From 7d535a97dc5baf37eb1466029f9d86f0b6cf66e0 Mon Sep 17 00:00:00 2001 From: kusano Date: Mar 23 2016 16:31:57 +0000 Subject: Add 3rd party libraries --- diff --git a/thirdparty/.gitignore b/thirdparty/.gitignore deleted file mode 100644 index 3f896cb..0000000 --- a/thirdparty/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -# preserve this empty directory -!.gitignore diff --git a/thirdparty/LibJPEG/README.txt b/thirdparty/LibJPEG/README.txt new file mode 100644 index 0000000..f662399 --- /dev/null +++ b/thirdparty/LibJPEG/README.txt @@ -0,0 +1,13 @@ + +WINDOWS: + +Per compilare LibJPEG, bisogna ricordarsi di creare il file +"jconfig.h" copiandolo da una delle varie versioni system-dependent. + +NON AGGIUNGERE IL SUDDETTO FILE AL DEPOT. + +MACOSX: + +Lancia build.sh e bon. + +Daniele \ No newline at end of file diff --git a/thirdparty/LibJPEG/clean.sh b/thirdparty/LibJPEG/clean.sh new file mode 100644 index 0000000..4bb5b1b --- /dev/null +++ b/thirdparty/LibJPEG/clean.sh @@ -0,0 +1,15 @@ +# This script erases all intermediate and system-dependent files, while +# retaining the built library. + +# The resulting folder can be submitted to version control. + + +cd jpeg-9 + +make clean +rm -rf .deps +rm -rf libs_x86_64 +rm -rf libs_i386 +rm -f *.a +rm -f *.dylib +rm -f jconfig.h \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/Makefile.am b/thirdparty/LibJPEG/jpeg-9/Makefile.am new file mode 100644 index 0000000..86895a1 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/Makefile.am @@ -0,0 +1,134 @@ +## Process this file with automake to produce Makefile.in +# +# Automake Makefile for the JPEG library +# +# This file is written by Bob Friesenhahn, Guido Vollbeding +# + +# Sources to build library +LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c + +# System dependent sources +SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c + +# Headers which are installed to support the library +INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h + +# Headers which are not installed +OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \ + jversion.h transupp.h + +# Manual pages (Automake uses 'MANS' for itself) +DISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 + +# Other documentation files +DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \ + structure.txt coderules.txt filelist.txt change.log + +# Makefiles for various systems +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt + +# Configuration files +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms + +# Support scripts for configure +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib + +# Miscellaneous support files +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map + +# Test support files +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg + +# libtool libraries to build +lib_LTLIBRARIES = libjpeg.la + +# Library sources for libjpeg.la +libjpeg_la_SOURCES = $(LIBSOURCES) + +# LDFLAGS for libjpeg.la +libjpeg_la_LDFLAGS = -no-undefined \ + -version-info $(JPEG_LIB_VERSION) + +if HAVE_LD_VERSION_SCRIPT + libjpeg_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libjpeg.map +endif + +# Executables to build +bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom + +# Executable sources & libs +cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \ + rdswitch.c cdjpeg.c +cjpeg_LDADD = libjpeg.la +djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \ + rdcolmap.c cdjpeg.c +djpeg_LDADD = libjpeg.la +jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c +jpegtran_LDADD = libjpeg.la +rdjpgcom_SOURCES = rdjpgcom.c +wrjpgcom_SOURCES = wrjpgcom.c + +# Manual pages to install +man_MANS = $(DISTMANS) + +# Headers to install +include_HEADERS = $(INSTINCLUDES) + +# Other distributed headers +noinst_HEADERS = $(OTHERINCLUDES) + +# Other distributed files +EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \ + $(OTHERFILES) $(TESTFILES) + +# Files to be cleaned +CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \ + testoutt.jpg + +# Install jconfig.h +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(includedir) + $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h + +# Uninstall jconfig.h +uninstall-local: + rm -f $(DESTDIR)$(includedir)/jconfig.h + +# Run tests +test: check-local +check-local: + rm -f testout* + ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg + ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg + ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm + ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg + ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm + ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg + cmp $(srcdir)/testimg.ppm testout.ppm + cmp $(srcdir)/testimg.bmp testout.bmp + cmp $(srcdir)/testimg.jpg testout.jpg + cmp $(srcdir)/testimg.ppm testoutp.ppm + cmp $(srcdir)/testimgp.jpg testoutp.jpg + cmp $(srcdir)/testorig.jpg testoutt.jpg diff --git a/thirdparty/LibJPEG/jpeg-9/Makefile.in b/thirdparty/LibJPEG/jpeg-9/Makefile.in new file mode 100644 index 0000000..d9a3664 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/Makefile.in @@ -0,0 +1,995 @@ +# Makefile.in generated by automake 1.13.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Automake Makefile for the JPEG library +# +# This file is written by Bob Friesenhahn, Guido Vollbeding +# + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=$(srcdir)/libjpeg.map +bin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \ + rdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/jconfig.cfg depcomp $(include_HEADERS) \ + $(noinst_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = jconfig.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libjpeg_la_LIBADD = +am__objects_1 = jaricom.lo jcapimin.lo jcapistd.lo jcarith.lo \ + jccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \ + jcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \ + jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo jdapistd.lo \ + jdarith.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \ + jddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \ + jdmaster.lo jdmerge.lo jdpostct.lo jdsample.lo jdtrans.lo \ + jerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo jidctflt.lo \ + jidctfst.lo jidctint.lo jquant1.lo jquant2.lo jutils.lo \ + jmemmgr.lo @MEMORYMGR@.lo +am_libjpeg_la_OBJECTS = $(am__objects_1) +libjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(bin_PROGRAMS) +am_cjpeg_OBJECTS = cjpeg.$(OBJEXT) rdppm.$(OBJEXT) rdgif.$(OBJEXT) \ + rdtarga.$(OBJEXT) rdrle.$(OBJEXT) rdbmp.$(OBJEXT) \ + rdswitch.$(OBJEXT) cdjpeg.$(OBJEXT) +cjpeg_OBJECTS = $(am_cjpeg_OBJECTS) +cjpeg_DEPENDENCIES = libjpeg.la +am_djpeg_OBJECTS = djpeg.$(OBJEXT) wrppm.$(OBJEXT) wrgif.$(OBJEXT) \ + wrtarga.$(OBJEXT) wrrle.$(OBJEXT) wrbmp.$(OBJEXT) \ + rdcolmap.$(OBJEXT) cdjpeg.$(OBJEXT) +djpeg_OBJECTS = $(am_djpeg_OBJECTS) +djpeg_DEPENDENCIES = libjpeg.la +am_jpegtran_OBJECTS = jpegtran.$(OBJEXT) rdswitch.$(OBJEXT) \ + cdjpeg.$(OBJEXT) transupp.$(OBJEXT) +jpegtran_OBJECTS = $(am_jpegtran_OBJECTS) +jpegtran_DEPENDENCIES = libjpeg.la +am_rdjpgcom_OBJECTS = rdjpgcom.$(OBJEXT) +rdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS) +rdjpgcom_LDADD = $(LDADD) +am_wrjpgcom_OBJECTS = wrjpgcom.$(OBJEXT) +wrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS) +wrjpgcom_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libjpeg_la_SOURCES) $(cjpeg_SOURCES) $(djpeg_SOURCES) \ + $(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(wrjpgcom_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +HEADERS = $(include_HEADERS) $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)jconfig.cfg +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JPEG_LIB_VERSION = @JPEG_LIB_VERSION@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEMORYMGR = @MEMORYMGR@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Sources to build library +LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c + + +# System dependent sources +SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c + +# Headers which are installed to support the library +INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h + +# Headers which are not installed +OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \ + jversion.h transupp.h + + +# Manual pages (Automake uses 'MANS' for itself) +DISTMANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 + +# Other documentation files +DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \ + structure.txt coderules.txt filelist.txt change.log + + +# Makefiles for various systems +MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt + + +# Configuration files +CONFIGFILES = jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms + + +# Support scripts for configure +CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib + + +# Miscellaneous support files +OTHERFILES = jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map + +# Test support files +TESTFILES = testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg + + +# libtool libraries to build +lib_LTLIBRARIES = libjpeg.la + +# Library sources for libjpeg.la +libjpeg_la_SOURCES = $(LIBSOURCES) + +# LDFLAGS for libjpeg.la +libjpeg_la_LDFLAGS = -no-undefined -version-info $(JPEG_LIB_VERSION) \ + $(am__append_1) + +# Executable sources & libs +cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \ + rdswitch.c cdjpeg.c + +cjpeg_LDADD = libjpeg.la +djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \ + rdcolmap.c cdjpeg.c + +djpeg_LDADD = libjpeg.la +jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c +jpegtran_LDADD = libjpeg.la +rdjpgcom_SOURCES = rdjpgcom.c +wrjpgcom_SOURCES = wrjpgcom.c + +# Manual pages to install +man_MANS = $(DISTMANS) + +# Headers to install +include_HEADERS = $(INSTINCLUDES) + +# Other distributed headers +noinst_HEADERS = $(OTHERINCLUDES) + +# Other distributed files +EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \ + $(OTHERFILES) $(TESTFILES) + + +# Files to be cleaned +CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \ + testoutt.jpg + +all: jconfig.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +jconfig.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/jconfig.cfg $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status jconfig.h +$(srcdir)/jconfig.cfg: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f jconfig.h stamp-h1 + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) + $(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) + @rm -f cjpeg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS) +djpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) $(EXTRA_djpeg_DEPENDENCIES) + @rm -f djpeg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS) +jpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) $(EXTRA_jpegtran_DEPENDENCIES) + @rm -f jpegtran$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS) +rdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) $(EXTRA_rdjpgcom_DEPENDENCIES) + @rm -f rdjpgcom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS) +wrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) $(EXTRA_wrjpgcom_DEPENDENCIES) + @rm -f wrjpgcom$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/@MEMORYMGR@.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdbmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdcolmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdgif.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdppm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdrle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdtarga.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrbmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrgif.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrppm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrrle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrtarga.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \ + jconfig.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-includeHEADERS install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-local uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: all check-am install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am \ + check-local clean clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool cscope cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-data-local install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-local uninstall-man \ + uninstall-man1 + + +# Install jconfig.h +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(includedir) + $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h + +# Uninstall jconfig.h +uninstall-local: + rm -f $(DESTDIR)$(includedir)/jconfig.h + +# Run tests +test: check-local +check-local: + rm -f testout* + ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg + ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg + ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm + ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg + ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm + ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg + cmp $(srcdir)/testimg.ppm testout.ppm + cmp $(srcdir)/testimg.bmp testout.bmp + cmp $(srcdir)/testimg.jpg testout.jpg + cmp $(srcdir)/testimg.ppm testoutp.ppm + cmp $(srcdir)/testimgp.jpg testoutp.jpg + cmp $(srcdir)/testorig.jpg testoutt.jpg + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibJPEG/jpeg-9/README b/thirdparty/LibJPEG/jpeg-9/README new file mode 100644 index 0000000..fc5ca5d --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/README @@ -0,0 +1,350 @@ +The Independent JPEG Group's JPEG software +========================================== + +README for release 9 of 13-Jan-2013 +=================================== + +This distribution contains the ninth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, +and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(also known as JPEG, together with ITU-T SG16). + + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +ACKNOWLEDGMENTS Special thanks. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + install.txt How to configure and install the IJG software. + usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.txt). + wizard.txt Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.txt How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.txt Overview of the JPEG library's internal structure. + filelist.txt Road map of IJG files. + coderules.txt Coding style rules --- please read if you contribute code. + +Please read at least the files install.txt and usage.txt. Some information +can also be found in the JPEG FAQ (Frequently Asked Questions) article. See +ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and gray-scale images. + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +We have made no provision for supporting the hierarchical or lossless +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PostScript file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/wallace.ps.gz. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). +Although this is by far the most detailed and comprehensive exposition of +JPEG publicly available, we point out that it is still missing an explanation +of the most essential properties and algorithms of the underlying DCT +technology. +If you think that you know about DCT-based JPEG after reading this book, +then you are in delusion. The real fundamentals and corresponding potential +of DCT-based JPEG are not publicly known so far, and that is the reason for +all the mistaken developments taking place in the image coding domain. + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. +IJG JPEG 8 introduced an implementation of the JPEG SmartScale extension +which is specified in two documents: A contributed document at ITU and ISO +with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced +Image Coding", April 2006, Geneva, Switzerland. The latest version of this +document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N +5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany. +IJG JPEG 9 introduces a reversible color transform for improved lossless +compression which is described in a contributed document ISO/IEC JTC1/SC29/ +WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris, +France. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report +and thus received a formal publication status. It is available as a free +download in PDF format from +http://www.ecma-international.org/publications/techreports/E-TR-098.htm. +A PostScript version of the JFIF document is available at +http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at +http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". This particular version will be archived as +http://www.ijg.org/files/jpegsrc.v9.tar.gz, and in Windows-compatible +"zip" archive format as http://www.ijg.org/files/jpegsr9.zip. + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + + +ACKNOWLEDGMENTS +=============== + +Thank to Juergen Bruder for providing me with a copy of the common DCT +algorithm article, only to find out that I had come to the same result +in a more direct and comprehensible way with a more generative approach. + +Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the +ITU JPEG (Study Group 16) meeting in Geneva, Switzerland. + +Thank to Thomas Wiegand and Gary Sullivan for inviting me to the +Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland. + +Thank to Thomas Richter and Daniel Lee for inviting me to the +ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16) +meeting in Berlin, Germany. + +Thank to John Korejwa and Massimo Ballerini for inviting me to +fruitful consultations in Boston, MA and Milan, Italy. + +Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther +Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel +for corresponding business development. + +Thank to Nico Zschach and Dirk Stelling of the technical support team +at the Digital Images company in Halle for providing me with extra +equipment for configuration tests. + +Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful +communication about JPEG configuration in Sigma Photo Pro software. + +Thank to Andrew Finkenstadt for hosting the ijg.org site. + +Last but not least special thank to Thomas G. Lane for the original +design and development of this singular software package. + + +FILE FORMAT WARS +================ + +The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together +with ITU-T SG16) currently promotes different formats containing the name +"JPEG" which is misleading because these formats are incompatible with +original DCT-based JPEG and are based on faulty technologies. +IJG therefore does not and will not support such momentary mistakes +(see REFERENCES). +There exist also distributions under the name "OpenJPEG" promoting such +kind of formats which is misleading because they don't support original +JPEG images. +We have no sympathy for the promotion of inferior formats. Indeed, one of +the original reasons for developing this free software was to help force +convergence on common, interoperable format standards for JPEG files. +Don't use an incompatible file format! +(In any case, our decoder will remain capable of reading existing JPEG +image files indefinitely.) + +Furthermore, the ISO committee pretends to be "responsible for the popular +JPEG" in their public reports which is not true because they don't respond to +actual requirements for the maintenance of the original JPEG specification. + +There are currently different distributions in circulation containing the +name "libjpeg" which is misleading because they don't have the features and +are incompatible with formats supported by actual IJG libjpeg distributions. +One of those fakes is released by members of the ISO committee and just uses +the name of libjpeg for misdirection of people, similar to the abuse of the +name JPEG as described above, while having nothing in common with actual IJG +libjpeg distributions. +The other one claims to be a "derivative" or "fork" of the original libjpeg +and violates the license conditions as described under LEGAL ISSUES above. +We have no sympathy for the release of misleading and illegal distributions +derived from obsolete code bases. +Don't use an obsolete code base! + + +TO DO +===== + +Version 9 is the second release of a new generation JPEG standard +to overcome the limitations of the original JPEG specification. +More features are being prepared for coming releases... + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. diff --git a/thirdparty/LibJPEG/jpeg-9/aclocal.m4 b/thirdparty/LibJPEG/jpeg-9/aclocal.m4 new file mode 100644 index 0000000..9f63e17 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/aclocal.m4 @@ -0,0 +1,9683 @@ +# generated automatically by aclocal 1.13.1 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.13' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.13.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.13.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + ]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of '-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/thirdparty/LibJPEG/jpeg-9/ar-lib b/thirdparty/LibJPEG/jpeg-9/ar-lib new file mode 100644 index 0000000..fe2301e --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/ar-lib @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# 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, see . + +# 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat < /* to declare isupper(), tolower() */ +#ifdef NEED_SIGNAL_CATCHER +#include /* to declare signal() */ +#endif +#ifdef USE_SETMODE +#include /* to declare setmode()'s parameter macros */ +/* If you have setmode() but not , just delete this line: */ +#include /* to declare setmode() */ +#endif + + +/* + * Signal catcher to ensure that temporary files are removed before aborting. + * NB: for Amiga Manx C this is actually a global routine named _abort(); + * we put "#define signal_catcher _abort" in jconfig.h. Talk about bogus... + */ + +#ifdef NEED_SIGNAL_CATCHER + +static j_common_ptr sig_cinfo; + +void /* must be global for Manx C */ +signal_catcher (int signum) +{ + if (sig_cinfo != NULL) { + if (sig_cinfo->err != NULL) /* turn off trace output */ + sig_cinfo->err->trace_level = 0; + jpeg_destroy(sig_cinfo); /* clean up memory allocation & temp files */ + } + exit(EXIT_FAILURE); +} + + +GLOBAL(void) +enable_signal_catcher (j_common_ptr cinfo) +{ + sig_cinfo = cinfo; +#ifdef SIGINT /* not all systems have SIGINT */ + signal(SIGINT, signal_catcher); +#endif +#ifdef SIGTERM /* not all systems have SIGTERM */ + signal(SIGTERM, signal_catcher); +#endif +} + +#endif + + +/* + * Optional progress monitor: display a percent-done figure on stderr. + */ + +#ifdef PROGRESS_REPORT + +METHODDEF(void) +progress_monitor (j_common_ptr cinfo) +{ + cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress; + int total_passes = prog->pub.total_passes + prog->total_extra_passes; + int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit); + + if (percent_done != prog->percent_done) { + prog->percent_done = percent_done; + if (total_passes > 1) { + fprintf(stderr, "\rPass %d/%d: %3d%% ", + prog->pub.completed_passes + prog->completed_extra_passes + 1, + total_passes, percent_done); + } else { + fprintf(stderr, "\r %3d%% ", percent_done); + } + fflush(stderr); + } +} + + +GLOBAL(void) +start_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress) +{ + /* Enable progress display, unless trace output is on */ + if (cinfo->err->trace_level == 0) { + progress->pub.progress_monitor = progress_monitor; + progress->completed_extra_passes = 0; + progress->total_extra_passes = 0; + progress->percent_done = -1; + cinfo->progress = &progress->pub; + } +} + + +GLOBAL(void) +end_progress_monitor (j_common_ptr cinfo) +{ + /* Clear away progress display */ + if (cinfo->err->trace_level == 0) { + fprintf(stderr, "\r \r"); + fflush(stderr); + } +} + +#endif + + +/* + * Case-insensitive matching of possibly-abbreviated keyword switches. + * keyword is the constant keyword (must be lower case already), + * minchars is length of minimum legal abbreviation. + */ + +GLOBAL(boolean) +keymatch (char * arg, const char * keyword, int minchars) +{ + register int ca, ck; + register int nmatched = 0; + + while ((ca = *arg++) != '\0') { + if ((ck = *keyword++) == '\0') + return FALSE; /* arg longer than keyword, no good */ + if (isupper(ca)) /* force arg to lcase (assume ck is already) */ + ca = tolower(ca); + if (ca != ck) + return FALSE; /* no good */ + nmatched++; /* count matched characters */ + } + /* reached end of argument; fail if it's too short for unique abbrev */ + if (nmatched < minchars) + return FALSE; + return TRUE; /* A-OK */ +} + + +/* + * Routines to establish binary I/O mode for stdin and stdout. + * Non-Unix systems often require some hacking to get out of text mode. + */ + +GLOBAL(FILE *) +read_stdin (void) +{ + FILE * input_file = stdin; + +#ifdef USE_SETMODE /* need to hack file mode? */ + setmode(fileno(stdin), O_BINARY); +#endif +#ifdef USE_FDOPEN /* need to re-open in binary mode? */ + if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) { + fprintf(stderr, "Cannot reopen stdin\n"); + exit(EXIT_FAILURE); + } +#endif + return input_file; +} + + +GLOBAL(FILE *) +write_stdout (void) +{ + FILE * output_file = stdout; + +#ifdef USE_SETMODE /* need to hack file mode? */ + setmode(fileno(stdout), O_BINARY); +#endif +#ifdef USE_FDOPEN /* need to re-open in binary mode? */ + if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) { + fprintf(stderr, "Cannot reopen stdout\n"); + exit(EXIT_FAILURE); + } +#endif + return output_file; +} diff --git a/thirdparty/LibJPEG/jpeg-9/cdjpeg.h b/thirdparty/LibJPEG/jpeg-9/cdjpeg.h new file mode 100644 index 0000000..ed024ac --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/cdjpeg.h @@ -0,0 +1,187 @@ +/* + * cdjpeg.h + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains common declarations for the sample applications + * cjpeg and djpeg. It is NOT used by the core JPEG library. + */ + +#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ +#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ +#include "jinclude.h" +#include "jpeglib.h" +#include "jerror.h" /* get library error codes too */ +#include "cderror.h" /* get application-specific error codes */ + + +/* + * Object interface for cjpeg's source file decoding modules + */ + +typedef struct cjpeg_source_struct * cjpeg_source_ptr; + +struct cjpeg_source_struct { + JMETHOD(void, start_input, (j_compress_ptr cinfo, + cjpeg_source_ptr sinfo)); + JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo, + cjpeg_source_ptr sinfo)); + JMETHOD(void, finish_input, (j_compress_ptr cinfo, + cjpeg_source_ptr sinfo)); + + FILE *input_file; + + JSAMPARRAY buffer; + JDIMENSION buffer_height; +}; + + +/* + * Object interface for djpeg's output file encoding modules + */ + +typedef struct djpeg_dest_struct * djpeg_dest_ptr; + +struct djpeg_dest_struct { + /* start_output is called after jpeg_start_decompress finishes. + * The color map will be ready at this time, if one is needed. + */ + JMETHOD(void, start_output, (j_decompress_ptr cinfo, + djpeg_dest_ptr dinfo)); + /* Emit the specified number of pixel rows from the buffer. */ + JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo, + djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied)); + /* Finish up at the end of the image. */ + JMETHOD(void, finish_output, (j_decompress_ptr cinfo, + djpeg_dest_ptr dinfo)); + + /* Target file spec; filled in by djpeg.c after object is created. */ + FILE * output_file; + + /* Output pixel-row buffer. Created by module init or start_output. + * Width is cinfo->output_width * cinfo->output_components; + * height is buffer_height. + */ + JSAMPARRAY buffer; + JDIMENSION buffer_height; +}; + + +/* + * cjpeg/djpeg may need to perform extra passes to convert to or from + * the source/destination file format. The JPEG library does not know + * about these passes, but we'd like them to be counted by the progress + * monitor. We use an expanded progress monitor object to hold the + * additional pass count. + */ + +struct cdjpeg_progress_mgr { + struct jpeg_progress_mgr pub; /* fields known to JPEG library */ + int completed_extra_passes; /* extra passes completed */ + int total_extra_passes; /* total extra */ + /* last printed percentage stored here to avoid multiple printouts */ + int percent_done; +}; + +typedef struct cdjpeg_progress_mgr * cd_progress_ptr; + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jinit_read_bmp jIRdBMP +#define jinit_write_bmp jIWrBMP +#define jinit_read_gif jIRdGIF +#define jinit_write_gif jIWrGIF +#define jinit_read_ppm jIRdPPM +#define jinit_write_ppm jIWrPPM +#define jinit_read_rle jIRdRLE +#define jinit_write_rle jIWrRLE +#define jinit_read_targa jIRdTarga +#define jinit_write_targa jIWrTarga +#define read_quant_tables RdQTables +#define read_scan_script RdScnScript +#define set_quality_ratings SetQRates +#define set_quant_slots SetQSlots +#define set_sample_factors SetSFacts +#define read_color_map RdCMap +#define enable_signal_catcher EnSigCatcher +#define start_progress_monitor StProgMon +#define end_progress_monitor EnProgMon +#define read_stdin RdStdin +#define write_stdout WrStdout +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Module selection routines for I/O modules. */ + +EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo)); +EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo, + boolean is_os2)); +EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo)); +EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo)); +EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo)); +EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo)); +EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo)); +EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo)); +EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo)); +EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo)); + +/* cjpeg support routines (in rdswitch.c) */ + +EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename, + boolean force_baseline)); +EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename)); +EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg, + boolean force_baseline)); +EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg)); +EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg)); + +/* djpeg support routines (in rdcolmap.c) */ + +EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile)); + +/* common support routines (in cdjpeg.c) */ + +EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo)); +EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo, + cd_progress_ptr progress)); +EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo)); +EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars)); +EXTERN(FILE *) read_stdin JPP((void)); +EXTERN(FILE *) write_stdout JPP((void)); + +/* miscellaneous useful macros */ + +#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ +#define READ_BINARY "r" +#define WRITE_BINARY "w" +#else +#ifdef VMS /* VMS is very nonstandard */ +#define READ_BINARY "rb", "ctx=stm" +#define WRITE_BINARY "wb", "ctx=stm" +#else /* standard ANSI-compliant case */ +#define READ_BINARY "rb" +#define WRITE_BINARY "wb" +#endif +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif +#ifndef EXIT_SUCCESS +#ifdef VMS +#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ +#else +#define EXIT_SUCCESS 0 +#endif +#endif +#ifndef EXIT_WARNING +#ifdef VMS +#define EXIT_WARNING 1 /* VMS is very nonstandard */ +#else +#define EXIT_WARNING 2 +#endif +#endif diff --git a/thirdparty/LibJPEG/jpeg-9/change.log b/thirdparty/LibJPEG/jpeg-9/change.log new file mode 100644 index 0000000..a1d94ff --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/change.log @@ -0,0 +1,382 @@ +CHANGE LOG for Independent JPEG Group's JPEG software + + +Version 9 13-Jan-2013 +---------------------- + +Add cjpeg -rgb1 option to create an RGB JPEG file, and insert +a simple reversible color transform into the processing which +significantly improves the compression. +The recommended command for lossless coding of RGB images is now +cjpeg -rgb1 -block 1 -arithmetic. +As said, this option improves the compression significantly, but +the files are not compatible with JPEG decoders prior to IJG v9 +due to the included color transform. +The used color transform and marker signaling is compatible with +other JPEG standards (e.g., JPEG-LS part 2). + +Remove the automatic de-ANSI-fication support (Automake 1.12). +Thank also to Nitin A Kamble for suggestion. + +Add remark for jpeg_mem_dest() in jdatadst.c. +Thank to Elie-Gregoire Khoury for the hint. + +Support files with invalid component identifiers (created +by Adobe PDF). Thank to Robin Watts for the suggestion. + +Adapt full buffer case in jcmainct.c for use with scaled DCT. +Thank to Sergii Biloshytskyi for the suggestion. + +Add type identifier for declaration of noreturn functions. +Thank to Brett L. Moore for the suggestion. + +Correct argument type in format string, avoid compiler warnings. +Thank to Vincent Torri for hint. + +Add missing #include directives in configuration checks, avoid +configuration errors. Thank to John Spencer for the hint. + + +Version 8d 15-Jan-2012 +----------------------- + +Add cjpeg -rgb option to create RGB JPEG files. +Using this switch suppresses the conversion from RGB +colorspace input to the default YCbCr JPEG colorspace. +This feature allows true lossless JPEG coding of RGB color images. +The recommended command for this purpose is currently +cjpeg -rgb -block 1 -arithmetic. +SmartScale capable decoder (introduced with IJG JPEG 8) required. +Thank to Michael Koch for the initial suggestion. + +Add option to disable the region adjustment in the transupp crop code. +Thank to Jeffrey Friedl for the suggestion. + +Thank to Richard Jones and Edd Dawson for various minor corrections. + +Thank to Akim Demaille for configure.ac cleanup. + + +Version 8c 16-Jan-2011 +----------------------- + +Add option to compression library and cjpeg (-block N) to use +different DCT block size. +All N from 1 to 16 are possible. Default is 8 (baseline format). +Larger values produce higher compression, +smaller values produce higher quality. +SmartScale capable decoder (introduced with IJG JPEG 8) required. + + +Version 8b 16-May-2010 +----------------------- + +Repair problem in new memory source manager with corrupt JPEG data. +Thank to Ted Campbell and Samuel Chun for the report. + +Repair problem in Makefile.am test target. +Thank to anonymous user for the report. + +Support MinGW installation with automatic configure. +Thank to Volker Grabsch for the suggestion. + + +Version 8a 28-Feb-2010 +----------------------- + +Writing tables-only datastreams via jpeg_write_tables works again. + +Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg. +Thank to Brett Blackham for the suggestion. + +Improve accuracy in floating point IDCT calculation. +Thank to Robert Hooke for the hint. + + +Version 8 10-Jan-2010 +---------------------- + +jpegtran now supports the same -scale option as djpeg for "lossless" resize. +An implementation of the JPEG SmartScale extension is required for this +feature. A (draft) specification of the JPEG SmartScale extension is +available as a contributed document at ITU and ISO. Revision 2 or later +of the document is required (latest document version is Revision 3). +The SmartScale extension will enable more features beside lossless resize +in future implementations, as described in the document (new compression +options). + +Add sanity check in BMP reader module to avoid cjpeg crash for empty input +image (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error). + +Add data source and destination managers for read from and write to +memory buffers. New API functions jpeg_mem_src and jpeg_mem_dest. +Thank to Roberto Boni from Italy for the suggestion. + + +Version 7 27-Jun-2009 +---------------------- + +New scaled DCTs implemented. +djpeg now supports scalings N/8 with all N from 1 to 16. +cjpeg now supports scalings 8/N with all N from 1 to 16. +Scaled DCTs with size larger than 8 are now also used for resolving the +common 2x2 chroma subsampling case without additional spatial resampling. +Separate spatial resampling for those kind of files is now only necessary +for N>8 scaling cases. +Furthermore, separate scaled DCT functions are provided for direct resolving +of the common asymmetric subsampling cases (2x1 and 1x2) without additional +spatial resampling. + +cjpeg -quality option has been extended for support of separate quality +settings for luminance and chrominance (or in general, for every provided +quantization table slot). +New API function jpeg_default_qtables() and q_scale_factor array in library. + +Added -nosmooth option to cjpeg, complementary to djpeg. +New variable "do_fancy_downsampling" in library, complement to fancy +upsampling. Fancy upsampling now uses direct DCT scaling with sizes +larger than 8. The old method is not reversible and has been removed. + +Support arithmetic entropy encoding and decoding. +Added files jaricom.c, jcarith.c, jdarith.c. + +Straighten the file structure: +Removed files jidctred.c, jcphuff.c, jchuff.h, jdphuff.c, jdhuff.h. + +jpegtran has a new "lossless" cropping feature. + +Implement -perfect option in jpegtran, new API function +jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch) + +Better error messages for jpegtran fopen failure. +(DP 203_jpegtran_errmsg.dpatch) + +Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c: +according to Netpbm, the de facto standard implementation of the PNM formats, +the most significant byte is first. (DP 203_rdppm.dpatch) + +Add -raw option to rdjpgcom not to mangle the output. +(DP 205_rdjpgcom_raw.dpatch) + +Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch) + +Add extern "C" to jpeglib.h. +This avoids the need to put extern "C" { ... } around #include "jpeglib.h" +in your C++ application. Defining the symbol DONT_USE_EXTERN_C in the +configuration prevents this. (DP 202_jpeglib.h_c++.dpatch) + + +Version 6b 27-Mar-1998 +----------------------- + +jpegtran has new features for lossless image transformations (rotation +and flipping) as well as "lossless" reduction to grayscale. + +jpegtran now copies comments by default; it has a -copy switch to enable +copying all APPn blocks as well, or to suppress comments. (Formerly it +always suppressed comments and APPn blocks.) jpegtran now also preserves +JFIF version and resolution information. + +New decompressor library feature: COM and APPn markers found in the input +file can be saved in memory for later use by the application. (Before, +you had to code this up yourself with a custom marker processor.) + +There is an unused field "void * client_data" now in compress and decompress +parameter structs; this may be useful in some applications. + +JFIF version number information is now saved by the decoder and accepted by +the encoder. jpegtran uses this to copy the source file's version number, +to ensure "jpegtran -copy all" won't create bogus files that contain JFXX +extensions but claim to be version 1.01. Applications that generate their +own JFXX extension markers also (finally) have a supported way to cause the +encoder to emit JFIF version number 1.02. + +djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather +than as unknown APP0 markers. + +In -verbose mode, djpeg and rdjpgcom will try to print the contents of +APP12 markers as text. Some digital cameras store useful text information +in APP12 markers. + +Handling of truncated data streams is more robust: blocks beyond the one in +which the error occurs will be output as uniform gray, or left unchanged +if decoding a progressive JPEG. The appearance no longer depends on the +Huffman tables being used. + +Huffman tables are checked for validity much more carefully than before. + +To avoid the Unisys LZW patent, djpeg's GIF output capability has been +changed to produce "uncompressed GIFs", and cjpeg's GIF input capability +has been removed altogether. We're not happy about it either, but there +seems to be no good alternative. + +The configure script now supports building libjpeg as a shared library +on many flavors of Unix (all the ones that GNU libtool knows how to +build shared libraries for). Use "./configure --enable-shared" to +try this out. + +New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio. +Also, a jconfig file and a build script for Metrowerks CodeWarrior +on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there +are miscellaneous other minor improvements in the makefiles. + +jmemmac.c now knows how to create temporary files following Mac System 7 +conventions. + +djpeg's -map switch is now able to read raw-format PPM files reliably. + +cjpeg -progressive -restart no longer generates any unnecessary DRI markers. + +Multiple calls to jpeg_simple_progression for a single JPEG object +no longer leak memory. + + +Version 6a 7-Feb-96 +-------------------- + +Library initialization sequence modified to detect version mismatches +and struct field packing mismatches between library and calling application. +This change requires applications to be recompiled, but does not require +any application source code change. + +All routine declarations changed to the style "GLOBAL(type) name ...", +that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the +routine's return type as an argument. This makes it possible to add +Microsoft-style linkage keywords to all the routines by changing just +these macros. Note that any application code that was using these macros +will have to be changed. + +DCT coefficient quantization tables are now stored in normal array order +rather than zigzag order. Application code that calls jpeg_add_quant_table, +or otherwise manipulates quantization tables directly, will need to be +changed. If you need to make such code work with either older or newer +versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is +recommended. + +djpeg's trace capability now dumps DQT tables in natural order, not zigzag +order. This allows the trace output to be made into a "-qtables" file +more easily. + +New system-dependent memory manager module for use on Apple Macintosh. + +Fix bug in cjpeg's -smooth option: last one or two scanlines would be +duplicates of the prior line unless the image height mod 16 was 1 or 2. + +Repair minor problems in VMS, BCC, MC6 makefiles. + +New configure script based on latest GNU Autoconf. + +Correct the list of include files needed by MetroWerks C for ccommand(). + +Numerous small documentation updates. + + +Version 6 2-Aug-95 +------------------- + +Progressive JPEG support: library can read and write full progressive JPEG +files. A "buffered image" mode supports incremental decoding for on-the-fly +display of progressive images. Simply recompiling an existing IJG-v5-based +decoder with v6 should allow it to read progressive files, though of course +without any special progressive display. + +New "jpegtran" application performs lossless transcoding between different +JPEG formats; primarily, it can be used to convert baseline to progressive +JPEG and vice versa. In support of jpegtran, the library now allows lossless +reading and writing of JPEG files as DCT coefficient arrays. This ability +may be of use in other applications. + +Notes for programmers: +* We changed jpeg_start_decompress() to be able to suspend; this makes all +decoding modes available to suspending-input applications. However, +existing applications that use suspending input will need to be changed +to check the return value from jpeg_start_decompress(). You don't need to +do anything if you don't use a suspending data source. +* We changed the interface to the virtual array routines: access_virt_array +routines now take a count of the number of rows to access this time. The +last parameter to request_virt_array routines is now interpreted as the +maximum number of rows that may be accessed at once, but not necessarily +the height of every access. + + +Version 5b 15-Mar-95 +--------------------- + +Correct bugs with grayscale images having v_samp_factor > 1. + +jpeg_write_raw_data() now supports output suspension. + +Correct bugs in "configure" script for case of compiling in +a directory other than the one containing the source files. + +Repair bug in jquant1.c: sometimes didn't use as many colors as it could. + +Borland C makefile and jconfig file work under either MS-DOS or OS/2. + +Miscellaneous improvements to documentation. + + +Version 5a 7-Dec-94 +-------------------- + +Changed color conversion roundoff behavior so that grayscale values are +represented exactly. (This causes test image files to change.) + +Make ordered dither use 16x16 instead of 4x4 pattern for a small quality +improvement. + +New configure script based on latest GNU Autoconf. +Fix configure script to handle CFLAGS correctly. +Rename *.auto files to *.cfg, so that configure script still works if +file names have been truncated for DOS. + +Fix bug in rdbmp.c: didn't allow for extra data between header and image. + +Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data. + +Fix several bugs in rdrle.c. + +NEED_SHORT_EXTERNAL_NAMES option was broken. + +Revise jerror.h/jerror.c for more flexibility in message table. + +Repair oversight in jmemname.c NO_MKTEMP case: file could be there +but unreadable. + + +Version 5 24-Sep-94 +-------------------- + +Version 5 represents a nearly complete redesign and rewrite of the IJG +software. Major user-visible changes include: + * Automatic configuration simplifies installation for most Unix systems. + * A range of speed vs. image quality tradeoffs are supported. + This includes resizing of an image during decompression: scaling down + by a factor of 1/2, 1/4, or 1/8 is handled very efficiently. + * New programs rdjpgcom and wrjpgcom allow insertion and extraction + of text comments in a JPEG file. + +The application programmer's interface to the library has changed completely. +Notable improvements include: + * We have eliminated the use of callback routines for handling the + uncompressed image data. The application now sees the library as a + set of routines that it calls to read or write image data on a + scanline-by-scanline basis. + * The application image data is represented in a conventional interleaved- + pixel format, rather than as a separate array for each color channel. + This can save a copying step in many programs. + * The handling of compressed data has been cleaned up: the application can + supply routines to source or sink the compressed data. It is possible to + suspend processing on source/sink buffer overrun, although this is not + supported in all operating modes. + * All static state has been eliminated from the library, so that multiple + instances of compression or decompression can be active concurrently. + * JPEG abbreviated datastream formats are supported, ie, quantization and + Huffman tables can be stored separately from the image data. + * And not only that, but the documentation of the library has improved + considerably! + + +The last widely used release before the version 5 rewrite was version 4A of +18-Feb-93. Change logs before that point have been discarded, since they +are not of much interest after the rewrite. diff --git a/thirdparty/LibJPEG/jpeg-9/cjpeg.1 b/thirdparty/LibJPEG/jpeg-9/cjpeg.1 new file mode 100644 index 0000000..e0b8d43 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/cjpeg.1 @@ -0,0 +1,366 @@ +.TH CJPEG 1 "4 May 2012" +.SH NAME +cjpeg \- compress an image file to a JPEG file +.SH SYNOPSIS +.B cjpeg +[ +.I options +] +[ +.I filename +] +.LP +.SH DESCRIPTION +.LP +.B cjpeg +compresses the named image file, or the standard input if no file is +named, and produces a JPEG/JFIF file on the standard output. +The currently supported input file formats are: PPM (PBMPLUS color +format), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster +Toolkit format). (RLE is supported only if the URT library is available.) +.SH OPTIONS +All switch names may be abbreviated; for example, +.B \-grayscale +may be written +.B \-gray +or +.BR \-gr . +Most of the "basic" switches can be abbreviated to as little as one letter. +Upper and lower case are equivalent (thus +.B \-BMP +is the same as +.BR \-bmp ). +British spellings are also accepted (e.g., +.BR \-greyscale ), +though for brevity these are not mentioned below. +.PP +The basic switches are: +.TP +.BI \-quality " N[,...]" +Scale quantization tables to adjust image quality. Quality is 0 (worst) to +100 (best); default is 75. (See below for more info.) +.TP +.B \-grayscale +Create monochrome JPEG file from color input. Be sure to use this switch when +compressing a grayscale BMP file, because +.B cjpeg +isn't bright enough to notice whether a BMP file uses only shades of gray. +By saying +.BR \-grayscale , +you'll get a smaller JPEG file that takes less time to process. +.TP +.B \-rgb +Create RGB JPEG file. +Using this switch suppresses the conversion from RGB +colorspace input to the default YCbCr JPEG colorspace. +You can use this switch in combination with the +.BI \-block " N" +switch (see below) for lossless JPEG coding. +See also the +.B \-rgb1 +switch below. +.TP +.B \-optimize +Perform optimization of entropy encoding parameters. Without this, default +encoding parameters are used. +.B \-optimize +usually makes the JPEG file a little smaller, but +.B cjpeg +runs somewhat slower and needs much more memory. Image quality and speed of +decompression are unaffected by +.BR \-optimize . +.TP +.B \-progressive +Create progressive JPEG file (see below). +.TP +.BI \-scale " M/N" +Scale the output image by a factor M/N. Currently supported scale factors are +M/N with all N from 1 to 16, where M is the destination DCT size, which is 8 +by default (see +.BI \-block " N" +switch below). +.TP +.B \-targa +Input file is Targa format. Targa files that contain an "identification" +field will not be automatically recognized by +.BR cjpeg ; +for such files you must specify +.B \-targa +to make +.B cjpeg +treat the input as Targa format. +For most Targa files, you won't need this switch. +.PP +The +.B \-quality +switch lets you trade off compressed file size against quality of the +reconstructed image: the higher the quality setting, the larger the JPEG file, +and the closer the output image will be to the original input. Normally you +want to use the lowest quality setting (smallest file) that decompresses into +something visually indistinguishable from the original image. For this +purpose the quality setting should be between 50 and 95; the default of 75 is +often about right. If you see defects at +.B \-quality +75, then go up 5 or 10 counts at a time until you are happy with the output +image. (The optimal setting will vary from one image to another.) +.PP +.B \-quality +100 will generate a quantization table of all 1's, minimizing loss in the +quantization step (but there is still information loss in subsampling, as well +as roundoff error). This setting is mainly of interest for experimental +purposes. Quality values above about 95 are +.B not +recommended for normal use; the compressed file size goes up dramatically for +hardly any gain in output image quality. +.PP +In the other direction, quality values below 50 will produce very small files +of low image quality. Settings around 5 to 10 might be useful in preparing an +index of a large image library, for example. Try +.B \-quality +2 (or so) for some amusing Cubist effects. (Note: quality +values below about 25 generate 2-byte quantization tables, which are +considered optional in the JPEG standard. +.B cjpeg +emits a warning message when you give such a quality value, because some +other JPEG programs may be unable to decode the resulting file. Use +.B \-baseline +if you need to ensure compatibility at low quality values.) +.PP +The +.B \-quality +option has been extended in IJG version 7 for support of separate quality +settings for luminance and chrominance (or in general, for every provided +quantization table slot). This feature is useful for high-quality +applications which cannot accept the damage of color data by coarse +subsampling settings. You can now easily reduce the color data amount more +smoothly with finer control without separate subsampling. The resulting file +is fully compliant with standard JPEG decoders. +Note that the +.B \-quality +ratings refer to the quantization table slots, and that the last value is +replicated if there are more q-table slots than parameters. The default +q-table slots are 0 for luminance and 1 for chrominance with default tables as +given in the JPEG standard. This is compatible with the old behaviour in case +that only one parameter is given, which is then used for both luminance and +chrominance (slots 0 and 1). More or custom quantization tables can be set +with +.B \-qtables +and assigned to components with +.B \-qslots +parameter (see the "wizard" switches below). +.B Caution: +You must explicitly add +.BI \-sample " 1x1" +for efficient separate color +quality selection, since the default value used by library is 2x2! +.PP +The +.B \-progressive +switch creates a "progressive JPEG" file. In this type of JPEG file, the data +is stored in multiple scans of increasing quality. If the file is being +transmitted over a slow communications link, the decoder can use the first +scan to display a low-quality image very quickly, and can then improve the +display with each subsequent scan. The final image is exactly equivalent to a +standard JPEG file of the same quality setting, and the total file size is +about the same --- often a little smaller. +.PP +Switches for advanced users: +.TP +.B \-arithmetic +Use arithmetic coding. +.B Caution: +arithmetic coded JPEG is not yet widely implemented, so many decoders will +be unable to view an arithmetic coded JPEG file at all. +.TP +.BI \-block " N" +Set DCT block size. All N from 1 to 16 are possible. +Default is 8 (baseline format). +Larger values produce higher compression, +smaller values produce higher quality +(exact DCT stage possible with 1 or 2; with the default quality of 75 and +default Luminance qtable the DCT+Quantization stage is lossless for N=1). +.B Caution: +An implementation of the JPEG SmartScale extension is required for this +feature. SmartScale enabled JPEG is not yet widely implemented, so many +decoders will be unable to view a SmartScale extended JPEG file at all. +.TP +.B \-rgb1 +Create RGB JPEG file with reversible color transform. +Works like the +.B \-rgb +switch (see above) and inserts a simple reversible color transform +into the processing which significantly improves the compression. +Use this switch in combination with the +.BI \-block " N" +switch (see above) for lossless JPEG coding. +.B Caution: +A decoder with inverse color transform support is required for +this feature. Reversible color transform support is not yet +widely implemented, so many decoders will be unable to view +a reversible color transformed JPEG file at all. +.TP +.B \-dct int +Use integer DCT method (default). +.TP +.B \-dct fast +Use fast integer DCT (less accurate). +.TP +.B \-dct float +Use floating-point DCT method. +The float method is very slightly more accurate than the int method, but is +much slower unless your machine has very fast floating-point hardware. Also +note that results of the floating-point method may vary slightly across +machines, while the integer methods should give the same results everywhere. +The fast integer method is much less accurate than the other two. +.TP +.B \-nosmooth +Don't use high-quality downsampling. +.TP +.BI \-restart " N" +Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is +attached to the number. +.B \-restart 0 +(the default) means no restart markers. +.TP +.BI \-smooth " N" +Smooth the input image to eliminate dithering noise. N, ranging from 1 to +100, indicates the strength of smoothing. 0 (the default) means no smoothing. +.TP +.BI \-maxmemory " N" +Set limit for amount of memory to use in processing large images. Value is +in thousands of bytes, or millions of bytes if "M" is attached to the +number. For example, +.B \-max 4m +selects 4000000 bytes. If more space is needed, temporary files will be used. +.TP +.BI \-outfile " name" +Send output image to the named file, not to standard output. +.TP +.B \-verbose +Enable debug printout. More +.BR \-v 's +give more output. Also, version information is printed at startup. +.TP +.B \-debug +Same as +.BR \-verbose . +.PP +The +.B \-restart +option inserts extra markers that allow a JPEG decoder to resynchronize after +a transmission error. Without restart markers, any damage to a compressed +file will usually ruin the image from the point of the error to the end of the +image; with restart markers, the damage is usually confined to the portion of +the image up to the next restart marker. Of course, the restart markers +occupy extra space. We recommend +.B \-restart 1 +for images that will be transmitted across unreliable networks such as Usenet. +.PP +The +.B \-smooth +option filters the input to eliminate fine-scale noise. This is often useful +when converting dithered images to JPEG: a moderate smoothing factor of 10 to +50 gets rid of dithering patterns in the input file, resulting in a smaller +JPEG file and a better-looking image. Too large a smoothing factor will +visibly blur the image, however. +.PP +Switches for wizards: +.TP +.B \-baseline +Force baseline-compatible quantization tables to be generated. This clamps +quantization values to 8 bits even at low quality settings. (This switch is +poorly named, since it does not ensure that the output is actually baseline +JPEG. For example, you can use +.B \-baseline +and +.B \-progressive +together.) +.TP +.BI \-qtables " file" +Use the quantization tables given in the specified text file. +.TP +.BI \-qslots " N[,...]" +Select which quantization table to use for each color component. +.TP +.BI \-sample " HxV[,...]" +Set JPEG sampling factors for each color component. +.TP +.BI \-scans " file" +Use the scan script given in the specified text file. +.PP +The "wizard" switches are intended for experimentation with JPEG. If you +don't know what you are doing, \fBdon't use them\fR. These switches are +documented further in the file wizard.txt. +.SH EXAMPLES +.LP +This example compresses the PPM file foo.ppm with a quality factor of +60 and saves the output as foo.jpg: +.IP +.B cjpeg \-quality +.I 60 foo.ppm +.B > +.I foo.jpg +.SH HINTS +Color GIF files are not the ideal input for JPEG; JPEG is really intended for +compressing full-color (24-bit) images. In particular, don't try to convert +cartoons, line drawings, and other images that have only a few distinct +colors. GIF works great on these, JPEG does not. If you want to convert a +GIF to JPEG, you should experiment with +.BR cjpeg 's +.B \-quality +and +.B \-smooth +options to get a satisfactory conversion. +.B \-smooth 10 +or so is often helpful. +.PP +Avoid running an image through a series of JPEG compression/decompression +cycles. Image quality loss will accumulate; after ten or so cycles the image +may be noticeably worse than it was after one cycle. It's best to use a +lossless format while manipulating an image, then convert to JPEG format when +you are ready to file the image away. +.PP +The +.B \-optimize +option to +.B cjpeg +is worth using when you are making a "final" version for posting or archiving. +It's also a win when you are using low quality settings to make very small +JPEG files; the percentage improvement is often a lot more than it is on +larger files. (At present, +.B \-optimize +mode is always selected when generating progressive JPEG files.) +.SH ENVIRONMENT +.TP +.B JPEGMEM +If this environment variable is set, its value is the default memory limit. +The value is specified as described for the +.B \-maxmemory +switch. +.B JPEGMEM +overrides the default value specified when the program was compiled, and +itself is overridden by an explicit +.BR \-maxmemory . +.SH SEE ALSO +.BR djpeg (1), +.BR jpegtran (1), +.BR rdjpgcom (1), +.BR wrjpgcom (1) +.br +.BR ppm (5), +.BR pgm (5) +.br +Wallace, Gregory K. "The JPEG Still Picture Compression Standard", +Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. +.SH AUTHOR +Independent JPEG Group +.SH BUGS +GIF input files are no longer supported, to avoid the Unisys LZW patent. +(Conversion of GIF files to JPEG is usually a bad idea anyway.) +.PP +Not all variants of BMP and Targa file formats are supported. +.PP +The +.B \-targa +switch is not a bug, it's a feature. (It would be a bug if the Targa format +designers had not been clueless.) diff --git a/thirdparty/LibJPEG/jpeg-9/cjpeg.c b/thirdparty/LibJPEG/jpeg-9/cjpeg.c new file mode 100644 index 0000000..d05cdd0 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/cjpeg.c @@ -0,0 +1,652 @@ +/* + * cjpeg.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2003-2013 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a command-line user interface for the JPEG compressor. + * It should work on any system with Unix- or MS-DOS-style command lines. + * + * Two different command line styles are permitted, depending on the + * compile-time switch TWO_FILE_COMMANDLINE: + * cjpeg [options] inputfile outputfile + * cjpeg [options] [inputfile] + * In the second style, output is always to standard output, which you'd + * normally redirect to a file or pipe to some other program. Input is + * either from a named file or from standard input (typically redirected). + * The second style is convenient on Unix but is unhelpful on systems that + * don't support pipes. Also, you MUST use the first style if your system + * doesn't do binary I/O to stdin/stdout. + * To simplify script writing, the "-outfile" switch is provided. The syntax + * cjpeg [options] -outfile outputfile inputfile + * works regardless of which command line style is used. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ +#include "jversion.h" /* for version message */ + +#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ +#ifdef __MWERKS__ +#include /* Metrowerks needs this */ +#include /* ... and this */ +#endif +#ifdef THINK_C +#include /* Think declares it here */ +#endif +#endif + + +/* Create the add-on message string table. */ + +#define JMESSAGE(code,string) string , + +static const char * const cdjpeg_message_table[] = { +#include "cderror.h" + NULL +}; + + +/* + * This routine determines what format the input file is, + * and selects the appropriate input-reading module. + * + * To determine which family of input formats the file belongs to, + * we may look only at the first byte of the file, since C does not + * guarantee that more than one character can be pushed back with ungetc. + * Looking at additional bytes would require one of these approaches: + * 1) assume we can fseek() the input file (fails for piped input); + * 2) assume we can push back more than one character (works in + * some C implementations, but unportable); + * 3) provide our own buffering (breaks input readers that want to use + * stdio directly, such as the RLE library); + * or 4) don't put back the data, and modify the input_init methods to assume + * they start reading after the start of file (also breaks RLE library). + * #1 is attractive for MS-DOS but is untenable on Unix. + * + * The most portable solution for file types that can't be identified by their + * first byte is to make the user tell us what they are. This is also the + * only approach for "raw" file types that contain only arbitrary values. + * We presently apply this method for Targa files. Most of the time Targa + * files start with 0x00, so we recognize that case. Potentially, however, + * a Targa file could start with any byte value (byte 0 is the length of the + * seldom-used ID field), so we provide a switch to force Targa input mode. + */ + +static boolean is_targa; /* records user -targa switch */ + + +LOCAL(cjpeg_source_ptr) +select_file_type (j_compress_ptr cinfo, FILE * infile) +{ + int c; + + if (is_targa) { +#ifdef TARGA_SUPPORTED + return jinit_read_targa(cinfo); +#else + ERREXIT(cinfo, JERR_TGA_NOTCOMP); +#endif + } + + if ((c = getc(infile)) == EOF) + ERREXIT(cinfo, JERR_INPUT_EMPTY); + if (ungetc(c, infile) == EOF) + ERREXIT(cinfo, JERR_UNGETC_FAILED); + + switch (c) { +#ifdef BMP_SUPPORTED + case 'B': + return jinit_read_bmp(cinfo); +#endif +#ifdef GIF_SUPPORTED + case 'G': + return jinit_read_gif(cinfo); +#endif +#ifdef PPM_SUPPORTED + case 'P': + return jinit_read_ppm(cinfo); +#endif +#ifdef RLE_SUPPORTED + case 'R': + return jinit_read_rle(cinfo); +#endif +#ifdef TARGA_SUPPORTED + case 0x00: + return jinit_read_targa(cinfo); +#endif + default: + ERREXIT(cinfo, JERR_UNKNOWN_FORMAT); + break; + } + + return NULL; /* suppress compiler warnings */ +} + + +/* + * Argument-parsing code. + * The switch parser is designed to be useful with DOS-style command line + * syntax, ie, intermixed switches and file names, where only the switches + * to the left of a given file name affect processing of that file. + * The main program in this file doesn't actually use this capability... + */ + + +static const char * progname; /* program name for error messages */ +static char * outfilename; /* for -outfile switch */ + + +LOCAL(void) +usage (void) +/* complain about bad command line */ +{ + fprintf(stderr, "usage: %s [switches] ", progname); +#ifdef TWO_FILE_COMMANDLINE + fprintf(stderr, "inputfile outputfile\n"); +#else + fprintf(stderr, "[inputfile]\n"); +#endif + + fprintf(stderr, "Switches (names may be abbreviated):\n"); + fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n"); + fprintf(stderr, " -grayscale Create monochrome JPEG file\n"); + fprintf(stderr, " -rgb Create RGB JPEG file\n"); +#ifdef ENTROPY_OPT_SUPPORTED + fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n"); +#endif +#ifdef C_PROGRESSIVE_SUPPORTED + fprintf(stderr, " -progressive Create progressive JPEG file\n"); +#endif +#ifdef DCT_SCALING_SUPPORTED + fprintf(stderr, " -scale M/N Scale image by fraction M/N, eg, 1/2\n"); +#endif +#ifdef TARGA_SUPPORTED + fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n"); +#endif + fprintf(stderr, "Switches for advanced users:\n"); +#ifdef C_ARITH_CODING_SUPPORTED + fprintf(stderr, " -arithmetic Use arithmetic coding\n"); +#endif +#ifdef DCT_SCALING_SUPPORTED + fprintf(stderr, " -block N DCT block size (1..16; default is 8)\n"); +#endif +#if JPEG_LIB_VERSION_MAJOR >= 9 + fprintf(stderr, " -rgb1 Create RGB JPEG file with reversible color transform\n"); +#endif +#ifdef DCT_ISLOW_SUPPORTED + fprintf(stderr, " -dct int Use integer DCT method%s\n", + (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); +#endif +#ifdef DCT_IFAST_SUPPORTED + fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n", + (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : "")); +#endif +#ifdef DCT_FLOAT_SUPPORTED + fprintf(stderr, " -dct float Use floating-point DCT method%s\n", + (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : "")); +#endif + fprintf(stderr, " -nosmooth Don't use high-quality downsampling\n"); + fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n"); +#ifdef INPUT_SMOOTHING_SUPPORTED + fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)\n"); +#endif + fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); + fprintf(stderr, " -outfile name Specify name for output file\n"); + fprintf(stderr, " -verbose or -debug Emit debug output\n"); + fprintf(stderr, "Switches for wizards:\n"); + fprintf(stderr, " -baseline Force baseline quantization tables\n"); + fprintf(stderr, " -qtables file Use quantization tables given in file\n"); + fprintf(stderr, " -qslots N[,...] Set component quantization tables\n"); + fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n"); +#ifdef C_MULTISCAN_FILES_SUPPORTED + fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); +#endif + exit(EXIT_FAILURE); +} + + +LOCAL(int) +parse_switches (j_compress_ptr cinfo, int argc, char **argv, + int last_file_arg_seen, boolean for_real) +/* Parse optional switches. + * Returns argv[] index of first file-name argument (== argc if none). + * Any file names with indexes <= last_file_arg_seen are ignored; + * they have presumably been processed in a previous iteration. + * (Pass 0 for last_file_arg_seen on the first or only iteration.) + * for_real is FALSE on the first (dummy) pass; we may skip any expensive + * processing. + */ +{ + int argn; + char * arg; + boolean force_baseline; + boolean simple_progressive; + char * qualityarg = NULL; /* saves -quality parm if any */ + char * qtablefile = NULL; /* saves -qtables filename if any */ + char * qslotsarg = NULL; /* saves -qslots parm if any */ + char * samplearg = NULL; /* saves -sample parm if any */ + char * scansarg = NULL; /* saves -scans parm if any */ + + /* Set up default JPEG parameters. */ + + force_baseline = FALSE; /* by default, allow 16-bit quantizers */ + simple_progressive = FALSE; + is_targa = FALSE; + outfilename = NULL; + cinfo->err->trace_level = 0; + + /* Scan command line options, adjust parameters */ + + for (argn = 1; argn < argc; argn++) { + arg = argv[argn]; + if (*arg != '-') { + /* Not a switch, must be a file name argument */ + if (argn <= last_file_arg_seen) { + outfilename = NULL; /* -outfile applies to just one input file */ + continue; /* ignore this name if previously processed */ + } + break; /* else done parsing switches */ + } + arg++; /* advance past switch marker character */ + + if (keymatch(arg, "arithmetic", 1)) { + /* Use arithmetic coding. */ +#ifdef C_ARITH_CODING_SUPPORTED + cinfo->arith_code = TRUE; +#else + fprintf(stderr, "%s: sorry, arithmetic coding not supported\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "baseline", 2)) { + /* Force baseline-compatible output (8-bit quantizer values). */ + force_baseline = TRUE; + + } else if (keymatch(arg, "block", 2)) { + /* Set DCT block size. */ +#if defined DCT_SCALING_SUPPORTED && JPEG_LIB_VERSION_MAJOR >= 8 && \ + (JPEG_LIB_VERSION_MAJOR > 8 || JPEG_LIB_VERSION_MINOR >= 3) + int val; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%d", &val) != 1) + usage(); + if (val < 1 || val > 16) + usage(); + cinfo->block_size = val; +#else + fprintf(stderr, "%s: sorry, block size setting not supported\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "dct", 2)) { + /* Select DCT algorithm. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "int", 1)) { + cinfo->dct_method = JDCT_ISLOW; + } else if (keymatch(argv[argn], "fast", 2)) { + cinfo->dct_method = JDCT_IFAST; + } else if (keymatch(argv[argn], "float", 2)) { + cinfo->dct_method = JDCT_FLOAT; + } else + usage(); + + } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { + /* Enable debug printouts. */ + /* On first -d, print version identification */ + static boolean printed_version = FALSE; + + if (! printed_version) { + fprintf(stderr, "Independent JPEG Group's CJPEG, version %s\n%s\n", + JVERSION, JCOPYRIGHT); + printed_version = TRUE; + } + cinfo->err->trace_level++; + + } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { + /* Force a monochrome JPEG file to be generated. */ + jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + + } else if (keymatch(arg, "rgb", 3) || keymatch(arg, "rgb1", 4)) { + /* Force an RGB JPEG file to be generated. */ +#if JPEG_LIB_VERSION_MAJOR >= 9 + /* Note: Entropy table assignment in jpeg_set_colorspace depends + * on color_transform. + */ + cinfo->color_transform = arg[3] ? JCT_SUBTRACT_GREEN : JCT_NONE; +#endif + jpeg_set_colorspace(cinfo, JCS_RGB); + + } else if (keymatch(arg, "maxmemory", 3)) { + /* Maximum memory in Kb (or Mb with 'm'). */ + long lval; + char ch = 'x'; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) + usage(); + if (ch == 'm' || ch == 'M') + lval *= 1000L; + cinfo->mem->max_memory_to_use = lval * 1000L; + + } else if (keymatch(arg, "nosmooth", 3)) { + /* Suppress fancy downsampling. */ + cinfo->do_fancy_downsampling = FALSE; + + } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) { + /* Enable entropy parm optimization. */ +#ifdef ENTROPY_OPT_SUPPORTED + cinfo->optimize_coding = TRUE; +#else + fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "outfile", 4)) { + /* Set output file name. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + outfilename = argv[argn]; /* save it away for later use */ + + } else if (keymatch(arg, "progressive", 1)) { + /* Select simple progressive mode. */ +#ifdef C_PROGRESSIVE_SUPPORTED + simple_progressive = TRUE; + /* We must postpone execution until num_components is known. */ +#else + fprintf(stderr, "%s: sorry, progressive output was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "quality", 1)) { + /* Quality ratings (quantization table scaling factors). */ + if (++argn >= argc) /* advance to next argument */ + usage(); + qualityarg = argv[argn]; + + } else if (keymatch(arg, "qslots", 2)) { + /* Quantization table slot numbers. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + qslotsarg = argv[argn]; + /* Must delay setting qslots until after we have processed any + * colorspace-determining switches, since jpeg_set_colorspace sets + * default quant table numbers. + */ + + } else if (keymatch(arg, "qtables", 2)) { + /* Quantization tables fetched from file. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + qtablefile = argv[argn]; + /* We postpone actually reading the file in case -quality comes later. */ + + } else if (keymatch(arg, "restart", 1)) { + /* Restart interval in MCU rows (or in MCUs with 'b'). */ + long lval; + char ch = 'x'; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) + usage(); + if (lval < 0 || lval > 65535L) + usage(); + if (ch == 'b' || ch == 'B') { + cinfo->restart_interval = (unsigned int) lval; + cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */ + } else { + cinfo->restart_in_rows = (int) lval; + /* restart_interval will be computed during startup */ + } + + } else if (keymatch(arg, "sample", 2)) { + /* Set sampling factors. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + samplearg = argv[argn]; + /* Must delay setting sample factors until after we have processed any + * colorspace-determining switches, since jpeg_set_colorspace sets + * default sampling factors. + */ + + } else if (keymatch(arg, "scale", 4)) { + /* Scale the image by a fraction M/N. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%u/%u", + &cinfo->scale_num, &cinfo->scale_denom) != 2) + usage(); + + } else if (keymatch(arg, "scans", 4)) { + /* Set scan script. */ +#ifdef C_MULTISCAN_FILES_SUPPORTED + if (++argn >= argc) /* advance to next argument */ + usage(); + scansarg = argv[argn]; + /* We must postpone reading the file in case -progressive appears. */ +#else + fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "smooth", 2)) { + /* Set input smoothing factor. */ + int val; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%d", &val) != 1) + usage(); + if (val < 0 || val > 100) + usage(); + cinfo->smoothing_factor = val; + + } else if (keymatch(arg, "targa", 1)) { + /* Input file is Targa format. */ + is_targa = TRUE; + + } else { + usage(); /* bogus switch */ + } + } + + /* Post-switch-scanning cleanup */ + + if (for_real) { + + /* Set quantization tables for selected quality. */ + /* Some or all may be overridden if -qtables is present. */ + if (qualityarg != NULL) /* process -quality if it was present */ + if (! set_quality_ratings(cinfo, qualityarg, force_baseline)) + usage(); + + if (qtablefile != NULL) /* process -qtables if it was present */ + if (! read_quant_tables(cinfo, qtablefile, force_baseline)) + usage(); + + if (qslotsarg != NULL) /* process -qslots if it was present */ + if (! set_quant_slots(cinfo, qslotsarg)) + usage(); + + if (samplearg != NULL) /* process -sample if it was present */ + if (! set_sample_factors(cinfo, samplearg)) + usage(); + +#ifdef C_PROGRESSIVE_SUPPORTED + if (simple_progressive) /* process -progressive; -scans can override */ + jpeg_simple_progression(cinfo); +#endif + +#ifdef C_MULTISCAN_FILES_SUPPORTED + if (scansarg != NULL) /* process -scans if it was present */ + if (! read_scan_script(cinfo, scansarg)) + usage(); +#endif + } + + return argn; /* return index of next arg (file name) */ +} + + +/* + * The main program. + */ + +int +main (int argc, char **argv) +{ + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; +#ifdef PROGRESS_REPORT + struct cdjpeg_progress_mgr progress; +#endif + int file_index; + cjpeg_source_ptr src_mgr; + FILE * input_file; + FILE * output_file; + JDIMENSION num_scanlines; + + /* On Mac, fetch a command line. */ +#ifdef USE_CCOMMAND + argc = ccommand(&argv); +#endif + + progname = argv[0]; + if (progname == NULL || progname[0] == 0) + progname = "cjpeg"; /* in case C library doesn't provide it */ + + /* Initialize the JPEG compression object with default error handling. */ + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_compress(&cinfo); + /* Add some application-specific error messages (from cderror.h) */ + jerr.addon_message_table = cdjpeg_message_table; + jerr.first_addon_message = JMSG_FIRSTADDONCODE; + jerr.last_addon_message = JMSG_LASTADDONCODE; + + /* Now safe to enable signal catcher. */ +#ifdef NEED_SIGNAL_CATCHER + enable_signal_catcher((j_common_ptr) &cinfo); +#endif + + /* Initialize JPEG parameters. + * Much of this may be overridden later. + * In particular, we don't yet know the input file's color space, + * but we need to provide some value for jpeg_set_defaults() to work. + */ + + cinfo.in_color_space = JCS_RGB; /* arbitrary guess */ + jpeg_set_defaults(&cinfo); + + /* Scan command line to find file names. + * It is convenient to use just one switch-parsing routine, but the switch + * values read here are ignored; we will rescan the switches after opening + * the input file. + */ + + file_index = parse_switches(&cinfo, argc, argv, 0, FALSE); + +#ifdef TWO_FILE_COMMANDLINE + /* Must have either -outfile switch or explicit output file name */ + if (outfilename == NULL) { + if (file_index != argc-2) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + outfilename = argv[file_index+1]; + } else { + if (file_index != argc-1) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + } +#else + /* Unix style: expect zero or one file name */ + if (file_index < argc-1) { + fprintf(stderr, "%s: only one input file\n", progname); + usage(); + } +#endif /* TWO_FILE_COMMANDLINE */ + + /* Open the input file. */ + if (file_index < argc) { + if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]); + exit(EXIT_FAILURE); + } + } else { + /* default input file is stdin */ + input_file = read_stdin(); + } + + /* Open the output file. */ + if (outfilename != NULL) { + if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, outfilename); + exit(EXIT_FAILURE); + } + } else { + /* default output file is stdout */ + output_file = write_stdout(); + } + +#ifdef PROGRESS_REPORT + start_progress_monitor((j_common_ptr) &cinfo, &progress); +#endif + + /* Figure out the input file format, and set up to read it. */ + src_mgr = select_file_type(&cinfo, input_file); + src_mgr->input_file = input_file; + + /* Read the input file header to obtain file size & colorspace. */ + (*src_mgr->start_input) (&cinfo, src_mgr); + + /* Now that we know input colorspace, fix colorspace-dependent defaults */ + jpeg_default_colorspace(&cinfo); + + /* Adjust default compression parameters by re-parsing the options */ + file_index = parse_switches(&cinfo, argc, argv, 0, TRUE); + + /* Specify data destination for compression */ + jpeg_stdio_dest(&cinfo, output_file); + + /* Start compressor */ + jpeg_start_compress(&cinfo, TRUE); + + /* Process data */ + while (cinfo.next_scanline < cinfo.image_height) { + num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr); + (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines); + } + + /* Finish compression and release memory */ + (*src_mgr->finish_input) (&cinfo, src_mgr); + jpeg_finish_compress(&cinfo); + jpeg_destroy_compress(&cinfo); + + /* Close files, if we opened them */ + if (input_file != stdin) + fclose(input_file); + if (output_file != stdout) + fclose(output_file); + +#ifdef PROGRESS_REPORT + end_progress_monitor((j_common_ptr) &cinfo); +#endif + + /* All done. */ + exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); + return 0; /* suppress no-return-value warnings */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/ckconfig.c b/thirdparty/LibJPEG/jpeg-9/ckconfig.c new file mode 100644 index 0000000..e658623 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/ckconfig.c @@ -0,0 +1,402 @@ +/* + * ckconfig.c + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + */ + +/* + * This program is intended to help you determine how to configure the JPEG + * software for installation on a particular system. The idea is to try to + * compile and execute this program. If your compiler fails to compile the + * program, make changes as indicated in the comments below. Once you can + * compile the program, run it, and it will produce a "jconfig.h" file for + * your system. + * + * As a general rule, each time you try to compile this program, + * pay attention only to the *first* error message you get from the compiler. + * Many C compilers will issue lots of spurious error messages once they + * have gotten confused. Go to the line indicated in the first error message, + * and read the comments preceding that line to see what to change. + * + * Almost all of the edits you may need to make to this program consist of + * changing a line that reads "#define SOME_SYMBOL" to "#undef SOME_SYMBOL", + * or vice versa. This is called defining or undefining that symbol. + */ + + +/* First we must see if your system has the include files we need. + * We start out with the assumption that your system has all the ANSI-standard + * include files. If you get any error trying to include one of these files, + * undefine the corresponding HAVE_xxx symbol. + */ + +#define HAVE_STDDEF_H /* replace 'define' by 'undef' if error here */ +#ifdef HAVE_STDDEF_H /* next line will be skipped if you undef... */ +#include +#endif + +#define HAVE_STDLIB_H /* same thing for stdlib.h */ +#ifdef HAVE_STDLIB_H +#include +#endif + +#include /* If you ain't got this, you ain't got C. */ + +/* We have to see if your string functions are defined by + * strings.h (old BSD convention) or string.h (everybody else). + * We try the non-BSD convention first; define NEED_BSD_STRINGS + * if the compiler says it can't find string.h. + */ + +#undef NEED_BSD_STRINGS + +#ifdef NEED_BSD_STRINGS +#include +#else +#include +#endif + +/* On some systems (especially older Unix machines), type size_t is + * defined only in the include file . If you get a failure + * on the size_t test below, try defining NEED_SYS_TYPES_H. + */ + +#undef NEED_SYS_TYPES_H /* start by assuming we don't need it */ +#ifdef NEED_SYS_TYPES_H +#include +#endif + + +/* Usually type size_t is defined in one of the include files we've included + * above. If not, you'll get an error on the "typedef size_t my_size_t;" line. + * In that case, first try defining NEED_SYS_TYPES_H just above. + * If that doesn't work, you'll have to search through your system library + * to figure out which include file defines "size_t". Look for a line that + * says "typedef something-or-other size_t;". Then, change the line below + * that says "#include " to instead include the file + * you found size_t in, and define NEED_SPECIAL_INCLUDE. If you can't find + * type size_t anywhere, try replacing "#include " with + * "typedef unsigned int size_t;". + */ + +#undef NEED_SPECIAL_INCLUDE /* assume we DON'T need it, for starters */ + +#ifdef NEED_SPECIAL_INCLUDE +#include +#endif + +typedef size_t my_size_t; /* The payoff: do we have size_t now? */ + + +/* The next question is whether your compiler supports ANSI-style function + * prototypes. You need to know this in order to choose between using + * makefile.ansi and using makefile.unix. + * The #define line below is set to assume you have ANSI function prototypes. + * If you get an error in this group of lines, undefine HAVE_PROTOTYPES. + */ + +#define HAVE_PROTOTYPES + +#ifdef HAVE_PROTOTYPES +int testfunction (int arg1, int * arg2); /* check prototypes */ + +struct methods_struct { /* check method-pointer declarations */ + int (*error_exit) (char *msgtext); + int (*trace_message) (char *msgtext); + int (*another_method) (void); +}; + +int testfunction (int arg1, int * arg2) /* check definitions */ +{ + return arg2[arg1]; +} + +int test2function (void) /* check void arg list */ +{ + return 0; +} +#endif + + +/* Now we want to find out if your compiler knows what "unsigned char" means. + * If you get an error on the "unsigned char un_char;" line, + * then undefine HAVE_UNSIGNED_CHAR. + */ + +#define HAVE_UNSIGNED_CHAR + +#ifdef HAVE_UNSIGNED_CHAR +unsigned char un_char; +#endif + + +/* Now we want to find out if your compiler knows what "unsigned short" means. + * If you get an error on the "unsigned short un_short;" line, + * then undefine HAVE_UNSIGNED_SHORT. + */ + +#define HAVE_UNSIGNED_SHORT + +#ifdef HAVE_UNSIGNED_SHORT +unsigned short un_short; +#endif + + +/* Now we want to find out if your compiler understands type "void". + * If you get an error anywhere in here, undefine HAVE_VOID. + */ + +#define HAVE_VOID + +#ifdef HAVE_VOID +/* Caution: a C++ compiler will insist on complete prototypes */ +typedef void * void_ptr; /* check void * */ +#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */ +typedef void (*void_func) (int a, int b); +#else +typedef void (*void_func) (); +#endif + +#ifdef HAVE_PROTOTYPES /* check void function result */ +void test3function (void_ptr arg1, void_func arg2) +#else +void test3function (arg1, arg2) + void_ptr arg1; + void_func arg2; +#endif +{ + char * locptr = (char *) arg1; /* check casting to and from void * */ + arg1 = (void *) locptr; + (*arg2) (1, 2); /* check call of fcn returning void */ +} +#endif + + +/* Now we want to find out if your compiler knows what "const" means. + * If you get an error here, undefine HAVE_CONST. + */ + +#define HAVE_CONST + +#ifdef HAVE_CONST +static const int carray[3] = {1, 2, 3}; + +#ifdef HAVE_PROTOTYPES +int test4function (const int arg1) +#else +int test4function (arg1) + const int arg1; +#endif +{ + return carray[arg1]; +} +#endif + + +/* If you get an error or warning about this structure definition, + * define INCOMPLETE_TYPES_BROKEN. + */ + +#undef INCOMPLETE_TYPES_BROKEN + +#ifndef INCOMPLETE_TYPES_BROKEN +typedef struct undefined_structure * undef_struct_ptr; +#endif + + +/* If you get an error about duplicate names, + * define NEED_SHORT_EXTERNAL_NAMES. + */ + +#undef NEED_SHORT_EXTERNAL_NAMES + +#ifndef NEED_SHORT_EXTERNAL_NAMES + +int possibly_duplicate_function () +{ + return 0; +} + +int possibly_dupli_function () +{ + return 1; +} + +#endif + + + +/************************************************************************ + * OK, that's it. You should not have to change anything beyond this + * point in order to compile and execute this program. (You might get + * some warnings, but you can ignore them.) + * When you run the program, it will make a couple more tests that it + * can do automatically, and then it will create jconfig.h and print out + * any additional suggestions it has. + ************************************************************************ + */ + + +#ifdef HAVE_PROTOTYPES +int is_char_signed (int arg) +#else +int is_char_signed (arg) + int arg; +#endif +{ + if (arg == 189) { /* expected result for unsigned char */ + return 0; /* type char is unsigned */ + } + else if (arg != -67) { /* expected result for signed char */ + printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + } + return 1; /* assume char is signed otherwise */ +} + + +#ifdef HAVE_PROTOTYPES +int is_shifting_signed (long arg) +#else +int is_shifting_signed (arg) + long arg; +#endif +/* See whether right-shift on a long is signed or not. */ +{ + long res = arg >> 4; + + if (res == -0x7F7E80CL) { /* expected result for signed shift */ + return 1; /* right shift is signed */ + } + /* see if unsigned-shift hack will fix it. */ + /* we can't just test exact value since it depends on width of long... */ + res |= (~0L) << (32-4); + if (res == -0x7F7E80CL) { /* expected result now? */ + return 0; /* right shift is unsigned */ + } + printf("Right shift isn't acting as I expect it to.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + return 0; /* try it with unsigned anyway */ +} + + +#ifdef HAVE_PROTOTYPES +int main (int argc, char ** argv) +#else +int main (argc, argv) + int argc; + char ** argv; +#endif +{ + char signed_char_check = (char) (-67); + FILE *outfile; + + /* Attempt to write jconfig.h */ + if ((outfile = fopen("jconfig.h", "w")) == NULL) { + printf("Failed to write jconfig.h\n"); + return 1; + } + + /* Write out all the info */ + fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n"); + fprintf(outfile, "/* see jconfig.txt for explanations */\n\n"); +#ifdef HAVE_PROTOTYPES + fprintf(outfile, "#define HAVE_PROTOTYPES\n"); +#else + fprintf(outfile, "#undef HAVE_PROTOTYPES\n"); +#endif +#ifdef HAVE_UNSIGNED_CHAR + fprintf(outfile, "#define HAVE_UNSIGNED_CHAR\n"); +#else + fprintf(outfile, "#undef HAVE_UNSIGNED_CHAR\n"); +#endif +#ifdef HAVE_UNSIGNED_SHORT + fprintf(outfile, "#define HAVE_UNSIGNED_SHORT\n"); +#else + fprintf(outfile, "#undef HAVE_UNSIGNED_SHORT\n"); +#endif +#ifdef HAVE_VOID + fprintf(outfile, "/* #define void char */\n"); +#else + fprintf(outfile, "#define void char\n"); +#endif +#ifdef HAVE_CONST + fprintf(outfile, "/* #define const */\n"); +#else + fprintf(outfile, "#define const\n"); +#endif + if (is_char_signed((int) signed_char_check)) + fprintf(outfile, "#undef CHAR_IS_UNSIGNED\n"); + else + fprintf(outfile, "#define CHAR_IS_UNSIGNED\n"); +#ifdef HAVE_STDDEF_H + fprintf(outfile, "#define HAVE_STDDEF_H\n"); +#else + fprintf(outfile, "#undef HAVE_STDDEF_H\n"); +#endif +#ifdef HAVE_STDLIB_H + fprintf(outfile, "#define HAVE_STDLIB_H\n"); +#else + fprintf(outfile, "#undef HAVE_STDLIB_H\n"); +#endif +#ifdef NEED_BSD_STRINGS + fprintf(outfile, "#define NEED_BSD_STRINGS\n"); +#else + fprintf(outfile, "#undef NEED_BSD_STRINGS\n"); +#endif +#ifdef NEED_SYS_TYPES_H + fprintf(outfile, "#define NEED_SYS_TYPES_H\n"); +#else + fprintf(outfile, "#undef NEED_SYS_TYPES_H\n"); +#endif + fprintf(outfile, "#undef NEED_FAR_POINTERS\n"); +#ifdef NEED_SHORT_EXTERNAL_NAMES + fprintf(outfile, "#define NEED_SHORT_EXTERNAL_NAMES\n"); +#else + fprintf(outfile, "#undef NEED_SHORT_EXTERNAL_NAMES\n"); +#endif +#ifdef INCOMPLETE_TYPES_BROKEN + fprintf(outfile, "#define INCOMPLETE_TYPES_BROKEN\n"); +#else + fprintf(outfile, "#undef INCOMPLETE_TYPES_BROKEN\n"); +#endif + fprintf(outfile, "\n#ifdef JPEG_INTERNALS\n\n"); + if (is_shifting_signed(-0x7F7E80B1L)) + fprintf(outfile, "#undef RIGHT_SHIFT_IS_UNSIGNED\n"); + else + fprintf(outfile, "#define RIGHT_SHIFT_IS_UNSIGNED\n"); + fprintf(outfile, "\n#endif /* JPEG_INTERNALS */\n"); + fprintf(outfile, "\n#ifdef JPEG_CJPEG_DJPEG\n\n"); + fprintf(outfile, "#define BMP_SUPPORTED /* BMP image file format */\n"); + fprintf(outfile, "#define GIF_SUPPORTED /* GIF image file format */\n"); + fprintf(outfile, "#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */\n"); + fprintf(outfile, "#undef RLE_SUPPORTED /* Utah RLE image file format */\n"); + fprintf(outfile, "#define TARGA_SUPPORTED /* Targa image file format */\n\n"); + fprintf(outfile, "#undef TWO_FILE_COMMANDLINE /* You may need this on non-Unix systems */\n"); + fprintf(outfile, "#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */\n"); + fprintf(outfile, "#undef DONT_USE_B_MODE\n"); + fprintf(outfile, "/* #define PROGRESS_REPORT */ /* optional */\n"); + fprintf(outfile, "\n#endif /* JPEG_CJPEG_DJPEG */\n"); + + /* Close the jconfig.h file */ + fclose(outfile); + + /* User report */ + printf("Configuration check for Independent JPEG Group's software done.\n"); + printf("\nI have written the jconfig.h file for you.\n\n"); +#ifdef HAVE_PROTOTYPES + printf("You should use makefile.ansi as the starting point for your Makefile.\n"); +#else + printf("You should use makefile.unix as the starting point for your Makefile.\n"); +#endif + +#ifdef NEED_SPECIAL_INCLUDE + printf("\nYou'll need to change jconfig.h to include the system include file\n"); + printf("that you found type size_t in, or add a direct definition of type\n"); + printf("size_t if that's what you used. Just add it to the end.\n"); +#endif + + return 0; +} diff --git a/thirdparty/LibJPEG/jpeg-9/coderules.txt b/thirdparty/LibJPEG/jpeg-9/coderules.txt new file mode 100644 index 0000000..357929f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/coderules.txt @@ -0,0 +1,118 @@ +IJG JPEG LIBRARY: CODING RULES + +Copyright (C) 1991-1996, Thomas G. Lane. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +Since numerous people will be contributing code and bug fixes, it's important +to establish a common coding style. The goal of using similar coding styles +is much more important than the details of just what that style is. + +In general we follow the recommendations of "Recommended C Style and Coding +Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and +Brader). This document is available in the IJG FTP archive (see +jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl). + +Block comments should be laid out thusly: + +/* + * Block comments in this style. + */ + +We indent statements in K&R style, e.g., + if (test) { + then-part; + } else { + else-part; + } +with two spaces per indentation level. (This indentation convention is +handled automatically by GNU Emacs and many other text editors.) + +Multi-word names should be written in lower case with underscores, e.g., +multi_word_name (not multiWordName). Preprocessor symbols and enum constants +are similar but upper case (MULTI_WORD_NAME). Names should be unique within +the first fifteen characters. (On some older systems, global names must be +unique within six characters. We accommodate this without cluttering the +source code by using macros to substitute shorter names.) + +We use function prototypes everywhere; we rely on automatic source code +transformation to feed prototype-less C compilers. Transformation is done +by the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript). +ansi2knr is not very bright, so it imposes a format requirement on function +declarations: the function name MUST BEGIN IN COLUMN 1. Thus all functions +should be written in the following style: + +LOCAL(int *) +function_name (int a, char *b) +{ + code... +} + +Note that each function definition must begin with GLOBAL(type), LOCAL(type), +or METHODDEF(type). These macros expand to "static type" or just "type" as +appropriate. They provide a readable indication of the routine's usage and +can readily be changed for special needs. (For instance, special linkage +keywords can be inserted for use in Windows DLLs.) + +ansi2knr does not transform method declarations (function pointers in +structs). We handle these with a macro JMETHOD, defined as + #ifdef HAVE_PROTOTYPES + #define JMETHOD(type,methodname,arglist) type (*methodname) arglist + #else + #define JMETHOD(type,methodname,arglist) type (*methodname) () + #endif +which is used like this: + struct function_pointers { + JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp)); + JMETHOD(void, term_entropy_encoder, (void)); + }; +Note the set of parentheses surrounding the parameter list. + +A similar solution is used for forward and external function declarations +(see the EXTERN and JPP macros). + +If the code is to work on non-ANSI compilers, we cannot rely on a prototype +declaration to coerce actual parameters into the right types. Therefore, use +explicit casts on actual parameters whenever the actual parameter type is not +identical to the formal parameter. Beware of implicit conversions to "int". + +It seems there are some non-ANSI compilers in which the sizeof() operator +is defined to return int, yet size_t is defined as long. Needless to say, +this is brain-damaged. Always use the SIZEOF() macro in place of sizeof(), +so that the result is guaranteed to be of type size_t. + + +The JPEG library is intended to be used within larger programs. Furthermore, +we want it to be reentrant so that it can be used by applications that process +multiple images concurrently. The following rules support these requirements: + +1. Avoid direct use of file I/O, "malloc", error report printouts, etc; +pass these through the common routines provided. + +2. Minimize global namespace pollution. Functions should be declared static +wherever possible. (Note that our method-based calling conventions help this +a lot: in many modules only the initialization function will ever need to be +called directly, so only that function need be externally visible.) All +global function names should begin with "jpeg_", and should have an +abbreviated name (unique in the first six characters) substituted by macro +when NEED_SHORT_EXTERNAL_NAMES is set. + +3. Don't use global variables; anything that must be used in another module +should be in the common data structures. + +4. Don't use static variables except for read-only constant tables. Variables +that should be private to a module can be placed into private structures (see +the system architecture document, structure.txt). + +5. Source file names should begin with "j" for files that are part of the +library proper; source files that are not part of the library, such as cjpeg.c +and djpeg.c, do not begin with "j". Keep source file names to eight +characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers. Keep +compression and decompression code in separate source files --- some +applications may want only one half of the library. + +Note: these rules (particularly #4) are not followed religiously in the +modules that are used in cjpeg/djpeg but are not part of the JPEG library +proper. Those modules are not really intended to be used in other +applications. diff --git a/thirdparty/LibJPEG/jpeg-9/config.guess b/thirdparty/LibJPEG/jpeg-9/config.guess new file mode 100644 index 0000000..1804e9f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/config.guess @@ -0,0 +1,1535 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012, 2013 Free Software Foundation, Inc. + +timestamp='2012-12-29' + +# 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 . +# +# 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. +# +# 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 with a ChangeLog entry 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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +2012, 2013 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 + +# 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=`(/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 ;; + *) 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*|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 + # 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}" + 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 /* 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 + + 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/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + 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 + #include + + 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 + 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 ;; + i*: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-gnu`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/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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' /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 + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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 + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + 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 + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + 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 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < 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/thirdparty/LibJPEG/jpeg-9/config.sub b/thirdparty/LibJPEG/jpeg-9/config.sub new file mode 100644 index 0000000..802a224 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/config.sub @@ -0,0 +1,1790 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012, 2013 Free Software Foundation, Inc. + +timestamp='2012-12-29' + +# 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 . +# +# 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 with a ChangeLog entry 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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +2012, 2013 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* | \ + 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 \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | 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 \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | 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 \ + | 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 + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | 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-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | 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-* \ + | 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-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | 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-* \ + | 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 + ;; + 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=i386-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 + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-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* \ + | -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* \ + | -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*) + # 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 + ;; + -kaos*) + os=-kaos + ;; + -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 + ;; + 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/thirdparty/LibJPEG/jpeg-9/configure b/thirdparty/LibJPEG/jpeg-9/configure new file mode 100644 index 0000000..c7b1387 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/configure @@ -0,0 +1,15346 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for libjpeg 9.0.0. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libjpeg' +PACKAGE_TARNAME='libjpeg' +PACKAGE_VERSION='9.0.0' +PACKAGE_STRING='libjpeg 9.0.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +JPEG_LIB_VERSION +MEMORYMGR +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +EGREP +GREP +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +ac_ct_AR +AR +LN_S +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_dependency_tracking +enable_ld_version_script +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_maxmem +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libjpeg 9.0.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libjpeg] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libjpeg 9.0.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-ld-version-script + enable linker version script (default is enabled + when possible) + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-maxmem=N enable use of temp files, set max mem usage to N MB + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + 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 the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libjpeg configure 9.0.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libjpeg $as_me 9.0.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Directory where autotools helper scripts lives. +ac_aux_dir= +for ac_dir in . "$srcdir"/.; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +# Generate configuration headers. +ac_config_headers="$ac_config_headers jconfig.h:jconfig.cfg" + + +# Hack: disable autoheader so that it doesn't overwrite our cfg template. +AUTOHEADER="echo autoheader ignored" + +# Check system type +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +# Initialize Automake +# Don't require all the GNU mandated files +am__api_version='1.13' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libjpeg' + VERSION='9.0.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# Make --enable-silent-rules the default. +# To get verbose build output you may configure +# with --disable-silent-rules or use "make V=1". +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +# Add configure option --enable-maintainer-mode which enables +# dependency checking and generation useful to package maintainers. +# This is made an option to avoid confusing end users. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +# Check for programs +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + + +# Check if LD supports linker scripts, +# and define automake conditional HAVE_LD_VERSION_SCRIPT if so. +# Check whether --enable-ld-version-script was given. +if test "${enable_ld_version_script+set}" = set; then : + enableval=$enable_ld_version_script; have_ld_version_script=$enableval +fi + +if test -z "$have_ld_version_script"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 +$as_echo_n "checking if LD -Wl,--version-script works... " >&6; } + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map <conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_ld_version_script=yes +else + have_ld_version_script=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + rm -f conftest.map + LDFLAGS="$save_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5 +$as_echo "$have_ld_version_script" >&6; } +fi + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +# See if compiler supports prototypes. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5 +$as_echo_n "checking for function prototypes... " >&6; } +if ${ijg_cv_have_prototypes+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int testfunction (int arg1, int * arg2); /* check prototypes */ +struct methods_struct { /* check method-pointer declarations */ + int (*error_exit) (char *msgtext); + int (*trace_message) (char *msgtext); + int (*another_method) (void); +}; +int testfunction (int arg1, int * arg2) /* check definitions */ +{ return arg2[arg1]; } +int test2function (void) /* check void arg list */ +{ return 0; } + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ijg_cv_have_prototypes=yes +else + ijg_cv_have_prototypes=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_have_prototypes" >&5 +$as_echo "$ijg_cv_have_prototypes" >&6; } +if test $ijg_cv_have_prototypes = yes; then + +$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your compiler does not seem to know about function prototypes. + Perhaps it needs a special switch to enable ANSI C mode. + If so, we recommend running configure like this: + ./configure CC='cc -switch' + where -switch is the proper switch." >&5 +$as_echo "$as_me: WARNING: Your compiler does not seem to know about function prototypes. + Perhaps it needs a special switch to enable ANSI C mode. + If so, we recommend running configure like this: + ./configure CC='cc -switch' + where -switch is the proper switch." >&2;} +fi + +# Check header files + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stddef.h stdlib.h locale.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes; then : + +else + +$as_echo "#define NEED_BSD_STRINGS 1" >>confdefs.h + +fi + + + +# See whether type size_t is defined in any ANSI-standard places; +# if not, perhaps it is defined in . +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_STDDEF_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef NEED_BSD_STRINGS +#include +#else +#include +#endif +typedef size_t my_size_t; + +int +main () +{ + my_size_t foovar; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ijg_size_t_ok=yes +else + ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5 +$as_echo "$ijg_size_t_ok" >&6; } +if test "$ijg_size_t_ok" != yes; then + ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes; then : + +$as_echo "#define NEED_SYS_TYPES_H 1" >>confdefs.h + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "size_t" >/dev/null 2>&1; then : + ijg_size_t_ok="size_t is in sys/types.h" +else + ijg_size_t_ok=no +fi +rm -f conftest* + +else + ijg_size_t_ok=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5 +$as_echo "$ijg_size_t_ok" >&6; } + if test "$ijg_size_t_ok" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Type size_t is not defined in any of the usual places. + Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&5 +$as_echo "$as_me: WARNING: Type size_t is not defined in any of the usual places. + Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&2;} + fi +fi + +# Check compiler characteristics +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned char" >&5 +$as_echo_n "checking for type unsigned char... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + unsigned char un_char; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_UNSIGNED_CHAR 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned short" >&5 +$as_echo_n "checking for type unsigned short... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + unsigned short un_short; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_UNSIGNED_SHORT 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type void" >&5 +$as_echo_n "checking for type void... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Caution: a C++ compiler will insist on valid prototypes */ +typedef void * void_ptr; /* check void * */ +#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */ +typedef void (*void_func) (int a, int b); +#else +typedef void (*void_func) (); +#endif + +#ifdef HAVE_PROTOTYPES /* check void function result */ +void test3function (void_ptr arg1, void_func arg2) +#else +void test3function (arg1, arg2) + void_ptr arg1; + void_func arg2; +#endif +{ + char * locptr = (char *) arg1; /* check casting to and from void * */ + arg1 = (void *) locptr; + (*arg2) (1, 2); /* check call of fcn returning void */ +} + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define void char" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + + +# Check for non-broken inline under various spellings +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +ijg_cv_inline="" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +} __inline__ int foo() { return 0; } +int bar() { return foo(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ijg_cv_inline="__inline__" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +} __inline int foo() { return 0; } +int bar() { return foo(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ijg_cv_inline="__inline" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +} inline int foo() { return 0; } +int bar() { return foo(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ijg_cv_inline="inline" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_inline" >&5 +$as_echo "$ijg_cv_inline" >&6; } + +cat >>confdefs.h <<_ACEOF +#define INLINE $ijg_cv_inline +_ACEOF + + +# We cannot check for bogus warnings, but at least we can check for errors +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken incomplete types" >&5 +$as_echo_n "checking for broken incomplete types... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + typedef struct undefined_structure * undef_struct_ptr; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken" >&5 +$as_echo "broken" >&6; } + +$as_echo "#define INCOMPLETE_TYPES_BROKEN 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +# Test whether global names are unique to at least 15 chars +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for short external names" >&5 +$as_echo_n "checking for short external names... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int possibly_duplicate_function () { return 0; } +int possibly_dupli_function () { return 1; } + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: short" >&5 +$as_echo "short" >&6; } + +$as_echo "#define NEED_SHORT_EXTERNAL_NAMES 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +# Run-time checks +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if char is signed" >&5 +$as_echo_n "checking to see if char is signed... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assuming that char is signed on target machine. + If it is unsigned, this will be a little bit inefficient." >&5 +$as_echo "$as_me: WARNING: Assuming that char is signed on target machine. + If it is unsigned, this will be a little bit inefficient." >&2;} + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef HAVE_PROTOTYPES +int is_char_signed (int arg) +#else +int is_char_signed (arg) + int arg; +#endif +{ + if (arg == 189) { /* expected result for unsigned char */ + return 0; /* type char is unsigned */ + } + else if (arg != -67) { /* expected result for signed char */ + printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + } + return 1; /* assume char is signed otherwise */ +} +char signed_char_check = (char) (-67); +int main() { + exit(is_char_signed((int) signed_char_check)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define CHAR_IS_UNSIGNED 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if right shift is signed" >&5 +$as_echo_n "checking to see if right shift is signed... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that right shift is signed on target machine." >&5 +$as_echo "Assuming that right shift is signed on target machine." >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef HAVE_PROTOTYPES +int is_shifting_signed (long arg) +#else +int is_shifting_signed (arg) + long arg; +#endif +/* See whether right-shift on a long is signed or not. */ +{ + long res = arg >> 4; + + if (res == -0x7F7E80CL) { /* expected result for signed shift */ + return 1; /* right shift is signed */ + } + /* see if unsigned-shift hack will fix it. */ + /* we can't just test exact value since it depends on width of long... */ + res |= (~0L) << (32-4); + if (res == -0x7F7E80CL) { /* expected result now? */ + return 0; /* right shift is unsigned */ + } + printf("Right shift isn't acting as I expect it to.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + return 0; /* try it with unsigned anyway */ +} +int main() { + exit(is_shifting_signed(-0x7F7E80B1L)); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define RIGHT_SHIFT_IS_UNSIGNED 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if fopen accepts b spec" >&5 +$as_echo_n "checking to see if fopen accepts b spec... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that it does." >&5 +$as_echo "Assuming that it does." >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_STDLIB_H +#include +#endif +#include +int main() { + if (fopen("conftestdata", "wb") != NULL) + exit(0); + exit(1); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define DONT_USE_B_MODE 1" >>confdefs.h + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +# Configure libtool +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +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 + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Select memory manager depending on user input. +# If no "-enable-maxmem", use jmemnobs +MEMORYMGR='jmemnobs' +MAXMEM="no" +# Check whether --enable-maxmem was given. +if test "${enable_maxmem+set}" = set; then : + enableval=$enable_maxmem; MAXMEM="$enableval" +fi + +if test "x$MAXMEM" = xyes; then + MAXMEM=1 +fi +if test "x$MAXMEM" != xno; then + if test -n "`echo $MAXMEM | sed 's/[0-9]//g'`"; then + as_fn_error $? "non-numeric argument to --enable-maxmem" "$LINENO" 5 + fi + DEFAULTMAXMEM=`expr $MAXMEM \* 1048576` + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_MAX_MEM ${DEFAULTMAXMEM} +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'tmpfile()'" >&5 +$as_echo_n "checking for 'tmpfile()'... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + FILE * tfile = tmpfile(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + MEMORYMGR='jmemansi' +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + MEMORYMGR='jmemname' + + # Test for the need to remove temporary files using a signal handler + # (for cjpeg/djpeg) + +$as_echo "#define NEED_SIGNAL_CATCHER 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'mktemp()'" >&5 +$as_echo_n "checking for 'mktemp()'... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + char fname[80]; mktemp(fname); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MKTEMP 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + +# Extract the library version IDs from jpeglib.h. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libjpeg version number" >&5 +$as_echo_n "checking libjpeg version number... " >&6; } +major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` +minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` +JPEG_LIB_VERSION=`expr $major + $minor`:0:$minor + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JPEG_LIB_VERSION" >&5 +$as_echo "$JPEG_LIB_VERSION" >&6; } + +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, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libjpeg $as_me 9.0.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libjpeg config.status 9.0.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "jconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS jconfig.h:jconfig.cfg" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/thirdparty/LibJPEG/jpeg-9/configure.ac b/thirdparty/LibJPEG/jpeg-9/configure.ac new file mode 100644 index 0000000..e0cc36b --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/configure.ac @@ -0,0 +1,365 @@ +# IJG auto-configuration source file. +# Process this file with autoconf to produce a configure script. + +# +# Configure script for IJG libjpeg +# + +AC_INIT([libjpeg], [9.0.0]) + +# Directory where autotools helper scripts lives. +AC_CONFIG_AUX_DIR([.]) + +# Generate configuration headers. +AC_CONFIG_HEADERS([jconfig.h:jconfig.cfg]) + +# Hack: disable autoheader so that it doesn't overwrite our cfg template. +AUTOHEADER="echo autoheader ignored" + +# Check system type +AC_CANONICAL_TARGET + +# Initialize Automake +# Don't require all the GNU mandated files +AM_INIT_AUTOMAKE([-Wall -Werror no-dist foreign]) + +# Make --enable-silent-rules the default. +# To get verbose build output you may configure +# with --disable-silent-rules or use "make V=1". +AM_SILENT_RULES([yes]) + +# Add configure option --enable-maintainer-mode which enables +# dependency checking and generation useful to package maintainers. +# This is made an option to avoid confusing end users. +AM_MAINTAINER_MODE + +# Check for programs +AC_PROG_CC +AC_PROG_CC_STDC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_LN_S +AM_PROG_AR + +# Check if LD supports linker scripts, +# and define automake conditional HAVE_LD_VERSION_SCRIPT if so. +AC_ARG_ENABLE([ld-version-script], + AS_HELP_STRING([--enable-ld-version-script], + [enable linker version script (default is enabled when possible)]), + [have_ld_version_script=$enableval], []) +if test -z "$have_ld_version_script"; then + AC_MSG_CHECKING([if LD -Wl,--version-script works]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map < rather than standard .])]) + +# See whether type size_t is defined in any ANSI-standard places; +# if not, perhaps it is defined in . +AC_MSG_CHECKING([for size_t]) +AC_TRY_COMPILE([ +#ifdef HAVE_STDDEF_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef NEED_BSD_STRINGS +#include +#else +#include +#endif +typedef size_t my_size_t; +], + [ my_size_t foovar; ], + [ijg_size_t_ok=yes], + [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"]) +AC_MSG_RESULT([$ijg_size_t_ok]) +if test "$ijg_size_t_ok" != yes; then + AC_CHECK_HEADER([sys/types.h], + [AC_DEFINE([NEED_SYS_TYPES_H], [1], + [Need to include in order to obtain size_t.]) + AC_EGREP_CPP([size_t], [#include ], + [ijg_size_t_ok="size_t is in sys/types.h"], + [ijg_size_t_ok=no])], + [ijg_size_t_ok=no]) + AC_MSG_RESULT([$ijg_size_t_ok]) + if test "$ijg_size_t_ok" = no; then + AC_MSG_WARN([Type size_t is not defined in any of the usual places. + Try putting '"typedef unsigned int size_t;"' in jconfig.h.]) + fi +fi + +# Check compiler characteristics +AC_MSG_CHECKING([for type unsigned char]) +AC_TRY_COMPILE([], [ unsigned char un_char; ], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UNSIGNED_CHAR], [1], + [Compiler supports 'unsigned char'.])], + [AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING([for type unsigned short]) +AC_TRY_COMPILE([], [ unsigned short un_short; ], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UNSIGNED_SHORT], [1], + [Compiler supports 'unsigned short'.])], + [AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING([for type void]) +AC_TRY_COMPILE([ +/* Caution: a C++ compiler will insist on valid prototypes */ +typedef void * void_ptr; /* check void * */ +#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */ +typedef void (*void_func) (int a, int b); +#else +typedef void (*void_func) (); +#endif + +#ifdef HAVE_PROTOTYPES /* check void function result */ +void test3function (void_ptr arg1, void_func arg2) +#else +void test3function (arg1, arg2) + void_ptr arg1; + void_func arg2; +#endif +{ + char * locptr = (char *) arg1; /* check casting to and from void * */ + arg1 = (void *) locptr; + (*arg2) (1, 2); /* check call of fcn returning void */ +} +], [ ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([void], [char], + [Define 'void' as 'char' for archaic compilers + that don't understand it.])]) +AC_C_CONST + +# Check for non-broken inline under various spellings +AC_MSG_CHECKING([for inline]) +ijg_cv_inline="" +AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; } +int bar() { return foo();], ijg_cv_inline="__inline__", +[AC_TRY_COMPILE(, [} __inline int foo() { return 0; } +int bar() { return foo();], ijg_cv_inline="__inline", +[AC_TRY_COMPILE(, [} inline int foo() { return 0; } +int bar() { return foo();], ijg_cv_inline="inline")])]) +AC_MSG_RESULT($ijg_cv_inline) +AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline], + [How to obtain function inlining.]) + +# We cannot check for bogus warnings, but at least we can check for errors +AC_MSG_CHECKING([for broken incomplete types]) +AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], + [], + [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(broken) + AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1], + [Compiler does not support pointers to unspecified + structures.])]) + +# Test whether global names are unique to at least 15 chars +AC_MSG_CHECKING([for short external names]) +AC_TRY_LINK([ +int possibly_duplicate_function () { return 0; } +int possibly_dupli_function () { return 1; } +], [], + [AC_MSG_RESULT(ok)], + [AC_MSG_RESULT(short) + AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1], + [Linker requires that global names be unique in + first 15 characters.])]) + +# Run-time checks +AC_MSG_CHECKING([to see if char is signed]) +AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef HAVE_PROTOTYPES +int is_char_signed (int arg) +#else +int is_char_signed (arg) + int arg; +#endif +{ + if (arg == 189) { /* expected result for unsigned char */ + return 0; /* type char is unsigned */ + } + else if (arg != -67) { /* expected result for signed char */ + printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + } + return 1; /* assume char is signed otherwise */ +} +char signed_char_check = (char) (-67); +int main() { + exit(is_char_signed((int) signed_char_check)); +}], [AC_MSG_RESULT(no) + AC_DEFINE([CHAR_IS_UNSIGNED], [1], + [Characters are unsigned])], + [AC_MSG_RESULT(yes)], +[AC_MSG_WARN([Assuming that char is signed on target machine. + If it is unsigned, this will be a little bit inefficient.]) +]) + +AC_MSG_CHECKING([to see if right shift is signed]) +AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include +#ifdef HAVE_PROTOTYPES +int is_shifting_signed (long arg) +#else +int is_shifting_signed (arg) + long arg; +#endif +/* See whether right-shift on a long is signed or not. */ +{ + long res = arg >> 4; + + if (res == -0x7F7E80CL) { /* expected result for signed shift */ + return 1; /* right shift is signed */ + } + /* see if unsigned-shift hack will fix it. */ + /* we can't just test exact value since it depends on width of long... */ + res |= (~0L) << (32-4); + if (res == -0x7F7E80CL) { /* expected result now? */ + return 0; /* right shift is unsigned */ + } + printf("Right shift isn't acting as I expect it to.\n"); + printf("I fear the JPEG software will not work at all.\n\n"); + return 0; /* try it with unsigned anyway */ +} +int main() { + exit(is_shifting_signed(-0x7F7E80B1L)); +}], + [AC_MSG_RESULT(no) + AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1], + [Broken compiler shifts signed values as an unsigned shift.])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)]) + +AC_MSG_CHECKING([to see if fopen accepts b spec]) +AC_TRY_RUN([ +#ifdef HAVE_STDLIB_H +#include +#endif +#include +int main() { + if (fopen("conftestdata", "wb") != NULL) + exit(0); + exit(1); +}], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([DONT_USE_B_MODE], [1], + [Don't open files in binary mode.])], + [AC_MSG_RESULT(Assuming that it does.)]) + +# Configure libtool +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +# Select memory manager depending on user input. +# If no "-enable-maxmem", use jmemnobs +MEMORYMGR='jmemnobs' +MAXMEM="no" +AC_ARG_ENABLE([maxmem], +[ --enable-maxmem[=N] enable use of temp files, set max mem usage to N MB], +[MAXMEM="$enableval"]) +dnl [# support --with-maxmem for backwards compatibility with IJG V5.] +dnl AC_ARG_WITH(maxmem, , MAXMEM="$withval") +if test "x$MAXMEM" = xyes; then + MAXMEM=1 +fi +if test "x$MAXMEM" != xno; then + if test -n "`echo $MAXMEM | sed 's/[[0-9]]//g'`"; then + AC_MSG_ERROR(non-numeric argument to --enable-maxmem) + fi + DEFAULTMAXMEM=`expr $MAXMEM \* 1048576` + AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}], + [Maximum data space library will allocate.]) + AC_MSG_CHECKING([for 'tmpfile()']) + AC_TRY_LINK([#include ], [ FILE * tfile = tmpfile(); ], + [AC_MSG_RESULT(yes) + MEMORYMGR='jmemansi'], + [AC_MSG_RESULT(no) + dnl if tmpfile is not present, must use jmemname. + MEMORYMGR='jmemname' + + # Test for the need to remove temporary files using a signal handler + # (for cjpeg/djpeg) + AC_DEFINE([NEED_SIGNAL_CATCHER], [1], + [Need signal handler to clean up temporary files.]) + AC_MSG_CHECKING([for 'mktemp()']) + AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE([NO_MKTEMP], [1], + [The mktemp() function is not available.])])]) +fi +AC_SUBST([MEMORYMGR]) + +# Extract the library version IDs from jpeglib.h. +AC_MSG_CHECKING([libjpeg version number]) +[major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` +minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`] +AC_SUBST([JPEG_LIB_VERSION], + [`expr $major + $minor`:0:$minor]) +AC_MSG_RESULT([$JPEG_LIB_VERSION]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/thirdparty/LibJPEG/jpeg-9/depcomp b/thirdparty/LibJPEG/jpeg-9/depcomp new file mode 100644 index 0000000..06b0882 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/depcomp @@ -0,0 +1,790 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-10-18.11; # UTC + +# Copyright (C) 1999-2013 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, see . + +# 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. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/LibJPEG/jpeg-9/djpeg.1 b/thirdparty/LibJPEG/jpeg-9/djpeg.1 new file mode 100644 index 0000000..f3722d1 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/djpeg.1 @@ -0,0 +1,252 @@ +.TH DJPEG 1 "3 October 2009" +.SH NAME +djpeg \- decompress a JPEG file to an image file +.SH SYNOPSIS +.B djpeg +[ +.I options +] +[ +.I filename +] +.LP +.SH DESCRIPTION +.LP +.B djpeg +decompresses the named JPEG file, or the standard input if no file is named, +and produces an image file on the standard output. PBMPLUS (PPM/PGM), BMP, +GIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected. +(RLE is supported only if the URT library is available.) +.SH OPTIONS +All switch names may be abbreviated; for example, +.B \-grayscale +may be written +.B \-gray +or +.BR \-gr . +Most of the "basic" switches can be abbreviated to as little as one letter. +Upper and lower case are equivalent (thus +.B \-BMP +is the same as +.BR \-bmp ). +British spellings are also accepted (e.g., +.BR \-greyscale ), +though for brevity these are not mentioned below. +.PP +The basic switches are: +.TP +.BI \-colors " N" +Reduce image to at most N colors. This reduces the number of colors used in +the output image, so that it can be displayed on a colormapped display or +stored in a colormapped file format. For example, if you have an 8-bit +display, you'd need to reduce to 256 or fewer colors. +.TP +.BI \-quantize " N" +Same as +.BR \-colors . +.B \-colors +is the recommended name, +.B \-quantize +is provided only for backwards compatibility. +.TP +.B \-fast +Select recommended processing options for fast, low quality output. (The +default options are chosen for highest quality output.) Currently, this is +equivalent to \fB\-dct fast \-nosmooth \-onepass \-dither ordered\fR. +.TP +.B \-grayscale +Force gray-scale output even if JPEG file is color. Useful for viewing on +monochrome displays; also, +.B djpeg +runs noticeably faster in this mode. +.TP +.BI \-scale " M/N" +Scale the output image by a factor M/N. Currently supported scale factors are +M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for +baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled +size to be applied on the given input. For baseline JPEG this is equivalent +to M/8 scaling, since the source DCT size for baseline JPEG is 8. +Scaling is handy if the image is larger than your screen; also, +.B djpeg +runs much faster when scaling down the output. +.TP +.B \-bmp +Select BMP output format (Windows flavor). 8-bit colormapped format is +emitted if +.B \-colors +or +.B \-grayscale +is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color +format is emitted. +.TP +.B \-gif +Select GIF output format. Since GIF does not support more than 256 colors, +.B \-colors 256 +is assumed (unless you specify a smaller number of colors). +.TP +.B \-os2 +Select BMP output format (OS/2 1.x flavor). 8-bit colormapped format is +emitted if +.B \-colors +or +.B \-grayscale +is specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color +format is emitted. +.TP +.B \-pnm +Select PBMPLUS (PPM/PGM) output format (this is the default format). +PGM is emitted if the JPEG file is gray-scale or if +.B \-grayscale +is specified; otherwise PPM is emitted. +.TP +.B \-rle +Select RLE output format. (Requires URT library.) +.TP +.B \-targa +Select Targa output format. Gray-scale format is emitted if the JPEG file is +gray-scale or if +.B \-grayscale +is specified; otherwise, colormapped format is emitted if +.B \-colors +is specified; otherwise, 24-bit full-color format is emitted. +.PP +Switches for advanced users: +.TP +.B \-dct int +Use integer DCT method (default). +.TP +.B \-dct fast +Use fast integer DCT (less accurate). +.TP +.B \-dct float +Use floating-point DCT method. +The float method is very slightly more accurate than the int method, but is +much slower unless your machine has very fast floating-point hardware. Also +note that results of the floating-point method may vary slightly across +machines, while the integer methods should give the same results everywhere. +The fast integer method is much less accurate than the other two. +.TP +.B \-dither fs +Use Floyd-Steinberg dithering in color quantization. +.TP +.B \-dither ordered +Use ordered dithering in color quantization. +.TP +.B \-dither none +Do not use dithering in color quantization. +By default, Floyd-Steinberg dithering is applied when quantizing colors; this +is slow but usually produces the best results. Ordered dither is a compromise +between speed and quality; no dithering is fast but usually looks awful. Note +that these switches have no effect unless color quantization is being done. +Ordered dither is only available in +.B \-onepass +mode. +.TP +.BI \-map " file" +Quantize to the colors used in the specified image file. This is useful for +producing multiple files with identical color maps, or for forcing a +predefined set of colors to be used. The +.I file +must be a GIF or PPM file. This option overrides +.B \-colors +and +.BR \-onepass . +.TP +.B \-nosmooth +Don't use high-quality upsampling. +.TP +.B \-onepass +Use one-pass instead of two-pass color quantization. The one-pass method is +faster and needs less memory, but it produces a lower-quality image. +.B \-onepass +is ignored unless you also say +.B \-colors +.IR N . +Also, the one-pass method is always used for gray-scale output (the two-pass +method is no improvement then). +.TP +.BI \-maxmemory " N" +Set limit for amount of memory to use in processing large images. Value is +in thousands of bytes, or millions of bytes if "M" is attached to the +number. For example, +.B \-max 4m +selects 4000000 bytes. If more space is needed, temporary files will be used. +.TP +.BI \-outfile " name" +Send output image to the named file, not to standard output. +.TP +.B \-verbose +Enable debug printout. More +.BR \-v 's +give more output. Also, version information is printed at startup. +.TP +.B \-debug +Same as +.BR \-verbose . +.SH EXAMPLES +.LP +This example decompresses the JPEG file foo.jpg, quantizes it to +256 colors, and saves the output in 8-bit BMP format in foo.bmp: +.IP +.B djpeg \-colors 256 \-bmp +.I foo.jpg +.B > +.I foo.bmp +.SH HINTS +To get a quick preview of an image, use the +.B \-grayscale +and/or +.B \-scale +switches. +.B \-grayscale \-scale 1/8 +is the fastest case. +.PP +Several options are available that trade off image quality to gain speed. +.B \-fast +turns on the recommended settings. +.PP +.B \-dct fast +and/or +.B \-nosmooth +gain speed at a small sacrifice in quality. +When producing a color-quantized image, +.B \-onepass \-dither ordered +is fast but much lower quality than the default behavior. +.B \-dither none +may give acceptable results in two-pass mode, but is seldom tolerable in +one-pass mode. +.PP +If you are fortunate enough to have very fast floating point hardware, +\fB\-dct float\fR may be even faster than \fB\-dct fast\fR. But on most +machines \fB\-dct float\fR is slower than \fB\-dct int\fR; in this case it is +not worth using, because its theoretical accuracy advantage is too small to be +significant in practice. +.SH ENVIRONMENT +.TP +.B JPEGMEM +If this environment variable is set, its value is the default memory limit. +The value is specified as described for the +.B \-maxmemory +switch. +.B JPEGMEM +overrides the default value specified when the program was compiled, and +itself is overridden by an explicit +.BR \-maxmemory . +.SH SEE ALSO +.BR cjpeg (1), +.BR jpegtran (1), +.BR rdjpgcom (1), +.BR wrjpgcom (1) +.br +.BR ppm (5), +.BR pgm (5) +.br +Wallace, Gregory K. "The JPEG Still Picture Compression Standard", +Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. +.SH AUTHOR +Independent JPEG Group +.SH BUGS +To avoid the Unisys LZW patent, +.B djpeg +produces uncompressed GIF files. These are larger than they should be, but +are readable by standard GIF decoders. diff --git a/thirdparty/LibJPEG/jpeg-9/djpeg.c b/thirdparty/LibJPEG/jpeg-9/djpeg.c new file mode 100644 index 0000000..be7f269 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/djpeg.c @@ -0,0 +1,617 @@ +/* + * djpeg.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2009-2013 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a command-line user interface for the JPEG decompressor. + * It should work on any system with Unix- or MS-DOS-style command lines. + * + * Two different command line styles are permitted, depending on the + * compile-time switch TWO_FILE_COMMANDLINE: + * djpeg [options] inputfile outputfile + * djpeg [options] [inputfile] + * In the second style, output is always to standard output, which you'd + * normally redirect to a file or pipe to some other program. Input is + * either from a named file or from standard input (typically redirected). + * The second style is convenient on Unix but is unhelpful on systems that + * don't support pipes. Also, you MUST use the first style if your system + * doesn't do binary I/O to stdin/stdout. + * To simplify script writing, the "-outfile" switch is provided. The syntax + * djpeg [options] -outfile outputfile inputfile + * works regardless of which command line style is used. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ +#include "jversion.h" /* for version message */ + +#include /* to declare isprint() */ + +#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ +#ifdef __MWERKS__ +#include /* Metrowerks needs this */ +#include /* ... and this */ +#endif +#ifdef THINK_C +#include /* Think declares it here */ +#endif +#endif + + +/* Create the add-on message string table. */ + +#define JMESSAGE(code,string) string , + +static const char * const cdjpeg_message_table[] = { +#include "cderror.h" + NULL +}; + + +/* + * This list defines the known output image formats + * (not all of which need be supported by a given version). + * You can change the default output format by defining DEFAULT_FMT; + * indeed, you had better do so if you undefine PPM_SUPPORTED. + */ + +typedef enum { + FMT_BMP, /* BMP format (Windows flavor) */ + FMT_GIF, /* GIF format */ + FMT_OS2, /* BMP format (OS/2 flavor) */ + FMT_PPM, /* PPM/PGM (PBMPLUS formats) */ + FMT_RLE, /* RLE format */ + FMT_TARGA, /* Targa format */ + FMT_TIFF /* TIFF format */ +} IMAGE_FORMATS; + +#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */ +#define DEFAULT_FMT FMT_PPM +#endif + +static IMAGE_FORMATS requested_fmt; + + +/* + * Argument-parsing code. + * The switch parser is designed to be useful with DOS-style command line + * syntax, ie, intermixed switches and file names, where only the switches + * to the left of a given file name affect processing of that file. + * The main program in this file doesn't actually use this capability... + */ + + +static const char * progname; /* program name for error messages */ +static char * outfilename; /* for -outfile switch */ + + +LOCAL(void) +usage (void) +/* complain about bad command line */ +{ + fprintf(stderr, "usage: %s [switches] ", progname); +#ifdef TWO_FILE_COMMANDLINE + fprintf(stderr, "inputfile outputfile\n"); +#else + fprintf(stderr, "[inputfile]\n"); +#endif + + fprintf(stderr, "Switches (names may be abbreviated):\n"); + fprintf(stderr, " -colors N Reduce image to no more than N colors\n"); + fprintf(stderr, " -fast Fast, low-quality processing\n"); + fprintf(stderr, " -grayscale Force grayscale output\n"); +#ifdef IDCT_SCALING_SUPPORTED + fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n"); +#endif +#ifdef BMP_SUPPORTED + fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n", + (DEFAULT_FMT == FMT_BMP ? " (default)" : "")); +#endif +#ifdef GIF_SUPPORTED + fprintf(stderr, " -gif Select GIF output format%s\n", + (DEFAULT_FMT == FMT_GIF ? " (default)" : "")); +#endif +#ifdef BMP_SUPPORTED + fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n", + (DEFAULT_FMT == FMT_OS2 ? " (default)" : "")); +#endif +#ifdef PPM_SUPPORTED + fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n", + (DEFAULT_FMT == FMT_PPM ? " (default)" : "")); +#endif +#ifdef RLE_SUPPORTED + fprintf(stderr, " -rle Select Utah RLE output format%s\n", + (DEFAULT_FMT == FMT_RLE ? " (default)" : "")); +#endif +#ifdef TARGA_SUPPORTED + fprintf(stderr, " -targa Select Targa output format%s\n", + (DEFAULT_FMT == FMT_TARGA ? " (default)" : "")); +#endif + fprintf(stderr, "Switches for advanced users:\n"); +#ifdef DCT_ISLOW_SUPPORTED + fprintf(stderr, " -dct int Use integer DCT method%s\n", + (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); +#endif +#ifdef DCT_IFAST_SUPPORTED + fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n", + (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : "")); +#endif +#ifdef DCT_FLOAT_SUPPORTED + fprintf(stderr, " -dct float Use floating-point DCT method%s\n", + (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : "")); +#endif + fprintf(stderr, " -dither fs Use F-S dithering (default)\n"); + fprintf(stderr, " -dither none Don't use dithering in quantization\n"); + fprintf(stderr, " -dither ordered Use ordered dither (medium speed, quality)\n"); +#ifdef QUANT_2PASS_SUPPORTED + fprintf(stderr, " -map FILE Map to colors used in named image file\n"); +#endif + fprintf(stderr, " -nosmooth Don't use high-quality upsampling\n"); +#ifdef QUANT_1PASS_SUPPORTED + fprintf(stderr, " -onepass Use 1-pass quantization (fast, low quality)\n"); +#endif + fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); + fprintf(stderr, " -outfile name Specify name for output file\n"); + fprintf(stderr, " -verbose or -debug Emit debug output\n"); + exit(EXIT_FAILURE); +} + + +LOCAL(int) +parse_switches (j_decompress_ptr cinfo, int argc, char **argv, + int last_file_arg_seen, boolean for_real) +/* Parse optional switches. + * Returns argv[] index of first file-name argument (== argc if none). + * Any file names with indexes <= last_file_arg_seen are ignored; + * they have presumably been processed in a previous iteration. + * (Pass 0 for last_file_arg_seen on the first or only iteration.) + * for_real is FALSE on the first (dummy) pass; we may skip any expensive + * processing. + */ +{ + int argn; + char * arg; + + /* Set up default JPEG parameters. */ + requested_fmt = DEFAULT_FMT; /* set default output file format */ + outfilename = NULL; + cinfo->err->trace_level = 0; + + /* Scan command line options, adjust parameters */ + + for (argn = 1; argn < argc; argn++) { + arg = argv[argn]; + if (*arg != '-') { + /* Not a switch, must be a file name argument */ + if (argn <= last_file_arg_seen) { + outfilename = NULL; /* -outfile applies to just one input file */ + continue; /* ignore this name if previously processed */ + } + break; /* else done parsing switches */ + } + arg++; /* advance past switch marker character */ + + if (keymatch(arg, "bmp", 1)) { + /* BMP output format. */ + requested_fmt = FMT_BMP; + + } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) || + keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) { + /* Do color quantization. */ + int val; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%d", &val) != 1) + usage(); + cinfo->desired_number_of_colors = val; + cinfo->quantize_colors = TRUE; + + } else if (keymatch(arg, "dct", 2)) { + /* Select IDCT algorithm. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "int", 1)) { + cinfo->dct_method = JDCT_ISLOW; + } else if (keymatch(argv[argn], "fast", 2)) { + cinfo->dct_method = JDCT_IFAST; + } else if (keymatch(argv[argn], "float", 2)) { + cinfo->dct_method = JDCT_FLOAT; + } else + usage(); + + } else if (keymatch(arg, "dither", 2)) { + /* Select dithering algorithm. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "fs", 2)) { + cinfo->dither_mode = JDITHER_FS; + } else if (keymatch(argv[argn], "none", 2)) { + cinfo->dither_mode = JDITHER_NONE; + } else if (keymatch(argv[argn], "ordered", 2)) { + cinfo->dither_mode = JDITHER_ORDERED; + } else + usage(); + + } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { + /* Enable debug printouts. */ + /* On first -d, print version identification */ + static boolean printed_version = FALSE; + + if (! printed_version) { + fprintf(stderr, "Independent JPEG Group's DJPEG, version %s\n%s\n", + JVERSION, JCOPYRIGHT); + printed_version = TRUE; + } + cinfo->err->trace_level++; + + } else if (keymatch(arg, "fast", 1)) { + /* Select recommended processing options for quick-and-dirty output. */ + cinfo->two_pass_quantize = FALSE; + cinfo->dither_mode = JDITHER_ORDERED; + if (! cinfo->quantize_colors) /* don't override an earlier -colors */ + cinfo->desired_number_of_colors = 216; + cinfo->dct_method = JDCT_FASTEST; + cinfo->do_fancy_upsampling = FALSE; + + } else if (keymatch(arg, "gif", 1)) { + /* GIF output format. */ + requested_fmt = FMT_GIF; + + } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) { + /* Force monochrome output. */ + cinfo->out_color_space = JCS_GRAYSCALE; + + } else if (keymatch(arg, "map", 3)) { + /* Quantize to a color map taken from an input file. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (for_real) { /* too expensive to do twice! */ +#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ + FILE * mapfile; + + if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); + exit(EXIT_FAILURE); + } + read_color_map(cinfo, mapfile); + fclose(mapfile); + cinfo->quantize_colors = TRUE; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + + } else if (keymatch(arg, "maxmemory", 3)) { + /* Maximum memory in Kb (or Mb with 'm'). */ + long lval; + char ch = 'x'; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) + usage(); + if (ch == 'm' || ch == 'M') + lval *= 1000L; + cinfo->mem->max_memory_to_use = lval * 1000L; + + } else if (keymatch(arg, "nosmooth", 3)) { + /* Suppress fancy upsampling. */ + cinfo->do_fancy_upsampling = FALSE; + + } else if (keymatch(arg, "onepass", 3)) { + /* Use fast one-pass quantization. */ + cinfo->two_pass_quantize = FALSE; + + } else if (keymatch(arg, "os2", 3)) { + /* BMP output format (OS/2 flavor). */ + requested_fmt = FMT_OS2; + + } else if (keymatch(arg, "outfile", 4)) { + /* Set output file name. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + outfilename = argv[argn]; /* save it away for later use */ + + } else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) { + /* PPM/PGM output format. */ + requested_fmt = FMT_PPM; + + } else if (keymatch(arg, "rle", 1)) { + /* RLE output format. */ + requested_fmt = FMT_RLE; + + } else if (keymatch(arg, "scale", 1)) { + /* Scale the output image by a fraction M/N. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%u/%u", + &cinfo->scale_num, &cinfo->scale_denom) < 1) + usage(); + + } else if (keymatch(arg, "targa", 1)) { + /* Targa output format. */ + requested_fmt = FMT_TARGA; + + } else { + usage(); /* bogus switch */ + } + } + + return argn; /* return index of next arg (file name) */ +} + + +/* + * Marker processor for COM and interesting APPn markers. + * This replaces the library's built-in processor, which just skips the marker. + * We want to print out the marker as text, to the extent possible. + * Note this code relies on a non-suspending data source. + */ + +LOCAL(unsigned int) +jpeg_getc (j_decompress_ptr cinfo) +/* Read next byte */ +{ + struct jpeg_source_mgr * datasrc = cinfo->src; + + if (datasrc->bytes_in_buffer == 0) { + if (! (*datasrc->fill_input_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } + datasrc->bytes_in_buffer--; + return GETJOCTET(*datasrc->next_input_byte++); +} + + +METHODDEF(boolean) +print_text_marker (j_decompress_ptr cinfo) +{ + boolean traceit = (cinfo->err->trace_level >= 1); + INT32 length; + unsigned int ch; + unsigned int lastch = 0; + + length = jpeg_getc(cinfo) << 8; + length += jpeg_getc(cinfo); + length -= 2; /* discount the length word itself */ + + if (traceit) { + if (cinfo->unread_marker == JPEG_COM) + fprintf(stderr, "Comment, length %ld:\n", (long) length); + else /* assume it is an APPn otherwise */ + fprintf(stderr, "APP%d, length %ld:\n", + cinfo->unread_marker - JPEG_APP0, (long) length); + } + + while (--length >= 0) { + ch = jpeg_getc(cinfo); + if (traceit) { + /* Emit the character in a readable form. + * Nonprintables are converted to \nnn form, + * while \ is converted to \\. + * Newlines in CR, CR/LF, or LF form will be printed as one newline. + */ + if (ch == '\r') { + fprintf(stderr, "\n"); + } else if (ch == '\n') { + if (lastch != '\r') + fprintf(stderr, "\n"); + } else if (ch == '\\') { + fprintf(stderr, "\\\\"); + } else if (isprint(ch)) { + putc(ch, stderr); + } else { + fprintf(stderr, "\\%03o", ch); + } + lastch = ch; + } + } + + if (traceit) + fprintf(stderr, "\n"); + + return TRUE; +} + + +/* + * The main program. + */ + +int +main (int argc, char **argv) +{ + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; +#ifdef PROGRESS_REPORT + struct cdjpeg_progress_mgr progress; +#endif + int file_index; + djpeg_dest_ptr dest_mgr = NULL; + FILE * input_file; + FILE * output_file; + JDIMENSION num_scanlines; + + /* On Mac, fetch a command line. */ +#ifdef USE_CCOMMAND + argc = ccommand(&argv); +#endif + + progname = argv[0]; + if (progname == NULL || progname[0] == 0) + progname = "djpeg"; /* in case C library doesn't provide it */ + + /* Initialize the JPEG decompression object with default error handling. */ + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + /* Add some application-specific error messages (from cderror.h) */ + jerr.addon_message_table = cdjpeg_message_table; + jerr.first_addon_message = JMSG_FIRSTADDONCODE; + jerr.last_addon_message = JMSG_LASTADDONCODE; + + /* Insert custom marker processor for COM and APP12. + * APP12 is used by some digital camera makers for textual info, + * so we provide the ability to display it as text. + * If you like, additional APPn marker types can be selected for display, + * but don't try to override APP0 or APP14 this way (see libjpeg.doc). + */ + jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker); + jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker); + + /* Now safe to enable signal catcher. */ +#ifdef NEED_SIGNAL_CATCHER + enable_signal_catcher((j_common_ptr) &cinfo); +#endif + + /* Scan command line to find file names. */ + /* It is convenient to use just one switch-parsing routine, but the switch + * values read here are ignored; we will rescan the switches after opening + * the input file. + * (Exception: tracing level set here controls verbosity for COM markers + * found during jpeg_read_header...) + */ + + file_index = parse_switches(&cinfo, argc, argv, 0, FALSE); + +#ifdef TWO_FILE_COMMANDLINE + /* Must have either -outfile switch or explicit output file name */ + if (outfilename == NULL) { + if (file_index != argc-2) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + outfilename = argv[file_index+1]; + } else { + if (file_index != argc-1) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + } +#else + /* Unix style: expect zero or one file name */ + if (file_index < argc-1) { + fprintf(stderr, "%s: only one input file\n", progname); + usage(); + } +#endif /* TWO_FILE_COMMANDLINE */ + + /* Open the input file. */ + if (file_index < argc) { + if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]); + exit(EXIT_FAILURE); + } + } else { + /* default input file is stdin */ + input_file = read_stdin(); + } + + /* Open the output file. */ + if (outfilename != NULL) { + if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, outfilename); + exit(EXIT_FAILURE); + } + } else { + /* default output file is stdout */ + output_file = write_stdout(); + } + +#ifdef PROGRESS_REPORT + start_progress_monitor((j_common_ptr) &cinfo, &progress); +#endif + + /* Specify data source for decompression */ + jpeg_stdio_src(&cinfo, input_file); + + /* Read file header, set default decompression parameters */ + (void) jpeg_read_header(&cinfo, TRUE); + + /* Adjust default decompression parameters by re-parsing the options */ + file_index = parse_switches(&cinfo, argc, argv, 0, TRUE); + + /* Initialize the output module now to let it override any crucial + * option settings (for instance, GIF wants to force color quantization). + */ + switch (requested_fmt) { +#ifdef BMP_SUPPORTED + case FMT_BMP: + dest_mgr = jinit_write_bmp(&cinfo, FALSE); + break; + case FMT_OS2: + dest_mgr = jinit_write_bmp(&cinfo, TRUE); + break; +#endif +#ifdef GIF_SUPPORTED + case FMT_GIF: + dest_mgr = jinit_write_gif(&cinfo); + break; +#endif +#ifdef PPM_SUPPORTED + case FMT_PPM: + dest_mgr = jinit_write_ppm(&cinfo); + break; +#endif +#ifdef RLE_SUPPORTED + case FMT_RLE: + dest_mgr = jinit_write_rle(&cinfo); + break; +#endif +#ifdef TARGA_SUPPORTED + case FMT_TARGA: + dest_mgr = jinit_write_targa(&cinfo); + break; +#endif + default: + ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT); + break; + } + dest_mgr->output_file = output_file; + + /* Start decompressor */ + (void) jpeg_start_decompress(&cinfo); + + /* Write output file header */ + (*dest_mgr->start_output) (&cinfo, dest_mgr); + + /* Process data */ + while (cinfo.output_scanline < cinfo.output_height) { + num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer, + dest_mgr->buffer_height); + (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines); + } + +#ifdef PROGRESS_REPORT + /* Hack: count final pass as done in case finish_output does an extra pass. + * The library won't have updated completed_passes. + */ + progress.pub.completed_passes = progress.pub.total_passes; +#endif + + /* Finish decompression and release memory. + * I must do it in this order because output module has allocated memory + * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory. + */ + (*dest_mgr->finish_output) (&cinfo, dest_mgr); + (void) jpeg_finish_decompress(&cinfo); + jpeg_destroy_decompress(&cinfo); + + /* Close files, if we opened them */ + if (input_file != stdin) + fclose(input_file); + if (output_file != stdout) + fclose(output_file); + +#ifdef PROGRESS_REPORT + end_progress_monitor((j_common_ptr) &cinfo); +#endif + + /* All done. */ + exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS); + return 0; /* suppress no-return-value warnings */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/example.c b/thirdparty/LibJPEG/jpeg-9/example.c new file mode 100644 index 0000000..1d6f6cc --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/example.c @@ -0,0 +1,433 @@ +/* + * example.c + * + * This file illustrates how to use the IJG code as a subroutine library + * to read or write JPEG image files. You should look at this code in + * conjunction with the documentation file libjpeg.txt. + * + * This code will not do anything useful as-is, but it may be helpful as a + * skeleton for constructing routines that call the JPEG library. + * + * We present these routines in the same coding style used in the JPEG code + * (ANSI function definitions, etc); but you are of course free to code your + * routines in a different style if you prefer. + */ + +#include + +/* + * Include file for users of JPEG library. + * You will need to have included system headers that define at least + * the typedefs FILE and size_t before you can include jpeglib.h. + * (stdio.h is sufficient on ANSI-conforming systems.) + * You may also wish to include "jerror.h". + */ + +#include "jpeglib.h" + +/* + * is used for the optional error recovery mechanism shown in + * the second part of the example. + */ + +#include + + + +/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/ + +/* This half of the example shows how to feed data into the JPEG compressor. + * We present a minimal version that does not worry about refinements such + * as error recovery (the JPEG code will just exit() if it gets an error). + */ + + +/* + * IMAGE DATA FORMATS: + * + * The standard input image format is a rectangular array of pixels, with + * each pixel having the same number of "component" values (color channels). + * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars). + * If you are working with color data, then the color values for each pixel + * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit + * RGB color. + * + * For this example, we'll assume that this data structure matches the way + * our application has stored the image in memory, so we can just pass a + * pointer to our image buffer. In particular, let's say that the image is + * RGB color and is described by: + */ + +extern JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */ +extern int image_height; /* Number of rows in image */ +extern int image_width; /* Number of columns in image */ + + +/* + * Sample routine for JPEG compression. We assume that the target file name + * and a compression quality factor are passed in. + */ + +GLOBAL(void) +write_JPEG_file (char * filename, int quality) +{ + /* This struct contains the JPEG compression parameters and pointers to + * working space (which is allocated as needed by the JPEG library). + * It is possible to have several such structures, representing multiple + * compression/decompression processes, in existence at once. We refer + * to any one struct (and its associated working data) as a "JPEG object". + */ + struct jpeg_compress_struct cinfo; + /* This struct represents a JPEG error handler. It is declared separately + * because applications often want to supply a specialized error handler + * (see the second half of this file for an example). But here we just + * take the easy way out and use the standard error handler, which will + * print a message on stderr and call exit() if compression fails. + * Note that this struct must live as long as the main JPEG parameter + * struct, to avoid dangling-pointer problems. + */ + struct jpeg_error_mgr jerr; + /* More stuff */ + FILE * outfile; /* target file */ + JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ + int row_stride; /* physical row width in image buffer */ + + /* Step 1: allocate and initialize JPEG compression object */ + + /* We have to set up the error handler first, in case the initialization + * step fails. (Unlikely, but it could happen if you are out of memory.) + * This routine fills in the contents of struct jerr, and returns jerr's + * address which we place into the link field in cinfo. + */ + cinfo.err = jpeg_std_error(&jerr); + /* Now we can initialize the JPEG compression object. */ + jpeg_create_compress(&cinfo); + + /* Step 2: specify data destination (eg, a file) */ + /* Note: steps 2 and 3 can be done in either order. */ + + /* Here we use the library-supplied code to send compressed data to a + * stdio stream. You can also write your own code to do something else. + * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that + * requires it in order to write binary files. + */ + if ((outfile = fopen(filename, "wb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + exit(1); + } + jpeg_stdio_dest(&cinfo, outfile); + + /* Step 3: set parameters for compression */ + + /* First we supply a description of the input image. + * Four fields of the cinfo struct must be filled in: + */ + cinfo.image_width = image_width; /* image width and height, in pixels */ + cinfo.image_height = image_height; + cinfo.input_components = 3; /* # of color components per pixel */ + cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ + /* Now use the library's routine to set default compression parameters. + * (You must set at least cinfo.in_color_space before calling this, + * since the defaults depend on the source color space.) + */ + jpeg_set_defaults(&cinfo); + /* Now you can set any non-default parameters you wish to. + * Here we just illustrate the use of quality (quantization table) scaling: + */ + jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */); + + /* Step 4: Start compressor */ + + /* TRUE ensures that we will write a complete interchange-JPEG file. + * Pass TRUE unless you are very sure of what you're doing. + */ + jpeg_start_compress(&cinfo, TRUE); + + /* Step 5: while (scan lines remain to be written) */ + /* jpeg_write_scanlines(...); */ + + /* Here we use the library's state variable cinfo.next_scanline as the + * loop counter, so that we don't have to keep track ourselves. + * To keep things simple, we pass one scanline per call; you can pass + * more if you wish, though. + */ + row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */ + + while (cinfo.next_scanline < cinfo.image_height) { + /* jpeg_write_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could pass + * more than one scanline at a time if that's more convenient. + */ + row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride]; + (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + + /* Step 6: Finish compression */ + + jpeg_finish_compress(&cinfo); + /* After finish_compress, we can close the output file. */ + fclose(outfile); + + /* Step 7: release JPEG compression object */ + + /* This is an important step since it will release a good deal of memory. */ + jpeg_destroy_compress(&cinfo); + + /* And we're done! */ +} + + +/* + * SOME FINE POINTS: + * + * In the above loop, we ignored the return value of jpeg_write_scanlines, + * which is the number of scanlines actually written. We could get away + * with this because we were only relying on the value of cinfo.next_scanline, + * which will be incremented correctly. If you maintain additional loop + * variables then you should be careful to increment them properly. + * Actually, for output to a stdio stream you needn't worry, because + * then jpeg_write_scanlines will write all the lines passed (or else exit + * with a fatal error). Partial writes can only occur if you use a data + * destination module that can demand suspension of the compressor. + * (If you don't know what that's for, you don't need it.) + * + * If the compressor requires full-image buffers (for entropy-coding + * optimization or a multi-scan JPEG file), it will create temporary + * files for anything that doesn't fit within the maximum-memory setting. + * (Note that temp files are NOT needed if you use the default parameters.) + * On some systems you may need to set up a signal handler to ensure that + * temporary files are deleted if the program is interrupted. See libjpeg.txt. + * + * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG + * files to be compatible with everyone else's. If you cannot readily read + * your data in that order, you'll need an intermediate array to hold the + * image. See rdtarga.c or rdbmp.c for examples of handling bottom-to-top + * source data using the JPEG code's internal virtual-array mechanisms. + */ + + + +/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/ + +/* This half of the example shows how to read data from the JPEG decompressor. + * It's a bit more refined than the above, in that we show: + * (a) how to modify the JPEG library's standard error-reporting behavior; + * (b) how to allocate workspace using the library's memory manager. + * + * Just to make this example a little different from the first one, we'll + * assume that we do not intend to put the whole image into an in-memory + * buffer, but to send it line-by-line someplace else. We need a one- + * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG + * memory manager allocate it for us. This approach is actually quite useful + * because we don't need to remember to deallocate the buffer separately: it + * will go away automatically when the JPEG object is cleaned up. + */ + + +/* + * ERROR HANDLING: + * + * The JPEG library's standard error handler (jerror.c) is divided into + * several "methods" which you can override individually. This lets you + * adjust the behavior without duplicating a lot of code, which you might + * have to update with each future release. + * + * Our example here shows how to override the "error_exit" method so that + * control is returned to the library's caller when a fatal error occurs, + * rather than calling exit() as the standard error_exit method does. + * + * We use C's setjmp/longjmp facility to return control. This means that the + * routine which calls the JPEG library must first execute a setjmp() call to + * establish the return point. We want the replacement error_exit to do a + * longjmp(). But we need to make the setjmp buffer accessible to the + * error_exit routine. To do this, we make a private extension of the + * standard JPEG error handler object. (If we were using C++, we'd say we + * were making a subclass of the regular error handler.) + * + * Here's the extended error handler struct: + */ + +struct my_error_mgr { + struct jpeg_error_mgr pub; /* "public" fields */ + + jmp_buf setjmp_buffer; /* for return to caller */ +}; + +typedef struct my_error_mgr * my_error_ptr; + +/* + * Here's the routine that will replace the standard error_exit method: + */ + +METHODDEF(void) +my_error_exit (j_common_ptr cinfo) +{ + /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ + my_error_ptr myerr = (my_error_ptr) cinfo->err; + + /* Always display the message. */ + /* We could postpone this until after returning, if we chose. */ + (*cinfo->err->output_message) (cinfo); + + /* Return control to the setjmp point */ + longjmp(myerr->setjmp_buffer, 1); +} + + +/* + * Sample routine for JPEG decompression. We assume that the source file name + * is passed in. We want to return 1 on success, 0 on error. + */ + + +GLOBAL(int) +read_JPEG_file (char * filename) +{ + /* This struct contains the JPEG decompression parameters and pointers to + * working space (which is allocated as needed by the JPEG library). + */ + struct jpeg_decompress_struct cinfo; + /* We use our private extension JPEG error handler. + * Note that this struct must live as long as the main JPEG parameter + * struct, to avoid dangling-pointer problems. + */ + struct my_error_mgr jerr; + /* More stuff */ + FILE * infile; /* source file */ + JSAMPARRAY buffer; /* Output row buffer */ + int row_stride; /* physical row width in output buffer */ + + /* In this example we want to open the input file before doing anything else, + * so that the setjmp() error recovery below can assume the file is open. + * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that + * requires it in order to read binary files. + */ + + if ((infile = fopen(filename, "rb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + return 0; + } + + /* Step 1: allocate and initialize JPEG decompression object */ + + /* We set up the normal JPEG error routines, then override error_exit. */ + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.pub.error_exit = my_error_exit; + /* Establish the setjmp return context for my_error_exit to use. */ + if (setjmp(jerr.setjmp_buffer)) { + /* If we get here, the JPEG code has signaled an error. + * We need to clean up the JPEG object, close the input file, and return. + */ + jpeg_destroy_decompress(&cinfo); + fclose(infile); + return 0; + } + /* Now we can initialize the JPEG decompression object. */ + jpeg_create_decompress(&cinfo); + + /* Step 2: specify data source (eg, a file) */ + + jpeg_stdio_src(&cinfo, infile); + + /* Step 3: read file parameters with jpeg_read_header() */ + + (void) jpeg_read_header(&cinfo, TRUE); + /* We can ignore the return value from jpeg_read_header since + * (a) suspension is not possible with the stdio data source, and + * (b) we passed TRUE to reject a tables-only JPEG file as an error. + * See libjpeg.txt for more info. + */ + + /* Step 4: set parameters for decompression */ + + /* In this example, we don't need to change any of the defaults set by + * jpeg_read_header(), so we do nothing here. + */ + + /* Step 5: Start decompressor */ + + (void) jpeg_start_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* We may need to do some setup of our own at this point before reading + * the data. After jpeg_start_decompress() we have the correct scaled + * output image dimensions available, as well as the output colormap + * if we asked for color quantization. + * In this example, we need to make an output work buffer of the right size. + */ + /* JSAMPLEs per row in output buffer */ + row_stride = cinfo.output_width * cinfo.output_components; + /* Make a one-row-high sample array that will go away when done with image */ + buffer = (*cinfo.mem->alloc_sarray) + ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); + + /* Step 6: while (scan lines remain to be read) */ + /* jpeg_read_scanlines(...); */ + + /* Here we use the library's state variable cinfo.output_scanline as the + * loop counter, so that we don't have to keep track ourselves. + */ + while (cinfo.output_scanline < cinfo.output_height) { + /* jpeg_read_scanlines expects an array of pointers to scanlines. + * Here the array is only one element long, but you could ask for + * more than one scanline at a time if that's more convenient. + */ + (void) jpeg_read_scanlines(&cinfo, buffer, 1); + /* Assume put_scanline_someplace wants a pointer and sample count. */ + put_scanline_someplace(buffer[0], row_stride); + } + + /* Step 7: Finish decompression */ + + (void) jpeg_finish_decompress(&cinfo); + /* We can ignore the return value since suspension is not possible + * with the stdio data source. + */ + + /* Step 8: Release JPEG decompression object */ + + /* This is an important step since it will release a good deal of memory. */ + jpeg_destroy_decompress(&cinfo); + + /* After finish_decompress, we can close the input file. + * Here we postpone it until after no more JPEG errors are possible, + * so as to simplify the setjmp error logic above. (Actually, I don't + * think that jpeg_destroy can do an error exit, but why assume anything...) + */ + fclose(infile); + + /* At this point you may want to check to see whether any corrupt-data + * warnings occurred (test whether jerr.pub.num_warnings is nonzero). + */ + + /* And we're done! */ + return 1; +} + + +/* + * SOME FINE POINTS: + * + * In the above code, we ignored the return value of jpeg_read_scanlines, + * which is the number of scanlines actually read. We could get away with + * this because we asked for only one line at a time and we weren't using + * a suspending data source. See libjpeg.txt for more info. + * + * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress(); + * we should have done it beforehand to ensure that the space would be + * counted against the JPEG max_memory setting. In some systems the above + * code would risk an out-of-memory error. However, in general we don't + * know the output image dimensions before jpeg_start_decompress(), unless we + * call jpeg_calc_output_dimensions(). See libjpeg.txt for more about this. + * + * Scanlines are returned in the same order as they appear in the JPEG file, + * which is standardly top-to-bottom. If you must emit data bottom-to-top, + * you can use one of the virtual arrays provided by the JPEG memory manager + * to invert the data. See wrbmp.c for an example. + * + * As with compression, some operating modes may require temporary files. + * On some systems you may need to set up a signal handler to ensure that + * temporary files are deleted if the program is interrupted. See libjpeg.txt. + */ diff --git a/thirdparty/LibJPEG/jpeg-9/filelist.txt b/thirdparty/LibJPEG/jpeg-9/filelist.txt new file mode 100644 index 0000000..86633bc --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/filelist.txt @@ -0,0 +1,214 @@ +IJG JPEG LIBRARY: FILE LIST + +Copyright (C) 1994-2012, Thomas G. Lane, Guido Vollbeding. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +Here is a road map to the files in the IJG JPEG distribution. The +distribution includes the JPEG library proper, plus two application +programs ("cjpeg" and "djpeg") which use the library to convert JPEG +files to and from some other popular image formats. A third application +"jpegtran" uses the library to do lossless conversion between different +variants of JPEG. There are also two stand-alone applications, +"rdjpgcom" and "wrjpgcom". + + +THE JPEG LIBRARY +================ + +Include files: + +jpeglib.h JPEG library's exported data and function declarations. +jconfig.h Configuration declarations. Note: this file is not present + in the distribution; it is generated during installation. +jmorecfg.h Additional configuration declarations; need not be changed + for a standard installation. +jerror.h Declares JPEG library's error and trace message codes. +jinclude.h Central include file used by all IJG .c files to reference + system include files. +jpegint.h JPEG library's internal data structures. +jdct.h Private declarations for forward & reverse DCT subsystems. +jmemsys.h Private declarations for memory management subsystem. +jversion.h Version information. + +Applications using the library should include jpeglib.h (which in turn +includes jconfig.h and jmorecfg.h). Optionally, jerror.h may be included +if the application needs to reference individual JPEG error codes. The +other include files are intended for internal use and would not normally +be included by an application program. (cjpeg/djpeg/etc do use jinclude.h, +since its function is to improve portability of the whole IJG distribution. +Most other applications will directly include the system include files they +want, and hence won't need jinclude.h.) + + +C source code files: + +These files contain most of the functions intended to be called directly by +an application program: + +jcapimin.c Application program interface: core routines for compression. +jcapistd.c Application program interface: standard compression. +jdapimin.c Application program interface: core routines for decompression. +jdapistd.c Application program interface: standard decompression. +jcomapi.c Application program interface routines common to compression + and decompression. +jcparam.c Compression parameter setting helper routines. +jctrans.c API and library routines for transcoding compression. +jdtrans.c API and library routines for transcoding decompression. + +Compression side of the library: + +jcinit.c Initialization: determines which other modules to use. +jcmaster.c Master control: setup and inter-pass sequencing logic. +jcmainct.c Main buffer controller (preprocessor => JPEG compressor). +jcprepct.c Preprocessor buffer controller. +jccoefct.c Buffer controller for DCT coefficient buffer. +jccolor.c Color space conversion. +jcsample.c Downsampling. +jcdctmgr.c DCT manager (DCT implementation selection & control). +jfdctint.c Forward DCT using slow-but-accurate integer method. +jfdctfst.c Forward DCT using faster, less accurate integer method. +jfdctflt.c Forward DCT using floating-point arithmetic. +jchuff.c Huffman entropy coding. +jcarith.c Arithmetic entropy coding. +jcmarker.c JPEG marker writing. +jdatadst.c Data destination managers for memory and stdio output. + +Decompression side of the library: + +jdmaster.c Master control: determines which other modules to use. +jdinput.c Input controller: controls input processing modules. +jdmainct.c Main buffer controller (JPEG decompressor => postprocessor). +jdcoefct.c Buffer controller for DCT coefficient buffer. +jdpostct.c Postprocessor buffer controller. +jdmarker.c JPEG marker reading. +jdhuff.c Huffman entropy decoding. +jdarith.c Arithmetic entropy decoding. +jddctmgr.c IDCT manager (IDCT implementation selection & control). +jidctint.c Inverse DCT using slow-but-accurate integer method. +jidctfst.c Inverse DCT using faster, less accurate integer method. +jidctflt.c Inverse DCT using floating-point arithmetic. +jdsample.c Upsampling. +jdcolor.c Color space conversion. +jdmerge.c Merged upsampling/color conversion (faster, lower quality). +jquant1.c One-pass color quantization using a fixed-spacing colormap. +jquant2.c Two-pass color quantization using a custom-generated colormap. + Also handles one-pass quantization to an externally given map. +jdatasrc.c Data source managers for memory and stdio input. + +Support files for both compression and decompression: + +jaricom.c Tables for common use in arithmetic entropy encoding and + decoding routines. +jerror.c Standard error handling routines (application replaceable). +jmemmgr.c System-independent (more or less) memory management code. +jutils.c Miscellaneous utility routines. + +jmemmgr.c relies on a system-dependent memory management module. The IJG +distribution includes the following implementations of the system-dependent +module: + +jmemnobs.c "No backing store": assumes adequate virtual memory exists. +jmemansi.c Makes temporary files with ANSI-standard routine tmpfile(). +jmemname.c Makes temporary files with program-generated file names. +jmemdos.c Custom implementation for MS-DOS (16-bit environment only): + can use extended and expanded memory as well as temp files. +jmemmac.c Custom implementation for Apple Macintosh. + +Exactly one of the system-dependent modules should be configured into an +installed JPEG library (see install.txt for hints about which one to use). +On unusual systems you may find it worthwhile to make a special +system-dependent memory manager. + + +Non-C source code files: + +jmemdosa.asm 80x86 assembly code support for jmemdos.c; used only in + MS-DOS-specific configurations of the JPEG library. + + +CJPEG/DJPEG/JPEGTRAN +==================== + +Include files: + +cdjpeg.h Declarations shared by cjpeg/djpeg/jpegtran modules. +cderror.h Additional error and trace message codes for cjpeg et al. +transupp.h Declarations for jpegtran support routines in transupp.c. + +C source code files: + +cjpeg.c Main program for cjpeg. +djpeg.c Main program for djpeg. +jpegtran.c Main program for jpegtran. +cdjpeg.c Utility routines used by all three programs. +rdcolmap.c Code to read a colormap file for djpeg's "-map" switch. +rdswitch.c Code to process some of cjpeg's more complex switches. + Also used by jpegtran. +transupp.c Support code for jpegtran: lossless image manipulations. + +Image file reader modules for cjpeg: + +rdbmp.c BMP file input. +rdgif.c GIF file input (now just a stub). +rdppm.c PPM/PGM file input. +rdrle.c Utah RLE file input. +rdtarga.c Targa file input. + +Image file writer modules for djpeg: + +wrbmp.c BMP file output. +wrgif.c GIF file output (a mere shadow of its former self). +wrppm.c PPM/PGM file output. +wrrle.c Utah RLE file output. +wrtarga.c Targa file output. + + +RDJPGCOM/WRJPGCOM +================= + +C source code files: + +rdjpgcom.c Stand-alone rdjpgcom application. +wrjpgcom.c Stand-alone wrjpgcom application. + +These programs do not depend on the IJG library. They do use +jconfig.h and jinclude.h, only to improve portability. + + +ADDITIONAL FILES +================ + +Documentation (see README for a guide to the documentation files): + +README Master documentation file. +*.txt Other documentation files. +*.1 Documentation in Unix man page format. +change.log Version-to-version change highlights. +example.c Sample code for calling JPEG library. + +Configuration/installation files and programs (see install.txt for more info): + +configure Unix shell script to perform automatic configuration. +configure.ac Source file for use with Autoconf to generate configure. +ltmain.sh Support scripts for configure (from GNU libtool). +config.guess +config.sub +depcomp +missing +ar-lib +install-sh Install shell script for those Unix systems lacking one. +Makefile.in Makefile input for configure. +Makefile.am Source file for use with Automake to generate Makefile.in. +ckconfig.c Program to generate jconfig.h on non-Unix systems. +jconfig.txt Template for making jconfig.h by hand. +mak*.* Sample makefiles for particular systems. +jconfig.* Sample jconfig.h for particular systems. +libjpeg.map Script to generate shared library with versioned symbols. +aclocal.m4 M4 macro definitions for use with Autoconf. + +Test files (see install.txt for test procedure): + +test*.* Source and comparison files for confidence test. + These are binary image files, NOT text files. diff --git a/thirdparty/LibJPEG/jpeg-9/install-sh b/thirdparty/LibJPEG/jpeg-9/install-sh new file mode 100644 index 0000000..377bb86 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/LibJPEG/jpeg-9/install.txt b/thirdparty/LibJPEG/jpeg-9/install.txt new file mode 100644 index 0000000..7ca92cb --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/install.txt @@ -0,0 +1,1096 @@ +INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software + +Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +This file explains how to configure and install the IJG software. We have +tried to make this software extremely portable and flexible, so that it can be +adapted to almost any environment. The downside of this decision is that the +installation process is complicated. We have provided shortcuts to simplify +the task on common systems. But in any case, you will need at least a little +familiarity with C programming and program build procedures for your system. + +If you are only using this software as part of a larger program, the larger +program's installation procedure may take care of configuring the IJG code. +For example, Ghostscript's installation script will configure the IJG code. +You don't need to read this file if you just want to compile Ghostscript. + +If you are on a Unix machine, you may not need to read this file at all. +Try doing + ./configure + make + make test +If that doesn't complain, do + make install +(better do "make -n install" first to see if the makefile will put the files +where you want them). Read further if you run into snags or want to customize +the code for your system. + + +TABLE OF CONTENTS +----------------- + +Before you start +Configuring the software: + using the automatic "configure" script + using one of the supplied jconfig and makefile files + by hand +Building the software +Testing the software +Installing the software +Optional stuff +Optimization +Hints for specific systems + + +BEFORE YOU START +================ + +Before installing the software you must unpack the distributed source code. +Since you are reading this file, you have probably already succeeded in this +task. However, there is a potential for error if you needed to convert the +files to the local standard text file format (for example, if you are on +MS-DOS you may have converted LF end-of-line to CR/LF). You must apply +such conversion to all the files EXCEPT those whose names begin with "test". +The test files contain binary data; if you change them in any way then the +self-test will give bad results. + +Please check the last section of this file to see if there are hints for the +specific machine or compiler you are using. + + +CONFIGURING THE SOFTWARE +======================== + +To configure the IJG code for your system, you need to create two files: + * jconfig.h: contains values for system-dependent #define symbols. + * Makefile: controls the compilation process. +(On a non-Unix machine, you may create "project files" or some other +substitute for a Makefile. jconfig.h is needed in any environment.) + +We provide three different ways to generate these files: + * On a Unix system, you can just run the "configure" script. + * We provide sample jconfig files and makefiles for popular machines; + if your machine matches one of the samples, just copy the right sample + files to jconfig.h and Makefile. + * If all else fails, read the instructions below and make your own files. + + +Configuring the software using the automatic "configure" script +--------------------------------------------------------------- + +If you are on a Unix machine, you can just type + ./configure +and let the configure script construct appropriate configuration files. +If you're using "csh" on an old version of System V, you might need to type + sh configure +instead to prevent csh from trying to execute configure itself. +Expect configure to run for a few minutes, particularly on slower machines; +it works by compiling a series of test programs. + +Configure was created with GNU Autoconf and it follows the usual conventions +for GNU configure scripts. It makes a few assumptions that you may want to +override. You can do this by providing optional switches to configure: + +* Configure will build both static and shared libraries, if possible. +If you want to build libjpeg only as a static library, say + ./configure --disable-shared +If you want to build libjpeg only as a shared library, say + ./configure --disable-static +Configure uses GNU libtool to take care of system-dependent shared library +building methods. + +* Configure will use gcc (GNU C compiler) if it's available, otherwise cc. +To force a particular compiler to be selected, use the CC option, for example + ./configure CC='cc' +The same method can be used to include any unusual compiler switches. +For example, on HP-UX you probably want to say + ./configure CC='cc -Aa' +to get HP's compiler to run in ANSI mode. + +* The default CFLAGS setting is "-g" for non-gcc compilers, "-g -O2" for gcc. +You can override this by saying, for example, + ./configure CFLAGS='-O2' +if you want to compile without debugging support. + +* Configure will set up the makefile so that "make install" will install files +into /usr/local/bin, /usr/local/man, etc. You can specify an installation +prefix other than "/usr/local" by giving configure the option "--prefix=PATH". + +* If you don't have a lot of swap space, you may need to enable the IJG +software's internal virtual memory mechanism. To do this, give the option +"--enable-maxmem=N" where N is the default maxmemory limit in megabytes. +This is discussed in more detail under "Selecting a memory manager", below. +You probably don't need to worry about this on reasonably-sized Unix machines, +unless you plan to process very large images. + +Configure has some other features that are useful if you are cross-compiling +or working in a network of multiple machine types; but if you need those +features, you probably already know how to use them. + + +Configuring the software using one of the supplied jconfig and makefile files +----------------------------------------------------------------------------- + +If you have one of these systems, you can just use the provided configuration +files: + +Makefile jconfig file System and/or compiler + +makefile.manx jconfig.manx Amiga, Manx Aztec C +makefile.sas jconfig.sas Amiga, SAS C +makeproj.mac jconfig.mac Apple Macintosh, Metrowerks CodeWarrior +mak*jpeg.st jconfig.st Atari ST/STE/TT, Pure C or Turbo C +makefile.bcc jconfig.bcc MS-DOS or OS/2, Borland C +makefile.dj jconfig.dj MS-DOS, DJGPP (Delorie's port of GNU C) +makefile.mc6 jconfig.mc6 MS-DOS, Microsoft C (16-bit only) +makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C +makefile.vc jconfig.vc Windows NT/95, MS Visual C++ +make*.vc6 jconfig.vc Windows NT/95, MS Visual C++ 6 +make*.v10 jconfig.vc Windows NT/95, MS Visual C++ 2010 (v10) +makefile.mms jconfig.vms Digital VMS, with MMS software +makefile.vms jconfig.vms Digital VMS, without MMS software + +Copy the proper jconfig file to jconfig.h and the makefile to Makefile (or +whatever your system uses as the standard makefile name). For more info see +the appropriate system-specific hints section near the end of this file. + + +Configuring the software by hand +-------------------------------- + +First, generate a jconfig.h file. If you are moderately familiar with C, +the comments in jconfig.txt should be enough information to do this; just +copy jconfig.txt to jconfig.h and edit it appropriately. Otherwise, you may +prefer to use the ckconfig.c program. You will need to compile and execute +ckconfig.c by hand --- we hope you know at least enough to do that. +ckconfig.c may not compile the first try (in fact, the whole idea is for it +to fail if anything is going to). If you get compile errors, fix them by +editing ckconfig.c according to the directions given in ckconfig.c. Once +you get it to run, it will write a suitable jconfig.h file, and will also +print out some advice about which makefile to use. + +You may also want to look at the canned jconfig files, if there is one for a +system similar to yours. + +Second, select a makefile and copy it to Makefile (or whatever your system +uses as the standard makefile name). The most generic makefiles we provide +are + makefile.ansi: if your C compiler supports function prototypes + makefile.unix: if not. +(You have function prototypes if ckconfig.c put "#define HAVE_PROTOTYPES" +in jconfig.h.) You may want to start from one of the other makefiles if +there is one for a system similar to yours. + +Look over the selected Makefile and adjust options as needed. In particular +you may want to change the CC and CFLAGS definitions. For instance, if you +are using GCC, set CC=gcc. If you had to use any compiler switches to get +ckconfig.c to work, make sure the same switches are in CFLAGS. + +If you are on a system that doesn't use makefiles, you'll need to set up +project files (or whatever you do use) to compile all the source files and +link them into executable files cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom. +See the file lists in any of the makefiles to find out which files go into +each program. Note that the provided makefiles all make a "library" file +libjpeg first, but you don't have to do that if you don't want to; the file +lists identify which source files are actually needed for compression, +decompression, or both. As a last resort, you can make a batch script that +just compiles everything and links it all together; makefile.vms is an example +of this (it's for VMS systems that have no make-like utility). + +Here are comments about some specific configuration decisions you'll +need to make: + +Command line style +------------------ + +These programs can use a Unix-like command line style which supports +redirection and piping, like this: + cjpeg inputfile >outputfile + cjpeg outputfile + source program | cjpeg >outputfile +The simpler "two file" command line style is just + cjpeg inputfile outputfile +You may prefer the two-file style, particularly if you don't have pipes. + +You MUST use two-file style on any system that doesn't cope well with binary +data fed through stdin/stdout; this is true for some MS-DOS compilers, for +example. If you're not on a Unix system, it's safest to assume you need +two-file style. (But if your compiler provides either the Posix-standard +fdopen() library routine or a Microsoft-compatible setmode() routine, you +can safely use the Unix command line style, by defining USE_FDOPEN or +USE_SETMODE respectively.) + +To use the two-file style, make jconfig.h say "#define TWO_FILE_COMMANDLINE". + +Selecting a memory manager +-------------------------- + +The IJG code is capable of working on images that are too big to fit in main +memory; data is swapped out to temporary files as necessary. However, the +code to do this is rather system-dependent. We provide five different +memory managers: + +* jmemansi.c This version uses the ANSI-standard library routine tmpfile(), + which not all non-ANSI systems have. On some systems + tmpfile() may put the temporary file in a non-optimal + location; if you don't like what it does, use jmemname.c. + +* jmemname.c This version creates named temporary files. For anything + except a Unix machine, you'll need to configure the + select_file_name() routine appropriately; see the comments + near the head of jmemname.c. If you use this version, define + NEED_SIGNAL_CATCHER in jconfig.h to make sure the temp files + are removed if the program is aborted. + +* jmemnobs.c (That stands for No Backing Store :-).) This will compile on + almost any system, but it assumes you have enough main memory + or virtual memory to hold the biggest images you work with. + +* jmemdos.c This should be used with most 16-bit MS-DOS compilers. + See the system-specific notes about MS-DOS for more info. + IMPORTANT: if you use this, define USE_MSDOS_MEMMGR in + jconfig.h, and include the assembly file jmemdosa.asm in the + programs. The supplied makefiles and jconfig files for + 16-bit MS-DOS compilers already do both. + +* jmemmac.c Custom version for Apple Macintosh; see the system-specific + notes for Macintosh for more info. + +To use a particular memory manager, change the SYSDEPMEM variable in your +makefile to equal the corresponding object file name (for example, jmemansi.o +or jmemansi.obj for jmemansi.c). + +If you have plenty of (real or virtual) main memory, just use jmemnobs.c. +"Plenty" means about ten bytes for every pixel in the largest images +you plan to process, so a lot of systems don't meet this criterion. +If yours doesn't, try jmemansi.c first. If that doesn't compile, you'll have +to use jmemname.c; be sure to adjust select_file_name() for local conditions. +You may also need to change unlink() to remove() in close_backing_store(). + +Except with jmemnobs.c or jmemmac.c, you need to adjust the DEFAULT_MAX_MEM +setting to a reasonable value for your system (either by adding a #define for +DEFAULT_MAX_MEM to jconfig.h, or by adding a -D switch to the Makefile). +This value limits the amount of data space the program will attempt to +allocate. Code and static data space isn't counted, so the actual memory +needs for cjpeg or djpeg are typically 100 to 150Kb more than the max-memory +setting. Larger max-memory settings reduce the amount of I/O needed to +process a large image, but too large a value can result in "insufficient +memory" failures. On most Unix machines (and other systems with virtual +memory), just set DEFAULT_MAX_MEM to several million and forget it. At the +other end of the spectrum, for MS-DOS machines you probably can't go much +above 300K to 400K. (On MS-DOS the value refers to conventional memory only. +Extended/expanded memory is handled separately by jmemdos.c.) + + +BUILDING THE SOFTWARE +===================== + +Now you should be able to compile the software. Just say "make" (or +whatever's necessary to start the compilation). Have a cup of coffee. + +Here are some things that could go wrong: + +If your compiler complains about undefined structures, you should be able to +shut it up by putting "#define INCOMPLETE_TYPES_BROKEN" in jconfig.h. + +If you have trouble with missing system include files or inclusion of the +wrong ones, read jinclude.h. This shouldn't happen if you used configure +or ckconfig.c to set up jconfig.h. + +There are a fair number of routines that do not use all of their parameters; +some compilers will issue warnings about this, which you can ignore. There +are also a few configuration checks that may give "unreachable code" warnings. +Any other warning deserves investigation. + +If you don't have a getenv() library routine, define NO_GETENV. + +Also see the system-specific hints, below. + + +TESTING THE SOFTWARE +==================== + +As a quick test of functionality we've included a small sample image in +several forms: + testorig.jpg Starting point for the djpeg tests. + testimg.ppm The output of djpeg testorig.jpg + testimg.bmp The output of djpeg -bmp -colors 256 testorig.jpg + testimg.jpg The output of cjpeg testimg.ppm + testprog.jpg Progressive-mode equivalent of testorig.jpg. + testimgp.jpg The output of cjpeg -progressive -optimize testimg.ppm +(The first- and second-generation .jpg files aren't identical since the +default compression parameters are lossy.) If you can generate duplicates +of the testimg* files then you probably have working programs. + +With most of the makefiles, "make test" will perform the necessary +comparisons. + +If you're using a makefile that doesn't provide the test option, run djpeg +and cjpeg by hand and compare the output files to testimg* with whatever +binary file comparison tool you have. The files should be bit-for-bit +identical. + +If the programs complain "MAX_ALLOC_CHUNK is wrong, please fix", then you +need to reduce MAX_ALLOC_CHUNK to a value that fits in type size_t. +Try adding "#define MAX_ALLOC_CHUNK 65520L" to jconfig.h. A less likely +configuration error is "ALIGN_TYPE is wrong, please fix": defining ALIGN_TYPE +as long should take care of that one. + +If the cjpeg test run fails with "Missing Huffman code table entry", it's a +good bet that you needed to define RIGHT_SHIFT_IS_UNSIGNED. Go back to the +configuration step and run ckconfig.c. (This is a good plan for any other +test failure, too.) + +If you are using Unix (one-file) command line style on a non-Unix system, +it's a good idea to check that binary I/O through stdin/stdout actually +works. You should get the same results from "djpeg out.ppm" +as from "djpeg -outfile out.ppm testorig.jpg". Note that the makefiles all +use the latter style and therefore do not exercise stdin/stdout! If this +check fails, try recompiling with USE_SETMODE or USE_FDOPEN defined. +If it still doesn't work, better use two-file style. + +If you chose a memory manager other than jmemnobs.c, you should test that +temporary-file usage works. Try "djpeg -bmp -colors 256 -max 0 testorig.jpg" +and make sure its output matches testimg.bmp. If you have any really large +images handy, try compressing them with -optimize and/or decompressing with +-colors 256 to make sure your DEFAULT_MAX_MEM setting is not too large. + +NOTE: this is far from an exhaustive test of the JPEG software; some modules, +such as 1-pass color quantization, are not exercised at all. It's just a +quick test to give you some confidence that you haven't missed something +major. + + +INSTALLING THE SOFTWARE +======================= + +Once you're done with the above steps, you can install the software by +copying the executable files (cjpeg, djpeg, jpegtran, rdjpgcom, and wrjpgcom) +to wherever you normally install programs. On Unix systems, you'll also want +to put the man pages (cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1) +in the man-page directory. The pre-fab makefiles don't support this step +since there's such a wide variety of installation procedures on different +systems. + +If you generated a Makefile with the "configure" script, you can just say + make install +to install the programs and their man pages into the standard places. +(You'll probably need to be root to do this.) We recommend first saying + make -n install +to see where configure thought the files should go. You may need to edit +the Makefile, particularly if your system's conventions for man page +filenames don't match what configure expects. + +If you want to install the IJG library itself, for use in compiling other +programs besides ours, then you need to put the four include files + jpeglib.h jerror.h jconfig.h jmorecfg.h +into your include-file directory, and put the library file libjpeg.a +(extension may vary depending on system) wherever library files go. +If you generated a Makefile with "configure", it will do what it thinks +is the right thing if you say + make install-lib + + +OPTIONAL STUFF +============== + +Progress monitor: + +If you like, you can #define PROGRESS_REPORT (in jconfig.h) to enable display +of percent-done progress reports. The routine provided in cdjpeg.c merely +prints percentages to stderr, but you can customize it to do something +fancier. + +Utah RLE file format support: + +We distribute the software with support for RLE image files (Utah Raster +Toolkit format) disabled, because the RLE support won't compile without the +Utah library. If you have URT version 3.1 or later, you can enable RLE +support as follows: + 1. #define RLE_SUPPORTED in jconfig.h. + 2. Add a -I option to CFLAGS in the Makefile for the directory + containing the URT .h files (typically the "include" + subdirectory of the URT distribution). + 3. Add -L... -lrle to LDLIBS in the Makefile, where ... specifies + the directory containing the URT "librle.a" file (typically the + "lib" subdirectory of the URT distribution). + +Support for 12-bit-deep pixel data: + +The JPEG standard allows either 8-bit or 12-bit data precision. (For color, +this means 8 or 12 bits per channel, of course.) If you need to work with +deeper than 8-bit data, you can compile the IJG code for 12-bit operation. +To do so: + 1. In jmorecfg.h, define BITS_IN_JSAMPLE as 12 rather than 8. + 2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED, + because the code for those formats doesn't handle 12-bit data and won't + even compile. (The PPM code does work, as explained below. The GIF + code works too; it scales 8-bit GIF data to and from 12-bit depth + automatically.) + 3. Compile. Don't expect "make test" to pass, since the supplied test + files are for 8-bit data. + +Currently, 12-bit support does not work on 16-bit-int machines. + +Note that a 12-bit version will not read 8-bit JPEG files, nor vice versa; +so you'll want to keep around a regular 8-bit compilation as well. +(Run-time selection of data depth, to allow a single copy that does both, +is possible but would probably slow things down considerably; it's very low +on our to-do list.) + +The PPM reader (rdppm.c) can read 12-bit data from either text-format or +binary-format PPM and PGM files. Binary-format PPM/PGM files which have a +maxval greater than 255 are assumed to use 2 bytes per sample, MSB first +(big-endian order). As of early 1995, 2-byte binary format is not +officially supported by the PBMPLUS library, but it is expected that a +future release of PBMPLUS will support it. Note that the PPM reader will +read files of any maxval regardless of the BITS_IN_JSAMPLE setting; incoming +data is automatically rescaled to either maxval=255 or maxval=4095 as +appropriate for the cjpeg bit depth. + +The PPM writer (wrppm.c) will normally write 2-byte binary PPM or PGM +format, maxval 4095, when compiled with BITS_IN_JSAMPLE=12. Since this +format is not yet widely supported, you can disable it by compiling wrppm.c +with PPM_NORAWWORD defined; then the data is scaled down to 8 bits to make a +standard 1-byte/sample PPM or PGM file. (Yes, this means still another copy +of djpeg to keep around. But hopefully you won't need it for very long. +Poskanzer's supposed to get that new PBMPLUS release out Real Soon Now.) + +Of course, if you are working with 12-bit data, you probably have it stored +in some other, nonstandard format. In that case you'll probably want to +write your own I/O modules to read and write your format. + +Note that a 12-bit version of cjpeg always runs in "-optimize" mode, in +order to generate valid Huffman tables. This is necessary because our +default Huffman tables only cover 8-bit data. + +Removing code: + +If you need to make a smaller version of the JPEG software, some optional +functions can be removed at compile time. See the xxx_SUPPORTED #defines in +jconfig.h and jmorecfg.h. If at all possible, we recommend that you leave in +decoder support for all valid JPEG files, to ensure that you can read anyone's +output. Taking out support for image file formats that you don't use is the +most painless way to make the programs smaller. Another possibility is to +remove some of the DCT methods: in particular, the "IFAST" method may not be +enough faster than the others to be worth keeping on your machine. (If you +do remove ISLOW or IFAST, be sure to redefine JDCT_DEFAULT or JDCT_FASTEST +to a supported method, by adding a #define in jconfig.h.) + + +OPTIMIZATION +============ + +Unless you own a Cray, you'll probably be interested in making the JPEG +software go as fast as possible. This section covers some machine-dependent +optimizations you may want to try. We suggest that before trying any of +this, you first get the basic installation to pass the self-test step. +Repeat the self-test after any optimization to make sure that you haven't +broken anything. + +The integer DCT routines perform a lot of multiplications. These +multiplications must yield 32-bit results, but none of their input values +are more than 16 bits wide. On many machines, notably the 680x0 and 80x86 +CPUs, a 16x16=>32 bit multiply instruction is faster than a full 32x32=>32 +bit multiply. Unfortunately there is no portable way to specify such a +multiplication in C, but some compilers can generate one when you use the +right combination of casts. See the MULTIPLYxxx macro definitions in +jdct.h. If your compiler makes "int" be 32 bits and "short" be 16 bits, +defining SHORTxSHORT_32 is fairly likely to work. When experimenting with +alternate definitions, be sure to test not only whether the code still works +(use the self-test), but also whether it is actually faster --- on some +compilers, alternate definitions may compute the right answer, yet be slower +than the default. Timing cjpeg on a large PGM (grayscale) input file is the +best way to check this, as the DCT will be the largest fraction of the runtime +in that mode. (Note: some of the distributed compiler-specific jconfig files +already contain #define switches to select appropriate MULTIPLYxxx +definitions.) + +If your machine has sufficiently fast floating point hardware, you may find +that the float DCT method is faster than the integer DCT methods, even +after tweaking the integer multiply macros. In that case you may want to +make the float DCT be the default method. (The only objection to this is +that float DCT results may vary slightly across machines.) To do that, add +"#define JDCT_DEFAULT JDCT_FLOAT" to jconfig.h. Even if you don't change +the default, you should redefine JDCT_FASTEST, which is the method selected +by djpeg's -fast switch. Don't forget to update the documentation files +(usage.txt and/or cjpeg.1, djpeg.1) to agree with what you've done. + +If access to "short" arrays is slow on your machine, it may be a win to +define type JCOEF as int rather than short. This will cost a good deal of +memory though, particularly in some multi-pass modes, so don't do it unless +you have memory to burn and short is REALLY slow. + +If your compiler can compile function calls in-line, make sure the INLINE +macro in jmorecfg.h is defined as the keyword that marks a function +inline-able. Some compilers have a switch that tells the compiler to inline +any function it thinks is profitable (e.g., -finline-functions for gcc). +Enabling such a switch is likely to make the compiled code bigger but faster. + +In general, it's worth trying the maximum optimization level of your compiler, +and experimenting with any optional optimizations such as loop unrolling. +(Unfortunately, far too many compilers have optimizer bugs ... be prepared to +back off if the code fails self-test.) If you do any experimentation along +these lines, please report the optimal settings to jpeg-info@jpegclub.org so +we can mention them in future releases. Be sure to specify your machine and +compiler version. + + +HINTS FOR SPECIFIC SYSTEMS +========================== + +We welcome reports on changes needed for systems not mentioned here. Submit +'em to jpeg-info@jpegclub.org. Also, if configure or ckconfig.c is wrong +about how to configure the JPEG software for your system, please let us know. + + +Acorn RISC OS: + +(Thanks to Simon Middleton for these hints on compiling with Desktop C.) +After renaming the files according to Acorn conventions, take a copy of +makefile.ansi, change all occurrences of 'libjpeg.a' to 'libjpeg.o' and +change these definitions as indicated: + +CFLAGS= -throwback -IC: -Wn +LDLIBS=C:o.Stubs +SYSDEPMEM=jmemansi.o +LN=Link +AR=LibFile -c -o + +Also add a new line '.c.o:; $(cc) $< $(cflags) -c -o $@'. Remove the +lines '$(RM) libjpeg.o' and '$(AR2) libjpeg.o' and the 'jconfig.h' +dependency section. + +Copy jconfig.txt to jconfig.h. Edit jconfig.h to define TWO_FILE_COMMANDLINE +and CHAR_IS_UNSIGNED. + +Run the makefile using !AMU not !Make. If you want to use the 'clean' and +'test' makefile entries then you will have to fiddle with the syntax a bit +and rename the test files. + + +Amiga: + +SAS C 6.50 reportedly is too buggy to compile the IJG code properly. +A patch to update to 6.51 is available from SAS or AmiNet FTP sites. + +The supplied config files are set up to use jmemname.c as the memory +manager, with temporary files being created on the device named by +"JPEGTMP:". + + +Atari ST/STE/TT: + +Copy the project files makcjpeg.st, makdjpeg.st, maktjpeg.st, and makljpeg.st +to cjpeg.prj, djpeg.prj, jpegtran.prj, and libjpeg.prj respectively. The +project files should work as-is with Pure C. For Turbo C, change library +filenames "pc..." to "tc..." in each project file. Note that libjpeg.prj +selects jmemansi.c as the recommended memory manager. You'll probably want to +adjust the DEFAULT_MAX_MEM setting --- you want it to be a couple hundred K +less than your normal free memory. Put "#define DEFAULT_MAX_MEM nnnn" into +jconfig.h to do this. + +To use the 68881/68882 coprocessor for the floating point DCT, add the +compiler option "-8" to the project files and replace pcfltlib.lib with +pc881lib.lib in cjpeg.prj and djpeg.prj. Or if you don't have a +coprocessor, you may prefer to remove the float DCT code by undefining +DCT_FLOAT_SUPPORTED in jmorecfg.h (since without a coprocessor, the float +code will be too slow to be useful). In that case, you can delete +pcfltlib.lib from the project files. + +Note that you must make libjpeg.lib before making cjpeg.ttp, djpeg.ttp, +or jpegtran.ttp. You'll have to perform the self-test by hand. + +We haven't bothered to include project files for rdjpgcom and wrjpgcom. +Those source files should just be compiled by themselves; they don't +depend on the JPEG library. You can use the default.prj project file +of the Pure C distribution to make the programs. + +There is a bug in some older versions of the Turbo C library which causes the +space used by temporary files created with "tmpfile()" not to be freed after +an abnormal program exit. If you check your disk afterwards, you will find +cluster chains that are allocated but not used by a file. This should not +happen in cjpeg/djpeg/jpegtran, since we enable a signal catcher to explicitly +close temp files before exiting. But if you use the JPEG library with your +own code, be sure to supply a signal catcher, or else use a different +system-dependent memory manager. + + +Cray: + +Should you be so fortunate as to be running JPEG on a Cray YMP, there is a +compiler bug in old versions of Cray's Standard C (prior to 3.1). If you +still have an old compiler, you'll need to insert a line reading +"#pragma novector" just before the loop + for (i = 1; i <= (int) htbl->bits[l]; i++) + huffsize[p++] = (char) l; +in fix_huff_tbl (in V5beta1, line 204 of jchuff.c and line 176 of jdhuff.c). +[This bug may or may not still occur with the current IJG code, but it's +probably a dead issue anyway...] + + +HP-UX: + +If you have HP-UX 7.05 or later with the "software development" C compiler, +you should run the compiler in ANSI mode. If using the configure script, +say + ./configure CC='cc -Aa' +(or -Ae if you prefer). If configuring by hand, use makefile.ansi and add +"-Aa" to the CFLAGS line in the makefile. + +If you have a pre-7.05 system, or if you are using the non-ANSI C compiler +delivered with a minimum HP-UX system, then you must use makefile.unix +(and do NOT add -Aa); or just run configure without the CC option. + +On HP 9000 series 800 machines, the HP C compiler is buggy in revisions prior +to A.08.07. If you get complaints about "not a typedef name", you'll have to +use makefile.unix, or run configure without the CC option. + + +Macintosh, generic comments: + +The supplied user-interface files (cjpeg.c, djpeg.c, etc) are set up to +provide a Unix-style command line interface. You can use this interface on +the Mac by means of the ccommand() library routine provided by Metrowerks +CodeWarrior or Think C. This is only appropriate for testing the library, +however; to make a user-friendly equivalent of cjpeg/djpeg you'd really want +to develop a Mac-style user interface. There isn't a complete example +available at the moment, but there are some helpful starting points: +1. Sam Bushell's free "To JPEG" applet provides drag-and-drop conversion to +JPEG under System 7 and later. This only illustrates how to use the +compression half of the library, but it does a very nice job of that part. +The CodeWarrior source code is available from http://www.pobox.com/~jsam. +2. Jim Brunner prepared a Mac-style user interface for both compression and +decompression. Unfortunately, it hasn't been updated since IJG v4, and +the library's API has changed considerably since then. Still it may be of +some help, particularly as a guide to compiling the IJG code under Think C. +Jim's code is available from the Info-Mac archives, at sumex-aim.stanford.edu +or mirrors thereof; see file /info-mac/dev/src/jpeg-convert-c.hqx. + +jmemmac.c is the recommended memory manager back end for Macintosh. It uses +NewPtr/DisposePtr instead of malloc/free, and has a Mac-specific +implementation of jpeg_mem_available(). It also creates temporary files that +follow Mac conventions. (That part of the code relies on System-7-or-later OS +functions. See the comments in jmemmac.c if you need to run it on System 6.) +NOTE that USE_MAC_MEMMGR must be defined in jconfig.h to use jmemmac.c. + +You can also use jmemnobs.c, if you don't care about handling images larger +than available memory. If you use any memory manager back end other than +jmemmac.c, we recommend replacing "malloc" and "free" by "NewPtr" and +"DisposePtr", because Mac C libraries often have peculiar implementations of +malloc/free. (For instance, free() may not return the freed space to the +Mac Memory Manager. This is undesirable for the IJG code because jmemmgr.c +already clumps space requests.) + + +Macintosh, Metrowerks CodeWarrior: + +The Unix-command-line-style interface can be used by defining USE_CCOMMAND. +You'll also need to define TWO_FILE_COMMANDLINE to avoid stdin/stdout. +This means that when using the cjpeg/djpeg programs, you'll have to type the +input and output file names in the "Arguments" text-edit box, rather than +using the file radio buttons. (Perhaps USE_FDOPEN or USE_SETMODE would +eliminate the problem, but I haven't heard from anyone who's tried it.) + +On 680x0 Macs, Metrowerks defines type "double" as a 10-byte IEEE extended +float. jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power +of 2. Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint. + +The supplied configuration file jconfig.mac can be used for your jconfig.h; +it includes all the recommended symbol definitions. If you have AppleScript +installed, you can run the supplied script makeproj.mac to create CodeWarrior +project files for the library and the testbed applications, then build the +library and applications. (Thanks to Dan Sears and Don Agro for this nifty +hack, which saves us from trying to maintain CodeWarrior project files as part +of the IJG distribution...) + + +Macintosh, Think C: + +The documentation in Jim Brunner's "JPEG Convert" source code (see above) +includes detailed build instructions for Think C; it's probably somewhat +out of date for the current release, but may be helpful. + +If you want to build the minimal command line version, proceed as follows. +You'll have to prepare project files for the programs; we don't include any +in the distribution since they are not text files. Use the file lists in +any of the supplied makefiles as a guide. Also add the ANSI and Unix C +libraries in a separate segment. You may need to divide the JPEG files into +more than one segment; we recommend dividing compression and decompression +modules. Define USE_CCOMMAND in jconfig.h so that the ccommand() routine is +called. You must also define TWO_FILE_COMMANDLINE because stdin/stdout +don't handle binary data correctly. + +On 680x0 Macs, Think C defines type "double" as a 12-byte IEEE extended float. +jmemmgr.c won't like this: it wants sizeof(ALIGN_TYPE) to be a power of 2. +Add "#define ALIGN_TYPE long" to jconfig.h to eliminate the complaint. + +jconfig.mac should work as a jconfig.h configuration file for Think C, +but the makeproj.mac AppleScript script is specific to CodeWarrior. Sorry. + + +MIPS R3000: + +MIPS's cc version 1.31 has a rather nasty optimization bug. Don't use -O +if you have that compiler version. (Use "cc -V" to check the version.) +Note that the R3000 chip is found in workstations from DEC and others. + + +MS-DOS, generic comments for 16-bit compilers: + +The IJG code is designed to work well in 80x86 "small" or "medium" memory +models (i.e., data pointers are 16 bits unless explicitly declared "far"; +code pointers can be either size). You may be able to use small model to +compile cjpeg or djpeg by itself, but you will probably have to use medium +model for any larger application. This won't make much difference in +performance. You *will* take a noticeable performance hit if you use a +large-data memory model, and you should avoid "huge" model if at all +possible. Be sure that NEED_FAR_POINTERS is defined in jconfig.h if you use +a small-data memory model; be sure it is NOT defined if you use a large-data +model. (The supplied makefiles and jconfig files for Borland and Microsoft C +compile in medium model and define NEED_FAR_POINTERS.) + +The DOS-specific memory manager, jmemdos.c, should be used if possible. +It needs some assembly-code routines which are in jmemdosa.asm; make sure +your makefile assembles that file and includes it in the library. If you +don't have a suitable assembler, you can get pre-assembled object files for +jmemdosa by FTP from ftp.uu.net:/graphics/jpeg/jdosaobj.zip. (DOS-oriented +distributions of the IJG source code often include these object files.) + +When using jmemdos.c, jconfig.h must define USE_MSDOS_MEMMGR and must set +MAX_ALLOC_CHUNK to less than 64K (65520L is a typical value). If your +C library's far-heap malloc() can't allocate blocks that large, reduce +MAX_ALLOC_CHUNK to whatever it can handle. + +If you can't use jmemdos.c for some reason --- for example, because you +don't have an assembler to assemble jmemdosa.asm --- you'll have to fall +back to jmemansi.c or jmemname.c. You'll probably still need to set +MAX_ALLOC_CHUNK in jconfig.h, because most DOS C libraries won't malloc() +more than 64K at a time. IMPORTANT: if you use jmemansi.c or jmemname.c, +you will have to compile in a large-data memory model in order to get the +right stdio library. Too bad. + +wrjpgcom needs to be compiled in large model, because it malloc()s a 64KB +work area to hold the comment text. If your C library's malloc can't +handle that, reduce MAX_COM_LENGTH as necessary in wrjpgcom.c. + +Most MS-DOS compilers treat stdin/stdout as text files, so you must use +two-file command line style. But if your compiler has either fdopen() or +setmode(), you can use one-file style if you like. To do this, define +USE_SETMODE or USE_FDOPEN so that stdin/stdout will be set to binary mode. +(USE_SETMODE seems to work with more DOS compilers than USE_FDOPEN.) You +should test that I/O through stdin/stdout produces the same results as I/O +to explicitly named files... the "make test" procedures in the supplied +makefiles do NOT use stdin/stdout. + + +MS-DOS, generic comments for 32-bit compilers: + +None of the above comments about memory models apply if you are using a +32-bit flat-memory-space environment, such as DJGPP or Watcom C. (And you +should use one if you have it, as performance will be much better than +8086-compatible code!) For flat-memory-space compilers, do NOT define +NEED_FAR_POINTERS, and do NOT use jmemdos.c. Use jmemnobs.c if the +environment supplies adequate virtual memory, otherwise use jmemansi.c or +jmemname.c. + +You'll still need to be careful about binary I/O through stdin/stdout. +See the last paragraph of the previous section. + + +MS-DOS, Borland C: + +Be sure to convert all the source files to DOS text format (CR/LF newlines). +Although Borland C will often work OK with unmodified Unix (LF newlines) +source files, sometimes it will give bogus compile errors. +"Illegal character '#'" is the most common such error. (This is true with +Borland C 3.1, but perhaps is fixed in newer releases.) + +If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE. +jconfig.bcc already includes #define USE_SETMODE to make this work. +(fdopen does not work correctly.) + + +MS-DOS, Microsoft C: + +makefile.mc6 works with Microsoft C, DOS Visual C++, etc. It should only +be used if you want to build a 16-bit (small or medium memory model) program. + +If you want one-file command line style, just undefine TWO_FILE_COMMANDLINE. +jconfig.mc6 already includes #define USE_SETMODE to make this work. +(fdopen does not work correctly.) + +Note that this makefile assumes that the working copy of itself is called +"makefile". If you want to call it something else, say "makefile.mak", +be sure to adjust the dependency line that reads "$(RFILE) : makefile". +Otherwise the make will fail because it doesn't know how to create "makefile". +Worse, some releases of Microsoft's make utilities give an incorrect error +message in this situation. + +Old versions of MS C fail with an "out of macro expansion space" error +because they can't cope with the macro TRACEMS8 (defined in jerror.h). +If this happens to you, the easiest solution is to change TRACEMS8 to +expand to nothing. You'll lose the ability to dump out JPEG coefficient +tables with djpeg -debug -debug, but at least you can compile. + +Original MS C 6.0 is very buggy; it compiles incorrect code unless you turn +off optimization entirely (remove -O from CFLAGS). 6.00A is better, but it +still generates bad code if you enable loop optimizations (-Ol or -Ox). + +MS C 8.0 crashes when compiling jquant1.c with optimization switch /Oo ... +which is on by default. To work around this bug, compile that one file +with /Oo-. + + +Microsoft Windows (all versions), generic comments: + +Some Windows system include files define typedef boolean as "unsigned char". +The IJG code also defines typedef boolean, but we make it an "enum" by default. +This doesn't affect the IJG programs because we don't import those Windows +include files. But if you use the JPEG library in your own program, and some +of your program's files import one definition of boolean while some import the +other, you can get all sorts of mysterious problems. A good preventive step +is to make the IJG library use "unsigned char" for boolean. To do that, +add something like this to your jconfig.h file: + /* Define "boolean" as unsigned char, not enum, per Windows custom */ + #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ + typedef unsigned char boolean; + #endif + #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +(This is already in jconfig.vc, by the way.) + +windef.h contains the declarations + #define far + #define FAR far +Since jmorecfg.h tries to define FAR as empty, you may get a compiler +warning if you include both jpeglib.h and windef.h (which windows.h +includes). To suppress the warning, you can put "#ifndef FAR"/"#endif" +around the line "#define FAR" in jmorecfg.h. +(Something like this is already in jmorecfg.h, by the way.) + +When using the library in a Windows application, you will almost certainly +want to modify or replace the error handler module jerror.c, since our +default error handler does a couple of inappropriate things: + 1. it tries to write error and warning messages on stderr; + 2. in event of a fatal error, it exits by calling exit(). + +A simple stopgap solution for problem 1 is to replace the line + fprintf(stderr, "%s\n", buffer); +(in output_message in jerror.c) with + MessageBox(GetActiveWindow(),buffer,"JPEG Error",MB_OK|MB_ICONERROR); +It's highly recommended that you at least do that much, since otherwise +error messages will disappear into nowhere. (Beginning with IJG v6b, this +code is already present in jerror.c; just define USE_WINDOWS_MESSAGEBOX in +jconfig.h to enable it.) + +The proper solution for problem 2 is to return control to your calling +application after a library error. This can be done with the setjmp/longjmp +technique discussed in libjpeg.txt and illustrated in example.c. (NOTE: +some older Windows C compilers provide versions of setjmp/longjmp that +don't actually work under Windows. You may need to use the Windows system +functions Catch and Throw instead.) + +The recommended memory manager under Windows is jmemnobs.c; in other words, +let Windows do any virtual memory management needed. You should NOT use +jmemdos.c nor jmemdosa.asm under Windows. + +For Windows 3.1, we recommend compiling in medium or large memory model; +for newer Windows versions, use a 32-bit flat memory model. (See the MS-DOS +sections above for more info about memory models.) In the 16-bit memory +models only, you'll need to put + #define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ +into jconfig.h to limit allocation chunks to 64Kb. (Without that, you'd +have to use huge memory model, which slows things down unnecessarily.) +jmemnobs.c works without modification in large or flat memory models, but to +use medium model, you need to modify its jpeg_get_large and jpeg_free_large +routines to allocate far memory. In any case, you might like to replace +its calls to malloc and free with direct calls on Windows memory allocation +functions. + +You may also want to modify jdatasrc.c and jdatadst.c to use Windows file +operations rather than fread/fwrite. This is only necessary if your C +compiler doesn't provide a competent implementation of C stdio functions. + +You might want to tweak the RGB_xxx macros in jmorecfg.h so that the library +will accept or deliver color pixels in BGR sample order, not RGB; BGR order +is usually more convenient under Windows. Note that this change will break +the sample applications cjpeg/djpeg, but the library itself works fine. + + +Many people want to convert the IJG library into a DLL. This is reasonably +straightforward, but watch out for the following: + + 1. Don't try to compile as a DLL in small or medium memory model; use +large model, or even better, 32-bit flat model. Many places in the IJG code +assume the address of a local variable is an ordinary (not FAR) pointer; +that isn't true in a medium-model DLL. + + 2. Microsoft C cannot pass file pointers between applications and DLLs. +(See Microsoft Knowledge Base, PSS ID Number Q50336.) So jdatasrc.c and +jdatadst.c don't work if you open a file in your application and then pass +the pointer to the DLL. One workaround is to make jdatasrc.c/jdatadst.c +part of your main application rather than part of the DLL. + + 3. You'll probably need to modify the macros GLOBAL() and EXTERN() to +attach suitable linkage keywords to the exported routine names. Similarly, +you'll want to modify METHODDEF() and JMETHOD() to ensure function pointers +are declared in a way that lets application routines be called back through +the function pointers. These macros are in jmorecfg.h. Typical definitions +for a 16-bit DLL are: + #define GLOBAL(type) type _far _pascal _loadds _export + #define EXTERN(type) extern type _far _pascal _loadds + #define METHODDEF(type) static type _far _pascal + #define JMETHOD(type,methodname,arglist) \ + type (_far _pascal *methodname) arglist +For a 32-bit DLL you may want something like + #define GLOBAL(type) __declspec(dllexport) type + #define EXTERN(type) extern __declspec(dllexport) type +Although not all the GLOBAL routines are actually intended to be called by +the application, the performance cost of making them all DLL entry points is +negligible. + +The unmodified IJG library presents a very C-specific application interface, +so the resulting DLL is only usable from C or C++ applications. There has +been some talk of writing wrapper code that would present a simpler interface +usable from other languages, such as Visual Basic. This is on our to-do list +but hasn't been very high priority --- any volunteers out there? + + +Microsoft Windows, Borland C: + +The provided jconfig.bcc should work OK in a 32-bit Windows environment, +but you'll need to tweak it in a 16-bit environment (you'd need to define +NEED_FAR_POINTERS and MAX_ALLOC_CHUNK). Beware that makefile.bcc will need +alteration if you want to use it for Windows --- in particular, you should +use jmemnobs.c not jmemdos.c under Windows. + +Borland C++ 4.5 fails with an internal compiler error when trying to compile +jdmerge.c in 32-bit mode. If enough people complain, perhaps Borland will fix +it. In the meantime, the simplest known workaround is to add a redundant +definition of the variable range_limit in h2v1_merged_upsample(), at the head +of the block that handles odd image width (about line 268 in v6 jdmerge.c): + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + register JSAMPLE * range_limit = cinfo->sample_range_limit; /* ADD THIS */ + cb = GETJSAMPLE(*inptr1); +Pretty bizarre, especially since the very similar routine h2v2_merged_upsample +doesn't trigger the bug. +Recent reports suggest that this bug does not occur with "bcc32a" (the +Pentium-optimized version of the compiler). + +Another report from a user of Borland C 4.5 was that incorrect code (leading +to a color shift in processed images) was produced if any of the following +optimization switch combinations were used: + -Ot -Og + -Ot -Op + -Ot -Om +So try backing off on optimization if you see such a problem. (Are there +several different releases all numbered "4.5"??) + + +Microsoft Windows, Microsoft Visual C++: + +jconfig.vc should work OK with any Microsoft compiler for a 32-bit memory +model. makefile.vc is intended for command-line use. (If you are using +the Developer Studio environment, you may prefer the DevStudio project +files; see below.) + +IJG JPEG 7 adds extern "C" to jpeglib.h. This avoids the need to put +extern "C" { ... } around #include "jpeglib.h" in your C++ application. +You can also force VC++ to treat the library as C++ code by renaming +all the *.c files to *.cpp (and adjusting the makefile to match). +In this case you also need to define the symbol DONT_USE_EXTERN_C in +the configuration to prevent jpeglib.h from using extern "C". + + +Microsoft Windows, Microsoft Visual C++ 6 Developer Studio: + +We include makefiles that should work as project files in DevStudio 6.0 or +later. There is a library makefile that builds the IJG library as a static +Win32 library, and application makefiles that build the sample applications +as Win32 console applications. (Even if you only want the library, we +recommend building the applications so that you can run the self-test.) + +To use: +1. Open the command prompt, change to the main directory and execute the + command line + NMAKE /f makefile.vc setup-vc6 + This will move jconfig.vc to jconfig.h and makefiles to project files. + (Note that the renaming is critical!) +2. Open the workspace file jpeg.dsw, build the library project. + (If you are using DevStudio more recent than 6.0, you'll probably + get a message saying that the project files are being updated.) +3. Open the workspace file apps.dsw, build the application projects. +4. To perform the self-test, execute the command line + NMAKE /f makefile.vc test-build +5. Move the application .exe files from `app`\Release to an + appropriate location on your path. + + +Microsoft Windows, Microsoft Visual C++ 2010 Developer Studio (v10): + +We include makefiles that should work as project files in Visual Studio +2010 or later. There is a library makefile that builds the IJG library +as a static Win32 library, and application makefiles that build the sample +applications as Win32 console applications. (Even if you only want the +library, we recommend building the applications so that you can run the +self-test.) + +To use: +1. Open the command prompt, change to the main directory and execute the + command line + NMAKE /f makefile.vc setup-v10 + This will move jconfig.vc to jconfig.h and makefiles to project files. + (Note that the renaming is critical!) +2. Open the solution file jpeg.sln, build the library project. + (If you are using Visual Studio more recent than 2010 (v10), you'll + probably get a message saying that the project files are being updated.) +3. Open the solution file apps.sln, build the application projects. +4. To perform the self-test, execute the command line + NMAKE /f makefile.vc test-build +5. Move the application .exe files from `app`\Release to an + appropriate location on your path. + +Note: +There seems to be an optimization bug in the compiler which causes the +self-test to fail with the color quantization option. +We have disabled optimization for the file jquant2.c in the library +project file which causes the self-test to pass properly. + + +OS/2, Borland C++: + +Watch out for optimization bugs in older Borland compilers; you may need +to back off the optimization switch settings. See the comments in +makefile.bcc. + + +SGI: + +On some SGI systems, you may need to set "AR2= ar -ts" in the Makefile. +If you are using configure, you can do this by saying + ./configure RANLIB='ar -ts' +This change is not needed on all SGIs. Use it only if the make fails at the +stage of linking the completed programs. + +On the MIPS R4000 architecture (Indy, etc.), the compiler option "-mips2" +reportedly speeds up the float DCT method substantially, enough to make it +faster than the default int method (but still slower than the fast int +method). If you use -mips2, you may want to alter the default DCT method to +be float. To do this, put "#define JDCT_DEFAULT JDCT_FLOAT" in jconfig.h. + + +VMS: + +On an Alpha/VMS system with MMS, be sure to use the "/Marco=Alpha=1" +qualifier with MMS when building the JPEG package. + +VAX/VMS v5.5-1 may have problems with the test step of the build procedure +reporting differences when it compares the original and test images. If the +error points to the last block of the files, it is most likely bogus and may +be safely ignored. It seems to be because the files are Stream_LF and +Backup/Compare has difficulty with the (presumably) null padded files. +This problem was not observed on VAX/VMS v6.1 or AXP/VMS v6.1. diff --git a/thirdparty/LibJPEG/jpeg-9/jaricom.c b/thirdparty/LibJPEG/jpeg-9/jaricom.c new file mode 100644 index 0000000..6900688 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jaricom.c @@ -0,0 +1,153 @@ +/* + * jaricom.c + * + * Developed 1997-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains probability estimation tables for common use in + * arithmetic entropy encoding and decoding routines. + * + * This data represents Table D.3 in the JPEG spec (D.2 in the draft), + * ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81, and Table 24 + * in the JBIG spec, ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + +/* The following #define specifies the packing of the four components + * into the compact INT32 representation. + * Note that this formula must match the actual arithmetic encoder + * and decoder implementation. The implementation has to be changed + * if this formula is changed. + * The current organization is leaned on Markus Kuhn's JBIG + * implementation (jbig_tab.c). + */ + +#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b) + +const INT32 jpeg_aritab[113+1] = { +/* + * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS + */ + V( 0, 0x5a1d, 1, 1, 1 ), + V( 1, 0x2586, 14, 2, 0 ), + V( 2, 0x1114, 16, 3, 0 ), + V( 3, 0x080b, 18, 4, 0 ), + V( 4, 0x03d8, 20, 5, 0 ), + V( 5, 0x01da, 23, 6, 0 ), + V( 6, 0x00e5, 25, 7, 0 ), + V( 7, 0x006f, 28, 8, 0 ), + V( 8, 0x0036, 30, 9, 0 ), + V( 9, 0x001a, 33, 10, 0 ), + V( 10, 0x000d, 35, 11, 0 ), + V( 11, 0x0006, 9, 12, 0 ), + V( 12, 0x0003, 10, 13, 0 ), + V( 13, 0x0001, 12, 13, 0 ), + V( 14, 0x5a7f, 15, 15, 1 ), + V( 15, 0x3f25, 36, 16, 0 ), + V( 16, 0x2cf2, 38, 17, 0 ), + V( 17, 0x207c, 39, 18, 0 ), + V( 18, 0x17b9, 40, 19, 0 ), + V( 19, 0x1182, 42, 20, 0 ), + V( 20, 0x0cef, 43, 21, 0 ), + V( 21, 0x09a1, 45, 22, 0 ), + V( 22, 0x072f, 46, 23, 0 ), + V( 23, 0x055c, 48, 24, 0 ), + V( 24, 0x0406, 49, 25, 0 ), + V( 25, 0x0303, 51, 26, 0 ), + V( 26, 0x0240, 52, 27, 0 ), + V( 27, 0x01b1, 54, 28, 0 ), + V( 28, 0x0144, 56, 29, 0 ), + V( 29, 0x00f5, 57, 30, 0 ), + V( 30, 0x00b7, 59, 31, 0 ), + V( 31, 0x008a, 60, 32, 0 ), + V( 32, 0x0068, 62, 33, 0 ), + V( 33, 0x004e, 63, 34, 0 ), + V( 34, 0x003b, 32, 35, 0 ), + V( 35, 0x002c, 33, 9, 0 ), + V( 36, 0x5ae1, 37, 37, 1 ), + V( 37, 0x484c, 64, 38, 0 ), + V( 38, 0x3a0d, 65, 39, 0 ), + V( 39, 0x2ef1, 67, 40, 0 ), + V( 40, 0x261f, 68, 41, 0 ), + V( 41, 0x1f33, 69, 42, 0 ), + V( 42, 0x19a8, 70, 43, 0 ), + V( 43, 0x1518, 72, 44, 0 ), + V( 44, 0x1177, 73, 45, 0 ), + V( 45, 0x0e74, 74, 46, 0 ), + V( 46, 0x0bfb, 75, 47, 0 ), + V( 47, 0x09f8, 77, 48, 0 ), + V( 48, 0x0861, 78, 49, 0 ), + V( 49, 0x0706, 79, 50, 0 ), + V( 50, 0x05cd, 48, 51, 0 ), + V( 51, 0x04de, 50, 52, 0 ), + V( 52, 0x040f, 50, 53, 0 ), + V( 53, 0x0363, 51, 54, 0 ), + V( 54, 0x02d4, 52, 55, 0 ), + V( 55, 0x025c, 53, 56, 0 ), + V( 56, 0x01f8, 54, 57, 0 ), + V( 57, 0x01a4, 55, 58, 0 ), + V( 58, 0x0160, 56, 59, 0 ), + V( 59, 0x0125, 57, 60, 0 ), + V( 60, 0x00f6, 58, 61, 0 ), + V( 61, 0x00cb, 59, 62, 0 ), + V( 62, 0x00ab, 61, 63, 0 ), + V( 63, 0x008f, 61, 32, 0 ), + V( 64, 0x5b12, 65, 65, 1 ), + V( 65, 0x4d04, 80, 66, 0 ), + V( 66, 0x412c, 81, 67, 0 ), + V( 67, 0x37d8, 82, 68, 0 ), + V( 68, 0x2fe8, 83, 69, 0 ), + V( 69, 0x293c, 84, 70, 0 ), + V( 70, 0x2379, 86, 71, 0 ), + V( 71, 0x1edf, 87, 72, 0 ), + V( 72, 0x1aa9, 87, 73, 0 ), + V( 73, 0x174e, 72, 74, 0 ), + V( 74, 0x1424, 72, 75, 0 ), + V( 75, 0x119c, 74, 76, 0 ), + V( 76, 0x0f6b, 74, 77, 0 ), + V( 77, 0x0d51, 75, 78, 0 ), + V( 78, 0x0bb6, 77, 79, 0 ), + V( 79, 0x0a40, 77, 48, 0 ), + V( 80, 0x5832, 80, 81, 1 ), + V( 81, 0x4d1c, 88, 82, 0 ), + V( 82, 0x438e, 89, 83, 0 ), + V( 83, 0x3bdd, 90, 84, 0 ), + V( 84, 0x34ee, 91, 85, 0 ), + V( 85, 0x2eae, 92, 86, 0 ), + V( 86, 0x299a, 93, 87, 0 ), + V( 87, 0x2516, 86, 71, 0 ), + V( 88, 0x5570, 88, 89, 1 ), + V( 89, 0x4ca9, 95, 90, 0 ), + V( 90, 0x44d9, 96, 91, 0 ), + V( 91, 0x3e22, 97, 92, 0 ), + V( 92, 0x3824, 99, 93, 0 ), + V( 93, 0x32b4, 99, 94, 0 ), + V( 94, 0x2e17, 93, 86, 0 ), + V( 95, 0x56a8, 95, 96, 1 ), + V( 96, 0x4f46, 101, 97, 0 ), + V( 97, 0x47e5, 102, 98, 0 ), + V( 98, 0x41cf, 103, 99, 0 ), + V( 99, 0x3c3d, 104, 100, 0 ), + V( 100, 0x375e, 99, 93, 0 ), + V( 101, 0x5231, 105, 102, 0 ), + V( 102, 0x4c0f, 106, 103, 0 ), + V( 103, 0x4639, 107, 104, 0 ), + V( 104, 0x415e, 103, 99, 0 ), + V( 105, 0x5627, 105, 106, 1 ), + V( 106, 0x50e7, 108, 107, 0 ), + V( 107, 0x4b85, 109, 103, 0 ), + V( 108, 0x5597, 110, 109, 0 ), + V( 109, 0x504f, 111, 107, 0 ), + V( 110, 0x5a10, 110, 111, 1 ), + V( 111, 0x5522, 112, 109, 0 ), + V( 112, 0x59eb, 112, 111, 1 ), +/* + * This last entry is used for fixed probability estimate of 0.5 + * as suggested in Section 10.3 Table 5 of ITU-T Rec. T.851. + */ + V( 113, 0x5a1d, 113, 113, 0 ) +}; diff --git a/thirdparty/LibJPEG/jpeg-9/jcapimin.c b/thirdparty/LibJPEG/jpeg-9/jcapimin.c new file mode 100644 index 0000000..639ce86 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcapimin.c @@ -0,0 +1,288 @@ +/* + * jcapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * Modified 2003-2010 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-compression case or the transcoding-only + * case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jcapistd.c. But also see jcparam.c for + * parameter-setup helper routines, jcomapi.c for routines shared by + * compression and decompression, and jctrans.c for the transcoding case. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Initialization of a JPEG compression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_compress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = FALSE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->dest = NULL; + + cinfo->comp_info = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + cinfo->quant_tbl_ptrs[i] = NULL; + cinfo->q_scale_factor[i] = 100; + } + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + /* Must do it here for emit_dqt in case jpeg_write_tables is used */ + cinfo->block_size = DCTSIZE; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + + cinfo->script_space = NULL; + + cinfo->input_gamma = 1.0; /* in case application forgets */ + + /* OK, I'm ready */ + cinfo->global_state = CSTATE_START; +} + + +/* + * Destruction of a JPEG compression object + */ + +GLOBAL(void) +jpeg_destroy_compress (j_compress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG compression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_compress (j_compress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Forcibly suppress or un-suppress all quantization and Huffman tables. + * Marks all currently defined tables as already written (if suppress) + * or not written (if !suppress). This will control whether they get emitted + * by a subsequent jpeg_start_compress call. + * + * This routine is exported for use by applications that want to produce + * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but + * since it is called by jpeg_start_compress, we put it here --- otherwise + * jcparam.o would be linked whether the application used it or not. + */ + +GLOBAL(void) +jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress) +{ + int i; + JQUANT_TBL * qtbl; + JHUFF_TBL * htbl; + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) + qtbl->sent_table = suppress; + } + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) + htbl->sent_table = suppress; + } +} + + +/* + * Finish JPEG compression. + * + * If a multipass operating mode was selected, this may do a great deal of + * work including most of the actual output. + */ + +GLOBAL(void) +jpeg_finish_compress (j_compress_ptr cinfo) +{ + JDIMENSION iMCU_row; + + if (cinfo->global_state == CSTATE_SCANNING || + cinfo->global_state == CSTATE_RAW_OK) { + /* Terminate first pass */ + if (cinfo->next_scanline < cinfo->image_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_pass) (cinfo); + } else if (cinfo->global_state != CSTATE_WRCOEFS) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any remaining passes */ + while (! cinfo->master->is_last_pass) { + (*cinfo->master->prepare_for_pass) (cinfo); + for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) iMCU_row; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* We bypass the main controller and invoke coef controller directly; + * all work is being done from the coefficient buffer. + */ + if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } + (*cinfo->master->finish_pass) (cinfo); + } + /* Write EOI, do final cleanup */ + (*cinfo->marker->write_file_trailer) (cinfo); + (*cinfo->dest->term_destination) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); +} + + +/* + * Write a special marker. + * This is only recommended for writing COM or APPn markers. + * Must be called after jpeg_start_compress() and before + * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). + */ + +GLOBAL(void) +jpeg_write_marker (j_compress_ptr cinfo, int marker, + const JOCTET *dataptr, unsigned int datalen) +{ + JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); + + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); + write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ + while (datalen--) { + (*write_marker_byte) (cinfo, *dataptr); + dataptr++; + } +} + +/* Same, but piecemeal. */ + +GLOBAL(void) +jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +{ + if (cinfo->next_scanline != 0 || + (cinfo->global_state != CSTATE_SCANNING && + cinfo->global_state != CSTATE_RAW_OK && + cinfo->global_state != CSTATE_WRCOEFS)) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); +} + +GLOBAL(void) +jpeg_write_m_byte (j_compress_ptr cinfo, int val) +{ + (*cinfo->marker->write_marker_byte) (cinfo, val); +} + + +/* + * Alternate compression function: just write an abbreviated table file. + * Before calling this, all parameters and a data destination must be set up. + * + * To produce a pair of files containing abbreviated tables and abbreviated + * image data, one would proceed as follows: + * + * initialize JPEG object + * set JPEG parameters + * set destination to table file + * jpeg_write_tables(cinfo); + * set destination to image file + * jpeg_start_compress(cinfo, FALSE); + * write data... + * jpeg_finish_compress(cinfo); + * + * jpeg_write_tables has the side effect of marking all tables written + * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress + * will not re-emit the tables unless it is passed write_all_tables=TRUE. + */ + +GLOBAL(void) +jpeg_write_tables (j_compress_ptr cinfo) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Initialize the marker writer ... bit of a crock to do it here. */ + jinit_marker_writer(cinfo); + /* Write them tables! */ + (*cinfo->marker->write_tables_only) (cinfo); + /* And clean up. */ + (*cinfo->dest->term_destination) (cinfo); + /* + * In library releases up through v6a, we called jpeg_abort() here to free + * any working memory allocated by the destination manager and marker + * writer. Some applications had a problem with that: they allocated space + * of their own from the library memory manager, and didn't want it to go + * away during write_tables. So now we do nothing. This will cause a + * memory leak if an app calls write_tables repeatedly without doing a full + * compression cycle or otherwise resetting the JPEG object. However, that + * seems less bad than unexpectedly freeing memory in the normal case. + * An app that prefers the old behavior can call jpeg_abort for itself after + * each call to jpeg_write_tables(). + */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcapistd.c b/thirdparty/LibJPEG/jpeg-9/jcapistd.c new file mode 100644 index 0000000..c0320b1 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcapistd.c @@ -0,0 +1,161 @@ +/* + * jcapistd.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the compression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-compression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_compress, it will end up linking in the entire compressor. + * We thus must separate this file from jcapimin.c to avoid linking the + * whole compression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Compression initialization. + * Before calling this, all parameters and a data destination must be set up. + * + * We require a write_all_tables parameter as a failsafe check when writing + * multiple datastreams from the same compression object. Since prior runs + * will have left all the tables marked sent_table=TRUE, a subsequent run + * would emit an abbreviated stream (no tables) by default. This may be what + * is wanted, but for safety's sake it should not be the default behavior: + * programmers should have to make a deliberate choice to emit abbreviated + * images. Therefore the documentation and examples should encourage people + * to pass write_all_tables=TRUE; then it will take active thought to do the + * wrong thing. + */ + +GLOBAL(void) +jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (write_all_tables) + jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ + + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + jinit_compress_master(cinfo); + /* Set up for the first pass */ + (*cinfo->master->prepare_for_pass) (cinfo); + /* Ready for application to drive first pass through jpeg_write_scanlines + * or jpeg_write_raw_data. + */ + cinfo->next_scanline = 0; + cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); +} + + +/* + * Write some scanlines of data to the JPEG compressor. + * + * The return value will be the number of lines actually written. + * This should be less than the supplied num_lines only in case that + * the data destination module has requested suspension of the compressor, + * or if more than image_height scanlines are passed in. + * + * Note: we warn about excess calls to jpeg_write_scanlines() since + * this likely signals an application programmer error. However, + * excess scanlines passed in the last valid call are *silently* ignored, + * so that the application need not adjust num_lines for end-of-image + * when using a multiple-scanline buffer. + */ + +GLOBAL(JDIMENSION) +jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION num_lines) +{ + JDIMENSION row_ctr, rows_left; + + if (cinfo->global_state != CSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_scanlines. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_scanlines. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Ignore any extra scanlines at bottom of image. */ + rows_left = cinfo->image_height - cinfo->next_scanline; + if (num_lines > rows_left) + num_lines = rows_left; + + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); + cinfo->next_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to write raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION num_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != CSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->next_scanline >= cinfo->image_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->next_scanline; + cinfo->progress->pass_limit = (long) cinfo->image_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Give master control module another chance if this is first call to + * jpeg_write_raw_data. This lets output of the frame/scan headers be + * delayed so that application can write COM, etc, markers between + * jpeg_start_compress and jpeg_write_raw_data. + */ + if (cinfo->master->call_pass_startup) + (*cinfo->master->pass_startup) (cinfo); + + /* Verify that at least one iMCU row has been passed. */ + lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE; + if (num_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Directly compress the row. */ + if (! (*cinfo->coef->compress_data) (cinfo, data)) { + /* If compressor did not consume the whole row, suspend processing. */ + return 0; + } + + /* OK, we processed one iMCU row. */ + cinfo->next_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcarith.c b/thirdparty/LibJPEG/jpeg-9/jcarith.c new file mode 100644 index 0000000..a7f9ff7 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcarith.c @@ -0,0 +1,943 @@ +/* + * jcarith.c + * + * Developed 1997-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains portable arithmetic entropy encoding routines for JPEG + * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81). + * + * Both sequential and progressive modes are supported in this single module. + * + * Suspension is not currently supported in this module. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Expanded entropy encoder object for arithmetic encoding. */ + +typedef struct { + struct jpeg_entropy_encoder pub; /* public fields */ + + INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */ + INT32 a; /* A register, normalized size of coding interval */ + INT32 sc; /* counter for stacked 0xFF values which might overflow */ + INT32 zc; /* counter for pending 0x00 output values which might * + * be discarded at the end ("Pacman" termination) */ + int ct; /* bit shift counter, determines when next byte will be written */ + int buffer; /* buffer for most recent output byte != 0xFF */ + + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ + int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */ + + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to statistics areas (these workspaces have image lifespan) */ + unsigned char * dc_stats[NUM_ARITH_TBLS]; + unsigned char * ac_stats[NUM_ARITH_TBLS]; + + /* Statistics bin for coding with fixed probability 0.5 */ + unsigned char fixed_bin[4]; +} arith_entropy_encoder; + +typedef arith_entropy_encoder * arith_entropy_ptr; + +/* The following two definitions specify the allocation chunk size + * for the statistics area. + * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least + * 49 statistics bins for DC, and 245 statistics bins for AC coding. + * + * We use a compact representation with 1 byte per statistics bin, + * thus the numbers directly represent byte sizes. + * This 1 byte per statistics bin contains the meaning of the MPS + * (more probable symbol) in the highest bit (mask 0x80), and the + * index into the probability estimation state machine table + * in the lower bits (mask 0x7F). + */ + +#define DC_STAT_BINS 64 +#define AC_STAT_BINS 256 + +/* NOTE: Uncomment the following #define if you want to use the + * given formula for calculating the AC conditioning parameter Kx + * for spectral selection progressive coding in section G.1.3.2 + * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4). + * Although the spec and P&M authors claim that this "has proven + * to give good results for 8 bit precision samples", I'm not + * convinced yet that this is really beneficial. + * Early tests gave only very marginal compression enhancements + * (a few - around 5 or so - bytes even for very large files), + * which would turn out rather negative if we'd suppress the + * DAC (Define Arithmetic Conditioning) marker segments for + * the default parameters in the future. + * Note that currently the marker writing module emits 12-byte + * DAC segments for a full-component scan in a color image. + * This is not worth worrying about IMHO. However, since the + * spec defines the default values to be used if the tables + * are omitted (unlike Huffman tables, which are required + * anyway), one might optimize this behaviour in the future, + * and then it would be disadvantageous to use custom tables if + * they don't provide sufficient gain to exceed the DAC size. + * + * On the other hand, I'd consider it as a reasonable result + * that the conditioning has no significant influence on the + * compression performance. This means that the basic + * statistical model is already rather stable. + * + * Thus, at the moment, we use the default conditioning values + * anyway, and do not use the custom formula. + * +#define CALCULATE_SPECTRAL_CONDITIONING + */ + +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. + * We assume that int right shift is unsigned if INT32 right shift is, + * which should be safe. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS int ishift_temp; +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +LOCAL(void) +emit_byte (int val, j_compress_ptr cinfo) +/* Write next output byte; we do not support suspension in this module. */ +{ + struct jpeg_destination_mgr * dest = cinfo->dest; + + *dest->next_output_byte++ = (JOCTET) val; + if (--dest->free_in_buffer == 0) + if (! (*dest->empty_output_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); +} + + +/* + * Finish up at the end of an arithmetic-compressed scan. + */ + +METHODDEF(void) +finish_pass (j_compress_ptr cinfo) +{ + arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; + INT32 temp; + + /* Section D.1.8: Termination of encoding */ + + /* Find the e->c in the coding interval with the largest + * number of trailing zero bits */ + if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c) + e->c = temp + 0x8000L; + else + e->c = temp; + /* Send remaining bytes to output */ + e->c <<= e->ct; + if (e->c & 0xF8000000L) { + /* One final overflow has to be handled */ + if (e->buffer >= 0) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + emit_byte(e->buffer + 1, cinfo); + if (e->buffer + 1 == 0xFF) + emit_byte(0x00, cinfo); + } + e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */ + e->sc = 0; + } else { + if (e->buffer == 0) + ++e->zc; + else if (e->buffer >= 0) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + emit_byte(e->buffer, cinfo); + } + if (e->sc) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + do { + emit_byte(0xFF, cinfo); + emit_byte(0x00, cinfo); + } while (--e->sc); + } + } + /* Output final bytes only if they are not 0x00 */ + if (e->c & 0x7FFF800L) { + if (e->zc) /* output final pending zero bytes */ + do emit_byte(0x00, cinfo); + while (--e->zc); + emit_byte((e->c >> 19) & 0xFF, cinfo); + if (((e->c >> 19) & 0xFF) == 0xFF) + emit_byte(0x00, cinfo); + if (e->c & 0x7F800L) { + emit_byte((e->c >> 11) & 0xFF, cinfo); + if (((e->c >> 11) & 0xFF) == 0xFF) + emit_byte(0x00, cinfo); + } + } +} + + +/* + * The core arithmetic encoding routine (common in JPEG and JBIG). + * This needs to go as fast as possible. + * Machine-dependent optimization facilities + * are not utilized in this portable implementation. + * However, this code should be fairly efficient and + * may be a good base for further optimizations anyway. + * + * Parameter 'val' to be encoded may be 0 or 1 (binary decision). + * + * Note: I've added full "Pacman" termination support to the + * byte output routines, which is equivalent to the optional + * Discard_final_zeros procedure (Figure D.15) in the spec. + * Thus, we always produce the shortest possible output + * stream compliant to the spec (no trailing zero bytes, + * except for FF stuffing). + * + * I've also introduced a new scheme for accessing + * the probability estimation state machine table, + * derived from Markus Kuhn's JBIG implementation. + */ + +LOCAL(void) +arith_encode (j_compress_ptr cinfo, unsigned char *st, int val) +{ + register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; + register unsigned char nl, nm; + register INT32 qe, temp; + register int sv; + + /* Fetch values from our compact representation of Table D.3(D.2): + * Qe values and probability estimation state machine + */ + sv = *st; + qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */ + nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */ + nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */ + + /* Encode & estimation procedures per sections D.1.4 & D.1.5 */ + e->a -= qe; + if (val != (sv >> 7)) { + /* Encode the less probable symbol */ + if (e->a >= qe) { + /* If the interval size (qe) for the less probable symbol (LPS) + * is larger than the interval size for the MPS, then exchange + * the two symbols for coding efficiency, otherwise code the LPS + * as usual: */ + e->c += e->a; + e->a = qe; + } + *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */ + } else { + /* Encode the more probable symbol */ + if (e->a >= 0x8000L) + return; /* A >= 0x8000 -> ready, no renormalization required */ + if (e->a < qe) { + /* If the interval size (qe) for the less probable symbol (LPS) + * is larger than the interval size for the MPS, then exchange + * the two symbols for coding efficiency: */ + e->c += e->a; + e->a = qe; + } + *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */ + } + + /* Renormalization & data output per section D.1.6 */ + do { + e->a <<= 1; + e->c <<= 1; + if (--e->ct == 0) { + /* Another byte is ready for output */ + temp = e->c >> 19; + if (temp > 0xFF) { + /* Handle overflow over all stacked 0xFF bytes */ + if (e->buffer >= 0) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + emit_byte(e->buffer + 1, cinfo); + if (e->buffer + 1 == 0xFF) + emit_byte(0x00, cinfo); + } + e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */ + e->sc = 0; + /* Note: The 3 spacer bits in the C register guarantee + * that the new buffer byte can't be 0xFF here + * (see page 160 in the P&M JPEG book). */ + e->buffer = temp & 0xFF; /* new output byte, might overflow later */ + } else if (temp == 0xFF) { + ++e->sc; /* stack 0xFF byte (which might overflow later) */ + } else { + /* Output all stacked 0xFF bytes, they will not overflow any more */ + if (e->buffer == 0) + ++e->zc; + else if (e->buffer >= 0) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + emit_byte(e->buffer, cinfo); + } + if (e->sc) { + if (e->zc) + do emit_byte(0x00, cinfo); + while (--e->zc); + do { + emit_byte(0xFF, cinfo); + emit_byte(0x00, cinfo); + } while (--e->sc); + } + e->buffer = temp & 0xFF; /* new output byte (can still overflow) */ + } + e->c &= 0x7FFFFL; + e->ct += 8; + } + } while (e->a < 0x8000L); +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(void) +emit_restart (j_compress_ptr cinfo, int restart_num) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + int ci; + jpeg_component_info * compptr; + + finish_pass(cinfo); + + emit_byte(0xFF, cinfo); + emit_byte(JPEG_RST0 + restart_num, cinfo); + + /* Re-initialize statistics areas */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) { + MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS); + /* Reset DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + entropy->dc_context[ci] = 0; + } + /* AC needs no table when not present */ + if (cinfo->Se) { + MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS); + } + } + + /* Reset arithmetic encoding variables */ + entropy->c = 0; + entropy->a = 0x10000L; + entropy->sc = 0; + entropy->zc = 0; + entropy->ct = 11; + entropy->buffer = -1; /* empty */ +} + + +/* + * MCU encoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + unsigned char *st; + int blkn, ci, tbl; + int v, v2, m; + ISHIFT_TEMPS + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + emit_restart(cinfo, entropy->next_restart_num); + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + tbl = cinfo->cur_comp_info[ci]->dc_tbl_no; + + /* Compute the DC value after the required point transform by Al. + * This is simply an arithmetic right shift. + */ + m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al); + + /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */ + + /* Table F.4: Point to statistics bin S0 for DC coefficient coding */ + st = entropy->dc_stats[tbl] + entropy->dc_context[ci]; + + /* Figure F.4: Encode_DC_DIFF */ + if ((v = m - entropy->last_dc_val[ci]) == 0) { + arith_encode(cinfo, st, 0); + entropy->dc_context[ci] = 0; /* zero diff category */ + } else { + entropy->last_dc_val[ci] = m; + arith_encode(cinfo, st, 1); + /* Figure F.6: Encoding nonzero value v */ + /* Figure F.7: Encoding the sign of v */ + if (v > 0) { + arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */ + st += 2; /* Table F.4: SP = S0 + 2 */ + entropy->dc_context[ci] = 4; /* small positive diff category */ + } else { + v = -v; + arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */ + st += 3; /* Table F.4: SN = S0 + 3 */ + entropy->dc_context[ci] = 8; /* small negative diff category */ + } + /* Figure F.8: Encoding the magnitude category of v */ + m = 0; + if (v -= 1) { + arith_encode(cinfo, st, 1); + m = 1; + v2 = v; + st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ + while (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st += 1; + } + } + arith_encode(cinfo, st, 0); + /* Section F.1.4.4.1.2: Establish dc_context conditioning category */ + if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1)) + entropy->dc_context[ci] = 0; /* zero diff category */ + else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1)) + entropy->dc_context[ci] += 8; /* large diff category */ + /* Figure F.9: Encoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + arith_encode(cinfo, st, (m & v) ? 1 : 0); + } + } + + return TRUE; +} + + +/* + * MCU encoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + unsigned char *st; + int tbl, k, ke; + int v, v2, m; + const int * natural_order; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + emit_restart(cinfo, entropy->next_restart_num); + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + natural_order = cinfo->natural_order; + + /* Encode the MCU data block */ + block = MCU_data[0]; + tbl = cinfo->cur_comp_info[0]->ac_tbl_no; + + /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */ + + /* Establish EOB (end-of-block) index */ + ke = cinfo->Se; + do { + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if ((v = (*block)[natural_order[ke]]) >= 0) { + if (v >>= cinfo->Al) break; + } else { + v = -v; + if (v >>= cinfo->Al) break; + } + } while (--ke); + + /* Figure F.5: Encode_AC_Coefficients */ + for (k = cinfo->Ss - 1; k < ke;) { + st = entropy->ac_stats[tbl] + 3 * k; + arith_encode(cinfo, st, 0); /* EOB decision */ + for (;;) { + if ((v = (*block)[natural_order[++k]]) >= 0) { + if (v >>= cinfo->Al) { + arith_encode(cinfo, st + 1, 1); + arith_encode(cinfo, entropy->fixed_bin, 0); + break; + } + } else { + v = -v; + if (v >>= cinfo->Al) { + arith_encode(cinfo, st + 1, 1); + arith_encode(cinfo, entropy->fixed_bin, 1); + break; + } + } + arith_encode(cinfo, st + 1, 0); + st += 3; + } + st += 2; + /* Figure F.8: Encoding the magnitude category of v */ + m = 0; + if (v -= 1) { + arith_encode(cinfo, st, 1); + m = 1; + v2 = v; + if (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st = entropy->ac_stats[tbl] + + (k <= cinfo->arith_ac_K[tbl] ? 189 : 217); + while (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st += 1; + } + } + } + arith_encode(cinfo, st, 0); + /* Figure F.9: Encoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + arith_encode(cinfo, st, (m & v) ? 1 : 0); + } + /* Encode EOB decision only if k < cinfo->Se */ + if (k < cinfo->Se) { + st = entropy->ac_stats[tbl] + 3 * k; + arith_encode(cinfo, st, 1); + } + + return TRUE; +} + + +/* + * MCU encoding for DC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + unsigned char *st; + int Al, blkn; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + emit_restart(cinfo, entropy->next_restart_num); + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + st = entropy->fixed_bin; /* use fixed probability estimation */ + Al = cinfo->Al; + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + /* We simply emit the Al'th bit of the DC coefficient value. */ + arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1); + } + + return TRUE; +} + + +/* + * MCU encoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + unsigned char *st; + int tbl, k, ke, kex; + int v; + const int * natural_order; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + emit_restart(cinfo, entropy->next_restart_num); + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + natural_order = cinfo->natural_order; + + /* Encode the MCU data block */ + block = MCU_data[0]; + tbl = cinfo->cur_comp_info[0]->ac_tbl_no; + + /* Section G.1.3.3: Encoding of AC coefficients */ + + /* Establish EOB (end-of-block) index */ + ke = cinfo->Se; + do { + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if ((v = (*block)[natural_order[ke]]) >= 0) { + if (v >>= cinfo->Al) break; + } else { + v = -v; + if (v >>= cinfo->Al) break; + } + } while (--ke); + + /* Establish EOBx (previous stage end-of-block) index */ + for (kex = ke; kex > 0; kex--) + if ((v = (*block)[natural_order[kex]]) >= 0) { + if (v >>= cinfo->Ah) break; + } else { + v = -v; + if (v >>= cinfo->Ah) break; + } + + /* Figure G.10: Encode_AC_Coefficients_SA */ + for (k = cinfo->Ss - 1; k < ke;) { + st = entropy->ac_stats[tbl] + 3 * k; + if (k >= kex) + arith_encode(cinfo, st, 0); /* EOB decision */ + for (;;) { + if ((v = (*block)[natural_order[++k]]) >= 0) { + if (v >>= cinfo->Al) { + if (v >> 1) /* previously nonzero coef */ + arith_encode(cinfo, st + 2, (v & 1)); + else { /* newly nonzero coef */ + arith_encode(cinfo, st + 1, 1); + arith_encode(cinfo, entropy->fixed_bin, 0); + } + break; + } + } else { + v = -v; + if (v >>= cinfo->Al) { + if (v >> 1) /* previously nonzero coef */ + arith_encode(cinfo, st + 2, (v & 1)); + else { /* newly nonzero coef */ + arith_encode(cinfo, st + 1, 1); + arith_encode(cinfo, entropy->fixed_bin, 1); + } + break; + } + } + arith_encode(cinfo, st + 1, 0); + st += 3; + } + } + /* Encode EOB decision only if k < cinfo->Se */ + if (k < cinfo->Se) { + st = entropy->ac_stats[tbl] + 3 * k; + arith_encode(cinfo, st, 1); + } + + return TRUE; +} + + +/* + * Encode and output one MCU's worth of arithmetic-compressed coefficients. + */ + +METHODDEF(boolean) +encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + jpeg_component_info * compptr; + JBLOCKROW block; + unsigned char *st; + int blkn, ci, tbl, k, ke; + int v, v2, m; + const int * natural_order; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + emit_restart(cinfo, entropy->next_restart_num); + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + natural_order = cinfo->natural_order; + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */ + + tbl = compptr->dc_tbl_no; + + /* Table F.4: Point to statistics bin S0 for DC coefficient coding */ + st = entropy->dc_stats[tbl] + entropy->dc_context[ci]; + + /* Figure F.4: Encode_DC_DIFF */ + if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) { + arith_encode(cinfo, st, 0); + entropy->dc_context[ci] = 0; /* zero diff category */ + } else { + entropy->last_dc_val[ci] = (*block)[0]; + arith_encode(cinfo, st, 1); + /* Figure F.6: Encoding nonzero value v */ + /* Figure F.7: Encoding the sign of v */ + if (v > 0) { + arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */ + st += 2; /* Table F.4: SP = S0 + 2 */ + entropy->dc_context[ci] = 4; /* small positive diff category */ + } else { + v = -v; + arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */ + st += 3; /* Table F.4: SN = S0 + 3 */ + entropy->dc_context[ci] = 8; /* small negative diff category */ + } + /* Figure F.8: Encoding the magnitude category of v */ + m = 0; + if (v -= 1) { + arith_encode(cinfo, st, 1); + m = 1; + v2 = v; + st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ + while (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st += 1; + } + } + arith_encode(cinfo, st, 0); + /* Section F.1.4.4.1.2: Establish dc_context conditioning category */ + if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1)) + entropy->dc_context[ci] = 0; /* zero diff category */ + else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1)) + entropy->dc_context[ci] += 8; /* large diff category */ + /* Figure F.9: Encoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + arith_encode(cinfo, st, (m & v) ? 1 : 0); + } + + /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */ + + if ((ke = cinfo->lim_Se) == 0) continue; + tbl = compptr->ac_tbl_no; + + /* Establish EOB (end-of-block) index */ + do { + if ((*block)[natural_order[ke]]) break; + } while (--ke); + + /* Figure F.5: Encode_AC_Coefficients */ + for (k = 0; k < ke;) { + st = entropy->ac_stats[tbl] + 3 * k; + arith_encode(cinfo, st, 0); /* EOB decision */ + while ((v = (*block)[natural_order[++k]]) == 0) { + arith_encode(cinfo, st + 1, 0); + st += 3; + } + arith_encode(cinfo, st + 1, 1); + /* Figure F.6: Encoding nonzero value v */ + /* Figure F.7: Encoding the sign of v */ + if (v > 0) { + arith_encode(cinfo, entropy->fixed_bin, 0); + } else { + v = -v; + arith_encode(cinfo, entropy->fixed_bin, 1); + } + st += 2; + /* Figure F.8: Encoding the magnitude category of v */ + m = 0; + if (v -= 1) { + arith_encode(cinfo, st, 1); + m = 1; + v2 = v; + if (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st = entropy->ac_stats[tbl] + + (k <= cinfo->arith_ac_K[tbl] ? 189 : 217); + while (v2 >>= 1) { + arith_encode(cinfo, st, 1); + m <<= 1; + st += 1; + } + } + } + arith_encode(cinfo, st, 0); + /* Figure F.9: Encoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + arith_encode(cinfo, st, (m & v) ? 1 : 0); + } + /* Encode EOB decision only if k < cinfo->lim_Se */ + if (k < cinfo->lim_Se) { + st = entropy->ac_stats[tbl] + 3 * k; + arith_encode(cinfo, st, 1); + } + } + + return TRUE; +} + + +/* + * Initialize for an arithmetic-compressed scan. + */ + +METHODDEF(void) +start_pass (j_compress_ptr cinfo, boolean gather_statistics) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + int ci, tbl; + jpeg_component_info * compptr; + + if (gather_statistics) + /* Make sure to avoid that in the master control logic! + * We are fully adaptive here and need no extra + * statistics gathering pass! + */ + ERREXIT(cinfo, JERR_NOT_COMPILED); + + /* We assume jcmaster.c already validated the progressive scan parameters. */ + + /* Select execution routines */ + if (cinfo->progressive_mode) { + if (cinfo->Ah == 0) { + if (cinfo->Ss == 0) + entropy->pub.encode_mcu = encode_mcu_DC_first; + else + entropy->pub.encode_mcu = encode_mcu_AC_first; + } else { + if (cinfo->Ss == 0) + entropy->pub.encode_mcu = encode_mcu_DC_refine; + else + entropy->pub.encode_mcu = encode_mcu_AC_refine; + } + } else + entropy->pub.encode_mcu = encode_mcu; + + /* Allocate & initialize requested statistics areas */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) { + tbl = compptr->dc_tbl_no; + if (tbl < 0 || tbl >= NUM_ARITH_TBLS) + ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); + if (entropy->dc_stats[tbl] == NULL) + entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS); + MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS); + /* Initialize DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + entropy->dc_context[ci] = 0; + } + /* AC needs no table when not present */ + if (cinfo->Se) { + tbl = compptr->ac_tbl_no; + if (tbl < 0 || tbl >= NUM_ARITH_TBLS) + ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); + if (entropy->ac_stats[tbl] == NULL) + entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS); + MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS); +#ifdef CALCULATE_SPECTRAL_CONDITIONING + if (cinfo->progressive_mode) + /* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */ + cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4); +#endif + } + } + + /* Initialize arithmetic encoding variables */ + entropy->c = 0; + entropy->a = 0x10000L; + entropy->sc = 0; + entropy->zc = 0; + entropy->ct = 11; + entropy->buffer = -1; /* empty */ + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* + * Module initialization routine for arithmetic entropy encoding. + */ + +GLOBAL(void) +jinit_arith_encoder (j_compress_ptr cinfo) +{ + arith_entropy_ptr entropy; + int i; + + entropy = (arith_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(arith_entropy_encoder)); + cinfo->entropy = &entropy->pub; + entropy->pub.start_pass = start_pass; + entropy->pub.finish_pass = finish_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + entropy->dc_stats[i] = NULL; + entropy->ac_stats[i] = NULL; + } + + /* Initialize index for fixed probability estimation */ + entropy->fixed_bin[0] = 113; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jccoefct.c b/thirdparty/LibJPEG/jpeg-9/jccoefct.c new file mode 100644 index 0000000..924a703 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jccoefct.c @@ -0,0 +1,454 @@ +/* + * jccoefct.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 2003-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for compression. + * This controller is the top level of the JPEG compressor proper. + * The coefficient buffer lies between forward-DCT and entropy encoding steps. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* We use a full-image coefficient buffer when doing Huffman optimization, + * and also for writing multiple-scan JPEG files. In all cases, the DCT + * step is run during the first pass, and subsequent passes need only read + * the buffered coefficients. + */ +#ifdef ENTROPY_OPT_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#else +#ifdef C_MULTISCAN_FILES_SUPPORTED +#define FULL_COEF_BUFFER_SUPPORTED +#endif +#endif + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_coef_controller pub; /* public fields */ + + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* For single-pass compression, it's sufficient to buffer just one MCU + * (although this may prove a bit slow in practice). We allocate a + * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each + * MCU constructed and sent. (On 80x86, the workspace is FAR even though + * it's not really very big; this is to keep the module interfaces unchanged + * when a large coefficient buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays. + */ + JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]; + + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +} my_coef_controller; + +typedef my_coef_controller * my_coef_ptr; + + +/* Forward declarations */ +METHODDEF(boolean) compress_data + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#ifdef FULL_COEF_BUFFER_SUPPORTED +METHODDEF(boolean) compress_first_pass + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +METHODDEF(boolean) compress_output + JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (coef->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_data; + break; +#ifdef FULL_COEF_BUFFER_SUPPORTED + case JBUF_SAVE_AND_PASS: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_first_pass; + break; + case JBUF_CRANK_DEST: + if (coef->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + coef->pub.compress_data = compress_output; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data in the single-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(boolean) +compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, bi, ci, yindex, yoffset, blockcnt; + JDIMENSION ypos, xpos; + jpeg_component_info *compptr; + forward_DCT_ptr forward_DCT; + + /* Loop to write as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Determine where data comes from in input_buf and do the DCT thing. + * Each call on forward_DCT processes a horizontal row of DCT blocks + * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks + * sequentially. Dummy blocks at the right or bottom edge are filled in + * specially. The data in them does not matter for image reconstruction, + * so we fill them with values that will encode to the smallest amount of + * data, viz: all zeroes in the AC entries, DC entries equal to previous + * block's DC value. (Thanks to Thomas Kinsman for this idea.) + */ + blkn = 0; + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + forward_DCT = cinfo->fdct->forward_DCT[compptr->component_index]; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + xpos = MCU_col_num * compptr->MCU_sample_width; + ypos = yoffset * compptr->DCT_v_scaled_size; + /* ypos == (yoffset+yindex) * DCTSIZE */ + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + (*forward_DCT) (cinfo, compptr, + input_buf[compptr->component_index], + coef->MCU_buffer[blkn], + ypos, xpos, (JDIMENSION) blockcnt); + if (blockcnt < compptr->MCU_width) { + /* Create some dummy blocks at the right edge of the image. */ + FMEMZERO((void FAR *) coef->MCU_buffer[blkn + blockcnt], + (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); + for (bi = blockcnt; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0]; + } + } + } else { + /* Create a row of dummy blocks at the bottom of the image. */ + FMEMZERO((void FAR *) coef->MCU_buffer[blkn], + compptr->MCU_width * SIZEOF(JBLOCK)); + for (bi = 0; bi < compptr->MCU_width; bi++) { + coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0]; + } + } + blkn += compptr->MCU_width; + ypos += compptr->DCT_v_scaled_size; + } + } + /* Try to write the MCU. In event of a suspension failure, we will + * re-DCT the MCU on restart (a bit inefficient, could be fixed...) + */ + if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +#ifdef FULL_COEF_BUFFER_SUPPORTED + +/* + * Process some data in the first pass of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the image. + * This amount of data is read from the source buffer, DCT'd and quantized, + * and saved into the virtual arrays. We also generate suitable dummy blocks + * as needed at the right and lower edges. (The dummy blocks are constructed + * in the virtual arrays, which have been padded appropriately.) This makes + * it possible for subsequent passes not to worry about real vs. dummy blocks. + * + * We must also emit the data to the entropy encoder. This is conveniently + * done by calling compress_output() after we've loaded the current strip + * of the virtual arrays. + * + * NB: input_buf contains a plane for each component in image. All + * components are DCT'd and loaded into the virtual arrays in this pass. + * However, it may be that only a subset of the components are emitted to + * the entropy encoder during this first pass; be careful about looking + * at the scan-dependent variables (MCU dimensions, etc). + */ + +METHODDEF(boolean) +compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION blocks_across, MCUs_across, MCUindex; + int bi, ci, h_samp_factor, block_row, block_rows, ndummy; + JCOEF lastDC; + jpeg_component_info *compptr; + JBLOCKARRAY buffer; + JBLOCKROW thisblockrow, lastblockrow; + forward_DCT_ptr forward_DCT; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + coef->iMCU_row_num * compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (coef->iMCU_row_num < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here, since may not be set! */ + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + blocks_across = compptr->width_in_blocks; + h_samp_factor = compptr->h_samp_factor; + /* Count number of dummy blocks to be added at the right margin. */ + ndummy = (int) (blocks_across % h_samp_factor); + if (ndummy > 0) + ndummy = h_samp_factor - ndummy; + forward_DCT = cinfo->fdct->forward_DCT[ci]; + /* Perform DCT for all non-dummy blocks in this iMCU row. Each call + * on forward_DCT processes a complete horizontal row of DCT blocks. + */ + for (block_row = 0; block_row < block_rows; block_row++) { + thisblockrow = buffer[block_row]; + (*forward_DCT) (cinfo, compptr, input_buf[ci], thisblockrow, + (JDIMENSION) (block_row * compptr->DCT_v_scaled_size), + (JDIMENSION) 0, blocks_across); + if (ndummy > 0) { + /* Create dummy blocks at the right edge of the image. */ + thisblockrow += blocks_across; /* => first dummy block */ + FMEMZERO((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK)); + lastDC = thisblockrow[-1][0]; + for (bi = 0; bi < ndummy; bi++) { + thisblockrow[bi][0] = lastDC; + } + } + } + /* If at end of image, create dummy block rows as needed. + * The tricky part here is that within each MCU, we want the DC values + * of the dummy blocks to match the last real block's DC value. + * This squeezes a few more bytes out of the resulting file... + */ + if (coef->iMCU_row_num == last_iMCU_row) { + blocks_across += ndummy; /* include lower right corner */ + MCUs_across = blocks_across / h_samp_factor; + for (block_row = block_rows; block_row < compptr->v_samp_factor; + block_row++) { + thisblockrow = buffer[block_row]; + lastblockrow = buffer[block_row-1]; + FMEMZERO((void FAR *) thisblockrow, + (size_t) (blocks_across * SIZEOF(JBLOCK))); + for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { + lastDC = lastblockrow[h_samp_factor-1][0]; + for (bi = 0; bi < h_samp_factor; bi++) { + thisblockrow[bi][0] = lastDC; + } + thisblockrow += h_samp_factor; /* advance to next MCU in row */ + lastblockrow += h_samp_factor; + } + } + } + } + /* NB: compress_output will increment iMCU_row_num if successful. + * A suspension return will result in redoing all the work above next time. + */ + + /* Emit data to the entropy encoder, sharing code with subsequent passes */ + return compress_output(cinfo, input_buf); +} + + +/* + * Process some data in subsequent passes of a multi-pass case. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. + * NB: during first pass, this is safe only because the buffers will + * already be aligned properly, so jmemmgr.c won't need to do any I/O. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to write the MCU. */ + if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + +#endif /* FULL_COEF_BUFFER_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_coef_ptr coef; + + coef = (my_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_coef_controller)); + cinfo->coef = (struct jpeg_c_coef_controller *) coef; + coef->pub.start_pass = start_pass_coef; + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef FULL_COEF_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + int ci; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) jround_up((long) compptr->width_in_blocks, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_blocks, + (long) compptr->v_samp_factor), + (JDIMENSION) compptr->v_samp_factor); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + coef->whole_image[0] = NULL; /* flag for no virtual arrays */ + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jccolor.c b/thirdparty/LibJPEG/jpeg-9/jccolor.c new file mode 100644 index 0000000..81d74ef --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jccolor.c @@ -0,0 +1,541 @@ +/* + * jccolor.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2011-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_converter pub; /* public fields */ + + /* Private state for RGB->YCC conversion */ + INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ +} my_color_converter; + +typedef my_color_converter * my_cconvert_ptr; + + +/**************** RGB -> YCbCr conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE + * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, + * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and + * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) + * were not represented exactly. Now we sacrifice exact representation of + * maximum red and maximum blue in order to get exact grayscales. + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times R,G,B for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included + * in the tables to save adding them separately in the inner loop. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS) +#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((INT32) ((x) * (1L< Y section */ +#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ +#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ +#define R_CB_OFF (3*(MAXJSAMPLE+1)) +#define G_CB_OFF (4*(MAXJSAMPLE+1)) +#define B_CB_OFF (5*(MAXJSAMPLE+1)) +#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ +#define G_CR_OFF (6*(MAXJSAMPLE+1)) +#define B_CR_OFF (7*(MAXJSAMPLE+1)) +#define TABLE_SIZE (8*(MAXJSAMPLE+1)) + + +/* + * Initialize for RGB->YCC colorspace conversion. + */ + +METHODDEF(void) +rgb_ycc_start (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + INT32 * rgb_ycc_tab; + INT32 i; + + /* Allocate and fill in the conversion tables. */ + cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (TABLE_SIZE * SIZEOF(INT32))); + + for (i = 0; i <= MAXJSAMPLE; i++) { + rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; + rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; + rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; + rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. + * This ensures that the maximum output will round to MAXJSAMPLE + * not MAXJSAMPLE+1, and thus that we don't have to range-limit. + */ + rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +/* B=>Cb and R=>Cr tables are the same + rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; +*/ + rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; + rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * + * Note that we change from the application's interleaved-pixel format + * to our internal noninterleaved, one-plane-per-component format. + * The input buffer is therefore three times as wide as the output buffer. + * + * A starting row offset is provided only for the output buffer. The caller + * can easily adjust the passed input_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +rgb_ycc_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + inptr += RGB_PIXELSIZE; + } + } +} + + +/**************** Cases other than RGB -> YCbCr **************/ + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles RGB->grayscale conversion, which is the same + * as the RGB->Y portion of RGB->YCbCr. + * We assume rgb_ycc_start has been called (we only use the Y tables). + */ + +METHODDEF(void) +rgb_gray_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row++]; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + inptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles Adobe-style CMYK->YCCK conversion, + * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same + * conversion as above, while passing K (black) unchanged. + * We assume rgb_ycc_start has been called. + */ + +METHODDEF(void) +cmyk_ycck_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_ycc_tab; + register int r, g, b; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2, outptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + outptr3 = output_buf[3][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); + g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); + b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); + /* K passes through as-is */ + outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ + /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations + * must be too; we do not need an explicit range-limiting operation. + * Hence the value being shifted is never negative, and we don't + * need the general RIGHT_SHIFT macro. + */ + /* Y */ + outptr0[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + /* Cb */ + outptr1[col] = (JSAMPLE) + ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) + >> SCALEBITS); + /* Cr */ + outptr2[col] = (JSAMPLE) + ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) + >> SCALEBITS); + inptr += 4; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * [R,G,B] to [R-G,G,B-G] conversion with modulo calculation + * (forward reversible color transform). + */ + +METHODDEF(void) +rgb_rgb1_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register int r, g, b; + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr[RGB_RED]); + g = GETJSAMPLE(inptr[RGB_GREEN]); + b = GETJSAMPLE(inptr[RGB_BLUE]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE); + outptr1[col] = (JSAMPLE) g; + outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE); + inptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles grayscale output with no conversion. + * The source can be either plain grayscale or YCbCr (since Y == gray). + */ + +METHODDEF(void) +grayscale_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + int instride = cinfo->input_components; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr = output_buf[0][output_row++]; + for (col = 0; col < num_cols; col++) { + outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ + inptr += instride; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * No colorspace conversion, but change from interleaved + * to separate-planes representation. + */ + +METHODDEF(void) +rgb_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + register JSAMPROW inptr; + register JSAMPROW outptr0, outptr1, outptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + inptr = *input_buf++; + outptr0 = output_buf[0][output_row]; + outptr1 = output_buf[1][output_row]; + outptr2 = output_buf[2][output_row]; + output_row++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr0[col] = inptr[RGB_RED]; + outptr1[col] = inptr[RGB_GREEN]; + outptr2[col] = inptr[RGB_BLUE]; + inptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Convert some rows of samples to the JPEG colorspace. + * This version handles multi-component colorspaces without conversion. + * We assume input_components == num_components. + */ + +METHODDEF(void) +null_convert (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) +{ + int ci; + register int nc = cinfo->num_components; + register JSAMPROW inptr; + register JSAMPROW outptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->image_width; + + while (--num_rows >= 0) { + /* It seems fastest to make a separate pass for each component. */ + for (ci = 0; ci < nc; ci++) { + inptr = input_buf[0] + ci; + outptr = output_buf[ci][output_row]; + for (col = 0; col < num_cols; col++) { + *outptr++ = *inptr; /* don't need GETJSAMPLE() here */ + inptr += nc; + } + } + input_buf++; + output_row++; + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +null_method (j_compress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for input colorspace conversion. + */ + +GLOBAL(void) +jinit_color_converter (j_compress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_converter)); + cinfo->cconvert = &cconvert->pub; + /* set start_pass to null method until we find out differently */ + cconvert->pub.start_pass = null_method; + + /* Make sure input_components agrees with in_color_space */ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + if (cinfo->input_components != 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_RGB: + if (cinfo->input_components != RGB_PIXELSIZE) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_YCbCr: + if (cinfo->input_components != 3) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->input_components != 4) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->input_components < 1) + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + break; + } + + /* Support color transform only for RGB colorspace */ + if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + + /* Check num_components, set conversion method based on requested space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_GRAYSCALE || + cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = grayscale_convert; + else if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_gray_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB) { + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb_rgb1_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_RGB) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = rgb_ycc_convert; + } else if (cinfo->in_color_space == JCS_YCbCr) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + if (cinfo->in_color_space == JCS_CMYK) { + cconvert->pub.start_pass = rgb_ycc_start; + cconvert->pub.color_convert = cmyk_ycck_convert; + } else if (cinfo->in_color_space == JCS_YCCK) + cconvert->pub.color_convert = null_convert; + else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: /* allow null conversion of JCS_UNKNOWN */ + if (cinfo->jpeg_color_space != cinfo->in_color_space || + cinfo->num_components != cinfo->input_components) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + cconvert->pub.color_convert = null_convert; + break; + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcdctmgr.c b/thirdparty/LibJPEG/jpeg-9/jcdctmgr.c new file mode 100644 index 0000000..0bbdbb6 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcdctmgr.c @@ -0,0 +1,482 @@ +/* + * jcdctmgr.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the forward-DCT management logic. + * This code selects a particular DCT implementation to be used, + * and it performs related housekeeping chores including coefficient + * quantization. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + + +/* Private subobject for this module */ + +typedef struct { + struct jpeg_forward_dct pub; /* public fields */ + + /* Pointer to the DCT routine actually in use */ + forward_DCT_method_ptr do_dct[MAX_COMPONENTS]; + + /* The actual post-DCT divisors --- not identical to the quant table + * entries, because of scaling (especially for an unnormalized DCT). + * Each table is given in normal array order. + */ + DCTELEM * divisors[NUM_QUANT_TBLS]; + +#ifdef DCT_FLOAT_SUPPORTED + /* Same as above for the floating-point case. */ + float_DCT_method_ptr do_float_dct[MAX_COMPONENTS]; + FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; +#endif +} my_fdct_controller; + +typedef my_fdct_controller * my_fdct_ptr; + + +/* The current scaled-DCT routines require ISLOW-style divisor tables, + * so be sure to compile that code if either ISLOW or SCALING is requested. + */ +#ifdef DCT_ISLOW_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#else +#ifdef DCT_SCALING_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#endif +#endif + + +/* + * Perform forward DCT on one or more blocks of a component. + * + * The input samples are taken from the sample_data[] array starting at + * position start_row/start_col, and moving to the right for any additional + * blocks. The quantized coefficients are returned in coef_blocks[]. + */ + +METHODDEF(void) +forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for integer DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; + forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index]; + DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; + DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) { + /* Perform the DCT */ + (*do_dct) (workspace, sample_data, start_col); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register DCTELEM temp, qval; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + qval = divisors[i]; + temp = workspace[i]; + /* Divide the coefficient value by qval, ensuring proper rounding. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * + * In most files, at least half of the output values will be zero + * (at default quantization settings, more like three-quarters...) + * so we should ensure that this case is fast. On many machines, + * a comparison is enough cheaper than a divide to make a special test + * a win. Since both inputs will be nonnegative, we need only test + * for a < b to discover whether a/b is 0. + * If your machine's division is fast enough, define FAST_DIVIDE. + */ +#ifdef FAST_DIVIDE +#define DIVIDE_BY(a,b) a /= b +#else +#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 +#endif + if (temp < 0) { + temp = -temp; + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + temp = -temp; + } else { + temp += qval>>1; /* for rounding */ + DIVIDE_BY(temp, qval); + } + output_ptr[i] = (JCOEF) temp; + } + } + } +} + + +#ifdef DCT_FLOAT_SUPPORTED + +METHODDEF(void) +forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks) +/* This version is used for floating-point DCT implementations. */ +{ + /* This routine is heavily used, so it's worth coding it tightly. */ + my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; + float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index]; + FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; + FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ + JDIMENSION bi; + + sample_data += start_row; /* fold in the vertical offset once */ + + for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) { + /* Perform the DCT */ + (*do_dct) (workspace, sample_data, start_col); + + /* Quantize/descale the coefficients, and store into coef_blocks[] */ + { register FAST_FLOAT temp; + register int i; + register JCOEFPTR output_ptr = coef_blocks[bi]; + + for (i = 0; i < DCTSIZE2; i++) { + /* Apply the quantization and scaling factor */ + temp = workspace[i] * divisors[i]; + /* Round to nearest integer. + * Since C does not specify the direction of rounding for negative + * quotients, we have to force the dividend positive for portability. + * The maximum coefficient size is +-16K (for 12-bit data), so this + * code should work for either 16-bit or 32-bit ints. + */ + output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); + } + } + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ + + +/* + * Initialize for a processing pass. + * Verify that all referenced Q-tables are present, and set up + * the divisor table for each one. + * In the current implementation, DCT of all components is done during + * the first pass, even if only some components will be output in the + * first scan. Hence all components should be examined here. + */ + +METHODDEF(void) +start_pass_fdctmgr (j_compress_ptr cinfo) +{ + my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; + int ci, qtblno, i; + jpeg_component_info *compptr; + int method = 0; + JQUANT_TBL * qtbl; + DCTELEM * dtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Select the proper DCT routine for this component's scaling */ + switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) { +#ifdef DCT_SCALING_SUPPORTED + case ((1 << 8) + 1): + fdct->do_dct[ci] = jpeg_fdct_1x1; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((2 << 8) + 2): + fdct->do_dct[ci] = jpeg_fdct_2x2; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((3 << 8) + 3): + fdct->do_dct[ci] = jpeg_fdct_3x3; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((4 << 8) + 4): + fdct->do_dct[ci] = jpeg_fdct_4x4; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((5 << 8) + 5): + fdct->do_dct[ci] = jpeg_fdct_5x5; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((6 << 8) + 6): + fdct->do_dct[ci] = jpeg_fdct_6x6; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((7 << 8) + 7): + fdct->do_dct[ci] = jpeg_fdct_7x7; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((9 << 8) + 9): + fdct->do_dct[ci] = jpeg_fdct_9x9; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((10 << 8) + 10): + fdct->do_dct[ci] = jpeg_fdct_10x10; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((11 << 8) + 11): + fdct->do_dct[ci] = jpeg_fdct_11x11; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((12 << 8) + 12): + fdct->do_dct[ci] = jpeg_fdct_12x12; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((13 << 8) + 13): + fdct->do_dct[ci] = jpeg_fdct_13x13; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((14 << 8) + 14): + fdct->do_dct[ci] = jpeg_fdct_14x14; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((15 << 8) + 15): + fdct->do_dct[ci] = jpeg_fdct_15x15; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((16 << 8) + 16): + fdct->do_dct[ci] = jpeg_fdct_16x16; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((16 << 8) + 8): + fdct->do_dct[ci] = jpeg_fdct_16x8; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((14 << 8) + 7): + fdct->do_dct[ci] = jpeg_fdct_14x7; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((12 << 8) + 6): + fdct->do_dct[ci] = jpeg_fdct_12x6; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((10 << 8) + 5): + fdct->do_dct[ci] = jpeg_fdct_10x5; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((8 << 8) + 4): + fdct->do_dct[ci] = jpeg_fdct_8x4; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((6 << 8) + 3): + fdct->do_dct[ci] = jpeg_fdct_6x3; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((4 << 8) + 2): + fdct->do_dct[ci] = jpeg_fdct_4x2; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((2 << 8) + 1): + fdct->do_dct[ci] = jpeg_fdct_2x1; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((8 << 8) + 16): + fdct->do_dct[ci] = jpeg_fdct_8x16; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((7 << 8) + 14): + fdct->do_dct[ci] = jpeg_fdct_7x14; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((6 << 8) + 12): + fdct->do_dct[ci] = jpeg_fdct_6x12; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((5 << 8) + 10): + fdct->do_dct[ci] = jpeg_fdct_5x10; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((4 << 8) + 8): + fdct->do_dct[ci] = jpeg_fdct_4x8; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((3 << 8) + 6): + fdct->do_dct[ci] = jpeg_fdct_3x6; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((2 << 8) + 4): + fdct->do_dct[ci] = jpeg_fdct_2x4; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; + case ((1 << 8) + 2): + fdct->do_dct[ci] = jpeg_fdct_1x2; + method = JDCT_ISLOW; /* jfdctint uses islow-style table */ + break; +#endif + case ((DCTSIZE << 8) + DCTSIZE): + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + fdct->do_dct[ci] = jpeg_fdct_islow; + method = JDCT_ISLOW; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + fdct->do_dct[ci] = jpeg_fdct_ifast; + method = JDCT_IFAST; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + fdct->do_float_dct[ci] = jpeg_fdct_float; + method = JDCT_FLOAT; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + break; + default: + ERREXIT2(cinfo, JERR_BAD_DCTSIZE, + compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size); + break; + } + qtblno = compptr->quant_tbl_no; + /* Make sure specified quantization table is present */ + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + qtbl = cinfo->quant_tbl_ptrs[qtblno]; + /* Compute divisors for this quant table */ + /* We may do this more than once for same table, but it's not a big deal */ + switch (method) { +#ifdef PROVIDE_ISLOW_TABLES + case JDCT_ISLOW: + /* For LL&M IDCT method, divisors are equal to raw quantization + * coefficients multiplied by 8 (to counteract scaling). + */ + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; + } + fdct->pub.forward_DCT[ci] = forward_DCT; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + */ +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + if (fdct->divisors[qtblno] == NULL) { + fdct->divisors[qtblno] = (DCTELEM *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(DCTELEM)); + } + dtbl = fdct->divisors[qtblno]; + for (i = 0; i < DCTSIZE2; i++) { + dtbl[i] = (DCTELEM) + DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], + (INT32) aanscales[i]), + CONST_BITS-3); + } + } + fdct->pub.forward_DCT[ci] = forward_DCT; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, divisors are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 8. + * What's actually stored is 1/divisor so that the inner loop can + * use a multiplication rather than a division. + */ + FAST_FLOAT * fdtbl; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + if (fdct->float_divisors[qtblno] == NULL) { + fdct->float_divisors[qtblno] = (FAST_FLOAT *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + DCTSIZE2 * SIZEOF(FAST_FLOAT)); + } + fdtbl = fdct->float_divisors[qtblno]; + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fdtbl[i] = (FAST_FLOAT) + (1.0 / (((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * 8.0))); + i++; + } + } + } + fdct->pub.forward_DCT[ci] = forward_DCT_float; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Initialize FDCT manager. + */ + +GLOBAL(void) +jinit_forward_dct (j_compress_ptr cinfo) +{ + my_fdct_ptr fdct; + int i; + + fdct = (my_fdct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_fdct_controller)); + cinfo->fdct = (struct jpeg_forward_dct *) fdct; + fdct->pub.start_pass = start_pass_fdctmgr; + + /* Mark divisor tables unallocated */ + for (i = 0; i < NUM_QUANT_TBLS; i++) { + fdct->divisors[i] = NULL; +#ifdef DCT_FLOAT_SUPPORTED + fdct->float_divisors[i] = NULL; +#endif + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jchuff.c b/thirdparty/LibJPEG/jpeg-9/jchuff.c new file mode 100644 index 0000000..257d7aa --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jchuff.c @@ -0,0 +1,1576 @@ +/* + * jchuff.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2006-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy encoding routines. + * Both sequential and progressive modes are supported in this single module. + * + * Much of the complexity here has to do with supporting output suspension. + * If the data destination module demands suspension, we want to be able to + * back up to the start of the current MCU. To do this, we copy state + * variables into local working storage, and update them back to the + * permanent JPEG objects only upon successful completion of an MCU. + * + * We do not support output suspension for the progressive JPEG mode, since + * the library currently does not allow multiple-scan files to be written + * with output suspension. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* The legal range of a DCT coefficient is + * -1024 .. +1023 for 8-bit data; + * -16384 .. +16383 for 12-bit data. + * Hence the magnitude should always fit in 10 or 14 bits respectively. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MAX_COEF_BITS 10 +#else +#define MAX_COEF_BITS 14 +#endif + +/* Derived data constructed for each Huffman table */ + +typedef struct { + unsigned int ehufco[256]; /* code for each symbol */ + char ehufsi[256]; /* length of code for each symbol */ + /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ +} c_derived_tbl; + + +/* Expanded entropy encoder object for Huffman encoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + INT32 put_buffer; /* current bit-accumulation buffer */ + int put_bits; /* # of bits now in it */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).put_buffer = (src).put_buffer, \ + (dest).put_bits = (src).put_bits, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + struct jpeg_entropy_encoder pub; /* public fields */ + + savable_state saved; /* Bit buffer & DC state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + int next_restart_num; /* next restart number to write (0-7) */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + + /* Statistics tables for optimization */ + long * dc_count_ptrs[NUM_HUFF_TBLS]; + long * ac_count_ptrs[NUM_HUFF_TBLS]; + + /* Following fields used only in progressive mode */ + + /* Mode flag: TRUE for optimization, FALSE for actual data output */ + boolean gather_statistics; + + /* next_output_byte/free_in_buffer are local copies of cinfo->dest fields. + */ + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ + + /* Coding status for AC components */ + int ac_tbl_no; /* the table number of the single component */ + unsigned int EOBRUN; /* run length of EOBs */ + unsigned int BE; /* # of buffered correction bits before MCU */ + char * bit_buffer; /* buffer for correction bits (1 per char) */ + /* packing correction bits tightly would save some space but cost time... */ +} huff_entropy_encoder; + +typedef huff_entropy_encoder * huff_entropy_ptr; + +/* Working state while writing an MCU (sequential mode). + * This struct contains all the fields that are needed by subroutines. + */ + +typedef struct { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + savable_state cur; /* Current bit buffer & DC state */ + j_compress_ptr cinfo; /* dump_buffer needs access to this */ +} working_state; + +/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit + * buffer can hold. Larger sizes may slightly improve compression, but + * 1000 is already well into the realm of overkill. + * The minimum safe size is 64 bits. + */ + +#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ + +/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. + * We assume that int right shift is unsigned if INT32 right shift is, + * which should be safe. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS int ishift_temp; +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +LOCAL(void) +jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno, + c_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + c_derived_tbl *dtbl; + int p, i, l, lastp, si, maxsymbol; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (c_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(c_derived_tbl)); + dtbl = *pdtbl; + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + lastp = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + */ + if (((INT32) code) >= (((INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure C.3: generate encoding tables */ + /* These are code and size indexed by symbol value */ + + /* Set all codeless symbols to have code length 0; + * this lets us detect duplicate VAL entries here, and later + * allows emit_bits to detect any attempt to emit such symbols. + */ + MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi)); + + /* This is also a convenient place to check for out-of-range + * and duplicated VAL entries. We allow 0..255 for AC symbols + * but only 0..15 for DC. (We could constrain them further + * based on data depth and mode, but this seems enough.) + */ + maxsymbol = isDC ? 15 : 255; + + for (p = 0; p < lastp; p++) { + i = htbl->huffval[p]; + if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + dtbl->ehufco[i] = huffcode[p]; + dtbl->ehufsi[i] = huffsize[p]; + } +} + + +/* Outputting bytes to the file. + * NB: these must be called only when actually outputting, + * that is, entropy->gather_statistics == FALSE. + */ + +/* Emit a byte, taking 'action' if must suspend. */ +#define emit_byte_s(state,val,action) \ + { *(state)->next_output_byte++ = (JOCTET) (val); \ + if (--(state)->free_in_buffer == 0) \ + if (! dump_buffer_s(state)) \ + { action; } } + +/* Emit a byte */ +#define emit_byte_e(entropy,val) \ + { *(entropy)->next_output_byte++ = (JOCTET) (val); \ + if (--(entropy)->free_in_buffer == 0) \ + dump_buffer_e(entropy); } + + +LOCAL(boolean) +dump_buffer_s (working_state * state) +/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ +{ + struct jpeg_destination_mgr * dest = state->cinfo->dest; + + if (! (*dest->empty_output_buffer) (state->cinfo)) + return FALSE; + /* After a successful buffer dump, must reset buffer pointers */ + state->next_output_byte = dest->next_output_byte; + state->free_in_buffer = dest->free_in_buffer; + return TRUE; +} + + +LOCAL(void) +dump_buffer_e (huff_entropy_ptr entropy) +/* Empty the output buffer; we do not support suspension in this case. */ +{ + struct jpeg_destination_mgr * dest = entropy->cinfo->dest; + + if (! (*dest->empty_output_buffer) (entropy->cinfo)) + ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); + /* After a successful buffer dump, must reset buffer pointers */ + entropy->next_output_byte = dest->next_output_byte; + entropy->free_in_buffer = dest->free_in_buffer; +} + + +/* Outputting bits to the file */ + +/* Only the right 24 bits of put_buffer are used; the valid bits are + * left-justified in this part. At most 16 bits can be passed to emit_bits + * in one call, and we never retain more than 7 bits in put_buffer + * between calls, so 24 bits are sufficient. + */ + +INLINE +LOCAL(boolean) +emit_bits_s (working_state * state, unsigned int code, int size) +/* Emit some bits; return TRUE if successful, FALSE if must suspend */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register INT32 put_buffer = (INT32) code; + register int put_bits = state->cur.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); + + put_buffer &= (((INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte_s(state, c, return FALSE); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte_s(state, 0, return FALSE); + } + put_buffer <<= 8; + put_bits -= 8; + } + + state->cur.put_buffer = put_buffer; /* update state variables */ + state->cur.put_bits = put_bits; + + return TRUE; +} + + +INLINE +LOCAL(void) +emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size) +/* Emit some bits, unless we are in gather mode */ +{ + /* This routine is heavily used, so it's worth coding tightly. */ + register INT32 put_buffer = (INT32) code; + register int put_bits = entropy->saved.put_bits; + + /* if size is 0, caller used an invalid Huffman table entry */ + if (size == 0) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + if (entropy->gather_statistics) + return; /* do nothing if we're only getting stats */ + + put_buffer &= (((INT32) 1)<saved.put_buffer; + + while (put_bits >= 8) { + int c = (int) ((put_buffer >> 16) & 0xFF); + + emit_byte_e(entropy, c); + if (c == 0xFF) { /* need to stuff a zero byte? */ + emit_byte_e(entropy, 0); + } + put_buffer <<= 8; + put_bits -= 8; + } + + entropy->saved.put_buffer = put_buffer; /* update variables */ + entropy->saved.put_bits = put_bits; +} + + +LOCAL(boolean) +flush_bits_s (working_state * state) +{ + if (! emit_bits_s(state, 0x7F, 7)) /* fill any partial byte with ones */ + return FALSE; + state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ + state->cur.put_bits = 0; + return TRUE; +} + + +LOCAL(void) +flush_bits_e (huff_entropy_ptr entropy) +{ + emit_bits_e(entropy, 0x7F, 7); /* fill any partial byte with ones */ + entropy->saved.put_buffer = 0; /* and reset bit-buffer to empty */ + entropy->saved.put_bits = 0; +} + + +/* + * Emit (or just count) a Huffman symbol. + */ + +INLINE +LOCAL(void) +emit_dc_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol) +{ + if (entropy->gather_statistics) + entropy->dc_count_ptrs[tbl_no][symbol]++; + else { + c_derived_tbl * tbl = entropy->dc_derived_tbls[tbl_no]; + emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); + } +} + + +INLINE +LOCAL(void) +emit_ac_symbol (huff_entropy_ptr entropy, int tbl_no, int symbol) +{ + if (entropy->gather_statistics) + entropy->ac_count_ptrs[tbl_no][symbol]++; + else { + c_derived_tbl * tbl = entropy->ac_derived_tbls[tbl_no]; + emit_bits_e(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); + } +} + + +/* + * Emit bits from a correction bit buffer. + */ + +LOCAL(void) +emit_buffered_bits (huff_entropy_ptr entropy, char * bufstart, + unsigned int nbits) +{ + if (entropy->gather_statistics) + return; /* no real work */ + + while (nbits > 0) { + emit_bits_e(entropy, (unsigned int) (*bufstart), 1); + bufstart++; + nbits--; + } +} + + +/* + * Emit any pending EOBRUN symbol. + */ + +LOCAL(void) +emit_eobrun (huff_entropy_ptr entropy) +{ + register int temp, nbits; + + if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */ + temp = entropy->EOBRUN; + nbits = 0; + while ((temp >>= 1)) + nbits++; + /* safety check: shouldn't happen given limited correction-bit buffer */ + if (nbits > 14) + ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); + + emit_ac_symbol(entropy, entropy->ac_tbl_no, nbits << 4); + if (nbits) + emit_bits_e(entropy, entropy->EOBRUN, nbits); + + entropy->EOBRUN = 0; + + /* Emit any buffered correction bits */ + emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE); + entropy->BE = 0; + } +} + + +/* + * Emit a restart marker & resynchronize predictions. + */ + +LOCAL(boolean) +emit_restart_s (working_state * state, int restart_num) +{ + int ci; + + if (! flush_bits_s(state)) + return FALSE; + + emit_byte_s(state, 0xFF, return FALSE); + emit_byte_s(state, JPEG_RST0 + restart_num, return FALSE); + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) + state->cur.last_dc_val[ci] = 0; + + /* The restart counter is not updated until we successfully write the MCU. */ + + return TRUE; +} + + +LOCAL(void) +emit_restart_e (huff_entropy_ptr entropy, int restart_num) +{ + int ci; + + emit_eobrun(entropy); + + if (! entropy->gather_statistics) { + flush_bits_e(entropy); + emit_byte_e(entropy, 0xFF); + emit_byte_e(entropy, JPEG_RST0 + restart_num); + } + + if (entropy->cinfo->Ss == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + } else { + /* Re-initialize all AC-related fields to 0 */ + entropy->EOBRUN = 0; + entropy->BE = 0; + } +} + + +/* + * MCU encoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int temp, temp2; + register int nbits; + int blkn, ci; + int Al = cinfo->Al; + JBLOCKROW block; + jpeg_component_info * compptr; + ISHIFT_TEMPS + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart_e(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Compute the DC value after the required point transform by Al. + * This is simply an arithmetic right shift. + */ + temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); + + /* DC differences are figured on the point-transformed values. */ + temp = temp2 - entropy->saved.last_dc_val[ci]; + entropy->saved.last_dc_val[ci] = temp2; + + /* Encode the DC coefficient difference per section G.1.2.1 */ + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit the Huffman-coded symbol for the number of bits */ + emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + emit_bits_e(entropy, (unsigned int) temp2, nbits); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int temp, temp2; + register int nbits; + register int r, k; + int Se, Al; + const int * natural_order; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart_e(entropy, entropy->next_restart_num); + + Se = cinfo->Se; + Al = cinfo->Al; + natural_order = cinfo->natural_order; + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ + + r = 0; /* r = run length of zeros */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = (*block)[natural_order[k]]) == 0) { + r++; + continue; + } + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value; so the code is + * interwoven with finding the abs value (temp) and output bits (temp2). + */ + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + /* For a negative coef, want temp2 = bitwise complement of abs(coef) */ + temp2 = ~temp; + } else { + temp >>= Al; /* apply the point transform */ + temp2 = temp; + } + /* Watch out for case that nonzero coef is zero after point transform */ + if (temp == 0) { + r++; + continue; + } + + /* Emit any pending EOBRUN */ + if (entropy->EOBRUN > 0) + emit_eobrun(entropy); + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + emit_bits_e(entropy, (unsigned int) temp2, nbits); + + r = 0; /* reset zero run length */ + } + + if (r > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + if (entropy->EOBRUN == 0x7FFF) + emit_eobrun(entropy); /* force it out to avoid overflow */ + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int temp; + int blkn; + int Al = cinfo->Al; + JBLOCKROW block; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart_e(entropy, entropy->next_restart_num); + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* We simply emit the Al'th bit of the DC coefficient value. */ + temp = (*block)[0]; + emit_bits_e(entropy, (unsigned int) (temp >> Al), 1); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * MCU encoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int temp; + register int r, k; + int EOB; + char *BR_buffer; + unsigned int BR; + int Se, Al; + const int * natural_order; + JBLOCKROW block; + int absvalues[DCTSIZE2]; + + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) + if (entropy->restarts_to_go == 0) + emit_restart_e(entropy, entropy->next_restart_num); + + Se = cinfo->Se; + Al = cinfo->Al; + natural_order = cinfo->natural_order; + + /* Encode the MCU data block */ + block = MCU_data[0]; + + /* It is convenient to make a pre-pass to determine the transformed + * coefficients' absolute values and the EOB position. + */ + EOB = 0; + for (k = cinfo->Ss; k <= Se; k++) { + temp = (*block)[natural_order[k]]; + /* We must apply the point transform by Al. For AC coefficients this + * is an integer division with rounding towards 0. To do this portably + * in C, we shift after obtaining the absolute value. + */ + if (temp < 0) + temp = -temp; /* temp is abs value of input */ + temp >>= Al; /* apply the point transform */ + absvalues[k] = temp; /* save abs value for main pass */ + if (temp == 1) + EOB = k; /* EOB = index of last newly-nonzero coef */ + } + + /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ + + r = 0; /* r = run length of zeros */ + BR = 0; /* BR = count of buffered bits added now */ + BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ + + for (k = cinfo->Ss; k <= Se; k++) { + if ((temp = absvalues[k]) == 0) { + r++; + continue; + } + + /* Emit any required ZRLs, but not if they can be folded into EOB */ + while (r > 15 && k <= EOB) { + /* emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + /* Emit ZRL */ + emit_ac_symbol(entropy, entropy->ac_tbl_no, 0xF0); + r -= 16; + /* Emit buffered correction bits that must be associated with ZRL */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + } + + /* If the coef was previously nonzero, it only needs a correction bit. + * NOTE: a straight translation of the spec's figure G.7 would suggest + * that we also need to test r > 15. But if r > 15, we can only get here + * if k > EOB, which implies that this coefficient is not 1. + */ + if (temp > 1) { + /* The correction bit is the next bit of the absolute value. */ + BR_buffer[BR++] = (char) (temp & 1); + continue; + } + + /* Emit any pending EOBRUN and the BE correction bits */ + emit_eobrun(entropy); + + /* Count/emit Huffman symbol for run length / number of bits */ + emit_ac_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); + + /* Emit output bit for newly-nonzero coef */ + temp = ((*block)[natural_order[k]] < 0) ? 0 : 1; + emit_bits_e(entropy, (unsigned int) temp, 1); + + /* Emit buffered correction bits that must be associated with this code */ + emit_buffered_bits(entropy, BR_buffer, BR); + BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ + BR = 0; + r = 0; /* reset zero run length */ + } + + if (r > 0 || BR > 0) { /* If there are trailing zeroes, */ + entropy->EOBRUN++; /* count an EOB */ + entropy->BE += BR; /* concat my correction bits to older ones */ + /* We force out the EOB if we risk either: + * 1. overflow of the EOB counter; + * 2. overflow of the correction bit buffer during the next MCU. + */ + if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1)) + emit_eobrun(entropy); + } + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* Encode a single block's worth of coefficients */ + +LOCAL(boolean) +encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, + c_derived_tbl *dctbl, c_derived_tbl *actbl) +{ + register int temp, temp2; + register int nbits; + register int k, r, i; + int Se = state->cinfo->lim_Se; + const int * natural_order = state->cinfo->natural_order; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = temp2 = block[0] - last_dc_val; + + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* For a negative input, want temp2 = bitwise complement of abs(input) */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit the Huffman-coded symbol for the number of bits */ + if (! emit_bits_s(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (nbits) /* emit_bits rejects calls with size 0 */ + if (! emit_bits_s(state, (unsigned int) temp2, nbits)) + return FALSE; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k <= Se; k++) { + if ((temp = block[natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + if (! emit_bits_s(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) + return FALSE; + r -= 16; + } + + temp2 = temp; + if (temp < 0) { + temp = -temp; /* temp is abs value of input */ + /* This code assumes we are on a two's complement machine */ + temp2--; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); + + /* Emit Huffman symbol for run length / number of bits */ + i = (r << 4) + nbits; + if (! emit_bits_s(state, actbl->ehufco[i], actbl->ehufsi[i])) + return FALSE; + + /* Emit that number of bits of the value, if positive, */ + /* or the complement of its magnitude, if negative. */ + if (! emit_bits_s(state, (unsigned int) temp2, nbits)) + return FALSE; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + if (! emit_bits_s(state, actbl->ehufco[0], actbl->ehufsi[0])) + return FALSE; + + return TRUE; +} + + +/* + * Encode and output one MCU's worth of Huffman-compressed coefficients. + */ + +METHODDEF(boolean) +encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + working_state state; + int blkn, ci; + jpeg_component_info * compptr; + + /* Load up working state */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Emit restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! emit_restart_s(&state, entropy->next_restart_num)) + return FALSE; + } + + /* Encode the MCU data blocks */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + if (! encode_one_block(&state, + MCU_data[blkn][0], state.cur.last_dc_val[ci], + entropy->dc_derived_tbls[compptr->dc_tbl_no], + entropy->ac_derived_tbls[compptr->ac_tbl_no])) + return FALSE; + /* Update last_dc_val */ + state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + /* Completed MCU, so update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + + /* Update restart-interval state too */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num++; + entropy->next_restart_num &= 7; + } + entropy->restarts_to_go--; + } + + return TRUE; +} + + +/* + * Finish up at the end of a Huffman-compressed scan. + */ + +METHODDEF(void) +finish_pass_huff (j_compress_ptr cinfo) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + working_state state; + + if (cinfo->progressive_mode) { + entropy->next_output_byte = cinfo->dest->next_output_byte; + entropy->free_in_buffer = cinfo->dest->free_in_buffer; + + /* Flush out any buffered data */ + emit_eobrun(entropy); + flush_bits_e(entropy); + + cinfo->dest->next_output_byte = entropy->next_output_byte; + cinfo->dest->free_in_buffer = entropy->free_in_buffer; + } else { + /* Load up working state ... flush_bits needs it */ + state.next_output_byte = cinfo->dest->next_output_byte; + state.free_in_buffer = cinfo->dest->free_in_buffer; + ASSIGN_STATE(state.cur, entropy->saved); + state.cinfo = cinfo; + + /* Flush out the last data */ + if (! flush_bits_s(&state)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Update state */ + cinfo->dest->next_output_byte = state.next_output_byte; + cinfo->dest->free_in_buffer = state.free_in_buffer; + ASSIGN_STATE(entropy->saved, state.cur); + } +} + + +/* + * Huffman coding optimization. + * + * We first scan the supplied data and count the number of uses of each symbol + * that is to be Huffman-coded. (This process MUST agree with the code above.) + * Then we build a Huffman coding tree for the observed counts. + * Symbols which are not needed at all for the particular image are not + * assigned any code, which saves space in the DHT marker as well as in + * the compressed data. + */ + + +/* Process a single block's worth of coefficients */ + +LOCAL(void) +htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, + long dc_counts[], long ac_counts[]) +{ + register int temp; + register int nbits; + register int k, r; + int Se = cinfo->lim_Se; + const int * natural_order = cinfo->natural_order; + + /* Encode the DC coefficient difference per section F.1.2.1 */ + + temp = block[0] - last_dc_val; + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 0; + while (temp) { + nbits++; + temp >>= 1; + } + /* Check for out-of-range coefficient values. + * Since we're encoding a difference, the range limit is twice as much. + */ + if (nbits > MAX_COEF_BITS+1) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count the Huffman symbol for the number of bits */ + dc_counts[nbits]++; + + /* Encode the AC coefficients per section F.1.2.2 */ + + r = 0; /* r = run length of zeros */ + + for (k = 1; k <= Se; k++) { + if ((temp = block[natural_order[k]]) == 0) { + r++; + } else { + /* if run length > 15, must emit special run-length-16 codes (0xF0) */ + while (r > 15) { + ac_counts[0xF0]++; + r -= 16; + } + + /* Find the number of bits needed for the magnitude of the coefficient */ + if (temp < 0) + temp = -temp; + + /* Find the number of bits needed for the magnitude of the coefficient */ + nbits = 1; /* there must be at least one 1 bit */ + while ((temp >>= 1)) + nbits++; + /* Check for out-of-range coefficient values */ + if (nbits > MAX_COEF_BITS) + ERREXIT(cinfo, JERR_BAD_DCT_COEF); + + /* Count Huffman symbol for run length / number of bits */ + ac_counts[(r << 4) + nbits]++; + + r = 0; + } + } + + /* If the last coef(s) were zero, emit an end-of-block code */ + if (r > 0) + ac_counts[0]++; +} + + +/* + * Trial-encode one MCU's worth of Huffman-compressed coefficients. + * No data is actually output, so no suspension return is possible. + */ + +METHODDEF(boolean) +encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int blkn, ci; + jpeg_component_info * compptr; + + /* Take care of restart intervals if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) { + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Update restart state */ + entropy->restarts_to_go = cinfo->restart_interval; + } + entropy->restarts_to_go--; + } + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], + entropy->dc_count_ptrs[compptr->dc_tbl_no], + entropy->ac_count_ptrs[compptr->ac_tbl_no]); + entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; + } + + return TRUE; +} + + +/* + * Generate the best Huffman code table for the given counts, fill htbl. + * + * The JPEG standard requires that no symbol be assigned a codeword of all + * one bits (so that padding bits added at the end of a compressed segment + * can't look like a valid code). Because of the canonical ordering of + * codewords, this just means that there must be an unused slot in the + * longest codeword length category. Section K.2 of the JPEG spec suggests + * reserving such a slot by pretending that symbol 256 is a valid symbol + * with count 1. In theory that's not optimal; giving it count zero but + * including it in the symbol set anyway should give a better Huffman code. + * But the theoretically better code actually seems to come out worse in + * practice, because it produces more all-ones bytes (which incur stuffed + * zero bytes in the final file). In any case the difference is tiny. + * + * The JPEG standard requires Huffman codes to be no more than 16 bits long. + * If some symbols have a very small but nonzero probability, the Huffman tree + * must be adjusted to meet the code length restriction. We currently use + * the adjustment method suggested in JPEG section K.2. This method is *not* + * optimal; it may not choose the best possible limited-length code. But + * typically only very-low-frequency symbols will be given less-than-optimal + * lengths, so the code is almost optimal. Experimental comparisons against + * an optimal limited-length-code algorithm indicate that the difference is + * microscopic --- usually less than a hundredth of a percent of total size. + * So the extra complexity of an optimal algorithm doesn't seem worthwhile. + */ + +LOCAL(void) +jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) +{ +#define MAX_CLEN 32 /* assumed maximum initial code length */ + UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ + int codesize[257]; /* codesize[k] = code length of symbol k */ + int others[257]; /* next symbol in current branch of tree */ + int c1, c2; + int p, i, j; + long v; + + /* This algorithm is explained in section K.2 of the JPEG standard */ + + MEMZERO(bits, SIZEOF(bits)); + MEMZERO(codesize, SIZEOF(codesize)); + for (i = 0; i < 257; i++) + others[i] = -1; /* init links to empty */ + + freq[256] = 1; /* make sure 256 has a nonzero count */ + /* Including the pseudo-symbol 256 in the Huffman procedure guarantees + * that no real symbol is given code-value of all ones, because 256 + * will be placed last in the largest codeword category. + */ + + /* Huffman's basic algorithm to assign optimal code lengths to symbols */ + + for (;;) { + /* Find the smallest nonzero frequency, set c1 = its symbol */ + /* In case of ties, take the larger symbol number */ + c1 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v) { + v = freq[i]; + c1 = i; + } + } + + /* Find the next smallest nonzero frequency, set c2 = its symbol */ + /* In case of ties, take the larger symbol number */ + c2 = -1; + v = 1000000000L; + for (i = 0; i <= 256; i++) { + if (freq[i] && freq[i] <= v && i != c1) { + v = freq[i]; + c2 = i; + } + } + + /* Done if we've merged everything into one frequency */ + if (c2 < 0) + break; + + /* Else merge the two counts/trees */ + freq[c1] += freq[c2]; + freq[c2] = 0; + + /* Increment the codesize of everything in c1's tree branch */ + codesize[c1]++; + while (others[c1] >= 0) { + c1 = others[c1]; + codesize[c1]++; + } + + others[c1] = c2; /* chain c2 onto c1's tree branch */ + + /* Increment the codesize of everything in c2's tree branch */ + codesize[c2]++; + while (others[c2] >= 0) { + c2 = others[c2]; + codesize[c2]++; + } + } + + /* Now count the number of symbols of each code length */ + for (i = 0; i <= 256; i++) { + if (codesize[i]) { + /* The JPEG standard seems to think that this can't happen, */ + /* but I'm paranoid... */ + if (codesize[i] > MAX_CLEN) + ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); + + bits[codesize[i]]++; + } + } + + /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure + * Huffman procedure assigned any such lengths, we must adjust the coding. + * Here is what the JPEG spec says about how this next bit works: + * Since symbols are paired for the longest Huffman code, the symbols are + * removed from this length category two at a time. The prefix for the pair + * (which is one bit shorter) is allocated to one of the pair; then, + * skipping the BITS entry for that prefix length, a code word from the next + * shortest nonzero BITS entry is converted into a prefix for two code words + * one bit longer. + */ + + for (i = MAX_CLEN; i > 16; i--) { + while (bits[i] > 0) { + j = i - 2; /* find length of new prefix to be used */ + while (bits[j] == 0) + j--; + + bits[i] -= 2; /* remove two symbols */ + bits[i-1]++; /* one goes in this length */ + bits[j+1] += 2; /* two new symbols in this length */ + bits[j]--; /* symbol of this length is now a prefix */ + } + } + + /* Remove the count for the pseudo-symbol 256 from the largest codelength */ + while (bits[i] == 0) /* find largest codelength still in use */ + i--; + bits[i]--; + + /* Return final symbol counts (only for lengths 0..16) */ + MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); + + /* Return a list of the symbols sorted by code length */ + /* It's not real clear to me why we don't need to consider the codelength + * changes made above, but the JPEG spec seems to think this works. + */ + p = 0; + for (i = 1; i <= MAX_CLEN; i++) { + for (j = 0; j <= 255; j++) { + if (codesize[j] == i) { + htbl->huffval[p] = (UINT8) j; + p++; + } + } + } + + /* Set sent_table FALSE so updated table will be written to JPEG file. */ + htbl->sent_table = FALSE; +} + + +/* + * Finish up a statistics-gathering pass and create the new Huffman tables. + */ + +METHODDEF(void) +finish_pass_gather (j_compress_ptr cinfo) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int ci, tbl; + jpeg_component_info * compptr; + JHUFF_TBL **htblptr; + boolean did_dc[NUM_HUFF_TBLS]; + boolean did_ac[NUM_HUFF_TBLS]; + + /* It's important not to apply jpeg_gen_optimal_table more than once + * per table, because it clobbers the input frequency counts! + */ + if (cinfo->progressive_mode) + /* Flush out buffered data (all we care about is counting the EOB symbol) */ + emit_eobrun(entropy); + + MEMZERO(did_dc, SIZEOF(did_dc)); + MEMZERO(did_ac, SIZEOF(did_ac)); + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) { + tbl = compptr->dc_tbl_no; + if (! did_dc[tbl]) { + htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[tbl]); + did_dc[tbl] = TRUE; + } + } + /* AC needs no table when not present */ + if (cinfo->Se) { + tbl = compptr->ac_tbl_no; + if (! did_ac[tbl]) { + htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[tbl]); + did_ac[tbl] = TRUE; + } + } + } +} + + +/* + * Initialize for a Huffman-compressed scan. + * If gather_statistics is TRUE, we do not output anything during the scan, + * just count the Huffman symbols used and generate Huffman code tables. + */ + +METHODDEF(void) +start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int ci, tbl; + jpeg_component_info * compptr; + + if (gather_statistics) + entropy->pub.finish_pass = finish_pass_gather; + else + entropy->pub.finish_pass = finish_pass_huff; + + if (cinfo->progressive_mode) { + entropy->cinfo = cinfo; + entropy->gather_statistics = gather_statistics; + + /* We assume jcmaster.c already validated the scan parameters. */ + + /* Select execution routine */ + if (cinfo->Ah == 0) { + if (cinfo->Ss == 0) + entropy->pub.encode_mcu = encode_mcu_DC_first; + else + entropy->pub.encode_mcu = encode_mcu_AC_first; + } else { + if (cinfo->Ss == 0) + entropy->pub.encode_mcu = encode_mcu_DC_refine; + else { + entropy->pub.encode_mcu = encode_mcu_AC_refine; + /* AC refinement needs a correction bit buffer */ + if (entropy->bit_buffer == NULL) + entropy->bit_buffer = (char *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + MAX_CORR_BITS * SIZEOF(char)); + } + } + + /* Initialize AC stuff */ + entropy->ac_tbl_no = cinfo->cur_comp_info[0]->ac_tbl_no; + entropy->EOBRUN = 0; + entropy->BE = 0; + } else { + if (gather_statistics) + entropy->pub.encode_mcu = encode_mcu_gather; + else + entropy->pub.encode_mcu = encode_mcu_huff; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) { + tbl = compptr->dc_tbl_no; + if (gather_statistics) { + /* Check for invalid table index */ + /* (make_c_derived_tbl does this in the other path) */ + if (tbl < 0 || tbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); + /* Allocate and zero the statistics tables */ + /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ + if (entropy->dc_count_ptrs[tbl] == NULL) + entropy->dc_count_ptrs[tbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->dc_count_ptrs[tbl], 257 * SIZEOF(long)); + } else { + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + jpeg_make_c_derived_tbl(cinfo, TRUE, tbl, + & entropy->dc_derived_tbls[tbl]); + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + /* AC needs no table when not present */ + if (cinfo->Se) { + tbl = compptr->ac_tbl_no; + if (gather_statistics) { + if (tbl < 0 || tbl >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); + if (entropy->ac_count_ptrs[tbl] == NULL) + entropy->ac_count_ptrs[tbl] = (long *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 257 * SIZEOF(long)); + MEMZERO(entropy->ac_count_ptrs[tbl], 257 * SIZEOF(long)); + } else { + jpeg_make_c_derived_tbl(cinfo, FALSE, tbl, + & entropy->ac_derived_tbls[tbl]); + } + } + } + + /* Initialize bit buffer to empty */ + entropy->saved.put_buffer = 0; + entropy->saved.put_bits = 0; + + /* Initialize restart stuff */ + entropy->restarts_to_go = cinfo->restart_interval; + entropy->next_restart_num = 0; +} + + +/* + * Module initialization routine for Huffman entropy encoding. + */ + +GLOBAL(void) +jinit_huff_encoder (j_compress_ptr cinfo) +{ + huff_entropy_ptr entropy; + int i; + + entropy = (huff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(huff_entropy_encoder)); + cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; + entropy->pub.start_pass = start_pass_huff; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; + entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; + } + + if (cinfo->progressive_mode) + entropy->bit_buffer = NULL; /* needed only in AC refinement scan */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcinit.c b/thirdparty/LibJPEG/jpeg-9/jcinit.c new file mode 100644 index 0000000..0ba310f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcinit.c @@ -0,0 +1,65 @@ +/* + * jcinit.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains initialization logic for the JPEG compressor. + * This routine is in charge of selecting the modules to be executed and + * making an initialization call to each one. + * + * Logically, this code belongs in jcmaster.c. It's split out because + * linking this routine implies linking the entire compression library. + * For a transcoding-only application, we want to be able to use jcmaster.c + * without linking in the whole library. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Master selection of compression modules. + * This is done once at the start of processing an image. We determine + * which modules will be used and give them appropriate initialization calls. + */ + +GLOBAL(void) +jinit_compress_master (j_compress_ptr cinfo) +{ + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, FALSE /* full compression */); + + /* Preprocessing */ + if (! cinfo->raw_data_in) { + jinit_color_converter(cinfo); + jinit_downsampler(cinfo); + jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); + } + /* Forward DCT */ + jinit_forward_dct(cinfo); + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) + jinit_arith_encoder(cinfo); + else { + jinit_huff_encoder(cinfo); + } + + /* Need a full-image coefficient buffer in any multi-pass mode. */ + jinit_c_coef_controller(cinfo, + (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); + jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcmainct.c b/thirdparty/LibJPEG/jpeg-9/jcmainct.c new file mode 100644 index 0000000..39b9790 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcmainct.c @@ -0,0 +1,297 @@ +/* + * jcmainct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2003-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for compression. + * The main buffer lies between the pre-processor and the JPEG + * compressor proper; it holds downsampled data in the JPEG colorspace. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Note: currently, there is no operating mode in which a full-image buffer + * is needed at this step. If there were, that mode could not be used with + * "raw data" input, since this module is bypassed in that case. However, + * we've left the code here for possible use in special applications. + */ +#undef FULL_MAIN_BUFFER_SUPPORTED + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_main_controller pub; /* public fields */ + + JDIMENSION cur_iMCU_row; /* number of current iMCU row */ + JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ + boolean suspended; /* remember if we suspended output */ + J_BUF_MODE pass_mode; /* current operating mode */ + + /* If using just a strip buffer, this points to the entire set of buffers + * (we allocate one for each component). In the full-image case, this + * points to the currently accessible strips of the virtual arrays. + */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* If using full-image storage, this array holds pointers to virtual-array + * control blocks for each component. Unused if not full-image storage. + */ + jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; +#endif +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#ifdef FULL_MAIN_BUFFER_SUPPORTED +METHODDEF(void) process_data_buffer_main + JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + + /* Do nothing in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + mainp->cur_iMCU_row = 0; /* initialize counters */ + mainp->rowgroup_ctr = 0; + mainp->suspended = FALSE; + mainp->pass_mode = pass_mode; /* save mode for use by process_data */ + + switch (pass_mode) { + case JBUF_PASS_THRU: +#ifdef FULL_MAIN_BUFFER_SUPPORTED + if (mainp->whole_image[0] != NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + mainp->pub.process_data = process_data_simple_main; + break; +#ifdef FULL_MAIN_BUFFER_SUPPORTED + case JBUF_SAVE_SOURCE: + case JBUF_CRANK_DEST: + case JBUF_SAVE_AND_PASS: + if (mainp->whole_image[0] == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + mainp->pub.process_data = process_data_buffer_main; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This routine handles the simple pass-through mode, + * where we have only a strip buffer. + */ + +METHODDEF(void) +process_data_simple_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + + while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Read input data if we haven't filled the main buffer yet */ + if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size) + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mainp->buffer, &mainp->rowgroup_ctr, + (JDIMENSION) cinfo->min_DCT_v_scaled_size); + + /* If we don't have a full iMCU row buffered, return to application for + * more data. Note that preprocessor will always pad to fill the iMCU row + * at the bottom of the image. + */ + if (mainp->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size) + return; + + /* Send the completed row to the compressor */ + if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mainp->suspended) { + (*in_row_ctr)--; + mainp->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mainp->suspended) { + (*in_row_ctr)++; + mainp->suspended = FALSE; + } + mainp->rowgroup_ctr = 0; + mainp->cur_iMCU_row++; + } +} + + +#ifdef FULL_MAIN_BUFFER_SUPPORTED + +/* + * Process some data. + * This routine handles all of the modes that use a full-size buffer. + */ + +METHODDEF(void) +process_data_buffer_main (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + int ci; + jpeg_component_info *compptr; + boolean writing = (mainp->pass_mode != JBUF_CRANK_DEST); + + while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) { + /* Realign the virtual buffers if at the start of an iMCU row. */ + if (mainp->rowgroup_ctr == 0) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mainp->buffer[ci] = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, mainp->whole_image[ci], mainp->cur_iMCU_row * + ((JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size)), + (JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size), + writing); + } + /* In a read pass, pretend we just read some source data. */ + if (! writing) { + *in_row_ctr += (JDIMENSION) + (cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size); + mainp->rowgroup_ctr = (JDIMENSION) cinfo->min_DCT_v_scaled_size; + } + } + + /* If a write pass, read input data until the current iMCU row is full. */ + /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ + if (writing) { + (*cinfo->prep->pre_process_data) (cinfo, + input_buf, in_row_ctr, in_rows_avail, + mainp->buffer, &mainp->rowgroup_ctr, + (JDIMENSION) cinfo->min_DCT_v_scaled_size); + /* Return to application if we need more data to fill the iMCU row. */ + if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size) + return; + } + + /* Emit data, unless this is a sink-only pass. */ + if (mainp->pass_mode != JBUF_SAVE_SOURCE) { + if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) { + /* If compressor did not consume the whole row, then we must need to + * suspend processing and return to the application. In this situation + * we pretend we didn't yet consume the last input row; otherwise, if + * it happened to be the last row of the image, the application would + * think we were done. + */ + if (! mainp->suspended) { + (*in_row_ctr)--; + mainp->suspended = TRUE; + } + return; + } + /* We did finish the row. Undo our little suspension hack if a previous + * call suspended; then mark the main buffer empty. + */ + if (mainp->suspended) { + (*in_row_ctr)++; + mainp->suspended = FALSE; + } + } + + /* If get here, we are done with this iMCU row. Mark buffer empty. */ + mainp->rowgroup_ctr = 0; + mainp->cur_iMCU_row++; + } +} + +#endif /* FULL_MAIN_BUFFER_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mainp; + int ci; + jpeg_component_info *compptr; + + mainp = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = &mainp->pub; + mainp->pub.start_pass = start_pass_main; + + /* We don't need to create a buffer in raw-data mode. */ + if (cinfo->raw_data_in) + return; + + /* Create the buffer. It holds downsampled data, so each component + * may be of a different size. + */ + if (need_full_buffer) { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + /* Allocate a full-image virtual array for each component */ + /* Note we pad the bottom to a multiple of the iMCU height */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mainp->whole_image[ci] = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), + ((JDIMENSION) jround_up((long) compptr->height_in_blocks, + (long) compptr->v_samp_factor)) * + ((JDIMENSION) cinfo->min_DCT_v_scaled_size), + (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size)); + } +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif + } else { +#ifdef FULL_MAIN_BUFFER_SUPPORTED + mainp->whole_image[0] = NULL; /* flag for no virtual arrays */ +#endif + /* Allocate a strip buffer for each component */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + mainp->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), + (JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size)); + } + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcmarker.c b/thirdparty/LibJPEG/jpeg-9/jcmarker.c new file mode 100644 index 0000000..92aa65f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcmarker.c @@ -0,0 +1,719 @@ +/* + * jcmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2003-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write JPEG datastream markers. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG8 = 0xf8, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_writer pub; /* public fields */ + + unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ +} my_marker_writer; + +typedef my_marker_writer * my_marker_ptr; + + +/* + * Basic output routines. + * + * Note that we do not support suspension while writing a marker. + * Therefore, an application using suspension must ensure that there is + * enough buffer space for the initial markers (typ. 600-700 bytes) before + * calling jpeg_start_compress, and enough space to write the trailing EOI + * (a few bytes) before calling jpeg_finish_compress. Multipass compression + * modes are not supported at all with suspension, so those two are the only + * points where markers will be written. + */ + +LOCAL(void) +emit_byte (j_compress_ptr cinfo, int val) +/* Emit a byte */ +{ + struct jpeg_destination_mgr * dest = cinfo->dest; + + *(dest->next_output_byte)++ = (JOCTET) val; + if (--dest->free_in_buffer == 0) { + if (! (*dest->empty_output_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + } +} + + +LOCAL(void) +emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) +/* Emit a marker code */ +{ + emit_byte(cinfo, 0xFF); + emit_byte(cinfo, (int) mark); +} + + +LOCAL(void) +emit_2bytes (j_compress_ptr cinfo, int value) +/* Emit a 2-byte integer; these are always MSB first in JPEG files */ +{ + emit_byte(cinfo, (value >> 8) & 0xFF); + emit_byte(cinfo, value & 0xFF); +} + + +/* + * Routines to write specific marker types. + */ + +LOCAL(int) +emit_dqt (j_compress_ptr cinfo, int index) +/* Emit a DQT marker */ +/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ +{ + JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index]; + int prec; + int i; + + if (qtbl == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index); + + prec = 0; + for (i = 0; i <= cinfo->lim_Se; i++) { + if (qtbl->quantval[cinfo->natural_order[i]] > 255) + prec = 1; + } + + if (! qtbl->sent_table) { + emit_marker(cinfo, M_DQT); + + emit_2bytes(cinfo, + prec ? cinfo->lim_Se * 2 + 2 + 1 + 2 : cinfo->lim_Se + 1 + 1 + 2); + + emit_byte(cinfo, index + (prec<<4)); + + for (i = 0; i <= cinfo->lim_Se; i++) { + /* The table entries must be emitted in zigzag order. */ + unsigned int qval = qtbl->quantval[cinfo->natural_order[i]]; + if (prec) + emit_byte(cinfo, (int) (qval >> 8)); + emit_byte(cinfo, (int) (qval & 0xFF)); + } + + qtbl->sent_table = TRUE; + } + + return prec; +} + + +LOCAL(void) +emit_dht (j_compress_ptr cinfo, int index, boolean is_ac) +/* Emit a DHT marker */ +{ + JHUFF_TBL * htbl; + int length, i; + + if (is_ac) { + htbl = cinfo->ac_huff_tbl_ptrs[index]; + index += 0x10; /* output index has AC bit set */ + } else { + htbl = cinfo->dc_huff_tbl_ptrs[index]; + } + + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index); + + if (! htbl->sent_table) { + emit_marker(cinfo, M_DHT); + + length = 0; + for (i = 1; i <= 16; i++) + length += htbl->bits[i]; + + emit_2bytes(cinfo, length + 2 + 1 + 16); + emit_byte(cinfo, index); + + for (i = 1; i <= 16; i++) + emit_byte(cinfo, htbl->bits[i]); + + for (i = 0; i < length; i++) + emit_byte(cinfo, htbl->huffval[i]); + + htbl->sent_table = TRUE; + } +} + + +LOCAL(void) +emit_dac (j_compress_ptr cinfo) +/* Emit a DAC marker */ +/* Since the useful info is so small, we want to emit all the tables in */ +/* one DAC marker. Therefore this routine does its own scan of the table. */ +{ +#ifdef C_ARITH_CODING_SUPPORTED + char dc_in_use[NUM_ARITH_TBLS]; + char ac_in_use[NUM_ARITH_TBLS]; + int length, i; + jpeg_component_info *compptr; + + for (i = 0; i < NUM_ARITH_TBLS; i++) + dc_in_use[i] = ac_in_use[i] = 0; + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) + dc_in_use[compptr->dc_tbl_no] = 1; + /* AC needs no table when not present */ + if (cinfo->Se) + ac_in_use[compptr->ac_tbl_no] = 1; + } + + length = 0; + for (i = 0; i < NUM_ARITH_TBLS; i++) + length += dc_in_use[i] + ac_in_use[i]; + + if (length) { + emit_marker(cinfo, M_DAC); + + emit_2bytes(cinfo, length*2 + 2); + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + if (dc_in_use[i]) { + emit_byte(cinfo, i); + emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); + } + if (ac_in_use[i]) { + emit_byte(cinfo, i + 0x10); + emit_byte(cinfo, cinfo->arith_ac_K[i]); + } + } + } +#endif /* C_ARITH_CODING_SUPPORTED */ +} + + +LOCAL(void) +emit_dri (j_compress_ptr cinfo) +/* Emit a DRI marker */ +{ + emit_marker(cinfo, M_DRI); + + emit_2bytes(cinfo, 4); /* fixed length */ + + emit_2bytes(cinfo, (int) cinfo->restart_interval); +} + + +LOCAL(void) +emit_lse_ict (j_compress_ptr cinfo) +/* Emit an LSE inverse color transform specification marker */ +{ + /* Support only 1 transform */ + if (cinfo->color_transform != JCT_SUBTRACT_GREEN || + cinfo->num_components < 3) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + + emit_marker(cinfo, M_JPG8); + + emit_2bytes(cinfo, 24); /* fixed length */ + + emit_byte(cinfo, 0x0D); /* ID inverse transform specification */ + emit_2bytes(cinfo, MAXJSAMPLE); /* MAXTRANS */ + emit_byte(cinfo, 3); /* Nt=3 */ + emit_byte(cinfo, cinfo->comp_info[1].component_id); + emit_byte(cinfo, cinfo->comp_info[0].component_id); + emit_byte(cinfo, cinfo->comp_info[2].component_id); + emit_byte(cinfo, 0x80); /* F1: CENTER1=1, NORM1=0 */ + emit_2bytes(cinfo, 0); /* A(1,1)=0 */ + emit_2bytes(cinfo, 0); /* A(1,2)=0 */ + emit_byte(cinfo, 0); /* F2: CENTER2=0, NORM2=0 */ + emit_2bytes(cinfo, 1); /* A(2,1)=1 */ + emit_2bytes(cinfo, 0); /* A(2,2)=0 */ + emit_byte(cinfo, 0); /* F3: CENTER3=0, NORM3=0 */ + emit_2bytes(cinfo, 1); /* A(3,1)=1 */ + emit_2bytes(cinfo, 0); /* A(3,2)=0 */ +} + + +LOCAL(void) +emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) +/* Emit a SOF marker */ +{ + int ci; + jpeg_component_info *compptr; + + emit_marker(cinfo, code); + + emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ + + /* Make sure image isn't bigger than SOF field can handle */ + if ((long) cinfo->jpeg_height > 65535L || + (long) cinfo->jpeg_width > 65535L) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); + + emit_byte(cinfo, cinfo->data_precision); + emit_2bytes(cinfo, (int) cinfo->jpeg_height); + emit_2bytes(cinfo, (int) cinfo->jpeg_width); + + emit_byte(cinfo, cinfo->num_components); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + emit_byte(cinfo, compptr->component_id); + emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); + emit_byte(cinfo, compptr->quant_tbl_no); + } +} + + +LOCAL(void) +emit_sos (j_compress_ptr cinfo) +/* Emit a SOS marker */ +{ + int i, td, ta; + jpeg_component_info *compptr; + + emit_marker(cinfo, M_SOS); + + emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ + + emit_byte(cinfo, cinfo->comps_in_scan); + + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + emit_byte(cinfo, compptr->component_id); + + /* We emit 0 for unused field(s); this is recommended by the P&M text + * but does not seem to be specified in the standard. + */ + + /* DC needs no table for refinement scan */ + td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0; + /* AC needs no table when not present */ + ta = cinfo->Se ? compptr->ac_tbl_no : 0; + + emit_byte(cinfo, (td << 4) + ta); + } + + emit_byte(cinfo, cinfo->Ss); + emit_byte(cinfo, cinfo->Se); + emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); +} + + +LOCAL(void) +emit_pseudo_sos (j_compress_ptr cinfo) +/* Emit a pseudo SOS marker */ +{ + emit_marker(cinfo, M_SOS); + + emit_2bytes(cinfo, 2 + 1 + 3); /* length */ + + emit_byte(cinfo, 0); /* Ns */ + + emit_byte(cinfo, 0); /* Ss */ + emit_byte(cinfo, cinfo->block_size * cinfo->block_size - 1); /* Se */ + emit_byte(cinfo, 0); /* Ah/Al */ +} + + +LOCAL(void) +emit_jfif_app0 (j_compress_ptr cinfo) +/* Emit a JFIF-compliant APP0 marker */ +{ + /* + * Length of APP0 block (2 bytes) + * Block ID (4 bytes - ASCII "JFIF") + * Zero byte (1 byte to terminate the ID string) + * Version Major, Minor (2 bytes - major first) + * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) + * Xdpu (2 bytes - dots per unit horizontal) + * Ydpu (2 bytes - dots per unit vertical) + * Thumbnail X size (1 byte) + * Thumbnail Y size (1 byte) + */ + + emit_marker(cinfo, M_APP0); + + emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ + + emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0x49); + emit_byte(cinfo, 0x46); + emit_byte(cinfo, 0); + emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ + emit_byte(cinfo, cinfo->JFIF_minor_version); + emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ + emit_2bytes(cinfo, (int) cinfo->X_density); + emit_2bytes(cinfo, (int) cinfo->Y_density); + emit_byte(cinfo, 0); /* No thumbnail image */ + emit_byte(cinfo, 0); +} + + +LOCAL(void) +emit_adobe_app14 (j_compress_ptr cinfo) +/* Emit an Adobe APP14 marker */ +{ + /* + * Length of APP14 block (2 bytes) + * Block ID (5 bytes - ASCII "Adobe") + * Version Number (2 bytes - currently 100) + * Flags0 (2 bytes - currently 0) + * Flags1 (2 bytes - currently 0) + * Color transform (1 byte) + * + * Although Adobe TN 5116 mentions Version = 101, all the Adobe files + * now in circulation seem to use Version = 100, so that's what we write. + * + * We write the color transform byte as 1 if the JPEG color space is + * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with + * whether the encoder performed a transformation, which is pretty useless. + */ + + emit_marker(cinfo, M_APP14); + + emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ + + emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ + emit_byte(cinfo, 0x64); + emit_byte(cinfo, 0x6F); + emit_byte(cinfo, 0x62); + emit_byte(cinfo, 0x65); + emit_2bytes(cinfo, 100); /* Version */ + emit_2bytes(cinfo, 0); /* Flags0 */ + emit_2bytes(cinfo, 0); /* Flags1 */ + switch (cinfo->jpeg_color_space) { + case JCS_YCbCr: + emit_byte(cinfo, 1); /* Color transform = 1 */ + break; + case JCS_YCCK: + emit_byte(cinfo, 2); /* Color transform = 2 */ + break; + default: + emit_byte(cinfo, 0); /* Color transform = 0 */ + break; + } +} + + +/* + * These routines allow writing an arbitrary marker with parameters. + * The only intended use is to emit COM or APPn markers after calling + * write_file_header and before calling write_frame_header. + * Other uses are not guaranteed to produce desirable results. + * Counting the parameter bytes properly is the caller's responsibility. + */ + +METHODDEF(void) +write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) +/* Emit an arbitrary marker header */ +{ + if (datalen > (unsigned int) 65533) /* safety check */ + ERREXIT(cinfo, JERR_BAD_LENGTH); + + emit_marker(cinfo, (JPEG_MARKER) marker); + + emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ +} + +METHODDEF(void) +write_marker_byte (j_compress_ptr cinfo, int val) +/* Emit one byte of marker parameters following write_marker_header */ +{ + emit_byte(cinfo, val); +} + + +/* + * Write datastream header. + * This consists of an SOI and optional APPn markers. + * We recommend use of the JFIF marker, but not the Adobe marker, + * when using YCbCr or grayscale data. The JFIF marker should NOT + * be used for any other JPEG colorspace. The Adobe marker is helpful + * to distinguish RGB, CMYK, and YCCK colorspaces. + * Note that an application can write additional header markers after + * jpeg_start_compress returns. + */ + +METHODDEF(void) +write_file_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + emit_marker(cinfo, M_SOI); /* first the SOI */ + + /* SOI is defined to reset restart interval to 0 */ + marker->last_restart_interval = 0; + + if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ + emit_jfif_app0(cinfo); + if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ + emit_adobe_app14(cinfo); +} + + +/* + * Write frame header. + * This consists of DQT and SOFn markers, + * a conditional LSE marker and a conditional pseudo SOS marker. + * Note that we do not emit the SOF until we have emitted the DQT(s). + * This avoids compatibility problems with incorrect implementations that + * try to error-check the quant table numbers as soon as they see the SOF. + */ + +METHODDEF(void) +write_frame_header (j_compress_ptr cinfo) +{ + int ci, prec; + boolean is_baseline; + jpeg_component_info *compptr; + + /* Emit DQT for each quantization table. + * Note that emit_dqt() suppresses any duplicate tables. + */ + prec = 0; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prec += emit_dqt(cinfo, compptr->quant_tbl_no); + } + /* now prec is nonzero iff there are any 16-bit quant tables. */ + + /* Check for a non-baseline specification. + * Note we assume that Huffman table numbers won't be changed later. + */ + if (cinfo->arith_code || cinfo->progressive_mode || + cinfo->data_precision != 8 || cinfo->block_size != DCTSIZE) { + is_baseline = FALSE; + } else { + is_baseline = TRUE; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) + is_baseline = FALSE; + } + if (prec && is_baseline) { + is_baseline = FALSE; + /* If it's baseline except for quantizer size, warn the user */ + TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); + } + } + + /* Emit the proper SOF marker */ + if (cinfo->arith_code) { + if (cinfo->progressive_mode) + emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */ + else + emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */ + } else { + if (cinfo->progressive_mode) + emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ + else if (is_baseline) + emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ + else + emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ + } + + /* Check to emit LSE inverse color transform specification marker */ + if (cinfo->color_transform) + emit_lse_ict(cinfo); + + /* Check to emit pseudo SOS marker */ + if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE) + emit_pseudo_sos(cinfo); +} + + +/* + * Write scan header. + * This consists of DHT or DAC markers, optional DRI, and SOS. + * Compressed data will be written following the SOS. + */ + +METHODDEF(void) +write_scan_header (j_compress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + int i; + jpeg_component_info *compptr; + + if (cinfo->arith_code) { + /* Emit arith conditioning info. We may have some duplication + * if the file has multiple scans, but it's so small it's hardly + * worth worrying about. + */ + emit_dac(cinfo); + } else { + /* Emit Huffman tables. + * Note that emit_dht() suppresses any duplicate tables. + */ + for (i = 0; i < cinfo->comps_in_scan; i++) { + compptr = cinfo->cur_comp_info[i]; + /* DC needs no table for refinement scan */ + if (cinfo->Ss == 0 && cinfo->Ah == 0) + emit_dht(cinfo, compptr->dc_tbl_no, FALSE); + /* AC needs no table when not present */ + if (cinfo->Se) + emit_dht(cinfo, compptr->ac_tbl_no, TRUE); + } + } + + /* Emit DRI if required --- note that DRI value could change for each scan. + * We avoid wasting space with unnecessary DRIs, however. + */ + if (cinfo->restart_interval != marker->last_restart_interval) { + emit_dri(cinfo); + marker->last_restart_interval = cinfo->restart_interval; + } + + emit_sos(cinfo); +} + + +/* + * Write datastream trailer. + */ + +METHODDEF(void) +write_file_trailer (j_compress_ptr cinfo) +{ + emit_marker(cinfo, M_EOI); +} + + +/* + * Write an abbreviated table-specification datastream. + * This consists of SOI, DQT and DHT tables, and EOI. + * Any table that is defined and not marked sent_table = TRUE will be + * emitted. Note that all tables will be marked sent_table = TRUE at exit. + */ + +METHODDEF(void) +write_tables_only (j_compress_ptr cinfo) +{ + int i; + + emit_marker(cinfo, M_SOI); + + for (i = 0; i < NUM_QUANT_TBLS; i++) { + if (cinfo->quant_tbl_ptrs[i] != NULL) + (void) emit_dqt(cinfo, i); + } + + if (! cinfo->arith_code) { + for (i = 0; i < NUM_HUFF_TBLS; i++) { + if (cinfo->dc_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, FALSE); + if (cinfo->ac_huff_tbl_ptrs[i] != NULL) + emit_dht(cinfo, i, TRUE); + } + } + + emit_marker(cinfo, M_EOI); +} + + +/* + * Initialize the marker writer module. + */ + +GLOBAL(void) +jinit_marker_writer (j_compress_ptr cinfo) +{ + my_marker_ptr marker; + + /* Create the subobject */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_marker_writer)); + cinfo->marker = &marker->pub; + /* Initialize method pointers */ + marker->pub.write_file_header = write_file_header; + marker->pub.write_frame_header = write_frame_header; + marker->pub.write_scan_header = write_scan_header; + marker->pub.write_file_trailer = write_file_trailer; + marker->pub.write_tables_only = write_tables_only; + marker->pub.write_marker_header = write_marker_header; + marker->pub.write_marker_byte = write_marker_byte; + /* Initialize private state */ + marker->last_restart_interval = 0; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcmaster.c b/thirdparty/LibJPEG/jpeg-9/jcmaster.c new file mode 100644 index 0000000..caf80a5 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcmaster.c @@ -0,0 +1,858 @@ +/* + * jcmaster.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2003-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG compressor. + * These routines are concerned with parameter validation, initial setup, + * and inter-pass control (determining the number of passes and the work + * to be done in each pass). + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private state */ + +typedef enum { + main_pass, /* input data, also do first output step */ + huff_opt_pass, /* Huffman code optimization pass */ + output_pass /* data output pass */ +} c_pass_type; + +typedef struct { + struct jpeg_comp_master pub; /* public fields */ + + c_pass_type pass_type; /* the type of the current pass */ + + int pass_number; /* # of passes completed */ + int total_passes; /* total # of passes needed */ + + int scan_number; /* current index in scan_info[] */ +} my_comp_master; + +typedef my_comp_master * my_master_ptr; + + +/* + * Support routines that do various essential calculations. + */ + +/* + * Compute JPEG image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + */ + +GLOBAL(void) +jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo) +/* Do computations that are needed before master selection phase */ +{ +#ifdef DCT_SCALING_SUPPORTED + + /* Sanity check on input image dimensions to prevent overflow in + * following calculation. + * We do check jpeg_width and jpeg_height in initial_setup below, + * but image_width and image_height can come from arbitrary data, + * and we need some space for multiplication by block_size. + */ + if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24)) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* Compute actual JPEG image dimensions and DCT scaling choices. */ + if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/1 scaling */ + cinfo->jpeg_width = cinfo->image_width * cinfo->block_size; + cinfo->jpeg_height = cinfo->image_height * cinfo->block_size; + cinfo->min_DCT_h_scaled_size = 1; + cinfo->min_DCT_v_scaled_size = 1; + } else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/2 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L); + cinfo->min_DCT_h_scaled_size = 2; + cinfo->min_DCT_v_scaled_size = 2; + } else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/3 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L); + cinfo->min_DCT_h_scaled_size = 3; + cinfo->min_DCT_v_scaled_size = 3; + } else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/4 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L); + cinfo->min_DCT_h_scaled_size = 4; + cinfo->min_DCT_v_scaled_size = 4; + } else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/5 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L); + cinfo->min_DCT_h_scaled_size = 5; + cinfo->min_DCT_v_scaled_size = 5; + } else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/6 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L); + cinfo->min_DCT_h_scaled_size = 6; + cinfo->min_DCT_v_scaled_size = 6; + } else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/7 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L); + cinfo->min_DCT_h_scaled_size = 7; + cinfo->min_DCT_v_scaled_size = 7; + } else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/8 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L); + cinfo->min_DCT_h_scaled_size = 8; + cinfo->min_DCT_v_scaled_size = 8; + } else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/9 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L); + cinfo->min_DCT_h_scaled_size = 9; + cinfo->min_DCT_v_scaled_size = 9; + } else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/10 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L); + cinfo->min_DCT_h_scaled_size = 10; + cinfo->min_DCT_v_scaled_size = 10; + } else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/11 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L); + cinfo->min_DCT_h_scaled_size = 11; + cinfo->min_DCT_v_scaled_size = 11; + } else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/12 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L); + cinfo->min_DCT_h_scaled_size = 12; + cinfo->min_DCT_v_scaled_size = 12; + } else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/13 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L); + cinfo->min_DCT_h_scaled_size = 13; + cinfo->min_DCT_v_scaled_size = 13; + } else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/14 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L); + cinfo->min_DCT_h_scaled_size = 14; + cinfo->min_DCT_v_scaled_size = 14; + } else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) { + /* Provide block_size/15 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L); + cinfo->min_DCT_h_scaled_size = 15; + cinfo->min_DCT_v_scaled_size = 15; + } else { + /* Provide block_size/16 scaling */ + cinfo->jpeg_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L); + cinfo->jpeg_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L); + cinfo->min_DCT_h_scaled_size = 16; + cinfo->min_DCT_v_scaled_size = 16; + } + +#else /* !DCT_SCALING_SUPPORTED */ + + /* Hardwire it to "no scaling" */ + cinfo->jpeg_width = cinfo->image_width; + cinfo->jpeg_height = cinfo->image_height; + cinfo->min_DCT_h_scaled_size = DCTSIZE; + cinfo->min_DCT_v_scaled_size = DCTSIZE; + +#endif /* DCT_SCALING_SUPPORTED */ +} + + +LOCAL(void) +jpeg_calc_trans_dimensions (j_compress_ptr cinfo) +{ + if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size) + ERREXIT2(cinfo, JERR_BAD_DCTSIZE, + cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size); + + cinfo->block_size = cinfo->min_DCT_h_scaled_size; +} + + +LOCAL(void) +initial_setup (j_compress_ptr cinfo, boolean transcode_only) +/* Do computations that are needed before master selection phase */ +{ + int ci, ssize; + jpeg_component_info *compptr; + long samplesperrow; + JDIMENSION jd_samplesperrow; + + if (transcode_only) + jpeg_calc_trans_dimensions(cinfo); + else + jpeg_calc_jpeg_dimensions(cinfo); + + /* Sanity check on block_size */ + if (cinfo->block_size < 1 || cinfo->block_size > 16) + ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size); + + /* Derive natural_order from block_size */ + switch (cinfo->block_size) { + case 2: cinfo->natural_order = jpeg_natural_order2; break; + case 3: cinfo->natural_order = jpeg_natural_order3; break; + case 4: cinfo->natural_order = jpeg_natural_order4; break; + case 5: cinfo->natural_order = jpeg_natural_order5; break; + case 6: cinfo->natural_order = jpeg_natural_order6; break; + case 7: cinfo->natural_order = jpeg_natural_order7; break; + default: cinfo->natural_order = jpeg_natural_order; break; + } + + /* Derive lim_Se from block_size */ + cinfo->lim_Se = cinfo->block_size < DCTSIZE ? + cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1; + + /* Sanity check on image dimensions */ + if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 || + cinfo->num_components <= 0 || cinfo->input_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->jpeg_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* Width of an input scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Fill in the correct component_index value; don't rely on application */ + compptr->component_index = ci; + /* In selecting the actual DCT scaling for each component, we try to + * scale down the chroma components via DCT scaling rather than downsampling. + * This saves time if the downsampler gets to use 1:1 scaling. + * Note this code adapts subsampling ratios which are powers of 2. + */ + ssize = 1; +#ifdef DCT_SCALING_SUPPORTED + while (cinfo->min_DCT_h_scaled_size * ssize <= + (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) && + (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) { + ssize = ssize * 2; + } +#endif + compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize; + ssize = 1; +#ifdef DCT_SCALING_SUPPORTED + while (cinfo->min_DCT_v_scaled_size * ssize <= + (cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) && + (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) { + ssize = ssize * 2; + } +#endif + compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize; + + /* We don't support DCT ratios larger than 2. */ + if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2) + compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2; + else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2) + compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2; + + /* Size in DCT blocks */ + compptr->width_in_blocks = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + compptr->height_in_blocks = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_width * + (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size), + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_height * + (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size), + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + /* Mark component needed (this flag isn't actually used for compression) */ + compptr->component_needed = TRUE; + } + + /* Compute number of fully interleaved MCU rows (number of times that + * main controller will call coefficient controller). + */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_height, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); +} + + +#ifdef C_MULTISCAN_FILES_SUPPORTED + +LOCAL(void) +validate_script (j_compress_ptr cinfo) +/* Verify that the scan script in cinfo->scan_info[] is valid; also + * determine whether it uses progressive JPEG, and set cinfo->progressive_mode. + */ +{ + const jpeg_scan_info * scanptr; + int scanno, ncomps, ci, coefi, thisi; + int Ss, Se, Ah, Al; + boolean component_sent[MAX_COMPONENTS]; +#ifdef C_PROGRESSIVE_SUPPORTED + int * last_bitpos_ptr; + int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; + /* -1 until that coefficient has been seen; then last Al for it */ +#endif + + if (cinfo->num_scans <= 0) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0); + + /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1; + * for progressive JPEG, no scan can have this. + */ + scanptr = cinfo->scan_info; + if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) { +#ifdef C_PROGRESSIVE_SUPPORTED + cinfo->progressive_mode = TRUE; + last_bitpos_ptr = & last_bitpos[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (coefi = 0; coefi < DCTSIZE2; coefi++) + *last_bitpos_ptr++ = -1; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->progressive_mode = FALSE; + for (ci = 0; ci < cinfo->num_components; ci++) + component_sent[ci] = FALSE; + } + + for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { + /* Validate component indexes */ + ncomps = scanptr->comps_in_scan; + if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN); + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (thisi < 0 || thisi >= cinfo->num_components) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + /* Components must appear in SOF order within each scan */ + if (ci > 0 && thisi <= scanptr->component_index[ci-1]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + } + /* Validate progression parameters */ + Ss = scanptr->Ss; + Se = scanptr->Se; + Ah = scanptr->Ah; + Al = scanptr->Al; + if (cinfo->progressive_mode) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that + * seems wrong: the upper bound ought to depend on data precision. + * Perhaps they really meant 0..N+1 for N-bit precision. + * Here we allow 0..10 for 8-bit data; Al larger than 10 results in + * out-of-range reconstructed DC values during the first DC scan, + * which might cause problems for some decoders. + */ +#if BITS_IN_JSAMPLE == 8 +#define MAX_AH_AL 10 +#else +#define MAX_AH_AL 13 +#endif + if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || + Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + if (Ss == 0) { + if (Se != 0) /* DC and AC together not OK */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + if (ncomps != 1) /* AC scans must be for only one component */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + for (ci = 0; ci < ncomps; ci++) { + last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0]; + if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */ + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + for (coefi = Ss; coefi <= Se; coefi++) { + if (last_bitpos_ptr[coefi] < 0) { + /* first scan of this coefficient */ + if (Ah != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } else { + /* not first scan */ + if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + } + last_bitpos_ptr[coefi] = Al; + } + } +#endif + } else { + /* For sequential JPEG, all progression parameters must be these: */ + if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0) + ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); + /* Make sure components are not sent twice */ + for (ci = 0; ci < ncomps; ci++) { + thisi = scanptr->component_index[ci]; + if (component_sent[thisi]) + ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); + component_sent[thisi] = TRUE; + } + } + } + + /* Now verify that everything got sent. */ + if (cinfo->progressive_mode) { +#ifdef C_PROGRESSIVE_SUPPORTED + /* For progressive mode, we only check that at least some DC data + * got sent for each component; the spec does not require that all bits + * of all coefficients be transmitted. Would it be wiser to enforce + * transmission of all coefficient bits?? + */ + for (ci = 0; ci < cinfo->num_components; ci++) { + if (last_bitpos[ci][0] < 0) + ERREXIT(cinfo, JERR_MISSING_DATA); + } +#endif + } else { + for (ci = 0; ci < cinfo->num_components; ci++) { + if (! component_sent[ci]) + ERREXIT(cinfo, JERR_MISSING_DATA); + } + } +} + + +LOCAL(void) +reduce_script (j_compress_ptr cinfo) +/* Adapt scan script for use with reduced block size; + * assume that script has been validated before. + */ +{ + jpeg_scan_info * scanptr; + int idxout, idxin; + + /* Circumvent const declaration for this function */ + scanptr = (jpeg_scan_info *) cinfo->scan_info; + idxout = 0; + + for (idxin = 0; idxin < cinfo->num_scans; idxin++) { + /* After skipping, idxout becomes smaller than idxin */ + if (idxin != idxout) + /* Copy rest of data; + * note we stay in given chunk of allocated memory. + */ + scanptr[idxout] = scanptr[idxin]; + if (scanptr[idxout].Ss > cinfo->lim_Se) + /* Entire scan out of range - skip this entry */ + continue; + if (scanptr[idxout].Se > cinfo->lim_Se) + /* Limit scan to end of block */ + scanptr[idxout].Se = cinfo->lim_Se; + idxout++; + } + + cinfo->num_scans = idxout; +} + +#endif /* C_MULTISCAN_FILES_SUPPORTED */ + + +LOCAL(void) +select_scan_parameters (j_compress_ptr cinfo) +/* Set up the scan parameters for the current scan */ +{ + int ci; + +#ifdef C_MULTISCAN_FILES_SUPPORTED + if (cinfo->scan_info != NULL) { + /* Prepare for current scan --- the script is already validated */ + my_master_ptr master = (my_master_ptr) cinfo->master; + const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; + + cinfo->comps_in_scan = scanptr->comps_in_scan; + for (ci = 0; ci < scanptr->comps_in_scan; ci++) { + cinfo->cur_comp_info[ci] = + &cinfo->comp_info[scanptr->component_index[ci]]; + } + if (cinfo->progressive_mode) { + cinfo->Ss = scanptr->Ss; + cinfo->Se = scanptr->Se; + cinfo->Ah = scanptr->Ah; + cinfo->Al = scanptr->Al; + return; + } + } + else +#endif + { + /* Prepare for single sequential-JPEG scan containing all components */ + if (cinfo->num_components > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPS_IN_SCAN); + cinfo->comps_in_scan = cinfo->num_components; + for (ci = 0; ci < cinfo->num_components; ci++) { + cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; + } + } + cinfo->Ss = 0; + cinfo->Se = cinfo->block_size * cinfo->block_size - 1; + cinfo->Ah = 0; + cinfo->Al = 0; +} + + +LOCAL(void) +per_scan_setup (j_compress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_blocks; + cinfo->MCU_rows_in_scan = compptr->height_in_blocks; + + /* For noninterleaved scan, always one block per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_blocks = 1; + compptr->MCU_sample_width = compptr->DCT_h_scaled_size; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of block rows present in the last iMCU row. + */ + tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->blocks_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_width, + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->jpeg_height, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + + cinfo->blocks_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of blocks of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size; + /* Figure number of non-dummy blocks in last MCU column & row */ + tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_blocks; + if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; + } + } + + } + + /* Convert restart specified in rows to actual MCU count. */ + /* Note that count must fit in 16 bits, so we provide limiting. */ + if (cinfo->restart_in_rows > 0) { + long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row; + cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L); + } +} + + +/* + * Per-pass setup. + * This is called at the beginning of each pass. We determine which modules + * will be active during this pass and give them appropriate start_pass calls. + * We also set is_last_pass to indicate whether any more passes will be + * required. + */ + +METHODDEF(void) +prepare_for_pass (j_compress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + switch (master->pass_type) { + case main_pass: + /* Initial pass: will collect input data, and do either Huffman + * optimization or data output for the first scan. + */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + if (! cinfo->raw_data_in) { + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->downsample->start_pass) (cinfo); + (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU); + } + (*cinfo->fdct->start_pass) (cinfo); + (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding); + (*cinfo->coef->start_pass) (cinfo, + (master->total_passes > 1 ? + JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + if (cinfo->optimize_coding) { + /* No immediate data output; postpone writing frame/scan headers */ + master->pub.call_pass_startup = FALSE; + } else { + /* Will write frame/scan headers at first jpeg_write_scanlines call */ + master->pub.call_pass_startup = TRUE; + } + break; +#ifdef ENTROPY_OPT_SUPPORTED + case huff_opt_pass: + /* Do Huffman optimization for a scan after the first one. */ + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + if (cinfo->Ss != 0 || cinfo->Ah == 0) { + (*cinfo->entropy->start_pass) (cinfo, TRUE); + (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); + master->pub.call_pass_startup = FALSE; + break; + } + /* Special case: Huffman DC refinement scans need no Huffman table + * and therefore we can skip the optimization pass for them. + */ + master->pass_type = output_pass; + master->pass_number++; + /*FALLTHROUGH*/ +#endif + case output_pass: + /* Do a data-output pass. */ + /* We need not repeat per-scan setup if prior optimization pass did it. */ + if (! cinfo->optimize_coding) { + select_scan_parameters(cinfo); + per_scan_setup(cinfo); + } + (*cinfo->entropy->start_pass) (cinfo, FALSE); + (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); + /* We emit frame/scan headers now */ + if (master->scan_number == 0) + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); + master->pub.call_pass_startup = FALSE; + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + } + + master->pub.is_last_pass = (master->pass_number == master->total_passes-1); + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->total_passes; + } +} + + +/* + * Special start-of-pass hook. + * This is called by jpeg_write_scanlines if call_pass_startup is TRUE. + * In single-pass processing, we need this hook because we don't want to + * write frame/scan headers during jpeg_start_compress; we want to let the + * application write COM markers etc. between jpeg_start_compress and the + * jpeg_write_scanlines loop. + * In multi-pass processing, this routine is not used. + */ + +METHODDEF(void) +pass_startup (j_compress_ptr cinfo) +{ + cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ + + (*cinfo->marker->write_frame_header) (cinfo); + (*cinfo->marker->write_scan_header) (cinfo); +} + + +/* + * Finish up at end of pass. + */ + +METHODDEF(void) +finish_pass_master (j_compress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* The entropy coder always needs an end-of-pass call, + * either to analyze statistics or to flush its output buffer. + */ + (*cinfo->entropy->finish_pass) (cinfo); + + /* Update state for next pass */ + switch (master->pass_type) { + case main_pass: + /* next pass is either output of scan 0 (after optimization) + * or output of scan 1 (if no optimization). + */ + master->pass_type = output_pass; + if (! cinfo->optimize_coding) + master->scan_number++; + break; + case huff_opt_pass: + /* next pass is always output of current scan */ + master->pass_type = output_pass; + break; + case output_pass: + /* next pass is either optimization or output of next scan */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + master->scan_number++; + break; + } + + master->pass_number++; +} + + +/* + * Initialize master compression control. + */ + +GLOBAL(void) +jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_comp_master)); + cinfo->master = (struct jpeg_comp_master *) master; + master->pub.prepare_for_pass = prepare_for_pass; + master->pub.pass_startup = pass_startup; + master->pub.finish_pass = finish_pass_master; + master->pub.is_last_pass = FALSE; + + /* Validate parameters, determine derived values */ + initial_setup(cinfo, transcode_only); + + if (cinfo->scan_info != NULL) { +#ifdef C_MULTISCAN_FILES_SUPPORTED + validate_script(cinfo); + if (cinfo->block_size < DCTSIZE) + reduce_script(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + cinfo->progressive_mode = FALSE; + cinfo->num_scans = 1; + } + + if ((cinfo->progressive_mode || cinfo->block_size < DCTSIZE) && + !cinfo->arith_code) /* TEMPORARY HACK ??? */ + /* assume default tables no good for progressive or downscale mode */ + cinfo->optimize_coding = TRUE; + + /* Initialize my private state */ + if (transcode_only) { + /* no main pass in transcoding */ + if (cinfo->optimize_coding) + master->pass_type = huff_opt_pass; + else + master->pass_type = output_pass; + } else { + /* for normal compression, first pass is always this type: */ + master->pass_type = main_pass; + } + master->scan_number = 0; + master->pass_number = 0; + if (cinfo->optimize_coding) + master->total_passes = cinfo->num_scans * 2; + else + master->total_passes = cinfo->num_scans; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcomapi.c b/thirdparty/LibJPEG/jpeg-9/jcomapi.c new file mode 100644 index 0000000..9b1fa75 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcomapi.c @@ -0,0 +1,106 @@ +/* + * jcomapi.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface routines that are used for both + * compression and decompression. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Abort processing of a JPEG compression or decompression operation, + * but don't destroy the object itself. + * + * For this, we merely clean up all the nonpermanent memory pools. + * Note that temp files (virtual arrays) are not allowed to belong to + * the permanent pool, so we will be able to close all temp files here. + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_abort (j_common_ptr cinfo) +{ + int pool; + + /* Do nothing if called on a not-initialized or destroyed JPEG object. */ + if (cinfo->mem == NULL) + return; + + /* Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { + (*cinfo->mem->free_pool) (cinfo, pool); + } + + /* Reset overall state for possible reuse of object */ + if (cinfo->is_decompressor) { + cinfo->global_state = DSTATE_START; + /* Try to keep application from accessing now-deleted marker list. + * A bit kludgy to do it here, but this is the most central place. + */ + ((j_decompress_ptr) cinfo)->marker_list = NULL; + } else { + cinfo->global_state = CSTATE_START; + } +} + + +/* + * Destruction of a JPEG object. + * + * Everything gets deallocated except the master jpeg_compress_struct itself + * and the error manager struct. Both of these are supplied by the application + * and must be freed, if necessary, by the application. (Often they are on + * the stack and so don't need to be freed anyway.) + * Closing a data source or destination, if necessary, is the application's + * responsibility. + */ + +GLOBAL(void) +jpeg_destroy (j_common_ptr cinfo) +{ + /* We need only tell the memory manager to release everything. */ + /* NB: mem pointer is NULL if memory mgr failed to initialize. */ + if (cinfo->mem != NULL) + (*cinfo->mem->self_destruct) (cinfo); + cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ + cinfo->global_state = 0; /* mark it destroyed */ +} + + +/* + * Convenience routines for allocating quantization and Huffman tables. + * (Would jutils.c be a more reasonable place to put these?) + */ + +GLOBAL(JQUANT_TBL *) +jpeg_alloc_quant_table (j_common_ptr cinfo) +{ + JQUANT_TBL *tbl; + + tbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} + + +GLOBAL(JHUFF_TBL *) +jpeg_alloc_huff_table (j_common_ptr cinfo) +{ + JHUFF_TBL *tbl; + + tbl = (JHUFF_TBL *) + (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); + tbl->sent_table = FALSE; /* make sure this is false in any new table */ + return tbl; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.bcc b/thirdparty/LibJPEG/jpeg-9/jconfig.bcc new file mode 100644 index 0000000..e4da3d7 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.bcc @@ -0,0 +1,48 @@ +/* jconfig.bcc --- jconfig.h for Borland C (Turbo C) on MS-DOS or OS/2. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#ifdef __MSDOS__ +#define NEED_FAR_POINTERS /* for small or medium memory model */ +#endif +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN /* this assumes you have -w-stu in CFLAGS */ + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#ifdef __MSDOS__ +#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ +#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ +#define USE_FMEM /* Borland has _fmemcpy() and _fmemset() */ +#endif + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE +#define USE_SETMODE /* Borland has setmode() */ +#ifdef __MSDOS__ +#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ +#endif +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.cfg b/thirdparty/LibJPEG/jpeg-9/jconfig.cfg new file mode 100644 index 0000000..bb7435c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.cfg @@ -0,0 +1,53 @@ +/* jconfig.cfg --- source file edited by configure script */ +/* see jconfig.txt for explanations */ + +#undef HAVE_PROTOTYPES +#undef HAVE_UNSIGNED_CHAR +#undef HAVE_UNSIGNED_SHORT +#undef void +#undef const +#undef CHAR_IS_UNSIGNED +#undef HAVE_STDDEF_H +#undef HAVE_STDLIB_H +#undef HAVE_LOCALE_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +/* Define this if you get warnings about undefined structures. */ +#undef INCOMPLETE_TYPES_BROKEN + +/* Define "boolean" as unsigned char, not int, on Windows systems. */ +#ifdef _WIN32 +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +#endif + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED +#undef INLINE +/* These are for configuring the JPEG memory manager. */ +#undef DEFAULT_MAX_MEM +#undef NO_MKTEMP + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#undef TWO_FILE_COMMANDLINE +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE + +/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ +#undef PROGRESS_REPORT + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.dj b/thirdparty/LibJPEG/jpeg-9/jconfig.dj new file mode 100644 index 0000000..a0d4092 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.dj @@ -0,0 +1,38 @@ +/* jconfig.dj --- jconfig.h for DJGPP (Delorie's GNU C port) on MS-DOS. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS /* DJGPP uses flat 32-bit addressing */ +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#undef TWO_FILE_COMMANDLINE /* optional */ +#define USE_SETMODE /* Needed to make one-file style work in DJGPP */ +#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.mac b/thirdparty/LibJPEG/jpeg-9/jconfig.mac new file mode 100644 index 0000000..70ed66c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.mac @@ -0,0 +1,43 @@ +/* jconfig.mac --- jconfig.h for CodeWarrior on Apple Macintosh */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#define USE_MAC_MEMMGR /* Define this if you use jmemmac.c */ + +#define ALIGN_TYPE long /* Needed for 680x0 Macs */ + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define USE_CCOMMAND /* Command line reader for Macintosh */ +#define TWO_FILE_COMMANDLINE /* Binary I/O thru stdin/stdout doesn't work */ + +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.manx b/thirdparty/LibJPEG/jpeg-9/jconfig.manx new file mode 100644 index 0000000..cd529d7 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.manx @@ -0,0 +1,43 @@ +/* jconfig.manx --- jconfig.h for Amiga systems using Manx Aztec C ver 5.x. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ + +#define SHORTxSHORT_32 /* produces better DCT code with Aztec C */ + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE +#define NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#define signal_catcher _abort /* hack for Aztec C naming requirements */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.mc6 b/thirdparty/LibJPEG/jpeg-9/jconfig.mc6 new file mode 100644 index 0000000..6b05e81 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.mc6 @@ -0,0 +1,52 @@ +/* jconfig.mc6 --- jconfig.h for Microsoft C on MS-DOS, version 6.00A & up. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#define NEED_FAR_POINTERS /* for small or medium memory model */ +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#define USE_MSDOS_MEMMGR /* Define this if you use jmemdos.c */ + +#define MAX_ALLOC_CHUNK 65520L /* Maximum request to malloc() */ + +#define USE_FMEM /* Microsoft has _fmemcpy() and _fmemset() */ + +#define NEED_FHEAPMIN /* far heap management routines are broken */ + +#define SHORTxLCONST_32 /* enable compiler-specific DCT optimization */ +/* Note: the above define is known to improve the code with Microsoft C 6.00A. + * I do not know whether it is good for later compiler versions. + * Please report any info on this point to jpeg-info@jpegclub.org. + */ + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE +#define USE_SETMODE /* Microsoft has setmode() */ +#define NEED_SIGNAL_CATCHER /* Define this if you use jmemdos.c */ +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.sas b/thirdparty/LibJPEG/jpeg-9/jconfig.sas new file mode 100644 index 0000000..b8a1819 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.sas @@ -0,0 +1,43 @@ +/* jconfig.sas --- jconfig.h for Amiga systems using SAS C 6.0 and up. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#define TEMP_DIRECTORY "JPEGTMP:" /* recommended setting for Amiga */ + +#define NO_MKTEMP /* SAS C doesn't have mktemp() */ + +#define SHORTxSHORT_32 /* produces better DCT code with SAS C */ + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE +#define NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.st b/thirdparty/LibJPEG/jpeg-9/jconfig.st new file mode 100644 index 0000000..5afa0b6 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.st @@ -0,0 +1,42 @@ +/* jconfig.st --- jconfig.h for Atari ST/STE/TT using Pure C or Turbo C. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +#define INCOMPLETE_TYPES_BROKEN /* suppress undefined-structure warnings */ + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#define ALIGN_TYPE long /* apparently double is a weird size? */ + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE /* optional -- undef if you like Unix style */ +/* Note: if you undef TWO_FILE_COMMANDLINE, you may need to define + * USE_SETMODE. Some Atari compilers require it, some do not. + */ +#define NEED_SIGNAL_CATCHER /* needed if you use jmemname.c */ +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.txt b/thirdparty/LibJPEG/jpeg-9/jconfig.txt new file mode 100644 index 0000000..b96d312 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.txt @@ -0,0 +1,164 @@ +/* + * jconfig.txt + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file documents the configuration options that are required to + * customize the JPEG software for a particular system. + * + * The actual configuration options for a particular installation are stored + * in jconfig.h. On many machines, jconfig.h can be generated automatically + * or copied from one of the "canned" jconfig files that we supply. But if + * you need to generate a jconfig.h file by hand, this file tells you how. + * + * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING. + * EDIT A COPY NAMED JCONFIG.H. + */ + + +/* + * These symbols indicate the properties of your machine or compiler. + * #define the symbol if yes, #undef it if no. + */ + +/* Does your compiler support function prototypes? + * (If not, you also need to use ansi2knr, see install.txt) + */ +#define HAVE_PROTOTYPES + +/* Does your compiler support the declaration "unsigned char" ? + * How about "unsigned short" ? + */ +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT + +/* Define "void" as "char" if your compiler doesn't know about type void. + * NOTE: be sure to define void such that "void *" represents the most general + * pointer type, e.g., that returned by malloc(). + */ +/* #define void char */ + +/* Define "const" as empty if your compiler doesn't know the "const" keyword. + */ +/* #define const */ + +/* Define this if an ordinary "char" type is unsigned. + * If you're not sure, leaving it undefined will work at some cost in speed. + * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal. + */ +#undef CHAR_IS_UNSIGNED + +/* Define this if your system has an ANSI-conforming file. + */ +#define HAVE_STDDEF_H + +/* Define this if your system has an ANSI-conforming file. + */ +#define HAVE_STDLIB_H + +/* Define this if your system does not have an ANSI/SysV , + * but does have a BSD-style . + */ +#undef NEED_BSD_STRINGS + +/* Define this if your system does not provide typedef size_t in any of the + * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in + * instead. + */ +#undef NEED_SYS_TYPES_H + +/* For 80x86 machines, you need to define NEED_FAR_POINTERS, + * unless you are using a large-data memory model or 80386 flat-memory mode. + * On less brain-damaged CPUs this symbol must not be defined. + * (Defining this symbol causes large data structures to be referenced through + * "far" pointers and to be allocated with a special version of malloc.) + */ +#undef NEED_FAR_POINTERS + +/* Define this if your linker needs global names to be unique in less + * than the first 15 characters. + */ +#undef NEED_SHORT_EXTERNAL_NAMES + +/* Although a real ANSI C compiler can deal perfectly well with pointers to + * unspecified structures (see "incomplete types" in the spec), a few pre-ANSI + * and pseudo-ANSI compilers get confused. To keep one of these bozos happy, + * define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you + * actually get "missing structure definition" warnings or errors while + * compiling the JPEG code. + */ +#undef INCOMPLETE_TYPES_BROKEN + +/* Define "boolean" as unsigned char, not int, on Windows systems. + */ +#ifdef _WIN32 +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +#endif + + +/* + * The following options affect code selection within the JPEG library, + * but they don't need to be visible to applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS has been defined. + */ + +#ifdef JPEG_INTERNALS + +/* Define this if your compiler implements ">>" on signed values as a logical + * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, + * which is the normal and rational definition. + */ +#undef RIGHT_SHIFT_IS_UNSIGNED + + +#endif /* JPEG_INTERNALS */ + + +/* + * The remaining options do not affect the JPEG library proper, + * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). + * Other applications can ignore these. + */ + +#ifdef JPEG_CJPEG_DJPEG + +/* These defines indicate which image (non-JPEG) file formats are allowed. */ + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +/* Define this if you want to name both input and output files on the command + * line, rather than using stdout and optionally stdin. You MUST do this if + * your system can't cope with binary I/O to stdin/stdout. See comments at + * head of cjpeg.c or djpeg.c. + */ +#undef TWO_FILE_COMMANDLINE + +/* Define this if your system needs explicit cleanup of temporary files. + * This is crucial under MS-DOS, where the temporary "files" may be areas + * of extended memory; on most other systems it's not as important. + */ +#undef NEED_SIGNAL_CATCHER + +/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb"). + * This is necessary on systems that distinguish text files from binary files, + * and is harmless on most systems that don't. If you have one of the rare + * systems that complains about the "b" spec, define this symbol. + */ +#undef DONT_USE_B_MODE + +/* Define this if you want percent-done progress reports from cjpeg/djpeg. + */ +#undef PROGRESS_REPORT + + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.vc b/thirdparty/LibJPEG/jpeg-9/jconfig.vc new file mode 100644 index 0000000..f15b418 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.vc @@ -0,0 +1,45 @@ +/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +/* Define "boolean" as unsigned char, not enum, per Windows custom */ +#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ +typedef unsigned char boolean; +#endif +#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ + + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE /* optional */ +#define USE_SETMODE /* Microsoft has setmode() */ +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.vms b/thirdparty/LibJPEG/jpeg-9/jconfig.vms new file mode 100644 index 0000000..8337b0b --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.vms @@ -0,0 +1,37 @@ +/* jconfig.vms --- jconfig.h for use on Digital VMS. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#define TWO_FILE_COMMANDLINE /* Needed on VMS */ +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jconfig.wat b/thirdparty/LibJPEG/jpeg-9/jconfig.wat new file mode 100644 index 0000000..190cc75 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jconfig.wat @@ -0,0 +1,38 @@ +/* jconfig.wat --- jconfig.h for Watcom C/C++ on MS-DOS or OS/2. */ +/* see jconfig.txt for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +/* #define void char */ +/* #define const */ +#define CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS /* Watcom uses flat 32-bit addressing */ +#undef NEED_SHORT_EXTERNAL_NAMES +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#undef TWO_FILE_COMMANDLINE /* optional */ +#define USE_SETMODE /* Needed to make one-file style work in Watcom */ +#undef NEED_SIGNAL_CATCHER /* Define this if you use jmemname.c */ +#undef DONT_USE_B_MODE +#undef PROGRESS_REPORT /* optional */ + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/thirdparty/LibJPEG/jpeg-9/jcparam.c b/thirdparty/LibJPEG/jpeg-9/jcparam.c new file mode 100644 index 0000000..e530c3c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcparam.c @@ -0,0 +1,637 @@ +/* + * jcparam.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2003-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains optional default-setting code for the JPEG compressor. + * Applications do not have to use this file, but those that don't use it + * must know a lot more about the innards of the JPEG code. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Quantization table setup routines + */ + +GLOBAL(void) +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) +/* Define a quantization table equal to the basic_table times + * a scale factor (given as a percentage). + * If force_baseline is TRUE, the computed quantization table entries + * are limited to 1..255 for JPEG baseline compatibility. + */ +{ + JQUANT_TBL ** qtblptr; + int i; + long temp; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl); + + qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; + + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); + + for (i = 0; i < DCTSIZE2; i++) { + temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; + /* limit the values to the valid range */ + if (temp <= 0L) temp = 1L; + if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ + if (force_baseline && temp > 255L) + temp = 255L; /* limit to baseline range if requested */ + (*qtblptr)->quantval[i] = (UINT16) temp; + } + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*qtblptr)->sent_table = FALSE; +} + + +/* These are the sample quantization tables given in JPEG spec section K.1. + * The spec says that the values given produce "good" quality, and + * when divided by 2, "very good" quality. + */ +static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 56, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 +}; +static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 +}; + + +GLOBAL(void) +jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables + * and straight percentage-scaling quality scales. + * This entry point allows different scalings for luminance and chrominance. + */ +{ + /* Set up two quantization tables using the specified scaling */ + jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, + cinfo->q_scale_factor[0], force_baseline); + jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, + cinfo->q_scale_factor[1], force_baseline); +} + + +GLOBAL(void) +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables + * and a straight percentage-scaling quality scale. In most cases it's better + * to use jpeg_set_quality (below); this entry point is provided for + * applications that insist on a linear percentage scaling. + */ +{ + /* Set up two quantization tables using the specified scaling */ + jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, + scale_factor, force_baseline); + jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, + scale_factor, force_baseline); +} + + +GLOBAL(int) +jpeg_quality_scaling (int quality) +/* Convert a user-specified quality rating to a percentage scaling factor + * for an underlying quantization table, using our recommended scaling curve. + * The input 'quality' factor should be 0 (terrible) to 100 (very good). + */ +{ + /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ + if (quality <= 0) quality = 1; + if (quality > 100) quality = 100; + + /* The basic table is used as-is (scaling 100) for a quality of 50. + * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; + * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table + * to make all the table entries 1 (hence, minimum quantization loss). + * Qualities 1..50 are converted to scaling percentage 5000/Q. + */ + if (quality < 50) + quality = 5000 / quality; + else + quality = 200 - quality*2; + + return quality; +} + + +GLOBAL(void) +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) +/* Set or change the 'quality' (quantization) setting, using default tables. + * This is the standard quality-adjusting entry point for typical user + * interfaces; only those who want detailed control over quantization tables + * would use the preceding routines directly. + */ +{ + /* Convert user 0-100 rating to percentage scaling */ + quality = jpeg_quality_scaling(quality); + + /* Set up standard quality tables */ + jpeg_set_linear_quality(cinfo, quality, force_baseline); +} + + +/* + * Huffman table setup routines + */ + +LOCAL(void) +add_huff_table (j_compress_ptr cinfo, + JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) +/* Define a Huffman table */ +{ + int nsymbols, len; + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + /* Copy the number-of-symbols-of-each-code-length counts */ + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + + /* Validate the counts. We do this here mainly so we can copy the right + * number of symbols from the val[] array, without risking marching off + * the end of memory. jchuff.c will do a more thorough test later. + */ + nsymbols = 0; + for (len = 1; len <= 16; len++) + nsymbols += bits[len]; + if (nsymbols < 1 || nsymbols > 256) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8)); + + /* Initialize sent_table FALSE so table will be written to JPEG file. */ + (*htblptr)->sent_table = FALSE; +} + + +LOCAL(void) +std_huff_tables (j_compress_ptr cinfo) +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ +/* IMPORTANT: these are only valid for 8-bit data precision! */ +{ + static const UINT8 bits_dc_luminance[17] = + { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_luminance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_dc_chrominance[17] = + { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + static const UINT8 val_dc_chrominance[] = + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + + static const UINT8 bits_ac_luminance[17] = + { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; + static const UINT8 val_ac_luminance[] = + { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, + 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, + 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, + 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, + 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, + 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, + 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, + 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, + 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, + 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, + 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, + 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, + 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, + 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, + 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, + 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, + 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, + 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + static const UINT8 bits_ac_chrominance[17] = + { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; + static const UINT8 val_ac_chrominance[] = + { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, + 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, + 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, + 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, + 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, + 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, + 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, + 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, + 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, + 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, + 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, + 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, + 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, + 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, + 0xf9, 0xfa }; + + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], + bits_dc_luminance, val_dc_luminance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], + bits_ac_luminance, val_ac_luminance); + add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], + bits_dc_chrominance, val_dc_chrominance); + add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], + bits_ac_chrominance, val_ac_chrominance); +} + + +/* + * Default parameter setup for compression. + * + * Applications that don't choose to use this routine must do their + * own setup of all these parameters. Alternately, you can call this + * to establish defaults and then alter parameters selectively. This + * is the recommended approach since, if we add any new parameters, + * your code will still work (they'll be set to reasonable defaults). + */ + +GLOBAL(void) +jpeg_set_defaults (j_compress_ptr cinfo) +{ + int i; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Allocate comp_info array large enough for maximum component count. + * Array is made permanent in case application wants to compress + * multiple images at same param settings. + */ + if (cinfo->comp_info == NULL) + cinfo->comp_info = (jpeg_component_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + MAX_COMPONENTS * SIZEOF(jpeg_component_info)); + + /* Initialize everything not dependent on the color space */ + + cinfo->scale_num = 1; /* 1:1 scaling */ + cinfo->scale_denom = 1; + cinfo->data_precision = BITS_IN_JSAMPLE; + /* Set up two quantization tables using default quality of 75 */ + jpeg_set_quality(cinfo, 75, TRUE); + /* Set up two Huffman tables */ + std_huff_tables(cinfo); + + /* Initialize default arithmetic coding conditioning */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + + /* Default is no multiple-scan output */ + cinfo->scan_info = NULL; + cinfo->num_scans = 0; + + /* Expect normal source image, not raw downsampled data */ + cinfo->raw_data_in = FALSE; + + /* Use Huffman coding, not arithmetic coding, by default */ + cinfo->arith_code = FALSE; + + /* By default, don't do extra passes to optimize entropy coding */ + cinfo->optimize_coding = FALSE; + /* The standard Huffman tables are only valid for 8-bit data precision. + * If the precision is higher, force optimization on so that usable + * tables will be computed. This test can be removed if default tables + * are supplied that are valid for the desired precision. + */ + if (cinfo->data_precision > 8) + cinfo->optimize_coding = TRUE; + + /* By default, use the simpler non-cosited sampling alignment */ + cinfo->CCIR601_sampling = FALSE; + + /* By default, apply fancy downsampling */ + cinfo->do_fancy_downsampling = TRUE; + + /* No input smoothing */ + cinfo->smoothing_factor = 0; + + /* DCT algorithm preference */ + cinfo->dct_method = JDCT_DEFAULT; + + /* No restart markers */ + cinfo->restart_interval = 0; + cinfo->restart_in_rows = 0; + + /* Fill in default JFIF marker parameters. Note that whether the marker + * will actually be written is determined by jpeg_set_colorspace. + * + * By default, the library emits JFIF version code 1.01. + * An application that wants to emit JFIF 1.02 extension markers should set + * JFIF_minor_version to 2. We could probably get away with just defaulting + * to 1.02, but there may still be some decoders in use that will complain + * about that; saying 1.01 should minimize compatibility problems. + */ + cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; /* Pixel size is unknown by default */ + cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ + cinfo->Y_density = 1; + + /* No color transform */ + cinfo->color_transform = JCT_NONE; + + /* Choose JPEG colorspace based on input space, set defaults accordingly */ + + jpeg_default_colorspace(cinfo); +} + + +/* + * Select an appropriate JPEG colorspace for in_color_space. + */ + +GLOBAL(void) +jpeg_default_colorspace (j_compress_ptr cinfo) +{ + switch (cinfo->in_color_space) { + case JCS_GRAYSCALE: + jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); + break; + case JCS_RGB: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_YCbCr: + jpeg_set_colorspace(cinfo, JCS_YCbCr); + break; + case JCS_CMYK: + jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */ + break; + case JCS_YCCK: + jpeg_set_colorspace(cinfo, JCS_YCCK); + break; + case JCS_UNKNOWN: + jpeg_set_colorspace(cinfo, JCS_UNKNOWN); + break; + default: + ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); + } +} + + +/* + * Set the JPEG colorspace, and choose colorspace-dependent default values. + */ + +GLOBAL(void) +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) +{ + jpeg_component_info * compptr; + int ci; + +#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ + (compptr = &cinfo->comp_info[index], \ + compptr->component_id = (id), \ + compptr->h_samp_factor = (hsamp), \ + compptr->v_samp_factor = (vsamp), \ + compptr->quant_tbl_no = (quant), \ + compptr->dc_tbl_no = (dctbl), \ + compptr->ac_tbl_no = (actbl) ) + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* For all colorspaces, we use Q and Huff tables 0 for luminance components, + * tables 1 for chrominance components. + */ + + cinfo->jpeg_color_space = colorspace; + + cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ + cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ + + switch (colorspace) { + case JCS_GRAYSCALE: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 1; + /* JFIF specifies component ID 1 */ + SET_COMP(0, 1, 1,1, 0, 0,0); + break; + case JCS_RGB: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ + cinfo->num_components = 3; + SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); + SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0, + cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0); + SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); + break; + case JCS_YCbCr: + cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ + cinfo->num_components = 3; + /* JFIF specifies component IDs 1,2,3 */ + /* We default to 2x2 subsamples of chrominance */ + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + break; + case JCS_CMYK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ + cinfo->num_components = 4; + SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0); + SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0); + SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0); + SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0); + break; + case JCS_YCCK: + cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ + cinfo->num_components = 4; + SET_COMP(0, 1, 2,2, 0, 0,0); + SET_COMP(1, 2, 1,1, 1, 1,1); + SET_COMP(2, 3, 1,1, 1, 1,1); + SET_COMP(3, 4, 2,2, 0, 0,0); + break; + case JCS_UNKNOWN: + cinfo->num_components = cinfo->input_components; + if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + for (ci = 0; ci < cinfo->num_components; ci++) { + SET_COMP(ci, ci, 1,1, 0, 0,0); + } + break; + default: + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + } +} + + +#ifdef C_PROGRESSIVE_SUPPORTED + +LOCAL(jpeg_scan_info *) +fill_a_scan (jpeg_scan_info * scanptr, int ci, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for specified component */ +{ + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + return scanptr; +} + +LOCAL(jpeg_scan_info *) +fill_scans (jpeg_scan_info * scanptr, int ncomps, + int Ss, int Se, int Ah, int Al) +/* Support routine: generate one scan for each component */ +{ + int ci; + + for (ci = 0; ci < ncomps; ci++) { + scanptr->comps_in_scan = 1; + scanptr->component_index[0] = ci; + scanptr->Ss = Ss; + scanptr->Se = Se; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } + return scanptr; +} + +LOCAL(jpeg_scan_info *) +fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) +/* Support routine: generate interleaved DC scan if possible, else N scans */ +{ + int ci; + + if (ncomps <= MAX_COMPS_IN_SCAN) { + /* Single interleaved DC scan */ + scanptr->comps_in_scan = ncomps; + for (ci = 0; ci < ncomps; ci++) + scanptr->component_index[ci] = ci; + scanptr->Ss = scanptr->Se = 0; + scanptr->Ah = Ah; + scanptr->Al = Al; + scanptr++; + } else { + /* Noninterleaved DC scan for each component */ + scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al); + } + return scanptr; +} + + +/* + * Create a recommended progressive-JPEG script. + * cinfo->num_components and cinfo->jpeg_color_space must be correct. + */ + +GLOBAL(void) +jpeg_simple_progression (j_compress_ptr cinfo) +{ + int ncomps = cinfo->num_components; + int nscans; + jpeg_scan_info * scanptr; + + /* Safety check to ensure start_compress not called yet. */ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Figure space needed for script. Calculation must match code below! */ + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + nscans = 10; + } else { + /* All-purpose script for other color spaces. */ + if (ncomps > MAX_COMPS_IN_SCAN) + nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */ + else + nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */ + } + + /* Allocate space for script. + * We need to put it in the permanent pool in case the application performs + * multiple compressions without changing the settings. To avoid a memory + * leak if jpeg_simple_progression is called repeatedly for the same JPEG + * object, we try to re-use previously allocated space, and we allocate + * enough space to handle YCbCr even if initially asked for grayscale. + */ + if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { + cinfo->script_space_size = MAX(nscans, 10); + cinfo->script_space = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + cinfo->script_space_size * SIZEOF(jpeg_scan_info)); + } + scanptr = cinfo->script_space; + cinfo->scan_info = scanptr; + cinfo->num_scans = nscans; + + if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { + /* Custom script for YCbCr color images. */ + /* Initial DC scan */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + /* Initial AC scan: get some luma data out in a hurry */ + scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2); + /* Chroma data is too small to be worth expending many scans on */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1); + /* Complete spectral selection for luma AC */ + scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2); + /* Refine next bit of luma AC */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1); + /* Finish DC successive approximation */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + /* Finish AC successive approximation */ + scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0); + scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0); + /* Luma bottom bit comes last since it's usually largest scan */ + scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0); + } else { + /* All-purpose script for other color spaces. */ + /* Successive approximation first pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); + scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2); + scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2); + /* Successive approximation second pass */ + scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1); + /* Successive approximation final pass */ + scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); + scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0); + } +} + +#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jcprepct.c b/thirdparty/LibJPEG/jpeg-9/jcprepct.c new file mode 100644 index 0000000..be44cc4 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcprepct.c @@ -0,0 +1,358 @@ +/* + * jcprepct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the compression preprocessing controller. + * This controller manages the color conversion, downsampling, + * and edge expansion steps. + * + * Most of the complexity here is associated with buffering input rows + * as required by the downsampler. See the comments at the head of + * jcsample.c for the downsampler's needs. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* At present, jcsample.c can request context rows only for smoothing. + * In the future, we might also need context rows for CCIR601 sampling + * or other more-complex downsampling procedures. The code to support + * context rows should be compiled only if needed. + */ +#ifdef INPUT_SMOOTHING_SUPPORTED +#define CONTEXT_ROWS_SUPPORTED +#endif + + +/* + * For the simple (no-context-row) case, we just need to buffer one + * row group's worth of pixels for the downsampling step. At the bottom of + * the image, we pad to a full row group by replicating the last pixel row. + * The downsampler's last output row is then replicated if needed to pad + * out to a full iMCU row. + * + * When providing context rows, we must buffer three row groups' worth of + * pixels. Three row groups are physically allocated, but the row pointer + * arrays are made five row groups high, with the extra pointers above and + * below "wrapping around" to point to the last and first real row groups. + * This allows the downsampler to access the proper context rows. + * At the top and bottom of the image, we create dummy context rows by + * copying the first or last real pixel row. This copying could be avoided + * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the + * trouble on the compression side. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_prep_controller pub; /* public fields */ + + /* Downsampling input buffer. This buffer holds color-converted data + * until we have enough to do a downsample step. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + JDIMENSION rows_to_go; /* counts rows remaining in source image */ + int next_buf_row; /* index of next row to store in color_buf */ + +#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */ + int this_row_group; /* starting row index of group to process */ + int next_buf_stop; /* downsample when we reach this index */ +#endif +} my_prep_controller; + +typedef my_prep_controller * my_prep_ptr; + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + + if (pass_mode != JBUF_PASS_THRU) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Initialize total-height counter for detecting bottom of image */ + prep->rows_to_go = cinfo->image_height; + /* Mark the conversion buffer empty */ + prep->next_buf_row = 0; +#ifdef CONTEXT_ROWS_SUPPORTED + /* Preset additional state variables for context mode. + * These aren't used in non-context mode, so we needn't test which mode. + */ + prep->this_row_group = 0; + /* Set next_buf_stop to stop after two row groups have been read in. */ + prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; +#endif +} + + +/* + * Expand an image vertically from height input_rows to height output_rows, + * by duplicating the bottom row. + */ + +LOCAL(void) +expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, + int input_rows, int output_rows) +{ + register int row; + + for (row = input_rows; row < output_rows; row++) { + jcopy_sample_rows(image_data, input_rows-1, image_data, row, + 1, num_cols); + } +} + + +/* + * Process some data in the simple no-context case. + * + * Preprocessor output data is counted in "row groups". A row group + * is defined to be v_samp_factor sample rows of each component. + * Downsampling will produce this much data from each max_v_samp_factor + * input rows. + */ + +METHODDEF(void) +pre_process_data (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + JDIMENSION inrows; + jpeg_component_info * compptr; + + while (*in_row_ctr < in_rows_avail && + *out_row_group_ctr < out_row_groups_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = cinfo->max_v_samp_factor - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + *in_row_ctr += numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= numrows; + /* If at bottom of image, pad to fill the conversion buffer. */ + if (prep->rows_to_go == 0 && + prep->next_buf_row < cinfo->max_v_samp_factor) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, cinfo->max_v_samp_factor); + } + prep->next_buf_row = cinfo->max_v_samp_factor; + } + /* If we've filled the conversion buffer, empty it. */ + if (prep->next_buf_row == cinfo->max_v_samp_factor) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, (JDIMENSION) 0, + output_buf, *out_row_group_ctr); + prep->next_buf_row = 0; + (*out_row_group_ctr)++; + } + /* If at bottom of image, pad the output to a full iMCU height. + * Note we assume the caller is providing a one-iMCU-height output buffer! + */ + if (prep->rows_to_go == 0 && + *out_row_group_ctr < out_row_groups_avail) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + numrows = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; + expand_bottom_edge(output_buf[ci], + compptr->width_in_blocks * compptr->DCT_h_scaled_size, + (int) (*out_row_group_ctr * numrows), + (int) (out_row_groups_avail * numrows)); + } + *out_row_group_ctr = out_row_groups_avail; + break; /* can exit outer loop without test */ + } + } +} + + +#ifdef CONTEXT_ROWS_SUPPORTED + +/* + * Process some data in the context case. + */ + +METHODDEF(void) +pre_process_context (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int numrows, ci; + int buf_height = cinfo->max_v_samp_factor * 3; + JDIMENSION inrows; + + while (*out_row_group_ctr < out_row_groups_avail) { + if (*in_row_ctr < in_rows_avail) { + /* Do color conversion to fill the conversion buffer. */ + inrows = in_rows_avail - *in_row_ctr; + numrows = prep->next_buf_stop - prep->next_buf_row; + numrows = (int) MIN((JDIMENSION) numrows, inrows); + (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, + prep->color_buf, + (JDIMENSION) prep->next_buf_row, + numrows); + /* Pad at top of image, if first time through */ + if (prep->rows_to_go == cinfo->image_height) { + for (ci = 0; ci < cinfo->num_components; ci++) { + int row; + for (row = 1; row <= cinfo->max_v_samp_factor; row++) { + jcopy_sample_rows(prep->color_buf[ci], 0, + prep->color_buf[ci], -row, + 1, cinfo->image_width); + } + } + } + *in_row_ctr += numrows; + prep->next_buf_row += numrows; + prep->rows_to_go -= numrows; + } else { + /* Return for more data, unless we are at the bottom of the image. */ + if (prep->rows_to_go != 0) + break; + /* When at bottom of image, pad to fill the conversion buffer. */ + if (prep->next_buf_row < prep->next_buf_stop) { + for (ci = 0; ci < cinfo->num_components; ci++) { + expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, + prep->next_buf_row, prep->next_buf_stop); + } + prep->next_buf_row = prep->next_buf_stop; + } + } + /* If we've gotten enough data, downsample a row group. */ + if (prep->next_buf_row == prep->next_buf_stop) { + (*cinfo->downsample->downsample) (cinfo, + prep->color_buf, + (JDIMENSION) prep->this_row_group, + output_buf, *out_row_group_ctr); + (*out_row_group_ctr)++; + /* Advance pointers with wraparound as necessary. */ + prep->this_row_group += cinfo->max_v_samp_factor; + if (prep->this_row_group >= buf_height) + prep->this_row_group = 0; + if (prep->next_buf_row >= buf_height) + prep->next_buf_row = 0; + prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; + } + } +} + + +/* + * Create the wrapped-around downsampling input buffer needed for context mode. + */ + +LOCAL(void) +create_context_buffer (j_compress_ptr cinfo) +{ + my_prep_ptr prep = (my_prep_ptr) cinfo->prep; + int rgroup_height = cinfo->max_v_samp_factor; + int ci, i; + jpeg_component_info * compptr; + JSAMPARRAY true_buffer, fake_buffer; + + /* Grab enough space for fake row pointers for all the components; + * we need five row groups' worth of pointers for each component. + */ + fake_buffer = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (cinfo->num_components * 5 * rgroup_height) * + SIZEOF(JSAMPROW)); + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate the actual buffer space (3 row groups) for this component. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + true_buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_blocks * + cinfo->min_DCT_h_scaled_size * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) (3 * rgroup_height)); + /* Copy true buffer row pointers into the middle of the fake row array */ + MEMCOPY(fake_buffer + rgroup_height, true_buffer, + 3 * rgroup_height * SIZEOF(JSAMPROW)); + /* Fill in the above and below wraparound pointers */ + for (i = 0; i < rgroup_height; i++) { + fake_buffer[i] = true_buffer[2 * rgroup_height + i]; + fake_buffer[4 * rgroup_height + i] = true_buffer[i]; + } + prep->color_buf[ci] = fake_buffer + rgroup_height; + fake_buffer += 5 * rgroup_height; /* point to space for next component */ + } +} + +#endif /* CONTEXT_ROWS_SUPPORTED */ + + +/* + * Initialize preprocessing controller. + */ + +GLOBAL(void) +jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer) +{ + my_prep_ptr prep; + int ci; + jpeg_component_info * compptr; + + if (need_full_buffer) /* safety check */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + prep = (my_prep_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_prep_controller)); + cinfo->prep = (struct jpeg_c_prep_controller *) prep; + prep->pub.start_pass = start_pass_prep; + + /* Allocate the color conversion buffer. + * We make the buffer wide enough to allow the downsampler to edge-expand + * horizontally within the buffer, if it so chooses. + */ + if (cinfo->downsample->need_context_rows) { + /* Set up to provide context rows */ +#ifdef CONTEXT_ROWS_SUPPORTED + prep->pub.pre_process_data = pre_process_context; + create_context_buffer(cinfo); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* No context, just make it tall enough for one row group */ + prep->pub.pre_process_data = pre_process_data; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (((long) compptr->width_in_blocks * + cinfo->min_DCT_h_scaled_size * + cinfo->max_h_samp_factor) / compptr->h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jcsample.c b/thirdparty/LibJPEG/jpeg-9/jcsample.c new file mode 100644 index 0000000..4d36f85 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jcsample.c @@ -0,0 +1,545 @@ +/* + * jcsample.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains downsampling routines. + * + * Downsampling input data is counted in "row groups". A row group + * is defined to be max_v_samp_factor pixel rows of each component, + * from which the downsampler produces v_samp_factor sample rows. + * A single row group is processed in each call to the downsampler module. + * + * The downsampler is responsible for edge-expansion of its output data + * to fill an integral number of DCT blocks horizontally. The source buffer + * may be modified if it is helpful for this purpose (the source buffer is + * allocated wide enough to correspond to the desired output width). + * The caller (the prep controller) is responsible for vertical padding. + * + * The downsampler may request "context rows" by setting need_context_rows + * during startup. In this case, the input arrays will contain at least + * one row group's worth of pixels above and below the passed-in data; + * the caller will create dummy rows at image top and bottom by replicating + * the first or last real pixel row. + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + * + * The downsampling algorithm used here is a simple average of the source + * pixels covered by the output pixel. The hi-falutin sampling literature + * refers to this as a "box filter". In general the characteristics of a box + * filter are not very good, but for the specific cases we normally use (1:1 + * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not + * nearly so bad. If you intend to use other sampling ratios, you'd be well + * advised to improve this code. + * + * A simple input-smoothing capability is provided. This is mainly intended + * for cleaning up color-dithered GIF input files (if you find it inadequate, + * we suggest using an external filtering program such as pnmconvol). When + * enabled, each input pixel P is replaced by a weighted sum of itself and its + * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, + * where SF = (smoothing_factor / 1024). + * Currently, smoothing is only supported for 2h2v sampling factors. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Pointer to routine to downsample a single component */ +typedef JMETHOD(void, downsample1_ptr, + (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data)); + +/* Private subobject */ + +typedef struct { + struct jpeg_downsampler pub; /* public fields */ + + /* Downsampling method pointers, one per component */ + downsample1_ptr methods[MAX_COMPONENTS]; + + /* Height of an output row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_downsample need not + * recompute them each time. They are unused for other downsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_downsampler; + +typedef my_downsampler * my_downsample_ptr; + + +/* + * Initialize for a downsampling pass. + */ + +METHODDEF(void) +start_pass_downsample (j_compress_ptr cinfo) +{ + /* no work for now */ +} + + +/* + * Expand a component horizontally from width input_cols to width output_cols, + * by duplicating the rightmost samples. + */ + +LOCAL(void) +expand_right_edge (JSAMPARRAY image_data, int num_rows, + JDIMENSION input_cols, JDIMENSION output_cols) +{ + register JSAMPROW ptr; + register JSAMPLE pixval; + register int count; + int row; + int numcols = (int) (output_cols - input_cols); + + if (numcols > 0) { + for (row = 0; row < num_rows; row++) { + ptr = image_data[row] + input_cols; + pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ + for (count = numcols; count > 0; count--) + *ptr++ = pixval; + } + } +} + + +/* + * Do downsampling for a whole row group (all components). + * + * In this version we simply downsample each component independently. + */ + +METHODDEF(void) +sep_downsample (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) +{ + my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; + int ci; + jpeg_component_info * compptr; + JSAMPARRAY in_ptr, out_ptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + in_ptr = input_buf[ci] + in_row_index; + out_ptr = output_buf[ci] + + (out_row_group_index * downsample->rowgroup_height[ci]); + (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr); + } +} + + +/* + * Downsample pixel values of a single component. + * One row group is processed per call. + * This version handles arbitrary integral sampling ratios, without smoothing. + * Note that this version is not actually used for customary sampling ratios. + */ + +METHODDEF(void) +int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; + int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; + JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ + JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size; + JSAMPROW inptr, outptr; + INT32 outvalue; + + h_expand = downsample->h_expand[compptr->component_index]; + v_expand = downsample->v_expand[compptr->component_index]; + numpix = h_expand * v_expand; + numpix2 = numpix/2; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * h_expand); + + inrow = outrow = 0; + while (inrow < cinfo->max_v_samp_factor) { + outptr = output_data[outrow]; + for (outcol = 0, outcol_h = 0; outcol < output_cols; + outcol++, outcol_h += h_expand) { + outvalue = 0; + for (v = 0; v < v_expand; v++) { + inptr = input_data[inrow+v] + outcol_h; + for (h = 0; h < h_expand; h++) { + outvalue += (INT32) GETJSAMPLE(*inptr++); + } + } + *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); + } + inrow += v_expand; + outrow++; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * without smoothing. + */ + +METHODDEF(void) +fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + /* Copy the data */ + jcopy_sample_rows(input_data, 0, output_data, 0, + cinfo->max_v_samp_factor, cinfo->image_width); + /* Edge-expand */ + expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width, + compptr->width_in_blocks * compptr->DCT_h_scaled_size); +} + + +/* + * Downsample pixel values of a single component. + * This version handles the common case of 2:1 horizontal and 1:1 vertical, + * without smoothing. + * + * A note about the "bias" calculations: when rounding fractional values to + * integer, we do not want to always round 0.5 up to the next integer. + * If we did that, we'd introduce a noticeable bias towards larger values. + * Instead, this code is arranged so that 0.5 will be rounded up or down at + * alternate pixel locations (a simple ordered dither pattern). + */ + +METHODDEF(void) +h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size; + register JSAMPROW inptr, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + outptr = output_data[inrow]; + inptr = input_data[inrow]; + bias = 0; /* bias = 0,1,0,1,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + + bias) >> 1); + bias ^= 1; /* 0=>1, 1=>0 */ + inptr += 2; + } + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * without smoothing. + */ + +METHODDEF(void) +h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION outcol; + JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size; + register JSAMPROW inptr0, inptr1, outptr; + register int bias; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data, cinfo->max_v_samp_factor, + cinfo->image_width, output_cols * 2); + + inrow = outrow = 0; + while (inrow < cinfo->max_v_samp_factor) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + bias = 1; /* bias = 1,2,1,2,... for successive samples */ + for (outcol = 0; outcol < output_cols; outcol++) { + *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + + bias) >> 2); + bias ^= 3; /* 1=>2, 2=>1 */ + inptr0 += 2; inptr1 += 2; + } + inrow += 2; + outrow++; + } +} + + +#ifdef INPUT_SMOOTHING_SUPPORTED + +/* + * Downsample pixel values of a single component. + * This version handles the standard case of 2:1 horizontal and 2:1 vertical, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow, outrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size; + register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; + INT32 membersum, neighsum, memberscale, neighscale; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols * 2); + + /* We don't bother to form the individual "smoothed" input pixel values; + * we can directly compute the output which is the average of the four + * smoothed values. Each of the four member pixels contributes a fraction + * (1-8*SF) to its own smoothed image and a fraction SF to each of the three + * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final + * output. The four corner-adjacent neighbor pixels contribute a fraction + * SF to just one smoothed pixel, or SF/4 to the final output; while the + * eight edge-adjacent neighbors contribute SF to each of two smoothed + * pixels, or SF/2 overall. In order to use integer arithmetic, these + * factors are scaled by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ + neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ + + inrow = outrow = 0; + while (inrow < cinfo->max_v_samp_factor) { + outptr = output_data[outrow]; + inptr0 = input_data[inrow]; + inptr1 = input_data[inrow+1]; + above_ptr = input_data[inrow-1]; + below_ptr = input_data[inrow+2]; + + /* Special case for first column: pretend column -1 is same as column 0 */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); + neighsum += neighsum; + neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + /* sum of pixels directly mapped to this output element */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + /* sum of edge-neighbor pixels */ + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); + /* The edge-neighbors count twice as much as corner-neighbors */ + neighsum += neighsum; + /* Add in the corner-neighbors */ + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); + /* form final output scaled up by 2^16 */ + membersum = membersum * memberscale + neighsum * neighscale; + /* round, descale and output it */ + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); + neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + + GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + + GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); + neighsum += neighsum; + neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + + GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + inrow += 2; + outrow++; + } +} + + +/* + * Downsample pixel values of a single component. + * This version handles the special case of a full-size component, + * with smoothing. One row of context is required. + */ + +METHODDEF(void) +fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, + JSAMPARRAY input_data, JSAMPARRAY output_data) +{ + int inrow; + JDIMENSION colctr; + JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size; + register JSAMPROW inptr, above_ptr, below_ptr, outptr; + INT32 membersum, neighsum, memberscale, neighscale; + int colsum, lastcolsum, nextcolsum; + + /* Expand input data enough to let all the output samples be generated + * by the standard loop. Special-casing padded output would be more + * efficient. + */ + expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, + cinfo->image_width, output_cols); + + /* Each of the eight neighbor pixels contributes a fraction SF to the + * smoothed pixel, while the main pixel contributes (1-8*SF). In order + * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. + * Also recall that SF = smoothing_factor / 1024. + */ + + memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ + neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ + + for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { + outptr = output_data[inrow]; + inptr = input_data[inrow]; + above_ptr = input_data[inrow-1]; + below_ptr = input_data[inrow+1]; + + /* Special case for first column */ + colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + + GETJSAMPLE(*inptr); + membersum = GETJSAMPLE(*inptr++); + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = colsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + + for (colctr = output_cols - 2; colctr > 0; colctr--) { + membersum = GETJSAMPLE(*inptr++); + above_ptr++; below_ptr++; + nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + + GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + nextcolsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); + lastcolsum = colsum; colsum = nextcolsum; + } + + /* Special case for last column */ + membersum = GETJSAMPLE(*inptr); + neighsum = lastcolsum + (colsum - membersum) + colsum; + membersum = membersum * memberscale + neighsum * neighscale; + *outptr = (JSAMPLE) ((membersum + 32768) >> 16); + + } +} + +#endif /* INPUT_SMOOTHING_SUPPORTED */ + + +/* + * Module initialization routine for downsampling. + * Note that we must select a routine for each component. + */ + +GLOBAL(void) +jinit_downsampler (j_compress_ptr cinfo) +{ + my_downsample_ptr downsample; + int ci; + jpeg_component_info * compptr; + boolean smoothok = TRUE; + int h_in_group, v_in_group, h_out_group, v_out_group; + + downsample = (my_downsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_downsampler)); + cinfo->downsample = (struct jpeg_downsampler *) downsample; + downsample->pub.start_pass = start_pass_downsample; + downsample->pub.downsample = sep_downsample; + downsample->pub.need_context_rows = FALSE; + + if (cinfo->CCIR601_sampling) + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* Verify we can handle the sampling factors, and set up method pointers */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Compute size of an "output group" for DCT scaling. This many samples + * are to be converted from max_h_samp_factor * max_v_samp_factor pixels. + */ + h_out_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) / + cinfo->min_DCT_h_scaled_size; + v_out_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; + h_in_group = cinfo->max_h_samp_factor; + v_in_group = cinfo->max_v_samp_factor; + downsample->rowgroup_height[ci] = v_out_group; /* save for use later */ + if (h_in_group == h_out_group && v_in_group == v_out_group) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = fullsize_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = fullsize_downsample; + } else if (h_in_group == h_out_group * 2 && + v_in_group == v_out_group) { + smoothok = FALSE; + downsample->methods[ci] = h2v1_downsample; + } else if (h_in_group == h_out_group * 2 && + v_in_group == v_out_group * 2) { +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor) { + downsample->methods[ci] = h2v2_smooth_downsample; + downsample->pub.need_context_rows = TRUE; + } else +#endif + downsample->methods[ci] = h2v2_downsample; + } else if ((h_in_group % h_out_group) == 0 && + (v_in_group % v_out_group) == 0) { + smoothok = FALSE; + downsample->methods[ci] = int_downsample; + downsample->h_expand[ci] = (UINT8) (h_in_group / h_out_group); + downsample->v_expand[ci] = (UINT8) (v_in_group / v_out_group); + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + } + +#ifdef INPUT_SMOOTHING_SUPPORTED + if (cinfo->smoothing_factor && !smoothok) + TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); +#endif +} diff --git a/thirdparty/LibJPEG/jpeg-9/jctrans.c b/thirdparty/LibJPEG/jpeg-9/jctrans.c new file mode 100644 index 0000000..8813c3e --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jctrans.c @@ -0,0 +1,385 @@ +/* + * jctrans.c + * + * Copyright (C) 1995-1998, Thomas G. Lane. + * Modified 2000-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding compression, + * that is, writing raw DCT coefficient arrays to an output JPEG file. + * The routines in jcapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Forward declarations */ +LOCAL(void) transencode_master_selection + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); +LOCAL(void) transencode_coef_controller + JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); + + +/* + * Compression initialization for writing raw-coefficient data. + * Before calling this, all parameters and a data destination must be set up. + * Call jpeg_finish_compress() to actually write the data. + * + * The number of passed virtual arrays must match cinfo->num_components. + * Note that the virtual arrays need not be filled or even realized at + * the time write_coefficients is called; indeed, if the virtual arrays + * were requested from this compression object's memory manager, they + * typically will be realized during this routine and filled afterwards. + */ + +GLOBAL(void) +jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) +{ + if (cinfo->global_state != CSTATE_START) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Mark all tables to be written */ + jpeg_suppress_tables(cinfo, FALSE); + /* (Re)initialize error mgr and destination modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->dest->init_destination) (cinfo); + /* Perform master selection of active modules */ + transencode_master_selection(cinfo, coef_arrays); + /* Wait for jpeg_finish_compress() call */ + cinfo->next_scanline = 0; /* so jpeg_write_marker works */ + cinfo->global_state = CSTATE_WRCOEFS; +} + + +/* + * Initialize the compression object with default parameters, + * then copy from the source object all parameters needed for lossless + * transcoding. Parameters that can be varied without loss (such as + * scan script and Huffman optimization) are left in their default states. + */ + +GLOBAL(void) +jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo) +{ + JQUANT_TBL ** qtblptr; + jpeg_component_info *incomp, *outcomp; + JQUANT_TBL *c_quant, *slot_quant; + int tblno, ci, coefi; + + /* Safety check to ensure start_compress not called yet. */ + if (dstinfo->global_state != CSTATE_START) + ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state); + /* Copy fundamental image dimensions */ + dstinfo->image_width = srcinfo->image_width; + dstinfo->image_height = srcinfo->image_height; + dstinfo->input_components = srcinfo->num_components; + dstinfo->in_color_space = srcinfo->jpeg_color_space; + dstinfo->jpeg_width = srcinfo->output_width; + dstinfo->jpeg_height = srcinfo->output_height; + dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size; + dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size; + /* Initialize all parameters to default values */ + jpeg_set_defaults(dstinfo); + /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. + * Fix it to get the right header markers for the image colorspace. + * Note: Entropy table assignment in jpeg_set_colorspace depends + * on color_transform. + */ + dstinfo->color_transform = srcinfo->color_transform; + jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); + dstinfo->data_precision = srcinfo->data_precision; + dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; + /* Copy the source's quantization tables. */ + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + if (srcinfo->quant_tbl_ptrs[tblno] != NULL) { + qtblptr = & dstinfo->quant_tbl_ptrs[tblno]; + if (*qtblptr == NULL) + *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo); + MEMCOPY((*qtblptr)->quantval, + srcinfo->quant_tbl_ptrs[tblno]->quantval, + SIZEOF((*qtblptr)->quantval)); + (*qtblptr)->sent_table = FALSE; + } + } + /* Copy the source's per-component info. + * Note we assume jpeg_set_defaults has allocated the dest comp_info array. + */ + dstinfo->num_components = srcinfo->num_components; + if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS) + ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components, + MAX_COMPONENTS); + for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info; + ci < dstinfo->num_components; ci++, incomp++, outcomp++) { + outcomp->component_id = incomp->component_id; + outcomp->h_samp_factor = incomp->h_samp_factor; + outcomp->v_samp_factor = incomp->v_samp_factor; + outcomp->quant_tbl_no = incomp->quant_tbl_no; + /* Make sure saved quantization table for component matches the qtable + * slot. If not, the input file re-used this qtable slot. + * IJG encoder currently cannot duplicate this. + */ + tblno = outcomp->quant_tbl_no; + if (tblno < 0 || tblno >= NUM_QUANT_TBLS || + srcinfo->quant_tbl_ptrs[tblno] == NULL) + ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno); + slot_quant = srcinfo->quant_tbl_ptrs[tblno]; + c_quant = incomp->quant_table; + if (c_quant != NULL) { + for (coefi = 0; coefi < DCTSIZE2; coefi++) { + if (c_quant->quantval[coefi] != slot_quant->quantval[coefi]) + ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); + } + } + /* Note: we do not copy the source's entropy table assignments; + * instead we rely on jpeg_set_colorspace to have made a suitable choice. + */ + } + /* Also copy JFIF version and resolution information, if available. + * Strictly speaking this isn't "critical" info, but it's nearly + * always appropriate to copy it if available. In particular, + * if the application chooses to copy JFIF 1.02 extension markers from + * the source file, we need to copy the version to make sure we don't + * emit a file that has 1.02 extensions but a claimed version of 1.01. + * We will *not*, however, copy version info from mislabeled "2.01" files. + */ + if (srcinfo->saw_JFIF_marker) { + if (srcinfo->JFIF_major_version == 1) { + dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; + dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; + } + dstinfo->density_unit = srcinfo->density_unit; + dstinfo->X_density = srcinfo->X_density; + dstinfo->Y_density = srcinfo->Y_density; + } +} + + +/* + * Master selection of compression modules for transcoding. + * This substitutes for jcinit.c's initialization of the full compressor. + */ + +LOCAL(void) +transencode_master_selection (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + /* Initialize master control (includes parameter checking/processing) */ + jinit_c_master_control(cinfo, TRUE /* transcode only */); + + /* Entropy encoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) + jinit_arith_encoder(cinfo); + else { + jinit_huff_encoder(cinfo); + } + + /* We need a special coefficient buffer controller. */ + transencode_coef_controller(cinfo, coef_arrays); + + jinit_marker_writer(cinfo); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Write the datastream header (SOI, JFIF) immediately. + * Frame and scan headers are postponed till later. + * This lets application insert special markers after the SOI. + */ + (*cinfo->marker->write_file_header) (cinfo); +} + + +/* + * The rest of this file is a special implementation of the coefficient + * buffer controller. This is similar to jccoefct.c, but it handles only + * output from presupplied virtual arrays. Furthermore, we generate any + * dummy padding blocks on-the-fly rather than expecting them to be present + * in the arrays. + */ + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_c_coef_controller pub; /* public fields */ + + JDIMENSION iMCU_row_num; /* iMCU row # within image */ + JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* Virtual block array for each component. */ + jvirt_barray_ptr * whole_image; + + /* Workspace for constructing dummy blocks at right/bottom edges. */ + JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU]; +} my_coef_controller; + +typedef my_coef_controller * my_coef_ptr; + + +LOCAL(void) +start_iMCU_row (j_compress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row */ +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->mcu_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + if (pass_mode != JBUF_CRANK_DEST) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + coef->iMCU_row_num = 0; + start_iMCU_row(cinfo); +} + + +/* + * Process some data. + * We process the equivalent of one fully interleaved MCU row ("iMCU" row) + * per call, ie, v_samp_factor block rows for each component in the scan. + * The data is obtained from the virtual arrays and fed to the entropy coder. + * Returns TRUE if the iMCU row is completed, FALSE if suspended. + * + * NB: input_buf is ignored; it is likely to be a NULL pointer. + */ + +METHODDEF(boolean) +compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, blockcnt; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + coef->iMCU_row_num * compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * compptr->MCU_width; + blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (coef->iMCU_row_num < last_iMCU_row || + yindex+yoffset < compptr->last_row_height) { + /* Fill in pointers to real blocks in this row */ + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < blockcnt; xindex++) + MCU_buffer[blkn++] = buffer_ptr++; + } else { + /* At bottom of image, need a whole row of dummy blocks */ + xindex = 0; + } + /* Fill in any dummy blocks needed in this row. + * Dummy blocks are filled in the same way as in jccoefct.c: + * all zeroes in the AC entries, DC entries equal to previous + * block's DC value. The init routine has already zeroed the + * AC entries, so we need only set the DC entries correctly. + */ + for (; xindex < compptr->MCU_width; xindex++) { + MCU_buffer[blkn] = coef->dummy_buffer[blkn]; + MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; + blkn++; + } + } + } + /* Try to write the MCU. */ + if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->mcu_ctr = MCU_col_num; + return FALSE; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->mcu_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + coef->iMCU_row_num++; + start_iMCU_row(cinfo); + return TRUE; +} + + +/* + * Initialize coefficient buffer controller. + * + * Each passed coefficient array must be the right size for that + * coefficient: width_in_blocks wide and height_in_blocks high, + * with unitheight at least v_samp_factor. + */ + +LOCAL(void) +transencode_coef_controller (j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays) +{ + my_coef_ptr coef; + JBLOCKROW buffer; + int i; + + coef = (my_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_coef_controller)); + cinfo->coef = &coef->pub; + coef->pub.start_pass = start_pass_coef; + coef->pub.compress_data = compress_output; + + /* Save pointer to virtual arrays */ + coef->whole_image = coef_arrays; + + /* Allocate and pre-zero space for dummy DCT blocks. */ + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); + FMEMZERO((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) { + coef->dummy_buffer[i] = buffer + i; + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdapimin.c b/thirdparty/LibJPEG/jpeg-9/jdapimin.c new file mode 100644 index 0000000..7f1ce4c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdapimin.c @@ -0,0 +1,396 @@ +/* + * jdapimin.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * Modified 2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "minimum" API routines that may be + * needed in either the normal full-decompression case or the + * transcoding-only case. + * + * Most of the routines intended to be called directly by an application + * are in this file or in jdapistd.c. But also see jcomapi.c for routines + * shared by compression and decompression, and jdtrans.c for the transcoding + * case. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * Initialization of a JPEG decompression object. + * The error manager must already be set up (in case memory manager fails). + */ + +GLOBAL(void) +jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) +{ + int i; + + /* Guard against version mismatches between library and caller. */ + cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ + if (version != JPEG_LIB_VERSION) + ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); + if (structsize != SIZEOF(struct jpeg_decompress_struct)) + ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, + (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); + + /* For debugging purposes, we zero the whole master structure. + * But the application has already set the err pointer, and may have set + * client_data, so we have to save and restore those fields. + * Note: if application hasn't set client_data, tools like Purify may + * complain here. + */ + { + struct jpeg_error_mgr * err = cinfo->err; + void * client_data = cinfo->client_data; /* ignore Purify complaint here */ + MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); + cinfo->err = err; + cinfo->client_data = client_data; + } + cinfo->is_decompressor = TRUE; + + /* Initialize a memory manager instance for this object */ + jinit_memory_mgr((j_common_ptr) cinfo); + + /* Zero out pointers to permanent structures. */ + cinfo->progress = NULL; + cinfo->src = NULL; + + for (i = 0; i < NUM_QUANT_TBLS; i++) + cinfo->quant_tbl_ptrs[i] = NULL; + + for (i = 0; i < NUM_HUFF_TBLS; i++) { + cinfo->dc_huff_tbl_ptrs[i] = NULL; + cinfo->ac_huff_tbl_ptrs[i] = NULL; + } + + /* Initialize marker processor so application can override methods + * for COM, APPn markers before calling jpeg_read_header. + */ + cinfo->marker_list = NULL; + jinit_marker_reader(cinfo); + + /* And initialize the overall input controller. */ + jinit_input_controller(cinfo); + + /* OK, I'm ready */ + cinfo->global_state = DSTATE_START; +} + + +/* + * Destruction of a JPEG decompression object + */ + +GLOBAL(void) +jpeg_destroy_decompress (j_decompress_ptr cinfo) +{ + jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Abort processing of a JPEG decompression operation, + * but don't destroy the object itself. + */ + +GLOBAL(void) +jpeg_abort_decompress (j_decompress_ptr cinfo) +{ + jpeg_abort((j_common_ptr) cinfo); /* use common routine */ +} + + +/* + * Set default decompression parameters. + */ + +LOCAL(void) +default_decompress_parms (j_decompress_ptr cinfo) +{ + /* Guess the input colorspace, and set output colorspace accordingly. */ + /* (Wish JPEG committee had provided a real way to specify this...) */ + /* Note application may override our guesses. */ + switch (cinfo->num_components) { + case 1: + cinfo->jpeg_color_space = JCS_GRAYSCALE; + cinfo->out_color_space = JCS_GRAYSCALE; + break; + + case 3: + if (cinfo->saw_JFIF_marker) { + cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ + } else if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_RGB; + break; + case 1: + cinfo->jpeg_color_space = JCS_YCbCr; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + break; + } + } else { + /* Saw no special markers, try to guess from the component IDs */ + int cid0 = cinfo->comp_info[0].component_id; + int cid1 = cinfo->comp_info[1].component_id; + int cid2 = cinfo->comp_info[2].component_id; + + if (cid0 == 1 && cid1 == 2 && cid2 == 3) + cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ + else if (cid0 == 82 && cid1 == 71 && cid2 == 66) + cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ + else { + TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); + cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ + } + } + /* Always guess RGB is proper output colorspace. */ + cinfo->out_color_space = JCS_RGB; + break; + + case 4: + if (cinfo->saw_Adobe_marker) { + switch (cinfo->Adobe_transform) { + case 0: + cinfo->jpeg_color_space = JCS_CMYK; + break; + case 2: + cinfo->jpeg_color_space = JCS_YCCK; + break; + default: + WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); + cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ + break; + } + } else { + /* No special markers, assume straight CMYK. */ + cinfo->jpeg_color_space = JCS_CMYK; + } + cinfo->out_color_space = JCS_CMYK; + break; + + default: + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->out_color_space = JCS_UNKNOWN; + break; + } + + /* Set defaults for other decompression parameters. */ + cinfo->scale_num = cinfo->block_size; /* 1:1 scaling */ + cinfo->scale_denom = cinfo->block_size; + cinfo->output_gamma = 1.0; + cinfo->buffered_image = FALSE; + cinfo->raw_data_out = FALSE; + cinfo->dct_method = JDCT_DEFAULT; + cinfo->do_fancy_upsampling = TRUE; + cinfo->do_block_smoothing = TRUE; + cinfo->quantize_colors = FALSE; + /* We set these in case application only sets quantize_colors. */ + cinfo->dither_mode = JDITHER_FS; +#ifdef QUANT_2PASS_SUPPORTED + cinfo->two_pass_quantize = TRUE; +#else + cinfo->two_pass_quantize = FALSE; +#endif + cinfo->desired_number_of_colors = 256; + cinfo->colormap = NULL; + /* Initialize for no mode change in buffered-image mode. */ + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; +} + + +/* + * Decompression startup: read start of JPEG datastream to see what's there. + * Need only initialize JPEG object and supply a data source before calling. + * + * This routine will read as far as the first SOS marker (ie, actual start of + * compressed data), and will save all tables and parameters in the JPEG + * object. It will also initialize the decompression parameters to default + * values, and finally return JPEG_HEADER_OK. On return, the application may + * adjust the decompression parameters and then call jpeg_start_decompress. + * (Or, if the application only wanted to determine the image parameters, + * the data need not be decompressed. In that case, call jpeg_abort or + * jpeg_destroy to release any temporary space.) + * If an abbreviated (tables only) datastream is presented, the routine will + * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then + * re-use the JPEG object to read the abbreviated image datastream(s). + * It is unnecessary (but OK) to call jpeg_abort in this case. + * The JPEG_SUSPENDED return code only occurs if the data source module + * requests suspension of the decompressor. In this case the application + * should load more source data and then re-call jpeg_read_header to resume + * processing. + * If a non-suspending data source is used and require_image is TRUE, then the + * return code need not be inspected since only JPEG_HEADER_OK is possible. + * + * This routine is now just a front end to jpeg_consume_input, with some + * extra error checking. + */ + +GLOBAL(int) +jpeg_read_header (j_decompress_ptr cinfo, boolean require_image) +{ + int retcode; + + if (cinfo->global_state != DSTATE_START && + cinfo->global_state != DSTATE_INHEADER) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + retcode = jpeg_consume_input(cinfo); + + switch (retcode) { + case JPEG_REACHED_SOS: + retcode = JPEG_HEADER_OK; + break; + case JPEG_REACHED_EOI: + if (require_image) /* Complain if application wanted an image */ + ERREXIT(cinfo, JERR_NO_IMAGE); + /* Reset to start state; it would be safer to require the application to + * call jpeg_abort, but we can't change it now for compatibility reasons. + * A side effect is to free any temporary memory (there shouldn't be any). + */ + jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ + retcode = JPEG_HEADER_TABLES_ONLY; + break; + case JPEG_SUSPENDED: + /* no work */ + break; + } + + return retcode; +} + + +/* + * Consume data in advance of what the decompressor requires. + * This can be called at any time once the decompressor object has + * been created and a data source has been set up. + * + * This routine is essentially a state machine that handles a couple + * of critical state-transition actions, namely initial setup and + * transition from header scanning to ready-for-start_decompress. + * All the actual input is done via the input controller's consume_input + * method. + */ + +GLOBAL(int) +jpeg_consume_input (j_decompress_ptr cinfo) +{ + int retcode = JPEG_SUSPENDED; + + /* NB: every possible DSTATE value should be listed in this switch */ + switch (cinfo->global_state) { + case DSTATE_START: + /* Start-of-datastream actions: reset appropriate modules */ + (*cinfo->inputctl->reset_input_controller) (cinfo); + /* Initialize application's data source module */ + (*cinfo->src->init_source) (cinfo); + cinfo->global_state = DSTATE_INHEADER; + /*FALLTHROUGH*/ + case DSTATE_INHEADER: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ + /* Set up default parameters based on header data */ + default_decompress_parms(cinfo); + /* Set global state: ready for start_decompress */ + cinfo->global_state = DSTATE_READY; + } + break; + case DSTATE_READY: + /* Can't advance past first SOS until start_decompress is called */ + retcode = JPEG_REACHED_SOS; + break; + case DSTATE_PRELOAD: + case DSTATE_PRESCAN: + case DSTATE_SCANNING: + case DSTATE_RAW_OK: + case DSTATE_BUFIMAGE: + case DSTATE_BUFPOST: + case DSTATE_STOPPING: + retcode = (*cinfo->inputctl->consume_input) (cinfo); + break; + default: + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + return retcode; +} + + +/* + * Have we finished reading the input file? + */ + +GLOBAL(boolean) +jpeg_input_complete (j_decompress_ptr cinfo) +{ + /* Check for valid jpeg object */ + if (cinfo->global_state < DSTATE_START || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->eoi_reached; +} + + +/* + * Is there more than one scan? + */ + +GLOBAL(boolean) +jpeg_has_multiple_scans (j_decompress_ptr cinfo) +{ + /* Only valid after jpeg_read_header completes */ + if (cinfo->global_state < DSTATE_READY || + cinfo->global_state > DSTATE_STOPPING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return cinfo->inputctl->has_multiple_scans; +} + + +/* + * Finish JPEG decompression. + * + * This will normally just verify the file trailer and release temp storage. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_decompress (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { + /* Terminate final pass of non-buffered mode */ + if (cinfo->output_scanline < cinfo->output_height) + ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state == DSTATE_BUFIMAGE) { + /* Finishing after a buffered-image operation */ + cinfo->global_state = DSTATE_STOPPING; + } else if (cinfo->global_state != DSTATE_STOPPING) { + /* STOPPING = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read until EOI */ + while (! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + /* Do final cleanup */ + (*cinfo->src->term_source) (cinfo); + /* We can use jpeg_abort to release memory and reset global_state */ + jpeg_abort((j_common_ptr) cinfo); + return TRUE; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdapistd.c b/thirdparty/LibJPEG/jpeg-9/jdapistd.c new file mode 100644 index 0000000..9d74537 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdapistd.c @@ -0,0 +1,275 @@ +/* + * jdapistd.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains application interface code for the decompression half + * of the JPEG library. These are the "standard" API routines that are + * used in the normal full-decompression case. They are not used by a + * transcoding-only application. Note that if an application links in + * jpeg_start_decompress, it will end up linking in the entire decompressor. + * We thus must separate this file from jdapimin.c to avoid linking the + * whole decompression library into a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Forward declarations */ +LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); + + +/* + * Decompression initialization. + * jpeg_read_header must be completed before calling this. + * + * If a multipass operating mode was selected, this will do all but the + * last pass, and thus may take a great deal of time. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_start_decompress (j_decompress_ptr cinfo) +{ + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize master control, select active modules */ + jinit_master_decompress(cinfo); + if (cinfo->buffered_image) { + /* No more work here; expecting jpeg_start_output next */ + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; + } + cinfo->global_state = DSTATE_PRELOAD; + } + if (cinfo->global_state == DSTATE_PRELOAD) { + /* If file has multiple scans, absorb them all into the coef buffer */ + if (cinfo->inputctl->has_multiple_scans) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return FALSE; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* jdmaster underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + } + cinfo->output_scan_number = cinfo->input_scan_number; + } else if (cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Perform any dummy output passes, and set up for the final pass */ + return output_pass_setup(cinfo); +} + + +/* + * Set up for an output pass, and perform any dummy pass(es) needed. + * Common subroutine for jpeg_start_decompress and jpeg_start_output. + * Entry: global_state = DSTATE_PRESCAN only if previously suspended. + * Exit: If done, returns TRUE and sets global_state for proper output mode. + * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. + */ + +LOCAL(boolean) +output_pass_setup (j_decompress_ptr cinfo) +{ + if (cinfo->global_state != DSTATE_PRESCAN) { + /* First call: do pass setup */ + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; + cinfo->global_state = DSTATE_PRESCAN; + } + /* Loop over any required dummy passes */ + while (cinfo->master->is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Crank through the dummy pass */ + while (cinfo->output_scanline < cinfo->output_height) { + JDIMENSION last_scanline; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + /* Process some data */ + last_scanline = cinfo->output_scanline; + (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, + &cinfo->output_scanline, (JDIMENSION) 0); + if (cinfo->output_scanline == last_scanline) + return FALSE; /* No progress made, must suspend */ + } + /* Finish up dummy pass, and set up for another one */ + (*cinfo->master->finish_output_pass) (cinfo); + (*cinfo->master->prepare_for_output_pass) (cinfo); + cinfo->output_scanline = 0; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } + /* Ready for application to drive output pass through + * jpeg_read_scanlines or jpeg_read_raw_data. + */ + cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; + return TRUE; +} + + +/* + * Read some scanlines of data from the JPEG decompressor. + * + * The return value will be the number of lines actually read. + * This may be less than the number requested in several cases, + * including bottom of image, data source suspension, and operating + * modes that emit multiple scanlines at a time. + * + * Note: we warn about excess calls to jpeg_read_scanlines() since + * this likely signals an application programmer error. However, + * an oversize buffer (max_lines > scanlines remaining) is not an error. + */ + +GLOBAL(JDIMENSION) +jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, + JDIMENSION max_lines) +{ + JDIMENSION row_ctr; + + if (cinfo->global_state != DSTATE_SCANNING) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Process some data */ + row_ctr = 0; + (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); + cinfo->output_scanline += row_ctr; + return row_ctr; +} + + +/* + * Alternate entry point to read raw data. + * Processes exactly one iMCU row per call, unless suspended. + */ + +GLOBAL(JDIMENSION) +jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, + JDIMENSION max_lines) +{ + JDIMENSION lines_per_iMCU_row; + + if (cinfo->global_state != DSTATE_RAW_OK) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + if (cinfo->output_scanline >= cinfo->output_height) { + WARNMS(cinfo, JWRN_TOO_MUCH_DATA); + return 0; + } + + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) { + cinfo->progress->pass_counter = (long) cinfo->output_scanline; + cinfo->progress->pass_limit = (long) cinfo->output_height; + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + } + + /* Verify that at least one iMCU row can be returned. */ + lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size; + if (max_lines < lines_per_iMCU_row) + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* Decompress directly into user's buffer. */ + if (! (*cinfo->coef->decompress_data) (cinfo, data)) + return 0; /* suspension forced, can do nothing more */ + + /* OK, we processed one iMCU row. */ + cinfo->output_scanline += lines_per_iMCU_row; + return lines_per_iMCU_row; +} + + +/* Additional entry points for buffered-image mode. */ + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Initialize for an output pass in buffered-image mode. + */ + +GLOBAL(boolean) +jpeg_start_output (j_decompress_ptr cinfo, int scan_number) +{ + if (cinfo->global_state != DSTATE_BUFIMAGE && + cinfo->global_state != DSTATE_PRESCAN) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + /* Limit scan number to valid range */ + if (scan_number <= 0) + scan_number = 1; + if (cinfo->inputctl->eoi_reached && + scan_number > cinfo->input_scan_number) + scan_number = cinfo->input_scan_number; + cinfo->output_scan_number = scan_number; + /* Perform any dummy output passes, and set up for the real pass */ + return output_pass_setup(cinfo); +} + + +/* + * Finish up after an output pass in buffered-image mode. + * + * Returns FALSE if suspended. The return value need be inspected only if + * a suspending data source is used. + */ + +GLOBAL(boolean) +jpeg_finish_output (j_decompress_ptr cinfo) +{ + if ((cinfo->global_state == DSTATE_SCANNING || + cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { + /* Terminate this pass. */ + /* We do not require the whole pass to have been completed. */ + (*cinfo->master->finish_output_pass) (cinfo); + cinfo->global_state = DSTATE_BUFPOST; + } else if (cinfo->global_state != DSTATE_BUFPOST) { + /* BUFPOST = repeat call after a suspension, anything else is error */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + } + /* Read markers looking for SOS or EOI */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) + return FALSE; /* Suspend, come back later */ + } + cinfo->global_state = DSTATE_BUFIMAGE; + return TRUE; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jdarith.c b/thirdparty/LibJPEG/jpeg-9/jdarith.c new file mode 100644 index 0000000..6e32d23 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdarith.c @@ -0,0 +1,782 @@ +/* + * jdarith.c + * + * Developed 1997-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains portable arithmetic entropy decoding routines for JPEG + * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81). + * + * Both sequential and progressive modes are supported in this single module. + * + * Suspension is not currently supported in this module. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Expanded entropy decoder object for arithmetic decoding. */ + +typedef struct { + struct jpeg_entropy_decoder pub; /* public fields */ + + INT32 c; /* C register, base of coding interval + input bit buffer */ + INT32 a; /* A register, normalized size of coding interval */ + int ct; /* bit shift counter, # of bits left in bit buffer part of C */ + /* init: ct = -16 */ + /* run: ct = 0..7 */ + /* error: ct = -1 */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ + int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */ + + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Pointers to statistics areas (these workspaces have image lifespan) */ + unsigned char * dc_stats[NUM_ARITH_TBLS]; + unsigned char * ac_stats[NUM_ARITH_TBLS]; + + /* Statistics bin for coding with fixed probability 0.5 */ + unsigned char fixed_bin[4]; +} arith_entropy_decoder; + +typedef arith_entropy_decoder * arith_entropy_ptr; + +/* The following two definitions specify the allocation chunk size + * for the statistics area. + * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least + * 49 statistics bins for DC, and 245 statistics bins for AC coding. + * + * We use a compact representation with 1 byte per statistics bin, + * thus the numbers directly represent byte sizes. + * This 1 byte per statistics bin contains the meaning of the MPS + * (more probable symbol) in the highest bit (mask 0x80), and the + * index into the probability estimation state machine table + * in the lower bits (mask 0x7F). + */ + +#define DC_STAT_BINS 64 +#define AC_STAT_BINS 256 + + +LOCAL(int) +get_byte (j_decompress_ptr cinfo) +/* Read next input byte; we do not support suspension in this module. */ +{ + struct jpeg_source_mgr * src = cinfo->src; + + if (src->bytes_in_buffer == 0) + if (! (*src->fill_input_buffer) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + src->bytes_in_buffer--; + return GETJOCTET(*src->next_input_byte++); +} + + +/* + * The core arithmetic decoding routine (common in JPEG and JBIG). + * This needs to go as fast as possible. + * Machine-dependent optimization facilities + * are not utilized in this portable implementation. + * However, this code should be fairly efficient and + * may be a good base for further optimizations anyway. + * + * Return value is 0 or 1 (binary decision). + * + * Note: I've changed the handling of the code base & bit + * buffer register C compared to other implementations + * based on the standards layout & procedures. + * While it also contains both the actual base of the + * coding interval (16 bits) and the next-bits buffer, + * the cut-point between these two parts is floating + * (instead of fixed) with the bit shift counter CT. + * Thus, we also need only one (variable instead of + * fixed size) shift for the LPS/MPS decision, and + * we can get away with any renormalization update + * of C (except for new data insertion, of course). + * + * I've also introduced a new scheme for accessing + * the probability estimation state machine table, + * derived from Markus Kuhn's JBIG implementation. + */ + +LOCAL(int) +arith_decode (j_decompress_ptr cinfo, unsigned char *st) +{ + register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy; + register unsigned char nl, nm; + register INT32 qe, temp; + register int sv, data; + + /* Renormalization & data input per section D.2.6 */ + while (e->a < 0x8000L) { + if (--e->ct < 0) { + /* Need to fetch next data byte */ + if (cinfo->unread_marker) + data = 0; /* stuff zero data */ + else { + data = get_byte(cinfo); /* read next input byte */ + if (data == 0xFF) { /* zero stuff or marker code */ + do data = get_byte(cinfo); + while (data == 0xFF); /* swallow extra 0xFF bytes */ + if (data == 0) + data = 0xFF; /* discard stuffed zero byte */ + else { + /* Note: Different from the Huffman decoder, hitting + * a marker while processing the compressed data + * segment is legal in arithmetic coding. + * The convention is to supply zero data + * then until decoding is complete. + */ + cinfo->unread_marker = data; + data = 0; + } + } + } + e->c = (e->c << 8) | data; /* insert data into C register */ + if ((e->ct += 8) < 0) /* update bit shift counter */ + /* Need more initial bytes */ + if (++e->ct == 0) + /* Got 2 initial bytes -> re-init A and exit loop */ + e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */ + } + e->a <<= 1; + } + + /* Fetch values from our compact representation of Table D.3(D.2): + * Qe values and probability estimation state machine + */ + sv = *st; + qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */ + nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */ + nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */ + + /* Decode & estimation procedures per sections D.2.4 & D.2.5 */ + temp = e->a - qe; + e->a = temp; + temp <<= e->ct; + if (e->c >= temp) { + e->c -= temp; + /* Conditional LPS (less probable symbol) exchange */ + if (e->a < qe) { + e->a = qe; + *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */ + } else { + e->a = qe; + *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */ + sv ^= 0x80; /* Exchange LPS/MPS */ + } + } else if (e->a < 0x8000L) { + /* Conditional MPS (more probable symbol) exchange */ + if (e->a < qe) { + *st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */ + sv ^= 0x80; /* Exchange LPS/MPS */ + } else { + *st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */ + } + } + + return sv >> 7; +} + + +/* + * Check for a restart marker & resynchronize decoder. + */ + +LOCAL(void) +process_restart (j_decompress_ptr cinfo) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + int ci; + jpeg_component_info * compptr; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + ERREXIT(cinfo, JERR_CANT_SUSPEND); + + /* Re-initialize statistics areas */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { + MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS); + /* Reset DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + entropy->dc_context[ci] = 0; + } + if ((! cinfo->progressive_mode && cinfo->lim_Se) || + (cinfo->progressive_mode && cinfo->Ss)) { + MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS); + } + } + + /* Reset arithmetic decoding variables */ + entropy->c = 0; + entropy->a = 0; + entropy->ct = -16; /* force reading 2 initial bytes to fill C */ + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Arithmetic MCU decoding. + * Each of these routines decodes and returns one MCU's worth of + * arithmetic-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. + */ + +/* + * MCU decoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + unsigned char *st; + int blkn, ci, tbl, sign; + int v, m; + + /* Process restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + process_restart(cinfo); + entropy->restarts_to_go--; + } + + if (entropy->ct == -1) return TRUE; /* if error do nothing */ + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + tbl = cinfo->cur_comp_info[ci]->dc_tbl_no; + + /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */ + + /* Table F.4: Point to statistics bin S0 for DC coefficient coding */ + st = entropy->dc_stats[tbl] + entropy->dc_context[ci]; + + /* Figure F.19: Decode_DC_DIFF */ + if (arith_decode(cinfo, st) == 0) + entropy->dc_context[ci] = 0; + else { + /* Figure F.21: Decoding nonzero value v */ + /* Figure F.22: Decoding the sign of v */ + sign = arith_decode(cinfo, st + 1); + st += 2; st += sign; + /* Figure F.23: Decoding the magnitude category of v */ + if ((m = arith_decode(cinfo, st)) != 0) { + st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ + while (arith_decode(cinfo, st)) { + if ((m <<= 1) == 0x8000) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* magnitude overflow */ + return TRUE; + } + st += 1; + } + } + /* Section F.1.4.4.1.2: Establish dc_context conditioning category */ + if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1)) + entropy->dc_context[ci] = 0; /* zero diff category */ + else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1)) + entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */ + else + entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */ + v = m; + /* Figure F.24: Decoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + if (arith_decode(cinfo, st)) v |= m; + v += 1; if (sign) v = -v; + entropy->last_dc_val[ci] += v; + } + + /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */ + (*block)[0] = (JCOEF) (entropy->last_dc_val[ci] << cinfo->Al); + } + + return TRUE; +} + + +/* + * MCU decoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + unsigned char *st; + int tbl, sign, k; + int v, m; + const int * natural_order; + + /* Process restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + process_restart(cinfo); + entropy->restarts_to_go--; + } + + if (entropy->ct == -1) return TRUE; /* if error do nothing */ + + natural_order = cinfo->natural_order; + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = cinfo->cur_comp_info[0]->ac_tbl_no; + + /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */ + + /* Figure F.20: Decode_AC_coefficients */ + k = cinfo->Ss - 1; + do { + st = entropy->ac_stats[tbl] + 3 * k; + if (arith_decode(cinfo, st)) break; /* EOB flag */ + for (;;) { + k++; + if (arith_decode(cinfo, st + 1)) break; + st += 3; + if (k >= cinfo->Se) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* spectral overflow */ + return TRUE; + } + } + /* Figure F.21: Decoding nonzero value v */ + /* Figure F.22: Decoding the sign of v */ + sign = arith_decode(cinfo, entropy->fixed_bin); + st += 2; + /* Figure F.23: Decoding the magnitude category of v */ + if ((m = arith_decode(cinfo, st)) != 0) { + if (arith_decode(cinfo, st)) { + m <<= 1; + st = entropy->ac_stats[tbl] + + (k <= cinfo->arith_ac_K[tbl] ? 189 : 217); + while (arith_decode(cinfo, st)) { + if ((m <<= 1) == 0x8000) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* magnitude overflow */ + return TRUE; + } + st += 1; + } + } + } + v = m; + /* Figure F.24: Decoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + if (arith_decode(cinfo, st)) v |= m; + v += 1; if (sign) v = -v; + /* Scale and output coefficient in natural (dezigzagged) order */ + (*block)[natural_order[k]] = (JCOEF) (v << cinfo->Al); + } while (k < cinfo->Se); + + return TRUE; +} + + +/* + * MCU decoding for DC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + unsigned char *st; + int p1, blkn; + + /* Process restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + process_restart(cinfo); + entropy->restarts_to_go--; + } + + st = entropy->fixed_bin; /* use fixed probability estimation */ + p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + /* Encoded data is simply the next bit of the two's-complement DC value */ + if (arith_decode(cinfo, st)) + MCU_data[blkn][0][0] |= p1; + } + + return TRUE; +} + + +/* + * MCU decoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + JBLOCKROW block; + JCOEFPTR thiscoef; + unsigned char *st; + int tbl, k, kex; + int p1, m1; + const int * natural_order; + + /* Process restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + process_restart(cinfo); + entropy->restarts_to_go--; + } + + if (entropy->ct == -1) return TRUE; /* if error do nothing */ + + natural_order = cinfo->natural_order; + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = cinfo->cur_comp_info[0]->ac_tbl_no; + + p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ + + /* Establish EOBx (previous stage end-of-block) index */ + kex = cinfo->Se; + do { + if ((*block)[natural_order[kex]]) break; + } while (--kex); + + k = cinfo->Ss - 1; + do { + st = entropy->ac_stats[tbl] + 3 * k; + if (k >= kex) + if (arith_decode(cinfo, st)) break; /* EOB flag */ + for (;;) { + thiscoef = *block + natural_order[++k]; + if (*thiscoef) { /* previously nonzero coef */ + if (arith_decode(cinfo, st + 2)) { + if (*thiscoef < 0) + *thiscoef += m1; + else + *thiscoef += p1; + } + break; + } + if (arith_decode(cinfo, st + 1)) { /* newly nonzero coef */ + if (arith_decode(cinfo, entropy->fixed_bin)) + *thiscoef = m1; + else + *thiscoef = p1; + break; + } + st += 3; + if (k >= cinfo->Se) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* spectral overflow */ + return TRUE; + } + } + } while (k < cinfo->Se); + + return TRUE; +} + + +/* + * Decode one MCU's worth of arithmetic-compressed coefficients. + */ + +METHODDEF(boolean) +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + jpeg_component_info * compptr; + JBLOCKROW block; + unsigned char *st; + int blkn, ci, tbl, sign, k; + int v, m; + const int * natural_order; + + /* Process restart marker if needed */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + process_restart(cinfo); + entropy->restarts_to_go--; + } + + if (entropy->ct == -1) return TRUE; /* if error do nothing */ + + natural_order = cinfo->natural_order; + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + + /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */ + + tbl = compptr->dc_tbl_no; + + /* Table F.4: Point to statistics bin S0 for DC coefficient coding */ + st = entropy->dc_stats[tbl] + entropy->dc_context[ci]; + + /* Figure F.19: Decode_DC_DIFF */ + if (arith_decode(cinfo, st) == 0) + entropy->dc_context[ci] = 0; + else { + /* Figure F.21: Decoding nonzero value v */ + /* Figure F.22: Decoding the sign of v */ + sign = arith_decode(cinfo, st + 1); + st += 2; st += sign; + /* Figure F.23: Decoding the magnitude category of v */ + if ((m = arith_decode(cinfo, st)) != 0) { + st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */ + while (arith_decode(cinfo, st)) { + if ((m <<= 1) == 0x8000) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* magnitude overflow */ + return TRUE; + } + st += 1; + } + } + /* Section F.1.4.4.1.2: Establish dc_context conditioning category */ + if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1)) + entropy->dc_context[ci] = 0; /* zero diff category */ + else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1)) + entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */ + else + entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */ + v = m; + /* Figure F.24: Decoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + if (arith_decode(cinfo, st)) v |= m; + v += 1; if (sign) v = -v; + entropy->last_dc_val[ci] += v; + } + + (*block)[0] = (JCOEF) entropy->last_dc_val[ci]; + + /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */ + + if (cinfo->lim_Se == 0) continue; + tbl = compptr->ac_tbl_no; + k = 0; + + /* Figure F.20: Decode_AC_coefficients */ + do { + st = entropy->ac_stats[tbl] + 3 * k; + if (arith_decode(cinfo, st)) break; /* EOB flag */ + for (;;) { + k++; + if (arith_decode(cinfo, st + 1)) break; + st += 3; + if (k >= cinfo->lim_Se) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* spectral overflow */ + return TRUE; + } + } + /* Figure F.21: Decoding nonzero value v */ + /* Figure F.22: Decoding the sign of v */ + sign = arith_decode(cinfo, entropy->fixed_bin); + st += 2; + /* Figure F.23: Decoding the magnitude category of v */ + if ((m = arith_decode(cinfo, st)) != 0) { + if (arith_decode(cinfo, st)) { + m <<= 1; + st = entropy->ac_stats[tbl] + + (k <= cinfo->arith_ac_K[tbl] ? 189 : 217); + while (arith_decode(cinfo, st)) { + if ((m <<= 1) == 0x8000) { + WARNMS(cinfo, JWRN_ARITH_BAD_CODE); + entropy->ct = -1; /* magnitude overflow */ + return TRUE; + } + st += 1; + } + } + } + v = m; + /* Figure F.24: Decoding the magnitude bit pattern of v */ + st += 14; + while (m >>= 1) + if (arith_decode(cinfo, st)) v |= m; + v += 1; if (sign) v = -v; + (*block)[natural_order[k]] = (JCOEF) v; + } while (k < cinfo->lim_Se); + } + + return TRUE; +} + + +/* + * Initialize for an arithmetic-compressed scan. + */ + +METHODDEF(void) +start_pass (j_decompress_ptr cinfo) +{ + arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy; + int ci, tbl; + jpeg_component_info * compptr; + + if (cinfo->progressive_mode) { + /* Validate progressive scan parameters */ + if (cinfo->Ss == 0) { + if (cinfo->Se != 0) + goto bad; + } else { + /* need not check Ss/Se < 0 since they came from unsigned bytes */ + if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se) + goto bad; + /* AC scans may have only one component */ + if (cinfo->comps_in_scan != 1) + goto bad; + } + if (cinfo->Ah != 0) { + /* Successive approximation refinement scan: must have Al = Ah-1. */ + if (cinfo->Ah-1 != cinfo->Al) + goto bad; + } + if (cinfo->Al > 13) { /* need not check for < 0 */ + bad: + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + } + /* Update progression status, and verify that scan order is legal. + * Note that inter-scan inconsistencies are treated as warnings + * not fatal errors ... not clear if this is right way to behave. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + int coefi, cindex = cinfo->cur_comp_info[ci]->component_index; + int *coef_bit_ptr = & cinfo->coef_bits[cindex][0]; + if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); + for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { + int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; + if (cinfo->Ah != expected) + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); + coef_bit_ptr[coefi] = cinfo->Al; + } + } + /* Select MCU decoding routine */ + if (cinfo->Ah == 0) { + if (cinfo->Ss == 0) + entropy->pub.decode_mcu = decode_mcu_DC_first; + else + entropy->pub.decode_mcu = decode_mcu_AC_first; + } else { + if (cinfo->Ss == 0) + entropy->pub.decode_mcu = decode_mcu_DC_refine; + else + entropy->pub.decode_mcu = decode_mcu_AC_refine; + } + } else { + /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. + * This ought to be an error condition, but we make it a warning. + */ + if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 || + (cinfo->Se < DCTSIZE2 && cinfo->Se != cinfo->lim_Se)) + WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); + /* Select MCU decoding routine */ + entropy->pub.decode_mcu = decode_mcu; + } + + /* Allocate & initialize requested statistics areas */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) { + tbl = compptr->dc_tbl_no; + if (tbl < 0 || tbl >= NUM_ARITH_TBLS) + ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); + if (entropy->dc_stats[tbl] == NULL) + entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS); + MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS); + /* Initialize DC predictions to 0 */ + entropy->last_dc_val[ci] = 0; + entropy->dc_context[ci] = 0; + } + if ((! cinfo->progressive_mode && cinfo->lim_Se) || + (cinfo->progressive_mode && cinfo->Ss)) { + tbl = compptr->ac_tbl_no; + if (tbl < 0 || tbl >= NUM_ARITH_TBLS) + ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl); + if (entropy->ac_stats[tbl] == NULL) + entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS); + MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS); + } + } + + /* Initialize arithmetic decoding variables */ + entropy->c = 0; + entropy->a = 0; + entropy->ct = -16; /* force reading 2 initial bytes to fill C */ + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Module initialization routine for arithmetic entropy decoding. + */ + +GLOBAL(void) +jinit_arith_decoder (j_decompress_ptr cinfo) +{ + arith_entropy_ptr entropy; + int i; + + entropy = (arith_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(arith_entropy_decoder)); + cinfo->entropy = &entropy->pub; + entropy->pub.start_pass = start_pass; + + /* Mark tables unallocated */ + for (i = 0; i < NUM_ARITH_TBLS; i++) { + entropy->dc_stats[i] = NULL; + entropy->ac_stats[i] = NULL; + } + + /* Initialize index for fixed probability estimation */ + entropy->fixed_bin[0] = 113; + + if (cinfo->progressive_mode) { + /* Create progression status table */ + int *coef_bit_ptr, ci; + cinfo->coef_bits = (int (*)[DCTSIZE2]) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->num_components*DCTSIZE2*SIZEOF(int)); + coef_bit_ptr = & cinfo->coef_bits[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (i = 0; i < DCTSIZE2; i++) + *coef_bit_ptr++ = -1; + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdatadst.c b/thirdparty/LibJPEG/jpeg-9/jdatadst.c new file mode 100644 index 0000000..5c8681c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdatadst.c @@ -0,0 +1,270 @@ +/* + * jdatadst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2009-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains compression data destination routines for the case of + * emitting JPEG data to memory or to a file (or any stdio stream). + * While these routines are sufficient for most applications, + * some will want to use a different destination manager. + * IMPORTANT: we assume that fwrite() will correctly transcribe an array of + * JOCTETs into 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude.h" +#include "jpeglib.h" +#include "jerror.h" + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + + +/* Expanded data destination object for stdio output */ + +typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ + + FILE * outfile; /* target stream */ + JOCTET * buffer; /* start of buffer */ +} my_destination_mgr; + +typedef my_destination_mgr * my_dest_ptr; + +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + + +/* Expanded data destination object for memory output */ + +typedef struct { + struct jpeg_destination_mgr pub; /* public fields */ + + unsigned char ** outbuffer; /* target buffer */ + unsigned long * outsize; + unsigned char * newbuffer; /* newly allocated buffer */ + JOCTET * buffer; /* start of buffer */ + size_t bufsize; +} my_mem_destination_mgr; + +typedef my_mem_destination_mgr * my_mem_dest_ptr; + + +/* + * Initialize destination --- called by jpeg_start_compress + * before any data is actually written. + */ + +METHODDEF(void) +init_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + /* Allocate the output buffer --- it will be released when done with image */ + dest->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; +} + +METHODDEF(void) +init_mem_destination (j_compress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Empty the output buffer --- called whenever buffer fills up. + * + * In typical applications, this should write the entire output buffer + * (ignoring the current state of next_output_byte & free_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been dumped. + * + * In applications that need to be able to suspend compression due to output + * overrun, a FALSE return indicates that the buffer cannot be emptied now. + * In this situation, the compressor will return to its caller (possibly with + * an indication that it has not accepted all the supplied scanlines). The + * application should resume compression after it has made more room in the + * output buffer. Note that there are substantial restrictions on the use of + * suspension --- see the documentation. + * + * When suspending, the compressor will back up to a convenient restart point + * (typically the start of the current MCU). next_output_byte & free_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point will be regenerated after resumption, so do not + * write it out when emptying the buffer externally. + */ + +METHODDEF(boolean) +empty_output_buffer (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + + if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) != + (size_t) OUTPUT_BUF_SIZE) + ERREXIT(cinfo, JERR_FILE_WRITE); + + dest->pub.next_output_byte = dest->buffer; + dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; + + return TRUE; +} + +METHODDEF(boolean) +empty_mem_output_buffer (j_compress_ptr cinfo) +{ + size_t nextsize; + JOCTET * nextbuffer; + my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; + + /* Try to allocate new buffer with double size */ + nextsize = dest->bufsize * 2; + nextbuffer = (JOCTET *) malloc(nextsize); + + if (nextbuffer == NULL) + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); + + MEMCOPY(nextbuffer, dest->buffer, dest->bufsize); + + if (dest->newbuffer != NULL) + free(dest->newbuffer); + + dest->newbuffer = nextbuffer; + + dest->pub.next_output_byte = nextbuffer + dest->bufsize; + dest->pub.free_in_buffer = dest->bufsize; + + dest->buffer = nextbuffer; + dest->bufsize = nextsize; + + return TRUE; +} + + +/* + * Terminate destination --- called by jpeg_finish_compress + * after all data has been written. Usually needs to flush buffer. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_destination (j_compress_ptr cinfo) +{ + my_dest_ptr dest = (my_dest_ptr) cinfo->dest; + size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; + + /* Write any data remaining in the buffer */ + if (datacount > 0) { + if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) + ERREXIT(cinfo, JERR_FILE_WRITE); + } + fflush(dest->outfile); + /* Make sure we wrote the output file OK */ + if (ferror(dest->outfile)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + +METHODDEF(void) +term_mem_destination (j_compress_ptr cinfo) +{ + my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; + + *dest->outbuffer = dest->buffer; + *dest->outsize = dest->bufsize - dest->pub.free_in_buffer; +} + + +/* + * Prepare for output to a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing compression. + */ + +GLOBAL(void) +jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) +{ + my_dest_ptr dest; + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same file without re-executing jpeg_stdio_dest. + * This makes it dangerous to use this manager and a different destination + * manager serially with the same JPEG object, because their private object + * sizes may be different. Caveat programmer. + */ + if (cinfo->dest == NULL) { /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_destination_mgr)); + } + + dest = (my_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_destination; + dest->pub.empty_output_buffer = empty_output_buffer; + dest->pub.term_destination = term_destination; + dest->outfile = outfile; +} + + +/* + * Prepare for output to a memory buffer. + * The caller may supply an own initial buffer with appropriate size. + * Otherwise, or when the actual data output exceeds the given size, + * the library adapts the buffer size as necessary. + * The standard library functions malloc/free are used for allocating + * larger memory, so the buffer is available to the application after + * finishing compression, and then the application is responsible for + * freeing the requested memory. + * Note: An initial buffer supplied by the caller is expected to be + * managed by the application. The library does not free such buffer + * when allocating a larger buffer. + */ + +GLOBAL(void) +jpeg_mem_dest (j_compress_ptr cinfo, + unsigned char ** outbuffer, unsigned long * outsize) +{ + my_mem_dest_ptr dest; + + if (outbuffer == NULL || outsize == NULL) /* sanity check */ + ERREXIT(cinfo, JERR_BUFFER_SIZE); + + /* The destination object is made permanent so that multiple JPEG images + * can be written to the same buffer without re-executing jpeg_mem_dest. + */ + if (cinfo->dest == NULL) { /* first time for this JPEG object? */ + cinfo->dest = (struct jpeg_destination_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_mem_destination_mgr)); + } + + dest = (my_mem_dest_ptr) cinfo->dest; + dest->pub.init_destination = init_mem_destination; + dest->pub.empty_output_buffer = empty_mem_output_buffer; + dest->pub.term_destination = term_mem_destination; + dest->outbuffer = outbuffer; + dest->outsize = outsize; + dest->newbuffer = NULL; + + if (*outbuffer == NULL || *outsize == 0) { + /* Allocate initial buffer */ + dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE); + if (dest->newbuffer == NULL) + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); + *outsize = OUTPUT_BUF_SIZE; + } + + dest->pub.next_output_byte = dest->buffer = *outbuffer; + dest->pub.free_in_buffer = dest->bufsize = *outsize; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdatasrc.c b/thirdparty/LibJPEG/jpeg-9/jdatasrc.c new file mode 100644 index 0000000..7be59a8 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdatasrc.c @@ -0,0 +1,275 @@ +/* + * jdatasrc.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2009-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains decompression data source routines for the case of + * reading JPEG data from memory or from a file (or any stdio stream). + * While these routines are sufficient for most applications, + * some will want to use a different source manager. + * IMPORTANT: we assume that fread() will correctly transcribe an array of + * JOCTETs from 8-bit-wide elements on external storage. If char is wider + * than 8 bits on your machine, you may need to do some tweaking. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude.h" +#include "jpeglib.h" +#include "jerror.h" + + +/* Expanded data source object for stdio input */ + +typedef struct { + struct jpeg_source_mgr pub; /* public fields */ + + FILE * infile; /* source stream */ + JOCTET * buffer; /* start of buffer */ + boolean start_of_file; /* have we gotten any data yet? */ +} my_source_mgr; + +typedef my_source_mgr * my_src_ptr; + +#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ + + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ + +METHODDEF(void) +init_source (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + + /* We reset the empty-input-file flag for each image, + * but we don't clear the input buffer. + * This is correct behavior for reading a series of images from one source. + */ + src->start_of_file = TRUE; +} + +METHODDEF(void) +init_mem_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Fill the input buffer --- called whenever buffer is emptied. + * + * In typical applications, this should read fresh data into the buffer + * (ignoring the current state of next_input_byte & bytes_in_buffer), + * reset the pointer & count to the start of the buffer, and return TRUE + * indicating that the buffer has been reloaded. It is not necessary to + * fill the buffer entirely, only to obtain at least one more byte. + * + * There is no such thing as an EOF return. If the end of the file has been + * reached, the routine has a choice of ERREXIT() or inserting fake data into + * the buffer. In most cases, generating a warning message and inserting a + * fake EOI marker is the best course of action --- this will allow the + * decompressor to output however much of the image is there. However, + * the resulting error message is misleading if the real problem is an empty + * input file, so we handle that case specially. + * + * In applications that need to be able to suspend compression due to input + * not being available yet, a FALSE return indicates that no more data can be + * obtained right now, but more may be forthcoming later. In this situation, + * the decompressor will return to its caller (with an indication of the + * number of scanlines it has read, if any). The application should resume + * decompression after it has loaded more data into the input buffer. Note + * that there are substantial restrictions on the use of suspension --- see + * the documentation. + * + * When suspending, the decompressor will back up to a convenient restart point + * (typically the start of the current MCU). next_input_byte & bytes_in_buffer + * indicate where the restart point will be if the current call returns FALSE. + * Data beyond this point must be rescanned after resumption, so move it to + * the front of the buffer rather than discarding it. + */ + +METHODDEF(boolean) +fill_input_buffer (j_decompress_ptr cinfo) +{ + my_src_ptr src = (my_src_ptr) cinfo->src; + size_t nbytes; + + nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); + + if (nbytes <= 0) { + if (src->start_of_file) /* Treat empty input file as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + WARNMS(cinfo, JWRN_JPEG_EOF); + /* Insert a fake EOI marker */ + src->buffer[0] = (JOCTET) 0xFF; + src->buffer[1] = (JOCTET) JPEG_EOI; + nbytes = 2; + } + + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + src->start_of_file = FALSE; + + return TRUE; +} + +METHODDEF(boolean) +fill_mem_input_buffer (j_decompress_ptr cinfo) +{ + static const JOCTET mybuffer[4] = { + (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0 + }; + + /* The whole JPEG data is expected to reside in the supplied memory + * buffer, so any request for more data beyond the given buffer size + * is treated as an error. + */ + WARNMS(cinfo, JWRN_JPEG_EOF); + + /* Insert a fake EOI marker */ + + cinfo->src->next_input_byte = mybuffer; + cinfo->src->bytes_in_buffer = 2; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ + +METHODDEF(void) +skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + struct jpeg_source_mgr * src = cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->bytes_in_buffer) { + num_bytes -= (long) src->bytes_in_buffer; + (void) (*src->fill_input_buffer) (cinfo); + /* note we assume that fill_input_buffer will never return FALSE, + * so suspension need not be handled. + */ + } + src->next_input_byte += (size_t) num_bytes; + src->bytes_in_buffer -= (size_t) num_bytes; + } +} + + +/* + * An additional method that can be provided by data source modules is the + * resync_to_restart method for error recovery in the presence of RST markers. + * For the moment, this source module just uses the default resync method + * provided by the JPEG library. That method assumes that no backtracking + * is possible. + */ + + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. Often a no-op. + * + * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding + * application must deal with any cleanup that should happen even + * for error exit. + */ + +METHODDEF(void) +term_source (j_decompress_ptr cinfo) +{ + /* no work necessary here */ +} + + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ + +GLOBAL(void) +jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) +{ + my_src_ptr src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_source_mgr)); + src = (my_src_ptr) cinfo->src; + src->buffer = (JOCTET *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + INPUT_BUF_SIZE * SIZEOF(JOCTET)); + } + + src = (my_src_ptr) cinfo->src; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = term_source; + src->infile = infile; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} + + +/* + * Prepare for input from a supplied memory buffer. + * The buffer must contain the whole JPEG data. + */ + +GLOBAL(void) +jpeg_mem_src (j_decompress_ptr cinfo, + unsigned char * inbuffer, unsigned long insize) +{ + struct jpeg_source_mgr * src; + + if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */ + ERREXIT(cinfo, JERR_INPUT_EMPTY); + + /* The source object is made permanent so that a series of JPEG images + * can be read from the same buffer by calling jpeg_mem_src only before + * the first one. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(struct jpeg_source_mgr)); + } + + src = cinfo->src; + src->init_source = init_mem_source; + src->fill_input_buffer = fill_mem_input_buffer; + src->skip_input_data = skip_input_data; + src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->term_source = term_source; + src->bytes_in_buffer = (size_t) insize; + src->next_input_byte = (JOCTET *) inbuffer; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdcoefct.c b/thirdparty/LibJPEG/jpeg-9/jdcoefct.c new file mode 100644 index 0000000..ed02fc3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdcoefct.c @@ -0,0 +1,741 @@ +/* + * jdcoefct.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 2002-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the coefficient buffer controller for decompression. + * This controller is the top level of the JPEG decompressor proper. + * The coefficient buffer lies between entropy decoding and inverse-DCT steps. + * + * In buffered-image mode, this controller is the interface between + * input-oriented processing and output-oriented processing. + * Also, the input side (only) is used when reading a file for transcoding. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + +/* Block smoothing is only applicable for progressive JPEG, so: */ +#ifndef D_PROGRESSIVE_SUPPORTED +#undef BLOCK_SMOOTHING_SUPPORTED +#endif + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_coef_controller pub; /* public fields */ + + /* These variables keep track of the current location of the input side. */ + /* cinfo->input_iMCU_row is also used for this. */ + JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ + int MCU_vert_offset; /* counts MCU rows within iMCU row */ + int MCU_rows_per_iMCU_row; /* number of such rows needed */ + + /* The output side's location is represented by cinfo->output_iMCU_row. */ + + /* In single-pass modes, it's sufficient to buffer just one MCU. + * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, + * and let the entropy decoder write into that workspace each time. + * (On 80x86, the workspace is FAR even though it's not really very big; + * this is to keep the module interfaces unchanged when a large coefficient + * buffer is necessary.) + * In multi-pass modes, this array points to the current MCU's blocks + * within the virtual arrays; it is used only by the input side. + */ + JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* In multi-pass modes, we need a virtual block array for each component. */ + jvirt_barray_ptr whole_image[MAX_COMPONENTS]; +#endif + +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* When doing block smoothing, we latch coefficient Al values here */ + int * coef_bits_latch; +#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ +#endif +} my_coef_controller; + +typedef my_coef_controller * my_coef_ptr; + +/* Forward declarations */ +METHODDEF(int) decompress_onepass + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#ifdef D_MULTISCAN_FILES_SUPPORTED +METHODDEF(int) decompress_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif +#ifdef BLOCK_SMOOTHING_SUPPORTED +LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); +METHODDEF(int) decompress_smooth_data + JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); +#endif + + +LOCAL(void) +start_iMCU_row (j_decompress_ptr cinfo) +/* Reset within-iMCU-row counters for a new row (input side) */ +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + /* In an interleaved scan, an MCU row is the same as an iMCU row. + * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. + * But at the bottom of the image, process only what's left. + */ + if (cinfo->comps_in_scan > 1) { + coef->MCU_rows_per_iMCU_row = 1; + } else { + if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; + else + coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; + } + + coef->MCU_ctr = 0; + coef->MCU_vert_offset = 0; +} + + +/* + * Initialize for an input processing pass. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + cinfo->input_iMCU_row = 0; + start_iMCU_row(cinfo); +} + + +/* + * Initialize for an output processing pass. + */ + +METHODDEF(void) +start_output_pass (j_decompress_ptr cinfo) +{ +#ifdef BLOCK_SMOOTHING_SUPPORTED + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + + /* If multipass, check to see whether to use block smoothing on this pass */ + if (coef->pub.coef_arrays != NULL) { + if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) + coef->pub.decompress_data = decompress_smooth_data; + else + coef->pub.decompress_data = decompress_data; + } +#endif + cinfo->output_iMCU_row = 0; +} + + +/* + * Decompress and return some data in the single-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Input and output must run in lockstep since we have only a one-MCU buffer. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image, + * which we index according to the component's SOF position. + */ + +METHODDEF(int) +decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + int blkn, ci, xindex, yindex, yoffset, useful_width; + JSAMPARRAY output_ptr; + JDIMENSION start_col, output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Loop to process as much as one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; + MCU_col_num++) { + /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ + if (cinfo->lim_Se) /* can bypass in DC only case */ + FMEMZERO((void FAR *) coef->MCU_buffer[0], + (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK))); + if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + /* Determine where data should go in output_buf and do the IDCT thing. + * We skip dummy blocks at the right and bottom edges (but blkn gets + * incremented past them!). Note the inner loop relies on having + * allocated the MCU_buffer[] blocks sequentially. + */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) { + blkn += compptr->MCU_blocks; + continue; + } + inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index]; + useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width + : compptr->last_col_width; + output_ptr = output_buf[compptr->component_index] + + yoffset * compptr->DCT_v_scaled_size; + start_col = MCU_col_num * compptr->MCU_sample_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + if (cinfo->input_iMCU_row < last_iMCU_row || + yoffset+yindex < compptr->last_row_height) { + output_col = start_col; + for (xindex = 0; xindex < useful_width; xindex++) { + (*inverse_DCT) (cinfo, compptr, + (JCOEFPTR) coef->MCU_buffer[blkn+xindex], + output_ptr, output_col); + output_col += compptr->DCT_h_scaled_size; + } + } + blkn += compptr->MCU_width; + output_ptr += compptr->DCT_v_scaled_size; + } + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + cinfo->output_iMCU_row++; + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Dummy consume-input routine for single-pass operation. + */ + +METHODDEF(int) +dummy_consume_data (j_decompress_ptr cinfo) +{ + return JPEG_SUSPENDED; /* Always indicate nothing was done */ +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Consume input data and store it in the full-image coefficient buffer. + * We read as much as one fully interleaved MCU row ("iMCU" row) per call, + * ie, v_samp_factor block rows for each component in the scan. + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + */ + +METHODDEF(int) +consume_data (j_decompress_ptr cinfo) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION MCU_col_num; /* index of current MCU within row */ + int blkn, ci, xindex, yindex, yoffset; + JDIMENSION start_col; + JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; + JBLOCKROW buffer_ptr; + jpeg_component_info *compptr; + + /* Align the virtual buffers for the components used in this scan. */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + buffer[ci] = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], + cinfo->input_iMCU_row * compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, TRUE); + /* Note: entropy decoder expects buffer to be zeroed, + * but this is handled automatically by the memory manager + * because we requested a pre-zeroed array. + */ + } + + /* Loop to process one whole iMCU row */ + for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; + yoffset++) { + for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; + MCU_col_num++) { + /* Construct list of pointers to DCT blocks belonging to this MCU */ + blkn = 0; /* index of current DCT block within MCU */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + start_col = MCU_col_num * compptr->MCU_width; + for (yindex = 0; yindex < compptr->MCU_height; yindex++) { + buffer_ptr = buffer[ci][yindex+yoffset] + start_col; + for (xindex = 0; xindex < compptr->MCU_width; xindex++) { + coef->MCU_buffer[blkn++] = buffer_ptr++; + } + } + } + /* Try to fetch the MCU. */ + if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { + /* Suspension forced; update state counters and exit */ + coef->MCU_vert_offset = yoffset; + coef->MCU_ctr = MCU_col_num; + return JPEG_SUSPENDED; + } + } + /* Completed an MCU row, but perhaps not an iMCU row */ + coef->MCU_ctr = 0; + } + /* Completed the iMCU row, advance counters for next one */ + if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { + start_iMCU_row(cinfo); + return JPEG_ROW_COMPLETED; + } + /* Completed the scan */ + (*cinfo->inputctl->finish_input_pass) (cinfo); + return JPEG_SCAN_COMPLETED; +} + + +/* + * Decompress and return some data in the multi-pass case. + * Always attempts to emit one fully interleaved MCU row ("iMCU" row). + * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. + * + * NB: output_buf contains a plane for each component in image. + */ + +METHODDEF(int) +decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num; + int ci, block_row, block_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number < cinfo->output_scan_number || + (cinfo->input_scan_number == cinfo->output_scan_number && + cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Align the virtual buffer for this component. */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + cinfo->output_iMCU_row * compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) + block_rows = compptr->v_samp_factor; + else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); + if (block_rows == 0) block_rows = compptr->v_samp_factor; + } + inverse_DCT = cinfo->idct->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + output_col = 0; + for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) { + (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, + output_ptr, output_col); + buffer_ptr++; + output_col += compptr->DCT_h_scaled_size; + } + output_ptr += compptr->DCT_v_scaled_size; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +#ifdef BLOCK_SMOOTHING_SUPPORTED + +/* + * This code applies interblock smoothing as described by section K.8 + * of the JPEG standard: the first 5 AC coefficients are estimated from + * the DC values of a DCT block and its 8 neighboring blocks. + * We apply smoothing only for progressive JPEG decoding, and only if + * the coefficients it can estimate are not yet known to full precision. + */ + +/* Natural-order array positions of the first 5 zigzag-order coefficients */ +#define Q01_POS 1 +#define Q10_POS 8 +#define Q20_POS 16 +#define Q11_POS 9 +#define Q02_POS 2 + +/* + * Determine whether block smoothing is applicable and safe. + * We also latch the current states of the coef_bits[] entries for the + * AC coefficients; otherwise, if the input side of the decompressor + * advances into a new scan, we might think the coefficients are known + * more accurately than they really are. + */ + +LOCAL(boolean) +smoothing_ok (j_decompress_ptr cinfo) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + boolean smoothing_useful = FALSE; + int ci, coefi; + jpeg_component_info *compptr; + JQUANT_TBL * qtable; + int * coef_bits; + int * coef_bits_latch; + + if (! cinfo->progressive_mode || cinfo->coef_bits == NULL) + return FALSE; + + /* Allocate latch area if not already done */ + if (coef->coef_bits_latch == NULL) + coef->coef_bits_latch = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->num_components * + (SAVED_COEFS * SIZEOF(int))); + coef_bits_latch = coef->coef_bits_latch; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* All components' quantization values must already be latched. */ + if ((qtable = compptr->quant_table) == NULL) + return FALSE; + /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ + if (qtable->quantval[0] == 0 || + qtable->quantval[Q01_POS] == 0 || + qtable->quantval[Q10_POS] == 0 || + qtable->quantval[Q20_POS] == 0 || + qtable->quantval[Q11_POS] == 0 || + qtable->quantval[Q02_POS] == 0) + return FALSE; + /* DC values must be at least partly known for all components. */ + coef_bits = cinfo->coef_bits[ci]; + if (coef_bits[0] < 0) + return FALSE; + /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ + for (coefi = 1; coefi <= 5; coefi++) { + coef_bits_latch[coefi] = coef_bits[coefi]; + if (coef_bits[coefi] != 0) + smoothing_useful = TRUE; + } + coef_bits_latch += SAVED_COEFS; + } + + return smoothing_useful; +} + + +/* + * Variant of decompress_data for use when doing block smoothing. + */ + +METHODDEF(int) +decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) +{ + my_coef_ptr coef = (my_coef_ptr) cinfo->coef; + JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; + JDIMENSION block_num, last_block_column; + int ci, block_row, block_rows, access_rows; + JBLOCKARRAY buffer; + JBLOCKROW buffer_ptr, prev_block_row, next_block_row; + JSAMPARRAY output_ptr; + JDIMENSION output_col; + jpeg_component_info *compptr; + inverse_DCT_method_ptr inverse_DCT; + boolean first_row, last_row; + JBLOCK workspace; + int *coef_bits; + JQUANT_TBL *quanttbl; + INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; + int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; + int Al, pred; + + /* Force some input to be done if we are getting ahead of the input. */ + while (cinfo->input_scan_number <= cinfo->output_scan_number && + ! cinfo->inputctl->eoi_reached) { + if (cinfo->input_scan_number == cinfo->output_scan_number) { + /* If input is working on current scan, we ordinarily want it to + * have completed the current row. But if input scan is DC, + * we want it to keep one row ahead so that next block row's DC + * values are up to date. + */ + JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; + if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) + break; + } + if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) + return JPEG_SUSPENDED; + } + + /* OK, output from the virtual arrays. */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Don't bother to IDCT an uninteresting component. */ + if (! compptr->component_needed) + continue; + /* Count non-dummy DCT block rows in this iMCU row. */ + if (cinfo->output_iMCU_row < last_iMCU_row) { + block_rows = compptr->v_samp_factor; + access_rows = block_rows * 2; /* this and next iMCU row */ + last_row = FALSE; + } else { + /* NB: can't use last_row_height here; it is input-side-dependent! */ + block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); + if (block_rows == 0) block_rows = compptr->v_samp_factor; + access_rows = block_rows; /* this iMCU row only */ + last_row = TRUE; + } + /* Align the virtual buffer for this component. */ + if (cinfo->output_iMCU_row > 0) { + access_rows += compptr->v_samp_factor; /* prior iMCU row too */ + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor, + (JDIMENSION) access_rows, FALSE); + buffer += compptr->v_samp_factor; /* point to current iMCU row */ + first_row = FALSE; + } else { + buffer = (*cinfo->mem->access_virt_barray) + ((j_common_ptr) cinfo, coef->whole_image[ci], + (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); + first_row = TRUE; + } + /* Fetch component-dependent info */ + coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); + quanttbl = compptr->quant_table; + Q00 = quanttbl->quantval[0]; + Q01 = quanttbl->quantval[Q01_POS]; + Q10 = quanttbl->quantval[Q10_POS]; + Q20 = quanttbl->quantval[Q20_POS]; + Q11 = quanttbl->quantval[Q11_POS]; + Q02 = quanttbl->quantval[Q02_POS]; + inverse_DCT = cinfo->idct->inverse_DCT[ci]; + output_ptr = output_buf[ci]; + /* Loop over all DCT blocks to be processed. */ + for (block_row = 0; block_row < block_rows; block_row++) { + buffer_ptr = buffer[block_row]; + if (first_row && block_row == 0) + prev_block_row = buffer_ptr; + else + prev_block_row = buffer[block_row-1]; + if (last_row && block_row == block_rows-1) + next_block_row = buffer_ptr; + else + next_block_row = buffer[block_row+1]; + /* We fetch the surrounding DC values using a sliding-register approach. + * Initialize all nine here so as to do the right thing on narrow pics. + */ + DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; + DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; + DC7 = DC8 = DC9 = (int) next_block_row[0][0]; + output_col = 0; + last_block_column = compptr->width_in_blocks - 1; + for (block_num = 0; block_num <= last_block_column; block_num++) { + /* Fetch current DCT block into workspace so we can modify it. */ + jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); + /* Update DC values */ + if (block_num < last_block_column) { + DC3 = (int) prev_block_row[1][0]; + DC6 = (int) buffer_ptr[1][0]; + DC9 = (int) next_block_row[1][0]; + } + /* Compute coefficient estimates per K.8. + * An estimate is applied only if coefficient is still zero, + * and is not known to be fully accurate. + */ + /* AC01 */ + if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { + num = 36 * Q00 * (DC4 - DC6); + if (num >= 0) { + pred = (int) (((Q01<<7) + num) / (Q01<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q10<<7) + num) / (Q10<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q20<<7) + num) / (Q20<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q11<<7) + num) / (Q11<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { + pred = (int) (((Q02<<7) + num) / (Q02<<8)); + if (Al > 0 && pred >= (1< 0 && pred >= (1<DCT_h_scaled_size; + } + output_ptr += compptr->DCT_v_scaled_size; + } + } + + if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) + return JPEG_ROW_COMPLETED; + return JPEG_SCAN_COMPLETED; +} + +#endif /* BLOCK_SMOOTHING_SUPPORTED */ + + +/* + * Initialize coefficient buffer controller. + */ + +GLOBAL(void) +jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_coef_ptr coef; + + coef = (my_coef_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_coef_controller)); + cinfo->coef = (struct jpeg_d_coef_controller *) coef; + coef->pub.start_input_pass = start_input_pass; + coef->pub.start_output_pass = start_output_pass; +#ifdef BLOCK_SMOOTHING_SUPPORTED + coef->coef_bits_latch = NULL; +#endif + + /* Create the coefficient buffer. */ + if (need_full_buffer) { +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* Allocate a full-image virtual array for each component, */ + /* padded to a multiple of samp_factor DCT blocks in each direction. */ + /* Note we ask for a pre-zeroed array. */ + int ci, access_rows; + jpeg_component_info *compptr; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + access_rows = compptr->v_samp_factor; +#ifdef BLOCK_SMOOTHING_SUPPORTED + /* If block smoothing could be used, need a bigger window */ + if (cinfo->progressive_mode) + access_rows *= 3; +#endif + coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, + (JDIMENSION) jround_up((long) compptr->width_in_blocks, + (long) compptr->h_samp_factor), + (JDIMENSION) jround_up((long) compptr->height_in_blocks, + (long) compptr->v_samp_factor), + (JDIMENSION) access_rows); + } + coef->pub.consume_data = consume_data; + coef->pub.decompress_data = decompress_data; + coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + /* We only need a single-MCU buffer. */ + JBLOCKROW buffer; + int i; + + buffer = (JBLOCKROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); + for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) { + coef->MCU_buffer[i] = buffer + i; + } + if (cinfo->lim_Se == 0) /* DC only case: want to bypass later */ + FMEMZERO((void FAR *) buffer, + (size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK))); + coef->pub.consume_data = dummy_consume_data; + coef->pub.decompress_data = decompress_onepass; + coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */ + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdcolor.c b/thirdparty/LibJPEG/jpeg-9/jdcolor.c new file mode 100644 index 0000000..939df75 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdcolor.c @@ -0,0 +1,618 @@ +/* + * jdcolor.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2011-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains output colorspace conversion routines. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private subobject */ + +typedef struct { + struct jpeg_color_deconverter pub; /* public fields */ + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + + /* Private state for RGB->Y conversion */ + INT32 * rgb_y_tab; /* => table for RGB to Y conversion */ +} my_color_deconverter; + +typedef my_color_deconverter * my_cconvert_ptr; + + +/**************** YCbCr -> RGB conversion: most common case **************/ +/**************** RGB -> Y conversion: less common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * + * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B + * + * where Cb and Cr represent the incoming values less CENTERJSAMPLE. + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * Notice that Y, being an integral input, does not contribute any fraction + * so it need not participate in the rounding. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times Cb and Cr for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the + * values for the G calculation are left scaled up, since we must add them + * together before rounding. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((INT32) ((x) * (1L<Y conversion and divide it up into + * three parts, instead of doing three alloc_small requests. This lets us + * use a single table base address, which can be held in a register in the + * inner loops on many machines (more than can hold all three addresses, + * anyway). + */ + +#define R_Y_OFF 0 /* offset to R => Y section */ +#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ +#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ +#define TABLE_SIZE (3*(MAXJSAMPLE+1)) + + +/* + * Initialize tables for YCC->RGB colorspace conversion. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + int i; + INT32 x; + SHIFT_TEMPS + + cconvert->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + cconvert->Cr_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + cconvert->Cb_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 1.40200 * x */ + cconvert->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + cconvert->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.71414 * x */ + cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Convert some rows of samples to the output colorspace. + * + * Note that we change from noninterleaved, one-plane-per-component format + * to interleaved-pixel format. The output buffer is therefore three times + * as wide as the input buffer. + * A starting row offset is provided only for the input buffer. The caller + * can easily adjust the passed output_buf value to accommodate any row + * offset required on that side. + */ + +METHODDEF(void) +ycc_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register INT32 * Crgtab = cconvert->Cr_g_tab; + register INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; + outptr[RGB_GREEN] = range_limit[y + + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS))]; + outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/**************** Cases other than YCbCr -> RGB **************/ + + +/* + * Initialize for RGB->grayscale colorspace conversion. + */ + +LOCAL(void) +build_rgb_y_table (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + INT32 * rgb_y_tab; + INT32 i; + + /* Allocate and fill in the conversion tables. */ + cconvert->rgb_y_tab = rgb_y_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (TABLE_SIZE * SIZEOF(INT32))); + + for (i = 0; i <= MAXJSAMPLE; i++) { + rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i; + rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i; + rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + } +} + + +/* + * Convert RGB to grayscale. + */ + +METHODDEF(void) +rgb_gray_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_y_tab; + register int r, g, b; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr0[col]); + g = GETJSAMPLE(inptr1[col]); + b = GETJSAMPLE(inptr2[col]); + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * [R-G,G,B-G] to [R,G,B] conversion with modulo calculation + * (inverse color transform). + */ + +METHODDEF(void) +rgb1_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register int r, g, b; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr0[col]); + g = GETJSAMPLE(inptr1[col]); + b = GETJSAMPLE(inptr2[col]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + outptr[RGB_RED] = (JSAMPLE) ((r + g - CENTERJSAMPLE) & MAXJSAMPLE); + outptr[RGB_GREEN] = (JSAMPLE) g; + outptr[RGB_BLUE] = (JSAMPLE) ((b + g - CENTERJSAMPLE) & MAXJSAMPLE); + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * [R-G,G,B-G] to grayscale conversion with modulo calculation + * (inverse color transform). + */ + +METHODDEF(void) +rgb1_gray_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register INT32 * ctab = cconvert->rgb_y_tab; + register int r, g, b; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + r = GETJSAMPLE(inptr0[col]); + g = GETJSAMPLE(inptr1[col]); + b = GETJSAMPLE(inptr2[col]); + /* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD + * (modulo) operator is equivalent to the bitmask operator AND. + */ + r = (r + g - CENTERJSAMPLE) & MAXJSAMPLE; + b = (b + g - CENTERJSAMPLE) & MAXJSAMPLE; + /* Y */ + outptr[col] = (JSAMPLE) + ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) + >> SCALEBITS); + } + } +} + + +/* + * No colorspace change, but conversion from separate-planes + * to interleaved representation. + */ + +METHODDEF(void) +rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr[RGB_RED] = inptr0[col]; + outptr[RGB_GREEN] = inptr1[col]; + outptr[RGB_BLUE] = inptr2[col]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Color conversion for no colorspace change: just copy the data, + * converting from separate-planes to interleaved representation. + */ + +METHODDEF(void) +null_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + int ci; + register int nc = cinfo->num_components; + register JSAMPROW outptr; + register JSAMPROW inptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + for (ci = 0; ci < nc; ci++) { + inptr = input_buf[ci][input_row]; + outptr = output_buf[0] + ci; + for (col = 0; col < num_cols; col++) { + *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ + outptr += nc; + } + } + input_row++; + output_buf++; + } +} + + +/* + * Color conversion for grayscale: just copy the data. + * This also works for YCbCr -> grayscale conversion, in which + * we just copy the Y (luminance) component and ignore chrominance. + */ + +METHODDEF(void) +grayscale_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, + num_rows, cinfo->output_width); +} + + +/* + * Convert grayscale to RGB: just duplicate the graylevel three times. + * This is provided to support applications that don't want to cope + * with grayscale as a separate case. + */ + +METHODDEF(void) +gray_rgb_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + register JSAMPROW outptr; + register JSAMPROW inptr; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + + while (--num_rows >= 0) { + inptr = input_buf[0][input_row++]; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + /* We can dispense with GETJSAMPLE() here */ + outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; + outptr += RGB_PIXELSIZE; + } + } +} + + +/* + * Adobe-style YCCK->CMYK conversion. + * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same + * conversion as above, while passing K (black) unchanged. + * We assume build_ycc_rgb_table has been called. + */ + +METHODDEF(void) +ycck_cmyk_convert (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + register int y, cb, cr; + register JSAMPROW outptr; + register JSAMPROW inptr0, inptr1, inptr2, inptr3; + register JDIMENSION col; + JDIMENSION num_cols = cinfo->output_width; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + register int * Crrtab = cconvert->Cr_r_tab; + register int * Cbbtab = cconvert->Cb_b_tab; + register INT32 * Crgtab = cconvert->Cr_g_tab; + register INT32 * Cbgtab = cconvert->Cb_g_tab; + SHIFT_TEMPS + + while (--num_rows >= 0) { + inptr0 = input_buf[0][input_row]; + inptr1 = input_buf[1][input_row]; + inptr2 = input_buf[2][input_row]; + inptr3 = input_buf[3][input_row]; + input_row++; + outptr = *output_buf++; + for (col = 0; col < num_cols; col++) { + y = GETJSAMPLE(inptr0[col]); + cb = GETJSAMPLE(inptr1[col]); + cr = GETJSAMPLE(inptr2[col]); + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ + outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], + SCALEBITS)))]; + outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ + /* K passes through unchanged */ + outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ + outptr += 4; + } + } +} + + +/* + * Empty method for start_pass. + */ + +METHODDEF(void) +start_pass_dcolor (j_decompress_ptr cinfo) +{ + /* no work needed */ +} + + +/* + * Module initialization routine for output colorspace conversion. + */ + +GLOBAL(void) +jinit_color_deconverter (j_decompress_ptr cinfo) +{ + my_cconvert_ptr cconvert; + int ci; + + cconvert = (my_cconvert_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_color_deconverter)); + cinfo->cconvert = &cconvert->pub; + cconvert->pub.start_pass = start_pass_dcolor; + + /* Make sure num_components agrees with jpeg_color_space */ + switch (cinfo->jpeg_color_space) { + case JCS_GRAYSCALE: + if (cinfo->num_components != 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_RGB: + case JCS_YCbCr: + if (cinfo->num_components != 3) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + case JCS_CMYK: + case JCS_YCCK: + if (cinfo->num_components != 4) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + + default: /* JCS_UNKNOWN can be anything */ + if (cinfo->num_components < 1) + ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); + break; + } + + /* Support color transform only for RGB colorspace */ + if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + + /* Set out_color_components and conversion method based on requested space. + * Also clear the component_needed flags for any unused components, + * so that earlier pipeline stages can avoid useless computation. + */ + + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + if (cinfo->jpeg_color_space == JCS_GRAYSCALE || + cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = grayscale_convert; + /* For color->grayscale conversion, only the Y (0) component is needed */ + for (ci = 1; ci < cinfo->num_components; ci++) + cinfo->comp_info[ci].component_needed = FALSE; + } else if (cinfo->jpeg_color_space == JCS_RGB) { + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_gray_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb1_gray_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + build_rgb_y_table(cinfo); + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + if (cinfo->jpeg_color_space == JCS_YCbCr) { + cconvert->pub.color_convert = ycc_rgb_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { + cconvert->pub.color_convert = gray_rgb_convert; + } else if (cinfo->jpeg_color_space == JCS_RGB) { + switch (cinfo->color_transform) { + case JCT_NONE: + cconvert->pub.color_convert = rgb_convert; + break; + case JCT_SUBTRACT_GREEN: + cconvert->pub.color_convert = rgb1_rgb_convert; + break; + default: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + case JCS_CMYK: + cinfo->out_color_components = 4; + if (cinfo->jpeg_color_space == JCS_YCCK) { + cconvert->pub.color_convert = ycck_cmyk_convert; + build_ycc_rgb_table(cinfo); + } else if (cinfo->jpeg_color_space == JCS_CMYK) { + cconvert->pub.color_convert = null_convert; + } else + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + + default: + /* Permit null conversion to same output space */ + if (cinfo->out_color_space == cinfo->jpeg_color_space) { + cinfo->out_color_components = cinfo->num_components; + cconvert->pub.color_convert = null_convert; + } else /* unsupported non-null conversion */ + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + break; + } + + if (cinfo->quantize_colors) + cinfo->output_components = 1; /* single colormapped output component */ + else + cinfo->output_components = cinfo->out_color_components; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdct.h b/thirdparty/LibJPEG/jpeg-9/jdct.h new file mode 100644 index 0000000..360dec8 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdct.h @@ -0,0 +1,393 @@ +/* + * jdct.h + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file contains common declarations for the forward and + * inverse DCT modules. These declarations are private to the DCT managers + * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. + * The individual DCT algorithms are kept in separate files to ease + * machine-dependent tuning (e.g., assembly coding). + */ + + +/* + * A forward DCT routine is given a pointer to an input sample array and + * a pointer to a work area of type DCTELEM[]; the DCT is to be performed + * in-place in that buffer. Type DCTELEM is int for 8-bit samples, INT32 + * for 12-bit samples. (NOTE: Floating-point DCT implementations use an + * array of type FAST_FLOAT, instead.) + * The input data is to be fetched from the sample array starting at a + * specified column. (Any row offset needed will be applied to the array + * pointer before it is passed to the FDCT code.) + * Note that the number of samples fetched by the FDCT routine is + * DCT_h_scaled_size * DCT_v_scaled_size. + * The DCT outputs are returned scaled up by a factor of 8; they therefore + * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This + * convention improves accuracy in integer implementations and saves some + * work in floating-point ones. + * Quantization of the output coefficients is done by jcdctmgr.c. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef int DCTELEM; /* 16 or 32 bits is fine */ +#else +typedef INT32 DCTELEM; /* must have 32 bits */ +#endif + +typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data, + JSAMPARRAY sample_data, + JDIMENSION start_col)); +typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data, + JSAMPARRAY sample_data, + JDIMENSION start_col)); + + +/* + * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer + * to an output sample array. The routine must dequantize the input data as + * well as perform the IDCT; for dequantization, it uses the multiplier table + * pointed to by compptr->dct_table. The output data is to be placed into the + * sample array starting at a specified column. (Any row offset needed will + * be applied to the array pointer before it is passed to the IDCT code.) + * Note that the number of samples emitted by the IDCT routine is + * DCT_h_scaled_size * DCT_v_scaled_size. + */ + +/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ + +/* + * Each IDCT routine has its own ideas about the best dct_table element type. + */ + +typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ +#if BITS_IN_JSAMPLE == 8 +typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ +#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ +#else +typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ +#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ +#endif +typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ + + +/* + * Each IDCT routine is responsible for range-limiting its results and + * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could + * be quite far out of range if the input data is corrupt, so a bulletproof + * range-limiting step is required. We use a mask-and-table-lookup method + * to do the combined operations quickly. See the comments with + * prepare_range_limit_table (in jdmaster.c) for more info. + */ + +#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) + +#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_fdct_islow jFDislow +#define jpeg_fdct_ifast jFDifast +#define jpeg_fdct_float jFDfloat +#define jpeg_fdct_7x7 jFD7x7 +#define jpeg_fdct_6x6 jFD6x6 +#define jpeg_fdct_5x5 jFD5x5 +#define jpeg_fdct_4x4 jFD4x4 +#define jpeg_fdct_3x3 jFD3x3 +#define jpeg_fdct_2x2 jFD2x2 +#define jpeg_fdct_1x1 jFD1x1 +#define jpeg_fdct_9x9 jFD9x9 +#define jpeg_fdct_10x10 jFD10x10 +#define jpeg_fdct_11x11 jFD11x11 +#define jpeg_fdct_12x12 jFD12x12 +#define jpeg_fdct_13x13 jFD13x13 +#define jpeg_fdct_14x14 jFD14x14 +#define jpeg_fdct_15x15 jFD15x15 +#define jpeg_fdct_16x16 jFD16x16 +#define jpeg_fdct_16x8 jFD16x8 +#define jpeg_fdct_14x7 jFD14x7 +#define jpeg_fdct_12x6 jFD12x6 +#define jpeg_fdct_10x5 jFD10x5 +#define jpeg_fdct_8x4 jFD8x4 +#define jpeg_fdct_6x3 jFD6x3 +#define jpeg_fdct_4x2 jFD4x2 +#define jpeg_fdct_2x1 jFD2x1 +#define jpeg_fdct_8x16 jFD8x16 +#define jpeg_fdct_7x14 jFD7x14 +#define jpeg_fdct_6x12 jFD6x12 +#define jpeg_fdct_5x10 jFD5x10 +#define jpeg_fdct_4x8 jFD4x8 +#define jpeg_fdct_3x6 jFD3x6 +#define jpeg_fdct_2x4 jFD2x4 +#define jpeg_fdct_1x2 jFD1x2 +#define jpeg_idct_islow jRDislow +#define jpeg_idct_ifast jRDifast +#define jpeg_idct_float jRDfloat +#define jpeg_idct_7x7 jRD7x7 +#define jpeg_idct_6x6 jRD6x6 +#define jpeg_idct_5x5 jRD5x5 +#define jpeg_idct_4x4 jRD4x4 +#define jpeg_idct_3x3 jRD3x3 +#define jpeg_idct_2x2 jRD2x2 +#define jpeg_idct_1x1 jRD1x1 +#define jpeg_idct_9x9 jRD9x9 +#define jpeg_idct_10x10 jRD10x10 +#define jpeg_idct_11x11 jRD11x11 +#define jpeg_idct_12x12 jRD12x12 +#define jpeg_idct_13x13 jRD13x13 +#define jpeg_idct_14x14 jRD14x14 +#define jpeg_idct_15x15 jRD15x15 +#define jpeg_idct_16x16 jRD16x16 +#define jpeg_idct_16x8 jRD16x8 +#define jpeg_idct_14x7 jRD14x7 +#define jpeg_idct_12x6 jRD12x6 +#define jpeg_idct_10x5 jRD10x5 +#define jpeg_idct_8x4 jRD8x4 +#define jpeg_idct_6x3 jRD6x3 +#define jpeg_idct_4x2 jRD4x2 +#define jpeg_idct_2x1 jRD2x1 +#define jpeg_idct_8x16 jRD8x16 +#define jpeg_idct_7x14 jRD7x14 +#define jpeg_idct_6x12 jRD6x12 +#define jpeg_idct_5x10 jRD5x10 +#define jpeg_idct_4x8 jRD4x8 +#define jpeg_idct_3x6 jRD3x8 +#define jpeg_idct_2x4 jRD2x4 +#define jpeg_idct_1x2 jRD1x2 +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + +/* Extern declarations for the forward and inverse DCT routines. */ + +EXTERN(void) jpeg_fdct_islow + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_ifast + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_float + JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_7x7 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_6x6 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_5x5 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_4x4 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_3x3 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_2x2 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_1x1 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_9x9 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_10x10 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_11x11 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_12x12 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_13x13 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_14x14 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_15x15 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_16x16 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_16x8 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_14x7 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_12x6 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_10x5 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_8x4 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_6x3 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_4x2 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_2x1 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_8x16 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_7x14 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_6x12 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_5x10 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_4x8 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_3x6 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_2x4 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); +EXTERN(void) jpeg_fdct_1x2 + JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)); + +EXTERN(void) jpeg_idct_islow + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_ifast + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_float + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_7x7 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_6x6 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_5x5 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_3x3 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_1x1 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_9x9 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_10x10 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_11x11 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_12x12 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_13x13 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_14x14 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_15x15 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_16x16 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_16x8 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_14x7 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_12x6 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_10x5 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_8x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_6x3 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x1 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_8x16 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_7x14 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_6x12 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_5x10 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_4x8 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_3x6 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_2x4 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); +EXTERN(void) jpeg_idct_1x2 + JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); + + +/* + * Macros for handling fixed-point arithmetic; these are used by many + * but not all of the DCT/IDCT modules. + * + * All values are expected to be of type INT32. + * Fractional constants are scaled left by CONST_BITS bits. + * CONST_BITS is defined within each module using these macros, + * and may differ from one module to the next. + */ + +#define ONE ((INT32) 1) +#define CONST_SCALE (ONE << CONST_BITS) + +/* Convert a positive real constant to an integer scaled by CONST_SCALE. + * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, + * thus causing a lot of useless floating-point operations at run time. + */ + +#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) + +/* Descale and correctly round an INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) + +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. + * This macro is used only when the two inputs will actually be no more than + * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a + * full 32x32 multiply. This provides a useful speedup on many machines. + * Unfortunately there is no way to specify a 16x16->32 multiply portably + * in C, but some C compilers will do the right thing if you provide the + * correct combination of casts. + */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) +#endif +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const))) +#endif + +#ifndef MULTIPLY16C16 /* default definition */ +#define MULTIPLY16C16(var,const) ((var) * (const)) +#endif + +/* Same except both inputs are variables. */ + +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) +#endif + +#ifndef MULTIPLY16V16 /* default definition */ +#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) +#endif diff --git a/thirdparty/LibJPEG/jpeg-9/jddctmgr.c b/thirdparty/LibJPEG/jpeg-9/jddctmgr.c new file mode 100644 index 0000000..0ded9d5 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jddctmgr.c @@ -0,0 +1,384 @@ +/* + * jddctmgr.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2002-2010 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the inverse-DCT management logic. + * This code selects a particular IDCT implementation to be used, + * and it performs related housekeeping chores. No code in this file + * is executed per IDCT step, only during output pass setup. + * + * Note that the IDCT routines are responsible for performing coefficient + * dequantization as well as the IDCT proper. This module sets up the + * dequantization multiplier table needed by the IDCT routine. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + + +/* + * The decompressor input side (jdinput.c) saves away the appropriate + * quantization table for each component at the start of the first scan + * involving that component. (This is necessary in order to correctly + * decode files that reuse Q-table slots.) + * When we are ready to make an output pass, the saved Q-table is converted + * to a multiplier table that will actually be used by the IDCT routine. + * The multiplier table contents are IDCT-method-dependent. To support + * application changes in IDCT method between scans, we can remake the + * multiplier tables if necessary. + * In buffered-image mode, the first output pass may occur before any data + * has been seen for some components, and thus before their Q-tables have + * been saved away. To handle this case, multiplier tables are preset + * to zeroes; the result of the IDCT will be a neutral gray level. + */ + + +/* Private subobject for this module */ + +typedef struct { + struct jpeg_inverse_dct pub; /* public fields */ + + /* This array contains the IDCT method code that each multiplier table + * is currently set up for, or -1 if it's not yet set up. + * The actual multiplier tables are pointed to by dct_table in the + * per-component comp_info structures. + */ + int cur_method[MAX_COMPONENTS]; +} my_idct_controller; + +typedef my_idct_controller * my_idct_ptr; + + +/* Allocated multiplier tables: big enough for any supported variant */ + +typedef union { + ISLOW_MULT_TYPE islow_array[DCTSIZE2]; +#ifdef DCT_IFAST_SUPPORTED + IFAST_MULT_TYPE ifast_array[DCTSIZE2]; +#endif +#ifdef DCT_FLOAT_SUPPORTED + FLOAT_MULT_TYPE float_array[DCTSIZE2]; +#endif +} multiplier_table; + + +/* The current scaled-IDCT routines require ISLOW-style multiplier tables, + * so be sure to compile that code if either ISLOW or SCALING is requested. + */ +#ifdef DCT_ISLOW_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#else +#ifdef IDCT_SCALING_SUPPORTED +#define PROVIDE_ISLOW_TABLES +#endif +#endif + + +/* + * Prepare for an output pass. + * Here we select the proper IDCT routine for each component and build + * a matching multiplier table. + */ + +METHODDEF(void) +start_pass (j_decompress_ptr cinfo) +{ + my_idct_ptr idct = (my_idct_ptr) cinfo->idct; + int ci, i; + jpeg_component_info *compptr; + int method = 0; + inverse_DCT_method_ptr method_ptr = NULL; + JQUANT_TBL * qtbl; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Select the proper IDCT routine for this component's scaling */ + switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) { +#ifdef IDCT_SCALING_SUPPORTED + case ((1 << 8) + 1): + method_ptr = jpeg_idct_1x1; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((2 << 8) + 2): + method_ptr = jpeg_idct_2x2; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((3 << 8) + 3): + method_ptr = jpeg_idct_3x3; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((4 << 8) + 4): + method_ptr = jpeg_idct_4x4; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((5 << 8) + 5): + method_ptr = jpeg_idct_5x5; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((6 << 8) + 6): + method_ptr = jpeg_idct_6x6; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((7 << 8) + 7): + method_ptr = jpeg_idct_7x7; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((9 << 8) + 9): + method_ptr = jpeg_idct_9x9; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((10 << 8) + 10): + method_ptr = jpeg_idct_10x10; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((11 << 8) + 11): + method_ptr = jpeg_idct_11x11; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((12 << 8) + 12): + method_ptr = jpeg_idct_12x12; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((13 << 8) + 13): + method_ptr = jpeg_idct_13x13; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((14 << 8) + 14): + method_ptr = jpeg_idct_14x14; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((15 << 8) + 15): + method_ptr = jpeg_idct_15x15; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((16 << 8) + 16): + method_ptr = jpeg_idct_16x16; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((16 << 8) + 8): + method_ptr = jpeg_idct_16x8; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((14 << 8) + 7): + method_ptr = jpeg_idct_14x7; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((12 << 8) + 6): + method_ptr = jpeg_idct_12x6; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((10 << 8) + 5): + method_ptr = jpeg_idct_10x5; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((8 << 8) + 4): + method_ptr = jpeg_idct_8x4; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((6 << 8) + 3): + method_ptr = jpeg_idct_6x3; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((4 << 8) + 2): + method_ptr = jpeg_idct_4x2; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((2 << 8) + 1): + method_ptr = jpeg_idct_2x1; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((8 << 8) + 16): + method_ptr = jpeg_idct_8x16; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((7 << 8) + 14): + method_ptr = jpeg_idct_7x14; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((6 << 8) + 12): + method_ptr = jpeg_idct_6x12; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((5 << 8) + 10): + method_ptr = jpeg_idct_5x10; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((4 << 8) + 8): + method_ptr = jpeg_idct_4x8; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((3 << 8) + 6): + method_ptr = jpeg_idct_3x6; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((2 << 8) + 4): + method_ptr = jpeg_idct_2x4; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; + case ((1 << 8) + 2): + method_ptr = jpeg_idct_1x2; + method = JDCT_ISLOW; /* jidctint uses islow-style table */ + break; +#endif + case ((DCTSIZE << 8) + DCTSIZE): + switch (cinfo->dct_method) { +#ifdef DCT_ISLOW_SUPPORTED + case JDCT_ISLOW: + method_ptr = jpeg_idct_islow; + method = JDCT_ISLOW; + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + method_ptr = jpeg_idct_ifast; + method = JDCT_IFAST; + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + method_ptr = jpeg_idct_float; + method = JDCT_FLOAT; + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + break; + default: + ERREXIT2(cinfo, JERR_BAD_DCTSIZE, + compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size); + break; + } + idct->pub.inverse_DCT[ci] = method_ptr; + /* Create multiplier table from quant table. + * However, we can skip this if the component is uninteresting + * or if we already built the table. Also, if no quant table + * has yet been saved for the component, we leave the + * multiplier table all-zero; we'll be reading zeroes from the + * coefficient controller's buffer anyway. + */ + if (! compptr->component_needed || idct->cur_method[ci] == method) + continue; + qtbl = compptr->quant_table; + if (qtbl == NULL) /* happens if no data yet for component */ + continue; + idct->cur_method[ci] = method; + switch (method) { +#ifdef PROVIDE_ISLOW_TABLES + case JDCT_ISLOW: + { + /* For LL&M IDCT method, multipliers are equal to raw quantization + * coefficients, but are stored as ints to ensure access efficiency. + */ + ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; + for (i = 0; i < DCTSIZE2; i++) { + ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; + } + } + break; +#endif +#ifdef DCT_IFAST_SUPPORTED + case JDCT_IFAST: + { + /* For AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * For integer operation, the multiplier table is to be scaled by + * IFAST_SCALE_BITS. + */ + IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; +#define CONST_BITS 14 + static const INT16 aanscales[DCTSIZE2] = { + /* precomputed values scaled up by 14 bits */ + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, + 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, + 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, + 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, + 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, + 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, + 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 + }; + SHIFT_TEMPS + + for (i = 0; i < DCTSIZE2; i++) { + ifmtbl[i] = (IFAST_MULT_TYPE) + DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i], + (INT32) aanscales[i]), + CONST_BITS-IFAST_SCALE_BITS); + } + } + break; +#endif +#ifdef DCT_FLOAT_SUPPORTED + case JDCT_FLOAT: + { + /* For float AA&N IDCT method, multipliers are equal to quantization + * coefficients scaled by scalefactor[row]*scalefactor[col], where + * scalefactor[0] = 1 + * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 + * We apply a further scale factor of 1/8. + */ + FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; + int row, col; + static const double aanscalefactor[DCTSIZE] = { + 1.0, 1.387039845, 1.306562965, 1.175875602, + 1.0, 0.785694958, 0.541196100, 0.275899379 + }; + + i = 0; + for (row = 0; row < DCTSIZE; row++) { + for (col = 0; col < DCTSIZE; col++) { + fmtbl[i] = (FLOAT_MULT_TYPE) + ((double) qtbl->quantval[i] * + aanscalefactor[row] * aanscalefactor[col] * 0.125); + i++; + } + } + } + break; +#endif + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } + } +} + + +/* + * Initialize IDCT manager. + */ + +GLOBAL(void) +jinit_inverse_dct (j_decompress_ptr cinfo) +{ + my_idct_ptr idct; + int ci; + jpeg_component_info *compptr; + + idct = (my_idct_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_idct_controller)); + cinfo->idct = (struct jpeg_inverse_dct *) idct; + idct->pub.start_pass = start_pass; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Allocate and pre-zero a multiplier table for each component */ + compptr->dct_table = + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(multiplier_table)); + MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); + /* Mark multiplier table not yet set up for any method */ + idct->cur_method[ci] = -1; + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdhuff.c b/thirdparty/LibJPEG/jpeg-9/jdhuff.c new file mode 100644 index 0000000..e548e68 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdhuff.c @@ -0,0 +1,1542 @@ +/* + * jdhuff.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2006-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains Huffman entropy decoding routines. + * Both sequential and progressive modes are supported in this single module. + * + * Much of the complexity here has to do with supporting input suspension. + * If the data source module demands suspension, we want to be able to back + * up to the start of the current MCU. To do this, we copy state variables + * into local working storage, and update them back to the permanent + * storage only upon successful completion of an MCU. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Derived data constructed for each Huffman table */ + +#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ + +typedef struct { + /* Basic tables: (element [0] of each array is unused) */ + INT32 maxcode[18]; /* largest code of length k (-1 if none) */ + /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ + INT32 valoffset[17]; /* huffval[] offset for codes of length k */ + /* valoffset[k] = huffval[] index of 1st symbol of code length k, less + * the smallest code of length k; so given a code of length k, the + * corresponding symbol is huffval[code + valoffset[k]] + */ + + /* Link to public Huffman table (needed only in jpeg_huff_decode) */ + JHUFF_TBL *pub; + + /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of + * the input data stream. If the next Huffman code is no more + * than HUFF_LOOKAHEAD bits long, we can obtain its length and + * the corresponding symbol directly from these tables. + */ + int look_nbits[1< 32 bits on your machine, and shifting/masking longs is + * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE + * appropriately should be a win. Unfortunately we can't define the size + * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) + * because not all machines measure sizeof in 8-bit bytes. + */ + +typedef struct { /* Bitreading state saved across MCUs */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ +} bitread_perm_state; + +typedef struct { /* Bitreading working state within an MCU */ + /* Current data source location */ + /* We need a copy, rather than munging the original, in case of suspension */ + const JOCTET * next_input_byte; /* => next byte to read from source */ + size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ + /* Bit input buffer --- note these values are kept in register variables, + * not in this struct, inside the inner loops. + */ + bit_buf_type get_buffer; /* current bit-extraction buffer */ + int bits_left; /* # of unused bits in it */ + /* Pointer needed by jpeg_fill_bit_buffer. */ + j_decompress_ptr cinfo; /* back link to decompress master record */ +} bitread_working_state; + +/* Macros to declare and load/save bitread local variables. */ +#define BITREAD_STATE_VARS \ + register bit_buf_type get_buffer; \ + register int bits_left; \ + bitread_working_state br_state + +#define BITREAD_LOAD_STATE(cinfop,permstate) \ + br_state.cinfo = cinfop; \ + br_state.next_input_byte = cinfop->src->next_input_byte; \ + br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ + get_buffer = permstate.get_buffer; \ + bits_left = permstate.bits_left; + +#define BITREAD_SAVE_STATE(cinfop,permstate) \ + cinfop->src->next_input_byte = br_state.next_input_byte; \ + cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ + permstate.get_buffer = get_buffer; \ + permstate.bits_left = bits_left + +/* + * These macros provide the in-line portion of bit fetching. + * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer + * before using GET_BITS, PEEK_BITS, or DROP_BITS. + * The variables get_buffer and bits_left are assumed to be locals, + * but the state struct might not be (jpeg_huff_decode needs this). + * CHECK_BIT_BUFFER(state,n,action); + * Ensure there are N bits in get_buffer; if suspend, take action. + * val = GET_BITS(n); + * Fetch next N bits. + * val = PEEK_BITS(n); + * Fetch next N bits without removing them from the buffer. + * DROP_BITS(n); + * Discard next N bits. + * The value N should be a simple variable, not an expression, because it + * is evaluated multiple times. + */ + +#define CHECK_BIT_BUFFER(state,nbits,action) \ + { if (bits_left < (nbits)) { \ + if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ + { action; } \ + get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } + +#define GET_BITS(nbits) \ + (((int) (get_buffer >> (bits_left -= (nbits)))) & BIT_MASK(nbits)) + +#define PEEK_BITS(nbits) \ + (((int) (get_buffer >> (bits_left - (nbits)))) & BIT_MASK(nbits)) + +#define DROP_BITS(nbits) \ + (bits_left -= (nbits)) + + +/* + * Code for extracting next Huffman-coded symbol from input bit stream. + * Again, this is time-critical and we make the main paths be macros. + * + * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits + * without looping. Usually, more than 95% of the Huffman codes will be 8 + * or fewer bits long. The few overlength codes are handled with a loop, + * which need not be inline code. + * + * Notes about the HUFF_DECODE macro: + * 1. Near the end of the data segment, we may fail to get enough bits + * for a lookahead. In that case, we do it the hard way. + * 2. If the lookahead table contains no entry, the next code must be + * more than HUFF_LOOKAHEAD bits long. + * 3. jpeg_huff_decode returns -1 if forced to suspend. + */ + +#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ +{ register int nb, look; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + if (bits_left < HUFF_LOOKAHEAD) { \ + nb = 1; goto slowlabel; \ + } \ + } \ + look = PEEK_BITS(HUFF_LOOKAHEAD); \ + if ((nb = htbl->look_nbits[look]) != 0) { \ + DROP_BITS(nb); \ + result = htbl->look_sym[look]; \ + } else { \ + nb = HUFF_LOOKAHEAD+1; \ +slowlabel: \ + if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ + { failaction; } \ + get_buffer = state.get_buffer; bits_left = state.bits_left; \ + } \ +} + + +/* + * Expanded entropy decoder object for Huffman decoding. + * + * The savable_state subrecord contains fields that change within an MCU, + * but must not be updated permanently until we complete the MCU. + */ + +typedef struct { + unsigned int EOBRUN; /* remaining EOBs in EOBRUN */ + int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ +} savable_state; + +/* This macro is to work around compilers with missing or broken + * structure assignment. You'll need to fix this code if you have + * such a compiler and you change MAX_COMPS_IN_SCAN. + */ + +#ifndef NO_STRUCT_ASSIGN +#define ASSIGN_STATE(dest,src) ((dest) = (src)) +#else +#if MAX_COMPS_IN_SCAN == 4 +#define ASSIGN_STATE(dest,src) \ + ((dest).EOBRUN = (src).EOBRUN, \ + (dest).last_dc_val[0] = (src).last_dc_val[0], \ + (dest).last_dc_val[1] = (src).last_dc_val[1], \ + (dest).last_dc_val[2] = (src).last_dc_val[2], \ + (dest).last_dc_val[3] = (src).last_dc_val[3]) +#endif +#endif + + +typedef struct { + struct jpeg_entropy_decoder pub; /* public fields */ + + /* These fields are loaded into local variables at start of each MCU. + * In case of suspension, we exit WITHOUT updating them. + */ + bitread_perm_state bitstate; /* Bit buffer at start of MCU */ + savable_state saved; /* Other state at start of MCU */ + + /* These fields are NOT loaded into local working state. */ + boolean insufficient_data; /* set TRUE after emitting warning */ + unsigned int restarts_to_go; /* MCUs left in this restart interval */ + + /* Following two fields used only in progressive mode */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; + + d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ + + /* Following fields used only in sequential mode */ + + /* Pointers to derived tables (these workspaces have image lifespan) */ + d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; + d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; + + /* Precalculated info set up by start_pass for use in decode_mcu: */ + + /* Pointers to derived tables to be used for each block within an MCU */ + d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]; + d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]; + /* Whether we care about the DC and AC coefficient values for each block */ + int coef_limit[D_MAX_BLOCKS_IN_MCU]; +} huff_entropy_decoder; + +typedef huff_entropy_decoder * huff_entropy_ptr; + + +static const int jpeg_zigzag_order[8][8] = { + { 0, 1, 5, 6, 14, 15, 27, 28 }, + { 2, 4, 7, 13, 16, 26, 29, 42 }, + { 3, 8, 12, 17, 25, 30, 41, 43 }, + { 9, 11, 18, 24, 31, 40, 44, 53 }, + { 10, 19, 23, 32, 39, 45, 52, 54 }, + { 20, 22, 33, 38, 46, 51, 55, 60 }, + { 21, 34, 37, 47, 50, 56, 59, 61 }, + { 35, 36, 48, 49, 57, 58, 62, 63 } +}; + +static const int jpeg_zigzag_order7[7][7] = { + { 0, 1, 5, 6, 14, 15, 27 }, + { 2, 4, 7, 13, 16, 26, 28 }, + { 3, 8, 12, 17, 25, 29, 38 }, + { 9, 11, 18, 24, 30, 37, 39 }, + { 10, 19, 23, 31, 36, 40, 45 }, + { 20, 22, 32, 35, 41, 44, 46 }, + { 21, 33, 34, 42, 43, 47, 48 } +}; + +static const int jpeg_zigzag_order6[6][6] = { + { 0, 1, 5, 6, 14, 15 }, + { 2, 4, 7, 13, 16, 25 }, + { 3, 8, 12, 17, 24, 26 }, + { 9, 11, 18, 23, 27, 32 }, + { 10, 19, 22, 28, 31, 33 }, + { 20, 21, 29, 30, 34, 35 } +}; + +static const int jpeg_zigzag_order5[5][5] = { + { 0, 1, 5, 6, 14 }, + { 2, 4, 7, 13, 15 }, + { 3, 8, 12, 16, 21 }, + { 9, 11, 17, 20, 22 }, + { 10, 18, 19, 23, 24 } +}; + +static const int jpeg_zigzag_order4[4][4] = { + { 0, 1, 5, 6 }, + { 2, 4, 7, 12 }, + { 3, 8, 11, 13 }, + { 9, 10, 14, 15 } +}; + +static const int jpeg_zigzag_order3[3][3] = { + { 0, 1, 5 }, + { 2, 4, 6 }, + { 3, 7, 8 } +}; + +static const int jpeg_zigzag_order2[2][2] = { + { 0, 1 }, + { 2, 3 } +}; + + +/* + * Compute the derived values for a Huffman table. + * This routine also performs some validation checks on the table. + */ + +LOCAL(void) +jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno, + d_derived_tbl ** pdtbl) +{ + JHUFF_TBL *htbl; + d_derived_tbl *dtbl; + int p, i, l, si, numsymbols; + int lookbits, ctr; + char huffsize[257]; + unsigned int huffcode[257]; + unsigned int code; + + /* Note that huffsize[] and huffcode[] are filled in code-length order, + * paralleling the order of the symbols themselves in htbl->huffval[]. + */ + + /* Find the input Huffman table */ + if (tblno < 0 || tblno >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + htbl = + isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; + if (htbl == NULL) + ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); + + /* Allocate a workspace if we haven't already done so. */ + if (*pdtbl == NULL) + *pdtbl = (d_derived_tbl *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(d_derived_tbl)); + dtbl = *pdtbl; + dtbl->pub = htbl; /* fill in back link */ + + /* Figure C.1: make table of Huffman code length for each symbol */ + + p = 0; + for (l = 1; l <= 16; l++) { + i = (int) htbl->bits[l]; + if (i < 0 || p + i > 256) /* protect against table overrun */ + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + while (i--) + huffsize[p++] = (char) l; + } + huffsize[p] = 0; + numsymbols = p; + + /* Figure C.2: generate the codes themselves */ + /* We also validate that the counts represent a legal Huffman code tree. */ + + code = 0; + si = huffsize[0]; + p = 0; + while (huffsize[p]) { + while (((int) huffsize[p]) == si) { + huffcode[p++] = code; + code++; + } + /* code is now 1 more than the last code used for codelength si; but + * it must still fit in si bits, since no code is allowed to be all ones. + */ + if (((INT32) code) >= (((INT32) 1) << si)) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + code <<= 1; + si++; + } + + /* Figure F.15: generate decoding tables for bit-sequential decoding */ + + p = 0; + for (l = 1; l <= 16; l++) { + if (htbl->bits[l]) { + /* valoffset[l] = huffval[] index of 1st symbol of code length l, + * minus the minimum code of length l + */ + dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p]; + p += htbl->bits[l]; + dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */ + } else { + dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ + } + } + dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ + + /* Compute lookahead tables to speed up decoding. + * First we set all the table entries to 0, indicating "too long"; + * then we iterate through the Huffman codes that are short enough and + * fill in all the entries that correspond to bit sequences starting + * with that code. + */ + + MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); + + p = 0; + for (l = 1; l <= HUFF_LOOKAHEAD; l++) { + for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { + /* l = current code's length, p = its index in huffcode[] & huffval[]. */ + /* Generate left-justified code followed by all possible bit sequences */ + lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l); + for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { + dtbl->look_nbits[lookbits] = l; + dtbl->look_sym[lookbits] = htbl->huffval[p]; + lookbits++; + } + } + } + + /* Validate symbols as being reasonable. + * For AC tables, we make no check, but accept all byte values 0..255. + * For DC tables, we require the symbols to be in range 0..15. + * (Tighter bounds could be applied depending on the data depth and mode, + * but this is sufficient to ensure safe decoding.) + */ + if (isDC) { + for (i = 0; i < numsymbols; i++) { + int sym = htbl->huffval[i]; + if (sym < 0 || sym > 15) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + } + } +} + + +/* + * Out-of-line code for bit fetching. + * Note: current values of get_buffer and bits_left are passed as parameters, + * but are returned in the corresponding fields of the state struct. + * + * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width + * of get_buffer to be used. (On machines with wider words, an even larger + * buffer could be used.) However, on some machines 32-bit shifts are + * quite slow and take time proportional to the number of places shifted. + * (This is true with most PC compilers, for instance.) In this case it may + * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the + * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. + */ + +#ifdef SLOW_SHIFT_32 +#define MIN_GET_BITS 15 /* minimum allowable value */ +#else +#define MIN_GET_BITS (BIT_BUF_SIZE-7) +#endif + + +LOCAL(boolean) +jpeg_fill_bit_buffer (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + int nbits) +/* Load up the bit buffer to a depth of at least nbits */ +{ + /* Copy heavily used state fields into locals (hopefully registers) */ + register const JOCTET * next_input_byte = state->next_input_byte; + register size_t bytes_in_buffer = state->bytes_in_buffer; + j_decompress_ptr cinfo = state->cinfo; + + /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ + /* (It is assumed that no request will be for more than that many bits.) */ + /* We fail to do so only if we hit a marker or are forced to suspend. */ + + if (cinfo->unread_marker == 0) { /* cannot advance past a marker */ + while (bits_left < MIN_GET_BITS) { + register int c; + + /* Attempt to read a byte */ + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + + /* If it's 0xFF, check and discard stuffed zero byte */ + if (c == 0xFF) { + /* Loop here to discard any padding FF's on terminating marker, + * so that we can save a valid unread_marker value. NOTE: we will + * accept multiple FF's followed by a 0 as meaning a single FF data + * byte. This data pattern is not valid according to the standard. + */ + do { + if (bytes_in_buffer == 0) { + if (! (*cinfo->src->fill_input_buffer) (cinfo)) + return FALSE; + next_input_byte = cinfo->src->next_input_byte; + bytes_in_buffer = cinfo->src->bytes_in_buffer; + } + bytes_in_buffer--; + c = GETJOCTET(*next_input_byte++); + } while (c == 0xFF); + + if (c == 0) { + /* Found FF/00, which represents an FF data byte */ + c = 0xFF; + } else { + /* Oops, it's actually a marker indicating end of compressed data. + * Save the marker code for later use. + * Fine point: it might appear that we should save the marker into + * bitread working state, not straight into permanent state. But + * once we have hit a marker, we cannot need to suspend within the + * current MCU, because we will read no more bytes from the data + * source. So it is OK to update permanent state right away. + */ + cinfo->unread_marker = c; + /* See if we need to insert some fake zero bits. */ + goto no_more_bytes; + } + } + + /* OK, load c into get_buffer */ + get_buffer = (get_buffer << 8) | c; + bits_left += 8; + } /* end while */ + } else { + no_more_bytes: + /* We get here if we've read the marker that terminates the compressed + * data segment. There should be enough bits in the buffer register + * to satisfy the request; if so, no problem. + */ + if (nbits > bits_left) { + /* Uh-oh. Report corrupted data to user and stuff zeroes into + * the data stream, so that we can produce some kind of image. + * We use a nonvolatile flag to ensure that only one warning message + * appears per data segment. + */ + if (! ((huff_entropy_ptr) cinfo->entropy)->insufficient_data) { + WARNMS(cinfo, JWRN_HIT_MARKER); + ((huff_entropy_ptr) cinfo->entropy)->insufficient_data = TRUE; + } + /* Fill the buffer with zero bits */ + get_buffer <<= MIN_GET_BITS - bits_left; + bits_left = MIN_GET_BITS; + } + } + + /* Unload the local registers */ + state->next_input_byte = next_input_byte; + state->bytes_in_buffer = bytes_in_buffer; + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + return TRUE; +} + + +/* + * Figure F.12: extend sign bit. + * On some machines, a shift and sub will be faster than a table lookup. + */ + +#ifdef AVOID_TABLES + +#define BIT_MASK(nbits) ((1<<(nbits))-1) +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) - ((1<<(s))-1) : (x)) + +#else + +#define BIT_MASK(nbits) bmask[nbits] +#define HUFF_EXTEND(x,s) ((x) <= bmask[(s) - 1] ? (x) - bmask[s] : (x)) + +static const int bmask[16] = /* bmask[n] is mask for n rightmost bits */ + { 0, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, + 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF }; + +#endif /* AVOID_TABLES */ + + +/* + * Out-of-line code for Huffman code decoding. + */ + +LOCAL(int) +jpeg_huff_decode (bitread_working_state * state, + register bit_buf_type get_buffer, register int bits_left, + d_derived_tbl * htbl, int min_bits) +{ + register int l = min_bits; + register INT32 code; + + /* HUFF_DECODE has determined that the code is at least min_bits */ + /* bits long, so fetch that many bits in one swoop. */ + + CHECK_BIT_BUFFER(*state, l, return -1); + code = GET_BITS(l); + + /* Collect the rest of the Huffman code one bit at a time. */ + /* This is per Figure F.16 in the JPEG spec. */ + + while (code > htbl->maxcode[l]) { + code <<= 1; + CHECK_BIT_BUFFER(*state, 1, return -1); + code |= GET_BITS(1); + l++; + } + + /* Unload the local registers */ + state->get_buffer = get_buffer; + state->bits_left = bits_left; + + /* With garbage input we may reach the sentinel value l = 17. */ + + if (l > 16) { + WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); + return 0; /* fake a zero as the safest result */ + } + + return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ]; +} + + +/* + * Check for a restart marker & resynchronize decoder. + * Returns FALSE if must suspend. + */ + +LOCAL(boolean) +process_restart (j_decompress_ptr cinfo) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int ci; + + /* Throw away any unused bits remaining in bit buffer; */ + /* include any full bytes in next_marker's count of discarded bytes */ + cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; + entropy->bitstate.bits_left = 0; + + /* Advance past the RSTn marker */ + if (! (*cinfo->marker->read_restart_marker) (cinfo)) + return FALSE; + + /* Re-initialize DC predictions to 0 */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) + entropy->saved.last_dc_val[ci] = 0; + /* Re-init EOB run count, too */ + entropy->saved.EOBRUN = 0; + + /* Reset restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; + + /* Reset out-of-data flag, unless read_restart_marker left us smack up + * against a marker. In that case we will end up treating the next data + * segment as empty, and we can avoid producing bogus output pixels by + * leaving the flag set. + */ + if (cinfo->unread_marker == 0) + entropy->insufficient_data = FALSE; + + return TRUE; +} + + +/* + * Huffman MCU decoding. + * Each of these routines decodes and returns one MCU's worth of + * Huffman-compressed coefficients. + * The coefficients are reordered from zigzag order into natural array order, + * but are not dequantized. + * + * The i'th block of the MCU is stored into the block pointed to by + * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. + * (Wholesale zeroing is usually a little faster than retail...) + * + * We return FALSE if data source requested suspension. In that case no + * changes have been made to permanent state. (Exception: some output + * coefficients may already have been assigned. This is harmless for + * spectral selection, since we'll just re-assign them on the next call. + * Successive approximation AC refinement has to be more careful, however.) + */ + +/* + * MCU decoding for DC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int Al = cinfo->Al; + register int s, r; + int blkn, ci; + JBLOCKROW block; + BITREAD_STATE_VARS; + savable_state state; + d_derived_tbl * tbl; + jpeg_component_info * compptr; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + tbl = entropy->derived_tbls[compptr->dc_tbl_no]; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + HUFF_DECODE(s, br_state, tbl, return FALSE, label1); + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + + /* Convert DC difference to actual value, update last_dc_val */ + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */ + (*block)[0] = (JCOEF) (s << Al); + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC initial scan (either spectral selection, + * or first pass of successive approximation). + */ + +METHODDEF(boolean) +decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int s, k, r; + unsigned int EOBRUN; + int Se, Al; + const int * natural_order; + JBLOCKROW block; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + Se = cinfo->Se; + Al = cinfo->Al; + natural_order = cinfo->natural_order; + + /* Load up working state. + * We can avoid loading/saving bitread state if in an EOB run. + */ + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + + if (EOBRUN) /* if it's a band of zeroes... */ + EOBRUN--; /* ...process it now (we do nothing) */ + else { + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + for (k = cinfo->Ss; k <= Se; k++) { + HUFF_DECODE(s, br_state, tbl, return FALSE, label2); + r = s >> 4; + s &= 15; + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Scale and output coefficient in natural (dezigzagged) order */ + (*block)[natural_order[k]] = (JCOEF) (s << Al); + } else { + if (r != 15) { /* EOBr, run length is 2^r + appended bits */ + if (r) { /* EOBr, r > 0 */ + EOBRUN = 1 << r; + CHECK_BIT_BUFFER(br_state, r, return FALSE); + r = GET_BITS(r); + EOBRUN += r; + EOBRUN--; /* this band is processed at this moment */ + } + break; /* force end-of-band */ + } + k += 15; /* ZRL: skip 15 zeroes in band */ + } + } + + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + } + + /* Completed MCU, so update state */ + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for DC successive approximation refinement scan. + * Note: we assume such scans can be multi-component, although the spec + * is not very clear on the point. + */ + +METHODDEF(boolean) +decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + int blkn; + JBLOCKROW block; + BITREAD_STATE_VARS; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* Not worth the cycles to check insufficient_data here, + * since we will not change the data anyway if we read zeroes. + */ + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + block = MCU_data[blkn]; + + /* Encoded data is simply the next bit of the two's-complement DC value */ + CHECK_BIT_BUFFER(br_state, 1, return FALSE); + if (GET_BITS(1)) + (*block)[0] |= p1; + /* Note: since we use |=, repeating the assignment later is safe */ + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * MCU decoding for AC successive approximation refinement scan. + */ + +METHODDEF(boolean) +decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + register int s, k, r; + unsigned int EOBRUN; + int Se, p1, m1; + const int * natural_order; + JBLOCKROW block; + JCOEFPTR thiscoef; + BITREAD_STATE_VARS; + d_derived_tbl * tbl; + int num_newnz; + int newnz_pos[DCTSIZE2]; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, don't modify the MCU. + */ + if (! entropy->insufficient_data) { + + Se = cinfo->Se; + p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ + m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ + natural_order = cinfo->natural_order; + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ + + /* There is always only one block per MCU */ + block = MCU_data[0]; + tbl = entropy->ac_derived_tbl; + + /* If we are forced to suspend, we must undo the assignments to any newly + * nonzero coefficients in the block, because otherwise we'd get confused + * next time about which coefficients were already nonzero. + * But we need not undo addition of bits to already-nonzero coefficients; + * instead, we can test the current bit to see if we already did it. + */ + num_newnz = 0; + + /* initialize coefficient loop counter to start of band */ + k = cinfo->Ss; + + if (EOBRUN == 0) { + do { + HUFF_DECODE(s, br_state, tbl, goto undoit, label3); + r = s >> 4; + s &= 15; + if (s) { + if (s != 1) /* size of new coef should always be 1 */ + WARNMS(cinfo, JWRN_HUFF_BAD_CODE); + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) + s = p1; /* newly nonzero coef is positive */ + else + s = m1; /* newly nonzero coef is negative */ + } else { + if (r != 15) { + EOBRUN = 1 << r; /* EOBr, run length is 2^r + appended bits */ + if (r) { + CHECK_BIT_BUFFER(br_state, r, goto undoit); + r = GET_BITS(r); + EOBRUN += r; + } + break; /* rest of block is handled by EOB logic */ + } + /* note s = 0 for processing ZRL */ + } + /* Advance over already-nonzero coefs and r still-zero coefs, + * appending correction bits to the nonzeroes. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + do { + thiscoef = *block + natural_order[k]; + if (*thiscoef) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ + if (*thiscoef >= 0) + *thiscoef += p1; + else + *thiscoef += m1; + } + } + } else { + if (--r < 0) + break; /* reached target zero coefficient */ + } + k++; + } while (k <= Se); + if (s) { + int pos = natural_order[k]; + /* Output newly nonzero coefficient */ + (*block)[pos] = (JCOEF) s; + /* Remember its position in case we have to suspend */ + newnz_pos[num_newnz++] = pos; + } + k++; + } while (k <= Se); + } + + if (EOBRUN) { + /* Scan any remaining coefficient positions after the end-of-band + * (the last newly nonzero coefficient, if any). Append a correction + * bit to each already-nonzero coefficient. A correction bit is 1 + * if the absolute value of the coefficient must be increased. + */ + do { + thiscoef = *block + natural_order[k]; + if (*thiscoef) { + CHECK_BIT_BUFFER(br_state, 1, goto undoit); + if (GET_BITS(1)) { + if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ + if (*thiscoef >= 0) + *thiscoef += p1; + else + *thiscoef += m1; + } + } + } + k++; + } while (k <= Se); + /* Count one block completed in EOB run */ + EOBRUN--; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; + +undoit: + /* Re-zero any output coefficients that we made newly nonzero */ + while (num_newnz) + (*block)[newnz_pos[--num_newnz]] = 0; + + return FALSE; +} + + +/* + * Decode one MCU's worth of Huffman-compressed coefficients, + * partial blocks. + */ + +METHODDEF(boolean) +decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + const int * natural_order; + int Se, blkn; + BITREAD_STATE_VARS; + savable_state state; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + natural_order = cinfo->natural_order; + Se = cinfo->lim_Se; + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + JBLOCKROW block = MCU_data[blkn]; + d_derived_tbl * htbl; + register int s, k, r; + int coef_limit, ci; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + htbl = entropy->dc_cur_tbls[blkn]; + HUFF_DECODE(s, br_state, htbl, return FALSE, label1); + + htbl = entropy->ac_cur_tbls[blkn]; + k = 1; + coef_limit = entropy->coef_limit[blkn]; + if (coef_limit) { + /* Convert DC difference to actual value, update last_dc_val */ + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + ci = cinfo->MCU_membership[blkn]; + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Output the DC coefficient */ + (*block)[0] = (JCOEF) s; + + /* Section F.2.2.2: decode the AC coefficients */ + /* Since zeroes are skipped, output area must be cleared beforehand */ + for (; k < coef_limit; k++) { + HUFF_DECODE(s, br_state, htbl, return FALSE, label2); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Output coefficient in natural (dezigzagged) order. + * Note: the extra entries in natural_order[] will save us + * if k > Se, which could happen if the data is corrupted. + */ + (*block)[natural_order[k]] = (JCOEF) s; + } else { + if (r != 15) + goto EndOfBlock; + k += 15; + } + } + } else { + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } + } + + /* Section F.2.2.2: decode the AC coefficients */ + /* In this path we just discard the values */ + for (; k <= Se; k++) { + HUFF_DECODE(s, br_state, htbl, return FALSE, label3); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } else { + if (r != 15) + break; + k += 15; + } + } + + EndOfBlock: ; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * Decode one MCU's worth of Huffman-compressed coefficients, + * full-size blocks. + */ + +METHODDEF(boolean) +decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int blkn; + BITREAD_STATE_VARS; + savable_state state; + + /* Process restart marker if needed; may have to suspend */ + if (cinfo->restart_interval) { + if (entropy->restarts_to_go == 0) + if (! process_restart(cinfo)) + return FALSE; + } + + /* If we've run out of data, just leave the MCU set to zeroes. + * This way, we return uniform gray for the remainder of the segment. + */ + if (! entropy->insufficient_data) { + + /* Load up working state */ + BITREAD_LOAD_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(state, entropy->saved); + + /* Outer loop handles each block in the MCU */ + + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + JBLOCKROW block = MCU_data[blkn]; + d_derived_tbl * htbl; + register int s, k, r; + int coef_limit, ci; + + /* Decode a single block's worth of coefficients */ + + /* Section F.2.2.1: decode the DC coefficient difference */ + htbl = entropy->dc_cur_tbls[blkn]; + HUFF_DECODE(s, br_state, htbl, return FALSE, label1); + + htbl = entropy->ac_cur_tbls[blkn]; + k = 1; + coef_limit = entropy->coef_limit[blkn]; + if (coef_limit) { + /* Convert DC difference to actual value, update last_dc_val */ + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + } + ci = cinfo->MCU_membership[blkn]; + s += state.last_dc_val[ci]; + state.last_dc_val[ci] = s; + /* Output the DC coefficient */ + (*block)[0] = (JCOEF) s; + + /* Section F.2.2.2: decode the AC coefficients */ + /* Since zeroes are skipped, output area must be cleared beforehand */ + for (; k < coef_limit; k++) { + HUFF_DECODE(s, br_state, htbl, return FALSE, label2); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + r = GET_BITS(s); + s = HUFF_EXTEND(r, s); + /* Output coefficient in natural (dezigzagged) order. + * Note: the extra entries in jpeg_natural_order[] will save us + * if k >= DCTSIZE2, which could happen if the data is corrupted. + */ + (*block)[jpeg_natural_order[k]] = (JCOEF) s; + } else { + if (r != 15) + goto EndOfBlock; + k += 15; + } + } + } else { + if (s) { + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } + } + + /* Section F.2.2.2: decode the AC coefficients */ + /* In this path we just discard the values */ + for (; k < DCTSIZE2; k++) { + HUFF_DECODE(s, br_state, htbl, return FALSE, label3); + + r = s >> 4; + s &= 15; + + if (s) { + k += r; + CHECK_BIT_BUFFER(br_state, s, return FALSE); + DROP_BITS(s); + } else { + if (r != 15) + break; + k += 15; + } + } + + EndOfBlock: ; + } + + /* Completed MCU, so update state */ + BITREAD_SAVE_STATE(cinfo,entropy->bitstate); + ASSIGN_STATE(entropy->saved, state); + } + + /* Account for restart interval (no-op if not using restarts) */ + entropy->restarts_to_go--; + + return TRUE; +} + + +/* + * Initialize for a Huffman-compressed scan. + */ + +METHODDEF(void) +start_pass_huff_decoder (j_decompress_ptr cinfo) +{ + huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int ci, blkn, tbl, i; + jpeg_component_info * compptr; + + if (cinfo->progressive_mode) { + /* Validate progressive scan parameters */ + if (cinfo->Ss == 0) { + if (cinfo->Se != 0) + goto bad; + } else { + /* need not check Ss/Se < 0 since they came from unsigned bytes */ + if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se) + goto bad; + /* AC scans may have only one component */ + if (cinfo->comps_in_scan != 1) + goto bad; + } + if (cinfo->Ah != 0) { + /* Successive approximation refinement scan: must have Al = Ah-1. */ + if (cinfo->Ah-1 != cinfo->Al) + goto bad; + } + if (cinfo->Al > 13) { /* need not check for < 0 */ + /* Arguably the maximum Al value should be less than 13 for 8-bit precision, + * but the spec doesn't say so, and we try to be liberal about what we + * accept. Note: large Al values could result in out-of-range DC + * coefficients during early scans, leading to bizarre displays due to + * overflows in the IDCT math. But we won't crash. + */ + bad: + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + } + /* Update progression status, and verify that scan order is legal. + * Note that inter-scan inconsistencies are treated as warnings + * not fatal errors ... not clear if this is right way to behave. + */ + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + int coefi, cindex = cinfo->cur_comp_info[ci]->component_index; + int *coef_bit_ptr = & cinfo->coef_bits[cindex][0]; + if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); + for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { + int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; + if (cinfo->Ah != expected) + WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); + coef_bit_ptr[coefi] = cinfo->Al; + } + } + + /* Select MCU decoding routine */ + if (cinfo->Ah == 0) { + if (cinfo->Ss == 0) + entropy->pub.decode_mcu = decode_mcu_DC_first; + else + entropy->pub.decode_mcu = decode_mcu_AC_first; + } else { + if (cinfo->Ss == 0) + entropy->pub.decode_mcu = decode_mcu_DC_refine; + else + entropy->pub.decode_mcu = decode_mcu_AC_refine; + } + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Make sure requested tables are present, and compute derived tables. + * We may build same derived table more than once, but it's not expensive. + */ + if (cinfo->Ss == 0) { + if (cinfo->Ah == 0) { /* DC refinement needs no table */ + tbl = compptr->dc_tbl_no; + jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, + & entropy->derived_tbls[tbl]); + } + } else { + tbl = compptr->ac_tbl_no; + jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, + & entropy->derived_tbls[tbl]); + /* remember the single active table */ + entropy->ac_derived_tbl = entropy->derived_tbls[tbl]; + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Initialize private state variables */ + entropy->saved.EOBRUN = 0; + } else { + /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. + * This ought to be an error condition, but we make it a warning because + * there are some baseline files out there with all zeroes in these bytes. + */ + if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 || + ((cinfo->is_baseline || cinfo->Se < DCTSIZE2) && + cinfo->Se != cinfo->lim_Se)) + WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); + + /* Select MCU decoding routine */ + /* We retain the hard-coded case for full-size blocks. + * This is not necessary, but it appears that this version is slightly + * more performant in the given implementation. + * With an improved implementation we would prefer a single optimized + * function. + */ + if (cinfo->lim_Se != DCTSIZE2-1) + entropy->pub.decode_mcu = decode_mcu_sub; + else + entropy->pub.decode_mcu = decode_mcu; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Compute derived values for Huffman tables */ + /* We may do this more than once for a table, but it's not expensive */ + tbl = compptr->dc_tbl_no; + jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, + & entropy->dc_derived_tbls[tbl]); + if (cinfo->lim_Se) { /* AC needs no table when not present */ + tbl = compptr->ac_tbl_no; + jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, + & entropy->ac_derived_tbls[tbl]); + } + /* Initialize DC predictions to 0 */ + entropy->saved.last_dc_val[ci] = 0; + } + + /* Precalculate decoding info for each block in an MCU of this scan */ + for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { + ci = cinfo->MCU_membership[blkn]; + compptr = cinfo->cur_comp_info[ci]; + /* Precalculate which table to use for each block */ + entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; + entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; + /* Decide whether we really care about the coefficient values */ + if (compptr->component_needed) { + ci = compptr->DCT_v_scaled_size; + i = compptr->DCT_h_scaled_size; + switch (cinfo->lim_Se) { + case (1*1-1): + entropy->coef_limit[blkn] = 1; + break; + case (2*2-1): + if (ci <= 0 || ci > 2) ci = 2; + if (i <= 0 || i > 2) i = 2; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order2[ci - 1][i - 1]; + break; + case (3*3-1): + if (ci <= 0 || ci > 3) ci = 3; + if (i <= 0 || i > 3) i = 3; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order3[ci - 1][i - 1]; + break; + case (4*4-1): + if (ci <= 0 || ci > 4) ci = 4; + if (i <= 0 || i > 4) i = 4; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order4[ci - 1][i - 1]; + break; + case (5*5-1): + if (ci <= 0 || ci > 5) ci = 5; + if (i <= 0 || i > 5) i = 5; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order5[ci - 1][i - 1]; + break; + case (6*6-1): + if (ci <= 0 || ci > 6) ci = 6; + if (i <= 0 || i > 6) i = 6; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order6[ci - 1][i - 1]; + break; + case (7*7-1): + if (ci <= 0 || ci > 7) ci = 7; + if (i <= 0 || i > 7) i = 7; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order7[ci - 1][i - 1]; + break; + default: + if (ci <= 0 || ci > 8) ci = 8; + if (i <= 0 || i > 8) i = 8; + entropy->coef_limit[blkn] = 1 + jpeg_zigzag_order[ci - 1][i - 1]; + break; + } + } else { + entropy->coef_limit[blkn] = 0; + } + } + } + + /* Initialize bitread state variables */ + entropy->bitstate.bits_left = 0; + entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ + entropy->insufficient_data = FALSE; + + /* Initialize restart counter */ + entropy->restarts_to_go = cinfo->restart_interval; +} + + +/* + * Module initialization routine for Huffman entropy decoding. + */ + +GLOBAL(void) +jinit_huff_decoder (j_decompress_ptr cinfo) +{ + huff_entropy_ptr entropy; + int i; + + entropy = (huff_entropy_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(huff_entropy_decoder)); + cinfo->entropy = &entropy->pub; + entropy->pub.start_pass = start_pass_huff_decoder; + + if (cinfo->progressive_mode) { + /* Create progression status table */ + int *coef_bit_ptr, ci; + cinfo->coef_bits = (int (*)[DCTSIZE2]) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->num_components*DCTSIZE2*SIZEOF(int)); + coef_bit_ptr = & cinfo->coef_bits[0][0]; + for (ci = 0; ci < cinfo->num_components; ci++) + for (i = 0; i < DCTSIZE2; i++) + *coef_bit_ptr++ = -1; + + /* Mark derived tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->derived_tbls[i] = NULL; + } + } else { + /* Mark tables unallocated */ + for (i = 0; i < NUM_HUFF_TBLS; i++) { + entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; + } + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdinput.c b/thirdparty/LibJPEG/jpeg-9/jdinput.c new file mode 100644 index 0000000..2c5c717 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdinput.c @@ -0,0 +1,661 @@ +/* + * jdinput.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2002-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains input control logic for the JPEG decompressor. + * These routines are concerned with controlling the decompressor's input + * processing (marker reading and coefficient decoding). The actual input + * reading is done in jdmarker.c, jdhuff.c, and jdarith.c. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private state */ + +typedef struct { + struct jpeg_input_controller pub; /* public fields */ + + int inheaders; /* Nonzero until first SOS is reached */ +} my_input_controller; + +typedef my_input_controller * my_inputctl_ptr; + + +/* Forward declarations */ +METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo)); + + +/* + * Routines to calculate various quantities related to the size of the image. + */ + + +/* + * Compute output image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + */ + +GLOBAL(void) +jpeg_core_output_dimensions (j_decompress_ptr cinfo) +/* Do computations that are needed before master selection phase. + * This function is used for transcoding and full decompression. + */ +{ +#ifdef IDCT_SCALING_SUPPORTED + int ci; + jpeg_component_info *compptr; + + /* Compute actual output image dimensions and DCT scaling choices. */ + if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom) { + /* Provide 1/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 1; + cinfo->min_DCT_v_scaled_size = 1; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 2) { + /* Provide 2/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 2L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 2L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 2; + cinfo->min_DCT_v_scaled_size = 2; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 3) { + /* Provide 3/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 3L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 3L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 3; + cinfo->min_DCT_v_scaled_size = 3; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 4) { + /* Provide 4/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 4L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 4L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 4; + cinfo->min_DCT_v_scaled_size = 4; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 5) { + /* Provide 5/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 5L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 5L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 5; + cinfo->min_DCT_v_scaled_size = 5; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 6) { + /* Provide 6/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 6L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 6L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 6; + cinfo->min_DCT_v_scaled_size = 6; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 7) { + /* Provide 7/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 7L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 7L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 7; + cinfo->min_DCT_v_scaled_size = 7; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 8) { + /* Provide 8/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 8L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 8L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 8; + cinfo->min_DCT_v_scaled_size = 8; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 9) { + /* Provide 9/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 9L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 9L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 9; + cinfo->min_DCT_v_scaled_size = 9; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 10) { + /* Provide 10/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 10L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 10L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 10; + cinfo->min_DCT_v_scaled_size = 10; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 11) { + /* Provide 11/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 11L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 11L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 11; + cinfo->min_DCT_v_scaled_size = 11; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 12) { + /* Provide 12/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 12L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 12L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 12; + cinfo->min_DCT_v_scaled_size = 12; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 13) { + /* Provide 13/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 13L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 13L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 13; + cinfo->min_DCT_v_scaled_size = 13; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 14) { + /* Provide 14/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 14L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 14L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 14; + cinfo->min_DCT_v_scaled_size = 14; + } else if (cinfo->scale_num * cinfo->block_size <= cinfo->scale_denom * 15) { + /* Provide 15/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 15L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 15L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 15; + cinfo->min_DCT_v_scaled_size = 15; + } else { + /* Provide 16/block_size scaling */ + cinfo->output_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * 16L, (long) cinfo->block_size); + cinfo->output_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * 16L, (long) cinfo->block_size); + cinfo->min_DCT_h_scaled_size = 16; + cinfo->min_DCT_v_scaled_size = 16; + } + + /* Recompute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size; + compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size; + } + +#else /* !IDCT_SCALING_SUPPORTED */ + + /* Hardwire it to "no scaling" */ + cinfo->output_width = cinfo->image_width; + cinfo->output_height = cinfo->image_height; + /* jdinput.c has already initialized DCT_scaled_size, + * and has computed unscaled downsampled_width and downsampled_height. + */ + +#endif /* IDCT_SCALING_SUPPORTED */ +} + + +LOCAL(void) +initial_setup (j_decompress_ptr cinfo) +/* Called once, when first SOS marker is reached */ +{ + int ci; + jpeg_component_info *compptr; + + /* Make sure image isn't bigger than I can handle */ + if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || + (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) + ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); + + /* For now, precision must match compiled-in value... */ + if (cinfo->data_precision != BITS_IN_JSAMPLE) + ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); + + /* Check that number of components won't exceed internal array sizes */ + if (cinfo->num_components > MAX_COMPONENTS) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, + MAX_COMPONENTS); + + /* Compute maximum sampling factors; check factor validity */ + cinfo->max_h_samp_factor = 1; + cinfo->max_v_samp_factor = 1; + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || + compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) + ERREXIT(cinfo, JERR_BAD_SAMPLING); + cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, + compptr->h_samp_factor); + cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, + compptr->v_samp_factor); + } + + /* Derive block_size, natural_order, and lim_Se */ + if (cinfo->is_baseline || (cinfo->progressive_mode && + cinfo->comps_in_scan)) { /* no pseudo SOS marker */ + cinfo->block_size = DCTSIZE; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + } else + switch (cinfo->Se) { + case (1*1-1): + cinfo->block_size = 1; + cinfo->natural_order = jpeg_natural_order; /* not needed */ + cinfo->lim_Se = cinfo->Se; + break; + case (2*2-1): + cinfo->block_size = 2; + cinfo->natural_order = jpeg_natural_order2; + cinfo->lim_Se = cinfo->Se; + break; + case (3*3-1): + cinfo->block_size = 3; + cinfo->natural_order = jpeg_natural_order3; + cinfo->lim_Se = cinfo->Se; + break; + case (4*4-1): + cinfo->block_size = 4; + cinfo->natural_order = jpeg_natural_order4; + cinfo->lim_Se = cinfo->Se; + break; + case (5*5-1): + cinfo->block_size = 5; + cinfo->natural_order = jpeg_natural_order5; + cinfo->lim_Se = cinfo->Se; + break; + case (6*6-1): + cinfo->block_size = 6; + cinfo->natural_order = jpeg_natural_order6; + cinfo->lim_Se = cinfo->Se; + break; + case (7*7-1): + cinfo->block_size = 7; + cinfo->natural_order = jpeg_natural_order7; + cinfo->lim_Se = cinfo->Se; + break; + case (8*8-1): + cinfo->block_size = 8; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (9*9-1): + cinfo->block_size = 9; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (10*10-1): + cinfo->block_size = 10; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (11*11-1): + cinfo->block_size = 11; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (12*12-1): + cinfo->block_size = 12; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (13*13-1): + cinfo->block_size = 13; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (14*14-1): + cinfo->block_size = 14; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (15*15-1): + cinfo->block_size = 15; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + case (16*16-1): + cinfo->block_size = 16; + cinfo->natural_order = jpeg_natural_order; + cinfo->lim_Se = DCTSIZE2-1; + break; + default: + ERREXIT4(cinfo, JERR_BAD_PROGRESSION, + cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); + break; + } + + /* We initialize DCT_scaled_size and min_DCT_scaled_size to block_size. + * In the full decompressor, + * this will be overridden by jpeg_calc_output_dimensions in jdmaster.c; + * but in the transcoder, + * jpeg_calc_output_dimensions is not used, so we must do it here. + */ + cinfo->min_DCT_h_scaled_size = cinfo->block_size; + cinfo->min_DCT_v_scaled_size = cinfo->block_size; + + /* Compute dimensions of components */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + compptr->DCT_h_scaled_size = cinfo->block_size; + compptr->DCT_v_scaled_size = cinfo->block_size; + /* Size in DCT blocks */ + compptr->width_in_blocks = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + compptr->height_in_blocks = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + /* downsampled_width and downsampled_height will also be overridden by + * jdmaster.c if we are doing full decompression. The transcoder library + * doesn't use these values, but the calling application might. + */ + /* Size in samples */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, + (long) cinfo->max_h_samp_factor); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, + (long) cinfo->max_v_samp_factor); + /* Mark component needed, until color conversion says otherwise */ + compptr->component_needed = TRUE; + /* Mark no quantization table yet saved for component */ + compptr->quant_table = NULL; + } + + /* Compute number of fully interleaved MCU rows. */ + cinfo->total_iMCU_rows = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + + /* Decide whether file contains multiple scans */ + if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode) + cinfo->inputctl->has_multiple_scans = TRUE; + else + cinfo->inputctl->has_multiple_scans = FALSE; +} + + +LOCAL(void) +per_scan_setup (j_decompress_ptr cinfo) +/* Do computations that are needed before processing a JPEG scan */ +/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ +{ + int ci, mcublks, tmp; + jpeg_component_info *compptr; + + if (cinfo->comps_in_scan == 1) { + + /* Noninterleaved (single-component) scan */ + compptr = cinfo->cur_comp_info[0]; + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = compptr->width_in_blocks; + cinfo->MCU_rows_in_scan = compptr->height_in_blocks; + + /* For noninterleaved scan, always one block per MCU */ + compptr->MCU_width = 1; + compptr->MCU_height = 1; + compptr->MCU_blocks = 1; + compptr->MCU_sample_width = compptr->DCT_h_scaled_size; + compptr->last_col_width = 1; + /* For noninterleaved scans, it is convenient to define last_row_height + * as the number of block rows present in the last iMCU row. + */ + tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); + if (tmp == 0) tmp = compptr->v_samp_factor; + compptr->last_row_height = tmp; + + /* Prepare array describing MCU composition */ + cinfo->blocks_in_MCU = 1; + cinfo->MCU_membership[0] = 0; + + } else { + + /* Interleaved (multi-component) scan */ + if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) + ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, + MAX_COMPS_IN_SCAN); + + /* Overall image size in MCUs */ + cinfo->MCUs_per_row = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width, + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + cinfo->MCU_rows_in_scan = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height, + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + + cinfo->blocks_in_MCU = 0; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* Sampling factors give # of blocks of component in each MCU */ + compptr->MCU_width = compptr->h_samp_factor; + compptr->MCU_height = compptr->v_samp_factor; + compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; + compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size; + /* Figure number of non-dummy blocks in last MCU column & row */ + tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); + if (tmp == 0) tmp = compptr->MCU_width; + compptr->last_col_width = tmp; + tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); + if (tmp == 0) tmp = compptr->MCU_height; + compptr->last_row_height = tmp; + /* Prepare array describing MCU composition */ + mcublks = compptr->MCU_blocks; + if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU) + ERREXIT(cinfo, JERR_BAD_MCU_SIZE); + while (mcublks-- > 0) { + cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; + } + } + + } +} + + +/* + * Save away a copy of the Q-table referenced by each component present + * in the current scan, unless already saved during a prior scan. + * + * In a multiple-scan JPEG file, the encoder could assign different components + * the same Q-table slot number, but change table definitions between scans + * so that each component uses a different Q-table. (The IJG encoder is not + * currently capable of doing this, but other encoders might.) Since we want + * to be able to dequantize all the components at the end of the file, this + * means that we have to save away the table actually used for each component. + * We do this by copying the table at the start of the first scan containing + * the component. + * The JPEG spec prohibits the encoder from changing the contents of a Q-table + * slot between scans of a component using that slot. If the encoder does so + * anyway, this decoder will simply use the Q-table values that were current + * at the start of the first scan for the component. + * + * The decompressor output side looks only at the saved quant tables, + * not at the current Q-table slots. + */ + +LOCAL(void) +latch_quant_tables (j_decompress_ptr cinfo) +{ + int ci, qtblno; + jpeg_component_info *compptr; + JQUANT_TBL * qtbl; + + for (ci = 0; ci < cinfo->comps_in_scan; ci++) { + compptr = cinfo->cur_comp_info[ci]; + /* No work if we already saved Q-table for this component */ + if (compptr->quant_table != NULL) + continue; + /* Make sure specified quantization table is present */ + qtblno = compptr->quant_tbl_no; + if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || + cinfo->quant_tbl_ptrs[qtblno] == NULL) + ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); + /* OK, save away the quantization table */ + qtbl = (JQUANT_TBL *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(JQUANT_TBL)); + MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); + compptr->quant_table = qtbl; + } +} + + +/* + * Initialize the input modules to read a scan of compressed data. + * The first call to this is done by jdmaster.c after initializing + * the entire decompressor (during jpeg_start_decompress). + * Subsequent calls come from consume_markers, below. + */ + +METHODDEF(void) +start_input_pass (j_decompress_ptr cinfo) +{ + per_scan_setup(cinfo); + latch_quant_tables(cinfo); + (*cinfo->entropy->start_pass) (cinfo); + (*cinfo->coef->start_input_pass) (cinfo); + cinfo->inputctl->consume_input = cinfo->coef->consume_data; +} + + +/* + * Finish up after inputting a compressed-data scan. + * This is called by the coefficient controller after it's read all + * the expected data of the scan. + */ + +METHODDEF(void) +finish_input_pass (j_decompress_ptr cinfo) +{ + cinfo->inputctl->consume_input = consume_markers; +} + + +/* + * Read JPEG markers before, between, or after compressed-data scans. + * Change state as necessary when a new scan is reached. + * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + * + * The consume_input method pointer points either here or to the + * coefficient controller's consume_data routine, depending on whether + * we are reading a compressed data segment or inter-segment markers. + * + * Note: This function should NOT return a pseudo SOS marker (with zero + * component number) to the caller. A pseudo marker received by + * read_markers is processed and then skipped for other markers. + */ + +METHODDEF(int) +consume_markers (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + int val; + + if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ + return JPEG_REACHED_EOI; + + for (;;) { /* Loop to pass pseudo SOS marker */ + val = (*cinfo->marker->read_markers) (cinfo); + + switch (val) { + case JPEG_REACHED_SOS: /* Found SOS */ + if (inputctl->inheaders) { /* 1st SOS */ + if (inputctl->inheaders == 1) + initial_setup(cinfo); + if (cinfo->comps_in_scan == 0) { /* pseudo SOS marker */ + inputctl->inheaders = 2; + break; + } + inputctl->inheaders = 0; + /* Note: start_input_pass must be called by jdmaster.c + * before any more input can be consumed. jdapimin.c is + * responsible for enforcing this sequencing. + */ + } else { /* 2nd or later SOS marker */ + if (! inputctl->pub.has_multiple_scans) + ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ + if (cinfo->comps_in_scan == 0) /* unexpected pseudo SOS marker */ + break; + start_input_pass(cinfo); + } + return val; + case JPEG_REACHED_EOI: /* Found EOI */ + inputctl->pub.eoi_reached = TRUE; + if (inputctl->inheaders) { /* Tables-only datastream, apparently */ + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_NO_SOS); + } else { + /* Prevent infinite loop in coef ctlr's decompress_data routine + * if user set output_scan_number larger than number of scans. + */ + if (cinfo->output_scan_number > cinfo->input_scan_number) + cinfo->output_scan_number = cinfo->input_scan_number; + } + return val; + case JPEG_SUSPENDED: + return val; + default: + return val; + } + } +} + + +/* + * Reset state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; + + inputctl->pub.consume_input = consume_markers; + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = 1; + /* Reset other modules */ + (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); + (*cinfo->marker->reset_marker_reader) (cinfo); + /* Reset progression state -- would be cleaner if entropy decoder did this */ + cinfo->coef_bits = NULL; +} + + +/* + * Initialize the input controller module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_input_controller (j_decompress_ptr cinfo) +{ + my_inputctl_ptr inputctl; + + /* Create subobject in permanent pool */ + inputctl = (my_inputctl_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_input_controller)); + cinfo->inputctl = (struct jpeg_input_controller *) inputctl; + /* Initialize method pointers */ + inputctl->pub.consume_input = consume_markers; + inputctl->pub.reset_input_controller = reset_input_controller; + inputctl->pub.start_input_pass = start_input_pass; + inputctl->pub.finish_input_pass = finish_input_pass; + /* Initialize state: can't use reset_input_controller since we don't + * want to try to reset other modules yet. + */ + inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ + inputctl->pub.eoi_reached = FALSE; + inputctl->inheaders = 1; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdmainct.c b/thirdparty/LibJPEG/jpeg-9/jdmainct.c new file mode 100644 index 0000000..52091fb --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdmainct.c @@ -0,0 +1,513 @@ +/* + * jdmainct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2002-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the main buffer controller for decompression. + * The main buffer lies between the JPEG decompressor proper and the + * post-processor; it holds downsampled data in the JPEG colorspace. + * + * Note that this code is bypassed in raw-data mode, since the application + * supplies the equivalent of the main buffer in that case. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * In the current system design, the main buffer need never be a full-image + * buffer; any full-height buffers will be found inside the coefficient or + * postprocessing controllers. Nonetheless, the main controller is not + * trivial. Its responsibility is to provide context rows for upsampling/ + * rescaling, and doing this in an efficient fashion is a bit tricky. + * + * Postprocessor input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) + * sample rows of each component. (We require DCT_scaled_size values to be + * chosen such that these numbers are integers. In practice DCT_scaled_size + * values will likely be powers of two, so we actually have the stronger + * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.) + * Upsampling will typically produce max_v_samp_factor pixel rows from each + * row group (times any additional scale factor that the upsampler is + * applying). + * + * The coefficient controller will deliver data to us one iMCU row at a time; + * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or + * exactly min_DCT_scaled_size row groups. (This amount of data corresponds + * to one row of MCUs when the image is fully interleaved.) Note that the + * number of sample rows varies across components, but the number of row + * groups does not. Some garbage sample rows may be included in the last iMCU + * row at the bottom of the image. + * + * Depending on the vertical scaling algorithm used, the upsampler may need + * access to the sample row(s) above and below its current input row group. + * The upsampler is required to set need_context_rows TRUE at global selection + * time if so. When need_context_rows is FALSE, this controller can simply + * obtain one iMCU row at a time from the coefficient controller and dole it + * out as row groups to the postprocessor. + * + * When need_context_rows is TRUE, this controller guarantees that the buffer + * passed to postprocessing contains at least one row group's worth of samples + * above and below the row group(s) being processed. Note that the context + * rows "above" the first passed row group appear at negative row offsets in + * the passed buffer. At the top and bottom of the image, the required + * context rows are manufactured by duplicating the first or last real sample + * row; this avoids having special cases in the upsampling inner loops. + * + * The amount of context is fixed at one row group just because that's a + * convenient number for this controller to work with. The existing + * upsamplers really only need one sample row of context. An upsampler + * supporting arbitrary output rescaling might wish for more than one row + * group of context when shrinking the image; tough, we don't handle that. + * (This is justified by the assumption that downsizing will be handled mostly + * by adjusting the DCT_scaled_size values, so that the actual scale factor at + * the upsample step needn't be much less than one.) + * + * To provide the desired context, we have to retain the last two row groups + * of one iMCU row while reading in the next iMCU row. (The last row group + * can't be processed until we have another row group for its below-context, + * and so we have to save the next-to-last group too for its above-context.) + * We could do this most simply by copying data around in our buffer, but + * that'd be very slow. We can avoid copying any data by creating a rather + * strange pointer structure. Here's how it works. We allocate a workspace + * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number + * of row groups per iMCU row). We create two sets of redundant pointers to + * the workspace. Labeling the physical row groups 0 to M+1, the synthesized + * pointer lists look like this: + * M+1 M-1 + * master pointer --> 0 master pointer --> 0 + * 1 1 + * ... ... + * M-3 M-3 + * M-2 M + * M-1 M+1 + * M M-2 + * M+1 M-1 + * 0 0 + * We read alternate iMCU rows using each master pointer; thus the last two + * row groups of the previous iMCU row remain un-overwritten in the workspace. + * The pointer lists are set up so that the required context rows appear to + * be adjacent to the proper places when we pass the pointer lists to the + * upsampler. + * + * The above pictures describe the normal state of the pointer lists. + * At top and bottom of the image, we diddle the pointer lists to duplicate + * the first or last sample row as necessary (this is cheaper than copying + * sample rows around). + * + * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that + * situation each iMCU row provides only one row group so the buffering logic + * must be different (eg, we must read two iMCU rows before we can emit the + * first row group). For now, we simply do not support providing context + * rows when min_DCT_scaled_size is 1. That combination seems unlikely to + * be worth providing --- if someone wants a 1/8th-size preview, they probably + * want it quick and dirty, so a context-free upsampler is sufficient. + */ + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_main_controller pub; /* public fields */ + + /* Pointer to allocated workspace (M or M+2 row groups). */ + JSAMPARRAY buffer[MAX_COMPONENTS]; + + boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ + JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ + + /* Remaining fields are only used in the context case. */ + + /* These are the master pointers to the funny-order pointer lists. */ + JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ + + int whichptr; /* indicates which pointer set is now in use */ + int context_state; /* process_data state machine status */ + JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ + JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ +} my_main_controller; + +typedef my_main_controller * my_main_ptr; + +/* context_state values: */ +#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ +#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ +#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ + + +/* Forward declarations */ +METHODDEF(void) process_data_simple_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +METHODDEF(void) process_data_context_main + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) process_data_crank_post + JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); +#endif + + +LOCAL(void) +alloc_funny_pointers (j_decompress_ptr cinfo) +/* Allocate space for the funny pointer lists. + * This is done only once, not once per pass. + */ +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + int ci, rgroup; + int M = cinfo->min_DCT_v_scaled_size; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + /* Get top-level space for component array pointers. + * We alloc both arrays with one call to save a few cycles. + */ + mainp->xbuffer[0] = (JSAMPIMAGE) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); + mainp->xbuffer[1] = mainp->xbuffer[0] + cinfo->num_components; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ + /* Get space for pointer lists --- M+4 row groups in each list. + * We alloc both pointer lists with one call to save a few cycles. + */ + xbuf = (JSAMPARRAY) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW)); + xbuf += rgroup; /* want one row group at negative offsets */ + mainp->xbuffer[0][ci] = xbuf; + xbuf += rgroup * (M + 4); + mainp->xbuffer[1][ci] = xbuf; + } +} + + +LOCAL(void) +make_funny_pointers (j_decompress_ptr cinfo) +/* Create the funny pointer lists discussed in the comments above. + * The actual workspace is already allocated (in main->buffer), + * and the space for the pointer lists is allocated too. + * This routine just fills in the curiously ordered lists. + * This will be repeated at the beginning of each pass. + */ +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_DCT_v_scaled_size; + jpeg_component_info *compptr; + JSAMPARRAY buf, xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ + xbuf0 = mainp->xbuffer[0][ci]; + xbuf1 = mainp->xbuffer[1][ci]; + /* First copy the workspace pointers as-is */ + buf = mainp->buffer[ci]; + for (i = 0; i < rgroup * (M + 2); i++) { + xbuf0[i] = xbuf1[i] = buf[i]; + } + /* In the second list, put the last four row groups in swapped order */ + for (i = 0; i < rgroup * 2; i++) { + xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; + xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; + } + /* The wraparound pointers at top and bottom will be filled later + * (see set_wraparound_pointers, below). Initially we want the "above" + * pointers to duplicate the first actual data line. This only needs + * to happen in xbuffer[0]. + */ + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[0]; + } + } +} + + +LOCAL(void) +set_wraparound_pointers (j_decompress_ptr cinfo) +/* Set up the "wraparound" pointers at top and bottom of the pointer lists. + * This changes the pointer list state from top-of-image to the normal state. + */ +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + int ci, i, rgroup; + int M = cinfo->min_DCT_v_scaled_size; + jpeg_component_info *compptr; + JSAMPARRAY xbuf0, xbuf1; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ + xbuf0 = mainp->xbuffer[0][ci]; + xbuf1 = mainp->xbuffer[1][ci]; + for (i = 0; i < rgroup; i++) { + xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; + xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; + xbuf0[rgroup*(M+2) + i] = xbuf0[i]; + xbuf1[rgroup*(M+2) + i] = xbuf1[i]; + } + } +} + + +LOCAL(void) +set_bottom_pointers (j_decompress_ptr cinfo) +/* Change the pointer lists to duplicate the last sample row at the bottom + * of the image. whichptr indicates which xbuffer holds the final iMCU row. + * Also sets rowgroups_avail to indicate number of nondummy row groups in row. + */ +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + int ci, i, rgroup, iMCUheight, rows_left; + jpeg_component_info *compptr; + JSAMPARRAY xbuf; + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Count sample rows in one iMCU row and in one row group */ + iMCUheight = compptr->v_samp_factor * compptr->DCT_v_scaled_size; + rgroup = iMCUheight / cinfo->min_DCT_v_scaled_size; + /* Count nondummy sample rows remaining for this component */ + rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); + if (rows_left == 0) rows_left = iMCUheight; + /* Count nondummy row groups. Should get same answer for each component, + * so we need only do it once. + */ + if (ci == 0) { + mainp->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); + } + /* Duplicate the last real sample row rgroup*2 times; this pads out the + * last partial rowgroup and ensures at least one full rowgroup of context. + */ + xbuf = mainp->xbuffer[mainp->whichptr][ci]; + for (i = 0; i < rgroup * 2; i++) { + xbuf[rows_left + i] = xbuf[rows_left-1]; + } + } +} + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->upsample->need_context_rows) { + mainp->pub.process_data = process_data_context_main; + make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ + mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ + mainp->context_state = CTX_PREPARE_FOR_IMCU; + mainp->iMCU_row_ctr = 0; + } else { + /* Simple case with no context needed */ + mainp->pub.process_data = process_data_simple_main; + } + mainp->buffer_full = FALSE; /* Mark buffer empty */ + mainp->rowgroup_ctr = 0; + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_CRANK_DEST: + /* For last pass of 2-pass quantization, just crank the postprocessor */ + mainp->pub.process_data = process_data_crank_post; + break; +#endif + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } +} + + +/* + * Process some data. + * This handles the simple case where no context is required. + */ + +METHODDEF(void) +process_data_simple_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + JDIMENSION rowgroups_avail; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mainp->buffer_full) { + if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer)) + return; /* suspension forced, can do nothing more */ + mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + } + + /* There are always min_DCT_scaled_size row groups in an iMCU row. */ + rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size; + /* Note: at the bottom of the image, we may pass extra garbage row groups + * to the postprocessor. The postprocessor has to check for bottom + * of image anyway (at row resolution), so no point in us doing it too. + */ + + /* Feed the postprocessor */ + (*cinfo->post->post_process_data) (cinfo, mainp->buffer, + &mainp->rowgroup_ctr, rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + + /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ + if (mainp->rowgroup_ctr >= rowgroups_avail) { + mainp->buffer_full = FALSE; + mainp->rowgroup_ctr = 0; + } +} + + +/* + * Process some data. + * This handles the case where context rows must be provided. + */ + +METHODDEF(void) +process_data_context_main (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_main_ptr mainp = (my_main_ptr) cinfo->main; + + /* Read input data if we haven't filled the main buffer yet */ + if (! mainp->buffer_full) { + if (! (*cinfo->coef->decompress_data) (cinfo, + mainp->xbuffer[mainp->whichptr])) + return; /* suspension forced, can do nothing more */ + mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ + mainp->iMCU_row_ctr++; /* count rows received */ + } + + /* Postprocessor typically will not swallow all the input data it is handed + * in one call (due to filling the output buffer first). Must be prepared + * to exit and restart. This switch lets us keep track of how far we got. + * Note that each case falls through to the next on successful completion. + */ + switch (mainp->context_state) { + case CTX_POSTPONED_ROW: + /* Call postprocessor using previously set pointers for postponed row */ + (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr], + &mainp->rowgroup_ctr, mainp->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mainp->rowgroup_ctr < mainp->rowgroups_avail) + return; /* Need to suspend */ + mainp->context_state = CTX_PREPARE_FOR_IMCU; + if (*out_row_ctr >= out_rows_avail) + return; /* Postprocessor exactly filled output buf */ + /*FALLTHROUGH*/ + case CTX_PREPARE_FOR_IMCU: + /* Prepare to process first M-1 row groups of this iMCU row */ + mainp->rowgroup_ctr = 0; + mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size - 1); + /* Check for bottom of image: if so, tweak pointers to "duplicate" + * the last sample row, and adjust rowgroups_avail to ignore padding rows. + */ + if (mainp->iMCU_row_ctr == cinfo->total_iMCU_rows) + set_bottom_pointers(cinfo); + mainp->context_state = CTX_PROCESS_IMCU; + /*FALLTHROUGH*/ + case CTX_PROCESS_IMCU: + /* Call postprocessor using previously set pointers */ + (*cinfo->post->post_process_data) (cinfo, mainp->xbuffer[mainp->whichptr], + &mainp->rowgroup_ctr, mainp->rowgroups_avail, + output_buf, out_row_ctr, out_rows_avail); + if (mainp->rowgroup_ctr < mainp->rowgroups_avail) + return; /* Need to suspend */ + /* After the first iMCU, change wraparound pointers to normal state */ + if (mainp->iMCU_row_ctr == 1) + set_wraparound_pointers(cinfo); + /* Prepare to load new iMCU row using other xbuffer list */ + mainp->whichptr ^= 1; /* 0=>1 or 1=>0 */ + mainp->buffer_full = FALSE; + /* Still need to process last row group of this iMCU row, */ + /* which is saved at index M+1 of the other xbuffer */ + mainp->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 1); + mainp->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_v_scaled_size + 2); + mainp->context_state = CTX_POSTPONED_ROW; + } +} + + +/* + * Process some data. + * Final pass of two-pass quantization: just call the postprocessor. + * Source data will be the postprocessor controller's internal buffer. + */ + +#ifdef QUANT_2PASS_SUPPORTED + +METHODDEF(void) +process_data_crank_post (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, + (JDIMENSION *) NULL, (JDIMENSION) 0, + output_buf, out_row_ctr, out_rows_avail); +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize main buffer controller. + */ + +GLOBAL(void) +jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_main_ptr mainp; + int ci, rgroup, ngroups; + jpeg_component_info *compptr; + + mainp = (my_main_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_main_controller)); + cinfo->main = &mainp->pub; + mainp->pub.start_pass = start_pass_main; + + if (need_full_buffer) /* shouldn't happen */ + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + + /* Allocate the workspace. + * ngroups is the number of row groups we need. + */ + if (cinfo->upsample->need_context_rows) { + if (cinfo->min_DCT_v_scaled_size < 2) /* unsupported, see comments above */ + ERREXIT(cinfo, JERR_NOTIMPL); + alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ + ngroups = cinfo->min_DCT_v_scaled_size + 2; + } else { + ngroups = cinfo->min_DCT_v_scaled_size; + } + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ + mainp->buffer[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size), + (JDIMENSION) (rgroup * ngroups)); + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdmarker.c b/thirdparty/LibJPEG/jpeg-9/jdmarker.c new file mode 100644 index 0000000..ce8b713 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdmarker.c @@ -0,0 +1,1505 @@ +/* + * jdmarker.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2009-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to decode JPEG datastream markers. + * Most of the complexity arises from our desire to support input + * suspension: if not all of the data for a marker is available, + * we must exit back to the application. On resumption, we reprocess + * the marker. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +typedef enum { /* JPEG marker codes */ + M_SOF0 = 0xc0, + M_SOF1 = 0xc1, + M_SOF2 = 0xc2, + M_SOF3 = 0xc3, + + M_SOF5 = 0xc5, + M_SOF6 = 0xc6, + M_SOF7 = 0xc7, + + M_JPG = 0xc8, + M_SOF9 = 0xc9, + M_SOF10 = 0xca, + M_SOF11 = 0xcb, + + M_SOF13 = 0xcd, + M_SOF14 = 0xce, + M_SOF15 = 0xcf, + + M_DHT = 0xc4, + + M_DAC = 0xcc, + + M_RST0 = 0xd0, + M_RST1 = 0xd1, + M_RST2 = 0xd2, + M_RST3 = 0xd3, + M_RST4 = 0xd4, + M_RST5 = 0xd5, + M_RST6 = 0xd6, + M_RST7 = 0xd7, + + M_SOI = 0xd8, + M_EOI = 0xd9, + M_SOS = 0xda, + M_DQT = 0xdb, + M_DNL = 0xdc, + M_DRI = 0xdd, + M_DHP = 0xde, + M_EXP = 0xdf, + + M_APP0 = 0xe0, + M_APP1 = 0xe1, + M_APP2 = 0xe2, + M_APP3 = 0xe3, + M_APP4 = 0xe4, + M_APP5 = 0xe5, + M_APP6 = 0xe6, + M_APP7 = 0xe7, + M_APP8 = 0xe8, + M_APP9 = 0xe9, + M_APP10 = 0xea, + M_APP11 = 0xeb, + M_APP12 = 0xec, + M_APP13 = 0xed, + M_APP14 = 0xee, + M_APP15 = 0xef, + + M_JPG0 = 0xf0, + M_JPG8 = 0xf8, + M_JPG13 = 0xfd, + M_COM = 0xfe, + + M_TEM = 0x01, + + M_ERROR = 0x100 +} JPEG_MARKER; + + +/* Private state */ + +typedef struct { + struct jpeg_marker_reader pub; /* public fields */ + + /* Application-overridable marker processing methods */ + jpeg_marker_parser_method process_COM; + jpeg_marker_parser_method process_APPn[16]; + + /* Limit on marker data length to save for each marker type */ + unsigned int length_limit_COM; + unsigned int length_limit_APPn[16]; + + /* Status of COM/APPn marker saving */ + jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ + unsigned int bytes_read; /* data bytes read so far in marker */ + /* Note: cur_marker is not linked into marker_list until it's all read. */ +} my_marker_reader; + +typedef my_marker_reader * my_marker_ptr; + + +/* + * Macros for fetching data from the data source module. + * + * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect + * the current restart point; we update them only when we have reached a + * suitable place to restart if a suspension occurs. + */ + +/* Declare and initialize local copies of input pointer/count */ +#define INPUT_VARS(cinfo) \ + struct jpeg_source_mgr * datasrc = (cinfo)->src; \ + const JOCTET * next_input_byte = datasrc->next_input_byte; \ + size_t bytes_in_buffer = datasrc->bytes_in_buffer + +/* Unload the local copies --- do this only at a restart boundary */ +#define INPUT_SYNC(cinfo) \ + ( datasrc->next_input_byte = next_input_byte, \ + datasrc->bytes_in_buffer = bytes_in_buffer ) + +/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ +#define INPUT_RELOAD(cinfo) \ + ( next_input_byte = datasrc->next_input_byte, \ + bytes_in_buffer = datasrc->bytes_in_buffer ) + +/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. + * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, + * but we must reload the local copies after a successful fill. + */ +#define MAKE_BYTE_AVAIL(cinfo,action) \ + if (bytes_in_buffer == 0) { \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ + } + +/* Read a byte into variable V. + * If must suspend, take the specified action (typically "return FALSE"). + */ +#define INPUT_BYTE(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = GETJOCTET(*next_input_byte++); ) + +/* As above, but read two bytes interpreted as an unsigned 16-bit integer. + * V should be declared unsigned int or perhaps INT32. + */ +#define INPUT_2BYTES(cinfo,V,action) \ + MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ + MAKE_BYTE_AVAIL(cinfo,action); \ + bytes_in_buffer--; \ + V += GETJOCTET(*next_input_byte++); ) + + +/* + * Routines to process JPEG markers. + * + * Entry condition: JPEG marker itself has been read and its code saved + * in cinfo->unread_marker; input restart point is just after the marker. + * + * Exit: if return TRUE, have read and processed any parameters, and have + * updated the restart point to point after the parameters. + * If return FALSE, was forced to suspend before reaching end of + * marker parameters; restart point has not been moved. Same routine + * will be called again after application supplies more input data. + * + * This approach to suspension assumes that all of a marker's parameters + * can fit into a single input bufferload. This should hold for "normal" + * markers. Some COM/APPn markers might have large parameter segments + * that might not fit. If we are simply dropping such a marker, we use + * skip_input_data to get past it, and thereby put the problem on the + * source manager's shoulders. If we are saving the marker's contents + * into memory, we use a slightly different convention: when forced to + * suspend, the marker processor updates the restart point to the end of + * what it's consumed (ie, the end of the buffer) before returning FALSE. + * On resumption, cinfo->unread_marker still contains the marker code, + * but the data source will point to the next chunk of marker data. + * The marker processor must retain internal state to deal with this. + * + * Note that we don't bother to avoid duplicate trace messages if a + * suspension occurs within marker parameters. Other side effects + * require more care. + */ + + +LOCAL(boolean) +get_soi (j_decompress_ptr cinfo) +/* Process an SOI marker */ +{ + int i; + + TRACEMS(cinfo, 1, JTRC_SOI); + + if (cinfo->marker->saw_SOI) + ERREXIT(cinfo, JERR_SOI_DUPLICATE); + + /* Reset all parameters that are defined to be reset by SOI */ + + for (i = 0; i < NUM_ARITH_TBLS; i++) { + cinfo->arith_dc_L[i] = 0; + cinfo->arith_dc_U[i] = 1; + cinfo->arith_ac_K[i] = 5; + } + cinfo->restart_interval = 0; + + /* Set initial assumptions for colorspace etc */ + + cinfo->jpeg_color_space = JCS_UNKNOWN; + cinfo->color_transform = JCT_NONE; + cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ + + cinfo->saw_JFIF_marker = FALSE; + cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ + cinfo->JFIF_minor_version = 1; + cinfo->density_unit = 0; + cinfo->X_density = 1; + cinfo->Y_density = 1; + cinfo->saw_Adobe_marker = FALSE; + cinfo->Adobe_transform = 0; + + cinfo->marker->saw_SOI = TRUE; + + return TRUE; +} + + +LOCAL(boolean) +get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog, + boolean is_arith) +/* Process a SOFn marker */ +{ + INT32 length; + int c, ci, i; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + cinfo->is_baseline = is_baseline; + cinfo->progressive_mode = is_prog; + cinfo->arith_code = is_arith; + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); + INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); + INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); + + length -= 8; + + TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, + (int) cinfo->image_width, (int) cinfo->image_height, + cinfo->num_components); + + if (cinfo->marker->saw_SOF) + ERREXIT(cinfo, JERR_SOF_DUPLICATE); + + /* We don't support files in which the image height is initially specified */ + /* as 0 and is later redefined by DNL. As long as we have to check that, */ + /* might as well have a general sanity check. */ + if (cinfo->image_height <= 0 || cinfo->image_width <= 0 + || cinfo->num_components <= 0) + ERREXIT(cinfo, JERR_EMPTY_IMAGE); + + if (length != (cinfo->num_components * 3)) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + if (cinfo->comp_info == NULL) /* do only once, even if suspend */ + cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->num_components * SIZEOF(jpeg_component_info)); + + for (ci = 0; ci < cinfo->num_components; ci++) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Check to see whether component id has already been seen */ + /* (in violation of the spec, but unfortunately seen in some */ + /* files). If so, create "fake" component id equal to the */ + /* max id seen so far + 1. */ + for (i = 0, compptr = cinfo->comp_info; i < ci; i++, compptr++) { + if (c == compptr->component_id) { + compptr = cinfo->comp_info; + c = compptr->component_id; + compptr++; + for (i = 1; i < ci; i++, compptr++) { + if (compptr->component_id > c) c = compptr->component_id; + } + c++; + break; + } + } + compptr->component_id = c; + compptr->component_index = ci; + INPUT_BYTE(cinfo, c, return FALSE); + compptr->h_samp_factor = (c >> 4) & 15; + compptr->v_samp_factor = (c ) & 15; + INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); + + TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, + compptr->component_id, compptr->h_samp_factor, + compptr->v_samp_factor, compptr->quant_tbl_no); + } + + cinfo->marker->saw_SOF = TRUE; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_sos (j_decompress_ptr cinfo) +/* Process a SOS marker */ +{ + INT32 length; + int c, ci, i, n; + jpeg_component_info * compptr; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXITS(cinfo, JERR_SOF_BEFORE, "SOS"); + + INPUT_2BYTES(cinfo, length, return FALSE); + + INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ + + TRACEMS1(cinfo, 1, JTRC_SOS, n); + + if (length != (n * 2 + 6) || n > MAX_COMPS_IN_SCAN || + (n == 0 && !cinfo->progressive_mode)) + /* pseudo SOS marker only allowed in progressive mode */ + ERREXIT(cinfo, JERR_BAD_LENGTH); + + cinfo->comps_in_scan = n; + + /* Collect the component-spec parameters */ + + for (i = 0; i < n; i++) { + INPUT_BYTE(cinfo, c, return FALSE); + + /* Detect the case where component id's are not unique, and, if so, */ + /* create a fake component id using the same logic as in get_sof. */ + for (ci = 0; ci < i; ci++) { + if (c == cinfo->cur_comp_info[ci]->component_id) { + c = cinfo->cur_comp_info[0]->component_id; + for (ci = 1; ci < i; ci++) { + compptr = cinfo->cur_comp_info[ci]; + if (compptr->component_id > c) c = compptr->component_id; + } + c++; + break; + } + } + + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + if (c == compptr->component_id) + goto id_found; + } + + ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, c); + + id_found: + + cinfo->cur_comp_info[i] = compptr; + INPUT_BYTE(cinfo, c, return FALSE); + compptr->dc_tbl_no = (c >> 4) & 15; + compptr->ac_tbl_no = (c ) & 15; + + TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, compptr->component_id, + compptr->dc_tbl_no, compptr->ac_tbl_no); + } + + /* Collect the additional scan parameters Ss, Se, Ah/Al. */ + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ss = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Se = c; + INPUT_BYTE(cinfo, c, return FALSE); + cinfo->Ah = (c >> 4) & 15; + cinfo->Al = (c ) & 15; + + TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, + cinfo->Ah, cinfo->Al); + + /* Prepare to scan data & restart markers */ + cinfo->marker->next_restart_num = 0; + + /* Count another (non-pseudo) SOS marker */ + if (n) cinfo->input_scan_number++; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +#ifdef D_ARITH_CODING_SUPPORTED + +LOCAL(boolean) +get_dac (j_decompress_ptr cinfo) +/* Process a DAC marker */ +{ + INT32 length; + int index, val; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + INPUT_BYTE(cinfo, index, return FALSE); + INPUT_BYTE(cinfo, val, return FALSE); + + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_DAC, index, val); + + if (index < 0 || index >= (2*NUM_ARITH_TBLS)) + ERREXIT1(cinfo, JERR_DAC_INDEX, index); + + if (index >= NUM_ARITH_TBLS) { /* define AC table */ + cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val; + } else { /* define DC table */ + cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F); + cinfo->arith_dc_U[index] = (UINT8) (val >> 4); + if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index]) + ERREXIT1(cinfo, JERR_DAC_VALUE, val); + } + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + +#else /* ! D_ARITH_CODING_SUPPORTED */ + +#define get_dac(cinfo) skip_variable(cinfo) + +#endif /* D_ARITH_CODING_SUPPORTED */ + + +LOCAL(boolean) +get_dht (j_decompress_ptr cinfo) +/* Process a DHT marker */ +{ + INT32 length; + UINT8 bits[17]; + UINT8 huffval[256]; + int i, index, count; + JHUFF_TBL **htblptr; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 16) { + INPUT_BYTE(cinfo, index, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DHT, index); + + bits[0] = 0; + count = 0; + for (i = 1; i <= 16; i++) { + INPUT_BYTE(cinfo, bits[i], return FALSE); + count += bits[i]; + } + + length -= 1 + 16; + + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[1], bits[2], bits[3], bits[4], + bits[5], bits[6], bits[7], bits[8]); + TRACEMS8(cinfo, 2, JTRC_HUFFBITS, + bits[9], bits[10], bits[11], bits[12], + bits[13], bits[14], bits[15], bits[16]); + + /* Here we just do minimal validation of the counts to avoid walking + * off the end of our table space. jdhuff.c will check more carefully. + */ + if (count > 256 || ((INT32) count) > length) + ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); + + for (i = 0; i < count; i++) + INPUT_BYTE(cinfo, huffval[i], return FALSE); + + length -= count; + + if (index & 0x10) { /* AC table definition */ + index -= 0x10; + htblptr = &cinfo->ac_huff_tbl_ptrs[index]; + } else { /* DC table definition */ + htblptr = &cinfo->dc_huff_tbl_ptrs[index]; + } + + if (index < 0 || index >= NUM_HUFF_TBLS) + ERREXIT1(cinfo, JERR_DHT_INDEX, index); + + if (*htblptr == NULL) + *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); + + MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); + MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dqt (j_decompress_ptr cinfo) +/* Process a DQT marker */ +{ + INT32 length, count, i; + int n, prec; + unsigned int tmp; + JQUANT_TBL *quant_ptr; + const int *natural_order; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + while (length > 0) { + length--; + INPUT_BYTE(cinfo, n, return FALSE); + prec = n >> 4; + n &= 0x0F; + + TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); + + if (n >= NUM_QUANT_TBLS) + ERREXIT1(cinfo, JERR_DQT_INDEX, n); + + if (cinfo->quant_tbl_ptrs[n] == NULL) + cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); + quant_ptr = cinfo->quant_tbl_ptrs[n]; + + if (prec) { + if (length < DCTSIZE2 * 2) { + /* Initialize full table for safety. */ + for (i = 0; i < DCTSIZE2; i++) { + quant_ptr->quantval[i] = 1; + } + count = length >> 1; + } else + count = DCTSIZE2; + } else { + if (length < DCTSIZE2) { + /* Initialize full table for safety. */ + for (i = 0; i < DCTSIZE2; i++) { + quant_ptr->quantval[i] = 1; + } + count = length; + } else + count = DCTSIZE2; + } + + switch (count) { + case (2*2): natural_order = jpeg_natural_order2; break; + case (3*3): natural_order = jpeg_natural_order3; break; + case (4*4): natural_order = jpeg_natural_order4; break; + case (5*5): natural_order = jpeg_natural_order5; break; + case (6*6): natural_order = jpeg_natural_order6; break; + case (7*7): natural_order = jpeg_natural_order7; break; + default: natural_order = jpeg_natural_order; break; + } + + for (i = 0; i < count; i++) { + if (prec) + INPUT_2BYTES(cinfo, tmp, return FALSE); + else + INPUT_BYTE(cinfo, tmp, return FALSE); + /* We convert the zigzag-order table to natural array order. */ + quant_ptr->quantval[natural_order[i]] = (UINT16) tmp; + } + + if (cinfo->err->trace_level >= 2) { + for (i = 0; i < DCTSIZE2; i += 8) { + TRACEMS8(cinfo, 2, JTRC_QUANTVALS, + quant_ptr->quantval[i], quant_ptr->quantval[i+1], + quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], + quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], + quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); + } + } + + length -= count; + if (prec) length -= count; + } + + if (length != 0) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_dri (j_decompress_ptr cinfo) +/* Process a DRI marker */ +{ + INT32 length; + unsigned int tmp; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 4) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_2BYTES(cinfo, tmp, return FALSE); + + TRACEMS1(cinfo, 1, JTRC_DRI, tmp); + + cinfo->restart_interval = tmp; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +get_lse (j_decompress_ptr cinfo) +/* Process an LSE marker */ +{ + INT32 length; + unsigned int tmp; + int cid; + INPUT_VARS(cinfo); + + if (! cinfo->marker->saw_SOF) + ERREXITS(cinfo, JERR_SOF_BEFORE, "LSE"); + + if (cinfo->num_components < 3) goto bad; + + INPUT_2BYTES(cinfo, length, return FALSE); + + if (length != 24) + ERREXIT(cinfo, JERR_BAD_LENGTH); + + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0x0D) /* ID inverse transform specification */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != MAXJSAMPLE) goto bad; /* MAXTRANS */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 3) goto bad; /* Nt=3 */ + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[1].component_id) goto bad; + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[0].component_id) goto bad; + INPUT_BYTE(cinfo, cid, return FALSE); + if (cid != cinfo->comp_info[2].component_id) goto bad; + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0x80) goto bad; /* F1: CENTER1=1, NORM1=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(1,1)=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(1,2)=0 */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* F2: CENTER2=0, NORM2=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 1) goto bad; /* A(2,1)=1 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* A(2,2)=0 */ + INPUT_BYTE(cinfo, tmp, return FALSE); + if (tmp != 0) goto bad; /* F3: CENTER3=0, NORM3=0 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 1) goto bad; /* A(3,1)=1 */ + INPUT_2BYTES(cinfo, tmp, return FALSE); + if (tmp != 0) { /* A(3,2)=0 */ + bad: + ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); + } + + /* OK, valid transform that we can handle. */ + cinfo->color_transform = JCT_SUBTRACT_GREEN; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Routines for processing APPn and COM markers. + * These are either saved in memory or discarded, per application request. + * APP0 and APP14 are specially checked to see if they are + * JFIF and Adobe markers, respectively. + */ + +#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ +#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ +#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ + + +LOCAL(void) +examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, + unsigned int datalen, INT32 remaining) +/* Examine first few bytes from an APP0. + * Take appropriate action if it is a JFIF marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + INT32 totallen = (INT32) datalen + remaining; + + if (datalen >= APP0_DATA_LEN && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x49 && + GETJOCTET(data[3]) == 0x46 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF APP0 marker: save info */ + cinfo->saw_JFIF_marker = TRUE; + cinfo->JFIF_major_version = GETJOCTET(data[5]); + cinfo->JFIF_minor_version = GETJOCTET(data[6]); + cinfo->density_unit = GETJOCTET(data[7]); + cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]); + cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]); + /* Check version. + * Major version must be 1, anything else signals an incompatible change. + * (We used to treat this as an error, but now it's a nonfatal warning, + * because some bozo at Hijaak couldn't read the spec.) + * Minor version should be 0..2, but process anyway if newer. + */ + if (cinfo->JFIF_major_version != 1) + WARNMS2(cinfo, JWRN_JFIF_MAJOR, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version); + /* Generate trace messages */ + TRACEMS5(cinfo, 1, JTRC_JFIF, + cinfo->JFIF_major_version, cinfo->JFIF_minor_version, + cinfo->X_density, cinfo->Y_density, cinfo->density_unit); + /* Validate thumbnail dimensions and issue appropriate messages */ + if (GETJOCTET(data[12]) | GETJOCTET(data[13])) + TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, + GETJOCTET(data[12]), GETJOCTET(data[13])); + totallen -= APP0_DATA_LEN; + if (totallen != + ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3)) + TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); + } else if (datalen >= 6 && + GETJOCTET(data[0]) == 0x4A && + GETJOCTET(data[1]) == 0x46 && + GETJOCTET(data[2]) == 0x58 && + GETJOCTET(data[3]) == 0x58 && + GETJOCTET(data[4]) == 0) { + /* Found JFIF "JFXX" extension APP0 marker */ + /* The library doesn't actually do anything with these, + * but we try to produce a helpful trace message. + */ + switch (GETJOCTET(data[5])) { + case 0x10: + TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen); + break; + case 0x11: + TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen); + break; + case 0x13: + TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen); + break; + default: + TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, + GETJOCTET(data[5]), (int) totallen); + break; + } + } else { + /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); + } +} + + +LOCAL(void) +examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, + unsigned int datalen, INT32 remaining) +/* Examine first few bytes from an APP14. + * Take appropriate action if it is an Adobe marker. + * datalen is # of bytes at data[], remaining is length of rest of marker data. + */ +{ + unsigned int version, flags0, flags1, transform; + + if (datalen >= APP14_DATA_LEN && + GETJOCTET(data[0]) == 0x41 && + GETJOCTET(data[1]) == 0x64 && + GETJOCTET(data[2]) == 0x6F && + GETJOCTET(data[3]) == 0x62 && + GETJOCTET(data[4]) == 0x65) { + /* Found Adobe APP14 marker */ + version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]); + flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]); + flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]); + transform = GETJOCTET(data[11]); + TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform); + cinfo->saw_Adobe_marker = TRUE; + cinfo->Adobe_transform = (UINT8) transform; + } else { + /* Start of APP14 does not match "Adobe", or too short */ + TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); + } +} + + +METHODDEF(boolean) +get_interesting_appn (j_decompress_ptr cinfo) +/* Process an APP0 or APP14 marker without saving it */ +{ + INT32 length; + JOCTET b[APPN_DATA_LEN]; + unsigned int i, numtoread; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + /* get the interesting part of the marker data */ + if (length >= APPN_DATA_LEN) + numtoread = APPN_DATA_LEN; + else if (length > 0) + numtoread = (unsigned int) length; + else + numtoread = 0; + for (i = 0; i < numtoread; i++) + INPUT_BYTE(cinfo, b[i], return FALSE); + length -= numtoread; + + /* process it */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + case M_APP14: + examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); + break; + default: + /* can't get here unless jpeg_save_markers chooses wrong processor */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +#ifdef SAVE_MARKERS_SUPPORTED + +METHODDEF(boolean) +save_marker (j_decompress_ptr cinfo) +/* Save an APPn or COM marker into the marker list */ +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + jpeg_saved_marker_ptr cur_marker = marker->cur_marker; + unsigned int bytes_read, data_length; + JOCTET FAR * data; + INT32 length = 0; + INPUT_VARS(cinfo); + + if (cur_marker == NULL) { + /* begin reading a marker */ + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + if (length >= 0) { /* watch out for bogus length word */ + /* figure out how much we want to save */ + unsigned int limit; + if (cinfo->unread_marker == (int) M_COM) + limit = marker->length_limit_COM; + else + limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; + if ((unsigned int) length < limit) + limit = (unsigned int) length; + /* allocate and initialize the marker item */ + cur_marker = (jpeg_saved_marker_ptr) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(struct jpeg_marker_struct) + limit); + cur_marker->next = NULL; + cur_marker->marker = (UINT8) cinfo->unread_marker; + cur_marker->original_length = (unsigned int) length; + cur_marker->data_length = limit; + /* data area is just beyond the jpeg_marker_struct */ + data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); + marker->cur_marker = cur_marker; + marker->bytes_read = 0; + bytes_read = 0; + data_length = limit; + } else { + /* deal with bogus length word */ + bytes_read = data_length = 0; + data = NULL; + } + } else { + /* resume reading a marker */ + bytes_read = marker->bytes_read; + data_length = cur_marker->data_length; + data = cur_marker->data + bytes_read; + } + + while (bytes_read < data_length) { + INPUT_SYNC(cinfo); /* move the restart point to here */ + marker->bytes_read = bytes_read; + /* If there's not at least one byte in buffer, suspend */ + MAKE_BYTE_AVAIL(cinfo, return FALSE); + /* Copy bytes with reasonable rapidity */ + while (bytes_read < data_length && bytes_in_buffer > 0) { + *data++ = *next_input_byte++; + bytes_in_buffer--; + bytes_read++; + } + } + + /* Done reading what we want to read */ + if (cur_marker != NULL) { /* will be NULL if bogus length word */ + /* Add new marker to end of list */ + if (cinfo->marker_list == NULL) { + cinfo->marker_list = cur_marker; + } else { + jpeg_saved_marker_ptr prev = cinfo->marker_list; + while (prev->next != NULL) + prev = prev->next; + prev->next = cur_marker; + } + /* Reset pointer & calc remaining data length */ + data = cur_marker->data; + length = cur_marker->original_length - data_length; + } + /* Reset to initial state for next marker */ + marker->cur_marker = NULL; + + /* Process the marker if interesting; else just make a generic trace msg */ + switch (cinfo->unread_marker) { + case M_APP0: + examine_app0(cinfo, data, data_length, length); + break; + case M_APP14: + examine_app14(cinfo, data, data_length, length); + break; + default: + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, + (int) (data_length + length)); + break; + } + + /* skip any remaining data -- could be lots */ + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +METHODDEF(boolean) +skip_variable (j_decompress_ptr cinfo) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + INT32 length; + INPUT_VARS(cinfo); + + INPUT_2BYTES(cinfo, length, return FALSE); + length -= 2; + + TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); + + INPUT_SYNC(cinfo); /* do before skip_input_data */ + if (length > 0) + (*cinfo->src->skip_input_data) (cinfo, (long) length); + + return TRUE; +} + + +/* + * Find the next JPEG marker, save it in cinfo->unread_marker. + * Returns FALSE if had to suspend before reaching a marker; + * in that case cinfo->unread_marker is unchanged. + * + * Note that the result might not be a valid marker code, + * but it will never be 0 or FF. + */ + +LOCAL(boolean) +next_marker (j_decompress_ptr cinfo) +{ + int c; + INPUT_VARS(cinfo); + + for (;;) { + INPUT_BYTE(cinfo, c, return FALSE); + /* Skip any non-FF bytes. + * This may look a bit inefficient, but it will not occur in a valid file. + * We sync after each discarded byte so that a suspending data source + * can discard the byte from its buffer. + */ + while (c != 0xFF) { + cinfo->marker->discarded_bytes++; + INPUT_SYNC(cinfo); + INPUT_BYTE(cinfo, c, return FALSE); + } + /* This loop swallows any duplicate FF bytes. Extra FFs are legal as + * pad bytes, so don't count them in discarded_bytes. We assume there + * will not be so many consecutive FF bytes as to overflow a suspending + * data source's input buffer. + */ + do { + INPUT_BYTE(cinfo, c, return FALSE); + } while (c == 0xFF); + if (c != 0) + break; /* found a valid marker, exit loop */ + /* Reach here if we found a stuffed-zero data sequence (FF/00). + * Discard it and loop back to try again. + */ + cinfo->marker->discarded_bytes += 2; + INPUT_SYNC(cinfo); + } + + if (cinfo->marker->discarded_bytes != 0) { + WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c); + cinfo->marker->discarded_bytes = 0; + } + + cinfo->unread_marker = c; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +LOCAL(boolean) +first_marker (j_decompress_ptr cinfo) +/* Like next_marker, but used to obtain the initial SOI marker. */ +/* For this marker, we do not allow preceding garbage or fill; otherwise, + * we might well scan an entire input file before realizing it ain't JPEG. + * If an application wants to process non-JFIF files, it must seek to the + * SOI before calling the JPEG library. + */ +{ + int c, c2; + INPUT_VARS(cinfo); + + INPUT_BYTE(cinfo, c, return FALSE); + INPUT_BYTE(cinfo, c2, return FALSE); + if (c != 0xFF || c2 != (int) M_SOI) + ERREXIT2(cinfo, JERR_NO_SOI, c, c2); + + cinfo->unread_marker = c2; + + INPUT_SYNC(cinfo); + return TRUE; +} + + +/* + * Read markers until SOS or EOI. + * + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + * + * Note: This function may return a pseudo SOS marker (with zero + * component number) for treat by input controller's consume_input. + * consume_input itself should filter out (skip) the pseudo marker + * after processing for the caller. + */ + +METHODDEF(int) +read_markers (j_decompress_ptr cinfo) +{ + /* Outer loop repeats once for each marker. */ + for (;;) { + /* Collect the marker proper, unless we already did. */ + /* NB: first_marker() enforces the requirement that SOI appear first. */ + if (cinfo->unread_marker == 0) { + if (! cinfo->marker->saw_SOI) { + if (! first_marker(cinfo)) + return JPEG_SUSPENDED; + } else { + if (! next_marker(cinfo)) + return JPEG_SUSPENDED; + } + } + /* At this point cinfo->unread_marker contains the marker code and the + * input point is just past the marker proper, but before any parameters. + * A suspension will cause us to return with this state still true. + */ + switch (cinfo->unread_marker) { + case M_SOI: + if (! get_soi(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_SOF0: /* Baseline */ + if (! get_sof(cinfo, TRUE, FALSE, FALSE)) + return JPEG_SUSPENDED; + break; + + case M_SOF1: /* Extended sequential, Huffman */ + if (! get_sof(cinfo, FALSE, FALSE, FALSE)) + return JPEG_SUSPENDED; + break; + + case M_SOF2: /* Progressive, Huffman */ + if (! get_sof(cinfo, FALSE, TRUE, FALSE)) + return JPEG_SUSPENDED; + break; + + case M_SOF9: /* Extended sequential, arithmetic */ + if (! get_sof(cinfo, FALSE, FALSE, TRUE)) + return JPEG_SUSPENDED; + break; + + case M_SOF10: /* Progressive, arithmetic */ + if (! get_sof(cinfo, FALSE, TRUE, TRUE)) + return JPEG_SUSPENDED; + break; + + /* Currently unsupported SOFn types */ + case M_SOF3: /* Lossless, Huffman */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_JPG: /* Reserved for JPEG extensions */ + case M_SOF11: /* Lossless, arithmetic */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); + break; + + case M_SOS: + if (! get_sos(cinfo)) + return JPEG_SUSPENDED; + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_SOS; + + case M_EOI: + TRACEMS(cinfo, 1, JTRC_EOI); + cinfo->unread_marker = 0; /* processed the marker */ + return JPEG_REACHED_EOI; + + case M_DAC: + if (! get_dac(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DHT: + if (! get_dht(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DQT: + if (! get_dqt(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_DRI: + if (! get_dri(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_JPG8: + if (! get_lse(cinfo)) + return JPEG_SUSPENDED; + break; + + case M_APP0: + case M_APP1: + case M_APP2: + case M_APP3: + case M_APP4: + case M_APP5: + case M_APP6: + case M_APP7: + case M_APP8: + case M_APP9: + case M_APP10: + case M_APP11: + case M_APP12: + case M_APP13: + case M_APP14: + case M_APP15: + if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ + cinfo->unread_marker - (int) M_APP0]) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_COM: + if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) + return JPEG_SUSPENDED; + break; + + case M_RST0: /* these are all parameterless */ + case M_RST1: + case M_RST2: + case M_RST3: + case M_RST4: + case M_RST5: + case M_RST6: + case M_RST7: + case M_TEM: + TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); + break; + + case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ + if (! skip_variable(cinfo)) + return JPEG_SUSPENDED; + break; + + default: /* must be DHP, EXP, JPGn, or RESn */ + /* For now, we treat the reserved markers as fatal errors since they are + * likely to be used to signal incompatible JPEG Part 3 extensions. + * Once the JPEG 3 version-number marker is well defined, this code + * ought to change! + */ + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); + break; + } + /* Successfully processed marker, so reset state variable */ + cinfo->unread_marker = 0; + } /* end loop */ +} + + +/* + * Read a restart marker, which is expected to appear next in the datastream; + * if the marker is not there, take appropriate recovery action. + * Returns FALSE if suspension is required. + * + * This is called by the entropy decoder after it has read an appropriate + * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder + * has already read a marker from the data source. Under normal conditions + * cinfo->unread_marker will be reset to 0 before returning; if not reset, + * it holds a marker which the decoder will be unable to read past. + */ + +METHODDEF(boolean) +read_restart_marker (j_decompress_ptr cinfo) +{ + /* Obtain a marker unless we already did. */ + /* Note that next_marker will complain if it skips any data. */ + if (cinfo->unread_marker == 0) { + if (! next_marker(cinfo)) + return FALSE; + } + + if (cinfo->unread_marker == + ((int) M_RST0 + cinfo->marker->next_restart_num)) { + /* Normal case --- swallow the marker and let entropy decoder continue */ + TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num); + cinfo->unread_marker = 0; + } else { + /* Uh-oh, the restart markers have been messed up. */ + /* Let the data source manager determine how to resync. */ + if (! (*cinfo->src->resync_to_restart) (cinfo, + cinfo->marker->next_restart_num)) + return FALSE; + } + + /* Update next-restart state */ + cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; + + return TRUE; +} + + +/* + * This is the default resync_to_restart method for data source managers + * to use if they don't have any better approach. Some data source managers + * may be able to back up, or may have additional knowledge about the data + * which permits a more intelligent recovery strategy; such managers would + * presumably supply their own resync method. + * + * read_restart_marker calls resync_to_restart if it finds a marker other than + * the restart marker it was expecting. (This code is *not* used unless + * a nonzero restart interval has been declared.) cinfo->unread_marker is + * the marker code actually found (might be anything, except 0 or FF). + * The desired restart marker number (0..7) is passed as a parameter. + * This routine is supposed to apply whatever error recovery strategy seems + * appropriate in order to position the input stream to the next data segment. + * Note that cinfo->unread_marker is treated as a marker appearing before + * the current data-source input point; usually it should be reset to zero + * before returning. + * Returns FALSE if suspension is required. + * + * This implementation is substantially constrained by wanting to treat the + * input as a data stream; this means we can't back up. Therefore, we have + * only the following actions to work with: + * 1. Simply discard the marker and let the entropy decoder resume at next + * byte of file. + * 2. Read forward until we find another marker, discarding intervening + * data. (In theory we could look ahead within the current bufferload, + * without having to discard data if we don't find the desired marker. + * This idea is not implemented here, in part because it makes behavior + * dependent on buffer size and chance buffer-boundary positions.) + * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). + * This will cause the entropy decoder to process an empty data segment, + * inserting dummy zeroes, and then we will reprocess the marker. + * + * #2 is appropriate if we think the desired marker lies ahead, while #3 is + * appropriate if the found marker is a future restart marker (indicating + * that we have missed the desired restart marker, probably because it got + * corrupted). + * We apply #2 or #3 if the found marker is a restart marker no more than + * two counts behind or ahead of the expected one. We also apply #2 if the + * found marker is not a legal JPEG marker code (it's certainly bogus data). + * If the found marker is a restart marker more than 2 counts away, we do #1 + * (too much risk that the marker is erroneous; with luck we will be able to + * resync at some future point). + * For any valid non-restart JPEG marker, we apply #3. This keeps us from + * overrunning the end of a scan. An implementation limited to single-scan + * files might find it better to apply #2 for markers other than EOI, since + * any other marker would have to be bogus data in that case. + */ + +GLOBAL(boolean) +jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) +{ + int marker = cinfo->unread_marker; + int action = 1; + + /* Always put up a warning. */ + WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); + + /* Outer loop handles repeated decision after scanning forward. */ + for (;;) { + if (marker < (int) M_SOF0) + action = 2; /* invalid marker */ + else if (marker < (int) M_RST0 || marker > (int) M_RST7) + action = 3; /* valid non-restart marker */ + else { + if (marker == ((int) M_RST0 + ((desired+1) & 7)) || + marker == ((int) M_RST0 + ((desired+2) & 7))) + action = 3; /* one of the next two expected restarts */ + else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || + marker == ((int) M_RST0 + ((desired-2) & 7))) + action = 2; /* a prior restart, so advance */ + else + action = 1; /* desired restart or too far away */ + } + TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); + switch (action) { + case 1: + /* Discard marker and let entropy decoder resume processing. */ + cinfo->unread_marker = 0; + return TRUE; + case 2: + /* Scan to the next marker, and repeat the decision loop. */ + if (! next_marker(cinfo)) + return FALSE; + marker = cinfo->unread_marker; + break; + case 3: + /* Return without advancing past this marker. */ + /* Entropy decoder will be forced to process an empty segment. */ + return TRUE; + } + } /* end loop */ +} + + +/* + * Reset marker processing state to begin a fresh datastream. + */ + +METHODDEF(void) +reset_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + cinfo->comp_info = NULL; /* until allocated by get_sof */ + cinfo->input_scan_number = 0; /* no SOS seen yet */ + cinfo->unread_marker = 0; /* no pending marker */ + marker->pub.saw_SOI = FALSE; /* set internal state too */ + marker->pub.saw_SOF = FALSE; + marker->pub.discarded_bytes = 0; + marker->cur_marker = NULL; +} + + +/* + * Initialize the marker reader module. + * This is called only once, when the decompression object is created. + */ + +GLOBAL(void) +jinit_marker_reader (j_decompress_ptr cinfo) +{ + my_marker_ptr marker; + int i; + + /* Create subobject in permanent pool */ + marker = (my_marker_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + SIZEOF(my_marker_reader)); + cinfo->marker = &marker->pub; + /* Initialize public method pointers */ + marker->pub.reset_marker_reader = reset_marker_reader; + marker->pub.read_markers = read_markers; + marker->pub.read_restart_marker = read_restart_marker; + /* Initialize COM/APPn processing. + * By default, we examine and then discard APP0 and APP14, + * but simply discard COM and all other APPn. + */ + marker->process_COM = skip_variable; + marker->length_limit_COM = 0; + for (i = 0; i < 16; i++) { + marker->process_APPn[i] = skip_variable; + marker->length_limit_APPn[i] = 0; + } + marker->process_APPn[0] = get_interesting_appn; + marker->process_APPn[14] = get_interesting_appn; + /* Reset marker processing state */ + reset_marker_reader(cinfo); +} + + +/* + * Control saving of COM and APPn markers into marker_list. + */ + +#ifdef SAVE_MARKERS_SUPPORTED + +GLOBAL(void) +jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + long maxlength; + jpeg_marker_parser_method processor; + + /* Length limit mustn't be larger than what we can allocate + * (should only be a concern in a 16-bit environment). + */ + maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct); + if (((long) length_limit) > maxlength) + length_limit = (unsigned int) maxlength; + + /* Choose processor routine to use. + * APP0/APP14 have special requirements. + */ + if (length_limit) { + processor = save_marker; + /* If saving APP0/APP14, save at least enough for our internal use. */ + if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN) + length_limit = APP0_DATA_LEN; + else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN) + length_limit = APP14_DATA_LEN; + } else { + processor = skip_variable; + /* If discarding APP0/APP14, use our regular on-the-fly processor. */ + if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14) + processor = get_interesting_appn; + } + + if (marker_code == (int) M_COM) { + marker->process_COM = processor; + marker->length_limit_COM = length_limit; + } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) { + marker->process_APPn[marker_code - (int) M_APP0] = processor; + marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; + } else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} + +#endif /* SAVE_MARKERS_SUPPORTED */ + + +/* + * Install a special processing method for COM or APPn markers. + */ + +GLOBAL(void) +jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine) +{ + my_marker_ptr marker = (my_marker_ptr) cinfo->marker; + + if (marker_code == (int) M_COM) + marker->process_COM = routine; + else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) + marker->process_APPn[marker_code - (int) M_APP0] = routine; + else + ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdmaster.c b/thirdparty/LibJPEG/jpeg-9/jdmaster.c new file mode 100644 index 0000000..fef72a2 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdmaster.c @@ -0,0 +1,531 @@ +/* + * jdmaster.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2002-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains master control logic for the JPEG decompressor. + * These routines are concerned with selecting the modules to be executed + * and with determining the number of passes and the work to be done in each + * pass. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private state */ + +typedef struct { + struct jpeg_decomp_master pub; /* public fields */ + + int pass_number; /* # of passes completed */ + + boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ + + /* Saved references to initialized quantizer modules, + * in case we need to switch modes. + */ + struct jpeg_color_quantizer * quantizer_1pass; + struct jpeg_color_quantizer * quantizer_2pass; +} my_decomp_master; + +typedef my_decomp_master * my_master_ptr; + + +/* + * Determine whether merged upsample/color conversion should be used. + * CRUCIAL: this must match the actual capabilities of jdmerge.c! + */ + +LOCAL(boolean) +use_merged_upsample (j_decompress_ptr cinfo) +{ +#ifdef UPSAMPLE_MERGING_SUPPORTED + /* Merging is the equivalent of plain box-filter upsampling */ + if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) + return FALSE; + /* jdmerge.c only supports YCC=>RGB color conversion */ + if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || + cinfo->out_color_space != JCS_RGB || + cinfo->out_color_components != RGB_PIXELSIZE) + return FALSE; + /* and it only handles 2h1v or 2h2v sampling ratios */ + if (cinfo->comp_info[0].h_samp_factor != 2 || + cinfo->comp_info[1].h_samp_factor != 1 || + cinfo->comp_info[2].h_samp_factor != 1 || + cinfo->comp_info[0].v_samp_factor > 2 || + cinfo->comp_info[1].v_samp_factor != 1 || + cinfo->comp_info[2].v_samp_factor != 1) + return FALSE; + /* furthermore, it doesn't work if we've scaled the IDCTs differently */ + if (cinfo->comp_info[0].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size || + cinfo->comp_info[1].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size || + cinfo->comp_info[2].DCT_h_scaled_size != cinfo->min_DCT_h_scaled_size || + cinfo->comp_info[0].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size || + cinfo->comp_info[1].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size || + cinfo->comp_info[2].DCT_v_scaled_size != cinfo->min_DCT_v_scaled_size) + return FALSE; + /* ??? also need to test for upsample-time rescaling, when & if supported */ + return TRUE; /* by golly, it'll work... */ +#else + return FALSE; +#endif +} + + +/* + * Compute output image dimensions and related values. + * NOTE: this is exported for possible use by application. + * Hence it mustn't do anything that can't be done twice. + * Also note that it may be called before the master module is initialized! + */ + +GLOBAL(void) +jpeg_calc_output_dimensions (j_decompress_ptr cinfo) +/* Do computations that are needed before master selection phase. + * This function is used for full decompression. + */ +{ +#ifdef IDCT_SCALING_SUPPORTED + int ci; + jpeg_component_info *compptr; +#endif + + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_READY) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + /* Compute core output image dimensions and DCT scaling choices. */ + jpeg_core_output_dimensions(cinfo); + +#ifdef IDCT_SCALING_SUPPORTED + + /* In selecting the actual DCT scaling for each component, we try to + * scale up the chroma components via IDCT scaling rather than upsampling. + * This saves time if the upsampler gets to use 1:1 scaling. + * Note this code adapts subsampling ratios which are powers of 2. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + int ssize = 1; + while (cinfo->min_DCT_h_scaled_size * ssize <= + (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) && + (cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) { + ssize = ssize * 2; + } + compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize; + ssize = 1; + while (cinfo->min_DCT_v_scaled_size * ssize <= + (cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) && + (cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) { + ssize = ssize * 2; + } + compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize; + + /* We don't support IDCT ratios larger than 2. */ + if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2) + compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2; + else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2) + compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2; + } + + /* Recompute downsampled dimensions of components; + * application needs to know these if using raw downsampled data. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Size in samples, after IDCT scaling */ + compptr->downsampled_width = (JDIMENSION) + jdiv_round_up((long) cinfo->image_width * + (long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size), + (long) (cinfo->max_h_samp_factor * cinfo->block_size)); + compptr->downsampled_height = (JDIMENSION) + jdiv_round_up((long) cinfo->image_height * + (long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size), + (long) (cinfo->max_v_samp_factor * cinfo->block_size)); + } + +#endif /* IDCT_SCALING_SUPPORTED */ + + /* Report number of components in selected colorspace. */ + /* Probably this should be in the color conversion module... */ + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + cinfo->out_color_components = 1; + break; + case JCS_RGB: + cinfo->out_color_components = RGB_PIXELSIZE; + break; + case JCS_YCbCr: + cinfo->out_color_components = 3; + break; + case JCS_CMYK: + case JCS_YCCK: + cinfo->out_color_components = 4; + break; + default: /* else must be same colorspace as in file */ + cinfo->out_color_components = cinfo->num_components; + break; + } + cinfo->output_components = (cinfo->quantize_colors ? 1 : + cinfo->out_color_components); + + /* See if upsampler will want to emit more than one row at a time */ + if (use_merged_upsample(cinfo)) + cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; + else + cinfo->rec_outbuf_height = 1; +} + + +/* + * Several decompression processes need to range-limit values to the range + * 0..MAXJSAMPLE; the input value may fall somewhat outside this range + * due to noise introduced by quantization, roundoff error, etc. These + * processes are inner loops and need to be as fast as possible. On most + * machines, particularly CPUs with pipelines or instruction prefetch, + * a (subscript-check-less) C table lookup + * x = sample_range_limit[x]; + * is faster than explicit tests + * if (x < 0) x = 0; + * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; + * These processes all use a common table prepared by the routine below. + * + * For most steps we can mathematically guarantee that the initial value + * of x is within MAXJSAMPLE+1 of the legal range, so a table running from + * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial + * limiting step (just after the IDCT), a wildly out-of-range value is + * possible if the input data is corrupt. To avoid any chance of indexing + * off the end of memory and getting a bad-pointer trap, we perform the + * post-IDCT limiting thus: + * x = range_limit[x & MASK]; + * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit + * samples. Under normal circumstances this is more than enough range and + * a correct output will be generated; with bogus input data the mask will + * cause wraparound, and we will safely generate a bogus-but-in-range output. + * For the post-IDCT step, we want to convert the data from signed to unsigned + * representation by adding CENTERJSAMPLE at the same time that we limit it. + * So the post-IDCT limiting table ends up looking like this: + * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, + * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), + * 0,1,...,CENTERJSAMPLE-1 + * Negative inputs select values from the upper half of the table after + * masking. + * + * We can save some space by overlapping the start of the post-IDCT table + * with the simpler range limiting table. The post-IDCT table begins at + * sample_range_limit + CENTERJSAMPLE. + * + * Note that the table is allocated in near data space on PCs; it's small + * enough and used often enough to justify this. + */ + +LOCAL(void) +prepare_range_limit_table (j_decompress_ptr cinfo) +/* Allocate and fill in the sample_range_limit table */ +{ + JSAMPLE * table; + int i; + + table = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ + cinfo->sample_range_limit = table; + /* First segment of "simple" table: limit[x] = 0 for x < 0 */ + MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); + /* Main part of "simple" table: limit[x] = x */ + for (i = 0; i <= MAXJSAMPLE; i++) + table[i] = (JSAMPLE) i; + table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ + /* End of simple table, rest of first half of post-IDCT table */ + for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) + table[i] = MAXJSAMPLE; + /* Second half of post-IDCT table */ + MEMZERO(table + (2 * (MAXJSAMPLE+1)), + (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); + MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), + cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); +} + + +/* + * Master selection of decompression modules. + * This is done once at jpeg_start_decompress time. We determine + * which modules will be used and give them appropriate initialization calls. + * We also initialize the decompressor input side to begin consuming data. + * + * Since jpeg_read_header has finished, we know what is in the SOF + * and (first) SOS markers. We also have all the application parameter + * settings. + */ + +LOCAL(void) +master_selection (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + boolean use_c_buffer; + long samplesperrow; + JDIMENSION jd_samplesperrow; + + /* Initialize dimensions and other stuff */ + jpeg_calc_output_dimensions(cinfo); + prepare_range_limit_table(cinfo); + + /* Width of an output scanline must be representable as JDIMENSION. */ + samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; + jd_samplesperrow = (JDIMENSION) samplesperrow; + if ((long) jd_samplesperrow != samplesperrow) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + + /* Initialize my private state */ + master->pass_number = 0; + master->using_merged_upsample = use_merged_upsample(cinfo); + + /* Color quantizer selection */ + master->quantizer_1pass = NULL; + master->quantizer_2pass = NULL; + /* No mode changes if not using buffered-image mode. */ + if (! cinfo->quantize_colors || ! cinfo->buffered_image) { + cinfo->enable_1pass_quant = FALSE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + } + if (cinfo->quantize_colors) { + if (cinfo->raw_data_out) + ERREXIT(cinfo, JERR_NOTIMPL); + /* 2-pass quantizer only works in 3-component color space. */ + if (cinfo->out_color_components != 3) { + cinfo->enable_1pass_quant = TRUE; + cinfo->enable_external_quant = FALSE; + cinfo->enable_2pass_quant = FALSE; + cinfo->colormap = NULL; + } else if (cinfo->colormap != NULL) { + cinfo->enable_external_quant = TRUE; + } else if (cinfo->two_pass_quantize) { + cinfo->enable_2pass_quant = TRUE; + } else { + cinfo->enable_1pass_quant = TRUE; + } + + if (cinfo->enable_1pass_quant) { +#ifdef QUANT_1PASS_SUPPORTED + jinit_1pass_quantizer(cinfo); + master->quantizer_1pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + + /* We use the 2-pass code to map to external colormaps. */ + if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { +#ifdef QUANT_2PASS_SUPPORTED + jinit_2pass_quantizer(cinfo); + master->quantizer_2pass = cinfo->cquantize; +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } + /* If both quantizers are initialized, the 2-pass one is left active; + * this is necessary for starting with quantization to an external map. + */ + } + + /* Post-processing: in particular, color conversion first */ + if (! cinfo->raw_data_out) { + if (master->using_merged_upsample) { +#ifdef UPSAMPLE_MERGING_SUPPORTED + jinit_merged_upsampler(cinfo); /* does color conversion too */ +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif + } else { + jinit_color_deconverter(cinfo); + jinit_upsampler(cinfo); + } + jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); + } + /* Inverse DCT */ + jinit_inverse_dct(cinfo); + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) + jinit_arith_decoder(cinfo); + else { + jinit_huff_decoder(cinfo); + } + + /* Initialize principal buffer controllers. */ + use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; + jinit_d_coef_controller(cinfo, use_c_buffer); + + if (! cinfo->raw_data_out) + jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + +#ifdef D_MULTISCAN_FILES_SUPPORTED + /* If jpeg_start_decompress will read the whole file, initialize + * progress monitoring appropriately. The input step is counted + * as one pass. + */ + if (cinfo->progress != NULL && ! cinfo->buffered_image && + cinfo->inputctl->has_multiple_scans) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->progressive_mode) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); + /* Count the input pass as done */ + master->pass_number++; + } +#endif /* D_MULTISCAN_FILES_SUPPORTED */ +} + + +/* + * Per-pass setup. + * This is called at the beginning of each output pass. We determine which + * modules will be active during this pass and give them appropriate + * start_pass calls. We also set is_dummy_pass to indicate whether this + * is a "real" output pass or a dummy pass for color quantization. + * (In the latter case, jdapistd.c will crank the pass to completion.) + */ + +METHODDEF(void) +prepare_for_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (master->pub.is_dummy_pass) { +#ifdef QUANT_2PASS_SUPPORTED + /* Final pass of 2-pass quantization */ + master->pub.is_dummy_pass = FALSE; + (*cinfo->cquantize->start_pass) (cinfo, FALSE); + (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); + (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); +#else + ERREXIT(cinfo, JERR_NOT_COMPILED); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + if (cinfo->quantize_colors && cinfo->colormap == NULL) { + /* Select new quantization method */ + if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { + cinfo->cquantize = master->quantizer_2pass; + master->pub.is_dummy_pass = TRUE; + } else if (cinfo->enable_1pass_quant) { + cinfo->cquantize = master->quantizer_1pass; + } else { + ERREXIT(cinfo, JERR_MODE_CHANGE); + } + } + (*cinfo->idct->start_pass) (cinfo); + (*cinfo->coef->start_output_pass) (cinfo); + if (! cinfo->raw_data_out) { + if (! master->using_merged_upsample) + (*cinfo->cconvert->start_pass) (cinfo); + (*cinfo->upsample->start_pass) (cinfo); + if (cinfo->quantize_colors) + (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); + (*cinfo->post->start_pass) (cinfo, + (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); + (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); + } + } + + /* Set up progress monitor's pass info if present */ + if (cinfo->progress != NULL) { + cinfo->progress->completed_passes = master->pass_number; + cinfo->progress->total_passes = master->pass_number + + (master->pub.is_dummy_pass ? 2 : 1); + /* In buffered-image mode, we assume one more output pass if EOI not + * yet reached, but no more passes if EOI has been reached. + */ + if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { + cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); + } + } +} + + +/* + * Finish up at end of an output pass. + */ + +METHODDEF(void) +finish_output_pass (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + if (cinfo->quantize_colors) + (*cinfo->cquantize->finish_pass) (cinfo); + master->pass_number++; +} + + +#ifdef D_MULTISCAN_FILES_SUPPORTED + +/* + * Switch to a new external colormap between output passes. + */ + +GLOBAL(void) +jpeg_new_colormap (j_decompress_ptr cinfo) +{ + my_master_ptr master = (my_master_ptr) cinfo->master; + + /* Prevent application from calling me at wrong times */ + if (cinfo->global_state != DSTATE_BUFIMAGE) + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + + if (cinfo->quantize_colors && cinfo->enable_external_quant && + cinfo->colormap != NULL) { + /* Select 2-pass quantizer for external colormap use */ + cinfo->cquantize = master->quantizer_2pass; + /* Notify quantizer of colormap change */ + (*cinfo->cquantize->new_color_map) (cinfo); + master->pub.is_dummy_pass = FALSE; /* just in case */ + } else + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + +#endif /* D_MULTISCAN_FILES_SUPPORTED */ + + +/* + * Initialize master decompression control and select active modules. + * This is performed at the start of jpeg_start_decompress. + */ + +GLOBAL(void) +jinit_master_decompress (j_decompress_ptr cinfo) +{ + my_master_ptr master; + + master = (my_master_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_decomp_master)); + cinfo->master = (struct jpeg_decomp_master *) master; + master->pub.prepare_for_output_pass = prepare_for_output_pass; + master->pub.finish_output_pass = finish_output_pass; + + master->pub.is_dummy_pass = FALSE; + + master_selection(cinfo); +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdmerge.c b/thirdparty/LibJPEG/jpeg-9/jdmerge.c new file mode 100644 index 0000000..3744446 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdmerge.c @@ -0,0 +1,400 @@ +/* + * jdmerge.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains code for merged upsampling/color conversion. + * + * This file combines functions from jdsample.c and jdcolor.c; + * read those files first to understand what's going on. + * + * When the chroma components are to be upsampled by simple replication + * (ie, box filtering), we can save some work in color conversion by + * calculating all the output pixels corresponding to a pair of chroma + * samples at one time. In the conversion equations + * R = Y + K1 * Cr + * G = Y + K2 * Cb + K3 * Cr + * B = Y + K4 * Cb + * only the Y term varies among the group of pixels corresponding to a pair + * of chroma samples, so the rest of the terms can be calculated just once. + * At typical sampling ratios, this eliminates half or three-quarters of the + * multiplications needed for color conversion. + * + * This file currently provides implementations for the following cases: + * YCbCr => RGB color conversion only. + * Sampling ratios of 2h1v or 2h2v. + * No scaling needed at upsample time. + * Corner-aligned (non-CCIR601) sampling alignment. + * Other special cases could be added, but in most applications these are + * the only common cases. (For uncommon cases we fall back on the more + * general code in jdsample.c and jdcolor.c.) + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + +#ifdef UPSAMPLE_MERGING_SUPPORTED + + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Pointer to routine to do actual upsampling/conversion of one row group */ + JMETHOD(void, upmethod, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf)); + + /* Private state for YCC->RGB conversion */ + int * Cr_r_tab; /* => table for Cr to R conversion */ + int * Cb_b_tab; /* => table for Cb to B conversion */ + INT32 * Cr_g_tab; /* => table for Cr to G conversion */ + INT32 * Cb_g_tab; /* => table for Cb to G conversion */ + + /* For 2:1 vertical sampling, we produce two output rows at a time. + * We need a "spare" row buffer to hold the second output row if the + * application provides just a one-row buffer; we also use the spare + * to discard the dummy last row if the image height is odd. + */ + JSAMPROW spare_row; + boolean spare_full; /* T if spare buffer is occupied */ + + JDIMENSION out_row_width; /* samples per output row */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + +#define SCALEBITS 16 /* speediest right-shift on some machines */ +#define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) +#define FIX(x) ((INT32) ((x) * (1L<RGB colorspace conversion. + * This is taken directly from jdcolor.c; see that file for more info. + */ + +LOCAL(void) +build_ycc_rgb_table (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int i; + INT32 x; + SHIFT_TEMPS + + upsample->Cr_r_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cb_b_tab = (int *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(int)); + upsample->Cr_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + upsample->Cb_g_tab = (INT32 *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (MAXJSAMPLE+1) * SIZEOF(INT32)); + + for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { + /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ + /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ + /* Cr=>R value is nearest int to 1.40200 * x */ + upsample->Cr_r_tab[i] = (int) + RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); + /* Cb=>B value is nearest int to 1.77200 * x */ + upsample->Cb_b_tab[i] = (int) + RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); + /* Cr=>G value is scaled-up -0.71414 * x */ + upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; + /* Cb=>G value is scaled-up -0.34414 * x */ + /* We also add in ONE_HALF so that need not do it in inner loop */ + upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; + } +} + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_merged_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the spare buffer empty */ + upsample->spare_full = FALSE; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * The control routine just handles the row buffering considerations. + */ + +METHODDEF(void) +merged_2v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 2:1 vertical sampling case: may need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPROW work_ptrs[2]; + JDIMENSION num_rows; /* number of rows returned to caller */ + + if (upsample->spare_full) { + /* If we have a spare row saved from a previous cycle, just return it. */ + jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, + 1, upsample->out_row_width); + num_rows = 1; + upsample->spare_full = FALSE; + } else { + /* Figure number of rows to return to caller. */ + num_rows = 2; + /* Not more than the distance to the end of the image. */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + /* Create output pointer array for upsampler. */ + work_ptrs[0] = output_buf[*out_row_ctr]; + if (num_rows > 1) { + work_ptrs[1] = output_buf[*out_row_ctr + 1]; + } else { + work_ptrs[1] = upsample->spare_row; + upsample->spare_full = TRUE; + } + /* Now do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); + } + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (! upsample->spare_full) + (*in_row_group_ctr)++; +} + + +METHODDEF(void) +merged_1v_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +/* 1:1 vertical sampling case: much easier, never need a spare row. */ +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Just do the upsampling. */ + (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, + output_buf + *out_row_ctr); + /* Adjust counts */ + (*out_row_ctr)++; + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by the control routines to do + * the actual upsampling/conversion. One row group is processed per call. + * + * Note: since we may be writing directly into application-supplied buffers, + * we have to be honest about the output width; we can't assume the buffer + * has been rounded up to an even width. + */ + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. + */ + +METHODDEF(void) +h2v1_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr; + JSAMPROW inptr0, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + INT32 * Crgtab = upsample->Cr_g_tab; + INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr0 = input_buf[0][in_row_group_ctr]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr = output_buf[0]; + /* Loop for each pair of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 2 Y values and emit 2 pixels */ + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr0++); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + outptr += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr0); + outptr[RGB_RED] = range_limit[y + cred]; + outptr[RGB_GREEN] = range_limit[y + cgreen]; + outptr[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. + */ + +METHODDEF(void) +h2v2_merged_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, + JSAMPARRAY output_buf) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + register int y, cred, cgreen, cblue; + int cb, cr; + register JSAMPROW outptr0, outptr1; + JSAMPROW inptr00, inptr01, inptr1, inptr2; + JDIMENSION col; + /* copy these pointers into registers if possible */ + register JSAMPLE * range_limit = cinfo->sample_range_limit; + int * Crrtab = upsample->Cr_r_tab; + int * Cbbtab = upsample->Cb_b_tab; + INT32 * Crgtab = upsample->Cr_g_tab; + INT32 * Cbgtab = upsample->Cb_g_tab; + SHIFT_TEMPS + + inptr00 = input_buf[0][in_row_group_ctr*2]; + inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; + inptr1 = input_buf[1][in_row_group_ctr]; + inptr2 = input_buf[2][in_row_group_ctr]; + outptr0 = output_buf[0]; + outptr1 = output_buf[1]; + /* Loop for each group of output pixels */ + for (col = cinfo->output_width >> 1; col > 0; col--) { + /* Do the chroma part of the calculation */ + cb = GETJSAMPLE(*inptr1++); + cr = GETJSAMPLE(*inptr2++); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + /* Fetch 4 Y values and emit 4 pixels */ + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr00++); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + outptr0 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + y = GETJSAMPLE(*inptr01++); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + outptr1 += RGB_PIXELSIZE; + } + /* If image width is odd, do the last output column separately */ + if (cinfo->output_width & 1) { + cb = GETJSAMPLE(*inptr1); + cr = GETJSAMPLE(*inptr2); + cred = Crrtab[cr]; + cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); + cblue = Cbbtab[cb]; + y = GETJSAMPLE(*inptr00); + outptr0[RGB_RED] = range_limit[y + cred]; + outptr0[RGB_GREEN] = range_limit[y + cgreen]; + outptr0[RGB_BLUE] = range_limit[y + cblue]; + y = GETJSAMPLE(*inptr01); + outptr1[RGB_RED] = range_limit[y + cred]; + outptr1[RGB_GREEN] = range_limit[y + cgreen]; + outptr1[RGB_BLUE] = range_limit[y + cblue]; + } +} + + +/* + * Module initialization routine for merged upsampling/color conversion. + * + * NB: this is called under the conditions determined by use_merged_upsample() + * in jdmaster.c. That routine MUST correspond to the actual capabilities + * of this module; no safety checks are made here. + */ + +GLOBAL(void) +jinit_merged_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_merged_upsample; + upsample->pub.need_context_rows = FALSE; + + upsample->out_row_width = cinfo->output_width * cinfo->out_color_components; + + if (cinfo->max_v_samp_factor == 2) { + upsample->pub.upsample = merged_2v_upsample; + upsample->upmethod = h2v2_merged_upsample; + /* Allocate a spare row buffer */ + upsample->spare_row = (JSAMPROW) + (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); + } else { + upsample->pub.upsample = merged_1v_upsample; + upsample->upmethod = h2v1_merged_upsample; + /* No spare row needed */ + upsample->spare_row = NULL; + } + + build_ycc_rgb_table(cinfo); +} + +#endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jdpostct.c b/thirdparty/LibJPEG/jpeg-9/jdpostct.c new file mode 100644 index 0000000..571563d --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdpostct.c @@ -0,0 +1,290 @@ +/* + * jdpostct.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the decompression postprocessing controller. + * This controller manages the upsampling, color conversion, and color + * quantization/reduction steps; specifically, it controls the buffering + * between upsample/color conversion and color quantization/reduction. + * + * If no color quantization/reduction is required, then this module has no + * work to do, and it just hands off to the upsample/color conversion code. + * An integrated upsample/convert/quantize process would replace this module + * entirely. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Private buffer controller object */ + +typedef struct { + struct jpeg_d_post_controller pub; /* public fields */ + + /* Color quantization source buffer: this holds output data from + * the upsample/color conversion step to be passed to the quantizer. + * For two-pass color quantization, we need a full-image buffer; + * for one-pass operation, a strip buffer is sufficient. + */ + jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ + JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ + JDIMENSION strip_height; /* buffer size in rows */ + /* for two-pass mode only: */ + JDIMENSION starting_row; /* row # of first row in current strip */ + JDIMENSION next_row; /* index of next row to fill/empty in strip */ +} my_post_controller; + +typedef my_post_controller * my_post_ptr; + + +/* Forward declarations */ +METHODDEF(void) post_process_1pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#ifdef QUANT_2PASS_SUPPORTED +METHODDEF(void) post_process_prepass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +METHODDEF(void) post_process_2pass + JPP((j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +#endif + + +/* + * Initialize for a processing pass. + */ + +METHODDEF(void) +start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + + switch (pass_mode) { + case JBUF_PASS_THRU: + if (cinfo->quantize_colors) { + /* Single-pass processing with color quantization. */ + post->pub.post_process_data = post_process_1pass; + /* We could be doing buffered-image output before starting a 2-pass + * color quantization; in that case, jinit_d_post_controller did not + * allocate a strip buffer. Use the virtual-array buffer as workspace. + */ + if (post->buffer == NULL) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + (JDIMENSION) 0, post->strip_height, TRUE); + } + } else { + /* For single-pass processing without color quantization, + * I have no work to do; just call the upsampler directly. + */ + post->pub.post_process_data = cinfo->upsample->upsample; + } + break; +#ifdef QUANT_2PASS_SUPPORTED + case JBUF_SAVE_AND_PASS: + /* First pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_prepass; + break; + case JBUF_CRANK_DEST: + /* Second pass of 2-pass quantization */ + if (post->whole_image == NULL) + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + post->pub.post_process_data = post_process_2pass; + break; +#endif /* QUANT_2PASS_SUPPORTED */ + default: + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); + break; + } + post->starting_row = post->next_row = 0; +} + + +/* + * Process some data in the one-pass (strip buffer) case. + * This is used for color precision reduction as well as one-pass quantization. + */ + +METHODDEF(void) +post_process_1pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Fill the buffer, but not more than what we can dump out in one go. */ + /* Note we rely on the upsampler to detect bottom of image. */ + max_rows = out_rows_avail - *out_row_ctr; + if (max_rows > post->strip_height) + max_rows = post->strip_height; + num_rows = 0; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &num_rows, max_rows); + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer, output_buf + *out_row_ctr, (int) num_rows); + *out_row_ctr += num_rows; +} + + +#ifdef QUANT_2PASS_SUPPORTED + +/* + * Process some data in the first pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_prepass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION old_next_row, num_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, TRUE); + } + + /* Upsample some data (up to a strip height's worth). */ + old_next_row = post->next_row; + (*cinfo->upsample->upsample) (cinfo, + input_buf, in_row_group_ctr, in_row_groups_avail, + post->buffer, &post->next_row, post->strip_height); + + /* Allow quantizer to scan new data. No data is emitted, */ + /* but we advance out_row_ctr so outer loop can tell when we're done. */ + if (post->next_row > old_next_row) { + num_rows = post->next_row - old_next_row; + (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, + (JSAMPARRAY) NULL, (int) num_rows); + *out_row_ctr += num_rows; + } + + /* Advance if we filled the strip. */ + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + + +/* + * Process some data in the second pass of 2-pass quantization. + */ + +METHODDEF(void) +post_process_2pass (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_post_ptr post = (my_post_ptr) cinfo->post; + JDIMENSION num_rows, max_rows; + + /* Reposition virtual buffer if at start of strip. */ + if (post->next_row == 0) { + post->buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, post->whole_image, + post->starting_row, post->strip_height, FALSE); + } + + /* Determine number of rows to emit. */ + num_rows = post->strip_height - post->next_row; /* available in strip */ + max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ + if (num_rows > max_rows) + num_rows = max_rows; + /* We have to check bottom of image here, can't depend on upsampler. */ + max_rows = cinfo->output_height - post->starting_row; + if (num_rows > max_rows) + num_rows = max_rows; + + /* Quantize and emit data. */ + (*cinfo->cquantize->color_quantize) (cinfo, + post->buffer + post->next_row, output_buf + *out_row_ctr, + (int) num_rows); + *out_row_ctr += num_rows; + + /* Advance if we filled the strip. */ + post->next_row += num_rows; + if (post->next_row >= post->strip_height) { + post->starting_row += post->strip_height; + post->next_row = 0; + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ + + +/* + * Initialize postprocessing controller. + */ + +GLOBAL(void) +jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer) +{ + my_post_ptr post; + + post = (my_post_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_post_controller)); + cinfo->post = (struct jpeg_d_post_controller *) post; + post->pub.start_pass = start_pass_dpost; + post->whole_image = NULL; /* flag for no virtual arrays */ + post->buffer = NULL; /* flag for no strip buffer */ + + /* Create the quantization buffer, if needed */ + if (cinfo->quantize_colors) { + /* The buffer strip height is max_v_samp_factor, which is typically + * an efficient number of rows for upsampling to return. + * (In the presence of output rescaling, we might want to be smarter?) + */ + post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; + if (need_full_buffer) { + /* Two-pass color quantization: need full-image storage. */ + /* We round up the number of rows to a multiple of the strip height. */ +#ifdef QUANT_2PASS_SUPPORTED + post->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + cinfo->output_width * cinfo->out_color_components, + (JDIMENSION) jround_up((long) cinfo->output_height, + (long) post->strip_height), + post->strip_height); +#else + ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); +#endif /* QUANT_2PASS_SUPPORTED */ + } else { + /* One-pass color quantization: just make a strip buffer. */ + post->buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * cinfo->out_color_components, + post->strip_height); + } + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdsample.c b/thirdparty/LibJPEG/jpeg-9/jdsample.c new file mode 100644 index 0000000..7bc8885 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdsample.c @@ -0,0 +1,361 @@ +/* + * jdsample.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2002-2008 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains upsampling routines. + * + * Upsampling input data is counted in "row groups". A row group + * is defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size) + * sample rows of each component. Upsampling will normally produce + * max_v_samp_factor pixel rows from each row group (but this could vary + * if the upsampler is applying a scale factor of its own). + * + * An excellent reference for image resampling is + * Digital Image Warping, George Wolberg, 1990. + * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Pointer to routine to upsample a single component */ +typedef JMETHOD(void, upsample1_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); + +/* Private subobject */ + +typedef struct { + struct jpeg_upsampler pub; /* public fields */ + + /* Color conversion buffer. When using separate upsampling and color + * conversion steps, this buffer holds one upsampled row group until it + * has been color converted and output. + * Note: we do not allocate any storage for component(s) which are full-size, + * ie do not need rescaling. The corresponding entry of color_buf[] is + * simply set to point to the input data array, thereby avoiding copying. + */ + JSAMPARRAY color_buf[MAX_COMPONENTS]; + + /* Per-component upsampling method pointers */ + upsample1_ptr methods[MAX_COMPONENTS]; + + int next_row_out; /* counts rows emitted from color_buf */ + JDIMENSION rows_to_go; /* counts rows remaining in image */ + + /* Height of an input row group for each component. */ + int rowgroup_height[MAX_COMPONENTS]; + + /* These arrays save pixel expansion factors so that int_expand need not + * recompute them each time. They are unused for other upsampling methods. + */ + UINT8 h_expand[MAX_COMPONENTS]; + UINT8 v_expand[MAX_COMPONENTS]; +} my_upsampler; + +typedef my_upsampler * my_upsample_ptr; + + +/* + * Initialize for an upsampling pass. + */ + +METHODDEF(void) +start_pass_upsample (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + + /* Mark the conversion buffer empty */ + upsample->next_row_out = cinfo->max_v_samp_factor; + /* Initialize total-height counter for detecting bottom of image */ + upsample->rows_to_go = cinfo->output_height; +} + + +/* + * Control routine to do upsampling (and color conversion). + * + * In this version we upsample each component independently. + * We upsample one row group into the conversion buffer, then apply + * color conversion a row at a time. + */ + +METHODDEF(void) +sep_upsample (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + int ci; + jpeg_component_info * compptr; + JDIMENSION num_rows; + + /* Fill the conversion buffer, if it's empty */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) { + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Invoke per-component upsample method. Notice we pass a POINTER + * to color_buf[ci], so that fullsize_upsample can change it. + */ + (*upsample->methods[ci]) (cinfo, compptr, + input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]), + upsample->color_buf + ci); + } + upsample->next_row_out = 0; + } + + /* Color-convert and emit rows */ + + /* How many we have in the buffer: */ + num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); + /* Not more than the distance to the end of the image. Need this test + * in case the image height is not a multiple of max_v_samp_factor: + */ + if (num_rows > upsample->rows_to_go) + num_rows = upsample->rows_to_go; + /* And not more than what the client can accept: */ + out_rows_avail -= *out_row_ctr; + if (num_rows > out_rows_avail) + num_rows = out_rows_avail; + + (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, + (JDIMENSION) upsample->next_row_out, + output_buf + *out_row_ctr, + (int) num_rows); + + /* Adjust counts */ + *out_row_ctr += num_rows; + upsample->rows_to_go -= num_rows; + upsample->next_row_out += num_rows; + /* When the buffer is emptied, declare this input row group consumed */ + if (upsample->next_row_out >= cinfo->max_v_samp_factor) + (*in_row_group_ctr)++; +} + + +/* + * These are the routines invoked by sep_upsample to upsample pixel values + * of a single component. One row group is processed per call. + */ + + +/* + * For full-size components, we just make color_buf[ci] point at the + * input buffer, and thus avoid copying any data. Note that this is + * safe only because sep_upsample doesn't declare the input row group + * "consumed" until we are done color converting and emitting it. + */ + +METHODDEF(void) +fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = input_data; +} + + +/* + * This is a no-op version used for "uninteresting" components. + * These components will not be referenced by color conversion. + */ + +METHODDEF(void) +noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + *output_data_ptr = NULL; /* safety check */ +} + + +/* + * This version handles any integral sampling ratios. + * This is not used for typical JPEG files, so it need not be fast. + * Nor, for that matter, is it particularly accurate: the algorithm is + * simple replication of the input pixel onto the corresponding output + * pixels. The hi-falutin sampling literature refers to this as a + * "box filter". A box filter tends to introduce visible artifacts, + * so if you are actually going to use 3:1 or 4:1 sampling ratios + * you would be well advised to improve this code. + */ + +METHODDEF(void) +int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + register int h; + JSAMPROW outend; + int h_expand, v_expand; + int inrow, outrow; + + h_expand = upsample->h_expand[compptr->component_index]; + v_expand = upsample->v_expand[compptr->component_index]; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + /* Generate one output row with proper horizontal expansion */ + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + for (h = h_expand; h > 0; h--) { + *outptr++ = invalue; + } + } + /* Generate any additional output rows by duplicating the first one */ + if (v_expand > 1) { + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + v_expand-1, cinfo->output_width); + } + inrow++; + outrow += v_expand; + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int outrow; + + for (outrow = 0; outrow < cinfo->max_v_samp_factor; outrow++) { + inptr = input_data[outrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + } +} + + +/* + * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. + * It's still a box filter. + */ + +METHODDEF(void) +h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) +{ + JSAMPARRAY output_data = *output_data_ptr; + register JSAMPROW inptr, outptr; + register JSAMPLE invalue; + JSAMPROW outend; + int inrow, outrow; + + inrow = outrow = 0; + while (outrow < cinfo->max_v_samp_factor) { + inptr = input_data[inrow]; + outptr = output_data[outrow]; + outend = outptr + cinfo->output_width; + while (outptr < outend) { + invalue = *inptr++; /* don't need GETJSAMPLE() here */ + *outptr++ = invalue; + *outptr++ = invalue; + } + jcopy_sample_rows(output_data, outrow, output_data, outrow+1, + 1, cinfo->output_width); + inrow++; + outrow += 2; + } +} + + +/* + * Module initialization routine for upsampling. + */ + +GLOBAL(void) +jinit_upsampler (j_decompress_ptr cinfo) +{ + my_upsample_ptr upsample; + int ci; + jpeg_component_info * compptr; + boolean need_buffer; + int h_in_group, v_in_group, h_out_group, v_out_group; + + upsample = (my_upsample_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_upsampler)); + cinfo->upsample = (struct jpeg_upsampler *) upsample; + upsample->pub.start_pass = start_pass_upsample; + upsample->pub.upsample = sep_upsample; + upsample->pub.need_context_rows = FALSE; /* until we find out differently */ + + if (cinfo->CCIR601_sampling) /* this isn't supported */ + ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); + + /* Verify we can handle the sampling factors, select per-component methods, + * and create storage as needed. + */ + for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; + ci++, compptr++) { + /* Compute size of an "input group" after IDCT scaling. This many samples + * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. + */ + h_in_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) / + cinfo->min_DCT_h_scaled_size; + v_in_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / + cinfo->min_DCT_v_scaled_size; + h_out_group = cinfo->max_h_samp_factor; + v_out_group = cinfo->max_v_samp_factor; + upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ + need_buffer = TRUE; + if (! compptr->component_needed) { + /* Don't bother to upsample an uninteresting component. */ + upsample->methods[ci] = noop_upsample; + need_buffer = FALSE; + } else if (h_in_group == h_out_group && v_in_group == v_out_group) { + /* Fullsize components can be processed without any work. */ + upsample->methods[ci] = fullsize_upsample; + need_buffer = FALSE; + } else if (h_in_group * 2 == h_out_group && + v_in_group == v_out_group) { + /* Special case for 2h1v upsampling */ + upsample->methods[ci] = h2v1_upsample; + } else if (h_in_group * 2 == h_out_group && + v_in_group * 2 == v_out_group) { + /* Special case for 2h2v upsampling */ + upsample->methods[ci] = h2v2_upsample; + } else if ((h_out_group % h_in_group) == 0 && + (v_out_group % v_in_group) == 0) { + /* Generic integral-factors upsampling method */ + upsample->methods[ci] = int_upsample; + upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); + upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); + } else + ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); + if (need_buffer) { + upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) jround_up((long) cinfo->output_width, + (long) cinfo->max_h_samp_factor), + (JDIMENSION) cinfo->max_v_samp_factor); + } + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jdtrans.c b/thirdparty/LibJPEG/jpeg-9/jdtrans.c new file mode 100644 index 0000000..22dd47f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jdtrans.c @@ -0,0 +1,140 @@ +/* + * jdtrans.c + * + * Copyright (C) 1995-1997, Thomas G. Lane. + * Modified 2000-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains library routines for transcoding decompression, + * that is, reading raw DCT coefficient arrays from an input JPEG file. + * The routines in jdapimin.c will also be needed by a transcoder. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* Forward declarations */ +LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); + + +/* + * Read the coefficient arrays from a JPEG file. + * jpeg_read_header must be completed before calling this. + * + * The entire image is read into a set of virtual coefficient-block arrays, + * one per component. The return value is a pointer to the array of + * virtual-array descriptors. These can be manipulated directly via the + * JPEG memory manager, or handed off to jpeg_write_coefficients(). + * To release the memory occupied by the virtual arrays, call + * jpeg_finish_decompress() when done with the data. + * + * An alternative usage is to simply obtain access to the coefficient arrays + * during a buffered-image-mode decompression operation. This is allowed + * after any jpeg_finish_output() call. The arrays can be accessed until + * jpeg_finish_decompress() is called. (Note that any call to the library + * may reposition the arrays, so don't rely on access_virt_barray() results + * to stay valid across library calls.) + * + * Returns NULL if suspended. This case need be checked only if + * a suspending data source is used. + */ + +GLOBAL(jvirt_barray_ptr *) +jpeg_read_coefficients (j_decompress_ptr cinfo) +{ + if (cinfo->global_state == DSTATE_READY) { + /* First call: initialize active modules */ + transdecode_master_selection(cinfo); + cinfo->global_state = DSTATE_RDCOEFS; + } + if (cinfo->global_state == DSTATE_RDCOEFS) { + /* Absorb whole file into the coef buffer */ + for (;;) { + int retcode; + /* Call progress monitor hook if present */ + if (cinfo->progress != NULL) + (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); + /* Absorb some more input */ + retcode = (*cinfo->inputctl->consume_input) (cinfo); + if (retcode == JPEG_SUSPENDED) + return NULL; + if (retcode == JPEG_REACHED_EOI) + break; + /* Advance progress counter if appropriate */ + if (cinfo->progress != NULL && + (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { + if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { + /* startup underestimated number of scans; ratchet up one scan */ + cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; + } + } + } + /* Set state so that jpeg_finish_decompress does the right thing */ + cinfo->global_state = DSTATE_STOPPING; + } + /* At this point we should be in state DSTATE_STOPPING if being used + * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access + * to the coefficients during a full buffered-image-mode decompression. + */ + if ((cinfo->global_state == DSTATE_STOPPING || + cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { + return cinfo->coef->coef_arrays; + } + /* Oops, improper usage */ + ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); + return NULL; /* keep compiler happy */ +} + + +/* + * Master selection of decompression modules for transcoding. + * This substitutes for jdmaster.c's initialization of the full decompressor. + */ + +LOCAL(void) +transdecode_master_selection (j_decompress_ptr cinfo) +{ + /* This is effectively a buffered-image operation. */ + cinfo->buffered_image = TRUE; + + /* Compute output image dimensions and related values. */ + jpeg_core_output_dimensions(cinfo); + + /* Entropy decoding: either Huffman or arithmetic coding. */ + if (cinfo->arith_code) + jinit_arith_decoder(cinfo); + else { + jinit_huff_decoder(cinfo); + } + + /* Always get a full-image coefficient buffer. */ + jinit_d_coef_controller(cinfo, TRUE); + + /* We can now tell the memory manager to allocate virtual arrays. */ + (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); + + /* Initialize input side of decompressor to consume first scan. */ + (*cinfo->inputctl->start_input_pass) (cinfo); + + /* Initialize progress monitoring. */ + if (cinfo->progress != NULL) { + int nscans; + /* Estimate number of scans to set pass_limit. */ + if (cinfo->progressive_mode) { + /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ + nscans = 2 + 3 * cinfo->num_components; + } else if (cinfo->inputctl->has_multiple_scans) { + /* For a nonprogressive multiscan file, estimate 1 scan per component. */ + nscans = cinfo->num_components; + } else { + nscans = 1; + } + cinfo->progress->pass_counter = 0L; + cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; + cinfo->progress->completed_passes = 0; + cinfo->progress->total_passes = 1; + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/jerror.c b/thirdparty/LibJPEG/jpeg-9/jerror.c new file mode 100644 index 0000000..8c0b9e0 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jerror.c @@ -0,0 +1,253 @@ +/* + * jerror.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains simple error-reporting and trace-message routines. + * These are suitable for Unix-like systems and others where writing to + * stderr is the right thing to do. Many applications will want to replace + * some or all of these routines. + * + * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, + * you get a Windows-specific hack to display error messages in a dialog box. + * It ain't much, but it beats dropping error messages into the bit bucket, + * which is what happens to output to stderr under most Windows C compilers. + * + * These routines are used by both the compression and decompression code. + */ + +/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ +#include "jinclude.h" +#include "jpeglib.h" +#include "jversion.h" +#include "jerror.h" + +#ifdef USE_WINDOWS_MESSAGEBOX +#include +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif + + +/* + * Create the message string table. + * We do this from the master message list in jerror.h by re-reading + * jerror.h with a suitable definition for macro JMESSAGE. + * The message table is made an external symbol just in case any applications + * want to refer to it directly. + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_message_table jMsgTable +#endif + +#define JMESSAGE(code,string) string , + +const char * const jpeg_std_message_table[] = { +#include "jerror.h" + NULL +}; + + +/* + * Error exit handler: must not return to caller. + * + * Applications may override this if they want to get control back after + * an error. Typically one would longjmp somewhere instead of exiting. + * The setjmp buffer can be made a private field within an expanded error + * handler object. Note that the info needed to generate an error message + * is stored in the error object, so you can generate the message now or + * later, at your convenience. + * You should make sure that the JPEG object is cleaned up (with jpeg_abort + * or jpeg_destroy) at some point. + */ + +METHODDEF(noreturn_t) +error_exit (j_common_ptr cinfo) +{ + /* Always display the message */ + (*cinfo->err->output_message) (cinfo); + + /* Let the memory manager delete any temp files before we die */ + jpeg_destroy(cinfo); + + exit(EXIT_FAILURE); +} + + +/* + * Actual output of an error or trace message. + * Applications may override this method to send JPEG messages somewhere + * other than stderr. + * + * On Windows, printing to stderr is generally completely useless, + * so we provide optional code to produce an error-dialog popup. + * Most Windows applications will still prefer to override this routine, + * but if they don't, it'll do something at least marginally useful. + * + * NOTE: to use the library in an environment that doesn't support the + * C stdio library, you may have to delete the call to fprintf() entirely, + * not just not use this routine. + */ + +METHODDEF(void) +output_message (j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + /* Create the message */ + (*cinfo->err->format_message) (cinfo, buffer); + +#ifdef USE_WINDOWS_MESSAGEBOX + /* Display it in a message dialog box */ + MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", + MB_OK | MB_ICONERROR); +#else + /* Send it to stderr, adding a newline */ + fprintf(stderr, "%s\n", buffer); +#endif +} + + +/* + * Decide whether to emit a trace or warning message. + * msg_level is one of: + * -1: recoverable corrupt-data warning, may want to abort. + * 0: important advisory messages (always display to user). + * 1: first level of tracing detail. + * 2,3,...: successively more detailed tracing messages. + * An application might override this method if it wanted to abort on warnings + * or change the policy about which messages to display. + */ + +METHODDEF(void) +emit_message (j_common_ptr cinfo, int msg_level) +{ + struct jpeg_error_mgr * err = cinfo->err; + + if (msg_level < 0) { + /* It's a warning message. Since corrupt files may generate many warnings, + * the policy implemented here is to show only the first warning, + * unless trace_level >= 3. + */ + if (err->num_warnings == 0 || err->trace_level >= 3) + (*err->output_message) (cinfo); + /* Always count warnings in num_warnings. */ + err->num_warnings++; + } else { + /* It's a trace message. Show it if trace_level >= msg_level. */ + if (err->trace_level >= msg_level) + (*err->output_message) (cinfo); + } +} + + +/* + * Format a message string for the most recent JPEG error or message. + * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX + * characters. Note that no '\n' character is added to the string. + * Few applications should need to override this method. + */ + +METHODDEF(void) +format_message (j_common_ptr cinfo, char * buffer) +{ + struct jpeg_error_mgr * err = cinfo->err; + int msg_code = err->msg_code; + const char * msgtext = NULL; + const char * msgptr; + char ch; + boolean isstring; + + /* Look up message string in proper table */ + if (msg_code > 0 && msg_code <= err->last_jpeg_message) { + msgtext = err->jpeg_message_table[msg_code]; + } else if (err->addon_message_table != NULL && + msg_code >= err->first_addon_message && + msg_code <= err->last_addon_message) { + msgtext = err->addon_message_table[msg_code - err->first_addon_message]; + } + + /* Defend against bogus message number */ + if (msgtext == NULL) { + err->msg_parm.i[0] = msg_code; + msgtext = err->jpeg_message_table[0]; + } + + /* Check for string parameter, as indicated by %s in the message text */ + isstring = FALSE; + msgptr = msgtext; + while ((ch = *msgptr++) != '\0') { + if (ch == '%') { + if (*msgptr == 's') isstring = TRUE; + break; + } + } + + /* Format the message into the passed buffer */ + if (isstring) + sprintf(buffer, msgtext, err->msg_parm.s); + else + sprintf(buffer, msgtext, + err->msg_parm.i[0], err->msg_parm.i[1], + err->msg_parm.i[2], err->msg_parm.i[3], + err->msg_parm.i[4], err->msg_parm.i[5], + err->msg_parm.i[6], err->msg_parm.i[7]); +} + + +/* + * Reset error state variables at start of a new image. + * This is called during compression startup to reset trace/error + * processing to default state, without losing any application-specific + * method pointers. An application might possibly want to override + * this method if it has additional error processing state. + */ + +METHODDEF(void) +reset_error_mgr (j_common_ptr cinfo) +{ + cinfo->err->num_warnings = 0; + /* trace_level is not reset since it is an application-supplied parameter */ + cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ +} + + +/* + * Fill in the standard error-handling methods in a jpeg_error_mgr object. + * Typical call is: + * struct jpeg_compress_struct cinfo; + * struct jpeg_error_mgr err; + * + * cinfo.err = jpeg_std_error(&err); + * after which the application may override some of the methods. + */ + +GLOBAL(struct jpeg_error_mgr *) +jpeg_std_error (struct jpeg_error_mgr * err) +{ + err->error_exit = error_exit; + err->emit_message = emit_message; + err->output_message = output_message; + err->format_message = format_message; + err->reset_error_mgr = reset_error_mgr; + + err->trace_level = 0; /* default = no tracing */ + err->num_warnings = 0; /* no warnings emitted yet */ + err->msg_code = 0; /* may be useful as a flag for "no error" */ + + /* Initialize message table pointers */ + err->jpeg_message_table = jpeg_std_message_table; + err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; + + err->addon_message_table = NULL; + err->first_addon_message = 0; /* for safety */ + err->last_addon_message = 0; + + return err; +} diff --git a/thirdparty/LibJPEG/jpeg-9/jerror.h b/thirdparty/LibJPEG/jpeg-9/jerror.h new file mode 100644 index 0000000..a4b661f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jerror.h @@ -0,0 +1,304 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 1997-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") +JMESSAGE(JERR_BAD_DROP_SAMPLING, + "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_BEFORE, "Invalid JPEG file structure: %s before SOF") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (cinfo)->err->msg_parm.i[4] = (p5), \ + (cinfo)->err->msg_parm.i[5] = (p6), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/thirdparty/LibJPEG/jpeg-9/jfdctflt.c b/thirdparty/LibJPEG/jpeg-9/jfdctflt.c new file mode 100644 index 0000000..74d0d86 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jfdctflt.c @@ -0,0 +1,174 @@ +/* + * jfdctflt.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2003-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * forward DCT (Discrete Cosine Transform). + * + * This implementation should be more accurate than either of the integer + * DCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; + FAST_FLOAT *dataptr; + JSAMPROW elemptr; + int ctr; + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Load data into workspace */ + tmp0 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7])); + tmp7 = (FAST_FLOAT) (GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7])); + tmp1 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6])); + tmp6 = (FAST_FLOAT) (GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6])); + tmp2 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5])); + tmp5 = (FAST_FLOAT) (GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5])); + tmp3 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4])); + tmp4 = (FAST_FLOAT) (GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4])); + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Apply unsigned->signed conversion */ + dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ + z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ + z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ + z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jfdctfst.c b/thirdparty/LibJPEG/jpeg-9/jfdctfst.c new file mode 100644 index 0000000..8cad5f2 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jfdctfst.c @@ -0,0 +1,230 @@ +/* + * jfdctfst.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2003-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jfdctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * Again to save a few shifts, the intermediate results between pass 1 and + * pass 2 are not upscaled, but are represented only to integral precision. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#define CONST_BITS 8 + + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */ +#else +#define FIX_0_382683433 FIX(0.382683433) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_707106781 FIX(0.707106781) +#define FIX_1_306562965 FIX(1.306562965) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z1, z2, z3, z4, z5, z11, z13; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + + dataptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Load data into workspace */ + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); + tmp7 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]); + tmp6 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]); + tmp5 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]); + tmp4 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Apply unsigned->signed conversion */ + dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */ + dataptr[4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[2] = tmp13 + z1; /* phase 5 */ + dataptr[6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[5] = z13 + z2; /* phase 6 */ + dataptr[3] = z13 - z2; + dataptr[1] = z11 + z4; + dataptr[7] = z11 - z4; + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + /* Even part */ + + tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ + dataptr[DCTSIZE*4] = tmp10 - tmp11; + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ + dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ + dataptr[DCTSIZE*6] = tmp13 - z1; + + /* Odd part */ + + tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + /* The rotator is modified from fig 4-8 to avoid extra negations. */ + z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ + + z11 = tmp7 + z3; /* phase 5 */ + z13 = tmp7 - z3; + + dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ + dataptr[DCTSIZE*3] = z13 - z2; + dataptr[DCTSIZE*1] = z11 + z4; + dataptr[DCTSIZE*7] = z11 - z4; + + dataptr++; /* advance pointer to next column */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jfdctint.c b/thirdparty/LibJPEG/jpeg-9/jfdctint.c new file mode 100644 index 0000000..1dde58c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jfdctint.c @@ -0,0 +1,4348 @@ +/* + * jfdctint.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modification developed 2003-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * forward DCT (Discrete Cosine Transform). + * + * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + * + * We also provide FDCT routines with various input sample block sizes for + * direct resolution reduction or enlargement and for direct resolving the + * common 2x1 and 1x2 subsampling cases without additional resampling: NxN + * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 output DCT block. + * + * For N<8 we fill the remaining block coefficients with zero. + * For N>8 we apply a partial N-point FDCT on the input samples, computing + * just the lower 8 frequency coefficients and discarding the rest. + * + * We must scale the output coefficients of the N-point FDCT appropriately + * to the standard 8-point FDCT level by 8/N per 1-D pass. This scaling + * is folded into the constant multipliers (pass 2) and/or final/initial + * shifting. + * + * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases + * since there would be too many additional constants to pre-calculate. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D DCT step produces outputs which are a factor of sqrt(N) + * larger than the true DCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D DCT, + * because the y0 and y4 outputs need not be divided by sqrt(N). + * In the IJG code, this factor of 8 is removed by the quantization step + * (in jcdctmgr.c), NOT in this module. + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (For 12-bit sample data, the intermediate + * array is INT32 anyway.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* + * Perform the forward DCT on one block of samples. + */ + +GLOBAL(void) +jpeg_fdct_islow (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]); + + tmp10 = tmp0 + tmp3; + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), + CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) + RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) + RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) + RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + + /* Add fudge factor here for final descale. */ + tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1)); + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS+PASS1_BITS-1); + dataptr[DCTSIZE*2] = (DCTELEM) + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS+PASS1_BITS-1); + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[DCTSIZE*1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) + RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) + RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + +#ifdef DCT_SCALING_SUPPORTED + + +/* + * Perform the forward DCT on a 7x7 sample block. + */ + +GLOBAL(void) +jpeg_fdct_7x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12; + INT32 z1, z2, z3; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* cK represents sqrt(2) * cos(K*pi/14). */ + + dataptr = data; + for (ctr = 0; ctr < 7; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]); + tmp3 = GETJSAMPLE(elemptr[3]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); + + z1 = tmp0 + tmp2; + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); + tmp3 += tmp3; + z1 -= tmp3; + z1 -= tmp3; + z1 = MULTIPLY(z1, FIX(0.353553391)); /* (c2+c6-c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002)); /* (c2+c4-c6)/2 */ + z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123)); /* c6 */ + dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS); + z1 -= z2; + z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734)); /* c4 */ + dataptr[4] = (DCTELEM) + DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */ + tmp1 += tmp2; + tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268)); /* c5 */ + tmp0 += tmp3; + tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693)); /* c3+c1-c5 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/7)**2 = 64/49, which we fold + * into the constant multipliers: + * cK now represents sqrt(2) * cos(K*pi/14) * 64/49. + */ + + dataptr = data; + for (ctr = 0; ctr < 7; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4]; + tmp3 = dataptr[DCTSIZE*3]; + + tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5]; + tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4]; + + z1 = tmp0 + tmp2; + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */ + CONST_BITS+PASS1_BITS); + tmp3 += tmp3; + z1 -= tmp3; + z1 -= tmp3; + z1 = MULTIPLY(z1, FIX(0.461784020)); /* (c2+c6-c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084)); /* (c2+c4-c6)/2 */ + z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446)); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS); + z1 -= z2; + z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509)); /* c4 */ + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */ + tmp1 += tmp2; + tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310)); /* c5 */ + tmp0 += tmp3; + tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355)); /* c3+c1-c5 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 6x6 sample block. + */ + +GLOBAL(void) +jpeg_fdct_6x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2; + INT32 tmp10, tmp11, tmp12; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* cK represents sqrt(2) * cos(K*pi/12). */ + + dataptr = data; + for (ctr = 0; ctr < 6; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]); + tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */ + CONST_BITS-PASS1_BITS); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */ + CONST_BITS-PASS1_BITS); + + dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS)); + dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS); + dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS)); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/6)**2 = 16/9, which we fold + * into the constant multipliers: + * cK now represents sqrt(2) * cos(K*pi/12) * 16/9. + */ + + dataptr = data; + for (ctr = 0; ctr < 6; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5]; + tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3]; + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 5x5 sample block. + */ + +GLOBAL(void) +jpeg_fdct_5x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2; + INT32 tmp10, tmp11; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* cK represents sqrt(2) * cos(K*pi/10). */ + + dataptr = data; + for (ctr = 0; ctr < 5; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]); + tmp2 = GETJSAMPLE(elemptr[2]); + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << (PASS1_BITS+1)); + tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ + tmp10 -= tmp2 << 2; + tmp10 = MULTIPLY(tmp10, FIX(0.353553391)); /* (c2-c4)/2 */ + dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS-1); + dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS-1); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876)); /* c3 */ + + dataptr[1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */ + CONST_BITS-PASS1_BITS-1); + dataptr[3] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */ + CONST_BITS-PASS1_BITS-1); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/5)**2 = 64/25, which we partially + * fold into the constant multipliers (other part was done in pass 1): + * cK now represents sqrt(2) * cos(K*pi/10) * 32/25. + */ + + dataptr = data; + for (ctr = 0; ctr < 5; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3]; + tmp2 = dataptr[DCTSIZE*2]; + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)), /* 32/25 */ + CONST_BITS+PASS1_BITS); + tmp11 = MULTIPLY(tmp11, FIX(1.011928851)); /* (c2+c4)/2 */ + tmp10 -= tmp2 << 2; + tmp10 = MULTIPLY(tmp10, FIX(0.452548340)); /* (c2-c4)/2 */ + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961)); /* c3 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 4x4 sample block. + */ + +GLOBAL(void) +jpeg_fdct_4x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1; + INT32 tmp10, tmp11; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We must also scale the output by (8/4)**2 = 2**2, which we add here. */ + /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+2)); + dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+2)); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-3); + + dataptr[1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS-2); + dataptr[3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS-2); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1)); + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2]; + + tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2]; + + dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS+PASS1_BITS-1); + + dataptr[DCTSIZE*1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 3x3 sample block. + */ + +GLOBAL(void) +jpeg_fdct_3x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We scale the results further by 2**2 as part of output adaption */ + /* scaling for different DCT size. */ + /* cK represents sqrt(2) * cos(K*pi/6). */ + + dataptr = data; + for (ctr = 0; ctr < 3; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]); + tmp1 = GETJSAMPLE(elemptr[1]); + + tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+2)); + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */ + CONST_BITS-PASS1_BITS-2); + + /* Odd part */ + + dataptr[1] = (DCTELEM) + DESCALE(MULTIPLY(tmp2, FIX(1.224744871)), /* c1 */ + CONST_BITS-PASS1_BITS-2); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/3)**2 = 64/9, which we partially + * fold into the constant multipliers (other part was done in pass 1): + * cK now represents sqrt(2) * cos(K*pi/6) * 16/9. + */ + + dataptr = data; + for (ctr = 0; ctr < 3; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2]; + tmp1 = dataptr[DCTSIZE*1]; + + tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(MULTIPLY(tmp2, FIX(2.177324216)), /* c1 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 2x2 sample block. + */ + +GLOBAL(void) +jpeg_fdct_2x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + JSAMPROW elemptr; + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + + /* Row 0 */ + elemptr = sample_data[0] + start_col; + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]); + tmp1 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]); + + /* Row 1 */ + elemptr = sample_data[1] + start_col; + + tmp2 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[1]); + tmp3 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[1]); + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/2)**2 = 2**4. + */ + + /* Column 0 */ + /* Apply unsigned->signed conversion */ + data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp2 - 4 * CENTERJSAMPLE) << 4); + data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp2) << 4); + + /* Column 1 */ + data[DCTSIZE*0+1] = (DCTELEM) ((tmp1 + tmp3) << 4); + data[DCTSIZE*1+1] = (DCTELEM) ((tmp1 - tmp3) << 4); +} + + +/* + * Perform the forward DCT on a 1x1 sample block. + */ + +GLOBAL(void) +jpeg_fdct_1x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* We leave the result scaled up by an overall factor of 8. */ + /* We must also scale the output by (8/1)**2 = 2**6. */ + /* Apply unsigned->signed conversion */ + data[0] = (DCTELEM) + ((GETJSAMPLE(sample_data[0][start_col]) - CENTERJSAMPLE) << 6); +} + + +/* + * Perform the forward DCT on a 9x9 sample block. + */ + +GLOBAL(void) +jpeg_fdct_9x9 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2; + DCTELEM workspace[8]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* we scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* cK represents sqrt(2) * cos(K*pi/18). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[8]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[7]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[6]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[5]); + tmp4 = GETJSAMPLE(elemptr[4]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[8]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[7]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[6]); + tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[5]); + + z1 = tmp0 + tmp2 + tmp3; + z2 = tmp1 + tmp4; + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) ((z1 + z2 - 9 * CENTERJSAMPLE) << 1); + dataptr[6] = (DCTELEM) + DESCALE(MULTIPLY(z1 - z2 - z2, FIX(0.707106781)), /* c6 */ + CONST_BITS-1); + z1 = MULTIPLY(tmp0 - tmp2, FIX(1.328926049)); /* c2 */ + z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(0.707106781)); /* c6 */ + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.083350441)) /* c4 */ + + z1 + z2, CONST_BITS-1); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.245575608)) /* c8 */ + + z1 - z2, CONST_BITS-1); + + /* Odd part */ + + dataptr[3] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.224744871)), /* c3 */ + CONST_BITS-1); + + tmp11 = MULTIPLY(tmp11, FIX(1.224744871)); /* c3 */ + tmp0 = MULTIPLY(tmp10 + tmp12, FIX(0.909038955)); /* c5 */ + tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.483689525)); /* c7 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS-1); + + tmp2 = MULTIPLY(tmp12 - tmp13, FIX(1.392728481)); /* c1 */ + + dataptr[5] = (DCTELEM) DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS-1); + dataptr[7] = (DCTELEM) DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS-1); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 9) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/9)**2 = 64/81, which we partially + * fold into the constant multipliers and final/initial shifting: + * cK now represents sqrt(2) * cos(K*pi/18) * 128/81. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*0]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*7]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*6]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*5]; + tmp4 = dataptr[DCTSIZE*4]; + + tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*0]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*7]; + tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*6]; + tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*5]; + + z1 = tmp0 + tmp2 + tmp3; + z2 = tmp1 + tmp4; + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(z1 + z2, FIX(1.580246914)), /* 128/81 */ + CONST_BITS+2); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(MULTIPLY(z1 - z2 - z2, FIX(1.117403309)), /* c6 */ + CONST_BITS+2); + z1 = MULTIPLY(tmp0 - tmp2, FIX(2.100031287)); /* c2 */ + z2 = MULTIPLY(tmp1 - tmp4 - tmp4, FIX(1.117403309)); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp2 - tmp3, FIX(1.711961190)) /* c4 */ + + z1 + z2, CONST_BITS+2); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp3 - tmp0, FIX(0.388070096)) /* c8 */ + + z1 - z2, CONST_BITS+2); + + /* Odd part */ + + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12 - tmp13, FIX(1.935399303)), /* c3 */ + CONST_BITS+2); + + tmp11 = MULTIPLY(tmp11, FIX(1.935399303)); /* c3 */ + tmp0 = MULTIPLY(tmp10 + tmp12, FIX(1.436506004)); /* c5 */ + tmp1 = MULTIPLY(tmp10 + tmp13, FIX(0.764348879)); /* c7 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp11 + tmp0 + tmp1, CONST_BITS+2); + + tmp2 = MULTIPLY(tmp12 - tmp13, FIX(2.200854883)); /* c1 */ + + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp0 - tmp11 - tmp2, CONST_BITS+2); + dataptr[DCTSIZE*7] = (DCTELEM) + DESCALE(tmp1 - tmp11 + tmp2, CONST_BITS+2); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 10x10 sample block. + */ + +GLOBAL(void) +jpeg_fdct_10x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + DCTELEM workspace[8*2]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* we scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* cK represents sqrt(2) * cos(K*pi/20). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]); + tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]); + + tmp10 = tmp0 + tmp4; + tmp13 = tmp0 - tmp4; + tmp11 = tmp1 + tmp3; + tmp14 = tmp1 - tmp3; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << 1); + tmp12 += tmp12; + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */ + MULTIPLY(tmp11 - tmp12, FIX(0.437016024)), /* c8 */ + CONST_BITS-1); + tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876)); /* c6 */ + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)), /* c2-c6 */ + CONST_BITS-1); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)), /* c2+c6 */ + CONST_BITS-1); + + /* Odd part */ + + tmp10 = tmp0 + tmp4; + tmp11 = tmp1 - tmp3; + dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << 1); + tmp2 <<= CONST_BITS; + dataptr[1] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) + /* c1 */ + MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 + /* c3 */ + MULTIPLY(tmp3, FIX(0.642039522)) + /* c7 */ + MULTIPLY(tmp4, FIX(0.221231742)), /* c9 */ + CONST_BITS-1); + tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) - /* (c3+c7)/2 */ + MULTIPLY(tmp1 + tmp3, FIX(0.587785252)); /* (c1-c9)/2 */ + tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) + /* (c3-c7)/2 */ + (tmp11 << (CONST_BITS - 1)) - tmp2; + dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-1); + dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-1); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 10) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/10)**2 = 16/25, which we partially + * fold into the constant multipliers and final/initial shifting: + * cK now represents sqrt(2) * cos(K*pi/20) * 32/25. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0]; + tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6]; + tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5]; + + tmp10 = tmp0 + tmp4; + tmp13 = tmp0 - tmp4; + tmp11 = tmp1 + tmp3; + tmp14 = tmp1 - tmp3; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7]; + tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6]; + tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */ + CONST_BITS+2); + tmp12 += tmp12; + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */ + MULTIPLY(tmp11 - tmp12, FIX(0.559380511)), /* c8 */ + CONST_BITS+2); + tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961)); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)), /* c2-c6 */ + CONST_BITS+2); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)), /* c2+c6 */ + CONST_BITS+2); + + /* Odd part */ + + tmp10 = tmp0 + tmp4; + tmp11 = tmp1 - tmp3; + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)), /* 32/25 */ + CONST_BITS+2); + tmp2 = MULTIPLY(tmp2, FIX(1.28)); /* 32/25 */ + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) + /* c1 */ + MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 + /* c3 */ + MULTIPLY(tmp3, FIX(0.821810588)) + /* c7 */ + MULTIPLY(tmp4, FIX(0.283176630)), /* c9 */ + CONST_BITS+2); + tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) - /* (c3+c7)/2 */ + MULTIPLY(tmp1 + tmp3, FIX(0.752365123)); /* (c1-c9)/2 */ + tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) + /* (c3-c7)/2 */ + MULTIPLY(tmp11, FIX(0.64)) - tmp2; /* 16/25 */ + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+2); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+2); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on an 11x11 sample block. + */ + +GLOBAL(void) +jpeg_fdct_11x11 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 z1, z2, z3; + DCTELEM workspace[8*3]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* we scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* cK represents sqrt(2) * cos(K*pi/22). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[10]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[9]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[8]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[7]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[6]); + tmp5 = GETJSAMPLE(elemptr[5]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[10]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[9]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[8]); + tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[7]); + tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[6]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 - 11 * CENTERJSAMPLE) << 1); + tmp5 += tmp5; + tmp0 -= tmp5; + tmp1 -= tmp5; + tmp2 -= tmp5; + tmp3 -= tmp5; + tmp4 -= tmp5; + z1 = MULTIPLY(tmp0 + tmp3, FIX(1.356927976)) + /* c2 */ + MULTIPLY(tmp2 + tmp4, FIX(0.201263574)); /* c10 */ + z2 = MULTIPLY(tmp1 - tmp3, FIX(0.926112931)); /* c6 */ + z3 = MULTIPLY(tmp0 - tmp1, FIX(1.189712156)); /* c4 */ + dataptr[2] = (DCTELEM) + DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.018300590)) /* c2+c8-c6 */ + - MULTIPLY(tmp4, FIX(1.390975730)), /* c4+c10 */ + CONST_BITS-1); + dataptr[4] = (DCTELEM) + DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.062335650)) /* c4-c6-c10 */ + - MULTIPLY(tmp2, FIX(1.356927976)) /* c2 */ + + MULTIPLY(tmp4, FIX(0.587485545)), /* c8 */ + CONST_BITS-1); + dataptr[6] = (DCTELEM) + DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.620527200)) /* c2+c4-c6 */ + - MULTIPLY(tmp2, FIX(0.788749120)), /* c8+c10 */ + CONST_BITS-1); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.286413905)); /* c3 */ + tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.068791298)); /* c5 */ + tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.764581576)); /* c7 */ + tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.719967871)) /* c7+c5+c3-c1 */ + + MULTIPLY(tmp14, FIX(0.398430003)); /* c9 */ + tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.764581576)); /* -c7 */ + tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.399818907)); /* -c1 */ + tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.276416582)) /* c9+c7+c1-c3 */ + - MULTIPLY(tmp14, FIX(1.068791298)); /* c5 */ + tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.398430003)); /* c9 */ + tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(1.989053629)) /* c9+c5+c3-c7 */ + + MULTIPLY(tmp14, FIX(1.399818907)); /* c1 */ + tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.305598626)) /* c1+c5-c9-c7 */ + - MULTIPLY(tmp14, FIX(1.286413905)); /* c3 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-1); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-1); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-1); + dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS-1); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 11) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/11)**2 = 64/121, which we partially + * fold into the constant multipliers and final/initial shifting: + * cK now represents sqrt(2) * cos(K*pi/22) * 128/121. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*2]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*1]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*0]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*7]; + tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*6]; + tmp5 = dataptr[DCTSIZE*5]; + + tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*2]; + tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*1]; + tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*0]; + tmp13 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*7]; + tmp14 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*6]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5, + FIX(1.057851240)), /* 128/121 */ + CONST_BITS+2); + tmp5 += tmp5; + tmp0 -= tmp5; + tmp1 -= tmp5; + tmp2 -= tmp5; + tmp3 -= tmp5; + tmp4 -= tmp5; + z1 = MULTIPLY(tmp0 + tmp3, FIX(1.435427942)) + /* c2 */ + MULTIPLY(tmp2 + tmp4, FIX(0.212906922)); /* c10 */ + z2 = MULTIPLY(tmp1 - tmp3, FIX(0.979689713)); /* c6 */ + z3 = MULTIPLY(tmp0 - tmp1, FIX(1.258538479)); /* c4 */ + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(z1 + z2 - MULTIPLY(tmp3, FIX(1.077210542)) /* c2+c8-c6 */ + - MULTIPLY(tmp4, FIX(1.471445400)), /* c4+c10 */ + CONST_BITS+2); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(z2 + z3 + MULTIPLY(tmp1, FIX(0.065941844)) /* c4-c6-c10 */ + - MULTIPLY(tmp2, FIX(1.435427942)) /* c2 */ + + MULTIPLY(tmp4, FIX(0.621472312)), /* c8 */ + CONST_BITS+2); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(z1 + z3 - MULTIPLY(tmp0, FIX(1.714276708)) /* c2+c4-c6 */ + - MULTIPLY(tmp2, FIX(0.834379234)), /* c8+c10 */ + CONST_BITS+2); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.360834544)); /* c3 */ + tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.130622199)); /* c5 */ + tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.808813568)); /* c7 */ + tmp0 = tmp1 + tmp2 + tmp3 - MULTIPLY(tmp10, FIX(1.819470145)) /* c7+c5+c3-c1 */ + + MULTIPLY(tmp14, FIX(0.421479672)); /* c9 */ + tmp4 = MULTIPLY(tmp11 + tmp12, - FIX(0.808813568)); /* -c7 */ + tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.480800167)); /* -c1 */ + tmp1 += tmp4 + tmp5 + MULTIPLY(tmp11, FIX(1.350258864)) /* c9+c7+c1-c3 */ + - MULTIPLY(tmp14, FIX(1.130622199)); /* c5 */ + tmp10 = MULTIPLY(tmp12 + tmp13, FIX(0.421479672)); /* c9 */ + tmp2 += tmp4 + tmp10 - MULTIPLY(tmp12, FIX(2.104122847)) /* c9+c5+c3-c7 */ + + MULTIPLY(tmp14, FIX(1.480800167)); /* c1 */ + tmp3 += tmp5 + tmp10 + MULTIPLY(tmp13, FIX(1.381129125)) /* c1+c5-c9-c7 */ + - MULTIPLY(tmp14, FIX(1.360834544)); /* c3 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 12x12 sample block. + */ + +GLOBAL(void) +jpeg_fdct_12x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + DCTELEM workspace[8*4]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* cK represents sqrt(2) * cos(K*pi/24). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]); + + tmp10 = tmp0 + tmp5; + tmp13 = tmp0 - tmp5; + tmp11 = tmp1 + tmp4; + tmp14 = tmp1 - tmp4; + tmp12 = tmp2 + tmp3; + tmp15 = tmp2 - tmp3; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) (tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE); + dataptr[6] = (DCTELEM) (tmp13 - tmp14 - tmp15); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */ + CONST_BITS); + dataptr[2] = (DCTELEM) + DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */ + CONST_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100); /* c9 */ + tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865); /* c3-c9 */ + tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065); /* c3+c9 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054)); /* c5 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669)); /* c7 */ + tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */ + + MULTIPLY(tmp5, FIX(0.184591911)); /* c11 */ + tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */ + tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */ + + MULTIPLY(tmp5, FIX(0.860918669)); /* c7 */ + tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */ + - MULTIPLY(tmp5, FIX(1.121971054)); /* c5 */ + tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */ + - MULTIPLY(tmp2 + tmp5, FIX_0_541196100); /* c9 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 12) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/12)**2 = 4/9, which we partially + * fold into the constant multipliers and final shifting: + * cK now represents sqrt(2) * cos(K*pi/24) * 8/9. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0]; + tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7]; + tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6]; + + tmp10 = tmp0 + tmp5; + tmp13 = tmp0 - tmp5; + tmp11 = tmp1 + tmp4; + tmp14 = tmp1 - tmp4; + tmp12 = tmp2 + tmp3; + tmp15 = tmp2 - tmp3; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0]; + tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7]; + tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */ + CONST_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */ + CONST_BITS+1); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)), /* c4 */ + CONST_BITS+1); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) + /* 8/9 */ + MULTIPLY(tmp13 + tmp15, FIX(1.214244803)), /* c2 */ + CONST_BITS+1); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200)); /* c9 */ + tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102)); /* c3-c9 */ + tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502)); /* c3+c9 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603)); /* c5 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039)); /* c7 */ + tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */ + + MULTIPLY(tmp5, FIX(0.164081699)); /* c11 */ + tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */ + tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */ + + MULTIPLY(tmp5, FIX(0.765261039)); /* c7 */ + tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */ + - MULTIPLY(tmp5, FIX(0.997307603)); /* c5 */ + tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */ + - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+1); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+1); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 13x13 sample block. + */ + +GLOBAL(void) +jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + INT32 z1, z2; + DCTELEM workspace[8*5]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* cK represents sqrt(2) * cos(K*pi/26). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[12]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[11]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[10]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[9]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[8]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[7]); + tmp6 = GETJSAMPLE(elemptr[6]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[12]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[11]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[10]); + tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[9]); + tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[8]); + tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[7]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + (tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6 - 13 * CENTERJSAMPLE); + tmp6 += tmp6; + tmp0 -= tmp6; + tmp1 -= tmp6; + tmp2 -= tmp6; + tmp3 -= tmp6; + tmp4 -= tmp6; + tmp5 -= tmp6; + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.373119086)) + /* c2 */ + MULTIPLY(tmp1, FIX(1.058554052)) + /* c6 */ + MULTIPLY(tmp2, FIX(0.501487041)) - /* c10 */ + MULTIPLY(tmp3, FIX(0.170464608)) - /* c12 */ + MULTIPLY(tmp4, FIX(0.803364869)) - /* c8 */ + MULTIPLY(tmp5, FIX(1.252223920)), /* c4 */ + CONST_BITS); + z1 = MULTIPLY(tmp0 - tmp2, FIX(1.155388986)) - /* (c4+c6)/2 */ + MULTIPLY(tmp3 - tmp4, FIX(0.435816023)) - /* (c2-c10)/2 */ + MULTIPLY(tmp1 - tmp5, FIX(0.316450131)); /* (c8-c12)/2 */ + z2 = MULTIPLY(tmp0 + tmp2, FIX(0.096834934)) - /* (c4-c6)/2 */ + MULTIPLY(tmp3 + tmp4, FIX(0.937303064)) + /* (c2+c10)/2 */ + MULTIPLY(tmp1 + tmp5, FIX(0.486914739)); /* (c8+c12)/2 */ + + dataptr[4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.322312651)); /* c3 */ + tmp2 = MULTIPLY(tmp10 + tmp12, FIX(1.163874945)); /* c5 */ + tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.937797057)) + /* c7 */ + MULTIPLY(tmp14 + tmp15, FIX(0.338443458)); /* c11 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(tmp10, FIX(2.020082300)) + /* c3+c5+c7-c1 */ + MULTIPLY(tmp14, FIX(0.318774355)); /* c9-c11 */ + tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.937797057)) - /* c7 */ + MULTIPLY(tmp11 + tmp12, FIX(0.338443458)); /* c11 */ + tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(1.163874945)); /* -c5 */ + tmp1 += tmp4 + tmp5 + + MULTIPLY(tmp11, FIX(0.837223564)) - /* c5+c9+c11-c3 */ + MULTIPLY(tmp14, FIX(2.341699410)); /* c1+c7 */ + tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.657217813)); /* -c9 */ + tmp2 += tmp4 + tmp6 - + MULTIPLY(tmp12, FIX(1.572116027)) + /* c1+c5-c9-c11 */ + MULTIPLY(tmp15, FIX(2.260109708)); /* c3+c7 */ + tmp3 += tmp5 + tmp6 + + MULTIPLY(tmp13, FIX(2.205608352)) - /* c3+c5+c9-c7 */ + MULTIPLY(tmp15, FIX(1.742345811)); /* c1+c11 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 13) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/13)**2 = 64/169, which we partially + * fold into the constant multipliers and final shifting: + * cK now represents sqrt(2) * cos(K*pi/26) * 128/169. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*4]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*3]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*2]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*1]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*0]; + tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*7]; + tmp6 = dataptr[DCTSIZE*6]; + + tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*4]; + tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*3]; + tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*2]; + tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*1]; + tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*0]; + tmp15 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*7]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 + tmp1 + tmp2 + tmp3 + tmp4 + tmp5 + tmp6, + FIX(0.757396450)), /* 128/169 */ + CONST_BITS+1); + tmp6 += tmp6; + tmp0 -= tmp6; + tmp1 -= tmp6; + tmp2 -= tmp6; + tmp3 -= tmp6; + tmp4 -= tmp6; + tmp5 -= tmp6; + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.039995521)) + /* c2 */ + MULTIPLY(tmp1, FIX(0.801745081)) + /* c6 */ + MULTIPLY(tmp2, FIX(0.379824504)) - /* c10 */ + MULTIPLY(tmp3, FIX(0.129109289)) - /* c12 */ + MULTIPLY(tmp4, FIX(0.608465700)) - /* c8 */ + MULTIPLY(tmp5, FIX(0.948429952)), /* c4 */ + CONST_BITS+1); + z1 = MULTIPLY(tmp0 - tmp2, FIX(0.875087516)) - /* (c4+c6)/2 */ + MULTIPLY(tmp3 - tmp4, FIX(0.330085509)) - /* (c2-c10)/2 */ + MULTIPLY(tmp1 - tmp5, FIX(0.239678205)); /* (c8-c12)/2 */ + z2 = MULTIPLY(tmp0 + tmp2, FIX(0.073342435)) - /* (c4-c6)/2 */ + MULTIPLY(tmp3 + tmp4, FIX(0.709910013)) + /* (c2+c10)/2 */ + MULTIPLY(tmp1 + tmp5, FIX(0.368787494)); /* (c8+c12)/2 */ + + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS+1); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.001514908)); /* c3 */ + tmp2 = MULTIPLY(tmp10 + tmp12, FIX(0.881514751)); /* c5 */ + tmp3 = MULTIPLY(tmp10 + tmp13, FIX(0.710284161)) + /* c7 */ + MULTIPLY(tmp14 + tmp15, FIX(0.256335874)); /* c11 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(tmp10, FIX(1.530003162)) + /* c3+c5+c7-c1 */ + MULTIPLY(tmp14, FIX(0.241438564)); /* c9-c11 */ + tmp4 = MULTIPLY(tmp14 - tmp15, FIX(0.710284161)) - /* c7 */ + MULTIPLY(tmp11 + tmp12, FIX(0.256335874)); /* c11 */ + tmp5 = MULTIPLY(tmp11 + tmp13, - FIX(0.881514751)); /* -c5 */ + tmp1 += tmp4 + tmp5 + + MULTIPLY(tmp11, FIX(0.634110155)) - /* c5+c9+c11-c3 */ + MULTIPLY(tmp14, FIX(1.773594819)); /* c1+c7 */ + tmp6 = MULTIPLY(tmp12 + tmp13, - FIX(0.497774438)); /* -c9 */ + tmp2 += tmp4 + tmp6 - + MULTIPLY(tmp12, FIX(1.190715098)) + /* c1+c5-c9-c11 */ + MULTIPLY(tmp15, FIX(1.711799069)); /* c3+c7 */ + tmp3 += tmp5 + tmp6 + + MULTIPLY(tmp13, FIX(1.670519935)) - /* c3+c5+c9-c7 */ + MULTIPLY(tmp15, FIX(1.319646532)); /* c1+c11 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+1); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+1); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 14x14 sample block. + */ + +GLOBAL(void) +jpeg_fdct_14x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + DCTELEM workspace[8*6]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* cK represents sqrt(2) * cos(K*pi/28). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]); + tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]); + tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]); + + tmp10 = tmp0 + tmp6; + tmp14 = tmp0 - tmp6; + tmp11 = tmp1 + tmp5; + tmp15 = tmp1 - tmp5; + tmp12 = tmp2 + tmp4; + tmp16 = tmp2 - tmp4; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); + tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + (tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE); + tmp13 += tmp13; + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */ + MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */ + MULTIPLY(tmp12 - tmp13, FIX(0.881747734)), /* c8 */ + CONST_BITS); + + tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686)); /* c6 */ + + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590)) /* c2-c6 */ + + MULTIPLY(tmp16, FIX(0.613604268)), /* c10 */ + CONST_BITS); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954)) /* c6+c10 */ + - MULTIPLY(tmp16, FIX(1.378756276)), /* c2 */ + CONST_BITS); + + /* Odd part */ + + tmp10 = tmp1 + tmp2; + tmp11 = tmp5 - tmp4; + dataptr[7] = (DCTELEM) (tmp0 - tmp10 + tmp3 - tmp11 - tmp6); + tmp3 <<= CONST_BITS; + tmp10 = MULTIPLY(tmp10, - FIX(0.158341681)); /* -c13 */ + tmp11 = MULTIPLY(tmp11, FIX(1.405321284)); /* c1 */ + tmp10 += tmp11 - tmp3; + tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) + /* c5 */ + MULTIPLY(tmp4 + tmp6, FIX(0.752406978)); /* c9 */ + dataptr[5] = (DCTELEM) + DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */ + + MULTIPLY(tmp4, FIX(1.119999435)), /* c1+c11-c9 */ + CONST_BITS); + tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) + /* c3 */ + MULTIPLY(tmp5 - tmp6, FIX(0.467085129)); /* c11 */ + dataptr[3] = (DCTELEM) + DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */ + - MULTIPLY(tmp5, FIX(3.069855259)), /* c1+c5+c11 */ + CONST_BITS); + dataptr[1] = (DCTELEM) + DESCALE(tmp11 + tmp12 + tmp3 + tmp6 - + MULTIPLY(tmp0 + tmp6, FIX(1.126980169)), /* c3+c5-c1 */ + CONST_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 14) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/14)**2 = 16/49, which we partially + * fold into the constant multipliers and final shifting: + * cK now represents sqrt(2) * cos(K*pi/28) * 32/49. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3]; + tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1]; + tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0]; + tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7]; + + tmp10 = tmp0 + tmp6; + tmp14 = tmp0 - tmp6; + tmp11 = tmp1 + tmp5; + tmp15 = tmp1 - tmp5; + tmp12 = tmp2 + tmp4; + tmp16 = tmp2 - tmp4; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2]; + tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1]; + tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0]; + tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13, + FIX(0.653061224)), /* 32/49 */ + CONST_BITS+1); + tmp13 += tmp13; + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */ + MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */ + MULTIPLY(tmp12 - tmp13, FIX(0.575835255)), /* c8 */ + CONST_BITS+1); + + tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570)); /* c6 */ + + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691)) /* c2-c6 */ + + MULTIPLY(tmp16, FIX(0.400721155)), /* c10 */ + CONST_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725)) /* c6+c10 */ + - MULTIPLY(tmp16, FIX(0.900412262)), /* c2 */ + CONST_BITS+1); + + /* Odd part */ + + tmp10 = tmp1 + tmp2; + tmp11 = tmp5 - tmp4; + dataptr[DCTSIZE*7] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6, + FIX(0.653061224)), /* 32/49 */ + CONST_BITS+1); + tmp3 = MULTIPLY(tmp3 , FIX(0.653061224)); /* 32/49 */ + tmp10 = MULTIPLY(tmp10, - FIX(0.103406812)); /* -c13 */ + tmp11 = MULTIPLY(tmp11, FIX(0.917760839)); /* c1 */ + tmp10 += tmp11 - tmp3; + tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) + /* c5 */ + MULTIPLY(tmp4 + tmp6, FIX(0.491367823)); /* c9 */ + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */ + + MULTIPLY(tmp4, FIX(0.731428202)), /* c1+c11-c9 */ + CONST_BITS+1); + tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) + /* c3 */ + MULTIPLY(tmp5 - tmp6, FIX(0.305035186)); /* c11 */ + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */ + - MULTIPLY(tmp5, FIX(2.004803435)), /* c1+c5+c11 */ + CONST_BITS+1); + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp11 + tmp12 + tmp3 + - MULTIPLY(tmp0, FIX(0.735987049)) /* c3+c5-c1 */ + - MULTIPLY(tmp6, FIX(0.082925825)), /* c9-c11-c13 */ + CONST_BITS+1); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 15x15 sample block. + */ + +GLOBAL(void) +jpeg_fdct_15x15 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 z1, z2, z3; + DCTELEM workspace[8*7]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* cK represents sqrt(2) * cos(K*pi/30). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[14]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[13]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[12]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[11]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[10]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[9]); + tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[8]); + tmp7 = GETJSAMPLE(elemptr[7]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[14]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[13]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[12]); + tmp13 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[11]); + tmp14 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[10]); + tmp15 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[9]); + tmp16 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[8]); + + z1 = tmp0 + tmp4 + tmp5; + z2 = tmp1 + tmp3 + tmp6; + z3 = tmp2 + tmp7; + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) (z1 + z2 + z3 - 15 * CENTERJSAMPLE); + z3 += z3; + dataptr[6] = (DCTELEM) + DESCALE(MULTIPLY(z1 - z3, FIX(1.144122806)) - /* c6 */ + MULTIPLY(z2 - z3, FIX(0.437016024)), /* c12 */ + CONST_BITS); + tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7; + z1 = MULTIPLY(tmp3 - tmp2, FIX(1.531135173)) - /* c2+c14 */ + MULTIPLY(tmp6 - tmp2, FIX(2.238241955)); /* c4+c8 */ + z2 = MULTIPLY(tmp5 - tmp2, FIX(0.798468008)) - /* c8-c14 */ + MULTIPLY(tmp0 - tmp2, FIX(0.091361227)); /* c2-c4 */ + z3 = MULTIPLY(tmp0 - tmp3, FIX(1.383309603)) + /* c2 */ + MULTIPLY(tmp6 - tmp5, FIX(0.946293579)) + /* c8 */ + MULTIPLY(tmp1 - tmp4, FIX(0.790569415)); /* (c6+c12)/2 */ + + dataptr[2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS); + dataptr[4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS); + + /* Odd part */ + + tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16, + FIX(1.224744871)); /* c5 */ + tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.344997024)) + /* c3 */ + MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.831253876)); /* c9 */ + tmp12 = MULTIPLY(tmp12, FIX(1.224744871)); /* c5 */ + tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.406466353)) + /* c1 */ + MULTIPLY(tmp11 + tmp14, FIX(1.344997024)) + /* c3 */ + MULTIPLY(tmp13 + tmp15, FIX(0.575212477)); /* c11 */ + tmp0 = MULTIPLY(tmp13, FIX(0.475753014)) - /* c7-c11 */ + MULTIPLY(tmp14, FIX(0.513743148)) + /* c3-c9 */ + MULTIPLY(tmp16, FIX(1.700497885)) + tmp4 + tmp12; /* c1+c13 */ + tmp3 = MULTIPLY(tmp10, - FIX(0.355500862)) - /* -(c1-c7) */ + MULTIPLY(tmp11, FIX(2.176250899)) - /* c3+c9 */ + MULTIPLY(tmp15, FIX(0.869244010)) + tmp4 - tmp12; /* c11+c13 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp3, CONST_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 15) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/15)**2 = 64/225, which we partially + * fold into the constant multipliers and final shifting: + * cK now represents sqrt(2) * cos(K*pi/30) * 256/225. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*6]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*5]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*4]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*3]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*2]; + tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*1]; + tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*0]; + tmp7 = dataptr[DCTSIZE*7]; + + tmp10 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*6]; + tmp11 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*5]; + tmp12 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*4]; + tmp13 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*3]; + tmp14 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*2]; + tmp15 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*1]; + tmp16 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*0]; + + z1 = tmp0 + tmp4 + tmp5; + z2 = tmp1 + tmp3 + tmp6; + z3 = tmp2 + tmp7; + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(z1 + z2 + z3, FIX(1.137777778)), /* 256/225 */ + CONST_BITS+2); + z3 += z3; + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(MULTIPLY(z1 - z3, FIX(1.301757503)) - /* c6 */ + MULTIPLY(z2 - z3, FIX(0.497227121)), /* c12 */ + CONST_BITS+2); + tmp2 += ((tmp1 + tmp4) >> 1) - tmp7 - tmp7; + z1 = MULTIPLY(tmp3 - tmp2, FIX(1.742091575)) - /* c2+c14 */ + MULTIPLY(tmp6 - tmp2, FIX(2.546621957)); /* c4+c8 */ + z2 = MULTIPLY(tmp5 - tmp2, FIX(0.908479156)) - /* c8-c14 */ + MULTIPLY(tmp0 - tmp2, FIX(0.103948774)); /* c2-c4 */ + z3 = MULTIPLY(tmp0 - tmp3, FIX(1.573898926)) + /* c2 */ + MULTIPLY(tmp6 - tmp5, FIX(1.076671805)) + /* c8 */ + MULTIPLY(tmp1 - tmp4, FIX(0.899492312)); /* (c6+c12)/2 */ + + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z3, CONST_BITS+2); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z2 + z3, CONST_BITS+2); + + /* Odd part */ + + tmp2 = MULTIPLY(tmp10 - tmp12 - tmp13 + tmp15 + tmp16, + FIX(1.393487498)); /* c5 */ + tmp1 = MULTIPLY(tmp10 - tmp14 - tmp15, FIX(1.530307725)) + /* c3 */ + MULTIPLY(tmp11 - tmp13 - tmp16, FIX(0.945782187)); /* c9 */ + tmp12 = MULTIPLY(tmp12, FIX(1.393487498)); /* c5 */ + tmp4 = MULTIPLY(tmp10 - tmp16, FIX(1.600246161)) + /* c1 */ + MULTIPLY(tmp11 + tmp14, FIX(1.530307725)) + /* c3 */ + MULTIPLY(tmp13 + tmp15, FIX(0.654463974)); /* c11 */ + tmp0 = MULTIPLY(tmp13, FIX(0.541301207)) - /* c7-c11 */ + MULTIPLY(tmp14, FIX(0.584525538)) + /* c3-c9 */ + MULTIPLY(tmp16, FIX(1.934788705)) + tmp4 + tmp12; /* c1+c13 */ + tmp3 = MULTIPLY(tmp10, - FIX(0.404480980)) - /* -(c1-c7) */ + MULTIPLY(tmp11, FIX(2.476089912)) - /* c3+c9 */ + MULTIPLY(tmp15, FIX(0.989006518)) + tmp4 - tmp12; /* c11+c13 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+2); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+2); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+2); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3, CONST_BITS+2); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 16x16 sample block. + */ + +GLOBAL(void) +jpeg_fdct_16x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17; + DCTELEM workspace[DCTSIZE2]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* cK represents sqrt(2) * cos(K*pi/32). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]); + tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]); + tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]); + + tmp10 = tmp0 + tmp7; + tmp14 = tmp0 - tmp7; + tmp11 = tmp1 + tmp6; + tmp15 = tmp1 - tmp6; + tmp12 = tmp2 + tmp5; + tmp16 = tmp2 - tmp5; + tmp13 = tmp3 + tmp4; + tmp17 = tmp3 - tmp4; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]); + tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); + tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */ + MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */ + CONST_BITS-PASS1_BITS); + + tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */ + MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */ + + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */ + + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */ + - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */ + MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */ + MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */ + MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */ + tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */ + MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */ + tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */ + MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */ + tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */ + MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */ + MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */ + tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */ + - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */ + tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */ + + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */ + tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */ + + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == DCTSIZE * 2) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/16)**2 = 1/2**2. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3]; + tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2]; + tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1]; + tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0]; + + tmp10 = tmp0 + tmp7; + tmp14 = tmp0 - tmp7; + tmp11 = tmp1 + tmp6; + tmp15 = tmp1 - tmp6; + tmp12 = tmp2 + tmp5; + tmp16 = tmp2 - tmp5; + tmp13 = tmp3 + tmp4; + tmp17 = tmp3 - tmp4; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3]; + tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2]; + tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1]; + tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+2); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */ + MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */ + CONST_BITS+PASS1_BITS+2); + + tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */ + MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */ + + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */ + + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+10 */ + CONST_BITS+PASS1_BITS+2); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */ + - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */ + CONST_BITS+PASS1_BITS+2); + + /* Odd part */ + + tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */ + MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */ + MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */ + MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */ + tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */ + MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */ + tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */ + MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */ + tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */ + MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */ + MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */ + tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */ + - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */ + tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */ + + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */ + tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */ + + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+2); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+2); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+2); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+2); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 16x8 sample block. + * + * 16-point FDCT in pass 1 (rows), 8-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_16x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17; + INT32 z1; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32). */ + + dataptr = data; + ctr = 0; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[15]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[14]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[13]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[12]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[11]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[10]); + tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[9]); + tmp7 = GETJSAMPLE(elemptr[7]) + GETJSAMPLE(elemptr[8]); + + tmp10 = tmp0 + tmp7; + tmp14 = tmp0 - tmp7; + tmp11 = tmp1 + tmp6; + tmp15 = tmp1 - tmp6; + tmp12 = tmp2 + tmp5; + tmp16 = tmp2 - tmp5; + tmp13 = tmp3 + tmp4; + tmp17 = tmp3 - tmp4; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[15]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[14]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[13]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[12]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[11]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[10]); + tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[9]); + tmp7 = GETJSAMPLE(elemptr[7]) - GETJSAMPLE(elemptr[8]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 + tmp13 - 16 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */ + MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */ + CONST_BITS-PASS1_BITS); + + tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */ + MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */ + + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */ + + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */ + - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */ + MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */ + MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */ + MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */ + tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */ + MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */ + tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */ + MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */ + tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */ + MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */ + MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */ + tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */ + - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */ + tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */ + + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */ + tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */ + + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by 8/16 = 1/2. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + + tmp10 = tmp0 + tmp3; + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS+1); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS+1); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), + CONST_BITS+PASS1_BITS+1); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12, + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13, + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12, + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13, + CONST_BITS+PASS1_BITS+1); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 14x7 sample block. + * + * 14-point FDCT in pass 1 (rows), 7-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_14x7 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 z1, z2, z3; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Zero bottom row of output coefficient block. */ + MEMZERO(&data[DCTSIZE*7], SIZEOF(DCTELEM) * DCTSIZE); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28). */ + + dataptr = data; + for (ctr = 0; ctr < 7; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[13]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[12]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[11]); + tmp13 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[10]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[9]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[8]); + tmp6 = GETJSAMPLE(elemptr[6]) + GETJSAMPLE(elemptr[7]); + + tmp10 = tmp0 + tmp6; + tmp14 = tmp0 - tmp6; + tmp11 = tmp1 + tmp5; + tmp15 = tmp1 - tmp5; + tmp12 = tmp2 + tmp4; + tmp16 = tmp2 - tmp4; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[13]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[12]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[11]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[10]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[9]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[8]); + tmp6 = GETJSAMPLE(elemptr[6]) - GETJSAMPLE(elemptr[7]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 + tmp13 - 14 * CENTERJSAMPLE) << PASS1_BITS); + tmp13 += tmp13; + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.274162392)) + /* c4 */ + MULTIPLY(tmp11 - tmp13, FIX(0.314692123)) - /* c12 */ + MULTIPLY(tmp12 - tmp13, FIX(0.881747734)), /* c8 */ + CONST_BITS-PASS1_BITS); + + tmp10 = MULTIPLY(tmp14 + tmp15, FIX(1.105676686)); /* c6 */ + + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.273079590)) /* c2-c6 */ + + MULTIPLY(tmp16, FIX(0.613604268)), /* c10 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.719280954)) /* c6+c10 */ + - MULTIPLY(tmp16, FIX(1.378756276)), /* c2 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = tmp1 + tmp2; + tmp11 = tmp5 - tmp4; + dataptr[7] = (DCTELEM) ((tmp0 - tmp10 + tmp3 - tmp11 - tmp6) << PASS1_BITS); + tmp3 <<= CONST_BITS; + tmp10 = MULTIPLY(tmp10, - FIX(0.158341681)); /* -c13 */ + tmp11 = MULTIPLY(tmp11, FIX(1.405321284)); /* c1 */ + tmp10 += tmp11 - tmp3; + tmp11 = MULTIPLY(tmp0 + tmp2, FIX(1.197448846)) + /* c5 */ + MULTIPLY(tmp4 + tmp6, FIX(0.752406978)); /* c9 */ + dataptr[5] = (DCTELEM) + DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(2.373959773)) /* c3+c5-c13 */ + + MULTIPLY(tmp4, FIX(1.119999435)), /* c1+c11-c9 */ + CONST_BITS-PASS1_BITS); + tmp12 = MULTIPLY(tmp0 + tmp1, FIX(1.334852607)) + /* c3 */ + MULTIPLY(tmp5 - tmp6, FIX(0.467085129)); /* c11 */ + dataptr[3] = (DCTELEM) + DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.424103948)) /* c3-c9-c13 */ + - MULTIPLY(tmp5, FIX(3.069855259)), /* c1+c5+c11 */ + CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) + DESCALE(tmp11 + tmp12 + tmp3 + tmp6 - + MULTIPLY(tmp0 + tmp6, FIX(1.126980169)), /* c3+c5-c1 */ + CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/14)*(8/7) = 32/49, which we + * partially fold into the constant multipliers and final shifting: + * 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14) * 64/49. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*6]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*5]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*4]; + tmp3 = dataptr[DCTSIZE*3]; + + tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*6]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*5]; + tmp12 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*4]; + + z1 = tmp0 + tmp2; + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(z1 + tmp1 + tmp3, FIX(1.306122449)), /* 64/49 */ + CONST_BITS+PASS1_BITS+1); + tmp3 += tmp3; + z1 -= tmp3; + z1 -= tmp3; + z1 = MULTIPLY(z1, FIX(0.461784020)); /* (c2+c6-c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp2, FIX(1.202428084)); /* (c2+c4-c6)/2 */ + z3 = MULTIPLY(tmp1 - tmp2, FIX(0.411026446)); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS+PASS1_BITS+1); + z1 -= z2; + z2 = MULTIPLY(tmp0 - tmp1, FIX(1.151670509)); /* c4 */ + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.923568041)), /* c2+c6-c4 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+PASS1_BITS+1); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(1.221765677)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.222383464)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.800824523)); /* -c1 */ + tmp1 += tmp2; + tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.801442310)); /* c5 */ + tmp0 += tmp3; + tmp2 += tmp3 + MULTIPLY(tmp12, FIX(2.443531355)); /* c3+c1-c5 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp0, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp1, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp2, CONST_BITS+PASS1_BITS+1); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 12x6 sample block. + * + * 12-point FDCT in pass 1 (rows), 6-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_12x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Zero 2 bottom rows of output coefficient block. */ + MEMZERO(&data[DCTSIZE*6], SIZEOF(DCTELEM) * DCTSIZE * 2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24). */ + + dataptr = data; + for (ctr = 0; ctr < 6; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[11]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[10]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[9]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[8]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[7]); + tmp5 = GETJSAMPLE(elemptr[5]) + GETJSAMPLE(elemptr[6]); + + tmp10 = tmp0 + tmp5; + tmp13 = tmp0 - tmp5; + tmp11 = tmp1 + tmp4; + tmp14 = tmp1 - tmp4; + tmp12 = tmp2 + tmp3; + tmp15 = tmp2 - tmp3; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[11]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[10]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[9]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[8]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[7]); + tmp5 = GETJSAMPLE(elemptr[5]) - GETJSAMPLE(elemptr[6]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 - 12 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[6] = (DCTELEM) ((tmp13 - tmp14 - tmp15) << PASS1_BITS); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.224744871)), /* c4 */ + CONST_BITS-PASS1_BITS); + dataptr[2] = (DCTELEM) + DESCALE(tmp14 - tmp15 + MULTIPLY(tmp13 + tmp15, FIX(1.366025404)), /* c2 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp1 + tmp4, FIX_0_541196100); /* c9 */ + tmp14 = tmp10 + MULTIPLY(tmp1, FIX_0_765366865); /* c3-c9 */ + tmp15 = tmp10 - MULTIPLY(tmp4, FIX_1_847759065); /* c3+c9 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.121971054)); /* c5 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.860918669)); /* c7 */ + tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.580774953)) /* c5+c7-c1 */ + + MULTIPLY(tmp5, FIX(0.184591911)); /* c11 */ + tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.184591911)); /* -c11 */ + tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.339493912)) /* c1+c5-c11 */ + + MULTIPLY(tmp5, FIX(0.860918669)); /* c7 */ + tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.725788011)) /* c1+c11-c7 */ + - MULTIPLY(tmp5, FIX(1.121971054)); /* c5 */ + tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.306562965)) /* c3 */ + - MULTIPLY(tmp2 + tmp5, FIX_0_541196100); /* c9 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/12)*(8/6) = 8/9, which we + * partially fold into the constant multipliers and final shifting: + * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5]; + tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3]; + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */ + CONST_BITS+PASS1_BITS+1); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS+1); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 10x5 sample block. + * + * 10-point FDCT in pass 1 (rows), 5-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_10x5 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Zero 3 bottom rows of output coefficient block. */ + MEMZERO(&data[DCTSIZE*5], SIZEOF(DCTELEM) * DCTSIZE * 3); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20). */ + + dataptr = data; + for (ctr = 0; ctr < 5; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[9]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[8]); + tmp12 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[7]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[6]); + tmp4 = GETJSAMPLE(elemptr[4]) + GETJSAMPLE(elemptr[5]); + + tmp10 = tmp0 + tmp4; + tmp13 = tmp0 - tmp4; + tmp11 = tmp1 + tmp3; + tmp14 = tmp1 - tmp3; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[9]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[8]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[7]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[6]); + tmp4 = GETJSAMPLE(elemptr[4]) - GETJSAMPLE(elemptr[5]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 + tmp12 - 10 * CENTERJSAMPLE) << PASS1_BITS); + tmp12 += tmp12; + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.144122806)) - /* c4 */ + MULTIPLY(tmp11 - tmp12, FIX(0.437016024)), /* c8 */ + CONST_BITS-PASS1_BITS); + tmp10 = MULTIPLY(tmp13 + tmp14, FIX(0.831253876)); /* c6 */ + dataptr[2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.513743148)), /* c2-c6 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.176250899)), /* c2+c6 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = tmp0 + tmp4; + tmp11 = tmp1 - tmp3; + dataptr[5] = (DCTELEM) ((tmp10 - tmp11 - tmp2) << PASS1_BITS); + tmp2 <<= CONST_BITS; + dataptr[1] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.396802247)) + /* c1 */ + MULTIPLY(tmp1, FIX(1.260073511)) + tmp2 + /* c3 */ + MULTIPLY(tmp3, FIX(0.642039522)) + /* c7 */ + MULTIPLY(tmp4, FIX(0.221231742)), /* c9 */ + CONST_BITS-PASS1_BITS); + tmp12 = MULTIPLY(tmp0 - tmp4, FIX(0.951056516)) - /* (c3+c7)/2 */ + MULTIPLY(tmp1 + tmp3, FIX(0.587785252)); /* (c1-c9)/2 */ + tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.309016994)) + /* (c3-c7)/2 */ + (tmp11 << (CONST_BITS - 1)) - tmp2; + dataptr[3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/10)*(8/5) = 32/25, which we + * fold into the constant multipliers: + * 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10) * 32/25. + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*4]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*3]; + tmp2 = dataptr[DCTSIZE*2]; + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*4]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*3]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp2, FIX(1.28)), /* 32/25 */ + CONST_BITS+PASS1_BITS); + tmp11 = MULTIPLY(tmp11, FIX(1.011928851)); /* (c2+c4)/2 */ + tmp10 -= tmp2 << 2; + tmp10 = MULTIPLY(tmp10, FIX(0.452548340)); /* (c2-c4)/2 */ + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp1, FIX(1.064004961)); /* c3 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.657591230)), /* c1-c3 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.785601151)), /* c1+c3 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on an 8x4 sample block. + * + * 8-point FDCT in pass 1 (rows), 4-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_8x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Zero 4 bottom rows of output coefficient block. */ + MEMZERO(&data[DCTSIZE*4], SIZEOF(DCTELEM) * DCTSIZE * 4); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We must also scale the output by 8/4 = 2, which we add here. */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]); + + tmp10 = tmp0 + tmp3; + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << (PASS1_BITS+1)); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << (PASS1_BITS+1)); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-2); + dataptr[2] = (DCTELEM) RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), + CONST_BITS-PASS1_BITS-1); + dataptr[6] = (DCTELEM) RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), + CONST_BITS-PASS1_BITS-1); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-2); + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS-1); + dataptr[3] = (DCTELEM) + RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS-1); + dataptr[5] = (DCTELEM) + RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS-1); + dataptr[7] = (DCTELEM) + RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS-1); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ + + dataptr = data; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3] + (ONE << (PASS1_BITS-1)); + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2]; + + tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2]; + + dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS+PASS1_BITS-1); + + dataptr[DCTSIZE*1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 6x3 sample block. + * + * 6-point FDCT in pass 1 (rows), 3-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_6x3 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2; + INT32 tmp10, tmp11, tmp12; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + + dataptr = data; + for (ctr = 0; ctr < 3; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]); + tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << (PASS1_BITS+1)); + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */ + CONST_BITS-PASS1_BITS-1); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */ + CONST_BITS-PASS1_BITS-1); + + /* Odd part */ + + tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */ + CONST_BITS-PASS1_BITS-1); + + dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << (PASS1_BITS+1))); + dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << (PASS1_BITS+1)); + dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << (PASS1_BITS+1))); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially + * fold into the constant multipliers (other part was done in pass 1): + * 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6) * 16/9. + */ + + dataptr = data; + for (ctr = 0; ctr < 6; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*2]; + tmp1 = dataptr[DCTSIZE*1]; + + tmp2 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*2]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(1.257078722)), /* c2 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(MULTIPLY(tmp2, FIX(2.177324216)), /* c1 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 4x2 sample block. + * + * 4-point FDCT in pass 1 (rows), 2-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_4x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1; + INT32 tmp10, tmp11; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We must also scale the output by (8/4)*(8/2) = 2**3, which we add here. */ + /* 4-point FDCT kernel, */ + /* cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. */ + + dataptr = data; + for (ctr = 0; ctr < 2; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+3)); + dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+3)); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-4); + + dataptr[1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS-3); + dataptr[3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS-3); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = dataptr[DCTSIZE*0] + (ONE << (PASS1_BITS-1)); + tmp1 = dataptr[DCTSIZE*1]; + + dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp0 + tmp1, PASS1_BITS); + + /* Odd part */ + + dataptr[DCTSIZE*1] = (DCTELEM) RIGHT_SHIFT(tmp0 - tmp1, PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 2x1 sample block. + * + * 2-point FDCT in pass 1 (rows), 1-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_2x1 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1; + JSAMPROW elemptr; + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + elemptr = sample_data[0] + start_col; + + tmp0 = GETJSAMPLE(elemptr[0]); + tmp1 = GETJSAMPLE(elemptr[1]); + + /* We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/2)*(8/1) = 2**5. + */ + + /* Even part */ + /* Apply unsigned->signed conversion */ + data[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); + + /* Odd part */ + data[1] = (DCTELEM) ((tmp0 - tmp1) << 5); +} + + +/* + * Perform the forward DCT on an 8x16 sample block. + * + * 8-point FDCT in pass 1 (rows), 16-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_8x16 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16, tmp17; + INT32 z1; + DCTELEM workspace[DCTSIZE2]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) + GETJSAMPLE(elemptr[4]); + + tmp10 = tmp0 + tmp3; + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[7]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[6]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[5]); + tmp3 = GETJSAMPLE(elemptr[3]) - GETJSAMPLE(elemptr[4]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) ((tmp10 + tmp11 - 8 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, FIX_0_765366865), + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 - MULTIPLY(tmp13, FIX_1_847759065), + CONST_BITS-PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[1] = (DCTELEM) DESCALE(tmp0 + tmp10 + tmp12, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1 + tmp11 + tmp13, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2 + tmp11 + tmp12, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp3 + tmp10 + tmp13, CONST_BITS-PASS1_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == DCTSIZE * 2) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by 8/16 = 1/2. + * 16-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/32). + */ + + dataptr = data; + wsptr = workspace; + for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*3]; + tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*2]; + tmp6 = dataptr[DCTSIZE*6] + wsptr[DCTSIZE*1]; + tmp7 = dataptr[DCTSIZE*7] + wsptr[DCTSIZE*0]; + + tmp10 = tmp0 + tmp7; + tmp14 = tmp0 - tmp7; + tmp11 = tmp1 + tmp6; + tmp15 = tmp1 - tmp6; + tmp12 = tmp2 + tmp5; + tmp16 = tmp2 - tmp5; + tmp13 = tmp3 + tmp4; + tmp17 = tmp3 - tmp4; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*4]; + tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*3]; + tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*2]; + tmp6 = dataptr[DCTSIZE*6] - wsptr[DCTSIZE*1]; + tmp7 = dataptr[DCTSIZE*7] - wsptr[DCTSIZE*0]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(tmp10 + tmp11 + tmp12 + tmp13, PASS1_BITS+1); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(1.306562965)) + /* c4[16] = c2[8] */ + MULTIPLY(tmp11 - tmp12, FIX_0_541196100), /* c12[16] = c6[8] */ + CONST_BITS+PASS1_BITS+1); + + tmp10 = MULTIPLY(tmp17 - tmp15, FIX(0.275899379)) + /* c14[16] = c7[8] */ + MULTIPLY(tmp14 - tmp16, FIX(1.387039845)); /* c2[16] = c1[8] */ + + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp15, FIX(1.451774982)) /* c6+c14 */ + + MULTIPLY(tmp16, FIX(2.172734804)), /* c2+c10 */ + CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(0.211164243)) /* c2-c6 */ + - MULTIPLY(tmp17, FIX(1.061594338)), /* c10+c14 */ + CONST_BITS+PASS1_BITS+1); + + /* Odd part */ + + tmp11 = MULTIPLY(tmp0 + tmp1, FIX(1.353318001)) + /* c3 */ + MULTIPLY(tmp6 - tmp7, FIX(0.410524528)); /* c13 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(1.247225013)) + /* c5 */ + MULTIPLY(tmp5 + tmp7, FIX(0.666655658)); /* c11 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(1.093201867)) + /* c7 */ + MULTIPLY(tmp4 - tmp7, FIX(0.897167586)); /* c9 */ + tmp14 = MULTIPLY(tmp1 + tmp2, FIX(0.138617169)) + /* c15 */ + MULTIPLY(tmp6 - tmp5, FIX(1.407403738)); /* c1 */ + tmp15 = MULTIPLY(tmp1 + tmp3, - FIX(0.666655658)) + /* -c11 */ + MULTIPLY(tmp4 + tmp6, - FIX(1.247225013)); /* -c5 */ + tmp16 = MULTIPLY(tmp2 + tmp3, - FIX(1.353318001)) + /* -c3 */ + MULTIPLY(tmp5 - tmp4, FIX(0.410524528)); /* c13 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(tmp0, FIX(2.286341144)) + /* c7+c5+c3-c1 */ + MULTIPLY(tmp7, FIX(0.779653625)); /* c15+c13-c11+c9 */ + tmp11 += tmp14 + tmp15 + MULTIPLY(tmp1, FIX(0.071888074)) /* c9-c3-c15+c11 */ + - MULTIPLY(tmp6, FIX(1.663905119)); /* c7+c13+c1-c5 */ + tmp12 += tmp14 + tmp16 - MULTIPLY(tmp2, FIX(1.125726048)) /* c7+c5+c15-c3 */ + + MULTIPLY(tmp5, FIX(1.227391138)); /* c9-c11+c1-c13 */ + tmp13 += tmp15 + tmp16 + MULTIPLY(tmp3, FIX(1.065388962)) /* c15+c3+c11-c7 */ + + MULTIPLY(tmp4, FIX(2.167985692)); /* c1+c13+c5-c9 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS+1); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS+1); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 7x14 sample block. + * + * 7-point FDCT in pass 1 (rows), 14-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_7x14 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 z1, z2, z3; + DCTELEM workspace[8*6]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 7-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/14). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[6]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[5]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[4]); + tmp3 = GETJSAMPLE(elemptr[3]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[6]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[5]); + tmp12 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[4]); + + z1 = tmp0 + tmp2; + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((z1 + tmp1 + tmp3 - 7 * CENTERJSAMPLE) << PASS1_BITS); + tmp3 += tmp3; + z1 -= tmp3; + z1 -= tmp3; + z1 = MULTIPLY(z1, FIX(0.353553391)); /* (c2+c6-c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp2, FIX(0.920609002)); /* (c2+c4-c6)/2 */ + z3 = MULTIPLY(tmp1 - tmp2, FIX(0.314692123)); /* c6 */ + dataptr[2] = (DCTELEM) DESCALE(z1 + z2 + z3, CONST_BITS-PASS1_BITS); + z1 -= z2; + z2 = MULTIPLY(tmp0 - tmp1, FIX(0.881747734)); /* c4 */ + dataptr[4] = (DCTELEM) + DESCALE(z2 + z3 - MULTIPLY(tmp1 - tmp3, FIX(0.707106781)), /* c2+c6-c4 */ + CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp1 = MULTIPLY(tmp10 + tmp11, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(tmp10 - tmp11, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(tmp11 + tmp12, - FIX(1.378756276)); /* -c1 */ + tmp1 += tmp2; + tmp3 = MULTIPLY(tmp10 + tmp12, FIX(0.613604268)); /* c5 */ + tmp0 += tmp3; + tmp2 += tmp3 + MULTIPLY(tmp12, FIX(1.870828693)); /* c3+c1-c5 */ + + dataptr[1] = (DCTELEM) DESCALE(tmp0, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp2, CONST_BITS-PASS1_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 14) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/7)*(8/14) = 32/49, which we + * fold into the constant multipliers: + * 14-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/28) * 32/49. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = 0; ctr < 7; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*3]; + tmp13 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*2]; + tmp4 = dataptr[DCTSIZE*4] + wsptr[DCTSIZE*1]; + tmp5 = dataptr[DCTSIZE*5] + wsptr[DCTSIZE*0]; + tmp6 = dataptr[DCTSIZE*6] + dataptr[DCTSIZE*7]; + + tmp10 = tmp0 + tmp6; + tmp14 = tmp0 - tmp6; + tmp11 = tmp1 + tmp5; + tmp15 = tmp1 - tmp5; + tmp12 = tmp2 + tmp4; + tmp16 = tmp2 - tmp4; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*3]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*2]; + tmp4 = dataptr[DCTSIZE*4] - wsptr[DCTSIZE*1]; + tmp5 = dataptr[DCTSIZE*5] - wsptr[DCTSIZE*0]; + tmp6 = dataptr[DCTSIZE*6] - dataptr[DCTSIZE*7]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12 + tmp13, + FIX(0.653061224)), /* 32/49 */ + CONST_BITS+PASS1_BITS); + tmp13 += tmp13; + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp13, FIX(0.832106052)) + /* c4 */ + MULTIPLY(tmp11 - tmp13, FIX(0.205513223)) - /* c12 */ + MULTIPLY(tmp12 - tmp13, FIX(0.575835255)), /* c8 */ + CONST_BITS+PASS1_BITS); + + tmp10 = MULTIPLY(tmp14 + tmp15, FIX(0.722074570)); /* c6 */ + + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp14, FIX(0.178337691)) /* c2-c6 */ + + MULTIPLY(tmp16, FIX(0.400721155)), /* c10 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp15, FIX(1.122795725)) /* c6+c10 */ + - MULTIPLY(tmp16, FIX(0.900412262)), /* c2 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = tmp1 + tmp2; + tmp11 = tmp5 - tmp4; + dataptr[DCTSIZE*7] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp10 + tmp3 - tmp11 - tmp6, + FIX(0.653061224)), /* 32/49 */ + CONST_BITS+PASS1_BITS); + tmp3 = MULTIPLY(tmp3 , FIX(0.653061224)); /* 32/49 */ + tmp10 = MULTIPLY(tmp10, - FIX(0.103406812)); /* -c13 */ + tmp11 = MULTIPLY(tmp11, FIX(0.917760839)); /* c1 */ + tmp10 += tmp11 - tmp3; + tmp11 = MULTIPLY(tmp0 + tmp2, FIX(0.782007410)) + /* c5 */ + MULTIPLY(tmp4 + tmp6, FIX(0.491367823)); /* c9 */ + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp10 + tmp11 - MULTIPLY(tmp2, FIX(1.550341076)) /* c3+c5-c13 */ + + MULTIPLY(tmp4, FIX(0.731428202)), /* c1+c11-c9 */ + CONST_BITS+PASS1_BITS); + tmp12 = MULTIPLY(tmp0 + tmp1, FIX(0.871740478)) + /* c3 */ + MULTIPLY(tmp5 - tmp6, FIX(0.305035186)); /* c11 */ + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(tmp10 + tmp12 - MULTIPLY(tmp1, FIX(0.276965844)) /* c3-c9-c13 */ + - MULTIPLY(tmp5, FIX(2.004803435)), /* c1+c5+c11 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp11 + tmp12 + tmp3 + - MULTIPLY(tmp0, FIX(0.735987049)) /* c3+c5-c1 */ + - MULTIPLY(tmp6, FIX(0.082925825)), /* c9-c11-c13 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 6x12 sample block. + * + * 6-point FDCT in pass 1 (rows), 12-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_6x12 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + DCTELEM workspace[8*4]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[5]); + tmp11 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) + GETJSAMPLE(elemptr[3]); + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[5]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[4]); + tmp2 = GETJSAMPLE(elemptr[2]) - GETJSAMPLE(elemptr[3]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp11 - 6 * CENTERJSAMPLE) << PASS1_BITS); + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(1.224744871)), /* c2 */ + CONST_BITS-PASS1_BITS); + dataptr[4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(0.707106781)), /* c4 */ + CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = DESCALE(MULTIPLY(tmp0 + tmp2, FIX(0.366025404)), /* c5 */ + CONST_BITS-PASS1_BITS); + + dataptr[1] = (DCTELEM) (tmp10 + ((tmp0 + tmp1) << PASS1_BITS)); + dataptr[3] = (DCTELEM) ((tmp0 - tmp1 - tmp2) << PASS1_BITS); + dataptr[5] = (DCTELEM) (tmp10 + ((tmp2 - tmp1) << PASS1_BITS)); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 12) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/6)*(8/12) = 8/9, which we + * fold into the constant multipliers: + * 12-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/24) * 8/9. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*3]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*2]; + tmp2 = dataptr[DCTSIZE*2] + wsptr[DCTSIZE*1]; + tmp3 = dataptr[DCTSIZE*3] + wsptr[DCTSIZE*0]; + tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*7]; + tmp5 = dataptr[DCTSIZE*5] + dataptr[DCTSIZE*6]; + + tmp10 = tmp0 + tmp5; + tmp13 = tmp0 - tmp5; + tmp11 = tmp1 + tmp4; + tmp14 = tmp1 - tmp4; + tmp12 = tmp2 + tmp3; + tmp15 = tmp2 - tmp3; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*3]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*2]; + tmp2 = dataptr[DCTSIZE*2] - wsptr[DCTSIZE*1]; + tmp3 = dataptr[DCTSIZE*3] - wsptr[DCTSIZE*0]; + tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*7]; + tmp5 = dataptr[DCTSIZE*5] - dataptr[DCTSIZE*6]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(0.888888889)), /* 8/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(MULTIPLY(tmp13 - tmp14 - tmp15, FIX(0.888888889)), /* 8/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.088662108)), /* c4 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp14 - tmp15, FIX(0.888888889)) + /* 8/9 */ + MULTIPLY(tmp13 + tmp15, FIX(1.214244803)), /* c2 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp1 + tmp4, FIX(0.481063200)); /* c9 */ + tmp14 = tmp10 + MULTIPLY(tmp1, FIX(0.680326102)); /* c3-c9 */ + tmp15 = tmp10 - MULTIPLY(tmp4, FIX(1.642452502)); /* c3+c9 */ + tmp12 = MULTIPLY(tmp0 + tmp2, FIX(0.997307603)); /* c5 */ + tmp13 = MULTIPLY(tmp0 + tmp3, FIX(0.765261039)); /* c7 */ + tmp10 = tmp12 + tmp13 + tmp14 - MULTIPLY(tmp0, FIX(0.516244403)) /* c5+c7-c1 */ + + MULTIPLY(tmp5, FIX(0.164081699)); /* c11 */ + tmp11 = MULTIPLY(tmp2 + tmp3, - FIX(0.164081699)); /* -c11 */ + tmp12 += tmp11 - tmp15 - MULTIPLY(tmp2, FIX(2.079550144)) /* c1+c5-c11 */ + + MULTIPLY(tmp5, FIX(0.765261039)); /* c7 */ + tmp13 += tmp11 - tmp14 + MULTIPLY(tmp3, FIX(0.645144899)) /* c1+c11-c7 */ + - MULTIPLY(tmp5, FIX(0.997307603)); /* c5 */ + tmp11 = tmp15 + MULTIPLY(tmp0 - tmp3, FIX(1.161389302)) /* c3 */ + - MULTIPLY(tmp2 + tmp5, FIX(0.481063200)); /* c9 */ + + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp10, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp11, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp13, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 5x10 sample block. + * + * 5-point FDCT in pass 1 (rows), 10-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_5x10 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4; + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + DCTELEM workspace[8*2]; + DCTELEM *dataptr; + DCTELEM *wsptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* 5-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/10). */ + + dataptr = data; + ctr = 0; + for (;;) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[4]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[3]); + tmp2 = GETJSAMPLE(elemptr[2]); + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + + tmp0 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[4]); + tmp1 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[3]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp10 + tmp2 - 5 * CENTERJSAMPLE) << PASS1_BITS); + tmp11 = MULTIPLY(tmp11, FIX(0.790569415)); /* (c2+c4)/2 */ + tmp10 -= tmp2 << 2; + tmp10 = MULTIPLY(tmp10, FIX(0.353553391)); /* (c2-c4)/2 */ + dataptr[2] = (DCTELEM) DESCALE(tmp11 + tmp10, CONST_BITS-PASS1_BITS); + dataptr[4] = (DCTELEM) DESCALE(tmp11 - tmp10, CONST_BITS-PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp1, FIX(0.831253876)); /* c3 */ + + dataptr[1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0, FIX(0.513743148)), /* c1-c3 */ + CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp1, FIX(2.176250899)), /* c1+c3 */ + CONST_BITS-PASS1_BITS); + + ctr++; + + if (ctr != DCTSIZE) { + if (ctr == 10) + break; /* Done. */ + dataptr += DCTSIZE; /* advance pointer to next row */ + } else + dataptr = workspace; /* switch pointer to extended workspace */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/5)*(8/10) = 32/25, which we + * fold into the constant multipliers: + * 10-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/20) * 32/25. + */ + + dataptr = data; + wsptr = workspace; + for (ctr = 0; ctr < 5; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + wsptr[DCTSIZE*1]; + tmp1 = dataptr[DCTSIZE*1] + wsptr[DCTSIZE*0]; + tmp12 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*7]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*6]; + tmp4 = dataptr[DCTSIZE*4] + dataptr[DCTSIZE*5]; + + tmp10 = tmp0 + tmp4; + tmp13 = tmp0 - tmp4; + tmp11 = tmp1 + tmp3; + tmp14 = tmp1 - tmp3; + + tmp0 = dataptr[DCTSIZE*0] - wsptr[DCTSIZE*1]; + tmp1 = dataptr[DCTSIZE*1] - wsptr[DCTSIZE*0]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*7]; + tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*6]; + tmp4 = dataptr[DCTSIZE*4] - dataptr[DCTSIZE*5]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11 + tmp12, FIX(1.28)), /* 32/25 */ + CONST_BITS+PASS1_BITS); + tmp12 += tmp12; + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp12, FIX(1.464477191)) - /* c4 */ + MULTIPLY(tmp11 - tmp12, FIX(0.559380511)), /* c8 */ + CONST_BITS+PASS1_BITS); + tmp10 = MULTIPLY(tmp13 + tmp14, FIX(1.064004961)); /* c6 */ + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp13, FIX(0.657591230)), /* c2-c6 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) + DESCALE(tmp10 - MULTIPLY(tmp14, FIX(2.785601151)), /* c2+c6 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = tmp0 + tmp4; + tmp11 = tmp1 - tmp3; + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp2, FIX(1.28)), /* 32/25 */ + CONST_BITS+PASS1_BITS); + tmp2 = MULTIPLY(tmp2, FIX(1.28)); /* 32/25 */ + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(MULTIPLY(tmp0, FIX(1.787906876)) + /* c1 */ + MULTIPLY(tmp1, FIX(1.612894094)) + tmp2 + /* c3 */ + MULTIPLY(tmp3, FIX(0.821810588)) + /* c7 */ + MULTIPLY(tmp4, FIX(0.283176630)), /* c9 */ + CONST_BITS+PASS1_BITS); + tmp12 = MULTIPLY(tmp0 - tmp4, FIX(1.217352341)) - /* (c3+c7)/2 */ + MULTIPLY(tmp1 + tmp3, FIX(0.752365123)); /* (c1-c9)/2 */ + tmp13 = MULTIPLY(tmp10 + tmp11, FIX(0.395541753)) + /* (c3-c7)/2 */ + MULTIPLY(tmp11, FIX(0.64)) - tmp2; /* 16/25 */ + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp12 + tmp13, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp12 - tmp13, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + wsptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 4x8 sample block. + * + * 4-point FDCT in pass 1 (rows), 8-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_4x8 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We must also scale the output by 8/4 = 2, which we add here. */ + /* 4-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). */ + + dataptr = data; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[3]); + tmp1 = GETJSAMPLE(elemptr[1]) + GETJSAMPLE(elemptr[2]); + + tmp10 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[3]); + tmp11 = GETJSAMPLE(elemptr[1]) - GETJSAMPLE(elemptr[2]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 - 4 * CENTERJSAMPLE) << (PASS1_BITS+1)); + dataptr[2] = (DCTELEM) ((tmp0 - tmp1) << (PASS1_BITS+1)); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-2); + + dataptr[1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS-1); + dataptr[3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS-1); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + /* Even part per LL&M figure 1 --- note that published figure is faulty; + * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". + */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; + + /* Add fudge factor here for final descale. */ + tmp10 = tmp0 + tmp3 + (ONE << (PASS1_BITS-1)); + tmp12 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp13 = tmp1 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; + tmp3 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; + + dataptr[DCTSIZE*0] = (DCTELEM) RIGHT_SHIFT(tmp10 + tmp11, PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) RIGHT_SHIFT(tmp10 - tmp11, PASS1_BITS); + + z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS+PASS1_BITS-1); + dataptr[DCTSIZE*2] = (DCTELEM) + RIGHT_SHIFT(z1 + MULTIPLY(tmp12, FIX_0_765366865), CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*6] = (DCTELEM) + RIGHT_SHIFT(z1 - MULTIPLY(tmp13, FIX_1_847759065), CONST_BITS+PASS1_BITS); + + /* Odd part per figure 8 --- note paper omits factor of sqrt(2). + * 8-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + * i0..i3 in the paper are tmp0..tmp3 here. + */ + + tmp10 = tmp0 + tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp0 + tmp2; + tmp13 = tmp1 + tmp3; + z1 = MULTIPLY(tmp12 + tmp13, FIX_1_175875602); /* c3 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS+PASS1_BITS-1); + + tmp0 = MULTIPLY(tmp0, FIX_1_501321110); /* c1+c3-c5-c7 */ + tmp1 = MULTIPLY(tmp1, FIX_3_072711026); /* c1+c3+c5-c7 */ + tmp2 = MULTIPLY(tmp2, FIX_2_053119869); /* c1+c3-c5+c7 */ + tmp3 = MULTIPLY(tmp3, FIX_0_298631336); /* -c1+c3+c5-c7 */ + tmp10 = MULTIPLY(tmp10, - FIX_0_899976223); /* c7-c3 */ + tmp11 = MULTIPLY(tmp11, - FIX_2_562915447); /* -c1-c3 */ + tmp12 = MULTIPLY(tmp12, - FIX_0_390180644); /* c5-c3 */ + tmp13 = MULTIPLY(tmp13, - FIX_1_961570560); /* -c3-c5 */ + + tmp12 += z1; + tmp13 += z1; + + dataptr[DCTSIZE*1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + tmp10 + tmp12, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + RIGHT_SHIFT(tmp1 + tmp11 + tmp13, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) + RIGHT_SHIFT(tmp2 + tmp11 + tmp12, CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*7] = (DCTELEM) + RIGHT_SHIFT(tmp3 + tmp10 + tmp13, CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 3x6 sample block. + * + * 3-point FDCT in pass 1 (rows), 6-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_3x6 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1, tmp2; + INT32 tmp10, tmp11, tmp12; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + /* We scale the results further by 2 as part of output adaption */ + /* scaling for different DCT size. */ + /* 3-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/6). */ + + dataptr = data; + for (ctr = 0; ctr < 6; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]) + GETJSAMPLE(elemptr[2]); + tmp1 = GETJSAMPLE(elemptr[1]); + + tmp2 = GETJSAMPLE(elemptr[0]) - GETJSAMPLE(elemptr[2]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) + ((tmp0 + tmp1 - 3 * CENTERJSAMPLE) << (PASS1_BITS+1)); + dataptr[2] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp1, FIX(0.707106781)), /* c2 */ + CONST_BITS-PASS1_BITS-1); + + /* Odd part */ + + dataptr[1] = (DCTELEM) + DESCALE(MULTIPLY(tmp2, FIX(1.224744871)), /* c1 */ + CONST_BITS-PASS1_BITS-1); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We remove the PASS1_BITS scaling, but leave the results scaled up + * by an overall factor of 8. + * We must also scale the output by (8/6)*(8/3) = 32/9, which we partially + * fold into the constant multipliers (other part was done in pass 1): + * 6-point FDCT kernel, cK represents sqrt(2) * cos(K*pi/12) * 16/9. + */ + + dataptr = data; + for (ctr = 0; ctr < 3; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*5]; + tmp11 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*3]; + + tmp10 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + + tmp0 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*5]; + tmp1 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*4]; + tmp2 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*3]; + + dataptr[DCTSIZE*0] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 + tmp11, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*2] = (DCTELEM) + DESCALE(MULTIPLY(tmp12, FIX(2.177324216)), /* c2 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*4] = (DCTELEM) + DESCALE(MULTIPLY(tmp10 - tmp11 - tmp11, FIX(1.257078722)), /* c4 */ + CONST_BITS+PASS1_BITS); + + /* Odd part */ + + tmp10 = MULTIPLY(tmp0 + tmp2, FIX(0.650711829)); /* c5 */ + + dataptr[DCTSIZE*1] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp0 + tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + DESCALE(MULTIPLY(tmp0 - tmp1 - tmp2, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + dataptr[DCTSIZE*5] = (DCTELEM) + DESCALE(tmp10 + MULTIPLY(tmp2 - tmp1, FIX(1.777777778)), /* 16/9 */ + CONST_BITS+PASS1_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 2x4 sample block. + * + * 2-point FDCT in pass 1 (rows), 4-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_2x4 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1; + INT32 tmp10, tmp11; + DCTELEM *dataptr; + JSAMPROW elemptr; + int ctr; + SHIFT_TEMPS + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true DCT. */ + /* We must also scale the output by (8/2)*(8/4) = 2**3, which we add here. */ + + dataptr = data; + for (ctr = 0; ctr < 4; ctr++) { + elemptr = sample_data[ctr] + start_col; + + /* Even part */ + + tmp0 = GETJSAMPLE(elemptr[0]); + tmp1 = GETJSAMPLE(elemptr[1]); + + /* Apply unsigned->signed conversion */ + dataptr[0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 3); + + /* Odd part */ + + dataptr[1] = (DCTELEM) ((tmp0 - tmp1) << 3); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. + * We leave the results scaled up by an overall factor of 8. + * 4-point FDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point FDCT]. + */ + + dataptr = data; + for (ctr = 0; ctr < 2; ctr++) { + /* Even part */ + + tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*3]; + tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*2]; + + tmp10 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*3]; + tmp11 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*2]; + + dataptr[DCTSIZE*0] = (DCTELEM) (tmp0 + tmp1); + dataptr[DCTSIZE*2] = (DCTELEM) (tmp0 - tmp1); + + /* Odd part */ + + tmp0 = MULTIPLY(tmp10 + tmp11, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-1); + + dataptr[DCTSIZE*1] = (DCTELEM) + RIGHT_SHIFT(tmp0 + MULTIPLY(tmp10, FIX_0_765366865), /* c2-c6 */ + CONST_BITS); + dataptr[DCTSIZE*3] = (DCTELEM) + RIGHT_SHIFT(tmp0 - MULTIPLY(tmp11, FIX_1_847759065), /* c2+c6 */ + CONST_BITS); + + dataptr++; /* advance pointer to next column */ + } +} + + +/* + * Perform the forward DCT on a 1x2 sample block. + * + * 1-point FDCT in pass 1 (rows), 2-point in pass 2 (columns). + */ + +GLOBAL(void) +jpeg_fdct_1x2 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col) +{ + INT32 tmp0, tmp1; + + /* Pre-zero output coefficient block. */ + MEMZERO(data, SIZEOF(DCTELEM) * DCTSIZE2); + + tmp0 = GETJSAMPLE(sample_data[0][start_col]); + tmp1 = GETJSAMPLE(sample_data[1][start_col]); + + /* We leave the results scaled up by an overall factor of 8. + * We must also scale the output by (8/1)*(8/2) = 2**5. + */ + + /* Even part */ + /* Apply unsigned->signed conversion */ + data[DCTSIZE*0] = (DCTELEM) ((tmp0 + tmp1 - 2 * CENTERJSAMPLE) << 5); + + /* Odd part */ + data[DCTSIZE*1] = (DCTELEM) ((tmp0 - tmp1) << 5); +} + +#endif /* DCT_SCALING_SUPPORTED */ +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jidctflt.c b/thirdparty/LibJPEG/jpeg-9/jidctflt.c new file mode 100644 index 0000000..23ae9d3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jidctflt.c @@ -0,0 +1,235 @@ +/* + * jidctflt.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * Modified 2010 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a floating-point implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * This implementation should be more accurate than either of the integer + * IDCT implementations. However, it may not give the same results on all + * machines because of differences in roundoff behavior. Speed will depend + * on the hardware's floating point capacity. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with a fixed-point + * implementation, accuracy is lost due to imprecise representation of the + * scaled quantization values. However, that problem does not arise if + * we use floating point arithmetic. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_FLOAT_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a float result. + */ + +#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + FAST_FLOAT tmp10, tmp11, tmp12, tmp13; + FAST_FLOAT z5, z10, z11, z12, z13; + JCOEFPTR inptr; + FLOAT_MULT_TYPE * quantptr; + FAST_FLOAT * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = cinfo->sample_range_limit; + int ctr; + FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */ + tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 - tmp5; + + wsptr[DCTSIZE*0] = tmp0 + tmp7; + wsptr[DCTSIZE*7] = tmp0 - tmp7; + wsptr[DCTSIZE*1] = tmp1 + tmp6; + wsptr[DCTSIZE*6] = tmp1 - tmp6; + wsptr[DCTSIZE*2] = tmp2 + tmp5; + wsptr[DCTSIZE*5] = tmp2 - tmp5; + wsptr[DCTSIZE*3] = tmp3 + tmp4; + wsptr[DCTSIZE*4] = tmp3 - tmp4; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * And testing floats for zero is relatively expensive, so we don't bother. + */ + + /* Even part */ + + /* Apply signed->unsigned and prepare float->int conversion */ + z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5); + tmp10 = z5 + wsptr[4]; + tmp11 = z5 - wsptr[4]; + + tmp13 = wsptr[2] + wsptr[6]; + tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = wsptr[5] + wsptr[3]; + z10 = wsptr[5] - wsptr[3]; + z11 = wsptr[1] + wsptr[7]; + z12 = wsptr[1] - wsptr[7]; + + tmp7 = z11 + z13; + tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); + + z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ + tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */ + tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 - tmp5; + + /* Final output stage: float->int conversion and range-limit */ + + outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK]; + outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK]; + outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK]; + outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK]; + outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK]; + outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK]; + outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK]; + outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jidctfst.c b/thirdparty/LibJPEG/jpeg-9/jidctfst.c new file mode 100644 index 0000000..dba4216 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jidctfst.c @@ -0,0 +1,368 @@ +/* + * jidctfst.c + * + * Copyright (C) 1994-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a fast, not so accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on Arai, Agui, and Nakajima's algorithm for + * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in + * Japanese, but the algorithm is described in the Pennebaker & Mitchell + * JPEG textbook (see REFERENCES section in file README). The following code + * is based directly on figure 4-8 in P&M. + * While an 8-point DCT cannot be done in less than 11 multiplies, it is + * possible to arrange the computation so that many of the multiplies are + * simple scalings of the final outputs. These multiplies can then be + * folded into the multiplications or divisions by the JPEG quantization + * table entries. The AA&N method leaves only 5 multiplies and 29 adds + * to be done in the DCT itself. + * The primary disadvantage of this method is that with fixed-point math, + * accuracy is lost due to imprecise representation of the scaled + * quantization values. The smaller the quantization table entry, the less + * precise the scaled value, so this implementation does worse with high- + * quality-setting files than with low-quality ones. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_IFAST_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* Scaling decisions are generally the same as in the LL&M algorithm; + * see jidctint.c for more details. However, we choose to descale + * (right shift) multiplication products as soon as they are formed, + * rather than carrying additional fractional bits into subsequent additions. + * This compromises accuracy slightly, but it lets us save a few shifts. + * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) + * everywhere except in the multiplications proper; this saves a good deal + * of work on 16-bit-int machines. + * + * The dequantized coefficients are not integers because the AA&N scaling + * factors have been incorporated. We represent them scaled up by PASS1_BITS, + * so that the first and second IDCT rounds have the same input scaling. + * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to + * avoid a descaling shift; this compromises accuracy rather drastically + * for small quantization table entries, but it saves a lot of shifts. + * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway, + * so we use a much larger scaling factor to preserve accuracy. + * + * A final compromise is to represent the multiplicative constants to only + * 8 fractional bits, rather than 13. This saves some shifting work on some + * machines, and may also reduce the cost of multiplication (since there + * are fewer one-bits in the constants). + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 8 +#define PASS1_BITS 2 +#else +#define CONST_BITS 8 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 8 +#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */ +#else +#define FIX_1_082392200 FIX(1.082392200) +#define FIX_1_414213562 FIX(1.414213562) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_2_613125930 FIX(2.613125930) +#endif + + +/* We can gain a little more speed, with a further compromise in accuracy, + * by omitting the addition in a descaling shift. This yields an incorrectly + * rounded result half the time... + */ + +#ifndef USE_ACCURATE_ROUNDING +#undef DESCALE +#define DESCALE(x,n) RIGHT_SHIFT(x, n) +#endif + + +/* Multiply a DCTELEM variable by an INT32 constant, and immediately + * descale to yield a DCTELEM result. + */ + +#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 + * multiplication will do. For 12-bit data, the multiplier table is + * declared INT32, so a 32-bit multiply will be used. + */ + +#if BITS_IN_JSAMPLE == 8 +#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval)) +#else +#define DEQUANTIZE(coef,quantval) \ + DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS) +#endif + + +/* Like DESCALE, but applies to a DCTELEM and produces an int. + * We assume that int right shift is unsigned if INT32 right shift is. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define ISHIFT_TEMPS DCTELEM ishift_temp; +#if BITS_IN_JSAMPLE == 8 +#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ +#else +#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ +#endif +#define IRIGHT_SHIFT(x,shft) \ + ((ishift_temp = (x)) < 0 ? \ + (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ + (ishift_temp >> (shft))) +#else +#define ISHIFT_TEMPS +#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +#ifdef USE_ACCURATE_ROUNDING +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) +#else +#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) +#endif + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; + DCTELEM tmp10, tmp11, tmp12, tmp13; + DCTELEM z5, z10, z11, z12, z13; + JCOEFPTR inptr; + IFAST_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS /* for DESCALE */ + ISHIFT_TEMPS /* for IDESCALE */ + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = tmp0 + tmp2; /* phase 3 */ + tmp11 = tmp0 - tmp2; + + tmp13 = tmp1 + tmp3; /* phases 5-3 */ + tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ + + tmp0 = tmp10 + tmp13; /* phase 2 */ + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z13 = tmp6 + tmp5; /* phase 6 */ + z10 = tmp6 - tmp5; + z11 = tmp4 + tmp7; + z12 = tmp4 - tmp7; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); + wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); + wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); + wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); + wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); + wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); + wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); + wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part */ + + tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); + tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); + + tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); + tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) + - tmp13; + + tmp0 = tmp10 + tmp13; + tmp3 = tmp10 - tmp13; + tmp1 = tmp11 + tmp12; + tmp2 = tmp11 - tmp12; + + /* Odd part */ + + z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; + z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; + z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; + z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; + + tmp7 = z11 + z13; /* phase 5 */ + tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ + + z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ + tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ + tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ + + tmp6 = tmp12 - tmp7; /* phase 2 */ + tmp5 = tmp11 - tmp6; + tmp4 = tmp10 + tmp5; + + /* Final output stage: scale down by a factor of 8 and range-limit */ + + outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#endif /* DCT_IFAST_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jidctint.c b/thirdparty/LibJPEG/jpeg-9/jidctint.c new file mode 100644 index 0000000..dcdf7ce --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jidctint.c @@ -0,0 +1,5137 @@ +/* + * jidctint.c + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modification developed 2002-2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a slow-but-accurate integer implementation of the + * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine + * must also perform dequantization of the input coefficients. + * + * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT + * on each row (or vice versa, but it's more convenient to emit a row at + * a time). Direct algorithms are also available, but they are much more + * complex and seem not to be any faster when reduced to code. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + * + * We also provide IDCT routines with various output sample block sizes for + * direct resolution reduction or enlargement and for direct resolving the + * common 2x1 and 1x2 subsampling cases without additional resampling: NxN + * (N=1...16), 2NxN, and Nx2N (N=1...8) pixels for one 8x8 input DCT block. + * + * For N<8 we simply take the corresponding low-frequency coefficients of + * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block + * to yield the downscaled outputs. + * This can be seen as direct low-pass downsampling from the DCT domain + * point of view rather than the usual spatial domain point of view, + * yielding significant computational savings and results at least + * as good as common bilinear (averaging) spatial downsampling. + * + * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as + * lower frequencies and higher frequencies assumed to be zero. + * It turns out that the computational effort is similar to the 8x8 IDCT + * regarding the output size. + * Furthermore, the scaling and descaling is the same for all IDCT sizes. + * + * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases + * since there would be too many additional constants to pre-calculate. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jdct.h" /* Private declarations for DCT subsystem */ + +#ifdef DCT_ISLOW_SUPPORTED + + +/* + * This module is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */ +#endif + + +/* + * The poop on this scaling stuff is as follows: + * + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) + * larger than the true IDCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D IDCT, + * because the y0 and y4 inputs need not be divided by sqrt(N). + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (To scale up 12-bit sample data further, an + * intermediate INT32 array would be needed.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#if BITS_IN_JSAMPLE == 8 +#define CONST_BITS 13 +#define PASS1_BITS 2 +#else +#define CONST_BITS 13 +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus + * causing a lot of useless floating-point operations at run time. + * To get around this we use the following pre-calculated constants. + * If you change CONST_BITS you may want to add appropriate values. + * (With a reasonable C compiler, you can just rely on the FIX() macro...) + */ + +#if CONST_BITS == 13 +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ +#else +#define FIX_0_298631336 FIX(0.298631336) +#define FIX_0_390180644 FIX(0.390180644) +#define FIX_0_541196100 FIX(0.541196100) +#define FIX_0_765366865 FIX(0.765366865) +#define FIX_0_899976223 FIX(0.899976223) +#define FIX_1_175875602 FIX(1.175875602) +#define FIX_1_501321110 FIX(1.501321110) +#define FIX_1_847759065 FIX(1.847759065) +#define FIX_1_961570560 FIX(1.961570560) +#define FIX_2_053119869 FIX(2.053119869) +#define FIX_2_562915447 FIX(2.562915447) +#define FIX_3_072711026 FIX(3.072711026) +#endif + + +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. + * For 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#if BITS_IN_JSAMPLE == 8 +#define MULTIPLY(var,const) MULTIPLY16C16(var,const) +#else +#define MULTIPLY(var,const) ((var) * (const)) +#endif + + +/* Dequantize a coefficient by multiplying it by the multiplier-table + * entry; produce an int result. In this module, both inputs and result + * are 16 bits or less, so either int or short multiply will work. + */ + +#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) + + +/* + * Perform dequantization and inverse DCT on one block of coefficients. + */ + +GLOBAL(void) +jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[DCTSIZE2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z2 <<= CONST_BITS; + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z2 += ONE << (CONST_BITS-PASS1_BITS-1); + + tmp0 = z2 + z3; + tmp1 = z2 - z3; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < DCTSIZE; ctr++) { + outptr = output_buf[ctr] + output_col; + /* Rows of zeroes can be exploited in the same way as we did with columns. + * However, the column calculation has created many nonzero AC terms, so + * the simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_ROW_TEST + if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && + wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { + /* AC terms all zero */ + JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3) + & RANGE_MASK]; + + outptr[0] = dcval; + outptr[1] = dcval; + outptr[2] = dcval; + outptr[3] = dcval; + outptr[4] = dcval; + outptr[5] = dcval; + outptr[6] = dcval; + outptr[7] = dcval; + + wsptr += DCTSIZE; /* advance pointer to next row */ + continue; + } +#endif + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + /* Add fudge factor here for final descale. */ + z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + +#ifdef IDCT_SCALING_SUPPORTED + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 7x7 output block. + * + * Optimized algorithm with 12 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/14). + */ + +GLOBAL(void) +jpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[7*7]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp13 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp13 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp13 += ONE << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */ + tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */ + tmp0 = z1 + z3; + z2 -= tmp0; + tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */ + tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */ + tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */ + tmp13 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + + tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */ + tmp1 += tmp2; + z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */ + tmp0 += z2; + tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */ + + /* Final output stage */ + + wsptr[7*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[7*6] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[7*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[7*5] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[7*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[7*4] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[7*3] = (int) RIGHT_SHIFT(tmp13, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 7 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 7; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp13 <<= CONST_BITS; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[4]; + z3 = (INT32) wsptr[6]; + + tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */ + tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */ + tmp0 = z1 + z3; + z2 -= tmp0; + tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */ + tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */ + tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */ + tmp13 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + + tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp0 = tmp1 - tmp2; + tmp1 += tmp2; + tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */ + tmp1 += tmp2; + z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */ + tmp0 += z2; + tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 7; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 6x6 output block. + * + * Optimized algorithm with 3 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/12). + */ + +GLOBAL(void) +jpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[6*6]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ + tmp1 = tmp0 + tmp10; + tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS); + tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */ + tmp10 = tmp1 + tmp0; + tmp12 = tmp1 - tmp0; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp0 = tmp1 + ((z1 + z2) << CONST_BITS); + tmp2 = tmp1 + ((z3 - z2) << CONST_BITS); + tmp1 = (z1 - z2 - z3) << PASS1_BITS; + + /* Final output stage */ + + wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[6*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[6*1] = (int) (tmp11 + tmp1); + wsptr[6*4] = (int) (tmp11 - tmp1); + wsptr[6*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[6*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 6 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + tmp2 = (INT32) wsptr[4]; + tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ + tmp1 = tmp0 + tmp10; + tmp11 = tmp0 - tmp10 - tmp10; + tmp10 = (INT32) wsptr[2]; + tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */ + tmp10 = tmp1 + tmp0; + tmp12 = tmp1 - tmp0; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp0 = tmp1 + ((z1 + z2) << CONST_BITS); + tmp2 = tmp1 + ((z3 - z2) << CONST_BITS); + tmp1 = (z1 - z2 - z3) << CONST_BITS; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 6; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 5x5 output block. + * + * Optimized algorithm with 5 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/10). + */ + +GLOBAL(void) +jpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp10, tmp11, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[5*5]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp12 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp12 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp0 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */ + z3 = tmp12 + z2; + tmp10 = z3 + z1; + tmp11 = z3 - z1; + tmp12 -= z2 << 2; + + /* Odd part */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */ + tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */ + tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */ + + /* Final output stage */ + + wsptr[5*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[5*4] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[5*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[5*3] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[5*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 5 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 5; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp12 <<= CONST_BITS; + tmp0 = (INT32) wsptr[2]; + tmp1 = (INT32) wsptr[4]; + z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */ + z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */ + z3 = tmp12 + z2; + tmp10 = z3 + z1; + tmp11 = z3 - z1; + tmp12 -= z2 << 2; + + /* Odd part */ + + z2 = (INT32) wsptr[1]; + z3 = (INT32) wsptr[3]; + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */ + tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */ + tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 5; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 4x4 output block. + * + * Optimized algorithm with 3 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. + */ + +GLOBAL(void) +jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp2, tmp10, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[4*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + + tmp10 = (tmp0 + tmp2) << PASS1_BITS; + tmp12 = (tmp0 - tmp2) << PASS1_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS); + tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS); + + /* Final output stage */ + + wsptr[4*0] = (int) (tmp10 + tmp0); + wsptr[4*3] = (int) (tmp10 - tmp0); + wsptr[4*1] = (int) (tmp12 + tmp2); + wsptr[4*2] = (int) (tmp12 - tmp2); + } + + /* Pass 2: process 4 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp2 = (INT32) wsptr[2]; + + tmp10 = (tmp0 + tmp2) << CONST_BITS; + tmp12 = (tmp0 - tmp2) << CONST_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = (INT32) wsptr[1]; + z3 = (INT32) wsptr[3]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 4; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 3x3 output block. + * + * Optimized algorithm with 2 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/6). + */ + +GLOBAL(void) +jpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp2, tmp10, tmp12; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[3*3]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ + tmp10 = tmp0 + tmp12; + tmp2 = tmp0 - tmp12 - tmp12; + + /* Odd part */ + + tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */ + + /* Final output stage */ + + wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[3*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[3*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 3 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 3; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + tmp2 = (INT32) wsptr[2]; + tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ + tmp10 = tmp0 + tmp12; + tmp2 = tmp0 - tmp12 - tmp12; + + /* Odd part */ + + tmp12 = (INT32) wsptr[1]; + tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 3; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 2x2 output block. + * + * Multiplication-less algorithm. + */ + +GLOBAL(void) +jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; + ISLOW_MULT_TYPE * quantptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* Pass 1: process columns from input. */ + + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + + /* Column 0 */ + tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); + /* Add fudge factor here for final descale. */ + tmp4 += ONE << 2; + + tmp0 = tmp4 + tmp5; + tmp2 = tmp4 - tmp5; + + /* Column 1 */ + tmp4 = DEQUANTIZE(coef_block[DCTSIZE*0+1], quantptr[DCTSIZE*0+1]); + tmp5 = DEQUANTIZE(coef_block[DCTSIZE*1+1], quantptr[DCTSIZE*1+1]); + + tmp1 = tmp4 + tmp5; + tmp3 = tmp4 - tmp5; + + /* Pass 2: process 2 rows, store into output array. */ + + /* Row 0 */ + outptr = output_buf[0] + output_col; + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK]; + + /* Row 1 */ + outptr = output_buf[1] + output_col; + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp2 + tmp3, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2 - tmp3, 3) & RANGE_MASK]; +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 1x1 output block. + * + * We hardly need an inverse DCT routine for this: just take the + * average pixel value, which is one-eighth of the DC coefficient. + */ + +GLOBAL(void) +jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + int dcval; + ISLOW_MULT_TYPE * quantptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* 1x1 is trivial: just take the DC coefficient divided by 8. */ + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + dcval = DEQUANTIZE(coef_block[0], quantptr[0]); + dcval = (int) DESCALE((INT32) dcval, 3); + + output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 9x9 output block. + * + * Optimized algorithm with 10 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/18). + */ + +GLOBAL(void) +jpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*9]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp3 = MULTIPLY(z3, FIX(0.707106781)); /* c6 */ + tmp1 = tmp0 + tmp3; + tmp2 = tmp0 - tmp3 - tmp3; + + tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */ + tmp11 = tmp2 + tmp0; + tmp14 = tmp2 - tmp0 - tmp0; + + tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */ + tmp2 = MULTIPLY(z1, FIX(1.083350441)); /* c4 */ + tmp3 = MULTIPLY(z2, FIX(0.245575608)); /* c8 */ + + tmp10 = tmp1 + tmp0 - tmp3; + tmp12 = tmp1 - tmp0 + tmp2; + tmp13 = tmp1 - tmp2 + tmp3; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + z2 = MULTIPLY(z2, - FIX(1.224744871)); /* -c3 */ + + tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525)); /* c7 */ + tmp0 = tmp2 + tmp3 - z2; + tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481)); /* c1 */ + tmp2 += z2 - tmp1; + tmp3 += z2 + tmp1; + tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp14, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 9 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 9; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[4]; + z3 = (INT32) wsptr[6]; + + tmp3 = MULTIPLY(z3, FIX(0.707106781)); /* c6 */ + tmp1 = tmp0 + tmp3; + tmp2 = tmp0 - tmp3 - tmp3; + + tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */ + tmp11 = tmp2 + tmp0; + tmp14 = tmp2 - tmp0 - tmp0; + + tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */ + tmp2 = MULTIPLY(z1, FIX(1.083350441)); /* c4 */ + tmp3 = MULTIPLY(z2, FIX(0.245575608)); /* c8 */ + + tmp10 = tmp1 + tmp0 - tmp3; + tmp12 = tmp1 - tmp0 + tmp2; + tmp13 = tmp1 - tmp2 + tmp3; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + z2 = MULTIPLY(z2, - FIX(1.224744871)); /* -c3 */ + + tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525)); /* c7 */ + tmp0 = tmp2 + tmp3 - z2; + tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481)); /* c1 */ + tmp2 += z2 - tmp1; + tmp3 += z2 + tmp1; + tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 10x10 output block. + * + * Optimized algorithm with 12 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/20). + */ + +GLOBAL(void) +jpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24; + INT32 z1, z2, z3, z4, z5; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*10]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z3 += ONE << (CONST_BITS-PASS1_BITS-1); + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ + z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */ + tmp10 = z3 + z1; + tmp11 = z3 - z2; + + tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1), /* c0 = (c4-c8)*2 */ + CONST_BITS-PASS1_BITS); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */ + tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */ + tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */ + + tmp20 = tmp10 + tmp12; + tmp24 = tmp10 - tmp12; + tmp21 = tmp11 + tmp13; + tmp23 = tmp11 - tmp13; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = z2 + z4; + tmp13 = z2 - z4; + + tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */ + z5 = z3 << CONST_BITS; + + z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */ + z4 = z5 + tmp12; + + tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */ + tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */ + + z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */ + z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1)); + + tmp12 = (z1 - tmp13 - z3) << PASS1_BITS; + + tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */ + tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) (tmp22 + tmp12); + wsptr[8*7] = (int) (tmp22 - tmp12); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 10 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 10; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 <<= CONST_BITS; + z4 = (INT32) wsptr[4]; + z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ + z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */ + tmp10 = z3 + z1; + tmp11 = z3 - z2; + + tmp22 = z3 - ((z1 - z2) << 1); /* c0 = (c4-c8)*2 */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */ + tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */ + tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */ + + tmp20 = tmp10 + tmp12; + tmp24 = tmp10 - tmp12; + tmp21 = tmp11 + tmp13; + tmp23 = tmp11 - tmp13; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z3 <<= CONST_BITS; + z4 = (INT32) wsptr[7]; + + tmp11 = z2 + z4; + tmp13 = z2 - z4; + + tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */ + + z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */ + z4 = z3 + tmp12; + + tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */ + tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */ + + z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */ + z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1)); + + tmp12 = ((z1 - tmp13) << CONST_BITS) - z3; + + tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */ + tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 11x11 output block. + * + * Optimized algorithm with 24 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/22). + */ + +GLOBAL(void) +jpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*11]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp10 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp10 += ONE << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132)); /* c2+c4 */ + tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045)); /* c2-c6 */ + z4 = z1 + z3; + tmp24 = MULTIPLY(z4, - FIX(1.155664402)); /* -(c2-c10) */ + z4 -= z2; + tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976)); /* c2 */ + tmp21 = tmp20 + tmp23 + tmp25 - + MULTIPLY(z2, FIX(1.821790775)); /* c2+c4+c10-c6 */ + tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */ + tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */ + tmp24 += tmp25; + tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120)); /* c8+c10 */ + tmp24 += MULTIPLY(z2, FIX(1.944413522)) - /* c2+c8 */ + MULTIPLY(z1, FIX(1.390975730)); /* c4+c10 */ + tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = z1 + z2; + tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.887983902)); /* c3-c9 */ + tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295)); /* c5-c9 */ + tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(z1, FIX(0.923107866)); /* c7+c5+c3-c1-2*c9 */ + z1 = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */ + tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588)); /* c1+c7+3*c9-c3 */ + tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623)); /* c3+c5-c7-c9 */ + z1 = MULTIPLY(z2 + z4, - FIX(1.798248910)); /* -(c1+c9) */ + tmp11 += z1; + tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632)); /* c1+c5+c9-c7 */ + tmp14 += MULTIPLY(z2, - FIX(1.467221301)) + /* -(c5+c9) */ + MULTIPLY(z3, FIX(1.001388905)) - /* c1-c9 */ + MULTIPLY(z4, FIX(1.684843907)); /* c3+c9 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 11 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 11; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp10 <<= CONST_BITS; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[4]; + z3 = (INT32) wsptr[6]; + + tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132)); /* c2+c4 */ + tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045)); /* c2-c6 */ + z4 = z1 + z3; + tmp24 = MULTIPLY(z4, - FIX(1.155664402)); /* -(c2-c10) */ + z4 -= z2; + tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976)); /* c2 */ + tmp21 = tmp20 + tmp23 + tmp25 - + MULTIPLY(z2, FIX(1.821790775)); /* c2+c4+c10-c6 */ + tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */ + tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */ + tmp24 += tmp25; + tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120)); /* c8+c10 */ + tmp24 += MULTIPLY(z2, FIX(1.944413522)) - /* c2+c8 */ + MULTIPLY(z1, FIX(1.390975730)); /* c4+c10 */ + tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = z1 + z2; + tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.887983902)); /* c3-c9 */ + tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295)); /* c5-c9 */ + tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(z1, FIX(0.923107866)); /* c7+c5+c3-c1-2*c9 */ + z1 = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */ + tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588)); /* c1+c7+3*c9-c3 */ + tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623)); /* c3+c5-c7-c9 */ + z1 = MULTIPLY(z2 + z4, - FIX(1.798248910)); /* -(c1+c9) */ + tmp11 += z1; + tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632)); /* c1+c5+c9-c7 */ + tmp14 += MULTIPLY(z2, - FIX(1.467221301)) + /* -(c5+c9) */ + MULTIPLY(z3, FIX(1.001388905)) - /* c1-c9 */ + MULTIPLY(z4, FIX(1.684843907)); /* c3+c9 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 12x12 output block. + * + * Optimized algorithm with 15 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/24). + */ + +GLOBAL(void) +jpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*12]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z3 += ONE << (CONST_BITS-PASS1_BITS-1); + + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */ + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */ + z1 <<= CONST_BITS; + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + z2 <<= CONST_BITS; + + tmp12 = z1 - z2; + + tmp21 = z3 + tmp12; + tmp24 = z3 - tmp12; + + tmp12 = z4 + z2; + + tmp20 = tmp10 + tmp12; + tmp25 = tmp10 - tmp12; + + tmp12 = z4 - z1 - z2; + + tmp22 = tmp11 + tmp12; + tmp23 = tmp11 - tmp12; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */ + tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */ + + tmp10 = z1 + z3; + tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */ + tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */ + tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */ + tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */ + tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */ + tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */ + tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */ + MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */ + + z1 -= z4; + z2 -= z3; + z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */ + tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */ + tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 12 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 12; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 <<= CONST_BITS; + + z4 = (INT32) wsptr[4]; + z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */ + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + z1 = (INT32) wsptr[2]; + z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */ + z1 <<= CONST_BITS; + z2 = (INT32) wsptr[6]; + z2 <<= CONST_BITS; + + tmp12 = z1 - z2; + + tmp21 = z3 + tmp12; + tmp24 = z3 - tmp12; + + tmp12 = z4 + z2; + + tmp20 = tmp10 + tmp12; + tmp25 = tmp10 - tmp12; + + tmp12 = z4 - z1 - z2; + + tmp22 = tmp11 + tmp12; + tmp23 = tmp11 - tmp12; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */ + tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */ + + tmp10 = z1 + z3; + tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */ + tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */ + tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */ + tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */ + tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */ + tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */ + tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */ + MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */ + + z1 -= z4; + z2 -= z3; + z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */ + tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */ + tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 13x13 output block. + * + * Optimized algorithm with 29 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/26). + */ + +GLOBAL(void) +jpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*13]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z1 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + tmp12 = MULTIPLY(tmp10, FIX(1.155388986)); /* (c4+c6)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1; /* (c4-c6)/2 */ + + tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13; /* c2 */ + tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13; /* c10 */ + + tmp12 = MULTIPLY(tmp10, FIX(0.316450131)); /* (c8-c12)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1; /* (c8+c12)/2 */ + + tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13; /* c6 */ + tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */ + + tmp12 = MULTIPLY(tmp10, FIX(0.435816023)); /* (c2-c10)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1; /* (c2+c10)/2 */ + + tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */ + tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */ + + tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1; /* c0 */ + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651)); /* c3 */ + tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945)); /* c5 */ + tmp15 = z1 + z4; + tmp13 = MULTIPLY(tmp15, FIX(0.937797057)); /* c7 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(z1, FIX(2.020082300)); /* c7+c5+c3-c1 */ + tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458)); /* -c11 */ + tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */ + tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */ + tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945)); /* -c5 */ + tmp11 += tmp14; + tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */ + tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813)); /* -c9 */ + tmp12 += tmp14; + tmp13 += tmp14; + tmp15 = MULTIPLY(tmp15, FIX(0.338443458)); /* c11 */ + tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */ + MULTIPLY(z2, FIX(0.466105296)); /* c1-c7 */ + z1 = MULTIPLY(z3 - z2, FIX(0.937797057)); /* c7 */ + tmp14 += z1; + tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) - /* c3-c7 */ + MULTIPLY(z4, FIX(1.742345811)); /* c1+c11 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*12] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp26, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 13 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 13; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 <<= CONST_BITS; + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[4]; + z4 = (INT32) wsptr[6]; + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + tmp12 = MULTIPLY(tmp10, FIX(1.155388986)); /* (c4+c6)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1; /* (c4-c6)/2 */ + + tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13; /* c2 */ + tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13; /* c10 */ + + tmp12 = MULTIPLY(tmp10, FIX(0.316450131)); /* (c8-c12)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1; /* (c8+c12)/2 */ + + tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13; /* c6 */ + tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */ + + tmp12 = MULTIPLY(tmp10, FIX(0.435816023)); /* (c2-c10)/2 */ + tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1; /* (c2+c10)/2 */ + + tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */ + tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */ + + tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1; /* c0 */ + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651)); /* c3 */ + tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945)); /* c5 */ + tmp15 = z1 + z4; + tmp13 = MULTIPLY(tmp15, FIX(0.937797057)); /* c7 */ + tmp10 = tmp11 + tmp12 + tmp13 - + MULTIPLY(z1, FIX(2.020082300)); /* c7+c5+c3-c1 */ + tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458)); /* -c11 */ + tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */ + tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */ + tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945)); /* -c5 */ + tmp11 += tmp14; + tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */ + tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813)); /* -c9 */ + tmp12 += tmp14; + tmp13 += tmp14; + tmp15 = MULTIPLY(tmp15, FIX(0.338443458)); /* c11 */ + tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */ + MULTIPLY(z2, FIX(0.466105296)); /* c1-c7 */ + z1 = MULTIPLY(z3 - z2, FIX(0.937797057)); /* c7 */ + tmp14 += z1; + tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) - /* c3-c7 */ + MULTIPLY(z4, FIX(1.742345811)); /* c1+c11 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 14x14 output block. + * + * Optimized algorithm with 20 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/28). + */ + +GLOBAL(void) +jpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*14]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z1 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ + z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */ + z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */ + + tmp10 = z1 + z2; + tmp11 = z1 + z3; + tmp12 = z1 - z4; + + tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */ + CONST_BITS-PASS1_BITS); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */ + + tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */ + tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */ + tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */ + MULTIPLY(z2, FIX(1.378756276)); /* c2 */ + + tmp20 = tmp10 + tmp13; + tmp26 = tmp10 - tmp13; + tmp21 = tmp11 + tmp14; + tmp25 = tmp11 - tmp14; + tmp22 = tmp12 + tmp15; + tmp24 = tmp12 - tmp15; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp13 = z4 << CONST_BITS; + + tmp14 = z1 + z3; + tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */ + tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */ + tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */ + tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */ + tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */ + z1 -= z2; + tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13; /* c11 */ + tmp16 += tmp15; + z1 += z4; + z4 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */ + tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */ + tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */ + z4 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */ + tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */ + tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */ + + tmp13 = (z1 - z3) << PASS1_BITS; + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) (tmp23 + tmp13); + wsptr[8*10] = (int) (tmp23 - tmp13); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 14 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 14; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 <<= CONST_BITS; + z4 = (INT32) wsptr[4]; + z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ + z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */ + z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */ + + tmp10 = z1 + z2; + tmp11 = z1 + z3; + tmp12 = z1 - z4; + + tmp23 = z1 - ((z2 + z3 - z4) << 1); /* c0 = (c4+c12-c8)*2 */ + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[6]; + + z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */ + + tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */ + tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */ + tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */ + MULTIPLY(z2, FIX(1.378756276)); /* c2 */ + + tmp20 = tmp10 + tmp13; + tmp26 = tmp10 - tmp13; + tmp21 = tmp11 + tmp14; + tmp25 = tmp11 - tmp14; + tmp22 = tmp12 + tmp15; + tmp24 = tmp12 - tmp15; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + z4 <<= CONST_BITS; + + tmp14 = z1 + z3; + tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */ + tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */ + tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */ + tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */ + tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */ + z1 -= z2; + tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4; /* c11 */ + tmp16 += tmp15; + tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4; /* -c13 */ + tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */ + tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */ + tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */ + tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */ + tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */ + + tmp13 = ((z1 - z3) << CONST_BITS) + z4; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 15x15 output block. + * + * Optimized algorithm with 22 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/30). + */ + +GLOBAL(void) +jpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*15]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z1 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */ + tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */ + + tmp12 = z1 - tmp10; + tmp13 = z1 + tmp11; + z1 -= (tmp11 - tmp10) << 1; /* c0 = (c6-c12)*2 */ + + z4 = z2 - z3; + z3 += z2; + tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */ + z2 = MULTIPLY(z2, FIX(1.439773946)); /* c4+c14 */ + + tmp20 = tmp13 + tmp10 + tmp11; + tmp23 = tmp12 - tmp10 + tmp11 + z2; + + tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */ + + tmp25 = tmp13 - tmp10 - tmp11; + tmp26 = tmp12 + tmp10 - tmp11 - z2; + + tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */ + + tmp21 = tmp12 + tmp10 + tmp11; + tmp24 = tmp13 - tmp10 + tmp11; + tmp11 += tmp11; + tmp22 = z1 + tmp11; /* c10 = c6-c12 */ + tmp27 = z1 - tmp11 - tmp11; /* c0 = (c6-c12)*2 */ + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z4 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z3 = MULTIPLY(z4, FIX(1.224744871)); /* c5 */ + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp13 = z2 - z4; + tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876)); /* c9 */ + tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148)); /* c3-c9 */ + tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899)); /* c3+c9 */ + + tmp13 = MULTIPLY(z2, - FIX(0.831253876)); /* -c9 */ + tmp15 = MULTIPLY(z2, - FIX(1.344997024)); /* -c3 */ + z2 = z1 - z4; + tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353)); /* c1 */ + + tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */ + tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */ + tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3; /* c5 */ + z2 = MULTIPLY(z1 + z4, FIX(0.575212477)); /* c11 */ + tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3; /* c7-c11 */ + tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3; /* c11+c13 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*14] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*13] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*12] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp27, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 15 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 15; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 <<= CONST_BITS; + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[4]; + z4 = (INT32) wsptr[6]; + + tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */ + tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */ + + tmp12 = z1 - tmp10; + tmp13 = z1 + tmp11; + z1 -= (tmp11 - tmp10) << 1; /* c0 = (c6-c12)*2 */ + + z4 = z2 - z3; + z3 += z2; + tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */ + z2 = MULTIPLY(z2, FIX(1.439773946)); /* c4+c14 */ + + tmp20 = tmp13 + tmp10 + tmp11; + tmp23 = tmp12 - tmp10 + tmp11 + z2; + + tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */ + + tmp25 = tmp13 - tmp10 - tmp11; + tmp26 = tmp12 + tmp10 - tmp11 - z2; + + tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */ + tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */ + + tmp21 = tmp12 + tmp10 + tmp11; + tmp24 = tmp13 - tmp10 + tmp11; + tmp11 += tmp11; + tmp22 = z1 + tmp11; /* c10 = c6-c12 */ + tmp27 = z1 - tmp11 - tmp11; /* c0 = (c6-c12)*2 */ + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z4 = (INT32) wsptr[5]; + z3 = MULTIPLY(z4, FIX(1.224744871)); /* c5 */ + z4 = (INT32) wsptr[7]; + + tmp13 = z2 - z4; + tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876)); /* c9 */ + tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148)); /* c3-c9 */ + tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899)); /* c3+c9 */ + + tmp13 = MULTIPLY(z2, - FIX(0.831253876)); /* -c9 */ + tmp15 = MULTIPLY(z2, - FIX(1.344997024)); /* -c3 */ + z2 = z1 - z4; + tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353)); /* c1 */ + + tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */ + tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */ + tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3; /* c5 */ + z2 = MULTIPLY(z1 + z4, FIX(0.575212477)); /* c11 */ + tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3; /* c7-c11 */ + tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3; /* c11+c13 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 16x16 output block. + * + * Optimized algorithm with 28 multiplications in the 1-D kernel. + * cK represents sqrt(2) * cos(K*pi/32). + */ + +GLOBAL(void) +jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*16]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += 1 << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ + tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */ + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + tmp12 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + z3 = z1 - z2; + z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */ + z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */ + + tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */ + tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */ + tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */ + tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */ + + tmp20 = tmp10 + tmp0; + tmp27 = tmp10 - tmp0; + tmp21 = tmp12 + tmp1; + tmp26 = tmp12 - tmp1; + tmp22 = tmp13 + tmp2; + tmp25 = tmp13 - tmp2; + tmp23 = tmp11 + tmp3; + tmp24 = tmp11 - tmp3; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = z1 + z3; + + tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */ + tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */ + tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */ + tmp13 = tmp10 + tmp11 + tmp12 - + MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */ + z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */ + tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */ + tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */ + z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */ + tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */ + tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */ + z2 += z4; + z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */ + tmp1 += z1; + tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */ + z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */ + tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */ + tmp12 += z2; + z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */ + tmp2 += z2; + tmp3 += z2; + z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */ + tmp10 += z2; + tmp11 += z2; + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 16 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 16; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + + z1 = (INT32) wsptr[4]; + tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ + tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */ + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + tmp12 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[6]; + z3 = z1 - z2; + z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */ + z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */ + + tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */ + tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */ + tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */ + tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */ + + tmp20 = tmp10 + tmp0; + tmp27 = tmp10 - tmp0; + tmp21 = tmp12 + tmp1; + tmp26 = tmp12 - tmp1; + tmp22 = tmp13 + tmp2; + tmp25 = tmp13 - tmp2; + tmp23 = tmp11 + tmp3; + tmp24 = tmp11 - tmp3; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = z1 + z3; + + tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */ + tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */ + tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */ + tmp13 = tmp10 + tmp11 + tmp12 - + MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */ + z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */ + tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */ + tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */ + z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */ + tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */ + tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */ + z2 += z4; + z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */ + tmp1 += z1; + tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */ + z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */ + tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */ + tmp12 += z2; + z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */ + tmp2 += z2; + tmp3 += z2; + z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */ + tmp10 += z2; + tmp11 += z2; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 16x8 output block. + * + * 8-point IDCT in pass 1 (columns), 16-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*8]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = DCTSIZE; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[DCTSIZE*0] = dcval; + wsptr[DCTSIZE*1] = dcval; + wsptr[DCTSIZE*2] = dcval; + wsptr[DCTSIZE*3] = dcval; + wsptr[DCTSIZE*4] = dcval; + wsptr[DCTSIZE*5] = dcval; + wsptr[DCTSIZE*6] = dcval; + wsptr[DCTSIZE*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z2 <<= CONST_BITS; + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z2 += ONE << (CONST_BITS-PASS1_BITS-1); + + tmp0 = z2 + z3; + tmp1 = z2 - z3; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process 8 rows from work array, store into output array. + * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32). + */ + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + + z1 = (INT32) wsptr[4]; + tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ + tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */ + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + tmp12 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[6]; + z3 = z1 - z2; + z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */ + z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */ + + tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */ + tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */ + tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */ + tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */ + + tmp20 = tmp10 + tmp0; + tmp27 = tmp10 - tmp0; + tmp21 = tmp12 + tmp1; + tmp26 = tmp12 - tmp1; + tmp22 = tmp13 + tmp2; + tmp25 = tmp13 - tmp2; + tmp23 = tmp11 + tmp3; + tmp24 = tmp11 - tmp3; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = z1 + z3; + + tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */ + tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */ + tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */ + tmp13 = tmp10 + tmp11 + tmp12 - + MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */ + z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */ + tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */ + tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */ + z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */ + tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */ + tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */ + z2 += z4; + z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */ + tmp1 += z1; + tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */ + z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */ + tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */ + tmp12 += z2; + z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */ + tmp2 += z2; + tmp3 += z2; + z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */ + tmp10 += z2; + tmp11 += z2; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 14x7 output block. + * + * 7-point IDCT in pass 1 (columns), 14-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_14x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*7]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp23 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp23 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp23 += ONE << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */ + tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */ + tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */ + tmp10 = z1 + z3; + z2 -= tmp10; + tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */ + tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */ + tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */ + tmp23 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + + tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp10 = tmp11 - tmp12; + tmp11 += tmp12; + tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */ + tmp11 += tmp12; + z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */ + tmp10 += z2; + tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 7 rows from work array, store into output array. + * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28). + */ + wsptr = workspace; + for (ctr = 0; ctr < 7; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z1 <<= CONST_BITS; + z4 = (INT32) wsptr[4]; + z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ + z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */ + z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */ + + tmp10 = z1 + z2; + tmp11 = z1 + z3; + tmp12 = z1 - z4; + + tmp23 = z1 - ((z2 + z3 - z4) << 1); /* c0 = (c4+c12-c8)*2 */ + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[6]; + + z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */ + + tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */ + tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */ + tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */ + MULTIPLY(z2, FIX(1.378756276)); /* c2 */ + + tmp20 = tmp10 + tmp13; + tmp26 = tmp10 - tmp13; + tmp21 = tmp11 + tmp14; + tmp25 = tmp11 - tmp14; + tmp22 = tmp12 + tmp15; + tmp24 = tmp12 - tmp15; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + z4 <<= CONST_BITS; + + tmp14 = z1 + z3; + tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */ + tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */ + tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */ + tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */ + tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */ + z1 -= z2; + tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4; /* c11 */ + tmp16 += tmp15; + tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4; /* -c13 */ + tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */ + tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */ + tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */ + tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */ + tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */ + + tmp13 = ((z1 - z3) << CONST_BITS) + z4; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 12x6 output block. + * + * 6-point IDCT in pass 1 (columns), 12-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_12x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*6]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp10 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp10 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp12 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */ + tmp11 = tmp10 + tmp20; + tmp21 = RIGHT_SHIFT(tmp10 - tmp20 - tmp20, CONST_BITS-PASS1_BITS); + tmp20 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp10 = MULTIPLY(tmp20, FIX(1.224744871)); /* c2 */ + tmp20 = tmp11 + tmp10; + tmp22 = tmp11 - tmp10; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp10 = tmp11 + ((z1 + z2) << CONST_BITS); + tmp12 = tmp11 + ((z3 - z2) << CONST_BITS); + tmp11 = (z1 - z2 - z3) << PASS1_BITS; + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) (tmp21 + tmp11); + wsptr[8*4] = (int) (tmp21 - tmp11); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 6 rows from work array, store into output array. + * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24). + */ + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 <<= CONST_BITS; + + z4 = (INT32) wsptr[4]; + z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */ + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + z1 = (INT32) wsptr[2]; + z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */ + z1 <<= CONST_BITS; + z2 = (INT32) wsptr[6]; + z2 <<= CONST_BITS; + + tmp12 = z1 - z2; + + tmp21 = z3 + tmp12; + tmp24 = z3 - tmp12; + + tmp12 = z4 + z2; + + tmp20 = tmp10 + tmp12; + tmp25 = tmp10 - tmp12; + + tmp12 = z4 - z1 - z2; + + tmp22 = tmp11 + tmp12; + tmp23 = tmp11 - tmp12; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z4 = (INT32) wsptr[7]; + + tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */ + tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */ + + tmp10 = z1 + z3; + tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */ + tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */ + tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */ + tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */ + tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */ + tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */ + tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */ + MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */ + + z1 -= z4; + z2 -= z3; + z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */ + tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */ + tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 10x5 output block. + * + * 5-point IDCT in pass 1 (columns), 10-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_10x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*5]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp12 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp12 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp13 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp14 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */ + z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */ + z3 = tmp12 + z2; + tmp10 = z3 + z1; + tmp11 = z3 - z1; + tmp12 -= z2 << 2; + + /* Odd part */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */ + tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */ + tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */ + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp10 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp11 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 5 rows from work array, store into output array. + * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20). + */ + wsptr = workspace; + for (ctr = 0; ctr < 5; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 <<= CONST_BITS; + z4 = (INT32) wsptr[4]; + z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ + z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */ + tmp10 = z3 + z1; + tmp11 = z3 - z2; + + tmp22 = z3 - ((z1 - z2) << 1); /* c0 = (c4-c8)*2 */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */ + tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */ + tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */ + + tmp20 = tmp10 + tmp12; + tmp24 = tmp10 - tmp12; + tmp21 = tmp11 + tmp13; + tmp23 = tmp11 - tmp13; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + z3 <<= CONST_BITS; + z4 = (INT32) wsptr[7]; + + tmp11 = z2 + z4; + tmp13 = z2 - z4; + + tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */ + + z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */ + z4 = z3 + tmp12; + + tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */ + tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */ + + z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */ + z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1)); + + tmp12 = ((z1 - tmp13) << CONST_BITS) - z3; + + tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */ + tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 8; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 8x4 output block. + * + * 4-point IDCT in pass 1 (columns), 8-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + + tmp10 = (tmp0 + tmp2) << PASS1_BITS; + tmp12 = (tmp0 - tmp2) << PASS1_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp0 = RIGHT_SHIFT(z1 + MULTIPLY(z2, FIX_0_765366865), /* c2-c6 */ + CONST_BITS-PASS1_BITS); + tmp2 = RIGHT_SHIFT(z1 - MULTIPLY(z3, FIX_1_847759065), /* c2+c6 */ + CONST_BITS-PASS1_BITS); + + /* Final output stage */ + + wsptr[8*0] = (int) (tmp10 + tmp0); + wsptr[8*3] = (int) (tmp10 - tmp0); + wsptr[8*1] = (int) (tmp12 + tmp2); + wsptr[8*2] = (int) (tmp12 - tmp2); + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + /* Add fudge factor here for final descale. */ + z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 6x3 output block. + * + * 3-point IDCT in pass 1 (columns), 6-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[6*3]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ + tmp10 = tmp0 + tmp12; + tmp2 = tmp0 - tmp12 - tmp12; + + /* Odd part */ + + tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */ + + /* Final output stage */ + + wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[6*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[6*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 3 rows from work array, store into output array. + * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ + wsptr = workspace; + for (ctr = 0; ctr < 3; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + tmp2 = (INT32) wsptr[4]; + tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ + tmp1 = tmp0 + tmp10; + tmp11 = tmp0 - tmp10 - tmp10; + tmp10 = (INT32) wsptr[2]; + tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */ + tmp10 = tmp1 + tmp0; + tmp12 = tmp1 - tmp0; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp0 = tmp1 + ((z1 + z2) << CONST_BITS); + tmp2 = tmp1 + ((z3 - z2) << CONST_BITS); + tmp1 = (z1 - z2 - z3) << CONST_BITS; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 6; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 4x2 output block. + * + * 2-point IDCT in pass 1 (columns), 4-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_4x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp2, tmp10, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + INT32 * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + INT32 workspace[4*2]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + + /* Odd part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + /* Final output stage */ + + wsptr[4*0] = tmp10 + tmp0; + wsptr[4*1] = tmp10 - tmp0; + } + + /* Pass 2: process 2 rows from work array, store into output array. + * 4-point IDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. + */ + wsptr = workspace; + for (ctr = 0; ctr < 2; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = wsptr[0] + (ONE << 2); + tmp2 = wsptr[2]; + + tmp10 = (tmp0 + tmp2) << CONST_BITS; + tmp12 = (tmp0 - tmp2) << CONST_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = wsptr[1]; + z3 = wsptr[3]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+3) + & RANGE_MASK]; + + wsptr += 4; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 2x1 output block. + * + * 1-point IDCT in pass 1 (columns), 2-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp10; + ISLOW_MULT_TYPE * quantptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* Pass 1: empty. */ + + /* Pass 2: process 1 row from input, store into output array. */ + + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + outptr = output_buf[0] + output_col; + + /* Even part */ + + tmp10 = DEQUANTIZE(coef_block[0], quantptr[0]); + /* Add fudge factor here for final descale. */ + tmp10 += ONE << 2; + + /* Odd part */ + + tmp0 = DEQUANTIZE(coef_block[1], quantptr[1]); + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3) & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3) & RANGE_MASK]; +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 8x16 output block. + * + * 16-point IDCT in pass 1 (columns), 8-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[8*16]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 16-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/32). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + + z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */ + tmp2 = MULTIPLY(z1, FIX_0_541196100); /* c12[16] = c6[8] */ + + tmp10 = tmp0 + tmp1; + tmp11 = tmp0 - tmp1; + tmp12 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + z3 = z1 - z2; + z4 = MULTIPLY(z3, FIX(0.275899379)); /* c14[16] = c7[8] */ + z3 = MULTIPLY(z3, FIX(1.387039845)); /* c2[16] = c1[8] */ + + tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447); /* (c6+c2)[16] = (c3+c1)[8] */ + tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223); /* (c6-c14)[16] = (c3-c7)[8] */ + tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */ + tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */ + + tmp20 = tmp10 + tmp0; + tmp27 = tmp10 - tmp0; + tmp21 = tmp12 + tmp1; + tmp26 = tmp12 - tmp1; + tmp22 = tmp13 + tmp2; + tmp25 = tmp13 - tmp2; + tmp23 = tmp11 + tmp3; + tmp24 = tmp11 - tmp3; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = z1 + z3; + + tmp1 = MULTIPLY(z1 + z2, FIX(1.353318001)); /* c3 */ + tmp2 = MULTIPLY(tmp11, FIX(1.247225013)); /* c5 */ + tmp3 = MULTIPLY(z1 + z4, FIX(1.093201867)); /* c7 */ + tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586)); /* c9 */ + tmp11 = MULTIPLY(tmp11, FIX(0.666655658)); /* c11 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528)); /* c13 */ + tmp0 = tmp1 + tmp2 + tmp3 - + MULTIPLY(z1, FIX(2.286341144)); /* c7+c5+c3-c1 */ + tmp13 = tmp10 + tmp11 + tmp12 - + MULTIPLY(z1, FIX(1.835730603)); /* c9+c11+c13-c15 */ + z1 = MULTIPLY(z2 + z3, FIX(0.138617169)); /* c15 */ + tmp1 += z1 + MULTIPLY(z2, FIX(0.071888074)); /* c9+c11-c3-c15 */ + tmp2 += z1 - MULTIPLY(z3, FIX(1.125726048)); /* c5+c7+c15-c3 */ + z1 = MULTIPLY(z3 - z2, FIX(1.407403738)); /* c1 */ + tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282)); /* c1+c11-c9-c13 */ + tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411)); /* c1+c5+c13-c7 */ + z2 += z4; + z1 = MULTIPLY(z2, - FIX(0.666655658)); /* -c11 */ + tmp1 += z1; + tmp3 += z1 + MULTIPLY(z4, FIX(1.065388962)); /* c3+c11+c15-c7 */ + z2 = MULTIPLY(z2, - FIX(1.247225013)); /* -c5 */ + tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809)); /* c1+c5+c9-c13 */ + tmp12 += z2; + z2 = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */ + tmp2 += z2; + tmp3 += z2; + z2 = MULTIPLY(z4 - z3, FIX(0.410524528)); /* c13 */ + tmp10 += z2; + tmp11 += z2; + + /* Final output stage */ + + wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[8*2] = (int) RIGHT_SHIFT(tmp22 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[8*5] = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[8*6] = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*9] = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process rows from work array, store into output array. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + wsptr = workspace; + for (ctr = 0; ctr < 16; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) wsptr[2]; + z3 = (INT32) wsptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + /* Add fudge factor here for final descale. */ + z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + z3 = (INT32) wsptr[4]; + + tmp0 = (z2 + z3) << CONST_BITS; + tmp1 = (z2 - z3) << CONST_BITS; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) wsptr[7]; + tmp1 = (INT32) wsptr[5]; + tmp2 = (INT32) wsptr[3]; + tmp3 = (INT32) wsptr[1]; + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += DCTSIZE; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 7x14 output block. + * + * 14-point IDCT in pass 1 (columns), 7-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_7x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[7*14]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 14-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/28). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z1 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z1 += ONE << (CONST_BITS-PASS1_BITS-1); + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z2 = MULTIPLY(z4, FIX(1.274162392)); /* c4 */ + z3 = MULTIPLY(z4, FIX(0.314692123)); /* c12 */ + z4 = MULTIPLY(z4, FIX(0.881747734)); /* c8 */ + + tmp10 = z1 + z2; + tmp11 = z1 + z3; + tmp12 = z1 - z4; + + tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */ + CONST_BITS-PASS1_BITS); + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z3 = MULTIPLY(z1 + z2, FIX(1.105676686)); /* c6 */ + + tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */ + tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */ + tmp15 = MULTIPLY(z1, FIX(0.613604268)) - /* c10 */ + MULTIPLY(z2, FIX(1.378756276)); /* c2 */ + + tmp20 = tmp10 + tmp13; + tmp26 = tmp10 - tmp13; + tmp21 = tmp11 + tmp14; + tmp25 = tmp11 - tmp14; + tmp22 = tmp12 + tmp15; + tmp24 = tmp12 - tmp15; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp13 = z4 << CONST_BITS; + + tmp14 = z1 + z3; + tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607)); /* c3 */ + tmp12 = MULTIPLY(tmp14, FIX(1.197448846)); /* c5 */ + tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */ + tmp14 = MULTIPLY(tmp14, FIX(0.752406978)); /* c9 */ + tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426)); /* c9+c11-c13 */ + z1 -= z2; + tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13; /* c11 */ + tmp16 += tmp15; + z1 += z4; + z4 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */ + tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948)); /* c3-c9-c13 */ + tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773)); /* c3+c5-c13 */ + z4 = MULTIPLY(z3 - z2, FIX(1.405321284)); /* c1 */ + tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */ + tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567)); /* c1+c11-c5 */ + + tmp13 = (z1 - z3) << PASS1_BITS; + + /* Final output stage */ + + wsptr[7*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[7*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[7*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[7*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[7*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[7*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[7*3] = (int) (tmp23 + tmp13); + wsptr[7*10] = (int) (tmp23 - tmp13); + wsptr[7*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[7*9] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[7*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[7*8] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + wsptr[7*6] = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS); + wsptr[7*7] = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 14 rows from work array, store into output array. + * 7-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/14). + */ + wsptr = workspace; + for (ctr = 0; ctr < 14; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp23 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp23 <<= CONST_BITS; + + z1 = (INT32) wsptr[2]; + z2 = (INT32) wsptr[4]; + z3 = (INT32) wsptr[6]; + + tmp20 = MULTIPLY(z2 - z3, FIX(0.881747734)); /* c4 */ + tmp22 = MULTIPLY(z1 - z2, FIX(0.314692123)); /* c6 */ + tmp21 = tmp20 + tmp22 + tmp23 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */ + tmp10 = z1 + z3; + z2 -= tmp10; + tmp10 = MULTIPLY(tmp10, FIX(1.274162392)) + tmp23; /* c2 */ + tmp20 += tmp10 - MULTIPLY(z3, FIX(0.077722536)); /* c2-c4-c6 */ + tmp22 += tmp10 - MULTIPLY(z1, FIX(2.470602249)); /* c2+c4+c6 */ + tmp23 += MULTIPLY(z2, FIX(1.414213562)); /* c0 */ + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + + tmp11 = MULTIPLY(z1 + z2, FIX(0.935414347)); /* (c3+c1-c5)/2 */ + tmp12 = MULTIPLY(z1 - z2, FIX(0.170262339)); /* (c3+c5-c1)/2 */ + tmp10 = tmp11 - tmp12; + tmp11 += tmp12; + tmp12 = MULTIPLY(z2 + z3, - FIX(1.378756276)); /* -c1 */ + tmp11 += tmp12; + z2 = MULTIPLY(z1 + z3, FIX(0.613604268)); /* c5 */ + tmp10 += z2; + tmp12 += z2 + MULTIPLY(z3, FIX(1.870828693)); /* c3+c1-c5 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 7; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 6x12 output block. + * + * 12-point IDCT in pass 1 (columns), 6-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_6x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25; + INT32 z1, z2, z3, z4; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[6*12]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 12-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/24). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z3 += ONE << (CONST_BITS-PASS1_BITS-1); + + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */ + + tmp10 = z3 + z4; + tmp11 = z3 - z4; + + z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */ + z1 <<= CONST_BITS; + z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + z2 <<= CONST_BITS; + + tmp12 = z1 - z2; + + tmp21 = z3 + tmp12; + tmp24 = z3 - tmp12; + + tmp12 = z4 + z2; + + tmp20 = tmp10 + tmp12; + tmp25 = tmp10 - tmp12; + + tmp12 = z4 - z1 - z2; + + tmp22 = tmp11 + tmp12; + tmp23 = tmp11 - tmp12; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = MULTIPLY(z2, FIX(1.306562965)); /* c3 */ + tmp14 = MULTIPLY(z2, - FIX_0_541196100); /* -c9 */ + + tmp10 = z1 + z3; + tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669)); /* c7 */ + tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384)); /* c5-c7 */ + tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716)); /* c1-c5 */ + tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580)); /* -(c7+c11) */ + tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */ + tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */ + tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) - /* c7-c11 */ + MULTIPLY(z4, FIX(1.982889723)); /* c5+c7 */ + + z1 -= z4; + z2 -= z3; + z3 = MULTIPLY(z1 + z2, FIX_0_541196100); /* c9 */ + tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865); /* c3-c9 */ + tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065); /* c3+c9 */ + + /* Final output stage */ + + wsptr[6*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[6*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[6*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[6*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[6*2] = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS); + wsptr[6*9] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS); + wsptr[6*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[6*8] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[6*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[6*7] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + wsptr[6*5] = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS); + wsptr[6*6] = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 12 rows from work array, store into output array. + * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ + wsptr = workspace; + for (ctr = 0; ctr < 12; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp10 <<= CONST_BITS; + tmp12 = (INT32) wsptr[4]; + tmp20 = MULTIPLY(tmp12, FIX(0.707106781)); /* c4 */ + tmp11 = tmp10 + tmp20; + tmp21 = tmp10 - tmp20 - tmp20; + tmp20 = (INT32) wsptr[2]; + tmp10 = MULTIPLY(tmp20, FIX(1.224744871)); /* c2 */ + tmp20 = tmp11 + tmp10; + tmp22 = tmp11 - tmp10; + + /* Odd part */ + + z1 = (INT32) wsptr[1]; + z2 = (INT32) wsptr[3]; + z3 = (INT32) wsptr[5]; + tmp11 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp10 = tmp11 + ((z1 + z2) << CONST_BITS); + tmp12 = tmp11 + ((z3 - z2) << CONST_BITS); + tmp11 = (z1 - z2 - z3) << CONST_BITS; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 6; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 5x10 output block. + * + * 10-point IDCT in pass 1 (columns), 5-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_5x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp10, tmp11, tmp12, tmp13, tmp14; + INT32 tmp20, tmp21, tmp22, tmp23, tmp24; + INT32 z1, z2, z3, z4, z5; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[5*10]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 10-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/20). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z3 += ONE << (CONST_BITS-PASS1_BITS-1); + z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z1 = MULTIPLY(z4, FIX(1.144122806)); /* c4 */ + z2 = MULTIPLY(z4, FIX(0.437016024)); /* c8 */ + tmp10 = z3 + z1; + tmp11 = z3 - z2; + + tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1), /* c0 = (c4-c8)*2 */ + CONST_BITS-PASS1_BITS); + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c6 */ + tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */ + tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */ + + tmp20 = tmp10 + tmp12; + tmp24 = tmp10 - tmp12; + tmp21 = tmp11 + tmp13; + tmp23 = tmp11 - tmp13; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + + tmp11 = z2 + z4; + tmp13 = z2 - z4; + + tmp12 = MULTIPLY(tmp13, FIX(0.309016994)); /* (c3-c7)/2 */ + z5 = z3 << CONST_BITS; + + z2 = MULTIPLY(tmp11, FIX(0.951056516)); /* (c3+c7)/2 */ + z4 = z5 + tmp12; + + tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */ + tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */ + + z2 = MULTIPLY(tmp11, FIX(0.587785252)); /* (c1-c9)/2 */ + z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1)); + + tmp12 = (z1 - tmp13 - z3) << PASS1_BITS; + + tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */ + tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */ + + /* Final output stage */ + + wsptr[5*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS); + wsptr[5*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS); + wsptr[5*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS); + wsptr[5*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS); + wsptr[5*2] = (int) (tmp22 + tmp12); + wsptr[5*7] = (int) (tmp22 - tmp12); + wsptr[5*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS); + wsptr[5*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS); + wsptr[5*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS); + wsptr[5*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 10 rows from work array, store into output array. + * 5-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/10). + */ + wsptr = workspace; + for (ctr = 0; ctr < 10; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp12 <<= CONST_BITS; + tmp13 = (INT32) wsptr[2]; + tmp14 = (INT32) wsptr[4]; + z1 = MULTIPLY(tmp13 + tmp14, FIX(0.790569415)); /* (c2+c4)/2 */ + z2 = MULTIPLY(tmp13 - tmp14, FIX(0.353553391)); /* (c2-c4)/2 */ + z3 = tmp12 + z2; + tmp10 = z3 + z1; + tmp11 = z3 - z1; + tmp12 -= z2 << 2; + + /* Odd part */ + + z2 = (INT32) wsptr[1]; + z3 = (INT32) wsptr[3]; + + z1 = MULTIPLY(z2 + z3, FIX(0.831253876)); /* c3 */ + tmp13 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c1-c3 */ + tmp14 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c1+c3 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp13, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp14, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 5; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 4x8 output block. + * + * 8-point IDCT in pass 1 (columns), 4-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[4*8]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 4; ctr > 0; ctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any column in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * column DCT calculations can be simplified this way. + */ + + if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && + inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && + inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && + inptr[DCTSIZE*7] == 0) { + /* AC terms all zero */ + int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; + + wsptr[4*0] = dcval; + wsptr[4*1] = dcval; + wsptr[4*2] = dcval; + wsptr[4*3] = dcval; + wsptr[4*4] = dcval; + wsptr[4*5] = dcval; + wsptr[4*6] = dcval; + wsptr[4*7] = dcval; + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); + tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); + tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); + + z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + z2 <<= CONST_BITS; + z3 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + z2 += ONE << (CONST_BITS-PASS1_BITS-1); + + tmp0 = z2 + z3; + tmp1 = z2 - z3; + + tmp10 = tmp0 + tmp2; + tmp13 = tmp0 - tmp2; + tmp11 = tmp1 + tmp3; + tmp12 = tmp1 - tmp3; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); + tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + + z2 = tmp0 + tmp2; + z3 = tmp1 + tmp3; + + z1 = MULTIPLY(z2 + z3, FIX_1_175875602); /* sqrt(2) * c3 */ + z2 = MULTIPLY(z2, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z3 = MULTIPLY(z3, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + z2 += z1; + z3 += z1; + + z1 = MULTIPLY(tmp0 + tmp3, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + tmp0 += z1 + z2; + tmp3 += z1 + z3; + + z1 = MULTIPLY(tmp1 + tmp2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp1 += z1 + z3; + tmp2 += z1 + z2; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + wsptr[4*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + wsptr[4*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + wsptr[4*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[4*6] = (int) RIGHT_SHIFT(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + wsptr[4*2] = (int) RIGHT_SHIFT(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + wsptr[4*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + wsptr[4*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[4*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + inptr++; /* advance pointers to next column */ + quantptr++; + wsptr++; + } + + /* Pass 2: process 8 rows from work array, store into output array. + * 4-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/16). + */ + wsptr = workspace; + for (ctr = 0; ctr < 8; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp2 = (INT32) wsptr[2]; + + tmp10 = (tmp0 + tmp2) << CONST_BITS; + tmp12 = (tmp0 - tmp2) << CONST_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = (INT32) wsptr[1]; + z3 = (INT32) wsptr[3]; + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 4; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a reduced-size 3x6 output block. + * + * 6-point IDCT in pass 1 (columns), 3-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_3x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + int * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + int workspace[3*6]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12). + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp0 <<= CONST_BITS; + /* Add fudge factor here for final descale. */ + tmp0 += ONE << (CONST_BITS-PASS1_BITS-1); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); + tmp10 = MULTIPLY(tmp2, FIX(0.707106781)); /* c4 */ + tmp1 = tmp0 + tmp10; + tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS); + tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + tmp0 = MULTIPLY(tmp10, FIX(1.224744871)); /* c2 */ + tmp10 = tmp1 + tmp0; + tmp12 = tmp1 - tmp0; + + /* Odd part */ + + z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); + tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */ + tmp0 = tmp1 + ((z1 + z2) << CONST_BITS); + tmp2 = tmp1 + ((z3 - z2) << CONST_BITS); + tmp1 = (z1 - z2 - z3) << PASS1_BITS; + + /* Final output stage */ + + wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS); + wsptr[3*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS); + wsptr[3*1] = (int) (tmp11 + tmp1); + wsptr[3*4] = (int) (tmp11 - tmp1); + wsptr[3*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS); + wsptr[3*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS); + } + + /* Pass 2: process 6 rows from work array, store into output array. + * 3-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/6). + */ + wsptr = workspace; + for (ctr = 0; ctr < 6; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2)); + tmp0 <<= CONST_BITS; + tmp2 = (INT32) wsptr[2]; + tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */ + tmp10 = tmp0 + tmp12; + tmp2 = tmp0 - tmp12 - tmp12; + + /* Odd part */ + + tmp12 = (INT32) wsptr[1]; + tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */ + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2, + CONST_BITS+PASS1_BITS+3) + & RANGE_MASK]; + + wsptr += 3; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 2x4 output block. + * + * 4-point IDCT in pass 1 (columns), 2-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_2x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp2, tmp10, tmp12; + INT32 z1, z2, z3; + JCOEFPTR inptr; + ISLOW_MULT_TYPE * quantptr; + INT32 * wsptr; + JSAMPROW outptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + int ctr; + INT32 workspace[2*4]; /* buffers data between passes */ + SHIFT_TEMPS + + /* Pass 1: process columns from input, store into work array. + * 4-point IDCT kernel, + * cK represents sqrt(2) * cos(K*pi/16) [refers to 8-point IDCT]. + */ + inptr = coef_block; + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + wsptr = workspace; + for (ctr = 0; ctr < 2; ctr++, inptr++, quantptr++, wsptr++) { + /* Even part */ + + tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); + tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); + + tmp10 = (tmp0 + tmp2) << CONST_BITS; + tmp12 = (tmp0 - tmp2) << CONST_BITS; + + /* Odd part */ + /* Same rotation as in the even part of the 8x8 LL&M IDCT */ + + z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); + z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); + + z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */ + tmp0 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */ + tmp2 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */ + + /* Final output stage */ + + wsptr[2*0] = tmp10 + tmp0; + wsptr[2*3] = tmp10 - tmp0; + wsptr[2*1] = tmp12 + tmp2; + wsptr[2*2] = tmp12 - tmp2; + } + + /* Pass 2: process 4 rows from work array, store into output array. */ + + wsptr = workspace; + for (ctr = 0; ctr < 4; ctr++) { + outptr = output_buf[ctr] + output_col; + + /* Even part */ + + /* Add fudge factor here for final descale. */ + tmp10 = wsptr[0] + (ONE << (CONST_BITS+2)); + + /* Odd part */ + + tmp0 = wsptr[1]; + + /* Final output stage */ + + outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS+3) + & RANGE_MASK]; + outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS+3) + & RANGE_MASK]; + + wsptr += 2; /* advance pointer to next row */ + } +} + + +/* + * Perform dequantization and inverse DCT on one block of coefficients, + * producing a 1x2 output block. + * + * 2-point IDCT in pass 1 (columns), 1-point in pass 2 (rows). + */ + +GLOBAL(void) +jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col) +{ + INT32 tmp0, tmp10; + ISLOW_MULT_TYPE * quantptr; + JSAMPLE *range_limit = IDCT_range_limit(cinfo); + SHIFT_TEMPS + + /* Process 1 column from input, store into output array. */ + + quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; + + /* Even part */ + + tmp10 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]); + /* Add fudge factor here for final descale. */ + tmp10 += ONE << 2; + + /* Odd part */ + + tmp0 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]); + + /* Final output stage */ + + output_buf[0][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0, 3) + & RANGE_MASK]; + output_buf[1][output_col] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0, 3) + & RANGE_MASK]; +} + +#endif /* IDCT_SCALING_SUPPORTED */ +#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jinclude.h b/thirdparty/LibJPEG/jpeg-9/jinclude.h new file mode 100644 index 0000000..0a4f151 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jinclude.h @@ -0,0 +1,91 @@ +/* + * jinclude.h + * + * Copyright (C) 1991-1994, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file exists to provide a single place to fix any problems with + * including the wrong system include files. (Common problems are taken + * care of by the standard jconfig symbols, but on really weird systems + * you may have to edit this file.) + * + * NOTE: this file is NOT intended to be included by applications using the + * JPEG library. Most applications need only include jpeglib.h. + */ + + +/* Include auto-config file to find out which system include files we need. */ + +#include "jconfig.h" /* auto configuration options */ +#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ + +/* + * We need the NULL macro and size_t typedef. + * On an ANSI-conforming system it is sufficient to include . + * Otherwise, we get them from or ; we may have to + * pull in as well. + * Note that the core JPEG library does not require ; + * only the default error handler and data source/destination modules do. + * But we must pull it in because of the references to FILE in jpeglib.h. + * You can remove those references if you want to compile without . + */ + +#ifdef HAVE_STDDEF_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef NEED_SYS_TYPES_H +#include +#endif + +#include + +/* + * We need memory copying and zeroing functions, plus strncpy(). + * ANSI and System V implementations declare these in . + * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). + * Some systems may declare memset and memcpy in . + * + * NOTE: we assume the size parameters to these functions are of type size_t. + * Change the casts in these macros if not! + */ + +#ifdef NEED_BSD_STRINGS + +#include +#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) +#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) + +#else /* not BSD, assume ANSI/SysV string lib */ + +#include +#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) +#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) + +#endif + +/* + * In ANSI C, and indeed any rational implementation, size_t is also the + * type returned by sizeof(). However, it seems there are some irrational + * implementations out there, in which sizeof() returns an int even though + * size_t is defined as long or unsigned long. To ensure consistent results + * we always use this SIZEOF() macro in place of using sizeof() directly. + */ + +#define SIZEOF(object) ((size_t) sizeof(object)) + +/* + * The modules that use fread() and fwrite() always invoke them through + * these macros. On some systems you may need to twiddle the argument casts. + * CAUTION: argument order is different from underlying functions! + */ + +#define JFREAD(file,buf,sizeofbuf) \ + ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) +#define JFWRITE(file,buf,sizeofbuf) \ + ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/thirdparty/LibJPEG/jpeg-9/jmemansi.c b/thirdparty/LibJPEG/jpeg-9/jmemansi.c new file mode 100644 index 0000000..2d93e49 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemansi.c @@ -0,0 +1,167 @@ +/* + * jmemansi.c + * + * Copyright (C) 1992-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a simple generic implementation of the system- + * dependent portion of the JPEG memory manager. This implementation + * assumes that you have the ANSI-standard library routine tmpfile(). + * Also, the problem of determining the amount of memory available + * is shoved onto the user. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + +#ifndef SEEK_SET /* pre-ANSI systems may not define this; */ +#define SEEK_SET 0 /* if not, assume 0 is correct */ +#endif + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * It's impossible to do this in a portable way; our current solution is + * to make the user tell us (with a default value set at compile time). + * If you can actually get the available space, it's a good idea to subtract + * a slop factor of 5% or so. + */ + +#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ +#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */ +#endif + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return cinfo->mem->max_memory_to_use - already_allocated; +} + + +/* + * Backing store (temporary file) management. + * Backing store objects are only used when the value returned by + * jpeg_mem_available is less than the total space needed. You can dispense + * with these routines if you have plenty of virtual memory; see jmemnobs.c. + */ + + +METHODDEF(void) +read_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (fseek(info->temp_file, file_offset, SEEK_SET)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + if (JFREAD(info->temp_file, buffer_address, byte_count) + != (size_t) byte_count) + ERREXIT(cinfo, JERR_TFILE_READ); +} + + +METHODDEF(void) +write_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (fseek(info->temp_file, file_offset, SEEK_SET)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + if (JFWRITE(info->temp_file, buffer_address, byte_count) + != (size_t) byte_count) + ERREXIT(cinfo, JERR_TFILE_WRITE); +} + + +METHODDEF(void) +close_backing_store (j_common_ptr cinfo, backing_store_ptr info) +{ + fclose(info->temp_file); + /* Since this implementation uses tmpfile() to create the file, + * no explicit file deletion is needed. + */ +} + + +/* + * Initial opening of a backing-store object. + * + * This version uses tmpfile(), which constructs a suitable file name + * behind the scenes. We don't have to use info->temp_name[] at all; + * indeed, we can't even find out the actual name of the temp file. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + if ((info->temp_file = tmpfile()) == NULL) + ERREXITS(cinfo, JERR_TFILE_CREATE, ""); + info->read_backing_store = read_backing_store; + info->write_backing_store = write_backing_store; + info->close_backing_store = close_backing_store; +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemdos.c b/thirdparty/LibJPEG/jpeg-9/jmemdos.c new file mode 100644 index 0000000..60b45c6 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemdos.c @@ -0,0 +1,638 @@ +/* + * jmemdos.c + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides an MS-DOS-compatible implementation of the system- + * dependent portion of the JPEG memory manager. Temporary data can be + * stored in extended or expanded memory as well as in regular DOS files. + * + * If you use this file, you must be sure that NEED_FAR_POINTERS is defined + * if you compile in a small-data memory model; it should NOT be defined if + * you use a large-data memory model. This file is not recommended if you + * are using a flat-memory-space 386 environment such as DJGCC or Watcom C. + * Also, this code will NOT work if struct fields are aligned on greater than + * 2-byte boundaries. + * + * Based on code contributed by Ge' Weijers. + */ + +/* + * If you have both extended and expanded memory, you may want to change the + * order in which they are tried in jopen_backing_store. On a 286 machine + * expanded memory is usually faster, since extended memory access involves + * an expensive protected-mode-and-back switch. On 386 and better, extended + * memory is usually faster. As distributed, the code tries extended memory + * first (what? not everyone has a 386? :-). + * + * You can disable use of extended/expanded memory entirely by altering these + * definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0). + */ + +#ifndef XMS_SUPPORTED +#define XMS_SUPPORTED 1 +#endif +#ifndef EMS_SUPPORTED +#define EMS_SUPPORTED 1 +#endif + + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare these */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +extern char * getenv JPP((const char * name)); +#endif + +#ifdef NEED_FAR_POINTERS + +#ifdef __TURBOC__ +/* These definitions work for Borland C (Turbo C) */ +#include /* need farmalloc(), farfree() */ +#define far_malloc(x) farmalloc(x) +#define far_free(x) farfree(x) +#else +/* These definitions work for Microsoft C and compatible compilers */ +#include /* need _fmalloc(), _ffree() */ +#define far_malloc(x) _fmalloc(x) +#define far_free(x) _ffree(x) +#endif + +#else /* not NEED_FAR_POINTERS */ + +#define far_malloc(x) malloc(x) +#define far_free(x) free(x) + +#endif /* NEED_FAR_POINTERS */ + +#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ +#define READ_BINARY "r" +#else +#define READ_BINARY "rb" +#endif + +#ifndef USE_MSDOS_MEMMGR /* make sure user got configuration right */ + You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */ +#endif + +#if MAX_ALLOC_CHUNK >= 65535L /* make sure jconfig.h got this right */ + MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */ +#endif + + +/* + * Declarations for assembly-language support routines (see jmemdosa.asm). + * + * The functions are declared "far" as are all their pointer arguments; + * this ensures the assembly source code will work regardless of the + * compiler memory model. We assume "short" is 16 bits, "long" is 32. + */ + +typedef void far * XMSDRIVER; /* actually a pointer to code */ +typedef struct { /* registers for calling XMS driver */ + unsigned short ax, dx, bx; + void far * ds_si; + } XMScontext; +typedef struct { /* registers for calling EMS driver */ + unsigned short ax, dx, bx; + void far * ds_si; + } EMScontext; + +extern short far jdos_open JPP((short far * handle, char far * filename)); +extern short far jdos_close JPP((short handle)); +extern short far jdos_seek JPP((short handle, long offset)); +extern short far jdos_read JPP((short handle, void far * buffer, + unsigned short count)); +extern short far jdos_write JPP((short handle, void far * buffer, + unsigned short count)); +extern void far jxms_getdriver JPP((XMSDRIVER far *)); +extern void far jxms_calldriver JPP((XMSDRIVER, XMScontext far *)); +extern short far jems_available JPP((void)); +extern void far jems_calldriver JPP((EMScontext far *)); + + +/* + * Selection of a file name for a temporary file. + * This is highly system-dependent, and you may want to customize it. + */ + +static int next_file_num; /* to distinguish among several temp files */ + +LOCAL(void) +select_file_name (char * fname) +{ + const char * env; + char * ptr; + FILE * tfile; + + /* Keep generating file names till we find one that's not in use */ + for (;;) { + /* Get temp directory name from environment TMP or TEMP variable; + * if none, use "." + */ + if ((env = (const char *) getenv("TMP")) == NULL) + if ((env = (const char *) getenv("TEMP")) == NULL) + env = "."; + if (*env == '\0') /* null string means "." */ + env = "."; + ptr = fname; /* copy name to fname */ + while (*env != '\0') + *ptr++ = *env++; + if (ptr[-1] != '\\' && ptr[-1] != '/') + *ptr++ = '\\'; /* append backslash if not in env variable */ + /* Append a suitable file name */ + next_file_num++; /* advance counter */ + sprintf(ptr, "JPG%03d.TMP", next_file_num); + /* Probe to see if file name is already in use */ + if ((tfile = fopen(fname, READ_BINARY)) == NULL) + break; + fclose(tfile); /* oops, it's there; close tfile & try again */ + } +} + + +/* + * Near-memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are allocated in far memory, if possible + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) far_malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + far_free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * It's impossible to do this in a portable way; our current solution is + * to make the user tell us (with a default value set at compile time). + * If you can actually get the available space, it's a good idea to subtract + * a slop factor of 5% or so. + */ + +#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ +#define DEFAULT_MAX_MEM 300000L /* for total usage about 450K */ +#endif + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return cinfo->mem->max_memory_to_use - already_allocated; +} + + +/* + * Backing store (temporary file) management. + * Backing store objects are only used when the value returned by + * jpeg_mem_available is less than the total space needed. You can dispense + * with these routines if you have plenty of virtual memory; see jmemnobs.c. + */ + +/* + * For MS-DOS we support three types of backing storage: + * 1. Conventional DOS files. We access these by direct DOS calls rather + * than via the stdio package. This provides a bit better performance, + * but the real reason is that the buffers to be read or written are FAR. + * The stdio library for small-data memory models can't cope with that. + * 2. Extended memory, accessed per the XMS V2.0 specification. + * 3. Expanded memory, accessed per the LIM/EMS 4.0 specification. + * You'll need copies of those specs to make sense of the related code. + * The specs are available by Internet FTP from the SIMTEL archives + * (oak.oakland.edu and its various mirror sites). See files + * pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip. + */ + + +/* + * Access methods for a DOS file. + */ + + +METHODDEF(void) +read_file_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (jdos_seek(info->handle.file_handle, file_offset)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */ + if (byte_count > 65535L) /* safety check */ + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + if (jdos_read(info->handle.file_handle, buffer_address, + (unsigned short) byte_count)) + ERREXIT(cinfo, JERR_TFILE_READ); +} + + +METHODDEF(void) +write_file_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (jdos_seek(info->handle.file_handle, file_offset)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */ + if (byte_count > 65535L) /* safety check */ + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + if (jdos_write(info->handle.file_handle, buffer_address, + (unsigned short) byte_count)) + ERREXIT(cinfo, JERR_TFILE_WRITE); +} + + +METHODDEF(void) +close_file_store (j_common_ptr cinfo, backing_store_ptr info) +{ + jdos_close(info->handle.file_handle); /* close the file */ + remove(info->temp_name); /* delete the file */ +/* If your system doesn't have remove(), try unlink() instead. + * remove() is the ANSI-standard name for this function, but + * unlink() was more common in pre-ANSI systems. + */ + TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name); +} + + +LOCAL(boolean) +open_file_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + short handle; + + select_file_name(info->temp_name); + if (jdos_open((short far *) & handle, (char far *) info->temp_name)) { + /* might as well exit since jpeg_open_backing_store will fail anyway */ + ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); + return FALSE; + } + info->handle.file_handle = handle; + info->read_backing_store = read_file_store; + info->write_backing_store = write_file_store; + info->close_backing_store = close_file_store; + TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); + return TRUE; /* succeeded */ +} + + +/* + * Access methods for extended memory. + */ + +#if XMS_SUPPORTED + +static XMSDRIVER xms_driver; /* saved address of XMS driver */ + +typedef union { /* either long offset or real-mode pointer */ + long offset; + void far * ptr; + } XMSPTR; + +typedef struct { /* XMS move specification structure */ + long length; + XMSH src_handle; + XMSPTR src; + XMSH dst_handle; + XMSPTR dst; + } XMSspec; + +#define ODD(X) (((X) & 1L) != 0) + + +METHODDEF(void) +read_xms_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + XMScontext ctx; + XMSspec spec; + char endbuffer[2]; + + /* The XMS driver can't cope with an odd length, so handle the last byte + * specially if byte_count is odd. We don't expect this to be common. + */ + + spec.length = byte_count & (~ 1L); + spec.src_handle = info->handle.xms_handle; + spec.src.offset = file_offset; + spec.dst_handle = 0; + spec.dst.ptr = buffer_address; + + ctx.ds_si = (void far *) & spec; + ctx.ax = 0x0b00; /* EMB move */ + jxms_calldriver(xms_driver, (XMScontext far *) & ctx); + if (ctx.ax != 1) + ERREXIT(cinfo, JERR_XMS_READ); + + if (ODD(byte_count)) { + read_xms_store(cinfo, info, (void FAR *) endbuffer, + file_offset + byte_count - 1L, 2L); + ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0]; + } +} + + +METHODDEF(void) +write_xms_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + XMScontext ctx; + XMSspec spec; + char endbuffer[2]; + + /* The XMS driver can't cope with an odd length, so handle the last byte + * specially if byte_count is odd. We don't expect this to be common. + */ + + spec.length = byte_count & (~ 1L); + spec.src_handle = 0; + spec.src.ptr = buffer_address; + spec.dst_handle = info->handle.xms_handle; + spec.dst.offset = file_offset; + + ctx.ds_si = (void far *) & spec; + ctx.ax = 0x0b00; /* EMB move */ + jxms_calldriver(xms_driver, (XMScontext far *) & ctx); + if (ctx.ax != 1) + ERREXIT(cinfo, JERR_XMS_WRITE); + + if (ODD(byte_count)) { + read_xms_store(cinfo, info, (void FAR *) endbuffer, + file_offset + byte_count - 1L, 2L); + endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L]; + write_xms_store(cinfo, info, (void FAR *) endbuffer, + file_offset + byte_count - 1L, 2L); + } +} + + +METHODDEF(void) +close_xms_store (j_common_ptr cinfo, backing_store_ptr info) +{ + XMScontext ctx; + + ctx.dx = info->handle.xms_handle; + ctx.ax = 0x0a00; + jxms_calldriver(xms_driver, (XMScontext far *) & ctx); + TRACEMS1(cinfo, 1, JTRC_XMS_CLOSE, info->handle.xms_handle); + /* we ignore any error return from the driver */ +} + + +LOCAL(boolean) +open_xms_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + XMScontext ctx; + + /* Get address of XMS driver */ + jxms_getdriver((XMSDRIVER far *) & xms_driver); + if (xms_driver == NULL) + return FALSE; /* no driver to be had */ + + /* Get version number, must be >= 2.00 */ + ctx.ax = 0x0000; + jxms_calldriver(xms_driver, (XMScontext far *) & ctx); + if (ctx.ax < (unsigned short) 0x0200) + return FALSE; + + /* Try to get space (expressed in kilobytes) */ + ctx.dx = (unsigned short) ((total_bytes_needed + 1023L) >> 10); + ctx.ax = 0x0900; + jxms_calldriver(xms_driver, (XMScontext far *) & ctx); + if (ctx.ax != 1) + return FALSE; + + /* Succeeded, save the handle and away we go */ + info->handle.xms_handle = ctx.dx; + info->read_backing_store = read_xms_store; + info->write_backing_store = write_xms_store; + info->close_backing_store = close_xms_store; + TRACEMS1(cinfo, 1, JTRC_XMS_OPEN, ctx.dx); + return TRUE; /* succeeded */ +} + +#endif /* XMS_SUPPORTED */ + + +/* + * Access methods for expanded memory. + */ + +#if EMS_SUPPORTED + +/* The EMS move specification structure requires word and long fields aligned + * at odd byte boundaries. Some compilers will align struct fields at even + * byte boundaries. While it's usually possible to force byte alignment, + * that causes an overall performance penalty and may pose problems in merging + * JPEG into a larger application. Instead we accept some rather dirty code + * here. Note this code would fail if the hardware did not allow odd-byte + * word & long accesses, but all 80x86 CPUs do. + */ + +typedef void far * EMSPTR; + +typedef union { /* EMS move specification structure */ + long length; /* It's easy to access first 4 bytes */ + char bytes[18]; /* Misaligned fields in here! */ + } EMSspec; + +/* Macros for accessing misaligned fields */ +#define FIELD_AT(spec,offset,type) (*((type *) &(spec.bytes[offset]))) +#define SRC_TYPE(spec) FIELD_AT(spec,4,char) +#define SRC_HANDLE(spec) FIELD_AT(spec,5,EMSH) +#define SRC_OFFSET(spec) FIELD_AT(spec,7,unsigned short) +#define SRC_PAGE(spec) FIELD_AT(spec,9,unsigned short) +#define SRC_PTR(spec) FIELD_AT(spec,7,EMSPTR) +#define DST_TYPE(spec) FIELD_AT(spec,11,char) +#define DST_HANDLE(spec) FIELD_AT(spec,12,EMSH) +#define DST_OFFSET(spec) FIELD_AT(spec,14,unsigned short) +#define DST_PAGE(spec) FIELD_AT(spec,16,unsigned short) +#define DST_PTR(spec) FIELD_AT(spec,14,EMSPTR) + +#define EMSPAGESIZE 16384L /* gospel, see the EMS specs */ + +#define HIBYTE(W) (((W) >> 8) & 0xFF) +#define LOBYTE(W) ((W) & 0xFF) + + +METHODDEF(void) +read_ems_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + EMScontext ctx; + EMSspec spec; + + spec.length = byte_count; + SRC_TYPE(spec) = 1; + SRC_HANDLE(spec) = info->handle.ems_handle; + SRC_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE); + SRC_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE); + DST_TYPE(spec) = 0; + DST_HANDLE(spec) = 0; + DST_PTR(spec) = buffer_address; + + ctx.ds_si = (void far *) & spec; + ctx.ax = 0x5700; /* move memory region */ + jems_calldriver((EMScontext far *) & ctx); + if (HIBYTE(ctx.ax) != 0) + ERREXIT(cinfo, JERR_EMS_READ); +} + + +METHODDEF(void) +write_ems_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + EMScontext ctx; + EMSspec spec; + + spec.length = byte_count; + SRC_TYPE(spec) = 0; + SRC_HANDLE(spec) = 0; + SRC_PTR(spec) = buffer_address; + DST_TYPE(spec) = 1; + DST_HANDLE(spec) = info->handle.ems_handle; + DST_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE); + DST_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE); + + ctx.ds_si = (void far *) & spec; + ctx.ax = 0x5700; /* move memory region */ + jems_calldriver((EMScontext far *) & ctx); + if (HIBYTE(ctx.ax) != 0) + ERREXIT(cinfo, JERR_EMS_WRITE); +} + + +METHODDEF(void) +close_ems_store (j_common_ptr cinfo, backing_store_ptr info) +{ + EMScontext ctx; + + ctx.ax = 0x4500; + ctx.dx = info->handle.ems_handle; + jems_calldriver((EMScontext far *) & ctx); + TRACEMS1(cinfo, 1, JTRC_EMS_CLOSE, info->handle.ems_handle); + /* we ignore any error return from the driver */ +} + + +LOCAL(boolean) +open_ems_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + EMScontext ctx; + + /* Is EMS driver there? */ + if (! jems_available()) + return FALSE; + + /* Get status, make sure EMS is OK */ + ctx.ax = 0x4000; + jems_calldriver((EMScontext far *) & ctx); + if (HIBYTE(ctx.ax) != 0) + return FALSE; + + /* Get version, must be >= 4.0 */ + ctx.ax = 0x4600; + jems_calldriver((EMScontext far *) & ctx); + if (HIBYTE(ctx.ax) != 0 || LOBYTE(ctx.ax) < 0x40) + return FALSE; + + /* Try to allocate requested space */ + ctx.ax = 0x4300; + ctx.bx = (unsigned short) ((total_bytes_needed + EMSPAGESIZE-1L) / EMSPAGESIZE); + jems_calldriver((EMScontext far *) & ctx); + if (HIBYTE(ctx.ax) != 0) + return FALSE; + + /* Succeeded, save the handle and away we go */ + info->handle.ems_handle = ctx.dx; + info->read_backing_store = read_ems_store; + info->write_backing_store = write_ems_store; + info->close_backing_store = close_ems_store; + TRACEMS1(cinfo, 1, JTRC_EMS_OPEN, ctx.dx); + return TRUE; /* succeeded */ +} + +#endif /* EMS_SUPPORTED */ + + +/* + * Initial opening of a backing-store object. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + /* Try extended memory, then expanded memory, then regular file. */ +#if XMS_SUPPORTED + if (open_xms_store(cinfo, info, total_bytes_needed)) + return; +#endif +#if EMS_SUPPORTED + if (open_ems_store(cinfo, info, total_bytes_needed)) + return; +#endif + if (open_file_store(cinfo, info, total_bytes_needed)) + return; + ERREXITS(cinfo, JERR_TFILE_CREATE, ""); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + next_file_num = 0; /* initialize temp file name generator */ + return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* Microsoft C, at least in v6.00A, will not successfully reclaim freed + * blocks of size > 32Kbytes unless we give it a kick in the rear, like so: + */ +#ifdef NEED_FHEAPMIN + _fheapmin(); +#endif +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemdosa.asm b/thirdparty/LibJPEG/jpeg-9/jmemdosa.asm new file mode 100644 index 0000000..ecd4372 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemdosa.asm @@ -0,0 +1,379 @@ +; +; jmemdosa.asm +; +; Copyright (C) 1992, Thomas G. Lane. +; This file is part of the Independent JPEG Group's software. +; For conditions of distribution and use, see the accompanying README file. +; +; This file contains low-level interface routines to support the MS-DOS +; backing store manager (jmemdos.c). Routines are provided to access disk +; files through direct DOS calls, and to access XMS and EMS drivers. +; +; This file should assemble with Microsoft's MASM or any compatible +; assembler (including Borland's Turbo Assembler). If you haven't got +; a compatible assembler, better fall back to jmemansi.c or jmemname.c. +; +; To minimize dependence on the C compiler's register usage conventions, +; we save and restore all 8086 registers, even though most compilers only +; require SI,DI,DS to be preserved. Also, we use only 16-bit-wide return +; values, which everybody returns in AX. +; +; Based on code contributed by Ge' Weijers. +; + +JMEMDOSA_TXT segment byte public 'CODE' + + assume cs:JMEMDOSA_TXT + + public _jdos_open + public _jdos_close + public _jdos_seek + public _jdos_read + public _jdos_write + public _jxms_getdriver + public _jxms_calldriver + public _jems_available + public _jems_calldriver + +; +; short far jdos_open (short far * handle, char far * filename) +; +; Create and open a temporary file +; +_jdos_open proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov cx,0 ; normal file attributes + lds dx,dword ptr [bp+10] ; get filename pointer + mov ah,3ch ; create file + int 21h + jc open_err ; if failed, return error code + lds bx,dword ptr [bp+6] ; get handle pointer + mov word ptr [bx],ax ; save the handle + xor ax,ax ; return zero for OK +open_err: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jdos_open endp + + +; +; short far jdos_close (short handle) +; +; Close the file handle +; +_jdos_close proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov bx,word ptr [bp+6] ; file handle + mov ah,3eh ; close file + int 21h + jc close_err ; if failed, return error code + xor ax,ax ; return zero for OK +close_err: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jdos_close endp + + +; +; short far jdos_seek (short handle, long offset) +; +; Set file position +; +_jdos_seek proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov bx,word ptr [bp+6] ; file handle + mov dx,word ptr [bp+8] ; LS offset + mov cx,word ptr [bp+10] ; MS offset + mov ax,4200h ; absolute seek + int 21h + jc seek_err ; if failed, return error code + xor ax,ax ; return zero for OK +seek_err: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jdos_seek endp + + +; +; short far jdos_read (short handle, void far * buffer, unsigned short count) +; +; Read from file +; +_jdos_read proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov bx,word ptr [bp+6] ; file handle + lds dx,dword ptr [bp+8] ; buffer address + mov cx,word ptr [bp+12] ; number of bytes + mov ah,3fh ; read file + int 21h + jc read_err ; if failed, return error code + cmp ax,word ptr [bp+12] ; make sure all bytes were read + je read_ok + mov ax,1 ; else return 1 for not OK + jmp short read_err +read_ok: xor ax,ax ; return zero for OK +read_err: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jdos_read endp + + +; +; short far jdos_write (short handle, void far * buffer, unsigned short count) +; +; Write to file +; +_jdos_write proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov bx,word ptr [bp+6] ; file handle + lds dx,dword ptr [bp+8] ; buffer address + mov cx,word ptr [bp+12] ; number of bytes + mov ah,40h ; write file + int 21h + jc write_err ; if failed, return error code + cmp ax,word ptr [bp+12] ; make sure all bytes written + je write_ok + mov ax,1 ; else return 1 for not OK + jmp short write_err +write_ok: xor ax,ax ; return zero for OK +write_err: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jdos_write endp + + +; +; void far jxms_getdriver (XMSDRIVER far *) +; +; Get the address of the XMS driver, or NULL if not available +; +_jxms_getdriver proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov ax,4300h ; call multiplex interrupt with + int 2fh ; a magic cookie, hex 4300 + cmp al,80h ; AL should contain hex 80 + je xmsavail + xor dx,dx ; no XMS driver available + xor ax,ax ; return a nil pointer + jmp short xmsavail_done +xmsavail: mov ax,4310h ; fetch driver address with + int 2fh ; another magic cookie + mov dx,es ; copy address to dx:ax + mov ax,bx +xmsavail_done: les bx,dword ptr [bp+6] ; get pointer to return value + mov word ptr es:[bx],ax + mov word ptr es:[bx+2],dx + pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jxms_getdriver endp + + +; +; void far jxms_calldriver (XMSDRIVER, XMScontext far *) +; +; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers. +; These are loaded, the XMS call is performed, and the new values of the +; AX,DX,BX registers are written back to the context structure. +; +_jxms_calldriver proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + les bx,dword ptr [bp+10] ; get XMScontext pointer + mov ax,word ptr es:[bx] ; load registers + mov dx,word ptr es:[bx+2] + mov si,word ptr es:[bx+6] + mov ds,word ptr es:[bx+8] + mov bx,word ptr es:[bx+4] + call dword ptr [bp+6] ; call the driver + mov cx,bx ; save returned BX for a sec + les bx,dword ptr [bp+10] ; get XMScontext pointer + mov word ptr es:[bx],ax ; put back ax,dx,bx + mov word ptr es:[bx+2],dx + mov word ptr es:[bx+4],cx + pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jxms_calldriver endp + + +; +; short far jems_available (void) +; +; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs) +; +_jems_available proc far + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + mov ax,3567h ; get interrupt vector 67h + int 21h + push cs + pop ds + mov di,000ah ; check offs 10 in returned seg + lea si,ASCII_device_name ; against literal string + mov cx,8 + cld + repe cmpsb + jne no_ems + mov ax,1 ; match, it's there + jmp short avail_done +no_ems: xor ax,ax ; it's not there +avail_done: pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + ret + +ASCII_device_name db "EMMXXXX0" + +_jems_available endp + + +; +; void far jems_calldriver (EMScontext far *) +; +; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers. +; These are loaded, the EMS trap is performed, and the new values of the +; AX,DX,BX registers are written back to the context structure. +; +_jems_calldriver proc far + push bp ; linkage + mov bp,sp + push si ; save all registers for safety + push di + push bx + push cx + push dx + push es + push ds + les bx,dword ptr [bp+6] ; get EMScontext pointer + mov ax,word ptr es:[bx] ; load registers + mov dx,word ptr es:[bx+2] + mov si,word ptr es:[bx+6] + mov ds,word ptr es:[bx+8] + mov bx,word ptr es:[bx+4] + int 67h ; call the EMS driver + mov cx,bx ; save returned BX for a sec + les bx,dword ptr [bp+6] ; get EMScontext pointer + mov word ptr es:[bx],ax ; put back ax,dx,bx + mov word ptr es:[bx+2],dx + mov word ptr es:[bx+4],cx + pop ds ; restore registers and exit + pop es + pop dx + pop cx + pop bx + pop di + pop si + pop bp + ret +_jems_calldriver endp + +JMEMDOSA_TXT ends + + end diff --git a/thirdparty/LibJPEG/jpeg-9/jmemmac.c b/thirdparty/LibJPEG/jpeg-9/jmemmac.c new file mode 100644 index 0000000..106f9be --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemmac.c @@ -0,0 +1,289 @@ +/* + * jmemmac.c + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * jmemmac.c provides an Apple Macintosh implementation of the system- + * dependent portion of the JPEG memory manager. + * + * If you use jmemmac.c, then you must define USE_MAC_MEMMGR in the + * JPEG_INTERNALS part of jconfig.h. + * + * jmemmac.c uses the Macintosh toolbox routines NewPtr and DisposePtr + * instead of malloc and free. It accurately determines the amount of + * memory available by using CompactMem. Notice that if left to its + * own devices, this code can chew up all available space in the + * application's zone, with the exception of the rather small "slop" + * factor computed in jpeg_mem_available(). The application can ensure + * that more space is left over by reducing max_memory_to_use. + * + * Large images are swapped to disk using temporary files and System 7.0+'s + * temporary folder functionality. + * + * Note that jmemmac.c depends on two features of MacOS that were first + * introduced in System 7: FindFolder and the FSSpec-based calls. + * If your application uses jmemmac.c and is run under System 6 or earlier, + * and the jpeg library decides it needs a temporary file, it will abort, + * printing error messages about requiring System 7. (If no temporary files + * are created, it will run fine.) + * + * If you want to use jmemmac.c in an application that might be used with + * System 6 or earlier, then you should remove dependencies on FindFolder + * and the FSSpec calls. You will need to replace FindFolder with some + * other mechanism for finding a place to put temporary files, and you + * should replace the FSSpec calls with their HFS equivalents: + * + * FSpDelete -> HDelete + * FSpGetFInfo -> HGetFInfo + * FSpCreate -> HCreate + * FSpOpenDF -> HOpen *** Note: not HOpenDF *** + * FSMakeFSSpec -> (fill in spec by hand.) + * + * (Use HOpen instead of HOpenDF. HOpen is just a glue-interface to PBHOpen, + * which is on all HFS macs. HOpenDF is a System 7 addition which avoids the + * ages-old problem of names starting with a period.) + * + * Contributed by Sam Bushell (jsam@iagu.on.net) and + * Dan Gildor (gyld@in-touch.com). + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef USE_MAC_MEMMGR /* make sure user got configuration right */ + You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */ +#endif + +#include /* we use the MacOS memory manager */ +#include /* we use the MacOS File stuff */ +#include /* we use the MacOS HFS stuff */ +#include /* for smSystemScript */ +#include /* we use Gestalt to test for specific functionality */ + +#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ +#define TEMP_FILE_NAME "JPG%03d.TMP" +#endif + +static int next_file_num; /* to distinguish among several temp files */ + + +/* + * Memory allocation and freeing are controlled by the MacOS library + * routines NewPtr() and DisposePtr(), which allocate fixed-address + * storage. Unfortunately, the IJG library isn't smart enough to cope + * with relocatable storage. + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) NewPtr(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + DisposePtr((Ptr) object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: we include FAR keywords in the routine declarations simply for + * consistency with the rest of the IJG code; FAR should expand to empty + * on rational architectures like the Mac. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) NewPtr(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + DisposePtr((Ptr) object); +} + + +/* + * This routine computes the total memory space available for allocation. + */ + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + long limit = cinfo->mem->max_memory_to_use - already_allocated; + long slop, mem; + + /* Don't ask for more than what application has told us we may use */ + if (max_bytes_needed > limit && limit > 0) + max_bytes_needed = limit; + /* Find whether there's a big enough free block in the heap. + * CompactMem tries to create a contiguous block of the requested size, + * and then returns the size of the largest free block (which could be + * much more or much less than we asked for). + * We add some slop to ensure we don't use up all available memory. + */ + slop = max_bytes_needed / 16 + 32768L; + mem = CompactMem(max_bytes_needed + slop) - slop; + if (mem < 0) + mem = 0; /* sigh, couldn't even get the slop */ + /* Don't take more than the application says we can have */ + if (mem > limit && limit > 0) + mem = limit; + return mem; +} + + +/* + * Backing store (temporary file) management. + * Backing store objects are only used when the value returned by + * jpeg_mem_available is less than the total space needed. You can dispense + * with these routines if you have plenty of virtual memory; see jmemnobs.c. + */ + + +METHODDEF(void) +read_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + long bytes = byte_count; + long retVal; + + if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr ) + ERREXIT(cinfo, JERR_TFILE_SEEK); + + retVal = FSRead ( info->temp_file, &bytes, + (unsigned char *) buffer_address ); + if ( retVal != noErr || bytes != byte_count ) + ERREXIT(cinfo, JERR_TFILE_READ); +} + + +METHODDEF(void) +write_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + long bytes = byte_count; + long retVal; + + if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr ) + ERREXIT(cinfo, JERR_TFILE_SEEK); + + retVal = FSWrite ( info->temp_file, &bytes, + (unsigned char *) buffer_address ); + if ( retVal != noErr || bytes != byte_count ) + ERREXIT(cinfo, JERR_TFILE_WRITE); +} + + +METHODDEF(void) +close_backing_store (j_common_ptr cinfo, backing_store_ptr info) +{ + FSClose ( info->temp_file ); + FSpDelete ( &(info->tempSpec) ); +} + + +/* + * Initial opening of a backing-store object. + * + * This version uses FindFolder to find the Temporary Items folder, + * and puts the temporary file in there. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + short tmpRef, vRefNum; + long dirID; + FInfo finderInfo; + FSSpec theSpec; + Str255 fName; + OSErr osErr; + long gestaltResponse = 0; + + /* Check that FSSpec calls are available. */ + osErr = Gestalt( gestaltFSAttr, &gestaltResponse ); + if ( ( osErr != noErr ) + || !( gestaltResponse & (1<temp_name, TEMP_FILE_NAME, next_file_num); + strcpy ( (Ptr)fName+1, info->temp_name ); + *fName = strlen (info->temp_name); + osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec ); + + if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr ) + break; + } + + osErr = FSpCreate ( &theSpec, '????', '????', smSystemScript ); + if ( osErr != noErr ) + ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); + + osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(info->temp_file) ); + if ( osErr != noErr ) + ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); + + info->tempSpec = theSpec; + + info->read_backing_store = read_backing_store; + info->write_backing_store = write_backing_store; + info->close_backing_store = close_backing_store; + TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + next_file_num = 0; + + /* max_memory_to_use will be initialized to FreeMem()'s result; + * the calling application might later reduce it, for example + * to leave room to invoke multiple JPEG objects. + * Note that FreeMem returns the total number of free bytes; + * it may not be possible to allocate a single block of this size. + */ + return FreeMem(); +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemmgr.c b/thirdparty/LibJPEG/jpeg-9/jmemmgr.c new file mode 100644 index 0000000..0a137cd --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemmgr.c @@ -0,0 +1,1119 @@ +/* + * jmemmgr.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2011-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the JPEG system-independent memory management + * routines. This code is usable across a wide variety of machines; most + * of the system dependencies have been isolated in a separate file. + * The major functions provided here are: + * * pool-based allocation and freeing of memory; + * * policy decisions about how to divide available memory among the + * virtual arrays; + * * control logic for swapping virtual arrays between main memory and + * backing storage. + * The separate system-dependent file provides the actual backing-storage + * access code, and it contains the policy decision about how much total + * main memory to use. + * This file is system-dependent in the sense that some of its functions + * are unnecessary in some systems. For example, if there is enough virtual + * memory so that backing storage will never be used, much of the virtual + * array control logic could be removed. (Of course, if you have that much + * memory then you shouldn't care about a little bit of unused code...) + */ + +#define JPEG_INTERNALS +#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef NO_GETENV +#ifndef HAVE_STDLIB_H /* should declare getenv() */ +extern char * getenv JPP((const char * name)); +#endif +#endif + + +/* + * Some important notes: + * The allocation routines provided here must never return NULL. + * They should exit to error_exit if unsuccessful. + * + * It's not a good idea to try to merge the sarray and barray routines, + * even though they are textually almost the same, because samples are + * usually stored as bytes while coefficients are shorts or ints. Thus, + * in machines where byte pointers have a different representation from + * word pointers, the resulting machine code could not be the same. + */ + + +/* + * Many machines require storage alignment: longs must start on 4-byte + * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() + * always returns pointers that are multiples of the worst-case alignment + * requirement, and we had better do so too. + * There isn't any really portable way to determine the worst-case alignment + * requirement. This module assumes that the alignment requirement is + * multiples of sizeof(ALIGN_TYPE). + * By default, we define ALIGN_TYPE as double. This is necessary on some + * workstations (where doubles really do need 8-byte alignment) and will work + * fine on nearly everything. If your machine has lesser alignment needs, + * you can save a few bytes by making ALIGN_TYPE smaller. + * The only place I know of where this will NOT work is certain Macintosh + * 680x0 compilers that define double as a 10-byte IEEE extended float. + * Doing 10-byte alignment is counterproductive because longwords won't be + * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have + * such a compiler. + */ + +#ifndef ALIGN_TYPE /* so can override from jconfig.h */ +#define ALIGN_TYPE double +#endif + + +/* + * We allocate objects from "pools", where each pool is gotten with a single + * request to jpeg_get_small() or jpeg_get_large(). There is no per-object + * overhead within a pool, except for alignment padding. Each pool has a + * header with a link to the next pool of the same class. + * Small and large pool headers are identical except that the latter's + * link pointer must be FAR on 80x86 machines. + * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE + * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple + * of the alignment requirement of ALIGN_TYPE. + */ + +typedef union small_pool_struct * small_pool_ptr; + +typedef union small_pool_struct { + struct { + small_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} small_pool_hdr; + +typedef union large_pool_struct FAR * large_pool_ptr; + +typedef union large_pool_struct { + struct { + large_pool_ptr next; /* next in list of pools */ + size_t bytes_used; /* how many bytes already used within pool */ + size_t bytes_left; /* bytes still available in this pool */ + } hdr; + ALIGN_TYPE dummy; /* included in union to ensure alignment */ +} large_pool_hdr; + + +/* + * Here is the full definition of a memory manager object. + */ + +typedef struct { + struct jpeg_memory_mgr pub; /* public fields */ + + /* Each pool identifier (lifetime class) names a linked list of pools. */ + small_pool_ptr small_list[JPOOL_NUMPOOLS]; + large_pool_ptr large_list[JPOOL_NUMPOOLS]; + + /* Since we only have one lifetime class of virtual arrays, only one + * linked list is necessary (for each datatype). Note that the virtual + * array control blocks being linked together are actually stored somewhere + * in the small-pool list. + */ + jvirt_sarray_ptr virt_sarray_list; + jvirt_barray_ptr virt_barray_list; + + /* This counts total space obtained from jpeg_get_small/large */ + long total_space_allocated; + + /* alloc_sarray and alloc_barray set this value for use by virtual + * array routines. + */ + JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ +} my_memory_mgr; + +typedef my_memory_mgr * my_mem_ptr; + + +/* + * The control blocks for virtual arrays. + * Note that these blocks are allocated in the "small" pool area. + * System-dependent info for the associated backing store (if any) is hidden + * inside the backing_store_info struct. + */ + +struct jvirt_sarray_control { + JSAMPARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_sarray_ptr next; /* link to next virtual sarray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + +struct jvirt_barray_control { + JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ + JDIMENSION rows_in_array; /* total virtual array height */ + JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ + JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ + JDIMENSION rows_in_mem; /* height of memory buffer */ + JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ + JDIMENSION cur_start_row; /* first logical row # in the buffer */ + JDIMENSION first_undef_row; /* row # of first uninitialized row */ + boolean pre_zero; /* pre-zero mode requested? */ + boolean dirty; /* do current buffer contents need written? */ + boolean b_s_open; /* is backing-store data valid? */ + jvirt_barray_ptr next; /* link to next virtual barray control block */ + backing_store_info b_s_info; /* System-dependent control info */ +}; + + +#ifdef MEM_STATS /* optional extra stuff for statistics */ + +LOCAL(void) +print_mem_stats (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + + /* Since this is only a debugging stub, we can cheat a little by using + * fprintf directly rather than going through the trace message code. + * This is helpful because message parm array can't handle longs. + */ + fprintf(stderr, "Freeing pool %d, total space = %ld\n", + pool_id, mem->total_space_allocated); + + for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; + lhdr_ptr = lhdr_ptr->hdr.next) { + fprintf(stderr, " Large chunk used %ld\n", + (long) lhdr_ptr->hdr.bytes_used); + } + + for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; + shdr_ptr = shdr_ptr->hdr.next) { + fprintf(stderr, " Small chunk used %ld free %ld\n", + (long) shdr_ptr->hdr.bytes_used, + (long) shdr_ptr->hdr.bytes_left); + } +} + +#endif /* MEM_STATS */ + + +LOCAL(noreturn_t) +out_of_memory (j_common_ptr cinfo, int which) +/* Report an out-of-memory error and stop execution */ +/* If we compiled MEM_STATS support, report alloc requests before dying */ +{ +#ifdef MEM_STATS + cinfo->err->trace_level = 2; /* force self_destruct to report stats */ +#endif + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); +} + + +/* + * Allocation of "small" objects. + * + * For these, we use pooled storage. When a new pool must be created, + * we try to get enough space for the current request plus a "slop" factor, + * where the slop will be the amount of leftover space in the new pool. + * The speed vs. space tradeoff is largely determined by the slop values. + * A different slop value is provided for each pool class (lifetime), + * and we also distinguish the first pool of a class from later ones. + * NOTE: the values given work fairly well on both 16- and 32-bit-int + * machines, but may be too small if longs are 64 bits or more. + */ + +static const size_t first_pool_slop[JPOOL_NUMPOOLS] = +{ + 1600, /* first PERMANENT pool */ + 16000 /* first IMAGE pool */ +}; + +static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = +{ + 0, /* additional PERMANENT pools */ + 5000 /* additional IMAGE pools */ +}; + +#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ + + +METHODDEF(void *) +alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "small" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr hdr_ptr, prev_hdr_ptr; + char * data_ptr; + size_t odd_bytes, min_request, slop; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) + out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* See if space is available in any existing pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + prev_hdr_ptr = NULL; + hdr_ptr = mem->small_list[pool_id]; + while (hdr_ptr != NULL) { + if (hdr_ptr->hdr.bytes_left >= sizeofobject) + break; /* found pool with enough space */ + prev_hdr_ptr = hdr_ptr; + hdr_ptr = hdr_ptr->hdr.next; + } + + /* Time to make a new pool? */ + if (hdr_ptr == NULL) { + /* min_request is what we need now, slop is what will be leftover */ + min_request = sizeofobject + SIZEOF(small_pool_hdr); + if (prev_hdr_ptr == NULL) /* first pool in class? */ + slop = first_pool_slop[pool_id]; + else + slop = extra_pool_slop[pool_id]; + /* Don't ask for more than MAX_ALLOC_CHUNK */ + if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) + slop = (size_t) (MAX_ALLOC_CHUNK-min_request); + /* Try to get space, if fail reduce slop and try again */ + for (;;) { + hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); + if (hdr_ptr != NULL) + break; + slop /= 2; + if (slop < MIN_SLOP) /* give up when it gets real small */ + out_of_memory(cinfo, 2); /* jpeg_get_small failed */ + } + mem->total_space_allocated += min_request + slop; + /* Success, initialize the new pool header and add to end of list */ + hdr_ptr->hdr.next = NULL; + hdr_ptr->hdr.bytes_used = 0; + hdr_ptr->hdr.bytes_left = sizeofobject + slop; + if (prev_hdr_ptr == NULL) /* first pool in class? */ + mem->small_list[pool_id] = hdr_ptr; + else + prev_hdr_ptr->hdr.next = hdr_ptr; + } + + /* OK, allocate the object from the current pool */ + data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ + data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ + hdr_ptr->hdr.bytes_used += sizeofobject; + hdr_ptr->hdr.bytes_left -= sizeofobject; + + return (void *) data_ptr; +} + + +/* + * Allocation of "large" objects. + * + * The external semantics of these are the same as "small" objects, + * except that FAR pointers are used on 80x86. However the pool + * management heuristics are quite different. We assume that each + * request is large enough that it may as well be passed directly to + * jpeg_get_large; the pool management just links everything together + * so that we can free it all on demand. + * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY + * structures. The routines that create these structures (see below) + * deliberately bunch rows together to ensure a large request size. + */ + +METHODDEF(void FAR *) +alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) +/* Allocate a "large" object */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + large_pool_ptr hdr_ptr; + size_t odd_bytes; + + /* Check for unsatisfiable request (do now to ensure no overflow below) */ + if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) + out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ + + /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ + odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); + if (odd_bytes > 0) + sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; + + /* Always make a new pool */ + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + + SIZEOF(large_pool_hdr)); + if (hdr_ptr == NULL) + out_of_memory(cinfo, 4); /* jpeg_get_large failed */ + mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr); + + /* Success, initialize the new pool header and add to list */ + hdr_ptr->hdr.next = mem->large_list[pool_id]; + /* We maintain space counts in each pool header for statistical purposes, + * even though they are not needed for allocation. + */ + hdr_ptr->hdr.bytes_used = sizeofobject; + hdr_ptr->hdr.bytes_left = 0; + mem->large_list[pool_id] = hdr_ptr; + + return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ +} + + +/* + * Creation of 2-D sample arrays. + * The pointers are in near heap, the samples themselves in FAR heap. + * + * To minimize allocation overhead and to allow I/O of large contiguous + * blocks, we allocate the sample rows in groups of as many rows as possible + * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. + * NB: the virtual array control routines, later in this file, know about + * this chunking of rows. The rowsperchunk value is left in the mem manager + * object so that it can be saved away if this sarray is the workspace for + * a virtual array. + */ + +METHODDEF(JSAMPARRAY) +alloc_sarray (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, JDIMENSION numrows) +/* Allocate a 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JSAMPARRAY result; + JSAMPROW workspace; + JDIMENSION rowsperchunk, currow, i; + long ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((long) samplesperrow * SIZEOF(JSAMPLE)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < (long) numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JSAMPARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JSAMPROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JSAMPROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow + * SIZEOF(JSAMPLE))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += samplesperrow; + } + } + + return result; +} + + +/* + * Creation of 2-D coefficient-block arrays. + * This is essentially the same as the code for sample arrays, above. + */ + +METHODDEF(JBLOCKARRAY) +alloc_barray (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, JDIMENSION numrows) +/* Allocate a 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + JBLOCKARRAY result; + JBLOCKROW workspace; + JDIMENSION rowsperchunk, currow, i; + long ltemp; + + /* Calculate max # of rows allowed in one allocation chunk */ + ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / + ((long) blocksperrow * SIZEOF(JBLOCK)); + if (ltemp <= 0) + ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + if (ltemp < (long) numrows) + rowsperchunk = (JDIMENSION) ltemp; + else + rowsperchunk = numrows; + mem->last_rowsperchunk = rowsperchunk; + + /* Get space for row pointers (small object) */ + result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, + (size_t) (numrows * SIZEOF(JBLOCKROW))); + + /* Get the rows themselves (large objects) */ + currow = 0; + while (currow < numrows) { + rowsperchunk = MIN(rowsperchunk, numrows - currow); + workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, + (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow + * SIZEOF(JBLOCK))); + for (i = rowsperchunk; i > 0; i--) { + result[currow++] = workspace; + workspace += blocksperrow; + } + } + + return result; +} + + +/* + * About virtual array management: + * + * The above "normal" array routines are only used to allocate strip buffers + * (as wide as the image, but just a few rows high). Full-image-sized buffers + * are handled as "virtual" arrays. The array is still accessed a strip at a + * time, but the memory manager must save the whole array for repeated + * accesses. The intended implementation is that there is a strip buffer in + * memory (as high as is possible given the desired memory limit), plus a + * backing file that holds the rest of the array. + * + * The request_virt_array routines are told the total size of the image and + * the maximum number of rows that will be accessed at once. The in-memory + * buffer must be at least as large as the maxaccess value. + * + * The request routines create control blocks but not the in-memory buffers. + * That is postponed until realize_virt_arrays is called. At that time the + * total amount of space needed is known (approximately, anyway), so free + * memory can be divided up fairly. + * + * The access_virt_array routines are responsible for making a specific strip + * area accessible (after reading or writing the backing file, if necessary). + * Note that the access routines are told whether the caller intends to modify + * the accessed strip; during a read-only pass this saves having to rewrite + * data to disk. The access routines are also responsible for pre-zeroing + * any newly accessed rows, if pre-zeroing was requested. + * + * In current usage, the access requests are usually for nonoverlapping + * strips; that is, successive access start_row numbers differ by exactly + * num_rows = maxaccess. This means we can get good performance with simple + * buffer dump/reload logic, by making the in-memory buffer be a multiple + * of the access height; then there will never be accesses across bufferload + * boundaries. The code will still work with overlapping access requests, + * but it doesn't handle bufferload overlaps very efficiently. + */ + + +METHODDEF(jvirt_sarray_ptr) +request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION samplesperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D sample array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_sarray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_sarray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->samplesperrow = samplesperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ + mem->virt_sarray_list = result; + + return result; +} + + +METHODDEF(jvirt_barray_ptr) +request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero, + JDIMENSION blocksperrow, JDIMENSION numrows, + JDIMENSION maxaccess) +/* Request a virtual 2-D coefficient-block array */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + jvirt_barray_ptr result; + + /* Only IMAGE-lifetime virtual arrays are currently supported */ + if (pool_id != JPOOL_IMAGE) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + + /* get control block */ + result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, + SIZEOF(struct jvirt_barray_control)); + + result->mem_buffer = NULL; /* marks array not yet realized */ + result->rows_in_array = numrows; + result->blocksperrow = blocksperrow; + result->maxaccess = maxaccess; + result->pre_zero = pre_zero; + result->b_s_open = FALSE; /* no associated backing-store object */ + result->next = mem->virt_barray_list; /* add to list of virtual arrays */ + mem->virt_barray_list = result; + + return result; +} + + +METHODDEF(void) +realize_virt_arrays (j_common_ptr cinfo) +/* Allocate the in-memory buffers for any unrealized virtual arrays */ +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + long space_per_minheight, maximum_space, avail_mem; + long minheights, max_minheights; + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + /* Compute the minimum space needed (maxaccess rows in each buffer) + * and the maximum space needed (full image height in each buffer). + * These may be of use to the system-dependent jpeg_mem_available routine. + */ + space_per_minheight = 0; + maximum_space = 0; + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += (long) sptr->maxaccess * + (long) sptr->samplesperrow * SIZEOF(JSAMPLE); + maximum_space += (long) sptr->rows_in_array * + (long) sptr->samplesperrow * SIZEOF(JSAMPLE); + } + } + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + space_per_minheight += (long) bptr->maxaccess * + (long) bptr->blocksperrow * SIZEOF(JBLOCK); + maximum_space += (long) bptr->rows_in_array * + (long) bptr->blocksperrow * SIZEOF(JBLOCK); + } + } + + if (space_per_minheight <= 0) + return; /* no unrealized arrays, no work */ + + /* Determine amount of memory to actually use; this is system-dependent. */ + avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space, + mem->total_space_allocated); + + /* If the maximum space needed is available, make all the buffers full + * height; otherwise parcel it out with the same number of minheights + * in each buffer. + */ + if (avail_mem >= maximum_space) + max_minheights = 1000000000L; + else { + max_minheights = avail_mem / space_per_minheight; + /* If there doesn't seem to be enough space, try to get the minimum + * anyway. This allows a "stub" implementation of jpeg_mem_available(). + */ + if (max_minheights <= 0) + max_minheights = 1; + } + + /* Allocate the in-memory buffers and initialize backing store as needed. */ + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L; + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + sptr->rows_in_mem = sptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess); + jpeg_open_backing_store(cinfo, & sptr->b_s_info, + (long) sptr->rows_in_array * + (long) sptr->samplesperrow * + (long) SIZEOF(JSAMPLE)); + sptr->b_s_open = TRUE; + } + sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, + sptr->samplesperrow, sptr->rows_in_mem); + sptr->rowsperchunk = mem->last_rowsperchunk; + sptr->cur_start_row = 0; + sptr->first_undef_row = 0; + sptr->dirty = FALSE; + } + } + + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->mem_buffer == NULL) { /* if not realized yet */ + minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L; + if (minheights <= max_minheights) { + /* This buffer fits in memory */ + bptr->rows_in_mem = bptr->rows_in_array; + } else { + /* It doesn't fit in memory, create backing store. */ + bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess); + jpeg_open_backing_store(cinfo, & bptr->b_s_info, + (long) bptr->rows_in_array * + (long) bptr->blocksperrow * + (long) SIZEOF(JBLOCK)); + bptr->b_s_open = TRUE; + } + bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, + bptr->blocksperrow, bptr->rows_in_mem); + bptr->rowsperchunk = mem->last_rowsperchunk; + bptr->cur_start_row = 0; + bptr->first_undef_row = 0; + bptr->dirty = FALSE; + } + } +} + + +LOCAL(void) +do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual sample array */ +{ + long bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = (long) ptr->cur_start_row + i; + rows = MIN(rows, (long) ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, (long) ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + file_offset, byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + file_offset, byte_count); + file_offset += byte_count; + } +} + + +LOCAL(void) +do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing) +/* Do backing store read or write of a virtual coefficient-block array */ +{ + long bytesperrow, file_offset, byte_count, rows, thisrow, i; + + bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK); + file_offset = ptr->cur_start_row * bytesperrow; + /* Loop to read or write each allocation chunk in mem_buffer */ + for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { + /* One chunk, but check for short chunk at end of buffer */ + rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); + /* Transfer no more than is currently defined */ + thisrow = (long) ptr->cur_start_row + i; + rows = MIN(rows, (long) ptr->first_undef_row - thisrow); + /* Transfer no more than fits in file */ + rows = MIN(rows, (long) ptr->rows_in_array - thisrow); + if (rows <= 0) /* this chunk might be past end of file! */ + break; + byte_count = rows * bytesperrow; + if (writing) + (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + file_offset, byte_count); + else + (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, + (void FAR *) ptr->mem_buffer[i], + file_offset, byte_count); + file_offset += byte_count; + } +} + + +METHODDEF(JSAMPARRAY) +access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual sample array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_sarray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_sarray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + FMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +METHODDEF(JBLOCKARRAY) +access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, + JDIMENSION start_row, JDIMENSION num_rows, + boolean writable) +/* Access the part of a virtual block array starting at start_row */ +/* and extending for num_rows rows. writable is true if */ +/* caller intends to modify the accessed area. */ +{ + JDIMENSION end_row = start_row + num_rows; + JDIMENSION undef_row; + + /* debugging check */ + if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || + ptr->mem_buffer == NULL) + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + + /* Make the desired part of the virtual array accessible */ + if (start_row < ptr->cur_start_row || + end_row > ptr->cur_start_row+ptr->rows_in_mem) { + if (! ptr->b_s_open) + ERREXIT(cinfo, JERR_VIRTUAL_BUG); + /* Flush old buffer contents if necessary */ + if (ptr->dirty) { + do_barray_io(cinfo, ptr, TRUE); + ptr->dirty = FALSE; + } + /* Decide what part of virtual array to access. + * Algorithm: if target address > current window, assume forward scan, + * load starting at target address. If target address < current window, + * assume backward scan, load so that target area is top of window. + * Note that when switching from forward write to forward read, will have + * start_row = 0, so the limiting case applies and we load from 0 anyway. + */ + if (start_row > ptr->cur_start_row) { + ptr->cur_start_row = start_row; + } else { + /* use long arithmetic here to avoid overflow & unsigned problems */ + long ltemp; + + ltemp = (long) end_row - (long) ptr->rows_in_mem; + if (ltemp < 0) + ltemp = 0; /* don't fall off front end of file */ + ptr->cur_start_row = (JDIMENSION) ltemp; + } + /* Read in the selected part of the array. + * During the initial write pass, we will do no actual read + * because the selected part is all undefined. + */ + do_barray_io(cinfo, ptr, FALSE); + } + /* Ensure the accessed part of the array is defined; prezero if needed. + * To improve locality of access, we only prezero the part of the array + * that the caller is about to access, not the entire in-memory array. + */ + if (ptr->first_undef_row < end_row) { + if (ptr->first_undef_row < start_row) { + if (writable) /* writer skipped over a section of array */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + undef_row = start_row; /* but reader is allowed to read ahead */ + } else { + undef_row = ptr->first_undef_row; + } + if (writable) + ptr->first_undef_row = end_row; + if (ptr->pre_zero) { + size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); + undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ + end_row -= ptr->cur_start_row; + while (undef_row < end_row) { + FMEMZERO((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); + undef_row++; + } + } else { + if (! writable) /* reader looking at undefined data */ + ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); + } + } + /* Flag the buffer dirty if caller will write in it */ + if (writable) + ptr->dirty = TRUE; + /* Return address of proper part of the buffer */ + return ptr->mem_buffer + (start_row - ptr->cur_start_row); +} + + +/* + * Release all objects belonging to a specified pool. + */ + +METHODDEF(void) +free_pool (j_common_ptr cinfo, int pool_id) +{ + my_mem_ptr mem = (my_mem_ptr) cinfo->mem; + small_pool_ptr shdr_ptr; + large_pool_ptr lhdr_ptr; + size_t space_freed; + + if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) + ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ + +#ifdef MEM_STATS + if (cinfo->err->trace_level > 1) + print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ +#endif + + /* If freeing IMAGE pool, close any virtual arrays first */ + if (pool_id == JPOOL_IMAGE) { + jvirt_sarray_ptr sptr; + jvirt_barray_ptr bptr; + + for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { + if (sptr->b_s_open) { /* there may be no backing store */ + sptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); + } + } + mem->virt_sarray_list = NULL; + for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { + if (bptr->b_s_open) { /* there may be no backing store */ + bptr->b_s_open = FALSE; /* prevent recursive close if error */ + (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); + } + } + mem->virt_barray_list = NULL; + } + + /* Release large objects */ + lhdr_ptr = mem->large_list[pool_id]; + mem->large_list[pool_id] = NULL; + + while (lhdr_ptr != NULL) { + large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; + space_freed = lhdr_ptr->hdr.bytes_used + + lhdr_ptr->hdr.bytes_left + + SIZEOF(large_pool_hdr); + jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); + mem->total_space_allocated -= space_freed; + lhdr_ptr = next_lhdr_ptr; + } + + /* Release small objects */ + shdr_ptr = mem->small_list[pool_id]; + mem->small_list[pool_id] = NULL; + + while (shdr_ptr != NULL) { + small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; + space_freed = shdr_ptr->hdr.bytes_used + + shdr_ptr->hdr.bytes_left + + SIZEOF(small_pool_hdr); + jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); + mem->total_space_allocated -= space_freed; + shdr_ptr = next_shdr_ptr; + } +} + + +/* + * Close up shop entirely. + * Note that this cannot be called unless cinfo->mem is non-NULL. + */ + +METHODDEF(void) +self_destruct (j_common_ptr cinfo) +{ + int pool; + + /* Close all backing store, release all memory. + * Releasing pools in reverse order might help avoid fragmentation + * with some (brain-damaged) malloc libraries. + */ + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + free_pool(cinfo, pool); + } + + /* Release the memory manager control block too. */ + jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); + cinfo->mem = NULL; /* ensures I will be called only once */ + + jpeg_mem_term(cinfo); /* system-dependent cleanup */ +} + + +/* + * Memory manager initialization. + * When this is called, only the error manager pointer is valid in cinfo! + */ + +GLOBAL(void) +jinit_memory_mgr (j_common_ptr cinfo) +{ + my_mem_ptr mem; + long max_to_use; + int pool; + size_t test_mac; + + cinfo->mem = NULL; /* for safety if init fails */ + + /* Check for configuration errors. + * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably + * doesn't reflect any real hardware alignment requirement. + * The test is a little tricky: for X>0, X and X-1 have no one-bits + * in common if and only if X is a power of 2, ie has only one one-bit. + * Some compilers may give an "unreachable code" warning here; ignore it. + */ + if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) + ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); + /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be + * a multiple of SIZEOF(ALIGN_TYPE). + * Again, an "unreachable code" warning may be ignored here. + * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. + */ + test_mac = (size_t) MAX_ALLOC_CHUNK; + if ((long) test_mac != MAX_ALLOC_CHUNK || + (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) + ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); + + max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ + + /* Attempt to allocate memory manager's control block */ + mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); + + if (mem == NULL) { + jpeg_mem_term(cinfo); /* system-dependent cleanup */ + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); + } + + /* OK, fill in the method pointers */ + mem->pub.alloc_small = alloc_small; + mem->pub.alloc_large = alloc_large; + mem->pub.alloc_sarray = alloc_sarray; + mem->pub.alloc_barray = alloc_barray; + mem->pub.request_virt_sarray = request_virt_sarray; + mem->pub.request_virt_barray = request_virt_barray; + mem->pub.realize_virt_arrays = realize_virt_arrays; + mem->pub.access_virt_sarray = access_virt_sarray; + mem->pub.access_virt_barray = access_virt_barray; + mem->pub.free_pool = free_pool; + mem->pub.self_destruct = self_destruct; + + /* Make MAX_ALLOC_CHUNK accessible to other modules */ + mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK; + + /* Initialize working state */ + mem->pub.max_memory_to_use = max_to_use; + + for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { + mem->small_list[pool] = NULL; + mem->large_list[pool] = NULL; + } + mem->virt_sarray_list = NULL; + mem->virt_barray_list = NULL; + + mem->total_space_allocated = SIZEOF(my_memory_mgr); + + /* Declare ourselves open for business */ + cinfo->mem = & mem->pub; + + /* Check for an environment variable JPEGMEM; if found, override the + * default max_memory setting from jpeg_mem_init. Note that the + * surrounding application may again override this value. + * If your system doesn't support getenv(), define NO_GETENV to disable + * this feature. + */ +#ifndef NO_GETENV + { char * memenv; + + if ((memenv = getenv("JPEGMEM")) != NULL) { + char ch = 'x'; + + if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { + if (ch == 'm' || ch == 'M') + max_to_use *= 1000L; + mem->pub.max_memory_to_use = max_to_use * 1000L; + } + } + } +#endif + +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemname.c b/thirdparty/LibJPEG/jpeg-9/jmemname.c new file mode 100644 index 0000000..ed96dee --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemname.c @@ -0,0 +1,276 @@ +/* + * jmemname.c + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a generic implementation of the system-dependent + * portion of the JPEG memory manager. This implementation assumes that + * you must explicitly construct a name for each temp file. + * Also, the problem of determining the amount of memory available + * is shoved onto the user. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + +#ifndef SEEK_SET /* pre-ANSI systems may not define this; */ +#define SEEK_SET 0 /* if not, assume 0 is correct */ +#endif + +#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ +#define READ_BINARY "r" +#define RW_BINARY "w+" +#else +#ifdef VMS /* VMS is very nonstandard */ +#define READ_BINARY "rb", "ctx=stm" +#define RW_BINARY "w+b", "ctx=stm" +#else /* standard ANSI-compliant case */ +#define READ_BINARY "rb" +#define RW_BINARY "w+b" +#endif +#endif + + +/* + * Selection of a file name for a temporary file. + * This is system-dependent! + * + * The code as given is suitable for most Unix systems, and it is easily + * modified for most non-Unix systems. Some notes: + * 1. The temp file is created in the directory named by TEMP_DIRECTORY. + * The default value is /usr/tmp, which is the conventional place for + * creating large temp files on Unix. On other systems you'll probably + * want to change the file location. You can do this by editing the + * #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h. + * + * 2. If you need to change the file name as well as its location, + * you can override the TEMP_FILE_NAME macro. (Note that this is + * actually a printf format string; it must contain %s and %d.) + * Few people should need to do this. + * + * 3. mktemp() is used to ensure that multiple processes running + * simultaneously won't select the same file names. If your system + * doesn't have mktemp(), define NO_MKTEMP to do it the hard way. + * (If you don't have , also define NO_ERRNO_H.) + * + * 4. You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c + * will cause the temp files to be removed if you stop the program early. + */ + +#ifndef TEMP_DIRECTORY /* can override from jconfig.h or Makefile */ +#define TEMP_DIRECTORY "/usr/tmp/" /* recommended setting for Unix */ +#endif + +static int next_file_num; /* to distinguish among several temp files */ + +#ifdef NO_MKTEMP + +#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ +#define TEMP_FILE_NAME "%sJPG%03d.TMP" +#endif + +#ifndef NO_ERRNO_H +#include /* to define ENOENT */ +#endif + +/* ANSI C specifies that errno is a macro, but on older systems it's more + * likely to be a plain int variable. And not all versions of errno.h + * bother to declare it, so we have to in order to be most portable. Thus: + */ +#ifndef errno +extern int errno; +#endif + + +LOCAL(void) +select_file_name (char * fname) +{ + FILE * tfile; + + /* Keep generating file names till we find one that's not in use */ + for (;;) { + next_file_num++; /* advance counter */ + sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); + if ((tfile = fopen(fname, READ_BINARY)) == NULL) { + /* fopen could have failed for a reason other than the file not + * being there; for example, file there but unreadable. + * If isn't available, then we cannot test the cause. + */ +#ifdef ENOENT + if (errno != ENOENT) + continue; +#endif + break; + } + fclose(tfile); /* oops, it's there; close tfile & try again */ + } +} + +#else /* ! NO_MKTEMP */ + +/* Note that mktemp() requires the initial filename to end in six X's */ +#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ +#define TEMP_FILE_NAME "%sJPG%dXXXXXX" +#endif + +LOCAL(void) +select_file_name (char * fname) +{ + next_file_num++; /* advance counter */ + sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); + mktemp(fname); /* make sure file name is unique */ + /* mktemp replaces the trailing XXXXXX with a unique string of characters */ +} + +#endif /* NO_MKTEMP */ + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * It's impossible to do this in a portable way; our current solution is + * to make the user tell us (with a default value set at compile time). + * If you can actually get the available space, it's a good idea to subtract + * a slop factor of 5% or so. + */ + +#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ +#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */ +#endif + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return cinfo->mem->max_memory_to_use - already_allocated; +} + + +/* + * Backing store (temporary file) management. + * Backing store objects are only used when the value returned by + * jpeg_mem_available is less than the total space needed. You can dispense + * with these routines if you have plenty of virtual memory; see jmemnobs.c. + */ + + +METHODDEF(void) +read_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (fseek(info->temp_file, file_offset, SEEK_SET)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + if (JFREAD(info->temp_file, buffer_address, byte_count) + != (size_t) byte_count) + ERREXIT(cinfo, JERR_TFILE_READ); +} + + +METHODDEF(void) +write_backing_store (j_common_ptr cinfo, backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count) +{ + if (fseek(info->temp_file, file_offset, SEEK_SET)) + ERREXIT(cinfo, JERR_TFILE_SEEK); + if (JFWRITE(info->temp_file, buffer_address, byte_count) + != (size_t) byte_count) + ERREXIT(cinfo, JERR_TFILE_WRITE); +} + + +METHODDEF(void) +close_backing_store (j_common_ptr cinfo, backing_store_ptr info) +{ + fclose(info->temp_file); /* close the file */ + unlink(info->temp_name); /* delete the file */ +/* If your system doesn't have unlink(), use remove() instead. + * remove() is the ANSI-standard name for this function, but if + * your system was ANSI you'd be using jmemansi.c, right? + */ + TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name); +} + + +/* + * Initial opening of a backing-store object. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + select_file_name(info->temp_name); + if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL) + ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); + info->read_backing_store = read_backing_store; + info->write_backing_store = write_backing_store; + info->close_backing_store = close_backing_store; + TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + next_file_num = 0; /* initialize temp file name generator */ + return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemnobs.c b/thirdparty/LibJPEG/jpeg-9/jmemnobs.c new file mode 100644 index 0000000..eb8c337 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemnobs.c @@ -0,0 +1,109 @@ +/* + * jmemnobs.c + * + * Copyright (C) 1992-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides a really simple implementation of the system- + * dependent portion of the JPEG memory manager. This implementation + * assumes that no backing-store files are needed: all required space + * can be obtained from malloc(). + * This is very portable in the sense that it'll compile on almost anything, + * but you'd better have lots of main memory (or virtual memory) if you want + * to process big images. + * Note that the max_memory_to_use option is ignored by this implementation. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" +#include "jmemsys.h" /* import the system-dependent declarations */ + +#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ +extern void * malloc JPP((size_t size)); +extern void free JPP((void *ptr)); +#endif + + +/* + * Memory allocation and freeing are controlled by the regular library + * routines malloc() and free(). + */ + +GLOBAL(void *) +jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * "Large" objects are treated the same as "small" ones. + * NB: although we include FAR keywords in the routine declarations, + * this file won't actually work in 80x86 small/medium model; at least, + * you probably won't be able to process useful-size images in only 64KB. + */ + +GLOBAL(void FAR *) +jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) +{ + return (void FAR *) malloc(sizeofobject); +} + +GLOBAL(void) +jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) +{ + free(object); +} + + +/* + * This routine computes the total memory space available for allocation. + * Here we always say, "we got all you want bud!" + */ + +GLOBAL(long) +jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, + long max_bytes_needed, long already_allocated) +{ + return max_bytes_needed; +} + + +/* + * Backing store (temporary file) management. + * Since jpeg_mem_available always promised the moon, + * this should never be called and we can just error out. + */ + +GLOBAL(void) +jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, + long total_bytes_needed) +{ + ERREXIT(cinfo, JERR_NO_BACKING_STORE); +} + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. Here, there isn't any. + */ + +GLOBAL(long) +jpeg_mem_init (j_common_ptr cinfo) +{ + return 0; /* just set max_memory_to_use to 0 */ +} + +GLOBAL(void) +jpeg_mem_term (j_common_ptr cinfo) +{ + /* no work */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jmemsys.h b/thirdparty/LibJPEG/jpeg-9/jmemsys.h new file mode 100644 index 0000000..6c3c6d3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmemsys.h @@ -0,0 +1,198 @@ +/* + * jmemsys.h + * + * Copyright (C) 1992-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This include file defines the interface between the system-independent + * and system-dependent portions of the JPEG memory manager. No other + * modules need include it. (The system-independent portion is jmemmgr.c; + * there are several different versions of the system-dependent portion.) + * + * This file works as-is for the system-dependent memory managers supplied + * in the IJG distribution. You may need to modify it if you write a + * custom memory manager. If system-dependent changes are needed in + * this file, the best method is to #ifdef them based on a configuration + * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR + * and USE_MAC_MEMMGR. + */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_get_small jGetSmall +#define jpeg_free_small jFreeSmall +#define jpeg_get_large jGetLarge +#define jpeg_free_large jFreeLarge +#define jpeg_mem_available jMemAvail +#define jpeg_open_backing_store jOpenBackStore +#define jpeg_mem_init jMemInit +#define jpeg_mem_term jMemTerm +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* + * These two functions are used to allocate and release small chunks of + * memory. (Typically the total amount requested through jpeg_get_small is + * no more than 20K or so; this will be requested in chunks of a few K each.) + * Behavior should be the same as for the standard library functions malloc + * and free; in particular, jpeg_get_small must return NULL on failure. + * On most systems, these ARE malloc and free. jpeg_free_small is passed the + * size of the object being freed, just in case it's needed. + * On an 80x86 machine using small-data memory model, these manage near heap. + */ + +EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); +EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, + size_t sizeofobject)); + +/* + * These two functions are used to allocate and release large chunks of + * memory (up to the total free space designated by jpeg_mem_available). + * The interface is the same as above, except that on an 80x86 machine, + * far pointers are used. On most other machines these are identical to + * the jpeg_get/free_small routines; but we keep them separate anyway, + * in case a different allocation strategy is desirable for large chunks. + */ + +EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, + size_t sizeofobject)); +EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, + size_t sizeofobject)); + +/* + * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may + * be requested in a single call to jpeg_get_large (and jpeg_get_small for that + * matter, but that case should never come into play). This macro is needed + * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. + * On those machines, we expect that jconfig.h will provide a proper value. + * On machines with 32-bit flat address spaces, any large constant may be used. + * + * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type + * size_t and will be a multiple of sizeof(align_type). + */ + +#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ +#define MAX_ALLOC_CHUNK 1000000000L +#endif + +/* + * This routine computes the total space still available for allocation by + * jpeg_get_large. If more space than this is needed, backing store will be + * used. NOTE: any memory already allocated must not be counted. + * + * There is a minimum space requirement, corresponding to the minimum + * feasible buffer sizes; jmemmgr.c will request that much space even if + * jpeg_mem_available returns zero. The maximum space needed, enough to hold + * all working storage in memory, is also passed in case it is useful. + * Finally, the total space already allocated is passed. If no better + * method is available, cinfo->mem->max_memory_to_use - already_allocated + * is often a suitable calculation. + * + * It is OK for jpeg_mem_available to underestimate the space available + * (that'll just lead to more backing-store access than is really necessary). + * However, an overestimate will lead to failure. Hence it's wise to subtract + * a slop factor from the true available space. 5% should be enough. + * + * On machines with lots of virtual memory, any large constant may be returned. + * Conversely, zero may be returned to always use the minimum amount of memory. + */ + +EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, + long min_bytes_needed, + long max_bytes_needed, + long already_allocated)); + + +/* + * This structure holds whatever state is needed to access a single + * backing-store object. The read/write/close method pointers are called + * by jmemmgr.c to manipulate the backing-store object; all other fields + * are private to the system-dependent backing store routines. + */ + +#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ + + +#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ + +typedef unsigned short XMSH; /* type of extended-memory handles */ +typedef unsigned short EMSH; /* type of expanded-memory handles */ + +typedef union { + short file_handle; /* DOS file handle if it's a temp file */ + XMSH xms_handle; /* handle if it's a chunk of XMS */ + EMSH ems_handle; /* handle if it's a chunk of EMS */ +} handle_union; + +#endif /* USE_MSDOS_MEMMGR */ + +#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ +#include +#endif /* USE_MAC_MEMMGR */ + + +typedef struct backing_store_struct * backing_store_ptr; + +typedef struct backing_store_struct { + /* Methods for reading/writing/closing this backing-store object */ + JMETHOD(void, read_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, write_backing_store, (j_common_ptr cinfo, + backing_store_ptr info, + void FAR * buffer_address, + long file_offset, long byte_count)); + JMETHOD(void, close_backing_store, (j_common_ptr cinfo, + backing_store_ptr info)); + + /* Private fields for system-dependent backing-store management */ +#ifdef USE_MSDOS_MEMMGR + /* For the MS-DOS manager (jmemdos.c), we need: */ + handle_union handle; /* reference to backing-store storage object */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else +#ifdef USE_MAC_MEMMGR + /* For the Mac manager (jmemmac.c), we need: */ + short temp_file; /* file reference number to temp file */ + FSSpec tempSpec; /* the FSSpec for the temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ +#else + /* For a typical implementation with temp files, we need: */ + FILE * temp_file; /* stdio reference to temp file */ + char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ +#endif +#endif +} backing_store_info; + + +/* + * Initial opening of a backing-store object. This must fill in the + * read/write/close pointers in the object. The read/write routines + * may take an error exit if the specified maximum file size is exceeded. + * (If jpeg_mem_available always returns a large value, this routine can + * just take an error exit.) + */ + +EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, + backing_store_ptr info, + long total_bytes_needed)); + + +/* + * These routines take care of any system-dependent initialization and + * cleanup required. jpeg_mem_init will be called before anything is + * allocated (and, therefore, nothing in cinfo is of use except the error + * manager pointer). It should return a suitable default value for + * max_memory_to_use; this may subsequently be overridden by the surrounding + * application. (Note that max_memory_to_use is only important if + * jpeg_mem_available chooses to consult it ... no one else will.) + * jpeg_mem_term may assume that all requested memory has been freed and that + * all opened backing-store objects have been closed. + */ + +EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/thirdparty/LibJPEG/jpeg-9/jmorecfg.h b/thirdparty/LibJPEG/jpeg-9/jmorecfg.h new file mode 100644 index 0000000..93b82b3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jmorecfg.h @@ -0,0 +1,392 @@ +/* + * jmorecfg.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 1997-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains additional configuration options that customize the + * JPEG software for special applications or support machine-dependent + * optimizations. Most users will not need to touch this file. + */ + + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ + + +/* + * Maximum number of components (color channels) allowed in JPEG image. + * To meet the letter of the JPEG spec, set this to 255. However, darn + * few applications need more than 4 channels (maybe 5 for CMYK + alpha + * mask). We recommend 10 as a reasonable compromise; use 4 if you are + * really short on memory. (Each allowed component costs a hundred or so + * bytes of storage, whether actually used in an image or not.) + */ + +#define MAX_COMPONENTS 10 /* maximum number of image components */ + + +/* + * Basic data types. + * You may need to change these if you have a machine with unusual data + * type sizes; for example, "char" not 8 bits, "short" not 16 bits, + * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, + * but it had better be at least 16. + */ + +/* Representation of a single sample (pixel element value). + * We frequently allocate large arrays of these, so it's important to keep + * them small. But if you have memory to burn and access to char or short + * arrays is very slow on your hardware, you might want to change these. + */ + +#if BITS_IN_JSAMPLE == 8 +/* JSAMPLE should be the smallest type that will hold the values 0..255. + * You can use a signed char by having GETJSAMPLE mask it with 0xFF. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JSAMPLE; +#ifdef CHAR_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + +#define MAXJSAMPLE 255 +#define CENTERJSAMPLE 128 + +#endif /* BITS_IN_JSAMPLE == 8 */ + + +#if BITS_IN_JSAMPLE == 12 +/* JSAMPLE should be the smallest type that will hold the values 0..4095. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 4095 +#define CENTERJSAMPLE 2048 + +#endif /* BITS_IN_JSAMPLE == 12 */ + + +/* Representation of a DCT frequency coefficient. + * This should be a signed value of at least 16 bits; "short" is usually OK. + * Again, we allocate large arrays of these, but you can change to int + * if you have memory to burn and "short" is really slow. + */ + +typedef short JCOEF; + + +/* Compressed datastreams are represented as arrays of JOCTET. + * These must be EXACTLY 8 bits wide, at least once they are written to + * external storage. Note that when using the stdio data source/destination + * managers, this is also the data type passed to fread/fwrite. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JOCTET; +#define GETJOCTET(value) (value) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JOCTET; +#ifdef CHAR_IS_UNSIGNED +#define GETJOCTET(value) (value) +#else +#define GETJOCTET(value) ((value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + + +/* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special + * extraction code like we did for JSAMPLE. (In other words, these + * typedefs live at a different point on the speed/space tradeoff curve.) + */ + +/* UINT8 must hold at least the values 0..255. */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char UINT8; +#else /* not HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char UINT8; +#else /* not CHAR_IS_UNSIGNED */ +typedef short UINT8; +#endif /* CHAR_IS_UNSIGNED */ +#endif /* HAVE_UNSIGNED_CHAR */ + +/* UINT16 must hold at least the values 0..65535. */ + +#ifdef HAVE_UNSIGNED_SHORT +typedef unsigned short UINT16; +#else /* not HAVE_UNSIGNED_SHORT */ +typedef unsigned int UINT16; +#endif /* HAVE_UNSIGNED_SHORT */ + +/* INT16 must hold at least the values -32768..32767. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ +typedef short INT16; +#endif + +/* INT32 must hold at least signed 32-bit values. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ +#ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ +#ifndef _BASETSD_H /* MinGW is slightly different */ +#ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ +typedef long INT32; +#endif +#endif +#endif +#endif + +/* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore + * "unsigned int" is sufficient on all machines. However, if you need to + * handle larger images and you don't mind deviating from the spec, you + * can change this datatype. + */ + +typedef unsigned int JDIMENSION; + +#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ + + +/* These macros are used in all function definitions and extern declarations. + * You could modify them if you need to change function linkage conventions; + * in particular, you'll need to do that to make the library a Windows DLL. + * Another application is to make all functions global for use with debuggers + * or code profilers that require it. + */ + +/* a function called through method pointers: */ +#define METHODDEF(type) static type +/* a function used only in its module: */ +#define LOCAL(type) static type +/* a function referenced thru EXTERNs: */ +#define GLOBAL(type) type +/* a reference to a GLOBAL function: */ +#define EXTERN(type) extern type + + +/* This macro is used to declare a "method", that is, a function pointer. + * We want to supply prototype parameters if the compiler can cope. + * Note that the arglist parameter must be parenthesized! + * Again, you can customize this if you need special linkage keywords. + */ + +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (*methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (*methodname) () +#endif + + +/* The noreturn type identifier is used to declare functions + * which cannot return. + * Compilers can thus create more optimized code and perform + * better checks for warnings and errors. + * Static analyzer tools can make improved inferences about + * execution paths and are prevented from giving false alerts. + * + * Unfortunately, the proposed specifications of corresponding + * extensions in the Dec 2011 ISO C standard revision (C11), + * GCC, MSVC, etc. are not viable. + * Thus we introduce a user defined type to declare noreturn + * functions at least for clarity. A proper compiler would + * have a suitable noreturn type to match in place of void. + */ + +#ifndef HAVE_NORETURN_T +typedef void noreturn_t; +#endif + + +/* Here is the pseudo-keyword for declaring pointers that must be "far" + * on 80x86 machines. Most of the specialized coding for 80x86 is handled + * by just saying "FAR *" where such a pointer is needed. In a few places + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. + */ + +#ifndef FAR +#ifdef NEED_FAR_POINTERS +#define FAR far +#else +#define FAR +#endif +#endif + + +/* + * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * in standard header files. Or you may have conflicts with application- + * specific header files that you want to include together with these files. + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. + */ + +#ifdef HAVE_BOOLEAN +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif +#else +#undef TRUE +#undef FALSE +typedef enum { FALSE = 0, TRUE = 1 } boolean; +#endif + + +/* + * The remaining options affect code selection within the JPEG library, + * but they don't need to be visible to most applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. + */ + +#ifdef JPEG_INTERNALS +#define JPEG_INTERNAL_OPTIONS +#endif + +#ifdef JPEG_INTERNAL_OPTIONS + + +/* + * These defines indicate whether to include various optional functions. + * Undefining some of these symbols will produce a smaller but less capable + * library. Note that you can leave certain source files out of the + * compilation/linking process if you've #undef'd the corresponding symbols. + * (You may HAVE to do that if your compiler doesn't like null source files.) + */ + +/* Capability options common to encoder and decoder: */ + +#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ +#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ +#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ + +/* Encoder capability options: */ + +#define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ +#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ +/* Note: if you selected 12-bit data precision, it is dangerous to turn off + * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit + * precision, so jchuff.c normally uses entropy optimization to compute + * usable tables for higher precision. If you don't want to do optimization, + * you'll have to supply different default Huffman tables. + * The exact same statements apply for progressive JPEG: the default tables + * don't work for progressive mode. (This may get fixed, however.) + */ +#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ + +/* Decoder capability options: */ + +#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ +#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ +#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ +#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ +#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ + +/* more capability options later, no doubt */ + + +/* + * Ordering of RGB data in scanlines passed to or from the application. + * If your application wants to deal with data in the order B,G,R, just + * change these macros. You can also deal with formats such as R,G,B,X + * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing + * the offsets will also change the order in which colormap data is organized. + * RESTRICTIONS: + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. + * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE + * is not 3 (they don't understand about dummy color components!). So you + * can't use color quantization if you change that value. + */ + +#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ +#define RGB_GREEN 1 /* Offset of Green */ +#define RGB_BLUE 2 /* Offset of Blue */ +#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ + + +/* Definitions for speed-related optimizations. */ + + +/* If your compiler supports inline functions, define INLINE + * as the inline keyword; otherwise define it as empty. + */ + +#ifndef INLINE +#ifdef __GNUC__ /* for instance, GNU C knows about inline */ +#define INLINE __inline__ +#endif +#ifndef INLINE +#define INLINE /* default is to define it as empty */ +#endif +#endif + + +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying + * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER + * as short on such a machine. MULTIPLIER must be at least 16 bits wide. + */ + +#ifndef MULTIPLIER +#define MULTIPLIER int /* type for fastest integer multiply */ +#endif + + +/* FAST_FLOAT should be either float or double, whichever is done faster + * by your compiler. (Note that this type is only used in the floating point + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) + * Typically, float is faster in ANSI C compilers, while double is faster in + * pre-ANSI compilers (because they insist on converting to double anyway). + * The code below therefore chooses float if we have ANSI-style prototypes. + */ + +#ifndef FAST_FLOAT +#ifdef HAVE_PROTOTYPES +#define FAST_FLOAT float +#else +#define FAST_FLOAT double +#endif +#endif + +#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/thirdparty/LibJPEG/jpeg-9/jpegint.h b/thirdparty/LibJPEG/jpeg-9/jpegint.h new file mode 100644 index 0000000..c0d5c14 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jpegint.h @@ -0,0 +1,426 @@ +/* + * jpegint.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 1997-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file provides common declarations for the various JPEG modules. + * These declarations are considered internal to the JPEG library; most + * applications using the library shouldn't need to include this file. + */ + + +/* Declarations for both compression & decompression */ + +typedef enum { /* Operating modes for buffer controllers */ + JBUF_PASS_THRU, /* Plain stripwise operation */ + /* Remaining modes require a full-image buffer to have been created */ + JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ + JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ + JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ +} J_BUF_MODE; + +/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ +#define CSTATE_START 100 /* after create_compress */ +#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ +#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ +#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ +#define DSTATE_START 200 /* after create_decompress */ +#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ +#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ +#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ +#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ +#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ +#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ +#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ +#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ +#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ +#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ + + +/* Declarations for compression modules */ + +/* Master control module */ +struct jpeg_comp_master { + JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); + JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); + JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean call_pass_startup; /* True if pass_startup must be called */ + boolean is_last_pass; /* True during last pass */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_c_main_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail)); +}; + +/* Compression preprocessing (downsampling input buffer control) */ +struct jpeg_c_prep_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, + JDIMENSION *in_row_ctr, + JDIMENSION in_rows_avail, + JSAMPIMAGE output_buf, + JDIMENSION *out_row_group_ctr, + JDIMENSION out_row_groups_avail)); +}; + +/* Coefficient buffer control */ +struct jpeg_c_coef_controller { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(boolean, compress_data, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf)); +}; + +/* Colorspace conversion */ +struct jpeg_color_converter { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, color_convert, (j_compress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows)); +}; + +/* Downsampling */ +struct jpeg_downsampler { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + JMETHOD(void, downsample, (j_compress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION in_row_index, + JSAMPIMAGE output_buf, + JDIMENSION out_row_group_index)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Forward DCT (also controls coefficient quantization) */ +typedef JMETHOD(void, forward_DCT_ptr, + (j_compress_ptr cinfo, jpeg_component_info * compptr, + JSAMPARRAY sample_data, JBLOCKROW coef_blocks, + JDIMENSION start_row, JDIMENSION start_col, + JDIMENSION num_blocks)); + +struct jpeg_forward_dct { + JMETHOD(void, start_pass, (j_compress_ptr cinfo)); + /* It is useful to allow each component to have a separate FDCT method. */ + forward_DCT_ptr forward_DCT[MAX_COMPONENTS]; +}; + +/* Entropy encoding */ +struct jpeg_entropy_encoder { + JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics)); + JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data)); + JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); +}; + +/* Marker writing */ +struct jpeg_marker_writer { + JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); + JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); + JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); + /* These routines are exported to allow insertion of extra markers */ + /* Probably only COM and APPn markers should be written this way */ + JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, + unsigned int datalen)); + JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); +}; + + +/* Declarations for decompression modules */ + +/* Master control module */ +struct jpeg_decomp_master { + JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ +}; + +/* Input control module */ +struct jpeg_input_controller { + JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); + JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); + + /* State variables made visible to other modules */ + boolean has_multiple_scans; /* True if file has multiple scans */ + boolean eoi_reached; /* True when EOI has been consumed */ +}; + +/* Main buffer control (downsampled-data buffer) */ +struct jpeg_d_main_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, process_data, (j_decompress_ptr cinfo, + JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Coefficient buffer control */ +struct jpeg_d_coef_controller { + JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); + JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); + JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, + JSAMPIMAGE output_buf)); + /* Pointer to array of coefficient virtual arrays, or NULL if none */ + jvirt_barray_ptr *coef_arrays; +}; + +/* Decompression postprocessing (color quantization buffer control) */ +struct jpeg_d_post_controller { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); + JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); +}; + +/* Marker reading & parsing */ +struct jpeg_marker_reader { + JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); + /* Read markers until SOS or EOI. + * Returns same codes as are defined for jpeg_consume_input: + * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. + */ + JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); + /* Read a restart marker --- exported for use by entropy decoder only */ + jpeg_marker_parser_method read_restart_marker; + + /* State of marker reader --- nominally internal, but applications + * supplying COM or APPn handlers might like to know the state. + */ + boolean saw_SOI; /* found SOI? */ + boolean saw_SOF; /* found SOF? */ + int next_restart_num; /* next restart number expected (0-7) */ + unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ +}; + +/* Entropy decoding */ +struct jpeg_entropy_decoder { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, + JBLOCKROW *MCU_data)); +}; + +/* Inverse DCT (also performs dequantization) */ +typedef JMETHOD(void, inverse_DCT_method_ptr, + (j_decompress_ptr cinfo, jpeg_component_info * compptr, + JCOEFPTR coef_block, + JSAMPARRAY output_buf, JDIMENSION output_col)); + +struct jpeg_inverse_dct { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + /* It is useful to allow each component to have a separate IDCT method. */ + inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; +}; + +/* Upsampling (note that upsampler must also call color converter) */ +struct jpeg_upsampler { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, upsample, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, + JDIMENSION *in_row_group_ctr, + JDIMENSION in_row_groups_avail, + JSAMPARRAY output_buf, + JDIMENSION *out_row_ctr, + JDIMENSION out_rows_avail)); + + boolean need_context_rows; /* TRUE if need rows above & below */ +}; + +/* Colorspace conversion */ +struct jpeg_color_deconverter { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, color_convert, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows)); +}; + +/* Color quantization or color precision reduction */ +struct jpeg_color_quantizer { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan)); + JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, + int num_rows)); + JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); +}; + + +/* Miscellaneous useful macros */ + +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jinit_compress_master jICompress +#define jinit_c_master_control jICMaster +#define jinit_c_main_controller jICMainC +#define jinit_c_prep_controller jICPrepC +#define jinit_c_coef_controller jICCoefC +#define jinit_color_converter jICColor +#define jinit_downsampler jIDownsampler +#define jinit_forward_dct jIFDCT +#define jinit_huff_encoder jIHEncoder +#define jinit_arith_encoder jIAEncoder +#define jinit_marker_writer jIMWriter +#define jinit_master_decompress jIDMaster +#define jinit_d_main_controller jIDMainC +#define jinit_d_coef_controller jIDCoefC +#define jinit_d_post_controller jIDPostC +#define jinit_input_controller jIInCtlr +#define jinit_marker_reader jIMReader +#define jinit_huff_decoder jIHDecoder +#define jinit_arith_decoder jIADecoder +#define jinit_inverse_dct jIIDCT +#define jinit_upsampler jIUpsampler +#define jinit_color_deconverter jIDColor +#define jinit_1pass_quantizer jI1Quant +#define jinit_2pass_quantizer jI2Quant +#define jinit_merged_upsampler jIMUpsampler +#define jinit_memory_mgr jIMemMgr +#define jdiv_round_up jDivRound +#define jround_up jRound +#define jzero_far jZeroFar +#define jcopy_sample_rows jCopySamples +#define jcopy_block_row jCopyBlocks +#define jpeg_zigzag_order jZIGTable +#define jpeg_natural_order jZAGTable +#define jpeg_natural_order7 jZAG7Table +#define jpeg_natural_order6 jZAG6Table +#define jpeg_natural_order5 jZAG5Table +#define jpeg_natural_order4 jZAG4Table +#define jpeg_natural_order3 jZAG3Table +#define jpeg_natural_order2 jZAG2Table +#define jpeg_aritab jAriTab +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays + * and coefficient-block arrays. This won't work on 80x86 because the arrays + * are FAR and we're assuming a small-pointer memory model. However, some + * DOS compilers provide far-pointer versions of memcpy() and memset() even + * in the small-model libraries. These will be used if USE_FMEM is defined. + * Otherwise, the routines in jutils.c do it the hard way. + */ + +#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */ +#define FMEMZERO(target,size) MEMZERO(target,size) +#else /* 80x86 case */ +#ifdef USE_FMEM +#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) +#else +EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); +#define FMEMZERO(target,size) jzero_far(target, size) +#endif +#endif + + +/* Compression module initialization routines */ +EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, + boolean transcode_only)); +EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo)); +EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); +/* Decompression module initialization routines */ +EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, + boolean need_full_buffer)); +EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); +EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); +/* Memory manager initialization */ +EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); + +/* Utility routines in jutils.c */ +EXTERN(long) jdiv_round_up JPP((long a, long b)); +EXTERN(long) jround_up JPP((long a, long b)); +EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols)); +EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks)); +/* Constant tables in jutils.c */ +#if 0 /* This table is not actually needed in v6a */ +extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ +#endif +extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ +extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */ +extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */ +extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */ +extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */ +extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */ +extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */ + +/* Arithmetic coding probability estimation tables in jaricom.c */ +extern const INT32 jpeg_aritab[]; + +/* Suppress undefined-structure complaints if necessary. */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +#endif +#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/thirdparty/LibJPEG/jpeg-9/jpeglib.h b/thirdparty/LibJPEG/jpeg-9/jpeglib.h new file mode 100644 index 0000000..0a6dac4 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jpeglib.h @@ -0,0 +1,1173 @@ +/* + * jpeglib.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * Modified 2002-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the application interface for the JPEG library. + * Most applications using the library need only include this file, + * and perhaps jerror.h if they want to know the exact error codes. + */ + +#ifndef JPEGLIB_H +#define JPEGLIB_H + +/* + * First we include the configuration files that record how this + * installation of the JPEG library is set up. jconfig.h can be + * generated automatically for many systems. jmorecfg.h contains + * manual configuration options that most people need not worry about. + */ + +#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ +#include "jconfig.h" /* widely used configuration options */ +#endif +#include "jmorecfg.h" /* seldom changed options */ + + +#ifdef __cplusplus +#ifndef DONT_USE_EXTERN_C +extern "C" { +#endif +#endif + +/* Version IDs for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 90". + */ + +#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ +#define JPEG_LIB_VERSION_MAJOR 9 +#define JPEG_LIB_VERSION_MINOR 0 + + +/* Various constants determining the sizes of things. + * All of these are specified by the JPEG standard, so don't change them + * if you want to be compatible. + */ + +#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ +#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ +#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ +#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ +#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ +#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; + * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. + * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU + * to handle it. We even let you do this from the jconfig.h file. However, + * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe + * sometimes emits noncompliant files doesn't mean you should too. + */ +#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ +#ifndef D_MAX_BLOCKS_IN_MCU +#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ +#endif + + +/* Data structures for images (arrays of samples and of DCT coefficients). + * On 80x86 machines, the image arrays are too big for near pointers, + * but the pointer arrays can fit in near memory. + */ + +typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ +typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ +typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + +typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ +typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ +typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ +typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ + +typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ + + +/* Types for JPEG compression parameters and working tables. */ + + +/* DCT coefficient quantization tables. */ + +typedef struct { + /* This array gives the coefficient quantizers in natural array order + * (not the zigzag order in which they are stored in a JPEG DQT marker). + * CAUTION: IJG versions prior to v6a kept this array in zigzag order. + */ + UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JQUANT_TBL; + + +/* Huffman coding tables. */ + +typedef struct { + /* These two fields directly represent the contents of a JPEG DHT marker */ + UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ + /* length k bits; bits[0] is unused */ + UINT8 huffval[256]; /* The symbols, in order of incr code length */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JHUFF_TBL; + + +/* Basic info about one component (color channel). */ + +typedef struct { + /* These values are fixed over the whole image. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOF marker. */ + int component_id; /* identifier for this component (0..255) */ + int component_index; /* its index in SOF or cinfo->comp_info[] */ + int h_samp_factor; /* horizontal sampling factor (1..4) */ + int v_samp_factor; /* vertical sampling factor (1..4) */ + int quant_tbl_no; /* quantization table selector (0..3) */ + /* These values may vary between scans. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOS marker. */ + /* The decompressor output side may not use these variables. */ + int dc_tbl_no; /* DC entropy table selector (0..3) */ + int ac_tbl_no; /* AC entropy table selector (0..3) */ + + /* Remaining fields should be treated as private by applications. */ + + /* These values are computed during compression or decompression startup: */ + /* Component's size in DCT blocks. + * Any dummy blocks added to complete an MCU are not counted; therefore + * these values do not depend on whether a scan is interleaved or not. + */ + JDIMENSION width_in_blocks; + JDIMENSION height_in_blocks; + /* Size of a DCT block in samples, + * reflecting any scaling we choose to apply during the DCT step. + * Values from 1 to 16 are supported. + * Note that different components may receive different DCT scalings. + */ + int DCT_h_scaled_size; + int DCT_v_scaled_size; + /* The downsampled dimensions are the component's actual, unpadded number + * of samples at the main buffer (preprocessing/compression interface); + * DCT scaling is included, so + * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) + * and similarly for height. + */ + JDIMENSION downsampled_width; /* actual width in samples */ + JDIMENSION downsampled_height; /* actual height in samples */ + /* This flag is used only for decompression. In cases where some of the + * components will be ignored (eg grayscale output from YCbCr image), + * we can skip most computations for the unused components. + */ + boolean component_needed; /* do we need the value of this component? */ + + /* These values are computed before starting a scan of the component. */ + /* The decompressor output side may not use these variables. */ + int MCU_width; /* number of blocks per MCU, horizontally */ + int MCU_height; /* number of blocks per MCU, vertically */ + int MCU_blocks; /* MCU_width * MCU_height */ + int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */ + int last_col_width; /* # of non-dummy blocks across in last MCU */ + int last_row_height; /* # of non-dummy blocks down in last MCU */ + + /* Saved quantization table for component; NULL if none yet saved. + * See jdinput.c comments about the need for this information. + * This field is currently used only for decompression. + */ + JQUANT_TBL * quant_table; + + /* Private per-component storage for DCT or IDCT subsystem. */ + void * dct_table; +} jpeg_component_info; + + +/* The script for encoding a multiple-scan file is an array of these: */ + +typedef struct { + int comps_in_scan; /* number of components encoded in this scan */ + int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ + int Ss, Se; /* progressive JPEG spectral selection parms */ + int Ah, Al; /* progressive JPEG successive approx. parms */ +} jpeg_scan_info; + +/* The decompressor can save APPn and COM markers in a list of these: */ + +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; + +struct jpeg_marker_struct { + jpeg_saved_marker_ptr next; /* next in list, or NULL */ + UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ + unsigned int original_length; /* # bytes of data in the file */ + unsigned int data_length; /* # bytes of data saved at data[] */ + JOCTET FAR * data; /* the data contained in the marker */ + /* the marker length word is not counted in data_length or original_length */ +}; + +/* Known color spaces. */ + +typedef enum { + JCS_UNKNOWN, /* error/unspecified */ + JCS_GRAYSCALE, /* monochrome */ + JCS_RGB, /* red/green/blue */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_CMYK, /* C/M/Y/K */ + JCS_YCCK /* Y/Cb/Cr/K */ +} J_COLOR_SPACE; + +/* Supported color transforms. */ + +typedef enum { + JCT_NONE = 0, + JCT_SUBTRACT_GREEN = 1 +} J_COLOR_TRANSFORM; + +/* DCT/IDCT algorithm options. */ + +typedef enum { + JDCT_ISLOW, /* slow but accurate integer algorithm */ + JDCT_IFAST, /* faster, less accurate integer method */ + JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ +} J_DCT_METHOD; + +#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ +#define JDCT_DEFAULT JDCT_ISLOW +#endif +#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ +#define JDCT_FASTEST JDCT_IFAST +#endif + +/* Dithering options for decompression. */ + +typedef enum { + JDITHER_NONE, /* no dithering */ + JDITHER_ORDERED, /* simple ordered dither */ + JDITHER_FS /* Floyd-Steinberg error diffusion dither */ +} J_DITHER_MODE; + + +/* Common fields between JPEG compression and decompression master structs. */ + +#define jpeg_common_fields \ + struct jpeg_error_mgr * err; /* Error handler module */\ + struct jpeg_memory_mgr * mem; /* Memory manager module */\ + struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ + void * client_data; /* Available for use by application */\ + boolean is_decompressor; /* So common code can tell which is which */\ + int global_state /* For checking call sequence validity */ + +/* Routines that are to be used by both halves of the library are declared + * to receive a pointer to this structure. There are no actual instances of + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. + */ +struct jpeg_common_struct { + jpeg_common_fields; /* Fields common to both master struct types */ + /* Additional fields follow in an actual jpeg_compress_struct or + * jpeg_decompress_struct. All three structs must agree on these + * initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct jpeg_common_struct * j_common_ptr; +typedef struct jpeg_compress_struct * j_compress_ptr; +typedef struct jpeg_decompress_struct * j_decompress_ptr; + + +/* Master record for a compression instance */ + +struct jpeg_compress_struct { + jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ + + /* Destination for compressed data */ + struct jpeg_destination_mgr * dest; + + /* Description of source image --- these fields must be filled in by + * outer application before starting compression. in_color_space must + * be correct before you can even call jpeg_set_defaults(). + */ + + JDIMENSION image_width; /* input image width */ + JDIMENSION image_height; /* input image height */ + int input_components; /* # of color components in input image */ + J_COLOR_SPACE in_color_space; /* colorspace of input image */ + + double input_gamma; /* image gamma of input image */ + + /* Compression parameters --- these fields must be set before calling + * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to + * initialize everything to reasonable defaults, then changing anything + * the application specifically wants to change. That way you won't get + * burnt when new parameters are added. Also note that there are several + * helper routines to simplify changing parameters. + */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + JDIMENSION jpeg_width; /* scaled JPEG image width */ + JDIMENSION jpeg_height; /* scaled JPEG image height */ + /* Dimensions of actual JPEG image that will be written to file, + * derived from input dimensions by scaling factors above. + * These fields are computed by jpeg_start_compress(). + * You can also use jpeg_calc_jpeg_dimensions() to determine these values + * in advance of calling jpeg_start_compress(). + */ + + int data_precision; /* bits of precision in image data */ + + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + int q_scale_factor[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined, + * and corresponding scale factors (percentage, initialized 100). + */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + int num_scans; /* # of entries in scan_info array */ + const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + /* The default value of scan_info is NULL, which causes a single-scan + * sequential JPEG file to be emitted. To create a multi-scan file, + * set num_scans and scan_info to point to an array of scan definitions. + */ + + boolean raw_data_in; /* TRUE=caller supplies downsampled data */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */ + int smoothing_factor; /* 1..100, or 0 for no input smoothing */ + J_DCT_METHOD dct_method; /* DCT algorithm selector */ + + /* The restart interval can be specified in absolute MCUs by setting + * restart_interval, or in MCU rows by setting restart_in_rows + * (in which case the correct restart_interval will be figured + * for each scan). + */ + unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ + int restart_in_rows; /* if > 0, MCU rows per restart interval */ + + /* Parameters controlling emission of special markers. */ + + boolean write_JFIF_header; /* should a JFIF marker be written? */ + UINT8 JFIF_major_version; /* What to write for the JFIF version number */ + UINT8 JFIF_minor_version; + /* These three values are not used by the JPEG code, merely copied */ + /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ + /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ + /* ratio is defined by X_density/Y_density even when density_unit=0. */ + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean write_Adobe_marker; /* should an Adobe marker be written? */ + + J_COLOR_TRANSFORM color_transform; + /* Color transform identifier, writes LSE marker if nonzero */ + + /* State variable: index of next scanline to be written to + * jpeg_write_scanlines(). Application may use this to control its + * processing loop, e.g., "while (next_scanline < image_height)". + */ + + JDIMENSION next_scanline; /* 0 .. image_height-1 */ + + /* Remaining fields are known throughout compressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during compression startup + */ + boolean progressive_mode; /* TRUE if scan script uses progressive mode */ + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ + int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ + /* The coefficient controller receives data in units of MCU rows as defined + * for fully interleaved scans (whether the JPEG file is interleaved or not). + * There are v_samp_factor * DCTSIZE sample rows of each component in an + * "iMCU" (interleaved MCU) row. + */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int blocks_in_MCU; /* # of DCT blocks per MCU */ + int MCU_membership[C_MAX_BLOCKS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ + + int block_size; /* the basic DCT block size: 1..16 */ + const int * natural_order; /* natural-order position array */ + int lim_Se; /* min( Se, DCTSIZE2-1 ) */ + + /* + * Links to compression subobjects (methods and private variables of modules) + */ + struct jpeg_comp_master * master; + struct jpeg_c_main_controller * main; + struct jpeg_c_prep_controller * prep; + struct jpeg_c_coef_controller * coef; + struct jpeg_marker_writer * marker; + struct jpeg_color_converter * cconvert; + struct jpeg_downsampler * downsample; + struct jpeg_forward_dct * fdct; + struct jpeg_entropy_encoder * entropy; + jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + int script_space_size; +}; + + +/* Master record for a decompression instance */ + +struct jpeg_decompress_struct { + jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ + + /* Source of compressed data */ + struct jpeg_source_mgr * src; + + /* Basic description of image --- filled in by jpeg_read_header(). */ + /* Application may inspect these values to decide how to process image. */ + + JDIMENSION image_width; /* nominal image width (from SOF marker) */ + JDIMENSION image_height; /* nominal image height */ + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + /* Decompression processing parameters --- these fields must be set before + * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes + * them to default values. + */ + + J_COLOR_SPACE out_color_space; /* colorspace for output */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + double output_gamma; /* image gamma wanted in output */ + + boolean buffered_image; /* TRUE=multiple output passes */ + boolean raw_data_out; /* TRUE=downsampled data wanted */ + + J_DCT_METHOD dct_method; /* IDCT algorithm selector */ + boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + + boolean quantize_colors; /* TRUE=colormapped output wanted */ + /* the following are ignored if not quantize_colors: */ + J_DITHER_MODE dither_mode; /* type of color dithering to use */ + boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + int desired_number_of_colors; /* max # colors to use in created colormap */ + /* these are significant only in buffered-image mode: */ + boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ + boolean enable_external_quant;/* enable future use of external colormap */ + boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + + /* Description of actual output image that will be returned to application. + * These fields are computed by jpeg_start_decompress(). + * You can also use jpeg_calc_output_dimensions() to determine these values + * in advance of calling jpeg_start_decompress(). + */ + + JDIMENSION output_width; /* scaled image width */ + JDIMENSION output_height; /* scaled image height */ + int out_color_components; /* # of color components in out_color_space */ + int output_components; /* # of color components returned */ + /* output_components is 1 (a colormap index) when quantizing colors; + * otherwise it equals out_color_components. + */ + int rec_outbuf_height; /* min recommended height of scanline buffer */ + /* If the buffer passed to jpeg_read_scanlines() is less than this many rows + * high, space and time will be wasted due to unnecessary data copying. + * Usually rec_outbuf_height will be 1 or 2, at most 4. + */ + + /* When quantizing colors, the output colormap is described by these fields. + * The application can supply a colormap by setting colormap non-NULL before + * calling jpeg_start_decompress; otherwise a colormap is created during + * jpeg_start_decompress or jpeg_start_output. + * The map has out_color_components rows and actual_number_of_colors columns. + */ + int actual_number_of_colors; /* number of entries in use */ + JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ + + /* State variables: these variables indicate the progress of decompression. + * The application may examine these but must not modify them. + */ + + /* Row index of next scanline to be read from jpeg_read_scanlines(). + * Application may use this to control its processing loop, e.g., + * "while (output_scanline < output_height)". + */ + JDIMENSION output_scanline; /* 0 .. output_height-1 */ + + /* Current input scan number and number of iMCU rows completed in scan. + * These indicate the progress of the decompressor input side. + */ + int input_scan_number; /* Number of SOS markers seen so far */ + JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ + + /* The "output scan number" is the notional scan being displayed by the + * output side. The decompressor will not allow output scan/row number + * to get ahead of input scan/row, but it can fall arbitrarily far behind. + */ + int output_scan_number; /* Nominal scan number being displayed */ + JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ + + /* Current progression status. coef_bits[c][i] indicates the precision + * with which component c's DCT coefficient i (in zigzag order) is known. + * It is -1 when no data has yet been received, otherwise it is the point + * transform (shift) value for the most recent scan of the coefficient + * (thus, 0 at completion of the progression). + * This pointer is NULL when reading a non-progressive file. + */ + int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ + + /* Internal JPEG parameters --- the application usually need not look at + * these fields. Note that the decompressor output side may not use + * any parameters that can change between scans. + */ + + /* Quantization and Huffman tables are carried forward across input + * datastreams when processing abbreviated JPEG datastreams. + */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + /* These parameters are never carried across datastreams, since they + * are given in SOF/SOS markers or defined to be reset by SOI. + */ + + int data_precision; /* bits of precision in image data */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + boolean is_baseline; /* TRUE if Baseline SOF0 encountered */ + boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ + + /* These fields record data obtained from optional markers recognized by + * the JPEG library. + */ + boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + UINT8 JFIF_major_version; /* JFIF version number */ + UINT8 JFIF_minor_version; + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + + J_COLOR_TRANSFORM color_transform; + /* Color transform identifier derived from LSE marker, otherwise zero */ + + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + + /* Aside from the specific data retained from APPn markers known to the + * library, the uninterpreted contents of any or all APPn and COM markers + * can be saved in a list for examination by the application. + */ + jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ + + /* Remaining fields are known throughout decompressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during decompression startup + */ + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */ + int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ + /* The coefficient controller's input and output progress is measured in + * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows + * in fully interleaved JPEG scans, but are used whether the scan is + * interleaved or not. We define an iMCU row as v_samp_factor DCT block + * rows of each component. Therefore, the IDCT output contains + * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row. + */ + + JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + * Note that the decompressor output side must not use these fields. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int blocks_in_MCU; /* # of DCT blocks per MCU */ + int MCU_membership[D_MAX_BLOCKS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ + + /* These fields are derived from Se of first SOS marker. + */ + int block_size; /* the basic DCT block size: 1..16 */ + const int * natural_order; /* natural-order position array for entropy decode */ + int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */ + + /* This field is shared between entropy decoder and marker parser. + * It is either zero or the code of a JPEG marker that has been + * read from the data source, but has not yet been processed. + */ + int unread_marker; + + /* + * Links to decompression subobjects (methods, private variables of modules) + */ + struct jpeg_decomp_master * master; + struct jpeg_d_main_controller * main; + struct jpeg_d_coef_controller * coef; + struct jpeg_d_post_controller * post; + struct jpeg_input_controller * inputctl; + struct jpeg_marker_reader * marker; + struct jpeg_entropy_decoder * entropy; + struct jpeg_inverse_dct * idct; + struct jpeg_upsampler * upsample; + struct jpeg_color_deconverter * cconvert; + struct jpeg_color_quantizer * cquantize; +}; + + +/* "Object" declarations for JPEG modules that may be supplied or called + * directly by the surrounding application. + * As with all objects in the JPEG library, these structs only define the + * publicly visible methods and state variables of a module. Additional + * private fields may exist after the public ones. + */ + + +/* Error handler object */ + +struct jpeg_error_mgr { + /* Error exit handler: does not return to caller */ + JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo)); + /* Conditionally emit a trace or warning message */ + JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); + /* Routine that actually outputs a trace or error message */ + JMETHOD(void, output_message, (j_common_ptr cinfo)); + /* Format a message string for the most recent JPEG error or message */ + JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); +#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ + /* Reset error state variables at start of a new image */ + JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); + + /* The message ID code and any parameters are saved here. + * A message can have one string parameter or up to 8 int parameters. + */ + int msg_code; +#define JMSG_STR_PARM_MAX 80 + union { + int i[8]; + char s[JMSG_STR_PARM_MAX]; + } msg_parm; + + /* Standard state variables for error facility */ + + int trace_level; /* max msg_level that will be displayed */ + + /* For recoverable corrupt-data errors, we emit a warning message, + * but keep going unless emit_message chooses to abort. emit_message + * should count warnings in num_warnings. The surrounding application + * can check for bad data by seeing if num_warnings is nonzero at the + * end of processing. + */ + long num_warnings; /* number of corrupt-data warnings */ + + /* These fields point to the table(s) of error message strings. + * An application can change the table pointer to switch to a different + * message list (typically, to change the language in which errors are + * reported). Some applications may wish to add additional error codes + * that will be handled by the JPEG library error mechanism; the second + * table pointer is used for this purpose. + * + * First table includes all errors generated by JPEG library itself. + * Error code 0 is reserved for a "no such error string" message. + */ + const char * const * jpeg_message_table; /* Library errors */ + int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ + /* Second table can be added by application (see cjpeg/djpeg for example). + * It contains strings numbered first_addon_message..last_addon_message. + */ + const char * const * addon_message_table; /* Non-library errors */ + int first_addon_message; /* code for first string in addon table */ + int last_addon_message; /* code for last string in addon table */ +}; + + +/* Progress monitor object */ + +struct jpeg_progress_mgr { + JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); + + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +}; + + +/* Data destination object for compression */ + +struct jpeg_destination_mgr { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + + JMETHOD(void, init_destination, (j_compress_ptr cinfo)); + JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(void, term_destination, (j_compress_ptr cinfo)); +}; + + +/* Data source object for decompression */ + +struct jpeg_source_mgr { + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + + JMETHOD(void, init_source, (j_decompress_ptr cinfo)); + JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); + JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(void, term_source, (j_decompress_ptr cinfo)); +}; + + +/* Memory manager object. + * Allocates "small" objects (a few K total), "large" objects (tens of K), + * and "really big" objects (virtual arrays with backing store if needed). + * The memory manager does not allow individual objects to be freed; rather, + * each created object is assigned to a pool, and whole pools can be freed + * at once. This is faster and more convenient than remembering exactly what + * to free, especially where malloc()/free() are not too speedy. + * NB: alloc routines never return NULL. They exit to error_exit if not + * successful. + */ + +#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ +#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ +#define JPOOL_NUMPOOLS 2 + +typedef struct jvirt_sarray_control * jvirt_sarray_ptr; +typedef struct jvirt_barray_control * jvirt_barray_ptr; + + +struct jpeg_memory_mgr { + /* Method pointers */ + JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, + JDIMENSION numrows)); + JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, + JDIMENSION numrows)); + JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION samplesperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION blocksperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); + JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, + jvirt_sarray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, + jvirt_barray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); + JMETHOD(void, self_destruct, (j_common_ptr cinfo)); + + /* Limit on memory allocation for this JPEG object. (Note that this is + * merely advisory, not a guaranteed maximum; it only affects the space + * used for virtual-array buffers.) May be changed by outer application + * after creating the JPEG object. + */ + long max_memory_to_use; + + /* Maximum allocation request accepted by alloc_large. */ + long max_alloc_chunk; +}; + + +/* Routine signature for application-supplied marker processing methods. + * Need not pass marker code since it is stored in cinfo->unread_marker. + */ +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); + + +/* Declarations for routines called by application. + * The JPP macro hides prototype parameters from compilers that can't cope. + * Note JPP requires double parentheses. + */ + +#ifdef HAVE_PROTOTYPES +#define JPP(arglist) arglist +#else +#define JPP(arglist) () +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. + * We shorten external names to be unique in the first six letters, which + * is good enough for all known systems. + * (If your compiler itself needs names to be unique in less than 15 + * characters, you are out of luck. Get a better compiler.) + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_error jStdError +#define jpeg_CreateCompress jCreaCompress +#define jpeg_CreateDecompress jCreaDecompress +#define jpeg_destroy_compress jDestCompress +#define jpeg_destroy_decompress jDestDecompress +#define jpeg_stdio_dest jStdDest +#define jpeg_stdio_src jStdSrc +#define jpeg_mem_dest jMemDest +#define jpeg_mem_src jMemSrc +#define jpeg_set_defaults jSetDefaults +#define jpeg_set_colorspace jSetColorspace +#define jpeg_default_colorspace jDefColorspace +#define jpeg_set_quality jSetQuality +#define jpeg_set_linear_quality jSetLQuality +#define jpeg_default_qtables jDefQTables +#define jpeg_add_quant_table jAddQuantTable +#define jpeg_quality_scaling jQualityScaling +#define jpeg_simple_progression jSimProgress +#define jpeg_suppress_tables jSuppressTables +#define jpeg_alloc_quant_table jAlcQTable +#define jpeg_alloc_huff_table jAlcHTable +#define jpeg_start_compress jStrtCompress +#define jpeg_write_scanlines jWrtScanlines +#define jpeg_finish_compress jFinCompress +#define jpeg_calc_jpeg_dimensions jCjpegDimensions +#define jpeg_write_raw_data jWrtRawData +#define jpeg_write_marker jWrtMarker +#define jpeg_write_m_header jWrtMHeader +#define jpeg_write_m_byte jWrtMByte +#define jpeg_write_tables jWrtTables +#define jpeg_read_header jReadHeader +#define jpeg_start_decompress jStrtDecompress +#define jpeg_read_scanlines jReadScanlines +#define jpeg_finish_decompress jFinDecompress +#define jpeg_read_raw_data jReadRawData +#define jpeg_has_multiple_scans jHasMultScn +#define jpeg_start_output jStrtOutput +#define jpeg_finish_output jFinOutput +#define jpeg_input_complete jInComplete +#define jpeg_new_colormap jNewCMap +#define jpeg_consume_input jConsumeInput +#define jpeg_core_output_dimensions jCoreDimensions +#define jpeg_calc_output_dimensions jCalcDimensions +#define jpeg_save_markers jSaveMarkers +#define jpeg_set_marker_processor jSetMarker +#define jpeg_read_coefficients jReadCoefs +#define jpeg_write_coefficients jWrtCoefs +#define jpeg_copy_critical_parameters jCopyCrit +#define jpeg_abort_compress jAbrtCompress +#define jpeg_abort_decompress jAbrtDecompress +#define jpeg_abort jAbort +#define jpeg_destroy jDestroy +#define jpeg_resync_to_restart jResyncRestart +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Default error-management setup */ +EXTERN(struct jpeg_error_mgr *) jpeg_std_error + JPP((struct jpeg_error_mgr * err)); + +/* Initialization of JPEG compression objects. + * jpeg_create_compress() and jpeg_create_decompress() are the exported + * names that applications should call. These expand to calls on + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information + * passed for version mismatch checking. + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. + */ +#define jpeg_create_compress(cinfo) \ + jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_compress_struct)) +#define jpeg_create_decompress(cinfo) \ + jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_decompress_struct)) +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, + int version, size_t structsize)); +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, + int version, size_t structsize)); +/* Destruction of JPEG compression objects */ +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); + +/* Standard data source and destination managers: stdio streams. */ +/* Caller is responsible for opening the file before and closing after. */ +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); + +/* Data source and destination managers: memory buffers. */ +EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, + unsigned char ** outbuffer, + unsigned long * outsize)); +EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, + unsigned char * inbuffer, + unsigned long insize)); + +/* Default parameter setup for compression */ +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); +/* Compression parameter setup aids */ +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, + J_COLOR_SPACE colorspace)); +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, + boolean force_baseline)); +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, + int scale_factor, + boolean force_baseline)); +EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo, + boolean force_baseline)); +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, + boolean force_baseline)); +EXTERN(int) jpeg_quality_scaling JPP((int quality)); +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, + boolean suppress)); +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); + +/* Main entry points for compression */ +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, + boolean write_all_tables)); +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION num_lines)); +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); + +/* Precalculate JPEG dimensions for current compression parameters. */ +EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo)); + +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION num_lines)); + +/* Write a special marker. See libjpeg.txt concerning safe usage. */ +EXTERN(void) jpeg_write_marker + JPP((j_compress_ptr cinfo, int marker, + const JOCTET * dataptr, unsigned int datalen)); +/* Same, but piecemeal. */ +EXTERN(void) jpeg_write_m_header + JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); +EXTERN(void) jpeg_write_m_byte + JPP((j_compress_ptr cinfo, int val)); + +/* Alternate compression function: just write an abbreviated table file */ +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); + +/* Decompression startup: read start of JPEG datastream to see what's there */ +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, + boolean require_image)); +/* Return value is one of: */ +#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ +#define JPEG_HEADER_OK 1 /* Found valid image datastream */ +#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ +/* If you pass require_image = TRUE (normal case), you need not check for + * a TABLES_ONLY return code; an abbreviated file will cause an error exit. + * JPEG_SUSPENDED is only possible if you use a data source module that can + * give a suspension return (the stdio source module doesn't). + */ + +/* Main entry points for decompression */ +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION max_lines)); +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); + +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION max_lines)); + +/* Additional entry points for buffered-image mode. */ +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, + int scan_number)); +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); +/* Return value is one of: */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ +#define JPEG_REACHED_EOI 2 /* Reached end of image */ +#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ +#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ + +/* Precalculate output dimensions for current decompression parameters. */ +EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); + +/* Control saving of COM and APPn markers into marker_list. */ +EXTERN(void) jpeg_save_markers + JPP((j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit)); + +/* Install a special processing method for COM or APPn markers. */ +EXTERN(void) jpeg_set_marker_processor + JPP((j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine)); + +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays)); +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, + j_compress_ptr dstinfo)); + +/* If you choose to abort compression or decompression before completing + * jpeg_finish_(de)compress, then you need to clean up to release memory, + * temporary files, etc. You can just call jpeg_destroy_(de)compress + * if you're done with the JPEG object, but if you want to clean it up and + * reuse it, call this: + */ +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); + +/* Generic versions of jpeg_abort and jpeg_destroy that work on either + * flavor of JPEG object. These may be more convenient in some places. + */ +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); + +/* Default restart-marker-resync procedure for use by data source modules */ +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, + int desired)); + + +/* These marker codes are exported since applications and data source modules + * are likely to want to use them. + */ + +#define JPEG_RST0 0xD0 /* RST0 marker code */ +#define JPEG_EOI 0xD9 /* EOI marker code */ +#define JPEG_APP0 0xE0 /* APP0 marker code */ +#define JPEG_COM 0xFE /* COM marker code */ + + +/* If we have a brain-damaged compiler that emits warnings (or worse, errors) + * for structure definitions that are never filled in, keep it quiet by + * supplying dummy definitions for the various substructures. + */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +struct jpeg_comp_master { long dummy; }; +struct jpeg_c_main_controller { long dummy; }; +struct jpeg_c_prep_controller { long dummy; }; +struct jpeg_c_coef_controller { long dummy; }; +struct jpeg_marker_writer { long dummy; }; +struct jpeg_color_converter { long dummy; }; +struct jpeg_downsampler { long dummy; }; +struct jpeg_forward_dct { long dummy; }; +struct jpeg_entropy_encoder { long dummy; }; +struct jpeg_decomp_master { long dummy; }; +struct jpeg_d_main_controller { long dummy; }; +struct jpeg_d_coef_controller { long dummy; }; +struct jpeg_d_post_controller { long dummy; }; +struct jpeg_input_controller { long dummy; }; +struct jpeg_marker_reader { long dummy; }; +struct jpeg_entropy_decoder { long dummy; }; +struct jpeg_inverse_dct { long dummy; }; +struct jpeg_upsampler { long dummy; }; +struct jpeg_color_deconverter { long dummy; }; +struct jpeg_color_quantizer { long dummy; }; +#endif /* JPEG_INTERNALS */ +#endif /* INCOMPLETE_TYPES_BROKEN */ + + +/* + * The JPEG library modules define JPEG_INTERNALS before including this file. + * The internal structure declarations are read only when that is true. + * Applications using the library should not include jpegint.h, but may wish + * to include jerror.h. + */ + +#ifdef JPEG_INTERNALS +#include "jpegint.h" /* fetch private declarations */ +#include "jerror.h" /* fetch error codes too */ +#endif + +#ifdef __cplusplus +#ifndef DONT_USE_EXTERN_C +} +#endif +#endif + +#endif /* JPEGLIB_H */ diff --git a/thirdparty/LibJPEG/jpeg-9/jpegtran.1 b/thirdparty/LibJPEG/jpeg-9/jpegtran.1 new file mode 100644 index 0000000..0ad1bbc --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jpegtran.1 @@ -0,0 +1,285 @@ +.TH JPEGTRAN 1 "28 December 2009" +.SH NAME +jpegtran \- lossless transformation of JPEG files +.SH SYNOPSIS +.B jpegtran +[ +.I options +] +[ +.I filename +] +.LP +.SH DESCRIPTION +.LP +.B jpegtran +performs various useful transformations of JPEG files. +It can translate the coded representation from one variant of JPEG to another, +for example from baseline JPEG to progressive JPEG or vice versa. It can also +perform some rearrangements of the image data, for example turning an image +from landscape to portrait format by rotation. +.PP +.B jpegtran +works by rearranging the compressed data (DCT coefficients), without +ever fully decoding the image. Therefore, its transformations are lossless: +there is no image degradation at all, which would not be true if you used +.B djpeg +followed by +.B cjpeg +to accomplish the same conversion. But by the same token, +.B jpegtran +cannot perform lossy operations such as changing the image quality. +.PP +.B jpegtran +reads the named JPEG/JFIF file, or the standard input if no file is +named, and produces a JPEG/JFIF file on the standard output. +.SH OPTIONS +All switch names may be abbreviated; for example, +.B \-optimize +may be written +.B \-opt +or +.BR \-o . +Upper and lower case are equivalent. +British spellings are also accepted (e.g., +.BR \-optimise ), +though for brevity these are not mentioned below. +.PP +To specify the coded JPEG representation used in the output file, +.B jpegtran +accepts a subset of the switches recognized by +.BR cjpeg : +.TP +.B \-optimize +Perform optimization of entropy encoding parameters. +.TP +.B \-progressive +Create progressive JPEG file. +.TP +.BI \-restart " N" +Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is +attached to the number. +.TP +.B \-arithmetic +Use arithmetic coding. +.TP +.BI \-scans " file" +Use the scan script given in the specified text file. +.PP +See +.BR cjpeg (1) +for more details about these switches. +If you specify none of these switches, you get a plain baseline-JPEG output +file. The quality setting and so forth are determined by the input file. +.PP +The image can be losslessly transformed by giving one of these switches: +.TP +.B \-flip horizontal +Mirror image horizontally (left-right). +.TP +.B \-flip vertical +Mirror image vertically (top-bottom). +.TP +.B \-rotate 90 +Rotate image 90 degrees clockwise. +.TP +.B \-rotate 180 +Rotate image 180 degrees. +.TP +.B \-rotate 270 +Rotate image 270 degrees clockwise (or 90 ccw). +.TP +.B \-transpose +Transpose image (across UL-to-LR axis). +.TP +.B \-transverse +Transverse transpose (across UR-to-LL axis). +.IP +The transpose transformation has no restrictions regarding image dimensions. +The other transformations operate rather oddly if the image dimensions are not +a multiple of the iMCU size (usually 8 or 16 pixels), because they can only +transform complete blocks of DCT coefficient data in the desired way. +.IP +.BR jpegtran 's +default behavior when transforming an odd-size image is designed +to preserve exact reversibility and mathematical consistency of the +transformation set. As stated, transpose is able to flip the entire image +area. Horizontal mirroring leaves any partial iMCU column at the right edge +untouched, but is able to flip all rows of the image. Similarly, vertical +mirroring leaves any partial iMCU row at the bottom edge untouched, but is +able to flip all columns. The other transforms can be built up as sequences +of transpose and flip operations; for consistency, their actions on edge +pixels are defined to be the same as the end result of the corresponding +transpose-and-flip sequence. +.IP +For practical use, you may prefer to discard any untransformable edge pixels +rather than having a strange-looking strip along the right and/or bottom edges +of a transformed image. To do this, add the +.B \-trim +switch: +.TP +.B \-trim +Drop non-transformable edge blocks. +.IP +Obviously, a transformation with +.B \-trim +is not reversible, so strictly speaking +.B jpegtran +with this switch is not lossless. Also, the expected mathematical +equivalences between the transformations no longer hold. For example, +.B \-rot 270 -trim +trims only the bottom edge, but +.B \-rot 90 -trim +followed by +.B \-rot 180 -trim +trims both edges. +.IP +If you are only interested in perfect transformation, add the +.B \-perfect +switch: +.TP +.B \-perfect +Fails with an error if the transformation is not perfect. +.IP +For example you may want to do +.IP +.B (jpegtran \-rot 90 -perfect +.I foo.jpg +.B || djpeg +.I foo.jpg +.B | pnmflip \-r90 | cjpeg) +.IP +to do a perfect rotation if available or an approximated one if not. +.PP +We also offer a lossless-crop option, which discards data outside a given +image region but losslessly preserves what is inside. Like the rotate and +flip transforms, lossless crop is restricted by the current JPEG format: the +upper left corner of the selected region must fall on an iMCU boundary. If +this does not hold for the given crop parameters, we silently move the upper +left corner up and/or left to make it so, simultaneously increasing the region +dimensions to keep the lower right crop corner unchanged. (Thus, the output +image covers at least the requested region, but may cover more.) + +The image can be losslessly cropped by giving the switch: +.TP +.B \-crop WxH+X+Y +Crop to a rectangular subarea of width W, height H starting at point X,Y. +.PP +Other not-strictly-lossless transformation switches are: +.TP +.B \-grayscale +Force grayscale output. +.IP +This option discards the chrominance channels if the input image is YCbCr +(ie, a standard color JPEG), resulting in a grayscale JPEG file. The +luminance channel is preserved exactly, so this is a better method of reducing +to grayscale than decompression, conversion, and recompression. This switch +is particularly handy for fixing a monochrome picture that was mistakenly +encoded as a color JPEG. (In such a case, the space savings from getting rid +of the near-empty chroma channels won't be large; but the decoding time for +a grayscale JPEG is substantially less than that for a color JPEG.) +.TP +.BI \-scale " M/N" +Scale the output image by a factor M/N. +.IP +Currently supported scale factors are M/N with all M from 1 to 16, where N is +the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted, +then M specifies the DCT scaled size to be applied on the given input. For +baseline JPEG this is equivalent to M/8 scaling, since the source DCT size +for baseline JPEG is 8. +.B Caution: +An implementation of the JPEG SmartScale extension is required for this +feature. SmartScale enabled JPEG is not yet widely implemented, so many +decoders will be unable to view a SmartScale extended JPEG file at all. +.PP +.B jpegtran +also recognizes these switches that control what to do with "extra" markers, +such as comment blocks: +.TP +.B \-copy none +Copy no extra markers from source file. This setting suppresses all +comments and other excess baggage present in the source file. +.TP +.B \-copy comments +Copy only comment markers. This setting copies comments from the source file, +but discards any other inessential (for image display) data. +.TP +.B \-copy all +Copy all extra markers. This setting preserves miscellaneous markers +found in the source file, such as JFIF thumbnails, Exif data, and Photoshop +settings. In some files these extra markers can be sizable. +.IP +The default behavior is +.BR "\-copy comments" . +(Note: in IJG releases v6 and v6a, +.B jpegtran +always did the equivalent of +.BR "\-copy none" .) +.PP +Additional switches recognized by jpegtran are: +.TP +.BI \-maxmemory " N" +Set limit for amount of memory to use in processing large images. Value is +in thousands of bytes, or millions of bytes if "M" is attached to the +number. For example, +.B \-max 4m +selects 4000000 bytes. If more space is needed, temporary files will be used. +.TP +.BI \-outfile " name" +Send output image to the named file, not to standard output. +.TP +.B \-verbose +Enable debug printout. More +.BR \-v 's +give more output. Also, version information is printed at startup. +.TP +.B \-debug +Same as +.BR \-verbose . +.SH EXAMPLES +.LP +This example converts a baseline JPEG file to progressive form: +.IP +.B jpegtran \-progressive +.I foo.jpg +.B > +.I fooprog.jpg +.PP +This example rotates an image 90 degrees clockwise, discarding any +unrotatable edge pixels: +.IP +.B jpegtran \-rot 90 -trim +.I foo.jpg +.B > +.I foo90.jpg +.SH ENVIRONMENT +.TP +.B JPEGMEM +If this environment variable is set, its value is the default memory limit. +The value is specified as described for the +.B \-maxmemory +switch. +.B JPEGMEM +overrides the default value specified when the program was compiled, and +itself is overridden by an explicit +.BR \-maxmemory . +.SH SEE ALSO +.BR cjpeg (1), +.BR djpeg (1), +.BR rdjpgcom (1), +.BR wrjpgcom (1) +.br +Wallace, Gregory K. "The JPEG Still Picture Compression Standard", +Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. +.SH AUTHOR +Independent JPEG Group +.SH BUGS +The transform options can't transform odd-size images perfectly. Use +.B \-trim +or +.B \-perfect +if you don't like the results. +.PP +The entire image is read into memory and then written out again, even in +cases where this isn't really necessary. Expect swapping on large images, +especially when using the more complex transform options. diff --git a/thirdparty/LibJPEG/jpeg-9/jpegtran.c b/thirdparty/LibJPEG/jpeg-9/jpegtran.c new file mode 100644 index 0000000..7e8ef0c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jpegtran.c @@ -0,0 +1,560 @@ +/* + * jpegtran.c + * + * Copyright (C) 1995-2012, Thomas G. Lane, Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a command-line user interface for JPEG transcoding. + * It is very similar to cjpeg.c, and partly to djpeg.c, but provides + * lossless transcoding between different JPEG file formats. It also + * provides some lossless and sort-of-lossless transformations of JPEG data. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ +#include "transupp.h" /* Support routines for jpegtran */ +#include "jversion.h" /* for version message */ + +#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ +#ifdef __MWERKS__ +#include /* Metrowerks needs this */ +#include /* ... and this */ +#endif +#ifdef THINK_C +#include /* Think declares it here */ +#endif +#endif + + +/* + * Argument-parsing code. + * The switch parser is designed to be useful with DOS-style command line + * syntax, ie, intermixed switches and file names, where only the switches + * to the left of a given file name affect processing of that file. + * The main program in this file doesn't actually use this capability... + */ + + +static const char * progname; /* program name for error messages */ +static char * outfilename; /* for -outfile switch */ +static char * scaleoption; /* -scale switch */ +static JCOPY_OPTION copyoption; /* -copy switch */ +static jpeg_transform_info transformoption; /* image transformation options */ + + +LOCAL(void) +usage (void) +/* complain about bad command line */ +{ + fprintf(stderr, "usage: %s [switches] ", progname); +#ifdef TWO_FILE_COMMANDLINE + fprintf(stderr, "inputfile outputfile\n"); +#else + fprintf(stderr, "[inputfile]\n"); +#endif + + fprintf(stderr, "Switches (names may be abbreviated):\n"); + fprintf(stderr, " -copy none Copy no extra markers from source file\n"); + fprintf(stderr, " -copy comments Copy only comment markers (default)\n"); + fprintf(stderr, " -copy all Copy all extra markers\n"); +#ifdef ENTROPY_OPT_SUPPORTED + fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n"); +#endif +#ifdef C_PROGRESSIVE_SUPPORTED + fprintf(stderr, " -progressive Create progressive JPEG file\n"); +#endif + fprintf(stderr, "Switches for modifying the image:\n"); +#if TRANSFORMS_SUPPORTED + fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n"); + fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); + fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n"); + fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n"); + fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n"); +#endif + fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n"); +#if TRANSFORMS_SUPPORTED + fprintf(stderr, " -transpose Transpose image\n"); + fprintf(stderr, " -transverse Transverse transpose image\n"); + fprintf(stderr, " -trim Drop non-transformable edge blocks\n"); +#endif + fprintf(stderr, "Switches for advanced users:\n"); +#ifdef C_ARITH_CODING_SUPPORTED + fprintf(stderr, " -arithmetic Use arithmetic coding\n"); +#endif + fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n"); + fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); + fprintf(stderr, " -outfile name Specify name for output file\n"); + fprintf(stderr, " -verbose or -debug Emit debug output\n"); + fprintf(stderr, "Switches for wizards:\n"); +#ifdef C_MULTISCAN_FILES_SUPPORTED + fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); +#endif + exit(EXIT_FAILURE); +} + + +LOCAL(void) +select_transform (JXFORM_CODE transform) +/* Silly little routine to detect multiple transform options, + * which we can't handle. + */ +{ +#if TRANSFORMS_SUPPORTED + if (transformoption.transform == JXFORM_NONE || + transformoption.transform == transform) { + transformoption.transform = transform; + } else { + fprintf(stderr, "%s: can only do one image transformation at a time\n", + progname); + usage(); + } +#else + fprintf(stderr, "%s: sorry, image transformation was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif +} + + +LOCAL(int) +parse_switches (j_compress_ptr cinfo, int argc, char **argv, + int last_file_arg_seen, boolean for_real) +/* Parse optional switches. + * Returns argv[] index of first file-name argument (== argc if none). + * Any file names with indexes <= last_file_arg_seen are ignored; + * they have presumably been processed in a previous iteration. + * (Pass 0 for last_file_arg_seen on the first or only iteration.) + * for_real is FALSE on the first (dummy) pass; we may skip any expensive + * processing. + */ +{ + int argn; + char * arg; + boolean simple_progressive; + char * scansarg = NULL; /* saves -scans parm if any */ + + /* Set up default JPEG parameters. */ + simple_progressive = FALSE; + outfilename = NULL; + scaleoption = NULL; + copyoption = JCOPYOPT_DEFAULT; + transformoption.transform = JXFORM_NONE; + transformoption.perfect = FALSE; + transformoption.trim = FALSE; + transformoption.force_grayscale = FALSE; + transformoption.crop = FALSE; + cinfo->err->trace_level = 0; + + /* Scan command line options, adjust parameters */ + + for (argn = 1; argn < argc; argn++) { + arg = argv[argn]; + if (*arg != '-') { + /* Not a switch, must be a file name argument */ + if (argn <= last_file_arg_seen) { + outfilename = NULL; /* -outfile applies to just one input file */ + continue; /* ignore this name if previously processed */ + } + break; /* else done parsing switches */ + } + arg++; /* advance past switch marker character */ + + if (keymatch(arg, "arithmetic", 1)) { + /* Use arithmetic coding. */ +#ifdef C_ARITH_CODING_SUPPORTED + cinfo->arith_code = TRUE; +#else + fprintf(stderr, "%s: sorry, arithmetic coding not supported\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "copy", 2)) { + /* Select which extra markers to copy. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "none", 1)) { + copyoption = JCOPYOPT_NONE; + } else if (keymatch(argv[argn], "comments", 1)) { + copyoption = JCOPYOPT_COMMENTS; + } else if (keymatch(argv[argn], "all", 1)) { + copyoption = JCOPYOPT_ALL; + } else + usage(); + + } else if (keymatch(arg, "crop", 2)) { + /* Perform lossless cropping. */ +#if TRANSFORMS_SUPPORTED + if (++argn >= argc) /* advance to next argument */ + usage(); + if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) { + fprintf(stderr, "%s: bogus -crop argument '%s'\n", + progname, argv[argn]); + exit(EXIT_FAILURE); + } +#else + select_transform(JXFORM_NONE); /* force an error */ +#endif + + } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { + /* Enable debug printouts. */ + /* On first -d, print version identification */ + static boolean printed_version = FALSE; + + if (! printed_version) { + fprintf(stderr, "Independent JPEG Group's JPEGTRAN, version %s\n%s\n", + JVERSION, JCOPYRIGHT); + printed_version = TRUE; + } + cinfo->err->trace_level++; + + } else if (keymatch(arg, "flip", 1)) { + /* Mirror left-right or top-bottom. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "horizontal", 1)) + select_transform(JXFORM_FLIP_H); + else if (keymatch(argv[argn], "vertical", 1)) + select_transform(JXFORM_FLIP_V); + else + usage(); + + } else if (keymatch(arg, "grayscale", 1) || keymatch(arg, "greyscale",1)) { + /* Force to grayscale. */ +#if TRANSFORMS_SUPPORTED + transformoption.force_grayscale = TRUE; +#else + select_transform(JXFORM_NONE); /* force an error */ +#endif + + } else if (keymatch(arg, "maxmemory", 3)) { + /* Maximum memory in Kb (or Mb with 'm'). */ + long lval; + char ch = 'x'; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) + usage(); + if (ch == 'm' || ch == 'M') + lval *= 1000L; + cinfo->mem->max_memory_to_use = lval * 1000L; + + } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) { + /* Enable entropy parm optimization. */ +#ifdef ENTROPY_OPT_SUPPORTED + cinfo->optimize_coding = TRUE; +#else + fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "outfile", 4)) { + /* Set output file name. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + outfilename = argv[argn]; /* save it away for later use */ + + } else if (keymatch(arg, "perfect", 2)) { + /* Fail if there is any partial edge MCUs that the transform can't + * handle. */ + transformoption.perfect = TRUE; + + } else if (keymatch(arg, "progressive", 2)) { + /* Select simple progressive mode. */ +#ifdef C_PROGRESSIVE_SUPPORTED + simple_progressive = TRUE; + /* We must postpone execution until num_components is known. */ +#else + fprintf(stderr, "%s: sorry, progressive output was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "restart", 1)) { + /* Restart interval in MCU rows (or in MCUs with 'b'). */ + long lval; + char ch = 'x'; + + if (++argn >= argc) /* advance to next argument */ + usage(); + if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) + usage(); + if (lval < 0 || lval > 65535L) + usage(); + if (ch == 'b' || ch == 'B') { + cinfo->restart_interval = (unsigned int) lval; + cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */ + } else { + cinfo->restart_in_rows = (int) lval; + /* restart_interval will be computed during startup */ + } + + } else if (keymatch(arg, "rotate", 2)) { + /* Rotate 90, 180, or 270 degrees (measured clockwise). */ + if (++argn >= argc) /* advance to next argument */ + usage(); + if (keymatch(argv[argn], "90", 2)) + select_transform(JXFORM_ROT_90); + else if (keymatch(argv[argn], "180", 3)) + select_transform(JXFORM_ROT_180); + else if (keymatch(argv[argn], "270", 3)) + select_transform(JXFORM_ROT_270); + else + usage(); + + } else if (keymatch(arg, "scale", 4)) { + /* Scale the output image by a fraction M/N. */ + if (++argn >= argc) /* advance to next argument */ + usage(); + scaleoption = argv[argn]; + /* We must postpone processing until decompression startup. */ + + } else if (keymatch(arg, "scans", 1)) { + /* Set scan script. */ +#ifdef C_MULTISCAN_FILES_SUPPORTED + if (++argn >= argc) /* advance to next argument */ + usage(); + scansarg = argv[argn]; + /* We must postpone reading the file in case -progressive appears. */ +#else + fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n", + progname); + exit(EXIT_FAILURE); +#endif + + } else if (keymatch(arg, "transpose", 1)) { + /* Transpose (across UL-to-LR axis). */ + select_transform(JXFORM_TRANSPOSE); + + } else if (keymatch(arg, "transverse", 6)) { + /* Transverse transpose (across UR-to-LL axis). */ + select_transform(JXFORM_TRANSVERSE); + + } else if (keymatch(arg, "trim", 3)) { + /* Trim off any partial edge MCUs that the transform can't handle. */ + transformoption.trim = TRUE; + + } else { + usage(); /* bogus switch */ + } + } + + /* Post-switch-scanning cleanup */ + + if (for_real) { + +#ifdef C_PROGRESSIVE_SUPPORTED + if (simple_progressive) /* process -progressive; -scans can override */ + jpeg_simple_progression(cinfo); +#endif + +#ifdef C_MULTISCAN_FILES_SUPPORTED + if (scansarg != NULL) /* process -scans if it was present */ + if (! read_scan_script(cinfo, scansarg)) + usage(); +#endif + } + + return argn; /* return index of next arg (file name) */ +} + + +/* + * The main program. + */ + +int +main (int argc, char **argv) +{ + struct jpeg_decompress_struct srcinfo; + struct jpeg_compress_struct dstinfo; + struct jpeg_error_mgr jsrcerr, jdsterr; +#ifdef PROGRESS_REPORT + struct cdjpeg_progress_mgr progress; +#endif + jvirt_barray_ptr * src_coef_arrays; + jvirt_barray_ptr * dst_coef_arrays; + int file_index; + /* We assume all-in-memory processing and can therefore use only a + * single file pointer for sequential input and output operation. + */ + FILE * fp; + + /* On Mac, fetch a command line. */ +#ifdef USE_CCOMMAND + argc = ccommand(&argv); +#endif + + progname = argv[0]; + if (progname == NULL || progname[0] == 0) + progname = "jpegtran"; /* in case C library doesn't provide it */ + + /* Initialize the JPEG decompression object with default error handling. */ + srcinfo.err = jpeg_std_error(&jsrcerr); + jpeg_create_decompress(&srcinfo); + /* Initialize the JPEG compression object with default error handling. */ + dstinfo.err = jpeg_std_error(&jdsterr); + jpeg_create_compress(&dstinfo); + + /* Now safe to enable signal catcher. + * Note: we assume only the decompression object will have virtual arrays. + */ +#ifdef NEED_SIGNAL_CATCHER + enable_signal_catcher((j_common_ptr) &srcinfo); +#endif + + /* Scan command line to find file names. + * It is convenient to use just one switch-parsing routine, but the switch + * values read here are mostly ignored; we will rescan the switches after + * opening the input file. Also note that most of the switches affect the + * destination JPEG object, so we parse into that and then copy over what + * needs to affects the source too. + */ + + file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE); + jsrcerr.trace_level = jdsterr.trace_level; + srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use; + +#ifdef TWO_FILE_COMMANDLINE + /* Must have either -outfile switch or explicit output file name */ + if (outfilename == NULL) { + if (file_index != argc-2) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + outfilename = argv[file_index+1]; + } else { + if (file_index != argc-1) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + } +#else + /* Unix style: expect zero or one file name */ + if (file_index < argc-1) { + fprintf(stderr, "%s: only one input file\n", progname); + usage(); + } +#endif /* TWO_FILE_COMMANDLINE */ + + /* Open the input file. */ + if (file_index < argc) { + if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s for reading\n", progname, argv[file_index]); + exit(EXIT_FAILURE); + } + } else { + /* default input file is stdin */ + fp = read_stdin(); + } + +#ifdef PROGRESS_REPORT + start_progress_monitor((j_common_ptr) &dstinfo, &progress); +#endif + + /* Specify data source for decompression */ + jpeg_stdio_src(&srcinfo, fp); + + /* Enable saving of extra markers that we want to copy */ + jcopy_markers_setup(&srcinfo, copyoption); + + /* Read file header */ + (void) jpeg_read_header(&srcinfo, TRUE); + + /* Adjust default decompression parameters */ + if (scaleoption != NULL) + if (sscanf(scaleoption, "%u/%u", + &srcinfo.scale_num, &srcinfo.scale_denom) < 1) + usage(); + + /* Any space needed by a transform option must be requested before + * jpeg_read_coefficients so that memory allocation will be done right. + */ +#if TRANSFORMS_SUPPORTED + /* Fail right away if -perfect is given and transformation is not perfect. + */ + if (!jtransform_request_workspace(&srcinfo, &transformoption)) { + fprintf(stderr, "%s: transformation is not perfect\n", progname); + exit(EXIT_FAILURE); + } +#endif + + /* Read source file as DCT coefficients */ + src_coef_arrays = jpeg_read_coefficients(&srcinfo); + + /* Initialize destination compression parameters from source values */ + jpeg_copy_critical_parameters(&srcinfo, &dstinfo); + + /* Adjust destination parameters if required by transform options; + * also find out which set of coefficient arrays will hold the output. + */ +#if TRANSFORMS_SUPPORTED + dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo, + src_coef_arrays, + &transformoption); +#else + dst_coef_arrays = src_coef_arrays; +#endif + + /* Close input file, if we opened it. + * Note: we assume that jpeg_read_coefficients consumed all input + * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will + * only consume more while (! cinfo->inputctl->eoi_reached). + * We cannot call jpeg_finish_decompress here since we still need the + * virtual arrays allocated from the source object for processing. + */ + if (fp != stdin) + fclose(fp); + + /* Open the output file. */ + if (outfilename != NULL) { + if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s for writing\n", progname, outfilename); + exit(EXIT_FAILURE); + } + } else { + /* default output file is stdout */ + fp = write_stdout(); + } + + /* Adjust default compression parameters by re-parsing the options */ + file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE); + + /* Specify data destination for compression */ + jpeg_stdio_dest(&dstinfo, fp); + + /* Start compressor (note no image data is actually written here) */ + jpeg_write_coefficients(&dstinfo, dst_coef_arrays); + + /* Copy to the output file any extra markers that we want to preserve */ + jcopy_markers_execute(&srcinfo, &dstinfo, copyoption); + + /* Execute image transformation, if any */ +#if TRANSFORMS_SUPPORTED + jtransform_execute_transformation(&srcinfo, &dstinfo, + src_coef_arrays, + &transformoption); +#endif + + /* Finish compression and release memory */ + jpeg_finish_compress(&dstinfo); + jpeg_destroy_compress(&dstinfo); + (void) jpeg_finish_decompress(&srcinfo); + jpeg_destroy_decompress(&srcinfo); + + /* Close output file, if we opened it */ + if (fp != stdout) + fclose(fp); + +#ifdef PROGRESS_REPORT + end_progress_monitor((j_common_ptr) &dstinfo); +#endif + + /* All done. */ + exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS); + return 0; /* suppress no-return-value warnings */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/jquant1.c b/thirdparty/LibJPEG/jpeg-9/jquant1.c new file mode 100644 index 0000000..9d11f70 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jquant1.c @@ -0,0 +1,857 @@ +/* + * jquant1.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 1-pass color quantization (color mapping) routines. + * These routines provide mapping to a fixed color map using equally spaced + * color values. Optional Floyd-Steinberg or ordered dithering is available. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + +#ifdef QUANT_1PASS_SUPPORTED + + +/* + * The main purpose of 1-pass quantization is to provide a fast, if not very + * high quality, colormapped output capability. A 2-pass quantizer usually + * gives better visual quality; however, for quantized grayscale output this + * quantizer is perfectly adequate. Dithering is highly recommended with this + * quantizer, though you can turn it off if you really want to. + * + * In 1-pass quantization the colormap must be chosen in advance of seeing the + * image. We use a map consisting of all combinations of Ncolors[i] color + * values for the i'th component. The Ncolors[] values are chosen so that + * their product, the total number of colors, is no more than that requested. + * (In most cases, the product will be somewhat less.) + * + * Since the colormap is orthogonal, the representative value for each color + * component can be determined without considering the other components; + * then these indexes can be combined into a colormap index by a standard + * N-dimensional-array-subscript calculation. Most of the arithmetic involved + * can be precalculated and stored in the lookup table colorindex[]. + * colorindex[i][j] maps pixel value j in component i to the nearest + * representative value (grid plane) for that component; this index is + * multiplied by the array stride for component i, so that the + * index of the colormap entry closest to a given pixel value is just + * sum( colorindex[component-number][pixel-component-value] ) + * Aside from being fast, this scheme allows for variable spacing between + * representative values with no additional lookup cost. + * + * If gamma correction has been applied in color conversion, it might be wise + * to adjust the color grid spacing so that the representative colors are + * equidistant in linear space. At this writing, gamma correction is not + * implemented by jdcolor, so nothing is done here. + */ + + +/* Declarations for ordered dithering. + * + * We use a standard 16x16 ordered dither array. The basic concept of ordered + * dithering is described in many references, for instance Dale Schumacher's + * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). + * In place of Schumacher's comparisons against a "threshold" value, we add a + * "dither" value to the input pixel and then round the result to the nearest + * output value. The dither value is equivalent to (0.5 - threshold) times + * the distance between output values. For ordered dithering, we assume that + * the output colors are equally spaced; if not, results will probably be + * worse, since the dither may be too much or too little at a given point. + * + * The normal calculation would be to form pixel value + dither, range-limit + * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. + * We can skip the separate range-limiting step by extending the colorindex + * table in both directions. + */ + +#define ODITHER_SIZE 16 /* dimension of dither matrix */ +/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ +#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ +#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ + +typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; +typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; + +static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { + /* Bayer's order-4 dither array. Generated by the code given in + * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. + * The values in this array must range from 0 to ODITHER_CELLS-1. + */ + { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, + { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, + { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, + { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, + { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, + { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, + { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, + { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, + { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, + { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, + { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, + { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, + { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, + { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, + { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, + { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } +}; + + +/* Declarations for Floyd-Steinberg dithering. + * + * Errors are accumulated into the array fserrors[], at a resolution of + * 1/16th of a pixel count. The error at a given pixel is propagated + * to its not-yet-processed neighbors using the standard F-S fractions, + * ... (here) 7/16 + * 3/16 5/16 1/16 + * We work left-to-right on even rows, right-to-left on odd rows. + * + * We can get away with a single array (holding one row's worth of errors) + * by using it to store the current row's errors at pixel columns not yet + * processed, but the next row's errors at columns already processed. We + * need only a few extra variables to hold the errors immediately around the + * current column. (If we are lucky, those variables are in registers, but + * even if not, they're probably cheaper to access than array elements are.) + * + * The fserrors[] array is indexed [component#][position]. + * We provide (#columns + 2) entries per component; the extra entry at each + * end saves us from special-casing the first and last pixels. + * + * Note: on a wide image, we might not have enough room in a PC's near data + * segment to hold the error array; so it is allocated with alloc_large. + */ + +#if BITS_IN_JSAMPLE == 8 +typedef INT16 FSERROR; /* 16 bits should be enough */ +typedef int LOCFSERROR; /* use 'int' for calculation temps */ +#else +typedef INT32 FSERROR; /* may need more than 16 bits */ +typedef INT32 LOCFSERROR; /* be sure calculation temps are big enough */ +#endif + +typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ + + +/* Private subobject */ + +#define MAX_Q_COMPS 4 /* max components I can handle */ + +typedef struct { + struct jpeg_color_quantizer pub; /* public fields */ + + /* Initially allocated colormap is saved here */ + JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ + int sv_actual; /* number of entries in use */ + + JSAMPARRAY colorindex; /* Precomputed mapping for speed */ + /* colorindex[i][j] = index of color closest to pixel value j in component i, + * premultiplied as described above. Since colormap indexes must fit into + * JSAMPLEs, the entries of this array will too. + */ + boolean is_padded; /* is the colorindex padded for odither? */ + + int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ + + /* Variables for ordered dithering */ + int row_index; /* cur row's vertical index in dither matrix */ + ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ + + /* Variables for Floyd-Steinberg dithering */ + FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ + boolean on_odd_row; /* flag to remember which row we are on */ +} my_cquantizer; + +typedef my_cquantizer * my_cquantize_ptr; + + +/* + * Policy-making subroutines for create_colormap and create_colorindex. + * These routines determine the colormap to be used. The rest of the module + * only assumes that the colormap is orthogonal. + * + * * select_ncolors decides how to divvy up the available colors + * among the components. + * * output_value defines the set of representative values for a component. + * * largest_input_value defines the mapping from input values to + * representative values for a component. + * Note that the latter two routines may impose different policies for + * different components, though this is not currently done. + */ + + +LOCAL(int) +select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) +/* Determine allocation of desired colors to components, */ +/* and fill in Ncolors[] array to indicate choice. */ +/* Return value is total number of colors (product of Ncolors[] values). */ +{ + int nc = cinfo->out_color_components; /* number of color components */ + int max_colors = cinfo->desired_number_of_colors; + int total_colors, iroot, i, j; + boolean changed; + long temp; + static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; + + /* We can allocate at least the nc'th root of max_colors per component. */ + /* Compute floor(nc'th root of max_colors). */ + iroot = 1; + do { + iroot++; + temp = iroot; /* set temp = iroot ** nc */ + for (i = 1; i < nc; i++) + temp *= iroot; + } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ + iroot--; /* now iroot = floor(root) */ + + /* Must have at least 2 color values per component */ + if (iroot < 2) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); + + /* Initialize to iroot color values for each component */ + total_colors = 1; + for (i = 0; i < nc; i++) { + Ncolors[i] = iroot; + total_colors *= iroot; + } + /* We may be able to increment the count for one or more components without + * exceeding max_colors, though we know not all can be incremented. + * Sometimes, the first component can be incremented more than once! + * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) + * In RGB colorspace, try to increment G first, then R, then B. + */ + do { + changed = FALSE; + for (i = 0; i < nc; i++) { + j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); + /* calculate new total_colors if Ncolors[j] is incremented */ + temp = total_colors / Ncolors[j]; + temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ + if (temp > (long) max_colors) + break; /* won't fit, done with this pass */ + Ncolors[j]++; /* OK, apply the increment */ + total_colors = (int) temp; + changed = TRUE; + } + } while (changed); + + return total_colors; +} + + +LOCAL(int) +output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return j'th output value, where j will range from 0 to maxj */ +/* The output values must fall in 0..MAXJSAMPLE in increasing order */ +{ + /* We always provide values 0 and MAXJSAMPLE for each component; + * any additional values are equally spaced between these limits. + * (Forcing the upper and lower values to the limits ensures that + * dithering can't produce a color outside the selected gamut.) + */ + return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj); +} + + +LOCAL(int) +largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) +/* Return largest input value that should map to j'th output value */ +/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ +{ + /* Breakpoints are halfway between values returned by output_value */ + return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); +} + + +/* + * Create the colormap. + */ + +LOCAL(void) +create_colormap (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colormap; /* Created colormap */ + int total_colors; /* Number of distinct output colors */ + int i,j,k, nci, blksize, blkdist, ptr, val; + + /* Select number of colors for each component */ + total_colors = select_ncolors(cinfo, cquantize->Ncolors); + + /* Report selected color counts */ + if (cinfo->out_color_components == 3) + TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, + total_colors, cquantize->Ncolors[0], + cquantize->Ncolors[1], cquantize->Ncolors[2]); + else + TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); + + /* Allocate and fill in the colormap. */ + /* The colors are ordered in the map in standard row-major order, */ + /* i.e. rightmost (highest-indexed) color changes most rapidly. */ + + colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + /* blkdist is distance between groups of identical entries for a component */ + blkdist = total_colors; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colormap entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blkdist / nci; + for (j = 0; j < nci; j++) { + /* Compute j'th output value (out of nci) for component */ + val = output_value(cinfo, i, j, nci-1); + /* Fill in all colormap entries that have this value of this component */ + for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { + /* fill in blksize entries beginning at ptr */ + for (k = 0; k < blksize; k++) + colormap[i][ptr+k] = (JSAMPLE) val; + } + } + blkdist = blksize; /* blksize of this color is blkdist of next */ + } + + /* Save the colormap in private storage, + * where it will survive color quantization mode changes. + */ + cquantize->sv_colormap = colormap; + cquantize->sv_actual = total_colors; +} + + +/* + * Create the color index table. + */ + +LOCAL(void) +create_colorindex (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPROW indexptr; + int i,j,k, nci, blksize, val, pad; + + /* For ordered dither, we pad the color index tables by MAXJSAMPLE in + * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). + * This is not necessary in the other dithering modes. However, we + * flag whether it was done in case user changes dithering mode. + */ + if (cinfo->dither_mode == JDITHER_ORDERED) { + pad = MAXJSAMPLE*2; + cquantize->is_padded = TRUE; + } else { + pad = 0; + cquantize->is_padded = FALSE; + } + + cquantize->colorindex = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (MAXJSAMPLE+1 + pad), + (JDIMENSION) cinfo->out_color_components); + + /* blksize is number of adjacent repeated entries for a component */ + blksize = cquantize->sv_actual; + + for (i = 0; i < cinfo->out_color_components; i++) { + /* fill in colorindex entries for i'th color component */ + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + blksize = blksize / nci; + + /* adjust colorindex pointers to provide padding at negative indexes. */ + if (pad) + cquantize->colorindex[i] += MAXJSAMPLE; + + /* in loop, val = index of current output value, */ + /* and k = largest j that maps to current val */ + indexptr = cquantize->colorindex[i]; + val = 0; + k = largest_input_value(cinfo, i, 0, nci-1); + for (j = 0; j <= MAXJSAMPLE; j++) { + while (j > k) /* advance val if past boundary */ + k = largest_input_value(cinfo, i, ++val, nci-1); + /* premultiply so that no multiplication needed in main processing */ + indexptr[j] = (JSAMPLE) (val * blksize); + } + /* Pad at both ends if necessary */ + if (pad) + for (j = 1; j <= MAXJSAMPLE; j++) { + indexptr[-j] = indexptr[0]; + indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; + } + } +} + + +/* + * Create an ordered-dither array for a component having ncolors + * distinct output values. + */ + +LOCAL(ODITHER_MATRIX_PTR) +make_odither_array (j_decompress_ptr cinfo, int ncolors) +{ + ODITHER_MATRIX_PTR odither; + int j,k; + INT32 num,den; + + odither = (ODITHER_MATRIX_PTR) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ODITHER_MATRIX)); + /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). + * Hence the dither value for the matrix cell with fill order f + * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). + * On 16-bit-int machine, be careful to avoid overflow. + */ + den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1)); + for (j = 0; j < ODITHER_SIZE; j++) { + for (k = 0; k < ODITHER_SIZE; k++) { + num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) + * MAXJSAMPLE; + /* Ensure round towards zero despite C's lack of consistency + * about rounding negative values in integer division... + */ + odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); + } + } + return odither; +} + + +/* + * Create the ordered-dither tables. + * Components having the same number of representative colors may + * share a dither table. + */ + +LOCAL(void) +create_odither_tables (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + ODITHER_MATRIX_PTR odither; + int i, j, nci; + + for (i = 0; i < cinfo->out_color_components; i++) { + nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ + odither = NULL; /* search for matching prior component */ + for (j = 0; j < i; j++) { + if (nci == cquantize->Ncolors[j]) { + odither = cquantize->odither[j]; + break; + } + } + if (odither == NULL) /* need a new table? */ + odither = make_odither_array(cinfo, nci); + cquantize->odither[i] = odither; + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + JSAMPARRAY colorindex = cquantize->colorindex; + register int pixcode, ci; + register JSAMPROW ptrin, ptrout; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + register int nc = cinfo->out_color_components; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = 0; + for (ci = 0; ci < nc; ci++) { + pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); + } + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW ptrin, ptrout; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptrin = input_buf[row]; + ptrout = output_buf[row]; + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); + *ptrout++ = (JSAMPLE) pixcode; + } + } +} + + +METHODDEF(void) +quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + int * dither; /* points to active row of dither matrix */ + int row_index, col_index; /* current indexes into dither matrix */ + int nc = cinfo->out_color_components; + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + FMEMZERO((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + row_index = cquantize->row_index; + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + colorindex_ci = cquantize->colorindex[ci]; + dither = cquantize->odither[ci][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, + * select output value, accumulate into output code for this pixel. + * Range-limiting need not be done explicitly, as we have extended + * the colorindex table to produce the right answers for out-of-range + * inputs. The maximum dither is +- MAXJSAMPLE; this sets the + * required amount of padding. + */ + *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]; + input_ptr += nc; + output_ptr++; + col_index = (col_index + 1) & ODITHER_MASK; + } + } + /* Advance row index for next row */ + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* Fast path for out_color_components==3, with ordered dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register int pixcode; + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex0 = cquantize->colorindex[0]; + JSAMPROW colorindex1 = cquantize->colorindex[1]; + JSAMPROW colorindex2 = cquantize->colorindex[2]; + int * dither0; /* points to active row of dither matrix */ + int * dither1; + int * dither2; + int row_index, col_index; /* current indexes into dither matrix */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + row_index = cquantize->row_index; + input_ptr = input_buf[row]; + output_ptr = output_buf[row]; + dither0 = cquantize->odither[0][row_index]; + dither1 = cquantize->odither[1][row_index]; + dither2 = cquantize->odither[2][row_index]; + col_index = 0; + + for (col = width; col > 0; col--) { + pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + + dither0[col_index]]); + pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + + dither1[col_index]]); + pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + + dither2[col_index]]); + *output_ptr++ = (JSAMPLE) pixcode; + col_index = (col_index + 1) & ODITHER_MASK; + } + row_index = (row_index + 1) & ODITHER_MASK; + cquantize->row_index = row_index; + } +} + + +METHODDEF(void) +quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPARRAY output_buf, int num_rows) +/* General case, with Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + register LOCFSERROR cur; /* current error or pixel value */ + LOCFSERROR belowerr; /* error for pixel below cur */ + LOCFSERROR bpreverr; /* error for below/prev col */ + LOCFSERROR bnexterr; /* error for below/next col */ + LOCFSERROR delta; + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + register JSAMPROW input_ptr; + register JSAMPROW output_ptr; + JSAMPROW colorindex_ci; + JSAMPROW colormap_ci; + int pixcode; + int nc = cinfo->out_color_components; + int dir; /* 1 for left-to-right, -1 for right-to-left */ + int dirnc; /* dir * nc */ + int ci; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + /* Initialize output values to 0 so can process components separately */ + FMEMZERO((void FAR *) output_buf[row], + (size_t) (width * SIZEOF(JSAMPLE))); + for (ci = 0; ci < nc; ci++) { + input_ptr = input_buf[row] + ci; + output_ptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + input_ptr += (width-1) * nc; /* so point to rightmost pixel */ + output_ptr += width-1; + dir = -1; + dirnc = -nc; + errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ + } else { + /* work left to right in this row */ + dir = 1; + dirnc = nc; + errorptr = cquantize->fserrors[ci]; /* => entry before first column */ + } + colorindex_ci = cquantize->colorindex[ci]; + colormap_ci = cquantize->sv_colormap[ci]; + /* Preset error values: no error propagated to first pixel from left */ + cur = 0; + /* and no error propagated to row below yet */ + belowerr = bpreverr = 0; + + for (col = width; col > 0; col--) { + /* cur holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE; this sets the required size + * of the range_limit array. + */ + cur += GETJSAMPLE(*input_ptr); + cur = GETJSAMPLE(range_limit[cur]); + /* Select output value, accumulate into output code for this pixel */ + pixcode = GETJSAMPLE(colorindex_ci[cur]); + *output_ptr += (JSAMPLE) pixcode; + /* Compute actual representation error at this pixel */ + /* Note: we can do this even though we don't have the final */ + /* pixel code, because the colormap is orthogonal. */ + cur -= GETJSAMPLE(colormap_ci[pixcode]); + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + bnexterr = cur; + delta = cur * 2; + cur += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr + cur); + cur += delta; /* form error * 5 */ + bpreverr = belowerr + cur; + belowerr = bnexterr; + cur += delta; /* form error * 7 */ + /* At this point cur contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + input_ptr += dirnc; /* advance input ptr to next column */ + output_ptr += dir; /* advance output ptr to next column */ + errorptr += dir; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error value into the + * final fserrors[] entry. Note we need not unload belowerr because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ + } + cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); + } +} + + +/* + * Allocate workspace for Floyd-Steinberg errors. + */ + +LOCAL(void) +alloc_fs_workspace (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) { + cquantize->fserrors[i] = (FSERRPTR) + (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + } +} + + +/* + * Initialize for one-pass color quantization. + */ + +METHODDEF(void) +start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + size_t arraysize; + int i; + + /* Install my colormap. */ + cinfo->colormap = cquantize->sv_colormap; + cinfo->actual_number_of_colors = cquantize->sv_actual; + + /* Initialize for desired dithering mode. */ + switch (cinfo->dither_mode) { + case JDITHER_NONE: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = color_quantize3; + else + cquantize->pub.color_quantize = color_quantize; + break; + case JDITHER_ORDERED: + if (cinfo->out_color_components == 3) + cquantize->pub.color_quantize = quantize3_ord_dither; + else + cquantize->pub.color_quantize = quantize_ord_dither; + cquantize->row_index = 0; /* initialize state for ordered dither */ + /* If user changed to ordered dither from another mode, + * we must recreate the color index table with padding. + * This will cost extra space, but probably isn't very likely. + */ + if (! cquantize->is_padded) + create_colorindex(cinfo); + /* Create ordered-dither tables if we didn't already. */ + if (cquantize->odither[0] == NULL) + create_odither_tables(cinfo); + break; + case JDITHER_FS: + cquantize->pub.color_quantize = quantize_fs_dither; + cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ + /* Allocate Floyd-Steinberg workspace if didn't already. */ + if (cquantize->fserrors[0] == NULL) + alloc_fs_workspace(cinfo); + /* Initialize the propagated errors to zero. */ + arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); + for (i = 0; i < cinfo->out_color_components; i++) + FMEMZERO((void FAR *) cquantize->fserrors[i], arraysize); + break; + default: + ERREXIT(cinfo, JERR_NOT_COMPILED); + break; + } +} + + +/* + * Finish up at the end of the pass. + */ + +METHODDEF(void) +finish_pass_1_quant (j_decompress_ptr cinfo) +{ + /* no work in 1-pass case */ +} + + +/* + * Switch to a new external colormap between output passes. + * Shouldn't get to this module! + */ + +METHODDEF(void) +new_color_map_1_quant (j_decompress_ptr cinfo) +{ + ERREXIT(cinfo, JERR_MODE_CHANGE); +} + + +/* + * Module initialization routine for 1-pass color quantization. + */ + +GLOBAL(void) +jinit_1pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_1_quant; + cquantize->pub.finish_pass = finish_pass_1_quant; + cquantize->pub.new_color_map = new_color_map_1_quant; + cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ + cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ + + /* Make sure my internal arrays won't overflow */ + if (cinfo->out_color_components > MAX_Q_COMPS) + ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); + + /* Create the colormap and color index table. */ + create_colormap(cinfo); + create_colorindex(cinfo); + + /* Allocate Floyd-Steinberg workspace now if requested. + * We do this now since it is FAR storage and may affect the memory + * manager's space calculations. If the user changes to FS dither + * mode in a later pass, we will allocate the space then, and will + * possibly overrun the max_memory_to_use setting. + */ + if (cinfo->dither_mode == JDITHER_FS) + alloc_fs_workspace(cinfo); +} + +#endif /* QUANT_1PASS_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jquant2.c b/thirdparty/LibJPEG/jpeg-9/jquant2.c new file mode 100644 index 0000000..38fc2af --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jquant2.c @@ -0,0 +1,1311 @@ +/* + * jquant2.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains 2-pass color quantization (color mapping) routines. + * These routines provide selection of a custom color map for an image, + * followed by mapping of the image to that color map, with optional + * Floyd-Steinberg dithering. + * It is also possible to use just the second pass to map to an arbitrary + * externally-given color map. + * + * Note: ordered dithering is not supported, since there isn't any fast + * way to compute intercolor distances; it's unclear that ordered dither's + * fundamental assumptions even hold with an irregularly spaced color map. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + +#ifdef QUANT_2PASS_SUPPORTED + + +/* + * This module implements the well-known Heckbert paradigm for color + * quantization. Most of the ideas used here can be traced back to + * Heckbert's seminal paper + * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", + * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. + * + * In the first pass over the image, we accumulate a histogram showing the + * usage count of each possible color. To keep the histogram to a reasonable + * size, we reduce the precision of the input; typical practice is to retain + * 5 or 6 bits per color, so that 8 or 4 different input values are counted + * in the same histogram cell. + * + * Next, the color-selection step begins with a box representing the whole + * color space, and repeatedly splits the "largest" remaining box until we + * have as many boxes as desired colors. Then the mean color in each + * remaining box becomes one of the possible output colors. + * + * The second pass over the image maps each input pixel to the closest output + * color (optionally after applying a Floyd-Steinberg dithering correction). + * This mapping is logically trivial, but making it go fast enough requires + * considerable care. + * + * Heckbert-style quantizers vary a good deal in their policies for choosing + * the "largest" box and deciding where to cut it. The particular policies + * used here have proved out well in experimental comparisons, but better ones + * may yet be found. + * + * In earlier versions of the IJG code, this module quantized in YCbCr color + * space, processing the raw upsampled data without a color conversion step. + * This allowed the color conversion math to be done only once per colormap + * entry, not once per pixel. However, that optimization precluded other + * useful optimizations (such as merging color conversion with upsampling) + * and it also interfered with desired capabilities such as quantizing to an + * externally-supplied colormap. We have therefore abandoned that approach. + * The present code works in the post-conversion color space, typically RGB. + * + * To improve the visual quality of the results, we actually work in scaled + * RGB space, giving G distances more weight than R, and R in turn more than + * B. To do everything in integer math, we must use integer scale factors. + * The 2/3/1 scale factors used here correspond loosely to the relative + * weights of the colors in the NTSC grayscale equation. + * If you want to use this code to quantize a non-RGB color space, you'll + * probably need to change these scale factors. + */ + +#define R_SCALE 2 /* scale R distances by this much */ +#define G_SCALE 3 /* scale G distances by this much */ +#define B_SCALE 1 /* and B by this much */ + +/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined + * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B + * and B,G,R orders. If you define some other weird order in jmorecfg.h, + * you'll get compile errors until you extend this logic. In that case + * you'll probably want to tweak the histogram sizes too. + */ + +#if RGB_RED == 0 +#define C0_SCALE R_SCALE +#endif +#if RGB_BLUE == 0 +#define C0_SCALE B_SCALE +#endif +#if RGB_GREEN == 1 +#define C1_SCALE G_SCALE +#endif +#if RGB_RED == 2 +#define C2_SCALE R_SCALE +#endif +#if RGB_BLUE == 2 +#define C2_SCALE B_SCALE +#endif + + +/* + * First we have the histogram data structure and routines for creating it. + * + * The number of bits of precision can be adjusted by changing these symbols. + * We recommend keeping 6 bits for G and 5 each for R and B. + * If you have plenty of memory and cycles, 6 bits all around gives marginally + * better results; if you are short of memory, 5 bits all around will save + * some space but degrade the results. + * To maintain a fully accurate histogram, we'd need to allocate a "long" + * (preferably unsigned long) for each cell. In practice this is overkill; + * we can get by with 16 bits per cell. Few of the cell counts will overflow, + * and clamping those that do overflow to the maximum value will give close- + * enough results. This reduces the recommended histogram size from 256Kb + * to 128Kb, which is a useful savings on PC-class machines. + * (In the second pass the histogram space is re-used for pixel mapping data; + * in that capacity, each cell must be able to store zero to the number of + * desired colors. 16 bits/cell is plenty for that too.) + * Since the JPEG code is intended to run in small memory model on 80x86 + * machines, we can't just allocate the histogram in one chunk. Instead + * of a true 3-D array, we use a row of pointers to 2-D arrays. Each + * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and + * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that + * on 80x86 machines, the pointer row is in near memory but the actual + * arrays are in far memory (same arrangement as we use for image arrays). + */ + +#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ + +/* These will do the right thing for either R,G,B or B,G,R color order, + * but you may not like the results for other color orders. + */ +#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ +#define HIST_C1_BITS 6 /* bits of precision in G histogram */ +#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ + +/* Number of elements along histogram axes. */ +#define HIST_C0_ELEMS (1<cquantize; + register JSAMPROW ptr; + register histptr histp; + register hist3d histogram = cquantize->histogram; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + ptr = input_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the histogram */ + histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] + [GETJSAMPLE(ptr[1]) >> C1_SHIFT] + [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; + /* increment, check for overflow and undo increment if so. */ + if (++(*histp) <= 0) + (*histp)--; + ptr += 3; + } + } +} + + +/* + * Next we have the really interesting routines: selection of a colormap + * given the completed histogram. + * These routines work with a list of "boxes", each representing a rectangular + * subset of the input color space (to histogram precision). + */ + +typedef struct { + /* The bounds of the box (inclusive); expressed as histogram indexes */ + int c0min, c0max; + int c1min, c1max; + int c2min, c2max; + /* The volume (actually 2-norm) of the box */ + INT32 volume; + /* The number of nonzero histogram cells within this box */ + long colorcount; +} box; + +typedef box * boxptr; + + +LOCAL(boxptr) +find_biggest_color_pop (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest color population */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register long maxc = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->colorcount > maxc && boxp->volume > 0) { + which = boxp; + maxc = boxp->colorcount; + } + } + return which; +} + + +LOCAL(boxptr) +find_biggest_volume (boxptr boxlist, int numboxes) +/* Find the splittable box with the largest (scaled) volume */ +/* Returns NULL if no splittable boxes remain */ +{ + register boxptr boxp; + register int i; + register INT32 maxv = 0; + boxptr which = NULL; + + for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { + if (boxp->volume > maxv) { + which = boxp; + maxv = boxp->volume; + } + } + return which; +} + + +LOCAL(void) +update_box (j_decompress_ptr cinfo, boxptr boxp) +/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ +/* and recompute its volume and population */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + INT32 dist0,dist1,dist2; + long ccount; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + if (c0max > c0min) + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0min = c0min = c0; + goto have_c0min; + } + } + have_c0min: + if (c0max > c0min) + for (c0 = c0max; c0 >= c0min; c0--) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c0max = c0max = c0; + goto have_c0max; + } + } + have_c0max: + if (c1max > c1min) + for (c1 = c1min; c1 <= c1max; c1++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1min = c1min = c1; + goto have_c1min; + } + } + have_c1min: + if (c1max > c1min) + for (c1 = c1max; c1 >= c1min; c1--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) + if (*histp++ != 0) { + boxp->c1max = c1max = c1; + goto have_c1max; + } + } + have_c1max: + if (c2max > c2min) + for (c2 = c2min; c2 <= c2max; c2++) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2min = c2min = c2; + goto have_c2min; + } + } + have_c2min: + if (c2max > c2min) + for (c2 = c2max; c2 >= c2min; c2--) + for (c0 = c0min; c0 <= c0max; c0++) { + histp = & histogram[c0][c1min][c2]; + for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) + if (*histp != 0) { + boxp->c2max = c2max = c2; + goto have_c2max; + } + } + have_c2max: + + /* Update box volume. + * We use 2-norm rather than real volume here; this biases the method + * against making long narrow boxes, and it has the side benefit that + * a box is splittable iff norm > 0. + * Since the differences are expressed in histogram-cell units, + * we have to shift back to JSAMPLE units to get consistent distances; + * after which, we scale according to the selected distance scale factors. + */ + dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; + dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; + dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; + boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; + + /* Now scan remaining volume of box and compute population */ + ccount = 0; + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++, histp++) + if (*histp != 0) { + ccount++; + } + } + boxp->colorcount = ccount; +} + + +LOCAL(int) +median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, + int desired_colors) +/* Repeatedly select and split the largest box until we have enough boxes */ +{ + int n,lb; + int c0,c1,c2,cmax; + register boxptr b1,b2; + + while (numboxes < desired_colors) { + /* Select box to split. + * Current algorithm: by population for first half, then by volume. + */ + if (numboxes*2 <= desired_colors) { + b1 = find_biggest_color_pop(boxlist, numboxes); + } else { + b1 = find_biggest_volume(boxlist, numboxes); + } + if (b1 == NULL) /* no splittable boxes left! */ + break; + b2 = &boxlist[numboxes]; /* where new box will go */ + /* Copy the color bounds to the new box. */ + b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; + b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; + /* Choose which axis to split the box on. + * Current algorithm: longest scaled axis. + * See notes in update_box about scaling distances. + */ + c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; + c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; + c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; + /* We want to break any ties in favor of green, then red, blue last. + * This code does the right thing for R,G,B or B,G,R color orders only. + */ +#if RGB_RED == 0 + cmax = c1; n = 1; + if (c0 > cmax) { cmax = c0; n = 0; } + if (c2 > cmax) { n = 2; } +#else + cmax = c1; n = 1; + if (c2 > cmax) { cmax = c2; n = 2; } + if (c0 > cmax) { n = 0; } +#endif + /* Choose split point along selected axis, and update box bounds. + * Current algorithm: split at halfway point. + * (Since the box has been shrunk to minimum volume, + * any split will produce two nonempty subboxes.) + * Note that lb value is max for lower box, so must be < old max. + */ + switch (n) { + case 0: + lb = (b1->c0max + b1->c0min) / 2; + b1->c0max = lb; + b2->c0min = lb+1; + break; + case 1: + lb = (b1->c1max + b1->c1min) / 2; + b1->c1max = lb; + b2->c1min = lb+1; + break; + case 2: + lb = (b1->c2max + b1->c2min) / 2; + b1->c2max = lb; + b2->c2min = lb+1; + break; + } + /* Update stats for boxes */ + update_box(cinfo, b1); + update_box(cinfo, b2); + numboxes++; + } + return numboxes; +} + + +LOCAL(void) +compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) +/* Compute representative color for a box, put it in colormap[icolor] */ +{ + /* Current algorithm: mean weighted by pixels (not colors) */ + /* Note it is important to get the rounding correct! */ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + histptr histp; + int c0,c1,c2; + int c0min,c0max,c1min,c1max,c2min,c2max; + long count; + long total = 0; + long c0total = 0; + long c1total = 0; + long c2total = 0; + + c0min = boxp->c0min; c0max = boxp->c0max; + c1min = boxp->c1min; c1max = boxp->c1max; + c2min = boxp->c2min; c2max = boxp->c2max; + + for (c0 = c0min; c0 <= c0max; c0++) + for (c1 = c1min; c1 <= c1max; c1++) { + histp = & histogram[c0][c1][c2min]; + for (c2 = c2min; c2 <= c2max; c2++) { + if ((count = *histp++) != 0) { + total += count; + c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; + c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; + c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; + } + } + } + + cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); + cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); + cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); +} + + +LOCAL(void) +select_colors (j_decompress_ptr cinfo, int desired_colors) +/* Master routine for color selection */ +{ + boxptr boxlist; + int numboxes; + int i; + + /* Allocate workspace for box list */ + boxlist = (boxptr) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box)); + /* Initialize one box containing whole space */ + numboxes = 1; + boxlist[0].c0min = 0; + boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; + boxlist[0].c1min = 0; + boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; + boxlist[0].c2min = 0; + boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; + /* Shrink it to actually-used volume and set its statistics */ + update_box(cinfo, & boxlist[0]); + /* Perform median-cut to produce final box list */ + numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); + /* Compute the representative color for each box, fill colormap */ + for (i = 0; i < numboxes; i++) + compute_color(cinfo, & boxlist[i], i); + cinfo->actual_number_of_colors = numboxes; + TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes); +} + + +/* + * These routines are concerned with the time-critical task of mapping input + * colors to the nearest color in the selected colormap. + * + * We re-use the histogram space as an "inverse color map", essentially a + * cache for the results of nearest-color searches. All colors within a + * histogram cell will be mapped to the same colormap entry, namely the one + * closest to the cell's center. This may not be quite the closest entry to + * the actual input color, but it's almost as good. A zero in the cache + * indicates we haven't found the nearest color for that cell yet; the array + * is cleared to zeroes before starting the mapping pass. When we find the + * nearest color for a cell, its colormap index plus one is recorded in the + * cache for future use. The pass2 scanning routines call fill_inverse_cmap + * when they need to use an unfilled entry in the cache. + * + * Our method of efficiently finding nearest colors is based on the "locally + * sorted search" idea described by Heckbert and on the incremental distance + * calculation described by Spencer W. Thomas in chapter III.1 of Graphics + * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that + * the distances from a given colormap entry to each cell of the histogram can + * be computed quickly using an incremental method: the differences between + * distances to adjacent cells themselves differ by a constant. This allows a + * fairly fast implementation of the "brute force" approach of computing the + * distance from every colormap entry to every histogram cell. Unfortunately, + * it needs a work array to hold the best-distance-so-far for each histogram + * cell (because the inner loop has to be over cells, not colormap entries). + * The work array elements have to be INT32s, so the work array would need + * 256Kb at our recommended precision. This is not feasible in DOS machines. + * + * To get around these problems, we apply Thomas' method to compute the + * nearest colors for only the cells within a small subbox of the histogram. + * The work array need be only as big as the subbox, so the memory usage + * problem is solved. Furthermore, we need not fill subboxes that are never + * referenced in pass2; many images use only part of the color gamut, so a + * fair amount of work is saved. An additional advantage of this + * approach is that we can apply Heckbert's locality criterion to quickly + * eliminate colormap entries that are far away from the subbox; typically + * three-fourths of the colormap entries are rejected by Heckbert's criterion, + * and we need not compute their distances to individual cells in the subbox. + * The speed of this approach is heavily influenced by the subbox size: too + * small means too much overhead, too big loses because Heckbert's criterion + * can't eliminate as many colormap entries. Empirically the best subbox + * size seems to be about 1/512th of the histogram (1/8th in each direction). + * + * Thomas' article also describes a refined method which is asymptotically + * faster than the brute-force method, but it is also far more complex and + * cannot efficiently be applied to small subboxes. It is therefore not + * useful for programs intended to be portable to DOS machines. On machines + * with plenty of memory, filling the whole histogram in one shot with Thomas' + * refined method might be faster than the present code --- but then again, + * it might not be any faster, and it's certainly more complicated. + */ + + +/* log2(histogram cells in update box) for each axis; this can be adjusted */ +#define BOX_C0_LOG (HIST_C0_BITS-3) +#define BOX_C1_LOG (HIST_C1_BITS-3) +#define BOX_C2_LOG (HIST_C2_BITS-3) + +#define BOX_C0_ELEMS (1<actual_number_of_colors; + int maxc0, maxc1, maxc2; + int centerc0, centerc1, centerc2; + int i, x, ncolors; + INT32 minmaxdist, min_dist, max_dist, tdist; + INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ + + /* Compute true coordinates of update box's upper corner and center. + * Actually we compute the coordinates of the center of the upper-corner + * histogram cell, which are the upper bounds of the volume we care about. + * Note that since ">>" rounds down, the "center" values may be closer to + * min than to max; hence comparisons to them must be "<=", not "<". + */ + maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); + centerc0 = (minc0 + maxc0) >> 1; + maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); + centerc1 = (minc1 + maxc1) >> 1; + maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); + centerc2 = (minc2 + maxc2) >> 1; + + /* For each color in colormap, find: + * 1. its minimum squared-distance to any point in the update box + * (zero if color is within update box); + * 2. its maximum squared-distance to any point in the update box. + * Both of these can be found by considering only the corners of the box. + * We save the minimum distance for each color in mindist[]; + * only the smallest maximum distance is of interest. + */ + minmaxdist = 0x7FFFFFFFL; + + for (i = 0; i < numcolors; i++) { + /* We compute the squared-c0-distance term, then add in the other two. */ + x = GETJSAMPLE(cinfo->colormap[0][i]); + if (x < minc0) { + tdist = (x - minc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else if (x > maxc0) { + tdist = (x - maxc0) * C0_SCALE; + min_dist = tdist*tdist; + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + min_dist = 0; + if (x <= centerc0) { + tdist = (x - maxc0) * C0_SCALE; + max_dist = tdist*tdist; + } else { + tdist = (x - minc0) * C0_SCALE; + max_dist = tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[1][i]); + if (x < minc1) { + tdist = (x - minc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc1) { + tdist = (x - maxc1) * C1_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc1) { + tdist = (x - maxc1) * C1_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc1) * C1_SCALE; + max_dist += tdist*tdist; + } + } + + x = GETJSAMPLE(cinfo->colormap[2][i]); + if (x < minc2) { + tdist = (x - minc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else if (x > maxc2) { + tdist = (x - maxc2) * C2_SCALE; + min_dist += tdist*tdist; + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + /* within cell range so no contribution to min_dist */ + if (x <= centerc2) { + tdist = (x - maxc2) * C2_SCALE; + max_dist += tdist*tdist; + } else { + tdist = (x - minc2) * C2_SCALE; + max_dist += tdist*tdist; + } + } + + mindist[i] = min_dist; /* save away the results */ + if (max_dist < minmaxdist) + minmaxdist = max_dist; + } + + /* Now we know that no cell in the update box is more than minmaxdist + * away from some colormap entry. Therefore, only colors that are + * within minmaxdist of some part of the box need be considered. + */ + ncolors = 0; + for (i = 0; i < numcolors; i++) { + if (mindist[i] <= minmaxdist) + colorlist[ncolors++] = (JSAMPLE) i; + } + return ncolors; +} + + +LOCAL(void) +find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, + int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[]) +/* Find the closest colormap entry for each cell in the update box, + * given the list of candidate colors prepared by find_nearby_colors. + * Return the indexes of the closest entries in the bestcolor[] array. + * This routine uses Thomas' incremental distance calculation method to + * find the distance from a colormap entry to successive cells in the box. + */ +{ + int ic0, ic1, ic2; + int i, icolor; + register INT32 * bptr; /* pointer into bestdist[] array */ + JSAMPLE * cptr; /* pointer into bestcolor[] array */ + INT32 dist0, dist1; /* initial distance values */ + register INT32 dist2; /* current distance in inner loop */ + INT32 xx0, xx1; /* distance increments */ + register INT32 xx2; + INT32 inc0, inc1, inc2; /* initial values for increments */ + /* This array holds the distance to the nearest-so-far color for each cell */ + INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Initialize best-distance for each cell of the update box */ + bptr = bestdist; + for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) + *bptr++ = 0x7FFFFFFFL; + + /* For each color selected by find_nearby_colors, + * compute its distance to the center of each cell in the box. + * If that's less than best-so-far, update best distance and color number. + */ + + /* Nominal steps between cell centers ("x" in Thomas article) */ +#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) +#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) +#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) + + for (i = 0; i < numcolors; i++) { + icolor = GETJSAMPLE(colorlist[i]); + /* Compute (square of) distance from minc0/c1/c2 to this color */ + inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; + dist0 = inc0*inc0; + inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; + dist0 += inc1*inc1; + inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; + dist0 += inc2*inc2; + /* Form the initial difference increments */ + inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; + inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; + inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; + /* Now loop over all cells in box, updating distance per Thomas method */ + bptr = bestdist; + cptr = bestcolor; + xx0 = inc0; + for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { + dist1 = dist0; + xx1 = inc1; + for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { + dist2 = dist1; + xx2 = inc2; + for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { + if (dist2 < *bptr) { + *bptr = dist2; + *cptr = (JSAMPLE) icolor; + } + dist2 += xx2; + xx2 += 2 * STEP_C2 * STEP_C2; + bptr++; + cptr++; + } + dist1 += xx1; + xx1 += 2 * STEP_C1 * STEP_C1; + } + dist0 += xx0; + xx0 += 2 * STEP_C0 * STEP_C0; + } + } +} + + +LOCAL(void) +fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) +/* Fill the inverse-colormap entries in the update box that contains */ +/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ +/* we can fill as many others as we wish.) */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int minc0, minc1, minc2; /* lower left corner of update box */ + int ic0, ic1, ic2; + register JSAMPLE * cptr; /* pointer into bestcolor[] array */ + register histptr cachep; /* pointer into main cache array */ + /* This array lists the candidate colormap indexes. */ + JSAMPLE colorlist[MAXNUMCOLORS]; + int numcolors; /* number of candidate colors */ + /* This array holds the actually closest colormap index for each cell. */ + JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; + + /* Convert cell coordinates to update box ID */ + c0 >>= BOX_C0_LOG; + c1 >>= BOX_C1_LOG; + c2 >>= BOX_C2_LOG; + + /* Compute true coordinates of update box's origin corner. + * Actually we compute the coordinates of the center of the corner + * histogram cell, which are the lower bounds of the volume we care about. + */ + minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); + minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); + minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); + + /* Determine which colormap entries are close enough to be candidates + * for the nearest entry to some cell in the update box. + */ + numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); + + /* Determine the actually nearest colors. */ + find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, + bestcolor); + + /* Save the best color numbers (plus 1) in the main cache array */ + c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ + c1 <<= BOX_C1_LOG; + c2 <<= BOX_C2_LOG; + cptr = bestcolor; + for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { + for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { + cachep = & histogram[c0+ic0][c1+ic1][c2]; + for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { + *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); + } + } + } +} + + +/* + * Map some rows of pixels to the output colormapped representation. + */ + +METHODDEF(void) +pass2_no_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs no dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register JSAMPROW inptr, outptr; + register histptr cachep; + register int c0, c1, c2; + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + for (col = width; col > 0; col--) { + /* get pixel value and index into the cache */ + c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; + c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; + c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; + cachep = & histogram[c0][c1][c2]; + /* If we have not seen this color before, find nearest colormap entry */ + /* and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, c0,c1,c2); + /* Now emit the colormap index for this cell */ + *outptr++ = (JSAMPLE) (*cachep - 1); + } + } +} + + +METHODDEF(void) +pass2_fs_dither (j_decompress_ptr cinfo, + JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) +/* This version performs Floyd-Steinberg dithering */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ + LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ + LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ + register FSERRPTR errorptr; /* => fserrors[] at column before current */ + JSAMPROW inptr; /* => current input pixel */ + JSAMPROW outptr; /* => current output pixel */ + histptr cachep; + int dir; /* +1 or -1 depending on direction */ + int dir3; /* 3*dir, for advancing inptr & errorptr */ + int row; + JDIMENSION col; + JDIMENSION width = cinfo->output_width; + JSAMPLE *range_limit = cinfo->sample_range_limit; + int *error_limit = cquantize->error_limiter; + JSAMPROW colormap0 = cinfo->colormap[0]; + JSAMPROW colormap1 = cinfo->colormap[1]; + JSAMPROW colormap2 = cinfo->colormap[2]; + SHIFT_TEMPS + + for (row = 0; row < num_rows; row++) { + inptr = input_buf[row]; + outptr = output_buf[row]; + if (cquantize->on_odd_row) { + /* work right to left in this row */ + inptr += (width-1) * 3; /* so point to rightmost pixel */ + outptr += width-1; + dir = -1; + dir3 = -3; + errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ + cquantize->on_odd_row = FALSE; /* flip for next time */ + } else { + /* work left to right in this row */ + dir = 1; + dir3 = 3; + errorptr = cquantize->fserrors; /* => entry before first real column */ + cquantize->on_odd_row = TRUE; /* flip for next time */ + } + /* Preset error values: no error propagated to first pixel from left */ + cur0 = cur1 = cur2 = 0; + /* and no error propagated to row below yet */ + belowerr0 = belowerr1 = belowerr2 = 0; + bpreverr0 = bpreverr1 = bpreverr2 = 0; + + for (col = width; col > 0; col--) { + /* curN holds the error propagated from the previous pixel on the + * current line. Add the error propagated from the previous line + * to form the complete error correction term for this pixel, and + * round the error term (which is expressed * 16) to an integer. + * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct + * for either sign of the error value. + * Note: errorptr points to *previous* column's array entry. + */ + cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); + cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); + cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); + /* Limit the error using transfer function set by init_error_limit. + * See comments with init_error_limit for rationale. + */ + cur0 = error_limit[cur0]; + cur1 = error_limit[cur1]; + cur2 = error_limit[cur2]; + /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. + * The maximum error is +- MAXJSAMPLE (or less with error limiting); + * this sets the required size of the range_limit array. + */ + cur0 += GETJSAMPLE(inptr[0]); + cur1 += GETJSAMPLE(inptr[1]); + cur2 += GETJSAMPLE(inptr[2]); + cur0 = GETJSAMPLE(range_limit[cur0]); + cur1 = GETJSAMPLE(range_limit[cur1]); + cur2 = GETJSAMPLE(range_limit[cur2]); + /* Index into the cache with adjusted pixel value */ + cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; + /* If we have not seen this color before, find nearest colormap */ + /* entry and update the cache */ + if (*cachep == 0) + fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT); + /* Now emit the colormap index for this cell */ + { register int pixcode = *cachep - 1; + *outptr = (JSAMPLE) pixcode; + /* Compute representation error for this pixel */ + cur0 -= GETJSAMPLE(colormap0[pixcode]); + cur1 -= GETJSAMPLE(colormap1[pixcode]); + cur2 -= GETJSAMPLE(colormap2[pixcode]); + } + /* Compute error fractions to be propagated to adjacent pixels. + * Add these into the running sums, and simultaneously shift the + * next-line error sums left by 1 column. + */ + { register LOCFSERROR bnexterr, delta; + + bnexterr = cur0; /* Process component 0 */ + delta = cur0 * 2; + cur0 += delta; /* form error * 3 */ + errorptr[0] = (FSERROR) (bpreverr0 + cur0); + cur0 += delta; /* form error * 5 */ + bpreverr0 = belowerr0 + cur0; + belowerr0 = bnexterr; + cur0 += delta; /* form error * 7 */ + bnexterr = cur1; /* Process component 1 */ + delta = cur1 * 2; + cur1 += delta; /* form error * 3 */ + errorptr[1] = (FSERROR) (bpreverr1 + cur1); + cur1 += delta; /* form error * 5 */ + bpreverr1 = belowerr1 + cur1; + belowerr1 = bnexterr; + cur1 += delta; /* form error * 7 */ + bnexterr = cur2; /* Process component 2 */ + delta = cur2 * 2; + cur2 += delta; /* form error * 3 */ + errorptr[2] = (FSERROR) (bpreverr2 + cur2); + cur2 += delta; /* form error * 5 */ + bpreverr2 = belowerr2 + cur2; + belowerr2 = bnexterr; + cur2 += delta; /* form error * 7 */ + } + /* At this point curN contains the 7/16 error value to be propagated + * to the next pixel on the current line, and all the errors for the + * next line have been shifted over. We are therefore ready to move on. + */ + inptr += dir3; /* Advance pixel pointers to next column */ + outptr += dir; + errorptr += dir3; /* advance errorptr to current column */ + } + /* Post-loop cleanup: we must unload the final error values into the + * final fserrors[] entry. Note we need not unload belowerrN because + * it is for the dummy column before or after the actual array. + */ + errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ + errorptr[1] = (FSERROR) bpreverr1; + errorptr[2] = (FSERROR) bpreverr2; + } +} + + +/* + * Initialize the error-limiting transfer function (lookup table). + * The raw F-S error computation can potentially compute error values of up to + * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be + * much less, otherwise obviously wrong pixels will be created. (Typical + * effects include weird fringes at color-area boundaries, isolated bright + * pixels in a dark area, etc.) The standard advice for avoiding this problem + * is to ensure that the "corners" of the color cube are allocated as output + * colors; then repeated errors in the same direction cannot cause cascading + * error buildup. However, that only prevents the error from getting + * completely out of hand; Aaron Giles reports that error limiting improves + * the results even with corner colors allocated. + * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty + * well, but the smoother transfer function used below is even better. Thanks + * to Aaron Giles for this idea. + */ + +LOCAL(void) +init_error_limit (j_decompress_ptr cinfo) +/* Allocate and fill in the error_limiter table */ +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + int * table; + int in, out; + + table = (int *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int)); + table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ + cquantize->error_limiter = table; + +#define STEPSIZE ((MAXJSAMPLE+1)/16) + /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ + out = 0; + for (in = 0; in < STEPSIZE; in++, out++) { + table[in] = out; table[-in] = -out; + } + /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ + for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { + table[in] = out; table[-in] = -out; + } + /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ + for (; in <= MAXJSAMPLE; in++) { + table[in] = out; table[-in] = -out; + } +#undef STEPSIZE +} + + +/* + * Finish up at the end of each pass. + */ + +METHODDEF(void) +finish_pass1 (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Select the representative colors and fill in cinfo->colormap */ + cinfo->colormap = cquantize->sv_colormap; + select_colors(cinfo, cquantize->desired); + /* Force next pass to zero the color index table */ + cquantize->needs_zeroed = TRUE; +} + + +METHODDEF(void) +finish_pass2 (j_decompress_ptr cinfo) +{ + /* no work */ +} + + +/* + * Initialize for each processing pass. + */ + +METHODDEF(void) +start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + hist3d histogram = cquantize->histogram; + int i; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + if (is_pre_scan) { + /* Set up method pointers */ + cquantize->pub.color_quantize = prescan_quantize; + cquantize->pub.finish_pass = finish_pass1; + cquantize->needs_zeroed = TRUE; /* Always zero histogram */ + } else { + /* Set up method pointers */ + if (cinfo->dither_mode == JDITHER_FS) + cquantize->pub.color_quantize = pass2_fs_dither; + else + cquantize->pub.color_quantize = pass2_no_dither; + cquantize->pub.finish_pass = finish_pass2; + + /* Make sure color count is acceptable */ + i = cinfo->actual_number_of_colors; + if (i < 1) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1); + if (i > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + + if (cinfo->dither_mode == JDITHER_FS) { + size_t arraysize = (size_t) ((cinfo->output_width + 2) * + (3 * SIZEOF(FSERROR))); + /* Allocate Floyd-Steinberg workspace if we didn't already. */ + if (cquantize->fserrors == NULL) + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); + /* Initialize the propagated errors to zero. */ + FMEMZERO((void FAR *) cquantize->fserrors, arraysize); + /* Make the error-limit table if we didn't already. */ + if (cquantize->error_limiter == NULL) + init_error_limit(cinfo); + cquantize->on_odd_row = FALSE; + } + + } + /* Zero the histogram or inverse color map, if necessary */ + if (cquantize->needs_zeroed) { + for (i = 0; i < HIST_C0_ELEMS; i++) { + FMEMZERO((void FAR *) histogram[i], + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = FALSE; + } +} + + +/* + * Switch to a new external colormap between output passes. + */ + +METHODDEF(void) +new_color_map_2_quant (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; + + /* Reset the inverse color map */ + cquantize->needs_zeroed = TRUE; +} + + +/* + * Module initialization routine for 2-pass color quantization. + */ + +GLOBAL(void) +jinit_2pass_quantizer (j_decompress_ptr cinfo) +{ + my_cquantize_ptr cquantize; + int i; + + cquantize = (my_cquantize_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(my_cquantizer)); + cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; + cquantize->pub.start_pass = start_pass_2_quant; + cquantize->pub.new_color_map = new_color_map_2_quant; + cquantize->fserrors = NULL; /* flag optional arrays not allocated */ + cquantize->error_limiter = NULL; + + /* Make sure jdmaster didn't give me a case I can't handle */ + if (cinfo->out_color_components != 3) + ERREXIT(cinfo, JERR_NOTIMPL); + + /* Allocate the histogram/inverse colormap storage */ + cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d)); + for (i = 0; i < HIST_C0_ELEMS; i++) { + cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); + } + cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ + + /* Allocate storage for the completed colormap, if required. + * We do this now since it is FAR storage and may affect + * the memory manager's space calculations. + */ + if (cinfo->enable_2pass_quant) { + /* Make sure color count is acceptable */ + int desired = cinfo->desired_number_of_colors; + /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ + if (desired < 8) + ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8); + /* Make sure colormap indexes can be represented by JSAMPLEs */ + if (desired > MAXNUMCOLORS) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); + cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); + cquantize->desired = desired; + } else + cquantize->sv_colormap = NULL; + + /* Only F-S dithering or no dithering is supported. */ + /* If user asks for ordered dither, give him F-S. */ + if (cinfo->dither_mode != JDITHER_NONE) + cinfo->dither_mode = JDITHER_FS; + + /* Allocate Floyd-Steinberg workspace if necessary. + * This isn't really needed until pass 2, but again it is FAR storage. + * Although we will cope with a later change in dither_mode, + * we do not promise to honor max_memory_to_use if dither_mode changes. + */ + if (cinfo->dither_mode == JDITHER_FS) { + cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR)))); + /* Might as well create the error-limiting table too. */ + init_error_limit(cinfo); + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/jutils.c b/thirdparty/LibJPEG/jpeg-9/jutils.c new file mode 100644 index 0000000..5b16b6d --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jutils.c @@ -0,0 +1,227 @@ +/* + * jutils.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2009-2011 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains tables and miscellaneous utility routines needed + * for both compression and decompression. + * Note we prefix all global names with "j" to minimize conflicts with + * a surrounding application. + */ + +#define JPEG_INTERNALS +#include "jinclude.h" +#include "jpeglib.h" + + +/* + * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element + * of a DCT block read in natural order (left to right, top to bottom). + */ + +#if 0 /* This table is not actually needed in v6a */ + +const int jpeg_zigzag_order[DCTSIZE2] = { + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 43, + 9, 11, 18, 24, 31, 40, 44, 53, + 10, 19, 23, 32, 39, 45, 52, 54, + 20, 22, 33, 38, 46, 51, 55, 60, + 21, 34, 37, 47, 50, 56, 59, 61, + 35, 36, 48, 49, 57, 58, 62, 63 +}; + +#endif + +/* + * jpeg_natural_order[i] is the natural-order position of the i'th element + * of zigzag order. + * + * When reading corrupted data, the Huffman decoders could attempt + * to reference an entry beyond the end of this array (if the decoded + * zero run length reaches past the end of the block). To prevent + * wild stores without adding an inner-loop test, we put some extra + * "63"s after the real entries. This will cause the extra coefficient + * to be stored in location 63 of the block, not somewhere random. + * The worst case would be a run-length of 15, which means we need 16 + * fake entries. + */ + +const int jpeg_natural_order[DCTSIZE2+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order7[7*7+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 14, 21, 28, 35, + 42, 49, 50, 43, 36, 29, 22, 30, + 37, 44, 51, 52, 45, 38, 46, 53, + 54, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order6[6*6+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 41, 34, 27, + 20, 13, 21, 28, 35, 42, 43, 36, + 29, 37, 44, 45, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order5[5*5+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 12, + 19, 26, 33, 34, 27, 20, 28, 35, + 36, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order4[4*4+16] = { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 25, 18, 11, 19, 26, 27, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order3[3*3+16] = { + 0, 1, 8, 16, 9, 2, 10, 17, + 18, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + +const int jpeg_natural_order2[2*2+16] = { + 0, 1, 8, 9, + 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ + 63, 63, 63, 63, 63, 63, 63, 63 +}; + + +/* + * Arithmetic utilities + */ + +GLOBAL(long) +jdiv_round_up (long a, long b) +/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ +/* Assumes a >= 0, b > 0 */ +{ + return (a + b - 1L) / b; +} + + +GLOBAL(long) +jround_up (long a, long b) +/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ +/* Assumes a >= 0, b > 0 */ +{ + a += b - 1L; + return a - (a % b); +} + + +/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays + * and coefficient-block arrays. This won't work on 80x86 because the arrays + * are FAR and we're assuming a small-pointer memory model. However, some + * DOS compilers provide far-pointer versions of memcpy() and memset() even + * in the small-model libraries. These will be used if USE_FMEM is defined. + * Otherwise, the routines below do it the hard way. (The performance cost + * is not all that great, because these routines aren't very heavily used.) + */ + +#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */ +#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) +#else /* 80x86 case, define if we can */ +#ifdef USE_FMEM +#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) +#else +/* This function is for use by the FMEMZERO macro defined in jpegint.h. + * Do not call this function directly, use the FMEMZERO macro instead. + */ +GLOBAL(void) +jzero_far (void FAR * target, size_t bytestozero) +/* Zero out a chunk of FAR memory. */ +/* This might be sample-array data, block-array data, or alloc_large data. */ +{ + register char FAR * ptr = (char FAR *) target; + register size_t count; + + for (count = bytestozero; count > 0; count--) { + *ptr++ = 0; + } +} +#endif +#endif + + +GLOBAL(void) +jcopy_sample_rows (JSAMPARRAY input_array, int source_row, + JSAMPARRAY output_array, int dest_row, + int num_rows, JDIMENSION num_cols) +/* Copy some rows of samples from one place to another. + * num_rows rows are copied from input_array[source_row++] + * to output_array[dest_row++]; these areas may overlap for duplication. + * The source and destination arrays must be at least as wide as num_cols. + */ +{ + register JSAMPROW inptr, outptr; +#ifdef FMEMCOPY + register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); +#else + register JDIMENSION count; +#endif + register int row; + + input_array += source_row; + output_array += dest_row; + + for (row = num_rows; row > 0; row--) { + inptr = *input_array++; + outptr = *output_array++; +#ifdef FMEMCOPY + FMEMCOPY(outptr, inptr, count); +#else + for (count = num_cols; count > 0; count--) + *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ +#endif + } +} + + +GLOBAL(void) +jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, + JDIMENSION num_blocks) +/* Copy a row of coefficient blocks from one place to another. */ +{ +#ifdef FMEMCOPY + FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); +#else + register JCOEFPTR inptr, outptr; + register long count; + + inptr = (JCOEFPTR) input_row; + outptr = (JCOEFPTR) output_row; + for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { + *outptr++ = *inptr++; + } +#endif +} diff --git a/thirdparty/LibJPEG/jpeg-9/jversion.h b/thirdparty/LibJPEG/jpeg-9/jversion.h new file mode 100644 index 0000000..232085f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/jversion.h @@ -0,0 +1,14 @@ +/* + * jversion.h + * + * Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains software version identification. + */ + + +#define JVERSION "9 13-Jan-2013" + +#define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding" diff --git a/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9.lib b/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9.lib new file mode 100644 index 0000000..df21336 Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9.lib differ diff --git a/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9_64.lib b/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9_64.lib new file mode 100644 index 0000000..a71e99f Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/lib/LibJPEG-9_64.lib differ diff --git a/thirdparty/LibJPEG/jpeg-9/lib/libjpeg.a b/thirdparty/LibJPEG/jpeg-9/lib/libjpeg.a new file mode 100644 index 0000000..2e7ce68 Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/lib/libjpeg.a differ diff --git a/thirdparty/LibJPEG/jpeg-9/libjpeg.map b/thirdparty/LibJPEG/jpeg-9/libjpeg.map new file mode 100644 index 0000000..fa70b1f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/libjpeg.map @@ -0,0 +1,4 @@ +LIBJPEG_9.0 { + global: + *; +}; diff --git a/thirdparty/LibJPEG/jpeg-9/libjpeg.txt b/thirdparty/LibJPEG/jpeg-9/libjpeg.txt new file mode 100644 index 0000000..292a127 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/libjpeg.txt @@ -0,0 +1,3098 @@ +USING THE IJG JPEG LIBRARY + +Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +This file describes how to use the IJG JPEG library within an application +program. Read it if you want to write a program that uses the library. + +The file example.c provides heavily commented skeleton code for calling the +JPEG library. Also see jpeglib.h (the include file to be used by application +programs) for full details about data structures and function parameter lists. +The library source code, of course, is the ultimate reference. + +Note that there have been *major* changes from the application interface +presented by IJG version 4 and earlier versions. The old design had several +inherent limitations, and it had accumulated a lot of cruft as we added +features while trying to minimize application-interface changes. We have +sacrificed backward compatibility in the version 5 rewrite, but we think the +improvements justify this. + + +TABLE OF CONTENTS +----------------- + +Overview: + Functions provided by the library + Outline of typical usage +Basic library usage: + Data formats + Compression details + Decompression details + Mechanics of usage: include files, linking, etc +Advanced features: + Compression parameter selection + Decompression parameter selection + Special color spaces + Error handling + Compressed data handling (source and destination managers) + I/O suspension + Progressive JPEG support + Buffered-image mode + Abbreviated datastreams and multiple images + Special markers + Raw (downsampled) image data + Really raw data: DCT coefficients + Progress monitoring + Memory management + Memory usage + Library compile-time options + Portability considerations + Notes for MS-DOS implementors + +You should read at least the overview and basic usage sections before trying +to program with the library. The sections on advanced features can be read +if and when you need them. + + +OVERVIEW +======== + +Functions provided by the library +--------------------------------- + +The IJG JPEG library provides C code to read and write JPEG-compressed image +files. The surrounding application program receives or supplies image data a +scanline at a time, using a straightforward uncompressed image format. All +details of color conversion and other preprocessing/postprocessing can be +handled by the library. + +The library includes a substantial amount of code that is not covered by the +JPEG standard but is necessary for typical applications of JPEG. These +functions preprocess the image before JPEG compression or postprocess it after +decompression. They include colorspace conversion, downsampling/upsampling, +and color quantization. The application indirectly selects use of this code +by specifying the format in which it wishes to supply or receive image data. +For example, if colormapped output is requested, then the decompression +library automatically invokes color quantization. + +A wide range of quality vs. speed tradeoffs are possible in JPEG processing, +and even more so in decompression postprocessing. The decompression library +provides multiple implementations that cover most of the useful tradeoffs, +ranging from very-high-quality down to fast-preview operation. On the +compression side we have generally not provided low-quality choices, since +compression is normally less time-critical. It should be understood that the +low-quality modes may not meet the JPEG standard's accuracy requirements; +nonetheless, they are useful for viewers. + +A word about functions *not* provided by the library. We handle a subset of +the ISO JPEG standard; most baseline, extended-sequential, and progressive +JPEG processes are supported. (Our subset includes all features now in common +use.) Unsupported ISO options include: + * Hierarchical storage + * Lossless JPEG + * DNL marker + * Nonintegral subsampling ratios +We support both 8- and 12-bit data precision, but this is a compile-time +choice rather than a run-time choice; hence it is difficult to use both +precisions in a single application. + +By itself, the library handles only interchange JPEG datastreams --- in +particular the widely used JFIF file format. The library can be used by +surrounding code to process interchange or abbreviated JPEG datastreams that +are embedded in more complex file formats. (For example, this library is +used by the free LIBTIFF library to support JPEG compression in TIFF.) + + +Outline of typical usage +------------------------ + +The rough outline of a JPEG compression operation is: + + Allocate and initialize a JPEG compression object + Specify the destination for the compressed data (eg, a file) + Set parameters for compression, including image size & colorspace + jpeg_start_compress(...); + while (scan lines remain to be written) + jpeg_write_scanlines(...); + jpeg_finish_compress(...); + Release the JPEG compression object + +A JPEG compression object holds parameters and working state for the JPEG +library. We make creation/destruction of the object separate from starting +or finishing compression of an image; the same object can be re-used for a +series of image compression operations. This makes it easy to re-use the +same parameter settings for a sequence of images. Re-use of a JPEG object +also has important implications for processing abbreviated JPEG datastreams, +as discussed later. + +The image data to be compressed is supplied to jpeg_write_scanlines() from +in-memory buffers. If the application is doing file-to-file compression, +reading image data from the source file is the application's responsibility. +The library emits compressed data by calling a "data destination manager", +which typically will write the data into a file; but the application can +provide its own destination manager to do something else. + +Similarly, the rough outline of a JPEG decompression operation is: + + Allocate and initialize a JPEG decompression object + Specify the source of the compressed data (eg, a file) + Call jpeg_read_header() to obtain image info + Set parameters for decompression + jpeg_start_decompress(...); + while (scan lines remain to be read) + jpeg_read_scanlines(...); + jpeg_finish_decompress(...); + Release the JPEG decompression object + +This is comparable to the compression outline except that reading the +datastream header is a separate step. This is helpful because information +about the image's size, colorspace, etc is available when the application +selects decompression parameters. For example, the application can choose an +output scaling ratio that will fit the image into the available screen size. + +The decompression library obtains compressed data by calling a data source +manager, which typically will read the data from a file; but other behaviors +can be obtained with a custom source manager. Decompressed data is delivered +into in-memory buffers passed to jpeg_read_scanlines(). + +It is possible to abort an incomplete compression or decompression operation +by calling jpeg_abort(); or, if you do not need to retain the JPEG object, +simply release it by calling jpeg_destroy(). + +JPEG compression and decompression objects are two separate struct types. +However, they share some common fields, and certain routines such as +jpeg_destroy() can work on either type of object. + +The JPEG library has no static variables: all state is in the compression +or decompression object. Therefore it is possible to process multiple +compression and decompression operations concurrently, using multiple JPEG +objects. + +Both compression and decompression can be done in an incremental memory-to- +memory fashion, if suitable source/destination managers are used. See the +section on "I/O suspension" for more details. + + +BASIC LIBRARY USAGE +=================== + +Data formats +------------ + +Before diving into procedural details, it is helpful to understand the +image data format that the JPEG library expects or returns. + +The standard input image format is a rectangular array of pixels, with each +pixel having the same number of "component" or "sample" values (color +channels). You must specify how many components there are and the colorspace +interpretation of the components. Most applications will use RGB data +(three components per pixel) or grayscale data (one component per pixel). +PLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE. +A remarkable number of people manage to miss this, only to find that their +programs don't work with grayscale JPEG files. + +There is no provision for colormapped input. JPEG files are always full-color +or full grayscale (or sometimes another colorspace such as CMYK). You can +feed in a colormapped image by expanding it to full-color format. However +JPEG often doesn't work very well with source data that has been colormapped, +because of dithering noise. This is discussed in more detail in the JPEG FAQ +and the other references mentioned in the README file. + +Pixels are stored by scanlines, with each scanline running from left to +right. The component values for each pixel are adjacent in the row; for +example, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color. Each scanline is an +array of data type JSAMPLE --- which is typically "unsigned char", unless +you've changed jmorecfg.h. (You can also change the RGB pixel layout, say +to B,G,R order, by modifying jmorecfg.h. But see the restrictions listed in +that file before doing so.) + +A 2-D array of pixels is formed by making a list of pointers to the starts of +scanlines; so the scanlines need not be physically adjacent in memory. Even +if you process just one scanline at a time, you must make a one-element +pointer array to conform to this structure. Pointers to JSAMPLE rows are of +type JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY. + +The library accepts or supplies one or more complete scanlines per call. +It is not possible to process part of a row at a time. Scanlines are always +processed top-to-bottom. You can process an entire image in one call if you +have it all in memory, but usually it's simplest to process one scanline at +a time. + +For best results, source data values should have the precision specified by +BITS_IN_JSAMPLE (normally 8 bits). For instance, if you choose to compress +data that's only 6 bits/channel, you should left-justify each value in a +byte before passing it to the compressor. If you need to compress data +that has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12. +(See "Library compile-time options", later.) + + +The data format returned by the decompressor is the same in all details, +except that colormapped output is supported. (Again, a JPEG file is never +colormapped. But you can ask the decompressor to perform on-the-fly color +quantization to deliver colormapped output.) If you request colormapped +output then the returned data array contains a single JSAMPLE per pixel; +its value is an index into a color map. The color map is represented as +a 2-D JSAMPARRAY in which each row holds the values of one color component, +that is, colormap[i][j] is the value of the i'th color component for pixel +value (map index) j. Note that since the colormap indexes are stored in +JSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE +(ie, at most 256 colors for an 8-bit JPEG library). + + +Compression details +------------------- + +Here we revisit the JPEG compression outline given in the overview. + +1. Allocate and initialize a JPEG compression object. + +A JPEG compression object is a "struct jpeg_compress_struct". (It also has +a bunch of subsidiary structures which are allocated via malloc(), but the +application doesn't control those directly.) This struct can be just a local +variable in the calling routine, if a single routine is going to execute the +whole JPEG compression sequence. Otherwise it can be static or allocated +from malloc(). + +You will also need a structure representing a JPEG error handler. The part +of this that the library cares about is a "struct jpeg_error_mgr". If you +are providing your own error handler, you'll typically want to embed the +jpeg_error_mgr struct in a larger structure; this is discussed later under +"Error handling". For now we'll assume you are just using the default error +handler. The default error handler will print JPEG error/warning messages +on stderr, and it will call exit() if a fatal error occurs. + +You must initialize the error handler structure, store a pointer to it into +the JPEG object's "err" field, and then call jpeg_create_compress() to +initialize the rest of the JPEG object. + +Typical code for this step, if you are using the default error handler, is + + struct jpeg_compress_struct cinfo; + struct jpeg_error_mgr jerr; + ... + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_compress(&cinfo); + +jpeg_create_compress allocates a small amount of memory, so it could fail +if you are out of memory. In that case it will exit via the error handler; +that's why the error handler must be initialized first. + + +2. Specify the destination for the compressed data (eg, a file). + +As previously mentioned, the JPEG library delivers compressed data to a +"data destination" module. The library includes one data destination +module which knows how to write to a stdio stream. You can use your own +destination module if you want to do something else, as discussed later. + +If you use the standard destination module, you must open the target stdio +stream beforehand. Typical code for this step looks like: + + FILE * outfile; + ... + if ((outfile = fopen(filename, "wb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + exit(1); + } + jpeg_stdio_dest(&cinfo, outfile); + +where the last line invokes the standard destination module. + +WARNING: it is critical that the binary compressed data be delivered to the +output file unchanged. On non-Unix systems the stdio library may perform +newline translation or otherwise corrupt binary data. To suppress this +behavior, you may need to use a "b" option to fopen (as shown above), or use +setmode() or another routine to put the stdio stream in binary mode. See +cjpeg.c and djpeg.c for code that has been found to work on many systems. + +You can select the data destination after setting other parameters (step 3), +if that's more convenient. You may not change the destination between +calling jpeg_start_compress() and jpeg_finish_compress(). + + +3. Set parameters for compression, including image size & colorspace. + +You must supply information about the source image by setting the following +fields in the JPEG object (cinfo structure): + + image_width Width of image, in pixels + image_height Height of image, in pixels + input_components Number of color channels (samples per pixel) + in_color_space Color space of source image + +The image dimensions are, hopefully, obvious. JPEG supports image dimensions +of 1 to 64K pixels in either direction. The input color space is typically +RGB or grayscale, and input_components is 3 or 1 accordingly. (See "Special +color spaces", later, for more info.) The in_color_space field must be +assigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or +JCS_GRAYSCALE. + +JPEG has a large number of compression parameters that determine how the +image is encoded. Most applications don't need or want to know about all +these parameters. You can set all the parameters to reasonable defaults by +calling jpeg_set_defaults(); then, if there are particular values you want +to change, you can do so after that. The "Compression parameter selection" +section tells about all the parameters. + +You must set in_color_space correctly before calling jpeg_set_defaults(), +because the defaults depend on the source image colorspace. However the +other three source image parameters need not be valid until you call +jpeg_start_compress(). There's no harm in calling jpeg_set_defaults() more +than once, if that happens to be convenient. + +Typical code for a 24-bit RGB source image is + + cinfo.image_width = Width; /* image width and height, in pixels */ + cinfo.image_height = Height; + cinfo.input_components = 3; /* # of color components per pixel */ + cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ + + jpeg_set_defaults(&cinfo); + /* Make optional parameter settings here */ + + +4. jpeg_start_compress(...); + +After you have established the data destination and set all the necessary +source image info and other parameters, call jpeg_start_compress() to begin +a compression cycle. This will initialize internal state, allocate working +storage, and emit the first few bytes of the JPEG datastream header. + +Typical code: + + jpeg_start_compress(&cinfo, TRUE); + +The "TRUE" parameter ensures that a complete JPEG interchange datastream +will be written. This is appropriate in most cases. If you think you might +want to use an abbreviated datastream, read the section on abbreviated +datastreams, below. + +Once you have called jpeg_start_compress(), you may not alter any JPEG +parameters or other fields of the JPEG object until you have completed +the compression cycle. + + +5. while (scan lines remain to be written) + jpeg_write_scanlines(...); + +Now write all the required image data by calling jpeg_write_scanlines() +one or more times. You can pass one or more scanlines in each call, up +to the total image height. In most applications it is convenient to pass +just one or a few scanlines at a time. The expected format for the passed +data is discussed under "Data formats", above. + +Image data should be written in top-to-bottom scanline order. The JPEG spec +contains some weasel wording about how top and bottom are application-defined +terms (a curious interpretation of the English language...) but if you want +your files to be compatible with everyone else's, you WILL use top-to-bottom +order. If the source data must be read in bottom-to-top order, you can use +the JPEG library's virtual array mechanism to invert the data efficiently. +Examples of this can be found in the sample application cjpeg. + +The library maintains a count of the number of scanlines written so far +in the next_scanline field of the JPEG object. Usually you can just use +this variable as the loop counter, so that the loop test looks like +"while (cinfo.next_scanline < cinfo.image_height)". + +Code for this step depends heavily on the way that you store the source data. +example.c shows the following code for the case of a full-size 2-D source +array containing 3-byte RGB pixels: + + JSAMPROW row_pointer[1]; /* pointer to a single row */ + int row_stride; /* physical row width in buffer */ + + row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */ + + while (cinfo.next_scanline < cinfo.image_height) { + row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride]; + jpeg_write_scanlines(&cinfo, row_pointer, 1); + } + +jpeg_write_scanlines() returns the number of scanlines actually written. +This will normally be equal to the number passed in, so you can usually +ignore the return value. It is different in just two cases: + * If you try to write more scanlines than the declared image height, + the additional scanlines are ignored. + * If you use a suspending data destination manager, output buffer overrun + will cause the compressor to return before accepting all the passed lines. + This feature is discussed under "I/O suspension", below. The normal + stdio destination manager will NOT cause this to happen. +In any case, the return value is the same as the change in the value of +next_scanline. + + +6. jpeg_finish_compress(...); + +After all the image data has been written, call jpeg_finish_compress() to +complete the compression cycle. This step is ESSENTIAL to ensure that the +last bufferload of data is written to the data destination. +jpeg_finish_compress() also releases working memory associated with the JPEG +object. + +Typical code: + + jpeg_finish_compress(&cinfo); + +If using the stdio destination manager, don't forget to close the output +stdio stream (if necessary) afterwards. + +If you have requested a multi-pass operating mode, such as Huffman code +optimization, jpeg_finish_compress() will perform the additional passes using +data buffered by the first pass. In this case jpeg_finish_compress() may take +quite a while to complete. With the default compression parameters, this will +not happen. + +It is an error to call jpeg_finish_compress() before writing the necessary +total number of scanlines. If you wish to abort compression, call +jpeg_abort() as discussed below. + +After completing a compression cycle, you may dispose of the JPEG object +as discussed next, or you may use it to compress another image. In that case +return to step 2, 3, or 4 as appropriate. If you do not change the +destination manager, the new datastream will be written to the same target. +If you do not change any JPEG parameters, the new datastream will be written +with the same parameters as before. Note that you can change the input image +dimensions freely between cycles, but if you change the input colorspace, you +should call jpeg_set_defaults() to adjust for the new colorspace; and then +you'll need to repeat all of step 3. + + +7. Release the JPEG compression object. + +When you are done with a JPEG compression object, destroy it by calling +jpeg_destroy_compress(). This will free all subsidiary memory (regardless of +the previous state of the object). Or you can call jpeg_destroy(), which +works for either compression or decompression objects --- this may be more +convenient if you are sharing code between compression and decompression +cases. (Actually, these routines are equivalent except for the declared type +of the passed pointer. To avoid gripes from ANSI C compilers, jpeg_destroy() +should be passed a j_common_ptr.) + +If you allocated the jpeg_compress_struct structure from malloc(), freeing +it is your responsibility --- jpeg_destroy() won't. Ditto for the error +handler structure. + +Typical code: + + jpeg_destroy_compress(&cinfo); + + +8. Aborting. + +If you decide to abort a compression cycle before finishing, you can clean up +in either of two ways: + +* If you don't need the JPEG object any more, just call + jpeg_destroy_compress() or jpeg_destroy() to release memory. This is + legitimate at any point after calling jpeg_create_compress() --- in fact, + it's safe even if jpeg_create_compress() fails. + +* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call + jpeg_abort() which works on both compression and decompression objects. + This will return the object to an idle state, releasing any working memory. + jpeg_abort() is allowed at any time after successful object creation. + +Note that cleaning up the data destination, if required, is your +responsibility; neither of these routines will call term_destination(). +(See "Compressed data handling", below, for more about that.) + +jpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG +object that has reported an error by calling error_exit (see "Error handling" +for more info). The internal state of such an object is likely to be out of +whack. Either of these two routines will return the object to a known state. + + +Decompression details +--------------------- + +Here we revisit the JPEG decompression outline given in the overview. + +1. Allocate and initialize a JPEG decompression object. + +This is just like initialization for compression, as discussed above, +except that the object is a "struct jpeg_decompress_struct" and you +call jpeg_create_decompress(). Error handling is exactly the same. + +Typical code: + + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + ... + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + +(Both here and in the IJG code, we usually use variable name "cinfo" for +both compression and decompression objects.) + + +2. Specify the source of the compressed data (eg, a file). + +As previously mentioned, the JPEG library reads compressed data from a "data +source" module. The library includes one data source module which knows how +to read from a stdio stream. You can use your own source module if you want +to do something else, as discussed later. + +If you use the standard source module, you must open the source stdio stream +beforehand. Typical code for this step looks like: + + FILE * infile; + ... + if ((infile = fopen(filename, "rb")) == NULL) { + fprintf(stderr, "can't open %s\n", filename); + exit(1); + } + jpeg_stdio_src(&cinfo, infile); + +where the last line invokes the standard source module. + +WARNING: it is critical that the binary compressed data be read unchanged. +On non-Unix systems the stdio library may perform newline translation or +otherwise corrupt binary data. To suppress this behavior, you may need to use +a "b" option to fopen (as shown above), or use setmode() or another routine to +put the stdio stream in binary mode. See cjpeg.c and djpeg.c for code that +has been found to work on many systems. + +You may not change the data source between calling jpeg_read_header() and +jpeg_finish_decompress(). If you wish to read a series of JPEG images from +a single source file, you should repeat the jpeg_read_header() to +jpeg_finish_decompress() sequence without reinitializing either the JPEG +object or the data source module; this prevents buffered input data from +being discarded. + + +3. Call jpeg_read_header() to obtain image info. + +Typical code for this step is just + + jpeg_read_header(&cinfo, TRUE); + +This will read the source datastream header markers, up to the beginning +of the compressed data proper. On return, the image dimensions and other +info have been stored in the JPEG object. The application may wish to +consult this information before selecting decompression parameters. + +More complex code is necessary if + * A suspending data source is used --- in that case jpeg_read_header() + may return before it has read all the header data. See "I/O suspension", + below. The normal stdio source manager will NOT cause this to happen. + * Abbreviated JPEG files are to be processed --- see the section on + abbreviated datastreams. Standard applications that deal only in + interchange JPEG files need not be concerned with this case either. + +It is permissible to stop at this point if you just wanted to find out the +image dimensions and other header info for a JPEG file. In that case, +call jpeg_destroy() when you are done with the JPEG object, or call +jpeg_abort() to return it to an idle state before selecting a new data +source and reading another header. + + +4. Set parameters for decompression. + +jpeg_read_header() sets appropriate default decompression parameters based on +the properties of the image (in particular, its colorspace). However, you +may well want to alter these defaults before beginning the decompression. +For example, the default is to produce full color output from a color file. +If you want colormapped output you must ask for it. Other options allow the +returned image to be scaled and allow various speed/quality tradeoffs to be +selected. "Decompression parameter selection", below, gives details. + +If the defaults are appropriate, nothing need be done at this step. + +Note that all default values are set by each call to jpeg_read_header(). +If you reuse a decompression object, you cannot expect your parameter +settings to be preserved across cycles, as you can for compression. +You must set desired parameter values each time. + + +5. jpeg_start_decompress(...); + +Once the parameter values are satisfactory, call jpeg_start_decompress() to +begin decompression. This will initialize internal state, allocate working +memory, and prepare for returning data. + +Typical code is just + + jpeg_start_decompress(&cinfo); + +If you have requested a multi-pass operating mode, such as 2-pass color +quantization, jpeg_start_decompress() will do everything needed before data +output can begin. In this case jpeg_start_decompress() may take quite a while +to complete. With a single-scan (non progressive) JPEG file and default +decompression parameters, this will not happen; jpeg_start_decompress() will +return quickly. + +After this call, the final output image dimensions, including any requested +scaling, are available in the JPEG object; so is the selected colormap, if +colormapped output has been requested. Useful fields include + + output_width image width and height, as scaled + output_height + out_color_components # of color components in out_color_space + output_components # of color components returned per pixel + colormap the selected colormap, if any + actual_number_of_colors number of entries in colormap + +output_components is 1 (a colormap index) when quantizing colors; otherwise it +equals out_color_components. It is the number of JSAMPLE values that will be +emitted per pixel in the output arrays. + +Typically you will need to allocate data buffers to hold the incoming image. +You will need output_width * output_components JSAMPLEs per scanline in your +output buffer, and a total of output_height scanlines will be returned. + +Note: if you are using the JPEG library's internal memory manager to allocate +data buffers (as djpeg does), then the manager's protocol requires that you +request large buffers *before* calling jpeg_start_decompress(). This is a +little tricky since the output_XXX fields are not normally valid then. You +can make them valid by calling jpeg_calc_output_dimensions() after setting the +relevant parameters (scaling, output color space, and quantization flag). + + +6. while (scan lines remain to be read) + jpeg_read_scanlines(...); + +Now you can read the decompressed image data by calling jpeg_read_scanlines() +one or more times. At each call, you pass in the maximum number of scanlines +to be read (ie, the height of your working buffer); jpeg_read_scanlines() +will return up to that many lines. The return value is the number of lines +actually read. The format of the returned data is discussed under "Data +formats", above. Don't forget that grayscale and color JPEGs will return +different data formats! + +Image data is returned in top-to-bottom scanline order. If you must write +out the image in bottom-to-top order, you can use the JPEG library's virtual +array mechanism to invert the data efficiently. Examples of this can be +found in the sample application djpeg. + +The library maintains a count of the number of scanlines returned so far +in the output_scanline field of the JPEG object. Usually you can just use +this variable as the loop counter, so that the loop test looks like +"while (cinfo.output_scanline < cinfo.output_height)". (Note that the test +should NOT be against image_height, unless you never use scaling. The +image_height field is the height of the original unscaled image.) +The return value always equals the change in the value of output_scanline. + +If you don't use a suspending data source, it is safe to assume that +jpeg_read_scanlines() reads at least one scanline per call, until the +bottom of the image has been reached. + +If you use a buffer larger than one scanline, it is NOT safe to assume that +jpeg_read_scanlines() fills it. (The current implementation returns only a +few scanlines per call, no matter how large a buffer you pass.) So you must +always provide a loop that calls jpeg_read_scanlines() repeatedly until the +whole image has been read. + + +7. jpeg_finish_decompress(...); + +After all the image data has been read, call jpeg_finish_decompress() to +complete the decompression cycle. This causes working memory associated +with the JPEG object to be released. + +Typical code: + + jpeg_finish_decompress(&cinfo); + +If using the stdio source manager, don't forget to close the source stdio +stream if necessary. + +It is an error to call jpeg_finish_decompress() before reading the correct +total number of scanlines. If you wish to abort decompression, call +jpeg_abort() as discussed below. + +After completing a decompression cycle, you may dispose of the JPEG object as +discussed next, or you may use it to decompress another image. In that case +return to step 2 or 3 as appropriate. If you do not change the source +manager, the next image will be read from the same source. + + +8. Release the JPEG decompression object. + +When you are done with a JPEG decompression object, destroy it by calling +jpeg_destroy_decompress() or jpeg_destroy(). The previous discussion of +destroying compression objects applies here too. + +Typical code: + + jpeg_destroy_decompress(&cinfo); + + +9. Aborting. + +You can abort a decompression cycle by calling jpeg_destroy_decompress() or +jpeg_destroy() if you don't need the JPEG object any more, or +jpeg_abort_decompress() or jpeg_abort() if you want to reuse the object. +The previous discussion of aborting compression cycles applies here too. + + +Mechanics of usage: include files, linking, etc +----------------------------------------------- + +Applications using the JPEG library should include the header file jpeglib.h +to obtain declarations of data types and routines. Before including +jpeglib.h, include system headers that define at least the typedefs FILE and +size_t. On ANSI-conforming systems, including is sufficient; on +older Unix systems, you may need to define size_t. + +If the application needs to refer to individual JPEG library error codes, also +include jerror.h to define those symbols. + +jpeglib.h indirectly includes the files jconfig.h and jmorecfg.h. If you are +installing the JPEG header files in a system directory, you will want to +install all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h. + +The most convenient way to include the JPEG code into your executable program +is to prepare a library file ("libjpeg.a", or a corresponding name on non-Unix +machines) and reference it at your link step. If you use only half of the +library (only compression or only decompression), only that much code will be +included from the library, unless your linker is hopelessly brain-damaged. +The supplied makefiles build libjpeg.a automatically (see install.txt). + +While you can build the JPEG library as a shared library if the whim strikes +you, we don't really recommend it. The trouble with shared libraries is that +at some point you'll probably try to substitute a new version of the library +without recompiling the calling applications. That generally doesn't work +because the parameter struct declarations usually change with each new +version. In other words, the library's API is *not* guaranteed binary +compatible across versions; we only try to ensure source-code compatibility. +(In hindsight, it might have been smarter to hide the parameter structs from +applications and introduce a ton of access functions instead. Too late now, +however.) + +On some systems your application may need to set up a signal handler to ensure +that temporary files are deleted if the program is interrupted. This is most +critical if you are on MS-DOS and use the jmemdos.c memory manager back end; +it will try to grab extended memory for temp files, and that space will NOT be +freed automatically. See cjpeg.c or djpeg.c for an example signal handler. + +It may be worth pointing out that the core JPEG library does not actually +require the stdio library: only the default source/destination managers and +error handler need it. You can use the library in a stdio-less environment +if you replace those modules and use jmemnobs.c (or another memory manager of +your own devising). More info about the minimum system library requirements +may be found in jinclude.h. + + +ADVANCED FEATURES +================= + +Compression parameter selection +------------------------------- + +This section describes all the optional parameters you can set for JPEG +compression, as well as the "helper" routines provided to assist in this +task. Proper setting of some parameters requires detailed understanding +of the JPEG standard; if you don't know what a parameter is for, it's best +not to mess with it! See REFERENCES in the README file for pointers to +more info about JPEG. + +It's a good idea to call jpeg_set_defaults() first, even if you plan to set +all the parameters; that way your code is more likely to work with future JPEG +libraries that have additional parameters. For the same reason, we recommend +you use a helper routine where one is provided, in preference to twiddling +cinfo fields directly. + +The helper routines are: + +jpeg_set_defaults (j_compress_ptr cinfo) + This routine sets all JPEG parameters to reasonable defaults, using + only the input image's color space (field in_color_space, which must + already be set in cinfo). Many applications will only need to use + this routine and perhaps jpeg_set_quality(). + +jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) + Sets the JPEG file's colorspace (field jpeg_color_space) as specified, + and sets other color-space-dependent parameters appropriately. See + "Special color spaces", below, before using this. A large number of + parameters, including all per-component parameters, are set by this + routine; if you want to twiddle individual parameters you should call + jpeg_set_colorspace() before rather than after. + +jpeg_default_colorspace (j_compress_ptr cinfo) + Selects an appropriate JPEG colorspace based on cinfo->in_color_space, + and calls jpeg_set_colorspace(). This is actually a subroutine of + jpeg_set_defaults(). It's broken out in case you want to change + just the colorspace-dependent JPEG parameters. + +jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline) + Constructs JPEG quantization tables appropriate for the indicated + quality setting. The quality value is expressed on the 0..100 scale + recommended by IJG (cjpeg's "-quality" switch uses this routine). + Note that the exact mapping from quality values to tables may change + in future IJG releases as more is learned about DCT quantization. + If the force_baseline parameter is TRUE, then the quantization table + entries are constrained to the range 1..255 for full JPEG baseline + compatibility. In the current implementation, this only makes a + difference for quality settings below 25, and it effectively prevents + very small/low quality files from being generated. The IJG decoder + is capable of reading the non-baseline files generated at low quality + settings when force_baseline is FALSE, but other decoders may not be. + +jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, + boolean force_baseline) + Same as jpeg_set_quality() except that the generated tables are the + sample tables given in the JPEC spec section K.1, multiplied by the + specified scale factor (which is expressed as a percentage; thus + scale_factor = 100 reproduces the spec's tables). Note that larger + scale factors give lower quality. This entry point is useful for + conforming to the Adobe PostScript DCT conventions, but we do not + recommend linear scaling as a user-visible quality scale otherwise. + force_baseline again constrains the computed table entries to 1..255. + +int jpeg_quality_scaling (int quality) + Converts a value on the IJG-recommended quality scale to a linear + scaling percentage. Note that this routine may change or go away + in future releases --- IJG may choose to adopt a scaling method that + can't be expressed as a simple scalar multiplier, in which case the + premise of this routine collapses. Caveat user. + +jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline) + Set default quantization tables with linear q_scale_factor[] values + (see below). + +jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, boolean force_baseline) + Allows an arbitrary quantization table to be created. which_tbl + indicates which table slot to fill. basic_table points to an array + of 64 unsigned ints given in normal array order. These values are + multiplied by scale_factor/100 and then clamped to the range 1..65535 + (or to 1..255 if force_baseline is TRUE). + CAUTION: prior to library version 6a, jpeg_add_quant_table expected + the basic table to be given in JPEG zigzag order. If you need to + write code that works with either older or newer versions of this + routine, you must check the library version number. Something like + "#if JPEG_LIB_VERSION >= 61" is the right test. + +jpeg_simple_progression (j_compress_ptr cinfo) + Generates a default scan script for writing a progressive-JPEG file. + This is the recommended method of creating a progressive file, + unless you want to make a custom scan sequence. You must ensure that + the JPEG color space is set correctly before calling this routine. + + +Compression parameters (cinfo fields) include: + +boolean arith_code + If TRUE, use arithmetic coding. + If FALSE, use Huffman coding. + +int block_size + Set DCT block size. All N from 1 to 16 are possible. + Default is 8 (baseline format). + Larger values produce higher compression, + smaller values produce higher quality. + An exact DCT stage is possible with 1 or 2. + With the default quality of 75 and default Luminance qtable + the DCT+Quantization stage is lossless for value 1. + Note that values other than 8 require a SmartScale capable decoder, + introduced with IJG JPEG 8. Setting the block_size parameter for + compression works with version 8c and later. + +J_DCT_METHOD dct_method + Selects the algorithm used for the DCT step. Choices are: + JDCT_ISLOW: slow but accurate integer algorithm + JDCT_IFAST: faster, less accurate integer method + JDCT_FLOAT: floating-point method + JDCT_DEFAULT: default method (normally JDCT_ISLOW) + JDCT_FASTEST: fastest method (normally JDCT_IFAST) + The FLOAT method is very slightly more accurate than the ISLOW method, + but may give different results on different machines due to varying + roundoff behavior. The integer methods should give the same results + on all machines. On machines with sufficiently fast FP hardware, the + floating-point method may also be the fastest. The IFAST method is + considerably less accurate than the other two; its use is not + recommended if high quality is a concern. JDCT_DEFAULT and + JDCT_FASTEST are macros configurable by each installation. + +unsigned int scale_num, scale_denom + Scale the image by the fraction scale_num/scale_denom. Default is + 1/1, or no scaling. Currently, the supported scaling ratios are + M/N with all N from 1 to 16, where M is the destination DCT size, + which is 8 by default (see block_size parameter above). + (The library design allows for arbitrary scaling ratios but this + is not likely to be implemented any time soon.) + +J_COLOR_SPACE jpeg_color_space +int num_components + The JPEG color space and corresponding number of components; see + "Special color spaces", below, for more info. We recommend using + jpeg_set_colorspace() if you want to change these. + +J_COLOR_TRANSFORM color_transform + Internal color transform identifier, writes LSE marker if nonzero + (requires decoder with inverse color transform support, introduced + with IJG JPEG 9). + Two values are currently possible: JCT_NONE and JCT_SUBTRACT_GREEN. + Set this value for lossless RGB application *before* calling + jpeg_set_colorspace(), because entropy table assignment in + jpeg_set_colorspace() depends on color_transform. + +boolean optimize_coding + TRUE causes the compressor to compute optimal Huffman coding tables + for the image. This requires an extra pass over the data and + therefore costs a good deal of space and time. The default is + FALSE, which tells the compressor to use the supplied or default + Huffman tables. In most cases optimal tables save only a few percent + of file size compared to the default tables. Note that when this is + TRUE, you need not supply Huffman tables at all, and any you do + supply will be overwritten. + +unsigned int restart_interval +int restart_in_rows + To emit restart markers in the JPEG file, set one of these nonzero. + Set restart_interval to specify the exact interval in MCU blocks. + Set restart_in_rows to specify the interval in MCU rows. (If + restart_in_rows is not 0, then restart_interval is set after the + image width in MCUs is computed.) Defaults are zero (no restarts). + One restart marker per MCU row is often a good choice. + NOTE: the overhead of restart markers is higher in grayscale JPEG + files than in color files, and MUCH higher in progressive JPEGs. + If you use restarts, you may want to use larger intervals in those + cases. + +const jpeg_scan_info * scan_info +int num_scans + By default, scan_info is NULL; this causes the compressor to write a + single-scan sequential JPEG file. If not NULL, scan_info points to + an array of scan definition records of length num_scans. The + compressor will then write a JPEG file having one scan for each scan + definition record. This is used to generate noninterleaved or + progressive JPEG files. The library checks that the scan array + defines a valid JPEG scan sequence. (jpeg_simple_progression creates + a suitable scan definition array for progressive JPEG.) This is + discussed further under "Progressive JPEG support". + +boolean do_fancy_downsampling + If TRUE, use direct DCT scaling with DCT size > 8 for downsampling + of chroma components. + If FALSE, use only DCT size <= 8 and simple separate downsampling. + Default is TRUE. + For better image stability in multiple generation compression cycles + it is preferable that this value matches the corresponding + do_fancy_upsampling value in decompression. + +int smoothing_factor + If non-zero, the input image is smoothed; the value should be 1 for + minimal smoothing to 100 for maximum smoothing. Consult jcsample.c + for details of the smoothing algorithm. The default is zero. + +boolean write_JFIF_header + If TRUE, a JFIF APP0 marker is emitted. jpeg_set_defaults() and + jpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space + (ie, YCbCr or grayscale) is selected, otherwise FALSE. + +UINT8 JFIF_major_version +UINT8 JFIF_minor_version + The version number to be written into the JFIF marker. + jpeg_set_defaults() initializes the version to 1.01 (major=minor=1). + You should set it to 1.02 (major=1, minor=2) if you plan to write + any JFIF 1.02 extension markers. + +UINT8 density_unit +UINT16 X_density +UINT16 Y_density + The resolution information to be written into the JFIF marker; + not used otherwise. density_unit may be 0 for unknown, + 1 for dots/inch, or 2 for dots/cm. The default values are 0,1,1 + indicating square pixels of unknown size. + +boolean write_Adobe_marker + If TRUE, an Adobe APP14 marker is emitted. jpeg_set_defaults() and + jpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK, + or YCCK is selected, otherwise FALSE. It is generally a bad idea + to set both write_JFIF_header and write_Adobe_marker. In fact, + you probably shouldn't change the default settings at all --- the + default behavior ensures that the JPEG file's color space can be + recognized by the decoder. + +JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS] + Pointers to coefficient quantization tables, one per table slot, + or NULL if no table is defined for a slot. Usually these should + be set via one of the above helper routines; jpeg_add_quant_table() + is general enough to define any quantization table. The other + routines will set up table slot 0 for luminance quality and table + slot 1 for chrominance. + +int q_scale_factor[NUM_QUANT_TBLS] + Linear quantization scaling factors (percentage, initialized 100) + for use with jpeg_default_qtables(). + See rdswitch.c and cjpeg.c for an example of usage. + Note that the q_scale_factor[] fields are the "linear" scales, so you + have to convert from user-defined ratings via jpeg_quality_scaling(). + Here is an example code which corresponds to cjpeg -quality 90,70: + + jpeg_set_defaults(cinfo); + + /* Set luminance quality 90. */ + cinfo->q_scale_factor[0] = jpeg_quality_scaling(90); + /* Set chrominance quality 70. */ + cinfo->q_scale_factor[1] = jpeg_quality_scaling(70); + + jpeg_default_qtables(cinfo, force_baseline); + + CAUTION: You must also set 1x1 subsampling for efficient separate + color quality selection, since the default value used by library + is 2x2: + + cinfo->comp_info[0].v_samp_factor = 1; + cinfo->comp_info[0].h_samp_factor = 1; + +JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS] +JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS] + Pointers to Huffman coding tables, one per table slot, or NULL if + no table is defined for a slot. Slots 0 and 1 are filled with the + JPEG sample tables by jpeg_set_defaults(). If you need to allocate + more table structures, jpeg_alloc_huff_table() may be used. + Note that optimal Huffman tables can be computed for an image + by setting optimize_coding, as discussed above; there's seldom + any need to mess with providing your own Huffman tables. + + +The actual dimensions of the JPEG image that will be written to the file are +given by the following fields. These are computed from the input image +dimensions and the compression parameters by jpeg_start_compress(). You can +also call jpeg_calc_jpeg_dimensions() to obtain the values that will result +from the current parameter settings. This can be useful if you are trying +to pick a scaling ratio that will get close to a desired target size. + +JDIMENSION jpeg_width Actual dimensions of output image. +JDIMENSION jpeg_height + + +Per-component parameters are stored in the struct cinfo.comp_info[i] for +component number i. Note that components here refer to components of the +JPEG color space, *not* the source image color space. A suitably large +comp_info[] array is allocated by jpeg_set_defaults(); if you choose not +to use that routine, it's up to you to allocate the array. + +int component_id + The one-byte identifier code to be recorded in the JPEG file for + this component. For the standard color spaces, we recommend you + leave the default values alone. + +int h_samp_factor +int v_samp_factor + Horizontal and vertical sampling factors for the component; must + be 1..4 according to the JPEG standard. Note that larger sampling + factors indicate a higher-resolution component; many people find + this behavior quite unintuitive. The default values are 2,2 for + luminance components and 1,1 for chrominance components, except + for grayscale where 1,1 is used. + +int quant_tbl_no + Quantization table number for component. The default value is + 0 for luminance components and 1 for chrominance components. + +int dc_tbl_no +int ac_tbl_no + DC and AC entropy coding table numbers. The default values are + 0 for luminance components and 1 for chrominance components. + +int component_index + Must equal the component's index in comp_info[]. (Beginning in + release v6, the compressor library will fill this in automatically; + you don't have to.) + + +Decompression parameter selection +--------------------------------- + +Decompression parameter selection is somewhat simpler than compression +parameter selection, since all of the JPEG internal parameters are +recorded in the source file and need not be supplied by the application. +(Unless you are working with abbreviated files, in which case see +"Abbreviated datastreams", below.) Decompression parameters control +the postprocessing done on the image to deliver it in a format suitable +for the application's use. Many of the parameters control speed/quality +tradeoffs, in which faster decompression may be obtained at the price of +a poorer-quality image. The defaults select the highest quality (slowest) +processing. + +The following fields in the JPEG object are set by jpeg_read_header() and +may be useful to the application in choosing decompression parameters: + +JDIMENSION image_width Width and height of image +JDIMENSION image_height +int num_components Number of color components +J_COLOR_SPACE jpeg_color_space Colorspace of image +boolean saw_JFIF_marker TRUE if a JFIF APP0 marker was seen + UINT8 JFIF_major_version Version information from JFIF marker + UINT8 JFIF_minor_version + UINT8 density_unit Resolution data from JFIF marker + UINT16 X_density + UINT16 Y_density +boolean saw_Adobe_marker TRUE if an Adobe APP14 marker was seen + UINT8 Adobe_transform Color transform code from Adobe marker + +The JPEG color space, unfortunately, is something of a guess since the JPEG +standard proper does not provide a way to record it. In practice most files +adhere to the JFIF or Adobe conventions, and the decoder will recognize these +correctly. See "Special color spaces", below, for more info. + + +The decompression parameters that determine the basic properties of the +returned image are: + +J_COLOR_SPACE out_color_space + Output color space. jpeg_read_header() sets an appropriate default + based on jpeg_color_space; typically it will be RGB or grayscale. + The application can change this field to request output in a different + colorspace. For example, set it to JCS_GRAYSCALE to get grayscale + output from a color file. (This is useful for previewing: grayscale + output is faster than full color since the color components need not + be processed.) Note that not all possible color space transforms are + currently implemented; you may need to extend jdcolor.c if you want an + unusual conversion. + +unsigned int scale_num, scale_denom + Scale the image by the fraction scale_num/scale_denom. Currently, + the supported scaling ratios are M/N with all M from 1 to 16, where + N is the source DCT size, which is 8 for baseline JPEG. (The library + design allows for arbitrary scaling ratios but this is not likely + to be implemented any time soon.) The values are initialized by + jpeg_read_header() with the source DCT size. For baseline JPEG + this is 8/8. If you change only the scale_num value while leaving + the other unchanged, then this specifies the DCT scaled size to be + applied on the given input. For baseline JPEG this is equivalent + to M/8 scaling, since the source DCT size for baseline JPEG is 8. + Smaller scaling ratios permit significantly faster decoding since + fewer pixels need be processed and a simpler IDCT method can be used. + +boolean quantize_colors + If set TRUE, colormapped output will be delivered. Default is FALSE, + meaning that full-color output will be delivered. + +The next three parameters are relevant only if quantize_colors is TRUE. + +int desired_number_of_colors + Maximum number of colors to use in generating a library-supplied color + map (the actual number of colors is returned in a different field). + Default 256. Ignored when the application supplies its own color map. + +boolean two_pass_quantize + If TRUE, an extra pass over the image is made to select a custom color + map for the image. This usually looks a lot better than the one-size- + fits-all colormap that is used otherwise. Default is TRUE. Ignored + when the application supplies its own color map. + +J_DITHER_MODE dither_mode + Selects color dithering method. Supported values are: + JDITHER_NONE no dithering: fast, very low quality + JDITHER_ORDERED ordered dither: moderate speed and quality + JDITHER_FS Floyd-Steinberg dither: slow, high quality + Default is JDITHER_FS. (At present, ordered dither is implemented + only in the single-pass, standard-colormap case. If you ask for + ordered dither when two_pass_quantize is TRUE or when you supply + an external color map, you'll get F-S dithering.) + +When quantize_colors is TRUE, the target color map is described by the next +two fields. colormap is set to NULL by jpeg_read_header(). The application +can supply a color map by setting colormap non-NULL and setting +actual_number_of_colors to the map size. Otherwise, jpeg_start_decompress() +selects a suitable color map and sets these two fields itself. +[Implementation restriction: at present, an externally supplied colormap is +only accepted for 3-component output color spaces.] + +JSAMPARRAY colormap + The color map, represented as a 2-D pixel array of out_color_components + rows and actual_number_of_colors columns. Ignored if not quantizing. + CAUTION: if the JPEG library creates its own colormap, the storage + pointed to by this field is released by jpeg_finish_decompress(). + Copy the colormap somewhere else first, if you want to save it. + +int actual_number_of_colors + The number of colors in the color map. + +Additional decompression parameters that the application may set include: + +J_DCT_METHOD dct_method + Selects the algorithm used for the DCT step. Choices are the same + as described above for compression. + +boolean do_fancy_upsampling + If TRUE, use direct DCT scaling with DCT size > 8 for upsampling + of chroma components. + If FALSE, use only DCT size <= 8 and simple separate upsampling. + Default is TRUE. + For better image stability in multiple generation compression cycles + it is preferable that this value matches the corresponding + do_fancy_downsampling value in compression. + +boolean do_block_smoothing + If TRUE, interblock smoothing is applied in early stages of decoding + progressive JPEG files; if FALSE, not. Default is TRUE. Early + progression stages look "fuzzy" with smoothing, "blocky" without. + In any case, block smoothing ceases to be applied after the first few + AC coefficients are known to full accuracy, so it is relevant only + when using buffered-image mode for progressive images. + +boolean enable_1pass_quant +boolean enable_external_quant +boolean enable_2pass_quant + These are significant only in buffered-image mode, which is + described in its own section below. + + +The output image dimensions are given by the following fields. These are +computed from the source image dimensions and the decompression parameters +by jpeg_start_decompress(). You can also call jpeg_calc_output_dimensions() +to obtain the values that will result from the current parameter settings. +This can be useful if you are trying to pick a scaling ratio that will get +close to a desired target size. It's also important if you are using the +JPEG library's memory manager to allocate output buffer space, because you +are supposed to request such buffers *before* jpeg_start_decompress(). + +JDIMENSION output_width Actual dimensions of output image. +JDIMENSION output_height +int out_color_components Number of color components in out_color_space. +int output_components Number of color components returned. +int rec_outbuf_height Recommended height of scanline buffer. + +When quantizing colors, output_components is 1, indicating a single color map +index per pixel. Otherwise it equals out_color_components. The output arrays +are required to be output_width * output_components JSAMPLEs wide. + +rec_outbuf_height is the recommended minimum height (in scanlines) of the +buffer passed to jpeg_read_scanlines(). If the buffer is smaller, the +library will still work, but time will be wasted due to unnecessary data +copying. In high-quality modes, rec_outbuf_height is always 1, but some +faster, lower-quality modes set it to larger values (typically 2 to 4). +If you are going to ask for a high-speed processing mode, you may as well +go to the trouble of honoring rec_outbuf_height so as to avoid data copying. +(An output buffer larger than rec_outbuf_height lines is OK, but won't +provide any material speed improvement over that height.) + + +Special color spaces +-------------------- + +The JPEG standard itself is "color blind" and doesn't specify any particular +color space. It is customary to convert color data to a luminance/chrominance +color space before compressing, since this permits greater compression. The +existing de-facto JPEG file format standards specify YCbCr or grayscale data +(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe). For special +applications such as multispectral images, other color spaces can be used, +but it must be understood that such files will be unportable. + +The JPEG library can handle the most common colorspace conversions (namely +RGB <=> YCbCr and CMYK <=> YCCK). It can also deal with data of an unknown +color space, passing it through without conversion. If you deal extensively +with an unusual color space, you can easily extend the library to understand +additional color spaces and perform appropriate conversions. + +For compression, the source data's color space is specified by field +in_color_space. This is transformed to the JPEG file's color space given +by jpeg_color_space. jpeg_set_defaults() chooses a reasonable JPEG color +space depending on in_color_space, but you can override this by calling +jpeg_set_colorspace(). Of course you must select a supported transformation. +jccolor.c currently supports the following transformations: + RGB => YCbCr + RGB => GRAYSCALE + YCbCr => GRAYSCALE + CMYK => YCCK +plus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB, +YCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN. + +The de-facto file format standards (JFIF and Adobe) specify APPn markers that +indicate the color space of the JPEG file. It is important to ensure that +these are written correctly, or omitted if the JPEG file's color space is not +one of the ones supported by the de-facto standards. jpeg_set_colorspace() +will set the compression parameters to include or omit the APPn markers +properly, so long as it is told the truth about the JPEG color space. +For example, if you are writing some random 3-component color space without +conversion, don't try to fake out the library by setting in_color_space and +jpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN. You may want to write an +APPn marker of your own devising to identify the colorspace --- see "Special +markers", below. + +When told that the color space is UNKNOWN, the library will default to using +luminance-quality compression parameters for all color components. You may +well want to change these parameters. See the source code for +jpeg_set_colorspace(), in jcparam.c, for details. + +For decompression, the JPEG file's color space is given in jpeg_color_space, +and this is transformed to the output color space out_color_space. +jpeg_read_header's setting of jpeg_color_space can be relied on if the file +conforms to JFIF or Adobe conventions, but otherwise it is no better than a +guess. If you know the JPEG file's color space for certain, you can override +jpeg_read_header's guess by setting jpeg_color_space. jpeg_read_header also +selects a default output color space based on (its guess of) jpeg_color_space; +set out_color_space to override this. Again, you must select a supported +transformation. jdcolor.c currently supports + YCbCr => RGB + YCbCr => GRAYSCALE + RGB => GRAYSCALE + GRAYSCALE => RGB + YCCK => CMYK +as well as the null transforms. (Since GRAYSCALE=>RGB is provided, an +application can force grayscale JPEGs to look like color JPEGs if it only +wants to handle one case.) + +The two-pass color quantizer, jquant2.c, is specialized to handle RGB data +(it weights distances appropriately for RGB colors). You'll need to modify +the code if you want to use it for non-RGB output color spaces. Note that +jquant2.c is used to map to an application-supplied colormap as well as for +the normal two-pass colormap selection process. + +CAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG +files: 0 represents 100% ink coverage, rather than 0% ink as you'd expect. +This is arguably a bug in Photoshop, but if you need to work with Photoshop +CMYK files, you will have to deal with it in your application. We cannot +"fix" this in the library by inverting the data during the CMYK<=>YCCK +transform, because that would break other applications, notably Ghostscript. +Photoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK +data in the same inverted-YCCK representation used in bare JPEG files, but +the surrounding PostScript code performs an inversion using the PS image +operator. I am told that Photoshop 3.0 will write uninverted YCCK in +EPS/JPEG files, and will omit the PS-level inversion. (But the data +polarity used in bare JPEG files will not change in 3.0.) In either case, +the JPEG library must not invert the data itself, or else Ghostscript would +read these EPS files incorrectly. + + +Error handling +-------------- + +When the default error handler is used, any error detected inside the JPEG +routines will cause a message to be printed on stderr, followed by exit(). +You can supply your own error handling routines to override this behavior +and to control the treatment of nonfatal warnings and trace/debug messages. +The file example.c illustrates the most common case, which is to have the +application regain control after an error rather than exiting. + +The JPEG library never writes any message directly; it always goes through +the error handling routines. Three classes of messages are recognized: + * Fatal errors: the library cannot continue. + * Warnings: the library can continue, but the data is corrupt, and a + damaged output image is likely to result. + * Trace/informational messages. These come with a trace level indicating + the importance of the message; you can control the verbosity of the + program by adjusting the maximum trace level that will be displayed. + +You may, if you wish, simply replace the entire JPEG error handling module +(jerror.c) with your own code. However, you can avoid code duplication by +only replacing some of the routines depending on the behavior you need. +This is accomplished by calling jpeg_std_error() as usual, but then overriding +some of the method pointers in the jpeg_error_mgr struct, as illustrated by +example.c. + +All of the error handling routines will receive a pointer to the JPEG object +(a j_common_ptr which points to either a jpeg_compress_struct or a +jpeg_decompress_struct; if you need to tell which, test the is_decompressor +field). This struct includes a pointer to the error manager struct in its +"err" field. Frequently, custom error handler routines will need to access +additional data which is not known to the JPEG library or the standard error +handler. The most convenient way to do this is to embed either the JPEG +object or the jpeg_error_mgr struct in a larger structure that contains +additional fields; then casting the passed pointer provides access to the +additional fields. Again, see example.c for one way to do it. (Beginning +with IJG version 6b, there is also a void pointer "client_data" in each +JPEG object, which the application can also use to find related data. +The library does not touch client_data at all.) + +The individual methods that you might wish to override are: + +error_exit (j_common_ptr cinfo) + Receives control for a fatal error. Information sufficient to + generate the error message has been stored in cinfo->err; call + output_message to display it. Control must NOT return to the caller; + generally this routine will exit() or longjmp() somewhere. + Typically you would override this routine to get rid of the exit() + default behavior. Note that if you continue processing, you should + clean up the JPEG object with jpeg_abort() or jpeg_destroy(). + +output_message (j_common_ptr cinfo) + Actual output of any JPEG message. Override this to send messages + somewhere other than stderr. Note that this method does not know + how to generate a message, only where to send it. + +format_message (j_common_ptr cinfo, char * buffer) + Constructs a readable error message string based on the error info + stored in cinfo->err. This method is called by output_message. Few + applications should need to override this method. One possible + reason for doing so is to implement dynamic switching of error message + language. + +emit_message (j_common_ptr cinfo, int msg_level) + Decide whether or not to emit a warning or trace message; if so, + calls output_message. The main reason for overriding this method + would be to abort on warnings. msg_level is -1 for warnings, + 0 and up for trace messages. + +Only error_exit() and emit_message() are called from the rest of the JPEG +library; the other two are internal to the error handler. + +The actual message texts are stored in an array of strings which is pointed to +by the field err->jpeg_message_table. The messages are numbered from 0 to +err->last_jpeg_message, and it is these code numbers that are used in the +JPEG library code. You could replace the message texts (for instance, with +messages in French or German) by changing the message table pointer. See +jerror.h for the default texts. CAUTION: this table will almost certainly +change or grow from one library version to the next. + +It may be useful for an application to add its own message texts that are +handled by the same mechanism. The error handler supports a second "add-on" +message table for this purpose. To define an addon table, set the pointer +err->addon_message_table and the message numbers err->first_addon_message and +err->last_addon_message. If you number the addon messages beginning at 1000 +or so, you won't have to worry about conflicts with the library's built-in +messages. See the sample applications cjpeg/djpeg for an example of using +addon messages (the addon messages are defined in cderror.h). + +Actual invocation of the error handler is done via macros defined in jerror.h: + ERREXITn(...) for fatal errors + WARNMSn(...) for corrupt-data warnings + TRACEMSn(...) for trace and informational messages. +These macros store the message code and any additional parameters into the +error handler struct, then invoke the error_exit() or emit_message() method. +The variants of each macro are for varying numbers of additional parameters. +The additional parameters are inserted into the generated message using +standard printf() format codes. + +See jerror.h and jerror.c for further details. + + +Compressed data handling (source and destination managers) +---------------------------------------------------------- + +The JPEG compression library sends its compressed data to a "destination +manager" module. The default destination manager just writes the data to a +memory buffer or to a stdio stream, but you can provide your own manager to +do something else. Similarly, the decompression library calls a "source +manager" to obtain the compressed data; you can provide your own source +manager if you want the data to come from somewhere other than a memory +buffer or a stdio stream. + +In both cases, compressed data is processed a bufferload at a time: the +destination or source manager provides a work buffer, and the library invokes +the manager only when the buffer is filled or emptied. (You could define a +one-character buffer to force the manager to be invoked for each byte, but +that would be rather inefficient.) The buffer's size and location are +controlled by the manager, not by the library. For example, the memory +source manager just makes the buffer pointer and length point to the original +data in memory. In this case the buffer-reload procedure will be invoked +only if the decompressor ran off the end of the datastream, which would +indicate an erroneous datastream. + +The work buffer is defined as an array of datatype JOCTET, which is generally +"char" or "unsigned char". On a machine where char is not exactly 8 bits +wide, you must define JOCTET as a wider data type and then modify the data +source and destination modules to transcribe the work arrays into 8-bit units +on external storage. + +A data destination manager struct contains a pointer and count defining the +next byte to write in the work buffer and the remaining free space: + + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + +The library increments the pointer and decrements the count until the buffer +is filled. The manager's empty_output_buffer method must reset the pointer +and count. The manager is expected to remember the buffer's starting address +and total size in private fields not visible to the library. + +A data destination manager provides three methods: + +init_destination (j_compress_ptr cinfo) + Initialize destination. This is called by jpeg_start_compress() + before any data is actually written. It must initialize + next_output_byte and free_in_buffer. free_in_buffer must be + initialized to a positive value. + +empty_output_buffer (j_compress_ptr cinfo) + This is called whenever the buffer has filled (free_in_buffer + reaches zero). In typical applications, it should write out the + *entire* buffer (use the saved start address and buffer length; + ignore the current state of next_output_byte and free_in_buffer). + Then reset the pointer & count to the start of the buffer, and + return TRUE indicating that the buffer has been dumped. + free_in_buffer must be set to a positive value when TRUE is + returned. A FALSE return should only be used when I/O suspension is + desired (this operating mode is discussed in the next section). + +term_destination (j_compress_ptr cinfo) + Terminate destination --- called by jpeg_finish_compress() after all + data has been written. In most applications, this must flush any + data remaining in the buffer. Use either next_output_byte or + free_in_buffer to determine how much data is in the buffer. + +term_destination() is NOT called by jpeg_abort() or jpeg_destroy(). If you +want the destination manager to be cleaned up during an abort, you must do it +yourself. + +You will also need code to create a jpeg_destination_mgr struct, fill in its +method pointers, and insert a pointer to the struct into the "dest" field of +the JPEG compression object. This can be done in-line in your setup code if +you like, but it's probably cleaner to provide a separate routine similar to +the jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination +managers. + +Decompression source managers follow a parallel design, but with some +additional frammishes. The source manager struct contains a pointer and count +defining the next byte to read from the work buffer and the number of bytes +remaining: + + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + +The library increments the pointer and decrements the count until the buffer +is emptied. The manager's fill_input_buffer method must reset the pointer and +count. In most applications, the manager must remember the buffer's starting +address and total size in private fields not visible to the library. + +A data source manager provides five methods: + +init_source (j_decompress_ptr cinfo) + Initialize source. This is called by jpeg_read_header() before any + data is actually read. Unlike init_destination(), it may leave + bytes_in_buffer set to 0 (in which case a fill_input_buffer() call + will occur immediately). + +fill_input_buffer (j_decompress_ptr cinfo) + This is called whenever bytes_in_buffer has reached zero and more + data is wanted. In typical applications, it should read fresh data + into the buffer (ignoring the current state of next_input_byte and + bytes_in_buffer), reset the pointer & count to the start of the + buffer, and return TRUE indicating that the buffer has been reloaded. + It is not necessary to fill the buffer entirely, only to obtain at + least one more byte. bytes_in_buffer MUST be set to a positive value + if TRUE is returned. A FALSE return should only be used when I/O + suspension is desired (this mode is discussed in the next section). + +skip_input_data (j_decompress_ptr cinfo, long num_bytes) + Skip num_bytes worth of data. The buffer pointer and count should + be advanced over num_bytes input bytes, refilling the buffer as + needed. This is used to skip over a potentially large amount of + uninteresting data (such as an APPn marker). In some applications + it may be possible to optimize away the reading of the skipped data, + but it's not clear that being smart is worth much trouble; large + skips are uncommon. bytes_in_buffer may be zero on return. + A zero or negative skip count should be treated as a no-op. + +resync_to_restart (j_decompress_ptr cinfo, int desired) + This routine is called only when the decompressor has failed to find + a restart (RSTn) marker where one is expected. Its mission is to + find a suitable point for resuming decompression. For most + applications, we recommend that you just use the default resync + procedure, jpeg_resync_to_restart(). However, if you are able to back + up in the input data stream, or if you have a-priori knowledge about + the likely location of restart markers, you may be able to do better. + Read the read_restart_marker() and jpeg_resync_to_restart() routines + in jdmarker.c if you think you'd like to implement your own resync + procedure. + +term_source (j_decompress_ptr cinfo) + Terminate source --- called by jpeg_finish_decompress() after all + data has been read. Often a no-op. + +For both fill_input_buffer() and skip_input_data(), there is no such thing +as an EOF return. If the end of the file has been reached, the routine has +a choice of exiting via ERREXIT() or inserting fake data into the buffer. +In most cases, generating a warning message and inserting a fake EOI marker +is the best course of action --- this will allow the decompressor to output +however much of the image is there. In pathological cases, the decompressor +may swallow the EOI and again demand data ... just keep feeding it fake EOIs. +jdatasrc.c illustrates the recommended error recovery behavior. + +term_source() is NOT called by jpeg_abort() or jpeg_destroy(). If you want +the source manager to be cleaned up during an abort, you must do it yourself. + +You will also need code to create a jpeg_source_mgr struct, fill in its method +pointers, and insert a pointer to the struct into the "src" field of the JPEG +decompression object. This can be done in-line in your setup code if you +like, but it's probably cleaner to provide a separate routine similar to the +jpeg_stdio_src() or jpeg_mem_src() routines of the supplied source managers. + +For more information, consult the memory and stdio source and destination +managers in jdatasrc.c and jdatadst.c. + + +I/O suspension +-------------- + +Some applications need to use the JPEG library as an incremental memory-to- +memory filter: when the compressed data buffer is filled or emptied, they want +control to return to the outer loop, rather than expecting that the buffer can +be emptied or reloaded within the data source/destination manager subroutine. +The library supports this need by providing an "I/O suspension" mode, which we +describe in this section. + +The I/O suspension mode is not a panacea: nothing is guaranteed about the +maximum amount of time spent in any one call to the library, so it will not +eliminate response-time problems in single-threaded applications. If you +need guaranteed response time, we suggest you "bite the bullet" and implement +a real multi-tasking capability. + +To use I/O suspension, cooperation is needed between the calling application +and the data source or destination manager; you will always need a custom +source/destination manager. (Please read the previous section if you haven't +already.) The basic idea is that the empty_output_buffer() or +fill_input_buffer() routine is a no-op, merely returning FALSE to indicate +that it has done nothing. Upon seeing this, the JPEG library suspends +operation and returns to its caller. The surrounding application is +responsible for emptying or refilling the work buffer before calling the +JPEG library again. + +Compression suspension: + +For compression suspension, use an empty_output_buffer() routine that returns +FALSE; typically it will not do anything else. This will cause the +compressor to return to the caller of jpeg_write_scanlines(), with the return +value indicating that not all the supplied scanlines have been accepted. +The application must make more room in the output buffer, adjust the output +buffer pointer/count appropriately, and then call jpeg_write_scanlines() +again, pointing to the first unconsumed scanline. + +When forced to suspend, the compressor will backtrack to a convenient stopping +point (usually the start of the current MCU); it will regenerate some output +data when restarted. Therefore, although empty_output_buffer() is only +called when the buffer is filled, you should NOT write out the entire buffer +after a suspension. Write only the data up to the current position of +next_output_byte/free_in_buffer. The data beyond that point will be +regenerated after resumption. + +Because of the backtracking behavior, a good-size output buffer is essential +for efficiency; you don't want the compressor to suspend often. (In fact, an +overly small buffer could lead to infinite looping, if a single MCU required +more data than would fit in the buffer.) We recommend a buffer of at least +several Kbytes. You may want to insert explicit code to ensure that you don't +call jpeg_write_scanlines() unless there is a reasonable amount of space in +the output buffer; in other words, flush the buffer before trying to compress +more data. + +The compressor does not allow suspension while it is trying to write JPEG +markers at the beginning and end of the file. This means that: + * At the beginning of a compression operation, there must be enough free + space in the output buffer to hold the header markers (typically 600 or + so bytes). The recommended buffer size is bigger than this anyway, so + this is not a problem as long as you start with an empty buffer. However, + this restriction might catch you if you insert large special markers, such + as a JFIF thumbnail image, without flushing the buffer afterwards. + * When you call jpeg_finish_compress(), there must be enough space in the + output buffer to emit any buffered data and the final EOI marker. In the + current implementation, half a dozen bytes should suffice for this, but + for safety's sake we recommend ensuring that at least 100 bytes are free + before calling jpeg_finish_compress(). + +A more significant restriction is that jpeg_finish_compress() cannot suspend. +This means you cannot use suspension with multi-pass operating modes, namely +Huffman code optimization and multiple-scan output. Those modes write the +whole file during jpeg_finish_compress(), which will certainly result in +buffer overrun. (Note that this restriction applies only to compression, +not decompression. The decompressor supports input suspension in all of its +operating modes.) + +Decompression suspension: + +For decompression suspension, use a fill_input_buffer() routine that simply +returns FALSE (except perhaps during error recovery, as discussed below). +This will cause the decompressor to return to its caller with an indication +that suspension has occurred. This can happen at four places: + * jpeg_read_header(): will return JPEG_SUSPENDED. + * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE. + * jpeg_read_scanlines(): will return the number of scanlines already + completed (possibly 0). + * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE. +The surrounding application must recognize these cases, load more data into +the input buffer, and repeat the call. In the case of jpeg_read_scanlines(), +increment the passed pointers past any scanlines successfully read. + +Just as with compression, the decompressor will typically backtrack to a +convenient restart point before suspending. When fill_input_buffer() is +called, next_input_byte/bytes_in_buffer point to the current restart point, +which is where the decompressor will backtrack to if FALSE is returned. +The data beyond that position must NOT be discarded if you suspend; it needs +to be re-read upon resumption. In most implementations, you'll need to shift +this data down to the start of your work buffer and then load more data after +it. Again, this behavior means that a several-Kbyte work buffer is essential +for decent performance; furthermore, you should load a reasonable amount of +new data before resuming decompression. (If you loaded, say, only one new +byte each time around, you could waste a LOT of cycles.) + +The skip_input_data() source manager routine requires special care in a +suspension scenario. This routine is NOT granted the ability to suspend the +decompressor; it can decrement bytes_in_buffer to zero, but no more. If the +requested skip distance exceeds the amount of data currently in the input +buffer, then skip_input_data() must set bytes_in_buffer to zero and record the +additional skip distance somewhere else. The decompressor will immediately +call fill_input_buffer(), which should return FALSE, which will cause a +suspension return. The surrounding application must then arrange to discard +the recorded number of bytes before it resumes loading the input buffer. +(Yes, this design is rather baroque, but it avoids complexity in the far more +common case where a non-suspending source manager is used.) + +If the input data has been exhausted, we recommend that you emit a warning +and insert dummy EOI markers just as a non-suspending data source manager +would do. This can be handled either in the surrounding application logic or +within fill_input_buffer(); the latter is probably more efficient. If +fill_input_buffer() knows that no more data is available, it can set the +pointer/count to point to a dummy EOI marker and then return TRUE just as +though it had read more data in a non-suspending situation. + +The decompressor does not attempt to suspend within standard JPEG markers; +instead it will backtrack to the start of the marker and reprocess the whole +marker next time. Hence the input buffer must be large enough to hold the +longest standard marker in the file. Standard JPEG markers should normally +not exceed a few hundred bytes each (DHT tables are typically the longest). +We recommend at least a 2K buffer for performance reasons, which is much +larger than any correct marker is likely to be. For robustness against +damaged marker length counts, you may wish to insert a test in your +application for the case that the input buffer is completely full and yet +the decoder has suspended without consuming any data --- otherwise, if this +situation did occur, it would lead to an endless loop. (The library can't +provide this test since it has no idea whether "the buffer is full", or +even whether there is a fixed-size input buffer.) + +The input buffer would need to be 64K to allow for arbitrary COM or APPn +markers, but these are handled specially: they are either saved into allocated +memory, or skipped over by calling skip_input_data(). In the former case, +suspension is handled correctly, and in the latter case, the problem of +buffer overrun is placed on skip_input_data's shoulders, as explained above. +Note that if you provide your own marker handling routine for large markers, +you should consider how to deal with buffer overflow. + +Multiple-buffer management: + +In some applications it is desirable to store the compressed data in a linked +list of buffer areas, so as to avoid data copying. This can be handled by +having empty_output_buffer() or fill_input_buffer() set the pointer and count +to reference the next available buffer; FALSE is returned only if no more +buffers are available. Although seemingly straightforward, there is a +pitfall in this approach: the backtrack that occurs when FALSE is returned +could back up into an earlier buffer. For example, when fill_input_buffer() +is called, the current pointer & count indicate the backtrack restart point. +Since fill_input_buffer() will set the pointer and count to refer to a new +buffer, the restart position must be saved somewhere else. Suppose a second +call to fill_input_buffer() occurs in the same library call, and no +additional input data is available, so fill_input_buffer must return FALSE. +If the JPEG library has not moved the pointer/count forward in the current +buffer, then *the correct restart point is the saved position in the prior +buffer*. Prior buffers may be discarded only after the library establishes +a restart point within a later buffer. Similar remarks apply for output into +a chain of buffers. + +The library will never attempt to backtrack over a skip_input_data() call, +so any skipped data can be permanently discarded. You still have to deal +with the case of skipping not-yet-received data, however. + +It's much simpler to use only a single buffer; when fill_input_buffer() is +called, move any unconsumed data (beyond the current pointer/count) down to +the beginning of this buffer and then load new data into the remaining buffer +space. This approach requires a little more data copying but is far easier +to get right. + + +Progressive JPEG support +------------------------ + +Progressive JPEG rearranges the stored data into a series of scans of +increasing quality. In situations where a JPEG file is transmitted across a +slow communications link, a decoder can generate a low-quality image very +quickly from the first scan, then gradually improve the displayed quality as +more scans are received. The final image after all scans are complete is +identical to that of a regular (sequential) JPEG file of the same quality +setting. Progressive JPEG files are often slightly smaller than equivalent +sequential JPEG files, but the possibility of incremental display is the main +reason for using progressive JPEG. + +The IJG encoder library generates progressive JPEG files when given a +suitable "scan script" defining how to divide the data into scans. +Creation of progressive JPEG files is otherwise transparent to the encoder. +Progressive JPEG files can also be read transparently by the decoder library. +If the decoding application simply uses the library as defined above, it +will receive a final decoded image without any indication that the file was +progressive. Of course, this approach does not allow incremental display. +To perform incremental display, an application needs to use the decoder +library's "buffered-image" mode, in which it receives a decoded image +multiple times. + +Each displayed scan requires about as much work to decode as a full JPEG +image of the same size, so the decoder must be fairly fast in relation to the +data transmission rate in order to make incremental display useful. However, +it is possible to skip displaying the image and simply add the incoming bits +to the decoder's coefficient buffer. This is fast because only Huffman +decoding need be done, not IDCT, upsampling, colorspace conversion, etc. +The IJG decoder library allows the application to switch dynamically between +displaying the image and simply absorbing the incoming bits. A properly +coded application can automatically adapt the number of display passes to +suit the time available as the image is received. Also, a final +higher-quality display cycle can be performed from the buffered data after +the end of the file is reached. + +Progressive compression: + +To create a progressive JPEG file (or a multiple-scan sequential JPEG file), +set the scan_info cinfo field to point to an array of scan descriptors, and +perform compression as usual. Instead of constructing your own scan list, +you can call the jpeg_simple_progression() helper routine to create a +recommended progression sequence; this method should be used by all +applications that don't want to get involved in the nitty-gritty of +progressive scan sequence design. (If you want to provide user control of +scan sequences, you may wish to borrow the scan script reading code found +in rdswitch.c, so that you can read scan script files just like cjpeg's.) +When scan_info is not NULL, the compression library will store DCT'd data +into a buffer array as jpeg_write_scanlines() is called, and will emit all +the requested scans during jpeg_finish_compress(). This implies that +multiple-scan output cannot be created with a suspending data destination +manager, since jpeg_finish_compress() does not support suspension. We +should also note that the compressor currently forces Huffman optimization +mode when creating a progressive JPEG file, because the default Huffman +tables are unsuitable for progressive files. + +Progressive decompression: + +When buffered-image mode is not used, the decoder library will read all of +a multi-scan file during jpeg_start_decompress(), so that it can provide a +final decoded image. (Here "multi-scan" means either progressive or +multi-scan sequential.) This makes multi-scan files transparent to the +decoding application. However, existing applications that used suspending +input with version 5 of the IJG library will need to be modified to check +for a suspension return from jpeg_start_decompress(). + +To perform incremental display, an application must use the library's +buffered-image mode. This is described in the next section. + + +Buffered-image mode +------------------- + +In buffered-image mode, the library stores the partially decoded image in a +coefficient buffer, from which it can be read out as many times as desired. +This mode is typically used for incremental display of progressive JPEG files, +but it can be used with any JPEG file. Each scan of a progressive JPEG file +adds more data (more detail) to the buffered image. The application can +display in lockstep with the source file (one display pass per input scan), +or it can allow input processing to outrun display processing. By making +input and display processing run independently, it is possible for the +application to adapt progressive display to a wide range of data transmission +rates. + +The basic control flow for buffered-image decoding is + + jpeg_create_decompress() + set data source + jpeg_read_header() + set overall decompression parameters + cinfo.buffered_image = TRUE; /* select buffered-image mode */ + jpeg_start_decompress() + for (each output pass) { + adjust output decompression parameters if required + jpeg_start_output() /* start a new output pass */ + for (all scanlines in image) { + jpeg_read_scanlines() + display scanlines + } + jpeg_finish_output() /* terminate output pass */ + } + jpeg_finish_decompress() + jpeg_destroy_decompress() + +This differs from ordinary unbuffered decoding in that there is an additional +level of looping. The application can choose how many output passes to make +and how to display each pass. + +The simplest approach to displaying progressive images is to do one display +pass for each scan appearing in the input file. In this case the outer loop +condition is typically + while (! jpeg_input_complete(&cinfo)) +and the start-output call should read + jpeg_start_output(&cinfo, cinfo.input_scan_number); +The second parameter to jpeg_start_output() indicates which scan of the input +file is to be displayed; the scans are numbered starting at 1 for this +purpose. (You can use a loop counter starting at 1 if you like, but using +the library's input scan counter is easier.) The library automatically reads +data as necessary to complete each requested scan, and jpeg_finish_output() +advances to the next scan or end-of-image marker (hence input_scan_number +will be incremented by the time control arrives back at jpeg_start_output()). +With this technique, data is read from the input file only as needed, and +input and output processing run in lockstep. + +After reading the final scan and reaching the end of the input file, the +buffered image remains available; it can be read additional times by +repeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output() +sequence. For example, a useful technique is to use fast one-pass color +quantization for display passes made while the image is arriving, followed by +a final display pass using two-pass quantization for highest quality. This +is done by changing the library parameters before the final output pass. +Changing parameters between passes is discussed in detail below. + +In general the last scan of a progressive file cannot be recognized as such +until after it is read, so a post-input display pass is the best approach if +you want special processing in the final pass. + +When done with the image, be sure to call jpeg_finish_decompress() to release +the buffered image (or just use jpeg_destroy_decompress()). + +If input data arrives faster than it can be displayed, the application can +cause the library to decode input data in advance of what's needed to produce +output. This is done by calling the routine jpeg_consume_input(). +The return value is one of the following: + JPEG_REACHED_SOS: reached an SOS marker (the start of a new scan) + JPEG_REACHED_EOI: reached the EOI marker (end of image) + JPEG_ROW_COMPLETED: completed reading one MCU row of compressed data + JPEG_SCAN_COMPLETED: completed reading last MCU row of current scan + JPEG_SUSPENDED: suspended before completing any of the above +(JPEG_SUSPENDED can occur only if a suspending data source is used.) This +routine can be called at any time after initializing the JPEG object. It +reads some additional data and returns when one of the indicated significant +events occurs. (If called after the EOI marker is reached, it will +immediately return JPEG_REACHED_EOI without attempting to read more data.) + +The library's output processing will automatically call jpeg_consume_input() +whenever the output processing overtakes the input; thus, simple lockstep +display requires no direct calls to jpeg_consume_input(). But by adding +calls to jpeg_consume_input(), you can absorb data in advance of what is +being displayed. This has two benefits: + * You can limit buildup of unprocessed data in your input buffer. + * You can eliminate extra display passes by paying attention to the + state of the library's input processing. + +The first of these benefits only requires interspersing calls to +jpeg_consume_input() with your display operations and any other processing +you may be doing. To avoid wasting cycles due to backtracking, it's best to +call jpeg_consume_input() only after a hundred or so new bytes have arrived. +This is discussed further under "I/O suspension", above. (Note: the JPEG +library currently is not thread-safe. You must not call jpeg_consume_input() +from one thread of control if a different library routine is working on the +same JPEG object in another thread.) + +When input arrives fast enough that more than one new scan is available +before you start a new output pass, you may as well skip the output pass +corresponding to the completed scan. This occurs for free if you pass +cinfo.input_scan_number as the target scan number to jpeg_start_output(). +The input_scan_number field is simply the index of the scan currently being +consumed by the input processor. You can ensure that this is up-to-date by +emptying the input buffer just before calling jpeg_start_output(): call +jpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or +JPEG_REACHED_EOI. + +The target scan number passed to jpeg_start_output() is saved in the +cinfo.output_scan_number field. The library's output processing calls +jpeg_consume_input() whenever the current input scan number and row within +that scan is less than or equal to the current output scan number and row. +Thus, input processing can "get ahead" of the output processing but is not +allowed to "fall behind". You can achieve several different effects by +manipulating this interlock rule. For example, if you pass a target scan +number greater than the current input scan number, the output processor will +wait until that scan starts to arrive before producing any output. (To avoid +an infinite loop, the target scan number is automatically reset to the last +scan number when the end of image is reached. Thus, if you specify a large +target scan number, the library will just absorb the entire input file and +then perform an output pass. This is effectively the same as what +jpeg_start_decompress() does when you don't select buffered-image mode.) +When you pass a target scan number equal to the current input scan number, +the image is displayed no faster than the current input scan arrives. The +final possibility is to pass a target scan number less than the current input +scan number; this disables the input/output interlock and causes the output +processor to simply display whatever it finds in the image buffer, without +waiting for input. (However, the library will not accept a target scan +number less than one, so you can't avoid waiting for the first scan.) + +When data is arriving faster than the output display processing can advance +through the image, jpeg_consume_input() will store data into the buffered +image beyond the point at which the output processing is reading data out +again. If the input arrives fast enough, it may "wrap around" the buffer to +the point where the input is more than one whole scan ahead of the output. +If the output processing simply proceeds through its display pass without +paying attention to the input, the effect seen on-screen is that the lower +part of the image is one or more scans better in quality than the upper part. +Then, when the next output scan is started, you have a choice of what target +scan number to use. The recommended choice is to use the current input scan +number at that time, which implies that you've skipped the output scans +corresponding to the input scans that were completed while you processed the +previous output scan. In this way, the decoder automatically adapts its +speed to the arriving data, by skipping output scans as necessary to keep up +with the arriving data. + +When using this strategy, you'll want to be sure that you perform a final +output pass after receiving all the data; otherwise your last display may not +be full quality across the whole screen. So the right outer loop logic is +something like this: + do { + absorb any waiting input by calling jpeg_consume_input() + final_pass = jpeg_input_complete(&cinfo); + adjust output decompression parameters if required + jpeg_start_output(&cinfo, cinfo.input_scan_number); + ... + jpeg_finish_output() + } while (! final_pass); +rather than quitting as soon as jpeg_input_complete() returns TRUE. This +arrangement makes it simple to use higher-quality decoding parameters +for the final pass. But if you don't want to use special parameters for +the final pass, the right loop logic is like this: + for (;;) { + absorb any waiting input by calling jpeg_consume_input() + jpeg_start_output(&cinfo, cinfo.input_scan_number); + ... + jpeg_finish_output() + if (jpeg_input_complete(&cinfo) && + cinfo.input_scan_number == cinfo.output_scan_number) + break; + } +In this case you don't need to know in advance whether an output pass is to +be the last one, so it's not necessary to have reached EOF before starting +the final output pass; rather, what you want to test is whether the output +pass was performed in sync with the final input scan. This form of the loop +will avoid an extra output pass whenever the decoder is able (or nearly able) +to keep up with the incoming data. + +When the data transmission speed is high, you might begin a display pass, +then find that much or all of the file has arrived before you can complete +the pass. (You can detect this by noting the JPEG_REACHED_EOI return code +from jpeg_consume_input(), or equivalently by testing jpeg_input_complete().) +In this situation you may wish to abort the current display pass and start a +new one using the newly arrived information. To do so, just call +jpeg_finish_output() and then start a new pass with jpeg_start_output(). + +A variant strategy is to abort and restart display if more than one complete +scan arrives during an output pass; this can be detected by noting +JPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number. This +idea should be employed with caution, however, since the display process +might never get to the bottom of the image before being aborted, resulting +in the lower part of the screen being several passes worse than the upper. +In most cases it's probably best to abort an output pass only if the whole +file has arrived and you want to begin the final output pass immediately. + +When receiving data across a communication link, we recommend always using +the current input scan number for the output target scan number; if a +higher-quality final pass is to be done, it should be started (aborting any +incomplete output pass) as soon as the end of file is received. However, +many other strategies are possible. For example, the application can examine +the parameters of the current input scan and decide whether to display it or +not. If the scan contains only chroma data, one might choose not to use it +as the target scan, expecting that the scan will be small and will arrive +quickly. To skip to the next scan, call jpeg_consume_input() until it +returns JPEG_REACHED_SOS or JPEG_REACHED_EOI. Or just use the next higher +number as the target scan for jpeg_start_output(); but that method doesn't +let you inspect the next scan's parameters before deciding to display it. + + +In buffered-image mode, jpeg_start_decompress() never performs input and +thus never suspends. An application that uses input suspension with +buffered-image mode must be prepared for suspension returns from these +routines: +* jpeg_start_output() performs input only if you request 2-pass quantization + and the target scan isn't fully read yet. (This is discussed below.) +* jpeg_read_scanlines(), as always, returns the number of scanlines that it + was able to produce before suspending. +* jpeg_finish_output() will read any markers following the target scan, + up to the end of the file or the SOS marker that begins another scan. + (But it reads no input if jpeg_consume_input() has already reached the + end of the file or a SOS marker beyond the target output scan.) +* jpeg_finish_decompress() will read until the end of file, and thus can + suspend if the end hasn't already been reached (as can be tested by + calling jpeg_input_complete()). +jpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress() +all return TRUE if they completed their tasks, FALSE if they had to suspend. +In the event of a FALSE return, the application must load more input data +and repeat the call. Applications that use non-suspending data sources need +not check the return values of these three routines. + + +It is possible to change decoding parameters between output passes in the +buffered-image mode. The decoder library currently supports only very +limited changes of parameters. ONLY THE FOLLOWING parameter changes are +allowed after jpeg_start_decompress() is called: +* dct_method can be changed before each call to jpeg_start_output(). + For example, one could use a fast DCT method for early scans, changing + to a higher quality method for the final scan. +* dither_mode can be changed before each call to jpeg_start_output(); + of course this has no impact if not using color quantization. Typically + one would use ordered dither for initial passes, then switch to + Floyd-Steinberg dither for the final pass. Caution: changing dither mode + can cause more memory to be allocated by the library. Although the amount + of memory involved is not large (a scanline or so), it may cause the + initial max_memory_to_use specification to be exceeded, which in the worst + case would result in an out-of-memory failure. +* do_block_smoothing can be changed before each call to jpeg_start_output(). + This setting is relevant only when decoding a progressive JPEG image. + During the first DC-only scan, block smoothing provides a very "fuzzy" look + instead of the very "blocky" look seen without it; which is better seems a + matter of personal taste. But block smoothing is nearly always a win + during later stages, especially when decoding a successive-approximation + image: smoothing helps to hide the slight blockiness that otherwise shows + up on smooth gradients until the lowest coefficient bits are sent. +* Color quantization mode can be changed under the rules described below. + You *cannot* change between full-color and quantized output (because that + would alter the required I/O buffer sizes), but you can change which + quantization method is used. + +When generating color-quantized output, changing quantization method is a +very useful way of switching between high-speed and high-quality display. +The library allows you to change among its three quantization methods: +1. Single-pass quantization to a fixed color cube. + Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL. +2. Single-pass quantization to an application-supplied colormap. + Selected by setting cinfo.colormap to point to the colormap (the value of + two_pass_quantize is ignored); also set cinfo.actual_number_of_colors. +3. Two-pass quantization to a colormap chosen specifically for the image. + Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL. + (This is the default setting selected by jpeg_read_header, but it is + probably NOT what you want for the first pass of progressive display!) +These methods offer successively better quality and lesser speed. However, +only the first method is available for quantizing in non-RGB color spaces. + +IMPORTANT: because the different quantizer methods have very different +working-storage requirements, the library requires you to indicate which +one(s) you intend to use before you call jpeg_start_decompress(). (If we did +not require this, the max_memory_to_use setting would be a complete fiction.) +You do this by setting one or more of these three cinfo fields to TRUE: + enable_1pass_quant Fixed color cube colormap + enable_external_quant Externally-supplied colormap + enable_2pass_quant Two-pass custom colormap +All three are initialized FALSE by jpeg_read_header(). But +jpeg_start_decompress() automatically sets TRUE the one selected by the +current two_pass_quantize and colormap settings, so you only need to set the +enable flags for any other quantization methods you plan to change to later. + +After setting the enable flags correctly at jpeg_start_decompress() time, you +can change to any enabled quantization method by setting two_pass_quantize +and colormap properly just before calling jpeg_start_output(). The following +special rules apply: +1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass + or 2-pass mode from a different mode, or when you want the 2-pass + quantizer to be re-run to generate a new colormap. +2. To switch to an external colormap, or to change to a different external + colormap than was used on the prior pass, you must call + jpeg_new_colormap() after setting cinfo.colormap. +NOTE: if you want to use the same colormap as was used in the prior pass, +you should not do either of these things. This will save some nontrivial +switchover costs. +(These requirements exist because cinfo.colormap will always be non-NULL +after completing a prior output pass, since both the 1-pass and 2-pass +quantizers set it to point to their output colormaps. Thus you have to +do one of these two things to notify the library that something has changed. +Yup, it's a bit klugy, but it's necessary to do it this way for backwards +compatibility.) + +Note that in buffered-image mode, the library generates any requested colormap +during jpeg_start_output(), not during jpeg_start_decompress(). + +When using two-pass quantization, jpeg_start_output() makes a pass over the +buffered image to determine the optimum color map; it therefore may take a +significant amount of time, whereas ordinarily it does little work. The +progress monitor hook is called during this pass, if defined. It is also +important to realize that if the specified target scan number is greater than +or equal to the current input scan number, jpeg_start_output() will attempt +to consume input as it makes this pass. If you use a suspending data source, +you need to check for a FALSE return from jpeg_start_output() under these +conditions. The combination of 2-pass quantization and a not-yet-fully-read +target scan is the only case in which jpeg_start_output() will consume input. + + +Application authors who support buffered-image mode may be tempted to use it +for all JPEG images, even single-scan ones. This will work, but it is +inefficient: there is no need to create an image-sized coefficient buffer for +single-scan images. Requesting buffered-image mode for such an image wastes +memory. Worse, it can cost time on large images, since the buffered data has +to be swapped out or written to a temporary file. If you are concerned about +maximum performance on baseline JPEG files, you should use buffered-image +mode only when the incoming file actually has multiple scans. This can be +tested by calling jpeg_has_multiple_scans(), which will return a correct +result at any time after jpeg_read_header() completes. + +It is also worth noting that when you use jpeg_consume_input() to let input +processing get ahead of output processing, the resulting pattern of access to +the coefficient buffer is quite nonsequential. It's best to use the memory +manager jmemnobs.c if you can (ie, if you have enough real or virtual main +memory). If not, at least make sure that max_memory_to_use is set as high as +possible. If the JPEG memory manager has to use a temporary file, you will +probably see a lot of disk traffic and poor performance. (This could be +improved with additional work on the memory manager, but we haven't gotten +around to it yet.) + +In some applications it may be convenient to use jpeg_consume_input() for all +input processing, including reading the initial markers; that is, you may +wish to call jpeg_consume_input() instead of jpeg_read_header() during +startup. This works, but note that you must check for JPEG_REACHED_SOS and +JPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes. +Once the first SOS marker has been reached, you must call +jpeg_start_decompress() before jpeg_consume_input() will consume more input; +it'll just keep returning JPEG_REACHED_SOS until you do. If you read a +tables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI +without ever returning JPEG_REACHED_SOS; be sure to check for this case. +If this happens, the decompressor will not read any more input until you call +jpeg_abort() to reset it. It is OK to call jpeg_consume_input() even when not +using buffered-image mode, but in that case it's basically a no-op after the +initial markers have been read: it will just return JPEG_SUSPENDED. + + +Abbreviated datastreams and multiple images +------------------------------------------- + +A JPEG compression or decompression object can be reused to process multiple +images. This saves a small amount of time per image by eliminating the +"create" and "destroy" operations, but that isn't the real purpose of the +feature. Rather, reuse of an object provides support for abbreviated JPEG +datastreams. Object reuse can also simplify processing a series of images in +a single input or output file. This section explains these features. + +A JPEG file normally contains several hundred bytes worth of quantization +and Huffman tables. In a situation where many images will be stored or +transmitted with identical tables, this may represent an annoying overhead. +The JPEG standard therefore permits tables to be omitted. The standard +defines three classes of JPEG datastreams: + * "Interchange" datastreams contain an image and all tables needed to decode + the image. These are the usual kind of JPEG file. + * "Abbreviated image" datastreams contain an image, but are missing some or + all of the tables needed to decode that image. + * "Abbreviated table specification" (henceforth "tables-only") datastreams + contain only table specifications. +To decode an abbreviated image, it is necessary to load the missing table(s) +into the decoder beforehand. This can be accomplished by reading a separate +tables-only file. A variant scheme uses a series of images in which the first +image is an interchange (complete) datastream, while subsequent ones are +abbreviated and rely on the tables loaded by the first image. It is assumed +that once the decoder has read a table, it will remember that table until a +new definition for the same table number is encountered. + +It is the application designer's responsibility to figure out how to associate +the correct tables with an abbreviated image. While abbreviated datastreams +can be useful in a closed environment, their use is strongly discouraged in +any situation where data exchange with other applications might be needed. +Caveat designer. + +The JPEG library provides support for reading and writing any combination of +tables-only datastreams and abbreviated images. In both compression and +decompression objects, a quantization or Huffman table will be retained for +the lifetime of the object, unless it is overwritten by a new table definition. + + +To create abbreviated image datastreams, it is only necessary to tell the +compressor not to emit some or all of the tables it is using. Each +quantization and Huffman table struct contains a boolean field "sent_table", +which normally is initialized to FALSE. For each table used by the image, the +header-writing process emits the table and sets sent_table = TRUE unless it is +already TRUE. (In normal usage, this prevents outputting the same table +definition multiple times, as would otherwise occur because the chroma +components typically share tables.) Thus, setting this field to TRUE before +calling jpeg_start_compress() will prevent the table from being written at +all. + +If you want to create a "pure" abbreviated image file containing no tables, +just call "jpeg_suppress_tables(&cinfo, TRUE)" after constructing all the +tables. If you want to emit some but not all tables, you'll need to set the +individual sent_table fields directly. + +To create an abbreviated image, you must also call jpeg_start_compress() +with a second parameter of FALSE, not TRUE. Otherwise jpeg_start_compress() +will force all the sent_table fields to FALSE. (This is a safety feature to +prevent abbreviated images from being created accidentally.) + +To create a tables-only file, perform the same parameter setup that you +normally would, but instead of calling jpeg_start_compress() and so on, call +jpeg_write_tables(&cinfo). This will write an abbreviated datastream +containing only SOI, DQT and/or DHT markers, and EOI. All the quantization +and Huffman tables that are currently defined in the compression object will +be emitted unless their sent_tables flag is already TRUE, and then all the +sent_tables flags will be set TRUE. + +A sure-fire way to create matching tables-only and abbreviated image files +is to proceed as follows: + + create JPEG compression object + set JPEG parameters + set destination to tables-only file + jpeg_write_tables(&cinfo); + set destination to image file + jpeg_start_compress(&cinfo, FALSE); + write data... + jpeg_finish_compress(&cinfo); + +Since the JPEG parameters are not altered between writing the table file and +the abbreviated image file, the same tables are sure to be used. Of course, +you can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence +many times to produce many abbreviated image files matching the table file. + +You cannot suppress output of the computed Huffman tables when Huffman +optimization is selected. (If you could, there'd be no way to decode the +image...) Generally, you don't want to set optimize_coding = TRUE when +you are trying to produce abbreviated files. + +In some cases you might want to compress an image using tables which are +not stored in the application, but are defined in an interchange or +tables-only file readable by the application. This can be done by setting up +a JPEG decompression object to read the specification file, then copying the +tables into your compression object. See jpeg_copy_critical_parameters() +for an example of copying quantization tables. + + +To read abbreviated image files, you simply need to load the proper tables +into the decompression object before trying to read the abbreviated image. +If the proper tables are stored in the application program, you can just +allocate the table structs and fill in their contents directly. For example, +to load a fixed quantization table into table slot "n": + + if (cinfo.quant_tbl_ptrs[n] == NULL) + cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo); + quant_ptr = cinfo.quant_tbl_ptrs[n]; /* quant_ptr is JQUANT_TBL* */ + for (i = 0; i < 64; i++) { + /* Qtable[] is desired quantization table, in natural array order */ + quant_ptr->quantval[i] = Qtable[i]; + } + +Code to load a fixed Huffman table is typically (for AC table "n"): + + if (cinfo.ac_huff_tbl_ptrs[n] == NULL) + cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo); + huff_ptr = cinfo.ac_huff_tbl_ptrs[n]; /* huff_ptr is JHUFF_TBL* */ + for (i = 1; i <= 16; i++) { + /* counts[i] is number of Huffman codes of length i bits, i=1..16 */ + huff_ptr->bits[i] = counts[i]; + } + for (i = 0; i < 256; i++) { + /* symbols[] is the list of Huffman symbols, in code-length order */ + huff_ptr->huffval[i] = symbols[i]; + } + +(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a +constant JQUANT_TBL object is not safe. If the incoming file happened to +contain a quantization table definition, your master table would get +overwritten! Instead allocate a working table copy and copy the master table +into it, as illustrated above. Ditto for Huffman tables, of course.) + +You might want to read the tables from a tables-only file, rather than +hard-wiring them into your application. The jpeg_read_header() call is +sufficient to read a tables-only file. You must pass a second parameter of +FALSE to indicate that you do not require an image to be present. Thus, the +typical scenario is + + create JPEG decompression object + set source to tables-only file + jpeg_read_header(&cinfo, FALSE); + set source to abbreviated image file + jpeg_read_header(&cinfo, TRUE); + set decompression parameters + jpeg_start_decompress(&cinfo); + read data... + jpeg_finish_decompress(&cinfo); + +In some cases, you may want to read a file without knowing whether it contains +an image or just tables. In that case, pass FALSE and check the return value +from jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found, +JPEG_HEADER_TABLES_ONLY if only tables were found. (A third return value, +JPEG_SUSPENDED, is possible when using a suspending data source manager.) +Note that jpeg_read_header() will not complain if you read an abbreviated +image for which you haven't loaded the missing tables; the missing-table check +occurs later, in jpeg_start_decompress(). + + +It is possible to read a series of images from a single source file by +repeating the jpeg_read_header() ... jpeg_finish_decompress() sequence, +without releasing/recreating the JPEG object or the data source module. +(If you did reinitialize, any partial bufferload left in the data source +buffer at the end of one image would be discarded, causing you to lose the +start of the next image.) When you use this method, stored tables are +automatically carried forward, so some of the images can be abbreviated images +that depend on tables from earlier images. + +If you intend to write a series of images into a single destination file, +you might want to make a specialized data destination module that doesn't +flush the output buffer at term_destination() time. This would speed things +up by some trifling amount. Of course, you'd need to remember to flush the +buffer after the last image. You can make the later images be abbreviated +ones by passing FALSE to jpeg_start_compress(). + + +Special markers +--------------- + +Some applications may need to insert or extract special data in the JPEG +datastream. The JPEG standard provides marker types "COM" (comment) and +"APP0" through "APP15" (application) to hold application-specific data. +Unfortunately, the use of these markers is not specified by the standard. +COM markers are fairly widely used to hold user-supplied text. The JFIF file +format spec uses APP0 markers with specified initial strings to hold certain +data. Adobe applications use APP14 markers beginning with the string "Adobe" +for miscellaneous data. Other APPn markers are rarely seen, but might +contain almost anything. + +If you wish to store user-supplied text, we recommend you use COM markers +and place readable 7-bit ASCII text in them. Newline conventions are not +standardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR +(Mac style). A robust COM reader should be able to cope with random binary +garbage, including nulls, since some applications generate COM markers +containing non-ASCII junk. (But yours should not be one of them.) + +For program-supplied data, use an APPn marker, and be sure to begin it with an +identifying string so that you can tell whether the marker is actually yours. +It's probably best to avoid using APP0 or APP14 for any private markers. +(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you +not use APP8 markers for any private purposes, either.) + +Keep in mind that at most 65533 bytes can be put into one marker, but you +can have as many markers as you like. + +By default, the IJG compression library will write a JFIF APP0 marker if the +selected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if +the selected colorspace is RGB, CMYK, or YCCK. You can disable this, but +we don't recommend it. The decompression library will recognize JFIF and +Adobe markers and will set the JPEG colorspace properly when one is found. + + +You can write special markers immediately following the datastream header by +calling jpeg_write_marker() after jpeg_start_compress() and before the first +call to jpeg_write_scanlines(). When you do this, the markers appear after +the SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before +all else. Specify the marker type parameter as "JPEG_COM" for COM or +"JPEG_APP0 + n" for APPn. (Actually, jpeg_write_marker will let you write +any marker type, but we don't recommend writing any other kinds of marker.) +For example, to write a user comment string pointed to by comment_text: + jpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text)); + +If it's not convenient to store all the marker data in memory at once, +you can instead call jpeg_write_m_header() followed by multiple calls to +jpeg_write_m_byte(). If you do it this way, it's your responsibility to +call jpeg_write_m_byte() exactly the number of times given in the length +parameter to jpeg_write_m_header(). (This method lets you empty the +output buffer partway through a marker, which might be important when +using a suspending data destination module. In any case, if you are using +a suspending destination, you should flush its buffer after inserting +any special markers. See "I/O suspension".) + +Or, if you prefer to synthesize the marker byte sequence yourself, +you can just cram it straight into the data destination module. + +If you are writing JFIF 1.02 extension markers (thumbnail images), don't +forget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the +correct JFIF version number in the JFIF header marker. The library's default +is to write version 1.01, but that's wrong if you insert any 1.02 extension +markers. (We could probably get away with just defaulting to 1.02, but there +used to be broken decoders that would complain about unknown minor version +numbers. To reduce compatibility risks it's safest not to write 1.02 unless +you are actually using 1.02 extensions.) + + +When reading, two methods of handling special markers are available: +1. You can ask the library to save the contents of COM and/or APPn markers +into memory, and then examine them at your leisure afterwards. +2. You can supply your own routine to process COM and/or APPn markers +on-the-fly as they are read. +The first method is simpler to use, especially if you are using a suspending +data source; writing a marker processor that copes with input suspension is +not easy (consider what happens if the marker is longer than your available +input buffer). However, the second method conserves memory since the marker +data need not be kept around after it's been processed. + +For either method, you'd normally set up marker handling after creating a +decompression object and before calling jpeg_read_header(), because the +markers of interest will typically be near the head of the file and so will +be scanned by jpeg_read_header. Once you've established a marker handling +method, it will be used for the life of that decompression object +(potentially many datastreams), unless you change it. Marker handling is +determined separately for COM markers and for each APPn marker code. + + +To save the contents of special markers in memory, call + jpeg_save_markers(cinfo, marker_code, length_limit) +where marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n. +(To arrange to save all the special marker types, you need to call this +routine 17 times, for COM and APP0-APP15.) If the incoming marker is longer +than length_limit data bytes, only length_limit bytes will be saved; this +parameter allows you to avoid chewing up memory when you only need to see the +first few bytes of a potentially large marker. If you want to save all the +data, set length_limit to 0xFFFF; that is enough since marker lengths are only +16 bits. As a special case, setting length_limit to 0 prevents that marker +type from being saved at all. (That is the default behavior, in fact.) + +After jpeg_read_header() completes, you can examine the special markers by +following the cinfo->marker_list pointer chain. All the special markers in +the file appear in this list, in order of their occurrence in the file (but +omitting any markers of types you didn't ask for). Both the original data +length and the saved data length are recorded for each list entry; the latter +will not exceed length_limit for the particular marker type. Note that these +lengths exclude the marker length word, whereas the stored representation +within the JPEG file includes it. (Hence the maximum data length is really +only 65533.) + +It is possible that additional special markers appear in the file beyond the +SOS marker at which jpeg_read_header stops; if so, the marker list will be +extended during reading of the rest of the file. This is not expected to be +common, however. If you are short on memory you may want to reset the length +limit to zero for all marker types after finishing jpeg_read_header, to +ensure that the max_memory_to_use setting cannot be exceeded due to addition +of later markers. + +The marker list remains stored until you call jpeg_finish_decompress or +jpeg_abort, at which point the memory is freed and the list is set to empty. +(jpeg_destroy also releases the storage, of course.) + +Note that the library is internally interested in APP0 and APP14 markers; +if you try to set a small nonzero length limit on these types, the library +will silently force the length up to the minimum it wants. (But you can set +a zero length limit to prevent them from being saved at all.) Also, in a +16-bit environment, the maximum length limit may be constrained to less than +65533 by malloc() limitations. It is therefore best not to assume that the +effective length limit is exactly what you set it to be. + + +If you want to supply your own marker-reading routine, you do it by calling +jpeg_set_marker_processor(). A marker processor routine must have the +signature + boolean jpeg_marker_parser_method (j_decompress_ptr cinfo) +Although the marker code is not explicitly passed, the routine can find it +in cinfo->unread_marker. At the time of call, the marker proper has been +read from the data source module. The processor routine is responsible for +reading the marker length word and the remaining parameter bytes, if any. +Return TRUE to indicate success. (FALSE should be returned only if you are +using a suspending data source and it tells you to suspend. See the standard +marker processors in jdmarker.c for appropriate coding methods if you need to +use a suspending data source.) + +If you override the default APP0 or APP14 processors, it is up to you to +recognize JFIF and Adobe markers if you want colorspace recognition to occur +properly. We recommend copying and extending the default processors if you +want to do that. (A better idea is to save these marker types for later +examination by calling jpeg_save_markers(); that method doesn't interfere +with the library's own processing of these markers.) + +jpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive +--- if you call one it overrides any previous call to the other, for the +particular marker type specified. + +A simple example of an external COM processor can be found in djpeg.c. +Also, see jpegtran.c for an example of using jpeg_save_markers. + + +Raw (downsampled) image data +---------------------------- + +Some applications need to supply already-downsampled image data to the JPEG +compressor, or to receive raw downsampled data from the decompressor. The +library supports this requirement by allowing the application to write or +read raw data, bypassing the normal preprocessing or postprocessing steps. +The interface is different from the standard one and is somewhat harder to +use. If your interest is merely in bypassing color conversion, we recommend +that you use the standard interface and simply set jpeg_color_space = +in_color_space (or jpeg_color_space = out_color_space for decompression). +The mechanism described in this section is necessary only to supply or +receive downsampled image data, in which not all components have the same +dimensions. + + +To compress raw data, you must supply the data in the colorspace to be used +in the JPEG file (please read the earlier section on Special color spaces) +and downsampled to the sampling factors specified in the JPEG parameters. +You must supply the data in the format used internally by the JPEG library, +namely a JSAMPIMAGE array. This is an array of pointers to two-dimensional +arrays, each of type JSAMPARRAY. Each 2-D array holds the values for one +color component. This structure is necessary since the components are of +different sizes. If the image dimensions are not a multiple of the MCU size, +you must also pad the data correctly (usually, this is done by replicating +the last column and/or row). The data must be padded to a multiple of a DCT +block in each component: that is, each downsampled row must contain a +multiple of 8 valid samples, and there must be a multiple of 8 sample rows +for each component. (For applications such as conversion of digital TV +images, the standard image size is usually a multiple of the DCT block size, +so that no padding need actually be done.) + +The procedure for compression of raw data is basically the same as normal +compression, except that you call jpeg_write_raw_data() in place of +jpeg_write_scanlines(). Before calling jpeg_start_compress(), you must do +the following: + * Set cinfo->raw_data_in to TRUE. (It is set FALSE by jpeg_set_defaults().) + This notifies the library that you will be supplying raw data. + Furthermore, set cinfo->do_fancy_downsampling to FALSE if you want to use + real downsampled data. (It is set TRUE by jpeg_set_defaults().) + * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace() + call is a good idea. Note that since color conversion is bypassed, + in_color_space is ignored, except that jpeg_set_defaults() uses it to + choose the default jpeg_color_space setting. + * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and + cinfo->comp_info[i].v_samp_factor, are correct. Since these indicate the + dimensions of the data you are supplying, it's wise to set them + explicitly, rather than assuming the library's defaults are what you want. + +To pass raw data to the library, call jpeg_write_raw_data() in place of +jpeg_write_scanlines(). The two routines work similarly except that +jpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY. +The scanlines count passed to and returned from jpeg_write_raw_data is +measured in terms of the component with the largest v_samp_factor. + +jpeg_write_raw_data() processes one MCU row per call, which is to say +v_samp_factor*DCTSIZE sample rows of each component. The passed num_lines +value must be at least max_v_samp_factor*DCTSIZE, and the return value will +be exactly that amount (or possibly some multiple of that amount, in future +library versions). This is true even on the last call at the bottom of the +image; don't forget to pad your data as necessary. + +The required dimensions of the supplied data can be computed for each +component as + cinfo->comp_info[i].width_in_blocks*DCTSIZE samples per row + cinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image +after jpeg_start_compress() has initialized those fields. If the valid data +is smaller than this, it must be padded appropriately. For some sampling +factors and image sizes, additional dummy DCT blocks are inserted to make +the image a multiple of the MCU dimensions. The library creates such dummy +blocks itself; it does not read them from your supplied data. Therefore you +need never pad by more than DCTSIZE samples. An example may help here. +Assume 2h2v downsampling of YCbCr data, that is + cinfo->comp_info[0].h_samp_factor = 2 for Y + cinfo->comp_info[0].v_samp_factor = 2 + cinfo->comp_info[1].h_samp_factor = 1 for Cb + cinfo->comp_info[1].v_samp_factor = 1 + cinfo->comp_info[2].h_samp_factor = 1 for Cr + cinfo->comp_info[2].v_samp_factor = 1 +and suppose that the nominal image dimensions (cinfo->image_width and +cinfo->image_height) are 101x101 pixels. Then jpeg_start_compress() will +compute downsampled_width = 101 and width_in_blocks = 13 for Y, +downsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same +for the height fields). You must pad the Y data to at least 13*8 = 104 +columns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows. The +MCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16 +scanlines on each call to jpeg_write_raw_data(), which is to say 16 actual +sample rows of Y and 8 each of Cb and Cr. A total of 7 MCU rows are needed, +so you must pass a total of 7*16 = 112 "scanlines". The last DCT block row +of Y data is dummy, so it doesn't matter what you pass for it in the data +arrays, but the scanlines count must total up to 112 so that all of the Cb +and Cr data gets passed. + +Output suspension is supported with raw-data compression: if the data +destination module suspends, jpeg_write_raw_data() will return 0. +In this case the same data rows must be passed again on the next call. + + +Decompression with raw data output implies bypassing all postprocessing. +You must deal with the color space and sampling factors present in the +incoming file. If your application only handles, say, 2h1v YCbCr data, +you must check for and fail on other color spaces or other sampling factors. +The library will not convert to a different color space for you. + +To obtain raw data output, set cinfo->raw_data_out = TRUE before +jpeg_start_decompress() (it is set FALSE by jpeg_read_header()). Be sure to +verify that the color space and sampling factors are ones you can handle. +Furthermore, set cinfo->do_fancy_upsampling = FALSE if you want to get real +downsampled data (it is set TRUE by jpeg_read_header()). +Then call jpeg_read_raw_data() in place of jpeg_read_scanlines(). The +decompression process is otherwise the same as usual. + +jpeg_read_raw_data() returns one MCU row per call, and thus you must pass a +buffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is +the same as for raw-data compression). The buffer you pass must be large +enough to hold the actual data plus padding to DCT-block boundaries. As with +compression, any entirely dummy DCT blocks are not processed so you need not +allocate space for them, but the total scanline count includes them. The +above example of computing buffer dimensions for raw-data compression is +equally valid for decompression. + +Input suspension is supported with raw-data decompression: if the data source +module suspends, jpeg_read_raw_data() will return 0. You can also use +buffered-image mode to read raw data in multiple passes. + + +Really raw data: DCT coefficients +--------------------------------- + +It is possible to read or write the contents of a JPEG file as raw DCT +coefficients. This facility is mainly intended for use in lossless +transcoding between different JPEG file formats. Other possible applications +include lossless cropping of a JPEG image, lossless reassembly of a +multi-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc. + +To read the contents of a JPEG file as DCT coefficients, open the file and do +jpeg_read_header() as usual. But instead of calling jpeg_start_decompress() +and jpeg_read_scanlines(), call jpeg_read_coefficients(). This will read the +entire image into a set of virtual coefficient-block arrays, one array per +component. The return value is a pointer to an array of virtual-array +descriptors. Each virtual array can be accessed directly using the JPEG +memory manager's access_virt_barray method (see Memory management, below, +and also read structure.txt's discussion of virtual array handling). Or, +for simple transcoding to a different JPEG file format, the array list can +just be handed directly to jpeg_write_coefficients(). + +Each block in the block arrays contains quantized coefficient values in +normal array order (not JPEG zigzag order). The block arrays contain only +DCT blocks containing real data; any entirely-dummy blocks added to fill out +interleaved MCUs at the right or bottom edges of the image are discarded +during reading and are not stored in the block arrays. (The size of each +block array can be determined from the width_in_blocks and height_in_blocks +fields of the component's comp_info entry.) This is also the data format +expected by jpeg_write_coefficients(). + +When you are done using the virtual arrays, call jpeg_finish_decompress() +to release the array storage and return the decompression object to an idle +state; or just call jpeg_destroy() if you don't need to reuse the object. + +If you use a suspending data source, jpeg_read_coefficients() will return +NULL if it is forced to suspend; a non-NULL return value indicates successful +completion. You need not test for a NULL return value when using a +non-suspending data source. + +It is also possible to call jpeg_read_coefficients() to obtain access to the +decoder's coefficient arrays during a normal decode cycle in buffered-image +mode. This frammish might be useful for progressively displaying an incoming +image and then re-encoding it without loss. To do this, decode in buffered- +image mode as discussed previously, then call jpeg_read_coefficients() after +the last jpeg_finish_output() call. The arrays will be available for your use +until you call jpeg_finish_decompress(). + + +To write the contents of a JPEG file as DCT coefficients, you must provide +the DCT coefficients stored in virtual block arrays. You can either pass +block arrays read from an input JPEG file by jpeg_read_coefficients(), or +allocate virtual arrays from the JPEG compression object and fill them +yourself. In either case, jpeg_write_coefficients() is substituted for +jpeg_start_compress() and jpeg_write_scanlines(). Thus the sequence is + * Create compression object + * Set all compression parameters as necessary + * Request virtual arrays if needed + * jpeg_write_coefficients() + * jpeg_finish_compress() + * Destroy or re-use compression object +jpeg_write_coefficients() is passed a pointer to an array of virtual block +array descriptors; the number of arrays is equal to cinfo.num_components. + +The virtual arrays need only have been requested, not realized, before +jpeg_write_coefficients() is called. A side-effect of +jpeg_write_coefficients() is to realize any virtual arrays that have been +requested from the compression object's memory manager. Thus, when obtaining +the virtual arrays from the compression object, you should fill the arrays +after calling jpeg_write_coefficients(). The data is actually written out +when you call jpeg_finish_compress(); jpeg_write_coefficients() only writes +the file header. + +When writing raw DCT coefficients, it is crucial that the JPEG quantization +tables and sampling factors match the way the data was encoded, or the +resulting file will be invalid. For transcoding from an existing JPEG file, +we recommend using jpeg_copy_critical_parameters(). This routine initializes +all the compression parameters to default values (like jpeg_set_defaults()), +then copies the critical information from a source decompression object. +The decompression object should have just been used to read the entire +JPEG input file --- that is, it should be awaiting jpeg_finish_decompress(). + +jpeg_write_coefficients() marks all tables stored in the compression object +as needing to be written to the output file (thus, it acts like +jpeg_start_compress(cinfo, TRUE)). This is for safety's sake, to avoid +emitting abbreviated JPEG files by accident. If you really want to emit an +abbreviated JPEG file, call jpeg_suppress_tables(), or set the tables' +individual sent_table flags, between calling jpeg_write_coefficients() and +jpeg_finish_compress(). + + +Progress monitoring +------------------- + +Some applications may need to regain control from the JPEG library every so +often. The typical use of this feature is to produce a percent-done bar or +other progress display. (For a simple example, see cjpeg.c or djpeg.c.) +Although you do get control back frequently during the data-transferring pass +(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes +will occur inside jpeg_finish_compress or jpeg_start_decompress; those +routines may take a long time to execute, and you don't get control back +until they are done. + +You can define a progress-monitor routine which will be called periodically +by the library. No guarantees are made about how often this call will occur, +so we don't recommend you use it for mouse tracking or anything like that. +At present, a call will occur once per MCU row, scanline, or sample row +group, whichever unit is convenient for the current processing mode; so the +wider the image, the longer the time between calls. During the data +transferring pass, only one call occurs per call of jpeg_read_scanlines or +jpeg_write_scanlines, so don't pass a large number of scanlines at once if +you want fine resolution in the progress count. (If you really need to use +the callback mechanism for time-critical tasks like mouse tracking, you could +insert additional calls inside some of the library's inner loops.) + +To establish a progress-monitor callback, create a struct jpeg_progress_mgr, +fill in its progress_monitor field with a pointer to your callback routine, +and set cinfo->progress to point to the struct. The callback will be called +whenever cinfo->progress is non-NULL. (This pointer is set to NULL by +jpeg_create_compress or jpeg_create_decompress; the library will not change +it thereafter. So if you allocate dynamic storage for the progress struct, +make sure it will live as long as the JPEG object does. Allocating from the +JPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.) You +can use the same callback routine for both compression and decompression. + +The jpeg_progress_mgr struct contains four fields which are set by the library: + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +During any one pass, pass_counter increases from 0 up to (not including) +pass_limit; the step size is usually but not necessarily 1. The pass_limit +value may change from one pass to another. The expected total number of +passes is in total_passes, and the number of passes already completed is in +completed_passes. Thus the fraction of work completed may be estimated as + completed_passes + (pass_counter/pass_limit) + -------------------------------------------- + total_passes +ignoring the fact that the passes may not be equal amounts of work. + +When decompressing, pass_limit can even change within a pass, because it +depends on the number of scans in the JPEG file, which isn't always known in +advance. The computed fraction-of-work-done may jump suddenly (if the library +discovers it has overestimated the number of scans) or even decrease (in the +opposite case). It is not wise to put great faith in the work estimate. + +When using the decompressor's buffered-image mode, the progress monitor work +estimate is likely to be completely unhelpful, because the library has no way +to know how many output passes will be demanded of it. Currently, the library +sets total_passes based on the assumption that there will be one more output +pass if the input file end hasn't yet been read (jpeg_input_complete() isn't +TRUE), but no more output passes if the file end has been reached when the +output pass is started. This means that total_passes will rise as additional +output passes are requested. If you have a way of determining the input file +size, estimating progress based on the fraction of the file that's been read +will probably be more useful than using the library's value. + + +Memory management +----------------- + +This section covers some key facts about the JPEG library's built-in memory +manager. For more info, please read structure.txt's section about the memory +manager, and consult the source code if necessary. + +All memory and temporary file allocation within the library is done via the +memory manager. If necessary, you can replace the "back end" of the memory +manager to control allocation yourself (for example, if you don't want the +library to use malloc() and free() for some reason). + +Some data is allocated "permanently" and will not be freed until the JPEG +object is destroyed. Most data is allocated "per image" and is freed by +jpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort. You can call the +memory manager yourself to allocate structures that will automatically be +freed at these times. Typical code for this is + ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size); +Use JPOOL_PERMANENT to get storage that lasts as long as the JPEG object. +Use alloc_large instead of alloc_small for anything bigger than a few Kbytes. +There are also alloc_sarray and alloc_barray routines that automatically +build 2-D sample or block arrays. + +The library's minimum space requirements to process an image depend on the +image's width, but not on its height, because the library ordinarily works +with "strip" buffers that are as wide as the image but just a few rows high. +Some operating modes (eg, two-pass color quantization) require full-image +buffers. Such buffers are treated as "virtual arrays": only the current strip +need be in memory, and the rest can be swapped out to a temporary file. + +If you use the simplest memory manager back end (jmemnobs.c), then no +temporary files are used; virtual arrays are simply malloc()'d. Images bigger +than memory can be processed only if your system supports virtual memory. +The other memory manager back ends support temporary files of various flavors +and thus work in machines without virtual memory. They may also be useful on +Unix machines if you need to process images that exceed available swap space. + +When using temporary files, the library will make the in-memory buffers for +its virtual arrays just big enough to stay within a "maximum memory" setting. +Your application can set this limit by setting cinfo->mem->max_memory_to_use +after creating the JPEG object. (Of course, there is still a minimum size for +the buffers, so the max-memory setting is effective only if it is bigger than +the minimum space needed.) If you allocate any large structures yourself, you +must allocate them before jpeg_start_compress() or jpeg_start_decompress() in +order to have them counted against the max memory limit. Also keep in mind +that space allocated with alloc_small() is ignored, on the assumption that +it's too small to be worth worrying about; so a reasonable safety margin +should be left when setting max_memory_to_use. + +If you use the jmemname.c or jmemdos.c memory manager back end, it is +important to clean up the JPEG object properly to ensure that the temporary +files get deleted. (This is especially crucial with jmemdos.c, where the +"temporary files" may be extended-memory segments; if they are not freed, +DOS will require a reboot to recover the memory.) Thus, with these memory +managers, it's a good idea to provide a signal handler that will trap any +early exit from your program. The handler should call either jpeg_abort() +or jpeg_destroy() for any active JPEG objects. A handler is not needed with +jmemnobs.c, and shouldn't be necessary with jmemansi.c or jmemmac.c either, +since the C library is supposed to take care of deleting files made with +tmpfile(). + + +Memory usage +------------ + +Working memory requirements while performing compression or decompression +depend on image dimensions, image characteristics (such as colorspace and +JPEG process), and operating mode (application-selected options). + +As of v6b, the decompressor requires: + 1. About 24K in more-or-less-fixed-size data. This varies a bit depending + on operating mode and image characteristics (particularly color vs. + grayscale), but it doesn't depend on image dimensions. + 2. Strip buffers (of size proportional to the image width) for IDCT and + upsampling results. The worst case for commonly used sampling factors + is about 34 bytes * width in pixels for a color image. A grayscale image + only needs about 8 bytes per pixel column. + 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG + file (including progressive JPEGs), or whenever you select buffered-image + mode. This takes 2 bytes/coefficient. At typical 2x2 sampling, that's + 3 bytes per pixel for a color image. Worst case (1x1 sampling) requires + 6 bytes/pixel. For grayscale, figure 2 bytes/pixel. + 4. To perform 2-pass color quantization, the decompressor also needs a + 128K color lookup table and a full-image pixel buffer (3 bytes/pixel). +This does not count any memory allocated by the application, such as a +buffer to hold the final output image. + +The above figures are valid for 8-bit JPEG data precision and a machine with +32-bit ints. For 12-bit JPEG data, double the size of the strip buffers and +quantization pixel buffer. The "fixed-size" data will be somewhat smaller +with 16-bit ints, larger with 64-bit ints. Also, CMYK or other unusual +color spaces will require different amounts of space. + +The full-image coefficient and pixel buffers, if needed at all, do not +have to be fully RAM resident; you can have the library use temporary +files instead when the total memory usage would exceed a limit you set. +(But if your OS supports virtual memory, it's probably better to just use +jmemnobs and let the OS do the swapping.) + +The compressor's memory requirements are similar, except that it has no need +for color quantization. Also, it needs a full-image DCT coefficient buffer +if Huffman-table optimization is asked for, even if progressive mode is not +requested. + +If you need more detailed information about memory usage in a particular +situation, you can enable the MEM_STATS code in jmemmgr.c. + + +Library compile-time options +---------------------------- + +A number of compile-time options are available by modifying jmorecfg.h. + +The JPEG standard provides for both the baseline 8-bit DCT process and +a 12-bit DCT process. The IJG code supports 12-bit JPEG if you define +BITS_IN_JSAMPLE as 12 rather than 8. Note that this causes JSAMPLE to be +larger than a char, so it affects the surrounding application's image data. +The sample applications cjpeg and djpeg can support 12-bit mode only for PPM +and GIF file formats; you must disable the other file formats to compile a +12-bit cjpeg or djpeg. (install.txt has more information about that.) +At present, a 12-bit library can handle *only* 12-bit images, not both +precisions. (If you need to include both 8- and 12-bit libraries in a single +application, you could probably do it by defining NEED_SHORT_EXTERNAL_NAMES +for just one of the copies. You'd have to access the 8-bit and 12-bit copies +from separate application source files. This is untested ... if you try it, +we'd like to hear whether it works!) + +Note that a 12-bit library always compresses in Huffman optimization mode, +in order to generate valid Huffman tables. This is necessary because our +default Huffman tables only cover 8-bit data. If you need to output 12-bit +files in one pass, you'll have to supply suitable default Huffman tables. +You may also want to supply your own DCT quantization tables; the existing +quality-scaling code has been developed for 8-bit use, and probably doesn't +generate especially good tables for 12-bit. + +The maximum number of components (color channels) in the image is determined +by MAX_COMPONENTS. The JPEG standard allows up to 255 components, but we +expect that few applications will need more than four or so. + +On machines with unusual data type sizes, you may be able to improve +performance or reduce memory space by tweaking the various typedefs in +jmorecfg.h. In particular, on some RISC CPUs, access to arrays of "short"s +is quite slow; consider trading memory for speed by making JCOEF, INT16, and +UINT16 be "int" or "unsigned int". UINT8 is also a candidate to become int. +You probably don't want to make JSAMPLE be int unless you have lots of memory +to burn. + +You can reduce the size of the library by compiling out various optional +functions. To do this, undefine xxx_SUPPORTED symbols as necessary. + +You can also save a few K by not having text error messages in the library; +the standard error message table occupies about 5Kb. This is particularly +reasonable for embedded applications where there's no good way to display +a message anyway. To do this, remove the creation of the message table +(jpeg_std_message_table[]) from jerror.c, and alter format_message to do +something reasonable without it. You could output the numeric value of the +message code number, for example. If you do this, you can also save a couple +more K by modifying the TRACEMSn() macros in jerror.h to expand to nothing; +you don't need trace capability anyway, right? + + +Portability considerations +-------------------------- + +The JPEG library has been written to be extremely portable; the sample +applications cjpeg and djpeg are slightly less so. This section summarizes +the design goals in this area. (If you encounter any bugs that cause the +library to be less portable than is claimed here, we'd appreciate hearing +about them.) + +The code works fine on ANSI C, C++, and pre-ANSI C compilers, using any of +the popular system include file setups, and some not-so-popular ones too. +See install.txt for configuration procedures. + +The code is not dependent on the exact sizes of the C data types. As +distributed, we make the assumptions that + char is at least 8 bits wide + short is at least 16 bits wide + int is at least 16 bits wide + long is at least 32 bits wide +(These are the minimum requirements of the ANSI C standard.) Wider types will +work fine, although memory may be used inefficiently if char is much larger +than 8 bits or short is much bigger than 16 bits. The code should work +equally well with 16- or 32-bit ints. + +In a system where these assumptions are not met, you may be able to make the +code work by modifying the typedefs in jmorecfg.h. However, you will probably +have difficulty if int is less than 16 bits wide, since references to plain +int abound in the code. + +char can be either signed or unsigned, although the code runs faster if an +unsigned char type is available. If char is wider than 8 bits, you will need +to redefine JOCTET and/or provide custom data source/destination managers so +that JOCTET represents exactly 8 bits of data on external storage. + +The JPEG library proper does not assume ASCII representation of characters. +But some of the image file I/O modules in cjpeg/djpeg do have ASCII +dependencies in file-header manipulation; so does cjpeg's select_file_type() +routine. + +The JPEG library does not rely heavily on the C library. In particular, C +stdio is used only by the data source/destination modules and the error +handler, all of which are application-replaceable. (cjpeg/djpeg are more +heavily dependent on stdio.) malloc and free are called only from the memory +manager "back end" module, so you can use a different memory allocator by +replacing that one file. + +The code generally assumes that C names must be unique in the first 15 +characters. However, global function names can be made unique in the +first 6 characters by defining NEED_SHORT_EXTERNAL_NAMES. + +More info about porting the code may be gleaned by reading jconfig.txt, +jmorecfg.h, and jinclude.h. + + +Notes for MS-DOS implementors +----------------------------- + +The IJG code is designed to work efficiently in 80x86 "small" or "medium" +memory models (i.e., data pointers are 16 bits unless explicitly declared +"far"; code pointers can be either size). You may be able to use small +model to compile cjpeg or djpeg by itself, but you will probably have to use +medium model for any larger application. This won't make much difference in +performance. You *will* take a noticeable performance hit if you use a +large-data memory model (perhaps 10%-25%), and you should avoid "huge" model +if at all possible. + +The JPEG library typically needs 2Kb-3Kb of stack space. It will also +malloc about 20K-30K of near heap space while executing (and lots of far +heap, but that doesn't count in this calculation). This figure will vary +depending on selected operating mode, and to a lesser extent on image size. +There is also about 5Kb-6Kb of constant data which will be allocated in the +near data segment (about 4Kb of this is the error message table). +Thus you have perhaps 20K available for other modules' static data and near +heap space before you need to go to a larger memory model. The C library's +static data will account for several K of this, but that still leaves a good +deal for your needs. (If you are tight on space, you could reduce the sizes +of the I/O buffers allocated by jdatasrc.c and jdatadst.c, say from 4K to +1K. Another possibility is to move the error message table to far memory; +this should be doable with only localized hacking on jerror.c.) + +About 2K of the near heap space is "permanent" memory that will not be +released until you destroy the JPEG object. This is only an issue if you +save a JPEG object between compression or decompression operations. + +Far data space may also be a tight resource when you are dealing with large +images. The most memory-intensive case is decompression with two-pass color +quantization, or single-pass quantization to an externally supplied color +map. This requires a 128Kb color lookup table plus strip buffers amounting +to about 40 bytes per column for typical sampling ratios (eg, about 25600 +bytes for a 640-pixel-wide image). You may not be able to process wide +images if you have large data structures of your own. + +Of course, all of these concerns vanish if you use a 32-bit flat-memory-model +compiler, such as DJGPP or Watcom C. We highly recommend flat model if you +can use it; the JPEG library is significantly faster in flat model. diff --git a/thirdparty/LibJPEG/jpeg-9/ltmain.sh b/thirdparty/LibJPEG/jpeg-9/ltmain.sh new file mode 100644 index 0000000..63ae69d --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/ltmain.sh @@ -0,0 +1,9655 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.2 +TIMESTAMP="" +package_revision=1.3337 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/thirdparty/LibJPEG/jpeg-9/makcjpeg.st b/thirdparty/LibJPEG/jpeg-9/makcjpeg.st new file mode 100644 index 0000000..628f533 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makcjpeg.st @@ -0,0 +1,36 @@ +; Project file for Independent JPEG Group's software +; +; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. +; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. +; +; To use this file, rename it to cjpeg.prj. +; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." +; Read installation instructions before trying to make the program! +; +; +; * * * Output file * * * +cjpeg.ttp +; +; * * * COMPILER OPTIONS * * * +.C[-P] ; absolute calls +.C[-M] ; and no string merging, folks +.C[-w-cln] ; no "constant is long" warnings +.C[-w-par] ; no "parameter xxxx unused" +.C[-w-rch] ; no "unreachable code" +.C[-wsig] ; warn if significant digits may be lost += +; * * * * List of modules * * * * +pcstart.o +cjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) +cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +libjpeg.lib ; built by libjpeg.prj +pcfltlib.lib ; floating point library +; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED +pcstdlib.lib ; standard library +pcextlib.lib ; extended library diff --git a/thirdparty/LibJPEG/jpeg-9/makdjpeg.st b/thirdparty/LibJPEG/jpeg-9/makdjpeg.st new file mode 100644 index 0000000..4b61404 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makdjpeg.st @@ -0,0 +1,36 @@ +; Project file for Independent JPEG Group's software +; +; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. +; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. +; +; To use this file, rename it to djpeg.prj. +; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." +; Read installation instructions before trying to make the program! +; +; +; * * * Output file * * * +djpeg.ttp +; +; * * * COMPILER OPTIONS * * * +.C[-P] ; absolute calls +.C[-M] ; and no string merging, folks +.C[-w-cln] ; no "constant is long" warnings +.C[-w-par] ; no "parameter xxxx unused" +.C[-w-rch] ; no "unreachable code" +.C[-wsig] ; warn if significant digits may be lost += +; * * * * List of modules * * * * +pcstart.o +djpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,jversion.h) +cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdcolmap.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +wrppm.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +wrgif.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +wrtarga.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +wrbmp.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +wrrle.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +libjpeg.lib ; built by libjpeg.prj +pcfltlib.lib ; floating point library +; the float library can be omitted if you've turned off DCT_FLOAT_SUPPORTED +pcstdlib.lib ; standard library +pcextlib.lib ; extended library diff --git a/thirdparty/LibJPEG/jpeg-9/makeadsw.vc6 b/thirdparty/LibJPEG/jpeg-9/makeadsw.vc6 new file mode 100644 index 0000000..80459c5 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makeadsw.vc6 @@ -0,0 +1,77 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GEL�SCHT WERDEN! + +############################################################################### + +Project: "cjpeg"=".\cjpeg.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "djpeg"=".\djpeg.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "jpegtran"=".\jpegtran.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "rdjpgcom"=".\rdjpgcom.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "wrjpgcom"=".\wrjpgcom.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/thirdparty/LibJPEG/jpeg-9/makeasln.v10 b/thirdparty/LibJPEG/jpeg-9/makeasln.v10 new file mode 100644 index 0000000..617d9e9 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makeasln.v10 @@ -0,0 +1,33 @@ +��� +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "djpeg", "djpeg.vcxproj", "{11043137-B453-4DFA-9010-4D2B9DC1545C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpegtran", "jpegtran.vcxproj", "{025BAC50-51B5-4FFE-BC47-3F920BB4047E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdjpgcom", "rdjpgcom.vcxproj", "{C81513DB-78DC-46BC-BC98-82E745203976}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxproj", "{B57065D4-DDDA-4668-BAF5-2D49270C973C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32 + {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32 + {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32 + {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32 + {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32 + {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32 + {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32 + {C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32 + {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32 + {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/LibJPEG/jpeg-9/makecdep.vc6 b/thirdparty/LibJPEG/jpeg-9/makecdep.vc6 new file mode 100644 index 0000000..11dff77 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makecdep.vc6 @@ -0,0 +1,82 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von cjpeg.mak + +.\cdjpeg.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\cjpeg.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + ".\jversion.h"\ + + +.\rdbmp.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\rdgif.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\rdppm.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\rdrle.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\rdswitch.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\rdtarga.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/makecdsp.vc6 b/thirdparty/LibJPEG/jpeg-9/makecdsp.vc6 new file mode 100644 index 0000000..3ab5965 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makecdsp.vc6 @@ -0,0 +1,130 @@ +# Microsoft Developer Studio Project File - Name="cjpeg" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=cjpeg - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "cjpeg.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "cjpeg.mak" CFG="cjpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "cjpeg - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\cjpeg\Release" +# PROP BASE Intermediate_Dir ".\cjpeg\Release" +# PROP BASE Target_Dir ".\cjpeg" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\cjpeg\Release" +# PROP Intermediate_Dir ".\cjpeg\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir ".\cjpeg" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Target + +# Name "cjpeg - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\cdjpeg.c +# End Source File +# Begin Source File + +SOURCE=.\cjpeg.c +# End Source File +# Begin Source File + +SOURCE=.\rdbmp.c +# End Source File +# Begin Source File + +SOURCE=.\rdgif.c +# End Source File +# Begin Source File + +SOURCE=.\rdppm.c +# End Source File +# Begin Source File + +SOURCE=.\rdrle.c +# End Source File +# Begin Source File + +SOURCE=.\rdswitch.c +# End Source File +# Begin Source File + +SOURCE=.\rdtarga.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\cderror.h +# End Source File +# Begin Source File + +SOURCE=.\cdjpeg.h +# End Source File +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jerror.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# Begin Source File + +SOURCE=.\jmorecfg.h +# End Source File +# Begin Source File + +SOURCE=.\jpeglib.h +# End Source File +# Begin Source File + +SOURCE=.\jversion.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/makecfil.v10 b/thirdparty/LibJPEG/jpeg-9/makecfil.v10 new file mode 100644 index 0000000..a4f81ac --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makecfil.v10 @@ -0,0 +1,69 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makecmak.vc6 b/thirdparty/LibJPEG/jpeg-9/makecmak.vc6 new file mode 100644 index 0000000..bee03bf --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makecmak.vc6 @@ -0,0 +1,159 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on cjpeg.dsp +!IF "$(CFG)" == "" +CFG=cjpeg - Win32 +!MESSAGE Keine Konfiguration angegeben. cjpeg - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "cjpeg - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "cjpeg.mak" CFG="cjpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "cjpeg - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +OUTDIR=.\cjpeg\Release +INTDIR=.\cjpeg\Release +# Begin Custom Macros +OutDir=.\cjpeg\Release +# End Custom Macros + +ALL : "$(OUTDIR)\cjpeg.exe" + + +CLEAN : + -@erase "$(INTDIR)\cdjpeg.obj" + -@erase "$(INTDIR)\cjpeg.obj" + -@erase "$(INTDIR)\rdbmp.obj" + -@erase "$(INTDIR)\rdgif.obj" + -@erase "$(INTDIR)\rdppm.obj" + -@erase "$(INTDIR)\rdrle.obj" + -@erase "$(INTDIR)\rdswitch.obj" + -@erase "$(INTDIR)\rdtarga.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\cjpeg.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\cjpeg.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\cjpeg.pdb" /machine:I386 /out:"$(OUTDIR)\cjpeg.exe" +LINK32_OBJS= \ + "$(INTDIR)\cdjpeg.obj" \ + "$(INTDIR)\cjpeg.obj" \ + "$(INTDIR)\rdbmp.obj" \ + "$(INTDIR)\rdgif.obj" \ + "$(INTDIR)\rdppm.obj" \ + "$(INTDIR)\rdrle.obj" \ + "$(INTDIR)\rdswitch.obj" \ + "$(INTDIR)\rdtarga.obj" + +"$(OUTDIR)\cjpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\cjpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("cjpeg.dep") +!INCLUDE "cjpeg.dep" +!ELSE +!MESSAGE Warning: cannot find "cjpeg.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "cjpeg - Win32" +SOURCE=.\cdjpeg.c + +"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\cjpeg.c + +"$(INTDIR)\cjpeg.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdbmp.c + +"$(INTDIR)\rdbmp.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdgif.c + +"$(INTDIR)\rdgif.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdppm.c + +"$(INTDIR)\rdppm.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdrle.c + +"$(INTDIR)\rdrle.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdswitch.c + +"$(INTDIR)\rdswitch.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdtarga.c + +"$(INTDIR)\rdtarga.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/makecvcx.v10 b/thirdparty/LibJPEG/jpeg-9/makecvcx.v10 new file mode 100644 index 0000000..5df5c68 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makecvcx.v10 @@ -0,0 +1,76 @@ +��� + + + + Release + Win32 + + + + {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57} + Win32Proj + cjpeg + + + + Application + false + true + Unicode + + + + + + + + + + false + $(ProjectName)\$(Configuration)\ + $(ProjectName)\$(Configuration)\ + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + true + 4996 + + + Console + true + true + true + Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makeddep.vc6 b/thirdparty/LibJPEG/jpeg-9/makeddep.vc6 new file mode 100644 index 0000000..f911eba --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makeddep.vc6 @@ -0,0 +1,82 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von djpeg.mak + +.\cdjpeg.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\djpeg.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + ".\jversion.h"\ + + +.\rdcolmap.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\wrbmp.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\wrgif.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\wrppm.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\wrrle.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\wrtarga.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/makeddsp.vc6 b/thirdparty/LibJPEG/jpeg-9/makeddsp.vc6 new file mode 100644 index 0000000..f583a0f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makeddsp.vc6 @@ -0,0 +1,130 @@ +# Microsoft Developer Studio Project File - Name="djpeg" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=djpeg - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "djpeg.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "djpeg.mak" CFG="djpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "djpeg - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\djpeg\Release" +# PROP BASE Intermediate_Dir ".\djpeg\Release" +# PROP BASE Target_Dir ".\djpeg" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\djpeg\Release" +# PROP Intermediate_Dir ".\djpeg\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir ".\djpeg" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Target + +# Name "djpeg - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\cdjpeg.c +# End Source File +# Begin Source File + +SOURCE=.\djpeg.c +# End Source File +# Begin Source File + +SOURCE=.\rdcolmap.c +# End Source File +# Begin Source File + +SOURCE=.\wrbmp.c +# End Source File +# Begin Source File + +SOURCE=.\wrgif.c +# End Source File +# Begin Source File + +SOURCE=.\wrppm.c +# End Source File +# Begin Source File + +SOURCE=.\wrrle.c +# End Source File +# Begin Source File + +SOURCE=.\wrtarga.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\cderror.h +# End Source File +# Begin Source File + +SOURCE=.\cdjpeg.h +# End Source File +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jerror.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# Begin Source File + +SOURCE=.\jmorecfg.h +# End Source File +# Begin Source File + +SOURCE=.\jpeglib.h +# End Source File +# Begin Source File + +SOURCE=.\jversion.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/makedfil.v10 b/thirdparty/LibJPEG/jpeg-9/makedfil.v10 new file mode 100644 index 0000000..b4a83ab --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makedfil.v10 @@ -0,0 +1,69 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makedmak.vc6 b/thirdparty/LibJPEG/jpeg-9/makedmak.vc6 new file mode 100644 index 0000000..e16487f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makedmak.vc6 @@ -0,0 +1,159 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on djpeg.dsp +!IF "$(CFG)" == "" +CFG=djpeg - Win32 +!MESSAGE Keine Konfiguration angegeben. djpeg - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "djpeg - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "djpeg.mak" CFG="djpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "djpeg - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +OUTDIR=.\djpeg\Release +INTDIR=.\djpeg\Release +# Begin Custom Macros +OutDir=.\djpeg\Release +# End Custom Macros + +ALL : "$(OUTDIR)\djpeg.exe" + + +CLEAN : + -@erase "$(INTDIR)\cdjpeg.obj" + -@erase "$(INTDIR)\djpeg.obj" + -@erase "$(INTDIR)\rdcolmap.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\wrbmp.obj" + -@erase "$(INTDIR)\wrgif.obj" + -@erase "$(INTDIR)\wrppm.obj" + -@erase "$(INTDIR)\wrrle.obj" + -@erase "$(INTDIR)\wrtarga.obj" + -@erase "$(OUTDIR)\djpeg.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\djpeg.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\djpeg.pdb" /machine:I386 /out:"$(OUTDIR)\djpeg.exe" +LINK32_OBJS= \ + "$(INTDIR)\cdjpeg.obj" \ + "$(INTDIR)\djpeg.obj" \ + "$(INTDIR)\rdcolmap.obj" \ + "$(INTDIR)\wrbmp.obj" \ + "$(INTDIR)\wrgif.obj" \ + "$(INTDIR)\wrppm.obj" \ + "$(INTDIR)\wrrle.obj" \ + "$(INTDIR)\wrtarga.obj" + +"$(OUTDIR)\djpeg.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\djpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("djpeg.dep") +!INCLUDE "djpeg.dep" +!ELSE +!MESSAGE Warning: cannot find "djpeg.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "djpeg - Win32" +SOURCE=.\cdjpeg.c + +"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\djpeg.c + +"$(INTDIR)\djpeg.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdcolmap.c + +"$(INTDIR)\rdcolmap.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\wrbmp.c + +"$(INTDIR)\wrbmp.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\wrgif.c + +"$(INTDIR)\wrgif.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\wrppm.c + +"$(INTDIR)\wrppm.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\wrrle.c + +"$(INTDIR)\wrrle.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\wrtarga.c + +"$(INTDIR)\wrtarga.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/makedvcx.v10 b/thirdparty/LibJPEG/jpeg-9/makedvcx.v10 new file mode 100644 index 0000000..9ad2d41 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makedvcx.v10 @@ -0,0 +1,76 @@ +��� + + + + Release + Win32 + + + + {11043137-B453-4DFA-9010-4D2B9DC1545C} + Win32Proj + djpeg + + + + Application + false + true + Unicode + + + + + + + + + + false + $(ProjectName)\$(Configuration)\ + $(ProjectName)\$(Configuration)\ + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + true + 4996 + + + Console + true + true + true + Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.ansi b/thirdparty/LibJPEG/jpeg-9/makefile.ansi new file mode 100644 index 0000000..c0fe72b --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.ansi @@ -0,0 +1,221 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is suitable for Unix-like systems with ANSI-capable compilers. +# If you have a non-ANSI compiler, makefile.unix is a better starting point. + +# Read installation instructions before saying "make" !! + +# The name of your C compiler: +CC= cc + +# You may need to adjust these cc options: +CFLAGS= -O +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time cc options: +LDFLAGS= + +# To link any special libraries, add the necessary -l commands here. +LDLIBS= + +# Put here the object file name for the correct system-dependent memory +# manager file. For Unix this is usually jmemnobs.o, but you may want +# to use jmemansi.o or jmemname.o if you have limited swap space. +SYSDEPMEM= jmemnobs.o + +# miscellaneous OS-dependent stuff +# linker +LN= $(CC) +# file deletion command +RM= rm -f +# library (.a) file creation command +AR= ar rc +# second step in .a creation (use "touch" if not needed) +AR2= ranlib + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ + jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o +# decompression library object files +DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \ + jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \ + jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \ + jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o +# These objectfiles are included in libjpeg.a +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \ + cdjpeg.o +DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \ + cdjpeg.o +TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o + + +all: libjpeg.a cjpeg djpeg jpegtran rdjpgcom wrjpgcom + +libjpeg.a: $(LIBOBJECTS) + $(RM) libjpeg.a + $(AR) libjpeg.a $(LIBOBJECTS) + $(AR2) libjpeg.a + +cjpeg: $(COBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS) + +djpeg: $(DOBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS) + +jpegtran: $(TROBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.a $(LDLIBS) + +rdjpgcom: rdjpgcom.o + $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS) + +wrjpgcom: wrjpgcom.o + $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS) + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + $(RM) *.o cjpeg djpeg jpegtran libjpeg.a rdjpgcom wrjpgcom + $(RM) core testout* + +test: cjpeg djpeg jpegtran + $(RM) testout* + ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + ./cjpeg -dct int -outfile testout.jpg testimg.ppm + ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + ./jpegtran -outfile testoutt.jpg testprog.jpg + cmp testimg.ppm testout.ppm + cmp testimg.bmp testout.bmp + cmp testimg.jpg testout.jpg + cmp testimg.ppm testoutp.ppm + cmp testimgp.jpg testoutp.jpg + cmp testorig.jpg testoutt.jpg + + +jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.bcc b/thirdparty/LibJPEG/jpeg-9/makefile.bcc new file mode 100644 index 0000000..68d68ef --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.bcc @@ -0,0 +1,292 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is suitable for Borland C on MS-DOS or OS/2. +# It works with Borland C++ for DOS, revision 3.0 or later, +# and has been tested with Borland C++ for OS/2. +# Watch out for optimization bugs in the OS/2 compilers --- see notes below! +# Thanks to Tom Wright and Ge' Weijers (original DOS) and +# Ken Porter (OS/2) for this file. + +# Read installation instructions before saying "make" !! + +# Are we under DOS or OS/2? +!if !$d(DOS) && !$d(OS2) +!if $d(__OS2__) +OS2=1 +!else +DOS=1 +!endif +!endif + +# The name of your C compiler: +CC= bcc + +# You may need to adjust these cc options: +!if $d(DOS) +CFLAGS= -O2 -mm -w-par -w-stu -w-ccc -w-rch +!else +CFLAGS= -O1 -w-par -w-stu -w-ccc -w-rch +!endif +# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z). +# -O2 is buggy in Borland OS/2 C++ revision 2.0, so use -O1 there for now. +# If you have Borland OS/2 C++ revision 1.0, use -O or no optimization at all. +# -mm selects medium memory model (near data, far code pointers; DOS only!) +# -w-par suppresses warnings about unused function parameters +# -w-stu suppresses warnings about incomplete structures +# -w-ccc suppresses warnings about compile-time-constant conditions +# -w-rch suppresses warnings about unreachable code +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time cc options: +!if $d(DOS) +LDFLAGS= -mm +# memory model option here must match CFLAGS! +!else +LDFLAGS= +# -lai full-screen app +# -lc case-significant link +!endif + +# Put here the object file name for the correct system-dependent memory +# manager file. +# For DOS, we recommend jmemdos.c and jmemdosa.asm. +# For OS/2, we recommend jmemnobs.c (flat memory!) +# SYSDEPMEMLIB must list the same files with "+" signs for the librarian. +!if $d(DOS) +SYSDEPMEM= jmemdos.obj jmemdosa.obj +SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj +!else +SYSDEPMEM= jmemnobs.obj +SYSDEPMEMLIB= +jmemnobs.obj +!endif + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \ + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \ + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \ + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \ + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \ + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \ + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \ + jdmerge.obj +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \ + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \ + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj + + +all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.lib: $(LIBOBJECTS) + - del libjpeg.lib + tlib libjpeg.lib /E /C @&&| ++jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj & ++jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj & ++jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & ++jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj & ++jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & ++jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj & ++jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj & ++jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj & ++jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj & +$(SYSDEPMEMLIB) +| + +cjpeg.exe: $(COBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib + +djpeg.exe: $(DOBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib + +jpegtran.exe: $(TROBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib + +rdjpgcom.exe: rdjpgcom.c +!if $d(DOS) + $(CC) -ms -O rdjpgcom.c +!else + $(CC) $(CFLAGS) rdjpgcom.c +!endif + +# On DOS, wrjpgcom needs large model so it can malloc a 64K chunk +wrjpgcom.exe: wrjpgcom.c +!if $d(DOS) + $(CC) -ml -O wrjpgcom.c +!else + $(CC) $(CFLAGS) wrjpgcom.c +!endif + +# This "{}" syntax allows Borland Make to "batch" source files. +# In this way, each run of the compiler can build many modules. +.c.obj: + $(CC) $(CFLAGS) -c{ $<} + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + - del *.obj + - del libjpeg.lib + - del cjpeg.exe + - del djpeg.exe + - del jpegtran.exe + - del rdjpgcom.exe + - del wrjpgcom.exe + - del testout*.* + +test: cjpeg.exe djpeg.exe jpegtran.exe + - del testout*.* + djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + cjpeg -dct int -outfile testout.jpg testimg.ppm + djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + jpegtran -outfile testoutt.jpg testprog.jpg +!if $d(DOS) + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg +!else + echo n > n.tmp + comp testimg.ppm testout.ppm < n.tmp + comp testimg.bmp testout.bmp < n.tmp + comp testimg.jpg testout.jpg < n.tmp + comp testimg.ppm testoutp.ppm < n.tmp + comp testimgp.jpg testoutp.jpg < n.tmp + comp testorig.jpg testoutt.jpg < n.tmp + del n.tmp +!endif + + +jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +jmemdosa.obj: jmemdosa.asm + tasm /mx jmemdosa.asm diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.dj b/thirdparty/LibJPEG/jpeg-9/makefile.dj new file mode 100644 index 0000000..f37c121 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.dj @@ -0,0 +1,227 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is for DJGPP (Delorie's GNU C port on MS-DOS), v2.0 or later. +# Thanks to Frank J. Donahoe for this version. + +# Read installation instructions before saying "make" !! + +# The name of your C compiler: +CC= gcc + +# You may need to adjust these cc options: +CFLAGS= -O2 -Wall -I. +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time cc options: +LDFLAGS= -s + +# To link any special libraries, add the necessary -l commands here. +LDLIBS= + +# Put here the object file name for the correct system-dependent memory +# manager file. For DJGPP this is usually jmemnobs.o, but you could +# use jmemname.o if you want to use named temp files instead of swap space. +SYSDEPMEM= jmemnobs.o + +# miscellaneous OS-dependent stuff +# linker +LN= $(CC) +# file deletion command +RM= del +# library (.a) file creation command +AR= ar rc +# second step in .a creation (use "touch" if not needed) +AR2= ranlib + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ + jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o +# decompression library object files +DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \ + jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \ + jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \ + jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o +# These objectfiles are included in libjpeg.a +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \ + cdjpeg.o +DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \ + cdjpeg.o +TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o + + +all: libjpeg.a cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.a: $(LIBOBJECTS) + $(RM) libjpeg.a + $(AR) libjpeg.a $(LIBOBJECTS) + $(AR2) libjpeg.a + +cjpeg.exe: $(COBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o cjpeg.exe $(COBJECTS) libjpeg.a $(LDLIBS) + +djpeg.exe: $(DOBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o djpeg.exe $(DOBJECTS) libjpeg.a $(LDLIBS) + +jpegtran.exe: $(TROBJECTS) libjpeg.a + $(LN) $(LDFLAGS) -o jpegtran.exe $(TROBJECTS) libjpeg.a $(LDLIBS) + +rdjpgcom.exe: rdjpgcom.o + $(LN) $(LDFLAGS) -o rdjpgcom.exe rdjpgcom.o $(LDLIBS) + +wrjpgcom.exe: wrjpgcom.o + $(LN) $(LDFLAGS) -o wrjpgcom.exe wrjpgcom.o $(LDLIBS) + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + $(RM) *.o + $(RM) cjpeg.exe + $(RM) djpeg.exe + $(RM) jpegtran.exe + $(RM) rdjpgcom.exe + $(RM) wrjpgcom.exe + $(RM) libjpeg.a + $(RM) testout*.* + +test: cjpeg.exe djpeg.exe jpegtran.exe + $(RM) testout*.* + ./djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + ./cjpeg -dct int -outfile testout.jpg testimg.ppm + ./djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + ./jpegtran -outfile testoutt.jpg testprog.jpg + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg + + +jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.manx b/thirdparty/LibJPEG/jpeg-9/makefile.manx new file mode 100644 index 0000000..57a1bb9 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.manx @@ -0,0 +1,221 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is for Amiga systems using Manx Aztec C ver 5.x. +# Thanks to D.J. James (djjames@cup.portal.com) for this version. + +# Read installation instructions before saying "make" !! + +# The name of your C compiler: +CC= cc + +# You may need to adjust these cc options: +# Uncomment for generic 68000 code (will work on any Amiga) +ARCHFLAGS= -sn + +# Uncomment for 68020/68030 code (faster, but won't run on 68000 CPU) +#ARCHFLAGS= -c2 + +CFLAGS= -MC -MD $(ARCHFLAGS) -spfam -r4 + +# Link-time cc options: +LDFLAGS= -g + +# To link any special libraries, add the necessary -l commands here. +LDLIBS= -lml -lcl + +# Put here the object file name for the correct system-dependent memory +# manager file. For Amiga we recommend jmemname.o. +SYSDEPMEM= jmemname.o + +# miscellaneous OS-dependent stuff +# linker +LN= ln +# file deletion command +RM= delete quiet +# library (.lib) file creation command +AR= lb + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ + jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o +# decompression library object files +DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \ + jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \ + jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \ + jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \ + cdjpeg.o +DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \ + cdjpeg.o +TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o + + +all: libjpeg.lib cjpeg djpeg jpegtran rdjpgcom wrjpgcom + +libjpeg.lib: $(LIBOBJECTS) + -$(RM) libjpeg.lib + $(AR) libjpeg.lib $(LIBOBJECTS) + +cjpeg: $(COBJECTS) libjpeg.lib + $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.lib $(LDLIBS) + +djpeg: $(DOBJECTS) libjpeg.lib + $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.lib $(LDLIBS) + +jpegtran: $(TROBJECTS) libjpeg.lib + $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.lib $(LDLIBS) + +rdjpgcom: rdjpgcom.o + $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS) + +wrjpgcom: wrjpgcom.o + $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS) + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + -$(RM) *.o cjpeg djpeg jpegtran libjpeg.lib rdjpgcom wrjpgcom + -$(RM) core testout*.* + +test: cjpeg djpeg jpegtran + -$(RM) testout*.* + djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + cjpeg -dct int -outfile testout.jpg testimg.ppm + djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + jpegtran -outfile testoutt.jpg testprog.jpg + cmp testimg.ppm testout.ppm + cmp testimg.bmp testout.bmp + cmp testimg.jpg testout.jpg + cmp testimg.ppm testoutp.ppm + cmp testimgp.jpg testoutp.jpg + cmp testorig.jpg testoutt.jpg + + +jaricom.o: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.o: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.o: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.o: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.o: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.o: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.o: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.o: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.o: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.o: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.o: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.o: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.o: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.o: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.o: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.o: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.o: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.o: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.o: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.o: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.o: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.o: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.o: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.o: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.o: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.o: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.o: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.o: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.o: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.o: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.o: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.o: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.o: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.o: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.o: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.o: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.o: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.o: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.o: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.o: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.o: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.o: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.o: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.o: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.o: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.o: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.o: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.o: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.o: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.o: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.o: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.o: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.o: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.o: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.o: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.o: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.o: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.o: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.o: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.o: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.o: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.o: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.o: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.o: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.o: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.o: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.o: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.o: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.o: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.mc6 b/thirdparty/LibJPEG/jpeg-9/makefile.mc6 new file mode 100644 index 0000000..7dd37f1 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.mc6 @@ -0,0 +1,256 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is for Microsoft C for MS-DOS, version 6.00A and up. +# Use NMAKE, not Microsoft's brain-damaged MAKE. +# Thanks to Alan Wright and Chris Turner of Olivetti Research Ltd. + +# Read installation instructions before saying "nmake" !! + +# You may need to adjust these compiler options: +CFLAGS = -AM -Oecigt -Gs -W3 +# -AM medium memory model (or use -AS for small model, if you remove features) +# -Oecigt -Gs maximum safe optimisation (-Ol has bugs in MSC 6.00A) +# -W3 warning level 3 +# You might also want to add -G2 if you have an 80286, etc. +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Jan-Herman Buining suggests the following switches for MS C 8.0 and a 486: +# CFLAGS = /AM /f- /FPi87 /G3 /Gs /Gy /Ob1 /Oc /Oe /Og /Oi /Ol /On /Oo /Ot \ +# /OV4 /W3 +# except for jquant1.c, which must be compiled with /Oo- to avoid a compiler +# crash. + +# Ingar Steinsland suggests the following switches when building +# a 16-bit Windows DLL: +# CFLAGS = -ALw -Gsw -Zpe -W3 -O2 -Zi -Zd + +# Put here the object file name for the correct system-dependent memory +# manager file. For DOS, we recommend jmemdos.c and jmemdosa.asm. +# (But not for Windows; see install.txt if you use this makefile for Windows.) +SYSDEPMEM= jmemdos.obj jmemdosa.obj +# SYSDEPMEMLIB must list the same files with "+" signs for the librarian. +SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \ + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \ + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \ + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \ + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \ + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \ + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \ + jdmerge.obj +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \ + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \ + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj + +# need linker response file because file list > 128 chars +RFILE = libjpeg.ans + + +all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.lib: $(LIBOBJECTS) $(RFILE) + del libjpeg.lib + lib @$(RFILE) + +# linker response file for building libjpeg.lib +$(RFILE) : makefile + del $(RFILE) + echo libjpeg.lib >$(RFILE) +# silly want-to-create-it prompt: + echo y >>$(RFILE) + echo +jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj & >>$(RFILE) + echo +jcparam.obj +jdatadst.obj +jcinit.obj +jcmaster.obj & >>$(RFILE) + echo +jcmarker.obj +jcmainct.obj +jcprepct.obj & >>$(RFILE) + echo +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & >>$(RFILE) + echo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE) + echo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE) + echo +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & >>$(RFILE) + echo +jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj & >>$(RFILE) + echo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE) + echo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE) + echo +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE) + echo +jquant2.obj +jdmerge.obj +jaricom.obj +jcomapi.obj & >>$(RFILE) + echo +jutils.obj +jerror.obj +jmemmgr.obj & >>$(RFILE) + echo $(SYSDEPMEMLIB) ; >>$(RFILE) + +cjpeg.exe: $(COBJECTS) libjpeg.lib + echo $(COBJECTS) >cjpeg.lst + link /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ; + del cjpeg.lst + +djpeg.exe: $(DOBJECTS) libjpeg.lib + echo $(DOBJECTS) >djpeg.lst + link /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ; + del djpeg.lst + +jpegtran.exe: $(TROBJECTS) libjpeg.lib + link /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ; + +rdjpgcom.exe: rdjpgcom.c + $(CC) -AS -O -W3 rdjpgcom.c + +# wrjpgcom needs large model so it can malloc a 64K chunk +wrjpgcom.exe: wrjpgcom.c + $(CC) -AL -O -W3 wrjpgcom.c + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: + del *.obj + del libjpeg.lib + del cjpeg.exe + del djpeg.exe + del jpegtran.exe + del rdjpgcom.exe + del wrjpgcom.exe + del testout*.* + +test: cjpeg.exe djpeg.exe jpegtran.exe + del testout*.* + djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + cjpeg -dct int -outfile testout.jpg testimg.ppm + djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + jpegtran -outfile testoutt.jpg testprog.jpg + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg + + +jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +jmemdosa.obj : jmemdosa.asm + masm /mx $*; diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.mms b/thirdparty/LibJPEG/jpeg-9/makefile.mms new file mode 100644 index 0000000..5349306 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.mms @@ -0,0 +1,225 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is for use with MMS on Digital VMS systems. +# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu) +# and Tim Bell (tbell@netcom.com) for their help. + +# Read installation instructions before saying "MMS" !! + +# You may need to adjust these cc options: +CFLAGS= $(CFLAGS) /NoDebug /Optimize +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via /Define switches here. +.ifdef ALPHA +OPT= +.else +OPT= ,Sys$Disk:[]MAKVMS.OPT/Option +.endif + +# Put here the object file name for the correct system-dependent memory +# manager file. For Unix this is usually jmemnobs.o, but you may want +# to use jmemansi.o or jmemname.o if you have limited swap space. +SYSDEPMEM= jmemnobs.obj + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \ + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \ + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \ + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \ + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \ + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \ + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \ + jdmerge.obj +# These objectfiles are included in libjpeg.olb +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \ + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \ + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj +# objectfile lists with commas --- what a crock +COBJLIST= cjpeg.obj,rdppm.obj,rdgif.obj,rdtarga.obj,rdrle.obj,rdbmp.obj,\ + rdswitch.obj,cdjpeg.obj +DOBJLIST= djpeg.obj,wrppm.obj,wrgif.obj,wrtarga.obj,wrrle.obj,wrbmp.obj,\ + rdcolmap.obj,cdjpeg.obj +TROBJLIST= jpegtran.obj,rdswitch.obj,cdjpeg.obj,transupp.obj +LIBOBJLIST= jaricom.obj,jcapimin.obj,jcapistd.obj,jcarith.obj,jctrans.obj,\ + jcparam.obj,jdatadst.obj,jcinit.obj,jcmaster.obj,jcmarker.obj,\ + jcmainct.obj,jcprepct.obj,jccoefct.obj,jccolor.obj,jcsample.obj,\ + jchuff.obj,jcdctmgr.obj,jfdctfst.obj,jfdctflt.obj,jfdctint.obj,\ + jdapimin.obj,jdapistd.obj,jdarith.obj,jdtrans.obj,jdatasrc.obj,\ + jdmaster.obj,jdinput.obj,jdmarker.obj,jdhuff.obj,jdmainct.obj,\ + jdcoefct.obj,jdpostct.obj,jddctmgr.obj,jidctfst.obj,jidctflt.obj,\ + jidctint.obj,jdsample.obj,jdcolor.obj,jquant1.obj,jquant2.obj,\ + jdmerge.obj,jcomapi.obj,jutils.obj,jerror.obj,jmemmgr.obj,$(SYSDEPMEM) + + +.first + @- Define /NoLog Sys Sys$Library + +ALL : libjpeg.olb cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + @ Continue + +libjpeg.olb : $(LIBOBJECTS) + Library /Create libjpeg.olb $(LIBOBJLIST) + +cjpeg.exe : $(COBJECTS) libjpeg.olb + $(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),libjpeg.olb/Library$(OPT) + +djpeg.exe : $(DOBJECTS) libjpeg.olb + $(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),libjpeg.olb/Library$(OPT) + +jpegtran.exe : $(TROBJECTS) libjpeg.olb + $(LINK) $(LFLAGS) /Executable = jpegtran.exe $(TROBJLIST),libjpeg.olb/Library$(OPT) + +rdjpgcom.exe : rdjpgcom.obj + $(LINK) $(LFLAGS) /Executable = rdjpgcom.exe rdjpgcom.obj$(OPT) + +wrjpgcom.exe : wrjpgcom.obj + $(LINK) $(LFLAGS) /Executable = wrjpgcom.exe wrjpgcom.obj$(OPT) + +jconfig.h : jconfig.vms + @- Copy jconfig.vms jconfig.h + +clean : + @- Set Protection = Owner:RWED *.*;-1 + @- Set Protection = Owner:RWED *.OBJ + - Purge /NoLog /NoConfirm *.* + - Delete /NoLog /NoConfirm *.OBJ; + +test : cjpeg.exe djpeg.exe jpegtran.exe + mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm + mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg + - Backup /Compare/Log testimg.ppm testout.ppm + - Backup /Compare/Log testimg.bmp testout.bmp + - Backup /Compare/Log testimg.jpg testout.jpg + - Backup /Compare/Log testimg.ppm testoutp.ppm + - Backup /Compare/Log testimgp.jpg testoutp.jpg + - Backup /Compare/Log testorig.jpg testoutt.jpg + + +jaricom.obj : jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj : jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj : jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj : jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj : jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj : jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj : jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj : jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj : jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj : jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj : jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj : jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj : jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj : rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj : wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj : cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj : rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj : transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.sas b/thirdparty/LibJPEG/jpeg-9/makefile.sas new file mode 100644 index 0000000..ba0d63b --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.sas @@ -0,0 +1,259 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is for Amiga systems using SAS C 6.0 and up. +# Thanks to Ed Hanway, Mark Rinfret, and Jim Zepeda. + +# Read installation instructions before saying "make" !! + +# The name of your C compiler: +CC= sc + +# You may need to adjust these cc options: +# Uncomment the following lines for generic 680x0 version +ARCHFLAGS= cpu=any +SUFFIX= + +# Uncomment the following lines for 68030-only version +#ARCHFLAGS= cpu=68030 +#SUFFIX=.030 + +CFLAGS= nostackcheck data=near parms=register optimize $(ARCHFLAGS) \ + ignore=104 ignore=304 ignore=306 +# ignore=104 disables warnings for mismatched const qualifiers +# ignore=304 disables warnings for variables being optimized out +# ignore=306 disables warnings for the inlining of functions +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via define switches here. + +# Link-time cc options: +LDFLAGS= SC SD ND BATCH + +# To link any special libraries, add the necessary commands here. +LDLIBS= LIB:scm.lib LIB:sc.lib + +# Put here the object file name for the correct system-dependent memory +# manager file. For Amiga we recommend jmemname.o. +SYSDEPMEM= jmemname.o + +# miscellaneous OS-dependent stuff +# linker +LN= slink +# file deletion command +RM= delete quiet +# library (.lib) file creation command +AR= oml + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \ + jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ + jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \ + jfdctflt.o jfdctint.o +# decompression library object files +DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \ + jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \ + jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \ + jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswitch.o \ + cdjpeg.o +DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o \ + cdjpeg.o +TROBJECTS= jpegtran.o rdswitch.o cdjpeg.o transupp.o + + +all: libjpeg.lib cjpeg$(SUFFIX) djpeg$(SUFFIX) jpegtran$(SUFFIX) rdjpgcom$(SUFFIX) wrjpgcom$(SUFFIX) + +# note: do several AR steps to avoid command line length limitations + +libjpeg.lib: $(LIBOBJECTS) + -$(RM) libjpeg.lib + $(AR) libjpeg.lib r $(CLIBOBJECTS) + $(AR) libjpeg.lib r $(DLIBOBJECTS) + $(AR) libjpeg.lib r $(COMOBJECTS) + +cjpeg$(SUFFIX): $(COBJECTS) libjpeg.lib + $(LN) + +# You may want to adjust these compiler options: +CFLAGS= $(cflags) $(cdebug) $(cvars) -I. +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time options: +LDFLAGS= $(ldebug) $(conlflags) + +# To link any special libraries, add the necessary commands here. +LDLIBS= $(conlibs) + +# Put here the object file name for the correct system-dependent memory +# manager file. For NT we suggest jmemnobs.obj, which expects the OS to +# provide adequate virtual memory. +SYSDEPMEM= jmemnobs.obj + +# miscellaneous OS-dependent stuff +# file deletion command +RM= del + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \ + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \ + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \ + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \ + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \ + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \ + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \ + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \ + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \ + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \ + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \ + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \ + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \ + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \ + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \ + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \ + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \ + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \ + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \ + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \ + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \ + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \ + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \ + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \ + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \ + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \ + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \ + jdmerge.obj +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \ + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \ + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj + +# Template command for compiling .c to .obj +.c.obj: + $(cc) $(CFLAGS) $*.c + + +all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.lib: $(LIBOBJECTS) + $(RM) libjpeg.lib + lib -out:libjpeg.lib $(LIBOBJECTS) + +cjpeg.exe: $(COBJECTS) libjpeg.lib + $(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS) + +djpeg.exe: $(DOBJECTS) libjpeg.lib + $(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS) + +jpegtran.exe: $(TROBJECTS) libjpeg.lib + $(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS) + +rdjpgcom.exe: rdjpgcom.obj + $(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS) + +wrjpgcom.exe: wrjpgcom.obj + $(link) $(LDFLAGS) -out:wrjpgcom.exe wrjpgcom.obj $(LDLIBS) + + +clean: + $(RM) *.obj *.exe libjpeg.lib + $(RM) testout* + +setup-vc6: + ren jconfig.vc jconfig.h + ren makejdsw.vc6 jpeg.dsw + ren makeadsw.vc6 apps.dsw + ren makejmak.vc6 jpeg.mak + ren makejdep.vc6 jpeg.dep + ren makejdsp.vc6 jpeg.dsp + ren makecmak.vc6 cjpeg.mak + ren makecdep.vc6 cjpeg.dep + ren makecdsp.vc6 cjpeg.dsp + ren makedmak.vc6 djpeg.mak + ren makeddep.vc6 djpeg.dep + ren makeddsp.vc6 djpeg.dsp + ren maketmak.vc6 jpegtran.mak + ren maketdep.vc6 jpegtran.dep + ren maketdsp.vc6 jpegtran.dsp + ren makermak.vc6 rdjpgcom.mak + ren makerdep.vc6 rdjpgcom.dep + ren makerdsp.vc6 rdjpgcom.dsp + ren makewmak.vc6 wrjpgcom.mak + ren makewdep.vc6 wrjpgcom.dep + ren makewdsp.vc6 wrjpgcom.dsp + +setup-v10: + ren jconfig.vc jconfig.h + ren makejsln.v10 jpeg.sln + ren makeasln.v10 apps.sln + ren makejvcx.v10 jpeg.vcxproj + ren makejfil.v10 jpeg.vcxproj.filters + ren makecvcx.v10 cjpeg.vcxproj + ren makecfil.v10 cjpeg.vcxproj.filters + ren makedvcx.v10 djpeg.vcxproj + ren makedfil.v10 djpeg.vcxproj.filters + ren maketvcx.v10 jpegtran.vcxproj + ren maketfil.v10 jpegtran.vcxproj.filters + ren makervcx.v10 rdjpgcom.vcxproj + ren makerfil.v10 rdjpgcom.vcxproj.filters + ren makewvcx.v10 wrjpgcom.vcxproj + ren makewfil.v10 wrjpgcom.vcxproj.filters + +test: + IF EXIST testout* $(RM) testout* + .\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + .\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + .\cjpeg -dct int -outfile testout.jpg testimg.ppm + .\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + .\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + .\jpegtran -outfile testoutt.jpg testprog.jpg + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg + +test-build: + IF EXIST testout* $(RM) testout* + .\djpeg\Release\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + .\djpeg\Release\djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + .\cjpeg\Release\cjpeg -dct int -outfile testout.jpg testimg.ppm + .\djpeg\Release\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + .\cjpeg\Release\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + .\jpegtran\Release\jpegtran -outfile testoutt.jpg testprog.jpg + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg + + +jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.vms b/thirdparty/LibJPEG/jpeg-9/makefile.vms new file mode 100644 index 0000000..a07d070 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.vms @@ -0,0 +1,142 @@ +$! Makefile for Independent JPEG Group's software +$! +$! This is a command procedure for Digital VMS systems that do not have MMS. +$! It builds the JPEG software by brute force, recompiling everything whether +$! or not it is necessary. It then runs the basic self-test. +$! Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu) +$! and Tim Bell (tbell@netcom.com) for their help. +$! +$! Read installation instructions before running this!! +$! +$ If F$Mode () .eqs. "INTERACTIVE" +$ Then +$ VERIFY = F$Verify (0) +$ Else +$ VERIFY = F$Verify (1) +$ EndIf +$ On Control_Y Then GoTo End +$ On Error Then GoTo End +$ +$ If F$GetSyi ("HW_MODEL") .gt. 1023 +$ Then +$ OPT = "" +$ Else +$ OPT = ",Sys$Disk:[]makvms.opt/Option" +$ EndIf +$ +$ DoCompile := CC /NoDebug /Optimize /NoList +$! +$ DoCompile jaricom.c +$ DoCompile jcapimin.c +$ DoCompile jcapistd.c +$ DoCompile jcarith.c +$ DoCompile jctrans.c +$ DoCompile jcparam.c +$ DoCompile jdatadst.c +$ DoCompile jcinit.c +$ DoCompile jcmaster.c +$ DoCompile jcmarker.c +$ DoCompile jcmainct.c +$ DoCompile jcprepct.c +$ DoCompile jccoefct.c +$ DoCompile jccolor.c +$ DoCompile jcsample.c +$ DoCompile jchuff.c +$ DoCompile jcdctmgr.c +$ DoCompile jfdctfst.c +$ DoCompile jfdctflt.c +$ DoCompile jfdctint.c +$ DoCompile jdapimin.c +$ DoCompile jdapistd.c +$ DoCompile jdarith.c +$ DoCompile jdtrans.c +$ DoCompile jdatasrc.c +$ DoCompile jdmaster.c +$ DoCompile jdinput.c +$ DoCompile jdmarker.c +$ DoCompile jdhuff.c +$ DoCompile jdmainct.c +$ DoCompile jdcoefct.c +$ DoCompile jdpostct.c +$ DoCompile jddctmgr.c +$ DoCompile jidctfst.c +$ DoCompile jidctflt.c +$ DoCompile jidctint.c +$ DoCompile jdsample.c +$ DoCompile jdcolor.c +$ DoCompile jquant1.c +$ DoCompile jquant2.c +$ DoCompile jdmerge.c +$ DoCompile jcomapi.c +$ DoCompile jutils.c +$ DoCompile jerror.c +$ DoCompile jmemmgr.c +$ DoCompile jmemnobs.c +$! +$ Library /Create libjpeg.olb jaricom.obj,jcapimin.obj,jcapistd.obj, - + jcarith.obj,jctrans.obj,jcparam.obj,jdatadst.obj,jcinit.obj, - + jcmaster.obj,jcmarker.obj,jcmainct.obj,jcprepct.obj,jccoefct.obj, - + jccolor.obj,jcsample.obj,jchuff.obj,jcdctmgr.obj,jfdctfst.obj, - + jfdctflt.obj,jfdctint.obj,jdapimin.obj,jdapistd.obj,jdarith.obj, - + jdtrans.obj,jdatasrc.obj,jdmaster.obj,jdinput.obj,jdmarker.obj, - + jdhuff.obj,jdmainct.obj,jdcoefct.obj,jdpostct.obj,jddctmgr.obj, - + jidctfst.obj,jidctflt.obj,jidctint.obj,jdsample.obj,jdcolor.obj, - + jquant1.obj,jquant2.obj,jdmerge.obj,jcomapi.obj,jutils.obj, - + jerror.obj,jmemmgr.obj,jmemnobs.obj +$! +$ DoCompile cjpeg.c +$ DoCompile rdppm.c +$ DoCompile rdgif.c +$ DoCompile rdtarga.c +$ DoCompile rdrle.c +$ DoCompile rdbmp.c +$ DoCompile rdswitch.c +$ DoCompile cdjpeg.c +$! +$ Link /NoMap /Executable = cjpeg.exe cjpeg.obj,rdppm.obj,rdgif.obj, - + rdtarga.obj,rdrle.obj,rdbmp.obj,rdswitch.obj,cdjpeg.obj,libjpeg.olb/Library'OPT' +$! +$ DoCompile djpeg.c +$ DoCompile wrppm.c +$ DoCompile wrgif.c +$ DoCompile wrtarga.c +$ DoCompile wrrle.c +$ DoCompile wrbmp.c +$ DoCompile rdcolmap.c +$ DoCompile cdjpeg.c +$! +$ Link /NoMap /Executable = djpeg.exe djpeg.obj,wrppm.obj,wrgif.obj, - + wrtarga.obj,wrrle.obj,wrbmp.obj,rdcolmap.obj,cdjpeg.obj,libjpeg.olb/Library'OPT' +$! +$ DoCompile jpegtran.c +$ DoCompile rdswitch.c +$ DoCompile cdjpeg.c +$ DoCompile transupp.c +$! +$ Link /NoMap /Executable = jpegtran.exe jpegtran.obj,rdswitch.obj, - + cdjpeg.obj,transupp.obj,libjpeg.olb/Library'OPT' +$! +$ DoCompile rdjpgcom.c +$ Link /NoMap /Executable = rdjpgcom.exe rdjpgcom.obj'OPT' +$! +$ DoCompile wrjpgcom.c +$ Link /NoMap /Executable = wrjpgcom.exe wrjpgcom.obj'OPT' +$! +$! Run the self-test +$! +$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg +$ mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg +$ mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm +$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg +$ mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm +$ mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg +$ Backup /Compare/Log testimg.ppm testout.ppm +$ Backup /Compare/Log testimg.bmp testout.bmp +$ Backup /Compare/Log testimg.jpg testout.jpg +$ Backup /Compare/Log testimg.ppm testoutp.ppm +$ Backup /Compare/Log testimgp.jpg testoutp.jpg +$ Backup /Compare/Log testorig.jpg testoutt.jpg +$! +$End: +$ If Verify Then Set Verify +$ Exit diff --git a/thirdparty/LibJPEG/jpeg-9/makefile.wat b/thirdparty/LibJPEG/jpeg-9/makefile.wat new file mode 100644 index 0000000..9cb8d61 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makefile.wat @@ -0,0 +1,240 @@ +# Makefile for Independent JPEG Group's software + +# This makefile is suitable for Watcom C/C++ 10.0 on MS-DOS (using +# dos4g extender), OS/2, and Windows NT console mode. +# Thanks to Janos Haide, jhaide@btrvtech.com. + +# Read installation instructions before saying "wmake" !! + +# Uncomment line for desired system +SYSTEM=DOS +#SYSTEM=OS2 +#SYSTEM=NT + +# The name of your C compiler: +CC= wcl386 + +# You may need to adjust these cc options: +CFLAGS= -4r -ort -wx -zq -bt=$(SYSTEM) +# Caution: avoid -ol or -ox; these generate bad code with 10.0 or 10.0a. +# Generally, we recommend defining any configuration symbols in jconfig.h, +# NOT via -D switches here. + +# Link-time cc options: +!ifeq SYSTEM DOS +LDFLAGS= -zq -l=dos4g +!else ifeq SYSTEM OS2 +LDFLAGS= -zq -l=os2v2 +!else ifeq SYSTEM NT +LDFLAGS= -zq -l=nt +!endif + +# Put here the object file name for the correct system-dependent memory +# manager file. jmemnobs should work fine for dos4g or OS/2 environment. +SYSDEPMEM= jmemnobs.obj + +# End of configurable options. + + +# source files: JPEG library proper +LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c & + jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c & + jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c & + jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c & + jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c & + jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c & + jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c & + jquant2.c jutils.c jmemmgr.c +# memmgr back ends: compile only one of these into a working library +SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c +# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom +APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c & + rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c & + rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c +SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) +# files included by source files +INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h & + jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h +# documentation, test, and support files +DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 & + wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt & + coderules.txt filelist.txt change.log +MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc & + makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 & + makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 & + makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 & + maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 & + makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 & + makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 & + makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 & + makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st & + makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas & + makefile.mms makefile.vms makvms.opt +CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat & + jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas & + jconfig.vms +CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp & + missing ar-lib +OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map +TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg & + testimgp.jpg +DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) & + $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) +# library object files common to compression and decompression +COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM) +# compression library object files +CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj & + jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj & + jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj & + jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj +# decompression library object files +DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj & + jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj & + jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj & + jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj & + jdmerge.obj +# These objectfiles are included in libjpeg.lib +LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) +# object files for sample applications (excluding library files) +COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj & + rdswitch.obj cdjpeg.obj +DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj & + rdcolmap.obj cdjpeg.obj +TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj + + +all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe + +libjpeg.lib: $(LIBOBJECTS) + - del libjpeg.lib + * wlib -n libjpeg.lib $(LIBOBJECTS) + +cjpeg.exe: $(COBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) $(COBJECTS) libjpeg.lib + +djpeg.exe: $(DOBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) $(DOBJECTS) libjpeg.lib + +jpegtran.exe: $(TROBJECTS) libjpeg.lib + $(CC) $(LDFLAGS) $(TROBJECTS) libjpeg.lib + +rdjpgcom.exe: rdjpgcom.c + $(CC) $(CFLAGS) $(LDFLAGS) rdjpgcom.c + +wrjpgcom.exe: wrjpgcom.c + $(CC) $(CFLAGS) $(LDFLAGS) wrjpgcom.c + +.c.obj: + $(CC) $(CFLAGS) -c $< + +jconfig.h: jconfig.txt + echo You must prepare a system-dependent jconfig.h file. + echo Please read the installation directions in install.txt. + exit 1 + +clean: .SYMBOLIC + - del *.obj + - del libjpeg.lib + - del cjpeg.exe + - del djpeg.exe + - del jpegtran.exe + - del rdjpgcom.exe + - del wrjpgcom.exe + - del testout*.* + +test: cjpeg.exe djpeg.exe jpegtran.exe .SYMBOLIC + - del testout*.* + djpeg -dct int -ppm -outfile testout.ppm testorig.jpg + djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg + cjpeg -dct int -outfile testout.jpg testimg.ppm + djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg + cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm + jpegtran -outfile testoutt.jpg testprog.jpg +!ifeq SYSTEM DOS + fc /b testimg.ppm testout.ppm + fc /b testimg.bmp testout.bmp + fc /b testimg.jpg testout.jpg + fc /b testimg.ppm testoutp.ppm + fc /b testimgp.jpg testoutp.jpg + fc /b testorig.jpg testoutt.jpg +!else + echo n > n.tmp + comp testimg.ppm testout.ppm < n.tmp + comp testimg.bmp testout.bmp < n.tmp + comp testimg.jpg testout.jpg < n.tmp + comp testimg.ppm testoutp.ppm < n.tmp + comp testimgp.jpg testoutp.jpg < n.tmp + comp testorig.jpg testoutt.jpg < n.tmp + del n.tmp +!endif + + +jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h +jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h +jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h +jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h +jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h +cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h +jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h +rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h +wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h +cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h +rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h +wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h diff --git a/thirdparty/LibJPEG/jpeg-9/makejdep.vc6 b/thirdparty/LibJPEG/jpeg-9/makejdep.vc6 new file mode 100644 index 0000000..1065b21 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejdep.vc6 @@ -0,0 +1,423 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von jpeg.mak + +.\jaricom.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcapimin.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcapistd.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcarith.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jccoefct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jccolor.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcdctmgr.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jchuff.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcinit.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcmainct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcmarker.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcmaster.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcomapi.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcparam.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcprepct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jcsample.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jctrans.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdapimin.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdapistd.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdarith.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdatadst.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\jdatasrc.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\jdcoefct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdcolor.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jddctmgr.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdhuff.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdinput.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdmainct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdmarker.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdmaster.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdmerge.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdpostct.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdsample.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jdtrans.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jerror.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + ".\jversion.h"\ + + +.\jfdctflt.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jfdctfst.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jfdctint.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jidctflt.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jidctfst.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jidctint.c : \ + ".\jconfig.h"\ + ".\jdct.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jmemmgr.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmemsys.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jmemnobs.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmemsys.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jquant1.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jquant2.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + + +.\jutils.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/makejdsp.vc6 b/thirdparty/LibJPEG/jpeg-9/makejdsp.vc6 new file mode 100644 index 0000000..738f1ab --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejdsp.vc6 @@ -0,0 +1,285 @@ +# Microsoft Developer Studio Project File - Name="jpeg" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=jpeg - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "jpeg.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "jpeg.mak" CFG="jpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "jpeg - Win32" (basierend auf "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE RSC /l 0x407 +# ADD RSC /l 0x407 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo +# Begin Target + +# Name "jpeg - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\jaricom.c +# End Source File +# Begin Source File + +SOURCE=.\jcapimin.c +# End Source File +# Begin Source File + +SOURCE=.\jcapistd.c +# End Source File +# Begin Source File + +SOURCE=.\jcarith.c +# End Source File +# Begin Source File + +SOURCE=.\jccoefct.c +# End Source File +# Begin Source File + +SOURCE=.\jccolor.c +# End Source File +# Begin Source File + +SOURCE=.\jcdctmgr.c +# End Source File +# Begin Source File + +SOURCE=.\jchuff.c +# End Source File +# Begin Source File + +SOURCE=.\jcinit.c +# End Source File +# Begin Source File + +SOURCE=.\jcmainct.c +# End Source File +# Begin Source File + +SOURCE=.\jcmarker.c +# End Source File +# Begin Source File + +SOURCE=.\jcmaster.c +# End Source File +# Begin Source File + +SOURCE=.\jcomapi.c +# End Source File +# Begin Source File + +SOURCE=.\jcparam.c +# End Source File +# Begin Source File + +SOURCE=.\jcprepct.c +# End Source File +# Begin Source File + +SOURCE=.\jcsample.c +# End Source File +# Begin Source File + +SOURCE=.\jctrans.c +# End Source File +# Begin Source File + +SOURCE=.\jdapimin.c +# End Source File +# Begin Source File + +SOURCE=.\jdapistd.c +# End Source File +# Begin Source File + +SOURCE=.\jdarith.c +# End Source File +# Begin Source File + +SOURCE=.\jdatadst.c +# End Source File +# Begin Source File + +SOURCE=.\jdatasrc.c +# End Source File +# Begin Source File + +SOURCE=.\jdcoefct.c +# End Source File +# Begin Source File + +SOURCE=.\jdcolor.c +# End Source File +# Begin Source File + +SOURCE=.\jddctmgr.c +# End Source File +# Begin Source File + +SOURCE=.\jdhuff.c +# End Source File +# Begin Source File + +SOURCE=.\jdinput.c +# End Source File +# Begin Source File + +SOURCE=.\jdmainct.c +# End Source File +# Begin Source File + +SOURCE=.\jdmarker.c +# End Source File +# Begin Source File + +SOURCE=.\jdmaster.c +# End Source File +# Begin Source File + +SOURCE=.\jdmerge.c +# End Source File +# Begin Source File + +SOURCE=.\jdpostct.c +# End Source File +# Begin Source File + +SOURCE=.\jdsample.c +# End Source File +# Begin Source File + +SOURCE=.\jdtrans.c +# End Source File +# Begin Source File + +SOURCE=.\jerror.c +# End Source File +# Begin Source File + +SOURCE=.\jfdctflt.c +# End Source File +# Begin Source File + +SOURCE=.\jfdctfst.c +# End Source File +# Begin Source File + +SOURCE=.\jfdctint.c +# End Source File +# Begin Source File + +SOURCE=.\jidctflt.c +# End Source File +# Begin Source File + +SOURCE=.\jidctfst.c +# End Source File +# Begin Source File + +SOURCE=.\jidctint.c +# End Source File +# Begin Source File + +SOURCE=.\jmemmgr.c +# End Source File +# Begin Source File + +SOURCE=.\jmemnobs.c +# End Source File +# Begin Source File + +SOURCE=.\jquant1.c +# End Source File +# Begin Source File + +SOURCE=.\jquant2.c +# End Source File +# Begin Source File + +SOURCE=.\jutils.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jdct.h +# End Source File +# Begin Source File + +SOURCE=.\jerror.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# Begin Source File + +SOURCE=.\jmemsys.h +# End Source File +# Begin Source File + +SOURCE=.\jmorecfg.h +# End Source File +# Begin Source File + +SOURCE=.\jpegint.h +# End Source File +# Begin Source File + +SOURCE=.\jpeglib.h +# End Source File +# Begin Source File + +SOURCE=.\jversion.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/makejdsw.vc6 b/thirdparty/LibJPEG/jpeg-9/makejdsw.vc6 new file mode 100644 index 0000000..d11fab1 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejdsw.vc6 @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GEL�SCHT WERDEN! + +############################################################################### + +Project: "jpeg"=".\jpeg.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/thirdparty/LibJPEG/jpeg-9/makejfil.v10 b/thirdparty/LibJPEG/jpeg-9/makejfil.v10 new file mode 100644 index 0000000..654bfc0 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejfil.v10 @@ -0,0 +1,186 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makejmak.vc6 b/thirdparty/LibJPEG/jpeg-9/makejmak.vc6 new file mode 100644 index 0000000..1107336 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejmak.vc6 @@ -0,0 +1,425 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on jpeg.dsp +!IF "$(CFG)" == "" +CFG=jpeg - Win32 +!MESSAGE Keine Konfiguration angegeben. jpeg - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "jpeg - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "jpeg.mak" CFG="jpeg - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "jpeg - Win32" (basierend auf "Win32 (x86) Static Library") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\jpeg.lib" + + +CLEAN : + -@erase "$(INTDIR)\jaricom.obj" + -@erase "$(INTDIR)\jcapimin.obj" + -@erase "$(INTDIR)\jcapistd.obj" + -@erase "$(INTDIR)\jcarith.obj" + -@erase "$(INTDIR)\jccoefct.obj" + -@erase "$(INTDIR)\jccolor.obj" + -@erase "$(INTDIR)\jcdctmgr.obj" + -@erase "$(INTDIR)\jchuff.obj" + -@erase "$(INTDIR)\jcinit.obj" + -@erase "$(INTDIR)\jcmainct.obj" + -@erase "$(INTDIR)\jcmarker.obj" + -@erase "$(INTDIR)\jcmaster.obj" + -@erase "$(INTDIR)\jcomapi.obj" + -@erase "$(INTDIR)\jcparam.obj" + -@erase "$(INTDIR)\jcprepct.obj" + -@erase "$(INTDIR)\jcsample.obj" + -@erase "$(INTDIR)\jctrans.obj" + -@erase "$(INTDIR)\jdapimin.obj" + -@erase "$(INTDIR)\jdapistd.obj" + -@erase "$(INTDIR)\jdarith.obj" + -@erase "$(INTDIR)\jdatadst.obj" + -@erase "$(INTDIR)\jdatasrc.obj" + -@erase "$(INTDIR)\jdcoefct.obj" + -@erase "$(INTDIR)\jdcolor.obj" + -@erase "$(INTDIR)\jddctmgr.obj" + -@erase "$(INTDIR)\jdhuff.obj" + -@erase "$(INTDIR)\jdinput.obj" + -@erase "$(INTDIR)\jdmainct.obj" + -@erase "$(INTDIR)\jdmarker.obj" + -@erase "$(INTDIR)\jdmaster.obj" + -@erase "$(INTDIR)\jdmerge.obj" + -@erase "$(INTDIR)\jdpostct.obj" + -@erase "$(INTDIR)\jdsample.obj" + -@erase "$(INTDIR)\jdtrans.obj" + -@erase "$(INTDIR)\jerror.obj" + -@erase "$(INTDIR)\jfdctflt.obj" + -@erase "$(INTDIR)\jfdctfst.obj" + -@erase "$(INTDIR)\jfdctint.obj" + -@erase "$(INTDIR)\jidctflt.obj" + -@erase "$(INTDIR)\jidctfst.obj" + -@erase "$(INTDIR)\jidctint.obj" + -@erase "$(INTDIR)\jmemmgr.obj" + -@erase "$(INTDIR)\jmemnobs.obj" + -@erase "$(INTDIR)\jquant1.obj" + -@erase "$(INTDIR)\jquant2.obj" + -@erase "$(INTDIR)\jutils.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\jpeg.lib" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\jpeg.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\jpeg.bsc" +BSC32_SBRS= \ + +LIB32=link.exe -lib +LIB32_FLAGS=/nologo /out:"$(OUTDIR)\jpeg.lib" +LIB32_OBJS= \ + "$(INTDIR)\jaricom.obj" \ + "$(INTDIR)\jcapimin.obj" \ + "$(INTDIR)\jcapistd.obj" \ + "$(INTDIR)\jcarith.obj" \ + "$(INTDIR)\jccoefct.obj" \ + "$(INTDIR)\jccolor.obj" \ + "$(INTDIR)\jcdctmgr.obj" \ + "$(INTDIR)\jchuff.obj" \ + "$(INTDIR)\jcinit.obj" \ + "$(INTDIR)\jcmainct.obj" \ + "$(INTDIR)\jcmarker.obj" \ + "$(INTDIR)\jcmaster.obj" \ + "$(INTDIR)\jcomapi.obj" \ + "$(INTDIR)\jcparam.obj" \ + "$(INTDIR)\jcprepct.obj" \ + "$(INTDIR)\jcsample.obj" \ + "$(INTDIR)\jctrans.obj" \ + "$(INTDIR)\jdapimin.obj" \ + "$(INTDIR)\jdapistd.obj" \ + "$(INTDIR)\jdarith.obj" \ + "$(INTDIR)\jdatadst.obj" \ + "$(INTDIR)\jdatasrc.obj" \ + "$(INTDIR)\jdcoefct.obj" \ + "$(INTDIR)\jdcolor.obj" \ + "$(INTDIR)\jddctmgr.obj" \ + "$(INTDIR)\jdhuff.obj" \ + "$(INTDIR)\jdinput.obj" \ + "$(INTDIR)\jdmainct.obj" \ + "$(INTDIR)\jdmarker.obj" \ + "$(INTDIR)\jdmaster.obj" \ + "$(INTDIR)\jdmerge.obj" \ + "$(INTDIR)\jdpostct.obj" \ + "$(INTDIR)\jdsample.obj" \ + "$(INTDIR)\jdtrans.obj" \ + "$(INTDIR)\jerror.obj" \ + "$(INTDIR)\jfdctflt.obj" \ + "$(INTDIR)\jfdctfst.obj" \ + "$(INTDIR)\jfdctint.obj" \ + "$(INTDIR)\jidctflt.obj" \ + "$(INTDIR)\jidctfst.obj" \ + "$(INTDIR)\jidctint.obj" \ + "$(INTDIR)\jmemmgr.obj" \ + "$(INTDIR)\jmemnobs.obj" \ + "$(INTDIR)\jquant1.obj" \ + "$(INTDIR)\jquant2.obj" \ + "$(INTDIR)\jutils.obj" + +"$(OUTDIR)\jpeg.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) + $(LIB32) @<< + $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("jpeg.dep") +!INCLUDE "jpeg.dep" +!ELSE +!MESSAGE Warning: cannot find "jpeg.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "jpeg - Win32" +SOURCE=.\jaricom.c + +"$(INTDIR)\jaricom.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcapimin.c + +"$(INTDIR)\jcapimin.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcapistd.c + +"$(INTDIR)\jcapistd.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcarith.c + +"$(INTDIR)\jcarith.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jccoefct.c + +"$(INTDIR)\jccoefct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jccolor.c + +"$(INTDIR)\jccolor.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcdctmgr.c + +"$(INTDIR)\jcdctmgr.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jchuff.c + +"$(INTDIR)\jchuff.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcinit.c + +"$(INTDIR)\jcinit.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcmainct.c + +"$(INTDIR)\jcmainct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcmarker.c + +"$(INTDIR)\jcmarker.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcmaster.c + +"$(INTDIR)\jcmaster.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcomapi.c + +"$(INTDIR)\jcomapi.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcparam.c + +"$(INTDIR)\jcparam.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcprepct.c + +"$(INTDIR)\jcprepct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jcsample.c + +"$(INTDIR)\jcsample.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jctrans.c + +"$(INTDIR)\jctrans.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdapimin.c + +"$(INTDIR)\jdapimin.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdapistd.c + +"$(INTDIR)\jdapistd.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdarith.c + +"$(INTDIR)\jdarith.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdatadst.c + +"$(INTDIR)\jdatadst.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdatasrc.c + +"$(INTDIR)\jdatasrc.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdcoefct.c + +"$(INTDIR)\jdcoefct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdcolor.c + +"$(INTDIR)\jdcolor.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jddctmgr.c + +"$(INTDIR)\jddctmgr.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdhuff.c + +"$(INTDIR)\jdhuff.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdinput.c + +"$(INTDIR)\jdinput.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdmainct.c + +"$(INTDIR)\jdmainct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdmarker.c + +"$(INTDIR)\jdmarker.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdmaster.c + +"$(INTDIR)\jdmaster.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdmerge.c + +"$(INTDIR)\jdmerge.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdpostct.c + +"$(INTDIR)\jdpostct.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdsample.c + +"$(INTDIR)\jdsample.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jdtrans.c + +"$(INTDIR)\jdtrans.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jerror.c + +"$(INTDIR)\jerror.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jfdctflt.c + +"$(INTDIR)\jfdctflt.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jfdctfst.c + +"$(INTDIR)\jfdctfst.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jfdctint.c + +"$(INTDIR)\jfdctint.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jidctflt.c + +"$(INTDIR)\jidctflt.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jidctfst.c + +"$(INTDIR)\jidctfst.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jidctint.c + +"$(INTDIR)\jidctint.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jmemmgr.c + +"$(INTDIR)\jmemmgr.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jmemnobs.c + +"$(INTDIR)\jmemnobs.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jquant1.c + +"$(INTDIR)\jquant1.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jquant2.c + +"$(INTDIR)\jquant2.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jutils.c + +"$(INTDIR)\jutils.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/makejsln.v10 b/thirdparty/LibJPEG/jpeg-9/makejsln.v10 new file mode 100644 index 0000000..6a5befd --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejsln.v10 @@ -0,0 +1,17 @@ +��� +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32 + {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/LibJPEG/jpeg-9/makejvcx.v10 b/thirdparty/LibJPEG/jpeg-9/makejvcx.v10 new file mode 100644 index 0000000..ccee287 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makejvcx.v10 @@ -0,0 +1,112 @@ +��� + + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Disabled + false + + + + + {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} + Win32Proj + jpeg + + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS + true + true + + + Windows + true + true + true + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makeproj.mac b/thirdparty/LibJPEG/jpeg-9/makeproj.mac new file mode 100644 index 0000000..e5b5102 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makeproj.mac @@ -0,0 +1,213 @@ +-- +-- makeproj.mac +-- +-- This AppleScript builds Code Warrior PRO Release 2 project files for the +-- libjpeg library as well as the test programs 'cjpeg', 'djpeg', 'jpegtran'. +-- (We'd distribute real project files, except they're not text +-- and would create maintenance headaches.) +-- +-- The script then compiles and links the library and the test programs. +-- NOTE: if you haven't already created a 'jconfig.h' file, the script +-- automatically copies 'jconfig.mac' to 'jconfig.h'. +-- +-- To use this script, you must have AppleScript 1.1 or later installed +-- and a suitable AppleScript editor like Script Editor or Script Debugger +-- (http://www.latenightsw.com). Open this file with your AppleScript +-- editor and execute the "run" command to build the projects. +-- +-- Thanks to Dan Sears and Don Agro for this script. +-- Questions about this script can be addressed to dogpark@interlog.com +-- + +on run + + choose folder with prompt ">>> Select IJG source folder <<<" + set ijg_folder to result + + choose folder with prompt ">>> Select MetroWerks folder <<<" + set cw_folder to result + + -- if jconfig.h doesn't already exist, copy jconfig.mac + + tell application "Finder" + if not (exists file "jconfig.h" of ijg_folder) then + duplicate {file "jconfig.mac" of folder ijg_folder} + select file "jconfig.mac copy" of folder ijg_folder + set name of selection to "jconfig.h" + end if + end tell + + tell application "CodeWarrior IDE 2.1" + with timeout of 10000 seconds + + -- create libjpeg project + + activate + Create Project (ijg_folder as string) & "libjpeg.proj" + Set Preferences of panel "Target Settings" to {Target Name:"libjpeg"} + Set Preferences of panel "PPC Project" to {File Name:"libjpeg"} + Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"} + Set Preferences of panel "PPC Project" to {Project Type:library} + Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true} + Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true} + Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC} + Set Preferences of panel "PPC Linker" to {Generate SYM File:false} + + Add Files (ijg_folder as string) & "jaricom.c" To Segment 1 + Add Files (ijg_folder as string) & "jcapimin.c" To Segment 1 + Add Files (ijg_folder as string) & "jcapistd.c" To Segment 1 + Add Files (ijg_folder as string) & "jcarith.c" To Segment 1 + Add Files (ijg_folder as string) & "jctrans.c" To Segment 1 + Add Files (ijg_folder as string) & "jcparam.c" To Segment 1 + Add Files (ijg_folder as string) & "jdatadst.c" To Segment 1 + Add Files (ijg_folder as string) & "jcinit.c" To Segment 1 + Add Files (ijg_folder as string) & "jcmaster.c" To Segment 1 + Add Files (ijg_folder as string) & "jcmarker.c" To Segment 1 + Add Files (ijg_folder as string) & "jcmainct.c" To Segment 1 + Add Files (ijg_folder as string) & "jcprepct.c" To Segment 1 + Add Files (ijg_folder as string) & "jccoefct.c" To Segment 1 + Add Files (ijg_folder as string) & "jccolor.c" To Segment 1 + Add Files (ijg_folder as string) & "jcsample.c" To Segment 1 + Add Files (ijg_folder as string) & "jchuff.c" To Segment 1 + Add Files (ijg_folder as string) & "jcdctmgr.c" To Segment 1 + Add Files (ijg_folder as string) & "jfdctfst.c" To Segment 1 + Add Files (ijg_folder as string) & "jfdctflt.c" To Segment 1 + Add Files (ijg_folder as string) & "jfdctint.c" To Segment 1 + Add Files (ijg_folder as string) & "jdapimin.c" To Segment 1 + Add Files (ijg_folder as string) & "jdapistd.c" To Segment 1 + Add Files (ijg_folder as string) & "jdarith.c" To Segment 1 + Add Files (ijg_folder as string) & "jdtrans.c" To Segment 1 + Add Files (ijg_folder as string) & "jdatasrc.c" To Segment 1 + Add Files (ijg_folder as string) & "jdmaster.c" To Segment 1 + Add Files (ijg_folder as string) & "jdinput.c" To Segment 1 + Add Files (ijg_folder as string) & "jdmarker.c" To Segment 1 + Add Files (ijg_folder as string) & "jdhuff.c" To Segment 1 + Add Files (ijg_folder as string) & "jdmainct.c" To Segment 1 + Add Files (ijg_folder as string) & "jdcoefct.c" To Segment 1 + Add Files (ijg_folder as string) & "jdpostct.c" To Segment 1 + Add Files (ijg_folder as string) & "jddctmgr.c" To Segment 1 + Add Files (ijg_folder as string) & "jidctfst.c" To Segment 1 + Add Files (ijg_folder as string) & "jidctflt.c" To Segment 1 + Add Files (ijg_folder as string) & "jidctint.c" To Segment 1 + Add Files (ijg_folder as string) & "jdsample.c" To Segment 1 + Add Files (ijg_folder as string) & "jdcolor.c" To Segment 1 + Add Files (ijg_folder as string) & "jquant1.c" To Segment 1 + Add Files (ijg_folder as string) & "jquant2.c" To Segment 1 + Add Files (ijg_folder as string) & "jdmerge.c" To Segment 1 + Add Files (ijg_folder as string) & "jcomapi.c" To Segment 1 + Add Files (ijg_folder as string) & "jutils.c" To Segment 1 + Add Files (ijg_folder as string) & "jerror.c" To Segment 1 + Add Files (ijg_folder as string) & "jmemmgr.c" To Segment 1 + Add Files (ijg_folder as string) & "jmemmac.c" To Segment 1 + + -- compile and link the library + + Make Project + Close Project + + -- create cjpeg project + + activate + Create Project (ijg_folder as string) & "cjpeg.proj" + Set Preferences of panel "Target Settings" to {Target Name:"cjpeg"} + Set Preferences of panel "PPC Project" to {File Name:"cjpeg"} + Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"} + Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true} + Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true} + Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC} + Set Preferences of panel "PPC Linker" to {Generate SYM File:false} + + Add Files (ijg_folder as string) & "cjpeg.c" To Segment 1 + Add Files (ijg_folder as string) & "rdppm.c" To Segment 1 + Add Files (ijg_folder as string) & "rdgif.c" To Segment 1 + Add Files (ijg_folder as string) & "rdtarga.c" To Segment 1 + Add Files (ijg_folder as string) & "rdrle.c" To Segment 1 + Add Files (ijg_folder as string) & "rdbmp.c" To Segment 1 + Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1 + Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1 + + Add Files (ijg_folder as string) & "libjpeg" To Segment 2 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4 + + -- compile and link cjpeg + + Make Project + Close Project + + -- create djpeg project + + activate + Create Project (ijg_folder as string) & "djpeg.proj" + Set Preferences of panel "Target Settings" to {Target Name:"djpeg"} + Set Preferences of panel "PPC Project" to {File Name:"djpeg"} + Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"} + Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true} + Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true} + Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC} + Set Preferences of panel "PPC Linker" to {Generate SYM File:false} + + Add Files (ijg_folder as string) & "djpeg.c" To Segment 1 + Add Files (ijg_folder as string) & "wrppm.c" To Segment 1 + Add Files (ijg_folder as string) & "wrgif.c" To Segment 1 + Add Files (ijg_folder as string) & "wrtarga.c" To Segment 1 + Add Files (ijg_folder as string) & "wrrle.c" To Segment 1 + Add Files (ijg_folder as string) & "wrbmp.c" To Segment 1 + Add Files (ijg_folder as string) & "rdcolmap.c" To Segment 1 + Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1 + + Add Files (ijg_folder as string) & "libjpeg" To Segment 2 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4 + + -- compile and link djpeg + + Make Project + Close Project + + -- create jpegtran project + + activate + Create Project (ijg_folder as string) & "jpegtran.proj" + Set Preferences of panel "Target Settings" to {Target Name:"jpegtran"} + Set Preferences of panel "PPC Project" to {File Name:"jpegtran"} + Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"} + Set Preferences of panel "C/C++ Compiler" to {ANSI Strict:true} + Set Preferences of panel "C/C++ Compiler" to {Enums Always Ints:true} + Set Preferences of panel "PPC Codegen" to {Struct Alignment:PowerPC} + Set Preferences of panel "PPC Linker" to {Generate SYM File:false} + + Add Files (ijg_folder as string) & "jpegtran.c" To Segment 1 + Add Files (ijg_folder as string) & "rdswitch.c" To Segment 1 + Add Files (ijg_folder as string) & "cdjpeg.c" To Segment 1 + Add Files (ijg_folder as string) & "transupp.c" To Segment 1 + + Add Files (ijg_folder as string) & "libjpeg" To Segment 2 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL C.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:Bin:MSL SIOUX.PPC.Lib" To Segment 3 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.Lib" To Segment 3 + + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:InterfaceLib" To Segment 4 + Add Files (cw_folder as string) & "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:MathLib" To Segment 4 + + -- compile and link jpegtran + + Make Project + Close Project + + quit + + end timeout + end tell +end run diff --git a/thirdparty/LibJPEG/jpeg-9/makerdep.vc6 b/thirdparty/LibJPEG/jpeg-9/makerdep.vc6 new file mode 100644 index 0000000..94748d0 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makerdep.vc6 @@ -0,0 +1,6 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von rdjpgcom.mak + +.\rdjpgcom.c : \ + ".\jconfig.h"\ + ".\jinclude.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/makerdsp.vc6 b/thirdparty/LibJPEG/jpeg-9/makerdsp.vc6 new file mode 100644 index 0000000..60de09a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makerdsp.vc6 @@ -0,0 +1,78 @@ +# Microsoft Developer Studio Project File - Name="rdjpgcom" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=rdjpgcom - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "rdjpgcom.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "rdjpgcom.mak" CFG="rdjpgcom - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "rdjpgcom - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\rdjpgcom\Release" +# PROP BASE Intermediate_Dir ".\rdjpgcom\Release" +# PROP BASE Target_Dir ".\rdjpgcom" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\rdjpgcom\Release" +# PROP Intermediate_Dir ".\rdjpgcom\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir ".\rdjpgcom" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Target + +# Name "rdjpgcom - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\rdjpgcom.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/makerfil.v10 b/thirdparty/LibJPEG/jpeg-9/makerfil.v10 new file mode 100644 index 0000000..d14914a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makerfil.v10 @@ -0,0 +1,30 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makermak.vc6 b/thirdparty/LibJPEG/jpeg-9/makermak.vc6 new file mode 100644 index 0000000..6d2d4c7 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makermak.vc6 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on rdjpgcom.dsp +!IF "$(CFG)" == "" +CFG=rdjpgcom - Win32 +!MESSAGE Keine Konfiguration angegeben. rdjpgcom - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "rdjpgcom - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "rdjpgcom.mak" CFG="rdjpgcom - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "rdjpgcom - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +OUTDIR=.\rdjpgcom\Release +INTDIR=.\rdjpgcom\Release +# Begin Custom Macros +OutDir=.\rdjpgcom\Release +# End Custom Macros + +ALL : "$(OUTDIR)\rdjpgcom.exe" + + +CLEAN : + -@erase "$(INTDIR)\rdjpgcom.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\rdjpgcom.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\rdjpgcom.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\rdjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)\rdjpgcom.exe" +LINK32_OBJS= \ + "$(INTDIR)\rdjpgcom.obj" + +"$(OUTDIR)\rdjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\rdjpgcom.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("rdjpgcom.dep") +!INCLUDE "rdjpgcom.dep" +!ELSE +!MESSAGE Warning: cannot find "rdjpgcom.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "rdjpgcom - Win32" +SOURCE=.\rdjpgcom.c + +"$(INTDIR)\rdjpgcom.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/makervcx.v10 b/thirdparty/LibJPEG/jpeg-9/makervcx.v10 new file mode 100644 index 0000000..366d4fc --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makervcx.v10 @@ -0,0 +1,62 @@ +��� + + + + Release + Win32 + + + + {C81513DB-78DC-46BC-BC98-82E745203976} + Win32Proj + rdjpgcom + + + + Application + false + true + Unicode + + + + + + + + + + false + $(ProjectName)\$(Configuration)\ + $(ProjectName)\$(Configuration)\ + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + true + 4996 + + + Console + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/maketdep.vc6 b/thirdparty/LibJPEG/jpeg-9/maketdep.vc6 new file mode 100644 index 0000000..e177ecb --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maketdep.vc6 @@ -0,0 +1,43 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von jpegtran.mak + +.\cdjpeg.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\jpegtran.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + ".\jversion.h"\ + ".\transupp.h"\ + + +.\rdswitch.c : \ + ".\cderror.h"\ + ".\cdjpeg.h"\ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpeglib.h"\ + + +.\transupp.c : \ + ".\jconfig.h"\ + ".\jerror.h"\ + ".\jinclude.h"\ + ".\jmorecfg.h"\ + ".\jpegint.h"\ + ".\jpeglib.h"\ + ".\transupp.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/maketdsp.vc6 b/thirdparty/LibJPEG/jpeg-9/maketdsp.vc6 new file mode 100644 index 0000000..fe1ae9a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maketdsp.vc6 @@ -0,0 +1,122 @@ +# Microsoft Developer Studio Project File - Name="jpegtran" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=jpegtran - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "jpegtran.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "jpegtran.mak" CFG="jpegtran - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "jpegtran - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\jpegtran\Release" +# PROP BASE Intermediate_Dir ".\jpegtran\Release" +# PROP BASE Target_Dir ".\jpegtran" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\jpegtran\Release" +# PROP Intermediate_Dir ".\jpegtran\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir ".\jpegtran" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Target + +# Name "jpegtran - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\cdjpeg.c +# End Source File +# Begin Source File + +SOURCE=.\jpegtran.c +# End Source File +# Begin Source File + +SOURCE=.\rdswitch.c +# End Source File +# Begin Source File + +SOURCE=.\transupp.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\cderror.h +# End Source File +# Begin Source File + +SOURCE=.\cdjpeg.h +# End Source File +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jerror.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# Begin Source File + +SOURCE=.\jmorecfg.h +# End Source File +# Begin Source File + +SOURCE=.\jpegint.h +# End Source File +# Begin Source File + +SOURCE=.\jpeglib.h +# End Source File +# Begin Source File + +SOURCE=.\jversion.h +# End Source File +# Begin Source File + +SOURCE=.\transupp.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/maketfil.v10 b/thirdparty/LibJPEG/jpeg-9/maketfil.v10 new file mode 100644 index 0000000..fae0094 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maketfil.v10 @@ -0,0 +1,63 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/maketmak.vc6 b/thirdparty/LibJPEG/jpeg-9/maketmak.vc6 new file mode 100644 index 0000000..a0de38c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maketmak.vc6 @@ -0,0 +1,131 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on jpegtran.dsp +!IF "$(CFG)" == "" +CFG=jpegtran - Win32 +!MESSAGE Keine Konfiguration angegeben. jpegtran - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "jpegtran - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "jpegtran.mak" CFG="jpegtran - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "jpegtran - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +OUTDIR=.\jpegtran\Release +INTDIR=.\jpegtran\Release +# Begin Custom Macros +OutDir=.\jpegtran\Release +# End Custom Macros + +ALL : "$(OUTDIR)\jpegtran.exe" + + +CLEAN : + -@erase "$(INTDIR)\cdjpeg.obj" + -@erase "$(INTDIR)\jpegtran.obj" + -@erase "$(INTDIR)\rdswitch.obj" + -@erase "$(INTDIR)\transupp.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(OUTDIR)\jpegtran.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\jpegtran.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\jpegtran.pdb" /machine:I386 /out:"$(OUTDIR)\jpegtran.exe" +LINK32_OBJS= \ + "$(INTDIR)\cdjpeg.obj" \ + "$(INTDIR)\jpegtran.obj" \ + "$(INTDIR)\rdswitch.obj" \ + "$(INTDIR)\transupp.obj" + +"$(OUTDIR)\jpegtran.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\jpegtran.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("jpegtran.dep") +!INCLUDE "jpegtran.dep" +!ELSE +!MESSAGE Warning: cannot find "jpegtran.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "jpegtran - Win32" +SOURCE=.\cdjpeg.c + +"$(INTDIR)\cdjpeg.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\jpegtran.c + +"$(INTDIR)\jpegtran.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\rdswitch.c + +"$(INTDIR)\rdswitch.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\transupp.c + +"$(INTDIR)\transupp.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/maketvcx.v10 b/thirdparty/LibJPEG/jpeg-9/maketvcx.v10 new file mode 100644 index 0000000..e2b4ea3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maketvcx.v10 @@ -0,0 +1,74 @@ +��� + + + + Release + Win32 + + + + {025BAC50-51B5-4FFE-BC47-3F920BB4047E} + Win32Proj + jpegtran + + + + Application + false + true + Unicode + + + + + + + + + + false + $(ProjectName)\$(Configuration)\ + $(ProjectName)\$(Configuration)\ + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + true + 4996 + + + Console + true + true + true + Release\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makewdep.vc6 b/thirdparty/LibJPEG/jpeg-9/makewdep.vc6 new file mode 100644 index 0000000..15929bf --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makewdep.vc6 @@ -0,0 +1,6 @@ +# Microsoft Developer Studio erstellte Abh�ngigkeitsdatei, einbezogen von wrjpgcom.mak + +.\wrjpgcom.c : \ + ".\jconfig.h"\ + ".\jinclude.h"\ + diff --git a/thirdparty/LibJPEG/jpeg-9/makewdsp.vc6 b/thirdparty/LibJPEG/jpeg-9/makewdsp.vc6 new file mode 100644 index 0000000..2063b1a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makewdsp.vc6 @@ -0,0 +1,78 @@ +# Microsoft Developer Studio Project File - Name="wrjpgcom" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** NICHT BEARBEITEN ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=wrjpgcom - Win32 +!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE +!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl +!MESSAGE +!MESSAGE NMAKE /f "wrjpgcom.mak". +!MESSAGE +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "wrjpgcom.mak" CFG="wrjpgcom - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "wrjpgcom - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\wrjpgcom\Release" +# PROP BASE Intermediate_Dir ".\wrjpgcom\Release" +# PROP BASE Target_Dir ".\wrjpgcom" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\wrjpgcom\Release" +# PROP Intermediate_Dir ".\wrjpgcom\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir ".\wrjpgcom" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c +# ADD CPP /nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# Begin Target + +# Name "wrjpgcom - Win32" +# Begin Group "Quellcodedateien" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\wrjpgcom.c +# End Source File +# End Group +# Begin Group "Header-Dateien" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\jconfig.h +# End Source File +# Begin Source File + +SOURCE=.\jinclude.h +# End Source File +# End Group +# Begin Group "Ressourcendateien" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/LibJPEG/jpeg-9/makewfil.v10 b/thirdparty/LibJPEG/jpeg-9/makewfil.v10 new file mode 100644 index 0000000..72c5856 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makewfil.v10 @@ -0,0 +1,30 @@ +��� + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makewmak.vc6 b/thirdparty/LibJPEG/jpeg-9/makewmak.vc6 new file mode 100644 index 0000000..22b9086 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makewmak.vc6 @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on wrjpgcom.dsp +!IF "$(CFG)" == "" +CFG=wrjpgcom - Win32 +!MESSAGE Keine Konfiguration angegeben. wrjpgcom - Win32 wird als Standard verwendet. +!ENDIF + +!IF "$(CFG)" != "wrjpgcom - Win32" +!MESSAGE Ung�ltige Konfiguration "$(CFG)" angegeben. +!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben +!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: +!MESSAGE +!MESSAGE NMAKE /f "wrjpgcom.mak" CFG="wrjpgcom - Win32" +!MESSAGE +!MESSAGE F�r die Konfiguration stehen zur Auswahl: +!MESSAGE +!MESSAGE "wrjpgcom - Win32" (basierend auf "Win32 (x86) Console Application") +!MESSAGE +!ERROR Eine ung�ltige Konfiguration wurde angegeben. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +RSC=rc.exe +OUTDIR=.\wrjpgcom\Release +INTDIR=.\wrjpgcom\Release +# Begin Custom Macros +OutDir=.\wrjpgcom\Release +# End Custom Macros + +ALL : "$(OUTDIR)\wrjpgcom.exe" + + +CLEAN : + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\wrjpgcom.obj" + -@erase "$(OUTDIR)\wrjpgcom.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\wrjpgcom.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=Release\jpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\wrjpgcom.pdb" /machine:I386 /out:"$(OUTDIR)\wrjpgcom.exe" +LINK32_OBJS= \ + "$(INTDIR)\wrjpgcom.obj" + +"$(OUTDIR)\wrjpgcom.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +CPP_PROJ=/nologo /G6 /MT /W3 /GX /Ox /Oa /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /Fp"$(INTDIR)\wrjpgcom.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("wrjpgcom.dep") +!INCLUDE "wrjpgcom.dep" +!ELSE +!MESSAGE Warning: cannot find "wrjpgcom.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "wrjpgcom - Win32" +SOURCE=.\wrjpgcom.c + +"$(INTDIR)\wrjpgcom.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/thirdparty/LibJPEG/jpeg-9/makewvcx.v10 b/thirdparty/LibJPEG/jpeg-9/makewvcx.v10 new file mode 100644 index 0000000..e6c546a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makewvcx.v10 @@ -0,0 +1,62 @@ +��� + + + + Release + Win32 + + + + {B57065D4-DDDA-4668-BAF5-2D49270C973C} + Win32Proj + wrjpgcom + + + + Application + false + true + Unicode + + + + + + + + + + false + $(ProjectName)\$(Configuration)\ + $(ProjectName)\$(Configuration)\ + + + + Level3 + NotUsing + Full + true + false + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS + true + true + 4996 + + + Console + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/makljpeg.st b/thirdparty/LibJPEG/jpeg-9/makljpeg.st new file mode 100644 index 0000000..cc1ba01 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makljpeg.st @@ -0,0 +1,68 @@ +; Project file for Independent JPEG Group's software +; +; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. +; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. +; +; To use this file, rename it to libjpeg.prj. +; Read installation instructions before trying to make the program! +; +; +; * * * Output file * * * +libjpeg.lib +; +; * * * COMPILER OPTIONS * * * +.C[-P] ; absolute calls +.C[-M] ; and no string merging, folks +.C[-w-cln] ; no "constant is long" warnings +.C[-w-par] ; no "parameter xxxx unused" +.C[-w-rch] ; no "unreachable code" +.C[-wsig] ; warn if significant digits may be lost +.L[-J] ; link new Obj-format (so we get a library) += +; * * * * List of modules * * * * +jaricom.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jccoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jccolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcdctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jchuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcinit.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcomapi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcparam.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcprepct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jcsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jctrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdapimin.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdapistd.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdarith.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdatadst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h) +jdatasrc.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h) +jdcoefct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdcolor.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jddctmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jdhuff.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdinput.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdmainct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdmarker.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdmaster.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdmerge.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdpostct.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdsample.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jdtrans.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jerror.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jversion.h,jerror.h) +jfdctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jfdctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jfdctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jidctflt.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jidctfst.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jidctint.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jdct.h) +jquant1.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jquant2.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jutils.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h) +jmemmgr.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h) +jmemansi.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,jmemsys.h) diff --git a/thirdparty/LibJPEG/jpeg-9/maktjpeg.st b/thirdparty/LibJPEG/jpeg-9/maktjpeg.st new file mode 100644 index 0000000..43f078a --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/maktjpeg.st @@ -0,0 +1,30 @@ +; Project file for Independent JPEG Group's software +; +; This project file is for Atari ST/STE/TT systems using Pure C or Turbo C. +; Thanks to Frank Moehle, B. Setzepfandt, and Guido Vollbeding. +; +; To use this file, rename it to jpegtran.prj. +; If you are using Turbo C, change filenames beginning with "pc..." to "tc..." +; Read installation instructions before trying to make the program! +; +; +; * * * Output file * * * +jpegtran.ttp +; +; * * * COMPILER OPTIONS * * * +.C[-P] ; absolute calls +.C[-M] ; and no string merging, folks +.C[-w-cln] ; no "constant is long" warnings +.C[-w-par] ; no "parameter xxxx unused" +.C[-w-rch] ; no "unreachable code" +.C[-wsig] ; warn if significant digits may be lost += +; * * * * List of modules * * * * +pcstart.o +jpegtran.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h,transupp.h,jversion.h) +cdjpeg.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +rdswitch.c (cdjpeg.h,jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jerror.h,cderror.h) +transupp.c (jinclude.h,jconfig.h,jpeglib.h,jmorecfg.h,jpegint.h,jerror.h,transupp.h) +libjpeg.lib ; built by libjpeg.prj +pcstdlib.lib ; standard library +pcextlib.lib ; extended library diff --git a/thirdparty/LibJPEG/jpeg-9/makvms.opt b/thirdparty/LibJPEG/jpeg-9/makvms.opt new file mode 100644 index 0000000..675e8fe --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/makvms.opt @@ -0,0 +1,4 @@ +! A pointer to the VAX/VMS C Run-Time Shareable Library. +! This file is needed by makefile.mms and makefile.vms, +! but only for the older VAX C compiler. DEC C does not need it. +Sys$Library:VAXCRTL.EXE /Share diff --git a/thirdparty/LibJPEG/jpeg-9/missing b/thirdparty/LibJPEG/jpeg-9/missing new file mode 100644 index 0000000..cdea514 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2012-06-26.16; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# 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, see . + +# 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. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'automa4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.sln b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.sln new file mode 100644 index 0000000..7bd394c --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibJPEG", "LibJPEG.vcxproj", "{2BD91B84-8F0F-49F1-927A-514A3F2555F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Debug|Win32.Build.0 = Debug|Win32 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Debug|x64.ActiveCfg = Debug|x64 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Debug|x64.Build.0 = Debug|x64 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Release|Win32.ActiveCfg = Release|Win32 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Release|Win32.Build.0 = Release|Win32 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Release|x64.ActiveCfg = Release|x64 + {2BD91B84-8F0F-49F1-927A-514A3F2555F8}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj new file mode 100644 index 0000000..8f59ba2 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {2BD91B84-8F0F-49F1-927A-514A3F2555F8} + LibJPEG + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + + + true + + + + + Level3 + Disabled + + + true + + + + + Level3 + MaxSpeed + true + true + + + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + + + $(IntDir)vc$(PlatformToolsetVersion).pdb + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj.filters b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj.filters new file mode 100644 index 0000000..b96ece4 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/LibJPEG.vcxproj.filters @@ -0,0 +1,234 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/ipch/libjpeg-9e36a988/libjpeg-adbec841.ipch b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/ipch/libjpeg-9e36a988/libjpeg-adbec841.ipch new file mode 100644 index 0000000..9a7503b Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/prj/LibJPEG/ipch/libjpeg-9e36a988/libjpeg-adbec841.ipch differ diff --git a/thirdparty/LibJPEG/jpeg-9/rdbmp.c b/thirdparty/LibJPEG/jpeg-9/rdbmp.c new file mode 100644 index 0000000..fd773d4 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdbmp.c @@ -0,0 +1,480 @@ +/* + * rdbmp.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * Modified 2009-2010 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to read input images in Microsoft "BMP" + * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors). + * Currently, only 8-bit and 24-bit images are supported, not 1-bit or + * 4-bit (feeding such low-depth images into JPEG would be silly anyway). + * Also, we don't support RLE-compressed files. + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume input from + * an ordinary stdio stream. They further assume that reading begins + * at the start of the file; start_input may need work if the + * user interface has already read some data (e.g., to determine that + * the file is indeed BMP format). + * + * This code contributed by James Arthur Boucher. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef BMP_SUPPORTED + + +/* Macros to deal with unsigned chars as efficiently as compiler allows */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char U_CHAR; +#define UCH(x) ((int) (x)) +#else /* !HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char U_CHAR; +#define UCH(x) ((int) (x)) +#else +typedef char U_CHAR; +#define UCH(x) ((int) (x) & 0xFF) +#endif +#endif /* HAVE_UNSIGNED_CHAR */ + + +#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len))) + + +/* Private version of data source object */ + +typedef struct _bmp_source_struct * bmp_source_ptr; + +typedef struct _bmp_source_struct { + struct cjpeg_source_struct pub; /* public fields */ + + j_compress_ptr cinfo; /* back link saves passing separate parm */ + + JSAMPARRAY colormap; /* BMP colormap (converted to my format) */ + + jvirt_sarray_ptr whole_image; /* Needed to reverse row order */ + JDIMENSION source_row; /* Current source row number */ + JDIMENSION row_width; /* Physical width of scanlines in file */ + + int bits_per_pixel; /* remembers 8- or 24-bit format */ +} bmp_source_struct; + + +LOCAL(int) +read_byte (bmp_source_ptr sinfo) +/* Read next byte from BMP file */ +{ + register FILE *infile = sinfo->pub.input_file; + register int c; + + if ((c = getc(infile)) == EOF) + ERREXIT(sinfo->cinfo, JERR_INPUT_EOF); + return c; +} + + +LOCAL(void) +read_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize) +/* Read the colormap from a BMP file */ +{ + int i; + + switch (mapentrysize) { + case 3: + /* BGR format (occurs in OS/2 files) */ + for (i = 0; i < cmaplen; i++) { + sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo); + } + break; + case 4: + /* BGR0 format (occurs in MS Windows files) */ + for (i = 0; i < cmaplen; i++) { + sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo); + (void) read_byte(sinfo); + } + break; + default: + ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP); + break; + } +} + + +/* + * Read one row of pixels. + * The image has been read into the whole_image array, but is otherwise + * unprocessed. We must read it out in top-to-bottom row order, and if + * it is an 8-bit image, we must expand colormapped pixels to 24bit format. + */ + +METHODDEF(JDIMENSION) +get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 8-bit colormap indexes */ +{ + bmp_source_ptr source = (bmp_source_ptr) sinfo; + register JSAMPARRAY colormap = source->colormap; + JSAMPARRAY image_ptr; + register int t; + register JSAMPROW inptr, outptr; + register JDIMENSION col; + + /* Fetch next row from virtual array */ + source->source_row--; + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, + source->source_row, (JDIMENSION) 1, FALSE); + + /* Expand the colormap indexes to real data */ + inptr = image_ptr[0]; + outptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + t = GETJSAMPLE(*inptr++); + *outptr++ = colormap[0][t]; /* can omit GETJSAMPLE() safely */ + *outptr++ = colormap[1][t]; + *outptr++ = colormap[2][t]; + } + + return 1; +} + + +METHODDEF(JDIMENSION) +get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 24-bit pixels */ +{ + bmp_source_ptr source = (bmp_source_ptr) sinfo; + JSAMPARRAY image_ptr; + register JSAMPROW inptr, outptr; + register JDIMENSION col; + + /* Fetch next row from virtual array */ + source->source_row--; + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, + source->source_row, (JDIMENSION) 1, FALSE); + + /* Transfer data. Note source values are in BGR order + * (even though Microsoft's own documents say the opposite). + */ + inptr = image_ptr[0]; + outptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */ + outptr[1] = *inptr++; + outptr[0] = *inptr++; + outptr += 3; + } + + return 1; +} + + +METHODDEF(JDIMENSION) +get_32bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 32-bit pixels */ +{ + bmp_source_ptr source = (bmp_source_ptr) sinfo; + JSAMPARRAY image_ptr; + register JSAMPROW inptr, outptr; + register JDIMENSION col; + + /* Fetch next row from virtual array */ + source->source_row--; + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, + source->source_row, (JDIMENSION) 1, FALSE); + /* Transfer data. Note source values are in BGR order + * (even though Microsoft's own documents say the opposite). + */ + inptr = image_ptr[0]; + outptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */ + outptr[1] = *inptr++; + outptr[0] = *inptr++; + inptr++; /* skip the 4th byte (Alpha channel) */ + outptr += 3; + } + + return 1; +} + + +/* + * This method loads the image into whole_image during the first call on + * get_pixel_rows. The get_pixel_rows pointer is then adjusted to call + * get_8bit_row, get_24bit_row, or get_32bit_row on subsequent calls. + */ + +METHODDEF(JDIMENSION) +preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + bmp_source_ptr source = (bmp_source_ptr) sinfo; + register FILE *infile = source->pub.input_file; + register int c; + register JSAMPROW out_ptr; + JSAMPARRAY image_ptr; + JDIMENSION row, col; + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + + /* Read the data into a virtual array in input-file row order. */ + for (row = 0; row < cinfo->image_height; row++) { + if (progress != NULL) { + progress->pub.pass_counter = (long) row; + progress->pub.pass_limit = (long) cinfo->image_height; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, + row, (JDIMENSION) 1, TRUE); + out_ptr = image_ptr[0]; + for (col = source->row_width; col > 0; col--) { + /* inline copy of read_byte() for speed */ + if ((c = getc(infile)) == EOF) + ERREXIT(cinfo, JERR_INPUT_EOF); + *out_ptr++ = (JSAMPLE) c; + } + } + if (progress != NULL) + progress->completed_extra_passes++; + + /* Set up to read from the virtual array in top-to-bottom order */ + switch (source->bits_per_pixel) { + case 8: + source->pub.get_pixel_rows = get_8bit_row; + break; + case 24: + source->pub.get_pixel_rows = get_24bit_row; + break; + case 32: + source->pub.get_pixel_rows = get_32bit_row; + break; + default: + ERREXIT(cinfo, JERR_BMP_BADDEPTH); + } + source->source_row = cinfo->image_height; + + /* And read the first row */ + return (*source->pub.get_pixel_rows) (cinfo, sinfo); +} + + +/* + * Read the file header; return image size and component count. + */ + +METHODDEF(void) +start_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + bmp_source_ptr source = (bmp_source_ptr) sinfo; + U_CHAR bmpfileheader[14]; + U_CHAR bmpinfoheader[64]; +#define GET_2B(array,offset) ((unsigned int) UCH(array[offset]) + \ + (((unsigned int) UCH(array[offset+1])) << 8)) +#define GET_4B(array,offset) ((INT32) UCH(array[offset]) + \ + (((INT32) UCH(array[offset+1])) << 8) + \ + (((INT32) UCH(array[offset+2])) << 16) + \ + (((INT32) UCH(array[offset+3])) << 24)) + INT32 bfOffBits; + INT32 headerSize; + INT32 biWidth; + INT32 biHeight; + unsigned int biPlanes; + INT32 biCompression; + INT32 biXPelsPerMeter,biYPelsPerMeter; + INT32 biClrUsed = 0; + int mapentrysize = 0; /* 0 indicates no colormap */ + INT32 bPad; + JDIMENSION row_width; + + /* Read and verify the bitmap file header */ + if (! ReadOK(source->pub.input_file, bmpfileheader, 14)) + ERREXIT(cinfo, JERR_INPUT_EOF); + if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */ + ERREXIT(cinfo, JERR_BMP_NOT); + bfOffBits = (INT32) GET_4B(bmpfileheader,10); + /* We ignore the remaining fileheader fields */ + + /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows), + * or 64 bytes (OS/2 2.x). Check the first 4 bytes to find out which. + */ + if (! ReadOK(source->pub.input_file, bmpinfoheader, 4)) + ERREXIT(cinfo, JERR_INPUT_EOF); + headerSize = (INT32) GET_4B(bmpinfoheader,0); + if (headerSize < 12 || headerSize > 64) + ERREXIT(cinfo, JERR_BMP_BADHEADER); + if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4)) + ERREXIT(cinfo, JERR_INPUT_EOF); + + switch ((int) headerSize) { + case 12: + /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */ + biWidth = (INT32) GET_2B(bmpinfoheader,4); + biHeight = (INT32) GET_2B(bmpinfoheader,6); + biPlanes = GET_2B(bmpinfoheader,8); + source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10); + + switch (source->bits_per_pixel) { + case 8: /* colormapped image */ + mapentrysize = 3; /* OS/2 uses RGBTRIPLE colormap */ + TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight); + break; + case 24: /* RGB image */ + TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight); + break; + default: + ERREXIT(cinfo, JERR_BMP_BADDEPTH); + break; + } + break; + case 40: + case 64: + /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */ + /* or OS/2 2.x header, which has additional fields that we ignore */ + biWidth = GET_4B(bmpinfoheader,4); + biHeight = GET_4B(bmpinfoheader,8); + biPlanes = GET_2B(bmpinfoheader,12); + source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14); + biCompression = GET_4B(bmpinfoheader,16); + biXPelsPerMeter = GET_4B(bmpinfoheader,24); + biYPelsPerMeter = GET_4B(bmpinfoheader,28); + biClrUsed = GET_4B(bmpinfoheader,32); + /* biSizeImage, biClrImportant fields are ignored */ + + switch (source->bits_per_pixel) { + case 8: /* colormapped image */ + mapentrysize = 4; /* Windows uses RGBQUAD colormap */ + TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight); + break; + case 24: /* RGB image */ + TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight); + break; + case 32: /* RGB image + Alpha channel */ + TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight); + break; + default: + ERREXIT(cinfo, JERR_BMP_BADDEPTH); + break; + } + if (biCompression != 0) + ERREXIT(cinfo, JERR_BMP_COMPRESSED); + + if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) { + /* Set JFIF density parameters from the BMP data */ + cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */ + cinfo->Y_density = (UINT16) (biYPelsPerMeter/100); + cinfo->density_unit = 2; /* dots/cm */ + } + break; + default: + ERREXIT(cinfo, JERR_BMP_BADHEADER); + return; + } + + if (biWidth <= 0 || biHeight <= 0) + ERREXIT(cinfo, JERR_BMP_EMPTY); + if (biPlanes != 1) + ERREXIT(cinfo, JERR_BMP_BADPLANES); + + /* Compute distance to bitmap data --- will adjust for colormap below */ + bPad = bfOffBits - (headerSize + 14); + + /* Read the colormap, if any */ + if (mapentrysize > 0) { + if (biClrUsed <= 0) + biClrUsed = 256; /* assume it's 256 */ + else if (biClrUsed > 256) + ERREXIT(cinfo, JERR_BMP_BADCMAP); + /* Allocate space to store the colormap */ + source->colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) biClrUsed, (JDIMENSION) 3); + /* and read it from the file */ + read_colormap(source, (int) biClrUsed, mapentrysize); + /* account for size of colormap */ + bPad -= biClrUsed * mapentrysize; + } + + /* Skip any remaining pad bytes */ + if (bPad < 0) /* incorrect bfOffBits value? */ + ERREXIT(cinfo, JERR_BMP_BADHEADER); + while (--bPad >= 0) { + (void) read_byte(source); + } + + /* Compute row width in file, including padding to 4-byte boundary */ + if (source->bits_per_pixel == 24) + row_width = (JDIMENSION) (biWidth * 3); + else if (source->bits_per_pixel == 32) + row_width = (JDIMENSION) (biWidth * 4); + else + row_width = (JDIMENSION) biWidth; + while ((row_width & 3) != 0) row_width++; + source->row_width = row_width; + + /* Allocate space for inversion array, prepare for preload pass */ + source->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + row_width, (JDIMENSION) biHeight, (JDIMENSION) 1); + source->pub.get_pixel_rows = preload_image; + if (cinfo->progress != NULL) { + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + progress->total_extra_passes++; /* count file input as separate pass */ + } + + /* Allocate one-row buffer for returned data */ + source->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (biWidth * 3), (JDIMENSION) 1); + source->pub.buffer_height = 1; + + cinfo->in_color_space = JCS_RGB; + cinfo->input_components = 3; + cinfo->data_precision = 8; + cinfo->image_width = (JDIMENSION) biWidth; + cinfo->image_height = (JDIMENSION) biHeight; +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + /* no work */ +} + + +/* + * The module selection routine for BMP format input. + */ + +GLOBAL(cjpeg_source_ptr) +jinit_read_bmp (j_compress_ptr cinfo) +{ + bmp_source_ptr source; + + /* Create module interface object */ + source = (bmp_source_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(bmp_source_struct)); + source->cinfo = cinfo; /* make back link for subroutines */ + /* Fill in method ptrs, except get_pixel_rows which start_input sets */ + source->pub.start_input = start_input_bmp; + source->pub.finish_input = finish_input_bmp; + + return (cjpeg_source_ptr) source; +} + +#endif /* BMP_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/rdcolmap.c b/thirdparty/LibJPEG/jpeg-9/rdcolmap.c new file mode 100644 index 0000000..42b3437 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdcolmap.c @@ -0,0 +1,253 @@ +/* + * rdcolmap.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file implements djpeg's "-map file" switch. It reads a source image + * and constructs a colormap to be supplied to the JPEG decompressor. + * + * Currently, these file formats are supported for the map file: + * GIF: the contents of the GIF's global colormap are used. + * PPM (either text or raw flavor): the entire file is read and + * each unique pixel value is entered in the map. + * Note that reading a large PPM file will be horrendously slow. + * Typically, a PPM-format map file should contain just one pixel + * of each desired color. Such a file can be extracted from an + * ordinary image PPM file with ppmtomap(1). + * + * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not + * currently implemented. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */ + +/* Portions of this code are based on the PBMPLUS library, which is: +** +** Copyright (C) 1988 by Jef Poskanzer. +** +** Permission to use, copy, modify, and distribute this software and its +** documentation for any purpose and without fee is hereby granted, provided +** that the above copyright notice appear in all copies and that both that +** copyright notice and this permission notice appear in supporting +** documentation. This software is provided "as is" without express or +** implied warranty. +*/ + + +/* + * Add a (potentially) new color to the color map. + */ + +LOCAL(void) +add_map_entry (j_decompress_ptr cinfo, int R, int G, int B) +{ + JSAMPROW colormap0 = cinfo->colormap[0]; + JSAMPROW colormap1 = cinfo->colormap[1]; + JSAMPROW colormap2 = cinfo->colormap[2]; + int ncolors = cinfo->actual_number_of_colors; + int index; + + /* Check for duplicate color. */ + for (index = 0; index < ncolors; index++) { + if (GETJSAMPLE(colormap0[index]) == R && + GETJSAMPLE(colormap1[index]) == G && + GETJSAMPLE(colormap2[index]) == B) + return; /* color is already in map */ + } + + /* Check for map overflow. */ + if (ncolors >= (MAXJSAMPLE+1)) + ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1)); + + /* OK, add color to map. */ + colormap0[ncolors] = (JSAMPLE) R; + colormap1[ncolors] = (JSAMPLE) G; + colormap2[ncolors] = (JSAMPLE) B; + cinfo->actual_number_of_colors++; +} + + +/* + * Extract color map from a GIF file. + */ + +LOCAL(void) +read_gif_map (j_decompress_ptr cinfo, FILE * infile) +{ + int header[13]; + int i, colormaplen; + int R, G, B; + + /* Initial 'G' has already been read by read_color_map */ + /* Read the rest of the GIF header and logical screen descriptor */ + for (i = 1; i < 13; i++) { + if ((header[i] = getc(infile)) == EOF) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + } + + /* Verify GIF Header */ + if (header[1] != 'I' || header[2] != 'F') + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + + /* There must be a global color map. */ + if ((header[10] & 0x80) == 0) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + + /* OK, fetch it. */ + colormaplen = 2 << (header[10] & 0x07); + + for (i = 0; i < colormaplen; i++) { + R = getc(infile); + G = getc(infile); + B = getc(infile); + if (R == EOF || G == EOF || B == EOF) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + add_map_entry(cinfo, + R << (BITS_IN_JSAMPLE-8), + G << (BITS_IN_JSAMPLE-8), + B << (BITS_IN_JSAMPLE-8)); + } +} + + +/* Support routines for reading PPM */ + + +LOCAL(int) +pbm_getc (FILE * infile) +/* Read next char, skipping over any comments */ +/* A comment/newline sequence is returned as a newline */ +{ + register int ch; + + ch = getc(infile); + if (ch == '#') { + do { + ch = getc(infile); + } while (ch != '\n' && ch != EOF); + } + return ch; +} + + +LOCAL(unsigned int) +read_pbm_integer (j_decompress_ptr cinfo, FILE * infile) +/* Read an unsigned decimal integer from the PPM file */ +/* Swallows one trailing character after the integer */ +/* Note that on a 16-bit-int machine, only values up to 64k can be read. */ +/* This should not be a problem in practice. */ +{ + register int ch; + register unsigned int val; + + /* Skip any leading whitespace */ + do { + ch = pbm_getc(infile); + if (ch == EOF) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); + + if (ch < '0' || ch > '9') + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + + val = ch - '0'; + while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') { + val *= 10; + val += ch - '0'; + } + return val; +} + + +/* + * Extract color map from a PPM file. + */ + +LOCAL(void) +read_ppm_map (j_decompress_ptr cinfo, FILE * infile) +{ + int c; + unsigned int w, h, maxval, row, col; + int R, G, B; + + /* Initial 'P' has already been read by read_color_map */ + c = getc(infile); /* save format discriminator for a sec */ + + /* while we fetch the remaining header info */ + w = read_pbm_integer(cinfo, infile); + h = read_pbm_integer(cinfo, infile); + maxval = read_pbm_integer(cinfo, infile); + + if (w <= 0 || h <= 0 || maxval <= 0) /* error check */ + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + + /* For now, we don't support rescaling from an unusual maxval. */ + if (maxval != (unsigned int) MAXJSAMPLE) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + + switch (c) { + case '3': /* it's a text-format PPM file */ + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + R = read_pbm_integer(cinfo, infile); + G = read_pbm_integer(cinfo, infile); + B = read_pbm_integer(cinfo, infile); + add_map_entry(cinfo, R, G, B); + } + } + break; + + case '6': /* it's a raw-format PPM file */ + for (row = 0; row < h; row++) { + for (col = 0; col < w; col++) { + R = getc(infile); + G = getc(infile); + B = getc(infile); + if (R == EOF || G == EOF || B == EOF) + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + add_map_entry(cinfo, R, G, B); + } + } + break; + + default: + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + break; + } +} + + +/* + * Main entry point from djpeg.c. + * Input: opened input file (from file name argument on command line). + * Output: colormap and actual_number_of_colors fields are set in cinfo. + */ + +GLOBAL(void) +read_color_map (j_decompress_ptr cinfo, FILE * infile) +{ + /* Allocate space for a color map of maximum supported size. */ + cinfo->colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3); + cinfo->actual_number_of_colors = 0; /* initialize map to empty */ + + /* Read first byte to determine file format */ + switch (getc(infile)) { + case 'G': + read_gif_map(cinfo, infile); + break; + case 'P': + read_ppm_map(cinfo, infile); + break; + default: + ERREXIT(cinfo, JERR_BAD_CMAP_FILE); + break; + } +} + +#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/rdgif.c b/thirdparty/LibJPEG/jpeg-9/rdgif.c new file mode 100644 index 0000000..b27c167 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdgif.c @@ -0,0 +1,38 @@ +/* + * rdgif.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to read input images in GIF format. + * + ***************************************************************************** + * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * + * the ability to read GIF files has been removed from the IJG distribution. * + * Sorry about that. * + ***************************************************************************** + * + * We are required to state that + * "The Graphics Interchange Format(c) is the Copyright property of + * CompuServe Incorporated. GIF(sm) is a Service Mark property of + * CompuServe Incorporated." + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef GIF_SUPPORTED + +/* + * The module selection routine for GIF format input. + */ + +GLOBAL(cjpeg_source_ptr) +jinit_read_gif (j_compress_ptr cinfo) +{ + fprintf(stderr, "GIF input is unsupported for legal reasons. Sorry.\n"); + exit(EXIT_FAILURE); + return NULL; /* keep compiler happy */ +} + +#endif /* GIF_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/rdjpgcom.1 b/thirdparty/LibJPEG/jpeg-9/rdjpgcom.1 new file mode 100644 index 0000000..97611df --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdjpgcom.1 @@ -0,0 +1,63 @@ +.TH RDJPGCOM 1 "02 April 2009" +.SH NAME +rdjpgcom \- display text comments from a JPEG file +.SH SYNOPSIS +.B rdjpgcom +[ +.B \-raw +] +[ +.B \-verbose +] +[ +.I filename +] +.LP +.SH DESCRIPTION +.LP +.B rdjpgcom +reads the named JPEG/JFIF file, or the standard input if no file is named, +and prints any text comments found in the file on the standard output. +.PP +The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. +Although the standard doesn't actually define what COM blocks are for, they +are widely used to hold user-supplied text strings. This lets you add +annotations, titles, index terms, etc to your JPEG files, and later retrieve +them as text. COM blocks do not interfere with the image stored in the JPEG +file. The maximum size of a COM block is 64K, but you can have as many of +them as you like in one JPEG file. +.SH OPTIONS +.TP +.B \-raw +Normally +.B rdjpgcom +escapes non-printable characters in comments, for security reasons. +This option avoids that. +.PP +.B \-verbose +Causes +.B rdjpgcom +to also display the JPEG image dimensions. +.PP +Switch names may be abbreviated, and are not case sensitive. +.SH HINTS +.B rdjpgcom +does not depend on the IJG JPEG library. Its source code is intended as an +illustration of the minimum amount of code required to parse a JPEG file +header correctly. +.PP +In +.B \-verbose +mode, +.B rdjpgcom +will also attempt to print the contents of any "APP12" markers as text. +Some digital cameras produce APP12 markers containing useful textual +information. If you like, you can modify the source code to print +other APPn marker types as well. +.SH SEE ALSO +.BR cjpeg (1), +.BR djpeg (1), +.BR jpegtran (1), +.BR wrjpgcom (1) +.SH AUTHOR +Independent JPEG Group diff --git a/thirdparty/LibJPEG/jpeg-9/rdjpgcom.c b/thirdparty/LibJPEG/jpeg-9/rdjpgcom.c new file mode 100644 index 0000000..3719154 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdjpgcom.c @@ -0,0 +1,515 @@ +/* + * rdjpgcom.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 2009 by Bill Allombert, Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a very simple stand-alone application that displays + * the text in COM (comment) markers in a JFIF file. + * This may be useful as an example of the minimum logic needed to parse + * JPEG markers. + */ + +#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ +#include "jinclude.h" /* get auto-config symbols, */ + +#ifdef HAVE_LOCALE_H +#include /* Bill Allombert: use locale for isprint */ +#endif +#include /* to declare isupper(), tolower() */ +#ifdef USE_SETMODE +#include /* to declare setmode()'s parameter macros */ +/* If you have setmode() but not , just delete this line: */ +#include /* to declare setmode() */ +#endif + +#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ +#ifdef __MWERKS__ +#include /* Metrowerks needs this */ +#include /* ... and this */ +#endif +#ifdef THINK_C +#include /* Think declares it here */ +#endif +#endif + +#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ +#define READ_BINARY "r" +#else +#ifdef VMS /* VMS is very nonstandard */ +#define READ_BINARY "rb", "ctx=stm" +#else /* standard ANSI-compliant case */ +#define READ_BINARY "rb" +#endif +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif +#ifndef EXIT_SUCCESS +#ifdef VMS +#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ +#else +#define EXIT_SUCCESS 0 +#endif +#endif + + +/* + * These macros are used to read the input file. + * To reuse this code in another application, you might need to change these. + */ + +static FILE * infile; /* input JPEG file */ + +/* Return next input byte, or EOF if no more */ +#define NEXTBYTE() getc(infile) + + +/* Error exit handler */ +#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) + + +/* Read one byte, testing for EOF */ +static int +read_1_byte (void) +{ + int c; + + c = NEXTBYTE(); + if (c == EOF) + ERREXIT("Premature EOF in JPEG file"); + return c; +} + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in JPEG markers are MSB first */ +static unsigned int +read_2_bytes (void) +{ + int c1, c2; + + c1 = NEXTBYTE(); + if (c1 == EOF) + ERREXIT("Premature EOF in JPEG file"); + c2 = NEXTBYTE(); + if (c2 == EOF) + ERREXIT("Premature EOF in JPEG file"); + return (((unsigned int) c1) << 8) + ((unsigned int) c2); +} + + +/* + * JPEG markers consist of one or more 0xFF bytes, followed by a marker + * code byte (which is not an FF). Here are the marker codes of interest + * in this program. (See jdmarker.c for a more complete list.) + */ + +#define M_SOF0 0xC0 /* Start Of Frame N */ +#define M_SOF1 0xC1 /* N indicates which compression process */ +#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ +#define M_SOF3 0xC3 +#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ +#define M_SOF6 0xC6 +#define M_SOF7 0xC7 +#define M_SOF9 0xC9 +#define M_SOF10 0xCA +#define M_SOF11 0xCB +#define M_SOF13 0xCD +#define M_SOF14 0xCE +#define M_SOF15 0xCF +#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ +#define M_EOI 0xD9 /* End Of Image (end of datastream) */ +#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ +#define M_APP0 0xE0 /* Application-specific marker, type N */ +#define M_APP12 0xEC /* (we don't bother to list all 16 APPn's) */ +#define M_COM 0xFE /* COMment */ + + +/* + * Find the next JPEG marker and return its marker code. + * We expect at least one FF byte, possibly more if the compressor used FFs + * to pad the file. + * There could also be non-FF garbage between markers. The treatment of such + * garbage is unspecified; we choose to skip over it but emit a warning msg. + * NB: this routine must not be used after seeing SOS marker, since it will + * not deal correctly with FF/00 sequences in the compressed image data... + */ + +static int +next_marker (void) +{ + int c; + int discarded_bytes = 0; + + /* Find 0xFF byte; count and skip any non-FFs. */ + c = read_1_byte(); + while (c != 0xFF) { + discarded_bytes++; + c = read_1_byte(); + } + /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs + * are legal as pad bytes, so don't count them in discarded_bytes. + */ + do { + c = read_1_byte(); + } while (c == 0xFF); + + if (discarded_bytes != 0) { + fprintf(stderr, "Warning: garbage data found in JPEG file\n"); + } + + return c; +} + + +/* + * Read the initial marker, which should be SOI. + * For a JFIF file, the first two bytes of the file should be literally + * 0xFF M_SOI. To be more general, we could use next_marker, but if the + * input file weren't actually JPEG at all, next_marker might read the whole + * file and then return a misleading error message... + */ + +static int +first_marker (void) +{ + int c1, c2; + + c1 = NEXTBYTE(); + c2 = NEXTBYTE(); + if (c1 != 0xFF || c2 != M_SOI) + ERREXIT("Not a JPEG file"); + return c2; +} + + +/* + * Most types of marker are followed by a variable-length parameter segment. + * This routine skips over the parameters for any marker we don't otherwise + * want to process. + * Note that we MUST skip the parameter segment explicitly in order not to + * be fooled by 0xFF bytes that might appear within the parameter segment; + * such bytes do NOT introduce new markers. + */ + +static void +skip_variable (void) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + unsigned int length; + + /* Get the marker parameter length count */ + length = read_2_bytes(); + /* Length includes itself, so must be at least 2 */ + if (length < 2) + ERREXIT("Erroneous JPEG marker length"); + length -= 2; + /* Skip over the remaining bytes */ + while (length > 0) { + (void) read_1_byte(); + length--; + } +} + + +/* + * Process a COM marker. + * We want to print out the marker contents as legible text; + * we must guard against non-text junk and varying newline representations. + */ + +static void +process_COM (int raw) +{ + unsigned int length; + int ch; + int lastch = 0; + + /* Bill Allombert: set locale properly for isprint */ +#ifdef HAVE_LOCALE_H + setlocale(LC_CTYPE, ""); +#endif + + /* Get the marker parameter length count */ + length = read_2_bytes(); + /* Length includes itself, so must be at least 2 */ + if (length < 2) + ERREXIT("Erroneous JPEG marker length"); + length -= 2; + + while (length > 0) { + ch = read_1_byte(); + if (raw) { + putc(ch, stdout); + /* Emit the character in a readable form. + * Nonprintables are converted to \nnn form, + * while \ is converted to \\. + * Newlines in CR, CR/LF, or LF form will be printed as one newline. + */ + } else if (ch == '\r') { + printf("\n"); + } else if (ch == '\n') { + if (lastch != '\r') + printf("\n"); + } else if (ch == '\\') { + printf("\\\\"); + } else if (isprint(ch)) { + putc(ch, stdout); + } else { + printf("\\%03o", ch); + } + lastch = ch; + length--; + } + printf("\n"); + + /* Bill Allombert: revert to C locale */ +#ifdef HAVE_LOCALE_H + setlocale(LC_CTYPE, "C"); +#endif +} + + +/* + * Process a SOFn marker. + * This code is only needed if you want to know the image dimensions... + */ + +static void +process_SOFn (int marker) +{ + unsigned int length; + unsigned int image_height, image_width; + int data_precision, num_components; + const char * process; + int ci; + + length = read_2_bytes(); /* usual parameter length count */ + + data_precision = read_1_byte(); + image_height = read_2_bytes(); + image_width = read_2_bytes(); + num_components = read_1_byte(); + + switch (marker) { + case M_SOF0: process = "Baseline"; break; + case M_SOF1: process = "Extended sequential"; break; + case M_SOF2: process = "Progressive"; break; + case M_SOF3: process = "Lossless"; break; + case M_SOF5: process = "Differential sequential"; break; + case M_SOF6: process = "Differential progressive"; break; + case M_SOF7: process = "Differential lossless"; break; + case M_SOF9: process = "Extended sequential, arithmetic coding"; break; + case M_SOF10: process = "Progressive, arithmetic coding"; break; + case M_SOF11: process = "Lossless, arithmetic coding"; break; + case M_SOF13: process = "Differential sequential, arithmetic coding"; break; + case M_SOF14: process = "Differential progressive, arithmetic coding"; break; + case M_SOF15: process = "Differential lossless, arithmetic coding"; break; + default: process = "Unknown"; break; + } + + printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", + image_width, image_height, num_components, data_precision); + printf("JPEG process: %s\n", process); + + if (length != (unsigned int) (8 + num_components * 3)) + ERREXIT("Bogus SOF marker length"); + + for (ci = 0; ci < num_components; ci++) { + (void) read_1_byte(); /* Component ID code */ + (void) read_1_byte(); /* H, V sampling factors */ + (void) read_1_byte(); /* Quantization table number */ + } +} + + +/* + * Parse the marker stream until SOS or EOI is seen; + * display any COM markers. + * While the companion program wrjpgcom will always insert COM markers before + * SOFn, other implementations might not, so we scan to SOS before stopping. + * If we were only interested in the image dimensions, we would stop at SOFn. + * (Conversely, if we only cared about COM markers, there would be no need + * for special code to handle SOFn; we could treat it like other markers.) + */ + +static int +scan_JPEG_header (int verbose, int raw) +{ + int marker; + + /* Expect SOI at start of file */ + if (first_marker() != M_SOI) + ERREXIT("Expected SOI marker first"); + + /* Scan miscellaneous markers until we reach SOS. */ + for (;;) { + marker = next_marker(); + switch (marker) { + /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, + * treated as SOFn. C4 in particular is actually DHT. + */ + case M_SOF0: /* Baseline */ + case M_SOF1: /* Extended sequential, Huffman */ + case M_SOF2: /* Progressive, Huffman */ + case M_SOF3: /* Lossless, Huffman */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_SOF9: /* Extended sequential, arithmetic */ + case M_SOF10: /* Progressive, arithmetic */ + case M_SOF11: /* Lossless, arithmetic */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + if (verbose) + process_SOFn(marker); + else + skip_variable(); + break; + + case M_SOS: /* stop before hitting compressed data */ + return marker; + + case M_EOI: /* in case it's a tables-only JPEG stream */ + return marker; + + case M_COM: + process_COM(raw); + break; + + case M_APP12: + /* Some digital camera makers put useful textual information into + * APP12 markers, so we print those out too when in -verbose mode. + */ + if (verbose) { + printf("APP12 contains:\n"); + process_COM(raw); + } else + skip_variable(); + break; + + default: /* Anything else just gets skipped */ + skip_variable(); /* we assume it has a parameter count... */ + break; + } + } /* end loop */ +} + + +/* Command line parsing code */ + +static const char * progname; /* program name for error messages */ + + +static void +usage (void) +/* complain about bad command line */ +{ + fprintf(stderr, "rdjpgcom displays any textual comments in a JPEG file.\n"); + + fprintf(stderr, "Usage: %s [switches] [inputfile]\n", progname); + + fprintf(stderr, "Switches (names may be abbreviated):\n"); + fprintf(stderr, " -raw Display non-printable characters in comments (unsafe)\n"); + fprintf(stderr, " -verbose Also display dimensions of JPEG image\n"); + + exit(EXIT_FAILURE); +} + + +static int +keymatch (char * arg, const char * keyword, int minchars) +/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ +/* keyword is the constant keyword (must be lower case already), */ +/* minchars is length of minimum legal abbreviation. */ +{ + register int ca, ck; + register int nmatched = 0; + + while ((ca = *arg++) != '\0') { + if ((ck = *keyword++) == '\0') + return 0; /* arg longer than keyword, no good */ + if (isupper(ca)) /* force arg to lcase (assume ck is already) */ + ca = tolower(ca); + if (ca != ck) + return 0; /* no good */ + nmatched++; /* count matched characters */ + } + /* reached end of argument; fail if it's too short for unique abbrev */ + if (nmatched < minchars) + return 0; + return 1; /* A-OK */ +} + + +/* + * The main program. + */ + +int +main (int argc, char **argv) +{ + int argn; + char * arg; + int verbose = 0, raw = 0; + + /* On Mac, fetch a command line. */ +#ifdef USE_CCOMMAND + argc = ccommand(&argv); +#endif + + progname = argv[0]; + if (progname == NULL || progname[0] == 0) + progname = "rdjpgcom"; /* in case C library doesn't provide it */ + + /* Parse switches, if any */ + for (argn = 1; argn < argc; argn++) { + arg = argv[argn]; + if (arg[0] != '-') + break; /* not switch, must be file name */ + arg++; /* advance over '-' */ + if (keymatch(arg, "verbose", 1)) { + verbose++; + } else if (keymatch(arg, "raw", 1)) { + raw = 1; + } else + usage(); + } + + /* Open the input file. */ + /* Unix style: expect zero or one file name */ + if (argn < argc-1) { + fprintf(stderr, "%s: only one input file\n", progname); + usage(); + } + if (argn < argc) { + if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); + exit(EXIT_FAILURE); + } + } else { + /* default input file is stdin */ +#ifdef USE_SETMODE /* need to hack file mode? */ + setmode(fileno(stdin), O_BINARY); +#endif +#ifdef USE_FDOPEN /* need to re-open in binary mode? */ + if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open stdin\n", progname); + exit(EXIT_FAILURE); + } +#else + infile = stdin; +#endif + } + + /* Scan the JPEG headers. */ + (void) scan_JPEG_header(verbose, raw); + + /* All done. */ + exit(EXIT_SUCCESS); + return 0; /* suppress no-return-value warnings */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/rdppm.c b/thirdparty/LibJPEG/jpeg-9/rdppm.c new file mode 100644 index 0000000..a757022 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdppm.c @@ -0,0 +1,459 @@ +/* + * rdppm.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * Modified 2009 by Bill Allombert, Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to read input images in PPM/PGM format. + * The extended 2-byte-per-sample raw PPM/PGM formats are supported. + * The PBMPLUS library is NOT required to compile this software + * (but it is highly useful as a set of PPM image manipulation programs). + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume input from + * an ordinary stdio stream. They further assume that reading begins + * at the start of the file; start_input may need work if the + * user interface has already read some data (e.g., to determine that + * the file is indeed PPM format). + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef PPM_SUPPORTED + + +/* Portions of this code are based on the PBMPLUS library, which is: +** +** Copyright (C) 1988 by Jef Poskanzer. +** +** Permission to use, copy, modify, and distribute this software and its +** documentation for any purpose and without fee is hereby granted, provided +** that the above copyright notice appear in all copies and that both that +** copyright notice and this permission notice appear in supporting +** documentation. This software is provided "as is" without express or +** implied warranty. +*/ + + +/* Macros to deal with unsigned chars as efficiently as compiler allows */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char U_CHAR; +#define UCH(x) ((int) (x)) +#else /* !HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char U_CHAR; +#define UCH(x) ((int) (x)) +#else +typedef char U_CHAR; +#define UCH(x) ((int) (x) & 0xFF) +#endif +#endif /* HAVE_UNSIGNED_CHAR */ + + +#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len))) + + +/* + * On most systems, reading individual bytes with getc() is drastically less + * efficient than buffering a row at a time with fread(). On PCs, we must + * allocate the buffer in near data space, because we are assuming small-data + * memory model, wherein fread() can't reach far memory. If you need to + * process very wide images on a PC, you might have to compile in large-memory + * model, or else replace fread() with a getc() loop --- which will be much + * slower. + */ + + +/* Private version of data source object */ + +typedef struct { + struct cjpeg_source_struct pub; /* public fields */ + + U_CHAR *iobuffer; /* non-FAR pointer to I/O buffer */ + JSAMPROW pixrow; /* FAR pointer to same */ + size_t buffer_width; /* width of I/O buffer */ + JSAMPLE *rescale; /* => maxval-remapping array, or NULL */ +} ppm_source_struct; + +typedef ppm_source_struct * ppm_source_ptr; + + +LOCAL(int) +pbm_getc (FILE * infile) +/* Read next char, skipping over any comments */ +/* A comment/newline sequence is returned as a newline */ +{ + register int ch; + + ch = getc(infile); + if (ch == '#') { + do { + ch = getc(infile); + } while (ch != '\n' && ch != EOF); + } + return ch; +} + + +LOCAL(unsigned int) +read_pbm_integer (j_compress_ptr cinfo, FILE * infile) +/* Read an unsigned decimal integer from the PPM file */ +/* Swallows one trailing character after the integer */ +/* Note that on a 16-bit-int machine, only values up to 64k can be read. */ +/* This should not be a problem in practice. */ +{ + register int ch; + register unsigned int val; + + /* Skip any leading whitespace */ + do { + ch = pbm_getc(infile); + if (ch == EOF) + ERREXIT(cinfo, JERR_INPUT_EOF); + } while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); + + if (ch < '0' || ch > '9') + ERREXIT(cinfo, JERR_PPM_NONNUMERIC); + + val = ch - '0'; + while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') { + val *= 10; + val += ch - '0'; + } + return val; +} + + +/* + * Read one row of pixels. + * + * We provide several different versions depending on input file format. + * In all cases, input is scaled to the size of JSAMPLE. + * + * A really fast path is provided for reading byte/sample raw files with + * maxval = MAXJSAMPLE, which is the normal case for 8-bit data. + */ + + +METHODDEF(JDIMENSION) +get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading text-format PGM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + FILE * infile = source->pub.input_file; + register JSAMPROW ptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; + } + return 1; +} + + +METHODDEF(JDIMENSION) +get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading text-format PPM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + FILE * infile = source->pub.input_file; + register JSAMPROW ptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; + *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; + *ptr++ = rescale[read_pbm_integer(cinfo, infile)]; + } + return 1; +} + + +METHODDEF(JDIMENSION) +get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading raw-byte-format PGM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + register JSAMPROW ptr; + register U_CHAR * bufferptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) + ERREXIT(cinfo, JERR_INPUT_EOF); + ptr = source->pub.buffer[0]; + bufferptr = source->iobuffer; + for (col = cinfo->image_width; col > 0; col--) { + *ptr++ = rescale[UCH(*bufferptr++)]; + } + return 1; +} + + +METHODDEF(JDIMENSION) +get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading raw-byte-format PPM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + register JSAMPROW ptr; + register U_CHAR * bufferptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) + ERREXIT(cinfo, JERR_INPUT_EOF); + ptr = source->pub.buffer[0]; + bufferptr = source->iobuffer; + for (col = cinfo->image_width; col > 0; col--) { + *ptr++ = rescale[UCH(*bufferptr++)]; + *ptr++ = rescale[UCH(*bufferptr++)]; + *ptr++ = rescale[UCH(*bufferptr++)]; + } + return 1; +} + + +METHODDEF(JDIMENSION) +get_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE. + * In this case we just read right into the JSAMPLE buffer! + * Note that same code works for PPM and PGM files. + */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + + if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) + ERREXIT(cinfo, JERR_INPUT_EOF); + return 1; +} + + +METHODDEF(JDIMENSION) +get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading raw-word-format PGM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + register JSAMPROW ptr; + register U_CHAR * bufferptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) + ERREXIT(cinfo, JERR_INPUT_EOF); + ptr = source->pub.buffer[0]; + bufferptr = source->iobuffer; + for (col = cinfo->image_width; col > 0; col--) { + register int temp; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); + *ptr++ = rescale[temp]; + } + return 1; +} + + +METHODDEF(JDIMENSION) +get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading raw-word-format PPM files with any maxval */ +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + register JSAMPROW ptr; + register U_CHAR * bufferptr; + register JSAMPLE *rescale = source->rescale; + JDIMENSION col; + + if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width)) + ERREXIT(cinfo, JERR_INPUT_EOF); + ptr = source->pub.buffer[0]; + bufferptr = source->iobuffer; + for (col = cinfo->image_width; col > 0; col--) { + register int temp; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); + *ptr++ = rescale[temp]; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); + *ptr++ = rescale[temp]; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); + *ptr++ = rescale[temp]; + } + return 1; +} + + +/* + * Read the file header; return image size and component count. + */ + +METHODDEF(void) +start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + ppm_source_ptr source = (ppm_source_ptr) sinfo; + int c; + unsigned int w, h, maxval; + boolean need_iobuffer, use_raw_buffer, need_rescale; + + if (getc(source->pub.input_file) != 'P') + ERREXIT(cinfo, JERR_PPM_NOT); + + c = getc(source->pub.input_file); /* subformat discriminator character */ + + /* detect unsupported variants (ie, PBM) before trying to read header */ + switch (c) { + case '2': /* it's a text-format PGM file */ + case '3': /* it's a text-format PPM file */ + case '5': /* it's a raw-format PGM file */ + case '6': /* it's a raw-format PPM file */ + break; + default: + ERREXIT(cinfo, JERR_PPM_NOT); + break; + } + + /* fetch the remaining header info */ + w = read_pbm_integer(cinfo, source->pub.input_file); + h = read_pbm_integer(cinfo, source->pub.input_file); + maxval = read_pbm_integer(cinfo, source->pub.input_file); + + if (w <= 0 || h <= 0 || maxval <= 0) /* error check */ + ERREXIT(cinfo, JERR_PPM_NOT); + + cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */ + cinfo->image_width = (JDIMENSION) w; + cinfo->image_height = (JDIMENSION) h; + + /* initialize flags to most common settings */ + need_iobuffer = TRUE; /* do we need an I/O buffer? */ + use_raw_buffer = FALSE; /* do we map input buffer onto I/O buffer? */ + need_rescale = TRUE; /* do we need a rescale array? */ + + switch (c) { + case '2': /* it's a text-format PGM file */ + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h); + source->pub.get_pixel_rows = get_text_gray_row; + need_iobuffer = FALSE; + break; + + case '3': /* it's a text-format PPM file */ + cinfo->input_components = 3; + cinfo->in_color_space = JCS_RGB; + TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h); + source->pub.get_pixel_rows = get_text_rgb_row; + need_iobuffer = FALSE; + break; + + case '5': /* it's a raw-format PGM file */ + cinfo->input_components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + TRACEMS2(cinfo, 1, JTRC_PGM, w, h); + if (maxval > 255) { + source->pub.get_pixel_rows = get_word_gray_row; + } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) { + source->pub.get_pixel_rows = get_raw_row; + use_raw_buffer = TRUE; + need_rescale = FALSE; + } else { + source->pub.get_pixel_rows = get_scaled_gray_row; + } + break; + + case '6': /* it's a raw-format PPM file */ + cinfo->input_components = 3; + cinfo->in_color_space = JCS_RGB; + TRACEMS2(cinfo, 1, JTRC_PPM, w, h); + if (maxval > 255) { + source->pub.get_pixel_rows = get_word_rgb_row; + } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) { + source->pub.get_pixel_rows = get_raw_row; + use_raw_buffer = TRUE; + need_rescale = FALSE; + } else { + source->pub.get_pixel_rows = get_scaled_rgb_row; + } + break; + } + + /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */ + if (need_iobuffer) { + source->buffer_width = (size_t) w * cinfo->input_components * + ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR))); + source->iobuffer = (U_CHAR *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + source->buffer_width); + } + + /* Create compressor input buffer. */ + if (use_raw_buffer) { + /* For unscaled raw-input case, we can just map it onto the I/O buffer. */ + /* Synthesize a JSAMPARRAY pointer structure */ + /* Cast here implies near->far pointer conversion on PCs */ + source->pixrow = (JSAMPROW) source->iobuffer; + source->pub.buffer = & source->pixrow; + source->pub.buffer_height = 1; + } else { + /* Need to translate anyway, so make a separate sample buffer. */ + source->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1); + source->pub.buffer_height = 1; + } + + /* Compute the rescaling array if required. */ + if (need_rescale) { + INT32 val, half_maxval; + + /* On 16-bit-int machines we have to be careful of maxval = 65535 */ + source->rescale = (JSAMPLE *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE))); + half_maxval = maxval / 2; + for (val = 0; val <= (INT32) maxval; val++) { + /* The multiplication here must be done in 32 bits to avoid overflow */ + source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval); + } + } +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + /* no work */ +} + + +/* + * The module selection routine for PPM format input. + */ + +GLOBAL(cjpeg_source_ptr) +jinit_read_ppm (j_compress_ptr cinfo) +{ + ppm_source_ptr source; + + /* Create module interface object */ + source = (ppm_source_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ppm_source_struct)); + /* Fill in method ptrs, except get_pixel_rows which start_input sets */ + source->pub.start_input = start_input_ppm; + source->pub.finish_input = finish_input_ppm; + + return (cjpeg_source_ptr) source; +} + +#endif /* PPM_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/rdrle.c b/thirdparty/LibJPEG/jpeg-9/rdrle.c new file mode 100644 index 0000000..542bc37 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdrle.c @@ -0,0 +1,387 @@ +/* + * rdrle.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to read input images in Utah RLE format. + * The Utah Raster Toolkit library is required (version 3.1 or later). + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume input from + * an ordinary stdio stream. They further assume that reading begins + * at the start of the file; start_input may need work if the + * user interface has already read some data (e.g., to determine that + * the file is indeed RLE format). + * + * Based on code contributed by Mike Lijewski, + * with updates from Robert Hutchinson. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef RLE_SUPPORTED + +/* rle.h is provided by the Utah Raster Toolkit. */ + +#include + +/* + * We assume that JSAMPLE has the same representation as rle_pixel, + * to wit, "unsigned char". Hence we can't cope with 12- or 16-bit samples. + */ + +#if BITS_IN_JSAMPLE != 8 + Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */ +#endif + +/* + * We support the following types of RLE files: + * + * GRAYSCALE - 8 bits, no colormap + * MAPPEDGRAY - 8 bits, 1 channel colomap + * PSEUDOCOLOR - 8 bits, 3 channel colormap + * TRUECOLOR - 24 bits, 3 channel colormap + * DIRECTCOLOR - 24 bits, no colormap + * + * For now, we ignore any alpha channel in the image. + */ + +typedef enum + { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind; + + +/* + * Since RLE stores scanlines bottom-to-top, we have to invert the image + * to conform to JPEG's top-to-bottom order. To do this, we read the + * incoming image into a virtual array on the first get_pixel_rows call, + * then fetch the required row from the virtual array on subsequent calls. + */ + +typedef struct _rle_source_struct * rle_source_ptr; + +typedef struct _rle_source_struct { + struct cjpeg_source_struct pub; /* public fields */ + + rle_kind visual; /* actual type of input file */ + jvirt_sarray_ptr image; /* virtual array to hold the image */ + JDIMENSION row; /* current row # in the virtual array */ + rle_hdr header; /* Input file information */ + rle_pixel** rle_row; /* holds a row returned by rle_getrow() */ + +} rle_source_struct; + + +/* + * Read the file header; return image size and component count. + */ + +METHODDEF(void) +start_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + rle_source_ptr source = (rle_source_ptr) sinfo; + JDIMENSION width, height; +#ifdef PROGRESS_REPORT + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; +#endif + + /* Use RLE library routine to get the header info */ + source->header = *rle_hdr_init(NULL); + source->header.rle_file = source->pub.input_file; + switch (rle_get_setup(&(source->header))) { + case RLE_SUCCESS: + /* A-OK */ + break; + case RLE_NOT_RLE: + ERREXIT(cinfo, JERR_RLE_NOT); + break; + case RLE_NO_SPACE: + ERREXIT(cinfo, JERR_RLE_MEM); + break; + case RLE_EMPTY: + ERREXIT(cinfo, JERR_RLE_EMPTY); + break; + case RLE_EOF: + ERREXIT(cinfo, JERR_RLE_EOF); + break; + default: + ERREXIT(cinfo, JERR_RLE_BADERROR); + break; + } + + /* Figure out what we have, set private vars and return values accordingly */ + + width = source->header.xmax - source->header.xmin + 1; + height = source->header.ymax - source->header.ymin + 1; + source->header.xmin = 0; /* realign horizontally */ + source->header.xmax = width-1; + + cinfo->image_width = width; + cinfo->image_height = height; + cinfo->data_precision = 8; /* we can only handle 8 bit data */ + + if (source->header.ncolors == 1 && source->header.ncmap == 0) { + source->visual = GRAYSCALE; + TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height); + } else if (source->header.ncolors == 1 && source->header.ncmap == 1) { + source->visual = MAPPEDGRAY; + TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height, + 1 << source->header.cmaplen); + } else if (source->header.ncolors == 1 && source->header.ncmap == 3) { + source->visual = PSEUDOCOLOR; + TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height, + 1 << source->header.cmaplen); + } else if (source->header.ncolors == 3 && source->header.ncmap == 3) { + source->visual = TRUECOLOR; + TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height, + 1 << source->header.cmaplen); + } else if (source->header.ncolors == 3 && source->header.ncmap == 0) { + source->visual = DIRECTCOLOR; + TRACEMS2(cinfo, 1, JTRC_RLE, width, height); + } else + ERREXIT(cinfo, JERR_RLE_UNSUPPORTED); + + if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) { + cinfo->in_color_space = JCS_GRAYSCALE; + cinfo->input_components = 1; + } else { + cinfo->in_color_space = JCS_RGB; + cinfo->input_components = 3; + } + + /* + * A place to hold each scanline while it's converted. + * (GRAYSCALE scanlines don't need converting) + */ + if (source->visual != GRAYSCALE) { + source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) width, (JDIMENSION) cinfo->input_components); + } + + /* request a virtual array to hold the image */ + source->image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) (width * source->header.ncolors), + (JDIMENSION) height, (JDIMENSION) 1); + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + /* count file input as separate pass */ + progress->total_extra_passes++; + } +#endif + + source->pub.buffer_height = 1; +} + + +/* + * Read one row of pixels. + * Called only after load_image has read the image into the virtual array. + * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images. + */ + +METHODDEF(JDIMENSION) +get_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + rle_source_ptr source = (rle_source_ptr) sinfo; + + source->row--; + source->pub.buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE); + + return 1; +} + +/* + * Read one row of pixels. + * Called only after load_image has read the image into the virtual array. + * Used for PSEUDOCOLOR images. + */ + +METHODDEF(JDIMENSION) +get_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + rle_source_ptr source = (rle_source_ptr) sinfo; + JSAMPROW src_row, dest_row; + JDIMENSION col; + rle_map *colormap; + int val; + + colormap = source->header.cmap; + dest_row = source->pub.buffer[0]; + source->row--; + src_row = * (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE); + + for (col = cinfo->image_width; col > 0; col--) { + val = GETJSAMPLE(*src_row++); + *dest_row++ = (JSAMPLE) (colormap[val ] >> 8); + *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8); + *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8); + } + + return 1; +} + + +/* + * Load the image into a virtual array. We have to do this because RLE + * files start at the lower left while the JPEG standard has them starting + * in the upper left. This is called the first time we want to get a row + * of input. What we do is load the RLE data into the array and then call + * the appropriate routine to read one row from the array. Before returning, + * we set source->pub.get_pixel_rows so that subsequent calls go straight to + * the appropriate row-reading routine. + */ + +METHODDEF(JDIMENSION) +load_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + rle_source_ptr source = (rle_source_ptr) sinfo; + JDIMENSION row, col; + JSAMPROW scanline, red_ptr, green_ptr, blue_ptr; + rle_pixel **rle_row; + rle_map *colormap; + char channel; +#ifdef PROGRESS_REPORT + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; +#endif + + colormap = source->header.cmap; + rle_row = source->rle_row; + + /* Read the RLE data into our virtual array. + * We assume here that (a) rle_pixel is represented the same as JSAMPLE, + * and (b) we are not on a machine where FAR pointers differ from regular. + */ + RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */ + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_limit = cinfo->image_height; + progress->pub.pass_counter = 0; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + + switch (source->visual) { + + case GRAYSCALE: + case PSEUDOCOLOR: + for (row = 0; row < cinfo->image_height; row++) { + rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE); + rle_getrow(&source->header, rle_row); +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_counter++; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + } + break; + + case MAPPEDGRAY: + case TRUECOLOR: + for (row = 0; row < cinfo->image_height; row++) { + scanline = * (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE); + rle_row = source->rle_row; + rle_getrow(&source->header, rle_row); + + for (col = 0; col < cinfo->image_width; col++) { + for (channel = 0; channel < source->header.ncolors; channel++) { + *scanline++ = (JSAMPLE) + (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8); + } + } + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_counter++; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + } + break; + + case DIRECTCOLOR: + for (row = 0; row < cinfo->image_height; row++) { + scanline = * (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE); + rle_getrow(&source->header, rle_row); + + red_ptr = rle_row[0]; + green_ptr = rle_row[1]; + blue_ptr = rle_row[2]; + + for (col = cinfo->image_width; col > 0; col--) { + *scanline++ = *red_ptr++; + *scanline++ = *green_ptr++; + *scanline++ = *blue_ptr++; + } + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_counter++; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + } + } + +#ifdef PROGRESS_REPORT + if (progress != NULL) + progress->completed_extra_passes++; +#endif + + /* Set up to call proper row-extraction routine in future */ + if (source->visual == PSEUDOCOLOR) { + source->pub.buffer = source->rle_row; + source->pub.get_pixel_rows = get_pseudocolor_row; + } else { + source->pub.get_pixel_rows = get_rle_row; + } + source->row = cinfo->image_height; + + /* And fetch the topmost (bottommost) row */ + return (*source->pub.get_pixel_rows) (cinfo, sinfo); +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + /* no work */ +} + + +/* + * The module selection routine for RLE format input. + */ + +GLOBAL(cjpeg_source_ptr) +jinit_read_rle (j_compress_ptr cinfo) +{ + rle_source_ptr source; + + /* Create module interface object */ + source = (rle_source_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(rle_source_struct)); + /* Fill in method ptrs */ + source->pub.start_input = start_input_rle; + source->pub.finish_input = finish_input_rle; + source->pub.get_pixel_rows = load_image; + + return (cjpeg_source_ptr) source; +} + +#endif /* RLE_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/rdswitch.c b/thirdparty/LibJPEG/jpeg-9/rdswitch.c new file mode 100644 index 0000000..7a839af --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdswitch.c @@ -0,0 +1,365 @@ +/* + * rdswitch.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to process some of cjpeg's more complicated + * command-line switches. Switches processed here are: + * -qtables file Read quantization tables from text file + * -scans file Read scan script from text file + * -quality N[,N,...] Set quality ratings + * -qslots N[,N,...] Set component quantization table selectors + * -sample HxV[,HxV,...] Set component sampling factors + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ +#include /* to declare isdigit(), isspace() */ + + +LOCAL(int) +text_getc (FILE * file) +/* Read next char, skipping over any comments (# to end of line) */ +/* A comment/newline sequence is returned as a newline */ +{ + register int ch; + + ch = getc(file); + if (ch == '#') { + do { + ch = getc(file); + } while (ch != '\n' && ch != EOF); + } + return ch; +} + + +LOCAL(boolean) +read_text_integer (FILE * file, long * result, int * termchar) +/* Read an unsigned decimal integer from a file, store it in result */ +/* Reads one trailing character after the integer; returns it in termchar */ +{ + register int ch; + register long val; + + /* Skip any leading whitespace, detect EOF */ + do { + ch = text_getc(file); + if (ch == EOF) { + *termchar = ch; + return FALSE; + } + } while (isspace(ch)); + + if (! isdigit(ch)) { + *termchar = ch; + return FALSE; + } + + val = ch - '0'; + while ((ch = text_getc(file)) != EOF) { + if (! isdigit(ch)) + break; + val *= 10; + val += ch - '0'; + } + *result = val; + *termchar = ch; + return TRUE; +} + + +GLOBAL(boolean) +read_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline) +/* Read a set of quantization tables from the specified file. + * The file is plain ASCII text: decimal numbers with whitespace between. + * Comments preceded by '#' may be included in the file. + * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values. + * The tables are implicitly numbered 0,1,etc. + * NOTE: does not affect the qslots mapping, which will default to selecting + * table 0 for luminance (or primary) components, 1 for chrominance components. + * You must use -qslots if you want a different component->table mapping. + */ +{ + FILE * fp; + int tblno, i, termchar; + long val; + unsigned int table[DCTSIZE2]; + + if ((fp = fopen(filename, "r")) == NULL) { + fprintf(stderr, "Can't open table file %s\n", filename); + return FALSE; + } + tblno = 0; + + while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */ + if (tblno >= NUM_QUANT_TBLS) { + fprintf(stderr, "Too many tables in file %s\n", filename); + fclose(fp); + return FALSE; + } + table[0] = (unsigned int) val; + for (i = 1; i < DCTSIZE2; i++) { + if (! read_text_integer(fp, &val, &termchar)) { + fprintf(stderr, "Invalid table data in file %s\n", filename); + fclose(fp); + return FALSE; + } + table[i] = (unsigned int) val; + } + jpeg_add_quant_table(cinfo, tblno, table, cinfo->q_scale_factor[tblno], + force_baseline); + tblno++; + } + + if (termchar != EOF) { + fprintf(stderr, "Non-numeric data in file %s\n", filename); + fclose(fp); + return FALSE; + } + + fclose(fp); + return TRUE; +} + + +#ifdef C_MULTISCAN_FILES_SUPPORTED + +LOCAL(boolean) +read_scan_integer (FILE * file, long * result, int * termchar) +/* Variant of read_text_integer that always looks for a non-space termchar; + * this simplifies parsing of punctuation in scan scripts. + */ +{ + register int ch; + + if (! read_text_integer(file, result, termchar)) + return FALSE; + ch = *termchar; + while (ch != EOF && isspace(ch)) + ch = text_getc(file); + if (isdigit(ch)) { /* oops, put it back */ + if (ungetc(ch, file) == EOF) + return FALSE; + ch = ' '; + } else { + /* Any separators other than ';' and ':' are ignored; + * this allows user to insert commas, etc, if desired. + */ + if (ch != EOF && ch != ';' && ch != ':') + ch = ' '; + } + *termchar = ch; + return TRUE; +} + + +GLOBAL(boolean) +read_scan_script (j_compress_ptr cinfo, char * filename) +/* Read a scan script from the specified text file. + * Each entry in the file defines one scan to be emitted. + * Entries are separated by semicolons ';'. + * An entry contains one to four component indexes, + * optionally followed by a colon ':' and four progressive-JPEG parameters. + * The component indexes denote which component(s) are to be transmitted + * in the current scan. The first component has index 0. + * Sequential JPEG is used if the progressive-JPEG parameters are omitted. + * The file is free format text: any whitespace may appear between numbers + * and the ':' and ';' punctuation marks. Also, other punctuation (such + * as commas or dashes) can be placed between numbers if desired. + * Comments preceded by '#' may be included in the file. + * Note: we do very little validity checking here; + * jcmaster.c will validate the script parameters. + */ +{ + FILE * fp; + int scanno, ncomps, termchar; + long val; + jpeg_scan_info * scanptr; +#define MAX_SCANS 100 /* quite arbitrary limit */ + jpeg_scan_info scans[MAX_SCANS]; + + if ((fp = fopen(filename, "r")) == NULL) { + fprintf(stderr, "Can't open scan definition file %s\n", filename); + return FALSE; + } + scanptr = scans; + scanno = 0; + + while (read_scan_integer(fp, &val, &termchar)) { + if (scanno >= MAX_SCANS) { + fprintf(stderr, "Too many scans defined in file %s\n", filename); + fclose(fp); + return FALSE; + } + scanptr->component_index[0] = (int) val; + ncomps = 1; + while (termchar == ' ') { + if (ncomps >= MAX_COMPS_IN_SCAN) { + fprintf(stderr, "Too many components in one scan in file %s\n", + filename); + fclose(fp); + return FALSE; + } + if (! read_scan_integer(fp, &val, &termchar)) + goto bogus; + scanptr->component_index[ncomps] = (int) val; + ncomps++; + } + scanptr->comps_in_scan = ncomps; + if (termchar == ':') { + if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ') + goto bogus; + scanptr->Ss = (int) val; + if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ') + goto bogus; + scanptr->Se = (int) val; + if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ') + goto bogus; + scanptr->Ah = (int) val; + if (! read_scan_integer(fp, &val, &termchar)) + goto bogus; + scanptr->Al = (int) val; + } else { + /* set non-progressive parameters */ + scanptr->Ss = 0; + scanptr->Se = DCTSIZE2-1; + scanptr->Ah = 0; + scanptr->Al = 0; + } + if (termchar != ';' && termchar != EOF) { +bogus: + fprintf(stderr, "Invalid scan entry format in file %s\n", filename); + fclose(fp); + return FALSE; + } + scanptr++, scanno++; + } + + if (termchar != EOF) { + fprintf(stderr, "Non-numeric data in file %s\n", filename); + fclose(fp); + return FALSE; + } + + if (scanno > 0) { + /* Stash completed scan list in cinfo structure. + * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data, + * but if you want to compress multiple images you'd want JPOOL_PERMANENT. + */ + scanptr = (jpeg_scan_info *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + scanno * SIZEOF(jpeg_scan_info)); + MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info)); + cinfo->scan_info = scanptr; + cinfo->num_scans = scanno; + } + + fclose(fp); + return TRUE; +} + +#endif /* C_MULTISCAN_FILES_SUPPORTED */ + + +GLOBAL(boolean) +set_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline) +/* Process a quality-ratings parameter string, of the form + * N[,N,...] + * If there are more q-table slots than parameters, the last value is replicated. + */ +{ + int val = 75; /* default value */ + int tblno; + char ch; + + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + if (*arg) { + ch = ','; /* if not set by sscanf, will be ',' */ + if (sscanf(arg, "%d%c", &val, &ch) < 1) + return FALSE; + if (ch != ',') /* syntax check */ + return FALSE; + /* Convert user 0-100 rating to percentage scaling */ + cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val); + while (*arg && *arg++ != ',') /* advance to next segment of arg string */ + ; + } else { + /* reached end of parameter, set remaining factors to last value */ + cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val); + } + } + jpeg_default_qtables(cinfo, force_baseline); + return TRUE; +} + + +GLOBAL(boolean) +set_quant_slots (j_compress_ptr cinfo, char *arg) +/* Process a quantization-table-selectors parameter string, of the form + * N[,N,...] + * If there are more components than parameters, the last value is replicated. + */ +{ + int val = 0; /* default table # */ + int ci; + char ch; + + for (ci = 0; ci < MAX_COMPONENTS; ci++) { + if (*arg) { + ch = ','; /* if not set by sscanf, will be ',' */ + if (sscanf(arg, "%d%c", &val, &ch) < 1) + return FALSE; + if (ch != ',') /* syntax check */ + return FALSE; + if (val < 0 || val >= NUM_QUANT_TBLS) { + fprintf(stderr, "JPEG quantization tables are numbered 0..%d\n", + NUM_QUANT_TBLS-1); + return FALSE; + } + cinfo->comp_info[ci].quant_tbl_no = val; + while (*arg && *arg++ != ',') /* advance to next segment of arg string */ + ; + } else { + /* reached end of parameter, set remaining components to last table */ + cinfo->comp_info[ci].quant_tbl_no = val; + } + } + return TRUE; +} + + +GLOBAL(boolean) +set_sample_factors (j_compress_ptr cinfo, char *arg) +/* Process a sample-factors parameter string, of the form + * HxV[,HxV,...] + * If there are more components than parameters, "1x1" is assumed for the rest. + */ +{ + int ci, val1, val2; + char ch1, ch2; + + for (ci = 0; ci < MAX_COMPONENTS; ci++) { + if (*arg) { + ch2 = ','; /* if not set by sscanf, will be ',' */ + if (sscanf(arg, "%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3) + return FALSE; + if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */ + return FALSE; + if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) { + fprintf(stderr, "JPEG sampling factors must be 1..4\n"); + return FALSE; + } + cinfo->comp_info[ci].h_samp_factor = val1; + cinfo->comp_info[ci].v_samp_factor = val2; + while (*arg && *arg++ != ',') /* advance to next segment of arg string */ + ; + } else { + /* reached end of parameter, set remaining components to 1x1 sampling */ + cinfo->comp_info[ci].h_samp_factor = 1; + cinfo->comp_info[ci].v_samp_factor = 1; + } + } + return TRUE; +} diff --git a/thirdparty/LibJPEG/jpeg-9/rdtarga.c b/thirdparty/LibJPEG/jpeg-9/rdtarga.c new file mode 100644 index 0000000..4c2cd26 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/rdtarga.c @@ -0,0 +1,500 @@ +/* + * rdtarga.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to read input images in Targa format. + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume input from + * an ordinary stdio stream. They further assume that reading begins + * at the start of the file; start_input may need work if the + * user interface has already read some data (e.g., to determine that + * the file is indeed Targa format). + * + * Based on code contributed by Lee Daniel Crocker. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef TARGA_SUPPORTED + + +/* Macros to deal with unsigned chars as efficiently as compiler allows */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char U_CHAR; +#define UCH(x) ((int) (x)) +#else /* !HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char U_CHAR; +#define UCH(x) ((int) (x)) +#else +typedef char U_CHAR; +#define UCH(x) ((int) (x) & 0xFF) +#endif +#endif /* HAVE_UNSIGNED_CHAR */ + + +#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len))) + + +/* Private version of data source object */ + +typedef struct _tga_source_struct * tga_source_ptr; + +typedef struct _tga_source_struct { + struct cjpeg_source_struct pub; /* public fields */ + + j_compress_ptr cinfo; /* back link saves passing separate parm */ + + JSAMPARRAY colormap; /* Targa colormap (converted to my format) */ + + jvirt_sarray_ptr whole_image; /* Needed if funny input row order */ + JDIMENSION current_row; /* Current logical row number to read */ + + /* Pointer to routine to extract next Targa pixel from input file */ + JMETHOD(void, read_pixel, (tga_source_ptr sinfo)); + + /* Result of read_pixel is delivered here: */ + U_CHAR tga_pixel[4]; + + int pixel_size; /* Bytes per Targa pixel (1 to 4) */ + + /* State info for reading RLE-coded pixels; both counts must be init to 0 */ + int block_count; /* # of pixels remaining in RLE block */ + int dup_pixel_count; /* # of times to duplicate previous pixel */ + + /* This saves the correct pixel-row-expansion method for preload_image */ + JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo, + cjpeg_source_ptr sinfo)); +} tga_source_struct; + + +/* For expanding 5-bit pixel values to 8-bit with best rounding */ + +static const UINT8 c5to8bits[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + + + +LOCAL(int) +read_byte (tga_source_ptr sinfo) +/* Read next byte from Targa file */ +{ + register FILE *infile = sinfo->pub.input_file; + register int c; + + if ((c = getc(infile)) == EOF) + ERREXIT(sinfo->cinfo, JERR_INPUT_EOF); + return c; +} + + +LOCAL(void) +read_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize) +/* Read the colormap from a Targa file */ +{ + int i; + + /* Presently only handles 24-bit BGR format */ + if (mapentrysize != 24) + ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP); + + for (i = 0; i < cmaplen; i++) { + sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo); + sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo); + } +} + + +/* + * read_pixel methods: get a single pixel from Targa file into tga_pixel[] + */ + +METHODDEF(void) +read_non_rle_pixel (tga_source_ptr sinfo) +/* Read one Targa pixel from the input file; no RLE expansion */ +{ + register FILE *infile = sinfo->pub.input_file; + register int i; + + for (i = 0; i < sinfo->pixel_size; i++) { + sinfo->tga_pixel[i] = (U_CHAR) getc(infile); + } +} + + +METHODDEF(void) +read_rle_pixel (tga_source_ptr sinfo) +/* Read one Targa pixel from the input file, expanding RLE data as needed */ +{ + register FILE *infile = sinfo->pub.input_file; + register int i; + + /* Duplicate previously read pixel? */ + if (sinfo->dup_pixel_count > 0) { + sinfo->dup_pixel_count--; + return; + } + + /* Time to read RLE block header? */ + if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */ + i = read_byte(sinfo); + if (i & 0x80) { /* Start of duplicate-pixel block? */ + sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */ + sinfo->block_count = 0; /* then read new block header */ + } else { + sinfo->block_count = i & 0x7F; /* number of pixels after this one */ + } + } + + /* Read next pixel */ + for (i = 0; i < sinfo->pixel_size; i++) { + sinfo->tga_pixel[i] = (U_CHAR) getc(infile); + } +} + + +/* + * Read one row of pixels. + * + * We provide several different versions depending on input file format. + */ + + +METHODDEF(JDIMENSION) +get_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 8-bit grayscale pixels */ +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + register JSAMPROW ptr; + register JDIMENSION col; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ + *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]); + } + return 1; +} + +METHODDEF(JDIMENSION) +get_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 8-bit colormap indexes */ +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + register int t; + register JSAMPROW ptr; + register JDIMENSION col; + register JSAMPARRAY colormap = source->colormap; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ + t = UCH(source->tga_pixel[0]); + *ptr++ = colormap[0][t]; + *ptr++ = colormap[1][t]; + *ptr++ = colormap[2][t]; + } + return 1; +} + +METHODDEF(JDIMENSION) +get_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 16-bit pixels */ +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + register int t; + register JSAMPROW ptr; + register JDIMENSION col; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ + t = UCH(source->tga_pixel[0]); + t += UCH(source->tga_pixel[1]) << 8; + /* We expand 5 bit data to 8 bit sample width. + * The format of the 16-bit (LSB first) input word is + * xRRRRRGGGGGBBBBB + */ + ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F]; + t >>= 5; + ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F]; + t >>= 5; + ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F]; + ptr += 3; + } + return 1; +} + +METHODDEF(JDIMENSION) +get_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +/* This version is for reading 24-bit pixels */ +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + register JSAMPROW ptr; + register JDIMENSION col; + + ptr = source->pub.buffer[0]; + for (col = cinfo->image_width; col > 0; col--) { + (*source->read_pixel) (source); /* Load next pixel into tga_pixel */ + *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */ + *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]); + *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]); + } + return 1; +} + +/* + * Targa also defines a 32-bit pixel format with order B,G,R,A. + * We presently ignore the attribute byte, so the code for reading + * these pixels is identical to the 24-bit routine above. + * This works because the actual pixel length is only known to read_pixel. + */ + +#define get_32bit_row get_24bit_row + + +/* + * This method is for re-reading the input data in standard top-down + * row order. The entire image has already been read into whole_image + * with proper conversion of pixel format, but it's in a funny row order. + */ + +METHODDEF(JDIMENSION) +get_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + JDIMENSION source_row; + + /* Compute row of source that maps to current_row of normal order */ + /* For now, assume image is bottom-up and not interlaced. */ + /* NEEDS WORK to support interlaced images! */ + source_row = cinfo->image_height - source->current_row - 1; + + /* Fetch that row from virtual array */ + source->pub.buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, + source_row, (JDIMENSION) 1, FALSE); + + source->current_row++; + return 1; +} + + +/* + * This method loads the image into whole_image during the first call on + * get_pixel_rows. The get_pixel_rows pointer is then adjusted to call + * get_memory_row on subsequent calls. + */ + +METHODDEF(JDIMENSION) +preload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + JDIMENSION row; + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + + /* Read the data into a virtual array in input-file row order. */ + for (row = 0; row < cinfo->image_height; row++) { + if (progress != NULL) { + progress->pub.pass_counter = (long) row; + progress->pub.pass_limit = (long) cinfo->image_height; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } + source->pub.buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE); + (*source->get_pixel_rows) (cinfo, sinfo); + } + if (progress != NULL) + progress->completed_extra_passes++; + + /* Set up to read from the virtual array in unscrambled order */ + source->pub.get_pixel_rows = get_memory_row; + source->current_row = 0; + /* And read the first row */ + return get_memory_row(cinfo, sinfo); +} + + +/* + * Read the file header; return image size and component count. + */ + +METHODDEF(void) +start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + tga_source_ptr source = (tga_source_ptr) sinfo; + U_CHAR targaheader[18]; + int idlen, cmaptype, subtype, flags, interlace_type, components; + unsigned int width, height, maplen; + boolean is_bottom_up; + +#define GET_2B(offset) ((unsigned int) UCH(targaheader[offset]) + \ + (((unsigned int) UCH(targaheader[offset+1])) << 8)) + + if (! ReadOK(source->pub.input_file, targaheader, 18)) + ERREXIT(cinfo, JERR_INPUT_EOF); + + /* Pretend "15-bit" pixels are 16-bit --- we ignore attribute bit anyway */ + if (targaheader[16] == 15) + targaheader[16] = 16; + + idlen = UCH(targaheader[0]); + cmaptype = UCH(targaheader[1]); + subtype = UCH(targaheader[2]); + maplen = GET_2B(5); + width = GET_2B(12); + height = GET_2B(14); + source->pixel_size = UCH(targaheader[16]) >> 3; + flags = UCH(targaheader[17]); /* Image Descriptor byte */ + + is_bottom_up = ((flags & 0x20) == 0); /* bit 5 set => top-down */ + interlace_type = flags >> 6; /* bits 6/7 are interlace code */ + + if (cmaptype > 1 || /* cmaptype must be 0 or 1 */ + source->pixel_size < 1 || source->pixel_size > 4 || + (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */ + interlace_type != 0) /* currently don't allow interlaced image */ + ERREXIT(cinfo, JERR_TGA_BADPARMS); + + if (subtype > 8) { + /* It's an RLE-coded file */ + source->read_pixel = read_rle_pixel; + source->block_count = source->dup_pixel_count = 0; + subtype -= 8; + } else { + /* Non-RLE file */ + source->read_pixel = read_non_rle_pixel; + } + + /* Now should have subtype 1, 2, or 3 */ + components = 3; /* until proven different */ + cinfo->in_color_space = JCS_RGB; + + switch (subtype) { + case 1: /* Colormapped image */ + if (source->pixel_size == 1 && cmaptype == 1) + source->get_pixel_rows = get_8bit_row; + else + ERREXIT(cinfo, JERR_TGA_BADPARMS); + TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height); + break; + case 2: /* RGB image */ + switch (source->pixel_size) { + case 2: + source->get_pixel_rows = get_16bit_row; + break; + case 3: + source->get_pixel_rows = get_24bit_row; + break; + case 4: + source->get_pixel_rows = get_32bit_row; + break; + default: + ERREXIT(cinfo, JERR_TGA_BADPARMS); + break; + } + TRACEMS2(cinfo, 1, JTRC_TGA, width, height); + break; + case 3: /* Grayscale image */ + components = 1; + cinfo->in_color_space = JCS_GRAYSCALE; + if (source->pixel_size == 1) + source->get_pixel_rows = get_8bit_gray_row; + else + ERREXIT(cinfo, JERR_TGA_BADPARMS); + TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height); + break; + default: + ERREXIT(cinfo, JERR_TGA_BADPARMS); + break; + } + + if (is_bottom_up) { + /* Create a virtual array to buffer the upside-down image. */ + source->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1); + if (cinfo->progress != NULL) { + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + progress->total_extra_passes++; /* count file input as separate pass */ + } + /* source->pub.buffer will point to the virtual array. */ + source->pub.buffer_height = 1; /* in case anyone looks at it */ + source->pub.get_pixel_rows = preload_image; + } else { + /* Don't need a virtual array, but do need a one-row input buffer. */ + source->whole_image = NULL; + source->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + (JDIMENSION) width * components, (JDIMENSION) 1); + source->pub.buffer_height = 1; + source->pub.get_pixel_rows = source->get_pixel_rows; + } + + while (idlen--) /* Throw away ID field */ + (void) read_byte(source); + + if (maplen > 0) { + if (maplen > 256 || GET_2B(3) != 0) + ERREXIT(cinfo, JERR_TGA_BADCMAP); + /* Allocate space to store the colormap */ + source->colormap = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3); + /* and read it from the file */ + read_colormap(source, (int) maplen, UCH(targaheader[7])); + } else { + if (cmaptype) /* but you promised a cmap! */ + ERREXIT(cinfo, JERR_TGA_BADPARMS); + source->colormap = NULL; + } + + cinfo->input_components = components; + cinfo->data_precision = 8; + cinfo->image_width = width; + cinfo->image_height = height; +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) +{ + /* no work */ +} + + +/* + * The module selection routine for Targa format input. + */ + +GLOBAL(cjpeg_source_ptr) +jinit_read_targa (j_compress_ptr cinfo) +{ + tga_source_ptr source; + + /* Create module interface object */ + source = (tga_source_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(tga_source_struct)); + source->cinfo = cinfo; /* make back link for subroutines */ + /* Fill in method ptrs, except get_pixel_rows which start_input sets */ + source->pub.start_input = start_input_tga; + source->pub.finish_input = finish_input_tga; + + return (cjpeg_source_ptr) source; +} + +#endif /* TARGA_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/stamp-h1 b/thirdparty/LibJPEG/jpeg-9/stamp-h1 new file mode 100644 index 0000000..47553f4 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/stamp-h1 @@ -0,0 +1 @@ +timestamp for jconfig.h diff --git a/thirdparty/LibJPEG/jpeg-9/structure.txt b/thirdparty/LibJPEG/jpeg-9/structure.txt new file mode 100644 index 0000000..44e48ca --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/structure.txt @@ -0,0 +1,941 @@ +IJG JPEG LIBRARY: SYSTEM ARCHITECTURE + +Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. +This file is part of the Independent JPEG Group's software. +For conditions of distribution and use, see the accompanying README file. + + +This file provides an overview of the architecture of the IJG JPEG software; +that is, the functions of the various modules in the system and the interfaces +between modules. For more precise details about any data structure or calling +convention, see the include files and comments in the source code. + +We assume that the reader is already somewhat familiar with the JPEG standard. +The README file includes references for learning about JPEG. The file +libjpeg.txt describes the library from the viewpoint of an application +programmer using the library; it's best to read that file before this one. +Also, the file coderules.txt describes the coding style conventions we use. + +In this document, JPEG-specific terminology follows the JPEG standard: + A "component" means a color channel, e.g., Red or Luminance. + A "sample" is a single component value (i.e., one number in the image data). + A "coefficient" is a frequency coefficient (a DCT transform output number). + A "block" is an array of samples or coefficients. + An "MCU" (minimum coded unit) is an interleaved set of blocks of size + determined by the sampling factors, or a single block in a + noninterleaved scan. +We do not use the terms "pixel" and "sample" interchangeably. When we say +pixel, we mean an element of the full-size image, while a sample is an element +of the downsampled image. Thus the number of samples may vary across +components while the number of pixels does not. (This terminology is not used +rigorously throughout the code, but it is used in places where confusion would +otherwise result.) + + +*** System features *** + +The IJG distribution contains two parts: + * A subroutine library for JPEG compression and decompression. + * cjpeg/djpeg, two sample applications that use the library to transform + JFIF JPEG files to and from several other image formats. +cjpeg/djpeg are of no great intellectual complexity: they merely add a simple +command-line user interface and I/O routines for several uncompressed image +formats. This document concentrates on the library itself. + +We desire the library to be capable of supporting all JPEG baseline, extended +sequential, and progressive DCT processes. The library does not support the +hierarchical or lossless processes defined in the standard. + +Within these limits, any set of compression parameters allowed by the JPEG +spec should be readable for decompression. (We can be more restrictive about +what formats we can generate.) Although the system design allows for all +parameter values, some uncommon settings are not yet implemented and may +never be; nonintegral sampling ratios are the prime example. Furthermore, +we treat 8-bit vs. 12-bit data precision as a compile-time switch, not a +run-time option, because most machines can store 8-bit pixels much more +compactly than 12-bit. + +By itself, the library handles only interchange JPEG datastreams --- in +particular the widely used JFIF file format. The library can be used by +surrounding code to process interchange or abbreviated JPEG datastreams that +are embedded in more complex file formats. (For example, libtiff uses this +library to implement JPEG compression within the TIFF file format.) + +The library includes a substantial amount of code that is not covered by the +JPEG standard but is necessary for typical applications of JPEG. These +functions preprocess the image before JPEG compression or postprocess it after +decompression. They include colorspace conversion, downsampling/upsampling, +and color quantization. This code can be omitted if not needed. + +A wide range of quality vs. speed tradeoffs are possible in JPEG processing, +and even more so in decompression postprocessing. The decompression library +provides multiple implementations that cover most of the useful tradeoffs, +ranging from very-high-quality down to fast-preview operation. On the +compression side we have generally not provided low-quality choices, since +compression is normally less time-critical. It should be understood that the +low-quality modes may not meet the JPEG standard's accuracy requirements; +nonetheless, they are useful for viewers. + + +*** Portability issues *** + +Portability is an essential requirement for the library. The key portability +issues that show up at the level of system architecture are: + +1. Memory usage. We want the code to be able to run on PC-class machines +with limited memory. Images should therefore be processed sequentially (in +strips), to avoid holding the whole image in memory at once. Where a +full-image buffer is necessary, we should be able to use either virtual memory +or temporary files. + +2. Near/far pointer distinction. To run efficiently on 80x86 machines, the +code should distinguish "small" objects (kept in near data space) from +"large" ones (kept in far data space). This is an annoying restriction, but +fortunately it does not impact code quality for less brain-damaged machines, +and the source code clutter turns out to be minimal with sufficient use of +pointer typedefs. + +3. Data precision. We assume that "char" is at least 8 bits, "short" and +"int" at least 16, "long" at least 32. The code will work fine with larger +data sizes, although memory may be used inefficiently in some cases. However, +the JPEG compressed datastream must ultimately appear on external storage as a +sequence of 8-bit bytes if it is to conform to the standard. This may pose a +problem on machines where char is wider than 8 bits. The library represents +compressed data as an array of values of typedef JOCTET. If no data type +exactly 8 bits wide is available, custom data source and data destination +modules must be written to unpack and pack the chosen JOCTET datatype into +8-bit external representation. + + +*** System overview *** + +The compressor and decompressor are each divided into two main sections: +the JPEG compressor or decompressor proper, and the preprocessing or +postprocessing functions. The interface between these two sections is the +image data that the official JPEG spec regards as its input or output: this +data is in the colorspace to be used for compression, and it is downsampled +to the sampling factors to be used. The preprocessing and postprocessing +steps are responsible for converting a normal image representation to or from +this form. (Those few applications that want to deal with YCbCr downsampled +data can skip the preprocessing or postprocessing step.) + +Looking more closely, the compressor library contains the following main +elements: + + Preprocessing: + * Color space conversion (e.g., RGB to YCbCr). + * Edge expansion and downsampling. Optionally, this step can do simple + smoothing --- this is often helpful for low-quality source data. + JPEG proper: + * MCU assembly, DCT, quantization. + * Entropy coding (sequential or progressive, Huffman or arithmetic). + +In addition to these modules we need overall control, marker generation, +and support code (memory management & error handling). There is also a +module responsible for physically writing the output data --- typically +this is just an interface to fwrite(), but some applications may need to +do something else with the data. + +The decompressor library contains the following main elements: + + JPEG proper: + * Entropy decoding (sequential or progressive, Huffman or arithmetic). + * Dequantization, inverse DCT, MCU disassembly. + Postprocessing: + * Upsampling. Optionally, this step may be able to do more general + rescaling of the image. + * Color space conversion (e.g., YCbCr to RGB). This step may also + provide gamma adjustment [ currently it does not ]. + * Optional color quantization (e.g., reduction to 256 colors). + * Optional color precision reduction (e.g., 24-bit to 15-bit color). + [This feature is not currently implemented.] + +We also need overall control, marker parsing, and a data source module. +The support code (memory management & error handling) can be shared with +the compression half of the library. + +There may be several implementations of each of these elements, particularly +in the decompressor, where a wide range of speed/quality tradeoffs is very +useful. It must be understood that some of the best speedups involve +merging adjacent steps in the pipeline. For example, upsampling, color space +conversion, and color quantization might all be done at once when using a +low-quality ordered-dither technique. The system architecture is designed to +allow such merging where appropriate. + + +Note: it is convenient to regard edge expansion (padding to block boundaries) +as a preprocessing/postprocessing function, even though the JPEG spec includes +it in compression/decompression. We do this because downsampling/upsampling +can be simplified a little if they work on padded data: it's not necessary to +have special cases at the right and bottom edges. Therefore the interface +buffer is always an integral number of blocks wide and high, and we expect +compression preprocessing to pad the source data properly. Padding will occur +only to the next block (N-sample) boundary. In an interleaved-scan situation, +additional dummy blocks may be used to fill out MCUs, but the MCU assembly and +disassembly logic will create or discard these blocks internally. (This is +advantageous for speed reasons, since we avoid DCTing the dummy blocks. +It also permits a small reduction in file size, because the compressor can +choose dummy block contents so as to minimize their size in compressed form. +Finally, it makes the interface buffer specification independent of whether +the file is actually interleaved or not.) Applications that wish to deal +directly with the downsampled data must provide similar buffering and padding +for odd-sized images. + + +*** Poor man's object-oriented programming *** + +It should be clear by now that we have a lot of quasi-independent processing +steps, many of which have several possible behaviors. To avoid cluttering the +code with lots of switch statements, we use a simple form of object-style +programming to separate out the different possibilities. + +For example, two different color quantization algorithms could be implemented +as two separate modules that present the same external interface; at runtime, +the calling code will access the proper module indirectly through an "object". + +We can get the limited features we need while staying within portable C. +The basic tool is a function pointer. An "object" is just a struct +containing one or more function pointer fields, each of which corresponds to +a method name in real object-oriented languages. During initialization we +fill in the function pointers with references to whichever module we have +determined we need to use in this run. Then invocation of the module is done +by indirecting through a function pointer; on most machines this is no more +expensive than a switch statement, which would be the only other way of +making the required run-time choice. The really significant benefit, of +course, is keeping the source code clean and well structured. + +We can also arrange to have private storage that varies between different +implementations of the same kind of object. We do this by making all the +module-specific object structs be separately allocated entities, which will +be accessed via pointers in the master compression or decompression struct. +The "public" fields or methods for a given kind of object are specified by +a commonly known struct. But a module's initialization code can allocate +a larger struct that contains the common struct as its first member, plus +additional private fields. With appropriate pointer casting, the module's +internal functions can access these private fields. (For a simple example, +see jdatadst.c, which implements the external interface specified by struct +jpeg_destination_mgr, but adds extra fields.) + +(Of course this would all be a lot easier if we were using C++, but we are +not yet prepared to assume that everyone has a C++ compiler.) + +An important benefit of this scheme is that it is easy to provide multiple +versions of any method, each tuned to a particular case. While a lot of +precalculation might be done to select an optimal implementation of a method, +the cost per invocation is constant. For example, the upsampling step might +have a "generic" method, plus one or more "hardwired" methods for the most +popular sampling factors; the hardwired methods would be faster because they'd +use straight-line code instead of for-loops. The cost to determine which +method to use is paid only once, at startup, and the selection criteria are +hidden from the callers of the method. + +This plan differs a little bit from usual object-oriented structures, in that +only one instance of each object class will exist during execution. The +reason for having the class structure is that on different runs we may create +different instances (choose to execute different modules). You can think of +the term "method" as denoting the common interface presented by a particular +set of interchangeable functions, and "object" as denoting a group of related +methods, or the total shared interface behavior of a group of modules. + + +*** Overall control structure *** + +We previously mentioned the need for overall control logic in the compression +and decompression libraries. In IJG implementations prior to v5, overall +control was mostly provided by "pipeline control" modules, which proved to be +large, unwieldy, and hard to understand. To improve the situation, the +control logic has been subdivided into multiple modules. The control modules +consist of: + +1. Master control for module selection and initialization. This has two +responsibilities: + + 1A. Startup initialization at the beginning of image processing. + The individual processing modules to be used in this run are selected + and given initialization calls. + + 1B. Per-pass control. This determines how many passes will be performed + and calls each active processing module to configure itself + appropriately at the beginning of each pass. End-of-pass processing, + where necessary, is also invoked from the master control module. + + Method selection is partially distributed, in that a particular processing + module may contain several possible implementations of a particular method, + which it will select among when given its initialization call. The master + control code need only be concerned with decisions that affect more than + one module. + +2. Data buffering control. A separate control module exists for each + inter-processing-step data buffer. This module is responsible for + invoking the processing steps that write or read that data buffer. + +Each buffer controller sees the world as follows: + +input data => processing step A => buffer => processing step B => output data + | | | + ------------------ controller ------------------ + +The controller knows the dataflow requirements of steps A and B: how much data +they want to accept in one chunk and how much they output in one chunk. Its +function is to manage its buffer and call A and B at the proper times. + +A data buffer control module may itself be viewed as a processing step by a +higher-level control module; thus the control modules form a binary tree with +elementary processing steps at the leaves of the tree. + +The control modules are objects. A considerable amount of flexibility can +be had by replacing implementations of a control module. For example: +* Merging of adjacent steps in the pipeline is done by replacing a control + module and its pair of processing-step modules with a single processing- + step module. (Hence the possible merges are determined by the tree of + control modules.) +* In some processing modes, a given interstep buffer need only be a "strip" + buffer large enough to accommodate the desired data chunk sizes. In other + modes, a full-image buffer is needed and several passes are required. + The control module determines which kind of buffer is used and manipulates + virtual array buffers as needed. One or both processing steps may be + unaware of the multi-pass behavior. + +In theory, we might be able to make all of the data buffer controllers +interchangeable and provide just one set of implementations for all. In +practice, each one contains considerable special-case processing for its +particular job. The buffer controller concept should be regarded as an +overall system structuring principle, not as a complete description of the +task performed by any one controller. + + +*** Compression object structure *** + +Here is a sketch of the logical structure of the JPEG compression library: + + |-- Colorspace conversion + |-- Preprocessing controller --| + | |-- Downsampling +Main controller --| + | |-- Forward DCT, quantize + |-- Coefficient controller --| + |-- Entropy encoding + +This sketch also describes the flow of control (subroutine calls) during +typical image data processing. Each of the components shown in the diagram is +an "object" which may have several different implementations available. One +or more source code files contain the actual implementation(s) of each object. + +The objects shown above are: + +* Main controller: buffer controller for the subsampled-data buffer, which + holds the preprocessed input data. This controller invokes preprocessing to + fill the subsampled-data buffer, and JPEG compression to empty it. There is + usually no need for a full-image buffer here; a strip buffer is adequate. + +* Preprocessing controller: buffer controller for the downsampling input data + buffer, which lies between colorspace conversion and downsampling. Note + that a unified conversion/downsampling module would probably replace this + controller entirely. + +* Colorspace conversion: converts application image data into the desired + JPEG color space; also changes the data from pixel-interleaved layout to + separate component planes. Processes one pixel row at a time. + +* Downsampling: performs reduction of chroma components as required. + Optionally may perform pixel-level smoothing as well. Processes a "row + group" at a time, where a row group is defined as Vmax pixel rows of each + component before downsampling, and Vk sample rows afterwards (remember Vk + differs across components). Some downsampling or smoothing algorithms may + require context rows above and below the current row group; the + preprocessing controller is responsible for supplying these rows via proper + buffering. The downsampler is responsible for edge expansion at the right + edge (i.e., extending each sample row to a multiple of N samples); but the + preprocessing controller is responsible for vertical edge expansion (i.e., + duplicating the bottom sample row as needed to make a multiple of N rows). + +* Coefficient controller: buffer controller for the DCT-coefficient data. + This controller handles MCU assembly, including insertion of dummy DCT + blocks when needed at the right or bottom edge. When performing + Huffman-code optimization or emitting a multiscan JPEG file, this + controller is responsible for buffering the full image. The equivalent of + one fully interleaved MCU row of subsampled data is processed per call, + even when the JPEG file is noninterleaved. + +* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients. + Works on one or more DCT blocks at a time. (Note: the coefficients are now + emitted in normal array order, which the entropy encoder is expected to + convert to zigzag order as necessary. Prior versions of the IJG code did + the conversion to zigzag order within the quantization step.) + +* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the + coded data to the data destination module. Works on one MCU per call. + For progressive JPEG, the same DCT blocks are fed to the entropy coder + during each pass, and the coder must emit the appropriate subset of + coefficients. + +In addition to the above objects, the compression library includes these +objects: + +* Master control: determines the number of passes required, controls overall + and per-pass initialization of the other modules. + +* Marker writing: generates JPEG markers (except for RSTn, which is emitted + by the entropy encoder when needed). + +* Data destination manager: writes the output JPEG datastream to its final + destination (e.g., a file). The destination manager supplied with the + library knows how to write to a stdio stream or to a memory buffer; + for other behaviors, the surrounding application may provide its own + destination manager. + +* Memory manager: allocates and releases memory, controls virtual arrays + (with backing store management, where required). + +* Error handler: performs formatting and output of error and trace messages; + determines handling of nonfatal errors. The surrounding application may + override some or all of this object's methods to change error handling. + +* Progress monitor: supports output of "percent-done" progress reports. + This object represents an optional callback to the surrounding application: + if wanted, it must be supplied by the application. + +The error handler, destination manager, and progress monitor objects are +defined as separate objects in order to simplify application-specific +customization of the JPEG library. A surrounding application may override +individual methods or supply its own all-new implementation of one of these +objects. The object interfaces for these objects are therefore treated as +part of the application interface of the library, whereas the other objects +are internal to the library. + +The error handler and memory manager are shared by JPEG compression and +decompression; the progress monitor, if used, may be shared as well. + + +*** Decompression object structure *** + +Here is a sketch of the logical structure of the JPEG decompression library: + + |-- Entropy decoding + |-- Coefficient controller --| + | |-- Dequantize, Inverse DCT +Main controller --| + | |-- Upsampling + |-- Postprocessing controller --| |-- Colorspace conversion + |-- Color quantization + |-- Color precision reduction + +As before, this diagram also represents typical control flow. The objects +shown are: + +* Main controller: buffer controller for the subsampled-data buffer, which + holds the output of JPEG decompression proper. This controller's primary + task is to feed the postprocessing procedure. Some upsampling algorithms + may require context rows above and below the current row group; when this + is true, the main controller is responsible for managing its buffer so as + to make context rows available. In the current design, the main buffer is + always a strip buffer; a full-image buffer is never required. + +* Coefficient controller: buffer controller for the DCT-coefficient data. + This controller handles MCU disassembly, including deletion of any dummy + DCT blocks at the right or bottom edge. When reading a multiscan JPEG + file, this controller is responsible for buffering the full image. + (Buffering DCT coefficients, rather than samples, is necessary to support + progressive JPEG.) The equivalent of one fully interleaved MCU row of + subsampled data is processed per call, even when the source JPEG file is + noninterleaved. + +* Entropy decoding: Read coded data from the data source module and perform + Huffman or arithmetic entropy decoding. Works on one MCU per call. + For progressive JPEG decoding, the coefficient controller supplies the prior + coefficients of each MCU (initially all zeroes), which the entropy decoder + modifies in each scan. + +* Dequantization and inverse DCT: like it says. Note that the coefficients + buffered by the coefficient controller have NOT been dequantized; we + merge dequantization and inverse DCT into a single step for speed reasons. + When scaled-down output is asked for, simplified DCT algorithms may be used + that need fewer coefficients and emit fewer samples per DCT block, not the + full 8x8. Works on one DCT block at a time. + +* Postprocessing controller: buffer controller for the color quantization + input buffer, when quantization is in use. (Without quantization, this + controller just calls the upsampler.) For two-pass quantization, this + controller is responsible for buffering the full-image data. + +* Upsampling: restores chroma components to full size. (May support more + general output rescaling, too. Note that if undersized DCT outputs have + been emitted by the DCT module, this module must adjust so that properly + sized outputs are created.) Works on one row group at a time. This module + also calls the color conversion module, so its top level is effectively a + buffer controller for the upsampling->color conversion buffer. However, in + all but the highest-quality operating modes, upsampling and color + conversion are likely to be merged into a single step. + +* Colorspace conversion: convert from JPEG color space to output color space, + and change data layout from separate component planes to pixel-interleaved. + Works on one pixel row at a time. + +* Color quantization: reduce the data to colormapped form, using either an + externally specified colormap or an internally generated one. This module + is not used for full-color output. Works on one pixel row at a time; may + require two passes to generate a color map. Note that the output will + always be a single component representing colormap indexes. In the current + design, the output values are JSAMPLEs, so an 8-bit compilation cannot + quantize to more than 256 colors. This is unlikely to be a problem in + practice. + +* Color reduction: this module handles color precision reduction, e.g., + generating 15-bit color (5 bits/primary) from JPEG's 24-bit output. + Not quite clear yet how this should be handled... should we merge it with + colorspace conversion??? + +Note that some high-speed operating modes might condense the entire +postprocessing sequence to a single module (upsample, color convert, and +quantize in one step). + +In addition to the above objects, the decompression library includes these +objects: + +* Master control: determines the number of passes required, controls overall + and per-pass initialization of the other modules. This is subdivided into + input and output control: jdinput.c controls only input-side processing, + while jdmaster.c handles overall initialization and output-side control. + +* Marker reading: decodes JPEG markers (except for RSTn). + +* Data source manager: supplies the input JPEG datastream. The source + manager supplied with the library knows how to read from a stdio stream + or from a memory buffer; for other behaviors, the surrounding application + may provide its own source manager. + +* Memory manager: same as for compression library. + +* Error handler: same as for compression library. + +* Progress monitor: same as for compression library. + +As with compression, the data source manager, error handler, and progress +monitor are candidates for replacement by a surrounding application. + + +*** Decompression input and output separation *** + +To support efficient incremental display of progressive JPEG files, the +decompressor is divided into two sections that can run independently: + +1. Data input includes marker parsing, entropy decoding, and input into the + coefficient controller's DCT coefficient buffer. Note that this + processing is relatively cheap and fast. + +2. Data output reads from the DCT coefficient buffer and performs the IDCT + and all postprocessing steps. + +For a progressive JPEG file, the data input processing is allowed to get +arbitrarily far ahead of the data output processing. (This occurs only +if the application calls jpeg_consume_input(); otherwise input and output +run in lockstep, since the input section is called only when the output +section needs more data.) In this way the application can avoid making +extra display passes when data is arriving faster than the display pass +can run. Furthermore, it is possible to abort an output pass without +losing anything, since the coefficient buffer is read-only as far as the +output section is concerned. See libjpeg.txt for more detail. + +A full-image coefficient array is only created if the JPEG file has multiple +scans (or if the application specifies buffered-image mode anyway). When +reading a single-scan file, the coefficient controller normally creates only +a one-MCU buffer, so input and output processing must run in lockstep in this +case. jpeg_consume_input() is effectively a no-op in this situation. + +The main impact of dividing the decompressor in this fashion is that we must +be very careful with shared variables in the cinfo data structure. Each +variable that can change during the course of decompression must be +classified as belonging to data input or data output, and each section must +look only at its own variables. For example, the data output section may not +depend on any of the variables that describe the current scan in the JPEG +file, because these may change as the data input section advances into a new +scan. + +The progress monitor is (somewhat arbitrarily) defined to treat input of the +file as one pass when buffered-image mode is not used, and to ignore data +input work completely when buffered-image mode is used. Note that the +library has no reliable way to predict the number of passes when dealing +with a progressive JPEG file, nor can it predict the number of output passes +in buffered-image mode. So the work estimate is inherently bogus anyway. + +No comparable division is currently made in the compression library, because +there isn't any real need for it. + + +*** Data formats *** + +Arrays of pixel sample values use the following data structure: + + typedef something JSAMPLE; a pixel component value, 0..MAXJSAMPLE + typedef JSAMPLE *JSAMPROW; ptr to a row of samples + typedef JSAMPROW *JSAMPARRAY; ptr to a list of rows + typedef JSAMPARRAY *JSAMPIMAGE; ptr to a list of color-component arrays + +The basic element type JSAMPLE will typically be one of unsigned char, +(signed) char, or short. Short will be used if samples wider than 8 bits are +to be supported (this is a compile-time option). Otherwise, unsigned char is +used if possible. If the compiler only supports signed chars, then it is +necessary to mask off the value when reading. Thus, all reads of JSAMPLE +values must be coded as "GETJSAMPLE(value)", where the macro will be defined +as "((value) & 0xFF)" on signed-char machines and "((int) (value))" elsewhere. + +With these conventions, JSAMPLE values can be assumed to be >= 0. This helps +simplify correct rounding during downsampling, etc. The JPEG standard's +specification that sample values run from -128..127 is accommodated by +subtracting 128 from the sample value in the DCT step. Similarly, during +decompression the output of the IDCT step will be immediately shifted back to +0..255. (NB: different values are required when 12-bit samples are in use. +The code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be +defined as 255 and 128 respectively in an 8-bit implementation, and as 4095 +and 2048 in a 12-bit implementation.) + +We use a pointer per row, rather than a two-dimensional JSAMPLE array. This +choice costs only a small amount of memory and has several benefits: +* Code using the data structure doesn't need to know the allocated width of + the rows. This simplifies edge expansion/compression, since we can work + in an array that's wider than the logical picture width. +* Indexing doesn't require multiplication; this is a performance win on many + machines. +* Arrays with more than 64K total elements can be supported even on machines + where malloc() cannot allocate chunks larger than 64K. +* The rows forming a component array may be allocated at different times + without extra copying. This trick allows some speedups in smoothing steps + that need access to the previous and next rows. + +Note that each color component is stored in a separate array; we don't use the +traditional layout in which the components of a pixel are stored together. +This simplifies coding of modules that work on each component independently, +because they don't need to know how many components there are. Furthermore, +we can read or write each component to a temporary file independently, which +is helpful when dealing with noninterleaved JPEG files. + +In general, a specific sample value is accessed by code such as + GETJSAMPLE(image[colorcomponent][row][col]) +where col is measured from the image left edge, but row is measured from the +first sample row currently in memory. Either of the first two indexings can +be precomputed by copying the relevant pointer. + + +Since most image-processing applications prefer to work on images in which +the components of a pixel are stored together, the data passed to or from the +surrounding application uses the traditional convention: a single pixel is +represented by N consecutive JSAMPLE values, and an image row is an array of +(# of color components)*(image width) JSAMPLEs. One or more rows of data can +be represented by a pointer of type JSAMPARRAY in this scheme. This scheme is +converted to component-wise storage inside the JPEG library. (Applications +that want to skip JPEG preprocessing or postprocessing will have to contend +with component-wise storage.) + + +Arrays of DCT-coefficient values use the following data structure: + + typedef short JCOEF; a 16-bit signed integer + typedef JCOEF JBLOCK[DCTSIZE2]; an 8x8 block of coefficients + typedef JBLOCK *JBLOCKROW; ptr to one horizontal row of 8x8 blocks + typedef JBLOCKROW *JBLOCKARRAY; ptr to a list of such rows + typedef JBLOCKARRAY *JBLOCKIMAGE; ptr to a list of color component arrays + +The underlying type is at least a 16-bit signed integer; while "short" is big +enough on all machines of interest, on some machines it is preferable to use +"int" for speed reasons, despite the storage cost. Coefficients are grouped +into 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than +"8" and "64"). + +The contents of a coefficient block may be in either "natural" or zigzagged +order, and may be true values or divided by the quantization coefficients, +depending on where the block is in the processing pipeline. In the current +library, coefficient blocks are kept in natural order everywhere; the entropy +codecs zigzag or dezigzag the data as it is written or read. The blocks +contain quantized coefficients everywhere outside the DCT/IDCT subsystems. +(This latter decision may need to be revisited to support variable +quantization a la JPEG Part 3.) + +Notice that the allocation unit is now a row of 8x8 coefficient blocks, +corresponding to N rows of samples. Otherwise the structure is much the same +as for samples, and for the same reasons. + +On machines where malloc() can't handle a request bigger than 64Kb, this data +structure limits us to rows of less than 512 JBLOCKs, or a picture width of +4000+ pixels. This seems an acceptable restriction. + + +On 80x86 machines, the bottom-level pointer types (JSAMPROW and JBLOCKROW) +must be declared as "far" pointers, but the upper levels can be "near" +(implying that the pointer lists are allocated in the DS segment). +We use a #define symbol FAR, which expands to the "far" keyword when +compiling on 80x86 machines and to nothing elsewhere. + + +*** Suspendable processing *** + +In some applications it is desirable to use the JPEG library as an +incremental, memory-to-memory filter. In this situation the data source or +destination may be a limited-size buffer, and we can't rely on being able to +empty or refill the buffer at arbitrary times. Instead the application would +like to have control return from the library at buffer overflow/underrun, and +then resume compression or decompression at a later time. + +This scenario is supported for simple cases. (For anything more complex, we +recommend that the application "bite the bullet" and develop real multitasking +capability.) The libjpeg.txt file goes into more detail about the usage and +limitations of this capability; here we address the implications for library +structure. + +The essence of the problem is that the entropy codec (coder or decoder) must +be prepared to stop at arbitrary times. In turn, the controllers that call +the entropy codec must be able to stop before having produced or consumed all +the data that they normally would handle in one call. That part is reasonably +straightforward: we make the controller call interfaces include "progress +counters" which indicate the number of data chunks successfully processed, and +we require callers to test the counter rather than just assume all of the data +was processed. + +Rather than trying to restart at an arbitrary point, the current Huffman +codecs are designed to restart at the beginning of the current MCU after a +suspension due to buffer overflow/underrun. At the start of each call, the +codec's internal state is loaded from permanent storage (in the JPEG object +structures) into local variables. On successful completion of the MCU, the +permanent state is updated. (This copying is not very expensive, and may even +lead to *improved* performance if the local variables can be registerized.) +If a suspension occurs, the codec simply returns without updating the state, +thus effectively reverting to the start of the MCU. Note that this implies +leaving some data unprocessed in the source/destination buffer (ie, the +compressed partial MCU). The data source/destination module interfaces are +specified so as to make this possible. This also implies that the data buffer +must be large enough to hold a worst-case compressed MCU; a couple thousand +bytes should be enough. + +In a successive-approximation AC refinement scan, the progressive Huffman +decoder has to be able to undo assignments of newly nonzero coefficients if it +suspends before the MCU is complete, since decoding requires distinguishing +previously-zero and previously-nonzero coefficients. This is a bit tedious +but probably won't have much effect on performance. Other variants of Huffman +decoding need not worry about this, since they will just store the same values +again if forced to repeat the MCU. + +This approach would probably not work for an arithmetic codec, since its +modifiable state is quite large and couldn't be copied cheaply. Instead it +would have to suspend and resume exactly at the point of the buffer end. + +The JPEG marker reader is designed to cope with suspension at an arbitrary +point. It does so by backing up to the start of the marker parameter segment, +so the data buffer must be big enough to hold the largest marker of interest. +Again, a couple KB should be adequate. (A special "skip" convention is used +to bypass COM and APPn markers, so these can be larger than the buffer size +without causing problems; otherwise a 64K buffer would be needed in the worst +case.) + +The JPEG marker writer currently does *not* cope with suspension. +We feel that this is not necessary; it is much easier simply to require +the application to ensure there is enough buffer space before starting. (An +empty 2K buffer is more than sufficient for the header markers; and ensuring +there are a dozen or two bytes available before calling jpeg_finish_compress() +will suffice for the trailer.) This would not work for writing multi-scan +JPEG files, but we simply do not intend to support that capability with +suspension. + + +*** Memory manager services *** + +The JPEG library's memory manager controls allocation and deallocation of +memory, and it manages large "virtual" data arrays on machines where the +operating system does not provide virtual memory. Note that the same +memory manager serves both compression and decompression operations. + +In all cases, allocated objects are tied to a particular compression or +decompression master record, and they will be released when that master +record is destroyed. + +The memory manager does not provide explicit deallocation of objects. +Instead, objects are created in "pools" of free storage, and a whole pool +can be freed at once. This approach helps prevent storage-leak bugs, and +it speeds up operations whenever malloc/free are slow (as they often are). +The pools can be regarded as lifetime identifiers for objects. Two +pools/lifetimes are defined: + * JPOOL_PERMANENT lasts until master record is destroyed + * JPOOL_IMAGE lasts until done with image (JPEG datastream) +Permanent lifetime is used for parameters and tables that should be carried +across from one datastream to another; this includes all application-visible +parameters. Image lifetime is used for everything else. (A third lifetime, +JPOOL_PASS = one processing pass, was originally planned. However it was +dropped as not being worthwhile. The actual usage patterns are such that the +peak memory usage would be about the same anyway; and having per-pass storage +substantially complicates the virtual memory allocation rules --- see below.) + +The memory manager deals with three kinds of object: +1. "Small" objects. Typically these require no more than 10K-20K total. +2. "Large" objects. These may require tens to hundreds of K depending on + image size. Semantically they behave the same as small objects, but we + distinguish them for two reasons: + * On MS-DOS machines, large objects are referenced by FAR pointers, + small objects by NEAR pointers. + * Pool allocation heuristics may differ for large and small objects. + Note that individual "large" objects cannot exceed the size allowed by + type size_t, which may be 64K or less on some machines. +3. "Virtual" objects. These are large 2-D arrays of JSAMPLEs or JBLOCKs + (typically large enough for the entire image being processed). The + memory manager provides stripwise access to these arrays. On machines + without virtual memory, the rest of the array may be swapped out to a + temporary file. + +(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large +objects for the data proper and small objects for the row pointers. For +convenience and speed, the memory manager provides single routines to create +these structures. Similarly, virtual arrays include a small control block +and a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.) + +In the present implementation, virtual arrays are only permitted to have image +lifespan. (Permanent lifespan would not be reasonable, and pass lifespan is +not very useful since a virtual array's raison d'etre is to store data for +multiple passes through the image.) We also expect that only "small" objects +will be given permanent lifespan, though this restriction is not required by +the memory manager. + +In a non-virtual-memory machine, some performance benefit can be gained by +making the in-memory buffers for virtual arrays be as large as possible. +(For small images, the buffers might fit entirely in memory, so blind +swapping would be very wasteful.) The memory manager will adjust the height +of the buffers to fit within a prespecified maximum memory usage. In order +to do this in a reasonably optimal fashion, the manager needs to allocate all +of the virtual arrays at once. Therefore, there isn't a one-step allocation +routine for virtual arrays; instead, there is a "request" routine that simply +allocates the control block, and a "realize" routine (called just once) that +determines space allocation and creates all of the actual buffers. The +realize routine must allow for space occupied by non-virtual large objects. +(We don't bother to factor in the space needed for small objects, on the +grounds that it isn't worth the trouble.) + +To support all this, we establish the following protocol for doing business +with the memory manager: + 1. Modules must request virtual arrays (which may have only image lifespan) + during the initial setup phase, i.e., in their jinit_xxx routines. + 2. All "large" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be + allocated during initial setup. + 3. realize_virt_arrays will be called at the completion of initial setup. + The above conventions ensure that sufficient information is available + for it to choose a good size for virtual array buffers. +Small objects of any lifespan may be allocated at any time. We expect that +the total space used for small objects will be small enough to be negligible +in the realize_virt_arrays computation. + +In a virtual-memory machine, we simply pretend that the available space is +infinite, thus causing realize_virt_arrays to decide that it can allocate all +the virtual arrays as full-size in-memory buffers. The overhead of the +virtual-array access protocol is very small when no swapping occurs. + +A virtual array can be specified to be "pre-zeroed"; when this flag is set, +never-yet-written sections of the array are set to zero before being made +available to the caller. If this flag is not set, never-written sections +of the array contain garbage. (This feature exists primarily because the +equivalent logic would otherwise be needed in jdcoefct.c for progressive +JPEG mode; we may as well make it available for possible other uses.) + +The first write pass on a virtual array is required to occur in top-to-bottom +order; read passes, as well as any write passes after the first one, may +access the array in any order. This restriction exists partly to simplify +the virtual array control logic, and partly because some file systems may not +support seeking beyond the current end-of-file in a temporary file. The main +implication of this restriction is that rearrangement of rows (such as +converting top-to-bottom data order to bottom-to-top) must be handled while +reading data out of the virtual array, not while putting it in. + + +*** Memory manager internal structure *** + +To isolate system dependencies as much as possible, we have broken the +memory manager into two parts. There is a reasonably system-independent +"front end" (jmemmgr.c) and a "back end" that contains only the code +likely to change across systems. All of the memory management methods +outlined above are implemented by the front end. The back end provides +the following routines for use by the front end (none of these routines +are known to the rest of the JPEG code): + +jpeg_mem_init, jpeg_mem_term system-dependent initialization/shutdown + +jpeg_get_small, jpeg_free_small interface to malloc and free library routines + (or their equivalents) + +jpeg_get_large, jpeg_free_large interface to FAR malloc/free in MSDOS machines; + else usually the same as + jpeg_get_small/jpeg_free_small + +jpeg_mem_available estimate available memory + +jpeg_open_backing_store create a backing-store object + +read_backing_store, manipulate a backing-store object +write_backing_store, +close_backing_store + +On some systems there will be more than one type of backing-store object +(specifically, in MS-DOS a backing store file might be an area of extended +memory as well as a disk file). jpeg_open_backing_store is responsible for +choosing how to implement a given object. The read/write/close routines +are method pointers in the structure that describes a given object; this +lets them be different for different object types. + +It may be necessary to ensure that backing store objects are explicitly +released upon abnormal program termination. For example, MS-DOS won't free +extended memory by itself. To support this, we will expect the main program +or surrounding application to arrange to call self_destruct (typically via +jpeg_destroy) upon abnormal termination. This may require a SIGINT signal +handler or equivalent. We don't want to have the back end module install its +own signal handler, because that would pre-empt the surrounding application's +ability to control signal handling. + +The IJG distribution includes several memory manager back end implementations. +Usually the same back end should be suitable for all applications on a given +system, but it is possible for an application to supply its own back end at +need. + + +*** Implications of DNL marker *** + +Some JPEG files may use a DNL marker to postpone definition of the image +height (this would be useful for a fax-like scanner's output, for instance). +In these files the SOF marker claims the image height is 0, and you only +find out the true image height at the end of the first scan. + +We could read these files as follows: +1. Upon seeing zero image height, replace it by 65535 (the maximum allowed). +2. When the DNL is found, update the image height in the global image + descriptor. +This implies that control modules must avoid making copies of the image +height, and must re-test for termination after each MCU row. This would +be easy enough to do. + +In cases where image-size data structures are allocated, this approach will +result in very inefficient use of virtual memory or much-larger-than-necessary +temporary files. This seems acceptable for something that probably won't be a +mainstream usage. People might have to forgo use of memory-hogging options +(such as two-pass color quantization or noninterleaved JPEG files) if they +want efficient conversion of such files. (One could improve efficiency by +demanding a user-supplied upper bound for the height, less than 65536; in most +cases it could be much less.) + +The standard also permits the SOF marker to overestimate the image height, +with a DNL to give the true, smaller height at the end of the first scan. +This would solve the space problems if the overestimate wasn't too great. +However, it implies that you don't even know whether DNL will be used. + +This leads to a couple of very serious objections: +1. Testing for a DNL marker must occur in the inner loop of the decompressor's + Huffman decoder; this implies a speed penalty whether the feature is used + or not. +2. There is no way to hide the last-minute change in image height from an + application using the decoder. Thus *every* application using the IJG + library would suffer a complexity penalty whether it cared about DNL or + not. +We currently do not support DNL because of these problems. + +A different approach is to insist that DNL-using files be preprocessed by a +separate program that reads ahead to the DNL, then goes back and fixes the SOF +marker. This is a much simpler solution and is probably far more efficient. +Even if one wants piped input, buffering the first scan of the JPEG file needs +a lot smaller temp file than is implied by the maximum-height method. For +this approach we'd simply treat DNL as a no-op in the decompressor (at most, +check that it matches the SOF image height). + +We will not worry about making the compressor capable of outputting DNL. +Something similar to the first scheme above could be applied if anyone ever +wants to make that work. diff --git a/thirdparty/LibJPEG/jpeg-9/testimg.bmp b/thirdparty/LibJPEG/jpeg-9/testimg.bmp new file mode 100644 index 0000000..012223e Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/testimg.bmp differ diff --git a/thirdparty/LibJPEG/jpeg-9/testimg.jpg b/thirdparty/LibJPEG/jpeg-9/testimg.jpg new file mode 100644 index 0000000..a026e48 Binary files /dev/null and b/thirdparty/LibJPEG/jpeg-9/testimg.jpg differ diff --git a/thirdparty/LibJPEG/jpeg-9/testimg.ppm b/thirdparty/LibJPEG/jpeg-9/testimg.ppm new file mode 100644 index 0000000..bd78ef8 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/testimg.ppm @@ -0,0 +1,4 @@ +P6 +227 149 +255 +0/-0/-10.21/51.51.62/72.83/83/83/:3-:3-:3-:3-:3-:2/91.91.80-80-91.91.:2/80-80-80-80-80-80-80-80-6.+6.+6.+5-*5-*4,)4,)4,)4,)4,)4,)4,)4,)4,)4,)4,).+$/,%/,%0-&1.'2/(30)30)63,63,74-85.85.96/:70:70A;/B<0D>2F@2IA4JB5KC6KD4MD5MD5MD3NB2OC3OC3PD4QE5T>1Y?2b@4nB5}E6�G8�G9�E7�F9�F9�E8�F;�F>�F?�G@�G@�CN�CL�CL�DK�DI�BF�>B�@�?@�?<�=;�@.�@.�@.�?-�?-�@-�?-�?-�@,�A.�A-�B,�A*�A)�@*�A*�?/�?/�?/�>,�>,�<+�<+�<+�?+�?+�=*�=*�=*�>+�?+�@,�?:�>7�=4�?1�B3�D3�D3�D4�?/�@2�E8�H;�H9mB2T8*D3#:659549547326216005//50-72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-3--5,-4+,4*+4(*7(+=.1E69LUPdUPdUPd0/-0/-10.10.40-51.62/72.83/83/83/:3-:3-:3-:3-:3-91.91.80-80-80-80-91.91.80-80-80-80-80-80-80-80-6.+6.+5-*5-*5-*4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*/,%0-&0-&1.'2/(30)41*41*63,63,74-74-85.96/:70:70@:.A;/C=1E?3H@3IA4JB5JC3LC4LC4KB3MA1MA1NB2OC3PD4P>0U?1^A3jC4xD6�D4�D5�B3�B3�@2�@4�B7�C:�E<�F=�G>�AK�AI�CI�DH�DG�BD�@D�>C�;A�9@�9?�.�>.�>,�=+�<+�<+�>-�>*�>*�=*�=*�>+�?,�@-�@8�>5�>3�?1�A3�D4�D3�C4�A2�B6�E8�I;�G:kA3S9*D4$<66;55:4493382271161.61.72/72/72/61-61-50,50,50,.0-.0-.0-//-//-0/-2.-2.-3--5,-4*+4(*5)+<-0C47I:=h<;vDC�JI�LJ�ST�`h�k{�r��{����|��y��lv�[\�QHsQBkOFaOFaNI_RN_[Yfnot������������������~ojk[]\JVUCXQaXQaXQa/.,/.,0/-10.40-40-51.51.72.72.72.92,92,92,92,92,91.80-7/,7/,7/,7/,80-91.80-80-80-80-80-80-80-80-6.+5-*5-*5-*4,)4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*5-*1.'1.'2/(30)30)41*41*52+63,63,63,74-85.96/96/:70?9-@:.B<0D>2G?4H@3H@3H@3I@1I@1I@1K?1K?/L@0MA1NB2MA1QA2YB2dC2qC3|C2�A2�@0�<+�:+�;,�>0�@4�C8�F=�G>�?E�@F�BG�CF�DF�CE�AD�?D�;@�:?�:@�=@�@@�A=�@;�>7�@-�@-�@-�?,�?,�?-�>,�?,�?-�@-�@,�A+�A,�@*�A*�@)�?/�>.�>.�>.�=+�=+�=+�<+�=,�=,�<+�=)�>*�>*�?+�@,�B7�?5�>3�>2�A4�C5�D5�C4�D6�F9�I=�I=�F;gA4P:,B6&=77=77<66:4493383072/72/62/62/62/52-52-41,41,41,,1-,1-.0-.0-//-//-0/-2.-5//4..5,-4*+4*+9-/>24C79_83l?:|E@�IB�NK�Z^�ft�n��w��~�z��s�dm�UU�NEtO?lMBbPEcQHcMH^NK\[[estx��������������|xzlghXZ[KVTEZT`ZT`ZT`.-+/.,/.,0/-10.40-40-40-51.61-61-61-81+81+81+81+50-50-4/,4/,4/,4/,50-50-61.61.61.61.61.61.61.61.3.+3.+3.+2-*2-*2-*1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,30+30+30+41,41,52-52-52-52-52-63.74/850850961961>8,?9-@:.B<0E=2E=2F>1F>1G=1G>/F=.I=/I=/J>0L@0L@0JD4NE4TD4^D3hE2sB1~A/�>-�9'�9'�9)�<-�@3�E8�I<�J>�@C�AC�CE�DE�CD�AC�@C�>A�;@�:?�:>�=@�A?�B=�A7�>5�@,�@,�@,�?-�>,�>,�?,�>-�?-�?,�@-�@,�@+�@*�@)�@(�>.�>.�>.�=-�=-�=-�<*�<*�=+�=+�<*�<*�=+�=,�>-�>-�B6�?5�?2�@2�B4�C6�B5�B5�F:�H>�K@�J@|F:aA4K;.?9+@86@86?75>64:5294183073062/62/62/32.32-21,21,21,-2.-2.-2./1./1.00.00.10.5106005//5,-4+,6,-:01>45W6-b<3qA7}D9�H@�RQ�_i�i��s�|z�u~�my�^g�RQ�MDyM?rN@dPEgQFfLC^GBVNLZ^^fjnquzvx}vz�vwzokoa`bUWYKTUG]V^]V^]V^.-+.-+.-+/.,0/-10.3/,40-3/,4/+4/+4/+4/+6/)6/)6/)4/,4/,3.+3.+3.+3.+4/,4/,50-50-50-50-50-50-50-50-3.+3.+2-*2-*2-*1,)1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,41,41,41,41,41,52-52-52-52-52-63.63.74/850961961<5+=6,?8.@9/B:/C;0C;0C;.D:.D:.D:.G;-H<.I=/J>0K?1GH6KH7PG6XG5aF3jD1uB/|?,�;)�:'�;(�=,�B2�G7�K<�M>�DB�DC�DB�EB�C@�@@�>>�:>�:=�9<�;>�?>�B>�C:�A5�?0�@-�?,�?,�?,�>+�>+�>-�?-�?,�?-�?,�?+�?*�?+�?*�>)�?.�?.�>-�>-�>-�=,�=,�=,�=,�=,�=,�=,�<,�=-�>.�>.�B4�A4�@1�@3�B5�C7�A8�@7�B;�G?�KC�J@uE;Y>3C9-78*@86@86?75>64=53:5294173062/43/43/32.23.12-12,12,,2.-2.-2.-2./1./1.00.00.3205105104..2,,4+,7./901P5*Y9,e>/n@1tB7|KG�Yc�g~p�xx�s{�js�]e�TT�OG�LAyPAjPAhMAeJA`GBYHEXKKWMPU^bc`fbcha`f\Z`TWZOUYKWYL`WZ`WZ`WZ,,,,,,---.-+/.,0/-10.3/,2.+2.+3.*3.*3.*3.*3.*3.*3.+3.+2-*1,)1,)2-*3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+2-*2-*2-*2-*1,)1,)1,)0+(3.+3.+3.+3.+3.+3.+3.+3.+41,41,41,41,41,41,41,41,41,52-52-63.74/850850850;4*<5+=6,>7-@7.A8/A9.A9.C9/C9-C9-F:.G;/H<.J>0K?1FI8GH6MH5TG6[F3dC0lA.t?-{<*�;)�;*�=,�A1�F5�J:�M=�E@�FA�FA�E@�C?�@>�==�9<�:<�9;�;=�?=�B=�D8�A2�>,�@,�@,�?+�>-�>-�>,�>,�>.�>-�?,�?,�>,�?+�>*�>)�?)�>-�>-�>-�>-�=,�=,�=,�<+�=,�<+�<+�<+�<+�=.�>/�?0�C2�A2�@2�A5�B9�C:�@:�@9�@9�H@�NG�NEoG=R@4?;039-A75A75@64>63<4194083/74/63.43.34/23.13.02-02-02--3/-3/-3/.3/.3/02/02/11/11/32032040/2.-1-,4..5//H4)M5)X8+a<,f>2nGBzYb�l��u�{|�u|�mu�bi�[[�SL�LB�QAnN?jI=cH>`HB^FCX@BO2K?3DG6EF6KE5PD4VC2^C2e@.m>,v=,|;)�:)�;*�=.�B2�F7�I:�D<�F>�G>�F>�E>�C?�@>�<>�9:�9:�;<�@<�B;�D6�A/�=)�@-�@-�@-�?,�?,�>.�=-�>-�>,�?.�?-�?,�>,�>*�?*�>)�>-�>-�>-�=,�=,�=,�<-�<-�<-�<-�<,�<,�=-�=0�=0�>1�D2�C1�A3�B6�C:�A<�B=�B=�EA�PJ�XP�ZOqSIVI@BD97A6A83@72?61=60<4194083/63.43.43.34.13.13.02-.3-.3--3/-3/-3/.3/.3/.3/02/02/00.11/22021/0/-/.,2.-3/.?0)C1'K3'T8,Z<2dGCw]h�s�������|��sz�kq�ed�VS�JC�N>kK5.>5.>5.>5,B8/B8/C9/E8/G:1I<3J=4K?3EC6FB6IC5NB4TA3\@2b>0h=-q<.w9*}8)�7*�:,�=/�B2�D5�E9�F;�G<�H=�H>�F@�C?�@@�:9�:9�=;�A;�D:�E4�A-�?(�A-�A-�@.�@.�?.�>-�?-�>/�>.�@.�?.�?-�>+�?*�>)�>+�>-�>-�>-�=,�=.�=-�=-�=-�1�?2�D2�C1�B4�B6�C;�C>�C>�D?�PJ�[T�e\�f]s_TYUJFNC>KA@70@72>71=6094.83-63,63.43.34.34.13.13..3-.3-.3--3/-3/-3/.3/.3/.3/.3/02/.0-00.22022000.0/-0/-10.8,,;,)B1*K7.S<4^IHtbn�z������ʂ��y��rw�ik�XV�GD�I^C@[ABV>DP>EMGQSKWUQ^WU`XS_UR^TT^SV`UaZHaZHaZH,-/,-/------------.-+.-+/.,/.,1-*0,)0,)0,)/+(0+'/+*/+*/+*/+*/+*/+*/+*0,+/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,2.-1-,1-,1-,1-,1-,1-,1-,1-,0,)1-*2.+3/,3/,3/,3/,3/,3/,3/,3/,3/,40-51.62/73081+92,:3-;4.=4/>5.>5.>5.?4.?5,@6-C6.D7.F90G:1H;2F?5H@5J@6N@5R>3W<1\:0a7+k9.t8-|8+�9,�;/�=0�?1�?2�@3�B5�D8�E:�G=�F>�D?�B>�?=�A?�D?�E>�C8�C1�B.�B,�A.�@-�?,�?,�=-�=-�>.�?.�<,�=,�=+�>-�=,�=+�=*�>*�<+�<+�<+�<,�<,�<,�;-�;-�=/��F@�C>�DA�KG�XR�f]�qf�th|rfik^S_SCSHQJBLE=D=5<8/95,74-63,33+43.34.23-13.02--2,,1+,1+-2.-2.-2.-2.-2.-2./1./1.02/02/11/11/11/11/11/11/5*2;/3A32C4/J;6]OOymy��������Ӑ�݂��tz�jn�_b�YZ�PHmHBdA>]>>X?AVBHVLU^U`bbqnn}xv�|p�ulyoguh_k_T`Ta[Eb\Fc]G,-/,-/,-/,-/---------.-+/.,.-+.-+0,)/+(/+(/+(/+(.*).*).*).*)/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+0,+1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,0,)0,)1-*2.+3/,3/,2.+2.+2.+2.+2.+2.+3/,40-51.62/80-91.:2/;30=4/>50>50=4-?4.?4.?4.B5-C6.E80G:2H;3H>5J=5L=6O>6Q=4V;2Z90_7/h8.p7.y6-�8-�9.�;1�<1�>1�@3�A5�B5�E8�E:�F<�E=�C=�C?�D@�F@�F>�F8�C2�B/�C-�B0�A/�@.�?-�?-�>-�>.�>.�=,�=.�=-�=,�=+�>-�=,�>,�=+�=+�<,�<,�<,�;-�;-�<-�4�@6�A7�B8�H7�F7�G:�I@�HB�FA�JF�TM�dZ�re�~o�p~|mlteYgZJZOPLAKI=EC7@>2=:1:7.44*11)23+23-12,/1,/1,.0+.0+.0-/1./1./1./1./1./1./1./1.02/11/11/11/11/11/11/11/5*:9-9<15?53H?:^VTxsz��������ΐ�ׄ��x��py�kt�en�__yXZsSUjRWjU]j\gmguvr�v�������}��v�yp�sfteXfW_YA`ZBb\D,-/,-/,-/,-/,-/---------.-+.-+.-+-,*/+(.*'.*'.*'.*+.*+.*+.*+-)*-)*-)*-)*/+,/+,/+,/+,/+,/+,/+,/+,.*+.*+/+,/+,/+,0,-0,-0,-0,-0,-0,-1-.1-.1-.1-.1-.0,+0,+1-,2.-2.-2.-2.-1-,1-,1-,1-,1-,2.-3/.40/51080-91.:2/;30=31=31=4/=4/?40?4.?4.A4.C60D7/F91G:2H;5J;6K<7N=6P;6S:5V72[60c60k6.t5,}7/�9/�:0�<0�<1�@3�@4�@3�A3�C6�C8�D:�C<�F>�G@�HB�H?�E:�C3�B0�B.�B/�A.�@-�>-�>-�>-�>-�?0�<-�=-�=,�=.�>-�=,�=+�=+�<*�<,�<,�;+�;+�<-�;,�;-�<0�<0�<2�>3�?4�A8�C:�D;�K<�H;�H>�JD�IF�KG�SM�_V�rg��q��z��{��wr�ocqbVdWPQCMN@HI;DD8@@4::055+/0(01)01+/0*/0+./*./*//-//-//-//-//-//-//-//-//-//-00.00.00.00.00.00.00.00.6*>6+;8.6;63HE>_^Yyz|��������Î�˄��}��{��|��|����y��q~�o|�n}�o��y��������������������|�{j{iXiW\V<^X>`Z@-.0-.0-.0-.0-.0-.0......---.-+-,*-,*,+).*'.*'.*',*++)*+)*+)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+-+,-+,-+,-+,.,-.,-.,-.,-/-./-./-./+*0,+1-,1-,1-,1-,0,+0,+0,+0,+0,+0,+1-,2.-3/.40/91/:20;31<42=31=31=31=31>3/>3/>3/@3-A4.C60D71E82G83H94I:5L:6M:6N94Q83T50^72e60o6/x8/�90�:/�;1�=1�?4�?4�?2�@1�A2�C5�D7�D:�F<�G>�IA�H>�F:�C4�B0�B.�A.�A.�?-�>,�>,�=.�=.�=.�<,�<.�=.�=-�<.�=-�=-�<,�;)�;+�;+�;+�;,�;,�;-�:,�;/�<1�<1�>5�@7�C:�E<�F=�M>�I<�H>�IC�LG�PL�\T�j^��o��y���������z�ym{lam_UYHQUDKO@EI:@D6;=057,13(01)/0*/.).-).-).-+/.,0/-/.,/.,/.,/.,/.,/.,/.,/.,0/-0/-0/-0/-0/-0/-0/-0/-8*A6):3-1961HJ=bfX{�y������������������������������������������}������������������������~k|iUfSXT7ZV9^Z=+/2+/2-.0-.0-.0-.0-.0...------.-+-,*-,*,+),+),+),*+,*+,*++)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*+)*,*+-+,-+,.,-.,-/-./-./-./+*0,+0,+0,+0,+0,+/+*.*)/+*/+*/+*/+*0,+1-,3/.40/91/:20;31<42=32=32<20<20=20=2.=2.?1.@2/A4.B5/C60D63C84D95G96G96H94K84N51V72_60h70r7/}:1�<1�=2�>2�?7�?5�?5�?3�A3�C5�D6�E8�E;�F=�G>�F=�D8�B5�@0�@/�A-�A-�?,�>+�<,�<,�=-�=/�<.�<-�=-�<.�<-�<,�<,�<,�;+�:*�:*�:*�:+�:+�:,�:.;0�<1�=4?6�B9�D;�G@�HA�LA�H?�HA�KG�OL�WQ�f]�wh��w������������|�}t�qlte\eRV_LMVCEL0-?1.@2/A30A30?61@72@93A96A96B94E74G51O61W6/a6/j8/u9.�0�>7�>5�?5�@4�B4�C4�C4�D4�B5�C8�E:�E;�C7�@4�?1�?2�A,�?-�=,�=,�<+�<+�<.�<.�;-�E5:@29<134,22*1.)/+(/*'0**3*+4+,1++1++1++1++1++1++1++0,+1-,1-,1-,1-,1-,1-,1-,/.,;(;5(23+(56$CL-\hDt�`��w�������������������Ƥ�Ш�ɯ�ʰ�˯�ɪ��������������������������{w�rdx]MaHQQ5QQ5RR6,03,03,03,03./1./1./1./1/////////0/-/.,/.,.-+.-+/-..,-.,--+,,*++)*+)**()+)*+)*+)*+)*+)*+)*+)*+)*+)*+)*+)**()*()*())'()'(+)*+)*,*+-+,.,-.,-/-./-./+*/+*/+*/+*/+*.*)-)(,('0,+0,+0,+0,+1-,2.-40/40/:12;23;23<34=32<21<21;10<1/<1/<1/=/,>0->0-?1.@2/;60;62;83<94=:5=:5?82A60F5.O4-W5+b6+n8,x:-<,�<.�:6�<5�=5�@4�A4�B3�B2�@0�?1�@4�B7�B9�@6�?5�=2�?2�@-�?-�>,�<+�;*�;,�;-�;-�;,�<.�;-�<-�;.�;-�;,�;,�9)�9)�9)�9*�9*�9+~8,}9,=1�=4�@7�B9�E>�HC�KF�MH�IA�GA�JF�SO�\X�h`�{n��y�����������~������w{nixacr[ZhQP]IIUACL;>D60-?1.?1.96/:729839839:4:94;83>71A2+I2*S2)^4(j6)s8*|:*~;+�84�:5�=4�@3�B3�A1�@/�>-�<-�=0�@4�A7�@7�>4�=4�=3�@-�?,�=+�<*�;*�;,�;,�<-�;.�<.�;-�;,�:-�;-�;,�;,�9)�9)�9(�9*�9*�8*~8,}9,�>2?5�@7�C<�G?�ID�MG�OI�IC�HD�MJ�UT�a^�ng��s������������|��|������y�ql{dgv__nWXeQP\HIRAAG9=@579.66.41,1,)1)'2()3)*4*+2)*2)*2)*2)*2)*2)*2)*0**1++1++1++0,+0,+0,+0,+0,+:&27(+4."47=HRb1l~J��b��r��|�����~��{����ƅ�΅�ɢ�ɟ�Ȟ�×�������������~������~�vu�ml�dZnRG[?IL/GJ-DG*/0*/0*/0*01+01+01+21,21,32-63.63.63.52-50,4/+4/+8.,7/,6.+5-+4,*2-*1++0,-0,-.,/--/-,1,+0*+/)*.()./(0/(//(//(//(//)-.)-.*+/+,-,*-,(.-).-)-.(./)./)--/--/---.../-.0/-2.+3.+2-)4,)5.(7.)8/(;0*;1(<2)<5+=4+>5.>5.>5.=4-<3.<1-=2.<1-<1/;0.=/.>0/>0/?11H-&C1';5)2:++=-(=.-;.45-?-+H()R%(X((Z.+Z8.[A2\G6wC-{B.�C1�A3�?1�;0�:/�8+�;-�>.�B1�D0�D0�B.�?,�<*�63�83�:2�<1�@1B0|A/|A/�C2�A1�>1�=0�;/�:.�9-�9-v:/|@5u=0n9)s@/s@/t<+{@0{<-�?4�D9�H?�LA�NB�QC�RC�HK�TR�d]�ue{�lw�sz�|������������������y��k�{a�wh�ea�]\zV[sS]mR[cLVTEPH=J;6G53B,/=&,:#+:#-9#/8".#/-#-,$-,&*+))+-(.1'/2'/4'06&14'14'13'32(32(30(3.)-0,-0,)//'=>0WZErx\�g��s��p��q��r��r��s��{�����������������{��z��{��~��}�����|z�vr�oi{e[jWLZIKO@CG8>B3/0*01+01+01+12,12,21,32-43.63.74/74/63.61-50,50,7/,7/,6.+6.,5-+2-*1++0,+0,-/-./-0--/-,1+*/)*.()-/(//(//(//(//)-/)-.*+.*+/+*-,*.-).-)/.*./)./)./)..0....../-./.,/.,1-*3.+3.*5.(6/)8/(90);0*<2)=3*>5,>5,>5.>5.>5.=4-<3,=2.=2.<1-;0.;0.;0.=/.>0/?10F/'D0)A3*=4+96-85.83-<1-?-+D*)K)(P*'U.)[4-_:1c?3s@+xA-�A0�?2�?4�;3�:1�;1�9.�<-�>.�A0�B1�B/�A/�@/�93�:3�;2�=1�?0�@0@/�?/�A1�>0�=0�;/�;.�:-�:,�:,w9.x<1s9-n9)r?.s>.q9*u:,}=1�@5�E:�H?�K@�MB�PC�QC�DJ�QR�d]�vf��p}�w~����������������������w�}o�xa�g\�`V�ZU}XWyXWpSPbJKVECI;@A998340-0,+/+,.)--(,*,+)+***,+),-(,/)-2(03(03(02(02(10)1/*1-*1,+3,+32-12./0,)--%9:,TWBox[��i��o��l��n��p��p��p��w��������������{��x��w��y��|��|���{x�uq�nh{eYjWL[HGK<@D5:>/12,12,12,12,23-23-43.43.54/74/85085085083/72.61-80-80-7/,6.,6.,3.+2,,1-,1-./-.0.1..0--/,+0+*/*).1'//(//(//)-/)-/)-.*+.*+0,+0,+/.*/.*/.*0/*/0*/0*/////////0./0/-1-,1-*2-)4/+70*90+:1*<1+=3*>4+?5,?6-?6-@7.@70?6/>5.=4->3/=2.<1-;0.;0.;0.;0.<1/=20C2*E0+H/+L,-N+/M*.J*/E+.A-,@.*@/(C/(M/'Y0*d1-j30i;+o;-w;0�=4�<4�;5�94�:4�;2�=2�>2�@1�A2�A3�B5�C6�=2�=1�>1�>0�>/�=.�=.�=.�<.�;.�:-�9,�;,�;+~=+z=*}=3z<1v:/u;-x@1x@1v<.v;-?3�B6�F=�H?�JA�KA�NC�PD�DH�QQ�c^�ug��n��t~�}�������������������������{a�k[�eX�aV�`W�`W]QtVMiPC[E=RA6F9/<2*5-&1+%.)$-(1&*1&*1&*1&*1&*1(-2).1+//*0-+0,+0+,0),1(-1&.1&.14.24.0.*'**"66*PUAmv[~�i��k~�h�j��n��n~�m��q��x��|��z��w��v��t��u�w��y�y��}}�yw�sp�mh{eYkUL[HEG:=?28:-23-23-34.34.34.45/54/54/650961961:72:72:51940940:2/91.91.80-7/-4/,4/,3/.3/.3/01/01/00.1..0--/,,.2).2).2).0*.0*,0*,0*,/+*1-,1-*0/+0/+10+10+10+10+11111100010.10.2.+2.+3.*91.92,;2+<3,>4+@6-@6-A7.A8/A8/B90A8/A81@70>5.?4.=2.=2.<1-;0.;0.<1/=20=20?5,E2.O-.W(0]#/\"0W#/L'.C/.:3-55);5)E1(U.'c+*l*+e;/j;1s=3}<6�;8�;9�;7�:6�>9�?9�B9�C9�B9�B9�A9�@7�B/�B/�@.�@.�>-�<,�:+�9+�8*�8*�9*�9)�<)z=(w?(t@(�=3{7,x8,z3/>3/=2.=2.=20=20>31>31>7/C41O/2Y*2_%3`#2Y%1N+1B3077-39+68*?5)N1)]-)e+)c;3h<3r=7z=:�<<�<=�;;�;:�;9>8�A:C;�C<�B<�@9�?8E/�D/�C.�@-�=,�<,�9+�9+�6)�7)�9)�;)~=)w?(sA(qB(�6/|/'�8/�?4w5)s5*}A6}C7E9�G<�I>�J?�K@�LD�OG�SJycL~hS�oY�u]�}b��i��u��|�~|��~���������|�}{�y�n}�ly�lw�kw�mt�jo�gl~dbqZ[hTSZHIK=B@4=6,8/&5+":&(8%'6&'2&&0(&-)(++)).*'+*&,*&,*'+*'+,)*,**,**,-#$2*(50,85,BC5UZFfpWn}^t�cq�bt�ex�iw�ks�hs�iw�mz�mx�lw�kv�ly�q{�u{�w|�wx�uz�ww�tq�om�hd{_WkPJ^CFB9>:195,560560671671782782872872983<94=:5>;6>;6?:6>95>95?74?74>63=52;62:5294194184184195484373243132021/6-.6-.6-.6-.6-.4..4/,4/,40-40-40-52-32-32-43.43.431431542540841850940:5/=60?6/@7.B8/C9/F90G:1H;2F<3F<3F<3F<3E;2C90B71A60@5/@51>50=4/=4/>42?53?53=82A64I35Q16V.6U-5R/5J22A62::08<.9;-?9)H6*P4)U3)]2+c4.k62t76}77�89�79�78}75{:6|=8{?7@9�@:�@;�?;|E0}D0�C0�A/�=.�;-�:-�9,�8+�9+�:+<+{>+x?+uA+tB+�2,�2,�LE�XQ�A8|90�F;�J>yH:zJ<{M@|NA~NB�PE�UJ�YN_uNgwRtzX�{^�|b��i��s��|��z��|����|��x�~t�yq�v��p��o��n��p��p}�px�ms�kk~bgu\_iQWZGPM0%:,+7,*5+)1,(-,'+.').((/().(+-*,,*/+*3)*6',7&,9&,2)$<3,E>4JF:QR@]bLgqVizXm�]j�\j�]p�bq�eo�do�er�hu�kr�hq�it�lx�rz�vy�vy�vv�tw�tu�ro�kj�fc|^UlOJ^BHA9@91;4,671782782782893893983:94:94=:5>;6?<7?<7@;7@;7@;7B:7B:7A96@85=84=84<73<73<74<74<74;74:6395284173080.80.80.80.80.80.61.61.61-52-52-52-63.63.54/54/540540651952:72=84=82@93?80A8/C90D:0E;1H;2I=1I=1H>4H>4H>4G=4F<3D:1B8/A60B71@70@72?61?61@72@72A83=84@85B86D97E:8G96G96E:4C90B90B:/B:-D;,F:*H;*H;*].&b0)n3/x73�98�;;�<<�>;�A>�A<?6}=4~;3�;5�=8�>:~C3�B3�A2�?2�=1�<0�;/�;/;.|=.{=.|>/|>/|>/}>/}>/�.*�;8�kf�~y�ZT�C<�LAN@tJ:qM=pQ?qR@tSB{VD�[J�_OUOe�Uz~[�y_�ra�of�rk�xo��v��z��~��������~}�yy�v��r��r��r��r��t|�sv�ps�pl�ig�eby\\lQU_GMP;ED0A<)>3-<3,92*41(01).1(+1'+0)/0*2/*6,*:*+@'+D%+G$+H#+A7+LC4WP@[XE`bLgmQiwVj{Wl�[g�Wf�Wj�^n�an�an�br�fr�ko�hn�iq�nw�sy�vx�uu�ts�su�ts�pn�li�cb{[TmMH`@MD=E<5@707827828938938939:4:94:94;:5>;6?<7@=8@=8A<8A<8A<8A<8A<8A<8@;7?:6>95>95=84>95>95>95>95=84<73:51940:0.:0.:0.91.91.91.91.72.61-61-63.63.63.74/74/74/540651961;83<94?:4@;5B;3A8/B90C9/E;1H<0I=1J>2K=2K>5K>5J=4J=4F<3E;2C90B8/B92B92A81@72@72@93A:4A:4?74>95=<7>?7?@8@@6D@5J=4J70N5.Q6-Q6+O8*M:+I<)H=)l3(r6,~;3�@:�DA�HD�JG�LH�QJ�MD�D;�;2�8-�7-�91�;4�?7�?7�=6�<5�=5�=4|>3y?3vA3uA3uA3y?3}=3�:3�83�73�%$�<;�{z����hc�G@�K@wI:mNfW@jX@r\E}aL�eQj{O{{U�w\�l`�^_�R\�M[�O^�mu�xx΅~��������}��x��u��r��r��u��u��u��s{�sx�rq�lp�hi�adtW]gLVX@LJ3GB.L40H3.D3,?2*:1(70&40'40'81):/+?-+C++H(+M%-O$-Q#-PE1[P:d^FgfJilOnuTm{Wl~Vk�Zg�Vg�Vm�]p�ap�br�dv�hr�lo�km�ip�mw�ty�xw�wt�us�tu�ts�qo�ki�cb{[TmMGa>SJCKB;F=69:49:49:49:49:4:;5=<7=<7=<7?<7@=8@=8A>9C>:D?;D?;E@8C>8D=7B;5B;5B;5B;5B;5B;5A:4A:4A83A83A83@72@72>71>71>71<71<71;60:5/85085074/74/761961961:72<71=82A:2B;1C:1E;1F<2J>2K?3L@2N@3N@3M@7M@7L?6K>5I<3F<2E;2E;2B90A81A81?80?80?82@93@93<5/LE?IB:E<5OB:K:2J3+\>6Z5-`5.`4+^/'\0%b8,g@1gB2�I;�G;�I?�LA�F>�>7�=6�D;�ND�QE�VH�YK�PB�@5�:0�=4�9;�9:�67�54�96�@:{@8o?3oC6lB4m?2u:2�74�35�-3�(1�EE�ba�ED�WU�yv�VO�F<�WGlS=f\CedFgfHgbEm_DyeL�nV�dK�p]�ph�W]�8K�(D�&H�+L�d02b22\31L)'D'#I2,J70F5.E2,E0+H0.I-,I)*O+-V24VK/`W:f_BgdEkoLu}Xu�]o�Wj�Wl�Xn�]q�`s�bu�bu�dv�eq�ks�ms�oq�os�rw�xz�zy�zx�yq�rm�jj�gh�dazZTnKIc@TKBSJAPG>9:49:49:49:4:;5;<6>=8?>9>=8@=8A>9A>9B?:D?;D?;D?;FA;E@:E@:E@:D?9D?9E>8E>8E>8E>6E>6D=5C<4D;4D;4C:3B92B92B92B92A81A81@91@93>71<71;60;60:5/85.74-74-96196/96/;60<8/>:1A:0C:1C;0E;1G=1J>0L@2M?2NA1NA1N@5N@5M?6J=4I<3H;2E;1E;2C:1B90A81@91@91@91?;2?;2C:3G81I0,V..j68u99{;;�EC�D?�H@�I?�G>�JA�NH�PL�MK�E3�C2�B4�B6�>3�6-�7+�<0�C5�@.�@.�E3�F6�E5�H9�N@�KR�GN�@F�9=�8:�?<�A:r@5k?2uK=�NC�@:�,-�(0�8F�K\�JI�MM�>=�>?�_\�XQ�@5�UDvbJa]@Z_?ekIonOshJ{fK�kP�]V�][�SZ�7SD=]P.dY9ga?ifCnrMz�[z�bt�^r�]o�]o�^q�^u�bw�cw�cw�cr�mw�rz�vy�w~�}������������z�|q�ql�jh�c`yYTnKJdAWQEVPDUOC8938938939:4;<6<=7?>9@?:@?:B?:C@;C@;C@;D?;D?;D?;FA;FA;FA;E@:E@:G@:G@8F?7IB:HA9H?8G>5F=4E<3E<3D;2D:1D:1D:1C:1D;2D;4D;4C<4?80?80<71;60:5/:5/94.94.96/96/96/;7.<8/@9/A:0C;0E;1F<0I=/K?1M@0M@0NA1M@0N@5M?4L>3K=2I<3H;2E;1D:0C:1C:1A:0A:2?;2@<3@<3A=4SE�I?�MA�OB�RJ�SR�NS�EN�E2�B0�@0�?1�:-�7*�8+�=/�E4�>+�7$�:%�>+�@/�B2�C5�/8�9B�DL�KR�NR�LL�B>}:1u;/q9,s5*�2-�47�8@?:A@;BA4G=3F<2E;1D:0D:0E;1E;1D;2E<3E<3E<3@91?80?80<71;60:5/:5/:5/96/96-;7.;7.=9.@9/C;0D<1F<0F=.J>0L?/M@0M@0O?/O?/O>4O>4N=3K=2J<1G:1G:1D:0D;2D;2B;1B;1@<3A=4A>5A>5Q9/X+&�:?�P`�Oe�Of�Pc�GO�20�:/�?.�C3�F=�FG�>H�2B�H6�F5�B3�@3�?1�>1�B4�D6�G5�B/�<)�;&�<(�:(�5&�3$�7<�8>�7>�6=�9@?:BA4G=1H<0G;/E;/E;/E;/E;1E;1D<1D;2D;2@9/@91@91?82<71;60;60:5/;7.;7.;7.<8-?8.A;/C;0D4N=3N=3J<1I;0G;/F90D:0D<1D;2B;1@<1A=2A>5B?6C@7_4-t42�KS�Yi�H_�:Q�2C�#+�/)�9(�;&�=)�@3�A=�:?�0;�D4�B3�?2�>2�?5�C7�G;�J<�>/�?-�=+�:)�9'�:*�;-��LD�TL�TN�KJ�>C�3>�.<�5+�7.�0+�94�82�@9�[P�UDxO9~dI�lP�bF�]F�eT�qd�sj�b�?e�Ai�Bk�Bm�Am�@o�@o�@q�Aq�Bn�=h�Em�Jp�Gh�Mi�Zr�bs�Yc�@D]($M-"PC2PR=CO76H.WH1eYCujT�{g��y�����������~����������������������������������þ�����þ�����������y�vh{e\sWTmONiHTYBUZCW\E560560671782893:;5=<7>=8@?:B?:C@;DAGB>GD=GD=HC=ID>IE0I=/G>/G>/F<0F<0E;/E;1D<1C:1B90A:2@91@91?82<71;60;60;7.;7.;7,<8-?8.A;/D0K?/M@0NA0P@0O?/O@-P>2N>1M<2L;1I;0H:/F90C9/C;0B<0B;1@<1A=2A?3B@4C@7t50�FE�Y_�Ub�@Q�5F�0;�*+�1%�9#�;!�: �=&�=.�90�2-�:,�:-�9-�6,�91�A9�E;�E:�?2�@0�<,�6'�6)�=0�D9�G=�9*�@4�D=�A@�D�<@�?>�C>�JB�RM�ZW�PR�EL�;G�6F�2D�/B�1G�6L�:T�:T�:T�:W�=\�?a�Be�Di�h�?j�Am�@n�?o�>m�=m�Fn�:a�>d�In�Jl�Mm�So�Xn�p��_j�ILt:6\6-O9+OD2SN:`PArdW�|p��������������������������������������������������������������̿�����������m~k^u[VoQSlNU_DV`EWaF560560560560671893:94;:5=<7@=8A>9C@;DAHC?HC?GD=HE>ID>ID>JF=LE=MF2G=1F<0D<1D<1C:1B;1A:2@91?82?82<71<71<8/<8-<8->7-@:.B:/D2B@4@@4+)�JK�SV�=B�/6�.3�./�0)�1 �9!�=!�=�= �=#�;#�6"�6-�8/�5.�3,�71�@:�B<�@6�B7�A5�7�`U�q�eS�WC�N:�XG�e[�a_�PT�BI�DK�@D�@?�B<�B8�B9�IA�PL�KP�@K�9H�7H�5H�3E�7G�=K�9R�9R�7R�7U�7X�9]�HC?ID@HE>HE>ID>JE?JF=MF>MF2G=1E=2D<1C:1C:1A:2A:2@93?82<71<71<8-<8-<8-?8.@:.B:/D2??3@@4�67�]_�Z[�78�,,�/,�,#�0#�8$�B(�G*�G'�F$�F$�C!�? �81�;2�92�50�:6�B>�D=�>7�<3�<2��72�:�<$�:*�.(�$&�'�'�%�%(�,)�2*�5*�3(�2'�/&�-%�=(�2�>0�5)�7/�?7�C9�qd�m]�YF�VE�i\�lf�SS�@H�?L�4�6,�4.�44�BH�8G�2F�3H�5I�7G�Y�=X�:W�6W�5Y�5\�6_�7e�;k�:m�;o�t�>v�Eb�Nk�Tq�If�?\�Rq�f��f��^w�bv�ky�s{�rv�fe�ZV�TN��~������Ļ����������������������������������������������������������������þĪ�����y�vi|f`w[\uWbqRapQ`oP201312423653875984984983;:5<<4==5??5AA7CC9EE9EE9HH@HH>HH3B90E<5C:5@85?74@86?67>56:44F85E76B87@78>:;<:=<<>==????A@,�B0�D2�D0�B/�?,�>*�<*�=-�C4�F7�>0�3&�6+�8,�:-�=/�=.�(�9%�4�4 �9%�8&�6&�@4�QE�IA�MI�UU�VX�JP�9A�4?�9D�CH�CF�AA�?;�=3�=/�?/�@0�Q@�QC�LC�C=�??�@E�>G�8C�GM�EN�EQ�ES�AR�=S�>X�Cb�Gi�Bh�HH7H?8F=6C:5C<6A:4?74?74@85>95=84;63>3/=4/>42<74=98<;9=<:>=;@?;C@9G@6J@4L@0O@-P?+P>(=B,?A,E=0H92K63J46F35A57>=;8=69?5?A4C=-J9)^B4sRC�K=�;-�2#�6&�:'�8$�9%�?(�;%�=(�@,�@-�=,�9*�6(�5(�;+�:*�9)�;+�?.�B/�B/�@.�?.�:(�<+�E6�H9�?1�8+�7+�5+�7,�:.�;/�=/�;/�8/�4/�0-�--�-+�/+�4)�8(�;'�=&�:'�7"�8%�=*�;*�5&�;/�G<�G?�JF�PO�PQ�GK�;@�:A�?G�DG�DC�B?�>8�;1�;-�<-�>.�F5�M?�NE�GC�?@�>B�>F�>H�DJ�CL�DP�FT�BS�=S�>X�Ba�Fh�Ci�?i�@l�Bp�Gv�Jz�L|�Ix�Ht�Kp�Rs�]z�`{�Xw�Mq�Ck�Al�Cj�Jg�^p�pugNI��v���̲���������������������������������������������������������������������������Ų����������������������}/.,0/-10.21/43/540762761:94::2<<4>>4@@6BB8CC9DD8IF=IG;JH;KJ8MJ7NL7NL7OL9KI:NKBTSQ_^dihxmm�lk�ih�cYd[QZQGPJ@IH>FG>CC=A@::1>:1=90:3-94.;60=82=:3>;4?<5?<3C?4F@4I?3L@2O?0P?-Q>-P>*3@&7?'<=+A;-B8/A62>42;31=85B:7H94O2.[+)o-.�:=�EJ�9+�2$�1"�9'�<)�7$�8$�<&�;&�=)�A-�A/�>.�<-�:-�:.�>0�<.�9+�:+�<+�>-�>-�=,�?-�9(�>/�L=�H:�6*�2&�;0�5*�6+�8,�:.�;/�9.�7/�2,�/-�.+�.+�0)�2'�6&�8$�:#�7$�5#�8'�>-�=.�7)�8.�A7�<5�?8�EA�KI�IJ�CC�?A�@C�DC�C?�B;�=4�:.�9*�;*�<+�9)�E8�NE�IE�?@�X�@_�Df�Ci�Dm�Fp�Iw�K{�L|�K{�Cv�Gw�Jt�Nt�Z|�a��Uv�Cd�Hk�Rv�=\�H`�z��}~\F;��r��ճ���������������������������������������������������������������������������ξ�����������������������/.,/.,0/-10,21-32.54/650872991;;3==3??5AA7BB8CC9IE<0?=1@<0?<-A;+F?/H?.K?/M@/O?/P?/Q>/P=.<@)=?*?>,?<-?;0=:3;:5:94<94D95N43[*-o&-�-8�3C�7H�7)�7&�9(�?-�?,�9&�9#�;&�:&�<)�>,�@/�>/�<0�=/�=0�@5�=2�:,�8*�9+�:,�:,�:*�;,�;-�B4�E9�?3�1'�2(�:1�3+�4*�7,�8-�8.�7,�3,�1,�0,�.+�.)�0(�1&�4$�6 �8�/�0�4$�;,�4�V�et���͑�]=2aP@�wlѥ������������������������������������������������������������������������������º��������������������10,10,0/+0/+10,21,43.54/77/880991;;1==3??5AA7BB8KD:LF:OG:QJ:RK9SL9RM:QK=OKBVTUfdowx���������Î�Ə�����{w�rl�id�_[~UPnNJaJGXEBM?=B;7696196-86*86)581692891;;/><-?<+C<)D<'I>*J?+L?,M@/M@0M?2M?4L>3M?4K?3F<2B90=909:25<44>57<5>:1H3.\0/{48�;D�9E�2A�<+�<+�@.�A/�@-�<'�<'�>*�8%�:'�<+�=.�;/�;.�<0�<1�A6�>3�:/�7,�7,�8+�8+�8+�7+�A5�C8�8.�1&�3)�7-�6-�2+�3)�5+�6,�5,�4-�2*�/*�/,�.*�/)�0'�1#�4!�6�7�/�/�2"�5)�9-�:0�?6�E=�F>�@9�<5�@9�KD�NG�F<�;1�=1�<0�C�>E�BJ�JT�JY�FX�CY�B]�@_�Bd�Fj�Js�Ox�Oz�Ly�Ix�Gw�R��Q}�Iq�Im�St�Vt�Ni�D^�F]�Yk�������KFd2)�jc͖�����������������������������������������������������������������������������������ɿ�˾�����Ⱦȿ���84163.52-30+30+41,52-63,85.96/:70<90>;2@=4B?6B?6KC8ME:PF:SJ9TK:UL;SL<=;:6;8396/267465672880<:-A<)D>(G?(I?&J?)IA,JA0IA4IA6HA9G@:R9?�46�<*�=+�?-�?-�>,�>*�?+�@-�8%�9(�:+�:+�9,�9.�:0�;2�>7�;4�81�8.�8.�9/�8.�6,�7-�C9�?5�0&�,#�7/�<4�4,�1*�1*�2)�3*�3+�2+�/*�.(�.*�-)�/)�2&�3$�5"�7 �7�5#�3#�2$�2&�5)�7,�;3�?8�YR�RJ�HA�D;�F<�J?�G;�?3�;(�;(�;*�:)�:(�:+�>0�A3�A6�<5�<6�A?�EE�GI�JM�MQ�AD�?E�CI�JT�N[�JZ�F\�F]�A]�Ba�Ei�Jp�Nw�Oz�Mx�Kx�R{�R{�Ov�Ot�Vw�]{�So�D^�Uj�Qd�dt��������`c�KL�keώ��������������������������������������������������������������������������������������������������<94;8385052-41*41*52+63,74-85.96/;8/=:1?<3A>5B?6KA7MC7RF8UI9WK;WK;UL=SJASJK[Xcnl������ǚ�ޞ�졩��홛敘ߔ�֐�̈�����zz�rq�fd|XWiPN\IGRFCJDBG=?K==G;:?;:8<92A;-D=*F@*F@(GA)GB.ED2CC7BC=AC@>BAG9HH,�>,�?+�@,�@-�?-�=*�8'�8)�9*�9,�8-�8.�91�;3�;4�:3�81�81�92�:2�70�6/�<3�>5�91�2*�3*�;2�<3�5,�0(�1)�1*�1+�0+�/)�-(�,(�-)�.)�0)�2(�5%�6#�7!�8 �8%�8%�5%�4%�4(�6+�7.�7/�NG�XP�ZQ�RI�H>�E9�B5�?1�<&�<&�<(�;'�9(�;*�>0�@4�D;�?9�@:�FC�IH�HG�IH�JM�CF�AD�DI�KS�QZ�N]�L]�J`�D^�Da�Ff�Il�Nu�Ox�Ox�Ny�Yz�Wv�Vu�Yx�]{�Zu�Qk�I`�Wk�Ug�N\�^k�KZ�Sa�Sa�Q_�jfɂ~窧������������������������������������������������������������������������������������������������@=6=:3:7074-52+52+52+63,74-74-96/;8/=:1?<3@=4A>5M@7OC7RF8WJ:XK:YL-C@-CB.BC3AE7>E=�UE�YF�L7�A+�A+�@,�A-�A-�A-�A.�A/�=+�7&�7(�8)�8+�8-�6-�7/�8/�;2�73�61�61�72�94�94�81�6/�A:�8/�3*�7/�=5�=5�8/�6-�0'�0'�0(�/)�.)�-)�+(�+(�-)�/)�1)�4)�5'�8&�8$�8#�8$�9%�7$�6&�7)�8,�7+�4*�3+�NG�d\�`Y�OF�B9�<2�:/�?&�>&�=&�;%�9&�9*�;/�>3�C9�A9�E?�KH�LI�GD�FE�JI�FG�CD�DH�MS�RZ�R\�N^�Oa�G^�Gb�Gd�Ii�Nr�Rv�Ry�Ry�[u�\x�`}�_|�Up�Mg�Pg�Yn�[m�bs�L]�Sd�M_�Rg�I_�E]�d`�tqښ�������������������������������������������������������������������������������������������������A>5@=4?<3=:1;8/96-74+63*52)52)63*74-:70=:3@=6B?8J@6OC7RF8VI9WJ9XK;ZL?[NHTIMXR`gd�|}���̗�瞩������������������������꟡ܙ�ҍ����ur�he�]Z�XR~YP{YQxVOpOG_E?M?:@?;8@@6>>2@B5@F:>E=:C>9CB*�?,�@.�@.�?-�=,�;,�6'�5(�6*�7-�7-�8/�91�81�84�95�:6�85�61�61�83�:3�C<�=6�70�@7�[R�lc�]T�@7�1'�2)�1*�/)�*&�'%�(&�*(�-)�0*�2)�1%�0#�1"�5$�:(�=&�=&�=)�<*�;,�9+�8,�6-�@8�71�GA�c^�XQ�B<�@9�3.�<#�<$�<&�<&�:(�:)�<.�=2�>4�C;�PJ�XT�OJ�@;�@:�KE�FE�FE�JK�PT�QW�NV�KV�L\�Rd�Of�Ke�Jf�Mn�Rs�Rv�Pt�[w�Zu�Zu�[w�]x�Zs�Wn�Vi�ct�Vg�\m�Yl�DX�BX�Me�Ib�nh�hcˎ�赲���������������������������������������������������������������������������������������������C?4B>3A=2?;0=90;7.:6-95,73*73*73*83-:5/=82@;5B=7I?5LB6QE7UH8VI8YI9YK>ZMEUKLXP_ebyz���ɔ�䚧���������������������������������䘘،�ɀ~�uq�ie�b^�cV�bU�]T�WOtNHdFCTBAIAAA;=8@C9�<7�<7�=9�A=�C=�B<�A;�@:�A9�@7�8/�1'�6+�I>�\Q�?4�6,�+#�)#�,)�./�,-�((�0.�4/�7/�6,�4)�2&�3%�5&�='�<'�<(�;(�:(�7)�6(�4(�8/�5-�<6�PJ�SO�LH�A?�/,�=%�>&�='�<'�9(�8(�9,�:/�>4�B:�OF�WP�QK�D=�B<�KD�IF�IF�ML�SR�TV�PV�NV�OZ�Vf�Uh�Si�Rk�Rm�Sq�St�Rs�No�Tv�\|�^{�[v�Uo�Qg�Re�Uf�Qb�Zh�Zj�M^�Rc�Wi�I\�ha�\W��{٩����������������������������������������������������������������������������������������������EA5EA6C?4A=2?;0=9.<8-;7.84+84+73*83-:5/=82?:4A<6G>5JB7ND8RF6TG6WG7YI:YKBWKKXP[b^wsu����ޗ�����������������������������������뙗���Ղ��xt�qm�l`�i]�dY�^V�VQyNKhEDV@@J76;?=>HBBKABN?BYFJmX_}fn�t��}�����}��w��p��c��Rp�E^�I\�EP�9<�3,�7(�;%�; �<*�<*�;)�;*�<,�<-�<-�<.�6*�8.�<1�>5�@8�>7�<3�:2�73�40�3/�93�A;�E?�A<�<5�<4�4,�4*�7-�2'�, �6*�H<�I>�@6�4-�-)�+*�+,�+,�*,�))�/+�3,�5.�4+�2(�2'�2'�:&�;'�<(�;)�;*�:,�8+�8,�4+�;4�:5�<7�ON�XY�EE�02�=(�<(�<(�:'�9)�8*�7*�7,�>2�A6�JA�UK�RI�H>�E:�H@�ID�HC�LG�SP�SS�PQ�MQ�NW�Xd�Zh�[p�Zr�Uo�Ql�Pn�Rp�Fm�Ov�Z}�[{�Vq�Sk�Vk�[m�Yh�Yh�`m�`k�\f�en�fm�T[�cY}ND�lfØ�߹�������������������������������������������������������������������������������������������IE9HD8FB6D@4B>2@<1?;0>:/:6-95,95,94.:5/<71>93@;5E>6HA7LD7QE5RE4UF3WG7WIC_@EmDJ�OU�]f�jr�e��k��l��f��]��Ty�Fg�8U�0H�>P�BM�:<�7/�@.�B*�/�?0�@3�@3�6*�KB�JE�50�FF�Z\�HK�?B�=-�;+�:*�:*�:*�9,�9+�8,�<0�>2�F9�OB�PD�H<�C7�D7�F?�F?�JC�PK�RO�ML�KM�KP�X`�[h�aq�au�Wo�Og�Mg�Pk�Ju�Oy�Sw�Rq�Sm�[p�cu�ix�gu�ao�bm�el�gl�jj�jh�c_�dVeH:_T���ͫ�������������������������������������������������������������������������������������������LI:KH9JG8HD8FB6D@4B>3A=2=9.<8/;7.;60;60<71>93?:4B?8EA8JD8NE4PE1TE0VG4XH9ZMEVMR[Whkl�~����В�噧����������������������������������铕⊌ل�Ӆ�{u�mj�dd�_a�X[�QQsNHbUFY_CRlBL�EO�LV�U]�[d�]f�Ju�Nx�Pu�Ln�Fc�?Y�5J�+?�5E�AM�FK�><�>6�H8�J6�B)�>-�=-�<-�>/�?2�B4�D7�E:�E9�B7�>5�:2�6-�5,�3+�2*�1*�4-�60�90�80�7/�6.�5,�/&�5+�6)�2#�1"�9)�>-�<+�=-�D7�KA�D?�56�)-�)-�.2�67�55�30�1,�/,�/,�0-�/-�80�:1�:1�<0�<0�=0�?0�>1�7+�WL�`X�;6�;:�OQ�EH�OT�=2�:/�8,�8,�:-�;.�;-�:.�:-�<.�B3�H9�I:�D6�@2�>0�E<�E<�I@�PI�RM�NK�KK�LO�Z`�^h�fr�hx�]q�Og�Me�Qj�Pz�Qx�Qp�Sm�\q�hx�jw�ep�fr�_k�_k�kr�su�lh�f\�l^ujXVI8kXJ�{t���������������������������������������������������������������������������������������������QK=PJ3�;1�8/�4*�3*�4+�4,�5-�9/�<2�=4�<3�90�5-�5,�6-�.$�;.�<.�1"�.�8$�=)�;&�:'�9+�:1�=9�@@�;?�27�+1�,.�+,�+)�+(�/.�44�88�:;�55�64�73�6/�7-�5*�5(�5&�5'�PE�mc�HA�42�CC�>B�UY�B;�=6�70�6-�9/�<1�=1�=.�9)�<+�@.�B0�B0�?.�=,�<+�C8�D9�H=�PG�SL�OI�OJ�OP�_c�ai�it�m|�du�Uj�Rg�Wo�Sx�Ut�Wp�_p�oy�y~�ms�Xa�am�`m�ao�s{숊ɂ|�wj�yhhpYMO:^WG�qg���ݿ����������������������������������������������������������������������������������������SM=RL4D=5B;3A:4@93A:4A96B:7@A;CC;IE:NG7QF2RF.UF/WH5XJ=RHFXR\jh�}����ƒ�ږ�奦�����������������������������띤蛢晞⒚ۊ�҅�ʂ�‚������y��m��cz�Wi�P]�KW�GP�?H�9A�;6�<5�B6�H7�J5�G1�D.�@/�UG�G?�;7�64�88�:;�98�66�=.�<.�;.�;,�8+�6*�3)�1&�5*�3*�3(�2)�3*�5,�6.�7/�>3�<2�;1�8/�7.�6,�4*�3)�3&�3%�4%�6&�=)�>*�9$�2�;(�5%�3'�60�;<�=@�7=�27�-1�..�--�0.�44�9:�;=�;>�.4�/3�01�1/�1*�2(�1%�3$�2#�>/�j_�TL�95�@@�:=�RU�JE�B=�93�5.�8.�;0�<0�=-�<*�?-�@.�?-�;(�;(�<)�=*�>2�>2�D8�LB�PF�NF�MG�NL�bc�bf�hq�o{�hx�Ym�Uj�[p�Xs�\t�bq�kt��퉇�yy�_d�hr�l|�cs�kw���餟�����z\pWFRRL�4:�B*�D)�H)�N+�O(�L%�H%�D&�WB�F8�;5�>>�BH�>F�5>�08�F8�E7�D7�A3�=0�8,�3)�0%�0&�1(�2(�3*�5,�5,�4,�4,�C8�=2�7-�7-�:/�9/�5+�1'�7*�0"�0!�9&�9%�5 �9#�E.�:&�:)�7+�3.�//�05�5;�;B�IM�GJ�DD�@@�>>�9:�28�.4�'/�(/�*.�-.�0+�2*�5)�7(�0!�/�eY�]T�A<�ED�;=�NR�PM�FC�:6�5/�8.�:/�,�A/�B0�=)�8%�9&�;)�>,�8+�8+�>1�G<�K@�IA�IC�JG�`a�^b�dl�lx�ix�Zk�Ti�Zo�^t�cu�gq�qr݅�锍ꋇ�ru�q{�x��`s�Xg����֫����TnSAS;PTCkaW���ݿ����������������������������������������������������������������������������������������XO@XO@WN?VM>TK�8>�=@�D@�HB�;D�;B�CG�99�B@�D@�/-�HI�HK�AG�;D�8A�:?�<>�<;�<9�A=�>9�C=�LC�K@�>2�7+�;-�9,�8-�7-�3,�0,�/-�11�34�A1�9)�1 �1"�8(�;*�6%�2�2�4�5�4 �3"�3%�3(�3)�.(�2+�6+�8*�8(�7&�7%�6'�3'�2,�31�01�+2�*2�+4�-6�+1�*/�+,�.-�4.�8,�7(�5#�.�3 �XH�ZL�<2�OG�5/�IF�QR�LK�DB�<8�80�7,�9+�;+�;)�:'�9%�:&�<)�=+�=+�=,�9.�;.�=1�?1�?1�@1�@2�A4�k_�qe�d[�mi�ro�cb�ji�tu�k|�iv�dm�_h�af�gj�nk�qk�|w�}��Yj�[w�Zp������a�z]sMIZ6LR6snX���˷����������������������������������������������������������������������������������������YPAXO@XO@VM>UL=TKD�:B�7?�7;�89�:8�;7�F?�<5�<4�G>�LA�C7�;,�9+�7*�7+�7-�4-�2.�3/�53�66�?0�<-�6)�4&�6%�6%�4"�4�:"�:"�:#�;&�<*�;,�8,�5*�3.�5-�7-�8*�6&�4"�4!�3"�2$�1(�/+�.,�,-�,1�-3�.4�*,�,-�0.�2.�3*�5'�7'�9'�@,�*�E5�?1�F>�WP�C?�BA�WV�RR�KJ�C>�=5�9.�9+�8(�;)�;(�:'�;'�>+�?-�@/�>-�9.�;0�=0�=1�?0�?1�B3�C6�i\�md�b[�kf�ol�ba�kl�uv�p��o|�ir�^f�Y^�ad�qn�|v�yu�x~�Rd�Ur�Xn������X�n[tLN_;QZ;us\����ú���������������������������������������������������������������������������������������ZQBYPAYPAWN?VM>UL=TKC�C�>C�;C�7=�?A�A@�D?�=8�96�WW�BC�=B�:A�7<�58�66�96�;6�HA�:3�5+�A5�K>�H:�=/�8)�7)�7+�8,�7.�60�63�87�;;�5)�6*�6*�6*�5(�7)�:*�?,�5�5�6 �7"�9)�8+�4(�0&�=;�>8�=5�*�B/�1 �TE�<0�A;�C?�JI�TS�VV�SS�OM�IE�C;�<2�8+�6&�7&�7%�7$�:'�<*�>-�=,�=,�:.�;/�<.�=/�=.�?0�B4�E7�\O�g]�aY�lg�po�ab�fg�ko�P`�^k�hq�em�`e�dg�qq�zw�vs�nu�J]�Mj�Um񜡟��P�cVoEOd=Va?ww]���������������������������������������������������������������������������������������������\PB\PB[OAZN@YM?YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8RF8JF=KG�>@�FC�A<�71�>:�[W�AB�?C�=@�:=�89�97�=8�A:�E;�9/�2(�/�9(�8)�8+�:,�:/�80�83�;7�=:�3+�3,�5,�4-�6-�7.�:.�>/�9(�<)�>-�>.�=/�=2�>6�>7�?>�?<�?7�=1�:*�9%�;$�<%�<(�8'�2#�1%�2(�4,�2,�0*�3*�5*�7+�7)�7'�8%�<(�>*�<(�=,�^P�F<�3/�.-�?B�UX�vu�ro�jg�^Y�PI�A7�5(�.�8'�9&�8&�:)�=,�=-�>,�<-�<.�<.�=/�<-�;-�>0�B3�E9�MA�`W�a[�pl�tr�`a�]a�^d�FV�Ye�gp�go�dl�jp�st�xv�ss�en�CX�Eb�Rk뒘���N�\Ql?Ri?ZhDy|_���������������������������������������������������������������������������������������������\PB\PB[OA[OAZN@YM?YM?YM?WK=VJc�7U�8I�AE�FA�IA�IA�FC�AG�;J�9J�DI�>A�@?�JE�?8�3,�D<�TP�DC�AC�>@�>?�>=�@<�E;�H<�=2�7,�5'�9*�=-�=-�<+�<)�;*�;,�<-�;/�8/�70�83�95�:7�64�22�31�42�50�2+�1)�2'�9-�<0�90�5/�52�<;�DC�57�66�61�5,�5&�6"�9#�;#�>'�9&�5$�5'�9,�;0�:/�8-�?1�;-�8'�7&�:'�<)�='�;&�>-�:*�>2�B:�.+�::�14�26�73�;7�C>�JE�QI�SH�TH�UG�?0�>.�<,�<-�>.�@.�?/�?.�=0�=.�<.�<.�<,�=.�A3�D6�LA�bZ�c]�nl�rr�`c�`e�`g�ix�oz�lt�`h�^f�kq�w{�{|�pq�^h�@W�>]�Oh懍���X�aXuE\vIgwP��f��������������������������������������Ż㾺޺�޼���������������������������������������������[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJPI?QI>SK>UL;XM9YM7YM7XM;WK=ULGYSWc_nmk�tt�|~���������������ȍ�ώ�ԏ�Ս�Ӑ�Ӌ�ʂ��{��u|�ov�gp�ck��n~�ey�Zv�Mo�?c�2V�0L�6G�@C�GB�LB�MC�IG�CJ��ID�<4�5*�I@�LF�CA�>=�:;�;;�?=�E=�H<�I;�7*�7*�8(�9(�9'�9&�:(�;(�;)�=,�<-�;.�8.�6.�6/�5.�24�.1�+0�/2�37�69�45�21�/,�31�63�42�/3�/5�5?�=G�,2�.2�2/�3,�5(�8'�;&�>(�9$�8$�8&�:,�?1�A5�B5�A6�I8�B1�<*�:&�<)�?*�<)�9&�;*�6)�0'�B<�1/�>A�.2�'-�3-�4.�71�92�8.�5*�2&�1#�E5�A2�=.�:+�9)�:+�:,�:,�/�=.�<+�=,�?/�A4�SG�g^�d_�ki�no�ch�jq�ox�p}�t~�mw�cj�dl�qz�w|�su�kp�Xf�AY�:[�Kf�}����l�oj�Xo�Zx�`��r�����������������������������������ū٫�Ӧ�ѥ�ԩ�Ԯ�ֱ�ں������������������������������������ZN>ZN>ZN>ZN>YM=YM=YM=YM=XL@�E@�JB�KC�HG�BL�8�E;�F9�E6�8(�:*�:*�:'�8%�:&�:'�:&�9&�:)�;*�9+�7+�5+�3+�4-�)-�)/�,3�.4�07�18�28�58�7;�8<�9?�9A�9D�6G�6H�5J�)1�,2�02�4/�7-�9*�<+�=,�7&�9*�2�?4�>4�?6�?6�N<�H7�B1�=,�:'�:'�9(�9)�3%�9/�@8�D>�0/�-.�38�38�4-�6.�80�:1�;1�;0�:.�:/�L?�F:�?2�9*�7)�7*�8*�8*�<-�>/�?0�=/�<+�<+�<,�>0�KA�c[�c^�ki�os�hn�rz�v�er�oy�r{�js�lv�v�u}�io�fl�Rb�A[�6Y�Fa�t{�����~z�f{�f��h��u����˭����������������������շ�ˮ�Ũ�Ò�‘�ē�ș�˝�ˡ�Χ�Ү�ٻ����������������������������Ǿ[N>ZM=ZM=ZM=ZM=ZM=YLXL>YN�<=�A=�E?�GB�DH�AK�=M�:O�BA�GD�A<�H=�;.�5�83�.,�)&�.*�:3�C9�D6�@0�:(�<)�<)�:'�;(�=(�;'�8%�6"�7%�8)�7*�5(�3(�3)�3*�03�58�7<�38�,2�&-�'-�)1�,3�'0�%/�'6�+=�(A�:�2�".�&0�+1�0/�1,�4+�5)�6*�6+�90�>5�>7�:4�61�50�61�L?�K<�F7�>/�6(�3%�6)�9-�5*�6-�C<�74�21� �89�35�2(�3)�4)�5)�5+�5*�5+�7+�YN�RF�H;�@4�=�@A�BI�CM�AN�>N�A<�@9�?6�?3�=/�=0�E8�MD�61�;6�1.�2.�C<�?3�6'�?.�6#�:'�<)�;'�9%�:&�:'�:&�:'�9(�7(�3$�."�/%�7.�=5�72�30�.-�)(�%&�#%�"'�"'�$*� )�!,�%7�'<�;�4�3�)7�".�"+�*-�--�+(�-)�41�62�54�64�55�12�-.�+,�++�<4�91�:1�TK�"�+#�F>�.&�/(�<7�E@�:7�/,�.*�41�:7�?3�;.�5)�3&�5*�:.�;0�8.�bW�ZO�D8�6,�:/�9-�3)�6,�1%�2&�2&�4'�7'�:,�<.�=/�:.�C;�\W�pp�sv�v~�y��q|�{��x��u}�s{�r~�q}�lx�is�bm�I\�=\�8[�:V�ek�����}~�i|�d}�c��j��u������������|��vx�qw�o|�r��t��w�u��y������������������������§�̹���������־�ʻ�������ZM1�B6�?6�?8�A=�=;�:<�:@�7�=4�<1��6;�3:�06�-2�.3�14�36�4/�:5�72�DA�DA�/+�2.�"�41�?<�E@�=8�3-�2,�60�91�<-�9*�5'�4&�8+�;0�<2�9/�cY�XN�@8�3+�:1�;2�7.�:1�4+�4*�4*�5*�6(�6(�7(�6)�;0�B9�YT�ll�qt�w~�|��v��|��y��v~�u�s�o}�iw�eq�an�I]�<\�9\�=Y�dh��y��su�`t�\w�]�c��k��p��p��mp�_l�_f�\g�^j�_q�ey�i}�l��r��t��z��}������������������������Ʒ�ǿ���Һ�ŷ�������\L<\L<\L<\L<\L<\L<\L<\L/�E5�G7�C8�?9�=<�9>�9A�:E�>G�AH�@E�@B�<4�90�8-�:*�9(�:*�?3�F<�D>�96�65�:7�C=�OE�I<�4%�9&�:'�<)�=+�>,�=*�:)�9)�8'�2#�/#�4*�=3�?6�91�2+�7&�6&�3#�/"�-"�+%�,&�+(�++�(+�'-�(5�%8�5�2�3�(5�.;�4?�8C�;D��+6�1<�/9�-8�+5�,3�-1�.1�01�1.�<9�64�;9�lj�BA�.-�.,�97�?<�A=�<6�7.�6+�6+�5*�8&�6%�6%�8)�;.�<1�<2�;1�aW�TM�<3�0(�;3�?6�;3�>6�=8�<7�=4�<2�;/�:.�7*�6)�;/�@8�TM�ge�or�z~����{��{��z��x��w��s��l}�ft�bn�]k�G^�:Z�9\�AZ�_c�gk�^e�Oh�Ol�Rt�X{�\}�^x�\q�X`yO_P`�Ue�Ym�`u�g{�j��m��p��t��v��y��y��z��~�����������������ǹ�˸�̴����������[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:ZJ:[K;[K;\L<\L<\L<]K=]K=]L<^M=^M;^O<^O<^O<`P@^Q@]P@\NC\NE[NF\OI]PJ`NdcSmfX{g^�oh�zu��|��{�����������y��x��u��c��Oy�AF�@@�A=�F;�J;�J;�F9�B:�@?�;A�:D�7�>8�50�-&�:)�8)�5(�2'�/'�.'�,(�,*�+*�(,�)1�+7�';�";�=�"A�8G�(6�/;�P\�`l�P\�^N>^N?^N?_OB`PC`OEbM\cPdcUodZle�vr�~w��v��~����‰�Ё��w��k��Xu�Ff�=M�DP�JN�JH�G>�G<�G<�D>�BB�>C�>G�@H�CI�DD�B=�?9�A5�=/�:+�;*�:)�9*�<.�?6�FB�<;�AB�AA�:8�JB�XL�L>�@0�8(�3#�8(�<-�:*�7)�8+�0%�3)�8/�;4�:3�50�0+�+'�4,�4-�2.�31�43�45�58�6;�/4�.6�0=�2C�.F�*G�,L�1T�P�3D�2A�3>�5<�89�73�3*�/$�2*�-(�61�XT�\Z�XV�@A�HH�B@�<7�70�6-�8-�9+�7'�3!�:%�9$�;(�=-�;-�6)�8.�>5�NG�EA�50�1-�>9�?:�81�71�/0�11�42�73�92�:/�9.�:.�6*�7-�IB�_Y�nl�}�������v}�x~�z��x��s��j{�dt�_n�Ue�F]�6V�7Z�F_�TRvaBJoR�-H�:Q�CT�DK�@A�A>�DA�EB�EF�AF�@E�BF�DE�EA�C:�?4�@3�;-�8(�9(�:)�9(�:-�;3�IE�??�;>�68�2/�A:�ZP�g[�QC�A3�4'�6)�9+�8+�6+�8,�0&�5-�;4�:4�40�/,�-+�-,�4;�3;�3<�2=�1>�0=�0?�0@�1A�2D�5K�5O�0P�-Q�1X�:d�7B�O\�an�`n�Xf�Qb�EX�8J�@S�:G�2;�/2�3-�9-�=+�>(�9/�2(�JB�kc�LG�PM�<9�;9�LJ�@<�7/�7-�(�;%�=)�?-�9)�4'�:1�C=�HA�C?�72�2.�;7�:6�2.�2-�)+�+,�.-�3/�61�:1�<1�>2�6)�4)�B:�XR�jh�|}�������v}�y�{��x��q��h{�bt�^o�Se�I`�9X�9[�I_�QNmZ:Em8ZvCa|In�Sv�Y|�]�b��g��l�l{�m|�o}�p~�o��n��l��l��q��q��r��r��o��n��p��t��v��t��w�������ï�̾��Ž�ӫ�����ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M;_N<_N<^O<^O<_P;_P;aPH�$H�0Q�;U��A6�>1�?1�9+�7'�:)�=*�=,�>1�>7�=:�79�/3�/0�32�94�NE�la�j[�QC��D>�61�;7�UQ�F@�91�8-�:,�9(�:&�;%�B)�<&�<&�=*�8(�3(�=4�MF�GC�EB�96�30�73�41�/+�2-�)/�*/�--�0/�4/�7/�;1�>2�:,�4(�;2�NH�b^�yz�������z��}��}��x��n~�dw�^p�[l�N`�Ha�8W�7Y�H]�JGcS1Al6ZtDf~Nu�Z�c��f��j��n��s��t��t�r}�p}�n��m��l��k��n��p��o��o��l�k��n��p��s��r��w�������Ʊ�ο��ŷ�Ҥ�����ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9\M:\M:\M:`J<`J<^K<_L=^M=_N<_N<^O<`Q>aR=bQ=bQ=bR;bP:aO9`N8jNMgNRbQ[cWkjfuv�}}��y��{����˃��{|�qs�gj�TX�AG�#M�.T�7W�9P�>N�EM�EH�?B�BD�AC�@A�A?�C?�B9�?4�=0�?1�9+�8(�=,�A.�B1�C7�D=�64�57�,0�02�88�0+�5-�UK�zn�^R�D7�=0�<0�6,�6+�90�70�82�71�40�1/�10�53�87�=�>�>�>�=�=�<�=�:�@�$I�&N�$Q�%U�0e�=s�gr�al�Xe�R_�Q`�M]�?R�1B�:J�4?�-0�-(�5'�>&�C%�E"�7&�9(�WH�<0�A8�7/�3/�C@�XS�HA�91�6*�6&�5$�6"�9#�B*�<%�:%�<*�7&�3'�A7�SL�IE�GE�:8�2.�41�1-�.)�4.�'-�',�)+�*)�-(�1*�5,�9-�>1�3(�7.�HB�\X�wu�������~�������x��l|�`s�Zl�Xi�HZ�E^�4S�3R�CX�E@\L*?j4Uo?d|Lw�\��h��l��p��t��x��{��x��t|�mz�i}�g�h��h��k��m��m��l�j}�i��l��o��s��t��x�������«�Ƕ�Ȼ��Ӟ�����]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^L8\J>]K?]M@\L=ZM=ZO=\Q?^SA_T@_R?^Q@aQAcRBdQCdNAcM@pKEjKIfOUgZknl�v|�}��������������̃��{~�um�l]�fR�N[�DQ�>L�AN�CQ�>K�:G�4�;/�8+�:$�C0�=,�6(�?5�D=�;5�61�83�71�6-�7)�9(�='�;"�7�74�PL�XO�D9�8(�?.�C3�;-�4+�GD�.1�4;�4?�+9�@Q�(9�&+�*-�*-�"�#$�()�((��"�+1� )�&1�.<�$5�Yn�+@�`j�^i�Yc�T[�PT�HI�@;�:1�A2�F2�D.�;$�5�7#�;)�=+�81�83�EC�;9�23�45�44�CA�KF�KE�D;�:0�4+�4*�3+�2*�?1�9,�.#�'�,"�7/�C:�G=�PF�E;�80�1*�/-�01�/3�.4�14�12�01�/0�0.�1+�4+�8-�=/�2#�?0�>3�`W�tq�����������w��e}�[w�Xu�So�Jg�Dc�7Y�9]�>[�]k�C=PI/F`;Xw^N?^N?[N>ZO=\Q?^SA_TB]QA]P@_OB`NBbPFcOFcOFkLGjMOgS\h_rno�w~�~�������̢�����w��x��|x�uh�jY�Zg�N\�FR�HU�JV�ER�?J�;E�9A�:>�::�=:�?7�>4�+�?-�9(�:,�A6�<4�7/�<7�40�4-�4*�4(�7&�:&�;%�;"�52�A;�MD�I>�>/�8(�8)�;.�<2�JF�/1�5<�6A�.<�?P�'8�$'�%(�),�+,�*+�'(�((�*,�$'�%(�%,�:D�'�4C�AT�#6�lu�bl�Zc�W]�OS�BC�;8�>6�8,�E4�H6�?,�1�)�(�)�-'�:6�TR�HG�54�45�<=�WU�GB�GA�B9�9/�4+�6,�7/�5.�?5�:1�5.�3+�4.�83�?9�E=�JB�A8�6/�1*�0-�11�03�.3�14�12�01�/0�0.�1+�4+�8-�>0�3$�=.�=2�^U�vs�������������u��e|�[v�Wt�Qo�Ih�Aa�8Z�=_�F`�Q\{?7NH.Ga>Yx=e�Ks�Yx�aw�bz�f|�i}�j|�i|�i|�h{�e{�d}�c}�c�d{�l}�n}�l}�i}�e}�c�c��c��f��k��p��u��|���������z��doqR]_]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8]L8^K<_N>aP@`P@]P?[O?[O?[RC[QE[QE\OF\OG_PKcQOfTRhTUiTQiVXi]kmi�sv�z����͉�֗�ٟ�ʪ���}���烅�~t�ve�`k�S\�GQ�FQ�HR�EQ�@K�=G�6=�7:�99�<7�@7�A4�?0�=-�@-�=+�;*�B4�I?�;2�0)�92�6/�5.�7,�7*�7(�7$�:%�<'�3/�4.�A9�OC�H:�6%�3#�@2�>5�HD�13�4;�6@�4@�ES�3A�),�"&�#&�03�--�''�%%�12�(*�7:�+1�)1�3?�R^�=K�Yi�af�V\�OT�MR�EI�:;�74�?9�6,�?2�C5�>1�8-�3)�,%�' �% �0*�FC�::�,,�44�AB�^]�>:�C;�A9�=3�9/�=4�@8�@9�A>�=;�>=�A?�?>�;9�?=�ID�A;�=4�5,�2+�2-�31�12�/2�04�02�01�/0�/.�0+�4+�8-�?1�4%�9*�;0�[R�zw����������~��r��cy�Zt�Tq�Mm�Fg�=_�:^�Bb�Qg�?Fn<1OK2KcA[z?h�Lr�Zu�^t�_w�c{�gz�gy�fy�fy�cx�by�b{�a|�b}�by�j{�j{�h{�e{�az�^|�^�`��h��n��s��t��w��vy�pn�gVb`COM4@>^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^L6`N:aP<`Q>]P?ZN>YPAXPEXOH[RM_UTcWYeX_iYcl\fm]hlbclemol�rt�x�~�τ�ߊ�狇ޝ�٬�ɳ��y��{�߁y�v�nr�bg�U\�LU�FP�BM�>G�;D�5;�7:�97�=7�A6�B4�B1�?.�;,�=/�>0�G:�RG�H?�6.�1)�91�81�;0�<0�;-�6%�6&�9'�40�2-�=4�OC�K=�;,�8*�B6�7.�>:�/0�16�4<�8B�NZ�KW�>C�38�$&�/1�,,�22�+*�0.�::��37�-2�9B�EN�Yc�LY�?A�AD�CF�>C�9=�89�88�:5�83�91�:2�A:�NH�VS�NN�AB�82�:5�KG�NL�QR�YZ�RQ�YX�51�>6�C9�@7�?5�A9�C<�A;�C�:?�58�=?�LJ�93�70�4+�3,�5.�30�21�01�04�02�01�.0�/.�0+�3+�8-�@2�6'�6'�9.�WM�}y����������{��o�cw�Xq�Nm�Fh�?c�8\�=`�Id�Yh�25d<0SQ8TgG`}Ej�Ps�Yt�\u�^w�by�ey�fw�dv�aw�av�`x�`z�`{�a|�by�hz�g|�fz�bz�_z�]|�]~�_��e��m��r��s��u��st�ii�_RaZDSL8G@^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;_K2_M5aO9_P;\O>ZN@XPEXQKYQO^X\g`hnfsshysg{sg}tfnnzor�rw�v|�y��~�׃�刋쒍뛌ߞ�ƞt��k��mq�vj�{i�ll�kl�fi�]`�QW�EM�;B�5=�59�68�98�>7�A7�C5�C0�A-�8+�@3�;.�;1�RH�]S�NC�;2�90�7,�9/�>1�=1�6*�4'�7(�2-�60�=5�E9�F9�C3�A2�?2�0&�62�0/�-1�-4�7?�OY�Zd�[_�OS�.1�03�--�EE�66�,,�-.�>@�25�37�ch�=C�*2�-4�()�;=�AE�7:�37�8;�89�..�43�<9�HE�SS�`c�hn�dk�[e�B<�E@�^[�ig�op�jj�KK�=;�4.�>7�E<�C;�?5�<4�93�7/�0=�,9�+6�-8�*5�+3�8<�JK�3/�4.�4+�4+�5.�40�4/�3/�/4�/2�/1�-0�..�0+�3+�7-�?2�9*�3$�8-�NE�}y�������}��w��l|�at�Um�Hg�>b�8_�4\�@a�Mc�Wap/+\A0XX>]lMbIl�St�\u�_v�_x�cy�ex�bu�`u�`u�_v�_w�_z�`{�a|�by�d{�f|�dz�`y�^y�Z{�Z}�\��_��g��m��p��s��t{�nr�ffvi[k^RbU_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<`L1aM2`N6^O:[N>YOE[RMZTT_Zahbprm�zu�{t�yr�zp�yo�ov�py�t}�w��z��~�Ճ�ዋ唏㗊ҙ���������~y�l[�X>�H?�PI�VR�VU�RR�JM�=C�38�7<�9;�;9�=8�A8�C4�B0�@-�9.�A6�5+�.$�J?�h\�eZ�VI�=2�6)�4)�:0�;0�5,�3)�6+�/+�61�;2�:/�?0�F7�C3�9+�1&�3-�31�-.�*.�17�EJ�S[�_d�\a�9<�9<�+.�JK�89�//�55�()�(+�YZ�?B�9=�7:� %�))�=>�BE�49�,2�17�/5�(,�37�KN�ae�hn�cl�_k�_m�_n�NI�OJ�]Z�VT�MM�GH�32�31�A<�KD�PH�KA�A8�:3�50�2+�,;�+:�(7�%4�'4�/:�=C�IL�1.�3,�4,�5,�4-�4-�5/�4/�/4�/2�.1�-0�..�/+�3+�7-�=0�;-�1#�7,�D;�yv�������y��q��hx�`s�Tl�Cc�7^�3_�3\�Dc�M^�JMb6+TE0W[@^kMc~Kk�Tt�[w�_x�`{�dz�cv�`s�]s�\s�\t�]v�^w�_{�a|�by�bz�b|�b{�_x�[x�Yz�Y{�Z~�]��e��i��m��s��u��s|�mv�unmfwe_P=_P=_P=_P=_P=_P=_P=_P=^O<^O<^O<^O<^O<^O<^O<^O�cW�h[�fY�PB�?2�5)�7,�:0�5,�2+�6.�0,�4/�7/�8.�>1�C4�?0�4'�4*�1)�2/�..�-.�14�68�?C�OT�Y^�FK�RW�47�FJ�8<�BE�7:�.0�15�IK�8;�8:�#%�<>�89�;>�=A�6<�-4�)2�19��/>�)7�-:�9C�AH�AB�1/�4-�5,�5,�4-�3,�5/�50�.4�.2�.1�-0�..�/+�3+�7-�:.�>0�2$�7,�<3�tq�������r��j}�bt�]p�Rj�Bb�6`�5a�8_�Kf�N[z;6Y?.LH/TZ@]cIbzJj�Tr�[v�^y�c{�dx�as�\p�Yp�Yq�Zq�Zt�\u�]y�_z�`x�_y�^z�^y�\x�Wv�Uw�V{�X~�]��d��h��l��o��r��mx�gr�lk}ecu]_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>^N>eQ6cR8aP<]P@ZPG\TR_Zab^otr�yx�������~~�yx�wv�xw�t}�w��}�Ƃ�ƅ������������������ȸ�п��¡ϼ�Dz��kS�\F�G5�=0�H=�VQ�VT�NO�?A�=?�<<�<;�=:�=5�;1�8.�82�<5�:3�>5�PD�YM�]P�gX�dW�M@�:-�8.�91�3-�2,�50�40�2-�5-�<3�C7�C4�:-�3%�5*�-&�0+�.,�21�44�.,�00�EI�Y]�W\�pu�DJ�HN�=C�[a�ou�>C�~��mq�QT�>@�02�<>�EI�9>�7=�=F�6@�-8�>J�\h�mw�it�dl�]g�^k�ap�]n�Wh�_Y�OK�JG�74�0.�54�/.�95�D?�JD�JA�@8�6/�5-�71�94�$0�/<�1=�*6�/:�>E�>C�44�3.�5.�6-�5,�3*�3,�4/�5/�.4�.2�.1�-0�..�.+�2+�6-�9-�@2�1$�6,�7/�po�������k��cx�]p�Zn�Pi�Ad�7a�8d�=b�Pi�QW^2'RG3DH/PV`P@`P@_O?_O?_O?aQAbRB_O?]M=]M=aQAcSCbRB`P@eS;aP<_O?^QH[QOZSZeapsq�xx�z|�~�����}�xy�rs�no�qw�v{��̋�Ȗ�ä���������Ų�ͭ�Щ�У�Ѡ�ѡ�̚�Ɣզ���g�_F�zg�te�G?�QM�ba�IL�>A�79�9;�99�75�61�94�95�50�B;�=5�I?�XK�PA�eV�dV�YK�G;�:/�6-�6/�5/�3/�/-�2,�70�=4�<0�8)�5(�8*�/$�/(�.)�0-�20�40�51�40�8<�JN�Y]�OS�7?�6>�X`�~��~��ow�go�ip�fj�\_�Y[�^`�RY�CK�8B�7A�1>�+9�/>�=I�S_�`k�gp�ep�bo�bp�`o�[l�TO�FA�85�31�10�/.�21�86�D=�B:�?7�<4�90�81�83�84�5=�4;�3;�4<�5;�49�33�1/�3,�6-�7.�5+�3+�2,�1,�2.�/5�03�/2�.1�//�/,�3,�7.�@4�9,�7+�/&�<5�XW����~��h��e|�]r�Rh�He�Ae�9b�5`�Jl�Rd�==K. >>&?I.IO5]]EWlAcxMq�Zx�by�`t�\r�Xq�Wl�Sm�Rn�So�Vr�Xt�\u�]u�]t�Vt�Wv�Xw�Wv�Uv�Uu�Tt�S{�[{�\z�\u�Zn�Uc}MXrCSj>AW1?U/`P@`P@`P@_O?`P@aQAbRB`P@_O?`P@bRBcSCbRB`P@fVF_QD\OF_TRcZ_f`nmk�wv�wy�{}�}�x|�qt�lo�ln�oq�su�|}ى�Ԙ�Ш�ƹ���Ƶ�ϩ�ף�ܞ�ߞ�ޝ�ܞ�٠�Ҝ�ʖѼ�����~dċw�}m�VJ�`Y�qn�ZZ�JL�>@�<>�>@�:;�56�34�=:�73�?8�6.�>3�L@�I;�^O�p`�aS�H<�5)�0&�5-�4-�/)�43�95�<7�<3�8.�5)�5(�5*�6.�4-�1+�0+�0,�2,�4.�5.�9;�>A�IM�W[�\d�\d�]e�`k�R]�MX�Q[�_g�jq�fl�[`�RU�07�+5�+5�-9�&5�/�'6�7D�P\�[d�cl�em�ep�do�[h�P^�FB�<9�64�63�53�20�2/�62�>9�>7�<2�:1�91�82�95�96�9;�7:�7:�79�79�57�31�3,�4,�7-�7.�6,�2+�1*�0,�1.�05�03�/2�.1�//�/,�3,�6.�=2�>2�8-�2*�82�Z[����w{�a{�^v�Wq�Ok�Ff�=b�:c�=c�Lh�JVw<8F5#7=#9C(DH/UP`rJn�Xw�_v�]t�Zp�Vn�Tk�Ok�Pl�Qm�Ro�Vr�Zs�[s�[t�Vu�Wu�Wu�Ut�Tr�Qq�Pq�Qn�Pl�Nh�Lb�FXu?Nh8F]/@W+@W-@W-AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCaTDaTD`SC^QAbUM^QK[QPcYakesqm�vu�y{�y{�y~�w}�ns�ei�bf�jn�rv�}zᇃᖔߩ�ټ������ظ�������������ۤ�Ϡ�Ę��������k��p�p`�RG�]U�mi�us�^_�HL�@D�@D�=@�7:�36�>;�;6�A:�70�7.�?3�=/�G8�j\�j[�\M�B6�2(�4+�6-�1*�44�A>�GC�=6�2)�1'�2'�0%�3*�1)�.)�/)�2,�7/�=4�A7�-,�43�CE�VX�^b�Ya�S]�P[�FQ�HS�NY�\f�mv�mt�Y_�AG�*2�,4�1<�1>�*9�&6�6E�JX�IS�OY�W_�_f�dk�ai�Q[�BJ�95�63�75�<8�<9�85�51�60�:3�;2�90�90�81�83�:6�:8�;9�:9�99�98�88�84�40�3+�6,�8-�8,�6,�3)�/)�/,�0.�15�13�02�.1�//�0,�3,�6.�9/�D9�9/�4.�0,�`b����nu�_z�Ws�Pm�Ll�Df�8_�9_�Gf�Re�DJi=4K@,7@%8@(ED/LE2N^9YkEg|Qr�[t�Zq�Um�Rk�Mi�Kh�Ki�Lk�Pm�To�Up�Xq�Zu�Wu�Wt�Ur�Tp�Rm�Mk�Kj�Ld�Ga�E\~AUt;Li3E_/AX*>U'B\/E_2Ic6WJ:ZM=\O?^QA]P@^QA_RBaTD`SC`SC`SCaTDaTD`SC_RB]P@YNR[PVbXcjcsqm�vu�xz�z|�w|�sy�mr�bi�]c�ag�lr�v|ȋ�攑褡淴��������޿�����������ܨ�ҧ�ß�����������v��q�se�cW�i`�rm����ut�[[�KN�CG�?D�;?�8=�:8�;8�D?�C;�:0�;/�7)�2#�J;�bR�k]�SG�9.�3)�5+�4+�33�ML�[X�KF�80�3*�4+�2(�-&�,%�,%�,'�0)�6-�<0�?2�0(�4,�:6�CB�FH�EK�GP�LV�Q]�Vb�Xd�[g�gp�mu�Y_�=C�.2�-4�-4�*4�%2�(6��@?�<;�85�72�92�:1�90�80�71�73�86�87�<9�;9�:7�;8�:8�84�5.�4+�7,�8-�8,�7*�3)�/)�/)�/+�25�23�12�/1�//�0,�3,�6.�8.�G<�90�3.�-*�fj�y��jr�`{�Tq�Kk�Fj�=c�3[�<^�Ph�Xe�DBbE7WP=DH1@D-JH3JB/IW4Sc?btLm�Up�Xo�Rk�Ni�Kg�Ig�Ih�Kj�Mk�Pm�To�Wp�Yt�Vs�Uq�Sn�Qj�Lg�Ie�Hd�G`�D]�AWy=Rq8Mi6Lf6Ne7Pe:Lf6Oi9Sm=UH8WJ:[N>\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC_RB_RB_RBTLY`Xgnf{tp�xt�xw�xz�y{�sy�jq�`g�\b�`f�kq�v|�~�Ε�䞞譭齼������������������߳�س�Ѵ�ů��������������y�}q�wk�sk�ng�oi扄�~�sr�ed�VY�LN�CE�>A�95�:7�B=�E?�<3�=3�B5�1%�1"�I;�YK�N@�=/�8*�6*�3'�34�UU�kh�]X�E>�;3�;2�80�4-�1,�1+�0)�/'�0$�/$�0#�9,�4'�3)�:5�CA�EG�BG�@H�DO�OZ�Va�Va�^i�go�Ya�DI�88�55�26�18�3;�9C�HS�Va�6?�4;�7;�AF�KO�IM�;@�05�61�95�;8�;9�;9�:7�73�70�;2�;1�;2�:2�82�73�64�65�<8�;8�;8�:9�;7�95�6/�4,�8-�9,�9-�7*�3)�0'�/)�0+�45�33�22�01�0/�1,�3,�6.�7.�D:�7/�1-�21�jp�rz�hr�]v�Pm�Cf�_L;_ZFQP;KI4PI6MB0DR1M[8[kFf|Nm�Sm�Pl�Mh�Hf�Gg�Hg�Ii�Lj�Ol�Sn�Vo�Xt�Vq�Un�Pj�Lf�Ic�Fa�F_�DZ�@X|?St;Pn8Pj:Tk=XmB[pEUp=Vq>Wr?RE5UH8XK;ZM=[N>\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEdWG]Ulje|yu�}y�zy�wy�vx�sw�lq�cj�[c�]e�hp�w}ǁ�І�ՙ�ܡ�௲廿����������������������������Ź����������xzuwvqulg~mf�oi�b[�a[�sm�zu�{�|y�rp�cc�ST�HH�B=�>:�<6�A;�:1�D:�TJ�>2�6)�:,�=.�?/�A3�C5�?1�8*�23�LM�_]�XS�D?�;4�81�70�92�92�92�92�9/�9.�9+�8)�)�3"�@2�I>�E>�;:�7;�9@�8A�HT�Ua�Yb�^g�`i�U[�CI�?:�?;�AA�GJ�MR�QY�T]�V^�4:�/5�03�7:�=A�:?�48�/2�61�95�95�41�1/�20�40�4.�<4�=4�=3�;2�93�73�43�33�:8�98�88�89�87�75�4/�4+�7-�9,�9-�7*�2(�0&�0(�0*�45�43�32�11�1/�1,�3,�5.�90�<3�70�0-�AA�nu�ku�co�Sk�If�;c�1`�3b�RJ7QF4MB0AL.GU4Sc>`rHgMj�Mj�Kh�Ge�Ff�Gf�Hg�Ji�Nk�Rl�Um�Vq�So�Qj�Ng�Kc�H`�E_�F_�G\�E[~DWxAVr?Uo?YpB]rG_tKYtAYtAXs@NB2QE5UI9WK;XL\P@^RBaUEbVFbVFaUE_SCaUEfZJj^Nkg�up�|x�{y�wx�vw�pt�jo�ah�^f�_g�em�px�~�͉�؏�ܙ�Ϡ�֪�۴�ߺ�߾����������������̼�ƻ�Ŵ�����������qqstpqogevhe�nj�`Y�e_�[T�g`�tn�{v�{w�ws�hf�[Z�QK�GB�=6�C=�;4�G=�\R�;0�<0�7+�6(�>.�D3�C2�A1�A0�8:�>@�DC�C@�=8�91�7/�7/�:3�93�:3�;3�>5�A5�E6�G8�.�;%�K8�L=�=3�0+�10�8>�BJ�KV�U`�Ze�]e�Ya�LR�?D�4+�8/�<7�@@�DF�EJ�BI�?F�5;�26�36�8<�79�14�-2�.4�40�95�64�0.�,*�/,�2.�2-�=5�=4�>4�<3�:5�85�65�55�57�57�57�56�56�42�2.�1*�7.�:-�:+�8*�3(�1&�1(�1*�55�53�42�11�1/�1,�3,�5.�;2�4+�;4�20�UV�px�cn�[g�Kb�Ef�7b�+]�1b�@h�Ke�RYd8/ZI7SN:UN;[P>VI8M@0MA1=H*CN.K[6Xj@ayGf�Hh�Ig�Fe�Dc�Bc�Ee�Hg�Lh�Oi�Rj�Tn�Pl�Nh�Ld�Jb�H_�F_�H`�H_�H_�H]~I]yH]wH`wKcxOdyP[vA[vAZu@MA1PD4SG7VJ:WK;YM=[O?]QAcWGdXHdXHbVFaUEcWGj^NpdTvq�yu�xv�ts�rr�su�lp�bg�Za�^f�em�lt�u}Ɓ�Ѝ�ڕ�⚤ȟ�ͦ�Ԭ�ٰ�۱�ڲ�ڵ�۳�ֲ�Ѯ�˫�Ī�¦������{�|y�dbgidhbY\g[[xeauXR�e]�OH�VO�aY�jc�vp�}z�wu�lj�ZU�PJ�D>�MG�B9�F>�WO�,"�2'�5'�=0�E6�>-�2!�8%�F4�DF�9;�32�62�;6�<7�<6�<6�;4�82�5.�4+�5+�8+�<.�>/�U;�I/�='�;+�=2�;5�65�37�KR�LV�OY�S]�Wa�U\�LS�CG�5)�8-�81�64�55�58�4:�28�8<�6;�9=�8�53�ce�py�\h�R_�Ha�Gh�:e�*]�/a�@h�E]�AFQ-!UJ8PN9OH5\O>YH8L<-NB2:D)?J*GU2Rd:]sBcEf�Ge�Dc�Ba�@a�Cc�Fe�Jf�Mg�Ph�Rl�Pk�Of�Lc�Ia�G_�H_�H`�I\�G]�H]~I`|Ka{Ld{Of{Rg|S]xC^yD_zEAC8CE:IF=OH@RGAWI@]M>`O=aQ:aS9`T>_VGaZTfaeljwro�wo�zt�~w�zu�ro�hf�a`�^^�ba�hg�qo�|xυ�ڏ�㗐흖�٣�ڥ�ܦ�ݧ�ݦ�ۥ�ڦ�٥�֣�Ң�С�͞�ɗ������y�mrvghlc_`e[ZlYUtUP�UL�VK�RG�ZN�ZP�\S�md�|t�~����xy�yy�ab�PQ�EE�YV�61�1(�5(�7&�6%�8%�9'�:+�<.�?1�8+�=/�?1�;-�5'�4&�:.�?5�90�90�7.�7+�7)�;)�@+�C,�;3�?7�D<�F>�C;�<4�2*�,$�>5�G>�QH�XO�[R�YP�PG�E<��)<�*6�.6�48�;;�94�:5�<4�;5�:5�93�73�62�25�44�54�64�71�7.�6,�6)�9*�:(�:&�9&�8%�8%�7#�7#�41�4/�4.�3.�4,�5)�6(�8*�:.�7/�96�>B�ly�as�Rl�Gd�Ij�5Y�5]�;e�=c�Pj�LVT)":1 9<)EF4RL>PH;BC39E15K4FGHJ#MQ,U\:\jGcuOf}Qe�Nc�Hb�Ba�>c�@e�Dj�Il�Nm�Qj�Ii�Fg�Ff�Ff�Hf�Ic�Ic�Gd�Jd�Ic~Gc~Gd�FfFe~Dc|BX}8[�;^�>[K>^M;`O;`Q:^S?^WGa\Vhcinlyrq�tn�vp�tp�pm�gf�aa�]^�\\�ed�kj�tr�}{φ�َ����蘒웗Ҝ�ӝ�֞�ם�֝�՜�ҝ�ў�ќ�͜�ʛ�Ǚ�ē�����w�tmtkdkf]`e[YiZSoWMzVJ�VI�UK�\R�YR�XR�f_�qj�vo�w�������uu�fd�TS�YU�2+�/%�7)�7&�7%�8%�9&�:*�;-�=/�8,�9,�:,�:,�9+�9+�8+�8,�;1�90�8.�8,�8*�:(�;&�;%�4-�80�=5�@8�A9�?7�<4�91�5-�>6�H@�OG�QI�NF�C;�7/�8�9"�8)�4,�./�*3�(7�(:�+B�*B�)A�&A�$@� >�=�<�8�9�$;�);�-9�29�7;�;;�94�:5�;6�;5�:5�93�73�62�25�36�54�64�71�7.�5,�6)�9*�:(�:&�9&�9%�8%�7#�7#�4-�3-�4,�4*�4*�5(�6)�7*�c�@e�Di�Hk�Ml�Pl�Ij�Gh�Gf�Ff�Hf�Id�Jd�He�Kd�Ic�HdHe�Ge�GfEd}C\�<_�?b�B69.:<1??7E@:KB=OE/�>/�6(�/"�:.�7-�7,�8,�9+�:)�9&�8#�4*�6,�8.�:0�=3�@6�A7�B8�;1�@6�E;�F<�H>�G=�@6�8.�6!�7&�7,�3/�03�,5�*9�*<�'=�'=�%=�#;�!:�8�7�7�6�6�#8�*;�1<�6=�9;�;:�86�:5�;6�;5�:5�85�73�62�26�47�55�65�61�6/�5,�5(�9)�9)�9'�8%�8%�7$�7$�7$�4+�4)�4*�5(�6(�7&�7'�8)�=1�2+�98�lt�]n�Pi�=[�Jl�5\�=e�4[�<`�Tq�?Oa#(H1+79+-8'18&:;)B=*A<(@>)@B*?GY`4s~T��fw�bi~Ub|MaI`�C`�?a�>c�@h�Ej�Jk�Ml�Pn�Kk�Hh�Gg�Gg�Ih�Kf�Kf�Je�Ke�Jc�He�Gf�Hf�Ge�FcDb�Be�Eh�H06*58-;<4A>9G@:KB;RE.�?.�8(�/!�6)�5)�4(�6)�9+�<+�=*�;(�9/�9/�9/�9/�:0�;1�<2�=3�E;�E;�B8�=3�=3�A7�A7�=3�4#�6)�5.�31�/5�+6�(7�)<�&9�&;�&;�'<�&<�%<�$:�#:�!7�"7�%7�-9�5>�:?�9:�87�86�:5�;6�;5�95�85�65�54�27�37�66�65�72�6/�5,�5(�8*�8(�9&�8&�7$�7$�6#�6#�6'�7(�8'�9(�9(�:(�:'�:+�;/�3.�IK�o{�Vj�Da�=_�Ci�/[�7`�=c�Ll�Oe�0=G >3--3'+8'2=,=B.B@+C;$G="MA'R_*q}M��p��|��mj�W_{J]~E_�Ca�@b�?f�Ck�Hl�Lm�Qm�So�Ll�Ii�Hh�Hh�Ji�Lh�Mi�Mf�Ld�Jd�Ge�Hf�Hh�If�Ee�Df�Fi�Il�L-3'17-7:3<;6B=9G?UOCZUQa_dhgukk�ll�jg�ba�XV�PP�QQ�XY�`c�fj�or�ux�|Ѓ�ֆ�׉�؊�׌�،�̋�ˊ�͉�Љ�ш�ъ�Ӊ�Ќ�ϋ�ȍ�����������}x�vp��Sc�Q\qUT`^RVcOTbH_]DvUB�LB�RR�PW�PY�\d�ej�lj�wq�vl�ph�~v��{��~�ka�?2�8(�;(�='�='�='�;'�:'�8(�8)�8/�7.�8,�9+�;+�;*�:)�7(�9+�7+�8,�7+�7*�8*�<,�>-�=0�<0�<0�;/�:.�8,�7+�5*�@5�@5�=2�8.�8.�;1�:0�6,�.$�0)�2.�23�/8�-9�+;�+>�-?�.?�0@�/@�/A�.?�-?�->�)9�)8�*7�0:�6=�9=�77�53�86�:5�;6�:7�95�85�65�54�38�48�56�76�74�6/�6,�5*�9*�9*�9(�9&�9&�8&�7$�7$�9%�:&�<'�=(�=(�=(�>*�=.�8-�;8�^e�aq�Pi�;\�Ai�6a�/]�.W�Ij�Yq�>NX'-?+,730*1)-9-5@/:B+<<"B;VG(iV6v�P��l��������wo�[aK^F`�Bc�Be�Bj�Go�Lp�Po�So�Uo�Ll�Ki�Hg�Gi�Ji�Li�Nh�Nf�Je�Id�Hf�Ig�Ih�Hg�Gf�Fg�Ii�Kl�N*2%.4*470894<;7B=:HA;KD(�>(�=(�;(�;)�9)�8*�3+�6-�:.�:,�:)�9'�;)�=,�>.�@2�A4�=1�7*�4&�8)�<,�:,�:,�;-�;-�;-�9+�6)�5(�6*�;/�>2�>3�?4�>3�7,�.#�)%�-*�02�29�0;�/>�/?�0A�0@�1@�2@�0=�/:�-9�,8�*7�/<�/;�0:�2:�6;�68�55�42�86�:5�:6�:7�87�77�67�54�49�49�69�76�74�6/�6-�6*�7+�8)�8)�9'�8'�8%�8%�8%�:$�<%�>&�?'�A(�A*�@,�=.�71�IK�gr�Od�Hf�7]�Am�/_�1^�1X�Oj�Wfh39@*,?994443524925>-2<#29ECl`8�}R��u����Η�ȕ��}v�be�Q_�F`�Bc�@g�Do�Jr�Or�Rq�Up�Vo�Ll�Kh�Gf�Fh�Ii�Li�Ni�Og�Kf�Je�If�Ih�Ij�Ji�Gg�Eh�Jk�Mn�P(0#*2'/4-350664<87@<9C>8IE�3>�0>�0@�/?�.<�/<�/9�07�.5�,2�+2�)/�1;�3<�5;�59�47�55�65�75�86�97�:6�:7�87�77�67�46�5:�5:�7:�87�74�72�6-�6+�8*�8*�9(�9(�9(�8&�8&�8&�:"�;"�>$�?%�A(�@*�>-�;1�:6�U\�_o�Gc�>b�8c�6g�0c�4\�Cb�Ma�BIL44:97<<>948>58<7379+3="8DS[,��P��o�Ȉ�ˎ�̒�Í��}{�gg�Q^�E^�@c�@i�Do�Js�Ps�Sq�Uo�Un�Mk�Jg�Ge�Eg�Hh�Ki�Ni�Nf�Ld�Id�Ig�Hi�Jj�Ii�Fh�Ei�Kl�No�Q&.!(0%-2+130333756:97>;6GD=DD*�<'�8$�5#�B2�OA�N@�B4�7)�7)�>/�;+�:*�8(�6'�6'�6(�8*�8+�;.�;/�9-�5*�7,�;1�<2�9/�7:�8=�:A�8B�4A�.>�,;�,:�/;�19�38�58�57�48�36�45�49�6;�9<�69�45�33�86�;9�86�97�98�99�89�69�67�46�5:�5:�7:�79�85�82�7/�7+�8+�9+�:*�;*�:*�:*�:(�9(�: �: �=$�?%�@(�@+�=.�81�h�Co�Jr�Or�Rp�Tn�To�Mk�Ig�Fe�Ff�Gh�Ki�Ni�Nf�Ke�Jd�Ge�Hg�Hh�Gh�Gf�Dj�Lm�Op�R(0!'/"(-&+-*.0/333775:94==5?@8DE?JLKQQYVWiZ\s]^|YW�[Y�^]�ee�nn�wx��ڄ�䊌������솇䂂܀�Ԃ�Ӄ�Ҁ�ā�ǃ�Ʉ�Ά�҈�Ջ�֌�Ҋ�NJ�����~��x�wpxkeec^XpZMm[Mi\Kf^Kd_IcaHfbGl`FlR;�UA�^O�aY�YX�PT�Q[�Xb�kc�YR�D<�70�7/�;/�/�@/�@-�=*�9'�9)�0"�VJ�J?�.#�=1�2�<0�7,�7-�>4�E;�AF�8?�3:�4?�2>�-;�,:�2=�7@�5;�68�78�99�:9�86�65�==�<<�:<�89�77�76�75�75�97�98�99�::�9;�9<�9<�8<�6;�5:�7:�9:�:9�;5�90�7,�7+�9)�:)�:)�:)�:)�;*�;)�9!�>%�;#�5�:$�E3�@6�0.�^e�Vg�Hc�;\�0X�/[�5c�c�?i�Dn�Im�Ll�Nk�Qj�Rj�Hf�Dc�Bc�Df�Gh�Kg�Ld�Jg�Mh�Ng�Kf�He�Ef�Ej�Im�Jp�Sr�Ut�W*0")/#).'+-(-/.222553782;<4>@5BC;HJGOPTSUaXYm[[s\Z�^]�da�kj�us�}Ї�ዋ퍌��텄 ڀ~Ҁσ�υ�Ɔ�ȇ�ˉ�΋�ь�Ѝ�Ύ�Ɋ�����{��x�{s�tknkd^e\SbaLb`Ke^Kh]Ii\Ij^Hk_Gm_EraG{]C�[F�[L�WP�QS�PX�S`�WQ�KF�>9�50�5/�90�8,�8*�8&�8&�8&�8)�7)�5,�3,�2,�1'�4)�9+�=-�A/�@-�=*�9(�9)�<.�QE�H<�4(�:-�:,�5&�=+�=+�;*�;*�:)�8)�7)�6(�7*�8,�7,�3)�1'�1(�7.�=4�BH�7>�07�/:�0;�.;�1<�6?�6<�36�32�:8�EB�JF�EA�?<�:9�:8�97�96�85�85�98�98�87�88�99�9:�9;�9<�8=�7<�5:�59�68�88�:8�:5�91�7-�8*�:*�:*�;*�;*�<+�<+�<+�9"�?)�;$�5�;'�>];2@>/3A05?4E=:X;?T-0X51ZI7bjEu�[��p��|��|��}��������yr�`YuESq?\{B_>b�>i�Cm�Fl�Kk�Mh�Mh�Qh�Fe�Dc�Bc�Dg�Hi�Lh�Ng�Mi�Oi�Mi�Kg�Gg�Gf�Gj�Im�Ln�Qo�Rr�U-1"-1#,/&,.).0-11/34/45-9;0<>1@B5EH?KMLQRWUTbXWi\Yx^]fc�pm�zx���ύ�ᐏ퐎�釃�~�|�}ȁ}Dž�Ĉ�Ɗ�ʌ�ˌ�ˌ�nj���������|��v�{p�ujpod`i_Ue\MXeK]bKa_Jh[HmZIp[Hq\Go]EtcItZ?�V=�WD�YM�TS�NT�IU�@<�<9�84�61�6/�6.�6+�7(�6&�8&�8&�8'�6)�5,�3,�1,�5(�6(�9)�<+�@-�@-�=+�8(�5'�J=�E:�A5��7@�=C�7;�AA�NK�ZU�ZU�RL�B>�62�72�74�74�74�85�96�;8�::�77�88�89�8;�9<�8<�7<�7<�38�47�57�77�:7�:4�8/�7,�8+�:+�;+�<+�<+�<+�<+�<+�9$�@*�9$�7$�;+�2%�40�OT�Zi�H`�8U�6V�>]�Ff�Hf�Eat?9e?6QA2@C04?.29)>5,O61K*#W:,j\B��_��t��{��y��v��|��������m\uKHa7Nh9[xB_}?c�?h�Bl�Ej�Gh�Jg�Le�Me�Cd�Cc�Be�Fh�Ij�Nk�Oj�Nk�Ok�Oi�Mh�Jg�Hi�Hl�Ip�Ms�Vt�Wv�Y25$13&02'01+12-23.34.46+9;-;>-?B1DF9IJBNNNRQWTR]XVd\Zoda~nl�zw���Č�ؑ�唑쓏펋扅ڂ�{�|��}����������Ë��������}��{��v�zm~sfmoa`k^Vi[NgZJVdJZbJa_JjZJpYIsYJtZIs]FqY?tU9�T;�ZF�\P�RN�EG�:A�3/�41�51�50�5.�4+�6)�8)�7$�8$�8&�9'�6)�5*�3,�2,�8+�7)�7(�:*�=-�>/�;-�8+�3)�TK�;3�8.�A6�4'�<-�>-�7&�8'�9(�:)�8)�7)�6(�3'�5*�3)�2)�4,�:3�>7�?9�>8�47�59�6;�5;�2:�39�7=�<@�UV�c`�nj�id�VQ�A<�61�3/�71�71�71�82�85�96�97�::�78�89�8;�9<�8<�8<�8<�8<�48�68�67�87�;7�<4�9/�8.�9,�;,�;+�<+�<+�<+�;*�;*�:'�@,�8&�9'�;-�+"�54�_g�Sd�E]�;U�1B2SE*okH��f��t��t��q��t��������}l�\K_:BV1Lc7Yq?_{@d�@i�Ak�Di�Fg�Id�Jb�Lc�Bc�Bd�Cg�Hj�Mk�Om�Qn�Rj�Pj�Nj�Li�Jg�Gi�Gm�Kq�Mu�Yv�Zx�\78(78*66,56056156167/68+;>-=@+@C.DG4IK=NNFQPNSQTVUSYY[a_lki�us��}���Ȍ�֕�㔐䐍ދ�ӄ�Ɓ}�|��{�~����������������z��x�s�znzrfjm_\j[Tk[NjZKjYI^bK_aKe^Kk[KpZLtZKw\Kz[G{WA�S=�U?�XF�SF�F?�76�01�2-�3/�5/�4.�2*�2'�5(�9(�7$�9$�:$�:'�8)�7*�5,�3,�>-�:)�6%�8'�;+�=.�;.�6,�80�\T�=5�4+�A5�3$�:(�@-�9)�:*�:+�:,�;-�:-�8-�7-�3*�1)�1+�71�;7�>:�;7�74�77�;<��7=�7=�69�79�7:�::�=:�=7�;2�;/�9*�;*�<*�<)�=)�<(�<(�<(�:(�=*�9'�:*�9-�0)�AA�gr�L^�E[�BY�F[�N^�T]�VW�SQSU@LN9JG4JE1FD-AA'>C#@G%MU.^g,?=.==1==5=<7;<6;=2;=/?B-@D+CG,GI1KM8NOASPITQLYXDZ[M_^Zgepqo�{y������Ə�ӏ�Ս�ъ�ǃ��~z�zw�{u�zw�|y��|��~��~�y�|t�zrvkqrffm`Zl[QlZNl[KmZKmZIg^Mi]Mi]Mj]Mn]Ms^My^M�[I�`O�WG�N@�I=�@5�6.�0)�0*�51�5/�4/�4-�2)�3'�6&�;(�9$�;$�<$�<'�:)�9*�7,�5,�A.�;(�6#�5#�:)�=.�;/�6-�>7�ZT�HA�90�@3�6&�4 �>)�7'�7'�7'�7(�7)�7*�7,�8-�<3�:2�93�<7�>:�=9�85�41�96�<9�::�8:�>@�OR�cc�qp�he�UP�=8�2+�5.�;7�<:�:9�<3�:2�:4�83�73�65�55�68�69�69�7;�8<�8>�7=�7=�6<�8:�8;�8:�;:�>:�>7�<2�+>467>O#Jh4g�Tt�\��c��d��f��l��t��x��pn}\Q`C=J09F,BO3O_;Xi=czDg�Bk�Dk�Dh�Fe�F`�G`�Gf�Ci�Fj�Kl�Ml�Ok�Om�Ql�Rm�Qm�Qm�Pl�Lk�Jm�Jr�Ou�Qy�]y�]x�\CB0DB3DB6EB9CC;CC;BB8AD3CG0EH-GJ-JM0OO7RQ?TREURI[\:\\@\]Kaa_ihvrq�{z��~������È�����{�ys�tp�qm�ol�rn�tq�wr�wr�to�skxrilmb^l_Vj\OlZLn[Lo\Kq\Kq\KrZNq[Nn\Nl_Ol`PqaQy_N�[K�_S�OE�A8�:2�5-�1(�1(�5*�70�6/�4-�3*�4(�5(�6%�9#�;"�<$�>$�>'�<'�;*�9,�8,�D/�<(�5!�4!�9(�<.�9/�5-�83�NI�SM�B9�B5�@.�2�?(�;,�9+�8*�6)�7+�9.�;1�;3�D=�A<�?;�>;�=;�;:�88�77�93�95�84�;:�JJ�\[�dc�ca�=9�82�4.�81�B=�E@�=;�42�;3�;3�92�84�84�66�77�77�69�6;�6;�8<�8>�7=�7=�6<�68�69�89�;9�>9�>6�<1�<.�8)�;)�;(�;'�;&�;%�:'�9&�?-�7%�=,�:)�3'�QK�km�\f�N^�I\�HW�JU�SS�]R�fQ�jP=Sg{Fh�Cl�Ek�Di�Gc�Fa�G^�Gi�Fl�Im�Nn�Ol�Oj�Nk�Ok�Qp�Tp�Sp�Ro�Po�Nq�Nv�Rw�Uz�^z�^y�]GD3HE6HF9HE�61�3/�5/�5+�7*�8)�6/�4-�3,�4*�6*�7'�7%�7 �<"�>"�>$�?'�>'�<*�:,�9,�E/�='�3�3 �8'�;.�9/�5.�/*�?;�YT�I@�D7�I7�5�D,�F7�D5�A3�?2�?3�B7�F<�G?�B;�>9�;7�74�64�65�77�99�>7�:4�73�<:�IH�ML�=;�(%�-(�5/�@9�C=�A;�=8�>;�?>�:2�:2�92�84�95�96�99�9:�7:�6;�7<�8<�8>�7=�6<�7<�59�58�78�:8�<7�<4�<0�:-�8(�:(�;'�;&�:'�:&�:&�9%�?,�4"�>,�:*�1&�\X�y|�T_�Tb�I[�DR�GO�SP�bS�lS{rSC[C?H3B7%O6"_K0prJ��i�ǀy�t{�qu�]o�Hy}J��Xy|O\d5:D)3=$4>&WN?XO@YPAZQB\SD]TE]TEcZKbYJbXNcXRg\Zmacsfmwjs|n{~p}�s��s�~p}wjtobli\fcb]a`[a^W_\U_[R^ZOa[ObZMe\Kg\Ji\Ii]Gk\El]Fm]Dm]D_gOkiTqZH{M@�RI�WL�TI�WH�N:�G2�?*�;(�:.�72�23�,1�7.�7.�7.�8.�8.�7-�6+�6+�7+�7+�7+�7+�8+�8+�8+�8+�=.�=.�8(�2!�2!�;*�>/�:,�6+�6-�:2�B8�I>�G9�;,�1!�OG�IA�E=�E;�H?�G@�C>�<:�54�67�8:�9:�77�72�:3�>5�KA�E;�=0�7)�5&�8)�>.�A2�;/�<2�>5�=8�;9�79�67�68�7>�7>�7<�8:�99�97�:5�:3�5.�6/�81�84�97�98�9:�9:�;>�9;�99�<<�A=�C;�B6�@3�;+�=+�>,�<*�;(�:'�9&�8%�F2�>/�/%�-(�IK�ko�lq�WZ�OP�TQ�VO�YP�[P�]R�^V�`XMb!:O3JOf x�I��h��r��t��p��akN\lEWdHS\GHN@=C9;<,AB4=?2:=2,�:)�9,�70�42�22�6-�7.�8.�8.�7-�8-�7,�7+�7+�7+�7+�8+�8+�8+�8+�9+�>/�=.�9(�2 �3 �:)�=.�;,�:-�4*�3+�;0�E:�PB�RC�QA�E@�@;�<6�;5�>7�=8�96�33�69�68�79�68�77�97�=9�?:�C9�?2�:,�6'�5&�8)�=-�@1�A4�A4�@7�=8�97�67�56�68�6<�6<�7:�89�87�97�95�:3�92�:3�:3�;6�:8�:8�99�99�9;�:=�<=�?=�@;�?6�<2�;-�;+�<,�=+�<)�;(�:&�8&�7%z;)�8)�5*�;5�QP�ce�]a�MM�NL�SO�YP�\R�^S�^U�_V�^VSg*Sg(^r3z�O��l��z��n��`j�Fau@Sf9IY5FP7?H59?358/;<,AB4=?2:=2;A5:C2@M3Rc?]uCg�Hq�Lp�Jm�Hk�Jk�Lh�Km�Tn�To�Sm�Qk�Lj�Hl�Hm�Hp�Jn�Jp�Ls�Ou�Tx�Xx�Xx�Zm�\b�QY�H]TE]TE]TE]TE]TE]TE]TE]TE[RC\SD]TE^UF_VG`WHaXIaXIe]He]Jd[Jd[Le[Qf[Uh]Yh\\i]]j^`k_ak__i]]f[YbWU`USYVMWTKTQHRNCQMBSOCWQCXRB^WG^WEaYFc[Fg\Hi^Hk`Jk`J^cOmhUy_P�XN�[T�VQ�HE�E>�@7�>3�<-�9*�8+�9.�:/�;1�7-�7-�7-�8.�8-�7,�8,�7+�7+�7+�7+�8+�8+�8+�9+�9+�@1�>.�9(�2 �3�:&�=,�=.�?0�7+�2(�3(�<0�F9�M?�QB�87�43�20�52�:7�>;�=<�;<�8<�5:�27�24�56�97�<8�=8�;-�9+�6'�4%�5%�8(�<+�=.�D7�C6�B8�=7�96�64�55�67�5:�6:�69�79�77�95�:3�:3�:3�;4�<6�<6�;8�:9�99�88�9:�;<�@>�A=�>7�:1�7+�7(�;,�=+�=*�<(�;(�9&�8%�7$u8%y6%�9,�E=�RO�VT�OO�HH�LH�SL�ZO�^S�bU�aW�_V�]UgxB{�U��n��������zz�YYp:?R$AS)AQ-?L0:C.6<.690581:;+@A3=?29<1;A59B1@M3Qb>_wEi�Js�Nr�Lo�Jm�Lm�Nk�Np�Vq�Uo�Sn�Pl�Kk�Il�Hm�Ip�Jp�Jp�Lu�Sx�Xy�[u�Wq�U_�NVEOx>aXIaXIaXIaXIaXIaXIaXIaXI_VG`WH`WHaXIbYJcZKd[Ld[Le]Ff^Gf^Ig_Lg^Of\Pf\Rf\Sh]Wh]Wh^Uh^Ug]Se[QdZNdZN]YNZVKVRFRNBPL@PM>RO@UO?WQAYTA[VC^WDaZGd]Jf`JgaKadSleUt]O�[Q�b\�YX�DD�9:�;8�:6�80�8-�8)�:*�@.�C1�7*�7*�8+�8+�8+�8*�8*�8)�8)�8)�8)�8)�8)�9)�9)�9)�A2�>.�9'�4 �2�8"�=)�@.�>/�9+�6*�4*�7+�;.�0�26�14�02�34�88�;<�=?�;?�6<�38�/5�05�47�77�64�30�7(�6'�6&�7&�7&�9'�:)�:*�A3�A4�A7�?8�:7�85�76�67�6:�6:�68�76�86�94�:4�;4�92�:2�:4�;7�:8�98�97�89�<:�@<�B?�A;�;2�6+�5'�7(�;*�<)�<)�<(�:&�8$�7#�6%z@,v5#6'�E;�OH�MI�LG�PL�PH�VL�ZO�_R�bT�aV�aW�`W~�]��z��������ts�YN`8/A->3B%:F.=F3;A3:=2;<4<=79:*?@2<>19<1:@49B1?L2Pa=`xFj�Kt�Os�Mq�Lo�No�Pm�Pp�Tq�Up�Ro�Pm�Ll�Jn�Jo�Kq�Mr�Nt�Sy�X|�]w�[m�Sd�J[�LS|DNw?cZKcZKcZKcZKcZKcZKcZKcZKcZKcZKd[Ld[Le\Mf]Nf]Nf]Nf_Eg`Fh`IiaLiaNi`Oh_Ng^OjaRi`Qi`Qh_Nh`Mh`Mh`KiaLb_P^[LYVGTQBPM>NKTQ>VS@YVC\YF^[H^]I`aSf^QmWJ�[R�hc�b`�LM�@C�:<�79�74�70�9+�>)�D+�H-�7)�7)�8*�9+�9+�9*�9*�8)�8)�8)�8)�9)�9)�9)�9)�9)�A2�>.�:(�7"�5�7 �>&�B-�<*�;*�:,�8-�8.�:.�<0�>2�5<�3:�27�36�46�46�46�15�5:�39�38�5:�8:�66�2/�,(�9(�:(�:(�:(�:(�:(�9&�7&�:+�<-�?3�?7�=8�:6�86�87�56�66�66�74�84�93�:3�;3�:2�;2�=5�=9�=:�><�=;�==�A<�B<�A:�<3�7-�5(�7(�;)�;)�<)�=(�;(�9&�8%�7$�6#}C/s4"y4$�G:�RG�NF�NE�WN�UL�XL�[N�\N�^R�`U�aW�bY��d��|�����j]kJDS42@&$2-:&0;*5=.9?36:;3::29:*>?1;=08;09?38A0>K1Pa=ayGk�Lu�Pt�Nr�Mq�Pq�Ro�Rr�Sr�Sr�Qp�Om�Km�Ip�Lr�Ot�Qv�Sx�Y{�^z�_q�Vd�JY�?]�NVGQzBe\Me\Me\Me\Me\Me\Me\Me\Me\Mf]Nf]Nf]Ng^Og^Oh_Ph_Pg`Fh`IiaJjbMjbMjbOjbOjbOjbOiaNh`Kh`Ih`IhaGibHjcGe`Mb]J^XHXRBSM=MJ9KH7IH6KJ8LK9LM;NO=PQ?QTASVESVEYYM]WKcQEzXN�ha�ea�UU�OR�=C�8>�67�62�:.�@+�E*�I*�7(�7(�8)�9*�9*�9*�9*�8)�8)�9)�9)�9)�9)�9)�9)�:)�@4�=/�<+�:$�7�6�<#�B*�C.�@/�;,�7*�2(�4+�:2�@8�1<�2<�5=�8>�:>�;>�:=�9<�48�5:�8<�;>�;<�86�1-�-'�<+�=,�>*�>*�=)�<(�:'�8%�6%�7)�;.�=3�<5�;7�;8�;7�75�75�75�84�94�;4�;4�=4�>5�?7�A:�A;�A>�A?�??�??�B:�@8�<3�8-�5(�5'�8(�<*�;*�<)�<(�:&�9'�7%�6$�5#y<)r3!}:*�OA�YL�RG�OE�VJ�ZN�[M�[M�[O�\Q�^T�`Y�a[s}Xy�`r|ZU`B9F,/;'0;+1;03=44;35<4:?8?B9?A6<<277+89)>?1:27@/=J0O`HO?HO?PPDVRGYOChRE�YM�UL�RL�XW�GJ��:A�?C�BC�AC�@A�>?�12�56�::�<;�;7�73�4.�3+�>+�>+�>+�?,�>+�>(�<'�;'�7$�7'�8+�8.�8.�92�<7�?;�85�85�84�94�:4�;4�=4�>4�A7�C9�C<�B;�A=�?<�=;�<9�>3�:/�8+�6(�7'�8)�:)�;(�=)�=*�<)�:'�9&�7&6%~5$v4$x5%�B2�UE�XK�QC�PD�ZL�ZM�[N�]O�\Q�\R�\U�[V�\W`hCX_=JS4>G,6?*2=-4>35?74=88>:=B/;9*78(=>0:26?.=J0N_;`xFk�Lu�Pu�Os�Nr�Qr�Sp�Sq�Mr�Nq�Mp�Lo�Kr�Nu�Ry�X�`~�az�]q�Uf�L_�G[�E\�Hb�RY�ISzCh_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Pg^Oh_Ph_Ph_Ph_Ph_Pi`Qi`QmcWlbVjaRi`Qh_Pg^Og^Mh_NiaNiaLiaLiaJh`IhaGhaGhaGh`Kg_Je_Ib[H\WCUR?PM:ML:EF4DG6DH7BI9BI9BJ;BJ;BJ;JJ@QQERPAUN�YS�QO�CE�8:�55�:3�>/�>)�<$�8'�8'�9(�;*�;*�;*�;*�;*�:)�:)�:)�:)�:)�:)�:)�:)�=2�:.�<,�>+�9#�5�9�@'�:$�<)�?0�;1�8.�7/�<5�A;�;B�>F�BG�CE�@?�;7�50�1.�0,�51�:5�<6�:2�9.�9,�9,�>+�>+�?,�@-�@-�A+�>*�=*�<(�:(�7(�5)�4*�80�?8�D>�:5�:5�;4�;4�<4�=4�?4�@5�C9�D:�C;�A9�?:�;6�85�73�9-�7*�5'�6'�:)�<*�:)�9&�=*�=+�=*�<)~:'|7'{6&{6&y1#�8*�G8�RE�PB�K?�SE�_S�XK�ZN�\R�]T�\V�[V�YT�XSV^7EM(6@8A&>G27@E>GJ?GI;BC1?>);;#78(=>09;.69.8>26?.E5>F7?G8=H8AE4HK6YS;_F0�K9�j]�f`�SS�DE�@@�?=�=5�=0�>/�3$�5&�6'�7(�7(�8)�;,�=.�<-�<-�<-�<-�;,�;,�;,�;,�3,�7.�;-�;)�8"�7�8�:"�B-�<+�7)�4*�6/�<7�C?�HC�BG�DH�CC�:6�61�80�8.�5+�:/�9.�8.�8-�9,�:+�<+�>-�=*�=*�>+�?,�@-�A.�B-�@-�<*�:(�7(�6)�6+�8-�;1�=4�:4�<6�?6�@7�A7�A6�@4�@5�G=�E;�A6�;2�6.�3-�1,�1+�;-�:,�:+�:*�:)�;)�<+�=+~:'|9(|9({:({:(z9'x6&w4$z, �A4�NC�MA�L>�RE�VH�RG�\R�\R�UM�TL�ZU�XS�WR�`^R[0IQ(AK&BK,>H/7@-2=-4>34;3HPEX^RW[LLO?1;=0:=29?34=,;H.Pa=bzHl�Mu�Ps�Mq�Lp�Or�Sq�Tp�Jq�Kr�Lr�Ns�Pv�U{�\�b��fx�^i�O_�G]�G`�Jf�Oh�Rd�U[�LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^^j_]j_]j_[j_Yj`Wj`Vj`Vj`TjaRjaRjaRjaRjaRjaRjaRj_Kh`Kg_Jg_Jd]J^YEUR?ONE5?E7>F7>F7=E6BF8>E5=F1DN5HK0PB'yS<�ub�dX�_Y�UT�FG�>>�@=�>9�82�:+�<-�=.�<.�;-�:,�9+�9+�:,�:,�:,�:,�:,�:,�:,�:,�?9�A:�A7�=/�6#�2�2�3�5#�7(�;0�A8�E?�ID�JF�JG�BC�ED�C@�;5�9/�>1�A1�?.�@1�@0�>0�?/�?-�?.�A.�B.�;*�;*�<+�=,�?+�?+�?,�>+�@.�=-�:,�9*�8+�8-�:0�:1�90�;2�>5�A7�C7�D7�D9�E8�B6�A4�=1�:0�8-�5.�5,�5.�=,�=,�;,�;+�:*�;*�<,�=,~;*|;)y:)y:)x9(w8'u6't5&�1)�C9�NC�K?�J>�PD�TI�RG�SJ�WQ�UO�UR�\X�WT�SO�\XT]0Zc8_j@[eBIT66C)4@*0:-;H.Pa=c{Il�Mu�Pt�Nq�Lq�Pr�Sq�Tq�Kp�Lp�Jq�Mt�Qx�W|�_�c{�ao�Uc�J]�Fa�Je�Ne�Nc�Ld�U[�LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qj^`j^`j^^j_]j_[j_Yj`Wj`Vj`Vj`Tj`Tj`Tj`Tj`Vj`Vj`VlaMk`LiaLiaNf_La\I[VCTQ@ML:HI9DG6AE6AE6?E7>D6=C5=F57@-?H3EM5AA%QA'�]E�u`�WH�bZ�eb�RS�EF�FH�BD�79�9+�:,�:,�:,�:,�8+�6)�6)�8+�7+�7+�7+�7+�8,�8,�7,�3/�5/�5-�3(�0"�0�1 �4$�A2�C7�G?�KF�LG�JF�FB�C?�CC�DA�@:�;1�=/�C1�F4�G3�E3�E2�C2�B0�B0B/{B.xD.�8*�9+�:)�;*�<+�<+�=,�<*�?.�=-�;+�9*�8+�9-�:/�;/�7.�90�;0�>3�?3�@4�@3�A4�:,�:,�9+�7+�7+�7,�8.�91�=-�<,�<+�;,�:+�;+<+<,};+z;*z;,w9*v8)u7(t6's5&�91�F<�MB�J?�H<�OD�SH�QI�NG�SO�SO�VS�]X�YU�ZT�f_w�S~�\��`lxPJX46D#=J.MZ@eqYeoW\fMNWMKB3;I27C-EJ3IG0K<%mN9�dO�`N�A5�SL�c_�^^�RU�JM�DH�>C�;/�9-�7+�7+�9-�:/�;0�;0�>4�>4�>4�>4�?5�?5�?5�?5�?=�B>�D>�F=�G<�I>�N@�PD�SJ�OG�LG�IE�FC�C?�A=�@<�FD�C?�?7�<1�>.�D2�H3�J6�G4�F3�D3�C1B0zA.wC.uB/�8+�9+�9+�:,�:,�;-�;+�;+�:+�:)�8)�8*�9,�<-�=/�>0�9/�8.�9/�:.�:.�:,�9+�8*�7)�7*�7(�6*�7+�8-�9/�;0�=.�<-�;,�9*:+~9*}:*};-|:,z;,y;,w9,s8*q6(q7)q7)�B8�G=�K?�H<�I<�OD�UJ�TL�PL�SP�QO�RO�\X�_X�h^�zn��k��fu�VYh=CR)?O(P`B'=A&;>#78(:;-79,9<1;A57@/MKH/JH1Q?+e>-�ZL�`S�>6�4+�@9�XU�ig�de�RU�IN�KQ�J@�F<�@6�>4�@6�D:�G=�G>�JA�JA�JB�JB�KC�JC�KD�KD�RT�ST�TP�SM�SL�SL�TN�UN�LH�HF�EB�B@�B@�B@�EB�EB�JH�D@�>7�>2�A2�C1�F3�I6�F3�D3�C3�@0@1}?0y@/x@1�9.�9.�:.�:.�;/�;-�;-�;-�9*�9*�9+�9,�:+�;-�<.�=/�;/�:/�9-�:.�9,�8*�8*�8*�8)�8)�8(�8)�9*�:,�:-�;-�;-�:,�9+~9*}8)}7+|8+{9+z8*y9-x:-t9+q5*o5)q7+r:-�G;�H<�I=�I;�K=�RF�WM�WO�QM�TQ�RP�VQ�`Y�bW�h[�whivKZi>JY.AR&IZ0Wi?dvLj|TXjDL\8?M,:D)C-=@-:=*89):;-68+8;0H-NC-b=-�D:�VP�MJ�++�:9�=;�TP�pn�wv�eh�Y^�]c�VO�OH�G@�C<�D=�G@�GA�GA�HC�ID�ID�IE�JF�JF�KG�KG�GJ�GI�GH�GG�HD�HD�GD�EB�BA�AB�@C�BB�BB�B@�A>�A=�JI�B@�<6�>3�@3�A2�B0�D3�A2�@2�>1�=1�<2�<1=1}=1�:3�;3�;1�;1�<1�<1=/=/=/�.�9)�9*�:*�;+�;,�;+�;,�;+�:,�9+7)~6*{5){5)z6)z6+x6*x8,w9.s7,o5)o5)r:-u=0�L>�K>�J<�M=�QC�VH�XM�WN�MI�RQ�TR�[W�e\y_PcXFb]IBP,?M)?O(K\2_qGk~QcyKVk@M_7@R,6E&7D*=F1=D4:=27:19:*:;-68+8;0G*SA+{E9�NL�EH�5<�19�@E�?@�JI�b`�rp�op�be�Z^�RJ�LD�D=�B;�D=�E>�C<�?9�C=�B=�C>�C?�C?�D@�EA�EA�?D�@D�DF�FH�IH�JI�II�FH�AC�AD�AE�AC�AA�@>�>:�=8�EG�=<�73�;4�@4�?1�>0�A1�=/�<0�;1�92�81�93�:4�;4�:4�:4�<3�<3<3}=3}=3|<0{=0{=0{=.{<-z;,y:+z8*z8*�:0�:.�:-�:.�:.�;.�<.�=-�9)�:)�:*�;*�;+�;,<+}<*�8,�8,~6*}5)|4(z4(z4*y5*u3'v6,v8-r6+n4(n5*s:/v@4�PB�N?�N=�R@�VF�XI�UJ�RI�NI�RP�SO�\V�fZl\LML7BL3@O.KZ9WgC`rJezOdzLVl=G]/AV+7I#0A!5C*=F5QJ:MG7IC3GA13M*>G*[B.�PG�VV�7?�'3�BN�:C�9>�;:�HG�][�gf�[]�IL�JD�F@�C=�C>�GB�GB�B>�=9�C?�B?�C@�DA�DB�EC�EC�FD�>C�?D�BE�EG�GG�FF�BC�=A�AD�>C�;A�<>�>>�A?�D@�FA�@C�78�30�:4�?4�>1�=/�?2�;.�9.�80�61�71�73�84�:5:3:3:3~;3|<3|<2{=2{=2u9.v;-w<.w<.x=-x=-y;,y;,{;1};/~8,�7*�6)�5'�6(�5&�7(�8(�:)�;)�<+�<,~=+{<*�8,7+~6*|4(|4({2)y3)y5*t1(u5+v8-r6+n4)n5*t;0xB6�TE�Q@P>�UB�YH�YI�SG�NG�SN�RP�PK�VO�bUeZHFK4;K0IX;[jKgxVewQYnCSi;Me5I`28M"-B*;2@):E7;B;8<;7;<<=-<=/79,9<1=C77@/6C)DU1Rj8_{@m�Hp�Jq�Lr�Qt�Ur�Uq�Qt�Vu�Ys�Ym�Sd�N\�HZ�Dd�Na�J`�Hc�If�Ji�Ie�Da�>`�PWyGPr@i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTo\Nq_QtdUrdWnbTj`Th`ShbTgaSebQa^K[VBVQ;TN6NH.GA'RD)N=#cI2�iV�zm�ng�[W�PQ�BE�@E�@G�BF�DG�EI�GI�GI�BE�BE�BD�EE�DB�C;�D:�H;�F7�H9�H:�G?�EB�BD�?F�=E�BD�BD�BD�DE�DE�ED�ED�ED�DA�C@�B?�@>�?=�?=�?=�@>�E?�?8�:2�80�:0�>4�@3�?2A4|@5}?4<3�:3�83�73�72�<-�<-�<-�;,�;-�:,�:,�:,9-9-9-~:/~:/~:/~:/~:/~80~80}90}90}90}90|90|90|90|90z:0y9/y9/x8.w9.w9.w8/w8/v7.t8.s7-r6,q5+p6+l2'q7,m4)l3(o6+m4)q8-�H=�UL�TL�QK�PJ�NJ�NL�NM�PL�SM�UK�\NdOkaFTW8JX5N_;g�T`zMWpFTkARg@O`0CA4B@4@<12:/2:/4:.5;-9=.A,>D*T^4�E9�F9�G=�G>�GD�CE�AE�?G�CD�CD�CD�DE�DE�FD�FD�FD�EA�C@�B?�A>�A=�A=�@=�A>�FA�B<�=6�:0�90�;/�=0�=0A4|@5}?4<3�:3�91�71�72�<-�<-�;,�;,�;-�:,�:,�:,9-9-9-~:/~:/~:/~:/~:/}90}90}90}90}90}90|90|90|90z:0z:0y9/y9/x:/w9.w9.w8/w8/t8.s7-r6,r6,p6+p6+k1&q7,m4)l3(o6+l3(p7,~H<�SK�TJ�QJ�PJ�PL�OM�PN�RO�OG�SH�[K{ePsiPhkLdrOgxT\uKXoEPf?Ka:K_:K\:GV7CP42><03;03;05;/6<09=/A,>D*Q[9^mDm�Pp�Rr�Sq�Rs�Ss�Rx�a|�ex�ak�T`�I]�F]�F\�E`�Ia�Jc�Le�Nd�Mb�K`�I^�G]MRtBIk9i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtbTo_Pm]Pm_ToeYog\keYhbVfbVpl`{xi~{jzgzuapiVf`JPV�G@�GC�FF�EF�DG�CD�CD�CD�CD�DE�EC�EC�EC�DB�E@�D?�C>�C=�C=�B=�B=�F@�E=�C:�>5�:/�8-�9,�<-�A2~@3}?2=1�:1�91�81�80�<-�;,�;,�;,�:,�:,�:,�:.9-9-9-~:/~:/~:/~:/~:/}90}90}90}90|90{8/{8/{8/{;1{;1z:0y;0x:/x:/x:/x:/t8.t8.s7-s7-r6,q5+o5*o5*k1&o6+m4)k2'n5*i3'm7+}G;�QI�PI�QJ�QL�RM�RN�TP�UP�VO�[P^OtbNoiQnrWjwYfwWPf@K_:EY6BV3EV6GV7FU8ER8?I1*7;*:<.<>0<=/:;-5<45<46<26<09=/<>0=@-=C)MV7Zi@h|Kl�Np�Oq�Ru�St�Sz�cw�`n�Wc�L\�E\�E\�EZ�C_�Ha�Jb�Kd�Mc�La�J_�H]�F[}KPr@Gi7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTtdWqaTm_Rk_SkaWlcZle[jf]jf]wui��y��������|��r�ygZfNLV>AI2CF1ED0D?,I=-TD5M:+O8*R6*T7)X8+];/a?3eA5�KA�SL�UQ�NK�ED�AB�CC�EF�?>�@=�B>�D@�EA�FD�ED�ED�CD�CD�DD�DD�DD�ED�EB�GC�FB�E?�E>�E>�D=�D=�E=�E=�C<�E?�E>�@8�;/�8,�9+�;.�@2@1~?0=/�;/�:/�9/�90�;,�;,�;-�:,�:,�:,�9+9-9-9-~:/~:/~:/~:/~:/~:/}90|90|90{8/{8/{8/y9/x8.{;1y;0y;0y;0x:/x:/v:/v:/s7-s7-s7-r6,p6+o5*o5*n4)j1&o6+l3(h2&k5)h2&l6*|F:�OG�PH�QI�RM�SN�UP�WP�YQ�]R�aUy_PiZGd_IciOZgKN]@EU8AQ4=M0G2:A/7>,9=,9=.8<-7;,6=66=66;46<29<1;=/dxGj�Lp�Os�Tw�Uw�T{�dr�[e�N\�EZ�C\�E\�EZ�C_�H`�Ia�Jb�Ka�J`�I^�G]�FY{INp>Ef7i`Qi`Qi`QjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTseXugZsg[mcYjaXle]snhzwp�~w���������������������v~i`hSLSADK9AJ7>G4>G4BI7GNB�?@�AA�C@�EA�EA�EA�EA�DF�DF�DF�DD�ED�ED�ED�EA�FB�FA�F>�E=�F=�F=�F=�G>�@9�B;�D=�B9�>3�:-�;.�=/�?0�?/~?0=/�<-�:-�:-�:.�;-�;-�:,�:,�:,�9+9-9-9-~:/~:/~:/~:/}:1}:1}:1|90|90|90{8/y9/x8.x8.v8-y;0y;0x:/v:/v:/u9.u9.u9.s7/r6.q6.p5-o4,n3+m4+m4+j1(o6-j4*h2(j4*g1'k5+zF;�MG�NH�PJ�SL�UO�WP�ZP�ZQ{YMv\OkZJ]UBYXDY^HOYA>L3;G18D.5A+5A+8D.=I3AM7EN;BK8?H5.5<,4;+5;75<56;56;48;2:-;@)GP1Ra:buGi�Kq�Pu�Vy�Wx�Uz�cn�W`�IZ}C[~D^�G^�G]�F`�Ia�Jb�Kb�Ka�J`�I_�H^�GW{KLp@Bf6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTmaUndXpf\lcZkd\rmg��|����������������ľ��������������tfcTPQAEI8=F38E18G45F35F44E36D58D6;E:?G<@H=<6(L0�=/�=.�>/�?/�>.=-�<-�;,�;,�;-�:,�:,�:,�:,�9+9-9-~8,~:/~:/~:/~:/}:1}:1}:1}:1z:1z:1y90y90x8/v7.v7.v7.u9/u9/u9/s9.s9.s9.r8-r8-q6.q6.p5-o4,n3+m4+l3*l3*h2(l6,i3)f2'h4)e1&i5*xD9�KE�MF�PJ�TL�VO�XN�YO|\Os\Nk[L_XFUTBPS@JQ?@I64@,3<+2;*09(09(2;*5>-9B1-;@*CL/O^7_rDi�Mr�Sw�Xy�Wv�Us�\f�OZ}CX{A\E]�F]�F^�G`�I`�I`�I`�I`�I_�H^�G]�FVzLJn@Ae7haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTiaVjbWkdZmf^upj���������������������������������Һ������zym__YIKL:>F19E1>2J91`94�HH�\_�_d�VZ�OS�MO�LK�JJ�HE�FB�DA�A?�DF�DF�DF�CE�CE�BB�CB�CB�DC�D@�E?�F?�F<�F<�G=�H=�>8�?:�B9�C:�C8�A4�<-�9)�>-�>.�>-�=,�=,�<,�;,�<-�:,�:,�:,�9+9-9-~8,}9.~:/~:/~:/}:1}:1}:1}:1}:1y:1y:1x90x90w8/t8.s7-s7-s9.s9.r8-r8-q8-p7,p7,p7,p5-o6-n5,n5,m4+l3*i3)i3)g1'k7,h4)e1&h4)d0%f4)uC8�JE�LH�PJ�TL�WN�YOx[Mp]Nj^N]WGPQAKN=CJ:9B12:+08)36-17-06,/5+/5)17+2:-4<-9D4;F6=H7*0640641622716929;0:<.:?)?H+KY5]pCh�Ls�Tw�Yw�Wr�Qi�T^�IUx@WzB[~F[~F[~F]�H_�J_�J_�J_�J^�I^�I]�H]�HUvKJk@@a6haQhaQhaQibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcToh^ng_lh_tqj�����������������������������������������ũ�����sbaZGML7CH2AI4AH6BF7BD7C@9D<9C98C772?5;@9@93H/+c76�QR�gi�mm�[\�YW�US�QN�KK�GF�BB�@A�CG�DF�DF�BE�BE�AD�BB�BB�DC�CB�C?�C>�E>�E>�F<�G=�@;�@9�@9�C9�D:�B5�;-�5&�=-�=.�>-�=,�=,�<,�<*�=+�:,�:,�:.9-9-~8,}9.}9.~:/~:/}:1}:1}:1}:1}:1{;2w;1w;1v:0u9/t8.s9.r8-q7,r8-q8-p7,p7,n8,m7+m7+m7+o6-o6-n5,m4+j4*j4*i3)h4)f2'k7,h4)c1&e3(b0%e3(uC8�JG�NI�QJ�TM�XOzZMq[Mh\LXUDHK:=D4=E69A208+/7*5=056157257247005.06,08-19,6A3:E5=J9>K9;J77F12A,0?*.42.420511605818:/:<.:?+WzB[~FY|DY|D\G_�J_�J^�I^�I^�I]�H]�H]�HSsJHh?>^5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUfc\gd]vsn����������������������������������������������ȷɴ������icbFGG-EG/DF0GD3IC5H;3F42G34M797@;;@:@;8G85cGF�kjŔ�譩ҋ��tn�]X�SN�NN�IK�EI�CG�FH�HK�CF�:>�>@�FI�DG�:;�@@�@@�A@�B>�C>�B<�B;�B;�A<�@9�?8�A7�B8�@4�;.�8*�>.�>/�?.�>-�=,<+�=*�=*9-9-9-~8,~8,|8-|8-|8-}9.|90|90|90z:1z:1z:1z:1x=5w<4v;3u:2t91r7/p7.p7.o6-m7-m7-m7-m7-l8-l8-l8-i2+m6/p92o81k4-g2*g2*h3+e0(i7.d2)^,#`0&_/%b2(p@6�LJ�OK�QJ�QJ}YMv_QfYIRO>CF5=F58C35@02=/3;04:04:077577566446135016/05..6+.9+2=/6C29H5:I68G42D./A+,20,2.-2..3-36/780:&DR1YkCh�Ru�[w�_r�Wj�N\}HXyDTu@Tu@WxCZ{F[|GZ{F^Jb�Nb�N^J\}H_�K`�L^JTrNFd@:X4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUed_onj����������������������������������������������������ͱ��������cgkJMP1II/EC,HA/J>2L93M85Q99;;9BA?MHE\RQyjg���̳��ǿ���괪̃|�c\�VT�PS�FM�=D�EE�EE�GH�IK�EG�<>�<>�@C�>?�??�@@�A@�B>�B=�A<�A;�@:�@;�?8�A:�C9�A6�;/�9+�=.�>/�>.�>-�=,<+�=,�<,9-9-9-~8,}9.|8-|8-|8-|90|90|90z:1z:1{;2{;2{;2v=4u<3t;2s:1r90p7.m7-m7-m7-l8-l8-l8-l8-j8-j8-j8-l5.n70n91n91l7/i4,g2*e3*c1(e3*_/%^.$b2(^.$`0&n?5�IE�QL�WRWOrVKdRDQJ:>?/:A16A14A02>02<14<15;17:388677577557446116005./7,.8-1<.4A07E49H58G44E22D.062.40.3--2,14-45-8:-9=,7?'DQ3YkEh�Sv�`w�bp�Yf�NZzHWwETtBTtBVvDYyGYyGYyG[{I_M_M\|J[{I^~L^~L\|JTmOF_A9R4icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUneVneVneVddby{x�������������������������������������������������������ش�ĝ�����j`hCRW7DG,EC.KD4MC9N?8L=8C:;SJKi`a�xv���������������������画�ec�AC�BI�NV�VR�LI�DA�BA�FE�EF�CD�BD�=?�>>�??�@?�A@�A=�B=�A<�?:�@:�A:�D<�D<�B7�<2�9.�=0�=0�>/�>.�=-<+�=,�=,9-9-9-}9.}9.|8-|8-{8/}:1}:1{;2{;2{;2{;2{;2{;2t;2s:1p:0o9/n8.m7-k7,k7,l8-l8-j8-j8-j8-j8-i9-i9-n91m80m80m80m80i7.f4+c1(c3)a1']-#_0&c4*\-#_0&sD:OK�UPXQqSK^J?OC7?<-37(2:+/<+0<.2=/4<15;17:37:388688668557257227016/08-.8-0;-2?.6C27E48G48G48G46=53:2/4-,1*.1(13(57*6:)6>'DQ5[lHk�Zy�fw�fl�X^�KWwEUuCRr@Rr@TtBVvDWwEWwEXxF[{I]}K[{I[{I]}K\|JXxFPfOAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVneVofWgkl�������������������������������������������������������������۲�™���}�cdnKLS4EI0HJ5KI:GE9D@7QEEk__���������������������������������莎�bd�>C�PI�TM�OJ�F@�FB�MJ�JI�??�>>�>?�?>�@?�A?�B?�B?�C?�>8�?:�C=�E?�E>�B9�=5�;2�<1�=0�=1�=0=-~<,�=-�=-~:/~:/~:/}9.}9.|8-{8/{8/~;2|<3|<3{;2{;2z;4z;4z;4p:0o9/o9/m9.l8-k7,j6+h6+i7,i7,h8,h8,h8,h8,h8,h8,o:4j81h6/i70j81j81e4-a0)e4-b1*].&a2*b3+Y*"_3*zNE~]XvWRiNGWC:J<3@:.:;-8<.08)/:,1<.2=/5=25;169078079468368349338138119.19..9+/:,1<.2?.5B18E4:I6;J7;C87?428.-3)-0%/1&24'48)4<'ER8_pPr�d}�nw�if�XT}EUrBTqASp@Sp@TqAUrBVsCVsCWtD[xH]zJ\yI^{K_|L\yIVsCK\JD8f\Z�|z������������������������������������즤�if�K=�QD�YN�[Q�QH�D=�A<�D@�@=�?>�@?�B>�C?�C?�C?�C?�>9�@<�D@�E@�D<�@9�>5�<4�<3�=2�=1�=0=/~<.=/�Qn>Qn>Qn>Qn>Qn>Sp@Sp@WtD[xH]zJ]zJ_|L_|LZwGQn>ESF6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXpgXinrz���������������������������������������������������������������׹�ĥ�����regOMP;EL:EM>EODGSG~zq���ƽ����������������������������������������ߑ}�fS�K:�UF�WK�F;�@8�KE�C>�C?�B?�C@�C>�D>�D>�C=�@<�C=�E?�D?�A;�=8�;5�<4�<3�=4�=3�=2=1~<0=1=/~:/~:/~:/}9.|90{8/{8/{8/|<3{;2{;2y:3y:3x92w81w81m80l7/j8/j8/i7.i7.g7-g7-g7-g7-f7-f7-f7-f7-f7-d8-i70h6/g5.f5.g6/h70g6/e6.a2*e6.^2)\0'`4+a5,i=4|PGQJBE>6:6-85,99/8:/47,36+4:.5;/5;/69.69.68-57,46+19,19,19,19,19,19,19,19,08+.9+.9+/:*0;+3>.6A17B2gw]u�mv�nf�_RwKAh;Mj:Nk;Pm=Pm=Nk;Nk;OlVsCZwG]zJ^{K_|L_|LVsCLi9=H@/:2#.&gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXqhYqhYcjpmtz����������������������������������������������������������������Ư�����}vn[ZWFOQCQWKYcZbme����������������������������������������������������q[�WD�SC�QB�MA�JA�G@�E?�E@�E@�E>�D=�C<�C<�C?�D@�EA�C=�=9�;5�;5�<6�<5�<6�=5�=4<3~<0=1�<1~:/~:/~:/}9.|90{8/{8/y90{;2{;2z:1x92w81v70v70u6/k90j8/j8/j8/j8/h8.h8.h8.g7-f7-f7-f7-d8-d8-d8-d8-h6/h70i81i81h70i81j;3l=5g80k<4b6-a5,oC:xLCtI@uJA:=647036/7:18;247.14+25,58-58-57,46+46+46+46+46)/7(08)08)08)08)08)08+08+19,08+08+/7*08+19,3;.4e9Jg9Li;Nk=Nk=Li;Li;Mj
    UrDYvH[xJ]zL^{M\yKQn@Eb47@;+4/!*%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSkbSkbSkbSlcTlcTmdUmdUmdUmdUmdUneVofWpgXpgXqhYriZhowmt|����������������������������������������������������������������ʹƯ�����sce]P[YM_bYovo|���������������������������������������������������������Ȱ�}g�O=�Q@�RD�C8�IA�H@�F@�F@�E=�D<�C;�C;�D@�E@�E@�A=�;7�74�93�<6�<5�<6�=5�=4<3~;2<3=1~:/~:/~:/}9.|90{8/{8/y90z:1z:1y90w81v70u6/u6/t5.k90k90j8/j8/j8/i9/i9/h8.f7-f7-f7-d8-d8-d8-d8-d8-f5.i81l;4k:3j92j92m>6qB:n?7pD;g;2g;2SJ�aXTKpE<6=52913:27<5492/5+25,9<345-35*24)13(13(35(46)57*,7',7'-8(-8(-8(-8(-8(/7(19*08)08+/7*/7*/7*08+08+7@+9B-=D2=D2=A29;-35'/3$3:*JVBcr[f}a\wVLnICgA=c:He7Kh:Nk=Nk=Kh:Jg9Li;Nk=TqCWtFZwI[xJ]zLZwINk=A^05;9*0.!'%heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVg`MjeOnlWnl]ff^eeeqqy�������������������������������������������������������������������������ֵ�����ymvW\fK`lTq~l������������������������������������������������������������������Ъ��a\�D=�ME�KB�C:�A7�D:�H>�JA�I>�G>�J2�K4�L5�K4�H2�F2�E3�E5�D5�C6�@4�>3�;2�9/�7/�6-~:1~:1}90|8/{7.z7.y6-x5,w7-w7-x8.x8.v8-u7,s5*q3(h91h91h91g80h70g6/g6/g6/f5.h6/i70j81i70h6/f4-g2,k1-k4/n70m80k9.j:.i>.iB1dC2gJ8aJ8raOyn\�|j��qOL;4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4./4..3-.3-/4./4.05/0;32=55A77C98D86B64@22?.3@.DQ=WeN\jSSaHHV=DR8FT:Ic>Ke@Ke@Ke>JeOjAUpGYtK\vO]wR]wTWpPHaC8Q3).2&+/$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVjcPlgQmkVlj[gg_lll~~��������������������������������������������������������������������������Я�����vkrSYaI_kUt�o�����������������������������������������������������������������������}u�J@�K@�J<�K>�J>�D9�=2�?6�D;�H3�J7�M9�J7�G5�C4�D6�F7�C7�C8�A7�>5�<4�:1�91�81}:2}:2|91z:1y90x8/w7.v7.u6-v7.t8.t8.t8.r6,p4*o3)i81i81i81h70h70h70g6/g6/e3,e3,g5.h6/j81j81j81k92k60l71m80l:1k;/l>1j@0iD2hG6kP=gR?ufS�vd��s��rML:4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4.05//4..3-.3-.3-.3-/4.05/-80/:21=34@66B66B66B45B16C1CPAO6BP7FT:Ic@Jd?Ke@Ke>Ic3L/).2',0$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVhdYkd\kd\md]meZmfVmhTmhRmkVjk[jkcvxw�������������������������������������������������������������������������ۿ�ʫ�����yuy^kpZt{i������������������������������������������������������������������������������ٞ��L=�Q@�K;�>1�G9�XM�TJ�?6�D6�H9�J=�I=�B7�?5�A7�E=�A9�A9�@:>8~>5<4<4�;4x<2x<2w;1w;1v:0u9/t:/t:/s9.r9.r9.r9.q8-n8,l6*k5)j81j81j81j81i70i70i70h6/g5.g5.g5.g6/h70i81k:3k:3l;4k:3i:0j;1k?2lB4iD2fE2fI7lVAjYEviV�l��{�mEF439/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+/4./4./4./4./4./4./4./4./4./4..3--2,-2,.3-/4./4.*5-+6.-9//;12>24@46B47D38E3?L:ER>CQ:;I28F->L3ES:H`>Jb@LdBKc?Ia=G`9F_8G`9RkDXpL]uS^vVZqTPgK=T8,C)).2',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\kd\md]meZmfVniUljSlkVlm]pqi����������������������������������������������������������������������������ؼ�ǫ��������}�������������ſ�������������������������������������������������������������������������ı��n�Q>�P=�XH�L?�D7�G<�>4�D;�H?�F>�?9�;6�=8�A>�?;�@<�@<}@;z?9y@9x?8v?8v=4v=4v=4u<3s=3r<2r<2q;1o;0o;0o;0l:/k9.j8-j8-i7,n72n72m61l71l71k60i70i70l:3j92h70g6/f7/f7/h91h91j?6f>4e=1f>2hC3iE5gF3cG2cJ6hV@k\GskV��n��zor_9>*28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3-.3--2,-2,-2,-2,.3-.3-)4,)4,*6,+7-.:01=14@25A36C2:G5�=7�A;�D?�C?�<;�98�9:�==�==�>>�@?|A=xA6s>6s>6r=5p>5p>5p>5n>4n>4m=3l<2j;1j;1i:0i:0i:0p62p62p62o51m61m61k60i70l;4k:3h91e90e90e90e:1f;2dB6cA5cC4dD5fG5eH6cH3_I2^L6eV?jbKrmW��n��r[`L3;&28.28.17-17-17-06,06,06,17-17-17-06,06,/5+/5+/5+.3-.3-.3-.3-.3-.3-.3-.3--2,-2,,1+,1+,1+,1+-2,-2,,6.+5-*4,*4++5,.8-0:/2=/2=-5@06A05A-1=)1=)5A+9E/=O5AS9FY=I\@J]?J]=K^>L_?TgG\oQcvZbtZYkSK]G6G4$5"&+.$),"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheTheVjcYkd\lc\md]meZlfVlgSljSlnXorasvm�������������������������������������������������������������������������������θ�ͺ�ƶ�ø������������������������������������������������������������������������������������������������̧��lX�ZG�VC�M;�A8�B<�D>�D?�?>�;;�99�:;�<<�>?�?=}@=wB7o>7n?7o@8n?7m>6i=4h<3h<3h<3i=4r73q62q62p62o51m61l71j81h70g80e90e:1d<2f>4f@5gA6]C4aG8cL:dM;cM8`K6]K3]M4]Q9`Y?miPss[��mt|eFO:2>(39/28.28.28.17-17-17-06,17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0*+0*+0*,1+-2,,6.,6.*4,*4+*4++5*-7,.9+-8*0;+4?/5@/4?.3>-3?+4@,7F/;J3@P6DT:GW�H=�H>�G@�F@�C@�=:�97�<;�=;�>;�A5i=4j>5j>5k?6s63r73q62p62n72l71j81i81d8/d90c;1d>3d@4cA5cA5bB5VG4^OmmSsw^z�jcmU2>(5C,4:039/39/39/28.28.28.17-17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1+,1++0**/)*/)+0*,1+,1++5-+5-*4,*4,+5,+5,,6+-7,,7)/:,2=/6A17B27B25@/4?.2?+5B.:G3>L5AO6ES:JX?M[BTbI]kTcqZ_lXUbPERA2>0#/#(..&,,$**heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdTjdVjcYkd\lc\md]lfZlfVomXmmUimVgkZembr{x������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������׭��sY�SA�Q?�N>�O?�OB�J@�C:�<4�<7�>8�?6�@7{B7tD6qE8nG8s>:s>:s>:q>:q>:q>:q>:p?:sB=rA8l=7l=7m>8n?9r73r73q73n72m82j81i81f:1f;2d>3d@4bB5`C5]A3\@2[?1QI4[S>f^Gg_H`Y?ZS9ZS7\W:ZV;WW;knSrx^u}eUaI%37E.4:04:04:039/39/39/28.28.17-17-17-06,06,/5+/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0**/)*/)+0*+0*,1+)3+)3+*4,+5-+5,,6--7.-7,,6+.8-2=/6A39D69D67B46A1/<*2?-5B09F2:u@:s@9o>9o>9n72n72n93m;4l;4j;3g<3d<2c?3^>1dG9cG9T=-O8(M8'D/TR;PN7KI0MK2]Y>ieJeaDVU7XX<]`CosXz�fcmT=I1,:#1?(5;15;14:04:04:039/39/39/39/39/39/28.17-17-17-06,16016005/05//4./4./4./4.,1+,1+,1+,1+,1+,1++0*+0*.5.-4--4-,3,-4--4-.5-.5-+2*-4,08-5=29A6=E:?G7B25@03>-1<+2>*9E/BN8IU?O[EVbN]hWYdTLWI�F5�F4�D4�D2}B0yB.s@-o?+v?:t=8u>9v?:t?9q<6r=7sA:q?8q?8q?8o>7o>7n=6n=6n=6l;4m<5m>6k?6j?6h@6eA5cA5dG9[A2^G7\I8N=+F7$G8%A4!IM4GK2DG,BE*MM1[[?abC`aBYY=dgJsw\sy_X`H8D,/;%6D-7=36<26<26<25;15;15;15;15;15;15;14:04:039/39/39/27127127116016016005/05/.3-.3--2,-2,,1+,1++0*+0**1**1*)0))0))0)*1*+2+,3,.5--4,.5-07/4;39@8?F>BIA:G69F56C13@.2?+5B.;I2?M6KXDR_KXeSVcRKWI8p;5q<6vA;sA:p>7r@9xG@n=6n=6n=6m>6l=5l=5l=5l=5g?5h@6gA6gC7eC7cC6`C5^D5aL;UB1ZI7`S@RG3C;&E=(GA+>G,BH.@F*<@%?B%LO2_`AijKaaEnqTvz_gmSHP84<%4=(=F18>48>48>48>47=37=37=36<28>48>47=37=37=36<26<26<25:449349349338238238227105/05//4..3--2,,1++0*+0*(/((/((/((/((/()0)*1*+2+070.5.+2++2+.5.5<5K:4-9/-3/-3/,2.gdUgdUheVheVheVheVifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWmlWimThpXht`hthm|w���������������������������������������������������������ڻ�ּ�������������������������������������������������������������������������������������������������������������������������������������������������������ҽ��zyS3i?3i?3i?3f>2f>2f>2f>2aA4`C5`C5_C5^D5[D4ZE4VE3XI6OB/\T?oiSc^HMK4IG0LJ3;E*?H->G*48>47=37=37=39?58>48>48>48>48>48>48>47<67<67<66;56;56;55:45:438238216005//4.-2,,1+,1++0,+0,*/+*/++0,,1--2.-2.051.3/+0,+0,-2.2738=9'4.:0.5..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWjnUiqYgs_drejyt�������������������������������������������������������ܽ�չ�ѷ�Ѿ����������������������������������������������������������������������������������������������������������������������������������������������������������Ӿϴ�����u`yVBlI5mH6rM;uP>mF7iB3gB2jE5nI9oJ:pK;oK;eA1eA1cB1cB1cB1cB1cB1bC1\G6\G6\G6ZG6YH6WH5TG4RG3PH3MH2fdM~~fprZVX@IM4HL3;E*A.;>+9?59?59?58>48>47=37=37=38>48>48>48>48>48>48>48>49>89>89>88=78=78=77<67<66;55:449338227105//4./4.-2.-2.,1-+0,+0,,1--2.-2.,1-,1-,1-,1-.21043376598:H7=L9@O<@O:8F91?2,9/.5.-4-,3,fcTfcTgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWleUldWlcZmd]md]mf^mg[khWkmWioUiqYgs_bpcgxr�������������������������������������������������������ڻ�ѵ�˴�˺����������������������������������������������������������������������������������������������������������������������������������������������������������������������ӿһ������u�rd|]I}^JrVAaE0W;&Y=(Z?*X=(`E0`E0_F0_F0`G1`G1^H1^H1[L9ZM:ZM:XM9XM9UM8RL6QL6NL5QQ9ikS|�glrXSY?DM2>G,:G+48>48>48>47=37=38>48>48>48>49?59?5:?9:?9:?9:?99>89>89>88=78=78=77<66;55:4493382382/40.3/-2.,1-+0,+0,+0,+0,+/.,0/-10.21/32/32/32.210A.5F3;M7>P:=O7:L47I/6H.3E-6H0:L6MJ9EB1;A7;A7;A7;A7:@6:@6:@69?58>48>48>49?59?5:@6:@6:@6;@:;@:;@::?9:?99>89>89>8:?9:?99>89>88=78=77<67<6495273162/40-2.,1-+0,+/.,0/,0/-10.21.21.23-12,01):'/@-6H2;M5=O7?I.9F*?L0=J.AN2DN3HQ4LR6IN0JM0ZY;miLhdIc]C_YA_ZD`[GZUBQN=LI8=C9=C9=C989>89>8;@:;@:;@:;@::?9:?9:?9:?99>:8=95:6384162/40.3/.21.21.21-10-12,01,01-12-12$5"*<&3E/9K3XW9UT6SR3KE/JD.FA-D?,A>/@>1??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B79A6:B7;C8F;7B:7C97A66A16?.4<-39-270.5./51-7/-9+-<%.B3J7O7Z 8Y$8W+:U2:R8;P==O?>O=:L6@R8EX:EZ;DY:>U93J0(>'.5-,3++2*ZgM[hN\hP_iQakSckTglXhkXghVihVifWifWkeWmeXmeZnf[khWkhYkg[kg^jf]jf]hfZgeVgjWglVfoZerajwnz������������������������������������������������������̹˾������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Nj�lRM0TM0QK+SJ+WN/UO/UN1TO1SO2QP4QP4PP6QM2PO3PN5PP6MO7KO6HM6EM5HQ6EN3BK.AH)BI(GM+JP,KQ-NR/PT1VZ9^aBaaE[[?VVVV>XV=YW>XW;XW9WV8VU7QK5OI3LG3ID1DA2B@3??3>@5<=5;>59?59A67B48C57C57D3:B79A69A68@58@59A69A6:B7:B7:B7:B7:B7;C8F;76<83=51=/3B+9M*BY-Ia1Nq7Mn9Ji=Fa>AY?:L<:K9=O9DV5:@69A67B47B47C57D3:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8F;>F;>IA>J@?I>>I9?H7>F7>D8=B;>E>;A=6@85A39H1BV3Pg;ZrB]�F\}HVuIMhEBZ@9N;5G74E3XR6F;?G<>H=>I9?H7>F7>D8=B;=D=;A=6@85A39H1DX5Ri=]uEY|BXyDRqEIdA,6H2@R8L_AQfGShIMdH@W=4J329107/-4,YgMZhN\hP^jRblTemVgoZjo[lo\lm[mk\mj[nhZnhZoi]ph]liXkhYjfZie\ie\ie\ig[igXfiVchRajUerao|s{���������������������������������������ѿ�ɶ�ıþ�������˾��Ÿ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������̌�oRL2UN2TM0WN1VM.UO/WP3VQ3UQ4QP2ON2MM1PL1NM1NL3MM3LN6LP7KP9JR:LU:IR7JS6QX9SZ9U[9]c?gmI��a��s�������x��pr|Z\bFLP7KM7LK6KI4NI5PK7TM:VP:WQ;VP:SN:QL9LI:IG:EE9CE:=>6F;?G<=G<=H8>G6=E6=C7=B;:A:9?;5?75A39H1BV3Ne9Wo?Sv /* to declare isdigit() */ + + +#if TRANSFORMS_SUPPORTED + +/* + * Lossless image transformation routines. These routines work on DCT + * coefficient arrays and thus do not require any lossy decompression + * or recompression of the image. + * Thanks to Guido Vollbeding for the initial design and code of this feature, + * and to Ben Jackson for introducing the cropping feature. + * + * Horizontal flipping is done in-place, using a single top-to-bottom + * pass through the virtual source array. It will thus be much the + * fastest option for images larger than main memory. + * + * The other routines require a set of destination virtual arrays, so they + * need twice as much memory as jpegtran normally does. The destination + * arrays are always written in normal scan order (top to bottom) because + * the virtual array manager expects this. The source arrays will be scanned + * in the corresponding order, which means multiple passes through the source + * arrays for most of the transforms. That could result in much thrashing + * if the image is larger than main memory. + * + * If cropping or trimming is involved, the destination arrays may be smaller + * than the source arrays. Note it is not possible to do horizontal flip + * in-place when a nonzero Y crop offset is specified, since we'd have to move + * data from one block row to another but the virtual array manager doesn't + * guarantee we can touch more than one row at a time. So in that case, + * we have to use a separate destination array. + * + * Some notes about the operating environment of the individual transform + * routines: + * 1. Both the source and destination virtual arrays are allocated from the + * source JPEG object, and therefore should be manipulated by calling the + * source's memory manager. + * 2. The destination's component count should be used. It may be smaller + * than the source's when forcing to grayscale. + * 3. Likewise the destination's sampling factors should be used. When + * forcing to grayscale the destination's sampling factors will be all 1, + * and we may as well take that as the effective iMCU size. + * 4. When "trim" is in effect, the destination's dimensions will be the + * trimmed values but the source's will be untrimmed. + * 5. When "crop" is in effect, the destination's dimensions will be the + * cropped values but the source's will be uncropped. Each transform + * routine is responsible for picking up source data starting at the + * correct X and Y offset for the crop region. (The X and Y offsets + * passed to the transform routines are measured in iMCU blocks of the + * destination.) + * 6. All the routines assume that the source and destination buffers are + * padded out to a full iMCU boundary. This is true, although for the + * source buffer it is an undocumented property of jdcoefct.c. + */ + + +LOCAL(void) +do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* Crop. This is only used when no rotate/flip is requested with the crop. */ +{ + JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks; + int ci, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + jpeg_component_info *compptr; + + /* We simply have to copy the right amount of data (the destination's + * image size) starting at the given X and Y offsets in the source. + */ + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y + y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + jcopy_block_row(src_buffer[offset_y] + x_crop_blocks, + dst_buffer[offset_y], + compptr->width_in_blocks); + } + } + } +} + + +LOCAL(void) +do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, + jvirt_barray_ptr *src_coef_arrays) +/* Horizontal flip; done in-place, so no separate dest array is required. + * NB: this only works when y_crop_offset is zero. + */ +{ + JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks; + int ci, k, offset_y; + JBLOCKARRAY buffer; + JCOEFPTR ptr1, ptr2; + JCOEF temp1, temp2; + jpeg_component_info *compptr; + + /* Horizontal mirroring of DCT blocks is accomplished by swapping + * pairs of blocks in-place. Within a DCT block, we perform horizontal + * mirroring by changing the signs of odd-numbered columns. + * Partial iMCUs at the right edge are left untouched. + */ + MCU_cols = srcinfo->output_width / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + for (blk_y = 0; blk_y < compptr->height_in_blocks; + blk_y += compptr->v_samp_factor) { + buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + /* Do the mirroring */ + for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) { + ptr1 = buffer[offset_y][blk_x]; + ptr2 = buffer[offset_y][comp_width - blk_x - 1]; + /* this unrolled loop doesn't need to know which row it's on... */ + for (k = 0; k < DCTSIZE2; k += 2) { + temp1 = *ptr1; /* swap even column */ + temp2 = *ptr2; + *ptr1++ = temp2; + *ptr2++ = temp1; + temp1 = *ptr1; /* swap odd column with sign change */ + temp2 = *ptr2; + *ptr1++ = -temp2; + *ptr2++ = -temp1; + } + } + if (x_crop_blocks > 0) { + /* Now left-justify the portion of the data to be kept. + * We can't use a single jcopy_block_row() call because that routine + * depends on memcpy(), whose behavior is unspecified for overlapping + * source and destination areas. Sigh. + */ + for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) { + jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks, + buffer[offset_y] + blk_x, + (JDIMENSION) 1); + } + } + } + } + } +} + + +LOCAL(void) +do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* Horizontal flip in general cropping case */ +{ + JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, k, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JBLOCKROW src_row_ptr, dst_row_ptr; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + /* Here we must output into a separate array because we can't touch + * different rows of a single virtual array simultaneously. Otherwise, + * this is essentially the same as the routine above. + */ + MCU_cols = srcinfo->output_width / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y + y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + dst_row_ptr = dst_buffer[offset_y]; + src_row_ptr = src_buffer[offset_y]; + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Do the mirrorable blocks */ + dst_ptr = dst_row_ptr[dst_blk_x]; + src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1]; + /* this unrolled loop doesn't need to know which row it's on... */ + for (k = 0; k < DCTSIZE2; k += 2) { + *dst_ptr++ = *src_ptr++; /* copy even column */ + *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */ + } + } else { + /* Copy last partial block(s) verbatim */ + jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks, + dst_row_ptr + dst_blk_x, + (JDIMENSION) 1); + } + } + } + } + } +} + + +LOCAL(void) +do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* Vertical flip */ +{ + JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JBLOCKROW src_row_ptr, dst_row_ptr; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + /* We output into a separate array because we can't touch different + * rows of the source virtual array simultaneously. Otherwise, this + * is a pretty straightforward analog of horizontal flip. + * Within a DCT block, vertical mirroring is done by changing the signs + * of odd-numbered rows. + * Partial iMCUs at the bottom edge are copied verbatim. + */ + MCU_rows = srcinfo->output_height / + (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_height = MCU_rows * compptr->v_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + if (y_crop_blocks + dst_blk_y < comp_height) { + /* Row is within the mirrorable area. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + comp_height - y_crop_blocks - dst_blk_y - + (JDIMENSION) compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } else { + /* Bottom-edge blocks will be copied verbatim. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y + y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + if (y_crop_blocks + dst_blk_y < comp_height) { + /* Row is within the mirrorable area. */ + dst_row_ptr = dst_buffer[offset_y]; + src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1]; + src_row_ptr += x_crop_blocks; + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; + dst_blk_x++) { + dst_ptr = dst_row_ptr[dst_blk_x]; + src_ptr = src_row_ptr[dst_blk_x]; + for (i = 0; i < DCTSIZE; i += 2) { + /* copy even row */ + for (j = 0; j < DCTSIZE; j++) + *dst_ptr++ = *src_ptr++; + /* copy odd row with sign change */ + for (j = 0; j < DCTSIZE; j++) + *dst_ptr++ = - *src_ptr++; + } + } + } else { + /* Just copy row verbatim. */ + jcopy_block_row(src_buffer[offset_y] + x_crop_blocks, + dst_buffer[offset_y], + compptr->width_in_blocks); + } + } + } + } +} + + +LOCAL(void) +do_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* Transpose source into destination */ +{ + JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_x, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + /* Transposing pixels within a block just requires transposing the + * DCT coefficients. + * Partial iMCUs at the edges require no special treatment; we simply + * process all the available DCT blocks for every component. + */ + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; + dst_blk_x += compptr->h_samp_factor) { + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_x + x_crop_blocks, + (JDIMENSION) compptr->h_samp_factor, FALSE); + for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { + dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; + src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + } + } + } + } + } +} + + +LOCAL(void) +do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* 90 degree rotation is equivalent to + * 1. Transposing the image; + * 2. Horizontal mirroring. + * These two steps are merged into a single processing routine. + */ +{ + JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_x, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + /* Because of the horizontal mirror step, we can't process partial iMCUs + * at the (output) right edge properly. They just get transposed and + * not mirrored. + */ + MCU_cols = srcinfo->output_height / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; + dst_blk_x += compptr->h_samp_factor) { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Block is within the mirrorable area. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + comp_width - x_crop_blocks - dst_blk_x - + (JDIMENSION) compptr->h_samp_factor, + (JDIMENSION) compptr->h_samp_factor, FALSE); + } else { + /* Edge blocks are transposed but not mirrored. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_x + x_crop_blocks, + (JDIMENSION) compptr->h_samp_factor, FALSE); + } + for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { + dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Block is within the mirrorable area. */ + src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1] + [dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + i++; + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + } + } else { + /* Edge blocks are transposed but not mirrored. */ + src_ptr = src_buffer[offset_x] + [dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + } + } + } + } + } + } +} + + +LOCAL(void) +do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* 270 degree rotation is equivalent to + * 1. Horizontal mirroring; + * 2. Transposing the image. + * These two steps are merged into a single processing routine. + */ +{ + JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_x, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + /* Because of the horizontal mirror step, we can't process partial iMCUs + * at the (output) bottom edge properly. They just get transposed and + * not mirrored. + */ + MCU_rows = srcinfo->output_width / + (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_height = MCU_rows * compptr->v_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; + dst_blk_x += compptr->h_samp_factor) { + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_x + x_crop_blocks, + (JDIMENSION) compptr->h_samp_factor, FALSE); + for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { + dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; + if (y_crop_blocks + dst_blk_y < comp_height) { + /* Block is within the mirrorable area. */ + src_ptr = src_buffer[offset_x] + [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1]; + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < DCTSIZE; j++) { + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + j++; + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + } + } + } else { + /* Edge blocks are transposed but not mirrored. */ + src_ptr = src_buffer[offset_x] + [dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + } + } + } + } + } + } +} + + +LOCAL(void) +do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* 180 degree rotation is equivalent to + * 1. Vertical mirroring; + * 2. Horizontal mirroring. + * These two steps are merged into a single processing routine. + */ +{ + JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JBLOCKROW src_row_ptr, dst_row_ptr; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + MCU_cols = srcinfo->output_width / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + MCU_rows = srcinfo->output_height / + (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + comp_height = MCU_rows * compptr->v_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + if (y_crop_blocks + dst_blk_y < comp_height) { + /* Row is within the vertically mirrorable area. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + comp_height - y_crop_blocks - dst_blk_y - + (JDIMENSION) compptr->v_samp_factor, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } else { + /* Bottom-edge rows are only mirrored horizontally. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_y + y_crop_blocks, + (JDIMENSION) compptr->v_samp_factor, FALSE); + } + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + dst_row_ptr = dst_buffer[offset_y]; + if (y_crop_blocks + dst_blk_y < comp_height) { + /* Row is within the mirrorable area. */ + src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1]; + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) { + dst_ptr = dst_row_ptr[dst_blk_x]; + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Process the blocks that can be mirrored both ways. */ + src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1]; + for (i = 0; i < DCTSIZE; i += 2) { + /* For even row, negate every odd column. */ + for (j = 0; j < DCTSIZE; j += 2) { + *dst_ptr++ = *src_ptr++; + *dst_ptr++ = - *src_ptr++; + } + /* For odd row, negate every even column. */ + for (j = 0; j < DCTSIZE; j += 2) { + *dst_ptr++ = - *src_ptr++; + *dst_ptr++ = *src_ptr++; + } + } + } else { + /* Any remaining right-edge blocks are only mirrored vertically. */ + src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x]; + for (i = 0; i < DCTSIZE; i += 2) { + for (j = 0; j < DCTSIZE; j++) + *dst_ptr++ = *src_ptr++; + for (j = 0; j < DCTSIZE; j++) + *dst_ptr++ = - *src_ptr++; + } + } + } + } else { + /* Remaining rows are just mirrored horizontally. */ + src_row_ptr = src_buffer[offset_y]; + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Process the blocks that can be mirrored. */ + dst_ptr = dst_row_ptr[dst_blk_x]; + src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1]; + for (i = 0; i < DCTSIZE2; i += 2) { + *dst_ptr++ = *src_ptr++; + *dst_ptr++ = - *src_ptr++; + } + } else { + /* Any remaining right-edge blocks are only copied. */ + jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks, + dst_row_ptr + dst_blk_x, + (JDIMENSION) 1); + } + } + } + } + } + } +} + + +LOCAL(void) +do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JDIMENSION x_crop_offset, JDIMENSION y_crop_offset, + jvirt_barray_ptr *src_coef_arrays, + jvirt_barray_ptr *dst_coef_arrays) +/* Transverse transpose is equivalent to + * 1. 180 degree rotation; + * 2. Transposition; + * or + * 1. Horizontal mirroring; + * 2. Transposition; + * 3. Horizontal mirroring. + * These steps are merged into a single processing routine. + */ +{ + JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y; + JDIMENSION x_crop_blocks, y_crop_blocks; + int ci, i, j, offset_x, offset_y; + JBLOCKARRAY src_buffer, dst_buffer; + JCOEFPTR src_ptr, dst_ptr; + jpeg_component_info *compptr; + + MCU_cols = srcinfo->output_height / + (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size); + MCU_rows = srcinfo->output_width / + (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size); + + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + comp_width = MCU_cols * compptr->h_samp_factor; + comp_height = MCU_rows * compptr->v_samp_factor; + x_crop_blocks = x_crop_offset * compptr->h_samp_factor; + y_crop_blocks = y_crop_offset * compptr->v_samp_factor; + for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks; + dst_blk_y += compptr->v_samp_factor) { + dst_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y, + (JDIMENSION) compptr->v_samp_factor, TRUE); + for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) { + for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; + dst_blk_x += compptr->h_samp_factor) { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Block is within the mirrorable area. */ + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + comp_width - x_crop_blocks - dst_blk_x - + (JDIMENSION) compptr->h_samp_factor, + (JDIMENSION) compptr->h_samp_factor, FALSE); + } else { + src_buffer = (*srcinfo->mem->access_virt_barray) + ((j_common_ptr) srcinfo, src_coef_arrays[ci], + dst_blk_x + x_crop_blocks, + (JDIMENSION) compptr->h_samp_factor, FALSE); + } + for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) { + dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x]; + if (y_crop_blocks + dst_blk_y < comp_height) { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Block is within the mirrorable area. */ + src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1] + [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1]; + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < DCTSIZE; j++) { + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + j++; + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + } + i++; + for (j = 0; j < DCTSIZE; j++) { + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + j++; + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + } + } + } else { + /* Right-edge blocks are mirrored in y only */ + src_ptr = src_buffer[offset_x] + [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1]; + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < DCTSIZE; j++) { + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + j++; + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + } + } + } + } else { + if (x_crop_blocks + dst_blk_x < comp_width) { + /* Bottom-edge blocks are mirrored in x only */ + src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1] + [dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + i++; + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j]; + } + } else { + /* At lower right corner, just transpose, no mirroring */ + src_ptr = src_buffer[offset_x] + [dst_blk_y + offset_y + y_crop_blocks]; + for (i = 0; i < DCTSIZE; i++) + for (j = 0; j < DCTSIZE; j++) + dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j]; + } + } + } + } + } + } + } +} + + +/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec. + * Returns TRUE if valid integer found, FALSE if not. + * *strptr is advanced over the digit string, and *result is set to its value. + */ + +LOCAL(boolean) +jt_read_integer (const char ** strptr, JDIMENSION * result) +{ + const char * ptr = *strptr; + JDIMENSION val = 0; + + for (; isdigit(*ptr); ptr++) { + val = val * 10 + (JDIMENSION) (*ptr - '0'); + } + *result = val; + if (ptr == *strptr) + return FALSE; /* oops, no digits */ + *strptr = ptr; + return TRUE; +} + + +/* Parse a crop specification (written in X11 geometry style). + * The routine returns TRUE if the spec string is valid, FALSE if not. + * + * The crop spec string should have the format + * [f]x[f]{+-}{+-} + * where width, height, xoffset, and yoffset are unsigned integers. + * Each of the elements can be omitted to indicate a default value. + * (A weakness of this style is that it is not possible to omit xoffset + * while specifying yoffset, since they look alike.) + * + * This code is loosely based on XParseGeometry from the X11 distribution. + */ + +GLOBAL(boolean) +jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec) +{ + info->crop = FALSE; + info->crop_width_set = JCROP_UNSET; + info->crop_height_set = JCROP_UNSET; + info->crop_xoffset_set = JCROP_UNSET; + info->crop_yoffset_set = JCROP_UNSET; + + if (isdigit(*spec)) { + /* fetch width */ + if (! jt_read_integer(&spec, &info->crop_width)) + return FALSE; + if (*spec == 'f' || *spec == 'F') { + spec++; + info->crop_width_set = JCROP_FORCE; + } else + info->crop_width_set = JCROP_POS; + } + if (*spec == 'x' || *spec == 'X') { + /* fetch height */ + spec++; + if (! jt_read_integer(&spec, &info->crop_height)) + return FALSE; + if (*spec == 'f' || *spec == 'F') { + spec++; + info->crop_height_set = JCROP_FORCE; + } else + info->crop_height_set = JCROP_POS; + } + if (*spec == '+' || *spec == '-') { + /* fetch xoffset */ + info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS; + spec++; + if (! jt_read_integer(&spec, &info->crop_xoffset)) + return FALSE; + } + if (*spec == '+' || *spec == '-') { + /* fetch yoffset */ + info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS; + spec++; + if (! jt_read_integer(&spec, &info->crop_yoffset)) + return FALSE; + } + /* We had better have gotten to the end of the string. */ + if (*spec != '\0') + return FALSE; + info->crop = TRUE; + return TRUE; +} + + +/* Trim off any partial iMCUs on the indicated destination edge */ + +LOCAL(void) +trim_right_edge (jpeg_transform_info *info, JDIMENSION full_width) +{ + JDIMENSION MCU_cols; + + MCU_cols = info->output_width / info->iMCU_sample_width; + if (MCU_cols > 0 && info->x_crop_offset + MCU_cols == + full_width / info->iMCU_sample_width) + info->output_width = MCU_cols * info->iMCU_sample_width; +} + +LOCAL(void) +trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height) +{ + JDIMENSION MCU_rows; + + MCU_rows = info->output_height / info->iMCU_sample_height; + if (MCU_rows > 0 && info->y_crop_offset + MCU_rows == + full_height / info->iMCU_sample_height) + info->output_height = MCU_rows * info->iMCU_sample_height; +} + + +/* Request any required workspace. + * + * This routine figures out the size that the output image will be + * (which implies that all the transform parameters must be set before + * it is called). + * + * We allocate the workspace virtual arrays from the source decompression + * object, so that all the arrays (both the original data and the workspace) + * will be taken into account while making memory management decisions. + * Hence, this routine must be called after jpeg_read_header (which reads + * the image dimensions) and before jpeg_read_coefficients (which realizes + * the source's virtual arrays). + * + * This function returns FALSE right away if -perfect is given + * and transformation is not perfect. Otherwise returns TRUE. + */ + +GLOBAL(boolean) +jtransform_request_workspace (j_decompress_ptr srcinfo, + jpeg_transform_info *info) +{ + jvirt_barray_ptr *coef_arrays; + boolean need_workspace, transpose_it; + jpeg_component_info *compptr; + JDIMENSION xoffset, yoffset; + JDIMENSION width_in_iMCUs, height_in_iMCUs; + JDIMENSION width_in_blocks, height_in_blocks; + int ci, h_samp_factor, v_samp_factor; + + /* Determine number of components in output image */ + if (info->force_grayscale && + srcinfo->jpeg_color_space == JCS_YCbCr && + srcinfo->num_components == 3) + /* We'll only process the first component */ + info->num_components = 1; + else + /* Process all the components */ + info->num_components = srcinfo->num_components; + + /* Compute output image dimensions and related values. */ + jpeg_core_output_dimensions(srcinfo); + + /* Return right away if -perfect is given and transformation is not perfect. + */ + if (info->perfect) { + if (info->num_components == 1) { + if (!jtransform_perfect_transform(srcinfo->output_width, + srcinfo->output_height, + srcinfo->min_DCT_h_scaled_size, + srcinfo->min_DCT_v_scaled_size, + info->transform)) + return FALSE; + } else { + if (!jtransform_perfect_transform(srcinfo->output_width, + srcinfo->output_height, + srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size, + srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size, + info->transform)) + return FALSE; + } + } + + /* If there is only one output component, force the iMCU size to be 1; + * else use the source iMCU size. (This allows us to do the right thing + * when reducing color to grayscale, and also provides a handy way of + * cleaning up "funny" grayscale images whose sampling factors are not 1x1.) + */ + switch (info->transform) { + case JXFORM_TRANSPOSE: + case JXFORM_TRANSVERSE: + case JXFORM_ROT_90: + case JXFORM_ROT_270: + info->output_width = srcinfo->output_height; + info->output_height = srcinfo->output_width; + if (info->num_components == 1) { + info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size; + info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size; + } else { + info->iMCU_sample_width = + srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size; + info->iMCU_sample_height = + srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size; + } + break; + default: + info->output_width = srcinfo->output_width; + info->output_height = srcinfo->output_height; + if (info->num_components == 1) { + info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size; + info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size; + } else { + info->iMCU_sample_width = + srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size; + info->iMCU_sample_height = + srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size; + } + break; + } + + /* If cropping has been requested, compute the crop area's position and + * dimensions, ensuring that its upper left corner falls at an iMCU boundary. + */ + if (info->crop) { + /* Insert default values for unset crop parameters */ + if (info->crop_xoffset_set == JCROP_UNSET) + info->crop_xoffset = 0; /* default to +0 */ + if (info->crop_yoffset_set == JCROP_UNSET) + info->crop_yoffset = 0; /* default to +0 */ + if (info->crop_xoffset >= info->output_width || + info->crop_yoffset >= info->output_height) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + if (info->crop_width_set == JCROP_UNSET) + info->crop_width = info->output_width - info->crop_xoffset; + if (info->crop_height_set == JCROP_UNSET) + info->crop_height = info->output_height - info->crop_yoffset; + /* Ensure parameters are valid */ + if (info->crop_width <= 0 || info->crop_width > info->output_width || + info->crop_height <= 0 || info->crop_height > info->output_height || + info->crop_xoffset > info->output_width - info->crop_width || + info->crop_yoffset > info->output_height - info->crop_height) + ERREXIT(srcinfo, JERR_BAD_CROP_SPEC); + /* Convert negative crop offsets into regular offsets */ + if (info->crop_xoffset_set == JCROP_NEG) + xoffset = info->output_width - info->crop_width - info->crop_xoffset; + else + xoffset = info->crop_xoffset; + if (info->crop_yoffset_set == JCROP_NEG) + yoffset = info->output_height - info->crop_height - info->crop_yoffset; + else + yoffset = info->crop_yoffset; + /* Now adjust so that upper left corner falls at an iMCU boundary */ + if (info->crop_width_set == JCROP_FORCE) + info->output_width = info->crop_width; + else + info->output_width = + info->crop_width + (xoffset % info->iMCU_sample_width); + if (info->crop_height_set == JCROP_FORCE) + info->output_height = info->crop_height; + else + info->output_height = + info->crop_height + (yoffset % info->iMCU_sample_height); + /* Save x/y offsets measured in iMCUs */ + info->x_crop_offset = xoffset / info->iMCU_sample_width; + info->y_crop_offset = yoffset / info->iMCU_sample_height; + } else { + info->x_crop_offset = 0; + info->y_crop_offset = 0; + } + + /* Figure out whether we need workspace arrays, + * and if so whether they are transposed relative to the source. + */ + need_workspace = FALSE; + transpose_it = FALSE; + switch (info->transform) { + case JXFORM_NONE: + if (info->x_crop_offset != 0 || info->y_crop_offset != 0) + need_workspace = TRUE; + /* No workspace needed if neither cropping nor transforming */ + break; + case JXFORM_FLIP_H: + if (info->trim) + trim_right_edge(info, srcinfo->output_width); + if (info->y_crop_offset != 0) + need_workspace = TRUE; + /* do_flip_h_no_crop doesn't need a workspace array */ + break; + case JXFORM_FLIP_V: + if (info->trim) + trim_bottom_edge(info, srcinfo->output_height); + /* Need workspace arrays having same dimensions as source image. */ + need_workspace = TRUE; + break; + case JXFORM_TRANSPOSE: + /* transpose does NOT have to trim anything */ + /* Need workspace arrays having transposed dimensions. */ + need_workspace = TRUE; + transpose_it = TRUE; + break; + case JXFORM_TRANSVERSE: + if (info->trim) { + trim_right_edge(info, srcinfo->output_height); + trim_bottom_edge(info, srcinfo->output_width); + } + /* Need workspace arrays having transposed dimensions. */ + need_workspace = TRUE; + transpose_it = TRUE; + break; + case JXFORM_ROT_90: + if (info->trim) + trim_right_edge(info, srcinfo->output_height); + /* Need workspace arrays having transposed dimensions. */ + need_workspace = TRUE; + transpose_it = TRUE; + break; + case JXFORM_ROT_180: + if (info->trim) { + trim_right_edge(info, srcinfo->output_width); + trim_bottom_edge(info, srcinfo->output_height); + } + /* Need workspace arrays having same dimensions as source image. */ + need_workspace = TRUE; + break; + case JXFORM_ROT_270: + if (info->trim) + trim_bottom_edge(info, srcinfo->output_width); + /* Need workspace arrays having transposed dimensions. */ + need_workspace = TRUE; + transpose_it = TRUE; + break; + } + + /* Allocate workspace if needed. + * Note that we allocate arrays padded out to the next iMCU boundary, + * so that transform routines need not worry about missing edge blocks. + */ + if (need_workspace) { + coef_arrays = (jvirt_barray_ptr *) + (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE, + SIZEOF(jvirt_barray_ptr) * info->num_components); + width_in_iMCUs = (JDIMENSION) + jdiv_round_up((long) info->output_width, + (long) info->iMCU_sample_width); + height_in_iMCUs = (JDIMENSION) + jdiv_round_up((long) info->output_height, + (long) info->iMCU_sample_height); + for (ci = 0; ci < info->num_components; ci++) { + compptr = srcinfo->comp_info + ci; + if (info->num_components == 1) { + /* we're going to force samp factors to 1x1 in this case */ + h_samp_factor = v_samp_factor = 1; + } else if (transpose_it) { + h_samp_factor = compptr->v_samp_factor; + v_samp_factor = compptr->h_samp_factor; + } else { + h_samp_factor = compptr->h_samp_factor; + v_samp_factor = compptr->v_samp_factor; + } + width_in_blocks = width_in_iMCUs * h_samp_factor; + height_in_blocks = height_in_iMCUs * v_samp_factor; + coef_arrays[ci] = (*srcinfo->mem->request_virt_barray) + ((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE, + width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor); + } + info->workspace_coef_arrays = coef_arrays; + } else + info->workspace_coef_arrays = NULL; + + return TRUE; +} + + +/* Transpose destination image parameters */ + +LOCAL(void) +transpose_critical_parameters (j_compress_ptr dstinfo) +{ + int tblno, i, j, ci, itemp; + jpeg_component_info *compptr; + JQUANT_TBL *qtblptr; + JDIMENSION jtemp; + UINT16 qtemp; + + /* Transpose image dimensions */ + jtemp = dstinfo->image_width; + dstinfo->image_width = dstinfo->image_height; + dstinfo->image_height = jtemp; + itemp = dstinfo->min_DCT_h_scaled_size; + dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size; + dstinfo->min_DCT_v_scaled_size = itemp; + + /* Transpose sampling factors */ + for (ci = 0; ci < dstinfo->num_components; ci++) { + compptr = dstinfo->comp_info + ci; + itemp = compptr->h_samp_factor; + compptr->h_samp_factor = compptr->v_samp_factor; + compptr->v_samp_factor = itemp; + } + + /* Transpose quantization tables */ + for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { + qtblptr = dstinfo->quant_tbl_ptrs[tblno]; + if (qtblptr != NULL) { + for (i = 0; i < DCTSIZE; i++) { + for (j = 0; j < i; j++) { + qtemp = qtblptr->quantval[i*DCTSIZE+j]; + qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i]; + qtblptr->quantval[j*DCTSIZE+i] = qtemp; + } + } + } + } +} + + +/* Adjust Exif image parameters. + * + * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible. + */ + +LOCAL(void) +adjust_exif_parameters (JOCTET FAR * data, unsigned int length, + JDIMENSION new_width, JDIMENSION new_height) +{ + boolean is_motorola; /* Flag for byte order */ + unsigned int number_of_tags, tagnum; + unsigned int firstoffset, offset; + JDIMENSION new_value; + + if (length < 12) return; /* Length of an IFD entry */ + + /* Discover byte order */ + if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49) + is_motorola = FALSE; + else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D) + is_motorola = TRUE; + else + return; + + /* Check Tag Mark */ + if (is_motorola) { + if (GETJOCTET(data[2]) != 0) return; + if (GETJOCTET(data[3]) != 0x2A) return; + } else { + if (GETJOCTET(data[3]) != 0) return; + if (GETJOCTET(data[2]) != 0x2A) return; + } + + /* Get first IFD offset (offset to IFD0) */ + if (is_motorola) { + if (GETJOCTET(data[4]) != 0) return; + if (GETJOCTET(data[5]) != 0) return; + firstoffset = GETJOCTET(data[6]); + firstoffset <<= 8; + firstoffset += GETJOCTET(data[7]); + } else { + if (GETJOCTET(data[7]) != 0) return; + if (GETJOCTET(data[6]) != 0) return; + firstoffset = GETJOCTET(data[5]); + firstoffset <<= 8; + firstoffset += GETJOCTET(data[4]); + } + if (firstoffset > length - 2) return; /* check end of data segment */ + + /* Get the number of directory entries contained in this IFD */ + if (is_motorola) { + number_of_tags = GETJOCTET(data[firstoffset]); + number_of_tags <<= 8; + number_of_tags += GETJOCTET(data[firstoffset+1]); + } else { + number_of_tags = GETJOCTET(data[firstoffset+1]); + number_of_tags <<= 8; + number_of_tags += GETJOCTET(data[firstoffset]); + } + if (number_of_tags == 0) return; + firstoffset += 2; + + /* Search for ExifSubIFD offset Tag in IFD0 */ + for (;;) { + if (firstoffset > length - 12) return; /* check end of data segment */ + /* Get Tag number */ + if (is_motorola) { + tagnum = GETJOCTET(data[firstoffset]); + tagnum <<= 8; + tagnum += GETJOCTET(data[firstoffset+1]); + } else { + tagnum = GETJOCTET(data[firstoffset+1]); + tagnum <<= 8; + tagnum += GETJOCTET(data[firstoffset]); + } + if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */ + if (--number_of_tags == 0) return; + firstoffset += 12; + } + + /* Get the ExifSubIFD offset */ + if (is_motorola) { + if (GETJOCTET(data[firstoffset+8]) != 0) return; + if (GETJOCTET(data[firstoffset+9]) != 0) return; + offset = GETJOCTET(data[firstoffset+10]); + offset <<= 8; + offset += GETJOCTET(data[firstoffset+11]); + } else { + if (GETJOCTET(data[firstoffset+11]) != 0) return; + if (GETJOCTET(data[firstoffset+10]) != 0) return; + offset = GETJOCTET(data[firstoffset+9]); + offset <<= 8; + offset += GETJOCTET(data[firstoffset+8]); + } + if (offset > length - 2) return; /* check end of data segment */ + + /* Get the number of directory entries contained in this SubIFD */ + if (is_motorola) { + number_of_tags = GETJOCTET(data[offset]); + number_of_tags <<= 8; + number_of_tags += GETJOCTET(data[offset+1]); + } else { + number_of_tags = GETJOCTET(data[offset+1]); + number_of_tags <<= 8; + number_of_tags += GETJOCTET(data[offset]); + } + if (number_of_tags < 2) return; + offset += 2; + + /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */ + do { + if (offset > length - 12) return; /* check end of data segment */ + /* Get Tag number */ + if (is_motorola) { + tagnum = GETJOCTET(data[offset]); + tagnum <<= 8; + tagnum += GETJOCTET(data[offset+1]); + } else { + tagnum = GETJOCTET(data[offset+1]); + tagnum <<= 8; + tagnum += GETJOCTET(data[offset]); + } + if (tagnum == 0xA002 || tagnum == 0xA003) { + if (tagnum == 0xA002) + new_value = new_width; /* ExifImageWidth Tag */ + else + new_value = new_height; /* ExifImageHeight Tag */ + if (is_motorola) { + data[offset+2] = 0; /* Format = unsigned long (4 octets) */ + data[offset+3] = 4; + data[offset+4] = 0; /* Number Of Components = 1 */ + data[offset+5] = 0; + data[offset+6] = 0; + data[offset+7] = 1; + data[offset+8] = 0; + data[offset+9] = 0; + data[offset+10] = (JOCTET)((new_value >> 8) & 0xFF); + data[offset+11] = (JOCTET)(new_value & 0xFF); + } else { + data[offset+2] = 4; /* Format = unsigned long (4 octets) */ + data[offset+3] = 0; + data[offset+4] = 1; /* Number Of Components = 1 */ + data[offset+5] = 0; + data[offset+6] = 0; + data[offset+7] = 0; + data[offset+8] = (JOCTET)(new_value & 0xFF); + data[offset+9] = (JOCTET)((new_value >> 8) & 0xFF); + data[offset+10] = 0; + data[offset+11] = 0; + } + } + offset += 12; + } while (--number_of_tags); +} + + +/* Adjust output image parameters as needed. + * + * This must be called after jpeg_copy_critical_parameters() + * and before jpeg_write_coefficients(). + * + * The return value is the set of virtual coefficient arrays to be written + * (either the ones allocated by jtransform_request_workspace, or the + * original source data arrays). The caller will need to pass this value + * to jpeg_write_coefficients(). + */ + +GLOBAL(jvirt_barray_ptr *) +jtransform_adjust_parameters (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo, + jvirt_barray_ptr *src_coef_arrays, + jpeg_transform_info *info) +{ + /* If force-to-grayscale is requested, adjust destination parameters */ + if (info->force_grayscale) { + /* First, ensure we have YCbCr or grayscale data, and that the source's + * Y channel is full resolution. (No reasonable person would make Y + * be less than full resolution, so actually coping with that case + * isn't worth extra code space. But we check it to avoid crashing.) + */ + if (((dstinfo->jpeg_color_space == JCS_YCbCr && + dstinfo->num_components == 3) || + (dstinfo->jpeg_color_space == JCS_GRAYSCALE && + dstinfo->num_components == 1)) && + srcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor && + srcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) { + /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed + * properly. Among other things, it sets the target h_samp_factor & + * v_samp_factor to 1, which typically won't match the source. + * We have to preserve the source's quantization table number, however. + */ + int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no; + jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE); + dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no; + } else { + /* Sorry, can't do it */ + ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL); + } + } else if (info->num_components == 1) { + /* For a single-component source, we force the destination sampling factors + * to 1x1, with or without force_grayscale. This is useful because some + * decoders choke on grayscale images with other sampling factors. + */ + dstinfo->comp_info[0].h_samp_factor = 1; + dstinfo->comp_info[0].v_samp_factor = 1; + } + + /* Correct the destination's image dimensions as necessary + * for rotate/flip, resize, and crop operations. + */ + dstinfo->jpeg_width = info->output_width; + dstinfo->jpeg_height = info->output_height; + + /* Transpose destination image parameters */ + switch (info->transform) { + case JXFORM_TRANSPOSE: + case JXFORM_TRANSVERSE: + case JXFORM_ROT_90: + case JXFORM_ROT_270: + transpose_critical_parameters(dstinfo); + break; + default: + break; + } + + /* Adjust Exif properties */ + if (srcinfo->marker_list != NULL && + srcinfo->marker_list->marker == JPEG_APP0+1 && + srcinfo->marker_list->data_length >= 6 && + GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 && + GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 && + GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 && + GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 && + GETJOCTET(srcinfo->marker_list->data[4]) == 0 && + GETJOCTET(srcinfo->marker_list->data[5]) == 0) { + /* Suppress output of JFIF marker */ + dstinfo->write_JFIF_header = FALSE; + /* Adjust Exif image parameters */ + if (dstinfo->jpeg_width != srcinfo->image_width || + dstinfo->jpeg_height != srcinfo->image_height) + /* Align data segment to start of TIFF structure for parsing */ + adjust_exif_parameters(srcinfo->marker_list->data + 6, + srcinfo->marker_list->data_length - 6, + dstinfo->jpeg_width, dstinfo->jpeg_height); + } + + /* Return the appropriate output data set */ + if (info->workspace_coef_arrays != NULL) + return info->workspace_coef_arrays; + return src_coef_arrays; +} + + +/* Execute the actual transformation, if any. + * + * This must be called *after* jpeg_write_coefficients, because it depends + * on jpeg_write_coefficients to have computed subsidiary values such as + * the per-component width and height fields in the destination object. + * + * Note that some transformations will modify the source data arrays! + */ + +GLOBAL(void) +jtransform_execute_transform (j_decompress_ptr srcinfo, + j_compress_ptr dstinfo, + jvirt_barray_ptr *src_coef_arrays, + jpeg_transform_info *info) +{ + jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays; + + /* Note: conditions tested here should match those in switch statement + * in jtransform_request_workspace() + */ + switch (info->transform) { + case JXFORM_NONE: + if (info->x_crop_offset != 0 || info->y_crop_offset != 0) + do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_FLIP_H: + if (info->y_crop_offset != 0) + do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + else + do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset, + src_coef_arrays); + break; + case JXFORM_FLIP_V: + do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_TRANSPOSE: + do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_TRANSVERSE: + do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_ROT_90: + do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_ROT_180: + do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + case JXFORM_ROT_270: + do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset, + src_coef_arrays, dst_coef_arrays); + break; + } +} + +/* jtransform_perfect_transform + * + * Determine whether lossless transformation is perfectly + * possible for a specified image and transformation. + * + * Inputs: + * image_width, image_height: source image dimensions. + * MCU_width, MCU_height: pixel dimensions of MCU. + * transform: transformation identifier. + * Parameter sources from initialized jpeg_struct + * (after reading source header): + * image_width = cinfo.image_width + * image_height = cinfo.image_height + * MCU_width = cinfo.max_h_samp_factor * cinfo.block_size + * MCU_height = cinfo.max_v_samp_factor * cinfo.block_size + * Result: + * TRUE = perfect transformation possible + * FALSE = perfect transformation not possible + * (may use custom action then) + */ + +GLOBAL(boolean) +jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height, + int MCU_width, int MCU_height, + JXFORM_CODE transform) +{ + boolean result = TRUE; /* initialize TRUE */ + + switch (transform) { + case JXFORM_FLIP_H: + case JXFORM_ROT_270: + if (image_width % (JDIMENSION) MCU_width) + result = FALSE; + break; + case JXFORM_FLIP_V: + case JXFORM_ROT_90: + if (image_height % (JDIMENSION) MCU_height) + result = FALSE; + break; + case JXFORM_TRANSVERSE: + case JXFORM_ROT_180: + if (image_width % (JDIMENSION) MCU_width) + result = FALSE; + if (image_height % (JDIMENSION) MCU_height) + result = FALSE; + break; + default: + break; + } + + return result; +} + +#endif /* TRANSFORMS_SUPPORTED */ + + +/* Setup decompression object to save desired markers in memory. + * This must be called before jpeg_read_header() to have the desired effect. + */ + +GLOBAL(void) +jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option) +{ +#ifdef SAVE_MARKERS_SUPPORTED + int m; + + /* Save comments except under NONE option */ + if (option != JCOPYOPT_NONE) { + jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF); + } + /* Save all types of APPn markers iff ALL option */ + if (option == JCOPYOPT_ALL) { + for (m = 0; m < 16; m++) + jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF); + } +#endif /* SAVE_MARKERS_SUPPORTED */ +} + +/* Copy markers saved in the given source object to the destination object. + * This should be called just after jpeg_start_compress() or + * jpeg_write_coefficients(). + * Note that those routines will have written the SOI, and also the + * JFIF APP0 or Adobe APP14 markers if selected. + */ + +GLOBAL(void) +jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JCOPY_OPTION option) +{ + jpeg_saved_marker_ptr marker; + + /* In the current implementation, we don't actually need to examine the + * option flag here; we just copy everything that got saved. + * But to avoid confusion, we do not output JFIF and Adobe APP14 markers + * if the encoder library already wrote one. + */ + for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) { + if (dstinfo->write_JFIF_header && + marker->marker == JPEG_APP0 && + marker->data_length >= 5 && + GETJOCTET(marker->data[0]) == 0x4A && + GETJOCTET(marker->data[1]) == 0x46 && + GETJOCTET(marker->data[2]) == 0x49 && + GETJOCTET(marker->data[3]) == 0x46 && + GETJOCTET(marker->data[4]) == 0) + continue; /* reject duplicate JFIF */ + if (dstinfo->write_Adobe_marker && + marker->marker == JPEG_APP0+14 && + marker->data_length >= 5 && + GETJOCTET(marker->data[0]) == 0x41 && + GETJOCTET(marker->data[1]) == 0x64 && + GETJOCTET(marker->data[2]) == 0x6F && + GETJOCTET(marker->data[3]) == 0x62 && + GETJOCTET(marker->data[4]) == 0x65) + continue; /* reject duplicate Adobe */ +#ifdef NEED_FAR_POINTERS + /* We could use jpeg_write_marker if the data weren't FAR... */ + { + unsigned int i; + jpeg_write_m_header(dstinfo, marker->marker, marker->data_length); + for (i = 0; i < marker->data_length; i++) + jpeg_write_m_byte(dstinfo, marker->data[i]); + } +#else + jpeg_write_marker(dstinfo, marker->marker, + marker->data, marker->data_length); +#endif + } +} diff --git a/thirdparty/LibJPEG/jpeg-9/transupp.h b/thirdparty/LibJPEG/jpeg-9/transupp.h new file mode 100644 index 0000000..9aa0af3 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/transupp.h @@ -0,0 +1,213 @@ +/* + * transupp.h + * + * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains declarations for image transformation routines and + * other utility code used by the jpegtran sample application. These are + * NOT part of the core JPEG library. But we keep these routines separate + * from jpegtran.c to ease the task of maintaining jpegtran-like programs + * that have other user interfaces. + * + * NOTE: all the routines declared here have very specific requirements + * about when they are to be executed during the reading and writing of the + * source and destination files. See the comments in transupp.c, or see + * jpegtran.c for an example of correct usage. + */ + +/* If you happen not to want the image transform support, disable it here */ +#ifndef TRANSFORMS_SUPPORTED +#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */ +#endif + +/* + * Although rotating and flipping data expressed as DCT coefficients is not + * hard, there is an asymmetry in the JPEG format specification for images + * whose dimensions aren't multiples of the iMCU size. The right and bottom + * image edges are padded out to the next iMCU boundary with junk data; but + * no padding is possible at the top and left edges. If we were to flip + * the whole image including the pad data, then pad garbage would become + * visible at the top and/or left, and real pixels would disappear into the + * pad margins --- perhaps permanently, since encoders & decoders may not + * bother to preserve DCT blocks that appear to be completely outside the + * nominal image area. So, we have to exclude any partial iMCUs from the + * basic transformation. + * + * Transpose is the only transformation that can handle partial iMCUs at the + * right and bottom edges completely cleanly. flip_h can flip partial iMCUs + * at the bottom, but leaves any partial iMCUs at the right edge untouched. + * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched. + * The other transforms are defined as combinations of these basic transforms + * and process edge blocks in a way that preserves the equivalence. + * + * The "trim" option causes untransformable partial iMCUs to be dropped; + * this is not strictly lossless, but it usually gives the best-looking + * result for odd-size images. Note that when this option is active, + * the expected mathematical equivalences between the transforms may not hold. + * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim + * followed by -rot 180 -trim trims both edges.) + * + * We also offer a lossless-crop option, which discards data outside a given + * image region but losslessly preserves what is inside. Like the rotate and + * flip transforms, lossless crop is restricted by the JPEG format: the upper + * left corner of the selected region must fall on an iMCU boundary. If this + * does not hold for the given crop parameters, we silently move the upper left + * corner up and/or left to make it so, simultaneously increasing the region + * dimensions to keep the lower right crop corner unchanged. (Thus, the + * output image covers at least the requested region, but may cover more.) + * The adjustment of the region dimensions may be optionally disabled. + * + * We also provide a lossless-resize option, which is kind of a lossless-crop + * operation in the DCT coefficient block domain - it discards higher-order + * coefficients and losslessly preserves lower-order coefficients of a + * sub-block. + * + * Rotate/flip transform, resize, and crop can be requested together in a + * single invocation. The crop is applied last --- that is, the crop region + * is specified in terms of the destination image after transform/resize. + * + * We also offer a "force to grayscale" option, which simply discards the + * chrominance channels of a YCbCr image. This is lossless in the sense that + * the luminance channel is preserved exactly. It's not the same kind of + * thing as the rotate/flip transformations, but it's convenient to handle it + * as part of this package, mainly because the transformation routines have to + * be aware of the option to know how many components to work on. + */ + + +/* Short forms of external names for systems with brain-damaged linkers. */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jtransform_parse_crop_spec jTrParCrop +#define jtransform_request_workspace jTrRequest +#define jtransform_adjust_parameters jTrAdjust +#define jtransform_execute_transform jTrExec +#define jtransform_perfect_transform jTrPerfect +#define jcopy_markers_setup jCMrkSetup +#define jcopy_markers_execute jCMrkExec +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* + * Codes for supported types of image transformations. + */ + +typedef enum { + JXFORM_NONE, /* no transformation */ + JXFORM_FLIP_H, /* horizontal flip */ + JXFORM_FLIP_V, /* vertical flip */ + JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */ + JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */ + JXFORM_ROT_90, /* 90-degree clockwise rotation */ + JXFORM_ROT_180, /* 180-degree rotation */ + JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */ +} JXFORM_CODE; + +/* + * Codes for crop parameters, which can individually be unspecified, + * positive or negative for xoffset or yoffset, + * positive or forced for width or height. + */ + +typedef enum { + JCROP_UNSET, + JCROP_POS, + JCROP_NEG, + JCROP_FORCE +} JCROP_CODE; + +/* + * Transform parameters struct. + * NB: application must not change any elements of this struct after + * calling jtransform_request_workspace. + */ + +typedef struct { + /* Options: set by caller */ + JXFORM_CODE transform; /* image transform operator */ + boolean perfect; /* if TRUE, fail if partial MCUs are requested */ + boolean trim; /* if TRUE, trim partial MCUs as needed */ + boolean force_grayscale; /* if TRUE, convert color image to grayscale */ + boolean crop; /* if TRUE, crop source image */ + + /* Crop parameters: application need not set these unless crop is TRUE. + * These can be filled in by jtransform_parse_crop_spec(). + */ + JDIMENSION crop_width; /* Width of selected region */ + JCROP_CODE crop_width_set; /* (forced disables adjustment) */ + JDIMENSION crop_height; /* Height of selected region */ + JCROP_CODE crop_height_set; /* (forced disables adjustment) */ + JDIMENSION crop_xoffset; /* X offset of selected region */ + JCROP_CODE crop_xoffset_set; /* (negative measures from right edge) */ + JDIMENSION crop_yoffset; /* Y offset of selected region */ + JCROP_CODE crop_yoffset_set; /* (negative measures from bottom edge) */ + + /* Internal workspace: caller should not touch these */ + int num_components; /* # of components in workspace */ + jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */ + JDIMENSION output_width; /* cropped destination dimensions */ + JDIMENSION output_height; + JDIMENSION x_crop_offset; /* destination crop offsets measured in iMCUs */ + JDIMENSION y_crop_offset; + int iMCU_sample_width; /* destination iMCU size */ + int iMCU_sample_height; +} jpeg_transform_info; + + +#if TRANSFORMS_SUPPORTED + +/* Parse a crop specification (written in X11 geometry style) */ +EXTERN(boolean) jtransform_parse_crop_spec + JPP((jpeg_transform_info *info, const char *spec)); +/* Request any required workspace */ +EXTERN(boolean) jtransform_request_workspace + JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info)); +/* Adjust output image parameters */ +EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters + JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + jvirt_barray_ptr *src_coef_arrays, + jpeg_transform_info *info)); +/* Execute the actual transformation, if any */ +EXTERN(void) jtransform_execute_transform + JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + jvirt_barray_ptr *src_coef_arrays, + jpeg_transform_info *info)); +/* Determine whether lossless transformation is perfectly + * possible for a specified image and transformation. + */ +EXTERN(boolean) jtransform_perfect_transform + JPP((JDIMENSION image_width, JDIMENSION image_height, + int MCU_width, int MCU_height, + JXFORM_CODE transform)); + +/* jtransform_execute_transform used to be called + * jtransform_execute_transformation, but some compilers complain about + * routine names that long. This macro is here to avoid breaking any + * old source code that uses the original name... + */ +#define jtransform_execute_transformation jtransform_execute_transform + +#endif /* TRANSFORMS_SUPPORTED */ + + +/* + * Support for copying optional markers from source to destination file. + */ + +typedef enum { + JCOPYOPT_NONE, /* copy no optional markers */ + JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */ + JCOPYOPT_ALL /* copy all optional markers */ +} JCOPY_OPTION; + +#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */ + +/* Setup decompression object to save desired markers in memory */ +EXTERN(void) jcopy_markers_setup + JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option)); +/* Copy markers saved in the given source object to the destination object */ +EXTERN(void) jcopy_markers_execute + JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo, + JCOPY_OPTION option)); diff --git a/thirdparty/LibJPEG/jpeg-9/usage.txt b/thirdparty/LibJPEG/jpeg-9/usage.txt new file mode 100644 index 0000000..88158d6 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/usage.txt @@ -0,0 +1,650 @@ +USAGE instructions for the Independent JPEG Group's JPEG software +================================================================= + +This file describes usage of the JPEG conversion programs cjpeg and djpeg, +as well as the utility programs jpegtran, rdjpgcom and wrjpgcom. (See +the other documentation files if you wish to use the JPEG library within +your own programs.) + +If you are on a Unix machine you may prefer to read the Unix-style manual +pages in files cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1. + + +INTRODUCTION + +These programs implement JPEG image encoding, decoding, and transcoding. +JPEG (pronounced "jay-peg") is a standardized compression method for +full-color and gray-scale images. + + +GENERAL USAGE + +We provide two programs, cjpeg to compress an image file into JPEG format, +and djpeg to decompress a JPEG file back into a conventional image format. + +On Unix-like systems, you say: + cjpeg [switches] [imagefile] >jpegfile +or + djpeg [switches] [jpegfile] >imagefile +The programs read the specified input file, or standard input if none is +named. They always write to standard output (with trace/error messages to +standard error). These conventions are handy for piping images between +programs. + +On most non-Unix systems, you say: + cjpeg [switches] imagefile jpegfile +or + djpeg [switches] jpegfile imagefile +i.e., both the input and output files are named on the command line. This +style is a little more foolproof, and it loses no functionality if you don't +have pipes. (You can get this style on Unix too, if you prefer, by defining +TWO_FILE_COMMANDLINE when you compile the programs; see install.txt.) + +You can also say: + cjpeg [switches] -outfile jpegfile imagefile +or + djpeg [switches] -outfile imagefile jpegfile +This syntax works on all systems, so it is useful for scripts. + +The currently supported image file formats are: PPM (PBMPLUS color format), +PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster Toolkit +format). (RLE is supported only if the URT library is available.) +cjpeg recognizes the input image format automatically, with the exception +of some Targa-format files. You have to tell djpeg which format to generate. + +JPEG files are in the defacto standard JFIF file format. There are other, +less widely used JPEG-based file formats, but we don't support them. + +All switch names may be abbreviated; for example, -grayscale may be written +-gray or -gr. Most of the "basic" switches can be abbreviated to as little as +one letter. Upper and lower case are equivalent (-BMP is the same as -bmp). +British spellings are also accepted (e.g., -greyscale), though for brevity +these are not mentioned below. + + +CJPEG DETAILS + +The basic command line switches for cjpeg are: + + -quality N[,...] Scale quantization tables to adjust image quality. + Quality is 0 (worst) to 100 (best); default is 75. + (See below for more info.) + + -grayscale Create monochrome JPEG file from color input. + Be sure to use this switch when compressing a grayscale + BMP file, because cjpeg isn't bright enough to notice + whether a BMP file uses only shades of gray. By + saying -grayscale, you'll get a smaller JPEG file that + takes less time to process. + + -rgb Create RGB JPEG file. + Using this switch suppresses the conversion from RGB + colorspace input to the default YCbCr JPEG colorspace. + You can use this switch in combination with the + -block N switch (see below) for lossless JPEG coding. + See also the -rgb1 switch below. + + -optimize Perform optimization of entropy encoding parameters. + Without this, default encoding parameters are used. + -optimize usually makes the JPEG file a little smaller, + but cjpeg runs somewhat slower and needs much more + memory. Image quality and speed of decompression are + unaffected by -optimize. + + -progressive Create progressive JPEG file (see below). + + -scale M/N Scale the output image by a factor M/N. Currently + supported scale factors are M/N with all N from 1 to + 16, where M is the destination DCT size, which is 8 by + default (see -block N switch below). + + -targa Input file is Targa format. Targa files that contain + an "identification" field will not be automatically + recognized by cjpeg; for such files you must specify + -targa to make cjpeg treat the input as Targa format. + For most Targa files, you won't need this switch. + +The -quality switch lets you trade off compressed file size against quality of +the reconstructed image: the higher the quality setting, the larger the JPEG +file, and the closer the output image will be to the original input. Normally +you want to use the lowest quality setting (smallest file) that decompresses +into something visually indistinguishable from the original image. For this +purpose the quality setting should be between 50 and 95; the default of 75 is +often about right. If you see defects at -quality 75, then go up 5 or 10 +counts at a time until you are happy with the output image. (The optimal +setting will vary from one image to another.) + +-quality 100 will generate a quantization table of all 1's, minimizing loss +in the quantization step (but there is still information loss in subsampling, +as well as roundoff error). This setting is mainly of interest for +experimental purposes. Quality values above about 95 are NOT recommended for +normal use; the compressed file size goes up dramatically for hardly any gain +in output image quality. + +In the other direction, quality values below 50 will produce very small files +of low image quality. Settings around 5 to 10 might be useful in preparing an +index of a large image library, for example. Try -quality 2 (or so) for some +amusing Cubist effects. (Note: quality values below about 25 generate 2-byte +quantization tables, which are considered optional in the JPEG standard. +cjpeg emits a warning message when you give such a quality value, because some +other JPEG programs may be unable to decode the resulting file. Use -baseline +if you need to ensure compatibility at low quality values.) + +The -quality option has been extended in IJG version 7 for support of separate +quality settings for luminance and chrominance (or in general, for every +provided quantization table slot). This feature is useful for high-quality +applications which cannot accept the damage of color data by coarse +subsampling settings. You can now easily reduce the color data amount more +smoothly with finer control without separate subsampling. The resulting file +is fully compliant with standard JPEG decoders. +Note that the -quality ratings refer to the quantization table slots, and that +the last value is replicated if there are more q-table slots than parameters. +The default q-table slots are 0 for luminance and 1 for chrominance with +default tables as given in the JPEG standard. This is compatible with the old +behaviour in case that only one parameter is given, which is then used for +both luminance and chrominance (slots 0 and 1). More or custom quantization +tables can be set with -qtables and assigned to components with -qslots +parameter (see the "wizard" switches below). +CAUTION: You must explicitly add -sample 1x1 for efficient separate color +quality selection, since the default value used by library is 2x2! + +The -progressive switch creates a "progressive JPEG" file. In this type of +JPEG file, the data is stored in multiple scans of increasing quality. If the +file is being transmitted over a slow communications link, the decoder can use +the first scan to display a low-quality image very quickly, and can then +improve the display with each subsequent scan. The final image is exactly +equivalent to a standard JPEG file of the same quality setting, and the total +file size is about the same --- often a little smaller. + +Switches for advanced users: + + -arithmetic Use arithmetic coding. CAUTION: arithmetic coded JPEG + is not yet widely implemented, so many decoders will + be unable to view an arithmetic coded JPEG file at + all. + + -block N Set DCT block size. All N from 1 to 16 are possible. + Default is 8 (baseline format). + Larger values produce higher compression, + smaller values produce higher quality + (exact DCT stage possible with 1 or 2; with the + default quality of 75 and default Luminance qtable + the DCT+Quantization stage is lossless for N=1). + CAUTION: An implementation of the JPEG SmartScale + extension is required for this feature. SmartScale + enabled JPEG is not yet widely implemented, so many + decoders will be unable to view a SmartScale extended + JPEG file at all. + + -rgb1 Create RGB JPEG file with reversible color transform. + Works like the -rgb switch (see above) and inserts a + simple reversible color transform into the processing + which significantly improves the compression. + Use this switch in combination with the -block N + switch (see above) for lossless JPEG coding. + CAUTION: A decoder with inverse color transform + support is required for this feature. Reversible + color transform support is not yet widely implemented, + so many decoders will be unable to view a reversible + color transformed JPEG file at all. + + -dct int Use integer DCT method (default). + -dct fast Use fast integer DCT (less accurate). + -dct float Use floating-point DCT method. + The float method is very slightly more accurate than + the int method, but is much slower unless your machine + has very fast floating-point hardware. Also note that + results of the floating-point method may vary slightly + across machines, while the integer methods should give + the same results everywhere. The fast integer method + is much less accurate than the other two. + + -nosmooth Don't use high-quality downsampling. + + -restart N Emit a JPEG restart marker every N MCU rows, or every + N MCU blocks if "B" is attached to the number. + -restart 0 (the default) means no restart markers. + + -smooth N Smooth the input image to eliminate dithering noise. + N, ranging from 1 to 100, indicates the strength of + smoothing. 0 (the default) means no smoothing. + + -maxmemory N Set limit for amount of memory to use in processing + large images. Value is in thousands of bytes, or + millions of bytes if "M" is attached to the number. + For example, -max 4m selects 4000000 bytes. If more + space is needed, temporary files will be used. + + -verbose Enable debug printout. More -v's give more printout. + or -debug Also, version information is printed at startup. + +The -restart option inserts extra markers that allow a JPEG decoder to +resynchronize after a transmission error. Without restart markers, any damage +to a compressed file will usually ruin the image from the point of the error +to the end of the image; with restart markers, the damage is usually confined +to the portion of the image up to the next restart marker. Of course, the +restart markers occupy extra space. We recommend -restart 1 for images that +will be transmitted across unreliable networks such as Usenet. + +The -smooth option filters the input to eliminate fine-scale noise. This is +often useful when converting dithered images to JPEG: a moderate smoothing +factor of 10 to 50 gets rid of dithering patterns in the input file, resulting +in a smaller JPEG file and a better-looking image. Too large a smoothing +factor will visibly blur the image, however. + +Switches for wizards: + + -baseline Force baseline-compatible quantization tables to be + generated. This clamps quantization values to 8 bits + even at low quality settings. (This switch is poorly + named, since it does not ensure that the output is + actually baseline JPEG. For example, you can use + -baseline and -progressive together.) + + -qtables file Use the quantization tables given in the specified + text file. + + -qslots N[,...] Select which quantization table to use for each color + component. + + -sample HxV[,...] Set JPEG sampling factors for each color component. + + -scans file Use the scan script given in the specified text file. + +The "wizard" switches are intended for experimentation with JPEG. If you +don't know what you are doing, DON'T USE THEM. These switches are documented +further in the file wizard.txt. + + +DJPEG DETAILS + +The basic command line switches for djpeg are: + + -colors N Reduce image to at most N colors. This reduces the + or -quantize N number of colors used in the output image, so that it + can be displayed on a colormapped display or stored in + a colormapped file format. For example, if you have + an 8-bit display, you'd need to reduce to 256 or fewer + colors. (-colors is the recommended name, -quantize + is provided only for backwards compatibility.) + + -fast Select recommended processing options for fast, low + quality output. (The default options are chosen for + highest quality output.) Currently, this is equivalent + to "-dct fast -nosmooth -onepass -dither ordered". + + -grayscale Force gray-scale output even if JPEG file is color. + Useful for viewing on monochrome displays; also, + djpeg runs noticeably faster in this mode. + + -scale M/N Scale the output image by a factor M/N. Currently + supported scale factors are M/N with all M from 1 to + 16, where N is the source DCT size, which is 8 for + baseline JPEG. If the /N part is omitted, then M + specifies the DCT scaled size to be applied on the + given input. For baseline JPEG this is equivalent to + M/8 scaling, since the source DCT size for baseline + JPEG is 8. Scaling is handy if the image is larger + than your screen; also, djpeg runs much faster when + scaling down the output. + + -bmp Select BMP output format (Windows flavor). 8-bit + colormapped format is emitted if -colors or -grayscale + is specified, or if the JPEG file is gray-scale; + otherwise, 24-bit full-color format is emitted. + + -gif Select GIF output format. Since GIF does not support + more than 256 colors, -colors 256 is assumed (unless + you specify a smaller number of colors). If you + specify -fast, the default number of colors is 216. + + -os2 Select BMP output format (OS/2 1.x flavor). 8-bit + colormapped format is emitted if -colors or -grayscale + is specified, or if the JPEG file is gray-scale; + otherwise, 24-bit full-color format is emitted. + + -pnm Select PBMPLUS (PPM/PGM) output format (this is the + default format). PGM is emitted if the JPEG file is + gray-scale or if -grayscale is specified; otherwise + PPM is emitted. + + -rle Select RLE output format. (Requires URT library.) + + -targa Select Targa output format. Gray-scale format is + emitted if the JPEG file is gray-scale or if + -grayscale is specified; otherwise, colormapped format + is emitted if -colors is specified; otherwise, 24-bit + full-color format is emitted. + +Switches for advanced users: + + -dct int Use integer DCT method (default). + -dct fast Use fast integer DCT (less accurate). + -dct float Use floating-point DCT method. + The float method is very slightly more accurate than + the int method, but is much slower unless your machine + has very fast floating-point hardware. Also note that + results of the floating-point method may vary slightly + across machines, while the integer methods should give + the same results everywhere. The fast integer method + is much less accurate than the other two. + + -dither fs Use Floyd-Steinberg dithering in color quantization. + -dither ordered Use ordered dithering in color quantization. + -dither none Do not use dithering in color quantization. + By default, Floyd-Steinberg dithering is applied when + quantizing colors; this is slow but usually produces + the best results. Ordered dither is a compromise + between speed and quality; no dithering is fast but + usually looks awful. Note that these switches have + no effect unless color quantization is being done. + Ordered dither is only available in -onepass mode. + + -map FILE Quantize to the colors used in the specified image + file. This is useful for producing multiple files + with identical color maps, or for forcing a predefined + set of colors to be used. The FILE must be a GIF + or PPM file. This option overrides -colors and + -onepass. + + -nosmooth Don't use high-quality upsampling. + + -onepass Use one-pass instead of two-pass color quantization. + The one-pass method is faster and needs less memory, + but it produces a lower-quality image. -onepass is + ignored unless you also say -colors N. Also, + the one-pass method is always used for gray-scale + output (the two-pass method is no improvement then). + + -maxmemory N Set limit for amount of memory to use in processing + large images. Value is in thousands of bytes, or + millions of bytes if "M" is attached to the number. + For example, -max 4m selects 4000000 bytes. If more + space is needed, temporary files will be used. + + -verbose Enable debug printout. More -v's give more printout. + or -debug Also, version information is printed at startup. + + +HINTS FOR CJPEG + +Color GIF files are not the ideal input for JPEG; JPEG is really intended for +compressing full-color (24-bit) images. In particular, don't try to convert +cartoons, line drawings, and other images that have only a few distinct +colors. GIF works great on these, JPEG does not. If you want to convert a +GIF to JPEG, you should experiment with cjpeg's -quality and -smooth options +to get a satisfactory conversion. -smooth 10 or so is often helpful. + +Avoid running an image through a series of JPEG compression/decompression +cycles. Image quality loss will accumulate; after ten or so cycles the image +may be noticeably worse than it was after one cycle. It's best to use a +lossless format while manipulating an image, then convert to JPEG format when +you are ready to file the image away. + +The -optimize option to cjpeg is worth using when you are making a "final" +version for posting or archiving. It's also a win when you are using low +quality settings to make very small JPEG files; the percentage improvement +is often a lot more than it is on larger files. (At present, -optimize +mode is always selected when generating progressive JPEG files.) + +GIF input files are no longer supported, to avoid the Unisys LZW patent. +(Conversion of GIF files to JPEG is usually a bad idea anyway.) + + +HINTS FOR DJPEG + +To get a quick preview of an image, use the -grayscale and/or -scale switches. +"-grayscale -scale 1/8" is the fastest case. + +Several options are available that trade off image quality to gain speed. +"-fast" turns on the recommended settings. + +"-dct fast" and/or "-nosmooth" gain speed at a small sacrifice in quality. +When producing a color-quantized image, "-onepass -dither ordered" is fast but +much lower quality than the default behavior. "-dither none" may give +acceptable results in two-pass mode, but is seldom tolerable in one-pass mode. + +If you are fortunate enough to have very fast floating point hardware, +"-dct float" may be even faster than "-dct fast". But on most machines +"-dct float" is slower than "-dct int"; in this case it is not worth using, +because its theoretical accuracy advantage is too small to be significant +in practice. + +Two-pass color quantization requires a good deal of memory; on MS-DOS machines +it may run out of memory even with -maxmemory 0. In that case you can still +decompress, with some loss of image quality, by specifying -onepass for +one-pass quantization. + +To avoid the Unisys LZW patent, djpeg produces uncompressed GIF files. These +are larger than they should be, but are readable by standard GIF decoders. + + +HINTS FOR BOTH PROGRAMS + +If more space is needed than will fit in the available main memory (as +determined by -maxmemory), temporary files will be used. (MS-DOS versions +will try to get extended or expanded memory first.) The temporary files are +often rather large: in typical cases they occupy three bytes per pixel, for +example 3*800*600 = 1.44Mb for an 800x600 image. If you don't have enough +free disk space, leave out -progressive and -optimize (for cjpeg) or specify +-onepass (for djpeg). + +On MS-DOS, the temporary files are created in the directory named by the TMP +or TEMP environment variable, or in the current directory if neither of those +exist. Amiga implementations put the temp files in the directory named by +JPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with adequate free +space. + +The default memory usage limit (-maxmemory) is set when the software is +compiled. If you get an "insufficient memory" error, try specifying a smaller +-maxmemory value, even -maxmemory 0 to use the absolute minimum space. You +may want to recompile with a smaller default value if this happens often. + +On machines that have "environment" variables, you can define the environment +variable JPEGMEM to set the default memory limit. The value is specified as +described for the -maxmemory switch. JPEGMEM overrides the default value +specified when the program was compiled, and itself is overridden by an +explicit -maxmemory switch. + +On MS-DOS machines, -maxmemory is the amount of main (conventional) memory to +use. (Extended or expanded memory is also used if available.) Most +DOS-specific versions of this software do their own memory space estimation +and do not need you to specify -maxmemory. + + +JPEGTRAN + +jpegtran performs various useful transformations of JPEG files. +It can translate the coded representation from one variant of JPEG to another, +for example from baseline JPEG to progressive JPEG or vice versa. It can also +perform some rearrangements of the image data, for example turning an image +from landscape to portrait format by rotation. + +jpegtran works by rearranging the compressed data (DCT coefficients), without +ever fully decoding the image. Therefore, its transformations are lossless: +there is no image degradation at all, which would not be true if you used +djpeg followed by cjpeg to accomplish the same conversion. But by the same +token, jpegtran cannot perform lossy operations such as changing the image +quality. + +jpegtran uses a command line syntax similar to cjpeg or djpeg. +On Unix-like systems, you say: + jpegtran [switches] [inputfile] >outputfile +On most non-Unix systems, you say: + jpegtran [switches] inputfile outputfile +where both the input and output files are JPEG files. + +To specify the coded JPEG representation used in the output file, +jpegtran accepts a subset of the switches recognized by cjpeg: + -optimize Perform optimization of entropy encoding parameters. + -progressive Create progressive JPEG file. + -arithmetic Use arithmetic coding. + -restart N Emit a JPEG restart marker every N MCU rows, or every + N MCU blocks if "B" is attached to the number. + -scans file Use the scan script given in the specified text file. +See the previous discussion of cjpeg for more details about these switches. +If you specify none of these switches, you get a plain baseline-JPEG output +file. The quality setting and so forth are determined by the input file. + +The image can be losslessly transformed by giving one of these switches: + -flip horizontal Mirror image horizontally (left-right). + -flip vertical Mirror image vertically (top-bottom). + -rotate 90 Rotate image 90 degrees clockwise. + -rotate 180 Rotate image 180 degrees. + -rotate 270 Rotate image 270 degrees clockwise (or 90 ccw). + -transpose Transpose image (across UL-to-LR axis). + -transverse Transverse transpose (across UR-to-LL axis). + +The transpose transformation has no restrictions regarding image dimensions. +The other transformations operate rather oddly if the image dimensions are not +a multiple of the iMCU size (usually 8 or 16 pixels), because they can only +transform complete blocks of DCT coefficient data in the desired way. + +jpegtran's default behavior when transforming an odd-size image is designed +to preserve exact reversibility and mathematical consistency of the +transformation set. As stated, transpose is able to flip the entire image +area. Horizontal mirroring leaves any partial iMCU column at the right edge +untouched, but is able to flip all rows of the image. Similarly, vertical +mirroring leaves any partial iMCU row at the bottom edge untouched, but is +able to flip all columns. The other transforms can be built up as sequences +of transpose and flip operations; for consistency, their actions on edge +pixels are defined to be the same as the end result of the corresponding +transpose-and-flip sequence. + +For practical use, you may prefer to discard any untransformable edge pixels +rather than having a strange-looking strip along the right and/or bottom edges +of a transformed image. To do this, add the -trim switch: + -trim Drop non-transformable edge blocks. +Obviously, a transformation with -trim is not reversible, so strictly speaking +jpegtran with this switch is not lossless. Also, the expected mathematical +equivalences between the transformations no longer hold. For example, +"-rot 270 -trim" trims only the bottom edge, but "-rot 90 -trim" followed by +"-rot 180 -trim" trims both edges. + +If you are only interested in perfect transformation, add the -perfect switch: + -perfect Fails with an error if the transformation is not + perfect. +For example you may want to do + jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg +to do a perfect rotation if available or an approximated one if not. + +We also offer a lossless-crop option, which discards data outside a given +image region but losslessly preserves what is inside. Like the rotate and +flip transforms, lossless crop is restricted by the current JPEG format: the +upper left corner of the selected region must fall on an iMCU boundary. If +this does not hold for the given crop parameters, we silently move the upper +left corner up and/or left to make it so, simultaneously increasing the region +dimensions to keep the lower right crop corner unchanged. (Thus, the output +image covers at least the requested region, but may cover more.) + +The image can be losslessly cropped by giving the switch: + -crop WxH+X+Y Crop to a rectangular subarea of width W, height H + starting at point X,Y. + +Other not-strictly-lossless transformation switches are: + + -grayscale Force grayscale output. +This option discards the chrominance channels if the input image is YCbCr +(ie, a standard color JPEG), resulting in a grayscale JPEG file. The +luminance channel is preserved exactly, so this is a better method of reducing +to grayscale than decompression, conversion, and recompression. This switch +is particularly handy for fixing a monochrome picture that was mistakenly +encoded as a color JPEG. (In such a case, the space savings from getting rid +of the near-empty chroma channels won't be large; but the decoding time for +a grayscale JPEG is substantially less than that for a color JPEG.) + + -scale M/N Scale the output image by a factor M/N. +Currently supported scale factors are M/N with all M from 1 to 16, where N is +the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted, +then M specifies the DCT scaled size to be applied on the given input. For +baseline JPEG this is equivalent to M/8 scaling, since the source DCT size +for baseline JPEG is 8. CAUTION: An implementation of the JPEG SmartScale +extension is required for this feature. SmartScale enabled JPEG is not yet +widely implemented, so many decoders will be unable to view a SmartScale +extended JPEG file at all. + +jpegtran also recognizes these switches that control what to do with "extra" +markers, such as comment blocks: + -copy none Copy no extra markers from source file. This setting + suppresses all comments and other excess baggage + present in the source file. + -copy comments Copy only comment markers. This setting copies + comments from the source file, but discards + any other inessential (for image display) data. + -copy all Copy all extra markers. This setting preserves + miscellaneous markers found in the source file, such + as JFIF thumbnails, Exif data, and Photoshop settings. + In some files these extra markers can be sizable. +The default behavior is -copy comments. (Note: in IJG releases v6 and v6a, +jpegtran always did the equivalent of -copy none.) + +Additional switches recognized by jpegtran are: + -outfile filename + -maxmemory N + -verbose + -debug +These work the same as in cjpeg or djpeg. + + +THE COMMENT UTILITIES + +The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. +Although the standard doesn't actually define what COM blocks are for, they +are widely used to hold user-supplied text strings. This lets you add +annotations, titles, index terms, etc to your JPEG files, and later retrieve +them as text. COM blocks do not interfere with the image stored in the JPEG +file. The maximum size of a COM block is 64K, but you can have as many of +them as you like in one JPEG file. + +We provide two utility programs to display COM block contents and add COM +blocks to a JPEG file. + +rdjpgcom searches a JPEG file and prints the contents of any COM blocks on +standard output. The command line syntax is + rdjpgcom [-raw] [-verbose] [inputfilename] +The switch "-raw" (or just "-r") causes rdjpgcom to also output non-printable +characters in comments, which are normally escaped for security reasons. +The switch "-verbose" (or just "-v") causes rdjpgcom to also display the JPEG +image dimensions. If you omit the input file name from the command line, +the JPEG file is read from standard input. (This may not work on some +operating systems, if binary data can't be read from stdin.) + +wrjpgcom adds a COM block, containing text you provide, to a JPEG file. +Ordinarily, the COM block is added after any existing COM blocks, but you +can delete the old COM blocks if you wish. wrjpgcom produces a new JPEG +file; it does not modify the input file. DO NOT try to overwrite the input +file by directing wrjpgcom's output back into it; on most systems this will +just destroy your file. + +The command line syntax for wrjpgcom is similar to cjpeg's. On Unix-like +systems, it is + wrjpgcom [switches] [inputfilename] +The output file is written to standard output. The input file comes from +the named file, or from standard input if no input file is named. + +On most non-Unix systems, the syntax is + wrjpgcom [switches] inputfilename outputfilename +where both input and output file names must be given explicitly. + +wrjpgcom understands three switches: + -replace Delete any existing COM blocks from the file. + -comment "Comment text" Supply new COM text on command line. + -cfile name Read text for new COM block from named file. +(Switch names can be abbreviated.) If you have only one line of comment text +to add, you can provide it on the command line with -comment. The comment +text must be surrounded with quotes so that it is treated as a single +argument. Longer comments can be read from a text file. + +If you give neither -comment nor -cfile, then wrjpgcom will read the comment +text from standard input. (In this case an input image file name MUST be +supplied, so that the source JPEG file comes from somewhere else.) You can +enter multiple lines, up to 64KB worth. Type an end-of-file indicator +(usually control-D or control-Z) to terminate the comment text entry. + +wrjpgcom will not add a COM block if the provided comment string is empty. +Therefore -replace -comment "" can be used to delete all COM blocks from a +file. + +These utility programs do not depend on the IJG JPEG library. In +particular, the source code for rdjpgcom is intended as an illustration of +the minimum amount of code required to parse a JPEG file header correctly. diff --git a/thirdparty/LibJPEG/jpeg-9/wizard.txt b/thirdparty/LibJPEG/jpeg-9/wizard.txt new file mode 100644 index 0000000..54170b2 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wizard.txt @@ -0,0 +1,211 @@ +Advanced usage instructions for the Independent JPEG Group's JPEG software +========================================================================== + +This file describes cjpeg's "switches for wizards". + +The "wizard" switches are intended for experimentation with JPEG by persons +who are reasonably knowledgeable about the JPEG standard. If you don't know +what you are doing, DON'T USE THESE SWITCHES. You'll likely produce files +with worse image quality and/or poorer compression than you'd get from the +default settings. Furthermore, these switches must be used with caution +when making files intended for general use, because not all JPEG decoders +will support unusual JPEG parameter settings. + + +Quantization Table Adjustment +----------------------------- + +Ordinarily, cjpeg starts with a default set of tables (the same ones given +as examples in the JPEG standard) and scales them up or down according to +the -quality setting. The details of the scaling algorithm can be found in +jcparam.c. At very low quality settings, some quantization table entries +can get scaled up to values exceeding 255. Although 2-byte quantization +values are supported by the IJG software, this feature is not in baseline +JPEG and is not supported by all implementations. If you need to ensure +wide compatibility of low-quality files, you can constrain the scaled +quantization values to no more than 255 by giving the -baseline switch. +Note that use of -baseline will result in poorer quality for the same file +size, since more bits than necessary are expended on higher AC coefficients. + +You can substitute a different set of quantization values by using the +-qtables switch: + + -qtables file Use the quantization tables given in the named file. + +The specified file should be a text file containing decimal quantization +values. The file should contain one to four tables, each of 64 elements. +The tables are implicitly numbered 0,1,etc. in order of appearance. Table +entries appear in normal array order (NOT in the zigzag order in which they +will be stored in the JPEG file). + +Quantization table files are free format, in that arbitrary whitespace can +appear between numbers. Also, comments can be included: a comment starts +with '#' and extends to the end of the line. Here is an example file that +duplicates the default quantization tables: + + # Quantization tables given in JPEG spec, section K.1 + + # This is table 0 (the luminance table): + 16 11 10 16 24 40 51 61 + 12 12 14 19 26 58 60 55 + 14 13 16 24 40 57 69 56 + 14 17 22 29 51 87 80 62 + 18 22 37 56 68 109 103 77 + 24 35 55 64 81 104 113 92 + 49 64 78 87 103 121 120 101 + 72 92 95 98 112 100 103 99 + + # This is table 1 (the chrominance table): + 17 18 24 47 99 99 99 99 + 18 21 26 66 99 99 99 99 + 24 26 56 99 99 99 99 99 + 47 66 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + +If the -qtables switch is used without -quality, then the specified tables +are used exactly as-is. If both -qtables and -quality are used, then the +tables taken from the file are scaled in the same fashion that the default +tables would be scaled for that quality setting. If -baseline appears, then +the quantization values are constrained to the range 1-255. + +By default, cjpeg will use quantization table 0 for luminance components and +table 1 for chrominance components. To override this choice, use the -qslots +switch: + + -qslots N[,...] Select which quantization table to use for + each color component. + +The -qslots switch specifies a quantization table number for each color +component, in the order in which the components appear in the JPEG SOF marker. +For example, to create a separate table for each of Y,Cb,Cr, you could +provide a -qtables file that defines three quantization tables and say +"-qslots 0,1,2". If -qslots gives fewer table numbers than there are color +components, then the last table number is repeated as necessary. + + +Sampling Factor Adjustment +-------------------------- + +By default, cjpeg uses 2:1 horizontal and vertical downsampling when +compressing YCbCr data, and no downsampling for all other color spaces. +You can override this default with the -sample switch: + + -sample HxV[,...] Set JPEG sampling factors for each color + component. + +The -sample switch specifies the JPEG sampling factors for each color +component, in the order in which they appear in the JPEG SOF marker. +If you specify fewer HxV pairs than there are components, the remaining +components are set to 1x1 sampling. For example, the default YCbCr setting +is equivalent to "-sample 2x2,1x1,1x1", which can be abbreviated to +"-sample 2x2". + +There are still some JPEG decoders in existence that support only 2x1 +sampling (also called 4:2:2 sampling). Compatibility with such decoders can +be achieved by specifying "-sample 2x1". This is not recommended unless +really necessary, since it increases file size and encoding/decoding time +with very little quality gain. + + +Multiple Scan / Progression Control +----------------------------------- + +By default, cjpeg emits a single-scan sequential JPEG file. The +-progressive switch generates a progressive JPEG file using a default series +of progression parameters. You can create multiple-scan sequential JPEG +files or progressive JPEG files with custom progression parameters by using +the -scans switch: + + -scans file Use the scan sequence given in the named file. + +The specified file should be a text file containing a "scan script". +The script specifies the contents and ordering of the scans to be emitted. +Each entry in the script defines one scan. A scan definition specifies +the components to be included in the scan, and for progressive JPEG it also +specifies the progression parameters Ss,Se,Ah,Al for the scan. Scan +definitions are separated by semicolons (';'). A semicolon after the last +scan definition is optional. + +Each scan definition contains one to four component indexes, optionally +followed by a colon (':') and the four progressive-JPEG parameters. The +component indexes denote which color component(s) are to be transmitted in +the scan. Components are numbered in the order in which they appear in the +JPEG SOF marker, with the first component being numbered 0. (Note that these +indexes are not the "component ID" codes assigned to the components, just +positional indexes.) + +The progression parameters for each scan are: + Ss Zigzag index of first coefficient included in scan + Se Zigzag index of last coefficient included in scan + Ah Zero for first scan of a coefficient, else Al of prior scan + Al Successive approximation low bit position for scan +If the progression parameters are omitted, the values 0,63,0,0 are used, +producing a sequential JPEG file. cjpeg automatically determines whether +the script represents a progressive or sequential file, by observing whether +Ss and Se values other than 0 and 63 appear. (The -progressive switch is +not needed to specify this; in fact, it is ignored when -scans appears.) +The scan script must meet the JPEG restrictions on progression sequences. +(cjpeg checks that the spec's requirements are obeyed.) + +Scan script files are free format, in that arbitrary whitespace can appear +between numbers and around punctuation. Also, comments can be included: a +comment starts with '#' and extends to the end of the line. For additional +legibility, commas or dashes can be placed between values. (Actually, any +single punctuation character other than ':' or ';' can be inserted.) For +example, the following two scan definitions are equivalent: + 0 1 2: 0 63 0 0; + 0,1,2 : 0-63, 0,0 ; + +Here is an example of a scan script that generates a partially interleaved +sequential JPEG file: + + 0; # Y only in first scan + 1 2; # Cb and Cr in second scan + +Here is an example of a progressive scan script using only spectral selection +(no successive approximation): + + # Interleaved DC scan for Y,Cb,Cr: + 0,1,2: 0-0, 0, 0 ; + # AC scans: + 0: 1-2, 0, 0 ; # First two Y AC coefficients + 0: 3-5, 0, 0 ; # Three more + 1: 1-63, 0, 0 ; # All AC coefficients for Cb + 2: 1-63, 0, 0 ; # All AC coefficients for Cr + 0: 6-9, 0, 0 ; # More Y coefficients + 0: 10-63, 0, 0 ; # Remaining Y coefficients + +Here is an example of a successive-approximation script. This is equivalent +to the default script used by "cjpeg -progressive" for YCbCr images: + + # Initial DC scan for Y,Cb,Cr (lowest bit not sent) + 0,1,2: 0-0, 0, 1 ; + # First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits: + 0: 1-5, 0, 2 ; + # Send all Cr,Cb AC coefficients, minus lowest bit: + # (chroma data is usually too small to be worth subdividing further; + # but note we send Cr first since eye is least sensitive to Cb) + 2: 1-63, 0, 1 ; + 1: 1-63, 0, 1 ; + # Send remaining Y AC coefficients, minus 2 lowest bits: + 0: 6-63, 0, 2 ; + # Send next-to-lowest bit of all Y AC coefficients: + 0: 1-63, 2, 1 ; + # At this point we've sent all but the lowest bit of all coefficients. + # Send lowest bit of DC coefficients + 0,1,2: 0-0, 1, 0 ; + # Send lowest bit of AC coefficients + 2: 1-63, 1, 0 ; + 1: 1-63, 1, 0 ; + # Y AC lowest bit scan is last; it's usually the largest scan + 0: 1-63, 1, 0 ; + +It may be worth pointing out that this script is tuned for quality settings +of around 50 to 75. For lower quality settings, you'd probably want to use +a script with fewer stages of successive approximation (otherwise the +initial scans will be really bad). For higher quality settings, you might +want to use more stages of successive approximation (so that the initial +scans are not too large). diff --git a/thirdparty/LibJPEG/jpeg-9/wrbmp.c b/thirdparty/LibJPEG/jpeg-9/wrbmp.c new file mode 100644 index 0000000..3283b0f --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrbmp.c @@ -0,0 +1,442 @@ +/* + * wrbmp.c + * + * Copyright (C) 1994-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write output images in Microsoft "BMP" + * format (MS Windows 3.x and OS/2 1.x flavors). + * Either 8-bit colormapped or 24-bit full-color format can be written. + * No compression is supported. + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume output to + * an ordinary stdio stream. + * + * This code contributed by James Arthur Boucher. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef BMP_SUPPORTED + + +/* + * To support 12-bit JPEG data, we'd have to scale output down to 8 bits. + * This is not yet implemented. + */ + +#if BITS_IN_JSAMPLE != 8 + Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */ +#endif + +/* + * Since BMP stores scanlines bottom-to-top, we have to invert the image + * from JPEG's top-to-bottom order. To do this, we save the outgoing data + * in a virtual array during put_pixel_row calls, then actually emit the + * BMP file during finish_output. The virtual array contains one JSAMPLE per + * pixel if the output is grayscale or colormapped, three if it is full color. + */ + +/* Private version of data destination object */ + +typedef struct { + struct djpeg_dest_struct pub; /* public fields */ + + boolean is_os2; /* saves the OS2 format request flag */ + + jvirt_sarray_ptr whole_image; /* needed to reverse row order */ + JDIMENSION data_width; /* JSAMPLEs per row */ + JDIMENSION row_width; /* physical width of one row in the BMP file */ + int pad_bytes; /* number of padding bytes needed per row */ + JDIMENSION cur_output_row; /* next row# to write to virtual array */ +} bmp_dest_struct; + +typedef bmp_dest_struct * bmp_dest_ptr; + + +/* Forward declarations */ +LOCAL(void) write_colormap + JPP((j_decompress_ptr cinfo, bmp_dest_ptr dest, + int map_colors, int map_entry_size)); + + +/* + * Write some pixel data. + * In this module rows_supplied will always be 1. + */ + +METHODDEF(void) +put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +/* This version is for writing 24-bit pixels */ +{ + bmp_dest_ptr dest = (bmp_dest_ptr) dinfo; + JSAMPARRAY image_ptr; + register JSAMPROW inptr, outptr; + register JDIMENSION col; + int pad; + + /* Access next row in virtual array */ + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->whole_image, + dest->cur_output_row, (JDIMENSION) 1, TRUE); + dest->cur_output_row++; + + /* Transfer data. Note destination values must be in BGR order + * (even though Microsoft's own documents say the opposite). + */ + inptr = dest->pub.buffer[0]; + outptr = image_ptr[0]; + for (col = cinfo->output_width; col > 0; col--) { + outptr[2] = *inptr++; /* can omit GETJSAMPLE() safely */ + outptr[1] = *inptr++; + outptr[0] = *inptr++; + outptr += 3; + } + + /* Zero out the pad bytes. */ + pad = dest->pad_bytes; + while (--pad >= 0) + *outptr++ = 0; +} + +METHODDEF(void) +put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +/* This version is for grayscale OR quantized color output */ +{ + bmp_dest_ptr dest = (bmp_dest_ptr) dinfo; + JSAMPARRAY image_ptr; + register JSAMPROW inptr, outptr; + register JDIMENSION col; + int pad; + + /* Access next row in virtual array */ + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->whole_image, + dest->cur_output_row, (JDIMENSION) 1, TRUE); + dest->cur_output_row++; + + /* Transfer data. */ + inptr = dest->pub.buffer[0]; + outptr = image_ptr[0]; + for (col = cinfo->output_width; col > 0; col--) { + *outptr++ = *inptr++; /* can omit GETJSAMPLE() safely */ + } + + /* Zero out the pad bytes. */ + pad = dest->pad_bytes; + while (--pad >= 0) + *outptr++ = 0; +} + + +/* + * Startup: normally writes the file header. + * In this module we may as well postpone everything until finish_output. + */ + +METHODDEF(void) +start_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + /* no work here */ +} + + +/* + * Finish up at the end of the file. + * + * Here is where we really output the BMP file. + * + * First, routines to write the Windows and OS/2 variants of the file header. + */ + +LOCAL(void) +write_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) +/* Write a Windows-style BMP file header, including colormap if needed */ +{ + char bmpfileheader[14]; + char bmpinfoheader[40]; +#define PUT_2B(array,offset,value) \ + (array[offset] = (char) ((value) & 0xFF), \ + array[offset+1] = (char) (((value) >> 8) & 0xFF)) +#define PUT_4B(array,offset,value) \ + (array[offset] = (char) ((value) & 0xFF), \ + array[offset+1] = (char) (((value) >> 8) & 0xFF), \ + array[offset+2] = (char) (((value) >> 16) & 0xFF), \ + array[offset+3] = (char) (((value) >> 24) & 0xFF)) + INT32 headersize, bfSize; + int bits_per_pixel, cmap_entries; + + /* Compute colormap size and total file size */ + if (cinfo->out_color_space == JCS_RGB) { + if (cinfo->quantize_colors) { + /* Colormapped RGB */ + bits_per_pixel = 8; + cmap_entries = 256; + } else { + /* Unquantized, full color RGB */ + bits_per_pixel = 24; + cmap_entries = 0; + } + } else { + /* Grayscale output. We need to fake a 256-entry colormap. */ + bits_per_pixel = 8; + cmap_entries = 256; + } + /* File size */ + headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */ + bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; + + /* Set unused fields of header to 0 */ + MEMZERO(bmpfileheader, SIZEOF(bmpfileheader)); + MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader)); + + /* Fill the file header */ + bmpfileheader[0] = 0x42; /* first 2 bytes are ASCII 'B', 'M' */ + bmpfileheader[1] = 0x4D; + PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */ + /* we leave bfReserved1 & bfReserved2 = 0 */ + PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */ + + /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */ + PUT_2B(bmpinfoheader, 0, 40); /* biSize */ + PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */ + PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */ + PUT_2B(bmpinfoheader, 12, 1); /* biPlanes - must be 1 */ + PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */ + /* we leave biCompression = 0, for none */ + /* we leave biSizeImage = 0; this is correct for uncompressed data */ + if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */ + PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */ + PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */ + } + PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */ + /* we leave biClrImportant = 0 */ + + if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14) + ERREXIT(cinfo, JERR_FILE_WRITE); + if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40) + ERREXIT(cinfo, JERR_FILE_WRITE); + + if (cmap_entries > 0) + write_colormap(cinfo, dest, cmap_entries, 4); +} + + +LOCAL(void) +write_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest) +/* Write an OS2-style BMP file header, including colormap if needed */ +{ + char bmpfileheader[14]; + char bmpcoreheader[12]; + INT32 headersize, bfSize; + int bits_per_pixel, cmap_entries; + + /* Compute colormap size and total file size */ + if (cinfo->out_color_space == JCS_RGB) { + if (cinfo->quantize_colors) { + /* Colormapped RGB */ + bits_per_pixel = 8; + cmap_entries = 256; + } else { + /* Unquantized, full color RGB */ + bits_per_pixel = 24; + cmap_entries = 0; + } + } else { + /* Grayscale output. We need to fake a 256-entry colormap. */ + bits_per_pixel = 8; + cmap_entries = 256; + } + /* File size */ + headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */ + bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height; + + /* Set unused fields of header to 0 */ + MEMZERO(bmpfileheader, SIZEOF(bmpfileheader)); + MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader)); + + /* Fill the file header */ + bmpfileheader[0] = 0x42; /* first 2 bytes are ASCII 'B', 'M' */ + bmpfileheader[1] = 0x4D; + PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */ + /* we leave bfReserved1 & bfReserved2 = 0 */ + PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */ + + /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */ + PUT_2B(bmpcoreheader, 0, 12); /* bcSize */ + PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */ + PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */ + PUT_2B(bmpcoreheader, 8, 1); /* bcPlanes - must be 1 */ + PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */ + + if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14) + ERREXIT(cinfo, JERR_FILE_WRITE); + if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12) + ERREXIT(cinfo, JERR_FILE_WRITE); + + if (cmap_entries > 0) + write_colormap(cinfo, dest, cmap_entries, 3); +} + + +/* + * Write the colormap. + * Windows uses BGR0 map entries; OS/2 uses BGR entries. + */ + +LOCAL(void) +write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest, + int map_colors, int map_entry_size) +{ + JSAMPARRAY colormap = cinfo->colormap; + int num_colors = cinfo->actual_number_of_colors; + FILE * outfile = dest->pub.output_file; + int i; + + if (colormap != NULL) { + if (cinfo->out_color_components == 3) { + /* Normal case with RGB colormap */ + for (i = 0; i < num_colors; i++) { + putc(GETJSAMPLE(colormap[2][i]), outfile); + putc(GETJSAMPLE(colormap[1][i]), outfile); + putc(GETJSAMPLE(colormap[0][i]), outfile); + if (map_entry_size == 4) + putc(0, outfile); + } + } else { + /* Grayscale colormap (only happens with grayscale quantization) */ + for (i = 0; i < num_colors; i++) { + putc(GETJSAMPLE(colormap[0][i]), outfile); + putc(GETJSAMPLE(colormap[0][i]), outfile); + putc(GETJSAMPLE(colormap[0][i]), outfile); + if (map_entry_size == 4) + putc(0, outfile); + } + } + } else { + /* If no colormap, must be grayscale data. Generate a linear "map". */ + for (i = 0; i < 256; i++) { + putc(i, outfile); + putc(i, outfile); + putc(i, outfile); + if (map_entry_size == 4) + putc(0, outfile); + } + } + /* Pad colormap with zeros to ensure specified number of colormap entries */ + if (i > map_colors) + ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i); + for (; i < map_colors; i++) { + putc(0, outfile); + putc(0, outfile); + putc(0, outfile); + if (map_entry_size == 4) + putc(0, outfile); + } +} + + +METHODDEF(void) +finish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + bmp_dest_ptr dest = (bmp_dest_ptr) dinfo; + register FILE * outfile = dest->pub.output_file; + JSAMPARRAY image_ptr; + register JSAMPROW data_ptr; + JDIMENSION row; + register JDIMENSION col; + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + + /* Write the header and colormap */ + if (dest->is_os2) + write_os2_header(cinfo, dest); + else + write_bmp_header(cinfo, dest); + + /* Write the file body from our virtual array */ + for (row = cinfo->output_height; row > 0; row--) { + if (progress != NULL) { + progress->pub.pass_counter = (long) (cinfo->output_height - row); + progress->pub.pass_limit = (long) cinfo->output_height; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } + image_ptr = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE); + data_ptr = image_ptr[0]; + for (col = dest->row_width; col > 0; col--) { + putc(GETJSAMPLE(*data_ptr), outfile); + data_ptr++; + } + } + if (progress != NULL) + progress->completed_extra_passes++; + + /* Make sure we wrote the output file OK */ + fflush(outfile); + if (ferror(outfile)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * The module selection routine for BMP format output. + */ + +GLOBAL(djpeg_dest_ptr) +jinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2) +{ + bmp_dest_ptr dest; + JDIMENSION row_width; + + /* Create module interface object, fill in method pointers */ + dest = (bmp_dest_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(bmp_dest_struct)); + dest->pub.start_output = start_output_bmp; + dest->pub.finish_output = finish_output_bmp; + dest->is_os2 = is_os2; + + if (cinfo->out_color_space == JCS_GRAYSCALE) { + dest->pub.put_pixel_rows = put_gray_rows; + } else if (cinfo->out_color_space == JCS_RGB) { + if (cinfo->quantize_colors) + dest->pub.put_pixel_rows = put_gray_rows; + else + dest->pub.put_pixel_rows = put_pixel_rows; + } else { + ERREXIT(cinfo, JERR_BMP_COLORSPACE); + } + + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfo); + + /* Determine width of rows in the BMP file (padded to 4-byte boundary). */ + row_width = cinfo->output_width * cinfo->output_components; + dest->data_width = row_width; + while ((row_width & 3) != 0) row_width++; + dest->row_width = row_width; + dest->pad_bytes = (int) (row_width - dest->data_width); + + /* Allocate space for inversion array, prepare for write pass */ + dest->whole_image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + row_width, cinfo->output_height, (JDIMENSION) 1); + dest->cur_output_row = 0; + if (cinfo->progress != NULL) { + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; + progress->total_extra_passes++; /* count file input as separate pass */ + } + + /* Create decompressor output buffer. */ + dest->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1); + dest->pub.buffer_height = 1; + + return (djpeg_dest_ptr) dest; +} + +#endif /* BMP_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/wrgif.c b/thirdparty/LibJPEG/jpeg-9/wrgif.c new file mode 100644 index 0000000..5fe8328 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrgif.c @@ -0,0 +1,399 @@ +/* + * wrgif.c + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write output images in GIF format. + * + ************************************************************************** + * NOTE: to avoid entanglements with Unisys' patent on LZW compression, * + * this code has been modified to output "uncompressed GIF" files. * + * There is no trace of the LZW algorithm in this file. * + ************************************************************************** + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume output to + * an ordinary stdio stream. + */ + +/* + * This code is loosely based on ppmtogif from the PBMPLUS distribution + * of Feb. 1991. That file contains the following copyright notice: + * Based on GIFENCODE by David Rowley . + * Lempel-Ziv compression based on "compress" by Spencer W. Thomas et al. + * Copyright (C) 1989 by Jef Poskanzer. + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation. This software is provided "as is" without express or + * implied warranty. + * + * We are also required to state that + * "The Graphics Interchange Format(c) is the Copyright property of + * CompuServe Incorporated. GIF(sm) is a Service Mark property of + * CompuServe Incorporated." + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef GIF_SUPPORTED + + +/* Private version of data destination object */ + +typedef struct { + struct djpeg_dest_struct pub; /* public fields */ + + j_decompress_ptr cinfo; /* back link saves passing separate parm */ + + /* State for packing variable-width codes into a bitstream */ + int n_bits; /* current number of bits/code */ + int maxcode; /* maximum code, given n_bits */ + INT32 cur_accum; /* holds bits not yet output */ + int cur_bits; /* # of bits in cur_accum */ + + /* State for GIF code assignment */ + int ClearCode; /* clear code (doesn't change) */ + int EOFCode; /* EOF code (ditto) */ + int code_counter; /* counts output symbols */ + + /* GIF data packet construction buffer */ + int bytesinpkt; /* # of bytes in current packet */ + char packetbuf[256]; /* workspace for accumulating packet */ + +} gif_dest_struct; + +typedef gif_dest_struct * gif_dest_ptr; + +/* Largest value that will fit in N bits */ +#define MAXCODE(n_bits) ((1 << (n_bits)) - 1) + + +/* + * Routines to package finished data bytes into GIF data blocks. + * A data block consists of a count byte (1..255) and that many data bytes. + */ + +LOCAL(void) +flush_packet (gif_dest_ptr dinfo) +/* flush any accumulated data */ +{ + if (dinfo->bytesinpkt > 0) { /* never write zero-length packet */ + dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++; + if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt) + != (size_t) dinfo->bytesinpkt) + ERREXIT(dinfo->cinfo, JERR_FILE_WRITE); + dinfo->bytesinpkt = 0; + } +} + + +/* Add a character to current packet; flush to disk if necessary */ +#define CHAR_OUT(dinfo,c) \ + { (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c); \ + if ((dinfo)->bytesinpkt >= 255) \ + flush_packet(dinfo); \ + } + + +/* Routine to convert variable-width codes into a byte stream */ + +LOCAL(void) +output (gif_dest_ptr dinfo, int code) +/* Emit a code of n_bits bits */ +/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */ +{ + dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits; + dinfo->cur_bits += dinfo->n_bits; + + while (dinfo->cur_bits >= 8) { + CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF); + dinfo->cur_accum >>= 8; + dinfo->cur_bits -= 8; + } +} + + +/* The pseudo-compression algorithm. + * + * In this module we simply output each pixel value as a separate symbol; + * thus, no compression occurs. In fact, there is expansion of one bit per + * pixel, because we use a symbol width one bit wider than the pixel width. + * + * GIF ordinarily uses variable-width symbols, and the decoder will expect + * to ratchet up the symbol width after a fixed number of symbols. + * To simplify the logic and keep the expansion penalty down, we emit a + * GIF Clear code to reset the decoder just before the width would ratchet up. + * Thus, all the symbols in the output file will have the same bit width. + * Note that emitting the Clear codes at the right times is a mere matter of + * counting output symbols and is in no way dependent on the LZW patent. + * + * With a small basic pixel width (low color count), Clear codes will be + * needed very frequently, causing the file to expand even more. So this + * simplistic approach wouldn't work too well on bilevel images, for example. + * But for output of JPEG conversions the pixel width will usually be 8 bits + * (129 to 256 colors), so the overhead added by Clear symbols is only about + * one symbol in every 256. + */ + +LOCAL(void) +compress_init (gif_dest_ptr dinfo, int i_bits) +/* Initialize pseudo-compressor */ +{ + /* init all the state variables */ + dinfo->n_bits = i_bits; + dinfo->maxcode = MAXCODE(dinfo->n_bits); + dinfo->ClearCode = (1 << (i_bits - 1)); + dinfo->EOFCode = dinfo->ClearCode + 1; + dinfo->code_counter = dinfo->ClearCode + 2; + /* init output buffering vars */ + dinfo->bytesinpkt = 0; + dinfo->cur_accum = 0; + dinfo->cur_bits = 0; + /* GIF specifies an initial Clear code */ + output(dinfo, dinfo->ClearCode); +} + + +LOCAL(void) +compress_pixel (gif_dest_ptr dinfo, int c) +/* Accept and "compress" one pixel value. + * The given value must be less than n_bits wide. + */ +{ + /* Output the given pixel value as a symbol. */ + output(dinfo, c); + /* Issue Clear codes often enough to keep the reader from ratcheting up + * its symbol size. + */ + if (dinfo->code_counter < dinfo->maxcode) { + dinfo->code_counter++; + } else { + output(dinfo, dinfo->ClearCode); + dinfo->code_counter = dinfo->ClearCode + 2; /* reset the counter */ + } +} + + +LOCAL(void) +compress_term (gif_dest_ptr dinfo) +/* Clean up at end */ +{ + /* Send an EOF code */ + output(dinfo, dinfo->EOFCode); + /* Flush the bit-packing buffer */ + if (dinfo->cur_bits > 0) { + CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF); + } + /* Flush the packet buffer */ + flush_packet(dinfo); +} + + +/* GIF header construction */ + + +LOCAL(void) +put_word (gif_dest_ptr dinfo, unsigned int w) +/* Emit a 16-bit word, LSB first */ +{ + putc(w & 0xFF, dinfo->pub.output_file); + putc((w >> 8) & 0xFF, dinfo->pub.output_file); +} + + +LOCAL(void) +put_3bytes (gif_dest_ptr dinfo, int val) +/* Emit 3 copies of same byte value --- handy subr for colormap construction */ +{ + putc(val, dinfo->pub.output_file); + putc(val, dinfo->pub.output_file); + putc(val, dinfo->pub.output_file); +} + + +LOCAL(void) +emit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap) +/* Output the GIF file header, including color map */ +/* If colormap==NULL, synthesize a gray-scale colormap */ +{ + int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte; + int cshift = dinfo->cinfo->data_precision - 8; + int i; + + if (num_colors > 256) + ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors); + /* Compute bits/pixel and related values */ + BitsPerPixel = 1; + while (num_colors > (1 << BitsPerPixel)) + BitsPerPixel++; + ColorMapSize = 1 << BitsPerPixel; + if (BitsPerPixel <= 1) + InitCodeSize = 2; + else + InitCodeSize = BitsPerPixel; + /* + * Write the GIF header. + * Note that we generate a plain GIF87 header for maximum compatibility. + */ + putc('G', dinfo->pub.output_file); + putc('I', dinfo->pub.output_file); + putc('F', dinfo->pub.output_file); + putc('8', dinfo->pub.output_file); + putc('7', dinfo->pub.output_file); + putc('a', dinfo->pub.output_file); + /* Write the Logical Screen Descriptor */ + put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); + put_word(dinfo, (unsigned int) dinfo->cinfo->output_height); + FlagByte = 0x80; /* Yes, there is a global color table */ + FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */ + FlagByte |= (BitsPerPixel-1); /* size of global color table */ + putc(FlagByte, dinfo->pub.output_file); + putc(0, dinfo->pub.output_file); /* Background color index */ + putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */ + /* Write the Global Color Map */ + /* If the color map is more than 8 bits precision, */ + /* we reduce it to 8 bits by shifting */ + for (i=0; i < ColorMapSize; i++) { + if (i < num_colors) { + if (colormap != NULL) { + if (dinfo->cinfo->out_color_space == JCS_RGB) { + /* Normal case: RGB color map */ + putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file); + putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file); + putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file); + } else { + /* Grayscale "color map": possible if quantizing grayscale image */ + put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift); + } + } else { + /* Create a gray-scale map of num_colors values, range 0..255 */ + put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1)); + } + } else { + /* fill out the map to a power of 2 */ + put_3bytes(dinfo, 0); + } + } + /* Write image separator and Image Descriptor */ + putc(',', dinfo->pub.output_file); /* separator */ + put_word(dinfo, 0); /* left/top offset */ + put_word(dinfo, 0); + put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */ + put_word(dinfo, (unsigned int) dinfo->cinfo->output_height); + /* flag byte: not interlaced, no local color map */ + putc(0x00, dinfo->pub.output_file); + /* Write Initial Code Size byte */ + putc(InitCodeSize, dinfo->pub.output_file); + + /* Initialize for "compression" of image data */ + compress_init(dinfo, InitCodeSize+1); +} + + +/* + * Startup: write the file header. + */ + +METHODDEF(void) +start_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + gif_dest_ptr dest = (gif_dest_ptr) dinfo; + + if (cinfo->quantize_colors) + emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap); + else + emit_header(dest, 256, (JSAMPARRAY) NULL); +} + + +/* + * Write some pixel data. + * In this module rows_supplied will always be 1. + */ + +METHODDEF(void) +put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + gif_dest_ptr dest = (gif_dest_ptr) dinfo; + register JSAMPROW ptr; + register JDIMENSION col; + + ptr = dest->pub.buffer[0]; + for (col = cinfo->output_width; col > 0; col--) { + compress_pixel(dest, GETJSAMPLE(*ptr++)); + } +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + gif_dest_ptr dest = (gif_dest_ptr) dinfo; + + /* Flush "compression" mechanism */ + compress_term(dest); + /* Write a zero-length data block to end the series */ + putc(0, dest->pub.output_file); + /* Write the GIF terminator mark */ + putc(';', dest->pub.output_file); + /* Make sure we wrote the output file OK */ + fflush(dest->pub.output_file); + if (ferror(dest->pub.output_file)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * The module selection routine for GIF format output. + */ + +GLOBAL(djpeg_dest_ptr) +jinit_write_gif (j_decompress_ptr cinfo) +{ + gif_dest_ptr dest; + + /* Create module interface object, fill in method pointers */ + dest = (gif_dest_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(gif_dest_struct)); + dest->cinfo = cinfo; /* make back link for subroutines */ + dest->pub.start_output = start_output_gif; + dest->pub.put_pixel_rows = put_pixel_rows; + dest->pub.finish_output = finish_output_gif; + + if (cinfo->out_color_space != JCS_GRAYSCALE && + cinfo->out_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_GIF_COLORSPACE); + + /* Force quantization if color or if > 8 bits input */ + if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) { + /* Force quantization to at most 256 colors */ + cinfo->quantize_colors = TRUE; + if (cinfo->desired_number_of_colors > 256) + cinfo->desired_number_of_colors = 256; + } + + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfo); + + if (cinfo->output_components != 1) /* safety check: just one component? */ + ERREXIT(cinfo, JERR_GIF_BUG); + + /* Create decompressor output buffer. */ + dest->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1); + dest->pub.buffer_height = 1; + + return (djpeg_dest_ptr) dest; +} + +#endif /* GIF_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/wrjpgcom.1 b/thirdparty/LibJPEG/jpeg-9/wrjpgcom.1 new file mode 100644 index 0000000..d419a99 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrjpgcom.1 @@ -0,0 +1,103 @@ +.TH WRJPGCOM 1 "15 June 1995" +.SH NAME +wrjpgcom \- insert text comments into a JPEG file +.SH SYNOPSIS +.B wrjpgcom +[ +.B \-replace +] +[ +.BI \-comment " text" +] +[ +.BI \-cfile " name" +] +[ +.I filename +] +.LP +.SH DESCRIPTION +.LP +.B wrjpgcom +reads the named JPEG/JFIF file, or the standard input if no file is named, +and generates a new JPEG/JFIF file on standard output. A comment block is +added to the file. +.PP +The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. +Although the standard doesn't actually define what COM blocks are for, they +are widely used to hold user-supplied text strings. This lets you add +annotations, titles, index terms, etc to your JPEG files, and later retrieve +them as text. COM blocks do not interfere with the image stored in the JPEG +file. The maximum size of a COM block is 64K, but you can have as many of +them as you like in one JPEG file. +.PP +.B wrjpgcom +adds a COM block, containing text you provide, to a JPEG file. +Ordinarily, the COM block is added after any existing COM blocks; but you +can delete the old COM blocks if you wish. +.SH OPTIONS +Switch names may be abbreviated, and are not case sensitive. +.TP +.B \-replace +Delete any existing COM blocks from the file. +.TP +.BI \-comment " text" +Supply text for new COM block on command line. +.TP +.BI \-cfile " name" +Read text for new COM block from named file. +.PP +If you have only one line of comment text to add, you can provide it on the +command line with +.BR \-comment . +The comment text must be surrounded with quotes so that it is treated as a +single argument. Longer comments can be read from a text file. +.PP +If you give neither +.B \-comment +nor +.BR \-cfile , +then +.B wrjpgcom +will read the comment text from standard input. (In this case an input image +file name MUST be supplied, so that the source JPEG file comes from somewhere +else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file +indicator (usually control-D) to terminate the comment text entry. +.PP +.B wrjpgcom +will not add a COM block if the provided comment string is empty. Therefore +\fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file. +.SH EXAMPLES +.LP +Add a short comment to in.jpg, producing out.jpg: +.IP +.B wrjpgcom \-c +\fI"View of my back yard" in.jpg +.B > +.I out.jpg +.PP +Attach a long comment previously stored in comment.txt: +.IP +.B wrjpgcom +.I in.jpg +.B < +.I comment.txt +.B > +.I out.jpg +.PP +or equivalently +.IP +.B wrjpgcom +.B -cfile +.I comment.txt +.B < +.I in.jpg +.B > +.I out.jpg +.SH SEE ALSO +.BR cjpeg (1), +.BR djpeg (1), +.BR jpegtran (1), +.BR rdjpgcom (1) +.SH AUTHOR +Independent JPEG Group diff --git a/thirdparty/LibJPEG/jpeg-9/wrjpgcom.c b/thirdparty/LibJPEG/jpeg-9/wrjpgcom.c new file mode 100644 index 0000000..8c04b05 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrjpgcom.c @@ -0,0 +1,583 @@ +/* + * wrjpgcom.c + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains a very simple stand-alone application that inserts + * user-supplied text as a COM (comment) marker in a JFIF file. + * This may be useful as an example of the minimum logic needed to parse + * JPEG markers. + */ + +#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ +#include "jinclude.h" /* get auto-config symbols, */ + +#ifndef HAVE_STDLIB_H /* should declare malloc() */ +extern void * malloc (); +#endif +#include /* to declare isupper(), tolower() */ +#ifdef USE_SETMODE +#include /* to declare setmode()'s parameter macros */ +/* If you have setmode() but not , just delete this line: */ +#include /* to declare setmode() */ +#endif + +#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ +#ifdef __MWERKS__ +#include /* Metrowerks needs this */ +#include /* ... and this */ +#endif +#ifdef THINK_C +#include /* Think declares it here */ +#endif +#endif + +#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ +#define READ_BINARY "r" +#define WRITE_BINARY "w" +#else +#ifdef VMS /* VMS is very nonstandard */ +#define READ_BINARY "rb", "ctx=stm" +#define WRITE_BINARY "wb", "ctx=stm" +#else /* standard ANSI-compliant case */ +#define READ_BINARY "rb" +#define WRITE_BINARY "wb" +#endif +#endif + +#ifndef EXIT_FAILURE /* define exit() codes if not provided */ +#define EXIT_FAILURE 1 +#endif +#ifndef EXIT_SUCCESS +#ifdef VMS +#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ +#else +#define EXIT_SUCCESS 0 +#endif +#endif + +/* Reduce this value if your malloc() can't allocate blocks up to 64K. + * On DOS, compiling in large model is usually a better solution. + */ + +#ifndef MAX_COM_LENGTH +#define MAX_COM_LENGTH 65000L /* must be <= 65533 in any case */ +#endif + + +/* + * These macros are used to read the input file and write the output file. + * To reuse this code in another application, you might need to change these. + */ + +static FILE * infile; /* input JPEG file */ + +/* Return next input byte, or EOF if no more */ +#define NEXTBYTE() getc(infile) + +static FILE * outfile; /* output JPEG file */ + +/* Emit an output byte */ +#define PUTBYTE(x) putc((x), outfile) + + +/* Error exit handler */ +#define ERREXIT(msg) (fprintf(stderr, "%s\n", msg), exit(EXIT_FAILURE)) + + +/* Read one byte, testing for EOF */ +static int +read_1_byte (void) +{ + int c; + + c = NEXTBYTE(); + if (c == EOF) + ERREXIT("Premature EOF in JPEG file"); + return c; +} + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in JPEG markers are MSB first */ +static unsigned int +read_2_bytes (void) +{ + int c1, c2; + + c1 = NEXTBYTE(); + if (c1 == EOF) + ERREXIT("Premature EOF in JPEG file"); + c2 = NEXTBYTE(); + if (c2 == EOF) + ERREXIT("Premature EOF in JPEG file"); + return (((unsigned int) c1) << 8) + ((unsigned int) c2); +} + + +/* Routines to write data to output file */ + +static void +write_1_byte (int c) +{ + PUTBYTE(c); +} + +static void +write_2_bytes (unsigned int val) +{ + PUTBYTE((val >> 8) & 0xFF); + PUTBYTE(val & 0xFF); +} + +static void +write_marker (int marker) +{ + PUTBYTE(0xFF); + PUTBYTE(marker); +} + +static void +copy_rest_of_file (void) +{ + int c; + + while ((c = NEXTBYTE()) != EOF) + PUTBYTE(c); +} + + +/* + * JPEG markers consist of one or more 0xFF bytes, followed by a marker + * code byte (which is not an FF). Here are the marker codes of interest + * in this program. (See jdmarker.c for a more complete list.) + */ + +#define M_SOF0 0xC0 /* Start Of Frame N */ +#define M_SOF1 0xC1 /* N indicates which compression process */ +#define M_SOF2 0xC2 /* Only SOF0-SOF2 are now in common use */ +#define M_SOF3 0xC3 +#define M_SOF5 0xC5 /* NB: codes C4 and CC are NOT SOF markers */ +#define M_SOF6 0xC6 +#define M_SOF7 0xC7 +#define M_SOF9 0xC9 +#define M_SOF10 0xCA +#define M_SOF11 0xCB +#define M_SOF13 0xCD +#define M_SOF14 0xCE +#define M_SOF15 0xCF +#define M_SOI 0xD8 /* Start Of Image (beginning of datastream) */ +#define M_EOI 0xD9 /* End Of Image (end of datastream) */ +#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */ +#define M_COM 0xFE /* COMment */ + + +/* + * Find the next JPEG marker and return its marker code. + * We expect at least one FF byte, possibly more if the compressor used FFs + * to pad the file. (Padding FFs will NOT be replicated in the output file.) + * There could also be non-FF garbage between markers. The treatment of such + * garbage is unspecified; we choose to skip over it but emit a warning msg. + * NB: this routine must not be used after seeing SOS marker, since it will + * not deal correctly with FF/00 sequences in the compressed image data... + */ + +static int +next_marker (void) +{ + int c; + int discarded_bytes = 0; + + /* Find 0xFF byte; count and skip any non-FFs. */ + c = read_1_byte(); + while (c != 0xFF) { + discarded_bytes++; + c = read_1_byte(); + } + /* Get marker code byte, swallowing any duplicate FF bytes. Extra FFs + * are legal as pad bytes, so don't count them in discarded_bytes. + */ + do { + c = read_1_byte(); + } while (c == 0xFF); + + if (discarded_bytes != 0) { + fprintf(stderr, "Warning: garbage data found in JPEG file\n"); + } + + return c; +} + + +/* + * Read the initial marker, which should be SOI. + * For a JFIF file, the first two bytes of the file should be literally + * 0xFF M_SOI. To be more general, we could use next_marker, but if the + * input file weren't actually JPEG at all, next_marker might read the whole + * file and then return a misleading error message... + */ + +static int +first_marker (void) +{ + int c1, c2; + + c1 = NEXTBYTE(); + c2 = NEXTBYTE(); + if (c1 != 0xFF || c2 != M_SOI) + ERREXIT("Not a JPEG file"); + return c2; +} + + +/* + * Most types of marker are followed by a variable-length parameter segment. + * This routine skips over the parameters for any marker we don't otherwise + * want to process. + * Note that we MUST skip the parameter segment explicitly in order not to + * be fooled by 0xFF bytes that might appear within the parameter segment; + * such bytes do NOT introduce new markers. + */ + +static void +copy_variable (void) +/* Copy an unknown or uninteresting variable-length marker */ +{ + unsigned int length; + + /* Get the marker parameter length count */ + length = read_2_bytes(); + write_2_bytes(length); + /* Length includes itself, so must be at least 2 */ + if (length < 2) + ERREXIT("Erroneous JPEG marker length"); + length -= 2; + /* Skip over the remaining bytes */ + while (length > 0) { + write_1_byte(read_1_byte()); + length--; + } +} + +static void +skip_variable (void) +/* Skip over an unknown or uninteresting variable-length marker */ +{ + unsigned int length; + + /* Get the marker parameter length count */ + length = read_2_bytes(); + /* Length includes itself, so must be at least 2 */ + if (length < 2) + ERREXIT("Erroneous JPEG marker length"); + length -= 2; + /* Skip over the remaining bytes */ + while (length > 0) { + (void) read_1_byte(); + length--; + } +} + + +/* + * Parse the marker stream until SOFn or EOI is seen; + * copy data to output, but discard COM markers unless keep_COM is true. + */ + +static int +scan_JPEG_header (int keep_COM) +{ + int marker; + + /* Expect SOI at start of file */ + if (first_marker() != M_SOI) + ERREXIT("Expected SOI marker first"); + write_marker(M_SOI); + + /* Scan miscellaneous markers until we reach SOFn. */ + for (;;) { + marker = next_marker(); + switch (marker) { + /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be, + * treated as SOFn. C4 in particular is actually DHT. + */ + case M_SOF0: /* Baseline */ + case M_SOF1: /* Extended sequential, Huffman */ + case M_SOF2: /* Progressive, Huffman */ + case M_SOF3: /* Lossless, Huffman */ + case M_SOF5: /* Differential sequential, Huffman */ + case M_SOF6: /* Differential progressive, Huffman */ + case M_SOF7: /* Differential lossless, Huffman */ + case M_SOF9: /* Extended sequential, arithmetic */ + case M_SOF10: /* Progressive, arithmetic */ + case M_SOF11: /* Lossless, arithmetic */ + case M_SOF13: /* Differential sequential, arithmetic */ + case M_SOF14: /* Differential progressive, arithmetic */ + case M_SOF15: /* Differential lossless, arithmetic */ + return marker; + + case M_SOS: /* should not see compressed data before SOF */ + ERREXIT("SOS without prior SOFn"); + break; + + case M_EOI: /* in case it's a tables-only JPEG stream */ + return marker; + + case M_COM: /* Existing COM: conditionally discard */ + if (keep_COM) { + write_marker(marker); + copy_variable(); + } else { + skip_variable(); + } + break; + + default: /* Anything else just gets copied */ + write_marker(marker); + copy_variable(); /* we assume it has a parameter count... */ + break; + } + } /* end loop */ +} + + +/* Command line parsing code */ + +static const char * progname; /* program name for error messages */ + + +static void +usage (void) +/* complain about bad command line */ +{ + fprintf(stderr, "wrjpgcom inserts a textual comment in a JPEG file.\n"); + fprintf(stderr, "You can add to or replace any existing comment(s).\n"); + + fprintf(stderr, "Usage: %s [switches] ", progname); +#ifdef TWO_FILE_COMMANDLINE + fprintf(stderr, "inputfile outputfile\n"); +#else + fprintf(stderr, "[inputfile]\n"); +#endif + + fprintf(stderr, "Switches (names may be abbreviated):\n"); + fprintf(stderr, " -replace Delete any existing comments\n"); + fprintf(stderr, " -comment \"text\" Insert comment with given text\n"); + fprintf(stderr, " -cfile name Read comment from named file\n"); + fprintf(stderr, "Notice that you must put quotes around the comment text\n"); + fprintf(stderr, "when you use -comment.\n"); + fprintf(stderr, "If you do not give either -comment or -cfile on the command line,\n"); + fprintf(stderr, "then the comment text is read from standard input.\n"); + fprintf(stderr, "It can be multiple lines, up to %u characters total.\n", + (unsigned int) MAX_COM_LENGTH); +#ifndef TWO_FILE_COMMANDLINE + fprintf(stderr, "You must specify an input JPEG file name when supplying\n"); + fprintf(stderr, "comment text from standard input.\n"); +#endif + + exit(EXIT_FAILURE); +} + + +static int +keymatch (char * arg, const char * keyword, int minchars) +/* Case-insensitive matching of (possibly abbreviated) keyword switches. */ +/* keyword is the constant keyword (must be lower case already), */ +/* minchars is length of minimum legal abbreviation. */ +{ + register int ca, ck; + register int nmatched = 0; + + while ((ca = *arg++) != '\0') { + if ((ck = *keyword++) == '\0') + return 0; /* arg longer than keyword, no good */ + if (isupper(ca)) /* force arg to lcase (assume ck is already) */ + ca = tolower(ca); + if (ca != ck) + return 0; /* no good */ + nmatched++; /* count matched characters */ + } + /* reached end of argument; fail if it's too short for unique abbrev */ + if (nmatched < minchars) + return 0; + return 1; /* A-OK */ +} + + +/* + * The main program. + */ + +int +main (int argc, char **argv) +{ + int argn; + char * arg; + int keep_COM = 1; + char * comment_arg = NULL; + FILE * comment_file = NULL; + unsigned int comment_length = 0; + int marker; + + /* On Mac, fetch a command line. */ +#ifdef USE_CCOMMAND + argc = ccommand(&argv); +#endif + + progname = argv[0]; + if (progname == NULL || progname[0] == 0) + progname = "wrjpgcom"; /* in case C library doesn't provide it */ + + /* Parse switches, if any */ + for (argn = 1; argn < argc; argn++) { + arg = argv[argn]; + if (arg[0] != '-') + break; /* not switch, must be file name */ + arg++; /* advance over '-' */ + if (keymatch(arg, "replace", 1)) { + keep_COM = 0; + } else if (keymatch(arg, "cfile", 2)) { + if (++argn >= argc) usage(); + if ((comment_file = fopen(argv[argn], "r")) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); + exit(EXIT_FAILURE); + } + } else if (keymatch(arg, "comment", 1)) { + if (++argn >= argc) usage(); + comment_arg = argv[argn]; + /* If the comment text starts with '"', then we are probably running + * under MS-DOG and must parse out the quoted string ourselves. Sigh. + */ + if (comment_arg[0] == '"') { + comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH); + if (comment_arg == NULL) + ERREXIT("Insufficient memory"); + strcpy(comment_arg, argv[argn]+1); + for (;;) { + comment_length = (unsigned int) strlen(comment_arg); + if (comment_length > 0 && comment_arg[comment_length-1] == '"') { + comment_arg[comment_length-1] = '\0'; /* zap terminating quote */ + break; + } + if (++argn >= argc) + ERREXIT("Missing ending quote mark"); + strcat(comment_arg, " "); + strcat(comment_arg, argv[argn]); + } + } + comment_length = (unsigned int) strlen(comment_arg); + } else + usage(); + } + + /* Cannot use both -comment and -cfile. */ + if (comment_arg != NULL && comment_file != NULL) + usage(); + /* If there is neither -comment nor -cfile, we will read the comment text + * from stdin; in this case there MUST be an input JPEG file name. + */ + if (comment_arg == NULL && comment_file == NULL && argn >= argc) + usage(); + + /* Open the input file. */ + if (argn < argc) { + if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]); + exit(EXIT_FAILURE); + } + } else { + /* default input file is stdin */ +#ifdef USE_SETMODE /* need to hack file mode? */ + setmode(fileno(stdin), O_BINARY); +#endif +#ifdef USE_FDOPEN /* need to re-open in binary mode? */ + if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open stdin\n", progname); + exit(EXIT_FAILURE); + } +#else + infile = stdin; +#endif + } + + /* Open the output file. */ +#ifdef TWO_FILE_COMMANDLINE + /* Must have explicit output file name */ + if (argn != argc-2) { + fprintf(stderr, "%s: must name one input and one output file\n", + progname); + usage(); + } + if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open %s\n", progname, argv[argn+1]); + exit(EXIT_FAILURE); + } +#else + /* Unix style: expect zero or one file name */ + if (argn < argc-1) { + fprintf(stderr, "%s: only one input file\n", progname); + usage(); + } + /* default output file is stdout */ +#ifdef USE_SETMODE /* need to hack file mode? */ + setmode(fileno(stdout), O_BINARY); +#endif +#ifdef USE_FDOPEN /* need to re-open in binary mode? */ + if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) { + fprintf(stderr, "%s: can't open stdout\n", progname); + exit(EXIT_FAILURE); + } +#else + outfile = stdout; +#endif +#endif /* TWO_FILE_COMMANDLINE */ + + /* Collect comment text from comment_file or stdin, if necessary */ + if (comment_arg == NULL) { + FILE * src_file; + int c; + + comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH); + if (comment_arg == NULL) + ERREXIT("Insufficient memory"); + comment_length = 0; + src_file = (comment_file != NULL ? comment_file : stdin); + while ((c = getc(src_file)) != EOF) { + if (comment_length >= (unsigned int) MAX_COM_LENGTH) { + fprintf(stderr, "Comment text may not exceed %u bytes\n", + (unsigned int) MAX_COM_LENGTH); + exit(EXIT_FAILURE); + } + comment_arg[comment_length++] = (char) c; + } + if (comment_file != NULL) + fclose(comment_file); + } + + /* Copy JPEG headers until SOFn marker; + * we will insert the new comment marker just before SOFn. + * This (a) causes the new comment to appear after, rather than before, + * existing comments; and (b) ensures that comments come after any JFIF + * or JFXX markers, as required by the JFIF specification. + */ + marker = scan_JPEG_header(keep_COM); + /* Insert the new COM marker, but only if nonempty text has been supplied */ + if (comment_length > 0) { + write_marker(M_COM); + write_2_bytes(comment_length + 2); + while (comment_length > 0) { + write_1_byte(*comment_arg++); + comment_length--; + } + } + /* Duplicate the remainder of the source file. + * Note that any COM markers occuring after SOF will not be touched. + */ + write_marker(marker); + copy_rest_of_file(); + + /* All done. */ + exit(EXIT_SUCCESS); + return 0; /* suppress no-return-value warnings */ +} diff --git a/thirdparty/LibJPEG/jpeg-9/wrppm.c b/thirdparty/LibJPEG/jpeg-9/wrppm.c new file mode 100644 index 0000000..68e0c85 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrppm.c @@ -0,0 +1,269 @@ +/* + * wrppm.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * Modified 2009 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write output images in PPM/PGM format. + * The extended 2-byte-per-sample raw PPM/PGM formats are supported. + * The PBMPLUS library is NOT required to compile this software + * (but it is highly useful as a set of PPM image manipulation programs). + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume output to + * an ordinary stdio stream. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef PPM_SUPPORTED + + +/* + * For 12-bit JPEG data, we either downscale the values to 8 bits + * (to write standard byte-per-sample PPM/PGM files), or output + * nonstandard word-per-sample PPM/PGM files. Downscaling is done + * if PPM_NORAWWORD is defined (this can be done in the Makefile + * or in jconfig.h). + * (When the core library supports data precision reduction, a cleaner + * implementation will be to ask for that instead.) + */ + +#if BITS_IN_JSAMPLE == 8 +#define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) (v) +#define BYTESPERSAMPLE 1 +#define PPM_MAXVAL 255 +#else +#ifdef PPM_NORAWWORD +#define PUTPPMSAMPLE(ptr,v) *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8)) +#define BYTESPERSAMPLE 1 +#define PPM_MAXVAL 255 +#else +/* The word-per-sample format always puts the MSB first. */ +#define PUTPPMSAMPLE(ptr,v) \ + { register int val_ = v; \ + *ptr++ = (char) ((val_ >> 8) & 0xFF); \ + *ptr++ = (char) (val_ & 0xFF); \ + } +#define BYTESPERSAMPLE 2 +#define PPM_MAXVAL ((1<pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +/* + * This code is used when we have to copy the data and apply a pixel + * format translation. Typically this only happens in 12-bit mode. + */ + +METHODDEF(void) +copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; + register char * bufferptr; + register JSAMPROW ptr; + register JDIMENSION col; + + ptr = dest->pub.buffer[0]; + bufferptr = dest->iobuffer; + for (col = dest->samples_per_row; col > 0; col--) { + PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++)); + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +/* + * Write some pixel data when color quantization is in effect. + * We have to demap the color index values to straight data. + */ + +METHODDEF(void) +put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; + register char * bufferptr; + register int pixval; + register JSAMPROW ptr; + register JSAMPROW color_map0 = cinfo->colormap[0]; + register JSAMPROW color_map1 = cinfo->colormap[1]; + register JSAMPROW color_map2 = cinfo->colormap[2]; + register JDIMENSION col; + + ptr = dest->pub.buffer[0]; + bufferptr = dest->iobuffer; + for (col = cinfo->output_width; col > 0; col--) { + pixval = GETJSAMPLE(*ptr++); + PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval])); + PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval])); + PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval])); + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +METHODDEF(void) +put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; + register char * bufferptr; + register JSAMPROW ptr; + register JSAMPROW color_map = cinfo->colormap[0]; + register JDIMENSION col; + + ptr = dest->pub.buffer[0]; + bufferptr = dest->iobuffer; + for (col = cinfo->output_width; col > 0; col--) { + PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)])); + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +/* + * Startup: write the file header. + */ + +METHODDEF(void) +start_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + ppm_dest_ptr dest = (ppm_dest_ptr) dinfo; + + /* Emit file header */ + switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + /* emit header for raw PGM format */ + fprintf(dest->pub.output_file, "P5\n%ld %ld\n%d\n", + (long) cinfo->output_width, (long) cinfo->output_height, + PPM_MAXVAL); + break; + case JCS_RGB: + /* emit header for raw PPM format */ + fprintf(dest->pub.output_file, "P6\n%ld %ld\n%d\n", + (long) cinfo->output_width, (long) cinfo->output_height, + PPM_MAXVAL); + break; + default: + ERREXIT(cinfo, JERR_PPM_COLORSPACE); + } +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + /* Make sure we wrote the output file OK */ + fflush(dinfo->output_file); + if (ferror(dinfo->output_file)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * The module selection routine for PPM format output. + */ + +GLOBAL(djpeg_dest_ptr) +jinit_write_ppm (j_decompress_ptr cinfo) +{ + ppm_dest_ptr dest; + + /* Create module interface object, fill in method pointers */ + dest = (ppm_dest_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(ppm_dest_struct)); + dest->pub.start_output = start_output_ppm; + dest->pub.finish_output = finish_output_ppm; + + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfo); + + /* Create physical I/O buffer. Note we make this near on a PC. */ + dest->samples_per_row = cinfo->output_width * cinfo->out_color_components; + dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF(char)); + dest->iobuffer = (char *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width); + + if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 || + SIZEOF(JSAMPLE) != SIZEOF(char)) { + /* When quantizing, we need an output buffer for colormap indexes + * that's separate from the physical I/O buffer. We also need a + * separate buffer if pixel format translation must take place. + */ + dest->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * cinfo->output_components, (JDIMENSION) 1); + dest->pub.buffer_height = 1; + if (! cinfo->quantize_colors) + dest->pub.put_pixel_rows = copy_pixel_rows; + else if (cinfo->out_color_space == JCS_GRAYSCALE) + dest->pub.put_pixel_rows = put_demapped_gray; + else + dest->pub.put_pixel_rows = put_demapped_rgb; + } else { + /* We will fwrite() directly from decompressor output buffer. */ + /* Synthesize a JSAMPARRAY pointer structure */ + /* Cast here implies near->far pointer conversion on PCs */ + dest->pixrow = (JSAMPROW) dest->iobuffer; + dest->pub.buffer = & dest->pixrow; + dest->pub.buffer_height = 1; + dest->pub.put_pixel_rows = put_pixel_rows; + } + + return (djpeg_dest_ptr) dest; +} + +#endif /* PPM_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/wrrle.c b/thirdparty/LibJPEG/jpeg-9/wrrle.c new file mode 100644 index 0000000..a4e7337 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrrle.c @@ -0,0 +1,305 @@ +/* + * wrrle.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write output images in RLE format. + * The Utah Raster Toolkit library is required (version 3.1 or later). + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume output to + * an ordinary stdio stream. + * + * Based on code contributed by Mike Lijewski, + * with updates from Robert Hutchinson. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef RLE_SUPPORTED + +/* rle.h is provided by the Utah Raster Toolkit. */ + +#include + +/* + * We assume that JSAMPLE has the same representation as rle_pixel, + * to wit, "unsigned char". Hence we can't cope with 12- or 16-bit samples. + */ + +#if BITS_IN_JSAMPLE != 8 + Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */ +#endif + + +/* + * Since RLE stores scanlines bottom-to-top, we have to invert the image + * from JPEG's top-to-bottom order. To do this, we save the outgoing data + * in a virtual array during put_pixel_row calls, then actually emit the + * RLE file during finish_output. + */ + + +/* + * For now, if we emit an RLE color map then it is always 256 entries long, + * though not all of the entries need be used. + */ + +#define CMAPBITS 8 +#define CMAPLENGTH (1<<(CMAPBITS)) + +typedef struct { + struct djpeg_dest_struct pub; /* public fields */ + + jvirt_sarray_ptr image; /* virtual array to store the output image */ + rle_map *colormap; /* RLE-style color map, or NULL if none */ + rle_pixel **rle_row; /* To pass rows to rle_putrow() */ + +} rle_dest_struct; + +typedef rle_dest_struct * rle_dest_ptr; + +/* Forward declarations */ +METHODDEF(void) rle_put_pixel_rows + JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied)); + + +/* + * Write the file header. + * + * In this module it's easier to wait till finish_output to write anything. + */ + +METHODDEF(void) +start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + rle_dest_ptr dest = (rle_dest_ptr) dinfo; + size_t cmapsize; + int i, ci; +#ifdef PROGRESS_REPORT + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; +#endif + + /* + * Make sure the image can be stored in RLE format. + * + * - RLE stores image dimensions as *signed* 16 bit integers. JPEG + * uses unsigned, so we have to check the width. + * + * - Colorspace is expected to be grayscale or RGB. + * + * - The number of channels (components) is expected to be 1 (grayscale/ + * pseudocolor) or 3 (truecolor/directcolor). + * (could be 2 or 4 if using an alpha channel, but we aren't) + */ + + if (cinfo->output_width > 32767 || cinfo->output_height > 32767) + ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width, + cinfo->output_height); + + if (cinfo->out_color_space != JCS_GRAYSCALE && + cinfo->out_color_space != JCS_RGB) + ERREXIT(cinfo, JERR_RLE_COLORSPACE); + + if (cinfo->output_components != 1 && cinfo->output_components != 3) + ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components); + + /* Convert colormap, if any, to RLE format. */ + + dest->colormap = NULL; + + if (cinfo->quantize_colors) { + /* Allocate storage for RLE-style cmap, zero any extra entries */ + cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map); + dest->colormap = (rle_map *) (*cinfo->mem->alloc_small) + ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize); + MEMZERO(dest->colormap, cmapsize); + + /* Save away data in RLE format --- note 8-bit left shift! */ + /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */ + for (ci = 0; ci < cinfo->out_color_components; ci++) { + for (i = 0; i < cinfo->actual_number_of_colors; i++) { + dest->colormap[ci * CMAPLENGTH + i] = + GETJSAMPLE(cinfo->colormap[ci][i]) << 8; + } + } + } + + /* Set the output buffer to the first row */ + dest->pub.buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE); + dest->pub.buffer_height = 1; + + dest->pub.put_pixel_rows = rle_put_pixel_rows; + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->total_extra_passes++; /* count file writing as separate pass */ + } +#endif +} + + +/* + * Write some pixel data. + * + * This routine just saves the data away in a virtual array. + */ + +METHODDEF(void) +rle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + rle_dest_ptr dest = (rle_dest_ptr) dinfo; + + if (cinfo->output_scanline < cinfo->output_height) { + dest->pub.buffer = (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->image, + cinfo->output_scanline, (JDIMENSION) 1, TRUE); + } +} + +/* + * Finish up at the end of the file. + * + * Here is where we really output the RLE file. + */ + +METHODDEF(void) +finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + rle_dest_ptr dest = (rle_dest_ptr) dinfo; + rle_hdr header; /* Output file information */ + rle_pixel **rle_row, *red, *green, *blue; + JSAMPROW output_row; + char cmapcomment[80]; + int row, col; + int ci; +#ifdef PROGRESS_REPORT + cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress; +#endif + + /* Initialize the header info */ + header = *rle_hdr_init(NULL); + header.rle_file = dest->pub.output_file; + header.xmin = 0; + header.xmax = cinfo->output_width - 1; + header.ymin = 0; + header.ymax = cinfo->output_height - 1; + header.alpha = 0; + header.ncolors = cinfo->output_components; + for (ci = 0; ci < cinfo->output_components; ci++) { + RLE_SET_BIT(header, ci); + } + if (cinfo->quantize_colors) { + header.ncmap = cinfo->out_color_components; + header.cmaplen = CMAPBITS; + header.cmap = dest->colormap; + /* Add a comment to the output image with the true colormap length. */ + sprintf(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors); + rle_putcom(cmapcomment, &header); + } + + /* Emit the RLE header and color map (if any) */ + rle_put_setup(&header); + + /* Now output the RLE data from our virtual array. + * We assume here that (a) rle_pixel is represented the same as JSAMPLE, + * and (b) we are not on a machine where FAR pointers differ from regular. + */ + +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_limit = cinfo->output_height; + progress->pub.pass_counter = 0; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + + if (cinfo->output_components == 1) { + for (row = cinfo->output_height-1; row >= 0; row--) { + rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->image, + (JDIMENSION) row, (JDIMENSION) 1, FALSE); + rle_putrow(rle_row, (int) cinfo->output_width, &header); +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_counter++; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + } + } else { + for (row = cinfo->output_height-1; row >= 0; row--) { + rle_row = (rle_pixel **) dest->rle_row; + output_row = * (*cinfo->mem->access_virt_sarray) + ((j_common_ptr) cinfo, dest->image, + (JDIMENSION) row, (JDIMENSION) 1, FALSE); + red = rle_row[0]; + green = rle_row[1]; + blue = rle_row[2]; + for (col = cinfo->output_width; col > 0; col--) { + *red++ = GETJSAMPLE(*output_row++); + *green++ = GETJSAMPLE(*output_row++); + *blue++ = GETJSAMPLE(*output_row++); + } + rle_putrow(rle_row, (int) cinfo->output_width, &header); +#ifdef PROGRESS_REPORT + if (progress != NULL) { + progress->pub.pass_counter++; + (*progress->pub.progress_monitor) ((j_common_ptr) cinfo); + } +#endif + } + } + +#ifdef PROGRESS_REPORT + if (progress != NULL) + progress->completed_extra_passes++; +#endif + + /* Emit file trailer */ + rle_puteof(&header); + fflush(dest->pub.output_file); + if (ferror(dest->pub.output_file)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * The module selection routine for RLE format output. + */ + +GLOBAL(djpeg_dest_ptr) +jinit_write_rle (j_decompress_ptr cinfo) +{ + rle_dest_ptr dest; + + /* Create module interface object, fill in method pointers */ + dest = (rle_dest_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(rle_dest_struct)); + dest->pub.start_output = start_output_rle; + dest->pub.finish_output = finish_output_rle; + + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfo); + + /* Allocate a work array for output to the RLE library. */ + dest->rle_row = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width, (JDIMENSION) cinfo->output_components); + + /* Allocate a virtual array to hold the image. */ + dest->image = (*cinfo->mem->request_virt_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, + (JDIMENSION) (cinfo->output_width * cinfo->output_components), + cinfo->output_height, (JDIMENSION) 1); + + return (djpeg_dest_ptr) dest; +} + +#endif /* RLE_SUPPORTED */ diff --git a/thirdparty/LibJPEG/jpeg-9/wrtarga.c b/thirdparty/LibJPEG/jpeg-9/wrtarga.c new file mode 100644 index 0000000..cf104d2 --- /dev/null +++ b/thirdparty/LibJPEG/jpeg-9/wrtarga.c @@ -0,0 +1,253 @@ +/* + * wrtarga.c + * + * Copyright (C) 1991-1996, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains routines to write output images in Targa format. + * + * These routines may need modification for non-Unix environments or + * specialized applications. As they stand, they assume output to + * an ordinary stdio stream. + * + * Based on code contributed by Lee Daniel Crocker. + */ + +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ + +#ifdef TARGA_SUPPORTED + + +/* + * To support 12-bit JPEG data, we'd have to scale output down to 8 bits. + * This is not yet implemented. + */ + +#if BITS_IN_JSAMPLE != 8 + Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */ +#endif + +/* + * The output buffer needs to be writable by fwrite(). On PCs, we must + * allocate the buffer in near data space, because we are assuming small-data + * memory model, wherein fwrite() can't reach far memory. If you need to + * process very wide images on a PC, you might have to compile in large-memory + * model, or else replace fwrite() with a putc() loop --- which will be much + * slower. + */ + + +/* Private version of data destination object */ + +typedef struct { + struct djpeg_dest_struct pub; /* public fields */ + + char *iobuffer; /* physical I/O buffer */ + JDIMENSION buffer_width; /* width of one row */ +} tga_dest_struct; + +typedef tga_dest_struct * tga_dest_ptr; + + +LOCAL(void) +write_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors) +/* Create and write a Targa header */ +{ + char targaheader[18]; + + /* Set unused fields of header to 0 */ + MEMZERO(targaheader, SIZEOF(targaheader)); + + if (num_colors > 0) { + targaheader[1] = 1; /* color map type 1 */ + targaheader[5] = (char) (num_colors & 0xFF); + targaheader[6] = (char) (num_colors >> 8); + targaheader[7] = 24; /* 24 bits per cmap entry */ + } + + targaheader[12] = (char) (cinfo->output_width & 0xFF); + targaheader[13] = (char) (cinfo->output_width >> 8); + targaheader[14] = (char) (cinfo->output_height & 0xFF); + targaheader[15] = (char) (cinfo->output_height >> 8); + targaheader[17] = 0x20; /* Top-down, non-interlaced */ + + if (cinfo->out_color_space == JCS_GRAYSCALE) { + targaheader[2] = 3; /* image type = uncompressed gray-scale */ + targaheader[16] = 8; /* bits per pixel */ + } else { /* must be RGB */ + if (num_colors > 0) { + targaheader[2] = 1; /* image type = colormapped RGB */ + targaheader[16] = 8; + } else { + targaheader[2] = 2; /* image type = uncompressed RGB */ + targaheader[16] = 24; + } + } + + if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * Write some pixel data. + * In this module rows_supplied will always be 1. + */ + +METHODDEF(void) +put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +/* used for unquantized full-color output */ +{ + tga_dest_ptr dest = (tga_dest_ptr) dinfo; + register JSAMPROW inptr; + register char * outptr; + register JDIMENSION col; + + inptr = dest->pub.buffer[0]; + outptr = dest->iobuffer; + for (col = cinfo->output_width; col > 0; col--) { + outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */ + outptr[1] = (char) GETJSAMPLE(inptr[1]); + outptr[2] = (char) GETJSAMPLE(inptr[0]); + inptr += 3, outptr += 3; + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + +METHODDEF(void) +put_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +/* used for grayscale OR quantized color output */ +{ + tga_dest_ptr dest = (tga_dest_ptr) dinfo; + register JSAMPROW inptr; + register char * outptr; + register JDIMENSION col; + + inptr = dest->pub.buffer[0]; + outptr = dest->iobuffer; + for (col = cinfo->output_width; col > 0; col--) { + *outptr++ = (char) GETJSAMPLE(*inptr++); + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +/* + * Write some demapped pixel data when color quantization is in effect. + * For Targa, this is only applied to grayscale data. + */ + +METHODDEF(void) +put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, + JDIMENSION rows_supplied) +{ + tga_dest_ptr dest = (tga_dest_ptr) dinfo; + register JSAMPROW inptr; + register char * outptr; + register JSAMPROW color_map0 = cinfo->colormap[0]; + register JDIMENSION col; + + inptr = dest->pub.buffer[0]; + outptr = dest->iobuffer; + for (col = cinfo->output_width; col > 0; col--) { + *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]); + } + (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width); +} + + +/* + * Startup: write the file header. + */ + +METHODDEF(void) +start_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + tga_dest_ptr dest = (tga_dest_ptr) dinfo; + int num_colors, i; + FILE *outfile; + + if (cinfo->out_color_space == JCS_GRAYSCALE) { + /* Targa doesn't have a mapped grayscale format, so we will */ + /* demap quantized gray output. Never emit a colormap. */ + write_header(cinfo, dinfo, 0); + if (cinfo->quantize_colors) + dest->pub.put_pixel_rows = put_demapped_gray; + else + dest->pub.put_pixel_rows = put_gray_rows; + } else if (cinfo->out_color_space == JCS_RGB) { + if (cinfo->quantize_colors) { + /* We only support 8-bit colormap indexes, so only 256 colors */ + num_colors = cinfo->actual_number_of_colors; + if (num_colors > 256) + ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors); + write_header(cinfo, dinfo, num_colors); + /* Write the colormap. Note Targa uses BGR byte order */ + outfile = dest->pub.output_file; + for (i = 0; i < num_colors; i++) { + putc(GETJSAMPLE(cinfo->colormap[2][i]), outfile); + putc(GETJSAMPLE(cinfo->colormap[1][i]), outfile); + putc(GETJSAMPLE(cinfo->colormap[0][i]), outfile); + } + dest->pub.put_pixel_rows = put_gray_rows; + } else { + write_header(cinfo, dinfo, 0); + dest->pub.put_pixel_rows = put_pixel_rows; + } + } else { + ERREXIT(cinfo, JERR_TGA_COLORSPACE); + } +} + + +/* + * Finish up at the end of the file. + */ + +METHODDEF(void) +finish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo) +{ + /* Make sure we wrote the output file OK */ + fflush(dinfo->output_file); + if (ferror(dinfo->output_file)) + ERREXIT(cinfo, JERR_FILE_WRITE); +} + + +/* + * The module selection routine for Targa format output. + */ + +GLOBAL(djpeg_dest_ptr) +jinit_write_targa (j_decompress_ptr cinfo) +{ + tga_dest_ptr dest; + + /* Create module interface object, fill in method pointers */ + dest = (tga_dest_ptr) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + SIZEOF(tga_dest_struct)); + dest->pub.start_output = start_output_tga; + dest->pub.finish_output = finish_output_tga; + + /* Calculate output image dimensions so we can allocate space */ + jpeg_calc_output_dimensions(cinfo); + + /* Create I/O buffer. Note we make this near on a PC. */ + dest->buffer_width = cinfo->output_width * cinfo->output_components; + dest->iobuffer = (char *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (size_t) (dest->buffer_width * SIZEOF(char))); + + /* Create decompressor output buffer. */ + dest->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1); + dest->pub.buffer_height = 1; + + return (djpeg_dest_ptr) dest; +} + +#endif /* TARGA_SUPPORTED */ diff --git a/thirdparty/LibTIFF/README.txt b/thirdparty/LibTIFF/README.txt new file mode 100644 index 0000000..8eac49b --- /dev/null +++ b/thirdparty/LibTIFF/README.txt @@ -0,0 +1,22 @@ + +Per compilare LibTiff, bisogna ricordarsi di: + + +1. Compilare PRIMA zlib e LibJPEG + +2. (Windows) Creare i file 'tif_config.h' e 'tiffconf.h' copiandoli dalle + rispettive versioni platform-dependent + +3. (Windows) Dentro tiffconf.h, abilitare il supporto alle compressioni JPEG e ZLIB + +4. (Windows) NON usare 'tif_win32.c'. Anche li' usa 'tif_unix.c'. + +5. Ricordarsi di inserire la funzione di API TIFFFdOpenNoCloseProc(..) + che serve a deallocare la roba allocata da LibTIFF senza chiudere + il file aperto + +6. Per essere sicuri che sia andato tutto bene, provare a visualizzare + il folder tif dentro la nostra libreria di immagini test (verify_image) + + +Daniele \ No newline at end of file diff --git a/thirdparty/LibTIFF/clean.sh b/thirdparty/LibTIFF/clean.sh new file mode 100644 index 0000000..98daa7b --- /dev/null +++ b/thirdparty/LibTIFF/clean.sh @@ -0,0 +1,17 @@ +# This script erases all intermediate and system-dependent files, while +# retaining the built library. + +# The resulting folder can be submitted to version control. + +cd tiff-4.0.3 + +make clean +rm -rf libtiff/.deps +rm -rf port/.deps +rm -rf test/.deps +rm -rf libs_i386 +rm -rf libs_x86_64 +rm -f *.a +rm -f *.dylib +rm -f libtiff/tif_config.h +rm -f libtiff/tiffconf.h diff --git a/thirdparty/LibTIFF/tiff-4.0.3/COPYRIGHT b/thirdparty/LibTIFF/tiff-4.0.3/COPYRIGHT new file mode 100644 index 0000000..8282186 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/COPYRIGHT @@ -0,0 +1,21 @@ +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/ChangeLog b/thirdparty/LibTIFF/tiff-4.0.3/ChangeLog new file mode 100644 index 0000000..a537f71 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/ChangeLog @@ -0,0 +1,5835 @@ +2012-09-22 Bob Friesenhahn + + * libtiff 4.0.3 released. + +2012-09-20 Bob Friesenhahn + + * Makefile.am: Update to Automake 1.12.4 + +2012-08-19 Bob Friesenhahn + + * Makefile.in: Update to Automake 1.12.3 + + * libtiff{tiff.h, tif_print.c, tif_dirinfo.c, tif_dirread.c}: Add + some TIFF/FX support in libtiff. Add the tag definitions to + tiff.h. Add the related TIFF field definitions to tif_dirinfo.c, + and also fixes an error in a comment. Adds the photometric values + to tif_print.c, and fixes a bug. These changes are by Steve + Underwood. + +2012-08-13 Frank Warmerdam + + * libtiff/tif_write.c: Fix bug rewriting image tiles in a + compressed file: http://trac.osgeo.org/gdal/ticket/4771 + +2012-08-02 Frank Warmerdam + + * libtiff/tif_dirread.c: report error in case of mismatch value + counts for tags (ie. DotRange). + +2012-07-26 Tom Lane + + * libtiff/{tiffio.h, tif_dirinfo.c, libtiff.def}: Add six new + functions TIFFFieldTag(), TIFFFieldName(), TIFFFieldDataType(), + TIFFFieldPassCount(), TIFFFieldReadCount(), TIFFFieldWriteCount() + as external accessors for the opaque type TIFFField. + + * tools/tiffset.c: Make tiffset use the above functions instead of + relying on library private headers. + +2012-07-19 Tom Lane + + * tools/tiff2pdf.c: Fix two places where t2p_error didn't get set + after a malloc failure. No crash risk AFAICS, but the program + might not report exit code 1 as desired. h/t mancha@mac.hush.com + +2012-07-18 Tom Lane + + * tools/tiff2pdf.c: Fail when TIFFSetDirectory() fails. This + prevents core dumps or perhaps even arbitrary code execution when + processing a corrupt input file (CVE-2012-3401). + +2012-07-06 Bob Friesenhahn + + * test/raw_decode.c (main): Test fixes to work with IJG JPEG 7+. + IJG JPEG 7+ uses a different upsampling algorithm which produces + different numeric results. + + * libtiff/tif_jpeg.c (JPEGPreDecode): Patch from Even Rouault to + work with IJG JPEG 7+. + +2012-07-04 Bob Friesenhahn + + * test/raw_decode.c: Add changes so that test can run with build + directory outside of source directory. + +2012-07-02 Frank Warmerdam + + * libtiff/tif_jpeg.c: Fix handling when writing RGBA jpeg compressed + imagery (http://trac.osgeo.org/gdal/ticket/4732) + +2012-06-20 Frank Warmerdam + + * libtiff/tif_fax3.c: fix memory initialization of runs, only + partly done. + + * libtiff/tif_pixarlog.c: Make sure tbuf is large enough for one + full "stride" past the end. + +2012-06-19 Frank Warmerdam + + * libtiff/tif_packbits.c: fix read past end of data buffer. + +2012-06-15 Frank Warmerdam + + * libtiff 4.0.2 released. + + * tools/tif2pdf.c, tools/tifdump.c: avoid unitialized variable + warnings with clang. + +2012-06-15 Tom Lane + + * tools/tiff2pdf.c: Defend against integer overflows while + calculating required buffer sizes (CVE-2012-2113). + +2012-06-12 Frank Warmerdam + + * libtiff/tif_print.c: Be careful about printing corrupt inknames. + + * libtiff/tif_fax3.c: Ensure runs array is initialized to zeros. + +2012-06-07 Frank Warmerdam + + * libtiff/tif_print.c: avoid pretty printing other fields when + we don't have the proper amount and type of data or if the field + is actually autodefined. + +2012-06-05 Frank Warmerdam + + * libtiff/tif_tile.c, libtiff/tif_strip.c: Ensure that illegal + ycbcrsubsampling values result in a runtime error, not just an + assertion. + + * tests/custom_dir.c: Add testing of EXIF and custom directory + reading and writing. + + * libtiff/tif_dir.c, libtiff/tiffio.h: Add TIFFCreateCustomDirectory() + and TIFFCreateEXIFDirectory() functions. + + * libtiff/tif_dir.c, tif_print.c : Remove FIELD_CUSTOM handling for + PAGENUMBER, HALFTONEHINTS, and YCBCRSUBSAMPLING. Implement DOTRANGE + differently. This is to avoid using special TIFFGetField/TIFFSetField + rules for these fields in non-image directories (like EXIF). + +2012-06-04 Frank Warmerdam + + * libtiff/tif_jpeg.c: Remove code for fixing up h_sampling and v_sampling + in JPEGPreDecode(). If a fixup will be done it needs to be done sooner + in JPEGFixupTagsSubsampling() or else buffer sized may be wrong. + +2012-06-01 Frank Warmerdam + + * tools/tiffinfo.c: Do not try to read image data in EXIF directories. + + * libtiff/tif_getimage.c: added support for _SEPARATED CMYK images. + http://bugzilla.maptools.org/show_bug.cgi?id=2379 + + * libtiff/tif_unix.c: use strerror() to return a more specific error message + on failed open. + http://bugzilla.maptools.org/show_bug.cgi?id=2341 + + * libtiff/tif_jpeg.c: Fix JPEGDecodeRaw() bugs. + http://bugzilla.maptools.org/show_bug.cgi?id=2386 + + * tests/decode_raw.c, tests/images/quad-tile.jpg.tiff: add limited support + for testing jpeg in tiff image decoding including the "raw" decode interface. + +2012-05-31 Frank Warmerdam + + * libtiff/tif_jpeg.c: avoid overrunning the end of the output buffer in + JPEGDecodeRaw() - mostly likely to occur when there is confusion about + sampling values. + + * libtiff/tif_read.c: Make sure tif_rawdatasize is cleared when tif_rawdata is freed. + + * libtiff/tif_getimage.c: Add support for greyscale+alpha c/o Jérémie Laval. + http://bugzilla.maptools.org/show_bug.cgi?id=2398 + +2012-05-29 Frank Warmerdam + + * libtiff/tif_dir.c: avoid using specific set/get logic to process fields in custom directories, + like EXIF directories. This fixes problems like a tag "320" existing in a custom directory getting + processed as if it were a colormap when it isn't really. Damn the wide variety of argument formulations + to get/set functions for different tags! + + * libtiff/tif_dir.c: Ensure that we keep track of when tif_rawdata + is a pointer into an mmap()ed file via TIFF_BUFFERMMAP flag. + +2012-05-24 Frank Warmerdam + + * libtiff/tif_pixarlog.c: Allocate working buffer one word larger since we "forward + accumulate" and overwrite the end by one word in at least some cases. + +2012-05-23 Frank Warmerdam + + * libtiff/tif_pixarlog.c: avoid accessing out of the lookup arrays for out of range inputs. + + * tools/tiffinfo.c: initialize h=0 to avoid undefined variable for degenerate files. + + * libtiff/tif_ojpeg.c: if OJPEGWriteHeader() fails once do not bother trying again on + the same image. + + * libtiff/tif_ojpeg.c: make things more resilient in the face of files without + stripbytecounts or stripoffsets or where loading these fails. + + * libtiff/tif_print.c: be careful about whether min/max values are singular + or one per sample. + + * libtiff/tif_print.c: Avoid confusion about count size when printing custom fields. + May affect things like ISOSpeedRatings. + + * libtiff/tif_dir.c: avoid one byte past end of ink names reading + in some cases. + +2012-05-19 Bob Friesenhahn + + * man/TIFFGetField.3tiff: Correct the 'count' field type in the + example for how to retreive the value of unsupported tags. + +2012-03-30 Frank Warmerdam + + * tif_getimage.c: Fix size overflow (zdi-can-1221,CVE-2012-1173) + care of Tom Lane @ Red Hat. + +2012-02-18 Bob Friesenhahn + + * libtiff 4.0.1 released. + + * Update automake used to 1.11.3. + + * libtiff/tiffio.h: Use double-underbar syntax in GCC printf + attribute specification to lessen the risk of accidental macro + substitution. Patch from Vincent Torri. + +2012-01-31 Frank Warmerdam + + * libtiff/tif_dir.c, libtiff/tif_dirread.c: Extra caution around + assumption tag fetching is always successful. + + * libtiff/tif_jpeg.c: Extra caution for case where sp is NULL. + +2012-01-22 Bob Friesenhahn + + * configure.ac: Add support for using library symbol versioning on + ELF systems with the GNU linker. Support is enabled via + --enable-ld-version-script. Disabled by default for now until + there is a decision for how to deploy a libtiff with versioned + symbols after libtiff 4.0.0 was already released. + +2011-12-22 Bob Friesenhahn + + * libtiff/tif_win32.c: Eliminate some minor 64-bit warnings in + + tif_win32.c. Patch by Edward Lam. + + * configure.ac: Add libtiff private dependency on -llzma for + pkg-config. Patch by Mark Brand. + Updated Automake to 1.11.2. + +2011-12-21 Bob Friesenhahn + + * libtiff 4.0.0 released. + +2011-12-08 Frank Warmerdam + + * libtiff/tif_dirread.c, libtiff/tif_read.c: more cautious checking + of _TIFFFillStriles() results (#gdal 4372) + +2011-12-07 Frank Warmerdam + + * libtiff/tif_dirread.c: fixes to deal with invalid files where + _TIFFFillStriles() fails, and we try to chop up strips (gdal #4372) + + * libtiff/tif_dirread.c: fix error reporting when there is no + tag information struct and name (gdal #4373) + +2011-10-22 Bob Friesenhahn + + * Update GNU libtool to 2.4.2. + + * tools/tiffsplit.c (tiffcp): TIFFGetField count field should be + uint32 type for TIFFTAG_JPEGTABLES. Patch by Christophe + Deroulers. + +2011-06-21 Frank Warmerdam + + * libtiff/libtiff.def: Restore TIFFMergeFieldInfo. + +2011-05-31 Jim Meyering + + * libtiff/tif_dirread.c (TIFFFetchStripThing): Free "data" also + upon failure to allocate "resizeddata". + * tools/tiff2ps.c (PSDataBW): Zero buffer *after* checking for + allocation failure, not before. + * libtiff/tif_ojpeg.c: plug leaks on OJPEG read failure path + * tools/rgb2ycbcr.c (cvtRaster): unchecked malloc + * libtiff/tif_jpeg.c, tools/tiff2pdf.c, tools/tiff2ps.c: mark + NULL-deref and possible overflow + * tools/tiff2pdf.c: remove decl+set of set-but-not-used local, "written" + * libtiff/tif_jpeg.c (JPEGInitializeLibJPEG): Remove declaration + and set of otherwise unused local, data_is_empty. + * libtiff/tif_jpeg.c (JPEGDecodeRaw) [JPEG_LIB_MK1_OR_12BIT]: + Diagnose out-of-memory failure and return 0 rather than + dereferencing NULL. + +2011-05-24 Frank Warmerdam + + * libtiff/tif_dirread.c: produce special error message for zero tag + directories instead of error out on the malloc(0) failure. + +2011-05-16 Frank Warmerdam + + * libtiff/tif_dirinfo.c: Restore TIFFMergeFieldInfo() and + related declarations as they are in active use by libraries + such as libgeotiff, and work just fine. (#2315) + +2011-04-20 Frank Warmerdam + + * libtiff/tif_dirinfo.c,tiffio.h: Remove the obsolete + TIFFMergeFieldInfo/TIFFFindFieldInfo/TIFFFindFieldInfoByName API. + http://bugzilla.maptools.org/show_bug.cgi?id=2315 + + * libtiff/libtiff.def: add some missing (64bit) APIs. + http://bugzilla.maptools.org/show_bug.cgi?id=2316 + +2011-04-09 Bob Friesenhahn + + * libtiff 4.0.0beta7 released. + +2011-04-09 Bob Friesenhahn + + * configure.ac: Should use AC_CANONICAL_HOST since host specifies + the run-time target whereas target is used to specify the final + output target if the package is a build tool (like a compiler), + which libtiff is not. Resolves libtiff bug 2307 "Use + AC_CANONICAL_HOST macro". + +2011-04-02 Bob Friesenhahn + + * configure.ac: Support configuring TIFF_INT64_FORMAT and + TIFF_UINT64_FORMAT appropriately for MinGW32. + + * tools/tiffdump.c (ReadDirectory): MinGW32 needs to use WIN32 + printf conventions for 64-bit types because it uses the WIN32 CRT. + + * libtiff/{tif_dumpmode.c,tif_luv.c,tif_lzw.c,tif_print.c, + tif_read.c,tif_strip.c,tif_thunder.c}: MinGW32 needs to use WIN32 + printf conventions for 64-bit types because it uses the WIN32 CRT. + + * tools/tiff2pdf.c (t2p_write_pdf_string): Fix printf syntax not + understood by WIN32 CRT. + + * libtiff/tif_ojpeg.c: Fixes to compile with MinGW32 GCC. + + * tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since + it is much more portable. Tmpfile is included in ISO/IEC + 9899:1990 and the WIN32 CRT. + +2011-03-26 Frank Warmerdam + + * tools/tiffset.c: add -d and -sd switches to allow operation on + a particular directory, not just the first (jef). + +2011-03-21 Frank Warmerdam + + * libtiff/tif_thunder.c: Correct potential buffer overflow with + thunder encoded files with wrong bitspersample set. The libtiff + development team would like to thank Marin Barbella and TippingPoint's + Zero Day Initiative for reporting this vulnerability (ZDI-CAN-1004, + CVE-2011-1167). + http://bugzilla.maptools.org/show_bug.cgi?id=2300 + +2011-03-10 Frank Warmerdam + + * libtiff/tif_fax3.h: Fix to last change allowing zero length + runs at the start of a scanline - needed for legal cases. + +2011-03-02 Frank Warmerdam + + * libtiff/tif_fax3.h: Protect against a fax VL(n) codeword commanding + a move left. Without this, a malicious input file can generate an + indefinitely large series of runs without a0 ever reaching the right + margin, thus overrunning our buffer of run lengths. Per CVE-2011-0192. + This is a modified version of a patch proposed by Drew Yao of Apple + Product Security. It adds an unexpected() report, and disallows the + equality case, since emitting a run without increasing a0 still allows + buffer overrun. + +2011-02-23 Frank Warmerdam + + * libtiff/tif_jpeg.c: avoid divide by zero in degenerate case (#2296) + + * tools/tiff2rgba.c: close source file on error to make leak + detection easier. + + * libtiff/tif_getimage.c: avoid leaks if TIFFRGBAImageBegin() fails. + + http://bugzilla.maptools.org/show_bug.cgi?id=2295 + +2011-02-22 Frank Warmerdam + + * libtiff/tif_lzma.c: Maintain tif_rawcc/tif_rawcp (CHUNKY_STRING_READ + _SUPPORT) + +2011-02-18 Frank Warmerdam + + * configure.ac, configure: Added support for --enable-chunky-strip-read + configure option to enable the experimental feature from a couple + months ago for reading big strips in chunks. + + * configure.ac, tif_read.c, tif_readdir.c, tif_dir.h, tiffiop.h, + tif_write.c, tif_print.c, tif_jpeg.c, tif_dirwrite.c, tif_write.c: + Implement optional support for deferring the load of strip/tile + offset and size tags for optimized scanning of directories. Enabled + with the --enable-defer-strile-load configure option (DEFER_STRILE_LOAD + #define in tif_config.h). + +2011-02-11 Frank Warmerdam + + * libtiff/tif_print.c: remove unused variable. + +2011-02-09 Frank Warmerdam + + * libtiff/tif_win32.c: avoid error/warning buffer overrun problem + with non-console (popup message) builds on win32. + + http://bugzilla.maptools.org/show_bug.cgi?id=2293 + +2011-01-24 Olivier Paquet + + * libtiff/{tif_dir.{h,c}, tif_dirinfo.c, tif_dirread.c, tif_dirwrite.c, + tif_print.c, tiff.h, tiffiop.h} : Added support for + TIFFTAG_SMINSAMPLEVALUE and TIFFTAG_SMAXSAMPLEVALUE to have different + values for each sample. Presents the min/max of all samples by default for + compatibility. TIFFSetField/TIFFGetField can be made to handle those tags + as arrays by changing the new TIFFTAG_PERSAMPLE pseudo tag. + http://www.asmail.be/msg0055458208.html + +2011-01-06 Frank Warmerdam + + * libtiff/tif_pixarlog.c: Note that tif_rawcc/tif_rawcp are not + maintained. + + * libtiff/tif_zip.c: Maintain tif_rawcc/tif_rawcp when decoding + for CHUNKY_STRIP_READ_SUPPORT. + + * libtiff/tif_jpeg.c: ensure that rawcc and rawcp are maintained + during JPEGPreDecode and JPEGDecode calls. + * libtiff/tif_read.c: larger read ahead for CHUNKY_STRIP_READ_SUPPORT, + as compression formats like JPEG keep 16 lines interleaved in a sense + and might need to touch quite a bit of data. + + http://trac.osgeo.org/gdal/ticket/3894 + +2011-01-03 Lee Howard + + * libtiff/tif_jpeg.c: Fix regressions with 2 and 3 band images + caused by commit on 2010-12-14. Submitted by e-mail from + Even Rouault + +2010-12-31 Olivier Paquet + + * libtiff/tif_dirwrite.c: Fixed writing of TIFFTAG_REFERENCEBLACKWHITE. + http://bugzilla.maptools.org/show_bug.cgi?id=2266 + +2010-12-23 Andrey Kiselev + + * tools/tiffcp.c, man/tiffcp.1: Added support for specifying the + compression level parameter (preset) for Deflate and LZMA encoders, + e.g "-c lzma:p1" or "-c zip:p9". + + * libtiff/tif_lzma.c: Properly set the LZMA2 compression level + (preset) in LZMAVSetField(). + +2010-12-18 Bob Friesenhahn + + * libtiff/Makefile.am (libtiff_la_SOURCES): Added tif_lzma.c to + Makefile. + +2010-12-14 Andrey Kiselev + + * configure.ac, libtiff/{tif_codec.c, tif_config.h.in, tiff.h, + tiffiop.h, tif_lzma.c}, tools/tiffcp.c, man/tiffcp.1: Implement a new + TIFF compression scheme LZMA reserving a new value 34925 for + Compression tag. As per + bug http://bugzilla.maptools.org/show_bug.cgi?id=2221 + +2010-12-14 Lee Howard + + * libtiff/tif_dirread.c: tolerate some cases where + FIELD_COLORMAP is missing + http://bugzilla.maptools.org/show_bug.cgi?id=2189 + +2010-12-14 Lee Howard + + * libtiff/tif_read.c: change read_ahead to tmsize_t + http://bugzilla.maptools.org/show_bug.cgi?id=2222 + +2010-12-14 Lee Howard + + * configure.ac, libtiff/Makefile.am: Build tif_win32.c on + Windows except on Cygwin + http://bugzilla.maptools.org/show_bug.cgi?id=2224 + +2010-12-14 Lee Howard + + * tools/gif2tiff.c: fix buffer overrun + http://bugzilla.maptools.org/show_bug.cgi?id=2270 + +2010-12-14 Lee Howard + + * libtiff/tif_jpeg.c: reduce usage of JCS_UNKNOWN in order + to improve compatibility with various viewers + submitted by e-mail from Dwight Kelly + +2010-12-13 Lee Howard + + * tools/fax2ps.c: be consistent with page-numbering + http://bugzilla.maptools.org/show_bug.cgi?id=2225 + +2010-12-13 Lee Howard + + * libtiff/tif_color.c: prevent crash in handling bad TIFFs + resolves CVE-2010-2595 + http://bugzilla.maptools.org/show_bug.cgi?id=2208 + +2010-12-13 Lee Howard + + * tools/tiffcrop.c: new release by Richard Nolde + http://bugzilla.maptools.org/show_bug.cgi?id=2004 + +2010-12-12 Lee Howard + + * tools/tiff2pdf.c: fix colors for images with RGBA + interleaved data + http://bugzilla.maptools.org/show_bug.cgi?id=2250 + +2010-12-12 Lee Howard + + * libtiff/tif_dirread.c: fix for Zeiss LSM and Canon CR2 files + http://bugzilla.maptools.org/show_bug.cgi?id=2164 + +2010-12-11 Lee Howard + + * tools/tiff2pdf.c: remove invalid duplication for Lab + http://bugzilla.maptools.org/show_bug.cgi?id=2162 + +2010-12-11 Lee Howard + + * libtiff/tif_jpeg.c: fix use of clumplines calculation + http://bugzilla.maptools.org/show_bug.cgi?id=2149 + +2010-12-11 Lee Howard + + * tools/fax2ps.c: replace unsafe tmpfile() with mkstemp() + http://bugzilla.maptools.org/show_bug.cgi?id=2118 + +2010-12-11 Lee Howard + + * libtiff/tif_ojpeg.c, libtiff/tif_pixarlog.c, + libtiff/tif_zip.c: fix build errors for VC6 + http://bugzilla.maptools.org/show_bug.cgi?id=2105 + +2010-12-11 Lee Howard + + * libtiff/tif_stream.cxx: warnings cleanup + http://bugzilla.maptools.org/show_bug.cgi?id=2091 + * libtiff/tif_dirread.c: warnings cleanup + http://bugzilla.maptools.org/show_bug.cgi?id=2092 + +2010-12-11 Lee Howard + + * tools/tiff2pdf.c: add fill-page option + http://bugzilla.maptools.org/show_bug.cgi?id=2051 + +2010-12-11 Lee Howard + + * libtiff/tif_dirread.c: modify warnings + http://bugzilla.maptools.org/show_bug.cgi?id=2016 + +2010-12-11 Lee Howard + + * libtiff/tif_ojpeg.c: fix buffer overflow on problem data + http://bugzilla.maptools.org/show_bug.cgi?id=1999 + +2010-12-11 Lee Howard + + * tools/tiffinfoce.c: strip byte counts are uint64* now + +2010-12-11 Lee Howard + + * libtiff/tif_ojpeg.c: fix crash when reading a TIFF with a zero + or missing byte-count tag + * tools/tiffsplit.c: abort when reading a TIFF without a byte-count + per http://bugzilla.maptools.org/show_bug.cgi?id=1996 + +2010-12-08 Lee Howard + + * libtiff/tif_dirread.c: fix crash when reading a badly-constructed + TIFF per http://bugzilla.maptools.org/show_bug.cgi?id=1994 + +2010-12-06 Lee Howard + + * libtiff/tif_open.c: Fix mode check before opening a file. + http://bugzilla.maptools.org/show_bug.cgi?id=1906 + +2010-11-27 Bob Friesenhahn + + * libtiff-4.pc.in: Added libtiff pkg-config .pc file support. + Patch by Vincent Torri. + +2010-10-21 Frank Warmerdam + + * tools/tiffinfo.c: avoid direct reference to _TIFFerrorHandler. + + * libtiff/tif_config.vc.h: define snprintf to _snprintf for tiff2pdf. + + * libtiff/libtiff.def: export _TIFFCheckMalloc for tools. + +2010-09-25 Lee Howard + + * tools/tiff2ps.c: improvements and enhancements from Richard Nolde + with additional command line options for Document Title, + Document Creator, and Page Orientation + +2010-07-13 Bob Friesenhahn + + * tools/tiffcrop.c: Patch from Richard Nolde to avoid a + potentially unterminated buffer due to using an exceptionally long + file name. + +2010-07-08 Andrey Kiselev + + * tools/tiff2pdf.c: Fixed ID buffer filling in + t2p_write_pdf_trailer(), thanks to Dmitry V. Levin. + +2010-07-07 Andrey Kiselev + + * libtiff/tif_dirread.c: Really reset the tag count in CheckDirCount() + to expected value as the warning message suggests. As per bug + http://bugzilla.maptools.org/show_bug.cgi?id=1963 + +2010-07-06 Andrey Kiselev + + * tools/tiffset.c: Properly handle TIFFTAG_PAGENUMBER, + TIFFTAG_HALFTONEHINTS, TIFFTAG_YCBCRSUBSAMPLING, TIFFTAG_DOTRANGE + which should be set by value. + + * libtiff/tif_dirinfo.c: Don't use assertions in _TIFFFieldWithTag() + and _TIFFFieldWithName() if the tag is not found in the tag table. + This should be normal situation and returned NULL value should be + properly handled by the caller. + +2010-07-02 Andrey Kiselev + + * libtiff/tif_getimage.c: Avoid wrong math du to the signed/unsigned + integer type conversions. As per bug + http://bugzilla.maptools.org/show_bug.cgi?id=2207 + + * tools/{tiff2bw.c, thumbnail.c, pal2rgb.c}: Fix the count for + WhitePoint tag as per bug + http://bugzilla.maptools.org/show_bug.cgi?id=2042 + + * libtiff/tif_getimage.c: Check the number of samples per pixel when + working with YCbCr image in PickContigCase(). As per bug + http://bugzilla.maptools.org/show_bug.cgi?id=2216 + + * libtiff/tif_dir.c: Set the bogus post-decoding hook when processing + TIFFTAG_BITSPERSAMPLE in _TIFFVSetField() for the case of 8 bit when + we don't need any post-processing. That helps to reset the hook if we + previously set this field to some other value and the hook was + initialized accordingly. As per bug + http://bugzilla.maptools.org/show_bug.cgi?id=2035 + +2010-07-01 Andrey Kiselev + + * tools/tiffgt.c: Properly check the raster buffer allocations for + integer overflows. As per bug + http://bugzilla.maptools.org/show_bug.cgi?id=2108 + + * m4/acinclude.m4: Update GL/GLU/GLUt/Pthread macros from the + upstream. + + * libtiff/{tif_aux.c, tif_strip.c, tif_tile.c, tiffiop.h}: Move + multiply_32() and multiply_64() functions into tif_aux.c file and + rename them into _TIFFMultiply32() and _TIFFMultiply64() respectively. + +2010-06-30 Andrey Kiselev + + * tools/tiff2pdf.c: Better generation of ID field in + t2p_write_pdf_trailer(). Get rid of GCC aliasing warnings. + + * tools/tiff2pdf.c: Fixed computation of the tile buffer size when + converting JPEG encoded tiles. + + * tools/tiff2pdf.c: Better handling of string fields, use static + string buffers instead of dynamically allocated, use strncpy() instead + of strcpy(), control the string lengths. + +2010-06-25 Andrey Kiselev + + * tools/tiffcp.c: Initialize buffer arrays with zero to avoid + referencing to uninitialized memory in some cases (e.g. when tile size + set bigger than the image size). + +2010-06-15 Bob Friesenhahn + + * tools/tiffcrop.c: Patch from Richard Nolde. Reject YCbCr + subsampled data since tiffcrop currently doesn't support it. Fix + JPEG support. + +2010-06-13 Frank Warmerdam + + * libtiff/tif_dirinfo.c: Fix invocation of tag compare function (#2201) + + * tools/tiff2pdf.c: Fix assorted bugs in tiff2pdf: missing "return" + in t2p_read_tiff_size() causes t2p->tiff_datasize to be set entirely + wrong for COMPRESSION_JPEG case, resulting in memory stomp if actual + size is larger. Also, there are a bunch of places that try to + memset() a malloc'd buffer before checking for malloc failure, which + would result in core dump if there actually were a failure. (#2211) + +2010-06-11 Bob Friesenhahn + + * libtiff/tiffiop.h (TIFFSafeMultiply): Need more castings to + avoid compiler warnings if parameter types are not sign + consistent. + + * libtiff 4.0.0alpha6 released. + + * tools/tiffcrop.c: Applied patch from Richard Nolde: Corrected + European page size dimensions. Added an option to allow the user + to specify a custom page size on the command line. Fix the case + where a page size specified with a fractional part was being + coerced to an integer by retyping the variables that define the + paper size. + + * html/index.html: Update for the 3.9.3 release. + + * tools/tiffcp.c (tiffcp): Applied Tom Lane's patch to reject + YCbCr subsampled data since tiffcp currently doesn't support it. + http://bugzilla.maptools.org/show_bug.cgi?id=2097 + + * Update libtool to version 2.2.10. + +2010-06-10 Bob Friesenhahn + + * libtiff/tiffiop.h (TIFFSafeMultiply): Work properly if + multiplier is zero. + +2010-06-09 Bob Friesenhahn + + * libtiff/tif_fax3.c (Fax3SetupState): Yesterday's fix for + CVE-2010-1411 was not complete. + + * libtiff/tiffiop.h (TIFFSafeMultiply): New macro to safely + multiply two integers. Returns zero if there is an integer + overflow. + + * tools/tiffcp.c (main): tiffcp should not leak memory if an error + is reported when reading the input file. + +2010-06-08 Bob Friesenhahn + + * Update libtool to version 2.2.8. + + * libtiff/tif_fax3.c (Fax3SetupState): Avoid under-allocation of + buffer due to integer overflow in TIFFroundup() and several other + potential overflows. In conjunction with the fix to TIFFhowmany(), + fixes CVE-2010-1411. + + * libtiff/tiffiop.h (TIFFhowmany): Return zero if parameters would + result in an integer overflow. This causes TIFFroundup() to also + return zero if there would be an integer overflow. + + * contrib: Add an emacs formatting mode footer to all source files + so that emacs can be effectively used. + +2010-06-03 Oliver Chen Feng + + * libtiff/tools/tiffcp.c: add a new option -x to force merged tiff + file PAGENUMBER value in sequence for users who care the page + sequence, this will also prevent tiff2pdf from creating pdf file from + the merged tiff file with wrong page sequence. + +2010-05-08 Olivier Paquet + + * libtiff/tif_dirread.c: Restored TIFFReadDirEntryFloat function in order + to add missing TIFF_SETGET_FLOAT case to TIFFFetchNormalTag. + * libtiff/tif_dirinfo.c: Use correct set_field_type for + TIFFTAG_PIXAR_FOVCOT so it is readable again (regression from 3.9.2). + http://bugzilla.maptools.org/show_bug.cgi?id=2192 + +2010-05-07 Frank Warmerdam + + * libtiff/tif_jpeg.c: Ensure that quality is always set in + JPEGPreEncode(), not just when we want to output local tables. + Otherwise the quality used during compression may not be right and + might not match the tables in the tables tag. This bug only occurs + when seeking between directories in the midst of writing blocks. + http://trac.osgeo.org/gdal/ticket/3539 + +2010-05-06 Andrey Kiselev + + * html/man/TIFFGetField.3tiff.html, html/man/TIFFSetField.3tiff.html: + Regenerated from the source. + +2010-05-05 Olivier Paquet + + * libtiff/tif_print.c: Fixed printing of TIFFTAG_REFERENCEBLACKWHITE which + had stopped working. Also made it always print 6 floats instead of + 2*SamplesPerPixel. + http://bugzilla.maptools.org/show_bug.cgi?id=2191 + http://bugzilla.maptools.org/show_bug.cgi?id=2186 + * man/TIFFGetField.3tiff, man/TIFFSetField.3tiff: Fixed doc to reflect the + fact that libtiff considers TIFFTAG_REFERENCEBLACKWHITE to be 6 floats. + +2010-05-05 Frank Warmerdam + + * libtiff/tif_jpeg.c: Fix to use memcmp(), not memcpy() when checking + if the jpeg table was written. This is a fix for the last fix on 04-21. + +2010-04-21 Frank Warmerdam + + * libtiff/tif_jpeg.c: avoid preparing jpeg tables everytime + JPEGSetupEncode() is called if the tables already seem to be + established. This prevents spurious updates and rewriting of + directories with jpegtables when doing updates to existing images. + http://trac.osgeo.org/gdal/ticket/3539 + +2010-04-20 Olivier Paquet + + * libtiff/tif_dirinfo.c: Use correct set_field_type for + TIFFTAG_PIXAR_IMAGEFULLWIDTH, TIFFTAG_PIXAR_IMAGEFULLLENGTH, + TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN and TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA. + They were unreadable with TIFF_SETGET_UNDEFINED, a regression from 3.9.2. + http://bugzilla.maptools.org/show_bug.cgi?id=2139 + +2010-04-10 Bob Friesenhahn + + * libtiff/tif_dir.c (_TIFFVSetField): Add a special error case for + when the tag count value is zero. Error handling is still a + regression since in 3.9.2, empty tags are skipped (with a warning) + rather than returning a hard error and refusing to read the file. + + * tools/ppm2tiff.c (main): While case for parsing comment line + requires extra parenthesis to work as expected. Reported by + Thomas Sinclair. + +2010-04-02 Frank Warmerdam + + * libtiff/tif_read.c (primarily): Add support for + CHUNKY_STRIP_READ_SUPPORT where large strips are + read in chunks for applications using TIFFReadScanline(). + This is intended to make it more practical work with very + large compressed one-strip files. Feature is off by default. + Enable by defining CHUNK_STRIP_READ_SUPPORT as a macro. + http://trac.osgeo.org/gdal/ticket/3514 + +2010-03-31 Frank Warmerdam + + * libtiff/tif_flush.c: Use TIFFRewriteDirectory() when flushing + directories so previously placed directories will be migrated to + the end of file if needed. + +2010-03-30 Frank Warmerdam + + * libtiff/tif_lzw.c: change type of dec_bitsleft field to uint64 + to support operating on strips/tiles of more than 256MB. + http://trac.osgeo.org/gdal/ticket/3512 + +2010-03-10 Bob Friesenhahn + + * libtiff/tif_aux.c (_TIFFCheckRealloc): Improve error message so + that it is clearly a memory allocation error message, and also + includes the size of the allocation request. + +2010-02-22 Lee Howard + + * libtiff/tif_jpeg.c: Do not generate a JPEGTables tag when creating + the JPEG TIFF as is is not required in order to prevent it from + being unused and filled with invalid data. (Leave it to be + generated by later activity.) + http://bugzilla.maptools.org/show_bug.cgi?id=2135 + * tools/tiff2pdf.c: Write the JPEG SOI headers into the TIFF strip + data rather than skipping them. This fixes the ability to view in + Acrobat Reader, Evince, and Ghostscript. + http://bugzilla.maptools.org/show_bug.cgi?id=2135 + * libtiff/tif_fax3.c: Don't return error on badly-terminated MMR + strips. + http://bugzilla.maptools.org/show_bug.cgi?id=2029 + +2009-12-03 Frank Warmerdam + + * libtiff/tif_jpeg.c: Made JPEGDecodeRaw() check for buffer overruns. + Made so that when working with downsampled images a stub function + reporting an error is used for tif_decoderow. We cannot meaningfully + support reading scanlines in this situation. (#1936) + + * libtiff/tif_jpeg.c: Ensure that tif_scanlinesize is computed after + resetting of the upsampling values (gdal:#3259). + http://bugzilla.maptools.org/show_bug.cgi?id=1936 + +2009-11-30 Frank Warmerdam + + * contrib/dbs/tiff-grayscale.c, contrib/tif-palette.c, + tools/ras2tiff.c: Fix resource leaks on error. + http://bugzilla.maptools.org/show_bug.cgi?id=2121 + + * libtiff/tif_{aux.c,dir.c,dir.h,dirinfo.c}: Return to handling + TIFFTAG_REFERENCEBLACKWHITE as a field in the TIFF directory instead + of as a custom(generic) field to avoid a potential reentrancy problem. + http://bugzilla.maptools.org/show_bug.cgi?id=2125 + + * libtiff/tif_color.c, libtiff/tif_getimage.c, libtiff/tiffio.h, + man/TIFFcolor.3tiff: Make TIFFDisplay argument in TIFFCIELabToRGBInit + const, and display_sRGB static and const. + http://bugzilla.maptools.org/show_bug.cgi?id=2124 + +2009-11-04 Bob Friesenhahn + + * libtiff 4.0.0alpha5 released. + +2009-11-03 Bob Friesenhahn + + * tools/tiffcrop.c: Updated tiffcrop from Richard Nolde. This + version has undergone substantial testing with arbitrary sample + bit depths. Also eliminates GCC compilation warnings. + +2009-11-02 Bob Friesenhahn + + * port/libport.h: Add extern declarations for getopt standard + globals. + +2009-10-31 Bob Friesenhahn + + * libtiff/tif_lzw.c (LZWDecode, LZWDecodeCompat): Fix warnings + noticed in 64-bit build of libtiff with Visual Studio 2005. + Resolves "Bug 2067 - Visual Studio 2005 64-bit warnings in + tif_lzw.c", http://bugzilla.maptools.org/show_bug.cgi?id=2067 + + * libtiff/tif_pixarlog.c (PixarLogEncode): Fix non-important + warning noticed in Visual Studio 2005 build. Resolves "Bug 2068 - + Visual Studio 2005 64-bit warning in tif_pixarlog.c", + http://bugzilla.maptools.org/show_bug.cgi?id=2068 + +2009-10-29 Bob Friesenhahn + + * libtiff/tif_dirread.c: Eliminate GCC "dereferencing type-punned + pointer" warnings. + +2009-10-28 Bob Friesenhahn + + * html/tools.html: Add manual page links, and a summary + description of tiffcrop. + +2009-10-07 Bob Friesenhahn + + * configure.ac: x86_64 should use the same fill order as i386. + +2009-09-24 Bob Friesenhahn + + * tools/tiffcrop.c, man/tiffcrop.1: New tiffcrop from Richard + Nolde. Major updates to add significant functionality for reading + and writing tile based images with bit depths not a multiple of 8 + which cannot be handled by tiffcp. + +2009-09-03 Bob Friesenhahn + + * libtiff/tif_ojpeg.c (OJPEGWriteHeaderInfo): IJG JPEG 7 needs + do_fancy_upsampling=FALSE in order to read raw data. Resolves + "Bug 2090 - OJPEG crash with libjpeg v7". + http://bugzilla.maptools.org/show_bug.cgi?id=2090 + +2009-09-03 Frank Warmerdam + + * libtiff/tif_getimage.c: Fixed error recognition handling in RGBA + interface when stoponerror is set. + http://bugzilla.maptools.org/show_bug.cgi?id=2071 + +2009-08-30 Bob Friesenhahn + + * tools/{tiffcrop.c,tiffgt.c}: Applied patch from Oden Eriksson to + fix build with gcc when using the "-Wformat + -Werror=format-security" flags. + +2009-08-29 Bob Friesenhahn + + * test/{bmp2tiff_palette.sh, bmp2tiff_rgb.sh, gif2tiff.sh, + ppm2tiff_pbm.sh, ppm2tiff_pgm.sh, ppm2tiff_ppm.sh}: Additional + utilities tests. + +2009-08-28 Bob Friesenhahn + + * tools/tiffinfo.c: tiffinfo should return error status to the + caller. Register a private error callback to accomplish that. + + * test/Makefile.am (TIFFIMAGES): Add test images in BMP, GIF, and + PNM formats so that we will be able to test more of the tools. + While adding these test images I notice that bmp2tiff and gif2tiff + only support ancient versions of their respective formats. + +2009-08-27 Bob Friesenhahn + + * libtiff 4.0.0alpha4 released. + + * HOWTO-RELEASE: Improved release instructions. + +2009-08-24 Bob Friesenhahn + + * man/{TIFFClose.3tiff,raw2tiff.1,tiffcmp.1,tiffsplit.1}: Applied + fixes for "Bug 2023 - nroff errors in manual pages". + http://bugzilla.maptools.org/show_bug.cgi?id=2023 + + * tools/{rgb2ycbcr.c, tiff2rgba.c}: Applied fixes for "Bug 2079 - + CVE-2009-2347 libtiff: integer overflows in various inter-color + space conversion tools". + http://bugzilla.maptools.org/show_bug.cgi?id=2079 + + * libtiff/tif_print.c (TIFFPrintDirectory): Apply fix from Jay + Berkenbilt for "Bug 2024 - possible null pointer dereference with + one-line fix". + http://bugzilla.maptools.org/show_bug.cgi?id=2024 + + * libtiff/tif_dirread.c (TIFFReadCustomDirectory): Apply patch + from Jay Berkenbilt for "Bug 1895 - logic error in tif_dirread.c: + segfault after setting tdir_tag = IGNORE". + http://bugzilla.maptools.org/show_bug.cgi?id=1895 + +2009-08-23 Bob Friesenhahn + + * test/Makefile.am, test/tiffcrop*.sh: Split previously existing + tiffcrop.sh into a collection of many specific tests. Re-wrote + all of the existing tests to be based on some simple shell + functions. Make distcheck works again. + + Export certain variables (MAKE, MAKEFLAGS, MEMCHECK) to tests and + added 'memcheck' and 'ptrcheck' targets to make it easy to run the + tests under valgrind. + +2009-08-21 Bob Friesenhahn + + * test/tiffcp-logluv.sh: Fix test so that it works with a VPATH + build. + + * test/Makefile.am (AUTOMAKE_OPTIONS): Colorized tests was not + actually activated since it needed to be enabled in this + Makefile.am. Also activated parallel-tests mode since it offers + useful features such as per-test .log files and a summary test + report .log file. + +2009-08-20 Bob Friesenhahn + + * configure.ac: Updated autotools. Autoconf 2.64, Automake 1.11, + libtool 2.2.6. Enabled support for silent build rules + (--enable-silent-rules or 'make V=0') and colorized tests. + + * html/{index.html, v3.9.0.html}: Update for 3.9.0 release. + +2009-06-30 Frank Warmerdam + + * tests/tiffcp-logluv.sh: minimal testing of sgilog compression. + + * tools/tiffcp.c: add -c sgilog support. + + * libtiff/tif_luv.c: correct return codes from encoderow to be + 1 on success instead of zero. + http://bugzilla.maptools.org/show_bug.cgi?id=2069 + + * libtiff/tif_lzw.c: back out patch from #2065 and apply patch from + #1085 for a better underflow fix that errors properly. + http://bugzilla.maptools.org/show_bug.cgi?id=2065 + http://bugzilla.maptools.org/show_bug.cgi?id=1985 + +2009-06-26 Frank Warmerdam + + * libtiff/tif_strip.c: Remove an inappropriate assertion that often + fails on oddly sized 12bit jpeg compressed ycbcr images. + +2009-06-22 Frank Warmerdam + + * libtiff/tif_lzw.c: Fix buffer underflow bug. + http://bugzilla.maptools.org/show_bug.cgi?id=2065 + +2009-06-21 Frank Warmerdam + + * configure.ac, libtiff/tif_jpeg.c, libtiff/tif_jpeg_12.c: add support + for dual mode 8/12 bit jpeg support. + +2009-06-03 Frank Warmerdam + + * libtiff/tif_write.c: do not override the planar configuration to be + contig for one sample files if planar configuration is already set. + http://bugzilla.maptools.org/show_bug.cgi?id=2057 + +2009-06-02 Frank Warmerdam + + * libtiff/libtiff.def: Add TIFFUnsetField. + +2009-05-03 Frank Warmerdam + + * libtiff/{tif_jpeg.c,tif_ojpeg.c,tif_getimage.c}: Fixed various + error reports to use "%s" as format string. + http://trac.osgeo.org/gdal/ticket/2976 + +2009-03-12 Frank Warmerdam + + * libtiff/{tif_fax3.c,tif_jpeg.c,tif_ojpeg.c}: Fix printdir chaining + for some codecs (#2020). + +2009-02-12 Frank Warmerdam + + * libtiff/tif_luv.c: Fix handling of tiled logluv images. + http://bugzilla.maptools.org/show_bug.cgi?id=2005 + +2009-02-09 Frank Warmerdam + + * libtiff/tif_dirread.c: Improve allocation safety when allocated + buffer for large tags. (#1998) Related to (#1993) + +2009-02-06 Frank Warmerdam + + * tools/tiffcrop.c: Don't default image->res_unit to INCH. Now the + test suite should pass. + +2009-02-05 Frank Warmerdam + + * libtiff/tif_dirread.c: Re-incorporated a sanity check on tag size, + but at the 2GB boundary to avoid overflow on 32bit systems. + http://bugzilla.maptools.org/show_bug.cgi?id=1993 + + * libtiff/tif_dirread.c: Remove some assertions that blow due to + corrupt files rather than in response to library internal + inconsistencies. + http://bugzilla.maptools.org/show_bug.cgi?id=1995 + http://bugzilla.maptools.org/show_bug.cgi?id=1991 + + * libtiff/tif_dirread.c: Fixed testing for failed result from + TIFFReadDirectoryFindFieldInfo(). + http://bugzilla.maptools.org/show_bug.cgi?id=1992 + +2009-01-23 Frank Warmerdam + + * libtiff/tif_predict.c: Add support for 32bit integer horz. predictors. + http://bugzilla.maptools.org/show_bug.cgi?id=1911 + + * libtiff/tif_dirwrite.c: Fix byte swapping of next directory offset. + + http://bugzilla.maptools.org/show_bug.cgi?id=1924 + + * tools/tiffcrop.c: initialize xres/yres values. + + * test/*.sh - default ${srcdir} to local directory. + + * test/common.sh - start verbose mode after common settings. + + * libtiff/tif_dirinfo.c: Replace lfind() with local equivelent to + avoid type mismatches on different platforms. + http://bugzilla.maptools.org/show_bug.cgi?id=1889 + +2009-01-22 Frank Warmerdam + + * tools/{fax2tiff.c,thumbnail.c,tiff2pdf.c,tiff2ps.c,tiffdump.c, + tiffsplit.c}: avoid warnings, mostly 32bit/64bit casting issues. + + * port,tools: Introduce libport.h, and include in tools if NEED_LIBPORT + defined, primarily to reduce prototype warnings on windows. + + * libtiff/tif_dirinfo.c,tif_dirread.c: Avoid warnings + about unused parameters, and uninitialized variables. + +2009-01-21 Bob Friesenhahn + + * test/common.sh: Execute tests like 'make VERBOSE=TRUE check' in + order to trace full execution detail while executing the test suite. + +2009-01-20 Frank Warmerdam + + * tools/tiffsplit.c: fix sampleformat to be shortv instead of longv. + +2009-01-20 Bob Friesenhahn + + * test/Makefile.am (CLEANFILES): Make sure that test output files + are removed by 'make clean' + + * Update autotools for 4.0.0 beta3 + + * 4.0.0 beta3 produced. + +2009-01-12 Bob Friesenhahn + + * test/tiffcrop.sh: New test script for tiffcrop from Richard + Nolde. + + * tools/tiff2ps.c: Remove spurious message to stderr. + +2009-01-11 Bob Friesenhahn + + * tools/tiff2ps.c: Incorporated significant functionality update + from Richard Nolde. In particular, support for rotating the image + by 90, 180, 270, and 'auto' has been added. + + * man/tiffcrop.1: Incorporated documentation updates from Richard + Nolde. + + * tools/tiffcrop.c: Incorporated significant functionality update + from Richard Nolde. + +2008-12-31 Bob Friesenhahn + + * libtiff/tiffio.h: GCC will now validate format specifications + for TIFFError(), TIFFErrorExt(), TIFFWarning(), and + TIFFWarningExt() in order to reveal bugs. + + * Many fixes throughout to work better as a 64-bit build. + +2008-12-30 Bob Friesenhahn + + * tools/{tiff2pdf.c, tiff2ps.c, tiffinfo.c}: Offset and length + tags now require 64-bit parameter rather than 32-bit. + + * libtiff/tif_dirread.c: Fixed issues with unaligned access to + 64-bit values. + + * tools/thumbnail.c: Eliminate crash noticed while running test + suite. + +2008-12-29 Bob Friesenhahn + + * libtiff/tif_ojpeg.c (OJPEGLibjpegJpegSourceMgrFillInputBuffer): + Initialize stack variables to avoid compiler warning. + + * tools/tiffinfoce.c (main): Use toff_t for offset type when + retrieving offset of EXIF IFD. + + * libtiff/tiffio.h: Undeprecate toff_t and restore its use in the + TIFFClientOpen() callback and other external function definitions. + + * tools/tiffinfo.c (main): Offset to EXIF IFD requires a 64-bit + type now. Fixes crash when dumping files containing an EXIF IFD. + + * m4/libtool.m4: Update to libtool 2.2.6. + +2008-12-21 Frank Warmerdam + + * libtiff/tif_dir.c, tiffio.h: Introduce TIFFUnsetField() function. + + * libtiff/tif_jpeg.c: Avoid errors if the application writes a full + strip for the last partial strip in a jpeg compressed file. + http://bugzilla.maptools.org/show_bug.cgi?id=1981 + +2008-10-29 Frank Warmerdam + + * libtiff/tif_flush.c: Make sure that BEENWRITING is cleared when + we take the shortcut to only update the strip/tile offsets in place. + http://trac.osgeo.org/gdal/ticket/2621 + +2008-10-21 Andrey Kiselev + + * libtiff/tif_jbig.c: Support the JBIG-KIT 2.0 (compatibility with + the older versions retained). + +2008-10-09 Frank Warmerdam + + * libtiff/tif_jpeg.c: Add #ifdefs for changes needed if using + IPP enabled version of libjpeg from Intel. + http://bugzilla.maptools.org/show_bug.cgi?id=1951 + +2008-09-05 Andrey Kiselev + + * tools/tiffsplit.c: Use byte counts of proper size (uint64). + Required for libtiff 4.0. + + * tools/tiffsplit.c: Use dynamically allocated array instead of static + when constructing output file names. + +2008-09-03 Andrey Kiselev + + * tools/tiffsplit.c: Get rid of unsafe strcpy()/strcat() calls when + doing the filename/path construction. + + * tools/tiff2pdf.c: More appropriate format string in + t2p_write_pdf_string(); avoid signed/unsigned mismatch. + + * libtiff/tif_lzw.c: Properly zero out the codetable. As per bug + + http://bugzilla.maptools.org/show_bug.cgi?id=1929 + + * libtiff/tif_lzw.c: Properly zero out the string table. Fixes + CVE-2008-2327 security issue. + +2008-09-01 Frank Warmerdam + + * libtiff/tif_dirread.c: Avoid unused TIFFReadDirEntryFloat() function. + + * libtiff/tif_dirwrite.c: modified to write IFDs as either IFD8 or IFD + depending on whether the file is bigtiff or classic tiff. + http://bugzilla.maptools.org/show_bug.cgi?id=1917 + +2008-08-12 Edward Lam + + * tools/tiffdump.c: When compiling for Microsoft Windows, apply + consistent (__int64) casting when testing if _lseeki64 has + successfully seeked as requested. This is necessary for large + file support to work since off_t is only 32-bit. + +2008-07-29 Frank Warmerdam + + * tif_strip.c: Replace assertions related to samplesperpixel != 3 or + the subsampling values not being 1, 2 or 4 (for jpeg compressed images) + with control logic to return runtime errors (c/o Even Rouault) (#1927). + +2008-06-17 Frank Warmerdam + + * tools/tiffcrop.c: Fix some portability problems. + + * libtiff/tif_ojpeg.c: Use same jpeg/win32 boolean/FAR hacks as are + used in tif_jpeg.c. + + * libtiff/tif_win32.c: Ensure TIFFOpenW() uses same FILE_SHARE flags + as TIFFOpen(). + +2008-06-01 Frank Warmerdam + + * libtiff/tif_dirwrite.c: Fix alignment problems affecting architectures + like Sparc/Solaris. + http://bugzilla.maptools.org/show_bug.cgi?id=1892 + +2008-05-27 Frank Warmerdam + + * libtiff.def: Add TIFFFindField + http://bugzilla.maptools.org/show_bug.cgi?id=1891 + +2008-05-26 Frank Warmerdam + + * tif_config.*.h, tiffconf.*.h: Remove SIZEOF_LONG definition, unused. + + * li2008-04-15 Andrey Kiselev + +btiff/tif_win32.c: Replace custom Win32 memory api with generic + POSIX one. No apparent value to use of GlobalAlloc() in the modern + age. http://bugzilla.maptools.org/show_bug.cgi?id=1885 + + * libtiff/tiffconf.vc.h: Added JBIG_SUPPORT and MDI_SUPPORT items + in windows version (care of Edward Lam). + +2008-05-24 Frank Warmerdam + + * tif_codec.c: Avoid NULL pointer dereferencing for exotic + compression codec codes. + + * tif_dirwrite.c: fix potential memory leak. + + * tif_dirread.c: Fix unchecked malloc result. + +2008-05-24 Bob Friesenhahn + + * test {tiff2pdf.sh tiff2ps-EPS1.sh tiff2ps-PS1.sh tiff2ps-PS2.sh + tiff2ps-PS3.sh tiffcp-g3-1d-fill.sh tiffcp-g3-1d.sh + tiffcp-g3-2d-fill.sh tiffcp-g3-2d.sh tiffcp-g3.sh tiffcp-g4.sh + tiffcp-split-join.sh tiffcp-split.sh tiffcp-thumbnail.sh + tiffdump.sh tiffinfo.sh}: Added more test scripts based on + suggestions from Lee Howard posted to the tiff list on 13 Sep + 2007. + +2008-05-23 Frank Warmerdam + + * libtiff/tif_fax3.c: Add an assert in an effort to detect a + possible runtime problem reported by coverity. + + * contrib/iptcutil/iptcutil.c: Fixed memory leak of str. + + * tools/tiffcrop.c, man/tiffcrop.1: Major update from Richard Nolde. + http://bugzilla.maptools.org/show_bug.cgi?id=1888 + + * tools/tiffdither.c: remove dead onestrip code. avoid memory leak. + + * tools/rgb2ycbcr.c: fix memory leak of raster buffer. + + * tools/tiffcp.c: Simplify inknames code to avoid pointless test. + Cleanup scanline allocation to avoid coverity warning. + + * tools/thumbnail.c: Check for TIFFOpen() failure. + +2008-05-18 Frank Warmerdam + + * libtiff/tif_dirinfo.c: Use TIFF_SETGET_ASCII for PIXAR_TEXTUREFORMAT + and PIXAR_WRAPMODES instead of TIFF_SETGET_UNDEFINED. Not exactly clear + why this is needed. + +2008-05-09 Bob Friesenhahn + + * Makefile.am (ACLOCAL_AMFLAGS): Libtool 2.2.4 does not like + "ACLOCAL_AMFLAGS=-I ./m4". It wants "ACLOCAL_AMFLAGS=-I m4". + +2008-04-15 Andrey Kiselev + + * test/: Test suite updated. Everything is passed now. + + * libtiff/tif_dirinfo.c: Fixed description of the + TIFFTAG_NUMBEROFINKS tag. + +2008-04-14 Andrey Kiselev + + * libtiff/{tif_dirread.c, tif_dirwrite.c, tiffiop.h}: + Get rid of some of "dereferencing type-punned" warnings by converting + tdir_offset field of TIFFDirEntry structure into union. + +2008-04-10 Andrey Kiselev + + * libtiff/{tif_flush.c, tif_dirwrite.c, tiffio.h, tiffiop.h}: + TIFFRewriteField() renamed into _TIFFRewriteField() and moved out + from the public interface. Type of its 'count' parameter changed + from uint32 to tmsize_t. + + * /libtiff/tiffiop.h: Make tif_nfields and tif_nfieldscompat fields + of the tiff structure have the size_t type instead of uint32. + +2008-04-09 Andrey Kiselev + + * tools/tiffdump.c: Added support for MSVS 6.0. + + * libtiff/tif_dirread.c: Use custom functions _TIFFUInt64ToFloat() + and _TIFFUInt64ToDouble() to convert 64-bit integers into floating + point values on MSVS 6.0 platform. + +2008-03-14 Frank Warmerdam + + * tif_dirread.c: Removed sanity checks on tags larger than 4MB in + TIFFReadDirEntryArray() since they are interfering with seemingly + legitimate files. http://trac.osgeo.org/gdal/ticket/2005 + +2008-02-09 Joris Van Damme + + * tif_dirread.c: Added handling for the case of number of values for + PageNumber tag different from 2 (previously resulted in an assert + indicating lack of handling and was forgotten about) + +2008-02-01 Frank Warmerdam + + * libtiff/tif_jpeg.c: Do not try to fixup subsampling tags based on + the actual jpeg data stream if the first strip/tile has zero size. + This is the case when GDAL creates a new file with zero sizes, closes + and reopens it. + +2008-01-07 Frank Warmerdam + + * tools/tiff2ps.c: fix up 64bit issues (from Edward Lam). + +2008-01-01 Frank Warmerdam + + * libtiff/tif_dirwrite.c: #ifdef out lots of unused functions. + + * Makefile.vc, libtiff/Makefile.vc, tools/Makefile.vc: Improve clean + targets. + + * tools/tiffinfo.c, tools/tiffcmp.c, tools/gif2tiff.c, tools/bmp2tiff.c + tools/tiff2pdf.c: Fix 64-bit warnings when compiling under MSVC 2005 + (x64). + + * tools/tiffset.c: Changes to reflect the fact that TIFFFieldWithTag() + and TIFFFieldWithName() now return TIFFField pointers instead of + TIFFFieldInfo pointers. + + * tools/tiffdump.c: Added ssize_t typedef on Windows since it doesn't + exist. This makes it compile again on Windows + + * tif_aux.c, tif_getimage.c, tif_next.c, tif_predict.c, tif_win32.c, + tiffconf.vc.h: Various 64bit fixes from Edward Lam identified on win64. + + * test/rewrite_tag.c: New test for TIFFRewriteField(). + +2007-12-31 Frank Warmerdam + + * tif_dirwrite.c: Added TIFFRewriteField(). This new function + rewrites one field "on disk" updating an existing directory + entry. Lots of limitations still... + + * tiffiop.h, tif_write.c, tif_dirread.c, tif_flush.c: Keep track of + TIFF_DIRTYSTRIP separately from TIFF_DIRTYDIRECT to indicate that + the strip offset/size values are dirty but nothing else about the + directory is dirty. In flush handle "just stripmaps dirty" as a + special case that just rewrites these values without otherwise + modifying the directory on disk using TIFFRewriteField(). + + We also modify logic so that in update mode the directory is not + marked dirty on read, but only when something is changed. This + means we need to keep track of updates to the stripmap stuff in + TIFFAppendToStrip(). + +2007-12-10 Frank Warmerdam + + * tif_jpeg.c: Improve ability to switch between encoding and decoding + in the jpeg code (gdal bug #2033). + +2007-11-23 Frank Warmerdam + + * tif_dir.c, tif_dirread.c, tif_dirwrite.c, tif_read.c, tif_write.c, + tiffiop.h: Added TIFF_BUF4WRITE flag to indicate if contents of the + rawcp/rawcc buffer are for writing and thus may require flushing. + Necessary to distinguish whether they need to be written to disk when + in mixed read/write mode and doing a mixture of writing followed by + reading. http://trac.osgeo.org/gdal/ticket/1758 + +2007-11-23 Andrey Kiselev + + * configure.com, libtiff/tif_vms.c: Better OpenVMS support. Patches + from Alexey Chupahin. + +2007-11-02 Frank Warmerdam + + * tif_write.c: Rip out the fancy logic in TIFFAppendToStrip() for + establishing if an existing tile can be rewritten to the same location + by comparing the current size to all the other blocks in the same + directory. This is dangerous in many situations and can easily + corrupt a file. (observed in esoteric GDAL situation that's hard to + document). This change involves leaving the stripbytecount[] values + unaltered till TIFFAppendToStrip(). Now we only write a block back + to the same location it used to be at if the new data is the same + size or smaller - otherwise we move it to the end of file. + + * tif_dirwrite.c: Try to avoid writing out a full readbuffer of tile + data when writing the directory just because we have BEENWRITING at + some point in the past. This was causing odd junk to be written out + in a tile of data when a single tile had an interleaving of reading + and writing with reading last. (highlighted by gdal + autotest/gcore/tif_write.py test 7. + + * tif_predict.c: use working buffer in PredictorEncodeTile to avoid + modifying callers buffer. + http://trac.osgeo.org/gdal/ticket/1965 + + * tif_predict.c/h: more fixes related to last item, keeping a + distinct pfunc for encode and decode cases as these were getting + mixed up sometimes. + http://trac.osgeo.org/gdal/ticket/1948 + +2007-11-01 Frank Warmerdam + + * tif_predict.c/h, tif_lzw.c, tif_zip.c: Improvements so that + predictor based encoding and decoding works in read-write update + mode properly. + http://trac.osgeo.org/gdal/ticket/1948 + +2007-10-24 Joris Van Damme + + * tif_dirread.c: Fixed problem with bogus file triggering + assert(td->td_planarconfig == PLANARCONFIG_CONTIG) in + ChopUpSingleUncompressedStrip + +2007-10-22 Joris Van Damme + + * tif_jpeg.c: Resolved buffer incrementation bug that lead to faulty images + at best, access violation at worst, when subsampled JPEG compressed imagery + is decoded without the JPEG_COLORMODE feature + +2007-10-11 Frank Warmerdam + + * html/index.html: Update "people responsible" section. + +2007-10-05 Frank Warmerdam + + * tools/tiff2pdf.c: Fix problem with alpha setting in some cases + as reported on the mailing list. + +2007-10-01 Joris Van Damme + + * changed some more incorrect %lud printf flags to %lu + +2007-09-29 Joris Van Damme + + * tif_dirread.c: Strip chopping interfered badly with uncompressed + subsampled images because it tried to divide subsampled rowblocks, + leading to all sorts of errors throughout the library for these + images. Fixed by making strip chopping divide in row counts that + are a multiple of vertical subsampling value. + +2007-09-28 Joris Van Damme + + * tif_dirread.c: Logical cast working around compiler warning + + * tif_read.c: Correction of some error flags and parameter lists + +2007-09-27 Joris Van Damme + + * tif_dirread.c: Made calculation of td_maxsamplevalue more robust + when dealing with large bitspersample values, shutting up purification + tools that warn about truncation, though it remains incorrect and + indicates a conceptual problem there. + + * tif_open.c: Moved early exit in case of 'h' flag (to disable reading + of first IFD) to proper place because it badly interfered with memory + mapping, resulting in mapping flag even with dummy mapping functions + that returned 0 whilst at the same time the mapping tif_size wasn't + set, thus resulting in continuous incorrect beyond-eof errors. + +2007-09-24 Joris Van Damme + + * tif_dirinfo.c: Fixed (MSVC) compiler reports about + inconsistent use of const in tiffFields and exifFields definition + +2007-09-20 Frank Warmerdam + + * tif_dirwrite.c: Always write tile/strip offsets and sizes + using LONG8 type when output format is BigTIFF. The + TIFFWriteDirectoryTagLongLong8Array() function was restructured + accordingly. + + * tif_dirread.c: Improvements to error reporting text in + TIFFFetchDirectory(). + +2007-09-19 Bob Friesenhahn + + * test/images: Added a small collection of test images for use by + test programs and scripts. + * test/tiffinfo.sh: A trivial example test script. + * test/common.sh: Added small script for setting the environment + used by script-based tests. + +2007-08-24 Frank Warmerdam + + * tif_dirwrite.c: Write the tif_nextdiroff value instead of a fixed + zero when writing directory contents to preserve the ability to + rewrite directories in place, even in the middle of a directory + chain. + + * tif_dirinfo.c: _TIFFMergeFields() now only merges in field + definitions that are missing. Existing definitions are silently + ignored. + + * tif_dirread.c: Add runtime error for fields for which no definition + is found (in addition to an assert for developers) in + TIFFFetchNormalTag(). Not sure if this is needed, but it seems + prudent. + +2007-08-10 Joris Van Damme + + * libtiff/tif_getimage.c: removed SubsamplingHor and SubsamplingVer + from _TIFFRGBAImage structure to revert unwanted ABI change. + +2007-08-10 Joris Van Damme + + * libtiff/tif_win32.c: use SetFilePointer instead of + SetFilePointerEx, as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1580 + +2007-07-19 Andrey Kiselev + + * libtiff/tif_stream.cxx: Put all callback functions declarations + inside extern "C" block. + + * libtiff/{tif_lzw.c, tif_luv.c, tif_dumpmode.c, tif_print.c, + tif_read.c, tif_strip.c, tif_thunder.c}: Use "%I64d" printf() + formatter instead of "%lld" with MSVC compiler. + + * libtiff/{tiffiop.h, tif_aux.c}: Added _TIFFUInt64ToFloat() and + _TIFFUInt64ToDouble() functions. + +2007-07-18 Andrey Kiselev + + * libtiff/tif_dirread.c: Handle the case of MSVC 6 when using 64-bit + integer constants. + + * libtiff/{Makefile.am, Makefile.v}: Do not distribute tiffconf.h, + remove tif_config.h/tiffconf.h during cleaning. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1573 + + * libtiff/tif_unix.c: Do not use O_LARGEFILE. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1577 + +2007-07-13 Andrey Kiselev + + * libtiff 4.0.0alpha released. + +2007-07-12 Andrey Kiselev + + * tools/tiff2pdf.c: Added missed extern optind as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1567 + + * libtiff/{tif_close.c, tif_dirinfo.c, tiffiop.c, tif_dirread.c, + tif_dir.h, tif_dir.c, tiffio.h}: Transition to the new-style tag + extending scheme completed. + +2007-07-11 Bob Friesenhahn + + * libtiff/tif_stream.cxx: Adapt to use toff_t again. Update to + use standard C++ library size types and attempt to detect overflow + cases. + +2007-07-08 Andrey Kiselev + + * libtiff/{tif_jpeg.c, tif_dir.h, tif_dir.c, tif_dirinfo.c, tiffio.h, + tif_ojpeg.c, tif_print.c, tif_fax3.c, tif_dirread.c}: More work on new + tag extending scheme. Use the new scheme everywhere. + + * libtiff/{tif_zip.c, tif_predict.c, tif_pixarlog.c, tif_luv.c, + tif_fax3.c, tif_dirread.c, tif_dirwrite.c, tif_close.c, tif_ojpeg.c, + tif_jpeg.c, tif_dirinfo.c, tif_dir.h, tiffio.h, tiffiop.h}: + TIFFFIeldInfo structure replaced with TIFFField structure. + TIFFFieldInfo retained for the backward compatibility. + +2007-07-05 Bob Friesenhahn + + * tools/tiff2pdf.c: Fix a compile problem when JPEG_SUPPORT is not + defined. + +2007-07-04 Andrey Kiselev + + * libtiff/{tif_dir.c, tiff.h, tiffio.h, libtiff.def}: Unused + TIFFReassignTagToIgnore() function and TIFFIgnoreSense enumeration + removed. + + * libtiff/{tif_dirinfo.c, tif_fax3.c, tif_jbig.c, tif_jpeg.c}: Move + tags TIFFTAG_FAXRECVPARAMS, TIFFTAG_FAXSUBADDRESS, + TIFFTAG_FAXRECVTIME and TIFFTAG_FAXDCS to the common tag directory. + These tags are not codec-specific and relate to image content, so + process them as other normal tags. + + * libtiff/{tiffio.h, tif_dir.h}: TIFFTagValue structure moved from the + public tiffio.h to private tif_dir.h. + + * contrib/{acorn, mac-cw, mac-mpw}: Removed as unmaintained and + outdated. + +2007-07-03 Andrey Kiselev + + * libtiff{tif_acorn.c, tif_apple.c, tif_atari.c, tif_msdos.c, + tif_win3.c}: Obsoleted portability stuff removed. + + * tools/tiff2ps.c: Added support 16-bit images as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1566 + + Patch from William Bader. + + * tools/tiff2pdf.c: Fix for TIFFTAG_JPEGTABLES tag fetching and + significant upgrade of the whole utility as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1560 + + Now we don't need tiffiop.h in tiff2pdf anymore and will open output + PDF file using TIFFClientOpen() machinery as it is implemented + by Leon Bottou. + +2007-06-26 Bob Friesenhahn + + * configure.ac: Fix typo when substituting value for unsigned 8 bit type. + Added support for a TIFF_PTRDIFF_T type to use when doing pointer arithmetic. + Added support for a TIFF_SSIZE_T in order to return memory sizes but still + allow returning -1 for errors. + * libtiff/tiffconf.vc.h: Add porting type defintions for WIN32. + +2007-06-25 Bob Friesenhahn + + * port/strtoull.c: New porting function in case strtoull() is not + available on the target system. + * configure.ac: Add configure support for determining sized types + in a portable way and performing necessary substitutions in + tif_config.h and tiffconf.h. Updated tiff.h to use the new + definitions. + +2007-04-27 Andrey Kiselev + + * tools/tiff2pdf.c: Check the tmpfile() return status as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=154 + +2007-04-07 Andrey Kiselev + + * libtiff/{tif_dir.h, tif_dirread.c, tif_dirinfo.c, tif_jpeg.c, + tif_fax3.c, tif_jbig.c, tif_luv.c, tif_ojpeg.c, tif_pixarlog.c, + tif_predict.c, tif_zip.c}: Finally fix bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1274 + + by introducing _TIFFMergeFieldInfo() returning integer error status + instead of void in case of problems with field merging (e.g., if the + field with such a tag already registered). TIFFMergeFieldInfo() in + public API remains void. Use _TIFFMergeFieldInfo() everywhere and + check returned value. + +2007-04-07 Frank Warmerdam + + * contrib/addtiffo/tif_overview.c: Fix problems with odd sized output + blocks in TIFF_DownSample_Subsampled() (bug 1542). + +2007-04-06 Frank Warmerdam + + * libtiff/tif_jpeg.c: Changed JPEGInitializeLibJPEG() so that it + will convert from decompressor to compressor or compress to decompress + if required by the force arguments. This works around a problem in + where the JPEGFixupTestSubsampling() may cause a decompressor to + be setup on a directory when later a compressor is required with the + force flag set. Occurs with the addtiffo program for instance. + +2007-04-06 Andrey Kiselev + + * tools/tiffcrop.c, man/tiffcrop.1: Significant update in + functionality from Richard Nolde. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1525 + +2007-03-28 Frank Warmerdam + + * libtiff/tif_fax3.c: "inline static" -> "static inline" for IRIC CC. + +2007-03-17 Joris Van Damme + + * start of BigTIFF upgrade - CVS HEAD unstable until further notice + +2007-03-07 Joris Van Damme + + * libtiff/tif_getimage.c: workaround for 'Fractional scanline' error reading + OJPEG images with rowsperstrip that is not a multiple of vertical subsampling + factor. This bug is mentioned in: + http://bugzilla.remotesensing.org/show_bug.cgi?id=1390 + http://www.asmail.be/msg0054766825.html + +2007-03-07 Joris Van Damme + + * libtiff/tif_win32.c: made inclusion of windows.h unconditional + + * libtiff/tif_win32.c: replaced preprocessor indication for consiously + unused arguments by standard C indication for the same + +2007-02-27 Andrey Kiselev + + * libtiff/tif_dirread.c: Use uint32 type instead of tsize_t in byte + counters in TIFFFetchData(). Should finally fix the issue + + http://bugzilla.remotesensing.org/show_bug.cgi?id=890 + +2007-02-24 Andrey Kiselev + + * tools/tiffset.c: Properly handle tags with TIFF_VARIABLE writecount. + As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1350 + + * libtiff/tif_dirread.c: Added special function to handle + SubjectDistance EXIF tag as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1362 + + * tools/tiff2pdf.c: Do not assume inches when the resolution units + do not specified. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1366 + + * tools/{tiffcp.c, tiffcrop.c}: Do not change RowsPerStrip value if + it was set as infinite. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1368 + + * tools/tiffcrop.c, man/tiffcrop.1: New tiffcrop utility contributed + by Richard Nolde. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1383 + +2007-02-22 Andrey Kiselev + + * libtiff/tif_dir.c: Workaround for incorrect TIFFs with + ExtraSamples == 999 produced by Corel Draw. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1490 + + * libtiff/{tif_dirread.c, tif_read.c}: Type of the byte counters + changed from tsize_t to uint32 to be able to work with data arrays + larger than 2GB. Fixes bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=890 + + Idea submitted by Matt Hancher. + +2007-01-31 Andrey Kiselev + + * tools/tif2rgba.c: This utility does not work properly on big-endian + architectures. It was fixed including the bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1149 + +2007-01-15 Mateusz Loskot + + * Submitted libtiff port for Windows CE platform + * libtiff/tif_config.wince.h: Added configuration header for WinCE. + * libtiff/tiffconf.wince.h: Ported old configuration header for WinCE. + * libtiff/tif_wince.c: Added WinCE-specific implementation of some + functons from tif_win32.c. + * libtiff/tif_win32.c: Disabled some functions already reimplemented in tif_wince.c. + * libtiff/tiffiop.h, port/lfind.c: Added conditional include of some + standard header files for Windows CE build. + * tools/tiffinfoce.c: Ported tiffinfo utility for Windows CE. + +2006-11-19 Frank Warmerdam + + * libtiff/tif_write.c: TIFFAppendToStrip() - clear sorted flag if + we move a strip. + http://bugzilla.remotesensing.org/show_bug.cgi?id=1359 + +2006-10-13 Andrey Kiselev + + * libtiff/tif_dir.c: More fixes for vulnerabilities, reported + in Gentoo bug (): + + http://bugs.gentoo.org/show_bug.cgi?id=142383 + + * libtiff/contrib/dbs/xtiff/xtiff.c: Make xtiff utility compilable. + Though it is still far from the state of being working and useful. + +2006-10-12 Andrey Kiselev + + * libtiff/tif_fax3.c: Save the state of printdir codec dependent + method. + + * libtiff/tif_jpeg.c: Save the state of printdir codec dependent method + as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1273 + + * libtiff/tif_win32.c: Fixed problem with offset value manipulation + as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1322 + + * libtiff/{tif_read.c, tif_jpeg.c, tif_dir.c}: More fixes for + vulnerabilities, reported in Gentoo bug (): + + http://bugs.gentoo.org/show_bug.cgi?id=142383 + +2006-09-28 Andrey Kiselev + + * libtiff/{tif_fax3.c, tif_next.c, tif_pixarlog.c}: Fixed multiple + vulnerabilities, as per Gentoo bug (): + + http://bugs.gentoo.org/show_bug.cgi?id=142383 + +2006-09-27 Frank Warmerdam + + * libtiff/tif_lzw.c, libtiff/tif_zip.c: Fixed problems with mixing + encoding and decoding on the same read-write TIFF handle. The LZW + code can now maintain encode and decode state at the same time. The + ZIP code will switch back and forth as needed. + http://bugzilla.remotesensing.org/show_bug.cgi?id=757 + +2006-09-20 Frank Warmerdam + + * libtiff: Rename config.h.vc and tif_config.h.vc to config.vc.h and + tif_config.vc.h for easier identification by folks using an IDE. + +2006-07-25 Frank Warmerdam + + * tif_msdos.c: Avoid handle leak for failed opens. c/o Thierry Pierron + +2006-07-19 Frank Warmerdam + + * tif_dirwrite.c: take care not to flush out buffer of strip/tile + data in _TIFFWriteDirectory if TIFF_BEENWRITING not set. Relates + to bug report by Peng Gao with black strip at bottom of images. + +2006-07-12 Frank Warmerdam + + * tif_dirwrite.c: make sure to use uint32 for wordcount in + TIFFWriteNormanTag if writecount is VARIABLE2 for ASCII fields. + It already seems to have been done for other field types. Needed + for "tiffset" on files with geotiff ascii text. + +2006-07-04 Bob Friesenhahn + + * {configure.ac, libtiff/tif_config.h.vc, libtiff/tif_jbig.c} + (JBIGDecode): jbg_newlen is not available in older JBIG-KIT and + its use does not appear to be required, so use it only when it is + available. + +2006-06-24 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Added missed EXIF tag ColorSpace (40961). + + * libtiff/tif_dirread.c: Move IFD fetching code in the separate + function TIFFFetchDirectory() avoiding code duplication in + TIFFReadDirectory() and TIFFReadCustomDirectory(). + +2006-06-19 Frank Warmerdam + + * tools/tiff2pdf.c: Fix handling of -q values. + http://bugzilla.remotesensing.org/show_bug.cgi?id=587 + +2006-06-17 Frank Warmerdam + + * tif_readdir.c: Added case in EstimateStripByteCounts() for tiled + files. Modified TIFFReadDirectory() to not invoke + EstimateStripByteCounts() for case where entry 0 and 1 are unequal + but one of them is zero. + http://bugzilla.remotesensing.org/show_bug.cgi?id=1204 + +2006-06-08 Andrey Kiselev + + * libtiff/{tif_open.c, tif_dirread.c, tiffiop.h}: Move IFD looping + checking code in the separate function TIFFCheckDirOffset(). + + * libtiff/tif_aux.c: Added _TIFFCheckRealloc() function. + + * tools/tiffcmp.c: Fixed floating point comparison logic as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1191 + + * libtiff/tif_fax3.c: Fixed problems in fax decoder as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1194 + + * tools/tiff2pdf.c: Fixed buffer overflow condition in + t2p_write_pdf_string() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1196 + +2006-06-07 Andrey Kiselev + + * {configure, configure.ac, libtiff/tif_jbig.c, tools/tiffcp.c}: Added + support for JBIG compression scheme (34661 code) contributed by Lee + Howard. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=896 + + * configure, configure.ac: OJPEG support enabled by default. + + * contrib/ojpeg/: Removed. New OJPEG support does not need this patch. + +2006-06-03 Bob Friesenhahn + + * libtiff/{tif_dirinfo.c, tif_print.c} : Fix crash in + TIFFPrintDirectory(). Joris Van Damme authored the fix. + +2006-04-21 Andrey Kiselev + + * tools/tiff2pdf.c: Unified line ending characters (always use '\n') + as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1163 + + * README.vms, Makefile.am, configure.com, libtiff/{Makefile.am, + tif_config.h-vms, tif_stream.cxx, tif_vms.c, tiffconf.h-vms}: + Added support for OpenVMS by Alexey Chupahin, elvis_75@mail.ru. + +2006-04-20 Andrey Kiselev + + * tools/{fax2ps.c, fax2tiff.c, ppm2tiff.c, ras2tiff.c, tiff2pdf.c}: + Properly set the binary mode for stdin stream as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1141 + + * man/{bmp2tiff.1, fax2ps.1, fax2tiff.1, gif2tiff.1, ras2tiff.1, + raw2tiff.1, rgb2ycbcr.1, sgi2tiff.1, tiff2bw.1, tiff2pdf.1, tiff2ps.1, + tiff2rgba.1, tiffcmp.1, tiffcp.1, tiffdither.1, tiffdump.1, tiffgt.1, + tiffset.1}: Improvements in page formatting as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1140 + + * html/tools.html, html/man/Makefile.am, tools/tiff2pdf.c: Fixed + typos as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1139 + +2006-04-18 Frank Warmerdam + + * nmake.opt: use /EHsc for VS2005 compatibility. Also define + _CRT_SECURE_NO_DEPRECATE to avoid noise on VS2005. + +2006-04-12 Joris Van Damme + + * libtiff/tif_getimage.c: Added support for planarconfig separate + non-subsampled YCbCr (i.e. separate YCbCr with subsampling [1,1]) + +2006-04-11 Joris Van Damme + + * libtiff/tif_getimage.c: Revision of all RGB(A) put routines + - Conversion of unassociated alpha to associated alpha now done with + more performant LUT, and calculation more correct + - Conversion of 16bit data to 8bit data now done with + more performant LUT, and calculation more correct + - Bugfix of handling of 16bit RGB with unassociated alpha + +2006-04-11 Joris Van Damme + + * libtiff/tif_getimage.c: + - When there is no alpha, gtTileSeparate and gtStripSeparate allocated + buffer for alpha strile and filled it, only to never read it back. + Removed allocation and fill. + - Minor rename of vars in gtTileSeparate and gtStripSeparate + anticipating planned functionality extension + +2006-04-08 Joris Van Damme + + * libtiff/tif_getimage.c: renamed pickTileContigCase to PickContigCase + and pickTileSeparateCase to PickSeparateCase as both work on strips as + well + + * libtiff/tif_getimage.c: moved img->get selection from + TIFFRGBAImageBegin into PickContigCase and PickSeparateCase to create + logical hook for planned functionality extension + +2006-04-08 Joris Van Damme + + * libtiff/tif_ojpeg.c: resolved memory leak that was a consequence + of inappropriate use of jpeg_abort instead of jpeg_destroy + +2006-04-07 Joris Van Damme + + * libtiff/tif_getimage.c: replaced usage of TIFFScanlineSize in + gtStripContig with TIFFNewScanlineSize so as to fix buggy behaviour + on subsampled images - this ought to get sorted when we feel brave + enough to replace TIFFScanlineSize alltogether + + * libtiff/tif_ojpeg.c: fixed bug in OJPEGReadSkip + +2006-04-04 Joris Van Damme + + * libtiff/tiffio.h: added new type tstrile_t + + * libtiff/tif_dir.h: changed types of td_stripsperimage and td_nstrips + to new tstrile_t, types of td_stripoffset and td_stripbytecount to + toff_t* + + * libtiff/tif_ojpeg.c: totally new implementation + + * libtiff/tif_dirread.c: added several hacks to suit new support of + OJPEG + + * libtiff/tif_getimage.c: removed TIFFTAG_JPEGCOLORMODE handling + of OJPEG images in favor of tif_getimage.c native handling of + YCbCr and desubsampling + +2006-03-29 Frank Warmerdam + + * libtiff/tif_jpeg.c: JPEGVSetField() so that altering the photometric + interpretation causes the "upsampled" flag to be recomputed. Fixes + peculiar bug where photometric flag had to be set before jpegcolormode + flag. + +2006-03-25 Joris Van Damme + + * libtiff/tif_jpeg.c: strip size related bugfix in encode raw + + * libtiff/tif_strip.c: temporarilly added two new versions of + TIFFScanlineSize + - TIFFNewScanlineSize: proposed new version, after all related + issues and side-effects are sorted out + - TIFFOldScanlineSize: old version, from prior to 2006-03-21 change + This needs further sorting out. + +2006-03-25 Joris Van Damme + + * contrib/addtiffo/tif_ovrcache.c: bugfix to correctly pass size + of last truncated strip data to TIFFWriteEncodedStrip + +2006-03-25 Joris Van Damme + + * libtiff/{tif_jpeg.c, tif_strip.c}: bugfix of tif_jpeg decode raw + +2006-03-25 Joris Van Damme + + * libtiff/tif_getimage.c: bugfix/rewrite of putcontig8bitYCbCr22tile + + * libtiff/tif_getimage.c: added putcontig8bitYCbCr12tile + + * libtiff/tif_read.c: added support for new TIFF_NOREADRAW flag to + prepare the path for new tif_ojpeg.c + +2006-03-23 Andrey Kiselev + + * libtiff 3.8.2 released. + + * tools/Makefile.am: Use runtime paths linker flags when rpath + option enabled. + +2006-03-21 Andrey Kiselev + + * libtiff/libtiff.def: Added missed exports as per bug + http://bugzilla.remotesensing.org/attachment.cgi?id=337 + + * contrib/addtiffo/Makefile.vc, libtiff/Makefile.vc, port/Makefile.vc, + tools/Makefile.vc: Makefiles improvements as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1128 + + * nmake.opt libtiff/{tif_config.h.vc, tif_unix.c, tiffio.h}, + tools/{fax2ps.c, fax2tiff.c, tiff2pdf.c}: Fixed win32 I/O functions + usage as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1127 + + * libtiff/tif_strip.c: Take subsampling in account when calculating + TIFFScanlineSize(). + + * tools/tiffcp.c: Do not set RowsPerStrip bigger than image length. + +2006-03-17 Andrey Kiselev + + * tools/fax2tiff.c: Fixed wrong TIFFerror() invocations as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1125 + + * tools/fax2ps.c: Fixed reading the input stream from stdin as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1124 + +2006-03-16 Andrey Kiselev + + * libtiff/tiffiop.h: Added decalration for + _TIFFSetDefaultCompressionState(). + + * libtiff/{tif_jpeg.c, tif_fax3.c, tif_zip.c, tif_pixarlog.c, + tif_lzw.c, tif_luv.c}: Use _TIFFSetDefaultCompressionState() in all + codec cleanup methods. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1120 + +2006-03-15 Andrey Kiselev + + * libtiff/tif_jpeg.c: Do not cleanup codec state in TIFFInitJPEG(). As + per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1119 + + * tools/raw2tiff.c: Do not set RowsPerStrip larger than ImageLength. + As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1110 + + * libtiff/tiffiop.h: dblparam_t typedef removed; GLOBALDATA macro + removed; move here the STRIP_SIZE_DEFAULT macro definition. + + * libtiff/{tif_dirread.c, tif_strip.c}: Removed STRIP_SIZE_DEFAULT + macro definition. + + * libtiff/tif_dir.c: Use double type instead of dblparam_t. + +2006-03-14 Andrey Kiselev + + * libtiff/tif_dirread.c: Do not check the PlanarConfig tag presence + in TIFFReadDirectory, because it is always set at the start of + function and we allow TIFFs without that tag set. + +2005-03-13 Andrey Kiselev + + * libtiff 3.8.1 released. + +2006-03-07 Andrey Kiselev + + * libtiff/tif_dirread.c: Fixed error reporting in TIFFFetchAnyArray() + function as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1102 + + * libtiff/tif_dirread.c: More wise check for integer overflow + condition as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1102 + + * libtiff/{tif_jpeg.c, tif_pixarlog.c, tif_fax3.c, tif_zip.c}: + Properly restore setfield/getfield methods in cleanup functions. As + per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1102 + +2006-03-03 Andrey Kiselev + + * libtiff/{tif_predict.c, tif_predict.h}: Added new function + TIFFPredictorCleanup() to restore parent decode/encode/field methods. + + * libtiff/{tif_lzw.c, tif_pixarlog.c, tif_zip.c}: Use + TIFFPredictorCleanup() in codec cleanup methods. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1102 + + * libtiff/tif_dirread.c: Fixed integer overflow condition in + TIFFFetchData() function. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1102 + +2006-03-01 Andrey Kiselev + + * libtiff/tif_ojpeg.c: Set the ReferenceBlackWhite with the + TIFFSetField() method, not directly. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1043 + + * tools/ppm2tiff.c: Added support for PBM files as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1044 + +2006-02-27 Andrey Kiselev + + * libtiff/tif_write.c: Small code rearrangement in TIFFWriteScanline() + to avoid crash as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1081. + +2006-02-26 Andrey Kiselev + + * tools/tiff2pdf.c: Functions t2p_sample_rgbaa_to_rgb() and + t2p_sample_rgba_to_rgb() was used in place of each other, that was + resulted in problems with RGBA images with associated alpha. + As per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1097 + +2006-02-23 Andrey Kiselev + + * libtiff/tif_dirwrite.c: Properly write TIFFTAG_DOTRANGE tag as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1088. + + * libtiff/tif_print.c: Properly read TIFFTAG_PAGENUMBER, + TIFFTAG_HALFTONEHINTS, TIFFTAG_YCBCRSUBSAMPLING and TIFFTAG_DOTRANGE + tags as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1088. + + * tools/tiff2ps.c: Properly scale all the pages when converting + multipage TIFF with /width/height/center options set. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1080 + +2006-02-15 Andrey Kiselev + + * tools/tiff2pdf.c: Do not create output file until all option checks + will be done. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1072 + + * tools/bmp2tiff.c: Added ability to create multipage TIFFs from the + list of input files as per bug: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1077 + +2006-02-09 Andrey Kiselev + + * libtiff/tif_tile.c: Fix error reporting in TIFFCheckTile() as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1063. + + * tools/tiffgt.c: Avoid crashing in case of image unsupported by + TIFFRGBAImage interface. + + * libtiff/tif_color.c: Avoid overflow in case of wrong input as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1065. + +2006-02-07 Frank Warmerdam + + * tools/tiff2pdf.c: Fixed support for non-YCbCr encoded JPEG + compressed TIFF files, per submission from Dan Cobra. + +2006-02-07 Andrey Kiselev + + * libtiff/{tif_dirread.c, tif_packbits.c, tif_win32.c}: Properly + cast values to avoid warnings. As per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1033. + + * libtiff/tif_dirinfo.c: Use TIFF_NOTYPE instead of 0 when + appropriate. As per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1033. + + * libtiff/tif_aux.c: Fixed type of temporary variable in + _TIFFCheckMalloc() as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=1033. + +2006-02-06 Andrey Kiselev + + * libtiff/tif_aux.c: Return static array when fetching default + YCbCrCoefficients (another problem, reported a the + http://bugzilla.remotesensing.org/show_bug.cgi?id=1029 entry). + +2006-02-03 Andrey Kiselev + + * libtiff/tif_dir.c: Special handling for PageNumber, HalftoneHints, + YCbCrSubsampling and DotRange tags as per bugs + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1029 + http://bugzilla.remotesensing.org/show_bug.cgi?id=1034 + + * libtiff/tif_dirread.c: Use _TIFFGetExifFieldInfo() instead of + _TIFFGetFieldInfo() in TIFFReadEXIFDirectory() call as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1026. + +2006-01-23 Andrey Kiselev + + * libtool related stuff updated from the 2.1a branch. + +2006-01-11 Frank Warmerdam + + * tools/bmp2tiff,pal2rgb,ppm2tiff,ras2tiff,raw2tiff,sgi2tiff, + tiff2bw,tiffcp: Fixed jpeg option processing so -c jpeg:r:50 works + properly as per bug: + http://bugzilla.remotesensing.org/show_bug.cgi?id=1025 + +2006-01-09 Bob Friesenhahn + + * configure.ac: Fix with_default_strip_size comparison as reported + by Norihiko Murase. + +2006-01-08 Bob Friesenhahn + + * test/Makefile.am (LIBTIFF): Due to linking against libtiff + incorrectly, tests were not actually testing the uninstalled + libtiff. Now they are. + +2006-01-04 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Change definitions for TIFFTAG_ICCPROFILE, + TIFFTAG_PHOTOSHOP, TIFFTAG_RICHTIFFIPTC, TIFFTAG_XMLPACKET: readcount + should be uint32 value. + +2006-01-02 Bob Friesenhahn + + * html/man/Makefile.am (htmldoc): Fix htmldoc rule so that it can + be used if build directory is not the same as source directory. + * man/{TIFFGetField.3tiff, TIFFSetField.3tiff}: Documented + TIFFTAG_PHOTOSHOP, TIFFTAG_RICHTIFFIPTC, and TIFFTAG_XMLPACKET, + and re-sorted tag names in alphabetical order. + +2005-12-29 Andrey Kiselev + + * libtiff 3.8.0 released. + +2005-12-28 Bob Friesenhahn + + * tools/bmp2tiff.c (main): Fixed warning regarding returning + inconsistent types from a condition. + * tools/tiffcmp.c (CheckLongTag): Eliminate warning due to printf + format. + * tools/bmp2tiff.c: Reduce compilation warnings on big-endian CPUs. + +2005-12-28 Joris Van Damme + + * html/{index.html, support.hml, libtiff.html}: Cleaned up HTML + +2005-12-27 Andrey Kiselev + + * libtiff/tiffio.h: Added VC_EXTRALEAN definition before including + windows.h, to reduce the compile time. + +2005-12-26 Bob Friesenhahn + + * libtiff/tif_jpeg.c: Improve compilation under MinGW. + +2005-12-26 Andrey Kiselev + + * libtiff/{tif_dir.c, tif_dir.h, tif_dirread.c, tif_dirinfo.c}: + tiffFieldInfo and exifFieldInfo arrays definitions moved back to + tif_dirinfo.c; added _TIFFGetFieldInfo() and _TIFFGetExifFieldInfo() + private functions to retrieve FieldInfo arrays. + +2005-12-24 Bob Friesenhahn + + * html/build.html: Added some additional instructions for when + building using MSVC under Windows. Also fixed two HTML syntax + errors and used HTML Tidy to tidy up the HTML syntax and + formatting. + +2005-12-24 Andrey Kiselev + + * libtiff/{tif_aux.c, tif_dir.c, tif_dir.h, tif_dirwrite.c, + tif_print.c, tif_getimage.c}: Make InkSet, NumberOfInks, DotRange and + StoNits tags custom. + +2005-12-23 Andrey Kiselev + + * libtiff/{tif_aux.c, tif_dir.c, tif_dir.h, tif_print.c}: Make + WhitePoint tag custom. + + * libtiff/{tif_dir.h, tiff.h}: More EXIF tags added. + +2005-12-23 Joris Van Damme + + * libtiff/tiffio.h: fixed typo that potentially resulted in + redefininition of USE_WIN32_FILEIO + + * libtiff/*: Added more 'dual-mode' error handling: Done TIFFWarning + calls in core LibTiff. + +2005-12-21 Andrey Kiselev + + * libtiff/{tif_dir.c, tif_dir.h, tif_print.c}: Make RichTIFFIPTC, + Photoshop and ICCProfile tags custom. + +2005-12-21 Joris Van Damme + + * libtiff/*, contrib/*: Added 'dual-mode' error handling, enabling + newer code to get context indicator in error handler and still + remain compatible with older code: Done TIFFError calls everywhere + except in tools + +2005-12-20 Andrey Kiselev + + * tools/tiffcp.c: Added many error reporting messages; fixed integer + overflow as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=789 + +2005-12-16 Frank Warmerdam + + * contrib/addtiffo/*: Major upgrade by Joris to support subsampled + YCbCr images in jpeg compressed TIFF files. + +2005-12-14 Andrey Kiselev + + * tools/tiffcp.c: Return non-zero status when reading fails (again). + +2005-12-13 Andrey Kiselev + + * tools/tiffcp.c: Return non-zero status when reading fails. + +2005-12-12 Andrey Kiselev + + * libtiff/{tif_dir.h, tiff.h}: Added more EXIF tags. + +2005-12-09 Andrey Kiselev + + * libtiff/{tif_dir.c, tif_dir.h, tif_print.c}: Make XMLPacket tag + custom. + + * tools/tiffinfo.c: Print EXIF directory contents if exist. + + * libtiff/tiff.h: Few EXIF tag numbers added. + + * libtiff/{tif_dirinfo.c, tif_dirread.c, tif_dir.h, tif_dir.c, + tiffio.h}: Preliminary support to read custom directories. New + functions: TIFFReadCustomDirectory() and TIFFReadEXIFDirectory(). + +2005-12-07 Andrey Kiselev + + * libtiff/{tif_dirinfo.c, tif_dirread.c, tif_dir.h, tif_dir.c}: + More work to implement custom directory read support. + + * libtiff/{tif_aux.c, tif_dirinfo.c, tif_dirread.c, tif_dir.h, + tif_dir.c, tif_print.c}: Make YCbCrCoefficients and ReferenceBlackWhite + tags custom. + +2005-12-05 Andrey Kiselev + + * libtiff/tif_dirread.c: One more workaround for broken + StripByteCounts tag. Handle the case when StripByteCounts array filled + with completely wrong values. + +2005-11-30 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Release file descriptor in case of failure + in the TIFFOpenW() function as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1003 + + * libtiff/tif_dirinfo.c: Correctly yse bsearch() and lfind() + functions as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1008 + +2005-11-20 Frank Warmerdam + + * tif_open.c, tiff.h, tiffdump.c: Incorporate preliminary support + for MS MDI format. + http://bugzilla.remotesensing.org/show_bug.cgi?id=1002 + + * .cvsignore: many files added, and a few update according + to suggestion of Brad HArds on tiff mailing list. + +2005-11-03 Frank Warmerdam + + * libtiff/libtiff.def, tiffiop.h, tiffio.h: Made TIFFFreeDirectory + public. + +2005-10-31 Andrey Kiselev + + * tools/fax2tiff.c: Properly calculate sizes of temporary arrays + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=943 + + * tools/fax2tiff.c: Added option '-r' to set RowsPerStrip parameter + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=944 + + * tools/tiffdump.c: Fixed typeshift and typemask arrays initialization + problem as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=946 + + * tools/bmp2tiff.c: Fixed possible integer overflow error as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=965 + + * libtiff/tif_dirinfo.c: Make XResolution, YResolution and + ResolutionUnit tags modifiable during write process. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=977 + + * tools/tiffsplit.c: Copy fax related fields over splitted parts + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=983 + +2005-10-21 Frank Warmerdam + + * tif_dirread.c: Don't try and split single strips into "0" strips + in ChopUpSingleUncompressedStrip. This happens in some degenerate + cases (like 1x1 files with stripbytecounts==0 (gtsmall.jp2 embed tiff) + +2005-10-20 Joris Van Damme + + * tif_fax3.c: changed 'at scanline ...' style warning/errors + with incorrect use of tif_row, to 'at line ... of + strip/tile ...' style + +2005-10-15 Frank Warmerdam + + * tif_write.c: fixed setting of planarconfig as per bug report + on the mailing list from Joris. + +2005-10-07 Andrey Kiselev + + * configure.ac, configure, nmake.opt, libtiff/{tif_config.h, + tif_dirread.c}: Make the default strip size configurable via the + --with-default-strip-size and STRIP_SIZE_DEFAULT options. + +2005-09-30 Bob Friesenhahn + + * html/support.html: Fixed link to documentation on Greg Ward's + LogLuv TIFF format. + +2005-09-28 Andrey Kiselev + + * tools/tiffdump.c: Fixed crash when reading malformed tags. + +2005-09-20 Andrey Kiselev + + * tools/tiff2pdf.c: Added missed 'break' statement as per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=932 + +2005-09-12 Andrey Kiselev + + * libtiff 3.7.4 released. + + * {configure, configure.ac, Makefile.am, autogen.sh}: Applied patch + from Patrick Welche (all scripts moved in the 'config' and 'm4' + directories). + +2005-09-12 Frank Warmerdam + + * libtiff/tif_open.c: reintroduce seek to avoid problem on solaris. + +2005-09-05 Frank Warmerdam + + * libtiff/tif_dir.c: When prefreeing tv->value in TIFFSetFieldV + also set it to NULL to avoid double free when re-setting custom + string fields as per: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=922 + +2005-08-12 Frank Warmerdam + + * libtiff/tif_print.c: avoid signed/unsigned warning. + + * libtiff/tif_dirread.c: removed unused variable. + +2005-07-30 Frank Warmerdam + + * libtiff/tif_dir.c: Fixed up support for swapping "double complex" + values (128 bits as 2 64 bits doubles). GDAL gcore tests now + pass on bigendian (macosx) system. + +2005-07-28 Andrey Kiselev + + * libtiff/{tif_aux.c, tif_dirread.c, tif_fax3.c, tiffiop.h}: Rename + CheckMalloc() function to _TIFFCheckMalloc() and make it available + globally as an internal helper routine. + +2005-07-27 Andrey Kiselev + + * libtiff/tif_dir.c: More improvements in the "pass by value" part of + the custom tags handling code. + +2005-07-26 Andrey Kiselev + + * libtiff/{tif_dirread.c, tif_dirinfo.c}: Do not upcast BYTEs to + SHORTs in the TIFFFetchByteArray(). Remove TIFFFetchExtraSamples() + function, use TIFFFetchNormalTag() instead as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=831 + + Remove TIFFFetchExtraSamples() function, use TIFFFetchNormalTag() + instead. + + * libtiff/tiffconf.h.in: One more attempt to fix the AIX bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + +2005-07-25 Andrey Kiselev + + * libtiff/tif_print.c: Fixed printing of the BYTE and SBYTE arrays. + + * tools/tiffdump.c: Added support for TIFF_IFD datatype. + +2005-07-21 Andrey Kiselev + + * libtiff/tif_write.c: Do not check the PlanarConfiguration field in + the TIFFWriteCheck() function in case of single band images (as per + TIFF spec). + +2005-07-12 Andrey Kiselev + + * SConstruct, libtiff/SConstruct: Added the first very preliminary + support for SCons software building tool (http://www.scons.org/). + This is experimental infrastructure and it will exist along with the + autotools mechanics. + +2005-07-07 Andrey Kiselev + + * port/{getopt.c, strcasecmp.c, strtoul.c}: Update modules from + the NetBSD source tree (the old 4-clause BSD license changed to + the new 3-clause one). + + * configure.ac, port/lfind.c, libtiff/tiffiop.h: Added lfind() + replacement module. + + * port/dummy.c: Make the dummy function static. + +2005-07-06 Andrey Kiselev + + * tools/tiffcp.c: Fixed WhitePoint tag copying. + + * libtiff/{tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_print.c}: + Make FieldOfViewCotangent, MatrixWorldToScreen, MatrixWorldToCamera, + ImageFullWidth, ImageFullLength and PrimaryChromaticities tags custom. + +2005-07-04 Andrey Kiselev + + * libtiff 3.7.3 released. + + * configure, configure.ac: Do not use empty -R option when linking + with --enable-rpath. + +2005-07-01 Andrey Kiselev + + * libtiff/{tiffiop.h, tif_open.c}: Added open option 'h' to avoid + reading the first IFD when needed. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=875 + + * libtiff/tif_color.c: Better use of TIFFmin() macro to avoid side + effects. + +2005-06-23 Andrey Kiselev + + * tools/tiff2pdf.c: Print two characters per loop in the + t2p_write_pdf_trailer(). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=594 + + * tools/tiffgt.c: Use MacOS X OpenGL framework when appropriate. As + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=844 + + * acinclude.m4: Updated to latest OpenGL test macros versions. + + * libtiff/tiff.h: Use correct int size on Sparc 64bit/Sun compiler + platform. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=855 + +2005-06-14 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Added support for ClipPath, XClipPathUnits + and YClipPathUnits tags. + +2005-06-07 Andrey Kiselev + + * contrib/addtiffo/tif_ovrcache.c: Properly extract tile/strip size; + use pixel sized shift in contigous case. + +2005-06-06 Andrey Kiselev + + * contrib/addtiffo/{tif_overview.c, tif_ovrcache.c, tif_ovrcache.h}: + Make overviews working for contiguos images. + +2005-06-03 Andrey Kiselev + + * libtiff/tif_open.c: Replace runtime endianess check with the compile + time one. + + * libtiff/tif_predict.c: Floating point predictor now works on + big-endian hosts. + +2005-06-01 Andrey Kiselev + + * libtiff/tif_dir.c: Use _TIFFsetString() function when read custom + ASCII values. + + * libtiff/{tif_dirinfo.c, tif_dir.h, tif_dir.c, tif_print.c}: Make + DocumentName, Artist, HostComputer, ImageDescription, Make, Model, + Copyright, DateTime, PageName, TextureFormat, TextureWrapModes and + TargetPrinter tags custom. + + * libtiff/tif_jpeg.c: Cleanup the codec state depending on + TIFF_CODERSETUP flag (to fix memry leaks). + + * libtiff/tif_jpeg.c: Initialize JPEGTables array with zero after + allocating. + +2005-05-26 Andrey Kiselev + + * configure.ac, libtiff/Makefile.am: Added workaround for + OpenBSD/MirOS soname problem as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=838 + + * libtiff/tif_dirwrite.c: Use tdir_count when calling + TIFFCvtNativeToIEEEDouble() in the TIFFWriteDoubleArray() function as + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=845 + +2005-05-25 Andrey Kiselev + + * tools/ppm2tiff.c: Fixed format string when read PPM file header with + the fscanf() function. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=861 + + * libtiff/{tif_dirinfo.c, tif_print.c}: TIFFFetchByteArray() returns + uint16 array when fetching the BYTE and SBYTE filds, so we should + consider result as pointer to uint16 array and not as array of chars. + As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=831 + + * libtiff/tif_dir.c: More efficient custom tags retrieval as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=830 + + * libtiff/tif_win32.c: Use FILE_SHARE_READ | FILE_SHARE_WRITE share + mode in CreateFile() call as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=829 + + * libtiff/Makefile.am: Fixed parallel compilation of the libtiff and + libtiffxx libraries as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=826 + + * contrib/addtiffo/{tif_overview.c, tif_ovrcache.h}: Sinchronized with + GDAL. + +2005-05-23 Frank Warmerdam + + * libtiff/tif_jpeg.c: Substantial fix for addtiffo problems with + JPEG encoded TIFF files. Pre-allocate lots of space for jpegtables + in directory. + +2005-05-22 Frank Warmerdam + + * libtiff/tif_dirread.c: Changed the code that computes + stripbytecount[0] if it appears bogus to ignore if stripoffset[0] is + zero. This is a common case with GDAL indicating a "null" tile/strip. + +2005-05-17 Andrey Kiselev + + * tools/tiffsplit.c: Check for JPEGTables tag presence before copying. + +2005-05-06 Frank Warmerdam + + * libtiff/tif_dirread.c: Applied similar change to + TIFFFetchPerSampleLongs and TIFFFetchPerSampleAnys. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=843 + + * libtiff/tif_jpeg.c: added LIB_JPEG_MK1 support in JPEGDecodeRaw(). + +2005-05-06 Andrey Kiselev + * tools/tiff2pdfr.c, man/tiff2pdf.1: Calculate the tile width properly; + added new option '-b' to use interpolation in output PDF files (Bruno + Ledoux). + +2005-05-05 Frank Warmerdam + + * libtiff/tif_dirread.c: Ensure that broken files with too many + values in PerSampleShorts work ok instead of crashing. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=843 + +2005-04-27 Andrey Kiselev + + * tools/tiffdither.c: Copy the PhotometricInterpretation tag from the + input file. + +2005-04-15 Andrey Kiselev + + * libtiff/tif_predict.c: Added ability to encode floating point + predictor, as per TIFF Technical Note 3. + +2005-04-14 Andrey Kiselev + + * libtiff/{tif_predict.h, tif_predict.c}: Added ability to decode + floating point predictor, as per TIFF Technical Note 3. + +2005-04-13 Andrey Kiselev + + * libtiff/{tiffio.h, tiffiop.h, tif_dir.c, tif_read.c, tif_swab.c}: + Added _TIFFSwab24BitData() and TIFFSwabArrayOfLong() functions used to + swap 24-bit floating point values. + + * libtiff/tiff.h: Added predictor constants. + +2005-04-08 Andrey Kiselev + + * libtiff/{tiffiop.h, tif_dir.c}: Use uint32 type for appropriate + values in _TIFFVSetField() function. Inspired by the bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=816 + + * man/TIFFSetField.3tiff: Fixed definition of the TIFFTAG_INKNAMES tag + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=816 + +2005-03-30 Andrey Kiselev + + * libtiff/tif_open.c: Do not read header in case the output file + should be truncated (Ron). + + * libtiff/{tif_dirinfo.c, tif_config.h.vc}: Use lfind() instead + of bsearch() in _TIFFFindFieldInfoByName() function (Ron). + + * libtiff/{tiff.h, tif_dirinfo.c}: Fixes in EXIF tag ordering (Ron). + +2005-03-22 Andrey Kiselev + + * configure.ac, libtiff/Makefile.am: Use libtool machinery to pass + rpath option. + +2005-03-21 Andrey Kiselev + + * libtiff/{tif_dir.c, tif_print.c}: Handle all data types in custom + tags. + +2005-03-18 Andrey Kiselev + + * libtiff/dirinfo.c: Added DNG tags. + + * libtiff/{tif_dir.c, tif_print.c}: More improvements in custom tag + handling code. + + * libtiff/tiff.h: More comments; added missed DNG tag (LensInfo); + added DNG 1.1.0.0 tags. + + * tools/tif2pdf.c: Fixed problem with alpha channel handling as per + bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=794 + + * man/TIFFGetField.3tiff: Add a note about autoregistered tags. + +2005-03-17 Andrey Kiselev + + * nmake.opt: Build with Win32 CRT library by default. + + * tools/tiff2ps.c: Fixed typo in page size handling code. + + * libtiff/{tif_dir.c, tif_print.c}: Support for custom tags, passed + by value. + + * libtiff/{tiff.h, tif_dirinfo.c, tiffiop.h}: Added EXIF related tags. + +2005-03-15 Andrey Kiselev + + * libtiff 3.7.2 released. + +2005-03-09 Andrey Kiselev + + * tools/tiffcmp.c: Added ability to compare the 32-bit integer and + floating point data; complain on unsupported bit depths. + +2005-03-05 Andrey Kiselev + + * tif_stream.cxx: Use ios namespace instead of ios_base to support + GCC 2.95. + + * libtiff/{tiff.h, tif_fax3.tif, tif_jpeg.c}: Applied correct patch from + Lee Howard for HylaFax DCS tag + (see http://bugzilla.remotesensing.org/show_bug.cgi?id=771) + +2005-03-04 Andrey Kiselev + + * configure, configure.ac: Use -rpath option instead of -R as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=732 + + * libtiff/{tiff.h, tif_fax3.tif, tif_jpeg.c}: Applied patch from Lee + Howard to support a new tag TIFFTAG_FAXDCS (34911) used in HylaFax + software. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=771 + + * nmake.opt, html/build.html: Add more comments, change the config + file organization a bit as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=764 + + * tools/tiffcmp.c: Use properly sized buffer in short arrays comparison + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=785 + +2005-03-03 Andrey Kiselev + + * libtiff/tif_dirread.c: More logic to guess missed strip size as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=705 + + * tools/fax2ps.c: Replace insecure mktemp() function with the + tmpfile() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=786 + +2005-02-04 Andrey Kiselev + + * libtiff/tiff.h: Changed the int8 definition to be always signed char + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=727 + + * libtiff/tiffio.h: Move TIFFOpenW() function into the extern "C"{} + block as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=763 + +2005-02-03 Bob Friesenhahn + + * tools/tiffgt.c: Fix problem on big-endian CPUs so that images + display more correctly. Images display brighter than they should + on a Sun workstation. + +2005-02-03 Andrey Kiselev + + * libtiff/tif_dirread.c: Estimate strip size in case of wrong or + suspicious values in the tags. As per bugs + + http://bugzilla.remotesensing.org/show_bug.cgi?id=705 + + and + + http://bugzilla.remotesensing.org/show_bug.cgi?id=320 + + * tools/tiff2ps.c: Fixed problem with page sizes as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=742 + +2005-01-31 Bob Friesenhahn + + * libtiff/tiff.h (TIFFTAG_TILEWIDTH): Corrected description. + (TIFFTAG_TILELENGTH): Corrected description. + +2005-01-30 Andrey Kiselev + + * configure.ac: Fixes for --with-docdir option as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=759 + + * libtiff/tif_open.c: Remove unnesessary TIFFSeekFile() call as per + bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=756 + + * libtiff/tif_stream.cxx: Fixes for C++ stream interface from + Michael Rinne and Edward Lam. + +2005-01-15 Andrey Kiselev + + * configure.ac: Make the documentation directory location configurable + via the --with-docdir option (as suggested by Jeremy C. Reed). + + * libtiff/tif_color.c: Use double as the second argument of pow() + function in TIFFCIELabToRGBInit(). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=741 + + * libtiff/tif_pixarlog.c: Avoid warnings when converting float to + integer as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=740 + + * libtiff/tif_getimage.c: Always fill the error message buffer in + TIFFRGBAImageBegin() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=739 + +2005-01-12 Andrey Kiselev + + * libtiff/tif_jpeg.c: Added ability to read/write the fax specific + TIFFTAG_FAXRECVPARAMS, TIFFTAG_FAXSUBADDRESS and TIFFTAG_FAXRECVTIME + tags as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=736 + + * libtiff/tif_win32.c: Fixed message formatting in functions + Win32WarningHandler() and Win32ErrorHandler() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=735 + + * tools/tiff2ps.c: Interpret the -w and -h options independently. As + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=689 + +2005-01-11 Andrey Kiselev + + * libtiff/tiffio.h: Move the color conversion routines in the 'extern + "C"' section as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=727 + + * libtiff/tiff.h: Restore back the workaround for AIX Visual Age C + compiler to avoid double definition of BSD types as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + + * libtiff/Makefile.am: Place the C++ stream API in the separate + library called libtiffxx to avoid unneeded dependencies. Probably + there will be more C++ API in the future. As per bugs + + http://bugzilla.remotesensing.org/show_bug.cgi?id=733 + + and + + http://bugzilla.remotesensing.org/show_bug.cgi?id=730 + +2005-01-05 Andrey Kiselev + + * tools/tiffdump.c: Fixed problem when read broken TIFFs with the + wrong tag counts (Dmitry V. Levin, Martin Pitt). + + * configure.ac: Replace --disable-c++ with the --disable-cxx option as + per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=730 + +2004-12-25 Andrey Kiselev + + * libtiff/tif_getimage.c: More fixes for multiple-alpha-channelled + RGB-images as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=713 + + + * tools/tiffset.c: Convert character option to integer value as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=725 + +2004-12-20 Andrey Kiselev + + * libtiff 3.7.1 released. + + * html/tiffset.1.html: Add missed manual page as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=678 + + * libtiff/tiff.h: Revert back libtiff data type definitions as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=687 + +2004-12-19 Andrey Kiselev + + * libtiff/tif_dirread.c: Do not forget about TIFF_VARIABLE2 when + checking for tag count in TIFFReadDirectory() function. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=713 + + * libtiff/{tif_dirread.c, tif_fax3.c}: More argument checking in + CheckMallock() function. + + * libtiff/tif_getimage.c: Support for multiple-alpha-channelled + RGB-images as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=718 + +2004-12-15 Frank Warmerdam + + * libtiff/tif_getimage.c: #define A1 bracketing for clean build on + SunPro compiler. + +2004-12-11 Bob Friesenhahn + + * autogen.sh: aclocal and autoheader should be executed after + libtoolize. Also add '-I .' to aclocal invocation to check + current directory for macros. + +2004-12-10 Andrey Kiselev + + * libtiff/tif_dirwrite.c: Always write TIFFTAG_SUBIFD using LONG type + as per bugs + + http://bugzilla.remotesensing.org/show_bug.cgi?id=703 + + and + + http://bugzilla.remotesensing.org/show_bug.cgi?id=704 + +2004-12-04 Andrey Kiselev + + * nmake.opt: Link with the user32.lib in windowed mode. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=697 + + * libtiff/tif_win32.c: Use char* strings instead of TCHAR in windowed + mode as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=697 + + * libtiff/tif_config.in.vc: Removed unneded definitions for + read/open/close/lseek functions to fix the + + http://bugzilla.remotesensing.org/show_bug.cgi?id=680 + +2004-12-03 Andrey Kiselev + + * libtiff/{tif_dir.c, tif_dirread.c}: Remove TIFFReassignTagToIgnore() + call from the TIFFReadDirectory() function. TIFFReassignTagToIgnore + must be removed in the future, as it was never used properly. As per + bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=692 + +2004-11-30 Bob Friesenhahn + + * libtiff/tif_jpeg.c: Added a work-around in order to allow + compilation with the heavily modified version of libjpeg delivered + with Cygwin. + +2004-11-29 Andrey Kiselev + + * libtiff/tif_dir.c: Properly handle tags, which have the uint32 + counts. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=693 + + * tools/fax2ps.c: Be able to extract the first page (#0). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=690 + +2004-11-28 Andrey Kiselev + + * libtiff/tif_unix.c: Make UNIX module compilable (and usable) + on Windows. + + * nmake.opt: Add missed DLLNAME variable. + +2004-11-26 Frank Warmerdam + + * libtiff/makefile.vc: make it easier to rename the libtiff DLL. + +2004-11-24 Andrey Kiselev + + * man/libtiff.3tiff: Improvements in the "LIST OF ROUTINES" table as + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=545 + + * man/tiffset.1: Added manual page for tiffset tool written by Jay + Berkenbilt. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=678 + +2004-11-23 Frank Warmerdam + + * libtiff/tif_error.c: fixed TIFFerror call to be TIFFError. + +2004-11-21 Frank Warmerdam + + * html/document.html: Updated Adobe web links as per email from Joris. + +2004-11-21 Andrey Kiselev + + * libtiff/{tiffio.hxx, tiffio.h}: C++ stream interface moved to new + file tiffio.hxx. We don't have any C++ in tiffio.h, those who want to + use C++ streams should #include . + +2004-11-13 Andrey Kiselev + + * libtiff/tiff.h: Added Adobe DNG tags. + + * libtiff/tif_win32.c: Typo fixed. + + * libtiff/{tif_stream.cxx, tiffio.h}: C++ stream interface updated to + be compliant with the latest standard. Appropriate additions in + makefiles now completed. + +2004-11-11 Andrey Kiselev + + * tools/tiffset.c, libtiff/tif_dirinfo.c: Properly handle the + different tag types. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=600 + +2004-11-10 Andrey Kiselev + + * libtiff/tif_aux.c: Set the appropriate ReferenceBlackWhite array for + YCbCr image which lacks that tag (noted by Hans Petter Selasky). + +2004-11-09 Andrey Kiselev + + * libtiff/tif_color.c: Division by zero fixed (Hans Petter Selasky). + +2004-11-07 Andrey Kiselev + + * libtiff/{tif_stream.cxx, tiffio.h}: Added C++ stream interface + contributed by Edward Lam (see + http://bugzilla.remotesensing.org/show_bug.cgi?id=654 for details). + Though no changes in any makefiles yet. + +2004-11-05 Frank Warmerdam + + * libtiff/tif_open.c: Removed close() in TIFFClientOpen() if file + is bad. This is the callers responsibility. + http://bugzilla.remotesensing.org/show_bug.cgi?id=651 + +2004-11-05 Andrey Kiselev + + * libtiff/{tiffio.h, tif_win32.c, libtiff.def}: Added TIFFOpenW() + function to work with the double byte strings (used to represent + filenames in some locales). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=625 + + * libtiff/tif_dirread.c: Fixed problem when fetching BitsPerSample and + Compression tags of type LONG from broken TIFFS as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=662 + + * libtiff/tif_dirinfo.c: Fixed definition for TIFFTAG_RICHTIFFIPTC, + the writecount should have uint32 type. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=662 + + * libtiff/tif_write.c: Fixed wrong if() statement in + TIFFAppendToStrip() function as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=660 + +2004-11-04 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Change definition for TIFFTAG_EXTRASAMPLES + field. The caller should supply a count when setting this field. As + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=648 + + * libtiff/{tif_jpeg.c, tif_ojpeg.c}: TIFFTAG_JPEGTABLES should have + uint32 count. Use this type everywhere. + +2004-11-03 Frank Warmerdam + + * libtiff/tif_next.c: avoid use of u_long and u_char types. Bug 653. + +2004-11-02 Frank Warmerdam + + * tools/tiff2rgba.c: removed extra newlines in usage message. + +2004-10-30 Andrey Kiselev + + * libtiff/tif_dirwrite.c: Improvements in tag writing code. + + * tools/tiff2ps.c: Fixed wrong variable data type when read Position + tags (Tristan Hill). + +2004-10-30 Frank Warmerdam + + * libtiff/tiffiop.h: added fallback definition of assert() if we + don't have assert.h. + +2004-10-29 Andrey Kiselev + + * libtiff/tif_fax3.c: Fixed case with the wrong decode routines + choosing when the incorrect Group4Options tag set. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=323 + + * libtiff/tif_dirwrite.c: Fixed problem with passing count variable of + wrong type when writing the TIFF_BYTE/TIFF_SBYTE tags in + TIFFWriteNormalTag(). + +2004-10-28 Andrey Kiselev + + * tools/tiff2ps.c: Fixed wrong variable data type when read Resolution + tags (Peter Fales). + + * tools/{bmp2tiff.c, raw2tiff.c}: Get rid of stream I/O functions. + +2004-10-28 Frank Warmerdam + + * tools/tiff2pdf.c: added casts to avoid warnings. + + * libtiff/libtiff.def: Added several more entry points required + to link fax2tiff.c against the DLL on windows. + +2004-10-27 Andrey Kiselev + + * configure, configure.ac: Added --enable-rpath option to embed linker + paths into library binary. + +2004-10-26 Andrey Kiselev + + * tools/tiffset.c: Check the malloc return value (Dmitry V. Levin). + + * libtiff/{tif_strip.c, tif_tile.c}: Zero division problem fixed + (Vladimir Nadvornik, Dmitry V. Levin). + +2004-10-16 Andrey Kiselev + + * libtiff 3.7.0 released. + +2004-10-15 Bob Friesenhahn + + * libtiff/tif_jpeg.c: There seems to be no need to include stdio.h + in this file so its inclusion is removed. Including stdio.h + sometimes incurs an INT32 typedef conflict between MinGW's + basetsd.h and libjpeg's jmorecfg.h. + +2004-10-15 Andrey Kiselev + + * man/bmp2tiff.1: Added manual page for bmp2tiff utility. + +2004-10-13 Bob Friesenhahn + + * tools/tiffcmp.c (leof): Renamed from 'eof' in order to avoid + conflict noticed under MinGW. + * ltmain.sh: Fix for MinGW compilation. + +2004-10-13 Frank Warmerdam + + * man/tiffsplit.1: Fixed to indicate using aaa-zzz, not aa-zz. + http://bugzilla.remotesensing.org/show_bug.cgi?id=635 + +2004-10-12 Andrey Kiselev + + * libtiff/{tif_dirread.c, tif_jpeg.c, tif_luv.c, tif_ojpeg.c, + tif_pixarlog.c, tif_write.c}: Handle the zero strip/tile sizes + properly (Dmitry V. Levin, Marcus Meissner). + +2004-10-11 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Type of the TIFFTAG_SUBIFD field changed + to TIFF_IFD. + +2004-10-10 Andrey Kiselev + + * tools/bmp2tif.c: Check the space allocation results. + +2004-10-09 Andrey Kiselev + + * libtiff/tif_dir.c: Initialize td_tilewidth and td_tilelength fields + of the TIFFDirectory structure with the 0 instead of -1 to avoid + confusing integer overflows in TIFFTileRowSize() for striped images. + + * tools/tiff2pdf.c: Fixed TransferFunction tag handling reported + by Ross A. Finlayson. + + * libtiff/tif_dir.c: Fixed custom tags handling as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=629 + +2004-10-08 Frank Warmerdam + + * libtiff/tif_dirinfo.c: Fix bug with tif_foundfield and reallocation + of tif_fieldinfo. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=630 + +2004-10-04 Bob Friesenhahn + + * contrib/iptcutil/README: Added the missing README which goes + along with iptcutil. + +2004-10-03 Andrey Kiselev + + * libtiff/tif_compress.c: Improved error reporting in + TIFFGetConfiguredCODECs() (Dmitry V. Levin). + +2004-10-02 Andrey Kiselev + + * libtiff 3.7.0beta2 released. + + * libtiff/{tif_aux.c, tif_compress.c, tif_dirinfo.c, tif_dirwrite.c, + tif_extension.c, tif_fax3.c, tif_luv.c, tif_packbits.c, + tif_pixarlog.c, tif_write.c}: Added checks for failed memory + allocations and integer overflows (Dmitry V. Levin). + + * libtiff/tiff.h: Missed TIFF_BIGTIFF_VERSION constant added. + +2004-10-01 Frank Warmerdam + + * libtiff/tif_open.c: added a more informative message if a BigTIFF + file is opened. + +2004-09-30 Frank Warmerdam + + * libtiff/tif_dirinfo.c: changed type of XMLPacket (tag 700) to + TIFFTAG_BYTE instead of TIFFTAG_UNDEFINED to comply with the info + in the Adobe XMP Specification. + +2004-09-29 Andrey Kiselev + + * libtiff/{tif_jpeg.c, tif_pixarlog.c}: Use _TIFFmemset() instead of + memset(). + + * libtiff/{tif_dirread.c, tif_strip.c, tif_tile.c}: Applied patches + from Dmitry V. Levin to fix possible integer overflow problems. + +2004-09-28 Andrey Kiselev + + * libtiff/tif_getimage.c: Check for allocated buffers before clearing + (Dmitry V. Levin). + +2004-09-26 Andrey Kiselev + + * libtiff/{tif_dir.h, tif_dir.c, tif_dirread.c, tif_write.c}: + Optimize checking for the strip bounds. + + * libtiff/{tif_dirread.c, tif_strip.c}: TIFFScanlineSize() and + TIFFRasterScanlineSize() functions report zero in the case of integer + overflow now. Properly handle this case in TIFFReadDirectory() + (patches from Dmitry V. Levin). + +2004-09-25 Andrey Kiselev + + * libtiff/{tif_dirinfo.c, tif_strip.c, tif_tile.c}: Use TIFFhowmany8() + macro where appropriate. + + * tools/tiff2bw.c: Write ImageWidth/Height tags to output file, as + noted by Gennady Khokhorin. + + * libtiff/tif_dirread.c: Always check the return values, returned + by the _TIFFmalloc() (Dmitry V. Levin). + + * libtiff/tif_dir.c: Fixed possible integer overflow _TIFFset*Array() + functions (Dmitry V. Levin). + + * libtiff/{tif_dirread.c, tif_dir.c, tif_write.c}: + Potential memory leak fixed in TIFFReadDirectory(), _TIFFVSetField(), + TIFFGrowStrips() (found by Dmitry V. Levin). + +2004-09-24 Andrey Kiselev + + * libtiff/{tiffio.h, tif_compress.c}: Added TIFFGetConfiguredCODECs() + to get the list of configured codecs. + + * libtiff/{tiffiop.h, tif_dirread.c}: More overflow fixes from + Dmitry V. Levin. + +2004-09-23 Andrey Kiselev + + * libtiff/tif_dirread.c: Applied patch from Dmitry V. Levin to fix + possible integer overflow in CheckMalloc() function. + +2004-09-22 Andrey Kiselev + + * libtiff/{tiffiop.h, tif_strip.c}: Use TIFFhowmany8() macro instead + of plain TIFFhowmany() where appropriate. + +2004-09-21 Andrey Kiselev + + * libtiff/tif_getimage.c: Initialize arrays after space allocation. + +2004-09-19 Andrey Kiselev + + * libtiff 3.7.0beta released. + + * libtiff/{tif_luv.c, tif_next.c, tif_thunder.c}: Several buffer + overruns fixed, as noted by Chris Evans. + +2004-09-14 Bob Friesenhahn + + * commit: Added a script to make it more convenient to commit + updates. The CVS commit message is extracted from this ChangeLog + file. + +2004-09-14 Andrey Kiselev + + * configure.ac, configure, aclocal.m4, libtiff/{mkspans.c, tif_fax3.c, + tif_getimage.c, tif_luv.c, tif_lzw.c, tif_ojpeg.c, tif_packbits.c, + tif_predict.c, tif_read.c, tif_swab.c, tif_thunder.c, tif_write.c, + tif_dir.c, tif_dirread.c, tif_dirwrite.c, tif_jpeg.c, tif_dirinfo.c, + tif_vms.c, tif_print.c, tif_strip.c, tif_tile.c, tif_dir.h, + tif_config.h.in, tiffiop.h}: + Get rid of BSD data types (u_char, u_short, u_int, u_long). + +2004-09-13 Bob Friesenhahn + + * libtiff/tiff.h: Fix column tagging. Reference current Adobe XMP + specification. Reference libtiff bug tracking system to submit + private tag additions. + +2004-09-12 Bob Friesenhahn + + * tools/tiffgt.c: Include "tif_config.h". + + * configure.ac: Use AM_PROG_CC_C_O since it is now needed to build + tiffgt. This results in the 'compile' script being added to the + project. + + * tools/Makefile.am (tiffgt_CFLAGS): Add extra build options + required to find OpenGL headers necessary to build tiffgt. Also + ensure that the libtiff that we built is used rather than some other + libtiff installed on the system. + +2004-09-12 Andrey Kiselev + + * configure.ac, acinclude.m4, aclocal.m4: New macros to detect GLUT + libraries. + +2004-09-11 Bob Friesenhahn + + * configure.ac: Pass library configuration defines via + tif_config.h rather than extending CPPFLAGS. Configure a + libtiff/tiffconf.h in order to satisfy application requirements + (not used by library build). Do not define _POSIX_C_SOURCE=2 since + this causes failure to build on systems which properly respect + this request. + + * libtiff/tiffconf.h.in: New file to act as the template for the + configured tiffconf.h + + * libtiff/files.lst (HDRS): Install the configured tiffconf.h. + +2004-09-10 Frank Warmerdam + + * html/internals.html: Split off a discussion of adding new tags + into addingtags.html. + +2004-09-10 Andrey Kiselev + + * test/{ascii_tag.c, long_tag.c}: Preliminary test suite added. + + * tools/tiff2pdf.c: Fixed reading TransferFunction tag as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=590 + + * libtiff/tif_print.c: Fixes in InkNames and NumberOfInks reporting. + + * libtiff/tif_dirread.c: Don't reject to read tags of the + SamplesPerPixel size when the tag count is greater than number of + samples as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=576 + + * libtiff/tiff.h: Use _TIFF_DATA_TYPEDEFS_ guardian to switch off + defining int8/uint8/... etc. types. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=607 + +2004-09-09 Frank Warmerdam + + * tools/tiff2ps.c, tools/tiffmedian.c: fiddle with include files + to avoid compile warnings about getopt() and a few other things. + +2004-09-02 Andrey Kiselev + + * libtiff/tif_dirread.c: Use memcpy() function instead of pointer + assigning magic in TIFFFetchFloat(). + +2004-09-01 Andrey Kiselev + + * libtiff/{tiffio.h, tif_open.c}: Applied patches from Joris Van Damme + to avoid requirement for tiffiop.h inclusion in some applications. See + here + + http://www.asmail.be/msg0054799560.html + + for details. + + * tools/fax2tiff.c: Use the new functions in the code. + +2004-08-25 Andrey Kiselev + + * tools/tiff2pdf.c: Initialize arrays properly. + + * tools/tiff2ps.c: Avoid zero division in setupPageState() function; + properly initialize array in PSDataBW(). + +2004-08-24 Andrey Kiselev + + * tools/tiff2pdf.c: More fixes for bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=590 + + from Ross Finlayson. + +2004-08-23 Andrey Kiselev + + * tools/tiff2ps.c: Fixed problem with uninitialized values. + + * libtiff/tif_dir.c: Initialize tif_foundfield data member in the + TIFFDefaultDirectory() (in addition to 2004-08-19 fix). + + * tools/tiff2pdf.c: Fixed a bunch of problems as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=590 + +2004-08-20 Andrey Kiselev + + * tools/tiff2pdf.c: Applied patch from Ross Finlayson that checks + that the input file has compression, photometric interpretation, + etcetra, tags or if not than a more descriptive error is returned. + + * libtiff/tif_dirread.c: Fixed problem in TIFFReadDirectory() in the + code, responsible for tag data type checking. + +2004-08-19 Andrey Kiselev + + * libtiff/{tiffiop.h, tif_dirinfo.c}: Fixed problem with the static + variable as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=593 + +2004-08-16 Andrey Kiselev + + * tools/ras2tiff.c: Fixed issue with missed big-endian checks as per + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=586 + +2004-08-01 Andrey Kiselev + + * libtiff/{tif_config.h.in, tif_config.h.vc}: config.h.in and + config.h.vc files renamed in the tif_config.h.in and tif_config.h.vc. + +2004-07-24 Andrey Kiselev + + * libtiff/tif_lzw.c: LZW compression code is merged back from the + separate package. All libtiff tools are updated to not advertise an + abcence of LZW support. + +2004-07-12 Andrey Kiselev + + * libtiff/tiffio.h: Revert thandle_t back to void* type. + +2004-07-11 Andrey Kiselev + + * libtiff/{tif_read.c, tif_tile.c, tif_strip.c}: Fixes in error + messages, as suggested by Bernd Herd. + +2004-07-03 Andrey Kiselev + + * libtiff/tif_dir.c: Call TIFFError() instead of producing warnings + when setting custom tags by value. Reported by Eric Fieleke. + +2004-06-14 Andrey Kiselev + + * tools/bmp2tiff.c: Add missed RawsPerStrip setting. + +2004-06-08 Andrey Kiselev + + * tools/bmp2tiff.c: Added new utility to convert Windows BMP files + into TIFFs. + +2004-06-07 Andrey Kiselev + + * libtiff 3.7.0alpha released. + +2004-06-06 Andrey Kiselev + + * libtiff/{tiff.h, tif_dirwrite.c, tif_fax3.c, tif_packbits.c,}: Get rid + of ugly 64-bit hacks, replace them with the clever (autoconf based ) + ones :-). + + * libtiff/tiffio.h: Define thandle_t as int, not void* (may cause + problems in 64-bit environment). + +2004-06-05 Andrey Kiselev + + * tools/tiffset.c: tiffset now can set any libtiff supported tags. + Tags can be supplied by the mnemonic name or number. + + * libtiff/{tiffio.h, tif_dir.h, tif_dirinfo.c,}: Added two new + functions TIFFFindFieldInfoByName() and TIFFFieldWithName(). + +2004-05-27 Andrey Kiselev + + * libtiff/tif_ojpeg.c: Fixed problem with duplicated SOI and SOF + markers as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=581 + +2004-05-24 Andrey Kiselev + + * tools/tiffsplit.c: Don't forget to copy Photometric + Interpretation tag. + +2004-05-20 Andrey Kiselev + + * libtiff/{tif_open.c, tiffio.h}: New function added: + TIFFIsBigEndian(). Function returns nonzero if given was file written + in big-endian order. + + * tools/tiffsplit.c: Fixed problem with unproperly written multibyte + files. Now output files will be written using the same byte order + flag as in the input image. See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=574 + + for details. + +2004-05-19 Frank Warmerdam + + * libtiff/tif_print.c: added (untested) support for printing + SSHORT, SLONG and SRATIONAL fields. + + * tools/tiffcp.c: close output file on normal exit. + +2004-05-17 Andrey Kiselev + + * libtiff/tif_fax3.c: Avoid reading CCITT compression options + if compression type mismatches. See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=565 + +2004-04-30 Andrey Kiselev + + * libtiff/tif_strip.c: Never return 0 from the + TIFFNumberOfStrips(). + +2004-04-29 Andrey Kiselev + + * libtiff/tif_dirread.c: Workaround for broken TIFF writers which + store single SampleFormat value for multisampled images. See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=562 + +2004-04-25 Andrey Kiselev + + * configure.ac, libtiff/{tiff.h, config.h.in}: Added tests for int8, + int16 and int32 types to avoid complains on some compilers. Details at + + http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + +2004-04-20 Andrey Kiselev + + * tools/tiff2pdf.c: Fixed problem with unaligned access as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=555 + +2004-04-14 Andrey Kiselev + + * libtiff/tif_write.c: Allow in-place updating of the compressed + images (don't work properly with all codecs). For details see GDAL bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=534 + +2004-04-06 Andrey Kiselev + + * libtiff/tif_jpeg.c: Workaround for wrong sampling factors used + in the Intergarph JPEG compressed TIFF images as per bug: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=532 + +2004-04-04 Frank Warmerdam + + * libtiff/tif_open.c: close clientdata if TIFFClientOpen() fails + via bad2. + +2004-03-26 Andrey Kiselev + + * tools/tiffcp.c: Properly set Photometric Interpretation in case of + JPEG compression of grayscale images. + + * tools/tiffcp.c: Don't emit warnings when Orientation tag does not + present in the input image. + +2004-03-19 Andrey Kiselev + + * {many}: The first attempt to switch to autotools. + +2004-03-03 Andrey Kiselev + + * libtiff/tif_open.c: Use dummy mmap/munmap functions in + TIFFClientOpen() when the appropriate client functions was not + supplied by user. + +2004-03-02 Frank Warmerdam + + * tools/ycbcr.c: fixed main() declaration as per: + http://bugzilla.remotesensing.org/show_bug.cgi?id=513 + +2004-02-26 Andrey Kiselev + + * tools/tiffsplit.c: Copy JPEGTables tag contents for JPEG compressed + images. Reported by Artem Mirolubov. + + * libtiff/tif_dirread.c: Fixed problem with handling TIFF_UNDEFINED + tag type in TIFFFetchNormalTag() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=508 + +2004-02-17 Frank Warmerdam + + * libtiff/tif_codec.c: Fixed typo in TIFFInitPackBits name as per: + http://bugzilla.remotesensing.org/show_bug.cgi?id=494 + +2004-02-05 Andrey Kiselev + + * libtiff/tif_fax3.c: Fixed problem with CCITT encoding modes as per + bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=483 + + But we need more work on fax codec to support update mode. + +2004-01-30 Frank Warmerdam + + * libtiff/libtiff.def: Added TIFFCurrentDirOffset, TIFFWriteCheck, + TIFFRGBAImageOK, and TIFFNumberOfDirectories as suggested by + Scott Reynolds. + +2004-01-29 Andrey Kiselev + + * libtiff/tiff.h: Fixed tag definitions for TIFFTAG_YCLIPPATHUNITS + and TIFFTAG_INDEXED as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=475 + + * libtiff/{tif_win32.c, tif_unix.c}: Check whether the pointer is + NULL before proceeding further as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=474 + + Check results, returned by the TIFFFdOpen() before returning and close + file if TIFFFdOpen() failed as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=468 + + * libtiff/tif_open.c: More fixes for + + http://bugzilla.remotesensing.org/show_bug.cgi?id=468 + +2004-01-28 Andrey Kiselev + + * libtiff/{libtiff.def, tif_close.c, tiffio.h, tif_open.c}: Separate + TIFFCleanup() from the TIFFClose() in order to fix the bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=468 + + * tools/tiffcp.c: Fixed problem with wrong interpretation of the + InkNames tag as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=466 + + Memory leak fixed. + +2004-01-21 Frank Warmerdam + + * libtiff/tif_dirwrite.c: Fixed handling of writable ASCII tags that + are field_passcount=TRUE properly. Arguably anonymous custom tags + should be declared as passcount=FALSE, but I don't want to change + that without a careful review. + +2004-01-20 Andrey Kiselev + + * libtiff/tif_write.c: Fixed reporting size of the buffer in case of + stripped image in TIFFWriteBufferSetup(). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=460 + +2004-01-11 Andrey Kiselev + + * libtiff/tif_dir.c: Incomplete cleanup in TIFFFreeDirectory(), + patch from Gerben Koopmans. + + * libtiff/tif_dirread.c: Check field_passcount value before setting + the value of undefined type, patch from Gerben Koopmans. + +2004-01-02 Andrey Kiselev + + * tools/tiffcp.c: Fixed problem with wrong Photometric setting for + non-RGB images. + +2003-12-31 Andrey Kiselev + + * libtiff/tif_win32.c: Fixed problem with _TIFFrealloc() when the NULL + pointer passed. Patch supplied by Larry Grill. + + * libtiff/{tiff.h, tif_fax3.c}:Fixes for AMD 64 platform as + suggested by Jeremy C. Reed. + +2003-12-26 Andrey Kiselev + + * libtiff 3.6.1 released. + +2003-12-24 Andrey Kiselev + + * config.guess, config.sub: Updated from the recent upstream. + +2003-12-22 Andrey Kiselev + + * libtiff/{tif_color, tif_getimage.c, tiffio.h}, man/TIFFcolor.3t: + More cleanups in color conversion interface, added appropriate manual + page. + +2003-12-19 Andrey Kiselev + + * libtiff/{tif_extension.c, tif_dirinfo.c, tiff.h}: Warnings fixed as + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=357 + + * tools/tiff2ps.c: Added support for alpha channel. Fixes + + http://bugzilla.remotesensing.org/show_bug.cgi?id=428 + + * libtiff/{libtiff.def, tif_color.c, tif_getimage.c, tiffio.h}: + Interface for Lab->RGB color conversion is finally cleaned up. + Added support for ReferenceBlackWhite tag handling when converted from + YCbCr color space. The latter closes + + http://bugzilla.remotesensing.org/show_bug.cgi?id=120 + +2003-12-07 Andrey Kiselev + + * libtiff/{tif_getimage.c, tiffio.h}: Avoid warnings. + + * libtiff/makefile.vc, tools/makefile.vc: Support for IJG JPEG + library. + +2003-12-06 Andrey Kiselev + + * libtiff/{tif_getimage.c, tif_aux.c}: Read WhitePoint tag from the + file and properly use it for CIE Lab->RGB transform. + +2003-12-04 Andrey Kiselev + + * libtiff/{tif_getimage.c, tif_color.c, tiffio.h}: YCbCr->RGB + conversion routines now in the tif_color.c module. New function + TIFFYCbCrtoRGB() available in TIFF API. + + * libtiff/tif_dirwrite.c: Handle TIFF_IFD tag type correctly. + +2003-12-03 Andrey Kiselev + + * libtiff/{tif_getimage.c, tif_color.c, tiffio.h}: Improvements in + CIE Lab conversion code. Start moving YCbCr stuff to the tif_color.c + module. + + * libtiff/{tif_getimage.c, tiffio.h}, man{TIFFReadRGBAImage.3t, + TIFFReadRGBAStrip.3t, TIFFReadRGBATile.3t, TIFFRGBAImage.3t}: + Finally resolved problems with orientation handling. TIFFRGBAImage + interface now properly supports all possible orientations, i.e. images + will be flipped both in horizontal and vertical directions if + required. 'Known bugs' section now removed from the appropriate manual + pages. Closed bug entry: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=322 + +2003-12-02 Andrey Kiselev + + * libtiff/tif_dir.c: Fixed order of the parameters in TIFFError() + function calls as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=440 + +2003-11-28 Ross Finlayson + + * tools/tiff2pdf.c: Some bugs fixed. + +2003-11-27 Andrey Kiselev + + * libtiff/tif_luv.c: Fixed bug in 48-bit to 24-bit conversion routine, + reported by Antonio Scuri. + + * man/tiff2pdf.1: Few improvements in page layout. + + * Makefile.in, /man/Makefile.in, /html/man/tiff2pdf.1.html: + Added support fpr tiff2pdf manual page. + +2003-11-26 Ross Finlayson + + * /man/tiff2pdf.1: File added to repository. + +2003-11-26 Andrey Kiselev + + * Makefile.in, /tools/{Makefile.in, makefile.vc}: + Added support fpr tiff2pdf utility. + +2003-11-25 Ross Finlayson + + * /tools/tiff2pdf.c: File added to repository. + +2003-11-22 Andrey Kiselev + + * /tools/raw2tiff.c: sqrtf() replaced with sqrt(). + +2003-11-21 Andrey Kiselev + + * /tools/raw2tiff.c: #include removed. + + * tools/{Makefile.in, tiffgt.c}: Unmaintained and platform dependent + sgigt utility removed and replaced with the completely rewritten + portable tiffgt tool (depend on OpenGL and GLUT). Initial revision, + there is a lot of things to improve. + + * libtiff/tif_ojpeg.c: TIFFVGetField() function now can properly + extract the fields from the OJPEG files. Patch supplied by Ross + Finlayson. + + * libtiff/{tiffio.h, tif_codec.c}, man/{libtiff.3t, TIFFcodec.3t}: + Added new function TIFFIsCODECConfigured(), suggested by Ross + Finlayson. + +2003-11-18 Andrey Kiselev + + * libtiff/tif_dirinfo.c: Implemented binary search in + _TIFFMergeFieldInfo(). Patch supplied by Ross Finlayson. + + * libtiff/tif_dir.h: _TIFFFindOrRegisterdInfo declaration replaced + with _TIFFFindOrRegisterFieldInfo as reported by Ross Finlayson. + +2003-11-17 Frank Warmerdam + + * tif_dirread.c: do not mark all anonymously defined tags to be + IGNOREd. + +2003-11-17 Andrey Kiselev + + * contrib/pds/{tif_pdsdirread.c, tif_pdsdirwrite.c}: Use + TIFFDataWidth() function insted of tiffDataWidth array. + +2003-11-16 Andrey Kiselev + + * libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13) + datatype, intruduced in "Adobe PageMaker TIFF Tech. Notes". + +2003-11-15 Frank Warmerdam + + * Makefile.in: fixed missing backslash for tif_color.c in list. + +2003-11-13 Andrey Kiselev + + * libtiff/{tif_color.c, tif_getimage.c, tiffio.h, Makefile.in}: + New color space conversion code: CIE L*a*b* 1976 images now supported + by the TIFFRGBAImage interface. All introduced routines go to new + module tif_color.c. Eventually all color conversion functions should + be moved there. + +2003-11-12 Andrey Kiselev + + * tools/{ras2tiff.c, rasterfile.h}: Properly determine SUN Rasterfiles + with the reverse byte order (it is reported by the magic header + field). Problem reported by Andreas Wiesmann. + + * tools/raw2tiff.c, man/raw2tiff.1: Few improvements in correlation + calculation function. Guessing mechanics now documented in manual page. + +2003-11-11 Andrey Kiselev + + * tools/raw2tiff.c: Implemented image size guessing using + correlation coefficient calculation between two neighbour lines. + +2003-11-09 Frank Warmerdam + + * libtiff/tif_tile.c: remove spurious use of "s" (sample) in the + planarconfig_contig case in TIFFComputeTile(). + + http://bugzilla.remotesensing.org/show_bug.cgi?id=387 + +2003-11-09 Andrey Kiselev + + * libtiff/tiffiop.h: New macros: TIFFmax, TIFFmin and TIFFrint. + +2003-11-07 Andrey Kiselev + + * libtiff/{tiffio.h, tif_strip.c}, man/{TIFFstrip.3t, libtiff.3t}: + Added TIFFRawStripSize() function as suggested by Chris Hanson. + +2003-11-03 Andrey Kiselev + + * libtiff/{tif_lzw.c, tif_fax3.c}: Proper support for update mode as + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=424 + +2003-10-29 Andrey Kiselev + + * libtiff/libtiff.def: Added TIFFReadRGBAImageOriented. + + * html/build.html: Added note about GNU make requirement. + +2003-10-25 Andrey Kiselev + + * Makefile.in: Fixes in using MAKEFLAGS as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=418 + + * port/install.sh.in: Option -p added to the mkdir command to create + all directory tree structure before installing. + +2003-10-18 Andrey Kiselev + + * /tools/tiff2ps.c: #include replaced with the + #include . + +2003-10-16 Andrey Kiselev + + * Makefile.in: Add an absolute path to the test_pics.sh call. + +2003-10-12 Andrey Kiselev + + * libtiff/tiffcomp.h: #define _BSDTYPES_DEFINED when defining BSD + typedefs. + +2003-10-09 Andrey Kiselev + + * configure, libtiff/{Makefile.in, mkversion.c}: + Relative buildings fixed. + + * tools/Makefile.in: Added "-I../libtiff" to the tiffset building + rule. + +2003-10-07 Andrey Kiselev + + * Makefile.in: Added missed v3.6.0.html. + + * libtiff/tiffio.h: Typo fixed: ORIENTATION_BOTTOMLEFT replaced with + ORIENTATION_BOTLEFT. + +2003-10-04 Andrey Kiselev + + * 3.6.0 final release. + +2003-10-03 Andrey Kiselev + + * libtiff/{tif_getimage.c, tiffio.h}, man/TIFFReadRGBAImage.3t: New + function TIFFReadRGBAImageOriented() implemented to retrieve raster + array with user-specified origin position as suggested by Jason Frank. + See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=322 + + for details. + + * tools/tiff2rgba.c: Switched to use TIFFReadRGBAImageOriented() + instead of TIFFReadRGBAImage(). + + * tools/tiff2ps.c: Fixed possible endless loop as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=404 + +2003-09-30 Andrey Kiselev + + * libtiff/tif_dirread.c: Check field counter against number of fields + in order to fix + + http://bugzilla.remotesensing.org/show_bug.cgi?id=366 + + * libtiff/tif_fax3.c: Fix wrong line numbering as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=342 + +2003-09-25 Andrey Kiselev + + * libtiff/{tiffiop.h, tif_dirread.c, tif_dir.c, tif_open.c, + tif_close.c}: Store a list of opened IFD to prevent looping as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=383 + +2003-09-23 Andrey Kiselev + + * libtiff/tif_dirread.c: More fixes for EstimateStripByteCounts(). See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=358 + +2003-08-21 Andrey Kiselev + + * tools/tiffmedian.c: int declaration replaced with the uint32 to + support large images as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=382 + +2003-08-12 Andrey Kiselev + + * libtiff/Makefile.in: Fixed problem with building in different + directory. + + * tools/tiff2ps.c: Added missing #include . + + * libtiff/tif_dirwrite.c: More fixes for custom tags code + from Ashley Dreier. + +2003-08-07 Andrey Kiselev + + * tools/tiff2ps.c: Added page size setting when creating PS Level 2. + Patch submitted by Balatoni Denes (with corrections from Tom + Kacvinsky). + + * tools/tiff2ps.c: Fixed PS comment emitted when FlateDecode is + being used. Reported by Tom Kacvinsky. + + * libtiff/tif_dirwrite.c: Fixed problem with custom tags writing, + reported by Ashley Dreier. + + * libtiff/tif_print.c: Fixed problem with float tags reading, support + for printing RATIONAL and BYTE tags added. + +2003-08-05 Andrey Kiselev + + * libtiff/tif_lzw.c: Move LZW codec state block allocation back to + TIFFInitLZW(), because its initialization in LZWSetupDecode() cause + problems with predictor initialization. Remove O_RDONLY check during + state block allocation to be able open LZW compressed files in update + mode. + + Problem exist for libtiff version of the tif_lzw.c module. One from + lzw-compression-kit hasn't such troubles. + +2003-08-04 Frank Warmerdam + + * libtiff/tif_write.c: modified tif_write.c so that the various + encoded write functions use tif_postdecode() to apply byte order + swapping (swab) to the application passed data buffer if the same + would be done when reading. This allows us to write pixel data with + more than 8 bits per sample to existing files of a non-native byte + order. One side effect of this change is the applications buffer + itself is altered in this case by the act of writing. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=171 + +2003-07-25 Frank Warmerdam + + * libtiff/tif_open.c: avoid signed/unsigned casting warning + initializing typemask as per patch from J.A. Strother. + + * tools/tiffcp.c: fixed signed/unsigned casting warning. + + * libtiff/tif_print.c: dos2unix conversion. + + * tools/tiffsplit.c: increased the maximum number of pages that + can be split. Patch provided by Andrew J. Montalenti. + +2003-07-11 Andrey Kiselev + + * tools/raw2tiff.c: Added option `-p' to explicitly select color + space of input image data. Closes + + http://bugzilla.remotesensing.org/show_bug.cgi?id=364 + +2003-07-08 Frank Warmerdam + + * tif_aux.c, tif_codec.c, tif_dir.c, tif_dirread.c, tif_extension.c, + tif_fax3.c, tif_getimage.c, tif_luv.c, tif_lzw.c, tif_next.c, + tif_packbits.c, tif_predict.c, tif_print.c, tif_swab.c, tif_thunder.c: + avoid casting warning at /W4. + +2003-07-03 Andrey Kiselev + + * tools/thumbnail.c: Memory leak fixed as reported by Robert S. Kissel. + +2003-06-30 Andrey Kiselev + + * libtiff/tif_pixarlog.c: Unused variables removed. + + * libtiff/{tif_dirread.c, tif_dir.c}: Fixed problem with + EstimateStripByteCounts() as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=358 + + * libtiff/{tif_dirwrite.c, tif_packbits.c}: Fixed compilation on + 64-bit architectures as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=357 + + * libtiff/tif_dirinfo.c: TIFFDataWidth() returns 0 in case of + unknown data type. + +2003-06-19 Frank Warmerdam + + * libtiff/tif_print.c: fixed some serious bugs when printing + custom tags ... almost certain to crash. + + * libtiff/tif_dirread.c: Don't ignore custom fields that are + autodefined. Not sure how this got to be like this. + +2003-06-18 Andrey Kiselev + + * 3.6.0 Beta2 released. + + * tools/tiffcmp.c, man/tiffcmp.1: Fixed problem with unused data + comparing as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=349 + + `-z' option now can be used to set the number of reported different + bytes. + +2003-06-09 Andrey Kiselev + + * tools/tiffcp.c, man/tiffcp.1: Added possibility to specify value -1 + to -r option to get the entire image as one strip. See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=343 + + for details. + +2003-06-04 Andrey Kiselev + + * tools/tiffcp.c: Set the correct RowsPerStrip and PageNumber + values as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=343 + +2003-05-27 Frank Warmerdam + + * libtiff/tif_jpeg.c: modified segment_height calculation to always + be a full height tile for tiled images. Also changed error to just + be a warning. + +2003-05-25 Andrey Kiselev + + * tools/fax2tiff.c: Page numbering fixed, as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=341 + +2003-05-20 Andrey Kiselev + + * contrib/ojpeg/{Makefile.in, jdhuff.h, jinclude.h, ojpeg.c, README}, + configure, Makefile.in: Switched back to the old behaviour. Likely + better solution should be found for OJPEG support. + +2003-05-11 Andrey Kiselev + + * libtiff/mkversion.c: Fixed problem with wrong string size when + reading RELEASE-DATE file. + +2003-05-07 Andrey Kiselev + + * tools/tiff2ps.c: Fixed bug in Ascii85EncodeBlock() function: array + index was out of range. + +2003-05-06 Andrey Kiselev + + * contrib/ojpeg/{Makefile.in, jdhuff.h, jinclude.h, ojpeg.c, README}, + configure, Makefile.in: Improved libtiff compilation with OJPEG + support. Now no need for patching IJG JPEG library, hack requred by + libtiff will be compiled and used in-place. Implemented with + suggestion and help from Bill Allombert, Debian's libjpeg maintainer. + + * libtiff/tif_aux.c: Properly handle TIFFTAG_PREDICTOR in + TIFFVGetFieldDefaulted() function. + +2003-05-05 Andrey Kiselev + + * tools/ppm2tiff.c: PPM header parser improved: now able to skip + comments. + + * tools/tiffdither.c: Fixed problem with bit fill order tag setting: + was not copied from source image. + + * libtiff/getimage.c: Workaround for some images without correct + info about alpha channel as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=331 + +2003-04-29 Andrey Kiselev + + * tools/tiff2ps.c, man/tiff2ps.1: Add ability to generate PS Level 3. + It basically allows one to use the /flateDecode filter for ZIP + compressed TIFF images. Patch supplied by Tom Kacvinsky. Fixes + + http://bugzilla.remotesensing.org/show_bug.cgi?id=328 + + * tools/tiff2ps.c: Force deadzone printing when EPS output specified + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=325 + +2003-04-17 Andrey Kiselev + + * libtiff/tif_dirread.c: Removed additional check for StripByteCounts + due to problems with multidirectory images. Quality of error messages + improved. + +2003-04-16 Andrey Kiselev + + * tools/tiffcp.c: Fixed problem with colorspace conversion for JPEG + encoded images. See bug entries + + http://bugzilla.remotesensing.org/show_bug.cgi?id=275 + + and + + http://bugzilla.remotesensing.org/show_bug.cgi?id=23 + + * libtiff/tif_dirread.c: Additional check for StripByteCounts + correctness. Fixes + + http://bugzilla.remotesensing.org/show_bug.cgi?id=320 + +2003-03-12 Andrey Kiselev + + * tools/{fax2ps.c, fax2tiff.c, gif2tiff.c, pal2rgb.c, ppm2tiff.c, + ras2tiff.c, raw2tiff.c, rgb2ycbcr.c, thumbnail.c, tiff2bw.c, + tiff2ps.c, tiff2rgba.c, tiffcp.c, tiffdither.c, tiffinfo.c, + tiffmedian.c}: Added library version reporting facility to all tools. + +2003-03-06 Frank Warmerdam + + * port/install.sh.in: Fixed problems with install producing paths + like ///usr/local/lib on cygwin. + +2003-02-27 Andrey Kiselev + + * tools/fax2tiff.c, man/fax2tiff.1: New switch (-X) to set width of + raw input page. Patch supplied by Julien Gaulmin. See + + http://bugzilla.remotesensing.org/show_bug.cgi?id=293 + + for details. + +2003-02-26 Frank Warmerdam + + * libtiff/tif_dir.c: fixed up the tif_postdecode settings + responsible for byte swapping complex image data. + + * libtiff/tif_lzw.c: fixed so that decoder state isn't allocated till + LZWSetupDecode(). Needed to read LZW files in "r+" mode. + +2003-02-07 Andrey Kiselev + + * tools/ppm2tiff.c: Fixed problem with too many arguments. + +2003-02-04 Andrey Kiselev + + * tools/raw2tiff.c: Memory leak fixed. + +2003-02-03 Andrey Kiselev + + * tools/fax2tiff.c, man/fax2tiff.1: Applied patch from Julien Gaulmin + (thanks, Julien!). More switches for fax2tiff tool for better control + of input and output. Details at + + http://bugzilla.remotesensing.org/show_bug.cgi?id=272 + +2003-02-03 Frank Warmerdam + + * libtiff/tif_jpeg.c: Modified to defer initialization of jpeg + library so that we can check if there is already any tile/strip data + before deciding between creating a compressor or a decompressor. + +2003-01-31 Frank Warmerdam + + * libtiff/tif_write.c: TIFFWriteCheck() now fails if the image is + a pre-existing compressed image. That is, image writing to + pre-existing compressed images is not allowed. + + * libtiff/tif_open.c: Removed error if opening a compressed file + in update mode. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=198 + +2003-01-31 Andrey Kiselev + + * config.guess, config.sub: Updated to recent upstream versions. + +2003-01-15 Frank Warmerdam + + * cut 3.6.0 Beta release. + +2002-12-20 Andrey Kiselev + + * tools/fax2ps.c, man/fax2ps.1: Page size was determined + in wrong way as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=239 + +2002-12-17 Frank Warmerdam + + * libtiff/tif_dirread.c: Allow wrong sized arrays in + TIFFFetchStripThing(). + + http://bugzilla.remotesensing.org/show_bug.cgi?id=49 + +2002-12-02 Frank Warmerdam + + * libtiff/tif_dir.c: fix problem with test on td_customValueCount. + Was using realloc even first time. Fix by Igor Venevtsev. + +2002-11-30 Frank Warmerdam + + * libtiff/tif_dir.c: fixed bug with resetting an existing custom + field value. + + * libtiff/tif_dir.c: Fixed potential problem with ascii "custom" + tags in TIFFVGetField() ... added missing break. + +2002-10-14 Frank Warmerdam + + * tools/tiff2ps.c: fixes a problem where "tiff2ps -1e" did not make + the scanline buffer long enough when writing rgb triplets. + The scanline needs to be 3 X the number of dots or else it will + contain an incomplete triplet and programs that try to separate + the eps by redefining the colorimage operator will get messed up. + Patch supplied by William Bader. + + * Makefile.in: added tif_extension.c to file list as per + http://bugzilla.remotesensing.org/show_bug.cgi?id=218. + +2002-10-11 Andrey Kiselev + + * configure, config.site, libtiff/{tif_unix.c, Makefile.in}: Fix for + large files (>2GiB) supporting. New option in the config.site: + LARGEFILE="yes". Should be enough for I/O of the large files. + +2002-10-10 Frank Warmerdam + + * libtiff/html/v3.6.0.html: new release notes. + + * libtiff/index.html: removed faq, cvs snapshot cruft. Added email + link for Andrey. Pointer to v3.6.0.html. + + * libtiff/Makefile.in: added direct rule for tiffvers.h for release. + +2002-10-07 Andrey Kiselev + * tools/tiff2ps.c, man/tiff2ps.1: Applied patch form Sebastian Eken + (thanks, Sebastian!). New switches: + -b # for a bottom margin of # inches + -c center image + -l # for a left margin of # inches + -r rotate the image by 180 degrees + New features merged with code for shrinking/overlapping. + Previously added -c and -n switches (for overriding PS units) renamed + in -x and -y respectively. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=200 + + * html/man/*.html: Updated from actual manual pages. + +2002-10-06 Frank Warmerdam + + * libtiff/tif_jpeg.c: fixed problem with boolean defined with wrong + size on windows. Use #define boolean hack. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=188 + + * libtiff/tiff.h: Don't do special type handling in tiff.h unless + USING_VISUALAGE is defined. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + +2002-10-03 Frank Warmerdam + + * libtiff/tiff.h: added COMPRESSION_JP2000. + +2002-10-02 Andrey Kiselev + + * libtiff/tif_dirread.c: Another fix for the fetching SBYTE arrays + by the TIFFFetchByteArray() function. Should finally resolve + + http://bugzilla.remotesensing.org/show_bug.cgi?id=52 + + * configure: Set -DPIXARLOG_SUPPORT option along with -DZIP_SUPPORT + + * html/Makefile.in: New targets added: html and groffhtml for + producing HTML representations of the manual pages automatically. + html target uses man2html tool, groffhtml uses groff tool. + +2002-09-29 Frank Warmerdam + + * configure, libtiff/Makefile.in: Added SCO OpenServer 5.0.6 support + from John H. DuBois III. + +2002-09-15 Andrey Kiselev + + * Makefile.in, /man/{raw2tiff.1, Makefile.in, libtiff.3}: Added + manual page for raw2tiff(1) tool. + +2002-09-12 Andrey Kiselev + + * /libtiff/{tiffio.h, tif_dir.h}: TIFFDataWidth() declaration moved to + the tiffio.h header file. + + * Makefile.in, /man/{TIFFDataWidth.3t, Makefile.in, libtiff.3}: Added + manual page for TIFFDataWidth() function + +2002-09-08 Frank Warmerdam + + * libtiff/tif_dirread.c: Expand v[2] to v[4] in TIFFFetchShortPair() + as per http://bugzilla.remotesensing.org/show_bug.cgi?id=196. + + * tools/tiff2ps.c: Don't emit BeginData/EndData DSC comments + since we are unable to properly include the amount to skip. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=80 + +2002-09-02 Andrey Kiselev + + * /libtiff/tif_dirread.c: Fixed problem with SBYTE type data fetching + in TIFFFetchByteArray(). Problem described at + http://bugzilla.remotesensing.org/show_bug.cgi?id=52 + +2002-08-22 Andrey Kiselev + + * /libtiff/tif_dirinfo.c: Further additions to free custom fields + in _TIFFSetupFieldInfo() function. + See http://bugzilla.remotesensing.org/show_bug.cgi?id=169 for details. + + * /libtiff/tif_lzw.c: Additional consistency checking added in + LZWDecode() and LZWDecodeCompat(). + Fixes http://bugzilla.remotesensing.org/show_bug.cgi?id=190 + and http://bugzilla.remotesensing.org/show_bug.cgi?id=100 + + * /libtiff/tif_lzw.c: + Added check for valid code lengths in LZWDecode() and + LZWDecodeCompat(). Fixes + http://bugzilla.remotesensing.org/show_bug.cgi?id=115 + +2002-08-16 Andrey Kiselev + + * /libtiff/{Makefile.vc, libtiff.def}: + Missed declarations added. + +2002-08-15 Frank Warmerdam + + * tif_getimage.c: Ensure that TIFFRGBAImageBegin() returns the + return code from the underlying pick function. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=177 + + * tif_dir.h: changed FIELD_CODEC to 66 from 64 to avoid overlap + with FIELD_CUSTOM as mentioned in bug 169. + + * tif_close.c: added logic to free dynamically created anonymous + field definitions to correct a small memory leak. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=169 + +2002-08-10 Andrey Kiselev + + * /tools/{raw2tiff.c, Makefile.in, Makefile.lcc, Makefile.vc}: + New tool: raw2tiff --- raw images to TIFF converter. No manual page yet. + +2002-07-31 Frank Warmerdam + + * libtiff/tif_jpeg.c: Fixed problem with setting of nrows in + JPEGDecode() as per bugzilla bug (issue 1): + + http://bugzilla.remotesensing.org/show_bug.cgi?id=129 + + * libtiff/{tif_jpeg.c,tif_strip.c,tif_print.c}: Hacked tif_jpeg.c to + fetch TIFFTAG_YCBCRSUBSAMPLING from the jpeg data stream if it isn't + present in the tiff tags. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=168 + + * libtiff/tif_read.c, libtiff/tif_write.c: TIFFReadScanline() and + TIFFWriteScanline() now set tif_row explicitly in case the codec has + fooled with the value. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=129 + +2002-06-22 Andrey Kiselev + + * /tools/tiff2ps.c: Added workaround for some software that may crash + when last strip of image contains fewer number of scanlines than + specified by the `/Height' variable. See + http://bugzilla.remotesensing.org/show_bug.cgi?id=164 + for explanation. + +2002-06-21 Andrey Kiselev + + * tools/tiff2ps, man/tiff2ps.1: New functionality for tiff2ps utility: + splitting long images in several pages. See + http://bugzilla.remotesensing.org/show_bug.cgi?id=142 for explanation. + Patch granted by John Williams . + +2002-06-11 Frank Warmerdam + + * libtiff/contrib/win95: renamed to contrib/win_dib. Added new + Tiffile.cpp example of converting TIFF files into a DIB on Win32. + This one is described in: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=143 + + * libtiff/tif_ojpeg.c: Major upgrade from Scott. See details at: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=156 + +2002-05-10 Andrey Kiselev + + * tools/tiff2ps: New commandline switches to override resolution + units obtained from the input file. Closes + http://bugzilla.remotesensing.org/show_bug.cgi?id=131 + +2002-04-26 Andrey Kiselev + + * libtiff/libtiff.def: Added missed declaration. + +2002-04-22 Andrey Kiselev + + * tools/fax2tiff.c: Updated to reflect latest changes in libtiff. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=125 + +2002-04-20 Andrey Kiselev + + * libtiff/tif_open.c: Pointers to custom procedures + in TIFFClientOpen() are checked to be not NULL-pointers. + +2002-04-18 Andrey Kiselev + + * libtiff/libtiff.def: Added missed declarations. + + * libtiff/tif_pixarlog.c: Updated for using tif_tagmethods structure. + +2002-04-16 Andrey Kiselev + + * libtiff/tif_lzw.c: Additional checks for data integrity introduced. + Should finally close + http://bugzilla.remotesensing.org/show_bug.cgi?id=100 + +2002-04-10 Andrey Kiselev + + * tools/tiff2ps: Division by zero fixed. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=88 + +2002-04-09 Andrey Kiselev + + * libtiff/: tif_dirwrite.c, tif_write.c, tiffio.h: + TIFFCheckpointDirectory() routine added. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=124 + + * man/: TIFFWriteDirectory.3t, Makefile.in: Added description + for the new function. + +2002-04-08 Andrey Kiselev + + * libtiff/: tif_codec.c, tif_compress.c, tiffiop.h: Introduced + additional members tif->tif_decodestatus and tif->tif_encodestatus + for correct handling of unconfigured codecs (we should not try to read + data or to define data size without correct codecs). + + * libtiff/tif_getimage.c: The way of codecs checking in TIFFRGBAImageOK + changed. Now it has used tif->tif_decodestatus and + tif->tif_encodestatus. + Should fix http://bugzilla.remotesensing.org/show_bug.cgi?id=119 (in + case of __cvs_8.tif test image). + + * libtiff/: tif_dirinfo.c, tif_dirread.c: Somebody makes a bug in + tif_dirread.c when TIFFCreateAnonFieldInfo was introduced. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=119 in case + of _cvs_00000-00.tif, _cvs_00000-01.tif and _cvs_00000-02.tif. + +2002-04-04 Andrey Kiselev + + * libtiff/: tif_lzw.c: Assertions in LZWDecode and LZWDecodeCompat + replaced by warnings. Now libtiff should read corrupted LZW-compressed + files by skipping bad strips. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=100 + +2002-04-03 Frank Warmerdam + + * libtiff/tif_dirwrite.c: Removed some dead code. + + * libtiff/*: Cleanup some warnings. + + * libtiff/tif_dir.c: Fixed bug with count returned by TIFFGetField() + for variable length FIELD_CUSTOM values. Was int * but should be + u_short *. + +2002-04-01 Andrey Kiselev + + * tools/: tifcp.c: Added support for 'Orientation' tag in tiffcp + utility (at cpStripToTile routine). + +2002-03-27 Frank Warmerdam + + * tif_dirread.c: avoid div-by-zero if rowbytes is zero in chop func. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=111 + + * tif_print.c: Fixed so that ASCII FIELD_CUSTOM values with + passcount set FALSE can be printed (such as TIFFTAG_SOFTWARE). + + * libtiff/tif_dir.c,tif_dirinfo.c,tif_dir.h,tif_ojpeg.c: modified so + that TIFFTAG_SOFTWARE uses FIELD_CUSTOM as an example. + +2002-03-26 Dwight Kelly + + * libtiff/: tiff.h, tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_dirread.c, + tif_dirwrite.c: Added get/put code for new tag XMLPACKET as defined + in Adobe XMP Technote. Added missing INKSET tag value from TIFF 6.0 spec + INKSET_MULTIINK (=2). Added missing tags from Adobe TIFF technotes: + CLIPPATH, XCLIPPATHUNITS, YCLIPPATHUNITS, OPIIMAGEID, OPIPROXY and + INDEXED. Added PHOTOMETRIC tag value from TIFF technote 4 ICCLAB (=9). + +2002-03-26 Andrey Kiselev + + * libtiff/: tif_getimage.c: TIFFReadRGBAStrip and TIFFReadRGBATile + now also uses TIFFRGBAImageOK before reading. This is additional fix + for http://bugzilla.remotesensing.org/show_bug.cgi?id=110 + +2002-03-25 Andrey Kiselev + + * libtiff/: tif_getimage.c: Additional check for supported + codecs added in TIFFRGBAImageOK and TIFFReadRGBAImage now uses + TIFFRGBAImageOK before reading. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=110 + +2002-03-15 Andrey Kiselev + + * libtiff/: tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_dirread.c, + tif_dirwrite.c: Added routine TIFFDataWidth for detrmining + TIFFDataType sizes instead of working with tiffDataWidth array + directly. Should prevent out-of-borders bugs in case of unknown or + broken data types. EstimateStripByteCounts routine modified, so it + won't work when tags with uknown sizes founded. + Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=109 + +2002-03-13 Andrey Kiselev + + * libtiff/tif_getimage.c: Added support for correct handling + `Orientation' tag in gtTileContig. Should be added in other gt* + functions as well, but I have not images for testing yet. Partially + resolves http://bugzilla.remotesensing.org/show_bug.cgi?id=23 + +2002-03-10 Andrey Kiselev + + * libtiff/: tif_dirinfo.c, tif_dirwrite.c: Added possibility to + read broken TIFFs with LONG type used for TIFFTAG_COMPRESSION, + TIFFTAG_BITSPERSAMPLE, TIFFTAG_PHOTOMETRIC. Closes + http://bugzilla.remotesensing.org/show_bug.cgi?id=99 + +2002-03-08 Andrey Kiselev + + * libtiff/Makefile.in, tools/Makefile.in: Shared library will not + be stripped when installing, utility binaries will do. Closes + http://bugzilla.remotesensing.org/show_bug.cgi?id=93 + +2002-02-28 Frank Warmerdam + + * man/TIFFGetField: fixed type of TIFFTAG_COPYRIGHT. + + * man/libtiff.3t: added copyright tag info. + +2002-02-11 Frank Warmerdam + + * libtiff/{tiff.h,tif_fax3.c}: Add support for __arch64__. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=94 + + * man/Makefile.in: Patch DESTDIR handling + + http://bugzilla.remotesensing.org/show_bug.cgi?id=95 + + * configure: OpenBSD changes for Sparc64 and DSO version. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=96 + +2002-02-05 Frank Warmerdam + + * config.site/configure: added support for OJPEG=yes option to enable + OJPEG support from config.site. + +2002-01-27 Frank Warmerdam + + * html/document.html: fixed links for TIFf 6 docs. + +2002-01-18 Frank Warmerdam + + * config.guess, config.sub: Updated from ftp.gnu.org/pub/config. + + * libtiff/tif_read.c: Fixed TIFFReadEncodedStrip() to fail if the + decodestrip function returns anything not greater than zero as per + http://bugzilla.remotesensing.org/show_bug.cgi?id=97 + + * configure: Modify CheckForBigEndian so it can work in a cross + compiled situation. + +2002-01-16 Frank Warmerdam + + * tools/tiffdump.c: include TIFFTAG_JPEGTABLES in tag list. + + * tools/tiffset.c: fix bug in error reporting. + + * tools/tiffcp.c: fix several warnings that show up with -Wall. + +2002-01-04 Frank Warmerdam + + * libtiff/tif_jpeg.c: fixed computation of segment_width for + tiles files to avoid error about it not matching the + cinfo.d.image_width values ("JPEGPreDecode: Improper JPEG strip/tile + size.") for ITIFF files. Apparently the problem was incorporated since + 3.5.5, presumably during the OJPEG/JPEG work recently. + +2001-12-15 Frank Warmerdam + + * configure, libtiff/Makefile.in: Changes for building on MacOS 10.1. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=94 + + * libtiff/tif_getimage.c: If DEFAULT_EXTRASAMPLE_AS_ALPHA is 1 + (defined in tiffconf.h - 1 by default) then the RGBA interface + will assume that a fourth extra sample is ASSOCALPHA if the + EXTRASAMPLE value isn't set for it. This changes the behaviour of + the library, but makes it work better with RGBA files produced by + lots of applications that don't mark the alpha values properly. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=93 + http://bugzilla.remotesensing.org/show_bug.cgi?id=65 + +2001-12-12 Frank Warmerdam + + * libtiff/tif_jpeg.c: allow jpeg data stream sampling values to + override those from tiff directory. This makes this work with + ImageGear generated files. + +2001-12-07 Frank Warmerdam + + * html/Makefile.in: added missing images per bug 92. + + * port/Makefile.in: fixed clean target per bug 92. + +2001-11-28 Frank Warmerdam + + * Reissue 3.5.7 release. + + * libtiff/mkversion.c: Fix output of TIFF_VERSION to be + YYYYMMDD so that it is increasing over time. + + * Makefile.in: Ensure that tiffvers.h is regenerated in the + make release target. + + * Makefile.in: added libtiff/tiffvers.h to the release file list. + +2001-11-23 Frank Warmerdam + + * added html/v3.5.7.html, updated html/index.html. + + * Makefile.in: added contrib/addtiffo/tif_ovrcache.{c,h}. + +2001-11-15 Frank Warmerdam + + * configure: fixed test for -lm. + +2001-11-02 Frank Warmerdam + + * Added PHOTOMETRIC_ITULAB as per bug 90. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=90 + +2001-10-10 Frank Warmerdam + + * libtiff/tiff.h: I have created COMPRESSION_CCITT_T4, + COMPRESSION_CCITT_T6, TIFFTAG_T4OPTIONS and TIFFTAG_T6OPTIONS aliases + in keeping with TIFF 6.0 standard in tiff.h + + http://bugzilla.remotesensing.org/show_bug.cgi?id=83 + +2001-09-26 Frank Warmerdam + + * libtiff/tif_dirwrite.c: added TIFFRewriteDirectory() function. + Updated TIFFWriteDirectory man page to include TIFFRewriteDirectory. + +2001-09-24 Frank Warmerdam + + * libtiff/tif_lzw.c: Avoid MS VC++ 5.0 optimization bug. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=78 + + * libtiff/tif_lzw.c: added dummy LZWSetupEncode() to report an + error about LZW not being available. + + * libtiff/tif_dir.c: propagate failure to initialize compression + back from TIFFSetField() as an error status, so applications can + detect failure. + + * libtiff/tif_dir.c: removed the auto replacement of + COMPRESSION_LZW with COMPRESSION_NONE in _TIFFVSetField(). + + * Removed Makefile, tools/Makefile, port/install.sh, man/Makefile + from CVS as they are all supposed to be auto-generated by configure. + +2001-09-22 Frank Warmerdam + + * libtiff/tif_ojpeg.c: new update from Scott. + +2001-09-09 Frank Warmerdam + + * libtif/tif_fax3.c: Removed #ifdef PURIFY logic, and modified to + always use the "safe" version, even if there is a very slight + cost in performance. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=54 + + * libtiff/Makefile.in: Fixed @DSOSUB_VERSION to be @DSOSUF_VERSION@ + in two places. + + * libtiff/tif_getimage.c: Fixed problem with reading strips or + tiles that don't start on a tile boundary. Fix contributed by + Josep Vallverdu (from HP), and further described in bug 47. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=47 + + * tools/tiff2ps.c: added OJPEG YCbCr to RGB support. + + * libtiff/tif_ojpeg.c: Applied substantial patch from Scott. + +2001-09-06 Frank Warmerdam + + * libtiff/tif_packbits.c: fixed memory overrun error. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=77 + +2001-08-31 Frank Warmerdam + + * libtiff/tif_getimage.c: relax handling of contig case where + there are extra samples that are supposed to be ignored. This + should now work for 8bit greyscale or palletted images. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=75 + +2001-08-28 Frank Warmerdam + + * libtiff/tif_getimage.c: Don't complain for CMYK (separated) + images with more than four samples per pixel. See: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=73 + +2001-08-10 Frank Warmerdam + + * libtiff/tif_getimage.c: Use memmove() instead of TIFFmemcpy() + in TIFFReadRGBATile() to avoid issues in cases of overlapping + buffers. See Bug 69 in Bugzilla. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=69 + + * tools/tiff2rgba.c: fixed getopt() call so that -b works again. + +2001-08-09 Frank Warmerdam + + * libtiff/tiff.h, libtiff/tif_fax3.c: added check for __LP64__ + when checking for 64 bit architectures as per bugzilla bug 67. + +2001-07-27 Frank Warmerdam + + * man/Makefile.in: add TIFFClientOpen link as per debian submitted + bug 66. + +2001-07-20 Frank Warmerdam + + * libtiff/tif_jpeg.c: Define HAVE_BOOLEAN on windows if RPCNDR.H + has been included. + +2001-07-19 Frank Warmerdam + + * libtiff/tif_open.c: Seek back to zero after failed read, + before writing header. + +2001-07-18 Frank Warmerdam + + * libtiff/tif_ojpeg.c: updates from Scott. Handles colors + much better. Now depends on having patched libjpeg as per + patch in contrib/ojpeg/*. + +2001-07-17 Frank Warmerdam + + * */Makefile.in: added DESTDIR support. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=60 + +2001-07-16 Frank Warmerdam + + * configure, libtiff/Makefile.in: applied OpenBSD patches + as per: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=61 + +2001-06-28 Frank Warmerdam + + * libtiff/tif_getimage.c: Fixed so that failure is properly + reported by gtTileContig, gtStripContig, gtTileSeparate and + gtStripSeparate. + + See http://bugzilla.remotesensing.org/show_bug.cgi?id=51 + + * tiffcmp.c: Fixed multi samples per pixel support for ContigCompare. + Updated bug section of tiffcmp.1 to note tiled file issues. + + See http://bugzilla.remotesensing.org/show_bug.cgi?id=53 + +2001-06-22 Frank Warmerdam + + * configure: Changes for DSO generation on AIX provided by + John Marquart . + + * configure, libtiff/Makeifle.in: Modified to build DSOs properly + on Darwin thanks to Robert Krajewski (rpk@alum.mit.edu) and + Keisuke Fujii (fujiik@jlcuxf.kek.jp). + +2001-06-13 Frank Warmerdam + + * tools/tiff2rgba.c: added -n flag to avoid emitting alpha component. + + * man/tiff2rgba.1: new + +2001-05-22 Frank Warmerdam + + * Added tiffset and tif_ojpeg to the dist lists in Makefile.in. + +2001-05-13 Frank Warmerdam + + * libtiff/tools/thumbnail.c: changed default output compression + to packbits from LZW since LZW isn't generally available. + +2001-05-12 Frank Warmerdam + + * libtiff/tif_ojpeg.c: New. + libtiff/tif_jpeg.c, tiffconf.h, tif_getimage.c: changes related + to OJPEG support. + + Scott Marovich supplied OJPEG support. + +2001-05-11 Frank Warmerdam + + * tiff.h: removed, it duplicates libtiff/tiff.h. + +2001-05-08 Frank Warmerdam + + * libtiff/tif_dirinfo.c: moved pixar and copyright flags to + ensure everything is in order. + + * libtiff/libtiff.def: added TIFFCreateDirectory and + TIFFDefaultStripSize as per: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=46 + +2001-05-02 Frank Warmerdam + + * libtiff/tif_dirinfo.c: Modified the TIFF_BYTE definition for + TIFFTAG_PHOTOSHOP to use a writecount of TIFF_VARIABLE2 (-3) to + force use of uint32 counts instead of short counts. + + * libtiff/tif_dirwrite.c: Added support for TIFF_VARIABLE2 in the + case of writing TIFF_BYTE/TIFF_SBYTE fields. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=43 + +2001-05-01 Frank Warmerdam + + * libtiff/tif_dirinfo.c: removed duplicate TIFFTAG_PHOTOSHOP as per + bug report http://bugzilla.remotesensing.org/show_bug.cgi?id=44 + +2001-04-05 Frank Warmerdam + + * tiffio.h: removed C++ style comment. + + * configure: fixed up SCRIPT_SH/SHELL handling. + + * Makefile.in: Fixed SCRIPT_SH/SHELL handling. + + * config.guess: documented more variables as per bug 40. + +2001-04-03 Frank Warmerdam + + * configure, *Makefile.in: Various changes to improve configuration + for HP/UX specifically, and also in general. They include: + - Try to handle /usr/bin/sh instead of /bin/sh where necessary. + - Upgrade to HP/UX 10.x+ compiler, linker and dso options. + - Fixed mmap() test to avoid MMAP_FIXED ... it isn't available on HP + - Use -${MAKEFLAGS} in sub makes from makefiles. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=40 + +2001-04-02 Frank Warmerdam + + * libtiff/tiff.h: Applied hac to try and resolve the problem + with the inttypes.h include file on AIX. + + See http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + + * VERSION: update to 3.5.7 beta in preparation for release. + + * configure/config.site: modified to check if -lm is needed for + MACHDEPLIBS if not supplied by config.site. Needed for Darwin. + + * config.guess: updated wholesale to an FSF version apparently + from 1998 (as opposed to 1994). This is mainly inspired by + providing for MacOS X support. + +2001-03-29 Frank Warmerdam + + * configure, Makefile.in, etc: added support for OPTIMIZER being + set from config.site. + +2001-03-28 Frank Warmerdam + + * fax2ps.c: Helge (libtiff at oldach.net) submitted fix: + + Here's a fix for fax2ps that corrects behaviour for non-Letter paper + sizes. It fixes two problems: + + Without scaling (-S) the fax is now centered on the page size specified + with -H and/or -W. Before, fax2ps was using an obscure and practially + useless algorithm to allocate the image relative to Letter sized paper + which sometime sled to useless whitespace on the paper, while at the + same time cutting of the faxes printable area at the opposite border. + + Second, scaling now preserves aspect ratio, which makes unusual faxes + (in particular short ones) print properly. + + See http://bugzilla.remotesensing.org/show_bug.cgi?id=35 + + * tiff2ps.c/tiff2ps.1: Substantial changes to tiff2ps by + Bruce A. Mallett. See check message for detailed information + on all the changes, including a faster encoder, fixes for level + 2 PostScript, and support for the imagemask operator. + +2001-03-27 Frank Warmerdam + + * libtiff/tiffio.h: Changed "#if LOGLUV_PUBLIC" to + "#ifdef LOGLUV_PUBLIC" so it will work with VisualAge on AIX. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=39 + +2001-03-16 Frank Warmerdam + + * tif_dirinfo.c: moved definition of copyright tag in field list. + Apparently they have to be in sorted order by tag id. + +2001-03-13 Frank Warmerdam + + * tif_getimage.c: Added support for 16bit minisblack/miniswhite + images in RGBA interface. + +2001-03-02 Frank Warmerdam + + * Added TIFFTAG_COPYRIGHT support. + +2001-02-19 Frank Warmerdam + + * Brent Roman contributed updated tiffcp utility (and tiffcp.1) + with support for extracting subimages with the ,n syntax, and also + adding the -b bias removal flag. + +2001-02-16 Frank Warmerdam + + * libtiff/libtiff.def: Brent Roman submitted new version adding + serveral missing entry points. + + * libtiff/tif_dirinfo.c: don't declare tiffFieldInfo static on VMS. + Some sort of weird VMS thing. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=31 + + * tif_luv.c/tiff.h/tiffio.h: + New version of TIFF LogLuv (SGILOG) modules contributed by Greg Ward + (greg@shutterfly.com). He writes: + + 1) I improved the gamut-mapping function in tif_luv.c for imaginary + colors, because some images were being super-saturated on the input + side and this resulted in some strange color shifts in the output. + + 2) I added a psuedotag in tiff.h to control random dithering during + LogLuv encoding. This is turned off by default for 32-bit LogLuv and + on for 24-bit LogLuv output. Dithering improves the average color + accuracy over the image. + + 3) I added a #define for LOG_LUV_PUBLIC, which is enabled by default in + tiffio.h, to expose internal routines for converting between LogLuv and + XYZ coordinates. This is helpful for writing more efficient, + specialized conversion routines, especially for reading LogLuv files. + + Changes applied with minor edits. + +2001-01-23 Frank Warmerdam + + * tif_fax3.c: keep rw_mode flag internal to fax3 state to remember + whether we are encoding or decoding. This is to ensure graceful + recovery if TIFFClientOpen() discovers an attempt to open a compressed + file for "r+" access, and subsequently close it, as it resets the + tif_mode flag to O_RDONLY in this case to avoid writes, confusing the + compressor's concept of whether it is in encode or decode mode. + +2001-01-08 Mike Welles + + * Makefile.in: Now cleaning up after itself after creating the .tar.gz and .zip + +2001-01-07 Frank Warmerdam + + * html/libtiff.html: Fixed arguments in example for TIFFRGBAImageGet() + as per bug report by Patrick Connor. + +2000-12-28 Frank Warmerdam + + * Added RELEASE-DATE file to release file list. + + * Fixed libtiff/makefile.vc to make tiffvers.h not version.h. + +2000-12-22 Mike Welles + * added link to CVS mirror from index.html + + * updated html/internals.html to note that LZW compression is + not supported by default. + +2000-12-22 Frank Warmerdam + + * updated html/libtiff.html to not point at Niles' old JPL web site + for the man pages, point at www.libtiff.org. + +2000-12-21 Frank Warmerdam + + * libtiff/tif_apple.c: Applied "Carbon" support patches supplied by + Leonard Rosenthol . May interfere + with correct building on older systems. If so, please let me know. + +2000-12-19 Mike Welles + + * Took out LZW Encoding from tif_lzw.c + + * Created HOWTO-RELEASE + + * Created html/v3.5.6.html + + * updated index.html + +2000-12-01 Frank Warmerdam + + * Added patches for EOFB support in tif_fax3.c and tif_fax3.h. + Patches supplied by Frank Cringle + Example file at: ftp://ftp.remotesensing.org/pub/libtiff/eofb_396.tif + +2000-11-24 Frank Warmerdam + + * libtiff/Makefile.in: Added an installPrivateHdrs and install-private + target so that the private headers required by libgeotiff can be + installed with the others. They are not installed by default. + + * libtiff/Makefile.in: Added @MACHLIBDEPS@ to LINUXdso and GNULDdso + targets so libtiff.so will be built with an explicit dependency + on libm.so. + + * libtiff/Makefile.in: Use softlinks to link libtiff.so.3 to + libtiff.so.3.5.5. + + * libtiff/Makefile.in & configure: Remove all references to the ALPHA + file, or ALPHA version logic. Added stuff about DIST_POINT in + place of DIST_TYPE and the alpha release number stuff. + +2000-11-22 Frank Warmerdam + + * I have applied a patch from Steffen Moeller to + the configure script so that it now accepts the --prefix, and + --exec-prefix directives. + +2000-11-13 Frank Warmerdam + + * I have made a variety of modifications in an effort to ensure the + TIFFLIB_VERSION macro is automatically generated from the RELEASE-DATE + file which seems to be updated regularly. + + o mkversion.c now reads RELEASE-DATE and emits TIFFLIB_VERSION in + version include file. + o renamed version.h to tiffvers.h because we now have to install it + with the public libtiff include files. + o include tiffvers.h in tiffio.h. + o updated tif_version.c to use tiffvers.h. + o Updated Makefile.in accordingly. + + * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=25 + I have updated the win32 detection rules in tiffcomp.h. + +2000-10-20 Frank Warmerdam + + * tif_getimage.c: Fixed RGBA translation for YCbCr images for which + the strip/tile width and height aren't multiples of the sampling size. + See http://bugzilla.remotesensing.org/show_bug.cgi?id=20 + Some patches from Rick LaMont of Dot C Software. + + * Modified tif_packbits.c encoder to avoid compressing more + data than provided if rowsize doesn't factor into provided data + (such as occurs for YCbCr). + +2000-10-19 Frank Warmerdam + + * tools/rgb2ycbcr.c: fixed output strip size to account for vertical + roundup if rows_per_strip not a multiple of vertical sample size. + +2000-10-16 Frank Warmerdam + + * tif_dir.c: Clear TIFF_ISTILED flag in TIFFDefaultDirectory + as per http://bugzilla.remotesensing.org/show_bug.cgi?id=18 + from vandrove@vc.cvut.cz. + + * Modified tif_packbits.c decoding to avoid overrunning the + output buffer, and to issue a warning if data needs to be + discarded. See http://bugzilla.remotesensing.org/show_bug.cgi?id=18 + +2000-10-12 Frank Warmerdam + + * Modified tiff2bw to ensure portions add to 100%, and that + white is properly recovered. + + See bug http://bugzilla.remotesensing.org/show_bug.cgi?id=15 + Patch c/o Stanislav Brabec + +2000-09-30 Frank Warmerdam + + * Modified TIFFClientOpen() to emit an error on an attempt to + open a comperessed file for update (O_RDWR/r+) access. This is + because the compressor/decompressor code gets very confused when + the mode is O_RDWR, assuming this means writing only. See + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=13 + +2000-09-27 Frank Warmerdam + + * Added GNULDdso target an`d switched linux and freebsd to use it. + +2000-09-26 Frank Warmerdam + + * Applied patch for 0x0000 sequences in tif_fax3.h's definition + of EXPAND1D() as per bug 11 (from Roman). + +2000-09-25 Frank Warmerdam + * Fixed tiffcomp.h to avoid win32 stuff if unix #defined, to improve + cygwin compatibility. + + * Applied patch from Roman Shpount to tif_fax3.c. This seems to + be a proper fix to the buffer sizing problem. See + http://bugzilla.remotesensing.org/show_bug.cgi?id=11 + + * Fixed tif_getimage.c to fix overrun bug with YCbCr images without + downsampling. http://bugzilla.remotesensing.org/show_bug.cgi?id=10 + Thanks to Nick Lamb for reporting the + bug and proving the patch. + +2000-09-18 Frank Warmerdam + + * Fixed tif_jpeg.c so avoid destroying the decompressor before + we are done access data thanks to bug report from: + Michael Eckstein . + + * Reverted tif_flush change. + +2000-09-14 Frank Warmerdam + + * tif_flush.c: Changed so that TIFFFlushData() doesn't return an + error when TIFF_BEENWRITING is not set. This ensures that the + directory contents can still be flushed by TIFFFlush(). + +2000-08-14 Frank Warmerdam + + * tif_open.c: Don't set MMAP for O_RDWR files. + + * tif_open.c: Set STRIPCHOP_DEFAULT for O_RDWR as well as O_RDONLY + so that files opened for update can be strip chopped too. + + * tif_read.c: fixed up bug with files missing rowsperstrip and + the strips per separation fix done a few weeks ago. + +2000-07-17 Frank Warmerdam + + * Tentatively added support for SAMPLEFORMAT_COMPLEXIEEEFP, and + SAMPLEFORMAT_COMPLEXINT. + +2000-07-13 Mike Welles + + * index.html, bugs.html: added bugzilla info. + +2000-07-12 Frank Warmerdam + + * tif_read.c: fix subtle bug with determining the number of + rows for strips that are the last strip in a separation but + not the last strip of all in TIFFReadEncodedStrip(). + + * Applied 16/32 bit fix to tif_fax3.c. Fix supplied by + Peter Skarpetis + +2000-06-15 Frank Warmerdam + + * Modified tiffio.h logic with regard to including windows.h. It + won't include it when building with __CYGWIN__. + +2000-05-11 Frank Warmerdam + + * README: update to mention www.libtiff.org, don't list Sam's old + email address. + + * configure: Fixed DSO test for Linux as per patch from + Jan Van Buggenhout . + +2000-04-21 Frank Warmerdam + + * libtiff/tif_dirread.c: Don't use estimate strip byte count for + one tile/strip images with an offset, and byte count of zero. These + could be "unpopulated" images. + +2000-04-18 Frank Warmerdam + + * contrib/addtiffo: Added "averaging" resampling option. + + * tools/tiffsplit.c: Copy TIFFTAG_SAMPLEFORMAT. + +Tue Apr 18 16:18:08 2000 Frank Warmerdam + + * tools/Makefile.in: Modified to install properly on SGI. + +2000-04-12 Mike Welles + * configure: Fixed stupid mistake in libc6 test on Linux + +2000-04-04 Mike Welles + * tif_win32.c: Applied patch to fix overreads and ovverwrites + caught by BoundsChecker. From Arvan Pritchard + (untested). + + * tif_getimage.c: Applied patch to silence VC6 warnings. From + Arvan Pritchard + + * tif_lzw.c: Applied patch to silence VC6 warnings. From + Arvan Pritchard + +2000-03-28 Frank Warmerdam + + * Added contrib/stream (stream io) code submitted by Avi Bleiweiss. + +2000-03-28 Frank Warmerdam *** 3.5.5 release *** + + * fax2ps: Fixed mixup of width and height in bounding box statement + as per submission by Nalin Dahyabhai . + +2000-03-27 Mike Welles + + * fax2ps: Modified printruns to take uint32 instead of uint16. + Patch courtesy of Bernt Herd + +2000-03-20 Mike Welles + + * configure: added test for libc6 for linux targets. Bug reported by + Stanislav Brabec + + * Added 3.5 docs to html/Makefile.in. + Thanks to Stanislav Brabec + + * configure: fixed bugs in sed scripts + (applied sed script s:/@:s;@:;s:/s;;:;: to configure). + fix submitted to Stanislav Brabec + + * tools/iptcutil was not in files list, and wasn't being + added to tar archive. Updated Makefile.in. + +2000-03-17 Frank Warmerdam + + * tif_fax3.c: Fixed serious bug introduced during the uint16->uint32 + conversion for the run arrays. + +2000-03-03 Frank Warmerdam + + * Set td_sampleformat default to SAMPLEFORMAT_UINT instead of + SAMPLEFORMAT_VOID in TIFFDefaultDirectory() in tif_dir.c. + +2000-03-02 Frank Warmerdam + + * Added "GetDefaulted" support for TIFFTAG_SAMPLEFORMAT in tif_aux.c. + + * Patched tif_fax3.c so that dsp->runs is allocated a bit bigger + to avoid overruns encountered with frle_bug.tif. + +Tue Feb 15 22:01:05 2000 Frank Warmerdam + + * Fixed tools/tiffcmp so that stopondiff testing works. + Patch care of Joseph Orost . + +2000-01-28 + + * Modified tif_unix.c to support 2-4GB seeks if USE_64BIT_API is + set to 1, and added default (off) setting in tiffconf.h. This + should eventually be set by the configure script somehow. + + The original work on all these 2-4GB changes was done by + Peter Smith (psmith@creo.com). + + * Modified tif_win32.c to support 2-4GB seeks. + + * tentatively changed toff_t to be unsigned instead of signed to + facilitate support for 2-4GB files. + + * Updated a variety of files to use toff_t. Fixed some mixups + between toff_t and tsize_t. + +Fri Jan 28 10:13:49 2000 Frank Warmerdam + + * Largely reimplemented contrib/addtiffo to avoid temp files, + updating the TIFF file in place. Fixed a few other bugs to. + + * Set tif_rawdatasize to zero when freeing raw data buffer in + TIFFWriteDirectory(). + + * Enabled "REWRITE_HACK" in tif_write.c by default. + + * Fix bug in tif_write.c when switching between reading one directory + and writing to another. + + * Made TIFFWriteCheck() public, and added TIFFCreateDirectory() + +Wed Jan 5 12:37:48 2000 Frank Warmerdam + + * Added TIFFmemory(3t) functions to libtiff.def. + +Tue Jan 4 13:39:00 2000 Frank Warmerdam + + * Added libtiff/libtiff.def to TIFFILES distribution list. + +Mon Dec 27 12:13:39 EST 1999 Mike Welles + + * Created lzw compression kit, as a new module (libtiff-lzw-compression-kit). + + * Altered descriptions in tools to reflect "by default" lzw not supported + + * Updated index.html to note lzw compression kit. + +Tue Dec 21 14:01:51 1999 Frank Warmerdam + + * Added fax3sm_winnt.c to distribution list in Makefile.in. + +Tue Dec 21 11:04:45 EST 1999 Mike Welles *** 3.5.4 release *** + + * Aadded Pixar tag support. Contributed by Phil Beffery + + * Made one more change to tif_dir.c for removal of LZW compression. Also added notice + when LZW compression invoked. + + * Changed default compression in tools to TIFF_PACKBITS, and changed usage descriptions + in tools to reflect removal of LZW compression + +Mon Dec 20 18:39:02 EST 1999 Mike Welles + + * Fixed bug that caused LZW (non) compression to segfault. Added + warning about LZW compression removed being removed, and why. + + * Added nostrip to install in tools/Makefile.in so that debugging + symbols are kept. + +Tue Dec 7 12:04:47 EST 1999 Mike Welles + + * Added patch from Ivo Penzar , + supporting Adobe ZIP deflate. Untested. + +Sat Dec 4 15:47:11 1999 Frank Warmerdam + + * Made Packbits the default compression in tools/tiff2rgba.c instead + of LZW. + +Tue Nov 30 14:41:43 1999 Frank Warmerdam *** 3.5.3. release *** + + * Added tif_luv to contrib/djgpp/Makefile.lib. + +Tue Nov 30 14:15:32 EST 1999 Mike Welles + + * Added zip creation to relase makefile target + + * Added html for TIFFWriteTile.3t man page. + +Tue Nov 30 09:20:16 1999 Frank Warmerdam + + * Added some changes to tif_write.c to support rewriting existing + fixed sized tiles and strips. Code mods disabled by default, only + enabled if REWRITE_HACK is defined for now. + +Mon Nov 29 11:43:42 1999 Frank Warmerdam + + * Added TIFFWriteTile.3t man page. + +Sun Nov 28 20:36:18 1999 Frank Warmerdam + + * Added notes on use of makefile.vc in build.html, and fixed + email subscription address. + +199-11-28 Mike Welles + + * Fixed apocalypse-inducing y2k bug in contrib/ras/ras2tiff.c + + * Did some casts cleaning up to reduce compiler warnings in tif_fax3.c, + from Bruce Carmeron -- modifications of + changes made by Frank (sun cc still complained on cast). + + * Added tiffconf.h to install target per request from Bill + Radcliffe : "We need a way for ImageMagick to + know features have been compiled into the TIFF library in order to + handle things properly". + +Sat Nov 27 16:49:21 1999 Frank Warmerdam + + * fixed various VC++ warnings as suggested by Gilles Vollant + . + +Wed Nov 24 12:08:16 1999 Frank Warmerdam + + * Modified TIFFquery.3t man pages info on TIFFIsByteSwapped() to + not imply applications are responsible for image data swapping. + +1999-11-22 Mike Welles + * HTML-ized the man pages, added to html/man + + * Removed LZW Compression to comply with Unisys patent extortion. + +1999-09-29 Mike Welles + * Corrected one remaining 16 -> 32 bit value in tif_fax3.c, + From Ivo Penzar + +1999-09-26 Mike Welles *** 3.5.2 release *** + * Corrected alpha versioning. + + * Removed distinction between alpha and release targets in Makefile.in. + + * added release.stamp target, which tags cvs tree, and updates + "RELEASE-DATE" + + * added releasediff target, which diffs tree with source as of + date in "RELEASE-DATE" + + * Ticked up version to 3.5.2 (alpha 01 -- but I think we'll moving + away from alpha/non-alpha distinctions). + + * updated html to reflect release + +1999-09-23 + + * Set O_BINARY for tif_unix.c open() ... used on cygwin for instance. + + * Added CYGWIN case in configure. + +Fri Sep 17 00:13:51 CEST 1999 Mike Welles + + * Applied Francois Dagand's patch to handle fax decompression bug. + (sizes >= 65536 were failing) + +Tue Sep 14 21:31:43 1999 Frank Warmerdam + + * Applied "a" mode fix to tif_win32.c/TIFFOpen() as suggested + by Christopher Lawton + +Wed Sep 8 08:19:18 1999 Frank Warmerdam + + * Added IRIX/gcc, and OSF/1 4.x support on behalf of + Albert Chin-A-Young + + * Added TIFFReassignTagToIgnore() API on behalf of + Bruce Cameron . Man page still pending. + +Wed Aug 25 11:39:07 1999 Frank Warmerdam + + * Added test target in Makefile, test_pics.sh script and pics/*.rpt + files to provide for a rudimentary testsuite. + + * Added contrib/tags back from old distribution ... fixed up a bit. + +1999-08-16 + + * Added simple makefile.vc makefiles for building with MS VC++ + on Windows NT/98/95 in console mode. Stuff in contrib/win* make give + better solutions for some users. + +Mon Aug 16 21:52:11 1999 Frank Warmerdam + + * Added addtiffo (add overviews to a TIFF file) in contrib. Didn't + put it in tools since part of it is in C++. + +1999-08-16 Michael L. Welles + + * Updated html/index.html with anon CVS instructions. + +Mon Aug 16 13:18:41 1999 Frank Warmerdam + + * pre-remove so link before softlink in LINUXdso action in + libtiff/Makefile.in to avoid failure on LINUXdso builds other than + the first. + + * Fixed problem with cvtcmap() in tif_getimage.c modifying the + colormaps owned by the TIFF handle itself when trying to fixup wrong + (eight bit) colormaps. Corrected by maintaining a private copy of + the colormap. + + * Added TIFFReadRGBATile()/TIFFReadRGBAStrip() support in + tif_getimage.c. + + * CVS Repository placed at remotesensing.org. ChangeLog added. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/HOWTO-RELEASE b/thirdparty/LibTIFF/tiff-4.0.3/HOWTO-RELEASE new file mode 100644 index 0000000..701ca75 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/HOWTO-RELEASE @@ -0,0 +1,117 @@ +HOWTO-RELEASE: + +Notes on releasing. + +0. Make sure that you have current FSF releases of autoconf, automake, + and libtool packages installed under a common installation prefix + and that these tools are in your executable search path prior to + any other installed versions. Versions delivered with Linux may be + altered so it is best to install official FSF releases. GNU 'm4' + 1.4.16 is needed in order to avoid bugs in m4. These packages may + be downloaded from the following ftp locations: + + autoconf - ftp://ftp.gnu.org/pub/gnu/autoconf + automake - ftp://ftp.gnu.org/pub/gnu/automake + libtool - ftp://ftp.gnu.org/pub/gnu/libtool + m4 - ftp://ftp.gnu.org/pub/gnu/m4 + + Release builds should only be done on a system with a functioning + and correctly set system clock and on a filesystem which accurately + records file update times. Use of GNU make is recommended. + +1. Commit any unsaved changes. + +2. Create html/vX.X.html. Take ChangeLog entries and html-ify in there. + Easist thing to do is take html/vX.(X-1).html and use it as a template. + Add that file to the list of EXTRA_DIST files in the html/Makefile.am. + +3. Update html/index.html to refer to this new page as the current release. + +4. Increment the release version in configure.ac. Put 'alpha' or + 'beta' after the version, if applicable. For example: + + 4.0.0 + or + 4.0.0beta7 + + Version should be updated in two places: in the second argument of the + AC_INIT macro and in LIBTIFF_xxx_VERSION variables. + +5. Update library ELF versioning in configure.ac (LIBTIFF_CURRENT, + LIBTIFF_REVISION, and LIBTIFF_AGE). These numbers have nothing to + do with the libtiff release version numbers. + + Note that as of libtiff 4.X, proper ELF versioning is used so + please follow the rules listed in configure.ac. At a bare minimum, + you should increment LIBTIFF_REVISION for each release so that + installed library files don't overwrite existing files. If APIs + have been added, removed, or interface structures have changed, + then more care is required. + +6. Add an entry to Changelog similar to: + + * libtiff 4.0.0 released. + +7. In the source tree do + + ./autogen.sh + + This step may be skipped if you have already been using a + maintainer build with current autoconf, automake, and libtool + packages. It is only needed when updating tool versions. + +8. It is recommended (but not required) to build outside of the source + tree so that the source tree is kept in a pristine state. This + also allows sharing the source directory on several networked + systems. For example: + + mkdir libtiff-build + cd libtiff-build + /path/to/libtiff/configure --enable-maintainer-mode + + otherwise do + + ./configure --enable-maintainer-mode + +9. In the build tree do + + make release + + This will update "RELEASE-DATE", "VERSION", and libtiff/tiffvers.h + in the source tree. + +10. In the source tree, verify that the version info in RELEASE-DATE, + VERSION and libtiff/tiffvers.h is right. + +11. In the build tree do + + make + make distcheck + + If 'make distcheck' fails, then correct any issues until it + succeeds. + + Two files with names tiff-version.tar.gz and tiff-version.zip will + be created in the top level build directory. + +12. In the source tree do + + 'cvs commit'. + +13. In the source tree do + + cvs tag Release-v4-0-0 + + (or the appropriate name for the release) + +14. Copy release packages from the build tree to the + ftp.remotesensing.org ftp site. + + scp tiff-*.tar.gz tiff-*.zip \ + warmerdam@upload.osgeo.org:/osgeo/download/libtiff + +15. Announce to list, tiff@lists.maptools.org + +16. Update libtiff page on freshmeat with new version announcement. + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.am new file mode 100644 index 0000000..996297e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.am @@ -0,0 +1,59 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +docdir = $(LIBTIFF_DOCDIR) + +AUTOMAKE_OPTIONS = 1.12 dist-zip foreign +ACLOCAL_AMFLAGS = -I m4 + +docfiles = \ + COPYRIGHT \ + ChangeLog \ + README \ + README.vms \ + RELEASE-DATE \ + TODO \ + VERSION + +EXTRA_DIST = \ + HOWTO-RELEASE \ + Makefile.vc \ + SConstruct \ + autogen.sh \ + configure.com \ + nmake.opt \ + libtiff-4.pc.in + +dist_doc_DATA = $(docfiles) + +SUBDIRS = port libtiff tools build contrib test man html + +release: + (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) + (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) + (rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libtiff-4.pc diff --git a/thirdparty/LibTIFF/tiff-4.0.3/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.in new file mode 100644 index 0000000..6832eb8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.in @@ -0,0 +1,926 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libtiff-4.pc.in $(top_srcdir)/config/compile \ + $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing \ + $(top_srcdir)/config/mkinstalldirs $(top_srcdir)/configure \ + ChangeLog TODO config/compile config/config.guess \ + config/config.sub config/depcomp config/install-sh \ + config/ltmain.sh config/missing config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = libtiff-4.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" +DATA = $(dist_doc_DATA) $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip +GZIP_ENV = --best +DIST_TARGETS = dist-gzip dist-zip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = $(LIBTIFF_DOCDIR) +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.12 dist-zip foreign +ACLOCAL_AMFLAGS = -I m4 +docfiles = \ + COPYRIGHT \ + ChangeLog \ + README \ + README.vms \ + RELEASE-DATE \ + TODO \ + VERSION + +EXTRA_DIST = \ + HOWTO-RELEASE \ + Makefile.vc \ + SConstruct \ + autogen.sh \ + configure.com \ + nmake.opt \ + libtiff-4.pc.in + +dist_doc_DATA = $(docfiles) +SUBDIRS = port libtiff tools build contrib test man html +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libtiff-4.pc +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +libtiff-4.pc: $(top_builddir)/config.status $(srcdir)/libtiff-4.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_docDATA install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-cscope \ + clean-generic clean-libtool cscope cscopelist \ + cscopelist-recursive ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_docDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-dist_docDATA uninstall-pkgconfigDATA + + +release: + (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) + (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) + (rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.vc new file mode 100644 index 0000000..2d894c2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/Makefile.vc @@ -0,0 +1,58 @@ +# $Id: Makefile.vc,v 1.7 2008/01/01 15:53:10 fwarmerdam Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# Makefile for MS Visual C and Watcom C compilers. +# Edit nmake.opt file if you want to ajust building options. +# +# To build: +# C:\libtiff> nmake /f makefile.vc + +!INCLUDE nmake.opt + +all: port lib tools + +port:: + cd port + $(MAKE) /f Makefile.vc + cd.. + +lib: port + cd libtiff + $(MAKE) /f Makefile.vc + cd.. + +tools: lib + cd tools + $(MAKE) /f Makefile.vc + cd .. + +clean: + cd port + $(MAKE) /f Makefile.vc clean + cd.. + cd libtiff + $(MAKE) /f Makefile.vc clean + cd.. + cd tools + $(MAKE) /f Makefile.vc clean + cd .. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/README b/thirdparty/LibTIFF/tiff-4.0.3/README new file mode 100644 index 0000000..5f30f4e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/README @@ -0,0 +1,61 @@ +$Header: /cvs/maptools/cvsroot/libtiff/README,v 1.7 2012-02-18 21:53:27 bfriesen Exp $ + + +TIFF Software Distribution +-------------------------- +This file is just a placeholder; all the documentation is now in +HTML in the html directory. To view the documentation point your +favorite WWW viewer at html/index.html; + +e.g. + + firefox html/index.html + +If you don't have an HTML viewer then you can read the HTML source +or fetch a PostScript version of this documentation from the directory + + ftp://ftp.remotesensing.org/pub/libtiff/ + +If you can't hack either of these options then basically what you +want to do is: + + % ./configure + % make + % su + # make install + +More information, email contacts, and mailing list information can be +found online at http://www.remotesensing.org/libtiff/. + + +Use and Copyright +----------------- +Silicon Graphics has seen fit to allow us to give this work away. It +is free. There is no support or guarantee of any sort as to its +operations, correctness, or whatever. If you do anything useful with +all or parts of it you need to honor the copyright notices. I would +also be interested in knowing about it and, hopefully, be acknowledged. + +The legal way of saying that is: + +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/README.vms b/thirdparty/LibTIFF/tiff-4.0.3/README.vms new file mode 100644 index 0000000..44d9663 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/README.vms @@ -0,0 +1,12 @@ +Dear OpenVMS user +to make this library, execute +$@CONFIGURE +$@BUILD + +Build process should be error and warning free. When process will be finished, +LIBTIFF$STRATUP.COM file containing all required definitions, will be created. +Please call it from system startup procedure or individual user procedure LOGIN.COM +To link software with libtiff, use TIFF:LIBTIFF.OPT + +best regards, +Alexey Chupahin, elvis_75@mail.ru diff --git a/thirdparty/LibTIFF/tiff-4.0.3/RELEASE-DATE b/thirdparty/LibTIFF/tiff-4.0.3/RELEASE-DATE new file mode 100644 index 0000000..f0326d2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/RELEASE-DATE @@ -0,0 +1 @@ +20120922 diff --git a/thirdparty/LibTIFF/tiff-4.0.3/SConstruct b/thirdparty/LibTIFF/tiff-4.0.3/SConstruct new file mode 100644 index 0000000..682246e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/SConstruct @@ -0,0 +1,171 @@ +# $Id: SConstruct,v 1.4 2007/02/24 15:03:47 dron Exp $ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2005, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# This file contains rules to build software with the SCons tool +# (see the http://www.scons.org/ for details on SCons). + +import os + +env = Environment() + +# Read the user supplied options +opts = Options('libtiff.conf') +opts.Add(PathOption('PREFIX', \ + 'install architecture-independent files in this directory', \ + '/usr/local', PathOption.PathIsDirCreate)) +opts.Add(BoolOption('ccitt', \ + 'enable support for CCITT Group 3 & 4 algorithms', \ + 'yes')) +opts.Add(BoolOption('packbits', \ + 'enable support for Macintosh PackBits algorithm', \ + 'yes')) +opts.Add(BoolOption('lzw', \ + 'enable support for LZW algorithm', \ + 'yes')) +opts.Add(BoolOption('thunder', \ + 'enable support for ThunderScan 4-bit RLE algorithm', \ + 'yes')) +opts.Add(BoolOption('next', \ + 'enable support for NeXT 2-bit RLE algorithm', \ + 'yes')) +opts.Add(BoolOption('logluv', \ + 'enable support for LogLuv high dynamic range encoding', \ + 'yes')) +opts.Add(BoolOption('strip_chopping', \ + 'support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage)', \ + 'yes')) +opts.Add(BoolOption('extrasample_as_alpha', \ + 'the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don\'t mark the alpha properly', \ + 'yes')) +opts.Add(BoolOption('check_ycbcr_subsampling', \ + 'disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag', \ + 'yes')) +opts.Update(env) +opts.Save('libtiff.conf', env) +Help(opts.GenerateHelpText(env)) + +# Here are our installation paths: +idir_prefix = '$PREFIX' +idir_lib = '$PREFIX/lib' +idir_bin = '$PREFIX/bin' +idir_inc = '$PREFIX/include' +idir_doc = '$PREFIX/doc' +Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ]) + +# Now proceed to system feature checks +target_cpu, target_vendor, target_kernel, target_os = \ + os.popen("./config/config.guess").readlines()[0].split("-") + +def Define(context, key, have): + import SCons.Conftest + SCons.Conftest._Have(context, key, have) + +def CheckCustomOption(context, name): + context.Message('Checking is the ' + name + ' option set... ') + ret = env[name] + Define(context, name + '_SUPPORT', ret) + context.Result(ret) + return ret + +def CheckFillorderOption(context): + context.Message('Checking for the native cpu bit order... ') + if target_cpu[0] == 'i' and target_cpu[2:] == '86': + Define(context, 'HOST_FILLORDER', 'FILLORDER_LSB2MSB') + context.Result('lsb2msb') + else: + Define(context, 'HOST_FILLORDER', 'FILLORDER_MSB2LSB') + context.Result('msb2lsb') + return 1 + +def CheckIEEEFPOption(context): + context.Message('Checking for the IEEE floating point format... ') + Define(context, 'HAVE_IEEEFP', 1) + context.Result(1) + return 1 + +def CheckOtherOption(context, name): + context.Message('Checking is the ' + name + ' option set... ') + ret = env[name] + Define(context, 'HAVE_' + name, ret) + context.Result(ret) + return ret + +custom_tests = { \ + 'CheckCustomOption' : CheckCustomOption, \ + 'CheckFillorderOption' : CheckFillorderOption, \ + 'CheckIEEEFPOption' : CheckIEEEFPOption, \ + 'CheckOtherOption' : CheckOtherOption \ + } +conf = Configure(env, custom_tests = custom_tests, \ + config_h = 'libtiff/tif_config.h') + +# Check for standard library +conf.CheckLib('c') +if target_os != 'cygwin' \ + and target_os != 'mingw32' \ + and target_os != 'beos' \ + and target_os != 'darwin': + conf.CheckLib('m') + +# Check for system headers +conf.CheckCHeader('assert.h') +conf.CheckCHeader('fcntl.h') +conf.CheckCHeader('io.h') +conf.CheckCHeader('limits.h') +conf.CheckCHeader('malloc.h') +conf.CheckCHeader('search.h') +conf.CheckCHeader('sys/time.h') +conf.CheckCHeader('unistd.h') + +# Check for standard library functions +conf.CheckFunc('floor') +conf.CheckFunc('isascii') +conf.CheckFunc('memmove') +conf.CheckFunc('memset') +conf.CheckFunc('mmap') +conf.CheckFunc('pow') +conf.CheckFunc('setmode') +conf.CheckFunc('sqrt') +conf.CheckFunc('strchr') +conf.CheckFunc('strrchr') +conf.CheckFunc('strstr') +conf.CheckFunc('strtol') + +conf.CheckFillorderOption() +conf.CheckIEEEFPOption() +conf.CheckCustomOption('ccitt') +conf.CheckCustomOption('packbits') +conf.CheckCustomOption('lzw') +conf.CheckCustomOption('thunder') +conf.CheckCustomOption('next') +conf.CheckCustomOption('logluv') +conf.CheckOtherOption('strip_chopping') +conf.CheckOtherOption('extrasample_as_alpha') +conf.CheckOtherOption('check_ycbcr_subsampling') + +env = conf.Finish() + +# Ok, now go to build files in the subdirectories +SConscript(dirs = [ 'libtiff' ], name = 'SConstruct') diff --git a/thirdparty/LibTIFF/tiff-4.0.3/TODO b/thirdparty/LibTIFF/tiff-4.0.3/TODO new file mode 100644 index 0000000..2ff8627 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/TODO @@ -0,0 +1,12 @@ +# $Header: /cvs/libtiff/TODO,v 1.6 2002/10/10 05:28:43 warmerda Exp $ + +o gif2tiff segaulting on selected images +o tiffcmp read data by strip/tile instead of scanline +o YCbCr sampling support +o extracate colorspace conversion support +o look at isolating all codecs from TIFF library +o JPEG colormode order dependency problem +o Write documentation on how do extend tags, and how the custom field + stuff all works. + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/VERSION b/thirdparty/LibTIFF/tiff-4.0.3/VERSION new file mode 100644 index 0000000..c4e41f9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/VERSION @@ -0,0 +1 @@ +4.0.3 diff --git a/thirdparty/LibTIFF/tiff-4.0.3/aclocal.m4 b/thirdparty/LibTIFF/tiff-4.0.3/aclocal.m4 new file mode 100644 index 0000000..d7d14c8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/aclocal.m4 @@ -0,0 +1,1080 @@ +# generated automatically by aclocal 1.12.4 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.12' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.12.4], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.12.4])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], +[$0: two- and three-arguments forms are deprecated. For more info, see: +http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +dnl Support for Objective C++ was only introduced in Autoconf 2.65, +dnl but we still cater to Autoconf 2.62. +m4_ifdef([AC_PROG_OBJCXX], +[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of '-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/acinclude.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/autogen.sh b/thirdparty/LibTIFF/tiff-4.0.3/autogen.sh new file mode 100644 index 0000000..5633885 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/autogen.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -x +libtoolize --force --copy +aclocal -I ./m4 +autoheader +automake --foreign --add-missing --copy +autoconf + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/compile b/thirdparty/LibTIFF/tiff-4.0.3/config/compile new file mode 100644 index 0000000..1b1d232 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/config.guess b/thirdparty/LibTIFF/tiff-4.0.3/config/config.guess new file mode 100644 index 0000000..ca2a03c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/config.guess @@ -0,0 +1,1526 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-08' + +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 + +# 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 tupples: *-*-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=`(/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 ;; + *) 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*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + 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 + # 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}" + 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'` + exit ;; + 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 ;; + 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:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-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 /* 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 + + 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:*:[456]) + 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/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + 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 + #include + + 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 __LP64__ >/dev/null + 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 + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + 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 ;; + 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-gnu`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/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + 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-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + 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 ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) + 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' /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 i386. + echo i386-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; } ;; + 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.0*:*) + 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 + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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 ;; + 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 + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + 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 ;; + 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 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < 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/thirdparty/LibTIFF/tiff-4.0.3/config/config.sub b/thirdparty/LibTIFF/tiff-4.0.3/config/config.sub new file mode 100644 index 0000000..6759825 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/config.sub @@ -0,0 +1,1658 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-16' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# 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. + +# 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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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) + os= + basic_machine=$1 + ;; + -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*) + 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 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | 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 | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-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-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | 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-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-*) + ;; + # 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 + ;; + 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 + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + 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) + 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 + ;; + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + 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 + ;; + 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 + ;; + mingw32) + basic_machine=i386-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 + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + 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 + ;; + 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) basic_machine=powerpc-unknown + ;; + ppc-*) 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) + 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 + ;; + 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 + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-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 + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-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[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. + -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* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -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* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -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*) + # 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 + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -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 + ;; + # 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + 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 + ;; + -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/thirdparty/LibTIFF/tiff-4.0.3/config/depcomp b/thirdparty/LibTIFF/tiff-4.0.3/config/depcomp new file mode 100644 index 0000000..ca5ea4e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/install-sh b/thirdparty/LibTIFF/tiff-4.0.3/config/install-sh new file mode 100644 index 0000000..4fbbae7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment 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}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # 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 test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/ltmain.sh b/thirdparty/LibTIFF/tiff-4.0.3/config/ltmain.sh new file mode 100644 index 0000000..e172628 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/ltmain.sh @@ -0,0 +1,9655 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.2 +TIMESTAMP="" +package_revision=1.3337 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/missing b/thirdparty/LibTIFF/tiff-4.0.3/config/missing new file mode 100644 index 0000000..1c8ff70 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/mkinstalldirs b/thirdparty/LibTIFF/tiff-4.0.3/config/mkinstalldirs new file mode 100644 index 0000000..ef7e16f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/mkinstalldirs @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/config/test-driver b/thirdparty/LibTIFF/tiff-4.0.3/config/test-driver new file mode 100644 index 0000000..aba4d1d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/config/test-driver @@ -0,0 +1,127 @@ +#! /bin/sh +# test-driver - basic driver script for the 'parallel-tests' mode. + +scriptversion=2012-06-27.10; # UTC + +# Copyright (C) 2011-2012 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, see . + +# 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/configure b/thirdparty/LibTIFF/tiff-4.0.3/configure new file mode 100644 index 0000000..8f27f01 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/configure @@ -0,0 +1,22610 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.0.3. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: tiff@lists.maptools.org about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='LibTIFF Software' +PACKAGE_TARNAME='tiff' +PACKAGE_VERSION='4.0.3' +PACKAGE_STRING='LibTIFF Software 4.0.3' +PACKAGE_BUGREPORT='tiff@lists.maptools.org' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBDIR +WIN32_IO_FALSE +WIN32_IO_TRUE +HAVE_OPENGL_FALSE +HAVE_OPENGL_TRUE +GLUT_LIBS +GLUT_CFLAGS +GLU_LIBS +GLU_CFLAGS +GL_LIBS +GL_CFLAGS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +HAVE_CXX_FALSE +HAVE_CXX_TRUE +LIBTIFF_DOCDIR +HAVE_RPATH_FALSE +HAVE_RPATH_TRUE +LIBOBJS +tiff_libs_private +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CXXCPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LN_S +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LIBTIFF_RELEASE_DATE +LIBTIFF_VERSION_INFO +LIBTIFF_VERSION +LIBTIFF_ALPHA_VERSION +LIBTIFF_MICRO_VERSION +LIBTIFF_MINOR_VERSION +LIBTIFF_MAJOR_VERSION +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +enable_ld_version_script +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_silent_rules +enable_rpath +enable_largefile +with_docdir +enable_ccitt +enable_packbits +enable_lzw +enable_thunder +enable_next +enable_logluv +enable_mdi +enable_zlib +with_zlib_include_dir +with_zlib_lib_dir +enable_pixarlog +enable_jpeg +with_jpeg_include_dir +with_jpeg_lib_dir +enable_old_jpeg +enable_jbig +with_jbig_include_dir +with_jbig_lib_dir +enable_lzma +with_lzma_include_dir +with_lzma_lib_dir +enable_jpeg12 +with_jpeg12_include_dir +with_jpeg12_lib +enable_cxx +with_x +enable_strip_chopping +with_default_strip_size +enable_defer_strile_load +enable_chunky_strip_read +enable_extrasample_as_alpha +enable_check_ycbcr_subsampling +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +XMKMF' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures LibTIFF Software 4.0.3 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/tiff] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +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 LibTIFF Software 4.0.3:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-ld-version-script + enable linker version script (default is disabled) + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-rpath Enable runtime linker paths (-R libtool option) + --disable-largefile omit support for large files + --disable-ccitt disable support for CCITT Group 3 & 4 algorithms + --disable-packbits disable support for Macintosh PackBits algorithm + --disable-lzw disable support for LZW algorithm + --disable-thunder disable support for ThunderScan 4-bit RLE algorithm + --disable-next disable support for NeXT 2-bit RLE algorithm + --disable-logluv disable support for LogLuv high dynamic range + encoding + --disable-mdi disable support for Microsoft Document Imaging + --disable-zlib disable Zlib usage (required for Deflate + compression, enabled by default) + --disable-pixarlog disable support for Pixar log-format algorithm + (requires Zlib) + --disable-jpeg disable IJG JPEG library usage (required for JPEG + compression, enabled by default) + --disable-old-jpeg disable support for Old JPEG compresson (read-only, + enabled by default) + --disable-jbig disable JBIG-KIT usage (required for ISO JBIG + compression, enabled by default) + --disable-lzma disable liblzma usage (required for LZMA2 + compression, enabled by default) + --enable-jpeg12 enable libjpeg 8/12bit dual mode + --enable-cxx enable C++ stream API building (requires C++ + compiler) + --disable-strip-chopping + disable support for strip chopping (whether or not + to convert single-strip uncompressed images to + mutiple strips of specified size to reduce memory + usage) + --enable-defer-strile-load + enable deferred strip/tile offset/size loading + (experimental) + --enable-chunky-strip-read + enable reading large strips in chunks for + TIFFReadScanline() (experimental) + --disable-extrasample-as-alpha + the RGBA interface will treat a fourth sample with + no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha + properly + --disable-check-ycbcr-subsampling + disable picking up YCbCr subsampling info from the + JPEG data stream to support files lacking the tag + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-docdir=DIR directory where documentation should be installed + --with-zlib-include-dir=DIR + location of Zlib headers + --with-zlib-lib-dir=DIR location of Zlib library binary + --with-jpeg-include-dir=DIR + location of IJG JPEG library headers + --with-jpeg-lib-dir=DIR location of IJG JPEG library binary + --with-jbig-include-dir=DIR + location of JBIG-KIT headers + --with-jbig-lib-dir=DIR location of JBIG-KIT library binary + --with-lzma-include-dir=DIR + location of liblzma headers + --with-lzma-lib-dir=DIR location of liblzma library binary + --with-jpeg12-include-dir=DIR + location of libjpeg 12bit headers + --with-jpeg12-lib=LIBRARY + path to libjpeg 12bit library + --with-x use the X Window System + --with-default-strip-size=SIZE + default size of the strip in bytes (when strip + chopping enabled) [[default=8192]] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System + +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 . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +LibTIFF Software configure 4.0.3 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------------- ## +## Report this to tiff@lists.maptools.org ## +## -------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by LibTIFF Software $as_me 4.0.3, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +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 + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +am__api_version='1.12' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='tiff' + VERSION='4.0.3' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +LIBTIFF_MAJOR_VERSION=4 +LIBTIFF_MINOR_VERSION=0 +LIBTIFF_MICRO_VERSION=3 +LIBTIFF_ALPHA_VERSION= +LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION +LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"` + +LIBTIFF_CURRENT=7 +LIBTIFF_REVISION=0 +LIBTIFF_AGE=2 +LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE + +# This is a special hack for OpenBSD and MirOS systems. The dynamic linker +# in OpenBSD uses some special semantics for shared libraries. Their soname +# contains only two numbers, major and minor. +# See http://bugzilla.remotesensing.org/show_bug.cgi?id=838 for details. +#case "$host_os" in +# openbsd* | mirbsd*) +# LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION:0 +# ;; +# *) +# LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION +# ;; +#esac + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + + + ansi= + if test -z "$ansi"; then + msg="for C compiler warning flags" + else + msg="for C compiler warning and ANSI conformance flags" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5 +$as_echo_n "checking $msg... " >&6; } +if ${vl_cv_prog_cc_warnings+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test -n "$CC"; then + cat > conftest.c <&1 | grep -i "WorkShop" > /dev/null 2>&1 && + $CC -c -v -Xc conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-v" + else + vl_cv_prog_cc_warnings="-v -Xc" + fi + + elif $CC -V 2>&1 | grep -i "Digital UNIX Compiler" > /dev/null 2>&1 && + $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos" + else + vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1" + fi + + elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 && + $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" + else + vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi" + fi + + elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 && + $CC -c -fullwarn -ansi -ansiE conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-fullwarn" + else + vl_cv_prog_cc_warnings="-fullwarn -ansi -ansiE" + fi + + elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 && + $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="+w1" + else + vl_cv_prog_cc_warnings="+w1 -Aa" + fi + + elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 && + $CC -c -pvctl,fullmsg -Xc conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-pvctl,fullmsg" + else + vl_cv_prog_cc_warnings="-pvctl,fullmsg -Xc" + fi + + elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 && + $CC -c -h msglevel 2 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-h msglevel 2" + else + vl_cv_prog_cc_warnings="-h msglevel 2 -h conform" + fi + + fi + rm -f conftest.* + fi + if test -n "$vl_cv_prog_cc_warnings"; then + CFLAGS="$CFLAGS $vl_cv_prog_cc_warnings" + else + vl_cv_prog_cc_warnings="unknown" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vl_cv_prog_cc_warnings" >&5 +$as_echo "$vl_cv_prog_cc_warnings" >&6; } + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + + +# Check if LD supports linker scripts, and define automake conditional +# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently +# constrained to compilers using GNU ld on ELF systems or systems +# which provide an adequate emulation thereof. +# Check whether --enable-ld-version-script was given. +if test "${enable_ld_version_script+set}" = set; then : + enableval=$enable_ld_version_script; have_ld_version_script=$enableval +else + have_ld_version_script=no +fi + +if test "$have_ld_version_script" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5 +$as_echo_n "checking if LD -Wl,--version-script works... " >&6; } + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map <conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_ld_version_script=yes +else + have_ld_version_script=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + rm -f conftest.map + LDFLAGS="$save_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5 +$as_echo "$have_ld_version_script" >&6; } +fi + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +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 + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +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 + + + +# Enable support for silent build rules +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +case "${host_os}" in + cygwin* | mingw32* | beos* | darwin*) + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 +$as_echo_n "checking for sin in -lm... " >&6; } +if ${ac_cv_lib_m_sin+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); +int +main () +{ +return sin (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sin=yes +else + ac_cv_lib_m_sin=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 +$as_echo "$ac_cv_lib_m_sin" >&6; } +if test "x$ac_cv_lib_m_sin" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + + ;; +esac + +tiff_libs_private= + + +for ac_header in assert.h fcntl.h io.h limits.h malloc.h search.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 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 sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$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 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if ${ac_cv_struct_tm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + + +# Obtain size of an 'signed short' and define as SIZEOF_SIGNED_SHORT +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed short" >&5 +$as_echo_n "checking size of signed short... " >&6; } +if ${ac_cv_sizeof_signed_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed short))" "ac_cv_sizeof_signed_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_signed_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (signed short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_signed_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_short" >&5 +$as_echo "$ac_cv_sizeof_signed_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short +_ACEOF + + + +# Obtain size of an 'unsigned short' and define as SIZEOF_UNSIGNED_SHORT +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5 +$as_echo_n "checking size of unsigned short... " >&6; } +if ${ac_cv_sizeof_unsigned_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5 +$as_echo "$ac_cv_sizeof_unsigned_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short +_ACEOF + + + +# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed int" >&5 +$as_echo_n "checking size of signed int... " >&6; } +if ${ac_cv_sizeof_signed_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed int))" "ac_cv_sizeof_signed_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_signed_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (signed int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_signed_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_int" >&5 +$as_echo "$ac_cv_sizeof_signed_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_INT $ac_cv_sizeof_signed_int +_ACEOF + + + +# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5 +$as_echo_n "checking size of unsigned int... " >&6; } +if ${ac_cv_sizeof_unsigned_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5 +$as_echo "$ac_cv_sizeof_unsigned_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int +_ACEOF + + + +# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed long" >&5 +$as_echo_n "checking size of signed long... " >&6; } +if ${ac_cv_sizeof_signed_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed long))" "ac_cv_sizeof_signed_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_signed_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (signed long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_signed_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_long" >&5 +$as_echo "$ac_cv_sizeof_signed_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_LONG $ac_cv_sizeof_signed_long +_ACEOF + + + +# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5 +$as_echo_n "checking size of unsigned long... " >&6; } +if ${ac_cv_sizeof_unsigned_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long +_ACEOF + + + +# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. +# If 'long long' is not supported then the value defined is zero. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed long long" >&5 +$as_echo_n "checking size of signed long long... " >&6; } +if ${ac_cv_sizeof_signed_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed long long))" "ac_cv_sizeof_signed_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_signed_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (signed long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_signed_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_long_long" >&5 +$as_echo "$ac_cv_sizeof_signed_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long +_ACEOF + + + +# Obtain size of a 'unsigned long long' and define as +# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not +# supported then the value defined is zero. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5 +$as_echo_n "checking size of unsigned long long... " >&6; } +if ${ac_cv_sizeof_unsigned_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5 +$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long +_ACEOF + + + +# Obtain the size of an 'unsigned char *' and define as +# SIZEOF_UNSIGNED_CHAR_P. Result is available in +# ac_cv_sizeof_unsigned_char_p. +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned char *" >&5 +$as_echo_n "checking size of unsigned char *... " >&6; } +if ${ac_cv_sizeof_unsigned_char_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned char *))" "ac_cv_sizeof_unsigned_char_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_char_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (unsigned char *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_unsigned_char_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_char_p" >&5 +$as_echo "$ac_cv_sizeof_unsigned_char_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_CHAR_P $ac_cv_sizeof_unsigned_char_p +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 8-bit type" >&5 +$as_echo_n "checking for signed 8-bit type... " >&6; } +INT8_T='signed char' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT8_T" >&5 +$as_echo "$INT8_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT8_T $INT8_T +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 8-bit type" >&5 +$as_echo_n "checking for unsigned 8-bit type... " >&6; } +UINT8_T='unsigned char' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT8_T" >&5 +$as_echo "$UINT8_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT8_T $UINT8_T +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 16-bit type" >&5 +$as_echo_n "checking for signed 16-bit type... " >&6; } +INT16_T='signed short' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT16_T" >&5 +$as_echo "$INT16_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT16_T $INT16_T +_ACEOF + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 16-bit type" >&5 +$as_echo_n "checking for unsigned 16-bit type... " >&6; } +UINT16_T='unsigned short' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT16_T" >&5 +$as_echo "$UINT16_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT16_T $UINT16_T +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 32-bit type" >&5 +$as_echo_n "checking for signed 32-bit type... " >&6; } +INT32_T='none' +INT32_FORMAT='none' +if test $ac_cv_sizeof_signed_int -eq 4 +then + INT32_T='signed int' + INT32_FORMAT='"%d"' +elif test $ac_cv_sizeof_signed_long -eq 4 +then + INT32_T='signed long' + INT32_FORMAT='"%ld"' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT32_T" >&5 +$as_echo "$INT32_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT32_T $INT32_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT32_FORMAT $INT32_FORMAT +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 32-bit type" >&5 +$as_echo_n "checking for unsigned 32-bit type... " >&6; } +UINT32_T='none' +UINT32_FORMAT='none' +if test $ac_cv_sizeof_unsigned_int -eq 4 +then + UINT32_T='unsigned int' + UINT32_FORMAT='"%u"' +elif test $ac_cv_sizeof_unsigned_long -eq 4 +then + UINT32_T='unsigned long' + UINT32_FORMAT='"%lu"' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT32_T" >&5 +$as_echo "$UINT32_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT32_T $UINT32_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT32_FORMAT $UINT32_FORMAT +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 64-bit type" >&5 +$as_echo_n "checking for signed 64-bit type... " >&6; } +INT64_T='none' +INT64_FORMAT='none' +if test $ac_cv_sizeof_signed_long -eq 8 +then + INT64_T='signed long' + INT64_FORMAT='"%ld"' +elif test $ac_cv_sizeof_signed_long_long -eq 8 +then + INT64_T='signed long long' + case "${host_os}" in + mingw32*) + # MinGW32 understands 'long long', but uses printf from WIN32 CRT + INT64_FORMAT='"%I64d"' + ;; + *) + INT64_FORMAT='"%lld"' + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT64_T" >&5 +$as_echo "$INT64_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT64_T $INT64_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_INT64_FORMAT $INT64_FORMAT +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 64-bit type" >&5 +$as_echo_n "checking for unsigned 64-bit type... " >&6; } +UINT64_T='none' +UINT64_FORMAT='none' +if test $ac_cv_sizeof_unsigned_long -eq 8 +then + UINT64_T='unsigned long' + UINT64_FORMAT='"%lu"' +elif test $ac_cv_sizeof_unsigned_long_long -eq 8 +then + UINT64_T='unsigned long long' + case "${host_os}" in + mingw32*) + # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT + UINT64_FORMAT='"%I64u"' + ;; + *) + UINT64_FORMAT='"%llu"' + ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT64_T" >&5 +$as_echo "$UINT64_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT64_T $UINT64_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_UINT64_FORMAT $UINT64_FORMAT +_ACEOF + + +# Determine TIFF equivalent of ssize_t +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed size type" >&5 +$as_echo_n "checking for signed size type... " >&6; } +SSIZE_T='unknown' +SSIZE_FORMAT='unknown' +if test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p +then + SSIZE_T='signed long' + SSIZE_FORMAT='"%ld"' +elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p +then + SSIZE_T='signed long long' + SSIZE_FORMAT='"%lld"' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SSIZE_T" >&5 +$as_echo "$SSIZE_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_SSIZE_T $SSIZE_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_SSIZE_FORMAT $SSIZE_FORMAT +_ACEOF + + +# Determine the type to use for the difference between two pointers. +# We will default to the POSIX ptrdiff_t if it is available, but will +# be prepared for the case when it is not. +PTRDIFF_T='unknown' +PTRDIFF_FORMAT='"%ld"' +ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + PTRDIFF_T=ptrdiff_t +fi + +if test $PTRDIFF_T = unknown +then + PTRDIFF_T=$SSIZE_T + PTRDIFF_FORMAT=$SSIZE_FORMAT +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer difference type" >&5 +$as_echo_n "checking for pointer difference type... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTRDIFF_T" >&5 +$as_echo "$PTRDIFF_T" >&6; } + +cat >>confdefs.h <<_ACEOF +#define TIFF_PTRDIFF_T $PTRDIFF_T +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define TIFF_PTRDIFF_FORMAT $PTRDIFF_FORMAT +_ACEOF + + +ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" " +#if HAVE_INTTYPES_H +# include +#endif + +" +if test "x$ac_cv_type_int8" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT8 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "int16" "ac_cv_type_int16" " +#if HAVE_INTTYPES_H +# include +#endif + +" +if test "x$ac_cv_type_int16" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT16 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "int32" "ac_cv_type_int32" " +#if HAVE_INTTYPES_H +# include +#endif + +" +if test "x$ac_cv_type_int32" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT32 1 +_ACEOF + + +fi + + +for ac_func in floor isascii memmove memset mmap pow setmode sqrt strchr strrchr strstr strtol strtoull +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" +if test "x$ac_cv_func_getopt" = xyes; then : + $as_echo "#define HAVE_GETOPT 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" getopt.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes; then : + $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strcasecmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" +if test "x$ac_cv_func_strtoul" = xyes; then : + $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoul.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoul.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull" +if test "x$ac_cv_func_strtoull" = xyes; then : + $as_echo "#define HAVE_STRTOULL 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strtoull.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtoull.$ac_objext" + ;; +esac + +fi + + +ac_fn_c_check_func "$LINENO" "lfind" "ac_cv_func_lfind" +if test "x$ac_cv_func_lfind" = xyes; then : + $as_echo "#define HAVE_LFIND 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" lfind.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lfind.$ac_objext" + ;; +esac + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking native cpu bit order" >&5 +$as_echo_n "checking native cpu bit order... " >&6; } +case "$host_cpu" in + i*86*|x86_64*) + HOST_FILLORDER=FILLORDER_LSB2MSB + { $as_echo "$as_me:${as_lineno-$LINENO}: result: lsb2msb" >&5 +$as_echo "lsb2msb" >&6; } + ;; + *) + HOST_FILLORDER=FILLORDER_MSB2LSB + { $as_echo "$as_me:${as_lineno-$LINENO}: result: msb2lsb" >&5 +$as_echo "msb2lsb" >&6; } + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define HOST_FILLORDER $HOST_FILLORDER +_ACEOF + + +if test "$ac_cv_c_bigendian" = yes ; then + HOST_BIGENDIAN=1 +else + HOST_BIGENDIAN=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HOST_BIGENDIAN $HOST_BIGENDIAN +_ACEOF + + +#_POSIX_C_SOURCE=2 +#AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE, $_POSIX_C_SOURCE, [Define this macro to a positive integer to control which POSIX functionality is made available.]) + +HAVE_IEEEFP=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_IEEEFP $HAVE_IEEEFP +_ACEOF + + + +# Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; HAVE_RPATH=$enableval +else + HAVE_RPATH=no +fi + + if test "$HAVE_RPATH" = "yes"; then + HAVE_RPATH_TRUE= + HAVE_RPATH_FALSE='#' +else + HAVE_RPATH_TRUE='#' + HAVE_RPATH_FALSE= +fi + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + + + +LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION} + + +# Check whether --with-docdir was given. +if test "${with_docdir+set}" = set; then : + withval=$with_docdir; +fi + +if test "x$with_docdir" != "x" ; then + LIBTIFF_DOCDIR=$with_docdir +fi + + + + +# Check whether --enable-ccitt was given. +if test "${enable_ccitt+set}" = set; then : + enableval=$enable_ccitt; HAVE_CCITT=$enableval +else + HAVE_CCITT=yes +fi + + +if test "$HAVE_CCITT" = "yes" ; then + +$as_echo "#define CCITT_SUPPORT 1" >>confdefs.h + +fi + +# Check whether --enable-packbits was given. +if test "${enable_packbits+set}" = set; then : + enableval=$enable_packbits; HAVE_PACKBITS=$enableval +else + HAVE_PACKBITS=yes +fi + + +if test "$HAVE_PACKBITS" = "yes" ; then + +$as_echo "#define PACKBITS_SUPPORT 1" >>confdefs.h + +fi + +# Check whether --enable-lzw was given. +if test "${enable_lzw+set}" = set; then : + enableval=$enable_lzw; HAVE_LZW=$enableval +else + HAVE_LZW=yes +fi + + +if test "$HAVE_LZW" = "yes" ; then + +$as_echo "#define LZW_SUPPORT 1" >>confdefs.h + +fi + +# Check whether --enable-thunder was given. +if test "${enable_thunder+set}" = set; then : + enableval=$enable_thunder; HAVE_THUNDER=$enableval +else + HAVE_THUNDER=yes +fi + + +if test "$HAVE_THUNDER" = "yes" ; then + +$as_echo "#define THUNDER_SUPPORT 1" >>confdefs.h + +fi + +HAVE_NEXT=yes + +# Check whether --enable-next was given. +if test "${enable_next+set}" = set; then : + enableval=$enable_next; HAVE_NEXT=$enableval +else + HAVE_NEXT=yes +fi + + +if test "$HAVE_NEXT" = "yes" ; then + +$as_echo "#define NEXT_SUPPORT 1" >>confdefs.h + +fi + +# Check whether --enable-logluv was given. +if test "${enable_logluv+set}" = set; then : + enableval=$enable_logluv; HAVE_LOGLUV=$enableval +else + HAVE_LOGLUV=yes +fi + + +if test "$HAVE_LOGLUV" = "yes" ; then + +$as_echo "#define LOGLUV_SUPPORT 1" >>confdefs.h + +fi + + +# Check whether --enable-mdi was given. +if test "${enable_mdi+set}" = set; then : + enableval=$enable_mdi; HAVE_MDI=$enableval +else + HAVE_MDI=yes +fi + + +if test "$HAVE_MDI" = "yes" ; then + +$as_echo "#define MDI_SUPPORT 1" >>confdefs.h + +fi + + +HAVE_ZLIB=no + +# Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; +fi + + +# Check whether --with-zlib-include-dir was given. +if test "${with_zlib_include_dir+set}" = set; then : + withval=$with_zlib_include_dir; +fi + + +# Check whether --with-zlib-lib-dir was given. +if test "${with_zlib_lib_dir+set}" = set; then : + withval=$with_zlib_lib_dir; +fi + + +if test "x$enable_zlib" != "xno" ; then + + if test "x$with_zlib_lib_dir" != "x" ; then + LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 +$as_echo_n "checking for inflateEnd in -lz... " >&6; } +if ${ac_cv_lib_z_inflateEnd+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inflateEnd (); +int +main () +{ +return inflateEnd (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_inflateEnd=yes +else + ac_cv_lib_z_inflateEnd=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 +$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } +if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : + zlib_lib=yes +else + zlib_lib=no +fi + + if test "$zlib_lib" = "no" -a "x$with_zlib_lib_dir" != "x"; then + as_fn_error $? "Zlib library not found at $with_zlib_lib_dir" "$LINENO" 5 + fi + + if test "x$with_zlib_include_dir" != "x" ; then + CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS" + fi + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + zlib_h=yes +else + zlib_h=no +fi + + + if test "$zlib_h" = "no" -a "x$with_zlib_include_dir" != "x" ; then + as_fn_error $? "Zlib headers not found at $with_zlib_include_dir" "$LINENO" 5 + fi + + if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then + HAVE_ZLIB=yes + fi + +fi + +if test "$HAVE_ZLIB" = "yes" ; then + +$as_echo "#define ZIP_SUPPORT 1" >>confdefs.h + + LIBS="-lz $LIBS" + tiff_libs_private="-lz ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then + LIBDIR="-R $with_zlib_lib_dir $LIBDIR" + fi + +fi + + +# Check whether --enable-pixarlog was given. +if test "${enable_pixarlog+set}" = set; then : + enableval=$enable_pixarlog; HAVE_PIXARLOG=$enableval +else + HAVE_PIXARLOG=yes +fi + + +if test "$HAVE_ZLIB" = "yes" -a "$HAVE_PIXARLOG" = "yes" ; then + +$as_echo "#define PIXARLOG_SUPPORT 1" >>confdefs.h + +else + HAVE_PIXARLOG=no +fi + + +HAVE_JPEG=no + +# Check whether --enable-jpeg was given. +if test "${enable_jpeg+set}" = set; then : + enableval=$enable_jpeg; +fi + + +# Check whether --with-jpeg-include-dir was given. +if test "${with_jpeg_include_dir+set}" = set; then : + withval=$with_jpeg_include_dir; +fi + + +# Check whether --with-jpeg-lib-dir was given. +if test "${with_jpeg_lib_dir+set}" = set; then : + withval=$with_jpeg_lib_dir; +fi + + +if test "x$enable_jpeg" != "xno" ; then + + if test "x$with_jpeg_lib_dir" != "x" ; then + LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_read_scanlines in -ljpeg" >&5 +$as_echo_n "checking for jpeg_read_scanlines in -ljpeg... " >&6; } +if ${ac_cv_lib_jpeg_jpeg_read_scanlines+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_read_scanlines (); +int +main () +{ +return jpeg_read_scanlines (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_read_scanlines=yes +else + ac_cv_lib_jpeg_jpeg_read_scanlines=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_read_scanlines" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_read_scanlines" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_read_scanlines" = xyes; then : + jpeg_lib=yes +else + jpeg_lib=no +fi + + if test "$jpeg_lib" = "no" -a "x$with_jpeg_lib_dir" != "x" ; then + as_fn_error $? "IJG JPEG library not found at $with_jpeg_lib_dir" "$LINENO" 5 + fi + + if test "x$with_jpeg_include_dir" != "x" ; then + CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS" + fi + ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes; then : + jpeg_h=yes +else + jpeg_h=no +fi + + + if test "$jpeg_h" = "no" -a "x$with_jpeg_include_dir" != "x" ; then + as_fn_error $? "IJG JPEG library headers not found at $with_jpeg_include_dir" "$LINENO" 5 + fi + + if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then + HAVE_JPEG=yes + fi + +fi + +if test "$HAVE_JPEG" = "yes" ; then + +$as_echo "#define JPEG_SUPPORT 1" >>confdefs.h + + LIBS="-ljpeg $LIBS" + tiff_libs_private="-ljpeg ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then + LIBDIR="-R $with_jpeg_lib_dir $LIBDIR" + fi + +fi + + +# Check whether --enable-old-jpeg was given. +if test "${enable_old_jpeg+set}" = set; then : + enableval=$enable_old_jpeg; HAVE_OJPEG=${enableval} +else + HAVE_OJPEG=yes +fi + + +if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then + +$as_echo "#define OJPEG_SUPPORT 1" >>confdefs.h + +else + HAVE_OJPEG=no +fi + + +HAVE_JBIG=no + +# Check whether --enable-jbig was given. +if test "${enable_jbig+set}" = set; then : + enableval=$enable_jbig; +fi + + +# Check whether --with-jbig-include-dir was given. +if test "${with_jbig_include_dir+set}" = set; then : + withval=$with_jbig_include_dir; +fi + + +# Check whether --with-jbig-lib-dir was given. +if test "${with_jbig_lib_dir+set}" = set; then : + withval=$with_jbig_lib_dir; +fi + + +if test "x$enable_jbig" != "xno" ; then + + if test "x$with_jbig_lib_dir" != "x" ; then + LDFLAGS="-L$with_jbig_lib_dir $LDFLAGS" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jbg_dec_init in -ljbig" >&5 +$as_echo_n "checking for jbg_dec_init in -ljbig... " >&6; } +if ${ac_cv_lib_jbig_jbg_dec_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljbig $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jbg_dec_init (); +int +main () +{ +return jbg_dec_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_jbig_jbg_dec_init=yes +else + ac_cv_lib_jbig_jbg_dec_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jbig_jbg_dec_init" >&5 +$as_echo "$ac_cv_lib_jbig_jbg_dec_init" >&6; } +if test "x$ac_cv_lib_jbig_jbg_dec_init" = xyes; then : + jbig_lib=yes +else + jbig_lib=no +fi + + if test "$jbig_lib" = "no" -a "x$with_jbig_lib_dir" != "x" ; then + as_fn_error $? "JBIG-KIT library not found at $with_jbig_lib_dir" "$LINENO" 5 + fi + + if test "x$with_jbig_include_dir" != "x" ; then + CPPFLAGS="-I$with_jbig_include_dir $CPPFLAGS" + fi + ac_fn_c_check_header_mongrel "$LINENO" "jbig.h" "ac_cv_header_jbig_h" "$ac_includes_default" +if test "x$ac_cv_header_jbig_h" = xyes; then : + jbig_h=yes +else + jbig_h=no +fi + + + if test "$jbig_h" = "no" -a "x$with_jbig_include_dir" != "x" ; then + as_fn_error $? "JBIG-KIT library headers not found at $with_jbig_include_dir" "$LINENO" 5 + fi + + if test "$jbig_lib" = "yes" -a "$jbig_h" = "yes" ; then + HAVE_JBIG=yes + fi + +fi + +if test "$HAVE_JBIG" = "yes" ; then + +$as_echo "#define JBIG_SUPPORT 1" >>confdefs.h + + LIBS="-ljbig $LIBS" + tiff_libs_private="-ljbig ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_jbig_lib_dir" != "x" ; then + LIBDIR="-R $with_jbig_lib_dir $LIBDIR" + fi + + # Older versions of jbigkit lack jbg_newlen + for ac_func in jbg_newlen +do : + ac_fn_c_check_func "$LINENO" "jbg_newlen" "ac_cv_func_jbg_newlen" +if test "x$ac_cv_func_jbg_newlen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_JBG_NEWLEN 1 +_ACEOF + +fi +done + + +fi + + +HAVE_LZMA=no + +# Check whether --enable-lzma was given. +if test "${enable_lzma+set}" = set; then : + enableval=$enable_lzma; +fi + + +# Check whether --with-lzma-include-dir was given. +if test "${with_lzma_include_dir+set}" = set; then : + withval=$with_lzma_include_dir; +fi + + +# Check whether --with-lzma-lib-dir was given. +if test "${with_lzma_lib_dir+set}" = set; then : + withval=$with_lzma_lib_dir; +fi + + +if test "x$enable_lzma" != "xno" ; then + + if test "x$with_lzma_lib_dir" != "x" ; then + LDFLAGS="-L$with_lzma_lib_dir $LDFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 +$as_echo_n "checking for lzma_code in -llzma... " >&6; } +if ${ac_cv_lib_lzma_lzma_code+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lzma_code (); +int +main () +{ +return lzma_code (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_lzma_lzma_code=yes +else + ac_cv_lib_lzma_lzma_code=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 +$as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } +if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : + lzma_lib=yes +else + lzma_lib=no +fi + + if test "$lzma_lib" = "no" -a "x$with_lzma_lib_dir" != "x"; then + as_fn_error $? "lzma library not found at $with_lzma_lib_dir" "$LINENO" 5 + fi + + if test "x$with_lzma_include_dir" != "x" ; then + CPPFLAGS="-I$with_lzma_include_dir $CPPFLAGS" + fi + ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" +if test "x$ac_cv_header_lzma_h" = xyes; then : + lzma_h=yes +else + lzma_h=no +fi + + + if test "$lzma_h" = "no" -a "x$with_lzma_include_dir" != "x" ; then + as_fn_error $? "Liblzma headers not found at $with_lzma_include_dir" "$LINENO" 5 + fi + + if test "$lzma_lib" = "yes" -a "$lzma_h" = "yes" ; then + HAVE_LZMA=yes + fi + +fi + +if test "$HAVE_LZMA" = "yes" ; then + +$as_echo "#define LZMA_SUPPORT 1" >>confdefs.h + + LIBS="-llzma $LIBS" + tiff_libs_private="-llzma ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_lzma_lib_dir" != "x" ; then + LIBDIR="-R $with_lzma_lib_dir $LIBDIR" + fi + +fi + + +HAVE_JPEG12=no + +# Check whether --enable-jpeg12 was given. +if test "${enable_jpeg12+set}" = set; then : + enableval=$enable_jpeg12; +fi + + +# Check whether --with-jpeg12-include-dir was given. +if test "${with_jpeg12_include_dir+set}" = set; then : + withval=$with_jpeg12_include_dir; +fi + + +# Check whether --with-jpeg12-lib was given. +if test "${with_jpeg12_lib+set}" = set; then : + withval=$with_jpeg12_lib; +fi + + +if test "x$enable_jpeg12" == "xyes" ; then + + if test "x$with_jpeg12_lib" != "x" ; then + LIBS="$with_jpeg12_lib $LIBS" + fi + + HAVE_JPEG12=yes + + +$as_echo "#define JPEG_DUAL_MODE_8_12 1" >>confdefs.h + + if test "x$with_jpeg12_include_dir" != "x" ; then + +cat >>confdefs.h <<_ACEOF +#define LIBJPEG_12_PATH "$with_jpeg12_include_dir/jpeglib.h" +_ACEOF + + fi +fi + + + +# Check whether --enable-cxx was given. +if test "${enable_cxx+set}" = set; then : + enableval=$enable_cxx; HAVE_CXX=$enableval +else + HAVE_CXX=yes +fi + + +if test "$HAVE_CXX" = "yes" ; then + +$as_echo "#define CXX_SUPPORT 1" >>confdefs.h + +else + HAVE_CXX=no +fi + + if test "$HAVE_CXX" = "yes"; then + HAVE_CXX_TRUE= + HAVE_CXX_FALSE='#' +else + HAVE_CXX_TRUE='#' + HAVE_CXX_FALSE= +fi + + + +HAVE_OPENGL=no + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_dnet_ntoa=yes +else + ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +fi + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_gethostbyname=yes +else + ac_cv_lib_bsd_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : + +fi + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = xyes; then : + +fi + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if ${ac_cv_lib_posix_remove+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char remove (); +int +main () +{ +return remove (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes +else + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = xyes; then : + +fi + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if ${ac_cv_lib_ipc_shmat+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (); +int +main () +{ +return shmat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipc_shmat=yes +else + ac_cv_lib_ipc_shmat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_IceConnectionNumber=yes +else + ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +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 + +ax_pthread_ok=no + + +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + + + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + + + +case "${host_cpu}-${host_os}" in + *solaris*) + + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + *-darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + static void routine(void* a) {a=0;} + static void* start_routine(void* a) {return a;} +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th,0,start_routine,0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr=$attr; return attr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +$as_echo "${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5 +$as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; } +if ${ax_cv_c_compiler_ms+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef _MSC_VER + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_compiler_ms=yes +else + ax_compiler_ms=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ax_cv_c_compiler_ms=$ax_compiler_ms + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5 +$as_echo "$ax_cv_c_compiler_ms" >&6; } +if test X$ax_compiler_ms = Xno; then : + GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm" +fi + +if test "X$no_x" != "Xyes"; then : + if test -n "$x_includes"; then : + GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}" +fi + if test -n "$x_libraries"; then : + GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}" +fi +fi + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +for ac_header in GL/gl.h OpenGL/gl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +CPPFLAGS="${ax_save_CPPFLAGS}" + +for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + +fi + +done + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5 +$as_echo_n "checking for OpenGL library... " >&6; } +if ${ax_cv_check_gl_libgl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_check_gl_libgl="no" +case $host_cpu in + x86_64) ax_check_gl_libdir=lib64 ;; + *) ax_check_gl_libdir=lib ;; +esac +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" +LIBS="" +ax_check_libs="-lopengl32 -lGL" +for ax_lib in ${ax_check_libs}; do + if test X$ax_compiler_ms = Xyes; then : + ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` +else + ax_try_lib="${ax_lib}" +fi + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="${ax_try_lib}"; break +else + ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break +else + ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +done + +if test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes; then : + LIBS='-framework OpenGL' +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif +int +main () +{ +glBegin(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_gl_libgl="$LIBS" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +LIBS=${ax_save_LIBS} +CPPFLAGS=${ax_save_CPPFLAGS} +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_libgl" >&5 +$as_echo "$ax_cv_check_gl_libgl" >&6; } + +if test "X$ax_cv_check_gl_libgl" = Xno; then : + no_gl=yes; GL_CFLAGS=""; GL_LIBS="" +else + GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}" +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 + + + + + + +GLU_CFLAGS="${GL_CFLAGS}" + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +for ac_header in GL/glu.h OpenGL/glu.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +CPPFLAGS="${ax_save_CPPFLAGS}" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility library" >&5 +$as_echo_n "checking for OpenGL Utility library... " >&6; } +if ${ax_cv_check_glu_libglu+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_check_glu_libglu="no" +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" + +LIBS="${GL_LIBS} ${ax_save_LIBS}" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test X$ax_compiler_ms = Xyes; then : + 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 + +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif +int +main () +{ +gluBeginCurve(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glu_libglu=yes +else + LIBS="" +ax_check_libs="-lglu32 -lGLU" +for ax_lib in ${ax_check_libs}; do + if test X$ax_compiler_ms = Xyes; then : + ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` +else + ax_try_lib="${ax_lib}" +fi + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif +int +main () +{ +gluBeginCurve(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glu_libglu="${ax_try_lib}"; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +done + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test X$ax_compiler_ms = Xyes; then : + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +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 + + +LIBS=${ax_save_LIBS} +CPPFLAGS=${ax_save_CPPFLAGS} +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_libglu" >&5 +$as_echo "$ax_cv_check_glu_libglu" >&6; } +if test "X$ax_cv_check_glu_libglu" = Xno; then : + no_glu=yes; GLU_CFLAGS=""; GLU_LIBS="" +else + if test "X$ax_cv_check_glu_libglu" = Xyes; then : + GLU_LIBS="$GL_LIBS" +else + GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}" +fi +fi + + + +if test "X$ax_cv_check_glu_libglu" != Xno; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs GLU tesselator callback function type" >&5 +$as_echo_n "checking for varargs GLU tesselator callback function type... " >&6; } +if ${ax_cv_varargs_glu_tesscb+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_varargs_glu_tesscb=no +ax_save_CFLAGS="$CFLAGS" +CFLAGS="$GL_CFLAGS $CFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# ifdef HAVE_GL_GLU_H +# include +# else +# include +# endif +int +main () +{ +GLvoid (*func)(...); gluTessCallback(0, 0, func) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_varargs_glu_tesscb=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$ax_save_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5 +$as_echo "$ax_cv_varargs_glu_tesscb" >&6; } +if test X$ax_cv_varargs_glu_tesscb = Xyes; then : + +$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h + +fi +fi + + + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}" +for ac_header in GL/glut.h GLUT/glut.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +CPPFLAGS="${ax_save_CPPFLAGS}" + +GLUT_CFLAGS=${GLU_CFLAGS} +GLUT_LIBS=${GLU_LIBS} + + + +if test X$no_x != Xyes; then : + GLUT_LIBS="${X_PRE_LIBS} -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLUT library" >&5 +$as_echo_n "checking for GLUT library... " >&6; } +if ${ax_cv_check_glut_libglut+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_check_glut_libglut="no" +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 + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" +LIBS="" +ax_check_libs="-lglut32 -lglut" +for ax_lib in ${ax_check_libs}; do + if test X$ax_compiler_ms = Xyes; then : + ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` +else + ax_try_lib="${ax_lib}" +fi + LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if HAVE_WINDOWS_H && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLUT_H +# include +# elif defined(HAVE_GLUT_GLUT_H) +# include +# else +# error no glut.h +# endif +int +main () +{ +glutMainLoop() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glut_libglut="${ax_try_lib}"; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +done + +if test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes; then : + LIBS='-framework GLUT' +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if HAVE_WINDOWS_H && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLUT_H +# include +# elif defined(HAVE_GLUT_GLUT_H) +# include +# else +# error no glut.h +# endif +int +main () +{ +glutMainLoop() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_check_glut_libglut="$LIBS" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +CPPFLAGS="${ax_save_CPPFLAGS}" +LIBS="${ax_save_LIBS}" +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 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_libglut" >&5 +$as_echo "$ax_cv_check_glut_libglut" >&6; } + +if test "X$ax_cv_check_glut_libglut" = Xno; then : + no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS="" +else + GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}" +fi + + + + + +if test "$no_x" != "yes" -a "$no_gl" != "yes" \ + -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then + HAVE_OPENGL=yes +fi + + if test "$HAVE_OPENGL" = "yes"; then + HAVE_OPENGL_TRUE= + HAVE_OPENGL_FALSE='#' +else + HAVE_OPENGL_TRUE='#' + HAVE_OPENGL_FALSE= +fi + + + +win32_io_ok=no +case "${host_os}" in + cygwin*) + ;; + *) + if test x"$ac_cv_header_windows_h" = xyes; then + win32_io_ok=yes + +$as_echo "#define USE_WIN32_FILEIO 1" >>confdefs.h + + fi + ;; +esac + if test "$win32_io_ok" = yes; then + WIN32_IO_TRUE= + WIN32_IO_FALSE='#' +else + WIN32_IO_TRUE='#' + WIN32_IO_FALSE= +fi + + + + + + + + + +# Check whether --enable-strip-chopping was given. +if test "${enable_strip_chopping+set}" = set; then : + enableval=$enable_strip_chopping; HAVE_STRIPCHOP=$enableval +else + HAVE_STRIPCHOP=yes +fi + + +# Check whether --with-default-strip-size was given. +if test "${with_default_strip_size+set}" = set; then : + withval=$with_default_strip_size; +fi + + +if test "$HAVE_STRIPCHOP" = "yes" \ + -a "x$with_default_strip_size" != "xno"; then + +$as_echo "#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP" >>confdefs.h + + + if test "x$with_default_strip_size" = "x" \ + -o "x$with_default_strip_size" = "xyes"; then + with_default_strip_size="8192" + fi + + +cat >>confdefs.h <<_ACEOF +#define STRIP_SIZE_DEFAULT $with_default_strip_size +_ACEOF + + +fi + + +# Check whether --enable-defer-strile-load was given. +if test "${enable_defer_strile_load+set}" = set; then : + enableval=$enable_defer_strile_load; HAVE_DEFER_STRILE_LOAD=$enableval +else + HAVE_DEFER_STRILE_LOAD=no +fi + + +if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then + +$as_echo "#define DEFER_STRILE_LOAD 1" >>confdefs.h + + +fi + + +# Check whether --enable-chunky-strip-read was given. +if test "${enable_chunky_strip_read+set}" = set; then : + enableval=$enable_chunky_strip_read; HAVE_CHUNKY_STRIP_READ=$enableval +else + HAVE_CHUNKY_STRIP_READ=no +fi + + +if test "$HAVE_CHUNKY_STRIP_READ" = "yes" ; then + +$as_echo "#define CHUNKY_STRIP_READ_SUPPORT 1" >>confdefs.h + + +fi + + +$as_echo "#define SUBIFD_SUPPORT 1" >>confdefs.h + + + +# Check whether --enable-extrasample-as-alpha was given. +if test "${enable_extrasample_as_alpha+set}" = set; then : + enableval=$enable_extrasample_as_alpha; HAVE_EXTRASAMPLE_AS_ALPHA=$enableval +else + HAVE_EXTRASAMPLE_AS_ALPHA=yes +fi + + +if test "$HAVE_EXTRASAMPLE_AS_ALPHA" = "yes" ; then + +$as_echo "#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1" >>confdefs.h + +fi + + +# Check whether --enable-check-ycbcr-subsampling was given. +if test "${enable_check_ycbcr_subsampling+set}" = set; then : + enableval=$enable_check_ycbcr_subsampling; CHECK_JPEG_YCBCR_SUBSAMPLING=$enableval +else + CHECK_JPEG_YCBCR_SUBSAMPLING=yes +fi + + +if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then + +$as_echo "#define CHECK_JPEG_YCBCR_SUBSAMPLING 1" >>confdefs.h + +fi + + + + +ac_config_headers="$ac_config_headers libtiff/tif_config.h libtiff/tiffconf.h" + + +ac_config_files="$ac_config_files Makefile build/Makefile contrib/Makefile contrib/addtiffo/Makefile contrib/dbs/Makefile contrib/dbs/xtiff/Makefile contrib/iptcutil/Makefile contrib/mfs/Makefile contrib/pds/Makefile contrib/ras/Makefile contrib/stream/Makefile contrib/tags/Makefile contrib/win_dib/Makefile html/Makefile html/images/Makefile html/man/Makefile libtiff-4.pc libtiff/Makefile man/Makefile port/Makefile test/Makefile tools/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${HAVE_RPATH_TRUE}" && test -z "${HAVE_RPATH_FALSE}"; then + as_fn_error $? "conditional \"HAVE_RPATH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENGL_TRUE}" && test -z "${HAVE_OPENGL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENGL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_IO_TRUE}" && test -z "${WIN32_IO_FALSE}"; then + as_fn_error $? "conditional \"WIN32_IO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by LibTIFF Software $as_me 4.0.3, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +LibTIFF Software config.status 4.0.3 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "libtiff/tif_config.h") CONFIG_HEADERS="$CONFIG_HEADERS libtiff/tif_config.h" ;; + "libtiff/tiffconf.h") CONFIG_HEADERS="$CONFIG_HEADERS libtiff/tiffconf.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "build/Makefile") CONFIG_FILES="$CONFIG_FILES build/Makefile" ;; + "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; + "contrib/addtiffo/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/addtiffo/Makefile" ;; + "contrib/dbs/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/dbs/Makefile" ;; + "contrib/dbs/xtiff/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/dbs/xtiff/Makefile" ;; + "contrib/iptcutil/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/iptcutil/Makefile" ;; + "contrib/mfs/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/mfs/Makefile" ;; + "contrib/pds/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/pds/Makefile" ;; + "contrib/ras/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/ras/Makefile" ;; + "contrib/stream/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/stream/Makefile" ;; + "contrib/tags/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/tags/Makefile" ;; + "contrib/win_dib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/win_dib/Makefile" ;; + "html/Makefile") CONFIG_FILES="$CONFIG_FILES html/Makefile" ;; + "html/images/Makefile") CONFIG_FILES="$CONFIG_FILES html/images/Makefile" ;; + "html/man/Makefile") CONFIG_FILES="$CONFIG_FILES html/man/Makefile" ;; + "libtiff-4.pc") CONFIG_FILES="$CONFIG_FILES libtiff-4.pc" ;; + "libtiff/Makefile") CONFIG_FILES="$CONFIG_FILES libtiff/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "port/Makefile") CONFIG_FILES="$CONFIG_FILES port/Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + +echo "" +echo "Libtiff is now configured for ${host}" +echo "" +echo " Installation directory: ${prefix}" +echo " Documentation directory: ${LIBTIFF_DOCDIR}" +echo " C compiler: ${CC} ${CFLAGS}" +echo " C++ compiler: ${CXX} ${CXXFLAGS}" +echo " Enable runtime linker paths: ${HAVE_RPATH}" +echo " Enable linker symbol versioning: ${have_ld_version_script}" +echo " Support Microsoft Document Imaging: ${HAVE_MDI}" +echo " Use win32 IO: ${win32_io_ok}" +echo "" +echo " Support for internal codecs:" +echo " CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}" +echo " Macintosh PackBits algorithm: ${HAVE_PACKBITS}" +echo " LZW algorithm: ${HAVE_LZW}" +echo " ThunderScan 4-bit RLE algorithm: ${HAVE_THUNDER}" +echo " NeXT 2-bit RLE algorithm: ${HAVE_NEXT}" +echo " LogLuv high dynamic range encoding: ${HAVE_LOGLUV}" +echo "" +echo " Support for external codecs:" +echo " ZLIB support: ${HAVE_ZLIB}" +echo " Pixar log-format algorithm: ${HAVE_PIXARLOG}" +echo " JPEG support: ${HAVE_JPEG}" +echo " Old JPEG support: ${HAVE_OJPEG}" +echo " JPEG 8/12 bit dual mode: ${HAVE_JPEG12}" +echo " ISO JBIG support: ${HAVE_JBIG}" +echo " LZMA2 support: ${HAVE_LZMA}" +echo "" +echo " C++ support: ${HAVE_CXX}" +echo "" +echo " OpenGL support: ${HAVE_OPENGL}" +echo "" + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/configure.ac b/thirdparty/LibTIFF/tiff-4.0.3/configure.ac new file mode 100644 index 0000000..e1b8d40 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/configure.ac @@ -0,0 +1,1031 @@ +dnl -*- Autoconf -*- +dnl Tag Image File Format (TIFF) Software +dnl +dnl Copyright (C) 2004, Andrey Kiselev +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and +dnl its documentation for any purpose is hereby granted without fee, provided +dnl that (i) the above copyright notices and this permission notice appear in +dnl all copies of the software and related documentation, and (ii) the names of +dnl Sam Leffler and Silicon Graphics may not be used in any advertising or +dnl publicity relating to the software without the specific, prior written +dnl permission of Sam Leffler and Silicon Graphics. +dnl +dnl THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +dnl EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +dnl WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +dnl +dnl IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +dnl ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +dnl OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +dnl WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +dnl LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +dnl OF THIS SOFTWARE. + +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.64) +AC_INIT([LibTIFF Software],[4.0.3],[tiff@lists.maptools.org],[tiff]) +AC_CONFIG_AUX_DIR(config) +AC_CONFIG_MACRO_DIR(m4) +AC_LANG(C) + +dnl Compute the canonical host (run-time) system type variable +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE +dnl Do not rebuild generated files every time +AM_MAINTAINER_MODE + +dnl Versioning. +dnl Don't fill the ALPHA_VERSION field, if not applicable. +LIBTIFF_MAJOR_VERSION=4 +LIBTIFF_MINOR_VERSION=0 +LIBTIFF_MICRO_VERSION=3 +LIBTIFF_ALPHA_VERSION= +LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION +dnl This will be used with the 'make release' target +LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"` + +dnl Libtool library revision control info +dnl See the libtool documentation under the heading "Libtool's versioning +dnl system" in order to understand the meaning of these fields +dnl +dnl current +dnl The most recent interface number that this library implements. +dnl revision +dnl The implementation number of the current interface. +dnl age +dnl The difference between the newest and oldest interfaces that +dnl this library implements. In other words, the library implements +dnl all the interface numbers in the range from number current - +dnl age to current. +dnl +dnl Here are a set of rules to help you update your library version +dnl information: +dnl +dnl 1. Start with version information of `0:0:0' for each libtool library. +dnl 2. Update the version information only immediately before a public +dnl release of your software. More frequent updates are unnecessary, and +dnl only guarantee that the current interface number gets larger faster. +dnl 3. If the library source code has changed at all since the last update, +dnl then increment revision (`c:r:a' becomes `c:r+1:a'). +dnl 4. If any interfaces have been added, removed, or changed since the last +dnl update, increment current, and set revision to 0. +dnl 5. If any interfaces have been added since the last public release, then +dnl increment age. +dnl 6. If any interfaces have been removed since the last public release, +dnl then set age to 0. +LIBTIFF_CURRENT=7 +LIBTIFF_REVISION=0 +LIBTIFF_AGE=2 +LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE + +# This is a special hack for OpenBSD and MirOS systems. The dynamic linker +# in OpenBSD uses some special semantics for shared libraries. Their soname +# contains only two numbers, major and minor. +# See http://bugzilla.remotesensing.org/show_bug.cgi?id=838 for details. +#case "$host_os" in +# openbsd* | mirbsd*) +# LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION:0 +# ;; +# *) +# LIBTIFF_VERSION_INFO=$LIBTIFF_MAJOR_VERSION:$LIBTIFF_MINOR_VERSION:$LIBTIFF_MICRO_VERSION +# ;; +#esac + +AC_SUBST(LIBTIFF_MAJOR_VERSION) +AC_SUBST(LIBTIFF_MINOR_VERSION) +AC_SUBST(LIBTIFF_MICRO_VERSION) +AC_SUBST(LIBTIFF_ALPHA_VERSION) +AC_SUBST(LIBTIFF_VERSION) +AC_SUBST(LIBTIFF_VERSION_INFO) +AC_SUBST(LIBTIFF_RELEASE_DATE) + +dnl Checks for programs. +AC_PROG_CC +AM_PROG_CC_C_O + +dnl We want warnings. As many warnings as possible. +VL_PROG_CC_WARNINGS() + +AC_PROG_INSTALL +AC_PROG_LN_S + + +# Check if LD supports linker scripts, and define automake conditional +# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently +# constrained to compilers using GNU ld on ELF systems or systems +# which provide an adequate emulation thereof. +AC_ARG_ENABLE([ld-version-script], + AS_HELP_STRING([--enable-ld-version-script], + [enable linker version script (default is disabled)]), + [have_ld_version_script=$enableval], [have_ld_version_script=no]) +if test "$have_ld_version_script" != no; then + AC_MSG_CHECKING([if LD -Wl,--version-script works]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map < +#endif +]) + +dnl Checks for library functions. +AC_CHECK_FUNCS([floor isascii memmove memset mmap pow setmode sqrt strchr strrchr strstr strtol strtoull]) + +dnl Will use local replacements for unavailable functions +AC_REPLACE_FUNCS(getopt) +AC_REPLACE_FUNCS(strcasecmp) +AC_REPLACE_FUNCS(strtoul) +AC_REPLACE_FUNCS(strtoull) +AC_REPLACE_FUNCS(lfind) + +dnl --------------------------------------------------------------------------- +dnl Check the native cpu bit order. +dnl --------------------------------------------------------------------------- +AC_MSG_CHECKING([native cpu bit order]) +case "$host_cpu" in + i*86*|x86_64*) + HOST_FILLORDER=FILLORDER_LSB2MSB + AC_MSG_RESULT([lsb2msb]) + ;; + *) + HOST_FILLORDER=FILLORDER_MSB2LSB + AC_MSG_RESULT([msb2lsb]) + ;; +esac +AC_DEFINE_UNQUOTED(HOST_FILLORDER, $HOST_FILLORDER, [Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB)]) + +dnl --------------------------------------------------------------------------- +dnl Configure legacy tifconf.h HOST_BIGENDIAN. +dnl --------------------------------------------------------------------------- +if test "$ac_cv_c_bigendian" = yes ; then + HOST_BIGENDIAN=1 +else + HOST_BIGENDIAN=0 +fi +AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)]) + +dnl --------------------------------------------------------------------------- +dnl Make the POSIX.2 features available. +dnl --------------------------------------------------------------------------- +#_POSIX_C_SOURCE=2 +#AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE, $_POSIX_C_SOURCE, [Define this macro to a positive integer to control which POSIX functionality is made available.]) + +dnl --------------------------------------------------------------------------- +dnl Set the floating point format. +dnl FIXME: write appropriate test. +dnl --------------------------------------------------------------------------- +HAVE_IEEEFP=1 +AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine]) + +dnl --------------------------------------------------------------------------- +dnl Enable run-time paths to libraries usage. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(rpath, + AS_HELP_STRING([--enable-rpath], + [Enable runtime linker paths (-R libtool option)]), + [HAVE_RPATH=$enableval], [HAVE_RPATH=no]) +AM_CONDITIONAL(HAVE_RPATH, test "$HAVE_RPATH" = "yes") + +dnl --------------------------------------------------------------------------- +dnl Support large files. +dnl --------------------------------------------------------------------------- + +AC_SYS_LARGEFILE + +dnl --------------------------------------------------------------------------- +dnl Point to path where we should install documentation. +dnl --------------------------------------------------------------------------- + +LIBTIFF_DOCDIR=\${prefix}/share/doc/${PACKAGE}-${LIBTIFF_VERSION} + +AC_ARG_WITH(docdir, + AS_HELP_STRING([--with-docdir=DIR], + [directory where documentation should be installed]),,) +if test "x$with_docdir" != "x" ; then + LIBTIFF_DOCDIR=$with_docdir +fi + +AC_SUBST(LIBTIFF_DOCDIR) + +dnl --------------------------------------------------------------------------- +dnl Switch on/off internal codecs. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(ccitt, + AS_HELP_STRING([--disable-ccitt], + [disable support for CCITT Group 3 & 4 algorithms]), + [HAVE_CCITT=$enableval], [HAVE_CCITT=yes]) + +if test "$HAVE_CCITT" = "yes" ; then + AC_DEFINE(CCITT_SUPPORT,1,[Support CCITT Group 3 & 4 algorithms]) +fi + +AC_ARG_ENABLE(packbits, + AS_HELP_STRING([--disable-packbits], + [disable support for Macintosh PackBits algorithm]), + [HAVE_PACKBITS=$enableval], [HAVE_PACKBITS=yes]) + +if test "$HAVE_PACKBITS" = "yes" ; then + AC_DEFINE(PACKBITS_SUPPORT,1,[Support Macintosh PackBits algorithm]) +fi + +AC_ARG_ENABLE(lzw, + AS_HELP_STRING([--disable-lzw], + [disable support for LZW algorithm]), + [HAVE_LZW=$enableval], [HAVE_LZW=yes]) + +if test "$HAVE_LZW" = "yes" ; then + AC_DEFINE(LZW_SUPPORT,1,[Support LZW algorithm]) +fi + +AC_ARG_ENABLE(thunder, + AS_HELP_STRING([--disable-thunder], + [disable support for ThunderScan 4-bit RLE algorithm]), + [HAVE_THUNDER=$enableval], [HAVE_THUNDER=yes]) + +if test "$HAVE_THUNDER" = "yes" ; then + AC_DEFINE(THUNDER_SUPPORT,1,[Support ThunderScan 4-bit RLE algorithm]) +fi + +HAVE_NEXT=yes + +AC_ARG_ENABLE(next, + AS_HELP_STRING([--disable-next], + [disable support for NeXT 2-bit RLE algorithm]), + [HAVE_NEXT=$enableval], [HAVE_NEXT=yes]) + +if test "$HAVE_NEXT" = "yes" ; then + AC_DEFINE(NEXT_SUPPORT,1,[Support NeXT 2-bit RLE algorithm]) +fi + +AC_ARG_ENABLE(logluv, + AS_HELP_STRING([--disable-logluv], + [disable support for LogLuv high dynamic range encoding]), + [HAVE_LOGLUV=$enableval], [HAVE_LOGLUV=yes]) + +if test "$HAVE_LOGLUV" = "yes" ; then + AC_DEFINE(LOGLUV_SUPPORT,1,[Support LogLuv high dynamic range encoding]) +fi + +dnl --------------------------------------------------------------------------- +dnl Switch on/off support for Microsoft Document Imaging +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(mdi, + AS_HELP_STRING([--disable-mdi], + [disable support for Microsoft Document Imaging]), + [HAVE_MDI=$enableval], [HAVE_MDI=yes]) + +if test "$HAVE_MDI" = "yes" ; then + AC_DEFINE(MDI_SUPPORT,1,[Support Microsoft Document Imaging format]) +fi + +dnl --------------------------------------------------------------------------- +dnl Check for ZLIB. +dnl --------------------------------------------------------------------------- + +HAVE_ZLIB=no + +AC_ARG_ENABLE(zlib, + AS_HELP_STRING([--disable-zlib], + [disable Zlib usage (required for Deflate compression, enabled by default)]),,) +AC_ARG_WITH(zlib-include-dir, + AS_HELP_STRING([--with-zlib-include-dir=DIR], + [location of Zlib headers]),,) +AC_ARG_WITH(zlib-lib-dir, + AS_HELP_STRING([--with-zlib-lib-dir=DIR], + [location of Zlib library binary]),,) + +if test "x$enable_zlib" != "xno" ; then + + if test "x$with_zlib_lib_dir" != "x" ; then + LDFLAGS="-L$with_zlib_lib_dir $LDFLAGS" + fi + + AC_CHECK_LIB(z, inflateEnd, [zlib_lib=yes], [zlib_lib=no],) + if test "$zlib_lib" = "no" -a "x$with_zlib_lib_dir" != "x"; then + AC_MSG_ERROR([Zlib library not found at $with_zlib_lib_dir]) + fi + + if test "x$with_zlib_include_dir" != "x" ; then + CPPFLAGS="-I$with_zlib_include_dir $CPPFLAGS" + fi + AC_CHECK_HEADER(zlib.h, [zlib_h=yes], [zlib_h=no]) + if test "$zlib_h" = "no" -a "x$with_zlib_include_dir" != "x" ; then + AC_MSG_ERROR([Zlib headers not found at $with_zlib_include_dir]) + fi + + if test "$zlib_lib" = "yes" -a "$zlib_h" = "yes" ; then + HAVE_ZLIB=yes + fi + +fi + +if test "$HAVE_ZLIB" = "yes" ; then + AC_DEFINE(ZIP_SUPPORT,1,[Support Deflate compression]) + LIBS="-lz $LIBS" + tiff_libs_private="-lz ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_zlib_lib_dir" != "x" ; then + LIBDIR="-R $with_zlib_lib_dir $LIBDIR" + fi + +fi + +dnl --------------------------------------------------------------------------- +dnl Check for Pixar log-format algorithm. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(pixarlog, + AS_HELP_STRING([--disable-pixarlog], + [disable support for Pixar log-format algorithm (requires Zlib)]), + [HAVE_PIXARLOG=$enableval], [HAVE_PIXARLOG=yes]) + +if test "$HAVE_ZLIB" = "yes" -a "$HAVE_PIXARLOG" = "yes" ; then + AC_DEFINE(PIXARLOG_SUPPORT, 1, + [Support Pixar log-format algorithm (requires Zlib)]) +else + HAVE_PIXARLOG=no +fi + +dnl --------------------------------------------------------------------------- +dnl Check for JPEG. +dnl --------------------------------------------------------------------------- + +HAVE_JPEG=no + +AC_ARG_ENABLE(jpeg, + AS_HELP_STRING([--disable-jpeg], + [disable IJG JPEG library usage (required for JPEG compression, enabled by default)]),,) +AC_ARG_WITH(jpeg-include-dir, + AS_HELP_STRING([--with-jpeg-include-dir=DIR], + [location of IJG JPEG library headers]),,) +AC_ARG_WITH(jpeg-lib-dir, + AS_HELP_STRING([--with-jpeg-lib-dir=DIR], + [location of IJG JPEG library binary]),,) + +if test "x$enable_jpeg" != "xno" ; then + + if test "x$with_jpeg_lib_dir" != "x" ; then + LDFLAGS="-L$with_jpeg_lib_dir $LDFLAGS" + + fi + + AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [jpeg_lib=yes], [jpeg_lib=no],) + if test "$jpeg_lib" = "no" -a "x$with_jpeg_lib_dir" != "x" ; then + AC_MSG_ERROR([IJG JPEG library not found at $with_jpeg_lib_dir]) + fi + + if test "x$with_jpeg_include_dir" != "x" ; then + CPPFLAGS="-I$with_jpeg_include_dir $CPPFLAGS" + fi + AC_CHECK_HEADER(jpeglib.h, [jpeg_h=yes], [jpeg_h=no]) + if test "$jpeg_h" = "no" -a "x$with_jpeg_include_dir" != "x" ; then + AC_MSG_ERROR([IJG JPEG library headers not found at $with_jpeg_include_dir]) + fi + + if test "$jpeg_lib" = "yes" -a "$jpeg_h" = "yes" ; then + HAVE_JPEG=yes + fi + +fi + +if test "$HAVE_JPEG" = "yes" ; then + AC_DEFINE(JPEG_SUPPORT,1,[Support JPEG compression (requires IJG JPEG library)]) + LIBS="-ljpeg $LIBS" + tiff_libs_private="-ljpeg ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_jpeg_lib_dir" != "x" ; then + LIBDIR="-R $with_jpeg_lib_dir $LIBDIR" + fi + +fi + +dnl --------------------------------------------------------------------------- +dnl Check for Old JPEG. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(old-jpeg, + AS_HELP_STRING([--disable-old-jpeg], + [disable support for Old JPEG compresson (read-only, enabled by default)]), + [HAVE_OJPEG=${enableval}], [HAVE_OJPEG=yes]) + +if test "$HAVE_JPEG" = "yes" -a "$HAVE_OJPEG" = "yes" ; then + AC_DEFINE(OJPEG_SUPPORT, 1, + [Support Old JPEG compresson (read-only)]) +else + HAVE_OJPEG=no +fi + +dnl --------------------------------------------------------------------------- +dnl Check for JBIG-KIT. +dnl --------------------------------------------------------------------------- + +HAVE_JBIG=no + +AC_ARG_ENABLE(jbig, + AS_HELP_STRING([--disable-jbig], + [disable JBIG-KIT usage (required for ISO JBIG compression, enabled by default)]),,) +AC_ARG_WITH(jbig-include-dir, + AS_HELP_STRING([--with-jbig-include-dir=DIR], + [location of JBIG-KIT headers]),,) +AC_ARG_WITH(jbig-lib-dir, + AS_HELP_STRING([--with-jbig-lib-dir=DIR], + [location of JBIG-KIT library binary]),,) + +if test "x$enable_jbig" != "xno" ; then + + if test "x$with_jbig_lib_dir" != "x" ; then + LDFLAGS="-L$with_jbig_lib_dir $LDFLAGS" + + fi + + AC_CHECK_LIB(jbig, jbg_dec_init, [jbig_lib=yes], [jbig_lib=no],) + if test "$jbig_lib" = "no" -a "x$with_jbig_lib_dir" != "x" ; then + AC_MSG_ERROR([JBIG-KIT library not found at $with_jbig_lib_dir]) + fi + + if test "x$with_jbig_include_dir" != "x" ; then + CPPFLAGS="-I$with_jbig_include_dir $CPPFLAGS" + fi + AC_CHECK_HEADER(jbig.h, [jbig_h=yes], [jbig_h=no]) + if test "$jbig_h" = "no" -a "x$with_jbig_include_dir" != "x" ; then + AC_MSG_ERROR([JBIG-KIT library headers not found at $with_jbig_include_dir]) + fi + + if test "$jbig_lib" = "yes" -a "$jbig_h" = "yes" ; then + HAVE_JBIG=yes + fi + +fi + +if test "$HAVE_JBIG" = "yes" ; then + AC_DEFINE(JBIG_SUPPORT,1,[Support ISO JBIG compression (requires JBIG-KIT library)]) + LIBS="-ljbig $LIBS" + tiff_libs_private="-ljbig ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_jbig_lib_dir" != "x" ; then + LIBDIR="-R $with_jbig_lib_dir $LIBDIR" + fi + + # Older versions of jbigkit lack jbg_newlen + AC_CHECK_FUNCS([jbg_newlen]) + +fi + +dnl --------------------------------------------------------------------------- +dnl Check for liblzma2. +dnl --------------------------------------------------------------------------- + +HAVE_LZMA=no + +AC_ARG_ENABLE(lzma, + AS_HELP_STRING([--disable-lzma], + [disable liblzma usage (required for LZMA2 compression, enabled by default)]),,) +AC_ARG_WITH(lzma-include-dir, + AS_HELP_STRING([--with-lzma-include-dir=DIR], + [location of liblzma headers]),,) +AC_ARG_WITH(lzma-lib-dir, + AS_HELP_STRING([--with-lzma-lib-dir=DIR], + [location of liblzma library binary]),,) + +if test "x$enable_lzma" != "xno" ; then + + if test "x$with_lzma_lib_dir" != "x" ; then + LDFLAGS="-L$with_lzma_lib_dir $LDFLAGS" + fi + + AC_CHECK_LIB(lzma, lzma_code, [lzma_lib=yes], [lzma_lib=no],) + if test "$lzma_lib" = "no" -a "x$with_lzma_lib_dir" != "x"; then + AC_MSG_ERROR([lzma library not found at $with_lzma_lib_dir]) + fi + + if test "x$with_lzma_include_dir" != "x" ; then + CPPFLAGS="-I$with_lzma_include_dir $CPPFLAGS" + fi + AC_CHECK_HEADER(lzma.h, [lzma_h=yes], [lzma_h=no]) + if test "$lzma_h" = "no" -a "x$with_lzma_include_dir" != "x" ; then + AC_MSG_ERROR([Liblzma headers not found at $with_lzma_include_dir]) + fi + + if test "$lzma_lib" = "yes" -a "$lzma_h" = "yes" ; then + HAVE_LZMA=yes + fi + +fi + +if test "$HAVE_LZMA" = "yes" ; then + AC_DEFINE(LZMA_SUPPORT,1,[Support LZMA2 compression]) + LIBS="-llzma $LIBS" + tiff_libs_private="-llzma ${tiff_libs_private}" + + if test "$HAVE_RPATH" = "yes" -a "x$with_lzma_lib_dir" != "x" ; then + LIBDIR="-R $with_lzma_lib_dir $LIBDIR" + fi + +fi + +dnl --------------------------------------------------------------------------- +dnl Should 8/12 bit jpeg mode be enabled? +dnl --------------------------------------------------------------------------- + +HAVE_JPEG12=no + +AC_ARG_ENABLE(jpeg12, + AS_HELP_STRING([--enable-jpeg12], + [enable libjpeg 8/12bit dual mode]),,) +AC_ARG_WITH(jpeg12-include-dir, + AS_HELP_STRING([--with-jpeg12-include-dir=DIR], + [location of libjpeg 12bit headers]),,) +AC_ARG_WITH(jpeg12-lib, + AS_HELP_STRING([--with-jpeg12-lib=LIBRARY], + [path to libjpeg 12bit library]),,) + +if test "x$enable_jpeg12" == "xyes" ; then + + if test "x$with_jpeg12_lib" != "x" ; then + LIBS="$with_jpeg12_lib $LIBS" + fi + + HAVE_JPEG12=yes + + AC_DEFINE(JPEG_DUAL_MODE_8_12,1,[8/12 bit libjpeg dual mode enabled]) + if test "x$with_jpeg12_include_dir" != "x" ; then + AC_DEFINE_UNQUOTED(LIBJPEG_12_PATH,"$with_jpeg12_include_dir/jpeglib.h",[12bit libjpeg primary include file with path]) + fi +fi + + +dnl --------------------------------------------------------------------------- +dnl Check for C++. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(cxx, + AS_HELP_STRING([--enable-cxx], + [enable C++ stream API building (requires C++ compiler)]), + [HAVE_CXX=$enableval], [HAVE_CXX=yes]) + +if test "$HAVE_CXX" = "yes" ; then + AC_DEFINE(CXX_SUPPORT, 1, [Support C++ stream API (requires C++ compiler)]) +else + HAVE_CXX=no +fi + +AM_CONDITIONAL(HAVE_CXX, test "$HAVE_CXX" = "yes") + +dnl --------------------------------------------------------------------------- +dnl Check for OpenGL and GLUT. +dnl --------------------------------------------------------------------------- + +HAVE_OPENGL=no + + +AC_PATH_XTRA + +dnl AX_CHECK_GL sets GL_CFLAGS & GL_LIBS. Also PTHREAD_LIBS, +dnl PTHREAD_CFLAGS, & PTHREAD_CC as a side-effect +AX_CHECK_GL + +dnl AX_CHECK_GLU sets GLU_CFLAGS & GLU_LIBS +AX_CHECK_GLU + +dnl AX_CHECK_GLUT sets GLUT_CFLAGS & GLUT_LIBS +AX_CHECK_GLUT + +if test "$no_x" != "yes" -a "$no_gl" != "yes" \ + -a "$no_glu" != "yes" -a "$no_glut" != "yes" ; then + HAVE_OPENGL=yes +fi + +AM_CONDITIONAL(HAVE_OPENGL, test "$HAVE_OPENGL" = "yes") + +dnl --------------------------------------------------------------------------- +dnl Check for Win32 IO: make sure we have windows.h but not cygwin +dnl this must be after the ogl test, since that looks for windows.h and we +dnl test it +dnl --------------------------------------------------------------------------- + +win32_io_ok=no +case "${host_os}" in + cygwin*) + ;; + *) + if test x"$ac_cv_header_windows_h" = xyes; then + win32_io_ok=yes + AC_DEFINE(USE_WIN32_FILEIO,1,[define to use win32 IO system]) + fi + ;; +esac +AM_CONDITIONAL([WIN32_IO], [test "$win32_io_ok" = yes]) + +dnl --------------------------------------------------------------------------- +dnl Check for X Athena Widgets +dnl --------------------------------------------------------------------------- + +dnl HAVE_XAW=no + +dnl ICE_FIND_ATHENA + +dnl if test "$no_xaw" != "yes" ; then +dnl HAVE_XAW=yes +dnl fi + +dnl AM_CONDITIONAL(HAVE_XAW, test "$HAVE_XAW" = "yes") + +dnl =========================================================================== +dnl ``Orthogonal Features'' +dnl =========================================================================== + +dnl --------------------------------------------------------------------------- +dnl Default handling of strip chopping support. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(strip-chopping, + AS_HELP_STRING([--disable-strip-chopping], + [disable support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]), + [HAVE_STRIPCHOP=$enableval], [HAVE_STRIPCHOP=yes]) +AC_ARG_WITH(default-strip-size, + AS_HELP_STRING([--with-default-strip-size=SIZE], + [default size of the strip in bytes (when strip chopping enabled) [[default=8192]]]),,) + +if test "$HAVE_STRIPCHOP" = "yes" \ + -a "x$with_default_strip_size" != "xno"; then + AC_DEFINE(STRIPCHOP_DEFAULT,TIFF_STRIPCHOP,[Support strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]) + + if test "x$with_default_strip_size" = "x" \ + -o "x$with_default_strip_size" = "xyes"; then + with_default_strip_size="8192" + fi + + AC_DEFINE_UNQUOTED(STRIP_SIZE_DEFAULT,$with_default_strip_size,[Default size of the strip in bytes (when strip chopping enabled)]) + +fi + +dnl --------------------------------------------------------------------------- +dnl Should we try to defer loading of strip/tile offsets and sizes to +dnl optimize directory scanning? These is an experimental feature for +dnl libtiff 4.0. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(defer-strile-load, + AS_HELP_STRING([--enable-defer-strile-load], + [enable deferred strip/tile offset/size loading (experimental)]), + [HAVE_DEFER_STRILE_LOAD=$enableval], [HAVE_DEFER_STRILE_LOAD=no]) + +if test "$HAVE_DEFER_STRILE_LOAD" = "yes" ; then + AC_DEFINE(DEFER_STRILE_LOAD,1,[enable deferred strip/tile offset/size loading (experimental)]) + +fi + +dnl --------------------------------------------------------------------------- +dnl Check for support of CHUNKY_STRIP_READ_SUPPORT, a mechanism to allowing +dnl reading large strips (usually one strip files) in chunks when using +dnl TIFFReadScanline(). This is an experimental feature in libtiff 4.0. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(chunky-strip-read, + AS_HELP_STRING([--enable-chunky-strip-read], + [enable reading large strips in chunks for TIFFReadScanline() (experimental)]), + [HAVE_CHUNKY_STRIP_READ=$enableval], [HAVE_CHUNKY_STRIP_READ=no]) + +if test "$HAVE_CHUNKY_STRIP_READ" = "yes" ; then + AC_DEFINE(CHUNKY_STRIP_READ_SUPPORT,1,[enable partial strip reading for large strips (experimental)]) + +fi + +dnl --------------------------------------------------------------------------- +dnl Default subifd support. +dnl --------------------------------------------------------------------------- +AC_DEFINE(SUBIFD_SUPPORT,1,[Enable SubIFD tag (330) support]) + +dnl --------------------------------------------------------------------------- +dnl Default handling of ASSOCALPHA support. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(extrasample-as-alpha, + AS_HELP_STRING([--disable-extrasample-as-alpha], + [the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly]), + [HAVE_EXTRASAMPLE_AS_ALPHA=$enableval], + [HAVE_EXTRASAMPLE_AS_ALPHA=yes]) + +if test "$HAVE_EXTRASAMPLE_AS_ALPHA" = "yes" ; then + AC_DEFINE(DEFAULT_EXTRASAMPLE_AS_ALPHA, 1, + [Treat extra sample as alpha (default enabled). The RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly.]) +fi + +dnl --------------------------------------------------------------------------- +dnl Default handling of YCbCr subsampling support. +dnl See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details. +dnl --------------------------------------------------------------------------- + +AC_ARG_ENABLE(check-ycbcr-subsampling, + AS_HELP_STRING([--disable-check-ycbcr-subsampling], + [disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag]), + [CHECK_JPEG_YCBCR_SUBSAMPLING=$enableval], + [CHECK_JPEG_YCBCR_SUBSAMPLING=yes]) + +if test "$CHECK_JPEG_YCBCR_SUBSAMPLING" = "yes" ; then + AC_DEFINE(CHECK_JPEG_YCBCR_SUBSAMPLING, 1, + [Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled).]) +fi + +dnl --------------------------------------------------------------------------- + +AC_SUBST(LIBDIR) + +AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h]) + +AC_CONFIG_FILES([Makefile \ + build/Makefile \ + contrib/Makefile \ + contrib/addtiffo/Makefile \ + contrib/dbs/Makefile \ + contrib/dbs/xtiff/Makefile \ + contrib/iptcutil/Makefile \ + contrib/mfs/Makefile \ + contrib/pds/Makefile \ + contrib/ras/Makefile \ + contrib/stream/Makefile \ + contrib/tags/Makefile \ + contrib/win_dib/Makefile \ + html/Makefile \ + html/images/Makefile \ + html/man/Makefile \ + libtiff-4.pc \ + libtiff/Makefile \ + man/Makefile \ + port/Makefile \ + test/Makefile \ + tools/Makefile]) +AC_OUTPUT + +dnl --------------------------------------------------------------------------- +dnl Display configuration status +dnl --------------------------------------------------------------------------- + +LOC_MSG() +LOC_MSG([Libtiff is now configured for ${host}]) +LOC_MSG() +LOC_MSG([ Installation directory: ${prefix}]) +LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}]) +LOC_MSG([ C compiler: ${CC} ${CFLAGS}]) +LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}]) +LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}]) +LOC_MSG([ Enable linker symbol versioning: ${have_ld_version_script}]) +LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}]) +LOC_MSG([ Use win32 IO: ${win32_io_ok}]) +LOC_MSG() +LOC_MSG([ Support for internal codecs:]) +LOC_MSG([ CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}]) +LOC_MSG([ Macintosh PackBits algorithm: ${HAVE_PACKBITS}]) +LOC_MSG([ LZW algorithm: ${HAVE_LZW}]) +LOC_MSG([ ThunderScan 4-bit RLE algorithm: ${HAVE_THUNDER}]) +LOC_MSG([ NeXT 2-bit RLE algorithm: ${HAVE_NEXT}]) +LOC_MSG([ LogLuv high dynamic range encoding: ${HAVE_LOGLUV}]) +LOC_MSG() +LOC_MSG([ Support for external codecs:]) +LOC_MSG([ ZLIB support: ${HAVE_ZLIB}]) +LOC_MSG([ Pixar log-format algorithm: ${HAVE_PIXARLOG}]) +LOC_MSG([ JPEG support: ${HAVE_JPEG}]) +LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}]) +LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}]) +LOC_MSG([ ISO JBIG support: ${HAVE_JBIG}]) +LOC_MSG([ LZMA2 support: ${HAVE_LZMA}]) +LOC_MSG() +LOC_MSG([ C++ support: ${HAVE_CXX}]) +LOC_MSG() +dnl LOC_MSG([ X Athena Widgets support: ${HAVE_XAW}]) +LOC_MSG([ OpenGL support: ${HAVE_OPENGL}]) +LOC_MSG() + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/configure.com b/thirdparty/LibTIFF/tiff-4.0.3/configure.com new file mode 100644 index 0000000..2267517 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/configure.com @@ -0,0 +1,1357 @@ +$! $Id: configure.com,v 1.3 2012-07-29 15:45:29 tgl Exp $ +$! +$! OpenVMS configure procedure for libtiff +$! (c) Alexey Chupahin 22-NOV-2007 +$! elvis_75@mail.ru +$! +$! Permission to use, copy, modify, distribute, and sell this software and +$! its documentation for any purpose is hereby granted without fee, provided +$! that (i) the above copyright notices and this permission notice appear in +$! all copies of the software and related documentation, and (ii) the names of +$! Sam Leffler and Silicon Graphics may not be used in any advertising or +$! publicity relating to the software without the specific, prior written +$! permission of Sam Leffler and Silicon Graphics. +$! +$! THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +$! EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +$! WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +$! +$! IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +$! ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +$! OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +$! WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +$! LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +$! OF THIS SOFTWARE. +$! +$! +$ SET NOON +$WRITE SYS$OUTPUT " " +$WRITE SYS$OUTPUT "Configuring libTIFF library" +$WRITE SYS$OUTPUT " " +$! Checking architecture +$DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. "" +$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT "BAD compiler" GOTO EXIT +$ IF F$GETSYI("ARCH_TYPE").EQ.1 THEN CPU = "VAX" +$ IF F$GETSYI("ARCH_TYPE").EQ.2 THEN CPU = "Alpha" +$ IF F$GETSYI("ARCH_TYPE").EQ.3 THEN CPU = "I64" +$ OS = F$GETSYI("VERSION") +$WRITE SYS$OUTPUT "Checking architecture ... ", CPU +$WRITE SYS$OUTPUT "Checking OS ... OpenVMS ",OS +$SHARED=0 +$IF ( (CPU.EQS."Alpha").OR.(CPU.EQS."I64") ) +$ THEN +$ SHARED=64 +$ ELSE +$ SHARED=32 +$ENDIF +$MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. "" +$MMK = F$TYPE(MMK) +$IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES +$! I cant find any make tool +$GOTO EXIT +$! +$! +$TEST_LIBRARIES: +$! Setting as MAKE utility one of MMS or MMK. I prefer MMS. +$IF (MMK.NES."") THEN MAKE="MMK" +$IF (MMS) THEN MAKE="MMS" +$WRITE SYS$OUTPUT "Checking build utility ... ''MAKE'" +$WRITE SYS$OUTPUT " " +$! +$! +$IF (P1.EQS."STATIC").OR.(P1.EQS."static") THEN SHARED=0 +$! +$! +$!"Checking for strcasecmp " +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT + #include + #include + + int main() + { + if (strcasecmp("bla", "Bla")==0) exit(0); + else exit(2); + } +$! +$TMP = $STATUS +$DEASS SYS$ERROR +$DEAS SYS$OUTPUT +$IF (TMP .NE. %X10B90001) +$ THEN +$ HAVE_STRCASECMP=0 +$ GOTO NEXT1 +$ENDIF +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$LINK/EXE=TEST TEST +$TMP = $STATUS +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10000001) +$ THEN +$ HAVE_STRCASECMP=0 +$ GOTO NEXT1 +$ENDIF +$! +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$RUN TEST +$IF ($STATUS .NE. %X00000001) +$ THEN +$ HAVE_STRCASECMP=0 +$ ELSE +$ HAVE_STRCASECMP=1 +$ENDIF +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$NEXT1: +$IF (HAVE_STRCASECMP.EQ.1) +$ THEN +$ WRITE SYS$OUTPUT "Checking for strcasecmp ... Yes" +$ ELSE +$ WRITE SYS$OUTPUT "Checking for strcasecmp ... No" +$ENDIF +$! +$! + +$!"Checking for lfind " +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT + #include + + int main() + { + lfind((const void *)key, (const void *)NULL, (size_t *)NULL, + (size_t) 0, NULL); + } +$! +$TMP = $STATUS +$DEASS SYS$ERROR +$DEAS SYS$OUTPUT +$IF (TMP .NE. %X10B90001) +$ THEN +$ HAVE_LFIND=0 +$ GOTO NEXT2 +$ENDIF +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$LINK/EXE=TEST TEST +$TMP = $STATUS +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10000001) +$ THEN +$ HAVE_LFIND=0 +$ GOTO NEXT2 +$ ELSE +$ HAVE_LFIND=1 +$ENDIF +$! +$NEXT2: +$IF (HAVE_LFIND.EQ.1) +$ THEN +$ WRITE SYS$OUTPUT "Checking for lfind ... Yes" +$ ELSE +$ WRITE SYS$OUTPUT "Checking for lfind ... No" +$ENDIF +$! +$! +$!"Checking for correct zlib library " +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT + #include + #include + #include + int main() + { + printf("checking version zlib: %s\n",zlibVersion()); + } +$TMP = $STATUS +$DEASS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10B90001) +$ THEN +$ HAVE_ZLIB=0 +$ GOTO EXIT +$ENDIF +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$LINK/EXE=TEST TEST,ZLIB:LIBZ/LIB +$TMP = $STATUS +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10000001) +$ THEN +$ HAVE_ZLIB=0 +$ GOTO EXIT +$ ELSE +$ HAVE_ZLIB=1 +$ENDIF +$IF (HAVE_ZLIB.EQ.1) +$ THEN +$ WRITE SYS$OUTPUT "Checking for correct zlib library ... Yes" +$ ELSE +$ WRITE SYS$OUTPUT "Checking for correct zlib library ... No" +$ WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html" +$ENDIF +$RUN TEST +$! + +$DEL TEST.OBJ;* +$! Checking for JPEG ... +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ CC/OBJECT=TEST.OBJ/INCLUDE=(JPEG) SYS$INPUT + #include + #include + #include + #include + int main() + { + printf("checking version jpeg: %s\n",JVERSION); + jpeg_quality_scaling(0); + return 0; + } +$TMP = $STATUS +$DEASS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10B90001) +$ THEN +$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No" +$ HAVE_JPEG=0 +$ENDIF +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$LINK/EXE=TEST TEST,JPEG:LIBJPEG/LIB +$TMP = $STATUS +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10000001) +$ THEN +$ HAVE_JPEG=0 +$ ELSE +$ HAVE_JPEG=1 +$ENDIF +$IF (HAVE_JPEG.EQ.1) +$ THEN +$ WRITE SYS$OUTPUT "Checking for static jpeg library ... Yes" +$ JPEG_LIBRARY_PATH="JPEG:LIBJPEG/LIB" +$ RUN TEST +$ ELSE +$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No" +$ENDIF +$! +$!"Checking for SHARED JPEG library " +$OPEN/WRITE OUT TEST.OPT +$WRITE OUT "SYS$SHARE:LIBJPEG$SHR/SHARE" +$WRITE OUT "ZLIB:LIBZ/LIB" +$CLOSE OUT +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$LINK/EXE=TEST TEST,TEST/OPT +$TMP = $STATUS +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT +$!WRITE SYS$OUTPUT TMP +$IF (TMP .NE. %X10000001) +$ THEN +$ HAVE_JPEG_SHARED=0 +$ ELSE +$ HAVE_JPEG_SHARED=1 +$ENDIF +$IF (HAVE_JPEG_SHARED.EQ.1) +$ THEN +$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... Yes" +$ JPEG_LIBRARY_PATH="SYS$SHARE:LIBJPEG$SHR/SHARE" +$ ELSE +$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... No" +$ENDIF +$! +$ IF ( (HAVE_JPEG_SHARED.EQ.0).AND.(HAVE_JPEG.EQ.0) ) +$ THEN +$ WRITE SYS$OUTPUT "No JPEG library installed. This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html" +$ GOTO EXIT +$ ENDIF +$! +$! +$! +$! Checking for X11 ... +$IF F$TRNLNM("DECW$INCLUDE") .NES. "" +$ THEN +$ WRITE SYS$OUTPUT "Checking for X11 ... Yes" +$ ELSE +$ WRITE SYS$OUTPUT "Checking for X11 ... No" +$ WRITE SYS$OUTPUT "This is fatal. Please install X11 software" +$ GOTO EXIT +$ENDIF +$! +$!WRITING BUILD FILES +$OPEN/WRITE OUT BUILD.COM +$ WRITE OUT "$set def [.port]" +$ WRITE OUT "$",MAKE +$ WRITE OUT "$set def [-.libtiff]" +$ WRITE OUT "$",MAKE +$ WRITE OUT "$set def [-.tools]" +$ WRITE OUT "$",MAKE +$ WRITE OUT "$set def [-]" +$ WRITE OUT "$cop [.PORT]LIBPORT.OLB [.LIBTIFF]LIBPORT.OLB" +$ WRITE OUT "$ CURRENT = F$ENVIRONMENT (""DEFAULT"") " +$ WRITE OUT "$TIFF=CURRENT" +$ WRITE OUT "$OPEN/WRITE OUTT LIBTIFF$STARTUP.COM" +$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),9]:="".LIBTIFF]""" +$ WRITE OUT "$WRITE OUTT ""DEFINE TIFF ","'","'","TIFF'"" " +$ WRITE OUT "$TIFF=CURRENT" +$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),7]:="".TOOLS]""" +$ WRITE OUT "$WRITE OUTT ""BMP2TIFF:==$", "'","'","TIFF'BMP2TIFF""" +$ WRITE OUT "$WRITE OUTT ""FAX2PS:==$", "'","'","TIFF'FAX2PS""" +$ WRITE OUT "$WRITE OUTT ""FAX2TIFF:==$", "'","'","TIFF'FAX2TIFF""" +$ WRITE OUT "$WRITE OUTT ""GIF2TIFF:==$", "'","'","TIFF'GIF2TIFF""" +$ WRITE OUT "$WRITE OUTT ""PAL2RGB:==$", "'","'","TIFF'PAL2RGB""" +$ WRITE OUT "$WRITE OUTT ""PPM2TIFF:==$", "'","'","TIFF'PPM2TIFF""" +$ WRITE OUT "$WRITE OUTT ""RAS2TIFF:==$", "'","'","TIFF'RAS2TIFF""" +$ WRITE OUT "$WRITE OUTT ""RAW2TIFF:==$", "'","'","TIFF'RAW2TIFF""" +$ WRITE OUT "$WRITE OUTT ""RGB2YCBCR:==$", "'","'","TIFF'RGB2YCBCR""" +$ WRITE OUT "$WRITE OUTT ""THUMBNAIL:==$", "'","'","TIFF'THUMBNAIL""" +$ WRITE OUT "$WRITE OUTT ""TIFF2BW:==$", "'","'","TIFF'TIFF2BW""" +$ WRITE OUT "$WRITE OUTT ""TIFF2PDF:==$", "'","'","TIFF'TIFF2PDF""" +$ WRITE OUT "$WRITE OUTT ""TIFF2PS:==$", "'","'","TIFF'TIFF2PS""" +$ WRITE OUT "$WRITE OUTT ""TIFF2RGBA:==$", "'","'","TIFF'TIFF2RGBA""" +$ WRITE OUT "$WRITE OUTT ""TIFFCMP:==$", "'","'","TIFF'TIFFCMP""" +$ WRITE OUT "$WRITE OUTT ""TIFFCP:==$", "'","'","TIFF'TIFFCP""" +$ WRITE OUT "$WRITE OUTT ""TIFFDITHER:==$", "'","'","TIFF'TIFFDITHER""" +$ WRITE OUT "$WRITE OUTT ""TIFFDUMP:==$", "'","'","TIFF'TIFFDUMP""" +$ WRITE OUT "$WRITE OUTT ""TIFFINFO:==$", "'","'","TIFF'TIFFINFO""" +$ WRITE OUT "$WRITE OUTT ""TIFFMEDIAN:==$", "'","'","TIFF'TIFFMEDIAN""" +$ WRITE OUT "$WRITE OUTT ""TIFFCROP:==$", "'","'","TIFF'TIFFCROP""" +$ WRITE OUT "$WRITE OUTT ""TIFFSET:==$", "'","'","TIFF'TIFFSET""" +$ WRITE OUT "$CLOSE OUTT" +$ WRITE OUT "$OPEN/WRITE OUTT [.LIBTIFF]LIBTIFF.OPT" +$ WRITE OUT "$WRITE OUTT ""TIFF:TIFF/LIB"" +$ WRITE OUT "$WRITE OUTT ""TIFF:LIBPORT/LIB"" +$ WRITE OUT "$WRITE OUTT ""JPEG:LIBJPEG/LIB"" +$ WRITE OUT "$WRITE OUTT ""ZLIB:LIBZ/LIB"" +$ WRITE OUT "$CLOSE OUTT" +$! +$ WRITE OUT "$WRITE SYS$OUTPUT "" "" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""LIBTIFF$STARTUP.COM has been created. "" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""This file setups all logicals needed. It should be execute before using LibTIFF "" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""Nice place to call it - LOGIN.COM "" " +$ WRITE OUT "$WRITE SYS$OUTPUT """" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""Using the library:"" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""CC/INC=TIFF ASCII_TAG.C"" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""LINK ASCII_TAG,TIFF:LIBTIFF/OPT"" " +$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" " +$CLOSE OUT +$! +$! DESCRIP.MMS in [.PORT] +$OBJ="dummy.obj" +$IF HAVE_STRCASECMP.NE.1 +$ THEN +$ OBJ=OBJ+",strcasecmp.obj" +$ENDIF +$IF HAVE_LFIND.NE.1 +$ THEN +$ OBJ=OBJ+",lfind.obj" +$ENDIF +$OPEN/WRITE OUT [.PORT]DESCRIP.MMS +$WRITE OUT "OBJ=",OBJ +$WRITE OUT "" +$WRITE OUT "LIBPORT.OLB : $(OBJ)" +$WRITE OUT " LIB/CREA LIBPORT $(OBJ)" +$WRITE OUT "" +$WRITE OUT "" +$WRITE OUT "dummy.obj : dummy.c" +$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)" +$WRITE OUT "" +$WRITE OUT "" +$WRITE OUT "strcasecmp.obj : strcasecmp.c" +$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)" +$WRITE OUT "" +$WRITE OUT "" +$WRITE OUT "lfind.obj : lfind.c" +$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)" +$WRITE OUT "" +$WRITE OUT "" +$CLOSE OUT +$! +$! +$WRITE SYS$OUTPUT "Creating LIBTIFF$DEF.OPT" +$IF (SHARED.EQ.64) +$ THEN +$ COPY SYS$INPUT TIFF$DEF.OPT +SYMBOL_VECTOR= (- +TIFFOpen=PROCEDURE,- +TIFFGetVersion=PROCEDURE,- +TIFFCleanup=PROCEDURE,- +TIFFClose=PROCEDURE,- +TIFFFlush=PROCEDURE,- +TIFFFlushData=PROCEDURE,- +TIFFGetField=PROCEDURE,- +TIFFVGetField=PROCEDURE,- +TIFFGetFieldDefaulted=PROCEDURE,- +TIFFVGetFieldDefaulted=PROCEDURE,- +TIFFGetTagListEntry=PROCEDURE,- +TIFFGetTagListCount=PROCEDURE,- +TIFFReadDirectory=PROCEDURE,- +TIFFScanlineSize=PROCEDURE,- +TIFFStripSize=PROCEDURE,- +TIFFVStripSize=PROCEDURE,- +TIFFRawStripSize=PROCEDURE,- +TIFFTileRowSize=PROCEDURE,- +TIFFTileSize=PROCEDURE,- +TIFFVTileSize=PROCEDURE,- +TIFFFileno=PROCEDURE,- +TIFFSetFileno=PROCEDURE,- +TIFFGetMode=PROCEDURE,- +TIFFIsTiled=PROCEDURE,- +TIFFIsByteSwapped=PROCEDURE,- +TIFFIsBigEndian=PROCEDURE,- +TIFFIsMSB2LSB=PROCEDURE,- +TIFFIsUpSampled=PROCEDURE,- +TIFFCIELabToRGBInit=PROCEDURE,- +TIFFCIELabToXYZ=PROCEDURE,- +TIFFXYZToRGB=PROCEDURE,- +TIFFYCbCrToRGBInit=PROCEDURE,- +TIFFYCbCrtoRGB=PROCEDURE,- +TIFFCurrentRow=PROCEDURE,- +TIFFCurrentDirectory=PROCEDURE,- +TIFFCurrentStrip=PROCEDURE,- +TIFFCurrentTile=PROCEDURE,- +TIFFDataWidth=PROCEDURE,- +TIFFReadBufferSetup=PROCEDURE,- +TIFFWriteBufferSetup=PROCEDURE,- +TIFFSetupStrips=PROCEDURE,- +TIFFLastDirectory=PROCEDURE,- +TIFFSetDirectory=PROCEDURE,- +TIFFSetSubDirectory=PROCEDURE,- +TIFFUnlinkDirectory=PROCEDURE,- +TIFFSetField=PROCEDURE,- +TIFFVSetField=PROCEDURE,- +TIFFCheckpointDirectory=PROCEDURE,- +TIFFWriteDirectory=PROCEDURE,- +TIFFRewriteDirectory=PROCEDURE,- +TIFFPrintDirectory=PROCEDURE,- +TIFFReadScanline=PROCEDURE,- +TIFFWriteScanline=PROCEDURE,- +TIFFReadRGBAImage=PROCEDURE,- +TIFFReadRGBAImageOriented=PROCEDURE,- +TIFFFdOpen=PROCEDURE,- +TIFFClientOpen=PROCEDURE,- +TIFFFileName=PROCEDURE,- +TIFFError=PROCEDURE,- +TIFFErrorExt=PROCEDURE,- +TIFFWarning=PROCEDURE,- +TIFFWarningExt=PROCEDURE,- +TIFFSetErrorHandler=PROCEDURE,- +TIFFSetErrorHandlerExt=PROCEDURE,- +TIFFSetWarningHandler=PROCEDURE,- +TIFFSetWarningHandlerExt=PROCEDURE,- +TIFFComputeTile=PROCEDURE,- +TIFFCheckTile=PROCEDURE,- +TIFFNumberOfTiles=PROCEDURE,- +TIFFReadTile=PROCEDURE,- +TIFFWriteTile=PROCEDURE,- +TIFFComputeStrip=PROCEDURE,- +TIFFNumberOfStrips=PROCEDURE,- +TIFFRGBAImageBegin=PROCEDURE,- +TIFFRGBAImageGet=PROCEDURE,- +TIFFRGBAImageEnd=PROCEDURE,- +TIFFReadEncodedStrip=PROCEDURE,- +TIFFReadRawStrip=PROCEDURE,- +TIFFReadEncodedTile=PROCEDURE,- +TIFFReadRawTile=PROCEDURE,- +TIFFReadRGBATile=PROCEDURE,- +TIFFReadRGBAStrip=PROCEDURE,- +TIFFWriteEncodedStrip=PROCEDURE,- +TIFFWriteRawStrip=PROCEDURE,- +TIFFWriteEncodedTile=PROCEDURE,- +TIFFWriteRawTile=PROCEDURE,- +TIFFSetWriteOffset=PROCEDURE,- +TIFFSwabDouble=PROCEDURE,- +TIFFSwabShort=PROCEDURE,- +TIFFSwabLong=PROCEDURE,- +TIFFSwabArrayOfShort=PROCEDURE,- +TIFFSwabArrayOfLong=PROCEDURE,- +TIFFSwabArrayOfDouble=PROCEDURE,- +TIFFSwabArrayOfTriples=PROCEDURE,- +TIFFReverseBits=PROCEDURE,- +TIFFGetBitRevTable=PROCEDURE,- +TIFFDefaultStripSize=PROCEDURE,- +TIFFDefaultTileSize=PROCEDURE,- +TIFFRasterScanlineSize=PROCEDURE,- +_TIFFmalloc=PROCEDURE,- +_TIFFrealloc=PROCEDURE,- +_TIFFfree=PROCEDURE,- +_TIFFmemset=PROCEDURE,- +_TIFFmemcpy=PROCEDURE,- +_TIFFmemcmp=PROCEDURE,- +TIFFCreateDirectory=PROCEDURE,- +TIFFSetTagExtender=PROCEDURE,- +TIFFMergeFieldInfo=PROCEDURE,- +TIFFFindFieldInfo=PROCEDURE,- +TIFFFindFieldInfoByName=PROCEDURE,- +TIFFFieldWithName=PROCEDURE,- +TIFFFieldWithTag=PROCEDURE,- +TIFFFieldTag=PROCEDURE,- +TIFFFieldName=PROCEDURE,- +TIFFFieldDataType=PROCEDURE,- +TIFFFieldPassCount=PROCEDURE,- +TIFFFieldReadCount=PROCEDURE,- +TIFFFieldWriteCount=PROCEDURE,- +TIFFCurrentDirOffset=PROCEDURE,- +TIFFWriteCheck=PROCEDURE,- +TIFFRGBAImageOK=PROCEDURE,- +TIFFNumberOfDirectories=PROCEDURE,- +TIFFSetFileName=PROCEDURE,- +TIFFSetClientdata=PROCEDURE,- +TIFFSetMode=PROCEDURE,- +TIFFClientdata=PROCEDURE,- +TIFFGetReadProc=PROCEDURE,- +TIFFGetWriteProc=PROCEDURE,- +TIFFGetSeekProc=PROCEDURE,- +TIFFGetCloseProc=PROCEDURE,- +TIFFGetSizeProc=PROCEDURE,- +TIFFGetMapFileProc=PROCEDURE,- +TIFFGetUnmapFileProc=PROCEDURE,- +TIFFIsCODECConfigured=PROCEDURE,- +TIFFGetConfiguredCODECs=PROCEDURE,- +TIFFFindCODEC=PROCEDURE,- +TIFFRegisterCODEC=PROCEDURE,- +TIFFUnRegisterCODEC=PROCEDURE,- +TIFFFreeDirectory=PROCEDURE,- +TIFFReadCustomDirectory=PROCEDURE,- +TIFFReadEXIFDirectory=PROCEDURE,- +TIFFAccessTagMethods=PROCEDURE,- +TIFFGetClientInfo=PROCEDURE,- +TIFFSetClientInfo=PROCEDURE,- +TIFFReassignTagToIgnore=PROCEDURE- +) + +$ENDIF +$IF (SHARED.EQ.32) +$ THEN +$ COPY SYS$INPUT TIFF$DEF.OPT +UNIVERSAL=TIFFOpen +UNIVERSAL=TIFFGetVersion +UNIVERSAL=TIFFCleanup +UNIVERSAL=TIFFClose +UNIVERSAL=TIFFFlush +UNIVERSAL=TIFFFlushData +UNIVERSAL=TIFFGetField +UNIVERSAL=TIFFVGetField +UNIVERSAL=TIFFGetFieldDefaulted +UNIVERSAL=TIFFVGetFieldDefaulted +UNIVERSAL=TIFFGetTagListEntry +UNIVERSAL=TIFFGetTagListCount +UNIVERSAL=TIFFReadDirectory +UNIVERSAL=TIFFScanlineSize +UNIVERSAL=TIFFStripSize +UNIVERSAL=TIFFVStripSize +UNIVERSAL=TIFFRawStripSize +UNIVERSAL=TIFFTileRowSize +UNIVERSAL=TIFFTileSize +UNIVERSAL=TIFFVTileSize +UNIVERSAL=TIFFFileno +UNIVERSAL=TIFFSetFileno +UNIVERSAL=TIFFGetMode +UNIVERSAL=TIFFIsTiled +UNIVERSAL=TIFFIsByteSwapped +UNIVERSAL=TIFFIsBigEndian +UNIVERSAL=TIFFIsMSB2LSB +UNIVERSAL=TIFFIsUpSampled +UNIVERSAL=TIFFCIELabToRGBInit +UNIVERSAL=TIFFCIELabToXYZ +UNIVERSAL=TIFFXYZToRGB +UNIVERSAL=TIFFYCbCrToRGBInit +UNIVERSAL=TIFFYCbCrtoRGB +UNIVERSAL=TIFFCurrentRow +UNIVERSAL=TIFFCurrentDirectory +UNIVERSAL=TIFFCurrentStrip +UNIVERSAL=TIFFCurrentTile +UNIVERSAL=TIFFDataWidth +UNIVERSAL=TIFFReadBufferSetup +UNIVERSAL=TIFFWriteBufferSetup +UNIVERSAL=TIFFSetupStrips +UNIVERSAL=TIFFLastDirectory +UNIVERSAL=TIFFSetDirectory +UNIVERSAL=TIFFSetSubDirectory +UNIVERSAL=TIFFUnlinkDirectory +UNIVERSAL=TIFFSetField +UNIVERSAL=TIFFVSetField +UNIVERSAL=TIFFCheckpointDirectory +UNIVERSAL=TIFFWriteDirectory +UNIVERSAL=TIFFRewriteDirectory +UNIVERSAL=TIFFPrintDirectory +UNIVERSAL=TIFFReadScanline +UNIVERSAL=TIFFWriteScanline +UNIVERSAL=TIFFReadRGBAImage +UNIVERSAL=TIFFReadRGBAImageOriented +UNIVERSAL=TIFFFdOpen +UNIVERSAL=TIFFClientOpen +UNIVERSAL=TIFFFileName +UNIVERSAL=TIFFError +UNIVERSAL=TIFFErrorExt +UNIVERSAL=TIFFWarning +UNIVERSAL=TIFFWarningExt +UNIVERSAL=TIFFSetErrorHandler +UNIVERSAL=TIFFSetErrorHandlerExt +UNIVERSAL=TIFFSetWarningHandler +UNIVERSAL=TIFFSetWarningHandlerExt +UNIVERSAL=TIFFComputeTile +UNIVERSAL=TIFFCheckTile +UNIVERSAL=TIFFNumberOfTiles +UNIVERSAL=TIFFReadTile +UNIVERSAL=TIFFWriteTile +UNIVERSAL=TIFFComputeStrip +UNIVERSAL=TIFFNumberOfStrips +UNIVERSAL=TIFFRGBAImageBegin +UNIVERSAL=TIFFRGBAImageGet +UNIVERSAL=TIFFRGBAImageEnd +UNIVERSAL=TIFFReadEncodedStrip +UNIVERSAL=TIFFReadRawStrip +UNIVERSAL=TIFFReadEncodedTile +UNIVERSAL=TIFFReadRawTile +UNIVERSAL=TIFFReadRGBATile +UNIVERSAL=TIFFReadRGBAStrip +UNIVERSAL=TIFFWriteEncodedStrip +UNIVERSAL=TIFFWriteRawStrip +UNIVERSAL=TIFFWriteEncodedTile +UNIVERSAL=TIFFWriteRawTile +UNIVERSAL=TIFFSetWriteOffset +UNIVERSAL=TIFFSwabDouble +UNIVERSAL=TIFFSwabShort +UNIVERSAL=TIFFSwabLong +UNIVERSAL=TIFFSwabArrayOfShort +UNIVERSAL=TIFFSwabArrayOfLong +UNIVERSAL=TIFFSwabArrayOfDouble +UNIVERSAL=TIFFSwabArrayOfTriples +UNIVERSAL=TIFFReverseBits +UNIVERSAL=TIFFGetBitRevTable +UNIVERSAL=TIFFDefaultStripSize +UNIVERSAL=TIFFDefaultTileSize +UNIVERSAL=TIFFRasterScanlineSize +UNIVERSAL=_TIFFmalloc +UNIVERSAL=_TIFFrealloc +UNIVERSAL=_TIFFfree +UNIVERSAL=_TIFFmemset +UNIVERSAL=_TIFFmemcpy +UNIVERSAL=_TIFFmemcmp +UNIVERSAL=TIFFCreateDirectory +UNIVERSAL=TIFFSetTagExtender +UNIVERSAL=TIFFMergeFieldInfo +UNIVERSAL=TIFFFindFieldInfo +UNIVERSAL=TIFFFindFieldInfoByName +UNIVERSAL=TIFFFieldWithName +UNIVERSAL=TIFFFieldWithTag +UNIVERSAL=TIFFFieldTag +UNIVERSAL=TIFFFieldName +UNIVERSAL=TIFFFieldDataType +UNIVERSAL=TIFFFieldPassCount +UNIVERSAL=TIFFFieldReadCount +UNIVERSAL=TIFFFieldWriteCount +UNIVERSAL=TIFFCurrentDirOffset +UNIVERSAL=TIFFWriteCheck +UNIVERSAL=TIFFRGBAImageOK +UNIVERSAL=TIFFNumberOfDirectories +UNIVERSAL=TIFFSetFileName +UNIVERSAL=TIFFSetClientdata +UNIVERSAL=TIFFSetMode +UNIVERSAL=TIFFClientdata +UNIVERSAL=TIFFGetReadProc +UNIVERSAL=TIFFGetWriteProc +UNIVERSAL=TIFFGetSeekProc +UNIVERSAL=TIFFGetCloseProc +UNIVERSAL=TIFFGetSizeProc +UNIVERSAL=TIFFGetMapFileProc +UNIVERSAL=TIFFGetUnmapFileProc +UNIVERSAL=TIFFIsCODECConfigured +UNIVERSAL=TIFFGetConfiguredCODECs +UNIVERSAL=TIFFFindCODEC +UNIVERSAL=TIFFRegisterCODEC +UNIVERSAL=TIFFUnRegisterCODEC +UNIVERSAL=TIFFFreeDirectory +UNIVERSAL=TIFFReadCustomDirectory +UNIVERSAL=TIFFReadEXIFDirectory +UNIVERSAL=TIFFAccessTagMethods +UNIVERSAL=TIFFGetClientInfo +UNIVERSAL=TIFFSetClientInfo +UNIVERSAL=TIFFReassignTagToIgnore + +$ENDIF +$! +$! +$! Writing TIFF$SHR.OPT file to build TOOLS +$ IF (SHARED.GT.0) +$ THEN +$ OPEN/WRITE OUT TIFF$SHR.OPT +$ WRITE OUT "[]TIFF/LIB" +$ WRITE OUT "[-.PORT]LIBPORT/LIB" +$ WRITE OUT JPEG_LIBRARY_PATH +$ WRITE OUT "ZLIB:LIBZ/LIB" +$ CLOSE OUT +$ ENDIF +$! +$! +$! Writing OPT.OPT file to build TOOLS +$OPEN/WRITE OUT OPT.OPT +$ IF (SHARED.GT.0) +$ THEN +$ WRITE OUT "[-.LIBTIFF]TIFF$SHR/SHARE" +$ WRITE OUT JPEG_LIBRARY_PATH +$ ELSE +$ WRITE OUT "[-.LIBTIFF]TIFF/LIB" +$ WRITE OUT "[-.PORT]LIBPORT/LIB" +$ WRITE OUT JPEG_LIBRARY_PATH +$ ENDIF +$ WRITE OUT "ZLIB:LIBZ/LIB" +$CLOSE OUT +$! +$! +$COPY SYS$INPUT [.LIBTIFF]DESCRIP.MMS +# (c) Alexey Chupahin 22-NOV-2007 +# OpenVMS 7.3-1, DEC 2000 mod.300 +# OpenVMS 8.3, HP rx1620 +# Makefile for DEC C compilers. +# + +INCL = /INCLUDE=(JPEG,ZLIB,[]) + +CFLAGS = $(INCL) + +OBJ_SYSDEP_MODULE = tif_vms.obj + +OBJ = \ +tif_aux.obj,\ +tif_close.obj,\ +tif_codec.obj,\ +tif_color.obj,\ +tif_compress.obj,\ +tif_dir.obj,\ +tif_dirinfo.obj,\ +tif_dirread.obj,\ +tif_dirwrite.obj,\ +tif_dumpmode.obj,\ +tif_error.obj,\ +tif_extension.obj,\ +tif_fax3.obj,\ +tif_fax3sm.obj,\ +tif_flush.obj,\ +tif_getimage.obj,\ +tif_jbig.obj,\ +tif_jpeg.obj,\ +tif_luv.obj,\ +tif_lzw.obj,\ +tif_next.obj,\ +tif_ojpeg.obj,\ +tif_open.obj,\ +tif_packbits.obj,\ +tif_pixarlog.obj,\ +tif_predict.obj,\ +tif_print.obj,\ +tif_read.obj,\ +tif_strip.obj,\ +tif_swab.obj,\ +tif_thunder.obj,\ +tif_tile.obj,\ +tif_version.obj,\ +tif_warning.obj,\ +tif_write.obj,\ +tif_zip.obj, $(OBJ_SYSDEP_MODULE) + +$IF (SHARED.GT.0) +$ THEN +$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS +ALL : tiff.olb, tiff$shr.exe + $WRITE SYS$OUTPUT "Done" + +tiff$shr.exe : tiff.olb + LINK/SHARE=TIFF$SHR.EXE TIF_AUX,[-]TIFF$DEF/OPT, [-]TIFF$SHR/OPT + COPY TIFF$SHR.EXE SYS$SHARE + PURGE SYS$SHARE:TIFF$SHR.EXE + +$ ELSE +$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS +ALL : tiff.olb + $WRITE SYS$OUTPUT "Done" + +$ENDIF +$! +$! +$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS + +tiff.olb : $(OBJ) + lib/crea tiff.olb $(OBJ) + +#tif_config.h : tif_config.h-vms +# copy tif_config.h-vms tif_config.h +# +#tiffconf.h : tiffconf.h-vms +# copy tiffconf.h-vms tiffconf.h + +tif_aux.obj : tif_aux.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_close.obj : tif_close.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_codec.obj : tif_codec.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_color.obj : tif_color.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_compress.obj : tif_compress.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_dir.obj : tif_dir.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_dirinfo.obj : tif_dirinfo.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_dirread.obj : tif_dirread.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_dirwrite.obj : tif_dirwrite.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_dumpmode.obj : tif_dumpmode.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_error.obj : tif_error.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_extension.obj : tif_extension.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_fax3.obj : tif_fax3.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_fax3sm.obj : tif_fax3sm.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_flush.obj : tif_flush.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_getimage.obj : tif_getimage.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_jbig.obj : tif_jbig.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_jpeg.obj : tif_jpeg.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_luv.obj : tif_luv.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_lzw.obj : tif_lzw.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_next.obj : tif_next.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_ojpeg.obj : tif_ojpeg.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_open.obj : tif_open.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_packbits.obj : tif_packbits.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_pixarlog.obj : tif_pixarlog.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_predict.obj : tif_predict.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_print.obj : tif_print.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_read.obj : tif_read.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_strip.obj : tif_strip.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_swab.obj : tif_swab.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_thunder.obj : tif_thunder.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_tile.obj : tif_tile.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_unix.obj : tif_unix.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_version.obj : tif_version.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_warning.obj : tif_warning.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_write.obj : tif_write.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tif_zip.obj : tif_zip.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + + +clean : + del *.obj;* + del *.olb;* +$! +$! +$! +$COPY SYS$INPUT [.TOOLS]DESCRIP.MMS +# (c) Alexey Chupahin 22-NOV-2007 +# OpenVMS 7.3-1, DEC 2000 mod.300 +# OpenVMS 8.3, HP rx1620 + +INCL = /INCL=([],[-.LIBTIFF]) +CFLAGS = $(INCL) +LIBS = [-]OPT/OPT + +OBJ=\ +bmp2tiff.exe,\ +fax2ps.exe,\ +fax2tiff.exe,\ +gif2tiff.exe,\ +pal2rgb.exe,\ +ppm2tiff.exe,\ +ras2tiff.exe,\ +raw2tiff.exe,\ +rgb2ycbcr.exe,\ +thumbnail.exe,\ +tiff2bw.exe,\ +tiff2pdf.exe,\ +tiff2ps.exe,\ +tiff2rgba.exe,\ +tiffcmp.exe,\ +tiffcp.exe,\ +tiffcrop.exe,\ +tiffdither.exe,\ +tiffdump.exe,\ +tiffinfo.exe,\ +tiffmedian.exe,\ +tiffset.exe,\ +tiffsplit.exe,\ +ycbcr.exe + + +all : $(OBJ) + $! + +bmp2tiff.obj : bmp2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +bmp2tiff.exe : bmp2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +fax2ps.obj : fax2ps.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +fax2ps.exe : fax2ps.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +fax2tiff.obj : fax2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +fax2tiff.exe : fax2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +gif2tiff.obj : gif2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +gif2tiff.exe : gif2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +pal2rgb.obj : pal2rgb.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +pal2rgb.exe : pal2rgb.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +ppm2tiff.obj : ppm2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +ppm2tiff.exe : ppm2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +ras2tiff.obj : ras2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +ras2tiff.exe : ras2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +raw2tiff.obj : raw2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +raw2tiff.exe : raw2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +rgb2ycbcr.obj : rgb2ycbcr.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +rgb2ycbcr.exe : rgb2ycbcr.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +sgi2tiff.obj : sgi2tiff.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +sgi2tiff.exe : sgi2tiff.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +sgisv.obj : sgisv.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +sgisv.exe : sgisv.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +thumbnail.obj : thumbnail.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +thumbnail.exe : thumbnail.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiff2bw.obj : tiff2bw.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiff2bw.exe : tiff2bw.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiff2pdf.obj : tiff2pdf.c + $(CC) $(CFLAGS) /NOWARN $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiff2pdf.exe : tiff2pdf.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiff2ps.obj : tiff2ps.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiff2ps.exe : tiff2ps.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiff2rgba.obj : tiff2rgba.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiff2rgba.exe : tiff2rgba.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffcmp.obj : tiffcmp.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffcmp.exe : tiffcmp.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffcp.obj : tiffcp.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffcp.exe : tiffcp.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffcrop.obj : tiffcrop.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffcrop.exe : tiffcrop.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffdither.obj : tiffdither.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffdither.exe : tiffdither.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffdump.obj : tiffdump.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffdump.exe : tiffdump.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffgt.obj : tiffgt.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffgt.exe : tiffgt.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffinfo.obj : tiffinfo.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffinfo.exe : tiffinfo.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffmedian.obj : tiffmedian.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffmedian.exe : tiffmedian.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffset.obj : tiffset.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffset.exe : tiffset.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +tiffsplit.obj : tiffsplit.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +tiffsplit.exe : tiffsplit.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + +ycbcr.obj : ycbcr.c + $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET) + +ycbcr.exe : ycbcr.obj + LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS) + + +CLEAN : + DEL ALL.;* + DEL *.OBJ;* + DEL *.EXE;* + +$! +$! +$! +$!copiing and patching TIFF_CONF.H, TIF_CONFIG.H +$! +$CURRENT = F$ENVIRONMENT (""DEFAULT"") +$CURRENT[F$LOCATE("]",CURRENT),9]:=".LIBTIFF]" +$WRITE SYS$OUTPUT "Creating TIFFCONF.H and TIF_CONFIG.H" +$COPY SYS$INPUT 'CURRENT'TIFFCONF.H +/* + Configuration defines for installed libtiff. + This file maintained for backward compatibility. Do not use definitions + from this file in your programs. +*/ + +#ifndef _TIFFCONF_ +#define _TIFFCONF_ + +/* Define to 1 if the system has the type `int16'. */ +//#define HAVE_INT16 + +/* Define to 1 if the system has the type `int32'. */ +//#define HAVE_INT32 + +/* Define to 1 if the system has the type `int8'. */ +//#define HAVE_INT8 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Compatibility stuff. */ + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ + +#ifdef __IEEE_FLOAT +#define HAVE_IEEEFP 1 +#endif + +#define HAVE_GETOPT 1 + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#define HOST_BIGENDIAN 0 + +/* Support CCITT Group 3 & 4 algorithms */ +#define CCITT_SUPPORT 1 + +/* Support LogLuv high dynamic range encoding */ +#define LOGLUV_SUPPORT 1 + +/* Support LZW algorithm */ +#define LZW_SUPPORT 1 + +/* Support NeXT 2-bit RLE algorithm */ +#define NEXT_SUPPORT 1 + +/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation + fails with unpatched IJG JPEG library) */ + +/* Support Macintosh PackBits algorithm */ +#define PACKBITS_SUPPORT 1 + +/* Support Pixar log-format algorithm (requires Zlib) */ +#define PIXARLOG_SUPPORT 1 + +/* Support ThunderScan 4-bit RLE algorithm */ +#define THUNDER_SUPPORT 1 + +/* Support Deflate compression */ +/* #undef ZIP_SUPPORT */ + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of ~8Kb to reduce memory usage) */ +#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP + +/* Enable SubIFD tag (330) support */ +#define SUBIFD_SUPPORT 1 + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 + +/* + * Feature support definitions. + * XXX: These macros are obsoleted. Don't use them in your apps! + * Macros stays here for backward compatibility and should be always defined. + */ +#define COLORIMETRY_SUPPORT +#define YCBCR_SUPPORT +#define CMYK_SUPPORT +#define ICC_SUPPORT +#define PHOTOSHOP_SUPPORT +#define IPTC_SUPPORT + +#endif /* _TIFFCONF_ */ + + +$COPY SYS$INPUT 'CURRENT'TIF_CONFIG.H +/* Define to 1 if you have the header file. */ + +#ifndef HAVE_GETOPT +# define HAVE_GETOPT 1 +#endif + +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ + +#ifdef __IEEE_FLOAT +#define HAVE_IEEEFP 1 +#endif + +#define HAVE_UNISTD_H 1 + +#define HAVE_STRING_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +//#define HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +//#define HAVE_SEARCH_H 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +/* +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif +*/ + +/* Support CCITT Group 3 & 4 algorithms */ +#define CCITT_SUPPORT 1 + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 +/* Support C++ stream API (requires C++ compiler) */ +#define CXX_SUPPORT 1 + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 + +/* little Endian */ +#define HOST_BIGENDIAN 0 +#define JPEG_SUPPORT 1 +#define LOGLUV_SUPPORT 1 +/* Support LZW algorithm */ +#define LZW_SUPPORT 1 + +/* Support Microsoft Document Imaging format */ +#define MDI_SUPPORT 1 + +/* Support NeXT 2-bit RLE algorithm */ +#define NEXT_SUPPORT 1 +#define OJPEG_SUPPORT 1 + +/* Name of package */ +#define PACKAGE "tiff" + + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "tiff@lists.maptools.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "LibTIFF Software" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "LibTIFF Software 3.9.0beta for VMS" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "tiff" + +$PURGE 'CURRENT'TIFFCONF.H +$PURGE 'CURRENT'TIF_CONFIG.H +$OPEN/APPEND OUT 'CURRENT'TIF_CONFIG.H +$IF HAVE_LFIND.EQ.1 +$ THEN +$ WRITE OUT "#define HAVE_SEARCH_H 1" +$ ELSE +$ WRITE OUT "#undef HAVE_SEARCH_H" +$ENDIF +$CLOSE OUT +$! +$! +$WRITE SYS$OUTPUT " " +$WRITE SYS$OUTPUT " " +$WRITE SYS$OUTPUT "Now you can type @BUILD " +$! +$EXIT: +$DEFINE SYS$ERROR _NLA0: +$DEFINE SYS$OUTPUT _NLA0: +$DEL TEST.OBJ;* +$DEL TEST.C;* +$DEL TEST.EXE;* +$DEAS SYS$ERROR +$DEAS SYS$OUTPUT diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.am new file mode 100644 index 0000000..b231ef9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.am @@ -0,0 +1,29 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README + +SUBDIRS = addtiffo dbs iptcutil mfs pds ras stream tags win_dib + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.in new file mode 100644 index 0000000..e5b0741 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/Makefile.in @@ -0,0 +1,643 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README +SUBDIRS = addtiffo dbs iptcutil mfs pds ras stream tags win_dib +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + cscopelist cscopelist-recursive ctags ctags-recursive \ + distclean distclean-generic distclean-libtool distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/README new file mode 100644 index 0000000..26b7c5f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/README @@ -0,0 +1,2 @@ +This directory contains various contributions from libtiff users. + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.am new file mode 100644 index 0000000..d634a15 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.am @@ -0,0 +1,36 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +EXTRA_DIST = README Makefile.vc + +noinst_PROGRAMS = addtiffo + +addtiffo_SOURCES = addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h +addtiffo_LDADD = $(LIBTIFF) + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.in new file mode 100644 index 0000000..e442b40 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.in @@ -0,0 +1,602 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = addtiffo$(EXEEXT) +subdir = contrib/addtiffo +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_addtiffo_OBJECTS = addtiffo.$(OBJEXT) tif_overview.$(OBJEXT) \ + tif_ovrcache.$(OBJEXT) +addtiffo_OBJECTS = $(am_addtiffo_OBJECTS) +addtiffo_DEPENDENCIES = $(LIBTIFF) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(addtiffo_SOURCES) +DIST_SOURCES = $(addtiffo_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +EXTRA_DIST = README Makefile.vc +addtiffo_SOURCES = addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h +addtiffo_LDADD = $(LIBTIFF) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/addtiffo/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/addtiffo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +addtiffo$(EXEEXT): $(addtiffo_OBJECTS) $(addtiffo_DEPENDENCIES) $(EXTRA_addtiffo_DEPENDENCIES) + @rm -f addtiffo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(addtiffo_OBJECTS) $(addtiffo_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addtiffo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_overview.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ovrcache.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.vc new file mode 100644 index 0000000..2777dc2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/Makefile.vc @@ -0,0 +1,28 @@ +# +# If libtiff.a is installed in /usr/lib or /usr/local/lib just point +# LIBTIFF_DIR there. It doesn't need a full libtiff tree. +# +!INCLUDE ..\..\nmake.opt + +LIBTIFF_DIR = ..\..\libtiff +# +INCL = -I..\..\libtiff +LIBS = $(LIBTIFF_DIR)\libtiff.lib + +addtiffo: addtiffo.obj tif_overview.obj tif_ovrcache.obj + $(CC) $(CFLAGS) addtiffo.obj tif_overview.obj tif_ovrcache.obj \ + $(LIBS) /Feaddtiffo.exe + + +addtiffo.obj: addtiffo.c + $(CC) -c $(CFLAGS) addtiffo.c + +tif_overview.obj: tif_overview.c + $(CC) -c $(CFLAGS) tif_overview.c + +tif_ovrcache.obj: tif_ovrcache.c + $(CC) -c $(CFLAGS) tif_ovrcache.c + +clean: + -del *.obj + -del addtiffo.exe diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/README new file mode 100644 index 0000000..a6ca45f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/README @@ -0,0 +1,142 @@ + addtiffo 1.0 + ============ + +The addtiffo utility is used to add overview pyramids to an existing +TIFF or GeoTIFF file. Some applications can take advantage of these +overviews to accelerate overview display performance of large rasters. + +This release of addtiffo is primarily intended for compatibility testing +with applications, and to see if there is interest in a cleaner release +of the capability ... perhaps incorporation into the libtiff tools +distribution. + +Please feel free to contact me with questions, or problems. + +warmerda@home.com +http://home.gdal.org/~warmerda/ + + +Usage +----- + +Usage: addtiffo [-r {average/nearest} [-subifd] + tiff_filename [resolution_reductions] + +Example: + % addtiffo abc.tif 2 4 8 16 + +The numeric arguments are the list of reduction factors to +generate. In this example a 1/2, 1/4 1/8 and 1/16 + + + +Limitations +----------- + +See tif_overview.cpp for up to date details. + + o Currently only images with bits_per_sample of a multiple of eight + will work. + + o The code will attempt to use the same kind of compression, + photometric interpretation, and organization as the source image, but + it doesn't copy geotiff tags to the reduced resolution images. + + o Reduced resolution overviews for multi-sample files will currently + always be generated as PLANARCONFIG_SEPARATE. This could be fixed + reasonable easily if needed to improve compatibility with other + packages. Many don't properly support PLANARCONFIG_SEPARATE. + + o Overviews are always written as appended IFDs, rather than using the + ``tree of tree's'' approach using the SUBIFD tag. I wanted to implement + both, but it isn't currently easy to add a SUBIFD tag to an existing + main tiff IFD with libtiff. I hope to try this again later. + + +TIFF File Tags +-------------- + +The results of running addtiffo on a 1024x1024 tiled greyscale file +with the arguments ``2 4 8 16'' is to add four additional TIFF directories +appended on the file with the SUBFILETYPE flag to 0x1 indicating the extra +items are reduced resolution images. + +The tiffinfo output of such a file might look like this: + +TIFF Directory at offset 0x118008 + Image Width: 1024 Image Length: 1024 + Tile Width: 256 Tile Length: 112 + Bits/Sample: 8 + Compression Scheme: none + Photometric Interpretation: min-is-black + Samples/Pixel: 1 + Planar Configuration: single image plane +TIFF Directory at offset 0x15e1d2 + Subfile Type: reduced-resolution image (1 = 0x1) + Image Width: 512 Image Length: 512 + Tile Width: 256 Tile Length: 112 + Bits/Sample: 8 + Compression Scheme: none + Photometric Interpretation: min-is-black + Samples/Pixel: 1 + Planar Configuration: separate image planes +TIFF Directory at offset 0x1732b8 + Subfile Type: reduced-resolution image (1 = 0x1) + Image Width: 256 Image Length: 256 + Tile Width: 256 Tile Length: 112 + Bits/Sample: 8 + Compression Scheme: none + Photometric Interpretation: min-is-black + Samples/Pixel: 1 + Planar Configuration: separate image planes +TIFF Directory at offset 0x17a366 + Subfile Type: reduced-resolution image (1 = 0x1) + Image Width: 128 Image Length: 128 + Tile Width: 128 Tile Length: 112 + Bits/Sample: 8 + Compression Scheme: none + Photometric Interpretation: min-is-black + Samples/Pixel: 1 + Planar Configuration: separate image planes +TIFF Directory at offset 0x17b40c + Subfile Type: reduced-resolution image (1 = 0x1) + Image Width: 64 Image Length: 64 + Tile Width: 64 Tile Length: 64 + Bits/Sample: 8 + Compression Scheme: none + Photometric Interpretation: min-is-black + Samples/Pixel: 1 + Planar Configuration: separate image planes + + +Building +-------- + +You will need a C compiler. You will need to have libtiff already +built and installed. The provided Makefile should work on most Unix systems. +A similar file will be needed for Windows, but is not provided. + +The CFLAGS and LIBS macros in the Makefile will have to be updated to +point to the correct location of the libtiff include files, and library. + + +Credits +------- + + o Intergraph Corporation for partially funding the work. + + o Global Geomatics for partially funding reorganization of the overview + building ability as a separate utility. + + o Orrin Long, and Ed Grissom of Intergraph for explaining what needed to + be done. + + o Max Martinez of Erdas for his discussion of external overviews. + + o Atlantis Scientific who supported adding averaging, and some other + generalizations. + + o Frank Warmerdam for writing the bulk of the code. + + o Sam Leffler since this only exists because of his libtiff. + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/addtiffo.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/addtiffo.c new file mode 100644 index 0000000..d3920e2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/addtiffo.c @@ -0,0 +1,176 @@ +/****************************************************************************** + * $Id: addtiffo.c,v 1.7 2010-06-08 18:55:15 bfriesen Exp $ + * + * Project: GeoTIFF Overview Builder + * Purpose: Mainline for building overviews in a TIFF file. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************** + * + * $Log: addtiffo.c,v $ + * Revision 1.7 2010-06-08 18:55:15 bfriesen + * * contrib: Add an emacs formatting mode footer to all source files + * so that emacs can be effectively used. + * + * Revision 1.6 2005/12/16 05:59:55 fwarmerdam + * Major upgrade to support YCbCr subsampled jpeg images + * + * Revision 1.4 2004/09/21 13:31:23 dron + * Add missed include string.h. + * + * Revision 1.3 2000/04/18 22:48:31 warmerda + * Added support for averaging resampling + * + * Revision 1.2 2000/01/28 15:36:38 warmerda + * pass TIFF handle instead of filename to overview builder + * + * Revision 1.1 1999/08/17 01:47:59 warmerda + * New + * + * Revision 1.1 1999/03/12 17:46:32 warmerda + * New + * + * Revision 1.2 1999/02/11 22:27:12 warmerda + * Added multi-sample support + * + * Revision 1.1 1999/02/11 18:12:30 warmerda + * New + */ + +#include +#include +#include +#include "tiffio.h" + +void TIFFBuildOverviews( TIFF *, int, int *, int, const char *, + int (*)(double,void*), void * ); + +/************************************************************************/ +/* main() */ +/************************************************************************/ + +int main( int argc, char ** argv ) + +{ + int anOverviews[100]; /* TODO: un-hardwire array length, flexible allocate */ + int nOverviewCount = 0; + int bUseSubIFD = 0; + TIFF *hTIFF; + const char *pszResampling = "nearest"; + +/* -------------------------------------------------------------------- */ +/* Usage: */ +/* -------------------------------------------------------------------- */ + if( argc < 2 ) + { + printf( "Usage: addtiffo [-r {nearest,average,mode}]\n" + " tiff_filename [resolution_reductions]\n" + "\n" + "Example:\n" + " %% addtiffo abc.tif 2 4 8 16\n" ); + return( 1 ); + } + + while( argv[1][0] == '-' ) + { + if( strcmp(argv[1],"-subifd") == 0 ) + { + bUseSubIFD = 1; + argv++; + argc--; + } + else if( strcmp(argv[1],"-r") == 0 ) + { + argv += 2; + argc -= 2; + pszResampling = *argv; + } + else + { + fprintf( stderr, "Incorrect parameters\n" ); + return( 1 ); + } + } + + /* TODO: resampling mode parameter needs to be encoded in an integer from this point on */ + +/* -------------------------------------------------------------------- */ +/* Collect the user requested reduction factors. */ +/* -------------------------------------------------------------------- */ + while( nOverviewCount < argc - 2 && nOverviewCount < 100 ) + { + anOverviews[nOverviewCount] = atoi(argv[nOverviewCount+2]); + if( anOverviews[nOverviewCount] <= 0) + { + fprintf( stderr, "Incorrect parameters\n" ); + return(1); + } + nOverviewCount++; + } + +/* -------------------------------------------------------------------- */ +/* Default to four overview levels. It would be nicer if it */ +/* defaulted based on the size of the source image. */ +/* -------------------------------------------------------------------- */ + /* TODO: make it default based on the size of the source image */ + if( nOverviewCount == 0 ) + { + nOverviewCount = 4; + + anOverviews[0] = 2; + anOverviews[1] = 4; + anOverviews[2] = 8; + anOverviews[3] = 16; + } + +/* -------------------------------------------------------------------- */ +/* Build the overview. */ +/* -------------------------------------------------------------------- */ + hTIFF = TIFFOpen( argv[1], "r+" ); + if( hTIFF == NULL ) + { + fprintf( stderr, "TIFFOpen(%s) failed.\n", argv[1] ); + return( 1 ); + } + + TIFFBuildOverviews( hTIFF, nOverviewCount, anOverviews, bUseSubIFD, + pszResampling, NULL, NULL ); + + TIFFClose( hTIFF ); + +/* -------------------------------------------------------------------- */ +/* Optionally test for memory leaks. */ +/* -------------------------------------------------------------------- */ +#ifdef DBMALLOC + malloc_dump(1); +#endif + + return( 0 ); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_overview.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_overview.c new file mode 100644 index 0000000..156c081 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_overview.c @@ -0,0 +1,899 @@ +/****************************************************************************** + * tif_overview.c,v 1.9 2005/05/25 09:03:16 dron Exp + * + * Project: TIFF Overview Builder + * Purpose: Library function for building overviews in a TIFF file. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + * Notes: + * o Currently only images with bits_per_sample of a multiple of eight + * will work. + * + * o The downsampler currently just takes the top left pixel from the + * source rectangle. Eventually sampling options of averaging, mode, and + * ``center pixel'' should be offered. + * + * o The code will attempt to use the same kind of compression, + * photometric interpretation, and organization as the source image, but + * it doesn't copy geotiff tags to the reduced resolution images. + * + * o Reduced resolution overviews for multi-sample files will currently + * always be generated as PLANARCONFIG_SEPARATE. This could be fixed + * reasonable easily if needed to improve compatibility with other + * packages. Many don't properly support PLANARCONFIG_SEPARATE. + * + ****************************************************************************** + * Copyright (c) 1999, Frank Warmerdam + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************** + */ + +/* TODO: update notes in header above */ + +#include +#include +#include +#include + +#include "tiffio.h" +#include "tif_ovrcache.h" + +#ifndef FALSE +# define FALSE 0 +# define TRUE 1 +#endif + +#ifndef MAX +# define MIN(a,b) ((ab) ? a : b) +#endif + +void TIFFBuildOverviews( TIFF *, int, int *, int, const char *, + int (*)(double,void*), void * ); + +/************************************************************************/ +/* TIFF_WriteOverview() */ +/* */ +/* Create a new directory, without any image data for an overview. */ +/* Returns offset of newly created overview directory, but the */ +/* current directory is reset to be the one in used when this */ +/* function is called. */ +/************************************************************************/ + +uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize, + int nBitsPerPixel, int nPlanarConfig, int nSamples, + int nBlockXSize, int nBlockYSize, + int bTiled, int nCompressFlag, int nPhotometric, + int nSampleFormat, + unsigned short *panRed, + unsigned short *panGreen, + unsigned short *panBlue, + int bUseSubIFDs, + int nHorSubsampling, int nVerSubsampling ) + +{ + toff_t nBaseDirOffset; + toff_t nOffset; + + (void) bUseSubIFDs; + + nBaseDirOffset = TIFFCurrentDirOffset( hTIFF ); + + TIFFCreateDirectory( hTIFF ); + +/* -------------------------------------------------------------------- */ +/* Setup TIFF fields. */ +/* -------------------------------------------------------------------- */ + TIFFSetField( hTIFF, TIFFTAG_IMAGEWIDTH, nXSize ); + TIFFSetField( hTIFF, TIFFTAG_IMAGELENGTH, nYSize ); + if( nSamples == 1 ) + TIFFSetField( hTIFF, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG ); + else + TIFFSetField( hTIFF, TIFFTAG_PLANARCONFIG, nPlanarConfig ); + + TIFFSetField( hTIFF, TIFFTAG_BITSPERSAMPLE, nBitsPerPixel ); + TIFFSetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, nSamples ); + TIFFSetField( hTIFF, TIFFTAG_COMPRESSION, nCompressFlag ); + TIFFSetField( hTIFF, TIFFTAG_PHOTOMETRIC, nPhotometric ); + TIFFSetField( hTIFF, TIFFTAG_SAMPLEFORMAT, nSampleFormat ); + + if( bTiled ) + { + TIFFSetField( hTIFF, TIFFTAG_TILEWIDTH, nBlockXSize ); + TIFFSetField( hTIFF, TIFFTAG_TILELENGTH, nBlockYSize ); + } + else + TIFFSetField( hTIFF, TIFFTAG_ROWSPERSTRIP, nBlockYSize ); + + TIFFSetField( hTIFF, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE ); + + if( nPhotometric == PHOTOMETRIC_YCBCR || nPhotometric == PHOTOMETRIC_ITULAB ) + { + TIFFSetField( hTIFF, TIFFTAG_YCBCRSUBSAMPLING, nHorSubsampling, nVerSubsampling); + /* TODO: also write YCbCrPositioning and YCbCrCoefficients tag identical to source IFD */ + } + /* TODO: add command-line parameter for selecting jpeg compression quality + * that gets ignored when compression isn't jpeg */ + +/* -------------------------------------------------------------------- */ +/* Write color table if one is present. */ +/* -------------------------------------------------------------------- */ + if( panRed != NULL ) + { + TIFFSetField( hTIFF, TIFFTAG_COLORMAP, panRed, panGreen, panBlue ); + } + +/* -------------------------------------------------------------------- */ +/* Write directory, and return byte offset. */ +/* -------------------------------------------------------------------- */ + if( TIFFWriteCheck( hTIFF, bTiled, "TIFFBuildOverviews" ) == 0 ) + return 0; + + TIFFWriteDirectory( hTIFF ); + TIFFSetDirectory( hTIFF, (tdir_t) (TIFFNumberOfDirectories(hTIFF)-1) ); + + nOffset = TIFFCurrentDirOffset( hTIFF ); + + TIFFSetSubDirectory( hTIFF, nBaseDirOffset ); + + return nOffset; +} + +/************************************************************************/ +/* TIFF_GetSourceSamples() */ +/************************************************************************/ + +static void +TIFF_GetSourceSamples( double * padfSamples, unsigned char *pabySrc, + int nPixelBytes, int nSampleFormat, + uint32 nXSize, uint32 nYSize, + int nPixelOffset, int nLineOffset ) +{ + uint32 iXOff, iYOff; + int iSample; + + iSample = 0; + + for( iYOff = 0; iYOff < nYSize; iYOff++ ) + { + for( iXOff = 0; iXOff < nXSize; iXOff++ ) + { + unsigned char *pabyData; + + pabyData = pabySrc + iYOff * nLineOffset + iXOff * nPixelOffset; + + if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 1 ) + { + padfSamples[iSample++] = *pabyData; + } + else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2 ) + { + padfSamples[iSample++] = ((uint16 *) pabyData)[0]; + } + else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4 ) + { + padfSamples[iSample++] = ((uint32 *) pabyData)[0]; + } + else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2 ) + { + padfSamples[iSample++] = ((int16 *) pabyData)[0]; + } + else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32 ) + { + padfSamples[iSample++] = ((int32 *) pabyData)[0]; + } + else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4 ) + { + padfSamples[iSample++] = ((float *) pabyData)[0]; + } + else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 8 ) + { + padfSamples[iSample++] = ((double *) pabyData)[0]; + } + } + } +} + +/************************************************************************/ +/* TIFF_SetSample() */ +/************************************************************************/ + +static void +TIFF_SetSample( unsigned char * pabyData, int nPixelBytes, int nSampleFormat, + double dfValue ) + +{ + if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 1 ) + { + *pabyData = (unsigned char) MAX(0,MIN(255,dfValue)); + } + else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2 ) + { + *((uint16 *)pabyData) = (uint16) MAX(0,MIN(65535,dfValue)); + } + else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4 ) + { + *((uint32 *)pabyData) = (uint32) dfValue; + } + else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2 ) + { + *((int16 *)pabyData) = (int16) MAX(-32768,MIN(32767,dfValue)); + } + else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32 ) + { + *((int32 *)pabyData) = (int32) dfValue; + } + else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4 ) + { + *((float *)pabyData) = (float) dfValue; + } + else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 8 ) + { + *((double *)pabyData) = dfValue; + } +} + +/************************************************************************/ +/* TIFF_DownSample() */ +/* */ +/* Down sample a tile of full res data into a window of a tile */ +/* of downsampled data. */ +/************************************************************************/ + +static +void TIFF_DownSample( unsigned char *pabySrcTile, + uint32 nBlockXSize, uint32 nBlockYSize, + int nPixelSkewBits, int nBitsPerPixel, + unsigned char * pabyOTile, + uint32 nOBlockXSize, uint32 nOBlockYSize, + uint32 nTXOff, uint32 nTYOff, int nOMult, + int nSampleFormat, const char * pszResampling ) + +{ + uint32 i, j; + int k, nPixelBytes = (nBitsPerPixel) / 8; + int nPixelGroupBytes = (nBitsPerPixel+nPixelSkewBits)/8; + unsigned char *pabySrc, *pabyDst; + double *padfSamples; + + assert( nBitsPerPixel >= 8 ); + + padfSamples = (double *) malloc(sizeof(double) * nOMult * nOMult); + +/* ==================================================================== */ +/* Loop over scanline chunks to process, establishing where the */ +/* data is going. */ +/* ==================================================================== */ + for( j = 0; j*nOMult < nBlockYSize; j++ ) + { + if( j + nTYOff >= nOBlockYSize ) + break; + + pabyDst = pabyOTile + ((j+nTYOff)*nOBlockXSize + nTXOff) + * nPixelBytes * nPixelGroupBytes; + +/* -------------------------------------------------------------------- */ +/* Handler nearest resampling ... we don't even care about the */ +/* data type, we just do a bytewise copy. */ +/* -------------------------------------------------------------------- */ + if( strncmp(pszResampling,"nearest",4) == 0 + || strncmp(pszResampling,"NEAR",4) == 0 ) + { + pabySrc = pabySrcTile + j*nOMult*nBlockXSize * nPixelGroupBytes; + + for( i = 0; i*nOMult < nBlockXSize; i++ ) + { + if( i + nTXOff >= nOBlockXSize ) + break; + + /* + * For now use simple subsampling, from the top left corner + * of the source block of pixels. + */ + + for( k = 0; k < nPixelBytes; k++ ) + pabyDst[k] = pabySrc[k]; + + pabyDst += nPixelBytes * nPixelGroupBytes; + pabySrc += nOMult * nPixelGroupBytes; + } + } + +/* -------------------------------------------------------------------- */ +/* Handle the case of averaging. For this we also have to */ +/* handle each sample format we are concerned with. */ +/* -------------------------------------------------------------------- */ + else if( strncmp(pszResampling,"averag",6) == 0 + || strncmp(pszResampling,"AVERAG",6) == 0 ) + { + pabySrc = pabySrcTile + j*nOMult*nBlockXSize * nPixelGroupBytes; + + for( i = 0; i*nOMult < nBlockXSize; i++ ) + { + double dfTotal; + uint32 nXSize, nYSize, iSample; + + if( i + nTXOff >= nOBlockXSize ) + break; + + nXSize = MIN((uint32)nOMult,nBlockXSize-i); + nYSize = MIN((uint32)nOMult,nBlockYSize-j); + + TIFF_GetSourceSamples( padfSamples, pabySrc, + nPixelBytes, nSampleFormat, + nXSize, nYSize, + nPixelGroupBytes, + nPixelGroupBytes * nBlockXSize ); + + dfTotal = 0; + for( iSample = 0; iSample < nXSize*nYSize; iSample++ ) + { + dfTotal += padfSamples[iSample]; + } + + TIFF_SetSample( pabyDst, nPixelBytes, nSampleFormat, + dfTotal / (nXSize*nYSize) ); + + pabySrc += nOMult * nPixelGroupBytes; + pabyDst += nPixelBytes; + } + } + } + + free( padfSamples ); +} + +/************************************************************************/ +/* TIFF_DownSample_Subsampled() */ +/************************************************************************/ +static +void TIFF_DownSample_Subsampled( unsigned char *pabySrcTile, int nSample, + uint32 nBlockXSize, uint32 nBlockYSize, + unsigned char * pabyOTile, + uint32 nOBlockXSize, uint32 nOBlockYSize, + uint32 nTXOff, uint32 nTYOff, int nOMult, + const char *pszResampling, + int nHorSubsampling, int nVerSubsampling ) +{ + /* TODO: test with variety of subsampling values, and incovinient tile/strip sizes */ + int nSampleBlockSize; + int nSourceSampleRowSize; + int nDestSampleRowSize; + uint32 nSourceX, nSourceY; + uint32 nSourceXSec, nSourceYSec; + uint32 nSourceXSecEnd, nSourceYSecEnd; + uint32 nDestX, nDestY; + int nSampleOffsetInSampleBlock; + unsigned int nCummulator; + unsigned int nCummulatorCount; + + nSampleBlockSize = nHorSubsampling * nVerSubsampling + 2; + nSourceSampleRowSize = + ( ( nBlockXSize + nHorSubsampling - 1 ) / nHorSubsampling ) * nSampleBlockSize; + nDestSampleRowSize = + ( ( nOBlockXSize + nHorSubsampling - 1 ) / nHorSubsampling ) * nSampleBlockSize; + + if( strncmp(pszResampling,"nearest",4) == 0 + || strncmp(pszResampling,"NEAR",4) == 0 ) + { + if( nSample == 0 ) + { + for( nSourceY = 0, nDestY = nTYOff; + nSourceY < nBlockYSize; + nSourceY += nOMult, nDestY ++) + { + if( nDestY >= nOBlockYSize ) + break; + + for( nSourceX = 0, nDestX = nTXOff; + nSourceX < nBlockXSize; + nSourceX += nOMult, nDestX ++) + { + if( nDestX >= nOBlockXSize ) + break; + + * ( pabyOTile + ( nDestY / nVerSubsampling ) * nDestSampleRowSize + + ( nDestY % nVerSubsampling ) * nHorSubsampling + + ( nDestX / nHorSubsampling ) * nSampleBlockSize + + ( nDestX % nHorSubsampling ) ) = + * ( pabySrcTile + ( nSourceY / nVerSubsampling ) * nSourceSampleRowSize + + ( nSourceY % nVerSubsampling ) * nHorSubsampling + + ( nSourceX / nHorSubsampling ) * nSampleBlockSize + + ( nSourceX % nHorSubsampling ) ); + } + } + } + else + { + nSampleOffsetInSampleBlock = nHorSubsampling * nVerSubsampling + nSample - 1; + for( nSourceY = 0, nDestY = ( nTYOff / nVerSubsampling ); + nSourceY < ( nBlockYSize / nVerSubsampling ); + nSourceY += nOMult, nDestY ++) + { + if( nDestY*nVerSubsampling >= nOBlockYSize ) + break; + + for( nSourceX = 0, nDestX = ( nTXOff / nHorSubsampling ); + nSourceX < ( nBlockXSize / nHorSubsampling ); + nSourceX += nOMult, nDestX ++) + { + if( nDestX*nHorSubsampling >= nOBlockXSize ) + break; + + * ( pabyOTile + nDestY * nDestSampleRowSize + + nDestX * nSampleBlockSize + + nSampleOffsetInSampleBlock ) = + * ( pabySrcTile + nSourceY * nSourceSampleRowSize + + nSourceX * nSampleBlockSize + + nSampleOffsetInSampleBlock ); + } + } + } + } + else if( strncmp(pszResampling,"averag",6) == 0 + || strncmp(pszResampling,"AVERAG",6) == 0 ) + { + if( nSample == 0 ) + { + for( nSourceY = 0, nDestY = nTYOff; nSourceY < nBlockYSize; nSourceY += nOMult, nDestY ++) + { + if( nDestY >= nOBlockYSize ) + break; + + for( nSourceX = 0, nDestX = nTXOff; nSourceX < nBlockXSize; nSourceX += nOMult, nDestX ++) + { + if( nDestX >= nOBlockXSize ) + break; + + nSourceXSecEnd = nSourceX + nOMult; + if( nSourceXSecEnd > nBlockXSize ) + nSourceXSecEnd = nBlockXSize; + nSourceYSecEnd = nSourceY + nOMult; + if( nSourceYSecEnd > nBlockYSize ) + nSourceYSecEnd = nBlockYSize; + nCummulator = 0; + for( nSourceYSec = nSourceY; nSourceYSec < nSourceYSecEnd; nSourceYSec ++) + { + for( nSourceXSec = nSourceX; nSourceXSec < nSourceXSecEnd; nSourceXSec ++) + { + nCummulator += * ( pabySrcTile + ( nSourceYSec / nVerSubsampling ) * nSourceSampleRowSize + + ( nSourceYSec % nVerSubsampling ) * nHorSubsampling + + ( nSourceXSec / nHorSubsampling ) * nSampleBlockSize + + ( nSourceXSec % nHorSubsampling ) ); + } + } + nCummulatorCount = ( nSourceXSecEnd - nSourceX ) * ( nSourceYSecEnd - nSourceY ); + * ( pabyOTile + ( nDestY / nVerSubsampling ) * nDestSampleRowSize + + ( nDestY % nVerSubsampling ) * nHorSubsampling + + ( nDestX / nHorSubsampling ) * nSampleBlockSize + + ( nDestX % nHorSubsampling ) ) = + ( ( nCummulator + ( nCummulatorCount >> 1 ) ) / nCummulatorCount ); + } + } + } + else + { + nSampleOffsetInSampleBlock = nHorSubsampling * nVerSubsampling + nSample - 1; + for( nSourceY = 0, nDestY = ( nTYOff / nVerSubsampling ); nSourceY < ( nBlockYSize / nVerSubsampling ); + nSourceY += nOMult, nDestY ++) + { + if( nDestY*nVerSubsampling >= nOBlockYSize ) + break; + + for( nSourceX = 0, nDestX = ( nTXOff / nHorSubsampling ); nSourceX < ( nBlockXSize / nHorSubsampling ); + nSourceX += nOMult, nDestX ++) + { + if( nDestX*nHorSubsampling >= nOBlockXSize ) + break; + + nSourceXSecEnd = nSourceX + nOMult; + if( nSourceXSecEnd > ( nBlockXSize / nHorSubsampling ) ) + nSourceXSecEnd = ( nBlockXSize / nHorSubsampling ); + nSourceYSecEnd = nSourceY + nOMult; + if( nSourceYSecEnd > ( nBlockYSize / nVerSubsampling ) ) + nSourceYSecEnd = ( nBlockYSize / nVerSubsampling ); + nCummulator = 0; + for( nSourceYSec = nSourceY; nSourceYSec < nSourceYSecEnd; nSourceYSec ++) + { + for( nSourceXSec = nSourceX; nSourceXSec < nSourceXSecEnd; nSourceXSec ++) + { + nCummulator += * ( pabySrcTile + nSourceYSec * nSourceSampleRowSize + + nSourceXSec * nSampleBlockSize + + nSampleOffsetInSampleBlock ); + } + } + nCummulatorCount = ( nSourceXSecEnd - nSourceX ) * ( nSourceYSecEnd - nSourceY ); + * ( pabyOTile + nDestY * nDestSampleRowSize + + nDestX * nSampleBlockSize + + nSampleOffsetInSampleBlock ) = + ( ( nCummulator + ( nCummulatorCount >> 1 ) ) / nCummulatorCount ); + } + } + } + } +} + +/************************************************************************/ +/* TIFF_ProcessFullResBlock() */ +/* */ +/* Process one block of full res data, downsampling into each */ +/* of the overviews. */ +/************************************************************************/ + +void TIFF_ProcessFullResBlock( TIFF *hTIFF, int nPlanarConfig, + int bSubsampled, + int nHorSubsampling, int nVerSubsampling, + int nOverviews, int * panOvList, + int nBitsPerPixel, + int nSamples, TIFFOvrCache ** papoRawBIs, + uint32 nSXOff, uint32 nSYOff, + unsigned char *pabySrcTile, + uint32 nBlockXSize, uint32 nBlockYSize, + int nSampleFormat, const char * pszResampling ) + +{ + int iOverview, iSample; + + for( iSample = 0; iSample < nSamples; iSample++ ) + { + /* + * We have to read a tile/strip for each sample for + * PLANARCONFIG_SEPARATE. Otherwise, we just read all the samples + * at once when handling the first sample. + */ + if( nPlanarConfig == PLANARCONFIG_SEPARATE || iSample == 0 ) + { + if( TIFFIsTiled(hTIFF) ) + { + TIFFReadEncodedTile( hTIFF, + TIFFComputeTile(hTIFF, nSXOff, nSYOff, + 0, (tsample_t)iSample ), + pabySrcTile, + TIFFTileSize(hTIFF)); + } + else + { + TIFFReadEncodedStrip( hTIFF, + TIFFComputeStrip(hTIFF, nSYOff, + (tsample_t) iSample), + pabySrcTile, + TIFFStripSize(hTIFF) ); + } + } + + /* + * Loop over destination overview layers + */ + for( iOverview = 0; iOverview < nOverviews; iOverview++ ) + { + TIFFOvrCache *poRBI = papoRawBIs[iOverview]; + unsigned char *pabyOTile; + uint32 nTXOff, nTYOff, nOXOff, nOYOff, nOMult; + uint32 nOBlockXSize = poRBI->nBlockXSize; + uint32 nOBlockYSize = poRBI->nBlockYSize; + int nSkewBits, nSampleByteOffset; + + /* + * Fetch the destination overview tile + */ + nOMult = panOvList[iOverview]; + nOXOff = (nSXOff/nOMult) / nOBlockXSize; + nOYOff = (nSYOff/nOMult) / nOBlockYSize; + + if( bSubsampled ) + { + pabyOTile = TIFFGetOvrBlock_Subsampled( poRBI, nOXOff, nOYOff ); + + /* + * Establish the offset into this tile at which we should + * start placing data. + */ + nTXOff = (nSXOff - nOXOff*nOMult*nOBlockXSize) / nOMult; + nTYOff = (nSYOff - nOYOff*nOMult*nOBlockYSize) / nOMult; + + +#ifdef DBMALLOC + malloc_chain_check( 1 ); +#endif + TIFF_DownSample_Subsampled( pabySrcTile, iSample, + nBlockXSize, nBlockYSize, + pabyOTile, + poRBI->nBlockXSize, poRBI->nBlockYSize, + nTXOff, nTYOff, + nOMult, pszResampling, + nHorSubsampling, nVerSubsampling ); +#ifdef DBMALLOC + malloc_chain_check( 1 ); +#endif + + } + else + { + + pabyOTile = TIFFGetOvrBlock( poRBI, nOXOff, nOYOff, iSample ); + + /* + * Establish the offset into this tile at which we should + * start placing data. + */ + nTXOff = (nSXOff - nOXOff*nOMult*nOBlockXSize) / nOMult; + nTYOff = (nSYOff - nOYOff*nOMult*nOBlockYSize) / nOMult; + + /* + * Figure out the skew (extra space between ``our samples'') and + * the byte offset to the first sample. + */ + assert( (nBitsPerPixel % 8) == 0 ); + if( nPlanarConfig == PLANARCONFIG_SEPARATE ) + { + nSkewBits = 0; + nSampleByteOffset = 0; + } + else + { + nSkewBits = nBitsPerPixel * (nSamples-1); + nSampleByteOffset = (nBitsPerPixel/8) * iSample; + } + + /* + * Perform the downsampling. + */ +#ifdef DBMALLOC + malloc_chain_check( 1 ); +#endif + TIFF_DownSample( pabySrcTile + nSampleByteOffset, + nBlockXSize, nBlockYSize, + nSkewBits, nBitsPerPixel, pabyOTile, + poRBI->nBlockXSize, poRBI->nBlockYSize, + nTXOff, nTYOff, + nOMult, nSampleFormat, pszResampling ); +#ifdef DBMALLOC + malloc_chain_check( 1 ); +#endif + } + } + } +} + +/************************************************************************/ +/* TIFF_BuildOverviews() */ +/* */ +/* Build the requested list of overviews. Overviews are */ +/* maintained in a bunch of temporary files and then these are */ +/* written back to the TIFF file. Only one pass through the */ +/* source TIFF file is made for any number of output */ +/* overviews. */ +/************************************************************************/ + +void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList, + int bUseSubIFDs, const char *pszResampleMethod, + int (*pfnProgress)( double, void * ), + void * pProgressData ) + +{ + TIFFOvrCache **papoRawBIs; + uint32 nXSize, nYSize, nBlockXSize, nBlockYSize; + uint16 nBitsPerPixel, nPhotometric, nCompressFlag, nSamples, + nPlanarConfig, nSampleFormat; + int bSubsampled; + uint16 nHorSubsampling, nVerSubsampling; + int bTiled, nSXOff, nSYOff, i; + unsigned char *pabySrcTile; + uint16 *panRedMap, *panGreenMap, *panBlueMap; + TIFFErrorHandler pfnWarning; + + (void) pfnProgress; + (void) pProgressData; + +/* -------------------------------------------------------------------- */ +/* Get the base raster size. */ +/* -------------------------------------------------------------------- */ + TIFFGetField( hTIFF, TIFFTAG_IMAGEWIDTH, &nXSize ); + TIFFGetField( hTIFF, TIFFTAG_IMAGELENGTH, &nYSize ); + + TIFFGetField( hTIFF, TIFFTAG_BITSPERSAMPLE, &nBitsPerPixel ); + /* TODO: nBitsPerPixel seems misnomer and may need renaming to nBitsPerSample */ + TIFFGetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, &nSamples ); + TIFFGetFieldDefaulted( hTIFF, TIFFTAG_PLANARCONFIG, &nPlanarConfig ); + + TIFFGetFieldDefaulted( hTIFF, TIFFTAG_PHOTOMETRIC, &nPhotometric ); + TIFFGetFieldDefaulted( hTIFF, TIFFTAG_COMPRESSION, &nCompressFlag ); + TIFFGetFieldDefaulted( hTIFF, TIFFTAG_SAMPLEFORMAT, &nSampleFormat ); + + if( nPhotometric == PHOTOMETRIC_YCBCR || nPhotometric == PHOTOMETRIC_ITULAB ) + { + if( nBitsPerPixel != 8 || nSamples != 3 || nPlanarConfig != PLANARCONFIG_CONTIG || + nSampleFormat != SAMPLEFORMAT_UINT) + { + /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ + TIFFErrorExt( TIFFClientdata(hTIFF), "TIFFBuildOverviews", + "File `%s' has an unsupported subsampling configuration.\n", + TIFFFileName(hTIFF) ); + /* If you need support for this particular flavor, please contact either + * Frank Warmerdam warmerdam@pobox.com + * Joris Van Damme info@awaresystems.be + */ + return; + } + bSubsampled = 1; + TIFFGetField( hTIFF, TIFFTAG_YCBCRSUBSAMPLING, &nHorSubsampling, &nVerSubsampling ); + /* TODO: find out if maybe TIFFGetFieldDefaulted is better choice for YCbCrSubsampling tag */ + } + else + { + if( nBitsPerPixel < 8 ) + { + /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ + TIFFErrorExt( TIFFClientdata(hTIFF), "TIFFBuildOverviews", + "File `%s' has samples of %d bits per sample. Sample\n" + "sizes of less than 8 bits per sample are not supported.\n", + TIFFFileName(hTIFF), nBitsPerPixel ); + return; + } + bSubsampled = 0; + nHorSubsampling = 1; + nVerSubsampling = 1; + } + +/* -------------------------------------------------------------------- */ +/* Turn off warnings to avoid alot of repeated warnings while */ +/* rereading directories. */ +/* -------------------------------------------------------------------- */ + pfnWarning = TIFFSetWarningHandler( NULL ); + +/* -------------------------------------------------------------------- */ +/* Get the base raster block size. */ +/* -------------------------------------------------------------------- */ + if( TIFFGetField( hTIFF, TIFFTAG_ROWSPERSTRIP, &(nBlockYSize) ) ) + { + nBlockXSize = nXSize; + bTiled = FALSE; + } + else + { + TIFFGetField( hTIFF, TIFFTAG_TILEWIDTH, &nBlockXSize ); + TIFFGetField( hTIFF, TIFFTAG_TILELENGTH, &nBlockYSize ); + bTiled = TRUE; + } + +/* -------------------------------------------------------------------- */ +/* Capture the pallette if there is one. */ +/* -------------------------------------------------------------------- */ + if( TIFFGetField( hTIFF, TIFFTAG_COLORMAP, + &panRedMap, &panGreenMap, &panBlueMap ) ) + { + uint16 *panRed2, *panGreen2, *panBlue2; + int nColorCount = 1 << nBitsPerPixel; + + panRed2 = (uint16 *) _TIFFmalloc(2*nColorCount); + panGreen2 = (uint16 *) _TIFFmalloc(2*nColorCount); + panBlue2 = (uint16 *) _TIFFmalloc(2*nColorCount); + + memcpy( panRed2, panRedMap, 2 * nColorCount ); + memcpy( panGreen2, panGreenMap, 2 * nColorCount ); + memcpy( panBlue2, panBlueMap, 2 * nColorCount ); + + panRedMap = panRed2; + panGreenMap = panGreen2; + panBlueMap = panBlue2; + } + else + { + panRedMap = panGreenMap = panBlueMap = NULL; + } + +/* -------------------------------------------------------------------- */ +/* Initialize overviews. */ +/* -------------------------------------------------------------------- */ + papoRawBIs = (TIFFOvrCache **) _TIFFmalloc(nOverviews*sizeof(void*)); + + for( i = 0; i < nOverviews; i++ ) + { + uint32 nOXSize, nOYSize, nOBlockXSize, nOBlockYSize; + toff_t nDirOffset; + + nOXSize = (nXSize + panOvList[i] - 1) / panOvList[i]; + nOYSize = (nYSize + panOvList[i] - 1) / panOvList[i]; + + nOBlockXSize = MIN(nBlockXSize,nOXSize); + nOBlockYSize = MIN(nBlockYSize,nOYSize); + + if( bTiled ) + { + if( (nOBlockXSize % 16) != 0 ) + nOBlockXSize = nOBlockXSize + 16 - (nOBlockXSize % 16); + + if( (nOBlockYSize % 16) != 0 ) + nOBlockYSize = nOBlockYSize + 16 - (nOBlockYSize % 16); + } + + nDirOffset = TIFF_WriteOverview( hTIFF, nOXSize, nOYSize, + nBitsPerPixel, nPlanarConfig, + nSamples, nOBlockXSize, nOBlockYSize, + bTiled, nCompressFlag, nPhotometric, + nSampleFormat, + panRedMap, panGreenMap, panBlueMap, + bUseSubIFDs, + nHorSubsampling, nVerSubsampling ); + + papoRawBIs[i] = TIFFCreateOvrCache( hTIFF, nDirOffset ); + } + + if( panRedMap != NULL ) + { + _TIFFfree( panRedMap ); + _TIFFfree( panGreenMap ); + _TIFFfree( panBlueMap ); + } + +/* -------------------------------------------------------------------- */ +/* Allocate a buffer to hold a source block. */ +/* -------------------------------------------------------------------- */ + if( bTiled ) + pabySrcTile = (unsigned char *) _TIFFmalloc(TIFFTileSize(hTIFF)); + else + pabySrcTile = (unsigned char *) _TIFFmalloc(TIFFStripSize(hTIFF)); + +/* -------------------------------------------------------------------- */ +/* Loop over the source raster, applying data to the */ +/* destination raster. */ +/* -------------------------------------------------------------------- */ + for( nSYOff = 0; nSYOff < (int) nYSize; nSYOff += nBlockYSize ) + { + for( nSXOff = 0; nSXOff < (int) nXSize; nSXOff += nBlockXSize ) + { + /* + * Read and resample into the various overview images. + */ + + TIFF_ProcessFullResBlock( hTIFF, nPlanarConfig, + bSubsampled,nHorSubsampling,nVerSubsampling, + nOverviews, panOvList, + nBitsPerPixel, nSamples, papoRawBIs, + nSXOff, nSYOff, pabySrcTile, + nBlockXSize, nBlockYSize, + nSampleFormat, pszResampleMethod ); + } + } + + _TIFFfree( pabySrcTile ); + +/* -------------------------------------------------------------------- */ +/* Cleanup the rawblockedimage files. */ +/* -------------------------------------------------------------------- */ + for( i = 0; i < nOverviews; i++ ) + { + TIFFDestroyOvrCache( papoRawBIs[i] ); + } + + if( papoRawBIs != NULL ) + _TIFFfree( papoRawBIs ); + + TIFFSetWarningHandler( pfnWarning ); +} + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.c new file mode 100644 index 0000000..e19483b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.c @@ -0,0 +1,341 @@ +/****************************************************************************** + * $Id: tif_ovrcache.c,v 1.9 2010-06-08 18:55:15 bfriesen Exp $ + * + * Project: TIFF Overview Builder + * Purpose: Library functions to maintain two rows of tiles or two strips + * of data for output overviews as an output cache. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2000, Frank Warmerdam + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************** + */ + +#include "tiffiop.h" +#include "tif_ovrcache.h" +#include + +/************************************************************************/ +/* TIFFCreateOvrCache() */ +/* */ +/* Create an overview cache to hold two rows of blocks from an */ +/* existing TIFF directory. */ +/************************************************************************/ + +TIFFOvrCache *TIFFCreateOvrCache( TIFF *hTIFF, toff_t nDirOffset ) + +{ + TIFFOvrCache *psCache; + toff_t nBaseDirOffset; + + psCache = (TIFFOvrCache *) _TIFFmalloc(sizeof(TIFFOvrCache)); + psCache->nDirOffset = nDirOffset; + psCache->hTIFF = hTIFF; + +/* -------------------------------------------------------------------- */ +/* Get definition of this raster from the TIFF file itself. */ +/* -------------------------------------------------------------------- */ + nBaseDirOffset = TIFFCurrentDirOffset( psCache->hTIFF ); + TIFFSetSubDirectory( hTIFF, nDirOffset ); + + TIFFGetField( hTIFF, TIFFTAG_IMAGEWIDTH, &(psCache->nXSize) ); + TIFFGetField( hTIFF, TIFFTAG_IMAGELENGTH, &(psCache->nYSize) ); + + TIFFGetField( hTIFF, TIFFTAG_BITSPERSAMPLE, &(psCache->nBitsPerPixel) ); + TIFFGetField( hTIFF, TIFFTAG_SAMPLESPERPIXEL, &(psCache->nSamples) ); + TIFFGetField( hTIFF, TIFFTAG_PLANARCONFIG, &(psCache->nPlanarConfig) ); + + if( !TIFFIsTiled( hTIFF ) ) + { + TIFFGetField( hTIFF, TIFFTAG_ROWSPERSTRIP, &(psCache->nBlockYSize) ); + psCache->nBlockXSize = psCache->nXSize; + psCache->nBytesPerBlock = TIFFStripSize(hTIFF); + psCache->bTiled = FALSE; + } + else + { + TIFFGetField( hTIFF, TIFFTAG_TILEWIDTH, &(psCache->nBlockXSize) ); + TIFFGetField( hTIFF, TIFFTAG_TILELENGTH, &(psCache->nBlockYSize) ); + psCache->nBytesPerBlock = TIFFTileSize(hTIFF); + psCache->bTiled = TRUE; + } + +/* -------------------------------------------------------------------- */ +/* Compute some values from this. */ +/* -------------------------------------------------------------------- */ + + psCache->nBlocksPerRow = (psCache->nXSize + psCache->nBlockXSize - 1) + / psCache->nBlockXSize; + psCache->nBlocksPerColumn = (psCache->nYSize + psCache->nBlockYSize - 1) + / psCache->nBlockYSize; + + if (psCache->nPlanarConfig == PLANARCONFIG_SEPARATE) + psCache->nBytesPerRow = psCache->nBytesPerBlock + * psCache->nBlocksPerRow * psCache->nSamples; + else + psCache->nBytesPerRow = + psCache->nBytesPerBlock * psCache->nBlocksPerRow; + + +/* -------------------------------------------------------------------- */ +/* Allocate and initialize the data buffers. */ +/* -------------------------------------------------------------------- */ + + psCache->pabyRow1Blocks = + (unsigned char *) _TIFFmalloc(psCache->nBytesPerRow); + psCache->pabyRow2Blocks = + (unsigned char *) _TIFFmalloc(psCache->nBytesPerRow); + + if( psCache->pabyRow1Blocks == NULL + || psCache->pabyRow2Blocks == NULL ) + { + TIFFErrorExt( hTIFF->tif_clientdata, hTIFF->tif_name, + "Can't allocate memory for overview cache." ); + /* TODO: use of TIFFError is inconsistent with use of fprintf in addtiffo.c, sort out */ + return NULL; + } + + _TIFFmemset( psCache->pabyRow1Blocks, 0, psCache->nBytesPerRow ); + _TIFFmemset( psCache->pabyRow2Blocks, 0, psCache->nBytesPerRow ); + + psCache->nBlockOffset = 0; + + TIFFSetSubDirectory( psCache->hTIFF, nBaseDirOffset ); + + return psCache; +} + +/************************************************************************/ +/* TIFFWriteOvrRow() */ +/* */ +/* Write one entire row of blocks (row 1) to the tiff file, and */ +/* then rotate the block buffers, essentially moving things */ +/* down by one block. */ +/************************************************************************/ + +static void TIFFWriteOvrRow( TIFFOvrCache * psCache ) + +{ + int nRet, iTileX, iTileY = psCache->nBlockOffset; + unsigned char *pabyData; + toff_t nBaseDirOffset; + uint32 RowsInStrip; + +/* -------------------------------------------------------------------- */ +/* If the output cache is multi-byte per sample, and the file */ +/* being written to is of a different byte order than the current */ +/* platform, we will need to byte swap the data. */ +/* -------------------------------------------------------------------- */ + if( TIFFIsByteSwapped(psCache->hTIFF) ) + { + if( psCache->nBitsPerPixel == 16 ) + TIFFSwabArrayOfShort( (uint16 *) psCache->pabyRow1Blocks, + (psCache->nBytesPerBlock * psCache->nSamples) / 2 ); + + else if( psCache->nBitsPerPixel == 32 ) + TIFFSwabArrayOfLong( (uint32 *) psCache->pabyRow1Blocks, + (psCache->nBytesPerBlock * psCache->nSamples) / 4 ); + + else if( psCache->nBitsPerPixel == 64 ) + TIFFSwabArrayOfDouble( (double *) psCache->pabyRow1Blocks, + (psCache->nBytesPerBlock * psCache->nSamples) / 8 ); + } + +/* -------------------------------------------------------------------- */ +/* Record original directory position, so we can restore it at */ +/* end. */ +/* -------------------------------------------------------------------- */ + nBaseDirOffset = TIFFCurrentDirOffset( psCache->hTIFF ); + nRet = TIFFSetSubDirectory( psCache->hTIFF, psCache->nDirOffset ); + assert( nRet == 1 ); + +/* -------------------------------------------------------------------- */ +/* Write blocks to TIFF file. */ +/* -------------------------------------------------------------------- */ + for( iTileX = 0; iTileX < psCache->nBlocksPerRow; iTileX++ ) + { + int nTileID; + + if (psCache->nPlanarConfig == PLANARCONFIG_SEPARATE) + { + int iSample; + + for( iSample = 0; iSample < psCache->nSamples; iSample++ ) + { + pabyData = TIFFGetOvrBlock( psCache, iTileX, iTileY, iSample ); + + if( psCache->bTiled ) + { + nTileID = TIFFComputeTile( psCache->hTIFF, + iTileX * psCache->nBlockXSize, + iTileY * psCache->nBlockYSize, + 0, (tsample_t) iSample ); + TIFFWriteEncodedTile( psCache->hTIFF, nTileID, + pabyData, + TIFFTileSize(psCache->hTIFF) ); + } + else + { + nTileID = TIFFComputeStrip( psCache->hTIFF, + iTileY * psCache->nBlockYSize, + (tsample_t) iSample ); + RowsInStrip=psCache->nBlockYSize; + if ((iTileY+1)*psCache->nBlockYSize>psCache->nYSize) + RowsInStrip=psCache->nYSize-iTileY*psCache->nBlockYSize; + TIFFWriteEncodedStrip( psCache->hTIFF, nTileID, + pabyData, + TIFFVStripSize(psCache->hTIFF,RowsInStrip) ); + } + } + + } + else + { + pabyData = TIFFGetOvrBlock( psCache, iTileX, iTileY, 0 ); + + if( psCache->bTiled ) + { + nTileID = TIFFComputeTile( psCache->hTIFF, + iTileX * psCache->nBlockXSize, + iTileY * psCache->nBlockYSize, + 0, 0 ); + TIFFWriteEncodedTile( psCache->hTIFF, nTileID, + pabyData, + TIFFTileSize(psCache->hTIFF) ); + } + else + { + nTileID = TIFFComputeStrip( psCache->hTIFF, + iTileY * psCache->nBlockYSize, + 0 ); + RowsInStrip=psCache->nBlockYSize; + if ((iTileY+1)*psCache->nBlockYSize>psCache->nYSize) + RowsInStrip=psCache->nYSize-iTileY*psCache->nBlockYSize; + TIFFWriteEncodedStrip( psCache->hTIFF, nTileID, + pabyData, + TIFFVStripSize(psCache->hTIFF,RowsInStrip) ); + } + } + } + /* TODO: add checks on error status return of TIFFWriteEncodedTile and TIFFWriteEncodedStrip */ + +/* -------------------------------------------------------------------- */ +/* Rotate buffers. */ +/* -------------------------------------------------------------------- */ + pabyData = psCache->pabyRow1Blocks; + psCache->pabyRow1Blocks = psCache->pabyRow2Blocks; + psCache->pabyRow2Blocks = pabyData; + + _TIFFmemset( pabyData, 0, psCache->nBytesPerRow ); + + psCache->nBlockOffset++; + +/* -------------------------------------------------------------------- */ +/* Restore access to original directory. */ +/* -------------------------------------------------------------------- */ + TIFFFlush( psCache->hTIFF ); + /* TODO: add checks on error status return of TIFFFlush */ + TIFFSetSubDirectory( psCache->hTIFF, nBaseDirOffset ); + /* TODO: add checks on error status return of TIFFSetSubDirectory */ +} + +/************************************************************************/ +/* TIFFGetOvrBlock() */ +/************************************************************************/ + +/* TODO: make TIFF_Downsample handle iSample offset, so that we can + * do with a single TIFFGetOvrBlock and no longer need TIFFGetOvrBlock_Subsampled */ +unsigned char *TIFFGetOvrBlock( TIFFOvrCache *psCache, int iTileX, int iTileY, + int iSample ) + +{ + int nRowOffset; + + if( iTileY > psCache->nBlockOffset + 1 ) + TIFFWriteOvrRow( psCache ); + + assert( iTileX >= 0 && iTileX < psCache->nBlocksPerRow ); + assert( iTileY >= 0 && iTileY < psCache->nBlocksPerColumn ); + assert( iTileY >= psCache->nBlockOffset + && iTileY < psCache->nBlockOffset+2 ); + assert( iSample >= 0 && iSample < psCache->nSamples ); + + if (psCache->nPlanarConfig == PLANARCONFIG_SEPARATE) + nRowOffset = ((iTileX * psCache->nSamples) + iSample) + * psCache->nBytesPerBlock; + else + nRowOffset = iTileX * psCache->nBytesPerBlock + + (psCache->nBitsPerPixel + 7) / 8 * iSample; + + if( iTileY == psCache->nBlockOffset ) + return psCache->pabyRow1Blocks + nRowOffset; + else + return psCache->pabyRow2Blocks + nRowOffset; +} + +/************************************************************************/ +/* TIFFGetOvrBlock_Subsampled() */ +/************************************************************************/ + +unsigned char *TIFFGetOvrBlock_Subsampled( TIFFOvrCache *psCache, + int iTileX, int iTileY ) + +{ + int nRowOffset; + + if( iTileY > psCache->nBlockOffset + 1 ) + TIFFWriteOvrRow( psCache ); + + assert( iTileX >= 0 && iTileX < psCache->nBlocksPerRow ); + assert( iTileY >= 0 && iTileY < psCache->nBlocksPerColumn ); + assert( iTileY >= psCache->nBlockOffset + && iTileY < psCache->nBlockOffset+2 ); + assert( psCache->nPlanarConfig != PLANARCONFIG_SEPARATE ); + + nRowOffset = iTileX * psCache->nBytesPerBlock; + + if( iTileY == psCache->nBlockOffset ) + return psCache->pabyRow1Blocks + nRowOffset; + else + return psCache->pabyRow2Blocks + nRowOffset; +} + +/************************************************************************/ +/* TIFFDestroyOvrCache() */ +/************************************************************************/ + +void TIFFDestroyOvrCache( TIFFOvrCache * psCache ) + +{ + while( psCache->nBlockOffset < psCache->nBlocksPerColumn ) + TIFFWriteOvrRow( psCache ); + + _TIFFfree( psCache->pabyRow1Blocks ); + _TIFFfree( psCache->pabyRow2Blocks ); + _TIFFfree( psCache ); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.h new file mode 100644 index 0000000..0ad1082 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/addtiffo/tif_ovrcache.h @@ -0,0 +1,103 @@ +/****************************************************************************** + * tif_ovrcache.h,v 1.3 2005/05/25 09:03:16 dron Exp + * + * Project: TIFF Overview Builder + * Purpose: Library functions to maintain two rows of tiles or two strips + * of data for output overviews as an output cache. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + * This code could potentially be used by other applications wanting to + * manage a once-through write cache. + * + ****************************************************************************** + * Copyright (c) 2000, Frank Warmerdam + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************** + */ + +#ifndef TIF_OVRCACHE_H_INCLUDED +#define TIF_OVRCACHE_H_INCLUDED + +#include "tiffio.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef struct +{ + uint32 nXSize; + uint32 nYSize; + + uint16 nBitsPerPixel; + uint16 nSamples; + uint16 nPlanarConfig; + uint32 nBlockXSize; + uint32 nBlockYSize; + toff_t nBytesPerBlock; + toff_t nBytesPerRow; + + int nBlocksPerRow; + int nBlocksPerColumn; + + int nBlockOffset; /* what block is the first in papabyBlocks? */ + unsigned char *pabyRow1Blocks; + unsigned char *pabyRow2Blocks; + + toff_t nDirOffset; + TIFF *hTIFF; + int bTiled; + +} TIFFOvrCache; + +TIFFOvrCache *TIFFCreateOvrCache( TIFF *hTIFF, toff_t nDirOffset ); +unsigned char *TIFFGetOvrBlock( TIFFOvrCache *psCache, int iTileX, int iTileY, + int iSample ); +unsigned char *TIFFGetOvrBlock_Subsampled( TIFFOvrCache *psCache, int iTileX, int iTileY ); +void TIFFDestroyOvrCache( TIFFOvrCache * ); + +void TIFFBuildOverviews( TIFF *, int, int *, int, const char *, + int (*)(double,void*), void * ); + +void TIFF_ProcessFullResBlock( TIFF *, int, int, int, int, int, int *, int, + int, TIFFOvrCache **, uint32, uint32, + unsigned char *, uint32, uint32, + int, const char * ); + +uint32 TIFF_WriteOverview( TIFF *, uint32, uint32, int, int, int, int, int, + int, int, int, int, unsigned short *, + unsigned short *, unsigned short *, int, + int, int); + + + +#if defined(__cplusplus) +} +#endif + +#endif /* ndef TIF_OVRCACHE_H_INCLUDED */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.am new file mode 100644 index 0000000..0787377 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.am @@ -0,0 +1,44 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +SUBDIRS = xtiff + +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +EXTRA_DIST = README + +noinst_PROGRAMS = tiff-bi tiff-grayscale tiff-palette tiff-rgb + +tiff_bi_SOURCES = tiff-bi.c +tiff_bi_LDADD = $(LIBTIFF) +tiff_grayscale_SOURCES = tiff-grayscale.c +tiff_grayscale_LDADD = $(LIBTIFF) +tiff_palette_SOURCES = tiff-palette.c +tiff_palette_LDADD = $(LIBTIFF) +tiff_rgb_SOURCES = tiff-rgb.c +tiff_rgb_LDADD = $(LIBTIFF) + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.in new file mode 100644 index 0000000..734ef1a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/Makefile.in @@ -0,0 +1,758 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = tiff-bi$(EXEEXT) tiff-grayscale$(EXEEXT) \ + tiff-palette$(EXEEXT) tiff-rgb$(EXEEXT) +subdir = contrib/dbs +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_tiff_bi_OBJECTS = tiff-bi.$(OBJEXT) +tiff_bi_OBJECTS = $(am_tiff_bi_OBJECTS) +tiff_bi_DEPENDENCIES = $(LIBTIFF) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_tiff_grayscale_OBJECTS = tiff-grayscale.$(OBJEXT) +tiff_grayscale_OBJECTS = $(am_tiff_grayscale_OBJECTS) +tiff_grayscale_DEPENDENCIES = $(LIBTIFF) +am_tiff_palette_OBJECTS = tiff-palette.$(OBJEXT) +tiff_palette_OBJECTS = $(am_tiff_palette_OBJECTS) +tiff_palette_DEPENDENCIES = $(LIBTIFF) +am_tiff_rgb_OBJECTS = tiff-rgb.$(OBJEXT) +tiff_rgb_OBJECTS = $(am_tiff_rgb_OBJECTS) +tiff_rgb_DEPENDENCIES = $(LIBTIFF) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(tiff_bi_SOURCES) $(tiff_grayscale_SOURCES) \ + $(tiff_palette_SOURCES) $(tiff_rgb_SOURCES) +DIST_SOURCES = $(tiff_bi_SOURCES) $(tiff_grayscale_SOURCES) \ + $(tiff_palette_SOURCES) $(tiff_rgb_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = xtiff +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +EXTRA_DIST = README +tiff_bi_SOURCES = tiff-bi.c +tiff_bi_LDADD = $(LIBTIFF) +tiff_grayscale_SOURCES = tiff-grayscale.c +tiff_grayscale_LDADD = $(LIBTIFF) +tiff_palette_SOURCES = tiff-palette.c +tiff_palette_LDADD = $(LIBTIFF) +tiff_rgb_SOURCES = tiff-rgb.c +tiff_rgb_LDADD = $(LIBTIFF) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/dbs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/dbs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +tiff-bi$(EXEEXT): $(tiff_bi_OBJECTS) $(tiff_bi_DEPENDENCIES) $(EXTRA_tiff_bi_DEPENDENCIES) + @rm -f tiff-bi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff_bi_OBJECTS) $(tiff_bi_LDADD) $(LIBS) +tiff-grayscale$(EXEEXT): $(tiff_grayscale_OBJECTS) $(tiff_grayscale_DEPENDENCIES) $(EXTRA_tiff_grayscale_DEPENDENCIES) + @rm -f tiff-grayscale$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff_grayscale_OBJECTS) $(tiff_grayscale_LDADD) $(LIBS) +tiff-palette$(EXEEXT): $(tiff_palette_OBJECTS) $(tiff_palette_DEPENDENCIES) $(EXTRA_tiff_palette_DEPENDENCIES) + @rm -f tiff-palette$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff_palette_OBJECTS) $(tiff_palette_LDADD) $(LIBS) +tiff-rgb$(EXEEXT): $(tiff_rgb_OBJECTS) $(tiff_rgb_DEPENDENCIES) $(EXTRA_tiff_rgb_DEPENDENCIES) + @rm -f tiff-rgb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff_rgb_OBJECTS) $(tiff_rgb_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-bi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-grayscale.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-palette.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff-rgb.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist cscopelist-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/README new file mode 100644 index 0000000..e05d0a9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/README @@ -0,0 +1,7 @@ +Wed May 9 09:11:35 PDT 1990 + +This directory contains programs from Dan Sears +(dbs@decwrl.dec.com). Contact him directly if +you have questions/problems. + + Sam diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-bi.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-bi.c new file mode 100644 index 0000000..33f05c7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-bi.c @@ -0,0 +1,91 @@ +/* $Id: tiff-bi.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * tiff-bi.c -- create a Class B (bilevel) TIFF file + * + * Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts. + * + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * 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 Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include +#include + +#include "tiffio.h" + +#define WIDTH 512 +#define HEIGHT WIDTH + +int main(int argc, char **argv) +{ + int i; + unsigned char * scan_line; + TIFF * tif; + + if (argc != 2) { + fprintf(stderr, "Usage: %s tiff-image\n", argv[0]); + return 0; + } + + if ((tif = TIFFOpen(argv[1], "w")) == NULL) { + fprintf(stderr, "can't open %s as a TIFF file\n", argv[1]); + return 0; + } + + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, WIDTH); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, HEIGHT); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 1); + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_NONE); + + scan_line = (unsigned char *) malloc(WIDTH / 8); + + for (i = 0; i < (WIDTH / 8) / 2; i++) + scan_line[i] = 0; + + for (i = (WIDTH / 8) / 2; i < (WIDTH / 8); i++) + scan_line[i] = 255; + + for (i = 0; i < HEIGHT / 2; i++) + TIFFWriteScanline(tif, scan_line, i, 0); + + for (i = 0; i < (WIDTH / 8) / 2; i++) + scan_line[i] = 255; + + for (i = (WIDTH / 8) / 2; i < (WIDTH / 8); i++) + scan_line[i] = 0; + + for (i = HEIGHT / 2; i < HEIGHT; i++) + TIFFWriteScanline(tif, scan_line, i, 0); + + free(scan_line); + TIFFClose(tif); + return 0; +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-grayscale.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-grayscale.c new file mode 100644 index 0000000..00b229f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-grayscale.c @@ -0,0 +1,147 @@ +/* $Id: tiff-grayscale.c,v 1.6 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * tiff-grayscale.c -- create a Class G (grayscale) TIFF file + * with a gray response curve in linear optical density + * + * Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts. + * + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * 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 Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include +#include +#include +#include + +#include "tiffio.h" + +#define WIDTH 512 +#define HEIGHT WIDTH + +char * programName; +void Usage(); + +int main(int argc, char **argv) +{ + int bits_per_pixel = 8, cmsize, i, j, k, + gray_index, chunk_size = 32, nchunks = 16; + unsigned char * scan_line; + uint16 * gray; + float refblackwhite[2*1]; + TIFF * tif; + + programName = argv[0]; + + if (argc != 4) + Usage(); + + if (!strcmp(argv[1], "-depth")) + bits_per_pixel = atoi(argv[2]); + else + Usage(); + + switch (bits_per_pixel) { + case 8: + nchunks = 16; + chunk_size = 32; + break; + case 4: + nchunks = 4; + chunk_size = 128; + break; + case 2: + nchunks = 2; + chunk_size = 256; + break; + default: + Usage(); + } + + cmsize = nchunks * nchunks; + gray = (uint16 *) malloc(cmsize * sizeof(uint16)); + + gray[0] = 3000; + for (i = 1; i < cmsize; i++) + gray[i] = (uint16) (-log10((double) i / (cmsize - 1)) * 1000); + + refblackwhite[0] = 0.0; + refblackwhite[1] = (float)((1L< +#include +#include + +#include "tiffio.h" + +#define WIDTH 512 +#define HEIGHT WIDTH +#define SCALE(x) ((x) * 257L) + +char * programName; +void Usage(); + +int main(int argc, char **argv) +{ + int bits_per_pixel = 8, cmsize, i, j, k, + cmap_index, chunk_size = 32, nchunks = 16; + unsigned char * scan_line; + uint16 *red, *green, *blue; + TIFF * tif; + + programName = argv[0]; + + if (argc != 4) + Usage(); + + if (!strcmp(argv[1], "-depth")) + bits_per_pixel = atoi(argv[2]); + else + Usage(); + + switch (bits_per_pixel) { + case 8: + nchunks = 16; + chunk_size = 32; + break; + case 4: + nchunks = 4; + chunk_size = 128; + break; + case 2: + nchunks = 2; + chunk_size = 256; + break; + case 1: + nchunks = 2; + chunk_size = 256; + break; + default: + Usage(); + } + + if (bits_per_pixel != 1) { + cmsize = nchunks * nchunks; + } else { + cmsize = 2; + } + red = (uint16 *) malloc(cmsize * sizeof(uint16)); + green = (uint16 *) malloc(cmsize * sizeof(uint16)); + blue = (uint16 *) malloc(cmsize * sizeof(uint16)); + + switch (bits_per_pixel) { + case 8: + for (i = 0; i < cmsize; i++) { + if (i < 32) + red[i] = 0; + else if (i < 64) + red[i] = SCALE(36); + else if (i < 96) + red[i] = SCALE(73); + else if (i < 128) + red[i] = SCALE(109); + else if (i < 160) + red[i] = SCALE(146); + else if (i < 192) + red[i] = SCALE(182); + else if (i < 224) + red[i] = SCALE(219); + else if (i < 256) + red[i] = SCALE(255); + + if ((i % 32) < 4) + green[i] = 0; + else if (i < 8) + green[i] = SCALE(36); + else if ((i % 32) < 12) + green[i] = SCALE(73); + else if ((i % 32) < 16) + green[i] = SCALE(109); + else if ((i % 32) < 20) + green[i] = SCALE(146); + else if ((i % 32) < 24) + green[i] = SCALE(182); + else if ((i % 32) < 28) + green[i] = SCALE(219); + else if ((i % 32) < 32) + green[i] = SCALE(255); + + if ((i % 4) == 0) + blue[i] = SCALE(0); + else if ((i % 4) == 1) + blue[i] = SCALE(85); + else if ((i % 4) == 2) + blue[i] = SCALE(170); + else if ((i % 4) == 3) + blue[i] = SCALE(255); + } + break; + case 4: + red[0] = SCALE(255); + green[0] = 0; + blue[0] = 0; + + red[1] = 0; + green[1] = SCALE(255); + blue[1] = 0; + + red[2] = 0; + green[2] = 0; + blue[2] = SCALE(255); + + red[3] = SCALE(255); + green[3] = SCALE(255); + blue[3] = SCALE(255); + + red[4] = 0; + green[4] = SCALE(255); + blue[4] = SCALE(255); + + red[5] = SCALE(255); + green[5] = 0; + blue[5] = SCALE(255); + + red[6] = SCALE(255); + green[6] = SCALE(255); + blue[6] = 0; + + red[7] = 0; + green[7] = 0; + blue[7] = 0; + + red[8] = SCALE(176); + green[8] = SCALE(224); + blue[8] = SCALE(230); + red[9] = SCALE(100); + green[9] = SCALE(149); + blue[9] = SCALE(237); + red[10] = SCALE(46); + green[10] = SCALE(139); + blue[10] = SCALE(87); + red[11] = SCALE(160); + green[11] = SCALE(82); + blue[11] = SCALE(45); + red[12] = SCALE(238); + green[12] = SCALE(130); + blue[12] = SCALE(238); + red[13] = SCALE(176); + green[13] = SCALE(48); + blue[13] = SCALE(96); + red[14] = SCALE(50); + green[14] = SCALE(205); + blue[14] = SCALE(50); + red[15] = SCALE(240); + green[15] = SCALE(152); + blue[15] = SCALE(35); + break; + case 2: + red[0] = SCALE(255); + green[0] = 0; + blue[0] = 0; + + red[1] = 0; + green[1] = SCALE(255); + blue[1] = 0; + + red[2] = 0; + green[2] = 0; + blue[2] = SCALE(255); + red[3] = SCALE(255); + green[3] = SCALE(255); + blue[3] = SCALE(255); + break; + case 1: + red[0] = 0; + green[0] = 0; + blue[0] = 0; + + red[1] = SCALE(255); + green[1] = SCALE(255); + blue[1] = SCALE(255); + break; + } + + if ((tif = TIFFOpen(argv[3], "w")) == NULL) { + fprintf(stderr, "can't open %s as a TIFF file\n", argv[3]); + free(red);free(green);free(blue); + return 0; + } + + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, WIDTH); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, HEIGHT); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bits_per_pixel); + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_NONE); + TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue); + + scan_line = (unsigned char *) malloc(WIDTH / (8 / bits_per_pixel)); + + for (i = 0; i < HEIGHT; i++) { + for (j = 0, k = 0; j < WIDTH;) { + cmap_index = (j / chunk_size) + ((i / chunk_size) * nchunks); + + switch (bits_per_pixel) { + case 8: + scan_line[k++] = cmap_index; + j++; + break; + case 4: + scan_line[k++] = (cmap_index << 4) + cmap_index; + j += 2; + break; + case 2: + scan_line[k++] = (cmap_index << 6) + (cmap_index << 4) + + (cmap_index << 2) + cmap_index; + j += 4; + break; + case 1: + scan_line[k++] = + ((j / chunk_size) == (i / chunk_size)) ? 0x00 : 0xff; + j += 8; + break; + } + } + TIFFWriteScanline(tif, scan_line, i, 0); + } + + free(scan_line); + TIFFClose(tif); + return 0; +} + +void +Usage() +{ + fprintf(stderr, "Usage: %s -depth (8 | 4 | 2 | 1) tiff-image\n", programName); + exit(0); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-rgb.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-rgb.c new file mode 100644 index 0000000..bf90499 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/tiff-rgb.c @@ -0,0 +1,201 @@ +/* $Id: tiff-rgb.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * tiff-rgb.c -- create a 24-bit Class R (rgb) TIFF file + * + * Copyright 1990 by Digital Equipment Corporation, Maynard, Massachusetts. + * + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * 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 Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include +#include +#include +#include + +#include "tiffio.h" + +#define ROUND(x) (uint16) ((x) + 0.5) +#define CMSIZE 256 +#define WIDTH 525 +#define HEIGHT 512 +#define TIFF_GAMMA 2.2 + +void Usage(); +char * programName; + +int main(int argc, char **argv) +{ + char * input_file = NULL; + double image_gamma = TIFF_GAMMA; + int i, j; + TIFF * tif; + unsigned char * scan_line; + uint16 red[CMSIZE], green[CMSIZE], blue[CMSIZE]; + float refblackwhite[2*3]; + + programName = argv[0]; + + switch (argc) { + case 2: + image_gamma = TIFF_GAMMA; + input_file = argv[1]; + break; + case 4: + if (!strcmp(argv[1], "-gamma")) { + image_gamma = atof(argv[2]); + input_file = argv[3]; + } else + Usage(); + break; + default: + Usage(); + } + + for (i = 0; i < CMSIZE; i++) { + if (i == 0) + red[i] = green[i] = blue[i] = 0; + else { + red[i] = ROUND((pow(i / 255.0, 1.0 / image_gamma) * 65535.0)); + green[i] = ROUND((pow(i / 255.0, 1.0 / image_gamma) * 65535.0)); + blue[i] = ROUND((pow(i / 255.0, 1.0 / image_gamma) * 65535.0)); + } + } + refblackwhite[0] = 0.0; refblackwhite[1] = 255.0; + refblackwhite[2] = 0.0; refblackwhite[3] = 255.0; + refblackwhite[4] = 0.0; refblackwhite[5] = 255.0; + + if ((tif = TIFFOpen(input_file, "w")) == NULL) { + fprintf(stderr, "can't open %s as a TIFF file\n", input_file); + exit(0); + } + + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, WIDTH); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, HEIGHT); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 3); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_NONE); +#ifdef notdef + TIFFSetField(tif, TIFFTAG_WHITEPOINT, whitex, whitey); + TIFFSetField(tif, TIFFTAG_PRIMARYCHROMATICITIES, primaries); +#endif + TIFFSetField(tif, TIFFTAG_REFERENCEBLACKWHITE, refblackwhite); + TIFFSetField(tif, TIFFTAG_TRANSFERFUNCTION, red, green, blue); + + scan_line = (unsigned char *) malloc(WIDTH * 3); + + for (i = 0; i < 255; i++) { + for (j = 0; j < 75; j++) { + scan_line[j * 3] = 255; + scan_line[(j * 3) + 1] = 255 - i; + scan_line[(j * 3) + 2] = 255 - i; + } + for (j = 75; j < 150; j++) { + scan_line[j * 3] = 255 - i; + scan_line[(j * 3) + 1] = 255; + scan_line[(j * 3) + 2] = 255 - i; + } + for (j = 150; j < 225; j++) { + scan_line[j * 3] = 255 - i; + scan_line[(j * 3) + 1] = 255 - i; + scan_line[(j * 3) + 2] = 255; + } + for (j = 225; j < 300; j++) { + scan_line[j * 3] = (i - 1) / 2; + scan_line[(j * 3) + 1] = (i - 1) / 2; + scan_line[(j * 3) + 2] = (i - 1) / 2; + } + for (j = 300; j < 375; j++) { + scan_line[j * 3] = 255 - i; + scan_line[(j * 3) + 1] = 255; + scan_line[(j * 3) + 2] = 255; + } + for (j = 375; j < 450; j++) { + scan_line[j * 3] = 255; + scan_line[(j * 3) + 1] = 255 - i; + scan_line[(j * 3) + 2] = 255; + } + for (j = 450; j < 525; j++) { + scan_line[j * 3] = 255; + scan_line[(j * 3) + 1] = 255; + scan_line[(j * 3) + 2] = 255 - i; + } + TIFFWriteScanline(tif, scan_line, i, 0); + } + for (i = 255; i < 512; i++) { + for (j = 0; j < 75; j++) { + scan_line[j * 3] = i; + scan_line[(j * 3) + 1] = 0; + scan_line[(j * 3) + 2] = 0; + } + for (j = 75; j < 150; j++) { + scan_line[j * 3] = 0; + scan_line[(j * 3) + 1] = i; + scan_line[(j * 3) + 2] = 0; + } + for (j = 150; j < 225; j++) { + scan_line[j * 3] = 0; + scan_line[(j * 3) + 1] = 0; + scan_line[(j * 3) + 2] = i; + } + for (j = 225; j < 300; j++) { + scan_line[j * 3] = (i - 1) / 2; + scan_line[(j * 3) + 1] = (i - 1) / 2; + scan_line[(j * 3) + 2] = (i - 1) / 2; + } + for (j = 300; j < 375; j++) { + scan_line[j * 3] = 0; + scan_line[(j * 3) + 1] = i; + scan_line[(j * 3) + 2] = i; + } + for (j = 375; j < 450; j++) { + scan_line[j * 3] = i; + scan_line[(j * 3) + 1] = 0; + scan_line[(j * 3) + 2] = i; + } + for (j = 450; j < 525; j++) { + scan_line[j * 3] = i; + scan_line[(j * 3) + 1] = i; + scan_line[(j * 3) + 2] = 0; + } + TIFFWriteScanline(tif, scan_line, i, 0); + } + + free(scan_line); + TIFFClose(tif); + exit(0); +} + +void +Usage() +{ + fprintf(stderr, "Usage: %s -gamma gamma tiff-image\n", programName); + exit(0); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.am new file mode 100644 index 0000000..749f5ce --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.am @@ -0,0 +1,42 @@ +# +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +#LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +EXTRA_DIST = README patchlevel.h xtiff.c xtifficon.h + +#noinst_PROGRAMS = + +#if HAVE_XAW +#noinst_PROGRAMS += xtiff +#endif + +#xtiff_SOURCES = patchlevel.h xtiff.c xtifficon.h +#xtiff_CFLAGS = $(CFLAGS) $(XAW_CFLAGS) $(AM_CFLAGS) +#xtiff_LDADD = $(LIBTIFF) $(X_LIBS) $(XAW_LIBS) + +#INCLUDES = -I$(top_srcdir)/libtiff + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.in new file mode 100644 index 0000000..4ecfb0c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/Makefile.in @@ -0,0 +1,468 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +#LIBTIFF = $(top_builddir)/libtiff/libtiff.la +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/dbs/xtiff +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README patchlevel.h xtiff.c xtifficon.h +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/dbs/xtiff/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/dbs/xtiff/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +#noinst_PROGRAMS = + +#if HAVE_XAW +#noinst_PROGRAMS += xtiff +#endif + +#xtiff_SOURCES = patchlevel.h xtiff.c xtifficon.h +#xtiff_CFLAGS = $(CFLAGS) $(XAW_CFLAGS) $(AM_CFLAGS) +#xtiff_LDADD = $(LIBTIFF) $(X_LIBS) $(XAW_LIBS) + +#INCLUDES = -I$(top_srcdir)/libtiff + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/README new file mode 100644 index 0000000..fa15147 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/README @@ -0,0 +1,6 @@ +xtiff 2.0 + +xtiff is a tool for viewing a TIFF file in an X window. It was written to +handle as many different kinds of TIFF files as possible while remaining +simple, portable and efficient. xtiff requires X11 R4, the Athena Widgets +and Sam Leffler's libtiff package (which can be found on ucbvax.berkeley.edu). diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/patchlevel.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/patchlevel.h new file mode 100644 index 0000000..538b6d9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/patchlevel.h @@ -0,0 +1,8 @@ +#define PATCHLEVEL 0 +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtiff.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtiff.c new file mode 100644 index 0000000..2634030 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtiff.c @@ -0,0 +1,1290 @@ +/* + * $Id: xtiff.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ + * + * xtiff - view a TIFF file in an X window + * + * Dan Sears + * Chris Sears + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * 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 Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * + * Revision 1.0 90/05/07 + * Initial release. + * Revision 2.0 90/12/20 + * Converted to use the Athena Widgets and the Xt Intrinsics. + * + * Notes: + * + * According to the TIFF 5.0 Specification, it is possible to have + * both a TIFFTAG_COLORMAP and a TIFFTAG_COLORRESPONSECURVE. This + * doesn't make sense since a TIFFTAG_COLORMAP is 16 bits wide and + * a TIFFTAG_COLORRESPONSECURVE is tfBitsPerSample bits wide for each + * channel. This is probably a bug in the specification. + * In this case, TIFFTAG_COLORRESPONSECURVE is ignored. + * This might make sense if TIFFTAG_COLORMAP was 8 bits wide. + * + * TIFFTAG_COLORMAP is often incorrectly written as ranging from + * 0 to 255 rather than from 0 to 65535. CheckAndCorrectColormap() + * takes care of this. + * + * Only ORIENTATION_TOPLEFT is supported correctly. This is the + * default TIFF and X orientation. Other orientations will be + * displayed incorrectly. + * + * There is no support for or use of 3/3/2 DirectColor visuals. + * TIFFTAG_MINSAMPLEVALUE and TIFFTAG_MAXSAMPLEVALUE are not supported. + * + * Only TIFFTAG_BITSPERSAMPLE values that are 1, 2, 4 or 8 are supported. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define XK_MISCELLANY +#include +#include "xtifficon.h" + +#define TIFF_GAMMA "2.2" /* default gamma from the TIFF 5.0 spec */ +#define ROUND(x) (uint16) ((x) + 0.5) +#define SCALE(x, s) (((x) * 65535L) / (s)) +#define MCHECK(m) if (!m) { fprintf(stderr, "malloc failed\n"); exit(0); } +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define VIEWPORT_WIDTH 700 +#define VIEWPORT_HEIGHT 500 +#define KEY_TRANSLATE 20 + +#ifdef __STDC__ +#define PP(args) args +#else +#define PP(args) () +#endif + +int main PP((int argc, char **argv)); +void OpenTIFFFile PP((void)); +void GetTIFFHeader PP((void)); +void SetNameLabel PP((void)); +void CheckAndCorrectColormap PP((void)); +void SimpleGammaCorrection PP((void)); +void GetVisual PP((void)); +Boolean SearchVisualList PP((int image_depth, + int visual_class, Visual **visual)); +void GetTIFFImage PP((void)); +void CreateXImage PP((void)); +XtCallbackProc SelectProc PP((Widget w, caddr_t unused_1, caddr_t unused_2)); +void QuitProc PP((void)); +void NextProc PP((void)); +void PreviousProc PP((void)); +void PageProc PP((int direction)); +void EventProc PP((Widget widget, caddr_t unused, XEvent *event)); +void ResizeProc PP((void)); +int XTiffErrorHandler PP((Display *display, XErrorEvent *error_event)); +void Usage PP((void)); + +int xtVersion = XtSpecificationRelease; /* xtiff depends on R4 or higher */ + +/* + * Xt data structures + */ +Widget shellWidget, formWidget, listWidget, labelWidget, imageWidget; + +enum { ButtonQuit = 0, ButtonPreviousPage = 1, ButtonNextPage = 2 }; + +String buttonStrings[] = { "Quit", "Previous", "Next" }; + +static XrmOptionDescRec shellOptions[] = { + { "-help", "*help", XrmoptionNoArg, (caddr_t) "True" }, + { "-gamma", "*gamma", XrmoptionSepArg, NULL }, + { "-usePixmap", "*usePixmap", XrmoptionSepArg, NULL }, + { "-viewportWidth", "*viewportWidth", XrmoptionSepArg, NULL }, + { "-viewportHeight", "*viewportHeight", XrmoptionSepArg, NULL }, + { "-translate", "*translate", XrmoptionSepArg, NULL }, + { "-verbose", "*verbose", XrmoptionSepArg, NULL } +}; + +typedef struct { + Boolean help; + float gamma; + Boolean usePixmap; + uint32 viewportWidth; + uint32 viewportHeight; + int translate; + Boolean verbose; +} AppData, *AppDataPtr; + +AppData appData; + +XtResource clientResources[] = { + { + "help", XtCBoolean, XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, help), XtRImmediate, (XtPointer) False + }, { + "gamma", "Gamma", XtRFloat, sizeof(float), + XtOffset(AppDataPtr, gamma), XtRString, (XtPointer) TIFF_GAMMA + }, { + "usePixmap", "UsePixmap", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, usePixmap), XtRImmediate, (XtPointer) True + }, { + "viewportWidth", "ViewportWidth", XtRInt, sizeof(int), + XtOffset(AppDataPtr, viewportWidth), XtRImmediate, + (XtPointer) VIEWPORT_WIDTH + }, { + "viewportHeight", "ViewportHeight", XtRInt, sizeof(int), + XtOffset(AppDataPtr, viewportHeight), XtRImmediate, + (XtPointer) VIEWPORT_HEIGHT + }, { + "translate", "Translate", XtRInt, sizeof(int), + XtOffset(AppDataPtr, translate), XtRImmediate, (XtPointer) KEY_TRANSLATE + }, { + "verbose", "Verbose", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, verbose), XtRImmediate, (XtPointer) True + } +}; + +Arg formArgs[] = { + { XtNresizable, True } +}; + +Arg listArgs[] = { + { XtNresizable, False }, + { XtNborderWidth, 0 }, + { XtNdefaultColumns, 3 }, + { XtNforceColumns, True }, + { XtNlist, (int) buttonStrings }, + { XtNnumberStrings, XtNumber(buttonStrings) }, + { XtNtop, XtChainTop }, + { XtNleft, XtChainLeft }, + { XtNbottom, XtChainTop }, + { XtNright, XtChainLeft } +}; + +Arg labelArgs[] = { + { XtNresizable, False }, + { XtNwidth, 200 }, + { XtNborderWidth, 0 }, + { XtNjustify, XtJustifyLeft }, + { XtNtop, XtChainTop }, + { XtNleft, XtChainLeft }, + { XtNbottom, XtChainTop }, + { XtNright, XtChainLeft } +}; + +Arg imageArgs[] = { + { XtNresizable, True }, + { XtNborderWidth, 0 }, + { XtNtop, XtChainTop }, + { XtNleft, XtChainLeft }, + { XtNbottom, XtChainTop }, + { XtNright, XtChainLeft } +}; + +XtActionsRec actionsTable[] = { + { "quit", QuitProc }, + { "next", NextProc }, + { "previous", PreviousProc }, + { "notifyresize", ResizeProc } +}; + +char translationsTable[] = "q: quit() \n \ + Q: quit() \n \ + WM_PROTOCOLS: quit()\n \ + p: previous() \n \ + P: previous() \n \ + n: next() \n \ + N: next() \n \ + : notifyresize()"; + +/* + * X data structures + */ +Colormap xColormap; +Display * xDisplay; +Pixmap xImagePixmap; +Visual * xVisual; +XImage * xImage; +GC xWinGc; +int xImageDepth, xScreen, xRedMask, xGreenMask, xBlueMask, + xOffset = 0, yOffset = 0, grabX = -1, grabY = -1; +unsigned char basePixel = 0; + +/* + * TIFF data structures + */ +TIFF * tfFile = NULL; +uint32 tfImageWidth, tfImageHeight; +uint16 tfBitsPerSample, tfSamplesPerPixel, tfPlanarConfiguration, + tfPhotometricInterpretation, tfGrayResponseUnit, + tfImageDepth, tfBytesPerRow; +int tfDirectory = 0, tfMultiPage = False; +double tfUnitMap, tfGrayResponseUnitMap[] = { + -1, -10, -100, -1000, -10000, -100000 + }; + +/* + * display data structures + */ +double *dRed, *dGreen, *dBlue; + +/* + * shared data structures + */ +uint16 * redMap = NULL, *greenMap = NULL, *blueMap = NULL, + *grayMap = NULL, colormapSize; +char * imageMemory; +char * fileName; + +int +main(int argc, char **argv) +{ + XSetWindowAttributes window_attributes; + Widget widget_list[3]; + Arg args[5]; + + setbuf(stdout, NULL); setbuf(stderr, NULL); + + shellWidget = XtInitialize(argv[0], "XTiff", shellOptions, + XtNumber(shellOptions), &argc, argv); + + XSetErrorHandler(XTiffErrorHandler); + + XtGetApplicationResources(shellWidget, &appData, + (XtResourceList) clientResources, (Cardinal) XtNumber(clientResources), + (ArgList) NULL, (Cardinal) 0); + + if ((argc <= 1) || (argc > 2) || appData.help) + Usage(); + + if (appData.verbose == False) { + TIFFSetErrorHandler(0); + TIFFSetWarningHandler(0); + } + + fileName = argv[1]; + + xDisplay = XtDisplay(shellWidget); + xScreen = DefaultScreen(xDisplay); + + OpenTIFFFile(); + GetTIFFHeader(); + SimpleGammaCorrection(); + GetVisual(); + GetTIFFImage(); + + /* + * Send visual, colormap, depth and iconPixmap to shellWidget. + * Sending the visual to the shell is only possible with the advent of R4. + */ + XtSetArg(args[0], XtNvisual, xVisual); + XtSetArg(args[1], XtNcolormap, xColormap); + XtSetArg(args[2], XtNdepth, + xImageDepth == 1 ? DefaultDepth(xDisplay, xScreen) : xImageDepth); + XtSetArg(args[3], XtNiconPixmap, + XCreateBitmapFromData(xDisplay, RootWindow(xDisplay, xScreen), + xtifficon_bits, xtifficon_width, xtifficon_height)); + XtSetArg(args[4], XtNallowShellResize, True); + XtSetValues(shellWidget, args, 5); + + /* + * widget instance hierarchy + */ + formWidget = XtCreateManagedWidget("form", formWidgetClass, + shellWidget, formArgs, XtNumber(formArgs)); + + widget_list[0] = listWidget = XtCreateWidget("list", + listWidgetClass, formWidget, listArgs, XtNumber(listArgs)); + + widget_list[1] = labelWidget = XtCreateWidget("label", + labelWidgetClass, formWidget, labelArgs, XtNumber(labelArgs)); + + widget_list[2] = imageWidget = XtCreateWidget("image", + widgetClass, formWidget, imageArgs, XtNumber(imageArgs)); + + XtManageChildren(widget_list, XtNumber(widget_list)); + + /* + * initial widget sizes - for small images let xtiff size itself + */ + if (tfImageWidth >= appData.viewportWidth) { + XtSetArg(args[0], XtNwidth, appData.viewportWidth); + XtSetValues(shellWidget, args, 1); + } + if (tfImageHeight >= appData.viewportHeight) { + XtSetArg(args[0], XtNheight, appData.viewportHeight); + XtSetValues(shellWidget, args, 1); + } + + XtSetArg(args[0], XtNwidth, tfImageWidth); + XtSetArg(args[1], XtNheight, tfImageHeight); + XtSetValues(imageWidget, args, 2); + + /* + * formWidget uses these constraints but they are stored in the children. + */ + XtSetArg(args[0], XtNfromVert, listWidget); + XtSetValues(imageWidget, args, 1); + XtSetArg(args[0], XtNfromHoriz, listWidget); + XtSetValues(labelWidget, args, 1); + + SetNameLabel(); + + XtAddCallback(listWidget, XtNcallback, (XtCallbackProc) SelectProc, + (XtPointer) NULL); + + XtAddActions(actionsTable, XtNumber(actionsTable)); + XtSetArg(args[0], XtNtranslations, + XtParseTranslationTable(translationsTable)); + XtSetValues(formWidget, &args[0], 1); + XtSetValues(imageWidget, &args[0], 1); + + /* + * This is intended to be a little faster than going through + * the translation manager. + */ + XtAddEventHandler(imageWidget, ExposureMask | ButtonPressMask + | ButtonReleaseMask | Button1MotionMask | KeyPressMask, + False, EventProc, NULL); + + XtRealizeWidget(shellWidget); + + window_attributes.cursor = XCreateFontCursor(xDisplay, XC_fleur); + XChangeWindowAttributes(xDisplay, XtWindow(imageWidget), + CWCursor, &window_attributes); + + CreateXImage(); + + XtMainLoop(); + + return 0; +} + +void +OpenTIFFFile() +{ + if (tfFile != NULL) + TIFFClose(tfFile); + + if ((tfFile = TIFFOpen(fileName, "r")) == NULL) { + fprintf(appData.verbose ? stderr : stdout, + "xtiff: can't open %s as a TIFF file\n", fileName); + exit(0); + } + + tfMultiPage = (TIFFLastDirectory(tfFile) ? False : True); +} + +void +GetTIFFHeader() +{ + register int i; + + if (!TIFFSetDirectory(tfFile, tfDirectory)) { + fprintf(stderr, "xtiff: can't seek to directory %d in %s\n", + tfDirectory, fileName); + exit(0); + } + + TIFFGetField(tfFile, TIFFTAG_IMAGEWIDTH, &tfImageWidth); + TIFFGetField(tfFile, TIFFTAG_IMAGELENGTH, &tfImageHeight); + + /* + * If the following tags aren't present then use the TIFF defaults. + */ + TIFFGetFieldDefaulted(tfFile, TIFFTAG_BITSPERSAMPLE, &tfBitsPerSample); + TIFFGetFieldDefaulted(tfFile, TIFFTAG_SAMPLESPERPIXEL, &tfSamplesPerPixel); + TIFFGetFieldDefaulted(tfFile, TIFFTAG_PLANARCONFIG, &tfPlanarConfiguration); + TIFFGetFieldDefaulted(tfFile, TIFFTAG_GRAYRESPONSEUNIT, &tfGrayResponseUnit); + + tfUnitMap = tfGrayResponseUnitMap[tfGrayResponseUnit]; + colormapSize = 1 << tfBitsPerSample; + tfImageDepth = tfBitsPerSample * tfSamplesPerPixel; + + dRed = (double *) malloc(colormapSize * sizeof(double)); + dGreen = (double *) malloc(colormapSize * sizeof(double)); + dBlue = (double *) malloc(colormapSize * sizeof(double)); + MCHECK(dRed); MCHECK(dGreen); MCHECK(dBlue); + + /* + * If TIFFTAG_PHOTOMETRIC is not present then assign a reasonable default. + * The TIFF 5.0 specification doesn't give a default. + */ + if (!TIFFGetField(tfFile, TIFFTAG_PHOTOMETRIC, + &tfPhotometricInterpretation)) { + if (tfSamplesPerPixel != 1) + tfPhotometricInterpretation = PHOTOMETRIC_RGB; + else if (tfBitsPerSample == 1) + tfPhotometricInterpretation = PHOTOMETRIC_MINISBLACK; + else if (TIFFGetField(tfFile, TIFFTAG_COLORMAP, + &redMap, &greenMap, &blueMap)) { + tfPhotometricInterpretation = PHOTOMETRIC_PALETTE; + redMap = greenMap = blueMap = NULL; + } else + tfPhotometricInterpretation = PHOTOMETRIC_MINISBLACK; + } + + /* + * Given TIFFTAG_PHOTOMETRIC extract or create the response curves. + */ + switch (tfPhotometricInterpretation) { + case PHOTOMETRIC_RGB: + redMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap); + for (i = 0; i < colormapSize; i++) + dRed[i] = dGreen[i] = dBlue[i] + = (double) SCALE(i, colormapSize - 1); + break; + case PHOTOMETRIC_PALETTE: + if (!TIFFGetField(tfFile, TIFFTAG_COLORMAP, + &redMap, &greenMap, &blueMap)) { + redMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap); + for (i = 0; i < colormapSize; i++) + dRed[i] = dGreen[i] = dBlue[i] + = (double) SCALE(i, colormapSize - 1); + } else { + CheckAndCorrectColormap(); + for (i = 0; i < colormapSize; i++) { + dRed[i] = (double) redMap[i]; + dGreen[i] = (double) greenMap[i]; + dBlue[i] = (double) blueMap[i]; + } + } + break; + case PHOTOMETRIC_MINISWHITE: + redMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap); + for (i = 0; i < colormapSize; i++) + dRed[i] = dGreen[i] = dBlue[i] = (double) + SCALE(colormapSize-1-i, colormapSize-1); + break; + case PHOTOMETRIC_MINISBLACK: + redMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16)); + MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap); + for (i = 0; i < colormapSize; i++) + dRed[i] = dGreen[i] = dBlue[i] = (double) SCALE(i, colormapSize-1); + break; + default: + fprintf(stderr, + "xtiff: can't display photometric interpretation type %d\n", + tfPhotometricInterpretation); + exit(0); + } +} + +void +SetNameLabel() +{ + char buffer[BUFSIZ]; + Arg args[1]; + + if (tfMultiPage) + sprintf(buffer, "%s - page %d", fileName, tfDirectory); + else + strcpy(buffer, fileName); + XtSetArg(args[0], XtNlabel, buffer); + XtSetValues(labelWidget, args, 1); +} + +/* + * Many programs get TIFF colormaps wrong. They use 8-bit colormaps instead of + * 16-bit colormaps. This function is a heuristic to detect and correct this. + */ +void +CheckAndCorrectColormap() +{ + register int i; + + for (i = 0; i < colormapSize; i++) + if ((redMap[i] > 255) || (greenMap[i] > 255) || (blueMap[i] > 255)) + return; + + for (i = 0; i < colormapSize; i++) { + redMap[i] = SCALE(redMap[i], 255); + greenMap[i] = SCALE(greenMap[i], 255); + blueMap[i] = SCALE(blueMap[i], 255); + } + TIFFWarning(fileName, "Assuming 8-bit colormap"); +} + +void +SimpleGammaCorrection() +{ + register int i; + register double i_gamma = 1.0 / appData.gamma; + + for (i = 0; i < colormapSize; i++) { + if (((tfPhotometricInterpretation == PHOTOMETRIC_MINISWHITE) + && (i == colormapSize - 1)) + || ((tfPhotometricInterpretation == PHOTOMETRIC_MINISBLACK) + && (i == 0))) + redMap[i] = greenMap[i] = blueMap[i] = 0; + else { + redMap[i] = ROUND((pow(dRed[i] / 65535.0, i_gamma) * 65535.0)); + greenMap[i] = ROUND((pow(dGreen[i] / 65535.0, i_gamma) * 65535.0)); + blueMap[i] = ROUND((pow(dBlue[i] / 65535.0, i_gamma) * 65535.0)); + } + } + + free(dRed); free(dGreen); free(dBlue); +} + +static char* classNames[] = { + "StaticGray", + "GrayScale", + "StaticColor", + "PseudoColor", + "TrueColor", + "DirectColor" +}; + +/* + * Current limitation: the visual is set initially by the first file. + * It cannot be changed. + */ +void +GetVisual() +{ + XColor *colors = NULL; + unsigned long *pixels = NULL; + unsigned long i; + + switch (tfImageDepth) { + /* + * X really wants a 32-bit image with the fourth channel unused, + * but the visual structure thinks it's 24-bit. bitmap_unit is 32. + */ + case 32: + case 24: + if (SearchVisualList(24, DirectColor, &xVisual) == False) { + fprintf(stderr, "xtiff: 24-bit DirectColor visual not available\n"); + exit(0); + } + + colors = (XColor *) malloc(3 * colormapSize * sizeof(XColor)); + MCHECK(colors); + + for (i = 0; i < colormapSize; i++) { + colors[i].pixel = (i << 16) + (i << 8) + i; + colors[i].red = redMap[i]; + colors[i].green = greenMap[i]; + colors[i].blue = blueMap[i]; + colors[i].flags = DoRed | DoGreen | DoBlue; + } + + xColormap = XCreateColormap(xDisplay, RootWindow(xDisplay, xScreen), + xVisual, AllocAll); + XStoreColors(xDisplay, xColormap, colors, colormapSize); + break; + case 8: + case 4: + case 2: + /* + * We assume that systems with 24-bit visuals also have 8-bit visuals. + * We don't promote from 8-bit PseudoColor to 24/32 bit DirectColor. + */ + switch (tfPhotometricInterpretation) { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + if (SearchVisualList((int) tfImageDepth, GrayScale, &xVisual) == True) + break; + case PHOTOMETRIC_PALETTE: + if (SearchVisualList((int) tfImageDepth, PseudoColor, &xVisual) == True) + break; + default: + fprintf(stderr, "xtiff: Unsupported TIFF/X configuration\n"); + exit(0); + } + + colors = (XColor *) malloc(colormapSize * sizeof(XColor)); + MCHECK(colors); + + for (i = 0; i < colormapSize; i++) { + colors[i].pixel = i; + colors[i].red = redMap[i]; + colors[i].green = greenMap[i]; + colors[i].blue = blueMap[i]; + colors[i].flags = DoRed | DoGreen | DoBlue; + } + + /* + * xtiff's colormap allocation is private. It does not attempt + * to detect whether any existing colormap entries are suitable + * for its use. This will cause colormap flashing. Furthermore, + * background and foreground are taken from the environment. + * For example, the foreground color may be red when the visual + * is GrayScale. If the colormap is completely populated, + * Xt will not be able to allocate fg and bg. + */ + if (tfImageDepth == 8) + xColormap = XCreateColormap(xDisplay, RootWindow(xDisplay, xScreen), + xVisual, AllocAll); + else { + xColormap = XCreateColormap(xDisplay, RootWindow(xDisplay, xScreen), + xVisual, AllocNone); + pixels = (unsigned long *) + malloc(colormapSize * sizeof(unsigned long)); + MCHECK(pixels); + (void) XAllocColorCells(xDisplay, xColormap, True, + NULL, 0, pixels, colormapSize); + basePixel = (unsigned char) pixels[0]; + free(pixels); + } + XStoreColors(xDisplay, xColormap, colors, colormapSize); + break; + case 1: + xImageDepth = 1; + xVisual = DefaultVisual(xDisplay, xScreen); + xColormap = DefaultColormap(xDisplay, xScreen); + break; + default: + fprintf(stderr, "xtiff: unsupported image depth %d\n", tfImageDepth); + exit(0); + } + + if (appData.verbose == True) + fprintf(stderr, "%s: Using %d-bit %s visual.\n", + fileName, xImageDepth, classNames[xVisual->class]); + + if (colors != NULL) + free(colors); + if (grayMap != NULL) + free(grayMap); + if (redMap != NULL) + free(redMap); + if (greenMap != NULL) + free(greenMap); + if (blueMap != NULL) + free(blueMap); + + colors = NULL; grayMap = redMap = greenMap = blueMap = NULL; +} + +/* + * Search for an appropriate visual. Promote where necessary. + * Check to make sure that ENOUGH colormap entries are writeable. + * basePixel was determined when XAllocColorCells() contiguously + * allocated enough entries. basePixel is used below in GetTIFFImage. + */ +Boolean +SearchVisualList(image_depth, visual_class, visual) + int image_depth, visual_class; + Visual **visual; +{ + XVisualInfo template_visual, *visual_list, *vl; + int i, n_visuals; + + template_visual.screen = xScreen; + vl = visual_list = XGetVisualInfo(xDisplay, VisualScreenMask, + &template_visual, &n_visuals); + + if (n_visuals == 0) { + fprintf(stderr, "xtiff: visual list not available\n"); + exit(0); + } + + for (i = 0; i < n_visuals; vl++, i++) { + if ((vl->class == visual_class) && (vl->depth >= image_depth) + && (vl->visual->map_entries >= (1 << vl->depth))) { + *visual = vl->visual; + xImageDepth = vl->depth; + xRedMask = vl->red_mask; + xGreenMask = vl->green_mask; + xBlueMask = vl->blue_mask; + XFree((char *) visual_list); + return True; + } + } + + XFree((char *) visual_list); + return False; +} + +void +GetTIFFImage() +{ + int pixel_map[3], red_shift, green_shift, blue_shift; + char *scan_line, *output_p, *input_p; + uint32 i, j; + uint16 s; + + scan_line = (char *) malloc(tfBytesPerRow = TIFFScanlineSize(tfFile)); + MCHECK(scan_line); + + if ((tfImageDepth == 32) || (tfImageDepth == 24)) { + output_p = imageMemory = (char *) + malloc(tfImageWidth * tfImageHeight * 4); + MCHECK(imageMemory); + + /* + * Handle different color masks for different frame buffers. + */ + if (ImageByteOrder(xDisplay) == LSBFirst) { /* DECstation 5000 */ + red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 3 + : (xRedMask == 0xFF0000 ? 2 : (xRedMask == 0xFF00 ? 1 : 0)); + green_shift = pixel_map[1] = xGreenMask == 0xFF000000 ? 3 + : (xGreenMask == 0xFF0000 ? 2 : (xGreenMask == 0xFF00 ? 1 : 0)); + blue_shift = pixel_map[2] = xBlueMask == 0xFF000000 ? 3 + : (xBlueMask == 0xFF0000 ? 2 : (xBlueMask == 0xFF00 ? 1 : 0)); + } else { /* Ardent */ + red_shift = pixel_map[0] = xRedMask == 0xFF000000 ? 0 + : (xRedMask == 0xFF0000 ? 1 : (xRedMask == 0xFF00 ? 2 : 3)); + green_shift = pixel_map[0] = xGreenMask == 0xFF000000 ? 0 + : (xGreenMask == 0xFF0000 ? 1 : (xGreenMask == 0xFF00 ? 2 : 3)); + blue_shift = pixel_map[0] = xBlueMask == 0xFF000000 ? 0 + : (xBlueMask == 0xFF0000 ? 1 : (xBlueMask == 0xFF00 ? 2 : 3)); + } + + if (tfPlanarConfiguration == PLANARCONFIG_CONTIG) { + for (i = 0; i < tfImageHeight; i++) { + if (TIFFReadScanline(tfFile, scan_line, i, 0) < 0) + break; + for (input_p = scan_line, j = 0; j < tfImageWidth; j++) { + *(output_p + red_shift) = *input_p++; + *(output_p + green_shift) = *input_p++; + *(output_p + blue_shift) = *input_p++; + output_p += 4; + if (tfSamplesPerPixel == 4) /* skip the fourth channel */ + input_p++; + } + } + } else { + for (s = 0; s < tfSamplesPerPixel; s++) { + if (s == 3) /* skip the fourth channel */ + continue; + for (i = 0; i < tfImageHeight; i++) { + if (TIFFReadScanline(tfFile, scan_line, i, s) < 0) + break; + input_p = scan_line; + output_p = imageMemory + (i*tfImageWidth*4) + pixel_map[s]; + for (j = 0; j < tfImageWidth; j++, output_p += 4) + *output_p = *input_p++; + } + } + } + } else { + if (xImageDepth == tfImageDepth) { + output_p = imageMemory = (char *) + malloc(tfBytesPerRow * tfImageHeight); + MCHECK(imageMemory); + + for (i = 0; i < tfImageHeight; i++, output_p += tfBytesPerRow) + if (TIFFReadScanline(tfFile, output_p, i, 0) < 0) + break; + } else if ((xImageDepth == 8) && (tfImageDepth == 4)) { + output_p = imageMemory = (char *) + malloc(tfBytesPerRow * 2 * tfImageHeight + 2); + MCHECK(imageMemory); + + /* + * If a scanline is of odd size the inner loop below will overshoot. + * This is handled very simply by recalculating the start point at + * each scanline and padding imageMemory a little at the end. + */ + for (i = 0; i < tfImageHeight; i++) { + if (TIFFReadScanline(tfFile, scan_line, i, 0) < 0) + break; + output_p = &imageMemory[i * tfImageWidth]; + input_p = scan_line; + for (j = 0; j < tfImageWidth; j += 2, input_p++) { + *output_p++ = (*input_p >> 4) + basePixel; + *output_p++ = (*input_p & 0xf) + basePixel; + } + } + } else if ((xImageDepth == 8) && (tfImageDepth == 2)) { + output_p = imageMemory = (char *) + malloc(tfBytesPerRow * 4 * tfImageHeight + 4); + MCHECK(imageMemory); + + for (i = 0; i < tfImageHeight; i++) { + if (TIFFReadScanline(tfFile, scan_line, i, 0) < 0) + break; + output_p = &imageMemory[i * tfImageWidth]; + input_p = scan_line; + for (j = 0; j < tfImageWidth; j += 4, input_p++) { + *output_p++ = (*input_p >> 6) + basePixel; + *output_p++ = ((*input_p >> 4) & 3) + basePixel; + *output_p++ = ((*input_p >> 2) & 3) + basePixel; + *output_p++ = (*input_p & 3) + basePixel; + } + } + } else if ((xImageDepth == 4) && (tfImageDepth == 2)) { + output_p = imageMemory = (char *) + malloc(tfBytesPerRow * 2 * tfImageHeight + 2); + MCHECK(imageMemory); + + for (i = 0; i < tfImageHeight; i++) { + if (TIFFReadScanline(tfFile, scan_line, i, 0) < 0) + break; + output_p = &imageMemory[i * tfBytesPerRow * 2]; + input_p = scan_line; + for (j = 0; j < tfImageWidth; j += 4, input_p++) { + *output_p++ = (((*input_p>>6) << 4) + | ((*input_p >> 4) & 3)) + basePixel; + *output_p++ = ((((*input_p>>2) & 3) << 4) + | (*input_p & 3)) + basePixel; + } + } + } else { + fprintf(stderr, + "xtiff: can't handle %d-bit TIFF file on an %d-bit display\n", + tfImageDepth, xImageDepth); + exit(0); + } + } + + free(scan_line); +} + +void +CreateXImage() +{ + XGCValues gc_values; + GC bitmap_gc; + + xOffset = yOffset = 0; + grabX = grabY = -1; + + xImage = XCreateImage(xDisplay, xVisual, xImageDepth, + xImageDepth == 1 ? XYBitmap : ZPixmap, /* offset */ 0, + (char *) imageMemory, tfImageWidth, tfImageHeight, + /* bitmap_pad */ 8, /* bytes_per_line */ 0); + + /* + * libtiff converts LSB data into MSB but doesn't change the FillOrder tag. + */ + if (xImageDepth == 1) + xImage->bitmap_bit_order = MSBFirst; + if (xImageDepth <= 8) + xImage->byte_order = MSBFirst; + + /* + * create an appropriate GC + */ + gc_values.function = GXcopy; + gc_values.plane_mask = AllPlanes; + if (tfPhotometricInterpretation == PHOTOMETRIC_MINISBLACK) { + gc_values.foreground = XWhitePixel(xDisplay, xScreen); + gc_values.background = XBlackPixel(xDisplay, xScreen); + } else { + gc_values.foreground = XBlackPixel(xDisplay, xScreen); + gc_values.background = XWhitePixel(xDisplay, xScreen); + } + xWinGc = XCreateGC(xDisplay, XtWindow(shellWidget), + GCFunction | GCPlaneMask | GCForeground | GCBackground, &gc_values); + + /* + * create the pixmap and load the image + */ + if (appData.usePixmap == True) { + xImagePixmap = XCreatePixmap(xDisplay, RootWindow(xDisplay, xScreen), + xImage->width, xImage->height, xImageDepth); + + /* + * According to the O'Reilly X Protocol Reference Manual, page 53, + * "A pixmap depth of one is always supported and listed, but windows + * of depth one might not be supported." Therefore we create a pixmap + * of depth one and use XCopyPlane(). This is idiomatic. + */ + if (xImageDepth == 1) { /* just pass the bits through */ + gc_values.foreground = 1; /* foreground describes set bits */ + gc_values.background = 0; /* background describes clear bits */ + bitmap_gc = XCreateGC(xDisplay, xImagePixmap, + GCForeground | GCBackground, &gc_values); + XPutImage(xDisplay, xImagePixmap, bitmap_gc, xImage, + 0, 0, 0, 0, xImage->width, xImage->height); + } else + XPutImage(xDisplay, xImagePixmap, xWinGc, xImage, + 0, 0, 0, 0, xImage->width, xImage->height); + XDestroyImage(xImage); + free(imageMemory); + } +} + +XtCallbackProc +SelectProc(w, unused_1, unused_2) + Widget w; + caddr_t unused_1; + caddr_t unused_2; +{ + XawListReturnStruct *list_return; + + list_return = XawListShowCurrent(w); + + switch (list_return->list_index) { + case ButtonQuit: + QuitProc(); + break; + case ButtonPreviousPage: + PreviousProc(); + break; + case ButtonNextPage: + NextProc(); + break; + default: + fprintf(stderr, "error in SelectProc\n"); + exit(0); + } + XawListUnhighlight(w); +} + +void +QuitProc(void) +{ + exit(0); +} + +void +NextProc() +{ + PageProc(ButtonNextPage); +} + +void +PreviousProc() +{ + PageProc(ButtonPreviousPage); +} + +void +PageProc(direction) + int direction; +{ + XEvent fake_event; + Arg args[4]; + + switch (direction) { + case ButtonPreviousPage: + if (tfDirectory > 0) + TIFFSetDirectory(tfFile, --tfDirectory); + else + return; + break; + case ButtonNextPage: + if (TIFFReadDirectory(tfFile) == True) + tfDirectory++; + else + return; + break; + default: + fprintf(stderr, "error in PageProc\n"); + exit(0); + } + + xOffset = yOffset = 0; + grabX = grabY = -1; + + GetTIFFHeader(); + SetNameLabel(); + GetTIFFImage(); + + if (appData.usePixmap == True) + XFreePixmap(xDisplay, xImagePixmap); + else + XDestroyImage(xImage); + + CreateXImage(); + + /* + * Using XtSetValues() to set the widget size causes a resize. + * This resize gets propagated up to the parent shell. + * In order to disable this visually disconcerting effect, + * shell resizing is temporarily disabled. + */ + XtSetArg(args[0], XtNallowShellResize, False); + XtSetValues(shellWidget, args, 1); + + XtSetArg(args[0], XtNwidth, tfImageWidth); + XtSetArg(args[1], XtNheight, tfImageHeight); + XtSetValues(imageWidget, args, 2); + + XtSetArg(args[0], XtNallowShellResize, True); + XtSetValues(shellWidget, args, 1); + + XClearWindow(xDisplay, XtWindow(imageWidget)); + + fake_event.type = Expose; + fake_event.xexpose.x = fake_event.xexpose.y = 0; + fake_event.xexpose.width = tfImageWidth; /* the window will clip */ + fake_event.xexpose.height = tfImageHeight; + EventProc(imageWidget, NULL, &fake_event); +} + +void +EventProc(widget, unused, event) + Widget widget; + caddr_t unused; + XEvent *event; +{ + int ih, iw, ww, wh, sx, sy, w, h, dx, dy; + Dimension w_width, w_height; + XEvent next_event; + Arg args[2]; + + if (event->type == MappingNotify) { + XRefreshKeyboardMapping((XMappingEvent *) event); + return; + } + + if (!XtIsRealized(widget)) + return; + + if ((event->type == ButtonPress) || (event->type == ButtonRelease)) + if (event->xbutton.button != Button1) + return; + + iw = tfImageWidth; /* avoid sign problems */ + ih = tfImageHeight; + + /* + * The grabX and grabY variables record where the user grabbed the image. + * They also record whether the mouse button is down or not. + */ + if (event->type == ButtonPress) { + grabX = event->xbutton.x; + grabY = event->xbutton.y; + return; + } + + /* + * imageWidget is a Core widget and doesn't get resized. + * So we calculate the size of its viewport here. + */ + XtSetArg(args[0], XtNwidth, &w_width); + XtSetArg(args[1], XtNheight, &w_height); + XtGetValues(shellWidget, args, 2); + ww = w_width; + wh = w_height; + XtGetValues(listWidget, args, 2); + wh -= w_height; + + switch (event->type) { + case Expose: + dx = event->xexpose.x; + dy = event->xexpose.y; + sx = dx + xOffset; + sy = dy + yOffset; + w = MIN(event->xexpose.width, iw); + h = MIN(event->xexpose.height, ih); + break; + case KeyPress: + if ((grabX >= 0) || (grabY >= 0)) /* Mouse button is still down */ + return; + switch (XLookupKeysym((XKeyEvent *) event, /* KeySyms index */ 0)) { + case XK_Up: + if (ih < wh) /* Don't scroll if the window fits the image. */ + return; + sy = yOffset + appData.translate; + sy = MIN(ih - wh, sy); + if (sy == yOffset) /* Filter redundant stationary refreshes. */ + return; + yOffset = sy; + sx = xOffset; + dx = dy = 0; + w = ww; h = wh; + break; + case XK_Down: + if (ih < wh) + return; + sy = yOffset - appData.translate; + sy = MAX(sy, 0); + if (sy == yOffset) + return; + yOffset = sy; + sx = xOffset; + dx = dy = 0; + w = ww; h = wh; + break; + case XK_Left: + if (iw < ww) + return; + sx = xOffset + appData.translate; + sx = MIN(iw - ww, sx); + if (sx == xOffset) + return; + xOffset = sx; + sy = yOffset; + dx = dy = 0; + w = ww; h = wh; + break; + case XK_Right: + if (iw < ww) + return; + sx = xOffset - appData.translate; + sx = MAX(sx, 0); + if (sx == xOffset) + return; + xOffset = sx; + sy = yOffset; + dx = dy = 0; + w = ww; h = wh; + break; + default: + return; + } + break; + case MotionNotify: + /* + * MotionEvent compression. Ignore multiple motion events. + * Ignore motion events if the mouse button is up. + */ + if (XPending(xDisplay)) /* Xlib doesn't flush the output buffer */ + if (XtPeekEvent(&next_event)) + if (next_event.type == MotionNotify) + return; + if ((grabX < 0) || (grabY < 0)) + return; + sx = xOffset + grabX - (int) event->xmotion.x; + if (sx >= (iw - ww)) /* clamp x motion but allow y motion */ + sx = iw - ww; + sx = MAX(sx, 0); + sy = yOffset + grabY - (int) event->xmotion.y; + if (sy >= (ih - wh)) /* clamp y motion but allow x motion */ + sy = ih - wh; + sy = MAX(sy, 0); + if ((sx == xOffset) && (sy == yOffset)) + return; + dx = dy = 0; + w = ww; h = wh; + break; + case ButtonRelease: + xOffset = xOffset + grabX - (int) event->xbutton.x; + xOffset = MIN(iw - ww, xOffset); + xOffset = MAX(xOffset, 0); + yOffset = yOffset + grabY - (int) event->xbutton.y; + yOffset = MIN(ih - wh, yOffset); + yOffset = MAX(yOffset, 0); + grabX = grabY = -1; + default: + return; + } + + if (appData.usePixmap == True) { + if (xImageDepth == 1) + XCopyPlane(xDisplay, xImagePixmap, XtWindow(widget), + xWinGc, sx, sy, w, h, dx, dy, 1); + else + XCopyArea(xDisplay, xImagePixmap, XtWindow(widget), + xWinGc, sx, sy, w, h, dx, dy); + } else + XPutImage(xDisplay, XtWindow(widget), xWinGc, xImage, + sx, sy, dx, dy, w, h); +} + +void +ResizeProc() +{ + Dimension w_width, w_height; + int xo, yo, ww, wh; + XEvent fake_event; + Arg args[2]; + + if ((xOffset == 0) && (yOffset == 0)) + return; + + XtSetArg(args[0], XtNwidth, &w_width); + XtSetArg(args[1], XtNheight, &w_height); + XtGetValues(shellWidget, args, 2); + ww = w_width; + wh = w_height; + XtGetValues(listWidget, args, 2); + wh -= w_height; + + xo = xOffset; yo = yOffset; + + if ((xOffset + ww) >= tfImageWidth) + xOffset = MAX((int) tfImageWidth - ww, 0); + if ((yOffset + wh) >= tfImageHeight) + yOffset = MAX((int) tfImageHeight - wh, 0); + + /* + * Send an ExposeEvent if the origin changed. + * We have to do this because of the use and semantics of bit gravity. + */ + if ((xo != xOffset) || (yo != yOffset)) { + fake_event.type = Expose; + fake_event.xexpose.x = fake_event.xexpose.y = 0; + fake_event.xexpose.width = tfImageWidth; + fake_event.xexpose.height = tfImageHeight; + EventProc(imageWidget, NULL, &fake_event); + } +} + +int +XTiffErrorHandler(display, error_event) + Display *display; + XErrorEvent *error_event; +{ + char message[80]; + + /* + * Some X servers limit the size of pixmaps. + */ + if ((error_event->error_code == BadAlloc) + && (error_event->request_code == X_CreatePixmap)) + fprintf(stderr, "xtiff: requested pixmap too big for display\n"); + else { + XGetErrorText(display, error_event->error_code, message, 80); + fprintf(stderr, "xtiff: error code %s\n", message); + } + + exit(0); +} + +void +Usage() +{ + fprintf(stderr, "Usage xtiff: [options] tiff-file\n"); + fprintf(stderr, "\tstandard Xt options\n"); + fprintf(stderr, "\t[-help]\n"); + fprintf(stderr, "\t[-gamma gamma]\n"); + fprintf(stderr, "\t[-usePixmap (True | False)]\n"); + fprintf(stderr, "\t[-viewportWidth pixels]\n"); + fprintf(stderr, "\t[-viewportHeight pixels]\n"); + fprintf(stderr, "\t[-translate pixels]\n"); + fprintf(stderr, "\t[-verbose (True | False)]\n"); + exit(0); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtifficon.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtifficon.h new file mode 100644 index 0000000..3eac48e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/dbs/xtiff/xtifficon.h @@ -0,0 +1,21 @@ +#define xtifficon_width 32 +#define xtifficon_height 32 +static char xtifficon_bits[] = { + 0xff, 0x00, 0x00, 0xc0, 0xfe, 0x01, 0x7e, 0xc0, 0xfc, 0x03, 0x7e, 0x60, + 0xf8, 0x07, 0x06, 0x30, 0xf8, 0x07, 0x1e, 0x18, 0xf0, 0x0f, 0x1e, 0x0c, + 0xe0, 0x1f, 0x06, 0x06, 0xc0, 0x3f, 0x06, 0x06, 0xc0, 0x3f, 0x06, 0x03, + 0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00, 0x00, 0xfe, 0x61, 0x00, + 0x00, 0xfe, 0x31, 0x7e, 0x7e, 0xfc, 0x33, 0x7e, 0x7e, 0xf8, 0x1b, 0x06, + 0x18, 0xf0, 0x0d, 0x1e, 0x18, 0xf0, 0x0e, 0x1e, 0x18, 0x60, 0x1f, 0x06, + 0x18, 0xb0, 0x3f, 0x06, 0x18, 0x98, 0x7f, 0x06, 0x18, 0x98, 0x7f, 0x00, + 0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01, 0x00, 0x63, 0xfc, 0x03, + 0x80, 0x61, 0xfc, 0x03, 0xc0, 0x60, 0xf8, 0x07, 0xc0, 0x60, 0xf0, 0x0f, + 0x60, 0x60, 0xe0, 0x1f, 0x30, 0x60, 0xe0, 0x1f, 0x18, 0x60, 0xc0, 0x3f, + 0x0c, 0x60, 0x80, 0x7f, 0x06, 0x00, 0x00, 0xff}; +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.am new file mode 100644 index 0000000..9caedf1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.am @@ -0,0 +1,36 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +EXTRA_DIST = README test.iptc test.txt + +noinst_PROGRAMS = iptcutil + +iptcutil_SOURCES = iptcutil.c +iptcutil_LDADD = $(LIBTIFF) + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.in new file mode 100644 index 0000000..eb4b82c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/Makefile.in @@ -0,0 +1,599 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = iptcutil$(EXEEXT) +subdir = contrib/iptcutil +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_iptcutil_OBJECTS = iptcutil.$(OBJEXT) +iptcutil_OBJECTS = $(am_iptcutil_OBJECTS) +iptcutil_DEPENDENCIES = $(LIBTIFF) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(iptcutil_SOURCES) +DIST_SOURCES = $(iptcutil_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +EXTRA_DIST = README test.iptc test.txt +iptcutil_SOURCES = iptcutil.c +iptcutil_LDADD = $(LIBTIFF) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/iptcutil/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/iptcutil/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +iptcutil$(EXEEXT): $(iptcutil_OBJECTS) $(iptcutil_DEPENDENCIES) $(EXTRA_iptcutil_DEPENDENCIES) + @rm -f iptcutil$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(iptcutil_OBJECTS) $(iptcutil_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptcutil.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/README new file mode 100644 index 0000000..1619ef4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/README @@ -0,0 +1,25 @@ + +Program: IPTCUTIL.C + +Purpose: Convert between IPTC binary and a "special" IPTC text file format. + +Usage: iptcutil -t | -b [-i file] [-o file] output + +Notes: You tell the program the "type" of input file via the -t and -b + switches. The -t says that the input is text, while the -b says + that the input is binary IPTC. You can use either the -i or the + -o switches to tell the program what the input and output files + will be, or use simple piping. + +Author: William T. Radcliffe (billr@corbis.com) + Parts of this program were derived from other places. The original + binary to text conversion was taken from the PHP distribution and + the tokenizer was written many years ago, by someone else as well. + +This software is provided freely "as is", without warranty of any kind, +express or implied, including but not limited to the warranties of +merchantability, fitness for a particular purpose and noninfringement. +In no event shall William T. Radcliffe be liable for any claim, damages or +other liability, whether in an action of contract, tort or otherwise, +arising from, out of or in connection with IPTCUTIL + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/iptcutil.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/iptcutil.c new file mode 100644 index 0000000..eaee188 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/iptcutil.c @@ -0,0 +1,943 @@ +/* $Id: iptcutil.c,v 1.8 2011-05-08 00:44:18 fwarmerdam Exp $ */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_STRINGS_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef WIN32 +#define STRNICMP strnicmp +#else +#define STRNICMP strncasecmp +#endif + +typedef struct _tag_spec +{ + short + id; + + char + *name; +} tag_spec; + +static tag_spec tags[] = { + { 5,"Image Name" }, + { 7,"Edit Status" }, + { 10,"Priority" }, + { 15,"Category" }, + { 20,"Supplemental Category" }, + { 22,"Fixture Identifier" }, + { 25,"Keyword" }, + { 30,"Release Date" }, + { 35,"Release Time" }, + { 40,"Special Instructions" }, + { 45,"Reference Service" }, + { 47,"Reference Date" }, + { 50,"Reference Number" }, + { 55,"Created Date" }, + { 60,"Created Time" }, + { 65,"Originating Program" }, + { 70,"Program Version" }, + { 75,"Object Cycle" }, + { 80,"Byline" }, + { 85,"Byline Title" }, + { 90,"City" }, + { 95,"Province State" }, + { 100,"Country Code" }, + { 101,"Country" }, + { 103,"Original Transmission Reference" }, + { 105,"Headline" }, + { 110,"Credit" }, + { 115,"Source" }, + { 116,"Copyright String" }, + { 120,"Caption" }, + { 121,"Local Caption" }, + { 122,"Caption Writer" }, + { 200,"Custom Field 1" }, + { 201,"Custom Field 2" }, + { 202,"Custom Field 3" }, + { 203,"Custom Field 4" }, + { 204,"Custom Field 5" }, + { 205,"Custom Field 6" }, + { 206,"Custom Field 7" }, + { 207,"Custom Field 8" }, + { 208,"Custom Field 9" }, + { 209,"Custom Field 10" }, + { 210,"Custom Field 11" }, + { 211,"Custom Field 12" }, + { 212,"Custom Field 13" }, + { 213,"Custom Field 14" }, + { 214,"Custom Field 15" }, + { 215,"Custom Field 16" }, + { 216,"Custom Field 17" }, + { 217,"Custom Field 18" }, + { 218,"Custom Field 19" }, + { 219,"Custom Field 20" } +}; + +/* + * We format the output using HTML conventions + * to preserve control characters and such. + */ +void formatString(FILE *ofile, const char *s, int len) +{ + putc('"', ofile); + for (; len > 0; --len, ++s) { + int c = *s; + switch (c) { + case '&': + fputs("&", ofile); + break; +#ifdef HANDLE_GT_LT + case '<': + fputs("<", ofile); + break; + case '>': + fputs(">", ofile); + break; +#endif + case '"': + fputs(""", ofile); + break; + default: + if (iscntrl(c)) + fprintf(ofile, "&#%d;", c); + else + putc(*s, ofile); + break; + } + } + fputs("\"\n", ofile); +} + +typedef struct _html_code +{ + short + len; + const char + *code, + val; +} html_code; + +static html_code html_codes[] = { +#ifdef HANDLE_GT_LT + { 4,"<",'<' }, + { 4,">",'>' }, +#endif + { 5,"&",'&' }, + { 6,""",'"' } +}; + +/* + * This routine converts HTML escape sequence + * back to the original ASCII representation. + * - returns the number of characters dropped. + */ +int convertHTMLcodes(char *s, int len) +{ + if (len <=0 || s==(char*)NULL || *s=='\0') + return 0; + + if (s[1] == '#') + { + int val, o; + + if (sscanf(s,"&#%d;",&val) == 1) + { + o = 3; + while (s[o] != ';') + { + o++; + if (o > 5) + break; + } + if (o < 5) + strcpy(s+1, s+1+o); + *s = val; + return o; + } + } + else + { + int + i, + codes = sizeof(html_codes) / sizeof(html_code); + + for (i=0; i < codes; i++) + { + if (html_codes[i].len <= len) + if (STRNICMP(s, html_codes[i].code, html_codes[i].len) == 0) + { + strcpy(s+1, s+html_codes[i].len); + *s = html_codes[i].val; + return html_codes[i].len-1; + } + } + } + + return 0; +} + +int formatIPTC(FILE *ifile, FILE *ofile) +{ + unsigned int + foundiptc, + tagsfound; + + unsigned char + recnum, + dataset; + + char + *readable, + *str; + + long + tagindx, + taglen; + + int + i, + tagcount = sizeof(tags) / sizeof(tag_spec); + + char + c; + + foundiptc = 0; /* found the IPTC-Header */ + tagsfound = 0; /* number of tags found */ + + c = getc(ifile); + while (c != EOF) + { + if (c == 0x1c) + foundiptc = 1; + else + { + if (foundiptc) + return -1; + else + continue; + } + + /* we found the 0x1c tag and now grab the dataset and record number tags */ + dataset = getc(ifile); + if ((char) dataset == EOF) + return -1; + recnum = getc(ifile); + if ((char) recnum == EOF) + return -1; + /* try to match this record to one of the ones in our named table */ + for (i=0; i< tagcount; i++) + { + if (tags[i].id == recnum) + break; + } + if (i < tagcount) + readable = tags[i].name; + else + readable = ""; + + /* then we decode the length of the block that follows - long or short fmt */ + c = getc(ifile); + if (c == EOF) + return 0; + if (c & (unsigned char) 0x80) + { + unsigned char + buffer[4]; + + for (i=0; i<4; i++) + { + c = buffer[i] = getc(ifile); + if (c == EOF) + return -1; + } + taglen = (((long) buffer[ 0 ]) << 24) | + (((long) buffer[ 1 ]) << 16) | + (((long) buffer[ 2 ]) << 8) | + (((long) buffer[ 3 ])); + } + else + { + unsigned char + x = c; + + taglen = ((long) x) << 8; + x = getc(ifile); + if ((char)x == EOF) + return -1; + taglen |= (long) x; + } + /* make a buffer to hold the tag data and snag it from the input stream */ + str = (char *) malloc((unsigned int) (taglen+1)); + if (str == (char *) NULL) + { + printf("Memory allocation failed"); + return 0; + } + for (tagindx=0; tagindx 0) + fprintf(ofile, "%d#%d#%s=",(unsigned int)dataset, (unsigned int) recnum, readable); + else + fprintf(ofile, "%d#%d=",(unsigned int)dataset, (unsigned int) recnum); + formatString( ofile, str, taglen ); + free(str); + + tagsfound++; + + c = getc(ifile); + } + return tagsfound; +} + +int tokenizer(unsigned inflag,char *token,int tokmax,char *line, +char *white,char *brkchar,char *quote,char eschar,char *brkused, +int *next,char *quoted); + +char *super_fgets(char *b, int *blen, FILE *file) +{ + int + c, + len; + + char + *q; + + len=*blen; + for (q=b; ; q++) + { + c=fgetc(file); + if (c == EOF || c == '\n') + break; + if (((long)q - (long)b + 1 ) >= (long) len) + { + long + tlen; + + tlen=(long)q-(long)b; + len<<=1; + b=(char *) realloc((char *) b,(len+2)); + if ((char *) b == (char *) NULL) + break; + q=b+tlen; + } + *q=(unsigned char) c; + } + *blen=0; + if ((unsigned char *)b != (unsigned char *) NULL) + { + int + tlen; + + tlen=(long)q - (long)b; + if (tlen == 0) + return (char *) NULL; + b[tlen] = '\0'; + *blen=++tlen; + } + return b; +} + +#define BUFFER_SZ 4096 + +int main(int argc, char *argv[]) +{ + unsigned int + length; + + unsigned char + *buffer; + + int + i, + mode; /* iptc binary, or iptc text */ + + FILE + *ifile = stdin, + *ofile = stdout; + + char + c, + *usage = "usage: iptcutil -t | -b [-i file] [-o file] output"; + + if( argc < 2 ) + { + puts(usage); + return 1; + } + + mode = 0; + length = -1; + buffer = (unsigned char *)NULL; + + for (i=1; i 0) + { + char + *s = &token[next-1]; + + len -= convertHTMLcodes(s, strlen(s)); + } + } + + fputc(0x1c, ofile); + fputc(dataset, ofile); + fputc(recnum, ofile); + if (len < 0x10000) + { + fputc((len >> 8) & 255, ofile); + fputc(len & 255, ofile); + } + else + { + fputc(((len >> 24) & 255) | 0x80, ofile); + fputc((len >> 16) & 255, ofile); + fputc((len >> 8) & 255, ofile); + fputc(len & 255, ofile); + } + next=0; + while (len--) + fputc(token[next++], ofile); + } + state++; + } + free(token); + token = (char *)NULL; + free(newstr); + newstr = (char *)NULL; + } + free(line); + + fclose( ifile ); + fclose( ofile ); + } + + return 0; +} + +/* + This routine is a generalized, finite state token parser. It allows + you extract tokens one at a time from a string of characters. The + characters used for white space, for break characters, and for quotes + can be specified. Also, characters in the string can be preceded by + a specifiable escape character which removes any special meaning the + character may have. + + There are a lot of formal parameters in this subroutine call, but + once you get familiar with them, this routine is fairly easy to use. + "#define" macros can be used to generate simpler looking calls for + commonly used applications of this routine. + + First, some terminology: + + token: used here, a single unit of information in + the form of a group of characters. + + white space: space that gets ignored (except within quotes + or when escaped), like blanks and tabs. in + addition, white space terminates a non-quoted + token. + + break character: a character that separates non-quoted tokens. + commas are a common break character. the + usage of break characters to signal the end + of a token is the same as that of white space, + except multiple break characters with nothing + or only white space between generate a null + token for each two break characters together. + + for example, if blank is set to be the white + space and comma is set to be the break + character, the line ... + + A, B, C , , DEF + + ... consists of 5 tokens: + + 1) "A" + 2) "B" + 3) "C" + 4) "" (the null string) + 5) "DEF" + + quote character: a character that, when surrounding a group + of other characters, causes the group of + characters to be treated as a single token, + no matter how many white spaces or break + characters exist in the group. also, a + token always terminates after the closing + quote. for example, if ' is the quote + character, blank is white space, and comma + is the break character, the following + string ... + + A, ' B, CD'EF GHI + + ... consists of 4 tokens: + + 1) "A" + 2) " B, CD" (note the blanks & comma) + 3) "EF" + 4) "GHI" + + the quote characters themselves do + not appear in the resultant tokens. the + double quotes are delimiters i use here for + documentation purposes only. + + escape character: a character which itself is ignored but + which causes the next character to be + used as is. ^ and \ are often used as + escape characters. an escape in the last + position of the string gets treated as a + "normal" (i.e., non-quote, non-white, + non-break, and non-escape) character. + for example, assume white space, break + character, and quote are the same as in the + above examples, and further, assume that + ^ is the escape character. then, in the + string ... + + ABC, ' DEF ^' GH' I ^ J K^ L ^ + + ... there are 7 tokens: + + 1) "ABC" + 2) " DEF ' GH" + 3) "I" + 4) " " (a lone blank) + 5) "J" + 6) "K L" + 7) "^" (passed as is at end of line) + + + OK, now that you have this background, here's how to call "tokenizer": + + result=tokenizer(flag,token,maxtok,string,white,break,quote,escape, + brkused,next,quoted) + + result: 0 if we haven't reached EOS (end of string), and + 1 if we have (this is an "int"). + + flag: right now, only the low order 3 bits are used. + 1 => convert non-quoted tokens to upper case + 2 => convert non-quoted tokens to lower case + 0 => do not convert non-quoted tokens + (this is a "char"). + + token: a character string containing the returned next token + (this is a "char[]"). + + maxtok: the maximum size of "token". characters beyond + "maxtok" are truncated (this is an "int"). + + string: the string to be parsed (this is a "char[]"). + + white: a string of the valid white spaces. example: + + char whitesp[]={" \t"}; + + blank and tab will be valid white space (this is + a "char[]"). + + break: a string of the valid break characters. example: + + char breakch[]={";,"}; + + semicolon and comma will be valid break characters + (this is a "char[]"). + + IMPORTANT: do not use the name "break" as a C + variable, as this is a reserved word in C. + + quote: a string of the valid quote characters. an example + would be + + char whitesp[]={"'\""); + + (this causes single and double quotes to be valid) + note that a token starting with one of these characters + needs the same quote character to terminate it. + + for example, + + "ABC ' + + is unterminated, but + + "DEF" and 'GHI' + + are properly terminated. note that different quote + characters can appear on the same line; only for + a given token do the quote characters have to be + the same (this is a "char[]"). + + escape: the escape character (NOT a string ... only one + allowed). use zero if none is desired (this is + a "char"). + + brkused: the break character used to terminate the current + token. if the token was quoted, this will be the + quote used. if the token is the last one on the + line, this will be zero (this is a pointer to a + "char"). + + next: this variable points to the first character of the + next token. it gets reset by "tokenizer" as it steps + through the string. set it to 0 upon initialization, + and leave it alone after that. you can change it + if you want to jump around in the string or re-parse + from the beginning, but be careful (this is a + pointer to an "int"). + + quoted: set to 1 (true) if the token was quoted and 0 (false) + if not. you may need this information (for example: + in C, a string with quotes around it is a character + string, while one without is an identifier). + + (this is a pointer to a "char"). +*/ + +/* states */ + +#define IN_WHITE 0 +#define IN_TOKEN 1 +#define IN_QUOTE 2 +#define IN_OZONE 3 + +int _p_state; /* current state */ +unsigned _p_flag; /* option flag */ +char _p_curquote; /* current quote char */ +int _p_tokpos; /* current token pos */ + +/* routine to find character in string ... used only by "tokenizer" */ + +int sindex(char ch,char *string) +{ + char *cp; + for(cp=string;*cp;++cp) + if(ch==*cp) + return (int)(cp-string); /* return postion of character */ + return -1; /* eol ... no match found */ +} + +/* routine to store a character in a string ... used only by "tokenizer" */ + +void chstore(char *string,int max,char ch) +{ + char c; + if(_p_tokpos>=0&&_p_tokpos=0) /* break */ + { + switch(_p_state) + { + case IN_WHITE: /* these are the same here ... */ + case IN_TOKEN: /* ... just get out */ + case IN_OZONE: /* ditto */ + ++(*next); + *brkused=brkchar[qp]; + goto byebye; + + case IN_QUOTE: /* just keep going */ + chstore(token,tokmax,c); + break; + } + } + else if((qp=sindex(c,quote))>=0) /* quote */ + { + switch(_p_state) + { + case IN_WHITE: /* these are identical, */ + _p_state=IN_QUOTE; /* change states */ + _p_curquote=quote[qp]; /* save quote char */ + *quoted=1; /* set to true as long as something is in quotes */ + break; + + case IN_QUOTE: + if(quote[qp]==_p_curquote) /* same as the beginning quote? */ + { + _p_state=IN_OZONE; + _p_curquote=0; + } + else + chstore(token,tokmax,c); /* treat as regular char */ + break; + + case IN_TOKEN: + case IN_OZONE: + *brkused=c; /* uses quote as break char */ + goto byebye; + } + } + else if((qp=sindex(c,white))>=0) /* white */ + { + switch(_p_state) + { + case IN_WHITE: + case IN_OZONE: + break; /* keep going */ + + case IN_TOKEN: + _p_state=IN_OZONE; + break; + + case IN_QUOTE: + chstore(token,tokmax,c); /* it's valid here */ + break; + } + } + else if(c==eschar) /* escape */ + { + nc=line[(*next)+1]; + if(nc==0) /* end of line */ + { + *brkused=0; + chstore(token,tokmax,c); + ++(*next); + goto byebye; + } + switch(_p_state) + { + case IN_WHITE: + --(*next); + _p_state=IN_TOKEN; + break; + + case IN_TOKEN: + case IN_QUOTE: + ++(*next); + chstore(token,tokmax,nc); + break; + + case IN_OZONE: + goto byebye; + } + } + else /* anything else is just a real character */ + { + switch(_p_state) + { + case IN_WHITE: + _p_state=IN_TOKEN; /* switch states */ + + case IN_TOKEN: /* these 2 are */ + case IN_QUOTE: /* identical here */ + chstore(token,tokmax,c); + break; + + case IN_OZONE: + goto byebye; + } + } + } /* end of main loop */ + +byebye: + token[_p_tokpos]=0; /* make sure token ends with EOS */ + + return 0; +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.iptc b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.iptc new file mode 100644 index 0000000..a260562 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.iptc differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.txt b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.txt new file mode 100644 index 0000000..d518100 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/iptcutil/test.txt @@ -0,0 +1,32 @@ +2#0="�" +2#120#Caption="Chairman of the US House Judiciary Committee, Henry Hyde,R-IL, makes his opening statement during impeachment hearings 11 December on Capitol Hill in Washington, DC. The committee is debating the articles of impechment and my take a vote on the impeachment of US President BIll Clinton on charges that he obstucted justice, lied and abused the power of his office as early as today. AFP PHOTO Paul J. RICHARDS " +2#122#Caption Writer="kb/lt" +2#100#Country Code="USA" +2#105#Headline="Old fart squeezing two fingers." +2#30#Release Date="19981211" +2#35#Release Time="000000+0000" +2#40#Special Instructions="This is a test. This is only a test. ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890" +2#80#Byline="PAUL J. RICHARDS" +2#85#Byline Title="STF" +2#110#Credit="AFP" +2#65#Originating Program="MacDesk Reporter" +2#115#Source="AFP" +2#5#Image Name="US-HYDE" +2#55#Created Date="19981211" +2#90#City="WASHINGTON" +2#95#Province State="DC" +2#101#Country="UNITED STATES" +2#103#Original Transmission Reference="DCA03" +2#15#Category="POL" +2#20#Supplemental Category="GOVERNMENT" +2#10#Priority="5" +2#25#Keyword="fart" +2#25#Keyword="squeezing" +2#25#Keyword="old" +2#25#Keyword="fingers" +2#75#Object Cycle="a" +2#60#Created Time="000000+0000" +2#70#Program Version="2.0.3" +2#130="3S" +2#135="GB" +2#231="Kaya A. Hoffmann 12/14/98 12:00:44 PM Copy To : Selects - \\KINYANI\Selects������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������" diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.am new file mode 100644 index 0000000..fb8a07e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README mfs_file.c + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.in new file mode 100644 index 0000000..37ac4c2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/mfs +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README mfs_file.c +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/mfs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/mfs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/README new file mode 100644 index 0000000..6f9befb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/README @@ -0,0 +1,37 @@ +Date: Mon, 23 Jun 1997 13:30:48 +0200 +To: + +From: "Mike Johnson" +Subject: libtiff - Thanks + +Return-Path: mikehunt@swipnet.se +Delivery-Date: Mon, 23 Jun 1997 06:53:39 -0700 + +Hi Sam, + +I noticed in the README from libtiff that you would like to know about +what people have done with libtiff, so I thought I would drop you a +line. + +We have used libtiff to create and convert TIFF images of financial +documents which are sent from and to major document processing systems +in Sweden and Denmark. + +I would like to express my deep gratitude to yourself and Sillicon +Graphics for making this excellent library available for public use. +There is obviously a lot of work that has gone in to libtiff and the +quality of the code and documentation is an example to others. + +One thing that libtiff did not do was work on a memory area rather than +files. In my applications I had already read a TIFF or other format +file in to memory and did not want to waste I/O writing it out again +for libtiff's benefit. I therefore constructed a set of functions to +pass up to TIFFClientOpen to simulate a file in memory. I have attached +my mfs (memory file system) source code for you to use or junk, as you +see fit. :-) + +Once again, thanks very much for making my life simpler. + +Best Regards, + +Mike Johnson. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/mfs_file.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/mfs_file.c new file mode 100644 index 0000000..6675e2a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/mfs/mfs_file.c @@ -0,0 +1,586 @@ +/* +-------------------------------------------------------------------------------- +- Module : mem_file.c +- Description : A general purpose library for manipulating a memory area +- as if it were a file. +- mfs_ stands for memory file system. +- Author : Mike Johnson - Banctec AB 03/07/96 +- +-------------------------------------------------------------------------------- +*/ + +/* + +Copyright (c) 1996 Mike Johnson +Copyright (c) 1996 BancTec AB + +Permission to use, copy, modify, distribute, and sell this software +for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Mike Johnson and BancTec may not be used in any advertising or +publicity relating to the software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL MIKE JOHNSON OR BANCTEC BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + +*/ + + +/* +-------------------------------------------------------------------------------- +- Includes +-------------------------------------------------------------------------------- +*/ + +#include +#include +#include + +/* +-------------------------------------------------------------------------------- +- Definitions +-------------------------------------------------------------------------------- +*/ + +#define MAX_BUFFS 20 +#define FALSE 0 +#define TRUE 1 + +/* +-------------------------------------------------------------------------------- +- Globals +-------------------------------------------------------------------------------- +*/ + +static char *buf[MAX_BUFFS]; /* Memory for each open buf */ +static long buf_off[MAX_BUFFS]; /* File pointer for each buf */ +static long buf_size[MAX_BUFFS]; /* Count of bytes allocated for each buf */ +static long fds[MAX_BUFFS]; /* File descriptor status */ +static int buf_mode[MAX_BUFFS]; /* Mode of buffer (r, w, a) */ + +static int library_init_done = FALSE; + + +/* +-------------------------------------------------------------------------------- +- Function prototypes +-------------------------------------------------------------------------------- +*/ + +int mfs_open (void *ptr, int size, char *mode); +int mfs_lseek (int fd, int offset, int whence); +int mfs_read (int fd, void *buf, int size); +int mfs_write (int fd, void *buf, int size); +int mfs_size (int fd); +int mfs_map (int fd, char **addr, size_t *len); +int mfs_unmap (int fd); +int mfs_close (int fd); +static int extend_mem_file (int fd, int size); +static void mem_init (); + +/* +-------------------------------------------------------------------------------- +- Function code +-------------------------------------------------------------------------------- +*/ + +/* +-------------------------------------------------------------------------------- +- Function : mfs_open () +- +- Arguments : Pointer to allocated buffer, initial size of buffer, +- mode spec (r, w, a) +- +- Returns : File descriptor or -1 if error. +- +- Description : Register this area of memory (which has been allocated +- and has a file read into it) under the mem_file library. +- A file descriptor is returned which can the be passed +- back to TIFFClientOpen and used as if it was a disk +- based fd. +- If the call is for mode 'w' then pass (void *)NULL as +- the buffer and zero size and the library will +- allocate memory for you. +- If the mode is append then pass (void *)NULL and size +- zero or with a valid address. +- +-------------------------------------------------------------------------------- +*/ + +int mfs_open (void *buffer, int size, char *mode) +{ + int ret, i; + void *tmp; + + if (library_init_done == FALSE) + { + mem_init (); + library_init_done = TRUE; + } + + ret = -1; + + /* Find a free fd */ + + for (i = 0; i < MAX_BUFFS; i++) + { + if (fds[i] == -1) + { + ret = i; + break; + } + } + + if (i == MAX_BUFFS) /* No more free descriptors */ + { + ret = -1; + errno = EMFILE; + } + + if (ret >= 0 && *mode == 'r') + { + if (buffer == (void *)NULL) + { + ret = -1; + errno = EINVAL; + } + else + { + buf[ret] = (char *)buffer; + buf_size[ret] = size; + buf_off[ret] = 0; + } + } + else if (ret >= 0 && *mode == 'w') + { + + if (buffer != (void *)NULL) + { + ret = -1; + errno = EINVAL; + } + + else + { + tmp = malloc (0); /* Get a pointer */ + if (tmp == (void *)NULL) + { + ret = -1; + errno = EDQUOT; + } + else + { + buf[ret] = (char *)tmp; + buf_size[ret] = 0; + buf_off[ret] = 0; + } + } + } + else if (ret >= 0 && *mode == 'a') + { + if (buffer == (void *) NULL) /* Create space for client */ + { + tmp = malloc (0); /* Get a pointer */ + if (tmp == (void *)NULL) + { + ret = -1; + errno = EDQUOT; + } + else + { + buf[ret] = (char *)tmp; + buf_size[ret] = 0; + buf_off[ret] = 0; + } + } + else /* Client has file read in already */ + { + buf[ret] = (char *)buffer; + buf_size[ret] = size; + buf_off[ret] = 0; + } + } + else /* Some other invalid combination of parameters */ + { + ret = -1; + errno = EINVAL; + } + + if (ret != -1) + { + fds[ret] = 0; + buf_mode[ret] = *mode; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_lseek () +- +- Arguments : File descriptor, offset, whence +- +- Returns : as per man lseek (2) +- +- Description : Does the same as lseek (2) except on a memory based file. +- Note: the memory area will be extended if the caller +- attempts to seek past the current end of file (memory). +- +-------------------------------------------------------------------------------- +*/ + +int mfs_lseek (int fd, int offset, int whence) +{ + int ret; + long test_off; + + if (fds[fd] == -1) /* Not open */ + { + ret = -1; + errno = EBADF; + } + else if (offset < 0 && whence == SEEK_SET) + { + ret = -1; + errno = EINVAL; + } + else + { + switch (whence) + { + case SEEK_SET: + if (offset > buf_size[fd]) + extend_mem_file (fd, offset); + buf_off[fd] = offset; + ret = offset; + break; + + case SEEK_CUR: + test_off = buf_off[fd] + offset; + + if (test_off < 0) + { + ret = -1; + errno = EINVAL; + } + else + { + if (test_off > buf_size[fd]) + extend_mem_file (fd, test_off); + buf_off[fd] = test_off; + ret = test_off; + } + break; + + case SEEK_END: + test_off = buf_size[fd] + offset; + + if (test_off < 0) + { + ret = -1; + errno = EINVAL; + } + else + { + if (test_off > buf_size[fd]) + extend_mem_file (fd, test_off); + buf_off[fd] = test_off; + ret = test_off; + } + break; + + default: + errno = EINVAL; + ret = -1; + break; + } + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_read () +- +- Arguments : File descriptor, buffer, size +- +- Returns : as per man read (2) +- +- Description : Does the same as read (2) except on a memory based file. +- Note: An attempt to read past the end of memory currently +- allocated to the file will return 0 (End Of File) +- +-------------------------------------------------------------------------------- +*/ + +int mfs_read (int fd, void *clnt_buf, int size) +{ + int ret; + + if (fds[fd] == -1 || buf_mode[fd] != 'r') + { + /* File is either not open, or not opened for read */ + + ret = -1; + errno = EBADF; + } + else if (buf_off[fd] + size > buf_size[fd]) + { + ret = 0; /* EOF */ + } + else + { + memcpy (clnt_buf, (void *) (buf[fd] + buf_off[fd]), size); + buf_off[fd] = buf_off[fd] + size; + ret = size; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_write () +- +- Arguments : File descriptor, buffer, size +- +- Returns : as per man write (2) +- +- Description : Does the same as write (2) except on a memory based file. +- Note: the memory area will be extended if the caller +- attempts to write past the current end of file (memory). +- +-------------------------------------------------------------------------------- +*/ + +int mfs_write (int fd, void *clnt_buf, int size) +{ + int ret; + + if (fds[fd] == -1 || buf_mode[fd] == 'r') + { + /* Either the file is not open or it is opened for reading only */ + + ret = -1; + errno = EBADF; + } + else if (buf_mode[fd] == 'w') + { + /* Write */ + + if (buf_off[fd] + size > buf_size[fd]) + { + extend_mem_file (fd, buf_off[fd] + size); + buf_size[fd] = (buf_off[fd] + size); + } + + memcpy ((buf[fd] + buf_off[fd]), clnt_buf, size); + buf_off[fd] = buf_off[fd] + size; + + ret = size; + } + else + { + /* Append */ + + if (buf_off[fd] != buf_size[fd]) + buf_off[fd] = buf_size[fd]; + + extend_mem_file (fd, buf_off[fd] + size); + buf_size[fd] += size; + + memcpy ((buf[fd] + buf_off[fd]), clnt_buf, size); + buf_off[fd] = buf_off[fd] + size; + + ret = size; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_size () +- +- Arguments : File descriptor +- +- Returns : integer file size +- +- Description : This function returns the current size of the file in bytes. +- +-------------------------------------------------------------------------------- +*/ + +int mfs_size (int fd) +{ + int ret; + + if (fds[fd] == -1) /* Not open */ + { + ret = -1; + errno = EBADF; + } + else + ret = buf_size[fd]; + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_map () +- +- Arguments : File descriptor, ptr to address, ptr to length +- +- Returns : Map status (succeeded or otherwise) +- +- Description : This function tells the client where the file is mapped +- in memory and what size the mapped area is. It is provided +- to satisfy the MapProc function in libtiff. It pretends +- that the file has been mmap (2)ped. +- +-------------------------------------------------------------------------------- +*/ + +int mfs_map (int fd, char **addr, size_t *len) +{ + int ret; + + if (fds[fd] == -1) /* Not open */ + { + ret = -1; + errno = EBADF; + } + else + { + *addr = buf[fd]; + *len = buf_size[fd]; + ret = 0; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_unmap () +- +- Arguments : File descriptor +- +- Returns : UnMap status (succeeded or otherwise) +- +- Description : This function does nothing as the file is always +- in memory. +- +-------------------------------------------------------------------------------- +*/ + +int mfs_unmap (int fd) +{ + return (0); +} + +/* +-------------------------------------------------------------------------------- +- Function : mfs_close () +- +- Arguments : File descriptor +- +- Returns : close status (succeeded or otherwise) +- +- Description : Close the open memory file. (Make fd available again.) +- +-------------------------------------------------------------------------------- +*/ + +int mfs_close (int fd) +{ + int ret; + + if (fds[fd] == -1) /* Not open */ + { + ret = -1; + errno = EBADF; + } + else + { + fds[fd] = -1; + ret = 0; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : extend_mem_file () +- +- Arguments : File descriptor, length to extend to. +- +- Returns : 0 - All OK, -1 - realloc () failed. +- +- Description : Increase the amount of memory allocated to a file. +- +-------------------------------------------------------------------------------- +*/ + +static int extend_mem_file (int fd, int size) +{ + void *new_mem; + int ret; + + if ((new_mem = realloc (buf[fd], size)) == (void *) NULL) + ret = -1; + else + { + buf[fd] = (char *) new_mem; + ret = 0; + } + + return (ret); +} + +/* +-------------------------------------------------------------------------------- +- Function : mem_init () +- +- Arguments : None +- +- Returns : void +- +- Description : Initialise the library. +- +-------------------------------------------------------------------------------- +*/ + +static void mem_init () +{ + int i; + + for (i = 0; i < MAX_BUFFS; i++) + { + fds[i] = -1; + buf[i] = (char *)NULL; + buf_size[i] = 0; + buf_off[i] = 0; + } +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.am new file mode 100644 index 0000000..b3c145d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README tif_imageiter.c tif_imageiter.h tif_pdsdirread.c tif_pdsdirwrite.c + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.in new file mode 100644 index 0000000..ddcab31 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/pds +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README tif_imageiter.c tif_imageiter.h tif_pdsdirread.c tif_pdsdirwrite.c +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/pds/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/pds/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/README new file mode 100644 index 0000000..b9abc6b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/README @@ -0,0 +1,90 @@ +Date: Fri, 01 Aug 1997 20:14:52 MDT +To: Sam Leffler + +From: "Conrad J. Poelman (WSAT)" +Subject: Potential TIFF library additions + +Delivery-Date: Fri, 01 Aug 1997 19:21:06 -0700 + +Sam, + +You probably don't remember me, but I sent in a couple of bug fixes +regarding the TIFF library about a 16 months ago or so... + +I just wanted to send you two other additions that I have made to our +local version of the TIFF library in hopes that you will want to +incorporate them into your next major release of the TIFF library. +(These additions are based on TIFF version 3.4beta31, but they sit on +top of the library so they shouldn't be much trouble to incorporate them +into any more recent version.) They are internally documented to a +reasonable extent and we've been successfully using them in our code +here for over a year. If you think they would make good additions to the +TIFF library, I'd be happy to clean them up more, document them more, +and/or integrate them with the latest version of the TIFF library, but I +figured I'd see if you were interested in using them before I went to +all that trouble. + +TIFF Image Iterator +------------------- +Your ReadRGBA() routine works well for reading many different formats +(TILED, STIP, compressed or not, etc.) of the most basic types of data +(RGB, 8-bit greyscale, 8-bit colormapped) into an SGI-style data array, +and serves as a good template for users with other needs. I used it as +an exmaple of how to make an iterator which, rather than fill a data +array, calls an arbitrary user-supplied callback function for each +"chunk" of data - that "chunk" might be a strip or a tile, and might +have one sample-per-pixel or two, and might be 8-bit data or 16-bit or +24-bit. The callback function can do whatever it wants with the data - +store it in a big array, convert it to RGBA, or draw it directly to the +screen. I was able to use this iterator to read 16-bit greyscale and 32- +and 64-bit floating point data, which wasn't possible with ReadRGBA(). + +I have tested this routine with 8- and 16-bit greyscale data as well as +with 32- and 64-bit floating point data. I believe nearly all of our +data is organized in strips, so actually I'd appreciate it if you had +some tiled images that I could test it with. + +It should certainly be possible and would be cleanest to reimplement +ReadRGBA() in terms of the image iterator, but I haven't done that. + + +Private Sub-Directory Read/Write +-------------------------------- +TIFF-PL is a Phillips Laboratory extension to the TIFF tags that allows +us to store satellite imaging-specific information in a TIFF format, +such as the satellite's trajectory, the imaging time, etc. In order to +give us the flexibility to modify the tag definitions without getting +approval from the TIFF committee every time, we were given only three +TIFF tags - a PL signature, a PL version number, and PL directory +offset, which lists the position in the file at which to find a private +sub-directory of tags-value pairs. So I wrote two routines: +TIFFWritePrivateDataSubDirectory(), which takes a list of tags and a +"get" function and writes the tag values into the TIFF file, returning +the offset within the file at which it wrote the directory; and +TIFFReadPrivateDataSubDirectory(), which takes an offset, a list of +tags, and a "set" function and reads all the data from the private +directory. The functions themselves are pretty simple. (The files are +huge because I had to basically copy all of the tif_dirread.c and +tif_dirwrite.c files in order to access the various fetching routines +which were all declared static and therefore inaccessible in the TIFF +library.) + + +I'm including the four source files (tif_imgiter.h, tif_imgiter.c, +tif_pdsdirread.c, tif_pdsdirwrite.c) in case you want to take a look at +them. I can also send you some sample code that uses them if you like. +If you're interested in having them incorporated into the standard TIFF +library, I'd be happy to do that integration and clean up and document +the routines. (For example, I've already realized that instead of +limiting the SEP callback function to three bands (R,G,B) it should take +an array to enable the handling of n-banded multi-spectral data...) If +not, I'll just leave them as they are, since they work fine for us now. + +Holler if you have any questions. + +-- Conrad +__________________________________________________________________ + Capt Conrad J. Poelman PL/WSAT (Phillips Laboratory) + 505-846-4347 3550 Aberdeen Ave SE + (FAX) 505-846-4374 Kirtland AFB, NM 87117-5776 + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.c new file mode 100644 index 0000000..e025dc5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.c @@ -0,0 +1,525 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_imageiter.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * Copyright (c) 1991-1996 Sam Leffler + * Copyright (c) 1991-1996 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Written by Conrad J. Poelman, PL/WSAT, Kirtland AFB, NM on 26 Mar 96. + * + * This file contains code to allow a calling program to "iterate" over each + * pixels in an image as it is read from the file. The iterator takes care of + * reading strips versus (possibly clipped) tiles, decoding the information + * according to the decoding method, and so on, so that calling program can + * ignore those details. The calling program does, however, need to be + * conscious of the type of the pixel data that it is receiving. + * + * For reasons of efficiency, the callback function actually gets called for + * "blocks" of pixels rather than for individual pixels. The format of the + * callback arguments is given below. + * + * This code was taken from TIFFReadRGBAImage() in tif_getimage.c of the original + * TIFF distribution, and simplified and generalized to provide this general + * iteration capability. Those routines could certainly be re-implemented in terms + * of a TIFFImageIter if desired. + * + */ +#include "tiffiop.h" +#include "tif_imageiter.h" +#include +#include + +static int gtTileContig(TIFFImageIter*, void *udata, uint32, uint32); +static int gtTileSeparate(TIFFImageIter*, void *udata, uint32, uint32); +static int gtStripContig(TIFFImageIter*, void *udata, uint32, uint32); +static int gtStripSeparate(TIFFImageIter*, void *udata, uint32, uint32); + +static const char photoTag[] = "PhotometricInterpretation"; + +static int +isCCITTCompression(TIFF* tif) +{ + uint16 compress; + TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress); + return (compress == COMPRESSION_CCITTFAX3 || + compress == COMPRESSION_CCITTFAX4 || + compress == COMPRESSION_CCITTRLE || + compress == COMPRESSION_CCITTRLEW); +} + +int +TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024]) +{ + uint16* sampleinfo; + uint16 extrasamples; + uint16 planarconfig; + int colorchannels; + + img->tif = tif; + img->stoponerr = stop; + TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample); + img->alpha = 0; + TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &img->samplesperpixel); + TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, + &extrasamples, &sampleinfo); + if (extrasamples == 1) + switch (sampleinfo[0]) { + case EXTRASAMPLE_ASSOCALPHA: /* data is pre-multiplied */ + case EXTRASAMPLE_UNASSALPHA: /* data is not pre-multiplied */ + img->alpha = sampleinfo[0]; + break; + } + colorchannels = img->samplesperpixel - extrasamples; + TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &planarconfig); + if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) { + switch (colorchannels) { + case 1: + if (isCCITTCompression(tif)) + img->photometric = PHOTOMETRIC_MINISWHITE; + else + img->photometric = PHOTOMETRIC_MINISBLACK; + break; + case 3: + img->photometric = PHOTOMETRIC_RGB; + break; + default: + sprintf(emsg, "Missing needed %s tag", photoTag); + return (0); + } + } + switch (img->photometric) { + case PHOTOMETRIC_PALETTE: + if (!TIFFGetField(tif, TIFFTAG_COLORMAP, + &img->redcmap, &img->greencmap, &img->bluecmap)) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Missing required \"Colormap\" tag"); + return (0); + } + /* fall thru... */ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: +/* This should work now so skip the check - BSR + if (planarconfig == PLANARCONFIG_CONTIG && img->samplesperpixel != 1) { + sprintf(emsg, + "Sorry, can not handle contiguous data with %s=%d, and %s=%d", + photoTag, img->photometric, + "Samples/pixel", img->samplesperpixel); + return (0); + } + */ + break; + case PHOTOMETRIC_YCBCR: + if (planarconfig != PLANARCONFIG_CONTIG) { + sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d", + "Planarconfiguration", planarconfig); + return (0); + } + /* It would probably be nice to have a reality check here. */ + { uint16 compress; + TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress); + if (compress == COMPRESSION_JPEG && planarconfig == PLANARCONFIG_CONTIG) { + /* can rely on libjpeg to convert to RGB */ + /* XXX should restore current state on exit */ + TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + img->photometric = PHOTOMETRIC_RGB; + } + } + break; + case PHOTOMETRIC_RGB: + if (colorchannels < 3) { + sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", + "Color channels", colorchannels); + return (0); + } + break; + case PHOTOMETRIC_SEPARATED: { + uint16 inkset; + TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset); + if (inkset != INKSET_CMYK) { + sprintf(emsg, "Sorry, can not handle separated image with %s=%d", + "InkSet", inkset); + return (0); + } + if (img->samplesperpixel != 4) { + sprintf(emsg, "Sorry, can not handle separated image with %s=%d", + "Samples/pixel", img->samplesperpixel); + return (0); + } + break; + } + default: + sprintf(emsg, "Sorry, can not handle image with %s=%d", + photoTag, img->photometric); + return (0); + } + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &img->width); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &img->height); + + TIFFGetFieldDefaulted(tif, TIFFTAG_ORIENTATION, &img->orientation); + switch (img->orientation) { + case ORIENTATION_BOTRIGHT: + case ORIENTATION_RIGHTBOT: /* XXX */ + case ORIENTATION_LEFTBOT: /* XXX */ + TIFFWarning(TIFFFileName(tif), "using bottom-left orientation"); + img->orientation = ORIENTATION_BOTLEFT; + /* fall thru... */ + case ORIENTATION_BOTLEFT: + break; + case ORIENTATION_TOPRIGHT: + case ORIENTATION_RIGHTTOP: /* XXX */ + case ORIENTATION_LEFTTOP: /* XXX */ + default: + TIFFWarning(TIFFFileName(tif), "using top-left orientation"); + img->orientation = ORIENTATION_TOPLEFT; + /* fall thru... */ + case ORIENTATION_TOPLEFT: + break; + } + + img->isContig = + !(planarconfig == PLANARCONFIG_SEPARATE && colorchannels > 1); + if (img->isContig) { + img->get = TIFFIsTiled(tif) ? gtTileContig : gtStripContig; + } else { + img->get = TIFFIsTiled(tif) ? gtTileSeparate : gtStripSeparate; + } + return (1); +} + +int +TIFFImageIterGet(TIFFImageIter* img, void *udata, uint32 w, uint32 h) +{ + if (img->get == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup"); + return (0); + } + if (img->callback.any == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), + "No \"put\" routine setupl; probably can not handle image format"); + return (0); + } + return (*img->get)(img, udata, w, h); +} + +TIFFImageIterEnd(TIFFImageIter* img) +{ + /* Nothing to free... ? */ +} + +/* + * Read the specified image into an ABGR-format raster. + */ +int +TIFFReadImageIter(TIFF* tif, + uint32 rwidth, uint32 rheight, uint8* raster, int stop) +{ + char emsg[1024]; + TIFFImageIter img; + int ok; + + if (TIFFImageIterBegin(&img, tif, stop, emsg)) { + /* XXX verify rwidth and rheight against width and height */ + ok = TIFFImageIterGet(&img, raster, rwidth, img.height); + TIFFImageIterEnd(&img); + } else { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); + ok = 0; + } + return (ok); +} + + +/* + * Get an tile-organized image that has + * PlanarConfiguration contiguous if SamplesPerPixel > 1 + * or + * SamplesPerPixel == 1 + */ +static int +gtTileContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + ImageIterTileContigRoutine callback = img->callback.contig; + uint16 orientation; + uint32 col, row; + uint32 tw, th; + u_char* buf; + int32 fromskew; + uint32 nrow; + + buf = (u_char*) _TIFFmalloc(TIFFTileSize(tif)); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); + return (0); + } + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + orientation = img->orientation; + for (row = 0; row < h; row += th) { + nrow = (row + th > h ? h - row : th); + for (col = 0; col < w; col += tw) { + if (TIFFReadTile(tif, buf, col, row, 0, 0) < 0 && img->stoponerr) + break; + if (col + tw > w) { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + uint32 npix = w - col; + fromskew = tw - npix; + (*callback)(img, udata, col, row, npix, nrow, fromskew, buf); + } else { + (*callback)(img, udata, col, row, tw, nrow, 0, buf); + } + } + } + _TIFFfree(buf); + return (1); +} + +/* + * Get an tile-organized image that has + * SamplesPerPixel > 1 + * PlanarConfiguration separated + * We assume that all such images are RGB. + */ +static int +gtTileSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + ImageIterTileSeparateRoutine callback = img->callback.separate; + uint16 orientation; + uint32 col, row; + uint32 tw, th; + u_char* buf; + u_char* r; + u_char* g; + u_char* b; + u_char* a; + tsize_t tilesize; + int32 fromskew; + int alpha = img->alpha; + uint32 nrow; + + tilesize = TIFFTileSize(tif); + buf = (u_char*) _TIFFmalloc(4*tilesize); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); + return (0); + } + r = buf; + g = r + tilesize; + b = g + tilesize; + a = b + tilesize; + if (!alpha) + memset(a, 0xff, tilesize); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + orientation = img->orientation; + for (row = 0; row < h; row += th) { + nrow = (row + th > h ? h - row : th); + for (col = 0; col < w; col += tw) { + if (TIFFReadTile(tif, r, col, row,0,0) < 0 && img->stoponerr) + break; + if (TIFFReadTile(tif, g, col, row,0,1) < 0 && img->stoponerr) + break; + if (TIFFReadTile(tif, b, col, row,0,2) < 0 && img->stoponerr) + break; + if (alpha && TIFFReadTile(tif,a,col,row,0,3) < 0 && img->stoponerr) + break; + if (col + tw > w) { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + uint32 npix = w - col; + fromskew = tw - npix; + (*callback)(img, udata, col, row, npix, nrow, fromskew, r, g, b, a); + } else { + (*callback)(img, udata, col, row, tw, nrow, 0, r, g, b, a); + } + } + } + _TIFFfree(buf); + return (1); +} + +/* + * Get a strip-organized image that has + * PlanarConfiguration contiguous if SamplesPerPixel > 1 + * or + * SamplesPerPixel == 1 + */ +static int +gtStripContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + ImageIterTileContigRoutine callback = img->callback.contig; + uint16 orientation; + uint32 row, nrow; + u_char* buf; + uint32 rowsperstrip; + uint32 imagewidth = img->width; + tsize_t scanline; + int32 fromskew; + + buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer"); + return (0); + } + orientation = img->orientation; + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + scanline = TIFFScanlineSize(tif); + fromskew = (w < imagewidth ? imagewidth - w : 0); + for (row = 0; row < h; row += rowsperstrip) { + nrow = (row + rowsperstrip > h ? h - row : rowsperstrip); + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0), + buf, nrow*scanline) < 0 && img->stoponerr) + break; + (*callback)(img, udata, 0, row, w, nrow, fromskew, buf); + } + _TIFFfree(buf); + return (1); +} + +/* + * Get a strip-organized image with + * SamplesPerPixel > 1 + * PlanarConfiguration separated + * We assume that all such images are RGB. + */ +static int +gtStripSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + ImageIterTileSeparateRoutine callback = img->callback.separate; + uint16 orientation; + u_char *buf; + u_char *r, *g, *b, *a; + uint32 row, nrow; + tsize_t scanline; + uint32 rowsperstrip; + uint32 imagewidth = img->width; + tsize_t stripsize; + int32 fromskew; + int alpha = img->alpha; + + stripsize = TIFFStripSize(tif); + r = buf = (u_char *)_TIFFmalloc(4*stripsize); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); + return (0); + } + g = r + stripsize; + b = g + stripsize; + a = b + stripsize; + if (!alpha) + memset(a, 0xff, stripsize); + orientation = img->orientation; + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + scanline = TIFFScanlineSize(tif); + fromskew = (w < imagewidth ? imagewidth - w : 0); + for (row = 0; row < h; row += rowsperstrip) { + nrow = (row + rowsperstrip > h ? h - row : rowsperstrip); + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0), + r, nrow*scanline) < 0 && img->stoponerr) + break; + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 1), + g, nrow*scanline) < 0 && img->stoponerr) + break; + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 2), + b, nrow*scanline) < 0 && img->stoponerr) + break; + if (alpha && + (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 3), + a, nrow*scanline) < 0 && img->stoponerr)) + break; + (*callback)(img, udata, 0, row, w, nrow, fromskew, r, g, b, a); + } + _TIFFfree(buf); + return (1); +} + +DECLAREContigCallbackFunc(TestContigCallback) +{ + printf("Contig Callback called with x = %d, y = %d, w = %d, h = %d, fromskew = %d\n", + x, y, w, h, fromskew); +} + + +DECLARESepCallbackFunc(TestSepCallback) +{ + printf("Sep Callback called with x = %d, y = %d, w = %d, h = %d, fromskew = %d\n", + x, y, w, h, fromskew); +} + + +#ifdef MAIN +main(int argc, char **argv) +{ + char emsg[1024]; + TIFFImageIter img; + int ok; + int stop = 1; + + TIFF *tif; + unsigned long nx, ny; + unsigned short BitsPerSample, SamplesPerPixel; + int isColorMapped, isPliFile; + unsigned char *ColorMap; + unsigned char *data; + + if (argc < 2) { + fprintf(stderr,"usage: %s tiff_file\n",argv[0]); + exit(1); + } + tif = (TIFF *)PLIGetImage(argv[1], (void *) &data, &ColorMap, + &nx, &ny, &BitsPerSample, &SamplesPerPixel, + &isColorMapped, &isPliFile); + if (tif != NULL) { + + if (TIFFImageIterBegin(&img, tif, stop, emsg)) { + /* Here need to set data and callback function! */ + if (img.isContig) { + img.callback = TestContigCallback; + } else { + img.callback = TestSepCallback; + } + ok = TIFFImageIterGet(&img, NULL, img.width, img.height); + TIFFImageIterEnd(&img); + } else { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), emsg); + } + } + +} +#endif +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.h new file mode 100644 index 0000000..e7dbe46 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_imageiter.h @@ -0,0 +1,64 @@ +typedef struct _TIFFImageIter TIFFImageIter; + +/* The callback function is called for each "block" of image pixel data after + it has been read from the file and decoded. This image pixel data is in the + buffer pp, and this data represents the image pixels from (x,y) to + (x+w,y+h). It is stored in pixel format, so each pixel contains + img->samplesperpixel consecutive samples each containing img->bitspersample + bits of data. The array pp is ordered in h consecutive rows of w+fromskew + pixels each. */ +typedef void (*ImageIterTileContigRoutine) + (TIFFImageIter*, void *, uint32, uint32, uint32, uint32, int32, + unsigned char*); +#define DECLAREContigCallbackFunc(name) \ +static void name(\ + TIFFImageIter* img, \ + void* user_data, \ + uint32 x, uint32 y, \ + uint32 w, uint32 h, \ + int32 fromskew, \ + u_char* pp \ +) + +typedef void (*ImageIterTileSeparateRoutine) + (TIFFImageIter*, void *, uint32, uint32, uint32, uint32, int32, + unsigned char*, unsigned char*, unsigned char*, unsigned char*); +#define DECLARESepCallbackFunc(name) \ +static void name(\ + TIFFImageIter* img, \ + void* user_data, \ + uint32 x, uint32 y, \ + uint32 w, uint32 h,\ + int32 fromskew, \ + u_char* r, u_char* g, u_char* b, u_char* a\ +) + +struct _TIFFImageIter { + TIFF* tif; /* image handle */ + int stoponerr; /* stop on read error */ + int isContig; /* data is packed/separate */ + int alpha; /* type of alpha data present */ + uint32 width; /* image width */ + uint32 height; /* image height */ + uint16 bitspersample; /* image bits/sample */ + uint16 samplesperpixel; /* image samples/pixel */ + uint16 orientation; /* image orientation */ + uint16 photometric; /* image photometric interp */ + uint16* redcmap; /* colormap pallete */ + uint16* greencmap; + uint16* bluecmap; + /* get image data routine */ + int (*get)(TIFFImageIter*, void *udata, uint32, uint32); + union { + void (*any)(TIFFImageIter*); + ImageIterTileContigRoutine contig; + ImageIterTileSeparateRoutine separate; + } callback; /* fn to exec for each block */ +}; +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirread.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirread.c new file mode 100644 index 0000000..37e513a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirread.c @@ -0,0 +1,1131 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirread.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1996 Sam Leffler + * Copyright (c) 1991-1996 Silicon Graphics, Inc. + * Copyright (c( 1996 USAF Phillips Laboratory + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * These routines written by Conrad J. Poelman on a single late-night of + * March 20-21, 1996. + * + * The entire purpose of this file is to provide a single external function, + * TIFFReadPrivateDataSubDirectory(). This function is intended for use in reading a + * private subdirectory from a TIFF file into a private structure. The + * actual writing of data into the structure is handled by the setFieldFn(), + * which is passed to TIFFReadPrivateDataSubDirectory() as a parameter. The idea is to + * enable any application wishing to store private subdirectories to do so + * easily using this function, without modifying the TIFF library. + * + * The astute observer will notice that only two functions are at all different + * from the original tif_dirread.c file: TIFFReadPrivateDataSubDirectory() and + * TIFFFetchNormalSubTag(). All the other stuff that makes this file so huge + * is only necessary because all of those functions are declared static in + * tif_dirread.c, so we have to totally duplicate them in order to use them. + * + * Oh, also note the bug fix in TIFFFetchFloat(). + * + */ + +#include "tiffiop.h" + +#define IGNORE 0 /* tag placeholder used below */ + +#if HAVE_IEEEFP +#define TIFFCvtIEEEFloatToNative(tif, n, fp) +#define TIFFCvtIEEEDoubleToNative(tif, n, dp) +#else +extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*); +extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*); +#endif + +static void EstimateStripByteCounts(TIFF*, TIFFDirEntry*, uint16); +static void MissingRequired(TIFF*, const char*); +static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32); +static tsize_t TIFFFetchData(TIFF*, TIFFDirEntry*, char*); +static tsize_t TIFFFetchString(TIFF*, TIFFDirEntry*, char*); +static float TIFFFetchRational(TIFF*, TIFFDirEntry*); +static int TIFFFetchNormalSubTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*, + int (*getFieldFn)(TIFF *tif,ttag_t tag,...)); +static int TIFFFetchPerSampleShorts(TIFF*, TIFFDirEntry*, int*); +static int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*); +static int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16*); +static int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32**); +static int TIFFFetchExtraSamples(TIFF*, TIFFDirEntry*); +static int TIFFFetchRefBlackWhite(TIFF*, TIFFDirEntry*); +static float TIFFFetchFloat(TIFF*, TIFFDirEntry*); +static int TIFFFetchFloatArray(TIFF*, TIFFDirEntry*, float*); +static int TIFFFetchDoubleArray(TIFF*, TIFFDirEntry*, double*); +static int TIFFFetchAnyArray(TIFF*, TIFFDirEntry*, double*); +static int TIFFFetchShortPair(TIFF*, TIFFDirEntry*); +#if STRIPCHOP_SUPPORT +static void ChopUpSingleUncompressedStrip(TIFF*); +#endif + +static char * +CheckMalloc(TIFF* tif, tsize_t n, const char* what) +{ + char *cp = (char*)_TIFFmalloc(n); + if (cp == NULL) + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space %s", what); + return (cp); +} + +/* Just as was done with TIFFWritePrivateDataSubDirectory(), here we implement + TIFFReadPrivateDataSubDirectory() which takes an offset into the TIFF file, + a TIFFFieldInfo structure specifying the types of the various tags, + and a function to use to set individual tags when they are encountered. + The data is read from the file, translated using the TIFF library's + built-in machine-independent conversion functions, and filled into + private subdirectory structure. + + This code was written by copying the original TIFFReadDirectory() function + from tif_dirread.c and paring it down to what is needed for this. + + It is the caller's responsibility to allocate and initialize the internal + structure that setFieldFn() will be writing into. If this function is being + called more than once before closing the file, the caller also must be + careful to free data in the structure before re-initializing. + + It is also the caller's responsibility to verify the presence of + any required fields after reading the directory in. +*/ + + +int +TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset, + TIFFFieldInfo *field_info, + int (*setFieldFn)(TIFF *tif, ttag_t tag, ...)) +{ + register TIFFDirEntry* dp; + register int n; + register TIFFDirectory* td; + TIFFDirEntry* dir; + int iv; + long v; + double dv; + const TIFFFieldInfo* fip; + int fix; + uint16 dircount; + uint32 nextdiroff; + char* cp; + int diroutoforderwarning = 0; + + /* Skipped part about checking for directories or compression data. */ + + if (!isMapped(tif)) { + if (!SeekOK(tif, pdir_offset)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Seek error accessing TIFF private subdirectory"); + return (0); + } + if (!ReadOK(tif, &dircount, sizeof (uint16))) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Can not read TIFF private subdirectory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + dir = (TIFFDirEntry *)CheckMalloc(tif, + dircount * sizeof (TIFFDirEntry), "to read TIFF private subdirectory"); + if (dir == NULL) + return (0); + if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory"); + goto bad; + } + /* + * Read offset to next directory for sequential scans. + */ + (void) ReadOK(tif, &nextdiroff, sizeof (uint32)); + } else { + toff_t off = pdir_offset; + + if (off + sizeof (short) > tif->tif_size) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Can not read TIFF private subdirectory count"); + return (0); + } else + _TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16)); + off += sizeof (uint16); + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + dir = (TIFFDirEntry *)CheckMalloc(tif, + dircount * sizeof (TIFFDirEntry), "to read TIFF private subdirectory"); + if (dir == NULL) + return (0); + if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Can not read TIFF private subdirectory"); + goto bad; + } else + _TIFFmemcpy(dir, tif->tif_base + off, + dircount*sizeof (TIFFDirEntry)); + off += dircount* sizeof (TIFFDirEntry); + if (off + sizeof (uint32) < tif->tif_size) + _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32)); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextdiroff); + + /* + * Setup default value and then make a pass over + * the fields to check type and tag information, + * and to extract info required to size data + * structures. A second pass is made afterwards + * to read in everthing not taken in the first pass. + */ + td = &tif->tif_dir; + + for (fip = field_info, dp = dir, n = dircount; + n > 0; n--, dp++) { + if (tif->tif_flags & TIFF_SWAB) { + TIFFSwabArrayOfShort(&dp->tdir_tag, 2); + TIFFSwabArrayOfLong(&dp->tdir_count, 2); + } + /* + * Find the field information entry for this tag. + */ + /* + * Silicon Beach (at least) writes unordered + * directory tags (violating the spec). Handle + * it here, but be obnoxious (maybe they'll fix it?). + */ + if (dp->tdir_tag < fip->field_tag) { + if (!diroutoforderwarning) { + TIFFWarning(tif->tif_name, + "invalid TIFF private subdirectory; tags are not sorted in ascending order"); + diroutoforderwarning = 1; + } + fip = field_info; /* O(n^2) */ + } + + while (fip->field_tag && fip->field_tag < dp->tdir_tag) + fip++; + if (!fip->field_tag || fip->field_tag != dp->tdir_tag) { + TIFFWarning(tif->tif_name, + "unknown field with tag %d (0x%x) in private subdirectory ignored", + dp->tdir_tag, dp->tdir_tag); + dp->tdir_tag = IGNORE; + fip = field_info;/* restart search */ + continue; + } + /* + * Null out old tags that we ignore. + */ + + /* Not implemented yet, since FIELD_IGNORE is specific to + the main directories. Could pass this in too... */ + if (0 /* && fip->field_bit == FIELD_IGNORE */) { + ignore: + dp->tdir_tag = IGNORE; + continue; + } + + /* + * Check data type. + */ + + while (dp->tdir_type != (u_short)fip->field_type) { + if (fip->field_type == TIFF_ANY) /* wildcard */ + break; + fip++; + if (!fip->field_tag || fip->field_tag != dp->tdir_tag) { + TIFFWarning(tif->tif_name, + "wrong data type %d for \"%s\"; tag ignored", + dp->tdir_type, fip[-1].field_name); + goto ignore; + } + } + /* + * Check count if known in advance. + */ + if (fip->field_readcount != TIFF_VARIABLE) { + uint32 expected = (fip->field_readcount == TIFF_SPP) ? + (uint32) td->td_samplesperpixel : + (uint32) fip->field_readcount; + if (!CheckDirCount(tif, dp, expected)) + goto ignore; + } + + /* Now read in and process data from field. */ + if (!TIFFFetchNormalSubTag(tif, dp, fip, setFieldFn)) + goto bad; + + } + + if (dir) + _TIFFfree(dir); + return (1); +bad: + if (dir) + _TIFFfree(dir); + return (0); +} + +static void +EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) +{ + register TIFFDirEntry *dp; + register TIFFDirectory *td = &tif->tif_dir; + uint16 i; + + if (td->td_stripbytecount) + _TIFFfree(td->td_stripbytecount); + td->td_stripbytecount = (uint32*) + CheckMalloc(tif, td->td_nstrips * sizeof (uint32), + "for \"StripByteCounts\" array"); + if (td->td_compression != COMPRESSION_NONE) { + uint32 space = (uint32)(sizeof (TIFFHeader) + + sizeof (uint16) + + (dircount * sizeof (TIFFDirEntry)) + + sizeof (uint32)); + toff_t filesize = TIFFGetFileSize(tif); + uint16 n; + + /* calculate amount of space used by indirect values */ + for (dp = dir, n = dircount; n > 0; n--, dp++) { + uint32 cc = dp->tdir_count*TIFFDataWidth(dp->tdir_type); + if (cc > sizeof (uint32)) + space += cc; + } + space = (filesize - space) / td->td_samplesperpixel; + for (i = 0; i < td->td_nstrips; i++) + td->td_stripbytecount[i] = space; + /* + * This gross hack handles the case were the offset to + * the last strip is past the place where we think the strip + * should begin. Since a strip of data must be contiguous, + * it's safe to assume that we've overestimated the amount + * of data in the strip and trim this number back accordingly. + */ + i--; + if (td->td_stripoffset[i] + td->td_stripbytecount[i] > filesize) + td->td_stripbytecount[i] = + filesize - td->td_stripoffset[i]; + } else { + uint32 rowbytes = TIFFScanlineSize(tif); + uint32 rowsperstrip = td->td_imagelength / td->td_nstrips; + for (i = 0; i < td->td_nstrips; i++) + td->td_stripbytecount[i] = rowbytes*rowsperstrip; + } + TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS); + if (!TIFFFieldSet(tif, FIELD_ROWSPERSTRIP)) + td->td_rowsperstrip = td->td_imagelength; +} + +static void +MissingRequired(TIFF* tif, const char* tagname) +{ + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "TIFF directory is missing required \"%s\" field", tagname); +} + +/* + * Check the count field of a directory + * entry against a known value. The caller + * is expected to skip/ignore the tag if + * there is a mismatch. + */ +static int +CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count) +{ + if (count != dir->tdir_count) { + TIFFWarning(tif->tif_name, + "incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, + dir->tdir_count, count); + return (0); + } + return (1); +} + +/* + * Fetch a contiguous directory item. + */ +static tsize_t +TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp) +{ + int w = TIFFDataWidth(dir->tdir_type); + tsize_t cc = dir->tdir_count * w; + + if (!isMapped(tif)) { + if (!SeekOK(tif, dir->tdir_offset)) + goto bad; + if (!ReadOK(tif, cp, cc)) + goto bad; + } else { + if (dir->tdir_offset + cc > tif->tif_size) + goto bad; + _TIFFmemcpy(cp, tif->tif_base + dir->tdir_offset, cc); + } + if (tif->tif_flags & TIFF_SWAB) { + switch (dir->tdir_type) { + case TIFF_SHORT: + case TIFF_SSHORT: + TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count); + break; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count); + break; + case TIFF_DOUBLE: + TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count); + break; + } + } + return (cc); +bad: + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error fetching data for field \"%s\"", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); + return ((tsize_t) 0); +} + +/* + * Fetch an ASCII item from the file. + */ +static tsize_t +TIFFFetchString(TIFF* tif, TIFFDirEntry* dir, char* cp) +{ + if (dir->tdir_count <= 4) { + uint32 l = dir->tdir_offset; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&l); + _TIFFmemcpy(cp, &l, dir->tdir_count); + return (1); + } + return (TIFFFetchData(tif, dir, cp)); +} + +/* + * Convert numerator+denominator to float. + */ +static int +cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv) +{ + if (denom == 0) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%s: Rational with zero denominator (num = %lu)", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num); + return (0); + } else { + if (dir->tdir_type == TIFF_RATIONAL) + *rv = ((float)num / (float)denom); + else + *rv = ((float)(int32)num / (float)(int32)denom); + return (1); + } +} + +/* + * Fetch a rational item from the file + * at offset off and return the value + * as a floating point number. + */ +static float +TIFFFetchRational(TIFF* tif, TIFFDirEntry* dir) +{ + uint32 l[2]; + float v; + + return (!TIFFFetchData(tif, dir, (char *)l) || + !cvtRational(tif, dir, l[0], l[1], &v) ? 1.0f : v); +} + +/* + * Fetch a single floating point value + * from the offset field and return it + * as a native float. + */ +static float +TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir) +{ + /* This appears to be a flagrant bug in the TIFF library, yet I + actually don't understand how it could have ever worked the old + way. Look at the comments in my new code and you'll understand. */ +#if (0) + float v = (float) + TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset); + TIFFCvtIEEEFloatToNative(tif, 1, &v); +#else + float v; + /* This is a little bit tricky - if we just cast the uint32 to a float, + C will perform a numerical conversion, which is not what we want. + We want to take the actual bit pattern in the uint32 and interpret + it as a float. Thus we cast a uint32 * into a float * and then + dereference to get v. */ + uint32 l = (uint32) + TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset); + v = * (float *) &l; + TIFFCvtIEEEFloatToNative(tif, 1, &v); +#endif + return (v); + +} + +/* + * Fetch an array of BYTE or SBYTE values. + */ +static int +TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint16* v) +{ + if (dir->tdir_count <= 4) { + /* + * Extract data from offset field. + */ + if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { + switch (dir->tdir_count) { + case 4: v[3] = dir->tdir_offset & 0xff; + case 3: v[2] = (dir->tdir_offset >> 8) & 0xff; + case 2: v[1] = (dir->tdir_offset >> 16) & 0xff; + case 1: v[0] = dir->tdir_offset >> 24; + } + } else { + switch (dir->tdir_count) { + case 4: v[3] = dir->tdir_offset >> 24; + case 3: v[2] = (dir->tdir_offset >> 16) & 0xff; + case 2: v[1] = (dir->tdir_offset >> 8) & 0xff; + case 1: v[0] = dir->tdir_offset & 0xff; + } + } + return (1); + } else + return (TIFFFetchData(tif, dir, (char*) v) != 0); /* XXX */ +} + +/* + * Fetch an array of SHORT or SSHORT values. + */ +static int +TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v) +{ + if (dir->tdir_count <= 2) { + if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { + switch (dir->tdir_count) { + case 2: v[1] = dir->tdir_offset & 0xffff; + case 1: v[0] = dir->tdir_offset >> 16; + } + } else { + switch (dir->tdir_count) { + case 2: v[1] = dir->tdir_offset >> 16; + case 1: v[0] = dir->tdir_offset & 0xffff; + } + } + return (1); + } else + return (TIFFFetchData(tif, dir, (char *)v) != 0); +} + +/* + * Fetch a pair of SHORT or BYTE values. + */ +static int +TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir) +{ + uint16 v[2]; + int ok = 0; + + switch (dir->tdir_type) { + case TIFF_SHORT: + case TIFF_SSHORT: + ok = TIFFFetchShortArray(tif, dir, v); + break; + case TIFF_BYTE: + case TIFF_SBYTE: + ok = TIFFFetchByteArray(tif, dir, v); + break; + } + if (ok) + TIFFSetField(tif, dir->tdir_tag, v[0], v[1]); + return (ok); +} + +/* + * Fetch an array of LONG or SLONG values. + */ +static int +TIFFFetchLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v) +{ + if (dir->tdir_count == 1) { + v[0] = dir->tdir_offset; + return (1); + } else + return (TIFFFetchData(tif, dir, (char*) v) != 0); +} + +/* + * Fetch an array of RATIONAL or SRATIONAL values. + */ +static int +TIFFFetchRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v) +{ + int ok = 0; + uint32* l; + + l = (uint32*)CheckMalloc(tif, + dir->tdir_count*TIFFDataWidth(dir->tdir_type), + "to fetch array of rationals"); + if (l) { + if (TIFFFetchData(tif, dir, (char *)l)) { + uint32 i; + for (i = 0; i < dir->tdir_count; i++) { + ok = cvtRational(tif, dir, + l[2*i+0], l[2*i+1], &v[i]); + if (!ok) + break; + } + } + _TIFFfree((char *)l); + } + return (ok); +} + +/* + * Fetch an array of FLOAT values. + */ +static int +TIFFFetchFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v) +{ + + if (dir->tdir_count == 1) { + v[0] = *(float*) &dir->tdir_offset; + TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v); + return (1); + } else if (TIFFFetchData(tif, dir, (char*) v)) { + TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v); + return (1); + } else + return (0); +} + +/* + * Fetch an array of DOUBLE values. + */ +static int +TIFFFetchDoubleArray(TIFF* tif, TIFFDirEntry* dir, double* v) +{ + if (TIFFFetchData(tif, dir, (char*) v)) { + TIFFCvtIEEEDoubleToNative(tif, dir->tdir_count, v); + return (1); + } else + return (0); +} + +/* + * Fetch an array of ANY values. The actual values are + * returned as doubles which should be able hold all the + * types. Yes, there really should be an tany_t to avoid + * this potential non-portability ... Note in particular + * that we assume that the double return value vector is + * large enough to read in any fundamental type. We use + * that vector as a buffer to read in the base type vector + * and then convert it in place to double (from end + * to front of course). + */ +static int +TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v) +{ + int i; + + switch (dir->tdir_type) { + case TIFF_BYTE: + case TIFF_SBYTE: + if (!TIFFFetchByteArray(tif, dir, (uint16*) v)) + return (0); + if (dir->tdir_type == TIFF_BYTE) { + uint16* vp = (uint16*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } else { + int16* vp = (int16*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } + break; + case TIFF_SHORT: + case TIFF_SSHORT: + if (!TIFFFetchShortArray(tif, dir, (uint16*) v)) + return (0); + if (dir->tdir_type == TIFF_SHORT) { + uint16* vp = (uint16*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } else { + int16* vp = (int16*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } + break; + case TIFF_LONG: + case TIFF_SLONG: + if (!TIFFFetchLongArray(tif, dir, (uint32*) v)) + return (0); + if (dir->tdir_type == TIFF_LONG) { + uint32* vp = (uint32*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } else { + int32* vp = (int32*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + if (!TIFFFetchRationalArray(tif, dir, (float*) v)) + return (0); + { float* vp = (float*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } + break; + case TIFF_FLOAT: + if (!TIFFFetchFloatArray(tif, dir, (float*) v)) + return (0); + { float* vp = (float*) v; + for (i = dir->tdir_count-1; i >= 0; i--) + v[i] = vp[i]; + } + break; + case TIFF_DOUBLE: + return (TIFFFetchDoubleArray(tif, dir, (double*) v)); + default: + /* TIFF_NOTYPE */ + /* TIFF_ASCII */ + /* TIFF_UNDEFINED */ + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Cannot read TIFF_ANY type %d for field \"%s\"", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); + return (0); + } + return (1); +} + + +/* + * Fetch a tag that is not handled by special case code. + */ +/* The standard function TIFFFetchNormalTag() could definitely be replaced + with a simple call to this function, just adding TIFFSetField() as the + last argument. */ +static int +TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip, + int (*setFieldFn)(TIFF *tif, ttag_t tag, ...)) +{ + static char mesg[] = "to fetch tag value"; + int ok = 0; + + if (dp->tdir_count > 1) { /* array of values */ + char* cp = NULL; + + switch (dp->tdir_type) { + case TIFF_BYTE: + case TIFF_SBYTE: + /* NB: always expand BYTE values to shorts */ + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (uint16), mesg); + ok = cp && TIFFFetchByteArray(tif, dp, (uint16*) cp); + break; + case TIFF_SHORT: + case TIFF_SSHORT: + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (uint16), mesg); + ok = cp && TIFFFetchShortArray(tif, dp, (uint16*) cp); + break; + case TIFF_LONG: + case TIFF_SLONG: + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (uint32), mesg); + ok = cp && TIFFFetchLongArray(tif, dp, (uint32*) cp); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (float), mesg); + ok = cp && TIFFFetchRationalArray(tif, dp, (float*) cp); + break; + case TIFF_FLOAT: + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (float), mesg); + ok = cp && TIFFFetchFloatArray(tif, dp, (float*) cp); + break; + case TIFF_DOUBLE: + cp = CheckMalloc(tif, + dp->tdir_count * sizeof (double), mesg); + ok = cp && TIFFFetchDoubleArray(tif, dp, (double*) cp); + break; + case TIFF_ASCII: + case TIFF_UNDEFINED: /* bit of a cheat... */ + /* + * Some vendors write strings w/o the trailing + * NULL byte, so always append one just in case. + */ + cp = CheckMalloc(tif, dp->tdir_count+1, mesg); + if (ok = (cp && TIFFFetchString(tif, dp, cp))) + cp[dp->tdir_count] = '\0'; /* XXX */ + break; + } + if (ok) { + ok = (fip->field_passcount ? + (*setFieldFn)(tif, dp->tdir_tag, dp->tdir_count, cp) + : (*setFieldFn)(tif, dp->tdir_tag, cp)); + } + if (cp != NULL) + _TIFFfree(cp); + } else if (CheckDirCount(tif, dp, 1)) { /* singleton value */ + switch (dp->tdir_type) { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + /* + * If the tag is also acceptable as a LONG or SLONG + * then (*setFieldFn) will expect an uint32 parameter + * passed to it (through varargs). Thus, for machines + * where sizeof (int) != sizeof (uint32) we must do + * a careful check here. It's hard to say if this + * is worth optimizing. + * + * NB: We use TIFFFieldWithTag here knowing that + * it returns us the first entry in the table + * for the tag and that that entry is for the + * widest potential data type the tag may have. + */ + { TIFFDataType type = fip->field_type; + if (type != TIFF_LONG && type != TIFF_SLONG) { + uint16 v = (uint16) + TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset); + ok = (fip->field_passcount ? + (*setFieldFn)(tif, dp->tdir_tag, 1, &v) + : (*setFieldFn)(tif, dp->tdir_tag, v)); + break; + } + } + /* fall thru... */ + case TIFF_LONG: + case TIFF_SLONG: + { uint32 v32 = + TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset); + ok = (fip->field_passcount ? + (*setFieldFn)(tif, dp->tdir_tag, 1, &v32) + : (*setFieldFn)(tif, dp->tdir_tag, v32)); + } + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + { float v = (dp->tdir_type == TIFF_FLOAT ? + TIFFFetchFloat(tif, dp) + : TIFFFetchRational(tif, dp)); + ok = (fip->field_passcount ? + (*setFieldFn)(tif, dp->tdir_tag, 1, &v) + : (*setFieldFn)(tif, dp->tdir_tag, v)); + } + break; + case TIFF_DOUBLE: + { double v; + ok = (TIFFFetchDoubleArray(tif, dp, &v) && + (fip->field_passcount ? + (*setFieldFn)(tif, dp->tdir_tag, 1, &v) + : (*setFieldFn)(tif, dp->tdir_tag, v)) + ); + } + break; + case TIFF_ASCII: + case TIFF_UNDEFINED: /* bit of a cheat... */ + { char c[2]; + if (ok = (TIFFFetchString(tif, dp, c) != 0)) { + c[1] = '\0'; /* XXX paranoid */ + ok = (*setFieldFn)(tif, dp->tdir_tag, c); + } + } + break; + } + } + return (ok); +} + +/* Everything after this is exactly duplicated from the standard tif_dirread.c + file, necessitated by the fact that they are declared static there so + we can't call them! +*/ +#define NITEMS(x) (sizeof (x) / sizeof (x[0])) +/* + * Fetch samples/pixel short values for + * the specified tag and verify that + * all values are the same. + */ +static int +TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, int* pl) +{ + int samples = tif->tif_dir.td_samplesperpixel; + int status = 0; + + if (CheckDirCount(tif, dir, (uint32) samples)) { + uint16 buf[10]; + uint16* v = buf; + + if (samples > NITEMS(buf)) + v = (uint16*) _TIFFmalloc(samples * sizeof (uint16)); + if (TIFFFetchShortArray(tif, dir, v)) { + int i; + for (i = 1; i < samples; i++) + if (v[i] != v[0]) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Cannot handle different per-sample values for field \"%s\"", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); + goto bad; + } + *pl = v[0]; + status = 1; + } + bad: + if (v != buf) + _TIFFfree((char*) v); + } + return (status); +} + +/* + * Fetch samples/pixel ANY values for + * the specified tag and verify that + * all values are the same. + */ +static int +TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl) +{ + int samples = (int) tif->tif_dir.td_samplesperpixel; + int status = 0; + + if (CheckDirCount(tif, dir, (uint32) samples)) { + double buf[10]; + double* v = buf; + + if (samples > NITEMS(buf)) + v = (double*) _TIFFmalloc(samples * sizeof (double)); + if (TIFFFetchAnyArray(tif, dir, v)) { + int i; + for (i = 1; i < samples; i++) + if (v[i] != v[0]) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Cannot handle different per-sample values for field \"%s\"", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); + goto bad; + } + *pl = v[0]; + status = 1; + } + bad: + if (v != buf) + _TIFFfree(v); + } + return (status); +} +#undef NITEMS + +/* + * Fetch a set of offsets or lengths. + * While this routine says "strips", + * in fact it's also used for tiles. + */ +static int +TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp) +{ + register uint32* lp; + int status; + + if (!CheckDirCount(tif, dir, (uint32) nstrips)) + return (0); + /* + * Allocate space for strip information. + */ + if (*lpp == NULL && + (*lpp = (uint32 *)CheckMalloc(tif, + nstrips * sizeof (uint32), "for strip array")) == NULL) + return (0); + lp = *lpp; + if (dir->tdir_type == (int)TIFF_SHORT) { + /* + * Handle uint16->uint32 expansion. + */ + uint16* dp = (uint16*) CheckMalloc(tif, + dir->tdir_count* sizeof (uint16), "to fetch strip tag"); + if (dp == NULL) + return (0); + if (status = TIFFFetchShortArray(tif, dir, dp)) { + register uint16* wp = dp; + while (nstrips-- > 0) + *lp++ = *wp++; + } + _TIFFfree((char*) dp); + } else + status = TIFFFetchLongArray(tif, dir, lp); + return (status); +} + +#define NITEMS(x) (sizeof (x) / sizeof (x[0])) +/* + * Fetch and set the ExtraSamples tag. + */ +static int +TIFFFetchExtraSamples(TIFF* tif, TIFFDirEntry* dir) +{ + uint16 buf[10]; + uint16* v = buf; + int status; + + if (dir->tdir_count > NITEMS(buf)) + v = (uint16*) _TIFFmalloc(dir->tdir_count * sizeof (uint16)); + if (dir->tdir_type == TIFF_BYTE) + status = TIFFFetchByteArray(tif, dir, v); + else + status = TIFFFetchShortArray(tif, dir, v); + if (status) + status = TIFFSetField(tif, dir->tdir_tag, dir->tdir_count, v); + if (v != buf) + _TIFFfree((char*) v); + return (status); +} +#undef NITEMS + +#ifdef COLORIMETRY_SUPPORT +/* + * Fetch and set the RefBlackWhite tag. + */ +static int +TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir) +{ + static char mesg[] = "for \"ReferenceBlackWhite\" array"; + char* cp; + int ok; + + if (dir->tdir_type == TIFF_RATIONAL) + return (1/*TIFFFetchNormalTag(tif, dir) just so linker won't complain - this part of the code is never used anyway */); + /* + * Handle LONG's for backward compatibility. + */ + cp = CheckMalloc(tif, dir->tdir_count * sizeof (uint32), mesg); + if (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) { + float* fp = (float*) + CheckMalloc(tif, dir->tdir_count * sizeof (float), mesg); + if (ok = (fp != NULL)) { + uint32 i; + for (i = 0; i < dir->tdir_count; i++) + fp[i] = (float)((uint32*) cp)[i]; + ok = TIFFSetField(tif, dir->tdir_tag, fp); + _TIFFfree((char*) fp); + } + } + if (cp) + _TIFFfree(cp); + return (ok); +} +#endif + +#if STRIPCHOP_SUPPORT +/* + * Replace a single strip (tile) of uncompressed data by + * multiple strips (tiles), each approximately 8Kbytes. + * This is useful for dealing with large images or + * for dealing with machines with a limited amount + * memory. + */ +static void +ChopUpSingleUncompressedStrip(TIFF* tif) +{ + register TIFFDirectory *td = &tif->tif_dir; + uint32 bytecount = td->td_stripbytecount[0]; + uint32 offset = td->td_stripoffset[0]; + tsize_t rowbytes = TIFFVTileSize(tif, 1), stripbytes; + tstrip_t strip, nstrips, rowsperstrip; + uint32* newcounts; + uint32* newoffsets; + + /* + * Make the rows hold at least one + * scanline, but fill 8k if possible. + */ + if (rowbytes > 8192) { + stripbytes = rowbytes; + rowsperstrip = 1; + } else { + rowsperstrip = 8192 / rowbytes; + stripbytes = rowbytes * rowsperstrip; + } + /* never increase the number of strips in an image */ + if (rowsperstrip >= td->td_rowsperstrip) + return; + nstrips = (tstrip_t) TIFFhowmany(bytecount, stripbytes); + newcounts = (uint32*) CheckMalloc(tif, nstrips * sizeof (uint32), + "for chopped \"StripByteCounts\" array"); + newoffsets = (uint32*) CheckMalloc(tif, nstrips * sizeof (uint32), + "for chopped \"StripOffsets\" array"); + if (newcounts == NULL || newoffsets == NULL) { + /* + * Unable to allocate new strip information, give + * up and use the original one strip information. + */ + if (newcounts != NULL) + _TIFFfree(newcounts); + if (newoffsets != NULL) + _TIFFfree(newoffsets); + return; + } + /* + * Fill the strip information arrays with + * new bytecounts and offsets that reflect + * the broken-up format. + */ + for (strip = 0; strip < nstrips; strip++) { + if (stripbytes > bytecount) + stripbytes = bytecount; + newcounts[strip] = stripbytes; + newoffsets[strip] = offset; + offset += stripbytes; + bytecount -= stripbytes; + } + /* + * Replace old single strip info with multi-strip info. + */ + td->td_stripsperimage = td->td_nstrips = nstrips; + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + _TIFFfree(td->td_stripbytecount); + _TIFFfree(td->td_stripoffset); + td->td_stripbytecount = newcounts; + td->td_stripoffset = newoffsets; +} +#endif /* STRIPCHOP_SUPPORT */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirwrite.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirwrite.c new file mode 100644 index 0000000..3c632da --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/pds/tif_pdsdirwrite.c @@ -0,0 +1,971 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/contrib/pds/tif_pdsdirwrite.c,v 1.4 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* When writing data to TIFF files, it is often useful to store application- + specific data in a private TIFF directory so that the tags don't need to + be registered and won't conflict with other people's user-defined tags. + One needs to have a registered public tag which contains some amount of + raw data. That raw data, however, is interpreted at an independent, + separate, private tiff directory. This file provides some routines which + will be useful for converting that data from its raw binary form into + the proper form for your application. +*/ + +/* + * Copyright (c) 1988-1996 Sam Leffler + * Copyright (c) 1991-1996 Silicon Graphics, Inc. + * Copyright (c( 1996 USAF Phillips Laboratory + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * These routines written by Conrad J. Poelman on a single late-night of + * March 20-21, 1996. + * + * The entire purpose of this file is to provide a single external function, + * TIFFWritePrivateDataSubDirectory(). This function is intended for use + * in writing a private subdirectory structure into a TIFF file. The + * actual reading of data from the structure is handled by the getFieldFn(), + * which is passed to TIFFWritePrivateDataSubDirectory() as a parameter. The + * idea is to enable any application wishing to read private subdirectories to + * do so easily using this function, without modifying the TIFF library. + * + * The astute observer will notice that only two functions are at all different + * from the original tif_dirwrite.c file: TIFFWritePrivateDataSubDirectory()and + * TIFFWriteNormalSubTag(). All the other stuff that makes this file so huge + * is only necessary because all of those functions are declared static in + * tif_dirwrite.c, so we have to totally duplicate them in order to use them. + * + * Oh, also please note the bug-fix in the routine TIFFWriteNormalSubTag(), + * which equally should be applied to TIFFWriteNormalTag(). + * + */ +#include "tiffiop.h" + +#if HAVE_IEEEFP +#define TIFFCvtNativeToIEEEFloat(tif, n, fp) +#define TIFFCvtNativeToIEEEDouble(tif, n, dp) +#else +extern void TIFFCvtNativeToIEEEFloat(TIFF*, uint32, float*); +extern void TIFFCvtNativeToIEEEDouble(TIFF*, uint32, double*); +#endif + +static int TIFFWriteNormalTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*); +static int TIFFWriteNormalSubTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*, + int (*getFieldFn)(TIFF *tif,ttag_t tag,...)); +static void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32); +static int TIFFSetupShortPair(TIFF*, ttag_t, TIFFDirEntry*); +static int TIFFWritePerSampleShorts(TIFF*, ttag_t, TIFFDirEntry*); +static int TIFFWritePerSampleAnys(TIFF*, TIFFDataType, ttag_t, TIFFDirEntry*); +static int TIFFWriteShortTable(TIFF*, ttag_t, TIFFDirEntry*, uint32, uint16**); +static int TIFFWriteShortArray(TIFF*, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint16*); +static int TIFFWriteLongArray(TIFF *, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint32*); +static int TIFFWriteRationalArray(TIFF *, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*); +static int TIFFWriteFloatArray(TIFF *, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*); +static int TIFFWriteDoubleArray(TIFF *, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*); +static int TIFFWriteByteArray(TIFF*, TIFFDirEntry*, char*); +static int TIFFWriteAnyArray(TIFF*, + TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*); +#ifdef COLORIMETRY_SUPPORT +static int TIFFWriteTransferFunction(TIFF*, TIFFDirEntry*); +#endif +static int TIFFWriteData(TIFF*, TIFFDirEntry*, char*); +static int TIFFLinkDirectory(TIFF*); + +#define WriteRationalPair(type, tag1, v1, tag2, v2) { \ + if (!TIFFWriteRational(tif, type, tag1, dir, v1)) \ + goto bad; \ + if (!TIFFWriteRational(tif, type, tag2, dir+1, v2)) \ + goto bad; \ + dir++; \ +} +#define TIFFWriteRational(tif, type, tag, dir, v) \ + TIFFWriteRationalArray((tif), (type), (tag), (dir), 1, &(v)) +#ifndef TIFFWriteRational +static int TIFFWriteRational(TIFF*, + TIFFDataType, ttag_t, TIFFDirEntry*, float); +#endif + +/* This function will write an entire directory to the disk, and return the + offset value indicating where in the file it wrote the beginning of the + directory structure. This is NOT the same as the offset value before + calling this function, because some of the fields may have caused various + data items to be written out BEFORE writing the directory structure. + + This code was basically written by ripping of the TIFFWriteDirectory() + code and generalizing it, using RPS's TIFFWritePliIfd() code for + inspiration. My original goal was to make this code general enough that + the original TIFFWriteDirectory() could be rewritten to just call this + function with the appropriate field and field-accessing arguments. + + However, now I realize that there's a lot of code that gets executed for + the main, standard TIFF directories that does not apply to special + private subdirectories, so such a reimplementation for the sake of + eliminating redundant or duplicate code is probably not possible, + unless we also pass in a Main flag to indiciate which type of handling + to do, which would be kind of a hack. I've marked those places where I + changed or ripped out code which would have to be re-inserted to + generalize this function. If it can be done in a clean and graceful way, + it would be a great way to generalize the TIFF library. Otherwise, I'll + just leave this code here where it duplicates but remains on top of and + hopefully mostly independent of the main TIFF library. + + The caller will probably want to free the sub directory structure after + returning from this call, since otherwise once written out, the user + is likely to forget about it and leave data lying around. +*/ +toff_t +TIFFWritePrivateDataSubDirectory(TIFF* tif, + uint32 pdir_fieldsset[], int pdir_fields_last, + TIFFFieldInfo *field_info, + int (*getFieldFn)(TIFF *tif, ttag_t tag, ...)) +{ + uint16 dircount; + uint32 diroff, nextdiroff; + ttag_t tag; + uint32 nfields; + tsize_t dirsize; + char* data; + TIFFDirEntry* dir; + u_long b, *fields, fields_size; + toff_t directory_offset; + TIFFFieldInfo* fip; + + /* + * Deleted out all of the encoder flushing and such code from here - + * not necessary for subdirectories. + */ + + /* Finish writing out any image data. */ + TIFFFlushData(tif); + + /* + * Size the directory so that we can calculate + * offsets for the data items that aren't kept + * in-place in each field. + */ + nfields = 0; + for (b = 0; b <= pdir_fields_last; b++) + if (FieldSet(pdir_fieldsset, b)) + /* Deleted code to make size of first 4 tags 2 + instead of 1. */ + nfields += 1; + dirsize = nfields * sizeof (TIFFDirEntry); + data = (char*) _TIFFmalloc(dirsize); + if (data == NULL) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Cannot write private subdirectory, out of space"); + return (0); + } + /* + * Place directory in data section of the file. If there isn't one + * yet, place it at the end of the file. The directory is treated as + * data, so we don't link it into the directory structure at all. + */ + if (tif->tif_dataoff == 0) + tif->tif_dataoff =(TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1; + diroff = tif->tif_dataoff; + tif->tif_dataoff = (toff_t)( + diroff + sizeof (uint16) + dirsize + sizeof (toff_t)); + if (tif->tif_dataoff & 1) + tif->tif_dataoff++; + (void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET); + /*tif->tif_curdir++;*/ + dir = (TIFFDirEntry*) data; + /* + * Setup external form of directory + * entries and write data items. + */ + /* + * We make a local copy of the fieldsset here so that we don't mess + * up the original one when we call ResetFieldBit(). But I'm not sure + * why the original code calls ResetFieldBit(), since we're already + * going through the fields in order... + * + * fields_size is the number of uint32's we will need to hold the + * bit-mask for all of the fields. If our highest field number is + * 100, then we'll need 100 / (8*4)+1 == 4 uint32's to hold the + * fieldset. + * + * Unlike the original code, we allocate fields dynamically based + * on the requested pdir_fields_last value, allowing private + * data subdirectories to contain more than the built-in code's limit + * of 95 tags in a directory. + */ + fields_size = pdir_fields_last / (8*sizeof(uint32)) + 1; + fields = _TIFFmalloc(fields_size*sizeof(uint32)); + _TIFFmemcpy(fields, pdir_fieldsset, fields_size * sizeof(uint32)); + + /* Deleted "write out extra samples tag" code here. */ + + /* Deleted code for checking a billion little special cases for the + * standard TIFF tags. Should add a general mechanism for overloading + * write function for each field, just like Brian kept telling me!!! + */ + for (fip = field_info; fip->field_tag; fip++) { + /* Deleted code to check for FIELD_IGNORE!! */ + if (/* fip->field_bit == FIELD_IGNORE || */ + !FieldSet(fields, fip->field_bit)) + continue; + if (!TIFFWriteNormalSubTag(tif, dir, fip, getFieldFn)) + goto bad; + dir++; + ResetFieldBit(fields, fip->field_bit); + } + + /* Now we've written all of the referenced data, and are about to + write the main directory structure, so grab the tif_dataoff value + now so we can remember where we wrote the directory. */ + directory_offset = tif->tif_dataoff; + + /* + * Write directory. + */ + dircount = (uint16) nfields; + /* Deleted code to link to the next directory - we set it to zero! */ + nextdiroff = 0; + if (tif->tif_flags & TIFF_SWAB) { + /* + * The file's byte order is opposite to the + * native machine architecture. We overwrite + * the directory information with impunity + * because it'll be released below after we + * write it to the file. Note that all the + * other tag construction routines assume that + * we do this byte-swapping; i.e. they only + * byte-swap indirect data. + */ + for (dir = (TIFFDirEntry*) data; dircount; dir++, dircount--) { + TIFFSwabArrayOfShort(&dir->tdir_tag, 2); + TIFFSwabArrayOfLong(&dir->tdir_count, 2); + } + dircount = (uint16) nfields; + TIFFSwabShort(&dircount); + TIFFSwabLong(&nextdiroff); + } + + (void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET); + if (!WriteOK(tif, &dircount, sizeof (dircount))) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory count"); + goto bad; + } + if (!WriteOK(tif, data, dirsize)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory contents"); + goto bad; + } + if (!WriteOK(tif, &nextdiroff, sizeof (nextdiroff))) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing private subdirectory link"); + goto bad; + } + tif->tif_dataoff += sizeof(dircount) + dirsize + sizeof(nextdiroff); + + _TIFFfree(data); + _TIFFfree(fields); + tif->tif_flags &= ~TIFF_DIRTYDIRECT; + +#if (0) + /* This stuff commented out because I don't think we want it for + subdirectories, but I could be wrong. */ + (*tif->tif_cleanup)(tif); + + /* + * Reset directory-related state for subsequent + * directories. + */ + TIFFDefaultDirectory(tif); + tif->tif_curoff = 0; + tif->tif_row = (uint32) -1; + tif->tif_curstrip = (tstrip_t) -1; +#endif + + return (directory_offset); +bad: + _TIFFfree(data); + _TIFFfree(fields); + return (0); +} +#undef WriteRationalPair + +/* + * Process tags that are not special cased. + */ +/* The standard function TIFFWriteNormalTag() could definitely be replaced + with a simple call to this function, just adding TIFFGetField() as the + last argument. */ +static int +TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip, + int (*getFieldFn)(TIFF *tif, ttag_t tag, ...)) +{ + u_short wc = (u_short) fip->field_writecount; + + dir->tdir_tag = fip->field_tag; + dir->tdir_type = (u_short) fip->field_type; + dir->tdir_count = wc; +#define WRITEF(x,y) x(tif, fip->field_type, fip->field_tag, dir, wc, y) + switch (fip->field_type) { + case TIFF_SHORT: + case TIFF_SSHORT: + if (wc > 1) { + uint16* wp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &wp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &wp); + if (!WRITEF(TIFFWriteShortArray, wp)) + return (0); + } else { + uint16 sv; + (*getFieldFn)(tif, fip->field_tag, &sv); + dir->tdir_offset = + TIFFInsertData(tif, dir->tdir_type, sv); + } + break; + case TIFF_LONG: + case TIFF_SLONG: + if (wc > 1) { + uint32* lp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &lp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &lp); + if (!WRITEF(TIFFWriteLongArray, lp)) + return (0); + } else { + /* XXX handle LONG->SHORT conversion */ + (*getFieldFn)(tif, fip->field_tag, &dir->tdir_offset); + } + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + if (wc > 1) { + float* fp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &fp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &fp); + if (!WRITEF(TIFFWriteRationalArray, fp)) + return (0); + } else { + float fv; + (*getFieldFn)(tif, fip->field_tag, &fv); + if (!WRITEF(TIFFWriteRationalArray, &fv)) + return (0); + } + break; + case TIFF_FLOAT: + if (wc > 1) { + float* fp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &fp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &fp); + if (!WRITEF(TIFFWriteFloatArray, fp)) + return (0); + } else { + float fv; + (*getFieldFn)(tif, fip->field_tag, &fv); + if (!WRITEF(TIFFWriteFloatArray, &fv)) + return (0); + } + break; + case TIFF_DOUBLE: + /* Hey - I think this is a bug, or at least a "gross + inconsistency", in the TIFF library. Look at the original + TIFF library code below within the "#if (0) ... #else". + Just from the type of *dp, you can see that this code + expects TIFFGetField() to be handed a double ** for + any TIFF_DOUBLE tag, even for the constant wc==1 case. + This is totally inconsistent with other fields (like + TIFF_FLOAT, above) and is also inconsistent with the + TIFFSetField() function for TIFF_DOUBLEs, which expects + to be passed a single double by value for the wc==1 case. + (See the handling of TIFFFetchNormalTag() in tif_dirread.c + for an example.) Maybe this function was written before + TIFFWriteDoubleArray() was written, not that that's an + excuse. Anyway, the new code below is a trivial modification + of the TIFF_FLOAT code above. The fact that even single + doubles get written out in the data segment and get an + offset value stored is irrelevant here - that is all + handled by TIFFWriteDoubleArray(). */ +#if (0) + { double* dp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &dp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &dp); + TIFFCvtNativeToIEEEDouble(tif, wc, dp); + if (!TIFFWriteData(tif, dir, (char*) dp)) + return (0); + } +#else + if (wc > 1) { + double* dp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &dp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &dp); + if (!WRITEF(TIFFWriteDoubleArray, dp)) + return (0); + } else { + double dv; + (*getFieldFn)(tif, fip->field_tag, &dv); + if (!WRITEF(TIFFWriteDoubleArray, &dv)) + return (0); + } +#endif + break; + case TIFF_ASCII: + { char* cp; + (*getFieldFn)(tif, fip->field_tag, &cp); + dir->tdir_count = (uint32) (strlen(cp) + 1); + if (!TIFFWriteByteArray(tif, dir, cp)) + return (0); + } + break; + case TIFF_UNDEFINED: + { char* cp; + if (wc == (u_short) TIFF_VARIABLE) { + (*getFieldFn)(tif, fip->field_tag, &wc, &cp); + dir->tdir_count = wc; + } else + (*getFieldFn)(tif, fip->field_tag, &cp); + if (!TIFFWriteByteArray(tif, dir, cp)) + return (0); + } + break; + } + return (1); +} +#undef WRITEF + +/* Everything after this is exactly duplicated from the standard tif_dirwrite.c + file, necessitated by the fact that they are declared static there so + we can't call them! +*/ +/* + * Setup a directory entry with either a SHORT + * or LONG type according to the value. + */ +static void +TIFFSetupShortLong(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint32 v) +{ + dir->tdir_tag = tag; + dir->tdir_count = 1; + if (v > 0xffffL) { + dir->tdir_type = (short) TIFF_LONG; + dir->tdir_offset = v; + } else { + dir->tdir_type = (short) TIFF_SHORT; + dir->tdir_offset = TIFFInsertData(tif, (int) TIFF_SHORT, v); + } +} +#undef MakeShortDirent + +#ifndef TIFFWriteRational +/* + * Setup a RATIONAL directory entry and + * write the associated indirect value. + */ +static int +TIFFWriteRational(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, float v) +{ + return (TIFFWriteRationalArray(tif, type, tag, dir, 1, &v)); +} +#endif + +#define NITEMS(x) (sizeof (x) / sizeof (x[0])) +/* + * Setup a directory entry that references a + * samples/pixel array of SHORT values and + * (potentially) write the associated indirect + * values. + */ +static int +TIFFWritePerSampleShorts(TIFF* tif, ttag_t tag, TIFFDirEntry* dir) +{ + uint16 buf[10], v; + uint16* w = buf; + int i, status, samples = tif->tif_dir.td_samplesperpixel; + + if (samples > NITEMS(buf)) + w = (uint16*) _TIFFmalloc(samples * sizeof (uint16)); + TIFFGetField(tif, tag, &v); + for (i = 0; i < samples; i++) + w[i] = v; + status = TIFFWriteShortArray(tif, TIFF_SHORT, tag, dir, samples, w); + if (w != buf) + _TIFFfree((char*) w); + return (status); +} + +/* + * Setup a directory entry that references a samples/pixel array of ``type'' + * values and (potentially) write the associated indirect values. The source + * data from TIFFGetField() for the specified tag must be returned as double. + */ +static int +TIFFWritePerSampleAnys(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir) +{ + double buf[10], v; + double* w = buf; + int i, status; + int samples = (int) tif->tif_dir.td_samplesperpixel; + + if (samples > NITEMS(buf)) + w = (double*) _TIFFmalloc(samples * sizeof (double)); + TIFFGetField(tif, tag, &v); + for (i = 0; i < samples; i++) + w[i] = v; + status = TIFFWriteAnyArray(tif, type, tag, dir, samples, w); + if (w != buf) + _TIFFfree(w); + return (status); +} +#undef NITEMS + +/* + * Setup a pair of shorts that are returned by + * value, rather than as a reference to an array. + */ +static int +TIFFSetupShortPair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir) +{ + uint16 v[2]; + + TIFFGetField(tif, tag, &v[0], &v[1]); + return (TIFFWriteShortArray(tif, TIFF_SHORT, tag, dir, 2, v)); +} + +/* + * Setup a directory entry for an NxM table of shorts, + * where M is known to be 2**bitspersample, and write + * the associated indirect data. + */ +static int +TIFFWriteShortTable(TIFF* tif, + ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16** table) +{ + uint32 i, off; + + dir->tdir_tag = tag; + dir->tdir_type = (short) TIFF_SHORT; + /* XXX -- yech, fool TIFFWriteData */ + dir->tdir_count = (uint32) (1L<tif_dir.td_bitspersample); + off = tif->tif_dataoff; + for (i = 0; i < n; i++) + if (!TIFFWriteData(tif, dir, (char *)table[i])) + return (0); + dir->tdir_count *= n; + dir->tdir_offset = off; + return (1); +} + +/* + * Write/copy data associated with an ASCII or opaque tag value. + */ +static int +TIFFWriteByteArray(TIFF* tif, TIFFDirEntry* dir, char* cp) +{ + if (dir->tdir_count > 4) { + if (!TIFFWriteData(tif, dir, cp)) + return (0); + } else + _TIFFmemcpy(&dir->tdir_offset, cp, dir->tdir_count); + return (1); +} + +/* + * Setup a directory entry of an array of SHORT + * or SSHORT and write the associated indirect values. + */ +static int +TIFFWriteShortArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16* v) +{ + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + if (n <= 2) { + if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { + dir->tdir_offset = (uint32) ((long) v[0] << 16); + if (n == 2) + dir->tdir_offset |= v[1] & 0xffff; + } else { + dir->tdir_offset = v[0] & 0xffff; + if (n == 2) + dir->tdir_offset |= (long) v[1] << 16; + } + return (1); + } else + return (TIFFWriteData(tif, dir, (char*) v)); +} + +/* + * Setup a directory entry of an array of LONG + * or SLONG and write the associated indirect values. + */ +static int +TIFFWriteLongArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint32* v) +{ + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + if (n == 1) { + dir->tdir_offset = v[0]; + return (1); + } else + return (TIFFWriteData(tif, dir, (char*) v)); +} + +/* + * Setup a directory entry of an array of RATIONAL + * or SRATIONAL and write the associated indirect values. + */ +static int +TIFFWriteRationalArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v) +{ + uint32 i; + uint32* t; + int status; + + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + t = (uint32*) _TIFFmalloc(2*n * sizeof (uint32)); + for (i = 0; i < n; i++) { + float fv = v[i]; + int sign = 1; + uint32 den; + + if (fv < 0) { + if (type == TIFF_RATIONAL) { + TIFFWarning(tif->tif_name, + "\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL", + _TIFFFieldWithTag(tif,tag)->field_name, v); + fv = 0; + } else + fv = -fv, sign = -1; + } + den = 1L; + if (fv > 0) { + while (fv < 1L<<(31-3) && den < 1L<<(31-3)) + fv *= 1<<3, den *= 1L<<3; + } + t[2*i+0] = sign * (fv + 0.5); + t[2*i+1] = den; + } + status = TIFFWriteData(tif, dir, (char *)t); + _TIFFfree((char*) t); + return (status); +} + +static int +TIFFWriteFloatArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v) +{ + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + TIFFCvtNativeToIEEEFloat(tif, n, v); + if (n == 1) { + dir->tdir_offset = *(uint32*) &v[0]; + return (1); + } else + return (TIFFWriteData(tif, dir, (char*) v)); +} + +static int +TIFFWriteDoubleArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v) +{ + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + TIFFCvtNativeToIEEEDouble(tif, n, v); + return (TIFFWriteData(tif, dir, (char*) v)); +} + +/* + * Write an array of ``type'' values for a specified tag (i.e. this is a tag + * which is allowed to have different types, e.g. SMaxSampleType). + * Internally the data values are represented as double since a double can + * hold any of the TIFF tag types (yes, this should really be an abstract + * type tany_t for portability). The data is converted into the specified + * type in a temporary buffer and then handed off to the appropriate array + * writer. + */ +static int +TIFFWriteAnyArray(TIFF* tif, + TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v) +{ + char buf[10 * sizeof(double)]; + char* w = buf; + int i, status = 0; + + if (n * TIFFDataWidth(type) > sizeof buf) + w = (char*) _TIFFmalloc(n * TIFFDataWidth(type)); + switch (type) { + case TIFF_BYTE: + { unsigned char* bp = (unsigned char*) w; + for (i = 0; i < n; i++) + bp[i] = (unsigned char) v[i]; + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + if (!TIFFWriteByteArray(tif, dir, (char*) bp)) + goto out; + } + break; + case TIFF_SBYTE: + { signed char* bp = (signed char*) w; + for (i = 0; i < n; i++) + bp[i] = (signed char) v[i]; + dir->tdir_tag = tag; + dir->tdir_type = (short) type; + dir->tdir_count = n; + if (!TIFFWriteByteArray(tif, dir, (char*) bp)) + goto out; + } + break; + case TIFF_SHORT: + { uint16* bp = (uint16*) w; + for (i = 0; i < n; i++) + bp[i] = (uint16) v[i]; + if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp)) + goto out; + } + break; + case TIFF_SSHORT: + { int16* bp = (int16*) w; + for (i = 0; i < n; i++) + bp[i] = (int16) v[i]; + if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp)) + goto out; + } + break; + case TIFF_LONG: + { uint32* bp = (uint32*) w; + for (i = 0; i < n; i++) + bp[i] = (uint32) v[i]; + if (!TIFFWriteLongArray(tif, type, tag, dir, n, bp)) + goto out; + } + break; + case TIFF_SLONG: + { int32* bp = (int32*) w; + for (i = 0; i < n; i++) + bp[i] = (int32) v[i]; + if (!TIFFWriteLongArray(tif, type, tag, dir, n, (uint32*) bp)) + goto out; + } + break; + case TIFF_FLOAT: + { float* bp = (float*) w; + for (i = 0; i < n; i++) + bp[i] = (float) v[i]; + if (!TIFFWriteFloatArray(tif, type, tag, dir, n, bp)) + goto out; + } + break; + case TIFF_DOUBLE: + return (TIFFWriteDoubleArray(tif, type, tag, dir, n, v)); + default: + /* TIFF_NOTYPE */ + /* TIFF_ASCII */ + /* TIFF_UNDEFINED */ + /* TIFF_RATIONAL */ + /* TIFF_SRATIONAL */ + goto out; + } + status = 1; + out: + if (w != buf) + _TIFFfree(w); + return (status); +} + +#ifdef COLORIMETRY_SUPPORT +static int +TIFFWriteTransferFunction(TIFF* tif, TIFFDirEntry* dir) +{ + TIFFDirectory* td = &tif->tif_dir; + tsize_t n = (1L<td_bitspersample) * sizeof (uint16); + uint16** tf = td->td_transferfunction; + int ncols; + + /* + * Check if the table can be written as a single column, + * or if it must be written as 3 columns. Note that we + * write a 3-column tag if there are 2 samples/pixel and + * a single column of data won't suffice--hmm. + */ + switch (td->td_samplesperpixel - td->td_extrasamples) { + default: if (_TIFFmemcmp(tf[0], tf[2], n)) { ncols = 3; break; } + case 2: if (_TIFFmemcmp(tf[0], tf[1], n)) { ncols = 3; break; } + case 1: case 0: ncols = 1; + } + return (TIFFWriteShortTable(tif, + TIFFTAG_TRANSFERFUNCTION, dir, ncols, tf)); +} +#endif + +/* + * Write a contiguous directory item. + */ +static int +TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp) +{ + tsize_t cc; + + if (tif->tif_flags & TIFF_SWAB) { + switch (dir->tdir_type) { + case TIFF_SHORT: + case TIFF_SSHORT: + TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count); + break; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count); + break; + case TIFF_DOUBLE: + TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count); + break; + } + } + dir->tdir_offset = tif->tif_dataoff; + cc = dir->tdir_count * TIFFDataWidth(dir->tdir_type); + if (SeekOK(tif, dir->tdir_offset) && + WriteOK(tif, cp, cc)) { + tif->tif_dataoff += (cc + 1) & ~1; + return (1); + } + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing data for field \"%s\"", + _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); + return (0); +} + +/* + * Link the current directory into the + * directory chain for the file. + */ +static int +TIFFLinkDirectory(TIFF* tif) +{ + static const char module[] = "TIFFLinkDirectory"; + uint32 nextdir; + uint32 diroff; + + tif->tif_diroff = (TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1; + diroff = (uint32) tif->tif_diroff; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&diroff); +#if SUBIFD_SUPPORT + if (tif->tif_flags & TIFF_INSUBIFD) { + (void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET); + if (!WriteOK(tif, &diroff, sizeof (diroff))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Error writing SubIFD directory link", + tif->tif_name); + return (0); + } + /* + * Advance to the next SubIFD or, if this is + * the last one configured, revert back to the + * normal directory linkage. + */ + if (--tif->tif_nsubifd) + tif->tif_subifdoff += sizeof (diroff); + else + tif->tif_flags &= ~TIFF_INSUBIFD; + return (1); + } +#endif + if (tif->tif_header.tiff_diroff == 0) { + /* + * First directory, overwrite offset in header. + */ + tif->tif_header.tiff_diroff = (uint32) tif->tif_diroff; +#define HDROFF(f) ((toff_t) &(((TIFFHeader*) 0)->f)) + (void) TIFFSeekFile(tif, HDROFF(tiff_diroff), SEEK_SET); + if (!WriteOK(tif, &diroff, sizeof (diroff))) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "Error writing TIFF header"); + return (0); + } + return (1); + } + /* + * Not the first directory, search to the last and append. + */ + nextdir = tif->tif_header.tiff_diroff; + do { + uint16 dircount; + + if (!SeekOK(tif, nextdir) || + !ReadOK(tif, &dircount, sizeof (dircount))) { + TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + (void) TIFFSeekFile(tif, + dircount * sizeof (TIFFDirEntry), SEEK_CUR); + if (!ReadOK(tif, &nextdir, sizeof (nextdir))) { + TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory link"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextdir); + } while (nextdir != 0); + (void) TIFFSeekFile(tif, -(toff_t) sizeof (nextdir), SEEK_CUR); + if (!WriteOK(tif, &diroff, sizeof (diroff))) { + TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link"); + return (0); + } + return (1); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.am new file mode 100644 index 0000000..9480944 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README ras2tif.c tif2ras.c + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.in new file mode 100644 index 0000000..602ae86 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/ras +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README ras2tif.c tif2ras.c +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/ras/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/ras/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/README new file mode 100644 index 0000000..f87bfde --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/README @@ -0,0 +1,10 @@ +Sun May 19 22:28:16 PDT 1991 + +These programs are from Patrick Naughton (naughton@wind.sun.com). +I've tried to update them to reflect changes to the library, but +I am unable to verify that they operate properly, because they +require the Sun pixrect library. + +Please contact Patrick directly if you have questions/problems. + + Sam diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/ras2tif.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/ras2tif.c new file mode 100644 index 0000000..c44b313 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/ras2tif.c @@ -0,0 +1,254 @@ +#ifndef lint +static char sccsid[] = "@(#)ras2tif.c 1.2 90/03/06"; +#endif +/*- + * ras2tif.c - Converts from a Sun Rasterfile to a Tagged Image File. + * + * Copyright (c) 1990 by Sun Microsystems, Inc. + * + * Author: Patrick J. Naughton + * naughton@wind.sun.com + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * This file is provided AS IS with no warranties of any kind. The author + * shall have no liability with respect to the infringement of copyrights, + * trade secrets or any patents by this file or any part thereof. In no + * event will the author be liable for any lost revenue or profits or + * other special, indirect and consequential damages. + * + * Comments and additions should be sent to the author: + * + * Patrick J. Naughton + * Sun Microsystems + * 2550 Garcia Ave, MS 14-40 + * Mountain View, CA 94043 + * (415) 336-1080 + * + * Revision History: + * 11-Jan-89: Created. + * 06-Mar-90: fix bug in SCALE() macro. + * got rid of xres and yres, (they weren't working anyways). + * fixed bpsl calculation. + * 25-Nov-99: y2k fix (year as 1900 + tm_year) + * + * Description: + * This program takes a Sun Rasterfile [see rasterfile(5)] as input and + * writes a MicroSoft/Aldus "Tagged Image File Format" image or "TIFF" file. + * The input file may be standard input, but the output TIFF file must be a + * real file since seek(2) is used. + */ + +#include +#include +#include +#include "tiffio.h" + +typedef int boolean; +#define True (1) +#define False (0) +#define SCALE(x) (((x)*((1L<<16)-1))/255) + +boolean Verbose = False; +boolean dummyinput = False; +char *pname; /* program name (used for error messages) */ + +void +error(s1, s2) + char *s1, + *s2; +{ + fprintf(stderr, s1, pname, s2); + exit(1); +} + +void +usage() +{ + error("usage: %s -[vq] [-|rasterfile] TIFFfile\n", NULL); +} + + +main(argc, argv) + int argc; + char *argv[]; +{ + char *inf = NULL; + char *outf = NULL; + FILE *fp; + int depth, + i; + long row; + TIFF *tif; + Pixrect *pix; /* The Sun Pixrect */ + colormap_t Colormap; /* The Pixrect Colormap */ + u_short red[256], + green[256], + blue[256]; + struct tm *ct; + struct timeval tv; + long width, + height; + long rowsperstrip; + int year; + short photometric; + short samplesperpixel; + short bitspersample; + int bpsl; + static char *version = "ras2tif 1.0"; + static char *datetime = "1990:01:01 12:00:00"; + + gettimeofday(&tv, (struct timezone *) NULL); + ct = localtime(&tv.tv_sec); + year=1900 + ct->tm_year; + sprintf(datetime, "%04d:%02d:%02d %02d:%02d:%02d", + year, ct->tm_mon + 1, ct->tm_mday, + ct->tm_hour, ct->tm_min, ct->tm_sec); + + setbuf(stderr, NULL); + pname = argv[0]; + + while (--argc) { + if ((++argv)[0][0] == '-') { + switch (argv[0][1]) { + case 'v': + Verbose = True; + break; + case 'q': + usage(); + break; + case '\0': + if (inf == NULL) + dummyinput = True; + else + usage(); + break; + default: + fprintf(stderr, "%s: illegal option -%c.\n", pname, + argv[0][1]); + exit(1); + } + } else if (inf == NULL && !dummyinput) { + inf = argv[0]; + } else if (outf == NULL) + outf = argv[0]; + else + usage(); + } + + if (outf == NULL) + error("%s: can't write output file to a stream.\n", NULL); + + if (dummyinput || inf == NULL) { + inf = "Standard Input"; + fp = stdin; + } else if ((fp = fopen(inf, "r")) == NULL) + error("%s: %s couldn't be opened.\n", inf); + + if (Verbose) + fprintf(stderr, "Reading rasterfile from %s...", inf); + + pix = pr_load(fp, &Colormap); + if (pix == NULL) + error("%s: %s is not a raster file.\n", inf); + + if (Verbose) + fprintf(stderr, "done.\n"); + + if (Verbose) + fprintf(stderr, "Writing %s...", outf); + + tif = TIFFOpen(outf, "w"); + + if (tif == NULL) + error("%s: error opening TIFF file %s", outf); + + width = pix->pr_width; + height = pix->pr_height; + depth = pix->pr_depth; + + switch (depth) { + case 1: + samplesperpixel = 1; + bitspersample = 1; + photometric = PHOTOMETRIC_MINISBLACK; + break; + case 8: + samplesperpixel = 1; + bitspersample = 8; + photometric = PHOTOMETRIC_PALETTE; + break; + case 24: + samplesperpixel = 3; + bitspersample = 8; + photometric = PHOTOMETRIC_RGB; + break; + case 32: + samplesperpixel = 4; + bitspersample = 8; + photometric = PHOTOMETRIC_RGB; + break; + default: + error("%s: bogus depth: %d\n", depth); + } + + bpsl = ((depth * width + 15) >> 3) & ~1; + rowsperstrip = (8 * 1024) / bpsl; + + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bitspersample); + TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric); + TIFFSetField(tif, TIFFTAG_DOCUMENTNAME, inf); + TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, "converted Sun rasterfile"); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + TIFFSetField(tif, TIFFTAG_STRIPBYTECOUNTS, height / rowsperstrip); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif, TIFFTAG_SOFTWARE, version); + TIFFSetField(tif, TIFFTAG_DATETIME, datetime); + + memset(red, 0, sizeof(red)); + memset(green, 0, sizeof(green)); + memset(blue, 0, sizeof(blue)); + if (depth == 8) { + TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue); + for (i = 0; i < Colormap.length; i++) { + red[i] = SCALE(Colormap.map[0][i]); + green[i] = SCALE(Colormap.map[1][i]); + blue[i] = SCALE(Colormap.map[2][i]); + } + } + if (Verbose) + fprintf(stderr, "%dx%dx%d image, ", width, height, depth); + + for (row = 0; row < height; row++) + if (TIFFWriteScanline(tif, + (u_char *) mprd_addr(mpr_d(pix), 0, row), + row, 0) < 0) { + fprintf("failed a scanline write (%d)\n", row); + break; + } + TIFFFlushData(tif); + TIFFClose(tif); + + if (Verbose) + fprintf(stderr, "done.\n"); + + pr_destroy(pix); + + exit(0); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/tif2ras.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/tif2ras.c new file mode 100644 index 0000000..e1c321d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/ras/tif2ras.c @@ -0,0 +1,344 @@ +#ifndef lint +static char id[] = "$Id: tif2ras.c,v 1.3 2010-06-08 18:55:15 bfriesen Exp $"; +#endif +/*- + * tif2ras.c - Converts from a Tagged Image File Format image to a Sun Raster. + * + * Copyright (c) 1990 by Sun Microsystems, Inc. + * + * Author: Patrick J. Naughton + * naughton@wind.sun.com + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation. + * + * This file is provided AS IS with no warranties of any kind. The author + * shall have no liability with respect to the infringement of copyrights, + * trade secrets or any patents by this file or any part thereof. In no + * event will the author be liable for any lost revenue or profits or + * other special, indirect and consequential damages. + * + * Comments and additions should be sent to the author: + * + * Patrick J. Naughton + * Sun Microsystems + * 2550 Garcia Ave, MS 14-40 + * Mountain View, CA 94043 + * (415) 336-1080 + * + * Revision History: + * 10-Jan-89: Created. + * 06-Mar-90: Change to byte encoded rasterfiles. + * fix bug in call to ReadScanline(). + * fix bug in CVT() macro. + * fix assignment of td, (missing &). + * + * Description: + * This program takes a MicroSoft/Aldus "Tagged Image File Format" image or + * "TIFF" file as input and writes a Sun Rasterfile [see rasterfile(5)]. The + * output file may be standard output, but the input TIFF file must be a real + * file since seek(2) is used. + */ + +#include +#include +#include "tiffio.h" + +typedef int boolean; +#define True (1) +#define False (0) +#define CVT(x) (((x) * 255) / ((1L<<16)-1)) + +boolean Verbose = False; +char *pname; /* program name (used for error messages) */ + +void +error(s1, s2) + char *s1, + *s2; +{ + fprintf(stderr, s1, pname, s2); + exit(1); +} + +void +usage() +{ + error("usage: %s -[vq] TIFFfile [rasterfile]\n", NULL); +} + + +main(argc, argv) + int argc; + char *argv[]; +{ + char *inf = NULL; + char *outf = NULL; + FILE *fp; + long width, + height; + int depth, + numcolors; + register TIFF *tif; + TIFFDirectory *td; + register u_char *inp, + *outp; + register int col, + i; + register long row; + u_char *Map = NULL; + u_char *buf; + short bitspersample; + short samplesperpixel; + short photometric; + u_short *redcolormap, + *bluecolormap, + *greencolormap; + + Pixrect *pix; /* The Sun Pixrect */ + colormap_t Colormap; /* The Pixrect Colormap */ + u_char red[256], + green[256], + blue[256]; + + setbuf(stderr, NULL); + pname = argv[0]; + + while (--argc) { + if ((++argv)[0][0] == '-') + switch (argv[0][1]) { + case 'v': + Verbose = True; + break; + case 'q': + usage(); + break; + default: + fprintf(stderr, "%s: illegal option -%c.\n", pname, + argv[0][1]); + exit(1); + } + else if (inf == NULL) + inf = argv[0]; + else if (outf == NULL) + outf = argv[0]; + else + usage(); + + } + + if (inf == NULL) + error("%s: can't read input file from a stream.\n", NULL); + + if (Verbose) + fprintf(stderr, "Reading %s...", inf); + + tif = TIFFOpen(inf, "r"); + + if (tif == NULL) + error("%s: error opening TIFF file %s", inf); + + if (Verbose) + TIFFPrintDirectory(tif, stderr, True, False, False); + TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample); + if (bitspersample > 8) + error("%s: can't handle more than 8-bits per sample\n", NULL); + + TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + switch (samplesperpixel) { + case 1: + if (bitspersample == 1) + depth = 1; + else + depth = 8; + break; + case 3: + case 4: + depth = 24; + break; + default: + error("%s: only handle 1-channel gray scale or 3-channel color\n"); + } + + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height); + + if (Verbose) + fprintf(stderr, "%dx%dx%d image, ", width, height, depth); + if (Verbose) + fprintf(stderr, "%d bits/sample, %d samples/pixel, ", + bitspersample, samplesperpixel); + + pix = mem_create(width, height, depth); + if (pix == (Pixrect *) NULL) + error("%s: can't allocate memory for output pixrect...\n", NULL); + + numcolors = (1 << bitspersample); + + TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric); + if (numcolors == 2) { + if (Verbose) + fprintf(stderr, "monochrome "); + Colormap.type = RMT_NONE; + Colormap.length = 0; + Colormap.map[0] = Colormap.map[1] = Colormap.map[2] = NULL; + } else { + switch (photometric) { + case PHOTOMETRIC_MINISBLACK: + if (Verbose) + fprintf(stderr, "%d graylevels (min=black), ", numcolors); + Map = (u_char *) malloc(numcolors * sizeof(u_char)); + for (i = 0; i < numcolors; i++) + Map[i] = (255 * i) / numcolors; + Colormap.type = RMT_EQUAL_RGB; + Colormap.length = numcolors; + Colormap.map[0] = Colormap.map[1] = Colormap.map[2] = Map; + break; + case PHOTOMETRIC_MINISWHITE: + if (Verbose) + fprintf(stderr, "%d graylevels (min=white), ", numcolors); + Map = (u_char *) malloc(numcolors * sizeof(u_char)); + for (i = 0; i < numcolors; i++) + Map[i] = 255 - ((255 * i) / numcolors); + Colormap.type = RMT_EQUAL_RGB; + Colormap.length = numcolors; + Colormap.map[0] = Colormap.map[1] = Colormap.map[2] = Map; + break; + case PHOTOMETRIC_RGB: + if (Verbose) + fprintf(stderr, "truecolor "); + Colormap.type = RMT_NONE; + Colormap.length = 0; + Colormap.map[0] = Colormap.map[1] = Colormap.map[2] = NULL; + break; + case PHOTOMETRIC_PALETTE: + if (Verbose) + fprintf(stderr, "colormapped "); + Colormap.type = RMT_EQUAL_RGB; + Colormap.length = numcolors; + memset(red, 0, sizeof(red)); + memset(green, 0, sizeof(green)); + memset(blue, 0, sizeof(blue)); + TIFFGetField(tif, TIFFTAG_COLORMAP, + &redcolormap, &greencolormap, &bluecolormap); + for (i = 0; i < numcolors; i++) { + red[i] = (u_char) CVT(redcolormap[i]); + green[i] = (u_char) CVT(greencolormap[i]); + blue[i] = (u_char) CVT(bluecolormap[i]); + } + Colormap.map[0] = red; + Colormap.map[1] = green; + Colormap.map[2] = blue; + break; + case PHOTOMETRIC_MASK: + error("%s: Don't know how to handle PHOTOMETRIC_MASK\n"); + break; + case PHOTOMETRIC_DEPTH: + error("%s: Don't know how to handle PHOTOMETRIC_DEPTH\n"); + break; + default: + error("%s: unknown photometric (cmap): %d\n", photometric); + } + } + + buf = (u_char *) malloc(TIFFScanlineSize(tif)); + if (buf == NULL) + error("%s: can't allocate memory for scanline buffer...\n", NULL); + + for (row = 0; row < height; row++) { + if (TIFFReadScanline(tif, buf, row, 0) < 0) + error("%s: bad data read on line: %d\n", row); + inp = buf; + outp = (u_char *) mprd_addr(mpr_d(pix), 0, row); + switch (photometric) { + case PHOTOMETRIC_RGB: + if (samplesperpixel == 4) + for (col = 0; col < width; col++) { + *outp++ = *inp++; /* Blue */ + *outp++ = *inp++; /* Green */ + *outp++ = *inp++; /* Red */ + inp++; /* skip alpha channel */ + } + else + for (col = 0; col < width; col++) { + *outp++ = *inp++; /* Blue */ + *outp++ = *inp++; /* Green */ + *outp++ = *inp++; /* Red */ + } + break; + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + switch (bitspersample) { + case 1: + for (col = 0; col < ((width + 7) / 8); col++) + *outp++ = *inp++; + break; + case 2: + for (col = 0; col < ((width + 3) / 4); col++) { + *outp++ = (*inp >> 6) & 3; + *outp++ = (*inp >> 4) & 3; + *outp++ = (*inp >> 2) & 3; + *outp++ = *inp++ & 3; + } + break; + case 4: + for (col = 0; col < width / 2; col++) { + *outp++ = *inp >> 4; + *outp++ = *inp++ & 0xf; + } + break; + case 8: + for (col = 0; col < width; col++) + *outp++ = *inp++; + break; + default: + error("%s: bad bits/sample: %d\n", bitspersample); + } + break; + case PHOTOMETRIC_PALETTE: + memcpy(outp, inp, width); + break; + default: + error("%s: unknown photometric (write): %d\n", photometric); + } + } + + free((char *) buf); + + if (Verbose) + fprintf(stderr, "done.\n"); + + if (outf == NULL || strcmp(outf, "Standard Output") == 0) { + outf = "Standard Output"; + fp = stdout; + } else { + if (!(fp = fopen(outf, "w"))) + error("%s: %s couldn't be opened for writing.\n", outf); + } + + if (Verbose) + fprintf(stderr, "Writing rasterfile in %s...", outf); + + if (pr_dump(pix, fp, &Colormap, RT_BYTE_ENCODED, 0) == PIX_ERR) + error("%s: error writing Sun Rasterfile: %s\n", outf); + + if (Verbose) + fprintf(stderr, "done.\n"); + + pr_destroy(pix); + + if (fp != stdout) + fclose(fp); + + exit(0); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.am new file mode 100644 index 0000000..1e7a8da --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README tiffstream.cpp tiffstream.h + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.in new file mode 100644 index 0000000..67d5f93 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/stream +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README tiffstream.cpp tiffstream.h +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/stream/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/stream/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/README new file mode 100644 index 0000000..df9e43e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/README @@ -0,0 +1,30 @@ +Subject: tiff stream interface (contrib) +Date: Thu, 30 Mar 2000 10:48:51 -0800 +From: "Avi Bleiweiss" +To: , + +Here at Shutterfly we have augmented the file based tiff library to support +C++ streams. The implementation is an adaptor class, which takes any C++ +stream from the user and in return it deposits i/o operation method pointers +(e.g. read, write, seek and close) into the tiff's library client state. + +The class TiffStream has an overloaded factory method - makeFileStream - +which takes the C++ stream as an argument, calls TIFFClientOpen and returns +a tiff handle. The class retains the tiff handle in its local state and +provides a helper function (getTiffHandle) to query the handle at any time. +Additional helper method - getStreamSize - provides the stream size to the +user. The implementation assumes client responsibility to delete the stream +object. The class calls TIFFClose at destruction time. + +Attached are a definition (tiffstream.h) and an implementation +(tiffstream.cpp) files of the TiffStream class. No changes are required to +the tiff core piece and the class sits on top of the library. The code is +fairly tested at this point and is used internally in Shutterfly imaging +software. The code is portable across WindowsNT/Linux/Solaris. + +We at Shutterfly believe this software has benefits to the larger community +of tiff library users and would like to contribute this software to be part +of the tiff distributed package. Let me know of any issue. + +Thanks +Avi diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.cpp b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.cpp new file mode 100644 index 0000000..ffff687 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.cpp @@ -0,0 +1,238 @@ +// tiff stream interface class implementation + +#include "tiffstream.h" + +const char* TiffStream::m_name = "TiffStream"; + +TiffStream::TiffStream() +{ + m_tif = NULL; + + + m_inStream = NULL; + m_outStream = NULL; + m_ioStream = NULL; + + m_streamLength = 0; + + m_this = reinterpret_cast(this); +}; + +TiffStream::~TiffStream() +{ + if(m_tif != NULL) TIFFClose(m_tif); +} + +TIFF* +TiffStream::makeFileStream(istream* str) +{ + m_inStream = str; + m_outStream = NULL; + m_ioStream = NULL; + m_streamLength = getSize(m_this); + + m_tif = TIFFClientOpen(m_name, + "r", + m_this, + read, + write, + seek, + close, + size, + map, + unmap); + return m_tif; +} + +TIFF* +TiffStream::makeFileStream(ostream* str) +{ + m_inStream = NULL; + m_outStream = str; + m_ioStream = NULL; + m_streamLength = getSize(m_this); + + m_tif = TIFFClientOpen(m_name, + "w", + m_this, + read, + write, + seek, + close, + size, + map, + unmap); + return m_tif; +} + +TIFF* +TiffStream::makeFileStream(iostream* str) +{ + m_inStream = NULL; + m_outStream = NULL; + m_ioStream = str; + m_streamLength = getSize(m_this); + + m_tif = TIFFClientOpen(m_name, + "r+w", + m_this, + read, + write, + seek, + close, + size, + map, + unmap); + return m_tif; +} + +tsize_t +TiffStream::read(thandle_t fd, tdata_t buf, tsize_t size) +{ + istream* istr; + TiffStream* ts = reinterpret_cast(fd); + if(ts->m_inStream != NULL) { + istr = ts->m_inStream; + } else if(ts->m_ioStream != NULL) { + istr = ts->m_ioStream; + } + + int remain = ts->m_streamLength - ts->tell(fd); + int actual = remain < size ? remain : size; + istr->read(reinterpret_cast(buf), actual); + return istr->gcount(); +} + +tsize_t +TiffStream::write(thandle_t fd, tdata_t buf, tsize_t size) +{ + TiffStream* ts = reinterpret_cast(fd); + ostream* ostr; + if(ts->m_outStream != NULL) { + ostr = ts->m_outStream; + } else if(ts->m_ioStream != NULL) { + ostr = ts->m_ioStream; + } + + streampos start = ostr->tellp(); + ostr->write(reinterpret_cast(buf), size); + return ostr->tellp() - start; +} + +toff_t +TiffStream::seek(thandle_t fd, toff_t offset, int origin) +{ + TiffStream* ts = reinterpret_cast(fd); + if(ts->seekInt(fd, offset, origin) == true) return offset; + else return -1; +} + +int +TiffStream::close(thandle_t fd) +{ + TiffStream* ts = reinterpret_cast(fd); + if(ts->m_inStream != NULL) { + ts->m_inStream = NULL; + return 0; + } else if(ts->m_outStream != NULL) { + ts->m_outStream = NULL; + return 0; + } else if(ts->m_ioStream != NULL) { + ts->m_ioStream = NULL; + return 0; + } + return -1; +} + +toff_t +TiffStream::size(thandle_t fd) +{ + TiffStream* ts = reinterpret_cast(fd); + return ts->getSize(fd); +} + +int +TiffStream::map(thandle_t fd, tdata_t* phase, toff_t* psize) +{ + return 0; +} + +void +TiffStream::unmap(thandle_t fd, tdata_t base, tsize_t size) +{ +} + +unsigned int +TiffStream::getSize(thandle_t fd) +{ + if(!isOpen(fd)) return 0; + + unsigned int pos = tell(fd); + seekInt(fd, 0, end); + unsigned int size = tell(fd); + seekInt(fd, pos, beg); + + return size; +} + +unsigned int +TiffStream::tell(thandle_t fd) +{ + TiffStream* ts = reinterpret_cast(fd); + if(ts->m_inStream != NULL) { + return ts->m_inStream->tellg(); + } else if(ts->m_outStream != NULL) { + return ts->m_outStream->tellp(); + } else if(ts->m_ioStream != NULL) { + return ts->m_ioStream->tellg(); + } + return 0; +} + +bool +TiffStream::seekInt(thandle_t fd, unsigned int offset, int origin) +{ + if(!isOpen(fd)) return false; + + ios::seek_dir org; + switch(origin) { + case beg: + org = ios::beg; + break; + case cur: + org = ios::cur; + break; + case end: + org = ios::end; + break; + } + + TiffStream* ts = reinterpret_cast(fd); + if(ts->m_inStream != NULL) { + ts->m_inStream->seekg(offset, org); + return true; + } else if(ts->m_outStream != NULL) { + ts->m_outStream->seekp(offset, org); + return true; + } else if(ts->m_ioStream != NULL) { + ts->m_ioStream->seekg(offset, org); + ts->m_ioStream->seekp(offset, org); + return true; + } + return false; +} + +bool +TiffStream::isOpen(thandle_t fd) +{ + TiffStream* ts = reinterpret_cast(fd); + return (ts->m_inStream != NULL || + ts->m_outStream != NULL || + ts->m_ioStream != NULL); +}/* + * Local Variables: + * mode: c++ + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.h new file mode 100644 index 0000000..a583ae2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/stream/tiffstream.h @@ -0,0 +1,70 @@ +// tiff stream interface class definition + +#ifndef _TIFF_STREAM_H_ +#define _TIFF_STREAM_H_ + +#include + +#include "tiffio.h" + +class TiffStream { + +public: + // ctor/dtor + TiffStream(); + ~TiffStream(); + +public: + enum SeekDir { + beg, + cur, + end, + }; + +public: + // factory methods + TIFF* makeFileStream(iostream* str); + TIFF* makeFileStream(istream* str); + TIFF* makeFileStream(ostream* str); + +public: + // tiff client methods + static tsize_t read(thandle_t fd, tdata_t buf, tsize_t size); + static tsize_t write(thandle_t fd, tdata_t buf, tsize_t size); + static toff_t seek(thandle_t fd, toff_t offset, int origin); + static toff_t size(thandle_t fd); + static int close(thandle_t fd); + static int map(thandle_t fd, tdata_t* phase, toff_t* psize); + static void unmap(thandle_t fd, tdata_t base, tsize_t size); + +public: + // query method + TIFF* getTiffHandle() const { return m_tif; } + unsigned int getStreamLength() { return m_streamLength; } + +private: + // internal methods + unsigned int getSize(thandle_t fd); + unsigned int tell(thandle_t fd); + bool seekInt(thandle_t fd, unsigned int offset, int origin); + bool isOpen(thandle_t fd); + +private: + thandle_t m_this; + TIFF* m_tif; + static const char* m_name; + istream* m_inStream; + ostream* m_outStream; + iostream* m_ioStream; + int m_streamLength; + +}; + +#endif // _TIFF_STREAM_H_ +/* + * Local Variables: + * mode: c++ + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.am new file mode 100644 index 0000000..9d92444 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = README listtif.c maketif.c xtif_dir.c xtiffio.h xtiffiop.h + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.in new file mode 100644 index 0000000..f326150 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/tags +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README listtif.c maketif.c xtif_dir.c xtiffio.h xtiffiop.h +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/tags/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/tags/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/README b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/README new file mode 100644 index 0000000..73c6c21 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/README @@ -0,0 +1,132 @@ + +NOTE: Sept/2004 + +The following described approach to managing tag extensions has been +mostly superceeded since libtiff 3.6.0. The described approach requires +internal knowledge of the libtiff API and tends to be very fragile +in the face of libtiff upgrades. + +Please read over the html/addingtags.html in preference to the below +described approach. + + + +================================== + +Client module for adding to LIBTIFF tagset +------------------------------------------- + Author: Niles Ritter + + + + +In the past, users of the "libtiff" package had to modify the +source code of the library if they required additional private tags +or codes not recognized by libtiff. Thus, whenever +a new revision of libtiff came out the client would have to +perform modifications to six or seven different files to re-install +their tags. + +The latest versions of libtiff now provide client software new routines, +giving them the opportunity to install private extensions at runtime, +rather than compile-time. This means that the client may encapsulate +all of their private tags into a separate module, which need only +be recompiled when new versions of libtiff are released; no manual +editing of files is required. + +How it works +------------ + +The mechanism for overriding the tag access has been enabled with +a single new routine, which has the following calling sequence: + + TIFFExtendProc old_extender; + + old_extender = TIFFSetTagExtender(tag_extender); + +which must be called prior to opening or creating TIFF files. + +This routine sets a static pointer to the user-specified function +, which in turn is called by TIFFDefaultDirectory(), +just after the usual TIFFSetField() and TIFFGetField() methods +are defined, and just before the compression tag is set. It also +returns a pointer to the previously-defined value of the tag-extender, +so that multiple clients may be installed. + +The TIFFExtendProc method that you define should be used to override +the TIFF file's "vsetfield" and "vgetfield" methods, so that you +can trap your new, private tags, and install their values into +a private directory structure. For your convienience, a new pointer +has also been added to the "TIFF" file structure: + + tidata_t tif_clientdir; /* client TIFF directory */ + +into which you may install whatever private directory structures you like. +You should also override the tag-printing method from within your +"vsetfield" method, to permit the symbolic printing of your new tags. + + +Example Client Code: +-------------------- + +An example module has been provided as a template for installing +your own tags into a client tag extender. The module is called +"xtif_dir.c", and defines all of the interface routines, tag field +access, tag printing, etc. for most purpose. + +To see how the client module operates, there are three "fake" +tags currently installed. If you use the existing makefile you can +build them with: + + make all -f Makefile.gcc !or Makefile.mpw + maketif + listtif + +This will build two example programs called "maketif" and "listtif" +and then run them. These programs do nothing more than create a small +file called "newtif.tif", install the fake tags, and then list them out +using TIFFPrintDirectory(). + +Installing Private Tags +----------------------- + +To use this module for installing your own tags, edit each of the files + + xtif_dir.c + xtiffio.h + xtiffiop.h + +and search for the string "XXX". At these locations the comments +will direct you how to install your own tag values, define their +types, etc. Three examples tags are currently installed, demonstrating +how to implement multi-valued tags, single-valued tags, and ASCII tags. +The examples are not valid, registered tags, so you must replace them with +your own. + +To test the routines, also edit the test programs "maketif.c" and +"listtif.c" and replace the portions of the code that set the +private tag values and list them. + +Once you have edited these files, you may build the client module +with the Makefile provided, and run the test programs. + +To use these files in your own code, the "xtif_dir.c" module defines +replacement routines for the standard "TIFFOpen()" "TIFFFdOpen", +and "TIFFClose()" routines, called XTIFFOpen, XTIFFFdOpen and XTIFFClose. +You must use these routines in order to have the extended tag handlers +installed. Once installed, the standard TIFFGetField() and TIFFSetField +routines may be used as before. + +Adding Extended Tags to "tools" +------------------------------- +To create an extended-tag savvy "tiffinfo" program or other utility, you may +simply recompile and link the tools to your "libxtiff" library, adding + + -DTIFFOpen=XTIFFOpen -DTIFFClose=XTIFFClose -DTIFFFdOpen=XTIFFFdOpen + +to the compile statement. + +Bugs, Comments Etc: +------------------ + Send all reports and suggestions to ndr@tazboy.jpl.nasa.gov + (Niles Ritter). diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/listtif.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/listtif.c new file mode 100644 index 0000000..605de84 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/listtif.c @@ -0,0 +1,39 @@ +/* + * listtif.c -- lists a tiff file. + */ + +#include "xtiffio.h" +#include + +void main(int argc,char *argv[]) +{ + char *fname="newtif.tif"; + int flags; + + TIFF *tif=(TIFF*)0; /* TIFF-level descriptor */ + + if (argc>1) fname=argv[1]; + + tif=XTIFFOpen(fname,"r"); + if (!tif) goto failure; + + /* We want the double array listed */ + flags = TIFFPRINT_MYMULTIDOUBLES; + + TIFFPrintDirectory(tif,stdout,flags); + XTIFFClose(tif); + exit (0); + +failure: + printf("failure in listtif\n"); + if (tif) XTIFFClose(tif); + exit (-1); +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/maketif.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/maketif.c new file mode 100644 index 0000000..e965201 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/maketif.c @@ -0,0 +1,77 @@ +/* + * maketif.c -- creates a little TIFF file, with + * the XTIFF extended tiff example tags. + */ + +#include +#include "xtiffio.h" + + +void SetUpTIFFDirectory(TIFF *tif); +void WriteImage(TIFF *tif); + +#define WIDTH 20 +#define HEIGHT 20 + +void main() +{ + TIFF *tif=(TIFF*)0; /* TIFF-level descriptor */ + + tif=XTIFFOpen("newtif.tif","w"); + if (!tif) goto failure; + + SetUpTIFFDirectory(tif); + WriteImage(tif); + + XTIFFClose(tif); + exit (0); + +failure: + printf("failure in maketif\n"); + if (tif) XTIFFClose(tif); + exit (-1); +} + + +void SetUpTIFFDirectory(TIFF *tif) +{ + double mymulti[6]={0.0,1.0,2.0, 3.1415926, 5.0,1.0}; + uint32 mysingle=3456; + char *ascii="This file was produced by Steven Spielberg. NOT"; + + TIFFSetField(tif,TIFFTAG_IMAGEWIDTH,WIDTH); + TIFFSetField(tif,TIFFTAG_IMAGELENGTH,HEIGHT); + TIFFSetField(tif,TIFFTAG_COMPRESSION,COMPRESSION_NONE); + TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_MINISBLACK); + TIFFSetField(tif,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG); + TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,8); + TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP,20); + + /* Install the extended TIFF tag examples */ + TIFFSetField(tif,TIFFTAG_EXAMPLE_MULTI,6,mymulti); + TIFFSetField(tif,TIFFTAG_EXAMPLE_SINGLE,mysingle); + TIFFSetField(tif,TIFFTAG_EXAMPLE_ASCII,ascii); +} + + +void WriteImage(TIFF *tif) +{ + int i; + char buffer[WIDTH]; + + memset(buffer,0,sizeof(buffer)); + for (i=0;itif_clientdata, "WriteImage","failure in WriteScanline\n"); +} + + + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtif_dir.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtif_dir.c new file mode 100644 index 0000000..e67a6ab --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtif_dir.c @@ -0,0 +1,350 @@ +/* + * xtif_dir.c + * + * Extended TIFF Directory Tag Support. + * + * You may use this file as a template to add your own + * extended tags to the library. Only the parts of the code + * marked with "XXX" require modification. Three example tags + * are shown; you should replace them with your own. + * + * Author: Niles D. Ritter + */ + +#include "xtiffiop.h" +#include + +/* Tiff info structure. + * + * Entry format: + * { TAGNUMBER, ReadCount, WriteCount, DataType, FIELDNUM, + * OkToChange, PassDirCountOnSet, AsciiName } + * + * For ReadCount, WriteCount, -1 = unknown; used for mult-valued + * tags and ASCII. + */ + +static const TIFFFieldInfo xtiffFieldInfo[] = { + + /* XXX Replace these example tags with your own extended tags */ + { TIFFTAG_EXAMPLE_MULTI, -1,-1, TIFF_DOUBLE, FIELD_EXAMPLE_MULTI, + TRUE, TRUE, "MyMultivaluedTag" }, + { TIFFTAG_EXAMPLE_SINGLE, 1, 1, TIFF_LONG, FIELD_EXAMPLE_SINGLE, + TRUE, FALSE, "MySingleLongTag" }, + { TIFFTAG_EXAMPLE_ASCII, -1,-1, TIFF_ASCII, FIELD_EXAMPLE_ASCII, + TRUE, FALSE, "MyAsciiTag" }, +}; +#define N(a) (sizeof (a) / sizeof (a[0])) + + +static void +_XTIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) +{ + xtiff *xt = XTIFFDIR(tif); + XTIFFDirectory *xd = &xt->xtif_dir; + int i,num; + + /* call the inherited method */ + if (PARENT(xt,printdir)) + (PARENT(xt,printdir))(tif,fd,flags); + + /* XXX Add field printing here. Replace the three example + * tags implemented below with your own. + */ + + fprintf(fd,"--My Example Tags--\n"); + + /* Our first example tag may have a lot of values, so we + * will only print them out if the TIFFPRINT_MYMULTIDOUBLES + * flag is passed into the print method. + */ + if (TIFFFieldSet(tif,FIELD_EXAMPLE_MULTI)) + { + fprintf(fd, " My Multi-Valued Doubles:"); + if (flags & TIFFPRINT_MYMULTIDOUBLES) + { + double *value = xd->xd_example_multi; + + num = xd->xd_num_multi; + fprintf(fd,"("); + for (i=0;ixd_example_single); + } + + if (TIFFFieldSet(tif,FIELD_EXAMPLE_ASCII)) + { + _TIFFprintAsciiTag(fd,"My ASCII Tag", + xd->xd_example_ascii); + } +} + +static int +_XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) +{ + xtiff *xt = XTIFFDIR(tif); + XTIFFDirectory* xd = &xt->xtif_dir; + int status = 1; + uint32 v32=0; + int i=0, v=0; + va_list ap1 = ap; + + /* va_start is called by the calling routine */ + + switch (tag) { + /* + * XXX put your extended tags here; replace the implemented + * example tags with your own. + */ + case TIFFTAG_EXAMPLE_MULTI: + /* multi-valued tags need to store the count as well */ + xd->xd_num_multi = (uint16) va_arg(ap, int); + _TIFFsetDoubleArray(&xd->xd_example_multi, va_arg(ap, double*), + (long) xd->xd_num_multi); + break; + case TIFFTAG_EXAMPLE_SINGLE: + xd->xd_example_single = va_arg(ap, uint32); + break; + case TIFFTAG_EXAMPLE_ASCII: + _TIFFsetString(&xd->xd_example_ascii, va_arg(ap, char*)); + break; + default: + /* call the inherited method */ + return (PARENT(xt,vsetfield))(tif,tag,ap); + break; + } + if (status) { + /* we have to override the print method here, + * after the compression tags have gotten to it. + * This makes sense because the only time we would + * need the extended print method is if an extended + * tag is set by the reader. + */ + if (!(xt->xtif_flags & XTIFFP_PRINT)) + { + PARENT(xt,printdir) = TIFFMEMBER(tif,printdir); + TIFFMEMBER(tif,printdir) = _XTIFFPrintDirectory; + xt->xtif_flags |= XTIFFP_PRINT; + } + TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit); + tif->tif_flags |= TIFF_DIRTYDIRECT; + } + va_end(ap); + return (status); +badvalue: + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%d: Bad value for \"%s\"", v, + _TIFFFieldWithTag(tif, tag)->field_name); + va_end(ap); + return (0); +badvalue32: + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%ld: Bad value for \"%s\"", v32, + _TIFFFieldWithTag(tif, tag)->field_name); + va_end(ap); + return (0); +} + + +static int +_XTIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) +{ + xtiff *xt = XTIFFDIR(tif); + XTIFFDirectory* xd = &xt->xtif_dir; + + switch (tag) { + /* + * XXX put your extended tags here; replace the implemented + * example tags with your own. + */ + case TIFFTAG_EXAMPLE_MULTI: + *va_arg(ap, uint16*) = xd->xd_num_multi; + *va_arg(ap, double**) = xd->xd_example_multi; + break; + case TIFFTAG_EXAMPLE_ASCII: + *va_arg(ap, char**) = xd->xd_example_ascii; + break; + case TIFFTAG_EXAMPLE_SINGLE: + *va_arg(ap, uint32*) = xd->xd_example_single; + break; + default: + /* return inherited method */ + return (PARENT(xt,vgetfield))(tif,tag,ap); + break; + } + return (1); +} + +#define CleanupField(member) { \ + if (xd->member) { \ + _TIFFfree(xd->member); \ + xd->member = 0; \ + } \ +} +/* + * Release storage associated with a directory. + */ +static void +_XTIFFFreeDirectory(xtiff* xt) +{ + XTIFFDirectory* xd = &xt->xtif_dir; + + /* + * XXX - Purge all Your allocated memory except + * for the xtiff directory itself. This includes + * all fields that require a _TIFFsetXXX call in + * _XTIFFVSetField(). + */ + + CleanupField(xd_example_multi); + CleanupField(xd_example_ascii); + +} +#undef CleanupField + +static void _XTIFFLocalDefaultDirectory(TIFF *tif) +{ + xtiff *xt = XTIFFDIR(tif); + XTIFFDirectory* xd = &xt->xtif_dir; + + /* Install the extended Tag field info */ + _TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo)); + + /* + * free up any dynamically allocated arrays + * before the new directory is read in. + */ + + _XTIFFFreeDirectory(xt); + _TIFFmemset(xt,0,sizeof(xtiff)); + + /* Override the tag access methods */ + + PARENT(xt,vsetfield) = TIFFMEMBER(tif,vsetfield); + TIFFMEMBER(tif,vsetfield) = _XTIFFVSetField; + PARENT(xt,vgetfield) = TIFFMEMBER(tif,vgetfield); + TIFFMEMBER(tif,vgetfield) = _XTIFFVGetField; + + /* + * XXX Set up any default values here. + */ + + xd->xd_example_single = 234; +} + + + +/********************************************************************** + * Nothing below this line should need to be changed. + **********************************************************************/ + +static TIFFExtendProc _ParentExtender; + +/* + * This is the callback procedure, and is + * called by the DefaultDirectory method + * every time a new TIFF directory is opened. + */ + +static void +_XTIFFDefaultDirectory(TIFF *tif) +{ + xtiff *xt; + + /* Allocate Directory Structure if first time, and install it */ + if (!(tif->tif_flags & XTIFF_INITIALIZED)) + { + xt = _TIFFmalloc(sizeof(xtiff)); + if (!xt) + { + /* handle memory allocation failure here ! */ + return; + } + _TIFFmemset(xt,0,sizeof(xtiff)); + /* + * Install into TIFF structure. + */ + TIFFMEMBER(tif,clientdir) = (tidata_t)xt; + tif->tif_flags |= XTIFF_INITIALIZED; /* dont do this again! */ + } + + /* set up our own defaults */ + _XTIFFLocalDefaultDirectory(tif); + + /* Since an XTIFF client module may have overridden + * the default directory method, we call it now to + * allow it to set up the rest of its own methods. + */ + + if (_ParentExtender) + (*_ParentExtender)(tif); + +} + +/* + * XTIFF Initializer -- sets up the callback + * procedure for the TIFF module. + */ + +static +void _XTIFFInitialize(void) +{ + static first_time=1; + + if (! first_time) return; /* Been there. Done that. */ + first_time = 0; + + /* Grab the inherited method and install */ + _ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory); +} + + +/* + * Public File I/O Routines. + */ +TIFF* +XTIFFOpen(const char* name, const char* mode) +{ + /* Set up the callback */ + _XTIFFInitialize(); + + /* Open the file; the callback will set everything up + */ + return TIFFOpen(name, mode); +} + +TIFF* +XTIFFFdOpen(int fd, const char* name, const char* mode) +{ + /* Set up the callback */ + _XTIFFInitialize(); + + /* Open the file; the callback will set everything up + */ + return TIFFFdOpen(fd, name, mode); +} + + +void +XTIFFClose(TIFF *tif) +{ + xtiff *xt = XTIFFDIR(tif); + + /* call inherited function first */ + TIFFClose(tif); + + /* Free up extended allocated memory */ + _XTIFFFreeDirectory(xt); + _TIFFfree(xt); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffio.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffio.h new file mode 100644 index 0000000..e8600df --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffio.h @@ -0,0 +1,59 @@ +/* + * xtiffio.h -- Public interface to Extended TIFF tags + * + * This is a template for defining a client module + * which supports tag extensions to the standard libtiff + * set. Only portions of the code marked "XXX" need to + * be changed to support your tag set. + * + * written by: Niles D. Ritter + */ + +#ifndef __xtiffio_h +#define __xtiffio_h + +#include "tiffio.h" + +/* + * XXX Define your private Tag names and values here + */ + +/* These tags are not valid, but are provided for example */ +#define TIFFTAG_EXAMPLE_MULTI 61234 +#define TIFFTAG_EXAMPLE_SINGLE 61235 +#define TIFFTAG_EXAMPLE_ASCII 61236 + +/* + * XXX Define Printing method flags. These + * flags may be passed in to TIFFPrintDirectory() to + * indicate that those particular field values should + * be printed out in full, rather than just an indicator + * of whether they are present or not. + */ +#define TIFFPRINT_MYMULTIDOUBLES 0x80000000 + +/********************************************************************** + * Nothing below this line should need to be changed by the user. + **********************************************************************/ + +#if defined(__cplusplus) +extern "C" { +#endif + +extern TIFF* XTIFFOpen(const char* name, const char* mode); +extern TIFF* XTIFFFdOpen(int fd, const char* name, const char* mode); +extern void XTIFFClose(TIFF *tif); + +#if defined(__cplusplus) +} +#endif + +#endif /* __xtiffio_h */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffiop.h b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffiop.h new file mode 100644 index 0000000..9d534a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/tags/xtiffiop.h @@ -0,0 +1,72 @@ +/* + * Private Extended TIFF library interface. + * + * uses private LIBTIFF interface. + * + * The portions of this module marked "XXX" should be + * modified to support your tags instead. + * + * written by: Niles D. Ritter + * + */ + +#ifndef __xtiffiop_h +#define __xtiffiop_h + +#include "tiffiop.h" +#include "xtiffio.h" + +/********************************************************************** + * User Configuration + **********************************************************************/ + +/* XXX - Define number of your extended tags here */ +#define NUM_XFIELD 3 +#define XFIELD_BASE (FIELD_LAST-NUM_XFIELD) + +/* XXX - Define your Tag Fields here */ +#define FIELD_EXAMPLE_MULTI (XFIELD_BASE+0) +#define FIELD_EXAMPLE_SINGLE (XFIELD_BASE+1) +#define FIELD_EXAMPLE_ASCII (XFIELD_BASE+2) + + +/* XXX - Define Private directory tag structure here */ +struct XTIFFDirectory { + uint16 xd_num_multi; /* dir-count for the multi tag */ + double* xd_example_multi; + uint32 xd_example_single; + char* xd_example_ascii; +}; +typedef struct XTIFFDirectory XTIFFDirectory; + +/********************************************************************** + * Nothing below this line should need to be changed by the user. + **********************************************************************/ + +struct xtiff { + TIFF *xtif_tif; /* parent TIFF pointer */ + uint32 xtif_flags; +#define XTIFFP_PRINT 0x00000001 + XTIFFDirectory xtif_dir; /* internal rep of current directory */ + TIFFVSetMethod xtif_vsetfield; /* inherited tag set routine */ + TIFFVGetMethod xtif_vgetfield; /* inherited tag get routine */ + TIFFPrintMethod xtif_printdir; /* inherited dir print method */ +}; +typedef struct xtiff xtiff; + + +#define PARENT(xt,pmember) ((xt)->xtif_ ## pmember) +#define TIFFMEMBER(tf,pmember) ((tf)->tif_ ## pmember) +#define XTIFFDIR(tif) ((xtiff *)TIFFMEMBER(tif,clientdir)) + +/* Extended TIFF flags */ +#define XTIFF_INITIALIZED 0x80000000 + +#endif /* __xtiffiop_h */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.am new file mode 100644 index 0000000..2bdccd0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.am @@ -0,0 +1,27 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = Makefile.w95 README.Tiffile README.tiff2dib Tiffile.cpp tiff2dib.c + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.in new file mode 100644 index 0000000..b58adf6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.in @@ -0,0 +1,453 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = contrib/win_dib +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = Makefile.w95 README.Tiffile README.tiff2dib Tiffile.cpp tiff2dib.c +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/win_dib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign contrib/win_dib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.w95 b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.w95 new file mode 100644 index 0000000..3f461ef --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Makefile.w95 @@ -0,0 +1,134 @@ +# $Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.w95,v 1.2 1994/11/28 +06:13:31 sam Exp $ +# +# Tag Image File Format Library +# +# Copyright (c) 1988, 1989, 1990, 1991, 1992 Sam Leffler +# Copyright (c) 1991, 1992 Silicon Graphics, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# This Makefile is for use with microsoft nmake version 1.50 and +# Microsoft 32-bit C/C++ Compiler 9.00 +# +DESTDIR=. +# +IPATH= -I. +CONF_LIBRARY=$(NULL) +COPTS= -Oxa -DBSDTYPES -Zd +CFLAGS= $(COPTS) $(CONF_LIBRARY) +# +INCS= tiff.h tiffio.h +SRCS= tif_aux.c \ + tif_close.c \ + tif_codec.c \ + tif_compress.c \ + tif_dir.c \ + tif_dirinfo.c \ + tif_dirread.c \ + tif_dirwrite.c \ + tif_dumpmode.c \ + tif_error.c \ + tif_getimage.c \ + tif_jpeg.c \ + tif_flush.c \ + tif_lzw.c \ + tif_next.c \ + tif_open.c \ + tif_packbits.c \ + tif_predict \ + tif_print.c \ + tif_read.c \ + tif_swab.c \ + tif_strip.c \ + tif_thunder.c \ + tif_tile.c \ + tif_version.c \ + tif_warning.c \ + tif_write.c \ + tif_win32.c + + +OBJS= tif_aux.obj \ + tif_close.obj \ + tif_codec.obj \ + tif_compress.obj \ + tif_dir.obj \ + tif_dirinfo.obj \ + tif_dirread.obj \ + tif_dirwrite.obj \ + tif_dumpmode.obj \ + tif_error.obj \ + tif_getimage.obj \ + tif_jpeg.obj \ + tif_flush.obj \ + tif_lzw.obj \ + tif_next.obj \ + tif_open.obj \ + tif_packbits.obj \ + tif_predict.obj \ + tif_print.obj \ + tif_read.obj \ + tif_swab.obj \ + tif_strip.obj \ + tif_thunder.obj \ + tif_tile.obj \ + tif_version.obj \ + tif_warning.obj \ + tif_write.obj \ + tif_win32.obj + + + +ALL= libtiff.lib + +all: $(ALL) + +%.obj : %.c + $(CC) $(CFLAGS) -c $*.c + + +#.INCLUDE .IGNORE : depend + +libtiff.lib: $(OBJS) + - del libtiff.lib + lib /OUT:libtiff.lib $(OBJS) + + +#To include fax3 support, you need to modify mkg3states.c so it could run +#under windows 95 or NT. This application make the file g3state.h. +#after that, you have to add to the build script : tif_fax3.c and tif_fax3.obj +#and define CCITT_SUPPORT in the file tifconf.h + +#$(OBJS): tiffio.h tiff.h tiffcomp.h tiffiop.h tiffconf.h +#tif_fax3.obj: tif_fax3.c g3states.h t4.h tif_fax3.h + +#g3states.h: mkg3states.c t4.h +# $(CC) $(CFLAGS) mkg3states.c +# mkg3states -c > g3states.h + + +clean: + del *.obj + del mkg3stat + del g3states.h + +tags: $(SRCS) + $(CTAGS) $(SRCS) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.Tiffile b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.Tiffile new file mode 100644 index 0000000..82c6e5c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.Tiffile @@ -0,0 +1,31 @@ +Frank, + +I attached a file that uses RGBA interface (tif_getimage.c) to read a tiff +file and convert to a DIB. It's advantage is that it is easy to read *any* +tiff file suported by libtiff and easily convert it to a DIB. The disadvantage +is that bilevel (B&W) bitmaps (and all other non-rgba images) are also +converted to RGBA, thus taking up 32x as much memory as needed (4 bytes per +pixel, rather than 1 bit). I read tiff files, but don't need to +write them. And my files are typically small, so the overhead is mostly +inconsequential. But for bilevel images, I overrode the get() and put() +routines of the RGBA interface to just copy the data from the input raster +to the output raster, rather than expanding out to full 32 bit format. It +would be nice if there were a simple way to handle all palletized images, +but that would take more custom routines, and it's not that important to me. + +Usage: + + m_pDIB = (PBITMAPINFOHEADER)::ReadTIFF(pathName); + if (m_pDIB != 0) { + m_format = IMAGETYPE_TIF; + } + +This is intended as Win32, but the modifications for new get() and put() +routines may be independent of platform. + +Thanks for your work supporting the forum and the library! + +Regards, + +Mark James +mark@james.net diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.tiff2dib b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.tiff2dib new file mode 100644 index 0000000..3e6075f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/README.tiff2dib @@ -0,0 +1,51 @@ + +Date: 04 Dec 95 10:34:23 EST +From: Philippe <100423.3705@compuserve.com> +To: TIFF/sam Leffler +Subject: TIFF library and Windows 95 +Message-Id: <951204153422_100423.3705_BHG101-1@CompuServe.COM> + +Sam, + +First, let me thanks all of you how have worked +on that great TIFF library ! + +Here is some information that may help someone. + +I build the library under Windows 95 as a 32-bit library. +The contribution of Scott Wagner (tif_win32.c) worked fine, but +the makefile "makefile.msc" was unsable because it was +written for DOS or Windows 3.1 and all the files names +are limited to 8 characters. + +Here is the makefile I used : makefile.w95 + +Also, I had to disable fax3 support because I wasn't able +to build (as it is) the tool "mkg3states" to generate the include +file "g3states.h". +This source file must be modify to be build under Windows 95. + +To build the library under Windows 95 with Visual C++ 2.0, +I had to : + +- undefine CCITT_SUPPORT in "tiffconf.h" + +- create the file version.h with this line : + #define VERSION "3.4beta024" + +- build the makefile "makefile.w95" + +I also join the source file "tif2dib.c" that I created, +it contain the function LoadTIFFinDIB that load +a TIFF file and build a memory DIB with it and return the +HANDLE (HDIB) of the memory bloc containing this DIB. +Since DIB is the "natural" bitmap format for Windows 3.1, 95 and NT, +this function sould be usefull for some Windows 95 (or NT) developer. + + +Sorry for my approximate english ... + +Regards, + +Philippe Tenenhaus 100423.3705@compuserve.com +Paris diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Tiffile.cpp b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Tiffile.cpp new file mode 100644 index 0000000..9d958b1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/Tiffile.cpp @@ -0,0 +1,449 @@ +#include "StdAfx.h" + +//#define STRICT +#include +#include +#include +#include // MAX_ constants +#include "diblib.h" + +/*-------------------------------------------------------------------- + READ TIFF + Load the TIFF data from the file into memory. Return + a pointer to a valid DIB (or NULL for errors). + Uses the TIFFRGBA interface to libtiff.lib to convert + most file formats to a useable form. We just keep the 32 bit + form of the data to display, rather than optimizing for the + display. + + Main entry points: + + int ChkTIFF ( LPCTSTR lpszPath ) + PVOID ReadTIFF ( LPCTSTR lpszPath ) + + RETURN + A valid DIB pointer for success; NULL for failure. + + --------------------------------------------------------------------*/ + +#include "TiffLib/tiff.h" +#include "TiffLib/tiffio.h" +#include +#include + + +// piggyback some data on top of the RGBA Image +struct TIFFDibImage { + TIFFRGBAImage tif; + int dibinstalled; +} ; + + +HANDLE LoadTIFFinDIB(LPCTSTR lpFileName); +HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster) ; + +static void +MyWarningHandler(const char* module, const char* fmt, va_list ap) +{ + // ignore all warnings (unused tags, etc) + return; +} + +static void +MyErrorHandler(const char* module, const char* fmt, va_list ap) +{ + return; +} + +// Turn off the error and warning handlers to check if a valid file. +// Necessary because of the way that the Doc loads images and restart files. +int ChkTIFF ( LPCTSTR lpszPath ) +{ + int rtn = 0; + + TIFFErrorHandler eh; + TIFFErrorHandler wh; + + eh = TIFFSetErrorHandler(NULL); + wh = TIFFSetWarningHandler(NULL); + + TIFF* tif = TIFFOpen(lpszPath, "r"); + if (tif) { + rtn = 1; + TIFFClose(tif); + } + + TIFFSetErrorHandler(eh); + TIFFSetWarningHandler(wh); + + return rtn; +} + +void DibInstallHack(TIFFDibImage* img) ; + +PVOID ReadTIFF ( LPCTSTR lpszPath ) +{ + void* pDIB = 0; + TIFFErrorHandler wh; + + wh = TIFFSetWarningHandler(MyWarningHandler); + + if (ChkTIFF(lpszPath)) { + TIFF* tif = TIFFOpen(lpszPath, "r"); + if (tif) { + char emsg[1024]; + + if (TIFFRGBAImageOK(tif, emsg)) { + TIFFDibImage img; + char emsg[1024]; + + if (TIFFRGBAImageBegin(&img.tif, tif, -1, emsg)) { + size_t npixels; + uint32* raster; + + DibInstallHack(&img); + + npixels = img.tif.width * img.tif.height; + raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32)); + if (raster != NULL) { + if (TIFFRGBAImageGet(&img.tif, raster, img.tif.width, img.tif.height)) { + pDIB = TIFFRGBA2DIB(&img, raster); + } + } + _TIFFfree(raster); + } + TIFFRGBAImageEnd(&img.tif); + } + else { + TRACE("Unable to open image(%s): %s\n", lpszPath, emsg ); + } + TIFFClose(tif); + } + } + + TIFFSetWarningHandler(wh); + + return pDIB; +} + + + +HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster) +{ + void* pDIB = 0; + TIFFRGBAImage* img = &dib->tif; + + uint32 imageLength; + uint32 imageWidth; + uint16 BitsPerSample; + uint16 SamplePerPixel; + uint32 RowsPerStrip; + uint16 PhotometricInterpretation; + + BITMAPINFOHEADER bi; + int dwDIBSize ; + + TIFFGetField(img->tif, TIFFTAG_IMAGEWIDTH, &imageWidth); + TIFFGetField(img->tif, TIFFTAG_IMAGELENGTH, &imageLength); + TIFFGetField(img->tif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample); + TIFFGetField(img->tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip); + TIFFGetField(img->tif, TIFFTAG_SAMPLESPERPIXEL, &SamplePerPixel); + TIFFGetField(img->tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation); + + if ( BitsPerSample == 1 && SamplePerPixel == 1 && dib->dibinstalled ) { // bilevel + bi.biSize = sizeof(BITMAPINFOHEADER); + bi.biWidth = imageWidth; + bi.biHeight = imageLength; + bi.biPlanes = 1; // always + bi.biBitCount = 1; + bi.biCompression = BI_RGB; + bi.biSizeImage = WIDTHBYTES(bi.biWidth * bi.biBitCount) * bi.biHeight; + bi.biXPelsPerMeter = 0; + bi.biYPelsPerMeter = 0; + bi.biClrUsed = 0; // must be zero for RGB compression (none) + bi.biClrImportant = 0; // always + + // Get the size of the DIB + dwDIBSize = GetDIBSize( &bi ); + + // Allocate for the BITMAPINFO structure and the color table. + pDIB = GlobalAllocPtr( GHND, dwDIBSize ); + if (pDIB == 0) { + return( NULL ); + } + + // Copy the header info + *((BITMAPINFOHEADER*)pDIB) = bi; + + // Get a pointer to the color table + RGBQUAD *pRgbq = (RGBQUAD *)((LPSTR)pDIB + sizeof(BITMAPINFOHEADER)); + + pRgbq[0].rgbRed = 0; + pRgbq[0].rgbBlue = 0; + pRgbq[0].rgbGreen = 0; + pRgbq[0].rgbReserved = 0; + pRgbq[1].rgbRed = 255; + pRgbq[1].rgbBlue = 255; + pRgbq[1].rgbGreen = 255; + pRgbq[1].rgbReserved = 255; + + // Pointers to the bits + //PVOID pbiBits = (LPSTR)pRgbq + bi.biClrUsed * sizeof(RGBQUAD); + // + // In the BITMAPINFOHEADER documentation, it appears that + // there should be no color table for 32 bit images, but + // experience shows that the image is off by 3 words if it + // is not included. So here it is. + PVOID pbiBits = GetDIBImagePtr((BITMAPINFOHEADER*)pDIB); //(LPSTR)pRgbq + 3 * sizeof(RGBQUAD); + + int sizeWords = bi.biSizeImage/4; + RGBQUAD* rgbDib = (RGBQUAD*)pbiBits; + long* rgbTif = (long*)raster; + + _TIFFmemcpy(pbiBits, raster, bi.biSizeImage); + } + + // For now just always default to the RGB 32 bit form. // save as 32 bit for simplicity + else if ( true /*BitsPerSample == 8 && SamplePerPixel == 3*/ ) { // 24 bit color + + bi.biSize = sizeof(BITMAPINFOHEADER); + bi.biWidth = imageWidth; + bi.biHeight = imageLength; + bi.biPlanes = 1; // always + bi.biBitCount = 32; + bi.biCompression = BI_RGB; + bi.biSizeImage = WIDTHBYTES(bi.biWidth * bi.biBitCount) * bi.biHeight; + bi.biXPelsPerMeter = 0; + bi.biYPelsPerMeter = 0; + bi.biClrUsed = 0; // must be zero for RGB compression (none) + bi.biClrImportant = 0; // always + + // Get the size of the DIB + dwDIBSize = GetDIBSize( &bi ); + + // Allocate for the BITMAPINFO structure and the color table. + pDIB = GlobalAllocPtr( GHND, dwDIBSize ); + if (pDIB == 0) { + return( NULL ); + } + + // Copy the header info + *((BITMAPINFOHEADER*)pDIB) = bi; + + // Get a pointer to the color table + RGBQUAD *pRgbq = (RGBQUAD *)((LPSTR)pDIB + sizeof(BITMAPINFOHEADER)); + + // Pointers to the bits + //PVOID pbiBits = (LPSTR)pRgbq + bi.biClrUsed * sizeof(RGBQUAD); + // + // In the BITMAPINFOHEADER documentation, it appears that + // there should be no color table for 32 bit images, but + // experience shows that the image is off by 3 words if it + // is not included. So here it is. + PVOID pbiBits = (LPSTR)pRgbq + 3 * sizeof(RGBQUAD); + + int sizeWords = bi.biSizeImage/4; + RGBQUAD* rgbDib = (RGBQUAD*)pbiBits; + long* rgbTif = (long*)raster; + + // Swap the byte order while copying + for ( int i = 0 ; i < sizeWords ; ++i ) + { + rgbDib[i].rgbRed = TIFFGetR(rgbTif[i]); + rgbDib[i].rgbBlue = TIFFGetB(rgbTif[i]); + rgbDib[i].rgbGreen = TIFFGetG(rgbTif[i]); + rgbDib[i].rgbReserved = 0; + } + } + + return pDIB; +} + + + + +/////////////////////////////////////////////////////////////// +// +// Hacked from tif_getimage.c in libtiff in v3.5.7 +// +// +typedef unsigned char u_char; + + +#define DECLAREContigPutFunc(name) \ +static void name(\ + TIFFRGBAImage* img, \ + uint32* cp, \ + uint32 x, uint32 y, \ + uint32 w, uint32 h, \ + int32 fromskew, int32 toskew, \ + u_char* pp \ +) + +#define DECLARESepPutFunc(name) \ +static void name(\ + TIFFRGBAImage* img,\ + uint32* cp,\ + uint32 x, uint32 y, \ + uint32 w, uint32 h,\ + int32 fromskew, int32 toskew,\ + u_char* r, u_char* g, u_char* b, u_char* a\ +) + +DECLAREContigPutFunc(putContig1bitTile); +static int getStripContig1Bit(TIFFRGBAImage* img, uint32* uraster, uint32 w, uint32 h); + +//typdef struct TIFFDibImage { +// TIFFRGBAImage tif; +// dibinstalled; +//} TIFFDibImage ; + +void DibInstallHack(TIFFDibImage* dib) { + TIFFRGBAImage* img = &dib->tif; + dib->dibinstalled = false; + switch (img->photometric) { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + switch (img->bitspersample) { + case 1: + img->put.contig = putContig1bitTile; + img->get = getStripContig1Bit; + dib->dibinstalled = true; + break; + } + break; + } +} + +/* + * 1-bit packed samples => 1-bit + * + * Override to just copy the data + */ +DECLAREContigPutFunc(putContig1bitTile) +{ + int samplesperpixel = img->samplesperpixel; + + (void) y; + fromskew *= samplesperpixel; + int wb = WIDTHBYTES(w); + u_char* ucp = (u_char*)cp; + + /* Conver 'w' to bytes from pixels (rounded up) */ + w = (w+7)/8; + + while (h-- > 0) { + _TIFFmemcpy(ucp, pp, w); + /* + for (x = wb; x-- > 0;) { + *cp++ = rgbi(Map[pp[0]], Map[pp[1]], Map[pp[2]]); + pp += samplesperpixel; + } + */ + ucp += (wb + toskew); + pp += (w + fromskew); + } +} + +/* + * Hacked from the tif_getimage.c file. + */ +static uint32 +setorientation(TIFFRGBAImage* img, uint32 h) +{ + TIFF* tif = img->tif; + uint32 y; + + switch (img->orientation) { + case ORIENTATION_BOTRIGHT: + case ORIENTATION_RIGHTBOT: /* XXX */ + case ORIENTATION_LEFTBOT: /* XXX */ + TIFFWarning(TIFFFileName(tif), "using bottom-left orientation"); + img->orientation = ORIENTATION_BOTLEFT; + /* fall thru... */ + case ORIENTATION_BOTLEFT: + y = 0; + break; + case ORIENTATION_TOPRIGHT: + case ORIENTATION_RIGHTTOP: /* XXX */ + case ORIENTATION_LEFTTOP: /* XXX */ + default: + TIFFWarning(TIFFFileName(tif), "using top-left orientation"); + img->orientation = ORIENTATION_TOPLEFT; + /* fall thru... */ + case ORIENTATION_TOPLEFT: + y = h-1; + break; + } + return (y); +} + +/* + * Get a strip-organized image that has + * PlanarConfiguration contiguous if SamplesPerPixel > 1 + * or + * SamplesPerPixel == 1 + * + * Hacked from the tif_getimage.c file. + * + * This is set up to allow us to just copy the data to the raster + * for 1-bit bitmaps + */ +static int +getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + tileContigRoutine put = img->put.contig; + uint16 orientation; + uint32 row, y, nrow, rowstoread; + uint32 pos; + u_char* buf; + uint32 rowsperstrip; + uint32 imagewidth = img->width; + tsize_t scanline; + int32 fromskew, toskew; + tstrip_t strip; + tsize_t stripsize; + u_char* braster = (u_char*)raster; // byte wide raster + uint32 wb = WIDTHBYTES(w); + int ret = 1; + + buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer"); + return (0); + } + y = setorientation(img, h); + orientation = img->orientation; + toskew = -(int32) (orientation == ORIENTATION_TOPLEFT ? wb+wb : wb-wb); + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + scanline = TIFFScanlineSize(tif); + fromskew = (w < imagewidth ? imagewidth - w : 0)/8; + for (row = 0; row < h; row += nrow) + { + rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; + nrow = (row + rowstoread > h ? h - row : rowstoread); + strip = TIFFComputeStrip(tif,row+img->row_offset, 0); + stripsize = ((row + img->row_offset)%rowsperstrip + nrow) * scanline; + if (TIFFReadEncodedStrip(tif, strip, buf, stripsize ) < 0 + && img->stoponerr) + { + ret = 0; + break; + } + + pos = ((row + img->row_offset) % rowsperstrip) * scanline; + (*put)(img, (uint32*)(braster+y*wb), 0, y, w, nrow, fromskew, toskew, buf + pos); + y += (orientation == ORIENTATION_TOPLEFT ?-(int32) nrow : (int32) nrow); + } + _TIFFfree(buf); + return (ret); +} + +/* + * Local Variables: + * mode: c++ + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/tiff2dib.c b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/tiff2dib.c new file mode 100644 index 0000000..475ef30 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/contrib/win_dib/tiff2dib.c @@ -0,0 +1,379 @@ +/************************************************************************* + * + * Source file for Windows 95/Win32. + * + * The function LoadTIFFinDIB in this source file let you load + * a TIFF file and build a memory DIB with it and return the + * HANDLE (HDIB) of the memory bloc containing the DIB. + * + * Example : + * + * HDIB hDIB; + * hDIB = LoadTIFFinDIB("sample.tif"); + * + * + * To build this source file you must include the TIFF library + * in your project. + * + * 4/12/95 Philippe Tenenhaus 100423.3705@compuserve.com + * + ************************************************************************/ + + +#include "tiffio.h" + +#define HDIB HANDLE +#define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER)) +#define CVT(x) (((x) * 255L) / ((1L<<16)-1)) + +static HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount); +static LPSTR FindDIBBits(LPSTR lpDIB); +static WORD PaletteSize(LPSTR lpDIB); +static WORD DIBNumColors(LPSTR lpDIB); +static int checkcmap(int n, uint16* r, uint16* g, uint16* b); + + + +/************************************************************************* + * + * HDIB LoadTIFFinDIB(LPSTR lpFileName) + * + * Parameter: + * + * LPSTR lpDIB - File name of a tiff imag + * + * Return Value: + * + * LPSTR - HANDLE of a DIB + * + * Description: + * + * This function load a TIFF file and build a memory DIB with it + * and return the HANDLE (HDIB) of the memory bloc containing + * the DIB. + * + * 4/12/95 Philippe Tenenhaus 100423.3705@compuserve.com + * + ************************************************************************/ + +HDIB LoadTIFFinDIB(LPSTR lpFileName) +{ + TIFF *tif; + unsigned long imageLength; + unsigned long imageWidth; + unsigned int BitsPerSample; + unsigned long LineSize; + unsigned int SamplePerPixel; + unsigned long RowsPerStrip; + int PhotometricInterpretation; + long nrow; + unsigned long row; + char *buf; + LPBITMAPINFOHEADER lpDIB; + HDIB hDIB; + char *lpBits; + HGLOBAL hStrip; + int i,l; + int Align; + + tif = TIFFOpen(lpFileName, "r"); + + if (!tif) + goto TiffOpenError; + + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imageWidth); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imageLength); + TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &BitsPerSample); + TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip); + TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &RowsPerStrip); + TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation); + + LineSize = TIFFScanlineSize(tif); //Number of byte in ine line + + SamplePerPixel = (int) (LineSize/imageWidth); + + //Align = Number of byte to add at the end of each line of the DIB + Align = 4 - (LineSize % 4); + if (Align == 4) Align = 0; + + + //Create a new DIB + hDIB = CreateDIB((DWORD) imageWidth, (DWORD) imageLength, (WORD) +(BitsPerSample*SamplePerPixel)); + lpDIB = (LPBITMAPINFOHEADER) GlobalLock(hDIB); + if (!lpDIB) + goto OutOfDIBMemory; + + if (lpDIB) + lpBits = FindDIBBits((LPSTR) lpDIB); + + //In the tiff file the lines are save from up to down + //In a DIB the lines must be save from down to up + if (lpBits) + { + lpBits = FindDIBBits((LPSTR) lpDIB); + lpBits+=((imageWidth*SamplePerPixel)+Align)*(imageLength-1); + //now lpBits pointe on the bottom line + + hStrip = GlobalAlloc(GHND,TIFFStripSize(tif)); + buf = GlobalLock(hStrip); + + if (!buf) + goto OutOfBufMemory; + + //PhotometricInterpretation = 2 image is RGB + //PhotometricInterpretation = 3 image have a color palette + if (PhotometricInterpretation == 3) + { + uint16* red; + uint16* green; + uint16* blue; + int16 i; + LPBITMAPINFO lpbmi; + int Palette16Bits; + + TIFFGetField(tif, TIFFTAG_COLORMAP, &red, &green, &blue); + + //Is the palette 16 or 8 bits ? + if (checkcmap(1<= 0; i--) + { + if (Palette16Bits) + { + lpbmi->bmiColors[i].rgbRed =(BYTE) CVT(red[i]); + lpbmi->bmiColors[i].rgbGreen = (BYTE) CVT(green[i]); + lpbmi->bmiColors[i].rgbBlue = (BYTE) CVT(blue[i]); + } + else + { + lpbmi->bmiColors[i].rgbRed = (BYTE) red[i]; + lpbmi->bmiColors[i].rgbGreen = (BYTE) green[i]; + lpbmi->bmiColors[i].rgbBlue = (BYTE) blue[i]; + } + } + + } + + //read the tiff lines and save them in the DIB + //with RGB mode, we have to change the order of the 3 samples RGB +<=> BGR + for (row = 0; row < imageLength; row += RowsPerStrip) + { + nrow = (row + RowsPerStrip > imageLength ? imageLength - row : +RowsPerStrip); + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, row, 0), + buf, nrow*LineSize)==-1) + { + goto TiffReadError; + } + else + { + for (l = 0; l < nrow; l++) + { + if (SamplePerPixel == 3) + for (i=0;i< (int) (imageWidth);i++) + { + lpBits[i*SamplePerPixel+0]=buf[l*LineSize+i*Sample +PerPixel+2]; + lpBits[i*SamplePerPixel+1]=buf[l*LineSize+i*Sample +PerPixel+1]; + lpBits[i*SamplePerPixel+2]=buf[l*LineSize+i*Sample +PerPixel+0]; + } + else + memcpy(lpBits, &buf[(int) (l*LineSize)], (int) +imageWidth*SamplePerPixel); + + lpBits-=imageWidth*SamplePerPixel+Align; + + } + } + } + GlobalUnlock(hStrip); + GlobalFree(hStrip); + GlobalUnlock(hDIB); + TIFFClose(tif); + } + + return hDIB; + + OutOfBufMemory: + + TiffReadError: + GlobalUnlock(hDIB); + GlobalFree(hStrip); + OutOfDIBMemory: + TIFFClose(tif); + TiffOpenError: + return (HANDLE) 0; + + +} + + +static int checkcmap(int n, uint16* r, uint16* g, uint16* b) +{ + while (n-- > 0) + if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) + return (16); + + return (8); +} + + + +/************************************************************************* + * All the following functions were created by microsoft, they are + * parts of the sample project "wincap" given with the SDK Win32. + * + * Microsoft says that : + * + * You have a royalty-free right to use, modify, reproduce and + * distribute the Sample Files (and/or any modified version) in + * any way you find useful, provided that you agree that + * Microsoft has no warranty obligations or liability for any + * Sample Application Files which are modified. + * + ************************************************************************/ + +HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount) +{ + BITMAPINFOHEADER bi; // bitmap header + LPBITMAPINFOHEADER lpbi; // pointer to BITMAPINFOHEADER + DWORD dwLen; // size of memory block + HDIB hDIB; + DWORD dwBytesPerLine; // Number of bytes per scanline + + + // Make sure bits per pixel is valid + if (wBitCount <= 1) + wBitCount = 1; + else if (wBitCount <= 4) + wBitCount = 4; + else if (wBitCount <= 8) + wBitCount = 8; + else if (wBitCount <= 24) + wBitCount = 24; + else + wBitCount = 4; // set default value to 4 if parameter is bogus + + // initialize BITMAPINFOHEADER + bi.biSize = sizeof(BITMAPINFOHEADER); + bi.biWidth = dwWidth; // fill in width from parameter + bi.biHeight = dwHeight; // fill in height from parameter + bi.biPlanes = 1; // must be 1 + bi.biBitCount = wBitCount; // from parameter + bi.biCompression = BI_RGB; + bi.biSizeImage = (dwWidth*dwHeight*wBitCount)/8; //0; // 0's here +mean "default" + bi.biXPelsPerMeter = 2834; //0; + bi.biYPelsPerMeter = 2834; //0; + bi.biClrUsed = 0; + bi.biClrImportant = 0; + + // calculate size of memory block required to store the DIB. This + // block should be big enough to hold the BITMAPINFOHEADER, the color + // table, and the bits + + dwBytesPerLine = (((wBitCount * dwWidth) + 31) / 32 * 4); + dwLen = bi.biSize + PaletteSize((LPSTR)&bi) + (dwBytesPerLine * dwHeight); + + // alloc memory block to store our bitmap + hDIB = GlobalAlloc(GHND, dwLen); + + // major bummer if we couldn't get memory block + if (!hDIB) + { + return NULL; + } + + // lock memory and get pointer to it + lpbi = (VOID FAR *)GlobalLock(hDIB); + + // use our bitmap info structure to fill in first part of + // our DIB with the BITMAPINFOHEADER + *lpbi = bi; + + // Since we don't know what the colortable and bits should contain, + // just leave these blank. Unlock the DIB and return the HDIB. + + GlobalUnlock(hDIB); + + /* return handle to the DIB */ + return hDIB; +} + + +LPSTR FAR FindDIBBits(LPSTR lpDIB) +{ + return (lpDIB + *(LPDWORD)lpDIB + PaletteSize(lpDIB)); +} + + +WORD FAR PaletteSize(LPSTR lpDIB) +{ + /* calculate the size required by the palette */ + if (IS_WIN30_DIB (lpDIB)) + return (DIBNumColors(lpDIB) * sizeof(RGBQUAD)); + else + return (DIBNumColors(lpDIB) * sizeof(RGBTRIPLE)); +} + + +WORD DIBNumColors(LPSTR lpDIB) +{ + WORD wBitCount; // DIB bit count + + /* If this is a Windows-style DIB, the number of colors in the + * color table can be less than the number of bits per pixel + * allows for (i.e. lpbi->biClrUsed can be set to some value). + * If this is the case, return the appropriate value. + */ + + if (IS_WIN30_DIB(lpDIB)) + { + DWORD dwClrUsed; + + dwClrUsed = ((LPBITMAPINFOHEADER)lpDIB)->biClrUsed; + if (dwClrUsed) + return (WORD)dwClrUsed; + } + + /* Calculate the number of colors in the color table based on + * the number of bits per pixel for the DIB. + */ + if (IS_WIN30_DIB(lpDIB)) + wBitCount = ((LPBITMAPINFOHEADER)lpDIB)->biBitCount; + else + wBitCount = ((LPBITMAPCOREHEADER)lpDIB)->bcBitCount; + + /* return number of colors based on bits per pixel */ + switch (wBitCount) + { + case 1: + return 2; + + case 4: + return 16; + + case 8: + return 256; + + default: + return 0; + } +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.am new file mode 100644 index 0000000..8cb6706 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.am @@ -0,0 +1,86 @@ +# +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +docdir = $(LIBTIFF_DOCDIR)/html + +docfiles = \ + addingtags.html \ + bugs.html \ + build.html \ + contrib.html \ + document.html \ + images.html \ + index.html \ + internals.html \ + intro.html \ + libtiff.html \ + misc.html \ + support.html \ + TIFFTechNote2.html \ + tools.html \ + v3.4beta007.html \ + v3.4beta016.html \ + v3.4beta018.html \ + v3.4beta024.html \ + v3.4beta028.html \ + v3.4beta029.html \ + v3.4beta031.html \ + v3.4beta032.html \ + v3.4beta033.html \ + v3.4beta034.html \ + v3.4beta035.html \ + v3.4beta036.html \ + v3.5.1.html \ + v3.5.2.html \ + v3.5.3.html \ + v3.5.4.html \ + v3.5.5.html \ + v3.5.6-beta.html \ + v3.5.7.html \ + v3.6.0.html \ + v3.6.1.html \ + v3.7.0alpha.html \ + v3.7.0beta.html \ + v3.7.0beta2.html \ + v3.7.0.html \ + v3.7.1.html \ + v3.7.2.html \ + v3.7.3.html \ + v3.7.4.html \ + v3.8.0.html \ + v3.8.1.html \ + v3.8.2.html \ + v3.9.0beta.html \ + v3.9.1.html \ + v3.9.2.html \ + v4.0.0.html \ + v4.0.1.html \ + v4.0.2.html + +dist_doc_DATA = $(docfiles) + +SUBDIRS = images man + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.in new file mode 100644 index 0000000..9bb4c60 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/Makefile.in @@ -0,0 +1,753 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = html +DIST_COMMON = $(dist_doc_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" +DATA = $(dist_doc_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = $(LIBTIFF_DOCDIR)/html +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +docfiles = \ + addingtags.html \ + bugs.html \ + build.html \ + contrib.html \ + document.html \ + images.html \ + index.html \ + internals.html \ + intro.html \ + libtiff.html \ + misc.html \ + support.html \ + TIFFTechNote2.html \ + tools.html \ + v3.4beta007.html \ + v3.4beta016.html \ + v3.4beta018.html \ + v3.4beta024.html \ + v3.4beta028.html \ + v3.4beta029.html \ + v3.4beta031.html \ + v3.4beta032.html \ + v3.4beta033.html \ + v3.4beta034.html \ + v3.4beta035.html \ + v3.4beta036.html \ + v3.5.1.html \ + v3.5.2.html \ + v3.5.3.html \ + v3.5.4.html \ + v3.5.5.html \ + v3.5.6-beta.html \ + v3.5.7.html \ + v3.6.0.html \ + v3.6.1.html \ + v3.7.0alpha.html \ + v3.7.0beta.html \ + v3.7.0beta2.html \ + v3.7.0.html \ + v3.7.1.html \ + v3.7.2.html \ + v3.7.3.html \ + v3.7.4.html \ + v3.8.0.html \ + v3.8.1.html \ + v3.8.2.html \ + v3.9.0beta.html \ + v3.9.1.html \ + v3.9.2.html \ + v4.0.0.html \ + v4.0.1.html \ + v4.0.2.html + +dist_doc_DATA = $(docfiles) +SUBDIRS = images man +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign html/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign html/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(docdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-dist_docDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-dist_docDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + cscopelist cscopelist-recursive ctags ctags-recursive \ + distclean distclean-generic distclean-libtool distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dist_docDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-dist_docDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/TIFFTechNote2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/TIFFTechNote2.html new file mode 100644 index 0000000..92bace4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/TIFFTechNote2.html @@ -0,0 +1,707 @@ +
    +DRAFT TIFF Technical Note #2				17-Mar-95
    +============================
    +
    +This Technical Note describes serious problems that have been found in
    +TIFF 6.0's design for embedding JPEG-compressed data in TIFF (Section 22
    +of the TIFF 6.0 spec of 3 June 1992).  A replacement TIFF/JPEG
    +specification is given.  Some corrections to Section 21 are also given.
    +
    +To permit TIFF implementations to continue to read existing files, the 6.0
    +JPEG fields and tag values will remain reserved indefinitely.  However,
    +TIFF writers are strongly discouraged from using the 6.0 JPEG design.  It
    +is expected that the next full release of the TIFF specification will not
    +describe the old design at all, except to note that certain tag numbers
    +are reserved.  The existing Section 22 will be replaced by the
    +specification text given in the second part of this Tech Note.
    +
    +
    +Problems in TIFF 6.0 JPEG
    +=========================
    +
    +Abandoning a published spec is not a step to be taken lightly.  This
    +section summarizes the reasons that have forced this decision.
    +TIFF 6.0's JPEG design suffers from design errors and limitations,
    +ambiguities, and unnecessary complexity.
    +
    +
    +Design errors and limitations
    +-----------------------------
    +
    +The fundamental design error in the existing Section 22 is that JPEG's
    +various tables and parameters are broken out as separate fields which the
    +TIFF control logic must manage.  This is bad software engineering: that
    +information should be treated as private to the JPEG codec
    +(compressor/decompressor).  Worse, the fields themselves are specified
    +without sufficient thought for future extension and without regard to
    +well-established TIFF conventions.  Here are some of the significant
    +problems:
    +
    +* The JPEGxxTable fields do not store the table data directly in the
    +IFD/field structure; rather, the fields hold pointers to information
    +elsewhere in the file.  This requires special-purpose code to be added to
    +*every* TIFF-manipulating application, whether it needs to decode JPEG
    +image data or not.  Even a trivial TIFF editor, for example a program to
    +add an ImageDescription field to a TIFF file, must be explicitly aware of
    +the internal structure of the JPEG-related tables, or else it will probably
    +break the file.  Every other auxiliary field in the TIFF spec contains
    +data, not pointers, and can be copied or relocated by standard code that
    +doesn't know anything about the particular field.  This is a crucial
    +property of the TIFF format that must not be given up.
    +
    +* To manipulate these fields, the TIFF control logic is required to know a
    +great deal about JPEG details, for example such arcana as how to compute
    +the length of a Huffman code table --- the length is not supplied in the
    +field structure and can only be found by inspecting the table contents.
    +This is again a violation of good software practice.  Moreover, it will
    +prevent easy adoption of future JPEG extensions that might change these
    +low-level details.
    +
    +* The design neglects the fact that baseline JPEG codecs support only two
    +sets of Huffman tables: it specifies a separate table for each color
    +component.  This implies that encoders must waste space (by storing
    +duplicate Huffman tables) or else violate the well-founded TIFF convention
    +that prohibits duplicate pointers.  Furthermore, baseline decoders must
    +test to find out which tables are identical, a waste of time and code
    +space.
    +
    +* The JPEGInterchangeFormat field also violates TIFF's proscription against
    +duplicate pointers: the normal strip/tile pointers are expected to point
    +into the larger data area pointed to by JPEGInterchangeFormat.  All TIFF
    +editing applications must be specifically aware of this relationship, since
    +they must maintain it or else delete the JPEGInterchangeFormat field.  The
    +JPEGxxTables fields are also likely to point into the JPEGInterchangeFormat
    +area, creating additional pointer relationships that must be maintained.
    +
    +* The JPEGQTables field is fixed at a byte per table entry; there is no
    +way to support 16-bit quantization values.  This is a serious impediment
    +to extending TIFF to use 12-bit JPEG.
    +
    +* The 6.0 design cannot support using different quantization tables in
    +different strips/tiles of an image (so as to encode some areas at higher
    +quality than others).  Furthermore, since quantization tables are tied
    +one-for-one to color components, the design cannot support table switching
    +options that are likely to be added in future JPEG revisions.
    +
    +
    +Ambiguities
    +-----------
    +
    +Several incompatible interpretations are possible for 6.0's treatment of
    +JPEG restart markers:
    +
    +  * It is unclear whether restart markers must be omitted at TIFF segment
    +    (strip/tile) boundaries, or whether they are optional.
    +
    +  * It is unclear whether the segment size is required to be chosen as
    +    a multiple of the specified restart interval (if any); perhaps the
    +    JPEG codec is supposed to be reset at each segment boundary as if
    +    there were a restart marker there, even if the boundary does not fall
    +    at a multiple of the nominal restart interval.
    +
    +  * The spec fails to address the question of restart marker numbering:
    +    do the numbers begin again within each segment, or not?
    +
    +That last point is particularly nasty.  If we make numbering begin again
    +within each segment, we give up the ability to impose a TIFF strip/tile
    +structure on an existing JPEG datastream with restarts (which was clearly a
    +goal of Section 22's authors).  But the other choice interferes with random
    +access to the image segments: a reader must compute the first restart
    +number to be expected within a segment, and must have a way to reset its
    +JPEG decoder to expect a nonzero restart number first.  This may not even
    +be possible with some JPEG chips.
    +
    +The tile height restriction found on page 104 contradicts Section 15's
    +general description of tiles.  For an image that is not vertically
    +downsampled, page 104 specifies a tile height of one MCU or 8 pixels; but
    +Section 15 requires tiles to be a multiple of 16 pixels high.
    +
    +This Tech Note does not attempt to resolve these ambiguities, so
    +implementations that follow the 6.0 design should be aware that
    +inter-application compatibility problems are likely to arise.
    +
    +
    +Unnecessary complexity
    +----------------------
    +
    +The 6.0 design creates problems for implementations that need to keep the
    +JPEG codec separate from the TIFF control logic --- for example, consider
    +using a JPEG chip that was not designed specifically for TIFF.  JPEG codecs
    +generally want to produce or consume a standard ISO JPEG datastream, not
    +just raw compressed data.  (If they were to handle raw data, a separate
    +out-of-band mechanism would be needed to load tables into the codec.)
    +With such a codec, the TIFF control logic must parse JPEG markers emitted
    +by the codec to create the TIFF table fields (when writing) or synthesize
    +JPEG markers from the TIFF fields to feed the codec (when reading).  This
    +means that the control logic must know a great deal more about JPEG details
    +than we would like.  The parsing and reconstruction of the markers also
    +represents a fair amount of unnecessary work.
    +
    +Quite a few implementors have proposed writing "TIFF/JPEG" files in which
    +a standard JPEG datastream is simply dumped into the file and pointed to
    +by JPEGInterchangeFormat.  To avoid parsing the JPEG datastream, they
    +suggest not writing the JPEG auxiliary fields (JPEGxxTables etc) nor even
    +the basic TIFF strip/tile data pointers.  This approach is incompatible
    +with implementations that handle the full TIFF 6.0 JPEG design, since they
    +will expect to find strip/tile pointers and auxiliary fields.  Indeed this
    +is arguably not TIFF at all, since *all* TIFF-reading applications expect
    +to find strip or tile pointers.  A subset implementation that is not
    +upward-compatible with the full spec is clearly unacceptable.  However,
    +the frequency with which this idea has come up makes it clear that
    +implementors find the existing Section 22 too complex.
    +
    +
    +Overview of the solution
    +========================
    +
    +To solve these problems, we adopt a new design for embedding
    +JPEG-compressed data in TIFF files.  The new design uses only complete,
    +uninterpreted ISO JPEG datastreams, so it should be much more forgiving of
    +extensions to the ISO standard.  It should also be far easier to implement
    +using unmodified JPEG codecs.
    +
    +To reduce overhead in multi-segment TIFF files, we allow JPEG overhead
    +tables to be stored just once in a JPEGTables auxiliary field.  This
    +feature does not violate the integrity of the JPEG datastreams, because it
    +uses the notions of "tables-only datastreams" and "abbreviated image
    +datastreams" as defined by the ISO standard.
    +
    +To prevent confusion with the old design, the new design is given a new
    +Compression tag value, Compression=7.  Readers that need to handle
    +existing 6.0 JPEG files may read both old and new files, using whatever
    +interpretation of the 6.0 spec they did before.  Compression tag value 6
    +and the field tag numbers defined by 6.0 section 22 will remain reserved
    +indefinitely, even though detailed descriptions of them will be dropped
    +from future editions of the TIFF specification.
    +
    +
    +Replacement TIFF/JPEG specification
    +===================================
    +
    +[This section of the Tech Note is expected to replace Section 22 in the
    +next release of the TIFF specification.]
    +
    +This section describes TIFF compression scheme 7, a high-performance
    +compression method for continuous-tone images.
    +
    +Introduction
    +------------
    +
    +This TIFF compression method uses the international standard for image
    +compression ISO/IEC 10918-1, usually known as "JPEG" (after the original
    +name of the standards committee, Joint Photographic Experts Group).  JPEG
    +is a joint ISO/CCITT standard for compression of continuous-tone images.
    +
    +The JPEG committee decided that because of the broad scope of the standard,
    +no one algorithmic procedure was able to satisfy the requirements of all
    +applications.  Instead, the JPEG standard became a "toolkit" of multiple
    +algorithms and optional capabilities.  Individual applications may select
    +a subset of the JPEG standard that meets their requirements.
    +
    +The most important distinction among the JPEG processes is between lossy
    +and lossless compression.  Lossy compression methods provide high
    +compression but allow only approximate reconstruction of the original
    +image.  JPEG's lossy processes allow the encoder to trade off compressed
    +file size against reconstruction fidelity over a wide range.  Typically,
    +10:1 or more compression of full-color data can be obtained while keeping
    +the reconstructed image visually indistinguishable from the original.  Much
    +higher compression ratios are possible if a low-quality reconstructed image
    +is acceptable.  Lossless compression provides exact reconstruction of the
    +source data, but the achievable compression ratio is much lower than for
    +the lossy processes; JPEG's rather simple lossless process typically
    +achieves around 2:1 compression of full-color data.
    +
    +The most widely implemented JPEG subset is the "baseline" JPEG process.
    +This provides lossy compression of 8-bit-per-channel data.  Optional
    +extensions include 12-bit-per-channel data, arithmetic entropy coding for
    +better compression, and progressive/hierarchical representations.  The
    +lossless process is an independent algorithm that has little in
    +common with the lossy processes.
    +
    +It should be noted that the optional arithmetic-coding extension is subject
    +to several US and Japanese patents.  To avoid patent problems, use of
    +arithmetic coding processes in TIFF files intended for inter-application
    +interchange is discouraged.
    +
    +All of the JPEG processes are useful only for "continuous tone" data,
    +in which the difference between adjacent pixel values is usually small.
    +Low-bit-depth source data is not appropriate for JPEG compression, nor
    +are palette-color images good candidates.  The JPEG processes work well
    +on grayscale and full-color data.
    +
    +Describing the JPEG compression algorithms in sufficient detail to permit
    +implementation would require more space than we have here.  Instead, we
    +refer the reader to the References section.
    +
    +
    +What data is being compressed?
    +------------------------------
    +
    +In lossy JPEG compression, it is customary to convert color source data
    +to YCbCr and then downsample it before JPEG compression.  This gives
    +2:1 data compression with hardly any visible image degradation, and it
    +permits additional space savings within the JPEG compression step proper.
    +However, these steps are not considered part of the ISO JPEG standard.
    +The ISO standard is "color blind": it accepts data in any color space.
    +
    +For TIFF purposes, the JPEG compression tag is considered to represent the
    +ISO JPEG compression standard only.  The ISO standard is applied to the
    +same data that would be stored in the TIFF file if no compression were
    +used.  Therefore, if color conversion or downsampling are used, they must
    +be reflected in the regular TIFF fields; these steps are not considered to
    +be implicit in the JPEG compression tag value.  PhotometricInterpretation
    +and related fields shall describe the color space actually stored in the
    +file.  With the TIFF 6.0 field definitions, downsampling is permissible
    +only for YCbCr data, and it must correspond to the YCbCrSubSampling field.
    +(Note that the default value for this field is not 1,1; so the default for
    +YCbCr is to apply downsampling!)  It is likely that future versions of TIFF
    +will provide additional PhotometricInterpretation values and a more general
    +way of defining subsampling, so as to allow more flexibility in
    +JPEG-compressed files.  But that issue is not addressed in this Tech Note.
    +
    +Implementors should note that many popular JPEG codecs
    +(compressor/decompressors) provide automatic color conversion and
    +downsampling, so that the application may supply full-size RGB data which
    +is nonetheless converted to downsampled YCbCr.  This is an implementation
    +convenience which does not excuse the TIFF control layer from its
    +responsibility to know what is really going on.  The
    +PhotometricInterpretation and subsampling fields written to the file must
    +describe what is actually in the file.
    +
    +A JPEG-compressed TIFF file will typically have PhotometricInterpretation =
    +YCbCr and YCbCrSubSampling = [2,1] or [2,2], unless the source data was
    +grayscale or CMYK.
    +
    +
    +Basic representation of JPEG-compressed images
    +----------------------------------------------
    +
    +JPEG compression works in either strip-based or tile-based TIFF files.
    +Rather than repeating "strip or tile" constantly, we will use the term
    +"segment" to mean either a strip or a tile.
    +
    +When the Compression field has the value 7, each image segment contains
    +a complete JPEG datastream which is valid according to the ISO JPEG
    +standard (ISO/IEC 10918-1).  Any sequential JPEG process can be used,
    +including lossless JPEG, but progressive and hierarchical processes are not
    +supported.  Since JPEG is useful only for continuous-tone images, the
    +PhotometricInterpretation of the image shall not be 3 (palette color) nor
    +4 (transparency mask).  The bit depth of the data is also restricted as
    +specified below.
    +
    +Each image segment in a JPEG-compressed TIFF file shall contain a valid
    +JPEG datastream according to the ISO JPEG standard's rules for
    +interchange-format or abbreviated-image-format data.  The datastream shall
    +contain a single JPEG frame storing that segment of the image.  The
    +required JPEG markers within a segment are:
    +	SOI	(must appear at very beginning of segment)
    +	SOFn
    +	SOS	(one for each scan, if there is more than one scan)
    +	EOI	(must appear at very end of segment)
    +The actual compressed data follows SOS; it may contain RSTn markers if DRI
    +is used.
    +
    +Additional JPEG "tables and miscellaneous" markers may appear between SOI
    +and SOFn, between SOFn and SOS, and before each subsequent SOS if there is
    +more than one scan.  These markers include:
    +	DQT
    +	DHT
    +	DAC	(not to appear unless arithmetic coding is used)
    +	DRI
    +	APPn	(shall be ignored by TIFF readers)
    +	COM	(shall be ignored by TIFF readers)
    +DNL markers shall not be used in TIFF files.  Readers should abort if any
    +other marker type is found, especially the JPEG reserved markers;
    +occurrence of such a marker is likely to indicate a JPEG extension.
    +
    +The tables/miscellaneous markers may appear in any order.  Readers are
    +cautioned that although the SOFn marker refers to DQT tables, JPEG does not
    +require those tables to precede the SOFn, only the SOS.  Missing-table
    +checks should be made when SOS is reached.
    +
    +If no JPEGTables field is used, then each image segment shall be a complete
    +JPEG interchange datastream.  Each segment must define all the tables it
    +references.  To allow readers to decode segments in any order, no segment
    +may rely on tables being carried over from a previous segment.
    +
    +When a JPEGTables field is used, image segments may omit tables that have
    +been specified in the JPEGTables field.  Further details appear below.
    +
    +The SOFn marker shall be of type SOF0 for strict baseline JPEG data, of
    +type SOF1 for non-baseline lossy JPEG data, or of type SOF3 for lossless
    +JPEG data.  (SOF9 or SOF11 would be used for arithmetic coding.)  All
    +segments of a JPEG-compressed TIFF image shall use the same JPEG
    +compression process, in particular the same SOFn type.
    +
    +The data precision field of the SOFn marker shall agree with the TIFF
    +BitsPerSample field.  (Note that when PlanarConfiguration=1, this implies
    +that all components must have the same BitsPerSample value; when
    +PlanarConfiguration=2, different components could have different bit
    +depths.)  For SOF0 only precision 8 is permitted; for SOF1, precision 8 or
    +12 is permitted; for SOF3, precisions 2 to 16 are permitted.
    +
    +The image dimensions given in the SOFn marker shall agree with the logical
    +dimensions of that particular strip or tile.  For strip images, the SOFn
    +image width shall equal ImageWidth and the height shall equal RowsPerStrip,
    +except in the last strip; its SOFn height shall equal the number of rows
    +remaining in the ImageLength.  (In other words, no padding data is counted
    +in the SOFn dimensions.)  For tile images, each SOFn shall have width
    +TileWidth and height TileHeight; adding and removing any padding needed in
    +the edge tiles is the concern of some higher level of the TIFF software.
    +(The dimensional rules are slightly different when PlanarConfiguration=2,
    +as described below.)
    +
    +The ISO JPEG standard only permits images up to 65535 pixels in width or
    +height, due to 2-byte fields in the SOFn markers.  In TIFF, this limits
    +the size of an individual JPEG-compressed strip or tile, but the total
    +image size can be greater.
    +
    +The number of components in the JPEG datastream shall equal SamplesPerPixel
    +for PlanarConfiguration=1, and shall be 1 for PlanarConfiguration=2.  The
    +components shall be stored in the same order as they are described at the
    +TIFF field level.  (This applies both to their order in the SOFn marker,
    +and to the order in which they are scanned if multiple JPEG scans are
    +used.)  The component ID bytes are arbitrary so long as each component
    +within an image segment is given a distinct ID.  To avoid any possible
    +confusion, we require that all segments of a TIFF image use the same ID
    +code for a given component.
    +
    +In PlanarConfiguration 1, the sampling factors given in SOFn markers shall
    +agree with the sampling factors defined by the related TIFF fields (or with
    +the default values that are specified in the absence of those fields).
    +
    +When DCT-based JPEG is used in a strip TIFF file, RowsPerStrip is required
    +to be a multiple of 8 times the largest vertical sampling factor, i.e., a
    +multiple of the height of an interleaved MCU.  (For simplicity of
    +specification, we require this even if the data is not actually
    +interleaved.)  For example, if YCbCrSubSampling = [2,2] then RowsPerStrip
    +must be a multiple of 16.  An exception to this rule is made for
    +single-strip images (RowsPerStrip >= ImageLength): the exact value of
    +RowsPerStrip is unimportant in that case.  This rule ensures that no data
    +padding is needed at the bottom of a strip, except perhaps the last strip.
    +Any padding required at the right edge of the image, or at the bottom of
    +the last strip, is expected to occur internally to the JPEG codec.
    +
    +When DCT-based JPEG is used in a tiled TIFF file, TileLength is required
    +to be a multiple of 8 times the largest vertical sampling factor, i.e.,
    +a multiple of the height of an interleaved MCU; and TileWidth is required
    +to be a multiple of 8 times the largest horizontal sampling factor, i.e.,
    +a multiple of the width of an interleaved MCU.  (For simplicity of
    +specification, we require this even if the data is not actually
    +interleaved.)  All edge padding required will therefore occur in the course
    +of normal TIFF tile padding; it is not special to JPEG.
    +
    +Lossless JPEG does not impose these constraints on strip and tile sizes,
    +since it is not DCT-based.
    +
    +Note that within JPEG datastreams, multibyte values appear in the MSB-first
    +order specified by the JPEG standard, regardless of the byte ordering of
    +the surrounding TIFF file.
    +
    +
    +JPEGTables field
    +----------------
    +
    +The only auxiliary TIFF field added for Compression=7 is the optional
    +JPEGTables field.  The purpose of JPEGTables is to predefine JPEG
    +quantization and/or Huffman tables for subsequent use by JPEG image
    +segments.  When this is done, these rather bulky tables need not be
    +duplicated in each segment, thus saving space and processing time.
    +JPEGTables may be used even in a single-segment file, although there is no
    +space savings in that case.
    +
    +JPEGTables:
    +	Tag = 347 (15B.H)
    +	Type = UNDEFINED
    +	N = number of bytes in tables datastream, typically a few hundred
    +JPEGTables provides default JPEG quantization and/or Huffman tables which
    +are used whenever a segment datastream does not contain its own tables, as
    +specified below.
    +
    +Notice that the JPEGTables field is required to have type code UNDEFINED,
    +not type code BYTE.  This is to cue readers that expanding individual bytes
    +to short or long integers is not appropriate.  A TIFF reader will generally
    +need to store the field value as an uninterpreted byte sequence until it is
    +fed to the JPEG decoder.
    +
    +Multibyte quantities within the tables follow the ISO JPEG convention of
    +MSB-first storage, regardless of the byte ordering of the surrounding TIFF
    +file.
    +
    +When the JPEGTables field is present, it shall contain a valid JPEG
    +"abbreviated table specification" datastream.  This datastream shall begin
    +with SOI and end with EOI.  It may contain zero or more JPEG "tables and
    +miscellaneous" markers, namely:
    +	DQT
    +	DHT
    +	DAC	(not to appear unless arithmetic coding is used)
    +	DRI
    +	APPn	(shall be ignored by TIFF readers)
    +	COM	(shall be ignored by TIFF readers)
    +Since JPEG defines the SOI marker to reset the DAC and DRI state, these two
    +markers' values cannot be carried over into any image datastream, and thus
    +they are effectively no-ops in the JPEGTables field.  To avoid confusion,
    +it is recommended that writers not place DAC or DRI markers in JPEGTables.
    +However readers must properly skip over them if they appear.
    +
    +When JPEGTables is present, readers shall load the table specifications
    +contained in JPEGTables before processing image segment datastreams.
    +Image segments may simply refer to these preloaded tables without defining
    +them.  An image segment can still define and use its own tables, subject to
    +the restrictions below.
    +
    +An image segment may not redefine any table defined in JPEGTables.  (This
    +restriction is imposed to allow readers to process image segments in random
    +order without having to reload JPEGTables between segments.)  Therefore, use
    +of JPEGTables divides the available table slots into two groups: "global"
    +slots are defined in JPEGTables and may be used but not redefined by
    +segments; "local" slots are available for local definition and use in each
    +segment.  To permit random access, a segment may not reference any local
    +tables that it does not itself define.
    +
    +
    +Special considerations for PlanarConfiguration 2
    +------------------------------------------------
    +
    +In PlanarConfiguration 2, each image segment contains data for only one
    +color component.  To avoid confusing the JPEG codec, we wish the segments
    +to look like valid single-channel (i.e., grayscale) JPEG datastreams.  This
    +means that different rules must be used for the SOFn parameters.
    +
    +In PlanarConfiguration 2, the dimensions given in the SOFn of a subsampled
    +component shall be scaled down by the sampling factors compared to the SOFn
    +dimensions that would be used in PlanarConfiguration 1.  This is necessary
    +to match the actual number of samples stored in that segment, so that the
    +JPEG codec doesn't complain about too much or too little data.  In strip
    +TIFF files the computed dimensions may need to be rounded up to the next
    +integer; in tiled files, the restrictions on tile size make this case
    +impossible.
    +
    +Furthermore, all SOFn sampling factors shall be given as 1.  (This is
    +merely to avoid confusion, since the sampling factors in a single-channel
    +JPEG datastream have no real effect.)
    +
    +Any downsampling will need to happen externally to the JPEG codec, since
    +JPEG sampling factors are defined with reference to the full-precision
    +component.  In PlanarConfiguration 2, the JPEG codec will be working on
    +only one component at a time and thus will have no reference component to
    +downsample against.
    +
    +
    +Minimum requirements for TIFF/JPEG
    +----------------------------------
    +
    +ISO JPEG is a large and complex standard; most implementations support only
    +a subset of it.  Here we define a "core" subset of TIFF/JPEG which readers
    +must support to claim TIFF/JPEG compatibility.  For maximum
    +cross-application compatibility, we recommend that writers confine
    +themselves to this subset unless there is very good reason to do otherwise.
    +
    +Use the ISO baseline JPEG process: 8-bit data precision, Huffman coding,
    +with no more than 2 DC and 2 AC Huffman tables.  Note that this implies
    +BitsPerSample = 8 for each component.  We recommend deviating from baseline
    +JPEG only if 12-bit data precision or lossless coding is required.
    +
    +Use no subsampling (all JPEG sampling factors = 1) for color spaces other
    +than YCbCr.  (This is, in fact, required with the TIFF 6.0 field
    +definitions, but may not be so in future revisions.)  For YCbCr, use one of
    +the following choices:
    +	YCbCrSubSampling field		JPEG sampling factors
    +	1,1				1h1v, 1h1v, 1h1v
    +	2,1				2h1v, 1h1v, 1h1v
    +	2,2  (default value)		2h2v, 1h1v, 1h1v
    +We recommend that RGB source data be converted to YCbCr for best compression
    +results.  Other source data colorspaces should probably be left alone.
    +Minimal readers need not support JPEG images with colorspaces other than
    +YCbCr and grayscale (PhotometricInterpretation = 6 or 1).
    +
    +A minimal reader also need not support JPEG YCbCr images with nondefault
    +values of YCbCrCoefficients or YCbCrPositioning, nor with values of
    +ReferenceBlackWhite other than [0,255,128,255,128,255].  (These values
    +correspond to the RGB<=>YCbCr conversion specified by JFIF, which is widely
    +implemented in JPEG codecs.)
    +
    +Writers are reminded that a ReferenceBlackWhite field *must* be included
    +when PhotometricInterpretation is YCbCr, because the default
    +ReferenceBlackWhite values are inappropriate for YCbCr.
    +
    +If any subsampling is used, PlanarConfiguration=1 is preferred to avoid the
    +possibly-confusing requirements of PlanarConfiguration=2.  In any case,
    +readers are not required to support PlanarConfiguration=2.
    +
    +If possible, use a single interleaved scan in each image segment.  This is
    +not legal JPEG if there are more than 4 SamplesPerPixel or if the sampling
    +factors are such that more than 10 blocks would be needed per MCU; in that
    +case, use a separate scan for each component.  (The recommended color
    +spaces and sampling factors will not run into that restriction, so a
    +minimal reader need not support more than one scan per segment.)
    +
    +To claim TIFF/JPEG compatibility, readers shall support multiple-strip TIFF
    +files and the optional JPEGTables field; it is not acceptable to read only
    +single-datastream files.  Support for tiled TIFF files is strongly
    +recommended but not required.
    +
    +
    +Other recommendations for implementors
    +--------------------------------------
    +
    +The TIFF tag Compression=7 guarantees only that the compressed data is
    +represented as ISO JPEG datastreams.  Since JPEG is a large and evolving
    +standard, readers should apply careful error checking to the JPEG markers
    +to ensure that the compression process is within their capabilities.  In
    +particular, to avoid being confused by future extensions to the JPEG
    +standard, it is important to abort if unknown marker codes are seen.
    +
    +The point of requiring that all image segments use the same JPEG process is
    +to ensure that a reader need check only one segment to determine whether it
    +can handle the image.  For example, consider a TIFF reader that has access
    +to fast but restricted JPEG hardware, as well as a slower, more general
    +software implementation.  It is desirable to check only one image segment
    +to find out whether the fast hardware can be used.  Thus, writers should
    +try to ensure that all segments of an image look as much "alike" as
    +possible: there should be no variation in scan layout, use of options such
    +as DRI, etc.  Ideally, segments will be processed identically except
    +perhaps for using different local quantization or entropy-coding tables.
    +
    +Writers should avoid including "noise" JPEG markers (COM and APPn markers).
    +Standard TIFF fields provide a better way to transport any non-image data.
    +Some JPEG codecs may change behavior if they see an APPn marker they
    +think they understand; since the TIFF spec requires these markers to be
    +ignored, this behavior is undesirable.
    +
    +It is possible to convert an interchange-JPEG file (e.g., a JFIF file) to
    +TIFF simply by dropping the interchange datastream into a single strip.
    +(However, designers are reminded that the TIFF spec discourages huge
    +strips; splitting the image is somewhat more work but may give better
    +results.)  Conversion from TIFF to interchange JPEG is more complex.  A
    +strip-based TIFF/JPEG file can be converted fairly easily if all strips use
    +identical JPEG tables and no RSTn markers: just delete the overhead markers
    +and insert RSTn markers between strips.  Converting tiled images is harder,
    +since the data will usually not be in the right order (unless the tiles are
    +only one MCU high).  This can still be done losslessly, but it will require
    +undoing and redoing the entropy coding so that the DC coefficient
    +differences can be updated.
    +
    +There is no default value for JPEGTables: standard TIFF files must define all
    +tables that they reference.  For some closed systems in which many files will
    +have identical tables, it might make sense to define a default JPEGTables
    +value to avoid actually storing the tables.  Or even better, invent a
    +private field selecting one of N default JPEGTables settings, so as to allow
    +for future expansion.  Either of these must be regarded as a private
    +extension that will render the files unreadable by other applications.
    +
    +
    +References
    +----------
    +
    +[1] Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
    +Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
    +
    +This is the best short technical introduction to the JPEG algorithms.
    +It is a good overview but does not provide sufficiently detailed
    +information to write an implementation.
    +
    +[2] Pennebaker, William B. and Mitchell, Joan L.  "JPEG Still Image Data
    +Compression Standard", Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
    +638pp.
    +
    +This textbook is by far the most complete exposition of JPEG in existence.
    +It includes the full text of the ISO JPEG standards (DIS 10918-1 and draft
    +DIS 10918-2).  No would-be JPEG implementor should be without it.
    +
    +[3] ISO/IEC IS 10918-1, "Digital Compression and Coding of Continuous-tone
    +Still Images, Part 1: Requirements and guidelines", February 1994.
    +ISO/IEC DIS 10918-2, "Digital Compression and Coding of Continuous-tone
    +Still Images, Part 2: Compliance testing", final approval expected 1994.
    +
    +These are the official standards documents.  Note that the Pennebaker and
    +Mitchell textbook is likely to be cheaper and more useful than the official
    +standards.
    +
    +
    +Changes to Section 21: YCbCr Images
    +===================================
    +
    +[This section of the Tech Note clarifies section 21 to make clear the
    +interpretation of image dimensions in a subsampled image.  Furthermore,
    +the section is changed to allow the original image dimensions not to be
    +multiples of the sampling factors.  This change is necessary to support use
    +of JPEG compression on odd-size images.]
    +
    +Add the following paragraphs to the Section 21 introduction (p. 89),
    +just after the paragraph beginning "When a Class Y image is subsampled":
    +
    +	In a subsampled image, it is understood that all TIFF image
    +	dimensions are measured in terms of the highest-resolution
    +	(luminance) component.  In particular, ImageWidth, ImageLength,
    +	RowsPerStrip, TileWidth, TileLength, XResolution, and YResolution
    +	are measured in luminance samples.
    +
    +	RowsPerStrip, TileWidth, and TileLength are constrained so that
    +	there are an integral number of samples of each component in a
    +	complete strip or tile.  However, ImageWidth/ImageLength are not
    +	constrained.  If an odd-size image is to be converted to subsampled
    +	format, the writer should pad the source data to a multiple of the
    +	sampling factors by replication of the last column and/or row, then
    +	downsample.  The number of luminance samples actually stored in the
    +	file will be a multiple of the sampling factors.  Conversely,
    +	readers must ignore any extra data (outside the specified image
    +	dimensions) after upsampling.
    +
    +	When PlanarConfiguration=2, each strip or tile covers the same
    +	image area despite subsampling; that is, the total number of strips
    +	or tiles in the image is the same for each component.  Therefore
    +	strips or tiles of the subsampled components contain fewer samples
    +	than strips or tiles of the luminance component.
    +
    +	If there are extra samples per pixel (see field ExtraSamples),
    +	these data channels have the same number of samples as the
    +	luminance component.
    +
    +Rewrite the YCbCrSubSampling field description (pp 91-92) as follows
    +(largely to eliminate possibly-misleading references to
    +ImageWidth/ImageLength of the subsampled components):
    +
    +	(first paragraph unchanged)
    +
    +	The two elements of this field are defined as follows:
    +
    +	Short 0: ChromaSubsampleHoriz:
    +
    +	1 = there are equal numbers of luma and chroma samples horizontally.
    +
    +	2 = there are twice as many luma samples as chroma samples
    +	horizontally.
    +
    +	4 = there are four times as many luma samples as chroma samples
    +	horizontally.
    +
    +	Short 1: ChromaSubsampleVert:
    +
    +	1 = there are equal numbers of luma and chroma samples vertically.
    +
    +	2 = there are twice as many luma samples as chroma samples
    +	vertically.
    +
    +	4 = there are four times as many luma samples as chroma samples
    +	vertically.
    +
    +	ChromaSubsampleVert shall always be less than or equal to
    +	ChromaSubsampleHoriz.  Note that Cb and Cr have the same sampling
    +	ratios.
    +
    +	In a strip TIFF file, RowsPerStrip is required to be an integer
    +	multiple of ChromaSubSampleVert (unless RowsPerStrip >=
    +	ImageLength, in which case its exact value is unimportant).
    +	If ImageWidth and ImageLength are not multiples of
    +	ChromaSubsampleHoriz and ChromaSubsampleVert respectively, then the
    +	source data shall be padded to the next integer multiple of these
    +	values before downsampling.
    +
    +	In a tiled TIFF file, TileWidth must be an integer multiple of
    +	ChromaSubsampleHoriz and TileLength must be an integer multiple of
    +	ChromaSubsampleVert.  Padding will occur to tile boundaries.
    +
    +	The default values of this field are [ 2,2 ].  Thus, YCbCr data is
    +	downsampled by default!
    +
    diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/addingtags.html b/thirdparty/LibTIFF/tiff-4.0.3/html/addingtags.html new file mode 100644 index 0000000..452821c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/addingtags.html @@ -0,0 +1,292 @@ + + + +Modifying The TIFF Library + + + + + +

    +Defining New TIFF Tags +

    + +Libtiff has built-in knowledge of all the standard TIFF tags, as +well as extentions. The following describes how to add knowledge of +new tags as builtins to libtiff, or how to application specific tags can +be used by applications without modifying libtiff. +

    + +

    TIFFFieldInfo

    + +How libtiff manages specific tags is primarily controlled by the +definition for that tag value stored internally as a TIFFFieldInfo structure. +This structure looks like this: +

    + +

    +typedef	struct {
    +  ttag_t    field_tag;          /* field's tag */
    +  short	    field_readcount;    /* read count/TIFF_VARIABLE/TIFF_SPP */
    +  short	    field_writecount;   /* write count/TIFF_VARIABLE */
    +  TIFFDataType field_type;      /* type of associated data */
    +  unsigned short field_bit;     /* bit in fieldsset bit vector */
    +  unsigned char field_oktochange;/* if true, can change while writing */
    +  unsigned char field_passcount;/* if true, pass dir count on set */
    +  char	*field_name;		/* ASCII name */
    +} TIFFFieldInfo;
    +
    + +
      +
    • field_tag: the tag number. For instance 277 for the +SamplesPerPixel tag. Builtin tags will generally have a #define in +tiff.h for each known tag.

      + +

    • field_readcount: The number of values which should be read. +The special value TIFF_VARIABLE (-1) indicates that a variable number of +values may be read. The special value TIFFTAG_SPP (-2) indicates that there +should be one value for each sample as defined by TIFFTAG_SAMPLESPERPIXEL. +The special value TIFF_VARIABLE2 (-3) is presumably similar to TIFF_VARIABLE +though I am not sure what the distinction in behaviour is. This field +is TIFF_VARIABLE for variable length ascii fields.

      + +

    • field_writecount: The number of values which should be written. +Generally the same as field_readcount. A few built-in exceptions exist, but +I haven't analysed why they differ.

      + +

    • field_type: Type of the field. One of TIFF_BYTE, TIFF_ASCII, +TIFF_SHORT, TIFF_LONG, TIFF_RATIONAL, TIFF_SBYTE, TIFF_UNDEFINED, +TIFF_SSHORT, TIFF_SLONG, TIFF_SRATIONAL, TIFF_FLOAT, TIFF_DOUBLE or +TIFF_IFD. Note that some fields can support more than one type (for +instance short and long). These fields should have multiple TIFFFieldInfos. +

      + +

    • field_bit: Built-in tags stored in special fields in the +TIFF structure have assigned field numbers to distinguish them (ie. +FIELD_SAMPLESPERPIXEL). New tags should generally just use +FIELD_CUSTOM indicating they are stored in the generic tag list.

      + +

    • field_oktochange: TRUE if it is OK to change this tag value +while an image is being written. FALSE for stuff that must be set once +and then left unchanged (like ImageWidth, or PhotometricInterpretation for +instance).

      + +

    • field_passcount: If TRUE, then the count value must be passed +in TIFFSetField(), and TIFFGetField(), otherwise the count is not required. +This should generally be TRUE for non-ascii variable count tags unless +the count is implicit (such as with the colormap).

      + +

    • field_name: A name for the tag. Normally mixed case (studly caps) +like "StripByteCounts" and relatively short.

      + +

    + +A TIFFFieldInfo definition exists for each built-in tag in the tif_dirinfo.c +file. Some tags which support multiple data types have more than one +definition, one per data type supported.

    + +Various functions exist for getting the internal TIFFFieldInfo definitions, +including _TIFFFindFieldInfo(), and _TIFFFindFieldInfoByName(). See +tif_dirinfo.c for details. There must be some mechanism to get the whole +list, though I don't see it off hand.

    + +

    Default Tag Auto-registration

    + +In libtiff 3.6.0 a new mechanism was introduced allowing libtiff to +read unrecognised tags automatically. When an unknown tags is encountered, +it is automatically internally defined with a default name and a type +derived from the tag value in the file. Applications only need to predefine +application specific tags if they need to be able to set them in a file, or +if particular calling conventions are desired for TIFFSetField() and +TIFFGetField().

    + +When tags are autodefined like this the field_readcount and +field_writecount values are always TIFF_VARIABLE. The +field_passcount is always TRUE, and the field_bit is +FIELD_CUSTOM. The field name will be "Tag %d" where the %d is the tag +number.

    + +

    Defining Application Tags

    + +For various reasons, it is common for applications to want to define +their own tags to store information outside the core TIFF specification. +This is done by calling TIFFMergeFieldInfo() with one or more TIFFFieldInfos. +

    + +The libgeotiff library provides geospatial information extentions within +a TIFF file. First, a set of TIFFFieldInfo's is prepared with information +on the new tags:

    + +

    +static const TIFFFieldInfo xtiffFieldInfo[] = {
    +  
    +  /* XXX Insert Your tags here */
    +    { TIFFTAG_GEOPIXELSCALE,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
    +      TRUE,	TRUE,	"GeoPixelScale" },
    +    { TIFFTAG_GEOTRANSMATRIX,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
    +      TRUE,	TRUE,	"GeoTransformationMatrix" },
    +    { TIFFTAG_GEOTIEPOINTS,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
    +      TRUE,	TRUE,	"GeoTiePoints" },
    +    { TIFFTAG_GEOKEYDIRECTORY, -1,-1, TIFF_SHORT,	FIELD_CUSTOM,
    +      TRUE,	TRUE,	"GeoKeyDirectory" },
    +    { TIFFTAG_GEODOUBLEPARAMS,	-1,-1, TIFF_DOUBLE,	FIELD_CUSTOM,
    +      TRUE,	TRUE,	"GeoDoubleParams" },
    +    { TIFFTAG_GEOASCIIPARAMS,	-1,-1, TIFF_ASCII,	FIELD_CUSTOM,
    +      TRUE,	FALSE,	"GeoASCIIParams" }
    +};
    +
    + +In order to define the tags, we call TIFFMergeFieldInfo() on the +desired TIFF handle with the list of TIFFFieldInfos.

    + +

    +#define	N(a)	(sizeof (a) / sizeof (a[0]))
    +
    +    /* Install the extended Tag field info */
    +    TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo));
    +
    + +The tags need to be defined for each TIFF file opened - and when reading +they should be defined before the tags of the file are read, yet a valid +TIFF * is needed to merge the tags against. In order to get them +registered at the appropriate part of the setup process, it is necessary +to register our merge function as an extender callback with libtiff. +This is done with TIFFSetTagExtender(). We also keep track of the +previous tag extender (if any) so that we can call it from our extender +allowing a chain of customizations to take effect.

    + +

    +static TIFFExtendProc _ParentExtender = NULL;
    +
    +static
    +void _XTIFFInitialize(void)
    +{
    +    static int first_time=1;
    +	
    +    if (! first_time) return; /* Been there. Done that. */
    +    first_time = 0;
    +	
    +    /* Grab the inherited method and install */
    +    _ParentExtender = TIFFSetTagExtender(_XTIFFDefaultDirectory);
    +}
    +
    + +The extender callback is looks like this. It merges in our new fields +and then calls the next extender if there is one in effect.

    + +

    +static void
    +_XTIFFDefaultDirectory(TIFF *tif)
    +{
    +    /* Install the extended Tag field info */
    +    TIFFMergeFieldInfo(tif, xtiffFieldInfo, N(xtiffFieldInfo));
    +
    +    /* Since an XTIFF client module may have overridden
    +     * the default directory method, we call it now to
    +     * allow it to set up the rest of its own methods.
    +     */
    +
    +    if (_ParentExtender) 
    +        (*_ParentExtender)(tif);
    +}
    +
    + +The above approach ensures that our new definitions are used when reading +or writing any TIFF file. However, since on reading we already have +default definitions for tags, it is usually not critical to pre-define them. +If tag definitions are only required for writing custom tags, you can just +call TIFFMergeFieldInfo() before setting new tags. The whole extender +architecture can then be avoided.

    + +

    Adding New Builtin Tags

    + +A similar approach is taken to the above. However, the TIFFFieldInfo +should be added to the tiffFieldInfo[] list in tif_dirinfo.c. Ensure that +new tags are added in sorted order by the tag number.

    + +Normally new built-in tags should be defined with FIELD_CUSTOM; however, if +it is desirable for the tag value to have it's own field in the TIFFDirectory +structure, then you will need to #define a new FIELD_ value for it, and +add appropriate handling as follows: + + +

      +
    1. Define the tag in tiff.h. +
    2. Add a field to the directory structure in tif_dir.h + and define a FIELD_* bit (also update the definition of + FIELD_CODEC to reflect your addition). +
    3. Add an entry in the TIFFFieldInfo array defined at the top of + tif_dirinfo.c. + Note that you must keep this array sorted by tag + number and that the widest variant entry for a tag should come + first (e.g. LONG before SHORT). +
    4. Add entries in _TIFFVSetField() and _TIFFVGetField() + for the new tag. +
    5. (optional) If the value associated with the tag is not a scalar value + (e.g. the array for TransferFunction) and requires + special processing, + then add the appropriate code to TIFFReadDirectory() and + TIFFWriteDirectory(). You're best off finding a similar tag and + cribbing code. +
    6. Add support to TIFFPrintDirectory() in tif_print.c + to print the tag's value. +
    + +

    +If you want to maintain portability, beware of making assumptions +about data types. Use the typedefs (uint16, etc. when dealing with +data on disk and t*_t when stuff is in memory) and be careful about +passing items through printf or similar vararg interfaces. + +

    Adding New Codec-private Tags

    + +To add tags that are meaningful only when a particular compression +algorithm is used follow these steps: + +
      +
    1. Define the tag in tiff.h. +
    2. Allocate storage for the tag values in the private state block of + the codec. +
    3. Insure the state block is created when the codec is initialized. +
    4. At TIFFInitfoo time override the method pointers in the + TIFF structure + for getting, setting and printing tag values. For example, +
      +    sp->vgetparent = tif->tif_vgetfield;
      +    tif->tif_vgetfield = fooVGetField;	/* hook for codec tags */
      +    sp->vsetparent = tif->tif_vsetfield;
      +    tif->tif_vsetfield = fooVSetField;	/* hook for codec tags */
      +    tif->tif_printdir = fooPrintDir;	/* hook for codec tags */
      +
      + (Actually you may decide not to override the + tif_printdir method, but rather just specify it). +
    5. Create a private TIFFFieldInfo array for your tags and + merge them into the core tags at initialization time using + _TIFFMergeFieldInfo; e.g. +
      +    _TIFFMergeFieldInfo(tif, fooFieldInfo, N(fooFieldInfo));
      +
      + (where N is a macro used liberaly throughout the distributed code). +
    6. Fill in the get and set routines. Be sure to call the parent method + for tags that you are not handled directly. Also be sure to set the + FIELD_* bits for tags that are to be written to the file. Note that + you can create ``pseudo-tags'' by defining tags that are processed + exclusively in the get/set routines and never written to file (see + the handling of TIFFTAG_FAXMODE in tif_fax3.c + for an example of this). +
    7. Fill in the print routine, if appropriate. +
    + +Note that space has been allocated in the FIELD_* bit space for +codec-private tags. Define your bits as FIELD_CODEC+<offset> to +keep them away from the core tags. If you need more tags than there +is room for, just increase FIELD_SETLONGS at the top of +tiffiop.h. + +
    + +Last updated: $Date: 2004/09/10 14:43:18 $ + + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/bugs.html b/thirdparty/LibTIFF/tiff-4.0.3/html/bugs.html new file mode 100644 index 0000000..f09b755 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/bugs.html @@ -0,0 +1,63 @@ + + +Bugs and the TIFF Mailing List + + + +

    + +Bugs, Bugzilla, and the TIFF Mailing List +

    + +

    +This software is free. Please let us know when you find a problem or +fix a bug. + +

    +Thanks to MapTools.org, libtiff now uses +bugzilla to track bugs. All bugs filed in the older bugzilla at +bugzilla.remotesensing.org (pre April 2008) have unfortunately been lost. +

    +If you think you've discovered a bug, please first check to see if it is +already known by looking at the list of already reported bugs. You can do so +by visiting the buglist at +http://bugzilla.maptools.org/buglist.cgi?product=libtiff. Also verify that +the problem is still reproducable with the current development software +from CVS. +

    +If you'd like to enter a new bug, you can do so at +http://bugzilla.maptools.org/enter_bug.cgi?product=libtiff. +

    +If you'd like to inform us about some kind of security issue that should not +be disclosed for a period of time, then you can contact maintainers directly. +Send a copies of your report to the following people: Frank Warmerdam +<warmerdam@pobox.com>, +Andrey Kiselev +<dron@ak4719.spb.edu>. +

    + +Of course, reporting bugs is no substitute for discussion. The +tiff@lists.maptools.org mailing +list is for users of this software, and discussion TIFF issues in general. +It is managed with the Mailman software, and the web interface for subscribing +and managing your access to the list is at:

    + + http://lists.maptools.org/mailman/listinfo/tiff

    + +Posts to the list are only accepted from members of the list in order +to limit the amount of spam propagated. Also, to be approved as a member +you will need to email the list administrator with a brief description of +why you are interested in TIFF so we can weed out spammers.

    + +A Long Term +Archive including recent messages, and most messages back to 1993, +with search capabilities is available, and +has been prepared and hosted by AWare +Systems.

    + + +


    + +Last updated: $Date: 2008/09/03 08:05:04 $ + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/contrib.html b/thirdparty/LibTIFF/tiff-4.0.3/html/contrib.html new file mode 100644 index 0000000..d138900 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/contrib.html @@ -0,0 +1,209 @@ + + + +Contributed TIFF Software + + + + + +

    + +Contributed TIFF Software +

    + + +

    +The contrib directory has contributed software that +uses the TIFF library or which is associated with the library +(typically glue and guidance for ports to non-UNIX platforms, or tools that +aren't directly TIFF related). + +
    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +contrib/vms + +scripts and files from Karsten Spang for building + the library and tools under VMS +
    +contrib/dbs + +various tools from Dan & Chris Sears, including a simple X-based viewer +
    +contrib/ras + +two programs by Patrick Naughton for converting + between Sun rasterfile format and TIFF (these + require libpixrect.a, as opposed to the one in + tools that doesn't) +
    +contrib/mac-mpw
    +contrib/mac-cw +
    +scripts and files from Niles Ritter for building +the library and tools under Macintosh/MPW C and +code warrior. +
    +contrib/acorn + +scripts and files from Peter Greenham for building + the library and tools on an Acorn RISC OS system. +
    +contrib/win32 + +scripts and files from Scott Wagner for building +the library under Windows NT and Windows 95. (The makefile.vc in the +libtiff/libtiff directory may be sufficient for most users.) +
    +contrib/win_dib + +two separate implementations of TIFF to DIB code suitable for any Win32 +platform. Contributed by Mark James, and Philippe Tenenhaus. +
    +contrib/ojpeg + +Patch for IJG JPEG library related to support for some Old JPEG in TIFF files. +Contributed by Scott Marovich. +
    +contrib/dosdjgpp + +scripts and files from Alexander Lehmann for building + the library under MSDOS with the DJGPP v2 compiler. +
    +contrib/tags + +scripts and files from Niles Ritter for adding private + tag support at runtime, without changing libtiff. +
    +contrib/mfs + +code from Mike Johnson to read+write images in memory +without modifying the library +
    +contrib/pds + +various routines from Conrad Poelman; a TIFF image iterator and + code to support ``private sub-directories'' +
    +contrib/iptcutil + + +A utility by Bill Radcliffe to +convert an extracted IPTC Newsphoto caption from a binary blob to +ASCII text, and vice versa. IPTC binary blobs can be extracted from +images via the ImageMagick convert(1) +utility. + + +
    +contrib/addtiffo + + +A utility (and supporting subroutine) for building +one or more reduce resolution +overviews to an existing TIFF file. Supplied by +Frank Warmerdam. + +
    +contrib/stream + + +A class (TiffStream) for accessing TIFF files through a C++ stream +interface. Supplied by Avi Bleiweiss. + +
    + +

    +Questions regarding these packages are usually best directed toward +their authors. + +

    +


    + +Last updated: $Date: 2006/01/03 01:42:30 $ + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/document.html b/thirdparty/LibTIFF/tiff-4.0.3/html/document.html new file mode 100644 index 0000000..73fc8af --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/document.html @@ -0,0 +1,52 @@ + + + +TIFF Documentation + + + + +

    + +TIFF Documentation +

    + +

    +A copy of the 6.0 specification is available from Adobe at +http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf, or from the libtiff +ftp site at +ftp://ftp.remotesensing.org/pub/libtiff/doc/TIFF6.pdf.

    + +

    +Draft TIFF Technical Note #2 covers problems +with the TIFF 6.0 design for embedding JPEG-compressed data in TIFF, and +describes an alternative.

    + +Other Adobe information on TIFF can be retrieved from: + + +http://partners.adobe.com/public/developer/tiff/index.html + +

    +Joris Van Damme maintains a list of known tags and their descriptions and +definitions. It is available online at + +http://www.awaresystems.be/imaging/tiff/tifftags.html + +

    +There is a FAQ, related both to TIFF format and libtiff library: + +http://www.awaresystems.be/imaging/tiff/faq.html + +

    +There is a preliminary BigTIFF Design for +a TIFF variation supporting files larger than 4GB. + +


    + +
    + Last updated: $Date: 2006/07/10 18:13:52 $ +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images.html b/thirdparty/LibTIFF/tiff-4.0.3/html/images.html new file mode 100644 index 0000000..150ed0c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/images.html @@ -0,0 +1,41 @@ + + + +TIFF Test Images + + + + +

    + +TIFF Test Images +

    + +

    +Test images are available for most formats supported by the library. +Most of the images included in the test kit are also part of this +documentation (albeit in TIFF rather than GIF or JFIF). +The images are kept in a separate archive that should be located in +the same directory as this software. + +
    + +

    +The latest archive of test images is located at + +ftp://ftp.remotesensing.org/pub/libtiff/pics-3.8.0.tar.gz + +

    +There are two other good sources for TIFF test images: +the contributed software contrib/dbs includes several +programs that generate test images suitable for debugging, and +the tiffcp program can be used to generate a variety +of images with different storage characteristics. + +

    +


    + +Last updated: $Date: 2006/01/02 23:50:44 $ + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.am new file mode 100644 index 0000000..840e149 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.am @@ -0,0 +1,46 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +docdir = $(LIBTIFF_DOCDIR)/html/images + +docfiles = \ + back.gif \ + bali.jpg \ + cat.gif \ + cover.jpg \ + cramps.gif \ + dave.gif \ + info.gif \ + jello.jpg \ + jim.gif \ + note.gif \ + oxford.gif \ + quad.jpg \ + ring.gif \ + smallliz.jpg \ + strike.gif \ + warning.gif + +dist_doc_DATA = $(docfiles) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.in new file mode 100644 index 0000000..a78ae2f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/images/Makefile.in @@ -0,0 +1,526 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = html/images +DIST_COMMON = $(dist_doc_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" +DATA = $(dist_doc_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = $(LIBTIFF_DOCDIR)/html/images +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +docfiles = \ + back.gif \ + bali.jpg \ + cat.gif \ + cover.jpg \ + cramps.gif \ + dave.gif \ + info.gif \ + jello.jpg \ + jim.gif \ + note.gif \ + oxford.gif \ + quad.jpg \ + ring.gif \ + smallliz.jpg \ + strike.gif \ + warning.gif + +dist_doc_DATA = $(docfiles) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign html/images/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign html/images/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(docdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_docDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_docDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dist_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dist_docDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/back.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/back.gif new file mode 100644 index 0000000..11d0c35 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/back.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/bali.jpg b/thirdparty/LibTIFF/tiff-4.0.3/html/images/bali.jpg new file mode 100644 index 0000000..1f5c146 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/bali.jpg differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/cat.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cat.gif new file mode 100644 index 0000000..5bd3fac Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cat.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/cover.jpg b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cover.jpg new file mode 100644 index 0000000..8698cfb Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cover.jpg differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/cramps.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cramps.gif new file mode 100644 index 0000000..9153f9a Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/cramps.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/dave.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/dave.gif new file mode 100644 index 0000000..c36d447 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/dave.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/info.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/info.gif new file mode 100644 index 0000000..783d631 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/info.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/jello.jpg b/thirdparty/LibTIFF/tiff-4.0.3/html/images/jello.jpg new file mode 100644 index 0000000..df99e66 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/jello.jpg differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/jim.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/jim.gif new file mode 100644 index 0000000..9a18a03 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/jim.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/note.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/note.gif new file mode 100644 index 0000000..7177d68 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/note.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/oxford.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/oxford.gif new file mode 100644 index 0000000..dd4b86e Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/oxford.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/quad.jpg b/thirdparty/LibTIFF/tiff-4.0.3/html/images/quad.jpg new file mode 100644 index 0000000..4b7df17 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/quad.jpg differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/ring.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/ring.gif new file mode 100644 index 0000000..2a614f4 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/ring.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/smallliz.jpg b/thirdparty/LibTIFF/tiff-4.0.3/html/images/smallliz.jpg new file mode 100644 index 0000000..8eb827f Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/smallliz.jpg differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/strike.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/strike.gif new file mode 100644 index 0000000..0709d19 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/strike.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/images/warning.gif b/thirdparty/LibTIFF/tiff-4.0.3/html/images/warning.gif new file mode 100644 index 0000000..f51eb4b Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/html/images/warning.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/index.html b/thirdparty/LibTIFF/tiff-4.0.3/html/index.html new file mode 100644 index 0000000..17db67a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/index.html @@ -0,0 +1,123 @@ + + + + LibTIFF - TIFF Library and Utilities + + + + + +

    LibTIFF - TIFF Library and Utilities

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Home Pagehttp://www.remotesensing.org/libtiff/
    Home Page Mirrorhttp://libtiff.maptools.org/
    Latest Stable Releasev4.0.3
    Master Download Sitedownload.osgeo.org, directory libtiff
    Windows BinariesGnuWin32 Project
    Mailing Listtiff@lists.maptools.org, + Subscription, + Archive. + Please, read the TIFF FAQ + before asking questions.
    Anonymous CVSexport CVSROOT=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot
    + cvs login

    + (use empty password)
    + cvs checkout libtiff
    + to get the stable libtiff code or
    + cvs checkout -r branch-3-9 libtiff
    + to get the previous stable branch supporting the 3.9.X release series.
    +
    +

    + This software provides support for the Tag Image File Format (TIFF), + a widely used format for storing image data. The latest version of + the TIFF specification is available on-line + in several different formats. +

    +

    + Included in this software distribution is a library, libtiff, for + reading and writing TIFF, a small collection of tools for doing + simple manipulations of TIFF images, and documentation on the + library and tools. Libtiff is a portable software, it was built + and tested on various systems: UNIX flavors (Linux, BSD, Solaris, + MacOS X), Windows, and OpenVMS. It should be possible to port + libtiff and additional tools on other OSes. +

    +

    + The library, along with associated tool programs, should handle most of + your needs for reading and writing TIFF images on 32- and 64-bit + machines. +

    +

    + The software was originally authored and maintained by Sam Leffler. +

    +

    + Questions should be sent to the TIFF mailing list: + tiff@lists.maptools.org, with + a subscription interface at + http://lists.maptools.org/mailman/listinfo/tiff. +

    +

    + The persons responsible for putting up this site and putting together + versions >= 3.5.1 are + Frank Warmerdam, + Andrey Kiselev, + Bob Friesenhahn, + Joris Van Damme and Lee Howard. +

    +

    + The following sections are included in this documentation: +

    + +

    + BigTIFF News +

    + +
    +

    + Last updated $Date: 2012-06-16 00:19:37 $. +

    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/internals.html b/thirdparty/LibTIFF/tiff-4.0.3/html/internals.html new file mode 100644 index 0000000..3cc9673 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/internals.html @@ -0,0 +1,572 @@ + + + +Modifying The TIFF Library + + + + +

    + +Modifying The TIFF Library +

    + + +

    +This chapter provides information about the internal structure of +the library, how to control the configuration when building it, and +how to add new support to the library. +The following sections are found in this chapter: + +

    + + +


    Library Configuration

    + +Information on compiling the library is given +elsewhere in this documentation. +This section describes the low-level mechanisms used to control +the optional parts of the library that are configured at build +time. Control is based on +a collection of C defines that are specified either on the compiler +command line or in a configuration file such as port.h +(as generated by the configure script for UNIX systems) +or tiffconf.h. + +

    +Configuration defines are split into three areas: +

      +
    • those that control which compression schemes are + configured as part of the builtin codecs, +
    • those that control support for groups of tags that + are considered optional, and +
    • those that control operating system or machine-specific support. +
    + +

    +If the define COMPRESSION_SUPPORT is not defined +then a default set of compression schemes is automatically +configured: +

      +
    • CCITT Group 3 and 4 algorithms (compression codes 2, 3, 4, and 32771), +
    • the Macintosh PackBits algorithm (compression 32773), +
    • a 4-bit run-length encoding scheme from ThunderScan (compression 32809), +
    • a 2-bit encoding scheme used by NeXT (compression 32766), and +
    • two experimental schemes intended for images with high dynamic range +(compression 34676 and 34677). +
    + +

    + +To override the default compression behaviour define +COMPRESSION_SUPPORT and then one or more additional defines +to enable configuration of the appropriate codecs (see the table +below); e.g. + +

      +#define	COMPRESSION_SUPPORT
      +#define	CCITT_SUPPORT
      +#define	PACKBITS_SUPPORT
      +
    + +Several other compression schemes are configured separately from +the default set because they depend on ancillary software +packages that are not distributed with libtiff. + +

    +Support for JPEG compression is controlled by JPEG_SUPPORT. +The JPEG codec that comes with libtiff is designed for +use with release 5 or later of the Independent JPEG Group's freely +available software distribution. +This software can be retrieved from the directory +ftp.uu.net:/graphics/jpeg/. + + +

    +NOTE: +Enabling JPEG support automatically enables support for +the TIFF 6.0 colorimetry and YCbCr-related tags. + +

    +Experimental support for the deflate algorithm is controlled by +DEFLATE_SUPPORT. +The deflate codec that comes with libtiff is designed +for use with version 0.99 or later of the freely available +libz library written by Jean-loup Gailly and Mark Adler. +The data format used by this library is described +in the files +zlib-3.1.doc, +and +deflate-1.1.doc, +available in the directory +ftp.uu.net:/pub/archiving/zip/doc. +The library can be retried from the directory +ftp.uu.net:/pub/archiving/zip/zlib/ +(or try quest.jpl.nasa.gov:/beta/zlib/). + +

    +NOTE: +The deflate algorithm is experimental. Do not expect +to exchange files using this compression scheme; +it is included only because the similar, and more common, +LZW algorithm is claimed to be governed by licensing restrictions. + + +

    +By default tiffconf.h defines +COLORIMETRY_SUPPORT, +YCBCR_SUPPORT, +and +CMYK_SUPPORT. + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DefineDescription
    CCITT_SUPPORTCCITT Group 3 and 4 algorithms (compression codes 2, 3, 4, + and 32771)
    PACKBITS_SUPPORTMacintosh PackBits algorithm (compression 32773)
    LZW_SUPPORTLempel-Ziv & Welch (LZW) algorithm (compression 5)
    THUNDER_SUPPORT4-bit +run-length encoding scheme from ThunderScan (compression 32809)
    NEXT_SUPPORT2-bit encoding scheme used by NeXT (compression 32766)
    OJPEG_SUPPORTobsolete JPEG scheme defined in the 6.0 spec (compression 6)
    JPEG_SUPPORTcurrent JPEG scheme defined in TTN2 (compression 7)
    ZIP_SUPPORTexperimental Deflate scheme (compression 32946)
    PIXARLOG_SUPPORTPixar's compression scheme for high-resolution color images (compression 32909)
    SGILOG_SUPPORTSGI's compression scheme for high-resolution color images (compression 34676 and 34677)
    COLORIMETRY_SUPPORTsupport for the TIFF 6.0 colorimetry tags
    YCBCR_SUPPORTsupport for the TIFF 6.0 YCbCr-related tags
    CMYK_SUPPORTsupport for the TIFF 6.0 CMYK-related tags
    ICC_SUPPORTsupport for the ICC Profile tag; see +The ICC Profile Format Specification, +Annex B.3 "Embedding ICC Profiles in TIFF Files"; +available at +http://www.color.org +
    + + +


    General Portability Comments

    + +This software is developed on Silicon Graphics UNIX +systems (big-endian, MIPS CPU, 32-bit ints, +IEEE floating point). +The configure shell script generates the appropriate +include files and make files for UNIX systems. +Makefiles exist for non-UNIX platforms that the +code runs on -- this work has mostly been done by other people. + +

    +In general, the code is guaranteed to work only on SGI machines. +In practice it is highly portable to any 32-bit or 64-bit system and much +work has been done to insure portability to 16-bit systems. +If you encounter portability problems please return fixes so +that future distributions can be improved. + +

    +The software is written to assume an ANSI C compilation environment. +If your compiler does not support ANSI function prototypes, const, +and <stdarg.h> then you will have to make modifications to the +software. In the past I have tried to support compilers without const +and systems without <stdarg.h>, but I am +no longer interested in these +antiquated environments. With the general availability of +the freely available GCC compiler, I +see no reason to incorporate modifications to the software for these +purposes. + +

    +An effort has been made to isolate as many of the +operating system-dependencies +as possible in two files: tiffcomp.h and +libtiff/tif_<os>.c. The latter file contains +operating system-specific routines to do I/O and I/O-related operations. +The UNIX (tif_unix.c), +Macintosh (tif_apple.c), +and VMS (tif_vms.c) +code has had the most use; +the MS/DOS support (tif_msdos.c) assumes +some level of UNIX system call emulation (i.e. +open, +read, +write, +fstat, +malloc, +free). + +

    +Native CPU byte order is determined on the fly by +the library and does not need to be specified. +The HOST_FILLORDER and HOST_BIGENDIAN +definitions are not currently used, but may be employed by +codecs for optimization purposes. + +

    +The following defines control general portability: + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    BSDTYPESDefine this if your system does NOT define the + usual BSD typedefs: u_char, + u_short, u_int, u_long.
    HAVE_IEEEFPDefine this as 0 or 1 according to the floating point + format suported by the machine. If your machine does + not support IEEE floating point then you will need to + add support to tif_machdep.c to convert between the + native format and IEEE format.
    HAVE_MMAPDefine this if there is mmap-style support for +mapping files into memory (used only to read data).
    HOST_FILLORDERDefine the native CPU bit order: one of FILLORDER_MSB2LSB + or FILLORDER_LSB2MSB
    HOST_BIGENDIANDefine the native CPU byte order: 1 if big-endian (Motorola) + or 0 if little-endian (Intel); this may be used + in codecs to optimize code
    + +

    +On UNIX systems HAVE_MMAP is defined through the running of +the configure script; otherwise support for memory-mapped +files is disabled. +Note that tiffcomp.h defines HAVE_IEEEFP to be +1 (BSDTYPES is not defined). + + +


    Types and Portability

    + +The software makes extensive use of C typedefs to promote portability. +Two sets of typedefs are used, one for communication with clients +of the library and one for internal data structures and parsing of the +TIFF format. There are interactions between these two to be careful +of, but for the most part you should be able to deal with portability +purely by fiddling with the following machine-dependent typedefs: + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint88-bit unsigned integertiff.h
    int88-bit signed integertiff.h
    uint1616-bit unsigned integertiff.h
    int1616-bit signed integertiff.h
    uint3232-bit unsigned integertiff.h
    int3232-bit signed integertiff.h
    dblparam_tpromoted type for floatstiffcomp.h
    + +

    +(to clarify dblparam_t, it is the type that float parameters are +promoted to when passed by value in a function call.) + +

    +The following typedefs are used throughout the library and interfaces +to refer to certain objects whose size is dependent on the TIFF image +structure: + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    typedef unsigned int ttag_t; directory tag
    typedef uint16 tdir_t; directory index
    typedef uint16 tsample_t; sample number
    typedef uint32 tstrip_t; strip number
    typedef uint32 ttile_t; tile number
    typedef int32 tsize_t; i/o size in bytes
    typedef void* tdata_t; image data ref
    typedef void* thandle_t; client data handle
    typedef int32 toff_t; file offset (should be off_t)
    typedef unsigned char* tidata_t; internal image data
    + +

    +Note that tstrip_t, ttile_t, and tsize_t +are constrained to be +no more than 32-bit quantities by 32-bit fields they are stored +in in the TIFF image. Likewise tsample_t is limited by the 16-bit +field used to store the SamplesPerPixel tag. tdir_t +constrains +the maximum number of IFDs that may appear in an image and may +be an arbitrary size (without penalty). ttag_t must be either +int, unsigned int, pointer, or double +because the library uses a varargs +interface and ANSI C restricts the type of the parameter before an +ellipsis to be a promoted type. toff_t is defined as +int32 because +TIFF file offsets are (unsigned) 32-bit quantities. A signed +value is used because some interfaces return -1 on error (sigh). +Finally, note that tidata_t is used internally to the library to +manipulate internal data. User-specified data references are +passed as opaque handles and only cast at the lowest layers where +their type is presumed. + + +


    General Comments

    + +The library is designed to hide as much of the details of TIFF from +applications as +possible. In particular, TIFF directories are read in their entirety +into an internal format. Only the tags known by the library are +available to a user and certain tag data may be maintained that a user +does not care about (e.g. transfer function tables). + +


    Adding New Builtin Codecs

    + +To add builtin support for a new compression algorithm, you can either +use the "tag-extension" trick to override the handling of the +TIFF Compression tag (see Adding New Tags), +or do the following to add support directly to the core library: + +
      +
    1. Define the tag value in tiff.h. +
    2. Edit the file tif_codec.c to add an entry to the + _TIFFBuiltinCODECS array (see how other algorithms are handled). +
    3. Add the appropriate function prototype declaration to + tiffiop.h (close to the bottom). +
    4. Create a file with the compression scheme code, by convention files + are named tif_*.c (except perhaps on some systems where the + tif_ prefix pushes some filenames over 14 chars. +
    5. Edit Makefile.in (and any other Makefiles) + to include the new source file. +
    + +

    +A codec, say foo, can have many different entry points: + +

    +TIFFInitfoo(tif, scheme)/* initialize scheme and setup entry points in tif */
    +fooSetupDecode(tif)	/* called once per IFD after tags has been frozen */
    +fooPreDecode(tif, sample)/* called once per strip/tile, after data is read,
    +			    but before the first row is decoded */
    +fooDecode*(tif, bp, cc, sample)/* decode cc bytes of data into the buffer */
    +    fooDecodeRow(...)	/* called to decode a single scanline */
    +    fooDecodeStrip(...)	/* called to decode an entire strip */
    +    fooDecodeTile(...)	/* called to decode an entire tile */
    +fooSetupEncode(tif)	/* called once per IFD after tags has been frozen */
    +fooPreEncode(tif, sample)/* called once per strip/tile, before the first row in
    +			    a strip/tile is encoded */
    +fooEncode*(tif, bp, cc, sample)/* encode cc bytes of user data (bp) */
    +    fooEncodeRow(...)	/* called to decode a single scanline */
    +    fooEncodeStrip(...)	/* called to decode an entire strip */
    +    fooEncodeTile(...)	/* called to decode an entire tile */
    +fooPostEncode(tif)	/* called once per strip/tile, just before data is written */
    +fooSeek(tif, row)	/* seek forwards row scanlines from the beginning
    +			   of a strip (row will always be >0 and <rows/strip */
    +fooCleanup(tif)		/* called when compression scheme is replaced by user */
    +
    + +

    +Note that the encoding and decoding variants are only needed when +a compression algorithm is dependent on the structure of the data. +For example, Group 3 2D encoding and decoding maintains a reference +scanline. The sample parameter identifies which sample is to be +encoded or decoded if the image is organized with PlanarConfig=2 +(separate planes). This is important for algorithms such as JPEG. +If PlanarConfig=1 (interleaved), then sample will always be 0. + +


    Other Comments

    + +The library handles most I/O buffering. There are two data buffers +when decoding data: a raw data buffer that holds all the data in a +strip, and a user-supplied scanline buffer that compression schemes +place decoded data into. When encoding data the data in the +user-supplied scanline buffer is encoded into the raw data buffer (from +where it is written). Decoding routines should never have to explicitly +read data -- a full strip/tile's worth of raw data is read and scanlines +never cross strip boundaries. Encoding routines must be cognizant of +the raw data buffer size and call TIFFFlushData1() when necessary. +Note that any pending data is automatically flushed when a new strip/tile is +started, so there's no need do that in the tif_postencode routine (if +one exists). Bit order is automatically handled by the library when +a raw strip or tile is filled. If the decoded samples are interpreted +by the decoding routine before they are passed back to the user, then +the decoding logic must handle byte-swapping by overriding the +tif_postdecode +routine (set it to TIFFNoPostDecode) and doing the required work +internally. For an example of doing this look at the horizontal +differencing code in the routines in tif_predict.c. + +

    +The variables tif_rawcc, tif_rawdata, and +tif_rawcp in a TIFF structure +are associated with the raw data buffer. tif_rawcc must be non-zero +for the library to automatically flush data. The variable +tif_scanlinesize is the size a user's scanline buffer should be. The +variable tif_tilesize is the size of a tile for tiled images. This +should not normally be used by compression routines, except where it +relates to the compression algorithm. That is, the cc parameter to the +tif_decode* and tif_encode* +routines should be used in terminating +decompression/compression. This ensures these routines can be used, +for example, to decode/encode entire strips of data. + +

    +In general, if you have a new compression algorithm to add, work from +the code for an existing routine. In particular, +tif_dumpmode.c +has the trivial code for the "nil" compression scheme, +tif_packbits.c is a +simple byte-oriented scheme that has to watch out for buffer +boundaries, and tif_lzw.c has the LZW scheme that has the most +complexity -- it tracks the buffer boundary at a bit level. +Of course, using a private compression scheme (or private tags) limits +the portability of your TIFF files. + +

    +


    + +Last updated: $Date: 2004/09/10 14:47:31 $ + + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/intro.html b/thirdparty/LibTIFF/tiff-4.0.3/html/intro.html new file mode 100644 index 0000000..61c01d4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/intro.html @@ -0,0 +1,68 @@ + + + +Introduction to the TIFF Documentation + + + + +

    + +Introduction to the TIFF Documentation +

    + + +

    +The following definitions are used throughout this documentation. +They are consistent with the terminology used in the TIFF 6.0 specification. + +

    +
    Sample +
    The unit of information stored in an image; often called a + channel elsewhere. Sample values are numbers, usually unsigned + integers, but possibly in some other format if the SampleFormat + tag is specified in a TIFF +
    Pixel +
    A collection of one or more samples that go together. +
    Row +
    An Nx1 rectangular collection of pixels. +
    Tile +
    An NxM rectangular organization of data (or pixels). +
    Strip +
    A tile whose width is the full image width. +
    Compression +
    A scheme by which pixel or sample data are stored in + an encoded form, specifically with the intent of reducing the + storage cost. +
    Codec +
    Software that implements the decoding and encoding algorithms + of a compression scheme. + + +

    +In order to better understand how TIFF works (and consequently this +software) it is important to recognize the distinction between the +physical organization of image data as it is stored in a TIFF and how +the data is interpreted and manipulated as pixels in an image. TIFF +supports a wide variety of storage and data compression schemes that +can be used to optimize retrieval time and/or minimize storage space. +These on-disk formats are independent of the image characteristics; it +is the responsibility of the TIFF reader to process the on-disk storage +into an in-memory format suitable for an application. Furthermore, it +is the responsibility of the application to properly interpret the +visual characteristics of the image data. TIFF defines a framework for +specifying the on-disk storage format and image characteristics with +few restrictions. This permits significant complexity that can be +daunting. Good applications that handle TIFF work by handling as wide +a range of storage formats as possible, while constraining the +acceptable image characteristics to those that make sense for the +application. + + +

    +


    + +Last updated: $Date: 1999/08/09 20:21:21 $ + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/jconfig.h b/thirdparty/LibTIFF/tiff-4.0.3/html/jconfig.h new file mode 100644 index 0000000..3bacbe2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/jconfig.h @@ -0,0 +1,8 @@ + +#if defined(WIN32) +#include "jconfig.vc" +#elif defined(LINUX) || defined(MACOSX) +#include "jconfig.gcc" +#else +#include "jconfig.irix" +#endif diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/libtiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/libtiff.html new file mode 100644 index 0000000..6a2c42e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/libtiff.html @@ -0,0 +1,747 @@ + + + + Using The TIFF Library + + + + + + + + + + +
    +

    Using The TIFF Library

    +

    + libtiff is a set of C functions (a library) that support + the manipulation of TIFF image files. + The library requires an ANSI C compilation environment for building + and presumes an ANSI C environment for use. +

    +
    +
    +

    + libtiff + provides interfaces to image data at several layers of abstraction (and cost). + At the highest level image data can be read into an 8-bit/sample, + ABGR pixel raster format without regard for the underlying data organization, + colorspace, or compression scheme. Below this high-level interface + the library provides scanline-, strip-, and tile-oriented interfaces that + return data decompressed but otherwise untransformed. These interfaces + require that the application first identify the organization of stored + data and select either a strip-based or tile-based API for manipulating + data. At the lowest level the library + provides access to the raw uncompressed strips or tiles, + returning the data exactly as it appears in the file. +

    +

    + The material presented in this chapter is a basic introduction + to the capabilities of the library; it is not an attempt to describe + everything a developer needs to know about the library or about TIFF. + Detailed information on the interfaces to the library are given in + the UNIX + manual pages that accompany this software. +

    +

    + Michael Still has also written a useful introduction to libtiff for the + IBM DeveloperWorks site available at + http://www.ibm.com/developerworks/linux/library/l-libtiff. +

    +

    + The following sections are found in this chapter: +

    + +
    +

    How to tell which version you have

    +

    + The software version can be found by looking at the file named + VERSION + that is located at the top of the source tree; the precise alpha number + is given in the file dist/tiff.alpha. + If you have need to refer to this + specific software, you should identify it as: +

    +

    + TIFF <version> <alpha> +

    +

    + where <version> is whatever you get from + "cat VERSION" and <alpha> is + what you get from "cat dist/tiff.alpha". +

    +

    + Within an application that uses libtiff the TIFFGetVersion + routine will return a pointer to a string that contains software version + information. + The library include file <tiffio.h> contains a C pre-processor + define TIFFLIB_VERSION that can be used to check library + version compatiblity at compile time. +

    +
    +

    Library Datatypes

    +

    + libtiff defines a portable programming interface through the + use of a set of C type definitions. + These definitions, defined in in the files tiff.h and + tiffio.h, + isolate the libtiff API from the characteristics + of the underlying machine. + To insure portable code and correct operation, applications that use + libtiff should use the typedefs and follow the function + prototypes for the library API. +

    +
    +

    Memory Management

    +

    + libtiff uses a machine-specific set of routines for managing + dynamically allocated memory. + _TIFFmalloc, _TIFFrealloc, and _TIFFfree + mimic the normal ANSI C routines. + Any dynamically allocated memory that is to be passed into the library + should be allocated using these interfaces in order to insure pointer + compatibility on machines with a segmented architecture. + (On 32-bit UNIX systems these routines just call the normal malloc, + realloc, and free routines in the C library.) +

    +

    + To deal with segmented pointer issues libtiff also provides + _TIFFmemcpy, _TIFFmemset, and _TIFFmemmove + routines that mimic the equivalent ANSI C routines, but that are + intended for use with memory allocated through _TIFFmalloc + and _TIFFrealloc. +

    +
    +

    Error Handling

    +

    + libtiff handles most errors by returning an invalid/erroneous + value when returning from a function call. + Various diagnostic messages may also be generated by the library. + All error messages are directed to a single global error handler + routine that can be specified with a call to TIFFSetErrorHandler. + Likewise warning messages are directed to a single handler routine + that can be specified with a call to TIFFSetWarningHandler +

    +
    +

    Basic File Handling

    +

    + The library is modeled after the normal UNIX stdio library. + For example, to read from an existing TIFF image the + file must first be opened: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("foo.tif", "r");
    +     ... do stuff ...
    +     TIFFClose(tif);
    + }
    +

    +

    + The handle returned by TIFFOpen is opaque, that is + the application is not permitted to know about its contents. + All subsequent library calls for this file must pass the handle + as an argument. +

    +

    + To create or overwrite a TIFF image the file is also opened, but with + a "w" argument: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("foo.tif", "w");
    +     ... do stuff ...
    +     TIFFClose(tif);
    + }
    +

    +

    + If the file already exists it is first truncated to zero length. +

    + + + + + +
    Note that unlike the stdio library TIFF image files may not be + opened for both reading and writing; + there is no support for altering the contents of a TIFF file.
    +

    + libtiff buffers much information associated with writing a + valid TIFF image. Consequently, when writing a TIFF image it is necessary + to always call TIFFClose or TIFFFlush to flush any + buffered information to a file. Note that if you call TIFFClose + you do not need to call TIFFFlush. +

    +
    +

    TIFF Directories

    +

    + TIFF supports the storage of multiple images in a single file. + Each image has an associated data structure termed a directory + that houses all the information about the format and content of the + image data. + Images in a file are usually related but they do not need to be; it + is perfectly alright to store a color image together with a black and + white image. + Note however that while images may be related their directories are + not. + That is, each directory stands on its own; their is no need to read + an unrelated directory in order to properly interpret the contents + of an image. +

    +

    + libtiff provides several routines for reading and writing + directories. In normal use there is no need to explicitly + read or write a directory: the library automatically reads the first + directory in a file when opened for reading, and directory information + to be written is automatically accumulated and written when writing + (assuming TIFFClose or TIFFFlush are called). +

    +

    + For a file open for reading the TIFFSetDirectory routine can + be used to select an arbitrary directory; directories are referenced by + number with the numbering starting at 0. Otherwise the + TIFFReadDirectory and TIFFWriteDirectory routines can + be used for sequential access to directories. + For example, to count the number of directories in a file the following + code might be used: +

    +

    + #include "tiffio.h"
    + main(int argc, char* argv[])
    + {
    +     TIFF* tif = TIFFOpen(argv[1], "r");
    +     if (tif) {
    +         int dircount = 0;
    +         do {
    +             dircount++;
    +         } while (TIFFReadDirectory(tif));
    +         printf("%d directories in %s\n", dircount, argv[1]);
    +         TIFFClose(tif);
    +     }
    +     exit(0);
    + }
    +

    +

    + Finally, note that there are several routines for querying the + directory status of an open file: + TIFFCurrentDirectory returns the index of the current + directory and + TIFFLastDirectory returns an indication of whether the + current directory is the last directory in a file. + There is also a routine, TIFFPrintDirectory, that can + be called to print a formatted description of the contents of + the current directory; consult the manual page for complete details. +

    +
    +

    TIFF Tags

    +

    + Image-related information such as the image width and height, number + of samples, orientation, colorimetric information, etc. + are stored in each image + directory in fields or tags. + Tags are identified by a number that is usually a value registered + with the Aldus (now Adobe) Corporation. + Beware however that some vendors write + TIFF images with tags that are unregistered; in this case interpreting + their contents is usually a waste of time. +

    +

    + libtiff reads the contents of a directory all at once + and converts the on-disk information to an appropriate in-memory + form. While the TIFF specification permits an arbitrary set of + tags to be defined and used in a file, the library only understands + a limited set of tags. + Any unknown tags that are encountered in a file are ignored. + There is a mechanism to extend the set of tags the library handles + without modifying the library itself; + this is described elsewhere. +

    +

    + libtiff provides two interfaces for getting and setting tag + values: TIFFGetField and TIFFSetField. + These routines use a variable argument list-style interface to pass + parameters of different type through a single function interface. + The get interface takes one or more pointers to memory locations + where the tag values are to be returned and also returns one or + zero according to whether the requested tag is defined in the directory. + The set interface takes the tag values either by-reference or + by-value. + The TIFF specification defines + default values for some tags. + To get the value of a tag, or its default value if it is undefined, + the TIFFGetFieldDefaulted interface may be used. +

    +

    + The manual pages for the tag get and set routines specifiy the exact data types + and calling conventions required for each tag supported by the library. +

    +
    +

    TIFF Compression Schemes

    +

    + libtiff includes support for a wide variety of + data compression schemes. + In normal operation a compression scheme is automatically used when + the TIFF Compression tag is set, either by opening a file + for reading, or by setting the tag when writing. +

    +

    + Compression schemes are implemented by software modules termed codecs + that implement decoder and encoder routines that hook into the + core library i/o support. + Codecs other than those bundled with the library can be registered + for use with the TIFFRegisterCODEC routine. + This interface can also be used to override the core-library + implementation for a compression scheme. +

    +
    +

    Byte Order

    +

    + The TIFF specification says, and has always said, that + a correct TIFF + reader must handle images in big-endian and little-endian byte order. + libtiff conforms in this respect. + Consequently there is no means to force a specific + byte order for the data written to a TIFF image file (data is + written in the native order of the host CPU unless appending to + an existing file, in which case it is written in the byte order + specified in the file). +

    +
    +

    Data Placement

    +

    + The TIFF specification requires that all information except an + 8-byte header can be placed anywhere in a file. + In particular, it is perfectly legitimate for directory information + to be written after the image data itself. + Consequently TIFF is inherently not suitable for passing through a + stream-oriented mechanism such as UNIX pipes. + Software that require that data be organized in a file in a particular + order (e.g. directory information before image data) does not + correctly support TIFF. + libtiff provides no mechanism for controlling the placement + of data in a file; image data is typically written before directory + information. +

    +
    +

    TIFFRGBAImage Support

    +

    + libtiff provides a high-level interface for reading image + data from a TIFF file. This interface handles the details of + data organization and format for a wide variety of TIFF files; + at least the large majority of those files that one would normally + encounter. Image data is, by default, returned as ABGR + pixels packed into 32-bit words (8 bits per sample). Rectangular + rasters can be read or data can be intercepted at an intermediate + level and packed into memory in a format more suitable to the + application. + The library handles all the details of the format of data stored on + disk and, in most cases, if any colorspace conversions are required: + bilevel to RGB, greyscale to RGB, CMYK to RGB, YCbCr to RGB, 16-bit + samples to 8-bit samples, associated/unassociated alpha, etc. +

    +

    + There are two ways to read image data using this interface. If + all the data is to be stored in memory and manipulated at once, + then the routine TIFFReadRGBAImage can be used: +

    +

    +

    + #include "tiffio.h"
    + main(int argc, char* argv[])
    + {
    +     TIFF* tif = TIFFOpen(argv[1], "r");
    +     if (tif) {
    +         uint32 w, h;
    +         size_t npixels;
    +         uint32* raster;
    +         
    +         TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
    +         TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
    +         npixels = w * h;
    +         raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
    +         if (raster != NULL) {
    +             if (TIFFReadRGBAImage(tif, w, h, raster, 0)) {
    +                 ...process raster data...
    +             }
    +             _TIFFfree(raster);
    +         }
    +         TIFFClose(tif);
    +     }
    +     exit(0);
    + }
    +

    +

    + Note above that _TIFFmalloc is used to allocate memory for + the raster passed to TIFFReadRGBAImage; this is important + to insure the ``appropriate type of memory'' is passed on machines + with segmented architectures. +

    +

    + Alternatively, TIFFReadRGBAImage can be replaced with a + more low-level interface that permits an application to have more + control over this reading procedure. The equivalent to the above + is: +

    +

    + #include "tiffio.h"
    + main(int argc, char* argv[])
    + {
    +     TIFF* tif = TIFFOpen(argv[1], "r");
    +     if (tif) {
    +         TIFFRGBAImage img;
    +         char emsg[1024];
    +         
    +         if (TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
    +             size_t npixels;
    +             uint32* raster;
    +             
    +             npixels = img.width * img.height;
    +             raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
    +             if (raster != NULL) {
    +                 if (TIFFRGBAImageGet(&img, raster, img.width, img.height)) {
    +                     ...process raster data...
    +                 }
    +                 _TIFFfree(raster);
    +             }
    +             TIFFRGBAImageEnd(&img);
    +         } else
    +             TIFFError(argv[1], emsg);
    +         TIFFClose(tif);
    +     }
    +     exit(0);
    + }
    +

    +

    + However this usage does not take advantage of the more fine-grained + control that's possible. That is, by using this interface it is + possible to: +

    +
      +
    • repeatedly fetch (and manipulate) an image without opening + and closing the file
    • +
    • interpose a method for packing raster pixel data according to + application-specific needs (or write the data at all)
    • +
    • interpose methods that handle TIFF formats that are not already + handled by the core library
    • +
    +

    + The first item means that, for example, image viewers that want to + handle multiple files can cache decoding information in order to + speedup the work required to display a TIFF image. +

    +

    + The second item is the main reason for this interface. By interposing + a "put method" (the routine that is called to pack pixel data in + the raster) it is possible share the core logic that understands how + to deal with TIFF while packing the resultant pixels in a format that + is optimized for the application. This alternate format might be very + different than the 8-bit per sample ABGR format the library writes by + default. For example, if the application is going to display the image + on an 8-bit colormap display the put routine might take the data and + convert it on-the-fly to the best colormap indices for display. +

    +

    + The last item permits an application to extend the library + without modifying the core code. + By overriding the code provided an application might add support + for some esoteric flavor of TIFF that it needs, or it might + substitute a packing routine that is able to do optimizations + using application/environment-specific information. +

    +

    + The TIFF image viewer found in tools/sgigt.c is an example + of an application that makes use of the TIFFRGBAImage + support. +

    +
    +

    Scanline-based Image I/O

    +

    + The simplest interface provided by libtiff is a + scanline-oriented interface that can be used to read TIFF + images that have their image data organized in strips + (trying to use this interface to read data written in tiles + will produce errors.) + A scanline is a one pixel high row of image data whose width + is the width of the image. + Data is returned packed if the image data is stored with samples + packed together, or as arrays of separate samples if the data + is stored with samples separated. + The major limitation of the scanline-oriented interface, other + than the need to first identify an existing file as having a + suitable organization, is that random access to individual + scanlines can only be provided when data is not stored in a + compressed format, or when the number of rows in a strip + of image data is set to one (RowsPerStrip is one). +

    +

    + Two routines are provided for scanline-based i/o: + TIFFReadScanline + and + TIFFWriteScanline. + For example, to read the contents of a file that + is assumed to be organized in strips, the following might be used: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         uint32 imagelength;
    +         tdata_t buf;
    +         uint32 row;
    +         
    +         TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength);
    +         buf = _TIFFmalloc(TIFFScanlineSize(tif));
    +         for (row = 0; row < imagelength; row++)
    +             tiffreadscanline(tif, buf, row);
    +         _tifffree(buf);
    +         tiffclose(tif);
    +     }
    + }
    +

    +

    + TIFFScanlineSize returns the number of bytes in + a decoded scanline, as returned by TIFFReadScanline. + Note however that if the file had been create with samples + written in separate planes, then the above code would only + read data that contained the first sample of each pixel; + to handle either case one might use the following instead: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         uint32 imagelength;
    +         tdata_t buf;
    +         uint32 row;
    +         
    +         TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength);
    +         TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &config);
    +         buf = _TIFFmalloc(TIFFScanlineSize(tif));
    +         if (config == PLANARCONFIG_CONTIG) {
    +             for (row = 0; row < imagelength; row++)
    +                 tiffreadscanline(tif, buf, row);
    +         } else if (config == planarconfig_separate) {
    +             uint16 s, nsamples;
    +             
    +             tiffgetfield(tif, tifftag_samplesperpixel, &nsamples);
    +             for (s = 0; s < nsamples; s++)
    +                 for (row = 0; row < imagelength; row++)
    +                     tiffreadscanline(tif, buf, row, s);
    +         }
    +         _tifffree(buf);
    +         tiffclose(tif);
    +     }
    + }
    +

    +

    + Beware however that if the following code were used instead to + read data in the case PLANARCONFIG_SEPARATE,... +

    +

    +             for (row = 0; row < imagelength; row++)
    +                 for (s = 0; s < nsamples; s++)
    +                     tiffreadscanline(tif, buf, row, s);
    +

    +

    + ...then problems would arise if RowsPerStrip was not one + because the order in which scanlines are requested would require + random access to data within strips (something that is not supported + by the library when strips are compressed). +

    +
    +

    Strip-oriented Image I/O

    +

    + The strip-oriented interfaces provided by the library provide + access to entire strips of data. Unlike the scanline-oriented + calls, data can be read or written compressed or uncompressed. + Accessing data at a strip (or tile) level is often desirable + because there are no complications with regard to random access + to data within strips. +

    +

    + A simple example of reading an image by strips is: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         tdata_t buf;
    +         tstrip_t strip;
    +         
    +         buf = _TIFFmalloc(TIFFStripSize(tif));
    +         for (strip = 0; strip < tiffnumberofstrips(tif); strip++)
    +             tiffreadencodedstrip(tif, strip, buf, (tsize_t) -1);
    +         _tifffree(buf);
    +         tiffclose(tif);
    +     }
    + }
    +

    +

    + Notice how a strip size of -1 is used; TIFFReadEncodedStrip + will calculate the appropriate size in this case. +

    +

    + The above code reads strips in the order in which the + data is physically stored in the file. If multiple samples + are present and data is stored with PLANARCONFIG_SEPARATE + then all the strips of data holding the first sample will be + read, followed by strips for the second sample, etc. +

    +

    + Finally, note that the last strip of data in an image may have fewer + rows in it than specified by the RowsPerStrip tag. A + reader should not assume that each decoded strip contains a full + set of rows in it. +

    +

    + The following is an example of how to read raw strips of data from + a file: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         tdata_t buf;
    +         tstrip_t strip;
    +         uint32* bc;
    +         uint32 stripsize;
    +         
    +         TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
    +         stripsize = bc[0];
    +         buf = _TIFFmalloc(stripsize);
    +         for (strip = 0; strip < tiffnumberofstrips(tif); strip++) {
    +             if (bc[strip] > stripsize) {
    +                 buf = _TIFFrealloc(buf, bc[strip]);
    +                 stripsize = bc[strip];
    +             }
    +             TIFFReadRawStrip(tif, strip, buf, bc[strip]);
    +         }
    +         _TIFFfree(buf);
    +         TIFFClose(tif);
    +     }
    + }
    +

    +

    + As above the strips are read in the order in which they are + physically stored in the file; this may be different from the + logical ordering expected by an application. +

    +
    +

    Tile-oriented Image I/O

    +

    + Tiles of data may be read and written in a manner similar to strips. + With this interface, an image is + broken up into a set of rectangular areas that may have dimensions + less than the image width and height. All the tiles + in an image have the same size, and the tile width and length must each + be a multiple of 16 pixels. Tiles are ordered left-to-right and + top-to-bottom in an image. As for scanlines, samples can be packed + contiguously or separately. When separated, all the tiles for a sample + are colocated in the file. That is, all the tiles for sample 0 appear + before the tiles for sample 1, etc. +

    +

    + Tiles and strips may also be extended in a z dimension to form + volumes. Data volumes are organized as "slices". That is, all the + data for a slice is colocated. Volumes whose data is organized in + tiles can also have a tile depth so that data can be organized in + cubes. +

    +

    + There are actually two interfaces for tiles. + One interface is similar to scanlines, to read a tiled image, + code of the following sort might be used: +

    +

    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         uint32 imageWidth, imageLength;
    +         uint32 tileWidth, tileLength;
    +         uint32 x, y;
    +         tdata_t buf;
    +         
    +         TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &imageWidth);
    +         TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imageLength);
    +         TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tileWidth);
    +         TIFFGetField(tif, TIFFTAG_TILELENGTH, &tileLength);
    +         buf = _TIFFmalloc(TIFFTileSize(tif));
    +         for (y = 0; y < imagelength; y += tilelength)
    +             for (x = 0; x < imagewidth; x += tilewidth)
    +                 tiffreadtile(tif, buf, x, y, 0);
    +         _tifffree(buf);
    +         tiffclose(tif);
    +     }
    + }
    +

    +

    + (once again, we assume samples are packed contiguously.) +

    +

    + Alternatively a direct interface to the low-level data is provided + a la strips. Tiles can be read with + TIFFReadEncodedTile or TIFFReadRawTile, + and written with TIFFWriteEncodedTile or + TIFFWriteRawTile. For example, to read all the tiles in an image: +

    +

    + #include "tiffio.h"
    + main()
    + {
    +     TIFF* tif = TIFFOpen("myfile.tif", "r");
    +     if (tif) {
    +         tdata_t buf;
    +         ttile_t tile;
    +         
    +         buf = _TIFFmalloc(TIFFTileSize(tif));
    +         for (tile = 0; tile < tiffnumberoftiles(tif); tile++)
    +             tiffreadencodedtile(tif, tile, buf, (tsize_t) -1);
    +         _tifffree(buf);
    +         tiffclose(tif);
    +     }
    + }
    +

    +
    +

    Other Stuff

    +

    + Some other stuff will almost certainly go here... +

    +
    +

    + Last updated: $Date: 2005/12/28 06:53:18 $ +

    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.am new file mode 100644 index 0000000..ca222de --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.am @@ -0,0 +1,126 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +docdir = $(LIBTIFF_DOCDIR)/html/man +MANSRCDIR = $(top_srcdir)/man +HTMLMANDIR = $(top_srcdir)/html/man + +GROFF = groff -Thtml -mandoc +ECHO = echo + +indexfile = index.html +docfiles = \ + libtiff.3tiff.html \ + TIFFbuffer.3tiff.html \ + TIFFClose.3tiff.html \ + TIFFcodec.3tiff.html \ + TIFFcolor.3tiff.html \ + TIFFDataWidth.3tiff.html \ + TIFFError.3tiff.html \ + TIFFFieldDataType.3tiff.html \ + TIFFFieldName.3tiff.html \ + TIFFFieldPassCount.3tiff.html \ + TIFFFieldReadCount.3tiff.html \ + TIFFFieldTag.3tiff.html \ + TIFFFieldWriteCount.3tiff.html \ + TIFFFlush.3tiff.html \ + TIFFGetField.3tiff.html \ + TIFFmemory.3tiff.html \ + TIFFOpen.3tiff.html \ + TIFFPrintDirectory.3tiff.html \ + TIFFquery.3tiff.html \ + TIFFReadDirectory.3tiff.html \ + TIFFReadEncodedStrip.3tiff.html \ + TIFFReadEncodedTile.3tiff.html \ + TIFFReadRawStrip.3tiff.html \ + TIFFReadRawTile.3tiff.html \ + TIFFReadRGBAImage.3tiff.html \ + TIFFReadRGBAStrip.3tiff.html \ + TIFFReadRGBATile.3tiff.html \ + TIFFReadScanline.3tiff.html \ + TIFFReadTile.3tiff.html \ + TIFFRGBAImage.3tiff.html \ + TIFFSetDirectory.3tiff.html \ + TIFFSetField.3tiff.html \ + TIFFsize.3tiff.html \ + TIFFstrip.3tiff.html \ + TIFFswab.3tiff.html \ + TIFFtile.3tiff.html \ + TIFFWarning.3tiff.html \ + TIFFWriteDirectory.3tiff.html \ + TIFFWriteEncodedStrip.3tiff.html \ + TIFFWriteEncodedTile.3tiff.html \ + TIFFWriteRawStrip.3tiff.html \ + TIFFWriteRawTile.3tiff.html \ + TIFFWriteScanline.3tiff.html \ + TIFFWriteTile.3tiff.html \ + bmp2tiff.1.html \ + fax2ps.1.html \ + fax2tiff.1.html \ + gif2tiff.1.html \ + pal2rgb.1.html \ + ppm2tiff.1.html \ + ras2tiff.1.html \ + raw2tiff.1.html \ + rgb2ycbcr.1.html \ + sgi2tiff.1.html \ + thumbnail.1.html \ + tiff2bw.1.html \ + tiff2pdf.1.html \ + tiff2ps.1.html \ + tiff2rgba.1.html \ + tiffcmp.1.html \ + tiffcp.1.html \ + tiffcrop.1.html \ + tiffdither.1.html \ + tiffdump.1.html \ + tiffgt.1.html \ + tiffinfo.1.html \ + tiffmedian.1.html \ + tiffset.1.html \ + tiffsplit.1.html \ + tiffsv.1.html + +dist_doc_DATA = $(indexfile) $(docfiles) + +INDEXSTART = 'Libtiff HTML manpage index

      Man Pages

      ' +INDEXEND = '

    ' + +.PHONY: index +index: + ${ECHO} ${INDEXSTART} > $(indexfile) + for i in $(docfiles); do \ + ${ECHO} '
  1. '$$i'' >> $(indexfile); \ + done + ${ECHO} ${INDEXEND} >> $(indexfile) + +manpages = $(docfiles:.html=) + +.PHONY: htmldoc +htmldoc: + for i in $(manpages); do \ + ${GROFF} $(MANSRCDIR)/$$i > $(HTMLMANDIR)/$$i.html; \ + done + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.in new file mode 100644 index 0000000..86f71e9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/Makefile.in @@ -0,0 +1,602 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = html/man +DIST_COMMON = $(dist_doc_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(docdir)" +DATA = $(dist_doc_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = $(LIBTIFF_DOCDIR)/html/man +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +MANSRCDIR = $(top_srcdir)/man +HTMLMANDIR = $(top_srcdir)/html/man +GROFF = groff -Thtml -mandoc +ECHO = echo +indexfile = index.html +docfiles = \ + libtiff.3tiff.html \ + TIFFbuffer.3tiff.html \ + TIFFClose.3tiff.html \ + TIFFcodec.3tiff.html \ + TIFFcolor.3tiff.html \ + TIFFDataWidth.3tiff.html \ + TIFFError.3tiff.html \ + TIFFFieldDataType.3tiff.html \ + TIFFFieldName.3tiff.html \ + TIFFFieldPassCount.3tiff.html \ + TIFFFieldReadCount.3tiff.html \ + TIFFFieldTag.3tiff.html \ + TIFFFieldWriteCount.3tiff.html \ + TIFFFlush.3tiff.html \ + TIFFGetField.3tiff.html \ + TIFFmemory.3tiff.html \ + TIFFOpen.3tiff.html \ + TIFFPrintDirectory.3tiff.html \ + TIFFquery.3tiff.html \ + TIFFReadDirectory.3tiff.html \ + TIFFReadEncodedStrip.3tiff.html \ + TIFFReadEncodedTile.3tiff.html \ + TIFFReadRawStrip.3tiff.html \ + TIFFReadRawTile.3tiff.html \ + TIFFReadRGBAImage.3tiff.html \ + TIFFReadRGBAStrip.3tiff.html \ + TIFFReadRGBATile.3tiff.html \ + TIFFReadScanline.3tiff.html \ + TIFFReadTile.3tiff.html \ + TIFFRGBAImage.3tiff.html \ + TIFFSetDirectory.3tiff.html \ + TIFFSetField.3tiff.html \ + TIFFsize.3tiff.html \ + TIFFstrip.3tiff.html \ + TIFFswab.3tiff.html \ + TIFFtile.3tiff.html \ + TIFFWarning.3tiff.html \ + TIFFWriteDirectory.3tiff.html \ + TIFFWriteEncodedStrip.3tiff.html \ + TIFFWriteEncodedTile.3tiff.html \ + TIFFWriteRawStrip.3tiff.html \ + TIFFWriteRawTile.3tiff.html \ + TIFFWriteScanline.3tiff.html \ + TIFFWriteTile.3tiff.html \ + bmp2tiff.1.html \ + fax2ps.1.html \ + fax2tiff.1.html \ + gif2tiff.1.html \ + pal2rgb.1.html \ + ppm2tiff.1.html \ + ras2tiff.1.html \ + raw2tiff.1.html \ + rgb2ycbcr.1.html \ + sgi2tiff.1.html \ + thumbnail.1.html \ + tiff2bw.1.html \ + tiff2pdf.1.html \ + tiff2ps.1.html \ + tiff2rgba.1.html \ + tiffcmp.1.html \ + tiffcp.1.html \ + tiffcrop.1.html \ + tiffdither.1.html \ + tiffdump.1.html \ + tiffgt.1.html \ + tiffinfo.1.html \ + tiffmedian.1.html \ + tiffset.1.html \ + tiffsplit.1.html \ + tiffsv.1.html + +dist_doc_DATA = $(indexfile) $(docfiles) +INDEXSTART = 'Libtiff HTML manpage index

      Man Pages

      ' +INDEXEND = '

    ' +manpages = $(docfiles:.html=) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign html/man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign html/man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_docDATA: $(dist_doc_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + done + +uninstall-dist_docDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(docdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_docDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_docDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dist_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dist_docDATA + + +.PHONY: index +index: + ${ECHO} ${INDEXSTART} > $(indexfile) + for i in $(docfiles); do \ + ${ECHO} '
  2. '$$i'' >> $(indexfile); \ + done + ${ECHO} ${INDEXEND} >> $(indexfile) + +.PHONY: htmldoc +htmldoc: + for i in $(manpages); do \ + ${GROFF} $(MANSRCDIR)/$$i > $(HTMLMANDIR)/$$i.html; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFClose.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFClose.3tiff.html new file mode 100644 index 0000000..720ca32 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFClose.3tiff.html @@ -0,0 +1,87 @@ + + + + + + +TIFFClose + + + +

    TIFFClose

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFClose − close a previously opened +TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    void TIFFClose(TIFF *tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFClose closes a file that was previously opened +with TIFFOpen(3TIFF). Any buffered data are flushed +to the file, including the contents of the current directory +(if modified); and all resources are reclaimed.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the routine. Likewise, +warning messages are directed to the +TIFFWarning(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF), TIFFOpen(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFDataWidth.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFDataWidth.3tiff.html new file mode 100644 index 0000000..575e3cb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFDataWidth.3tiff.html @@ -0,0 +1,98 @@ + + + + + + +TIFFDataWidth + + + +

    TIFFDataWidth

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFDataWidth − Get the size of TIFF data types

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFDataWidth(TIFFDataType +type)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFDataWidth returns a size of type in +bytes. Currently following data types are supported:
    +TIFF_BYTE
    +TIFF_ASCII
    +TIFF_SBYTE
    +TIFF_UNDEFINED
    +TIFF_SHORT
    +TIFF_SSHORT
    +TIFF_LONG
    +TIFF_SLONG
    +TIFF_FLOAT
    +TIFF_IFD
    +TIFF_RATIONAL
    +TIFF_SRATIONAL
    +TIFF_DOUBLE

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFDataWidth returns a number of bytes occupied +by the item of given type. 0 returned when uknown data type +supplied.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF),

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFError.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFError.3tiff.html new file mode 100644 index 0000000..721cec7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFError.3tiff.html @@ -0,0 +1,106 @@ + + + + + + +TIFFError + + + +

    TIFFError

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFError, TIFFSetErrorHandler − library error +handling interface

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    void TIFFError(const char *module, const +char *fmt, ...)

    + +

    #include <stdarg.h>

    + +

    typedef void (*TIFFErrorHandler)(const char +*module, const char *fmt, +va_list ap);
    +TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler +handler);

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFError invokes the library-wide error handling +function to (normally) write an error message to the +stderr. The fmt parameter is a +printf(3S) format string, and any number arguments +can be supplied. The module parameter, if non-zero, +is printed before the message; it typically is used to +identify the software module in which an error is +detected.

    + +

    Applications that desire to capture control in the event +of an error should use TIFFSetErrorHandler to +override the default error handler. A NULL +(0) error handling function may be installed to suppress +error messages.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFSetErrorHandler returns a reference to the +previous error handling function.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFWarning(3TIFF), libtiff(3TIFF), +printf(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldDataType.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldDataType.3tiff.html new file mode 100644 index 0000000..d6a463f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldDataType.3tiff.html @@ -0,0 +1,89 @@ + + + + + + + + + +TIFFFieldDataType + + + + +

    TIFFFieldDataType

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + + +

    TIFFFieldDataType +− Get TIFF data type from field information

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + + +

    TIFFDataType +TIFFFieldDataType(const TIFFField* +fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldDataType +returns the data type stored in a TIFF field.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldDataType +returns a member of the enum type TIFFDataType.

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldName.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldName.3tiff.html new file mode 100644 index 0000000..b270d4a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldName.3tiff.html @@ -0,0 +1,86 @@ + + + + + + + + + +TIFFFieldName + + + + +

    TIFFFieldName

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + +

    TIFFFieldName +− Get TIFF field name from field information

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    const char* +TIFFFieldName(const TIFFField* fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldName +returns the textual name for a TIFF field.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldName +returns a constant C string.

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldPassCount.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldPassCount.3tiff.html new file mode 100644 index 0000000..480f736 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldPassCount.3tiff.html @@ -0,0 +1,98 @@ + + + + + + + + + +TIFFFieldPassCount + + + + +

    TIFFFieldPassCount

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + + +

    TIFFFieldPassCount +− Get whether to pass a count to TIFFGet/SetField

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    int +TIFFFieldPassCount(const TIFFField* +fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldPassCount +returns true (nonzero) if TIFFGetField and +TIFFSetField expect a count value to be passed +before the actual data pointer.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    When a +count is required, it will be of type uint32 +when TIFFFieldReadCount reports +TIFF_VARIABLE2, and of type uint16 otherwise. +(This distinction is critical for use of +TIFFGetField, but normally not so for use of +TIFFSetField.)

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldPassCount +returns an integer that is always 1 (true) or 0 (false).

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldReadCount.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldReadCount.3tiff.html new file mode 100644 index 0000000..c77d4d3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldReadCount.3tiff.html @@ -0,0 +1,101 @@ + + + + + + + + + +TIFFFieldReadCount + + + + +

    TIFFFieldReadCount

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + + +

    TIFFFieldReadCount +− Get number of values to be read from field

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    int +TIFFFieldReadCount(const TIFFField* +fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldReadCount +returns the number of values available to be read from the +specified TIFF field; that is, the number of arguments that +should be supplied to TIFFGetField. For most field +types this is a small positive integer, typically 1 or 2, +but there are some special values:
    +TIFF_VARIABLE
    indicates that a variable number of values +is possible; then, a uint16 count argument and +a pointer data argument must be supplied to +TIFFGetField.
    +TIFF_VARIABLE2
    is the same as TIFF_VARIABLE +except that the count argument must have type +uint32.
    +TIFF_SPP
    indicates that the number of arguments is equal +to the image’s number of samples per pixel.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldReadCount +returns an integer.

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldTag.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldTag.3tiff.html new file mode 100644 index 0000000..d1cc04a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldTag.3tiff.html @@ -0,0 +1,88 @@ + + + + + + + + + +TIFFFieldTag + + + + +

    TIFFFieldTag

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + +

    TIFFFieldTag +− Get TIFF field tag value from field information

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    uint32 +TIFFFieldTag(const TIFFField* fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldTag +returns the numeric tag value for a TIFF field. This can be +compared to various constants exported by the libtiff +header files, such as TIFFTAG_IMAGEWIDTH.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldTag +returns an integer tag value.

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldWriteCount.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldWriteCount.3tiff.html new file mode 100644 index 0000000..d72a8e3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFieldWriteCount.3tiff.html @@ -0,0 +1,108 @@ + + + + + + + + + +TIFFFieldWriteCount + + + + +

    TIFFFieldWriteCount

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + + +

    TIFFFieldWriteCount +− Get number of values to be written to field

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    int +TIFFFieldWriteCount(const TIFFField* +fip)

    + +

    DESCRIPTION + +

    + + + +

    TIFFFieldWriteCount +returns the number of values to be written into the +specified TIFF field; that is, the number of arguments that +should be supplied to TIFFSetField. For most field +types this is a small positive integer, typically 1 or 2, +but there are some special values:
    +TIFF_VARIABLE
    indicates that a variable number of values +is possible; then, a uint16 count argument and +a pointer data argument must be supplied to +TIFFSetField.
    +TIFF_VARIABLE2
    is the same as TIFF_VARIABLE +except that the count argument must have type +uint32. (On most modern machines, this makes no +practical difference, and the count argument can +simply be an int in either case.)
    +TIFF_SPP
    indicates that the number of arguments must be +equal to the image’s number of samples per pixel.

    + +

    fip is a +field information pointer previously returned by +TIFFFindField, TIFFFieldWithTag, or +TIFFFieldWithName.

    + +

    For most field +types, TIFFFieldWriteCount returns the same value as +TIFFFieldReadCount, but there are some +exceptions.

    + +

    RETURN VALUES + +

    + + + +

    TIFFFieldWriteCount +returns an integer.

    + +

    SEE ALSO + +

    + + + +

    libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFlush.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFlush.3tiff.html new file mode 100644 index 0000000..742f3ae --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFFlush.3tiff.html @@ -0,0 +1,113 @@ + + + + + + +TIFFFlush + + + +

    TIFFFlush

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFFlush, TIFFFlushData − flush pending writes to +an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFFlush(TIFF *tif)
    +int TIFFFlushData(TIFF *
    tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFFlush causes any pending writes for the +specified file (including writes for the current directory) +to be done. In normal operation this call is never needed +− the library automatically does any flushing +required.

    + +

    TIFFFlushData flushes any pending image data for +the specified file to be written out; directory-related data +are not flushed. In normal operation this call is never +needed − the library automatically does any flushing +required.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    0 is returned if an error is encountered, otherwise 1 is +returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteEncodedStrip(3TIFF), +TIFFWriteEncodedTile(3TIFF), +TIFFWriteRawStrip(3TIFF), +TIFFWriteRawTile(3TIFF), +TIFFWriteScanline(3TIFF), TIFFWriteTile(3TIFF) +libtiff(3TIFF),

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFGetField.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFGetField.3tiff.html new file mode 100644 index 0000000..bd2f78b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFGetField.3tiff.html @@ -0,0 +1,1969 @@ + + + + + + + + + +TIFFGetField + + + + +

    TIFFGetField

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +AUTOREGISTERED TAGS
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + +

    TIFFGetField, +TIFFVGetField − get the value(s) of a tag in an open +TIFF file

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    int +TIFFGetField(TIFF *tif, ttag_t +tag, ...)

    + +

    #include +<stdarg.h>

    + +

    int +TIFFVGetField(TIFF *tif, ttag_t +tag, va_list ap)
    +int TIFFGetFieldDefaulted(TIFF *
    tif, +ttag_t tag, ...)
    +int TIFFVGetFieldDefaulted(TIFF *
    tif, +ttag_t tag, va_list ap)

    + +

    DESCRIPTION + +

    + + + +

    TIFFGetField +returns the value of a tag or pseudo-tag associated with the +the current directory of the opened TIFF file +tif. (A pseudo-tag is a parameter that is used +to control the operation of the TIFF library +but whose value is not read or written to the underlying +file.) The file must have been previously opened with +TIFFOpen(3TIFF). The tag is identified by tag, +one of the values defined in the include file tiff.h +(see also the table below). The type and number of values +returned is dependent on the tag being requested. The +programming interface uses a variable argument list as +prescribed by the stdarg(3) interface. The returned +values should only be interpreted if TIFFGetField +returns 1.

    + + +

    TIFFVGetField +is functionally equivalent to TIFFGetField except +that it takes a pointer to a variable argument list. +TIFFVGetField is useful for layering interfaces on +top of the functionality provided by +TIFFGetField.

    + + +

    TIFFGetFieldDefaulted +and TIFFVGetFieldDefaulted are identical to +TIFFGetField and TIFFVGetField, except that if +a tag is not defined in the current directory and it has a +default value, then the default value is returned.

    + +

    The tags +understood by libtiff(3TIFF), the number of parameter +values, and the types for the returned values are shown +below. The data types are specified as in C and correspond +to the types used to specify tag values to +TIFFSetField(3TIFF). Remember that +TIFFGetField returns parameter values, so all the +listed data types are pointers to storage where values +should be returned. Consult the TIFF +specification (or relevant industry specification) for +information on the meaning of each tag and their possible +values.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    Tag Name

    + + +

    Count

    +
    + + +

    Types

    + + +

    Notes

    + + +

    TIFFTAG_ARTIST

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_BADFAXLINES

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_BITSPERSAMPLE

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_CLEANFAXDATA

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_COLORMAP

    + + +

    3

    +
    + + +

    uint16**

    + + +

    1<<BitsPerSample arrays

    + + +

    TIFFTAG_COMPRESSION

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_CONSECUTIVEBADFAXLINES

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_COPYRIGHT

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_DATATYPE

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_DATETIME

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_DOCUMENTNAME

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_DOTRANGE

    + + +

    2

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_EXTRASAMPLES

    + + +

    2

    +
    + + +

    uint16*,uint16**

    + + +

    count & types array

    + + +

    TIFFTAG_FAXFILLFUNC

    + + +

    1

    +
    + + +

    TIFFFaxFillFunc*

    + + +

    G3/G4 compression pseudo-tag

    + + +

    TIFFTAG_FAXMODE

    + + +

    1

    +
    + + +

    int*

    + + +

    G3/G4 compression pseudo-tag

    + + +

    TIFFTAG_FILLORDER

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_GROUP3OPTIONS

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_GROUP4OPTIONS

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_HALFTONEHINTS

    + + +

    2

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_HOSTCOMPUTER

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_ICCPROFILE

    + + +

    2

    +
    + + +

    uint32*,void**

    + + +

    count, profile data

    + + +

    TIFFTAG_IMAGEDEPTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_IMAGEDESCRIPTION

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_IMAGELENGTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_IMAGEWIDTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_INKNAMES

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_INKSET

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_JPEGCOLORMODE

    + + +

    1

    +
    + + +

    int*

    + + +

    JPEG pseudo-tag

    + + +

    TIFFTAG_JPEGQUALITY

    + + +

    1

    +
    + + +

    int*

    + + +

    JPEG pseudo-tag

    + + +

    TIFFTAG_JPEGTABLES

    + + +

    2

    +
    + + +

    uint32*,void**

    + + +

    count & tables

    + + +

    TIFFTAG_JPEGTABLESMODE

    + + +

    1

    +
    + + +

    int*

    + + +

    JPEG pseudo-tag

    + + +

    TIFFTAG_MAKE

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_MATTEING

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_MAXSAMPLEVALUE

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_MINSAMPLEVALUE

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_MODEL

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_ORIENTATION

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_PAGENAME

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_PAGENUMBER

    + + +

    2

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_PHOTOMETRIC

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_PHOTOSHOP

    + + +

    2

    +
    + + +

    uint32*,void**

    + + +

    count, data

    + + +

    TIFFTAG_PLANARCONFIG

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_PREDICTOR

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_PRIMARYCHROMATICITIES

    + + +

    1

    +
    + + +

    float**

    + + +

    6-entry array

    + + +

    TIFFTAG_REFERENCEBLACKWHITE

    + + +

    1

    +
    + + +

    float**

    + + +

    6-entry array

    + + +

    TIFFTAG_RESOLUTIONUNIT

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_RICHTIFFIPTC

    + + +

    2

    +
    + + +

    uint32*,void**

    + + +

    count, data

    + + +

    TIFFTAG_ROWSPERSTRIP

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_SAMPLEFORMAT

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_SAMPLESPERPIXEL

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_SMAXSAMPLEVALUE

    + + +

    1

    +
    + + +

    double*

    +
    + + +

    TIFFTAG_SMINSAMPLEVALUE

    + + +

    1

    +
    + + +

    double*

    +
    + + +

    TIFFTAG_SOFTWARE

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_STONITS

    + + +

    1

    +
    + + +

    double**

    +
    + + +

    TIFFTAG_STRIPBYTECOUNTS

    + + +

    1

    +
    + + +

    uint32**

    +
    + + +

    TIFFTAG_STRIPOFFSETS

    + + +

    1

    +
    + + +

    uint32**

    +
    + + +

    TIFFTAG_SUBFILETYPE

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_SUBIFD

    + + +

    2

    +
    + + +

    uint16*,uint32**

    + + +

    count & offsets array

    + + +

    TIFFTAG_TARGETPRINTER

    + + +

    1

    +
    + + +

    char**

    +
    + + +

    TIFFTAG_THRESHHOLDING

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_TILEBYTECOUNTS

    + + +

    1

    +
    + + +

    uint32**

    +
    + + +

    TIFFTAG_TILEDEPTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_TILELENGTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_TILEOFFSETS

    + + +

    1

    +
    + + +

    uint32**

    +
    + + +

    TIFFTAG_TILEWIDTH

    + + +

    1

    +
    + + +

    uint32*

    +
    + + +

    TIFFTAG_TRANSFERFUNCTION

    + + +

    1 or 3†

    + + +

    uint16**1<<BitsPerSample entry arrays

    + + +

    TIFFTAG_WHITEPOINT

    + + +

    1

    +
    + + +

    float**

    + + +

    2-entry array

    + + +

    TIFFTAG_XMLPACKET

    + + +

    2

    +
    + + +

    uint32*,void**

    + + +

    count, data

    + + +

    TIFFTAG_XPOSITION

    + + +

    1

    +
    + + +

    float*

    +
    + + +

    TIFFTAG_XRESOLUTION

    + + +

    1

    +
    + + +

    float*

    +
    + + +

    TIFFTAG_YCBCRCOEFFICIENTS

    + + +

    1

    +
    + + +

    float**

    + + +

    3-entry array

    + + +

    TIFFTAG_YCBCRPOSITIONING

    + + +

    1

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_YCBCRSUBSAMPLING

    + + +

    2

    +
    + + +

    uint16*

    +
    + + +

    TIFFTAG_YPOSITION

    + + +

    1

    +
    + + +

    float*

    +
    + + +

    TIFFTAG_YRESOLUTION

    + + +

    1

    +
    + + +

    float*‡

    +
    + +

    † If +SamplesPerPixel is one, then a single array is +returned; otherwise three arrays are returned.
    +‡ The contents of this field are quite complex. See +The ICC Profile Format Specification, Annex B.3 +"Embedding ICC Profiles in TIFF Files" (available +at http://www.color.org) for an explanation.

    + +

    AUTOREGISTERED TAGS + +

    + + +

    If you +can’t find the tag in the table above that means this +is unsupported tag. But you still be able to read it’s +value if you know the data type of that tag. For example, if +you want to read the LONG value from the tag 33424 and ASCII +string from the tag 36867 you can use the following +code:

    + +

    uint16 count; +
    +void *data;

    + + +

    TIFFGetField(tiff, +33424, &count, &data);
    +printf("Tag %d: %d, count %d0, 33424, *(uint32 *)data, +count);
    +TIFFGetField(tiff, 36867, &count, &data);
    +printf("Tag %d: %s, count %d0, 36867, (char *)data, +count);

    + +

    is not +supported by libtiff(3TIFF), library

    + +

    RETURN VALUES + +

    + + +

    1 is returned +if the tag is defined in the current directory; otherwise a +0 is returned.

    + +

    DIAGNOSTICS + +

    + + +

    All error +messages are directed to the TIFFError(3TIFF) +routine.

    + +

    Unknown +field, tag 0x%x. An unknown tag was supplied.

    + +

    SEE ALSO + +

    + + + +

    TIFFOpen(3TIFF), +TIFFSetField(3TIFF), TIFFSetDirectory(3TIFF), +TIFFReadDirectory(3TIFF), +TIFFWriteDirectory(3TIFF) libtiff(3TIFF),

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFOpen.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFOpen.3tiff.html new file mode 100644 index 0000000..2379121 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFOpen.3tiff.html @@ -0,0 +1,421 @@ + + + + + + +TIFFOpen + + + +

    TIFFOpen

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BYTE ORDER
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFOpen, TIFFFdOpen, TIFFClientOpen − open a +TIFF file for reading or writing

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    TIFF* TIFFOpen(const char *filename, +const char *mode)
    +TIFF* TIFFFdOpen(const int
    fd, const char +*filename, const char +*mode)

    + +

    typedef tsize_t (*TIFFReadWriteProc)(thandle_t, +tdata_t, tsize_t);
    +typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
    +typedef int (*TIFFCloseProc)(thandle_t);
    +typedef toff_t (*TIFFSizeProc)(thandle_t);
    +typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, +toff_t*);
    +typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, +toff_t);

    + +

    TIFF* TIFFClientOpen(const char +*filename, const char *mode, +thandle_t clientdata, TIFFReadWriteProc +readproc, TIFFReadWriteProc +writeproc, TIFFSeekProc seekproc, +TIFFCloseProc closeproc, TIFFSizeProc +sizeproc, TIFFMapFileProc mapproc, +TIFFUnmapFileProc unmapproc)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFOpen opens a TIFF file whose +name is filename and returns a handle to be used in +subsequent calls to routines in libtiff. If the open +operation fails, then zero is returned. The mode +parameter specifies if the file is to be opened for reading +(‘‘r’’), writing +(‘‘w’’), or appending +(‘‘a’’) and, optionally, whether to +override certain default aspects of library operation (see +below). When a file is opened for appending, existing data +will not be touched; instead new data will be written as +additional subfiles. If an existing file is opened for +writing, all previous data is overwritten.

    + +

    If a file is opened for reading, the first +TIFF directory in the file is automatically +read (also see TIFFSetDirectory(3TIFF) for reading +directories other than the first). If a file is opened for +writing or appending, a default directory is automatically +created for writing subsequent data. This directory has all +the default values specified in TIFF Revision +6.0: BitsPerSample=1, ThreshHolding=bilevel +art scan, FillOrder=1 (most significant bit of each +data byte is filled first), Orientation=1 (the 0th +row represents the visual top of the image, and the 0th +column represents the visual left hand side), +SamplesPerPixel=1, RowsPerStrip=infinity, +ResolutionUnit=2 (inches), and Compression=1 +(no compression). To alter these values, or to define values +for additional fields, TIFFSetField(3TIFF) must be +used.

    + +

    TIFFFdOpen is like TIFFOpen except that it +opens a TIFF file given an open file +descriptor fd. The file’s name and mode must +reflect that of the open descriptor. The object associated +with the file descriptor must support random +access.

    + +

    TIFFClientOpen is like TIFFOpen except that +the caller supplies a collection of functions that the +library will use to do UNIX -like I/O +operations. The readproc and writeproc are +called to read and write data at the current file position. +seekproc is called to change the current file +position a la lseek(2). closeproc is invoked +to release any resources associated with an open file. +sizeproc is invoked to obtain the size in bytes of a +file. mapproc and unmapproc are called to map +and unmap a file’s contents in memory; c.f. +mmap(2) and munmap(2). The clientdata +parameter is an opaque ‘‘handle’’ +passed to the client-specified routines passed as parameters +to TIFFClientOpen.

    +
    + +

    OPTIONS

    + + + + + +
    +

    The open mode parameter can include the following flags +in addition to the ‘‘r’’, +‘‘w’’, and +‘‘a’’ flags. Note however that +option flags must follow the read-write-append +specification.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    l

    +
    + +

    When creating a new file force information be written +with Little-Endian byte order (but see below). By default +the library will create new files using the native +CPU byte order.

    +
    +
    + +

    b

    +
    + +

    When creating a new file force information be written +with Big-Endian byte order (but see below). By default the +library will create new files using the native +CPU byte order.

    +
    +
    + +

    L

    +
    + +

    Force image data that is read or written to be treated +with bits filled from Least Significant Bit ( +LSB ) to Most Significant Bit ( +MSB ). Note that this is the opposite to the +way the library has worked from its inception.

    +
    +
    + +

    B

    +
    + +

    Force image data that is read or written to be treated +with bits filled from Most Significant Bit ( +MSB ) to Least Significant Bit ( +LSB ); this is the default.

    +
    +
    + +

    H

    +
    + +

    Force image data that is read or written to be treated +with bits filled in the same order as the native +CPU.

    +
    +
    + +

    M

    +
    + +

    Enable the use of memory-mapped files for images opened +read-only. If the underlying system does not support +memory-mapped files or if the specific image being opened +cannot be memory-mapped then the library will fallback to +using the normal system interface for reading information. +By default the library will attempt to use memory-mapped +files.

    +
    +
    + +

    m

    +
    + +

    Disable the use of memory-mapped files.

    +
    +
    + +

    C

    +
    + +

    Enable the use of ‘‘strip +chopping’’ when reading images that are +comprised of a single strip or tile of uncompressed data. +Strip chopping is a mechanism by which the library will +automatically convert the single-strip image to multiple +strips, each of which has about 8 Kilobytes of data. This +facility can be useful in reducing the amount of memory used +to read an image because the library normally reads each +strip in its entirety. Strip chopping does however alter the +apparent contents of the image because when an image is +divided into multiple strips it looks as though the +underlying file contains multiple separate strips. Finally, +note that default handling of strip chopping is a +compile-time configuration parameter. The default behaviour, +for backwards compatibility, is to enable strip +chopping.

    +
    +
    + +

    c

    +
    + +

    Disable the use of strip chopping when reading +images.

    +
    +
    + +

    h

    +
    + +

    Read TIFF header only, do not load the first image +directory. That could be useful in case of the broken first +directory. We can open the file and proceed to the other +directories.

    +
    +
    + +

    BYTE ORDER

    + + + + + +
    +

    The TIFF specification (all +versions) states that compliant readers must be +capable of reading images written in either byte order. +Nonetheless some software that claims to support the reading +of TIFF images is incapable of reading images +in anything but the native CPU byte order on +which the software was written. (Especially notorious are +applications written to run on Intel-based machines.) By +default the library will create new files with the native +byte-order of the CPU on which the +application is run. This ensures optimal performance and is +portable to any application that conforms to the TIFF +specification. To force the library to use a specific +byte-order when creating a new file the +‘‘b’’ and +‘‘l’’ option flags may be included +in the call to open a file; for example, +‘‘wb’’ or +‘‘wl’’.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    Upon successful completion TIFFOpen, +TIFFFdOpen, and TIFFClientOpen return a +TIFF pointer. Otherwise, NULL is +returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine. Likewise, warning messages +are directed to the TIFFWarning(3TIFF) routine.

    + +

    "%s": Bad mode. The specified +mode parameter was not one of +‘‘r’’ (read), +‘‘w’’ (write), or +‘‘a’’ (append).

    + +

    %s: Cannot open. TIFFOpen() was unable to +open the specified filename for read/writing.

    + +

    Cannot read TIFF header. An error occurred while +attempting to read the header information.

    + +

    Error writing TIFF header. An error occurred while +writing the default header information for a new file.

    + +

    Not a TIFF file, bad magic number %d (0x%x). The +magic number in the header was not (hex) 0x4d4d or (hex) +0x4949.

    + +

    Not a TIFF file, bad version number %d (0x%x). The +version field in the header was not 42 (decimal).

    + +

    Cannot append to file that has opposite byte +ordering. A file with a byte ordering opposite to the +native byte ordering of the current machine was opened for +appending (‘‘a’’). This is a +limitation of the library.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF), TIFFClose(3TIFF)

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFPrintDirectory.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFPrintDirectory.3tiff.html new file mode 100644 index 0000000..f4dca6e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFPrintDirectory.3tiff.html @@ -0,0 +1,225 @@ + + + + + + +TIFFPrintDirectory + + + +

    TIFFPrintDirectory

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFPrintDirectory − print a description of a +TIFF directory

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    void TIFFPrintDirectory(TIFF *tif, FILE +*fd, long flags)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFPrintDirectory prints a description of the +current directory in the specified TIFF file +to the standard I/O output stream fd. The +flags parameter is used to control the level of +detail of the printed information; it is a bit-or of the +flags defined in tiffio.h:

    + + +

    #define TIFFPRINT_NONE 0x0 /* no extra info */

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    #define

    +
    + +

    TIFFPRINT_STRIPS

    +
    + +

    0x1

    +
    + +

    /* strips/tiles info */

    +
    + +

    #define

    +
    + +

    TIFFPRINT_CURVES

    +
    + +

    0x2

    +
    + +

    /* color/gray response curves */

    +
    + +

    #define

    +
    + +

    TIFFPRINT_COLORMAP

    +
    + +

    0x4

    +
    + +

    /* colormap */

    +
    + +

    #define

    +
    + +

    TIFFPRINT_JPEGQTABLES

    +
    + +

    0x100

    +
    + +

    /* JPEG Q matrices */

    +
    + +

    #define

    +
    + +

    TIFFPRINT_JPEGACTABLES

    +
    + +

    0x200

    +
    + +

    /* JPEG AC tables */

    +
    + +

    #define

    +
    + +

    TIFFPRINT_JPEGDCTABLES

    +
    + +

    0x200

    +
    + +

    /* JPEG DC tables */

    +
    + +

    NOTES

    + + + + + +
    +

    In C++ the flags parameter defaults to 0.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    None.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF), TIFFOpen(3TIFF), +TIFFReadDirectory(3TIFF), +TIFFSetDirectory(3TIFF)

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFRGBAImage.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFRGBAImage.3tiff.html new file mode 100644 index 0000000..08a9924 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFRGBAImage.3tiff.html @@ -0,0 +1,319 @@ + + + + + + +TIFFRGBAImage + + + +

    TIFFRGBAImage

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +ALTERNATE RASTER FORMATS
    +SIMULTANEOUS RASTER STORE AND DISPLAY
    +SUPPORTING ADDITIONAL TIFF FORMATS
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFRGBAImageOK, TIFFRGBAImageBegin, TIFFRGBAImageGet, +TIFFRGBAImageEnd − read and decode an image into a +raster

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    typedef unsigned char TIFFRGBValue; typedef struct +_TIFFRGBAImage TIFFRGBAImage;

    + +

    int TIFFRGBAImageOK(TIFF *tif, char +emsg[1024])
    +int TIFFRGBAImageBegin(TIFFRGBAImage *
    img, +TIFF* tif, int stopOnError, +char emsg[1024])
    +int TIFFRGBAImageGet(TIFFRGBAImage *
    img, +uint32* raster, uint32 width , +uint32 height)
    +void TIFFRGBAImageEnd(TIFFRGBAImage +*
    img)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    The routines described here provide a high-level +interface through which TIFF images may be +read into memory. Images may be strip- or tile-based and +have a variety of different characteristics: bits/sample, +samples/pixel, photometric, etc. Decoding state is +encapsulated in a TIFFRGBAImage structure making it +possible to capture state for multiple images and quickly +switch between them. The target raster format can be +customized to a particular application’s needs by +installing custom routines that manipulate image data +according to application requirements.

    + +

    The default usage for these routines is: check if an +image can be processed using TIFFRGBAImageOK, +construct a decoder state block using +TIFFRGBAImageBegin, read and decode an image into a +target raster using TIFFRGBAImageGet, and then +release resources using TIFFRGBAImageEnd. +TIFFRGBAImageGet can be called multiple times to +decode an image using different state parameters. If +multiple images are to be displayed and there is not enough +space for each of the decoded rasters, multiple state blocks +can be managed and then calls can be made to +TIFFRGBAImageGet as needed to display an image.

    + +

    The generated raster is assumed to be an array of +width times height 32-bit entries, where +width must be less than or equal to the width of the +image (height may be any non-zero size). If the +raster dimensions are smaller than the image, the image data +is cropped to the raster bounds. If the raster height is +greater than that of the image, then the image data are +placed in the lower part of the raster. (Note that the +raster is assume to be organized such that the pixel at +location (x,y) is +raster[y*width+x]; with the +raster origin in the lower-left hand corner.)

    + +

    Raster pixels are 8-bit packed red, green, blue, alpha +samples. The macros TIFFGetR, TIFFGetG, +TIFFGetB, and TIFFGetA should be used to +access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255).

    + +

    TIFFRGBAImageGet converts non-8-bit images by +scaling sample values. Palette, grayscale, bilevel, +CMYK , and YCbCr images are converted to +RGB transparently. Raster pixels are returned +uncorrected by any colorimetry information present in the +directory.

    + +

    The parameter stopOnError specifies how to act if +an error is encountered while reading the image. If +stopOnError is non-zero, then an error will terminate +the operation; otherwise TIFFRGBAImageGet will +continue processing data until all the possible data in the +image have been requested.

    +
    + +

    ALTERNATE RASTER FORMATS

    + + + + + +
    +

    To use the core support for reading and processing +TIFF images, but write the resulting raster +data in a different format one need only override the +‘‘put methods’’ used to store +raster data. These methods are are defined in the +TIFFRGBAImage structure and initially setup by +TIFFRGBAImageBegin to point to routines that pack +raster data in the default ABGR pixel format. +Two different routines are used according to the physical +organization of the image data in the file: +PlanarConfiguration=1 (packed samples), and +PlanarConfiguration=2 (separated samples). Note that +this mechanism can be used to transform the data before +storing it in the raster. For example one can convert data +to colormap indices for display on a colormap display.

    +
    + +

    SIMULTANEOUS RASTER STORE AND DISPLAY

    + + + + + +
    +

    It is simple to display an image as it is being read into +memory by overriding the put methods as described above for +supporting alternate raster formats. Simply keep a reference +to the default put methods setup by +TIFFRGBAImageBegin and then invoke them before or +after each display operation. For example, the +tiffgt(1) utility uses the following put method to +update the display as the raster is being filled:

    + +
    static void
    +putContigAndDraw(TIFFRGBAImage* img, uint32* raster,
    +    uint32 x, uint32 y, uint32 w, uint32 h,
    +    int32 fromskew, int32 toskew,
    +    unsigned char* cp)
    +{
    +    (*putContig)(img, raster, x, y, w, h, fromskew, toskew, cp);
    +    if (x+w == width) {
    +     w = width;
    +     if (img->orientation == ORIENTATION_TOPLEFT)
    +         lrectwrite(0, y-(h-1), w-1, y, raster-x-(h-1)*w);
    +     else
    +         lrectwrite(0, y, w-1, y+h-1, raster);
    +    }
    +}
    +
    + +

    (the original routine provided by the library is saved in +the variable putContig.)

    +
    + +

    SUPPORTING ADDITIONAL TIFF FORMATS

    + + + + + +
    +

    The TIFFRGBAImage routines support the most +commonly encountered flavors of TIFF. It is +possible to extend this support by overriding the +‘‘get method’’ invoked by +TIFFRGBAImageGet to read TIFF image +data. Details of doing this are a bit involved, it is best +to make a copy of an existing get method and modify it to +suit the needs of an application.

    +
    + +

    NOTES

    + + + + + +
    +

    Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +SamplesPerPixel minus ExtraSamples).

    + +

    Palette image colormaps that appear to be incorrectly +written as 8-bit values are automatically scaled to +16-bits.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    All routines return 1 if the operation was successful. +Otherwise, 0 is returned if an error was encountered and +stopOnError is zero.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Sorry, can not handle %d-bit pictures. The image +had BitsPerSample other than 1, 2, 4, 8, or 16.

    + +

    Sorry, can not handle %d-channel images. The image +had SamplesPerPixel other than 1, 3, or 4.

    + +

    Missing needed "PhotometricInterpretation" +tag. The image did not have a tag that describes how to +display the data.

    + +

    No "PhotometricInterpretation" tag, assuming +RGB. The image was missing a tag that describes how to +display it, but because it has 3 or 4 samples/pixel, it is +assumed to be RGB.

    + +

    No "PhotometricInterpretation" tag, assuming +min-is-black. The image was missing a tag that describes +how to display it, but because it has 1 sample/pixel, it is +assumed to be a grayscale or bilevel image.

    + +

    No space for photometric conversion table. There +was insufficient memory for a table used to convert image +samples to 8-bit RGB.

    + +

    Missing required "Colormap" tag. A +Palette image did not have a required Colormap +tag.

    + +

    No space for tile buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    No space for strip buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    Can not handle format. The image has a format +(combination of BitsPerSample, +SamplesPerPixel, and +PhotometricInterpretation) that can not be +handled.

    + +

    No space for B&W mapping table. There was +insufficient memory to allocate a table used to map +grayscale data to RGB.

    + +

    No space for Palette mapping table. There was +insufficient memory to allocate a table used to map data to +8-bit RGB.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFReadRGBAImage(3TIFF), +TIFFReadRGBAImageOriented(3TIFF), +TIFFReadRGBAStrip(3TIFF), +TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadDirectory.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadDirectory.3tiff.html new file mode 100644 index 0000000..82350ad --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadDirectory.3tiff.html @@ -0,0 +1,218 @@ + + + + + + +TIFFReadDirectory + + + +

    TIFFReadDirectory

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadDirectory − get the contents of the +next directory in an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFReadDirectory(TIFF +*tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the next directory in the specified file and +make it the current directory. Applications only need to +call TIFFReadDirectory to read multiple subfiles in a +single TIFF file— the first directory in a +file is automatically read when TIFFOpen is +called.

    +
    + +

    NOTES

    + + + + + +
    +

    If the library is compiled with +STRIPCHOP_SUPPORT enabled, then images that have a +single uncompressed strip or tile of data are automatically +treated as if they were made up of multiple strips or tiles +of approximately 8 kilobytes each. This operation is done +only in-memory; it does not alter the contents of the file. +However, the construction of the ‘‘chopped +strips’’ is visible to the application through +the number of strips [tiles] returned by +TIFFNumberOfStrips +[TIFFNumberOfTiles].

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    If the next directory was successfully read, 1 is +returned. Otherwise, 0 is returned if an error was +encountered, or if there are no more directories to be +read.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine. All warning messages are +directed to the TIFFWarning(3TIFF) routine.

    + +

    Seek error accessing TIFF directory. An error +occurred while positioning to the location of the +directory.

    + +

    Wrong data type %d for field "%s". +The tag entry in the directory had an incorrect data type. +For example, an ImageDescription tag with a +SHORT data type.

    + +

    TIFF directory is missing required "%s" +field. The specified tag is required to be present by +the TIFF 5.0 specification, but is missing. The +directory is (usually) unusable.

    + +

    %s: Rational with zero denominator. A +directory tag has a RATIONAL value whose +denominator is zero.

    + +

    Incorrect count %d for field "%s" (%lu, +expecting %lu); tag ignored. The specified tag’s +count field is bad. For example, a count other than 1 for a +SubFileType tag.

    + +

    Cannot handle different per-sample values for +field "%s". The tag has SamplesPerPixel +values and they are not all the same; e.g. +BitsPerSample. The library is unable to handle images +of this sort.

    + +

    Count mismatch for field "%s"; +expecting %d, got %d. The count field in a tag does not +agree with the number expected by the library. This should +never happen, so if it does, the library refuses to read the +directory.

    + +

    Invalid TIFF directory; tags are not sorted in +ascending order. The directory tags are not properly +sorted as specified in the TIFF 5.0 +specification. This error is not fatal.

    + +

    Ignoring unknown field with tag %d (0x%x). An +unknown tag was encountered in the directory; the library +ignores all such tags.

    + +

    TIFF directory is missing requred +"ImageLength" field. The image violates the +specification by not having a necessary field. There is no +way for the library to recover from this error.

    + +

    TIFF directory is missing requred +"PlanarConfig" field. The image violates the +specification by not having a necessary field. There is no +way for the library to recover from this error.

    + +

    TIFF directory is missing requred +"StripOffsets" field. The image has multiple +strips, but is missing the tag that specifies the file +offset to each strip of data. There is no way for the +library to recover from this error.

    + +

    TIFF directory is missing requred +"TileOffsets" field. The image has multiple +tiles, but is missing the tag that specifies the file offset +to each tile of data. There is no way for the library to +recover from this error.

    + +

    TIFF directory is missing required +"StripByteCounts" field. The image has +multiple strips, but is missing the tag that specifies the +size of each strip of data. There is no way for the library +to recover from this error.

    + +

    TIFF directory is missing required +"StripByteCounts" field, calculating from +imagelength. The image violates the specification by not +having a necessary field. However, when the image is +comprised of only one strip or tile, the library will +estimate the missing value based on the file size.

    + +

    Bogus "StripByteCounts" field, ignoring +and calculating from imagelength. Certain vendors +violate the specification by writing zero for the +StripByteCounts tag when they want to leave the value +unspecified. If the image has a single strip, the library +will estimate the missing value based on the file +size.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteDirectory(3TIFF), +TIFFSetDirectory(3TIFF), +TIFFSetSubDirectory(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedStrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedStrip.3tiff.html new file mode 100644 index 0000000..d5c4c15 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedStrip.3tiff.html @@ -0,0 +1,133 @@ + + + + + + +TIFFReadEncodedStrip + + + +

    TIFFReadEncodedStrip

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadEncodedStrip − read and decode a strip +of data from an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFReadEncodedStrip(TIFF +*tif, tstrip_t strip, +tdata_t buf, tsize_t +size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the specified strip of data and place up to +size bytes of decompressed information in the (user +supplied) data buffer.

    +
    + +

    NOTES

    + + + + + +
    +

    The value of strip is a ‘‘raw +strip number.’’ That is, the caller must take +into account whether or not the data are organized in +separate planes (PlanarConfiguration=2). To read a +full strip of data the data buffer should typically be at +least as large as the number returned by +TIFFStripSize(3TIFF). If the -1 passed in size +parameter, the whole strip will be read. You should be sure +you have enough space allocated for the buffer.

    + +

    The library attempts to hide bit- and byte-ordering +differences between the image and the native machine by +converting data to the native machine order. Bit reversal is +done if the FillOrder tag is opposite to the native +machine bit order. 16- and 32-bit samples are automatically +byte-swapped if the file was written with a byte order +opposite to the native machine byte order,

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    The actual number of bytes of data that were placed +in buf is returned; TIFFReadEncodedStrip +returns −1 if an error was encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFReadRawStrip(3TIFF), +TIFFReadScanline(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedTile.3tiff.html new file mode 100644 index 0000000..b42dc09 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadEncodedTile.3tiff.html @@ -0,0 +1,130 @@ + + + + + + +TIFFReadEncodedTile + + + +

    TIFFReadEncodedTile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadEncodedTile − read and decode a tile of +data from an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFReadEncodedTile(TIFF *tif, +ttile_t tile, tdata_t buf, +tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the specified tile of data and place up to +size bytes of decompressed information in the (user +supplied) data buffer.

    +
    + +

    NOTES

    + + + + + +
    +

    The value of tile is a ‘‘raw tile +number.’’ That is, the caller must take into +account whether or not the data are organized in separate +planes (PlanarConfiguration=2). +TIFFComputeTile automatically does this when +converting an (x,y,z,sample) coordinate quadruple to a tile +number. To read a full tile of data the data buffer should +be at least as large as the value returned by +TIFFTileSize.

    + +

    The library attempts to hide bit- and byte-ordering +differences between the image and the native machine by +converting data to the native machine order. Bit reversal is +done if the FillOrder tag is opposite to the native +machine bit order. 16- and 32-bit samples are automatically +byte-swapped if the file was written with a byte order +opposite to the native machine byte order,

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    The actual number of bytes of data that were placed in +buf is returned; TIFFReadEncodedTile returns +−1 if an error was encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFReadRawTile(3TIFF), +TIFFReadTile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAImage.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAImage.3tiff.html new file mode 100644 index 0000000..1ebb09b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAImage.3tiff.html @@ -0,0 +1,301 @@ + + + + + + +TIFFReadRGBAImage + + + +

    TIFFReadRGBAImage

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadRGBAImage, TIFFReadRGBAImageOriented − read +and decode an image into a fixed-format raster

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    #define TIFFGetR(abgr) ((abgr) & 0xff)
    +#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
    +#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
    +#define TIFFGetA(abgr) (((abgr) >> 24) & +0xff)

    + +

    int TIFFReadRGBAImage(TIFF *tif, +uint32 width, uint32 height, +uint32 *raster, int +stopOnError)
    +int TIFFReadRGBAImageOriented(TIFF *
    tif, +uint32 width, uint32 height, +uint32 *raster, int orientation, +int stopOnError)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFReadRGBAImage reads a strip- or tile-based +image into memory, storing the result in the user supplied +raster. The raster is assumed to be an array of +width times height 32-bit entries, where +width must be less than or equal to the width of the +image (height may be any non-zero size). If the +raster dimensions are smaller than the image, the image data +is cropped to the raster bounds. If the raster height is +greater than that of the image, then the image data are +placed in the lower part of the raster. (Note that the +raster is assume to be organized such that the pixel at +location (x,y) is +raster[y*width+x]; with the +raster origin in the lower-left hand corner.)

    + +

    TIFFReadRGBAImageOriented works like +TIFFReadRGBAImage with except of that user can +specify the raster origin position with the +orientation parameter. Four orientations +supported:

    +
    + + + + + +
    +

    ORIENTATION_TOPLEFT

    + + + + + +
    +

    origin in top-left corner,

    +
    + + + + + +
    +

    ORIENTATION_TOPRIGHT

    + + + + + +
    +

    origin in top-right corner,

    +
    + + + + + +
    +

    ORIENTATION_BOTLEFT

    + + + + + +
    +

    origin in bottom-left corner and

    +
    + + + + + +
    +

    ORIENTATION_BOTRIGHT

    + + + + + +
    +

    origin in bottom-right corner.

    +
    + + + + + +
    +

    If you choose ORIENTATION_BOTLEFT result will be +the same as returned by the TIFFReadRGBAImage.

    + +

    Raster pixels are 8-bit packed red, green, blue, alpha +samples. The macros TIFFGetR, TIFFGetG, +TIFFGetB, and TIFFGetA should be used to +access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255).

    + +

    TIFFReadRGBAImage converts non-8-bit images by +scaling sample values. Palette, grayscale, bilevel, +CMYK , and YCbCr images are converted to +RGB transparently. Raster pixels are returned +uncorrected by any colorimetry information present in the +directory.

    + +

    The paramater stopOnError specifies how to act if +an error is encountered while reading the image. If +stopOnError is non-zero, then an error will terminate +the operation; otherwise TIFFReadRGBAImage will +continue processing data until all the possible data in the +image have been requested.

    +
    + +

    NOTES

    + + + + + +
    +

    In C++ the stopOnError parameter defaults to +0.

    + +

    Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +SamplesPerPixel minus ExtraSamples).

    + +

    Palettte image colormaps that appear to be incorrectly +written as 8-bit values are automatically scaled to +16-bits.

    + +

    TIFFReadRGBAImage is just a wrapper around the +more general TIFFRGBAImage(3TIFF) facilities.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    1 is returned if the image was successfully read and +converted. Otherwise, 0 is returned if an error was +encountered and stopOnError is zero.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Sorry, can not handle %d-bit pictures. The image +had BitsPerSample other than 1, 2, 4, 8, or 16.

    + +

    Sorry, can not handle %d-channel images. The image +had SamplesPerPixel other than 1, 3, or 4.

    + +

    Missing needed "PhotometricInterpretation" +tag. The image did not have a tag that describes how to +display the data.

    + +

    No "PhotometricInterpretation" tag, assuming +RGB. The image was missing a tag that describes how to +display it, but because it has 3 or 4 samples/pixel, it is +assumed to be RGB.

    + +

    No "PhotometricInterpretation" tag, assuming +min-is-black. The image was missing a tag that describes +how to display it, but because it has 1 sample/pixel, it is +assumed to be a grayscale or bilevel image.

    + +

    No space for photometric conversion table. There +was insufficient memory for a table used to convert image +samples to 8-bit RGB.

    + +

    Missing required "Colormap" tag. A +Palette image did not have a required Colormap +tag.

    + +

    No space for tile buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    No space for strip buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    Can not handle format. The image has a format +(combination of BitsPerSample, +SamplesPerPixel, and +PhotometricInterpretation) that +TIFFReadRGBAImage can not handle.

    + +

    No space for B&W mapping table. There was +insufficient memory to allocate a table used to map +grayscale data to RGB.

    + +

    No space for Palette mapping table. There was +insufficient memory to allocate a table used to map data to +8-bit RGB.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFRGBAImage(3TIFF), +TIFFReadRGBAStrip(3TIFF), +TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAStrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAStrip.3tiff.html new file mode 100644 index 0000000..37d36d3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBAStrip.3tiff.html @@ -0,0 +1,208 @@ + + + + + + +TIFFReadRGBAStrip + + + +

    TIFFReadRGBAStrip

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadRGBAStrip − read and decode an image strip +into a fixed-format raster

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    #define TIFFGetR(abgr) ((abgr) & 0xff)
    +#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
    +#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
    +#define TIFFGetA(abgr) (((abgr) >> 24) & +0xff)

    + +

    int TIFFReadRGBAStrip(TIFF *tif, +uint32 row, uint32 +*raster)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFReadRGBAStrip reads a single strip of a +strip-based image into memory, storing the result in the +user supplied RGBA raster. The raster is assumed to +be an array of width times rowsperstrip 32-bit entries, +where width is the width of the image (TIFFTAG_IMAGEWIDTH) +and rowsperstrip is the maximum lines in a strip +(TIFFTAG_ROWSPERSTRIP).

    + +

    The row value should be the row of the first row +in the strip (strip * rowsperstrip, zero based).

    + +

    Note that the raster is assume to be organized such that +the pixel at location (x,y) is +raster[y*width+x]; with the +raster origin in the lower-left hand corner of the +strip. That is bottom to top organization. When reading a +partial last strip in the file the last line of the image +will begin at the beginning of the buffer.

    + +

    Raster pixels are 8-bit packed red, green, blue, alpha +samples. The macros TIFFGetR, TIFFGetG, +TIFFGetB, and TIFFGetA should be used to +access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255).

    + +

    See the TIFFRGBAImage(3TIFF) page for more details +on how various image types are converted to RGBA values.

    +
    + +

    NOTES

    + + + + + +
    +

    Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +SamplesPerPixel minus ExtraSamples).

    + +

    Palette image colormaps that appear to be incorrectly +written as 8-bit values are automatically scaled to +16-bits.

    + +

    TIFFReadRGBAStrip is just a wrapper around the +more general TIFFRGBAImage(3TIFF) facilities. +It’s main advantage over the similar +TIFFReadRGBAImage() function is that for large images +a single buffer capable of holding the whole image +doesn’t need to be allocated, only enough for one +strip. The TIFFReadRGBATile() function does a similar +operation for tiled images.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    1 is returned if the image was successfully read and +converted. Otherwise, 0 is returned if an error was +encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Sorry, can not handle %d-bit pictures. The image +had BitsPerSample other than 1, 2, 4, 8, or 16.

    + +

    Sorry, can not handle %d-channel images. The image +had SamplesPerPixel other than 1, 3, or 4.

    + +

    Missing needed "PhotometricInterpretation" +tag. The image did not have a tag that describes how to +display the data.

    + +

    No "PhotometricInterpretation" tag, assuming +RGB. The image was missing a tag that describes how to +display it, but because it has 3 or 4 samples/pixel, it is +assumed to be RGB.

    + +

    No "PhotometricInterpretation" tag, assuming +min-is-black. The image was missing a tag that describes +how to display it, but because it has 1 sample/pixel, it is +assumed to be a grayscale or bilevel image.

    + +

    No space for photometric conversion table. There +was insufficient memory for a table used to convert image +samples to 8-bit RGB.

    + +

    Missing required "Colormap" tag. A +Palette image did not have a required Colormap +tag.

    + +

    No space for tile buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    No space for strip buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    Can not handle format. The image has a format +(combination of BitsPerSample, +SamplesPerPixel, and +PhotometricInterpretation) that +TIFFReadRGBAImage can not handle.

    + +

    No space for B&W mapping table. There was +insufficient memory to allocate a table used to map +grayscale data to RGB.

    + +

    No space for Palette mapping table. There was +insufficient memory to allocate a table used to map data to +8-bit RGB.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFRGBAImage(3TIFF), +TIFFReadRGBAImage(3TIFF), +TIFFReadRGBATile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBATile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBATile.3tiff.html new file mode 100644 index 0000000..6bd298a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRGBATile.3tiff.html @@ -0,0 +1,261 @@ + + + + + + +TIFFReadRGBATile + + + +

    TIFFReadRGBATile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadRGBATile − read and decode an image tile +into a fixed-format raster

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    #define TIFFGetR(abgr)

    +
    + +

    ((abgr) & 0xff)

    +
    + +

    #define TIFFGetG(abgr)

    +
    + +

    (((abgr) >> 8) & 0xff)

    +
    + +

    #define TIFFGetB(abgr)

    +
    + +

    (((abgr) >> 16) & 0xff)

    +
    + +

    #define TIFFGetA(abgr)

    +
    + +

    (((abgr) >> 24) & 0xff)

    +
    + + + + + +
    +

    int TIFFReadRGBATile(TIFF *tif, +uint32 x, uint32 y, uint32 +*raster)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFReadRGBATile reads a single tile of a +tile-based image into memory, storing the result in the user +supplied RGBA raster. The raster is assumed to be an +array of width times length 32-bit entries, where width is +the width of a tile (TIFFTAG_TILEWIDTH) and length is the +height of a tile (TIFFTAG_TILELENGTH).

    + +

    The x and y values are the offsets from the +top left corner to the top left corner of the tile to be +read. They must be an exact multiple of the tile width and +length.

    + +

    Note that the raster is assume to be organized such that +the pixel at location (x,y) is +raster[y*width+x]; with the +raster origin in the lower-left hand corner of the +tile. That is bottom to top organization. Edge tiles which +partly fall off the image will be filled out with +appropriate zeroed areas.

    + +

    Raster pixels are 8-bit packed red, green, blue, alpha +samples. The macros TIFFGetR, TIFFGetG, +TIFFGetB, and TIFFGetA should be used to +access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255).

    + +

    See the TIFFRGBAImage(3TIFF) page for more details +on how various image types are converted to RGBA values.

    +
    + +

    NOTES

    + + + + + +
    +

    Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +SamplesPerPixel minus ExtraSamples).

    + +

    Palette image colormaps that appear to be incorrectly +written as 8-bit values are automatically scaled to +16-bits.

    + +

    TIFFReadRGBATile is just a wrapper around the more +general TIFFRGBAImage(3TIFF) facilities. It’s +main advantage over the similar TIFFReadRGBAImage() +function is that for large images a single buffer capable of +holding the whole image doesn’t need to be allocated, +only enough for one tile. The TIFFReadRGBAStrip() +function does a similar operation for stripped images.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    1 is returned if the image was successfully read and +converted. Otherwise, 0 is returned if an error was +encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Sorry, can not handle %d-bit pictures. The image +had BitsPerSample other than 1, 2, 4, 8, or 16.

    + +

    Sorry, can not handle %d-channel images. The image +had SamplesPerPixel other than 1, 3, or 4.

    + +

    Missing needed "PhotometricInterpretation" +tag. The image did not have a tag that describes how to +display the data.

    + +

    No "PhotometricInterpretation" tag, assuming +RGB. The image was missing a tag that describes how to +display it, but because it has 3 or 4 samples/pixel, it is +assumed to be RGB.

    + +

    No "PhotometricInterpretation" tag, assuming +min-is-black. The image was missing a tag that describes +how to display it, but because it has 1 sample/pixel, it is +assumed to be a grayscale or bilevel image.

    + +

    No space for photometric conversion table. There +was insufficient memory for a table used to convert image +samples to 8-bit RGB.

    + +

    Missing required "Colormap" tag. A +Palette image did not have a required Colormap +tag.

    + +

    No space for tile buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    No space for strip buffer. There was insufficient +memory to allocate an i/o buffer.

    + +

    Can not handle format. The image has a format +(combination of BitsPerSample, +SamplesPerPixel, and +PhotometricInterpretation) that +TIFFReadRGBAImage can not handle.

    + +

    No space for B&W mapping table. There was +insufficient memory to allocate a table used to map +grayscale data to RGB.

    + +

    No space for Palette mapping table. There was +insufficient memory to allocate a table used to map data to +8-bit RGB.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFRGBAImage(3TIFF), +TIFFReadRGBAImage(3TIFF), +TIFFReadRGBAStrip(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawStrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawStrip.3tiff.html new file mode 100644 index 0000000..4dd1fbc --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawStrip.3tiff.html @@ -0,0 +1,109 @@ + + + + + + +TIFFReadRawStrip + + + +

    TIFFReadRawStrip

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadRawStrip − return the undecoded contents of +a strip of data from an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFReadRawStrip(TIFF *tif, +tstrip_t strip, tdata_t buf, +tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the contents of the specified strip into the (user +supplied) data buffer. Note that the value of strip +is a ‘‘raw strip number.’’ That is, +the caller must take into account whether or not the data is +organized in separate planes (PlanarConfiguration=2). +To read a full strip of data the data buffer should +typically be at least as large as the number returned by +TIFFStripSize.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    The actual number of bytes of data that were placed in +buf is returned; TIFFReadEncodedStrip returns +−1 if an error was encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFReadEncodedStrip(3TIFF), +TIFFReadScanline(3TIFF), TIFFStripSize(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawTile.3tiff.html new file mode 100644 index 0000000..e74295b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadRawTile.3tiff.html @@ -0,0 +1,111 @@ + + + + + + +TIFFReadRawTile + + + +

    TIFFReadRawTile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadRawTile − return an undecoded tile of data +from an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFReadRawTile(TIFF *tif, +ttile_t tile, tdata_t buf, +tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the contents of the specified tile into the (user +supplied) data buffer. Note that the value of tile is +a ‘‘raw tile number.’’ That is, the +caller must take into account whether or not the data is +organized in separate planes (PlanarConfiguration=2). +TIFFComputeTile automatically does this when +converting an (x,y,z,sample) coordinate quadruple to a tile +number. To read a full tile of data the data buffer should +typically be at least as large as the value returned by +TIFFTileSize.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    The actual number of bytes of data that were placed in +buf is returned; TIFFReadEncodedTile returns +−1 if an error was encountered.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFReadEncodedTile(3TIFF), +TIFFReadTile(3TIFF), TIFFTileSize(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadScanline.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadScanline.3tiff.html new file mode 100644 index 0000000..e825e4c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadScanline.3tiff.html @@ -0,0 +1,157 @@ + + + + + + +TIFFReadScanline + + + +

    TIFFReadScanline

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadScanline − read and decode a scanline of +data from an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFReadScanline(TIFF *tif, +tdata_t buf, uint32 row, +tsample_t sample)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Read the data for the specified row into the (user +supplied) data buffer buf. The data are returned +decompressed and, in the native byte- and bit-ordering, but +are otherwise packed (see further below). The buffer must be +large enough to hold an entire scanline of data. +Applications should call the routine TIFFScanlineSize +to find out the size (in bytes) of a scanline buffer. The +row parameter is always used by +TIFFReadScanline; the sample parameter is used +only if data are organized in separate planes +(PlanarConfiguration=2).

    +
    + +

    NOTES

    + + + + + +
    +

    The library attempts to hide bit- and byte-ordering +differences between the image and the native machine by +converting data to the native machine order. Bit reversal is +done if the FillOrder tag is opposite to the native +machine bit order. 16- and 32-bit samples are automatically +byte-swapped if the file was written with a byte order +opposite to the native machine byte order,

    + +

    In C++ the sample parameter defaults to 0.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFReadScanline returns −1 if it detects an +error; otherwise 1 is returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Compression algorithm does not support random +access. Data was requested in a non-sequential order +from a file that uses a compression algorithm and that has +RowsPerStrip greater than one. That is, data in the +image is stored in a compressed form, and with multiple rows +packed into a strip. In this case, the library does not +support random access to the data. The data should either be +accessed sequentially, or the file should be converted so +that each strip is made up of one row of data.

    +
    + +

    BUGS

    + + + + + +
    +

    Reading subsampled YCbCR data does not work correctly +because, for PlanarConfiguration=2 the size of a +scanline is not calculated on a per-sample basis, and for +PlanarConfiguration=1 the library does not unpack the +block-interleaved samples; use the strip- and tile-based +interfaces to read these formats.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFReadEncodedStrip(3TIFF), +TIFFReadRawStrip(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadTile.3tiff.html new file mode 100644 index 0000000..be245f8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFReadTile.3tiff.html @@ -0,0 +1,133 @@ + + + + + + +TIFFReadTile + + + +

    TIFFReadTile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadTile − read and decode a tile of data from +an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFReadTile(TIFF *tif, +tdata_t buf, uint32 x, +uint32 y, uint32 z, +tsample_t sample)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Return the data for the tile containing the +specified coordinates. The data placed in buf are +returned decompressed and, typically, in the native byte- +and bit-ordering, but are otherwise packed (see further +below). The buffer must be large enough to hold an entire +tile of data. Applications should call the routine +TIFFTileSize to find out the size (in bytes) of a +tile buffer. The x and y parameters are always +used by TIFFReadTile. The z parameter is used +if the image is deeper than 1 slice +(ImageDepth>1). The sample parameter is +used only if data are organized in separate planes +(PlanarConfiguration=2).

    +
    + +

    NOTES

    + + + + + +
    +

    The library attempts to hide bit- and byte-ordering +differences between the image and the native machine by +converting data to the native machine order. Bit reversal is +done if the FillOrder tag is opposite to the native +machine bit order. 16- and 32-bit samples are automatically +byte-swapped if the file was written with a byte order +opposite to the native machine byte order,

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFReadTile returns −1 if it detects an +error; otherwise the number of bytes in the decoded tile is +returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFCheckTile(3TIFF), +TIFFComputeTile(3TIFF), TIFFOpen(3TIFF), +TIFFReadEncodedTile(3TIFF), +TIFFReadRawTile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetDirectory.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetDirectory.3tiff.html new file mode 100644 index 0000000..9047b0b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetDirectory.3tiff.html @@ -0,0 +1,122 @@ + + + + + + +TIFFSetDirectory + + + +

    TIFFSetDirectory

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFSetDirectory, TIFFSetSubDirectory − set the +current directory for an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFSetDirectory(TIFF *tif, +tdir_t dirnum)
    +int TIFFSetSubDirectory(TIFF *
    tif, uint32 +diroff)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFSetDirectory changes the current directory and +reads its contents with TIFFReadDirectory. The +parameter dirnum specifies the subfile/directory as +an integer number, with the first directory numbered +zero.

    + +

    TIFFSetSubDirectory acts like +TIFFSetDirectory, except the directory is specified +as a file offset instead of an index; this is required for +accessing subdirectories linked through a SubIFD +tag.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    On successful return 1 is returned. Otherwise, 0 is +returned if dirnum or diroff specifies a +non-existent directory, or if an error was encountered while +reading the directory’s contents.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: Error fetching directory count. An error was +encountered while reading the ‘‘directory +count’’ field.

    + +

    %s: Error fetching directory link. An error was +encountered while reading the ‘‘link +value’’ that points to the next directory in a +file.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFCurrentDirectory(3TIFF), +TIFFOpen(3TIFF), TIFFReadDirectory(3TIFF), +TIFFWriteDirectory(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetField.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetField.3tiff.html new file mode 100644 index 0000000..f160fed --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFSetField.3tiff.html @@ -0,0 +1,1865 @@ + + + + + + + + + +TIFFSetField + + + + +

    TIFFSetField

    + +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + + +

    NAME + +

    + + +

    TIFFSetField, +TIFFVSetField − set the value(s) of a tag in a +TIFF file open for writing

    + +

    SYNOPSIS + +

    + + +

    #include +<tiffio.h>

    + +

    int +TIFFSetField(TIFF *tif, ttag_t +tag, ...)

    + +

    #include +<stdarg.h>

    + +

    int +TIFFVSetField(TIFF *tif, ttag_t +tag, va_list ap)

    + +

    DESCRIPTION + +

    + + + +

    TIFFSetField +sets the value of a field or pseudo-tag in the current +directory associated with the open TIFF file +tif. (A pseudo-tag is a parameter that is used +to control the operation of the TIFF library +but whose value is not read or written to the underlying +file.) To set the value of a field the file must have been +previously opened for writing with TIFFOpen(3TIFF); +pseudo-tags can be set whether the file was opened for +reading or writing. The field is identified by tag, +one of the values defined in the include file tiff.h +(see also the table below). The actual value is specified +using a variable argument list, as prescribed by the +stdarg(3) interface (or, on some machines, the +varargs(3) interface.)

    + + +

    TIFFVSetField +is functionally equivalent to TIFFSetField except +that it takes a pointer to a variable argument list. +TIFFVSetField is useful for writing routines that are +layered on top of the functionality provided by +TIFFSetField.

    + +

    The tags +understood by libtiff, the number of parameter +values, and the expected types for the parameter values are +shown below. The data types are: char* is +null-terminated string and corresponds to the +ASCII data type; uint16 is an unsigned +16-bit value; uint32 is an unsigned 32-bit value; +uint16* is an array of unsigned 16-bit values. +void* is an array of data values of unspecified +type.

    + +

    Consult the +TIFF specification for information on the +meaning of each tag.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    Tag Name

    + + +

    Count

    +
    + + +

    Types

    + + +

    Notes

    + + +

    TIFFTAG_ARTIST

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_BADFAXLINES

    + + +

    1

    +
    + + +

    uint32

    +
    + + +

    TIFFTAG_BITSPERSAMPLE

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_CLEANFAXDATA

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_COLORMAP

    + + +

    3

    +
    + + +

    uint16*

    + + +

    1<<BitsPerSample arrays

    + + +

    TIFFTAG_COMPRESSION

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_CONSECUTIVEBADFAXLINES

    + + +

    1

    +
    + + +

    uint32

    +
    + + +

    TIFFTAG_COPYRIGHT

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_DATETIME

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_DOCUMENTNAME

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_DOTRANGE

    + + +

    2

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_EXTRASAMPLES

    + + +

    2

    +
    + + +

    uint16,uint16*

    + + +

    † count & types array

    + + +

    TIFFTAG_FAXFILLFUNC

    + + +

    1

    +
    + + +

    TIFFFaxFillFunc

    + + +

    G3/G4 compression pseudo-tag

    + + +

    TIFFTAG_FAXMODE

    + + +

    1

    +
    + + +

    int

    + + +

    † G3/G4 compression pseudo-tag

    + + +

    TIFFTAG_FILLORDER

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_GROUP3OPTIONS

    + + +

    1

    +
    + + +

    uint32

    + + +

    + + +

    TIFFTAG_GROUP4OPTIONS

    + + +

    1

    +
    + + +

    uint32

    + + +

    + + +

    TIFFTAG_HALFTONEHINTS

    + + +

    2

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_HOSTCOMPUTER

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_ICCPROFILE

    + + +

    2

    +
    + + +

    uint32,void*

    + + +

    count, profile data

    + + +

    TIFFTAG_IMAGEDEPTH

    + + +

    1

    +
    + + +

    uint32

    + + +

    + + +

    TIFFTAG_IMAGEDESCRIPTION

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_IMAGELENGTH

    + + +

    1

    +
    + + +

    uint32

    +
    + + +

    TIFFTAG_IMAGEWIDTH

    + + +

    1

    +
    + + +

    uint32

    + + +

    + + +

    TIFFTAG_INKNAMES

    + + +

    2

    +
    + + +

    uint16, char*

    +
    + + +

    TIFFTAG_INKSET

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_JPEGCOLORMODE

    + + +

    1

    +
    + + +

    int

    + + +

    † JPEG pseudo-tag

    + + +

    TIFFTAG_JPEGQUALITY

    + + +

    1

    +
    + + +

    int

    + + +

    JPEG pseudo-tag

    + + +

    TIFFTAG_JPEGTABLES

    + + +

    2

    +
    + + +

    uint32*,void*

    + + +

    † count & tables

    + + +

    TIFFTAG_JPEGTABLESMODE

    + + +

    1

    +
    + + +

    int

    + + +

    † JPEG pseudo-tag

    + + +

    TIFFTAG_MAKE

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_MATTEING

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_MAXSAMPLEVALUE

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_MINSAMPLEVALUE

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_MODEL

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_ORIENTATION

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_PAGENAME

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_PAGENUMBER

    + + +

    2

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_PHOTOMETRIC

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_PHOTOSHOP

    + + +

    ?

    +
    + + +

    uint32,void*

    + + +

    count, data

    + + +

    TIFFTAG_PLANARCONFIG

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_PREDICTOR

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_PRIMARYCHROMATICITIES

    + + +

    1

    +
    + + +

    float*

    + + +

    6-entry array

    + + +

    TIFFTAG_REFERENCEBLACKWHITE

    + + +

    1

    +
    + + +

    float*

    + + +

    † 6-entry array

    + + +

    TIFFTAG_RESOLUTIONUNIT

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_RICHTIFFIPTC

    + + +

    2

    +
    + + +

    uint32,void*

    + + +

    count, data

    + + +

    TIFFTAG_ROWSPERSTRIP

    + + +

    1

    +
    + + +

    uint32

    + + +

    † must be > 0

    + + +

    TIFFTAG_SAMPLEFORMAT

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_SAMPLESPERPIXEL

    + + +

    1

    +
    + + +

    uint16

    + + +

    † value must be <= 4

    + + +

    TIFFTAG_SMAXSAMPLEVALUE

    + + +

    1

    +
    + + +

    double

    +
    + + +

    TIFFTAG_SMINSAMPLEVALUE

    + + +

    1

    +
    + + +

    double

    +
    + + +

    TIFFTAG_SOFTWARE

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_STONITS

    + + +

    1

    +
    + + +

    double

    + + +

    + + +

    TIFFTAG_SUBFILETYPE

    + + +

    1

    +
    + + +

    uint32

    +
    + + +

    TIFFTAG_SUBIFD

    + + +

    2

    +
    + + +

    uint16,uint32*

    + + +

    count & offsets array

    + + +

    TIFFTAG_TARGETPRINTER

    + + +

    1

    +
    + + +

    char*

    +
    + + +

    TIFFTAG_THRESHHOLDING

    + + +

    1

    +
    + + +

    uint16

    +
    + + +

    TIFFTAG_TILEDEPTH

    + + +

    1

    +
    + + +

    uint32

    + + +

    + + +

    TIFFTAG_TILELENGTH

    + + +

    1

    +
    + + +

    uint32

    + + +

    † must be a multiple of 8

    + + +

    TIFFTAG_TILEWIDTH

    + + +

    1

    +
    + + +

    uint32

    + + +

    † must be a multiple of 8

    + + +

    TIFFTAG_TRANSFERFUNCTION

    + + +

    1 or 3‡ uint16*

    + + +

    1<<BitsPerSample entry arrays

    + + +

    TIFFTAG_WHITEPOINT

    + + +

    1

    +
    + + +

    float*

    + + +

    2-entry array

    + + +

    TIFFTAG_XMLPACKET

    + + +

    2

    +
    + + +

    uint32,void*

    + + +

    count, data

    + + +

    TIFFTAG_XPOSITION

    + + +

    1

    +
    + + +

    float

    +
    + + +

    TIFFTAG_XRESOLUTION

    + + +

    1

    +
    + + +

    float

    +
    + + +

    TIFFTAG_YCBCRCOEFFICIENTS

    + + +

    1

    +
    + + +

    float*

    + + +

    † 3-entry array

    + + +

    TIFFTAG_YCBCRPOSITIONING

    + + +

    1

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_YCBCRSAMPLING

    + + +

    2

    +
    + + +

    uint16

    + + +

    + + +

    TIFFTAG_YPOSITION

    + + +

    1

    +
    + + +

    float

    +
    + + +

    TIFFTAG_YRESOLUTION

    + + +

    1

    +
    + + +

    float

    +
    + +

    † Tag may not have its +values changed once data is written.
    +‡ If SamplesPerPixel is one, then a single +array is passed; otherwise three arrays should be passed. +
    +* The contents of this field are quite complex. See The +ICC Profile Format Specification, Annex B.3 +"Embedding ICC Profiles in TIFF Files" (available +at http://www.color.org) for an explanation.

    + +

    RETURN VALUES + +

    + + +

    1 is returned +if the operation was successful. Otherwise, 0 is returned if +an error was detected.

    + +

    DIAGNOSTICS + +

    + + +

    All error +messages are directed to the TIFFError(3TIFF) +routine.

    + +

    %s: Cannot +modify tag "%s" while writing. Data has +already been written to the file, so the specified +tag’s value can not be changed. This restriction is +applied to all tags that affect the format of written +data.

    + +

    %d: Bad +value for "%s". An invalid value was supplied +for the named tag.

    + +

    SEE ALSO + +

    + + + +

    TIFFOpen(3TIFF), +TIFFGetField(3TIFF), TIFFSetDirectory(3TIFF), +TIFFWriteDirectory(3TIFF), +TIFFReadDirectory(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library +home page: http://www.remotesensing.org/libtiff/

    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWarning.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWarning.3tiff.html new file mode 100644 index 0000000..18f2e8b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWarning.3tiff.html @@ -0,0 +1,108 @@ + + + + + + +TIFFWarning + + + +

    TIFFWarning

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWarning, TIFFSetWarningHandler − library +warning interface

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    void TIFFWarning(const char *module, +const char *fmt, ...)

    + +

    #include <stdarg.h>

    + +

    typedef void (*TIFFWarningHandler)(const char +*module, const char *fmt, +va_list ap);

    + +

    TIFFWarningHandler +TIFFSetWarningHandler(TIFFWarningHandler +handler);

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFWarning invokes the library-wide warning +handler function to (normally) write a warning message to +the stderr. The fmt parameter is a +printf(3S) format string, and any number arguments +can be supplied. The module parameter is interpreted +as a string that, if non-zero, should be printed before the +message; it typically is used to identify the software +module in which a warning is detected.

    + +

    Applications that desire to capture control in the event +of a warning should use TIFFSetWarningHandler to +override the default warning handler. A NULL +(0) warning handler function may be installed to suppress +error messages.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFSetWarningHandler returns a reference to the +previous error handling function.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFError(3TIFF), libtiff(3TIFF), +printf(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteDirectory.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteDirectory.3tiff.html new file mode 100644 index 0000000..1e72a5b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteDirectory.3tiff.html @@ -0,0 +1,176 @@ + + + + + + +TIFFWriteDirectory + + + +

    TIFFWriteDirectory

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWriteDirectory, TIFFRewriteDirectory, +TIFFCheckpointDirectory − write the current directory +in an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFWriteDirectory(TIFF *tif)
    +int TIFFRewriteDirectory(TIFF *
    tif)
    +int TIFFCheckpointDirectory(TIFF *
    tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFWriteDirectory will write the contents of the +current directory to the file and setup to create a new +subfile in the same file. Applications only need to call +TIFFWriteDirectory when writing multiple subfiles to +a single TIFF file. TIFFWriteDirectory +is automatically called by TIFFClose and +TIFFFlush to write a modified directory if the file +is open for writing.

    + +

    The TIFFRewriteDirectory function operates +similarly to TIFFWriteDirectory, but can be called +with directories previously read or written that already +have an established location in the file. It will rewrite +the directory, but instead of place it at it’s old +location (as TIFFWriteDirectory would) it will place +them at the end of the file, correcting the pointer from the +preceeding directory or file header to point to it’s +new location. This is particularly important in cases where +the size of the directory and pointed to data has grown, so +it won’t fit in the space available at the old +location.

    + +

    The TIFFCheckpointDirectory writes the current +state of the tiff directory into the file to make what is +currently in the file readable. Unlike +TIFFWriteDirectory, TIFFCheckpointDirectory does not +free up the directory data structures in memory, so they can +be updated (as strips/tiles are written) and written again. +Reading such a partial file you will at worst get a tiff +read error for the first strip/tile encountered that is +incomplete, but you will at least get all the valid data in +the file before that. When the file is complete, just use +TIFFWriteDirectory as usual to finish it off +cleanly.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    1 is returned when the contents are successfully written +to the file. Otherwise, 0 is returned if an error was +encountered when writing the directory contents.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    Error post-encoding before directory write. Before +writing the contents of the current directory, any pending +data are flushed. This message indicates that an error +occurred while doing this.

    + +

    Error flushing data before directory write. Before +writing the contents of the current directory, any pending +data are flushed. This message indicates that an error +occurred while doing this.

    + +

    Cannot write directory, out of space. There was +not enough space to allocate a temporary area for the +directory that was to be written.

    + +

    Error writing directory count. A write error +occurred when writing the count of fields in the +directory.

    + +

    Error writing directory contents. A write error +occurred when writing the directory fields.

    + +

    Error writing directory link. A write error +occurred when writing the link to the next directory.

    + +

    Error writing data for field "%s". A +write error occurred when writing indirect data for the +specified field.

    + +

    Error writing TIFF header. A write error occurred +when re-writing header at the front of the file.

    + +

    Error fetching directory count. A read error +occurred when fetching the directory count field for a +previous directory. This can occur when setting up a link to +the directory that is being written.

    + +

    Error fetching directory link. A read error +occurred when fetching the directory link field for a +previous directory. This can occur when setting up a link to +the directory that is being written.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFError(3TIFF), +TIFFReadDirectory(3TIFF), +TIFFSetDirectory(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedStrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedStrip.3tiff.html new file mode 100644 index 0000000..3b90199 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedStrip.3tiff.html @@ -0,0 +1,153 @@ + + + + + + +TIFFWriteEncodedStrip + + + +

    TIFFWriteEncodedStrip

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWritedEncodedStrip − compress and write a +strip of data to an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFWriteEncodedStrip(TIFF +*tif, tstrip_t strip, +tdata_t buf, tsize_t +size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Compress size bytes of raw data from +buf and write the result to the specified strip; +replacing any previously written data. Note that the value +of strip is a ‘‘raw strip +number.’’ That is, the caller must take into +account whether or not the data are organized in separate +planes (PlanarConfiguration=2).

    +
    + +

    NOTES

    + + + + + +
    +

    The library writes encoded data using the native +machine byte order. Correctly implemented TIFF +readers are expected to do any necessary byte-swapping +to correctly process image data with BitsPerSample greater +than 8.

    + +

    The strip number must be valid according to the +current settings of the ImageLength and +RowsPerStrip tags. An image may be dynamically grown +by increasing the value of ImageLength prior to each +call to TIFFWriteEncodedStrip.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    −1 is returned if an error was encountered. +Otherwise, the value of size is returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: File not open for writing. The file was +opened for reading, not writing.

    + +

    Can not write scanlines to a tiled image. The +image is assumed to be organized in tiles because the +TileWidth and TileLength tags have been set +with TIFFSetField(3TIFF).

    + +

    %s: Must set "ImageWidth" before +writing data. The image’s width has not be set +before the first write. See TIFFSetField(3TIFF) for +information on how to do this.

    + +

    %s: Must set "PlanarConfiguration" +before writing data. The organization of data has not be +defined before the first write. See +TIFFSetField(3TIFF) for information on how to do +this.

    + +

    %s: No space for strip arrays". There +was not enough space for the arrays that hold strip offsets +and byte counts.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteScanline(3TIFF), +TIFFWriteRawStrip(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedTile.3tiff.html new file mode 100644 index 0000000..5e85f6d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteEncodedTile.3tiff.html @@ -0,0 +1,147 @@ + + + + + + +TIFFWriteEncodedTile + + + +

    TIFFWriteEncodedTile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWritedEncodedTile − compress and write a +tile of data to an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFWriteEncodedTile(TIFF +*tif, ttile_t tile, tdata_t +buf, tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Compress size bytes of raw data from +buf and append the result to the end of the +specified tile. Note that the value of tile is a +‘‘raw tile number.’’ That is, the +caller must take into account whether or not the data are +organized in separate places (PlanarConfiguration=2). +TIFFComputeTile automatically does this when +converting an (x,y,z,sample) coordinate quadruple to a tile +number.

    +
    + +

    NOTES

    + + + + + +
    +

    The library writes encoded data using the native +machine byte order. Correctly implemented TIFF +readers are expected to do any necessary byte-swapping +to correctly process image data with BitsPerSample greater +than 8.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    −1 is returned if an error was encountered. +Otherwise, the value of size is returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: File not open for writing. The file was +opened for reading, not writing.

    + +

    Can not write tiles to a stripped image. The +image is assumed to be organized in strips because neither +of the TileWidth or TileLength tags have been +set with TIFFSetField(3TIFF).

    + +

    %s: Must set "ImageWidth" before +writing data. The image’s width has not be set +before the first write. See TIFFSetField(3TIFF) for +information on how to do this.

    + +

    %s: Must set "PlanarConfiguration" +before writing data. The organization of data has not be +defined before the first write. See +TIFFSetField(3TIFF) for information on how to do +this.

    + +

    %s: No space for tile arrays". There was +not enough space for the arrays that hold tile offsets and +byte counts.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFWriteTile(3TIFF), +TIFFWriteRawTile(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawStrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawStrip.3tiff.html new file mode 100644 index 0000000..9a3ef0c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawStrip.3tiff.html @@ -0,0 +1,144 @@ + + + + + + +TIFFWriteRawstrip + + + +

    TIFFWriteRawstrip

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWriteRawStrip − write a strip of raw data to an +open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFWriteRawStrip(TIFF *tif, +tstrip_t strip, tdata_t buf, +tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Append size bytes of raw data to the specified +strip.

    +
    + +

    NOTES

    + + + + + +
    +

    The strip number must be valid according to the current +settings of the ImageLength and RowsPerStrip +tags. An image may be dynamically grown by increasing the +value of ImageLength prior to each call to +TIFFWriteRawStrip.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    −1 is returned if an error occurred. Otherwise, the +value of size is returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: File not open for writing. The file was opened +for reading, not writing.

    + +

    Can not write scanlines to a tiled image. The +image is assumed to be organized in tiles because the +TileWidth and TileLength tags have been set +with TIFFSetField(3TIFF).

    + +

    %s: Must set "ImageWidth" before writing +data. The image’s width has not be set before the +first write. See TIFFSetField(3TIFF) for information +on how to do this.

    + +

    %s: Must set "PlanarConfiguration" before +writing data. The organization of data has not be +defined before the first write. See +TIFFSetField(3TIFF) for information on how to do +this.

    + +

    %s: No space for strip arrays". There was not +enough space for the arrays that hold strip offsets and byte +counts.

    + +

    %s: Strip %d out of range, max %d. The specified +strip is not a valid strip according to the currently +specified image dimensions.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteEncodedStrip(3TIFF), +TIFFWriteScanline(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawTile.3tiff.html new file mode 100644 index 0000000..639af6c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteRawTile.3tiff.html @@ -0,0 +1,128 @@ + + + + + + +TIFFWriteRawtile + + + +

    TIFFWriteRawtile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWriteRawTile − write a tile of raw data to an +open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFWriteRawTile(TIFF *tif, +ttile_t tile, tdata_t buf, +tsize_t size)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Append size bytes of raw data to the specified +tile.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    −1 is returned if an error occurred. Otherwise, the +value of size is returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: File not open for writing. The file was opened +for reading, not writing.

    + +

    Can not write tiles to a stripped image. The image +is assumed to be organized in strips because neither of the +TileWidth or TileLength tags have been set +with TIFFSetField(3TIFF).

    + +

    %s: Must set "ImageWidth" before writing +data. The image’s width has not be set before the +first write. See TIFFSetField(3TIFF) for information +on how to do this.

    + +

    %s: Must set "PlanarConfiguration" before +writing data. The organization of data has not be +defined before the first write. See +TIFFSetField(3TIFF) for information on how to do +this.

    + +

    %s: No space for tile arrays". There was not +enough space for the arrays that hold tile offsets and byte +counts.

    + +

    %s: Specified tile %d out of range, max %d. The +specified tile is not valid according to the currently +specified image dimensions.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteEncodedTile(3TIFF), +TIFFWriteScanline(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteScanline.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteScanline.3tiff.html new file mode 100644 index 0000000..4c68f9d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteScanline.3tiff.html @@ -0,0 +1,206 @@ + + + + + + +TIFFWriteScanline + + + +

    TIFFWriteScanline

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +NOTES
    +RETURN VALUES
    +DIAGNOSTICS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWriteScanline − write a scanline to an open +TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFWriteScanline(TIFF *tif, +tdata_t buf, uint32 row, +tsample_t sample)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Write data to a file at the specified row. The +sample parameter is used only if data are organized +in separate planes (PlanarConfiguration=2). The data +are assumed to be uncompressed and in the native bit- and +byte-order of the host machine. The data written to the file +is compressed according to the compression scheme of the +current TIFF directory (see further below). +If the current scanline is past the end of the current +subfile, the ImageLength field is automatically +increased to include the scanline (except for +PlanarConfiguration=2, where the ImageLength +cannot be changed once the first data are written). If the +ImageLength is increased, the StripOffsets and +StripByteCounts fields are similarly enlarged to +reflect data written past the previous end of image.

    +
    + +

    NOTES

    + + + + + +
    +

    The library writes encoded data using the native machine +byte order. Correctly implemented TIFF +readers are expected to do any necessary byte-swapping to +correctly process image data with BitsPerSample greater than +8. The library attempts to hide bit-ordering differences +between the image and the native machine by converting data +from the native machine order.

    + +

    In C++ the sample parameter defaults to 0.

    + +

    Once data are written to a file for the current +directory, the values of certain tags may not be altered; +see TIFFSetField(3TIFF) for more information.

    + +

    It is not possible to write scanlines to a file that uses +a tiled organization. The routine TIFFIsTiled can be +used to determine if the file is organized as tiles or +strips.

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFWriteScanline returns −1 if it +immediately detects an error and 1 for a successful +write.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    + +

    %s: File not open for writing . The file was +opened for reading, not writing.

    + +

    Can not write scanlines to a tiled image. An +attempt was made to write a scanline to a tiled image. The +image is assumed to be organized in tiles because the +TileWidth and TileLength tags have been set +with TIFFSetField(3TIFF).

    + +

    Compression algorithm does not support random +access. Data was written in a non-sequential order to a +file that uses a compression algorithm and that has +RowsPerStrip greater than one. That is, data in the +image is to be stored in a compressed form, and with +multiple rows packed into a strip. In this case, the library +does not support random access to the data. The data should +either be written as entire strips, sequentially by rows, or +the value of RowsPerStrip should be set to one.

    + +

    %s: Must set "ImageWidth" before writing +data. The image’s width has not be set before the +first write. See TIFFSetField(3TIFF) for information +on how to do this.

    + +

    %s: Must set "PlanarConfiguration" before +writing data. The organization of data has not be +defined before the first write. See +TIFFSetField(3TIFF) for information on how to do +this.

    + +

    Can not change "ImageLength" when using +separate planes. Separate image planes are being used +(PlanarConfiguration=2), but the number of rows has +not been specified before the first write. The library +supports the dynamic growth of an image only when data are +organized in a contiguous manner +(PlanarConfiguration=1).

    + +

    %d: Sample out of range, max %d. The sample +parameter was greater than the value of the SamplesPerPixel +tag.

    + +

    %s: No space for strip arrays . There was not +enough space for the arrays that hold strip offsets and byte +counts.

    +
    + +

    BUGS

    + + + + + +
    +

    Writing subsampled YCbCR data does not work correctly +because, for PlanarConfiguration=2 the size of a +scanline is not calculated on a per-sample basis, and for +PlanarConfiguration=1 the library does not pack the +block-interleaved samples.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), +TIFFWriteEncodedStrip(3TIFF), +TIFFWriteRawStrip(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteTile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteTile.3tiff.html new file mode 100644 index 0000000..6f6ffd2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFWriteTile.3tiff.html @@ -0,0 +1,115 @@ + + + + + + +TIFFWriteTile + + + +

    TIFFWriteTile

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +RETURN VALUES
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFWriteTile − encode and write a tile of data to +an open TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFWriteTile(TIFF *tif, +tdata_t buf, uint32 x, +uint32 y, uint32 z, +tsample_t sample)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Write the data for the tile containing the +specified coordinates. The data in buf are is +(potentially) compressed, and written to the indicated file, +normally being appended to the end of the file. The buffer +must be contain an entire tile of data. Applications should +call the routine TIFFTileSize to find out the size +(in bytes) of a tile buffer. The x and y +parameters are always used by TIFFWriteTile. The +z parameter is used if the image is deeper than 1 +slice (ImageDepth>1). The sample parameter +is used only if data are organized in separate planes +(PlanarConfiguration=2).

    +
    + +

    RETURN VALUES

    + + + + + +
    +

    TIFFWriteTile returns −1 if it detects an +error; otherwise the number of bytes in the tile is +returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    All error messages are directed to the +TIFFError(3TIFF) routine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFCheckTile(3TIFF), +TIFFComputeTile(3TIFF), TIFFOpen(3TIFF), +TIFFReadTile(3TIFF), TIFFWriteScanline(3TIFF), +TIFFWriteEncodedTile(3TIFF), +TIFFWriteRawTile(3TIFF), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFbuffer.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFbuffer.3tiff.html new file mode 100644 index 0000000..09009b5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFbuffer.3tiff.html @@ -0,0 +1,116 @@ + + + + + + +TIFFBUFFER + + + +

    TIFFBUFFER

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFReadBufferSetup, TIFFWriteBufferSetup − I/O +buffering control routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +
    #include <tiffio.h>
    +
    +int TIFFReadBufferSetup(TIFF *tif, tdata_t buffer, tsize_t size);
    +int TIFFWriteBufferSetup(TIFF *tif, tdata_t buffer, tsize_t size);
    +
    +
    + +

    DESCRIPTION

    + + + + + + +
    +

    The following routines are provided for client-control of +the I/O buffers used by the library. Applications need never +use these routines; they are provided only for +‘‘intelligent clients’’ that wish to +optimize memory usage and/or eliminate potential copy +operations that can occur when working with images that have +data stored without compression.

    + +

    TIFFReadBufferSetup sets up the data buffer used +to read raw (encoded) data from a file. If the specified +pointer is NULL (zero), then a buffer of the +appropriate size is allocated. Otherwise the caller must +guarantee that the buffer is large enough to hold any +individual strip of raw data. TIFFReadBufferSetup +returns a non-zero value if the setup was successful and +zero otherwise.

    + +

    TIFFWriteBufferSetup sets up the data buffer used +to write raw (encoded) data to a file. If the specified +size is −1 then the buffer size is selected to +hold a complete tile or strip, or at least 8 kilobytes, +whichever is greater. If the specified buffer is +NULL (zero), then a buffer of the appropriate +size is dynamically allocated. TIFFWriteBufferSetup +returns a non-zero value if the setup was successful and +zero otherwise.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    %s: No space for data buffer at scanline %ld. +TIFFReadBufferSetup was unable to dynamically +allocate space for a data buffer.

    + +

    %s: No space for output buffer. +TIFFWriteBufferSetup was unable to dynamically +allocate space for a data buffer.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcodec.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcodec.3tiff.html new file mode 100644 index 0000000..d200754 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcodec.3tiff.html @@ -0,0 +1,116 @@ + + + + + + +CODEC + + + +

    CODEC

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFFindCODEC, TIFFRegisterCODEC, TIFFUnRegisterCODEC, +TIFFIsCODECConfigured − codec-related utility +routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    const TIFFCodec* TIFFFindCODEC(uint16 +scheme);
    +TIFFCodec* TIFFRegisterCODEC(uint16
    scheme, +const char *method, TIFFInitMethod +init);
    +void TIFFUnRegisterCODEC(TIFFCodec +*
    codec);
    +int TIFFIsCODECConfigured(uint16
    +scheme);

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    libtiff supports a variety of compression schemes +implemented by software codecs. Each codec adheres to +a modular interface that provides for the decoding and +encoding of image data; as well as some other methods for +initialization, setup, cleanup, and the control of default +strip and tile sizes. Codecs are identified by the +associated value of the TIFF +Compression tag; e.g. 5 for LZW +compression.

    + +

    The TIFFRegisterCODEC routine can be used to +augment or override the set of codecs available to an +application. If the specified scheme already has a +registered codec then it is overridden and any images +with data encoded with this compression scheme will be +decoded using the supplied coded.

    + +

    TIFFIsCODECConfigured returns 1 if the codec is +configured and working. Otherwise 0 will be returned.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    No space to register compression scheme %s. +TIFFRegisterCODEC was unable to allocate memory for +the data structures needed to register a codec.

    + +

    Cannot remove compression scheme %s; not +registered. TIFFUnRegisterCODEC did not locate +the specified codec in the table of registered compression +schemes.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcolor.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcolor.3tiff.html new file mode 100644 index 0000000..edf423b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFcolor.3tiff.html @@ -0,0 +1,975 @@ + + + + + + +COLOR + + + +

    COLOR

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFYCbCrToRGBInit, TIFFYCbCrtoRGB, TIFFCIELabToRGBInit, +TIFFCIELabToXYZ, TIFFXYZToRGB − color conversion +routines.

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB +*ycbcr, float *luma, float +*refBlackWhite");"
    +void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *
    ycbcr, +uint32 Y, int32 Cb, int32 +Cr, uint32 *R, uint32 +*G, uint32 *B );

    + +

    int TIFFCIELabToRGBInit(TIFFCIELabToRGB +*cielab, TIFFDisplay *display, +float *refWhite);
    +void TIFFCIELabToXYZ(TIFFCIELabToRGB *
    cielab, +uint32 L, int32 a, int32 +b, float *X, float *Y, +float *Z);
    +void TIFFXYZToRGB(TIFFCIELabToRGB *
    cielab, +float X, float Y, float +Z",uint32*"R, +uint32 *G, uint32 *B);

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFF supports several color spaces for images stored in +that format. There is usually a problem of application to +handle the data properly and convert between different +colorspaces for displaying and printing purposes. To +simplify this task libtiff implements several color +conversion routines itself. In particular, these routines +used in TIFFRGBAImage(3TIFF) interface.

    + +

    TIFFYCbCrToRGBInit() used to initialize +YCbCr to RGB conversion state. Allocating and +freeing of the ycbcr structure belongs to programmer. +TIFFYCbCrToRGB defined in tiffio.h as

    +
    + + + + + +
    +
    typedef struct {                /* YCbCr->RGB support */
    +        TIFFRGBValue* clamptab; /* range clamping table */
    +
    +
    + + + + + +

    int*

    + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Cr_r_tab;
    +int*

    +
    +
    + +

    Cb_b_tab;
    +int32*

    +
    +
    + +

    Cr_g_tab;
    +int32*

    +
    +
    + +

    Cb_g_tab;

    +
    +
    + + + + + +
    +

    int32* Y_tab;
    +} TIFFYCbCrToRGB;

    + + + + + +
    +

    luma is a float array of three values representing +proportions of the red, green and blue in luminance, Y (see +section 21 of the TIFF 6.0 specification, where the YCbCr +images discussed). TIFFTAG_YCBCRCOEFFICIENTS holds +that values in TIFF file. refBlackWhite is a float +array of 6 values which specifies a pair of headroom and +footroom image data values (codes) for each image component +(see section 20 of the TIFF 6.0 specification where the +colorinmetry fields discussed). +TIFFTAG_REFERENCEBLACKWHITE is responsible for +storing these values in TIFF file. Following code snippet +should helps to understand the the technique:

    +
    + + + + + +
    +
    float *luma, *refBlackWhite;
    +uint16 hs, vs;
    +
    +/* Initialize structures */
    +ycbcr = (TIFFYCbCrToRGB*)
    +
    +
    + + + + + + + + + + + + + + + +
    + +

    _TIFFmalloc(TIFFroundup(sizeof(TIFFYCbCrToRGB), +sizeof(long))

    +
    + +

    + 4*256*sizeof(TIFFRGBValue)

    +
    + +

    + 2*256*sizeof(int)

    +
    + +

    + 3*256*sizeof(int32));

    +
    + + + + + +
    +

    if (ycbcr == NULL) {
    +TIFFError("YCbCr->RGB",

    + + + + + + + +
    + + +

    "No space for YCbCr->RGB conversion +state");

    +
    +
    + + + + + +
    +

    exit(0);
    +}

    + +

    TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRCOEFFICIENTS, +&luma);
    +TIFFGetFieldDefaulted(tif, TIFFTAG_REFERENCEBLACKWHITE, +&refBlackWhite);
    +if (TIFFYCbCrToRGBInit(ycbcr, luma, refBlackWhite) < +0)

    + + + + + +
    + +

    exit(0);

    +
    + + + + + +
    +

    /* Start conversion */
    +uint32 r, g, b;
    +uint32 Y;
    +int32 Cb, Cr;

    + +

    for each pixel in image

    + + + + + +
    + +

    TIFFYCbCrtoRGB(img->ycbcr, Y, Cb, Cr, &r, &g, +&b);

    +
    + + + + + +
    +

    /* Free state structure */
    +_TIFFfree(ycbcr);

    + + + + + +
    +

    TIFFCIELabToRGBInit() initializes the CIE +L*a*b* 1976 to RGB conversion state. +TIFFCIELabToRGB defined as

    +
    + + + + + +
    +
    #define CIELABTORGB_TABLE_RANGE 1500
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    typedef struct {

    +
    + + +

    /* CIE Lab 1976->RGB support */

    +
    +
    + + +

    int

    +
    + +

    range;

    +
    + + +

    /* Size of conversion table */

    +
    +
    + + +

    float

    +
    + +

    rstep, gstep, bstep;

    +
    +
    + + +

    float

    +
    + +

    X0, Y0, Z0;

    +
    + +

    /* Reference white point */

    +
    +
    + +

    TIFFDisplay display;

    +
    +
    + + +

    float

    +
    + +

    Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr +to r */

    +
    +
    + + +

    float

    +
    + +

    Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg +to g */

    +
    +
    + + +

    float

    +
    + +

    Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb +to b */

    +
    +
    + + + + + +
    +

    } TIFFCIELabToRGB;

    + + + + + +
    +

    display is a display device description, declared +as

    +
    + + + + + +
    +
    typedef struct {
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    float d_mat[3][3]; /* XYZ -> luminance matrix */

    +
    + +

    float d_YCR; /* Light o/p for reference white */

    +
    + +

    float d_YCG;

    +
    + +

    float d_YCB;

    +
    + +

    uint32 d_Vrwr; /* Pixel values for ref. white */

    +
    + +

    uint32 d_Vrwg;

    +
    + +

    uint32 d_Vrwb;

    +
    + +

    float d_Y0R; /* Residual light for black pixel */

    +
    + +

    float d_Y0G;

    +
    + +

    float d_Y0B;

    +
    + +

    float d_gammaR; /* Gamma values for the three guns +*/

    +
    + +

    float d_gammaG;

    +
    + +

    float d_gammaB;

    +
    + + + + + +
    +

    } TIFFDisplay;

    + + + + + +
    +

    For example, the one can use sRGB device, which has the +following parameters:

    +
    + + + + + +
    +
    TIFFDisplay display_sRGB = {
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    { /* XYZ -> luminance matrix */

    +
    +
    + + +

    { 3.2410F, -1.5374F, -0.4986F },

    +
    +
    + + +

    { -0.9692F, 1.8760F, 0.0416F },

    +
    +
    + + +

    { 0.0556F, -0.2040F, 1.0570F }

    +
    +
    + +

    },

    +
    + +
    + +

    100.0F, 100.0F, 100.0F, /* Light o/p for reference white +*/

    +
    +
    + +

    255, 255, 255, /* Pixel values for ref. white */

    +
    +
    + +

    1.0F, 1.0F, 1.0F, /* Residual light o/p for black pixel +*/

    +
    +
    + +

    2.4F, 2.4F, 2.4F, /* Gamma values for the three guns +*/

    +
    +
    + + + + + +
    +

    };

    + + + + + +
    +

    refWhite is a color temperature of the reference +white. The TIFFTAG_WHITEPOINT contains the +chromaticity of the white point of the image from where the +reference white can be calculated using following +formulae:

    +
    + + + + + +
    +

    refWhite_Y = 100.0
    +refWhite_X = whitePoint_x / whitePoint_y * refWhite_Y
    +refWhite_Z = (1.0 - whitePoint_x - whitePoint_y) / +whitePoint_y * refWhite_X

    + + + + + +
    +

    The conversion itself performed in two steps: at the +first one we will convert CIE L*a*b* 1976 to CIE +XYZ using TIFFCIELabToXYZ() routine, and at the +second step we will convert CIE XYZ to RGB +using TIFFXYZToRGB(). Look at the code sample +below:

    +
    + + + + + +
    +
    float   *whitePoint;
    +float   refWhite[3];
    +
    +/* Initialize structures */
    +img->cielab = (TIFFCIELabToRGB *)
    +
    +
    + + + + + + +
    + +

    _TIFFmalloc(sizeof(TIFFCIELabToRGB));

    +
    + + + + + +
    +

    if (!cielab) {

    + + + + + + + + + + + + + + + + + + + + +
    + +

    TIFFError("CIE L*a*b*->RGB",

    +
    +
    + + +

    "No space for CIE L*a*b*->RGB conversion +state.");

    +
    +
    + +

    exit(0);

    +
    +
    + + + + + +
    +

    }

    + +

    TIFFGetFieldDefaulted(tif, TIFFTAG_WHITEPOINT, +&whitePoint);
    +refWhite[1] = 100.0F;
    +refWhite[0] = whitePoint[0] / whitePoint[1] * +refWhite[1];
    +refWhite[2] = (1.0F - whitePoint[0] - +whitePoint[1])

    + + + + + +
    + +

    / whitePoint[1] * refWhite[1];

    +
    + + + + + +
    +

    if (TIFFCIELabToRGBInit(cielab, &display_sRGB, +refWhite) < 0) {

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    TIFFError("CIE L*a*b*->RGB",

    +
    +
    + + +

    "Failed to initialize CIE L*a*b*->RGB conversion +state.");

    +
    +
    + +

    _TIFFfree(cielab);

    +
    +
    + +

    exit(0);

    +
    +
    + + + + + +
    +

    }

    + +

    /* Now we can start to convert */
    +uint32 r, g, b;
    +uint32 L;
    +int32 a, b;
    +float X, Y, Z;

    + +

    for each pixel in image

    + + + + + + + + +
    + +

    TIFFCIELabToXYZ(cielab, L, a, b, &X, &Y, +&Z);

    +
    + +

    TIFFXYZToRGB(cielab, X, Y, Z, &r, &g, +&b);

    +
    + + + + + +
    +

    /* Don’t forget to free the state structure */
    +_TIFFfree(cielab);

    + +

    SEE ALSO

    + + + + + +
    +

    TIFFRGBAImage(3TIFF) libtiff(3TIFF),

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFmemory.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFmemory.3tiff.html new file mode 100644 index 0000000..c3f38e0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFmemory.3tiff.html @@ -0,0 +1,110 @@ + + + + + + +MEMORY + + + +

    MEMORY

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    _TIFFmalloc, _TIFFrealloc, _TIFFfree, _TIFFmemset, +_TIFFmemcpy, _TIFFmemcmp, − memory management-related +functions for use with TIFF files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tdata_t _TIFFmalloc(tsize_t size);
    +tdata_t _TIFFrealloc(tdata_t
    buffer, +tsize_t size);
    +void _TIFFfree(tdata_t
    buffer);
    +void _TIFFmemset(tdata_t
    s, int +c, tsize_t n);
    +void _TIFFmemcpy(tdata_t
    dest, const +tdata_t src, tsize_t n);
    +int _TIFFmemcmp(const tdata_t
    s1, const +tdata_t s2, tsize_t n);

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    These routines are provided for writing portable software +that uses libtiff; they hide any memory-management +related issues, such as dealing with segmented architectures +found on 16-bit machines.

    + +

    _TIFFmalloc and _TIFFrealloc are used to +dynamically allocate and reallocate memory used by +libtiff; such as memory passed into the I/O routines. +Memory allocated through these interfaces is released back +to the system using the _TIFFfree routine.

    + +

    Memory allocated through one of the above interfaces can +be set to a known value using _TIFFmemset, copied to +another memory location using _TIFFmemcpy, or +compared for equality using _TIFFmemcmp. These +routines conform to the equivalent ANSI C +routines: memset, memcpy, and memcmp, +repsectively.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    malloc(3), memory(3), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFquery.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFquery.3tiff.html new file mode 100644 index 0000000..2b47fc3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFquery.3tiff.html @@ -0,0 +1,148 @@ + + + + + + +QUERY + + + +

    QUERY

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFCurrentRow, TIFFCurrentStrip, TIFFCurrentTile, +TIFFCurrentDirectory, TIFFLastDirectory, TIFFFileno, +TIFFFileName, TIFFGetMode, TIFFIsTiled, TIFFIsByteSwapped, +TIFFIsUpSampled, TIFFIsMSB2LSB, TIFFGetVersion − query +routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    uint32 TIFFCurrentRow(TIFF* tif)
    +tstrip_t TIFFCurrentStrip(TIFF*
    tif)
    +ttile_t TIFFCurrentTile(TIFF*
    tif)
    +tdir_t TIFFCurrentDirectory(TIFF*
    tif)
    +int TIFFLastDirectory(TIFF*
    tif)
    +int TIFFFileno(TIFF*
    tif)
    +char* TIFFFileName(TIFF*
    tif)
    +int TIFFGetMode(TIFF*
    tif)
    +int TIFFIsTiled(TIFF*
    tif)
    +int TIFFIsByteSwapped(TIFF*
    tif)
    +int TIFFIsUpSampled(TIFF*
    tif)
    +int TIFFIsMSB2LSB(TIFF*
    tif)
    +const char* TIFFGetVersion(void)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    The following routines return status information about an +open TIFF file.

    + +

    TIFFCurrentDirectory returns the index of the +current directory (directories are numbered starting at 0). +This number is suitable for use with the +TIFFSetDirectory routine.

    + +

    TIFFLastDirectory returns a non-zero value if the +current directory is the last directory in the file; +otherwise zero is returned.

    + +

    TIFFCurrentRow, TIFFCurrentStrip, and +TIFFCurrentTile, return the current row, strip, and +tile, respectively, that is being read or written. These +values are updated each time a read or write is done.

    + +

    TIFFFileno returns the underlying file descriptor +used to access the TIFF image in the +filesystem.

    + +

    TIFFFileName returns the pathname argument passed +to TIFFOpen or TIFFFdOpen.

    + +

    TIFFGetMode returns the mode with which the +underlying file was opened. On UNIX systems, +this is the value passed to the open(2) system +call.

    + +

    TIFFIsTiled returns a non-zero value if the image +data has a tiled organization. Zero is returned if the image +data is organized in strips.

    + +

    TIFFIsByteSwapped returns a non-zero value if the +image data was in a different byte-order than the host +machine. Zero is returned if the TIFF file and local host +byte-orders are the same. Note that TIFFReadTile(), +TIFFReadStrip() and TIFFReadScanline() functions already +normally perform byte swapping to local host order if +needed.

    + +

    TIFFIsUpSampled returns a non-zero value if image +data returned through the read interface routines is being +up-sampled. This can be useful to applications that want to +calculate I/O buffer sizes to reflect this usage (though the +usual strip and tile size routines already do this).

    + +

    TIFFIsMSB2LSB returns a non-zero value if the +image data is being returned with bit 0 as the most +significant bit.

    + +

    TIFFGetVersion returns an ASCII +string that has a version stamp for the TIFF +library software.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF), TIFFOpen(3TIFF), +TIFFFdOpen(3TIFF)

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFsize.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFsize.3tiff.html new file mode 100644 index 0000000..5a14254 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFsize.3tiff.html @@ -0,0 +1,95 @@ + + + + + + +TIFFSIZE + + + +

    TIFFSIZE

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFScanlineSize, TIFFRasterScanlineSize, − return +the size of various items associated with an open +TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    tsize_t TIFFRasterScanlineSize(TIFF +*tif)
    +tsize_t TIFFScanlineSize(TIFF *
    tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFScanlineSize returns the size in bytes of a +row of data as it would be returned in a call to +TIFFReadScanline, or as it would be expected in a +call to TIFFWriteScanline.

    + +

    TIFFRasterScanlineSize returns the size in bytes +of a complete decoded and packed raster scanline. Note that +this value may be different from the value returned by +TIFFScanlineSize if data is stored as separate +planes.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFOpen(3TIFF), TIFFReadScanline(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFstrip.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFstrip.3tiff.html new file mode 100644 index 0000000..b8bc7c6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFstrip.3tiff.html @@ -0,0 +1,129 @@ + + + + + + +TIFFSTRIP + + + +

    TIFFSTRIP

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFDefaultStripSize, TIFFStripSize, TIFFVStripSize, +TIFFRawStripSize, TIFFComputeStrip, TIFFNumberOfStrips +− strip-related utility routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    uint32 TIFFDefaultStripSize(TIFF *tif, +uint32 estimate)
    +tsize_t TIFFStripSize(TIFF *
    tif)
    +tsize_t TIFFVStripSize(TIFF *
    tif, uint32 +nrows)
    +tsize_t TIFFRawStripSize(TIFF *
    tif, +tstrip_t strip)
    +tstrip_t TIFFComputeStrip(TIFF *
    tif, +uint32 row, tsample_t +sample)
    +tstrip_t TIFFNumberOfStrips(TIFF *
    tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFDefaultStripSize returns the number of rows +for a reasonable-sized strip according to the current +settings of the ImageWidth, BitsPerSample, +SamplesPerPixel, tags and any compression-specific +requirements. If the estimate parameter, if non-zero, +then it is taken as an estimate of the desired strip size +and adjusted according to any compression-specific +requirements. The value returned by this function is +typically used to define the RowsPerStrip tag. In +lieu of any unusual requirements TIFFDefaultStripSize +tries to create strips that have approximately 8 kilobytes +of uncompressed data.

    + +

    TIFFStripSize returns the equivalent size for a +strip of data as it would be returned in a call to +TIFFReadEncodedStrip or as it would be expected in a +call to TIFFWriteEncodedStrip.

    + +

    TIFFVStripSize returns the number of bytes in a +strip with nrows rows of data.

    + +

    TIFFRawStripSize returns the number of bytes in a +raw strip (i.e. not decoded).

    + +

    TIFFComputeStrip returns the strip that contains +the specified coordinates. A valid strip is always returned; +out-of-range coordinate values are clamped to the bounds of +the image. The row parameter is always used in +calculating a strip. The sample parameter is used +only if data are organized in separate planes +(PlanarConfiguration=2).

    + +

    TIFFNumberOfStrips returns the number of strips in +the image.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFReadEncodedStrip(3TIFF), +TIFFReadRawStrip(3TIFF), +TIFFWriteEncodedStrip(3TIFF), +TIFFWriteRawStrip(3TIFF), libtiff(3TIFF),

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFswab.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFswab.3tiff.html new file mode 100644 index 0000000..80d1db4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFswab.3tiff.html @@ -0,0 +1,110 @@ + + + + + + +SWAB + + + +

    SWAB

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFGetBitRevTable, TIFFReverseBits, TIFFSwabShort, +TIFFSwabLong, TIFFSwabArrayOfShort, TIFFSwabArrayOfLong +− byte- and bit-swapping routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    const unsigned char* TIFFGetBitRevTable(int +reversed)
    +void TIFFReverseBits(u_char *
    data, unsigned +long nbytes)
    +void TIFFSwabShort(uint16 *
    data)
    +void TIFFSwabLong(uint32 *
    data)
    +void TIFFSwabArrayOfShort(uint16 *
    data, +unsigned long nshorts)
    +void TIFFSwabArrayOfLong(uint32 *
    data, +unsigned long nlongs)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    The following routines are used by the library to swap +16- and 32-bit data and to reverse the order of bits in +bytes.

    + +

    TIFFSwabShort and TIFFSwabLong swap the +bytes in a single 16-bit and 32-bit item, respectively. +TIFFSwabArrayOfShort and TIFFSwabArrayOfLong +swap the bytes in an array of 16-bit and 32-bit items, +respectively.

    + +

    TIFFReverseBits replaces each byte in data +with the equivalent bit-reversed value. This operation is +performed with a lookup table, which is returned using the +TIFFGetBitRevTable function. reversed +parameter specifies which table should be returned. Supply +1 if you want bit reversal table. Supply 0 to +get the table that do not reverse bit values. It is a lookup +table that can be used as an identity function; i.e. +TIFFNoBitRevTable[n] == n.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFtile.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFtile.3tiff.html new file mode 100644 index 0000000..addeb51 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/TIFFtile.3tiff.html @@ -0,0 +1,141 @@ + + + + + + +TIFFTILE + + + +

    TIFFTILE

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DIAGNOSTICS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    TIFFTileSize, TIFFTileRowSize, TIFFVTileSize, +TIFFDefaultTileSize, TIFFComputeTile, TIFFCheckTile, +TIFFNumberOfTiles − tile-related utility routines

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    void TIFFDefaultTileSize(TIFF *tif, +uint32 *tw, uint32 *th)
    +tsize_t TIFFTileSize(TIFF *
    tif)
    +tsize_t TIFFTileRowSize(TIFF *
    tif)
    +tsize_t TIFFVTileSize(TIFF *
    tif, uint32 +nrows)
    +ttile_t TIFFComputeTile(TIFF *
    tif, uint32 +x, uint32 y, uint32 z, +tsample_t sample)
    +int TIFFCheckTile(TIFF *
    tif, uint32 +x, uint32 y, uint32 z, +tsample_t sample)
    +ttile_t TIFFNumberOfTiles(TIFF *
    tif)

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    TIFFDefaultTileSize returns the pixel width and +height of a reasonable-sized tile; suitable for setting up +the TileWidth and TileLength tags. If the +tw and th values passed in are non-zero, then +they are adjusted to reflect any compression-specific +requirements. The returned width and height are constrained +to be a multiple of 16 pixels to conform with the +TIFF specification.

    + +

    TIFFTileSize returns the equivalent size for a +tile of data as it would be returned in a call to +TIFFReadTile or as it would be expected in a call to +TIFFWriteTile.

    + +

    TIFFVTileSize returns the number of bytes in a +row-aligned tile with nrows of data.

    + +

    TIFFTileRowSize returns the number of bytes of a +row of data in a tile.

    + +

    TIFFComputeTile returns the tile that contains the +specified coordinates. A valid tile is always returned; +out-of-range coordinate values are clamped to the bounds of +the image. The x and y parameters are always +used in calculating a tile. The z parameter is used +if the image is deeper than 1 slice +(ImageDepth>1). The sample parameter is +used only if data are organized in separate planes +(PlanarConfiguration=2).

    + +

    TIFFCheckTile returns a non-zero value if the +supplied coordinates are within the bounds of the image and +zero otherwise. The x parameter is checked against +the value of the ImageWidth tag. The y +parameter is checked against the value of the +ImageLength tag. The z parameter is checked +against the value of the ImageDepth tag (if defined). +The sample parameter is checked against the value of +the SamplesPerPixel parameter if the data are +organized in separate planes.

    + +

    TIFFNumberOfTiles returns the number of tiles in +the image.

    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    None.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    TIFFReadEncodedTile(3TIFF), +TIFFReadRawTile(3TIFF), TIFFReadTile(3TIFF), +TIFFWriteEncodedTile(3TIFF), +TIFFWriteRawTile(3TIFF), TIFFWriteTile(3TIFF), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/bmp2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/bmp2tiff.1.html new file mode 100644 index 0000000..1104a49 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/bmp2tiff.1.html @@ -0,0 +1,121 @@ + + + + + + +BMP2TIFF + + + +

    BMP2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    bmp2tiff − create a TIFF file from a +Microsoft Windows Device Independent Bitmap image file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    bmp2tiff [ options ] input.bmp +output.tiff

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    bmp2tiff converts a Microsoft Windows Device +Independent Bitmap image file to TIFF. By +default, the TIFF image is created with data +samples packed (PlanarConfiguration=1), compressed +with the PackBits algorithm +(Compression=32773), and with each strip no +more than 8 kilobytes. These characteristics can overridden, +or explicitly specified with the options described +below.

    +
    + +

    OPTIONS

    + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, -c +packbits for the PackBits compression algorithm (the +default), -c jpeg for the baseline JPEG compression +algorithm, -c zip for the Deflate compression +algorithm, and −c lzw for Lempel-Ziv & +Welch.

    +
    +
    + + + + + +
    +

    −r <number>

    + + + + + +
    +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    gif2tiff(1), pal2rgb(1), +ppm2tiff(1), raw2tiff(1), ras2tiff(1), +sgi2tiff(1), libtiff(3TIFF)

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2ps.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2ps.1.html new file mode 100644 index 0000000..aba6fc3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2ps.1.html @@ -0,0 +1,252 @@ + + + + + + +FAX2PS + + + +

    FAX2PS

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +DIAGNOSTICS
    +NOTES
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    fax2ps − convert a TIFF facsimile to +compressed PostScript™

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    fax2ps [ options ] [ file ... ]

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    fax2ps reads one or more TIFF +facsimile image files and prints a compressed form of +PostScript on the standard output that is suitable for +printing.

    + +

    By default, each page is scaled to reflect the image +dimensions and resolutions stored in the file. The +−x and −y options can be used to +specify the horizontal and vertical image resolutions +(lines/inch), respectively. If the −S option is +specified, each page is scaled to fill an output page. The +default output page is 8.5 by 11 inches. Alternate page +dimensions can be specified in inches with the +−W and −H options.

    + +

    By default fax2ps generates PostScript for all +pages in the file. The −p option can be used to +select one or more pages from a multi-page document.

    + +

    fax2ps generates a compressed form of PostScript +that is optimized for sending pages of text to a PostScript +printer attached to a host through a low-speed link (such as +a serial line). Each output page is filled with white and +then only the black areas are drawn. The PostScript +specification of the black drawing operations is optimized +by using a special font that encodes the move-draw +operations required to fill the black regions on the page. +This compression scheme typically results in a substantially +reduced PostScript description, relative to the +straightforward imaging of the page with a PostScript +image operator. This algorithm can, however, be +ineffective for continuous-tone and white-on-black images. +For these images, it sometimes is more efficient to send the +raster bitmap image directly; see tiff2ps(1).

    +
    + +

    OPTIONS

    + + + + + + + +
    + +

    −p number

    +
    + +

    Print only the indicated page. Multiple pages may be +printed by specifying this option more than once.

    +
    +
    + + + + + +
    +

    −x resolution

    + + + + + +
    +

    Use resolution as the horizontal resolution, in +dots/inch, of the image data. By default this value is taken +from the file.

    +
    + + + + + +
    +

    −y resolution

    + + + + + +
    +

    Use resolution as the vertical resolution, in +lines/inch, of the image data. By default this value is +taken from the file.

    +
    + + + + + + + + + + + + + + + + + +
    + +

    −S

    +
    + +

    Scale each page of image data to fill the output page +dimensions. By default images are presented according to the +dimension information recorded in the TIFF +file.

    +
    +
    + +

    −W width

    +
    + +

    Use width as the width, in inches, of the output +page.

    +
    +
    + +

    −H height

    +
    + +

    Use height as the height, in inches, of the +output page.

    +
    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    Some messages about malformed TIFF images +come from the TIFF library.

    + +

    Various messages about badly formatted facsimile images +may be generated due to transmission errors in received +facsimile. fax2ps attempts to recover from such data +errors by resynchronizing decoding at the end of the current +scanline. This can result in long horizontal black lines in +the resultant PostScript image.

    +
    + +

    NOTES

    + + + + + +
    +

    If the destination printer supports PostScript Level II +then it is always faster to just send the encoded bitmap +generated by the tiff2ps(1) program.

    +
    + +

    BUGS

    + + + + + +
    +

    fax2ps should probably figure out when it is doing +a poor job of compressing the output and just generate +PostScript to image the bitmap raster instead.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiff2ps(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2tiff.1.html new file mode 100644 index 0000000..3aac8c7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/fax2tiff.1.html @@ -0,0 +1,607 @@ + + + + + + +FAX2TIFF + + + +

    FAX2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +DIAGNOSTICS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    fax2tiff − create a TIFF Class F fax +file from raw fax data

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    fax2tiff [ options ] [ −o +output.tif ] input.raw

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Fax2tiff creates a TIFF file +containing CCITT Group 3 or Group 4 encoded +data from one or more files containing +‘‘raw’’ Group 3 or Group 4 encoded +data (typically obtained directly from a fax modem). By +default, each row of data in the resultant +TIFF file is 1-dimensionally encoded and +padded or truncated to 1728 pixels, as needed. The resultant +image is a set of low resolution (98 lines/inch) or medium +resolution (196 lines/inch) pages, each of which is a single +strip of data. The generated file conforms to the +TIFF Class F ( FAX ) +specification for storing facsimile data. This means, in +particular, that each page of the data does not +include the trailing return to control ( +RTC ) code; as required for transmission by +the CCITT Group 3 specifications. The old, +‘‘classic’’, format is created if +the −c option is used. (The Class F format can +also be requested with the −f option.)

    + +

    The default name of the output image is fax.tif; +this can be changed with the −o option. Each +input file is assumed to be a separate page of facsimile +data from the same document. The order in which input files +are specified on the command line is the order in which the +resultant pages appear in the output file.

    +
    + +

    OPTIONS

    + + + + + +
    +

    Options that affect the interpretation of input data +are:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −3

    +
    + +

    Assume input data is CCITT Group 3 +encoded (default).

    +
    +
    + +

    −4

    +
    + +

    Assume input data is CCITT Group 4 +encoded.

    +
    +
    + +

    −U

    +
    + +

    Assume input data is uncompressed (Group 3 or Group +4).

    +
    +
    + +

    −1

    +
    + +

    Assume input data is encoded with the 1-dimensional +version of the CCITT Group 3 Huffman encoding +algorithm (default).

    +
    +
    + +

    −2

    +
    + +

    Assume input data is 2-dimensional version of the +CCITT Group 3 Huffman encoding algorithm.

    +
    +
    + +

    −P

    +
    + +

    Assume input data is not EOL-aligned (default). +This option has effect with Group 3 encoded input only.

    +
    +
    + +

    −A

    +
    + +

    Assume input data is EOL-aligned. This option has effect +with Group 3 encoded input only.

    +
    +
    + +

    −M

    +
    + +

    Treat input data as having bits filled from most +significant bit ( MSB ) to most least bit ( +LSB ).

    +
    +
    + +

    −L

    +
    + +

    Treat input data as having bits filled from least +significant bit ( LSB ) to most significant +bit ( MSB ) (default).

    +
    +
    + +

    −B

    +
    + +

    Assume input data was encoded with black as 0 and white +as 1.

    +
    +
    + +

    −W

    +
    + +

    Assume input data was encoded with black as 1 and white +as 0 (default).

    +
    +
    + +

    −R

    +
    + +

    Specify the vertical resolution, in lines/inch, of the +input images. By default input are assumed to have a +vertical resolution of 196 lines/inch. If images are low +resolution facsimile, a value of 98 lines/inch should be +specified.

    +
    +
    + +

    −X

    +
    + +

    Specify the width, in pixels, of the input images. By +default input are assumed to have a width of 1728 +pixels.

    +
    +
    + + + + + +
    +

    Options that affect the output file format are:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −o

    +
    + +

    Specify the name of the output file.

    +
    +
    + +

    −7

    +
    + +

    Force output to be compressed with the +CCITT Group 3 Huffman encoding algorithm +(default).

    +
    +
    + +

    −8

    +
    + +

    Force output to be compressed with the +CCITT Group 4 Huffman encoding.

    +
    +
    + +

    −u

    +
    + +

    Force output to be uncompressed (Group 3 or Group +4).

    +
    +
    + +

    −5

    +
    + +

    Force output to be encoded with the 1-dimensional +version of the CCITT Group 3 Huffman encoding +algorithm.

    +
    +
    + +

    −6

    +
    + +

    Force output to be encoded with the 2-dimensional +version of the CCITT Group 3 Huffman encoding +algorithm (default).

    +
    +
    + +

    −a

    +
    + +

    Force the last bit of each End Of Line ( +EOL ) code to land on a byte boundary +(default). This ‘‘zero padding’’ +will be reflected in the contents of the +Group3Options tag of the resultant +TIFF file. This option has effect with Group +3 encoded output only.

    +
    +
    + +

    −p

    +
    + +

    Do not EOL-align output. This option has effect with +Group 3 encoded output only.

    +
    +
    + +

    −c

    +
    + +

    Generate "classic" Group 3 TIFF format.

    +
    +
    + +

    −f

    +
    + +

    Generate TIFF Class F (TIFF/F) format (default).

    +
    +
    + +

    −m

    +
    + +

    Force output data to have bits filled from most +significant bit ( MSB ) to most least bit ( +LSB ).

    +
    +
    + +

    −l

    +
    + +

    Force output data to have bits filled from least +significant bit ( LSB ) to most significant +bit ( MSB ) (default).

    +
    +
    + +

    −r

    +
    + +

    Specify the number of rows (scanlines) in each strip of +data written to the output file. By default (or when value +0 is specified), tiffcp attempts to set the +rows/strip that no more than 8 kilobytes of data appear in a +strip (with except of G3/G4 compression schemes). If you +specify special value −1 it will results in +infinite number of the rows per strip. The entire image will +be the one strip in that case. This is default in case of +G3/G4 output compression schemes.

    +
    +
    + +

    −s

    +
    + +

    Stretch the input image vertically by writing each input +row of data twice to the output file.

    +
    +
    + +

    −v

    +
    + +

    Force fax2tiff to print the number of rows of +data it retrieved from the input file.

    +
    +
    + +

    −z

    +
    + +

    Force output to be compressed with the LZW encoding.

    +
    +
    + +

    DIAGNOSTICS

    + + + + + +
    +

    The following warnings and errors come from the decoding +routines in the library.

    + +

    Warning, %s: Premature EOL at scanline %d (x +%d).\n. The input data had a row that was shorter than +the expected width. The row is padded with white.

    + +

    %s: Premature EOF at scanline %d (x %d).\n. The +decoder ran out of data in the middle of a scanline. The +resultant row is padded with white.

    + +

    %s: Bad code word at row %d, x %d\n. An invalid +Group 3 code was encountered while decoding the input +file. The row number and horizontal position is given. The +remainder of the input row is discarded, while the +corresponding output row is padded with white.

    + +

    %s: Bad 2D code word at scanline %d.\n. An invalid +Group 4 or 2D Group 3 code was encountered while +decoding the input file. The row number and horizontal +position is given. The remainder of the input row is +discarded, while the corresponding output row is padded with +white.

    +
    + +

    BUGS

    + + + + + +
    +

    Input data are assumed to have a a ‘‘top +left’’ orientation; it should be possible to +override this assumption from the command line.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    CCITT Recommendation T.4 +(Standardization of Group 3 Facsimile Apparatus for Document +Transmission).

    + +

    The Spirit of TIFF Class F, an appendix to the +TIFF 5.0 specification prepared by Cygnet Technologies.

    + +

    tiffinfo(1), tiffdither(1), +tiffgt(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/gif2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/gif2tiff.1.html new file mode 100644 index 0000000..c507353 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/gif2tiff.1.html @@ -0,0 +1,141 @@ + + + + + + +GIF2TIFF + + + +

    GIF2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +NOTES
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    gif2tiff − create a TIFF file from a +GIF87 format image file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    gif2tiff [ options ] input.gif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Gif2tiff converts a file in the GIF87 format to +TIFF. The TIFF image is +created as a palette image, with samples compressed with the +Lempel-Ziv & Welch algorithm (Compression=5). +These characteristics can overridden, or explicitly +specified with the options described below.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm, +−c zip for the Deflate compression algorithm, +and −c lzw for Lempel-Ziv & Welch (the +default).

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    NOTES

    + + + + + +
    +

    The program is based on Paul Haeberli’s +fromgif program which, in turn, is based on Marcel +J.E. Mol’s GIF reader.

    +
    + +

    BUGS

    + + + + + +
    +

    Should have more options to control output format.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/index.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/index.html new file mode 100644 index 0000000..7e9e8d2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/index.html @@ -0,0 +1,64 @@ +Libtiff HTML manpage index diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/libtiff.3tiff.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/libtiff.3tiff.html new file mode 100644 index 0000000..931ae94 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/libtiff.3tiff.html @@ -0,0 +1,1150 @@ + + + + + + +INTRO + + + +

    INTRO

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +DATA TYPES
    +LIST OF ROUTINES
    +TAG USAGE
    +PSEUDO TAGS
    +DIAGNOSTICS
    +SEE ALSO
    +BUGS
    + +
    + +

    NAME

    + + + + + +
    +

    libtiff − introduction to libtiff, a +library for reading and writing TIFF +files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    #include <tiffio.h>

    + +

    cc file.c -ltiff

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    libtiff is a library for reading and writing +data files encoded with the Tag Image File format, +Revision 6.0 (or revision 5.0 or revision 4.0). This file +format is suitable for archiving multi-color and +monochromatic image data.

    + +

    The library supports several compression algorithms, +as indicated by the Compression field, including: no +compression (1), CCITT 1D Huffman compression +(2), CCITT Group 3 Facsimile compression +(3), CCITT Group 4 Facsimile compression (4), +Lempel-Ziv & Welch compression (5), baseline JPEG +compression (7), word-aligned 1D Huffman compression +(32771), and PackBits compression (32773). In addition, +several nonstandard compression algorithms are supported: +the 4-bit compression algorithm used by the +ThunderScan program (32809) (decompression only), +NeXT’s 2-bit compression algorithm (32766) +(decompression only), an experimental LZ-style algorithm +known as Deflate (32946), and an experimental CIE LogLuv +compression scheme designed for images with high dynamic +range (32845 for LogL and 32845 for LogLuv). Directory +information may be in either little- or big-endian byte +order−byte swapping is automatically done by the +library. Data bit ordering may be either Most Significant +Bit ( MSB ) to Least Significant Bit ( LSB +) or LSB to MSB. Finally, the +library does not support files in which the +BitsPerSample, Compression, +MinSampleValue, or MaxSampleValue fields are +defined differently on a per-sample basis (in Rev. 6.0 the +Compression tag is not defined on a per-sample basis, +so this is immaterial).

    +
    + +

    DATA TYPES

    + + + + + +
    +

    The library makes extensive use of C typedefs to +promote portability. Two sets of typedefs are used, one for +communication with clients of the library and one for +internal data structures and parsing of the TIFF +format. The following typedefs are exposed to users +either through function definitions or through parameters +passed through the varargs interfaces.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    typedef unsigned short uint16;

    +
    + +

    16-bit unsigned integer

    +
    + +

    typedef unsigned <thing> +uint32;

    +
    + +

    32-bit unsigned integer

    +
    + +

    typedef unsigned int ttag_t;

    +
    + +

    directory tag

    +
    + +

    typedef uint16 tdir_t;

    +
    + +

    directory index

    +
    + +

    typedef uint16 tsample_t;

    +
    + +

    sample number

    +
    + +

    typedef uint32 tstrip_t;

    +
    + +

    strip number

    +
    + +

    typedef uint32 ttile_t;

    +
    + +

    tile number

    +
    + +

    typedef int32 tsize_t;

    +
    + +

    i/o size in bytes

    +
    + +

    typedef void* tdata_t;

    +
    + +

    image data ref

    +
    + +

    typedef void* thandle_t;

    +
    + +

    client data handle

    +
    + +

    typedef int32 toff_t;

    +
    + +

    file offset

    +
    + + + + + +
    +

    Note that tstrip_t, ttile_t, and +tsize_t are constrained to be no more than 32-bit +quantities by 32-bit fields they are stored in in the +TIFF image. Likewise tsample_t is limited by the +16-bit field used to store the SamplesPerPixel tag. +tdir_t constrains the maximum number of IFDs +that may appear in an image and may be an arbitrary +size (w/o penalty). ttag_t must be either int, +unsigned int, pointer, or double because the library uses a +varargs interface and ANSI C restricts the type +of the parameter before an ellipsis to be a promoted type. +toff_t is defined as int32 because TIFF file offsets +are (unsigned) 32-bit quantities. A signed value is used +because some interfaces return −1 on error. Finally, +note that user-specified data references are passed as +opaque handles and only cast at the lowest layers where +their type is presumed.

    +
    + +

    LIST OF ROUTINES

    + + + + + +
    +

    The following routines are part of the library. +Consult specific manual pages for details on their +operation; on most systems doing ‘‘man +function-name’’ will work.

    + + +

    Name Description

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    TIFFCheckpointDirectory

    +
    + +

    writes the current state of the directory

    +
    + +

    TIFFCheckTile

    +
    + +

    very x,y,z,sample is within image

    +
    + +

    TIFFCIELabToRGBInit

    +
    + +

    initialize CIE L*a*b* 1976 to RGB conversion +state

    +
    + +

    TIFFCIELabToXYZ

    +
    + +

    perform CIE L*a*b* 1976 to CIE XYZ +conversion

    +
    + +

    TIFFClientOpen

    +
    + +

    open a file for reading or writing

    +
    + +

    TIFFClose

    +
    + +

    close an open file

    +
    + +

    TIFFComputeStrip

    +
    + +

    return strip containing y,sample

    +
    + +

    TIFFComputeTile

    +
    + +

    return tile containing x,y,z,sample

    +
    + +

    TIFFCurrentDirectory

    +
    + +

    return index of current directory

    +
    + +

    TIFFCurrentRow

    +
    + +

    return index of current scanline

    +
    + +

    TIFFCurrentStrip

    +
    + +

    return index of current strip

    +
    + +

    TIFFCurrentTile

    +
    + +

    return index of current tile

    +
    + +

    TIFFDataWidth

    +
    + +

    return the size of TIFF data types

    +
    + +

    TIFFError

    +
    + +

    library error handler

    +
    + +

    TIFFFdOpen

    +
    + +

    open a file for reading or writing

    +
    + +

    TIFFFileName

    +
    + +

    return name of open file

    +
    + +

    TIFFFileno

    +
    + +

    return open file descriptor

    +
    + +

    TIFFFindCODEC

    +
    + +

    find standard codec for the specific +scheme

    +
    + +

    TIFFFlush

    +
    + +

    flush all pending writes

    +
    + +

    TIFFFlushData

    +
    + +

    flush pending data writes

    +
    + +

    TIFFGetBitRevTable

    +
    + +

    return bit reversal table

    +
    + +

    TIFFGetField

    +
    + +

    return tag value in current directory

    +
    + +

    TIFFGetFieldDefaulted

    +
    + +

    return tag value in current directory

    +
    + +

    TIFFGetMode

    +
    + +

    return open file mode

    +
    + +

    TIFFGetVersion

    +
    + +

    return library version string

    +
    + +

    TIFFIsCODECConfigured

    +
    + +

    check, whether we have working codec

    +
    + +

    TIFFIsMSB2LSB

    +
    + +

    return true if image data is being +returned

    +
    + +

    with bit 0 as the most significant bit

    +
    + +

    TIFFIsTiled

    +
    + +

    return true if image data is tiled

    +
    + +

    TIFFIsByteSwapped

    +
    + +

    return true if image data is byte-swapped

    +
    + +

    TIFFNumberOfStrips

    +
    + +

    return number of strips in an image

    +
    + +

    TIFFNumberOfTiles

    +
    + +

    return number of tiles in an image

    +
    + +

    TIFFOpen

    +
    + +

    open a file for reading or writing

    +
    + +

    TIFFPrintDirectory

    +
    + +

    print description of the current +directory

    +
    + +

    TIFFReadBufferSetup

    +
    + +

    specify i/o buffer for reading

    +
    + +

    TIFFReadDirectory

    +
    + +

    read the next directory

    +
    + +

    TIFFReadEncodedStrip

    +
    + +

    read and decode a strip of data

    +
    + +

    TIFFReadEncodedTile

    +
    + +

    read and decode a tile of data

    +
    + +

    TIFFReadRawStrip

    +
    + +

    read a raw strip of data

    +
    + +

    TIFFReadRawTile

    +
    + +

    read a raw tile of data

    +
    + +

    TIFFReadRGBAImage

    +
    + +

    read an image into a fixed format raster

    +
    + +

    TIFFReadScanline

    +
    + +

    read and decode a row of data

    +
    + +

    TIFFReadTile

    +
    + +

    read and decode a tile of data

    +
    + +

    TIFFRegisterCODEC

    +
    + +

    override standard codec for the specific +scheme

    +
    + +

    TIFFReverseBits

    +
    + +

    reverse bits in an array of bytes

    +
    + +

    TIFFRGBAImageBegin

    +
    + +

    setup decoder state for TIFFRGBAImageGet

    +
    + +

    TIFFRGBAImageEnd

    +
    + +

    release TIFFRGBAImage decoder state

    +
    + +

    TIFFRGBAImageGet

    +
    + +

    read and decode an image

    +
    + +

    TIFFRGBAImageOK

    +
    + +

    is image readable by TIFFRGBAImageGet

    +
    + +

    TIFFScanlineSize

    +
    + +

    return size of a scanline

    +
    + +

    TIFFSetDirectory

    +
    + +

    set the current directory

    +
    + +

    TIFFSetSubDirectory

    +
    + +

    set the current directory

    +
    + +

    TIFFSetErrorHandler

    +
    + +

    set error handler function

    +
    + +

    TIFFSetField

    +
    + +

    set a tag’s value in the current +directory

    +
    + +

    TIFFSetWarningHandler

    +
    + +

    set warning handler function

    +
    + +

    TIFFStripSize

    +
    + +

    returns size of a strip

    +
    + +

    TIFFRawStripSize

    +
    + +

    returns the number of bytes in a raw +strip

    +
    + +

    TIFFSwabShort

    +
    + +

    swap bytes of short

    +
    + +

    TIFFSwabLong

    +
    + +

    swap bytes of long

    +
    + +

    TIFFSwabArrayOfShort

    +
    + +

    swap bytes of an array of shorts

    +
    + +

    TIFFSwabArrayOfLong

    +
    + +

    swap bytes of an array of longs

    +
    + +

    TIFFTileRowSize

    +
    + +

    return size of a row in a tile

    +
    + +

    TIFFTileSize

    +
    + +

    return size of a tile

    +
    + +

    TIFFUnRegisterCODEC

    +
    + +

    unregisters the codec

    +
    + +

    TIFFVGetField

    +
    + +

    return tag value in current directory

    +
    + +

    TIFFVGetFieldDefaulted

    +
    + +

    return tag value in current directory

    +
    + +

    TIFFVSetField

    +
    + +

    set a tag’s value in the current +directory

    +
    + +

    TIFFVStripSize

    +
    + +

    returns the number of bytes in a strip

    +
    + +

    TIFFWarning

    +
    + +

    library warning handler

    +
    + +

    TIFFWriteDirectory

    +
    + +

    write the current directory

    +
    + +

    TIFFWriteEncodedStrip

    +
    + +

    compress and write a strip of data

    +
    + +

    TIFFWriteEncodedTile

    +
    + +

    compress and write a tile of data

    +
    + +

    TIFFWriteRawStrip

    +
    + +

    write a raw strip of data

    +
    + +

    TIFFWriteRawTile

    +
    + +

    write a raw tile of data

    +
    + +

    TIFFWriteScanline

    +
    + +

    write a scanline of data

    +
    + +

    TIFFWriteTile

    +
    + +

    compress and write a tile of data

    +
    + +

    TIFFXYZToRGB

    +
    + +

    perform CIE XYZ to RGB conversion

    +
    + +

    TIFFYCbCrToRGBInit

    +
    + +

    initialize YCbCr to RGB conversion state

    +
    + +

    TIFFYCbCrtoRGB

    +
    + +

    perform YCbCr to RGB conversion

    +
    + + + + + +
    +

    Auxiliary functions:

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    _TIFFfree

    +
    + +

    free memory buffer

    +
    + +

    _TIFFmalloc

    +
    + +

    dynamically allocate memory buffer

    +
    + +

    _TIFFmemcmp

    +
    + +

    compare contents of the memory buffers

    +
    + +

    _TIFFmemcpy

    +
    + +

    copy contents of the one buffer to +another

    +
    + +

    _TIFFmemset

    +
    + +

    fill memory buffer with a constant byte

    +
    + +

    _TIFFrealloc

    +
    + +

    dynamically reallocate memory buffer

    +
    + +

    TAG USAGE

    + + + + +
    +

    The table below lists the TIFF tags that +are recognized and handled by the library. If no use is +indicated in the table, then the library reads and writes +the tag, but does not use it internally. Note that some tags +are meaningful only when a particul \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/pal2rgb.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/pal2rgb.1.html new file mode 100644 index 0000000..d06ddb6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/pal2rgb.1.html @@ -0,0 +1,189 @@ + + + + + + +PAL2RGB + + + +

    PAL2RGB

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    pal2rgb − convert a palette color +TIFF image to a full color image

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    pal2rgb [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Pal2rgb converts a palette color +TIFF image to a full color image by applying +the colormap of the palette image to each sample to generate +a full color RGB image.

    +
    + +

    OPTIONS

    + + + + + +
    +

    Options that affect the interpretation of input data +are:

    +
    + + + + + + + + +
    + +

    −C

    +
    + +

    This option overrides the default behavior of +pal2rgb in determining whether or not colormap +entries contain 16-bit or 8-bit values. By default the +colormap is inspected and if no colormap entry greater than +255 is found, the colormap is assumed to have only 8-bit +values; otherwise 16-bit values (as required by the +TIFF specification) are assumed. The +−C option can be used to explicitly specify the +number of bits for colormap entries: −C 8 for +8-bit values, −C 16 for 16-bit values.

    +
    +
    + + + + + +
    +

    Options that affect the output file format are:

    +
    + + + + + + + + + + + + + + + + + + + + +
    + +

    −p

    +
    + +

    Explicitly select the planar configuration used in +organizing data samples in the output image: −p +contig for samples packed contiguously, and −p +separate for samples stored separately. By default +samples are packed.

    +
    +
    + +

    −c

    +
    + +

    Use the specific compression algorithm to encoded image +data in the output file: −c packbits for +Macintosh Packbits, −c lzw for Lempel-Ziv & +Welch, −c zip for Deflate, −c none +for no compression. If no compression-related option is +specified, the input file’s compression algorithm is +used.

    +
    +
    + +

    −r

    +
    + +

    Explicitly specify the number of rows in each strip of +the output file. If the −r option is not +specified, a number is selected such that each output strip +has approximately 8 kilobytes of data in it.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    Only 8-bit images are handled.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/ppm2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/ppm2tiff.1.html new file mode 100644 index 0000000..e3c664e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/ppm2tiff.1.html @@ -0,0 +1,141 @@ + + + + + + +PPM2TIFF + + + +

    PPM2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    ppm2tiff − create a TIFF file from +PPM, PGM and PBM image +files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    ppm2tiff [ options ] [ input.ppm ] +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    ppm2tiff converts a file in the PPM, +PGM and PBM image formats to +TIFF. By default, the TIFF +image is created with data samples packed +(PlanarConfiguration=1), compressed with the Packbits +algorithm (Compression=32773), and with each strip no +more than 8 kilobytes. These characteristics can be +overridden, or explicitly specified with the options +described below

    + +

    If the PPM file contains greyscale data, +then the PhotometricInterpretation tag is set to 1 +(min-is-black), otherwise it is set to 2 (RGB).

    + +

    If no PPM file is specified on the command +line, ppm2tiff will read from the standard input.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: none for no compression, packbits for +PackBits compression (will be used by default), lzw +for Lempel-Ziv & Welch compression, jpeg for +baseline JPEG compression, zip for Deflate +compression, g3 for CCITT Group 3 (T.4) compression, +and g4 for CCITT Group 4 (T.6) compression.

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    −R

    +
    + +

    Mark the resultant image to have the specified X and Y +resolution (in dots/inch).

    +
    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/ras2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/ras2tiff.1.html new file mode 100644 index 0000000..2c652ab --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/ras2tiff.1.html @@ -0,0 +1,139 @@ + + + + + + +RAS2TIFF + + + +

    RAS2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    ras2tiff − create a TIFF file from a +Sun rasterfile

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    ras2tiff [ options ] input.ras +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    ras2tiff converts a file in the Sun rasterfile +format to TIFF. By default, the +TIFF image is created with data samples +packed (PlanarConfiguration=1), compressed with the +Lempel-Ziv & Welch algorithm (Compression=5), and +with each strip no more than 8 kilobytes. These +characteristics can overridden, or explicitly specified with +the options described below.

    + +

    Any colormap information in the rasterfile is carried +over to the TIFF file by including a +Colormap tag in the output file. If the rasterfile +has a colormap, the PhotometricInterpretation tag is +set to 3 (palette); otherwise it is set to 2 (RGB) if the +depth is 24 or 1 (min-is-black) if the depth is not 24.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm, +−c jpeg for the baseline JPEG compression +algorithm, −c zip for the Deflate compression +algorithm, and −c lzw for Lempel-Ziv & +Welch (the default).

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    Does not handle all possible rasterfiles. In particular, +ras2tiff does not handle run-length encoded +images.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/raw2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/raw2tiff.1.html new file mode 100644 index 0000000..ce47e9f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/raw2tiff.1.html @@ -0,0 +1,510 @@ + + + + + + +RAW2TIFF + + + +

    RAW2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +GUESSING THE IMAGE GEOMETRY
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    raw2tiff − create a TIFF file from a +raw data

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    raw2tiff [ options ] input.raw +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    raw2tiff converts a raw byte sequence into +TIFF. By default, the TIFF +image is created with data samples packed +(PlanarConfiguration=1), compressed with the PackBits +algorithm (Compression=32773), and with each strip no +more than 8 kilobytes. These characteristics can overridden, +or explicitly specified with the options described +below.

    +
    + +

    OPTIONS

    + + + + + +
    +

    −H number

    + + + + + +
    +

    size of input image file header in bytes (0 by default). +This amount of data just will be skipped from the start of +file while reading.

    +
    + + + + + +
    +

    −w number

    + + + + + +
    +

    width of input image in pixels (can be guessed, see +GUESSING THE IMAGE GEOMETRY +below).

    +
    + + + + + +
    +

    −l number

    + + + + + +
    +

    length of input image in lines (can be guessed, see +GUESSING THE IMAGE GEOMETRY +below).

    +
    + + + + + +
    +

    −b number

    + + + + + +
    +

    number of bands in input image (1 by default).

    +
    + + + + + +
    +

    −d data_type

    + + + + + +
    +

    type of samples in input image, where data_type +may be:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    byte

    +
    + +

    8-bit unsigned integer (default),

    +
    + +

    short

    +
    + +

    16-bit unsigned integer,

    +
    + +

    long

    +
    + +

    32-bit unsigned integer,

    +
    + +

    sbyte

    +
    + +

    8-bit signed integer,

    +
    + +

    sshort

    +
    + +

    16-bit signed integer,

    +
    + +

    slong

    +
    + +

    32-bit signed integer,

    +
    + +

    float

    +
    + +

    32-bit IEEE floating point,

    +
    + +

    double

    +
    + +

    64-bit IEEE floating point.

    +
    + + + + + +
    +

    −i config

    + + + + + +
    +

    type of samples interleaving in input image, where +config may be:

    + + + + + + + + + + +
    + +

    pixel

    +
    + +

    pixel interleaved data (default),

    +
    + +

    band

    +
    + +

    band interleaved data.

    +
    + + + + + +
    +

    −p photo

    + + + + + +
    +

    photometric interpretation (color space) of the input +image, where photo may be:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    miniswhite

    +
    + +

    white color represented with 0 value,

    +
    + +

    minisblack

    +
    + +

    black color represented with 0 value (default),

    +
    + +

    rgb

    +
    + +

    image has RGB color model,

    +
    + +

    cmyk

    +
    + +

    image has CMYK (separated) color model,

    +
    + +

    ycbcr

    +
    + +

    image has YCbCr color model,

    +
    + +

    cielab

    +
    + +

    image has CIE L*a*b color model,

    +
    + +

    icclab

    +
    + +

    image has ICC L*a*b color model,

    +
    + +

    itulab

    +
    + +

    image has ITU L*a*b color model.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −s

    +
    + +

    swap bytes fetched from the input file.

    +
    +
    + +

    −L

    +
    + +

    input data has LSB2MSB bit order (default).

    +
    +
    + +

    −M

    +
    + +

    input data has MSB2LSB bit order.

    +
    +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm (the +default), −c jpeg for the baseline JPEG +compression algorithm, −c zip for the Deflate +compression algorithm, and −c lzw for +Lempel-Ziv & Welch.

    +
    +
    + + + + + +
    +

    −r number

    + + + + + +
    +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    + +

    GUESSING THE IMAGE GEOMETRY

    + + + + + +
    +

    raw2tiff can guess image width and height in case +one or both of these parameters are not specified. If you +omit one of those parameters, the complementary one will be +calculated based on the file size (taking into account +header size, number of bands and data type). If you omit +both parameters, the statistical approach will be used. +Utility will compute correlation coefficient between two +lines at the image center using several appropriate line +sizes and the highest absolute value of the coefficient will +indicate the right line size. That is why you should be +cautious with the very large images, because guessing +process may take a while (depending on your system +performance). Of course, the utility can’t guess the +header size, number of bands and data type, so it should be +specified manually. If you don’t know anything about +your image, just try with the several combinations of those +options.

    + +

    There is no magic, it is just a mathematical statistics, +so it can be wrong in some cases. But for most ordinary +images guessing method will work fine.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/rgb2ycbcr.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/rgb2ycbcr.1.html new file mode 100644 index 0000000..dcd88d1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/rgb2ycbcr.1.html @@ -0,0 +1,155 @@ + + + + + + +RGB2YCBCR + + + +

    RGB2YCBCR

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    rgb2ycbcr − convert non-YCbCr TIFF +images to a YCbCr TIFF image

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    rgb2ycbcr [ options ] src1.tif src2.tif +... dst.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    rgb2ycbcr converts RGB color, +greyscale, or bi-level TIFF images to YCbCr +images by transforming and sampling pixel data. If multiple +files are specified on the command line each source file is +converted to a separate directory in the destination +file.

    + +

    By default, chrominance samples are created by sampling 2 +by 2 blocks of luminance values; this can be changed with +the −h and −v options. Output data +are compressed with the PackBits compression +scheme, by default; an alternate scheme can be selected with +the −c option. By default, output data are +compressed in strips with the number of rows in each strip +selected so that the size of a strip is never more than 8 +kilobytes; the −r option can be used to +explicitly set the number of rows per strip.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm (the +default), −c jpeg for the JPEG compression +algorithm, −c zip for the deflate compression +algorithm, and −c lzw for Lempel-Ziv & +Welch.

    +
    +
    + +

    −h

    +
    + +

    Set the horizontal sampling dimension to one of: 1, 2 +(default), or 4.

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    −v

    +
    + +

    Set the vertical sampling dimension to one of: 1, 2 +(default), or 4.

    +
    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffinfo(1), tiffcp(1), +libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/sgi2tiff.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/sgi2tiff.1.html new file mode 100644 index 0000000..7665a6e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/sgi2tiff.1.html @@ -0,0 +1,147 @@ + + + + + + +SGI2TIFF + + + +

    SGI2TIFF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    sgi2tiff − create a TIFF file from +an SGI image file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    sgi2tiff [ options ] input.rgb +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    sgi2tiff converts a file in the SGI +image format to TIFF. By default, the +TIFF image is created with data samples +packed (PlanarConfiguration=1), compressed with the +Lempel-Ziv & Welch algorithm (Compression=5), and +with each strip no more than 8 kilobytes. These +characteristics can overridden, or explicitly specified with +the options described below.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm), +−c jpeg for the baseline JPEG compression +algorithm, −c zip for the Deflate compression +algorithm, and −c lzw for Lempel-Ziv & +Welch (the default).

    +
    +
    + +

    −p

    +
    + +

    Explicitly select the planar configuration used in +organizing data samples in the output image: −p +contig for samples packed contiguously, and −p +separate for samples stored separately. By default +samples are packed.

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    Does not record colormap information.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/thumbnail.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/thumbnail.1.html new file mode 100644 index 0000000..2d1f3c9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/thumbnail.1.html @@ -0,0 +1,148 @@ + + + + + + +THUMBNAIL + + + +

    THUMBNAIL

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    thumbnail − create a TIFF file with +thumbnail images

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    thumbnail [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    thumbnail is a program written to show how one +might use the SubIFD tag (#330) to store thumbnail images. +thumbnail copies a TIFF Class F +facsimile file to the output file and for each image an +8-bit greyscale thumbnail sketch. The output file +contains the thumbnail image with the associated +full-resolution page linked below with the SubIFD tag.

    + +

    By default, thumbnail images are 216 pixels wide by 274 +pixels high. Pixels are calculated by sampling and filtering +the input image with each pixel value passed through a +contrast curve.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + +
    + +

    −w

    +
    + +

    Specify the width of thumbnail images in pixels.

    +
    +
    + +

    −h

    +
    + +

    Specify the height of thumbnail images in pixels.

    +
    +
    + +

    −c

    +
    + +

    Specify a contrast curve to apply in generating the +thumbnail images. By default pixels values are passed +through a linear contrast curve that simply maps the pixel +value ranges. Alternative curves are: exp50 for a 50% +exponential curve, exp60 for a 60% exponential curve, +exp70 for a 70% exponential curve, exp80 for a +80% exponential curve, exp90 for a 90% exponential +curve, exp for a pure exponential curve, +linear for a linear curve.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    There are no options to control the format of the saved +thumbnail images.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffdump(1), tiffgt(1), tiffinfo(1), +libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2bw.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2bw.1.html new file mode 100644 index 0000000..1ebb4d3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2bw.1.html @@ -0,0 +1,161 @@ + + + + + + +TIFF2BW + + + +

    TIFF2BW

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiff2bw − convert a color TIFF image +to greyscale

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiff2bw [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Tiff2bw converts an RGB or Palette +color TIFF image to a greyscale image by +combining percentages of the red, green, and blue channels. +By default, output samples are created by taking 28% of the +red channel, 59% of the green channel, and 11% of the blue +channel. To alter these percentages, the −R, +−G, and −B options may be +used.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression, −c +packbits for the PackBits compression algorithm, +−c zip for the Deflate compression algorithm, +−c g3 for the CCITT Group 3 compression +algorithm, −c g4 for the CCITT Group 4 +compression algorithm, and −c lzw for +Lempel-Ziv & Welch (the default).

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    −R

    +
    + +

    Specify the percentage of the red channel to use +(default 28).

    +
    +
    + +

    −G

    +
    + +

    Specify the percentage of the green channel to use +(default 59).

    +
    +
    + +

    −B

    +
    + +

    Specify the percentage of the blue channel to use +(default 11).

    +
    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2pdf.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2pdf.1.html new file mode 100644 index 0000000..3b6dd4b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2pdf.1.html @@ -0,0 +1,609 @@ + + + + + + +TIFF2PDF + + + +

    TIFF2PDF

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +EXAMPLES
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiff2pdf − convert a TIFF image to a PDF +document

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiff2pdf [ options ] input.tiff

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiff2pdf opens a TIFF image and writes a PDF +document to standard output.

    + +

    The program converts one TIFF file to one PDF file, +including multiple page TIFF files, tiled TIFF files, black +and white. grayscale, and color TIFF files that contain data +of TIFF photometric interpretations of bilevel, grayscale, +RGB, YCbCr, CMYK separation, and ICC L*a*b* as supported by +libtiff and PDF.

    + +

    If you have multiple TIFF files to convert into one PDF +file then use tiffcp or other program to concatenate +the files into a multiple page TIFF file. If the input TIFF +file is of huge dimensions (greater than 10000 pixels height +or width) convert the input image to a tiled TIFF if it is +not already.

    + +

    The standard output is standard output. Set the output +file name with the −o output.pdf +option.

    + +

    All black and white files are compressed into a single +strip CCITT G4 Fax compressed PDF, unless tiled, where tiled +black and white images are compressed into tiled CCITT G4 +Fax compressed PDF, libtiff CCITT support is +assumed.

    + +

    Color and grayscale data can be compressed using either +JPEG compression, ITU-T T.81, or Zip/Deflate LZ77 +compression. Set the compression type using the +−j or −z options. JPEG compression +support requires that libtiff be configured with JPEG +support, and Zip/Deflate compression support requires that +libtiff be configured with Zip support, in +tiffconf.h. Use only one or the other of −j and +−z.

    + +

    If the input TIFF contains single strip CCITT G4 Fax +compressed information, then that is written to the PDF file +without transcoding, unless the options of no compression +and no passthrough are set, −d and +−n.

    + +

    If the input TIFF contains JPEG or single strip +Zip/Deflate compressed information, and they are configured, +then that is written to the PDF file without transcoding, +unless the options of no compression and no passthrough are +set.

    + +

    The default page size upon which the TIFF image is placed +is determined by the resolution and extent of the image +data. Default values for the TIFF image resolution can be +set using the −x and −y options. +The page size can be set using the −p option +for paper size, or −w and −l for +paper width and length, then each page of the TIFF image is +centered on its page. The distance unit for default +resolution and page width and length can be set by the +−u option, the default unit is inch.

    + +

    Various items of the output document information can be +set with the −e, −c, +−a, −t, −s, and +−k options. Setting the argument of the option +to "" for these tags causes the relevant document +information field to be not written. Some of the document +information values otherwise get their information from the +input TIFF image, the software, author, document name, and +image description.

    + +

    The Portable Document Format (PDF) specification is +copyrighted by Adobe Systems, Incorporated.

    +
    + +

    OPTIONS

    + + + + + +
    +

    −o output-file

    + + + + + +
    +

    Set the output to go to file. output-file

    +
    + + + + + + + + + + + + +
    + +

    −j

    +
    + +

    Compress with JPEG (requires libjpeg configured +with libtiff).

    +
    + +

    −z

    +
    + +

    Compress with Zip/Deflate (requires zlib +configured with libtiff).

    +
    + + + + + +
    +

    −q quality

    + + + + + +
    +

    Set the compression quality, 1-100 for JPEG.

    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −n

    +
    + +

    Do not allow data to be converted without uncompressing, +no compressed data passthrough.

    +
    + +

    −b

    +
    + +

    Set PDF ‘‘Interpolate’’ user +preference.

    +
    + +

    −d

    +
    + +

    Do not compress (decompress).

    +
    + +

    −i

    +
    + +

    Invert colors.

    +
    + + + + + +
    +

    −p paper-size

    + + + + + +
    +

    Set paper size, e.g., letter, legal, +A4.

    +
    + + + + + +
    +

    −u [i|m]

    + + + + + +
    +

    Set distance unit, i for inch, m for +centimeter.

    +
    + + + + + +
    +

    −w width

    + + + + + +
    +

    Set width in units.

    +
    + + + + + +
    +

    −l length

    + + + + + +
    +

    Set length in units.

    +
    + + + + + +
    +

    −x xres

    + + + + + +
    +

    Set x/width resolution default.

    +
    + + + + + +
    +

    −y yres

    + + + + + +
    +

    Set y/length resolution default.

    +
    + + + + + +
    +

    −r [d|o]

    + + + + + +
    +

    Set d for resolution default for images without +resolution, o for resolution override for all +images.

    +
    + + + + + + + + +
    + +

    −f

    +
    + +

    Set PDF ‘‘Fit Window’’ user +preference.

    +
    +
    + + + + + +
    +

    −e YYYYMMDDHHMMSS

    + + + + + +
    +

    Set document information date, overrides image or current +date/time default, YYYYMMDDHHMMSS.

    +
    + + + + + +
    +

    −c creator

    + + + + + +
    +

    Set document information creator, overrides image +software default.

    +
    + + + + + +
    +

    −a author

    + + + + + +
    +

    Set document information author, overrides image artist +default.

    +
    + + + + + +
    +

    −t title

    + + + + + +
    +

    Set document information title, overrides image document +name default.

    +
    + + + + + +
    +

    −s subject

    + + + + + +
    +

    Set document information subject, overrides image image +description default.

    +
    + + + + + +
    +

    −k keywords

    + + + + + +
    +

    Set document information keywords.

    +
    + + + + + + + + +
    + +

    −h

    +
    + +

    List usage reminder to stderr and exit.

    +
    +
    + +

    EXAMPLES

    + + + + + +
    +

    The following example would generate the file output.pdf +from input.tiff.

    + + + + + +
    +
    tiff2pdf −o output.pdf input.tiff
    +
    +
    + + + + + + +
    +

    The following example would generate PDF output from +input.tiff and write it to standard output.

    + + + + + +
    +
    tiff2pdf input.tiff
    +
    +
    + + + + + + +
    +

    The following example would generate the file output.pdf +from input.tiff, putting the image pages on a letter sized +page, compressing the output with JPEG, with JPEG quality +75, setting the title to +‘‘Document’’, and setting the +‘‘Fit Window’’ option.

    + + + + + +
    +
    tiff2pdf −p letter −j −q 75 −t "Document" −f −o output.pdf input.tiff
    +
    +
    + +

    BUGS

    + + + + + + +
    +

    Please report bugs via the web interface at

    +
    + + + + + +
    + +

    http://bugzilla.remotesensing.org/enter_bug.cgi?product=libtiff

    +
    + +

    SEE ALSO

    + + + + + +
    +

    libtiff(3), tiffcp(1), +tiff2ps(1)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2ps.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2ps.1.html new file mode 100644 index 0000000..ef2cd7f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2ps.1.html @@ -0,0 +1,532 @@ + + + + + + +TIFF2PS + + + +

    TIFF2PS

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +EXAMPLES
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiff2ps − convert a TIFF image to +PostScript™

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiff2ps [ options ] input.tif +...

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiff2ps reads TIFF images and +writes PostScript or Encapsulated PostScript (EPS) on the +standard output. By default, tiff2ps writes +Encapsulated PostScript for the first image in the specified +TIFF image file.

    + +

    By default, tiff2ps will generate PostScript that +fills a printed area specified by the TIFF +tags in the input file. If the file does not contain +XResolution or YResolution tags, then the +printed area is set according to the image dimensions. The +−w and −h options (see below) can +be used to set the dimensions of the printed area in inches; +overriding any relevant TIFF tags.

    + +

    The PostScript generated for RGB, palette, +and CMYK images uses the colorimage +operator. The PostScript generated for greyscale and bilevel +images uses the image operator. When the +colorimage operator is used, PostScript code to +emulate this operator on older PostScript printers is also +generated. Note that this emulation code can be very +slow.

    + +

    Color images with associated alpha data are composited +over a white background.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −1

    +
    + +

    Generate PostScript Level 1 (the default).

    +
    +
    + +

    −2

    +
    + +

    Generate PostScript Level 2.

    +
    +
    + +

    −3

    +
    + +

    Generate PostScript Level 3. It basically allows one to +use the /flateDecode filter for ZIP compressed TIFF +images.

    +
    +
    + +

    −a

    +
    + +

    Generate output for all IFDs (pages) in the input +file.

    +
    +
    + +

    −b

    +
    + +

    Specify the bottom margin for the output (in inches). +This does not affect the height of the printed image.

    +
    +
    + +

    −c

    +
    + +

    Center the image in the output. This option only shows +an effect if both the −w and the +−h option are given.

    +
    +
    + +

    −d

    +
    + +

    Set the initial TIFF directory to the +specified directory number. (NB: Directories are numbered +starting at zero.) This option is useful for selecting +individual pages in a multi-page (e.g. facsimile) file.

    +
    +
    + +

    −e

    +
    + +

    Force the generation of Encapsulated PostScript (implies +−z).

    +
    +
    + +

    −h

    +
    + +

    Specify the vertical size of the printed area (in +inches).

    +
    +
    + +

    −H

    +
    + +

    Specify the maximum height of image (in inches). Images +with larger sizes will be split in several pages. Option +−L may be used for specifying size of split +images overlapping.

    +
    +
    + +

    −i

    +
    + +

    Enable/disable pixel interpolation. This option requires +a single numeric value: zero to disable pixel interpolation +and non-zero to enable. The default is enabled.

    +
    +
    + +

    −L

    +
    + +

    Specify the size of overlapping for split images (in +inches). Used in conjunction with −H +option.

    +
    +
    + +

    −l

    +
    + +

    Specify the left margin for the output (in inches). This +does not affect the width of the printed image.

    +
    +
    + +

    −m

    +
    + +

    Where possible render using the imagemask +PostScript operator instead of the image operator. +When this option is specified tiff2ps will use +imagemask for rendering 1 bit deep images. If this +option is not specified or if the image depth is greater +than 1 then the image operator is used.

    +
    +
    + +

    −o

    +
    + +

    Set the initial TIFF directory to the +IFD at the specified file offset. This option +is useful for selecting thumbnail images and the like which +are hidden using the SubIFD tag.

    +
    +
    + +

    −p

    +
    + +

    Force the generation of (non-Encapsulated) +PostScript.

    +
    +
    + +

    −r

    +
    + +

    Rotate image by 180 degrees.

    +
    +
    + +

    −s

    +
    + +

    Generate output for a single IFD (page) in the input +file.

    +
    +
    + +

    −w

    +
    + +

    Specify the horizontal size of the printed area (in +inches).

    +
    +
    + +

    −x

    +
    + +

    Override resolution units specified in the TIFF as +centimeters.

    +
    +
    + +

    −y

    +
    + +

    Override resolution units specified in the TIFF as +inches.

    +
    +
    + +

    −z

    +
    + +

    When generating PostScript Level 2, data is scaled so +that it does not image into the deadzone on a page +(the outer margin that the printing device is unable to +mark). This option suppresses this behavior. When PostScript +Level 1 is generated, data is imaged to the entire printed +page and this option has no affect.

    +
    +
    + +

    EXAMPLES

    + + + + + +
    +

    The following generates PostScript Level 2 for all pages +of a facsimile:

    + + + + + +
    +
    tiff2ps −a2 fax.tif | lpr
    +
    +
    + + + + + + +
    +

    Note also that if you have version 2.6.1 or newer of +Ghostscript then you can efficiently preview facsimile +generated with the above command.

    + +

    To generate Encapsulated PostScript for a the image at +directory 2 of an image use:

    + + + + + +
    +
    tiff2ps −d 1 foo.tif
    +
    +
    + + + + + + +
    +

    (Notice that directories are numbered starting at +zero.)

    + +

    If you have a long image, it may be split in several +pages:

    + + + + + +
    +
    tiff2ps −h11 −w8.5 −H14 −L.5 foo.tif > foo.ps
    +
    +
    + + + + + + +
    +

    The page size is set to 8.5x11 by −w and +−h options. We will accept a small amount of +vertical compression, so −H set to 14. Any +pages between 11 and 14 inches will be fit onto one page. +Pages longer than 14 inches are cut off at 11 and continued +on the next page. The −L.5 option says to +repeat a half inch on the next page (to improve +readability).

    +
    + +

    BUGS

    + + + + + +
    +

    Because PostScript does not support the notion of a +colormap, 8-bit palette images produce 24-bit PostScript +images. This conversion results in output that is six times +bigger than the original image and which takes a long time +to send to a printer over a serial line. Matters are even +worse for 4-, 2-, and 1-bit palette images.

    + +

    Does not handle tiled images when generating PostScript +Level I output.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcp(1), +tiffgt(1), tiffmedian(1), tiff2bw(1), +tiffsv(1), libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2rgba.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2rgba.1.html new file mode 100644 index 0000000..35e06a5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiff2rgba.1.html @@ -0,0 +1,162 @@ + + + + + + +TIFF2RGBA + + + +

    TIFF2RGBA

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiff2rgba − convert a TIFF image to +RGBA color space

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiff2rgba [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Tiff2rgba converts a wide variety of TIFF images +into an RGBA TIFF image. This includes the ability to +translate different color spaces and photometric +interpretation into RGBA, support for alpha blending, and +translation of many different bit depths into a 32bit RGBA +image.

    + +

    Internally this program is implemented using the +TIFFReadRGBAImage() function, and it suffers any +limitations of that image. This includes limited support for +> 8 BitsPerSample images, and flaws with some esoteric +combinations of BitsPerSample, photometric interpretation, +block organization and planar configuration.

    + +

    The generated images are stripped images with four +samples per pixel (red, green, blue and alpha) or if the +−n flag is used, three samples per pixel (red, +green, and blue). The resulting images are always planar +configuration contiguous. For this reason, this program is a +useful utility for transform exotic TIFF files into a form +ingestible by almost any TIFF supporting software.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Specify a compression scheme to use when writing image +data: −c none for no compression (the default), +−c packbits for the PackBits compression +algorithm, −c zip for the Deflate compression +algorithm, −c jpeg for the JPEG compression +algorithm, and −c lzw for Lempel-Ziv & +Welch.

    +
    +
    + +

    −r

    +
    + +

    Write data with a specified number of rows per strip; by +default the number of rows/strip is selected so that each +strip is approximately 8 kilobytes.

    +
    +
    + +

    −b

    +
    + +

    Process the image one block (strip/tile) at a time +instead of by reading the whole image into memory at once. +This may be necessary for very large images on systems with +limited RAM.

    +
    +
    + +

    −n

    +
    + +

    Drop the alpha component from the output file, producing +a pure RGB file. Currently this does not work if the +−b flag is also in effect.

    +
    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiff2bw(1), TIFFReadRGBAImage(3t), +libtiff(3)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcmp.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcmp.1.html new file mode 100644 index 0000000..acd2e90 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcmp.1.html @@ -0,0 +1,156 @@ + + + + + + +TIFFCMP + + + +

    TIFFCMP

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffcmp − compare two TIFF files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffcmp [ options ] file1.tif +file2.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Tiffcmp compares the tags and data in two files +created according to the Tagged Image File Format, Revision +6.0. The schemes used for compressing data in each file are +immaterial when data are compared−data are compared on +a scanline-by-scanline basis after decompression. Most +directory tags are checked; notable exceptions are: +GrayResponseCurve, ColorResponseCurve, and +ColorMap tags. Data will not be compared if any of +the BitsPerSample, SamplesPerPixel, or +ImageWidth values are not equal. By default, +tiffcmp will terminate if it encounters any +difference.

    +
    + +

    OPTIONS

    + + + + + + + + +
    + +

    −l

    +
    + +

    List each byte of image data that differs between the +files.

    +
    +
    + + + + + +
    +

    −z number

    + + + + + +
    +

    List specified number of image data bytes that differs +between the files.

    +
    + + + + + + + + +
    + +

    −t

    +
    + +

    Ignore any differences in directory tags.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    Tags that are not recognized by the library are not +compared; they may also generate spurious diagnostics.

    + +

    The image data of tiled files is not compared, since the +TIFFReadScanline() function is used. An error will be +reported for tiled files.

    + +

    The pixel and/or sample number reported in differences +may be off in some exotic cases.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffcp(1), +tiffmedian(1), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcp.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcp.1.html new file mode 100644 index 0000000..4c7fcb6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcp.1.html @@ -0,0 +1,536 @@ + + + + + + +TIFFCP + + + +

    TIFFCP

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +EXAMPLES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffcp − copy (and possibly convert) a +TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffcp [ options ] src1.tif ... srcN.tif +dst.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffcp combines one or more files created +according to the Tag Image File Format, Revision 6.0 into a +single TIFF file. Because the output file may +be compressed using a different algorithm than the input +files, tiffcp is most often used to convert between +different compression schemes.

    + +

    By default, tiffcp will copy all the understood +tags in a TIFF directory of an input file to +the associated directory in the output file.

    + +

    tiffcp can be used to reorganize the storage +characteristics of data in a file, but it is explicitly +intended to not alter or convert the image data content in +any way.

    +
    + +

    OPTIONS

    + + + + + +
    +

    −b image

    + + + + + +
    +

    subtract the following monochrome image from all others +processed. This can be used to remove a noise bias from a +set of images. This bias image is typically an image of +noise the camera saw with its shutter closed.

    +
    + + + + + + + + + + + + + + + + + + + + +
    + +

    −B

    +
    + +

    Force output to be written with Big-Endian byte order. +This option only has an effect when the output file is +created or overwritten and not when it is appended to.

    +
    +
    + +

    −C

    +
    + +

    Suppress the use of ‘‘strip +chopping’’ when reading images that have a +single strip/tile of uncompressed data.

    +
    +
    + +

    −c

    +
    + +

    Specify the compression to use for data written to the +output file: none for no compression, packbits +for PackBits compression, lzw for Lempel-Ziv & +Welch compression, jpeg for baseline JPEG +compression, zip for Deflate compression, g3 +for CCITT Group 3 (T.4) compression, and g4 for CCITT +Group 4 (T.6) compression. By default tiffcp will +compress data according to the value of the +Compression tag found in the source file.

    +
    +
    + + + + + +
    +

    The CCITT Group 3 and Group 4 compression +algorithms can only be used with bilevel data.

    + +

    Group 3 compression can be specified together with +several T.4-specific options: 1d for 1-dimensional +encoding, 2d for 2-dimensional encoding, and +fill to force each encoded scanline to be zero-filled +so that the terminating EOL code lies on a byte boundary. +Group 3-specific options are specified by appending a +‘‘:’’-separated list to the +‘‘g3’’ option; e.g. −c +g3:2d:fill to get 2D-encoded data with byte-aligned EOL +codes.

    + +

    LZW compression can be specified together +with a predictor value. A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. LZW-specific +options are specified by appending a +‘‘:’’-separated list to the +‘‘lzw’’ option; e.g. −c +lzw:2 for LZW compression with horizontal +differencing.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −f

    +
    + +

    Specify the bit fill order to use in writing output +data. By default, tiffcp will create a new file with +the same fill order as the original. Specifying −f +lsb2msb will force data to be written with the FillOrder +tag set to LSB2MSB, while −f +msb2lsb will force data to be written with the FillOrder +tag set to MSB2LSB.

    +
    +
    + +

    −i

    +
    + +

    Ignore non-fatal read errors and continue processing of +the input file.

    +
    +
    + +

    −l

    +
    + +

    Specify the length of a tile (in pixels). tiffcp +attempts to set the tile dimensions so that no more than 8 +kilobytes of data appear in a tile.

    +
    +
    + +

    −L

    +
    + +

    Force output to be written with Little-Endian byte +order. This option only has an effect when the output file +is created or overwritten and not when it is appended +to.

    +
    +
    + +

    −M

    +
    + +

    Suppress the use of memory-mapped files when reading +images.

    +
    +
    + +

    −p

    +
    + +

    Specify the planar configuration to use in writing image +data that has one 8-bit sample per pixel. By default, +tiffcp will create a new file with the same planar +configuration as the original. Specifying −p +contig will force data to be written with multi-sample +data packed together, while −p separate will +force samples to be written in separate planes.

    +
    +
    + +

    −r

    +
    + +

    Specify the number of rows (scanlines) in each strip of +data written to the output file. By default (or when value +0 is specified), tiffcp attempts to set the +rows/strip that no more than 8 kilobytes of data appear in a +strip. If you specify special value −1 it will +results in infinite number of the rows per strip. The entire +image will be the one strip in that case.

    +
    +
    + +

    −s

    +
    + +

    Force the output file to be written with data organized +in strips (rather than tiles).

    +
    +
    + +

    −t

    +
    + +

    Force the output file to be written with data organized +in tiles (rather than strips). options can be used to force +the resultant image to be written as strips or tiles of +data, respectively.

    +
    +
    + +

    −w

    +
    + +

    Specify the width of a tile (in pixels). tiffcp +attempts to set the tile dimensions so that no more than 8 +kilobytes of data appear in a tile. tiffcp attempts +to set the tile dimensions so that no more than 8 kilobytes +of data appear in a tile.

    +
    +
    + +

    −x

    +
    + +

    Force the output file to be written with PAGENUMBER value +in sequence.

    +
    +
    + + + + + +
    +

    −,=character

    + + + + + +
    +

    substitute character for ‘,’ in +parsing image directory indices in files. This is necessary +if filenames contain commas. Note that −,= with +whitespace immediately following will disable the special +meaning of the ‘,’ entirely. See examples.

    +
    + +

    EXAMPLES

    + + + + + +
    +

    The following concatenates two files and writes the +result using LZW encoding:

    + + + + + +
    +
    tiffcp −c lzw a.tif b.tif result.tif
    +
    +
    + + + + + + +
    +

    To convert a G3 1d-encoded TIFF to a +single strip of G4-encoded data the following might be +used:

    + + + + + +
    +
    tiffcp −c g4 −r 10000 g3.tif g4.tif
    +
    +
    + + + + + + +
    +

    (1000 is just a number that is larger than the number of +rows in the source file.)

    + +

    To extract a selected set of images from a multi-image +TIFF file, the file name may be immediately followed by a +‘,’ separated list of image directory indices. +The first image is always in directory 0. Thus, to copy the +1st and 3rd images of image file +‘‘album.tif’’ to +‘‘result.tif’’:

    + + + + + +
    +
    tiffcp album.tif,0,2 result.tif
    +
    +
    + + + + + + +
    +

    A trailing comma denotes remaining images in sequence. +The following command will copy all image with except the +first one:

    + + + + + +
    +
    tiffcp album.tif,1, result.tif
    +
    +
    + + + + + + +
    +

    Given file ‘‘CCD.tif’’ whose +first image is a noise bias followed by images which include +that bias, subtract the noise from all those images +following it (while decompressing) with the +command:

    + + + + + +
    +
    tiffcp −c none −b CCD.tif CCD.tif,1, result.tif
    +
    +
    + + + + + + +
    +

    If the file above were named +‘‘CCD,X.tif’’, the −,= +option would be required to correctly parse this filename +with image numbers, as follows:

    + + + + + +
    +
    tiffcp −c none −,=% −b CCD,X.tif CCD,X%1%.tif result.tif
    +
    +
    +
    + +

    SEE ALSO

    + + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcmp(1), +tiffmedian(1), tiffsplit(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcrop.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcrop.1.html new file mode 100644 index 0000000..9c1edbb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffcrop.1.html @@ -0,0 +1,684 @@ + + + + + + +TIFFCROP + + + +

    TIFFCROP

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +EXAMPLES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffcrop − copy (and possibly convert and crop or +process) a TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffcrop [ options ] src1.tif ... +srcN.tif dst.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffcrop combines one or more files created +according to the Tag Image File Format, Revision 6.0 into a +single TIFF file. The output file may be +compressed using a different algorithm than the input files. +tiffcrop is most often used to extract portions of an +image for processing with bar code recognizer or OCR +software when that software cannot restrict the region of +interest to a specific portion of the image or to improve +efficiency when the regions of interest must be rotated.

    + +

    By default, tiffcrop will copy all the understood +tags in a TIFF directory of an input file to +the associated directory in the output file.

    + +

    tiffcrop can be used to reorganize the storage +characteristics of data in a file, and it will alter or +convert the image data content as specified at the same +time, unlike tiffcp.

    + +

    tiffcrop will behave exactly like tiffcp if none +of the new options are specified.

    +
    + +

    OPTIONS

    + + + + + +
    +

    −N odd|even|#,#-#,#|last

    + + + + + +
    +

    sequences and ranges of images within file to process. +The words odd or even may be used to specify +all odd or even numbered images. The word last may be +used in place of a number in the sequence to indicate the +final image in the file without knowing how many images +there are. Ranges of images may be specified with a dash and +multiple sets can be indicated by joining them in a +comma-separated list. e.g.. use −N 1,5-7,last +to process the 1st, 5th through 7th, and final image in the +file.

    +
    + + + + + +
    +

    −E top|bottom|left|right

    + + + + + +
    +

    use the top, bottom, left, or right edge as origin +reference for width and length of crop regions. May be +abbreviated to first letter.

    +
    + + + + + +
    +

    −U in|cm|px

    + + + + + +
    +

    units to apply to dimensions for margins and crop +regions. Inches or centimeters are converted to pixels using +the resolution unit specified in the TIFF file (which +defaults to inches if not specified in the IFD).

    +
    + + + + + +
    +

    −m #,#,#,#

    + + + + + +
    +

    margins to be removed from the image. The order must be +top, left, bottom, right with only commas separating the +elements of the list. Margins are scaled according to the +current units and removed before any other extractions are +computed. Capital M was in use.

    +
    + + + + + + + + + + + + + + +
    + +

    −X #

    +
    + +

    horizontal (X-axis) dimension of a region to extract +relative to the specified origin reference. If the origin is +the top or bottom edge, the X axis value will be assumed to +start at the left edge.

    +
    +
    + +

    −Y #

    +
    + +

    vertical (Y-axis) dimension of a region to extract +relative to the specified origin reference. If the origin is +the left or right edge, the Y axis value will be assumed to +start at the top.

    +
    +
    + + + + + +
    +

    −Z #:#,#:#

    + + + + + +
    +

    zones of the image designated as position X of Y equal +sized portions measured from the reference edge, e.g. 1:3 +would be first third of the image starting from the +reference edge minus any margins specified for the confining +edges. Multiple zones can be specified as a comma separated +list but they must reference the same edge. To extract the +top quarter and the bottom third of an image you would use +−Z 1:4,3:3.

    +
    + + + + + +
    +

    −F horiz|vert

    + + + + + +
    +

    flip, i.e. mirror, the image or extracted region +horizontally or vertically.

    +
    + + + + + +
    +

    −R 90|180|270

    + + + + + +
    +

    rotate the image or extracted region 90, 180, or 270 +degrees clockwise.

    +
    + + + + + + + + +
    + +

    −I

    +
    + +

    invert the colorspace values for grayscale and bi-level +images. This would be used to correct negative images that +have incorrect PHOTOMETRIC INTERPRETATION tags. No support +for color images.

    +
    +
    + + + + + +
    +

    −b image

    + + + + + +
    +

    subtract the following monochrome image from all others +processed. This can be used to remove a noise bias from a +set of images. This bias image is typically an image of +noise the camera saw with its shutter closed. Bias image +support is not available with options for cropping, +rotating, or inverting the image.

    +
    + + + + + + + + + + + + + + + + + + + + +
    + +

    −B

    +
    + +

    Force output to be written with Big-Endian byte order. +This option only has an effect when the output file is +created or overwritten and not when it is appended to.

    +
    +
    + +

    −C

    +
    + +

    Suppress the use of ‘‘strip +chopping’’ when reading images that have a +single strip/tile of uncompressed data.

    +
    +
    + +

    −c

    +
    + +

    Specify the compression to use for data written to the +output file: none for no compression, packbits +for PackBits compression, lzw for Lempel-Ziv & +Welch compression, jpeg for baseline JPEG +compression, zip for Deflate compression, g3 +for CCITT Group 3 (T.4) compression, and g4 for CCITT +Group 4 (T.6) compression. By default tiffcrop will +compress data according to the value of the +Compression tag found in the source file.

    +
    +
    + + + + + +
    +

    The CCITT Group 3 and Group 4 compression +algorithms can only be used with bi-level data.

    + +

    Group 3 compression can be specified together with +several T.4-specific options: 1d for 1-dimensional +encoding, 2d for 2-dimensional encoding, and +fill to force each encoded scanline to be zero-filled +so that the terminating EOL code lies on a byte boundary. +Group 3-specific options are specified by appending a +‘‘:’’-separated list to the +‘‘g3’’ option; e.g. −c +g3:2d:fill to get 2D-encoded data with byte-aligned EOL +codes.

    + +

    LZW compression can be specified together +with a predictor value. A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. LZW-specific +options are specified by appending a +‘‘:’’-separated list to the +‘‘lzw’’ option; e.g. −c +lzw:2 for LZW compression with horizontal +differencing.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −f

    +
    + +

    Specify the bit fill order to use in writing output +data. By default, tiffcrop will create a new file +with the same fill order as the original. Specifying +−f lsb2msb will force data to be written with +the FillOrder tag set to LSB2MSB, while +−f msb2lsb will force data to be written with +the FillOrder tag set to MSB2LSB.

    +
    +
    + +

    −i

    +
    + +

    Ignore non-fatal read errors and continue processing of +the input file.

    +
    +
    + +

    −l

    +
    + +

    Specify the length of a tile (in pixels). +tiffcrop attempts to set the tile dimensions so that +no more than 8 kilobytes of data appear in a tile.

    +
    +
    + +

    −L

    +
    + +

    Force output to be written with Little-Endian byte +order. This option only has an effect when the output file +is created or overwritten and not when it is appended +to.

    +
    +
    + +

    −M

    +
    + +

    Suppress the use of memory-mapped files when reading +images.

    +
    +
    + +

    −p

    +
    + +

    Specify the planar configuration to use in writing image +data that has one 8-bit sample per pixel. By default, +tiffcrop will create a new file with the same planar +configuration as the original. Specifying −p +contig will force data to be written with multi-sample +data packed together, while −p separate will +force samples to be written in separate planes.

    +
    +
    + +

    −r

    +
    + +

    Specify the number of rows (scanlines) in each strip of +data written to the output file. By default (or when value +0 is specified), tiffcrop attempts to set the +rows/strip that no more than 8 kilobytes of data appear in a +strip. If you specify special value -1 it will +results in infinite number of the rows per strip. The entire +image will be the one strip in that case.

    +
    +
    + +

    −s

    +
    + +

    Force the output file to be written with data organized +in strips (rather than tiles).

    +
    +
    + +

    −t

    +
    + +

    Force the output file to be written with data organized +in tiles (rather than strips). options can be used to force +the resultant image to be written as strips or tiles of +data, respectively.

    +
    +
    + +

    −w

    +
    + +

    Specify the width of a tile (in pixels). tiffcrop +attempts to set the tile dimensions so that no more than 8 +kilobytes of data appear in a tile. tiffcrop attempts +to set the tile dimensions so that no more than 8 kilobytes +of data appear in a tile.

    +
    +
    + + + + + +
    +

    −,={character}

    + + + + + +
    +

    substitute {character} for ’,’ in parsing +image directory indices in files. This is necessary if +filenames contain commas. Note that ’,=’ with +whitespace immediately following will disable the special +meaning of the ’,’ entirely. See examples.

    +
    + +

    EXAMPLES

    + + + + + +
    +

    The following concatenates two files and writes the +result using LZW encoding:

    + + + + + +
    +
    tiffcrop -c lzw a.tif b.tif result.tif
    +
    +
    + + + + + + +
    +

    To convert a G3 1d-encoded TIFF to a +single strip of G4-encoded data the following might be +used:

    + + + + + +
    +
    tiffcrop -c g4 -r 10000 g3.tif g4.tif
    +
    +
    + + + + + + +
    +

    (1000 is just a number that is larger than the number of +rows in the source file.)

    + +

    To extract a selected set of images from a multi-image +TIFF file use the -N option described above. Thus, to copy +the 1st and 3rd images of image file "album.tif" +to "result.tif":

    + + + + + +
    +
    tiffcrop -N 1,3 album.tif result.tif
    +
    +
    + + + + + + +
    +

    Given file "CCD.tif" whose first image is a +noise bias followed by images which include that bias, +subtract the noise from all those images following it (while +decompressing) with the command:

    + + + + + +
    +
    tiffcrop -c none -b CCD.tif CCD.tif -d 2 result.tif
    +
    +
    + +

    SEE ALSO

    + + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcmp(1), +tiffcp(1), tiffmedian(1), tiffsplit(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdither.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdither.1.html new file mode 100644 index 0000000..5e3cb7c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdither.1.html @@ -0,0 +1,183 @@ + + + + + + +TIFFDITHER + + + +

    TIFFDITHER

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +NOTES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffdither − convert a greyscale image to bilevel +using dithering

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffdither [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffdither converts a single channel 8-bit +greyscale image to a bilevel image using Floyd-Steinberg +error propagation with thresholding.

    +
    + +

    OPTIONS

    + + + + + + + + +
    + +

    −c

    +
    + +

    Specify the compression to use for data written to the +output file: none for no compression, packbits +for PackBits compression, lzw for Lempel-Ziv & +Welch compression, zip for Deflate compression, +g3 for CCITT Group 3 (T.4) compression, and g4 +for CCITT Group 4 (T.6) compression. By default +tiffdither will compress data according to the value +of the Compression tag found in the source file.

    +
    +
    + + + + + +
    +

    The CCITT Group 3 and Group 4 compression +algorithms can only be used with bilevel data.

    + +

    Group 3 compression can be specified together with +several T.4-specific options: 1d for 1-dimensional +encoding, 2d for 2-dimensional encoding, and +fill to force each encoded scanline to be zero-filled +so that the terminating EOL code lies on a byte boundary. +Group 3-specific options are specified by appending a +‘‘:’’-separated list to the +‘‘g3’’ option; e.g. −c +g3:2d:fill to get 2D-encoded data with byte-aligned EOL +codes.

    + +

    LZW compression can be specified together +with a predictor value. A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. LZW-specific +options are specified by appending a +‘‘:’’-separated list to the +‘‘lzw’’ option; e.g. −c +lzw:2 for LZW compression with horizontal +differencing.

    +
    + + + + + + + + + + + + + + +
    + +

    −f

    +
    + +

    Specify the bit fill order to use in writing output +data. By default, tiffdither will create a new file +with the same fill order as the original. Specifying +−f lsb2msb will force data to be written with +the FillOrder tag set to LSB2MSB , +while −f msb2lsb will force data to be written +with the Fill- Order tag set to MSB2LSB +.

    +
    +
    + +

    −t

    +
    + +

    Set the threshold value for dithering. By default the +threshold value is 128.

    +
    +
    + +

    NOTES

    + + + + + +
    +

    The dither algorithm is taken from the +tiffmedian(1) program (written by Paul Heckbert).

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), fax2tiff(1), +tiffinfo(1), tiffcp(1), tiff2bw(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdump.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdump.1.html new file mode 100644 index 0000000..c37d2ee --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffdump.1.html @@ -0,0 +1,145 @@ + + + + + + +TIFFDUMP + + + +

    TIFFDUMP

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffdump − print verbatim information about +TIFF files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffdump [ options ] name ...

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffdump displays directory information from files +created according to the Tag Image File Format, Revision +6.0. The header of each TIFF file (magic +number, version, and first directory offset) is displayed, +followed by the tag contents of each directory in the file. +For each tag, the name, data type, count, and value(s) is +displayed. When the symbolic name for a tag or data type is +known, the symbolic name is displayed followed by it’s +numeric (decimal) value. Tag values are displayed enclosed +in ‘‘<>’’ characters +immediately preceded by the value of the count field. For +example, an ImageWidth tag might be displayed as +‘‘ImageWidth (256) SHORT (3) +1<800>’’.

    + +

    tiffdump is particularly useful for investigating +the contents of TIFF files that +libtiff does not understand.

    +
    + +

    OPTIONS

    + + + + + + + + +
    + +

    −h

    +
    + +

    Force numeric data to be printed in hexadecimal rather +than the default decimal.

    +
    +
    + + + + + +
    +

    −m items

    + + + + + +
    +

    Change the number of indirect data items that are +printed. By default, this will be 24.

    +
    + + + + + +
    +

    −o offset

    + + + + + +
    +

    Dump the contents of the IFD at the a +particular file offset. The file offset may be specified +using the usual C-style syntax; i.e. a leading +‘‘0x’’ for hexadecimal and a leading +‘‘0’’ for octal.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffinfo(1), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffgt.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffgt.1.html new file mode 100644 index 0000000..5a04996 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffgt.1.html @@ -0,0 +1,551 @@ + + + + + + +TIFFGT + + + +

    TIFFGT

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffgt − display an image stored in a +TIFF file (Silicon Graphics version)

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffgt [ options ] input.tif ...

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffgt displays one or more images stored using +the Tag Image File Format, Revision 6.0. Each image is +placed in a fixed size window that the user must position on +the display (unless configured otherwise through X +defaults). If the display has fewer than 24 bitplanes, or if +the image does not warrant full color, then +RGB color values are mapped to the closest +values that exist in the colormap (this is done using the +rgbi routine found in the graphics utility library +−lgutil.)

    + +

    tiffgt correctly handles files with any of the +following characteristics:

    + + + + + + + + + + + + + + + + + + + + + + +
    + +

    BitsPerSample

    +
    + +

    1, 2, 4, 8, 16

    +
    + +

    SamplesPerPixel

    +
    + +

    1, 3, 4 (the 4th sample is ignored)

    +
    + +

    PhotometricInterpretation

    +
    + +

    0 (min-is-white), 1 (min-is-black), 2 (RGB), 3 +(palette), 6 (YCbCr)

    +
    + +

    PlanarConfiguration

    +
    + +

    1 (contiguous), 2 (separate)

    +
    + +

    Orientation

    +
    + +

    1 (top-left), 4 (bottom-left)

    +
    + + + + + +
    +

    Data may be organized as strips or tiles and may be +compressed with any of the compression algorithms supported +by the libtiff(3) library.

    + +

    For palette images (PhotometricInterpretation=3), +tiffgt inspects the colormap values and assumes +either 16-bit or 8-bit values according to the maximum +value. That is, if no colormap entry greater than 255 is +found, tiffgt assumes the colormap has only 8-bit +values; otherwise it assumes 16-bit values. This inspection +is done to handle old images written by previous (incorrect) +versions of libtiff.

    + +

    tiffgt can be used to display multiple images +one-at-a-time. The left mouse button switches the display to +the first image in the next file in the list of files +specified on the command line. The right mouse button +switches to the first image in the previous file in +the list. The middle mouse button causes the first image in +the first file specified on the command line to be +displayed. In addition the following keyboard commands are +recognized:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    b

    +
    + +

    Use a PhotometricInterpretation of MinIsBlack in +displaying the current image.

    +
    +
    + +

    l

    +
    + +

    Use a FillOrder of lsb-to-msb in decoding the +current image.

    +
    +
    + +

    m

    +
    + +

    Use a FillOrder of msb-to-lsb in decoding the +current image.

    +
    +
    + +

    c

    +
    + +

    Use a colormap visual to display the current image.

    +
    +
    + +

    r

    +
    + +

    Use a true color (24-bit RGB) visual to display the +current image.

    +
    +
    + +

    w

    +
    + +

    Use a PhotometricInterpretation of MinIsWhite in +displaying the current image.

    +
    +
    + +

    W

    +
    + +

    Toggle (enable/disable) display of warning messages from +the TIFF library when decoding images.

    +
    +
    + +

    E

    +
    + +

    Toggle (enable/disable) display of error messages from +the TIFF library when decoding images.

    +
    +
    + +

    z

    +
    + +

    Reset all parameters to their default settings +(FillOrder, PhotometricInterpretation, +handling of warnings and errors).

    +
    +
    + +

    PageUp

    +
    + +

    Display the previous image in the current file or the +last image in the previous file.

    +
    +
    + + + + + +
    +

    PageDown

    + + + + + +
    +

    Display the next image in the current file or the first +image in the next file.

    +
    + + + + + + + + + + + + + + +
    + +

    Home

    +
    + +

    Display the first image in the current file.

    +
    +
    + +

    End

    +
    + +

    Display the last image in the current file +(unimplemented).

    +
    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Force image display in a colormap window.

    +
    +
    + +

    −d

    +
    + +

    Specify an image to display by directory number. By +default the first image in the file is displayed. +Directories are numbered starting at zero.

    +
    +
    + +

    −e

    +
    + +

    Enable reporting of error messages from the +TIFF library. By default tiffgt +silently ignores images that cannot be read.

    +
    +
    + +

    −f

    +
    + +

    Force tiffgt to run as a foreground process. By +default tiffgt will place itself in the background +once it has opened the requested image file.

    +
    +
    + +

    −l

    +
    + +

    Force the presumed bit ordering to be LSB +to MSB.

    +
    +
    + +

    −m

    +
    + +

    Force the presumed bit ordering to be MSB +to LSB.

    +
    +
    + +

    −o

    +
    + +

    Specify an image to display by directory offset. By +default the first image in the file is displayed. +Directories offsets may be specified using C-style syntax; +i.e. a leading ‘‘0x’’ for +hexadecimal and a leading ‘‘0’’ for +octal.

    +
    +
    + +

    −p

    +
    + +

    Override the value of the +PhotometricInterpretation tag; the parameter may be +one of: miniswhite, minisblack, rgb, +palette, mask, separated, ycbcr, +and cielab.

    +
    +
    + +

    −r

    +
    + +

    Force image display in a full color window.

    +
    +
    + +

    −s

    +
    + +

    Stop on the first read error. By default all errors in +the input data are ignored and tiffgt does it’s +best to display as much of an image as possible.

    +
    +
    + +

    −w

    +
    + +

    Enable reporting of warning messages from the +TIFF library. By default tiffgt +ignores warning messages generated when reading an +image.

    +
    +
    + +

    −v

    +
    + +

    Place information in the title bar describing what type +of window (full color or colormap) is being used, the name +of the input file, and the directory index of the image (if +non-zero). By default, the window type is not shown in the +title bar.

    +
    +
    + +

    BUGS

    + + + + + +
    +

    Images wider and taller than the display are silently +truncated to avoid crashing old versions of the window +manager.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffdump(1), tiffinfo(1), tiffcp(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffinfo.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffinfo.1.html new file mode 100644 index 0000000..d3a013c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffinfo.1.html @@ -0,0 +1,196 @@ + + + + + + +TIFFINFO + + + +

    TIFFINFO

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffinfo − print information about +TIFF files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffinfo [ options ] input.tif +...

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Tiffinfo displays information about files created +according to the Tag Image File Format, Revision 6.0. By +default, the contents of each TIFF directory +in each file is displayed, with the value of each tag shown +symbolically (where sensible).

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    −c

    +
    + +

    Display the colormap and color/gray response curves, if +present.

    +
    +
    + +

    −D

    +
    + +

    In addition to displaying the directory tags, read and +decompress all the data in each image (but not display +it).

    +
    +
    + +

    −d

    +
    + +

    In addition to displaying the directory tags, print each +byte of decompressed data in hexadecimal.

    +
    +
    + +

    −j

    +
    + +

    Display any JPEG -related tags that are +present.

    +
    +
    + +

    −o

    +
    + +

    Set the initial TIFF directory according +to the specified file offset. The file offset may be +specified using the usual C-style syntax; i.e. a leading +‘‘0x’’ for hexadecimal and a leading +‘‘0’’ for octal.

    +
    +
    + +

    −s

    +
    + +

    Display the offsets and byte counts for each data strip +in a directory.

    +
    +
    + +

    −z

    +
    + +

    Enable strip chopping when reading image data.

    +
    +
    + +

    −#

    +
    + +

    Set the initial TIFF directory to +#.

    +
    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffcp(1), tiffcmp(1), +tiffmedian(1), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffmedian.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffmedian.1.html new file mode 100644 index 0000000..7831051 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffmedian.1.html @@ -0,0 +1,183 @@ + + + + + + +TIFFMEDIAN + + + +

    TIFFMEDIAN

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +NOTES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffmedian − apply the median cut algorithm to data +in a TIFF file

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffmedian [ options ] input.tif +output.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffmedian applies the median cut algorithm to an +RGB image in input.tif to generate a +palette image that is written to output.tif. The +generated colormap has, by default, 256 entries. The image +data is quantized by mapping each pixel to the closest color +values in the colormap.

    +
    + +

    OPTIONS

    + + + + + + + + +
    + +

    −c

    +
    + +

    Specify the compression to use for data written to the +output file: none for no compression, packbits +for PackBits compression, lzw for Lempel-Ziv & +Welch compression, and zip for Deflate compression. +By default tiffmedian will compress data according to +the value of the Compression tag found in the source +file.

    +
    +
    + + + + + +
    +

    LZW compression can be specified together +with a predictor value. A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. LZW-specific +options are specified by appending a +‘‘:’’-separated list to the +‘‘lzw’’ option; e.g. −c +lzw:2 for LZW compression with horizontal +differencing.

    +
    + + + + + + + + + + + + + + + + + + + + +
    + +

    −C

    +
    + +

    Specify the number of entries to use in the generated +colormap. By default all 256 entries/colors are used.

    +
    +
    + +

    −f

    +
    + +

    Apply Floyd-Steinberg dithering before selecting a +colormap entry.

    +
    +
    + +

    −r

    +
    + +

    Specify the number of rows (scanlines) in each strip of +data written to the output file. By default, +tiffmedian attempts to set the rows/strip that no +more than 8 kilobytes of data appear in a strip.

    +
    +
    + +

    NOTES

    + + + + + +
    +

    This program is derived from Paul Heckbert’s +median program.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    pal2rgb(1), tiffinfo(1), tiffcp(1), +tiffcmp(1), libtiff(3TIFF)

    + +

    Color Image Quantization for Frame Buffer Display, +Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307.

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffset.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffset.1.html new file mode 100644 index 0000000..7192d6e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffset.1.html @@ -0,0 +1,176 @@ + + + + + + +TIFFSET + + + +

    TIFFSET

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +EXAMPLES
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffset − set a field in a TIFF +header

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffset [ options ] filename.tif

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    Tiffset sets the value of a TIFF +header to a specified value.

    +
    + +

    OPTIONS

    + + + + + +
    +

    −s tagnumber [ count ] +value ...

    + + + + + +
    +

    Set the value of the named tag to the value or values +specified.

    +
    + + + + + +
    +

    −sf tagnumber filename

    + + + + + +
    +

    Set the value of the tag to the contents of filename. +This option is supported for ASCII tags only.

    +
    + +

    EXAMPLES

    + + + + + +
    +

    The following example sets the image description tag +(270) of a.tif to the contents of the file descrip:

    + + + + + +
    +
    tiffset −sf 270 descrip a.tif
    +
    +
    + + + + + + +
    +

    The following example sets the artist tag (315) of a.tif +to the string +‘‘Anonymous’’:

    + + + + + +
    +
    tiffset −s 305 Anonymous a.tif
    +
    +
    + + + + + + +
    +

    This example sets the resolution of the file a.tif to 300 +dpi:

    + + + + + +
    +
    tiffset −s 296 2 a.tif
    +tiffset −s 282 300.0 a.tif
    +tiffset −s 283 300.0 a.tif
    +
    +
    + +

    SEE ALSO

    + + + + + + +
    +

    tiffdump(1), tiffinfo(1), tiffcp(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsplit.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsplit.1.html new file mode 100644 index 0000000..4de5c81 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsplit.1.html @@ -0,0 +1,102 @@ + + + + + + +TIFFSPLIT + + + +

    TIFFSPLIT

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffsplit − split a multi-image TIFF +into single-image TIFF files

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffsplit src.tif [ prefix ]

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffsplit takes a multi-directory (page) +TIFF file and creates one or more +single-directory (page) TIFF files from it. +The output files are given names created by concatenating a +prefix, a lexically ordered suffix in the range +[aaa-zzz], the suffix .tif (e.g. +xaaa.tif, xaab.tif, xzzz.tif). If a +prefix is not specified on the command line, the default +prefix of x is used.

    +
    + +

    OPTIONS

    + + + + + +
    +

    None.

    +
    + +

    BUGS

    + + + + + +
    +

    Only a select set of ‘‘known +tags’’ is copied when splitting.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    tiffcp(1), tiffinfo(1), +libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsv.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsv.1.html new file mode 100644 index 0000000..f9921a4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/man/tiffsv.1.html @@ -0,0 +1,207 @@ + + + + + + +TIFFSV + + + +

    TIFFSV

    +NAME
    +SYNOPSIS
    +DESCRIPTION
    +OPTIONS
    +NOTE
    +BUGS
    +SEE ALSO
    + +
    + +

    NAME

    + + + + + +
    +

    tiffsv − save an image from the framebuffer in a +TIFF file (Silicon Graphics version)

    +
    + +

    SYNOPSIS

    + + + + + +
    +

    tiffsv [ options ] output.tif [ +x1 x2 y1 y2 ]

    +
    + +

    DESCRIPTION

    + + + + + +
    +

    tiffsv saves all or part of the framebuffer in a +file using the Tag Image File Format, Revision 6.0. By +default, the image is saved with data samples packed +(PlanarConfiguration=1), compressed with the +Lempel-Ziv & Welch algorithm (Compression=5), and +with each strip no more than 8 kilobytes. These +characteristics can be overridden, or explicitly specified +with the options described below.

    +
    + +

    OPTIONS

    + + + + + + + + + + + + + + +
    + +

    −b

    +
    + +

    Save the image as a greyscale image as if it were +processed by tiff2bw(1). This option is included for +compatibility with the standard scrsave(6D) +program.

    +
    +
    + +

    −c

    +
    + +

    Specify the compression to use for data written to the +output file: none for no compression, packbits +for PackBits compression, jpeg for baseline JPEG +compression, zip for Deflate compression, and +lzw for Lempel-Ziv & Welch compression +(default).

    +
    +
    + + + + + +
    +

    LZW compression can be specified together +with a predictor value. A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. LZW-specific +options are specified by appending a +‘‘:’’-separated list to the +‘‘lzw’’ option; e.g. −c +lzw:2 for LZW compression with horizontal +differencing.

    +
    + + + + + + + + + + + + + + +
    + +

    −p

    +
    + +

    Specify the planar configuration to use in writing image +data. By default, tiffsv will create a new file with +the data samples packed contiguously. Specifying −p +contig will force data to be written with multi-sample +data packed together, while −p separate will +force samples to be written in separate planes.

    +
    +
    + +

    −r

    +
    + +

    Specify the number of rows (scanlines) in each strip of +data written to the output file. By default, tiffsv +attempts to set the rows/strip that no more than 8 kilobytes +of data appear in a strip.

    +
    +
    + +

    NOTE

    + + + + + +
    +

    Except for the use of TIFF, this program +is equivalent to the standard scrsave program. This +means, for example, that you can use it in conjunction with +the standard icut program simply by creating a link +called scrsave, or by creating a shell script called +scrsave that invokes tiffgt with the +appropriate options.

    +
    + +

    BUGS

    + + + + + +
    +

    If data are saved compressed and in separate planes, then +the rows in each strip is silently set to one to avoid +limitations in the libtiff(3TIFF) library.

    +
    + +

    SEE ALSO

    + + + + + +
    +

    scrsave(6D) pal2rgb(1), tiffdump(1), +tiffgt(1), tiffinfo(1), tiffcp(1), +tiffmedian(1), libtiff(3TIFF)

    + +

    Libtiff library home page: +http://www.remotesensing.org/libtiff/

    +
    +
    + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/misc.html b/thirdparty/LibTIFF/tiff-4.0.3/html/misc.html new file mode 100644 index 0000000..aed91a9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/misc.html @@ -0,0 +1,116 @@ + + + +Acknowledgments and Other Issues + + + + +

    + +Acknowledgments and Other Issues +

    + +

    +Silicon Graphics has seen fit to allow us to give this work away. It +is free. There is no support or guarantee of any sort as to its +operations, correctness, or whatever. If you do anything useful with +all or parts of it you need to honor the copyright notices. It would +also be nice to be acknowledged.

    + +
    + +

    Acknowledgements

    + +The libtiff software was written by Sam Leffler while working for +Silicon Graphics.

    + +The LZW algorithm is derived from the compress program (the proper attribution +is included in the source code). The Group 3 fax stuff originated as code +from Jef Poskanzer, but has since been rewritten several times. The latest +version uses an algorithm from Frank Cringle -- consult +libtiff/mkg3states.c and libtiff/tif_fax3.h for further +information. The JPEG support was written by Tom Lane and is dependent on the +excellent work of Tom Lane and the Independent JPEG Group (IJG) who distribute +their work under friendly licensing similar to this software. Joris Van Damme +implemented the robust Old JPEG decoder (as included in libtiff since version +3.9.0, there was another Old JPEG module in older releases, which was +incomplete and unsuitable for many existing images of that format). JBIG +module was written by Lee Howard and depends on JBIG library from the Markus +Kuhn. Many other people have by now helped with bug fixes and code; a few of +the more persistent contributors have been: + +

    +    Bjorn P. Brox
    +    Dan McCoy
    +    J.T. Conklin                
    +    Richard Minner
    +    Frank D. Cringle        
    +    Richard Mlynarik
    +    Soren Pingel Dalsgaard  
    +    Niles Ritter
    +    Steve Johnson           
    +    Karsten Spang
    +    Tom Lane               
    +    Peter Smith
    +    Brent Roman            
    +    Mike Welles
    +    Frank Warmerdam
    +    Greg Ward
    +    Stanislav Brabec        
    +    Roman Shpount
    +    Peter Skarpetis        
    +    Arvan Pritchard
    +    Bernt Herd             
    +    Joseph Orost
    +    Phil Beffery           
    +    Ivo Penzar
    +    Francois Dagand        
    +    Albert Chin-A-Young
    +    Bruce A. Mallett
    +    Dwight Kelly
    +    Andrey Kiselev
    +    Ross Finlayson
    +    Dmitry V. Levin
    +    Bob Friesenhahn
    +    Lee Howard
    +    Joris Van Damme
    +    Tavis Ormandy
    +    Richard Nolde
    +
    + +(my apology to anyone that was inadvertently not listed.) + +

    Use and Copyright

    + +

    +Copyright (c) 1988-1997 Sam Leffler
    +Copyright (c) 1991-1997 Silicon Graphics, Inc.
    +
    +Permission to use, copy, modify, distribute, and sell this software and 
    +its documentation for any purpose is hereby granted without fee, provided
    +that (i) the above copyright notices and this permission notice appear in
    +all copies of the software and related documentation, and (ii) the names of
    +Sam Leffler and Silicon Graphics may not be used in any advertising or
    +publicity relating to the software without the specific, prior written
    +permission of Sam Leffler and Silicon Graphics.
    +
    +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
    +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
    +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
    +
    +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
    +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
    +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
    +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
    +OF THIS SOFTWARE.
    +
    + +

    +


    + + +Last updated: $Date: 2007/02/24 15:47:04 $ + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/support.html b/thirdparty/LibTIFF/tiff-4.0.3/html/support.html new file mode 100644 index 0000000..f6f5d60 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/support.html @@ -0,0 +1,655 @@ + + + + TIFF 6.0 Specification Coverage + + + + + + + + + + +
    +

    TIFF 6.0 Specification Coverage

    +

    + The library is capable of dealing with images that are written to + follow the 5.0 or 6.0 TIFF spec. There is also considerable support + for some of the more esoteric portions of the 6.0 TIFF spec. +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Core requirements +

    + Both "MM" and "II" byte orders are handled. + Both packed and separated planar configuration of samples. + Any number of samples per pixel (memory permitting). + Any image width and height (memory permitting). + Multiple subfiles can be read and written. + Editing is not supported in that related subfiles (e.g. + a reduced resolution version of an image) are not automatically + updated. +

    +

    + Tags handled: ExtraSamples, ImageWidth, + ImageLength, NewSubfileType, ResolutionUnit. + Rowsperstrip, StripOffsets, StripByteCounts, + XResolution, YResolution +

    +
    Tiled ImagesTileWidth, TileLength, TileOffsets, + TileByteCounts
    Image Colorimetry InformationWhitePoint, PrimaryChromaticities, TransferFunction, + ReferenceBlackWhite
    Class B for bilevel imagesSamplesPerPixel = 1
    + BitsPerSample = 1
    + Compression = 1 (none), 2 (CCITT 1D), or 32773 (PackBits)
    + PhotometricInterpretation = 0 (Min-is-White), 1 (Min-is-Black)
    Class G for grayscale imagesSamplesPerPixel = 1
    + BitsPerSample = 4, 8
    + Compression = 1 (none) 5 (LZW)
    + PhotometricInterpretation = 0 (Min-is-White), 1 (Min-is-Black)
    Class P for palette color imagesSamplesPerPixel = 1
    + BitsPerSample = 1-8
    + Compression = 1 (none) 5 (LZW)
    + PhotometricInterpretation = 3 (Palette RGB)
    + ColorMap
    Class R for RGB full color imagesSamplesPerPixel = 3
    + BitsPerSample = <8,8,8>
    + PlanarConfiguration = 1, 2
    + Compression = 1 (none) 5 (LZW)
    + PhotometricInterpretation = 2 (RGB)
    Class F for facsimile(Class B tags plus...)
    + Compression = 3 (CCITT Group 3), 4 (CCITT Group 4)
    + FillOrder = 1 (MSB), 2 (LSB)
    + Group3Options = 1 (2d encoding), 4 (zero fill), 5 (2d+fill)
    + ImageWidth = 1728, 2048, 2482
    + NewSubFileType = 2
    + ResolutionUnit = 2 (Inch), 3 (Centimeter)
    + PageNumber, + XResolution, + YResolution, + Software, + BadFaxLines, + CleanFaxData, + ConsecutiveBadFaxLines, + DateTime, + DocumentName, + ImageDescription, + Orientation
    Class S for separated imagesSamplesPerPixel = 4
    + PlanarConfiguration = 1, 2
    + Compression = 1 (none), 5 (LZW)
    + PhotometricInterpretation = 5 (Separated)
    + InkSet = 1 (CMYK)
    + DotRange, + InkNames, + DotRange, + TargetPrinter
    Class Y for YCbCr imagesSamplesPerPixel = 3
    + BitsPerSample = <8,8,8>
    + PlanarConfiguration = 1, 2
    + Compression = 1 (none), 5 (LZW), 7 (JPEG)
    + PhotometricInterpretation = 6 (YCbCr)
    + YCbCrCoefficients, + YCbCrSubsampling, + YCbCrPositioning
    + (colorimetry info from Appendix H; see above)
    Class "JPEG" for JPEG images (per TTN2)PhotometricInterpretation = 1 (grayscale), 2 (RGB), 5 (CMYK), 6 (YCbCr)
    + (Class Y tags if YCbCr)
    + (Class S tags if CMYK)
    + Compression = 7 (JPEG)
    +

    + In addition, the library supports some optional compression algorithms + that are, in some cases, of dubious value. +

    + + + + + + + + +
    Compression tag valueCompression algorithm
    32766NeXT 2-bit encoding
    32809ThunderScan 4-bit encoding
    32909Pixar companded 11-bit ZIP encoding
    32946PKZIP-style Deflate encoding (experimental)
    34676SGI 32-bit Log Luminance encoding (experimental)
    34677SGI 24-bit Log Luminance encoding (experimental)
    +
    +

    + Note that there is no support for the JPEG-related tags defined + in the 6.0 specification; the JPEG support is based on the post-6.0 + proposal given in TIFF Technical Note #2. +

    + + + + + +
    For more information on the experimental Log Luminance encoding + consult the materials available at + http://www.anyhere.com/gward/pixformat/tiffluv.html.
    +
    +

    + The following table shows the tags that are recognized + and how they are used by the library. If no use is indicated, + then the library reads and writes the tag, but does not use it internally. +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tag NameValueR/WLibrary's Use (Comments)
    NewSubFileType254R/Wnone (called SubFileType in <tiff.h>)
    SubFileType255R/Wnone (called OSubFileType in <tiff.h>)
    ImageWidth256R/Wlots
    ImageLength257R/Wlots
    BitsPerSample258R/Wlots
    Compression259R/Wto select appropriate codec
    PhotometricInterpretation262R/Wlots
    Thresholding263R/W 
    CellWidth264 parsed but ignored
    CellLength265 parsed but ignored
    FillOrder266R/Wcontrol bit order
    DocumentName269R/W 
    ImageDescription270R/W 
    Make271R/W 
    Model272R/W 
    StripOffsets273R/Wdata i/o
    Orientation274R/W 
    SamplesPerPixel277R/Wlots
    RowsPerStrip278R/Wdata i/o
    StripByteCounts279R/Wdata i/o
    MinSampleValue280R/W 
    MaxSampleValue281R/W 
    XResolution282R/W 
    YResolution283R/Wused by Group 3 2d encoder
    PlanarConfiguration284R/Wdata i/o
    PageName285R/W 
    XPosition286R/W 
    YPosition286R/W 
    FreeOffsets288 parsed but ignored
    FreeByteCounts289 parsed but ignored
    GrayResponseUnit290 parsed but ignored
    GrayResponseCurve291 parsed but ignored
    Group3Options292R/Wused by Group 3 codec
    Group4Options293R/W 
    ResolutionUnit296R/Wused by Group 3 2d encoder
    PageNumber297R/W 
    ColorResponseUnit300 parsed but ignored
    TransferFunction301R/W 
    Software305R/W 
    DateTime306R/W 
    Artist315R/W 
    HostComputer316R/W 
    Predictor317R/Wused by LZW codec
    WhitePoint318R/W 
    PrimaryChromacities319R/W 
    ColorMap320R/W 
    TileWidth322R/Wdata i/o
    TileLength323R/Wdata i/o
    TileOffsets324R/Wdata i/o
    TileByteCounts324R/Wdata i/o
    BadFaxLines326R/W 
    CleanFaxData327R/W 
    ConsecutiveBadFaxLines328R/W 
    SubIFD330R/Wsubimage descriptor support
    InkSet332R/W 
    InkNames333R/W 
    DotRange336R/W 
    TargetPrinter337R/W 
    ExtraSamples338R/Wlots
    SampleFormat339R/W 
    SMinSampleValue340R/W 
    SMaxSampleValue341R/W 
    JPEGTables347R/Wused by JPEG codec
    YCbCrCoefficients529R/Wused by TIFFReadRGBAImage support
    YCbCrSubsampling530R/Wtile/strip size calculations
    YCbCrPositioning531R/W 
    ReferenceBlackWhite532R/W 
    Matteing32995Rnone (obsoleted by ExtraSamples tag)
    DataType32996Rnone (obsoleted by SampleFormat tag)
    ImageDepth32997R/Wtile/strip calculations
    TileDepth32998R/Wtile/strip calculations
    StoNits37439R/W 
    +

    + The Matteing and DataType + tags have been obsoleted by the 6.0 + ExtraSamples and SampleFormat tags. + Consult the documentation on the + ExtraSamples tag and Associated Alpha for elaboration. Note however + that if you use Associated Alpha, you are expected to save data that is + pre-multipled by Alpha. If this means nothing to you, check out + Porter & Duff's paper in the '84 SIGGRAPH proceedings: "Compositing Digital + Images". +

    +

    + The ImageDepth + tag is a non-standard, but registered tag that specifies + the Z-dimension of volumetric data. The combination of ImageWidth, + ImageLength, and ImageDepth, + defines a 3D volume of pixels that are + further specified by BitsPerSample and + SamplesPerPixel. The TileDepth + tag (also non-standard, but registered) can be used to specified a + subvolume "tiling" of a volume of data. +

    +

    + The Colorimetry, and CMYK tags are additions that appear in TIFF 6.0. + Consult the TIFF 6.0 specification included in the doc directory + and online. +

    +

    + The JPEG-related tag is specified in + TIFF Technical Note #2 which defines + a revised JPEG-in-TIFF scheme (revised over that appendix that was + part of the TIFF 6.0 specification). +

    +
    +

    + Last updated: $Date: 2005/12/28 06:53:18 $ +

    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/tools.html b/thirdparty/LibTIFF/tiff-4.0.3/html/tools.html new file mode 100644 index 0000000..65e9c0d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/tools.html @@ -0,0 +1,164 @@ + + + + +TIFF Tools Overview + + +

    TIFF +Tools Overview

    +

    This software distribution comes with a small collection of +programs for converting non-TIFF format images to TIFF and for +manipulating and interrogating the contents of TIFF images. Several +of these tools are useful in their own right. Many of them however +are more intended to serve as programming examples for using the +TIFF library.

    +

    Device-dependent Programs

    +There are two device-dependent programs that serve as simple +examples for writing programs to display and save TIFF images. + + + + + + + + + +
    +tiffgt    Display the contents of one or more TIFF images using OpenGL. +The software makes extensive use of the TIFFRGBAImage +facilities described elsewhere.
    tiffsvA program to save all or part of a screen dump on a Silicon +Graphics system. As for tiffgt this code, while written to +use the IRIS GL, can be easily tailored to other devices.
    +

    Device-independent Programs

    +The remaining programs should be device-independent: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    bmp2tiffConvert BMP images to TIFF
    fax2psConvert a Group 3- or Group 4- compressed TIFF to PostScript +that is significantly more compressed than is generated by +tiff2ps (unless tiff2ps writes PS Level II)
    fax2tiffConvert raw Group 3 or Group 4 facsimile data to TIFF
    gif2tiffA quick hack that converts GIF 87a (old) format images to TIFF
    pal2rgbConvert a Palette-style image to a full color RGB image by +applying the colormap
    ppm2tiffA quick hack that converts 8-bit PPM format images to TIFF
    ras2tiffA quick hack that converts Sun rasterfile format images to TIFF +-- it's less than complete
    raw2tiffCreate a TIFF file from raw data
    rgb2ycbcrConvert an RGB, grayscale, or bilevel TIFF image to a YCbCr +TIFF image; it's mainly provided for testing
    sgi2tiffA program to convert SGI image files to TIFF. This program is +only useful on SGI machines as it uses -limage.
    thumbnailCopy a bilevel TIFF to one that includes 8-bit greyscale +"thumbnail images" for each page; it is provided as an example of +how one might use the SubIFD tag (and the library support +for it)
    tiff2bwA simple program to convert a color image to grayscale
    tiff2pdfConvert TIFF images to PDF
    tiff2psConvert TIFF images to PostScript
    tiff2rgbaConvert a TIFF image to RGBA color space
    tiffcmpCompare the contents of two TIFF files (it does not check all +the directory information, but does check all the data)
    tiffcpCopy, concatenate, and convert TIFF images (e.g. switching from +Compression=5 to Compression=1)
    tiffcropProvides selection of images from within one or more multi-image +TIFF files, with orthogonal rotation, mirroring, cropping, and +extraction of multiple sections and exporting to one or more files. +It extends the functionality of tiffcp to support additional bit +depths in strips and tiles and enhances the selection capabilities of +tiffsplit. Bilevel images can be inverted and images may be split into +segments to fit on multiple /pages/ (standard paper sizes), plus other +functions described in the tiffcrop man page
    tiffditherDither a b&w image into a bilevel image (suitable for use +in creating fax files)
    tiffdumpDisplay the verbatim contents of the TIFF directory in a file +(it's very useful for debugging bogus files that you may get from +someone that claims they support TIFF)
    tiffinfoDisplay information about one or more TIFF files.
    tiffmedianA version of Paul Heckbert's median cut program that reads an +RGB TIFF image, and creates a TIFF palette file as a result
    tiffsetSet a field in a TIFF header
    tiffsplitCreate one or more single-image files from a (possibly) +multi-image file
    +

    Check out the manual pages for details about the above +programs.

    +
    +Last updated: $Date: 2009-10-28 22:13:37 $ + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta007.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta007.html new file mode 100644 index 0000000..c535d27 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta007.html @@ -0,0 +1,112 @@ + + + +Changes in TIFF v3.4beta007 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • bit order was corrected for Pentium systems +
    • a new define, HOST_BIGENDIAN, was added for code that + wants to statically use information about native cpu byte order +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • the G3/G4 decoder was replaced by a new one that is faster and + has smaller state tables +
    • Niles Ritter's client tag extension hooks were added +
    • a new routine TIFFCurrentDirOffset was added for + applications that want to find out the file offset of a TIFF directory +
    • the calculation of the number of strips in an image was corected + for images with certain esoteric configurations +
    • a potential memory leak (very unlikely) was plugged +
    • the TIFFReadRGBAImage support was completely rewritten + and new, more flexible support was added for reading images into + a fixed-format raster +
    • YCbCr to RGB conversion done in the TIFFReadRGBAImage support + was optimized +
    • a bug in JPEG support calculation of strip size was corrected +
    • the LZW decoder was changed to initialize the code table to zero + to lessen potential problems that arise when invalid data is decoded +
    • tiffcomp.h is now aware of OS/2 +
    • some function prototypes in tiffio.h and tiffiop.h + that contained parameter + names have been changed to avoid complaints from certain compilers +
    + +


    + +CHANGES IN THE PORTABILITY SUPPORT: + +
      +
    • Makefile.in has been corrected to use the parameters + chosen by the configure script +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fax2ps has been rewritten and moved over from the user + contributed software +
    • an uninitialized variable in pal2rgb has been fixed +
    • ras2tiff now converts 24-bit RGB raster data so that + samples are written in the proper order +
    • tiff2ps has been updated to include fixes + and enhancements from Alberto Accomazzi +
    • tiffcp now has a -o option to select a directory + by file offset +
    • tiffinfo is now capable of displaying the raw undecoded + image data in a file +
    • tiffgt has been rewritten to use the new TIFFRGBAImage + support and to handle multiple files +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta016.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta016.html new file mode 100644 index 0000000..22f185f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta016.html @@ -0,0 +1,122 @@ + + + +Changes in TIFF v3.4beta016 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • support was added for configuring the Deflate codec +
    • support was added for the HTML documentation +
    • codecs that are not configured for inclusion in the library + are no longer compiled +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • support was added for registering new codecs external to the library + and for overriding the codecs that are builtin to the library +
    • emulation support for the old DataType tag was improved +
    • suppport was added for the SMinSampleValue + and SMaxSampleValue tags +
    • the library no longer ignores TileWidth and TileLength + tags whose values are not a multiple of 16 (per the spec); this + permits old, improperly written, images to be read +
    • the support for the Predictor tag was placed in a reusable + module so that it can be shared by multiple codecs +
    • experimental compression support was added for the Deflate algorithm + (using the freely available zlib package) +
    • a new routine, TIFFWriteBufferSetup was added a la the + routine TIFFReadBufferSetup +
    • the DSO version of the library is now statically linked with the + JPEG and Deflate libraries; this means applications that link against + the DSO do not also need to link against these ancillary libraries +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • all the tools now use common code to process compress-oriented arguments +
    • tiffdump should now compile on a Macintosh with MPW +
    + +


    + +CHANGES IN THE MANUAL PAGES: + +
      +
    • everything was updated +
    + +


    + +CHANGES IN THE DOCUMENTATION: + +
      +
    • everything was updated +
    + +


    + +CHANGES IN CONTRIBUTED SOFTWARE: + +
      +
    • contrib/dbs/xtiff was made to compile +
    • contrib/mac-mpw is new support for compiling the software on + a Macintosh under MPW; consult the documentation + for details +
    • contrib/tags is information on how to use the tag extenion + facilities; consult + contrib/tags/README for details +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta018.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta018.html new file mode 100644 index 0000000..ac1877f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta018.html @@ -0,0 +1,84 @@ + + + +Changes in TIFF v3.4beta018 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • configure now recognizes IRIX 6.x systems +
    • configure now uses ENVOPTS when searching for an ANSI + C compiler; this fixes a problem configuring the software under + HP/UX with the native C compiler +
    • configure now correctly recognizes memory-mapped files are supported + under AIX +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • make install now properly installs the include files +
    • some portability fixes from Bjorn Brox +
    • the G3/G4 codec now warns about decoded rows that are longer than + the image/tile width +
    • changes from Frank Cringle to make the library work with the + gcc-specific bounds checking software +
    • miscellaneous fixes to TIFFPrintDirectory +
    • bug fix to correct a problem where TIFFWriteRawStrip + could not be used to automatically grow an image's length +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fixes from Frank Cringle to update fax2tiff +
    • portability fixes to tiff2bw and tiffcmp +
    • tiffdump now uses the byte swapping routines in the library +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta024.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta024.html new file mode 100644 index 0000000..25a3347 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta024.html @@ -0,0 +1,139 @@ + + + +Changes in TIFF v3.4beta024 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • It is now possible to setup the software to build only the + library; configure reconizes this is the intent when the + VERSION, tiff.alpha, and tif_version.c + files are in the local directory (i.e. ``.'') +
    • configure no longer tries to setup HTML materials +
    • include file directories needed in building the library are now + specified with a DIRS_LIBINC config parameter +
    • configure no longer checks for alternate compilers if CC + is set; if the specified compiler is not found or is not appropriate + the configuration procedure aborts +
    • the port.h file generated by configure is now used only by + the library and as such as have been moved to the libtiff + directory +
    • there is beginning support for building DSO's on systems other than IRIX +
    • configure now verifies the JPEG and zlib directory pathnames by + checking for well-known include files in these directories +
    • configure no longer creates the dist directory needed only + on SGI machines (for building SGI binary distributions) +
    • a bug was fixed whereby configure would incorrectly set + ENVOPTS when building the software with gcc under AIX +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • two new typedefs were added to tiff.h: int8 + and uint8 for signed and unsigned 8-bit quantities, + respectively; these are currently used only by + programs in the tools directory +
    • the BadFaxLines, CleanFaxData, and + ConsecutiveBadFaxLines tags are now supported with + Group 4 compression +
    • byte order is now correctly identified on 64-bit machines +
    • a bug was fixed in the PackBits decoder where input data would + appear short when a no-op run was present +
    • a bug was fixed in calculations with very wide strips +
    • TIFFWriteEncodedStrip and TIFFWriteRawStrip + were extended to support dynamically growing the number of + strips in an image (must set ImageLength prior to + making calls though) +
    • TIFFDefaultTileSize now rounds tile width and height + up to a multiple of 16 pixels, as required by the TIFF 6.0 specification +
    • the file version.h is now built by a new mkversion + program; this was done for portability to non-UNIX systems +
    • support was added for the Acorn RISC OS (from Peter Greenham) +
    • the builtin codec table is now made const when compiling + under VMS so that libtiff can be built as a shared library +
    • support for the PowerPC Mac (from Ruedi Boesch) +
    • support for Window NT/Window 95 (from Scott Wagner) +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • the tools no longer include port.h +
    • various portability fixes; mostly to eliminate implicit assumptions + about how long int32 data types are +
    • PostScript Level II additions to tiff2ps from Bjorn Brox +
    • sgi2tiff now handles RGBA images +
    + +


    + +CHANGES IN THE MANUAL PAGES: + +
      +
    • the documentation has been updated to reflect the current state of + the software +
    • some routines have been moved to different manual pages + to group like-routines together +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • support was added for the Acorn RISC OS (from Peter Greenham) +
    • support for Windows NT/Windows 95 contributed for a previous + version of this software was sort of incorporated (it's broken + right now) (from Scott Wagner) +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta028.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta028.html new file mode 100644 index 0000000..ff7ef69 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta028.html @@ -0,0 +1,146 @@ + + + +Changes in TIFF v3.4beta028 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • a -noninteractive flag was added to configure to + control whether or not it prints and prompts for configuration information +
    • various typos and fixes were made in configure for the the + library-only build support (this and other configure fixes from + Richard Mlynarik <mly@adoc.xerox.com>) +
    • bugs were fixed in the handling of pathnames supplied for external + packages; e.g. DIR_JPEG +
    • the handling of SETMAKE is now done properly +
    • the default prototype function declaration for pow was corrected +
    • a bug was fixed in libtiff/Makefile.in that caused installation + to fail on systems without DSO support +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • Acorn RISC O/S support that was accidentally left out of the + left out of the previous distribution is present (from Peter Greenham) +
    • complaints about unknown and/or unsupported codecs have been + delayed until they are invoked; this permits applications to open + images and look at tags even if the image data is compressed with + an unknown/unsupported compression scheme +
    • bugs in handling unknown tags have been corrected; applications + that use multiple codecs, each with codec-specific tags, no longer + generate confusing error messages +
    • a missing pseudo-tag definition in the CCITT G3 codec was fixed + (this problem caused core dumps in the tiffcp program) +
    • pseudo-tags are now treated specially; they are always considered + to be set (i.e. they do not use bits in the FIELD_* bit-vectors). +
    • the use of strip chopping can now be controlled on a per-file basis + through a mode parameter supplied when opening a file (``C'' to + enable strip chopping and ``c'' to disable) +
    • two bugs were fixed in the writing of opposite-endian byte-order + files +
    • support was added for three new fax-related tags registered to + SGI: FaxRecvParams, FaxRecvTime, and FaxSubAddress +
    • the bit order of image data read and written can now be controlled + on a per-file basis through a mode parameter supplied when opening + a file (``B'' to force MSB2LSB bit order, ``L'' for LSB2MSB bit + order, and ``H'' for the bit order of the native CPU) +
    • the byte order of image and tag data written to newly-created files + can now be controlled on a per-file basis through a mode parameter + supplied when openening a file (``b'' to force Big-Endian byte order + and ``l'' to force Little-Endian byte order) +
    • the use memory-mapped files for images opened read-only can now + be controlled on a per-file basis through a mode parameter supplied + when opening a file (``M'' to enable use of memory-mapped files + and ``m'' to disable use) +
    • the use of the WIN32 define in tiffiop.h has + been replaced by __WIN32__ +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fax2ps now does a save and restore + around each page of PostScript; this fixes a problem with VM + overflow when printing a many-page document on some printers +
    • a bug in the handling of 3-channel images by ras2tiff + was fixed +
    • tiffcp has new options to control the byte order of + newly created files: -B for Big-Endian byte order, -L + for Little-Endian byte order; a -M option to disable the + use of memory-mapped files, and a -C option to disable the + use of strip chopping +
    • bugs were fixed in tiffcp's handling of codec-specific tags +
    + +


    + +CHANGES IN THE MANUAL PAGES: + +
      +
    • the TIFFOpen page has been updated to reflect the new + optional open mode parameters +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • contrib/win95 contains information and code from Philippe Tenenhaus + <100423.3705@compuserve.com> + about using the software under Windows 95 +
    • contrib/winnt contains information and code from Dave Dyer + <ddyer@triple-i.com> + about using the software under Windows NT +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta029.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta029.html new file mode 100644 index 0000000..f2a3d3f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta029.html @@ -0,0 +1,86 @@ + + + +Changes in TIFF v3.4beta029 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • configure now relativizes pathname references given in + -L options (as frequently specified when configuring + ancillary packages) +
    • problems related to configuring the software on Ultrix 4.4 have + been corrected +
    • the shell to use in Makefiles and scripts can now be set with the + SCRIPT_SH configuration parameter +
    • comments in config.site now correctly indicate how to setup the + use of ancillary packages +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • mods for building the software on a Mac using the + MetroWerks CodeWarrior compilers +
    • a bug in the CCITT T.4/T.6 decoder was fixed where the last codeword in + a strip/tile might not be decoded; this was seen only when decoding + multi-strip images +
    • a bug in the CCITT RLE codecs was fixed whereby the pseudo tags were not + being properly registered +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • contrib/mac-cw contains information and code from Niles Ritter + <ndr@tazboy.jpl.nasa.gov> + about building the software with the MetroWerks CodeWarrior compilers + on Macintosh systems +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta031.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta031.html new file mode 100644 index 0000000..d5b7eac --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta031.html @@ -0,0 +1,94 @@ + + + +Changes in TIFF v3.4beta031 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • configure now captures significantly more information + in the config.log file and provides more information when + it is unable to setup a configuration +
    • support was added for building shared libraries on more systems: + AIX, HPUX, Solaris, and Linux. +
    • a new configuration parameter LIBCOPTS was added for + passing arguments to the C compiler to use when building only + the library; this is part of the enhanced support for building + shared libraries +
    • include files for optional packages that reside in /usr/include + are now handled correctly +
    • build trees may now be configured using either relative or absolute + pathnames to the source distribution +
    • several new configuration parameters were added, mainly for building + shared libraries: DIST_MAJOR, DIST_MINOR, + DIST_ALPHA, and DSOSUF_VERSION +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • the Deflate support has been revised: it requires version 0.99 of + the zlib software distribution, the output format has changed and + is incompatible with previous versions of this library (each + strip now includes a header read and written by the zlib library) +
    • the codec name printed by the TIFFPrintDirectory routine is now + taken from the codec table instead of from a builtin table; this means + that application-defined codecs are handled correctly +
    • a new symbol was added that contains the library version number; + this can be used to do a compile-time compatibility check of the + library version +
    + +


    + +CHANGES IN THE MANUAL PAGES: + +
      +
    • the creation and installation of manual pages was redone; it now + implements the documented ``configuration scheme'' +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta032.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta032.html new file mode 100644 index 0000000..bc14ef3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta032.html @@ -0,0 +1,90 @@ + + + +Changes in TIFF v3.4beta032 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • various fixups and subtle improvements to configure + from Richard Mlynarik +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • a new codec from Pixar designed for high-resolution color images; + note that this codec is not configured by default +
    • a bug fix for reading tags with a single FLOAT value +
    • change to the TIFFGetField calling convention: + a tag that has a single value of + type DOUBLE is now retrieved by passing a + ``double*'' instead of a + ``double**'' (this change makes the handling of tags with + DOUBLE values identical to the handling of tags with + FLOAT values) +
    • fix to VMS support for the handling of floating point values +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • tiffdump now handles tags with FLOAT and DOUBLE + values +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • updates to the Acorn OS support from Peter Greenham +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta033.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta033.html new file mode 100644 index 0000000..8d8345a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta033.html @@ -0,0 +1,82 @@ + + + +Changes in TIFF v3.4beta033 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • support was added for building the library as a DSO under OSF/1 +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • fixes to the Pixar codec +
    • portability mods for VMS +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fixes to gif2tiff and ppm2tiff for building under MS/DOS +
    • portability mods to fax2ps and ycbcr for VMS +
    + +


    + +CHANGES IN THE CONTRIBUTED SOFTWARE: + +
      +
    • a new package from Alexander Lehmann + for building the library and tools under MS/DOS with DJGPP v2 +
    • updated VMS support from Karsten Spang +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta034.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta034.html new file mode 100644 index 0000000..77d9863 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta034.html @@ -0,0 +1,68 @@ + + + +Changes in TIFF v3.4beta034 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • support was added for building the library as a DSO under NetBSD +
    • a bug was fixed in the DSO support for Linux +
    • the handling of version strings has changed slightly to simplify parsing +
    • a new parameter, TIFFLIBREF, was added to control how the + library is referenced when linking programs in the tools directory +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • DSO creation under Solaris now forces the DSO name with a -h option +
    • the interface to the mkversion program was changed + to eliminate the need to parse files +
    • a bug was fixed in the EOL-detection logic of the T.4/T.6 decoder +
    • ANSI IT8 TIFF/IT tag definitions were added to tiff.h +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta035.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta035.html new file mode 100644 index 0000000..22fb2b8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta035.html @@ -0,0 +1,63 @@ + + + +Changes in TIFF v3.4beta035 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • support was added installing the HTML documentation +
    • support was added for building the library as a DSO under FreeBSD +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • the interface to the mkversion program was restored to + the form used prior to v3.4beta034 +
    • several portability problems for 16-bit systems were fixed +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta036.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta036.html new file mode 100644 index 0000000..e36754d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.4beta036.html @@ -0,0 +1,117 @@ + + + +Changes in TIFF v3.4beta036 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • support was added for building the library as a DSO under HP-UX with + the native C compiler +
    • tools are now built with explicit pathnames for the DSO under IRIX, + Solaris, and Linux +
    • DSO configuration support for Linux was changed to require that + libc.so only be readable (not executable) +
    + +


    + +CHANGES IN LIBTIFF: + +
      +
    • support was add for ICC: NumberOfInks, and ICCProfile +
    • a memory leak caused by doing TIFFSetDirectory(0) was fixed +
    • a bug was fixed whereby certain multi-directory files were not + properly handled when accessed by mapping the data into memory +
    • the strip chopping support is now always compiled + into the library with the default usage controlled by a + STRIPCHOP_DEFAULT configuration parameter +
    • the strip chopping support no longer chops tiled images +
    • all static strings are now const--for shared libraries +
    • the logic for estimating the strip size of images without + a StripByteCounts tag was improved by handling + PlanarContig images differently from PlanarSeparate +
    • a bug was fixed in the G3 codec when converting the Y resolution + of data specified in metric units +
    • a bug was fixed in the G3/G4 decoder for data where lines terminate + with a v0 code +
    • the TIFFRGBAImage support was changed to scale 16-bit colormap + entries more conservatively to avoid problems with applications + that do not generate fully saturated pixel values +
    • the LZW decoder was changed to use a more conservative scheme when + bounds checking the hash table array; this avoids pitfalls with + systems that load objects into memory in unusual locations +
    • a bug was fixed in TIFFPrintDirectory's handling of the + InkNames tag +
    • TIFFPrintDirectory now understands NumberOfInks + and ICC-related tags +
    • the routines for reading image data now provide more useful information + when a read error is encountered +
    • support was added for compiling with Microsoft Visual C++ 4.0 +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • a bug was fixed in pal2rgb's colormap handling +
    • tiff2ps now includes John Wehle's changes for maintaining + the aspect ratio + of images when scaling and for honoring the deadzone on a page when + generating PostScript Level II +
    • tiff2ps does a better job guarding against the mishandling + of greyscale images +
    • tiff2ps now correctly converts X- and Y-resolution values + specified in metric units +
    • tiffdump has a new -m option to control the maximum + number of indirect + data values printed for a tag (by default 24) +
    • tiffdump understands several new tags +
    • tiffdump now shows any terminating null in ASCII strings +
    • tiffinfo now suppresses strip chopping when interpreting an image; + a new -z option has been added to enable strip chopping +
    + + TIFF home page.
    + +
    + +
    +Sam Leffler / sam@engr.sgi.com +Last updated $Date: 1999/08/09 20:21:21 $. +
    + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.1.html new file mode 100644 index 0000000..0c88de9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.1.html @@ -0,0 +1,75 @@ + + + +Changes in TIFF v3.5.1 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • None of consequence +
    + +


    + +CHANGES IN LIBTIFF: + + +
      +
    • Support was added for IPTC Newsphoto metadata (TIFFTAGE_IPTCNEWSPHOTO) +
    • Support was added for photoshop caption handling (TIFFTAG_PHOTOSHOP) +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • Bill Radcliffe's iptcutil was +added to the "contrib" subdirectory . It can convert an IPTC binary +blob to ASCII text and vice-versa. The blob itself can be extracted +from or added to an image with the ImageMagick convert(1) +utility. +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/01/03 01:42:30 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.2.html new file mode 100644 index 0000000..71b486a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.2.html @@ -0,0 +1,108 @@ + + + +Changes in TIFF v3.5.2 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    + +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Corrected alpha versioning. + +
    • Removed distinction between alpha and release targets in Makefile.in. + +
    • Added release.stamp target, which tags cvs tree, and updates + "RELEASE-DATE" + +
    • Added releasediff target, which diffs tree with source as of + date in "RELEASE-DATE" + +
    • Ticked up version to 3.5.2 (alpha 01 -- but I think we'll moving + away from alpha/non-alpha distinctions). + +
    + +


    + +CHANGES IN LIBTIFF: + + +
      +
    • Added IRIX/gcc, and OSF/1 4.x support on behalf of + Albert Chin-A-Young + +
    • Added TIFFReassignTagToIgnore() API on behalf of + Bruce Cameron . Man page still pending. + +
    • pre-remove so link before softlink in LINUXdso action in + libtiff/Makefile.in to avoid failure on LINUXdso builds other than + the first. + +
    • Fixed problem with cvtcmap() in tif_getimage.c modifying the + colormaps owned by the TIFF handle itself when trying to fixup wrong + (eight bit) colormaps. Corrected by maintaining a private copy of + the colormap. + +
    • Added TIFFReadRGBATile()/TIFFReadRGBAStrip() support in + tif_getimage.c. + +
    • Applied "a" mode fix to tif_win32.c/TIFFOpen() as suggested + by Christopher Lawton + +
    • Set O_BINARY for tif_unix.c open() ... used on cygwin for instance. + +
    • Added CYGWIN case in configure. + +
    • Applied Francois Dagand's patch to handle fax decompression bug. + (sizes >= 65536 were failing) +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • Added addtiffo (add overviews to a TIFF file) in contrib. Didn't + put it in tools since part of it is in C++. +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2004/11/26 14:37:20 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.3.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.3.html new file mode 100644 index 0000000..e7910d9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.3.html @@ -0,0 +1,132 @@ + + + +Changes in TIFF v3.5.3 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +The ChangeLog will follow, but please note the most important change: +LZW compression has been removed. +

    +Unisys has the patent on LZW compression and have been very active in +their enforcement of late, demanding payments of $5000 or more from +websites using unlicensed software to create GIF's. They could well +do the same do persons using libtiff to create LZW compressed TIFF +images. +

    +From Burn All GIF's Day: +
    +The catch is that it appears to be difficult or impossible to get a +Unisys license to use LZW in free software that complies with the Open +Source Definition +

    +Unfortunatly, the removal of LZW compression means that saved image size has +grown dramatically. Without a change in the TIFF spec to support +another lossless compression format, this is unavoidable. +

    +The library can use zip for lossless compression, but as this is not +part of the spec, TIFFs using zip compression may not work with other +software +

    +We will be making a patch available that will contain the LZW +compression code for users who have either obtained a license from +Unisys or are willing to risk it. +

    +LZW decompression is unchanged. +

    +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Added zip creation to release makefile target + + +
    + +


    + +CHANGES IN LIBTIFF: + + +
      + +
    • Added html for TIFFWriteTile.3t man page. + +
    • Added some changes to tif_write.c to support rewriting existing + fixed sized tiles and strips. Code mods disabled by default, only + enabled if REWRITE_HACK is defined for now. + +
    • Added TIFFWriteTile.3t man page. + +
    • Added notes on use of makefile.vc in build.html, and fixed + email subscription address. + +
    • Fixed apocalypse-inducing y2k bug in contrib/ras/ras2tiff.c + +
    • Did some casts cleaning up to reduce compiler warnings in tif_fax3.c, + from Bruce Carmeron -- modifications of + changes made by Frank (sun cc still complained on cast). + +
    • fixed various VC++ warnings as suggested by Gilles Vollant + . + +
    • Modified TIFFquery.3t man pages info on TIFFIsByteSwapped() to + not imply applications are responsible for image data swapping. + +
    • HTML-ized the man pages, added to html/man + +
    • Removed LZW Compression to comply with Unisys patent extortion. + +
    • Corrected one remaining 16 -> 32 bit value in tif_fax3.c, + From Ivo Penzar Added patch from Ivo Penzar to have TiffAdvanceDirectory handle + memory mapped files. +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • Fixed apocalypse-inducing y2k bug in contrib/ras/ras2tiff.c +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2004/11/26 14:37:20 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.4.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.4.html new file mode 100644 index 0000000..714621e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.4.html @@ -0,0 +1,88 @@ + + + +Changes in TIFF v3.5.4 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • None + + +
    + +


    + +CHANGES IN LIBTIFF: + + +
      + +
    • Added Pixar tag support. Contributed by Phil Beffery + +
    • Made one more change to tif_dir.c for removal of LZW compression. Also added notice + when LZW compression invoked. + +
    • Fixed bug that caused LZW (non) compression to segfault. Added + warning about LZW compression removed being removed, and why. + +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • Changed default compression in tools to TIFF_PACKBITS, and changed usage descriptions + in tools to reflect removal of LZW compression + +
    • Added nostrip to install in tools/Makefile.in so that debugging + symbols are kept. + +
    • Made Packbits the default compression in tools/tiff2rgba.c instead + of LZW. + + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/01/03 01:45:41 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.5.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.5.html new file mode 100644 index 0000000..20be92f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.5.html @@ -0,0 +1,155 @@ + + + +Changes in TIFF v3.5.5 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • configure: added test for libc6 for linux targets. Bug reported by + Stanislav Brabec + +
    • configure: fixed bugs in sed scripts + (applied sed script s:/@:s;@:;s:/s;;:;: to configure). + fix submitted by Stanislav Brabec + +
    • tools/iptcutil was not in files list, and wasn't being + added to tar archive. Updated Makefile.in. + +
    • Added 3.5 docs to html/Makefile.in. + Thanks to Stanislav Brabec + +
    • Fixed tools/tiffcmp so that stopondiff testing works. + Patch care of Joseph Orost . + +
    • Added fax3sm_winnt.c to distribution list in Makefile.in. + +
    • Added libtiff/libtiff.def to TIFFILES distribution list. +
    + +


    + +CHANGES IN LIBTIFF: + + +
      +
    • tif_fax3.c: Fixed serious bug introduced during the uint16->uint32 + conversion for the run arrays. + +
    • Set td_sampleformat default to SAMPLEFORMAT_UINT instead of + SAMPLEFORMAT_VOID in TIFFDefaultDirectory() in tif_dir.c. + +
    • Added "GetDefaulted" support for TIFFTAG_SAMPLEFORMAT in tif_aux.c. + +
    • Patched tif_fax3.c so that dsp->runs is allocated a bit bigger + to avoid overruns encountered with frle_bug.tif. + + +
    • Modified tif_unix.c to support 2-4GB seeks if USE_64BIT_API is + set to 1, and added default (off) setting in tiffconf.h. This + should eventually be set by the configure script somehow. + + The original work on all these 2-4GB changes was done by + Peter Smith (psmith@creo.com). + +
    • Modified tif_win32.c to support 2-4GB seeks. + +
    • tentatively changed toff_t to be unsigned instead of signed to + facilitate support for 2-4GB files. + +
    • Updated a variety of files to use toff_t. Fixed some mixups + between toff_t and tsize_t. + +
    • Set tif_rawdatasize to zero when freeing raw data buffer in + TIFFWriteDirectory(). + +
    • Enabled "REWRITE_HACK" in tif_write.c by default. + +
    • Fix bug in tif_write.c when switching between reading one directory + and writing to another. + +
    • Made TIFFWriteCheck() public, and added TIFFCreateDirectory() + +
    • Added TIFFmemory(3t) functions to libtiff.def. + +
    • Added libtiff/libtiff.def to TIFFILES distribution list. +
    + +


    + +CHANGES IN THE TOOLS: + +
      +
    • fax2ps: Fixed mixup of width and height in bounding box statement + as per submission by Nalin Dahyabhai . + +
    • fax2ps: Modified printruns to take uint32 instead of uint16. + Patch courtesy of Bernt Herd + + +
    • Largely reimplemented contrib/addtiffo to avoid temp files, + updating the TIFF file in place. Fixed a few other bugs to. + +
    • Altered descriptions in tools to reflect "by default" lzw not supported +
    + +


    + +CHANGES IN THE LZW COMPRESSION KIT +
      +
    • created mangle-src.sh -- sed scripts to munge src into LZW enabled format. Thanks to Stanislav Brabec + +
    • created Makefile + +
    • merged tif_dir.c with current source. + + +
    • Created lzw compression kit, as a new CVS module (libtiff-lzw-compression-kit). + +
    • Updated index.html to note lzw compression kit. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2004/11/26 14:37:20 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.6-beta.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.6-beta.html new file mode 100644 index 0000000..682f845 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.6-beta.html @@ -0,0 +1,185 @@ + + + +Changes in TIFF v3.5.6 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • Added GNULDdso target and switched linux and freebsd to use it. +
    • tools/Makefile.in: Modified to install properly on SGI. +
    • configure: Fixed DSO test for Linux as per patch from + Jan Van Buggenhout . + +
    + +


    + +CHANGES IN LIBTIFF: + + +
      + +
    • tif_dir.c: Clear TIFF_ISTILED flag in TIFFDefaultDirectory + as per http://bugzilla.remotesensing.org/show_bug.cgi?id=18 + from vandrove@vc.cvut.cz. + +
    • Modified tif_packbits.c decoding to avoid overrunning the + output buffer, and to issue a warning if data needs to be + discarded. See http://bugzilla.remotesensing.org/show_bug.cgi?id=18 + +
    • Modified TIFFClientOpen() to emit an error on an attempt to + open a comperessed file for update (O_RDWR/r+) access. This is + because the compressor/decompressor code gets very confused when + the mode is O_RDWR, assuming this means writing only. See + bug http://bugzilla.remotesensing.org/show_bug.cgi?id=13 + +
    • Applied patch for 0x0000 sequences in tif_fax3.h's definition + of EXPAND1D() as per bug 11 (from Roman). + +
    • Fixed tiffcomp.h to avoid win32 stuff if unix #defined, to improve + cygwin compatibility. + +
    • Applied patch from Roman Shpount to tif_fax3.c. This seems to + be a proper fix to the buffer sizing problem. See + http://bugzilla.remotesensing.org/show_bug.cgi?id=11 + +
    • Fixed tif_getimage.c to fix overrun bug with YCbCr images without + downsampling. http://bugzilla.remotesensing.org/show_bug.cgi?id=10 + Thanks to Nick Lamb for reporting the + bug and proving the patch. + +
    • Fixed tif_jpeg.c so avoid destroying the decompressor before + we are done access data thanks to bug report from: + Michael Eckstein . + +
    • tif_open.c: Don't set MMAP for O_RDWR files. + +
    • tif_open.c: Set STRIPCHOP_DEFAULT for O_RDWR as well as O_RDONLY + so that files opened for update can be strip chopped too. + +
    • tif_read.c: fixed up bug with files missing rowsperstrip and + the strips per separation fix done a few weeks ago. + +
    • Tentatively added support for SAMPLEFORMAT_COMPLEXIEEEFP, and + SAMPLEFORMAT_COMPLEXINT. + +
    • index.html, bugs.html: added bugzilla info. + +
    • tif_read.c: fix subtle bug with determining the number of + rows for strips that are the last strip in a separation but + not the last strip of all in TIFFReadEncodedStrip(). + +
    • Applied 16/32 bit fix to tif_fax3.c. Fix supplied by + Peter Skarpetis + +
    • Modified tiffio.h logic with regard to including windows.h. It + won't include it when building with __CYGWIN__. + +
    • README: update to mention www.libtiff.org, don't list Sam's old + email address. + +
    • libtiff/tif_dirread.c: Don't use estimate strip byte count for + one tile/strip images with an offset, and byte count of zero. These + could be "unpopulated" images. + +
    • tif_win32.c: Applied patch to fix overreads and ovverwrites + caught by BoundsChecker. From Arvan Pritchard + (untested). + +
    • tif_getimage.c: Applied patch to silence VC6 warnings. From + Arvan Pritchard + +
    • tif_lzw.c: Applied patch to silence VC6 warnings. From + Arvan Pritchard + +
    • libtiff/tif_apple.c: Applied "Carbon" support patches supplied by + Leonard Rosenthol . May interfere + with correct building on older systems. If so, please let me know. + + +
    + +


    + +CHANGES IN THE TOOLS: + +
      + +
    • tools/rgb2ycbcr.c: fixed output strip size to account for vertical + roundup if rows_per_strip not a multiple of vertical sample size. + +
    • tools/tiffsplit.c: Copy TIFFTAG_SAMPLEFORMAT. + +
    • Modified tiff2bw to ensure portions add to 100%, and that + white is properly recovered. See bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=15 Patch + c/o Stanislav Brabec + +
    + +


    + +CHANGES IN CONTRIB: + +
      + +
    • contrib/addtiffo: Added "averaging" resampling option. + +
    • Added contrib/stream (stream io) code submitted by Avi Bleiweiss. + +
    + +


    + +CHANGES IN THE LZW COMPRESSION KIT +
      + +
    • updated tif_dir.c to reflect changes to no-lzw tif_dir.c + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/03/18 17:12:47 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.7.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.7.html new file mode 100644 index 0000000..528df74 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.5.7.html @@ -0,0 +1,259 @@ + + + +Changes in TIFF v3.5.7 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • libtiff/libtiff.def: Brent Roman submitted new version adding +serveral missing entry points. Also add a few other entry points +later. + +
    • configure, Makefile.in, etc: added support for OPTIMIZER being + set from config.site. +
    • config.guess: updated wholesale to an FSF version apparently + from 1998 (as opposed to 1994). This is mainly inspired by + providing for MacOS X support. + +
    • configure/config.site: modified to check if -lm is needed for + MACHDEPLIBS if not supplied by config.site. Needed for Darwin. +
    • libtiff/tiff.h: Applied hac to try and resolve the problem + with the inttypes.h include file on AIX. (Bug 39) + +
    • configure, *Makefile.in: Various changes to improve configuration + for HP/UX specifically, and also in general. (Bug 40) They include: +
        +
      • Try to handle /usr/bin/sh instead of /bin/sh where necessary. +
      • Upgrade to HP/UX 10.x+ compiler, linker and dso options. +
      • Fixed mmap() test to avoid MMAP_FIXED ... it isn't available on HP +
      • Use -${MAKEFLAGS} in sub makes from makefiles. +
      • Fixed SCRIPT_SH/SHELL handling. +
      +
    • configure: Changes for DSO generation on AIX provided by + John Marquart . + +
    • configure, libtiff/Makefile.in: Modified to build DSOs properly + on Darwin thanks to Robert Krajewski (rpk@alum.mit.edu) and + Keisuke Fujii (fujiik@jlcuxf.kek.jp). + +
    • configure, libtiff/Makefile.in: applied OpenBSD patches as per bug 61. + +
    • Makefile.in: added DESTDIR support as per bug 60. + +
    • libtiff/tif_jpeg.c: Define HAVE_BOOLEAN on windows if RPCNDR.H + has been included. +
    • man/Makefile.in: add TIFFClientOpen link as per debian submitted + bug 66. +
    • libtiff/Makefile.in: Fixed @DSOSUB_VERSION to be @DSOSUF_VERSION@ + in two places. +
    + +


    + + + +CHANGES IN LIBTIFF: + + +
      +
    • tif_fax3.c: keep rw_mode flag internal to fax3 state to remember + whether we are encoding or decoding. This is to ensure graceful + recovery if TIFFClientOpen() discovers an attempt to open a compressed + file for "r+" access, and subsequently close it, as it resets the + tif_mode flag to O_RDONLY in this case to avoid writes, confusing the + compressor's concept of whether it is in encode or decode mode. +
    • tif_luv.c/tiff.h/tiffio.h: + New version of TIFF LogLuv (SGILOG) modules contributed by Greg Ward + (greg@shutterfly.com). He writes: + +
        +
      1. I improved the gamut-mapping function in tif_luv.c for imaginary + colors, because some images were being super-saturated on the input + side and this resulted in some strange color shifts in the output. + +
      2. I added a psuedotag in tiff.h to control random dithering during + LogLuv encoding. This is turned off by default for 32-bit LogLuv and + on for 24-bit LogLuv output. Dithering improves the average color + accuracy over the image. + +
      3. I added a #define for LOG_LUV_PUBLIC, which is enabled by default in + tiffio.h, to expose internal routines for converting between LogLuv and + XYZ coordinates. This is helpful for writing more efficient, + specialized conversion routines, especially for reading LogLuv files. +
      + +
    • libtiff/tif_dirinfo.c: don't declare tiffFieldInfo static on VMS. + +
    • Added TIFFTAG_COPYRIGHT support. +
    • tif_getimage.c: Added support for 16bit minisblack/miniswhite + images in RGBA interface. +
    • libtiff/tif_dirinfo.c: removed duplicate TIFFTAG_PHOTOSHOP as per + bug 44. +
    • libtiff/tif_dirwrite.c: Added support for TIFF_VARIABLE2 in the + case of writing TIFF_BYTE/TIFF_SBYTE fields as per bug 43. + +
    • libtiff/tif_dirinfo.c: Modified the TIFF_BYTE definition for + TIFFTAG_PHOTOSHOP to use a writecount of TIFF_VARIABLE2 (-3) to + force use of uint32 counts instead of short counts. + +
    • libtiff/tif_dirinfo.c: moved pixar and copyright flags to + ensure everything is in order. + +
    • Integrated experimental OJPEG support from Scott Marovich of HP. + +
    • libtiff/tif_open.c: Seek back to zero after failed read, + before writing header. + +
    • libtiff/tiff.h, libtiff/tif_fax3.c: added check for __LP64__ + when checking for 64 bit architectures as per bugzilla bug 67. +
    • libtiff/tif_getimage.c: Use memmove() instead of TIFFmemcpy() + in TIFFReadRGBATile() to avoid issues in cases of overlapping + buffers. See Bug 69 in Bugzilla. +
    • libtiff/tif_getimage.c: Don't complain for CMYK (separated) + images with more than four samples per pixel as per bug 73. + +
    • libtiff/tif_getimage.c: relax handling of contig case where +there are extra samples that are supposed to be ignored as per bug 75. This +should now work for 8bit greyscale or palletted images. + +
    • libtiff/tif_packbits.c: fixed memory overrun error as per bug 77. + +
    • libtiff/tif_getimage.c: Fixed problem with reading strips or +tiles that don't start on a tile boundary. Fix contributed by +Josep Vallverdu (from HP), and further described in bug 47. + +
    • libtif/tif_fax3.c: Removed #ifdef PURIFY logic, and modified to + always use the "safe" version, even if there is a very slight + cost in performance as per bug 54. +
    • libtiff/tif_lzw.c: added dummy LZWSetupEncode() to report an + error about LZW not being available. + +
    • libtiff/tif_dir.c: propagate failure to initialize compression + back from TIFFSetField() as an error status, so applications can + detect failure. + +
    • libtiff/tif_lzw.c: Avoid MS VC++ 5.0 optimization bug as per bug 78. + +
    • libtiff/tif_dirwrite.c: added TIFFRewriteDirectory() function. +Updated TIFFWriteDirectory man page to include TIFFRewriteDirectory. + +
    • libtiff/tiff.h: I have created COMPRESSION_CCITT_T4, + COMPRESSION_CCITT_T6, TIFFTAG_T4OPTIONS and TIFFTAG_T6OPTIONS aliases + in keeping with TIFF 6.0 standard in tiff.h as per bug 83. + +
    • Added PHOTOMETRIC_ITULAB as per bug 90. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • Brent Roman contributed updated tiffcp utility (and tiffcp.1) + with support for extracting subimages with the ,n syntax, and also + adding the -b bias removal flag. +
    • tiff2ps.c/tiff2ps.1: Substantial changes to tiff2ps by + Bruce A. Mallett, including a faster encoder, fixes for level + 2 PostScript, and support for the imagemask operator. +
    • fax2ps.c: Helge (libtiff at oldach.net) submitted fix +that corrects behaviour for non-Letter paper +sizes. (Bug 35) It fixes two problems: +
      + Without scaling (-S) the fax is now centered on the page size specified + with -H and/or -W. Before, fax2ps was using an obscure and practially + useless algorithm to allocate the image relative to Letter sized paper + which sometime sled to useless whitespace on the paper, while at the + same time cutting of the faxes printable area at the opposite border. +
      + + Second, scaling now preserves aspect ratio, which makes unusual faxes + (in particular short ones) print properly. + +
    • thumbnail.c: changed default output compression + to packbits from LZW since LZW isn't generally available. +
    • tiff2rgba.c: added -n flag to avoid emitting alpha component. Also added +a man page for tiff2rgba. + +
    • tiffcmp.c: Fixed multi samples per pixel support for ContigCompare +as per bug 53. +Updated bug section of tiffcmp.1 to note tiled file issues. + +
    • libtiff/tif_getimage.c: Fixed so that failure is properly + reported by gtTileContig, gtStripContig, gtTileSeparate and + gtStripSeparate as per bug 51. + + +
    + +


    + + + +CHANGES IN THE LZW COMPRESSION KIT: +
      +
    • Rewrote lzw patching process so that is required to enable full + LZW support is to drop the tif_lzw.c from the + libtiff-lzw-compression-kit over the one in the libtiff directory. + +
    • Some changes were made to make recovery from failure to + initialize the LZW compressor more graceful. + +
    • Note that as distributed libtiff support LZW decompression, but + not LZW compression. +
    + + + +CHANGES IN THE CONTRIB AREA: +
      +
    • Fixed distribution to include contrib/addtiffo/tif_ovrcache.{c,h}. +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2004/11/26 14:37:20 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.0.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.0.html new file mode 100644 index 0000000..888e547 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.0.html @@ -0,0 +1,434 @@ + + + +Changes in TIFF v3.6.0 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • New utility raw2tiff +for converting raw rasters into TIFF files. +
    • Lots of new tiff2ps options. +
    • Lots of new fax2tiff options. +
    • Lots of bug fixes for LZW, JPEG and OJPEG compression. +
    + +

    Custom Tag Support

    + +The approach to extending libtiff with custom tags has changed radically. +Previously, all internally supported TIFF tags had a place in the +private TIFFDirectory structure within libtiff to hold the values (if read), +and a "field number" (ie. FIELD_SUBFILETYPE) used to identify that tag. +However, every time a new tag was added to the core, the size of the +TIFFDirectory structure would changing, breaking any dynamically linked +software that used the private data structures.

    + +Also, any tag not recognised +by libtiff would not be read and accessable to applications without some +fairly complicated work on the applications part to pre-register the tags +as exemplified by the support for "Geo"TIFF tags by libgeotiff layered on +libtiff.

    + +Amoung other things this approach required the extension code +to access the private libtiff structures ... which made the higher level +non-libtiff code be locked into a specific version of libtiff at compile time. +This caused no end of bug reports!

    + +The new approach is for libtiff to read all tags from TIFF files. Those that +aren't recognised as "core tags" (those having an associated FIELD_ value, +and place for storage in the TIFFDirectory structure) are now read into a +dynamic list of extra tags (td_customValues in TIFFDirectory). When a new +tag code is encountered for the first time in a given TIFF file, a new +anonymous tag definition is created for the tag in the tag definition list. +The type, and some other metadata is worked out from the instance encountered. +These fields are known as "custom tags".

    + +Custom tags can be set and fetched normally using TIFFSetField() and +TIFFGetField(), and appear pretty much like normal tags to application code. +However, they have no impact on internal libtiff processing (such as +compression). Some utilities, such as tiffcp will now copy these custom +tags to the new output files.

    + +As well as the internal work with custom tags, new C API entry points +were added so that extension libraries, such as libgeotiff, could +define new tags more easily without accessing internal data structures. +Because tag handling of extension tags is done via the "custom fields" +mechanism as well, the definition provided externally mostly serves to provide +a meaningful name for the tag. + +The addition of "custom tags" and the altered approach to extending libtiff +with externally defined tags is the primary reason for the shift to the +3.6.x version number from 3.5.x.

    + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • configure, config.site: Fix for large files (>2GiB) support. New +option in the config.site: LARGEFILE="yes". Should be enougth for the large +files I/O. + +
    • configure: Set -DPIXARLOG_SUPPORT option along with -DZIP_SUPPORT. + +
    • html/Makefile.in: Updated to use groffhtml for generating html pages +from man pages. + +
    • configure, libtiff/Makefile.in: Added SCO OpenServer 5.0.6 support +from John H. DuBois III. + +
    • libtiff/{Makefile.vc, libtiff.def}: Missed declarations added. + +
    • libtiff/Makefile.in, tools/Makefile.in: Shared library will not be +stripped when installing, utility binaries will do be stripped. As per bug 93. + +
    • man/Makefile.in: Patch DESTDIR handling as per bug 95. + +
    • configure: OpenBSD changes for Sparc64 and DSO version as per bug 96. + +
    • config.site/configure: added support for OJPEG=yes option to enable +OJPEG support from config.site. + +
    • config.guess, config.sub: Updated from ftp.gnu.org/pub/config. + +
    • configure: Modify CheckForBigEndian so it can work in a cross +compiled situation. + +
    • configure, libtiff/Makefile.in: Changes for building on MacOS 10.1 +as per bug 94. + +
    • html/Makefile.in: added missing images per bug 92. + +
    • port/Makefile.in: fixed clean target per bug 92. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      + +
    • libtiff/tif_getimage.c: New function TIFFReadRGBAImageOriented() +implemented to retrieve raster array with user-specified origin position. + +
    • libtiff/tif_fax3.c: Fix wrong line numbering. + +
    • libtiff/tif_dirread.c: Check field counter against number of fields. + +
    • Store a list of opened IFD to prevent directory looping. + +
    • libtiff/tif_jpeg.c: modified segment_height calculation to always +be a full height tile for tiled images. Also changed error to just +be a warning. + +
    • libtiff/tif_lzw.c: fixed so that decoder state isn't allocated till +LZWSetupDecode(). Needed to read LZW files in "r+" mode. + +
    • libtiff/tif_dir.c: fixed up the tif_postdecode settings responsible +for byte swapping complex image data. + +
    • libtiff/tif_open.c: Removed error if opening a compressed file +in update mode bug (198). + +
    • libtiff/tif_write.c: TIFFWriteCheck() now fails if the image is +a pre-existing compressed image. That is, image writing to pre-existing +compressed images is not allowed. + +
    • html/man/*.html: Web pages regenerated from man pages. + +
    • libtiff/tif_jpeg.c: Hack to ensure that "boolean" is defined properly +on Windows so as to avoid the structure size mismatch error from libjpeg +(bug 188). + +
    • libtiff/tiff.h: #ifdef USING_VISUALAGE around previous Visual Age +AIX porting hack as it screwed up gcc. (bug 39) + +
    • libtiff/tiff.h: added COMPRESSION_JP2000 (34712) for LEAD tools +custom compression. + +
    • libtiff/tif_dirread.c: Another fix for the fetching SBYTE arrays +by the TIFFFetchByteArray() function. (bug 52) + +
    • libtiff/tif_dirread.c: Expand v[2] to v[4] in TIFFFetchShortPair() +as per bug 196. + +
    • libtiff/tif_lzw.c: Additional consistency checking added in +LZWDecode() and LZWDecodeCompat() fixing bugs 190 and 100. + +
    • libtiff/tif_lzw.c: Added check for valid code lengths in LZWDecode() +and LZWDecodeCompat(). Fixes bug 115. + +
    • tif_getimage.c: Ensure that TIFFRGBAImageBegin() returns the +return code from the underlying pick function as per bug 177. + +
    • libtiff/{tif_jpeg.c,tif_strip.c,tif_print.c}: Hacked tif_jpeg.c to +fetch TIFFTAG_YCBCRSUBSAMPLING from the jpeg data stream if it isn't +present in the tiff tags as per bug 168. + +
    • libtiff/tif_jpeg.c: Fixed problem with setting of nrows in +JPEGDecode() as per bug 129. + +
    • libtiff/tif_read.c, libtiff/tif_write.c: TIFFReadScanline() and +TIFFWriteScanline() now set tif_row explicitly in case the codec has +fooled with the value as per bug 129. + +
    • libtiff/tif_ojpeg.c: Major upgrade from Scott. Details in bug 156. + +
    • libtiff/tif_open.c: Pointers to custom procedures +in TIFFClientOpen() are checked to be not NULL-pointers. + +
    • libtiff/tif_lzw.c: Assertions in LZWDecode and LZWDecodeCompat +replaced by warnings. Now libtiff should read corrupted LZW-compressed +files by skipping bad strips as per bug 100. + +
    • libtiff/: tif_dirwrite.c, tif_write.c, tiffio.h: +TIFFCheckpointDirectory() +routine added as per bug 124. The +TIFFWriteDirectory +man page discusses this new function as well as the related +TIFFRewriteDirectory(). + +
    • libtiff/: tif_codec.c, tif_compress.c, tiffiop.h, tif_getimage.c: +Introduced +additional members tif->tif_decodestatus and tif->tif_encodestatus +for correct handling of unconfigured codecs (we should not try to read +data or to define data size without correct codecs). See bug 119. + +
    • tif_dirread.c: avoid div-by-zero if rowbytes is zero in chop func as +per bug 111. + +
    • libtiff/: tiff.h, tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_dirread.c, +tif_dirwrite.c: Dwight Kelly added get/put code for new tag XMLPACKET as +defined in Adobe XMP Technote. Added missing INKSET tag value from TIFF 6.0 +spec INKSET_MULTIINK (=2). Added missing tags from Adobe TIFF technotes: +CLIPPATH, XCLIPPATHUNITS, YCLIPPATHUNITS, OPIIMAGEID, OPIPROXY and +INDEXED. Added PHOTOMETRIC tag value from TIFF technote 4 ICCLAB (=9). + +
    • libtiff/tif_getimage.c: Additional check for supported codecs added in +TIFFRGBAImageOK, TIFFReadRGBAImage, TIFFReadRGBAStrip and TIFFReadRGBATile now +use TIFFRGBAImageOK before reading a per bug 110. + +
    • libtiff/: tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_dirread.c, +tif_dirwrite.c: Added routine +TIFFDataWidth for determining +TIFFDataType sizes instead of working with tiffDataWidth array +directly as per bug 109. + +
    • libtiff/: tif_dirinfo.c, tif_dirwrite.c: Added possibility to +read broken TIFFs with LONG type used for TIFFTAG_COMPRESSION, +TIFFTAG_BITSPERSAMPLE, TIFFTAG_PHOTOMETRIC as per bug 99. + +
    • libtiff/{tiff.h,tif_fax3.c}: Add support for __arch64__ as per bug 94. + +
    • libtiff/tif_read.c: Fixed TIFFReadEncodedStrip() to fail if the +decodestrip function returns anything not greater than zero as per bug 97. + +
    • libtiff/tif_jpeg.c: fixed computation of segment_width for +tiles files to avoid error about it not matching the +cinfo.d.image_width values ("JPEGPreDecode: Improper JPEG strip/tile +size.") for ITIFF files. Apparently the problem was incorporated since +3.5.5, presumably during the OJPEG/JPEG work recently. + +
    • libtiff/tif_getimage.c: If DEFAULT_EXTRASAMPLE_AS_ALPHA is 1 +(defined in tiffconf.h - 1 by default) then the RGBA interface +will assume that a fourth extra sample is ASSOCALPHA if the +EXTRASAMPLE value isn't set for it. This changes the behaviour of +the library, but makes it work better with RGBA files produced by +lots of applications that don't mark the alpha values properly. +As per bugs 93 and 65. + +
    • libtiff/tif_jpeg.c: allow jpeg data stream sampling values to +override those from tiff directory. This makes this work with +ImageGear generated files. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • tiff2ps: Added page size setting +when creating PS Level 2. + +
    • tiff2ps: Fixed PS comment emitted when +FlateDecode is being used. + +
    • tiffsplit: increased the maximum +number of pages that can be split. + +
    • raw2tiff: Added option `-p' to +explicitly select color space of input image data. + +
    • tiffmedian: Suppiort for large +(> 2GB) images. + +
    • ppm2tiff: Fixed possible endless loop. + +
    • tiff2rgba: Switched to use +TIFFReadRGBAImageOriented() +instead of TIFFReadRGBAImage(). + +
    • tiffcmp: Fixed problem with unused data +comparing (bug 349). `-z' option now can be used to set the number of reported +different bytes. + +
    • tiffcp: Added possibility to specify +value -1 to -r option to get the entire image as one strip (bug 343). + +
    • tiffcp: Set the correct RowsPerStrip +and PageNumber values (bug 343). + +
    • fax2tiff: Page numbering fixed (bug +341). + +
    • ppm2tiff: PPM header parser improved: +now able to skip comments. + +
    • tiff2ps: Force deadzone printing when +EPS output specified (bug 325). + +
    • tiff2ps: Add ability to generate +PS Level 3. It basically allows one to use the /flateDecode filter for ZIP +compressed TIFF images. Patch supplied by Tom Kacvinsky (bug 328). + +
    • tiffcp: Fixed problem with colorspace +conversion for JPEG encoded images (bugs 23 and 275) + +
    • fax2tiff: Applied patch from +Julien Gaulmin. More switches for fax2tiff tool for better control +of input and output (bugs 272 and 293). + +
    • raw2tiff: +New utility for turning raw raster images into TIFF files +written by Andrey Kiselev. + +
    • tiff2ps: +Sebastian Eken provided patches (bug 200) to add new these new +switches: +
        +
      • -b #: for a bottom margin of # inches +
      • -c: center image +
      • -l #: for a left margin of # inches +
      • -r: rotate the image by 180 degrees +
      + +Also, new features merged with code for shrinking/overlapping. + +
    • tiff2ps: Don't emit BeginData/EndData +DSC comments since we are unable to properly include the amount to skip +as per bug 80. + +
    • tiff2ps: Added workaround for some +software that may crash when last strip of image contains fewer number +of scanlines than specified by the `/Height' variable as per bug 164. + +
    • tiff2ps: Patch from John Williams to add new +functionality for tiff2ps utility splitting long images in several pages as +per bug 142. New switches: +
        +
      • -H #: split image if height is more than # inches +
      • -L #: overLap split images by # inches +
      + +
    • tiff2ps: New commandline +switches to override resolution units obtained from the input file per bug 131: +
        +
      • -x: override resolution units as centimeters +
      • -y: override resolution units as inches +
      + +
    • fax2tiff: Updated to reflect +latest changes in libtiff per bug 125. + +
    • tiff2ps: Division by zero fixed as per bug 88. + +
    • tiffcp: +Added support for 'Orientation' tag. + +
    • tiffdump: +include TIFFTAG_JPEGTABLES in tag list. + +
    • tiffset: fix bug in error reporting. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: +
      + +
    • Fixed distribution to include contrib/addtiffo/tif_ovrcache.{c,h}. +
    • libtiff/contrib/win95: renamed to contrib/win_dib. Added new +Tiffile.cpp example of converting TIFF files into a DIB on Win32 as per +bug 143. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • LZW compression kit synchronized with actual libtiff version. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2003/10/04 11:38:17 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.1.html new file mode 100644 index 0000000..d106062 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.6.1.html @@ -0,0 +1,199 @@ + + + +Changes in TIFF v3.6.1 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + + + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • libtiff/makefile.vc, tools/makefile.vc: Support for IJG JPEG library. + +
    • Makefile.in: Add an absolute path to the test_pics.sh call. + +
    • Makefile.in: Add an absolute path to the test_pics.sh call. + +
    • libtiff/tiffcomp.h: #define _BSDTYPES_DEFINED when defining BSD typedefs. + +
    • configure, libtiff/{Makefile.in, mkversion.c}: Relative buildings fixed. + +
    • Makefile.in: Add an absolute path to the test_pics.sh call. + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      + +
    • libtiff/{tif_color.c, tif_getimage.c, tiffio.h}: Added support +for ReferenceBlackWhite tag handling when converted from YCbCr color space as +per bug 120. + +
    • libtiff/{tif_getimage.c, tif_aux.c}: Read WhitePoint tag from the +file and properly use it for CIE Lab 1976 to RGB transform. + +
    • libtiff/{tif_getimage.c, tiffio.h}: Finally resolved problems with +orientation handling. TIFFRGBAImage interface now properly supports all +possible orientations, i.e. images will be flipped both in horizontal and +vertical directions if required. 'Known bugs' section now removed from the +appropriate manual pages. + +
    • libtiff/tif_luv.c: Fixed bug in 48-bit to 24-bit conversion routine, +reported by Antonio Scuri. + +
    • libtiff/{tiffio.h, tif_codec.c}: Added new function +TIFFIsCODECConfigured(), suggested by Ross Finlayson. + +
    • libtiff/tif_ojpeg.c: TIFFVGetField() function now can properly extract +the fields from the OJPEG files. Patch supplied by Ross Finlayson. + +
    • libtiff/tif_dir.h: _TIFFFindOrRegisterdInfo declaration replaced +with _TIFFFindOrRegisterFieldInfo as reported by Ross Finlayson. + +
    • libtiff/tif_dirinfo.c: Implemented binary search in _TIFFMergeFieldInfo(). +Patch supplied by Ross Finlayson. + +
    • tif_dirread.c: do not mark all anonymously defined tags to be IGNOREd (as +it was done in 3.6.0). + +
    • libtiff/{tiff.h, tif_dirinfo.c}: Added support for IFD (13) datatype, +intruduced in "Adobe PageMaker TIFF Technical Notes". + +
    • libtiff/{tif_color.c, tif_getimage.c, tiffio.h}: New color space +conversion code: CIE L*a*b* 1976 images now supported by the TIFFRGBAImage +interface. YCbCr to RGB conversion code also moved there and now has +publicly available interface. These +routines currently used in TIFFRGBAImage interface only and not supported in +other libtiff tools yet. So if you want, for example, to convert CIE Lab image +into PostScript file you should do it in two steps: chnge colorspace to RGB +using tiff2rgba utility abd then process +it with the tiff2ps. + +
    • libtiff/tif_tile.c: Remove spurious use of "s" (sample) in the +planarconfig_contig case in TIFFComputeTile() as per bug 387 + +
    • libtiff/tiffiop.h: New macros: TIFFmax and TIFFmin. + +
    • libtiff/{tiffio.h, tif_strip.c}: Added TIFFRawStripSize() function +as suggested by Chris Hanson. + +
    • libtiff/{tif_lzw.c, tif_fax3.c}: Proper support for update mode +as per bug 424. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • tiff2pdf: New tool, written by +Ross Finlayson, to directly convert TIFF files to PDF. + +
    • tiffgt: Unmaintained and platform +dependent sgigt utility removed and replaced with the completely rewritten +portable tiffgt tool (depend on OpenGL and +GLUT). This tool will not build by default. + +
    • ras2tiff: Properly determine +SUN Rasterfiles with the reverse byte order (it is reported by the magic +header field). Problem reported by Andreas Wiesmann. + +
    • raw2tiff: Implemented image size +guessing using correlation coefficient calculation between two neighbour +lines. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: +
      + +
    • contrib/pds/{tif_pdsdirread.c, tif_pdsdirwrite.c}: Use TIFFDataWidth() +function insted of tiffDataWidth array. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • Proper support for update mode as per bug 424. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2003/12/24 22:14:15 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0.html new file mode 100644 index 0000000..413f2c6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0.html @@ -0,0 +1,144 @@ + + + + Changes in TIFF v3.7.0 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • Several bugs found after 3.7.0beta2 release were fixed. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • ltmain.sh: Fix for MinGW compilation. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      + +
    • libtiff/{tif_dirread.c, tif_jpeg.c, tif_luv.c, tif_ojpeg.c, + tif_pixarlog.c, tif_write.c}: Handle the zero strip/tile sizes + properly (Dmitry V. Levin, Marcus Meissner). + +
    • libtiff/tif_dirinfo.c: Type of the TIFFTAG_SUBIFD field changed + to TIFF_IFD. + +
    • Preliminary support for BigTIFF files: now libtiff can + recognize and reject to open such images. ;-) + +
    • libtiff/tif_dir.c: Initialize td_tilewidth and td_tilelength fields + of the TIFFDirectory structure with the 0 instead of -1 to avoid + confusing integer overflows in TIFFTileRowSize() for striped images. + +
    • libtiff/tif_dir.c: Initialize td_tilewidth and td_tilelength fields + of the TIFFDirectory structure with the 0 instead of -1 to avoid + confusing integer overflows in TIFFTileRowSize() for striped images. + +
    • libtiff/tif_dirinfo.c: Fix bug with tif_foundfield and reallocation + of tif_fieldinfo as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=630 + +
    • libtiff/tif_compress.c: Improved error reporting in + TIFFGetConfiguredCODECs() (Dmitry V. Levin). + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • tiffcmp.c (leof): Renamed from 'eof' in order to avoid + conflict noticed under MinGW. + +
    • tiff2pdf.c: Fixed TransferFunction tag handling reported + by Ross A. Finlayson. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • No changes. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • This one is not longer needed. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2004/12/20 19:31:44 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0alpha.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0alpha.html new file mode 100644 index 0000000..95c633c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0alpha.html @@ -0,0 +1,249 @@ + + + + Changes in TIFF v3.7.0alpha + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Significant changes in software configuration: we are switched + to GNU autotools now. + +
    • tiffset: tiffset now can set any libtiff supported tags. Tags + can be supplied by the mnemonic name or number. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Get rid of the old configuration system and switch to + GNU autotools. +
    + +


    + + + +CHANGES IN LIBTIFF: + + + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • tiffset: tiffset now can set any libtiff supported tags. Tags + can be supplied by the mnemonic name or number. + +
    • ycbcr.c: fixed main() declaration as per: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=513. + +
    • tiffsplit: Don't forget + to copy Photometric Interpretation tag. + +
    • tiffsplit: Fixed problem with + unproperly written multibyte files. Now output files will be written + using the same byte order flag as in the input image. See + . + +
    • tiffsplit: Copy JPEGTables + tag contents for JPEG compressed images. Reported by Artem Mirolubov. + +
    • tiffcp: Close output file + on normal exit. + +
    • tiffcp: Don't emit warnings + when Orientation tag does not present in the input image. + +
    • tiffcp: Properly set + Photometric Interpretation in case of JPEG compression of grayscale + images. + +
    • tiffcp: Fixed problem with wrong + interpretation of the InkNames tag as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=466. + Memory leak fixed. + +
    • tiffcp: Fixed problem with + wrong Photometric setting for non-RGB images. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • Outdated stuff removed. + +
    • Almost all programs are sinchronized with the current libtiff + and should compile without problems. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • No changes. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/03/18 17:12:47 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta.html new file mode 100644 index 0000000..7d7c868 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta.html @@ -0,0 +1,162 @@ + + + + Changes in TIFF v3.7.0beta + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • LZW compression enabled by default. You don't need the separate + compression kit anymore. + +
    • bmp2tiff: Added new utility to convert Windows BMP files + into TIFFs. + +
    • The first attempt to implement a test suite. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Many portability fixes in the new autotooled build suite. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • libtiff/{tif_luv.c, tif_next.c, tif_thunder.c}: Several buffer + overruns fixed, as noted by Chris Evans. + +
    • BSD data types (u_char, u_short, u_int, u_long) is no longer + used internally in the libtiff. Should result in simpler configuration + and better portability. + +
    • libtiff/tiff.h: Fix column tagging. Reference current Adobe XMP + specification. Reference libtiff bug tracking system to submit + private tag additions. + +
    • libtiff/tif_dirread.c: Don't reject to read tags of the + SamplesPerPixel size when the tag count is greater than number of + samples as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=576. + +
    • libtiff/{tiffio.h, tif_open.c}: Applied patches from + Joris Van Damme to avoid requirement for tiffiop.h inclusion in + some applications. Look for details here: + + http://www.asmail.be/msg0054799560.html. + +
    • libtiff/{tiffiop.h, tif_dirinfo.c}: Fixed problem with the static + variable as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=593. + +
    • libtiff/tif_lzw.c: LZW compression code is merged back from the + separate package. All libtiff tools are updated to not advertise an + abcence of LZW support. + +
    • libtiff/tif_dir.c: Call TIFFError() instead of producing warnings + when setting custom tags by value. Reported by Eric Fieleke. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • tiff2ps: Avoid zero division in setupPageState() function; + properly initialize array in PSDataBW(). + +
    • tiff2pdf: Multiple bugfixes. + +
    • ras2tiff: Fixed issue with missed big-endian checks as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=586. + +
    • bmp2tiff: Added new utility to convert Windows BMP files + into TIFFs. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • No changes. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • This one is not longer needed. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/03/18 17:12:47 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta2.html new file mode 100644 index 0000000..67dd8da --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.0beta2.html @@ -0,0 +1,131 @@ + + + + Changes in TIFF v3.7.0beta2 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • The code has been reviewed by Dmitry Levin: added checks + for values, returned by the space allocation functions, fixed + problems with the possible integer overflows. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Several fixes in the test suite. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      + +
    • Preliminary support for BigTIFF files: now libtiff can + recognize and reject to open such images. ;-) + +
    • libtiff/tif_dirinfo.c: changed type of XMLPacket (tag 700) to + TIFFTAG_BYTE instead of TIFFTAG_UNDEFINED to comply with the info + in the Adobe XMP Specification. + +
    • Added many checks for integer overflow and for successful space + allocations in the different parts of library. Code review + completed by Dmitry V. Levin. + +
    • libtiff/{tiffio.h, tif_compress.c}: Added + TIFFGetConfiguredCODECs()function to get the list of configured codecs. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • tiff2bw: Write ImageWidth/Height tags to output file, as + noted by Gennady Khokhorin. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • No changes. + +
    + + + +CHANGES IN THE LZW COMPRESSION +KIT: +
      + +
    • This one is not longer needed. + +
    + + TIFF home page.
    + +
    + +Last updated $Date: 2006/03/18 17:12:47 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.1.html new file mode 100644 index 0000000..b888792 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.1.html @@ -0,0 +1,233 @@ + + + + Changes in TIFF v3.7.1 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • This is mostly bugfix release. Most important fix is the one + related to wrong custom tag read/write code. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • autogen.sh: aclocal and autoheader should be executed after + libtoolize. Also add '-I .' to aclocal invocation to check + current directory for macros. + +
    • nmake.opt: Link with the user32.lib in windowed mode. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=697 + +
    • nmake.opt, makefile.vc: make it easier to rename the libtiff DLL. + +
    • configure, configure.ac: Added --enable-rpath option to embed + linker paths into library binary. + +
    + +


    + + + +CHANGES IN LIBTIFF: + + + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • fax2ps.c: Be able to extract the first page (#0). As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=690 + +
    • tiff2ps.c: Fixed wrong variable data type when read Position + tags (Tristan Hill). + +
    • tiff2ps.c: Fixed wrong variable data type when read Resolution + tags (Peter Fales). + +
    • tiffset.c: Check the malloc return value (Dmitry V. Levin). + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • No changes. + +
    + +Last updated $Date: 2004/12/20 19:31:44 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.2.html new file mode 100644 index 0000000..6cb6f7c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.2.html @@ -0,0 +1,222 @@ + + + + Changes in TIFF v3.7.2 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • Maintainance release. Many bugfixes in the build environment + and compatibility improvements. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + + + +


    + + + +CHANGES IN LIBTIFF: + + + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • No changes. + +
    + +Last updated $Date: 2005/03/15 15:17:44 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.3.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.3.html new file mode 100644 index 0000000..d698451 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.3.html @@ -0,0 +1,230 @@ + + + + Changes in TIFF v3.7.3 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Replace runtime endianess check with the compile time one. + +
    • Added support for the new predictor type (floating point + predictor), defined at the TIFF Technical Note 3. + +
    • Added Support for custom tags, passed by value. + Added support for all DNG tags. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + + + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • tiffiop.h, tif_open.c: Added open option 'h' to avoid reading + the first IFD when needed. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=875 + +
    • tiff.h: Use correct int size on Sparc 64bit/Sun compiler + platform. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=855 + +
    • tif_dirinfo.c: Added support for ClipPath, XClipPathUnits + and YClipPathUnits tags. + +
    • tif_dirinfo.c, tif_dir.h, tif_dir.c, tif_print.c: Make + DocumentName, Artist, HostComputer, ImageDescription, Make, Model, + Copyright, DateTime, PageName, TextureFormat, TextureWrapModes and + TargetPrinter tags custom. + +
    • tif_jpeg.c: Cleanup the codec state depending on TIFF_CODERSETUP + flag (to fix memory leaks). + +
    • tif_dirwrite.c: Use tdir_count when calling + TIFFCvtNativeToIEEEDouble() in the TIFFWriteDoubleArray() function as + per bug + http://bugzilla.remotesensing.org/show_bug.cgi?id=845 + +
    • tif_dirinfo.c, tif_print.c: TIFFFetchByteArray() returns + uint16 array when fetching the BYTE and SBYTE fields, so we should + consider result as pointer to uint16 array and not as array of chars. + As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=831 + +
    • tif_dir.c: More efficient custom tags retrieval as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=830 + +
    • tif_win32.c: Use FILE_SHARE_READ | FILE_SHARE_WRITE share + mode in CreateFile() call as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=829 + +
    • tif_jpeg.c: Substantial fix for addtiffo problems with + JPEG encoded TIFF files. Pre-allocate lots of space for jpegtables + in directory. + +
    • tif_dirread.c: Changed the code that computes + stripbytecount[0] if it appears bogus to ignore if stripoffset[0] is + zero. This is a common case with GDAL indicating a "null" tile/strip. + +
    • tif_jpeg.c: added LIB_JPEG_MK1 support in JPEGDecodeRaw(). + +
    • tif_dirread.c: Ensure that broken files with too many + values in PerSampleShorts, TIFFFetchPerSampleLongs and + TIFFFetchPerSampleAnys work ok instead of crashing. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=843 + +
    • tif_predict.h, tif_predict.c: Added ability to decode and encode + floating point predictor, as per TIFF Technical Note 3. + See http://chriscox.org/TIFF_TN3_Draft2.pdf for details. + +
    • tiffio.h, tiffiop.h, tif_dir.c, tif_read.c, tif_swab.c: + Added _TIFFSwab24BitData() and TIFFSwabArrayOfLong() functions used to + swap 24-bit floating point values. + +
    • tiff.h: Added predictor constants. + +
    • tiffiop.h, tif_dir.c: Use uint32 type for appropriate values + in _TIFFVSetField() function. Inspired by the bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=816 + +
    • tif_open.c: Do not read header in case the output file should + be truncated (Ron). + +
    • tif_dirinfo.c, tif_config.h.vc: Use lfind() instead of bsearch() + in _TIFFFindFieldInfoByName() function (Ron). + +
    • tif_dir.c, tif_print.c: Properly handle all data types in custom + tags. + +
    • dirinfo.c: Added DNG tags. + +
    • tiff.h: Added missed DNG tag (LensInfo); added DNG 1.1.0.0 tags. + +
    • tif_dir.c, tif_print.c: Added Support for custom tags, passed + by value. + +
    • tiff.h, tif_dirinfo.c, tiffiop.h: Added EXIF related tags. +
    + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • addtiffo/{tif_overview.c, tif_ovrcache.c, tif_ovrcache.h}: + Make overviews working for contiguous images. + +
    + +Last updated $Date: 2006/01/04 22:04:46 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.4.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.4.html new file mode 100644 index 0000000..9437320 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.7.4.html @@ -0,0 +1,133 @@ + + + + Changes in TIFF v3.7.4 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Fixed important bug in custom tags handling code.. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Applied patch from Patrick Welche (all scripts moved in the + 'config' and 'm4' directories). + +
    • SConstruct, libtiff/SConstruct: Added the first very preliminary + support for SCons software building tool (http://www.scons.org/). + This is experimental infrastructure and it will exist along with the + autotools stuff. + +
    • port/lfind.c: Added lfind() replacement module. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • tif_dir.c: When prefreeing tv->value in TIFFSetFieldV + also set it to NULL to avoid double free when re-setting custom + string fields as per: + + http://bugzilla.remotesensing.org/show_bug.cgi?id=922 + +
    • tif_dir.c: Fixed up support for swapping "double complex" + values (128 bits as 2 64 bits doubles). GDAL gcore tests now + pass on bigendian (macosx) system. + +
    • libtiff/{tif_dirread.c, tif_dirinfo.c}: Do not upcast BYTEs to + SHORTs in the TIFFFetchByteArray(). Remove TIFFFetchExtraSamples() + function, use TIFFFetchNormalTag() instead as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=831 + + Remove TIFFFetchExtraSamples() function, use TIFFFetchNormalTag() + instead. + +
    • tif_print.c: Fixed printing of the BYTE and SBYTE arrays. + +
    • tif_write.c: Do not check the PlanarConfiguration field in + the TIFFWriteCheck() function in case of single band images (as per + TIFF spec). + +
    • libtiff/{tif_dir.c, tif_dir.h, tif_dirinfo.c, tif_print.c}: + Make FieldOfViewCotangent, MatrixWorldToScreen, MatrixWorldToCamera, + ImageFullWidth, ImageFullLength and PrimaryChromaticities tags custom. +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • tiffcp.c: Fixed WhitePoint tag copying. +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      +
    • tiffdump.c: Added support for TIFF_IFD datatype. + +
    • addtiffo/{tif_overview.c, tif_ovrcache.c, tif_ovrcache.h}: + Make overviews working for contiguous images. + +
    + +Last updated $Date: 2005/11/03 14:18:43 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.0.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.0.html new file mode 100644 index 0000000..914dcb0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.0.html @@ -0,0 +1,199 @@ + + + + Changes in TIFF v3.8.0 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Read-only support for custom directories (e.g. EXIF directory). + +
    • Preliminary support for MS MDI format. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • Make the default strip size configurable via the + --with-default-strip-size and STRIP_SIZE_DEFAULT options. +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • tiffio.h: Added VC_EXTRALEAN definition before including + windows.h, to reduce the compile time. + +
    • tif_jpeg.c: Improve compilation under MinGW. + +
    • {tif_aux.c, tif_dir.c, tif_dir.h, tif_dirwrite.c, + tif_print.c, tif_getimage.c}: Make InkSet, NumberOfInks, DotRange and + StoNits tags custom. + +
    • {tif_aux.c, tif_dir.c, tif_dir.h, tif_print.c}: Make + WhitePoint tag custom. + +
    • tiffio.h: fixed typo that potentially resulted in + redefininition of USE_WIN32_FILEIO + +
    • {tif_dir.c, tif_dir.h, tif_print.c}: Make RichTIFFIPTC, + Photoshop and ICCProfile tags custom. + +
    • libtiff/*, contrib/*: Added 'dual-mode' error handling, enabling + newer code to get context indicator in error handler and still + remain compatible with older code: Done TIFFError calls everywhere + except in tools. + +
    • tiffinfo.c: Print EXIF directory contents if exist. + +
    • {tif_dirinfo.c, tif_dirread.c, tif_dir.h, tif_dir.c}: + Custom directory read-only support. + +
    • {tif_aux.c, tif_dirinfo.c, tif_dirread.c, tif_dir.h, + tif_dir.c, tif_print.c}: Make YCbCrCoefficients and ReferenceBlackWhite + tags custom. + +
    • tif_dirread.c: One more workaround for broken StripByteCounts + tag. Handle the case when StripByteCounts array filled with + completely wrong values. + +
    • tif_dirinfo.c: Release file descriptor in case of failure + in the TIFFOpenW() function as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1003 + +
    • tif_dirinfo.c: Correctly yse bsearch() and lfind() + functions as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1008 + +
    • tif_open.c, tiff.h, tiffdump.c: Incorporate preliminary support + for MS MDI format. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1002 + +
    • libtiff.def, tiffiop.h, tiffio.h: Made TIFFFreeDirectory + public. + +
    • /tif_dirinfo.c: Make XResolution, YResolution and + ResolutionUnit tags modifiable during write process. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=977 + +
    • if_dirread.c: Don't try and split single strips into "0" strips + in ChopUpSingleUncompressedStrip. This happens in some degenerate + cases (like 1x1 files with stripbytecounts==0 (gtsmall.jp2 embed tiff) + +
    • tif_fax3.c: changed 'at scanline ...' style warning/errors + with incorrect use of tif_row, to 'at line ... of + strip/tile ...' style. +
    + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      +
    • contrib/addtiffo/*: Major upgrade by Joris to support subsampled + YCbCr images in jpeg compressed TIFF files. + +
    + +Last updated $Date: 2006/01/04 23:38:38 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.1.html new file mode 100644 index 0000000..9fea140 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.1.html @@ -0,0 +1,217 @@ + + + + Changes in TIFF v3.8.1 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Bug-fix release. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      +
    • libtool related stuff updated from the 2.1a branch. + +
    • Fix with_default_strip_size comparison as reported by + Norihiko Murase. +
    + +


    + + + +CHANGES IN LIBTIFF: + + + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      +
    + +Last updated $Date: 2006/03/13 14:52:12 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.2.html new file mode 100644 index 0000000..e648127 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.8.2.html @@ -0,0 +1,137 @@ + + + + Changes in TIFF v3.8.2 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • Bug-fix release. +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + + + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • tif_strip.c: Take subsampling in account when calculating + TIFFScanlineSize(). + +
    • tif_jpeg.c, tif_fax3.c, tif_zip.c, tif_pixarlog.c, + tif_lzw.c, tif_luv.c: Use _TIFFSetDefaultCompressionState() in all + codec cleanup methods. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1120 + +
    • tif_jpeg.c: Do not cleanup codec state in TIFFInitJPEG(). As + per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1119 + +
    • tif_dir.c: Use double type instead of dblparam_t. + +
    • tif_dirread.c: Do not check the PlanarConfig tag presence + in TIFFReadDirectory, because it is always set at the start of + function and we allow TIFFs without that tag set. + +
    + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      +
    + +Last updated $Date: 2006/03/23 14:54:01 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.0beta.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.0beta.html new file mode 100644 index 0000000..d7d8821 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.0beta.html @@ -0,0 +1,304 @@ + + + + Changes in TIFF v3.9.0beta + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). +If you don't find something listed here, then it was not done in this +timeframe, or it was not considered important enough to be mentioned. +The following information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • New tiffcrop utility contributed by Richard Nolde. + tiffcrop does the same as tiffcp, but also can crop, + extract, rotate and mirror images. + +
    • tif_jbig.c: Added support for JBIG compression scheme + (34661 code), contributed by Lee Howard. + +
    • Totally new implementation of OJPEG module from + Joris Van Damme. No need to patch libjpeg anymore. Many OJPEG files + should be supported now that was not supported previously. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • tif_config.wince.h, tiffconf.wince.h, tif_wince.c: WinCE-specific + compatibility stuff from Mateusz Loskot. + +
    • Rename config.h.vc and tif_config.h.vc to config.vc.h and + tif_config.vc.h for easier identification by folks using an IDE. + +
    • configure, configure.ac: OJPEG support enabled by default (i.e., + whe the conformant JPEG support enabled). + +
    • README.vms, Makefile.am, configure.com, libtiff/{Makefile.am, + tif_config.h-vms, tif_stream.cxx, tif_vms.c, tiffconf.h-vms}: + Added support for OpenVMS by Alexey Chupahin. + +
    • nmake.opt: use /EHsc for VS2005 compatibility. Also define + _CRT_SECURE_NO_DEPRECATE to avoid noise on VS2005. + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • tif_dirinfo.c (_TIFFFindFieldInfo): Don't attempt to + bsearch() on a NULL fieldinfo list. + (_TIFFFindFieldInfoByName): Don't attempt to lfind() on a NULL + fieldinfo list. + +
    • tif_jpeg.c: Changed JPEGInitializeLibJPEG() so that it + will convert from decompressor to compressor or compress to decompress + if required by the force arguments. This works around a problem in + where the JPEGFixupTestSubsampling() may cause a decompressor to + be setup on a directory when later a compressor is required with the + force flag set. Occurs with the addtiffo program for instance. + +
    • tif_dirwrite.c: Fixed swapping of byte arrays stored + in-place in tag offsets as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1363 + +
    • tif_getimage.c: workaround for 'Fractional scanline' error + reading OJPEG images with rowsperstrip that is not a multiple of + vertical subsampling factor. This bug is mentioned in + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1390 and + + http://www.asmail.be/msg0054766825.html + +
    • tif_dirread.c: Added special function to handle + SubjectDistance EXIF tag as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1362 + +
    • tif_dirread.c, tif_read.c: Type of the byte counters + changed from tsize_t to uint32 to be able to work with data arrays + larger than 2GB. Fixes bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=89 + Idea submitted by Matt Hancher. + +
    • tif_dir.c: Workaround for incorrect TIFFs with + ExtraSamples == 999 produced by Corel Draw. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1490 + +
    • tif_write.c: TIFFAppendToStrip() - clear sorted flag if + we move a strip. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1359 + +
    • tif_fax3.c: Save the state of printdir codec dependent method. + +
    • tif_jpeg.c: Save the state of printdir codec dependent method + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1273 + +
    • tif_win32.c: Fixed problem with offset value manipulation + as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1322 + +
    • tif_fax3.c, tif_next.c, tif_pixarlog.c: Fixed multiple + vulnerabilities, as per Gentoo bug (): + + http://bugs.gentoo.org/show_bug.cgi?id=142383 + +
    • tif_lzw.c, tif_zip.c: Fixed problems with mixing + encoding and decoding on the same read-write TIFF handle. The LZW + code can now maintain encode and decode state at the same time. The + ZIP code will switch back and forth as needed. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=757 + +
    • tif_msdos.c: Avoid handle leak for failed opens. + c/o Thierry Pierron + +
    • tif_dirwrite.c: take care not to flush out buffer of strip/tile + data in _TIFFWriteDirectory if TIFF_BEENWRITING not set. Relates + to bug report by Peng Gao with black strip at bottom of images. + +
    • tif_dirwrite.c: make sure to use uint32 for wordcount in + TIFFWriteNormanTag if writecount is VARIABLE2 for ASCII fields. + It already seems to have been done for other field types. Needed + for "tiffset" on files with geotiff ascii text. + +
    • tif_dirinfo.c: Added missed EXIF tag ColorSpace (40961). + +
    • tif_dirread.c: Move IFD fetching code in the separate + function TIFFFetchDirectory() avoiding code duplication in + TIFFReadDirectory() and TIFFReadCustomDirectory(). + +
    • tif_readdir.c: Added case in EstimateStripByteCounts() for tiled + files. Modified TIFFReadDirectory() to not invoke + EstimateStripByteCounts() for case where entry 0 and 1 are unequal but + one of them is zero. + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1204 + +
    • tif_open.c, tif_dirread.c, tiffiop.h: Move IFD looping + checking code in the separate function TIFFCheckDirOffset(). + +
    • tif_aux.c: Added _TIFFCheckRealloc() function. + +
    • tif_fax3.c: Fixed problems in fax decoder as per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=1194 + +
    • tif_jbig.c: Added support for JBIG compression scheme + (34661 code) contributed by Lee Howard. As per bug + + http://bugzilla.remotesensing.org/show_bug.cgi?id=896 + +
    • tif_getimage.c: Added support for planarconfig separate + non-subsampled YCbCr (i.e. separate YCbCr with subsampling [1,1]). + +
    • tif_getimage.c: Revision of all RGB(A) put routines: +
        +
      • Conversion of unassociated alpha to associated alpha + now done with more performant LUT, and calculation more + correct. +
      • Conversion of 16bit data to 8bit data now done with + more performant LUT, and calculation more correct +
      • Bugfix of handling of 16bit RGB with unassociated alpha +
      + +
    • tif_ojpeg.c: totally new implementation + +
    • tif_getimage.c: removed TIFFTAG_JPEGCOLORMODE handling + of OJPEG images in favor of tif_getimage.c native handling of + YCbCr and desubsampling. + +
    • tif_jpeg.c: JPEGVSetField() so that altering the photometric + interpretation causes the "upsampled" flag to be recomputed. Fixes + peculiar bug where photometric flag had to be set before jpegcolormode + flag. + +
    + +


    + + + +CHANGES IN THE TOOLS: + + + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • contrib/addtiffo/tif_overview.c: Fix problems with odd sized + output blocks in TIFF_DownSample_Subsampled() (bug 1542). + +
    • contrib/dbs/xtiff/xtiff.c: Make xtiff utility compilable. + Though it is still far from the state of being working and useful. + +
    + +Last updated $Date: 2009-08-20 22:57:39 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.1.html new file mode 100644 index 0000000..c97d94f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.1.html @@ -0,0 +1,115 @@ + + + + Changes in TIFF v3.9.1 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). If you don't +find something listed here, then it was not done in this timeframe, or +it was not considered important enough to be mentioned. The following +information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      +
    • This is a bug-fix release for several bugs (two of which + are dire) which were discovered in the 3.9.0 release. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • Several defines were missing from tif_config.vc.h which + are necessary to compile the library using MSVC. + +
    • Colorized tests were actually not enabled as expected. + Parallel tests mode is now also enabled so that tests can be + run in parallel, and test output is sent to .log files. + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • libtiff/tif_write.c (TIFFAppendToStrip): Remove cast + which caused libtiff to output a wrong last strip with + byte-count and strip-offset of zero. This cast was added on + the day of the 3.9.0 release. + +
    • libtiff/tif_dirwrite.c: Back out changes from 2007-11-22 + that resulted in the final strip not being written in some + circumstances. + http://bugzilla.maptools.org/show_bug.cgi?id=2088 + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      +
    • None + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • None + +
    + +Last updated $Date: 2009-08-28 18:54:11 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.2.html new file mode 100644 index 0000000..bb76794 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v3.9.2.html @@ -0,0 +1,122 @@ + + + + Changes in TIFF v3.9.2 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). If you don't +find something listed here, then it was not done in this timeframe, or +it was not considered important enough to be mentioned. The following +information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • Fixes a number of bugs present in the 3.9.1 release. + +
    • OJPEG support updated to work with IJG JPEG 7 release. + +
    • Tiffcrop validated for most TIFF storage subformats and sample depths. + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • x86_64 now uses the same default fill order as i386. + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • Writing tags with an array value of type TIFF_DOUBLE now + returns correct error status. The TIFFTAG_SMINSAMPLEVALUE and + TIFFTAG_SMAXSAMPLEVALUE tags failed to write without this fix. + +
    • OJPEG decoder now works with IJG JPEG 7. Resolves "Bug + 2090 - OJPEG crash with libjpeg v7". + http://bugzilla.maptools.org/show_bug.cgi?id=2090 + +
    • Eliminate most GCC "dereferencing type-punned pointer" + warnings. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • New tiffcrop from Richard Nolde. Major updates to add + significant functionality for reading and writing tile based + images with bit depths not a multiple of 8 which cannot be + handled by tiffcp. + +
    • Allow building tools with GCC using the "-Wformat + -Werror=format-security" flags. + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • None + +
    + +Last updated $Date: 2009-11-04 17:38:13 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.0.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.0.html new file mode 100644 index 0000000..9694a1e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.0.html @@ -0,0 +1,269 @@ + + + + Changes in TIFF v4.0.0 + + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). If you don't +find something listed here, then it was not done in this timeframe, or +it was not considered important enough to be mentioned. Please consult +the ChangeLog file in the source package for full change details. The +following information is located here: +

    +

    +


    + + + +

    MAJOR CHANGES:

    + +BigTIFF support changes: + +
      + +
    • The options parameter in the TIFFOpen and TIFFClientOpen funcs has + been extended. When creating new files, you can add option '4' to + specify you want to create a ClassicTIFF file, though that is the + default and the option is not strictly necessary. (As such, old + calling code will continue to function and create ClassicTIFF files.) + Or you can add option '8' to specify you want to create a BigTIFF file + instead. This new option is also reflected in some of the tools we + already upgraded. For instance, you can use the -8 option on tiffcp to + have tiffcp produce BigTIFF files instead of the default ClassicTIFF. + (Whilst on additional option is provided for version selection when + creating new files, no such option is necessary when reading TIFF + files. LibTiff reads ClassicTIFF and BigTIFF both, and the application + does not need to be aware which TIFF version an opened file is.) + +
    • Although the tag count in BigTIFF is 64bit, we restricted the + count in the implementation to a much more reasonable size. This is + necessary in current implementation, because all tag data gets read + automatically in the IFD reading stage, so if there's half a dozen + private tags with multiple gigabytes of data that causes considerable + overhead even if the application level is never interested in these + tags. Our choice to ignore tags with data longer then a certain sanity + value is much needed as things stand. We also recommend to step away + from writing tiles that are 8 kilobyte in their uncompressed form, or + writing single-line strips, in really big files, resulting in mega's + of tiles or strips. It's much more efficient to choose bigger tile or + strip sizes, up to several megabyte if needed, and have a few kilo of + tiles or strips instead. + +
    • Although it's rare, some application code does directly access + file offsets. Some of these are automatically upgraded because they + used the toff_t type, others need to be aware that the datatype + changed and need to start using toff_t or uint64. This impacts access + to tags like the EXIF IFD tag, for example, or the SubIfds tag, or to + StripOffsets or TileOffsets, the return type of functions like + TIFFCurrentDirOffset, and a parameter type to functions like + TIFFSetSubDirectory. + +
    • Although it's rare, some application code does use structures + like TIFFHeader or TIFFDirEntry that used to be an exact binary + representation of TIFF structures. These need to change. The old + TIFFHeader structure is replaced by the new TIFFHeaderClassic, + TIFFHeaderBig, and TIFFHeaderCommon structures that are an exact + binary representation of the ClassicTIFF and BigTIFF header, and of + the part that is common to both. There is no new equivalent for the + old TIFFDirEntry structure (or more precisely, there is still a + TIFFDirEntry structure, but it is changed, moved to library-private + definition, and no longer an exact binary representation of the tag + structure of either TIFF version). + +
    • Sizer functions, like TIFFTileSize or TIFFScanlineSize and the + like, return a tmsize_t value (tmsize_t is defined as int32 on 32bit + machines, and int64 on 64bit machines, and as such it is meant to + represent signed memory sizes). This is because we figure 98% of the + calling code uses the return value as sizes in allocations and the + like. So, any overflow that is theoretically possible with BigTIFF + when LibTiff is running on a 32bit system, is best detected inside the + sizer functions and it is best to return a type that makes sense as a + memory size. If your calling code is the exception and is interested + in actual file size, you best use the newer TIFFTileSize64 or + TIFFScanlineSize64 function that returns an uint64 type. + +
    • These TIFF tags require a 64-bit type as an argument in + libtiff 4.0.0: +
        +
      • TIFFTAG_FREEBYTECOUNTS +
      • TIFFTAG_FREEOFFSETS +
      • TIFFTAG_STRIPBYTECOUNTS +
      • TIFFTAG_STRIPOFFSETS +
      • TIFFTAG_TILEBYTECOUNTS +
      • TIFFTAG_TILEOFFSETS +
      + +
    + +Other important backward incompatible changes in the public API: + +
      +
    • TIFFRewriteField() renamed into _TIFFRewriteField() and moved out + from the public interface (from tiffio.h to tiffiop.h). Type of its + 'count' parameter changed from uint32 to tmsize_t. + +
    • TIFFMergeFieldInfo() returns non-void result now. It returns 0 + if successful and -1 if failed. Though this is now obsoleted function + and should not be used in new programs. Use the new tag extension + scheme instead. + +
    • TIFFFieldWithTag() and TIFFFieldWithName() functions now return + pointer to TIFFField constant object instead of TIFFFieldInfo. + +
    • TIFFReassignTagToIgnore() function and TIFFIgnoreSense enumeration + have been removed. They was unused and never been used properly. + Should be unneeded for high-level applications. + +
    • TIFFTagValue structure removed from the public tiffio.h + to private tif_dir.h and not accessible anymore. It should be unneeded + for high-level applications. + +
    + +


    + + +

    CHANGES IN THE SOFTWARE CONFIGURATION:

    + +
      + +
    • Updated autotools: Autoconf 2.68, Automake 1.11.1, libtool + 2.4. + +
    • Enabled support for Automake silent build rules + (--enable-silent-rules or 'make V=0') + +
    • Enabled support for Automake colorized and parallel tests. + +
    • Added detection of 64-bit integer types since libtiff 4.0 + requires use of 64-bit signed and unsigned integer types. + +
    • Libtiff now provides a more comprehensive test suite with + over 72 tests, which may be executed on Unix-like systems, or + under Microsoft Windows using MinGW/MSYS or Cygwin. + +
    • --disable-lzma configure option to disable use of liblzma. + +
    • --enable-defer-strile-load configure option to enable + experimental deferred strip/tile offset/size loading. May + cause some extremely sophisticated uses of libtiff to fail. + +
    • --enable-chunky-strip-read configure option to enable + experimental enable reading large strips in chunks in + TIFFReadScanline(). + +
    • Now always uses WIN32 native I/O functions for Microsoft + Windows except for under Cygwin. + +
    • Now provides a pkg-config support file (libtiff-4.pc). + +
    + +


    + + + +

    CHANGES IN LIBTIFF:

    + +
      + +
    • Patches/fixes made to stable libtiff (v3.9.X) are also + applied to 4.0.0. There are too many to list here. See the + distribution ChangeLog for a detailed change list. + +
    • There is considerable change in some files like + tif_dirread and tif_dirwrite. These changes don't impact + backwards compatibility, they are mostly a clean rewrite that + does allow BigTIFF support as well as somewhat more robust + reading of the unexpected already and will also serve future + API extension but does not impact current API or functionality + in a negative way that you need to know about. + +
    • Although there is still a functional definition for types + like toff_t (file offset), tstrip_t (strip index number), etc, + we recommend against using these in newer code. We have + learned that it is next to impossible to use these + consistently and make real abstraction of the binary format of + these types. Instead, at a certain level we always end up + doing casts anyway, and taking the exact binary format into + account, so these types are nothing but dangerously misleading + and obfuscating. You do not need to update calling code that + uses them, as 99.9% of such code will continue to work. But we + recommend against using them in newer calling code, and we + started replacing them with binary clear types like uint16, + uint32 and such in the library. + +
    • We do use and will continue to use one functional type + that is an exception to the above rule, being tmsize_t. This + is a signed memory size type, i.e. it is int32 on 32bit + machines, or int64 on 64bit machines. + +
    • Optionally support LZMA compression via TIFF tag 34925. + Tiffcp supports compression levels similar to "-c lzma:p1" or + "-c zip:p9 for setting the LZMA compression parameters. + +
    • Optionally defer the load of strip/tile offset and size + tags for optimized scanning of directories. Enabled with the + --enable-defer-strile-load configure option (DEFER_STRILE_LOAD + #define in tif_config.h). + +
    • Optionally enable experimental support for reading big + strips in chunks. Enabled with the --enable-chunky-strip-read + configure option. + +
    + +


    + + + +

    CHANGES IN THE TOOLS:

    + +
      + +
    • tiffset: add -d and -sd switches to allow operation on + a particular directory, not just the first. + +
    + +


    + + + +

    CHANGES IN THE CONTRIB AREA:

    + +
      +
    + +Last updated $Date: 2011-04-09 21:01:00 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.1.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.1.html new file mode 100644 index 0000000..1f113c1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.1.html @@ -0,0 +1,113 @@ + + + + Changes in TIFF v4.0.1 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). If you don't +find something listed here, then it was not done in this timeframe, or +it was not considered important enough to be mentioned. The following +information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • None + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • --enable-ld-version-script: New configure option to + enable shared library symbol versioning on ELF-based systems + (e.g. Linux and FreeBSD) which use the GNU linker. This + allows multiple major versions of libtiff to be loaded + simultaneously into the same application or library without + conflict, as long as all libtiffs involved are built with + versioned symbols. This option is not enabled by default. + +
    • Added libtiff private dependency on -llzma for pkg-config. + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      +
    • libtiff/tif_dir.c, libtiff/tif_dirread.c: Extra caution around + assumption tag fetching is always successful. + +
    • libtiff/tif_jpeg.c: Extra caution for case where sp is NULL. + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • None + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • None + +
    + +Last updated $Date: 2012-02-18 21:53:27 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.2.html b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.2.html new file mode 100644 index 0000000..c265b95 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/html/v4.0.2.html @@ -0,0 +1,118 @@ + + + + Changes in TIFF v4.0.2 + + + + + + + +TIFF CHANGE INFORMATION + + + + +

    +This document describes the changes made to the software between the +previous and current versions (see above). If you don't +find something listed here, then it was not done in this timeframe, or +it was not considered important enough to be mentioned. The following +information is located here: +

    +

    +


    + + + +MAJOR CHANGES: + +
      + +
    • None + +
    + + +


    + + +CHANGES IN THE SOFTWARE CONFIGURATION: + +
      + +
    • None + +
    + +


    + + + +CHANGES IN LIBTIFF: + +
      + +
    • tif_getimage.c: added support for _SEPARATED CMYK images. + +
    • tif_getimage.c: Added support for greyscale + alpha. + +
    • Added TIFFCreateCustomDirectory() and TIFFCreateEXIFDirectory() functions. +
    • tif_print.c: Lots of fixes around printing corrupt or + hostile input. + +
    • Improve handling of corrupt ycbcrsubsampling values. + +
    • tif_unix.c: use strerror to get meaningful error messages. + +
    • tif_jpeg.c: fix serious bugs in JPEGDecodeRaw(). + +
    • tif_jpeg.c: Fix size overflow (zdi-can-1221,CVE-2012-1173). + +
    + +


    + + + +CHANGES IN THE TOOLS: + +
      + +
    • tiff2pdf: Defend against integer overflows while + calculating required buffer sizes (CVE-2012-2113). + +
    + +


    + + + +CHANGES IN THE CONTRIB AREA: + +
      + +
    • None + +
    + +Last updated $Date: 2012-06-16 00:19:37 $. + + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3.lib b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3.lib new file mode 100644 index 0000000..2f3736b Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3.lib differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64.lib b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64.lib new file mode 100644 index 0000000..3183125 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64.lib differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64d.lib b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64d.lib new file mode 100644 index 0000000..68d53b1 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3_64d.lib differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3d.lib b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3d.lib new file mode 100644 index 0000000..e573ad5 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/lib/LibTIFF-4.0.3d.lib differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc b/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc new file mode 100644 index 0000000..6f17c68 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libtiff +Description: Tag Image File Format (TIFF) library. +Version: 4.0.3 +Libs: -L${libdir} -ltiff +Libs.private: -ljpeg -lz +Cflags: -I${includedir} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc.in b/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc.in new file mode 100644 index 0000000..abe75a6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff-4.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libtiff +Description: Tag Image File Format (TIFF) library. +Version: @VERSION@ +Libs: -L${libdir} -ltiff +Libs.private: @tiff_libs_private@ +Cflags: -I${includedir} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.am new file mode 100644 index 0000000..82fa31d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.am @@ -0,0 +1,150 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +LIBPORT = $(top_builddir)/port/libport.la +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +libtiffincludedir = $(includedir) + +EXTRA_DIST = Makefile.vc \ + SConstruct \ + tif_config.h-vms \ + tif_config.vc.h \ + tif_config.wince.h \ + tiffconf.vc.h \ + tiffconf.wince.h \ + libtiff.def \ + libtiff.map \ + libtiffxx.map + +libtiffinclude_HEADERS = \ + tiff.h \ + tiffio.h \ + tiffvers.h + +if HAVE_CXX +libtiffinclude_HEADERS += tiffio.hxx +endif + +noinst_HEADERS = \ + t4.h \ + tif_dir.h \ + tif_predict.h \ + tiffiop.h \ + uvcode.h + +nodist_libtiffinclude_HEADERS = \ + tiffconf.h + +libtiff_la_SOURCES = \ + tif_aux.c \ + tif_close.c \ + tif_codec.c \ + tif_color.c \ + tif_compress.c \ + tif_dir.c \ + tif_dirinfo.c \ + tif_dirread.c \ + tif_dirwrite.c \ + tif_dumpmode.c \ + tif_error.c \ + tif_extension.c \ + tif_fax3.c \ + tif_fax3sm.c \ + tif_flush.c \ + tif_getimage.c \ + tif_jbig.c \ + tif_jpeg.c \ + tif_jpeg_12.c \ + tif_luv.c \ + tif_lzma.c \ + tif_lzw.c \ + tif_next.c \ + tif_ojpeg.c \ + tif_open.c \ + tif_packbits.c \ + tif_pixarlog.c \ + tif_predict.c \ + tif_print.c \ + tif_read.c \ + tif_strip.c \ + tif_swab.c \ + tif_thunder.c \ + tif_tile.c \ + tif_version.c \ + tif_warning.c \ + tif_write.c \ + tif_zip.c + +libtiffxx_la_SOURCES = \ + tif_stream.cxx + +if WIN32_IO +EXTRA_DIST += tif_unix.c +libtiff_la_SOURCES += tif_win32.c +else +EXTRA_DIST += tif_win32.c +libtiff_la_SOURCES += tif_unix.c +endif + +lib_LTLIBRARIES = libtiff.la +if HAVE_CXX +lib_LTLIBRARIES += libtiffxx.la +endif + +libtiff_la_LDFLAGS = \ + -no-undefined \ + -version-info $(LIBTIFF_VERSION_INFO) +if HAVE_RPATH +libtiff_la_LDFLAGS += $(LIBDIR) +endif +if HAVE_LD_VERSION_SCRIPT +libtiff_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiff.map +endif +libtiff_la_LIBADD = $(LIBPORT) + +libtiffxx_la_LDFLAGS = \ + -no-undefined \ + -version-info $(LIBTIFF_VERSION_INFO) +if HAVE_RPATH +libtiffxx_la_LDFLAGS += $(LIBDIR) +endif +if HAVE_LD_VERSION_SCRIPT +libtiffxx_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiffxx.map +endif +libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT) +libtiffxx_la_DEPENDENCIES = libtiff.la + +# +# The finite state machine tables used by the G3/G4 decoders +# are generated by the mkg3states program. On systems without +# make these rules have to be manually carried out. +# +noinst_PROGRAMS = mkg3states +mkg3states_SOURCES = mkg3states.c tif_fax3.h +mkg3states_LDADD = $(LIBPORT) + +faxtable: mkg3states + (rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c) + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.in new file mode 100644 index 0000000..a658342 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.in @@ -0,0 +1,915 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_CXX_TRUE@am__append_1 = tiffio.hxx +@WIN32_IO_TRUE@am__append_2 = tif_unix.c +@WIN32_IO_TRUE@am__append_3 = tif_win32.c +@WIN32_IO_FALSE@am__append_4 = tif_win32.c +@WIN32_IO_FALSE@am__append_5 = tif_unix.c +@HAVE_CXX_TRUE@am__append_6 = libtiffxx.la +@HAVE_RPATH_TRUE@am__append_7 = $(LIBDIR) +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_8 = -Wl,--version-script=$(srcdir)/libtiff.map +@HAVE_RPATH_TRUE@am__append_9 = $(LIBDIR) +@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_10 = -Wl,--version-script=$(srcdir)/libtiffxx.map +noinst_PROGRAMS = mkg3states$(EXEEXT) +subdir = libtiff +DIST_COMMON = $(am__libtiffinclude_HEADERS_DIST) $(noinst_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/tif_config.h.in $(srcdir)/tiffconf.h.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = tif_config.h tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" \ + "$(DESTDIR)$(libtiffincludedir)" \ + "$(DESTDIR)$(libtiffincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libtiff_la_DEPENDENCIES = $(LIBPORT) +am__libtiff_la_SOURCES_DIST = tif_aux.c tif_close.c tif_codec.c \ + tif_color.c tif_compress.c tif_dir.c tif_dirinfo.c \ + tif_dirread.c tif_dirwrite.c tif_dumpmode.c tif_error.c \ + tif_extension.c tif_fax3.c tif_fax3sm.c tif_flush.c \ + tif_getimage.c tif_jbig.c tif_jpeg.c tif_jpeg_12.c tif_luv.c \ + tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c \ + tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c \ + tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c \ + tif_version.c tif_warning.c tif_write.c tif_zip.c tif_win32.c \ + tif_unix.c +@WIN32_IO_TRUE@am__objects_1 = tif_win32.lo +@WIN32_IO_FALSE@am__objects_2 = tif_unix.lo +am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \ + tif_color.lo tif_compress.lo tif_dir.lo tif_dirinfo.lo \ + tif_dirread.lo tif_dirwrite.lo tif_dumpmode.lo tif_error.lo \ + tif_extension.lo tif_fax3.lo tif_fax3sm.lo tif_flush.lo \ + tif_getimage.lo tif_jbig.lo tif_jpeg.lo tif_jpeg_12.lo \ + tif_luv.lo tif_lzma.lo tif_lzw.lo tif_next.lo tif_ojpeg.lo \ + tif_open.lo tif_packbits.lo tif_pixarlog.lo tif_predict.lo \ + tif_print.lo tif_read.lo tif_strip.lo tif_swab.lo \ + tif_thunder.lo tif_tile.lo tif_version.lo tif_warning.lo \ + tif_write.lo tif_zip.lo $(am__objects_1) $(am__objects_2) +libtiff_la_OBJECTS = $(am_libtiff_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libtiff_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libtiff_la_LDFLAGS) $(LDFLAGS) -o $@ +am_libtiffxx_la_OBJECTS = tif_stream.lo +libtiffxx_la_OBJECTS = $(am_libtiffxx_la_OBJECTS) +libtiffxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libtiffxx_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_CXX_TRUE@am_libtiffxx_la_rpath = -rpath $(libdir) +PROGRAMS = $(noinst_PROGRAMS) +am_mkg3states_OBJECTS = mkg3states.$(OBJEXT) +mkg3states_OBJECTS = $(am_mkg3states_OBJECTS) +mkg3states_DEPENDENCIES = $(LIBPORT) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(libtiff_la_SOURCES) $(libtiffxx_la_SOURCES) \ + $(mkg3states_SOURCES) +DIST_SOURCES = $(am__libtiff_la_SOURCES_DIST) $(libtiffxx_la_SOURCES) \ + $(mkg3states_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__libtiffinclude_HEADERS_DIST = tiff.h tiffio.h tiffvers.h \ + tiffio.hxx +HEADERS = $(libtiffinclude_HEADERS) $(nodist_libtiffinclude_HEADERS) \ + $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBPORT = $(top_builddir)/port/libport.la +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +libtiffincludedir = $(includedir) +EXTRA_DIST = Makefile.vc SConstruct tif_config.h-vms tif_config.vc.h \ + tif_config.wince.h tiffconf.vc.h tiffconf.wince.h libtiff.def \ + libtiff.map libtiffxx.map $(am__append_2) $(am__append_4) +libtiffinclude_HEADERS = tiff.h tiffio.h tiffvers.h $(am__append_1) +noinst_HEADERS = \ + t4.h \ + tif_dir.h \ + tif_predict.h \ + tiffiop.h \ + uvcode.h + +nodist_libtiffinclude_HEADERS = \ + tiffconf.h + +libtiff_la_SOURCES = tif_aux.c tif_close.c tif_codec.c tif_color.c \ + tif_compress.c tif_dir.c tif_dirinfo.c tif_dirread.c \ + tif_dirwrite.c tif_dumpmode.c tif_error.c tif_extension.c \ + tif_fax3.c tif_fax3sm.c tif_flush.c tif_getimage.c tif_jbig.c \ + tif_jpeg.c tif_jpeg_12.c tif_luv.c tif_lzma.c tif_lzw.c \ + tif_next.c tif_ojpeg.c tif_open.c tif_packbits.c \ + tif_pixarlog.c tif_predict.c tif_print.c tif_read.c \ + tif_strip.c tif_swab.c tif_thunder.c tif_tile.c tif_version.c \ + tif_warning.c tif_write.c tif_zip.c $(am__append_3) \ + $(am__append_5) +libtiffxx_la_SOURCES = \ + tif_stream.cxx + +lib_LTLIBRARIES = libtiff.la $(am__append_6) +libtiff_la_LDFLAGS = -no-undefined -version-info \ + $(LIBTIFF_VERSION_INFO) $(am__append_7) $(am__append_8) +libtiff_la_LIBADD = $(LIBPORT) +libtiffxx_la_LDFLAGS = -no-undefined -version-info \ + $(LIBTIFF_VERSION_INFO) $(am__append_9) $(am__append_10) +libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT) +libtiffxx_la_DEPENDENCIES = libtiff.la +mkg3states_SOURCES = mkg3states.c tif_fax3.h +mkg3states_LDADD = $(LIBPORT) +all: tif_config.h tiffconf.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .cxx .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libtiff/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libtiff/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +tif_config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/tif_config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status libtiff/tif_config.h +$(srcdir)/tif_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +tiffconf.h: stamp-h2 + @if test ! -f $@; then rm -f stamp-h2; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h2; else :; fi + +stamp-h2: $(srcdir)/tiffconf.h.in $(top_builddir)/config.status + @rm -f stamp-h2 + cd $(top_builddir) && $(SHELL) ./config.status libtiff/tiffconf.h + +distclean-hdr: + -rm -f tif_config.h stamp-h1 tiffconf.h stamp-h2 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libtiff.la: $(libtiff_la_OBJECTS) $(libtiff_la_DEPENDENCIES) $(EXTRA_libtiff_la_DEPENDENCIES) + $(AM_V_CCLD)$(libtiff_la_LINK) -rpath $(libdir) $(libtiff_la_OBJECTS) $(libtiff_la_LIBADD) $(LIBS) +libtiffxx.la: $(libtiffxx_la_OBJECTS) $(libtiffxx_la_DEPENDENCIES) $(EXTRA_libtiffxx_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libtiffxx_la_LINK) $(am_libtiffxx_la_rpath) $(libtiffxx_la_OBJECTS) $(libtiffxx_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +mkg3states$(EXEEXT): $(mkg3states_OBJECTS) $(mkg3states_DEPENDENCIES) $(EXTRA_mkg3states_DEPENDENCIES) + @rm -f mkg3states$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mkg3states_OBJECTS) $(mkg3states_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkg3states.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_aux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_close.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_codec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_compress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dir.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dirwrite.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_dumpmode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_extension.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_fax3sm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_flush.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_getimage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_next.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_ojpeg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_open.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_packbits.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_pixarlog.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_predict.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_print.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_strip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_swab.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_thunder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_tile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_warning.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_write.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_zip.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +.cxx.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cxx.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cxx.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-libtiffincludeHEADERS: $(libtiffinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(libtiffinclude_HEADERS)'; test -n "$(libtiffincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libtiffincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libtiffincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libtiffincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libtiffincludedir)" || exit $$?; \ + done + +uninstall-libtiffincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libtiffinclude_HEADERS)'; test -n "$(libtiffincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libtiffincludedir)'; $(am__uninstall_files_from_dir) +install-nodist_libtiffincludeHEADERS: $(nodist_libtiffinclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_libtiffinclude_HEADERS)'; test -n "$(libtiffincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libtiffincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libtiffincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libtiffincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libtiffincludedir)" || exit $$?; \ + done + +uninstall-nodist_libtiffincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_libtiffinclude_HEADERS)'; test -n "$(libtiffincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libtiffincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) tif_config.h.in tiffconf.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) tif_config.h.in tiffconf.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) tif_config.h.in tiffconf.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) tif_config.h.in tiffconf.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) tif_config.h \ + tiffconf.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libtiffincludedir)" "$(DESTDIR)$(libtiffincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-libtiffincludeHEADERS \ + install-nodist_libtiffincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-libtiffincludeHEADERS \ + uninstall-nodist_libtiffincludeHEADERS + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ + cscopelist ctags distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-libtiffincludeHEADERS install-man \ + install-nodist_libtiffincludeHEADERS install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-libtiffincludeHEADERS \ + uninstall-nodist_libtiffincludeHEADERS + + +faxtable: mkg3states + (rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.vc new file mode 100644 index 0000000..42792ba --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/Makefile.vc @@ -0,0 +1,102 @@ +# $Id: Makefile.vc,v 1.22 2009-06-23 18:25:43 fwarmerdam Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# Makefile for MS Visual C and Watcom C compilers. +# +# To build: +# C:\libtiff\libtiff> nmake /f makefile.vc all +# + +!INCLUDE ..\nmake.opt + +INCL = -I. $(JPEG_INCLUDE) $(ZLIB_INCLUDE) $(JBIG_INCLUDE) + +!IFDEF USE_WIN_CRT_LIB +OBJ_SYSDEP_MODULE = tif_unix.obj +!ELSE +OBJ_SYSDEP_MODULE = tif_win32.obj +!ENDIF + +OBJ = \ + tif_aux.obj \ + tif_close.obj \ + tif_codec.obj \ + tif_color.obj \ + tif_compress.obj \ + tif_dir.obj \ + tif_dirinfo.obj \ + tif_dirread.obj \ + tif_dirwrite.obj \ + tif_dumpmode.obj \ + tif_error.obj \ + tif_extension.obj \ + tif_fax3.obj \ + tif_fax3sm.obj \ + tif_getimage.obj \ + tif_jbig.obj \ + tif_jpeg.obj \ + tif_jpeg_12.obj \ + tif_ojpeg.obj \ + tif_flush.obj \ + tif_luv.obj \ + tif_lzw.obj \ + tif_next.obj \ + tif_open.obj \ + tif_packbits.obj \ + tif_pixarlog.obj \ + tif_predict.obj \ + tif_print.obj \ + tif_read.obj \ + tif_stream.obj \ + tif_swab.obj \ + tif_strip.obj \ + tif_thunder.obj \ + tif_tile.obj \ + tif_version.obj \ + tif_warning.obj \ + tif_write.obj \ + tif_zip.obj \ + $(OBJ_SYSDEP_MODULE) + +all: libtiff.lib $(DLLNAME) + +tif_config.h: tif_config.vc.h + copy tif_config.vc.h tif_config.h + +tiffconf.h: tiffconf.vc.h + copy tiffconf.vc.h tiffconf.h + +libtiff.lib: tif_config.h tiffconf.h $(OBJ) + $(AR) /out:libtiff.lib $(OBJ) $(LIBS) + +$(DLLNAME): tif_config.h tiffconf.h libtiff.def $(OBJ) + $(LD) /debug /dll /def:libtiff.def /out:$(DLLNAME) \ + /implib:libtiff_i.lib $(OBJ) $(LIBS) + +clean: + -del tif_config.h tiffconf.h + -del *.obj + -del *.lib + -del *.dll + -del *.dll.manifest + -del *.pdb diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/SConstruct b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/SConstruct new file mode 100644 index 0000000..cb6a7cc --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/SConstruct @@ -0,0 +1,73 @@ +# $Id: SConstruct,v 1.4 2007/02/24 15:03:50 dron Exp $ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2005, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# This file contains rules to build software with the SCons tool +# (see the http://www.scons.org/ for details on SCons). + +# Import globally defined options +Import([ 'env', 'idir_lib' ]) + +SRCS = [ \ + 'tif_aux.c', \ + 'tif_close.c', \ + 'tif_codec.c', \ + 'tif_color.c', \ + 'tif_compress.c', \ + 'tif_dir.c', \ + 'tif_dirinfo.c', \ + 'tif_dirread.c', \ + 'tif_dirwrite.c', \ + 'tif_dumpmode.c', \ + 'tif_error.c', \ + 'tif_extension.c', \ + 'tif_fax3.c', \ + 'tif_fax3sm.c', \ + 'tif_flush.c', \ + 'tif_getimage.c', \ + 'tif_jbig.c', \ + 'tif_jpeg.c', \ + 'tif_luv.c', \ + 'tif_lzw.c', \ + 'tif_next.c', \ + 'tif_ojpeg.c', \ + 'tif_open.c', \ + 'tif_packbits.c', \ + 'tif_pixarlog.c', \ + 'tif_predict.c', \ + 'tif_print.c', \ + 'tif_read.c', \ + 'tif_strip.c', \ + 'tif_swab.c', \ + 'tif_thunder.c', \ + 'tif_tile.c', \ + 'tif_unix.c', \ + 'tif_version.c', \ + 'tif_warning.c', \ + 'tif_write.c', \ + 'tif_zip.c' ] + +StaticLibrary('tiff', SRCS) +SharedLibrary('tiff', SRCS) + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.def b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.def new file mode 100644 index 0000000..892ad23 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.def @@ -0,0 +1,158 @@ +EXPORTS TIFFOpen + TIFFOpenW + TIFFGetVersion + TIFFCleanup + TIFFClose + TIFFFlush + TIFFFlushData + TIFFGetField + TIFFVGetField + TIFFGetFieldDefaulted + TIFFVGetFieldDefaulted + TIFFGetTagListEntry + TIFFGetTagListCount + TIFFReadDirectory + TIFFScanlineSize64 + TIFFScanlineSize + TIFFStripSize64 + TIFFStripSize + TIFFVStripSize64 + TIFFVStripSize + TIFFRawStripSize64 + TIFFRawStripSize + TIFFTileRowSize64 + TIFFTileRowSize + TIFFTileSize64 + TIFFTileSize + TIFFVTileSize64 + TIFFVTileSize + TIFFFileno + TIFFSetFileno + TIFFGetMode + TIFFIsTiled + TIFFIsByteSwapped + TIFFIsBigEndian + TIFFIsMSB2LSB + TIFFIsUpSampled + TIFFCIELabToRGBInit + TIFFCIELabToXYZ + TIFFXYZToRGB + TIFFYCbCrToRGBInit + TIFFYCbCrtoRGB + TIFFCurrentRow + TIFFCurrentDirectory + TIFFCurrentStrip + TIFFCurrentTile + TIFFDataWidth + TIFFReadBufferSetup + TIFFWriteBufferSetup + TIFFSetupStrips + TIFFLastDirectory + TIFFSetDirectory + TIFFSetSubDirectory + TIFFUnlinkDirectory + TIFFSetField + TIFFVSetField + TIFFCheckpointDirectory + TIFFWriteDirectory + TIFFRewriteDirectory + TIFFPrintDirectory + TIFFReadScanline + TIFFWriteScanline + TIFFReadRGBAImage + TIFFReadRGBAImageOriented + TIFFFdOpen + TIFFClientOpen + TIFFFileName + TIFFError + TIFFErrorExt + TIFFWarning + TIFFWarningExt + TIFFSetErrorHandler + TIFFSetErrorHandlerExt + TIFFSetWarningHandler + TIFFSetWarningHandlerExt + TIFFComputeTile + TIFFCheckTile + TIFFNumberOfTiles + TIFFReadTile + TIFFWriteTile + TIFFComputeStrip + TIFFNumberOfStrips + TIFFRGBAImageBegin + TIFFRGBAImageGet + TIFFRGBAImageEnd + TIFFReadEncodedStrip + TIFFReadRawStrip + TIFFReadEncodedTile + TIFFReadRawTile + TIFFReadRGBATile + TIFFReadRGBAStrip + TIFFWriteEncodedStrip + TIFFWriteRawStrip + TIFFWriteEncodedTile + TIFFWriteRawTile + TIFFSetWriteOffset + TIFFSwabFloat + TIFFSwabDouble + TIFFSwabShort + TIFFSwabLong + TIFFSwabArrayOfShort + TIFFSwabArrayOfLong + TIFFSwabArrayOfFloat + TIFFSwabArrayOfDouble + TIFFSwabArrayOfTriples + TIFFReverseBits + TIFFGetBitRevTable + TIFFDefaultStripSize + TIFFDefaultTileSize + TIFFRasterScanlineSize64 + TIFFRasterScanlineSize + _TIFFmalloc + _TIFFrealloc + _TIFFfree + _TIFFmemset + _TIFFmemcpy + _TIFFmemcmp + _TIFFCheckMalloc + TIFFCreateDirectory + TIFFSetTagExtender + TIFFFieldWithName + TIFFFieldWithTag + TIFFFieldTag + TIFFFieldName + TIFFFieldDataType + TIFFFieldPassCount + TIFFFieldReadCount + TIFFFieldWriteCount + TIFFCurrentDirOffset + TIFFWriteCheck + TIFFRGBAImageOK + TIFFNumberOfDirectories + TIFFSetFileName + TIFFSetClientdata + TIFFSetMode + TIFFClientdata + TIFFGetReadProc + TIFFGetWriteProc + TIFFGetSeekProc + TIFFGetCloseProc + TIFFGetSizeProc + TIFFGetMapFileProc + TIFFGetUnmapFileProc + TIFFIsCODECConfigured + TIFFGetConfiguredCODECs + TIFFFindCODEC + TIFFRegisterCODEC + TIFFUnRegisterCODEC + TIFFFreeDirectory + TIFFReadCustomDirectory + TIFFReadEXIFDirectory + TIFFAccessTagMethods + TIFFGetClientInfo + TIFFSetClientInfo + TIFFSwabLong8 + TIFFSwabArrayOfLong8 + TIFFFindField + TIFFUnsetField + TIFFMergeFieldInfo diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.map b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.map new file mode 100644 index 0000000..2fc177f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiff.map @@ -0,0 +1,4 @@ +LIBTIFF_4.0 { + global: + *; +}; diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiffxx.map b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiffxx.map new file mode 100644 index 0000000..e2f648f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/libtiffxx.map @@ -0,0 +1,4 @@ +LIBTIFFXX_4.0 { + global: + *; +}; diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/mkg3states.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/mkg3states.c new file mode 100644 index 0000000..1df9ccc --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/mkg3states.c @@ -0,0 +1,451 @@ +/* "$Id: mkg3states.c,v 1.11 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* Initialise fax decoder tables + * Decoder support is derived, with permission, from the code + * in Frank Cringle's viewfax program; + * Copyright (C) 1990, 1995 Frank D. Cringle. + */ +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tif_fax3.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#define streq(a,b) (strcmp(a,b) == 0) + +/* NB: can't use names in tif_fax3.h 'cuz they are declared const */ +TIFFFaxTabEnt MainTable[128]; +TIFFFaxTabEnt WhiteTable[4096]; +TIFFFaxTabEnt BlackTable[8192]; + +struct proto { + uint16 code; /* right justified, lsb-first, zero filled */ + uint16 val; /* (pixel count)<<4 + code width */ +}; + +static struct proto Pass[] = { +{ 0x0008, 4 }, +{ 0, 0 } +}; + +static struct proto Horiz[] = { +{ 0x0004, 3 }, +{ 0, 0 } +}; + +static struct proto V0[] = { +{ 0x0001, 1 }, +{ 0, 0 } +}; + +static struct proto VR[] = { +{ 0x0006, (1<<4)+3 }, +{ 0x0030, (2<<4)+6 }, +{ 0x0060, (3<<4)+7 }, +{ 0, 0 } +}; + +static struct proto VL[] = { +{ 0x0002, (1<<4)+3 }, +{ 0x0010, (2<<4)+6 }, +{ 0x0020, (3<<4)+7 }, +{ 0, 0 } +}; + +static struct proto Ext[] = { +{ 0x0040, 7 }, +{ 0, 0 } +}; + +static struct proto EOLV[] = { +{ 0x0000, 7 }, +{ 0, 0 } +}; + +static struct proto MakeUpW[] = { +{ 0x001b, 1029 }, +{ 0x0009, 2053 }, +{ 0x003a, 3078 }, +{ 0x0076, 4103 }, +{ 0x006c, 5128 }, +{ 0x00ec, 6152 }, +{ 0x0026, 7176 }, +{ 0x00a6, 8200 }, +{ 0x0016, 9224 }, +{ 0x00e6, 10248 }, +{ 0x0066, 11273 }, +{ 0x0166, 12297 }, +{ 0x0096, 13321 }, +{ 0x0196, 14345 }, +{ 0x0056, 15369 }, +{ 0x0156, 16393 }, +{ 0x00d6, 17417 }, +{ 0x01d6, 18441 }, +{ 0x0036, 19465 }, +{ 0x0136, 20489 }, +{ 0x00b6, 21513 }, +{ 0x01b6, 22537 }, +{ 0x0032, 23561 }, +{ 0x0132, 24585 }, +{ 0x00b2, 25609 }, +{ 0x0006, 26630 }, +{ 0x01b2, 27657 }, +{ 0, 0 } +}; + +static struct proto MakeUpB[] = { +{ 0x03c0, 1034 }, +{ 0x0130, 2060 }, +{ 0x0930, 3084 }, +{ 0x0da0, 4108 }, +{ 0x0cc0, 5132 }, +{ 0x02c0, 6156 }, +{ 0x0ac0, 7180 }, +{ 0x06c0, 8205 }, +{ 0x16c0, 9229 }, +{ 0x0a40, 10253 }, +{ 0x1a40, 11277 }, +{ 0x0640, 12301 }, +{ 0x1640, 13325 }, +{ 0x09c0, 14349 }, +{ 0x19c0, 15373 }, +{ 0x05c0, 16397 }, +{ 0x15c0, 17421 }, +{ 0x0dc0, 18445 }, +{ 0x1dc0, 19469 }, +{ 0x0940, 20493 }, +{ 0x1940, 21517 }, +{ 0x0540, 22541 }, +{ 0x1540, 23565 }, +{ 0x0b40, 24589 }, +{ 0x1b40, 25613 }, +{ 0x04c0, 26637 }, +{ 0x14c0, 27661 }, +{ 0, 0 } +}; + +static struct proto MakeUp[] = { +{ 0x0080, 28683 }, +{ 0x0180, 29707 }, +{ 0x0580, 30731 }, +{ 0x0480, 31756 }, +{ 0x0c80, 32780 }, +{ 0x0280, 33804 }, +{ 0x0a80, 34828 }, +{ 0x0680, 35852 }, +{ 0x0e80, 36876 }, +{ 0x0380, 37900 }, +{ 0x0b80, 38924 }, +{ 0x0780, 39948 }, +{ 0x0f80, 40972 }, +{ 0, 0 } +}; + +static struct proto TermW[] = { +{ 0x00ac, 8 }, +{ 0x0038, 22 }, +{ 0x000e, 36 }, +{ 0x0001, 52 }, +{ 0x000d, 68 }, +{ 0x0003, 84 }, +{ 0x0007, 100 }, +{ 0x000f, 116 }, +{ 0x0019, 133 }, +{ 0x0005, 149 }, +{ 0x001c, 165 }, +{ 0x0002, 181 }, +{ 0x0004, 198 }, +{ 0x0030, 214 }, +{ 0x000b, 230 }, +{ 0x002b, 246 }, +{ 0x0015, 262 }, +{ 0x0035, 278 }, +{ 0x0072, 295 }, +{ 0x0018, 311 }, +{ 0x0008, 327 }, +{ 0x0074, 343 }, +{ 0x0060, 359 }, +{ 0x0010, 375 }, +{ 0x000a, 391 }, +{ 0x006a, 407 }, +{ 0x0064, 423 }, +{ 0x0012, 439 }, +{ 0x000c, 455 }, +{ 0x0040, 472 }, +{ 0x00c0, 488 }, +{ 0x0058, 504 }, +{ 0x00d8, 520 }, +{ 0x0048, 536 }, +{ 0x00c8, 552 }, +{ 0x0028, 568 }, +{ 0x00a8, 584 }, +{ 0x0068, 600 }, +{ 0x00e8, 616 }, +{ 0x0014, 632 }, +{ 0x0094, 648 }, +{ 0x0054, 664 }, +{ 0x00d4, 680 }, +{ 0x0034, 696 }, +{ 0x00b4, 712 }, +{ 0x0020, 728 }, +{ 0x00a0, 744 }, +{ 0x0050, 760 }, +{ 0x00d0, 776 }, +{ 0x004a, 792 }, +{ 0x00ca, 808 }, +{ 0x002a, 824 }, +{ 0x00aa, 840 }, +{ 0x0024, 856 }, +{ 0x00a4, 872 }, +{ 0x001a, 888 }, +{ 0x009a, 904 }, +{ 0x005a, 920 }, +{ 0x00da, 936 }, +{ 0x0052, 952 }, +{ 0x00d2, 968 }, +{ 0x004c, 984 }, +{ 0x00cc, 1000 }, +{ 0x002c, 1016 }, +{ 0, 0 } +}; + +static struct proto TermB[] = { +{ 0x03b0, 10 }, +{ 0x0002, 19 }, +{ 0x0003, 34 }, +{ 0x0001, 50 }, +{ 0x0006, 67 }, +{ 0x000c, 84 }, +{ 0x0004, 100 }, +{ 0x0018, 117 }, +{ 0x0028, 134 }, +{ 0x0008, 150 }, +{ 0x0010, 167 }, +{ 0x0050, 183 }, +{ 0x0070, 199 }, +{ 0x0020, 216 }, +{ 0x00e0, 232 }, +{ 0x0030, 249 }, +{ 0x03a0, 266 }, +{ 0x0060, 282 }, +{ 0x0040, 298 }, +{ 0x0730, 315 }, +{ 0x00b0, 331 }, +{ 0x01b0, 347 }, +{ 0x0760, 363 }, +{ 0x00a0, 379 }, +{ 0x0740, 395 }, +{ 0x00c0, 411 }, +{ 0x0530, 428 }, +{ 0x0d30, 444 }, +{ 0x0330, 460 }, +{ 0x0b30, 476 }, +{ 0x0160, 492 }, +{ 0x0960, 508 }, +{ 0x0560, 524 }, +{ 0x0d60, 540 }, +{ 0x04b0, 556 }, +{ 0x0cb0, 572 }, +{ 0x02b0, 588 }, +{ 0x0ab0, 604 }, +{ 0x06b0, 620 }, +{ 0x0eb0, 636 }, +{ 0x0360, 652 }, +{ 0x0b60, 668 }, +{ 0x05b0, 684 }, +{ 0x0db0, 700 }, +{ 0x02a0, 716 }, +{ 0x0aa0, 732 }, +{ 0x06a0, 748 }, +{ 0x0ea0, 764 }, +{ 0x0260, 780 }, +{ 0x0a60, 796 }, +{ 0x04a0, 812 }, +{ 0x0ca0, 828 }, +{ 0x0240, 844 }, +{ 0x0ec0, 860 }, +{ 0x01c0, 876 }, +{ 0x0e40, 892 }, +{ 0x0140, 908 }, +{ 0x01a0, 924 }, +{ 0x09a0, 940 }, +{ 0x0d40, 956 }, +{ 0x0340, 972 }, +{ 0x05a0, 988 }, +{ 0x0660, 1004 }, +{ 0x0e60, 1020 }, +{ 0, 0 } +}; + +static struct proto EOLH[] = { +{ 0x0000, 11 }, +{ 0, 0 } +}; + +static void +FillTable(TIFFFaxTabEnt *T, int Size, struct proto *P, int State) +{ + int limit = 1 << Size; + + while (P->val) { + int width = P->val & 15; + int param = P->val >> 4; + int incr = 1 << width; + int code; + for (code = P->code; code < limit; code += incr) { + TIFFFaxTabEnt *E = T+code; + E->State = State; + E->Width = width; + E->Param = param; + } + P++; + } +} + +static char* storage_class = ""; +static char* const_class = ""; +static int packoutput = 1; +static char* prebrace = ""; +static char* postbrace = ""; + +void +WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name) +{ + int i; + char* sep; + + fprintf(fd, "%s %s TIFFFaxTabEnt %s[%d] = {", + storage_class, const_class, name, Size); + if (packoutput) { + sep = "\n"; + for (i = 0; i < Size; i++) { + fprintf(fd, "%s%s%d,%d,%d%s", + sep, prebrace, T->State, T->Width, (int) T->Param, postbrace); + if (((i+1) % 10) == 0) + sep = ",\n"; + else + sep = ","; + T++; + } + } else { + sep = "\n "; + for (i = 0; i < Size; i++) { + fprintf(fd, "%s%s%3d,%3d,%4d%s", + sep, prebrace, T->State, T->Width, (int) T->Param, postbrace); + if (((i+1) % 6) == 0) + sep = ",\n "; + else + sep = ","; + T++; + } + } + fprintf(fd, "\n};\n"); +} + +/* initialise the huffman code tables */ +int +main(int argc, char* argv[]) +{ + FILE* fd; + char* outputfile; + int c; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "c:s:bp")) != -1) + switch (c) { + case 'c': + const_class = optarg; + break; + case 's': + storage_class = optarg; + break; + case 'p': + packoutput = 0; + break; + case 'b': + prebrace = "{"; + postbrace = "}"; + break; + case '?': + fprintf(stderr, + "usage: %s [-c const] [-s storage] [-p] [-b] file\n", + argv[0]); + return (-1); + } + outputfile = optind < argc ? argv[optind] : "g3states.h"; + fd = fopen(outputfile, "w"); + if (fd == NULL) { + fprintf(stderr, "%s: %s: Cannot create output file.\n", + argv[0], outputfile); + return (-2); + } + FillTable(MainTable, 7, Pass, S_Pass); + FillTable(MainTable, 7, Horiz, S_Horiz); + FillTable(MainTable, 7, V0, S_V0); + FillTable(MainTable, 7, VR, S_VR); + FillTable(MainTable, 7, VL, S_VL); + FillTable(MainTable, 7, Ext, S_Ext); + FillTable(MainTable, 7, EOLV, S_EOL); + FillTable(WhiteTable, 12, MakeUpW, S_MakeUpW); + FillTable(WhiteTable, 12, MakeUp, S_MakeUp); + FillTable(WhiteTable, 12, TermW, S_TermW); + FillTable(WhiteTable, 12, EOLH, S_EOL); + FillTable(BlackTable, 13, MakeUpB, S_MakeUpB); + FillTable(BlackTable, 13, MakeUp, S_MakeUp); + FillTable(BlackTable, 13, TermB, S_TermB); + FillTable(BlackTable, 13, EOLH, S_EOL); + + fprintf(fd, "/* WARNING, this file was automatically generated by the\n"); + fprintf(fd, " mkg3states program */\n"); + fprintf(fd, "#include \"tiff.h\"\n"); + fprintf(fd, "#include \"tif_fax3.h\"\n"); + WriteTable(fd, MainTable, 128, "TIFFFaxMainTable"); + WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable"); + WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable"); + fclose(fd); + return (0); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h1 b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h1 new file mode 100644 index 0000000..b921dfd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h1 @@ -0,0 +1 @@ +timestamp for libtiff/tif_config.h diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h2 b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h2 new file mode 100644 index 0000000..4c535bb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/stamp-h2 @@ -0,0 +1 @@ +timestamp for libtiff/tiffconf.h diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/t4.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/t4.h new file mode 100644 index 0000000..b908f54 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/t4.h @@ -0,0 +1,292 @@ +/* $Id: t4.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _T4_ +#define _T4_ +/* + * CCITT T.4 1D Huffman runlength codes and + * related definitions. Given the small sizes + * of these tables it does not seem + * worthwhile to make code & length 8 bits. + */ +typedef struct tableentry { + unsigned short length; /* bit length of g3 code */ + unsigned short code; /* g3 code */ + short runlen; /* run length in bits */ +} tableentry; + +#define EOL 0x001 /* EOL code value - 0000 0000 0000 1 */ + +/* status values returned instead of a run length */ +#define G3CODE_EOL -1 /* NB: ACT_EOL - ACT_WRUNT */ +#define G3CODE_INVALID -2 /* NB: ACT_INVALID - ACT_WRUNT */ +#define G3CODE_EOF -3 /* end of input data */ +#define G3CODE_INCOMP -4 /* incomplete run code */ + +/* + * Note that these tables are ordered such that the + * index into the table is known to be either the + * run length, or (run length / 64) + a fixed offset. + * + * NB: The G3CODE_INVALID entries are only used + * during state generation (see mkg3states.c). + */ +#ifdef G3CODES +const tableentry TIFFFaxWhiteCodes[] = { + { 8, 0x35, 0 }, /* 0011 0101 */ + { 6, 0x7, 1 }, /* 0001 11 */ + { 4, 0x7, 2 }, /* 0111 */ + { 4, 0x8, 3 }, /* 1000 */ + { 4, 0xB, 4 }, /* 1011 */ + { 4, 0xC, 5 }, /* 1100 */ + { 4, 0xE, 6 }, /* 1110 */ + { 4, 0xF, 7 }, /* 1111 */ + { 5, 0x13, 8 }, /* 1001 1 */ + { 5, 0x14, 9 }, /* 1010 0 */ + { 5, 0x7, 10 }, /* 0011 1 */ + { 5, 0x8, 11 }, /* 0100 0 */ + { 6, 0x8, 12 }, /* 0010 00 */ + { 6, 0x3, 13 }, /* 0000 11 */ + { 6, 0x34, 14 }, /* 1101 00 */ + { 6, 0x35, 15 }, /* 1101 01 */ + { 6, 0x2A, 16 }, /* 1010 10 */ + { 6, 0x2B, 17 }, /* 1010 11 */ + { 7, 0x27, 18 }, /* 0100 111 */ + { 7, 0xC, 19 }, /* 0001 100 */ + { 7, 0x8, 20 }, /* 0001 000 */ + { 7, 0x17, 21 }, /* 0010 111 */ + { 7, 0x3, 22 }, /* 0000 011 */ + { 7, 0x4, 23 }, /* 0000 100 */ + { 7, 0x28, 24 }, /* 0101 000 */ + { 7, 0x2B, 25 }, /* 0101 011 */ + { 7, 0x13, 26 }, /* 0010 011 */ + { 7, 0x24, 27 }, /* 0100 100 */ + { 7, 0x18, 28 }, /* 0011 000 */ + { 8, 0x2, 29 }, /* 0000 0010 */ + { 8, 0x3, 30 }, /* 0000 0011 */ + { 8, 0x1A, 31 }, /* 0001 1010 */ + { 8, 0x1B, 32 }, /* 0001 1011 */ + { 8, 0x12, 33 }, /* 0001 0010 */ + { 8, 0x13, 34 }, /* 0001 0011 */ + { 8, 0x14, 35 }, /* 0001 0100 */ + { 8, 0x15, 36 }, /* 0001 0101 */ + { 8, 0x16, 37 }, /* 0001 0110 */ + { 8, 0x17, 38 }, /* 0001 0111 */ + { 8, 0x28, 39 }, /* 0010 1000 */ + { 8, 0x29, 40 }, /* 0010 1001 */ + { 8, 0x2A, 41 }, /* 0010 1010 */ + { 8, 0x2B, 42 }, /* 0010 1011 */ + { 8, 0x2C, 43 }, /* 0010 1100 */ + { 8, 0x2D, 44 }, /* 0010 1101 */ + { 8, 0x4, 45 }, /* 0000 0100 */ + { 8, 0x5, 46 }, /* 0000 0101 */ + { 8, 0xA, 47 }, /* 0000 1010 */ + { 8, 0xB, 48 }, /* 0000 1011 */ + { 8, 0x52, 49 }, /* 0101 0010 */ + { 8, 0x53, 50 }, /* 0101 0011 */ + { 8, 0x54, 51 }, /* 0101 0100 */ + { 8, 0x55, 52 }, /* 0101 0101 */ + { 8, 0x24, 53 }, /* 0010 0100 */ + { 8, 0x25, 54 }, /* 0010 0101 */ + { 8, 0x58, 55 }, /* 0101 1000 */ + { 8, 0x59, 56 }, /* 0101 1001 */ + { 8, 0x5A, 57 }, /* 0101 1010 */ + { 8, 0x5B, 58 }, /* 0101 1011 */ + { 8, 0x4A, 59 }, /* 0100 1010 */ + { 8, 0x4B, 60 }, /* 0100 1011 */ + { 8, 0x32, 61 }, /* 0011 0010 */ + { 8, 0x33, 62 }, /* 0011 0011 */ + { 8, 0x34, 63 }, /* 0011 0100 */ + { 5, 0x1B, 64 }, /* 1101 1 */ + { 5, 0x12, 128 }, /* 1001 0 */ + { 6, 0x17, 192 }, /* 0101 11 */ + { 7, 0x37, 256 }, /* 0110 111 */ + { 8, 0x36, 320 }, /* 0011 0110 */ + { 8, 0x37, 384 }, /* 0011 0111 */ + { 8, 0x64, 448 }, /* 0110 0100 */ + { 8, 0x65, 512 }, /* 0110 0101 */ + { 8, 0x68, 576 }, /* 0110 1000 */ + { 8, 0x67, 640 }, /* 0110 0111 */ + { 9, 0xCC, 704 }, /* 0110 0110 0 */ + { 9, 0xCD, 768 }, /* 0110 0110 1 */ + { 9, 0xD2, 832 }, /* 0110 1001 0 */ + { 9, 0xD3, 896 }, /* 0110 1001 1 */ + { 9, 0xD4, 960 }, /* 0110 1010 0 */ + { 9, 0xD5, 1024 }, /* 0110 1010 1 */ + { 9, 0xD6, 1088 }, /* 0110 1011 0 */ + { 9, 0xD7, 1152 }, /* 0110 1011 1 */ + { 9, 0xD8, 1216 }, /* 0110 1100 0 */ + { 9, 0xD9, 1280 }, /* 0110 1100 1 */ + { 9, 0xDA, 1344 }, /* 0110 1101 0 */ + { 9, 0xDB, 1408 }, /* 0110 1101 1 */ + { 9, 0x98, 1472 }, /* 0100 1100 0 */ + { 9, 0x99, 1536 }, /* 0100 1100 1 */ + { 9, 0x9A, 1600 }, /* 0100 1101 0 */ + { 6, 0x18, 1664 }, /* 0110 00 */ + { 9, 0x9B, 1728 }, /* 0100 1101 1 */ + { 11, 0x8, 1792 }, /* 0000 0001 000 */ + { 11, 0xC, 1856 }, /* 0000 0001 100 */ + { 11, 0xD, 1920 }, /* 0000 0001 101 */ + { 12, 0x12, 1984 }, /* 0000 0001 0010 */ + { 12, 0x13, 2048 }, /* 0000 0001 0011 */ + { 12, 0x14, 2112 }, /* 0000 0001 0100 */ + { 12, 0x15, 2176 }, /* 0000 0001 0101 */ + { 12, 0x16, 2240 }, /* 0000 0001 0110 */ + { 12, 0x17, 2304 }, /* 0000 0001 0111 */ + { 12, 0x1C, 2368 }, /* 0000 0001 1100 */ + { 12, 0x1D, 2432 }, /* 0000 0001 1101 */ + { 12, 0x1E, 2496 }, /* 0000 0001 1110 */ + { 12, 0x1F, 2560 }, /* 0000 0001 1111 */ + { 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */ + { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */ + { 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */ + { 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */ + { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ +}; + +const tableentry TIFFFaxBlackCodes[] = { + { 10, 0x37, 0 }, /* 0000 1101 11 */ + { 3, 0x2, 1 }, /* 010 */ + { 2, 0x3, 2 }, /* 11 */ + { 2, 0x2, 3 }, /* 10 */ + { 3, 0x3, 4 }, /* 011 */ + { 4, 0x3, 5 }, /* 0011 */ + { 4, 0x2, 6 }, /* 0010 */ + { 5, 0x3, 7 }, /* 0001 1 */ + { 6, 0x5, 8 }, /* 0001 01 */ + { 6, 0x4, 9 }, /* 0001 00 */ + { 7, 0x4, 10 }, /* 0000 100 */ + { 7, 0x5, 11 }, /* 0000 101 */ + { 7, 0x7, 12 }, /* 0000 111 */ + { 8, 0x4, 13 }, /* 0000 0100 */ + { 8, 0x7, 14 }, /* 0000 0111 */ + { 9, 0x18, 15 }, /* 0000 1100 0 */ + { 10, 0x17, 16 }, /* 0000 0101 11 */ + { 10, 0x18, 17 }, /* 0000 0110 00 */ + { 10, 0x8, 18 }, /* 0000 0010 00 */ + { 11, 0x67, 19 }, /* 0000 1100 111 */ + { 11, 0x68, 20 }, /* 0000 1101 000 */ + { 11, 0x6C, 21 }, /* 0000 1101 100 */ + { 11, 0x37, 22 }, /* 0000 0110 111 */ + { 11, 0x28, 23 }, /* 0000 0101 000 */ + { 11, 0x17, 24 }, /* 0000 0010 111 */ + { 11, 0x18, 25 }, /* 0000 0011 000 */ + { 12, 0xCA, 26 }, /* 0000 1100 1010 */ + { 12, 0xCB, 27 }, /* 0000 1100 1011 */ + { 12, 0xCC, 28 }, /* 0000 1100 1100 */ + { 12, 0xCD, 29 }, /* 0000 1100 1101 */ + { 12, 0x68, 30 }, /* 0000 0110 1000 */ + { 12, 0x69, 31 }, /* 0000 0110 1001 */ + { 12, 0x6A, 32 }, /* 0000 0110 1010 */ + { 12, 0x6B, 33 }, /* 0000 0110 1011 */ + { 12, 0xD2, 34 }, /* 0000 1101 0010 */ + { 12, 0xD3, 35 }, /* 0000 1101 0011 */ + { 12, 0xD4, 36 }, /* 0000 1101 0100 */ + { 12, 0xD5, 37 }, /* 0000 1101 0101 */ + { 12, 0xD6, 38 }, /* 0000 1101 0110 */ + { 12, 0xD7, 39 }, /* 0000 1101 0111 */ + { 12, 0x6C, 40 }, /* 0000 0110 1100 */ + { 12, 0x6D, 41 }, /* 0000 0110 1101 */ + { 12, 0xDA, 42 }, /* 0000 1101 1010 */ + { 12, 0xDB, 43 }, /* 0000 1101 1011 */ + { 12, 0x54, 44 }, /* 0000 0101 0100 */ + { 12, 0x55, 45 }, /* 0000 0101 0101 */ + { 12, 0x56, 46 }, /* 0000 0101 0110 */ + { 12, 0x57, 47 }, /* 0000 0101 0111 */ + { 12, 0x64, 48 }, /* 0000 0110 0100 */ + { 12, 0x65, 49 }, /* 0000 0110 0101 */ + { 12, 0x52, 50 }, /* 0000 0101 0010 */ + { 12, 0x53, 51 }, /* 0000 0101 0011 */ + { 12, 0x24, 52 }, /* 0000 0010 0100 */ + { 12, 0x37, 53 }, /* 0000 0011 0111 */ + { 12, 0x38, 54 }, /* 0000 0011 1000 */ + { 12, 0x27, 55 }, /* 0000 0010 0111 */ + { 12, 0x28, 56 }, /* 0000 0010 1000 */ + { 12, 0x58, 57 }, /* 0000 0101 1000 */ + { 12, 0x59, 58 }, /* 0000 0101 1001 */ + { 12, 0x2B, 59 }, /* 0000 0010 1011 */ + { 12, 0x2C, 60 }, /* 0000 0010 1100 */ + { 12, 0x5A, 61 }, /* 0000 0101 1010 */ + { 12, 0x66, 62 }, /* 0000 0110 0110 */ + { 12, 0x67, 63 }, /* 0000 0110 0111 */ + { 10, 0xF, 64 }, /* 0000 0011 11 */ + { 12, 0xC8, 128 }, /* 0000 1100 1000 */ + { 12, 0xC9, 192 }, /* 0000 1100 1001 */ + { 12, 0x5B, 256 }, /* 0000 0101 1011 */ + { 12, 0x33, 320 }, /* 0000 0011 0011 */ + { 12, 0x34, 384 }, /* 0000 0011 0100 */ + { 12, 0x35, 448 }, /* 0000 0011 0101 */ + { 13, 0x6C, 512 }, /* 0000 0011 0110 0 */ + { 13, 0x6D, 576 }, /* 0000 0011 0110 1 */ + { 13, 0x4A, 640 }, /* 0000 0010 0101 0 */ + { 13, 0x4B, 704 }, /* 0000 0010 0101 1 */ + { 13, 0x4C, 768 }, /* 0000 0010 0110 0 */ + { 13, 0x4D, 832 }, /* 0000 0010 0110 1 */ + { 13, 0x72, 896 }, /* 0000 0011 1001 0 */ + { 13, 0x73, 960 }, /* 0000 0011 1001 1 */ + { 13, 0x74, 1024 }, /* 0000 0011 1010 0 */ + { 13, 0x75, 1088 }, /* 0000 0011 1010 1 */ + { 13, 0x76, 1152 }, /* 0000 0011 1011 0 */ + { 13, 0x77, 1216 }, /* 0000 0011 1011 1 */ + { 13, 0x52, 1280 }, /* 0000 0010 1001 0 */ + { 13, 0x53, 1344 }, /* 0000 0010 1001 1 */ + { 13, 0x54, 1408 }, /* 0000 0010 1010 0 */ + { 13, 0x55, 1472 }, /* 0000 0010 1010 1 */ + { 13, 0x5A, 1536 }, /* 0000 0010 1101 0 */ + { 13, 0x5B, 1600 }, /* 0000 0010 1101 1 */ + { 13, 0x64, 1664 }, /* 0000 0011 0010 0 */ + { 13, 0x65, 1728 }, /* 0000 0011 0010 1 */ + { 11, 0x8, 1792 }, /* 0000 0001 000 */ + { 11, 0xC, 1856 }, /* 0000 0001 100 */ + { 11, 0xD, 1920 }, /* 0000 0001 101 */ + { 12, 0x12, 1984 }, /* 0000 0001 0010 */ + { 12, 0x13, 2048 }, /* 0000 0001 0011 */ + { 12, 0x14, 2112 }, /* 0000 0001 0100 */ + { 12, 0x15, 2176 }, /* 0000 0001 0101 */ + { 12, 0x16, 2240 }, /* 0000 0001 0110 */ + { 12, 0x17, 2304 }, /* 0000 0001 0111 */ + { 12, 0x1C, 2368 }, /* 0000 0001 1100 */ + { 12, 0x1D, 2432 }, /* 0000 0001 1101 */ + { 12, 0x1E, 2496 }, /* 0000 0001 1110 */ + { 12, 0x1F, 2560 }, /* 0000 0001 1111 */ + { 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */ + { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */ + { 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */ + { 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */ + { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ +}; +#else +extern const tableentry TIFFFaxWhiteCodes[]; +extern const tableentry TIFFFaxBlackCodes[]; +#endif +#endif /* _T4_ */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_aux.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_aux.c new file mode 100644 index 0000000..927150a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_aux.c @@ -0,0 +1,358 @@ +/* $Id: tif_aux.c,v 1.26 2010-07-01 15:33:28 dron Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Auxiliary Support Routines. + */ +#include "tiffiop.h" +#include "tif_predict.h" +#include + +uint32 +_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where) +{ + uint32 bytes = first * second; + + if (second && bytes / second != first) { + TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where); + bytes = 0; + } + + return bytes; +} + +uint64 +_TIFFMultiply64(TIFF* tif, uint64 first, uint64 second, const char* where) +{ + uint64 bytes = first * second; + + if (second && bytes / second != first) { + TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where); + bytes = 0; + } + + return bytes; +} + +void* +_TIFFCheckRealloc(TIFF* tif, void* buffer, + tmsize_t nmemb, tmsize_t elem_size, const char* what) +{ + void* cp = NULL; + tmsize_t bytes = nmemb * elem_size; + + /* + * XXX: Check for integer overflow. + */ + if (nmemb && elem_size && bytes / elem_size == nmemb) + cp = _TIFFrealloc(buffer, bytes); + + if (cp == NULL) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Failed to allocate memory for %s " + "(%ld elements of %ld bytes each)", + what,(long) nmemb, (long) elem_size); + } + + return cp; +} + +void* +_TIFFCheckMalloc(TIFF* tif, tmsize_t nmemb, tmsize_t elem_size, const char* what) +{ + return _TIFFCheckRealloc(tif, NULL, nmemb, elem_size, what); +} + +static int +TIFFDefaultTransferFunction(TIFFDirectory* td) +{ + uint16 **tf = td->td_transferfunction; + tmsize_t i, n, nbytes; + + tf[0] = tf[1] = tf[2] = 0; + if (td->td_bitspersample >= sizeof(tmsize_t) * 8 - 2) + return 0; + + n = ((tmsize_t)1)<td_bitspersample; + nbytes = n * sizeof (uint16); + if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes))) + return 0; + tf[0][0] = 0; + for (i = 1; i < n; i++) { + double t = (double)i/((double) n-1.); + tf[0][i] = (uint16)floor(65535.*pow(t, 2.2) + .5); + } + + if (td->td_samplesperpixel - td->td_extrasamples > 1) { + if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes))) + goto bad; + _TIFFmemcpy(tf[1], tf[0], nbytes); + if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes))) + goto bad; + _TIFFmemcpy(tf[2], tf[0], nbytes); + } + return 1; + +bad: + if (tf[0]) + _TIFFfree(tf[0]); + if (tf[1]) + _TIFFfree(tf[1]); + if (tf[2]) + _TIFFfree(tf[2]); + tf[0] = tf[1] = tf[2] = 0; + return 0; +} + +static int +TIFFDefaultRefBlackWhite(TIFFDirectory* td) +{ + int i; + + if (!(td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float)))) + return 0; + if (td->td_photometric == PHOTOMETRIC_YCBCR) { + /* + * YCbCr (Class Y) images must have the ReferenceBlackWhite + * tag set. Fix the broken images, which lacks that tag. + */ + td->td_refblackwhite[0] = 0.0F; + td->td_refblackwhite[1] = td->td_refblackwhite[3] = + td->td_refblackwhite[5] = 255.0F; + td->td_refblackwhite[2] = td->td_refblackwhite[4] = 128.0F; + } else { + /* + * Assume RGB (Class R) + */ + for (i = 0; i < 3; i++) { + td->td_refblackwhite[2*i+0] = 0; + td->td_refblackwhite[2*i+1] = + (float)((1L<td_bitspersample)-1L); + } + } + return 1; +} + +/* + * Like TIFFGetField, but return any default + * value if the tag is not present in the directory. + * + * NB: We use the value in the directory, rather than + * explcit values so that defaults exist only one + * place in the library -- in TIFFDefaultDirectory. + */ +int +TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (TIFFVGetField(tif, tag, ap)) + return (1); + switch (tag) { + case TIFFTAG_SUBFILETYPE: + *va_arg(ap, uint32 *) = td->td_subfiletype; + return (1); + case TIFFTAG_BITSPERSAMPLE: + *va_arg(ap, uint16 *) = td->td_bitspersample; + return (1); + case TIFFTAG_THRESHHOLDING: + *va_arg(ap, uint16 *) = td->td_threshholding; + return (1); + case TIFFTAG_FILLORDER: + *va_arg(ap, uint16 *) = td->td_fillorder; + return (1); + case TIFFTAG_ORIENTATION: + *va_arg(ap, uint16 *) = td->td_orientation; + return (1); + case TIFFTAG_SAMPLESPERPIXEL: + *va_arg(ap, uint16 *) = td->td_samplesperpixel; + return (1); + case TIFFTAG_ROWSPERSTRIP: + *va_arg(ap, uint32 *) = td->td_rowsperstrip; + return (1); + case TIFFTAG_MINSAMPLEVALUE: + *va_arg(ap, uint16 *) = td->td_minsamplevalue; + return (1); + case TIFFTAG_MAXSAMPLEVALUE: + *va_arg(ap, uint16 *) = td->td_maxsamplevalue; + return (1); + case TIFFTAG_PLANARCONFIG: + *va_arg(ap, uint16 *) = td->td_planarconfig; + return (1); + case TIFFTAG_RESOLUTIONUNIT: + *va_arg(ap, uint16 *) = td->td_resolutionunit; + return (1); + case TIFFTAG_PREDICTOR: + { + TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data; + *va_arg(ap, uint16*) = (uint16) sp->predictor; + return 1; + } + case TIFFTAG_DOTRANGE: + *va_arg(ap, uint16 *) = 0; + *va_arg(ap, uint16 *) = (1<td_bitspersample)-1; + return (1); + case TIFFTAG_INKSET: + *va_arg(ap, uint16 *) = INKSET_CMYK; + return 1; + case TIFFTAG_NUMBEROFINKS: + *va_arg(ap, uint16 *) = 4; + return (1); + case TIFFTAG_EXTRASAMPLES: + *va_arg(ap, uint16 *) = td->td_extrasamples; + *va_arg(ap, uint16 **) = td->td_sampleinfo; + return (1); + case TIFFTAG_MATTEING: + *va_arg(ap, uint16 *) = + (td->td_extrasamples == 1 && + td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA); + return (1); + case TIFFTAG_TILEDEPTH: + *va_arg(ap, uint32 *) = td->td_tiledepth; + return (1); + case TIFFTAG_DATATYPE: + *va_arg(ap, uint16 *) = td->td_sampleformat-1; + return (1); + case TIFFTAG_SAMPLEFORMAT: + *va_arg(ap, uint16 *) = td->td_sampleformat; + return(1); + case TIFFTAG_IMAGEDEPTH: + *va_arg(ap, uint32 *) = td->td_imagedepth; + return (1); + case TIFFTAG_YCBCRCOEFFICIENTS: + { + /* defaults are from CCIR Recommendation 601-1 */ + static float ycbcrcoeffs[] = { 0.299f, 0.587f, 0.114f }; + *va_arg(ap, float **) = ycbcrcoeffs; + return 1; + } + case TIFFTAG_YCBCRSUBSAMPLING: + *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[0]; + *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[1]; + return (1); + case TIFFTAG_YCBCRPOSITIONING: + *va_arg(ap, uint16 *) = td->td_ycbcrpositioning; + return (1); + case TIFFTAG_WHITEPOINT: + { + static float whitepoint[2]; + + /* TIFF 6.0 specification tells that it is no default + value for the WhitePoint, but AdobePhotoshop TIFF + Technical Note tells that it should be CIE D50. */ + whitepoint[0] = D50_X0 / (D50_X0 + D50_Y0 + D50_Z0); + whitepoint[1] = D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0); + *va_arg(ap, float **) = whitepoint; + return 1; + } + case TIFFTAG_TRANSFERFUNCTION: + if (!td->td_transferfunction[0] && + !TIFFDefaultTransferFunction(td)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space for \"TransferFunction\" tag"); + return (0); + } + *va_arg(ap, uint16 **) = td->td_transferfunction[0]; + if (td->td_samplesperpixel - td->td_extrasamples > 1) { + *va_arg(ap, uint16 **) = td->td_transferfunction[1]; + *va_arg(ap, uint16 **) = td->td_transferfunction[2]; + } + return (1); + case TIFFTAG_REFERENCEBLACKWHITE: + if (!td->td_refblackwhite && !TIFFDefaultRefBlackWhite(td)) + return (0); + *va_arg(ap, float **) = td->td_refblackwhite; + return (1); + } + return 0; +} + +/* + * Like TIFFGetField, but return any default + * value if the tag is not present in the directory. + */ +int +TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...) +{ + int ok; + va_list ap; + + va_start(ap, tag); + ok = TIFFVGetFieldDefaulted(tif, tag, ap); + va_end(ap); + return (ok); +} + +struct _Int64Parts { + int32 low, high; +}; + +typedef union { + struct _Int64Parts part; + int64 value; +} _Int64; + +float +_TIFFUInt64ToFloat(uint64 ui64) +{ + _Int64 i; + + i.value = ui64; + if (i.part.high >= 0) { + return (float)i.value; + } else { + long double df; + df = (long double)i.value; + df += 18446744073709551616.0; /* adding 2**64 */ + return (float)df; + } +} + +double +_TIFFUInt64ToDouble(uint64 ui64) +{ + _Int64 i; + + i.value = ui64; + if (i.part.high >= 0) { + return (double)i.value; + } else { + long double df; + df = (long double)i.value; + df += 18446744073709551616.0; /* adding 2**64 */ + return (double)df; + } +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_close.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_close.c new file mode 100644 index 0000000..13d2bab --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_close.c @@ -0,0 +1,140 @@ +/* $Id: tif_close.c,v 1.19 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + */ +#include "tiffiop.h" +#include + +/************************************************************************/ +/* TIFFCleanup() */ +/************************************************************************/ + +/** + * Auxiliary function to free the TIFF structure. Given structure will be + * completetly freed, so you should save opened file handle and pointer + * to the close procedure in external variables before calling + * _TIFFCleanup(), if you will need these ones to close the file. + * + * @param tif A TIFF pointer. + */ + +void +TIFFCleanup(TIFF* tif) +{ + /* + * Flush buffered data and directory (if dirty). + */ + if (tif->tif_mode != O_RDONLY) + TIFFFlush(tif); + (*tif->tif_cleanup)(tif); + TIFFFreeDirectory(tif); + + if (tif->tif_dirlist) + _TIFFfree(tif->tif_dirlist); + + /* + * Clean up client info links. + */ + while( tif->tif_clientinfo ) + { + TIFFClientInfoLink *link = tif->tif_clientinfo; + + tif->tif_clientinfo = link->next; + _TIFFfree( link->name ); + _TIFFfree( link ); + } + + if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER)) + _TIFFfree(tif->tif_rawdata); + if (isMapped(tif)) + TIFFUnmapFileContents(tif, tif->tif_base, (toff_t)tif->tif_size); + + /* + * Clean up custom fields. + */ + if (tif->tif_fields && tif->tif_nfields > 0) { + uint32 i; + + for (i = 0; i < tif->tif_nfields; i++) { + TIFFField *fld = tif->tif_fields[i]; + if (fld->field_bit == FIELD_CUSTOM && + strncmp("Tag ", fld->field_name, 4) == 0) { + _TIFFfree(fld->field_name); + _TIFFfree(fld); + } + } + + _TIFFfree(tif->tif_fields); + } + + if (tif->tif_nfieldscompat > 0) { + uint32 i; + + for (i = 0; i < tif->tif_nfieldscompat; i++) { + if (tif->tif_fieldscompat[i].allocated_size) + _TIFFfree(tif->tif_fieldscompat[i].fields); + } + _TIFFfree(tif->tif_fieldscompat); + } + + _TIFFfree(tif); +} + +/************************************************************************/ +/* TIFFClose() */ +/************************************************************************/ + +/** + * Close a previously opened TIFF file. + * + * TIFFClose closes a file that was previously opened with TIFFOpen(). + * Any buffered data are flushed to the file, including the contents of + * the current directory (if modified); and all resources are reclaimed. + * + * @param tif A TIFF pointer. + */ + +void +TIFFClose(TIFF* tif) +{ + TIFFCloseProc closeproc = tif->tif_closeproc; + thandle_t fd = tif->tif_clientdata; + + TIFFCleanup(tif); + (void) (*closeproc)(fd); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_codec.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_codec.c new file mode 100644 index 0000000..e201667 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_codec.c @@ -0,0 +1,165 @@ +/* $Id: tif_codec.c,v 1.15 2010-12-14 12:53:00 dron Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Builtin Compression Scheme Configuration Support. + */ +#include "tiffiop.h" + +static int NotConfigured(TIFF*, int); + +#ifndef LZW_SUPPORT +#define TIFFInitLZW NotConfigured +#endif +#ifndef PACKBITS_SUPPORT +#define TIFFInitPackBits NotConfigured +#endif +#ifndef THUNDER_SUPPORT +#define TIFFInitThunderScan NotConfigured +#endif +#ifndef NEXT_SUPPORT +#define TIFFInitNeXT NotConfigured +#endif +#ifndef JPEG_SUPPORT +#define TIFFInitJPEG NotConfigured +#endif +#ifndef OJPEG_SUPPORT +#define TIFFInitOJPEG NotConfigured +#endif +#ifndef CCITT_SUPPORT +#define TIFFInitCCITTRLE NotConfigured +#define TIFFInitCCITTRLEW NotConfigured +#define TIFFInitCCITTFax3 NotConfigured +#define TIFFInitCCITTFax4 NotConfigured +#endif +#ifndef JBIG_SUPPORT +#define TIFFInitJBIG NotConfigured +#endif +#ifndef ZIP_SUPPORT +#define TIFFInitZIP NotConfigured +#endif +#ifndef PIXARLOG_SUPPORT +#define TIFFInitPixarLog NotConfigured +#endif +#ifndef LOGLUV_SUPPORT +#define TIFFInitSGILog NotConfigured +#endif +#ifndef LZMA_SUPPORT +#define TIFFInitLZMA NotConfigured +#endif + +/* + * Compression schemes statically built into the library. + */ +#ifdef VMS +const TIFFCodec _TIFFBuiltinCODECS[] = { +#else +TIFFCodec _TIFFBuiltinCODECS[] = { +#endif + { "None", COMPRESSION_NONE, TIFFInitDumpMode }, + { "LZW", COMPRESSION_LZW, TIFFInitLZW }, + { "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits }, + { "ThunderScan", COMPRESSION_THUNDERSCAN,TIFFInitThunderScan }, + { "NeXT", COMPRESSION_NEXT, TIFFInitNeXT }, + { "JPEG", COMPRESSION_JPEG, TIFFInitJPEG }, + { "Old-style JPEG", COMPRESSION_OJPEG, TIFFInitOJPEG }, + { "CCITT RLE", COMPRESSION_CCITTRLE, TIFFInitCCITTRLE }, + { "CCITT RLE/W", COMPRESSION_CCITTRLEW, TIFFInitCCITTRLEW }, + { "CCITT Group 3", COMPRESSION_CCITTFAX3, TIFFInitCCITTFax3 }, + { "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 }, + { "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG }, + { "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP }, + { "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, + { "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog }, + { "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog }, + { "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog }, + { "LZMA", COMPRESSION_LZMA, TIFFInitLZMA }, + { NULL, 0, NULL } +}; + +static int +_notConfigured(TIFF* tif) +{ + const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); + char compression_code[20]; + + sprintf( compression_code, "%d", tif->tif_dir.td_compression ); + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%s compression support is not configured", + c ? c->name : compression_code ); + return (0); +} + +static int +NotConfigured(TIFF* tif, int scheme) +{ + (void) scheme; + + tif->tif_fixuptags = _notConfigured; + tif->tif_decodestatus = FALSE; + tif->tif_setupdecode = _notConfigured; + tif->tif_encodestatus = FALSE; + tif->tif_setupencode = _notConfigured; + return (1); +} + +/************************************************************************/ +/* TIFFIsCODECConfigured() */ +/************************************************************************/ + +/** + * Check whether we have working codec for the specific coding scheme. + * + * @return returns 1 if the codec is configured and working. Otherwise + * 0 will be returned. + */ + +int +TIFFIsCODECConfigured(uint16 scheme) +{ + const TIFFCodec* codec = TIFFFindCODEC(scheme); + + if(codec == NULL) { + return 0; + } + if(codec->init == NULL) { + return 0; + } + if(codec->init != NotConfigured){ + return 1; + } + return 0; +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_color.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_color.c new file mode 100644 index 0000000..be4850c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_color.c @@ -0,0 +1,287 @@ +/* $Id: tif_color.c,v 1.19 2010-12-14 02:22:42 faxguy Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * CIE L*a*b* to CIE XYZ and CIE XYZ to RGB conversion routines are taken + * from the VIPS library (http://www.vips.ecs.soton.ac.uk) with + * the permission of John Cupitt, the VIPS author. + */ + +/* + * TIFF Library. + * + * Color space conversion routines. + */ + +#include "tiffiop.h" +#include + +/* + * Convert color value from the CIE L*a*b* 1976 space to CIE XYZ. + */ +void +TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b, + float *X, float *Y, float *Z) +{ + float L = (float)l * 100.0F / 255.0F; + float cby, tmp; + + if( L < 8.856F ) { + *Y = (L * cielab->Y0) / 903.292F; + cby = 7.787F * (*Y / cielab->Y0) + 16.0F / 116.0F; + } else { + cby = (L + 16.0F) / 116.0F; + *Y = cielab->Y0 * cby * cby * cby; + } + + tmp = (float)a / 500.0F + cby; + if( tmp < 0.2069F ) + *X = cielab->X0 * (tmp - 0.13793F) / 7.787F; + else + *X = cielab->X0 * tmp * tmp * tmp; + + tmp = cby - (float)b / 200.0F; + if( tmp < 0.2069F ) + *Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F; + else + *Z = cielab->Z0 * tmp * tmp * tmp; +} + +#define RINT(R) ((uint32)((R)>0?((R)+0.5):((R)-0.5))) +/* + * Convert color value from the XYZ space to RGB. + */ +void +TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, + uint32 *r, uint32 *g, uint32 *b) +{ + int i; + float Yr, Yg, Yb; + float *matrix = &cielab->display.d_mat[0][0]; + + /* Multiply through the matrix to get luminosity values. */ + Yr = matrix[0] * X + matrix[1] * Y + matrix[2] * Z; + Yg = matrix[3] * X + matrix[4] * Y + matrix[5] * Z; + Yb = matrix[6] * X + matrix[7] * Y + matrix[8] * Z; + + /* Clip input */ + Yr = TIFFmax(Yr, cielab->display.d_Y0R); + Yg = TIFFmax(Yg, cielab->display.d_Y0G); + Yb = TIFFmax(Yb, cielab->display.d_Y0B); + + /* Avoid overflow in case of wrong input values */ + Yr = TIFFmin(Yr, cielab->display.d_YCR); + Yg = TIFFmin(Yg, cielab->display.d_YCG); + Yb = TIFFmin(Yb, cielab->display.d_YCB); + + /* Turn luminosity to colour value. */ + i = (int)((Yr - cielab->display.d_Y0R) / cielab->rstep); + i = TIFFmin(cielab->range, i); + *r = RINT(cielab->Yr2r[i]); + + i = (int)((Yg - cielab->display.d_Y0G) / cielab->gstep); + i = TIFFmin(cielab->range, i); + *g = RINT(cielab->Yg2g[i]); + + i = (int)((Yb - cielab->display.d_Y0B) / cielab->bstep); + i = TIFFmin(cielab->range, i); + *b = RINT(cielab->Yb2b[i]); + + /* Clip output. */ + *r = TIFFmin(*r, cielab->display.d_Vrwr); + *g = TIFFmin(*g, cielab->display.d_Vrwg); + *b = TIFFmin(*b, cielab->display.d_Vrwb); +} +#undef RINT + +/* + * Allocate conversion state structures and make look_up tables for + * the Yr,Yb,Yg <=> r,g,b conversions. + */ +int +TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab, + const TIFFDisplay *display, float *refWhite) +{ + int i; + double gamma; + + cielab->range = CIELABTORGB_TABLE_RANGE; + + _TIFFmemcpy(&cielab->display, display, sizeof(TIFFDisplay)); + + /* Red */ + gamma = 1.0 / cielab->display.d_gammaR ; + cielab->rstep = + (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; + for(i = 0; i <= cielab->range; i++) { + cielab->Yr2r[i] = cielab->display.d_Vrwr + * ((float)pow((double)i / cielab->range, gamma)); + } + + /* Green */ + gamma = 1.0 / cielab->display.d_gammaG ; + cielab->gstep = + (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; + for(i = 0; i <= cielab->range; i++) { + cielab->Yg2g[i] = cielab->display.d_Vrwg + * ((float)pow((double)i / cielab->range, gamma)); + } + + /* Blue */ + gamma = 1.0 / cielab->display.d_gammaB ; + cielab->bstep = + (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; + for(i = 0; i <= cielab->range; i++) { + cielab->Yb2b[i] = cielab->display.d_Vrwb + * ((float)pow((double)i / cielab->range, gamma)); + } + + /* Init reference white point */ + cielab->X0 = refWhite[0]; + cielab->Y0 = refWhite[1]; + cielab->Z0 = refWhite[2]; + + return 0; +} + +/* + * Convert color value from the YCbCr space to CIE XYZ. + * The colorspace conversion algorithm comes from the IJG v5a code; + * see below for more information on how it works. + */ +#define SHIFT 16 +#define FIX(x) ((int32)((x) * (1L<(max)?(max):(f)) +#define HICLAMP(f,max) ((f)>(max)?(max):(f)) + +void +TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr, + uint32 *r, uint32 *g, uint32 *b) +{ + int32 i; + + /* XXX: Only 8-bit YCbCr input supported for now */ + Y = HICLAMP(Y, 255), Cb = CLAMP(Cb, 0, 255), Cr = CLAMP(Cr, 0, 255); + + i = ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr]; + *r = CLAMP(i, 0, 255); + i = ycbcr->Y_tab[Y] + + (int)((ycbcr->Cb_g_tab[Cb] + ycbcr->Cr_g_tab[Cr]) >> SHIFT); + *g = CLAMP(i, 0, 255); + i = ycbcr->Y_tab[Y] + ycbcr->Cb_b_tab[Cb]; + *b = CLAMP(i, 0, 255); +} + +/* + * Initialize the YCbCr->RGB conversion tables. The conversion + * is done according to the 6.0 spec: + * + * R = Y + Cr*(2 - 2*LumaRed) + * B = Y + Cb*(2 - 2*LumaBlue) + * G = Y + * - LumaBlue*Cb*(2-2*LumaBlue)/LumaGreen + * - LumaRed*Cr*(2-2*LumaRed)/LumaGreen + * + * To avoid floating point arithmetic the fractional constants that + * come out of the equations are represented as fixed point values + * in the range 0...2^16. We also eliminate multiplications by + * pre-calculating possible values indexed by Cb and Cr (this code + * assumes conversion is being done for 8-bit samples). + */ +int +TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite) +{ + TIFFRGBValue* clamptab; + int i; + +#define LumaRed luma[0] +#define LumaGreen luma[1] +#define LumaBlue luma[2] + + clamptab = (TIFFRGBValue*)( + (uint8*) ycbcr+TIFFroundup_32(sizeof (TIFFYCbCrToRGB), sizeof (long))); + _TIFFmemset(clamptab, 0, 256); /* v < 0 => 0 */ + ycbcr->clamptab = (clamptab += 256); + for (i = 0; i < 256; i++) + clamptab[i] = (TIFFRGBValue) i; + _TIFFmemset(clamptab+256, 255, 2*256); /* v > 255 => 255 */ + ycbcr->Cr_r_tab = (int*) (clamptab + 3*256); + ycbcr->Cb_b_tab = ycbcr->Cr_r_tab + 256; + ycbcr->Cr_g_tab = (int32*) (ycbcr->Cb_b_tab + 256); + ycbcr->Cb_g_tab = ycbcr->Cr_g_tab + 256; + ycbcr->Y_tab = ycbcr->Cb_g_tab + 256; + + { float f1 = 2-2*LumaRed; int32 D1 = FIX(f1); + float f2 = LumaRed*f1/LumaGreen; int32 D2 = -FIX(f2); + float f3 = 2-2*LumaBlue; int32 D3 = FIX(f3); + float f4 = LumaBlue*f3/LumaGreen; int32 D4 = -FIX(f4); + int x; + +#undef LumaBlue +#undef LumaGreen +#undef LumaRed + + /* + * i is the actual input pixel value in the range 0..255 + * Cb and Cr values are in the range -128..127 (actually + * they are in a range defined by the ReferenceBlackWhite + * tag) so there is some range shifting to do here when + * constructing tables indexed by the raw pixel data. + */ + for (i = 0, x = -128; i < 256; i++, x++) { + int32 Cr = (int32)Code2V(x, refBlackWhite[4] - 128.0F, + refBlackWhite[5] - 128.0F, 127); + int32 Cb = (int32)Code2V(x, refBlackWhite[2] - 128.0F, + refBlackWhite[3] - 128.0F, 127); + + ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT); + ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT); + ycbcr->Cr_g_tab[i] = D2*Cr; + ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF; + ycbcr->Y_tab[i] = + (int32)Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255); + } + } + + return 0; +} +#undef HICLAMP +#undef CLAMP +#undef Code2V +#undef SHIFT +#undef ONE_HALF +#undef FIX + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_compress.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_compress.c new file mode 100644 index 0000000..20e72fd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_compress.c @@ -0,0 +1,304 @@ +/* $Id: tif_compress.c,v 1.22 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Compression Scheme Configuration Support. + */ +#include "tiffiop.h" + +static int +TIFFNoEncode(TIFF* tif, const char* method) +{ + const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); + + if (c) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%s %s encoding is not implemented", + c->name, method); + } else { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Compression scheme %u %s encoding is not implemented", + tif->tif_dir.td_compression, method); + } + return (-1); +} + +int +_TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoEncode(tif, "scanline")); +} + +int +_TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoEncode(tif, "strip")); +} + +int +_TIFFNoTileEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoEncode(tif, "tile")); +} + +static int +TIFFNoDecode(TIFF* tif, const char* method) +{ + const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); + + if (c) + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%s %s decoding is not implemented", + c->name, method); + else + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Compression scheme %u %s decoding is not implemented", + tif->tif_dir.td_compression, method); + return (-1); +} + +int +_TIFFNoFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +int +_TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoDecode(tif, "scanline")); +} + +int +_TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoDecode(tif, "strip")); +} + +int +_TIFFNoTileDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) pp; (void) cc; (void) s; + return (TIFFNoDecode(tif, "tile")); +} + +int +_TIFFNoSeek(TIFF* tif, uint32 off) +{ + (void) off; + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Compression algorithm does not support random access"); + return (0); +} + +int +_TIFFNoPreCode(TIFF* tif, uint16 s) +{ + (void) tif; (void) s; + return (1); +} + +static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } +static void _TIFFvoid(TIFF* tif) { (void) tif; } + +void +_TIFFSetDefaultCompressionState(TIFF* tif) +{ + tif->tif_fixuptags = _TIFFNoFixupTags; + tif->tif_decodestatus = TRUE; + tif->tif_setupdecode = _TIFFtrue; + tif->tif_predecode = _TIFFNoPreCode; + tif->tif_decoderow = _TIFFNoRowDecode; + tif->tif_decodestrip = _TIFFNoStripDecode; + tif->tif_decodetile = _TIFFNoTileDecode; + tif->tif_encodestatus = TRUE; + tif->tif_setupencode = _TIFFtrue; + tif->tif_preencode = _TIFFNoPreCode; + tif->tif_postencode = _TIFFtrue; + tif->tif_encoderow = _TIFFNoRowEncode; + tif->tif_encodestrip = _TIFFNoStripEncode; + tif->tif_encodetile = _TIFFNoTileEncode; + tif->tif_close = _TIFFvoid; + tif->tif_seek = _TIFFNoSeek; + tif->tif_cleanup = _TIFFvoid; + tif->tif_defstripsize = _TIFFDefaultStripSize; + tif->tif_deftilesize = _TIFFDefaultTileSize; + tif->tif_flags &= ~(TIFF_NOBITREV|TIFF_NOREADRAW); +} + +int +TIFFSetCompressionScheme(TIFF* tif, int scheme) +{ + const TIFFCodec *c = TIFFFindCODEC((uint16) scheme); + + _TIFFSetDefaultCompressionState(tif); + /* + * Don't treat an unknown compression scheme as an error. + * This permits applications to open files with data that + * the library does not have builtin support for, but which + * may still be meaningful. + */ + return (c ? (*c->init)(tif, scheme) : 1); +} + +/* + * Other compression schemes may be registered. Registered + * schemes can also override the builtin versions provided + * by this library. + */ +typedef struct _codec { + struct _codec* next; + TIFFCodec* info; +} codec_t; +static codec_t* registeredCODECS = NULL; + +const TIFFCodec* +TIFFFindCODEC(uint16 scheme) +{ + const TIFFCodec* c; + codec_t* cd; + + for (cd = registeredCODECS; cd; cd = cd->next) + if (cd->info->scheme == scheme) + return ((const TIFFCodec*) cd->info); + for (c = _TIFFBuiltinCODECS; c->name; c++) + if (c->scheme == scheme) + return (c); + return ((const TIFFCodec*) 0); +} + +TIFFCodec* +TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init) +{ + codec_t* cd = (codec_t*) + _TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1)); + + if (cd != NULL) { + cd->info = (TIFFCodec*) ((uint8*) cd + sizeof (codec_t)); + cd->info->name = (char*) + ((uint8*) cd->info + sizeof (TIFFCodec)); + strcpy(cd->info->name, name); + cd->info->scheme = scheme; + cd->info->init = init; + cd->next = registeredCODECS; + registeredCODECS = cd; + } else { + TIFFErrorExt(0, "TIFFRegisterCODEC", + "No space to register compression scheme %s", name); + return NULL; + } + return (cd->info); +} + +void +TIFFUnRegisterCODEC(TIFFCodec* c) +{ + codec_t* cd; + codec_t** pcd; + + for (pcd = ®isteredCODECS; (cd = *pcd); pcd = &cd->next) + if (cd->info == c) { + *pcd = cd->next; + _TIFFfree(cd); + return; + } + TIFFErrorExt(0, "TIFFUnRegisterCODEC", + "Cannot remove compression scheme %s; not registered", c->name); +} + +/************************************************************************/ +/* TIFFGetConfisuredCODECs() */ +/************************************************************************/ + +/** + * Get list of configured codecs, both built-in and registered by user. + * Caller is responsible to free this structure. + * + * @return returns array of TIFFCodec records (the last record should be NULL) + * or NULL if function failed. + */ + +TIFFCodec* +TIFFGetConfiguredCODECs() +{ + int i = 1; + codec_t *cd; + const TIFFCodec* c; + TIFFCodec* codecs = NULL; + TIFFCodec* new_codecs; + + for (cd = registeredCODECS; cd; cd = cd->next) { + new_codecs = (TIFFCodec *) + _TIFFrealloc(codecs, i * sizeof(TIFFCodec)); + if (!new_codecs) { + _TIFFfree (codecs); + return NULL; + } + codecs = new_codecs; + _TIFFmemcpy(codecs + i - 1, cd, sizeof(TIFFCodec)); + i++; + } + for (c = _TIFFBuiltinCODECS; c->name; c++) { + if (TIFFIsCODECConfigured(c->scheme)) { + new_codecs = (TIFFCodec *) + _TIFFrealloc(codecs, i * sizeof(TIFFCodec)); + if (!new_codecs) { + _TIFFfree (codecs); + return NULL; + } + codecs = new_codecs; + _TIFFmemcpy(codecs + i - 1, (const void*)c, sizeof(TIFFCodec)); + i++; + } + } + + new_codecs = (TIFFCodec *) _TIFFrealloc(codecs, i * sizeof(TIFFCodec)); + if (!new_codecs) { + _TIFFfree (codecs); + return NULL; + } + codecs = new_codecs; + _TIFFmemset(codecs + i - 1, 0, sizeof(TIFFCodec)); + + return codecs; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h-vms b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h-vms new file mode 100644 index 0000000..d653bd8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h-vms @@ -0,0 +1,46 @@ +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +#define HAVE_UNISTD_H 1 + +#define HAVE_STRING_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +//#define HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +//#define HAVE_SEARCH_H 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +/* +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif +*/ + +// #define lfind _lfind diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h.in b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h.in new file mode 100644 index 0000000..b2cea35 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.h.in @@ -0,0 +1,395 @@ +/* libtiff/tif_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Support CCITT Group 3 & 4 algorithms */ +#undef CCITT_SUPPORT + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#undef CHECK_JPEG_YCBCR_SUBSAMPLING + +/* enable partial strip reading for large strips (experimental) */ +#undef CHUNKY_STRIP_READ_SUPPORT + +/* Support C++ stream API (requires C++ compiler) */ +#undef CXX_SUPPORT + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#undef DEFAULT_EXTRASAMPLE_AS_ALPHA + +/* enable deferred strip/tile offset/size loading (experimental) */ +#undef DEFER_STRILE_LOAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `floor' function. */ +#undef HAVE_FLOOR + +/* Define to 1 if you have the `getopt' function. */ +#undef HAVE_GETOPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_GLUT_GLUT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GL_GLUT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GL_GLU_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GL_GL_H + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#undef HAVE_IEEEFP + +/* Define to 1 if the system has the type `int16'. */ +#undef HAVE_INT16 + +/* Define to 1 if the system has the type `int32'. */ +#undef HAVE_INT32 + +/* Define to 1 if the system has the type `int8'. */ +#undef HAVE_INT8 + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IO_H + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* Define to 1 if you have the `jbg_newlen' function. */ +#undef HAVE_JBG_NEWLEN + +/* Define to 1 if you have the `lfind' function. */ +#undef HAVE_LFIND + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENGL_GLU_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENGL_GL_H + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_SEARCH_H + +/* Define to 1 if you have the `setmode' function. */ +#undef HAVE_SETMODE + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Use nonstandard varargs form for the GLU tesselator callback */ +#undef HAVE_VARARGS_GLU_TESSCB + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINDOWS_H + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#undef HOST_BIGENDIAN + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#undef HOST_FILLORDER + +/* Support ISO JBIG compression (requires JBIG-KIT library) */ +#undef JBIG_SUPPORT + +/* 8/12 bit libjpeg dual mode enabled */ +#undef JPEG_DUAL_MODE_8_12 + +/* Support JPEG compression (requires IJG JPEG library) */ +#undef JPEG_SUPPORT + +/* 12bit libjpeg primary include file with path */ +#undef LIBJPEG_12_PATH + +/* Support LogLuv high dynamic range encoding */ +#undef LOGLUV_SUPPORT + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Support LZMA2 compression */ +#undef LZMA_SUPPORT + +/* Support LZW algorithm */ +#undef LZW_SUPPORT + +/* Support Microsoft Document Imaging format */ +#undef MDI_SUPPORT + +/* Support NeXT 2-bit RLE algorithm */ +#undef NEXT_SUPPORT + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Support Old JPEG compresson (read-only) */ +#undef OJPEG_SUPPORT + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Support Macintosh PackBits algorithm */ +#undef PACKBITS_SUPPORT + +/* Support Pixar log-format algorithm (requires Zlib) */ +#undef PIXARLOG_SUPPORT + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `signed int', as computed by sizeof. */ +#undef SIZEOF_SIGNED_INT + +/* The size of `signed long', as computed by sizeof. */ +#undef SIZEOF_SIGNED_LONG + +/* The size of `signed long long', as computed by sizeof. */ +#undef SIZEOF_SIGNED_LONG_LONG + +/* The size of `signed short', as computed by sizeof. */ +#undef SIZEOF_SIGNED_SHORT + +/* The size of `unsigned char *', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_CHAR_P + +/* The size of `unsigned int', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_INT + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* The size of `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* The size of `unsigned short', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_SHORT + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of specified size to reduce memory usage) */ +#undef STRIPCHOP_DEFAULT + +/* Default size of the strip in bytes (when strip chopping enabled) */ +#undef STRIP_SIZE_DEFAULT + +/* Enable SubIFD tag (330) support */ +#undef SUBIFD_SUPPORT + +/* Support ThunderScan 4-bit RLE algorithm */ +#undef THUNDER_SUPPORT + +/* Signed 16-bit type */ +#undef TIFF_INT16_T + +/* Signed 32-bit type formatter */ +#undef TIFF_INT32_FORMAT + +/* Signed 32-bit type */ +#undef TIFF_INT32_T + +/* Signed 64-bit type formatter */ +#undef TIFF_INT64_FORMAT + +/* Signed 64-bit type */ +#undef TIFF_INT64_T + +/* Signed 8-bit type */ +#undef TIFF_INT8_T + +/* Pointer difference type formatter */ +#undef TIFF_PTRDIFF_FORMAT + +/* Pointer difference type */ +#undef TIFF_PTRDIFF_T + +/* Signed size type formatter */ +#undef TIFF_SSIZE_FORMAT + +/* Signed size type */ +#undef TIFF_SSIZE_T + +/* Unsigned 16-bit type */ +#undef TIFF_UINT16_T + +/* Unsigned 32-bit type formatter */ +#undef TIFF_UINT32_FORMAT + +/* Unsigned 32-bit type */ +#undef TIFF_UINT32_T + +/* Unsigned 64-bit type formatter */ +#undef TIFF_UINT64_FORMAT + +/* Unsigned 64-bit type */ +#undef TIFF_UINT64_T + +/* Unsigned 8-bit type */ +#undef TIFF_UINT8_T + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* define to use win32 IO system */ +#undef USE_WIN32_FILEIO + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Support Deflate compression */ +#undef ZIP_SUPPORT + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.vc.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.vc.h new file mode 100644 index 0000000..c297cf3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.vc.h @@ -0,0 +1,71 @@ +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Define to 1 if you have the `jbg_newlen' function. */ +#define HAVE_JBG_NEWLEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SEARCH_H 1 + +/* Define to 1 if you have the `setmode' function. */ +#define HAVE_SETMODE 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Signed 64-bit type formatter */ +#define TIFF_INT64_FORMAT "%I64d" + +/* Signed 64-bit type */ +#define TIFF_INT64_T signed __int64 + +/* Unsigned 64-bit type formatter */ +#define TIFF_UINT64_FORMAT "%I64u" + +/* Unsigned 64-bit type */ +#define TIFF_UINT64_T unsigned __int64 + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +#define snprintf _snprintf + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif + +#define lfind _lfind +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.wince.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.wince.h new file mode 100644 index 0000000..94e92bb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_config.wince.h @@ -0,0 +1,71 @@ +/* $Id: tif_config.wince.h,v 1.3 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * TIFF library configuration header for Windows CE platform. + */ +#ifndef _WIN32_WCE +# error This version of tif_config.h header is dedicated for Windows CE platform! +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Define to 1 if you have the `jbg_newlen' function. */ +#define HAVE_JBG_NEWLEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#define HAVE_IO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SEARCH_H 1 + +/* Define to 1 if you have the `setmode' function. */ +#define HAVE_SETMODE 1 + +/* Define to 1 if you have the `bsearch' function. */ +#define HAVE_BSEARCH 1 +#define bsearch wceex_bsearch + +/* Define to 1 if you have the `lfind' function. */ +#define HAVE_LFIND 1 +#define lfind wceex_lfind + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Set the native cpu bit order */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +# ifndef inline +# define inline __inline +# endif +#endif + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.c new file mode 100644 index 0000000..8bf3ea7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.c @@ -0,0 +1,1659 @@ +/* $Id: tif_dir.c,v 1.113 2012-06-14 20:32:53 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Directory Tag Get & Set Routines. + * (and also some miscellaneous stuff) + */ +#include "tiffiop.h" + +/* + * These are used in the backwards compatibility code... + */ +#define DATATYPE_VOID 0 /* !untyped data */ +#define DATATYPE_INT 1 /* !signed integer data */ +#define DATATYPE_UINT 2 /* !unsigned integer data */ +#define DATATYPE_IEEEFP 3 /* !IEEE floating point data */ + +static void +setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size) +{ + if (*vpp) + _TIFFfree(*vpp), *vpp = 0; + if (vp) { + tmsize_t bytes = (tmsize_t)(nmemb * elem_size); + if (elem_size && bytes / elem_size == nmemb) + *vpp = (void*) _TIFFmalloc(bytes); + if (*vpp) + _TIFFmemcpy(*vpp, vp, bytes); + } +} +void _TIFFsetByteArray(void** vpp, void* vp, uint32 n) + { setByteArray(vpp, vp, n, 1); } +void _TIFFsetString(char** cpp, char* cp) + { setByteArray((void**) cpp, (void*) cp, strlen(cp)+1, 1); } +void _TIFFsetNString(char** cpp, char* cp, uint32 n) + { setByteArray((void**) cpp, (void*) cp, n, 1); } +void _TIFFsetShortArray(uint16** wpp, uint16* wp, uint32 n) + { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16)); } +void _TIFFsetLongArray(uint32** lpp, uint32* lp, uint32 n) + { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32)); } +void _TIFFsetLong8Array(uint64** lpp, uint64* lp, uint32 n) + { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint64)); } +void _TIFFsetFloatArray(float** fpp, float* fp, uint32 n) + { setByteArray((void**) fpp, (void*) fp, n, sizeof (float)); } +void _TIFFsetDoubleArray(double** dpp, double* dp, uint32 n) + { setByteArray((void**) dpp, (void*) dp, n, sizeof (double)); } + +static void +setDoubleArrayOneValue(double** vpp, double value, size_t nmemb) +{ + if (*vpp) + _TIFFfree(*vpp); + *vpp = _TIFFmalloc(nmemb*sizeof(double)); + if (*vpp) + { + while (nmemb--) + ((double*)*vpp)[nmemb] = value; + } +} + +/* + * Install extra samples information. + */ +static int +setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v) +{ +/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */ +#define EXTRASAMPLE_COREL_UNASSALPHA 999 + + uint16* va; + uint32 i; + + *v = (uint16) va_arg(ap, uint16_vap); + if ((uint16) *v > td->td_samplesperpixel) + return 0; + va = va_arg(ap, uint16*); + if (*v > 0 && va == NULL) /* typically missing param */ + return 0; + for (i = 0; i < *v; i++) { + if (va[i] > EXTRASAMPLE_UNASSALPHA) { + /* + * XXX: Corel Draw is known to produce incorrect + * ExtraSamples tags which must be patched here if we + * want to be able to open some of the damaged TIFF + * files: + */ + if (va[i] == EXTRASAMPLE_COREL_UNASSALPHA) + va[i] = EXTRASAMPLE_UNASSALPHA; + else + return 0; + } + } + td->td_extrasamples = (uint16) *v; + _TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples); + return 1; + +#undef EXTRASAMPLE_COREL_UNASSALPHA +} + +/* + * Confirm we have "samplesperpixel" ink names separated by \0. Returns + * zero if the ink names are not as expected. + */ +static uint32 +checkInkNamesString(TIFF* tif, uint32 slen, const char* s) +{ + TIFFDirectory* td = &tif->tif_dir; + uint16 i = td->td_samplesperpixel; + + if (slen > 0) { + const char* ep = s+slen; + const char* cp = s; + for (; i > 0; i--) { + for (; cp < ep && *cp != '\0'; cp++) {} + if (cp >= ep) + goto bad; + cp++; /* skip \0 */ + } + return ((uint32)(cp-s)); + } +bad: + TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", + "%s: Invalid InkNames value; expecting %d names, found %d", + tif->tif_name, + td->td_samplesperpixel, + td->td_samplesperpixel-i); + return (0); +} + +static int +_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[] = "_TIFFVSetField"; + + TIFFDirectory* td = &tif->tif_dir; + int status = 1; + uint32 v32, i, v; + char* s; + const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY); + uint32 standard_tag = tag; + + /* + * We want to force the custom code to be used for custom + * fields even if the tag happens to match a well known + * one - important for reinterpreted handling of standard + * tag values in custom directories (ie. EXIF) + */ + if (fip->field_bit == FIELD_CUSTOM) { + standard_tag = 0; + } + + switch (standard_tag) { + case TIFFTAG_SUBFILETYPE: + td->td_subfiletype = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_IMAGEWIDTH: + td->td_imagewidth = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_IMAGELENGTH: + td->td_imagelength = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_BITSPERSAMPLE: + td->td_bitspersample = (uint16) va_arg(ap, uint16_vap); + /* + * If the data require post-decoding processing to byte-swap + * samples, set it up here. Note that since tags are required + * to be ordered, compression code can override this behaviour + * in the setup method if it wants to roll the post decoding + * work in with its normal work. + */ + if (tif->tif_flags & TIFF_SWAB) { + if (td->td_bitspersample == 8) + tif->tif_postdecode = _TIFFNoPostDecode; + else if (td->td_bitspersample == 16) + tif->tif_postdecode = _TIFFSwab16BitData; + else if (td->td_bitspersample == 24) + tif->tif_postdecode = _TIFFSwab24BitData; + else if (td->td_bitspersample == 32) + tif->tif_postdecode = _TIFFSwab32BitData; + else if (td->td_bitspersample == 64) + tif->tif_postdecode = _TIFFSwab64BitData; + else if (td->td_bitspersample == 128) /* two 64's */ + tif->tif_postdecode = _TIFFSwab64BitData; + } + break; + case TIFFTAG_COMPRESSION: + v = (uint16) va_arg(ap, uint16_vap); + /* + * If we're changing the compression scheme, the notify the + * previous module so that it can cleanup any state it's + * setup. + */ + if (TIFFFieldSet(tif, FIELD_COMPRESSION)) { + if ((uint32)td->td_compression == v) + break; + (*tif->tif_cleanup)(tif); + tif->tif_flags &= ~TIFF_CODERSETUP; + } + /* + * Setup new compression routine state. + */ + if( (status = TIFFSetCompressionScheme(tif, v)) != 0 ) + td->td_compression = (uint16) v; + else + status = 0; + break; + case TIFFTAG_PHOTOMETRIC: + td->td_photometric = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_THRESHHOLDING: + td->td_threshholding = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_FILLORDER: + v = (uint16) va_arg(ap, uint16_vap); + if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB) + goto badvalue; + td->td_fillorder = (uint16) v; + break; + case TIFFTAG_ORIENTATION: + v = (uint16) va_arg(ap, uint16_vap); + if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v) + goto badvalue; + else + td->td_orientation = (uint16) v; + break; + case TIFFTAG_SAMPLESPERPIXEL: + v = (uint16) va_arg(ap, uint16_vap); + if (v == 0) + goto badvalue; + td->td_samplesperpixel = (uint16) v; + break; + case TIFFTAG_ROWSPERSTRIP: + v32 = (uint32) va_arg(ap, uint32); + if (v32 == 0) + goto badvalue32; + td->td_rowsperstrip = v32; + if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) { + td->td_tilelength = v32; + td->td_tilewidth = td->td_imagewidth; + } + break; + case TIFFTAG_MINSAMPLEVALUE: + td->td_minsamplevalue = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_MAXSAMPLEVALUE: + td->td_maxsamplevalue = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_SMINSAMPLEVALUE: + if (tif->tif_flags & TIFF_PERSAMPLE) + _TIFFsetDoubleArray(&td->td_sminsamplevalue, va_arg(ap, double*), td->td_samplesperpixel); + else + setDoubleArrayOneValue(&td->td_sminsamplevalue, va_arg(ap, double), td->td_samplesperpixel); + break; + case TIFFTAG_SMAXSAMPLEVALUE: + if (tif->tif_flags & TIFF_PERSAMPLE) + _TIFFsetDoubleArray(&td->td_smaxsamplevalue, va_arg(ap, double*), td->td_samplesperpixel); + else + setDoubleArrayOneValue(&td->td_smaxsamplevalue, va_arg(ap, double), td->td_samplesperpixel); + break; + case TIFFTAG_XRESOLUTION: + td->td_xresolution = (float) va_arg(ap, double); + break; + case TIFFTAG_YRESOLUTION: + td->td_yresolution = (float) va_arg(ap, double); + break; + case TIFFTAG_PLANARCONFIG: + v = (uint16) va_arg(ap, uint16_vap); + if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE) + goto badvalue; + td->td_planarconfig = (uint16) v; + break; + case TIFFTAG_XPOSITION: + td->td_xposition = (float) va_arg(ap, double); + break; + case TIFFTAG_YPOSITION: + td->td_yposition = (float) va_arg(ap, double); + break; + case TIFFTAG_RESOLUTIONUNIT: + v = (uint16) va_arg(ap, uint16_vap); + if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v) + goto badvalue; + td->td_resolutionunit = (uint16) v; + break; + case TIFFTAG_PAGENUMBER: + td->td_pagenumber[0] = (uint16) va_arg(ap, uint16_vap); + td->td_pagenumber[1] = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_HALFTONEHINTS: + td->td_halftonehints[0] = (uint16) va_arg(ap, uint16_vap); + td->td_halftonehints[1] = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_COLORMAP: + v32 = (uint32)(1L<td_bitspersample); + _TIFFsetShortArray(&td->td_colormap[0], va_arg(ap, uint16*), v32); + _TIFFsetShortArray(&td->td_colormap[1], va_arg(ap, uint16*), v32); + _TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32); + break; + case TIFFTAG_EXTRASAMPLES: + if (!setExtraSamples(td, ap, &v)) + goto badvalue; + break; + case TIFFTAG_MATTEING: + td->td_extrasamples = (((uint16) va_arg(ap, uint16_vap)) != 0); + if (td->td_extrasamples) { + uint16 sv = EXTRASAMPLE_ASSOCALPHA; + _TIFFsetShortArray(&td->td_sampleinfo, &sv, 1); + } + break; + case TIFFTAG_TILEWIDTH: + v32 = (uint32) va_arg(ap, uint32); + if (v32 % 16) { + if (tif->tif_mode != O_RDONLY) + goto badvalue32; + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, + "Nonstandard tile width %d, convert file", v32); + } + td->td_tilewidth = v32; + tif->tif_flags |= TIFF_ISTILED; + break; + case TIFFTAG_TILELENGTH: + v32 = (uint32) va_arg(ap, uint32); + if (v32 % 16) { + if (tif->tif_mode != O_RDONLY) + goto badvalue32; + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, + "Nonstandard tile length %d, convert file", v32); + } + td->td_tilelength = v32; + tif->tif_flags |= TIFF_ISTILED; + break; + case TIFFTAG_TILEDEPTH: + v32 = (uint32) va_arg(ap, uint32); + if (v32 == 0) + goto badvalue32; + td->td_tiledepth = v32; + break; + case TIFFTAG_DATATYPE: + v = (uint16) va_arg(ap, uint16_vap); + switch (v) { + case DATATYPE_VOID: v = SAMPLEFORMAT_VOID; break; + case DATATYPE_INT: v = SAMPLEFORMAT_INT; break; + case DATATYPE_UINT: v = SAMPLEFORMAT_UINT; break; + case DATATYPE_IEEEFP: v = SAMPLEFORMAT_IEEEFP;break; + default: goto badvalue; + } + td->td_sampleformat = (uint16) v; + break; + case TIFFTAG_SAMPLEFORMAT: + v = (uint16) va_arg(ap, uint16_vap); + if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v) + goto badvalue; + td->td_sampleformat = (uint16) v; + + /* Try to fix up the SWAB function for complex data. */ + if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT + && td->td_bitspersample == 32 + && tif->tif_postdecode == _TIFFSwab32BitData ) + tif->tif_postdecode = _TIFFSwab16BitData; + else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT + || td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP) + && td->td_bitspersample == 64 + && tif->tif_postdecode == _TIFFSwab64BitData ) + tif->tif_postdecode = _TIFFSwab32BitData; + break; + case TIFFTAG_IMAGEDEPTH: + td->td_imagedepth = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_SUBIFD: + if ((tif->tif_flags & TIFF_INSUBIFD) == 0) { + td->td_nsubifd = (uint16) va_arg(ap, uint16_vap); + _TIFFsetLong8Array(&td->td_subifd, (uint64*) va_arg(ap, uint64*), + (long) td->td_nsubifd); + } else { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Sorry, cannot nest SubIFDs", + tif->tif_name); + status = 0; + } + break; + case TIFFTAG_YCBCRPOSITIONING: + td->td_ycbcrpositioning = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_YCBCRSUBSAMPLING: + td->td_ycbcrsubsampling[0] = (uint16) va_arg(ap, uint16_vap); + td->td_ycbcrsubsampling[1] = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_TRANSFERFUNCTION: + v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1; + for (i = 0; i < v; i++) + _TIFFsetShortArray(&td->td_transferfunction[i], + va_arg(ap, uint16*), 1L<td_bitspersample); + break; + case TIFFTAG_REFERENCEBLACKWHITE: + /* XXX should check for null range */ + _TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 6); + break; + case TIFFTAG_INKNAMES: + v = (uint16) va_arg(ap, uint16_vap); + s = va_arg(ap, char*); + v = checkInkNamesString(tif, v, s); + status = v > 0; + if( v > 0 ) { + _TIFFsetNString(&td->td_inknames, s, v); + td->td_inknameslen = v; + } + break; + case TIFFTAG_PERSAMPLE: + v = (uint16) va_arg(ap, uint16_vap); + if( v == PERSAMPLE_MULTI ) + tif->tif_flags |= TIFF_PERSAMPLE; + else + tif->tif_flags &= ~TIFF_PERSAMPLE; + break; + default: { + TIFFTagValue *tv; + int tv_size, iCustom; + + /* + * This can happen if multiple images are open with different + * codecs which have private tags. The global tag information + * table may then have tags that are valid for one file but not + * the other. If the client tries to set a tag that is not valid + * for the image's codec then we'll arrive here. This + * happens, for example, when tiffcp is used to convert between + * compression schemes and codec-specific tags are blindly copied. + */ + if(fip == NULL || fip->field_bit != FIELD_CUSTOM) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Invalid %stag \"%s\" (not supported by codec)", + tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", + fip ? fip->field_name : "Unknown"); + status = 0; + break; + } + + /* + * Find the existing entry for this custom value. + */ + tv = NULL; + for (iCustom = 0; iCustom < td->td_customValueCount; iCustom++) { + if (td->td_customValues[iCustom].info->field_tag == tag) { + tv = td->td_customValues + iCustom; + if (tv->value != NULL) { + _TIFFfree(tv->value); + tv->value = NULL; + } + break; + } + } + + /* + * Grow the custom list if the entry was not found. + */ + if(tv == NULL) { + TIFFTagValue *new_customValues; + + td->td_customValueCount++; + new_customValues = (TIFFTagValue *) + _TIFFrealloc(td->td_customValues, + sizeof(TIFFTagValue) * td->td_customValueCount); + if (!new_customValues) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Failed to allocate space for list of custom values", + tif->tif_name); + status = 0; + goto end; + } + + td->td_customValues = new_customValues; + + tv = td->td_customValues + (td->td_customValueCount - 1); + tv->info = fip; + tv->value = NULL; + tv->count = 0; + } + + /* + * Set custom value ... save a copy of the custom tag value. + */ + tv_size = _TIFFDataSize(fip->field_type); + if (tv_size == 0) { + status = 0; + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Bad field type %d for \"%s\"", + tif->tif_name, fip->field_type, + fip->field_name); + goto end; + } + + if (fip->field_type == TIFF_ASCII) + { + uint32 ma; + char* mb; + if (fip->field_passcount) + { + assert(fip->field_writecount==TIFF_VARIABLE2); + ma=(uint32)va_arg(ap,uint32); + mb=(char*)va_arg(ap,char*); + } + else + { + mb=(char*)va_arg(ap,char*); + ma=(uint32)(strlen(mb)+1); + } + tv->count=ma; + setByteArray(&tv->value,mb,ma,1); + } + else + { + if (fip->field_passcount) { + if (fip->field_writecount == TIFF_VARIABLE2) + tv->count = (uint32) va_arg(ap, uint32); + else + tv->count = (int) va_arg(ap, int); + } else if (fip->field_writecount == TIFF_VARIABLE + || fip->field_writecount == TIFF_VARIABLE2) + tv->count = 1; + else if (fip->field_writecount == TIFF_SPP) + tv->count = td->td_samplesperpixel; + else + tv->count = fip->field_writecount; + + if (tv->count == 0) { + status = 0; + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Null count for \"%s\" (type " + "%d, writecount %d, passcount %d)", + tif->tif_name, + fip->field_name, + fip->field_type, + fip->field_writecount, + fip->field_passcount); + goto end; + } + + tv->value = _TIFFCheckMalloc(tif, tv->count, tv_size, + "custom tag binary object"); + if (!tv->value) { + status = 0; + goto end; + } + + if (fip->field_tag == TIFFTAG_DOTRANGE + && strcmp(fip->field_name,"DotRange") == 0) { + /* TODO: This is an evil exception and should not have been + handled this way ... likely best if we move it into + the directory structure with an explicit field in + libtiff 4.1 and assign it a FIELD_ value */ + uint16 v[2]; + v[0] = (uint16)va_arg(ap, int); + v[1] = (uint16)va_arg(ap, int); + _TIFFmemcpy(tv->value, &v, 4); + } + + else if (fip->field_passcount + || fip->field_writecount == TIFF_VARIABLE + || fip->field_writecount == TIFF_VARIABLE2 + || fip->field_writecount == TIFF_SPP + || tv->count > 1) { + _TIFFmemcpy(tv->value, va_arg(ap, void *), + tv->count * tv_size); + } else { + char *val = (char *)tv->value; + assert( tv->count == 1 ); + + switch (fip->field_type) { + case TIFF_BYTE: + case TIFF_UNDEFINED: + { + uint8 v = (uint8)va_arg(ap, int); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_SBYTE: + { + int8 v = (int8)va_arg(ap, int); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_SHORT: + { + uint16 v = (uint16)va_arg(ap, int); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_SSHORT: + { + int16 v = (int16)va_arg(ap, int); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_LONG: + case TIFF_IFD: + { + uint32 v = va_arg(ap, uint32); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_SLONG: + { + int32 v = va_arg(ap, int32); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_LONG8: + case TIFF_IFD8: + { + uint64 v = va_arg(ap, uint64); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_SLONG8: + { + int64 v = va_arg(ap, int64); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + { + float v = (float)va_arg(ap, double); + _TIFFmemcpy(val, &v, tv_size); + } + break; + case TIFF_DOUBLE: + { + double v = va_arg(ap, double); + _TIFFmemcpy(val, &v, tv_size); + } + break; + default: + _TIFFmemset(val, 0, tv_size); + status = 0; + break; + } + } + } + } + } + if (status) { + const TIFFField* fip=TIFFFieldWithTag(tif,tag); + if (fip) + TIFFSetFieldBit(tif, fip->field_bit); + tif->tif_flags |= TIFF_DIRTYDIRECT; + } + +end: + va_end(ap); + return (status); +badvalue: + { + const TIFFField* fip=TIFFFieldWithTag(tif,tag); + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Bad value %u for \"%s\" tag", + tif->tif_name, v, + fip ? fip->field_name : "Unknown"); + va_end(ap); + } + return (0); +badvalue32: + { + const TIFFField* fip=TIFFFieldWithTag(tif,tag); + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Bad value %u for \"%s\" tag", + tif->tif_name, v32, + fip ? fip->field_name : "Unknown"); + va_end(ap); + } + return (0); +} + +/* + * Return 1/0 according to whether or not + * it is permissible to set the tag's value. + * Note that we allow ImageLength to be changed + * so that we can append and extend to images. + * Any other tag may not be altered once writing + * has commenced, unless its value has no effect + * on the format of the data that is written. + */ +static int +OkToChangeTag(TIFF* tif, uint32 tag) +{ + const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); + if (!fip) { /* unknown tag */ + TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %u", + tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag); + return (0); + } + if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) && + !fip->field_oktochange) { + /* + * Consult info table to see if tag can be changed + * after we've started writing. We only allow changes + * to those tags that don't/shouldn't affect the + * compression and/or format of the data. + */ + TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", + "%s: Cannot modify tag \"%s\" while writing", + tif->tif_name, fip->field_name); + return (0); + } + return (1); +} + +/* + * Record the value of a field in the + * internal directory structure. The + * field will be written to the file + * when/if the directory structure is + * updated. + */ +int +TIFFSetField(TIFF* tif, uint32 tag, ...) +{ + va_list ap; + int status; + + va_start(ap, tag); + status = TIFFVSetField(tif, tag, ap); + va_end(ap); + return (status); +} + +/* + * Clear the contents of the field in the internal structure. + */ +int +TIFFUnsetField(TIFF* tif, uint32 tag) +{ + const TIFFField *fip = TIFFFieldWithTag(tif, tag); + TIFFDirectory* td = &tif->tif_dir; + + if( !fip ) + return 0; + + if( fip->field_bit != FIELD_CUSTOM ) + TIFFClrFieldBit(tif, fip->field_bit); + else + { + TIFFTagValue *tv = NULL; + int i; + + for (i = 0; i < td->td_customValueCount; i++) { + + tv = td->td_customValues + i; + if( tv->info->field_tag == tag ) + break; + } + + if( i < td->td_customValueCount ) + { + _TIFFfree(tv->value); + for( ; i < td->td_customValueCount-1; i++) { + td->td_customValues[i] = td->td_customValues[i+1]; + } + td->td_customValueCount--; + } + } + + tif->tif_flags |= TIFF_DIRTYDIRECT; + + return (1); +} + +/* + * Like TIFFSetField, but taking a varargs + * parameter list. This routine is useful + * for building higher-level interfaces on + * top of the library. + */ +int +TIFFVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + return OkToChangeTag(tif, tag) ? + (*tif->tif_tagmethods.vsetfield)(tif, tag, ap) : 0; +} + +static int +_TIFFVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + TIFFDirectory* td = &tif->tif_dir; + int ret_val = 1; + uint32 standard_tag = tag; + const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); + + /* + * We want to force the custom code to be used for custom + * fields even if the tag happens to match a well known + * one - important for reinterpreted handling of standard + * tag values in custom directories (ie. EXIF) + */ + if (fip->field_bit == FIELD_CUSTOM) { + standard_tag = 0; + } + + switch (standard_tag) { + case TIFFTAG_SUBFILETYPE: + *va_arg(ap, uint32*) = td->td_subfiletype; + break; + case TIFFTAG_IMAGEWIDTH: + *va_arg(ap, uint32*) = td->td_imagewidth; + break; + case TIFFTAG_IMAGELENGTH: + *va_arg(ap, uint32*) = td->td_imagelength; + break; + case TIFFTAG_BITSPERSAMPLE: + *va_arg(ap, uint16*) = td->td_bitspersample; + break; + case TIFFTAG_COMPRESSION: + *va_arg(ap, uint16*) = td->td_compression; + break; + case TIFFTAG_PHOTOMETRIC: + *va_arg(ap, uint16*) = td->td_photometric; + break; + case TIFFTAG_THRESHHOLDING: + *va_arg(ap, uint16*) = td->td_threshholding; + break; + case TIFFTAG_FILLORDER: + *va_arg(ap, uint16*) = td->td_fillorder; + break; + case TIFFTAG_ORIENTATION: + *va_arg(ap, uint16*) = td->td_orientation; + break; + case TIFFTAG_SAMPLESPERPIXEL: + *va_arg(ap, uint16*) = td->td_samplesperpixel; + break; + case TIFFTAG_ROWSPERSTRIP: + *va_arg(ap, uint32*) = td->td_rowsperstrip; + break; + case TIFFTAG_MINSAMPLEVALUE: + *va_arg(ap, uint16*) = td->td_minsamplevalue; + break; + case TIFFTAG_MAXSAMPLEVALUE: + *va_arg(ap, uint16*) = td->td_maxsamplevalue; + break; + case TIFFTAG_SMINSAMPLEVALUE: + if (tif->tif_flags & TIFF_PERSAMPLE) + *va_arg(ap, double**) = td->td_sminsamplevalue; + else + { + /* libtiff historially treats this as a single value. */ + uint16 i; + double v = td->td_sminsamplevalue[0]; + for (i=1; i < td->td_samplesperpixel; ++i) + if( td->td_sminsamplevalue[i] < v ) + v = td->td_sminsamplevalue[i]; + *va_arg(ap, double*) = v; + } + break; + case TIFFTAG_SMAXSAMPLEVALUE: + if (tif->tif_flags & TIFF_PERSAMPLE) + *va_arg(ap, double**) = td->td_smaxsamplevalue; + else + { + /* libtiff historially treats this as a single value. */ + uint16 i; + double v = td->td_smaxsamplevalue[0]; + for (i=1; i < td->td_samplesperpixel; ++i) + if( td->td_smaxsamplevalue[i] > v ) + v = td->td_smaxsamplevalue[i]; + *va_arg(ap, double*) = v; + } + break; + case TIFFTAG_XRESOLUTION: + *va_arg(ap, float*) = td->td_xresolution; + break; + case TIFFTAG_YRESOLUTION: + *va_arg(ap, float*) = td->td_yresolution; + break; + case TIFFTAG_PLANARCONFIG: + *va_arg(ap, uint16*) = td->td_planarconfig; + break; + case TIFFTAG_XPOSITION: + *va_arg(ap, float*) = td->td_xposition; + break; + case TIFFTAG_YPOSITION: + *va_arg(ap, float*) = td->td_yposition; + break; + case TIFFTAG_RESOLUTIONUNIT: + *va_arg(ap, uint16*) = td->td_resolutionunit; + break; + case TIFFTAG_PAGENUMBER: + *va_arg(ap, uint16*) = td->td_pagenumber[0]; + *va_arg(ap, uint16*) = td->td_pagenumber[1]; + break; + case TIFFTAG_HALFTONEHINTS: + *va_arg(ap, uint16*) = td->td_halftonehints[0]; + *va_arg(ap, uint16*) = td->td_halftonehints[1]; + break; + case TIFFTAG_COLORMAP: + *va_arg(ap, uint16**) = td->td_colormap[0]; + *va_arg(ap, uint16**) = td->td_colormap[1]; + *va_arg(ap, uint16**) = td->td_colormap[2]; + break; + case TIFFTAG_STRIPOFFSETS: + case TIFFTAG_TILEOFFSETS: + _TIFFFillStriles( tif ); + *va_arg(ap, uint64**) = td->td_stripoffset; + break; + case TIFFTAG_STRIPBYTECOUNTS: + case TIFFTAG_TILEBYTECOUNTS: + _TIFFFillStriles( tif ); + *va_arg(ap, uint64**) = td->td_stripbytecount; + break; + case TIFFTAG_MATTEING: + *va_arg(ap, uint16*) = + (td->td_extrasamples == 1 && + td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA); + break; + case TIFFTAG_EXTRASAMPLES: + *va_arg(ap, uint16*) = td->td_extrasamples; + *va_arg(ap, uint16**) = td->td_sampleinfo; + break; + case TIFFTAG_TILEWIDTH: + *va_arg(ap, uint32*) = td->td_tilewidth; + break; + case TIFFTAG_TILELENGTH: + *va_arg(ap, uint32*) = td->td_tilelength; + break; + case TIFFTAG_TILEDEPTH: + *va_arg(ap, uint32*) = td->td_tiledepth; + break; + case TIFFTAG_DATATYPE: + switch (td->td_sampleformat) { + case SAMPLEFORMAT_UINT: + *va_arg(ap, uint16*) = DATATYPE_UINT; + break; + case SAMPLEFORMAT_INT: + *va_arg(ap, uint16*) = DATATYPE_INT; + break; + case SAMPLEFORMAT_IEEEFP: + *va_arg(ap, uint16*) = DATATYPE_IEEEFP; + break; + case SAMPLEFORMAT_VOID: + *va_arg(ap, uint16*) = DATATYPE_VOID; + break; + } + break; + case TIFFTAG_SAMPLEFORMAT: + *va_arg(ap, uint16*) = td->td_sampleformat; + break; + case TIFFTAG_IMAGEDEPTH: + *va_arg(ap, uint32*) = td->td_imagedepth; + break; + case TIFFTAG_SUBIFD: + *va_arg(ap, uint16*) = td->td_nsubifd; + *va_arg(ap, uint64**) = td->td_subifd; + break; + case TIFFTAG_YCBCRPOSITIONING: + *va_arg(ap, uint16*) = td->td_ycbcrpositioning; + break; + case TIFFTAG_YCBCRSUBSAMPLING: + *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[0]; + *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[1]; + break; + case TIFFTAG_TRANSFERFUNCTION: + *va_arg(ap, uint16**) = td->td_transferfunction[0]; + if (td->td_samplesperpixel - td->td_extrasamples > 1) { + *va_arg(ap, uint16**) = td->td_transferfunction[1]; + *va_arg(ap, uint16**) = td->td_transferfunction[2]; + } + break; + case TIFFTAG_REFERENCEBLACKWHITE: + *va_arg(ap, float**) = td->td_refblackwhite; + break; + case TIFFTAG_INKNAMES: + *va_arg(ap, char**) = td->td_inknames; + break; + default: + { + int i; + + /* + * This can happen if multiple images are open + * with different codecs which have private + * tags. The global tag information table may + * then have tags that are valid for one file + * but not the other. If the client tries to + * get a tag that is not valid for the image's + * codec then we'll arrive here. + */ + if( fip == NULL || fip->field_bit != FIELD_CUSTOM ) + { + TIFFErrorExt(tif->tif_clientdata, "_TIFFVGetField", + "%s: Invalid %stag \"%s\" " + "(not supported by codec)", + tif->tif_name, + isPseudoTag(tag) ? "pseudo-" : "", + fip ? fip->field_name : "Unknown"); + ret_val = 0; + break; + } + + /* + * Do we have a custom value? + */ + ret_val = 0; + for (i = 0; i < td->td_customValueCount; i++) { + TIFFTagValue *tv = td->td_customValues + i; + + if (tv->info->field_tag != tag) + continue; + + if (fip->field_passcount) { + if (fip->field_readcount == TIFF_VARIABLE2) + *va_arg(ap, uint32*) = (uint32)tv->count; + else /* Assume TIFF_VARIABLE */ + *va_arg(ap, uint16*) = (uint16)tv->count; + *va_arg(ap, void **) = tv->value; + ret_val = 1; + } else if (fip->field_tag == TIFFTAG_DOTRANGE + && strcmp(fip->field_name,"DotRange") == 0) { + /* TODO: This is an evil exception and should not have been + handled this way ... likely best if we move it into + the directory structure with an explicit field in + libtiff 4.1 and assign it a FIELD_ value */ + *va_arg(ap, uint16*) = ((uint16 *)tv->value)[0]; + *va_arg(ap, uint16*) = ((uint16 *)tv->value)[1]; + ret_val = 1; + } else { + if (fip->field_type == TIFF_ASCII + || fip->field_readcount == TIFF_VARIABLE + || fip->field_readcount == TIFF_VARIABLE2 + || fip->field_readcount == TIFF_SPP + || tv->count > 1) { + *va_arg(ap, void **) = tv->value; + ret_val = 1; + } else { + char *val = (char *)tv->value; + assert( tv->count == 1 ); + switch (fip->field_type) { + case TIFF_BYTE: + case TIFF_UNDEFINED: + *va_arg(ap, uint8*) = + *(uint8 *)val; + ret_val = 1; + break; + case TIFF_SBYTE: + *va_arg(ap, int8*) = + *(int8 *)val; + ret_val = 1; + break; + case TIFF_SHORT: + *va_arg(ap, uint16*) = + *(uint16 *)val; + ret_val = 1; + break; + case TIFF_SSHORT: + *va_arg(ap, int16*) = + *(int16 *)val; + ret_val = 1; + break; + case TIFF_LONG: + case TIFF_IFD: + *va_arg(ap, uint32*) = + *(uint32 *)val; + ret_val = 1; + break; + case TIFF_SLONG: + *va_arg(ap, int32*) = + *(int32 *)val; + ret_val = 1; + break; + case TIFF_LONG8: + case TIFF_IFD8: + *va_arg(ap, uint64*) = + *(uint64 *)val; + ret_val = 1; + break; + case TIFF_SLONG8: + *va_arg(ap, int64*) = + *(int64 *)val; + ret_val = 1; + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + *va_arg(ap, float*) = + *(float *)val; + ret_val = 1; + break; + case TIFF_DOUBLE: + *va_arg(ap, double*) = + *(double *)val; + ret_val = 1; + break; + default: + ret_val = 0; + break; + } + } + } + break; + } + } + } + return(ret_val); +} + +/* + * Return the value of a field in the + * internal directory structure. + */ +int +TIFFGetField(TIFF* tif, uint32 tag, ...) +{ + int status; + va_list ap; + + va_start(ap, tag); + status = TIFFVGetField(tif, tag, ap); + va_end(ap); + return (status); +} + +/* + * Like TIFFGetField, but taking a varargs + * parameter list. This routine is useful + * for building higher-level interfaces on + * top of the library. + */ +int +TIFFVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); + return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit)) ? + (*tif->tif_tagmethods.vgetfield)(tif, tag, ap) : 0); +} + +#define CleanupField(member) { \ + if (td->member) { \ + _TIFFfree(td->member); \ + td->member = 0; \ + } \ +} + +/* + * Release storage associated with a directory. + */ +void +TIFFFreeDirectory(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + int i; + + _TIFFmemset(td->td_fieldsset, 0, FIELD_SETLONGS); + CleanupField(td_sminsamplevalue); + CleanupField(td_smaxsamplevalue); + CleanupField(td_colormap[0]); + CleanupField(td_colormap[1]); + CleanupField(td_colormap[2]); + CleanupField(td_sampleinfo); + CleanupField(td_subifd); + CleanupField(td_inknames); + CleanupField(td_refblackwhite); + CleanupField(td_transferfunction[0]); + CleanupField(td_transferfunction[1]); + CleanupField(td_transferfunction[2]); + CleanupField(td_stripoffset); + CleanupField(td_stripbytecount); + TIFFClrFieldBit(tif, FIELD_YCBCRSUBSAMPLING); + TIFFClrFieldBit(tif, FIELD_YCBCRPOSITIONING); + + /* Cleanup custom tag values */ + for( i = 0; i < td->td_customValueCount; i++ ) { + if (td->td_customValues[i].value) + _TIFFfree(td->td_customValues[i].value); + } + + td->td_customValueCount = 0; + CleanupField(td_customValues); + +#if defined(DEFER_STRILE_LOAD) + _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry)); + _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry)); +#endif +} +#undef CleanupField + +/* + * Client Tag extension support (from Niles Ritter). + */ +static TIFFExtendProc _TIFFextender = (TIFFExtendProc) NULL; + +TIFFExtendProc +TIFFSetTagExtender(TIFFExtendProc extender) +{ + TIFFExtendProc prev = _TIFFextender; + _TIFFextender = extender; + return (prev); +} + +/* + * Setup for a new directory. Should we automatically call + * TIFFWriteDirectory() if the current one is dirty? + * + * The newly created directory will not exist on the file till + * TIFFWriteDirectory(), TIFFFlush() or TIFFClose() is called. + */ +int +TIFFCreateDirectory(TIFF* tif) +{ + TIFFDefaultDirectory(tif); + tif->tif_diroff = 0; + tif->tif_nextdiroff = 0; + tif->tif_curoff = 0; + tif->tif_row = (uint32) -1; + tif->tif_curstrip = (uint32) -1; + + return 0; +} + +int +TIFFCreateCustomDirectory(TIFF* tif, const TIFFFieldArray* infoarray) +{ + TIFFDefaultDirectory(tif); + + /* + * Reset the field definitions to match the application provided list. + * Hopefully TIFFDefaultDirectory() won't have done anything irreversable + * based on it's assumption this is an image directory. + */ + _TIFFSetupFields(tif, infoarray); + + tif->tif_diroff = 0; + tif->tif_nextdiroff = 0; + tif->tif_curoff = 0; + tif->tif_row = (uint32) -1; + tif->tif_curstrip = (uint32) -1; + + return 0; +} + +int +TIFFCreateEXIFDirectory(TIFF* tif) +{ + const TIFFFieldArray* exifFieldArray; + exifFieldArray = _TIFFGetExifFields(); + return TIFFCreateCustomDirectory(tif, exifFieldArray); +} + +/* + * Setup a default directory structure. + */ +int +TIFFDefaultDirectory(TIFF* tif) +{ + register TIFFDirectory* td = &tif->tif_dir; + const TIFFFieldArray* tiffFieldArray; + + tiffFieldArray = _TIFFGetFields(); + _TIFFSetupFields(tif, tiffFieldArray); + + _TIFFmemset(td, 0, sizeof (*td)); + td->td_fillorder = FILLORDER_MSB2LSB; + td->td_bitspersample = 1; + td->td_threshholding = THRESHHOLD_BILEVEL; + td->td_orientation = ORIENTATION_TOPLEFT; + td->td_samplesperpixel = 1; + td->td_rowsperstrip = (uint32) -1; + td->td_tilewidth = 0; + td->td_tilelength = 0; + td->td_tiledepth = 1; + td->td_stripbytecountsorted = 1; /* Our own arrays always sorted. */ + td->td_resolutionunit = RESUNIT_INCH; + td->td_sampleformat = SAMPLEFORMAT_UINT; + td->td_imagedepth = 1; + td->td_ycbcrsubsampling[0] = 2; + td->td_ycbcrsubsampling[1] = 2; + td->td_ycbcrpositioning = YCBCRPOSITION_CENTERED; + tif->tif_postdecode = _TIFFNoPostDecode; + tif->tif_foundfield = NULL; + tif->tif_tagmethods.vsetfield = _TIFFVSetField; + tif->tif_tagmethods.vgetfield = _TIFFVGetField; + tif->tif_tagmethods.printdir = NULL; + /* + * Give client code a chance to install their own + * tag extensions & methods, prior to compression overloads. + */ + if (_TIFFextender) + (*_TIFFextender)(tif); + (void) TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + /* + * NB: The directory is marked dirty as a result of setting + * up the default compression scheme. However, this really + * isn't correct -- we want TIFF_DIRTYDIRECT to be set only + * if the user does something. We could just do the setup + * by hand, but it seems better to use the normal mechanism + * (i.e. TIFFSetField). + */ + tif->tif_flags &= ~TIFF_DIRTYDIRECT; + + /* + * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=19 + * we clear the ISTILED flag when setting up a new directory. + * Should we also be clearing stuff like INSUBIFD? + */ + tif->tif_flags &= ~TIFF_ISTILED; + + return (1); +} + +static int +TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off) +{ + static const char module[] = "TIFFAdvanceDirectory"; + if (isMapped(tif)) + { + uint64 poff=*nextdir; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + tmsize_t poffa,poffb,poffc,poffd; + uint16 dircount; + uint32 nextdir32; + poffa=(tmsize_t)poff; + poffb=poffa+sizeof(uint16); + if (((uint64)poffa!=poff)||(poffbtif->tif_size)) + { + TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory count"); + return(0); + } + _TIFFmemcpy(&dircount,tif->tif_base+poffa,sizeof(uint16)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort(&dircount); + poffc=poffb+dircount*12; + poffd=poffc+sizeof(uint32); + if ((poffctif->tif_size)) + { + TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory link"); + return(0); + } + if (off!=NULL) + *off=(uint64)poffc; + _TIFFmemcpy(&nextdir32,tif->tif_base+poffc,sizeof(uint32)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&nextdir32); + *nextdir=nextdir32; + } + else + { + tmsize_t poffa,poffb,poffc,poffd; + uint64 dircount64; + uint16 dircount16; + poffa=(tmsize_t)poff; + poffb=poffa+sizeof(uint64); + if (((uint64)poffa!=poff)||(poffbtif->tif_size)) + { + TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory count"); + return(0); + } + _TIFFmemcpy(&dircount64,tif->tif_base+poffa,sizeof(uint64)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>0xFFFF) + { + TIFFErrorExt(tif->tif_clientdata,module,"Sanity check on directory count failed"); + return(0); + } + dircount16=(uint16)dircount64; + poffc=poffb+dircount16*20; + poffd=poffc+sizeof(uint64); + if ((poffctif->tif_size)) + { + TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory link"); + return(0); + } + if (off!=NULL) + *off=(uint64)poffc; + _TIFFmemcpy(nextdir,tif->tif_base+poffc,sizeof(uint64)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(nextdir); + } + return(1); + } + else + { + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint16 dircount; + uint32 nextdir32; + if (!SeekOK(tif, *nextdir) || + !ReadOK(tif, &dircount, sizeof (uint16))) { + TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count", + tif->tif_name); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + if (off != NULL) + *off = TIFFSeekFile(tif, + dircount*12, SEEK_CUR); + else + (void) TIFFSeekFile(tif, + dircount*12, SEEK_CUR); + if (!ReadOK(tif, &nextdir32, sizeof (uint32))) { + TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link", + tif->tif_name); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextdir32); + *nextdir=nextdir32; + } + else + { + uint64 dircount64; + uint16 dircount16; + if (!SeekOK(tif, *nextdir) || + !ReadOK(tif, &dircount64, sizeof (uint64))) { + TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count", + tif->tif_name); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>0xFFFF) + { + TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count"); + return(0); + } + dircount16 = (uint16)dircount64; + if (off != NULL) + *off = TIFFSeekFile(tif, + dircount16*20, SEEK_CUR); + else + (void) TIFFSeekFile(tif, + dircount16*20, SEEK_CUR); + if (!ReadOK(tif, nextdir, sizeof (uint64))) { + TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link", + tif->tif_name); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(nextdir); + } + return (1); + } +} + +/* + * Count the number of directories in a file. + */ +uint16 +TIFFNumberOfDirectories(TIFF* tif) +{ + uint64 nextdir; + uint16 n; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + nextdir = tif->tif_header.classic.tiff_diroff; + else + nextdir = tif->tif_header.big.tiff_diroff; + n = 0; + while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL)) + n++; + return (n); +} + +/* + * Set the n-th directory as the current directory. + * NB: Directories are numbered starting at 0. + */ +int +TIFFSetDirectory(TIFF* tif, uint16 dirn) +{ + uint64 nextdir; + uint16 n; + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + nextdir = tif->tif_header.classic.tiff_diroff; + else + nextdir = tif->tif_header.big.tiff_diroff; + for (n = dirn; n > 0 && nextdir != 0; n--) + if (!TIFFAdvanceDirectory(tif, &nextdir, NULL)) + return (0); + tif->tif_nextdiroff = nextdir; + /* + * Set curdir to the actual directory index. The + * -1 is because TIFFReadDirectory will increment + * tif_curdir after successfully reading the directory. + */ + tif->tif_curdir = (dirn - n) - 1; + /* + * Reset tif_dirnumber counter and start new list of seen directories. + * We need this to prevent IFD loops. + */ + tif->tif_dirnumber = 0; + return (TIFFReadDirectory(tif)); +} + +/* + * Set the current directory to be the directory + * located at the specified file offset. This interface + * is used mainly to access directories linked with + * the SubIFD tag (e.g. thumbnail images). + */ +int +TIFFSetSubDirectory(TIFF* tif, uint64 diroff) +{ + tif->tif_nextdiroff = diroff; + /* + * Reset tif_dirnumber counter and start new list of seen directories. + * We need this to prevent IFD loops. + */ + tif->tif_dirnumber = 0; + return (TIFFReadDirectory(tif)); +} + +/* + * Return file offset of the current directory. + */ +uint64 +TIFFCurrentDirOffset(TIFF* tif) +{ + return (tif->tif_diroff); +} + +/* + * Return an indication of whether or not we are + * at the last directory in the file. + */ +int +TIFFLastDirectory(TIFF* tif) +{ + return (tif->tif_nextdiroff == 0); +} + +/* + * Unlink the specified directory from the directory chain. + */ +int +TIFFUnlinkDirectory(TIFF* tif, uint16 dirn) +{ + static const char module[] = "TIFFUnlinkDirectory"; + uint64 nextdir; + uint64 off; + uint16 n; + + if (tif->tif_mode == O_RDONLY) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not unlink directory in read-only file"); + return (0); + } + /* + * Go to the directory before the one we want + * to unlink and nab the offset of the link + * field we'll need to patch. + */ + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + nextdir = tif->tif_header.classic.tiff_diroff; + off = 4; + } + else + { + nextdir = tif->tif_header.big.tiff_diroff; + off = 8; + } + for (n = dirn-1; n > 0; n--) { + if (nextdir == 0) { + TIFFErrorExt(tif->tif_clientdata, module, "Directory %d does not exist", dirn); + return (0); + } + if (!TIFFAdvanceDirectory(tif, &nextdir, &off)) + return (0); + } + /* + * Advance to the directory to be unlinked and fetch + * the offset of the directory that follows. + */ + if (!TIFFAdvanceDirectory(tif, &nextdir, NULL)) + return (0); + /* + * Go back and patch the link field of the preceding + * directory to point to the offset of the directory + * that follows. + */ + (void) TIFFSeekFile(tif, off, SEEK_SET); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 nextdir32; + nextdir32=(uint32)nextdir; + assert((uint64)nextdir32==nextdir); + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextdir32); + if (!WriteOK(tif, &nextdir32, sizeof (uint32))) { + TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link"); + return (0); + } + } + else + { + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&nextdir); + if (!WriteOK(tif, &nextdir, sizeof (uint64))) { + TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link"); + return (0); + } + } + /* + * Leave directory state setup safely. We don't have + * facilities for doing inserting and removing directories, + * so it's safest to just invalidate everything. This + * means that the caller can only append to the directory + * chain. + */ + (*tif->tif_cleanup)(tif); + if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { + _TIFFfree(tif->tif_rawdata); + tif->tif_rawdata = NULL; + tif->tif_rawcc = 0; + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = 0; + } + tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP|TIFF_POSTENCODE|TIFF_BUF4WRITE); + TIFFFreeDirectory(tif); + TIFFDefaultDirectory(tif); + tif->tif_diroff = 0; /* force link on next write */ + tif->tif_nextdiroff = 0; /* next write must be at end */ + tif->tif_curoff = 0; + tif->tif_row = (uint32) -1; + tif->tif_curstrip = (uint32) -1; + return (1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.h new file mode 100644 index 0000000..6af5f3d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dir.h @@ -0,0 +1,308 @@ +/* $Id: tif_dir.h,v 1.54 2011-02-18 20:53:05 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFDIR_ +#define _TIFFDIR_ +/* + * ``Library-private'' Directory-related Definitions. + */ + +typedef struct { + const TIFFField *info; + int count; + void *value; +} TIFFTagValue; + +/* + * TIFF Image File Directories are comprised of a table of field + * descriptors of the form shown below. The table is sorted in + * ascending order by tag. The values associated with each entry are + * disjoint and may appear anywhere in the file (so long as they are + * placed on a word boundary). + * + * If the value is 4 bytes or less, in ClassicTIFF, or 8 bytes or less in + * BigTIFF, then it is placed in the offset field to save space. If so, + * it is left-justified in the offset field. + */ +typedef struct { + uint16 tdir_tag; /* see below */ + uint16 tdir_type; /* data type; see below */ + uint64 tdir_count; /* number of items; length in spec */ + union { + uint16 toff_short; + uint32 toff_long; + uint64 toff_long8; + } tdir_offset; /* either offset or the data itself if fits */ +} TIFFDirEntry; + +/* + * Internal format of a TIFF directory entry. + */ +typedef struct { +#define FIELD_SETLONGS 4 + /* bit vector of fields that are set */ + unsigned long td_fieldsset[FIELD_SETLONGS]; + + uint32 td_imagewidth, td_imagelength, td_imagedepth; + uint32 td_tilewidth, td_tilelength, td_tiledepth; + uint32 td_subfiletype; + uint16 td_bitspersample; + uint16 td_sampleformat; + uint16 td_compression; + uint16 td_photometric; + uint16 td_threshholding; + uint16 td_fillorder; + uint16 td_orientation; + uint16 td_samplesperpixel; + uint32 td_rowsperstrip; + uint16 td_minsamplevalue, td_maxsamplevalue; + double* td_sminsamplevalue; + double* td_smaxsamplevalue; + float td_xresolution, td_yresolution; + uint16 td_resolutionunit; + uint16 td_planarconfig; + float td_xposition, td_yposition; + uint16 td_pagenumber[2]; + uint16* td_colormap[3]; + uint16 td_halftonehints[2]; + uint16 td_extrasamples; + uint16* td_sampleinfo; + /* even though the name is misleading, td_stripsperimage is the number + * of striles (=strips or tiles) per plane, and td_nstrips the total + * number of striles */ + uint32 td_stripsperimage; + uint32 td_nstrips; /* size of offset & bytecount arrays */ + uint64* td_stripoffset; + uint64* td_stripbytecount; + int td_stripbytecountsorted; /* is the bytecount array sorted ascending? */ +#if defined(DEFER_STRILE_LOAD) + TIFFDirEntry td_stripoffset_entry; /* for deferred loading */ + TIFFDirEntry td_stripbytecount_entry; /* for deferred loading */ +#endif + uint16 td_nsubifd; + uint64* td_subifd; + /* YCbCr parameters */ + uint16 td_ycbcrsubsampling[2]; + uint16 td_ycbcrpositioning; + /* Colorimetry parameters */ + uint16* td_transferfunction[3]; + float* td_refblackwhite; + /* CMYK parameters */ + int td_inknameslen; + char* td_inknames; + + int td_customValueCount; + TIFFTagValue *td_customValues; +} TIFFDirectory; + +/* + * Field flags used to indicate fields that have been set in a directory, and + * to reference fields when manipulating a directory. + */ + +/* + * FIELD_IGNORE is used to signify tags that are to be processed but otherwise + * ignored. This permits antiquated tags to be quietly read and discarded. + * Note that a bit *is* allocated for ignored tags; this is understood by the + * directory reading logic which uses this fact to avoid special-case handling + */ +#define FIELD_IGNORE 0 + +/* multi-item fields */ +#define FIELD_IMAGEDIMENSIONS 1 +#define FIELD_TILEDIMENSIONS 2 +#define FIELD_RESOLUTION 3 +#define FIELD_POSITION 4 + +/* single-item fields */ +#define FIELD_SUBFILETYPE 5 +#define FIELD_BITSPERSAMPLE 6 +#define FIELD_COMPRESSION 7 +#define FIELD_PHOTOMETRIC 8 +#define FIELD_THRESHHOLDING 9 +#define FIELD_FILLORDER 10 +#define FIELD_ORIENTATION 15 +#define FIELD_SAMPLESPERPIXEL 16 +#define FIELD_ROWSPERSTRIP 17 +#define FIELD_MINSAMPLEVALUE 18 +#define FIELD_MAXSAMPLEVALUE 19 +#define FIELD_PLANARCONFIG 20 +#define FIELD_RESOLUTIONUNIT 22 +#define FIELD_PAGENUMBER 23 +#define FIELD_STRIPBYTECOUNTS 24 +#define FIELD_STRIPOFFSETS 25 +#define FIELD_COLORMAP 26 +#define FIELD_EXTRASAMPLES 31 +#define FIELD_SAMPLEFORMAT 32 +#define FIELD_SMINSAMPLEVALUE 33 +#define FIELD_SMAXSAMPLEVALUE 34 +#define FIELD_IMAGEDEPTH 35 +#define FIELD_TILEDEPTH 36 +#define FIELD_HALFTONEHINTS 37 +#define FIELD_YCBCRSUBSAMPLING 39 +#define FIELD_YCBCRPOSITIONING 40 +#define FIELD_REFBLACKWHITE 41 +#define FIELD_TRANSFERFUNCTION 44 +#define FIELD_INKNAMES 46 +#define FIELD_SUBIFD 49 +/* FIELD_CUSTOM (see tiffio.h) 65 */ +/* end of support for well-known tags; codec-private tags follow */ +#define FIELD_CODEC 66 /* base of codec-private tags */ + + +/* + * Pseudo-tags don't normally need field bits since they are not written to an + * output file (by definition). The library also has express logic to always + * query a codec for a pseudo-tag so allocating a field bit for one is a + * waste. If codec wants to promote the notion of a pseudo-tag being ``set'' + * or ``unset'' then it can do using internal state flags without polluting + * the field bit space defined for real tags. + */ +#define FIELD_PSEUDO 0 + +#define FIELD_LAST (32*FIELD_SETLONGS-1) + +#define BITn(n) (((unsigned long)1L)<<((n)&0x1f)) +#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32]) +#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) +#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field)) +#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field)) + +#define FieldSet(fields, f) (fields[(f)/32] & BITn(f)) +#define ResetFieldBit(fields, f) (fields[(f)/32] &= ~BITn(f)) + +typedef enum { + TIFF_SETGET_UNDEFINED = 0, + TIFF_SETGET_ASCII = 1, + TIFF_SETGET_UINT8 = 2, + TIFF_SETGET_SINT8 = 3, + TIFF_SETGET_UINT16 = 4, + TIFF_SETGET_SINT16 = 5, + TIFF_SETGET_UINT32 = 6, + TIFF_SETGET_SINT32 = 7, + TIFF_SETGET_UINT64 = 8, + TIFF_SETGET_SINT64 = 9, + TIFF_SETGET_FLOAT = 10, + TIFF_SETGET_DOUBLE = 11, + TIFF_SETGET_IFD8 = 12, + TIFF_SETGET_INT = 13, + TIFF_SETGET_UINT16_PAIR = 14, + TIFF_SETGET_C0_ASCII = 15, + TIFF_SETGET_C0_UINT8 = 16, + TIFF_SETGET_C0_SINT8 = 17, + TIFF_SETGET_C0_UINT16 = 18, + TIFF_SETGET_C0_SINT16 = 19, + TIFF_SETGET_C0_UINT32 = 20, + TIFF_SETGET_C0_SINT32 = 21, + TIFF_SETGET_C0_UINT64 = 22, + TIFF_SETGET_C0_SINT64 = 23, + TIFF_SETGET_C0_FLOAT = 24, + TIFF_SETGET_C0_DOUBLE = 25, + TIFF_SETGET_C0_IFD8 = 26, + TIFF_SETGET_C16_ASCII = 27, + TIFF_SETGET_C16_UINT8 = 28, + TIFF_SETGET_C16_SINT8 = 29, + TIFF_SETGET_C16_UINT16 = 30, + TIFF_SETGET_C16_SINT16 = 31, + TIFF_SETGET_C16_UINT32 = 32, + TIFF_SETGET_C16_SINT32 = 33, + TIFF_SETGET_C16_UINT64 = 34, + TIFF_SETGET_C16_SINT64 = 35, + TIFF_SETGET_C16_FLOAT = 36, + TIFF_SETGET_C16_DOUBLE = 37, + TIFF_SETGET_C16_IFD8 = 38, + TIFF_SETGET_C32_ASCII = 39, + TIFF_SETGET_C32_UINT8 = 40, + TIFF_SETGET_C32_SINT8 = 41, + TIFF_SETGET_C32_UINT16 = 42, + TIFF_SETGET_C32_SINT16 = 43, + TIFF_SETGET_C32_UINT32 = 44, + TIFF_SETGET_C32_SINT32 = 45, + TIFF_SETGET_C32_UINT64 = 46, + TIFF_SETGET_C32_SINT64 = 47, + TIFF_SETGET_C32_FLOAT = 48, + TIFF_SETGET_C32_DOUBLE = 49, + TIFF_SETGET_C32_IFD8 = 50, + TIFF_SETGET_OTHER = 51 +} TIFFSetGetFieldType; + +#if defined(__cplusplus) +extern "C" { +#endif + +extern const TIFFFieldArray* _TIFFGetFields(void); +extern const TIFFFieldArray* _TIFFGetExifFields(void); +extern void _TIFFSetupFields(TIFF* tif, const TIFFFieldArray* infoarray); +extern void _TIFFPrintFieldInfo(TIFF*, FILE*); + +extern int _TIFFFillStriles(TIFF*); + +typedef enum { + tfiatImage, + tfiatExif, + tfiatOther +} TIFFFieldArrayType; + +struct _TIFFFieldArray { + TIFFFieldArrayType type; /* array type, will be used to determine if IFD is image and such */ + uint32 allocated_size; /* 0 if array is constant, other if modified by future definition extension support */ + uint32 count; /* number of elements in fields array */ + TIFFField* fields; /* actual field info */ +}; + +struct _TIFFField { + uint32 field_tag; /* field's tag */ + short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ + short field_writecount; /* write count/TIFF_VARIABLE */ + TIFFDataType field_type; /* type of associated data */ + uint32 reserved; /* reserved for future extension */ + TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField */ + TIFFSetGetFieldType get_field_type; /* type to be passed to TIFFGetField */ + unsigned short field_bit; /* bit in fieldsset bit vector */ + unsigned char field_oktochange; /* if true, can change while writing */ + unsigned char field_passcount; /* if true, pass dir count on set */ + char* field_name; /* ASCII name */ + TIFFFieldArray* field_subfields; /* if field points to child ifds, child ifd field definition array */ +}; + +extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32); +extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType); +extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType); + +#if defined(__cplusplus) +} +#endif +#endif /* _TIFFDIR_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirinfo.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirinfo.c new file mode 100644 index 0000000..d319931 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirinfo.c @@ -0,0 +1,957 @@ +/* $Id: tif_dirinfo.c,v 1.117 2012-08-19 16:56:34 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Core Directory Tag Support. + */ +#include "tiffiop.h" +#include + +/* + * NOTE: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG. + * + * NOTE: The second field (field_readcount) and third field (field_writecount) + * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3) + * and TIFF_SPP (-2). The macros should be used but would throw off + * the formatting of the code, so please interprete the -1, -2 and -3 + * values accordingly. + */ + +static TIFFFieldArray tiffFieldArray; +static TIFFFieldArray exifFieldArray; + +static TIFFField +tiffFields[] = { + { TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_SUBFILETYPE, 1, 0, "SubfileType", NULL }, + { TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_SUBFILETYPE, 1, 0, "OldSubfileType", NULL }, + { TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDIMENSIONS, 0, 0, "ImageWidth", NULL }, + { TIFFTAG_IMAGELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDIMENSIONS, 1, 0, "ImageLength", NULL }, + { TIFFTAG_BITSPERSAMPLE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_BITSPERSAMPLE, 0, 0, "BitsPerSample", NULL }, + { TIFFTAG_COMPRESSION, -1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_COMPRESSION, 0, 0, "Compression", NULL }, + { TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_PHOTOMETRIC, 0, 0, "PhotometricInterpretation", NULL }, + { TIFFTAG_THRESHHOLDING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_THRESHHOLDING, 1, 0, "Threshholding", NULL }, + { TIFFTAG_CELLWIDTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "CellWidth", NULL }, + { TIFFTAG_CELLLENGTH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "CellLength", NULL }, + { TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_FILLORDER, 0, 0, "FillOrder", NULL }, + { TIFFTAG_DOCUMENTNAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DocumentName", NULL }, + { TIFFTAG_IMAGEDESCRIPTION, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageDescription", NULL }, + { TIFFTAG_MAKE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Make", NULL }, + { TIFFTAG_MODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Model", NULL }, + { TIFFTAG_STRIPOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "StripOffsets", NULL }, + { TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_ORIENTATION, 0, 0, "Orientation", NULL }, + { TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLESPERPIXEL, 0, 0, "SamplesPerPixel", NULL }, + { TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_ROWSPERSTRIP, 0, 0, "RowsPerStrip", NULL }, + { TIFFTAG_STRIPBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "StripByteCounts", NULL }, + { TIFFTAG_MINSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_MINSAMPLEVALUE, 1, 0, "MinSampleValue", NULL }, + { TIFFTAG_MAXSAMPLEVALUE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_MAXSAMPLEVALUE, 1, 0, "MaxSampleValue", NULL }, + { TIFFTAG_XRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTION, 1, 0, "XResolution", NULL }, + { TIFFTAG_YRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTION, 1, 0, "YResolution", NULL }, + { TIFFTAG_PLANARCONFIG, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_PLANARCONFIG, 0, 0, "PlanarConfiguration", NULL }, + { TIFFTAG_PAGENAME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PageName", NULL }, + { TIFFTAG_XPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_POSITION, 1, 0, "XPosition", NULL }, + { TIFFTAG_YPOSITION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_POSITION, 1, 0, "YPosition", NULL }, + { TIFFTAG_FREEOFFSETS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeOffsets", NULL }, + { TIFFTAG_FREEBYTECOUNTS, -1, -1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 0, 0, "FreeByteCounts", NULL }, + { TIFFTAG_GRAYRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseUnit", NULL }, + { TIFFTAG_GRAYRESPONSECURVE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "GrayResponseCurve", NULL }, + { TIFFTAG_RESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_RESOLUTIONUNIT, 1, 0, "ResolutionUnit", NULL }, + { TIFFTAG_PAGENUMBER, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_PAGENUMBER, 1, 0, "PageNumber", NULL }, + { TIFFTAG_COLORRESPONSEUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_IGNORE, 1, 0, "ColorResponseUnit", NULL }, + { TIFFTAG_TRANSFERFUNCTION, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_TRANSFERFUNCTION, 1, 0, "TransferFunction", NULL }, + { TIFFTAG_SOFTWARE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Software", NULL }, + { TIFFTAG_DATETIME, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTime", NULL }, + { TIFFTAG_ARTIST, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Artist", NULL }, + { TIFFTAG_HOSTCOMPUTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "HostComputer", NULL }, + { TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WhitePoint", NULL }, + { TIFFTAG_PRIMARYCHROMATICITIES, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PrimaryChromaticities", NULL }, + { TIFFTAG_COLORMAP, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_COLORMAP, 1, 0, "ColorMap", NULL }, + { TIFFTAG_HALFTONEHINTS, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_HALFTONEHINTS, 1, 0, "HalftoneHints", NULL }, + { TIFFTAG_TILEWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDIMENSIONS, 0, 0, "TileWidth", NULL }, + { TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDIMENSIONS, 0, 0, "TileLength", NULL }, + { TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPOFFSETS, 0, 0, "TileOffsets", NULL }, + { TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_STRIPBYTECOUNTS, 0, 0, "TileByteCounts", NULL }, + { TIFFTAG_SUBIFD, -1, -1, TIFF_IFD8, 0, TIFF_SETGET_C16_IFD8, TIFF_SETGET_UNDEFINED, FIELD_SUBIFD, 1, 1, "SubIFD", &tiffFieldArray }, + { TIFFTAG_INKSET, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InkSet", NULL }, + { TIFFTAG_INKNAMES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_C16_ASCII, TIFF_SETGET_UNDEFINED, FIELD_INKNAMES, 1, 1, "InkNames", NULL }, + { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "NumberOfInks", NULL }, + { TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DotRange", NULL }, + { TIFFTAG_TARGETPRINTER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TargetPrinter", NULL }, + { TIFFTAG_EXTRASAMPLES, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 1, "ExtraSamples", NULL }, + { TIFFTAG_SAMPLEFORMAT, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "SampleFormat", NULL }, + { TIFFTAG_SMINSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMINSAMPLEVALUE, 1, 0, "SMinSampleValue", NULL }, + { TIFFTAG_SMAXSAMPLEVALUE, -2, -1, TIFF_ANY, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_SMAXSAMPLEVALUE, 1, 0, "SMaxSampleValue", NULL }, + { TIFFTAG_CLIPPATH, -1, -3, TIFF_BYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath", NULL }, + { TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL }, + { TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SBYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL }, + { TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL }, + { TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YCbCrCoefficients", NULL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_UINT16_PAIR, TIFF_SETGET_UNDEFINED, FIELD_YCBCRSUBSAMPLING, 0, 0, "YCbCrSubsampling", NULL }, + { TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_YCBCRPOSITIONING, 0, 0, "YCbCrPositioning", NULL }, + { TIFFTAG_REFERENCEBLACKWHITE, 6, 6, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_REFBLACKWHITE, 1, 0, "ReferenceBlackWhite", NULL }, + { TIFFTAG_XMLPACKET, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "XMLPacket", NULL }, + /* begin SGI tags */ + { TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_EXTRASAMPLES, 0, 0, "Matteing", NULL }, + { TIFFTAG_DATATYPE, -2, -1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_SAMPLEFORMAT, 0, 0, "DataType", NULL }, + { TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_IMAGEDEPTH, 0, 0, "ImageDepth", NULL }, + { TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_TILEDEPTH, 0, 0, "TileDepth", NULL }, + /* end SGI tags */ + /* begin Pixar tags */ + { TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullWidth", NULL }, + { TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageFullLength", NULL }, + { TIFFTAG_PIXAR_TEXTUREFORMAT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureFormat", NULL }, + { TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureWrapModes", NULL }, + { TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent", NULL }, + { TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen", NULL }, + { TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16, 16, TIFF_FLOAT, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera", NULL }, + { TIFFTAG_COPYRIGHT, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Copyright", NULL }, + /* end Pixar tags */ + { TIFFTAG_RICHTIFFIPTC, -3, -3, TIFF_LONG, 0, TIFF_SETGET_C32_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "RichTIFFIPTC", NULL }, + { TIFFTAG_PHOTOSHOP, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "Photoshop", NULL }, + { TIFFTAG_EXIFIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "EXIFIFDOffset", &exifFieldArray }, + { TIFFTAG_ICCPROFILE, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ICC Profile", NULL }, + { TIFFTAG_GPSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "GPSIFDOffset", NULL }, + { TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvParams", NULL }, + { TIFFTAG_FAXSUBADDRESS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxSubAddress", NULL }, + { TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_CUSTOM, TRUE, FALSE, "FaxRecvTime", NULL }, + { TIFFTAG_FAXDCS, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_ASCII, FIELD_CUSTOM, TRUE, FALSE, "FaxDcs", NULL }, + { TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "StoNits", NULL }, + { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL }, + /* begin DNG tags */ + { TIFFTAG_DNGVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DNGVersion", NULL }, + { TIFFTAG_DNGBACKWARDVERSION, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DNGBackwardVersion", NULL }, + { TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "UniqueCameraModel", NULL }, + { TIFFTAG_LOCALIZEDCAMERAMODEL, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "LocalizedCameraModel", NULL }, + { TIFFTAG_CFAPLANECOLOR, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CFAPlaneColor", NULL }, + { TIFFTAG_CFALAYOUT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CFALayout", NULL }, + { TIFFTAG_LINEARIZATIONTABLE, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "LinearizationTable", NULL }, + { TIFFTAG_BLACKLEVELREPEATDIM, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BlackLevelRepeatDim", NULL }, + { TIFFTAG_BLACKLEVEL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "BlackLevel", NULL }, + { TIFFTAG_BLACKLEVELDELTAH, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "BlackLevelDeltaH", NULL }, + { TIFFTAG_BLACKLEVELDELTAV, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "BlackLevelDeltaV", NULL }, + { TIFFTAG_WHITELEVEL, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "WhiteLevel", NULL }, + { TIFFTAG_DEFAULTSCALE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DefaultScale", NULL }, + { TIFFTAG_BESTQUALITYSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BestQualityScale", NULL }, + { TIFFTAG_DEFAULTCROPORIGIN, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DefaultCropOrigin", NULL }, + { TIFFTAG_DEFAULTCROPSIZE, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "DefaultCropSize", NULL }, + { TIFFTAG_COLORMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ColorMatrix1", NULL }, + { TIFFTAG_COLORMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ColorMatrix2", NULL }, + { TIFFTAG_CAMERACALIBRATION1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CameraCalibration1", NULL }, + { TIFFTAG_CAMERACALIBRATION2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CameraCalibration2", NULL }, + { TIFFTAG_REDUCTIONMATRIX1, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ReductionMatrix1", NULL }, + { TIFFTAG_REDUCTIONMATRIX2, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ReductionMatrix2", NULL }, + { TIFFTAG_ANALOGBALANCE, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "AnalogBalance", NULL }, + { TIFFTAG_ASSHOTNEUTRAL, -1, -1, TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "AsShotNeutral", NULL }, + { TIFFTAG_ASSHOTWHITEXY, 2, 2, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "AsShotWhiteXY", NULL }, + { TIFFTAG_BASELINEEXPOSURE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BaselineExposure", NULL }, + { TIFFTAG_BASELINENOISE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BaselineNoise", NULL }, + { TIFFTAG_BASELINESHARPNESS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BaselineSharpness", NULL }, + { TIFFTAG_BAYERGREENSPLIT, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "BayerGreenSplit", NULL }, + { TIFFTAG_LINEARRESPONSELIMIT, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "LinearResponseLimit", NULL }, + { TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CameraSerialNumber", NULL }, + { TIFFTAG_LENSINFO, 4, 4, TIFF_RATIONAL, 0, TIFF_SETGET_C0_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "LensInfo", NULL }, + { TIFFTAG_CHROMABLURRADIUS, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ChromaBlurRadius", NULL }, + { TIFFTAG_ANTIALIASSTRENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "AntiAliasStrength", NULL }, + { TIFFTAG_SHADOWSCALE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ShadowScale", NULL }, + { TIFFTAG_DNGPRIVATEDATA, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "DNGPrivateData", NULL }, + { TIFFTAG_MAKERNOTESAFETY, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "MakerNoteSafety", NULL }, + { TIFFTAG_CALIBRATIONILLUMINANT1, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CalibrationIlluminant1", NULL }, + { TIFFTAG_CALIBRATIONILLUMINANT2, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CalibrationIlluminant2", NULL }, + { TIFFTAG_RAWDATAUNIQUEID, 16, 16, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "RawDataUniqueID", NULL }, + { TIFFTAG_ORIGINALRAWFILENAME, -1, -1, TIFF_BYTE, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OriginalRawFileName", NULL }, + { TIFFTAG_ORIGINALRAWFILEDATA, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "OriginalRawFileData", NULL }, + { TIFFTAG_ACTIVEAREA, 4, 4, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ActiveArea", NULL }, + { TIFFTAG_MASKEDAREAS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "MaskedAreas", NULL }, + { TIFFTAG_ASSHOTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "AsShotICCProfile", NULL }, + { TIFFTAG_ASSHOTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "AsShotPreProfileMatrix", NULL }, + { TIFFTAG_CURRENTICCPROFILE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CurrentICCProfile", NULL }, + { TIFFTAG_CURRENTPREPROFILEMATRIX, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "CurrentPreProfileMatrix", NULL }, + { TIFFTAG_PERSAMPLE, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "PerSample", NULL}, + /* end DNG tags */ + /* begin TIFF/FX tags */ + { TIFFTAG_INDEXED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "Indexed" }, + { TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "GlobalParametersIFD", NULL }, + { TIFFTAG_PROFILETYPE, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ProfileType", NULL }, + { TIFFTAG_FAXPROFILE, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "FaxProfile", NULL }, + { TIFFTAG_CODINGMETHODS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "CodingMethods", NULL }, + { TIFFTAG_VERSIONYEAR, 4, 4, TIFF_BYTE, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "VersionYear", NULL }, + { TIFFTAG_MODENUMBER, 1, 1, TIFF_BYTE, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ModeNumber", NULL }, + { TIFFTAG_DECODE, -1, -1, TIFF_SRATIONAL, 0, TIFF_SETGET_C16_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "Decode", NULL }, + { TIFFTAG_IMAGEBASECOLOR, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ImageBaseColor", NULL }, + { TIFFTAG_T82OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "T82Options", NULL }, + { TIFFTAG_STRIPROWCOUNTS, -1, -1, TIFF_LONG, 0, TIFF_SETGET_C16_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "StripRowCounts", NULL }, + { TIFFTAG_IMAGELAYER, 2, 2, TIFF_LONG, 0, TIFF_SETGET_C0_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "ImageLayer", NULL }, + /* end DNG tags */ + /* begin pseudo tags */ +}; + +static TIFFField +exifFields[] = { + { EXIFTAG_EXPOSURETIME, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureTime", NULL }, + { EXIFTAG_FNUMBER, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FNumber", NULL }, + { EXIFTAG_EXPOSUREPROGRAM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureProgram", NULL }, + { EXIFTAG_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SpectralSensitivity", NULL }, + { EXIFTAG_ISOSPEEDRATINGS, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "ISOSpeedRatings", NULL }, + { EXIFTAG_OECF, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OptoelectricConversionFactor", NULL }, + { EXIFTAG_EXIFVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExifVersion", NULL }, + { EXIFTAG_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeOriginal", NULL }, + { EXIFTAG_DATETIMEDIGITIZED, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeDigitized", NULL }, + { EXIFTAG_COMPONENTSCONFIGURATION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ComponentsConfiguration", NULL }, + { EXIFTAG_COMPRESSEDBITSPERPIXEL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CompressedBitsPerPixel", NULL }, + { EXIFTAG_SHUTTERSPEEDVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ShutterSpeedValue", NULL }, + { EXIFTAG_APERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ApertureValue", NULL }, + { EXIFTAG_BRIGHTNESSVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "BrightnessValue", NULL }, + { EXIFTAG_EXPOSUREBIASVALUE, 1, 1, TIFF_SRATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureBiasValue", NULL }, + { EXIFTAG_MAXAPERTUREVALUE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MaxApertureValue", NULL }, + { EXIFTAG_SUBJECTDISTANCE, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectDistance", NULL }, + { EXIFTAG_METERINGMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "MeteringMode", NULL }, + { EXIFTAG_LIGHTSOURCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "LightSource", NULL }, + { EXIFTAG_FLASH, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Flash", NULL }, + { EXIFTAG_FOCALLENGTH, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalLength", NULL }, + { EXIFTAG_SUBJECTAREA, -1, -1, TIFF_SHORT, 0, TIFF_SETGET_C16_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "SubjectArea", NULL }, + { EXIFTAG_MAKERNOTE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "MakerNote", NULL }, + { EXIFTAG_USERCOMMENT, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "UserComment", NULL }, + { EXIFTAG_SUBSECTIME, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTime", NULL }, + { EXIFTAG_SUBSECTIMEORIGINAL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeOriginal", NULL }, + { EXIFTAG_SUBSECTIMEDIGITIZED, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeDigitized", NULL }, + { EXIFTAG_FLASHPIXVERSION, 4, 4, TIFF_UNDEFINED, 0, TIFF_SETGET_C0_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FlashpixVersion", NULL }, + { EXIFTAG_COLORSPACE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ColorSpace", NULL }, + { EXIFTAG_PIXELXDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PixelXDimension", NULL }, + { EXIFTAG_PIXELYDIMENSION, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "PixelYDimension", NULL }, + { EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RelatedSoundFile", NULL }, + { EXIFTAG_FLASHENERGY, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FlashEnergy", NULL }, + { EXIFTAG_SPATIALFREQUENCYRESPONSE, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "SpatialFrequencyResponse", NULL }, + { EXIFTAG_FOCALPLANEXRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneXResolution", NULL }, + { EXIFTAG_FOCALPLANEYRESOLUTION, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneYResolution", NULL }, + { EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit", NULL }, + { EXIFTAG_SUBJECTLOCATION, 2, 2, TIFF_SHORT, 0, TIFF_SETGET_C0_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectLocation", NULL }, + { EXIFTAG_EXPOSUREINDEX, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureIndex", NULL }, + { EXIFTAG_SENSINGMETHOD, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SensingMethod", NULL }, + { EXIFTAG_FILESOURCE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FileSource", NULL }, + { EXIFTAG_SCENETYPE, 1, 1, TIFF_UNDEFINED, 0, TIFF_SETGET_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SceneType", NULL }, + { EXIFTAG_CFAPATTERN, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "CFAPattern", NULL }, + { EXIFTAG_CUSTOMRENDERED, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CustomRendered", NULL }, + { EXIFTAG_EXPOSUREMODE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ExposureMode", NULL }, + { EXIFTAG_WHITEBALANCE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "WhiteBalance", NULL }, + { EXIFTAG_DIGITALZOOMRATIO, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DigitalZoomRatio", NULL }, + { EXIFTAG_FOCALLENGTHIN35MMFILM, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalLengthIn35mmFilm", NULL }, + { EXIFTAG_SCENECAPTURETYPE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SceneCaptureType", NULL }, + { EXIFTAG_GAINCONTROL, 1, 1, TIFF_RATIONAL, 0, TIFF_SETGET_DOUBLE, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "GainControl", NULL }, + { EXIFTAG_CONTRAST, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Contrast", NULL }, + { EXIFTAG_SATURATION, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Saturation", NULL }, + { EXIFTAG_SHARPNESS, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Sharpness", NULL }, + { EXIFTAG_DEVICESETTINGDESCRIPTION, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "DeviceSettingDescription", NULL }, + { EXIFTAG_SUBJECTDISTANCERANGE, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubjectDistanceRange", NULL }, + { EXIFTAG_IMAGEUNIQUEID, 33, 33, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "ImageUniqueID", NULL } +}; + +static TIFFFieldArray +tiffFieldArray = { tfiatImage, 0, TIFFArrayCount(tiffFields), tiffFields }; +static TIFFFieldArray +exifFieldArray = { tfiatExif, 0, TIFFArrayCount(exifFields), exifFields }; + +/* + * We have our own local lfind() equivelent to avoid subtle differences + * in types passed to lfind() on different systems. + */ + +static void * +td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(key, element)) /* key found */ + return element; + + return NULL; +} + +const TIFFFieldArray* +_TIFFGetFields(void) +{ + return(&tiffFieldArray); +} + +const TIFFFieldArray* +_TIFFGetExifFields(void) +{ + return(&exifFieldArray); +} + +void +_TIFFSetupFields(TIFF* tif, const TIFFFieldArray* fieldarray) +{ + if (tif->tif_fields && tif->tif_nfields > 0) { + uint32 i; + + for (i = 0; i < tif->tif_nfields; i++) { + TIFFField *fld = tif->tif_fields[i]; + if (fld->field_bit == FIELD_CUSTOM && + strncmp("Tag ", fld->field_name, 4) == 0) { + _TIFFfree(fld->field_name); + _TIFFfree(fld); + } + } + + _TIFFfree(tif->tif_fields); + tif->tif_fields = NULL; + tif->tif_nfields = 0; + } + if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count)) { + TIFFErrorExt(tif->tif_clientdata, "_TIFFSetupFields", + "Setting up field info failed"); + } +} + +static int +tagCompare(const void* a, const void* b) +{ + const TIFFField* ta = *(const TIFFField**) a; + const TIFFField* tb = *(const TIFFField**) b; + /* NB: be careful of return values for 16-bit platforms */ + if (ta->field_tag != tb->field_tag) + return (int)ta->field_tag - (int)tb->field_tag; + else + return (ta->field_type == TIFF_ANY) ? + 0 : ((int)tb->field_type - (int)ta->field_type); +} + +static int +tagNameCompare(const void* a, const void* b) +{ + const TIFFField* ta = *(const TIFFField**) a; + const TIFFField* tb = *(const TIFFField**) b; + int ret = strcmp(ta->field_name, tb->field_name); + + if (ret) + return ret; + else + return (ta->field_type == TIFF_ANY) ? + 0 : ((int)tb->field_type - (int)ta->field_type); +} + +int +_TIFFMergeFields(TIFF* tif, const TIFFField info[], uint32 n) +{ + static const char module[] = "_TIFFMergeFields"; + static const char reason[] = "for fields array"; + /* TIFFField** tp; */ + uint32 i; + + tif->tif_foundfield = NULL; + + if (tif->tif_fields && tif->tif_nfields > 0) { + tif->tif_fields = (TIFFField**) + _TIFFCheckRealloc(tif, tif->tif_fields, + (tif->tif_nfields + n), + sizeof(TIFFField *), reason); + } else { + tif->tif_fields = (TIFFField **) + _TIFFCheckMalloc(tif, n, sizeof(TIFFField *), + reason); + } + if (!tif->tif_fields) { + TIFFErrorExt(tif->tif_clientdata, module, + "Failed to allocate fields array"); + return 0; + } + + /* tp = tif->tif_fields + tif->tif_nfields; */ + for (i = 0; i < n; i++) { + const TIFFField *fip = + TIFFFindField(tif, info[i].field_tag, TIFF_ANY); + + /* only add definitions that aren't already present */ + if (!fip) { + tif->tif_fields[tif->tif_nfields] = (TIFFField *) (info+i); + tif->tif_nfields++; + } + } + + /* Sort the field info by tag number */ + qsort(tif->tif_fields, tif->tif_nfields, + sizeof(TIFFField *), tagCompare); + + return n; +} + +void +_TIFFPrintFieldInfo(TIFF* tif, FILE* fd) +{ + uint32 i; + + fprintf(fd, "%s: \n", tif->tif_name); + for (i = 0; i < tif->tif_nfields; i++) { + const TIFFField* fip = tif->tif_fields[i]; + fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n" + , (int)i + , (unsigned long) fip->field_tag + , fip->field_readcount, fip->field_writecount + , fip->field_type + , fip->field_bit + , fip->field_oktochange ? "TRUE" : "FALSE" + , fip->field_passcount ? "TRUE" : "FALSE" + , fip->field_name + ); + } +} + +/* + * Return size of TIFFDataType in bytes + */ +int +TIFFDataWidth(TIFFDataType type) +{ + switch(type) + { + case 0: /* nothing */ + case TIFF_BYTE: + case TIFF_ASCII: + case TIFF_SBYTE: + case TIFF_UNDEFINED: + return 1; + case TIFF_SHORT: + case TIFF_SSHORT: + return 2; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + case TIFF_IFD: + return 4; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_DOUBLE: + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_IFD8: + return 8; + default: + return 0; /* will return 0 for unknown types */ + } +} + +/* + * Return size of TIFFDataType in bytes. + * + * XXX: We need a separate function to determine the space needed + * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8, + * but we use 4-byte float to represent rationals. + */ +int +_TIFFDataSize(TIFFDataType type) +{ + switch (type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_ASCII: + case TIFF_UNDEFINED: + return 1; + case TIFF_SHORT: + case TIFF_SSHORT: + return 2; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + case TIFF_IFD: + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + return 4; + case TIFF_DOUBLE: + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_IFD8: + return 8; + default: + return 0; + } +} + +const TIFFField* +TIFFFindField(TIFF* tif, uint32 tag, TIFFDataType dt) +{ + TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL}; + TIFFField* pkey = &key; + const TIFFField **ret; + if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag && + (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type)) + return tif->tif_foundfield; + + /* If we are invoked with no field information, then just return. */ + if (!tif->tif_fields) + return NULL; + + /* NB: use sorted search (e.g. binary search) */ + + key.field_tag = tag; + key.field_type = dt; + + ret = (const TIFFField **) bsearch(&pkey, tif->tif_fields, + tif->tif_nfields, + sizeof(TIFFField *), tagCompare); + return tif->tif_foundfield = (ret ? *ret : NULL); +} + +const TIFFField* +_TIFFFindFieldByName(TIFF* tif, const char *field_name, TIFFDataType dt) +{ + TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL}; + TIFFField* pkey = &key; + const TIFFField **ret; + if (tif->tif_foundfield + && streq(tif->tif_foundfield->field_name, field_name) + && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type)) + return (tif->tif_foundfield); + + /* If we are invoked with no field information, then just return. */ + if (!tif->tif_fields) + return NULL; + + /* NB: use linear search since list is sorted by key#, not name */ + + key.field_name = (char *)field_name; + key.field_type = dt; + + ret = (const TIFFField **) + td_lfind(&pkey, tif->tif_fields, &tif->tif_nfields, + sizeof(TIFFField *), tagNameCompare); + + return tif->tif_foundfield = (ret ? *ret : NULL); +} + +const TIFFField* +TIFFFieldWithTag(TIFF* tif, uint32 tag) +{ + const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY); + if (!fip) { + TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag", + "Internal error, unknown tag 0x%x", + (unsigned int) tag); + } + return (fip); +} + +const TIFFField* +TIFFFieldWithName(TIFF* tif, const char *field_name) +{ + const TIFFField* fip = + _TIFFFindFieldByName(tif, field_name, TIFF_ANY); + if (!fip) { + TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName", + "Internal error, unknown tag %s", field_name); + } + return (fip); +} + +uint32 +TIFFFieldTag(const TIFFField* fip) +{ + return fip->field_tag; +} + +const char * +TIFFFieldName(const TIFFField* fip) +{ + return fip->field_name; +} + +TIFFDataType +TIFFFieldDataType(const TIFFField* fip) +{ + return fip->field_type; +} + +int +TIFFFieldPassCount(const TIFFField* fip) +{ + return fip->field_passcount; +} + +int +TIFFFieldReadCount(const TIFFField* fip) +{ + return fip->field_readcount; +} + +int +TIFFFieldWriteCount(const TIFFField* fip) +{ + return fip->field_writecount; +} + +const TIFFField* +_TIFFFindOrRegisterField(TIFF *tif, uint32 tag, TIFFDataType dt) + +{ + const TIFFField *fld; + + fld = TIFFFindField(tif, tag, dt); + if (fld == NULL) { + fld = _TIFFCreateAnonField(tif, tag, dt); + if (!_TIFFMergeFields(tif, fld, 1)) + return NULL; + } + + return fld; +} + +TIFFField* +_TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type) +{ + TIFFField *fld; + (void) tif; + + fld = (TIFFField *) _TIFFmalloc(sizeof (TIFFField)); + if (fld == NULL) + return NULL; + _TIFFmemset(fld, 0, sizeof(TIFFField)); + + fld->field_tag = tag; + fld->field_readcount = TIFF_VARIABLE2; + fld->field_writecount = TIFF_VARIABLE2; + fld->field_type = field_type; + fld->reserved = 0; + switch (field_type) + { + case TIFF_BYTE: + case TIFF_UNDEFINED: + fld->set_field_type = TIFF_SETGET_C32_UINT8; + fld->get_field_type = TIFF_SETGET_C32_UINT8; + break; + case TIFF_ASCII: + fld->set_field_type = TIFF_SETGET_C32_ASCII; + fld->get_field_type = TIFF_SETGET_C32_ASCII; + break; + case TIFF_SHORT: + fld->set_field_type = TIFF_SETGET_C32_UINT16; + fld->get_field_type = TIFF_SETGET_C32_UINT16; + break; + case TIFF_LONG: + fld->set_field_type = TIFF_SETGET_C32_UINT32; + fld->get_field_type = TIFF_SETGET_C32_UINT32; + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + fld->set_field_type = TIFF_SETGET_C32_FLOAT; + fld->get_field_type = TIFF_SETGET_C32_FLOAT; + break; + case TIFF_SBYTE: + fld->set_field_type = TIFF_SETGET_C32_SINT8; + fld->get_field_type = TIFF_SETGET_C32_SINT8; + break; + case TIFF_SSHORT: + fld->set_field_type = TIFF_SETGET_C32_SINT16; + fld->get_field_type = TIFF_SETGET_C32_SINT16; + break; + case TIFF_SLONG: + fld->set_field_type = TIFF_SETGET_C32_SINT32; + fld->get_field_type = TIFF_SETGET_C32_SINT32; + break; + case TIFF_DOUBLE: + fld->set_field_type = TIFF_SETGET_C32_DOUBLE; + fld->get_field_type = TIFF_SETGET_C32_DOUBLE; + break; + case TIFF_IFD: + case TIFF_IFD8: + fld->set_field_type = TIFF_SETGET_C32_IFD8; + fld->get_field_type = TIFF_SETGET_C32_IFD8; + break; + case TIFF_LONG8: + fld->set_field_type = TIFF_SETGET_C32_UINT64; + fld->get_field_type = TIFF_SETGET_C32_UINT64; + break; + case TIFF_SLONG8: + fld->set_field_type = TIFF_SETGET_C32_SINT64; + fld->get_field_type = TIFF_SETGET_C32_SINT64; + break; + default: + fld->set_field_type = TIFF_SETGET_UNDEFINED; + fld->get_field_type = TIFF_SETGET_UNDEFINED; + break; + } + fld->field_bit = FIELD_CUSTOM; + fld->field_oktochange = TRUE; + fld->field_passcount = TRUE; + fld->field_name = (char *) _TIFFmalloc(32); + if (fld->field_name == NULL) { + _TIFFfree(fld); + return NULL; + } + fld->field_subfields = NULL; + + /* + * note that this name is a special sign to TIFFClose() and + * _TIFFSetupFields() to free the field + */ + sprintf(fld->field_name, "Tag %d", (int) tag); + + return fld; +} + +/**************************************************************************** + * O B S O L E T E D I N T E R F A C E S + * + * Don't use this stuff in your applications, it may be removed in the future + * libtiff versions. + ****************************************************************************/ + +static TIFFSetGetFieldType +_TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount) +{ + if (type == TIFF_ASCII && count == TIFF_VARIABLE && passcount == 0) + return TIFF_SETGET_ASCII; + + else if (count == 1 && passcount == 0) { + switch (type) + { + case TIFF_BYTE: + case TIFF_UNDEFINED: + return TIFF_SETGET_UINT8; + case TIFF_ASCII: + return TIFF_SETGET_ASCII; + case TIFF_SHORT: + return TIFF_SETGET_UINT16; + case TIFF_LONG: + return TIFF_SETGET_UINT32; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + return TIFF_SETGET_FLOAT; + case TIFF_SBYTE: + return TIFF_SETGET_SINT8; + case TIFF_SSHORT: + return TIFF_SETGET_SINT16; + case TIFF_SLONG: + return TIFF_SETGET_SINT32; + case TIFF_DOUBLE: + return TIFF_SETGET_DOUBLE; + case TIFF_IFD: + case TIFF_IFD8: + return TIFF_SETGET_IFD8; + case TIFF_LONG8: + return TIFF_SETGET_UINT64; + case TIFF_SLONG8: + return TIFF_SETGET_SINT64; + default: + return TIFF_SETGET_UNDEFINED; + } + } + + else if (count >= 1 && passcount == 0) { + switch (type) + { + case TIFF_BYTE: + case TIFF_UNDEFINED: + return TIFF_SETGET_C0_UINT8; + case TIFF_ASCII: + return TIFF_SETGET_C0_ASCII; + case TIFF_SHORT: + return TIFF_SETGET_C0_UINT16; + case TIFF_LONG: + return TIFF_SETGET_C0_UINT32; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + return TIFF_SETGET_C0_FLOAT; + case TIFF_SBYTE: + return TIFF_SETGET_C0_SINT8; + case TIFF_SSHORT: + return TIFF_SETGET_C0_SINT16; + case TIFF_SLONG: + return TIFF_SETGET_C0_SINT32; + case TIFF_DOUBLE: + return TIFF_SETGET_C0_DOUBLE; + case TIFF_IFD: + case TIFF_IFD8: + return TIFF_SETGET_C0_IFD8; + case TIFF_LONG8: + return TIFF_SETGET_C0_UINT64; + case TIFF_SLONG8: + return TIFF_SETGET_C0_SINT64; + default: + return TIFF_SETGET_UNDEFINED; + } + } + + else if (count == TIFF_VARIABLE && passcount == 1) { + switch (type) + { + case TIFF_BYTE: + case TIFF_UNDEFINED: + return TIFF_SETGET_C16_UINT8; + case TIFF_ASCII: + return TIFF_SETGET_C16_ASCII; + case TIFF_SHORT: + return TIFF_SETGET_C16_UINT16; + case TIFF_LONG: + return TIFF_SETGET_C16_UINT32; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + return TIFF_SETGET_C16_FLOAT; + case TIFF_SBYTE: + return TIFF_SETGET_C16_SINT8; + case TIFF_SSHORT: + return TIFF_SETGET_C16_SINT16; + case TIFF_SLONG: + return TIFF_SETGET_C16_SINT32; + case TIFF_DOUBLE: + return TIFF_SETGET_C16_DOUBLE; + case TIFF_IFD: + case TIFF_IFD8: + return TIFF_SETGET_C16_IFD8; + case TIFF_LONG8: + return TIFF_SETGET_C16_UINT64; + case TIFF_SLONG8: + return TIFF_SETGET_C16_SINT64; + default: + return TIFF_SETGET_UNDEFINED; + } + } + + else if (count == TIFF_VARIABLE2 && passcount == 1) { + switch (type) + { + case TIFF_BYTE: + case TIFF_UNDEFINED: + return TIFF_SETGET_C32_UINT8; + case TIFF_ASCII: + return TIFF_SETGET_C32_ASCII; + case TIFF_SHORT: + return TIFF_SETGET_C32_UINT16; + case TIFF_LONG: + return TIFF_SETGET_C32_UINT32; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + return TIFF_SETGET_C32_FLOAT; + case TIFF_SBYTE: + return TIFF_SETGET_C32_SINT8; + case TIFF_SSHORT: + return TIFF_SETGET_C32_SINT16; + case TIFF_SLONG: + return TIFF_SETGET_C32_SINT32; + case TIFF_DOUBLE: + return TIFF_SETGET_C32_DOUBLE; + case TIFF_IFD: + case TIFF_IFD8: + return TIFF_SETGET_C32_IFD8; + case TIFF_LONG8: + return TIFF_SETGET_C32_UINT64; + case TIFF_SLONG8: + return TIFF_SETGET_C32_SINT64; + default: + return TIFF_SETGET_UNDEFINED; + } + } + + return TIFF_SETGET_UNDEFINED; +} + +int +TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n) +{ + static const char module[] = "TIFFMergeFieldInfo"; + static const char reason[] = "for fields array"; + TIFFField *tp; + size_t nfields; + uint32 i; + + if (tif->tif_nfieldscompat > 0) { + tif->tif_fieldscompat = (TIFFFieldArray *) + _TIFFCheckRealloc(tif, tif->tif_fieldscompat, + tif->tif_nfieldscompat + 1, + sizeof(TIFFFieldArray), reason); + } else { + tif->tif_fieldscompat = (TIFFFieldArray *) + _TIFFCheckMalloc(tif, 1, sizeof(TIFFFieldArray), + reason); + } + if (!tif->tif_fieldscompat) { + TIFFErrorExt(tif->tif_clientdata, module, + "Failed to allocate fields array"); + return -1; + } + nfields = tif->tif_nfieldscompat++; + + tif->tif_fieldscompat[nfields].type = tfiatOther; + tif->tif_fieldscompat[nfields].allocated_size = n; + tif->tif_fieldscompat[nfields].count = n; + tif->tif_fieldscompat[nfields].fields = + (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField), + reason); + if (!tif->tif_fieldscompat[nfields].fields) { + TIFFErrorExt(tif->tif_clientdata, module, + "Failed to allocate fields array"); + return -1; + } + + tp = tif->tif_fieldscompat[nfields].fields; + for (i = 0; i < n; i++) { + tp->field_tag = info[i].field_tag; + tp->field_readcount = info[i].field_readcount; + tp->field_writecount = info[i].field_writecount; + tp->field_type = info[i].field_type; + tp->reserved = 0; + tp->set_field_type = + _TIFFSetGetType(info[i].field_type, + info[i].field_readcount, + info[i].field_passcount); + tp->get_field_type = + _TIFFSetGetType(info[i].field_type, + info[i].field_readcount, + info[i].field_passcount); + tp->field_bit = info[i].field_bit; + tp->field_oktochange = info[i].field_oktochange; + tp->field_passcount = info[i].field_passcount; + tp->field_name = info[i].field_name; + tp->field_subfields = NULL; + tp++; + } + + if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Setting up field info failed"); + return -1; + } + + return 0; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirread.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirread.c new file mode 100644 index 0000000..19a26e2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirread.c @@ -0,0 +1,5613 @@ +/* $Id: tif_dirread.c,v 1.178 2012-08-19 16:56:34 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Directory Read Support Routines. + */ + +/* Suggested pending improvements: + * - add a field 'ignore' to the TIFFDirEntry structure, to flag status, + * eliminating current use of the IGNORE value, and therefore eliminating + * current irrational behaviour on tags with tag id code 0 + * - add a field 'field_info' to the TIFFDirEntry structure, and set that with + * the pointer to the appropriate TIFFField structure early on in + * TIFFReadDirectory, so as to eliminate current possibly repetitive lookup. + */ + +#include "tiffiop.h" + +#define IGNORE 0 /* tag placeholder used below */ +#define FAILED_FII ((uint32) -1) + +#ifdef HAVE_IEEEFP +# define TIFFCvtIEEEFloatToNative(tif, n, fp) +# define TIFFCvtIEEEDoubleToNative(tif, n, dp) +#else +extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*); +extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*); +#endif + +enum TIFFReadDirEntryErr { + TIFFReadDirEntryErrOk = 0, + TIFFReadDirEntryErrCount = 1, + TIFFReadDirEntryErrType = 2, + TIFFReadDirEntryErrIo = 3, + TIFFReadDirEntryErrRange = 4, + TIFFReadDirEntryErrPsdif = 5, + TIFFReadDirEntryErrSizesan = 6, + TIFFReadDirEntryErrAlloc = 7, +}; + +static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* direntry, float* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry* direntry, double* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64* value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEntry* direntry, float** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value); +#if 0 +static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleDouble(TIFF* tif, TIFFDirEntry* direntry, double* value); +#endif + +static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value); +static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8* value); +static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value); +static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16* value); +static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value); +static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFDirEntry* direntry, double* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFFDirEntry* direntry, double* value); +static void TIFFReadDirEntryCheckedFloat(TIFF* tif, TIFFDirEntry* direntry, float* value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF* tif, TIFFDirEntry* direntry, double* value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong(uint32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong8(uint64 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongSlong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sbyte(int8 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sshort(int16 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong(int32 value); +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong8(int64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value); + +static enum TIFFReadDirEntryErr TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest); +static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, const char* module, const char* tagname, int recover); + +static void TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16 dircount); +static TIFFDirEntry* TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16 dircount, uint16 tagid); +static void TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii); + +static int EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount); +static void MissingRequired(TIFF*, const char*); +static int TIFFCheckDirOffset(TIFF* tif, uint64 diroff); +static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32); +static uint16 TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir, uint64* nextdiroff); +static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover); +static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp); +static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*); +static void ChopUpSingleUncompressedStrip(TIFF*); +static uint64 TIFFReadUInt64(const uint8 *value); + +typedef union _UInt64Aligned_t +{ + double d; + uint64 l; + uint32 i[2]; + uint16 s[4]; + uint8 c[8]; +} UInt64Aligned_t; + +/* + Unaligned safe copy of a uint64 value from an octet array. +*/ +static uint64 TIFFReadUInt64(const uint8 *value) +{ + UInt64Aligned_t result; + + result.c[0]=value[0]; + result.c[1]=value[1]; + result.c[2]=value[2]; + result.c[3]=value[3]; + result.c[4]=value[4]; + result.c[5]=value[5]; + result.c[6]=value[6]; + result.c[7]=value[7]; + + return result.l; +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + TIFFReadDirEntryCheckedByte(tif,direntry,value); + return(TIFFReadDirEntryErrOk); + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeByteSbyte(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + { + uint16 m; + TIFFReadDirEntryCheckedShort(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeByteShort(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeByteSshort(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeByteLong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeByteSlong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + { + uint64 m; + err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeByteLong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeByteSlong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint8)m; + return(TIFFReadDirEntryErrOk); + } + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8 m; + TIFFReadDirEntryCheckedByte(tif,direntry,&m); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeShortSbyte(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + TIFFReadDirEntryCheckedShort(tif,direntry,value); + return(TIFFReadDirEntryErrOk); + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeShortSshort(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeShortLong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeShortSlong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + { + uint64 m; + err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeShortLong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeShortSlong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint16)m; + return(TIFFReadDirEntryErrOk); + } + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8 m; + TIFFReadDirEntryCheckedByte(tif,direntry,&m); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLongSbyte(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + { + uint16 m; + TIFFReadDirEntryCheckedShort(tif,direntry,&m); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLongSshort(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + TIFFReadDirEntryCheckedLong(tif,direntry,value); + return(TIFFReadDirEntryErrOk); + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLongSlong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + { + uint64 m; + err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeLongLong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeLongSlong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint32)m; + return(TIFFReadDirEntryErrOk); + } + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8 m; + TIFFReadDirEntryCheckedByte(tif,direntry,&m); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLong8Sbyte(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + { + uint16 m; + TIFFReadDirEntryCheckedShort(tif,direntry,&m); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLong8Sshort(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + err=TIFFReadDirEntryCheckRangeLong8Slong(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + err=TIFFReadDirEntryCheckedLong8(tif,direntry,value); + return(err); + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + err=TIFFReadDirEntryCheckRangeLong8Slong8(m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* direntry, float* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8 m; + TIFFReadDirEntryCheckedByte(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + { + uint16 m; + TIFFReadDirEntryCheckedShort(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + { + uint64 m; + err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); +#if defined(__WIN32__) && (_MSC_VER < 1500) + /* + * XXX: MSVC 6.0 does not support conversion + * of 64-bit integers into floating point + * values. + */ + *value = _TIFFUInt64ToFloat(m); +#else + *value=(float)m; +#endif + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_RATIONAL: + { + double m; + err=TIFFReadDirEntryCheckedRational(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SRATIONAL: + { + double m; + err=TIFFReadDirEntryCheckedSrational(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_FLOAT: + TIFFReadDirEntryCheckedFloat(tif,direntry,value); + return(TIFFReadDirEntryErrOk); + case TIFF_DOUBLE: + { + double m; + err=TIFFReadDirEntryCheckedDouble(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(float)m; + return(TIFFReadDirEntryErrOk); + } + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry* direntry, double* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8 m; + TIFFReadDirEntryCheckedByte(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SBYTE: + { + int8 m; + TIFFReadDirEntryCheckedSbyte(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SHORT: + { + uint16 m; + TIFFReadDirEntryCheckedShort(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + { + int16 m; + TIFFReadDirEntryCheckedSshort(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + { + int32 m; + TIFFReadDirEntryCheckedSlong(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + { + uint64 m; + err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); +#if defined(__WIN32__) && (_MSC_VER < 1500) + /* + * XXX: MSVC 6.0 does not support conversion + * of 64-bit integers into floating point + * values. + */ + *value = _TIFFUInt64ToDouble(m); +#else + *value = (double)m; +#endif + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + { + int64 m; + err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_RATIONAL: + err=TIFFReadDirEntryCheckedRational(tif,direntry,value); + return(err); + case TIFF_SRATIONAL: + err=TIFFReadDirEntryCheckedSrational(tif,direntry,value); + return(err); + case TIFF_FLOAT: + { + float m; + TIFFReadDirEntryCheckedFloat(tif,direntry,&m); + *value=(double)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_DOUBLE: + err=TIFFReadDirEntryCheckedDouble(tif,direntry,value); + return(err); + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64* value) +{ + enum TIFFReadDirEntryErr err; + if (direntry->tdir_count!=1) + return(TIFFReadDirEntryErrCount); + switch (direntry->tdir_type) + { + case TIFF_LONG: + case TIFF_IFD: + { + uint32 m; + TIFFReadDirEntryCheckedLong(tif,direntry,&m); + *value=(uint64)m; + return(TIFFReadDirEntryErrOk); + } + case TIFF_LONG8: + case TIFF_IFD8: + err=TIFFReadDirEntryCheckedLong8(tif,direntry,value); + return(err); + default: + return(TIFFReadDirEntryErrType); + } +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value) +{ + int typesize; + uint32 datasize; + void* data; + typesize=TIFFDataWidth(direntry->tdir_type); + if ((direntry->tdir_count==0)||(typesize==0)) + { + *value=0; + return(TIFFReadDirEntryErrOk); + } + (void) desttypesize; + + /* + * As a sanity check, make sure we have no more than a 2GB tag array + * in either the current data type or the dest data type. This also + * avoids problems with overflow of tmsize_t on 32bit systems. + */ + if ((uint64)(2147483647/typesize)tdir_count) + return(TIFFReadDirEntryErrSizesan); + if ((uint64)(2147483647/desttypesize)tdir_count) + return(TIFFReadDirEntryErrSizesan); + + *count=(uint32)direntry->tdir_count; + datasize=(*count)*typesize; + assert((tmsize_t)datasize>0); + data=_TIFFCheckMalloc(tif, *count, typesize, "ReadDirEntryArray"); + if (data==0) + return(TIFFReadDirEntryErrAlloc); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (datasize<=4) + _TIFFmemcpy(data,&direntry->tdir_offset,datasize); + else + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,(uint64)offset,(tmsize_t)datasize,data); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + } + } + else + { + if (datasize<=8) + _TIFFmemcpy(data,&direntry->tdir_offset,datasize); + else + { + enum TIFFReadDirEntryErr err; + uint64 offset = direntry->tdir_offset.toff_long8; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(&offset); + err=TIFFReadDirEntryData(tif,offset,(tmsize_t)datasize,data); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + } + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + uint8* data; + switch (direntry->tdir_type) + { + case TIFF_ASCII: + case TIFF_UNDEFINED: + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,1,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_ASCII: + case TIFF_UNDEFINED: + case TIFF_BYTE: + *value=(uint8*)origdata; + return(TIFFReadDirEntryErrOk); + case TIFF_SBYTE: + { + int8* m; + uint32 n; + m=(int8*)origdata; + for (n=0; ntdir_type) + { + case TIFF_SHORT: + { + uint16* ma; + uint8* mb; + uint32 n; + ma=(uint16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + err=TIFFReadDirEntryCheckRangeByteShort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + uint8* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + err=TIFFReadDirEntryCheckRangeByteSshort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + uint8* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + err=TIFFReadDirEntryCheckRangeByteLong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + uint8* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + err=TIFFReadDirEntryCheckRangeByteSlong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + uint8* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeByteLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + uint8* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeByteSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint8)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + int8* data; + switch (direntry->tdir_type) + { + case TIFF_UNDEFINED: + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,1,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_UNDEFINED: + case TIFF_BYTE: + { + uint8* m; + uint32 n; + m=(uint8*)origdata; + for (n=0; ntdir_type) + { + case TIFF_SHORT: + { + uint16* ma; + int8* mb; + uint32 n; + ma=(uint16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + err=TIFFReadDirEntryCheckRangeSbyteShort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + int8* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + err=TIFFReadDirEntryCheckRangeSbyteSshort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + int8* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + err=TIFFReadDirEntryCheckRangeSbyteLong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + int8* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + err=TIFFReadDirEntryCheckRangeSbyteSlong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + int8* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeSbyteLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + int8* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeSbyteSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int8)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + uint16* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,2,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_SHORT: + *value=(uint16*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfShort(*value,count); + return(TIFFReadDirEntryErrOk); + case TIFF_SSHORT: + { + int16* m; + uint32 n; + m=(int16*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)m); + err=TIFFReadDirEntryCheckRangeShortSshort(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(uint16*)origdata; + return(TIFFReadDirEntryErrOk); + } + } + data=(uint16*)_TIFFmalloc(count*2); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + uint16* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + err=TIFFReadDirEntryCheckRangeShortLong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint16)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + uint16* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + err=TIFFReadDirEntryCheckRangeShortSlong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint16)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + uint16* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeShortLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint16)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + uint16* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeShortSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint16)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + int16* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,2,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_SHORT: + { + uint16* m; + uint32 n; + m=(uint16*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(m); + err=TIFFReadDirEntryCheckRangeSshortShort(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(int16*)origdata; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SSHORT: + *value=(int16*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfShort((uint16*)(*value),count); + return(TIFFReadDirEntryErrOk); + } + data=(int16*)_TIFFmalloc(count*2); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + int16* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + err=TIFFReadDirEntryCheckRangeSshortLong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int16)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + int16* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + err=TIFFReadDirEntryCheckRangeSshortSlong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int16)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + int16* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeSshortLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int16)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + int16* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeSshortSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int16)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + uint32* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_LONG: + *value=(uint32*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(*value,count); + return(TIFFReadDirEntryErrOk); + case TIFF_SLONG: + { + int32* m; + uint32 n; + m=(int32*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)m); + err=TIFFReadDirEntryCheckRangeLongSlong(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(uint32*)origdata; + return(TIFFReadDirEntryErrOk); + } + } + data=(uint32*)_TIFFmalloc(count*4); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + uint32* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(uint32)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + uint32* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + err=TIFFReadDirEntryCheckRangeLongSshort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint32)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + uint32* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeLongLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint32)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + uint32* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeLongSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint32)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + int32* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_LONG: + { + uint32* m; + uint32 n; + m=(uint32*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)m); + err=TIFFReadDirEntryCheckRangeSlongLong(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(int32*)origdata; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG: + *value=(int32*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong((uint32*)(*value),count); + return(TIFFReadDirEntryErrOk); + } + data=(int32*)_TIFFmalloc(count*4); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + int32* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(int32)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + int32* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + *mb++=(int32)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + int32* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); + err=TIFFReadDirEntryCheckRangeSlongLong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int32)(*ma++); + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + int32* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + err=TIFFReadDirEntryCheckRangeSlongSlong8(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(int32)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + uint64* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,8,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_LONG8: + *value=(uint64*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8(*value,count); + return(TIFFReadDirEntryErrOk); + case TIFF_SLONG8: + { + int64* m; + uint32 n; + m=(int64*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)m); + err=TIFFReadDirEntryCheckRangeLong8Slong8(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(uint64*)origdata; + return(TIFFReadDirEntryErrOk); + } + } + data=(uint64*)_TIFFmalloc(count*8); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + uint64* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(uint64)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + uint64* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + err=TIFFReadDirEntryCheckRangeLong8Sshort(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint64)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + uint64* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + *mb++=(uint64)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + uint64* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + err=TIFFReadDirEntryCheckRangeLong8Slong(*ma); + if (err!=TIFFReadDirEntryErrOk) + break; + *mb++=(uint64)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + int64* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,8,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_LONG8: + { + uint64* m; + uint32 n; + m=(uint64*)origdata; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(m); + err=TIFFReadDirEntryCheckRangeSlong8Long8(*m); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(origdata); + return(err); + } + m++; + } + *value=(int64*)origdata; + return(TIFFReadDirEntryErrOk); + } + case TIFF_SLONG8: + *value=(int64*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8((uint64*)(*value),count); + return(TIFFReadDirEntryErrOk); + } + data=(int64*)_TIFFmalloc(count*8); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + int64* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(int64)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + int64* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + *mb++=(int64)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + int64* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + *mb++=(int64)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + int64* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + *mb++=(int64)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEntry* direntry, float** value) +{ + enum TIFFReadDirEntryErr err; + uint32 count; + void* origdata; + float* data; + switch (direntry->tdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + case TIFF_DOUBLE: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_FLOAT: + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong((uint32*)origdata,count); + TIFFCvtIEEEDoubleToNative(tif,count,(float*)origdata); + *value=(float*)origdata; + return(TIFFReadDirEntryErrOk); + } + data=(float*)_TIFFmalloc(count*sizeof(float)); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + float* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(float)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + float* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + *mb++=(float)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + float* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + *mb++=(float)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + float* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + *mb++=(float)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + float* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); +#if defined(__WIN32__) && (_MSC_VER < 1500) + /* + * XXX: MSVC 6.0 does not support + * conversion of 64-bit integers into + * floating point values. + */ + *mb++ = _TIFFUInt64ToFloat(*ma++); +#else + *mb++ = (float)(*ma++); +#endif + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + float* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + *mb++=(float)(*ma++); + } + } + break; + case TIFF_RATIONAL: + { + uint32* ma; + uint32 maa; + uint32 mab; + float* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + maa=*ma++; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + mab=*ma++; + if (mab==0) + *mb++=0.0; + else + *mb++=(float)maa/(float)mab; + } + } + break; + case TIFF_SRATIONAL: + { + uint32* ma; + int32 maa; + uint32 mab; + float* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + maa=*(int32*)ma; + ma++; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + mab=*ma++; + if (mab==0) + *mb++=0.0; + else + *mb++=(float)maa/(float)mab; + } + } + break; + case TIFF_DOUBLE: + { + double* ma; + float* mb; + uint32 n; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8((uint64*)origdata,count); + TIFFCvtIEEEDoubleToNative(tif,count,(double*)origdata); + ma=(double*)origdata; + mb=data; + for (n=0; ntdir_type) + { + case TIFF_BYTE: + case TIFF_SBYTE: + case TIFF_SHORT: + case TIFF_SSHORT: + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + case TIFF_DOUBLE: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,8,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_DOUBLE: + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8((uint64*)origdata,count); + TIFFCvtIEEEDoubleToNative(tif,count,(double*)origdata); + *value=(double*)origdata; + return(TIFFReadDirEntryErrOk); + } + data=(double*)_TIFFmalloc(count*sizeof(double)); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_BYTE: + { + uint8* ma; + double* mb; + uint32 n; + ma=(uint8*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort(ma); + *mb++=(double)(*ma++); + } + } + break; + case TIFF_SSHORT: + { + int16* ma; + double* mb; + uint32 n; + ma=(int16*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + *mb++=(double)(*ma++); + } + } + break; + case TIFF_LONG: + { + uint32* ma; + double* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + *mb++=(double)(*ma++); + } + } + break; + case TIFF_SLONG: + { + int32* ma; + double* mb; + uint32 n; + ma=(int32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + *mb++=(double)(*ma++); + } + } + break; + case TIFF_LONG8: + { + uint64* ma; + double* mb; + uint32 n; + ma=(uint64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8(ma); +#if defined(__WIN32__) && (_MSC_VER < 1500) + /* + * XXX: MSVC 6.0 does not support + * conversion of 64-bit integers into + * floating point values. + */ + *mb++ = _TIFFUInt64ToDouble(*ma++); +#else + *mb++ = (double)(*ma++); +#endif + } + } + break; + case TIFF_SLONG8: + { + int64* ma; + double* mb; + uint32 n; + ma=(int64*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + *mb++=(double)(*ma++); + } + } + break; + case TIFF_RATIONAL: + { + uint32* ma; + uint32 maa; + uint32 mab; + double* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + maa=*ma++; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + mab=*ma++; + if (mab==0) + *mb++=0.0; + else + *mb++=(double)maa/(double)mab; + } + } + break; + case TIFF_SRATIONAL: + { + uint32* ma; + int32 maa; + uint32 mab; + double* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + maa=*(int32*)ma; + ma++; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + mab=*ma++; + if (mab==0) + *mb++=0.0; + else + *mb++=(double)maa/(double)mab; + } + } + break; + case TIFF_FLOAT: + { + float* ma; + double* mb; + uint32 n; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong((uint32*)origdata,count); + TIFFCvtIEEEFloatToNative(tif,count,(float*)origdata); + ma=(float*)origdata; + mb=data; + for (n=0; ntdir_type) + { + case TIFF_LONG: + case TIFF_LONG8: + case TIFF_IFD: + case TIFF_IFD8: + break; + default: + return(TIFFReadDirEntryErrType); + } + err=TIFFReadDirEntryArray(tif,direntry,&count,8,&origdata); + if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) + { + *value=0; + return(err); + } + switch (direntry->tdir_type) + { + case TIFF_LONG8: + case TIFF_IFD8: + *value=(uint64*)origdata; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8(*value,count); + return(TIFFReadDirEntryErrOk); + } + data=(uint64*)_TIFFmalloc(count*8); + if (data==0) + { + _TIFFfree(origdata); + return(TIFFReadDirEntryErrAlloc); + } + switch (direntry->tdir_type) + { + case TIFF_LONG: + case TIFF_IFD: + { + uint32* ma; + uint64* mb; + uint32 n; + ma=(uint32*)origdata; + mb=data; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabLong(ma); + *mb++=(uint64)(*ma++); + } + } + break; + } + _TIFFfree(origdata); + if (err!=TIFFReadDirEntryErrOk) + { + _TIFFfree(data); + return(err); + } + *value=data; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value) +{ + enum TIFFReadDirEntryErr err; + uint16* m; + uint16* na; + uint16 nb; + if (direntry->tdir_count<(uint64)tif->tif_dir.td_samplesperpixel) + return(TIFFReadDirEntryErrCount); + err=TIFFReadDirEntryShortArray(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + na=m; + nb=tif->tif_dir.td_samplesperpixel; + *value=*na++; + nb--; + while (nb>0) + { + if (*na++!=*value) + { + err=TIFFReadDirEntryErrPsdif; + break; + } + nb--; + } + _TIFFfree(m); + return(err); +} + +#if 0 +static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleDouble(TIFF* tif, TIFFDirEntry* direntry, double* value) +{ + enum TIFFReadDirEntryErr err; + double* m; + double* na; + uint16 nb; + if (direntry->tdir_count<(uint64)tif->tif_dir.td_samplesperpixel) + return(TIFFReadDirEntryErrCount); + err=TIFFReadDirEntryDoubleArray(tif,direntry,&m); + if (err!=TIFFReadDirEntryErrOk) + return(err); + na=m; + nb=tif->tif_dir.td_samplesperpixel; + *value=*na++; + nb--; + while (nb>0) + { + if (*na++!=*value) + { + err=TIFFReadDirEntryErrPsdif; + break; + } + nb--; + } + _TIFFfree(m); + return(err); +} +#endif + +static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value) +{ + (void) tif; + *value=*(uint8*)(&direntry->tdir_offset); +} + +static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8* value) +{ + (void) tif; + *value=*(int8*)(&direntry->tdir_offset); +} + +static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value) +{ + *value = direntry->tdir_offset.toff_short; + /* *value=*(uint16*)(&direntry->tdir_offset); */ + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort(value); +} + +static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16* value) +{ + *value=*(int16*)(&direntry->tdir_offset); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)value); +} + +static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value) +{ + *value=*(uint32*)(&direntry->tdir_offset); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(value); +} + +static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32* value) +{ + *value=*(int32*)(&direntry->tdir_offset); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)value); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value) +{ + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,value); + if (err!=TIFFReadDirEntryErrOk) + return(err); + } + else + *value = direntry->tdir_offset.toff_long8; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(value); + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64* value) +{ + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,value); + if (err!=TIFFReadDirEntryErrOk) + return(err); + } + else + *value=*(int64*)(&direntry->tdir_offset); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)value); + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFDirEntry* direntry, double* value) +{ + UInt64Aligned_t m; + + assert(sizeof(double)==8); + assert(sizeof(uint64)==8); + assert(sizeof(uint32)==4); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,m.i); + if (err!=TIFFReadDirEntryErrOk) + return(err); + } + else + m.l = direntry->tdir_offset.toff_long8; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(m.i,2); + if (m.i[0]==0) + *value=0.0; + else + *value=(double)m.i[0]/(double)m.i[1]; + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFFDirEntry* direntry, double* value) +{ + UInt64Aligned_t m; + assert(sizeof(double)==8); + assert(sizeof(uint64)==8); + assert(sizeof(int32)==4); + assert(sizeof(uint32)==4); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,m.i); + if (err!=TIFFReadDirEntryErrOk) + return(err); + } + else + m.l=direntry->tdir_offset.toff_long8; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(m.i,2); + if ((int32)m.i[0]==0) + *value=0.0; + else + *value=(double)((int32)m.i[0])/(double)m.i[1]; + return(TIFFReadDirEntryErrOk); +} + +static void TIFFReadDirEntryCheckedFloat(TIFF* tif, TIFFDirEntry* direntry, float* value) +{ + union + { + float f; + uint32 i; + } float_union; + assert(sizeof(float)==4); + assert(sizeof(uint32)==4); + assert(sizeof(float_union)==4); + float_union.i=*(uint32*)(&direntry->tdir_offset); + *value=float_union.f; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)value); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF* tif, TIFFDirEntry* direntry, double* value) +{ + assert(sizeof(double)==8); + assert(sizeof(uint64)==8); + assert(sizeof(UInt64Aligned_t)==8); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + enum TIFFReadDirEntryErr err; + uint32 offset = direntry->tdir_offset.toff_long; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,value); + if (err!=TIFFReadDirEntryErrOk) + return(err); + } + else + { + UInt64Aligned_t uint64_union; + uint64_union.l=direntry->tdir_offset.toff_long8; + *value=uint64_union.d; + } + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)value); + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16 value) +{ + if (value>0xFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16 value) +{ + if ((value<0)||(value>0xFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32 value) +{ + if (value>0xFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32 value) +{ + if ((value<0)||(value>0xFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64 value) +{ + if (value>0xFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64 value) +{ + if ((value<0)||(value>0xFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8 value) +{ + if (value>0x7F) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16 value) +{ + if (value>0x7F) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16 value) +{ + if ((value<-0x80)||(value>0x7F)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32 value) +{ + if (value>0x7F) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32 value) +{ + if ((value<-0x80)||(value>0x7F)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64 value) +{ + if (value>0x7F) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64 value) +{ + if ((value<-0x80)||(value>0x7F)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32 value) +{ + if (value>0xFFFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32 value) +{ + if ((value<0)||(value>0xFFFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64 value) +{ + if (value>0xFFFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64 value) +{ + if ((value<0)||(value>0xFFFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16 value) +{ + if (value>0x7FFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32 value) +{ + if (value>0x7FFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32 value) +{ + if ((value<-0x8000)||(value>0x7FFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64 value) +{ + if (value>0x7FFF) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64 value) +{ + if ((value<-0x8000)||(value>0x7FFF)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value) +{ + if (value<0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +/* + * Largest 32-bit unsigned integer value. + */ +#if defined(__WIN32__) && defined(_MSC_VER) +# define TIFF_UINT32_MAX 0xFFFFFFFFI64 +#else +# define TIFF_UINT32_MAX 0xFFFFFFFFLL +#endif + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLongLong8(uint64 value) +{ + if (value > TIFF_UINT32_MAX) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLongSlong8(int64 value) +{ + if ((value<0) || (value > TIFF_UINT32_MAX)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +#undef TIFF_UINT32_MAX + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeSlongLong(uint32 value) +{ + if (value > 0x7FFFFFFFUL) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeSlongLong8(uint64 value) +{ + if (value > 0x7FFFFFFFUL) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeSlongSlong8(int64 value) +{ + if ((value < 0L-0x80000000L) || (value > 0x7FFFFFFFL)) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLong8Sbyte(int8 value) +{ + if (value < 0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLong8Sshort(int16 value) +{ + if (value < 0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLong8Slong(int32 value) +{ + if (value < 0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeLong8Slong8(int64 value) +{ + if (value < 0) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +/* + * Largest 64-bit signed integer value. + */ +#if defined(__WIN32__) && defined(_MSC_VER) +# define TIFF_INT64_MAX 0x7FFFFFFFFFFFFFFFI64 +#else +# define TIFF_INT64_MAX 0x7FFFFFFFFFFFFFFFLL +#endif + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value) +{ + if (value > TIFF_INT64_MAX) + return(TIFFReadDirEntryErrRange); + else + return(TIFFReadDirEntryErrOk); +} + +#undef TIFF_INT64_MAX + +static enum TIFFReadDirEntryErr +TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest) +{ + assert(size>0); + if (!isMapped(tif)) { + if (!SeekOK(tif,offset)) + return(TIFFReadDirEntryErrIo); + if (!ReadOK(tif,dest,size)) + return(TIFFReadDirEntryErrIo); + } else { + size_t ma,mb; + ma=(size_t)offset; + mb=ma+size; + if (((uint64)ma!=offset) + || (mb < ma) + || (mb - ma != (size_t) size) + || (mb < (size_t)size) + || (mb > (size_t)tif->tif_size) + ) + return(TIFFReadDirEntryErrIo); + _TIFFmemcpy(dest,tif->tif_base+ma,size); + } + return(TIFFReadDirEntryErrOk); +} + +static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, const char* module, const char* tagname, int recover) +{ + if (!recover) { + switch (err) { + case TIFFReadDirEntryErrCount: + TIFFErrorExt(tif->tif_clientdata, module, + "Incorrect count for \"%s\"", + tagname); + break; + case TIFFReadDirEntryErrType: + TIFFErrorExt(tif->tif_clientdata, module, + "Incompatible type for \"%s\"", + tagname); + break; + case TIFFReadDirEntryErrIo: + TIFFErrorExt(tif->tif_clientdata, module, + "IO error during reading of \"%s\"", + tagname); + break; + case TIFFReadDirEntryErrRange: + TIFFErrorExt(tif->tif_clientdata, module, + "Incorrect value for \"%s\"", + tagname); + break; + case TIFFReadDirEntryErrPsdif: + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot handle different values per sample for \"%s\"", + tagname); + break; + case TIFFReadDirEntryErrSizesan: + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on size of \"%s\" value failed", + tagname); + break; + case TIFFReadDirEntryErrAlloc: + TIFFErrorExt(tif->tif_clientdata, module, + "Out of memory reading of \"%s\"", + tagname); + break; + default: + assert(0); /* we should never get here */ + break; + } + } else { + switch (err) { + case TIFFReadDirEntryErrCount: + TIFFErrorExt(tif->tif_clientdata, module, + "Incorrect count for \"%s\"; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrType: + TIFFWarningExt(tif->tif_clientdata, module, + "Incompatible type for \"%s\"; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrIo: + TIFFWarningExt(tif->tif_clientdata, module, + "IO error during reading of \"%s\"; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrRange: + TIFFWarningExt(tif->tif_clientdata, module, + "Incorrect value for \"%s\"; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrPsdif: + TIFFWarningExt(tif->tif_clientdata, module, + "Cannot handle different values per sample for \"%s\"; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrSizesan: + TIFFWarningExt(tif->tif_clientdata, module, + "Sanity check on size of \"%s\" value failed; tag ignored", + tagname); + break; + case TIFFReadDirEntryErrAlloc: + TIFFWarningExt(tif->tif_clientdata, module, + "Out of memory reading of \"%s\"; tag ignored", + tagname); + break; + default: + assert(0); /* we should never get here */ + break; + } + } +} + +/* + * Read the next TIFF directory from a file and convert it to the internal + * format. We read directories sequentially. + */ +int +TIFFReadDirectory(TIFF* tif) +{ + static const char module[] = "TIFFReadDirectory"; + TIFFDirEntry* dir; + uint16 dircount; + TIFFDirEntry* dp; + uint16 di; + const TIFFField* fip; + uint32 fii=FAILED_FII; + toff_t nextdiroff; + tif->tif_diroff=tif->tif_nextdiroff; + if (!TIFFCheckDirOffset(tif,tif->tif_nextdiroff)) + return 0; /* last offset or bad offset (IFD looping) */ + (*tif->tif_cleanup)(tif); /* cleanup any previous compression state */ + tif->tif_curdir++; + nextdiroff = tif->tif_nextdiroff; + dircount=TIFFFetchDirectory(tif,nextdiroff,&dir,&tif->tif_nextdiroff); + if (!dircount) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Failed to read directory at offset " TIFF_UINT64_FORMAT,nextdiroff); + return 0; + } + TIFFReadDirectoryCheckOrder(tif,dir,dircount); + + /* + * Mark duplicates of any tag to be ignored (bugzilla 1994) + * to avoid certain pathological problems. + */ + { + TIFFDirEntry* ma; + uint16 mb; + for (ma=dir, mb=0; mbtdir_tag==na->tdir_tag) + na->tdir_tag=IGNORE; + } + } + } + + tif->tif_flags &= ~TIFF_BEENWRITING; /* reset before new dir */ + tif->tif_flags &= ~TIFF_BUF4WRITE; /* reset before new dir */ + /* free any old stuff and reinit */ + TIFFFreeDirectory(tif); + TIFFDefaultDirectory(tif); + /* + * Electronic Arts writes gray-scale TIFF files + * without a PlanarConfiguration directory entry. + * Thus we setup a default value here, even though + * the TIFF spec says there is no default value. + */ + TIFFSetField(tif,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG); + /* + * Setup default value and then make a pass over + * the fields to check type and tag information, + * and to extract info required to size data + * structures. A second pass is made afterwards + * to read in everthing not taken in the first pass. + * But we must process the Compression tag first + * in order to merge in codec-private tag definitions (otherwise + * we may get complaints about unknown tags). However, the + * Compression tag may be dependent on the SamplesPerPixel + * tag value because older TIFF specs permited Compression + * to be written as a SamplesPerPixel-count tag entry. + * Thus if we don't first figure out the correct SamplesPerPixel + * tag value then we may end up ignoring the Compression tag + * value because it has an incorrect count value (if the + * true value of SamplesPerPixel is not 1). + */ + dp=TIFFReadDirectoryFindEntry(tif,dir,dircount,TIFFTAG_SAMPLESPERPIXEL); + if (dp) + { + if (!TIFFFetchNormalTag(tif,dp,0)) + goto bad; + dp->tdir_tag=IGNORE; + } + dp=TIFFReadDirectoryFindEntry(tif,dir,dircount,TIFFTAG_COMPRESSION); + if (dp) + { + /* + * The 5.0 spec says the Compression tag has one value, while + * earlier specs say it has one value per sample. Because of + * this, we accept the tag if one value is supplied with either + * count. + */ + uint16 value; + enum TIFFReadDirEntryErr err; + err=TIFFReadDirEntryShort(tif,dp,&value); + if (err==TIFFReadDirEntryErrCount) + err=TIFFReadDirEntryPersampleShort(tif,dp,&value); + if (err!=TIFFReadDirEntryErrOk) + { + TIFFReadDirEntryOutputErr(tif,err,module,"Compression",0); + goto bad; + } + if (!TIFFSetField(tif,TIFFTAG_COMPRESSION,value)) + goto bad; + dp->tdir_tag=IGNORE; + } + else + { + if (!TIFFSetField(tif,TIFFTAG_COMPRESSION,COMPRESSION_NONE)) + goto bad; + } + /* + * First real pass over the directory. + */ + for (di=0, dp=dir; ditdir_tag!=IGNORE) + { + TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii); + if (fii == FAILED_FII) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Unknown field with tag %d (0x%x) encountered", + dp->tdir_tag,dp->tdir_tag); + /* the following knowingly leaks the + anonymous field structure */ + if (!_TIFFMergeFields(tif, + _TIFFCreateAnonField(tif, + dp->tdir_tag, + (TIFFDataType) dp->tdir_type), + 1)) { + TIFFWarningExt(tif->tif_clientdata, + module, + "Registering anonymous field with tag %d (0x%x) failed", + dp->tdir_tag, + dp->tdir_tag); + dp->tdir_tag=IGNORE; + } else { + TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii); + assert(fii != FAILED_FII); + } + } + } + if (dp->tdir_tag!=IGNORE) + { + fip=tif->tif_fields[fii]; + if (fip->field_bit==FIELD_IGNORE) + dp->tdir_tag=IGNORE; + else + { + switch (dp->tdir_tag) + { + case TIFFTAG_STRIPOFFSETS: + case TIFFTAG_STRIPBYTECOUNTS: + case TIFFTAG_TILEOFFSETS: + case TIFFTAG_TILEBYTECOUNTS: + TIFFSetFieldBit(tif,fip->field_bit); + break; + case TIFFTAG_IMAGEWIDTH: + case TIFFTAG_IMAGELENGTH: + case TIFFTAG_IMAGEDEPTH: + case TIFFTAG_TILELENGTH: + case TIFFTAG_TILEWIDTH: + case TIFFTAG_TILEDEPTH: + case TIFFTAG_PLANARCONFIG: + case TIFFTAG_ROWSPERSTRIP: + case TIFFTAG_EXTRASAMPLES: + if (!TIFFFetchNormalTag(tif,dp,0)) + goto bad; + dp->tdir_tag=IGNORE; + break; + } + } + } + } + /* + * XXX: OJPEG hack. + * If a) compression is OJPEG, b) planarconfig tag says it's separate, + * c) strip offsets/bytecounts tag are both present and + * d) both contain exactly one value, then we consistently find + * that the buggy implementation of the buggy compression scheme + * matches contig planarconfig best. So we 'fix-up' the tag here + */ + if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG)&& + (tif->tif_dir.td_planarconfig==PLANARCONFIG_SEPARATE)) + { + if (!_TIFFFillStriles(tif)) + goto bad; + dp=TIFFReadDirectoryFindEntry(tif,dir,dircount,TIFFTAG_STRIPOFFSETS); + if ((dp!=0)&&(dp->tdir_count==1)) + { + dp=TIFFReadDirectoryFindEntry(tif,dir,dircount, + TIFFTAG_STRIPBYTECOUNTS); + if ((dp!=0)&&(dp->tdir_count==1)) + { + tif->tif_dir.td_planarconfig=PLANARCONFIG_CONTIG; + TIFFWarningExt(tif->tif_clientdata,module, + "Planarconfig tag value assumed incorrect, " + "assuming data is contig instead of chunky"); + } + } + } + /* + * Allocate directory structure and setup defaults. + */ + if (!TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) + { + MissingRequired(tif,"ImageLength"); + goto bad; + } + /* + * Setup appropriate structures (by strip or by tile) + */ + if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) { + tif->tif_dir.td_nstrips = TIFFNumberOfStrips(tif); + tif->tif_dir.td_tilewidth = tif->tif_dir.td_imagewidth; + tif->tif_dir.td_tilelength = tif->tif_dir.td_rowsperstrip; + tif->tif_dir.td_tiledepth = tif->tif_dir.td_imagedepth; + tif->tif_flags &= ~TIFF_ISTILED; + } else { + tif->tif_dir.td_nstrips = TIFFNumberOfTiles(tif); + tif->tif_flags |= TIFF_ISTILED; + } + if (!tif->tif_dir.td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot handle zero number of %s", + isTiled(tif) ? "tiles" : "strips"); + goto bad; + } + tif->tif_dir.td_stripsperimage = tif->tif_dir.td_nstrips; + if (tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE) + tif->tif_dir.td_stripsperimage /= tif->tif_dir.td_samplesperpixel; + if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) { + if ((tif->tif_dir.td_compression==COMPRESSION_OJPEG) && + (isTiled(tif)==0) && + (tif->tif_dir.td_nstrips==1)) { + /* + * XXX: OJPEG hack. + * If a) compression is OJPEG, b) it's not a tiled TIFF, + * and c) the number of strips is 1, + * then we tolerate the absence of stripoffsets tag, + * because, presumably, all required data is in the + * JpegInterchangeFormat stream. + */ + TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS); + } else { + MissingRequired(tif, + isTiled(tif) ? "TileOffsets" : "StripOffsets"); + goto bad; + } + } + /* + * Second pass: extract other information. + */ + for (di=0, dp=dir; ditdir_tag) + { + case IGNORE: + break; + case TIFFTAG_MINSAMPLEVALUE: + case TIFFTAG_MAXSAMPLEVALUE: + case TIFFTAG_BITSPERSAMPLE: + case TIFFTAG_DATATYPE: + case TIFFTAG_SAMPLEFORMAT: + /* + * The MinSampleValue, MaxSampleValue, BitsPerSample + * DataType and SampleFormat tags are supposed to be + * written as one value/sample, but some vendors + * incorrectly write one value only -- so we accept + * that as well (yech). Other vendors write correct + * value for NumberOfSamples, but incorrect one for + * BitsPerSample and friends, and we will read this + * too. + */ + { + uint16 value; + enum TIFFReadDirEntryErr err; + err=TIFFReadDirEntryShort(tif,dp,&value); + if (err==TIFFReadDirEntryErrCount) + err=TIFFReadDirEntryPersampleShort(tif,dp,&value); + if (err!=TIFFReadDirEntryErrOk) + { + fip = TIFFFieldWithTag(tif,dp->tdir_tag); + TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0); + goto bad; + } + if (!TIFFSetField(tif,dp->tdir_tag,value)) + goto bad; + } + break; + case TIFFTAG_SMINSAMPLEVALUE: + case TIFFTAG_SMAXSAMPLEVALUE: + { + + double *data; + enum TIFFReadDirEntryErr err; + uint32 saved_flags; + int m; + if (dp->tdir_count != (uint64)tif->tif_dir.td_samplesperpixel) + err = TIFFReadDirEntryErrCount; + else + err = TIFFReadDirEntryDoubleArray(tif, dp, &data); + if (err!=TIFFReadDirEntryErrOk) + { + fip = TIFFFieldWithTag(tif,dp->tdir_tag); + TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0); + goto bad; + } + saved_flags = tif->tif_flags; + tif->tif_flags |= TIFF_PERSAMPLE; + m = TIFFSetField(tif,dp->tdir_tag,data); + tif->tif_flags = saved_flags; + _TIFFfree(data); + if (!m) + goto bad; + } + break; + case TIFFTAG_STRIPOFFSETS: + case TIFFTAG_TILEOFFSETS: +#if defined(DEFER_STRILE_LOAD) + _TIFFmemcpy( &(tif->tif_dir.td_stripoffset_entry), + dp, sizeof(TIFFDirEntry) ); +#else + if (!TIFFFetchStripThing(tif,dp,tif->tif_dir.td_nstrips,&tif->tif_dir.td_stripoffset)) + goto bad; +#endif + break; + case TIFFTAG_STRIPBYTECOUNTS: + case TIFFTAG_TILEBYTECOUNTS: +#if defined(DEFER_STRILE_LOAD) + _TIFFmemcpy( &(tif->tif_dir.td_stripbytecount_entry), + dp, sizeof(TIFFDirEntry) ); +#else + if (!TIFFFetchStripThing(tif,dp,tif->tif_dir.td_nstrips,&tif->tif_dir.td_stripbytecount)) + goto bad; +#endif + break; + case TIFFTAG_COLORMAP: + case TIFFTAG_TRANSFERFUNCTION: + { + enum TIFFReadDirEntryErr err; + uint32 countpersample; + uint32 countrequired; + uint32 incrementpersample; + uint16* value=NULL; + countpersample=(1L<tif_dir.td_bitspersample); + if ((dp->tdir_tag==TIFFTAG_TRANSFERFUNCTION)&&(dp->tdir_count==(uint64)countpersample)) + { + countrequired=countpersample; + incrementpersample=0; + } + else + { + countrequired=3*countpersample; + incrementpersample=countpersample; + } + if (dp->tdir_count!=(uint64)countrequired) + err=TIFFReadDirEntryErrCount; + else + err=TIFFReadDirEntryShortArray(tif,dp,&value); + if (err!=TIFFReadDirEntryErrOk) + { + fip = TIFFFieldWithTag(tif,dp->tdir_tag); + TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",1); + } + else + { + TIFFSetField(tif,dp->tdir_tag,value,value+incrementpersample,value+2*incrementpersample); + _TIFFfree(value); + } + } + break; +/* BEGIN REV 4.0 COMPATIBILITY */ + case TIFFTAG_OSUBFILETYPE: + { + uint16 valueo; + uint32 value; + if (TIFFReadDirEntryShort(tif,dp,&valueo)==TIFFReadDirEntryErrOk) + { + switch (valueo) + { + case OFILETYPE_REDUCEDIMAGE: value=FILETYPE_REDUCEDIMAGE; break; + case OFILETYPE_PAGE: value=FILETYPE_PAGE; break; + default: value=0; break; + } + if (value!=0) + TIFFSetField(tif,TIFFTAG_SUBFILETYPE,value); + } + } + break; +/* END REV 4.0 COMPATIBILITY */ + default: + (void) TIFFFetchNormalTag(tif, dp, TRUE); + break; + } + } + /* + * OJPEG hack: + * - If a) compression is OJPEG, and b) photometric tag is missing, + * then we consistently find that photometric should be YCbCr + * - If a) compression is OJPEG, and b) photometric tag says it's RGB, + * then we consistently find that the buggy implementation of the + * buggy compression scheme matches photometric YCbCr instead. + * - If a) compression is OJPEG, and b) bitspersample tag is missing, + * then we consistently find bitspersample should be 8. + * - If a) compression is OJPEG, b) samplesperpixel tag is missing, + * and c) photometric is RGB or YCbCr, then we consistently find + * samplesperpixel should be 3 + * - If a) compression is OJPEG, b) samplesperpixel tag is missing, + * and c) photometric is MINISWHITE or MINISBLACK, then we consistently + * find samplesperpixel should be 3 + */ + if (tif->tif_dir.td_compression==COMPRESSION_OJPEG) + { + if (!TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Photometric tag is missing, assuming data is YCbCr"); + if (!TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,PHOTOMETRIC_YCBCR)) + goto bad; + } + else if (tif->tif_dir.td_photometric==PHOTOMETRIC_RGB) + { + tif->tif_dir.td_photometric=PHOTOMETRIC_YCBCR; + TIFFWarningExt(tif->tif_clientdata, module, + "Photometric tag value assumed incorrect, " + "assuming data is YCbCr instead of RGB"); + } + if (!TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) + { + TIFFWarningExt(tif->tif_clientdata,module, + "BitsPerSample tag is missing, assuming 8 bits per sample"); + if (!TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,8)) + goto bad; + } + if (!TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) + { + if (tif->tif_dir.td_photometric==PHOTOMETRIC_RGB) + { + TIFFWarningExt(tif->tif_clientdata,module, + "SamplesPerPixel tag is missing, " + "assuming correct SamplesPerPixel value is 3"); + if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3)) + goto bad; + } + if (tif->tif_dir.td_photometric==PHOTOMETRIC_YCBCR) + { + TIFFWarningExt(tif->tif_clientdata,module, + "SamplesPerPixel tag is missing, " + "applying correct SamplesPerPixel value of 3"); + if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,3)) + goto bad; + } + else if ((tif->tif_dir.td_photometric==PHOTOMETRIC_MINISWHITE) + || (tif->tif_dir.td_photometric==PHOTOMETRIC_MINISBLACK)) + { + /* + * SamplesPerPixel tag is missing, but is not required + * by spec. Assume correct SamplesPerPixel value of 1. + */ + if (!TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,1)) + goto bad; + } + } + } + /* + * Verify Palette image has a Colormap. + */ + if (tif->tif_dir.td_photometric == PHOTOMETRIC_PALETTE && + !TIFFFieldSet(tif, FIELD_COLORMAP)) { + if ( tif->tif_dir.td_bitspersample>=8 && tif->tif_dir.td_samplesperpixel==3) + tif->tif_dir.td_photometric = PHOTOMETRIC_RGB; + else if (tif->tif_dir.td_bitspersample>=8) + tif->tif_dir.td_photometric = PHOTOMETRIC_MINISBLACK; + else { + MissingRequired(tif, "Colormap"); + goto bad; + } + } + /* + * OJPEG hack: + * We do no further messing with strip/tile offsets/bytecounts in OJPEG + * TIFFs + */ + if (tif->tif_dir.td_compression!=COMPRESSION_OJPEG) + { + /* + * Attempt to deal with a missing StripByteCounts tag. + */ + if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) { + /* + * Some manufacturers violate the spec by not giving + * the size of the strips. In this case, assume there + * is one uncompressed strip of data. + */ + if ((tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG && + tif->tif_dir.td_nstrips > 1) || + (tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE && + tif->tif_dir.td_nstrips != (uint32)tif->tif_dir.td_samplesperpixel)) { + MissingRequired(tif, "StripByteCounts"); + goto bad; + } + TIFFWarningExt(tif->tif_clientdata, module, + "TIFF directory is missing required " + "\"StripByteCounts\" field, calculating from imagelength"); + if (EstimateStripByteCounts(tif, dir, dircount) < 0) + goto bad; + /* + * Assume we have wrong StripByteCount value (in case + * of single strip) in following cases: + * - it is equal to zero along with StripOffset; + * - it is larger than file itself (in case of uncompressed + * image); + * - it is smaller than the size of the bytes per row + * multiplied on the number of rows. The last case should + * not be checked in the case of writing new image, + * because we may do not know the exact strip size + * until the whole image will be written and directory + * dumped out. + */ + #define BYTECOUNTLOOKSBAD \ + ( (tif->tif_dir.td_stripbytecount[0] == 0 && tif->tif_dir.td_stripoffset[0] != 0) || \ + (tif->tif_dir.td_compression == COMPRESSION_NONE && \ + tif->tif_dir.td_stripbytecount[0] > TIFFGetFileSize(tif) - tif->tif_dir.td_stripoffset[0]) || \ + (tif->tif_mode == O_RDONLY && \ + tif->tif_dir.td_compression == COMPRESSION_NONE && \ + tif->tif_dir.td_stripbytecount[0] < TIFFScanlineSize64(tif) * tif->tif_dir.td_imagelength) ) + + } else if (tif->tif_dir.td_nstrips == 1 + && _TIFFFillStriles(tif) + && tif->tif_dir.td_stripoffset[0] != 0 + && BYTECOUNTLOOKSBAD) { + /* + * XXX: Plexus (and others) sometimes give a value of + * zero for a tag when they don't know what the + * correct value is! Try and handle the simple case + * of estimating the size of a one strip image. + */ + TIFFWarningExt(tif->tif_clientdata, module, + "Bogus \"StripByteCounts\" field, ignoring and calculating from imagelength"); + if(EstimateStripByteCounts(tif, dir, dircount) < 0) + goto bad; + +#if !defined(DEFER_STRILE_LOAD) + } else if (tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG + && tif->tif_dir.td_nstrips > 2 + && tif->tif_dir.td_compression == COMPRESSION_NONE + && tif->tif_dir.td_stripbytecount[0] != tif->tif_dir.td_stripbytecount[1] + && tif->tif_dir.td_stripbytecount[0] != 0 + && tif->tif_dir.td_stripbytecount[1] != 0 ) { + /* + * XXX: Some vendors fill StripByteCount array with + * absolutely wrong values (it can be equal to + * StripOffset array, for example). Catch this case + * here. + * + * We avoid this check if deferring strile loading + * as it would always force us to load the strip/tile + * information. + */ + TIFFWarningExt(tif->tif_clientdata, module, + "Wrong \"StripByteCounts\" field, ignoring and calculating from imagelength"); + if (EstimateStripByteCounts(tif, dir, dircount) < 0) + goto bad; +#endif /* !defined(DEFER_STRILE_LOAD) */ + } + } + if (dir) + { + _TIFFfree(dir); + dir=NULL; + } + if (!TIFFFieldSet(tif, FIELD_MAXSAMPLEVALUE)) + { + if (tif->tif_dir.td_bitspersample>=16) + tif->tif_dir.td_maxsamplevalue=0xFFFF; + else + tif->tif_dir.td_maxsamplevalue = (uint16)((1L<tif_dir.td_bitspersample)-1); + } + /* + * XXX: We can optimize checking for the strip bounds using the sorted + * bytecounts array. See also comments for TIFFAppendToStrip() + * function in tif_write.c. + */ +#if !defined(DEFER_STRILE_LOAD) + if (tif->tif_dir.td_nstrips > 1) { + uint32 strip; + + tif->tif_dir.td_stripbytecountsorted = 1; + for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) { + if (tif->tif_dir.td_stripoffset[strip - 1] > + tif->tif_dir.td_stripoffset[strip]) { + tif->tif_dir.td_stripbytecountsorted = 0; + break; + } + } + } +#endif /* !defined(DEFER_STRILE_LOAD) */ + + /* + * An opportunity for compression mode dependent tag fixup + */ + (*tif->tif_fixuptags)(tif); + + /* + * Some manufacturers make life difficult by writing + * large amounts of uncompressed data as a single strip. + * This is contrary to the recommendations of the spec. + * The following makes an attempt at breaking such images + * into strips closer to the recommended 8k bytes. A + * side effect, however, is that the RowsPerStrip tag + * value may be changed. + */ + if ((tif->tif_dir.td_planarconfig==PLANARCONFIG_CONTIG)&& + (tif->tif_dir.td_nstrips==1)&& + (tif->tif_dir.td_compression==COMPRESSION_NONE)&& + ((tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED))==TIFF_STRIPCHOP)) + { + if ( !_TIFFFillStriles(tif) || !tif->tif_dir.td_stripbytecount ) + return 0; + ChopUpSingleUncompressedStrip(tif); + } + + /* + * Clear the dirty directory flag. + */ + tif->tif_flags &= ~TIFF_DIRTYDIRECT; + tif->tif_flags &= ~TIFF_DIRTYSTRIP; + + /* + * Reinitialize i/o since we are starting on a new directory. + */ + tif->tif_row = (uint32) -1; + tif->tif_curstrip = (uint32) -1; + tif->tif_col = (uint32) -1; + tif->tif_curtile = (uint32) -1; + tif->tif_tilesize = (tmsize_t) -1; + + tif->tif_scanlinesize = TIFFScanlineSize(tif); + if (!tif->tif_scanlinesize) { + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot handle zero scanline size"); + return (0); + } + + if (isTiled(tif)) { + tif->tif_tilesize = TIFFTileSize(tif); + if (!tif->tif_tilesize) { + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot handle zero tile size"); + return (0); + } + } else { + if (!TIFFStripSize(tif)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot handle zero strip size"); + return (0); + } + } + return (1); +bad: + if (dir) + _TIFFfree(dir); + return (0); +} + +static void +TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) +{ + static const char module[] = "TIFFReadDirectoryCheckOrder"; + uint16 m; + uint16 n; + TIFFDirEntry* o; + m=0; + for (n=0, o=dir; ntdir_tagtif_clientdata,module, + "Invalid TIFF directory; tags are not sorted in ascending order"); + break; + } + m=o->tdir_tag+1; + } +} + +static TIFFDirEntry* +TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16 dircount, uint16 tagid) +{ + TIFFDirEntry* m; + uint16 n; + (void) tif; + for (m=dir, n=0; ntdir_tag==tagid) + return(m); + } + return(0); +} + +static void +TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii) +{ + int32 ma,mb,mc; + ma=-1; + mc=(int32)tif->tif_nfields; + while (1) + { + if (ma+1==mc) + { + *fii = FAILED_FII; + return; + } + mb=(ma+mc)/2; + if (tif->tif_fields[mb]->field_tag==(uint32)tagid) + break; + if (tif->tif_fields[mb]->field_tag<(uint32)tagid) + ma=mb; + else + mc=mb; + } + while (1) + { + if (mb==0) + break; + if (tif->tif_fields[mb-1]->field_tag!=(uint32)tagid) + break; + mb--; + } + *fii=mb; +} + +/* + * Read custom directory from the arbitarry offset. + * The code is very similar to TIFFReadDirectory(). + */ +int +TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, + const TIFFFieldArray* infoarray) +{ + static const char module[] = "TIFFReadCustomDirectory"; + TIFFDirEntry* dir; + uint16 dircount; + TIFFDirEntry* dp; + uint16 di; + const TIFFField* fip; + uint32 fii; + _TIFFSetupFields(tif, infoarray); + dircount=TIFFFetchDirectory(tif,diroff,&dir,NULL); + if (!dircount) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Failed to read custom directory at offset " TIFF_UINT64_FORMAT,diroff); + return 0; + } + TIFFFreeDirectory(tif); + _TIFFmemset(&tif->tif_dir, 0, sizeof(TIFFDirectory)); + TIFFReadDirectoryCheckOrder(tif,dir,dircount); + for (di=0, dp=dir; ditdir_tag,&fii); + if (fii == FAILED_FII) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Unknown field with tag %d (0x%x) encountered", + dp->tdir_tag, dp->tdir_tag); + if (!_TIFFMergeFields(tif, _TIFFCreateAnonField(tif, + dp->tdir_tag, + (TIFFDataType) dp->tdir_type), + 1)) { + TIFFWarningExt(tif->tif_clientdata, module, + "Registering anonymous field with tag %d (0x%x) failed", + dp->tdir_tag, dp->tdir_tag); + dp->tdir_tag=IGNORE; + } else { + TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii); + assert( fii != FAILED_FII ); + } + } + if (dp->tdir_tag!=IGNORE) + { + fip=tif->tif_fields[fii]; + if (fip->field_bit==FIELD_IGNORE) + dp->tdir_tag=IGNORE; + else + { + /* check data type */ + while ((fip->field_type!=TIFF_ANY)&&(fip->field_type!=dp->tdir_type)) + { + fii++; + if ((fii==tif->tif_nfields)|| + (tif->tif_fields[fii]->field_tag!=(uint32)dp->tdir_tag)) + { + fii=0xFFFF; + break; + } + fip=tif->tif_fields[fii]; + } + if (fii==0xFFFF) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Wrong data type %d for \"%s\"; tag ignored", + dp->tdir_type,fip->field_name); + dp->tdir_tag=IGNORE; + } + else + { + /* check count if known in advance */ + if ((fip->field_readcount!=TIFF_VARIABLE)&& + (fip->field_readcount!=TIFF_VARIABLE2)) + { + uint32 expected; + if (fip->field_readcount==TIFF_SPP) + expected=(uint32)tif->tif_dir.td_samplesperpixel; + else + expected=(uint32)fip->field_readcount; + if (!CheckDirCount(tif,dp,expected)) + dp->tdir_tag=IGNORE; + } + } + } + switch (dp->tdir_tag) + { + case IGNORE: + break; + case EXIFTAG_SUBJECTDISTANCE: + (void) TIFFFetchSubjectDistance(tif,dp); + break; + default: + (void) TIFFFetchNormalTag(tif, dp, TRUE); + break; + } + } + } + if (dir) + _TIFFfree(dir); + return 1; +} + +/* + * EXIF is important special case of custom IFD, so we have a special + * function to read it. + */ +int +TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff) +{ + const TIFFFieldArray* exifFieldArray; + exifFieldArray = _TIFFGetExifFields(); + return TIFFReadCustomDirectory(tif, diroff, exifFieldArray); +} + +static int +EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) +{ + static const char module[] = "EstimateStripByteCounts"; + + TIFFDirEntry *dp; + TIFFDirectory *td = &tif->tif_dir; + uint32 strip; + + _TIFFFillStriles( tif ); + + if (td->td_stripbytecount) + _TIFFfree(td->td_stripbytecount); + td->td_stripbytecount = (uint64*) + _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64), + "for \"StripByteCounts\" array"); + if( td->td_stripbytecount == NULL ) + return -1; + + if (td->td_compression != COMPRESSION_NONE) { + uint64 space; + uint64 filesize; + uint16 n; + filesize = TIFFGetFileSize(tif); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + space=sizeof(TIFFHeaderClassic)+2+dircount*12+4; + else + space=sizeof(TIFFHeaderBig)+8+dircount*20+8; + /* calculate amount of space used by indirect values */ + for (dp = dir, n = dircount; n > 0; n--, dp++) + { + uint32 typewidth = TIFFDataWidth((TIFFDataType) dp->tdir_type); + uint64 datasize; + typewidth = TIFFDataWidth((TIFFDataType) dp->tdir_type); + if (typewidth == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Cannot determine size of unknown tag type %d", + dp->tdir_type); + return -1; + } + datasize=(uint64)typewidth*dp->tdir_count; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (datasize<=4) + datasize=0; + } + else + { + if (datasize<=8) + datasize=0; + } + space+=datasize; + } + space = filesize - space; + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + space /= td->td_samplesperpixel; + for (strip = 0; strip < td->td_nstrips; strip++) + td->td_stripbytecount[strip] = space; + /* + * This gross hack handles the case were the offset to + * the last strip is past the place where we think the strip + * should begin. Since a strip of data must be contiguous, + * it's safe to assume that we've overestimated the amount + * of data in the strip and trim this number back accordingly. + */ + strip--; + if (td->td_stripoffset[strip]+td->td_stripbytecount[strip] > filesize) + td->td_stripbytecount[strip] = filesize - td->td_stripoffset[strip]; + } else if (isTiled(tif)) { + uint64 bytespertile = TIFFTileSize64(tif); + + for (strip = 0; strip < td->td_nstrips; strip++) + td->td_stripbytecount[strip] = bytespertile; + } else { + uint64 rowbytes = TIFFScanlineSize64(tif); + uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage; + for (strip = 0; strip < td->td_nstrips; strip++) + td->td_stripbytecount[strip] = rowbytes * rowsperstrip; + } + TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS); + if (!TIFFFieldSet(tif, FIELD_ROWSPERSTRIP)) + td->td_rowsperstrip = td->td_imagelength; + return 1; +} + +static void +MissingRequired(TIFF* tif, const char* tagname) +{ + static const char module[] = "MissingRequired"; + + TIFFErrorExt(tif->tif_clientdata, module, + "TIFF directory is missing required \"%s\" field", + tagname); +} + +/* + * Check the directory offset against the list of already seen directory + * offsets. This is a trick to prevent IFD looping. The one can create TIFF + * file with looped directory pointers. We will maintain a list of already + * seen directories and check every IFD offset against that list. + */ +static int +TIFFCheckDirOffset(TIFF* tif, uint64 diroff) +{ + uint16 n; + + if (diroff == 0) /* no more directories */ + return 0; + + for (n = 0; n < tif->tif_dirnumber && tif->tif_dirlist; n++) { + if (tif->tif_dirlist[n] == diroff) + return 0; + } + + tif->tif_dirnumber++; + + if (tif->tif_dirnumber > tif->tif_dirlistsize) { + uint64* new_dirlist; + + /* + * XXX: Reduce memory allocation granularity of the dirlist + * array. + */ + new_dirlist = (uint64*)_TIFFCheckRealloc(tif, tif->tif_dirlist, + tif->tif_dirnumber, 2 * sizeof(uint64), "for IFD list"); + if (!new_dirlist) + return 0; + tif->tif_dirlistsize = 2 * tif->tif_dirnumber; + tif->tif_dirlist = new_dirlist; + } + + tif->tif_dirlist[tif->tif_dirnumber - 1] = diroff; + + return 1; +} + +/* + * Check the count field of a directory entry against a known value. The + * caller is expected to skip/ignore the tag if there is a mismatch. + */ +static int +CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count) +{ + if ((uint64)count > dir->tdir_count) { + const TIFFField* fip = TIFFFieldWithTag(tif, dir->tdir_tag); + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, + "incorrect count for field \"%s\" (" TIFF_UINT64_FORMAT ", expecting %u); tag ignored", + fip ? fip->field_name : "unknown tagname", + dir->tdir_count, count); + return (0); + } else if ((uint64)count < dir->tdir_count) { + const TIFFField* fip = TIFFFieldWithTag(tif, dir->tdir_tag); + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, + "incorrect count for field \"%s\" (" TIFF_UINT64_FORMAT ", expecting %u); tag trimmed", + fip ? fip->field_name : "unknown tagname", + dir->tdir_count, count); + dir->tdir_count = count; + return (1); + } + return (1); +} + +/* + * Read IFD structure from the specified offset. If the pointer to + * nextdiroff variable has been specified, read it too. Function returns a + * number of fields in the directory or 0 if failed. + */ +static uint16 +TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir, + uint64 *nextdiroff) +{ + static const char module[] = "TIFFFetchDirectory"; + + void* origdir; + uint16 dircount16; + uint32 dirsize; + TIFFDirEntry* dir; + uint8* ma; + TIFFDirEntry* mb; + uint16 n; + + assert(pdir); + + tif->tif_diroff = diroff; + if (nextdiroff) + *nextdiroff = 0; + if (!isMapped(tif)) { + if (!SeekOK(tif, tif->tif_diroff)) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Seek error accessing TIFF directory", + tif->tif_name); + return 0; + } + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (!ReadOK(tif, &dircount16, sizeof (uint16))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not read TIFF directory count", + tif->tif_name); + return 0; + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount16); + if (dircount16>4096) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on directory count failed, this is probably not a valid IFD offset"); + return 0; + } + dirsize = 12; + } else { + uint64 dircount64; + if (!ReadOK(tif, &dircount64, sizeof (uint64))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not read TIFF directory count", + tif->tif_name); + return 0; + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>4096) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on directory count failed, this is probably not a valid IFD offset"); + return 0; + } + dircount16 = (uint16)dircount64; + dirsize = 20; + } + origdir = _TIFFCheckMalloc(tif, dircount16, + dirsize, "to read TIFF directory"); + if (origdir == NULL) + return 0; + if (!ReadOK(tif, origdir, (tmsize_t)(dircount16*dirsize))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%.100s: Can not read TIFF directory", + tif->tif_name); + _TIFFfree(origdir); + return 0; + } + /* + * Read offset to next directory for sequential scans if + * needed. + */ + if (nextdiroff) + { + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 nextdiroff32; + if (!ReadOK(tif, &nextdiroff32, sizeof(uint32))) + nextdiroff32 = 0; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&nextdiroff32); + *nextdiroff=nextdiroff32; + } else { + if (!ReadOK(tif, nextdiroff, sizeof(uint64))) + *nextdiroff = 0; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(nextdiroff); + } + } + } else { + tmsize_t m; + tmsize_t off = (tmsize_t) tif->tif_diroff; + if ((uint64)off!=tif->tif_diroff) + { + TIFFErrorExt(tif->tif_clientdata,module,"Can not read TIFF directory count"); + return(0); + } + + /* + * Check for integer overflow when validating the dir_off, + * otherwise a very high offset may cause an OOB read and + * crash the client. Make two comparisons instead of + * + * off + sizeof(uint16) > tif->tif_size + * + * to avoid overflow. + */ + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + m=off+sizeof(uint16); + if ((mtif->tif_size)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not read TIFF directory count"); + return 0; + } else { + _TIFFmemcpy(&dircount16, tif->tif_base + off, + sizeof(uint16)); + } + off += sizeof (uint16); + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount16); + if (dircount16>4096) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on directory count failed, this is probably not a valid IFD offset"); + return 0; + } + dirsize = 12; + } + else + { + tmsize_t m; + uint64 dircount64; + m=off+sizeof(uint64); + if ((mtif->tif_size)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not read TIFF directory count"); + return 0; + } else { + _TIFFmemcpy(&dircount64, tif->tif_base + off, + sizeof(uint64)); + } + off += sizeof (uint64); + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>4096) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on directory count failed, this is probably not a valid IFD offset"); + return 0; + } + dircount16 = (uint16)dircount64; + dirsize = 20; + } + if (dircount16 == 0 ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on directory count failed, zero tag directories not supported"); + return 0; + } + origdir = _TIFFCheckMalloc(tif, dircount16, + dirsize, + "to read TIFF directory"); + if (origdir == NULL) + return 0; + m=off+dircount16*dirsize; + if ((mtif->tif_size)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not read TIFF directory"); + _TIFFfree(origdir); + return 0; + } else { + _TIFFmemcpy(origdir, tif->tif_base + off, + dircount16 * dirsize); + } + if (nextdiroff) { + off += dircount16 * dirsize; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 nextdiroff32; + m=off+sizeof(uint32); + if ((mtif->tif_size)) + nextdiroff32 = 0; + else + _TIFFmemcpy(&nextdiroff32, tif->tif_base + off, + sizeof (uint32)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&nextdiroff32); + *nextdiroff = nextdiroff32; + } + else + { + m=off+sizeof(uint64); + if ((mtif->tif_size)) + *nextdiroff = 0; + else + _TIFFmemcpy(nextdiroff, tif->tif_base + off, + sizeof (uint64)); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(nextdiroff); + } + } + } + dir = (TIFFDirEntry*)_TIFFCheckMalloc(tif, dircount16, + sizeof(TIFFDirEntry), + "to read TIFF directory"); + if (dir==0) + { + _TIFFfree(origdir); + return 0; + } + ma=(uint8*)origdir; + mb=dir; + for (n=0; ntif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + mb->tdir_tag=*(uint16*)ma; + ma+=sizeof(uint16); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)ma); + mb->tdir_type=*(uint16*)ma; + ma+=sizeof(uint16); + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)ma); + mb->tdir_count=(uint64)(*(uint32*)ma); + ma+=sizeof(uint32); + *(uint32*)(&mb->tdir_offset)=*(uint32*)ma; + ma+=sizeof(uint32); + } + else + { + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)ma); + mb->tdir_count=TIFFReadUInt64(ma); + ma+=sizeof(uint64); + mb->tdir_offset.toff_long8=TIFFReadUInt64(ma); + ma+=sizeof(uint64); + } + mb++; + } + _TIFFfree(origdir); + *pdir = dir; + return dircount16; +} + +/* + * Fetch a tag that is not handled by special case code. + */ +static int +TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover) +{ + static const char module[] = "TIFFFetchNormalTag"; + enum TIFFReadDirEntryErr err; + uint32 fii; + const TIFFField* fip = NULL; + TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii); + if( fii == FAILED_FII ) + { + TIFFErrorExt(tif->tif_clientdata, "TIFFFetchNormalTag", + "No definition found for tag %d", + dp->tdir_tag); + return 0; + } + fip=tif->tif_fields[fii]; + assert(fip->set_field_type!=TIFF_SETGET_OTHER); /* if so, we shouldn't arrive here but deal with this in specialized code */ + assert(fip->set_field_type!=TIFF_SETGET_INT); /* if so, we shouldn't arrive here as this is only the case for pseudo-tags */ + err=TIFFReadDirEntryErrOk; + switch (fip->set_field_type) + { + case TIFF_SETGET_UNDEFINED: + break; + case TIFF_SETGET_ASCII: + { + uint8* data; + assert(fip->field_passcount==0); + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + uint8* ma; + uint32 mb; + int n; + ma=data; + mb=0; + while (mb<(uint32)dp->tdir_count) + { + if (*ma==0) + break; + ma++; + mb++; + } + if (mb+1<(uint32)dp->tdir_count) + TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name); + else if (mb+1>(uint32)dp->tdir_count) + { + uint8* o; + TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte",fip->field_name); + if ((uint32)dp->tdir_count+1!=dp->tdir_count+1) + o=NULL; + else + o=_TIFFmalloc((uint32)dp->tdir_count+1); + if (o==NULL) + { + if (data!=NULL) + _TIFFfree(data); + return(0); + } + _TIFFmemcpy(o,data,(uint32)dp->tdir_count); + o[(uint32)dp->tdir_count]=0; + if (data!=0) + _TIFFfree(data); + data=o; + } + n=TIFFSetField(tif,dp->tdir_tag,data); + if (data!=0) + _TIFFfree(data); + if (!n) + return(0); + } + } + break; + case TIFF_SETGET_UINT8: + { + uint8 data=0; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryByte(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_UINT16: + { + uint16 data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryShort(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_UINT32: + { + uint32 data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryLong(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_UINT64: + { + uint64 data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryLong8(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_FLOAT: + { + float data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryFloat(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_DOUBLE: + { + double data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryDouble(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_IFD8: + { + uint64 data; + assert(fip->field_readcount==1); + assert(fip->field_passcount==0); + err=TIFFReadDirEntryIfd8(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + if (!TIFFSetField(tif,dp->tdir_tag,data)) + return(0); + } + } + break; + case TIFF_SETGET_UINT16_PAIR: + { + uint16* data; + assert(fip->field_readcount==2); + assert(fip->field_passcount==0); + if (dp->tdir_count!=2) { + TIFFWarningExt(tif->tif_clientdata,module, + "incorrect count for field \"%s\", expected 2, got %d", + fip->field_name,(int)dp->tdir_count); + return(0); + } + err=TIFFReadDirEntryShortArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,data[0],data[1]); + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C0_UINT8: + { + uint8* data; + assert(fip->field_readcount>=1); + assert(fip->field_passcount==0); + if (dp->tdir_count!=(uint64)fip->field_readcount) { + TIFFWarningExt(tif->tif_clientdata,module, + "incorrect count for field \"%s\", expected %d, got %d", + fip->field_name,(int) fip->field_readcount, (int)dp->tdir_count); + return 0; + } + else + { + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C0_UINT16: + { + uint16* data; + assert(fip->field_readcount>=1); + assert(fip->field_passcount==0); + if (dp->tdir_count!=(uint64)fip->field_readcount) + /* corrupt file */; + else + { + err=TIFFReadDirEntryShortArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C0_UINT32: + { + uint32* data; + assert(fip->field_readcount>=1); + assert(fip->field_passcount==0); + if (dp->tdir_count!=(uint64)fip->field_readcount) + /* corrupt file */; + else + { + err=TIFFReadDirEntryLongArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C0_FLOAT: + { + float* data; + assert(fip->field_readcount>=1); + assert(fip->field_passcount==0); + if (dp->tdir_count!=(uint64)fip->field_readcount) + /* corrupt file */; + else + { + err=TIFFReadDirEntryFloatArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_ASCII: + { + uint8* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_UINT8: + { + uint8* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_UINT16: + { + uint16* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryShortArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_UINT32: + { + uint32* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryLongArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_UINT64: + { + uint64* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryLong8Array(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_FLOAT: + { + float* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryFloatArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_DOUBLE: + { + double* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryDoubleArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C16_IFD8: + { + uint64* data; + assert(fip->field_readcount==TIFF_VARIABLE); + assert(fip->field_passcount==1); + if (dp->tdir_count>0xFFFF) + err=TIFFReadDirEntryErrCount; + else + { + err=TIFFReadDirEntryIfd8Array(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + } + break; + case TIFF_SETGET_C32_ASCII: + { + uint8* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_UINT8: + { + uint8* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryByteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_SINT8: + { + int8* data = NULL; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntrySbyteArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_UINT16: + { + uint16* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryShortArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_SINT16: + { + int16* data = NULL; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntrySshortArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_UINT32: + { + uint32* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryLongArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_SINT32: + { + int32* data = NULL; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntrySlongArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_UINT64: + { + uint64* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryLong8Array(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_SINT64: + { + int64* data = NULL; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntrySlong8Array(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_FLOAT: + { + float* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryFloatArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_DOUBLE: + { + double* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryDoubleArray(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + case TIFF_SETGET_C32_IFD8: + { + uint64* data; + assert(fip->field_readcount==TIFF_VARIABLE2); + assert(fip->field_passcount==1); + err=TIFFReadDirEntryIfd8Array(tif,dp,&data); + if (err==TIFFReadDirEntryErrOk) + { + int m; + m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data); + if (data!=0) + _TIFFfree(data); + if (!m) + return(0); + } + } + break; + default: + assert(0); /* we should never get here */ + break; + } + if (err!=TIFFReadDirEntryErrOk) + { + TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",recover); + return(0); + } + return(1); +} + +/* + * Fetch a set of offsets or lengths. + * While this routine says "strips", in fact it's also used for tiles. + */ +static int +TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp) +{ + static const char module[] = "TIFFFetchStripThing"; + enum TIFFReadDirEntryErr err; + uint64* data; + err=TIFFReadDirEntryLong8Array(tif,dir,&data); + if (err!=TIFFReadDirEntryErrOk) + { + const TIFFField* fip = TIFFFieldWithTag(tif,dir->tdir_tag); + TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0); + return(0); + } + if (dir->tdir_count!=(uint64)nstrips) + { + uint64* resizeddata; + resizeddata=(uint64*)_TIFFCheckMalloc(tif,nstrips,sizeof(uint64),"for strip array"); + if (resizeddata==0) { + _TIFFfree(data); + return(0); + } + if (dir->tdir_count<(uint64)nstrips) + { + _TIFFmemcpy(resizeddata,data,(uint32)dir->tdir_count*sizeof(uint64)); + _TIFFmemset(resizeddata+(uint32)dir->tdir_count,0,(nstrips-(uint32)dir->tdir_count)*sizeof(uint64)); + } + else + _TIFFmemcpy(resizeddata,data,nstrips*sizeof(uint64)); + _TIFFfree(data); + data=resizeddata; + } + *lpp=data; + return(1); +} + +/* + * Fetch and set the SubjectDistance EXIF tag. + */ +static int +TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir) +{ + static const char module[] = "TIFFFetchSubjectDistance"; + enum TIFFReadDirEntryErr err; + UInt64Aligned_t m; + m.l=0; + assert(sizeof(double)==8); + assert(sizeof(uint64)==8); + assert(sizeof(uint32)==4); + if (dir->tdir_count!=1) + err=TIFFReadDirEntryErrCount; + else if (dir->tdir_type!=TIFF_RATIONAL) + err=TIFFReadDirEntryErrType; + else + { + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 offset; + offset=*(uint32*)(&dir->tdir_offset); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&offset); + err=TIFFReadDirEntryData(tif,offset,8,m.i); + } + else + { + m.l=dir->tdir_offset.toff_long8; + err=TIFFReadDirEntryErrOk; + } + } + if (err==TIFFReadDirEntryErrOk) + { + double n; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(m.i,2); + if (m.i[0]==0) + n=0.0; + else if (m.i[0]==0xFFFFFFFF) + /* + * XXX: Numerator 0xFFFFFFFF means that we have infinite + * distance. Indicate that with a negative floating point + * SubjectDistance value. + */ + n=-1.0; + else + n=(double)m.i[0]/(double)m.i[1]; + return(TIFFSetField(tif,dir->tdir_tag,n)); + } + else + { + TIFFReadDirEntryOutputErr(tif,err,module,"SubjectDistance",TRUE); + return(0); + } +} + +/* + * Replace a single strip (tile) of uncompressed data by multiple strips + * (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for + * dealing with large images or for dealing with machines with a limited + * amount memory. + */ +static void +ChopUpSingleUncompressedStrip(TIFF* tif) +{ + register TIFFDirectory *td = &tif->tif_dir; + uint64 bytecount; + uint64 offset; + uint32 rowblock; + uint64 rowblockbytes; + uint64 stripbytes; + uint32 strip; + uint64 nstrips64; + uint32 nstrips32; + uint32 rowsperstrip; + uint64* newcounts; + uint64* newoffsets; + + bytecount = td->td_stripbytecount[0]; + offset = td->td_stripoffset[0]; + assert(td->td_planarconfig == PLANARCONFIG_CONTIG); + if ((td->td_photometric == PHOTOMETRIC_YCBCR)&& + (!isUpSampled(tif))) + rowblock = td->td_ycbcrsubsampling[1]; + else + rowblock = 1; + rowblockbytes = TIFFVTileSize64(tif, rowblock); + /* + * Make the rows hold at least one scanline, but fill specified amount + * of data if possible. + */ + if (rowblockbytes > STRIP_SIZE_DEFAULT) { + stripbytes = rowblockbytes; + rowsperstrip = rowblock; + } else if (rowblockbytes > 0 ) { + uint32 rowblocksperstrip; + rowblocksperstrip = (uint32) (STRIP_SIZE_DEFAULT / rowblockbytes); + rowsperstrip = rowblocksperstrip * rowblock; + stripbytes = rowblocksperstrip * rowblockbytes; + } + else + return; + + /* + * never increase the number of strips in an image + */ + if (rowsperstrip >= td->td_rowsperstrip) + return; + nstrips64 = TIFFhowmany_64(bytecount, stripbytes); + if ((nstrips64==0)||(nstrips64>0xFFFFFFFF)) /* something is wonky, do nothing. */ + return; + nstrips32 = (uint32)nstrips64; + + newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64), + "for chopped \"StripByteCounts\" array"); + newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips32, sizeof (uint64), + "for chopped \"StripOffsets\" array"); + if (newcounts == NULL || newoffsets == NULL) { + /* + * Unable to allocate new strip information, give up and use + * the original one strip information. + */ + if (newcounts != NULL) + _TIFFfree(newcounts); + if (newoffsets != NULL) + _TIFFfree(newoffsets); + return; + } + /* + * Fill the strip information arrays with new bytecounts and offsets + * that reflect the broken-up format. + */ + for (strip = 0; strip < nstrips32; strip++) { + if (stripbytes > bytecount) + stripbytes = bytecount; + newcounts[strip] = stripbytes; + newoffsets[strip] = offset; + offset += stripbytes; + bytecount -= stripbytes; + } + /* + * Replace old single strip info with multi-strip info. + */ + td->td_stripsperimage = td->td_nstrips = nstrips32; + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + _TIFFfree(td->td_stripbytecount); + _TIFFfree(td->td_stripoffset); + td->td_stripbytecount = newcounts; + td->td_stripoffset = newoffsets; + td->td_stripbytecountsorted = 1; +} + +int _TIFFFillStriles( TIFF *tif ) +{ +#if defined(DEFER_STRILE_LOAD) + register TIFFDirectory *td = &tif->tif_dir; + int return_value = 1; + + if( td->td_stripoffset != NULL ) + return 1; + + if( td->td_stripoffset_entry.tdir_count == 0 ) + return 0; + + if (!TIFFFetchStripThing(tif,&(td->td_stripoffset_entry), + td->td_nstrips,&td->td_stripoffset)) + { + return_value = 0; + } + + if (!TIFFFetchStripThing(tif,&(td->td_stripbytecount_entry), + td->td_nstrips,&td->td_stripbytecount)) + { + return_value = 0; + } + + _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry)); + _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry)); + + if (tif->tif_dir.td_nstrips > 1 && return_value == 1 ) { + uint32 strip; + + tif->tif_dir.td_stripbytecountsorted = 1; + for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) { + if (tif->tif_dir.td_stripoffset[strip - 1] > + tif->tif_dir.td_stripoffset[strip]) { + tif->tif_dir.td_stripbytecountsorted = 0; + break; + } + } + } + + return return_value; +#else /* !defined(DEFER_STRILE_LOAD) */ + (void) tif; + return 1; +#endif +} + + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirwrite.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirwrite.c new file mode 100644 index 0000000..fa20609 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dirwrite.c @@ -0,0 +1,2910 @@ +/* $Id: tif_dirwrite.c,v 1.77 2012-07-06 19:18:31 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Directory Write Support Routines. + */ +#include "tiffiop.h" + +#ifdef HAVE_IEEEFP +#define TIFFCvtNativeToIEEEFloat(tif, n, fp) +#define TIFFCvtNativeToIEEEDouble(tif, n, dp) +#else +extern void TIFFCvtNativeToIEEEFloat(TIFF* tif, uint32 n, float* fp); +extern void TIFFCvtNativeToIEEEDouble(TIFF* tif, uint32 n, double* dp); +#endif + +static int TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff); + +static int TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value); +#if 0 +static int TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +#endif + +static int TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value); +static int TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value); +#ifdef notdef +static int TIFFWriteDirectoryTagByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value); +#endif +static int TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value); +#if 0 +static int TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value); +#endif +#ifdef notdef +static int TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value); +#endif +static int TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value); +#if 0 +static int TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value); +#endif +static int TIFFWriteDirectoryTagShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value); +static int TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value); +static int TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value); +#ifdef notdef +static int TIFFWriteDirectoryTagSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value); +#endif +static int TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value); +#if 0 +static int TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value); +#endif +static int TIFFWriteDirectoryTagLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value); +static int TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value); +#if 0 +static int TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value); +#endif +#ifdef notdef +static int TIFFWriteDirectoryTagSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value); +#endif +static int TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value); +#if 0 +static int TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value); +#endif +#ifdef notdef +static int TIFFWriteDirectoryTagLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value); +#endif +static int TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +#ifdef notdef +static int TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value); +#endif +static int TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value); +static int TIFFWriteDirectoryTagRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +static int TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +static int TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +#ifdef notdef +static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value); +#endif +static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +#if 0 +static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value); +#endif +#ifdef notdef +static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +#endif +static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value); +#if 0 +static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +#endif +static int TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value); +#ifdef notdef +static int TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +#endif +static int TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value); +static int TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +static int TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +#ifdef notdef +static int TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +#endif +static int TIFFWriteDirectoryTagColormap(TIFF* tif, uint32* ndir, TIFFDirEntry* dir); +static int TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir); +static int TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir); + +static int TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value); +static int TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value); +#endif +static int TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value); +#endif +static int TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value); +static int TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value); +static int TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value); +#endif +static int TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value); +static int TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value); +static int TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value); +#endif +static int TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value); +#endif +static int TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value); +#endif +static int TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value); +static int TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +static int TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +static int TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value); +#endif +static int TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value); +#ifdef notdef +static int TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value); +#endif +static int TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value); +static int TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value); +static int TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value); + +static int TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data); + +static int TIFFLinkDirectory(TIFF*); + +/* + * Write the contents of the current directory + * to the specified file. This routine doesn't + * handle overwriting a directory with auxiliary + * storage that's been changed. + */ +int +TIFFWriteDirectory(TIFF* tif) +{ + return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL); +} + +/* + * Similar to TIFFWriteDirectory(), writes the directory out + * but leaves all data structures in memory so that it can be + * written again. This will make a partially written TIFF file + * readable before it is successfully completed/closed. + */ +int +TIFFCheckpointDirectory(TIFF* tif) +{ + int rc; + /* Setup the strips arrays, if they haven't already been. */ + if (tif->tif_dir.td_stripoffset == NULL) + (void) TIFFSetupStrips(tif); + rc = TIFFWriteDirectorySec(tif,TRUE,FALSE,NULL); + (void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END)); + return rc; +} + +int +TIFFWriteCustomDirectory(TIFF* tif, uint64* pdiroff) +{ + return TIFFWriteDirectorySec(tif,FALSE,FALSE,pdiroff); +} + +/* + * Similar to TIFFWriteDirectory(), but if the directory has already + * been written once, it is relocated to the end of the file, in case it + * has changed in size. Note that this will result in the loss of the + * previously used directory space. + */ +int +TIFFRewriteDirectory( TIFF *tif ) +{ + static const char module[] = "TIFFRewriteDirectory"; + + /* We don't need to do anything special if it hasn't been written. */ + if( tif->tif_diroff == 0 ) + return TIFFWriteDirectory( tif ); + + /* + * Find and zero the pointer to this directory, so that TIFFLinkDirectory + * will cause it to be added after this directories current pre-link. + */ + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (tif->tif_header.classic.tiff_diroff == tif->tif_diroff) + { + tif->tif_header.classic.tiff_diroff = 0; + tif->tif_diroff = 0; + + TIFFSeekFile(tif,4,SEEK_SET); + if (!WriteOK(tif, &(tif->tif_header.classic.tiff_diroff),4)) + { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Error updating TIFF header"); + return (0); + } + } + else + { + uint32 nextdir; + nextdir = tif->tif_header.classic.tiff_diroff; + while(1) { + uint16 dircount; + uint32 nextnextdir; + + if (!SeekOK(tif, nextdir) || + !ReadOK(tif, &dircount, 2)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + (void) TIFFSeekFile(tif, + nextdir+2+dircount*12, SEEK_SET); + if (!ReadOK(tif, &nextnextdir, 4)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory link"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextnextdir); + if (nextnextdir==tif->tif_diroff) + { + uint32 m; + m=0; + (void) TIFFSeekFile(tif, + nextdir+2+dircount*12, SEEK_SET); + if (!WriteOK(tif, &m, 4)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + tif->tif_diroff=0; + break; + } + nextdir=nextnextdir; + } + } + } + else + { + if (tif->tif_header.big.tiff_diroff == tif->tif_diroff) + { + tif->tif_header.big.tiff_diroff = 0; + tif->tif_diroff = 0; + + TIFFSeekFile(tif,8,SEEK_SET); + if (!WriteOK(tif, &(tif->tif_header.big.tiff_diroff),8)) + { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Error updating TIFF header"); + return (0); + } + } + else + { + uint64 nextdir; + nextdir = tif->tif_header.big.tiff_diroff; + while(1) { + uint64 dircount64; + uint16 dircount; + uint64 nextnextdir; + + if (!SeekOK(tif, nextdir) || + !ReadOK(tif, &dircount64, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>0xFFFF) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on tag count failed, likely corrupt TIFF"); + return (0); + } + dircount=(uint16)dircount64; + (void) TIFFSeekFile(tif, + nextdir+8+dircount*20, SEEK_SET); + if (!ReadOK(tif, &nextnextdir, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory link"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&nextnextdir); + if (nextnextdir==tif->tif_diroff) + { + uint64 m; + m=0; + (void) TIFFSeekFile(tif, + nextdir+8+dircount*20, SEEK_SET); + if (!WriteOK(tif, &m, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + tif->tif_diroff=0; + break; + } + nextdir=nextnextdir; + } + } + } + + /* + * Now use TIFFWriteDirectory() normally. + */ + + return TIFFWriteDirectory( tif ); +} + +static int +TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff) +{ + static const char module[] = "TIFFWriteDirectorySec"; + uint32 ndir; + TIFFDirEntry* dir; + uint32 dirsize; + void* dirmem; + uint32 m; + if (tif->tif_mode == O_RDONLY) + return (1); + + _TIFFFillStriles( tif ); + + /* + * Clear write state so that subsequent images with + * different characteristics get the right buffers + * setup for them. + */ + if (imagedone) + { + if (tif->tif_flags & TIFF_POSTENCODE) + { + tif->tif_flags &= ~TIFF_POSTENCODE; + if (!(*tif->tif_postencode)(tif)) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Error post-encoding before directory write"); + return (0); + } + } + (*tif->tif_close)(tif); /* shutdown encoder */ + /* + * Flush any data that might have been written + * by the compression close+cleanup routines. But + * be careful not to write stuff if we didn't add data + * in the previous steps as the "rawcc" data may well be + * a previously read tile/strip in mixed read/write mode. + */ + if (tif->tif_rawcc > 0 + && (tif->tif_flags & TIFF_BEENWRITING) != 0 ) + { + if( !TIFFFlushData1(tif) ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Error flushing data before directory write"); + return (0); + } + } + if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) + { + _TIFFfree(tif->tif_rawdata); + tif->tif_rawdata = NULL; + tif->tif_rawcc = 0; + tif->tif_rawdatasize = 0; + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = 0; + } + tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP); + } + dir=NULL; + dirmem=NULL; + dirsize=0; + while (1) + { + ndir=0; + if (isimage) + { + if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) + { + if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_IMAGEWIDTH,tif->tif_dir.td_imagewidth)) + goto bad; + if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_IMAGELENGTH,tif->tif_dir.td_imagelength)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) + { + if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_TILEWIDTH,tif->tif_dir.td_tilewidth)) + goto bad; + if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_TILELENGTH,tif->tif_dir.td_tilelength)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_RESOLUTION)) + { + if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_XRESOLUTION,tif->tif_dir.td_xresolution)) + goto bad; + if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_YRESOLUTION,tif->tif_dir.td_yresolution)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_POSITION)) + { + if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_XPOSITION,tif->tif_dir.td_xposition)) + goto bad; + if (!TIFFWriteDirectoryTagRational(tif,&ndir,dir,TIFFTAG_YPOSITION,tif->tif_dir.td_yposition)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) + { + if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_SUBFILETYPE,tif->tif_dir.td_subfiletype)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) + { + if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_BITSPERSAMPLE,tif->tif_dir.td_bitspersample)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_COMPRESSION)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_COMPRESSION,tif->tif_dir.td_compression)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_PHOTOMETRIC,tif->tif_dir.td_photometric)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_THRESHHOLDING,tif->tif_dir.td_threshholding)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_FILLORDER)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_FILLORDER,tif->tif_dir.td_fillorder)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_ORIENTATION)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_ORIENTATION,tif->tif_dir.td_orientation)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_SAMPLESPERPIXEL,tif->tif_dir.td_samplesperpixel)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) + { + if (!TIFFWriteDirectoryTagShortLong(tif,&ndir,dir,TIFFTAG_ROWSPERSTRIP,tif->tif_dir.td_rowsperstrip)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) + { + if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_MINSAMPLEVALUE,tif->tif_dir.td_minsamplevalue)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) + { + if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_MAXSAMPLEVALUE,tif->tif_dir.td_maxsamplevalue)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_PLANARCONFIG,tif->tif_dir.td_planarconfig)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_RESOLUTIONUNIT,tif->tif_dir.td_resolutionunit)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) + { + if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_PAGENUMBER,2,&tif->tif_dir.td_pagenumber[0])) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_STRIPBYTECOUNTS)) + { + if (!isTiled(tif)) + { + if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount)) + goto bad; + } + else + { + if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount)) + goto bad; + } + } + if (TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) + { + if (!isTiled(tif)) + { + if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset)) + goto bad; + } + else + { + if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_TILEOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset)) + goto bad; + } + } + if (TIFFFieldSet(tif,FIELD_COLORMAP)) + { + if (!TIFFWriteDirectoryTagColormap(tif,&ndir,dir)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES)) + { + if (tif->tif_dir.td_extrasamples) + { + uint16 na; + uint16* nb; + TIFFGetFieldDefaulted(tif,TIFFTAG_EXTRASAMPLES,&na,&nb); + if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_EXTRASAMPLES,na,nb)) + goto bad; + } + } + if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) + { + if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_SAMPLEFORMAT,tif->tif_dir.td_sampleformat)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) + { + if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMINSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_sminsamplevalue)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) + { + if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMAXSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_smaxsamplevalue)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) + { + if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_IMAGEDEPTH,tif->tif_dir.td_imagedepth)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) + { + if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,TIFFTAG_TILEDEPTH,tif->tif_dir.td_tiledepth)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) + { + if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_HALFTONEHINTS,2,&tif->tif_dir.td_halftonehints[0])) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) + { + if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_YCBCRSUBSAMPLING,2,&tif->tif_dir.td_ycbcrsubsampling[0])) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) + { + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,TIFFTAG_YCBCRPOSITIONING,tif->tif_dir.td_ycbcrpositioning)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) + { + if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,TIFFTAG_REFERENCEBLACKWHITE,6,tif->tif_dir.td_refblackwhite)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) + { + if (!TIFFWriteDirectoryTagTransferfunction(tif,&ndir,dir)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_INKNAMES)) + { + if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,TIFFTAG_INKNAMES,tif->tif_dir.td_inknameslen,tif->tif_dir.td_inknames)) + goto bad; + } + if (TIFFFieldSet(tif,FIELD_SUBIFD)) + { + if (!TIFFWriteDirectoryTagSubifd(tif,&ndir,dir)) + goto bad; + } + { + uint32 n; + for (n=0; ntif_nfields; n++) { + const TIFFField* o; + o = tif->tif_fields[n]; + if ((o->field_bit>=FIELD_CODEC)&&(TIFFFieldSet(tif,o->field_bit))) + { + switch (o->get_field_type) + { + case TIFF_SETGET_ASCII: + { + uint32 pa; + char* pb; + assert(o->field_type==TIFF_ASCII); + assert(o->field_readcount==TIFF_VARIABLE); + assert(o->field_passcount==0); + TIFFGetField(tif,o->field_tag,&pb); + pa=(uint32)(strlen(pb)); + if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,o->field_tag,pa,pb)) + goto bad; + } + break; + case TIFF_SETGET_UINT16: + { + uint16 p; + assert(o->field_type==TIFF_SHORT); + assert(o->field_readcount==1); + assert(o->field_passcount==0); + TIFFGetField(tif,o->field_tag,&p); + if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,o->field_tag,p)) + goto bad; + } + break; + case TIFF_SETGET_UINT32: + { + uint32 p; + assert(o->field_type==TIFF_LONG); + assert(o->field_readcount==1); + assert(o->field_passcount==0); + TIFFGetField(tif,o->field_tag,&p); + if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,o->field_tag,p)) + goto bad; + } + break; + case TIFF_SETGET_C32_UINT8: + { + uint32 pa; + void* pb; + assert(o->field_type==TIFF_UNDEFINED); + assert(o->field_readcount==TIFF_VARIABLE2); + assert(o->field_passcount==1); + TIFFGetField(tif,o->field_tag,&pa,&pb); + if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,o->field_tag,pa,pb)) + goto bad; + } + break; + default: + assert(0); /* we should never get here */ + break; + } + } + } + } + } + for (m=0; m<(uint32)(tif->tif_dir.td_customValueCount); m++) + { + switch (tif->tif_dir.td_customValues[m].info->field_type) + { + case TIFF_ASCII: + if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_UNDEFINED: + if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_BYTE: + if (!TIFFWriteDirectoryTagByteArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SBYTE: + if (!TIFFWriteDirectoryTagSbyteArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SHORT: + if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SSHORT: + if (!TIFFWriteDirectoryTagSshortArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_LONG: + if (!TIFFWriteDirectoryTagLongArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SLONG: + if (!TIFFWriteDirectoryTagSlongArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_LONG8: + if (!TIFFWriteDirectoryTagLong8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SLONG8: + if (!TIFFWriteDirectoryTagSlong8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_RATIONAL: + if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_SRATIONAL: + if (!TIFFWriteDirectoryTagSrationalArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_FLOAT: + if (!TIFFWriteDirectoryTagFloatArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_DOUBLE: + if (!TIFFWriteDirectoryTagDoubleArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_IFD: + if (!TIFFWriteDirectoryTagIfdArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + case TIFF_IFD8: + if (!TIFFWriteDirectoryTagIfdIfd8Array(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) + goto bad; + break; + default: + assert(0); /* we should never get here */ + break; + } + } + if (dir!=NULL) + break; + dir=_TIFFmalloc(ndir*sizeof(TIFFDirEntry)); + if (dir==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + goto bad; + } + if (isimage) + { + if ((tif->tif_diroff==0)&&(!TIFFLinkDirectory(tif))) + goto bad; + } + else + tif->tif_diroff=(TIFFSeekFile(tif,0,SEEK_END)+1)&(~1); + if (pdiroff!=NULL) + *pdiroff=tif->tif_diroff; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + dirsize=2+ndir*12+4; + else + dirsize=8+ndir*20+8; + tif->tif_dataoff=tif->tif_diroff+dirsize; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + tif->tif_dataoff=(uint32)tif->tif_dataoff; + if ((tif->tif_dataofftif_diroff)||(tif->tif_dataoff<(uint64)dirsize)) + { + TIFFErrorExt(tif->tif_clientdata,module,"Maximum TIFF file size exceeded"); + goto bad; + } + if (tif->tif_dataoff&1) + tif->tif_dataoff++; + if (isimage) + tif->tif_curdir++; + } + if (isimage) + { + if (TIFFFieldSet(tif,FIELD_SUBIFD)&&(tif->tif_subifdoff==0)) + { + uint32 na; + TIFFDirEntry* nb; + for (na=0, nb=dir; ; na++, nb++) + { + assert(natdir_tag==TIFFTAG_SUBIFD) + break; + } + if (!(tif->tif_flags&TIFF_BIGTIFF)) + tif->tif_subifdoff=tif->tif_diroff+2+na*12+8; + else + tif->tif_subifdoff=tif->tif_diroff+8+na*20+12; + } + } + dirmem=_TIFFmalloc(dirsize); + if (dirmem==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + goto bad; + } + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint8* n; + uint32 nTmp; + TIFFDirEntry* o; + n=dirmem; + *(uint16*)n=ndir; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)n); + n+=2; + o=dir; + for (m=0; mtdir_tag; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)n); + n+=2; + *(uint16*)n=o->tdir_type; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)n); + n+=2; + nTmp = (uint32)o->tdir_count; + _TIFFmemcpy(n,&nTmp,4); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)n); + n+=4; + /* This is correct. The data has been */ + /* swabbed previously in TIFFWriteDirectoryTagData */ + _TIFFmemcpy(n,&o->tdir_offset,4); + n+=4; + o++; + } + nTmp = (uint32)tif->tif_nextdiroff; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&nTmp); + _TIFFmemcpy(n,&nTmp,4); + } + else + { + uint8* n; + TIFFDirEntry* o; + n=dirmem; + *(uint64*)n=ndir; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)n); + n+=8; + o=dir; + for (m=0; mtdir_tag; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)n); + n+=2; + *(uint16*)n=o->tdir_type; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)n); + n+=2; + _TIFFmemcpy(n,&o->tdir_count,8); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)n); + n+=8; + _TIFFmemcpy(n,&o->tdir_offset,8); + n+=8; + o++; + } + _TIFFmemcpy(n,&tif->tif_nextdiroff,8); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)n); + } + _TIFFfree(dir); + dir=NULL; + if (!SeekOK(tif,tif->tif_diroff)) + { + TIFFErrorExt(tif->tif_clientdata,module,"IO error writing directory"); + goto bad; + } + if (!WriteOK(tif,dirmem,(tmsize_t)dirsize)) + { + TIFFErrorExt(tif->tif_clientdata,module,"IO error writing directory"); + goto bad; + } + _TIFFfree(dirmem); + if (imagedone) + { + TIFFFreeDirectory(tif); + tif->tif_flags &= ~TIFF_DIRTYDIRECT; + tif->tif_flags &= ~TIFF_DIRTYSTRIP; + (*tif->tif_cleanup)(tif); + /* + * Reset directory-related state for subsequent + * directories. + */ + TIFFCreateDirectory(tif); + } + return(1); +bad: + if (dir!=NULL) + _TIFFfree(dir); + if (dirmem!=NULL) + _TIFFfree(dirmem); + return(0); +} + +static int +TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value) +{ + static const char module[] = "TIFFWriteDirectoryTagSampleformatArray"; + void* conv; + uint32 i; + int ok; + conv = _TIFFmalloc(count*sizeof(double)); + if (conv == NULL) + { + TIFFErrorExt(tif->tif_clientdata, module, "Out of memory"); + return (0); + } + + switch (tif->tif_dir.td_sampleformat) + { + case SAMPLEFORMAT_IEEEFP: + if (tif->tif_dir.td_bitspersample<=32) + { + for (i = 0; i < count; ++i) + ((float*)conv)[i] = (float)value[i]; + ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv); + } + else + { + ok = TIFFWriteDirectoryTagDoubleArray(tif,ndir,dir,tag,count,value); + } + break; + case SAMPLEFORMAT_INT: + if (tif->tif_dir.td_bitspersample<=8) + { + for (i = 0; i < count; ++i) + ((int8*)conv)[i] = (int8)value[i]; + ok = TIFFWriteDirectoryTagSbyteArray(tif,ndir,dir,tag,count,(int8*)conv); + } + else if (tif->tif_dir.td_bitspersample<=16) + { + for (i = 0; i < count; ++i) + ((int16*)conv)[i] = (int16)value[i]; + ok = TIFFWriteDirectoryTagSshortArray(tif,ndir,dir,tag,count,(int16*)conv); + } + else + { + for (i = 0; i < count; ++i) + ((int32*)conv)[i] = (int32)value[i]; + ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv); + } + break; + case SAMPLEFORMAT_UINT: + if (tif->tif_dir.td_bitspersample<=8) + { + for (i = 0; i < count; ++i) + ((uint8*)conv)[i] = (uint8)value[i]; + ok = TIFFWriteDirectoryTagByteArray(tif,ndir,dir,tag,count,(uint8*)conv); + } + else if (tif->tif_dir.td_bitspersample<=16) + { + for (i = 0; i < count; ++i) + ((uint16*)conv)[i] = (uint16)value[i]; + ok = TIFFWriteDirectoryTagShortArray(tif,ndir,dir,tag,count,(uint16*)conv); + } + else + { + for (i = 0; i < count; ++i) + ((uint32*)conv)[i] = (uint32)value[i]; + ok = TIFFWriteDirectoryTagLongArray(tif,ndir,dir,tag,count,(uint32*)conv); + } + break; + default: + ok = 0; + } + + _TIFFfree(conv); + return (ok); +} + +#if 0 +static int +TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + switch (tif->tif_dir.td_sampleformat) + { + case SAMPLEFORMAT_IEEEFP: + if (tif->tif_dir.td_bitspersample<=32) + return(TIFFWriteDirectoryTagFloatPerSample(tif,ndir,dir,tag,(float)value)); + else + return(TIFFWriteDirectoryTagDoublePerSample(tif,ndir,dir,tag,value)); + case SAMPLEFORMAT_INT: + if (tif->tif_dir.td_bitspersample<=8) + return(TIFFWriteDirectoryTagSbytePerSample(tif,ndir,dir,tag,(int8)value)); + else if (tif->tif_dir.td_bitspersample<=16) + return(TIFFWriteDirectoryTagSshortPerSample(tif,ndir,dir,tag,(int16)value)); + else + return(TIFFWriteDirectoryTagSlongPerSample(tif,ndir,dir,tag,(int32)value)); + case SAMPLEFORMAT_UINT: + if (tif->tif_dir.td_bitspersample<=8) + return(TIFFWriteDirectoryTagBytePerSample(tif,ndir,dir,tag,(uint8)value)); + else if (tif->tif_dir.td_bitspersample<=16) + return(TIFFWriteDirectoryTagShortPerSample(tif,ndir,dir,tag,(uint16)value)); + else + return(TIFFWriteDirectoryTagLongPerSample(tif,ndir,dir,tag,(uint32)value)); + default: + return(1); + } +} +#endif + +static int +TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedAscii(tif,ndir,dir,tag,count,value)); +} + +static int +TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedUndefinedArray(tif,ndir,dir,tag,count,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedByte(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedByteArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int +TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value) +{ + static const char module[] = "TIFFWriteDirectoryTagBytePerSample"; + uint8* m; + uint8* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint8)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedByteArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +#ifdef notdef +static int +TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSbyte(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSbyteArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int +TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value) +{ + static const char module[] = "TIFFWriteDirectoryTagSbytePerSample"; + int8* m; + int8* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int8)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedSbyteArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +static int +TIFFWriteDirectoryTagShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedShort(tif,ndir,dir,tag,value)); +} + +static int +TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,count,value)); +} + +static int +TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value) +{ + static const char module[] = "TIFFWriteDirectoryTagShortPerSample"; + uint16* m; + uint16* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint16)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSshort(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSshortArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int +TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value) +{ + static const char module[] = "TIFFWriteDirectoryTagSshortPerSample"; + int16* m; + int16* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int16)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedSshortArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +static int +TIFFWriteDirectoryTagLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedLong(tif,ndir,dir,tag,value)); +} + +static int +TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int +TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value) +{ + static const char module[] = "TIFFWriteDirectoryTagLongPerSample"; + uint32* m; + uint32* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint32)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +#ifdef notdef +static int +TIFFWriteDirectoryTagSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSlong(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSlongArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int +TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value) +{ + static const char module[] = "TIFFWriteDirectoryTagSlongPerSample"; + int32* m; + int32* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int32)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedSlongArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +#ifdef notdef +static int +TIFFWriteDirectoryTagLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedLong8(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedLong8Array(tif,ndir,dir,tag,count,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSlong8(tif,ndir,dir,tag,value)); +} +#endif + +static int +TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSlong8Array(tif,ndir,dir,tag,count,value)); +} + +static int +TIFFWriteDirectoryTagRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedRational(tif,ndir,dir,tag,value)); +} + +static int +TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedRationalArray(tif,ndir,dir,tag,count,value)); +} + +static int +TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedSrationalArray(tif,ndir,dir,tag,count,value)); +} + +#ifdef notdef +static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedFloat(tif,ndir,dir,tag,value)); +} +#endif + +static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedFloatArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value) +{ + static const char module[] = "TIFFWriteDirectoryTagFloatPerSample"; + float* m; + float* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(float)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedFloatArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +#ifdef notdef +static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedDouble(tif,ndir,dir,tag,value)); +} +#endif + +static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedDoubleArray(tif,ndir,dir,tag,count,value)); +} + +#if 0 +static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + static const char module[] = "TIFFWriteDirectoryTagDoublePerSample"; + double* m; + double* na; + uint16 nb; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(double)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=m, nb=0; nbtif_dir.td_samplesperpixel; na++, nb++) + *na=value; + o=TIFFWriteDirectoryTagCheckedDoubleArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); + _TIFFfree(m); + return(o); +} +#endif + +static int +TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,tag,count,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + return(TIFFWriteDirectoryTagCheckedIfd8Array(tif,ndir,dir,tag,count,value)); +} +#endif + +static int +TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value) +{ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + if (value<=0xFFFF) + return(TIFFWriteDirectoryTagCheckedShort(tif,ndir,dir,tag,(uint16)value)); + else + return(TIFFWriteDirectoryTagCheckedLong(tif,ndir,dir,tag,value)); +} + +/************************************************************************/ +/* TIFFWriteDirectoryTagLongLong8Array() */ +/* */ +/* Write out LONG8 array as LONG8 for BigTIFF or LONG for */ +/* Classic TIFF with some checking. */ +/************************************************************************/ + +static int +TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + static const char module[] = "TIFFWriteDirectoryTagLongLong8Array"; + uint64* ma; + uint32 mb; + uint32* p; + uint32* q; + int o; + + /* is this just a counting pass? */ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + + /* We always write LONG8 for BigTIFF, no checking needed. */ + if( tif->tif_flags&TIFF_BIGTIFF ) + return TIFFWriteDirectoryTagCheckedLong8Array(tif,ndir,dir, + tag,count,value); + + /* + ** For classic tiff we want to verify everything is in range for LONG + ** and convert to long format. + */ + + p = _TIFFmalloc(count*sizeof(uint32)); + if (p==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + + for (q=p, ma=value, mb=0; mb0xFFFFFFFF) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Attempt to write value larger than 0xFFFFFFFF in Classic TIFF file."); + _TIFFfree(p); + return(0); + } + *q= (uint32)(*ma); + } + + o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p); + _TIFFfree(p); + + return(o); +} + +/************************************************************************/ +/* TIFFWriteDirectoryTagIfdIfd8Array() */ +/* */ +/* Write either IFD8 or IFD array depending on file type. */ +/************************************************************************/ + +static int +TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + static const char module[] = "TIFFWriteDirectoryTagIfdIfd8Array"; + uint64* ma; + uint32 mb; + uint32* p; + uint32* q; + int o; + + /* is this just a counting pass? */ + if (dir==NULL) + { + (*ndir)++; + return(1); + } + + /* We always write IFD8 for BigTIFF, no checking needed. */ + if( tif->tif_flags&TIFF_BIGTIFF ) + return TIFFWriteDirectoryTagCheckedIfd8Array(tif,ndir,dir, + tag,count,value); + + /* + ** For classic tiff we want to verify everything is in range for IFD + ** and convert to long format. + */ + + p = _TIFFmalloc(count*sizeof(uint32)); + if (p==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + + for (q=p, ma=value, mb=0; mb0xFFFFFFFF) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Attempt to write value larger than 0xFFFFFFFF in Classic TIFF file."); + _TIFFfree(p); + return(0); + } + *q= (uint32)(*ma); + } + + o=TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,tag,count,p); + _TIFFfree(p); + + return(o); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + static const char module[] = "TIFFWriteDirectoryTagShortLongLong8Array"; + uint64* ma; + uint32 mb; + uint8 n; + int o; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + n=0; + for (ma=value, mb=0; mb0xFFFF)) + n=1; + if ((n==1)&&(*ma>0xFFFFFFFF)) + { + n=2; + break; + } + } + if (n==0) + { + uint16* p; + uint16* q; + p=_TIFFmalloc(count*sizeof(uint16)); + if (p==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (ma=value, mb=0, q=p; mbtif_clientdata,module,"Out of memory"); + return(0); + } + for (ma=value, mb=0, q=p; mbtif_dir.td_bitspersample); + n=_TIFFmalloc(3*m*sizeof(uint16)); + if (n==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + _TIFFmemcpy(&n[0],tif->tif_dir.td_colormap[0],m*sizeof(uint16)); + _TIFFmemcpy(&n[m],tif->tif_dir.td_colormap[1],m*sizeof(uint16)); + _TIFFmemcpy(&n[2*m],tif->tif_dir.td_colormap[2],m*sizeof(uint16)); + o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,TIFFTAG_COLORMAP,3*m,n); + _TIFFfree(n); + return(o); +} + +static int +TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir) +{ + static const char module[] = "TIFFWriteDirectoryTagTransferfunction"; + uint32 m; + uint16 n; + uint16* o; + int p; + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=(1<tif_dir.td_bitspersample); + n=tif->tif_dir.td_samplesperpixel-tif->tif_dir.td_extrasamples; + /* + * Check if the table can be written as a single column, + * or if it must be written as 3 columns. Note that we + * write a 3-column tag if there are 2 samples/pixel and + * a single column of data won't suffice--hmm. + */ + if (n>3) + n=3; + if (n==3) + { + if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16))) + n=2; + } + if (n==2) + { + if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16))) + n=1; + } + if (n==0) + n=1; + o=_TIFFmalloc(n*m*sizeof(uint16)); + if (o==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + _TIFFmemcpy(&o[0],tif->tif_dir.td_transferfunction[0],m*sizeof(uint16)); + if (n>1) + _TIFFmemcpy(&o[m],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)); + if (n>2) + _TIFFmemcpy(&o[2*m],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)); + p=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,TIFFTAG_TRANSFERFUNCTION,n*m,o); + _TIFFfree(o); + return(p); +} + +static int +TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir) +{ + static const char module[] = "TIFFWriteDirectoryTagSubifd"; + uint64 m; + int n; + if (tif->tif_dir.td_nsubifd==0) + return(1); + if (dir==NULL) + { + (*ndir)++; + return(1); + } + m=tif->tif_dataoff; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32* o; + uint64* pa; + uint32* pb; + uint16 p; + o=_TIFFmalloc(tif->tif_dir.td_nsubifd*sizeof(uint32)); + if (o==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + pa=tif->tif_dir.td_subifd; + pb=o; + for (p=0; p < tif->tif_dir.td_nsubifd; p++) + { + assert(pa != 0); + assert(*pa <= 0xFFFFFFFFUL); + *pb++=(uint32)(*pa++); + } + n=TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,TIFFTAG_SUBIFD,tif->tif_dir.td_nsubifd,o); + _TIFFfree(o); + } + else + n=TIFFWriteDirectoryTagCheckedIfd8Array(tif,ndir,dir,TIFFTAG_SUBIFD,tif->tif_dir.td_nsubifd,tif->tif_dir.td_subifd); + if (!n) + return(0); + /* + * Total hack: if this directory includes a SubIFD + * tag then force the next directories to be + * written as ``sub directories'' of this one. This + * is used to write things like thumbnails and + * image masks that one wants to keep out of the + * normal directory linkage access mechanism. + */ + tif->tif_flags|=TIFF_INSUBIFD; + tif->tif_nsubifd=tif->tif_dir.td_nsubifd; + if (tif->tif_dir.td_nsubifd==1) + tif->tif_subifdoff=0; + else + tif->tif_subifdoff=m; + return(1); +} + +static int +TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value) +{ + assert(sizeof(char)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_ASCII,count,count,value)); +} + +static int +TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value) +{ + assert(sizeof(uint8)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_UNDEFINED,count,count,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value) +{ + assert(sizeof(uint8)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_BYTE,1,1,&value)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value) +{ + assert(sizeof(uint8)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_BYTE,count,count,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value) +{ + assert(sizeof(int8)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SBYTE,1,1,&value)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value) +{ + assert(sizeof(int8)==1); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SBYTE,count,count,value)); +} + +static int +TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value) +{ + uint16 m; + assert(sizeof(uint16)==2); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort(&m); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SHORT,1,2,&m)); +} + +static int +TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value) +{ + assert(count<0x80000000); + assert(sizeof(uint16)==2); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfShort(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SHORT,count,count*2,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value) +{ + int16 m; + assert(sizeof(int16)==2); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort((uint16*)(&m)); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SSHORT,1,2,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value) +{ + assert(count<0x80000000); + assert(sizeof(int16)==2); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfShort((uint16*)value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SSHORT,count,count*2,value)); +} + +static int +TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value) +{ + uint32 m; + assert(sizeof(uint32)==4); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&m); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG,1,4,&m)); +} + +static int +TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value) +{ + assert(count<0x40000000); + assert(sizeof(uint32)==4); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG,count,count*4,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value) +{ + int32 m; + assert(sizeof(int32)==4); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong((uint32*)(&m)); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,1,4,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value) +{ + assert(count<0x40000000); + assert(sizeof(int32)==4); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong((uint32*)value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,count,count*4,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value) +{ + uint64 m; + assert(sizeof(uint64)==8); + assert(tif->tif_flags&TIFF_BIGTIFF); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(&m); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,1,8,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + assert(count<0x20000000); + assert(sizeof(uint64)==8); + assert(tif->tif_flags&TIFF_BIGTIFF); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG8,count,count*8,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value) +{ + int64 m; + assert(sizeof(int64)==8); + assert(tif->tif_flags&TIFF_BIGTIFF); + m=value; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8((uint64*)(&m)); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,1,8,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value) +{ + assert(count<0x20000000); + assert(sizeof(int64)==8); + assert(tif->tif_flags&TIFF_BIGTIFF); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8((uint64*)value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value)); +} + +static int +TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + uint32 m[2]; + assert(value>=0.0); + assert(sizeof(uint32)==4); + if (value<=0.0) + { + m[0]=0; + m[1]=1; + } + else if (value==(double)(uint32)value) + { + m[0]=(uint32)value; + m[1]=1; + } + else if (value<1.0) + { + m[0]=(uint32)(value*0xFFFFFFFF); + m[1]=0xFFFFFFFF; + } + else + { + m[0]=0xFFFFFFFF; + m[1]=(uint32)(0xFFFFFFFF/value); + } + if (tif->tif_flags&TIFF_SWAB) + { + TIFFSwabLong(&m[0]); + TIFFSwabLong(&m[1]); + } + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_RATIONAL,1,8,&m[0])); +} + +static int +TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + static const char module[] = "TIFFWriteDirectoryTagCheckedRationalArray"; + uint32* m; + float* na; + uint32* nb; + uint32 nc; + int o; + assert(sizeof(uint32)==4); + m=_TIFFmalloc(count*2*sizeof(uint32)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=value, nb=m, nc=0; nctif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(m,count*2); + o=TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_RATIONAL,count,count*8,&m[0]); + _TIFFfree(m); + return(o); +} + +static int +TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + static const char module[] = "TIFFWriteDirectoryTagCheckedSrationalArray"; + int32* m; + float* na; + int32* nb; + uint32 nc; + int o; + assert(sizeof(int32)==4); + m=_TIFFmalloc(count*2*sizeof(int32)); + if (m==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + for (na=value, nb=m, nc=0; nc-1.0) + { + nb[0]=-(int32)((-*na)*0x7FFFFFFF); + nb[1]=0x7FFFFFFF; + } + else + { + nb[0]=-0x7FFFFFFF; + nb[1]=(int32)(0x7FFFFFFF/(-*na)); + } + } + else + { + if (*na==(int32)(*na)) + { + nb[0]=(int32)(*na); + nb[1]=1; + } + else if (*na<1.0) + { + nb[0]=(int32)((*na)*0x7FFFFFFF); + nb[1]=0x7FFFFFFF; + } + else + { + nb[0]=0x7FFFFFFF; + nb[1]=(int32)(0x7FFFFFFF/(*na)); + } + } + } + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong((uint32*)m,count*2); + o=TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SRATIONAL,count,count*8,&m[0]); + _TIFFfree(m); + return(o); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value) +{ + float m; + assert(sizeof(float)==4); + m=value; + TIFFCvtNativeToIEEEFloat(tif,1,&m); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabFloat(&m); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_FLOAT,1,4,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) +{ + assert(count<0x40000000); + assert(sizeof(float)==4); + TIFFCvtNativeToIEEEFloat(tif,count,&value); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfFloat(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_FLOAT,count,count*4,value)); +} + +#ifdef notdef +static int +TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value) +{ + double m; + assert(sizeof(double)==8); + m=value; + TIFFCvtNativeToIEEEDouble(tif,1,&m); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabDouble(&m); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_DOUBLE,1,8,&m)); +} +#endif + +static int +TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value) +{ + assert(count<0x20000000); + assert(sizeof(double)==8); + TIFFCvtNativeToIEEEDouble(tif,count,&value); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfDouble(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_DOUBLE,count,count*8,value)); +} + +static int +TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value) +{ + assert(count<0x40000000); + assert(sizeof(uint32)==4); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_IFD,count,count*4,value)); +} + +static int +TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value) +{ + assert(count<0x20000000); + assert(sizeof(uint64)==8); + assert(tif->tif_flags&TIFF_BIGTIFF); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabArrayOfLong8(value,count); + return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_IFD8,count,count*8,value)); +} + +static int +TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data) +{ + static const char module[] = "TIFFWriteDirectoryTagData"; + uint32 m; + m=0; + while (m<(*ndir)) + { + assert(dir[m].tdir_tag!=tag); + if (dir[m].tdir_tag>tag) + break; + m++; + } + if (m<(*ndir)) + { + uint32 n; + for (n=*ndir; n>m; n--) + dir[n]=dir[n-1]; + } + dir[m].tdir_tag=tag; + dir[m].tdir_type=datatype; + dir[m].tdir_count=count; + dir[m].tdir_offset.toff_long8 = 0; + if (datalength<=((tif->tif_flags&TIFF_BIGTIFF)?0x8U:0x4U)) + _TIFFmemcpy(&dir[m].tdir_offset,data,datalength); + else + { + uint64 na,nb; + na=tif->tif_dataoff; + nb=na+datalength; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + nb=(uint32)nb; + if ((nbtif_clientdata,module,"Maximum TIFF file size exceeded"); + return(0); + } + if (!SeekOK(tif,na)) + { + TIFFErrorExt(tif->tif_clientdata,module,"IO error writing tag data"); + return(0); + } + assert(datalength<0x80000000UL); + if (!WriteOK(tif,data,(tmsize_t)datalength)) + { + TIFFErrorExt(tif->tif_clientdata,module,"IO error writing tag data"); + return(0); + } + tif->tif_dataoff=nb; + if (tif->tif_dataoff&1) + tif->tif_dataoff++; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 o; + o=(uint32)na; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong(&o); + _TIFFmemcpy(&dir[m].tdir_offset,&o,4); + } + else + { + dir[m].tdir_offset.toff_long8 = na; + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8(&dir[m].tdir_offset.toff_long8); + } + } + (*ndir)++; + return(1); +} + +/* + * Link the current directory into the directory chain for the file. + */ +static int +TIFFLinkDirectory(TIFF* tif) +{ + static const char module[] = "TIFFLinkDirectory"; + + tif->tif_diroff = (TIFFSeekFile(tif,0,SEEK_END)+1) &~ 1; + + /* + * Handle SubIFDs + */ + if (tif->tif_flags & TIFF_INSUBIFD) + { + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 m; + m = (uint32)tif->tif_diroff; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&m); + (void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET); + if (!WriteOK(tif, &m, 4)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing SubIFD directory link"); + return (0); + } + /* + * Advance to the next SubIFD or, if this is + * the last one configured, revert back to the + * normal directory linkage. + */ + if (--tif->tif_nsubifd) + tif->tif_subifdoff += 4; + else + tif->tif_flags &= ~TIFF_INSUBIFD; + return (1); + } + else + { + uint64 m; + m = tif->tif_diroff; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&m); + (void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET); + if (!WriteOK(tif, &m, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing SubIFD directory link"); + return (0); + } + /* + * Advance to the next SubIFD or, if this is + * the last one configured, revert back to the + * normal directory linkage. + */ + if (--tif->tif_nsubifd) + tif->tif_subifdoff += 8; + else + tif->tif_flags &= ~TIFF_INSUBIFD; + return (1); + } + } + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 m; + uint32 nextdir; + m = (uint32)(tif->tif_diroff); + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&m); + if (tif->tif_header.classic.tiff_diroff == 0) { + /* + * First directory, overwrite offset in header. + */ + tif->tif_header.classic.tiff_diroff = (uint32) tif->tif_diroff; + (void) TIFFSeekFile(tif,4, SEEK_SET); + if (!WriteOK(tif, &m, 4)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Error writing TIFF header"); + return (0); + } + return (1); + } + /* + * Not the first directory, search to the last and append. + */ + nextdir = tif->tif_header.classic.tiff_diroff; + while(1) { + uint16 dircount; + uint32 nextnextdir; + + if (!SeekOK(tif, nextdir) || + !ReadOK(tif, &dircount, 2)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + (void) TIFFSeekFile(tif, + nextdir+2+dircount*12, SEEK_SET); + if (!ReadOK(tif, &nextnextdir, 4)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory link"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&nextnextdir); + if (nextnextdir==0) + { + (void) TIFFSeekFile(tif, + nextdir+2+dircount*12, SEEK_SET); + if (!WriteOK(tif, &m, 4)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + break; + } + nextdir=nextnextdir; + } + } + else + { + uint64 m; + uint64 nextdir; + m = tif->tif_diroff; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&m); + if (tif->tif_header.big.tiff_diroff == 0) { + /* + * First directory, overwrite offset in header. + */ + tif->tif_header.big.tiff_diroff = tif->tif_diroff; + (void) TIFFSeekFile(tif,8, SEEK_SET); + if (!WriteOK(tif, &m, 8)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Error writing TIFF header"); + return (0); + } + return (1); + } + /* + * Not the first directory, search to the last and append. + */ + nextdir = tif->tif_header.big.tiff_diroff; + while(1) { + uint64 dircount64; + uint16 dircount; + uint64 nextnextdir; + + if (!SeekOK(tif, nextdir) || + !ReadOK(tif, &dircount64, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory count"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + if (dircount64>0xFFFF) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Sanity check on tag count failed, likely corrupt TIFF"); + return (0); + } + dircount=(uint16)dircount64; + (void) TIFFSeekFile(tif, + nextdir+8+dircount*20, SEEK_SET); + if (!ReadOK(tif, &nextnextdir, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error fetching directory link"); + return (0); + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&nextnextdir); + if (nextnextdir==0) + { + (void) TIFFSeekFile(tif, + nextdir+8+dircount*20, SEEK_SET); + if (!WriteOK(tif, &m, 8)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + break; + } + nextdir=nextnextdir; + } + } + return (1); +} + +/************************************************************************/ +/* TIFFRewriteField() */ +/* */ +/* Rewrite a field in the directory on disk without regard to */ +/* updating the TIFF directory structure in memory. Currently */ +/* only supported for field that already exist in the on-disk */ +/* directory. Mainly used for updating stripoffset / */ +/* stripbytecount values after the directory is already on */ +/* disk. */ +/* */ +/* Returns zero on failure, and one on success. */ +/************************************************************************/ + +int +_TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype, + tmsize_t count, void* data) +{ + static const char module[] = "TIFFResetField"; + /* const TIFFField* fip = NULL; */ + uint16 dircount; + tmsize_t dirsize; + uint8 direntry_raw[20]; + uint16 entry_tag = 0; + uint16 entry_type = 0; + uint64 entry_count = 0; + uint64 entry_offset = 0; + int value_in_entry = 0; + uint64 read_offset; + uint8 *buf_to_write = NULL; + TIFFDataType datatype; + +/* -------------------------------------------------------------------- */ +/* Find field definition. */ +/* -------------------------------------------------------------------- */ + /*fip =*/ TIFFFindField(tif, tag, TIFF_ANY); + +/* -------------------------------------------------------------------- */ +/* Do some checking this is a straight forward case. */ +/* -------------------------------------------------------------------- */ + if( isMapped(tif) ) + { + TIFFErrorExt( tif->tif_clientdata, module, + "Memory mapped files not currently supported for this operation." ); + return 0; + } + + if( tif->tif_diroff == 0 ) + { + TIFFErrorExt( tif->tif_clientdata, module, + "Attempt to reset field on directory not already on disk." ); + return 0; + } + +/* -------------------------------------------------------------------- */ +/* Read the directory entry count. */ +/* -------------------------------------------------------------------- */ + if (!SeekOK(tif, tif->tif_diroff)) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Seek error accessing TIFF directory", + tif->tif_name); + return 0; + } + + read_offset = tif->tif_diroff; + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if (!ReadOK(tif, &dircount, sizeof (uint16))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not read TIFF directory count", + tif->tif_name); + return 0; + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&dircount); + dirsize = 12; + read_offset += 2; + } else { + uint64 dircount64; + if (!ReadOK(tif, &dircount64, sizeof (uint64))) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not read TIFF directory count", + tif->tif_name); + return 0; + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong8(&dircount64); + dircount = (uint16)dircount64; + dirsize = 20; + read_offset += 8; + } + +/* -------------------------------------------------------------------- */ +/* Read through directory to find target tag. */ +/* -------------------------------------------------------------------- */ + while( dircount > 0 ) + { + if (!ReadOK(tif, direntry_raw, dirsize)) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not read TIFF directory entry.", + tif->tif_name); + return 0; + } + + memcpy( &entry_tag, direntry_raw + 0, sizeof(uint16) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort( &entry_tag ); + + if( entry_tag == tag ) + break; + + read_offset += dirsize; + } + + if( entry_tag != tag ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Could not find tag %d.", + tif->tif_name, tag ); + return 0; + } + +/* -------------------------------------------------------------------- */ +/* Extract the type, count and offset for this entry. */ +/* -------------------------------------------------------------------- */ + memcpy( &entry_type, direntry_raw + 2, sizeof(uint16) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort( &entry_type ); + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 value; + + memcpy( &value, direntry_raw + 4, sizeof(uint32) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong( &value ); + entry_count = value; + + memcpy( &value, direntry_raw + 8, sizeof(uint32) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong( &value ); + entry_offset = value; + } + else + { + memcpy( &entry_count, direntry_raw + 4, sizeof(uint64) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8( &entry_count ); + + memcpy( &entry_offset, direntry_raw + 12, sizeof(uint64) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8( &entry_offset ); + } + +/* -------------------------------------------------------------------- */ +/* What data type do we want to write this as? */ +/* -------------------------------------------------------------------- */ + if( TIFFDataWidth(in_datatype) == 8 && !(tif->tif_flags&TIFF_BIGTIFF) ) + { + if( in_datatype == TIFF_LONG8 ) + datatype = TIFF_LONG; + else if( in_datatype == TIFF_SLONG8 ) + datatype = TIFF_SLONG; + else if( in_datatype == TIFF_IFD8 ) + datatype = TIFF_IFD; + else + datatype = in_datatype; + } + else + datatype = in_datatype; + +/* -------------------------------------------------------------------- */ +/* Prepare buffer of actual data to write. This includes */ +/* swabbing as needed. */ +/* -------------------------------------------------------------------- */ + buf_to_write = + (uint8 *)_TIFFCheckMalloc(tif, count, TIFFDataWidth(datatype), + "for field buffer."); + if (!buf_to_write) + return 0; + + if( datatype == in_datatype ) + memcpy( buf_to_write, data, count * TIFFDataWidth(datatype) ); + else if( datatype == TIFF_SLONG && in_datatype == TIFF_SLONG8 ) + { + tmsize_t i; + + for( i = 0; i < count; i++ ) + { + ((int32 *) buf_to_write)[i] = + (int32) ((int64 *) data)[i]; + if( (int64) ((int32 *) buf_to_write)[i] != ((int64 *) data)[i] ) + { + _TIFFfree( buf_to_write ); + TIFFErrorExt( tif->tif_clientdata, module, + "Value exceeds 32bit range of output type." ); + return 0; + } + } + } + else if( (datatype == TIFF_LONG && in_datatype == TIFF_LONG8) + || (datatype == TIFF_IFD && in_datatype == TIFF_IFD8) ) + { + tmsize_t i; + + for( i = 0; i < count; i++ ) + { + ((uint32 *) buf_to_write)[i] = + (uint32) ((uint64 *) data)[i]; + if( (uint64) ((uint32 *) buf_to_write)[i] != ((uint64 *) data)[i] ) + { + _TIFFfree( buf_to_write ); + TIFFErrorExt( tif->tif_clientdata, module, + "Value exceeds 32bit range of output type." ); + return 0; + } + } + } + + if( TIFFDataWidth(datatype) > 1 && (tif->tif_flags&TIFF_SWAB) ) + { + if( TIFFDataWidth(datatype) == 2 ) + TIFFSwabArrayOfShort( (uint16 *) buf_to_write, count ); + else if( TIFFDataWidth(datatype) == 4 ) + TIFFSwabArrayOfLong( (uint32 *) buf_to_write, count ); + else if( TIFFDataWidth(datatype) == 8 ) + TIFFSwabArrayOfLong8( (uint64 *) buf_to_write, count ); + } + +/* -------------------------------------------------------------------- */ +/* Is this a value that fits into the directory entry? */ +/* -------------------------------------------------------------------- */ + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + if( TIFFDataWidth(datatype) * count <= 4 ) + { + entry_offset = read_offset + 8; + value_in_entry = 1; + } + } + else + { + if( TIFFDataWidth(datatype) * count <= 8 ) + { + entry_offset = read_offset + 12; + value_in_entry = 1; + } + } + +/* -------------------------------------------------------------------- */ +/* If the tag type, and count match, then we just write it out */ +/* over the old values without altering the directory entry at */ +/* all. */ +/* -------------------------------------------------------------------- */ + if( entry_count == (uint64)count && entry_type == (uint16) datatype ) + { + if (!SeekOK(tif, entry_offset)) { + _TIFFfree( buf_to_write ); + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Seek error accessing TIFF directory", + tif->tif_name); + return 0; + } + if (!WriteOK(tif, buf_to_write, count*TIFFDataWidth(datatype))) { + _TIFFfree( buf_to_write ); + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + + _TIFFfree( buf_to_write ); + return 1; + } + +/* -------------------------------------------------------------------- */ +/* Otherwise, we write the new tag data at the end of the file. */ +/* -------------------------------------------------------------------- */ + if( !value_in_entry ) + { + entry_offset = TIFFSeekFile(tif,0,SEEK_END); + + if (!WriteOK(tif, buf_to_write, count*TIFFDataWidth(datatype))) { + _TIFFfree( buf_to_write ); + TIFFErrorExt(tif->tif_clientdata, module, + "Error writing directory link"); + return (0); + } + + _TIFFfree( buf_to_write ); + } + else + { + memcpy( &entry_offset, buf_to_write, count*TIFFDataWidth(datatype)); + } + +/* -------------------------------------------------------------------- */ +/* Adjust the directory entry. */ +/* -------------------------------------------------------------------- */ + entry_type = datatype; + memcpy( direntry_raw + 2, &entry_type, sizeof(uint16) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabShort( (uint16 *) (direntry_raw + 2) ); + + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + uint32 value; + + value = (uint32) entry_count; + memcpy( direntry_raw + 4, &value, sizeof(uint32) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong( (uint32 *) (direntry_raw + 4) ); + + value = (uint32) entry_offset; + memcpy( direntry_raw + 8, &value, sizeof(uint32) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong( (uint32 *) (direntry_raw + 8) ); + } + else + { + memcpy( direntry_raw + 4, &entry_count, sizeof(uint64) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8( (uint64 *) (direntry_raw + 4) ); + + memcpy( direntry_raw + 12, &entry_offset, sizeof(uint64) ); + if (tif->tif_flags&TIFF_SWAB) + TIFFSwabLong8( (uint64 *) (direntry_raw + 12) ); + } + +/* -------------------------------------------------------------------- */ +/* Write the directory entry out to disk. */ +/* -------------------------------------------------------------------- */ + if (!SeekOK(tif, read_offset )) { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Seek error accessing TIFF directory", + tif->tif_name); + return 0; + } + + if (!WriteOK(tif, direntry_raw,dirsize)) + { + TIFFErrorExt(tif->tif_clientdata, module, + "%s: Can not write TIFF directory entry.", + tif->tif_name); + return 0; + } + + return 1; +} +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dumpmode.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dumpmode.c new file mode 100644 index 0000000..a94cf0b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_dumpmode.c @@ -0,0 +1,143 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_dumpmode.c,v 1.14 2011-04-02 20:54:09 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * "Null" Compression Algorithm Support. + */ +#include "tiffiop.h" + +static int +DumpFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +/* + * Encode a hunk of pixels. + */ +static int +DumpModeEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s) +{ + (void) s; + while (cc > 0) { + tmsize_t n; + + n = cc; + if (tif->tif_rawcc + n > tif->tif_rawdatasize) + n = tif->tif_rawdatasize - tif->tif_rawcc; + + assert( n > 0 ); + + /* + * Avoid copy if client has setup raw + * data buffer to avoid extra copy. + */ + if (tif->tif_rawcp != pp) + _TIFFmemcpy(tif->tif_rawcp, pp, n); + tif->tif_rawcp += n; + tif->tif_rawcc += n; + pp += n; + cc -= n; + if (tif->tif_rawcc >= tif->tif_rawdatasize && + !TIFFFlushData1(tif)) + return (-1); + } + return (1); +} + +/* + * Decode a hunk of pixels. + */ +static int +DumpModeDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + static const char module[] = "DumpModeDecode"; + (void) s; + if (tif->tif_rawcc < cc) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, +"Not enough data for scanline %lu, expected a request for at most %I64d bytes, got a request for %I64d bytes", + (unsigned long) tif->tif_row, + (signed __int64) tif->tif_rawcc, + (signed __int64) cc); +#else + TIFFErrorExt(tif->tif_clientdata, module, +"Not enough data for scanline %lu, expected a request for at most %lld bytes, got a request for %lld bytes", + (unsigned long) tif->tif_row, + (signed long long) tif->tif_rawcc, + (signed long long) cc); +#endif + return (0); + } + /* + * Avoid copy if client has setup raw + * data buffer to avoid extra copy. + */ + if (tif->tif_rawcp != buf) + _TIFFmemcpy(buf, tif->tif_rawcp, cc); + tif->tif_rawcp += cc; + tif->tif_rawcc -= cc; + return (1); +} + +/* + * Seek forwards nrows in the current strip. + */ +static int +DumpModeSeek(TIFF* tif, uint32 nrows) +{ + tif->tif_rawcp += nrows * tif->tif_scanlinesize; + tif->tif_rawcc -= nrows * tif->tif_scanlinesize; + return (1); +} + +/* + * Initialize dump mode. + */ +int +TIFFInitDumpMode(TIFF* tif, int scheme) +{ + (void) scheme; + tif->tif_fixuptags = DumpFixupTags; + tif->tif_decoderow = DumpModeDecode; + tif->tif_decodestrip = DumpModeDecode; + tif->tif_decodetile = DumpModeDecode; + tif->tif_encoderow = DumpModeEncode; + tif->tif_encodestrip = DumpModeEncode; + tif->tif_encodetile = DumpModeEncode; + tif->tif_seek = DumpModeSeek; + return (1); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_error.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_error.c new file mode 100644 index 0000000..0bc8b87 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_error.c @@ -0,0 +1,80 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_error.c,v 1.5 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + */ +#include "tiffiop.h" + +TIFFErrorHandlerExt _TIFFerrorHandlerExt = NULL; + +TIFFErrorHandler +TIFFSetErrorHandler(TIFFErrorHandler handler) +{ + TIFFErrorHandler prev = _TIFFerrorHandler; + _TIFFerrorHandler = handler; + return (prev); +} + +TIFFErrorHandlerExt +TIFFSetErrorHandlerExt(TIFFErrorHandlerExt handler) +{ + TIFFErrorHandlerExt prev = _TIFFerrorHandlerExt; + _TIFFerrorHandlerExt = handler; + return (prev); +} + +void +TIFFError(const char* module, const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (_TIFFerrorHandler) + (*_TIFFerrorHandler)(module, fmt, ap); + if (_TIFFerrorHandlerExt) + (*_TIFFerrorHandlerExt)(0, module, fmt, ap); + va_end(ap); +} + +void +TIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (_TIFFerrorHandler) + (*_TIFFerrorHandler)(module, fmt, ap); + if (_TIFFerrorHandlerExt) + (*_TIFFerrorHandlerExt)(fd, module, fmt, ap); + va_end(ap); +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_extension.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_extension.c new file mode 100644 index 0000000..10afd41 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_extension.c @@ -0,0 +1,118 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.7 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Various routines support external extension of the tag set, and other + * application extension capabilities. + */ + +#include "tiffiop.h" + +int TIFFGetTagListCount( TIFF *tif ) + +{ + TIFFDirectory* td = &tif->tif_dir; + + return td->td_customValueCount; +} + +uint32 TIFFGetTagListEntry( TIFF *tif, int tag_index ) + +{ + TIFFDirectory* td = &tif->tif_dir; + + if( tag_index < 0 || tag_index >= td->td_customValueCount ) + return (uint32)(-1); + else + return td->td_customValues[tag_index].info->field_tag; +} + +/* +** This provides read/write access to the TIFFTagMethods within the TIFF +** structure to application code without giving access to the private +** TIFF structure. +*/ +TIFFTagMethods *TIFFAccessTagMethods( TIFF *tif ) + +{ + return &(tif->tif_tagmethods); +} + +void *TIFFGetClientInfo( TIFF *tif, const char *name ) + +{ + TIFFClientInfoLink *link = tif->tif_clientinfo; + + while( link != NULL && strcmp(link->name,name) != 0 ) + link = link->next; + + if( link != NULL ) + return link->data; + else + return NULL; +} + +void TIFFSetClientInfo( TIFF *tif, void *data, const char *name ) + +{ + TIFFClientInfoLink *link = tif->tif_clientinfo; + + /* + ** Do we have an existing link with this name? If so, just + ** set it. + */ + while( link != NULL && strcmp(link->name,name) != 0 ) + link = link->next; + + if( link != NULL ) + { + link->data = data; + return; + } + + /* + ** Create a new link. + */ + + link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink)); + assert (link != NULL); + link->next = tif->tif_clientinfo; + link->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1)); + assert (link->name != NULL); + strcpy(link->name, name); + link->data = data; + + tif->tif_clientinfo = link; +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.c new file mode 100644 index 0000000..2b2dccd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.c @@ -0,0 +1,1595 @@ +/* $Id: tif_fax3.c,v 1.74 2012-06-21 02:01:31 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1990-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef CCITT_SUPPORT +/* + * TIFF Library. + * + * CCITT Group 3 (T.4) and Group 4 (T.6) Compression Support. + * + * This file contains support for decoding and encoding TIFF + * compression algorithms 2, 3, 4, and 32771. + * + * Decoder support is derived, with permission, from the code + * in Frank Cringle's viewfax program; + * Copyright (C) 1990, 1995 Frank D. Cringle. + */ +#include "tif_fax3.h" +#define G3CODES +#include "t4.h" +#include + +/* + * Compression+decompression state blocks are + * derived from this ``base state'' block. + */ +typedef struct { + int rw_mode; /* O_RDONLY for decode, else encode */ + int mode; /* operating mode */ + tmsize_t rowbytes; /* bytes in a decoded scanline */ + uint32 rowpixels; /* pixels in a scanline */ + + uint16 cleanfaxdata; /* CleanFaxData tag */ + uint32 badfaxrun; /* BadFaxRun tag */ + uint32 badfaxlines; /* BadFaxLines tag */ + uint32 groupoptions; /* Group 3/4 options tag */ + + TIFFVGetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ + TIFFPrintMethod printdir; /* super-class method */ +} Fax3BaseState; +#define Fax3State(tif) ((Fax3BaseState*) (tif)->tif_data) + +typedef enum { G3_1D, G3_2D } Ttag; +typedef struct { + Fax3BaseState b; + + /* Decoder state info */ + const unsigned char* bitmap; /* bit reversal table */ + uint32 data; /* current i/o byte/word */ + int bit; /* current i/o bit in byte */ + int EOLcnt; /* count of EOL codes recognized */ + TIFFFaxFillFunc fill; /* fill routine */ + uint32* runs; /* b&w runs for current/previous row */ + uint32* refruns; /* runs for reference line */ + uint32* curruns; /* runs for current line */ + + /* Encoder state info */ + Ttag tag; /* encoding state */ + unsigned char* refline; /* reference line for 2d decoding */ + int k; /* #rows left that can be 2d encoded */ + int maxk; /* max #rows that can be 2d encoded */ + + int line; +} Fax3CodecState; +#define DecoderState(tif) ((Fax3CodecState*) Fax3State(tif)) +#define EncoderState(tif) ((Fax3CodecState*) Fax3State(tif)) + +#define is2DEncoding(sp) (sp->b.groupoptions & GROUP3OPT_2DENCODING) +#define isAligned(p,t) ((((size_t)(p)) & (sizeof (t)-1)) == 0) + +/* + * Group 3 and Group 4 Decoding. + */ + +/* + * These macros glue the TIFF library state to + * the state expected by Frank's decoder. + */ +#define DECLARE_STATE(tif, sp, mod) \ + static const char module[] = mod; \ + Fax3CodecState* sp = DecoderState(tif); \ + int a0; /* reference element */ \ + int lastx = sp->b.rowpixels; /* last element in row */ \ + uint32 BitAcc; /* bit accumulator */ \ + int BitsAvail; /* # valid bits in BitAcc */ \ + int RunLength; /* length of current run */ \ + unsigned char* cp; /* next byte of input data */ \ + unsigned char* ep; /* end of input data */ \ + uint32* pa; /* place to stuff next run */ \ + uint32* thisrun; /* current row's run array */ \ + int EOLcnt; /* # EOL codes recognized */ \ + const unsigned char* bitmap = sp->bitmap; /* input data bit reverser */ \ + const TIFFFaxTabEnt* TabEnt +#define DECLARE_STATE_2D(tif, sp, mod) \ + DECLARE_STATE(tif, sp, mod); \ + int b1; /* next change on prev line */ \ + uint32* pb /* next run in reference line */\ +/* + * Load any state that may be changed during decoding. + */ +#define CACHE_STATE(tif, sp) do { \ + BitAcc = sp->data; \ + BitsAvail = sp->bit; \ + EOLcnt = sp->EOLcnt; \ + cp = (unsigned char*) tif->tif_rawcp; \ + ep = cp + tif->tif_rawcc; \ +} while (0) +/* + * Save state possibly changed during decoding. + */ +#define UNCACHE_STATE(tif, sp) do { \ + sp->bit = BitsAvail; \ + sp->data = BitAcc; \ + sp->EOLcnt = EOLcnt; \ + tif->tif_rawcc -= (tmsize_t)((uint8*) cp - tif->tif_rawcp); \ + tif->tif_rawcp = (uint8*) cp; \ +} while (0) + +/* + * Setup state for decoding a strip. + */ +static int +Fax3PreDecode(TIFF* tif, uint16 s) +{ + Fax3CodecState* sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + sp->bit = 0; /* force initial read */ + sp->data = 0; + sp->EOLcnt = 0; /* force initial scan for EOL */ + /* + * Decoder assumes lsb-to-msb bit order. Note that we select + * this here rather than in Fax3SetupState so that viewers can + * hold the image open, fiddle with the FillOrder tag value, + * and then re-decode the image. Otherwise they'd need to close + * and open the image to get the state reset. + */ + sp->bitmap = + TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); + if (sp->refruns) { /* init reference line to white */ + sp->refruns[0] = (uint32) sp->b.rowpixels; + sp->refruns[1] = 0; + } + sp->line = 0; + return (1); +} + +/* + * Routine for handling various errors/conditions. + * Note how they are "glued into the decoder" by + * overriding the definitions used by the decoder. + */ + +static void +Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0) +{ + TIFFErrorExt(tif->tif_clientdata, module, "Bad code word at line %u of %s %u (x %u)", + line, isTiled(tif) ? "tile" : "strip", + (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), + a0); +} +#define unexpected(table, a0) Fax3Unexpected(module, tif, sp->line, a0) + +static void +Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0) +{ + TIFFErrorExt(tif->tif_clientdata, module, + "Uncompressed data (not supported) at line %u of %s %u (x %u)", + line, isTiled(tif) ? "tile" : "strip", + (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), + a0); +} +#define extension(a0) Fax3Extension(module, tif, sp->line, a0) + +static void +Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 lastx) +{ + TIFFWarningExt(tif->tif_clientdata, module, "%s at line %u of %s %u (got %u, expected %u)", + a0 < lastx ? "Premature EOL" : "Line length mismatch", + line, isTiled(tif) ? "tile" : "strip", + (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), + a0, lastx); +} +#define badlength(a0,lastx) Fax3BadLength(module, tif, sp->line, a0, lastx) + +static void +Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0) +{ + TIFFWarningExt(tif->tif_clientdata, module, "Premature EOF at line %u of %s %u (x %u)", + line, isTiled(tif) ? "tile" : "strip", + (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip), + a0); +} +#define prematureEOF(a0) Fax3PrematureEOF(module, tif, sp->line, a0) + +#define Nop + +/* + * Decode the requested amount of G3 1D-encoded data. + */ +static int +Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + DECLARE_STATE(tif, sp, "Fax3Decode1D"); + (void) s; + if (occ % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (-1); + } + CACHE_STATE(tif, sp); + thisrun = sp->curruns; + while (occ > 0) { + a0 = 0; + RunLength = 0; + pa = thisrun; +#ifdef FAX3_DEBUG + printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); + printf("-------------------- %d\n", tif->tif_row); + fflush(stdout); +#endif + SYNC_EOL(EOF1D); + EXPAND1D(EOF1Da); + (*sp->fill)(buf, thisrun, pa, lastx); + buf += sp->b.rowbytes; + occ -= sp->b.rowbytes; + sp->line++; + continue; + EOF1D: /* premature EOF */ + CLEANUP_RUNS(); + EOF1Da: /* premature EOF */ + (*sp->fill)(buf, thisrun, pa, lastx); + UNCACHE_STATE(tif, sp); + return (-1); + } + UNCACHE_STATE(tif, sp); + return (1); +} + +#define SWAP(t,a,b) { t x; x = (a); (a) = (b); (b) = x; } +/* + * Decode the requested amount of G3 2D-encoded data. + */ +static int +Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + DECLARE_STATE_2D(tif, sp, "Fax3Decode2D"); + int is1D; /* current line is 1d/2d-encoded */ + (void) s; + if (occ % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (-1); + } + CACHE_STATE(tif, sp); + while (occ > 0) { + a0 = 0; + RunLength = 0; + pa = thisrun = sp->curruns; +#ifdef FAX3_DEBUG + printf("\nBitAcc=%08X, BitsAvail = %d EOLcnt = %d", + BitAcc, BitsAvail, EOLcnt); +#endif + SYNC_EOL(EOF2D); + NeedBits8(1, EOF2D); + is1D = GetBits(1); /* 1D/2D-encoding tag bit */ + ClrBits(1); +#ifdef FAX3_DEBUG + printf(" %s\n-------------------- %d\n", + is1D ? "1D" : "2D", tif->tif_row); + fflush(stdout); +#endif + pb = sp->refruns; + b1 = *pb++; + if (is1D) + EXPAND1D(EOF2Da); + else + EXPAND2D(EOF2Da); + (*sp->fill)(buf, thisrun, pa, lastx); + SETVALUE(0); /* imaginary change for reference */ + SWAP(uint32*, sp->curruns, sp->refruns); + buf += sp->b.rowbytes; + occ -= sp->b.rowbytes; + sp->line++; + continue; + EOF2D: /* premature EOF */ + CLEANUP_RUNS(); + EOF2Da: /* premature EOF */ + (*sp->fill)(buf, thisrun, pa, lastx); + UNCACHE_STATE(tif, sp); + return (-1); + } + UNCACHE_STATE(tif, sp); + return (1); +} +#undef SWAP + +/* + * The ZERO & FILL macros must handle spans < 2*sizeof(long) bytes. + * For machines with 64-bit longs this is <16 bytes; otherwise + * this is <8 bytes. We optimize the code here to reflect the + * machine characteristics. + */ +#if SIZEOF_UNSIGNED_LONG == 8 +# define FILL(n, cp) \ + switch (n) { \ + case 15:(cp)[14] = 0xff; case 14:(cp)[13] = 0xff; case 13: (cp)[12] = 0xff;\ + case 12:(cp)[11] = 0xff; case 11:(cp)[10] = 0xff; case 10: (cp)[9] = 0xff;\ + case 9: (cp)[8] = 0xff; case 8: (cp)[7] = 0xff; case 7: (cp)[6] = 0xff;\ + case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; case 4: (cp)[3] = 0xff;\ + case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \ + case 1: (cp)[0] = 0xff; (cp) += (n); case 0: ; \ + } +# define ZERO(n, cp) \ + switch (n) { \ + case 15:(cp)[14] = 0; case 14:(cp)[13] = 0; case 13: (cp)[12] = 0; \ + case 12:(cp)[11] = 0; case 11:(cp)[10] = 0; case 10: (cp)[9] = 0; \ + case 9: (cp)[8] = 0; case 8: (cp)[7] = 0; case 7: (cp)[6] = 0; \ + case 6: (cp)[5] = 0; case 5: (cp)[4] = 0; case 4: (cp)[3] = 0; \ + case 3: (cp)[2] = 0; case 2: (cp)[1] = 0; \ + case 1: (cp)[0] = 0; (cp) += (n); case 0: ; \ + } +#else +# define FILL(n, cp) \ + switch (n) { \ + case 7: (cp)[6] = 0xff; case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; \ + case 4: (cp)[3] = 0xff; case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \ + case 1: (cp)[0] = 0xff; (cp) += (n); case 0: ; \ + } +# define ZERO(n, cp) \ + switch (n) { \ + case 7: (cp)[6] = 0; case 6: (cp)[5] = 0; case 5: (cp)[4] = 0; \ + case 4: (cp)[3] = 0; case 3: (cp)[2] = 0; case 2: (cp)[1] = 0; \ + case 1: (cp)[0] = 0; (cp) += (n); case 0: ; \ + } +#endif + +/* + * Bit-fill a row according to the white/black + * runs generated during G3/G4 decoding. + */ +void +_TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) +{ + static const unsigned char _fillmasks[] = + { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; + unsigned char* cp; + uint32 x, bx, run; + int32 n, nw; + long* lp; + + if ((erun-runs)&1) + *erun++ = 0; + x = 0; + for (; runs < erun; runs += 2) { + run = runs[0]; + if (x+run > lastx || run > lastx ) + run = runs[0] = (uint32) (lastx - x); + if (run) { + cp = buf + (x>>3); + bx = x&7; + if (run > 8-bx) { + if (bx) { /* align to byte boundary */ + *cp++ &= 0xff << (8-bx); + run -= 8-bx; + } + if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */ + if ((n/sizeof (long)) > 1) { + /* + * Align to longword boundary and fill. + */ + for (; n && !isAligned(cp, long); n--) + *cp++ = 0x00; + lp = (long*) cp; + nw = (int32)(n / sizeof (long)); + n -= nw * sizeof (long); + do { + *lp++ = 0L; + } while (--nw); + cp = (unsigned char*) lp; + } + ZERO(n, cp); + run &= 7; + } + if (run) + cp[0] &= 0xff >> run; + } else + cp[0] &= ~(_fillmasks[run]>>bx); + x += runs[0]; + } + run = runs[1]; + if (x+run > lastx || run > lastx ) + run = runs[1] = lastx - x; + if (run) { + cp = buf + (x>>3); + bx = x&7; + if (run > 8-bx) { + if (bx) { /* align to byte boundary */ + *cp++ |= 0xff >> bx; + run -= 8-bx; + } + if( (n = run>>3) != 0 ) { /* multiple bytes to fill */ + if ((n/sizeof (long)) > 1) { + /* + * Align to longword boundary and fill. + */ + for (; n && !isAligned(cp, long); n--) + *cp++ = 0xff; + lp = (long*) cp; + nw = (int32)(n / sizeof (long)); + n -= nw * sizeof (long); + do { + *lp++ = -1L; + } while (--nw); + cp = (unsigned char*) lp; + } + FILL(n, cp); + run &= 7; + } + if (run) + cp[0] |= 0xff00 >> run; + } else + cp[0] |= _fillmasks[run]>>bx; + x += runs[1]; + } + } + assert(x == lastx); +} +#undef ZERO +#undef FILL + +static int +Fax3FixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +/* + * Setup G3/G4-related compression/decompression state + * before data is processed. This routine is called once + * per image -- it sets up different state based on whether + * or not decoding or encoding is being done and whether + * 1D- or 2D-encoded data is involved. + */ +static int +Fax3SetupState(TIFF* tif) +{ + static const char module[] = "Fax3SetupState"; + TIFFDirectory* td = &tif->tif_dir; + Fax3BaseState* sp = Fax3State(tif); + int needsRefLine; + Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif); + tmsize_t rowbytes; + uint32 rowpixels, nruns; + + if (td->td_bitspersample != 1) { + TIFFErrorExt(tif->tif_clientdata, module, + "Bits/sample must be 1 for Group 3/4 encoding/decoding"); + return (0); + } + /* + * Calculate the scanline/tile widths. + */ + if (isTiled(tif)) { + rowbytes = TIFFTileRowSize(tif); + rowpixels = td->td_tilewidth; + } else { + rowbytes = TIFFScanlineSize(tif); + rowpixels = td->td_imagewidth; + } + sp->rowbytes = rowbytes; + sp->rowpixels = rowpixels; + /* + * Allocate any additional space required for decoding/encoding. + */ + needsRefLine = ( + (sp->groupoptions & GROUP3OPT_2DENCODING) || + td->td_compression == COMPRESSION_CCITTFAX4 + ); + + /* + Assure that allocation computations do not overflow. + + TIFFroundup and TIFFSafeMultiply return zero on integer overflow + */ + dsp->runs=(uint32*) NULL; + nruns = TIFFroundup_32(rowpixels,32); + if (needsRefLine) { + nruns = TIFFSafeMultiply(uint32,nruns,2); + } + if ((nruns == 0) || (TIFFSafeMultiply(uint32,nruns,2) == 0)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Row pixels integer overflow (rowpixels %u)", + rowpixels); + return (0); + } + dsp->runs = (uint32*) _TIFFCheckMalloc(tif, + TIFFSafeMultiply(uint32,nruns,2), + sizeof (uint32), + "for Group 3/4 run arrays"); + if (dsp->runs == NULL) + return (0); + memset( dsp->runs, 0, TIFFSafeMultiply(uint32,nruns,2)*sizeof(uint32)); + dsp->curruns = dsp->runs; + if (needsRefLine) + dsp->refruns = dsp->runs + nruns; + else + dsp->refruns = NULL; + if (td->td_compression == COMPRESSION_CCITTFAX3 + && is2DEncoding(dsp)) { /* NB: default is 1D routine */ + tif->tif_decoderow = Fax3Decode2D; + tif->tif_decodestrip = Fax3Decode2D; + tif->tif_decodetile = Fax3Decode2D; + } + + if (needsRefLine) { /* 2d encoding */ + Fax3CodecState* esp = EncoderState(tif); + /* + * 2d encoding requires a scanline + * buffer for the ``reference line''; the + * scanline against which delta encoding + * is referenced. The reference line must + * be initialized to be ``white'' (done elsewhere). + */ + esp->refline = (unsigned char*) _TIFFmalloc(rowbytes); + if (esp->refline == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, + "No space for Group 3/4 reference line"); + return (0); + } + } else /* 1d encoding */ + EncoderState(tif)->refline = NULL; + + return (1); +} + +/* + * CCITT Group 3 FAX Encoding. + */ + +#define Fax3FlushBits(tif, sp) { \ + if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \ + (void) TIFFFlushData1(tif); \ + *(tif)->tif_rawcp++ = (uint8) (sp)->data; \ + (tif)->tif_rawcc++; \ + (sp)->data = 0, (sp)->bit = 8; \ +} +#define _FlushBits(tif) { \ + if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \ + (void) TIFFFlushData1(tif); \ + *(tif)->tif_rawcp++ = (uint8) data; \ + (tif)->tif_rawcc++; \ + data = 0, bit = 8; \ +} +static const int _msbmask[9] = + { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; +#define _PutBits(tif, bits, length) { \ + while (length > bit) { \ + data |= bits >> (length - bit); \ + length -= bit; \ + _FlushBits(tif); \ + } \ + assert( length < 9 ); \ + data |= (bits & _msbmask[length]) << (bit - length); \ + bit -= length; \ + if (bit == 0) \ + _FlushBits(tif); \ +} + +/* + * Write a variable-length bit-value to + * the output stream. Values are + * assumed to be at most 16 bits. + */ +static void +Fax3PutBits(TIFF* tif, unsigned int bits, unsigned int length) +{ + Fax3CodecState* sp = EncoderState(tif); + unsigned int bit = sp->bit; + int data = sp->data; + + _PutBits(tif, bits, length); + + sp->data = data; + sp->bit = bit; +} + +/* + * Write a code to the output stream. + */ +#define putcode(tif, te) Fax3PutBits(tif, (te)->code, (te)->length) + +#ifdef FAX3_DEBUG +#define DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B") +#define DEBUG_PRINT(what,len) { \ + int t; \ + printf("%08X/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len); \ + for (t = length-1; t >= 0; t--) \ + putchar(code & (1<bit; + int data = sp->data; + unsigned int code, length; + + while (span >= 2624) { + const tableentry* te = &tab[63 + (2560>>6)]; + code = te->code, length = te->length; +#ifdef FAX3_DEBUG + DEBUG_PRINT("MakeUp", te->runlen); +#endif + _PutBits(tif, code, length); + span -= te->runlen; + } + if (span >= 64) { + const tableentry* te = &tab[63 + (span>>6)]; + assert(te->runlen == 64*(span>>6)); + code = te->code, length = te->length; +#ifdef FAX3_DEBUG + DEBUG_PRINT("MakeUp", te->runlen); +#endif + _PutBits(tif, code, length); + span -= te->runlen; + } + code = tab[span].code, length = tab[span].length; +#ifdef FAX3_DEBUG + DEBUG_PRINT(" Term", tab[span].runlen); +#endif + _PutBits(tif, code, length); + + sp->data = data; + sp->bit = bit; +} + +/* + * Write an EOL code to the output stream. The zero-fill + * logic for byte-aligning encoded scanlines is handled + * here. We also handle writing the tag bit for the next + * scanline when doing 2d encoding. + */ +static void +Fax3PutEOL(TIFF* tif) +{ + Fax3CodecState* sp = EncoderState(tif); + unsigned int bit = sp->bit; + int data = sp->data; + unsigned int code, length, tparm; + + if (sp->b.groupoptions & GROUP3OPT_FILLBITS) { + /* + * Force bit alignment so EOL will terminate on + * a byte boundary. That is, force the bit alignment + * to 16-12 = 4 before putting out the EOL code. + */ + int align = 8 - 4; + if (align != sp->bit) { + if (align > sp->bit) + align = sp->bit + (8 - align); + else + align = sp->bit - align; + code = 0; + tparm=align; + _PutBits(tif, 0, tparm); + } + } + code = EOL, length = 12; + if (is2DEncoding(sp)) + code = (code<<1) | (sp->tag == G3_1D), length++; + _PutBits(tif, code, length); + + sp->data = data; + sp->bit = bit; +} + +/* + * Reset encoding state at the start of a strip. + */ +static int +Fax3PreEncode(TIFF* tif, uint16 s) +{ + Fax3CodecState* sp = EncoderState(tif); + + (void) s; + assert(sp != NULL); + sp->bit = 8; + sp->data = 0; + sp->tag = G3_1D; + /* + * This is necessary for Group 4; otherwise it isn't + * needed because the first scanline of each strip ends + * up being copied into the refline. + */ + if (sp->refline) + _TIFFmemset(sp->refline, 0x00, sp->b.rowbytes); + if (is2DEncoding(sp)) { + float res = tif->tif_dir.td_yresolution; + /* + * The CCITT spec says that when doing 2d encoding, you + * should only do it on K consecutive scanlines, where K + * depends on the resolution of the image being encoded + * (2 for <= 200 lpi, 4 for > 200 lpi). Since the directory + * code initializes td_yresolution to 0, this code will + * select a K of 2 unless the YResolution tag is set + * appropriately. (Note also that we fudge a little here + * and use 150 lpi to avoid problems with units conversion.) + */ + if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER) + res *= 2.54f; /* convert to inches */ + sp->maxk = (res > 150 ? 4 : 2); + sp->k = sp->maxk-1; + } else + sp->k = sp->maxk = 0; + sp->line = 0; + return (1); +} + +static const unsigned char zeroruns[256] = { + 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */ +}; +static const unsigned char oneruns[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */ + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ +}; + +/* + * On certain systems it pays to inline + * the routines that find pixel spans. + */ +#ifdef VAXC +static int32 find0span(unsigned char*, int32, int32); +static int32 find1span(unsigned char*, int32, int32); +#pragma inline(find0span,find1span) +#endif + +/* + * Find a span of ones or zeros using the supplied + * table. The ``base'' of the bit string is supplied + * along with the start+end bit indices. + */ +inline static int32 +find0span(unsigned char* bp, int32 bs, int32 be) +{ + int32 bits = be - bs; + int32 n, span; + + bp += bs>>3; + /* + * Check partial byte on lhs. + */ + if (bits > 0 && (n = (bs & 7))) { + span = zeroruns[(*bp << n) & 0xff]; + if (span > 8-n) /* table value too generous */ + span = 8-n; + if (span > bits) /* constrain span to bit range */ + span = bits; + if (n+span < 8) /* doesn't extend to edge of byte */ + return (span); + bits -= span; + bp++; + } else + span = 0; + if (bits >= (int32)(2 * 8 * sizeof(long))) { + long* lp; + /* + * Align to longword boundary and check longwords. + */ + while (!isAligned(bp, long)) { + if (*bp != 0x00) + return (span + zeroruns[*bp]); + span += 8, bits -= 8; + bp++; + } + lp = (long*) bp; + while ((bits >= (int32)(8 * sizeof(long))) && (0 == *lp)) { + span += 8*sizeof (long), bits -= 8*sizeof (long); + lp++; + } + bp = (unsigned char*) lp; + } + /* + * Scan full bytes for all 0's. + */ + while (bits >= 8) { + if (*bp != 0x00) /* end of run */ + return (span + zeroruns[*bp]); + span += 8, bits -= 8; + bp++; + } + /* + * Check partial byte on rhs. + */ + if (bits > 0) { + n = zeroruns[*bp]; + span += (n > bits ? bits : n); + } + return (span); +} + +inline static int32 +find1span(unsigned char* bp, int32 bs, int32 be) +{ + int32 bits = be - bs; + int32 n, span; + + bp += bs>>3; + /* + * Check partial byte on lhs. + */ + if (bits > 0 && (n = (bs & 7))) { + span = oneruns[(*bp << n) & 0xff]; + if (span > 8-n) /* table value too generous */ + span = 8-n; + if (span > bits) /* constrain span to bit range */ + span = bits; + if (n+span < 8) /* doesn't extend to edge of byte */ + return (span); + bits -= span; + bp++; + } else + span = 0; + if (bits >= (int32)(2 * 8 * sizeof(long))) { + long* lp; + /* + * Align to longword boundary and check longwords. + */ + while (!isAligned(bp, long)) { + if (*bp != 0xff) + return (span + oneruns[*bp]); + span += 8, bits -= 8; + bp++; + } + lp = (long*) bp; + while ((bits >= (int32)(8 * sizeof(long))) && (~0 == *lp)) { + span += 8*sizeof (long), bits -= 8*sizeof (long); + lp++; + } + bp = (unsigned char*) lp; + } + /* + * Scan full bytes for all 1's. + */ + while (bits >= 8) { + if (*bp != 0xff) /* end of run */ + return (span + oneruns[*bp]); + span += 8, bits -= 8; + bp++; + } + /* + * Check partial byte on rhs. + */ + if (bits > 0) { + n = oneruns[*bp]; + span += (n > bits ? bits : n); + } + return (span); +} + +/* + * Return the offset of the next bit in the range + * [bs..be] that is different from the specified + * color. The end, be, is returned if no such bit + * exists. + */ +#define finddiff(_cp, _bs, _be, _color) \ + (_bs + (_color ? find1span(_cp,_bs,_be) : find0span(_cp,_bs,_be))) +/* + * Like finddiff, but also check the starting bit + * against the end in case start > end. + */ +#define finddiff2(_cp, _bs, _be, _color) \ + (_bs < _be ? finddiff(_cp,_bs,_be,_color) : _be) + +/* + * 1d-encode a row of pixels. The encoding is + * a sequence of all-white or all-black spans + * of pixels encoded with Huffman codes. + */ +static int +Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits) +{ + Fax3CodecState* sp = EncoderState(tif); + int32 span; + uint32 bs = 0; + + for (;;) { + span = find0span(bp, bs, bits); /* white span */ + putspan(tif, span, TIFFFaxWhiteCodes); + bs += span; + if (bs >= bits) + break; + span = find1span(bp, bs, bits); /* black span */ + putspan(tif, span, TIFFFaxBlackCodes); + bs += span; + if (bs >= bits) + break; + } + if (sp->b.mode & (FAXMODE_BYTEALIGN|FAXMODE_WORDALIGN)) { + if (sp->bit != 8) /* byte-align */ + Fax3FlushBits(tif, sp); + if ((sp->b.mode&FAXMODE_WORDALIGN) && + !isAligned(tif->tif_rawcp, uint16)) + Fax3FlushBits(tif, sp); + } + return (1); +} + +static const tableentry horizcode = + { 3, 0x1, 0 }; /* 001 */ +static const tableentry passcode = + { 4, 0x1, 0 }; /* 0001 */ +static const tableentry vcodes[7] = { + { 7, 0x03, 0 }, /* 0000 011 */ + { 6, 0x03, 0 }, /* 0000 11 */ + { 3, 0x03, 0 }, /* 011 */ + { 1, 0x1, 0 }, /* 1 */ + { 3, 0x2, 0 }, /* 010 */ + { 6, 0x02, 0 }, /* 0000 10 */ + { 7, 0x02, 0 } /* 0000 010 */ +}; + +/* + * 2d-encode a row of pixels. Consult the CCITT + * documentation for the algorithm. + */ +static int +Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32 bits) +{ +#define PIXEL(buf,ix) ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1) + uint32 a0 = 0; + uint32 a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0, bits, 0)); + uint32 b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0, bits, 0)); + uint32 a2, b2; + + for (;;) { + b2 = finddiff2(rp, b1, bits, PIXEL(rp,b1)); + if (b2 >= a1) { + int32 d = b1 - a1; + if (!(-3 <= d && d <= 3)) { /* horizontal mode */ + a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1)); + putcode(tif, &horizcode); + if (a0+a1 == 0 || PIXEL(bp, a0) == 0) { + putspan(tif, a1-a0, TIFFFaxWhiteCodes); + putspan(tif, a2-a1, TIFFFaxBlackCodes); + } else { + putspan(tif, a1-a0, TIFFFaxBlackCodes); + putspan(tif, a2-a1, TIFFFaxWhiteCodes); + } + a0 = a2; + } else { /* vertical mode */ + putcode(tif, &vcodes[d+3]); + a0 = a1; + } + } else { /* pass mode */ + putcode(tif, &passcode); + a0 = b2; + } + if (a0 >= bits) + break; + a1 = finddiff(bp, a0, bits, PIXEL(bp,a0)); + b1 = finddiff(rp, a0, bits, !PIXEL(bp,a0)); + b1 = finddiff(rp, b1, bits, PIXEL(bp,a0)); + } + return (1); +#undef PIXEL +} + +/* + * Encode a buffer of pixels. + */ +static int +Fax3Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + static const char module[] = "Fax3Encode"; + Fax3CodecState* sp = EncoderState(tif); + (void) s; + if (cc % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be written"); + return (0); + } + while (cc > 0) { + if ((sp->b.mode & FAXMODE_NOEOL) == 0) + Fax3PutEOL(tif); + if (is2DEncoding(sp)) { + if (sp->tag == G3_1D) { + if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) + return (0); + sp->tag = G3_2D; + } else { + if (!Fax3Encode2DRow(tif, bp, sp->refline, + sp->b.rowpixels)) + return (0); + sp->k--; + } + if (sp->k == 0) { + sp->tag = G3_1D; + sp->k = sp->maxk-1; + } else + _TIFFmemcpy(sp->refline, bp, sp->b.rowbytes); + } else { + if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) + return (0); + } + bp += sp->b.rowbytes; + cc -= sp->b.rowbytes; + } + return (1); +} + +static int +Fax3PostEncode(TIFF* tif) +{ + Fax3CodecState* sp = EncoderState(tif); + + if (sp->bit != 8) + Fax3FlushBits(tif, sp); + return (1); +} + +static void +Fax3Close(TIFF* tif) +{ + if ((Fax3State(tif)->mode & FAXMODE_NORTC) == 0) { + Fax3CodecState* sp = EncoderState(tif); + unsigned int code = EOL; + unsigned int length = 12; + int i; + + if (is2DEncoding(sp)) + code = (code<<1) | (sp->tag == G3_1D), length++; + for (i = 0; i < 6; i++) + Fax3PutBits(tif, code, length); + Fax3FlushBits(tif, sp); + } +} + +static void +Fax3Cleanup(TIFF* tif) +{ + Fax3CodecState* sp = DecoderState(tif); + + assert(sp != 0); + + tif->tif_tagmethods.vgetfield = sp->b.vgetparent; + tif->tif_tagmethods.vsetfield = sp->b.vsetparent; + tif->tif_tagmethods.printdir = sp->b.printdir; + + if (sp->runs) + _TIFFfree(sp->runs); + if (sp->refline) + _TIFFfree(sp->refline); + + _TIFFfree(tif->tif_data); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +#define FIELD_BADFAXLINES (FIELD_CODEC+0) +#define FIELD_CLEANFAXDATA (FIELD_CODEC+1) +#define FIELD_BADFAXRUN (FIELD_CODEC+2) + +#define FIELD_OPTIONS (FIELD_CODEC+7) + +static const TIFFField faxFields[] = { + { TIFFTAG_FAXMODE, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "FaxMode", NULL }, + { TIFFTAG_FAXFILLFUNC, 0, 0, TIFF_ANY, 0, TIFF_SETGET_OTHER, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "FaxFillFunc", NULL }, + { TIFFTAG_BADFAXLINES, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_BADFAXLINES, TRUE, FALSE, "BadFaxLines", NULL }, + { TIFFTAG_CLEANFAXDATA, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UINT16, FIELD_CLEANFAXDATA, TRUE, FALSE, "CleanFaxData", NULL }, + { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_BADFAXRUN, TRUE, FALSE, "ConsecutiveBadFaxLines", NULL }}; +static const TIFFField fax3Fields[] = { + { TIFFTAG_GROUP3OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_OPTIONS, FALSE, FALSE, "Group3Options", NULL }, +}; +static const TIFFField fax4Fields[] = { + { TIFFTAG_GROUP4OPTIONS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UINT32, FIELD_OPTIONS, FALSE, FALSE, "Group4Options", NULL }, +}; + +static int +Fax3VSetField(TIFF* tif, uint32 tag, va_list ap) +{ + Fax3BaseState* sp = Fax3State(tif); + const TIFFField* fip; + + assert(sp != 0); + assert(sp->vsetparent != 0); + + switch (tag) { + case TIFFTAG_FAXMODE: + sp->mode = (int) va_arg(ap, int); + return 1; /* NB: pseudo tag */ + case TIFFTAG_FAXFILLFUNC: + DecoderState(tif)->fill = va_arg(ap, TIFFFaxFillFunc); + return 1; /* NB: pseudo tag */ + case TIFFTAG_GROUP3OPTIONS: + /* XXX: avoid reading options if compression mismatches. */ + if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3) + sp->groupoptions = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_GROUP4OPTIONS: + /* XXX: avoid reading options if compression mismatches. */ + if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) + sp->groupoptions = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_BADFAXLINES: + sp->badfaxlines = (uint32) va_arg(ap, uint32); + break; + case TIFFTAG_CLEANFAXDATA: + sp->cleanfaxdata = (uint16) va_arg(ap, uint16_vap); + break; + case TIFFTAG_CONSECUTIVEBADFAXLINES: + sp->badfaxrun = (uint32) va_arg(ap, uint32); + break; + default: + return (*sp->vsetparent)(tif, tag, ap); + } + + if ((fip = TIFFFieldWithTag(tif, tag))) + TIFFSetFieldBit(tif, fip->field_bit); + else + return 0; + + tif->tif_flags |= TIFF_DIRTYDIRECT; + return 1; +} + +static int +Fax3VGetField(TIFF* tif, uint32 tag, va_list ap) +{ + Fax3BaseState* sp = Fax3State(tif); + + assert(sp != 0); + + switch (tag) { + case TIFFTAG_FAXMODE: + *va_arg(ap, int*) = sp->mode; + break; + case TIFFTAG_FAXFILLFUNC: + *va_arg(ap, TIFFFaxFillFunc*) = DecoderState(tif)->fill; + break; + case TIFFTAG_GROUP3OPTIONS: + case TIFFTAG_GROUP4OPTIONS: + *va_arg(ap, uint32*) = sp->groupoptions; + break; + case TIFFTAG_BADFAXLINES: + *va_arg(ap, uint32*) = sp->badfaxlines; + break; + case TIFFTAG_CLEANFAXDATA: + *va_arg(ap, uint16*) = sp->cleanfaxdata; + break; + case TIFFTAG_CONSECUTIVEBADFAXLINES: + *va_arg(ap, uint32*) = sp->badfaxrun; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return (1); +} + +static void +Fax3PrintDir(TIFF* tif, FILE* fd, long flags) +{ + Fax3BaseState* sp = Fax3State(tif); + + assert(sp != 0); + + (void) flags; + if (TIFFFieldSet(tif,FIELD_OPTIONS)) { + const char* sep = " "; + if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) { + fprintf(fd, " Group 4 Options:"); + if (sp->groupoptions & GROUP4OPT_UNCOMPRESSED) + fprintf(fd, "%suncompressed data", sep); + } else { + + fprintf(fd, " Group 3 Options:"); + if (sp->groupoptions & GROUP3OPT_2DENCODING) + fprintf(fd, "%s2-d encoding", sep), sep = "+"; + if (sp->groupoptions & GROUP3OPT_FILLBITS) + fprintf(fd, "%sEOL padding", sep), sep = "+"; + if (sp->groupoptions & GROUP3OPT_UNCOMPRESSED) + fprintf(fd, "%suncompressed data", sep); + } + fprintf(fd, " (%lu = 0x%lx)\n", + (unsigned long) sp->groupoptions, + (unsigned long) sp->groupoptions); + } + if (TIFFFieldSet(tif,FIELD_CLEANFAXDATA)) { + fprintf(fd, " Fax Data:"); + switch (sp->cleanfaxdata) { + case CLEANFAXDATA_CLEAN: + fprintf(fd, " clean"); + break; + case CLEANFAXDATA_REGENERATED: + fprintf(fd, " receiver regenerated"); + break; + case CLEANFAXDATA_UNCLEAN: + fprintf(fd, " uncorrected errors"); + break; + } + fprintf(fd, " (%u = 0x%x)\n", + sp->cleanfaxdata, sp->cleanfaxdata); + } + if (TIFFFieldSet(tif,FIELD_BADFAXLINES)) + fprintf(fd, " Bad Fax Lines: %lu\n", + (unsigned long) sp->badfaxlines); + if (TIFFFieldSet(tif,FIELD_BADFAXRUN)) + fprintf(fd, " Consecutive Bad Fax Lines: %lu\n", + (unsigned long) sp->badfaxrun); + if (sp->printdir) + (*sp->printdir)(tif, fd, flags); +} + +static int +InitCCITTFax3(TIFF* tif) +{ + static const char module[] = "InitCCITTFax3"; + Fax3BaseState* sp; + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, faxFields, TIFFArrayCount(faxFields))) { + TIFFErrorExt(tif->tif_clientdata, "InitCCITTFax3", + "Merging common CCITT Fax codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) + _TIFFmalloc(sizeof (Fax3CodecState)); + + if (tif->tif_data == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, + "No space for state block"); + return (0); + } + + sp = Fax3State(tif); + sp->rw_mode = tif->tif_mode; + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = Fax3VGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */ + sp->printdir = tif->tif_tagmethods.printdir; + tif->tif_tagmethods.printdir = Fax3PrintDir; /* hook for codec tags */ + sp->groupoptions = 0; + + if (sp->rw_mode == O_RDONLY) /* FIXME: improve for in place update */ + tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */ + DecoderState(tif)->runs = NULL; + TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, _TIFFFax3fillruns); + EncoderState(tif)->refline = NULL; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = Fax3FixupTags; + tif->tif_setupdecode = Fax3SetupState; + tif->tif_predecode = Fax3PreDecode; + tif->tif_decoderow = Fax3Decode1D; + tif->tif_decodestrip = Fax3Decode1D; + tif->tif_decodetile = Fax3Decode1D; + tif->tif_setupencode = Fax3SetupState; + tif->tif_preencode = Fax3PreEncode; + tif->tif_postencode = Fax3PostEncode; + tif->tif_encoderow = Fax3Encode; + tif->tif_encodestrip = Fax3Encode; + tif->tif_encodetile = Fax3Encode; + tif->tif_close = Fax3Close; + tif->tif_cleanup = Fax3Cleanup; + + return (1); +} + +int +TIFFInitCCITTFax3(TIFF* tif, int scheme) +{ + (void) scheme; + if (InitCCITTFax3(tif)) { + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, fax3Fields, + TIFFArrayCount(fax3Fields))) { + TIFFErrorExt(tif->tif_clientdata, "TIFFInitCCITTFax3", + "Merging CCITT Fax 3 codec-specific tags failed"); + return 0; + } + + /* + * The default format is Class/F-style w/o RTC. + */ + return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF); + } else + return 01; +} + +/* + * CCITT Group 4 (T.6) Facsimile-compatible + * Compression Scheme Support. + */ + +#define SWAP(t,a,b) { t x; x = (a); (a) = (b); (b) = x; } +/* + * Decode the requested amount of G4-encoded data. + */ +static int +Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + DECLARE_STATE_2D(tif, sp, "Fax4Decode"); + (void) s; + if (occ % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (-1); + } + CACHE_STATE(tif, sp); + while (occ > 0) { + a0 = 0; + RunLength = 0; + pa = thisrun = sp->curruns; + pb = sp->refruns; + b1 = *pb++; +#ifdef FAX3_DEBUG + printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); + printf("-------------------- %d\n", tif->tif_row); + fflush(stdout); +#endif + EXPAND2D(EOFG4); + if (EOLcnt) + goto EOFG4; + (*sp->fill)(buf, thisrun, pa, lastx); + SETVALUE(0); /* imaginary change for reference */ + SWAP(uint32*, sp->curruns, sp->refruns); + buf += sp->b.rowbytes; + occ -= sp->b.rowbytes; + sp->line++; + continue; + EOFG4: + NeedBits16( 13, BADG4 ); + BADG4: +#ifdef FAX3_DEBUG + if( GetBits(13) != 0x1001 ) + fputs( "Bad EOFB\n", stderr ); +#endif + ClrBits( 13 ); + (*sp->fill)(buf, thisrun, pa, lastx); + UNCACHE_STATE(tif, sp); + return ( sp->line ? 1 : -1); /* don't error on badly-terminated strips */ + } + UNCACHE_STATE(tif, sp); + return (1); +} +#undef SWAP + +/* + * Encode the requested amount of data. + */ +static int +Fax4Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + static const char module[] = "Fax4Encode"; + Fax3CodecState *sp = EncoderState(tif); + (void) s; + if (cc % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be written"); + return (0); + } + while (cc > 0) { + if (!Fax3Encode2DRow(tif, bp, sp->refline, sp->b.rowpixels)) + return (0); + _TIFFmemcpy(sp->refline, bp, sp->b.rowbytes); + bp += sp->b.rowbytes; + cc -= sp->b.rowbytes; + } + return (1); +} + +static int +Fax4PostEncode(TIFF* tif) +{ + Fax3CodecState *sp = EncoderState(tif); + + /* terminate strip w/ EOFB */ + Fax3PutBits(tif, EOL, 12); + Fax3PutBits(tif, EOL, 12); + if (sp->bit != 8) + Fax3FlushBits(tif, sp); + return (1); +} + +int +TIFFInitCCITTFax4(TIFF* tif, int scheme) +{ + (void) scheme; + if (InitCCITTFax3(tif)) { /* reuse G3 support */ + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, fax4Fields, + TIFFArrayCount(fax4Fields))) { + TIFFErrorExt(tif->tif_clientdata, "TIFFInitCCITTFax4", + "Merging CCITT Fax 4 codec-specific tags failed"); + return 0; + } + + tif->tif_decoderow = Fax4Decode; + tif->tif_decodestrip = Fax4Decode; + tif->tif_decodetile = Fax4Decode; + tif->tif_encoderow = Fax4Encode; + tif->tif_encodestrip = Fax4Encode; + tif->tif_encodetile = Fax4Encode; + tif->tif_postencode = Fax4PostEncode; + /* + * Suppress RTC at the end of each strip. + */ + return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_NORTC); + } else + return (0); +} + +/* + * CCITT Group 3 1-D Modified Huffman RLE Compression Support. + * (Compression algorithms 2 and 32771) + */ + +/* + * Decode the requested amount of RLE-encoded data. + */ +static int +Fax3DecodeRLE(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + DECLARE_STATE(tif, sp, "Fax3DecodeRLE"); + int mode = sp->b.mode; + (void) s; + if (occ % sp->b.rowbytes) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (-1); + } + CACHE_STATE(tif, sp); + thisrun = sp->curruns; + while (occ > 0) { + a0 = 0; + RunLength = 0; + pa = thisrun; +#ifdef FAX3_DEBUG + printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); + printf("-------------------- %d\n", tif->tif_row); + fflush(stdout); +#endif + EXPAND1D(EOFRLE); + (*sp->fill)(buf, thisrun, pa, lastx); + /* + * Cleanup at the end of the row. + */ + if (mode & FAXMODE_BYTEALIGN) { + int n = BitsAvail - (BitsAvail &~ 7); + ClrBits(n); + } else if (mode & FAXMODE_WORDALIGN) { + int n = BitsAvail - (BitsAvail &~ 15); + ClrBits(n); + if (BitsAvail == 0 && !isAligned(cp, uint16)) + cp++; + } + buf += sp->b.rowbytes; + occ -= sp->b.rowbytes; + sp->line++; + continue; + EOFRLE: /* premature EOF */ + (*sp->fill)(buf, thisrun, pa, lastx); + UNCACHE_STATE(tif, sp); + return (-1); + } + UNCACHE_STATE(tif, sp); + return (1); +} + +int +TIFFInitCCITTRLE(TIFF* tif, int scheme) +{ + (void) scheme; + if (InitCCITTFax3(tif)) { /* reuse G3 support */ + tif->tif_decoderow = Fax3DecodeRLE; + tif->tif_decodestrip = Fax3DecodeRLE; + tif->tif_decodetile = Fax3DecodeRLE; + /* + * Suppress RTC+EOLs when encoding and byte-align data. + */ + return TIFFSetField(tif, TIFFTAG_FAXMODE, + FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_BYTEALIGN); + } else + return (0); +} + +int +TIFFInitCCITTRLEW(TIFF* tif, int scheme) +{ + (void) scheme; + if (InitCCITTFax3(tif)) { /* reuse G3 support */ + tif->tif_decoderow = Fax3DecodeRLE; + tif->tif_decodestrip = Fax3DecodeRLE; + tif->tif_decodetile = Fax3DecodeRLE; + /* + * Suppress RTC+EOLs when encoding and word-align data. + */ + return TIFFSetField(tif, TIFFTAG_FAXMODE, + FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_WORDALIGN); + } else + return (0); +} +#endif /* CCITT_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.h new file mode 100644 index 0000000..b0f46c9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3.h @@ -0,0 +1,538 @@ +/* $Id: tif_fax3.h,v 1.9 2011-03-10 20:23:07 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1990-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _FAX3_ +#define _FAX3_ +/* + * TIFF Library. + * + * CCITT Group 3 (T.4) and Group 4 (T.6) Decompression Support. + * + * Decoder support is derived, with permission, from the code + * in Frank Cringle's viewfax program; + * Copyright (C) 1990, 1995 Frank D. Cringle. + */ +#include "tiff.h" + +/* + * To override the default routine used to image decoded + * spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC. + * The routine must have the type signature given below; + * for example: + * + * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) + * + * where buf is place to set the bits, runs is the array of b&w run + * lengths (white then black), erun is the last run in the array, and + * lastx is the width of the row in pixels. Fill routines can assume + * the run array has room for at least lastx runs and can overwrite + * data in the run array as needed (e.g. to append zero runs to bring + * the count up to a nice multiple). + */ +typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32); + +/* + * The default run filler; made external for other decoders. + */ +#if defined(__cplusplus) +extern "C" { +#endif +extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32); +#if defined(__cplusplus) +} +#endif + + +/* finite state machine codes */ +#define S_Null 0 +#define S_Pass 1 +#define S_Horiz 2 +#define S_V0 3 +#define S_VR 4 +#define S_VL 5 +#define S_Ext 6 +#define S_TermW 7 +#define S_TermB 8 +#define S_MakeUpW 9 +#define S_MakeUpB 10 +#define S_MakeUp 11 +#define S_EOL 12 + +typedef struct { /* state table entry */ + unsigned char State; /* see above */ + unsigned char Width; /* width of code in bits */ + uint32 Param; /* unsigned 32-bit run length in bits */ +} TIFFFaxTabEnt; + +extern const TIFFFaxTabEnt TIFFFaxMainTable[]; +extern const TIFFFaxTabEnt TIFFFaxWhiteTable[]; +extern const TIFFFaxTabEnt TIFFFaxBlackTable[]; + +/* + * The following macros define the majority of the G3/G4 decoder + * algorithm using the state tables defined elsewhere. To build + * a decoder you need some setup code and some glue code. Note + * that you may also need/want to change the way the NeedBits* + * macros get input data if, for example, you know the data to be + * decoded is properly aligned and oriented (doing so before running + * the decoder can be a big performance win). + * + * Consult the decoder in the TIFF library for an idea of what you + * need to define and setup to make use of these definitions. + * + * NB: to enable a debugging version of these macros define FAX3_DEBUG + * before including this file. Trace output goes to stdout. + */ + +#ifndef EndOfData +#define EndOfData() (cp >= ep) +#endif +/* + * Need <=8 or <=16 bits of input data. Unlike viewfax we + * cannot use/assume a word-aligned, properly bit swizzled + * input data set because data may come from an arbitrarily + * aligned, read-only source such as a memory-mapped file. + * Note also that the viewfax decoder does not check for + * running off the end of the input data buffer. This is + * possible for G3-encoded data because it prescans the input + * data to count EOL markers, but can cause problems for G4 + * data. In any event, we don't prescan and must watch for + * running out of data since we can't permit the library to + * scan past the end of the input data buffer. + * + * Finally, note that we must handle remaindered data at the end + * of a strip specially. The coder asks for a fixed number of + * bits when scanning for the next code. This may be more bits + * than are actually present in the data stream. If we appear + * to run out of data but still have some number of valid bits + * remaining then we makeup the requested amount with zeros and + * return successfully. If the returned data is incorrect then + * we should be called again and get a premature EOF error; + * otherwise we should get the right answer. + */ +#ifndef NeedBits8 +#define NeedBits8(n,eoflab) do { \ + if (BitsAvail < (n)) { \ + if (EndOfData()) { \ + if (BitsAvail == 0) /* no valid bits */ \ + goto eoflab; \ + BitsAvail = (n); /* pad with zeros */ \ + } else { \ + BitAcc |= ((uint32) bitmap[*cp++])<>= (n); \ +} while (0) + +#ifdef FAX3_DEBUG +static const char* StateNames[] = { + "Null ", + "Pass ", + "Horiz ", + "V0 ", + "VR ", + "VL ", + "Ext ", + "TermW ", + "TermB ", + "MakeUpW", + "MakeUpB", + "MakeUp ", + "EOL ", +}; +#define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0') +#define LOOKUP8(wid,tab,eoflab) do { \ + int t; \ + NeedBits8(wid,eoflab); \ + TabEnt = tab + GetBits(wid); \ + printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \ + StateNames[TabEnt->State], TabEnt->Param); \ + for (t = 0; t < TabEnt->Width; t++) \ + DEBUG_SHOW; \ + putchar('\n'); \ + fflush(stdout); \ + ClrBits(TabEnt->Width); \ +} while (0) +#define LOOKUP16(wid,tab,eoflab) do { \ + int t; \ + NeedBits16(wid,eoflab); \ + TabEnt = tab + GetBits(wid); \ + printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \ + StateNames[TabEnt->State], TabEnt->Param); \ + for (t = 0; t < TabEnt->Width; t++) \ + DEBUG_SHOW; \ + putchar('\n'); \ + fflush(stdout); \ + ClrBits(TabEnt->Width); \ +} while (0) + +#define SETVALUE(x) do { \ + *pa++ = RunLength + (x); \ + printf("SETVALUE: %d\t%d\n", RunLength + (x), a0); \ + a0 += x; \ + RunLength = 0; \ +} while (0) +#else +#define LOOKUP8(wid,tab,eoflab) do { \ + NeedBits8(wid,eoflab); \ + TabEnt = tab + GetBits(wid); \ + ClrBits(TabEnt->Width); \ +} while (0) +#define LOOKUP16(wid,tab,eoflab) do { \ + NeedBits16(wid,eoflab); \ + TabEnt = tab + GetBits(wid); \ + ClrBits(TabEnt->Width); \ +} while (0) + +/* + * Append a run to the run length array for the + * current row and reset decoding state. + */ +#define SETVALUE(x) do { \ + *pa++ = RunLength + (x); \ + a0 += (x); \ + RunLength = 0; \ +} while (0) +#endif + +/* + * Synchronize input decoding at the start of each + * row by scanning for an EOL (if appropriate) and + * skipping any trash data that might be present + * after a decoding error. Note that the decoding + * done elsewhere that recognizes an EOL only consumes + * 11 consecutive zero bits. This means that if EOLcnt + * is non-zero then we still need to scan for the final flag + * bit that is part of the EOL code. + */ +#define SYNC_EOL(eoflab) do { \ + if (EOLcnt == 0) { \ + for (;;) { \ + NeedBits16(11,eoflab); \ + if (GetBits(11) == 0) \ + break; \ + ClrBits(1); \ + } \ + } \ + for (;;) { \ + NeedBits8(8,eoflab); \ + if (GetBits(8)) \ + break; \ + ClrBits(8); \ + } \ + while (GetBits(1) == 0) \ + ClrBits(1); \ + ClrBits(1); /* EOL bit */ \ + EOLcnt = 0; /* reset EOL counter/flag */ \ +} while (0) + +/* + * Cleanup the array of runs after decoding a row. + * We adjust final runs to insure the user buffer is not + * overwritten and/or undecoded area is white filled. + */ +#define CLEANUP_RUNS() do { \ + if (RunLength) \ + SETVALUE(0); \ + if (a0 != lastx) { \ + badlength(a0, lastx); \ + while (a0 > lastx && pa > thisrun) \ + a0 -= *--pa; \ + if (a0 < lastx) { \ + if (a0 < 0) \ + a0 = 0; \ + if ((pa-thisrun)&1) \ + SETVALUE(0); \ + SETVALUE(lastx - a0); \ + } else if (a0 > lastx) { \ + SETVALUE(lastx); \ + SETVALUE(0); \ + } \ + } \ +} while (0) + +/* + * Decode a line of 1D-encoded data. + * + * The line expanders are written as macros so that they can be reused + * but still have direct access to the local variables of the "calling" + * function. + * + * Note that unlike the original version we have to explicitly test for + * a0 >= lastx after each black/white run is decoded. This is because + * the original code depended on the input data being zero-padded to + * insure the decoder recognized an EOL before running out of data. + */ +#define EXPAND1D(eoflab) do { \ + for (;;) { \ + for (;;) { \ + LOOKUP16(12, TIFFFaxWhiteTable, eof1d); \ + switch (TabEnt->State) { \ + case S_EOL: \ + EOLcnt = 1; \ + goto done1d; \ + case S_TermW: \ + SETVALUE(TabEnt->Param); \ + goto doneWhite1d; \ + case S_MakeUpW: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + unexpected("WhiteTable", a0); \ + goto done1d; \ + } \ + } \ + doneWhite1d: \ + if (a0 >= lastx) \ + goto done1d; \ + for (;;) { \ + LOOKUP16(13, TIFFFaxBlackTable, eof1d); \ + switch (TabEnt->State) { \ + case S_EOL: \ + EOLcnt = 1; \ + goto done1d; \ + case S_TermB: \ + SETVALUE(TabEnt->Param); \ + goto doneBlack1d; \ + case S_MakeUpB: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + unexpected("BlackTable", a0); \ + goto done1d; \ + } \ + } \ + doneBlack1d: \ + if (a0 >= lastx) \ + goto done1d; \ + if( *(pa-1) == 0 && *(pa-2) == 0 ) \ + pa -= 2; \ + } \ +eof1d: \ + prematureEOF(a0); \ + CLEANUP_RUNS(); \ + goto eoflab; \ +done1d: \ + CLEANUP_RUNS(); \ +} while (0) + +/* + * Update the value of b1 using the array + * of runs for the reference line. + */ +#define CHECK_b1 do { \ + if (pa != thisrun) while (b1 <= a0 && b1 < lastx) { \ + b1 += pb[0] + pb[1]; \ + pb += 2; \ + } \ +} while (0) + +/* + * Expand a row of 2D-encoded data. + */ +#define EXPAND2D(eoflab) do { \ + while (a0 < lastx) { \ + LOOKUP8(7, TIFFFaxMainTable, eof2d); \ + switch (TabEnt->State) { \ + case S_Pass: \ + CHECK_b1; \ + b1 += *pb++; \ + RunLength += b1 - a0; \ + a0 = b1; \ + b1 += *pb++; \ + break; \ + case S_Horiz: \ + if ((pa-thisrun)&1) { \ + for (;;) { /* black first */ \ + LOOKUP16(13, TIFFFaxBlackTable, eof2d); \ + switch (TabEnt->State) { \ + case S_TermB: \ + SETVALUE(TabEnt->Param); \ + goto doneWhite2da; \ + case S_MakeUpB: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + goto badBlack2d; \ + } \ + } \ + doneWhite2da:; \ + for (;;) { /* then white */ \ + LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \ + switch (TabEnt->State) { \ + case S_TermW: \ + SETVALUE(TabEnt->Param); \ + goto doneBlack2da; \ + case S_MakeUpW: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + goto badWhite2d; \ + } \ + } \ + doneBlack2da:; \ + } else { \ + for (;;) { /* white first */ \ + LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \ + switch (TabEnt->State) { \ + case S_TermW: \ + SETVALUE(TabEnt->Param); \ + goto doneWhite2db; \ + case S_MakeUpW: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + goto badWhite2d; \ + } \ + } \ + doneWhite2db:; \ + for (;;) { /* then black */ \ + LOOKUP16(13, TIFFFaxBlackTable, eof2d); \ + switch (TabEnt->State) { \ + case S_TermB: \ + SETVALUE(TabEnt->Param); \ + goto doneBlack2db; \ + case S_MakeUpB: \ + case S_MakeUp: \ + a0 += TabEnt->Param; \ + RunLength += TabEnt->Param; \ + break; \ + default: \ + goto badBlack2d; \ + } \ + } \ + doneBlack2db:; \ + } \ + CHECK_b1; \ + break; \ + case S_V0: \ + CHECK_b1; \ + SETVALUE(b1 - a0); \ + b1 += *pb++; \ + break; \ + case S_VR: \ + CHECK_b1; \ + SETVALUE(b1 - a0 + TabEnt->Param); \ + b1 += *pb++; \ + break; \ + case S_VL: \ + CHECK_b1; \ + if (b1 <= (int) (a0 + TabEnt->Param)) { \ + if (b1 < (int) (a0 + TabEnt->Param) || pa != thisrun) { \ + unexpected("VL", a0); \ + goto eol2d; \ + } \ + } \ + SETVALUE(b1 - a0 - TabEnt->Param); \ + b1 -= *--pb; \ + break; \ + case S_Ext: \ + *pa++ = lastx - a0; \ + extension(a0); \ + goto eol2d; \ + case S_EOL: \ + *pa++ = lastx - a0; \ + NeedBits8(4,eof2d); \ + if (GetBits(4)) \ + unexpected("EOL", a0); \ + ClrBits(4); \ + EOLcnt = 1; \ + goto eol2d; \ + default: \ + badMain2d: \ + unexpected("MainTable", a0); \ + goto eol2d; \ + badBlack2d: \ + unexpected("BlackTable", a0); \ + goto eol2d; \ + badWhite2d: \ + unexpected("WhiteTable", a0); \ + goto eol2d; \ + eof2d: \ + prematureEOF(a0); \ + CLEANUP_RUNS(); \ + goto eoflab; \ + } \ + } \ + if (RunLength) { \ + if (RunLength + a0 < lastx) { \ + /* expect a final V0 */ \ + NeedBits8(1,eof2d); \ + if (!GetBits(1)) \ + goto badMain2d; \ + ClrBits(1); \ + } \ + SETVALUE(0); \ + } \ +eol2d: \ + CLEANUP_RUNS(); \ +} while (0) +#endif /* _FAX3_ */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3sm.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3sm.c new file mode 100644 index 0000000..822191e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_fax3sm.c @@ -0,0 +1,1260 @@ +/* WARNING, this file was automatically generated by the + mkg3states program */ +#include "tiff.h" +#include "tif_fax3.h" + const TIFFFaxTabEnt TIFFFaxMainTable[128] = { +{12,7,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0}, +{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{5,6,2},{3,1,0},{5,3,1},{3,1,0}, +{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0}, +{4,3,1},{3,1,0},{5,7,3},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0}, +{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{4,6,2},{3,1,0}, +{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0}, +{2,3,0},{3,1,0},{4,3,1},{3,1,0},{6,7,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0}, +{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0}, +{5,6,2},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0}, +{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0},{4,7,3},{3,1,0},{5,3,1},{3,1,0}, +{2,3,0},{3,1,0},{4,3,1},{3,1,0},{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0}, +{4,3,1},{3,1,0},{4,6,2},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0}, +{1,4,0},{3,1,0},{5,3,1},{3,1,0},{2,3,0},{3,1,0},{4,3,1},{3,1,0} +}; + const TIFFFaxTabEnt TIFFFaxWhiteTable[4096] = { +{12,11,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6}, +{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7}, +{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8}, +{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1792},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16}, +{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128}, +{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5}, +{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3}, +{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6}, +{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3}, +{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15}, +{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17}, +{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128}, +{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5}, +{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6}, +{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1856},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8}, +{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5}, +{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14}, +{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16}, +{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128}, +{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9}, +{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4}, +{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6}, +{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15}, +{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{11,12,2112},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6}, +{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7}, +{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8}, +{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16}, +{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128}, +{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5}, +{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3}, +{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2368},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6}, +{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3}, +{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15}, +{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17}, +{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128}, +{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5}, +{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6}, +{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8}, +{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5}, +{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14}, +{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16}, +{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128}, +{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{11,12,1984},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9}, +{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4}, +{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6}, +{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15}, +{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6}, +{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7}, +{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8}, +{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1920},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16}, +{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128}, +{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5}, +{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3}, +{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6}, +{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3}, +{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15}, +{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17}, +{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128}, +{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5}, +{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6}, +{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2240},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8}, +{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5}, +{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14}, +{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16}, +{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128}, +{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9}, +{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4}, +{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6}, +{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15}, +{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{11,12,2496},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6}, +{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7}, +{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8}, +{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{12,11,0},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16}, +{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128}, +{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5}, +{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3}, +{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1792},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6}, +{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3}, +{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15}, +{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17}, +{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128}, +{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5}, +{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6}, +{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8}, +{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5}, +{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14}, +{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16}, +{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128}, +{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{11,11,1856},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9}, +{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4}, +{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6}, +{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15}, +{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6}, +{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7}, +{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6},{7,8,31},{7,5,8}, +{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2176},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16}, +{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128}, +{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1600},{7,4,5}, +{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3}, +{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6}, +{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3}, +{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15}, +{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5},{7,8,43},{7,6,17}, +{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128}, +{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5}, +{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,768},{7,4,6}, +{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2432},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6},{7,7,19},{7,5,8}, +{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5}, +{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17},{9,9,1408},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14}, +{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16}, +{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128}, +{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9}, +{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4}, +{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,960},{7,4,6}, +{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15}, +{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{11,12,2048},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6}, +{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7}, +{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6},{7,8,32},{7,5,8}, +{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16}, +{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128}, +{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1536},{7,4,5}, +{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3}, +{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,11,1920},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4}, +{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,896},{7,4,6}, +{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3}, +{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15}, +{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5},{7,8,44},{7,6,17}, +{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128}, +{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5}, +{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6}, +{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7}, +{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8}, +{7,8,55},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5}, +{7,8,53},{7,5,9},{9,8,448},{7,4,6},{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1472},{7,4,5},{7,8,43},{7,6,17},{9,9,1216},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14}, +{7,8,61},{7,4,4},{7,4,2},{7,4,7},{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16}, +{9,9,960},{7,4,6},{7,8,31},{7,5,8},{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,9,704},{7,4,6},{7,8,37},{9,5,128}, +{7,7,25},{7,6,15},{9,8,320},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5}, +{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{11,12,2304},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,7,20},{9,5,128},{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3}, +{7,7,27},{7,4,5},{7,8,40},{7,6,16},{9,9,832},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9}, +{9,8,512},{7,4,6},{7,8,36},{9,5,128},{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{9,9,1600},{7,4,5},{7,8,44},{7,6,17},{9,9,1344},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5}, +{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4}, +{7,4,2},{7,4,7},{7,8,48},{7,4,3},{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1088},{7,4,6}, +{7,8,32},{7,5,8},{7,8,58},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3}, +{7,5,11},{7,4,5},{7,7,26},{7,5,9},{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15}, +{9,8,384},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17}, +{9,7,256},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{0,0,0},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128}, +{7,7,24},{7,6,14},{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5}, +{7,8,39},{7,6,16},{9,8,576},{7,4,6},{7,7,19},{7,5,8},{7,8,55},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,45},{7,4,3},{7,5,11},{7,4,5},{7,8,53},{7,5,9},{9,8,448},{7,4,6}, +{7,8,35},{9,5,128},{7,8,51},{7,6,15},{7,8,63},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3}, +{9,9,1536},{7,4,5},{7,8,43},{7,6,17},{9,9,1280},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,8,29},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9}, +{9,6,1664},{7,4,6},{7,8,33},{9,5,128},{7,8,49},{7,6,14},{7,8,61},{7,4,4},{7,4,2},{7,4,7}, +{7,8,47},{7,4,3},{7,8,59},{7,4,5},{7,8,41},{7,6,16},{9,9,1024},{7,4,6},{7,8,31},{7,5,8}, +{7,8,57},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5}, +{7,7,26},{7,5,9},{9,9,768},{7,4,6},{7,8,37},{9,5,128},{7,7,25},{7,6,15},{9,8,320},{7,4,4}, +{7,4,2},{7,4,7},{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6}, +{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7},{11,12,2560},{7,4,3}, +{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6},{7,7,20},{9,5,128},{7,7,24},{7,6,14}, +{7,7,28},{7,4,4},{7,4,2},{7,4,7},{7,7,23},{7,4,3},{7,7,27},{7,4,5},{7,8,40},{7,6,16}, +{9,9,896},{7,4,6},{7,7,19},{7,5,8},{7,8,56},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7}, +{7,8,46},{7,4,3},{7,5,11},{7,4,5},{7,8,54},{7,5,9},{9,8,512},{7,4,6},{7,8,36},{9,5,128}, +{7,8,52},{7,6,15},{7,8,0},{7,4,4},{7,4,2},{7,4,7},{7,6,13},{7,4,3},{9,9,1728},{7,4,5}, +{7,8,44},{7,6,17},{9,9,1408},{7,4,6},{7,6,1},{7,5,8},{9,6,192},{9,5,64},{7,5,10},{7,4,4}, +{7,4,2},{7,4,7},{7,8,30},{7,4,3},{7,5,11},{7,4,5},{7,6,12},{7,5,9},{9,6,1664},{7,4,6}, +{7,8,34},{9,5,128},{7,8,50},{7,6,14},{7,8,62},{7,4,4},{7,4,2},{7,4,7},{7,8,48},{7,4,3}, +{7,8,60},{7,4,5},{7,8,42},{7,6,16},{9,9,1152},{7,4,6},{7,8,32},{7,5,8},{7,8,58},{9,5,64}, +{7,5,10},{7,4,4},{7,4,2},{7,4,7},{7,7,22},{7,4,3},{7,5,11},{7,4,5},{7,7,26},{7,5,9}, +{9,8,640},{7,4,6},{7,8,38},{9,5,128},{7,7,25},{7,6,15},{9,8,384},{7,4,4},{7,4,2},{7,4,7}, +{7,6,13},{7,4,3},{7,7,18},{7,4,5},{7,7,21},{7,6,17},{9,7,256},{7,4,6},{7,6,1},{7,5,8}, +{9,6,192},{9,5,64},{7,5,10},{7,4,4},{7,4,2},{7,4,7} +}; + const TIFFFaxTabEnt TIFFFaxBlackTable[8192] = { +{12,11,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,23},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,11,25},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,128},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,56},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,30},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,57},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,11,21},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,54},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,52},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,48},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,12,2112},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,44},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,36},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,384},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,28},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,60},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,40},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2368},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,12,1984},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,50},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,34},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1664},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,26},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1408},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,32},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,61},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,42},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,13,1024},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,13,768},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,62},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2240},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,46},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,38},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,512},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,19},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,12,2496},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,25},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,12,192},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1280},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,31},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,58},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,21},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,896},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,640},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,49},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2176},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,45},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,37},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,12,448},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,29},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,13,1536},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,41},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2432},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,12,2048},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,51},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,35},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,320},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,27},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,59},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,33},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,256},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,43},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,13,1152},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,55},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,63},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,12,2304},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,47},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,39},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,53},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2560},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,25},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,12,128},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,56},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,30},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,11,1856},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,57},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,21},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,54},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,52},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,48},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2112},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,44},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,36},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,12,384},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,28},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,60},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,40},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,12,2368},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,1984},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,50},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,34},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,13,1728},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,26},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,13,1472},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,32},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,61},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,42},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1088},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,832},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,62},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,12,2240},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,46},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,38},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,576},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2496},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{12,11,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,18},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,11,1792},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,23},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,20},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,25},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,192},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1344},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,31},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,11,1856},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,58},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,21},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{10,13,960},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,13,704},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,49},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2176},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,45},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,37},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,448},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,29},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1600},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,41},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{11,12,2432},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,18},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,17},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2048},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,51},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,35},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{10,12,320},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,27},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,59},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,33},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{11,11,1920},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,12,256},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,43},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,13,1216},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{0,0,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,8,13},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,9,15},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,55},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,63},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2304},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,12,47},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,12,39},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,12,53},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,12},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{0,0,0},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,8,13},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,11,19},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,11,24},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,11,22},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{11,12,2560},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,7,10},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,10,16},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2},{8,10,0},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2}, +{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{10,10,64},{8,2,3}, +{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,9},{8,2,3},{8,3,1},{8,2,2}, +{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,11},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3}, +{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2}, +{8,8,14},{8,2,3},{8,3,1},{8,2,2},{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,6,8},{8,2,3}, +{8,3,1},{8,2,2},{8,4,5},{8,2,3},{8,3,4},{8,2,2},{8,7,12},{8,2,3},{8,3,1},{8,2,2}, +{8,4,6},{8,2,3},{8,3,4},{8,2,2},{8,5,7},{8,2,3},{8,3,1},{8,2,2},{8,4,5},{8,2,3}, +{8,3,4},{8,2,2} +}; +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_flush.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_flush.c new file mode 100644 index 0000000..fd14e4c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_flush.c @@ -0,0 +1,118 @@ +/* $Id: tif_flush.c,v 1.9 2010-03-31 06:40:10 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + */ +#include "tiffiop.h" + +int +TIFFFlush(TIFF* tif) +{ + if( tif->tif_mode == O_RDONLY ) + return 1; + + if (!TIFFFlushData(tif)) + return (0); + + /* In update (r+) mode we try to detect the case where + only the strip/tile map has been altered, and we try to + rewrite only that portion of the directory without + making any other changes */ + + if( (tif->tif_flags & TIFF_DIRTYSTRIP) + && !(tif->tif_flags & TIFF_DIRTYDIRECT) + && tif->tif_mode == O_RDWR ) + { + uint64 *offsets=NULL, *sizes=NULL; + + if( TIFFIsTiled(tif) ) + { + if( TIFFGetField( tif, TIFFTAG_TILEOFFSETS, &offsets ) + && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &sizes ) + && _TIFFRewriteField( tif, TIFFTAG_TILEOFFSETS, TIFF_LONG8, + tif->tif_dir.td_nstrips, offsets ) + && _TIFFRewriteField( tif, TIFFTAG_TILEBYTECOUNTS, TIFF_LONG8, + tif->tif_dir.td_nstrips, sizes ) ) + { + tif->tif_flags &= ~TIFF_DIRTYSTRIP; + tif->tif_flags &= ~TIFF_BEENWRITING; + return 1; + } + } + else + { + if( TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &offsets ) + && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &sizes ) + && _TIFFRewriteField( tif, TIFFTAG_STRIPOFFSETS, TIFF_LONG8, + tif->tif_dir.td_nstrips, offsets ) + && _TIFFRewriteField( tif, TIFFTAG_STRIPBYTECOUNTS, TIFF_LONG8, + tif->tif_dir.td_nstrips, sizes ) ) + { + tif->tif_flags &= ~TIFF_DIRTYSTRIP; + tif->tif_flags &= ~TIFF_BEENWRITING; + return 1; + } + } + } + + if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP)) + && !TIFFRewriteDirectory(tif)) + return (0); + + return (1); +} + +/* + * Flush buffered data to the file. + * + * Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING + * is not set, so that TIFFFlush() will proceed to write out the directory. + * The documentation says returning 1 is an error indicator, but not having + * been writing isn't exactly a an error. Hopefully this doesn't cause + * problems for other people. + */ +int +TIFFFlushData(TIFF* tif) +{ + if ((tif->tif_flags & TIFF_BEENWRITING) == 0) + return (1); + if (tif->tif_flags & TIFF_POSTENCODE) { + tif->tif_flags &= ~TIFF_POSTENCODE; + if (!(*tif->tif_postencode)(tif)) + return (0); + } + return (TIFFFlushData1(tif)); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_getimage.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_getimage.c new file mode 100644 index 0000000..a85273c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_getimage.c @@ -0,0 +1,2867 @@ +/* $Id: tif_getimage.c,v 1.82 2012-06-06 00:17:49 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Read and return a packed RGBA image. + */ +#include "tiffiop.h" +#include + +static int gtTileContig(TIFFRGBAImage*, uint32*, uint32, uint32); +static int gtTileSeparate(TIFFRGBAImage*, uint32*, uint32, uint32); +static int gtStripContig(TIFFRGBAImage*, uint32*, uint32, uint32); +static int gtStripSeparate(TIFFRGBAImage*, uint32*, uint32, uint32); +static int PickContigCase(TIFFRGBAImage*); +static int PickSeparateCase(TIFFRGBAImage*); + +static int BuildMapUaToAa(TIFFRGBAImage* img); +static int BuildMapBitdepth16To8(TIFFRGBAImage* img); + +static const char photoTag[] = "PhotometricInterpretation"; + +/* + * Helper constants used in Orientation tag handling + */ +#define FLIP_VERTICALLY 0x01 +#define FLIP_HORIZONTALLY 0x02 + +/* + * Color conversion constants. We will define display types here. + */ + +static const TIFFDisplay display_sRGB = { + { /* XYZ -> luminance matrix */ + { 3.2410F, -1.5374F, -0.4986F }, + { -0.9692F, 1.8760F, 0.0416F }, + { 0.0556F, -0.2040F, 1.0570F } + }, + 100.0F, 100.0F, 100.0F, /* Light o/p for reference white */ + 255, 255, 255, /* Pixel values for ref. white */ + 1.0F, 1.0F, 1.0F, /* Residual light o/p for black pixel */ + 2.4F, 2.4F, 2.4F, /* Gamma values for the three guns */ +}; + +/* + * Check the image to see if TIFFReadRGBAImage can deal with it. + * 1/0 is returned according to whether or not the image can + * be handled. If 0 is returned, emsg contains the reason + * why it is being rejected. + */ +int +TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) +{ + TIFFDirectory* td = &tif->tif_dir; + uint16 photometric; + int colorchannels; + + if (!tif->tif_decodestatus) { + sprintf(emsg, "Sorry, requested compression method is not configured"); + return (0); + } + switch (td->td_bitspersample) { + case 1: + case 2: + case 4: + case 8: + case 16: + break; + default: + sprintf(emsg, "Sorry, can not handle images with %d-bit samples", + td->td_bitspersample); + return (0); + } + colorchannels = td->td_samplesperpixel - td->td_extrasamples; + if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) { + switch (colorchannels) { + case 1: + photometric = PHOTOMETRIC_MINISBLACK; + break; + case 3: + photometric = PHOTOMETRIC_RGB; + break; + default: + sprintf(emsg, "Missing needed %s tag", photoTag); + return (0); + } + } + switch (photometric) { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_PALETTE: + if (td->td_planarconfig == PLANARCONFIG_CONTIG + && td->td_samplesperpixel != 1 + && td->td_bitspersample < 8 ) { + sprintf(emsg, + "Sorry, can not handle contiguous data with %s=%d, " + "and %s=%d and Bits/Sample=%d", + photoTag, photometric, + "Samples/pixel", td->td_samplesperpixel, + td->td_bitspersample); + return (0); + } + /* + * We should likely validate that any extra samples are either + * to be ignored, or are alpha, and if alpha we should try to use + * them. But for now we won't bother with this. + */ + break; + case PHOTOMETRIC_YCBCR: + /* + * TODO: if at all meaningful and useful, make more complete + * support check here, or better still, refactor to let supporting + * code decide whether there is support and what meaningfull + * error to return + */ + break; + case PHOTOMETRIC_RGB: + if (colorchannels < 3) { + sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", + "Color channels", colorchannels); + return (0); + } + break; + case PHOTOMETRIC_SEPARATED: + { + uint16 inkset; + TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset); + if (inkset != INKSET_CMYK) { + sprintf(emsg, + "Sorry, can not handle separated image with %s=%d", + "InkSet", inkset); + return 0; + } + if (td->td_samplesperpixel < 4) { + sprintf(emsg, + "Sorry, can not handle separated image with %s=%d", + "Samples/pixel", td->td_samplesperpixel); + return 0; + } + break; + } + case PHOTOMETRIC_LOGL: + if (td->td_compression != COMPRESSION_SGILOG) { + sprintf(emsg, "Sorry, LogL data must have %s=%d", + "Compression", COMPRESSION_SGILOG); + return (0); + } + break; + case PHOTOMETRIC_LOGLUV: + if (td->td_compression != COMPRESSION_SGILOG && + td->td_compression != COMPRESSION_SGILOG24) { + sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d", + "Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24); + return (0); + } + if (td->td_planarconfig != PLANARCONFIG_CONTIG) { + sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d", + "Planarconfiguration", td->td_planarconfig); + return (0); + } + break; + case PHOTOMETRIC_CIELAB: + break; + default: + sprintf(emsg, "Sorry, can not handle image with %s=%d", + photoTag, photometric); + return (0); + } + return (1); +} + +void +TIFFRGBAImageEnd(TIFFRGBAImage* img) +{ + if (img->Map) + _TIFFfree(img->Map), img->Map = NULL; + if (img->BWmap) + _TIFFfree(img->BWmap), img->BWmap = NULL; + if (img->PALmap) + _TIFFfree(img->PALmap), img->PALmap = NULL; + if (img->ycbcr) + _TIFFfree(img->ycbcr), img->ycbcr = NULL; + if (img->cielab) + _TIFFfree(img->cielab), img->cielab = NULL; + if (img->UaToAa) + _TIFFfree(img->UaToAa), img->UaToAa = NULL; + if (img->Bitdepth16To8) + _TIFFfree(img->Bitdepth16To8), img->Bitdepth16To8 = NULL; + + if( img->redcmap ) { + _TIFFfree( img->redcmap ); + _TIFFfree( img->greencmap ); + _TIFFfree( img->bluecmap ); + img->redcmap = img->greencmap = img->bluecmap = NULL; + } +} + +static int +isCCITTCompression(TIFF* tif) +{ + uint16 compress; + TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress); + return (compress == COMPRESSION_CCITTFAX3 || + compress == COMPRESSION_CCITTFAX4 || + compress == COMPRESSION_CCITTRLE || + compress == COMPRESSION_CCITTRLEW); +} + +int +TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) +{ + uint16* sampleinfo; + uint16 extrasamples; + uint16 planarconfig; + uint16 compress; + int colorchannels; + uint16 *red_orig, *green_orig, *blue_orig; + int n_color; + + /* Initialize to normal values */ + img->row_offset = 0; + img->col_offset = 0; + img->redcmap = NULL; + img->greencmap = NULL; + img->bluecmap = NULL; + img->req_orientation = ORIENTATION_BOTLEFT; /* It is the default */ + + img->tif = tif; + img->stoponerr = stop; + TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample); + switch (img->bitspersample) { + case 1: + case 2: + case 4: + case 8: + case 16: + break; + default: + sprintf(emsg, "Sorry, can not handle images with %d-bit samples", + img->bitspersample); + goto fail_return; + } + img->alpha = 0; + TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &img->samplesperpixel); + TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, + &extrasamples, &sampleinfo); + if (extrasamples >= 1) + { + switch (sampleinfo[0]) { + case EXTRASAMPLE_UNSPECIFIED: /* Workaround for some images without */ + if (img->samplesperpixel > 3) /* correct info about alpha channel */ + img->alpha = EXTRASAMPLE_ASSOCALPHA; + break; + case EXTRASAMPLE_ASSOCALPHA: /* data is pre-multiplied */ + case EXTRASAMPLE_UNASSALPHA: /* data is not pre-multiplied */ + img->alpha = sampleinfo[0]; + break; + } + } + +#ifdef DEFAULT_EXTRASAMPLE_AS_ALPHA + if( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) + img->photometric = PHOTOMETRIC_MINISWHITE; + + if( extrasamples == 0 + && img->samplesperpixel == 4 + && img->photometric == PHOTOMETRIC_RGB ) + { + img->alpha = EXTRASAMPLE_ASSOCALPHA; + extrasamples = 1; + } +#endif + + colorchannels = img->samplesperpixel - extrasamples; + TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compress); + TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &planarconfig); + if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) { + switch (colorchannels) { + case 1: + if (isCCITTCompression(tif)) + img->photometric = PHOTOMETRIC_MINISWHITE; + else + img->photometric = PHOTOMETRIC_MINISBLACK; + break; + case 3: + img->photometric = PHOTOMETRIC_RGB; + break; + default: + sprintf(emsg, "Missing needed %s tag", photoTag); + goto fail_return; + } + } + switch (img->photometric) { + case PHOTOMETRIC_PALETTE: + if (!TIFFGetField(tif, TIFFTAG_COLORMAP, + &red_orig, &green_orig, &blue_orig)) { + sprintf(emsg, "Missing required \"Colormap\" tag"); + goto fail_return; + } + + /* copy the colormaps so we can modify them */ + n_color = (1L << img->bitspersample); + img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); + img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); + img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); + if( !img->redcmap || !img->greencmap || !img->bluecmap ) { + sprintf(emsg, "Out of memory for colormap copy"); + goto fail_return; + } + + _TIFFmemcpy( img->redcmap, red_orig, n_color * 2 ); + _TIFFmemcpy( img->greencmap, green_orig, n_color * 2 ); + _TIFFmemcpy( img->bluecmap, blue_orig, n_color * 2 ); + + /* fall thru... */ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + if (planarconfig == PLANARCONFIG_CONTIG + && img->samplesperpixel != 1 + && img->bitspersample < 8 ) { + sprintf(emsg, + "Sorry, can not handle contiguous data with %s=%d, " + "and %s=%d and Bits/Sample=%d", + photoTag, img->photometric, + "Samples/pixel", img->samplesperpixel, + img->bitspersample); + goto fail_return; + } + break; + case PHOTOMETRIC_YCBCR: + /* It would probably be nice to have a reality check here. */ + if (planarconfig == PLANARCONFIG_CONTIG) + /* can rely on libjpeg to convert to RGB */ + /* XXX should restore current state on exit */ + switch (compress) { + case COMPRESSION_JPEG: + /* + * TODO: when complete tests verify complete desubsampling + * and YCbCr handling, remove use of TIFFTAG_JPEGCOLORMODE in + * favor of tif_getimage.c native handling + */ + TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + img->photometric = PHOTOMETRIC_RGB; + break; + default: + /* do nothing */; + break; + } + /* + * TODO: if at all meaningful and useful, make more complete + * support check here, or better still, refactor to let supporting + * code decide whether there is support and what meaningfull + * error to return + */ + break; + case PHOTOMETRIC_RGB: + if (colorchannels < 3) { + sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", + "Color channels", colorchannels); + goto fail_return; + } + break; + case PHOTOMETRIC_SEPARATED: + { + uint16 inkset; + TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset); + if (inkset != INKSET_CMYK) { + sprintf(emsg, "Sorry, can not handle separated image with %s=%d", + "InkSet", inkset); + goto fail_return; + } + if (img->samplesperpixel < 4) { + sprintf(emsg, "Sorry, can not handle separated image with %s=%d", + "Samples/pixel", img->samplesperpixel); + goto fail_return; + } + } + break; + case PHOTOMETRIC_LOGL: + if (compress != COMPRESSION_SGILOG) { + sprintf(emsg, "Sorry, LogL data must have %s=%d", + "Compression", COMPRESSION_SGILOG); + goto fail_return; + } + TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT); + img->photometric = PHOTOMETRIC_MINISBLACK; /* little white lie */ + img->bitspersample = 8; + break; + case PHOTOMETRIC_LOGLUV: + if (compress != COMPRESSION_SGILOG && compress != COMPRESSION_SGILOG24) { + sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d", + "Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24); + goto fail_return; + } + if (planarconfig != PLANARCONFIG_CONTIG) { + sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d", + "Planarconfiguration", planarconfig); + return (0); + } + TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT); + img->photometric = PHOTOMETRIC_RGB; /* little white lie */ + img->bitspersample = 8; + break; + case PHOTOMETRIC_CIELAB: + break; + default: + sprintf(emsg, "Sorry, can not handle image with %s=%d", + photoTag, img->photometric); + goto fail_return; + } + img->Map = NULL; + img->BWmap = NULL; + img->PALmap = NULL; + img->ycbcr = NULL; + img->cielab = NULL; + img->UaToAa = NULL; + img->Bitdepth16To8 = NULL; + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &img->width); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &img->height); + TIFFGetFieldDefaulted(tif, TIFFTAG_ORIENTATION, &img->orientation); + img->isContig = + !(planarconfig == PLANARCONFIG_SEPARATE && img->samplesperpixel > 1); + if (img->isContig) { + if (!PickContigCase(img)) { + sprintf(emsg, "Sorry, can not handle image"); + goto fail_return; + } + } else { + if (!PickSeparateCase(img)) { + sprintf(emsg, "Sorry, can not handle image"); + goto fail_return; + } + } + return 1; + + fail_return: + _TIFFfree( img->redcmap ); + _TIFFfree( img->greencmap ); + _TIFFfree( img->bluecmap ); + img->redcmap = img->greencmap = img->bluecmap = NULL; + return 0; +} + +int +TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + if (img->get == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup"); + return (0); + } + if (img->put.any == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), + "No \"put\" routine setupl; probably can not handle image format"); + return (0); + } + return (*img->get)(img, raster, w, h); +} + +/* + * Read the specified image into an ABGR-format rastertaking in account + * specified orientation. + */ +int +TIFFReadRGBAImageOriented(TIFF* tif, + uint32 rwidth, uint32 rheight, uint32* raster, + int orientation, int stop) +{ + char emsg[1024] = ""; + TIFFRGBAImage img; + int ok; + + if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop, emsg)) { + img.req_orientation = orientation; + /* XXX verify rwidth and rheight against width and height */ + ok = TIFFRGBAImageGet(&img, raster+(rheight-img.height)*rwidth, + rwidth, img.height); + TIFFRGBAImageEnd(&img); + } else { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", emsg); + ok = 0; + } + return (ok); +} + +/* + * Read the specified image into an ABGR-format raster. Use bottom left + * origin for raster by default. + */ +int +TIFFReadRGBAImage(TIFF* tif, + uint32 rwidth, uint32 rheight, uint32* raster, int stop) +{ + return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster, + ORIENTATION_BOTLEFT, stop); +} + +static int +setorientation(TIFFRGBAImage* img) +{ + switch (img->orientation) { + case ORIENTATION_TOPLEFT: + case ORIENTATION_LEFTTOP: + if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_HORIZONTALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_VERTICALLY; + else + return 0; + case ORIENTATION_TOPRIGHT: + case ORIENTATION_RIGHTTOP: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_HORIZONTALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else + return 0; + case ORIENTATION_BOTRIGHT: + case ORIENTATION_RIGHTBOT: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTLEFT || + img->req_orientation == ORIENTATION_LEFTBOT) + return FLIP_HORIZONTALLY; + else + return 0; + case ORIENTATION_BOTLEFT: + case ORIENTATION_LEFTBOT: + if (img->req_orientation == ORIENTATION_TOPLEFT || + img->req_orientation == ORIENTATION_LEFTTOP) + return FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_TOPRIGHT || + img->req_orientation == ORIENTATION_RIGHTTOP) + return FLIP_HORIZONTALLY | FLIP_VERTICALLY; + else if (img->req_orientation == ORIENTATION_BOTRIGHT || + img->req_orientation == ORIENTATION_RIGHTBOT) + return FLIP_HORIZONTALLY; + else + return 0; + default: /* NOTREACHED */ + return 0; + } +} + +/* + * Get an tile-organized image that has + * PlanarConfiguration contiguous if SamplesPerPixel > 1 + * or + * SamplesPerPixel == 1 + */ +static int +gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + tileContigRoutine put = img->put.contig; + uint32 col, row, y, rowstoread; + tmsize_t pos; + uint32 tw, th; + unsigned char* buf; + int32 fromskew, toskew; + uint32 nrow; + int ret = 1, flip; + + buf = (unsigned char*) _TIFFmalloc(TIFFTileSize(tif)); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", "No space for tile buffer"); + return (0); + } + _TIFFmemset(buf, 0, TIFFTileSize(tif)); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + + flip = setorientation(img); + if (flip & FLIP_VERTICALLY) { + y = h - 1; + toskew = -(int32)(tw + w); + } + else { + y = 0; + toskew = -(int32)(tw - w); + } + + for (row = 0; row < h; row += nrow) + { + rowstoread = th - (row + img->row_offset) % th; + nrow = (row + rowstoread > h ? h - row : rowstoread); + for (col = 0; col < w; col += tw) + { + if (TIFFReadTile(tif, buf, col+img->col_offset, + row+img->row_offset, 0, 0)==(tmsize_t)(-1) && img->stoponerr) + { + ret = 0; + break; + } + + pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); + + if (col + tw > w) + { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + uint32 npix = w - col; + fromskew = tw - npix; + (*put)(img, raster+y*w+col, col, y, + npix, nrow, fromskew, toskew + fromskew, buf + pos); + } + else + { + (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos); + } + } + + y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); + } + _TIFFfree(buf); + + if (flip & FLIP_HORIZONTALLY) { + uint32 line; + + for (line = 0; line < h; line++) { + uint32 *left = raster + (line * w); + uint32 *right = left + w - 1; + + while ( left < right ) { + uint32 temp = *left; + *left = *right; + *right = temp; + left++, right--; + } + } + } + + return (ret); +} + +/* + * Get an tile-organized image that has + * SamplesPerPixel > 1 + * PlanarConfiguration separated + * We assume that all such images are RGB. + */ +static int +gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + tileSeparateRoutine put = img->put.separate; + uint32 col, row, y, rowstoread; + tmsize_t pos; + uint32 tw, th; + unsigned char* buf; + unsigned char* p0; + unsigned char* p1; + unsigned char* p2; + unsigned char* pa; + tmsize_t tilesize; + tmsize_t bufsize; + int32 fromskew, toskew; + int alpha = img->alpha; + uint32 nrow; + int ret = 1, flip; + int colorchannels; + + tilesize = TIFFTileSize(tif); + bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,tilesize); + if (bufsize == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtTileSeparate"); + return (0); + } + buf = (unsigned char*) _TIFFmalloc(bufsize); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", "No space for tile buffer"); + return (0); + } + _TIFFmemset(buf, 0, bufsize); + p0 = buf; + p1 = p0 + tilesize; + p2 = p1 + tilesize; + pa = (alpha?(p2+tilesize):NULL); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + + flip = setorientation(img); + if (flip & FLIP_VERTICALLY) { + y = h - 1; + toskew = -(int32)(tw + w); + } + else { + y = 0; + toskew = -(int32)(tw - w); + } + + switch( img->photometric ) + { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_PALETTE: + colorchannels = 1; + p2 = p1 = p0; + break; + + default: + colorchannels = 3; + break; + } + + for (row = 0; row < h; row += nrow) + { + rowstoread = th - (row + img->row_offset) % th; + nrow = (row + rowstoread > h ? h - row : rowstoread); + for (col = 0; col < w; col += tw) + { + if (TIFFReadTile(tif, p0, col+img->col_offset, + row+img->row_offset,0,0)==(tmsize_t)(-1) && img->stoponerr) + { + ret = 0; + break; + } + if (colorchannels > 1 + && TIFFReadTile(tif, p1, col+img->col_offset, + row+img->row_offset,0,1) == (tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + if (colorchannels > 1 + && TIFFReadTile(tif, p2, col+img->col_offset, + row+img->row_offset,0,2) == (tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + if (alpha + && TIFFReadTile(tif,pa,col+img->col_offset, + row+img->row_offset,0,colorchannels) == (tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + + pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); + + if (col + tw > w) + { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + uint32 npix = w - col; + fromskew = tw - npix; + (*put)(img, raster+y*w+col, col, y, + npix, nrow, fromskew, toskew + fromskew, + p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); + } else { + (*put)(img, raster+y*w+col, col, y, + tw, nrow, 0, toskew, p0 + pos, p1 + pos, p2 + pos, (alpha?(pa+pos):NULL)); + } + } + + y += (flip & FLIP_VERTICALLY ?-(int32) nrow : (int32) nrow); + } + + if (flip & FLIP_HORIZONTALLY) { + uint32 line; + + for (line = 0; line < h; line++) { + uint32 *left = raster + (line * w); + uint32 *right = left + w - 1; + + while ( left < right ) { + uint32 temp = *left; + *left = *right; + *right = temp; + left++, right--; + } + } + } + + _TIFFfree(buf); + return (ret); +} + +/* + * Get a strip-organized image that has + * PlanarConfiguration contiguous if SamplesPerPixel > 1 + * or + * SamplesPerPixel == 1 + */ +static int +gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + tileContigRoutine put = img->put.contig; + uint32 row, y, nrow, nrowsub, rowstoread; + tmsize_t pos; + unsigned char* buf; + uint32 rowsperstrip; + uint16 subsamplinghor,subsamplingver; + uint32 imagewidth = img->width; + tmsize_t scanline; + int32 fromskew, toskew; + int ret = 1, flip; + + buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif)); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer"); + return (0); + } + _TIFFmemset(buf, 0, TIFFStripSize(tif)); + + flip = setorientation(img); + if (flip & FLIP_VERTICALLY) { + y = h - 1; + toskew = -(int32)(w + w); + } else { + y = 0; + toskew = -(int32)(w - w); + } + + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRSUBSAMPLING, &subsamplinghor, &subsamplingver); + scanline = TIFFScanlineSize(tif); + fromskew = (w < imagewidth ? imagewidth - w : 0); + for (row = 0; row < h; row += nrow) + { + rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; + nrow = (row + rowstoread > h ? h - row : rowstoread); + nrowsub = nrow; + if ((nrowsub%subsamplingver)!=0) + nrowsub+=subsamplingver-nrowsub%subsamplingver; + if (TIFFReadEncodedStrip(tif, + TIFFComputeStrip(tif,row+img->row_offset, 0), + buf, + ((row + img->row_offset)%rowsperstrip + nrowsub) * scanline)==(tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + + pos = ((row + img->row_offset) % rowsperstrip) * scanline; + (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); + y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); + } + + if (flip & FLIP_HORIZONTALLY) { + uint32 line; + + for (line = 0; line < h; line++) { + uint32 *left = raster + (line * w); + uint32 *right = left + w - 1; + + while ( left < right ) { + uint32 temp = *left; + *left = *right; + *right = temp; + left++, right--; + } + } + } + + _TIFFfree(buf); + return (ret); +} + +/* + * Get a strip-organized image with + * SamplesPerPixel > 1 + * PlanarConfiguration separated + * We assume that all such images are RGB. + */ +static int +gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) +{ + TIFF* tif = img->tif; + tileSeparateRoutine put = img->put.separate; + unsigned char *buf; + unsigned char *p0, *p1, *p2, *pa; + uint32 row, y, nrow, rowstoread; + tmsize_t pos; + tmsize_t scanline; + uint32 rowsperstrip, offset_row; + uint32 imagewidth = img->width; + tmsize_t stripsize; + tmsize_t bufsize; + int32 fromskew, toskew; + int alpha = img->alpha; + int ret = 1, flip, colorchannels; + + stripsize = TIFFStripSize(tif); + bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,stripsize); + if (bufsize == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtStripSeparate"); + return (0); + } + p0 = buf = (unsigned char *)_TIFFmalloc(bufsize); + if (buf == 0) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for tile buffer"); + return (0); + } + _TIFFmemset(buf, 0, bufsize); + p1 = p0 + stripsize; + p2 = p1 + stripsize; + pa = (alpha?(p2+stripsize):NULL); + + flip = setorientation(img); + if (flip & FLIP_VERTICALLY) { + y = h - 1; + toskew = -(int32)(w + w); + } + else { + y = 0; + toskew = -(int32)(w - w); + } + + switch( img->photometric ) + { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_PALETTE: + colorchannels = 1; + p2 = p1 = p0; + break; + + default: + colorchannels = 3; + break; + } + + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + scanline = TIFFScanlineSize(tif); + fromskew = (w < imagewidth ? imagewidth - w : 0); + for (row = 0; row < h; row += nrow) + { + rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; + nrow = (row + rowstoread > h ? h - row : rowstoread); + offset_row = row + img->row_offset; + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), + p0, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + if (colorchannels > 1 + && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), + p1, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + if (colorchannels > 1 + && TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), + p2, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) == (tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + if (alpha) + { + if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, colorchannels), + pa, ((row + img->row_offset)%rowsperstrip + nrow) * scanline)==(tmsize_t)(-1) + && img->stoponerr) + { + ret = 0; + break; + } + } + + pos = ((row + img->row_offset) % rowsperstrip) * scanline; + (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos, + p2 + pos, (alpha?(pa+pos):NULL)); + y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); + } + + if (flip & FLIP_HORIZONTALLY) { + uint32 line; + + for (line = 0; line < h; line++) { + uint32 *left = raster + (line * w); + uint32 *right = left + w - 1; + + while ( left < right ) { + uint32 temp = *left; + *left = *right; + *right = temp; + left++, right--; + } + } + } + + _TIFFfree(buf); + return (ret); +} + +/* + * The following routines move decoded data returned + * from the TIFF library into rasters filled with packed + * ABGR pixels (i.e. suitable for passing to lrecwrite.) + * + * The routines have been created according to the most + * important cases and optimized. PickContigCase and + * PickSeparateCase analyze the parameters and select + * the appropriate "get" and "put" routine to use. + */ +#define REPEAT8(op) REPEAT4(op); REPEAT4(op) +#define REPEAT4(op) REPEAT2(op); REPEAT2(op) +#define REPEAT2(op) op; op +#define CASE8(x,op) \ + switch (x) { \ + case 7: op; case 6: op; case 5: op; \ + case 4: op; case 3: op; case 2: op; \ + case 1: op; \ + } +#define CASE4(x,op) switch (x) { case 3: op; case 2: op; case 1: op; } +#define NOP + +#define UNROLL8(w, op1, op2) { \ + uint32 _x; \ + for (_x = w; _x >= 8; _x -= 8) { \ + op1; \ + REPEAT8(op2); \ + } \ + if (_x > 0) { \ + op1; \ + CASE8(_x,op2); \ + } \ +} +#define UNROLL4(w, op1, op2) { \ + uint32 _x; \ + for (_x = w; _x >= 4; _x -= 4) { \ + op1; \ + REPEAT4(op2); \ + } \ + if (_x > 0) { \ + op1; \ + CASE4(_x,op2); \ + } \ +} +#define UNROLL2(w, op1, op2) { \ + uint32 _x; \ + for (_x = w; _x >= 2; _x -= 2) { \ + op1; \ + REPEAT2(op2); \ + } \ + if (_x) { \ + op1; \ + op2; \ + } \ +} + +#define SKEW(r,g,b,skew) { r += skew; g += skew; b += skew; } +#define SKEW4(r,g,b,a,skew) { r += skew; g += skew; b += skew; a+= skew; } + +#define A1 (((uint32)0xffL)<<24) +#define PACK(r,g,b) \ + ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1) +#define PACK4(r,g,b,a) \ + ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24)) +#define W2B(v) (((v)>>8)&0xff) +/* TODO: PACKW should have be made redundant in favor of Bitdepth16To8 LUT */ +#define PACKW(r,g,b) \ + ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1) +#define PACKW4(r,g,b,a) \ + ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24)) + +#define DECLAREContigPutFunc(name) \ +static void name(\ + TIFFRGBAImage* img, \ + uint32* cp, \ + uint32 x, uint32 y, \ + uint32 w, uint32 h, \ + int32 fromskew, int32 toskew, \ + unsigned char* pp \ +) + +/* + * 8-bit palette => colormap/RGB + */ +DECLAREContigPutFunc(put8bitcmaptile) +{ + uint32** PALmap = img->PALmap; + int samplesperpixel = img->samplesperpixel; + + (void) y; + while (h-- > 0) { + for (x = w; x-- > 0;) + { + *cp++ = PALmap[*pp][0]; + pp += samplesperpixel; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * 4-bit palette => colormap/RGB + */ +DECLAREContigPutFunc(put4bitcmaptile) +{ + uint32** PALmap = img->PALmap; + + (void) x; (void) y; + fromskew /= 2; + while (h-- > 0) { + uint32* bw; + UNROLL2(w, bw = PALmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 2-bit palette => colormap/RGB + */ +DECLAREContigPutFunc(put2bitcmaptile) +{ + uint32** PALmap = img->PALmap; + + (void) x; (void) y; + fromskew /= 4; + while (h-- > 0) { + uint32* bw; + UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 1-bit palette => colormap/RGB + */ +DECLAREContigPutFunc(put1bitcmaptile) +{ + uint32** PALmap = img->PALmap; + + (void) x; (void) y; + fromskew /= 8; + while (h-- > 0) { + uint32* bw; + UNROLL8(w, bw = PALmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit greyscale => colormap/RGB + */ +DECLAREContigPutFunc(putgreytile) +{ + int samplesperpixel = img->samplesperpixel; + uint32** BWmap = img->BWmap; + + (void) y; + while (h-- > 0) { + for (x = w; x-- > 0;) + { + *cp++ = BWmap[*pp][0]; + pp += samplesperpixel; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit greyscale with associated alpha => colormap/RGBA + */ +DECLAREContigPutFunc(putagreytile) +{ + int samplesperpixel = img->samplesperpixel; + uint32** BWmap = img->BWmap; + + (void) y; + while (h-- > 0) { + for (x = w; x-- > 0;) + { + *cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1); + pp += samplesperpixel; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * 16-bit greyscale => colormap/RGB + */ +DECLAREContigPutFunc(put16bitbwtile) +{ + int samplesperpixel = img->samplesperpixel; + uint32** BWmap = img->BWmap; + + (void) y; + while (h-- > 0) { + uint16 *wp = (uint16 *) pp; + + for (x = w; x-- > 0;) + { + /* use high order byte of 16bit value */ + + *cp++ = BWmap[*wp >> 8][0]; + pp += 2 * samplesperpixel; + wp += samplesperpixel; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * 1-bit bilevel => colormap/RGB + */ +DECLAREContigPutFunc(put1bitbwtile) +{ + uint32** BWmap = img->BWmap; + + (void) x; (void) y; + fromskew /= 8; + while (h-- > 0) { + uint32* bw; + UNROLL8(w, bw = BWmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 2-bit greyscale => colormap/RGB + */ +DECLAREContigPutFunc(put2bitbwtile) +{ + uint32** BWmap = img->BWmap; + + (void) x; (void) y; + fromskew /= 4; + while (h-- > 0) { + uint32* bw; + UNROLL4(w, bw = BWmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 4-bit greyscale => colormap/RGB + */ +DECLAREContigPutFunc(put4bitbwtile) +{ + uint32** BWmap = img->BWmap; + + (void) x; (void) y; + fromskew /= 2; + while (h-- > 0) { + uint32* bw; + UNROLL2(w, bw = BWmap[*pp++], *cp++ = *bw++); + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit packed samples, no Map => RGB + */ +DECLAREContigPutFunc(putRGBcontig8bittile) +{ + int samplesperpixel = img->samplesperpixel; + + (void) x; (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + UNROLL8(w, NOP, + *cp++ = PACK(pp[0], pp[1], pp[2]); + pp += samplesperpixel); + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit packed samples => RGBA w/ associated alpha + * (known to have Map == NULL) + */ +DECLAREContigPutFunc(putRGBAAcontig8bittile) +{ + int samplesperpixel = img->samplesperpixel; + + (void) x; (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + UNROLL8(w, NOP, + *cp++ = PACK4(pp[0], pp[1], pp[2], pp[3]); + pp += samplesperpixel); + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit packed samples => RGBA w/ unassociated alpha + * (known to have Map == NULL) + */ +DECLAREContigPutFunc(putRGBUAcontig8bittile) +{ + int samplesperpixel = img->samplesperpixel; + (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + uint32 r, g, b, a; + uint8* m; + for (x = w; x-- > 0;) { + a = pp[3]; + m = img->UaToAa+(a<<8); + r = m[pp[0]]; + g = m[pp[1]]; + b = m[pp[2]]; + *cp++ = PACK4(r,g,b,a); + pp += samplesperpixel; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * 16-bit packed samples => RGB + */ +DECLAREContigPutFunc(putRGBcontig16bittile) +{ + int samplesperpixel = img->samplesperpixel; + uint16 *wp = (uint16 *)pp; + (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + for (x = w; x-- > 0;) { + *cp++ = PACK(img->Bitdepth16To8[wp[0]], + img->Bitdepth16To8[wp[1]], + img->Bitdepth16To8[wp[2]]); + wp += samplesperpixel; + } + cp += toskew; + wp += fromskew; + } +} + +/* + * 16-bit packed samples => RGBA w/ associated alpha + * (known to have Map == NULL) + */ +DECLAREContigPutFunc(putRGBAAcontig16bittile) +{ + int samplesperpixel = img->samplesperpixel; + uint16 *wp = (uint16 *)pp; + (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + for (x = w; x-- > 0;) { + *cp++ = PACK4(img->Bitdepth16To8[wp[0]], + img->Bitdepth16To8[wp[1]], + img->Bitdepth16To8[wp[2]], + img->Bitdepth16To8[wp[3]]); + wp += samplesperpixel; + } + cp += toskew; + wp += fromskew; + } +} + +/* + * 16-bit packed samples => RGBA w/ unassociated alpha + * (known to have Map == NULL) + */ +DECLAREContigPutFunc(putRGBUAcontig16bittile) +{ + int samplesperpixel = img->samplesperpixel; + uint16 *wp = (uint16 *)pp; + (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + uint32 r,g,b,a; + uint8* m; + for (x = w; x-- > 0;) { + a = img->Bitdepth16To8[wp[3]]; + m = img->UaToAa+(a<<8); + r = m[img->Bitdepth16To8[wp[0]]]; + g = m[img->Bitdepth16To8[wp[1]]]; + b = m[img->Bitdepth16To8[wp[2]]]; + *cp++ = PACK4(r,g,b,a); + wp += samplesperpixel; + } + cp += toskew; + wp += fromskew; + } +} + +/* + * 8-bit packed CMYK samples w/o Map => RGB + * + * NB: The conversion of CMYK->RGB is *very* crude. + */ +DECLAREContigPutFunc(putRGBcontig8bitCMYKtile) +{ + int samplesperpixel = img->samplesperpixel; + uint16 r, g, b, k; + + (void) x; (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + UNROLL8(w, NOP, + k = 255 - pp[3]; + r = (k*(255-pp[0]))/255; + g = (k*(255-pp[1]))/255; + b = (k*(255-pp[2]))/255; + *cp++ = PACK(r, g, b); + pp += samplesperpixel); + cp += toskew; + pp += fromskew; + } +} + +/* + * 8-bit packed CMYK samples w/Map => RGB + * + * NB: The conversion of CMYK->RGB is *very* crude. + */ +DECLAREContigPutFunc(putRGBcontig8bitCMYKMaptile) +{ + int samplesperpixel = img->samplesperpixel; + TIFFRGBValue* Map = img->Map; + uint16 r, g, b, k; + + (void) y; + fromskew *= samplesperpixel; + while (h-- > 0) { + for (x = w; x-- > 0;) { + k = 255 - pp[3]; + r = (k*(255-pp[0]))/255; + g = (k*(255-pp[1]))/255; + b = (k*(255-pp[2]))/255; + *cp++ = PACK(Map[r], Map[g], Map[b]); + pp += samplesperpixel; + } + pp += fromskew; + cp += toskew; + } +} + +#define DECLARESepPutFunc(name) \ +static void name(\ + TIFFRGBAImage* img,\ + uint32* cp,\ + uint32 x, uint32 y, \ + uint32 w, uint32 h,\ + int32 fromskew, int32 toskew,\ + unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a\ +) + +/* + * 8-bit unpacked samples => RGB + */ +DECLARESepPutFunc(putRGBseparate8bittile) +{ + (void) img; (void) x; (void) y; (void) a; + while (h-- > 0) { + UNROLL8(w, NOP, *cp++ = PACK(*r++, *g++, *b++)); + SKEW(r, g, b, fromskew); + cp += toskew; + } +} + +/* + * 8-bit unpacked samples => RGBA w/ associated alpha + */ +DECLARESepPutFunc(putRGBAAseparate8bittile) +{ + (void) img; (void) x; (void) y; + while (h-- > 0) { + UNROLL8(w, NOP, *cp++ = PACK4(*r++, *g++, *b++, *a++)); + SKEW4(r, g, b, a, fromskew); + cp += toskew; + } +} + +/* + * 8-bit unpacked CMYK samples => RGBA + */ +DECLARESepPutFunc(putCMYKseparate8bittile) +{ + (void) img; (void) y; + while (h-- > 0) { + uint32 rv, gv, bv, kv; + for (x = w; x-- > 0;) { + kv = 255 - *a++; + rv = (kv*(255-*r++))/255; + gv = (kv*(255-*g++))/255; + bv = (kv*(255-*b++))/255; + *cp++ = PACK4(rv,gv,bv,255); + } + SKEW4(r, g, b, a, fromskew); + cp += toskew; + } +} + +/* + * 8-bit unpacked samples => RGBA w/ unassociated alpha + */ +DECLARESepPutFunc(putRGBUAseparate8bittile) +{ + (void) img; (void) y; + while (h-- > 0) { + uint32 rv, gv, bv, av; + uint8* m; + for (x = w; x-- > 0;) { + av = *a++; + m = img->UaToAa+(av<<8); + rv = m[*r++]; + gv = m[*g++]; + bv = m[*b++]; + *cp++ = PACK4(rv,gv,bv,av); + } + SKEW4(r, g, b, a, fromskew); + cp += toskew; + } +} + +/* + * 16-bit unpacked samples => RGB + */ +DECLARESepPutFunc(putRGBseparate16bittile) +{ + uint16 *wr = (uint16*) r; + uint16 *wg = (uint16*) g; + uint16 *wb = (uint16*) b; + (void) img; (void) y; (void) a; + while (h-- > 0) { + for (x = 0; x < w; x++) + *cp++ = PACK(img->Bitdepth16To8[*wr++], + img->Bitdepth16To8[*wg++], + img->Bitdepth16To8[*wb++]); + SKEW(wr, wg, wb, fromskew); + cp += toskew; + } +} + +/* + * 16-bit unpacked samples => RGBA w/ associated alpha + */ +DECLARESepPutFunc(putRGBAAseparate16bittile) +{ + uint16 *wr = (uint16*) r; + uint16 *wg = (uint16*) g; + uint16 *wb = (uint16*) b; + uint16 *wa = (uint16*) a; + (void) img; (void) y; + while (h-- > 0) { + for (x = 0; x < w; x++) + *cp++ = PACK4(img->Bitdepth16To8[*wr++], + img->Bitdepth16To8[*wg++], + img->Bitdepth16To8[*wb++], + img->Bitdepth16To8[*wa++]); + SKEW4(wr, wg, wb, wa, fromskew); + cp += toskew; + } +} + +/* + * 16-bit unpacked samples => RGBA w/ unassociated alpha + */ +DECLARESepPutFunc(putRGBUAseparate16bittile) +{ + uint16 *wr = (uint16*) r; + uint16 *wg = (uint16*) g; + uint16 *wb = (uint16*) b; + uint16 *wa = (uint16*) a; + (void) img; (void) y; + while (h-- > 0) { + uint32 r,g,b,a; + uint8* m; + for (x = w; x-- > 0;) { + a = img->Bitdepth16To8[*wa++]; + m = img->UaToAa+(a<<8); + r = m[img->Bitdepth16To8[*wr++]]; + g = m[img->Bitdepth16To8[*wg++]]; + b = m[img->Bitdepth16To8[*wb++]]; + *cp++ = PACK4(r,g,b,a); + } + SKEW4(wr, wg, wb, wa, fromskew); + cp += toskew; + } +} + +/* + * 8-bit packed CIE L*a*b 1976 samples => RGB + */ +DECLAREContigPutFunc(putcontig8bitCIELab) +{ + float X, Y, Z; + uint32 r, g, b; + (void) y; + fromskew *= 3; + while (h-- > 0) { + for (x = w; x-- > 0;) { + TIFFCIELabToXYZ(img->cielab, + (unsigned char)pp[0], + (signed char)pp[1], + (signed char)pp[2], + &X, &Y, &Z); + TIFFXYZToRGB(img->cielab, X, Y, Z, &r, &g, &b); + *cp++ = PACK(r, g, b); + pp += 3; + } + cp += toskew; + pp += fromskew; + } +} + +/* + * YCbCr -> RGB conversion and packing routines. + */ + +#define YCbCrtoRGB(dst, Y) { \ + uint32 r, g, b; \ + TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b); \ + dst = PACK(r, g, b); \ +} + +/* + * 8-bit packed YCbCr samples => RGB + * This function is generic for different sampling sizes, + * and can handle blocks sizes that aren't multiples of the + * sampling size. However, it is substantially less optimized + * than the specific sampling cases. It is used as a fallback + * for difficult blocks. + */ +#ifdef notdef +static void putcontig8bitYCbCrGenericTile( + TIFFRGBAImage* img, + uint32* cp, + uint32 x, uint32 y, + uint32 w, uint32 h, + int32 fromskew, int32 toskew, + unsigned char* pp, + int h_group, + int v_group ) + +{ + uint32* cp1 = cp+w+toskew; + uint32* cp2 = cp1+w+toskew; + uint32* cp3 = cp2+w+toskew; + int32 incr = 3*w+4*toskew; + int32 Cb, Cr; + int group_size = v_group * h_group + 2; + + (void) y; + fromskew = (fromskew * group_size) / h_group; + + for( yy = 0; yy < h; yy++ ) + { + unsigned char *pp_line; + int y_line_group = yy / v_group; + int y_remainder = yy - y_line_group * v_group; + + pp_line = pp + v_line_group * + + + for( xx = 0; xx < w; xx++ ) + { + Cb = pp + } + } + for (; h >= 4; h -= 4) { + x = w>>2; + do { + Cb = pp[16]; + Cr = pp[17]; + + YCbCrtoRGB(cp [0], pp[ 0]); + YCbCrtoRGB(cp [1], pp[ 1]); + YCbCrtoRGB(cp [2], pp[ 2]); + YCbCrtoRGB(cp [3], pp[ 3]); + YCbCrtoRGB(cp1[0], pp[ 4]); + YCbCrtoRGB(cp1[1], pp[ 5]); + YCbCrtoRGB(cp1[2], pp[ 6]); + YCbCrtoRGB(cp1[3], pp[ 7]); + YCbCrtoRGB(cp2[0], pp[ 8]); + YCbCrtoRGB(cp2[1], pp[ 9]); + YCbCrtoRGB(cp2[2], pp[10]); + YCbCrtoRGB(cp2[3], pp[11]); + YCbCrtoRGB(cp3[0], pp[12]); + YCbCrtoRGB(cp3[1], pp[13]); + YCbCrtoRGB(cp3[2], pp[14]); + YCbCrtoRGB(cp3[3], pp[15]); + + cp += 4, cp1 += 4, cp2 += 4, cp3 += 4; + pp += 18; + } while (--x); + cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; + pp += fromskew; + } +} +#endif + +/* + * 8-bit packed YCbCr samples w/ 4,4 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr44tile) +{ + uint32* cp1 = cp+w+toskew; + uint32* cp2 = cp1+w+toskew; + uint32* cp3 = cp2+w+toskew; + int32 incr = 3*w+4*toskew; + + (void) y; + /* adjust fromskew */ + fromskew = (fromskew * 18) / 4; + if ((h & 3) == 0 && (w & 3) == 0) { + for (; h >= 4; h -= 4) { + x = w>>2; + do { + int32 Cb = pp[16]; + int32 Cr = pp[17]; + + YCbCrtoRGB(cp [0], pp[ 0]); + YCbCrtoRGB(cp [1], pp[ 1]); + YCbCrtoRGB(cp [2], pp[ 2]); + YCbCrtoRGB(cp [3], pp[ 3]); + YCbCrtoRGB(cp1[0], pp[ 4]); + YCbCrtoRGB(cp1[1], pp[ 5]); + YCbCrtoRGB(cp1[2], pp[ 6]); + YCbCrtoRGB(cp1[3], pp[ 7]); + YCbCrtoRGB(cp2[0], pp[ 8]); + YCbCrtoRGB(cp2[1], pp[ 9]); + YCbCrtoRGB(cp2[2], pp[10]); + YCbCrtoRGB(cp2[3], pp[11]); + YCbCrtoRGB(cp3[0], pp[12]); + YCbCrtoRGB(cp3[1], pp[13]); + YCbCrtoRGB(cp3[2], pp[14]); + YCbCrtoRGB(cp3[3], pp[15]); + + cp += 4, cp1 += 4, cp2 += 4, cp3 += 4; + pp += 18; + } while (--x); + cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; + pp += fromskew; + } + } else { + while (h > 0) { + for (x = w; x > 0;) { + int32 Cb = pp[16]; + int32 Cr = pp[17]; + switch (x) { + default: + switch (h) { + default: YCbCrtoRGB(cp3[3], pp[15]); /* FALLTHROUGH */ + case 3: YCbCrtoRGB(cp2[3], pp[11]); /* FALLTHROUGH */ + case 2: YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 3: + switch (h) { + default: YCbCrtoRGB(cp3[2], pp[14]); /* FALLTHROUGH */ + case 3: YCbCrtoRGB(cp2[2], pp[10]); /* FALLTHROUGH */ + case 2: YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 2: + switch (h) { + default: YCbCrtoRGB(cp3[1], pp[13]); /* FALLTHROUGH */ + case 3: YCbCrtoRGB(cp2[1], pp[ 9]); /* FALLTHROUGH */ + case 2: YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 1: + switch (h) { + default: YCbCrtoRGB(cp3[0], pp[12]); /* FALLTHROUGH */ + case 3: YCbCrtoRGB(cp2[0], pp[ 8]); /* FALLTHROUGH */ + case 2: YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + } + if (x < 4) { + cp += x; cp1 += x; cp2 += x; cp3 += x; + x = 0; + } + else { + cp += 4; cp1 += 4; cp2 += 4; cp3 += 4; + x -= 4; + } + pp += 18; + } + if (h <= 4) + break; + h -= 4; + cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; + pp += fromskew; + } + } +} + +/* + * 8-bit packed YCbCr samples w/ 4,2 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr42tile) +{ + uint32* cp1 = cp+w+toskew; + int32 incr = 2*toskew+w; + + (void) y; + fromskew = (fromskew * 10) / 4; + if ((h & 3) == 0 && (w & 1) == 0) { + for (; h >= 2; h -= 2) { + x = w>>2; + do { + int32 Cb = pp[8]; + int32 Cr = pp[9]; + + YCbCrtoRGB(cp [0], pp[0]); + YCbCrtoRGB(cp [1], pp[1]); + YCbCrtoRGB(cp [2], pp[2]); + YCbCrtoRGB(cp [3], pp[3]); + YCbCrtoRGB(cp1[0], pp[4]); + YCbCrtoRGB(cp1[1], pp[5]); + YCbCrtoRGB(cp1[2], pp[6]); + YCbCrtoRGB(cp1[3], pp[7]); + + cp += 4, cp1 += 4; + pp += 10; + } while (--x); + cp += incr, cp1 += incr; + pp += fromskew; + } + } else { + while (h > 0) { + for (x = w; x > 0;) { + int32 Cb = pp[8]; + int32 Cr = pp[9]; + switch (x) { + default: + switch (h) { + default: YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 3: + switch (h) { + default: YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 2: + switch (h) { + default: YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + case 1: + switch (h) { + default: YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */ + case 1: YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */ + } /* FALLTHROUGH */ + } + if (x < 4) { + cp += x; cp1 += x; + x = 0; + } + else { + cp += 4; cp1 += 4; + x -= 4; + } + pp += 10; + } + if (h <= 2) + break; + h -= 2; + cp += incr, cp1 += incr; + pp += fromskew; + } + } +} + +/* + * 8-bit packed YCbCr samples w/ 4,1 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr41tile) +{ + (void) y; + /* XXX adjust fromskew */ + do { + x = w>>2; + do { + int32 Cb = pp[4]; + int32 Cr = pp[5]; + + YCbCrtoRGB(cp [0], pp[0]); + YCbCrtoRGB(cp [1], pp[1]); + YCbCrtoRGB(cp [2], pp[2]); + YCbCrtoRGB(cp [3], pp[3]); + + cp += 4; + pp += 6; + } while (--x); + + if( (w&3) != 0 ) + { + int32 Cb = pp[4]; + int32 Cr = pp[5]; + + switch( (w&3) ) { + case 3: YCbCrtoRGB(cp [2], pp[2]); + case 2: YCbCrtoRGB(cp [1], pp[1]); + case 1: YCbCrtoRGB(cp [0], pp[0]); + case 0: break; + } + + cp += (w&3); + pp += 6; + } + + cp += toskew; + pp += fromskew; + } while (--h); + +} + +/* + * 8-bit packed YCbCr samples w/ 2,2 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr22tile) +{ + uint32* cp2; + int32 incr = 2*toskew+w; + (void) y; + fromskew = (fromskew / 2) * 6; + cp2 = cp+w+toskew; + while (h>=2) { + x = w; + while (x>=2) { + uint32 Cb = pp[4]; + uint32 Cr = pp[5]; + YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp[1], pp[1]); + YCbCrtoRGB(cp2[0], pp[2]); + YCbCrtoRGB(cp2[1], pp[3]); + cp += 2; + cp2 += 2; + pp += 6; + x -= 2; + } + if (x==1) { + uint32 Cb = pp[4]; + uint32 Cr = pp[5]; + YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp2[0], pp[2]); + cp ++ ; + cp2 ++ ; + pp += 6; + } + cp += incr; + cp2 += incr; + pp += fromskew; + h-=2; + } + if (h==1) { + x = w; + while (x>=2) { + uint32 Cb = pp[4]; + uint32 Cr = pp[5]; + YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp[1], pp[1]); + cp += 2; + cp2 += 2; + pp += 6; + x -= 2; + } + if (x==1) { + uint32 Cb = pp[4]; + uint32 Cr = pp[5]; + YCbCrtoRGB(cp[0], pp[0]); + } + } +} + +/* + * 8-bit packed YCbCr samples w/ 2,1 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr21tile) +{ + (void) y; + fromskew = (fromskew * 4) / 2; + do { + x = w>>1; + do { + int32 Cb = pp[2]; + int32 Cr = pp[3]; + + YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp[1], pp[1]); + + cp += 2; + pp += 4; + } while (--x); + + if( (w&1) != 0 ) + { + int32 Cb = pp[2]; + int32 Cr = pp[3]; + + YCbCrtoRGB(cp[0], pp[0]); + + cp += 1; + pp += 4; + } + + cp += toskew; + pp += fromskew; + } while (--h); +} + +/* + * 8-bit packed YCbCr samples w/ 1,2 subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr12tile) +{ + uint32* cp2; + int32 incr = 2*toskew+w; + (void) y; + fromskew = (fromskew / 2) * 4; + cp2 = cp+w+toskew; + while (h>=2) { + x = w; + do { + uint32 Cb = pp[2]; + uint32 Cr = pp[3]; + YCbCrtoRGB(cp[0], pp[0]); + YCbCrtoRGB(cp2[0], pp[1]); + cp ++; + cp2 ++; + pp += 4; + } while (--x); + cp += incr; + cp2 += incr; + pp += fromskew; + h-=2; + } + if (h==1) { + x = w; + do { + uint32 Cb = pp[2]; + uint32 Cr = pp[3]; + YCbCrtoRGB(cp[0], pp[0]); + cp ++; + pp += 4; + } while (--x); + } +} + +/* + * 8-bit packed YCbCr samples w/ no subsampling => RGB + */ +DECLAREContigPutFunc(putcontig8bitYCbCr11tile) +{ + (void) y; + fromskew *= 3; + do { + x = w; /* was x = w>>1; patched 2000/09/25 warmerda@home.com */ + do { + int32 Cb = pp[1]; + int32 Cr = pp[2]; + + YCbCrtoRGB(*cp++, pp[0]); + + pp += 3; + } while (--x); + cp += toskew; + pp += fromskew; + } while (--h); +} + +/* + * 8-bit packed YCbCr samples w/ no subsampling => RGB + */ +DECLARESepPutFunc(putseparate8bitYCbCr11tile) +{ + (void) y; + (void) a; + /* TODO: naming of input vars is still off, change obfuscating declaration inside define, or resolve obfuscation */ + while (h-- > 0) { + x = w; + do { + uint32 dr, dg, db; + TIFFYCbCrtoRGB(img->ycbcr,*r++,*g++,*b++,&dr,&dg,&db); + *cp++ = PACK(dr,dg,db); + } while (--x); + SKEW(r, g, b, fromskew); + cp += toskew; + } +} +#undef YCbCrtoRGB + +static int +initYCbCrConversion(TIFFRGBAImage* img) +{ + static const char module[] = "initYCbCrConversion"; + + float *luma, *refBlackWhite; + + if (img->ycbcr == NULL) { + img->ycbcr = (TIFFYCbCrToRGB*) _TIFFmalloc( + TIFFroundup_32(sizeof (TIFFYCbCrToRGB), sizeof (long)) + + 4*256*sizeof (TIFFRGBValue) + + 2*256*sizeof (int) + + 3*256*sizeof (int32) + ); + if (img->ycbcr == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, module, + "No space for YCbCr->RGB conversion state"); + return (0); + } + } + + TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRCOEFFICIENTS, &luma); + TIFFGetFieldDefaulted(img->tif, TIFFTAG_REFERENCEBLACKWHITE, + &refBlackWhite); + if (TIFFYCbCrToRGBInit(img->ycbcr, luma, refBlackWhite) < 0) + return(0); + return (1); +} + +static tileContigRoutine +initCIELabConversion(TIFFRGBAImage* img) +{ + static const char module[] = "initCIELabConversion"; + + float *whitePoint; + float refWhite[3]; + + if (!img->cielab) { + img->cielab = (TIFFCIELabToRGB *) + _TIFFmalloc(sizeof(TIFFCIELabToRGB)); + if (!img->cielab) { + TIFFErrorExt(img->tif->tif_clientdata, module, + "No space for CIE L*a*b*->RGB conversion state."); + return NULL; + } + } + + TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint); + refWhite[1] = 100.0F; + refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1]; + refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1]) + / whitePoint[1] * refWhite[1]; + if (TIFFCIELabToRGBInit(img->cielab, &display_sRGB, refWhite) < 0) { + TIFFErrorExt(img->tif->tif_clientdata, module, + "Failed to initialize CIE L*a*b*->RGB conversion state."); + _TIFFfree(img->cielab); + return NULL; + } + + return putcontig8bitCIELab; +} + +/* + * Greyscale images with less than 8 bits/sample are handled + * with a table to avoid lots of shifts and masks. The table + * is setup so that put*bwtile (below) can retrieve 8/bitspersample + * pixel values simply by indexing into the table with one + * number. + */ +static int +makebwmap(TIFFRGBAImage* img) +{ + TIFFRGBValue* Map = img->Map; + int bitspersample = img->bitspersample; + int nsamples = 8 / bitspersample; + int i; + uint32* p; + + if( nsamples == 0 ) + nsamples = 1; + + img->BWmap = (uint32**) _TIFFmalloc( + 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); + if (img->BWmap == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for B&W mapping table"); + return (0); + } + p = (uint32*)(img->BWmap + 256); + for (i = 0; i < 256; i++) { + TIFFRGBValue c; + img->BWmap[i] = p; + switch (bitspersample) { +#define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); + case 1: + GREY(i>>7); + GREY((i>>6)&1); + GREY((i>>5)&1); + GREY((i>>4)&1); + GREY((i>>3)&1); + GREY((i>>2)&1); + GREY((i>>1)&1); + GREY(i&1); + break; + case 2: + GREY(i>>6); + GREY((i>>4)&3); + GREY((i>>2)&3); + GREY(i&3); + break; + case 4: + GREY(i>>4); + GREY(i&0xf); + break; + case 8: + case 16: + GREY(i); + break; + } +#undef GREY + } + return (1); +} + +/* + * Construct a mapping table to convert from the range + * of the data samples to [0,255] --for display. This + * process also handles inverting B&W images when needed. + */ +static int +setupMap(TIFFRGBAImage* img) +{ + int32 x, range; + + range = (int32)((1L<bitspersample)-1); + + /* treat 16 bit the same as eight bit */ + if( img->bitspersample == 16 ) + range = (int32) 255; + + img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); + if (img->Map == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), + "No space for photometric conversion table"); + return (0); + } + if (img->photometric == PHOTOMETRIC_MINISWHITE) { + for (x = 0; x <= range; x++) + img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range); + } else { + for (x = 0; x <= range; x++) + img->Map[x] = (TIFFRGBValue) ((x * 255) / range); + } + if (img->bitspersample <= 16 && + (img->photometric == PHOTOMETRIC_MINISBLACK || + img->photometric == PHOTOMETRIC_MINISWHITE)) { + /* + * Use photometric mapping table to construct + * unpacking tables for samples <= 8 bits. + */ + if (!makebwmap(img)) + return (0); + /* no longer need Map, free it */ + _TIFFfree(img->Map), img->Map = NULL; + } + return (1); +} + +static int +checkcmap(TIFFRGBAImage* img) +{ + uint16* r = img->redcmap; + uint16* g = img->greencmap; + uint16* b = img->bluecmap; + long n = 1L<bitspersample; + + while (n-- > 0) + if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) + return (16); + return (8); +} + +static void +cvtcmap(TIFFRGBAImage* img) +{ + uint16* r = img->redcmap; + uint16* g = img->greencmap; + uint16* b = img->bluecmap; + long i; + + for (i = (1L<bitspersample)-1; i >= 0; i--) { +#define CVT(x) ((uint16)((x)>>8)) + r[i] = CVT(r[i]); + g[i] = CVT(g[i]); + b[i] = CVT(b[i]); +#undef CVT + } +} + +/* + * Palette images with <= 8 bits/sample are handled + * with a table to avoid lots of shifts and masks. The table + * is setup so that put*cmaptile (below) can retrieve 8/bitspersample + * pixel values simply by indexing into the table with one + * number. + */ +static int +makecmap(TIFFRGBAImage* img) +{ + int bitspersample = img->bitspersample; + int nsamples = 8 / bitspersample; + uint16* r = img->redcmap; + uint16* g = img->greencmap; + uint16* b = img->bluecmap; + uint32 *p; + int i; + + img->PALmap = (uint32**) _TIFFmalloc( + 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); + if (img->PALmap == NULL) { + TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for Palette mapping table"); + return (0); + } + p = (uint32*)(img->PALmap + 256); + for (i = 0; i < 256; i++) { + TIFFRGBValue c; + img->PALmap[i] = p; +#define CMAP(x) c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff); + switch (bitspersample) { + case 1: + CMAP(i>>7); + CMAP((i>>6)&1); + CMAP((i>>5)&1); + CMAP((i>>4)&1); + CMAP((i>>3)&1); + CMAP((i>>2)&1); + CMAP((i>>1)&1); + CMAP(i&1); + break; + case 2: + CMAP(i>>6); + CMAP((i>>4)&3); + CMAP((i>>2)&3); + CMAP(i&3); + break; + case 4: + CMAP(i>>4); + CMAP(i&0xf); + break; + case 8: + CMAP(i); + break; + } +#undef CMAP + } + return (1); +} + +/* + * Construct any mapping table used + * by the associated put routine. + */ +static int +buildMap(TIFFRGBAImage* img) +{ + switch (img->photometric) { + case PHOTOMETRIC_RGB: + case PHOTOMETRIC_YCBCR: + case PHOTOMETRIC_SEPARATED: + if (img->bitspersample == 8) + break; + /* fall thru... */ + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_MINISWHITE: + if (!setupMap(img)) + return (0); + break; + case PHOTOMETRIC_PALETTE: + /* + * Convert 16-bit colormap to 8-bit (unless it looks + * like an old-style 8-bit colormap). + */ + if (checkcmap(img) == 16) + cvtcmap(img); + else + TIFFWarningExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "Assuming 8-bit colormap"); + /* + * Use mapping table and colormap to construct + * unpacking tables for samples < 8 bits. + */ + if (img->bitspersample <= 8 && !makecmap(img)) + return (0); + break; + } + return (1); +} + +/* + * Select the appropriate conversion routine for packed data. + */ +static int +PickContigCase(TIFFRGBAImage* img) +{ + img->get = TIFFIsTiled(img->tif) ? gtTileContig : gtStripContig; + img->put.contig = NULL; + switch (img->photometric) { + case PHOTOMETRIC_RGB: + switch (img->bitspersample) { + case 8: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + img->put.contig = putRGBAAcontig8bittile; + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapUaToAa(img)) + img->put.contig = putRGBUAcontig8bittile; + } + else + img->put.contig = putRGBcontig8bittile; + break; + case 16: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + { + if (BuildMapBitdepth16To8(img)) + img->put.contig = putRGBAAcontig16bittile; + } + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapBitdepth16To8(img) && + BuildMapUaToAa(img)) + img->put.contig = putRGBUAcontig16bittile; + } + else + { + if (BuildMapBitdepth16To8(img)) + img->put.contig = putRGBcontig16bittile; + } + break; + } + break; + case PHOTOMETRIC_SEPARATED: + if (buildMap(img)) { + if (img->bitspersample == 8) { + if (!img->Map) + img->put.contig = putRGBcontig8bitCMYKtile; + else + img->put.contig = putRGBcontig8bitCMYKMaptile; + } + } + break; + case PHOTOMETRIC_PALETTE: + if (buildMap(img)) { + switch (img->bitspersample) { + case 8: + img->put.contig = put8bitcmaptile; + break; + case 4: + img->put.contig = put4bitcmaptile; + break; + case 2: + img->put.contig = put2bitcmaptile; + break; + case 1: + img->put.contig = put1bitcmaptile; + break; + } + } + break; + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + if (buildMap(img)) { + switch (img->bitspersample) { + case 16: + img->put.contig = put16bitbwtile; + break; + case 8: + if (img->alpha && img->samplesperpixel == 2) + img->put.contig = putagreytile; + else + img->put.contig = putgreytile; + break; + case 4: + img->put.contig = put4bitbwtile; + break; + case 2: + img->put.contig = put2bitbwtile; + break; + case 1: + img->put.contig = put1bitbwtile; + break; + } + } + break; + case PHOTOMETRIC_YCBCR: + if ((img->bitspersample==8) && (img->samplesperpixel==3)) + { + if (initYCbCrConversion(img)!=0) + { + /* + * The 6.0 spec says that subsampling must be + * one of 1, 2, or 4, and that vertical subsampling + * must always be <= horizontal subsampling; so + * there are only a few possibilities and we just + * enumerate the cases. + * Joris: added support for the [1,2] case, nonetheless, to accomodate + * some OJPEG files + */ + uint16 SubsamplingHor; + uint16 SubsamplingVer; + TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer); + switch ((SubsamplingHor<<4)|SubsamplingVer) { + case 0x44: + img->put.contig = putcontig8bitYCbCr44tile; + break; + case 0x42: + img->put.contig = putcontig8bitYCbCr42tile; + break; + case 0x41: + img->put.contig = putcontig8bitYCbCr41tile; + break; + case 0x22: + img->put.contig = putcontig8bitYCbCr22tile; + break; + case 0x21: + img->put.contig = putcontig8bitYCbCr21tile; + break; + case 0x12: + img->put.contig = putcontig8bitYCbCr12tile; + break; + case 0x11: + img->put.contig = putcontig8bitYCbCr11tile; + break; + } + } + } + break; + case PHOTOMETRIC_CIELAB: + if (buildMap(img)) { + if (img->bitspersample == 8) + img->put.contig = initCIELabConversion(img); + break; + } + } + return ((img->get!=NULL) && (img->put.contig!=NULL)); +} + +/* + * Select the appropriate conversion routine for unpacked data. + * + * NB: we assume that unpacked single channel data is directed + * to the "packed routines. + */ +static int +PickSeparateCase(TIFFRGBAImage* img) +{ + img->get = TIFFIsTiled(img->tif) ? gtTileSeparate : gtStripSeparate; + img->put.separate = NULL; + switch (img->photometric) { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + /* greyscale images processed pretty much as RGB by gtTileSeparate */ + case PHOTOMETRIC_RGB: + switch (img->bitspersample) { + case 8: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + img->put.separate = putRGBAAseparate8bittile; + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapUaToAa(img)) + img->put.separate = putRGBUAseparate8bittile; + } + else + img->put.separate = putRGBseparate8bittile; + break; + case 16: + if (img->alpha == EXTRASAMPLE_ASSOCALPHA) + { + if (BuildMapBitdepth16To8(img)) + img->put.separate = putRGBAAseparate16bittile; + } + else if (img->alpha == EXTRASAMPLE_UNASSALPHA) + { + if (BuildMapBitdepth16To8(img) && + BuildMapUaToAa(img)) + img->put.separate = putRGBUAseparate16bittile; + } + else + { + if (BuildMapBitdepth16To8(img)) + img->put.separate = putRGBseparate16bittile; + } + break; + } + break; + case PHOTOMETRIC_SEPARATED: + if (img->bitspersample == 8 && img->samplesperpixel == 4) + { + img->alpha = 1; // Not alpha, but seems like the only way to get 4th band + img->put.separate = putCMYKseparate8bittile; + } + break; + case PHOTOMETRIC_YCBCR: + if ((img->bitspersample==8) && (img->samplesperpixel==3)) + { + if (initYCbCrConversion(img)!=0) + { + uint16 hs, vs; + TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs); + switch ((hs<<4)|vs) { + case 0x11: + img->put.separate = putseparate8bitYCbCr11tile; + break; + /* TODO: add other cases here */ + } + } + } + break; + } + return ((img->get!=NULL) && (img->put.separate!=NULL)); +} + +static int +BuildMapUaToAa(TIFFRGBAImage* img) +{ + static const char module[]="BuildMapUaToAa"; + uint8* m; + uint16 na,nv; + assert(img->UaToAa==NULL); + img->UaToAa=_TIFFmalloc(65536); + if (img->UaToAa==NULL) + { + TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); + return(0); + } + m=img->UaToAa; + for (na=0; na<256; na++) + { + for (nv=0; nv<256; nv++) + *m++=(nv*na+127)/255; + } + return(1); +} + +static int +BuildMapBitdepth16To8(TIFFRGBAImage* img) +{ + static const char module[]="BuildMapBitdepth16To8"; + uint8* m; + uint32 n; + assert(img->Bitdepth16To8==NULL); + img->Bitdepth16To8=_TIFFmalloc(65536); + if (img->Bitdepth16To8==NULL) + { + TIFFErrorExt(img->tif->tif_clientdata,module,"Out of memory"); + return(0); + } + m=img->Bitdepth16To8; + for (n=0; n<65536; n++) + *m++=(n+128)/257; + return(1); +} + + +/* + * Read a whole strip off data from the file, and convert to RGBA form. + * If this is the last strip, then it will only contain the portion of + * the strip that is actually within the image space. The result is + * organized in bottom to top form. + */ + + +int +TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster ) + +{ + char emsg[1024] = ""; + TIFFRGBAImage img; + int ok; + uint32 rowsperstrip, rows_to_read; + + if( TIFFIsTiled( tif ) ) + { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), + "Can't use TIFFReadRGBAStrip() with tiled file."); + return (0); + } + + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + if( (row % rowsperstrip) != 0 ) + { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), + "Row passed to TIFFReadRGBAStrip() must be first in a strip."); + return (0); + } + + if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, 0, emsg)) { + + img.row_offset = row; + img.col_offset = 0; + + if( row + rowsperstrip > img.height ) + rows_to_read = img.height - row; + else + rows_to_read = rowsperstrip; + + ok = TIFFRGBAImageGet(&img, raster, img.width, rows_to_read ); + + TIFFRGBAImageEnd(&img); + } else { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", emsg); + ok = 0; + } + + return (ok); +} + +/* + * Read a whole tile off data from the file, and convert to RGBA form. + * The returned RGBA data is organized from bottom to top of tile, + * and may include zeroed areas if the tile extends off the image. + */ + +int +TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) + +{ + char emsg[1024] = ""; + TIFFRGBAImage img; + int ok; + uint32 tile_xsize, tile_ysize; + uint32 read_xsize, read_ysize; + uint32 i_row; + + /* + * Verify that our request is legal - on a tile file, and on a + * tile boundary. + */ + + if( !TIFFIsTiled( tif ) ) + { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), + "Can't use TIFFReadRGBATile() with stripped file."); + return (0); + } + + TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize); + TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize); + if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 ) + { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), + "Row/col passed to TIFFReadRGBATile() must be top" + "left corner of a tile."); + return (0); + } + + /* + * Setup the RGBA reader. + */ + + if (!TIFFRGBAImageOK(tif, emsg) + || !TIFFRGBAImageBegin(&img, tif, 0, emsg)) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "%s", emsg); + return( 0 ); + } + + /* + * The TIFFRGBAImageGet() function doesn't allow us to get off the + * edge of the image, even to fill an otherwise valid tile. So we + * figure out how much we can read, and fix up the tile buffer to + * a full tile configuration afterwards. + */ + + if( row + tile_ysize > img.height ) + read_ysize = img.height - row; + else + read_ysize = tile_ysize; + + if( col + tile_xsize > img.width ) + read_xsize = img.width - col; + else + read_xsize = tile_xsize; + + /* + * Read the chunk of imagery. + */ + + img.row_offset = row; + img.col_offset = col; + + ok = TIFFRGBAImageGet(&img, raster, read_xsize, read_ysize ); + + TIFFRGBAImageEnd(&img); + + /* + * If our read was incomplete we will need to fix up the tile by + * shifting the data around as if a full tile of data is being returned. + * + * This is all the more complicated because the image is organized in + * bottom to top format. + */ + + if( read_xsize == tile_xsize && read_ysize == tile_ysize ) + return( ok ); + + for( i_row = 0; i_row < read_ysize; i_row++ ) { + memmove( raster + (tile_ysize - i_row - 1) * tile_xsize, + raster + (read_ysize - i_row - 1) * read_xsize, + read_xsize * sizeof(uint32) ); + _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize, + 0, sizeof(uint32) * (tile_xsize - read_xsize) ); + } + + for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) { + _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize, + 0, sizeof(uint32) * tile_xsize ); + } + + return (ok); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jbig.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jbig.c new file mode 100644 index 0000000..37878f6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jbig.c @@ -0,0 +1,213 @@ +/* $Id: tif_jbig.c,v 1.15 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * JBIG Compression Algorithm Support. + * Contributed by Lee Howard + * + */ + +#include "tiffiop.h" + +#ifdef JBIG_SUPPORT +#include "jbig.h" + +static int JBIGSetupDecode(TIFF* tif) +{ + if (TIFFNumberOfStrips(tif) != 1) + { + TIFFErrorExt(tif->tif_clientdata, "JBIG", "Multistrip images not supported in decoder"); + return 0; + } + + return 1; +} + +static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s) +{ + struct jbg_dec_state decoder; + int decodeStatus = 0; + unsigned char* pImage = NULL; + (void) size, (void) s; + + if (isFillOrder(tif, tif->tif_dir.td_fillorder)) + { + TIFFReverseBits(tif->tif_rawdata, tif->tif_rawdatasize); + } + + jbg_dec_init(&decoder); + +#if defined(HAVE_JBG_NEWLEN) + jbg_newlen(tif->tif_rawdata, (size_t)tif->tif_rawdatasize); + /* + * I do not check the return status of jbg_newlen because even if this + * function fails it does not necessarily mean that decoding the image + * will fail. It is generally only needed for received fax images + * that do not contain the actual length of the image in the BIE + * header. I do not log when an error occurs because that will cause + * problems when converting JBIG encoded TIFF's to + * PostScript. As long as the actual image length is contained in the + * BIE header jbg_dec_in should succeed. + */ +#endif /* HAVE_JBG_NEWLEN */ + + decodeStatus = jbg_dec_in(&decoder, (unsigned char*)tif->tif_rawdata, + (size_t)tif->tif_rawdatasize, NULL); + if (JBG_EOK != decodeStatus) + { + /* + * XXX: JBG_EN constant was defined in pre-2.0 releases of the + * JBIG-KIT. Since the 2.0 the error reporting functions were + * changed. We will handle both cases here. + */ + TIFFErrorExt(tif->tif_clientdata, + "JBIG", "Error (%d) decoding: %s", + decodeStatus, +#if defined(JBG_EN) + jbg_strerror(decodeStatus, JBG_EN) +#else + jbg_strerror(decodeStatus) +#endif + ); + return 0; + } + + pImage = jbg_dec_getimage(&decoder, 0); + _TIFFmemcpy(buffer, pImage, jbg_dec_getsize(&decoder)); + jbg_dec_free(&decoder); + return 1; +} + +static int JBIGSetupEncode(TIFF* tif) +{ + if (TIFFNumberOfStrips(tif) != 1) + { + TIFFErrorExt(tif->tif_clientdata, "JBIG", "Multistrip images not supported in encoder"); + return 0; + } + + return 1; +} + +static int JBIGCopyEncodedData(TIFF* tif, unsigned char* pp, size_t cc, uint16 s) +{ + (void) s; + while (cc > 0) + { + tmsize_t n = (tmsize_t)cc; + + if (tif->tif_rawcc + n > tif->tif_rawdatasize) + { + n = tif->tif_rawdatasize - tif->tif_rawcc; + } + + assert(n > 0); + _TIFFmemcpy(tif->tif_rawcp, pp, n); + tif->tif_rawcp += n; + tif->tif_rawcc += n; + pp += n; + cc -= (size_t)n; + if (tif->tif_rawcc >= tif->tif_rawdatasize && + !TIFFFlushData1(tif)) + { + return (-1); + } + } + + return (1); +} + +static void JBIGOutputBie(unsigned char* buffer, size_t len, void* userData) +{ + TIFF* tif = (TIFF*)userData; + + if (isFillOrder(tif, tif->tif_dir.td_fillorder)) + { + TIFFReverseBits(buffer, (tmsize_t)len); + } + + JBIGCopyEncodedData(tif, buffer, len, 0); +} + +static int JBIGEncode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s) +{ + TIFFDirectory* dir = &tif->tif_dir; + struct jbg_enc_state encoder; + + (void) size, (void) s; + + jbg_enc_init(&encoder, + dir->td_imagewidth, + dir->td_imagelength, + 1, + &buffer, + JBIGOutputBie, + tif); + /* + * jbg_enc_out does the "real" encoding. As data is encoded, + * JBIGOutputBie is called, which writes the data to the directory. + */ + jbg_enc_out(&encoder); + jbg_enc_free(&encoder); + + return 1; +} + +int TIFFInitJBIG(TIFF* tif, int scheme) +{ + assert(scheme == COMPRESSION_JBIG); + + /* + * These flags are set so the JBIG Codec can control when to reverse + * bits and when not to and to allow the jbig decoder and bit reverser + * to write to memory when necessary. + */ + tif->tif_flags |= TIFF_NOBITREV; + tif->tif_flags &= ~TIFF_MAPPED; + + /* Setup the function pointers for encode, decode, and cleanup. */ + tif->tif_setupdecode = JBIGSetupDecode; + tif->tif_decodestrip = JBIGDecode; + + tif->tif_setupencode = JBIGSetupEncode; + tif->tif_encodestrip = JBIGEncode; + + return 1; +} + +#endif /* JBIG_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg.c new file mode 100644 index 0000000..b61b91b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg.c @@ -0,0 +1,2304 @@ +/* $Id: tif_jpeg.c,v 1.111 2012-07-06 18:48:04 bfriesen Exp $ */ + +/* + * Copyright (c) 1994-1997 Sam Leffler + * Copyright (c) 1994-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#define WIN32_LEAN_AND_MEAN +#define VC_EXTRALEAN + +#include "tiffiop.h" +#ifdef JPEG_SUPPORT + +/* + * TIFF Library + * + * JPEG Compression support per TIFF Technical Note #2 + * (*not* per the original TIFF 6.0 spec). + * + * This file is simply an interface to the libjpeg library written by + * the Independent JPEG Group. You need release 5 or later of the IJG + * code, which you can find on the Internet at ftp.uu.net:/graphics/jpeg/. + * + * Contributed by Tom Lane . + */ +#include + +int TIFFFillStrip(TIFF* tif, uint32 strip); +int TIFFFillTile(TIFF* tif, uint32 tile); +int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode ); + +/* We undefine FAR to avoid conflict with JPEG definition */ + +#ifdef FAR +#undef FAR +#endif + +/* + Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is + not defined. Unfortunately, the MinGW and Borland compilers include + a typedef for INT32, which causes a conflict. MSVC does not include + a conficting typedef given the headers which are included. +*/ +#if defined(__BORLANDC__) || defined(__MINGW32__) +# define XMD_H 1 +#endif + +/* + The windows RPCNDR.H file defines boolean, but defines it with the + unsigned char size. You should compile JPEG library using appropriate + definitions in jconfig.h header, but many users compile library in wrong + way. That causes errors of the following type: + + "JPEGLib: JPEG parameter struct mismatch: library thinks size is 432, + caller expects 464" + + For such users we wil fix the problem here. See install.doc file from + the JPEG library distribution for details. +*/ + +/* Define "boolean" as unsigned char, not int, per Windows custom. */ +#if defined(__WIN32__) && !defined(__MINGW32__) +# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ + typedef unsigned char boolean; +# endif +# define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +#endif + +#include "jpeglib.h" +#include "jerror.h" + +/* + * Do we want to do special processing suitable for when JSAMPLE is a + * 16bit value? + */ + +#if defined(JPEG_LIB_MK1) +# define JPEG_LIB_MK1_OR_12BIT 1 +#elif BITS_IN_JSAMPLE == 12 +# define JPEG_LIB_MK1_OR_12BIT 1 +#endif + +/* + * We are using width_in_blocks which is supposed to be private to + * libjpeg. Unfortunately, the libjpeg delivered with Cygwin has + * renamed this member to width_in_data_units. Since the header has + * also renamed a define, use that unique define name in order to + * detect the problem header and adjust to suit. + */ +#if defined(D_MAX_DATA_UNITS_IN_MCU) +#define width_in_blocks width_in_data_units +#endif + +/* + * On some machines it may be worthwhile to use _setjmp or sigsetjmp + * in place of plain setjmp. These macros will make it easier. + */ +#define SETJMP(jbuf) setjmp(jbuf) +#define LONGJMP(jbuf,code) longjmp(jbuf,code) +#define JMP_BUF jmp_buf + +typedef struct jpeg_destination_mgr jpeg_destination_mgr; +typedef struct jpeg_source_mgr jpeg_source_mgr; +typedef struct jpeg_error_mgr jpeg_error_mgr; + +/* + * State block for each open TIFF file using + * libjpeg to do JPEG compression/decompression. + * + * libjpeg's visible state is either a jpeg_compress_struct + * or jpeg_decompress_struct depending on which way we + * are going. comm can be used to refer to the fields + * which are common to both. + * + * NB: cinfo is required to be the first member of JPEGState, + * so we can safely cast JPEGState* -> jpeg_xxx_struct* + * and vice versa! + */ +typedef struct { + union { + struct jpeg_compress_struct c; + struct jpeg_decompress_struct d; + struct jpeg_common_struct comm; + } cinfo; /* NB: must be first */ + int cinfo_initialized; + + jpeg_error_mgr err; /* libjpeg error manager */ + JMP_BUF exit_jmpbuf; /* for catching libjpeg failures */ + /* + * The following two members could be a union, but + * they're small enough that it's not worth the effort. + */ + jpeg_destination_mgr dest; /* data dest for compression */ + jpeg_source_mgr src; /* data source for decompression */ + /* private state */ + TIFF* tif; /* back link needed by some code */ + uint16 photometric; /* copy of PhotometricInterpretation */ + uint16 h_sampling; /* luminance sampling factors */ + uint16 v_sampling; + tmsize_t bytesperline; /* decompressed bytes per scanline */ + /* pointers to intermediate buffers when processing downsampled data */ + JSAMPARRAY ds_buffer[MAX_COMPONENTS]; + int scancount; /* number of "scanlines" accumulated */ + int samplesperclump; + + TIFFVGetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ + TIFFPrintMethod printdir; /* super-class method */ + TIFFStripMethod defsparent; /* super-class method */ + TIFFTileMethod deftparent; /* super-class method */ + /* pseudo-tag fields */ + void* jpegtables; /* JPEGTables tag value, or NULL */ + uint32 jpegtables_length; /* number of bytes in same */ + int jpegquality; /* Compression quality level */ + int jpegcolormode; /* Auto RGB<=>YCbCr convert? */ + int jpegtablesmode; /* What to put in JPEGTables */ + + int ycbcrsampling_fetched; +} JPEGState; + +#define JState(tif) ((JPEGState*)(tif)->tif_data) + +static int JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int JPEGInitializeLibJPEG(TIFF * tif, int decode ); +static int DecodeRowError(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); + +#define FIELD_JPEGTABLES (FIELD_CODEC+0) + +static const TIFFField jpegFields[] = { + { TIFFTAG_JPEGTABLES, -3, -3, TIFF_UNDEFINED, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_C32_UINT8, FIELD_JPEGTABLES, FALSE, TRUE, "JPEGTables", NULL }, + { TIFFTAG_JPEGQUALITY, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "", NULL }, + { TIFFTAG_JPEGCOLORMODE, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "", NULL }, + { TIFFTAG_JPEGTABLESMODE, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "", NULL } +}; + +/* + * libjpeg interface layer. + * + * We use setjmp/longjmp to return control to libtiff + * when a fatal error is encountered within the JPEG + * library. We also direct libjpeg error and warning + * messages through the appropriate libtiff handlers. + */ + +/* + * Error handling routines (these replace corresponding + * IJG routines from jerror.c). These are used for both + * compression and decompression. + */ +static void +TIFFjpeg_error_exit(j_common_ptr cinfo) +{ + JPEGState *sp = (JPEGState *) cinfo; /* NB: cinfo assumed first */ + char buffer[JMSG_LENGTH_MAX]; + + (*cinfo->err->format_message) (cinfo, buffer); + TIFFErrorExt(sp->tif->tif_clientdata, "JPEGLib", "%s", buffer); /* display the error message */ + jpeg_abort(cinfo); /* clean up libjpeg state */ + LONGJMP(sp->exit_jmpbuf, 1); /* return to libtiff caller */ +} + +/* + * This routine is invoked only for warning messages, + * since error_exit does its own thing and trace_level + * is never set > 0. + */ +static void +TIFFjpeg_output_message(j_common_ptr cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + + (*cinfo->err->format_message) (cinfo, buffer); + TIFFWarningExt(((JPEGState *) cinfo)->tif->tif_clientdata, "JPEGLib", "%s", buffer); +} + +/* + * Interface routines. This layer of routines exists + * primarily to limit side-effects from using setjmp. + * Also, normal/error returns are converted into return + * values per libtiff practice. + */ +#define CALLJPEG(sp, fail, op) (SETJMP((sp)->exit_jmpbuf) ? (fail) : (op)) +#define CALLVJPEG(sp, op) CALLJPEG(sp, 0, ((op),1)) + +static int +TIFFjpeg_create_compress(JPEGState* sp) +{ + /* initialize JPEG error handling */ + sp->cinfo.c.err = jpeg_std_error(&sp->err); + sp->err.error_exit = TIFFjpeg_error_exit; + sp->err.output_message = TIFFjpeg_output_message; + + return CALLVJPEG(sp, jpeg_create_compress(&sp->cinfo.c)); +} + +static int +TIFFjpeg_create_decompress(JPEGState* sp) +{ + /* initialize JPEG error handling */ + sp->cinfo.d.err = jpeg_std_error(&sp->err); + sp->err.error_exit = TIFFjpeg_error_exit; + sp->err.output_message = TIFFjpeg_output_message; + + return CALLVJPEG(sp, jpeg_create_decompress(&sp->cinfo.d)); +} + +static int +TIFFjpeg_set_defaults(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_set_defaults(&sp->cinfo.c)); +} + +static int +TIFFjpeg_set_colorspace(JPEGState* sp, J_COLOR_SPACE colorspace) +{ + return CALLVJPEG(sp, jpeg_set_colorspace(&sp->cinfo.c, colorspace)); +} + +static int +TIFFjpeg_set_quality(JPEGState* sp, int quality, boolean force_baseline) +{ + return CALLVJPEG(sp, + jpeg_set_quality(&sp->cinfo.c, quality, force_baseline)); +} + +static int +TIFFjpeg_suppress_tables(JPEGState* sp, boolean suppress) +{ + return CALLVJPEG(sp, jpeg_suppress_tables(&sp->cinfo.c, suppress)); +} + +static int +TIFFjpeg_start_compress(JPEGState* sp, boolean write_all_tables) +{ + return CALLVJPEG(sp, + jpeg_start_compress(&sp->cinfo.c, write_all_tables)); +} + +static int +TIFFjpeg_write_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int num_lines) +{ + return CALLJPEG(sp, -1, (int) jpeg_write_scanlines(&sp->cinfo.c, + scanlines, (JDIMENSION) num_lines)); +} + +static int +TIFFjpeg_write_raw_data(JPEGState* sp, JSAMPIMAGE data, int num_lines) +{ + return CALLJPEG(sp, -1, (int) jpeg_write_raw_data(&sp->cinfo.c, + data, (JDIMENSION) num_lines)); +} + +static int +TIFFjpeg_finish_compress(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_finish_compress(&sp->cinfo.c)); +} + +static int +TIFFjpeg_write_tables(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_write_tables(&sp->cinfo.c)); +} + +static int +TIFFjpeg_read_header(JPEGState* sp, boolean require_image) +{ + return CALLJPEG(sp, -1, jpeg_read_header(&sp->cinfo.d, require_image)); +} + +static int +TIFFjpeg_start_decompress(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_start_decompress(&sp->cinfo.d)); +} + +static int +TIFFjpeg_read_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int max_lines) +{ + return CALLJPEG(sp, -1, (int) jpeg_read_scanlines(&sp->cinfo.d, + scanlines, (JDIMENSION) max_lines)); +} + +static int +TIFFjpeg_read_raw_data(JPEGState* sp, JSAMPIMAGE data, int max_lines) +{ + return CALLJPEG(sp, -1, (int) jpeg_read_raw_data(&sp->cinfo.d, + data, (JDIMENSION) max_lines)); +} + +static int +TIFFjpeg_finish_decompress(JPEGState* sp) +{ + return CALLJPEG(sp, -1, (int) jpeg_finish_decompress(&sp->cinfo.d)); +} + +static int +TIFFjpeg_abort(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_abort(&sp->cinfo.comm)); +} + +static int +TIFFjpeg_destroy(JPEGState* sp) +{ + return CALLVJPEG(sp, jpeg_destroy(&sp->cinfo.comm)); +} + +static JSAMPARRAY +TIFFjpeg_alloc_sarray(JPEGState* sp, int pool_id, + JDIMENSION samplesperrow, JDIMENSION numrows) +{ + return CALLJPEG(sp, (JSAMPARRAY) NULL, + (*sp->cinfo.comm.mem->alloc_sarray) + (&sp->cinfo.comm, pool_id, samplesperrow, numrows)); +} + +/* + * JPEG library destination data manager. + * These routines direct compressed data from libjpeg into the + * libtiff output buffer. + */ + +static void +std_init_destination(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + TIFF* tif = sp->tif; + + sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata; + sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize; +} + +static boolean +std_empty_output_buffer(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + TIFF* tif = sp->tif; + + /* the entire buffer has been filled */ + tif->tif_rawcc = tif->tif_rawdatasize; + +#ifdef IPPJ_HUFF + /* + * The Intel IPP performance library does not necessarily fill up + * the whole output buffer on each pass, so only dump out the parts + * that have been filled. + * http://trac.osgeo.org/gdal/wiki/JpegIPP + */ + if ( sp->dest.free_in_buffer >= 0 ) { + tif->tif_rawcc = tif->tif_rawdatasize - sp->dest.free_in_buffer; + } +#endif + + TIFFFlushData1(tif); + sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata; + sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize; + + return (TRUE); +} + +static void +std_term_destination(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + TIFF* tif = sp->tif; + + tif->tif_rawcp = (uint8*) sp->dest.next_output_byte; + tif->tif_rawcc = + tif->tif_rawdatasize - (tmsize_t) sp->dest.free_in_buffer; + /* NB: libtiff does the final buffer flush */ +} + +static void +TIFFjpeg_data_dest(JPEGState* sp, TIFF* tif) +{ + (void) tif; + sp->cinfo.c.dest = &sp->dest; + sp->dest.init_destination = std_init_destination; + sp->dest.empty_output_buffer = std_empty_output_buffer; + sp->dest.term_destination = std_term_destination; +} + +/* + * Alternate destination manager for outputting to JPEGTables field. + */ + +static void +tables_init_destination(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + + /* while building, jpegtables_length is allocated buffer size */ + sp->dest.next_output_byte = (JOCTET*) sp->jpegtables; + sp->dest.free_in_buffer = (size_t) sp->jpegtables_length; +} + +static boolean +tables_empty_output_buffer(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + void* newbuf; + + /* the entire buffer has been filled; enlarge it by 1000 bytes */ + newbuf = _TIFFrealloc((void*) sp->jpegtables, + (tmsize_t) (sp->jpegtables_length + 1000)); + if (newbuf == NULL) + ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 100); + sp->dest.next_output_byte = (JOCTET*) newbuf + sp->jpegtables_length; + sp->dest.free_in_buffer = (size_t) 1000; + sp->jpegtables = newbuf; + sp->jpegtables_length += 1000; + return (TRUE); +} + +static void +tables_term_destination(j_compress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + + /* set tables length to number of bytes actually emitted */ + sp->jpegtables_length -= (uint32) sp->dest.free_in_buffer; +} + +static int +TIFFjpeg_tables_dest(JPEGState* sp, TIFF* tif) +{ + (void) tif; + /* + * Allocate a working buffer for building tables. + * Initial size is 1000 bytes, which is usually adequate. + */ + if (sp->jpegtables) + _TIFFfree(sp->jpegtables); + sp->jpegtables_length = 1000; + sp->jpegtables = (void*) _TIFFmalloc((tmsize_t) sp->jpegtables_length); + if (sp->jpegtables == NULL) { + sp->jpegtables_length = 0; + TIFFErrorExt(sp->tif->tif_clientdata, "TIFFjpeg_tables_dest", "No space for JPEGTables"); + return (0); + } + sp->cinfo.c.dest = &sp->dest; + sp->dest.init_destination = tables_init_destination; + sp->dest.empty_output_buffer = tables_empty_output_buffer; + sp->dest.term_destination = tables_term_destination; + return (1); +} + +/* + * JPEG library source data manager. + * These routines supply compressed data to libjpeg. + */ + +static void +std_init_source(j_decompress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + TIFF* tif = sp->tif; + + sp->src.next_input_byte = (const JOCTET*) tif->tif_rawdata; + sp->src.bytes_in_buffer = (size_t) tif->tif_rawcc; +} + +static boolean +std_fill_input_buffer(j_decompress_ptr cinfo) +{ + JPEGState* sp = (JPEGState* ) cinfo; + static const JOCTET dummy_EOI[2] = { 0xFF, JPEG_EOI }; + +#ifdef IPPJ_HUFF + /* + * The Intel IPP performance library does not necessarily read the whole + * input buffer in one pass, so it is possible to get here with data + * yet to read. + * + * We just return without doing anything, until the entire buffer has + * been read. + * http://trac.osgeo.org/gdal/wiki/JpegIPP + */ + if( sp->src.bytes_in_buffer > 0 ) { + return (TRUE); + } +#endif + + /* + * Normally the whole strip/tile is read and so we don't need to do + * a fill. In the case of CHUNKY_STRIP_READ_SUPPORT we might not have + * all the data, but the rawdata is refreshed between scanlines and + * we push this into the io machinery in JPEGDecode(). + * http://trac.osgeo.org/gdal/ticket/3894 + */ + + WARNMS(cinfo, JWRN_JPEG_EOF); + /* insert a fake EOI marker */ + sp->src.next_input_byte = dummy_EOI; + sp->src.bytes_in_buffer = 2; + return (TRUE); +} + +static void +std_skip_input_data(j_decompress_ptr cinfo, long num_bytes) +{ + JPEGState* sp = (JPEGState*) cinfo; + + if (num_bytes > 0) { + if ((size_t)num_bytes > sp->src.bytes_in_buffer) { + /* oops, buffer overrun */ + (void) std_fill_input_buffer(cinfo); + } else { + sp->src.next_input_byte += (size_t) num_bytes; + sp->src.bytes_in_buffer -= (size_t) num_bytes; + } + } +} + +static void +std_term_source(j_decompress_ptr cinfo) +{ + /* No work necessary here */ + (void) cinfo; +} + +static void +TIFFjpeg_data_src(JPEGState* sp, TIFF* tif) +{ + (void) tif; + sp->cinfo.d.src = &sp->src; + sp->src.init_source = std_init_source; + sp->src.fill_input_buffer = std_fill_input_buffer; + sp->src.skip_input_data = std_skip_input_data; + sp->src.resync_to_restart = jpeg_resync_to_restart; + sp->src.term_source = std_term_source; + sp->src.bytes_in_buffer = 0; /* for safety */ + sp->src.next_input_byte = NULL; +} + +/* + * Alternate source manager for reading from JPEGTables. + * We can share all the code except for the init routine. + */ + +static void +tables_init_source(j_decompress_ptr cinfo) +{ + JPEGState* sp = (JPEGState*) cinfo; + + sp->src.next_input_byte = (const JOCTET*) sp->jpegtables; + sp->src.bytes_in_buffer = (size_t) sp->jpegtables_length; +} + +static void +TIFFjpeg_tables_src(JPEGState* sp, TIFF* tif) +{ + TIFFjpeg_data_src(sp, tif); + sp->src.init_source = tables_init_source; +} + +/* + * Allocate downsampled-data buffers needed for downsampled I/O. + * We use values computed in jpeg_start_compress or jpeg_start_decompress. + * We use libjpeg's allocator so that buffers will be released automatically + * when done with strip/tile. + * This is also a handy place to compute samplesperclump, bytesperline. + */ +static int +alloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info, + int num_components) +{ + JPEGState* sp = JState(tif); + int ci; + jpeg_component_info* compptr; + JSAMPARRAY buf; + int samples_per_clump = 0; + + for (ci = 0, compptr = comp_info; ci < num_components; + ci++, compptr++) { + samples_per_clump += compptr->h_samp_factor * + compptr->v_samp_factor; + buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE, + compptr->width_in_blocks * DCTSIZE, + (JDIMENSION) (compptr->v_samp_factor*DCTSIZE)); + if (buf == NULL) + return (0); + sp->ds_buffer[ci] = buf; + } + sp->samplesperclump = samples_per_clump; + return (1); +} + + +/* + * JPEG Decoding. + */ + +#ifdef CHECK_JPEG_YCBCR_SUBSAMPLING + +#define JPEG_MARKER_SOF0 0xC0 +#define JPEG_MARKER_SOF1 0xC1 +#define JPEG_MARKER_SOF3 0xC3 +#define JPEG_MARKER_DHT 0xC4 +#define JPEG_MARKER_SOI 0xD8 +#define JPEG_MARKER_SOS 0xDA +#define JPEG_MARKER_DQT 0xDB +#define JPEG_MARKER_DRI 0xDD +#define JPEG_MARKER_APP0 0xE0 +#define JPEG_MARKER_COM 0xFE +struct JPEGFixupTagsSubsamplingData +{ + TIFF* tif; + void* buffer; + uint32 buffersize; + uint8* buffercurrentbyte; + uint32 bufferbytesleft; + uint64 fileoffset; + uint64 filebytesleft; + uint8 filepositioned; +}; +static void JPEGFixupTagsSubsampling(TIFF* tif); +static int JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data); +static int JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result); +static int JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result); +static void JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength); + +#endif + +static int +JPEGFixupTags(TIFF* tif) +{ +#ifdef CHECK_JPEG_YCBCR_SUBSAMPLING + if ((tif->tif_dir.td_photometric==PHOTOMETRIC_YCBCR)&& + (tif->tif_dir.td_planarconfig==PLANARCONFIG_CONTIG)&& + (tif->tif_dir.td_samplesperpixel==3)) + JPEGFixupTagsSubsampling(tif); +#endif + + return(1); +} + +#ifdef CHECK_JPEG_YCBCR_SUBSAMPLING + +static void +JPEGFixupTagsSubsampling(TIFF* tif) +{ + /* + * Some JPEG-in-TIFF produces do not emit the YCBCRSUBSAMPLING values in + * the TIFF tags, but still use non-default (2,2) values within the jpeg + * data stream itself. In order for TIFF applications to work properly + * - for instance to get the strip buffer size right - it is imperative + * that the subsampling be available before we start reading the image + * data normally. This function will attempt to analyze the first strip in + * order to get the sampling values from the jpeg data stream. + * + * Note that JPEGPreDeocode() will produce a fairly loud warning when the + * discovered sampling does not match the default sampling (2,2) or whatever + * was actually in the tiff tags. + * + * See the bug in bugzilla for details: + * + * http://bugzilla.remotesensing.org/show_bug.cgi?id=168 + * + * Frank Warmerdam, July 2002 + * Joris Van Damme, May 2007 + */ + static const char module[] = "JPEGFixupTagsSubsampling"; + struct JPEGFixupTagsSubsamplingData m; + + _TIFFFillStriles( tif ); + + if( tif->tif_dir.td_stripbytecount == NULL + || tif->tif_dir.td_stripbytecount[0] == 0 ) + { + /* Do not even try to check if the first strip/tile does not + yet exist, as occurs when GDAL has created a new NULL file + for instance. */ + return; + } + + m.tif=tif; + m.buffersize=2048; + m.buffer=_TIFFmalloc(m.buffersize); + if (m.buffer==NULL) + { + TIFFWarningExt(tif->tif_clientdata,module, + "Unable to allocate memory for auto-correcting of subsampling values; auto-correcting skipped"); + return; + } + m.buffercurrentbyte=NULL; + m.bufferbytesleft=0; + m.fileoffset=tif->tif_dir.td_stripoffset[0]; + m.filepositioned=0; + m.filebytesleft=tif->tif_dir.td_stripbytecount[0]; + if (!JPEGFixupTagsSubsamplingSec(&m)) + TIFFWarningExt(tif->tif_clientdata,module, + "Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped"); + _TIFFfree(m.buffer); +} + +static int +JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data) +{ + static const char module[] = "JPEGFixupTagsSubsamplingSec"; + uint8 m; + while (1) + { + while (1) + { + if (!JPEGFixupTagsSubsamplingReadByte(data,&m)) + return(0); + if (m==255) + break; + } + while (1) + { + if (!JPEGFixupTagsSubsamplingReadByte(data,&m)) + return(0); + if (m!=255) + break; + } + switch (m) + { + case JPEG_MARKER_SOI: + /* this type of marker has no data and should be skipped */ + break; + case JPEG_MARKER_COM: + case JPEG_MARKER_APP0: + case JPEG_MARKER_APP0+1: + case JPEG_MARKER_APP0+2: + case JPEG_MARKER_APP0+3: + case JPEG_MARKER_APP0+4: + case JPEG_MARKER_APP0+5: + case JPEG_MARKER_APP0+6: + case JPEG_MARKER_APP0+7: + case JPEG_MARKER_APP0+8: + case JPEG_MARKER_APP0+9: + case JPEG_MARKER_APP0+10: + case JPEG_MARKER_APP0+11: + case JPEG_MARKER_APP0+12: + case JPEG_MARKER_APP0+13: + case JPEG_MARKER_APP0+14: + case JPEG_MARKER_APP0+15: + case JPEG_MARKER_DQT: + case JPEG_MARKER_SOS: + case JPEG_MARKER_DHT: + case JPEG_MARKER_DRI: + /* this type of marker has data, but it has no use to us and should be skipped */ + { + uint16 n; + if (!JPEGFixupTagsSubsamplingReadWord(data,&n)) + return(0); + if (n<2) + return(0); + n-=2; + if (n>0) + JPEGFixupTagsSubsamplingSkip(data,n); + } + break; + case JPEG_MARKER_SOF0: + case JPEG_MARKER_SOF1: + /* this marker contains the subsampling factors we're scanning for */ + { + uint16 n; + uint16 o; + uint8 p; + uint8 ph,pv; + if (!JPEGFixupTagsSubsamplingReadWord(data,&n)) + return(0); + if (n!=8+data->tif->tif_dir.td_samplesperpixel*3) + return(0); + JPEGFixupTagsSubsamplingSkip(data,7); + if (!JPEGFixupTagsSubsamplingReadByte(data,&p)) + return(0); + ph=(p>>4); + pv=(p&15); + JPEGFixupTagsSubsamplingSkip(data,1); + for (o=1; otif->tif_dir.td_samplesperpixel; o++) + { + JPEGFixupTagsSubsamplingSkip(data,1); + if (!JPEGFixupTagsSubsamplingReadByte(data,&p)) + return(0); + if (p!=0x11) + { + TIFFWarningExt(data->tif->tif_clientdata,module, + "Subsampling values inside JPEG compressed data have no TIFF equivalent, auto-correction of TIFF subsampling values failed"); + return(1); + } + JPEGFixupTagsSubsamplingSkip(data,1); + } + if (((ph!=1)&&(ph!=2)&&(ph!=4))||((pv!=1)&&(pv!=2)&&(pv!=4))) + { + TIFFWarningExt(data->tif->tif_clientdata,module, + "Subsampling values inside JPEG compressed data have no TIFF equivalent, auto-correction of TIFF subsampling values failed"); + return(1); + } + if ((ph!=data->tif->tif_dir.td_ycbcrsubsampling[0])||(pv!=data->tif->tif_dir.td_ycbcrsubsampling[1])) + { + TIFFWarningExt(data->tif->tif_clientdata,module, + "Auto-corrected former TIFF subsampling values [%d,%d] to match subsampling values inside JPEG compressed data [%d,%d]", + (int)data->tif->tif_dir.td_ycbcrsubsampling[0], + (int)data->tif->tif_dir.td_ycbcrsubsampling[1], + (int)ph,(int)pv); + data->tif->tif_dir.td_ycbcrsubsampling[0]=ph; + data->tif->tif_dir.td_ycbcrsubsampling[1]=pv; + } + } + return(1); + default: + return(0); + } + } +} + +static int +JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result) +{ + if (data->bufferbytesleft==0) + { + uint32 m; + if (data->filebytesleft==0) + return(0); + if (!data->filepositioned) + { + TIFFSeekFile(data->tif,data->fileoffset,SEEK_SET); + data->filepositioned=1; + } + m=data->buffersize; + if ((uint64)m>data->filebytesleft) + m=(uint32)data->filebytesleft; + assert(m<0x80000000UL); + if (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m) + return(0); + data->buffercurrentbyte=data->buffer; + data->bufferbytesleft=m; + data->fileoffset+=m; + data->filebytesleft-=m; + } + *result=*data->buffercurrentbyte; + data->buffercurrentbyte++; + data->bufferbytesleft--; + return(1); +} + +static int +JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result) +{ + uint8 ma; + uint8 mb; + if (!JPEGFixupTagsSubsamplingReadByte(data,&ma)) + return(0); + if (!JPEGFixupTagsSubsamplingReadByte(data,&mb)) + return(0); + *result=(ma<<8)|mb; + return(1); +} + +static void +JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength) +{ + if ((uint32)skiplength<=data->bufferbytesleft) + { + data->buffercurrentbyte+=skiplength; + data->bufferbytesleft-=skiplength; + } + else + { + uint16 m; + m=skiplength-data->bufferbytesleft; + if (m<=data->filebytesleft) + { + data->bufferbytesleft=0; + data->fileoffset+=m; + data->filebytesleft-=m; + data->filepositioned=0; + } + else + { + data->bufferbytesleft=0; + data->filebytesleft=0; + } + } +} + +#endif + + +static int +JPEGSetupDecode(TIFF* tif) +{ + JPEGState* sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + +#if defined(JPEG_DUAL_MODE_8_12) && !defined(TIFFInitJPEG) + if( tif->tif_dir.td_bitspersample == 12 ) + return TIFFReInitJPEG_12( tif, COMPRESSION_JPEG, 0 ); +#endif + + JPEGInitializeLibJPEG( tif, TRUE ); + + assert(sp != NULL); + assert(sp->cinfo.comm.is_decompressor); + + /* Read JPEGTables if it is present */ + if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) { + TIFFjpeg_tables_src(sp, tif); + if(TIFFjpeg_read_header(sp,FALSE) != JPEG_HEADER_TABLES_ONLY) { + TIFFErrorExt(tif->tif_clientdata, "JPEGSetupDecode", "Bogus JPEGTables field"); + return (0); + } + } + + /* Grab parameters that are same for all strips/tiles */ + sp->photometric = td->td_photometric; + switch (sp->photometric) { + case PHOTOMETRIC_YCBCR: + sp->h_sampling = td->td_ycbcrsubsampling[0]; + sp->v_sampling = td->td_ycbcrsubsampling[1]; + break; + default: + /* TIFF 6.0 forbids subsampling of all other color spaces */ + sp->h_sampling = 1; + sp->v_sampling = 1; + break; + } + + /* Set up for reading normal data */ + TIFFjpeg_data_src(sp, tif); + tif->tif_postdecode = _TIFFNoPostDecode; /* override byte swapping */ + return (1); +} + +/* + * Set up for decoding a strip or tile. + */ +static int +JPEGPreDecode(TIFF* tif, uint16 s) +{ + JPEGState *sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + static const char module[] = "JPEGPreDecode"; + uint32 segment_width, segment_height; + int downsampled_output; + int ci; + + assert(sp != NULL); + + if (sp->cinfo.comm.is_decompressor == 0) + { + tif->tif_setupdecode( tif ); + } + + assert(sp->cinfo.comm.is_decompressor); + /* + * Reset decoder state from any previous strip/tile, + * in case application didn't read the whole strip. + */ + if (!TIFFjpeg_abort(sp)) + return (0); + /* + * Read the header for this strip/tile. + */ + + if (TIFFjpeg_read_header(sp, TRUE) != JPEG_HEADER_OK) + return (0); + + tif->tif_rawcp = (uint8*) sp->src.next_input_byte; + tif->tif_rawcc = sp->src.bytes_in_buffer; + + /* + * Check image parameters and set decompression parameters. + */ + segment_width = td->td_imagewidth; + segment_height = td->td_imagelength - tif->tif_row; + if (isTiled(tif)) { + segment_width = td->td_tilewidth; + segment_height = td->td_tilelength; + sp->bytesperline = TIFFTileRowSize(tif); + } else { + if (segment_height > td->td_rowsperstrip) + segment_height = td->td_rowsperstrip; + sp->bytesperline = TIFFScanlineSize(tif); + } + if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) { + /* + * For PC 2, scale down the expected strip/tile size + * to match a downsampled component + */ + segment_width = TIFFhowmany_32(segment_width, sp->h_sampling); + segment_height = TIFFhowmany_32(segment_height, sp->v_sampling); + } + if (sp->cinfo.d.image_width < segment_width || + sp->cinfo.d.image_height < segment_height) { + TIFFWarningExt(tif->tif_clientdata, module, + "Improper JPEG strip/tile size, " + "expected %dx%d, got %dx%d", + segment_width, segment_height, + sp->cinfo.d.image_width, + sp->cinfo.d.image_height); + } + if (sp->cinfo.d.image_width > segment_width || + sp->cinfo.d.image_height > segment_height) { + /* + * This case could be dangerous, if the strip or tile size has + * been reported as less than the amount of data jpeg will + * return, some potential security issues arise. Catch this + * case and error out. + */ + TIFFErrorExt(tif->tif_clientdata, module, + "JPEG strip/tile size exceeds expected dimensions," + " expected %dx%d, got %dx%d", + segment_width, segment_height, + sp->cinfo.d.image_width, sp->cinfo.d.image_height); + return (0); + } + if (sp->cinfo.d.num_components != + (td->td_planarconfig == PLANARCONFIG_CONTIG ? + td->td_samplesperpixel : 1)) { + TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG component count"); + return (0); + } +#ifdef JPEG_LIB_MK1 + if (12 != td->td_bitspersample && 8 != td->td_bitspersample) { + TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision"); + return (0); + } + sp->cinfo.d.data_precision = td->td_bitspersample; + sp->cinfo.d.bits_in_jsample = td->td_bitspersample; +#else + if (sp->cinfo.d.data_precision != td->td_bitspersample) { + TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG data precision"); + return (0); + } +#endif + if (td->td_planarconfig == PLANARCONFIG_CONTIG) { + /* Component 0 should have expected sampling factors */ + if (sp->cinfo.d.comp_info[0].h_samp_factor != sp->h_sampling || + sp->cinfo.d.comp_info[0].v_samp_factor != sp->v_sampling) { + TIFFErrorExt(tif->tif_clientdata, module, + "Improper JPEG sampling factors %d,%d\n" + "Apparently should be %d,%d.", + sp->cinfo.d.comp_info[0].h_samp_factor, + sp->cinfo.d.comp_info[0].v_samp_factor, + sp->h_sampling, sp->v_sampling); + return (0); + } + /* Rest should have sampling factors 1,1 */ + for (ci = 1; ci < sp->cinfo.d.num_components; ci++) { + if (sp->cinfo.d.comp_info[ci].h_samp_factor != 1 || + sp->cinfo.d.comp_info[ci].v_samp_factor != 1) { + TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors"); + return (0); + } + } + } else { + /* PC 2's single component should have sampling factors 1,1 */ + if (sp->cinfo.d.comp_info[0].h_samp_factor != 1 || + sp->cinfo.d.comp_info[0].v_samp_factor != 1) { + TIFFErrorExt(tif->tif_clientdata, module, "Improper JPEG sampling factors"); + return (0); + } + } + downsampled_output = FALSE; + if (td->td_planarconfig == PLANARCONFIG_CONTIG && + sp->photometric == PHOTOMETRIC_YCBCR && + sp->jpegcolormode == JPEGCOLORMODE_RGB) { + /* Convert YCbCr to RGB */ + sp->cinfo.d.jpeg_color_space = JCS_YCbCr; + sp->cinfo.d.out_color_space = JCS_RGB; + } else { + /* Suppress colorspace handling */ + sp->cinfo.d.jpeg_color_space = JCS_UNKNOWN; + sp->cinfo.d.out_color_space = JCS_UNKNOWN; + if (td->td_planarconfig == PLANARCONFIG_CONTIG && + (sp->h_sampling != 1 || sp->v_sampling != 1)) + downsampled_output = TRUE; + /* XXX what about up-sampling? */ + } + if (downsampled_output) { + /* Need to use raw-data interface to libjpeg */ + sp->cinfo.d.raw_data_out = TRUE; +#if JPEG_LIB_VERSION >= 70 + sp->cinfo.d.do_fancy_upsampling = FALSE; +#endif /* JPEG_LIB_VERSION >= 70 */ + tif->tif_decoderow = DecodeRowError; + tif->tif_decodestrip = JPEGDecodeRaw; + tif->tif_decodetile = JPEGDecodeRaw; + } else { + /* Use normal interface to libjpeg */ + sp->cinfo.d.raw_data_out = FALSE; + tif->tif_decoderow = JPEGDecode; + tif->tif_decodestrip = JPEGDecode; + tif->tif_decodetile = JPEGDecode; + } + /* Start JPEG decompressor */ + if (!TIFFjpeg_start_decompress(sp)) + return (0); + /* Allocate downsampled-data buffers if needed */ + if (downsampled_output) { + if (!alloc_downsampled_buffers(tif, sp->cinfo.d.comp_info, + sp->cinfo.d.num_components)) + return (0); + sp->scancount = DCTSIZE; /* mark buffer empty */ + } + return (1); +} + +/* + * Decode a chunk of pixels. + * "Standard" case: returned data is not downsampled. + */ +/*ARGSUSED*/ static int +JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + JPEGState *sp = JState(tif); + tmsize_t nrows; + (void) s; + + /* + ** Update available information, buffer may have been refilled + ** between decode requests + */ + sp->src.next_input_byte = (const JOCTET*) tif->tif_rawcp; + sp->src.bytes_in_buffer = (size_t) tif->tif_rawcc; + + if( sp->bytesperline == 0 ) + return 0; + + nrows = cc / sp->bytesperline; + if (cc % sp->bytesperline) + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline not read"); + + if( nrows > (tmsize_t) sp->cinfo.d.image_height ) + nrows = sp->cinfo.d.image_height; + + /* data is expected to be read in multiples of a scanline */ + if (nrows) + { + JSAMPROW line_work_buf = NULL; + + /* + * For 6B, only use temporary buffer for 12 bit imagery. + * For Mk1 always use it. + */ +#if !defined(JPEG_LIB_MK1) + if( sp->cinfo.d.data_precision == 12 ) +#endif + { + line_work_buf = (JSAMPROW) + _TIFFmalloc(sizeof(short) * sp->cinfo.d.output_width + * sp->cinfo.d.num_components ); + } + + do { + if( line_work_buf != NULL ) + { + /* + * In the MK1 case, we aways read into a 16bit buffer, and then + * pack down to 12bit or 8bit. In 6B case we only read into 16 + * bit buffer for 12bit data, which we need to repack. + */ + if (TIFFjpeg_read_scanlines(sp, &line_work_buf, 1) != 1) + return (0); + + if( sp->cinfo.d.data_precision == 12 ) + { + int value_pairs = (sp->cinfo.d.output_width + * sp->cinfo.d.num_components) / 2; + int iPair; + + for( iPair = 0; iPair < value_pairs; iPair++ ) + { + unsigned char *out_ptr = + ((unsigned char *) buf) + iPair * 3; + JSAMPLE *in_ptr = line_work_buf + iPair * 2; + + out_ptr[0] = (in_ptr[0] & 0xff0) >> 4; + out_ptr[1] = ((in_ptr[0] & 0xf) << 4) + | ((in_ptr[1] & 0xf00) >> 8); + out_ptr[2] = ((in_ptr[1] & 0xff) >> 0); + } + } + else if( sp->cinfo.d.data_precision == 8 ) + { + int value_count = (sp->cinfo.d.output_width + * sp->cinfo.d.num_components); + int iValue; + + for( iValue = 0; iValue < value_count; iValue++ ) + { + ((unsigned char *) buf)[iValue] = + line_work_buf[iValue] & 0xff; + } + } + } + else + { + /* + * In the libjpeg6b 8bit case. We read directly into the + * TIFF buffer. + */ + JSAMPROW bufptr = (JSAMPROW)buf; + + if (TIFFjpeg_read_scanlines(sp, &bufptr, 1) != 1) + return (0); + } + + ++tif->tif_row; + buf += sp->bytesperline; + cc -= sp->bytesperline; + } while (--nrows > 0); + + if( line_work_buf != NULL ) + _TIFFfree( line_work_buf ); + } + + /* Update information on consumed data */ + tif->tif_rawcp = (uint8*) sp->src.next_input_byte; + tif->tif_rawcc = sp->src.bytes_in_buffer; + + /* Close down the decompressor if we've finished the strip or tile. */ + return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height + || TIFFjpeg_finish_decompress(sp); +} + +/*ARGSUSED*/ static int +DecodeRowError(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) + +{ + (void) buf; + (void) cc; + (void) s; + + TIFFErrorExt(tif->tif_clientdata, "TIFFReadScanline", + "scanline oriented access is not supported for downsampled JPEG compressed images, consider enabling TIFF_JPEGCOLORMODE as JPEGCOLORMODE_RGB." ); + return 0; +} + +/* + * Decode a chunk of pixels. + * Returned data is downsampled per sampling factors. + */ +/*ARGSUSED*/ static int +JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + JPEGState *sp = JState(tif); + tmsize_t nrows; + (void) s; + + /* data is expected to be read in multiples of a scanline */ + if ( (nrows = sp->cinfo.d.image_height) ) { + + /* Cb,Cr both have sampling factors 1, so this is correct */ + JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width; + int samples_per_clump = sp->samplesperclump; + +#if defined(JPEG_LIB_MK1_OR_12BIT) + unsigned short* tmpbuf = _TIFFmalloc(sizeof(unsigned short) * + sp->cinfo.d.output_width * + sp->cinfo.d.num_components); + if(tmpbuf==NULL) { + TIFFErrorExt(tif->tif_clientdata, "JPEGDecodeRaw", + "Out of memory"); + return 0; + } +#endif + + do { + jpeg_component_info *compptr; + int ci, clumpoffset; + + if( cc < sp->bytesperline ) { + TIFFErrorExt(tif->tif_clientdata, "JPEGDecodeRaw", + "application buffer not large enough for all data."); + return 0; + } + + /* Reload downsampled-data buffer if needed */ + if (sp->scancount >= DCTSIZE) { + int n = sp->cinfo.d.max_v_samp_factor * DCTSIZE; + if (TIFFjpeg_read_raw_data(sp, sp->ds_buffer, n) != n) + return (0); + sp->scancount = 0; + } + /* + * Fastest way to unseparate data is to make one pass + * over the scanline for each row of each component. + */ + clumpoffset = 0; /* first sample in clump */ + for (ci = 0, compptr = sp->cinfo.d.comp_info; + ci < sp->cinfo.d.num_components; + ci++, compptr++) { + int hsamp = compptr->h_samp_factor; + int vsamp = compptr->v_samp_factor; + int ypos; + + for (ypos = 0; ypos < vsamp; ypos++) { + JSAMPLE *inptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos]; + JDIMENSION nclump; +#if defined(JPEG_LIB_MK1_OR_12BIT) + JSAMPLE *outptr = (JSAMPLE*)tmpbuf + clumpoffset; +#else + JSAMPLE *outptr = (JSAMPLE*)buf + clumpoffset; + if (cc < (tmsize_t) (clumpoffset + samples_per_clump*(clumps_per_line-1) + hsamp)) { + TIFFErrorExt(tif->tif_clientdata, "JPEGDecodeRaw", + "application buffer not large enough for all data, possible subsampling issue"); + return 0; + } +#endif + + if (hsamp == 1) { + /* fast path for at least Cb and Cr */ + for (nclump = clumps_per_line; nclump-- > 0; ) { + outptr[0] = *inptr++; + outptr += samples_per_clump; + } + } else { + int xpos; + + /* general case */ + for (nclump = clumps_per_line; nclump-- > 0; ) { + for (xpos = 0; xpos < hsamp; xpos++) + outptr[xpos] = *inptr++; + outptr += samples_per_clump; + } + } + clumpoffset += hsamp; + } + } + +#if defined(JPEG_LIB_MK1_OR_12BIT) + { + if (sp->cinfo.d.data_precision == 8) + { + int i=0; + int len = sp->cinfo.d.output_width * sp->cinfo.d.num_components; + for (i=0; icinfo.d.output_width + * sp->cinfo.d.num_components) / 2; + int iPair; + for( iPair = 0; iPair < value_pairs; iPair++ ) + { + unsigned char *out_ptr = ((unsigned char *) buf) + iPair * 3; + JSAMPLE *in_ptr = (JSAMPLE *) (tmpbuf + iPair * 2); + out_ptr[0] = (in_ptr[0] & 0xff0) >> 4; + out_ptr[1] = ((in_ptr[0] & 0xf) << 4) + | ((in_ptr[1] & 0xf00) >> 8); + out_ptr[2] = ((in_ptr[1] & 0xff) >> 0); + } + } + } +#endif + + sp->scancount ++; + tif->tif_row += sp->v_sampling; + + buf += sp->bytesperline; + cc -= sp->bytesperline; + + nrows -= sp->v_sampling; + } while (nrows > 0); + +#if defined(JPEG_LIB_MK1_OR_12BIT) + _TIFFfree(tmpbuf); +#endif + + } + + /* Close down the decompressor if done. */ + return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height + || TIFFjpeg_finish_decompress(sp); +} + + +/* + * JPEG Encoding. + */ + +static void +unsuppress_quant_table (JPEGState* sp, int tblno) +{ + JQUANT_TBL* qtbl; + + if ((qtbl = sp->cinfo.c.quant_tbl_ptrs[tblno]) != NULL) + qtbl->sent_table = FALSE; +} + +static void +unsuppress_huff_table (JPEGState* sp, int tblno) +{ + JHUFF_TBL* htbl; + + if ((htbl = sp->cinfo.c.dc_huff_tbl_ptrs[tblno]) != NULL) + htbl->sent_table = FALSE; + if ((htbl = sp->cinfo.c.ac_huff_tbl_ptrs[tblno]) != NULL) + htbl->sent_table = FALSE; +} + +static int +prepare_JPEGTables(TIFF* tif) +{ + JPEGState* sp = JState(tif); + + /* Initialize quant tables for current quality setting */ + if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE)) + return (0); + /* Mark only the tables we want for output */ + /* NB: chrominance tables are currently used only with YCbCr */ + if (!TIFFjpeg_suppress_tables(sp, TRUE)) + return (0); + if (sp->jpegtablesmode & JPEGTABLESMODE_QUANT) { + unsuppress_quant_table(sp, 0); + if (sp->photometric == PHOTOMETRIC_YCBCR) + unsuppress_quant_table(sp, 1); + } + if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) { + unsuppress_huff_table(sp, 0); + if (sp->photometric == PHOTOMETRIC_YCBCR) + unsuppress_huff_table(sp, 1); + } + /* Direct libjpeg output into jpegtables */ + if (!TIFFjpeg_tables_dest(sp, tif)) + return (0); + /* Emit tables-only datastream */ + if (!TIFFjpeg_write_tables(sp)) + return (0); + + return (1); +} + +static int +JPEGSetupEncode(TIFF* tif) +{ + JPEGState* sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + static const char module[] = "JPEGSetupEncode"; + +#if defined(JPEG_DUAL_MODE_8_12) && !defined(TIFFInitJPEG) + if( tif->tif_dir.td_bitspersample == 12 ) + return TIFFReInitJPEG_12( tif, COMPRESSION_JPEG, 1 ); +#endif + + JPEGInitializeLibJPEG( tif, FALSE ); + + assert(sp != NULL); + assert(!sp->cinfo.comm.is_decompressor); + + /* + * Initialize all JPEG parameters to default values. + * Note that jpeg_set_defaults needs legal values for + * in_color_space and input_components. + */ + sp->cinfo.c.in_color_space = JCS_UNKNOWN; + sp->cinfo.c.input_components = 1; + if (!TIFFjpeg_set_defaults(sp)) + return (0); + /* Set per-file parameters */ + sp->photometric = td->td_photometric; + switch (sp->photometric) { + case PHOTOMETRIC_YCBCR: + sp->h_sampling = td->td_ycbcrsubsampling[0]; + sp->v_sampling = td->td_ycbcrsubsampling[1]; + /* + * A ReferenceBlackWhite field *must* be present since the + * default value is inappropriate for YCbCr. Fill in the + * proper value if application didn't set it. + */ + { + float *ref; + if (!TIFFGetField(tif, TIFFTAG_REFERENCEBLACKWHITE, + &ref)) { + float refbw[6]; + long top = 1L << td->td_bitspersample; + refbw[0] = 0; + refbw[1] = (float)(top-1L); + refbw[2] = (float)(top>>1); + refbw[3] = refbw[1]; + refbw[4] = refbw[2]; + refbw[5] = refbw[1]; + TIFFSetField(tif, TIFFTAG_REFERENCEBLACKWHITE, + refbw); + } + } + break; + case PHOTOMETRIC_PALETTE: /* disallowed by Tech Note */ + case PHOTOMETRIC_MASK: + TIFFErrorExt(tif->tif_clientdata, module, + "PhotometricInterpretation %d not allowed for JPEG", + (int) sp->photometric); + return (0); + default: + /* TIFF 6.0 forbids subsampling of all other color spaces */ + sp->h_sampling = 1; + sp->v_sampling = 1; + break; + } + + /* Verify miscellaneous parameters */ + + /* + * This would need work if libtiff ever supports different + * depths for different components, or if libjpeg ever supports + * run-time selection of depth. Neither is imminent. + */ +#ifdef JPEG_LIB_MK1 + /* BITS_IN_JSAMPLE now permits 8 and 12 --- dgilbert */ + if (td->td_bitspersample != 8 && td->td_bitspersample != 12) +#else + if (td->td_bitspersample != BITS_IN_JSAMPLE ) +#endif + { + TIFFErrorExt(tif->tif_clientdata, module, "BitsPerSample %d not allowed for JPEG", + (int) td->td_bitspersample); + return (0); + } + sp->cinfo.c.data_precision = td->td_bitspersample; +#ifdef JPEG_LIB_MK1 + sp->cinfo.c.bits_in_jsample = td->td_bitspersample; +#endif + if (isTiled(tif)) { + if ((td->td_tilelength % (sp->v_sampling * DCTSIZE)) != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "JPEG tile height must be multiple of %d", + sp->v_sampling * DCTSIZE); + return (0); + } + if ((td->td_tilewidth % (sp->h_sampling * DCTSIZE)) != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "JPEG tile width must be multiple of %d", + sp->h_sampling * DCTSIZE); + return (0); + } + } else { + if (td->td_rowsperstrip < td->td_imagelength && + (td->td_rowsperstrip % (sp->v_sampling * DCTSIZE)) != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "RowsPerStrip must be multiple of %d for JPEG", + sp->v_sampling * DCTSIZE); + return (0); + } + } + + /* Create a JPEGTables field if appropriate */ + if (sp->jpegtablesmode & (JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF)) { + if( sp->jpegtables == NULL + || memcmp(sp->jpegtables,"\0\0\0\0\0\0\0\0\0",8) == 0 ) + { + if (!prepare_JPEGTables(tif)) + return (0); + /* Mark the field present */ + /* Can't use TIFFSetField since BEENWRITING is already set! */ + tif->tif_flags |= TIFF_DIRTYDIRECT; + TIFFSetFieldBit(tif, FIELD_JPEGTABLES); + } + } else { + /* We do not support application-supplied JPEGTables, */ + /* so mark the field not present */ + TIFFClrFieldBit(tif, FIELD_JPEGTABLES); + } + + /* Direct libjpeg output to libtiff's output buffer */ + TIFFjpeg_data_dest(sp, tif); + + return (1); +} + +/* + * Set encoding state at the start of a strip or tile. + */ +static int +JPEGPreEncode(TIFF* tif, uint16 s) +{ + JPEGState *sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + static const char module[] = "JPEGPreEncode"; + uint32 segment_width, segment_height; + int downsampled_input; + + assert(sp != NULL); + + if (sp->cinfo.comm.is_decompressor == 1) + { + tif->tif_setupencode( tif ); + } + + assert(!sp->cinfo.comm.is_decompressor); + /* + * Set encoding parameters for this strip/tile. + */ + if (isTiled(tif)) { + segment_width = td->td_tilewidth; + segment_height = td->td_tilelength; + sp->bytesperline = TIFFTileRowSize(tif); + } else { + segment_width = td->td_imagewidth; + segment_height = td->td_imagelength - tif->tif_row; + if (segment_height > td->td_rowsperstrip) + segment_height = td->td_rowsperstrip; + sp->bytesperline = TIFFScanlineSize(tif); + } + if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) { + /* for PC 2, scale down the strip/tile size + * to match a downsampled component + */ + segment_width = TIFFhowmany_32(segment_width, sp->h_sampling); + segment_height = TIFFhowmany_32(segment_height, sp->v_sampling); + } + if (segment_width > 65535 || segment_height > 65535) { + TIFFErrorExt(tif->tif_clientdata, module, "Strip/tile too large for JPEG"); + return (0); + } + sp->cinfo.c.image_width = segment_width; + sp->cinfo.c.image_height = segment_height; + downsampled_input = FALSE; + if (td->td_planarconfig == PLANARCONFIG_CONTIG) { + sp->cinfo.c.input_components = td->td_samplesperpixel; + if (sp->photometric == PHOTOMETRIC_YCBCR) { + if (sp->jpegcolormode == JPEGCOLORMODE_RGB) { + sp->cinfo.c.in_color_space = JCS_RGB; + } else { + sp->cinfo.c.in_color_space = JCS_YCbCr; + if (sp->h_sampling != 1 || sp->v_sampling != 1) + downsampled_input = TRUE; + } + if (!TIFFjpeg_set_colorspace(sp, JCS_YCbCr)) + return (0); + /* + * Set Y sampling factors; + * we assume jpeg_set_colorspace() set the rest to 1 + */ + sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling; + sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling; + } else { + if ((td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric == PHOTOMETRIC_MINISBLACK) && td->td_samplesperpixel == 1) + sp->cinfo.c.in_color_space = JCS_GRAYSCALE; + else if (td->td_photometric == PHOTOMETRIC_RGB && td->td_samplesperpixel == 3) + sp->cinfo.c.in_color_space = JCS_RGB; + else if (td->td_photometric == PHOTOMETRIC_SEPARATED && td->td_samplesperpixel == 4) + sp->cinfo.c.in_color_space = JCS_CMYK; + else + sp->cinfo.c.in_color_space = JCS_UNKNOWN; + if (!TIFFjpeg_set_colorspace(sp, sp->cinfo.c.in_color_space)) + return (0); + /* jpeg_set_colorspace set all sampling factors to 1 */ + } + } else { + sp->cinfo.c.input_components = 1; + sp->cinfo.c.in_color_space = JCS_UNKNOWN; + if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN)) + return (0); + sp->cinfo.c.comp_info[0].component_id = s; + /* jpeg_set_colorspace() set sampling factors to 1 */ + if (sp->photometric == PHOTOMETRIC_YCBCR && s > 0) { + sp->cinfo.c.comp_info[0].quant_tbl_no = 1; + sp->cinfo.c.comp_info[0].dc_tbl_no = 1; + sp->cinfo.c.comp_info[0].ac_tbl_no = 1; + } + } + /* ensure libjpeg won't write any extraneous markers */ + sp->cinfo.c.write_JFIF_header = FALSE; + sp->cinfo.c.write_Adobe_marker = FALSE; + /* set up table handling correctly */ + if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE)) + return (0); + if (! (sp->jpegtablesmode & JPEGTABLESMODE_QUANT)) { + unsuppress_quant_table(sp, 0); + unsuppress_quant_table(sp, 1); + } + if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) + sp->cinfo.c.optimize_coding = FALSE; + else + sp->cinfo.c.optimize_coding = TRUE; + if (downsampled_input) { + /* Need to use raw-data interface to libjpeg */ + sp->cinfo.c.raw_data_in = TRUE; + tif->tif_encoderow = JPEGEncodeRaw; + tif->tif_encodestrip = JPEGEncodeRaw; + tif->tif_encodetile = JPEGEncodeRaw; + } else { + /* Use normal interface to libjpeg */ + sp->cinfo.c.raw_data_in = FALSE; + tif->tif_encoderow = JPEGEncode; + tif->tif_encodestrip = JPEGEncode; + tif->tif_encodetile = JPEGEncode; + } + /* Start JPEG compressor */ + if (!TIFFjpeg_start_compress(sp, FALSE)) + return (0); + /* Allocate downsampled-data buffers if needed */ + if (downsampled_input) { + if (!alloc_downsampled_buffers(tif, sp->cinfo.c.comp_info, + sp->cinfo.c.num_components)) + return (0); + } + sp->scancount = 0; + + return (1); +} + +/* + * Encode a chunk of pixels. + * "Standard" case: incoming data is not downsampled. + */ +static int +JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + JPEGState *sp = JState(tif); + tmsize_t nrows; + JSAMPROW bufptr[1]; + short *line16 = NULL; + int line16_count = 0; + + (void) s; + assert(sp != NULL); + /* data is expected to be supplied in multiples of a scanline */ + nrows = cc / sp->bytesperline; + if (cc % sp->bytesperline) + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, + "fractional scanline discarded"); + + /* The last strip will be limited to image size */ + if( !isTiled(tif) && tif->tif_row+nrows > tif->tif_dir.td_imagelength ) + nrows = tif->tif_dir.td_imagelength - tif->tif_row; + + if( sp->cinfo.c.data_precision == 12 ) + { + line16_count = (sp->bytesperline * 2) / 3; + line16 = (short *) _TIFFmalloc(sizeof(short) * line16_count); + // FIXME: undiagnosed malloc failure + } + + while (nrows-- > 0) { + + if( sp->cinfo.c.data_precision == 12 ) + { + + int value_pairs = line16_count / 2; + int iPair; + + bufptr[0] = (JSAMPROW) line16; + + for( iPair = 0; iPair < value_pairs; iPair++ ) + { + unsigned char *in_ptr = + ((unsigned char *) buf) + iPair * 3; + JSAMPLE *out_ptr = (JSAMPLE *) (line16 + iPair * 2); + + out_ptr[0] = (in_ptr[0] << 4) | ((in_ptr[1] & 0xf0) >> 4); + out_ptr[1] = ((in_ptr[1] & 0x0f) << 8) | in_ptr[2]; + } + } + else + { + bufptr[0] = (JSAMPROW) buf; + } + if (TIFFjpeg_write_scanlines(sp, bufptr, 1) != 1) + return (0); + if (nrows > 0) + tif->tif_row++; + buf += sp->bytesperline; + } + + if( sp->cinfo.c.data_precision == 12 ) + { + _TIFFfree( line16 ); + } + + return (1); +} + +/* + * Encode a chunk of pixels. + * Incoming data is expected to be downsampled per sampling factors. + */ +static int +JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + JPEGState *sp = JState(tif); + JSAMPLE* inptr; + JSAMPLE* outptr; + tmsize_t nrows; + JDIMENSION clumps_per_line, nclump; + int clumpoffset, ci, xpos, ypos; + jpeg_component_info* compptr; + int samples_per_clump = sp->samplesperclump; + tmsize_t bytesperclumpline; + + (void) s; + assert(sp != NULL); + /* data is expected to be supplied in multiples of a clumpline */ + /* a clumpline is equivalent to v_sampling desubsampled scanlines */ + /* TODO: the following calculation of bytesperclumpline, should substitute calculation of sp->bytesperline, except that it is per v_sampling lines */ + bytesperclumpline = (((sp->cinfo.c.image_width+sp->h_sampling-1)/sp->h_sampling) + *(sp->h_sampling*sp->v_sampling+2)*sp->cinfo.c.data_precision+7) + /8; + + nrows = ( cc / bytesperclumpline ) * sp->v_sampling; + if (cc % bytesperclumpline) + TIFFWarningExt(tif->tif_clientdata, tif->tif_name, "fractional scanline discarded"); + + /* Cb,Cr both have sampling factors 1, so this is correct */ + clumps_per_line = sp->cinfo.c.comp_info[1].downsampled_width; + + while (nrows > 0) { + /* + * Fastest way to separate the data is to make one pass + * over the scanline for each row of each component. + */ + clumpoffset = 0; /* first sample in clump */ + for (ci = 0, compptr = sp->cinfo.c.comp_info; + ci < sp->cinfo.c.num_components; + ci++, compptr++) { + int hsamp = compptr->h_samp_factor; + int vsamp = compptr->v_samp_factor; + int padding = (int) (compptr->width_in_blocks * DCTSIZE - + clumps_per_line * hsamp); + for (ypos = 0; ypos < vsamp; ypos++) { + inptr = ((JSAMPLE*) buf) + clumpoffset; + outptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos]; + if (hsamp == 1) { + /* fast path for at least Cb and Cr */ + for (nclump = clumps_per_line; nclump-- > 0; ) { + *outptr++ = inptr[0]; + inptr += samples_per_clump; + } + } else { + /* general case */ + for (nclump = clumps_per_line; nclump-- > 0; ) { + for (xpos = 0; xpos < hsamp; xpos++) + *outptr++ = inptr[xpos]; + inptr += samples_per_clump; + } + } + /* pad each scanline as needed */ + for (xpos = 0; xpos < padding; xpos++) { + *outptr = outptr[-1]; + outptr++; + } + clumpoffset += hsamp; + } + } + sp->scancount++; + if (sp->scancount >= DCTSIZE) { + int n = sp->cinfo.c.max_v_samp_factor * DCTSIZE; + if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n) + return (0); + sp->scancount = 0; + } + tif->tif_row += sp->v_sampling; + buf += bytesperclumpline; + nrows -= sp->v_sampling; + } + return (1); +} + +/* + * Finish up at the end of a strip or tile. + */ +static int +JPEGPostEncode(TIFF* tif) +{ + JPEGState *sp = JState(tif); + + if (sp->scancount > 0) { + /* + * Need to emit a partial bufferload of downsampled data. + * Pad the data vertically. + */ + int ci, ypos, n; + jpeg_component_info* compptr; + + for (ci = 0, compptr = sp->cinfo.c.comp_info; + ci < sp->cinfo.c.num_components; + ci++, compptr++) { + int vsamp = compptr->v_samp_factor; + tmsize_t row_width = compptr->width_in_blocks * DCTSIZE + * sizeof(JSAMPLE); + for (ypos = sp->scancount * vsamp; + ypos < DCTSIZE * vsamp; ypos++) { + _TIFFmemcpy((void*)sp->ds_buffer[ci][ypos], + (void*)sp->ds_buffer[ci][ypos-1], + row_width); + + } + } + n = sp->cinfo.c.max_v_samp_factor * DCTSIZE; + if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n) + return (0); + } + + return (TIFFjpeg_finish_compress(JState(tif))); +} + +static void +JPEGCleanup(TIFF* tif) +{ + JPEGState *sp = JState(tif); + + assert(sp != 0); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + tif->tif_tagmethods.printdir = sp->printdir; + + if( sp != NULL ) { + if( sp->cinfo_initialized ) + TIFFjpeg_destroy(sp); /* release libjpeg resources */ + if (sp->jpegtables) /* tag value */ + _TIFFfree(sp->jpegtables); + } + _TIFFfree(tif->tif_data); /* release local state */ + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +static void +JPEGResetUpsampled( TIFF* tif ) +{ + JPEGState* sp = JState(tif); + TIFFDirectory* td = &tif->tif_dir; + + /* + * Mark whether returned data is up-sampled or not so TIFFStripSize + * and TIFFTileSize return values that reflect the true amount of + * data. + */ + tif->tif_flags &= ~TIFF_UPSAMPLED; + if (td->td_planarconfig == PLANARCONFIG_CONTIG) { + if (td->td_photometric == PHOTOMETRIC_YCBCR && + sp->jpegcolormode == JPEGCOLORMODE_RGB) { + tif->tif_flags |= TIFF_UPSAMPLED; + } else { +#ifdef notdef + if (td->td_ycbcrsubsampling[0] != 1 || + td->td_ycbcrsubsampling[1] != 1) + ; /* XXX what about up-sampling? */ +#endif + } + } + + /* + * Must recalculate cached tile size in case sampling state changed. + * Should we really be doing this now if image size isn't set? + */ + if( tif->tif_tilesize > 0 ) + tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tmsize_t)(-1); + if( tif->tif_scanlinesize > 0 ) + tif->tif_scanlinesize = TIFFScanlineSize(tif); +} + +static int +JPEGVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + JPEGState* sp = JState(tif); + const TIFFField* fip; + uint32 v32; + + assert(sp != NULL); + + switch (tag) { + case TIFFTAG_JPEGTABLES: + v32 = (uint32) va_arg(ap, uint32); + if (v32 == 0) { + /* XXX */ + return (0); + } + _TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*), + (long) v32); + sp->jpegtables_length = v32; + TIFFSetFieldBit(tif, FIELD_JPEGTABLES); + break; + case TIFFTAG_JPEGQUALITY: + sp->jpegquality = (int) va_arg(ap, int); + return (1); /* pseudo tag */ + case TIFFTAG_JPEGCOLORMODE: + sp->jpegcolormode = (int) va_arg(ap, int); + JPEGResetUpsampled( tif ); + return (1); /* pseudo tag */ + case TIFFTAG_PHOTOMETRIC: + { + int ret_value = (*sp->vsetparent)(tif, tag, ap); + JPEGResetUpsampled( tif ); + return ret_value; + } + case TIFFTAG_JPEGTABLESMODE: + sp->jpegtablesmode = (int) va_arg(ap, int); + return (1); /* pseudo tag */ + case TIFFTAG_YCBCRSUBSAMPLING: + /* mark the fact that we have a real ycbcrsubsampling! */ + sp->ycbcrsampling_fetched = 1; + /* should we be recomputing upsampling info here? */ + return (*sp->vsetparent)(tif, tag, ap); + default: + return (*sp->vsetparent)(tif, tag, ap); + } + + if ((fip = TIFFFieldWithTag(tif, tag))) { + TIFFSetFieldBit(tif, fip->field_bit); + } else { + return (0); + } + + tif->tif_flags |= TIFF_DIRTYDIRECT; + return (1); +} + +static int +JPEGVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + JPEGState* sp = JState(tif); + + assert(sp != NULL); + + switch (tag) { + case TIFFTAG_JPEGTABLES: + *va_arg(ap, uint32*) = sp->jpegtables_length; + *va_arg(ap, void**) = sp->jpegtables; + break; + case TIFFTAG_JPEGQUALITY: + *va_arg(ap, int*) = sp->jpegquality; + break; + case TIFFTAG_JPEGCOLORMODE: + *va_arg(ap, int*) = sp->jpegcolormode; + break; + case TIFFTAG_JPEGTABLESMODE: + *va_arg(ap, int*) = sp->jpegtablesmode; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return (1); +} + +static void +JPEGPrintDir(TIFF* tif, FILE* fd, long flags) +{ + JPEGState* sp = JState(tif); + + assert(sp != NULL); + (void) flags; + + if( sp != NULL ) { + if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) + fprintf(fd, " JPEG Tables: (%lu bytes)\n", + (unsigned long) sp->jpegtables_length); + if (sp->printdir) + (*sp->printdir)(tif, fd, flags); + } +} + +static uint32 +JPEGDefaultStripSize(TIFF* tif, uint32 s) +{ + JPEGState* sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + + s = (*sp->defsparent)(tif, s); + if (s < td->td_imagelength) + s = TIFFroundup_32(s, td->td_ycbcrsubsampling[1] * DCTSIZE); + return (s); +} + +static void +JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) +{ + JPEGState* sp = JState(tif); + TIFFDirectory *td = &tif->tif_dir; + + (*sp->deftparent)(tif, tw, th); + *tw = TIFFroundup_32(*tw, td->td_ycbcrsubsampling[0] * DCTSIZE); + *th = TIFFroundup_32(*th, td->td_ycbcrsubsampling[1] * DCTSIZE); +} + +/* + * The JPEG library initialized used to be done in TIFFInitJPEG(), but + * now that we allow a TIFF file to be opened in update mode it is necessary + * to have some way of deciding whether compression or decompression is + * desired other than looking at tif->tif_mode. We accomplish this by + * examining {TILE/STRIP}BYTECOUNTS to see if there is a non-zero entry. + * If so, we assume decompression is desired. + * + * This is tricky, because TIFFInitJPEG() is called while the directory is + * being read, and generally speaking the BYTECOUNTS tag won't have been read + * at that point. So we try to defer jpeg library initialization till we + * do have that tag ... basically any access that might require the compressor + * or decompressor that occurs after the reading of the directory. + * + * In an ideal world compressors or decompressors would be setup + * at the point where a single tile or strip was accessed (for read or write) + * so that stuff like update of missing tiles, or replacement of tiles could + * be done. However, we aren't trying to crack that nut just yet ... + * + * NFW, Feb 3rd, 2003. + */ + +static int JPEGInitializeLibJPEG( TIFF * tif, int decompress ) +{ + JPEGState* sp = JState(tif); + + if(sp->cinfo_initialized) + { + if( !decompress && sp->cinfo.comm.is_decompressor ) + TIFFjpeg_destroy( sp ); + else if( decompress && !sp->cinfo.comm.is_decompressor ) + TIFFjpeg_destroy( sp ); + else + return 1; + + sp->cinfo_initialized = 0; + } + + /* + * Initialize libjpeg. + */ + if ( decompress ) { + if (!TIFFjpeg_create_decompress(sp)) + return (0); + } else { + if (!TIFFjpeg_create_compress(sp)) + return (0); + } + + sp->cinfo_initialized = TRUE; + + return 1; +} + +int +TIFFInitJPEG(TIFF* tif, int scheme) +{ + JPEGState* sp; + + assert(scheme == COMPRESSION_JPEG); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, jpegFields, TIFFArrayCount(jpegFields))) { + TIFFErrorExt(tif->tif_clientdata, + "TIFFInitJPEG", + "Merging JPEG codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof (JPEGState)); + + if (tif->tif_data == NULL) { + TIFFErrorExt(tif->tif_clientdata, + "TIFFInitJPEG", "No space for JPEG state block"); + return 0; + } + _TIFFmemset(tif->tif_data, 0, sizeof(JPEGState)); + + sp = JState(tif); + sp->tif = tif; /* back link */ + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */ + sp->printdir = tif->tif_tagmethods.printdir; + tif->tif_tagmethods.printdir = JPEGPrintDir; /* hook for codec tags */ + + /* Default values for codec-specific fields */ + sp->jpegtables = NULL; + sp->jpegtables_length = 0; + sp->jpegquality = 75; /* Default IJG quality */ + sp->jpegcolormode = JPEGCOLORMODE_RAW; + sp->jpegtablesmode = JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF; + sp->ycbcrsampling_fetched = 0; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = JPEGFixupTags; + tif->tif_setupdecode = JPEGSetupDecode; + tif->tif_predecode = JPEGPreDecode; + tif->tif_decoderow = JPEGDecode; + tif->tif_decodestrip = JPEGDecode; + tif->tif_decodetile = JPEGDecode; + tif->tif_setupencode = JPEGSetupEncode; + tif->tif_preencode = JPEGPreEncode; + tif->tif_postencode = JPEGPostEncode; + tif->tif_encoderow = JPEGEncode; + tif->tif_encodestrip = JPEGEncode; + tif->tif_encodetile = JPEGEncode; + tif->tif_cleanup = JPEGCleanup; + sp->defsparent = tif->tif_defstripsize; + tif->tif_defstripsize = JPEGDefaultStripSize; + sp->deftparent = tif->tif_deftilesize; + tif->tif_deftilesize = JPEGDefaultTileSize; + tif->tif_flags |= TIFF_NOBITREV; /* no bit reversal, please */ + + sp->cinfo_initialized = FALSE; + + /* + ** Create a JPEGTables field if no directory has yet been created. + ** We do this just to ensure that sufficient space is reserved for + ** the JPEGTables field. It will be properly created the right + ** size later. + */ + if( tif->tif_diroff == 0 ) + { +#define SIZE_OF_JPEGTABLES 2000 +/* +The following line assumes incorrectly that all JPEG-in-TIFF files will have +a JPEGTABLES tag generated and causes null-filled JPEGTABLES tags to be written +when the JPEG data is placed with TIFFWriteRawStrip. The field bit should be +set, anyway, later when actual JPEGTABLES header is generated, so removing it +here hopefully is harmless. + TIFFSetFieldBit(tif, FIELD_JPEGTABLES); +*/ + sp->jpegtables_length = SIZE_OF_JPEGTABLES; + sp->jpegtables = (void *) _TIFFmalloc(sp->jpegtables_length); + // FIXME: NULL-deref after malloc failure + _TIFFmemset(sp->jpegtables, 0, SIZE_OF_JPEGTABLES); +#undef SIZE_OF_JPEGTABLES + } + + return 1; +} +#endif /* JPEG_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg_12.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg_12.c new file mode 100644 index 0000000..87aaa19 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_jpeg_12.c @@ -0,0 +1,65 @@ + +#include "tiffiop.h" + +#if defined(JPEG_DUAL_MODE_8_12) + +# define TIFFInitJPEG TIFFInitJPEG_12 + +# include LIBJPEG_12_PATH + +# include "tif_jpeg.c" + +int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode ) + +{ + JPEGState* sp; + + assert(scheme == COMPRESSION_JPEG); + + sp = JState(tif); + sp->tif = tif; /* back link */ + + /* + * Override parent get/set field methods. + */ + tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */ + tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */ + tif->tif_tagmethods.printdir = JPEGPrintDir; /* hook for codec tags */ + + /* + * Install codec methods. + */ + tif->tif_fixuptags = JPEGFixupTags; + tif->tif_setupdecode = JPEGSetupDecode; + tif->tif_predecode = JPEGPreDecode; + tif->tif_decoderow = JPEGDecode; + tif->tif_decodestrip = JPEGDecode; + tif->tif_decodetile = JPEGDecode; + tif->tif_setupencode = JPEGSetupEncode; + tif->tif_preencode = JPEGPreEncode; + tif->tif_postencode = JPEGPostEncode; + tif->tif_encoderow = JPEGEncode; + tif->tif_encodestrip = JPEGEncode; + tif->tif_encodetile = JPEGEncode; + tif->tif_cleanup = JPEGCleanup; + tif->tif_defstripsize = JPEGDefaultStripSize; + tif->tif_deftilesize = JPEGDefaultTileSize; + tif->tif_flags |= TIFF_NOBITREV; /* no bit reversal, please */ + + sp->cinfo_initialized = FALSE; + + if( is_encode ) + return JPEGSetupEncode(tif); + else + return JPEGSetupDecode(tif); +} + +#endif /* defined(JPEG_DUAL_MODE_8_12) */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_luv.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_luv.c new file mode 100644 index 0000000..eba6c08 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_luv.c @@ -0,0 +1,1683 @@ +/* $Id: tif_luv.c,v 1.35 2011-04-02 20:54:09 bfriesen Exp $ */ + +/* + * Copyright (c) 1997 Greg Ward Larson + * Copyright (c) 1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler, Greg Larson and Silicon Graphics may not be used in any + * advertising or publicity relating to the software without the specific, + * prior written permission of Sam Leffler, Greg Larson and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER, GREG LARSON OR SILICON GRAPHICS BE LIABLE + * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef LOGLUV_SUPPORT + +/* + * TIFF Library. + * LogLuv compression support for high dynamic range images. + * + * Contributed by Greg Larson. + * + * LogLuv image support uses the TIFF library to store 16 or 10-bit + * log luminance values with 8 bits each of u and v or a 14-bit index. + * + * The codec can take as input and produce as output 32-bit IEEE float values + * as well as 16-bit integer values. A 16-bit luminance is interpreted + * as a sign bit followed by a 15-bit integer that is converted + * to and from a linear magnitude using the transformation: + * + * L = 2^( (Le+.5)/256 - 64 ) # real from 15-bit + * + * Le = floor( 256*(log2(L) + 64) ) # 15-bit from real + * + * The actual conversion to world luminance units in candelas per sq. meter + * requires an additional multiplier, which is stored in the TIFFTAG_STONITS. + * This value is usually set such that a reasonable exposure comes from + * clamping decoded luminances above 1 to 1 in the displayed image. + * + * The 16-bit values for u and v may be converted to real values by dividing + * each by 32768. (This allows for negative values, which aren't useful as + * far as we know, but are left in case of future improvements in human + * color vision.) + * + * Conversion from (u,v), which is actually the CIE (u',v') system for + * you color scientists, is accomplished by the following transformation: + * + * u = 4*x / (-2*x + 12*y + 3) + * v = 9*y / (-2*x + 12*y + 3) + * + * x = 9*u / (6*u - 16*v + 12) + * y = 4*v / (6*u - 16*v + 12) + * + * This process is greatly simplified by passing 32-bit IEEE floats + * for each of three CIE XYZ coordinates. The codec then takes care + * of conversion to and from LogLuv, though the application is still + * responsible for interpreting the TIFFTAG_STONITS calibration factor. + * + * By definition, a CIE XYZ vector of [1 1 1] corresponds to a neutral white + * point of (x,y)=(1/3,1/3). However, most color systems assume some other + * white point, such as D65, and an absolute color conversion to XYZ then + * to another color space with a different white point may introduce an + * unwanted color cast to the image. It is often desirable, therefore, to + * perform a white point conversion that maps the input white to [1 1 1] + * in XYZ, then record the original white point using the TIFFTAG_WHITEPOINT + * tag value. A decoder that demands absolute color calibration may use + * this white point tag to get back the original colors, but usually it + * will be ignored and the new white point will be used instead that + * matches the output color space. + * + * Pixel information is compressed into one of two basic encodings, depending + * on the setting of the compression tag, which is one of COMPRESSION_SGILOG + * or COMPRESSION_SGILOG24. For COMPRESSION_SGILOG, greyscale data is + * stored as: + * + * 1 15 + * |-+---------------| + * + * COMPRESSION_SGILOG color data is stored as: + * + * 1 15 8 8 + * |-+---------------|--------+--------| + * S Le ue ve + * + * For the 24-bit COMPRESSION_SGILOG24 color format, the data is stored as: + * + * 10 14 + * |----------|--------------| + * Le' Ce + * + * There is no sign bit in the 24-bit case, and the (u,v) chromaticity is + * encoded as an index for optimal color resolution. The 10 log bits are + * defined by the following conversions: + * + * L = 2^((Le'+.5)/64 - 12) # real from 10-bit + * + * Le' = floor( 64*(log2(L) + 12) ) # 10-bit from real + * + * The 10 bits of the smaller format may be converted into the 15 bits of + * the larger format by multiplying by 4 and adding 13314. Obviously, + * a smaller range of magnitudes is covered (about 5 orders of magnitude + * instead of 38), and the lack of a sign bit means that negative luminances + * are not allowed. (Well, they aren't allowed in the real world, either, + * but they are useful for certain types of image processing.) + * + * The desired user format is controlled by the setting the internal + * pseudo tag TIFFTAG_SGILOGDATAFMT to one of: + * SGILOGDATAFMT_FLOAT = IEEE 32-bit float XYZ values + * SGILOGDATAFMT_16BIT = 16-bit integer encodings of logL, u and v + * Raw data i/o is also possible using: + * SGILOGDATAFMT_RAW = 32-bit unsigned integer with encoded pixel + * In addition, the following decoding is provided for ease of display: + * SGILOGDATAFMT_8BIT = 8-bit default RGB gamma-corrected values + * + * For grayscale images, we provide the following data formats: + * SGILOGDATAFMT_FLOAT = IEEE 32-bit float Y values + * SGILOGDATAFMT_16BIT = 16-bit integer w/ encoded luminance + * SGILOGDATAFMT_8BIT = 8-bit gray monitor values + * + * Note that the COMPRESSION_SGILOG applies a simple run-length encoding + * scheme by separating the logL, u and v bytes for each row and applying + * a PackBits type of compression. Since the 24-bit encoding is not + * adaptive, the 32-bit color format takes less space in many cases. + * + * Further control is provided over the conversion from higher-resolution + * formats to final encoded values through the pseudo tag + * TIFFTAG_SGILOGENCODE: + * SGILOGENCODE_NODITHER = do not dither encoded values + * SGILOGENCODE_RANDITHER = apply random dithering during encoding + * + * The default value of this tag is SGILOGENCODE_NODITHER for + * COMPRESSION_SGILOG to maximize run-length encoding and + * SGILOGENCODE_RANDITHER for COMPRESSION_SGILOG24 to turn + * quantization errors into noise. + */ + +#include +#include +#include + +/* + * State block for each open TIFF + * file using LogLuv compression/decompression. + */ +typedef struct logLuvState LogLuvState; + +struct logLuvState { + int user_datafmt; /* user data format */ + int encode_meth; /* encoding method */ + int pixel_size; /* bytes per pixel */ + + uint8* tbuf; /* translation buffer */ + tmsize_t tbuflen; /* buffer length */ + void (*tfunc)(LogLuvState*, uint8*, tmsize_t); + + TIFFVSetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ +}; + +#define DecoderState(tif) ((LogLuvState*) (tif)->tif_data) +#define EncoderState(tif) ((LogLuvState*) (tif)->tif_data) + +#define SGILOGDATAFMT_UNKNOWN -1 + +#define MINRUN 4 /* minimum run length */ + +/* + * Decode a string of 16-bit gray pixels. + */ +static int +LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "LogL16Decode"; + LogLuvState* sp = DecoderState(tif); + int shft; + tmsize_t i; + tmsize_t npixels; + unsigned char* bp; + int16* tp; + int16 b; + tmsize_t cc; + int rc; + + assert(s == 0); + assert(sp != NULL); + + npixels = occ / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_16BIT) + tp = (int16*) op; + else { + assert(sp->tbuflen >= npixels); + tp = (int16*) sp->tbuf; + } + _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0])); + + bp = (unsigned char*) tif->tif_rawcp; + cc = tif->tif_rawcc; + /* get each byte string */ + for (shft = 2*8; (shft -= 8) >= 0; ) { + for (i = 0; i < npixels && cc > 0; ) + if (*bp >= 128) { /* run */ + rc = *bp++ + (2-128); /* TODO: potential input buffer overrun when decoding corrupt or truncated data */ + b = (int16)(*bp++ << shft); + cc -= 2; + while (rc-- && i < npixels) + tp[i++] |= b; + } else { /* non-run */ + rc = *bp++; /* nul is noop */ + while (--cc && rc-- && i < npixels) + tp[i++] |= (int16)*bp++ << shft; + } + if (i != npixels) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %I64d pixels)", + (unsigned long) tif->tif_row, + (unsigned __int64) (npixels - i)); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %llu pixels)", + (unsigned long) tif->tif_row, + (unsigned long long) (npixels - i)); +#endif + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + return (0); + } + } + (*sp->tfunc)(sp, op, npixels); + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + return (1); +} + +/* + * Decode a string of 24-bit pixels. + */ +static int +LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "LogLuvDecode24"; + LogLuvState* sp = DecoderState(tif); + tmsize_t cc; + tmsize_t i; + tmsize_t npixels; + unsigned char* bp; + uint32* tp; + + assert(s == 0); + assert(sp != NULL); + + npixels = occ / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_RAW) + tp = (uint32 *)op; + else { + assert(sp->tbuflen >= npixels); + tp = (uint32 *) sp->tbuf; + } + /* copy to array of uint32 */ + bp = (unsigned char*) tif->tif_rawcp; + cc = tif->tif_rawcc; + for (i = 0; i < npixels && cc > 0; i++) { + tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2]; + bp += 3; + cc -= 3; + } + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + if (i != npixels) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %I64d pixels)", + (unsigned long) tif->tif_row, + (unsigned __int64) (npixels - i)); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %llu pixels)", + (unsigned long) tif->tif_row, + (unsigned long long) (npixels - i)); +#endif + return (0); + } + (*sp->tfunc)(sp, op, npixels); + return (1); +} + +/* + * Decode a string of 32-bit pixels. + */ +static int +LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "LogLuvDecode32"; + LogLuvState* sp; + int shft; + tmsize_t i; + tmsize_t npixels; + unsigned char* bp; + uint32* tp; + uint32 b; + tmsize_t cc; + int rc; + + assert(s == 0); + sp = DecoderState(tif); + assert(sp != NULL); + + npixels = occ / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_RAW) + tp = (uint32*) op; + else { + assert(sp->tbuflen >= npixels); + tp = (uint32*) sp->tbuf; + } + _TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0])); + + bp = (unsigned char*) tif->tif_rawcp; + cc = tif->tif_rawcc; + /* get each byte string */ + for (shft = 4*8; (shft -= 8) >= 0; ) { + for (i = 0; i < npixels && cc > 0; ) + if (*bp >= 128) { /* run */ + rc = *bp++ + (2-128); + b = (uint32)*bp++ << shft; + cc -= 2; /* TODO: potential input buffer overrun when decoding corrupt or truncated data */ + while (rc-- && i < npixels) + tp[i++] |= b; + } else { /* non-run */ + rc = *bp++; /* nul is noop */ + while (--cc && rc-- && i < npixels) + tp[i++] |= (uint32)*bp++ << shft; + } + if (i != npixels) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %I64d pixels)", + (unsigned long) tif->tif_row, + (unsigned __int64) (npixels - i)); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at row %lu (short %llu pixels)", + (unsigned long) tif->tif_row, + (unsigned long long) (npixels - i)); +#endif + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + return (0); + } + } + (*sp->tfunc)(sp, op, npixels); + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + return (1); +} + +/* + * Decode a strip of pixels. We break it into rows to + * maintain synchrony with the encode algorithm, which + * is row by row. + */ +static int +LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + tmsize_t rowlen = TIFFScanlineSize(tif); + + assert(cc%rowlen == 0); + while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) + bp += rowlen, cc -= rowlen; + return (cc == 0); +} + +/* + * Decode a tile of pixels. We break it into rows to + * maintain synchrony with the encode algorithm, which + * is row by row. + */ +static int +LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + tmsize_t rowlen = TIFFTileRowSize(tif); + + assert(cc%rowlen == 0); + while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) + bp += rowlen, cc -= rowlen; + return (cc == 0); +} + +/* + * Encode a row of 16-bit pixels. + */ +static int +LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + LogLuvState* sp = EncoderState(tif); + int shft; + tmsize_t i; + tmsize_t j; + tmsize_t npixels; + uint8* op; + int16* tp; + int16 b; + tmsize_t occ; + int rc=0, mask; + tmsize_t beg; + + assert(s == 0); + assert(sp != NULL); + npixels = cc / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_16BIT) + tp = (int16*) bp; + else { + tp = (int16*) sp->tbuf; + assert(sp->tbuflen >= npixels); + (*sp->tfunc)(sp, bp, npixels); + } + /* compress each byte string */ + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + for (shft = 2*8; (shft -= 8) >= 0; ) + for (i = 0; i < npixels; i += rc) { + if (occ < 4) { + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + } + mask = 0xff << shft; /* find next run */ + for (beg = i; beg < npixels; beg += rc) { + b = (int16) (tp[beg] & mask); + rc = 1; + while (rc < 127+2 && beg+rc < npixels && + (tp[beg+rc] & mask) == b) + rc++; + if (rc >= MINRUN) + break; /* long enough */ + } + if (beg-i > 1 && beg-i < MINRUN) { + b = (int16) (tp[i] & mask);/*check short run */ + j = i+1; + while ((tp[j++] & mask) == b) + if (j == beg) { + *op++ = (uint8)(128-2+j-i); + *op++ = (uint8)(b >> shft); + occ -= 2; + i = beg; + break; + } + } + while (i < beg) { /* write out non-run */ + if ((j = beg-i) > 127) j = 127; + if (occ < j+3) { + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + } + *op++ = (uint8) j; occ--; + while (j--) { + *op++ = (uint8) (tp[i++] >> shft & 0xff); + occ--; + } + } + if (rc >= MINRUN) { /* write out run */ + *op++ = (uint8) (128-2+rc); + *op++ = (uint8) (tp[beg] >> shft & 0xff); + occ -= 2; + } else + rc = 0; + } + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + + return (1); +} + +/* + * Encode a row of 24-bit pixels. + */ +static int +LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + LogLuvState* sp = EncoderState(tif); + tmsize_t i; + tmsize_t npixels; + tmsize_t occ; + uint8* op; + uint32* tp; + + assert(s == 0); + assert(sp != NULL); + npixels = cc / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_RAW) + tp = (uint32*) bp; + else { + tp = (uint32*) sp->tbuf; + assert(sp->tbuflen >= npixels); + (*sp->tfunc)(sp, bp, npixels); + } + /* write out encoded pixels */ + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + for (i = npixels; i--; ) { + if (occ < 3) { + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + } + *op++ = (uint8)(*tp >> 16); + *op++ = (uint8)(*tp >> 8 & 0xff); + *op++ = (uint8)(*tp++ & 0xff); + occ -= 3; + } + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + + return (1); +} + +/* + * Encode a row of 32-bit pixels. + */ +static int +LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + LogLuvState* sp = EncoderState(tif); + int shft; + tmsize_t i; + tmsize_t j; + tmsize_t npixels; + uint8* op; + uint32* tp; + uint32 b; + tmsize_t occ; + int rc=0, mask; + tmsize_t beg; + + assert(s == 0); + assert(sp != NULL); + + npixels = cc / sp->pixel_size; + + if (sp->user_datafmt == SGILOGDATAFMT_RAW) + tp = (uint32*) bp; + else { + tp = (uint32*) sp->tbuf; + assert(sp->tbuflen >= npixels); + (*sp->tfunc)(sp, bp, npixels); + } + /* compress each byte string */ + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + for (shft = 4*8; (shft -= 8) >= 0; ) + for (i = 0; i < npixels; i += rc) { + if (occ < 4) { + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + } + mask = 0xff << shft; /* find next run */ + for (beg = i; beg < npixels; beg += rc) { + b = tp[beg] & mask; + rc = 1; + while (rc < 127+2 && beg+rc < npixels && + (tp[beg+rc] & mask) == b) + rc++; + if (rc >= MINRUN) + break; /* long enough */ + } + if (beg-i > 1 && beg-i < MINRUN) { + b = tp[i] & mask; /* check short run */ + j = i+1; + while ((tp[j++] & mask) == b) + if (j == beg) { + *op++ = (uint8)(128-2+j-i); + *op++ = (uint8)(b >> shft); + occ -= 2; + i = beg; + break; + } + } + while (i < beg) { /* write out non-run */ + if ((j = beg-i) > 127) j = 127; + if (occ < j+3) { + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + occ = tif->tif_rawdatasize - tif->tif_rawcc; + } + *op++ = (uint8) j; occ--; + while (j--) { + *op++ = (uint8)(tp[i++] >> shft & 0xff); + occ--; + } + } + if (rc >= MINRUN) { /* write out run */ + *op++ = (uint8) (128-2+rc); + *op++ = (uint8)(tp[beg] >> shft & 0xff); + occ -= 2; + } else + rc = 0; + } + tif->tif_rawcp = op; + tif->tif_rawcc = tif->tif_rawdatasize - occ; + + return (1); +} + +/* + * Encode a strip of pixels. We break it into rows to + * avoid encoding runs across row boundaries. + */ +static int +LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + tmsize_t rowlen = TIFFScanlineSize(tif); + + assert(cc%rowlen == 0); + while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1) + bp += rowlen, cc -= rowlen; + return (cc == 0); +} + +/* + * Encode a tile of pixels. We break it into rows to + * avoid encoding runs across row boundaries. + */ +static int +LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + tmsize_t rowlen = TIFFTileRowSize(tif); + + assert(cc%rowlen == 0); + while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1) + bp += rowlen, cc -= rowlen; + return (cc == 0); +} + +/* + * Encode/Decode functions for converting to and from user formats. + */ + +#include "uvcode.h" + +#ifndef UVSCALE +#define U_NEU 0.210526316 +#define V_NEU 0.473684211 +#define UVSCALE 410. +#endif + +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 +#endif +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#define log2(x) ((1./M_LN2)*log(x)) +#define exp2(x) exp(M_LN2*(x)) + +#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \ + (int)(x) : \ + (int)((x) + rand()*(1./RAND_MAX) - .5)) + +#if !LOGLUV_PUBLIC +static +#endif +double +LogL16toY(int p16) /* compute luminance from 16-bit LogL */ +{ + int Le = p16 & 0x7fff; + double Y; + + if (!Le) + return (0.); + Y = exp(M_LN2/256.*(Le+.5) - M_LN2*64.); + return (!(p16 & 0x8000) ? Y : -Y); +} + +#if !LOGLUV_PUBLIC +static +#endif +int +LogL16fromY(double Y, int em) /* get 16-bit LogL from Y */ +{ + if (Y >= 1.8371976e19) + return (0x7fff); + if (Y <= -1.8371976e19) + return (0xffff); + if (Y > 5.4136769e-20) + return itrunc(256.*(log2(Y) + 64.), em); + if (Y < -5.4136769e-20) + return (~0x7fff | itrunc(256.*(log2(-Y) + 64.), em)); + return (0); +} + +static void +L16toY(LogLuvState* sp, uint8* op, tmsize_t n) +{ + int16* l16 = (int16*) sp->tbuf; + float* yp = (float*) op; + + while (n-- > 0) + *yp++ = (float)LogL16toY(*l16++); +} + +static void +L16toGry(LogLuvState* sp, uint8* op, tmsize_t n) +{ + int16* l16 = (int16*) sp->tbuf; + uint8* gp = (uint8*) op; + + while (n-- > 0) { + double Y = LogL16toY(*l16++); + *gp++ = (uint8) ((Y <= 0.) ? 0 : (Y >= 1.) ? 255 : (int)(256.*sqrt(Y))); + } +} + +static void +L16fromY(LogLuvState* sp, uint8* op, tmsize_t n) +{ + int16* l16 = (int16*) sp->tbuf; + float* yp = (float*) op; + + while (n-- > 0) + *l16++ = (int16) (LogL16fromY(*yp++, sp->encode_meth)); +} + +#if !LOGLUV_PUBLIC +static +#endif +void +XYZtoRGB24(float xyz[3], uint8 rgb[3]) +{ + double r, g, b; + /* assume CCIR-709 primaries */ + r = 2.690*xyz[0] + -1.276*xyz[1] + -0.414*xyz[2]; + g = -1.022*xyz[0] + 1.978*xyz[1] + 0.044*xyz[2]; + b = 0.061*xyz[0] + -0.224*xyz[1] + 1.163*xyz[2]; + /* assume 2.0 gamma for speed */ + /* could use integer sqrt approx., but this is probably faster */ + rgb[0] = (uint8)((r<=0.) ? 0 : (r >= 1.) ? 255 : (int)(256.*sqrt(r))); + rgb[1] = (uint8)((g<=0.) ? 0 : (g >= 1.) ? 255 : (int)(256.*sqrt(g))); + rgb[2] = (uint8)((b<=0.) ? 0 : (b >= 1.) ? 255 : (int)(256.*sqrt(b))); +} + +#if !LOGLUV_PUBLIC +static +#endif +double +LogL10toY(int p10) /* compute luminance from 10-bit LogL */ +{ + if (p10 == 0) + return (0.); + return (exp(M_LN2/64.*(p10+.5) - M_LN2*12.)); +} + +#if !LOGLUV_PUBLIC +static +#endif +int +LogL10fromY(double Y, int em) /* get 10-bit LogL from Y */ +{ + if (Y >= 15.742) + return (0x3ff); + else if (Y <= .00024283) + return (0); + else + return itrunc(64.*(log2(Y) + 12.), em); +} + +#define NANGLES 100 +#define uv2ang(u, v) ( (NANGLES*.499999999/M_PI) \ + * atan2((v)-V_NEU,(u)-U_NEU) + .5*NANGLES ) + +static int +oog_encode(double u, double v) /* encode out-of-gamut chroma */ +{ + static int oog_table[NANGLES]; + static int initialized = 0; + register int i; + + if (!initialized) { /* set up perimeter table */ + double eps[NANGLES], ua, va, ang, epsa; + int ui, vi, ustep; + for (i = NANGLES; i--; ) + eps[i] = 2.; + for (vi = UV_NVS; vi--; ) { + va = UV_VSTART + (vi+.5)*UV_SQSIZ; + ustep = uv_row[vi].nus-1; + if (vi == UV_NVS-1 || vi == 0 || ustep <= 0) + ustep = 1; + for (ui = uv_row[vi].nus-1; ui >= 0; ui -= ustep) { + ua = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ; + ang = uv2ang(ua, va); + i = (int) ang; + epsa = fabs(ang - (i+.5)); + if (epsa < eps[i]) { + oog_table[i] = uv_row[vi].ncum + ui; + eps[i] = epsa; + } + } + } + for (i = NANGLES; i--; ) /* fill any holes */ + if (eps[i] > 1.5) { + int i1, i2; + for (i1 = 1; i1 < NANGLES/2; i1++) + if (eps[(i+i1)%NANGLES] < 1.5) + break; + for (i2 = 1; i2 < NANGLES/2; i2++) + if (eps[(i+NANGLES-i2)%NANGLES] < 1.5) + break; + if (i1 < i2) + oog_table[i] = + oog_table[(i+i1)%NANGLES]; + else + oog_table[i] = + oog_table[(i+NANGLES-i2)%NANGLES]; + } + initialized = 1; + } + i = (int) uv2ang(u, v); /* look up hue angle */ + return (oog_table[i]); +} + +#undef uv2ang +#undef NANGLES + +#if !LOGLUV_PUBLIC +static +#endif +int +uv_encode(double u, double v, int em) /* encode (u',v') coordinates */ +{ + register int vi, ui; + + if (v < UV_VSTART) + return oog_encode(u, v); + vi = itrunc((v - UV_VSTART)*(1./UV_SQSIZ), em); + if (vi >= UV_NVS) + return oog_encode(u, v); + if (u < uv_row[vi].ustart) + return oog_encode(u, v); + ui = itrunc((u - uv_row[vi].ustart)*(1./UV_SQSIZ), em); + if (ui >= uv_row[vi].nus) + return oog_encode(u, v); + + return (uv_row[vi].ncum + ui); +} + +#if !LOGLUV_PUBLIC +static +#endif +int +uv_decode(double *up, double *vp, int c) /* decode (u',v') index */ +{ + int upper, lower; + register int ui, vi; + + if (c < 0 || c >= UV_NDIVS) + return (-1); + lower = 0; /* binary search */ + upper = UV_NVS; + while (upper - lower > 1) { + vi = (lower + upper) >> 1; + ui = c - uv_row[vi].ncum; + if (ui > 0) + lower = vi; + else if (ui < 0) + upper = vi; + else { + lower = vi; + break; + } + } + vi = lower; + ui = c - uv_row[vi].ncum; + *up = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ; + *vp = UV_VSTART + (vi+.5)*UV_SQSIZ; + return (0); +} + +#if !LOGLUV_PUBLIC +static +#endif +void +LogLuv24toXYZ(uint32 p, float XYZ[3]) +{ + int Ce; + double L, u, v, s, x, y; + /* decode luminance */ + L = LogL10toY(p>>14 & 0x3ff); + if (L <= 0.) { + XYZ[0] = XYZ[1] = XYZ[2] = 0.; + return; + } + /* decode color */ + Ce = p & 0x3fff; + if (uv_decode(&u, &v, Ce) < 0) { + u = U_NEU; v = V_NEU; + } + s = 1./(6.*u - 16.*v + 12.); + x = 9.*u * s; + y = 4.*v * s; + /* convert to XYZ */ + XYZ[0] = (float)(x/y * L); + XYZ[1] = (float)L; + XYZ[2] = (float)((1.-x-y)/y * L); +} + +#if !LOGLUV_PUBLIC +static +#endif +uint32 +LogLuv24fromXYZ(float XYZ[3], int em) +{ + int Le, Ce; + double u, v, s; + /* encode luminance */ + Le = LogL10fromY(XYZ[1], em); + /* encode color */ + s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2]; + if (!Le || s <= 0.) { + u = U_NEU; + v = V_NEU; + } else { + u = 4.*XYZ[0] / s; + v = 9.*XYZ[1] / s; + } + Ce = uv_encode(u, v, em); + if (Ce < 0) /* never happens */ + Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER); + /* combine encodings */ + return (Le << 14 | Ce); +} + +static void +Luv24toXYZ(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + float* xyz = (float*) op; + + while (n-- > 0) { + LogLuv24toXYZ(*luv, xyz); + xyz += 3; + luv++; + } +} + +static void +Luv24toLuv48(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + int16* luv3 = (int16*) op; + + while (n-- > 0) { + double u, v; + + *luv3++ = (int16)((*luv >> 12 & 0xffd) + 13314); + if (uv_decode(&u, &v, *luv&0x3fff) < 0) { + u = U_NEU; + v = V_NEU; + } + *luv3++ = (int16)(u * (1L<<15)); + *luv3++ = (int16)(v * (1L<<15)); + luv++; + } +} + +static void +Luv24toRGB(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + uint8* rgb = (uint8*) op; + + while (n-- > 0) { + float xyz[3]; + + LogLuv24toXYZ(*luv++, xyz); + XYZtoRGB24(xyz, rgb); + rgb += 3; + } +} + +static void +Luv24fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + float* xyz = (float*) op; + + while (n-- > 0) { + *luv++ = LogLuv24fromXYZ(xyz, sp->encode_meth); + xyz += 3; + } +} + +static void +Luv24fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + int16* luv3 = (int16*) op; + + while (n-- > 0) { + int Le, Ce; + + if (luv3[0] <= 0) + Le = 0; + else if (luv3[0] >= (1<<12)+3314) + Le = (1<<10) - 1; + else if (sp->encode_meth == SGILOGENCODE_NODITHER) + Le = (luv3[0]-3314) >> 2; + else + Le = itrunc(.25*(luv3[0]-3314.), sp->encode_meth); + + Ce = uv_encode((luv3[1]+.5)/(1<<15), (luv3[2]+.5)/(1<<15), + sp->encode_meth); + if (Ce < 0) /* never happens */ + Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER); + *luv++ = (uint32)Le << 14 | Ce; + luv3 += 3; + } +} + +#if !LOGLUV_PUBLIC +static +#endif +void +LogLuv32toXYZ(uint32 p, float XYZ[3]) +{ + double L, u, v, s, x, y; + /* decode luminance */ + L = LogL16toY((int)p >> 16); + if (L <= 0.) { + XYZ[0] = XYZ[1] = XYZ[2] = 0.; + return; + } + /* decode color */ + u = 1./UVSCALE * ((p>>8 & 0xff) + .5); + v = 1./UVSCALE * ((p & 0xff) + .5); + s = 1./(6.*u - 16.*v + 12.); + x = 9.*u * s; + y = 4.*v * s; + /* convert to XYZ */ + XYZ[0] = (float)(x/y * L); + XYZ[1] = (float)L; + XYZ[2] = (float)((1.-x-y)/y * L); +} + +#if !LOGLUV_PUBLIC +static +#endif +uint32 +LogLuv32fromXYZ(float XYZ[3], int em) +{ + unsigned int Le, ue, ve; + double u, v, s; + /* encode luminance */ + Le = (unsigned int)LogL16fromY(XYZ[1], em); + /* encode color */ + s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2]; + if (!Le || s <= 0.) { + u = U_NEU; + v = V_NEU; + } else { + u = 4.*XYZ[0] / s; + v = 9.*XYZ[1] / s; + } + if (u <= 0.) ue = 0; + else ue = itrunc(UVSCALE*u, em); + if (ue > 255) ue = 255; + if (v <= 0.) ve = 0; + else ve = itrunc(UVSCALE*v, em); + if (ve > 255) ve = 255; + /* combine encodings */ + return (Le << 16 | ue << 8 | ve); +} + +static void +Luv32toXYZ(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + float* xyz = (float*) op; + + while (n-- > 0) { + LogLuv32toXYZ(*luv++, xyz); + xyz += 3; + } +} + +static void +Luv32toLuv48(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + int16* luv3 = (int16*) op; + + while (n-- > 0) { + double u, v; + + *luv3++ = (int16)(*luv >> 16); + u = 1./UVSCALE * ((*luv>>8 & 0xff) + .5); + v = 1./UVSCALE * ((*luv & 0xff) + .5); + *luv3++ = (int16)(u * (1L<<15)); + *luv3++ = (int16)(v * (1L<<15)); + luv++; + } +} + +static void +Luv32toRGB(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + uint8* rgb = (uint8*) op; + + while (n-- > 0) { + float xyz[3]; + + LogLuv32toXYZ(*luv++, xyz); + XYZtoRGB24(xyz, rgb); + rgb += 3; + } +} + +static void +Luv32fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + float* xyz = (float*) op; + + while (n-- > 0) { + *luv++ = LogLuv32fromXYZ(xyz, sp->encode_meth); + xyz += 3; + } +} + +static void +Luv32fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n) +{ + uint32* luv = (uint32*) sp->tbuf; + int16* luv3 = (int16*) op; + + if (sp->encode_meth == SGILOGENCODE_NODITHER) { + while (n-- > 0) { + *luv++ = (uint32)luv3[0] << 16 | + (luv3[1]*(uint32)(UVSCALE+.5) >> 7 & 0xff00) | + (luv3[2]*(uint32)(UVSCALE+.5) >> 15 & 0xff); + luv3 += 3; + } + return; + } + while (n-- > 0) { + *luv++ = (uint32)luv3[0] << 16 | + (itrunc(luv3[1]*(UVSCALE/(1<<15)), sp->encode_meth) << 8 & 0xff00) | + (itrunc(luv3[2]*(UVSCALE/(1<<15)), sp->encode_meth) & 0xff); + luv3 += 3; + } +} + +static void +_logLuvNop(LogLuvState* sp, uint8* op, tmsize_t n) +{ + (void) sp; (void) op; (void) n; +} + +static int +LogL16GuessDataFmt(TIFFDirectory *td) +{ +#define PACK(s,b,f) (((b)<<6)|((s)<<3)|(f)) + switch (PACK(td->td_samplesperpixel, td->td_bitspersample, td->td_sampleformat)) { + case PACK(1, 32, SAMPLEFORMAT_IEEEFP): + return (SGILOGDATAFMT_FLOAT); + case PACK(1, 16, SAMPLEFORMAT_VOID): + case PACK(1, 16, SAMPLEFORMAT_INT): + case PACK(1, 16, SAMPLEFORMAT_UINT): + return (SGILOGDATAFMT_16BIT); + case PACK(1, 8, SAMPLEFORMAT_VOID): + case PACK(1, 8, SAMPLEFORMAT_UINT): + return (SGILOGDATAFMT_8BIT); + } +#undef PACK + return (SGILOGDATAFMT_UNKNOWN); +} + +static tmsize_t +multiply_ms(tmsize_t m1, tmsize_t m2) +{ + tmsize_t bytes = m1 * m2; + + if (m1 && bytes / m1 != m2) + bytes = 0; + + return bytes; +} + +static int +LogL16InitState(TIFF* tif) +{ + static const char module[] = "LogL16InitState"; + TIFFDirectory *td = &tif->tif_dir; + LogLuvState* sp = DecoderState(tif); + + assert(sp != NULL); + assert(td->td_photometric == PHOTOMETRIC_LOGL); + + /* for some reason, we can't do this in TIFFInitLogL16 */ + if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN) + sp->user_datafmt = LogL16GuessDataFmt(td); + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->pixel_size = sizeof (float); + break; + case SGILOGDATAFMT_16BIT: + sp->pixel_size = sizeof (int16); + break; + case SGILOGDATAFMT_8BIT: + sp->pixel_size = sizeof (uint8); + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "No support for converting user data format to LogL"); + return (0); + } + if( isTiled(tif) ) + sp->tbuflen = multiply_ms(td->td_tilewidth, td->td_tilelength); + else + sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_rowsperstrip); + if (multiply_ms(sp->tbuflen, sizeof (int16)) == 0 || + (sp->tbuf = (uint8*) _TIFFmalloc(sp->tbuflen * sizeof (int16))) == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, "No space for SGILog translation buffer"); + return (0); + } + return (1); +} + +static int +LogLuvGuessDataFmt(TIFFDirectory *td) +{ + int guess; + + /* + * If the user didn't tell us their datafmt, + * take our best guess from the bitspersample. + */ +#define PACK(a,b) (((a)<<3)|(b)) + switch (PACK(td->td_bitspersample, td->td_sampleformat)) { + case PACK(32, SAMPLEFORMAT_IEEEFP): + guess = SGILOGDATAFMT_FLOAT; + break; + case PACK(32, SAMPLEFORMAT_VOID): + case PACK(32, SAMPLEFORMAT_UINT): + case PACK(32, SAMPLEFORMAT_INT): + guess = SGILOGDATAFMT_RAW; + break; + case PACK(16, SAMPLEFORMAT_VOID): + case PACK(16, SAMPLEFORMAT_INT): + case PACK(16, SAMPLEFORMAT_UINT): + guess = SGILOGDATAFMT_16BIT; + break; + case PACK( 8, SAMPLEFORMAT_VOID): + case PACK( 8, SAMPLEFORMAT_UINT): + guess = SGILOGDATAFMT_8BIT; + break; + default: + guess = SGILOGDATAFMT_UNKNOWN; + break; +#undef PACK + } + /* + * Double-check samples per pixel. + */ + switch (td->td_samplesperpixel) { + case 1: + if (guess != SGILOGDATAFMT_RAW) + guess = SGILOGDATAFMT_UNKNOWN; + break; + case 3: + if (guess == SGILOGDATAFMT_RAW) + guess = SGILOGDATAFMT_UNKNOWN; + break; + default: + guess = SGILOGDATAFMT_UNKNOWN; + break; + } + return (guess); +} + +static int +LogLuvInitState(TIFF* tif) +{ + static const char module[] = "LogLuvInitState"; + TIFFDirectory* td = &tif->tif_dir; + LogLuvState* sp = DecoderState(tif); + + assert(sp != NULL); + assert(td->td_photometric == PHOTOMETRIC_LOGLUV); + + /* for some reason, we can't do this in TIFFInitLogLuv */ + if (td->td_planarconfig != PLANARCONFIG_CONTIG) { + TIFFErrorExt(tif->tif_clientdata, module, + "SGILog compression cannot handle non-contiguous data"); + return (0); + } + if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN) + sp->user_datafmt = LogLuvGuessDataFmt(td); + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->pixel_size = 3*sizeof (float); + break; + case SGILOGDATAFMT_16BIT: + sp->pixel_size = 3*sizeof (int16); + break; + case SGILOGDATAFMT_RAW: + sp->pixel_size = sizeof (uint32); + break; + case SGILOGDATAFMT_8BIT: + sp->pixel_size = 3*sizeof (uint8); + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "No support for converting user data format to LogLuv"); + return (0); + } + if( isTiled(tif) ) + sp->tbuflen = multiply_ms(td->td_tilewidth, td->td_tilelength); + else + sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_rowsperstrip); + if (multiply_ms(sp->tbuflen, sizeof (uint32)) == 0 || + (sp->tbuf = (uint8*) _TIFFmalloc(sp->tbuflen * sizeof (uint32))) == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, "No space for SGILog translation buffer"); + return (0); + } + return (1); +} + +static int +LogLuvFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +static int +LogLuvSetupDecode(TIFF* tif) +{ + static const char module[] = "LogLuvSetupDecode"; + LogLuvState* sp = DecoderState(tif); + TIFFDirectory* td = &tif->tif_dir; + + tif->tif_postdecode = _TIFFNoPostDecode; + switch (td->td_photometric) { + case PHOTOMETRIC_LOGLUV: + if (!LogLuvInitState(tif)) + break; + if (td->td_compression == COMPRESSION_SGILOG24) { + tif->tif_decoderow = LogLuvDecode24; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = Luv24toXYZ; + break; + case SGILOGDATAFMT_16BIT: + sp->tfunc = Luv24toLuv48; + break; + case SGILOGDATAFMT_8BIT: + sp->tfunc = Luv24toRGB; + break; + } + } else { + tif->tif_decoderow = LogLuvDecode32; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = Luv32toXYZ; + break; + case SGILOGDATAFMT_16BIT: + sp->tfunc = Luv32toLuv48; + break; + case SGILOGDATAFMT_8BIT: + sp->tfunc = Luv32toRGB; + break; + } + } + return (1); + case PHOTOMETRIC_LOGL: + if (!LogL16InitState(tif)) + break; + tif->tif_decoderow = LogL16Decode; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = L16toY; + break; + case SGILOGDATAFMT_8BIT: + sp->tfunc = L16toGry; + break; + } + return (1); + default: + TIFFErrorExt(tif->tif_clientdata, module, + "Inappropriate photometric interpretation %d for SGILog compression; %s", + td->td_photometric, "must be either LogLUV or LogL"); + break; + } + return (0); +} + +static int +LogLuvSetupEncode(TIFF* tif) +{ + static const char module[] = "LogLuvSetupEncode"; + LogLuvState* sp = EncoderState(tif); + TIFFDirectory* td = &tif->tif_dir; + + switch (td->td_photometric) { + case PHOTOMETRIC_LOGLUV: + if (!LogLuvInitState(tif)) + break; + if (td->td_compression == COMPRESSION_SGILOG24) { + tif->tif_encoderow = LogLuvEncode24; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = Luv24fromXYZ; + break; + case SGILOGDATAFMT_16BIT: + sp->tfunc = Luv24fromLuv48; + break; + case SGILOGDATAFMT_RAW: + break; + default: + goto notsupported; + } + } else { + tif->tif_encoderow = LogLuvEncode32; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = Luv32fromXYZ; + break; + case SGILOGDATAFMT_16BIT: + sp->tfunc = Luv32fromLuv48; + break; + case SGILOGDATAFMT_RAW: + break; + default: + goto notsupported; + } + } + break; + case PHOTOMETRIC_LOGL: + if (!LogL16InitState(tif)) + break; + tif->tif_encoderow = LogL16Encode; + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + sp->tfunc = L16fromY; + break; + case SGILOGDATAFMT_16BIT: + break; + default: + goto notsupported; + } + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "Inappropriate photometric interpretation %d for SGILog compression; %s", + td->td_photometric, "must be either LogLUV or LogL"); + break; + } + return (1); +notsupported: + TIFFErrorExt(tif->tif_clientdata, module, + "SGILog compression supported only for %s, or raw data", + td->td_photometric == PHOTOMETRIC_LOGL ? "Y, L" : "XYZ, Luv"); + return (0); +} + +static void +LogLuvClose(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + + /* + * For consistency, we always want to write out the same + * bitspersample and sampleformat for our TIFF file, + * regardless of the data format being used by the application. + * Since this routine is called after tags have been set but + * before they have been recorded in the file, we reset them here. + */ + td->td_samplesperpixel = + (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3; + td->td_bitspersample = 16; + td->td_sampleformat = SAMPLEFORMAT_INT; +} + +static void +LogLuvCleanup(TIFF* tif) +{ + LogLuvState* sp = (LogLuvState *)tif->tif_data; + + assert(sp != 0); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + + if (sp->tbuf) + _TIFFfree(sp->tbuf); + _TIFFfree(sp); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +static int +LogLuvVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[] = "LogLuvVSetField"; + LogLuvState* sp = DecoderState(tif); + int bps, fmt; + + switch (tag) { + case TIFFTAG_SGILOGDATAFMT: + sp->user_datafmt = (int) va_arg(ap, int); + /* + * Tweak the TIFF header so that the rest of libtiff knows what + * size of data will be passed between app and library, and + * assume that the app knows what it is doing and is not + * confused by these header manipulations... + */ + switch (sp->user_datafmt) { + case SGILOGDATAFMT_FLOAT: + bps = 32, fmt = SAMPLEFORMAT_IEEEFP; + break; + case SGILOGDATAFMT_16BIT: + bps = 16, fmt = SAMPLEFORMAT_INT; + break; + case SGILOGDATAFMT_RAW: + bps = 32, fmt = SAMPLEFORMAT_UINT; + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); + break; + case SGILOGDATAFMT_8BIT: + bps = 8, fmt = SAMPLEFORMAT_UINT; + break; + default: + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "Unknown data format %d for LogLuv compression", + sp->user_datafmt); + return (0); + } + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, fmt); + /* + * Must recalculate sizes should bits/sample change. + */ + tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tmsize_t) -1; + tif->tif_scanlinesize = TIFFScanlineSize(tif); + return (1); + case TIFFTAG_SGILOGENCODE: + sp->encode_meth = (int) va_arg(ap, int); + if (sp->encode_meth != SGILOGENCODE_NODITHER && + sp->encode_meth != SGILOGENCODE_RANDITHER) { + TIFFErrorExt(tif->tif_clientdata, module, + "Unknown encoding %d for LogLuv compression", + sp->encode_meth); + return (0); + } + return (1); + default: + return (*sp->vsetparent)(tif, tag, ap); + } +} + +static int +LogLuvVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + LogLuvState *sp = (LogLuvState *)tif->tif_data; + + switch (tag) { + case TIFFTAG_SGILOGDATAFMT: + *va_arg(ap, int*) = sp->user_datafmt; + return (1); + default: + return (*sp->vgetparent)(tif, tag, ap); + } +} + +static const TIFFField LogLuvFields[] = { + { TIFFTAG_SGILOGDATAFMT, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "SGILogDataFmt", NULL}, + { TIFFTAG_SGILOGENCODE, 0, 0, TIFF_SHORT, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "SGILogEncode", NULL} +}; + +int +TIFFInitSGILog(TIFF* tif, int scheme) +{ + static const char module[] = "TIFFInitSGILog"; + LogLuvState* sp; + + assert(scheme == COMPRESSION_SGILOG24 || scheme == COMPRESSION_SGILOG); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, LogLuvFields, + TIFFArrayCount(LogLuvFields))) { + TIFFErrorExt(tif->tif_clientdata, module, + "Merging SGILog codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof (LogLuvState)); + if (tif->tif_data == NULL) + goto bad; + sp = (LogLuvState*) tif->tif_data; + _TIFFmemset((void*)sp, 0, sizeof (*sp)); + sp->user_datafmt = SGILOGDATAFMT_UNKNOWN; + sp->encode_meth = (scheme == COMPRESSION_SGILOG24) ? + SGILOGENCODE_RANDITHER : SGILOGENCODE_NODITHER; + sp->tfunc = _logLuvNop; + + /* + * Install codec methods. + * NB: tif_decoderow & tif_encoderow are filled + * in at setup time. + */ + tif->tif_fixuptags = LogLuvFixupTags; + tif->tif_setupdecode = LogLuvSetupDecode; + tif->tif_decodestrip = LogLuvDecodeStrip; + tif->tif_decodetile = LogLuvDecodeTile; + tif->tif_setupencode = LogLuvSetupEncode; + tif->tif_encodestrip = LogLuvEncodeStrip; + tif->tif_encodetile = LogLuvEncodeTile; + tif->tif_close = LogLuvClose; + tif->tif_cleanup = LogLuvCleanup; + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = LogLuvVGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = LogLuvVSetField; /* hook for codec tags */ + + return (1); +bad: + TIFFErrorExt(tif->tif_clientdata, module, + "%s: No space for LogLuv state block", tif->tif_name); + return (0); +} +#endif /* LOGLUV_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzma.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzma.c new file mode 100644 index 0000000..dedf1d9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzma.c @@ -0,0 +1,495 @@ +/* $Id: tif_lzma.c,v 1.4 2011-12-22 00:29:29 bfriesen Exp $ */ + +/* + * Copyright (c) 2010, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef LZMA_SUPPORT +/* + * TIFF Library. + * + * LZMA2 Compression Support + * + * You need an LZMA2 SDK to link with. See http://tukaani.org/xz/ for details. + * + * The codec is derived from ZLIB codec (tif_zip.c). + */ + +#include "tif_predict.h" +#include "lzma.h" + +#include + +/* + * State block for each open TIFF file using LZMA2 compression/decompression. + */ +typedef struct { + TIFFPredictorState predict; + lzma_stream stream; + lzma_filter filters[LZMA_FILTERS_MAX + 1]; + lzma_options_delta opt_delta; /* delta filter options */ + lzma_options_lzma opt_lzma; /* LZMA2 filter options */ + int preset; /* compression level */ + lzma_check check; /* type of the integrity check */ + int state; /* state flags */ +#define LSTATE_INIT_DECODE 0x01 +#define LSTATE_INIT_ENCODE 0x02 + + TIFFVGetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ +} LZMAState; + +#define LState(tif) ((LZMAState*) (tif)->tif_data) +#define DecoderState(tif) LState(tif) +#define EncoderState(tif) LState(tif) + +static int LZMAEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s); +static int LZMADecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s); + +static const char * +LZMAStrerror(lzma_ret ret) +{ + switch (ret) { + case LZMA_OK: + return "operation completed successfully"; + case LZMA_STREAM_END: + return "end of stream was reached"; + case LZMA_NO_CHECK: + return "input stream has no integrity check"; + case LZMA_UNSUPPORTED_CHECK: + return "cannot calculate the integrity check"; + case LZMA_GET_CHECK: + return "integrity check type is now available"; + case LZMA_MEM_ERROR: + return "cannot allocate memory"; + case LZMA_MEMLIMIT_ERROR: + return "memory usage limit was reached"; + case LZMA_FORMAT_ERROR: + return "file format not recognized"; + case LZMA_OPTIONS_ERROR: + return "invalid or unsupported options"; + case LZMA_DATA_ERROR: + return "data is corrupt"; + case LZMA_BUF_ERROR: + return "no progress is possible (stream is truncated or corrupt)"; + case LZMA_PROG_ERROR: + return "programming error"; + default: + return "unindentified liblzma error"; + } +} + +static int +LZMAFixupTags(TIFF* tif) +{ + (void) tif; + return 1; +} + +static int +LZMASetupDecode(TIFF* tif) +{ + LZMAState* sp = DecoderState(tif); + + assert(sp != NULL); + + /* if we were last encoding, terminate this mode */ + if (sp->state & LSTATE_INIT_ENCODE) { + lzma_end(&sp->stream); + sp->state = 0; + } + + sp->state |= LSTATE_INIT_DECODE; + return 1; +} + +/* + * Setup state for decoding a strip. + */ +static int +LZMAPreDecode(TIFF* tif, uint16 s) +{ + static const char module[] = "LZMAPreDecode"; + LZMAState* sp = DecoderState(tif); + lzma_ret ret; + + (void) s; + assert(sp != NULL); + + if( (sp->state & LSTATE_INIT_DECODE) == 0 ) + tif->tif_setupdecode(tif); + + sp->stream.next_in = tif->tif_rawdata; + sp->stream.avail_in = (size_t) tif->tif_rawcc; + if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc) { + TIFFErrorExt(tif->tif_clientdata, module, + "Liblzma cannot deal with buffers this size"); + return 0; + } + + /* + * Disable memory limit when decoding. UINT64_MAX is a flag to disable + * the limit, we are passing (uint64_t)-1 which should be the same. + */ + ret = lzma_stream_decoder(&sp->stream, (uint64_t)-1, 0); + if (ret != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error initializing the stream decoder, %s", + LZMAStrerror(ret)); + return 0; + } + return 1; +} + +static int +LZMADecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "LZMADecode"; + LZMAState* sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + assert(sp->state == LSTATE_INIT_DECODE); + + sp->stream.next_in = tif->tif_rawcp; + sp->stream.avail_in = (size_t) tif->tif_rawcc; + + sp->stream.next_out = op; + sp->stream.avail_out = (size_t) occ; + if ((tmsize_t)sp->stream.avail_out != occ) { + TIFFErrorExt(tif->tif_clientdata, module, + "Liblzma cannot deal with buffers this size"); + return 0; + } + + do { + /* + * Save the current stream state to properly recover from the + * decoding errors later. + */ + const uint8_t *next_in = sp->stream.next_in; + size_t avail_in = sp->stream.avail_in; + + lzma_ret ret = lzma_code(&sp->stream, LZMA_RUN); + if (ret == LZMA_STREAM_END) + break; + if (ret == LZMA_MEMLIMIT_ERROR) { + lzma_ret r = lzma_stream_decoder(&sp->stream, + lzma_memusage(&sp->stream), 0); + if (r != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Error initializing the stream decoder, %s", + LZMAStrerror(r)); + break; + } + sp->stream.next_in = next_in; + sp->stream.avail_in = avail_in; + continue; + } + if (ret != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Decoding error at scanline %lu, %s", + (unsigned long) tif->tif_row, LZMAStrerror(ret)); + break; + } + } while (sp->stream.avail_out > 0); + if (sp->stream.avail_out != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %lu (short %lu bytes)", + (unsigned long) tif->tif_row, (unsigned long) sp->stream.avail_out); + return 0; + } + + tif->tif_rawcp = (uint8 *)sp->stream.next_in; /* cast away const */ + tif->tif_rawcc = sp->stream.avail_in; + + return 1; +} + +static int +LZMASetupEncode(TIFF* tif) +{ + LZMAState* sp = EncoderState(tif); + + assert(sp != NULL); + if (sp->state & LSTATE_INIT_DECODE) { + lzma_end(&sp->stream); + sp->state = 0; + } + + sp->state |= LSTATE_INIT_ENCODE; + return 1; +} + +/* + * Reset encoding state at the start of a strip. + */ +static int +LZMAPreEncode(TIFF* tif, uint16 s) +{ + static const char module[] = "LZMAPreEncode"; + LZMAState *sp = EncoderState(tif); + + (void) s; + assert(sp != NULL); + if( sp->state != LSTATE_INIT_ENCODE ) + tif->tif_setupencode(tif); + + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (size_t)tif->tif_rawdatasize; + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) { + TIFFErrorExt(tif->tif_clientdata, module, + "Liblzma cannot deal with buffers this size"); + return 0; + } + return (lzma_stream_encoder(&sp->stream, sp->filters, sp->check) == LZMA_OK); +} + +/* + * Encode a chunk of pixels. + */ +static int +LZMAEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + static const char module[] = "LZMAEncode"; + LZMAState *sp = EncoderState(tif); + + assert(sp != NULL); + assert(sp->state == LSTATE_INIT_ENCODE); + + (void) s; + sp->stream.next_in = bp; + sp->stream.avail_in = (size_t) cc; + if ((tmsize_t)sp->stream.avail_in != cc) { + TIFFErrorExt(tif->tif_clientdata, module, + "Liblzma cannot deal with buffers this size"); + return 0; + } + do { + lzma_ret ret = lzma_code(&sp->stream, LZMA_RUN); + if (ret != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Encoding error at scanline %lu, %s", + (unsigned long) tif->tif_row, LZMAStrerror(ret)); + return 0; + } + if (sp->stream.avail_out == 0) { + tif->tif_rawcc = tif->tif_rawdatasize; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (size_t)tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in LZMAPreEncode */ + } + } while (sp->stream.avail_in > 0); + return 1; +} + +/* + * Finish off an encoded strip by flushing the last + * string and tacking on an End Of Information code. + */ +static int +LZMAPostEncode(TIFF* tif) +{ + static const char module[] = "LZMAPostEncode"; + LZMAState *sp = EncoderState(tif); + lzma_ret ret; + + sp->stream.avail_in = 0; + do { + ret = lzma_code(&sp->stream, LZMA_FINISH); + switch (ret) { + case LZMA_STREAM_END: + case LZMA_OK: + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) { + tif->tif_rawcc = + tif->tif_rawdatasize - sp->stream.avail_out; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (size_t)tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */ + } + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, "Liblzma error: %s", + LZMAStrerror(ret)); + return 0; + } + } while (ret != LZMA_STREAM_END); + return 1; +} + +static void +LZMACleanup(TIFF* tif) +{ + LZMAState* sp = LState(tif); + + assert(sp != 0); + + (void)TIFFPredictorCleanup(tif); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + + if (sp->state) { + lzma_end(&sp->stream); + sp->state = 0; + } + _TIFFfree(sp); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +static int +LZMAVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[] = "LZMAVSetField"; + LZMAState* sp = LState(tif); + + switch (tag) { + case TIFFTAG_LZMAPRESET: + sp->preset = (int) va_arg(ap, int); + lzma_lzma_preset(&sp->opt_lzma, sp->preset); + if (sp->state & LSTATE_INIT_ENCODE) { + lzma_ret ret = lzma_stream_encoder(&sp->stream, + sp->filters, + sp->check); + if (ret != LZMA_OK) { + TIFFErrorExt(tif->tif_clientdata, module, + "Liblzma error: %s", + LZMAStrerror(ret)); + } + } + return 1; + default: + return (*sp->vsetparent)(tif, tag, ap); + } + /*NOTREACHED*/ +} + +static int +LZMAVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + LZMAState* sp = LState(tif); + + switch (tag) { + case TIFFTAG_LZMAPRESET: + *va_arg(ap, int*) = sp->preset; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return 1; +} + +static const TIFFField lzmaFields[] = { + { TIFFTAG_LZMAPRESET, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, + FIELD_PSEUDO, TRUE, FALSE, "LZMA2 Compression Preset", NULL }, +}; + +int +TIFFInitLZMA(TIFF* tif, int scheme) +{ + static const char module[] = "TIFFInitLZMA"; + LZMAState* sp; + lzma_stream tmp_stream = LZMA_STREAM_INIT; + + assert( scheme == COMPRESSION_LZMA ); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, lzmaFields, TIFFArrayCount(lzmaFields))) { + TIFFErrorExt(tif->tif_clientdata, module, + "Merging LZMA2 codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZMAState)); + if (tif->tif_data == NULL) + goto bad; + sp = LState(tif); + memcpy(&sp->stream, &tmp_stream, sizeof(lzma_stream)); + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = LZMAVGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = LZMAVSetField; /* hook for codec tags */ + + /* Default values for codec-specific fields */ + sp->preset = LZMA_PRESET_DEFAULT; /* default comp. level */ + sp->check = LZMA_CHECK_NONE; + sp->state = 0; + + /* Data filters. So far we are using delta and LZMA2 filters only. */ + sp->opt_delta.type = LZMA_DELTA_TYPE_BYTE; + /* + * The sample size in bytes seems to be reasonable distance for delta + * filter. + */ + sp->opt_delta.dist = (tif->tif_dir.td_bitspersample % 8) ? + 1 : tif->tif_dir.td_bitspersample / 8; + sp->filters[0].id = LZMA_FILTER_DELTA; + sp->filters[0].options = &sp->opt_delta; + + lzma_lzma_preset(&sp->opt_lzma, sp->preset); + sp->filters[1].id = LZMA_FILTER_LZMA2; + sp->filters[1].options = &sp->opt_lzma; + + sp->filters[2].id = LZMA_VLI_UNKNOWN; + sp->filters[2].options = NULL; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = LZMAFixupTags; + tif->tif_setupdecode = LZMASetupDecode; + tif->tif_predecode = LZMAPreDecode; + tif->tif_decoderow = LZMADecode; + tif->tif_decodestrip = LZMADecode; + tif->tif_decodetile = LZMADecode; + tif->tif_setupencode = LZMASetupEncode; + tif->tif_preencode = LZMAPreEncode; + tif->tif_postencode = LZMAPostEncode; + tif->tif_encoderow = LZMAEncode; + tif->tif_encodestrip = LZMAEncode; + tif->tif_encodetile = LZMAEncode; + tif->tif_cleanup = LZMACleanup; + /* + * Setup predictor setup. + */ + (void) TIFFPredictorInit(tif); + return 1; +bad: + TIFFErrorExt(tif->tif_clientdata, module, + "No space for LZMA2 state block"); + return 0; +} +#endif /* LZMA_SUPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzw.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzw.c new file mode 100644 index 0000000..fd9c7a0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_lzw.c @@ -0,0 +1,1167 @@ +/* $Id: tif_lzw.c,v 1.45 2011-04-02 20:54:09 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef LZW_SUPPORT +/* + * TIFF Library. + * Rev 5.0 Lempel-Ziv & Welch Compression Support + * + * This code is derived from the compress program whose code is + * derived from software contributed to Berkeley by James A. Woods, + * derived from original work by Spencer Thomas and Joseph Orost. + * + * The original Berkeley copyright notice appears below in its entirety. + */ +#include "tif_predict.h" + +#include + +/* + * NB: The 5.0 spec describes a different algorithm than Aldus + * implements. Specifically, Aldus does code length transitions + * one code earlier than should be done (for real LZW). + * Earlier versions of this library implemented the correct + * LZW algorithm, but emitted codes in a bit order opposite + * to the TIFF spec. Thus, to maintain compatibility w/ Aldus + * we interpret MSB-LSB ordered codes to be images written w/ + * old versions of this library, but otherwise adhere to the + * Aldus "off by one" algorithm. + * + * Future revisions to the TIFF spec are expected to "clarify this issue". + */ +#define LZW_COMPAT /* include backwards compatibility code */ +/* + * Each strip of data is supposed to be terminated by a CODE_EOI. + * If the following #define is included, the decoder will also + * check for end-of-strip w/o seeing this code. This makes the + * library more robust, but also slower. + */ +#define LZW_CHECKEOS /* include checks for strips w/o EOI code */ + +#define MAXCODE(n) ((1L<<(n))-1) +/* + * The TIFF spec specifies that encoded bit + * strings range from 9 to 12 bits. + */ +#define BITS_MIN 9 /* start with 9 bits */ +#define BITS_MAX 12 /* max of 12 bit strings */ +/* predefined codes */ +#define CODE_CLEAR 256 /* code to clear string table */ +#define CODE_EOI 257 /* end-of-information code */ +#define CODE_FIRST 258 /* first free code entry */ +#define CODE_MAX MAXCODE(BITS_MAX) +#define HSIZE 9001L /* 91% occupancy */ +#define HSHIFT (13-8) +#ifdef LZW_COMPAT +/* NB: +1024 is for compatibility with old files */ +#define CSIZE (MAXCODE(BITS_MAX)+1024L) +#else +#define CSIZE (MAXCODE(BITS_MAX)+1L) +#endif + +/* + * State block for each open TIFF file using LZW + * compression/decompression. Note that the predictor + * state block must be first in this data structure. + */ +typedef struct { + TIFFPredictorState predict; /* predictor super class */ + + unsigned short nbits; /* # of bits/code */ + unsigned short maxcode; /* maximum code for lzw_nbits */ + unsigned short free_ent; /* next free entry in hash table */ + long nextdata; /* next bits of i/o */ + long nextbits; /* # of valid bits in lzw_nextdata */ + + int rw_mode; /* preserve rw_mode from init */ +} LZWBaseState; + +#define lzw_nbits base.nbits +#define lzw_maxcode base.maxcode +#define lzw_free_ent base.free_ent +#define lzw_nextdata base.nextdata +#define lzw_nextbits base.nextbits + +/* + * Encoding-specific state. + */ +typedef uint16 hcode_t; /* codes fit in 16 bits */ +typedef struct { + long hash; + hcode_t code; +} hash_t; + +/* + * Decoding-specific state. + */ +typedef struct code_ent { + struct code_ent *next; + unsigned short length; /* string len, including this token */ + unsigned char value; /* data value */ + unsigned char firstchar; /* first token of string */ +} code_t; + +typedef int (*decodeFunc)(TIFF*, uint8*, tmsize_t, uint16); + +typedef struct { + LZWBaseState base; + + /* Decoding specific data */ + long dec_nbitsmask; /* lzw_nbits 1 bits, right adjusted */ + long dec_restart; /* restart count */ +#ifdef LZW_CHECKEOS + uint64 dec_bitsleft; /* available bits in raw data */ +#endif + decodeFunc dec_decode; /* regular or backwards compatible */ + code_t* dec_codep; /* current recognized code */ + code_t* dec_oldcodep; /* previously recognized code */ + code_t* dec_free_entp; /* next free entry */ + code_t* dec_maxcodep; /* max available entry */ + code_t* dec_codetab; /* kept separate for small machines */ + + /* Encoding specific data */ + int enc_oldcode; /* last code encountered */ + long enc_checkpoint; /* point at which to clear table */ +#define CHECK_GAP 10000 /* enc_ratio check interval */ + long enc_ratio; /* current compression ratio */ + long enc_incount; /* (input) data bytes encoded */ + long enc_outcount; /* encoded (output) bytes */ + uint8* enc_rawlimit; /* bound on tif_rawdata buffer */ + hash_t* enc_hashtab; /* kept separate for small machines */ +} LZWCodecState; + +#define LZWState(tif) ((LZWBaseState*) (tif)->tif_data) +#define DecoderState(tif) ((LZWCodecState*) LZWState(tif)) +#define EncoderState(tif) ((LZWCodecState*) LZWState(tif)) + +static int LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s); +#ifdef LZW_COMPAT +static int LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s); +#endif +static void cl_hash(LZWCodecState*); + +/* + * LZW Decoder. + */ + +#ifdef LZW_CHECKEOS +/* + * This check shouldn't be necessary because each + * strip is suppose to be terminated with CODE_EOI. + */ +#define NextCode(_tif, _sp, _bp, _code, _get) { \ + if ((_sp)->dec_bitsleft < (uint64)nbits) { \ + TIFFWarningExt(_tif->tif_clientdata, module, \ + "LZWDecode: Strip %d not terminated with EOI code", \ + _tif->tif_curstrip); \ + _code = CODE_EOI; \ + } else { \ + _get(_sp,_bp,_code); \ + (_sp)->dec_bitsleft -= nbits; \ + } \ +} +#else +#define NextCode(tif, sp, bp, code, get) get(sp, bp, code) +#endif + +static int +LZWFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +static int +LZWSetupDecode(TIFF* tif) +{ + static const char module[] = "LZWSetupDecode"; + LZWCodecState* sp = DecoderState(tif); + int code; + + if( sp == NULL ) + { + /* + * Allocate state block so tag methods have storage to record + * values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState)); + if (tif->tif_data == NULL) + { + TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block"); + return (0); + } + + DecoderState(tif)->dec_codetab = NULL; + DecoderState(tif)->dec_decode = NULL; + + /* + * Setup predictor setup. + */ + (void) TIFFPredictorInit(tif); + + sp = DecoderState(tif); + } + + assert(sp != NULL); + + if (sp->dec_codetab == NULL) { + sp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t)); + if (sp->dec_codetab == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, + "No space for LZW code table"); + return (0); + } + /* + * Pre-load the table. + */ + code = 255; + do { + sp->dec_codetab[code].value = code; + sp->dec_codetab[code].firstchar = code; + sp->dec_codetab[code].length = 1; + sp->dec_codetab[code].next = NULL; + } while (code--); + /* + * Zero-out the unused entries + */ + _TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0, + (CODE_FIRST - CODE_CLEAR) * sizeof (code_t)); + } + return (1); +} + +/* + * Setup state for decoding a strip. + */ +static int +LZWPreDecode(TIFF* tif, uint16 s) +{ + static const char module[] = "LZWPreDecode"; + LZWCodecState *sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + if( sp->dec_codetab == NULL ) + { + tif->tif_setupdecode( tif ); + } + + /* + * Check for old bit-reversed codes. + */ + if (tif->tif_rawdata[0] == 0 && (tif->tif_rawdata[1] & 0x1)) { +#ifdef LZW_COMPAT + if (!sp->dec_decode) { + TIFFWarningExt(tif->tif_clientdata, module, + "Old-style LZW codes, convert file"); + /* + * Override default decoding methods with + * ones that deal with the old coding. + * Otherwise the predictor versions set + * above will call the compatibility routines + * through the dec_decode method. + */ + tif->tif_decoderow = LZWDecodeCompat; + tif->tif_decodestrip = LZWDecodeCompat; + tif->tif_decodetile = LZWDecodeCompat; + /* + * If doing horizontal differencing, must + * re-setup the predictor logic since we + * switched the basic decoder methods... + */ + (*tif->tif_setupdecode)(tif); + sp->dec_decode = LZWDecodeCompat; + } + sp->lzw_maxcode = MAXCODE(BITS_MIN); +#else /* !LZW_COMPAT */ + if (!sp->dec_decode) { + TIFFErrorExt(tif->tif_clientdata, module, + "Old-style LZW codes not supported"); + sp->dec_decode = LZWDecode; + } + return (0); +#endif/* !LZW_COMPAT */ + } else { + sp->lzw_maxcode = MAXCODE(BITS_MIN)-1; + sp->dec_decode = LZWDecode; + } + sp->lzw_nbits = BITS_MIN; + sp->lzw_nextbits = 0; + sp->lzw_nextdata = 0; + + sp->dec_restart = 0; + sp->dec_nbitsmask = MAXCODE(BITS_MIN); +#ifdef LZW_CHECKEOS + sp->dec_bitsleft = ((uint64)tif->tif_rawcc) << 3; +#endif + sp->dec_free_entp = sp->dec_codetab + CODE_FIRST; + /* + * Zero entries that are not yet filled in. We do + * this to guard against bogus input data that causes + * us to index into undefined entries. If you can + * come up with a way to safely bounds-check input codes + * while decoding then you can remove this operation. + */ + _TIFFmemset(sp->dec_free_entp, 0, (CSIZE-CODE_FIRST)*sizeof (code_t)); + sp->dec_oldcodep = &sp->dec_codetab[-1]; + sp->dec_maxcodep = &sp->dec_codetab[sp->dec_nbitsmask-1]; + return (1); +} + +/* + * Decode a "hunk of data". + */ +#define GetNextCode(sp, bp, code) { \ + nextdata = (nextdata<<8) | *(bp)++; \ + nextbits += 8; \ + if (nextbits < nbits) { \ + nextdata = (nextdata<<8) | *(bp)++; \ + nextbits += 8; \ + } \ + code = (hcode_t)((nextdata >> (nextbits-nbits)) & nbitsmask); \ + nextbits -= nbits; \ +} + +static void +codeLoop(TIFF* tif, const char* module) +{ + TIFFErrorExt(tif->tif_clientdata, module, + "Bogus encoding, loop in the code table; scanline %d", + tif->tif_row); +} + +static int +LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) +{ + static const char module[] = "LZWDecode"; + LZWCodecState *sp = DecoderState(tif); + char *op = (char*) op0; + long occ = (long) occ0; + char *tp; + unsigned char *bp; + hcode_t code; + int len; + long nbits, nextbits, nextdata, nbitsmask; + code_t *codep, *free_entp, *maxcodep, *oldcodep; + + (void) s; + assert(sp != NULL); + assert(sp->dec_codetab != NULL); + + /* + Fail if value does not fit in long. + */ + if ((tmsize_t) occ != occ0) + return (0); + /* + * Restart interrupted output operation. + */ + if (sp->dec_restart) { + long residue; + + codep = sp->dec_codep; + residue = codep->length - sp->dec_restart; + if (residue > occ) { + /* + * Residue from previous decode is sufficient + * to satisfy decode request. Skip to the + * start of the decoded string, place decoded + * values in the output buffer, and return. + */ + sp->dec_restart += occ; + do { + codep = codep->next; + } while (--residue > occ && codep); + if (codep) { + tp = op + occ; + do { + *--tp = codep->value; + codep = codep->next; + } while (--occ && codep); + } + return (1); + } + /* + * Residue satisfies only part of the decode request. + */ + op += residue, occ -= residue; + tp = op; + do { + int t; + --tp; + t = codep->value; + codep = codep->next; + *tp = t; + } while (--residue && codep); + sp->dec_restart = 0; + } + + bp = (unsigned char *)tif->tif_rawcp; + nbits = sp->lzw_nbits; + nextdata = sp->lzw_nextdata; + nextbits = sp->lzw_nextbits; + nbitsmask = sp->dec_nbitsmask; + oldcodep = sp->dec_oldcodep; + free_entp = sp->dec_free_entp; + maxcodep = sp->dec_maxcodep; + + while (occ > 0) { + NextCode(tif, sp, bp, code, GetNextCode); + if (code == CODE_EOI) + break; + if (code == CODE_CLEAR) { + free_entp = sp->dec_codetab + CODE_FIRST; + _TIFFmemset(free_entp, 0, + (CSIZE - CODE_FIRST) * sizeof (code_t)); + nbits = BITS_MIN; + nbitsmask = MAXCODE(BITS_MIN); + maxcodep = sp->dec_codetab + nbitsmask-1; + NextCode(tif, sp, bp, code, GetNextCode); + if (code == CODE_EOI) + break; + if (code >= CODE_CLEAR) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "LZWDecode: Corrupted LZW table at scanline %d", + tif->tif_row); + return (0); + } + *op++ = (char)code, occ--; + oldcodep = sp->dec_codetab + code; + continue; + } + codep = sp->dec_codetab + code; + + /* + * Add the new entry to the code table. + */ + if (free_entp < &sp->dec_codetab[0] || + free_entp >= &sp->dec_codetab[CSIZE]) { + TIFFErrorExt(tif->tif_clientdata, module, + "Corrupted LZW table at scanline %d", + tif->tif_row); + return (0); + } + + free_entp->next = oldcodep; + if (free_entp->next < &sp->dec_codetab[0] || + free_entp->next >= &sp->dec_codetab[CSIZE]) { + TIFFErrorExt(tif->tif_clientdata, module, + "Corrupted LZW table at scanline %d", + tif->tif_row); + return (0); + } + free_entp->firstchar = free_entp->next->firstchar; + free_entp->length = free_entp->next->length+1; + free_entp->value = (codep < free_entp) ? + codep->firstchar : free_entp->firstchar; + if (++free_entp > maxcodep) { + if (++nbits > BITS_MAX) /* should not happen */ + nbits = BITS_MAX; + nbitsmask = MAXCODE(nbits); + maxcodep = sp->dec_codetab + nbitsmask-1; + } + oldcodep = codep; + if (code >= 256) { + /* + * Code maps to a string, copy string + * value to output (written in reverse). + */ + if(codep->length == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Wrong length of decoded string: " + "data probably corrupted at scanline %d", + tif->tif_row); + return (0); + } + if (codep->length > occ) { + /* + * String is too long for decode buffer, + * locate portion that will fit, copy to + * the decode buffer, and setup restart + * logic for the next decoding call. + */ + sp->dec_codep = codep; + do { + codep = codep->next; + } while (codep && codep->length > occ); + if (codep) { + sp->dec_restart = (long)occ; + tp = op + occ; + do { + *--tp = codep->value; + codep = codep->next; + } while (--occ && codep); + if (codep) + codeLoop(tif, module); + } + break; + } + len = codep->length; + tp = op + len; + do { + int t; + --tp; + t = codep->value; + codep = codep->next; + *tp = t; + } while (codep && tp > op); + if (codep) { + codeLoop(tif, module); + break; + } + assert(occ >= len); + op += len, occ -= len; + } else + *op++ = (char)code, occ--; + } + + tif->tif_rawcp = (uint8*) bp; + sp->lzw_nbits = (unsigned short) nbits; + sp->lzw_nextdata = nextdata; + sp->lzw_nextbits = nextbits; + sp->dec_nbitsmask = nbitsmask; + sp->dec_oldcodep = oldcodep; + sp->dec_free_entp = free_entp; + sp->dec_maxcodep = maxcodep; + + if (occ > 0) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %d (short %I64d bytes)", + tif->tif_row, (unsigned __int64) occ); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %d (short %llu bytes)", + tif->tif_row, (unsigned long long) occ); +#endif + return (0); + } + return (1); +} + +#ifdef LZW_COMPAT +/* + * Decode a "hunk of data" for old images. + */ +#define GetNextCodeCompat(sp, bp, code) { \ + nextdata |= (unsigned long) *(bp)++ << nextbits; \ + nextbits += 8; \ + if (nextbits < nbits) { \ + nextdata |= (unsigned long) *(bp)++ << nextbits;\ + nextbits += 8; \ + } \ + code = (hcode_t)(nextdata & nbitsmask); \ + nextdata >>= nbits; \ + nextbits -= nbits; \ +} + +static int +LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) +{ + static const char module[] = "LZWDecodeCompat"; + LZWCodecState *sp = DecoderState(tif); + char *op = (char*) op0; + long occ = (long) occ0; + char *tp; + unsigned char *bp; + int code, nbits; + long nextbits, nextdata, nbitsmask; + code_t *codep, *free_entp, *maxcodep, *oldcodep; + + (void) s; + assert(sp != NULL); + + /* + Fail if value does not fit in long. + */ + if ((tmsize_t) occ != occ0) + return (0); + + /* + * Restart interrupted output operation. + */ + if (sp->dec_restart) { + long residue; + + codep = sp->dec_codep; + residue = codep->length - sp->dec_restart; + if (residue > occ) { + /* + * Residue from previous decode is sufficient + * to satisfy decode request. Skip to the + * start of the decoded string, place decoded + * values in the output buffer, and return. + */ + sp->dec_restart += occ; + do { + codep = codep->next; + } while (--residue > occ); + tp = op + occ; + do { + *--tp = codep->value; + codep = codep->next; + } while (--occ); + return (1); + } + /* + * Residue satisfies only part of the decode request. + */ + op += residue, occ -= residue; + tp = op; + do { + *--tp = codep->value; + codep = codep->next; + } while (--residue); + sp->dec_restart = 0; + } + + bp = (unsigned char *)tif->tif_rawcp; + nbits = sp->lzw_nbits; + nextdata = sp->lzw_nextdata; + nextbits = sp->lzw_nextbits; + nbitsmask = sp->dec_nbitsmask; + oldcodep = sp->dec_oldcodep; + free_entp = sp->dec_free_entp; + maxcodep = sp->dec_maxcodep; + + while (occ > 0) { + NextCode(tif, sp, bp, code, GetNextCodeCompat); + if (code == CODE_EOI) + break; + if (code == CODE_CLEAR) { + free_entp = sp->dec_codetab + CODE_FIRST; + _TIFFmemset(free_entp, 0, + (CSIZE - CODE_FIRST) * sizeof (code_t)); + nbits = BITS_MIN; + nbitsmask = MAXCODE(BITS_MIN); + maxcodep = sp->dec_codetab + nbitsmask; + NextCode(tif, sp, bp, code, GetNextCodeCompat); + if (code == CODE_EOI) + break; + if (code >= CODE_CLEAR) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "LZWDecode: Corrupted LZW table at scanline %d", + tif->tif_row); + return (0); + } + *op++ = code, occ--; + oldcodep = sp->dec_codetab + code; + continue; + } + codep = sp->dec_codetab + code; + + /* + * Add the new entry to the code table. + */ + if (free_entp < &sp->dec_codetab[0] || + free_entp >= &sp->dec_codetab[CSIZE]) { + TIFFErrorExt(tif->tif_clientdata, module, + "Corrupted LZW table at scanline %d", tif->tif_row); + return (0); + } + + free_entp->next = oldcodep; + if (free_entp->next < &sp->dec_codetab[0] || + free_entp->next >= &sp->dec_codetab[CSIZE]) { + TIFFErrorExt(tif->tif_clientdata, module, + "Corrupted LZW table at scanline %d", tif->tif_row); + return (0); + } + free_entp->firstchar = free_entp->next->firstchar; + free_entp->length = free_entp->next->length+1; + free_entp->value = (codep < free_entp) ? + codep->firstchar : free_entp->firstchar; + if (++free_entp > maxcodep) { + if (++nbits > BITS_MAX) /* should not happen */ + nbits = BITS_MAX; + nbitsmask = MAXCODE(nbits); + maxcodep = sp->dec_codetab + nbitsmask; + } + oldcodep = codep; + if (code >= 256) { + /* + * Code maps to a string, copy string + * value to output (written in reverse). + */ + if(codep->length == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Wrong length of decoded " + "string: data probably corrupted at scanline %d", + tif->tif_row); + return (0); + } + if (codep->length > occ) { + /* + * String is too long for decode buffer, + * locate portion that will fit, copy to + * the decode buffer, and setup restart + * logic for the next decoding call. + */ + sp->dec_codep = codep; + do { + codep = codep->next; + } while (codep->length > occ); + sp->dec_restart = occ; + tp = op + occ; + do { + *--tp = codep->value; + codep = codep->next; + } while (--occ); + break; + } + assert(occ >= codep->length); + op += codep->length, occ -= codep->length; + tp = op; + do { + *--tp = codep->value; + } while( (codep = codep->next) != NULL ); + } else + *op++ = code, occ--; + } + + tif->tif_rawcp = (uint8*) bp; + sp->lzw_nbits = nbits; + sp->lzw_nextdata = nextdata; + sp->lzw_nextbits = nextbits; + sp->dec_nbitsmask = nbitsmask; + sp->dec_oldcodep = oldcodep; + sp->dec_free_entp = free_entp; + sp->dec_maxcodep = maxcodep; + + if (occ > 0) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %d (short %I64d bytes)", + tif->tif_row, (unsigned __int64) occ); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %d (short %llu bytes)", + tif->tif_row, (unsigned long long) occ); +#endif + return (0); + } + return (1); +} +#endif /* LZW_COMPAT */ + +/* + * LZW Encoding. + */ + +static int +LZWSetupEncode(TIFF* tif) +{ + static const char module[] = "LZWSetupEncode"; + LZWCodecState* sp = EncoderState(tif); + + assert(sp != NULL); + sp->enc_hashtab = (hash_t*) _TIFFmalloc(HSIZE*sizeof (hash_t)); + if (sp->enc_hashtab == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, + "No space for LZW hash table"); + return (0); + } + return (1); +} + +/* + * Reset encoding state at the start of a strip. + */ +static int +LZWPreEncode(TIFF* tif, uint16 s) +{ + LZWCodecState *sp = EncoderState(tif); + + (void) s; + assert(sp != NULL); + + if( sp->enc_hashtab == NULL ) + { + tif->tif_setupencode( tif ); + } + + sp->lzw_nbits = BITS_MIN; + sp->lzw_maxcode = MAXCODE(BITS_MIN); + sp->lzw_free_ent = CODE_FIRST; + sp->lzw_nextbits = 0; + sp->lzw_nextdata = 0; + sp->enc_checkpoint = CHECK_GAP; + sp->enc_ratio = 0; + sp->enc_incount = 0; + sp->enc_outcount = 0; + /* + * The 4 here insures there is space for 2 max-sized + * codes in LZWEncode and LZWPostDecode. + */ + sp->enc_rawlimit = tif->tif_rawdata + tif->tif_rawdatasize-1 - 4; + cl_hash(sp); /* clear hash table */ + sp->enc_oldcode = (hcode_t) -1; /* generates CODE_CLEAR in LZWEncode */ + return (1); +} + +#define CALCRATIO(sp, rat) { \ + if (incount > 0x007fffff) { /* NB: shift will overflow */\ + rat = outcount >> 8; \ + rat = (rat == 0 ? 0x7fffffff : incount/rat); \ + } else \ + rat = (incount<<8) / outcount; \ +} +#define PutNextCode(op, c) { \ + nextdata = (nextdata << nbits) | c; \ + nextbits += nbits; \ + *op++ = (unsigned char)(nextdata >> (nextbits-8)); \ + nextbits -= 8; \ + if (nextbits >= 8) { \ + *op++ = (unsigned char)(nextdata >> (nextbits-8)); \ + nextbits -= 8; \ + } \ + outcount += nbits; \ +} + +/* + * Encode a chunk of pixels. + * + * Uses an open addressing double hashing (no chaining) on the + * prefix code/next character combination. We do a variant of + * Knuth's algorithm D (vol. 3, sec. 6.4) along with G. Knott's + * relatively-prime secondary probe. Here, the modular division + * first probe is gives way to a faster exclusive-or manipulation. + * Also do block compression with an adaptive reset, whereby the + * code table is cleared when the compression ratio decreases, + * but after the table fills. The variable-length output codes + * are re-sized at this point, and a CODE_CLEAR is generated + * for the decoder. + */ +static int +LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + register LZWCodecState *sp = EncoderState(tif); + register long fcode; + register hash_t *hp; + register int h, c; + hcode_t ent; + long disp; + long incount, outcount, checkpoint; + long nextdata, nextbits; + int free_ent, maxcode, nbits; + uint8* op; + uint8* limit; + + (void) s; + if (sp == NULL) + return (0); + + assert(sp->enc_hashtab != NULL); + + /* + * Load local state. + */ + incount = sp->enc_incount; + outcount = sp->enc_outcount; + checkpoint = sp->enc_checkpoint; + nextdata = sp->lzw_nextdata; + nextbits = sp->lzw_nextbits; + free_ent = sp->lzw_free_ent; + maxcode = sp->lzw_maxcode; + nbits = sp->lzw_nbits; + op = tif->tif_rawcp; + limit = sp->enc_rawlimit; + ent = sp->enc_oldcode; + + if (ent == (hcode_t) -1 && cc > 0) { + /* + * NB: This is safe because it can only happen + * at the start of a strip where we know there + * is space in the data buffer. + */ + PutNextCode(op, CODE_CLEAR); + ent = *bp++; cc--; incount++; + } + while (cc > 0) { + c = *bp++; cc--; incount++; + fcode = ((long)c << BITS_MAX) + ent; + h = (c << HSHIFT) ^ ent; /* xor hashing */ +#ifdef _WINDOWS + /* + * Check hash index for an overflow. + */ + if (h >= HSIZE) + h -= HSIZE; +#endif + hp = &sp->enc_hashtab[h]; + if (hp->hash == fcode) { + ent = hp->code; + continue; + } + if (hp->hash >= 0) { + /* + * Primary hash failed, check secondary hash. + */ + disp = HSIZE - h; + if (h == 0) + disp = 1; + do { + /* + * Avoid pointer arithmetic 'cuz of + * wraparound problems with segments. + */ + if ((h -= disp) < 0) + h += HSIZE; + hp = &sp->enc_hashtab[h]; + if (hp->hash == fcode) { + ent = hp->code; + goto hit; + } + } while (hp->hash >= 0); + } + /* + * New entry, emit code and add to table. + */ + /* + * Verify there is space in the buffer for the code + * and any potential Clear code that might be emitted + * below. The value of limit is setup so that there + * are at least 4 bytes free--room for 2 codes. + */ + if (op > limit) { + tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata); + TIFFFlushData1(tif); + op = tif->tif_rawdata; + } + PutNextCode(op, ent); + ent = c; + hp->code = free_ent++; + hp->hash = fcode; + if (free_ent == CODE_MAX-1) { + /* table is full, emit clear code and reset */ + cl_hash(sp); + sp->enc_ratio = 0; + incount = 0; + outcount = 0; + free_ent = CODE_FIRST; + PutNextCode(op, CODE_CLEAR); + nbits = BITS_MIN; + maxcode = MAXCODE(BITS_MIN); + } else { + /* + * If the next entry is going to be too big for + * the code size, then increase it, if possible. + */ + if (free_ent > maxcode) { + nbits++; + assert(nbits <= BITS_MAX); + maxcode = (int) MAXCODE(nbits); + } else if (incount >= checkpoint) { + long rat; + /* + * Check compression ratio and, if things seem + * to be slipping, clear the hash table and + * reset state. The compression ratio is a + * 24+8-bit fractional number. + */ + checkpoint = incount+CHECK_GAP; + CALCRATIO(sp, rat); + if (rat <= sp->enc_ratio) { + cl_hash(sp); + sp->enc_ratio = 0; + incount = 0; + outcount = 0; + free_ent = CODE_FIRST; + PutNextCode(op, CODE_CLEAR); + nbits = BITS_MIN; + maxcode = MAXCODE(BITS_MIN); + } else + sp->enc_ratio = rat; + } + } + hit: + ; + } + + /* + * Restore global state. + */ + sp->enc_incount = incount; + sp->enc_outcount = outcount; + sp->enc_checkpoint = checkpoint; + sp->enc_oldcode = ent; + sp->lzw_nextdata = nextdata; + sp->lzw_nextbits = nextbits; + sp->lzw_free_ent = free_ent; + sp->lzw_maxcode = maxcode; + sp->lzw_nbits = nbits; + tif->tif_rawcp = op; + return (1); +} + +/* + * Finish off an encoded strip by flushing the last + * string and tacking on an End Of Information code. + */ +static int +LZWPostEncode(TIFF* tif) +{ + register LZWCodecState *sp = EncoderState(tif); + uint8* op = tif->tif_rawcp; + long nextbits = sp->lzw_nextbits; + long nextdata = sp->lzw_nextdata; + long outcount = sp->enc_outcount; + int nbits = sp->lzw_nbits; + + if (op > sp->enc_rawlimit) { + tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata); + TIFFFlushData1(tif); + op = tif->tif_rawdata; + } + if (sp->enc_oldcode != (hcode_t) -1) { + PutNextCode(op, sp->enc_oldcode); + sp->enc_oldcode = (hcode_t) -1; + } + PutNextCode(op, CODE_EOI); + if (nextbits > 0) + *op++ = (unsigned char)(nextdata << (8-nextbits)); + tif->tif_rawcc = (tmsize_t)(op - tif->tif_rawdata); + return (1); +} + +/* + * Reset encoding hash table. + */ +static void +cl_hash(LZWCodecState* sp) +{ + register hash_t *hp = &sp->enc_hashtab[HSIZE-1]; + register long i = HSIZE-8; + + do { + i -= 8; + hp[-7].hash = -1; + hp[-6].hash = -1; + hp[-5].hash = -1; + hp[-4].hash = -1; + hp[-3].hash = -1; + hp[-2].hash = -1; + hp[-1].hash = -1; + hp[ 0].hash = -1; + hp -= 8; + } while (i >= 0); + for (i += 8; i > 0; i--, hp--) + hp->hash = -1; +} + +static void +LZWCleanup(TIFF* tif) +{ + (void)TIFFPredictorCleanup(tif); + + assert(tif->tif_data != 0); + + if (DecoderState(tif)->dec_codetab) + _TIFFfree(DecoderState(tif)->dec_codetab); + + if (EncoderState(tif)->enc_hashtab) + _TIFFfree(EncoderState(tif)->enc_hashtab); + + _TIFFfree(tif->tif_data); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +int +TIFFInitLZW(TIFF* tif, int scheme) +{ + static const char module[] = "TIFFInitLZW"; + assert(scheme == COMPRESSION_LZW); + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof (LZWCodecState)); + if (tif->tif_data == NULL) + goto bad; + DecoderState(tif)->dec_codetab = NULL; + DecoderState(tif)->dec_decode = NULL; + EncoderState(tif)->enc_hashtab = NULL; + LZWState(tif)->rw_mode = tif->tif_mode; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = LZWFixupTags; + tif->tif_setupdecode = LZWSetupDecode; + tif->tif_predecode = LZWPreDecode; + tif->tif_decoderow = LZWDecode; + tif->tif_decodestrip = LZWDecode; + tif->tif_decodetile = LZWDecode; + tif->tif_setupencode = LZWSetupEncode; + tif->tif_preencode = LZWPreEncode; + tif->tif_postencode = LZWPostEncode; + tif->tif_encoderow = LZWEncode; + tif->tif_encodestrip = LZWEncode; + tif->tif_encodetile = LZWEncode; + tif->tif_cleanup = LZWCleanup; + /* + * Setup predictor setup. + */ + (void) TIFFPredictorInit(tif); + return (1); +bad: + TIFFErrorExt(tif->tif_clientdata, module, + "No space for LZW state block"); + return (0); +} + +/* + * Copyright (c) 1985, 1986 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * James A. Woods, derived from original work by Spencer Thomas + * and Joseph Orost. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ +#endif /* LZW_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_next.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_next.c new file mode 100644 index 0000000..524e127 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_next.c @@ -0,0 +1,160 @@ +/* $Id: tif_next.c,v 1.13 2010-03-10 18:56:48 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef NEXT_SUPPORT +/* + * TIFF Library. + * + * NeXT 2-bit Grey Scale Compression Algorithm Support + */ + +#define SETPIXEL(op, v) { \ + switch (npixels++ & 3) { \ + case 0: op[0] = (unsigned char) ((v) << 6); break; \ + case 1: op[0] |= (v) << 4; break; \ + case 2: op[0] |= (v) << 2; break; \ + case 3: *op++ |= (v); break; \ + } \ +} + +#define LITERALROW 0x00 +#define LITERALSPAN 0x40 +#define WHITE ((1<<2)-1) + +static int +NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + static const char module[] = "NeXTDecode"; + unsigned char *bp, *op; + tmsize_t cc; + uint8* row; + tmsize_t scanline, n; + + (void) s; + /* + * Each scanline is assumed to start off as all + * white (we assume a PhotometricInterpretation + * of ``min-is-black''). + */ + for (op = (unsigned char*) buf, cc = occ; cc-- > 0;) + *op++ = 0xff; + + bp = (unsigned char *)tif->tif_rawcp; + cc = tif->tif_rawcc; + scanline = tif->tif_scanlinesize; + if (occ % scanline) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (0); + } + for (row = buf; occ > 0; occ -= scanline, row += scanline) { + n = *bp++, cc--; + switch (n) { + case LITERALROW: + /* + * The entire scanline is given as literal values. + */ + if (cc < scanline) + goto bad; + _TIFFmemcpy(row, bp, scanline); + bp += scanline; + cc -= scanline; + break; + case LITERALSPAN: { + tmsize_t off; + /* + * The scanline has a literal span that begins at some + * offset. + */ + off = (bp[0] * 256) + bp[1]; + n = (bp[2] * 256) + bp[3]; + if (cc < 4+n || off+n > scanline) + goto bad; + _TIFFmemcpy(row+off, bp+4, n); + bp += 4+n; + cc -= 4+n; + break; + } + default: { + uint32 npixels = 0, grey; + uint32 imagewidth = tif->tif_dir.td_imagewidth; + + /* + * The scanline is composed of a sequence of constant + * color ``runs''. We shift into ``run mode'' and + * interpret bytes as codes of the form + * until we've filled the scanline. + */ + op = row; + for (;;) { + grey = (uint32)((n>>6) & 0x3); + n &= 0x3f; + /* + * Ensure the run does not exceed the scanline + * bounds, potentially resulting in a security + * issue. + */ + while (n-- > 0 && npixels < imagewidth) + SETPIXEL(op, grey); + if (npixels >= imagewidth) + break; + if (cc == 0) + goto bad; + n = *bp++, cc--; + } + break; + } + } + } + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + return (1); +bad: + TIFFErrorExt(tif->tif_clientdata, module, "Not enough data for scanline %ld", + (long) tif->tif_row); + return (0); +} + +int +TIFFInitNeXT(TIFF* tif, int scheme) +{ + (void) scheme; + tif->tif_decoderow = NeXTDecode; + tif->tif_decodestrip = NeXTDecode; + tif->tif_decodetile = NeXTDecode; + return (1); +} +#endif /* NEXT_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_ojpeg.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_ojpeg.c new file mode 100644 index 0000000..6ea3c38 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_ojpeg.c @@ -0,0 +1,2496 @@ +/* $Id: tif_ojpeg.c,v 1.56 2012-05-24 03:15:18 fwarmerdam Exp $ */ + +/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0 + specification is now totally obsolete and deprecated for new applications and + images. This file was was created solely in order to read unconverted images + still present on some users' computer systems. It will never be extended + to write such files. Writing new-style JPEG compressed TIFFs is implemented + in tif_jpeg.c. + + The code is carefully crafted to robustly read all gathered JPEG-in-TIFF + testfiles, and anticipate as much as possible all other... But still, it may + fail on some. If you encounter problems, please report them on the TIFF + mailing list and/or to Joris Van Damme . + + Please read the file called "TIFF Technical Note #2" if you need to be + convinced this compression scheme is bad and breaks TIFF. That document + is linked to from the LibTiff site + and from AWare Systems' TIFF section + . It is also absorbed + in Adobe's specification supplements, marked "draft" up to this day, but + supported by the TIFF community. + + This file interfaces with Release 6B of the JPEG Library written by the + Independent JPEG Group. Previous versions of this file required a hack inside + the LibJpeg library. This version no longer requires that. Remember to + remove the hack if you update from the old version. + + Copyright (c) Joris Van Damme + Copyright (c) AWare Systems + + The licence agreement for this file is the same as the rest of the LibTiff + library. + + IN NO EVENT SHALL JORIS VAN DAMME OR AWARE SYSTEMS BE LIABLE FOR + ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + + Joris Van Damme and/or AWare Systems may be available for custom + developement. If you like what you see, and need anything similar or related, + contact . +*/ + +/* What is what, and what is not? + + This decoder starts with an input stream, that is essentially the JpegInterchangeFormat + stream, if any, followed by the strile data, if any. This stream is read in + OJPEGReadByte and related functions. + + It analyzes the start of this stream, until it encounters non-marker data, i.e. + compressed image data. Some of the header markers it sees have no actual content, + like the SOI marker, and APP/COM markers that really shouldn't even be there. Some + other markers do have content, and the valuable bits and pieces of information + in these markers are saved, checking all to verify that the stream is more or + less within expected bounds. This happens inside the OJPEGReadHeaderInfoSecStreamXxx + functions. + + Some OJPEG imagery contains no valid JPEG header markers. This situation is picked + up on if we've seen no SOF marker when we're at the start of the compressed image + data. In this case, the tables are read from JpegXxxTables tags, and the other + bits and pieces of information is initialized to its most basic value. This is + implemented in the OJPEGReadHeaderInfoSecTablesXxx functions. + + When this is complete, a good and valid JPEG header can be assembled, and this is + passed through to LibJpeg. When that's done, the remainder of the input stream, i.e. + the compressed image data, can be passed through unchanged. This is done in + OJPEGWriteStream functions. + + LibTiff rightly expects to know the subsampling values before decompression. Just like + in new-style JPEG-in-TIFF, though, or even more so, actually, the YCbCrsubsampling + tag is notoriously unreliable. To correct these tag values with the ones inside + the JPEG stream, the first part of the input stream is pre-scanned in + OJPEGSubsamplingCorrect, making no note of any other data, reporting no warnings + or errors, up to the point where either these values are read, or it's clear they + aren't there. This means that some of the data is read twice, but we feel speed + in correcting these values is important enough to warrant this sacrifice. Allthough + there is currently no define or other configuration mechanism to disable this behaviour, + the actual header scanning is build to robustly respond with error report if it + should encounter an uncorrected mismatch of subsampling values. See + OJPEGReadHeaderInfoSecStreamSof. + + The restart interval and restart markers are the most tricky part... The restart + interval can be specified in a tag. It can also be set inside the input JPEG stream. + It can be used inside the input JPEG stream. If reading from strile data, we've + consistenly discovered the need to insert restart markers in between the different + striles, as is also probably the most likely interpretation of the original TIFF 6.0 + specification. With all this setting of interval, and actual use of markers that is not + predictable at the time of valid JPEG header assembly, the restart thing may turn + out the Achilles heel of this implementation. Fortunately, most OJPEG writer vendors + succeed in reading back what they write, which may be the reason why we've been able + to discover ways that seem to work. + + Some special provision is made for planarconfig separate OJPEG files. These seem + to consistently contain header info, a SOS marker, a plane, SOS marker, plane, SOS, + and plane. This may or may not be a valid JPEG configuration, we don't know and don't + care. We want LibTiff to be able to access the planes individually, without huge + buffering inside LibJpeg, anyway. So we compose headers to feed to LibJpeg, in this + case, that allow us to pass a single plane such that LibJpeg sees a valid + single-channel JPEG stream. Locating subsequent SOS markers, and thus subsequent + planes, is done inside OJPEGReadSecondarySos. + + The benefit of the scheme is... that it works, basically. We know of no other that + does. It works without checking software tag, or otherwise going about things in an + OJPEG flavor specific manner. Instead, it is a single scheme, that covers the cases + with and without JpegInterchangeFormat, with and without striles, with part of + the header in JpegInterchangeFormat and remainder in first strile, etc. It is forgiving + and robust, may likely work with OJPEG flavors we've not seen yet, and makes most out + of the data. + + Another nice side-effect is that a complete JPEG single valid stream is build if + planarconfig is not separate (vast majority). We may one day use that to build + converters to JPEG, and/or to new-style JPEG compression inside TIFF. + + A dissadvantage is the lack of random access to the individual striles. This is the + reason for much of the complicated restart-and-position stuff inside OJPEGPreDecode. + Applications would do well accessing all striles in order, as this will result in + a single sequential scan of the input stream, and no restarting of LibJpeg decoding + session. +*/ + +#define WIN32_LEAN_AND_MEAN +#define VC_EXTRALEAN + +#include "tiffiop.h" +#ifdef OJPEG_SUPPORT + +/* Configuration defines here are: + * JPEG_ENCAP_EXTERNAL: The normal way to call libjpeg, uses longjump. In some environments, + * like eg LibTiffDelphi, this is not possible. For this reason, the actual calls to + * libjpeg, with longjump stuff, are encapsulated in dedicated functions. When + * JPEG_ENCAP_EXTERNAL is defined, these encapsulating functions are declared external + * to this unit, and can be defined elsewhere to use stuff other then longjump. + * The default mode, without JPEG_ENCAP_EXTERNAL, implements the call encapsulators + * here, internally, with normal longjump. + * SETJMP, LONGJMP, JMP_BUF: On some machines/environments a longjump equivalent is + * conviniently available, but still it may be worthwhile to use _setjmp or sigsetjmp + * in place of plain setjmp. These macros will make it easier. It is useless + * to fiddle with these if you define JPEG_ENCAP_EXTERNAL. + * OJPEG_BUFFER: Define the size of the desired buffer here. Should be small enough so as to guarantee + * instant processing, optimal streaming and optimal use of processor cache, but also big + * enough so as to not result in significant call overhead. It should be at least a few + * bytes to accomodate some structures (this is verified in asserts), but it would not be + * sensible to make it this small anyway, and it should be at most 64K since it is indexed + * with uint16. We recommend 2K. + * EGYPTIANWALK: You could also define EGYPTIANWALK here, but it is not used anywhere and has + * absolutely no effect. That is why most people insist the EGYPTIANWALK is a bit silly. + */ + +/* define LIBJPEG_ENCAP_EXTERNAL */ +#define SETJMP(jbuf) setjmp(jbuf) +#define LONGJMP(jbuf,code) longjmp(jbuf,code) +#define JMP_BUF jmp_buf +#define OJPEG_BUFFER 2048 +/* define EGYPTIANWALK */ + +#define JPEG_MARKER_SOF0 0xC0 +#define JPEG_MARKER_SOF1 0xC1 +#define JPEG_MARKER_SOF3 0xC3 +#define JPEG_MARKER_DHT 0xC4 +#define JPEG_MARKER_RST0 0XD0 +#define JPEG_MARKER_SOI 0xD8 +#define JPEG_MARKER_EOI 0xD9 +#define JPEG_MARKER_SOS 0xDA +#define JPEG_MARKER_DQT 0xDB +#define JPEG_MARKER_DRI 0xDD +#define JPEG_MARKER_APP0 0xE0 +#define JPEG_MARKER_COM 0xFE + +#define FIELD_OJPEG_JPEGINTERCHANGEFORMAT (FIELD_CODEC+0) +#define FIELD_OJPEG_JPEGINTERCHANGEFORMATLENGTH (FIELD_CODEC+1) +#define FIELD_OJPEG_JPEGQTABLES (FIELD_CODEC+2) +#define FIELD_OJPEG_JPEGDCTABLES (FIELD_CODEC+3) +#define FIELD_OJPEG_JPEGACTABLES (FIELD_CODEC+4) +#define FIELD_OJPEG_JPEGPROC (FIELD_CODEC+5) +#define FIELD_OJPEG_JPEGRESTARTINTERVAL (FIELD_CODEC+6) + +static const TIFFField ojpegFields[] = { + {TIFFTAG_JPEGIFOFFSET,1,1,TIFF_LONG8,0,TIFF_SETGET_UINT64,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGINTERCHANGEFORMAT,TRUE,FALSE,"JpegInterchangeFormat",NULL}, + {TIFFTAG_JPEGIFBYTECOUNT,1,1,TIFF_LONG8,0,TIFF_SETGET_UINT64,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGINTERCHANGEFORMATLENGTH,TRUE,FALSE,"JpegInterchangeFormatLength",NULL}, + {TIFFTAG_JPEGQTABLES,TIFF_VARIABLE2,TIFF_VARIABLE2,TIFF_LONG8,0,TIFF_SETGET_C32_UINT64,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGQTABLES,FALSE,TRUE,"JpegQTables",NULL}, + {TIFFTAG_JPEGDCTABLES,TIFF_VARIABLE2,TIFF_VARIABLE2,TIFF_LONG8,0,TIFF_SETGET_C32_UINT64,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGDCTABLES,FALSE,TRUE,"JpegDcTables",NULL}, + {TIFFTAG_JPEGACTABLES,TIFF_VARIABLE2,TIFF_VARIABLE2,TIFF_LONG8,0,TIFF_SETGET_C32_UINT64,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGACTABLES,FALSE,TRUE,"JpegAcTables",NULL}, + {TIFFTAG_JPEGPROC,1,1,TIFF_SHORT,0,TIFF_SETGET_UINT16,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGPROC,FALSE,FALSE,"JpegProc",NULL}, + {TIFFTAG_JPEGRESTARTINTERVAL,1,1,TIFF_SHORT,0,TIFF_SETGET_UINT16,TIFF_SETGET_UNDEFINED,FIELD_OJPEG_JPEGRESTARTINTERVAL,FALSE,FALSE,"JpegRestartInterval",NULL}, +}; + +#ifndef LIBJPEG_ENCAP_EXTERNAL +#include +#endif + +/* We undefine FAR to avoid conflict with JPEG definition */ + +#ifdef FAR +#undef FAR +#endif + +/* + Libjpeg's jmorecfg.h defines INT16 and INT32, but only if XMD_H is + not defined. Unfortunately, the MinGW and Borland compilers include + a typedef for INT32, which causes a conflict. MSVC does not include + a conficting typedef given the headers which are included. +*/ +#if defined(__BORLANDC__) || defined(__MINGW32__) +# define XMD_H 1 +#endif + +/* Define "boolean" as unsigned char, not int, per Windows custom. */ +#if defined(__WIN32__) && !defined(__MINGW32__) +# ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ + typedef unsigned char boolean; +# endif +# define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ +#endif + +#include "jpeglib.h" +#include "jerror.h" + +typedef struct jpeg_error_mgr jpeg_error_mgr; +typedef struct jpeg_common_struct jpeg_common_struct; +typedef struct jpeg_decompress_struct jpeg_decompress_struct; +typedef struct jpeg_source_mgr jpeg_source_mgr; + +typedef enum { + osibsNotSetYet, + osibsJpegInterchangeFormat, + osibsStrile, + osibsEof +} OJPEGStateInBufferSource; + +typedef enum { + ososSoi, + ososQTable0,ososQTable1,ososQTable2,ososQTable3, + ososDcTable0,ososDcTable1,ososDcTable2,ososDcTable3, + ososAcTable0,ososAcTable1,ososAcTable2,ososAcTable3, + ososDri, + ososSof, + ososSos, + ososCompressed, + ososRst, + ososEoi +} OJPEGStateOutState; + +typedef struct { + TIFF* tif; + #ifndef LIBJPEG_ENCAP_EXTERNAL + JMP_BUF exit_jmpbuf; + #endif + TIFFVGetMethod vgetparent; + TIFFVSetMethod vsetparent; + TIFFPrintMethod printdir; + uint64 file_size; + uint32 image_width; + uint32 image_length; + uint32 strile_width; + uint32 strile_length; + uint32 strile_length_total; + uint8 samples_per_pixel; + uint8 plane_sample_offset; + uint8 samples_per_pixel_per_plane; + uint64 jpeg_interchange_format; + uint64 jpeg_interchange_format_length; + uint8 jpeg_proc; + uint8 subsamplingcorrect; + uint8 subsamplingcorrect_done; + uint8 subsampling_tag; + uint8 subsampling_hor; + uint8 subsampling_ver; + uint8 subsampling_force_desubsampling_inside_decompression; + uint8 qtable_offset_count; + uint8 dctable_offset_count; + uint8 actable_offset_count; + uint64 qtable_offset[3]; + uint64 dctable_offset[3]; + uint64 actable_offset[3]; + uint8* qtable[4]; + uint8* dctable[4]; + uint8* actable[4]; + uint16 restart_interval; + uint8 restart_index; + uint8 sof_log; + uint8 sof_marker_id; + uint32 sof_x; + uint32 sof_y; + uint8 sof_c[3]; + uint8 sof_hv[3]; + uint8 sof_tq[3]; + uint8 sos_cs[3]; + uint8 sos_tda[3]; + struct { + uint8 log; + OJPEGStateInBufferSource in_buffer_source; + uint32 in_buffer_next_strile; + uint64 in_buffer_file_pos; + uint64 in_buffer_file_togo; + } sos_end[3]; + uint8 readheader_done; + uint8 writeheader_done; + uint16 write_cursample; + uint32 write_curstrile; + uint8 libjpeg_session_active; + uint8 libjpeg_jpeg_query_style; + jpeg_error_mgr libjpeg_jpeg_error_mgr; + jpeg_decompress_struct libjpeg_jpeg_decompress_struct; + jpeg_source_mgr libjpeg_jpeg_source_mgr; + uint8 subsampling_convert_log; + uint32 subsampling_convert_ylinelen; + uint32 subsampling_convert_ylines; + uint32 subsampling_convert_clinelen; + uint32 subsampling_convert_clines; + uint32 subsampling_convert_ybuflen; + uint32 subsampling_convert_cbuflen; + uint32 subsampling_convert_ycbcrbuflen; + uint8* subsampling_convert_ycbcrbuf; + uint8* subsampling_convert_ybuf; + uint8* subsampling_convert_cbbuf; + uint8* subsampling_convert_crbuf; + uint32 subsampling_convert_ycbcrimagelen; + uint8** subsampling_convert_ycbcrimage; + uint32 subsampling_convert_clinelenout; + uint32 subsampling_convert_state; + uint32 bytes_per_line; /* if the codec outputs subsampled data, a 'line' in bytes_per_line */ + uint32 lines_per_strile; /* and lines_per_strile means subsampling_ver desubsampled rows */ + OJPEGStateInBufferSource in_buffer_source; + uint32 in_buffer_next_strile; + uint32 in_buffer_strile_count; + uint64 in_buffer_file_pos; + uint8 in_buffer_file_pos_log; + uint64 in_buffer_file_togo; + uint16 in_buffer_togo; + uint8* in_buffer_cur; + uint8 in_buffer[OJPEG_BUFFER]; + OJPEGStateOutState out_state; + uint8 out_buffer[OJPEG_BUFFER]; + uint8* skip_buffer; +} OJPEGState; + +static int OJPEGVGetField(TIFF* tif, uint32 tag, va_list ap); +static int OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap); +static void OJPEGPrintDir(TIFF* tif, FILE* fd, long flags); + +static int OJPEGFixupTags(TIFF* tif); +static int OJPEGSetupDecode(TIFF* tif); +static int OJPEGPreDecode(TIFF* tif, uint16 s); +static int OJPEGPreDecodeSkipRaw(TIFF* tif); +static int OJPEGPreDecodeSkipScanlines(TIFF* tif); +static int OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc); +static int OJPEGDecodeScanlines(TIFF* tif, uint8* buf, tmsize_t cc); +static void OJPEGPostDecode(TIFF* tif, uint8* buf, tmsize_t cc); +static int OJPEGSetupEncode(TIFF* tif); +static int OJPEGPreEncode(TIFF* tif, uint16 s); +static int OJPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s); +static int OJPEGPostEncode(TIFF* tif); +static void OJPEGCleanup(TIFF* tif); + +static void OJPEGSubsamplingCorrect(TIFF* tif); +static int OJPEGReadHeaderInfo(TIFF* tif); +static int OJPEGReadSecondarySos(TIFF* tif, uint16 s); +static int OJPEGWriteHeaderInfo(TIFF* tif); +static void OJPEGLibjpegSessionAbort(TIFF* tif); + +static int OJPEGReadHeaderInfoSec(TIFF* tif); +static int OJPEGReadHeaderInfoSecStreamDri(TIFF* tif); +static int OJPEGReadHeaderInfoSecStreamDqt(TIFF* tif); +static int OJPEGReadHeaderInfoSecStreamDht(TIFF* tif); +static int OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id); +static int OJPEGReadHeaderInfoSecStreamSos(TIFF* tif); +static int OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif); +static int OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif); +static int OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif); + +static int OJPEGReadBufferFill(OJPEGState* sp); +static int OJPEGReadByte(OJPEGState* sp, uint8* byte); +static int OJPEGReadBytePeek(OJPEGState* sp, uint8* byte); +static void OJPEGReadByteAdvance(OJPEGState* sp); +static int OJPEGReadWord(OJPEGState* sp, uint16* word); +static int OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem); +static void OJPEGReadSkip(OJPEGState* sp, uint16 len); + +static int OJPEGWriteStream(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamQTable(TIFF* tif, uint8 table_index, void** mem, uint32* len); +static void OJPEGWriteStreamDcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len); +static void OJPEGWriteStreamAcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len); +static void OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32* len); +static int OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32* len); +static void OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32* len); + +#ifdef LIBJPEG_ENCAP_EXTERNAL +extern int jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo); +extern int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image); +extern int jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo); +extern int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines); +extern int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines); +extern void jpeg_encap_unwind(TIFF* tif); +#else +static int jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* j); +static int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image); +static int jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo); +static int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines); +static int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines); +static void jpeg_encap_unwind(TIFF* tif); +#endif + +static void OJPEGLibjpegJpegErrorMgrOutputMessage(jpeg_common_struct* cinfo); +static void OJPEGLibjpegJpegErrorMgrErrorExit(jpeg_common_struct* cinfo); +static void OJPEGLibjpegJpegSourceMgrInitSource(jpeg_decompress_struct* cinfo); +static boolean OJPEGLibjpegJpegSourceMgrFillInputBuffer(jpeg_decompress_struct* cinfo); +static void OJPEGLibjpegJpegSourceMgrSkipInputData(jpeg_decompress_struct* cinfo, long num_bytes); +static boolean OJPEGLibjpegJpegSourceMgrResyncToRestart(jpeg_decompress_struct* cinfo, int desired); +static void OJPEGLibjpegJpegSourceMgrTermSource(jpeg_decompress_struct* cinfo); + +int +TIFFInitOJPEG(TIFF* tif, int scheme) +{ + static const char module[]="TIFFInitOJPEG"; + OJPEGState* sp; + + assert(scheme==COMPRESSION_OJPEG); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, ojpegFields, TIFFArrayCount(ojpegFields))) { + TIFFErrorExt(tif->tif_clientdata, module, + "Merging Old JPEG codec-specific tags failed"); + return 0; + } + + /* state block */ + sp=_TIFFmalloc(sizeof(OJPEGState)); + if (sp==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"No space for OJPEG state block"); + return(0); + } + _TIFFmemset(sp,0,sizeof(OJPEGState)); + sp->tif=tif; + sp->jpeg_proc=1; + sp->subsampling_hor=2; + sp->subsampling_ver=2; + TIFFSetField(tif,TIFFTAG_YCBCRSUBSAMPLING,2,2); + /* tif codec methods */ + tif->tif_fixuptags=OJPEGFixupTags; + tif->tif_setupdecode=OJPEGSetupDecode; + tif->tif_predecode=OJPEGPreDecode; + tif->tif_postdecode=OJPEGPostDecode; + tif->tif_decoderow=OJPEGDecode; + tif->tif_decodestrip=OJPEGDecode; + tif->tif_decodetile=OJPEGDecode; + tif->tif_setupencode=OJPEGSetupEncode; + tif->tif_preencode=OJPEGPreEncode; + tif->tif_postencode=OJPEGPostEncode; + tif->tif_encoderow=OJPEGEncode; + tif->tif_encodestrip=OJPEGEncode; + tif->tif_encodetile=OJPEGEncode; + tif->tif_cleanup=OJPEGCleanup; + tif->tif_data=(uint8*)sp; + /* tif tag methods */ + sp->vgetparent=tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield=OJPEGVGetField; + sp->vsetparent=tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield=OJPEGVSetField; + sp->printdir=tif->tif_tagmethods.printdir; + tif->tif_tagmethods.printdir=OJPEGPrintDir; + /* Some OJPEG files don't have strip or tile offsets or bytecounts tags. + Some others do, but have totally meaningless or corrupt values + in these tags. In these cases, the JpegInterchangeFormat stream is + reliable. In any case, this decoder reads the compressed data itself, + from the most reliable locations, and we need to notify encapsulating + LibTiff not to read raw strips or tiles for us. */ + tif->tif_flags|=TIFF_NOREADRAW; + return(1); +} + +static int +OJPEGVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + switch(tag) + { + case TIFFTAG_JPEGIFOFFSET: + *va_arg(ap,uint64*)=(uint64)sp->jpeg_interchange_format; + break; + case TIFFTAG_JPEGIFBYTECOUNT: + *va_arg(ap,uint64*)=(uint64)sp->jpeg_interchange_format_length; + break; + case TIFFTAG_YCBCRSUBSAMPLING: + if (sp->subsamplingcorrect_done==0) + OJPEGSubsamplingCorrect(tif); + *va_arg(ap,uint16*)=(uint16)sp->subsampling_hor; + *va_arg(ap,uint16*)=(uint16)sp->subsampling_ver; + break; + case TIFFTAG_JPEGQTABLES: + *va_arg(ap,uint32*)=(uint32)sp->qtable_offset_count; + *va_arg(ap,void**)=(void*)sp->qtable_offset; + break; + case TIFFTAG_JPEGDCTABLES: + *va_arg(ap,uint32*)=(uint32)sp->dctable_offset_count; + *va_arg(ap,void**)=(void*)sp->dctable_offset; + break; + case TIFFTAG_JPEGACTABLES: + *va_arg(ap,uint32*)=(uint32)sp->actable_offset_count; + *va_arg(ap,void**)=(void*)sp->actable_offset; + break; + case TIFFTAG_JPEGPROC: + *va_arg(ap,uint16*)=(uint16)sp->jpeg_proc; + break; + case TIFFTAG_JPEGRESTARTINTERVAL: + *va_arg(ap,uint16*)=sp->restart_interval; + break; + default: + return (*sp->vgetparent)(tif,tag,ap); + } + return (1); +} + +static int +OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[]="OJPEGVSetField"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint32 ma; + uint64* mb; + uint32 n; + switch(tag) + { + case TIFFTAG_JPEGIFOFFSET: + sp->jpeg_interchange_format=(uint64)va_arg(ap,uint64); + break; + case TIFFTAG_JPEGIFBYTECOUNT: + sp->jpeg_interchange_format_length=(uint64)va_arg(ap,uint64); + break; + case TIFFTAG_YCBCRSUBSAMPLING: + sp->subsampling_tag=1; + sp->subsampling_hor=(uint8)va_arg(ap,uint16_vap); + sp->subsampling_ver=(uint8)va_arg(ap,uint16_vap); + tif->tif_dir.td_ycbcrsubsampling[0]=sp->subsampling_hor; + tif->tif_dir.td_ycbcrsubsampling[1]=sp->subsampling_ver; + break; + case TIFFTAG_JPEGQTABLES: + ma=(uint32)va_arg(ap,uint32); + if (ma!=0) + { + if (ma>3) + { + TIFFErrorExt(tif->tif_clientdata,module,"JpegQTables tag has incorrect count"); + return(0); + } + sp->qtable_offset_count=(uint8)ma; + mb=(uint64*)va_arg(ap,uint64*); + for (n=0; nqtable_offset[n]=mb[n]; + } + break; + case TIFFTAG_JPEGDCTABLES: + ma=(uint32)va_arg(ap,uint32); + if (ma!=0) + { + if (ma>3) + { + TIFFErrorExt(tif->tif_clientdata,module,"JpegDcTables tag has incorrect count"); + return(0); + } + sp->dctable_offset_count=(uint8)ma; + mb=(uint64*)va_arg(ap,uint64*); + for (n=0; ndctable_offset[n]=mb[n]; + } + break; + case TIFFTAG_JPEGACTABLES: + ma=(uint32)va_arg(ap,uint32); + if (ma!=0) + { + if (ma>3) + { + TIFFErrorExt(tif->tif_clientdata,module,"JpegAcTables tag has incorrect count"); + return(0); + } + sp->actable_offset_count=(uint8)ma; + mb=(uint64*)va_arg(ap,uint64*); + for (n=0; nactable_offset[n]=mb[n]; + } + break; + case TIFFTAG_JPEGPROC: + sp->jpeg_proc=(uint8)va_arg(ap,uint16_vap); + break; + case TIFFTAG_JPEGRESTARTINTERVAL: + sp->restart_interval=(uint16)va_arg(ap,uint16_vap); + break; + default: + return (*sp->vsetparent)(tif,tag,ap); + } + TIFFSetFieldBit(tif,TIFFFieldWithTag(tif,tag)->field_bit); + tif->tif_flags|=TIFF_DIRTYDIRECT; + return(1); +} + +static void +OJPEGPrintDir(TIFF* tif, FILE* fd, long flags) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + (void)flags; + assert(sp!=NULL); + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGINTERCHANGEFORMAT)) + fprintf(fd," JpegInterchangeFormat: " TIFF_UINT64_FORMAT "\n",(TIFF_UINT64_T)sp->jpeg_interchange_format); + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGINTERCHANGEFORMATLENGTH)) + fprintf(fd," JpegInterchangeFormatLength: " TIFF_UINT64_FORMAT "\n",(TIFF_UINT64_T)sp->jpeg_interchange_format_length); + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGQTABLES)) + { + fprintf(fd," JpegQTables:"); + for (m=0; mqtable_offset_count; m++) + fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->qtable_offset[m]); + fprintf(fd,"\n"); + } + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGDCTABLES)) + { + fprintf(fd," JpegDcTables:"); + for (m=0; mdctable_offset_count; m++) + fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->dctable_offset[m]); + fprintf(fd,"\n"); + } + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGACTABLES)) + { + fprintf(fd," JpegAcTables:"); + for (m=0; mactable_offset_count; m++) + fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->actable_offset[m]); + fprintf(fd,"\n"); + } + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGPROC)) + fprintf(fd," JpegProc: %u\n",(unsigned int)sp->jpeg_proc); + if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGRESTARTINTERVAL)) + fprintf(fd," JpegRestartInterval: %u\n",(unsigned int)sp->restart_interval); + if (sp->printdir) + (*sp->printdir)(tif, fd, flags); +} + +static int +OJPEGFixupTags(TIFF* tif) +{ + (void) tif; + return(1); +} + +static int +OJPEGSetupDecode(TIFF* tif) +{ + static const char module[]="OJPEGSetupDecode"; + TIFFWarningExt(tif->tif_clientdata,module,"Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software"); + return(1); +} + +static int +OJPEGPreDecode(TIFF* tif, uint16 s) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint32 m; + if (sp->subsamplingcorrect_done==0) + OJPEGSubsamplingCorrect(tif); + if (sp->readheader_done==0) + { + if (OJPEGReadHeaderInfo(tif)==0) + return(0); + } + if (sp->sos_end[s].log==0) + { + if (OJPEGReadSecondarySos(tif,s)==0) + return(0); + } + if isTiled(tif) + m=tif->tif_curtile; + else + m=tif->tif_curstrip; + if ((sp->writeheader_done!=0) && ((sp->write_cursample!=s) || (sp->write_curstrile>m))) + { + if (sp->libjpeg_session_active!=0) + OJPEGLibjpegSessionAbort(tif); + sp->writeheader_done=0; + } + if (sp->writeheader_done==0) + { + sp->plane_sample_offset=(uint8)s; + sp->write_cursample=s; + sp->write_curstrile=s*tif->tif_dir.td_stripsperimage; + if ((sp->in_buffer_file_pos_log==0) || + (sp->in_buffer_file_pos-sp->in_buffer_togo!=sp->sos_end[s].in_buffer_file_pos)) + { + sp->in_buffer_source=sp->sos_end[s].in_buffer_source; + sp->in_buffer_next_strile=sp->sos_end[s].in_buffer_next_strile; + sp->in_buffer_file_pos=sp->sos_end[s].in_buffer_file_pos; + sp->in_buffer_file_pos_log=0; + sp->in_buffer_file_togo=sp->sos_end[s].in_buffer_file_togo; + sp->in_buffer_togo=0; + sp->in_buffer_cur=0; + } + if (OJPEGWriteHeaderInfo(tif)==0) + return(0); + } + while (sp->write_curstrilelibjpeg_jpeg_query_style==0) + { + if (OJPEGPreDecodeSkipRaw(tif)==0) + return(0); + } + else + { + if (OJPEGPreDecodeSkipScanlines(tif)==0) + return(0); + } + sp->write_curstrile++; + } + return(1); +} + +static int +OJPEGPreDecodeSkipRaw(TIFF* tif) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint32 m; + m=sp->lines_per_strile; + if (sp->subsampling_convert_state!=0) + { + if (sp->subsampling_convert_clines-sp->subsampling_convert_state>=m) + { + sp->subsampling_convert_state+=m; + if (sp->subsampling_convert_state==sp->subsampling_convert_clines) + sp->subsampling_convert_state=0; + return(1); + } + m-=sp->subsampling_convert_clines-sp->subsampling_convert_state; + sp->subsampling_convert_state=0; + } + while (m>=sp->subsampling_convert_clines) + { + if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0) + return(0); + m-=sp->subsampling_convert_clines; + } + if (m>0) + { + if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0) + return(0); + sp->subsampling_convert_state=m; + } + return(1); +} + +static int +OJPEGPreDecodeSkipScanlines(TIFF* tif) +{ + static const char module[]="OJPEGPreDecodeSkipScanlines"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint32 m; + if (sp->skip_buffer==NULL) + { + sp->skip_buffer=_TIFFmalloc(sp->bytes_per_line); + if (sp->skip_buffer==NULL) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + } + for (m=0; mlines_per_strile; m++) + { + if (jpeg_read_scanlines_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),&sp->skip_buffer,1)==0) + return(0); + } + return(1); +} + +static int +OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + (void)s; + if (sp->libjpeg_jpeg_query_style==0) + { + if (OJPEGDecodeRaw(tif,buf,cc)==0) + return(0); + } + else + { + if (OJPEGDecodeScanlines(tif,buf,cc)==0) + return(0); + } + return(1); +} + +static int +OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc) +{ + static const char module[]="OJPEGDecodeRaw"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8* m; + tmsize_t n; + uint8* oy; + uint8* ocb; + uint8* ocr; + uint8* p; + uint32 q; + uint8* r; + uint8 sx,sy; + if (cc%sp->bytes_per_line!=0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Fractional scanline not read"); + return(0); + } + assert(cc>0); + m=buf; + n=cc; + do + { + if (sp->subsampling_convert_state==0) + { + if (jpeg_read_raw_data_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),sp->subsampling_convert_ycbcrimage,sp->subsampling_ver*8)==0) + return(0); + } + oy=sp->subsampling_convert_ybuf+sp->subsampling_convert_state*sp->subsampling_ver*sp->subsampling_convert_ylinelen; + ocb=sp->subsampling_convert_cbbuf+sp->subsampling_convert_state*sp->subsampling_convert_clinelen; + ocr=sp->subsampling_convert_crbuf+sp->subsampling_convert_state*sp->subsampling_convert_clinelen; + p=m; + for (q=0; qsubsampling_convert_clinelenout; q++) + { + r=oy; + for (sy=0; sysubsampling_ver; sy++) + { + for (sx=0; sxsubsampling_hor; sx++) + *p++=*r++; + r+=sp->subsampling_convert_ylinelen-sp->subsampling_hor; + } + oy+=sp->subsampling_hor; + *p++=*ocb++; + *p++=*ocr++; + } + sp->subsampling_convert_state++; + if (sp->subsampling_convert_state==sp->subsampling_convert_clines) + sp->subsampling_convert_state=0; + m+=sp->bytes_per_line; + n-=sp->bytes_per_line; + } while(n>0); + return(1); +} + +static int +OJPEGDecodeScanlines(TIFF* tif, uint8* buf, tmsize_t cc) +{ + static const char module[]="OJPEGDecodeScanlines"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8* m; + tmsize_t n; + if (cc%sp->bytes_per_line!=0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Fractional scanline not read"); + return(0); + } + assert(cc>0); + m=buf; + n=cc; + do + { + if (jpeg_read_scanlines_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),&m,1)==0) + return(0); + m+=sp->bytes_per_line; + n-=sp->bytes_per_line; + } while(n>0); + return(1); +} + +static void +OJPEGPostDecode(TIFF* tif, uint8* buf, tmsize_t cc) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + (void)buf; + (void)cc; + sp->write_curstrile++; + if (sp->write_curstrile%tif->tif_dir.td_stripsperimage==0) + { + assert(sp->libjpeg_session_active!=0); + OJPEGLibjpegSessionAbort(tif); + sp->writeheader_done=0; + } +} + +static int +OJPEGSetupEncode(TIFF* tif) +{ + static const char module[]="OJPEGSetupEncode"; + TIFFErrorExt(tif->tif_clientdata,module,"OJPEG encoding not supported; use new-style JPEG compression instead"); + return(0); +} + +static int +OJPEGPreEncode(TIFF* tif, uint16 s) +{ + static const char module[]="OJPEGPreEncode"; + (void)s; + TIFFErrorExt(tif->tif_clientdata,module,"OJPEG encoding not supported; use new-style JPEG compression instead"); + return(0); +} + +static int +OJPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + static const char module[]="OJPEGEncode"; + (void)buf; + (void)cc; + (void)s; + TIFFErrorExt(tif->tif_clientdata,module,"OJPEG encoding not supported; use new-style JPEG compression instead"); + return(0); +} + +static int +OJPEGPostEncode(TIFF* tif) +{ + static const char module[]="OJPEGPostEncode"; + TIFFErrorExt(tif->tif_clientdata,module,"OJPEG encoding not supported; use new-style JPEG compression instead"); + return(0); +} + +static void +OJPEGCleanup(TIFF* tif) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + if (sp!=0) + { + tif->tif_tagmethods.vgetfield=sp->vgetparent; + tif->tif_tagmethods.vsetfield=sp->vsetparent; + tif->tif_tagmethods.printdir=sp->printdir; + if (sp->qtable[0]!=0) + _TIFFfree(sp->qtable[0]); + if (sp->qtable[1]!=0) + _TIFFfree(sp->qtable[1]); + if (sp->qtable[2]!=0) + _TIFFfree(sp->qtable[2]); + if (sp->qtable[3]!=0) + _TIFFfree(sp->qtable[3]); + if (sp->dctable[0]!=0) + _TIFFfree(sp->dctable[0]); + if (sp->dctable[1]!=0) + _TIFFfree(sp->dctable[1]); + if (sp->dctable[2]!=0) + _TIFFfree(sp->dctable[2]); + if (sp->dctable[3]!=0) + _TIFFfree(sp->dctable[3]); + if (sp->actable[0]!=0) + _TIFFfree(sp->actable[0]); + if (sp->actable[1]!=0) + _TIFFfree(sp->actable[1]); + if (sp->actable[2]!=0) + _TIFFfree(sp->actable[2]); + if (sp->actable[3]!=0) + _TIFFfree(sp->actable[3]); + if (sp->libjpeg_session_active!=0) + OJPEGLibjpegSessionAbort(tif); + if (sp->subsampling_convert_ycbcrbuf!=0) + _TIFFfree(sp->subsampling_convert_ycbcrbuf); + if (sp->subsampling_convert_ycbcrimage!=0) + _TIFFfree(sp->subsampling_convert_ycbcrimage); + if (sp->skip_buffer!=0) + _TIFFfree(sp->skip_buffer); + _TIFFfree(sp); + tif->tif_data=NULL; + _TIFFSetDefaultCompressionState(tif); + } +} + +static void +OJPEGSubsamplingCorrect(TIFF* tif) +{ + static const char module[]="OJPEGSubsamplingCorrect"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 mh; + uint8 mv; + _TIFFFillStriles( tif ); + + assert(sp->subsamplingcorrect_done==0); + if ((tif->tif_dir.td_samplesperpixel!=3) || ((tif->tif_dir.td_photometric!=PHOTOMETRIC_YCBCR) && + (tif->tif_dir.td_photometric!=PHOTOMETRIC_ITULAB))) + { + if (sp->subsampling_tag!=0) + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag not appropriate for this Photometric and/or SamplesPerPixel"); + sp->subsampling_hor=1; + sp->subsampling_ver=1; + sp->subsampling_force_desubsampling_inside_decompression=0; + } + else + { + sp->subsamplingcorrect_done=1; + mh=sp->subsampling_hor; + mv=sp->subsampling_ver; + sp->subsamplingcorrect=1; + OJPEGReadHeaderInfoSec(tif); + if (sp->subsampling_force_desubsampling_inside_decompression!=0) + { + sp->subsampling_hor=1; + sp->subsampling_ver=1; + } + sp->subsamplingcorrect=0; + if (((sp->subsampling_hor!=mh) || (sp->subsampling_ver!=mv)) && (sp->subsampling_force_desubsampling_inside_decompression==0)) + { + if (sp->subsampling_tag==0) + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag is not set, yet subsampling inside JPEG data [%d,%d] does not match default values [2,2]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver); + else + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data [%d,%d] does not match subsampling tag values [%d,%d]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver,mh,mv); + } + if (sp->subsampling_force_desubsampling_inside_decompression!=0) + { + if (sp->subsampling_tag==0) + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag is not set, yet subsampling inside JPEG data does not match default values [2,2] (nor any other values allowed in TIFF); assuming subsampling inside JPEG data is correct and desubsampling inside JPEG decompression"); + else + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data does not match subsampling tag values [%d,%d] (nor any other values allowed in TIFF); assuming subsampling inside JPEG data is correct and desubsampling inside JPEG decompression",mh,mv); + } + if (sp->subsampling_force_desubsampling_inside_decompression==0) + { + if (sp->subsampling_horsubsampling_ver) + TIFFWarningExt(tif->tif_clientdata,module,"Subsampling values [%d,%d] are not allowed in TIFF",sp->subsampling_hor,sp->subsampling_ver); + } + } + sp->subsamplingcorrect_done=1; +} + +static int +OJPEGReadHeaderInfo(TIFF* tif) +{ + static const char module[]="OJPEGReadHeaderInfo"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(sp->readheader_done==0); + sp->image_width=tif->tif_dir.td_imagewidth; + sp->image_length=tif->tif_dir.td_imagelength; + if isTiled(tif) + { + sp->strile_width=tif->tif_dir.td_tilewidth; + sp->strile_length=tif->tif_dir.td_tilelength; + sp->strile_length_total=((sp->image_length+sp->strile_length-1)/sp->strile_length)*sp->strile_length; + } + else + { + sp->strile_width=sp->image_width; + sp->strile_length=tif->tif_dir.td_rowsperstrip; + sp->strile_length_total=sp->image_length; + } + if (tif->tif_dir.td_samplesperpixel==1) + { + sp->samples_per_pixel=1; + sp->plane_sample_offset=0; + sp->samples_per_pixel_per_plane=sp->samples_per_pixel; + sp->subsampling_hor=1; + sp->subsampling_ver=1; + } + else + { + if (tif->tif_dir.td_samplesperpixel!=3) + { + TIFFErrorExt(tif->tif_clientdata,module,"SamplesPerPixel %d not supported for this compression scheme",sp->samples_per_pixel); + return(0); + } + sp->samples_per_pixel=3; + sp->plane_sample_offset=0; + if (tif->tif_dir.td_planarconfig==PLANARCONFIG_CONTIG) + sp->samples_per_pixel_per_plane=3; + else + sp->samples_per_pixel_per_plane=1; + } + if (sp->strile_lengthimage_length) + { + if (sp->strile_length%(sp->subsampling_ver*8)!=0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Incompatible vertical subsampling and image strip/tile length"); + return(0); + } + sp->restart_interval=((sp->strile_width+sp->subsampling_hor*8-1)/(sp->subsampling_hor*8))*(sp->strile_length/(sp->subsampling_ver*8)); + } + if (OJPEGReadHeaderInfoSec(tif)==0) + return(0); + sp->sos_end[0].log=1; + sp->sos_end[0].in_buffer_source=sp->in_buffer_source; + sp->sos_end[0].in_buffer_next_strile=sp->in_buffer_next_strile; + sp->sos_end[0].in_buffer_file_pos=sp->in_buffer_file_pos-sp->in_buffer_togo; + sp->sos_end[0].in_buffer_file_togo=sp->in_buffer_file_togo+sp->in_buffer_togo; + sp->readheader_done=1; + return(1); +} + +static int +OJPEGReadSecondarySos(TIFF* tif, uint16 s) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + assert(s>0); + assert(s<3); + assert(sp->sos_end[0].log!=0); + assert(sp->sos_end[s].log==0); + sp->plane_sample_offset=s-1; + while(sp->sos_end[sp->plane_sample_offset].log==0) + sp->plane_sample_offset--; + sp->in_buffer_source=sp->sos_end[sp->plane_sample_offset].in_buffer_source; + sp->in_buffer_next_strile=sp->sos_end[sp->plane_sample_offset].in_buffer_next_strile; + sp->in_buffer_file_pos=sp->sos_end[sp->plane_sample_offset].in_buffer_file_pos; + sp->in_buffer_file_pos_log=0; + sp->in_buffer_file_togo=sp->sos_end[sp->plane_sample_offset].in_buffer_file_togo; + sp->in_buffer_togo=0; + sp->in_buffer_cur=0; + while(sp->plane_sample_offsetplane_sample_offset++; + if (OJPEGReadHeaderInfoSecStreamSos(tif)==0) + return(0); + sp->sos_end[sp->plane_sample_offset].log=1; + sp->sos_end[sp->plane_sample_offset].in_buffer_source=sp->in_buffer_source; + sp->sos_end[sp->plane_sample_offset].in_buffer_next_strile=sp->in_buffer_next_strile; + sp->sos_end[sp->plane_sample_offset].in_buffer_file_pos=sp->in_buffer_file_pos-sp->in_buffer_togo; + sp->sos_end[sp->plane_sample_offset].in_buffer_file_togo=sp->in_buffer_file_togo+sp->in_buffer_togo; + } + return(1); +} + +static int +OJPEGWriteHeaderInfo(TIFF* tif) +{ + static const char module[]="OJPEGWriteHeaderInfo"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8** m; + uint32 n; + /* if a previous attempt failed, don't try again */ + if (sp->libjpeg_session_active != 0) + return 0; + sp->out_state=ososSoi; + sp->restart_index=0; + jpeg_std_error(&(sp->libjpeg_jpeg_error_mgr)); + sp->libjpeg_jpeg_error_mgr.output_message=OJPEGLibjpegJpegErrorMgrOutputMessage; + sp->libjpeg_jpeg_error_mgr.error_exit=OJPEGLibjpegJpegErrorMgrErrorExit; + sp->libjpeg_jpeg_decompress_struct.err=&(sp->libjpeg_jpeg_error_mgr); + sp->libjpeg_jpeg_decompress_struct.client_data=(void*)tif; + if (jpeg_create_decompress_encap(sp,&(sp->libjpeg_jpeg_decompress_struct))==0) + return(0); + sp->libjpeg_session_active=1; + sp->libjpeg_jpeg_source_mgr.bytes_in_buffer=0; + sp->libjpeg_jpeg_source_mgr.init_source=OJPEGLibjpegJpegSourceMgrInitSource; + sp->libjpeg_jpeg_source_mgr.fill_input_buffer=OJPEGLibjpegJpegSourceMgrFillInputBuffer; + sp->libjpeg_jpeg_source_mgr.skip_input_data=OJPEGLibjpegJpegSourceMgrSkipInputData; + sp->libjpeg_jpeg_source_mgr.resync_to_restart=OJPEGLibjpegJpegSourceMgrResyncToRestart; + sp->libjpeg_jpeg_source_mgr.term_source=OJPEGLibjpegJpegSourceMgrTermSource; + sp->libjpeg_jpeg_decompress_struct.src=&(sp->libjpeg_jpeg_source_mgr); + if (jpeg_read_header_encap(sp,&(sp->libjpeg_jpeg_decompress_struct),1)==0) + return(0); + if ((sp->subsampling_force_desubsampling_inside_decompression==0) && (sp->samples_per_pixel_per_plane>1)) + { + sp->libjpeg_jpeg_decompress_struct.raw_data_out=1; +#if JPEG_LIB_VERSION >= 70 + sp->libjpeg_jpeg_decompress_struct.do_fancy_upsampling=FALSE; +#endif + sp->libjpeg_jpeg_query_style=0; + if (sp->subsampling_convert_log==0) + { + assert(sp->subsampling_convert_ycbcrbuf==0); + assert(sp->subsampling_convert_ycbcrimage==0); + sp->subsampling_convert_ylinelen=((sp->strile_width+sp->subsampling_hor*8-1)/(sp->subsampling_hor*8)*sp->subsampling_hor*8); + sp->subsampling_convert_ylines=sp->subsampling_ver*8; + sp->subsampling_convert_clinelen=sp->subsampling_convert_ylinelen/sp->subsampling_hor; + sp->subsampling_convert_clines=8; + sp->subsampling_convert_ybuflen=sp->subsampling_convert_ylinelen*sp->subsampling_convert_ylines; + sp->subsampling_convert_cbuflen=sp->subsampling_convert_clinelen*sp->subsampling_convert_clines; + sp->subsampling_convert_ycbcrbuflen=sp->subsampling_convert_ybuflen+2*sp->subsampling_convert_cbuflen; + sp->subsampling_convert_ycbcrbuf=_TIFFmalloc(sp->subsampling_convert_ycbcrbuflen); + if (sp->subsampling_convert_ycbcrbuf==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + sp->subsampling_convert_ybuf=sp->subsampling_convert_ycbcrbuf; + sp->subsampling_convert_cbbuf=sp->subsampling_convert_ybuf+sp->subsampling_convert_ybuflen; + sp->subsampling_convert_crbuf=sp->subsampling_convert_cbbuf+sp->subsampling_convert_cbuflen; + sp->subsampling_convert_ycbcrimagelen=3+sp->subsampling_convert_ylines+2*sp->subsampling_convert_clines; + sp->subsampling_convert_ycbcrimage=_TIFFmalloc(sp->subsampling_convert_ycbcrimagelen*sizeof(uint8*)); + if (sp->subsampling_convert_ycbcrimage==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + m=sp->subsampling_convert_ycbcrimage; + *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3); + *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3+sp->subsampling_convert_ylines); + *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3+sp->subsampling_convert_ylines+sp->subsampling_convert_clines); + for (n=0; nsubsampling_convert_ylines; n++) + *m++=sp->subsampling_convert_ybuf+n*sp->subsampling_convert_ylinelen; + for (n=0; nsubsampling_convert_clines; n++) + *m++=sp->subsampling_convert_cbbuf+n*sp->subsampling_convert_clinelen; + for (n=0; nsubsampling_convert_clines; n++) + *m++=sp->subsampling_convert_crbuf+n*sp->subsampling_convert_clinelen; + sp->subsampling_convert_clinelenout=((sp->strile_width+sp->subsampling_hor-1)/sp->subsampling_hor); + sp->subsampling_convert_state=0; + sp->bytes_per_line=sp->subsampling_convert_clinelenout*(sp->subsampling_ver*sp->subsampling_hor+2); + sp->lines_per_strile=((sp->strile_length+sp->subsampling_ver-1)/sp->subsampling_ver); + sp->subsampling_convert_log=1; + } + } + else + { + sp->libjpeg_jpeg_decompress_struct.jpeg_color_space=JCS_UNKNOWN; + sp->libjpeg_jpeg_decompress_struct.out_color_space=JCS_UNKNOWN; + sp->libjpeg_jpeg_query_style=1; + sp->bytes_per_line=sp->samples_per_pixel_per_plane*sp->strile_width; + sp->lines_per_strile=sp->strile_length; + } + if (jpeg_start_decompress_encap(sp,&(sp->libjpeg_jpeg_decompress_struct))==0) + return(0); + sp->writeheader_done=1; + return(1); +} + +static void +OJPEGLibjpegSessionAbort(TIFF* tif) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(sp->libjpeg_session_active!=0); + jpeg_destroy((jpeg_common_struct*)(&(sp->libjpeg_jpeg_decompress_struct))); + sp->libjpeg_session_active=0; +} + +static int +OJPEGReadHeaderInfoSec(TIFF* tif) +{ + static const char module[]="OJPEGReadHeaderInfoSec"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + uint16 n; + uint8 o; + if (sp->file_size==0) + sp->file_size=TIFFGetFileSize(tif); + if (sp->jpeg_interchange_format!=0) + { + if (sp->jpeg_interchange_format>=sp->file_size) + { + sp->jpeg_interchange_format=0; + sp->jpeg_interchange_format_length=0; + } + else + { + if ((sp->jpeg_interchange_format_length==0) || (sp->jpeg_interchange_format+sp->jpeg_interchange_format_length>sp->file_size)) + sp->jpeg_interchange_format_length=sp->file_size-sp->jpeg_interchange_format; + } + } + sp->in_buffer_source=osibsNotSetYet; + sp->in_buffer_next_strile=0; + sp->in_buffer_strile_count=tif->tif_dir.td_nstrips; + sp->in_buffer_file_togo=0; + sp->in_buffer_togo=0; + do + { + if (OJPEGReadBytePeek(sp,&m)==0) + return(0); + if (m!=255) + break; + OJPEGReadByteAdvance(sp); + do + { + if (OJPEGReadByte(sp,&m)==0) + return(0); + } while(m==255); + switch(m) + { + case JPEG_MARKER_SOI: + /* this type of marker has no data, and should be skipped */ + break; + case JPEG_MARKER_COM: + case JPEG_MARKER_APP0: + case JPEG_MARKER_APP0+1: + case JPEG_MARKER_APP0+2: + case JPEG_MARKER_APP0+3: + case JPEG_MARKER_APP0+4: + case JPEG_MARKER_APP0+5: + case JPEG_MARKER_APP0+6: + case JPEG_MARKER_APP0+7: + case JPEG_MARKER_APP0+8: + case JPEG_MARKER_APP0+9: + case JPEG_MARKER_APP0+10: + case JPEG_MARKER_APP0+11: + case JPEG_MARKER_APP0+12: + case JPEG_MARKER_APP0+13: + case JPEG_MARKER_APP0+14: + case JPEG_MARKER_APP0+15: + /* this type of marker has data, but it has no use to us (and no place here) and should be skipped */ + if (OJPEGReadWord(sp,&n)==0) + return(0); + if (n<2) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JPEG data"); + return(0); + } + if (n>2) + OJPEGReadSkip(sp,n-2); + break; + case JPEG_MARKER_DRI: + if (OJPEGReadHeaderInfoSecStreamDri(tif)==0) + return(0); + break; + case JPEG_MARKER_DQT: + if (OJPEGReadHeaderInfoSecStreamDqt(tif)==0) + return(0); + break; + case JPEG_MARKER_DHT: + if (OJPEGReadHeaderInfoSecStreamDht(tif)==0) + return(0); + break; + case JPEG_MARKER_SOF0: + case JPEG_MARKER_SOF1: + case JPEG_MARKER_SOF3: + if (OJPEGReadHeaderInfoSecStreamSof(tif,m)==0) + return(0); + if (sp->subsamplingcorrect!=0) + return(1); + break; + case JPEG_MARKER_SOS: + if (sp->subsamplingcorrect!=0) + return(1); + assert(sp->plane_sample_offset==0); + if (OJPEGReadHeaderInfoSecStreamSos(tif)==0) + return(0); + break; + default: + TIFFErrorExt(tif->tif_clientdata,module,"Unknown marker type %d in JPEG data",m); + return(0); + } + } while(m!=JPEG_MARKER_SOS); + if (sp->subsamplingcorrect) + return(1); + if (sp->sof_log==0) + { + if (OJPEGReadHeaderInfoSecTablesQTable(tif)==0) + return(0); + sp->sof_marker_id=JPEG_MARKER_SOF0; + for (o=0; osamples_per_pixel; o++) + sp->sof_c[o]=o; + sp->sof_hv[0]=((sp->subsampling_hor<<4)|sp->subsampling_ver); + for (o=1; osamples_per_pixel; o++) + sp->sof_hv[o]=17; + sp->sof_x=sp->strile_width; + sp->sof_y=sp->strile_length_total; + sp->sof_log=1; + if (OJPEGReadHeaderInfoSecTablesDcTable(tif)==0) + return(0); + if (OJPEGReadHeaderInfoSecTablesAcTable(tif)==0) + return(0); + for (o=1; osamples_per_pixel; o++) + sp->sos_cs[o]=o; + } + return(1); +} + +static int +OJPEGReadHeaderInfoSecStreamDri(TIFF* tif) +{ + /* this could easilly cause trouble in some cases... but no such cases have occured sofar */ + static const char module[]="OJPEGReadHeaderInfoSecStreamDri"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint16 m; + if (OJPEGReadWord(sp,&m)==0) + return(0); + if (m!=4) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DRI marker in JPEG data"); + return(0); + } + if (OJPEGReadWord(sp,&m)==0) + return(0); + sp->restart_interval=m; + return(1); +} + +static int +OJPEGReadHeaderInfoSecStreamDqt(TIFF* tif) +{ + /* this is a table marker, and it is to be saved as a whole for exact pushing on the jpeg stream later on */ + static const char module[]="OJPEGReadHeaderInfoSecStreamDqt"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint16 m; + uint32 na; + uint8* nb; + uint8 o; + if (OJPEGReadWord(sp,&m)==0) + return(0); + if (m<=2) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DQT marker in JPEG data"); + return(0); + } + if (sp->subsamplingcorrect!=0) + OJPEGReadSkip(sp,m-2); + else + { + m-=2; + do + { + if (m<65) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DQT marker in JPEG data"); + return(0); + } + na=sizeof(uint32)+69; + nb=_TIFFmalloc(na); + if (nb==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + *(uint32*)nb=na; + nb[sizeof(uint32)]=255; + nb[sizeof(uint32)+1]=JPEG_MARKER_DQT; + nb[sizeof(uint32)+2]=0; + nb[sizeof(uint32)+3]=67; + if (OJPEGReadBlock(sp,65,&nb[sizeof(uint32)+4])==0) { + _TIFFfree(nb); + return(0); + } + o=nb[sizeof(uint32)+4]&15; + if (3tif_clientdata,module,"Corrupt DQT marker in JPEG data"); + _TIFFfree(nb); + return(0); + } + if (sp->qtable[o]!=0) + _TIFFfree(sp->qtable[o]); + sp->qtable[o]=nb; + m-=65; + } while(m>0); + } + return(1); +} + +static int +OJPEGReadHeaderInfoSecStreamDht(TIFF* tif) +{ + /* this is a table marker, and it is to be saved as a whole for exact pushing on the jpeg stream later on */ + /* TODO: the following assumes there is only one table in this marker... but i'm not quite sure that assumption is guaranteed correct */ + static const char module[]="OJPEGReadHeaderInfoSecStreamDht"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint16 m; + uint32 na; + uint8* nb; + uint8 o; + if (OJPEGReadWord(sp,&m)==0) + return(0); + if (m<=2) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DHT marker in JPEG data"); + return(0); + } + if (sp->subsamplingcorrect!=0) + { + OJPEGReadSkip(sp,m-2); + } + else + { + na=sizeof(uint32)+2+m; + nb=_TIFFmalloc(na); + if (nb==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + *(uint32*)nb=na; + nb[sizeof(uint32)]=255; + nb[sizeof(uint32)+1]=JPEG_MARKER_DHT; + nb[sizeof(uint32)+2]=(m>>8); + nb[sizeof(uint32)+3]=(m&255); + if (OJPEGReadBlock(sp,m-2,&nb[sizeof(uint32)+4])==0) + return(0); + o=nb[sizeof(uint32)+4]; + if ((o&240)==0) + { + if (3tif_clientdata,module,"Corrupt DHT marker in JPEG data"); + return(0); + } + if (sp->dctable[o]!=0) + _TIFFfree(sp->dctable[o]); + sp->dctable[o]=nb; + } + else + { + if ((o&240)!=16) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DHT marker in JPEG data"); + return(0); + } + o&=15; + if (3tif_clientdata,module,"Corrupt DHT marker in JPEG data"); + return(0); + } + if (sp->actable[o]!=0) + _TIFFfree(sp->actable[o]); + sp->actable[o]=nb; + } + } + return(1); +} + +static int +OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id) +{ + /* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */ + static const char module[]="OJPEGReadHeaderInfoSecStreamSof"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint16 m; + uint16 n; + uint8 o; + uint16 p; + uint16 q; + if (sp->sof_log!=0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JPEG data"); + return(0); + } + if (sp->subsamplingcorrect==0) + sp->sof_marker_id=marker_id; + /* Lf: data length */ + if (OJPEGReadWord(sp,&m)==0) + return(0); + if (m<11) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOF marker in JPEG data"); + return(0); + } + m-=8; + if (m%3!=0) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOF marker in JPEG data"); + return(0); + } + n=m/3; + if (sp->subsamplingcorrect==0) + { + if (n!=sp->samples_per_pixel) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected number of samples"); + return(0); + } + } + /* P: Sample precision */ + if (OJPEGReadByte(sp,&o)==0) + return(0); + if (o!=8) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected number of bits per sample"); + return(0); + } + /* Y: Number of lines, X: Number of samples per line */ + if (sp->subsamplingcorrect) + OJPEGReadSkip(sp,4); + else + { + /* Y: Number of lines */ + if (OJPEGReadWord(sp,&p)==0) + return(0); + if (((uint32)pimage_length) && ((uint32)pstrile_length_total)) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected height"); + return(0); + } + sp->sof_y=p; + /* X: Number of samples per line */ + if (OJPEGReadWord(sp,&p)==0) + return(0); + if (((uint32)pimage_width) && ((uint32)pstrile_width)) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected width"); + return(0); + } + if ((uint32)p>sp->strile_width) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data image width exceeds expected image width"); + return(0); + } + sp->sof_x=p; + } + /* Nf: Number of image components in frame */ + if (OJPEGReadByte(sp,&o)==0) + return(0); + if (o!=n) + { + if (sp->subsamplingcorrect==0) + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOF marker in JPEG data"); + return(0); + } + /* per component stuff */ + /* TODO: double-check that flow implies that n cannot be as big as to make us overflow sof_c, sof_hv and sof_tq arrays */ + for (q=0; qsubsamplingcorrect==0) + sp->sof_c[q]=o; + /* H: Horizontal sampling factor, and V: Vertical sampling factor */ + if (OJPEGReadByte(sp,&o)==0) + return(0); + if (sp->subsamplingcorrect!=0) + { + if (q==0) + { + sp->subsampling_hor=(o>>4); + sp->subsampling_ver=(o&15); + if (((sp->subsampling_hor!=1) && (sp->subsampling_hor!=2) && (sp->subsampling_hor!=4)) || + ((sp->subsampling_ver!=1) && (sp->subsampling_ver!=2) && (sp->subsampling_ver!=4))) + sp->subsampling_force_desubsampling_inside_decompression=1; + } + else + { + if (o!=17) + sp->subsampling_force_desubsampling_inside_decompression=1; + } + } + else + { + sp->sof_hv[q]=o; + if (sp->subsampling_force_desubsampling_inside_decompression==0) + { + if (q==0) + { + if (o!=((sp->subsampling_hor<<4)|sp->subsampling_ver)) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected subsampling values"); + return(0); + } + } + else + { + if (o!=17) + { + TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected subsampling values"); + return(0); + } + } + } + } + /* Tq: Quantization table destination selector */ + if (OJPEGReadByte(sp,&o)==0) + return(0); + if (sp->subsamplingcorrect==0) + sp->sof_tq[q]=o; + } + if (sp->subsamplingcorrect==0) + sp->sof_log=1; + return(1); +} + +static int +OJPEGReadHeaderInfoSecStreamSos(TIFF* tif) +{ + /* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */ + static const char module[]="OJPEGReadHeaderInfoSecStreamSos"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint16 m; + uint8 n; + uint8 o; + assert(sp->subsamplingcorrect==0); + if (sp->sof_log==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); + return(0); + } + /* Ls */ + if (OJPEGReadWord(sp,&m)==0) + return(0); + if (m!=6+sp->samples_per_pixel_per_plane*2) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); + return(0); + } + /* Ns */ + if (OJPEGReadByte(sp,&n)==0) + return(0); + if (n!=sp->samples_per_pixel_per_plane) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); + return(0); + } + /* Cs, Td, and Ta */ + for (o=0; osamples_per_pixel_per_plane; o++) + { + /* Cs */ + if (OJPEGReadByte(sp,&n)==0) + return(0); + sp->sos_cs[sp->plane_sample_offset+o]=n; + /* Td and Ta */ + if (OJPEGReadByte(sp,&n)==0) + return(0); + sp->sos_tda[sp->plane_sample_offset+o]=n; + } + /* skip Ss, Se, Ah, en Al -> no check, as per Tom Lane recommendation, as per LibJpeg source */ + OJPEGReadSkip(sp,3); + return(1); +} + +static int +OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif) +{ + static const char module[]="OJPEGReadHeaderInfoSecTablesQTable"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + uint8 n; + uint32 oa; + uint8* ob; + uint32 p; + if (sp->qtable_offset[0]==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables"); + return(0); + } + sp->in_buffer_file_pos_log=0; + for (m=0; msamples_per_pixel; m++) + { + if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1]))) + { + for (n=0; nqtable_offset[m]==sp->qtable_offset[n]) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JpegQTables tag value"); + return(0); + } + } + oa=sizeof(uint32)+69; + ob=_TIFFmalloc(oa); + if (ob==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + *(uint32*)ob=oa; + ob[sizeof(uint32)]=255; + ob[sizeof(uint32)+1]=JPEG_MARKER_DQT; + ob[sizeof(uint32)+2]=0; + ob[sizeof(uint32)+3]=67; + ob[sizeof(uint32)+4]=m; + TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); + p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64); + if (p!=64) + return(0); + sp->qtable[m]=ob; + sp->sof_tq[m]=m; + } + else + sp->sof_tq[m]=sp->sof_tq[m-1]; + } + return(1); +} + +static int +OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif) +{ + static const char module[]="OJPEGReadHeaderInfoSecTablesDcTable"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + uint8 n; + uint8 o[16]; + uint32 p; + uint32 q; + uint32 ra; + uint8* rb; + if (sp->dctable_offset[0]==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables"); + return(0); + } + sp->in_buffer_file_pos_log=0; + for (m=0; msamples_per_pixel; m++) + { + if ((sp->dctable_offset[m]!=0) && ((m==0) || (sp->dctable_offset[m]!=sp->dctable_offset[m-1]))) + { + for (n=0; ndctable_offset[m]==sp->dctable_offset[n]) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JpegDcTables tag value"); + return(0); + } + } + TIFFSeekFile(tif,sp->dctable_offset[m],SEEK_SET); + p=TIFFReadFile(tif,o,16); + if (p!=16) + return(0); + q=0; + for (n=0; n<16; n++) + q+=o[n]; + ra=sizeof(uint32)+21+q; + rb=_TIFFmalloc(ra); + if (rb==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + *(uint32*)rb=ra; + rb[sizeof(uint32)]=255; + rb[sizeof(uint32)+1]=JPEG_MARKER_DHT; + rb[sizeof(uint32)+2]=((19+q)>>8); + rb[sizeof(uint32)+3]=((19+q)&255); + rb[sizeof(uint32)+4]=m; + for (n=0; n<16; n++) + rb[sizeof(uint32)+5+n]=o[n]; + p=TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q); + if (p!=q) + return(0); + sp->dctable[m]=rb; + sp->sos_tda[m]=(m<<4); + } + else + sp->sos_tda[m]=sp->sos_tda[m-1]; + } + return(1); +} + +static int +OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif) +{ + static const char module[]="OJPEGReadHeaderInfoSecTablesAcTable"; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + uint8 n; + uint8 o[16]; + uint32 p; + uint32 q; + uint32 ra; + uint8* rb; + if (sp->actable_offset[0]==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables"); + return(0); + } + sp->in_buffer_file_pos_log=0; + for (m=0; msamples_per_pixel; m++) + { + if ((sp->actable_offset[m]!=0) && ((m==0) || (sp->actable_offset[m]!=sp->actable_offset[m-1]))) + { + for (n=0; nactable_offset[m]==sp->actable_offset[n]) + { + TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JpegAcTables tag value"); + return(0); + } + } + TIFFSeekFile(tif,sp->actable_offset[m],SEEK_SET); + p=TIFFReadFile(tif,o,16); + if (p!=16) + return(0); + q=0; + for (n=0; n<16; n++) + q+=o[n]; + ra=sizeof(uint32)+21+q; + rb=_TIFFmalloc(ra); + if (rb==0) + { + TIFFErrorExt(tif->tif_clientdata,module,"Out of memory"); + return(0); + } + *(uint32*)rb=ra; + rb[sizeof(uint32)]=255; + rb[sizeof(uint32)+1]=JPEG_MARKER_DHT; + rb[sizeof(uint32)+2]=((19+q)>>8); + rb[sizeof(uint32)+3]=((19+q)&255); + rb[sizeof(uint32)+4]=(16|m); + for (n=0; n<16; n++) + rb[sizeof(uint32)+5+n]=o[n]; + p=TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q); + if (p!=q) + return(0); + sp->actable[m]=rb; + sp->sos_tda[m]=(sp->sos_tda[m]|m); + } + else + sp->sos_tda[m]=(sp->sos_tda[m]|(sp->sos_tda[m-1]&15)); + } + return(1); +} + +static int +OJPEGReadBufferFill(OJPEGState* sp) +{ + uint16 m; + tmsize_t n; + /* TODO: double-check: when subsamplingcorrect is set, no call to TIFFErrorExt or TIFFWarningExt should be made + * in any other case, seek or read errors should be passed through */ + do + { + if (sp->in_buffer_file_togo!=0) + { + if (sp->in_buffer_file_pos_log==0) + { + TIFFSeekFile(sp->tif,sp->in_buffer_file_pos,SEEK_SET); + sp->in_buffer_file_pos_log=1; + } + m=OJPEG_BUFFER; + if ((uint64)m>sp->in_buffer_file_togo) + m=(uint16)sp->in_buffer_file_togo; + n=TIFFReadFile(sp->tif,sp->in_buffer,(tmsize_t)m); + if (n==0) + return(0); + assert(n>0); + assert(n<=OJPEG_BUFFER); + assert(n<65536); + assert((uint64)n<=sp->in_buffer_file_togo); + m=(uint16)n; + sp->in_buffer_togo=m; + sp->in_buffer_cur=sp->in_buffer; + sp->in_buffer_file_togo-=m; + sp->in_buffer_file_pos+=m; + break; + } + sp->in_buffer_file_pos_log=0; + switch(sp->in_buffer_source) + { + case osibsNotSetYet: + if (sp->jpeg_interchange_format!=0) + { + sp->in_buffer_file_pos=sp->jpeg_interchange_format; + sp->in_buffer_file_togo=sp->jpeg_interchange_format_length; + } + sp->in_buffer_source=osibsJpegInterchangeFormat; + break; + case osibsJpegInterchangeFormat: + sp->in_buffer_source=osibsStrile; + case osibsStrile: + if (!_TIFFFillStriles( sp->tif ) + || sp->tif->tif_dir.td_stripoffset == NULL + || sp->tif->tif_dir.td_stripbytecount == NULL) + return 0; + + if (sp->in_buffer_next_strile==sp->in_buffer_strile_count) + sp->in_buffer_source=osibsEof; + else + { + sp->in_buffer_file_pos=sp->tif->tif_dir.td_stripoffset[sp->in_buffer_next_strile]; + if (sp->in_buffer_file_pos!=0) + { + if (sp->in_buffer_file_pos>=sp->file_size) + sp->in_buffer_file_pos=0; + else if (sp->tif->tif_dir.td_stripbytecount==NULL) + sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos; + else + { + if (sp->tif->tif_dir.td_stripbytecount == 0) { + TIFFErrorExt(sp->tif->tif_clientdata,sp->tif->tif_name,"Strip byte counts are missing"); + return(0); + } + sp->in_buffer_file_togo=sp->tif->tif_dir.td_stripbytecount[sp->in_buffer_next_strile]; + if (sp->in_buffer_file_togo==0) + sp->in_buffer_file_pos=0; + else if (sp->in_buffer_file_pos+sp->in_buffer_file_togo>sp->file_size) + sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos; + } + } + sp->in_buffer_next_strile++; + } + break; + default: + return(0); + } + } while (1); + return(1); +} + +static int +OJPEGReadByte(OJPEGState* sp, uint8* byte) +{ + if (sp->in_buffer_togo==0) + { + if (OJPEGReadBufferFill(sp)==0) + return(0); + assert(sp->in_buffer_togo>0); + } + *byte=*(sp->in_buffer_cur); + sp->in_buffer_cur++; + sp->in_buffer_togo--; + return(1); +} + +static int +OJPEGReadBytePeek(OJPEGState* sp, uint8* byte) +{ + if (sp->in_buffer_togo==0) + { + if (OJPEGReadBufferFill(sp)==0) + return(0); + assert(sp->in_buffer_togo>0); + } + *byte=*(sp->in_buffer_cur); + return(1); +} + +static void +OJPEGReadByteAdvance(OJPEGState* sp) +{ + assert(sp->in_buffer_togo>0); + sp->in_buffer_cur++; + sp->in_buffer_togo--; +} + +static int +OJPEGReadWord(OJPEGState* sp, uint16* word) +{ + uint8 m; + if (OJPEGReadByte(sp,&m)==0) + return(0); + *word=(m<<8); + if (OJPEGReadByte(sp,&m)==0) + return(0); + *word|=m; + return(1); +} + +static int +OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem) +{ + uint16 mlen; + uint8* mmem; + uint16 n; + assert(len>0); + mlen=len; + mmem=mem; + do + { + if (sp->in_buffer_togo==0) + { + if (OJPEGReadBufferFill(sp)==0) + return(0); + assert(sp->in_buffer_togo>0); + } + n=mlen; + if (n>sp->in_buffer_togo) + n=sp->in_buffer_togo; + _TIFFmemcpy(mmem,sp->in_buffer_cur,n); + sp->in_buffer_cur+=n; + sp->in_buffer_togo-=n; + mlen-=n; + mmem+=n; + } while(mlen>0); + return(1); +} + +static void +OJPEGReadSkip(OJPEGState* sp, uint16 len) +{ + uint16 m; + uint16 n; + m=len; + n=m; + if (n>sp->in_buffer_togo) + n=sp->in_buffer_togo; + sp->in_buffer_cur+=n; + sp->in_buffer_togo-=n; + m-=n; + if (m>0) + { + assert(sp->in_buffer_togo==0); + n=m; + if ((uint64)n>sp->in_buffer_file_togo) + n=(uint16)sp->in_buffer_file_togo; + sp->in_buffer_file_pos+=n; + sp->in_buffer_file_togo-=n; + sp->in_buffer_file_pos_log=0; + /* we don't skip past jpeginterchangeformat/strile block... + * if that is asked from us, we're dealing with totally bazurk + * data anyway, and we've not seen this happening on any + * testfile, so we might as well likely cause some other + * meaningless error to be passed at some later time + */ + } +} + +static int +OJPEGWriteStream(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + *len=0; + do + { + assert(sp->out_state<=ososEoi); + switch(sp->out_state) + { + case ososSoi: + OJPEGWriteStreamSoi(tif,mem,len); + break; + case ososQTable0: + OJPEGWriteStreamQTable(tif,0,mem,len); + break; + case ososQTable1: + OJPEGWriteStreamQTable(tif,1,mem,len); + break; + case ososQTable2: + OJPEGWriteStreamQTable(tif,2,mem,len); + break; + case ososQTable3: + OJPEGWriteStreamQTable(tif,3,mem,len); + break; + case ososDcTable0: + OJPEGWriteStreamDcTable(tif,0,mem,len); + break; + case ososDcTable1: + OJPEGWriteStreamDcTable(tif,1,mem,len); + break; + case ososDcTable2: + OJPEGWriteStreamDcTable(tif,2,mem,len); + break; + case ososDcTable3: + OJPEGWriteStreamDcTable(tif,3,mem,len); + break; + case ososAcTable0: + OJPEGWriteStreamAcTable(tif,0,mem,len); + break; + case ososAcTable1: + OJPEGWriteStreamAcTable(tif,1,mem,len); + break; + case ososAcTable2: + OJPEGWriteStreamAcTable(tif,2,mem,len); + break; + case ososAcTable3: + OJPEGWriteStreamAcTable(tif,3,mem,len); + break; + case ososDri: + OJPEGWriteStreamDri(tif,mem,len); + break; + case ososSof: + OJPEGWriteStreamSof(tif,mem,len); + break; + case ososSos: + OJPEGWriteStreamSos(tif,mem,len); + break; + case ososCompressed: + if (OJPEGWriteStreamCompressed(tif,mem,len)==0) + return(0); + break; + case ososRst: + OJPEGWriteStreamRst(tif,mem,len); + break; + case ososEoi: + OJPEGWriteStreamEoi(tif,mem,len); + break; + } + } while (*len==0); + return(1); +} + +static void +OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(OJPEG_BUFFER>=2); + sp->out_buffer[0]=255; + sp->out_buffer[1]=JPEG_MARKER_SOI; + *len=2; + *mem=(void*)sp->out_buffer; + sp->out_state++; +} + +static void +OJPEGWriteStreamQTable(TIFF* tif, uint8 table_index, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + if (sp->qtable[table_index]!=0) + { + *mem=(void*)(sp->qtable[table_index]+sizeof(uint32)); + *len=*((uint32*)sp->qtable[table_index])-sizeof(uint32); + } + sp->out_state++; +} + +static void +OJPEGWriteStreamDcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + if (sp->dctable[table_index]!=0) + { + *mem=(void*)(sp->dctable[table_index]+sizeof(uint32)); + *len=*((uint32*)sp->dctable[table_index])-sizeof(uint32); + } + sp->out_state++; +} + +static void +OJPEGWriteStreamAcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + if (sp->actable[table_index]!=0) + { + *mem=(void*)(sp->actable[table_index]+sizeof(uint32)); + *len=*((uint32*)sp->actable[table_index])-sizeof(uint32); + } + sp->out_state++; +} + +static void +OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(OJPEG_BUFFER>=6); + if (sp->restart_interval!=0) + { + sp->out_buffer[0]=255; + sp->out_buffer[1]=JPEG_MARKER_DRI; + sp->out_buffer[2]=0; + sp->out_buffer[3]=4; + sp->out_buffer[4]=(sp->restart_interval>>8); + sp->out_buffer[5]=(sp->restart_interval&255); + *len=6; + *mem=(void*)sp->out_buffer; + } + sp->out_state++; +} + +static void +OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + assert(OJPEG_BUFFER>=2+8+sp->samples_per_pixel_per_plane*3); + assert(255>=8+sp->samples_per_pixel_per_plane*3); + sp->out_buffer[0]=255; + sp->out_buffer[1]=sp->sof_marker_id; + /* Lf */ + sp->out_buffer[2]=0; + sp->out_buffer[3]=8+sp->samples_per_pixel_per_plane*3; + /* P */ + sp->out_buffer[4]=8; + /* Y */ + sp->out_buffer[5]=(sp->sof_y>>8); + sp->out_buffer[6]=(sp->sof_y&255); + /* X */ + sp->out_buffer[7]=(sp->sof_x>>8); + sp->out_buffer[8]=(sp->sof_x&255); + /* Nf */ + sp->out_buffer[9]=sp->samples_per_pixel_per_plane; + for (m=0; msamples_per_pixel_per_plane; m++) + { + /* C */ + sp->out_buffer[10+m*3]=sp->sof_c[sp->plane_sample_offset+m]; + /* H and V */ + sp->out_buffer[10+m*3+1]=sp->sof_hv[sp->plane_sample_offset+m]; + /* Tq */ + sp->out_buffer[10+m*3+2]=sp->sof_tq[sp->plane_sample_offset+m]; + } + *len=10+sp->samples_per_pixel_per_plane*3; + *mem=(void*)sp->out_buffer; + sp->out_state++; +} + +static void +OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + uint8 m; + assert(OJPEG_BUFFER>=2+6+sp->samples_per_pixel_per_plane*2); + assert(255>=6+sp->samples_per_pixel_per_plane*2); + sp->out_buffer[0]=255; + sp->out_buffer[1]=JPEG_MARKER_SOS; + /* Ls */ + sp->out_buffer[2]=0; + sp->out_buffer[3]=6+sp->samples_per_pixel_per_plane*2; + /* Ns */ + sp->out_buffer[4]=sp->samples_per_pixel_per_plane; + for (m=0; msamples_per_pixel_per_plane; m++) + { + /* Cs */ + sp->out_buffer[5+m*2]=sp->sos_cs[sp->plane_sample_offset+m]; + /* Td and Ta */ + sp->out_buffer[5+m*2+1]=sp->sos_tda[sp->plane_sample_offset+m]; + } + /* Ss */ + sp->out_buffer[5+sp->samples_per_pixel_per_plane*2]=0; + /* Se */ + sp->out_buffer[5+sp->samples_per_pixel_per_plane*2+1]=63; + /* Ah and Al */ + sp->out_buffer[5+sp->samples_per_pixel_per_plane*2+2]=0; + *len=8+sp->samples_per_pixel_per_plane*2; + *mem=(void*)sp->out_buffer; + sp->out_state++; +} + +static int +OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + if (sp->in_buffer_togo==0) + { + if (OJPEGReadBufferFill(sp)==0) + return(0); + assert(sp->in_buffer_togo>0); + } + *len=sp->in_buffer_togo; + *mem=(void*)sp->in_buffer_cur; + sp->in_buffer_togo=0; + if (sp->in_buffer_file_togo==0) + { + switch(sp->in_buffer_source) + { + case osibsStrile: + if (sp->in_buffer_next_strilein_buffer_strile_count) + sp->out_state=ososRst; + else + sp->out_state=ososEoi; + break; + case osibsEof: + sp->out_state=ososEoi; + break; + default: + break; + } + } + return(1); +} + +static void +OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(OJPEG_BUFFER>=2); + sp->out_buffer[0]=255; + sp->out_buffer[1]=JPEG_MARKER_RST0+sp->restart_index; + sp->restart_index++; + if (sp->restart_index==8) + sp->restart_index=0; + *len=2; + *mem=(void*)sp->out_buffer; + sp->out_state=ososCompressed; +} + +static void +OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32* len) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + assert(OJPEG_BUFFER>=2); + sp->out_buffer[0]=255; + sp->out_buffer[1]=JPEG_MARKER_EOI; + *len=2; + *mem=(void*)sp->out_buffer; +} + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static int +jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo) +{ + return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_create_decompress(cinfo),1)); +} +#endif + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static int +jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image) +{ + return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_header(cinfo,require_image),1)); +} +#endif + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static int +jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo) +{ + return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_start_decompress(cinfo),1)); +} +#endif + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static int +jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines) +{ + return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_scanlines(cinfo,scanlines,max_lines),1)); +} +#endif + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static int +jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines) +{ + return(SETJMP(sp->exit_jmpbuf)?0:(jpeg_read_raw_data(cinfo,data,max_lines),1)); +} +#endif + +#ifndef LIBJPEG_ENCAP_EXTERNAL +static void +jpeg_encap_unwind(TIFF* tif) +{ + OJPEGState* sp=(OJPEGState*)tif->tif_data; + LONGJMP(sp->exit_jmpbuf,1); +} +#endif + +static void +OJPEGLibjpegJpegErrorMgrOutputMessage(jpeg_common_struct* cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo,buffer); + TIFFWarningExt(((TIFF*)(cinfo->client_data))->tif_clientdata,"LibJpeg","%s",buffer); +} + +static void +OJPEGLibjpegJpegErrorMgrErrorExit(jpeg_common_struct* cinfo) +{ + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo,buffer); + TIFFErrorExt(((TIFF*)(cinfo->client_data))->tif_clientdata,"LibJpeg","%s",buffer); + jpeg_encap_unwind((TIFF*)(cinfo->client_data)); +} + +static void +OJPEGLibjpegJpegSourceMgrInitSource(jpeg_decompress_struct* cinfo) +{ + (void)cinfo; +} + +static boolean +OJPEGLibjpegJpegSourceMgrFillInputBuffer(jpeg_decompress_struct* cinfo) +{ + TIFF* tif=(TIFF*)cinfo->client_data; + OJPEGState* sp=(OJPEGState*)tif->tif_data; + void* mem=0; + uint32 len=0U; + if (OJPEGWriteStream(tif,&mem,&len)==0) + { + TIFFErrorExt(tif->tif_clientdata,"LibJpeg","Premature end of JPEG data"); + jpeg_encap_unwind(tif); + } + sp->libjpeg_jpeg_source_mgr.bytes_in_buffer=len; + sp->libjpeg_jpeg_source_mgr.next_input_byte=mem; + return(1); +} + +static void +OJPEGLibjpegJpegSourceMgrSkipInputData(jpeg_decompress_struct* cinfo, long num_bytes) +{ + TIFF* tif=(TIFF*)cinfo->client_data; + (void)num_bytes; + TIFFErrorExt(tif->tif_clientdata,"LibJpeg","Unexpected error"); + jpeg_encap_unwind(tif); +} + +static boolean +OJPEGLibjpegJpegSourceMgrResyncToRestart(jpeg_decompress_struct* cinfo, int desired) +{ + TIFF* tif=(TIFF*)cinfo->client_data; + (void)desired; + TIFFErrorExt(tif->tif_clientdata,"LibJpeg","Unexpected error"); + jpeg_encap_unwind(tif); + return(0); +} + +static void +OJPEGLibjpegJpegSourceMgrTermSource(jpeg_decompress_struct* cinfo) +{ + (void)cinfo; +} + +#endif + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_open.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_open.c new file mode 100644 index 0000000..8c88328 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_open.c @@ -0,0 +1,725 @@ +/* $Id: tif_open.c,v 1.46 2010-12-06 16:54:54 faxguy Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + */ +#include "tiffiop.h" + +/* + * Dummy functions to fill the omitted client procedures. + */ +static int +_tiffDummyMapProc(thandle_t fd, void** pbase, toff_t* psize) +{ + (void) fd; (void) pbase; (void) psize; + return (0); +} + +static void +_tiffDummyUnmapProc(thandle_t fd, void* base, toff_t size) +{ + (void) fd; (void) base; (void) size; +} + +int +_TIFFgetMode(const char* mode, const char* module) +{ + int m = -1; + + switch (mode[0]) { + case 'r': + m = O_RDONLY; + if (mode[1] == '+') + m = O_RDWR; + break; + case 'w': + case 'a': + m = O_RDWR|O_CREAT; + if (mode[0] == 'w') + m |= O_TRUNC; + break; + default: + TIFFErrorExt(0, module, "\"%s\": Bad mode", mode); + break; + } + return (m); +} + +TIFF* +TIFFClientOpen( + const char* name, const char* mode, + thandle_t clientdata, + TIFFReadWriteProc readproc, + TIFFReadWriteProc writeproc, + TIFFSeekProc seekproc, + TIFFCloseProc closeproc, + TIFFSizeProc sizeproc, + TIFFMapFileProc mapproc, + TIFFUnmapFileProc unmapproc +) +{ + static const char module[] = "TIFFClientOpen"; + TIFF *tif; + int m; + const char* cp; + + /* The following are configuration checks. They should be redundant, but should not + * compile to any actual code in an optimised release build anyway. If any of them + * fail, (makefile-based or other) configuration is not correct */ + assert(sizeof(uint8)==1); + assert(sizeof(int8)==1); + assert(sizeof(uint16)==2); + assert(sizeof(int16)==2); + assert(sizeof(uint32)==4); + assert(sizeof(int32)==4); + assert(sizeof(uint64)==8); + assert(sizeof(int64)==8); + assert(sizeof(tmsize_t)==sizeof(void*)); + { + union{ + uint8 a8[2]; + uint16 a16; + } n; + n.a8[0]=1; + n.a8[1]=0; + #ifdef WORDS_BIGENDIAN + assert(n.a16==256); + #else + assert(n.a16==1); + #endif + } + + m = _TIFFgetMode(mode, module); + if (m == -1) + goto bad2; + tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof (TIFF) + strlen(name) + 1)); + if (tif == NULL) { + TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name); + goto bad2; + } + _TIFFmemset(tif, 0, sizeof (*tif)); + tif->tif_name = (char *)tif + sizeof (TIFF); + strcpy(tif->tif_name, name); + tif->tif_mode = m &~ (O_CREAT|O_TRUNC); + tif->tif_curdir = (uint16) -1; /* non-existent directory */ + tif->tif_curoff = 0; + tif->tif_curstrip = (uint32) -1; /* invalid strip */ + tif->tif_row = (uint32) -1; /* read/write pre-increment */ + tif->tif_clientdata = clientdata; + if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) { + TIFFErrorExt(clientdata, module, + "One of the client procedures is NULL pointer."); + goto bad2; + } + tif->tif_readproc = readproc; + tif->tif_writeproc = writeproc; + tif->tif_seekproc = seekproc; + tif->tif_closeproc = closeproc; + tif->tif_sizeproc = sizeproc; + if (mapproc) + tif->tif_mapproc = mapproc; + else + tif->tif_mapproc = _tiffDummyMapProc; + if (unmapproc) + tif->tif_unmapproc = unmapproc; + else + tif->tif_unmapproc = _tiffDummyUnmapProc; + _TIFFSetDefaultCompressionState(tif); /* setup default state */ + /* + * Default is to return data MSB2LSB and enable the + * use of memory-mapped files and strip chopping when + * a file is opened read-only. + */ + tif->tif_flags = FILLORDER_MSB2LSB; + if (m == O_RDONLY ) + tif->tif_flags |= TIFF_MAPPED; + + #ifdef STRIPCHOP_DEFAULT + if (m == O_RDONLY || m == O_RDWR) + tif->tif_flags |= STRIPCHOP_DEFAULT; + #endif + + /* + * Process library-specific flags in the open mode string. + * The following flags may be used to control intrinsic library + * behaviour that may or may not be desirable (usually for + * compatibility with some application that claims to support + * TIFF but only supports some braindead idea of what the + * vendor thinks TIFF is): + * + * 'l' use little-endian byte order for creating a file + * 'b' use big-endian byte order for creating a file + * 'L' read/write information using LSB2MSB bit order + * 'B' read/write information using MSB2LSB bit order + * 'H' read/write information using host bit order + * 'M' enable use of memory-mapped files when supported + * 'm' disable use of memory-mapped files + * 'C' enable strip chopping support when reading + * 'c' disable strip chopping support + * 'h' read TIFF header only, do not load the first IFD + * '4' ClassicTIFF for creating a file (default) + * '8' BigTIFF for creating a file + * + * The use of the 'l' and 'b' flags is strongly discouraged. + * These flags are provided solely because numerous vendors, + * typically on the PC, do not correctly support TIFF; they + * only support the Intel little-endian byte order. This + * support is not configured by default because it supports + * the violation of the TIFF spec that says that readers *MUST* + * support both byte orders. It is strongly recommended that + * you not use this feature except to deal with busted apps + * that write invalid TIFF. And even in those cases you should + * bang on the vendors to fix their software. + * + * The 'L', 'B', and 'H' flags are intended for applications + * that can optimize operations on data by using a particular + * bit order. By default the library returns data in MSB2LSB + * bit order for compatibiltiy with older versions of this + * library. Returning data in the bit order of the native cpu + * makes the most sense but also requires applications to check + * the value of the FillOrder tag; something they probably do + * not do right now. + * + * The 'M' and 'm' flags are provided because some virtual memory + * systems exhibit poor behaviour when large images are mapped. + * These options permit clients to control the use of memory-mapped + * files on a per-file basis. + * + * The 'C' and 'c' flags are provided because the library support + * for chopping up large strips into multiple smaller strips is not + * application-transparent and as such can cause problems. The 'c' + * option permits applications that only want to look at the tags, + * for example, to get the unadulterated TIFF tag information. + */ + for (cp = mode; *cp; cp++) + switch (*cp) { + case 'b': + #ifndef WORDS_BIGENDIAN + if (m&O_CREAT) + tif->tif_flags |= TIFF_SWAB; + #endif + break; + case 'l': + #ifdef WORDS_BIGENDIAN + if ((m&O_CREAT)) + tif->tif_flags |= TIFF_SWAB; + #endif + break; + case 'B': + tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | + FILLORDER_MSB2LSB; + break; + case 'L': + tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | + FILLORDER_LSB2MSB; + break; + case 'H': + tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | + HOST_FILLORDER; + break; + case 'M': + if (m == O_RDONLY) + tif->tif_flags |= TIFF_MAPPED; + break; + case 'm': + if (m == O_RDONLY) + tif->tif_flags &= ~TIFF_MAPPED; + break; + case 'C': + if (m == O_RDONLY) + tif->tif_flags |= TIFF_STRIPCHOP; + break; + case 'c': + if (m == O_RDONLY) + tif->tif_flags &= ~TIFF_STRIPCHOP; + break; + case 'h': + tif->tif_flags |= TIFF_HEADERONLY; + break; + case '8': + if (m&O_CREAT) + tif->tif_flags |= TIFF_BIGTIFF; + break; + } + /* + * Read in TIFF header. + */ + if ((m & O_TRUNC) || + !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) { + if (tif->tif_mode == O_RDONLY) { + TIFFErrorExt(tif->tif_clientdata, name, + "Cannot read TIFF header"); + goto bad; + } + /* + * Setup header and write. + */ + #ifdef WORDS_BIGENDIAN + tif->tif_header.common.tiff_magic = tif->tif_flags & TIFF_SWAB + ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN; + #else + tif->tif_header.common.tiff_magic = tif->tif_flags & TIFF_SWAB + ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN; + #endif + if (!(tif->tif_flags&TIFF_BIGTIFF)) + { + tif->tif_header.common.tiff_version = TIFF_VERSION_CLASSIC; + tif->tif_header.classic.tiff_diroff = 0; + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&tif->tif_header.common.tiff_version); + tif->tif_header_size = sizeof(TIFFHeaderClassic); + } + else + { + tif->tif_header.common.tiff_version = TIFF_VERSION_BIG; + tif->tif_header.big.tiff_offsetsize = 8; + tif->tif_header.big.tiff_unused = 0; + tif->tif_header.big.tiff_diroff = 0; + if (tif->tif_flags & TIFF_SWAB) + { + TIFFSwabShort(&tif->tif_header.common.tiff_version); + TIFFSwabShort(&tif->tif_header.big.tiff_offsetsize); + } + tif->tif_header_size = sizeof (TIFFHeaderBig); + } + /* + * The doc for "fopen" for some STD_C_LIBs says that if you + * open a file for modify ("+"), then you must fseek (or + * fflush?) between any freads and fwrites. This is not + * necessary on most systems, but has been shown to be needed + * on Solaris. + */ + TIFFSeekFile( tif, 0, SEEK_SET ); + if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size))) { + TIFFErrorExt(tif->tif_clientdata, name, + "Error writing TIFF header"); + goto bad; + } + /* + * Setup the byte order handling. + */ + if (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN) { + #ifndef WORDS_BIGENDIAN + tif->tif_flags |= TIFF_SWAB; + #endif + } else { + #ifdef WORDS_BIGENDIAN + tif->tif_flags |= TIFF_SWAB; + #endif + } + /* + * Setup default directory. + */ + if (!TIFFDefaultDirectory(tif)) + goto bad; + tif->tif_diroff = 0; + tif->tif_dirlist = NULL; + tif->tif_dirlistsize = 0; + tif->tif_dirnumber = 0; + return (tif); + } + /* + * Setup the byte order handling. + */ + if (tif->tif_header.common.tiff_magic != TIFF_BIGENDIAN && + tif->tif_header.common.tiff_magic != TIFF_LITTLEENDIAN + #if MDI_SUPPORT + && + #if HOST_BIGENDIAN + tif->tif_header.common.tiff_magic != MDI_BIGENDIAN + #else + tif->tif_header.common.tiff_magic != MDI_LITTLEENDIAN + #endif + ) { + TIFFErrorExt(tif->tif_clientdata, name, + "Not a TIFF or MDI file, bad magic number %d (0x%x)", + #else + ) { + TIFFErrorExt(tif->tif_clientdata, name, + "Not a TIFF file, bad magic number %d (0x%x)", + #endif + tif->tif_header.common.tiff_magic, + tif->tif_header.common.tiff_magic); + goto bad; + } + if (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN) { + #ifndef WORDS_BIGENDIAN + tif->tif_flags |= TIFF_SWAB; + #endif + } else { + #ifdef WORDS_BIGENDIAN + tif->tif_flags |= TIFF_SWAB; + #endif + } + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabShort(&tif->tif_header.common.tiff_version); + if ((tif->tif_header.common.tiff_version != TIFF_VERSION_CLASSIC)&& + (tif->tif_header.common.tiff_version != TIFF_VERSION_BIG)) { + TIFFErrorExt(tif->tif_clientdata, name, + "Not a TIFF file, bad version number %d (0x%x)", + tif->tif_header.common.tiff_version, + tif->tif_header.common.tiff_version); + goto bad; + } + if (tif->tif_header.common.tiff_version == TIFF_VERSION_CLASSIC) + { + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabLong(&tif->tif_header.classic.tiff_diroff); + tif->tif_header_size = sizeof(TIFFHeaderClassic); + } + else + { + if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic)))) + { + TIFFErrorExt(tif->tif_clientdata, name, + "Cannot read TIFF header"); + goto bad; + } + if (tif->tif_flags & TIFF_SWAB) + { + TIFFSwabShort(&tif->tif_header.big.tiff_offsetsize); + TIFFSwabLong8(&tif->tif_header.big.tiff_diroff); + } + if (tif->tif_header.big.tiff_offsetsize != 8) + { + TIFFErrorExt(tif->tif_clientdata, name, + "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)", + tif->tif_header.big.tiff_offsetsize, + tif->tif_header.big.tiff_offsetsize); + goto bad; + } + if (tif->tif_header.big.tiff_unused != 0) + { + TIFFErrorExt(tif->tif_clientdata, name, + "Not a TIFF file, bad BigTIFF unused %d (0x%x)", + tif->tif_header.big.tiff_unused, + tif->tif_header.big.tiff_unused); + goto bad; + } + tif->tif_header_size = sizeof(TIFFHeaderBig); + tif->tif_flags |= TIFF_BIGTIFF; + } + tif->tif_flags |= TIFF_MYBUFFER; + tif->tif_rawcp = tif->tif_rawdata = 0; + tif->tif_rawdatasize = 0; + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = 0; + + switch (mode[0]) { + case 'r': + if (!(tif->tif_flags&TIFF_BIGTIFF)) + tif->tif_nextdiroff = tif->tif_header.classic.tiff_diroff; + else + tif->tif_nextdiroff = tif->tif_header.big.tiff_diroff; + /* + * Try to use a memory-mapped file if the client + * has not explicitly suppressed usage with the + * 'm' flag in the open mode (see above). + */ + if (tif->tif_flags & TIFF_MAPPED) + { + toff_t n; + if (TIFFMapFileContents(tif,(void**)(&tif->tif_base),&n)) + { + tif->tif_size=(tmsize_t)n; + assert((toff_t)tif->tif_size==n); + } + else + tif->tif_flags &= ~TIFF_MAPPED; + } + /* + * Sometimes we do not want to read the first directory (for example, + * it may be broken) and want to proceed to other directories. I this + * case we use the TIFF_HEADERONLY flag to open file and return + * immediately after reading TIFF header. + */ + if (tif->tif_flags & TIFF_HEADERONLY) + return (tif); + + /* + * Setup initial directory. + */ + if (TIFFReadDirectory(tif)) { + tif->tif_rawcc = (tmsize_t)-1; + tif->tif_flags |= TIFF_BUFFERSETUP; + return (tif); + } + break; + case 'a': + /* + * New directories are automatically append + * to the end of the directory chain when they + * are written out (see TIFFWriteDirectory). + */ + if (!TIFFDefaultDirectory(tif)) + goto bad; + return (tif); + } +bad: + tif->tif_mode = O_RDONLY; /* XXX avoid flush */ + TIFFCleanup(tif); +bad2: + return ((TIFF*)0); +} + +/* + * Query functions to access private data. + */ + +/* + * Return open file's name. + */ +const char * +TIFFFileName(TIFF* tif) +{ + return (tif->tif_name); +} + +/* + * Set the file name. + */ +const char * +TIFFSetFileName(TIFF* tif, const char *name) +{ + const char* old_name = tif->tif_name; + tif->tif_name = (char *)name; + return (old_name); +} + +/* + * Return open file's I/O descriptor. + */ +int +TIFFFileno(TIFF* tif) +{ + return (tif->tif_fd); +} + +/* + * Set open file's I/O descriptor, and return previous value. + */ +int +TIFFSetFileno(TIFF* tif, int fd) +{ + int old_fd = tif->tif_fd; + tif->tif_fd = fd; + return old_fd; +} + +/* + * Return open file's clientdata. + */ +thandle_t +TIFFClientdata(TIFF* tif) +{ + return (tif->tif_clientdata); +} + +/* + * Set open file's clientdata, and return previous value. + */ +thandle_t +TIFFSetClientdata(TIFF* tif, thandle_t newvalue) +{ + thandle_t m = tif->tif_clientdata; + tif->tif_clientdata = newvalue; + return m; +} + +/* + * Return read/write mode. + */ +int +TIFFGetMode(TIFF* tif) +{ + return (tif->tif_mode); +} + +/* + * Return read/write mode. + */ +int +TIFFSetMode(TIFF* tif, int mode) +{ + int old_mode = tif->tif_mode; + tif->tif_mode = mode; + return (old_mode); +} + +/* + * Return nonzero if file is organized in + * tiles; zero if organized as strips. + */ +int +TIFFIsTiled(TIFF* tif) +{ + return (isTiled(tif)); +} + +/* + * Return current row being read/written. + */ +uint32 +TIFFCurrentRow(TIFF* tif) +{ + return (tif->tif_row); +} + +/* + * Return index of the current directory. + */ +uint16 +TIFFCurrentDirectory(TIFF* tif) +{ + return (tif->tif_curdir); +} + +/* + * Return current strip. + */ +uint32 +TIFFCurrentStrip(TIFF* tif) +{ + return (tif->tif_curstrip); +} + +/* + * Return current tile. + */ +uint32 +TIFFCurrentTile(TIFF* tif) +{ + return (tif->tif_curtile); +} + +/* + * Return nonzero if the file has byte-swapped data. + */ +int +TIFFIsByteSwapped(TIFF* tif) +{ + return ((tif->tif_flags & TIFF_SWAB) != 0); +} + +/* + * Return nonzero if the data is returned up-sampled. + */ +int +TIFFIsUpSampled(TIFF* tif) +{ + return (isUpSampled(tif)); +} + +/* + * Return nonzero if the data is returned in MSB-to-LSB bit order. + */ +int +TIFFIsMSB2LSB(TIFF* tif) +{ + return (isFillOrder(tif, FILLORDER_MSB2LSB)); +} + +/* + * Return nonzero if given file was written in big-endian order. + */ +int +TIFFIsBigEndian(TIFF* tif) +{ + return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN); +} + +/* + * Return pointer to file read method. + */ +TIFFReadWriteProc +TIFFGetReadProc(TIFF* tif) +{ + return (tif->tif_readproc); +} + +/* + * Return pointer to file write method. + */ +TIFFReadWriteProc +TIFFGetWriteProc(TIFF* tif) +{ + return (tif->tif_writeproc); +} + +/* + * Return pointer to file seek method. + */ +TIFFSeekProc +TIFFGetSeekProc(TIFF* tif) +{ + return (tif->tif_seekproc); +} + +/* + * Return pointer to file close method. + */ +TIFFCloseProc +TIFFGetCloseProc(TIFF* tif) +{ + return (tif->tif_closeproc); +} + +/* + * Return pointer to file size requesting method. + */ +TIFFSizeProc +TIFFGetSizeProc(TIFF* tif) +{ + return (tif->tif_sizeproc); +} + +/* + * Return pointer to memory mapping method. + */ +TIFFMapFileProc +TIFFGetMapFileProc(TIFF* tif) +{ + return (tif->tif_mapproc); +} + +/* + * Return pointer to memory unmapping method. + */ +TIFFUnmapFileProc +TIFFGetUnmapFileProc(TIFF* tif) +{ + return (tif->tif_unmapproc); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_packbits.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_packbits.c new file mode 100644 index 0000000..9e77190 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_packbits.c @@ -0,0 +1,300 @@ +/* $Id: tif_packbits.c,v 1.22 2012-06-20 05:25:33 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef PACKBITS_SUPPORT +/* + * TIFF Library. + * + * PackBits Compression Algorithm Support + */ +#include + +static int +PackBitsPreEncode(TIFF* tif, uint16 s) +{ + (void) s; + + if (!(tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t)))) + return (0); + /* + * Calculate the scanline/tile-width size in bytes. + */ + if (isTiled(tif)) + *(tmsize_t*)tif->tif_data = TIFFTileRowSize(tif); + else + *(tmsize_t*)tif->tif_data = TIFFScanlineSize(tif); + return (1); +} + +static int +PackBitsPostEncode(TIFF* tif) +{ + if (tif->tif_data) + _TIFFfree(tif->tif_data); + return (1); +} + +/* + * Encode a run of pixels. + */ +static int +PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) +{ + unsigned char* bp = (unsigned char*) buf; + uint8* op; + uint8* ep; + uint8* lastliteral; + long n, slop; + int b; + enum { BASE, LITERAL, RUN, LITERAL_RUN } state; + + (void) s; + op = tif->tif_rawcp; + ep = tif->tif_rawdata + tif->tif_rawdatasize; + state = BASE; + lastliteral = 0; + while (cc > 0) { + /* + * Find the longest string of identical bytes. + */ + b = *bp++, cc--, n = 1; + for (; cc > 0 && b == *bp; cc--, bp++) + n++; + again: + if (op + 2 >= ep) { /* insure space for new data */ + /* + * Be careful about writing the last + * literal. Must write up to that point + * and then copy the remainder to the + * front of the buffer. + */ + if (state == LITERAL || state == LITERAL_RUN) { + slop = (long)(op - lastliteral); + tif->tif_rawcc += (tmsize_t)(lastliteral - tif->tif_rawcp); + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + while (slop-- > 0) + *op++ = *lastliteral++; + lastliteral = tif->tif_rawcp; + } else { + tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); + if (!TIFFFlushData1(tif)) + return (-1); + op = tif->tif_rawcp; + } + } + switch (state) { + case BASE: /* initial state, set run/literal */ + if (n > 1) { + state = RUN; + if (n > 128) { + *op++ = (uint8) -127; + *op++ = (uint8) b; + n -= 128; + goto again; + } + *op++ = (uint8)(-(n-1)); + *op++ = (uint8) b; + } else { + lastliteral = op; + *op++ = 0; + *op++ = (uint8) b; + state = LITERAL; + } + break; + case LITERAL: /* last object was literal string */ + if (n > 1) { + state = LITERAL_RUN; + if (n > 128) { + *op++ = (uint8) -127; + *op++ = (uint8) b; + n -= 128; + goto again; + } + *op++ = (uint8)(-(n-1)); /* encode run */ + *op++ = (uint8) b; + } else { /* extend literal */ + if (++(*lastliteral) == 127) + state = BASE; + *op++ = (uint8) b; + } + break; + case RUN: /* last object was run */ + if (n > 1) { + if (n > 128) { + *op++ = (uint8) -127; + *op++ = (uint8) b; + n -= 128; + goto again; + } + *op++ = (uint8)(-(n-1)); + *op++ = (uint8) b; + } else { + lastliteral = op; + *op++ = 0; + *op++ = (uint8) b; + state = LITERAL; + } + break; + case LITERAL_RUN: /* literal followed by a run */ + /* + * Check to see if previous run should + * be converted to a literal, in which + * case we convert literal-run-literal + * to a single literal. + */ + if (n == 1 && op[-2] == (uint8) -1 && + *lastliteral < 126) { + state = (((*lastliteral) += 2) == 127 ? + BASE : LITERAL); + op[-2] = op[-1]; /* replicate */ + } else + state = RUN; + goto again; + } + } + tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); + tif->tif_rawcp = op; + return (1); +} + +/* + * Encode a rectangular chunk of pixels. We break it up + * into row-sized pieces to insure that encoded runs do + * not span rows. Otherwise, there can be problems with + * the decoder if data is read, for example, by scanlines + * when it was encoded by strips. + */ +static int +PackBitsEncodeChunk(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + tmsize_t rowsize = *(tmsize_t*)tif->tif_data; + + while (cc > 0) { + tmsize_t chunk = rowsize; + + if( cc < chunk ) + chunk = cc; + + if (PackBitsEncode(tif, bp, chunk, s) < 0) + return (-1); + bp += chunk; + cc -= chunk; + } + return (1); +} + +static int +PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "PackBitsDecode"; + char *bp; + tmsize_t cc; + long n; + int b; + + (void) s; + bp = (char*) tif->tif_rawcp; + cc = tif->tif_rawcc; + while (cc > 0 && occ > 0) { + n = (long) *bp++, cc--; + /* + * Watch out for compilers that + * don't sign extend chars... + */ + if (n >= 128) + n -= 256; + if (n < 0) { /* replicate next byte -n+1 times */ + if (n == -128) /* nop */ + continue; + n = -n + 1; + if( occ < (tmsize_t)n ) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Discarding %lu bytes to avoid buffer overrun", + (unsigned long) ((tmsize_t)n - occ)); + n = (long)occ; + } + occ -= n; + b = *bp++, cc--; + while (n-- > 0) + *op++ = (uint8) b; + } else { /* copy next n+1 bytes literally */ + if (occ < (tmsize_t)(n + 1)) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Discarding %lu bytes to avoid buffer overrun", + (unsigned long) ((tmsize_t)n - occ + 1)); + n = (long)occ - 1; + } + if (cc < (tmsize_t) (n+1)) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Terminating PackBitsDecode due to lack of data."); + break; + } + _TIFFmemcpy(op, bp, ++n); + op += n; occ -= n; + bp += n; cc -= n; + } + } + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + if (occ > 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data for scanline %lu", + (unsigned long) tif->tif_row); + return (0); + } + return (1); +} + +int +TIFFInitPackBits(TIFF* tif, int scheme) +{ + (void) scheme; + tif->tif_decoderow = PackBitsDecode; + tif->tif_decodestrip = PackBitsDecode; + tif->tif_decodetile = PackBitsDecode; + tif->tif_preencode = PackBitsPreEncode; + tif->tif_postencode = PackBitsPostEncode; + tif->tif_encoderow = PackBitsEncode; + tif->tif_encodestrip = PackBitsEncodeChunk; + tif->tif_encodetile = PackBitsEncodeChunk; + return (1); +} +#endif /* PACKBITS_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_pixarlog.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_pixarlog.c new file mode 100644 index 0000000..e583117 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_pixarlog.c @@ -0,0 +1,1426 @@ +/* $Id: tif_pixarlog.c,v 1.38 2012-06-21 01:01:53 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1996-1997 Sam Leffler + * Copyright (c) 1996 Pixar + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Pixar, Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef PIXARLOG_SUPPORT + +/* + * TIFF Library. + * PixarLog Compression Support + * + * Contributed by Dan McCoy. + * + * PixarLog film support uses the TIFF library to store companded + * 11 bit values into a tiff file, which are compressed using the + * zip compressor. + * + * The codec can take as input and produce as output 32-bit IEEE float values + * as well as 16-bit or 8-bit unsigned integer values. + * + * On writing any of the above are converted into the internal + * 11-bit log format. In the case of 8 and 16 bit values, the + * input is assumed to be unsigned linear color values that represent + * the range 0-1. In the case of IEEE values, the 0-1 range is assumed to + * be the normal linear color range, in addition over 1 values are + * accepted up to a value of about 25.0 to encode "hot" hightlights and such. + * The encoding is lossless for 8-bit values, slightly lossy for the + * other bit depths. The actual color precision should be better + * than the human eye can perceive with extra room to allow for + * error introduced by further image computation. As with any quantized + * color format, it is possible to perform image calculations which + * expose the quantization error. This format should certainly be less + * susceptable to such errors than standard 8-bit encodings, but more + * susceptable than straight 16-bit or 32-bit encodings. + * + * On reading the internal format is converted to the desired output format. + * The program can request which format it desires by setting the internal + * pseudo tag TIFFTAG_PIXARLOGDATAFMT to one of these possible values: + * PIXARLOGDATAFMT_FLOAT = provide IEEE float values. + * PIXARLOGDATAFMT_16BIT = provide unsigned 16-bit integer values + * PIXARLOGDATAFMT_8BIT = provide unsigned 8-bit integer values + * + * alternately PIXARLOGDATAFMT_8BITABGR provides unsigned 8-bit integer + * values with the difference that if there are exactly three or four channels + * (rgb or rgba) it swaps the channel order (bgr or abgr). + * + * PIXARLOGDATAFMT_11BITLOG provides the internal encoding directly + * packed in 16-bit values. However no tools are supplied for interpreting + * these values. + * + * "hot" (over 1.0) areas written in floating point get clamped to + * 1.0 in the integer data types. + * + * When the file is closed after writing, the bit depth and sample format + * are set always to appear as if 8-bit data has been written into it. + * That way a naive program unaware of the particulars of the encoding + * gets the format it is most likely able to handle. + * + * The codec does it's own horizontal differencing step on the coded + * values so the libraries predictor stuff should be turned off. + * The codec also handle byte swapping the encoded values as necessary + * since the library does not have the information necessary + * to know the bit depth of the raw unencoded buffer. + * + * NOTE: This decoder does not appear to update tif_rawcp, and tif_rawcc. + * This can cause problems with the implementation of CHUNKY_STRIP_READ_SUPPORT + * as noted in http://trac.osgeo.org/gdal/ticket/3894. FrankW - Jan'11 + */ + +#include "tif_predict.h" +#include "zlib.h" + +#include +#include +#include + +/* Tables for converting to/from 11 bit coded values */ + +#define TSIZE 2048 /* decode table size (11-bit tokens) */ +#define TSIZEP1 2049 /* Plus one for slop */ +#define ONE 1250 /* token value of 1.0 exactly */ +#define RATIO 1.004 /* nominal ratio for log part */ + +#define CODE_MASK 0x7ff /* 11 bits. */ + +static float Fltsize; +static float LogK1, LogK2; + +#define REPEAT(n, op) { int i; i=n; do { i--; op; } while (i>0); } + +static void +horizontalAccumulateF(uint16 *wp, int n, int stride, float *op, + float *ToLinearF) +{ + register unsigned int cr, cg, cb, ca, mask; + register float t0, t1, t2, t3; + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + t0 = ToLinearF[cr = (wp[0] & mask)]; + t1 = ToLinearF[cg = (wp[1] & mask)]; + t2 = ToLinearF[cb = (wp[2] & mask)]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + n -= 3; + while (n > 0) { + wp += 3; + op += 3; + n -= 3; + t0 = ToLinearF[(cr += wp[0]) & mask]; + t1 = ToLinearF[(cg += wp[1]) & mask]; + t2 = ToLinearF[(cb += wp[2]) & mask]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + } + } else if (stride == 4) { + t0 = ToLinearF[cr = (wp[0] & mask)]; + t1 = ToLinearF[cg = (wp[1] & mask)]; + t2 = ToLinearF[cb = (wp[2] & mask)]; + t3 = ToLinearF[ca = (wp[3] & mask)]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + op[3] = t3; + n -= 4; + while (n > 0) { + wp += 4; + op += 4; + n -= 4; + t0 = ToLinearF[(cr += wp[0]) & mask]; + t1 = ToLinearF[(cg += wp[1]) & mask]; + t2 = ToLinearF[(cb += wp[2]) & mask]; + t3 = ToLinearF[(ca += wp[3]) & mask]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + op[3] = t3; + } + } else { + REPEAT(stride, *op = ToLinearF[*wp&mask]; wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; *op = ToLinearF[*wp&mask]; wp++; op++) + n -= stride; + } + } + } +} + +static void +horizontalAccumulate12(uint16 *wp, int n, int stride, int16 *op, + float *ToLinearF) +{ + register unsigned int cr, cg, cb, ca, mask; + register float t0, t1, t2, t3; + +#define SCALE12 2048.0F +#define CLAMP12(t) (((t) < 3071) ? (uint16) (t) : 3071) + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + t0 = ToLinearF[cr = (wp[0] & mask)] * SCALE12; + t1 = ToLinearF[cg = (wp[1] & mask)] * SCALE12; + t2 = ToLinearF[cb = (wp[2] & mask)] * SCALE12; + op[0] = CLAMP12(t0); + op[1] = CLAMP12(t1); + op[2] = CLAMP12(t2); + n -= 3; + while (n > 0) { + wp += 3; + op += 3; + n -= 3; + t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12; + t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12; + t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12; + op[0] = CLAMP12(t0); + op[1] = CLAMP12(t1); + op[2] = CLAMP12(t2); + } + } else if (stride == 4) { + t0 = ToLinearF[cr = (wp[0] & mask)] * SCALE12; + t1 = ToLinearF[cg = (wp[1] & mask)] * SCALE12; + t2 = ToLinearF[cb = (wp[2] & mask)] * SCALE12; + t3 = ToLinearF[ca = (wp[3] & mask)] * SCALE12; + op[0] = CLAMP12(t0); + op[1] = CLAMP12(t1); + op[2] = CLAMP12(t2); + op[3] = CLAMP12(t3); + n -= 4; + while (n > 0) { + wp += 4; + op += 4; + n -= 4; + t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12; + t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12; + t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12; + t3 = ToLinearF[(ca += wp[3]) & mask] * SCALE12; + op[0] = CLAMP12(t0); + op[1] = CLAMP12(t1); + op[2] = CLAMP12(t2); + op[3] = CLAMP12(t3); + } + } else { + REPEAT(stride, t0 = ToLinearF[*wp&mask] * SCALE12; + *op = CLAMP12(t0); wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; t0 = ToLinearF[wp[stride]&mask]*SCALE12; + *op = CLAMP12(t0); wp++; op++) + n -= stride; + } + } + } +} + +static void +horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op, + uint16 *ToLinear16) +{ + register unsigned int cr, cg, cb, ca, mask; + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + op[0] = ToLinear16[cr = (wp[0] & mask)]; + op[1] = ToLinear16[cg = (wp[1] & mask)]; + op[2] = ToLinear16[cb = (wp[2] & mask)]; + n -= 3; + while (n > 0) { + wp += 3; + op += 3; + n -= 3; + op[0] = ToLinear16[(cr += wp[0]) & mask]; + op[1] = ToLinear16[(cg += wp[1]) & mask]; + op[2] = ToLinear16[(cb += wp[2]) & mask]; + } + } else if (stride == 4) { + op[0] = ToLinear16[cr = (wp[0] & mask)]; + op[1] = ToLinear16[cg = (wp[1] & mask)]; + op[2] = ToLinear16[cb = (wp[2] & mask)]; + op[3] = ToLinear16[ca = (wp[3] & mask)]; + n -= 4; + while (n > 0) { + wp += 4; + op += 4; + n -= 4; + op[0] = ToLinear16[(cr += wp[0]) & mask]; + op[1] = ToLinear16[(cg += wp[1]) & mask]; + op[2] = ToLinear16[(cb += wp[2]) & mask]; + op[3] = ToLinear16[(ca += wp[3]) & mask]; + } + } else { + REPEAT(stride, *op = ToLinear16[*wp&mask]; wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; *op = ToLinear16[*wp&mask]; wp++; op++) + n -= stride; + } + } + } +} + +/* + * Returns the log encoded 11-bit values with the horizontal + * differencing undone. + */ +static void +horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op) +{ + register unsigned int cr, cg, cb, ca, mask; + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + op[0] = cr = wp[0]; op[1] = cg = wp[1]; op[2] = cb = wp[2]; + n -= 3; + while (n > 0) { + wp += 3; + op += 3; + n -= 3; + op[0] = (cr += wp[0]) & mask; + op[1] = (cg += wp[1]) & mask; + op[2] = (cb += wp[2]) & mask; + } + } else if (stride == 4) { + op[0] = cr = wp[0]; op[1] = cg = wp[1]; + op[2] = cb = wp[2]; op[3] = ca = wp[3]; + n -= 4; + while (n > 0) { + wp += 4; + op += 4; + n -= 4; + op[0] = (cr += wp[0]) & mask; + op[1] = (cg += wp[1]) & mask; + op[2] = (cb += wp[2]) & mask; + op[3] = (ca += wp[3]) & mask; + } + } else { + REPEAT(stride, *op = *wp&mask; wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; *op = *wp&mask; wp++; op++) + n -= stride; + } + } + } +} + +static void +horizontalAccumulate8(uint16 *wp, int n, int stride, unsigned char *op, + unsigned char *ToLinear8) +{ + register unsigned int cr, cg, cb, ca, mask; + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + op[0] = ToLinear8[cr = (wp[0] & mask)]; + op[1] = ToLinear8[cg = (wp[1] & mask)]; + op[2] = ToLinear8[cb = (wp[2] & mask)]; + n -= 3; + while (n > 0) { + n -= 3; + wp += 3; + op += 3; + op[0] = ToLinear8[(cr += wp[0]) & mask]; + op[1] = ToLinear8[(cg += wp[1]) & mask]; + op[2] = ToLinear8[(cb += wp[2]) & mask]; + } + } else if (stride == 4) { + op[0] = ToLinear8[cr = (wp[0] & mask)]; + op[1] = ToLinear8[cg = (wp[1] & mask)]; + op[2] = ToLinear8[cb = (wp[2] & mask)]; + op[3] = ToLinear8[ca = (wp[3] & mask)]; + n -= 4; + while (n > 0) { + n -= 4; + wp += 4; + op += 4; + op[0] = ToLinear8[(cr += wp[0]) & mask]; + op[1] = ToLinear8[(cg += wp[1]) & mask]; + op[2] = ToLinear8[(cb += wp[2]) & mask]; + op[3] = ToLinear8[(ca += wp[3]) & mask]; + } + } else { + REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++) + n -= stride; + } + } + } +} + + +static void +horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op, + unsigned char *ToLinear8) +{ + register unsigned int cr, cg, cb, ca, mask; + register unsigned char t0, t1, t2, t3; + + if (n >= stride) { + mask = CODE_MASK; + if (stride == 3) { + op[0] = 0; + t1 = ToLinear8[cb = (wp[2] & mask)]; + t2 = ToLinear8[cg = (wp[1] & mask)]; + t3 = ToLinear8[cr = (wp[0] & mask)]; + op[1] = t1; + op[2] = t2; + op[3] = t3; + n -= 3; + while (n > 0) { + n -= 3; + wp += 3; + op += 4; + op[0] = 0; + t1 = ToLinear8[(cb += wp[2]) & mask]; + t2 = ToLinear8[(cg += wp[1]) & mask]; + t3 = ToLinear8[(cr += wp[0]) & mask]; + op[1] = t1; + op[2] = t2; + op[3] = t3; + } + } else if (stride == 4) { + t0 = ToLinear8[ca = (wp[3] & mask)]; + t1 = ToLinear8[cb = (wp[2] & mask)]; + t2 = ToLinear8[cg = (wp[1] & mask)]; + t3 = ToLinear8[cr = (wp[0] & mask)]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + op[3] = t3; + n -= 4; + while (n > 0) { + n -= 4; + wp += 4; + op += 4; + t0 = ToLinear8[(ca += wp[3]) & mask]; + t1 = ToLinear8[(cb += wp[2]) & mask]; + t2 = ToLinear8[(cg += wp[1]) & mask]; + t3 = ToLinear8[(cr += wp[0]) & mask]; + op[0] = t0; + op[1] = t1; + op[2] = t2; + op[3] = t3; + } + } else { + REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++) + n -= stride; + while (n > 0) { + REPEAT(stride, + wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++) + n -= stride; + } + } + } +} + +/* + * State block for each open TIFF + * file using PixarLog compression/decompression. + */ +typedef struct { + TIFFPredictorState predict; + z_stream stream; + uint16 *tbuf; + uint16 stride; + int state; + int user_datafmt; + int quality; +#define PLSTATE_INIT 1 + + TIFFVSetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ + + float *ToLinearF; + uint16 *ToLinear16; + unsigned char *ToLinear8; + uint16 *FromLT2; + uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ + uint16 *From8; + +} PixarLogState; + +static int +PixarLogMakeTables(PixarLogState *sp) +{ + +/* + * We make several tables here to convert between various external + * representations (float, 16-bit, and 8-bit) and the internal + * 11-bit companded representation. The 11-bit representation has two + * distinct regions. A linear bottom end up through .018316 in steps + * of about .000073, and a region of constant ratio up to about 25. + * These floating point numbers are stored in the main table ToLinearF. + * All other tables are derived from this one. The tables (and the + * ratios) are continuous at the internal seam. + */ + + int nlin, lt2size; + int i, j; + double b, c, linstep, v; + float *ToLinearF; + uint16 *ToLinear16; + unsigned char *ToLinear8; + uint16 *FromLT2; + uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ + uint16 *From8; + + c = log(RATIO); + nlin = (int)(1./c); /* nlin must be an integer */ + c = 1./nlin; + b = exp(-c*ONE); /* multiplicative scale factor [b*exp(c*ONE) = 1] */ + linstep = b*c*exp(1.); + + LogK1 = (float)(1./c); /* if (v >= 2) token = k1*log(v*k2) */ + LogK2 = (float)(1./b); + lt2size = (int)(2./linstep) + 1; + FromLT2 = (uint16 *)_TIFFmalloc(lt2size*sizeof(uint16)); + From14 = (uint16 *)_TIFFmalloc(16384*sizeof(uint16)); + From8 = (uint16 *)_TIFFmalloc(256*sizeof(uint16)); + ToLinearF = (float *)_TIFFmalloc(TSIZEP1 * sizeof(float)); + ToLinear16 = (uint16 *)_TIFFmalloc(TSIZEP1 * sizeof(uint16)); + ToLinear8 = (unsigned char *)_TIFFmalloc(TSIZEP1 * sizeof(unsigned char)); + if (FromLT2 == NULL || From14 == NULL || From8 == NULL || + ToLinearF == NULL || ToLinear16 == NULL || ToLinear8 == NULL) { + if (FromLT2) _TIFFfree(FromLT2); + if (From14) _TIFFfree(From14); + if (From8) _TIFFfree(From8); + if (ToLinearF) _TIFFfree(ToLinearF); + if (ToLinear16) _TIFFfree(ToLinear16); + if (ToLinear8) _TIFFfree(ToLinear8); + sp->FromLT2 = NULL; + sp->From14 = NULL; + sp->From8 = NULL; + sp->ToLinearF = NULL; + sp->ToLinear16 = NULL; + sp->ToLinear8 = NULL; + return 0; + } + + j = 0; + + for (i = 0; i < nlin; i++) { + v = i * linstep; + ToLinearF[j++] = (float)v; + } + + for (i = nlin; i < TSIZE; i++) + ToLinearF[j++] = (float)(b*exp(c*i)); + + ToLinearF[2048] = ToLinearF[2047]; + + for (i = 0; i < TSIZEP1; i++) { + v = ToLinearF[i]*65535.0 + 0.5; + ToLinear16[i] = (v > 65535.0) ? 65535 : (uint16)v; + v = ToLinearF[i]*255.0 + 0.5; + ToLinear8[i] = (v > 255.0) ? 255 : (unsigned char)v; + } + + j = 0; + for (i = 0; i < lt2size; i++) { + if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1]) + j++; + FromLT2[i] = j; + } + + /* + * Since we lose info anyway on 16-bit data, we set up a 14-bit + * table and shift 16-bit values down two bits on input. + * saves a little table space. + */ + j = 0; + for (i = 0; i < 16384; i++) { + while ((i/16383.)*(i/16383.) > ToLinearF[j]*ToLinearF[j+1]) + j++; + From14[i] = j; + } + + j = 0; + for (i = 0; i < 256; i++) { + while ((i/255.)*(i/255.) > ToLinearF[j]*ToLinearF[j+1]) + j++; + From8[i] = j; + } + + Fltsize = (float)(lt2size/2); + + sp->ToLinearF = ToLinearF; + sp->ToLinear16 = ToLinear16; + sp->ToLinear8 = ToLinear8; + sp->FromLT2 = FromLT2; + sp->From14 = From14; + sp->From8 = From8; + + return 1; +} + +#define DecoderState(tif) ((PixarLogState*) (tif)->tif_data) +#define EncoderState(tif) ((PixarLogState*) (tif)->tif_data) + +static int PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s); +static int PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s); + +#define PIXARLOGDATAFMT_UNKNOWN -1 + +static int +PixarLogGuessDataFmt(TIFFDirectory *td) +{ + int guess = PIXARLOGDATAFMT_UNKNOWN; + int format = td->td_sampleformat; + + /* If the user didn't tell us his datafmt, + * take our best guess from the bitspersample. + */ + switch (td->td_bitspersample) { + case 32: + if (format == SAMPLEFORMAT_IEEEFP) + guess = PIXARLOGDATAFMT_FLOAT; + break; + case 16: + if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) + guess = PIXARLOGDATAFMT_16BIT; + break; + case 12: + if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_INT) + guess = PIXARLOGDATAFMT_12BITPICIO; + break; + case 11: + if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) + guess = PIXARLOGDATAFMT_11BITLOG; + break; + case 8: + if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) + guess = PIXARLOGDATAFMT_8BIT; + break; + } + + return guess; +} + +static tmsize_t +multiply_ms(tmsize_t m1, tmsize_t m2) +{ + tmsize_t bytes = m1 * m2; + + if (m1 && bytes / m1 != m2) + bytes = 0; + + return bytes; +} + +static int +PixarLogFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +static int +PixarLogSetupDecode(TIFF* tif) +{ + static const char module[] = "PixarLogSetupDecode"; + TIFFDirectory *td = &tif->tif_dir; + PixarLogState* sp = DecoderState(tif); + tmsize_t tbuf_size; + + assert(sp != NULL); + + /* Make sure no byte swapping happens on the data + * after decompression. */ + tif->tif_postdecode = _TIFFNoPostDecode; + + /* for some reason, we can't do this in TIFFInitPixarLog */ + + sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? + td->td_samplesperpixel : 1); + tbuf_size = multiply_ms(multiply_ms(multiply_ms(sp->stride, td->td_imagewidth), + td->td_rowsperstrip), sizeof(uint16)); + if (tbuf_size == 0) + return (0); /* TODO: this is an error return without error report through TIFFErrorExt */ + sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size+sizeof(uint16)*sp->stride); + if (sp->tbuf == NULL) + return (0); + if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) + sp->user_datafmt = PixarLogGuessDataFmt(td); + if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { + TIFFErrorExt(tif->tif_clientdata, module, + "PixarLog compression can't handle bits depth/data format combination (depth: %d)", + td->td_bitspersample); + return (0); + } + + if (inflateInit(&sp->stream) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg); + return (0); + } else { + sp->state |= PLSTATE_INIT; + return (1); + } +} + +/* + * Setup state for decoding a strip. + */ +static int +PixarLogPreDecode(TIFF* tif, uint16 s) +{ + static const char module[] = "PixarLogPreDecode"; + PixarLogState* sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + sp->stream.next_in = tif->tif_rawdata; + assert(sizeof(sp->stream.avail_in)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_in = (uInt) tif->tif_rawcc; + if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + return (inflateReset(&sp->stream) == Z_OK); +} + +static int +PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "PixarLogDecode"; + TIFFDirectory *td = &tif->tif_dir; + PixarLogState* sp = DecoderState(tif); + tmsize_t i; + tmsize_t nsamples; + int llen; + uint16 *up; + + switch (sp->user_datafmt) { + case PIXARLOGDATAFMT_FLOAT: + nsamples = occ / sizeof(float); /* XXX float == 32 bits */ + break; + case PIXARLOGDATAFMT_16BIT: + case PIXARLOGDATAFMT_12BITPICIO: + case PIXARLOGDATAFMT_11BITLOG: + nsamples = occ / sizeof(uint16); /* XXX uint16 == 16 bits */ + break; + case PIXARLOGDATAFMT_8BIT: + case PIXARLOGDATAFMT_8BITABGR: + nsamples = occ; + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "%d bit input not supported in PixarLog", + td->td_bitspersample); + return 0; + } + + llen = sp->stride * td->td_imagewidth; + + (void) s; + assert(sp != NULL); + sp->stream.next_out = (unsigned char *) sp->tbuf; + assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16)); + if (sp->stream.avail_out != nsamples * sizeof(uint16)) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + do { + int state = inflate(&sp->stream, Z_PARTIAL_FLUSH); + if (state == Z_STREAM_END) { + break; /* XXX */ + } + if (state == Z_DATA_ERROR) { + TIFFErrorExt(tif->tif_clientdata, module, + "Decoding error at scanline %lu, %s", + (unsigned long) tif->tif_row, sp->stream.msg); + if (inflateSync(&sp->stream) != Z_OK) + return (0); + continue; + } + if (state != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } while (sp->stream.avail_out > 0); + + /* hopefully, we got all the bytes we needed */ + if (sp->stream.avail_out != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)", + (unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out); + return (0); + } + + up = sp->tbuf; + /* Swap bytes in the data if from a different endian machine. */ + if (tif->tif_flags & TIFF_SWAB) + TIFFSwabArrayOfShort(up, nsamples); + + /* + * if llen is not an exact multiple of nsamples, the decode operation + * may overflow the output buffer, so truncate it enough to prevent + * that but still salvage as much data as possible. + */ + if (nsamples % llen) { + TIFFWarningExt(tif->tif_clientdata, module, + "stride %lu is not a multiple of sample count, " + "%lu, data truncated.", (unsigned long) llen, (unsigned long) nsamples); + nsamples -= nsamples % llen; + } + + for (i = 0; i < nsamples; i += llen, up += llen) { + switch (sp->user_datafmt) { + case PIXARLOGDATAFMT_FLOAT: + horizontalAccumulateF(up, llen, sp->stride, + (float *)op, sp->ToLinearF); + op += llen * sizeof(float); + break; + case PIXARLOGDATAFMT_16BIT: + horizontalAccumulate16(up, llen, sp->stride, + (uint16 *)op, sp->ToLinear16); + op += llen * sizeof(uint16); + break; + case PIXARLOGDATAFMT_12BITPICIO: + horizontalAccumulate12(up, llen, sp->stride, + (int16 *)op, sp->ToLinearF); + op += llen * sizeof(int16); + break; + case PIXARLOGDATAFMT_11BITLOG: + horizontalAccumulate11(up, llen, sp->stride, + (uint16 *)op); + op += llen * sizeof(uint16); + break; + case PIXARLOGDATAFMT_8BIT: + horizontalAccumulate8(up, llen, sp->stride, + (unsigned char *)op, sp->ToLinear8); + op += llen * sizeof(unsigned char); + break; + case PIXARLOGDATAFMT_8BITABGR: + horizontalAccumulate8abgr(up, llen, sp->stride, + (unsigned char *)op, sp->ToLinear8); + op += llen * sizeof(unsigned char); + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "Unsupported bits/sample: %d", + td->td_bitspersample); + return (0); + } + } + + return (1); +} + +static int +PixarLogSetupEncode(TIFF* tif) +{ + static const char module[] = "PixarLogSetupEncode"; + TIFFDirectory *td = &tif->tif_dir; + PixarLogState* sp = EncoderState(tif); + tmsize_t tbuf_size; + + assert(sp != NULL); + + /* for some reason, we can't do this in TIFFInitPixarLog */ + + sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? + td->td_samplesperpixel : 1); + tbuf_size = multiply_ms(multiply_ms(multiply_ms(sp->stride, td->td_imagewidth), + td->td_rowsperstrip), sizeof(uint16)); + if (tbuf_size == 0) + return (0); /* TODO: this is an error return without error report through TIFFErrorExt */ + sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size); + if (sp->tbuf == NULL) + return (0); + if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) + sp->user_datafmt = PixarLogGuessDataFmt(td); + if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { + TIFFErrorExt(tif->tif_clientdata, module, "PixarLog compression can't handle %d bit linear encodings", td->td_bitspersample); + return (0); + } + + if (deflateInit(&sp->stream, sp->quality) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg); + return (0); + } else { + sp->state |= PLSTATE_INIT; + return (1); + } +} + +/* + * Reset encoding state at the start of a strip. + */ +static int +PixarLogPreEncode(TIFF* tif, uint16 s) +{ + static const char module[] = "PixarLogPreEncode"; + PixarLogState *sp = EncoderState(tif); + + (void) s; + assert(sp != NULL); + sp->stream.next_out = tif->tif_rawdata; + assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_out = tif->tif_rawdatasize; + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + return (deflateReset(&sp->stream) == Z_OK); +} + +static void +horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2) +{ + int32 r1, g1, b1, a1, r2, g2, b2, a2, mask; + float fltsize = Fltsize; + +#define CLAMP(v) ( (v<(float)0.) ? 0 \ + : (v<(float)2.) ? FromLT2[(int)(v*fltsize)] \ + : (v>(float)24.2) ? 2047 \ + : LogK1*log(v*LogK2) + 0.5 ) + + mask = CODE_MASK; + if (n >= stride) { + if (stride == 3) { + r2 = wp[0] = (uint16) CLAMP(ip[0]); + g2 = wp[1] = (uint16) CLAMP(ip[1]); + b2 = wp[2] = (uint16) CLAMP(ip[2]); + n -= 3; + while (n > 0) { + n -= 3; + wp += 3; + ip += 3; + r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; + g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; + b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; + } + } else if (stride == 4) { + r2 = wp[0] = (uint16) CLAMP(ip[0]); + g2 = wp[1] = (uint16) CLAMP(ip[1]); + b2 = wp[2] = (uint16) CLAMP(ip[2]); + a2 = wp[3] = (uint16) CLAMP(ip[3]); + n -= 4; + while (n > 0) { + n -= 4; + wp += 4; + ip += 4; + r1 = (int32) CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; + g1 = (int32) CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; + b1 = (int32) CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; + a1 = (int32) CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1; + } + } else { + ip += n - 1; /* point to last one */ + wp += n - 1; /* point to last one */ + n -= stride; + while (n > 0) { + REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); + wp[stride] -= wp[0]; + wp[stride] &= mask; + wp--; ip--) + n -= stride; + } + REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); wp--; ip--) + } + } +} + +static void +horizontalDifference16(unsigned short *ip, int n, int stride, + unsigned short *wp, uint16 *From14) +{ + register int r1, g1, b1, a1, r2, g2, b2, a2, mask; + +/* assumption is unsigned pixel values */ +#undef CLAMP +#define CLAMP(v) From14[(v) >> 2] + + mask = CODE_MASK; + if (n >= stride) { + if (stride == 3) { + r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); + b2 = wp[2] = CLAMP(ip[2]); + n -= 3; + while (n > 0) { + n -= 3; + wp += 3; + ip += 3; + r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; + g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; + b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; + } + } else if (stride == 4) { + r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); + b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); + n -= 4; + while (n > 0) { + n -= 4; + wp += 4; + ip += 4; + r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; + g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; + b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; + a1 = CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1; + } + } else { + ip += n - 1; /* point to last one */ + wp += n - 1; /* point to last one */ + n -= stride; + while (n > 0) { + REPEAT(stride, wp[0] = CLAMP(ip[0]); + wp[stride] -= wp[0]; + wp[stride] &= mask; + wp--; ip--) + n -= stride; + } + REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) + } + } +} + + +static void +horizontalDifference8(unsigned char *ip, int n, int stride, + unsigned short *wp, uint16 *From8) +{ + register int r1, g1, b1, a1, r2, g2, b2, a2, mask; + +#undef CLAMP +#define CLAMP(v) (From8[(v)]) + + mask = CODE_MASK; + if (n >= stride) { + if (stride == 3) { + r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); + b2 = wp[2] = CLAMP(ip[2]); + n -= 3; + while (n > 0) { + n -= 3; + r1 = CLAMP(ip[3]); wp[3] = (r1-r2) & mask; r2 = r1; + g1 = CLAMP(ip[4]); wp[4] = (g1-g2) & mask; g2 = g1; + b1 = CLAMP(ip[5]); wp[5] = (b1-b2) & mask; b2 = b1; + wp += 3; + ip += 3; + } + } else if (stride == 4) { + r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); + b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); + n -= 4; + while (n > 0) { + n -= 4; + r1 = CLAMP(ip[4]); wp[4] = (r1-r2) & mask; r2 = r1; + g1 = CLAMP(ip[5]); wp[5] = (g1-g2) & mask; g2 = g1; + b1 = CLAMP(ip[6]); wp[6] = (b1-b2) & mask; b2 = b1; + a1 = CLAMP(ip[7]); wp[7] = (a1-a2) & mask; a2 = a1; + wp += 4; + ip += 4; + } + } else { + wp += n + stride - 1; /* point to last one */ + ip += n + stride - 1; /* point to last one */ + n -= stride; + while (n > 0) { + REPEAT(stride, wp[0] = CLAMP(ip[0]); + wp[stride] -= wp[0]; + wp[stride] &= mask; + wp--; ip--) + n -= stride; + } + REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) + } + } +} + +/* + * Encode a chunk of pixels. + */ +static int +PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + static const char module[] = "PixarLogEncode"; + TIFFDirectory *td = &tif->tif_dir; + PixarLogState *sp = EncoderState(tif); + tmsize_t i; + tmsize_t n; + int llen; + unsigned short * up; + + (void) s; + + switch (sp->user_datafmt) { + case PIXARLOGDATAFMT_FLOAT: + n = cc / sizeof(float); /* XXX float == 32 bits */ + break; + case PIXARLOGDATAFMT_16BIT: + case PIXARLOGDATAFMT_12BITPICIO: + case PIXARLOGDATAFMT_11BITLOG: + n = cc / sizeof(uint16); /* XXX uint16 == 16 bits */ + break; + case PIXARLOGDATAFMT_8BIT: + case PIXARLOGDATAFMT_8BITABGR: + n = cc; + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "%d bit input not supported in PixarLog", + td->td_bitspersample); + return 0; + } + + llen = sp->stride * td->td_imagewidth; + + for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) { + switch (sp->user_datafmt) { + case PIXARLOGDATAFMT_FLOAT: + horizontalDifferenceF((float *)bp, llen, + sp->stride, up, sp->FromLT2); + bp += llen * sizeof(float); + break; + case PIXARLOGDATAFMT_16BIT: + horizontalDifference16((uint16 *)bp, llen, + sp->stride, up, sp->From14); + bp += llen * sizeof(uint16); + break; + case PIXARLOGDATAFMT_8BIT: + horizontalDifference8((unsigned char *)bp, llen, + sp->stride, up, sp->From8); + bp += llen * sizeof(unsigned char); + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "%d bit input not supported in PixarLog", + td->td_bitspersample); + return 0; + } + } + + sp->stream.next_in = (unsigned char *) sp->tbuf; + assert(sizeof(sp->stream.avail_in)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_in = (uInt) (n * sizeof(uint16)); + if ((sp->stream.avail_in / sizeof(uint16)) != (uInt) n) + { + TIFFErrorExt(tif->tif_clientdata, module, + "ZLib cannot deal with buffers this size"); + return (0); + } + + do { + if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "Encoder error: %s", + sp->stream.msg); + return (0); + } + if (sp->stream.avail_out == 0) { + tif->tif_rawcc = tif->tif_rawdatasize; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in PixarLogPreEncode */ + } + } while (sp->stream.avail_in > 0); + return (1); +} + +/* + * Finish off an encoded strip by flushing the last + * string and tacking on an End Of Information code. + */ + +static int +PixarLogPostEncode(TIFF* tif) +{ + static const char module[] = "PixarLogPostEncode"; + PixarLogState *sp = EncoderState(tif); + int state; + + sp->stream.avail_in = 0; + + do { + state = deflate(&sp->stream, Z_FINISH); + switch (state) { + case Z_STREAM_END: + case Z_OK: + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) { + tif->tif_rawcc = + tif->tif_rawdatasize - sp->stream.avail_out; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in PixarLogPreEncode */ + } + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } while (state != Z_STREAM_END); + return (1); +} + +static void +PixarLogClose(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + + /* In a really sneaky (and really incorrect, and untruthfull, and + * troublesome, and error-prone) maneuver that completely goes against + * the spirit of TIFF, and breaks TIFF, on close, we covertly + * modify both bitspersample and sampleformat in the directory to + * indicate 8-bit linear. This way, the decode "just works" even for + * readers that don't know about PixarLog, or how to set + * the PIXARLOGDATFMT pseudo-tag. + */ + td->td_bitspersample = 8; + td->td_sampleformat = SAMPLEFORMAT_UINT; +} + +static void +PixarLogCleanup(TIFF* tif) +{ + PixarLogState* sp = (PixarLogState*) tif->tif_data; + + assert(sp != 0); + + (void)TIFFPredictorCleanup(tif); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + + if (sp->FromLT2) _TIFFfree(sp->FromLT2); + if (sp->From14) _TIFFfree(sp->From14); + if (sp->From8) _TIFFfree(sp->From8); + if (sp->ToLinearF) _TIFFfree(sp->ToLinearF); + if (sp->ToLinear16) _TIFFfree(sp->ToLinear16); + if (sp->ToLinear8) _TIFFfree(sp->ToLinear8); + if (sp->state&PLSTATE_INIT) { + if (tif->tif_mode == O_RDONLY) + inflateEnd(&sp->stream); + else + deflateEnd(&sp->stream); + } + if (sp->tbuf) + _TIFFfree(sp->tbuf); + _TIFFfree(sp); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +static int +PixarLogVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[] = "PixarLogVSetField"; + PixarLogState *sp = (PixarLogState *)tif->tif_data; + int result; + + switch (tag) { + case TIFFTAG_PIXARLOGQUALITY: + sp->quality = (int) va_arg(ap, int); + if (tif->tif_mode != O_RDONLY && (sp->state&PLSTATE_INIT)) { + if (deflateParams(&sp->stream, + sp->quality, Z_DEFAULT_STRATEGY) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } + return (1); + case TIFFTAG_PIXARLOGDATAFMT: + sp->user_datafmt = (int) va_arg(ap, int); + /* Tweak the TIFF header so that the rest of libtiff knows what + * size of data will be passed between app and library, and + * assume that the app knows what it is doing and is not + * confused by these header manipulations... + */ + switch (sp->user_datafmt) { + case PIXARLOGDATAFMT_8BIT: + case PIXARLOGDATAFMT_8BITABGR: + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + break; + case PIXARLOGDATAFMT_11BITLOG: + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + break; + case PIXARLOGDATAFMT_12BITPICIO: + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + break; + case PIXARLOGDATAFMT_16BIT: + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + break; + case PIXARLOGDATAFMT_FLOAT: + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 32); + TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); + break; + } + /* + * Must recalculate sizes should bits/sample change. + */ + tif->tif_tilesize = isTiled(tif) ? TIFFTileSize(tif) : (tmsize_t)(-1); + tif->tif_scanlinesize = TIFFScanlineSize(tif); + result = 1; /* NB: pseudo tag */ + break; + default: + result = (*sp->vsetparent)(tif, tag, ap); + } + return (result); +} + +static int +PixarLogVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + PixarLogState *sp = (PixarLogState *)tif->tif_data; + + switch (tag) { + case TIFFTAG_PIXARLOGQUALITY: + *va_arg(ap, int*) = sp->quality; + break; + case TIFFTAG_PIXARLOGDATAFMT: + *va_arg(ap, int*) = sp->user_datafmt; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return (1); +} + +static const TIFFField pixarlogFields[] = { + {TIFFTAG_PIXARLOGDATAFMT, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "", NULL}, + {TIFFTAG_PIXARLOGQUALITY, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, FALSE, FALSE, "", NULL} +}; + +int +TIFFInitPixarLog(TIFF* tif, int scheme) +{ + static const char module[] = "TIFFInitPixarLog"; + + PixarLogState* sp; + + assert(scheme == COMPRESSION_PIXARLOG); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, pixarlogFields, + TIFFArrayCount(pixarlogFields))) { + TIFFErrorExt(tif->tif_clientdata, module, + "Merging PixarLog codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof (PixarLogState)); + if (tif->tif_data == NULL) + goto bad; + sp = (PixarLogState*) tif->tif_data; + _TIFFmemset(sp, 0, sizeof (*sp)); + sp->stream.data_type = Z_BINARY; + sp->user_datafmt = PIXARLOGDATAFMT_UNKNOWN; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = PixarLogFixupTags; + tif->tif_setupdecode = PixarLogSetupDecode; + tif->tif_predecode = PixarLogPreDecode; + tif->tif_decoderow = PixarLogDecode; + tif->tif_decodestrip = PixarLogDecode; + tif->tif_decodetile = PixarLogDecode; + tif->tif_setupencode = PixarLogSetupEncode; + tif->tif_preencode = PixarLogPreEncode; + tif->tif_postencode = PixarLogPostEncode; + tif->tif_encoderow = PixarLogEncode; + tif->tif_encodestrip = PixarLogEncode; + tif->tif_encodetile = PixarLogEncode; + tif->tif_close = PixarLogClose; + tif->tif_cleanup = PixarLogCleanup; + + /* Override SetField so we can handle our private pseudo-tag */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = PixarLogVGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = PixarLogVSetField; /* hook for codec tags */ + + /* Default values for codec-specific fields */ + sp->quality = Z_DEFAULT_COMPRESSION; /* default comp. level */ + sp->state = 0; + + /* we don't wish to use the predictor, + * the default is none, which predictor value 1 + */ + (void) TIFFPredictorInit(tif); + + /* + * build the companding tables + */ + PixarLogMakeTables(sp); + + return (1); +bad: + TIFFErrorExt(tif->tif_clientdata, module, + "No space for PixarLog state block"); + return (0); +} +#endif /* PIXARLOG_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.c new file mode 100644 index 0000000..f93c664 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.c @@ -0,0 +1,764 @@ +/* $Id: tif_predict.c,v 1.32 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Predictor Tag Support (used by multiple codecs). + */ +#include "tiffiop.h" +#include "tif_predict.h" + +#define PredictorState(tif) ((TIFFPredictorState*) (tif)->tif_data) + +static void horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc); +static void horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc); +static void horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc); +static void swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc); +static void swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc); +static void horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc); +static void horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc); +static void horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc); +static void fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc); +static void fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc); +static int PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s); +static int PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s); +static int PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s); +static int PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s); + +static int +PredictorSetup(TIFF* tif) +{ + static const char module[] = "PredictorSetup"; + + TIFFPredictorState* sp = PredictorState(tif); + TIFFDirectory* td = &tif->tif_dir; + + switch (sp->predictor) /* no differencing */ + { + case PREDICTOR_NONE: + return 1; + case PREDICTOR_HORIZONTAL: + if (td->td_bitspersample != 8 + && td->td_bitspersample != 16 + && td->td_bitspersample != 32) { + TIFFErrorExt(tif->tif_clientdata, module, + "Horizontal differencing \"Predictor\" not supported with %d-bit samples", + td->td_bitspersample); + return 0; + } + break; + case PREDICTOR_FLOATINGPOINT: + if (td->td_sampleformat != SAMPLEFORMAT_IEEEFP) { + TIFFErrorExt(tif->tif_clientdata, module, + "Floating point \"Predictor\" not supported with %d data format", + td->td_sampleformat); + return 0; + } + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, + "\"Predictor\" value %d not supported", + sp->predictor); + return 0; + } + sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? + td->td_samplesperpixel : 1); + /* + * Calculate the scanline/tile-width size in bytes. + */ + if (isTiled(tif)) + sp->rowsize = TIFFTileRowSize(tif); + else + sp->rowsize = TIFFScanlineSize(tif); + if (sp->rowsize == 0) + return 0; + + return 1; +} + +static int +PredictorSetupDecode(TIFF* tif) +{ + TIFFPredictorState* sp = PredictorState(tif); + TIFFDirectory* td = &tif->tif_dir; + + if (!(*sp->setupdecode)(tif) || !PredictorSetup(tif)) + return 0; + + if (sp->predictor == 2) { + switch (td->td_bitspersample) { + case 8: sp->decodepfunc = horAcc8; break; + case 16: sp->decodepfunc = horAcc16; break; + case 32: sp->decodepfunc = horAcc32; break; + } + /* + * Override default decoding method with one that does the + * predictor stuff. + */ + if( tif->tif_decoderow != PredictorDecodeRow ) + { + sp->decoderow = tif->tif_decoderow; + tif->tif_decoderow = PredictorDecodeRow; + sp->decodestrip = tif->tif_decodestrip; + tif->tif_decodestrip = PredictorDecodeTile; + sp->decodetile = tif->tif_decodetile; + tif->tif_decodetile = PredictorDecodeTile; + } + + /* + * If the data is horizontally differenced 16-bit data that + * requires byte-swapping, then it must be byte swapped before + * the accumulation step. We do this with a special-purpose + * routine and override the normal post decoding logic that + * the library setup when the directory was read. + */ + if (tif->tif_flags & TIFF_SWAB) { + if (sp->decodepfunc == horAcc16) { + sp->decodepfunc = swabHorAcc16; + tif->tif_postdecode = _TIFFNoPostDecode; + } else if (sp->decodepfunc == horAcc32) { + sp->decodepfunc = swabHorAcc32; + tif->tif_postdecode = _TIFFNoPostDecode; + } + } + } + + else if (sp->predictor == 3) { + sp->decodepfunc = fpAcc; + /* + * Override default decoding method with one that does the + * predictor stuff. + */ + if( tif->tif_decoderow != PredictorDecodeRow ) + { + sp->decoderow = tif->tif_decoderow; + tif->tif_decoderow = PredictorDecodeRow; + sp->decodestrip = tif->tif_decodestrip; + tif->tif_decodestrip = PredictorDecodeTile; + sp->decodetile = tif->tif_decodetile; + tif->tif_decodetile = PredictorDecodeTile; + } + /* + * The data should not be swapped outside of the floating + * point predictor, the accumulation routine should return + * byres in the native order. + */ + if (tif->tif_flags & TIFF_SWAB) { + tif->tif_postdecode = _TIFFNoPostDecode; + } + /* + * Allocate buffer to keep the decoded bytes before + * rearranging in the ight order + */ + } + + return 1; +} + +static int +PredictorSetupEncode(TIFF* tif) +{ + TIFFPredictorState* sp = PredictorState(tif); + TIFFDirectory* td = &tif->tif_dir; + + if (!(*sp->setupencode)(tif) || !PredictorSetup(tif)) + return 0; + + if (sp->predictor == 2) { + switch (td->td_bitspersample) { + case 8: sp->encodepfunc = horDiff8; break; + case 16: sp->encodepfunc = horDiff16; break; + case 32: sp->encodepfunc = horDiff32; break; + } + /* + * Override default encoding method with one that does the + * predictor stuff. + */ + if( tif->tif_encoderow != PredictorEncodeRow ) + { + sp->encoderow = tif->tif_encoderow; + tif->tif_encoderow = PredictorEncodeRow; + sp->encodestrip = tif->tif_encodestrip; + tif->tif_encodestrip = PredictorEncodeTile; + sp->encodetile = tif->tif_encodetile; + tif->tif_encodetile = PredictorEncodeTile; + } + } + + else if (sp->predictor == 3) { + sp->encodepfunc = fpDiff; + /* + * Override default encoding method with one that does the + * predictor stuff. + */ + if( tif->tif_encoderow != PredictorEncodeRow ) + { + sp->encoderow = tif->tif_encoderow; + tif->tif_encoderow = PredictorEncodeRow; + sp->encodestrip = tif->tif_encodestrip; + tif->tif_encodestrip = PredictorEncodeTile; + sp->encodetile = tif->tif_encodetile; + tif->tif_encodetile = PredictorEncodeTile; + } + } + + return 1; +} + +#define REPEAT4(n, op) \ + switch (n) { \ + default: { tmsize_t i; for (i = n-4; i > 0; i--) { op; } } \ + case 4: op; \ + case 3: op; \ + case 2: op; \ + case 1: op; \ + case 0: ; \ + } + +static void +horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + + char* cp = (char*) cp0; + assert((cc%stride)==0); + if (cc > stride) { + /* + * Pipeline the most common cases. + */ + if (stride == 3) { + unsigned int cr = cp[0]; + unsigned int cg = cp[1]; + unsigned int cb = cp[2]; + cc -= 3; + cp += 3; + while (cc>0) { + cp[0] = (char) (cr += cp[0]); + cp[1] = (char) (cg += cp[1]); + cp[2] = (char) (cb += cp[2]); + cc -= 3; + cp += 3; + } + } else if (stride == 4) { + unsigned int cr = cp[0]; + unsigned int cg = cp[1]; + unsigned int cb = cp[2]; + unsigned int ca = cp[3]; + cc -= 4; + cp += 4; + while (cc>0) { + cp[0] = (char) (cr += cp[0]); + cp[1] = (char) (cg += cp[1]); + cp[2] = (char) (cb += cp[2]); + cp[3] = (char) (ca += cp[3]); + cc -= 4; + cp += 4; + } + } else { + cc -= stride; + do { + REPEAT4(stride, cp[stride] = + (char) (cp[stride] + *cp); cp++) + cc -= stride; + } while (cc>0); + } + } +} + +static void +swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint16* wp = (uint16*) cp0; + tmsize_t wc = cc / 2; + + assert((cc%(2*stride))==0); + + if (wc > stride) { + TIFFSwabArrayOfShort(wp, wc); + wc -= stride; + do { + REPEAT4(stride, wp[stride] += wp[0]; wp++) + wc -= stride; + } while (wc > 0); + } +} + +static void +horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint16* wp = (uint16*) cp0; + tmsize_t wc = cc / 2; + + assert((cc%(2*stride))==0); + + if (wc > stride) { + wc -= stride; + do { + REPEAT4(stride, wp[stride] += wp[0]; wp++) + wc -= stride; + } while (wc > 0); + } +} + +static void +swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint32* wp = (uint32*) cp0; + tmsize_t wc = cc / 4; + + assert((cc%(4*stride))==0); + + if (wc > stride) { + TIFFSwabArrayOfLong(wp, wc); + wc -= stride; + do { + REPEAT4(stride, wp[stride] += wp[0]; wp++) + wc -= stride; + } while (wc > 0); + } +} + +static void +horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint32* wp = (uint32*) cp0; + tmsize_t wc = cc / 4; + + assert((cc%(4*stride))==0); + + if (wc > stride) { + wc -= stride; + do { + REPEAT4(stride, wp[stride] += wp[0]; wp++) + wc -= stride; + } while (wc > 0); + } +} + +/* + * Floating point predictor accumulation routine. + */ +static void +fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint32 bps = tif->tif_dir.td_bitspersample / 8; + tmsize_t wc = cc / bps; + tmsize_t count = cc; + uint8 *cp = (uint8 *) cp0; + uint8 *tmp = (uint8 *)_TIFFmalloc(cc); + + assert((cc%(bps*stride))==0); + + if (!tmp) + return; + + while (count > stride) { + REPEAT4(stride, cp[stride] += cp[0]; cp++) + count -= stride; + } + + _TIFFmemcpy(tmp, cp0, cc); + cp = (uint8 *) cp0; + for (count = 0; count < wc; count++) { + uint32 byte; + for (byte = 0; byte < bps; byte++) { + #if WORDS_BIGENDIAN + cp[bps * count + byte] = tmp[byte * wc + count]; + #else + cp[bps * count + byte] = + tmp[(bps - byte - 1) * wc + count]; + #endif + } + } + _TIFFfree(tmp); +} + +/* + * Decode a scanline and apply the predictor routine. + */ +static int +PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) +{ + TIFFPredictorState *sp = PredictorState(tif); + + assert(sp != NULL); + assert(sp->decoderow != NULL); + assert(sp->decodepfunc != NULL); + + if ((*sp->decoderow)(tif, op0, occ0, s)) { + (*sp->decodepfunc)(tif, op0, occ0); + return 1; + } else + return 0; +} + +/* + * Decode a tile/strip and apply the predictor routine. + * Note that horizontal differencing must be done on a + * row-by-row basis. The width of a "row" has already + * been calculated at pre-decode time according to the + * strip/tile dimensions. + */ +static int +PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) +{ + TIFFPredictorState *sp = PredictorState(tif); + + assert(sp != NULL); + assert(sp->decodetile != NULL); + + if ((*sp->decodetile)(tif, op0, occ0, s)) { + tmsize_t rowsize = sp->rowsize; + assert(rowsize > 0); + assert((occ0%rowsize)==0); + assert(sp->decodepfunc != NULL); + while (occ0 > 0) { + (*sp->decodepfunc)(tif, op0, rowsize); + occ0 -= rowsize; + op0 += rowsize; + } + return 1; + } else + return 0; +} + +static void +horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + TIFFPredictorState* sp = PredictorState(tif); + tmsize_t stride = sp->stride; + char* cp = (char*) cp0; + + assert((cc%stride)==0); + + if (cc > stride) { + cc -= stride; + /* + * Pipeline the most common cases. + */ + if (stride == 3) { + int r1, g1, b1; + int r2 = cp[0]; + int g2 = cp[1]; + int b2 = cp[2]; + do { + r1 = cp[3]; cp[3] = r1-r2; r2 = r1; + g1 = cp[4]; cp[4] = g1-g2; g2 = g1; + b1 = cp[5]; cp[5] = b1-b2; b2 = b1; + cp += 3; + } while ((cc -= 3) > 0); + } else if (stride == 4) { + int r1, g1, b1, a1; + int r2 = cp[0]; + int g2 = cp[1]; + int b2 = cp[2]; + int a2 = cp[3]; + do { + r1 = cp[4]; cp[4] = r1-r2; r2 = r1; + g1 = cp[5]; cp[5] = g1-g2; g2 = g1; + b1 = cp[6]; cp[6] = b1-b2; b2 = b1; + a1 = cp[7]; cp[7] = a1-a2; a2 = a1; + cp += 4; + } while ((cc -= 4) > 0); + } else { + cp += cc - 1; + do { + REPEAT4(stride, cp[stride] -= cp[0]; cp--) + } while ((cc -= stride) > 0); + } + } +} + +static void +horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + TIFFPredictorState* sp = PredictorState(tif); + tmsize_t stride = sp->stride; + int16 *wp = (int16*) cp0; + tmsize_t wc = cc/2; + + assert((cc%(2*stride))==0); + + if (wc > stride) { + wc -= stride; + wp += wc - 1; + do { + REPEAT4(stride, wp[stride] -= wp[0]; wp--) + wc -= stride; + } while (wc > 0); + } +} + +static void +horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + TIFFPredictorState* sp = PredictorState(tif); + tmsize_t stride = sp->stride; + int32 *wp = (int32*) cp0; + tmsize_t wc = cc/4; + + assert((cc%(4*stride))==0); + + if (wc > stride) { + wc -= stride; + wp += wc - 1; + do { + REPEAT4(stride, wp[stride] -= wp[0]; wp--) + wc -= stride; + } while (wc > 0); + } +} + +/* + * Floating point predictor differencing routine. + */ +static void +fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc) +{ + tmsize_t stride = PredictorState(tif)->stride; + uint32 bps = tif->tif_dir.td_bitspersample / 8; + tmsize_t wc = cc / bps; + tmsize_t count; + uint8 *cp = (uint8 *) cp0; + uint8 *tmp = (uint8 *)_TIFFmalloc(cc); + + assert((cc%(bps*stride))==0); + + if (!tmp) + return; + + _TIFFmemcpy(tmp, cp0, cc); + for (count = 0; count < wc; count++) { + uint32 byte; + for (byte = 0; byte < bps; byte++) { + #if WORDS_BIGENDIAN + cp[byte * wc + count] = tmp[bps * count + byte]; + #else + cp[(bps - byte - 1) * wc + count] = + tmp[bps * count + byte]; + #endif + } + } + _TIFFfree(tmp); + + cp = (uint8 *) cp0; + cp += cc - stride - 1; + for (count = cc; count > stride; count -= stride) + REPEAT4(stride, cp[stride] -= cp[0]; cp--) +} + +static int +PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + TIFFPredictorState *sp = PredictorState(tif); + + assert(sp != NULL); + assert(sp->encodepfunc != NULL); + assert(sp->encoderow != NULL); + + /* XXX horizontal differencing alters user's data XXX */ + (*sp->encodepfunc)(tif, bp, cc); + return (*sp->encoderow)(tif, bp, cc, s); +} + +static int +PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s) +{ + static const char module[] = "PredictorEncodeTile"; + TIFFPredictorState *sp = PredictorState(tif); + uint8 *working_copy; + tmsize_t cc = cc0, rowsize; + unsigned char* bp; + int result_code; + + assert(sp != NULL); + assert(sp->encodepfunc != NULL); + assert(sp->encodetile != NULL); + + /* + * Do predictor manipulation in a working buffer to avoid altering + * the callers buffer. http://trac.osgeo.org/gdal/ticket/1965 + */ + working_copy = (uint8*) _TIFFmalloc(cc0); + if( working_copy == NULL ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Out of memory allocating " TIFF_SSIZE_FORMAT " byte temp buffer.", + cc0 ); + return 0; + } + memcpy( working_copy, bp0, cc0 ); + bp = working_copy; + + rowsize = sp->rowsize; + assert(rowsize > 0); + assert((cc0%rowsize)==0); + while (cc > 0) { + (*sp->encodepfunc)(tif, bp, rowsize); + cc -= rowsize; + bp += rowsize; + } + result_code = (*sp->encodetile)(tif, working_copy, cc0, s); + + _TIFFfree( working_copy ); + + return result_code; +} + +#define FIELD_PREDICTOR (FIELD_CODEC+0) /* XXX */ + +static const TIFFField predictFields[] = { + { TIFFTAG_PREDICTOR, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UINT16, FIELD_PREDICTOR, FALSE, FALSE, "Predictor", NULL }, +}; + +static int +PredictorVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + TIFFPredictorState *sp = PredictorState(tif); + + assert(sp != NULL); + assert(sp->vsetparent != NULL); + + switch (tag) { + case TIFFTAG_PREDICTOR: + sp->predictor = (uint16) va_arg(ap, uint16_vap); + TIFFSetFieldBit(tif, FIELD_PREDICTOR); + break; + default: + return (*sp->vsetparent)(tif, tag, ap); + } + tif->tif_flags |= TIFF_DIRTYDIRECT; + return 1; +} + +static int +PredictorVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + TIFFPredictorState *sp = PredictorState(tif); + + assert(sp != NULL); + assert(sp->vgetparent != NULL); + + switch (tag) { + case TIFFTAG_PREDICTOR: + *va_arg(ap, uint16*) = sp->predictor; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return 1; +} + +static void +PredictorPrintDir(TIFF* tif, FILE* fd, long flags) +{ + TIFFPredictorState* sp = PredictorState(tif); + + (void) flags; + if (TIFFFieldSet(tif,FIELD_PREDICTOR)) { + fprintf(fd, " Predictor: "); + switch (sp->predictor) { + case 1: fprintf(fd, "none "); break; + case 2: fprintf(fd, "horizontal differencing "); break; + case 3: fprintf(fd, "floating point predictor "); break; + } + fprintf(fd, "%u (0x%x)\n", sp->predictor, sp->predictor); + } + if (sp->printdir) + (*sp->printdir)(tif, fd, flags); +} + +int +TIFFPredictorInit(TIFF* tif) +{ + TIFFPredictorState* sp = PredictorState(tif); + + assert(sp != 0); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, predictFields, + TIFFArrayCount(predictFields))) { + TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit", + "Merging Predictor codec-specific tags failed"); + return 0; + } + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = + PredictorVGetField;/* hook for predictor tag */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = + PredictorVSetField;/* hook for predictor tag */ + sp->printdir = tif->tif_tagmethods.printdir; + tif->tif_tagmethods.printdir = + PredictorPrintDir; /* hook for predictor tag */ + + sp->setupdecode = tif->tif_setupdecode; + tif->tif_setupdecode = PredictorSetupDecode; + sp->setupencode = tif->tif_setupencode; + tif->tif_setupencode = PredictorSetupEncode; + + sp->predictor = 1; /* default value */ + sp->encodepfunc = NULL; /* no predictor routine */ + sp->decodepfunc = NULL; /* no predictor routine */ + return 1; +} + +int +TIFFPredictorCleanup(TIFF* tif) +{ + TIFFPredictorState* sp = PredictorState(tif); + + assert(sp != 0); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + tif->tif_tagmethods.printdir = sp->printdir; + tif->tif_setupdecode = sp->setupdecode; + tif->tif_setupencode = sp->setupencode; + + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.h new file mode 100644 index 0000000..dc7144c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_predict.h @@ -0,0 +1,77 @@ +/* $Id: tif_predict.h,v 1.8 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1995-1997 Sam Leffler + * Copyright (c) 1995-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFPREDICT_ +#define _TIFFPREDICT_ +/* + * ``Library-private'' Support for the Predictor Tag + */ + +/* + * Codecs that want to support the Predictor tag must place + * this structure first in their private state block so that + * the predictor code can cast tif_data to find its state. + */ +typedef struct { + int predictor; /* predictor tag value */ + tmsize_t stride; /* sample stride over data */ + tmsize_t rowsize; /* tile/strip row size */ + + TIFFCodeMethod encoderow; /* parent codec encode/decode row */ + TIFFCodeMethod encodestrip; /* parent codec encode/decode strip */ + TIFFCodeMethod encodetile; /* parent codec encode/decode tile */ + TIFFPostMethod encodepfunc; /* horizontal differencer */ + + TIFFCodeMethod decoderow; /* parent codec encode/decode row */ + TIFFCodeMethod decodestrip; /* parent codec encode/decode strip */ + TIFFCodeMethod decodetile; /* parent codec encode/decode tile */ + TIFFPostMethod decodepfunc; /* horizontal accumulator */ + + TIFFVGetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ + TIFFPrintMethod printdir; /* super-class method */ + TIFFBoolMethod setupdecode; /* super-class method */ + TIFFBoolMethod setupencode; /* super-class method */ +} TIFFPredictorState; + +#if defined(__cplusplus) +extern "C" { +#endif +extern int TIFFPredictorInit(TIFF*); +extern int TIFFPredictorCleanup(TIFF*); +#if defined(__cplusplus) +} +#endif +#endif /* _TIFFPREDICT_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_print.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_print.c new file mode 100644 index 0000000..402666d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_print.c @@ -0,0 +1,716 @@ +/* $Id: tif_print.c,v 1.60 2012-08-19 16:56:35 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Directory Printing Support + */ +#include "tiffiop.h" +#include + +#include + +static void +_TIFFprintAsciiBounded(FILE* fd, const char* cp, int max_chars); + +static const char *photoNames[] = { + "min-is-white", /* PHOTOMETRIC_MINISWHITE */ + "min-is-black", /* PHOTOMETRIC_MINISBLACK */ + "RGB color", /* PHOTOMETRIC_RGB */ + "palette color (RGB from colormap)", /* PHOTOMETRIC_PALETTE */ + "transparency mask", /* PHOTOMETRIC_MASK */ + "separated", /* PHOTOMETRIC_SEPARATED */ + "YCbCr", /* PHOTOMETRIC_YCBCR */ + "7 (0x7)", + "CIE L*a*b*", /* PHOTOMETRIC_CIELAB */ + "ICC L*a*b*", /* PHOTOMETRIC_ICCLAB */ + "ITU L*a*b*" /* PHOTOMETRIC_ITULAB */ +}; +#define NPHOTONAMES (sizeof (photoNames) / sizeof (photoNames[0])) + +static const char *orientNames[] = { + "0 (0x0)", + "row 0 top, col 0 lhs", /* ORIENTATION_TOPLEFT */ + "row 0 top, col 0 rhs", /* ORIENTATION_TOPRIGHT */ + "row 0 bottom, col 0 rhs", /* ORIENTATION_BOTRIGHT */ + "row 0 bottom, col 0 lhs", /* ORIENTATION_BOTLEFT */ + "row 0 lhs, col 0 top", /* ORIENTATION_LEFTTOP */ + "row 0 rhs, col 0 top", /* ORIENTATION_RIGHTTOP */ + "row 0 rhs, col 0 bottom", /* ORIENTATION_RIGHTBOT */ + "row 0 lhs, col 0 bottom", /* ORIENTATION_LEFTBOT */ +}; +#define NORIENTNAMES (sizeof (orientNames) / sizeof (orientNames[0])) + +static void +_TIFFPrintField(FILE* fd, const TIFFField *fip, + uint32 value_count, void *raw_data) +{ + uint32 j; + + fprintf(fd, " %s: ", fip->field_name); + + for(j = 0; j < value_count; j++) { + if(fip->field_type == TIFF_BYTE) + fprintf(fd, "%u", ((uint8 *) raw_data)[j]); + else if(fip->field_type == TIFF_UNDEFINED) + fprintf(fd, "0x%x", + (unsigned int) ((unsigned char *) raw_data)[j]); + else if(fip->field_type == TIFF_SBYTE) + fprintf(fd, "%d", ((int8 *) raw_data)[j]); + else if(fip->field_type == TIFF_SHORT) + fprintf(fd, "%u", ((uint16 *) raw_data)[j]); + else if(fip->field_type == TIFF_SSHORT) + fprintf(fd, "%d", ((int16 *) raw_data)[j]); + else if(fip->field_type == TIFF_LONG) + fprintf(fd, "%lu", + (unsigned long)((uint32 *) raw_data)[j]); + else if(fip->field_type == TIFF_SLONG) + fprintf(fd, "%ld", (long)((int32 *) raw_data)[j]); + else if(fip->field_type == TIFF_IFD) + fprintf(fd, "0x%lx", + (unsigned long)((uint32 *) raw_data)[j]); + else if(fip->field_type == TIFF_RATIONAL + || fip->field_type == TIFF_SRATIONAL + || fip->field_type == TIFF_FLOAT) + fprintf(fd, "%f", ((float *) raw_data)[j]); + else if(fip->field_type == TIFF_LONG8) +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, "%I64u", + (unsigned __int64)((uint64 *) raw_data)[j]); +#else + fprintf(fd, "%llu", + (unsigned long long)((uint64 *) raw_data)[j]); +#endif + else if(fip->field_type == TIFF_SLONG8) +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, "%I64d", (__int64)((int64 *) raw_data)[j]); +#else + fprintf(fd, "%lld", (long long)((int64 *) raw_data)[j]); +#endif + else if(fip->field_type == TIFF_IFD8) +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, "0x%I64x", + (unsigned __int64)((uint64 *) raw_data)[j]); +#else + fprintf(fd, "0x%llx", + (unsigned long long)((uint64 *) raw_data)[j]); +#endif + else if(fip->field_type == TIFF_FLOAT) + fprintf(fd, "%f", ((float *)raw_data)[j]); + else if(fip->field_type == TIFF_DOUBLE) + fprintf(fd, "%f", ((double *) raw_data)[j]); + else if(fip->field_type == TIFF_ASCII) { + fprintf(fd, "%s", (char *) raw_data); + break; + } + else { + fprintf(fd, ""); + break; + } + + if(j < value_count - 1) + fprintf(fd, ","); + } + + fprintf(fd, "\n"); +} + +static int +_TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag, + uint32 value_count, void *raw_data) +{ + (void) tif; + + /* do not try to pretty print auto-defined fields */ + if (strncmp(fip->field_name,"Tag ", 4) == 0) { + return 0; + } + + switch (tag) + { + case TIFFTAG_INKSET: + if (value_count == 2 && fip->field_type == TIFF_SHORT) { + fprintf(fd, " Ink Set: "); + switch (*((uint16*)raw_data)) { + case INKSET_CMYK: + fprintf(fd, "CMYK\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + *((uint16*)raw_data), + *((uint16*)raw_data)); + break; + } + return 1; + } + return 0; + + case TIFFTAG_DOTRANGE: + if (value_count == 2 && fip->field_type == TIFF_SHORT) { + fprintf(fd, " Dot Range: %u-%u\n", + ((uint16*)raw_data)[0], ((uint16*)raw_data)[1]); + return 1; + } + return 0; + + case TIFFTAG_WHITEPOINT: + if (value_count == 2 && fip->field_type == TIFF_RATIONAL) { + fprintf(fd, " White Point: %g-%g\n", + ((float *)raw_data)[0], ((float *)raw_data)[1]); + return 1; + } + return 0; + + case TIFFTAG_XMLPACKET: + { + uint32 i; + + fprintf(fd, " XMLPacket (XMP Metadata):\n" ); + for(i = 0; i < value_count; i++) + fputc(((char *)raw_data)[i], fd); + fprintf( fd, "\n" ); + return 1; + } + case TIFFTAG_RICHTIFFIPTC: + /* + * XXX: for some weird reason RichTIFFIPTC tag + * defined as array of LONG values. + */ + fprintf(fd, + " RichTIFFIPTC Data: , %lu bytes\n", + (unsigned long) value_count * 4); + return 1; + + case TIFFTAG_PHOTOSHOP: + fprintf(fd, " Photoshop Data: , %lu bytes\n", + (unsigned long) value_count); + return 1; + + case TIFFTAG_ICCPROFILE: + fprintf(fd, " ICC Profile: , %lu bytes\n", + (unsigned long) value_count); + return 1; + + case TIFFTAG_STONITS: + if (value_count == 1 && fip->field_type == TIFF_DOUBLE) { + fprintf(fd, + " Sample to Nits conversion factor: %.4e\n", + *((double*)raw_data)); + return 1; + } + return 0; + } + + return 0; +} + +/* + * Print the contents of the current directory + * to the specified stdio file stream. + */ +void +TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) +{ + TIFFDirectory *td = &tif->tif_dir; + char *sep; + uint16 i; + long l, n; + +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n", + (unsigned __int64) tif->tif_diroff, + (unsigned __int64) tif->tif_diroff); +#else + fprintf(fd, "TIFF Directory at offset 0x%llx (%llu)\n", + (unsigned long long) tif->tif_diroff, + (unsigned long long) tif->tif_diroff); +#endif + if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) { + fprintf(fd, " Subfile Type:"); + sep = " "; + if (td->td_subfiletype & FILETYPE_REDUCEDIMAGE) { + fprintf(fd, "%sreduced-resolution image", sep); + sep = "/"; + } + if (td->td_subfiletype & FILETYPE_PAGE) { + fprintf(fd, "%smulti-page document", sep); + sep = "/"; + } + if (td->td_subfiletype & FILETYPE_MASK) + fprintf(fd, "%stransparency mask", sep); + fprintf(fd, " (%lu = 0x%lx)\n", + (long) td->td_subfiletype, (long) td->td_subfiletype); + } + if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) { + fprintf(fd, " Image Width: %lu Image Length: %lu", + (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength); + if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) + fprintf(fd, " Image Depth: %lu", + (unsigned long) td->td_imagedepth); + fprintf(fd, "\n"); + } + if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) { + fprintf(fd, " Tile Width: %lu Tile Length: %lu", + (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength); + if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) + fprintf(fd, " Tile Depth: %lu", + (unsigned long) td->td_tiledepth); + fprintf(fd, "\n"); + } + if (TIFFFieldSet(tif,FIELD_RESOLUTION)) { + fprintf(fd, " Resolution: %g, %g", + td->td_xresolution, td->td_yresolution); + if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) { + switch (td->td_resolutionunit) { + case RESUNIT_NONE: + fprintf(fd, " (unitless)"); + break; + case RESUNIT_INCH: + fprintf(fd, " pixels/inch"); + break; + case RESUNIT_CENTIMETER: + fprintf(fd, " pixels/cm"); + break; + default: + fprintf(fd, " (unit %u = 0x%x)", + td->td_resolutionunit, + td->td_resolutionunit); + break; + } + } + fprintf(fd, "\n"); + } + if (TIFFFieldSet(tif,FIELD_POSITION)) + fprintf(fd, " Position: %g, %g\n", + td->td_xposition, td->td_yposition); + if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) + fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample); + if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) { + fprintf(fd, " Sample Format: "); + switch (td->td_sampleformat) { + case SAMPLEFORMAT_VOID: + fprintf(fd, "void\n"); + break; + case SAMPLEFORMAT_INT: + fprintf(fd, "signed integer\n"); + break; + case SAMPLEFORMAT_UINT: + fprintf(fd, "unsigned integer\n"); + break; + case SAMPLEFORMAT_IEEEFP: + fprintf(fd, "IEEE floating point\n"); + break; + case SAMPLEFORMAT_COMPLEXINT: + fprintf(fd, "complex signed integer\n"); + break; + case SAMPLEFORMAT_COMPLEXIEEEFP: + fprintf(fd, "complex IEEE floating point\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_sampleformat, td->td_sampleformat); + break; + } + } + if (TIFFFieldSet(tif,FIELD_COMPRESSION)) { + const TIFFCodec* c = TIFFFindCODEC(td->td_compression); + fprintf(fd, " Compression Scheme: "); + if (c) + fprintf(fd, "%s\n", c->name); + else + fprintf(fd, "%u (0x%x)\n", + td->td_compression, td->td_compression); + } + if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) { + fprintf(fd, " Photometric Interpretation: "); + if (td->td_photometric < NPHOTONAMES) + fprintf(fd, "%s\n", photoNames[td->td_photometric]); + else { + switch (td->td_photometric) { + case PHOTOMETRIC_LOGL: + fprintf(fd, "CIE Log2(L)\n"); + break; + case PHOTOMETRIC_LOGLUV: + fprintf(fd, "CIE Log2(L) (u',v')\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_photometric, td->td_photometric); + break; + } + } + } + if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) { + fprintf(fd, " Extra Samples: %u<", td->td_extrasamples); + sep = ""; + for (i = 0; i < td->td_extrasamples; i++) { + switch (td->td_sampleinfo[i]) { + case EXTRASAMPLE_UNSPECIFIED: + fprintf(fd, "%sunspecified", sep); + break; + case EXTRASAMPLE_ASSOCALPHA: + fprintf(fd, "%sassoc-alpha", sep); + break; + case EXTRASAMPLE_UNASSALPHA: + fprintf(fd, "%sunassoc-alpha", sep); + break; + default: + fprintf(fd, "%s%u (0x%x)", sep, + td->td_sampleinfo[i], td->td_sampleinfo[i]); + break; + } + sep = ", "; + } + fprintf(fd, ">\n"); + } + if (TIFFFieldSet(tif,FIELD_INKNAMES)) { + char* cp; + fprintf(fd, " Ink Names: "); + i = td->td_samplesperpixel; + sep = ""; + for (cp = td->td_inknames; + i > 0 && cp < td->td_inknames + td->td_inknameslen; + cp = strchr(cp,'\0')+1, i--) { + int max_chars = + td->td_inknameslen - (cp - td->td_inknames); + fputs(sep, fd); + _TIFFprintAsciiBounded(fd, cp, max_chars); + sep = ", "; + } + fputs("\n", fd); + } + if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) { + fprintf(fd, " Thresholding: "); + switch (td->td_threshholding) { + case THRESHHOLD_BILEVEL: + fprintf(fd, "bilevel art scan\n"); + break; + case THRESHHOLD_HALFTONE: + fprintf(fd, "halftone or dithered scan\n"); + break; + case THRESHHOLD_ERRORDIFFUSE: + fprintf(fd, "error diffused\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_threshholding, td->td_threshholding); + break; + } + } + if (TIFFFieldSet(tif,FIELD_FILLORDER)) { + fprintf(fd, " FillOrder: "); + switch (td->td_fillorder) { + case FILLORDER_MSB2LSB: + fprintf(fd, "msb-to-lsb\n"); + break; + case FILLORDER_LSB2MSB: + fprintf(fd, "lsb-to-msb\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_fillorder, td->td_fillorder); + break; + } + } + if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) + { + fprintf(fd, " YCbCr Subsampling: %u, %u\n", + td->td_ycbcrsubsampling[0], td->td_ycbcrsubsampling[1] ); + } + if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) { + fprintf(fd, " YCbCr Positioning: "); + switch (td->td_ycbcrpositioning) { + case YCBCRPOSITION_CENTERED: + fprintf(fd, "centered\n"); + break; + case YCBCRPOSITION_COSITED: + fprintf(fd, "cosited\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_ycbcrpositioning, td->td_ycbcrpositioning); + break; + } + } + if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) + fprintf(fd, " Halftone Hints: light %u dark %u\n", + td->td_halftonehints[0], td->td_halftonehints[1]); + if (TIFFFieldSet(tif,FIELD_ORIENTATION)) { + fprintf(fd, " Orientation: "); + if (td->td_orientation < NORIENTNAMES) + fprintf(fd, "%s\n", orientNames[td->td_orientation]); + else + fprintf(fd, "%u (0x%x)\n", + td->td_orientation, td->td_orientation); + } + if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) + fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel); + if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) { + fprintf(fd, " Rows/Strip: "); + if (td->td_rowsperstrip == (uint32) -1) + fprintf(fd, "(infinite)\n"); + else + fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip); + } + if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) + fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue); + if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) + fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue); + if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) { + int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; + fprintf(fd, " SMin Sample Value:"); + for (i = 0; i < count; ++i) + fprintf(fd, " %g", td->td_sminsamplevalue[i]); + fprintf(fd, "\n"); + } + if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) { + int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1; + fprintf(fd, " SMax Sample Value:"); + for (i = 0; i < count; ++i) + fprintf(fd, " %g", td->td_smaxsamplevalue[i]); + fprintf(fd, "\n"); + } + if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) { + fprintf(fd, " Planar Configuration: "); + switch (td->td_planarconfig) { + case PLANARCONFIG_CONTIG: + fprintf(fd, "single image plane\n"); + break; + case PLANARCONFIG_SEPARATE: + fprintf(fd, "separate image planes\n"); + break; + default: + fprintf(fd, "%u (0x%x)\n", + td->td_planarconfig, td->td_planarconfig); + break; + } + } + if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) + fprintf(fd, " Page Number: %u-%u\n", + td->td_pagenumber[0], td->td_pagenumber[1]); + if (TIFFFieldSet(tif,FIELD_COLORMAP)) { + fprintf(fd, " Color Map: "); + if (flags & TIFFPRINT_COLORMAP) { + fprintf(fd, "\n"); + n = 1L<td_bitspersample; + for (l = 0; l < n; l++) + fprintf(fd, " %5lu: %5u %5u %5u\n", + l, + td->td_colormap[0][l], + td->td_colormap[1][l], + td->td_colormap[2][l]); + } else + fprintf(fd, "(present)\n"); + } + if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { + fprintf(fd, " Reference Black/White:\n"); + for (i = 0; i < 3; i++) + fprintf(fd, " %2d: %5g %5g\n", i, + td->td_refblackwhite[2*i+0], + td->td_refblackwhite[2*i+1]); + } + if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) { + fprintf(fd, " Transfer Function: "); + if (flags & TIFFPRINT_CURVES) { + fprintf(fd, "\n"); + n = 1L<td_bitspersample; + for (l = 0; l < n; l++) { + fprintf(fd, " %2lu: %5u", + l, td->td_transferfunction[0][l]); + for (i = 1; i < td->td_samplesperpixel; i++) + fprintf(fd, " %5u", + td->td_transferfunction[i][l]); + fputc('\n', fd); + } + } else + fprintf(fd, "(present)\n"); + } + if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) { + fprintf(fd, " SubIFD Offsets:"); + for (i = 0; i < td->td_nsubifd; i++) +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, " %5I64u", + (unsigned __int64) td->td_subifd[i]); +#else + fprintf(fd, " %5llu", + (unsigned long long) td->td_subifd[i]); +#endif + fputc('\n', fd); + } + + /* + ** Custom tag support. + */ + { + int i; + short count; + + count = (short) TIFFGetTagListCount(tif); + for(i = 0; i < count; i++) { + uint32 tag = TIFFGetTagListEntry(tif, i); + const TIFFField *fip; + uint32 value_count; + int mem_alloc = 0; + void *raw_data; + + fip = TIFFFieldWithTag(tif, tag); + if(fip == NULL) + continue; + + if(fip->field_passcount) { + if (fip->field_readcount == TIFF_VARIABLE ) { + if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1) + continue; + } else if (fip->field_readcount == TIFF_VARIABLE2 ) { + uint16 small_value_count; + if(TIFFGetField(tif, tag, &small_value_count, &raw_data) != 1) + continue; + value_count = small_value_count; + } else { + assert (fip->field_readcount == TIFF_VARIABLE + || fip->field_readcount == TIFF_VARIABLE2); + continue; + } + } else { + if (fip->field_readcount == TIFF_VARIABLE + || fip->field_readcount == TIFF_VARIABLE2) + value_count = 1; + else if (fip->field_readcount == TIFF_SPP) + value_count = td->td_samplesperpixel; + else + value_count = fip->field_readcount; + if (fip->field_tag == TIFFTAG_DOTRANGE + && strcmp(fip->field_name,"DotRange") == 0) { + /* TODO: This is an evil exception and should not have been + handled this way ... likely best if we move it into + the directory structure with an explicit field in + libtiff 4.1 and assign it a FIELD_ value */ + static uint16 dotrange[2]; + raw_data = dotrange; + TIFFGetField(tif, tag, dotrange+0, dotrange+1); + } else if (fip->field_type == TIFF_ASCII + || fip->field_readcount == TIFF_VARIABLE + || fip->field_readcount == TIFF_VARIABLE2 + || fip->field_readcount == TIFF_SPP + || value_count > 1) { + if(TIFFGetField(tif, tag, &raw_data) != 1) + continue; + } else { + raw_data = _TIFFmalloc( + _TIFFDataSize(fip->field_type) + * value_count); + mem_alloc = 1; + if(TIFFGetField(tif, tag, raw_data) != 1) { + _TIFFfree(raw_data); + continue; + } + } + } + + /* + * Catch the tags which needs to be specially handled + * and pretty print them. If tag not handled in + * _TIFFPrettyPrintField() fall down and print it as + * any other tag. + */ + if (!_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data)) + _TIFFPrintField(fd, fip, value_count, raw_data); + + if(mem_alloc) + _TIFFfree(raw_data); + } + } + + if (tif->tif_tagmethods.printdir) + (*tif->tif_tagmethods.printdir)(tif, fd, flags); + + _TIFFFillStriles( tif ); + + if ((flags & TIFFPRINT_STRIPS) && + TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) { + uint32 s; + + fprintf(fd, " %lu %s:\n", + (long) td->td_nstrips, + isTiled(tif) ? "Tiles" : "Strips"); + for (s = 0; s < td->td_nstrips; s++) +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + fprintf(fd, " %3lu: [%8I64u, %8I64u]\n", + (unsigned long) s, + (unsigned __int64) td->td_stripoffset[s], + (unsigned __int64) td->td_stripbytecount[s]); +#else + fprintf(fd, " %3lu: [%8llu, %8llu]\n", + (unsigned long) s, + (unsigned long long) td->td_stripoffset[s], + (unsigned long long) td->td_stripbytecount[s]); +#endif + } +} + +void +_TIFFprintAscii(FILE* fd, const char* cp) +{ + _TIFFprintAsciiBounded( fd, cp, strlen(cp)); +} + +static void +_TIFFprintAsciiBounded(FILE* fd, const char* cp, int max_chars) +{ + for (; max_chars > 0 && *cp != '\0'; cp++, max_chars--) { + const char* tp; + + if (isprint((int)*cp)) { + fputc(*cp, fd); + continue; + } + for (tp = "\tt\bb\rr\nn\vv"; *tp; tp++) + if (*tp++ == *cp) + break; + if (*tp) + fprintf(fd, "\\%c", *tp); + else + fprintf(fd, "\\%03o", *cp & 0xff); + } +} + +void +_TIFFprintAsciiTag(FILE* fd, const char* name, const char* value) +{ + fprintf(fd, " %s: \"", name); + _TIFFprintAscii(fd, value); + fprintf(fd, "\"\n"); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_read.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_read.c new file mode 100644 index 0000000..fe36e68 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_read.c @@ -0,0 +1,1083 @@ +/* $Id: tif_read.c,v 1.41 2012-07-06 19:22:58 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * Scanline-oriented Read Support + */ +#include "tiffiop.h" +#include + +int TIFFFillStrip(TIFF* tif, uint32 strip); +int TIFFFillTile(TIFF* tif, uint32 tile); +static int TIFFStartStrip(TIFF* tif, uint32 strip); +static int TIFFStartTile(TIFF* tif, uint32 tile); +static int TIFFCheckRead(TIFF*, int); +static tmsize_t +TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,const char* module); + +#define NOSTRIP ((uint32)(-1)) /* undefined state */ +#define NOTILE ((uint32)(-1)) /* undefined state */ + +static int +TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart ) +{ + static const char module[] = "TIFFFillStripPartial"; + register TIFFDirectory *td = &tif->tif_dir; + uint64 unused_data; + uint64 read_offset; + tmsize_t cc, to_read; + /* tmsize_t bytecountm; */ + + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + + /* + * Expand raw data buffer, if needed, to hold data + * strip coming from file (perhaps should set upper + * bound on the size of a buffer we'll use?). + */ + + /* bytecountm=(tmsize_t) td->td_stripbytecount[strip]; */ + if (read_ahead*2 > tif->tif_rawdatasize) { + assert( restart ); + + tif->tif_curstrip = NOSTRIP; + if ((tif->tif_flags & TIFF_MYBUFFER) == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Data buffer too small to hold part of strip %lu", + (unsigned long) strip); + return (0); + } + if (!TIFFReadBufferSetup(tif, 0, read_ahead*2)) + return (0); + } + + if( restart ) + { + tif->tif_rawdataloaded = 0; + tif->tif_rawdataoff = 0; + } + + /* + ** If we are reading more data, move any unused data to the + ** start of the buffer. + */ + if( tif->tif_rawdataloaded > 0 ) + unused_data = tif->tif_rawdataloaded - (tif->tif_rawcp - tif->tif_rawdata); + else + unused_data = 0; + + if( unused_data > 0 ) + { + assert((tif->tif_flags&TIFF_BUFFERMMAP)==0); + memmove( tif->tif_rawdata, tif->tif_rawcp, unused_data ); + } + + /* + ** Seek to the point in the file where more data should be read. + */ + read_offset = td->td_stripoffset[strip] + + tif->tif_rawdataoff + tif->tif_rawdataloaded; + + if (!SeekOK(tif, read_offset)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Seek error at scanline %lu, strip %lu", + (unsigned long) tif->tif_row, (unsigned long) strip); + return 0; + } + + /* + ** How much do we want to read? + */ + to_read = tif->tif_rawdatasize - unused_data; + if( (uint64) to_read > td->td_stripbytecount[strip] + - tif->tif_rawdataoff - tif->tif_rawdataloaded ) + { + to_read = td->td_stripbytecount[strip] + - tif->tif_rawdataoff - tif->tif_rawdataloaded; + } + + assert((tif->tif_flags&TIFF_BUFFERMMAP)==0); + cc = TIFFReadFile(tif, tif->tif_rawdata + unused_data, to_read); + + if (cc != to_read) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu; got %I64u bytes, expected %I64u", + (unsigned long) tif->tif_row, + (unsigned __int64) cc, + (unsigned __int64) to_read); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu; got %llu bytes, expected %llu", + (unsigned long) tif->tif_row, + (unsigned long long) cc, + (unsigned long long) to_read); +#endif + return 0; + } + + tif->tif_rawdataoff = tif->tif_rawdataoff + tif->tif_rawdataloaded - unused_data ; + tif->tif_rawdataloaded = unused_data + to_read; + + tif->tif_rawcp = tif->tif_rawdata; + + if (!isFillOrder(tif, td->td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) { + assert((tif->tif_flags&TIFF_BUFFERMMAP)==0); + TIFFReverseBits(tif->tif_rawdata + unused_data, to_read ); + } + + /* + ** When starting a strip from the beginning we need to + ** restart the decoder. + */ + if( restart ) + return TIFFStartStrip(tif, strip); + else + return 1; +} + +/* + * Seek to a random row+sample in a file. + * + * Only used by TIFFReadScanline, and is only used on + * strip organized files. We do some tricky stuff to try + * and avoid reading the whole compressed raw data for big + * strips. + */ +static int +TIFFSeek(TIFF* tif, uint32 row, uint16 sample ) +{ + register TIFFDirectory *td = &tif->tif_dir; + uint32 strip; + int whole_strip; + tmsize_t read_ahead = 0; + + /* + ** Establish what strip we are working from. + */ + if (row >= td->td_imagelength) { /* out of range */ + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Row out of range, max %lu", + (unsigned long) row, + (unsigned long) td->td_imagelength); + return (0); + } + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + if (sample >= td->td_samplesperpixel) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Sample out of range, max %lu", + (unsigned long) sample, (unsigned long) td->td_samplesperpixel); + return (0); + } + strip = (uint32)sample*td->td_stripsperimage + row/td->td_rowsperstrip; + } else + strip = row / td->td_rowsperstrip; + + /* + * Do we want to treat this strip as one whole chunk or + * read it a few lines at a time? + */ +#if defined(CHUNKY_STRIP_READ_SUPPORT) + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + whole_strip = tif->tif_dir.td_stripbytecount[strip] < 10 + || isMapped(tif); +#else + whole_strip = 1; +#endif + + if( !whole_strip ) + { + read_ahead = tif->tif_scanlinesize * 16 + 5000; + } + + /* + * If we haven't loaded this strip, do so now, possibly + * only reading the first part. + */ + if (strip != tif->tif_curstrip) { /* different strip, refill */ + + if( whole_strip ) + { + if (!TIFFFillStrip(tif, strip)) + return (0); + } + else + { + if( !TIFFFillStripPartial(tif,strip,read_ahead,1) ) + return 0; + } + } + + /* + ** If we already have some data loaded, do we need to read some more? + */ + else if( !whole_strip ) + { + if( ((tif->tif_rawdata + tif->tif_rawdataloaded) - tif->tif_rawcp) < read_ahead + && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < td->td_stripbytecount[strip] ) + { + if( !TIFFFillStripPartial(tif,strip,read_ahead,0) ) + return 0; + } + } + + if (row < tif->tif_row) { + /* + * Moving backwards within the same strip: backup + * to the start and then decode forward (below). + * + * NB: If you're planning on lots of random access within a + * strip, it's better to just read and decode the entire + * strip, and then access the decoded data in a random fashion. + */ + + if( tif->tif_rawdataoff != 0 ) + { + if( !TIFFFillStripPartial(tif,strip,read_ahead,1) ) + return 0; + } + else + { + if (!TIFFStartStrip(tif, strip)) + return (0); + } + } + + if (row != tif->tif_row) { + /* + * Seek forward to the desired row. + */ + + /* TODO: Will this really work with partial buffers? */ + + if (!(*tif->tif_seek)(tif, row - tif->tif_row)) + return (0); + tif->tif_row = row; + } + + return (1); +} + +int +TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample) +{ + int e; + + if (!TIFFCheckRead(tif, 0)) + return (-1); + if( (e = TIFFSeek(tif, row, sample)) != 0) { + /* + * Decompress desired row into user buffer. + */ + e = (*tif->tif_decoderow) + (tif, (uint8*) buf, tif->tif_scanlinesize, sample); + + /* we are now poised at the beginning of the next row */ + tif->tif_row = row + 1; + + if (e) + (*tif->tif_postdecode)(tif, (uint8*) buf, + tif->tif_scanlinesize); + } + return (e > 0 ? 1 : -1); +} + +/* + * Read a strip of data and decompress the specified + * amount into the user-supplied buffer. + */ +tmsize_t +TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size) +{ + static const char module[] = "TIFFReadEncodedStrip"; + TIFFDirectory *td = &tif->tif_dir; + uint32 rowsperstrip; + uint32 stripsperplane; + uint32 stripinplane; + uint16 plane; + uint32 rows; + tmsize_t stripsize; + if (!TIFFCheckRead(tif,0)) + return((tmsize_t)(-1)); + if (strip>=td->td_nstrips) + { + TIFFErrorExt(tif->tif_clientdata,module, + "%lu: Strip out of range, max %lu",(unsigned long)strip, + (unsigned long)td->td_nstrips); + return((tmsize_t)(-1)); + } + /* + * Calculate the strip size according to the number of + * rows in the strip (check for truncated last strip on any + * of the separations). + */ + rowsperstrip=td->td_rowsperstrip; + if (rowsperstrip>td->td_imagelength) + rowsperstrip=td->td_imagelength; + stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip); + stripinplane=(strip%stripsperplane); + plane=(strip/stripsperplane); + rows=td->td_imagelength-stripinplane*rowsperstrip; + if (rows>rowsperstrip) + rows=rowsperstrip; + stripsize=TIFFVStripSize(tif,rows); + if (stripsize==0) + return((tmsize_t)(-1)); + if ((size!=(tmsize_t)(-1))&&(sizetif_decodestrip)(tif,buf,stripsize,plane)<=0) + return((tmsize_t)(-1)); + (*tif->tif_postdecode)(tif,buf,stripsize); + return(stripsize); +} + +static tmsize_t +TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size, + const char* module) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif )) + return ((tmsize_t)(-1)); + + assert((tif->tif_flags&TIFF_NOREADRAW)==0); + if (!isMapped(tif)) { + tmsize_t cc; + + if (!SeekOK(tif, td->td_stripoffset[strip])) { + TIFFErrorExt(tif->tif_clientdata, module, + "Seek error at scanline %lu, strip %lu", + (unsigned long) tif->tif_row, (unsigned long) strip); + return ((tmsize_t)(-1)); + } + cc = TIFFReadFile(tif, buf, size); + if (cc != size) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu; got %I64u bytes, expected %I64u", + (unsigned long) tif->tif_row, + (unsigned __int64) cc, + (unsigned __int64) size); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu; got %llu bytes, expected %llu", + (unsigned long) tif->tif_row, + (unsigned long long) cc, + (unsigned long long) size); +#endif + return ((tmsize_t)(-1)); + } + } else { + tmsize_t ma,mb; + tmsize_t n; + ma=(tmsize_t)td->td_stripoffset[strip]; + mb=ma+size; + if (((uint64)ma!=td->td_stripoffset[strip])||(ma>tif->tif_size)) + n=0; + else if ((mbtif->tif_size)) + n=tif->tif_size-ma; + else + n=size; + if (n!=size) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu, strip %lu; got %I64u bytes, expected %I64u", + (unsigned long) tif->tif_row, + (unsigned long) strip, + (unsigned __int64) n, + (unsigned __int64) size); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at scanline %lu, strip %lu; got %llu bytes, expected %llu", + (unsigned long) tif->tif_row, + (unsigned long) strip, + (unsigned long long) n, + (unsigned long long) size); +#endif + return ((tmsize_t)(-1)); + } + _TIFFmemcpy(buf, tif->tif_base + ma, + size); + } + return (size); +} + +/* + * Read a strip of data from the file. + */ +tmsize_t +TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size) +{ + static const char module[] = "TIFFReadRawStrip"; + TIFFDirectory *td = &tif->tif_dir; + uint64 bytecount; + tmsize_t bytecountm; + + if (!TIFFCheckRead(tif, 0)) + return ((tmsize_t)(-1)); + if (strip >= td->td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, + "%lu: Strip out of range, max %lu", + (unsigned long) strip, + (unsigned long) td->td_nstrips); + return ((tmsize_t)(-1)); + } + if (tif->tif_flags&TIFF_NOREADRAW) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Compression scheme does not support access to raw uncompressed data"); + return ((tmsize_t)(-1)); + } + bytecount = td->td_stripbytecount[strip]; + if (bytecount <= 0) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "%I64u: Invalid strip byte count, strip %lu", + (unsigned __int64) bytecount, + (unsigned long) strip); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "%llu: Invalid strip byte count, strip %lu", + (unsigned long long) bytecount, + (unsigned long) strip); +#endif + return ((tmsize_t)(-1)); + } + bytecountm = (tmsize_t)bytecount; + if ((uint64)bytecountm!=bytecount) { + TIFFErrorExt(tif->tif_clientdata, module, "Integer overflow"); + return ((tmsize_t)(-1)); + } + if (size != (tmsize_t)(-1) && size < bytecountm) + bytecountm = size; + return (TIFFReadRawStrip1(tif, strip, buf, bytecountm, module)); +} + +/* + * Read the specified strip and setup for decoding. The data buffer is + * expanded, as necessary, to hold the strip's data. + */ +int +TIFFFillStrip(TIFF* tif, uint32 strip) +{ + static const char module[] = "TIFFFillStrip"; + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + + if ((tif->tif_flags&TIFF_NOREADRAW)==0) + { + uint64 bytecount = td->td_stripbytecount[strip]; + if (bytecount <= 0) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Invalid strip byte count %I64u, strip %lu", + (unsigned __int64) bytecount, + (unsigned long) strip); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Invalid strip byte count %llu, strip %lu", + (unsigned long long) bytecount, + (unsigned long) strip); +#endif + return (0); + } + if (isMapped(tif) && + (isFillOrder(tif, td->td_fillorder) + || (tif->tif_flags & TIFF_NOBITREV))) { + /* + * The image is mapped into memory and we either don't + * need to flip bits or the compression routine is + * going to handle this operation itself. In this + * case, avoid copying the raw data and instead just + * reference the data from the memory mapped file + * image. This assumes that the decompression + * routines do not modify the contents of the raw data + * buffer (if they try to, the application will get a + * fault since the file is mapped read-only). + */ + if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { + _TIFFfree(tif->tif_rawdata); + tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; + } + tif->tif_flags &= ~TIFF_MYBUFFER; + /* + * We must check for overflow, potentially causing + * an OOB read. Instead of simple + * + * td->td_stripoffset[strip]+bytecount > tif->tif_size + * + * comparison (which can overflow) we do the following + * two comparisons: + */ + if (bytecount > (uint64)tif->tif_size || + td->td_stripoffset[strip] > (uint64)tif->tif_size - bytecount) { + /* + * This error message might seem strange, but + * it's what would happen if a read were done + * instead. + */ +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + + "Read error on strip %lu; " + "got %I64u bytes, expected %I64u", + (unsigned long) strip, + (unsigned __int64) tif->tif_size - td->td_stripoffset[strip], + (unsigned __int64) bytecount); +#else + TIFFErrorExt(tif->tif_clientdata, module, + + "Read error on strip %lu; " + "got %llu bytes, expected %llu", + (unsigned long) strip, + (unsigned long long) tif->tif_size - td->td_stripoffset[strip], + (unsigned long long) bytecount); +#endif + tif->tif_curstrip = NOSTRIP; + return (0); + } + tif->tif_rawdatasize = (tmsize_t)bytecount; + tif->tif_rawdata = tif->tif_base + (tmsize_t)td->td_stripoffset[strip]; + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = (tmsize_t) bytecount; + + /* + * When we have tif_rawdata reference directly into the memory mapped file + * we need to be pretty careful about how we use the rawdata. It is not + * a general purpose working buffer as it normally otherwise is. So we + * keep track of this fact to avoid using it improperly. + */ + tif->tif_flags |= TIFF_BUFFERMMAP; + } else { + /* + * Expand raw data buffer, if needed, to hold data + * strip coming from file (perhaps should set upper + * bound on the size of a buffer we'll use?). + */ + tmsize_t bytecountm; + bytecountm=(tmsize_t)bytecount; + if ((uint64)bytecountm!=bytecount) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + return(0); + } + if (bytecountm > tif->tif_rawdatasize) { + tif->tif_curstrip = NOSTRIP; + if ((tif->tif_flags & TIFF_MYBUFFER) == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Data buffer too small to hold strip %lu", + (unsigned long) strip); + return (0); + } + if (!TIFFReadBufferSetup(tif, 0, bytecountm)) + return (0); + } + if (tif->tif_flags&TIFF_BUFFERMMAP) { + tif->tif_curstrip = NOSTRIP; + if (!TIFFReadBufferSetup(tif, 0, bytecountm)) + return (0); + } + if (TIFFReadRawStrip1(tif, strip, tif->tif_rawdata, + bytecountm, module) != bytecountm) + return (0); + + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = bytecountm; + + if (!isFillOrder(tif, td->td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) + TIFFReverseBits(tif->tif_rawdata, bytecountm); + } + } + return (TIFFStartStrip(tif, strip)); +} + +/* + * Tile-oriented Read Support + * Contributed by Nancy Cam (Silicon Graphics). + */ + +/* + * Read and decompress a tile of data. The + * tile is selected by the (x,y,z,s) coordinates. + */ +tmsize_t +TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s) +{ + if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s)) + return ((tmsize_t)(-1)); + return (TIFFReadEncodedTile(tif, + TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1))); +} + +/* + * Read a tile of data and decompress the specified + * amount into the user-supplied buffer. + */ +tmsize_t +TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size) +{ + static const char module[] = "TIFFReadEncodedTile"; + TIFFDirectory *td = &tif->tif_dir; + tmsize_t tilesize = tif->tif_tilesize; + + if (!TIFFCheckRead(tif, 1)) + return ((tmsize_t)(-1)); + if (tile >= td->td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, + "%lu: Tile out of range, max %lu", + (unsigned long) tile, (unsigned long) td->td_nstrips); + return ((tmsize_t)(-1)); + } + if (size == (tmsize_t)(-1)) + size = tilesize; + else if (size > tilesize) + size = tilesize; + if (TIFFFillTile(tif, tile) && (*tif->tif_decodetile)(tif, + (uint8*) buf, size, (uint16)(tile/td->td_stripsperimage))) { + (*tif->tif_postdecode)(tif, (uint8*) buf, size); + return (size); + } else + return ((tmsize_t)(-1)); +} + +static tmsize_t +TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif )) + return ((tmsize_t)(-1)); + + assert((tif->tif_flags&TIFF_NOREADRAW)==0); + if (!isMapped(tif)) { + tmsize_t cc; + + if (!SeekOK(tif, td->td_stripoffset[tile])) { + TIFFErrorExt(tif->tif_clientdata, module, + "Seek error at row %lu, col %lu, tile %lu", + (unsigned long) tif->tif_row, + (unsigned long) tif->tif_col, + (unsigned long) tile); + return ((tmsize_t)(-1)); + } + cc = TIFFReadFile(tif, buf, size); + if (cc != size) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at row %lu, col %lu; got %I64u bytes, expected %I64u", + (unsigned long) tif->tif_row, + (unsigned long) tif->tif_col, + (unsigned __int64) cc, + (unsigned __int64) size); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "Read error at row %lu, col %lu; got %llu bytes, expected %llu", + (unsigned long) tif->tif_row, + (unsigned long) tif->tif_col, + (unsigned long long) cc, + (unsigned long long) size); +#endif + return ((tmsize_t)(-1)); + } + } else { + tmsize_t ma,mb; + tmsize_t n; + ma=(tmsize_t)td->td_stripoffset[tile]; + mb=ma+size; + if (((uint64)ma!=td->td_stripoffset[tile])||(ma>tif->tif_size)) + n=0; + else if ((mbtif->tif_size)) + n=tif->tif_size-ma; + else + n=size; + if (n!=size) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, +"Read error at row %lu, col %lu, tile %lu; got %I64u bytes, expected %I64u", + (unsigned long) tif->tif_row, + (unsigned long) tif->tif_col, + (unsigned long) tile, + (unsigned __int64) n, + (unsigned __int64) size); +#else + TIFFErrorExt(tif->tif_clientdata, module, +"Read error at row %lu, col %lu, tile %lu; got %llu bytes, expected %llu", + (unsigned long) tif->tif_row, + (unsigned long) tif->tif_col, + (unsigned long) tile, + (unsigned long long) n, + (unsigned long long) size); +#endif + return ((tmsize_t)(-1)); + } + _TIFFmemcpy(buf, tif->tif_base + ma, size); + } + return (size); +} + +/* + * Read a tile of data from the file. + */ +tmsize_t +TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size) +{ + static const char module[] = "TIFFReadRawTile"; + TIFFDirectory *td = &tif->tif_dir; + uint64 bytecount64; + tmsize_t bytecountm; + + if (!TIFFCheckRead(tif, 1)) + return ((tmsize_t)(-1)); + if (tile >= td->td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, + "%lu: Tile out of range, max %lu", + (unsigned long) tile, (unsigned long) td->td_nstrips); + return ((tmsize_t)(-1)); + } + if (tif->tif_flags&TIFF_NOREADRAW) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Compression scheme does not support access to raw uncompressed data"); + return ((tmsize_t)(-1)); + } + bytecount64 = td->td_stripbytecount[tile]; + if (size != (tmsize_t)(-1) && (uint64)size < bytecount64) + bytecount64 = (uint64)size; + bytecountm = (tmsize_t)bytecount64; + if ((uint64)bytecountm!=bytecount64) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + return ((tmsize_t)(-1)); + } + return (TIFFReadRawTile1(tif, tile, buf, bytecountm, module)); +} + +/* + * Read the specified tile and setup for decoding. The data buffer is + * expanded, as necessary, to hold the tile's data. + */ +int +TIFFFillTile(TIFF* tif, uint32 tile) +{ + static const char module[] = "TIFFFillTile"; + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + + if ((tif->tif_flags&TIFF_NOREADRAW)==0) + { + uint64 bytecount = td->td_stripbytecount[tile]; + if (bytecount <= 0) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "%I64u: Invalid tile byte count, tile %lu", + (unsigned __int64) bytecount, + (unsigned long) tile); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "%llu: Invalid tile byte count, tile %lu", + (unsigned long long) bytecount, + (unsigned long) tile); +#endif + return (0); + } + if (isMapped(tif) && + (isFillOrder(tif, td->td_fillorder) + || (tif->tif_flags & TIFF_NOBITREV))) { + /* + * The image is mapped into memory and we either don't + * need to flip bits or the compression routine is + * going to handle this operation itself. In this + * case, avoid copying the raw data and instead just + * reference the data from the memory mapped file + * image. This assumes that the decompression + * routines do not modify the contents of the raw data + * buffer (if they try to, the application will get a + * fault since the file is mapped read-only). + */ + if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { + _TIFFfree(tif->tif_rawdata); + tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; + } + tif->tif_flags &= ~TIFF_MYBUFFER; + /* + * We must check for overflow, potentially causing + * an OOB read. Instead of simple + * + * td->td_stripoffset[tile]+bytecount > tif->tif_size + * + * comparison (which can overflow) we do the following + * two comparisons: + */ + if (bytecount > (uint64)tif->tif_size || + td->td_stripoffset[tile] > (uint64)tif->tif_size - bytecount) { + tif->tif_curtile = NOTILE; + return (0); + } + tif->tif_rawdatasize = (tmsize_t)bytecount; + tif->tif_rawdata = + tif->tif_base + (tmsize_t)td->td_stripoffset[tile]; + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = (tmsize_t) bytecount; + tif->tif_flags |= TIFF_BUFFERMMAP; + } else { + /* + * Expand raw data buffer, if needed, to hold data + * tile coming from file (perhaps should set upper + * bound on the size of a buffer we'll use?). + */ + tmsize_t bytecountm; + bytecountm=(tmsize_t)bytecount; + if ((uint64)bytecountm!=bytecount) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + return(0); + } + if (bytecountm > tif->tif_rawdatasize) { + tif->tif_curtile = NOTILE; + if ((tif->tif_flags & TIFF_MYBUFFER) == 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Data buffer too small to hold tile %lu", + (unsigned long) tile); + return (0); + } + if (!TIFFReadBufferSetup(tif, 0, bytecountm)) + return (0); + } + if (tif->tif_flags&TIFF_BUFFERMMAP) { + tif->tif_curtile = NOTILE; + if (!TIFFReadBufferSetup(tif, 0, bytecountm)) + return (0); + } + + if (TIFFReadRawTile1(tif, tile, tif->tif_rawdata, + bytecountm, module) != bytecountm) + return (0); + + tif->tif_rawdataoff = 0; + tif->tif_rawdataloaded = bytecountm; + + if (!isFillOrder(tif, td->td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) + TIFFReverseBits(tif->tif_rawdata, + tif->tif_rawdataloaded); + } + } + return (TIFFStartTile(tif, tile)); +} + +/* + * Setup the raw data buffer in preparation for + * reading a strip of raw data. If the buffer + * is specified as zero, then a buffer of appropriate + * size is allocated by the library. Otherwise, + * the client must guarantee that the buffer is + * large enough to hold any individual strip of + * raw data. + */ +int +TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size) +{ + static const char module[] = "TIFFReadBufferSetup"; + + assert((tif->tif_flags&TIFF_NOREADRAW)==0); + tif->tif_flags &= ~TIFF_BUFFERMMAP; + + if (tif->tif_rawdata) { + if (tif->tif_flags & TIFF_MYBUFFER) + _TIFFfree(tif->tif_rawdata); + tif->tif_rawdata = NULL; + tif->tif_rawdatasize = 0; + } + if (bp) { + tif->tif_rawdatasize = size; + tif->tif_rawdata = (uint8*) bp; + tif->tif_flags &= ~TIFF_MYBUFFER; + } else { + tif->tif_rawdatasize = (tmsize_t)TIFFroundup_64((uint64)size, 1024); + if (tif->tif_rawdatasize==0) + tif->tif_rawdatasize=(tmsize_t)(-1); + tif->tif_rawdata = (uint8*) _TIFFmalloc(tif->tif_rawdatasize); + tif->tif_flags |= TIFF_MYBUFFER; + } + if (tif->tif_rawdata == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, + "No space for data buffer at scanline %lu", + (unsigned long) tif->tif_row); + tif->tif_rawdatasize = 0; + return (0); + } + return (1); +} + +/* + * Set state to appear as if a + * strip has just been read in. + */ +static int +TIFFStartStrip(TIFF* tif, uint32 strip) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + + if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { + if (!(*tif->tif_setupdecode)(tif)) + return (0); + tif->tif_flags |= TIFF_CODERSETUP; + } + tif->tif_curstrip = strip; + tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; + tif->tif_flags &= ~TIFF_BUF4WRITE; + + if (tif->tif_flags&TIFF_NOREADRAW) + { + tif->tif_rawcp = NULL; + tif->tif_rawcc = 0; + } + else + { + tif->tif_rawcp = tif->tif_rawdata; + tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[strip]; + } + return ((*tif->tif_predecode)(tif, + (uint16)(strip / td->td_stripsperimage))); +} + +/* + * Set state to appear as if a + * tile has just been read in. + */ +static int +TIFFStartTile(TIFF* tif, uint32 tile) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (!_TIFFFillStriles( tif ) || !tif->tif_dir.td_stripbytecount) + return 0; + + if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { + if (!(*tif->tif_setupdecode)(tif)) + return (0); + tif->tif_flags |= TIFF_CODERSETUP; + } + tif->tif_curtile = tile; + tif->tif_row = + (tile % TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth)) * + td->td_tilelength; + tif->tif_col = + (tile % TIFFhowmany_32(td->td_imagelength, td->td_tilelength)) * + td->td_tilewidth; + tif->tif_flags &= ~TIFF_BUF4WRITE; + if (tif->tif_flags&TIFF_NOREADRAW) + { + tif->tif_rawcp = NULL; + tif->tif_rawcc = 0; + } + else + { + tif->tif_rawcp = tif->tif_rawdata; + tif->tif_rawcc = (tmsize_t)td->td_stripbytecount[tile]; + } + return ((*tif->tif_predecode)(tif, + (uint16)(tile/td->td_stripsperimage))); +} + +static int +TIFFCheckRead(TIFF* tif, int tiles) +{ + if (tif->tif_mode == O_WRONLY) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "File not open for reading"); + return (0); + } + if (tiles ^ isTiled(tif)) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, tiles ? + "Can not read tiles from a stripped image" : + "Can not read scanlines from a tiled image"); + return (0); + } + return (1); +} + +void +_TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc) +{ + (void) tif; (void) buf; (void) cc; +} + +void +_TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc) +{ + (void) tif; + assert((cc & 1) == 0); + TIFFSwabArrayOfShort((uint16*) buf, cc/2); +} + +void +_TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc) +{ + (void) tif; + assert((cc % 3) == 0); + TIFFSwabArrayOfTriples((uint8*) buf, cc/3); +} + +void +_TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc) +{ + (void) tif; + assert((cc & 3) == 0); + TIFFSwabArrayOfLong((uint32*) buf, cc/4); +} + +void +_TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc) +{ + (void) tif; + assert((cc & 7) == 0); + TIFFSwabArrayOfDouble((double*) buf, cc/8); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_stream.cxx b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_stream.cxx new file mode 100644 index 0000000..163447e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_stream.cxx @@ -0,0 +1,425 @@ +/* $Id: tif_stream.cxx,v 1.11 2010-12-11 23:12:29 faxguy Exp $ */ + +/* + * Copyright (c) 1988-1996 Sam Leffler + * Copyright (c) 1991-1996 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library UNIX-specific Routines. + */ +#include "tiffiop.h" +#include + +#ifndef __VMS +using namespace std; +#endif + +/* + ISO C++ uses a 'std::streamsize' type to define counts. This makes + it similar to, (but perhaps not the same as) size_t. + + The std::ios::pos_type is used to represent stream positions as used + by tellg(), tellp(), seekg(), and seekp(). This makes it similar to + (but perhaps not the same as) 'off_t'. The std::ios::streampos type + is used for character streams, but is documented to not be an + integral type anymore, so it should *not* be assigned to an integral + type. + + The std::ios::off_type is used to specify relative offsets needed by + the variants of seekg() and seekp() which accept a relative offset + argument. + + Useful prototype knowledge: + + Obtain read position + ios::pos_type basic_istream::tellg() + + Set read position + basic_istream& basic_istream::seekg(ios::pos_type) + basic_istream& basic_istream::seekg(ios::off_type, ios_base::seekdir) + + Read data + basic_istream& istream::read(char *str, streamsize count) + + Number of characters read in last unformatted read + streamsize istream::gcount(); + + Obtain write position + ios::pos_type basic_ostream::tellp() + + Set write position + basic_ostream& basic_ostream::seekp(ios::pos_type) + basic_ostream& basic_ostream::seekp(ios::off_type, ios_base::seekdir) + + Write data + basic_ostream& ostream::write(const char *str, streamsize count) +*/ + +struct tiffis_data; +struct tiffos_data; + +extern "C" { + + static tmsize_t _tiffosReadProc(thandle_t, void*, tmsize_t); + static tmsize_t _tiffisReadProc(thandle_t fd, void* buf, tmsize_t size); + static tmsize_t _tiffosWriteProc(thandle_t fd, void* buf, tmsize_t size); + static tmsize_t _tiffisWriteProc(thandle_t, void*, tmsize_t); + static uint64 _tiffosSeekProc(thandle_t fd, uint64 off, int whence); + static uint64 _tiffisSeekProc(thandle_t fd, uint64 off, int whence); + static uint64 _tiffosSizeProc(thandle_t fd); + static uint64 _tiffisSizeProc(thandle_t fd); + static int _tiffosCloseProc(thandle_t fd); + static int _tiffisCloseProc(thandle_t fd); + static int _tiffDummyMapProc(thandle_t , void** base, toff_t* size ); + static void _tiffDummyUnmapProc(thandle_t , void* base, toff_t size ); + static TIFF* _tiffStreamOpen(const char* name, const char* mode, void *fd); + +struct tiffis_data +{ + istream *stream; + ios::pos_type start_pos; +}; + +struct tiffos_data +{ + ostream *stream; + ios::pos_type start_pos; +}; + +static tmsize_t +_tiffosReadProc(thandle_t, void*, tmsize_t) +{ + return 0; +} + +static tmsize_t +_tiffisReadProc(thandle_t fd, void* buf, tmsize_t size) +{ + tiffis_data *data = reinterpret_cast(fd); + + // Verify that type does not overflow. + streamsize request_size = size; + if (static_cast(request_size) != size) + return static_cast(-1); + + data->stream->read((char *) buf, request_size); + + return static_cast(data->stream->gcount()); +} + +static tmsize_t +_tiffosWriteProc(thandle_t fd, void* buf, tmsize_t size) +{ + tiffos_data *data = reinterpret_cast(fd); + ostream *os = data->stream; + ios::pos_type pos = os->tellp(); + + // Verify that type does not overflow. + streamsize request_size = size; + if (static_cast(request_size) != size) + return static_cast(-1); + + os->write(reinterpret_cast(buf), request_size); + + return static_cast(os->tellp() - pos); +} + +static tmsize_t +_tiffisWriteProc(thandle_t, void*, tmsize_t) +{ + return 0; +} + +static uint64 +_tiffosSeekProc(thandle_t fd, uint64 off, int whence) +{ + tiffos_data *data = reinterpret_cast(fd); + ostream *os = data->stream; + + // if the stream has already failed, don't do anything + if( os->fail() ) + return static_cast(-1); + + switch(whence) { + case SEEK_SET: + { + // Compute 64-bit offset + uint64 new_offset = static_cast(data->start_pos) + off; + + // Verify that value does not overflow + ios::off_type offset = static_cast(new_offset); + if (static_cast(offset) != new_offset) + return static_cast(-1); + + os->seekp(offset, ios::beg); + break; + } + case SEEK_CUR: + { + // Verify that value does not overflow + ios::off_type offset = static_cast(off); + if (static_cast(offset) != off) + return static_cast(-1); + + os->seekp(offset, ios::cur); + break; + } + case SEEK_END: + { + // Verify that value does not overflow + ios::off_type offset = static_cast(off); + if (static_cast(offset) != off) + return static_cast(-1); + + os->seekp(offset, ios::end); + break; + } + } + + // Attempt to workaround problems with seeking past the end of the + // stream. ofstream doesn't have a problem with this but + // ostrstream/ostringstream does. In that situation, add intermediate + // '\0' characters. + if( os->fail() ) { +#ifdef __VMS + int old_state; +#else + ios::iostate old_state; +#endif + ios::pos_type origin; + + old_state = os->rdstate(); + // reset the fail bit or else tellp() won't work below + os->clear(os->rdstate() & ~ios::failbit); + switch( whence ) { + case SEEK_SET: + default: + origin = data->start_pos; + break; + case SEEK_CUR: + origin = os->tellp(); + break; + case SEEK_END: + os->seekp(0, ios::end); + origin = os->tellp(); + break; + } + // restore original stream state + os->clear(old_state); + + // only do something if desired seek position is valid + if( (static_cast(origin) + off) > static_cast(data->start_pos) ) { + uint64 num_fill; + + // clear the fail bit + os->clear(os->rdstate() & ~ios::failbit); + + // extend the stream to the expected size + os->seekp(0, ios::end); + num_fill = (static_cast(origin)) + off - os->tellp(); + for( uint64 i = 0; i < num_fill; i++ ) + os->put('\0'); + + // retry the seek + os->seekp(static_cast(static_cast(origin) + off), ios::beg); + } + } + + return static_cast(os->tellp()); +} + +static uint64 +_tiffisSeekProc(thandle_t fd, uint64 off, int whence) +{ + tiffis_data *data = reinterpret_cast(fd); + + switch(whence) { + case SEEK_SET: + { + // Compute 64-bit offset + uint64 new_offset = static_cast(data->start_pos) + off; + + // Verify that value does not overflow + ios::off_type offset = static_cast(new_offset); + if (static_cast(offset) != new_offset) + return static_cast(-1); + + data->stream->seekg(offset, ios::beg); + break; + } + case SEEK_CUR: + { + // Verify that value does not overflow + ios::off_type offset = static_cast(off); + if (static_cast(offset) != off) + return static_cast(-1); + + data->stream->seekg(offset, ios::cur); + break; + } + case SEEK_END: + { + // Verify that value does not overflow + ios::off_type offset = static_cast(off); + if (static_cast(offset) != off) + return static_cast(-1); + + data->stream->seekg(offset, ios::end); + break; + } + } + + return (uint64) (data->stream->tellg() - data->start_pos); +} + +static uint64 +_tiffosSizeProc(thandle_t fd) +{ + tiffos_data *data = reinterpret_cast(fd); + ostream *os = data->stream; + ios::pos_type pos = os->tellp(); + ios::pos_type len; + + os->seekp(0, ios::end); + len = os->tellp(); + os->seekp(pos); + + return (uint64) len; +} + +static uint64 +_tiffisSizeProc(thandle_t fd) +{ + tiffis_data *data = reinterpret_cast(fd); + ios::pos_type pos = data->stream->tellg(); + ios::pos_type len; + + data->stream->seekg(0, ios::end); + len = data->stream->tellg(); + data->stream->seekg(pos); + + return (uint64) len; +} + +static int +_tiffosCloseProc(thandle_t fd) +{ + // Our stream was not allocated by us, so it shouldn't be closed by us. + delete reinterpret_cast(fd); + return 0; +} + +static int +_tiffisCloseProc(thandle_t fd) +{ + // Our stream was not allocated by us, so it shouldn't be closed by us. + delete reinterpret_cast(fd); + return 0; +} + +static int +_tiffDummyMapProc(thandle_t , void** base, toff_t* size ) +{ + return (0); +} + +static void +_tiffDummyUnmapProc(thandle_t , void* base, toff_t size ) +{ +} + +/* + * Open a TIFF file descriptor for read/writing. + */ +static TIFF* +_tiffStreamOpen(const char* name, const char* mode, void *fd) +{ + TIFF* tif; + + if( strchr(mode, 'w') ) { + tiffos_data *data = new tiffos_data; + data->stream = reinterpret_cast(fd); + data->start_pos = data->stream->tellp(); + + // Open for writing. + tif = TIFFClientOpen(name, mode, + reinterpret_cast(data), + _tiffosReadProc, + _tiffosWriteProc, + _tiffosSeekProc, + _tiffosCloseProc, + _tiffosSizeProc, + _tiffDummyMapProc, + _tiffDummyUnmapProc); + } else { + tiffis_data *data = new tiffis_data; + data->stream = reinterpret_cast(fd); + data->start_pos = data->stream->tellg(); + // Open for reading. + tif = TIFFClientOpen(name, mode, + reinterpret_cast(data), + _tiffisReadProc, + _tiffisWriteProc, + _tiffisSeekProc, + _tiffisCloseProc, + _tiffisSizeProc, + _tiffDummyMapProc, + _tiffDummyUnmapProc); + } + + return (tif); +} + +} /* extern "C" */ + +TIFF* +TIFFStreamOpen(const char* name, ostream *os) +{ + // If os is either a ostrstream or ostringstream, and has no data + // written to it yet, then tellp() will return -1 which will break us. + // We workaround this by writing out a dummy character and + // then seek back to the beginning. + if( !os->fail() && static_cast(os->tellp()) < 0 ) { + *os << '\0'; + os->seekp(0); + } + + // NB: We don't support mapped files with streams so add 'm' + return _tiffStreamOpen(name, "wm", os); +} + +TIFF* +TIFFStreamOpen(const char* name, istream *is) +{ + // NB: We don't support mapped files with streams so add 'm' + return _tiffStreamOpen(name, "rm", is); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + Local Variables: + mode: c + indent-tabs-mode: true + c-basic-offset: 8 + End: +*/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_strip.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_strip.c new file mode 100644 index 0000000..568e489 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_strip.c @@ -0,0 +1,383 @@ +/* $Id: tif_strip.c,v 1.35 2012-06-06 05:33:55 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Strip-organized Image Support Routines. + */ +#include "tiffiop.h" + +/* + * Compute which strip a (row,sample) value is in. + */ +uint32 +TIFFComputeStrip(TIFF* tif, uint32 row, uint16 sample) +{ + static const char module[] = "TIFFComputeStrip"; + TIFFDirectory *td = &tif->tif_dir; + uint32 strip; + + strip = row / td->td_rowsperstrip; + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + if (sample >= td->td_samplesperpixel) { + TIFFErrorExt(tif->tif_clientdata, module, + "%lu: Sample out of range, max %lu", + (unsigned long) sample, (unsigned long) td->td_samplesperpixel); + return (0); + } + strip += (uint32)sample*td->td_stripsperimage; + } + return (strip); +} + +/* + * Compute how many strips are in an image. + */ +uint32 +TIFFNumberOfStrips(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + uint32 nstrips; + + nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 : + TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip)); + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel, + "TIFFNumberOfStrips"); + return (nstrips); +} + +/* + * Compute the # bytes in a variable height, row-aligned strip. + */ +uint64 +TIFFVStripSize64(TIFF* tif, uint32 nrows) +{ + static const char module[] = "TIFFVStripSize64"; + TIFFDirectory *td = &tif->tif_dir; + if (nrows==(uint32)(-1)) + nrows=td->td_imagelength; + if ((td->td_planarconfig==PLANARCONFIG_CONTIG)&& + (td->td_photometric == PHOTOMETRIC_YCBCR)&& + (!isUpSampled(tif))) + { + /* + * Packed YCbCr data contain one Cb+Cr for every + * HorizontalSampling*VerticalSampling Y values. + * Must also roundup width and height when calculating + * since images that are not a multiple of the + * horizontal/vertical subsampling area include + * YCbCr data for the extended image. + */ + uint16 ycbcrsubsampling[2]; + uint16 samplingblock_samples; + uint32 samplingblocks_hor; + uint32 samplingblocks_ver; + uint64 samplingrow_samples; + uint64 samplingrow_size; + if(td->td_samplesperpixel!=3) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Invalid td_samplesperpixel value"); + return 0; + } + TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING,ycbcrsubsampling+0, + ycbcrsubsampling+1); + if ((ycbcrsubsampling[0] != 1 && ycbcrsubsampling[0] != 2 && ycbcrsubsampling[0] != 4) + ||(ycbcrsubsampling[1] != 1 && ycbcrsubsampling[1] != 2 && ycbcrsubsampling[1] != 4)) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Invalid YCbCr subsampling (%dx%d)", + ycbcrsubsampling[0], + ycbcrsubsampling[1] ); + return 0; + } + samplingblock_samples=ycbcrsubsampling[0]*ycbcrsubsampling[1]+2; + samplingblocks_hor=TIFFhowmany_32(td->td_imagewidth,ycbcrsubsampling[0]); + samplingblocks_ver=TIFFhowmany_32(nrows,ycbcrsubsampling[1]); + samplingrow_samples=_TIFFMultiply64(tif,samplingblocks_hor,samplingblock_samples,module); + samplingrow_size=TIFFhowmany8_64(_TIFFMultiply64(tif,samplingrow_samples,td->td_bitspersample,module)); + return(_TIFFMultiply64(tif,samplingrow_size,samplingblocks_ver,module)); + } + else + return(_TIFFMultiply64(tif,nrows,TIFFScanlineSize64(tif),module)); +} +tmsize_t +TIFFVStripSize(TIFF* tif, uint32 nrows) +{ + static const char module[] = "TIFFVStripSize"; + uint64 m; + tmsize_t n; + m=TIFFVStripSize64(tif,nrows); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + return(n); +} + +/* + * Compute the # bytes in a raw strip. + */ +uint64 +TIFFRawStripSize64(TIFF* tif, uint32 strip) +{ + static const char module[] = "TIFFRawStripSize64"; + TIFFDirectory* td = &tif->tif_dir; + uint64 bytecount = td->td_stripbytecount[strip]; + + if (bytecount == 0) + { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "%I64u: Invalid strip byte count, strip %lu", + (unsigned __int64) bytecount, + (unsigned long) strip); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "%llu: Invalid strip byte count, strip %lu", + (unsigned long long) bytecount, + (unsigned long) strip); +#endif + bytecount = (uint64) -1; + } + + return bytecount; +} +tmsize_t +TIFFRawStripSize(TIFF* tif, uint32 strip) +{ + static const char module[] = "TIFFRawStripSize"; + uint64 m; + tmsize_t n; + m=TIFFRawStripSize64(tif,strip); + if (m==(uint64)(-1)) + n=(tmsize_t)(-1); + else + { + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + } + return(n); +} + +/* + * Compute the # bytes in a (row-aligned) strip. + * + * Note that if RowsPerStrip is larger than the + * recorded ImageLength, then the strip size is + * truncated to reflect the actual space required + * to hold the strip. + */ +uint64 +TIFFStripSize64(TIFF* tif) +{ + TIFFDirectory* td = &tif->tif_dir; + uint32 rps = td->td_rowsperstrip; + if (rps > td->td_imagelength) + rps = td->td_imagelength; + return (TIFFVStripSize64(tif, rps)); +} +tmsize_t +TIFFStripSize(TIFF* tif) +{ + static const char module[] = "TIFFStripSize"; + uint64 m; + tmsize_t n; + m=TIFFStripSize64(tif); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + return(n); +} + +/* + * Compute a default strip size based on the image + * characteristics and a requested value. If the + * request is <1 then we choose a strip size according + * to certain heuristics. + */ +uint32 +TIFFDefaultStripSize(TIFF* tif, uint32 request) +{ + return (*tif->tif_defstripsize)(tif, request); +} + +uint32 +_TIFFDefaultStripSize(TIFF* tif, uint32 s) +{ + if ((int32) s < 1) { + /* + * If RowsPerStrip is unspecified, try to break the + * image up into strips that are approximately + * STRIP_SIZE_DEFAULT bytes long. + */ + uint64 scanlinesize; + uint64 rows; + scanlinesize=TIFFScanlineSize64(tif); + if (scanlinesize==0) + scanlinesize=1; + rows=(uint64)STRIP_SIZE_DEFAULT/scanlinesize; + if (rows==0) + rows=1; + else if (rows>0xFFFFFFFF) + rows=0xFFFFFFFF; + s=(uint32)rows; + } + return (s); +} + +/* + * Return the number of bytes to read/write in a call to + * one of the scanline-oriented i/o routines. Note that + * this number may be 1/samples-per-pixel if data is + * stored as separate planes. + * The ScanlineSize in case of YCbCrSubsampling is defined as the + * strip size divided by the strip height, i.e. the size of a pack of vertical + * subsampling lines divided by vertical subsampling. It should thus make + * sense when multiplied by a multiple of vertical subsampling. + */ +uint64 +TIFFScanlineSize64(TIFF* tif) +{ + static const char module[] = "TIFFScanlineSize64"; + TIFFDirectory *td = &tif->tif_dir; + uint64 scanline_size; + if (td->td_planarconfig==PLANARCONFIG_CONTIG) + { + if ((td->td_photometric==PHOTOMETRIC_YCBCR)&& + (td->td_samplesperpixel==3)&& + (!isUpSampled(tif))) + { + uint16 ycbcrsubsampling[2]; + uint16 samplingblock_samples; + uint32 samplingblocks_hor; + uint64 samplingrow_samples; + uint64 samplingrow_size; + if(td->td_samplesperpixel!=3) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Invalid td_samplesperpixel value"); + return 0; + } + TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING, + ycbcrsubsampling+0, + ycbcrsubsampling+1); + if (((ycbcrsubsampling[0]!=1)&&(ycbcrsubsampling[0]!=2)&&(ycbcrsubsampling[0]!=4)) || + ((ycbcrsubsampling[1]!=1)&&(ycbcrsubsampling[1]!=2)&&(ycbcrsubsampling[1]!=4))) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Invalid YCbCr subsampling"); + return 0; + } + samplingblock_samples = ycbcrsubsampling[0]*ycbcrsubsampling[1]+2; + samplingblocks_hor = TIFFhowmany_32(td->td_imagewidth,ycbcrsubsampling[0]); + samplingrow_samples = _TIFFMultiply64(tif,samplingblocks_hor,samplingblock_samples,module); + samplingrow_size = TIFFhowmany_64(_TIFFMultiply64(tif,samplingrow_samples,td->td_bitspersample,module),8); + scanline_size = (samplingrow_size/ycbcrsubsampling[1]); + } + else + { + uint64 scanline_samples; + scanline_samples=_TIFFMultiply64(tif,td->td_imagewidth,td->td_samplesperpixel,module); + scanline_size=TIFFhowmany_64(_TIFFMultiply64(tif,scanline_samples,td->td_bitspersample,module),8); + } + } + else + scanline_size=TIFFhowmany_64(_TIFFMultiply64(tif,td->td_imagewidth,td->td_bitspersample,module),8); + return(scanline_size); +} +tmsize_t +TIFFScanlineSize(TIFF* tif) +{ + static const char module[] = "TIFFScanlineSize"; + uint64 m; + tmsize_t n; + m=TIFFScanlineSize64(tif); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow"); + n=0; + } + return(n); +} + +/* + * Return the number of bytes required to store a complete + * decoded and packed raster scanline (as opposed to the + * I/O size returned by TIFFScanlineSize which may be less + * if data is store as separate planes). + */ +uint64 +TIFFRasterScanlineSize64(TIFF* tif) +{ + static const char module[] = "TIFFRasterScanlineSize64"; + TIFFDirectory *td = &tif->tif_dir; + uint64 scanline; + + scanline = _TIFFMultiply64(tif, td->td_bitspersample, td->td_imagewidth, module); + if (td->td_planarconfig == PLANARCONFIG_CONTIG) { + scanline = _TIFFMultiply64(tif, scanline, td->td_samplesperpixel, module); + return (TIFFhowmany8_64(scanline)); + } else + return (_TIFFMultiply64(tif, TIFFhowmany8_64(scanline), + td->td_samplesperpixel, module)); +} +tmsize_t +TIFFRasterScanlineSize(TIFF* tif) +{ + static const char module[] = "TIFFRasterScanlineSize"; + uint64 m; + tmsize_t n; + m=TIFFRasterScanlineSize64(tif); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow"); + n=0; + } + return(n); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_swab.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_swab.c new file mode 100644 index 0000000..f37e33f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_swab.c @@ -0,0 +1,310 @@ +/* $Id: tif_swab.c,v 1.13 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library Bit & Byte Swapping Support. + * + * XXX We assume short = 16-bits and long = 32-bits XXX + */ +#include "tiffiop.h" + +#ifndef TIFFSwabShort +void +TIFFSwabShort(uint16* wp) +{ + register unsigned char* cp = (unsigned char*) wp; + unsigned char t; + assert(sizeof(uint16)==2); + t = cp[1]; cp[1] = cp[0]; cp[0] = t; +} +#endif + +#ifndef TIFFSwabLong +void +TIFFSwabLong(uint32* lp) +{ + register unsigned char* cp = (unsigned char*) lp; + unsigned char t; + assert(sizeof(uint32)==4); + t = cp[3]; cp[3] = cp[0]; cp[0] = t; + t = cp[2]; cp[2] = cp[1]; cp[1] = t; +} +#endif + +#ifndef TIFFSwabLong8 +void +TIFFSwabLong8(uint64* lp) +{ + register unsigned char* cp = (unsigned char*) lp; + unsigned char t; + assert(sizeof(uint64)==8); + t = cp[7]; cp[7] = cp[0]; cp[0] = t; + t = cp[6]; cp[6] = cp[1]; cp[1] = t; + t = cp[5]; cp[5] = cp[2]; cp[2] = t; + t = cp[4]; cp[4] = cp[3]; cp[3] = t; +} +#endif + +#ifndef TIFFSwabArrayOfShort +void +TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n) +{ + register unsigned char* cp; + register unsigned char t; + assert(sizeof(uint16)==2); + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char*) wp; + t = cp[1]; cp[1] = cp[0]; cp[0] = t; + wp++; + } +} +#endif + +#ifndef TIFFSwabArrayOfTriples +void +TIFFSwabArrayOfTriples(register uint8* tp, tmsize_t n) +{ + unsigned char* cp; + unsigned char t; + + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char*) tp; + t = cp[2]; cp[2] = cp[0]; cp[0] = t; + tp += 3; + } +} +#endif + +#ifndef TIFFSwabArrayOfLong +void +TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n) +{ + register unsigned char *cp; + register unsigned char t; + assert(sizeof(uint32)==4); + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char *)lp; + t = cp[3]; cp[3] = cp[0]; cp[0] = t; + t = cp[2]; cp[2] = cp[1]; cp[1] = t; + lp++; + } +} +#endif + +#ifndef TIFFSwabArrayOfLong8 +void +TIFFSwabArrayOfLong8(register uint64* lp, tmsize_t n) +{ + register unsigned char *cp; + register unsigned char t; + assert(sizeof(uint64)==8); + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char *)lp; + t = cp[7]; cp[7] = cp[0]; cp[0] = t; + t = cp[6]; cp[6] = cp[1]; cp[1] = t; + t = cp[5]; cp[5] = cp[2]; cp[2] = t; + t = cp[4]; cp[4] = cp[3]; cp[3] = t; + lp++; + } +} +#endif + +#ifndef TIFFSwabFloat +void +TIFFSwabFloat(float* fp) +{ + register unsigned char* cp = (unsigned char*) fp; + unsigned char t; + assert(sizeof(float)==4); + t = cp[3]; cp[3] = cp[0]; cp[0] = t; + t = cp[2]; cp[2] = cp[1]; cp[1] = t; +} +#endif + +#ifndef TIFFSwabArrayOfFloat +void +TIFFSwabArrayOfFloat(register float* fp, tmsize_t n) +{ + register unsigned char *cp; + register unsigned char t; + assert(sizeof(float)==4); + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char *)fp; + t = cp[3]; cp[3] = cp[0]; cp[0] = t; + t = cp[2]; cp[2] = cp[1]; cp[1] = t; + fp++; + } +} +#endif + +#ifndef TIFFSwabDouble +void +TIFFSwabDouble(double *dp) +{ + register unsigned char* cp = (unsigned char*) dp; + unsigned char t; + assert(sizeof(double)==8); + t = cp[7]; cp[7] = cp[0]; cp[0] = t; + t = cp[6]; cp[6] = cp[1]; cp[1] = t; + t = cp[5]; cp[5] = cp[2]; cp[2] = t; + t = cp[4]; cp[4] = cp[3]; cp[3] = t; +} +#endif + +#ifndef TIFFSwabArrayOfDouble +void +TIFFSwabArrayOfDouble(double* dp, tmsize_t n) +{ + register unsigned char *cp; + register unsigned char t; + assert(sizeof(double)==8); + /* XXX unroll loop some */ + while (n-- > 0) { + cp = (unsigned char *)dp; + t = cp[7]; cp[7] = cp[0]; cp[0] = t; + t = cp[6]; cp[6] = cp[1]; cp[1] = t; + t = cp[5]; cp[5] = cp[2]; cp[2] = t; + t = cp[4]; cp[4] = cp[3]; cp[3] = t; + dp++; + } +} +#endif + +/* + * Bit reversal tables. TIFFBitRevTable[] gives + * the bit reversed value of . Used in various + * places in the library when the FillOrder requires + * bit reversal of byte values (e.g. CCITT Fax 3 + * encoding/decoding). TIFFNoBitRevTable is provided + * for algorithms that want an equivalent table that + * do not reverse bit values. + */ +static const unsigned char TIFFBitRevTable[256] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff +}; +static const unsigned char TIFFNoBitRevTable[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, +}; + +const unsigned char* +TIFFGetBitRevTable(int reversed) +{ + return (reversed ? TIFFBitRevTable : TIFFNoBitRevTable); +} + +void +TIFFReverseBits(uint8* cp, tmsize_t n) +{ + for (; n > 8; n -= 8) { + cp[0] = TIFFBitRevTable[cp[0]]; + cp[1] = TIFFBitRevTable[cp[1]]; + cp[2] = TIFFBitRevTable[cp[2]]; + cp[3] = TIFFBitRevTable[cp[3]]; + cp[4] = TIFFBitRevTable[cp[4]]; + cp[5] = TIFFBitRevTable[cp[5]]; + cp[6] = TIFFBitRevTable[cp[6]]; + cp[7] = TIFFBitRevTable[cp[7]]; + cp += 8; + } + while (n-- > 0) + *cp = TIFFBitRevTable[*cp], cp++; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_thunder.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_thunder.c new file mode 100644 index 0000000..390891c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_thunder.c @@ -0,0 +1,207 @@ +/* $Id: tif_thunder.c,v 1.12 2011-04-02 20:54:09 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#include +#ifdef THUNDER_SUPPORT +/* + * TIFF Library. + * + * ThunderScan 4-bit Compression Algorithm Support + */ + +/* + * ThunderScan uses an encoding scheme designed for + * 4-bit pixel values. Data is encoded in bytes, with + * each byte split into a 2-bit code word and a 6-bit + * data value. The encoding gives raw data, runs of + * pixels, or pixel values encoded as a delta from the + * previous pixel value. For the latter, either 2-bit + * or 3-bit delta values are used, with the deltas packed + * into a single byte. + */ +#define THUNDER_DATA 0x3f /* mask for 6-bit data */ +#define THUNDER_CODE 0xc0 /* mask for 2-bit code word */ +/* code values */ +#define THUNDER_RUN 0x00 /* run of pixels w/ encoded count */ +#define THUNDER_2BITDELTAS 0x40 /* 3 pixels w/ encoded 2-bit deltas */ +#define DELTA2_SKIP 2 /* skip code for 2-bit deltas */ +#define THUNDER_3BITDELTAS 0x80 /* 2 pixels w/ encoded 3-bit deltas */ +#define DELTA3_SKIP 4 /* skip code for 3-bit deltas */ +#define THUNDER_RAW 0xc0 /* raw data encoded */ + +static const int twobitdeltas[4] = { 0, 1, 0, -1 }; +static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 }; + +#define SETPIXEL(op, v) { \ + lastpixel = (v) & 0xf; \ + if ( npixels < maxpixels ) \ + { \ + if (npixels++ & 1) \ + *op++ |= lastpixel; \ + else \ + op[0] = (uint8) (lastpixel << 4); \ + } \ +} + +static int +ThunderSetupDecode(TIFF* tif) +{ + static const char module[] = "ThunderSetupDecode"; + + if( tif->tif_dir.td_bitspersample != 4 ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Wrong bitspersample value (%d), Thunder decoder only supports 4bits per sample.", + (int) tif->tif_dir.td_bitspersample ); + return 0; + } + + + return (1); +} + +static int +ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels) +{ + static const char module[] = "ThunderDecode"; + register unsigned char *bp; + register tmsize_t cc; + unsigned int lastpixel; + tmsize_t npixels; + + bp = (unsigned char *)tif->tif_rawcp; + cc = tif->tif_rawcc; + lastpixel = 0; + npixels = 0; + while (cc > 0 && npixels < maxpixels) { + int n, delta; + + n = *bp++, cc--; + switch (n & THUNDER_CODE) { + case THUNDER_RUN: /* pixel run */ + /* + * Replicate the last pixel n times, + * where n is the lower-order 6 bits. + */ + if (npixels & 1) { + op[0] |= lastpixel; + lastpixel = *op++; npixels++; n--; + } else + lastpixel |= lastpixel << 4; + npixels += n; + if (npixels < maxpixels) { + for (; n > 0; n -= 2) + *op++ = (uint8) lastpixel; + } + if (n == -1) + *--op &= 0xf0; + lastpixel &= 0xf; + break; + case THUNDER_2BITDELTAS: /* 2-bit deltas */ + if ((delta = ((n >> 4) & 3)) != DELTA2_SKIP) + SETPIXEL(op, lastpixel + twobitdeltas[delta]); + if ((delta = ((n >> 2) & 3)) != DELTA2_SKIP) + SETPIXEL(op, lastpixel + twobitdeltas[delta]); + if ((delta = (n & 3)) != DELTA2_SKIP) + SETPIXEL(op, lastpixel + twobitdeltas[delta]); + break; + case THUNDER_3BITDELTAS: /* 3-bit deltas */ + if ((delta = ((n >> 3) & 7)) != DELTA3_SKIP) + SETPIXEL(op, lastpixel + threebitdeltas[delta]); + if ((delta = (n & 7)) != DELTA3_SKIP) + SETPIXEL(op, lastpixel + threebitdeltas[delta]); + break; + case THUNDER_RAW: /* raw data */ + SETPIXEL(op, n); + break; + } + } + tif->tif_rawcp = (uint8*) bp; + tif->tif_rawcc = cc; + if (npixels != maxpixels) { +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + TIFFErrorExt(tif->tif_clientdata, module, + "%s data at scanline %lu (%I64u != %I64u)", + npixels < maxpixels ? "Not enough" : "Too much", + (unsigned long) tif->tif_row, + (unsigned __int64) npixels, + (unsigned __int64) maxpixels); +#else + TIFFErrorExt(tif->tif_clientdata, module, + "%s data at scanline %lu (%llu != %llu)", + npixels < maxpixels ? "Not enough" : "Too much", + (unsigned long) tif->tif_row, + (unsigned long long) npixels, + (unsigned long long) maxpixels); +#endif + return (0); + } + + return (1); +} + +static int +ThunderDecodeRow(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) +{ + static const char module[] = "ThunderDecodeRow"; + uint8* row = buf; + + (void) s; + if (occ % tif->tif_scanlinesize) + { + TIFFErrorExt(tif->tif_clientdata, module, "Fractional scanlines cannot be read"); + return (0); + } + while (occ > 0) { + if (!ThunderDecode(tif, row, tif->tif_dir.td_imagewidth)) + return (0); + occ -= tif->tif_scanlinesize; + row += tif->tif_scanlinesize; + } + return (1); +} + +int +TIFFInitThunderScan(TIFF* tif, int scheme) +{ + (void) scheme; + + tif->tif_setupdecode = ThunderSetupDecode; + tif->tif_decoderow = ThunderDecodeRow; + tif->tif_decodestrip = ThunderDecodeRow; + return (1); +} +#endif /* THUNDER_SUPPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_tile.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_tile.c new file mode 100644 index 0000000..0ff7e85 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_tile.c @@ -0,0 +1,299 @@ +/* $Id: tif_tile.c,v 1.23 2012-06-06 05:33:55 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Tiled Image Support Routines. + */ +#include "tiffiop.h" + +/* + * Compute which tile an (x,y,z,s) value is in. + */ +uint32 +TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s) +{ + TIFFDirectory *td = &tif->tif_dir; + uint32 dx = td->td_tilewidth; + uint32 dy = td->td_tilelength; + uint32 dz = td->td_tiledepth; + uint32 tile = 1; + + if (td->td_imagedepth == 1) + z = 0; + if (dx == (uint32) -1) + dx = td->td_imagewidth; + if (dy == (uint32) -1) + dy = td->td_imagelength; + if (dz == (uint32) -1) + dz = td->td_imagedepth; + if (dx != 0 && dy != 0 && dz != 0) { + uint32 xpt = TIFFhowmany_32(td->td_imagewidth, dx); + uint32 ypt = TIFFhowmany_32(td->td_imagelength, dy); + uint32 zpt = TIFFhowmany_32(td->td_imagedepth, dz); + + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + tile = (xpt*ypt*zpt)*s + + (xpt*ypt)*(z/dz) + + xpt*(y/dy) + + x/dx; + else + tile = (xpt*ypt)*(z/dz) + xpt*(y/dy) + x/dx; + } + return (tile); +} + +/* + * Check an (x,y,z,s) coordinate + * against the image bounds. + */ +int +TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s) +{ + TIFFDirectory *td = &tif->tif_dir; + + if (x >= td->td_imagewidth) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Col out of range, max %lu", + (unsigned long) x, + (unsigned long) (td->td_imagewidth - 1)); + return (0); + } + if (y >= td->td_imagelength) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Row out of range, max %lu", + (unsigned long) y, + (unsigned long) (td->td_imagelength - 1)); + return (0); + } + if (z >= td->td_imagedepth) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Depth out of range, max %lu", + (unsigned long) z, + (unsigned long) (td->td_imagedepth - 1)); + return (0); + } + if (td->td_planarconfig == PLANARCONFIG_SEPARATE && + s >= td->td_samplesperpixel) { + TIFFErrorExt(tif->tif_clientdata, tif->tif_name, + "%lu: Sample out of range, max %lu", + (unsigned long) s, + (unsigned long) (td->td_samplesperpixel - 1)); + return (0); + } + return (1); +} + +/* + * Compute how many tiles are in an image. + */ +uint32 +TIFFNumberOfTiles(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + uint32 dx = td->td_tilewidth; + uint32 dy = td->td_tilelength; + uint32 dz = td->td_tiledepth; + uint32 ntiles; + + if (dx == (uint32) -1) + dx = td->td_imagewidth; + if (dy == (uint32) -1) + dy = td->td_imagelength; + if (dz == (uint32) -1) + dz = td->td_imagedepth; + ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 : + _TIFFMultiply32(tif, _TIFFMultiply32(tif, TIFFhowmany_32(td->td_imagewidth, dx), + TIFFhowmany_32(td->td_imagelength, dy), + "TIFFNumberOfTiles"), + TIFFhowmany_32(td->td_imagedepth, dz), "TIFFNumberOfTiles"); + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + ntiles = _TIFFMultiply32(tif, ntiles, td->td_samplesperpixel, + "TIFFNumberOfTiles"); + return (ntiles); +} + +/* + * Compute the # bytes in each row of a tile. + */ +uint64 +TIFFTileRowSize64(TIFF* tif) +{ + TIFFDirectory *td = &tif->tif_dir; + uint64 rowsize; + + if (td->td_tilelength == 0 || td->td_tilewidth == 0) + return (0); + rowsize = _TIFFMultiply64(tif, td->td_bitspersample, td->td_tilewidth, + "TIFFTileRowSize"); + if (td->td_planarconfig == PLANARCONFIG_CONTIG) + rowsize = _TIFFMultiply64(tif, rowsize, td->td_samplesperpixel, + "TIFFTileRowSize"); + return (TIFFhowmany8_64(rowsize)); +} +tmsize_t +TIFFTileRowSize(TIFF* tif) +{ + static const char module[] = "TIFFTileRowSize"; + uint64 m; + tmsize_t n; + m=TIFFTileRowSize64(tif); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + return(n); +} + +/* + * Compute the # bytes in a variable length, row-aligned tile. + */ +uint64 +TIFFVTileSize64(TIFF* tif, uint32 nrows) +{ + static const char module[] = "TIFFVTileSize64"; + TIFFDirectory *td = &tif->tif_dir; + if (td->td_tilelength == 0 || td->td_tilewidth == 0 || + td->td_tiledepth == 0) + return (0); + if ((td->td_planarconfig==PLANARCONFIG_CONTIG)&& + (td->td_photometric==PHOTOMETRIC_YCBCR)&& + (td->td_samplesperpixel==3)&& + (!isUpSampled(tif))) + { + /* + * Packed YCbCr data contain one Cb+Cr for every + * HorizontalSampling*VerticalSampling Y values. + * Must also roundup width and height when calculating + * since images that are not a multiple of the + * horizontal/vertical subsampling area include + * YCbCr data for the extended image. + */ + uint16 ycbcrsubsampling[2]; + uint16 samplingblock_samples; + uint32 samplingblocks_hor; + uint32 samplingblocks_ver; + uint64 samplingrow_samples; + uint64 samplingrow_size; + TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING,ycbcrsubsampling+0, + ycbcrsubsampling+1); + if ((ycbcrsubsampling[0] != 1 && ycbcrsubsampling[0] != 2 && ycbcrsubsampling[0] != 4) + ||(ycbcrsubsampling[1] != 1 && ycbcrsubsampling[1] != 2 && ycbcrsubsampling[1] != 4)) + { + TIFFErrorExt(tif->tif_clientdata,module, + "Invalid YCbCr subsampling (%dx%d)", + ycbcrsubsampling[0], + ycbcrsubsampling[1] ); + return 0; + } + samplingblock_samples=ycbcrsubsampling[0]*ycbcrsubsampling[1]+2; + samplingblocks_hor=TIFFhowmany_32(td->td_tilewidth,ycbcrsubsampling[0]); + samplingblocks_ver=TIFFhowmany_32(nrows,ycbcrsubsampling[1]); + samplingrow_samples=_TIFFMultiply64(tif,samplingblocks_hor,samplingblock_samples,module); + samplingrow_size=TIFFhowmany8_64(_TIFFMultiply64(tif,samplingrow_samples,td->td_bitspersample,module)); + return(_TIFFMultiply64(tif,samplingrow_size,samplingblocks_ver,module)); + } + else + return(_TIFFMultiply64(tif,nrows,TIFFTileRowSize64(tif),module)); +} +tmsize_t +TIFFVTileSize(TIFF* tif, uint32 nrows) +{ + static const char module[] = "TIFFVTileSize"; + uint64 m; + tmsize_t n; + m=TIFFVTileSize64(tif,nrows); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + return(n); +} + +/* + * Compute the # bytes in a row-aligned tile. + */ +uint64 +TIFFTileSize64(TIFF* tif) +{ + return (TIFFVTileSize64(tif, tif->tif_dir.td_tilelength)); +} +tmsize_t +TIFFTileSize(TIFF* tif) +{ + static const char module[] = "TIFFTileSize"; + uint64 m; + tmsize_t n; + m=TIFFTileSize64(tif); + n=(tmsize_t)m; + if ((uint64)n!=m) + { + TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow"); + n=0; + } + return(n); +} + +/* + * Compute a default tile size based on the image + * characteristics and a requested value. If a + * request is <1 then we choose a size according + * to certain heuristics. + */ +void +TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) +{ + (*tif->tif_deftilesize)(tif, tw, th); +} + +void +_TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) +{ + (void) tif; + if (*(int32*) tw < 1) + *tw = 256; + if (*(int32*) th < 1) + *th = 256; + /* roundup to a multiple of 16 per the spec */ + if (*tw & 0xf) + *tw = TIFFroundup_32(*tw, 16); + if (*th & 0xf) + *th = TIFFroundup_32(*th, 16); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_unix.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_unix.c new file mode 100644 index 0000000..11e41fd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_unix.c @@ -0,0 +1,346 @@ +/* $Id: tif_unix.c,v 1.23 2012-06-01 21:40:59 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library UNIX-specific Routines. These are should also work with the + * Windows Common RunTime Library. + */ + +#include "tif_config.h" + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#include + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#include "tiffiop.h" + +static tmsize_t +_tiffReadProc(thandle_t fd, void* buf, tmsize_t size) +{ + size_t size_io = (size_t) size; + if ((tmsize_t) size_io != size) + { + errno=EINVAL; + return (tmsize_t) -1; + } + return ((tmsize_t) read((int) fd, buf, size_io)); +} + +static tmsize_t +_tiffWriteProc(thandle_t fd, void* buf, tmsize_t size) +{ + size_t size_io = (size_t) size; + if ((tmsize_t) size_io != size) + { + errno=EINVAL; + return (tmsize_t) -1; + } + return ((tmsize_t) write((int) fd, buf, size_io)); +} + +static uint64 +_tiffSeekProc(thandle_t fd, uint64 off, int whence) +{ + off_t off_io = (off_t) off; + if ((uint64) off_io != off) + { + errno=EINVAL; + return (uint64) -1; /* this is really gross */ + } + return((uint64)lseek((int)fd,off_io,whence)); +} + +static int +_tiffCloseProc(thandle_t fd) +{ + return(close((int)fd)); +} + +static int +_tiffDummyCloseProc(thandle_t fd) +{ + return 0; +} + +static uint64 +_tiffSizeProc(thandle_t fd) +{ + struct stat sb; + if (fstat((int)fd,&sb)<0) + return(0); + else + return((uint64)sb.st_size); +} + +#ifdef HAVE_MMAP +#include + +static int +_tiffMapProc(thandle_t fd, void** pbase, toff_t* psize) +{ + uint64 size64 = _tiffSizeProc(fd); + tmsize_t sizem = (tmsize_t)size64; + if ((uint64)sizem==size64) { + *pbase = (void*) + mmap(0, (size_t)sizem, PROT_READ, MAP_SHARED, (int) fd, 0); + if (*pbase != (void*) -1) { + *psize = (tmsize_t)sizem; + return (1); + } + } + return (0); +} + +static void +_tiffUnmapProc(thandle_t fd, void* base, toff_t size) +{ + (void) fd; + (void) munmap(base, (off_t) size); +} +#else /* !HAVE_MMAP */ +static int +_tiffMapProc(thandle_t fd, void** pbase, toff_t* psize) +{ + (void) fd; (void) pbase; (void) psize; + return (0); +} + +static void +_tiffUnmapProc(thandle_t fd, void* base, toff_t size) +{ + (void) fd; (void) base; (void) size; +} +#endif /* !HAVE_MMAP */ + +/* + * Open a TIFF file descriptor for read/writing. + */ +TIFF* +TIFFFdOpen(int fd, const char* name, const char* mode) +{ + TIFF* tif; + + tif = TIFFClientOpen(name, mode, + (thandle_t) fd, + _tiffReadProc, _tiffWriteProc, + _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, + _tiffMapProc, _tiffUnmapProc); + if (tif) + tif->tif_fd = fd; + return (tif); +} + +/* + * Open a TIFF file descriptor for read/writing - but without close proc. + */ +TIFF* +TIFFFdOpenNoCloseProc(int fd, const char* name, const char* mode) +{ + TIFF* tif; + + tif = TIFFClientOpen(name, mode, + (thandle_t) fd, + _tiffReadProc, _tiffWriteProc, + _tiffSeekProc, _tiffDummyCloseProc, _tiffSizeProc, + _tiffMapProc, _tiffUnmapProc); + if (tif) + tif->tif_fd = fd; + return (tif); +} + +/* + * Open a TIFF file for read/writing. + */ +TIFF* +TIFFOpen(const char* name, const char* mode) +{ + static const char module[] = "TIFFOpen"; + int m, fd; + TIFF* tif; + + m = _TIFFgetMode(mode, module); + if (m == -1) + return ((TIFF*)0); + +/* for cygwin and mingw */ +#ifdef O_BINARY + m |= O_BINARY; +#endif + + fd = open(name, m, 0666); + if (fd < 0) { + if (errno > 0 && strerror(errno) != NULL ) { + TIFFErrorExt(0, module, "%s: %s", name, strerror(errno) ); + } else { + TIFFErrorExt(0, module, "%s: Cannot open", name); + } + return ((TIFF *)0); + } + + tif = TIFFFdOpen((int)fd, name, mode); + if(!tif) + close(fd); + return tif; +} + +#ifdef __WIN32__ +#include +/* + * Open a TIFF file with a Unicode filename, for read/writing. + */ +TIFF* +TIFFOpenW(const wchar_t* name, const char* mode) +{ + static const char module[] = "TIFFOpenW"; + int m, fd; + int mbsize; + char *mbname; + TIFF* tif; + + m = _TIFFgetMode(mode, module); + if (m == -1) + return ((TIFF*)0); + +/* for cygwin and mingw */ +#ifdef O_BINARY + m |= O_BINARY; +#endif + + fd = _wopen(name, m, 0666); + if (fd < 0) { + TIFFErrorExt(0, module, "%s: Cannot open", name); + return ((TIFF *)0); + } + + mbname = NULL; + mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL); + if (mbsize > 0) { + mbname = _TIFFmalloc(mbsize); + if (!mbname) { + TIFFErrorExt(0, module, + "Can't allocate space for filename conversion buffer"); + return ((TIFF*)0); + } + + WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize, + NULL, NULL); + } + + tif = TIFFFdOpen((int)fd, (mbname != NULL) ? mbname : "", + mode); + + _TIFFfree(mbname); + + if(!tif) + close(fd); + return tif; +} +#endif + +void* +_TIFFmalloc(tmsize_t s) +{ + return (malloc((size_t) s)); +} + +void +_TIFFfree(void* p) +{ + free(p); +} + +void* +_TIFFrealloc(void* p, tmsize_t s) +{ + return (realloc(p, (size_t) s)); +} + +void +_TIFFmemset(void* p, int v, tmsize_t c) +{ + memset(p, v, (size_t) c); +} + +void +_TIFFmemcpy(void* d, const void* s, tmsize_t c) +{ + memcpy(d, s, (size_t) c); +} + +int +_TIFFmemcmp(const void* p1, const void* p2, tmsize_t c) +{ + return (memcmp(p1, p2, (size_t) c)); +} + +static void +unixWarningHandler(const char* module, const char* fmt, va_list ap) +{ + if (module != NULL) + fprintf(stderr, "%s: ", module); + fprintf(stderr, "Warning, "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, ".\n"); +} +TIFFErrorHandler _TIFFwarningHandler = unixWarningHandler; + +static void +unixErrorHandler(const char* module, const char* fmt, va_list ap) +{ + if (module != NULL) + fprintf(stderr, "%s: ", module); + vfprintf(stderr, fmt, ap); + fprintf(stderr, ".\n"); +} +TIFFErrorHandler _TIFFerrorHandler = unixErrorHandler; + +/* vim: set ts=8 sts=8 sw=8 noet: */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_version.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_version.c new file mode 100644 index 0000000..f92c843 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_version.c @@ -0,0 +1,40 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_version.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */ +/* + * Copyright (c) 1992-1997 Sam Leffler + * Copyright (c) 1992-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ +#include "tiffiop.h" + +static const char TIFFVersion[] = TIFFLIB_VERSION_STR; + +const char* +TIFFGetVersion(void) +{ + return (TIFFVersion); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_warning.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_warning.c new file mode 100644 index 0000000..423b636 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_warning.c @@ -0,0 +1,81 @@ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_warning.c,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + */ +#include "tiffiop.h" + +TIFFErrorHandlerExt _TIFFwarningHandlerExt = NULL; + +TIFFErrorHandler +TIFFSetWarningHandler(TIFFErrorHandler handler) +{ + TIFFErrorHandler prev = _TIFFwarningHandler; + _TIFFwarningHandler = handler; + return (prev); +} + +TIFFErrorHandlerExt +TIFFSetWarningHandlerExt(TIFFErrorHandlerExt handler) +{ + TIFFErrorHandlerExt prev = _TIFFwarningHandlerExt; + _TIFFwarningHandlerExt = handler; + return (prev); +} + +void +TIFFWarning(const char* module, const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (_TIFFwarningHandler) + (*_TIFFwarningHandler)(module, fmt, ap); + if (_TIFFwarningHandlerExt) + (*_TIFFwarningHandlerExt)(0, module, fmt, ap); + va_end(ap); +} + +void +TIFFWarningExt(thandle_t fd, const char* module, const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (_TIFFwarningHandler) + (*_TIFFwarningHandler)(module, fmt, ap); + if (_TIFFwarningHandlerExt) + (*_TIFFwarningHandlerExt)(fd, module, fmt, ap); + va_end(ap); +} + + +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_win32.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_win32.c new file mode 100644 index 0000000..2cf1de9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_win32.c @@ -0,0 +1,440 @@ +/* $Id: tif_win32.c,v 1.39 2011-12-22 17:07:57 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library Win32-specific Routines. Adapted from tif_unix.c 4/5/95 by + * Scott Wagner (wagner@itek.com), Itek Graphix, Rochester, NY USA + */ +#include "tiffiop.h" + +#include + +static tmsize_t +_tiffReadProc(thandle_t fd, void* buf, tmsize_t size) +{ + /* tmsize_t is 64bit on 64bit systems, but the WinAPI ReadFile takes + * 32bit sizes, so we loop through the data in suitable 32bit sized + * chunks */ + uint8* ma; + uint64 mb; + DWORD n; + DWORD o; + tmsize_t p; + ma=(uint8*)buf; + mb=size; + p=0; + while (mb>0) + { + n=0x80000000UL; + if ((uint64)n>mb) + n=(DWORD)mb; + if (!ReadFile(fd,(LPVOID)ma,n,&o,NULL)) + return(0); + ma+=o; + mb-=o; + p+=o; + if (o!=n) + break; + } + return(p); +} + +static tmsize_t +_tiffWriteProc(thandle_t fd, void* buf, tmsize_t size) +{ + /* tmsize_t is 64bit on 64bit systems, but the WinAPI WriteFile takes + * 32bit sizes, so we loop through the data in suitable 32bit sized + * chunks */ + uint8* ma; + uint64 mb; + DWORD n; + DWORD o; + tmsize_t p; + ma=(uint8*)buf; + mb=size; + p=0; + while (mb>0) + { + n=0x80000000UL; + if ((uint64)n>mb) + n=(DWORD)mb; + if (!WriteFile(fd,(LPVOID)ma,n,&o,NULL)) + return(0); + ma+=o; + mb-=o; + p+=o; + if (o!=n) + break; + } + return(p); +} + +static uint64 +_tiffSeekProc(thandle_t fd, uint64 off, int whence) +{ + LARGE_INTEGER offli; + DWORD dwMoveMethod; + offli.QuadPart = off; + switch(whence) + { + case SEEK_SET: + dwMoveMethod = FILE_BEGIN; + break; + case SEEK_CUR: + dwMoveMethod = FILE_CURRENT; + break; + case SEEK_END: + dwMoveMethod = FILE_END; + break; + default: + dwMoveMethod = FILE_BEGIN; + break; + } + offli.LowPart=SetFilePointer(fd,offli.LowPart,&offli.HighPart,dwMoveMethod); + if ((offli.LowPart==INVALID_SET_FILE_POINTER)&&(GetLastError()!=NO_ERROR)) + offli.QuadPart=0; + return(offli.QuadPart); +} + +static int +_tiffCloseProc(thandle_t fd) +{ + return (CloseHandle(fd) ? 0 : -1); +} + +static uint64 +_tiffSizeProc(thandle_t fd) +{ + ULARGE_INTEGER m; + m.LowPart=GetFileSize(fd,&m.HighPart); + return(m.QuadPart); +} + +static int +_tiffDummyMapProc(thandle_t fd, void** pbase, toff_t* psize) +{ + (void) fd; + (void) pbase; + (void) psize; + return (0); +} + +/* + * From "Hermann Josef Hill" : + * + * Windows uses both a handle and a pointer for file mapping, + * but according to the SDK documentation and Richter's book + * "Advanced Windows Programming" it is safe to free the handle + * after obtaining the file mapping pointer + * + * This removes a nasty OS dependency and cures a problem + * with Visual C++ 5.0 + */ +static int +_tiffMapProc(thandle_t fd, void** pbase, toff_t* psize) +{ + uint64 size; + tmsize_t sizem; + HANDLE hMapFile; + + size = _tiffSizeProc(fd); + sizem = (tmsize_t)size; + if ((uint64)sizem!=size) + return (0); + + /* By passing in 0 for the maximum file size, it specifies that we + create a file mapping object for the full file size. */ + hMapFile = CreateFileMapping(fd, NULL, PAGE_READONLY, 0, 0, NULL); + if (hMapFile == NULL) + return (0); + *pbase = MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0); + CloseHandle(hMapFile); + if (*pbase == NULL) + return (0); + *psize = size; + return(1); +} + +static void +_tiffDummyUnmapProc(thandle_t fd, void* base, toff_t size) +{ + (void) fd; + (void) base; + (void) size; +} + +static void +_tiffUnmapProc(thandle_t fd, void* base, toff_t size) +{ + (void) fd; + (void) size; + UnmapViewOfFile(base); +} + +/* + * Open a TIFF file descriptor for read/writing. + * Note that TIFFFdOpen and TIFFOpen recognise the character 'u' in the mode + * string, which forces the file to be opened unmapped. + */ +TIFF* +TIFFFdOpen(int ifd, const char* name, const char* mode) +{ + TIFF* tif; + int fSuppressMap; + int m; + fSuppressMap=0; + for (m=0; mode[m]!=0; m++) + { + if (mode[m]=='u') + { + fSuppressMap=1; + break; + } + } + tif = TIFFClientOpen(name, mode, (thandle_t)ifd, + _tiffReadProc, _tiffWriteProc, + _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, + fSuppressMap ? _tiffDummyMapProc : _tiffMapProc, + fSuppressMap ? _tiffDummyUnmapProc : _tiffUnmapProc); + if (tif) + tif->tif_fd = ifd; + return (tif); +} + +#ifndef _WIN32_WCE + +/* + * Open a TIFF file for read/writing. + */ +TIFF* +TIFFOpen(const char* name, const char* mode) +{ + static const char module[] = "TIFFOpen"; + thandle_t fd; + int m; + DWORD dwMode; + TIFF* tif; + + m = _TIFFgetMode(mode, module); + + switch(m) { + case O_RDONLY: dwMode = OPEN_EXISTING; break; + case O_RDWR: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_CREAT: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_TRUNC: dwMode = CREATE_ALWAYS; break; + case O_RDWR|O_CREAT|O_TRUNC: dwMode = CREATE_ALWAYS; break; + default: return ((TIFF*)0); + } + + fd = (thandle_t)CreateFileA(name, + (m == O_RDONLY)?GENERIC_READ:(GENERIC_READ | GENERIC_WRITE), + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode, + (m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL, + NULL); + if (fd == INVALID_HANDLE_VALUE) { + TIFFErrorExt(0, module, "%s: Cannot open", name); + return ((TIFF *)0); + } + + tif = TIFFFdOpen((int)fd, name, mode); + if(!tif) + CloseHandle(fd); + return tif; +} + +/* + * Open a TIFF file with a Unicode filename, for read/writing. + */ +TIFF* +TIFFOpenW(const wchar_t* name, const char* mode) +{ + static const char module[] = "TIFFOpenW"; + thandle_t fd; + int m; + DWORD dwMode; + int mbsize; + char *mbname; + TIFF *tif; + + m = _TIFFgetMode(mode, module); + + switch(m) { + case O_RDONLY: dwMode = OPEN_EXISTING; break; + case O_RDWR: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_CREAT: dwMode = OPEN_ALWAYS; break; + case O_RDWR|O_TRUNC: dwMode = CREATE_ALWAYS; break; + case O_RDWR|O_CREAT|O_TRUNC: dwMode = CREATE_ALWAYS; break; + default: return ((TIFF*)0); + } + + fd = (thandle_t)CreateFileW(name, + (m == O_RDONLY)?GENERIC_READ:(GENERIC_READ|GENERIC_WRITE), + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode, + (m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL, + NULL); + if (fd == INVALID_HANDLE_VALUE) { + TIFFErrorExt(0, module, "%S: Cannot open", name); + return ((TIFF *)0); + } + + mbname = NULL; + mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL); + if (mbsize > 0) { + mbname = (char *)_TIFFmalloc(mbsize); + if (!mbname) { + TIFFErrorExt(0, module, + "Can't allocate space for filename conversion buffer"); + return ((TIFF*)0); + } + + WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize, + NULL, NULL); + } + + tif = TIFFFdOpen((int)fd, + (mbname != NULL) ? mbname : "", mode); + if(!tif) + CloseHandle(fd); + + _TIFFfree(mbname); + + return tif; +} + +#endif /* ndef _WIN32_WCE */ + +void* +_TIFFmalloc(tmsize_t s) +{ + return (malloc((size_t) s)); +} + +void +_TIFFfree(void* p) +{ + free(p); +} + +void* +_TIFFrealloc(void* p, tmsize_t s) +{ + return (realloc(p, (size_t) s)); +} + +void +_TIFFmemset(void* p, int v, tmsize_t c) +{ + memset(p, v, (size_t) c); +} + +void +_TIFFmemcpy(void* d, const void* s, tmsize_t c) +{ + memcpy(d, s, (size_t) c); +} + +int +_TIFFmemcmp(const void* p1, const void* p2, tmsize_t c) +{ + return (memcmp(p1, p2, (size_t) c)); +} + +#ifndef _WIN32_WCE + +#if (_MSC_VER < 1500) +# define vsnprintf _vsnprintf +#endif + +static void +Win32WarningHandler(const char* module, const char* fmt, va_list ap) +{ +#ifndef TIF_PLATFORM_CONSOLE + LPTSTR szTitle; + LPTSTR szTmp; + LPCTSTR szTitleText = "%s Warning"; + LPCTSTR szDefaultModule = "LIBTIFF"; + LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; + SIZE_T nBufSize = (strlen(szTmpModule) + + strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); + + if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) + return; + sprintf(szTitle, szTitleText, szTmpModule); + szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); + vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); + MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); + LocalFree(szTitle); + + return; +#else + if (module != NULL) + fprintf(stderr, "%s: ", module); + fprintf(stderr, "Warning, "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, ".\n"); +#endif +} +TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; + +static void +Win32ErrorHandler(const char* module, const char* fmt, va_list ap) +{ +#ifndef TIF_PLATFORM_CONSOLE + LPTSTR szTitle; + LPTSTR szTmp; + LPCTSTR szTitleText = "%s Error"; + LPCTSTR szDefaultModule = "LIBTIFF"; + LPCTSTR szTmpModule = (module == NULL) ? szDefaultModule : module; + SIZE_T nBufSize = (strlen(szTmpModule) + + strlen(szTitleText) + strlen(fmt) + 256)*sizeof(char); + + if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, nBufSize)) == NULL) + return; + sprintf(szTitle, szTitleText, szTmpModule); + szTmp = szTitle + (strlen(szTitle)+2)*sizeof(char); + vsnprintf(szTmp, nBufSize-(strlen(szTitle)+2)*sizeof(char), fmt, ap); + MessageBoxA(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION); + LocalFree(szTitle); + return; +#else + if (module != NULL) + fprintf(stderr, "%s: ", module); + vfprintf(stderr, fmt, ap); + fprintf(stderr, ".\n"); +#endif +} +TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; + +#endif /* ndef _WIN32_WCE */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_write.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_write.c new file mode 100644 index 0000000..8792123 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_write.c @@ -0,0 +1,771 @@ +/* $Id: tif_write.c,v 1.37 2012-08-13 22:10:17 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library. + * + * Scanline-oriented Write Support + */ +#include "tiffiop.h" +#include + +#define STRIPINCR 20 /* expansion factor on strip array */ + +#define WRITECHECKSTRIPS(tif, module) \ + (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module)) +#define WRITECHECKTILES(tif, module) \ + (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module)) +#define BUFFERCHECK(tif) \ + ((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) || \ + TIFFWriteBufferSetup((tif), NULL, (tmsize_t) -1)) + +static int TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module); +static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc); + +int +TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample) +{ + static const char module[] = "TIFFWriteScanline"; + register TIFFDirectory *td; + int status, imagegrew = 0; + uint32 strip; + + if (!WRITECHECKSTRIPS(tif, module)) + return (-1); + /* + * Handle delayed allocation of data buffer. This + * permits it to be sized more intelligently (using + * directory information). + */ + if (!BUFFERCHECK(tif)) + return (-1); + tif->tif_flags |= TIFF_BUF4WRITE; /* not strictly sure this is right*/ + + td = &tif->tif_dir; + /* + * Extend image length if needed + * (but only for PlanarConfig=1). + */ + if (row >= td->td_imagelength) { /* extend image */ + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not change \"ImageLength\" when using separate planes"); + return (-1); + } + td->td_imagelength = row+1; + imagegrew = 1; + } + /* + * Calculate strip and check for crossings. + */ + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + if (sample >= td->td_samplesperpixel) { + TIFFErrorExt(tif->tif_clientdata, module, + "%lu: Sample out of range, max %lu", + (unsigned long) sample, (unsigned long) td->td_samplesperpixel); + return (-1); + } + strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip; + } else + strip = row / td->td_rowsperstrip; + /* + * Check strip array to make sure there's space. We don't support + * dynamically growing files that have data organized in separate + * bitplanes because it's too painful. In that case we require that + * the imagelength be set properly before the first write (so that the + * strips array will be fully allocated above). + */ + if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module)) + return (-1); + if (strip != tif->tif_curstrip) { + /* + * Changing strips -- flush any data present. + */ + if (!TIFFFlushData(tif)) + return (-1); + tif->tif_curstrip = strip; + /* + * Watch out for a growing image. The value of strips/image + * will initially be 1 (since it can't be deduced until the + * imagelength is known). + */ + if (strip >= td->td_stripsperimage && imagegrew) + td->td_stripsperimage = + TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip); + tif->tif_row = + (strip % td->td_stripsperimage) * td->td_rowsperstrip; + if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { + if (!(*tif->tif_setupencode)(tif)) + return (-1); + tif->tif_flags |= TIFF_CODERSETUP; + } + + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + + if( td->td_stripbytecount[strip] > 0 ) + { + /* if we are writing over existing tiles, zero length */ + td->td_stripbytecount[strip] = 0; + + /* this forces TIFFAppendToStrip() to do a seek */ + tif->tif_curoff = 0; + } + + if (!(*tif->tif_preencode)(tif, sample)) + return (-1); + tif->tif_flags |= TIFF_POSTENCODE; + } + /* + * Ensure the write is either sequential or at the + * beginning of a strip (or that we can randomly + * access the data -- i.e. no encoding). + */ + if (row != tif->tif_row) { + if (row < tif->tif_row) { + /* + * Moving backwards within the same strip: + * backup to the start and then decode + * forward (below). + */ + tif->tif_row = (strip % td->td_stripsperimage) * + td->td_rowsperstrip; + tif->tif_rawcp = tif->tif_rawdata; + } + /* + * Seek forward to the desired row. + */ + if (!(*tif->tif_seek)(tif, row - tif->tif_row)) + return (-1); + tif->tif_row = row; + } + + /* swab if needed - note that source buffer will be altered */ + tif->tif_postdecode( tif, (uint8*) buf, tif->tif_scanlinesize ); + + status = (*tif->tif_encoderow)(tif, (uint8*) buf, + tif->tif_scanlinesize, sample); + + /* we are now poised at the beginning of the next row */ + tif->tif_row = row + 1; + return (status); +} + +/* + * Encode the supplied data and write it to the + * specified strip. + * + * NB: Image length must be setup before writing. + */ +tmsize_t +TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) +{ + static const char module[] = "TIFFWriteEncodedStrip"; + TIFFDirectory *td = &tif->tif_dir; + uint16 sample; + + if (!WRITECHECKSTRIPS(tif, module)) + return ((tmsize_t) -1); + /* + * Check strip array to make sure there's space. + * We don't support dynamically growing files that + * have data organized in separate bitplanes because + * it's too painful. In that case we require that + * the imagelength be set properly before the first + * write (so that the strips array will be fully + * allocated above). + */ + if (strip >= td->td_nstrips) { + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not grow image by strips when using separate planes"); + return ((tmsize_t) -1); + } + if (!TIFFGrowStrips(tif, 1, module)) + return ((tmsize_t) -1); + td->td_stripsperimage = + TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip); + } + /* + * Handle delayed allocation of data buffer. This + * permits it to be sized according to the directory + * info. + */ + if (!BUFFERCHECK(tif)) + return ((tmsize_t) -1); + + tif->tif_flags |= TIFF_BUF4WRITE; + tif->tif_curstrip = strip; + + tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; + if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { + if (!(*tif->tif_setupencode)(tif)) + return ((tmsize_t) -1); + tif->tif_flags |= TIFF_CODERSETUP; + } + + if( td->td_stripbytecount[strip] > 0 ) + { + /* Make sure that at the first attempt of rewriting the tile, we will have */ + /* more bytes available in the output buffer than the previous byte count, */ + /* so that TIFFAppendToStrip() will detect the overflow when it is called the first */ + /* time if the new compressed tile is bigger than the older one. (GDAL #4771) */ + if( tif->tif_rawdatasize <= td->td_stripbytecount[strip] ) + { + if( !(TIFFWriteBufferSetup(tif, NULL, + (tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[strip] + 1), 1024))) ) + return ((tmsize_t)(-1)); + } + + /* Force TIFFAppendToStrip() to consider placing data at end + of file. */ + tif->tif_curoff = 0; + } + + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + + tif->tif_flags &= ~TIFF_POSTENCODE; + sample = (uint16)(strip / td->td_stripsperimage); + if (!(*tif->tif_preencode)(tif, sample)) + return ((tmsize_t) -1); + + /* swab if needed - note that source buffer will be altered */ + tif->tif_postdecode( tif, (uint8*) data, cc ); + + if (!(*tif->tif_encodestrip)(tif, (uint8*) data, cc, sample)) + return (0); + if (!(*tif->tif_postencode)(tif)) + return ((tmsize_t) -1); + if (!isFillOrder(tif, td->td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) + TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc); + if (tif->tif_rawcc > 0 && + !TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc)) + return ((tmsize_t) -1); + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + return (cc); +} + +/* + * Write the supplied data to the specified strip. + * + * NB: Image length must be setup before writing. + */ +tmsize_t +TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) +{ + static const char module[] = "TIFFWriteRawStrip"; + TIFFDirectory *td = &tif->tif_dir; + + if (!WRITECHECKSTRIPS(tif, module)) + return ((tmsize_t) -1); + /* + * Check strip array to make sure there's space. + * We don't support dynamically growing files that + * have data organized in separate bitplanes because + * it's too painful. In that case we require that + * the imagelength be set properly before the first + * write (so that the strips array will be fully + * allocated above). + */ + if (strip >= td->td_nstrips) { + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { + TIFFErrorExt(tif->tif_clientdata, module, + "Can not grow image by strips when using separate planes"); + return ((tmsize_t) -1); + } + /* + * Watch out for a growing image. The value of + * strips/image will initially be 1 (since it + * can't be deduced until the imagelength is known). + */ + if (strip >= td->td_stripsperimage) + td->td_stripsperimage = + TIFFhowmany_32(td->td_imagelength,td->td_rowsperstrip); + if (!TIFFGrowStrips(tif, 1, module)) + return ((tmsize_t) -1); + } + tif->tif_curstrip = strip; + tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; + return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ? + cc : (tmsize_t) -1); +} + +/* + * Write and compress a tile of data. The + * tile is selected by the (x,y,z,s) coordinates. + */ +tmsize_t +TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s) +{ + if (!TIFFCheckTile(tif, x, y, z, s)) + return ((tmsize_t)(-1)); + /* + * NB: A tile size of -1 is used instead of tif_tilesize knowing + * that TIFFWriteEncodedTile will clamp this to the tile size. + * This is done because the tile size may not be defined until + * after the output buffer is setup in TIFFWriteBufferSetup. + */ + return (TIFFWriteEncodedTile(tif, + TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1))); +} + +/* + * Encode the supplied data and write it to the + * specified tile. There must be space for the + * data. The function clamps individual writes + * to a tile to the tile size, but does not (and + * can not) check that multiple writes to the same + * tile do not write more than tile size data. + * + * NB: Image length must be setup before writing; this + * interface does not support automatically growing + * the image on each write (as TIFFWriteScanline does). + */ +tmsize_t +TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc) +{ + static const char module[] = "TIFFWriteEncodedTile"; + TIFFDirectory *td; + uint16 sample; + + if (!WRITECHECKTILES(tif, module)) + return ((tmsize_t)(-1)); + td = &tif->tif_dir; + if (tile >= td->td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu", + (unsigned long) tile, (unsigned long) td->td_nstrips); + return ((tmsize_t)(-1)); + } + /* + * Handle delayed allocation of data buffer. This + * permits it to be sized more intelligently (using + * directory information). + */ + if (!BUFFERCHECK(tif)) + return ((tmsize_t)(-1)); + + tif->tif_flags |= TIFF_BUF4WRITE; + tif->tif_curtile = tile; + + if( td->td_stripbytecount[tile] > 0 ) + { + /* Make sure that at the first attempt of rewriting the tile, we will have */ + /* more bytes available in the output buffer than the previous byte count, */ + /* so that TIFFAppendToStrip() will detect the overflow when it is called the first */ + /* time if the new compressed tile is bigger than the older one. (GDAL #4771) */ + if( tif->tif_rawdatasize <= td->td_stripbytecount[tile] ) + { + if( !(TIFFWriteBufferSetup(tif, NULL, + (tmsize_t)TIFFroundup_64((uint64)(td->td_stripbytecount[tile] + 1), 1024))) ) + return ((tmsize_t)(-1)); + } + + /* Force TIFFAppendToStrip() to consider placing data at end + of file. */ + tif->tif_curoff = 0; + } + + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + + /* + * Compute tiles per row & per column to compute + * current row and column + */ + tif->tif_row = (tile % TIFFhowmany_32(td->td_imagelength, td->td_tilelength)) + * td->td_tilelength; + tif->tif_col = (tile % TIFFhowmany_32(td->td_imagewidth, td->td_tilewidth)) + * td->td_tilewidth; + + if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { + if (!(*tif->tif_setupencode)(tif)) + return ((tmsize_t)(-1)); + tif->tif_flags |= TIFF_CODERSETUP; + } + tif->tif_flags &= ~TIFF_POSTENCODE; + sample = (uint16)(tile/td->td_stripsperimage); + if (!(*tif->tif_preencode)(tif, sample)) + return ((tmsize_t)(-1)); + /* + * Clamp write amount to the tile size. This is mostly + * done so that callers can pass in some large number + * (e.g. -1) and have the tile size used instead. + */ + if ( cc < 1 || cc > tif->tif_tilesize) + cc = tif->tif_tilesize; + + /* swab if needed - note that source buffer will be altered */ + tif->tif_postdecode( tif, (uint8*) data, cc ); + + if (!(*tif->tif_encodetile)(tif, (uint8*) data, cc, sample)) + return (0); + if (!(*tif->tif_postencode)(tif)) + return ((tmsize_t)(-1)); + if (!isFillOrder(tif, td->td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) + TIFFReverseBits((uint8*)tif->tif_rawdata, tif->tif_rawcc); + if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile, + tif->tif_rawdata, tif->tif_rawcc)) + return ((tmsize_t)(-1)); + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + return (cc); +} + +/* + * Write the supplied data to the specified strip. + * There must be space for the data; we don't check + * if strips overlap! + * + * NB: Image length must be setup before writing; this + * interface does not support automatically growing + * the image on each write (as TIFFWriteScanline does). + */ +tmsize_t +TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc) +{ + static const char module[] = "TIFFWriteRawTile"; + + if (!WRITECHECKTILES(tif, module)) + return ((tmsize_t)(-1)); + if (tile >= tif->tif_dir.td_nstrips) { + TIFFErrorExt(tif->tif_clientdata, module, "Tile %lu out of range, max %lu", + (unsigned long) tile, + (unsigned long) tif->tif_dir.td_nstrips); + return ((tmsize_t)(-1)); + } + return (TIFFAppendToStrip(tif, tile, (uint8*) data, cc) ? + cc : (tmsize_t)(-1)); +} + +#define isUnspecified(tif, f) \ + (TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0) + +int +TIFFSetupStrips(TIFF* tif) +{ + TIFFDirectory* td = &tif->tif_dir; + + if (isTiled(tif)) + td->td_stripsperimage = + isUnspecified(tif, FIELD_TILEDIMENSIONS) ? + td->td_samplesperpixel : TIFFNumberOfTiles(tif); + else + td->td_stripsperimage = + isUnspecified(tif, FIELD_ROWSPERSTRIP) ? + td->td_samplesperpixel : TIFFNumberOfStrips(tif); + td->td_nstrips = td->td_stripsperimage; + if (td->td_planarconfig == PLANARCONFIG_SEPARATE) + td->td_stripsperimage /= td->td_samplesperpixel; + td->td_stripoffset = (uint64 *) + _TIFFmalloc(td->td_nstrips * sizeof (uint64)); + td->td_stripbytecount = (uint64 *) + _TIFFmalloc(td->td_nstrips * sizeof (uint64)); + if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL) + return (0); + /* + * Place data at the end-of-file + * (by setting offsets to zero). + */ + _TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint64)); + _TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint64)); + TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS); + TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS); + return (1); +} +#undef isUnspecified + +/* + * Verify file is writable and that the directory + * information is setup properly. In doing the latter + * we also "freeze" the state of the directory so + * that important information is not changed. + */ +int +TIFFWriteCheck(TIFF* tif, int tiles, const char* module) +{ + if (tif->tif_mode == O_RDONLY) { + TIFFErrorExt(tif->tif_clientdata, module, "File not open for writing"); + return (0); + } + if (tiles ^ isTiled(tif)) { + TIFFErrorExt(tif->tif_clientdata, module, tiles ? + "Can not write tiles to a stripped image" : + "Can not write scanlines to a tiled image"); + return (0); + } + + _TIFFFillStriles( tif ); + + /* + * On the first write verify all the required information + * has been setup and initialize any data structures that + * had to wait until directory information was set. + * Note that a lot of our work is assumed to remain valid + * because we disallow any of the important parameters + * from changing after we start writing (i.e. once + * TIFF_BEENWRITING is set, TIFFSetField will only allow + * the image's length to be changed). + */ + if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Must set \"ImageWidth\" before writing data"); + return (0); + } + if (tif->tif_dir.td_samplesperpixel == 1) { + /* + * Planarconfiguration is irrelevant in case of single band + * images and need not be included. We will set it anyway, + * because this field is used in other parts of library even + * in the single band case. + */ + if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) + tif->tif_dir.td_planarconfig = PLANARCONFIG_CONTIG; + } else { + if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) { + TIFFErrorExt(tif->tif_clientdata, module, + "Must set \"PlanarConfiguration\" before writing data"); + return (0); + } + } + if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) { + tif->tif_dir.td_nstrips = 0; + TIFFErrorExt(tif->tif_clientdata, module, "No space for %s arrays", + isTiled(tif) ? "tile" : "strip"); + return (0); + } + if (isTiled(tif)) + { + tif->tif_tilesize = TIFFTileSize(tif); + if (tif->tif_tilesize == 0) + return (0); + } + else + tif->tif_tilesize = (tmsize_t)(-1); + tif->tif_scanlinesize = TIFFScanlineSize(tif); + if (tif->tif_scanlinesize == 0) + return (0); + tif->tif_flags |= TIFF_BEENWRITING; + return (1); +} + +/* + * Setup the raw data buffer used for encoding. + */ +int +TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size) +{ + static const char module[] = "TIFFWriteBufferSetup"; + + if (tif->tif_rawdata) { + if (tif->tif_flags & TIFF_MYBUFFER) { + _TIFFfree(tif->tif_rawdata); + tif->tif_flags &= ~TIFF_MYBUFFER; + } + tif->tif_rawdata = NULL; + } + if (size == (tmsize_t)(-1)) { + size = (isTiled(tif) ? + tif->tif_tilesize : TIFFStripSize(tif)); + /* + * Make raw data buffer at least 8K + */ + if (size < 8*1024) + size = 8*1024; + bp = NULL; /* NB: force malloc */ + } + if (bp == NULL) { + bp = _TIFFmalloc(size); + if (bp == NULL) { + TIFFErrorExt(tif->tif_clientdata, module, "No space for output buffer"); + return (0); + } + tif->tif_flags |= TIFF_MYBUFFER; + } else + tif->tif_flags &= ~TIFF_MYBUFFER; + tif->tif_rawdata = (uint8*) bp; + tif->tif_rawdatasize = size; + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + tif->tif_flags |= TIFF_BUFFERSETUP; + return (1); +} + +/* + * Grow the strip data structures by delta strips. + */ +static int +TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module) +{ + TIFFDirectory *td = &tif->tif_dir; + uint64* new_stripoffset; + uint64* new_stripbytecount; + + assert(td->td_planarconfig == PLANARCONFIG_CONTIG); + new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset, + (td->td_nstrips + delta) * sizeof (uint64)); + new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount, + (td->td_nstrips + delta) * sizeof (uint64)); + if (new_stripoffset == NULL || new_stripbytecount == NULL) { + if (new_stripoffset) + _TIFFfree(new_stripoffset); + if (new_stripbytecount) + _TIFFfree(new_stripbytecount); + td->td_nstrips = 0; + TIFFErrorExt(tif->tif_clientdata, module, "No space to expand strip arrays"); + return (0); + } + td->td_stripoffset = new_stripoffset; + td->td_stripbytecount = new_stripbytecount; + _TIFFmemset(td->td_stripoffset + td->td_nstrips, + 0, delta*sizeof (uint64)); + _TIFFmemset(td->td_stripbytecount + td->td_nstrips, + 0, delta*sizeof (uint64)); + td->td_nstrips += delta; + tif->tif_flags |= TIFF_DIRTYDIRECT; + + return (1); +} + +/* + * Append the data to the specified strip. + */ +static int +TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc) +{ + static const char module[] = "TIFFAppendToStrip"; + TIFFDirectory *td = &tif->tif_dir; + uint64 m; + int64 old_byte_count = -1; + + if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) { + assert(td->td_nstrips > 0); + + if( td->td_stripbytecount[strip] != 0 + && td->td_stripoffset[strip] != 0 + && td->td_stripbytecount[strip] >= (uint64) cc ) + { + /* + * There is already tile data on disk, and the new tile + * data we have will fit in the same space. The only + * aspect of this that is risky is that there could be + * more data to append to this strip before we are done + * depending on how we are getting called. + */ + if (!SeekOK(tif, td->td_stripoffset[strip])) { + TIFFErrorExt(tif->tif_clientdata, module, + "Seek error at scanline %lu", + (unsigned long)tif->tif_row); + return (0); + } + } + else + { + /* + * Seek to end of file, and set that as our location to + * write this strip. + */ + td->td_stripoffset[strip] = TIFFSeekFile(tif, 0, SEEK_END); + tif->tif_flags |= TIFF_DIRTYSTRIP; + } + + tif->tif_curoff = td->td_stripoffset[strip]; + + /* + * We are starting a fresh strip/tile, so set the size to zero. + */ + old_byte_count = td->td_stripbytecount[strip]; + td->td_stripbytecount[strip] = 0; + } + + m = tif->tif_curoff+cc; + if (!(tif->tif_flags&TIFF_BIGTIFF)) + m = (uint32)m; + if ((mtif_curoff)||(m<(uint64)cc)) + { + TIFFErrorExt(tif->tif_clientdata, module, "Maximum TIFF file size exceeded"); + return (0); + } + if (!WriteOK(tif, data, cc)) { + TIFFErrorExt(tif->tif_clientdata, module, "Write error at scanline %lu", + (unsigned long) tif->tif_row); + return (0); + } + tif->tif_curoff = m; + td->td_stripbytecount[strip] += cc; + + if( (int64) td->td_stripbytecount[strip] != old_byte_count ) + tif->tif_flags |= TIFF_DIRTYSTRIP; + + return (1); +} + +/* + * Internal version of TIFFFlushData that can be + * called by ``encodestrip routines'' w/o concern + * for infinite recursion. + */ +int +TIFFFlushData1(TIFF* tif) +{ + if (tif->tif_rawcc > 0 && tif->tif_flags & TIFF_BUF4WRITE ) { + if (!isFillOrder(tif, tif->tif_dir.td_fillorder) && + (tif->tif_flags & TIFF_NOBITREV) == 0) + TIFFReverseBits((uint8*)tif->tif_rawdata, + tif->tif_rawcc); + if (!TIFFAppendToStrip(tif, + isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip, + tif->tif_rawdata, tif->tif_rawcc)) + return (0); + tif->tif_rawcc = 0; + tif->tif_rawcp = tif->tif_rawdata; + } + return (1); +} + +/* + * Set the current write offset. This should only be + * used to set the offset to a known previous location + * (very carefully), or to 0 so that the next write gets + * appended to the end of the file. + */ +void +TIFFSetWriteOffset(TIFF* tif, toff_t off) +{ + tif->tif_curoff = off; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_zip.c b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_zip.c new file mode 100644 index 0000000..f5aa2a9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tif_zip.c @@ -0,0 +1,469 @@ +/* $Id: tif_zip.c,v 1.31 2011-01-06 16:00:23 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1995-1997 Sam Leffler + * Copyright (c) 1995-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tiffiop.h" +#ifdef ZIP_SUPPORT +/* + * TIFF Library. + * + * ZIP (aka Deflate) Compression Support + * + * This file is simply an interface to the zlib library written by + * Jean-loup Gailly and Mark Adler. You must use version 1.0 or later + * of the library: this code assumes the 1.0 API and also depends on + * the ability to write the zlib header multiple times (one per strip) + * which was not possible with versions prior to 0.95. Note also that + * older versions of this codec avoided this bug by supressing the header + * entirely. This means that files written with the old library cannot + * be read; they should be converted to a different compression scheme + * and then reconverted. + * + * The data format used by the zlib library is described in the files + * zlib-3.1.doc, deflate-1.1.doc and gzip-4.1.doc, available in the + * directory ftp://ftp.uu.net/pub/archiving/zip/doc. The library was + * last found at ftp://ftp.uu.net/pub/archiving/zip/zlib/zlib-0.99.tar.gz. + */ +#include "tif_predict.h" +#include "zlib.h" + +#include + +/* + * Sigh, ZLIB_VERSION is defined as a string so there's no + * way to do a proper check here. Instead we guess based + * on the presence of #defines that were added between the + * 0.95 and 1.0 distributions. + */ +#if !defined(Z_NO_COMPRESSION) || !defined(Z_DEFLATED) +#error "Antiquated ZLIB software; you must use version 1.0 or later" +#endif + +/* + * State block for each open TIFF + * file using ZIP compression/decompression. + */ +typedef struct { + TIFFPredictorState predict; + z_stream stream; + int zipquality; /* compression level */ + int state; /* state flags */ +#define ZSTATE_INIT_DECODE 0x01 +#define ZSTATE_INIT_ENCODE 0x02 + + TIFFVGetMethod vgetparent; /* super-class method */ + TIFFVSetMethod vsetparent; /* super-class method */ +} ZIPState; + +#define ZState(tif) ((ZIPState*) (tif)->tif_data) +#define DecoderState(tif) ZState(tif) +#define EncoderState(tif) ZState(tif) + +static int ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s); +static int ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s); + +static int +ZIPFixupTags(TIFF* tif) +{ + (void) tif; + return (1); +} + +static int +ZIPSetupDecode(TIFF* tif) +{ + static const char module[] = "ZIPSetupDecode"; + ZIPState* sp = DecoderState(tif); + + assert(sp != NULL); + + /* if we were last encoding, terminate this mode */ + if (sp->state & ZSTATE_INIT_ENCODE) { + deflateEnd(&sp->stream); + sp->state = 0; + } + + if (inflateInit(&sp->stream) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg); + return (0); + } else { + sp->state |= ZSTATE_INIT_DECODE; + return (1); + } +} + +/* + * Setup state for decoding a strip. + */ +static int +ZIPPreDecode(TIFF* tif, uint16 s) +{ + static const char module[] = "ZIPPreDecode"; + ZIPState* sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + + if( (sp->state & ZSTATE_INIT_DECODE) == 0 ) + tif->tif_setupdecode( tif ); + + sp->stream.next_in = tif->tif_rawdata; + assert(sizeof(sp->stream.avail_in)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_in = (uInt) tif->tif_rawcc; + if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + return (inflateReset(&sp->stream) == Z_OK); +} + +static int +ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) +{ + static const char module[] = "ZIPDecode"; + ZIPState* sp = DecoderState(tif); + + (void) s; + assert(sp != NULL); + assert(sp->state == ZSTATE_INIT_DECODE); + + sp->stream.next_in = tif->tif_rawcp; + sp->stream.avail_in = (uInt) tif->tif_rawcc; + + sp->stream.next_out = op; + assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_out = (uInt) occ; + if ((tmsize_t)sp->stream.avail_out != occ) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + do { + int state = inflate(&sp->stream, Z_PARTIAL_FLUSH); + if (state == Z_STREAM_END) + break; + if (state == Z_DATA_ERROR) { + TIFFErrorExt(tif->tif_clientdata, module, + "Decoding error at scanline %lu, %s", + (unsigned long) tif->tif_row, sp->stream.msg); + if (inflateSync(&sp->stream) != Z_OK) + return (0); + continue; + } + if (state != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } while (sp->stream.avail_out > 0); + if (sp->stream.avail_out != 0) { + TIFFErrorExt(tif->tif_clientdata, module, + "Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)", + (unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out); + return (0); + } + + tif->tif_rawcp = sp->stream.next_in; + tif->tif_rawcc = sp->stream.avail_in; + + return (1); +} + +static int +ZIPSetupEncode(TIFF* tif) +{ + static const char module[] = "ZIPSetupEncode"; + ZIPState* sp = EncoderState(tif); + + assert(sp != NULL); + if (sp->state & ZSTATE_INIT_DECODE) { + inflateEnd(&sp->stream); + sp->state = 0; + } + + if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "%s", sp->stream.msg); + return (0); + } else { + sp->state |= ZSTATE_INIT_ENCODE; + return (1); + } +} + +/* + * Reset encoding state at the start of a strip. + */ +static int +ZIPPreEncode(TIFF* tif, uint16 s) +{ + static const char module[] = "ZIPPreEncode"; + ZIPState *sp = EncoderState(tif); + + (void) s; + assert(sp != NULL); + if( sp->state != ZSTATE_INIT_ENCODE ) + tif->tif_setupencode( tif ); + + sp->stream.next_out = tif->tif_rawdata; + assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_out = tif->tif_rawdatasize; + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + return (deflateReset(&sp->stream) == Z_OK); +} + +/* + * Encode a chunk of pixels. + */ +static int +ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) +{ + static const char module[] = "ZIPEncode"; + ZIPState *sp = EncoderState(tif); + + assert(sp != NULL); + assert(sp->state == ZSTATE_INIT_ENCODE); + + (void) s; + sp->stream.next_in = bp; + assert(sizeof(sp->stream.avail_in)==4); /* if this assert gets raised, + we need to simplify this code to reflect a ZLib that is likely updated + to deal with 8byte memory sizes, though this code will respond + apropriately even before we simplify it */ + sp->stream.avail_in = (uInt) cc; + if ((tmsize_t)sp->stream.avail_in != cc) + { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size"); + return (0); + } + do { + if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "Encoder error: %s", + sp->stream.msg); + return (0); + } + if (sp->stream.avail_out == 0) { + tif->tif_rawcc = tif->tif_rawdatasize; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */ + } + } while (sp->stream.avail_in > 0); + return (1); +} + +/* + * Finish off an encoded strip by flushing the last + * string and tacking on an End Of Information code. + */ +static int +ZIPPostEncode(TIFF* tif) +{ + static const char module[] = "ZIPPostEncode"; + ZIPState *sp = EncoderState(tif); + int state; + + sp->stream.avail_in = 0; + do { + state = deflate(&sp->stream, Z_FINISH); + switch (state) { + case Z_STREAM_END: + case Z_OK: + if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize) + { + tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out; + TIFFFlushData1(tif); + sp->stream.next_out = tif->tif_rawdata; + sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */ + } + break; + default: + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } while (state != Z_STREAM_END); + return (1); +} + +static void +ZIPCleanup(TIFF* tif) +{ + ZIPState* sp = ZState(tif); + + assert(sp != 0); + + (void)TIFFPredictorCleanup(tif); + + tif->tif_tagmethods.vgetfield = sp->vgetparent; + tif->tif_tagmethods.vsetfield = sp->vsetparent; + + if (sp->state & ZSTATE_INIT_ENCODE) { + deflateEnd(&sp->stream); + sp->state = 0; + } else if( sp->state & ZSTATE_INIT_DECODE) { + inflateEnd(&sp->stream); + sp->state = 0; + } + _TIFFfree(sp); + tif->tif_data = NULL; + + _TIFFSetDefaultCompressionState(tif); +} + +static int +ZIPVSetField(TIFF* tif, uint32 tag, va_list ap) +{ + static const char module[] = "ZIPVSetField"; + ZIPState* sp = ZState(tif); + + switch (tag) { + case TIFFTAG_ZIPQUALITY: + sp->zipquality = (int) va_arg(ap, int); + if ( sp->state&ZSTATE_INIT_ENCODE ) { + if (deflateParams(&sp->stream, + sp->zipquality, Z_DEFAULT_STRATEGY) != Z_OK) { + TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s", + sp->stream.msg); + return (0); + } + } + return (1); + default: + return (*sp->vsetparent)(tif, tag, ap); + } + /*NOTREACHED*/ +} + +static int +ZIPVGetField(TIFF* tif, uint32 tag, va_list ap) +{ + ZIPState* sp = ZState(tif); + + switch (tag) { + case TIFFTAG_ZIPQUALITY: + *va_arg(ap, int*) = sp->zipquality; + break; + default: + return (*sp->vgetparent)(tif, tag, ap); + } + return (1); +} + +static const TIFFField zipFields[] = { + { TIFFTAG_ZIPQUALITY, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "", NULL }, +}; + +int +TIFFInitZIP(TIFF* tif, int scheme) +{ + static const char module[] = "TIFFInitZIP"; + ZIPState* sp; + + assert( (scheme == COMPRESSION_DEFLATE) + || (scheme == COMPRESSION_ADOBE_DEFLATE)); + + /* + * Merge codec-specific tag information. + */ + if (!_TIFFMergeFields(tif, zipFields, TIFFArrayCount(zipFields))) { + TIFFErrorExt(tif->tif_clientdata, module, + "Merging Deflate codec-specific tags failed"); + return 0; + } + + /* + * Allocate state block so tag methods have storage to record values. + */ + tif->tif_data = (uint8*) _TIFFmalloc(sizeof (ZIPState)); + if (tif->tif_data == NULL) + goto bad; + sp = ZState(tif); + sp->stream.zalloc = NULL; + sp->stream.zfree = NULL; + sp->stream.opaque = NULL; + sp->stream.data_type = Z_BINARY; + + /* + * Override parent get/set field methods. + */ + sp->vgetparent = tif->tif_tagmethods.vgetfield; + tif->tif_tagmethods.vgetfield = ZIPVGetField; /* hook for codec tags */ + sp->vsetparent = tif->tif_tagmethods.vsetfield; + tif->tif_tagmethods.vsetfield = ZIPVSetField; /* hook for codec tags */ + + /* Default values for codec-specific fields */ + sp->zipquality = Z_DEFAULT_COMPRESSION; /* default comp. level */ + sp->state = 0; + + /* + * Install codec methods. + */ + tif->tif_fixuptags = ZIPFixupTags; + tif->tif_setupdecode = ZIPSetupDecode; + tif->tif_predecode = ZIPPreDecode; + tif->tif_decoderow = ZIPDecode; + tif->tif_decodestrip = ZIPDecode; + tif->tif_decodetile = ZIPDecode; + tif->tif_setupencode = ZIPSetupEncode; + tif->tif_preencode = ZIPPreEncode; + tif->tif_postencode = ZIPPostEncode; + tif->tif_encoderow = ZIPEncode; + tif->tif_encodestrip = ZIPEncode; + tif->tif_encodetile = ZIPEncode; + tif->tif_cleanup = ZIPCleanup; + /* + * Setup predictor setup. + */ + (void) TIFFPredictorInit(tif); + return (1); +bad: + TIFFErrorExt(tif->tif_clientdata, module, + "No space for ZIP state block"); + return (0); +} +#endif /* ZIP_SUPORT */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiff.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiff.h new file mode 100644 index 0000000..19b4e79 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiff.h @@ -0,0 +1,678 @@ +/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFF_ +#define _TIFF_ + +#include "tiffconf.h" + +/* + * Tag Image File Format (TIFF) + * + * Based on Rev 6.0 from: + * Developer's Desk + * Aldus Corporation + * 411 First Ave. South + * Suite 200 + * Seattle, WA 98104 + * 206-622-5500 + * + * (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf) + * + * For BigTIFF design notes see the following links + * http://www.remotesensing.org/libtiff/bigtiffdesign.html + * http://www.awaresystems.be/imaging/tiff/bigtiff.html + */ + +#define TIFF_VERSION_CLASSIC 42 +#define TIFF_VERSION_BIG 43 + +#define TIFF_BIGENDIAN 0x4d4d +#define TIFF_LITTLEENDIAN 0x4949 +#define MDI_LITTLEENDIAN 0x5045 +#define MDI_BIGENDIAN 0x4550 + +/* + * Intrinsic data types required by the file format: + * + * 8-bit quantities int8/uint8 + * 16-bit quantities int16/uint16 + * 32-bit quantities int32/uint32 + * 64-bit quantities int64/uint64 + * strings unsigned char* + */ + +typedef TIFF_INT8_T int8; +typedef TIFF_UINT8_T uint8; + +typedef TIFF_INT16_T int16; +typedef TIFF_UINT16_T uint16; + +typedef TIFF_INT32_T int32; +typedef TIFF_UINT32_T uint32; + +typedef TIFF_INT64_T int64; +typedef TIFF_UINT64_T uint64; + +/* + * Some types as promoted in a variable argument list + * We use uint16_vap rather then directly using int, because this way + * we document the type we actually want to pass through, conceptually, + * rather then confusing the issue by merely stating the type it gets + * promoted to + */ + +typedef int uint16_vap; + +/* + * TIFF header. + */ +typedef struct { + uint16 tiff_magic; /* magic number (defines byte order) */ + uint16 tiff_version; /* TIFF version number */ +} TIFFHeaderCommon; +typedef struct { + uint16 tiff_magic; /* magic number (defines byte order) */ + uint16 tiff_version; /* TIFF version number */ + uint32 tiff_diroff; /* byte offset to first directory */ +} TIFFHeaderClassic; +typedef struct { + uint16 tiff_magic; /* magic number (defines byte order) */ + uint16 tiff_version; /* TIFF version number */ + uint16 tiff_offsetsize; /* size of offsets, should be 8 */ + uint16 tiff_unused; /* unused word, should be 0 */ + uint64 tiff_diroff; /* byte offset to first directory */ +} TIFFHeaderBig; + + +/* + * NB: In the comments below, + * - items marked with a + are obsoleted by revision 5.0, + * - items marked with a ! are introduced in revision 6.0. + * - items marked with a % are introduced post revision 6.0. + * - items marked with a $ are obsoleted by revision 6.0. + * - items marked with a & are introduced by Adobe DNG specification. + */ + +/* + * Tag data type information. + * + * Note: RATIONALs are the ratio of two 32-bit integer values. + */ +typedef enum { + TIFF_NOTYPE = 0, /* placeholder */ + TIFF_BYTE = 1, /* 8-bit unsigned integer */ + TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ + TIFF_SHORT = 3, /* 16-bit unsigned integer */ + TIFF_LONG = 4, /* 32-bit unsigned integer */ + TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ + TIFF_SBYTE = 6, /* !8-bit signed integer */ + TIFF_UNDEFINED = 7, /* !8-bit untyped data */ + TIFF_SSHORT = 8, /* !16-bit signed integer */ + TIFF_SLONG = 9, /* !32-bit signed integer */ + TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ + TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ + TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ + TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */ + TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */ + TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */ + TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */ +} TIFFDataType; + +/* + * TIFF Tag Definitions. + */ +#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */ +#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */ +#define FILETYPE_PAGE 0x2 /* one page of many */ +#define FILETYPE_MASK 0x4 /* transparency mask */ +#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */ +#define OFILETYPE_IMAGE 1 /* full resolution image data */ +#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */ +#define OFILETYPE_PAGE 3 /* one page of many */ +#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */ +#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */ +#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */ +#define TIFFTAG_COMPRESSION 259 /* data compression technique */ +#define COMPRESSION_NONE 1 /* dump mode */ +#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */ +#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */ +#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */ +#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */ +#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */ +#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */ +#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */ +#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */ +#define COMPRESSION_T85 9 /* !TIFF/FX T.85 JBIG compression */ +#define COMPRESSION_T43 10 /* !TIFF/FX T.43 colour by layered JBIG compression */ +#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */ +#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */ +#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ +#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */ +/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT */ +#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */ +#define COMPRESSION_JBIG 34661 /* ISO JBIG */ +#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */ +#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */ +#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */ +#define COMPRESSION_LZMA 34925 /* LZMA2 */ +#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */ +#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */ +#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */ +#define PHOTOMETRIC_RGB 2 /* RGB color model */ +#define PHOTOMETRIC_PALETTE 3 /* color map indexed */ +#define PHOTOMETRIC_MASK 4 /* $holdout mask */ +#define PHOTOMETRIC_SEPARATED 5 /* !color separations */ +#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */ +#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */ +#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */ +#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */ +#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */ +#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */ +#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */ +#define THRESHHOLD_BILEVEL 1 /* b&w art scan */ +#define THRESHHOLD_HALFTONE 2 /* or dithered scan */ +#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */ +#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */ +#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */ +#define TIFFTAG_FILLORDER 266 /* data order within a byte */ +#define FILLORDER_MSB2LSB 1 /* most significant -> least */ +#define FILLORDER_LSB2MSB 2 /* least significant -> most */ +#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */ +#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ +#define TIFFTAG_MAKE 271 /* scanner manufacturer name */ +#define TIFFTAG_MODEL 272 /* scanner model name/number */ +#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */ +#define TIFFTAG_ORIENTATION 274 /* +image orientation */ +#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */ +#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */ +#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */ +#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */ +#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */ +#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */ +#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */ +#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */ +#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */ +#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */ +#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */ +#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */ +#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */ +#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */ +#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */ +#define TIFFTAG_PLANARCONFIG 284 /* storage organization */ +#define PLANARCONFIG_CONTIG 1 /* single image plane */ +#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */ +#define TIFFTAG_PAGENAME 285 /* page name image is from */ +#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */ +#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */ +#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */ +#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */ +#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */ +#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */ +#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */ +#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */ +#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ +#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */ +#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */ +#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */ +#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */ +#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */ +#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */ +#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */ +#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */ +#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */ +#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */ +#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */ +#define RESUNIT_NONE 1 /* no meaningful units */ +#define RESUNIT_INCH 2 /* english */ +#define RESUNIT_CENTIMETER 3 /* metric */ +#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */ +#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */ +#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */ +#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */ +#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */ +#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ +#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */ +#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */ +#define TIFFTAG_SOFTWARE 305 /* name & release */ +#define TIFFTAG_DATETIME 306 /* creation date and time */ +#define TIFFTAG_ARTIST 315 /* creator of image */ +#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ +#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */ +#define PREDICTOR_NONE 1 /* no prediction scheme used */ +#define PREDICTOR_HORIZONTAL 2 /* horizontal differencing */ +#define PREDICTOR_FLOATINGPOINT 3 /* floating point predictor */ +#define TIFFTAG_WHITEPOINT 318 /* image white point */ +#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */ +#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */ +#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */ +#define TIFFTAG_TILEWIDTH 322 /* !tile width in pixels */ +#define TIFFTAG_TILELENGTH 323 /* !tile height in pixels */ +#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */ +#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */ +#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */ +#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */ +#define CLEANFAXDATA_CLEAN 0 /* no errors detected */ +#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */ +#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */ +#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */ +#define TIFFTAG_SUBIFD 330 /* subimage descriptors */ +#define TIFFTAG_INKSET 332 /* !inks in separated image */ +#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */ +#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */ +#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ +#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ +#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ +#define TIFFTAG_TARGETPRINTER 337 /* !separation target */ +#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ +#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */ +#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */ +#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */ +#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */ +#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */ +#define SAMPLEFORMAT_INT 2 /* !signed integer data */ +#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */ +#define SAMPLEFORMAT_VOID 4 /* !untyped data */ +#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */ +#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */ +#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */ +#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */ +#define TIFFTAG_CLIPPATH 343 /* %ClipPath + [Adobe TIFF technote 2] */ +#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits + [Adobe TIFF technote 2] */ +#define TIFFTAG_YCLIPPATHUNITS 345 /* %YClipPathUnits + [Adobe TIFF technote 2] */ +#define TIFFTAG_INDEXED 346 /* %Indexed + [Adobe TIFF Technote 3] */ +#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */ +#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */ +/* Tags 400-435 are from the TIFF/FX spec */ +#define TIFFTAG_GLOBALPARAMETERSIFD 400 /* ! */ +#define TIFFTAG_PROFILETYPE 401 /* ! */ +#define PROFILETYPE_UNSPECIFIED 0 /* ! */ +#define PROFILETYPE_G3_FAX 1 /* ! */ +#define TIFFTAG_FAXPROFILE 402 /* ! */ +#define FAXPROFILE_S 1 /* !TIFF/FX FAX profile S */ +#define FAXPROFILE_F 2 /* !TIFF/FX FAX profile F */ +#define FAXPROFILE_J 3 /* !TIFF/FX FAX profile J */ +#define FAXPROFILE_C 4 /* !TIFF/FX FAX profile C */ +#define FAXPROFILE_L 5 /* !TIFF/FX FAX profile L */ +#define FAXPROFILE_M 6 /* !TIFF/FX FAX profile LM */ +#define TIFFTAG_CODINGMETHODS 403 /* !TIFF/FX coding methods */ +#define CODINGMETHODS_T4_1D (1 << 1) /* !T.4 1D */ +#define CODINGMETHODS_T4_2D (1 << 2) /* !T.4 2D */ +#define CODINGMETHODS_T6 (1 << 3) /* !T.6 */ +#define CODINGMETHODS_T85 (1 << 4) /* !T.85 JBIG */ +#define CODINGMETHODS_T42 (1 << 5) /* !T.42 JPEG */ +#define CODINGMETHODS_T43 (1 << 6) /* !T.43 colour by layered JBIG */ +#define TIFFTAG_VERSIONYEAR 404 /* !TIFF/FX version year */ +#define TIFFTAG_MODENUMBER 405 /* !TIFF/FX mode number */ +#define TIFFTAG_DECODE 433 /* !TIFF/FX decode */ +#define TIFFTAG_IMAGEBASECOLOR 434 /* !TIFF/FX image base colour */ +#define TIFFTAG_T82OPTIONS 435 /* !TIFF/FX T.82 options */ +/* + * Tags 512-521 are obsoleted by Technical Note #2 which specifies a + * revised JPEG-in-TIFF scheme. + */ +#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */ +#define JPEGPROC_BASELINE 1 /* !baseline sequential */ +#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */ +#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */ +#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */ +#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */ +#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */ +#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */ +#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */ +#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */ +#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */ +#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */ +#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */ +#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */ +#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */ +#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */ +#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */ +#define TIFFTAG_STRIPROWCOUNTS 559 /* !TIFF/FX strip row counts */ +#define TIFFTAG_XMLPACKET 700 /* %XML packet + [Adobe XMP Specification, + January 2004 */ +#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID + [Adobe TIFF technote] */ +/* tags 32952-32956 are private tags registered to Island Graphics */ +#define TIFFTAG_REFPTS 32953 /* image reference points */ +#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */ +#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */ +#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */ +/* tags 32995-32999 are private tags registered to SGI */ +#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */ +#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */ +#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */ +#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */ +/* tags 33300-33309 are private tags registered to Pixar */ +/* + * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH + * are set when an image has been cropped out of a larger image. + * They reflect the size of the original uncropped image. + * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used + * to determine the position of the smaller image in the larger one. + */ +#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */ +#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */ + /* Tags 33302-33306 are used to identify special image modes and data + * used by Pixar's texture formats. + */ +#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */ +#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */ +#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */ +#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305 +#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306 +/* tag 33405 is a private tag registered to Eastman Kodak */ +#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */ +/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */ +#define TIFFTAG_COPYRIGHT 33432 /* copyright string */ +/* IPTC TAG from RichTIFF specifications */ +#define TIFFTAG_RICHTIFFIPTC 33723 +/* 34016-34029 are reserved for ANSI IT8 TIFF/IT */ +#define TIFFTAG_STONITS 37439 /* Sample value to Nits */ +/* tag 34929 is a private tag registered to FedEx */ +#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */ +#define TIFFTAG_INTEROPERABILITYIFD 40965 /* Pointer to Interoperability private directory */ +/* Adobe Digital Negative (DNG) format tags */ +#define TIFFTAG_DNGVERSION 50706 /* &DNG version number */ +#define TIFFTAG_DNGBACKWARDVERSION 50707 /* &DNG compatibility version */ +#define TIFFTAG_UNIQUECAMERAMODEL 50708 /* &name for the camera model */ +#define TIFFTAG_LOCALIZEDCAMERAMODEL 50709 /* &localized camera model + name */ +#define TIFFTAG_CFAPLANECOLOR 50710 /* &CFAPattern->LinearRaw space + mapping */ +#define TIFFTAG_CFALAYOUT 50711 /* &spatial layout of the CFA */ +#define TIFFTAG_LINEARIZATIONTABLE 50712 /* &lookup table description */ +#define TIFFTAG_BLACKLEVELREPEATDIM 50713 /* &repeat pattern size for + the BlackLevel tag */ +#define TIFFTAG_BLACKLEVEL 50714 /* &zero light encoding level */ +#define TIFFTAG_BLACKLEVELDELTAH 50715 /* &zero light encoding level + differences (columns) */ +#define TIFFTAG_BLACKLEVELDELTAV 50716 /* &zero light encoding level + differences (rows) */ +#define TIFFTAG_WHITELEVEL 50717 /* &fully saturated encoding + level */ +#define TIFFTAG_DEFAULTSCALE 50718 /* &default scale factors */ +#define TIFFTAG_DEFAULTCROPORIGIN 50719 /* &origin of the final image + area */ +#define TIFFTAG_DEFAULTCROPSIZE 50720 /* &size of the final image + area */ +#define TIFFTAG_COLORMATRIX1 50721 /* &XYZ->reference color space + transformation matrix 1 */ +#define TIFFTAG_COLORMATRIX2 50722 /* &XYZ->reference color space + transformation matrix 2 */ +#define TIFFTAG_CAMERACALIBRATION1 50723 /* &calibration matrix 1 */ +#define TIFFTAG_CAMERACALIBRATION2 50724 /* &calibration matrix 2 */ +#define TIFFTAG_REDUCTIONMATRIX1 50725 /* &dimensionality reduction + matrix 1 */ +#define TIFFTAG_REDUCTIONMATRIX2 50726 /* &dimensionality reduction + matrix 2 */ +#define TIFFTAG_ANALOGBALANCE 50727 /* &gain applied the stored raw + values*/ +#define TIFFTAG_ASSHOTNEUTRAL 50728 /* &selected white balance in + linear reference space */ +#define TIFFTAG_ASSHOTWHITEXY 50729 /* &selected white balance in + x-y chromaticity + coordinates */ +#define TIFFTAG_BASELINEEXPOSURE 50730 /* &how much to move the zero + point */ +#define TIFFTAG_BASELINENOISE 50731 /* &relative noise level */ +#define TIFFTAG_BASELINESHARPNESS 50732 /* &relative amount of + sharpening */ +#define TIFFTAG_BAYERGREENSPLIT 50733 /* &how closely the values of + the green pixels in the + blue/green rows track the + values of the green pixels + in the red/green rows */ +#define TIFFTAG_LINEARRESPONSELIMIT 50734 /* &non-linear encoding range */ +#define TIFFTAG_CAMERASERIALNUMBER 50735 /* &camera's serial number */ +#define TIFFTAG_LENSINFO 50736 /* info about the lens */ +#define TIFFTAG_CHROMABLURRADIUS 50737 /* &chroma blur radius */ +#define TIFFTAG_ANTIALIASSTRENGTH 50738 /* &relative strength of the + camera's anti-alias filter */ +#define TIFFTAG_SHADOWSCALE 50739 /* &used by Adobe Camera Raw */ +#define TIFFTAG_DNGPRIVATEDATA 50740 /* &manufacturer's private data */ +#define TIFFTAG_MAKERNOTESAFETY 50741 /* &whether the EXIF MakerNote + tag is safe to preserve + along with the rest of the + EXIF data */ +#define TIFFTAG_CALIBRATIONILLUMINANT1 50778 /* &illuminant 1 */ +#define TIFFTAG_CALIBRATIONILLUMINANT2 50779 /* &illuminant 2 */ +#define TIFFTAG_BESTQUALITYSCALE 50780 /* &best quality multiplier */ +#define TIFFTAG_RAWDATAUNIQUEID 50781 /* &unique identifier for + the raw image data */ +#define TIFFTAG_ORIGINALRAWFILENAME 50827 /* &file name of the original + raw file */ +#define TIFFTAG_ORIGINALRAWFILEDATA 50828 /* &contents of the original + raw file */ +#define TIFFTAG_ACTIVEAREA 50829 /* &active (non-masked) pixels + of the sensor */ +#define TIFFTAG_MASKEDAREAS 50830 /* &list of coordinates + of fully masked pixels */ +#define TIFFTAG_ASSHOTICCPROFILE 50831 /* &these two tags used to */ +#define TIFFTAG_ASSHOTPREPROFILEMATRIX 50832 /* map cameras's color space + into ICC profile space */ +#define TIFFTAG_CURRENTICCPROFILE 50833 /* & */ +#define TIFFTAG_CURRENTPREPROFILEMATRIX 50834 /* & */ +/* tag 65535 is an undefined tag used by Eastman Kodak */ +#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */ + +/* + * The following are ``pseudo tags'' that can be used to control + * codec-specific functionality. These tags are not written to file. + * Note that these values start at 0xffff+1 so that they'll never + * collide with Aldus-assigned tags. + * + * If you want your private pseudo tags ``registered'' (i.e. added to + * this file), please post a bug report via the tracking system at + * http://www.remotesensing.org/libtiff/bugs.html with the appropriate + * C definitions to add. + */ +#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */ +#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */ +#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */ +#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */ +#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */ +#define FAXMODE_WORDALIGN 0x0008 /* word align row */ +#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */ +#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */ +/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */ +#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */ +#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */ +#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */ +#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */ +#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */ +#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */ +/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */ +#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */ +#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */ +#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */ +#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */ +#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */ +#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */ +#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */ +#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */ +/* 65550-65556 are allocated to Oceana Matrix */ +#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */ +#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */ +#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */ +#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */ +#define DCSIMAGERFILTER_IR 0 /* infrared filter */ +#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */ +#define DCSIMAGERFILTER_CFA 2 /* color filter array */ +#define DCSIMAGERFILTER_OTHER 3 /* other filter */ +#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */ +#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */ +#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */ +#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */ +#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */ +#define TIFFTAG_DCSGAMMA 65554 /* gamma value */ +#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */ +#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */ +/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ +#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ +#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ +/* 65559 is allocated to Oceana Matrix */ +#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ +#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */ +#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */ +#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */ +#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */ +#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */ +#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/ +#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/ +#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */ +#define TIFFTAG_LZMAPRESET 65562 /* LZMA2 preset (compression level) */ +#define TIFFTAG_PERSAMPLE 65563 /* interface for per sample tags */ +#define PERSAMPLE_MERGED 0 /* present as a single value */ +#define PERSAMPLE_MULTI 1 /* present as multiple values */ + +/* + * EXIF tags + */ +#define EXIFTAG_EXPOSURETIME 33434 /* Exposure time */ +#define EXIFTAG_FNUMBER 33437 /* F number */ +#define EXIFTAG_EXPOSUREPROGRAM 34850 /* Exposure program */ +#define EXIFTAG_SPECTRALSENSITIVITY 34852 /* Spectral sensitivity */ +#define EXIFTAG_ISOSPEEDRATINGS 34855 /* ISO speed rating */ +#define EXIFTAG_OECF 34856 /* Optoelectric conversion + factor */ +#define EXIFTAG_EXIFVERSION 36864 /* Exif version */ +#define EXIFTAG_DATETIMEORIGINAL 36867 /* Date and time of original + data generation */ +#define EXIFTAG_DATETIMEDIGITIZED 36868 /* Date and time of digital + data generation */ +#define EXIFTAG_COMPONENTSCONFIGURATION 37121 /* Meaning of each component */ +#define EXIFTAG_COMPRESSEDBITSPERPIXEL 37122 /* Image compression mode */ +#define EXIFTAG_SHUTTERSPEEDVALUE 37377 /* Shutter speed */ +#define EXIFTAG_APERTUREVALUE 37378 /* Aperture */ +#define EXIFTAG_BRIGHTNESSVALUE 37379 /* Brightness */ +#define EXIFTAG_EXPOSUREBIASVALUE 37380 /* Exposure bias */ +#define EXIFTAG_MAXAPERTUREVALUE 37381 /* Maximum lens aperture */ +#define EXIFTAG_SUBJECTDISTANCE 37382 /* Subject distance */ +#define EXIFTAG_METERINGMODE 37383 /* Metering mode */ +#define EXIFTAG_LIGHTSOURCE 37384 /* Light source */ +#define EXIFTAG_FLASH 37385 /* Flash */ +#define EXIFTAG_FOCALLENGTH 37386 /* Lens focal length */ +#define EXIFTAG_SUBJECTAREA 37396 /* Subject area */ +#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */ +#define EXIFTAG_USERCOMMENT 37510 /* User comments */ +#define EXIFTAG_SUBSECTIME 37520 /* DateTime subseconds */ +#define EXIFTAG_SUBSECTIMEORIGINAL 37521 /* DateTimeOriginal subseconds */ +#define EXIFTAG_SUBSECTIMEDIGITIZED 37522 /* DateTimeDigitized subseconds */ +#define EXIFTAG_FLASHPIXVERSION 40960 /* Supported Flashpix version */ +#define EXIFTAG_COLORSPACE 40961 /* Color space information */ +#define EXIFTAG_PIXELXDIMENSION 40962 /* Valid image width */ +#define EXIFTAG_PIXELYDIMENSION 40963 /* Valid image height */ +#define EXIFTAG_RELATEDSOUNDFILE 40964 /* Related audio file */ +#define EXIFTAG_FLASHENERGY 41483 /* Flash energy */ +#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484 /* Spatial frequency response */ +#define EXIFTAG_FOCALPLANEXRESOLUTION 41486 /* Focal plane X resolution */ +#define EXIFTAG_FOCALPLANEYRESOLUTION 41487 /* Focal plane Y resolution */ +#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488 /* Focal plane resolution unit */ +#define EXIFTAG_SUBJECTLOCATION 41492 /* Subject location */ +#define EXIFTAG_EXPOSUREINDEX 41493 /* Exposure index */ +#define EXIFTAG_SENSINGMETHOD 41495 /* Sensing method */ +#define EXIFTAG_FILESOURCE 41728 /* File source */ +#define EXIFTAG_SCENETYPE 41729 /* Scene type */ +#define EXIFTAG_CFAPATTERN 41730 /* CFA pattern */ +#define EXIFTAG_CUSTOMRENDERED 41985 /* Custom image processing */ +#define EXIFTAG_EXPOSUREMODE 41986 /* Exposure mode */ +#define EXIFTAG_WHITEBALANCE 41987 /* White balance */ +#define EXIFTAG_DIGITALZOOMRATIO 41988 /* Digital zoom ratio */ +#define EXIFTAG_FOCALLENGTHIN35MMFILM 41989 /* Focal length in 35 mm film */ +#define EXIFTAG_SCENECAPTURETYPE 41990 /* Scene capture type */ +#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ +#define EXIFTAG_CONTRAST 41992 /* Contrast */ +#define EXIFTAG_SATURATION 41993 /* Saturation */ +#define EXIFTAG_SHARPNESS 41994 /* Sharpness */ +#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995 /* Device settings description */ +#define EXIFTAG_SUBJECTDISTANCERANGE 41996 /* Subject distance range */ +#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ +#define EXIFTAG_GAINCONTROL 41991 /* Gain control */ +#define EXIFTAG_IMAGEUNIQUEID 42016 /* Unique image ID */ + +#endif /* _TIFF_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.h.in b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.h.in new file mode 100644 index 0000000..6da9c5a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.h.in @@ -0,0 +1,127 @@ +/* + Configuration defines for installed libtiff. + This file maintained for backward compatibility. Do not use definitions + from this file in your programs. +*/ + +#ifndef _TIFFCONF_ +#define _TIFFCONF_ + +/* Signed 16-bit type */ +#undef TIFF_INT16_T + +/* Signed 32-bit type */ +#undef TIFF_INT32_T + +/* Signed 64-bit type */ +#undef TIFF_INT64_T + +/* Signed 8-bit type */ +#undef TIFF_INT8_T + +/* Unsigned 16-bit type */ +#undef TIFF_UINT16_T + +/* Unsigned 32-bit type */ +#undef TIFF_UINT32_T + +/* Unsigned 64-bit type */ +#undef TIFF_UINT64_T + +/* Unsigned 8-bit type */ +#undef TIFF_UINT8_T + +/* Signed size type */ +#undef TIFF_SSIZE_T + +/* Pointer difference type */ +#undef TIFF_PTRDIFF_T + +/* Define to 1 if the system has the type `int16'. */ +#undef HAVE_INT16 + +/* Define to 1 if the system has the type `int32'. */ +#undef HAVE_INT32 + +/* Define to 1 if the system has the type `int8'. */ +#undef HAVE_INT8 + +/* Compatibility stuff. */ + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#undef HAVE_IEEEFP + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#undef HOST_FILLORDER + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#undef HOST_BIGENDIAN + +/* Support CCITT Group 3 & 4 algorithms */ +#undef CCITT_SUPPORT + +/* Support JPEG compression (requires IJG JPEG library) */ +#undef JPEG_SUPPORT + +/* Support JBIG compression (requires JBIG-KIT library) */ +#undef JBIG_SUPPORT + +/* Support LogLuv high dynamic range encoding */ +#undef LOGLUV_SUPPORT + +/* Support LZW algorithm */ +#undef LZW_SUPPORT + +/* Support NeXT 2-bit RLE algorithm */ +#undef NEXT_SUPPORT + +/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation + fails with unpatched IJG JPEG library) */ +#undef OJPEG_SUPPORT + +/* Support Macintosh PackBits algorithm */ +#undef PACKBITS_SUPPORT + +/* Support Pixar log-format algorithm (requires Zlib) */ +#undef PIXARLOG_SUPPORT + +/* Support ThunderScan 4-bit RLE algorithm */ +#undef THUNDER_SUPPORT + +/* Support Deflate compression */ +#undef ZIP_SUPPORT + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of ~8Kb to reduce memory usage) */ +#undef STRIPCHOP_DEFAULT + +/* Enable SubIFD tag (330) support */ +#undef SUBIFD_SUPPORT + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#undef DEFAULT_EXTRASAMPLE_AS_ALPHA + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#undef CHECK_JPEG_YCBCR_SUBSAMPLING + +/* Support MS MDI magic number files as TIFF */ +#undef MDI_SUPPORT + +/* + * Feature support definitions. + * XXX: These macros are obsoleted. Don't use them in your apps! + * Macros stays here for backward compatibility and should be always defined. + */ +#define COLORIMETRY_SUPPORT +#define YCBCR_SUPPORT +#define CMYK_SUPPORT +#define ICC_SUPPORT +#define PHOTOSHOP_SUPPORT +#define IPTC_SUPPORT + +#endif /* _TIFFCONF_ */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.vc.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.vc.h new file mode 100644 index 0000000..680f839 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.vc.h @@ -0,0 +1,160 @@ +/* + Configuration defines for installed libtiff. + This file maintained for backward compatibility. Do not use definitions + from this file in your programs. +*/ + +#ifndef _TIFFCONF_ +#define _TIFFCONF_ + +/* Define to 1 if the system has the type `int16'. */ +/* #undef HAVE_INT16 */ + +/* Define to 1 if the system has the type `int32'. */ +/* #undef HAVE_INT32 */ + +/* Define to 1 if the system has the type `int8'. */ +/* #undef HAVE_INT8 */ + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Signed 8-bit type */ +#define TIFF_INT8_T signed char + +/* Unsigned 8-bit type */ +#define TIFF_UINT8_T unsigned char + +/* Signed 16-bit type */ +#define TIFF_INT16_T signed short + +/* Unsigned 16-bit type */ +#define TIFF_UINT16_T unsigned short + +/* Signed 32-bit type formatter */ +#define TIFF_INT32_FORMAT "%d" + +/* Signed 32-bit type */ +#define TIFF_INT32_T signed int + +/* Unsigned 32-bit type formatter */ +#define TIFF_UINT32_FORMAT "%u" + +/* Unsigned 32-bit type */ +#define TIFF_UINT32_T unsigned int + +/* Signed 64-bit type formatter */ +#define TIFF_INT64_FORMAT "%I64d" + +/* Signed 64-bit type */ +#define TIFF_INT64_T signed __int64 + +/* Unsigned 64-bit type formatter */ +#define TIFF_UINT64_FORMAT "%I64u" + +/* Unsigned 64-bit type */ +#define TIFF_UINT64_T unsigned __int64 + +/* Signed size type */ +#if defined(_WIN64) +#define TIFF_SSIZE_T signed __int64 +#else +#define TIFF_SSIZE_T signed int +#endif + +/* Signed size type formatter */ +#if defined(_WIN64) +#define TIFF_SSIZE_FORMAT "%I64d" +#else +#define TIFF_SSIZE_FORMAT "%ld" +#endif + +/* Pointer difference type */ +#define TIFF_PTRDIFF_T long + +/* Compatibility stuff. */ + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#define HOST_BIGENDIAN 0 + +/* Support CCITT Group 3 & 4 algorithms */ +#define CCITT_SUPPORT 1 + +/* Support JPEG compression (requires IJG JPEG library) */ +/* #undef JPEG_SUPPORT */ + +/* Support JBIG compression (requires JBIG-KIT library) */ +/* #undef JBIG_SUPPORT */ + +/* Support LogLuv high dynamic range encoding */ +#define LOGLUV_SUPPORT 1 + +/* Support LZW algorithm */ +#define LZW_SUPPORT 1 + +/* Support NeXT 2-bit RLE algorithm */ +#define NEXT_SUPPORT 1 + +/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation + fails with unpatched IJG JPEG library) */ +/* #undef OJPEG_SUPPORT */ + +/* Support Macintosh PackBits algorithm */ +#define PACKBITS_SUPPORT 1 + +/* Support Pixar log-format algorithm (requires Zlib) */ +/* #undef PIXARLOG_SUPPORT */ + +/* Support ThunderScan 4-bit RLE algorithm */ +#define THUNDER_SUPPORT 1 + +/* Support Deflate compression */ +/* #undef ZIP_SUPPORT */ + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of ~8Kb to reduce memory usage) */ +#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP + +/* Enable SubIFD tag (330) support */ +#define SUBIFD_SUPPORT 1 + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 + +/* Support MS MDI magic number files as TIFF */ +/* #undef MDI_SUPPORT */ + +/* + * Feature support definitions. + * XXX: These macros are obsoleted. Don't use them in your apps! + * Macros stays here for backward compatibility and should be always defined. + */ +#define COLORIMETRY_SUPPORT +#define YCBCR_SUPPORT +#define CMYK_SUPPORT +#define ICC_SUPPORT +#define PHOTOSHOP_SUPPORT +#define IPTC_SUPPORT + +#endif /* _TIFFCONF_ */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.wince.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.wince.h new file mode 100644 index 0000000..2ef3958 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffconf.wince.h @@ -0,0 +1,121 @@ +/* $Id: tiffconf.wince.h,v 1.3 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Windows CE platform tiffconf.wince.h + * Created by Mateusz Loskot (mateusz@loskot.net) + * + * NOTE: Requires WCELIBCEX library with wceex_* functions, + * It's an extension to C library on Windows CE platform. + * For example, HAVE_STDIO_H definition indicates there are + * following files available: + * stdio.h - from Windows CE / Windows Mobile SDK + * wce_stdio.h - from WCELIBCEX library + */ + + +/* + Configuration defines for installed libtiff. + This file maintained for backward compatibility. Do not use definitions + from this file in your programs. +*/ + +#ifndef _WIN32_WCE +# error This version of tif_config.h header is dedicated for Windows CE platform! +#endif + + +#ifndef _TIFFCONF_ +#define _TIFFCONF_ + +/* Define to 1 if the system has the type `int16'. */ +/* #undef HAVE_INT16 */ + +/* Define to 1 if the system has the type `int32'. */ +/* #undef HAVE_INT32 */ + +/* Define to 1 if the system has the type `int8'. */ +/* #undef HAVE_INT8 */ + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* Compatibility stuff. */ + +/* Define as 0 or 1 according to the floating point format suported by the + machine */ +#define HAVE_IEEEFP 1 + +/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ +#define HOST_FILLORDER FILLORDER_LSB2MSB + +/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian + (Intel) */ +#define HOST_BIGENDIAN 0 + +/* Support CCITT Group 3 & 4 algorithms */ +#define CCITT_SUPPORT 1 + +/* Support JPEG compression (requires IJG JPEG library) */ +/* #undef JPEG_SUPPORT */ + +/* Support LogLuv high dynamic range encoding */ +#define LOGLUV_SUPPORT 1 + +/* Support LZW algorithm */ +#define LZW_SUPPORT 1 + +/* Support NeXT 2-bit RLE algorithm */ +#define NEXT_SUPPORT 1 + +/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation + fails with unpatched IJG JPEG library) */ +/* #undef OJPEG_SUPPORT */ + +/* Support Macintosh PackBits algorithm */ +#define PACKBITS_SUPPORT 1 + +/* Support Pixar log-format algorithm (requires Zlib) */ +/* #undef PIXARLOG_SUPPORT */ + +/* Support ThunderScan 4-bit RLE algorithm */ +#define THUNDER_SUPPORT 1 + +/* Support Deflate compression */ +/* #undef ZIP_SUPPORT */ + +/* Support strip chopping (whether or not to convert single-strip uncompressed + images to mutiple strips of ~8Kb to reduce memory usage) */ +#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP + +/* Enable SubIFD tag (330) support */ +#define SUBIFD_SUPPORT 1 + +/* Treat extra sample as alpha (default enabled). The RGBA interface will + treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many + packages produce RGBA files but don't mark the alpha properly. */ +#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 + +/* Pick up YCbCr subsampling info from the JPEG data stream to support files + lacking the tag (default enabled). */ +#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 + +/* + * Feature support definitions. + * XXX: These macros are obsoleted. Don't use them in your apps! + * Macros stays here for backward compatibility and should be always defined. + */ +#define COLORIMETRY_SUPPORT +#define YCBCR_SUPPORT +#define CMYK_SUPPORT +#define ICC_SUPPORT +#define PHOTOSHOP_SUPPORT +#define IPTC_SUPPORT + +#endif /* _TIFFCONF_ */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.h new file mode 100644 index 0000000..4e05272 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.h @@ -0,0 +1,558 @@ +/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFIO_ +#define _TIFFIO_ + +/* + * TIFF I/O Library Definitions. + */ +#include "tiff.h" +#include "tiffvers.h" + +/* + * TIFF is defined as an incomplete type to hide the + * library's internal data structures from clients. + */ +typedef struct tiff TIFF; + +/* + * The following typedefs define the intrinsic size of + * data types used in the *exported* interfaces. These + * definitions depend on the proper definition of types + * in tiff.h. Note also that the varargs interface used + * to pass tag types and values uses the types defined in + * tiff.h directly. + * + * NB: ttag_t is unsigned int and not unsigned short because + * ANSI C requires that the type before the ellipsis be a + * promoted type (i.e. one of int, unsigned int, pointer, + * or double) and because we defined pseudo-tags that are + * outside the range of legal Aldus-assigned tags. + * NB: tsize_t is int32 and not uint32 because some functions + * return -1. + * NB: toff_t is not off_t for many reasons; TIFFs max out at + * 32-bit file offsets, and BigTIFF maxes out at 64-bit + * offsets being the most important, and to ensure use of + * a consistently unsigned type across architectures. + * Prior to libtiff 4.0, this was an unsigned 32 bit type. + */ +/* + * this is the machine addressing size type, only it's signed, so make it + * int32 on 32bit machines, int64 on 64bit machines + */ +typedef TIFF_SSIZE_T tmsize_t; +typedef uint64 toff_t; /* file offset */ +/* the following are deprecated and should be replaced by their defining + counterparts */ +typedef uint32 ttag_t; /* directory tag */ +typedef uint16 tdir_t; /* directory index */ +typedef uint16 tsample_t; /* sample number */ +typedef uint32 tstrile_t; /* strip or tile number */ +typedef tstrile_t tstrip_t; /* strip number */ +typedef tstrile_t ttile_t; /* tile number */ +typedef tmsize_t tsize_t; /* i/o size in bytes */ +typedef void* tdata_t; /* image data ref */ + +#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) +#define __WIN32__ +#endif + +/* + * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c + * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). + * + * By default tif_unix.c is assumed. + */ + +#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) +# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO) +# define AVOID_WIN32_FILEIO +# endif +#endif + +#if defined(USE_WIN32_FILEIO) +# define VC_EXTRALEAN +# include +# ifdef __WIN32__ +DECLARE_HANDLE(thandle_t); /* Win32 file handle */ +# else +typedef HFILE thandle_t; /* client data handle */ +# endif /* __WIN32__ */ +#else +typedef void* thandle_t; /* client data handle */ +#endif /* USE_WIN32_FILEIO */ + +/* + * Flags to pass to TIFFPrintDirectory to control + * printing of data structures that are potentially + * very large. Bit-or these flags to enable printing + * multiple items. + */ +#define TIFFPRINT_NONE 0x0 /* no extra info */ +#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ +#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ +#define TIFFPRINT_COLORMAP 0x4 /* colormap */ +#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ +#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ +#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ + +/* + * Colour conversion stuff + */ + +/* reference white */ +#define D65_X0 (95.0470F) +#define D65_Y0 (100.0F) +#define D65_Z0 (108.8827F) + +#define D50_X0 (96.4250F) +#define D50_Y0 (100.0F) +#define D50_Z0 (82.4680F) + +/* Structure for holding information about a display device. */ + +typedef unsigned char TIFFRGBValue; /* 8-bit samples */ + +typedef struct { + float d_mat[3][3]; /* XYZ -> luminance matrix */ + float d_YCR; /* Light o/p for reference white */ + float d_YCG; + float d_YCB; + uint32 d_Vrwr; /* Pixel values for ref. white */ + uint32 d_Vrwg; + uint32 d_Vrwb; + float d_Y0R; /* Residual light for black pixel */ + float d_Y0G; + float d_Y0B; + float d_gammaR; /* Gamma values for the three guns */ + float d_gammaG; + float d_gammaB; +} TIFFDisplay; + +typedef struct { /* YCbCr->RGB support */ + TIFFRGBValue* clamptab; /* range clamping table */ + int* Cr_r_tab; + int* Cb_b_tab; + int32* Cr_g_tab; + int32* Cb_g_tab; + int32* Y_tab; +} TIFFYCbCrToRGB; + +typedef struct { /* CIE Lab 1976->RGB support */ + int range; /* Size of conversion table */ +#define CIELABTORGB_TABLE_RANGE 1500 + float rstep, gstep, bstep; + float X0, Y0, Z0; /* Reference white point */ + TIFFDisplay display; + float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ + float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ + float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ +} TIFFCIELabToRGB; + +/* + * RGBA-style image support. + */ +typedef struct _TIFFRGBAImage TIFFRGBAImage; +/* + * The image reading and conversion routines invoke + * ``put routines'' to copy/image/whatever tiles of + * raw image data. A default set of routines are + * provided to convert/copy raw image data to 8-bit + * packed ABGR format rasters. Applications can supply + * alternate routines that unpack the data into a + * different format or, for example, unpack the data + * and draw the unpacked raster on the display. + */ +typedef void (*tileContigRoutine) + (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, + unsigned char*); +typedef void (*tileSeparateRoutine) + (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, + unsigned char*, unsigned char*, unsigned char*, unsigned char*); +/* + * RGBA-reader state. + */ +struct _TIFFRGBAImage { + TIFF* tif; /* image handle */ + int stoponerr; /* stop on read error */ + int isContig; /* data is packed/separate */ + int alpha; /* type of alpha data present */ + uint32 width; /* image width */ + uint32 height; /* image height */ + uint16 bitspersample; /* image bits/sample */ + uint16 samplesperpixel; /* image samples/pixel */ + uint16 orientation; /* image orientation */ + uint16 req_orientation; /* requested orientation */ + uint16 photometric; /* image photometric interp */ + uint16* redcmap; /* colormap pallete */ + uint16* greencmap; + uint16* bluecmap; + /* get image data routine */ + int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32); + /* put decoded strip/tile */ + union { + void (*any)(TIFFRGBAImage*); + tileContigRoutine contig; + tileSeparateRoutine separate; + } put; + TIFFRGBValue* Map; /* sample mapping array */ + uint32** BWmap; /* black&white map */ + uint32** PALmap; /* palette image map */ + TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */ + TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */ + + uint8* UaToAa; /* Unassociated alpha to associated alpha convertion LUT */ + uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */ + + int row_offset; + int col_offset; +}; + +/* + * Macros for extracting components from the + * packed ABGR form returned by TIFFReadRGBAImage. + */ +#define TIFFGetR(abgr) ((abgr) & 0xff) +#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) +#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) +#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff) + +/* + * A CODEC is a software package that implements decoding, + * encoding, or decoding+encoding of a compression algorithm. + * The library provides a collection of builtin codecs. + * More codecs may be registered through calls to the library + * and/or the builtin implementations may be overridden. + */ +typedef int (*TIFFInitMethod)(TIFF*, int); +typedef struct { + char* name; + uint16 scheme; + TIFFInitMethod init; +} TIFFCodec; + +#include +#include + +/* share internal LogLuv conversion routines? */ +#ifndef LOGLUV_PUBLIC +#define LOGLUV_PUBLIC 1 +#endif + +#if !defined(__GNUC__) && !defined(__attribute__) +# define __attribute__(x) /*nothing*/ +#endif + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif +typedef void (*TIFFErrorHandler)(const char*, const char*, va_list); +typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list); +typedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t); +typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int); +typedef int (*TIFFCloseProc)(thandle_t); +typedef toff_t (*TIFFSizeProc)(thandle_t); +typedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size); +typedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size); +typedef void (*TIFFExtendProc)(TIFF*); + +extern const char* TIFFGetVersion(void); + +extern const TIFFCodec* TIFFFindCODEC(uint16); +extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod); +extern void TIFFUnRegisterCODEC(TIFFCodec*); +extern int TIFFIsCODECConfigured(uint16); +extern TIFFCodec* TIFFGetConfiguredCODECs(void); + +/* + * Auxiliary functions. + */ + +extern void* _TIFFmalloc(tmsize_t s); +extern void* _TIFFrealloc(void* p, tmsize_t s); +extern void _TIFFmemset(void* p, int v, tmsize_t c); +extern void _TIFFmemcpy(void* d, const void* s, tmsize_t c); +extern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c); +extern void _TIFFfree(void* p); + +/* +** Stuff, related to tag handling and creating custom tags. +*/ +extern int TIFFGetTagListCount( TIFF * ); +extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index ); + +#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ +#define TIFF_VARIABLE -1 /* marker for variable length tags */ +#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ +#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ + +#define FIELD_CUSTOM 65 + +typedef struct _TIFFField TIFFField; +typedef struct _TIFFFieldArray TIFFFieldArray; + +extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType); +extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32); +extern const TIFFField* TIFFFieldWithName(TIFF*, const char *); + +extern uint32 TIFFFieldTag(const TIFFField*); +extern const char* TIFFFieldName(const TIFFField*); +extern TIFFDataType TIFFFieldDataType(const TIFFField*); +extern int TIFFFieldPassCount(const TIFFField*); +extern int TIFFFieldReadCount(const TIFFField*); +extern int TIFFFieldWriteCount(const TIFFField*); + +typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list); +typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list); +typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); + +typedef struct { + TIFFVSetMethod vsetfield; /* tag set routine */ + TIFFVGetMethod vgetfield; /* tag get routine */ + TIFFPrintMethod printdir; /* directory print routine */ +} TIFFTagMethods; + +extern TIFFTagMethods *TIFFAccessTagMethods(TIFF *); +extern void *TIFFGetClientInfo(TIFF *, const char *); +extern void TIFFSetClientInfo(TIFF *, void *, const char *); + +extern void TIFFCleanup(TIFF* tif); +extern void TIFFClose(TIFF* tif); +extern int TIFFFlush(TIFF* tif); +extern int TIFFFlushData(TIFF* tif); +extern int TIFFGetField(TIFF* tif, uint32 tag, ...); +extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap); +extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...); +extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap); +extern int TIFFReadDirectory(TIFF* tif); +extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray); +extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff); +extern uint64 TIFFScanlineSize64(TIFF* tif); +extern tmsize_t TIFFScanlineSize(TIFF* tif); +extern uint64 TIFFRasterScanlineSize64(TIFF* tif); +extern tmsize_t TIFFRasterScanlineSize(TIFF* tif); +extern uint64 TIFFStripSize64(TIFF* tif); +extern tmsize_t TIFFStripSize(TIFF* tif); +extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip); +extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip); +extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows); +extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows); +extern uint64 TIFFTileRowSize64(TIFF* tif); +extern tmsize_t TIFFTileRowSize(TIFF* tif); +extern uint64 TIFFTileSize64(TIFF* tif); +extern tmsize_t TIFFTileSize(TIFF* tif); +extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows); +extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows); +extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request); +extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*); +extern int TIFFFileno(TIFF*); +extern int TIFFSetFileno(TIFF*, int); +extern thandle_t TIFFClientdata(TIFF*); +extern thandle_t TIFFSetClientdata(TIFF*, thandle_t); +extern int TIFFGetMode(TIFF*); +extern int TIFFSetMode(TIFF*, int); +extern int TIFFIsTiled(TIFF*); +extern int TIFFIsByteSwapped(TIFF*); +extern int TIFFIsUpSampled(TIFF*); +extern int TIFFIsMSB2LSB(TIFF*); +extern int TIFFIsBigEndian(TIFF*); +extern TIFFReadWriteProc TIFFGetReadProc(TIFF*); +extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*); +extern TIFFSeekProc TIFFGetSeekProc(TIFF*); +extern TIFFCloseProc TIFFGetCloseProc(TIFF*); +extern TIFFSizeProc TIFFGetSizeProc(TIFF*); +extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*); +extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*); +extern uint32 TIFFCurrentRow(TIFF*); +extern uint16 TIFFCurrentDirectory(TIFF*); +extern uint16 TIFFNumberOfDirectories(TIFF*); +extern uint64 TIFFCurrentDirOffset(TIFF*); +extern uint32 TIFFCurrentStrip(TIFF*); +extern uint32 TIFFCurrentTile(TIFF* tif); +extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size); +extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size); +extern int TIFFSetupStrips(TIFF *); +extern int TIFFWriteCheck(TIFF*, int, const char *); +extern void TIFFFreeDirectory(TIFF*); +extern int TIFFCreateDirectory(TIFF*); +extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*); +extern int TIFFCreateEXIFDirectory(TIFF*); +extern int TIFFLastDirectory(TIFF*); +extern int TIFFSetDirectory(TIFF*, uint16); +extern int TIFFSetSubDirectory(TIFF*, uint64); +extern int TIFFUnlinkDirectory(TIFF*, uint16); +extern int TIFFSetField(TIFF*, uint32, ...); +extern int TIFFVSetField(TIFF*, uint32, va_list); +extern int TIFFUnsetField(TIFF*, uint32); +extern int TIFFWriteDirectory(TIFF *); +extern int TIFFWriteCustomDirectory(TIFF *, uint64 *); +extern int TIFFCheckpointDirectory(TIFF *); +extern int TIFFRewriteDirectory(TIFF *); + +#if defined(c_plusplus) || defined(__cplusplus) +extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0); +extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); +extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0); +extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0); +extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, + int = ORIENTATION_BOTLEFT, int = 0); +#else +extern void TIFFPrintDirectory(TIFF*, FILE*, long); +extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); +extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample); +extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int); +extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int); +#endif + +extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * ); +extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * ); +extern int TIFFRGBAImageOK(TIFF*, char [1024]); +extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]); +extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32); +extern void TIFFRGBAImageEnd(TIFFRGBAImage*); +extern TIFF* TIFFOpen(const char*, const char*); +# ifdef __WIN32__ +extern TIFF* TIFFOpenW(const wchar_t*, const char*); +# endif /* __WIN32__ */ +extern TIFF* TIFFFdOpen(int, const char*, const char*); +extern TIFF* TIFFFdOpenNoCloseProc(int, const char*, const char*); +extern TIFF* TIFFClientOpen(const char*, const char*, + thandle_t, + TIFFReadWriteProc, TIFFReadWriteProc, + TIFFSeekProc, TIFFCloseProc, + TIFFSizeProc, + TIFFMapFileProc, TIFFUnmapFileProc); +extern const char* TIFFFileName(TIFF*); +extern const char* TIFFSetFileName(TIFF*, const char *); +extern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); +extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); +extern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3))); +extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4))); +extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); +extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt); +extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler); +extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt); +extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc); +extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); +extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s); +extern uint32 TIFFNumberOfTiles(TIFF*); +extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); +extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s); +extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16); +extern uint32 TIFFNumberOfStrips(TIFF*); +extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); +extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size); +extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); +extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size); +extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); +extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc); +extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); +extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc); +extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */ +extern void TIFFSetWriteOffset(TIFF* tif, toff_t off); +extern void TIFFSwabShort(uint16*); +extern void TIFFSwabLong(uint32*); +extern void TIFFSwabLong8(uint64*); +extern void TIFFSwabFloat(float*); +extern void TIFFSwabDouble(double*); +extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n); +extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n); +extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n); +extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n); +extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n); +extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n); +extern void TIFFReverseBits(uint8* cp, tmsize_t n); +extern const unsigned char* TIFFGetBitRevTable(int); + +#ifdef LOGLUV_PUBLIC +#define U_NEU 0.210526316 +#define V_NEU 0.473684211 +#define UVSCALE 410. +extern double LogL16toY(int); +extern double LogL10toY(int); +extern void XYZtoRGB24(float*, uint8*); +extern int uv_decode(double*, double*, int); +extern void LogLuv24toXYZ(uint32, float*); +extern void LogLuv32toXYZ(uint32, float*); +#if defined(c_plusplus) || defined(__cplusplus) +extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER); +extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER); +extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER); +extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER); +extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER); +#else +extern int LogL16fromY(double, int); +extern int LogL10fromY(double, int); +extern int uv_encode(double, double, int); +extern uint32 LogLuv24fromXYZ(float*, int); +extern uint32 LogLuv32fromXYZ(float*, int); +#endif +#endif /* LOGLUV_PUBLIC */ + +extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*); +extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, + float *, float *, float *); +extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, + uint32 *, uint32 *, uint32 *); + +extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*); +extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, + uint32 *, uint32 *, uint32 *); + +/**************************************************************************** + * O B S O L E T E D I N T E R F A C E S + * + * Don't use this stuff in your applications, it may be removed in the future + * libtiff versions. + ****************************************************************************/ +typedef struct { + ttag_t field_tag; /* field's tag */ + short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ + short field_writecount; /* write count/TIFF_VARIABLE */ + TIFFDataType field_type; /* type of associated data */ + unsigned short field_bit; /* bit in fieldsset bit vector */ + unsigned char field_oktochange; /* if true, can change while writing */ + unsigned char field_passcount; /* if true, pass dir count on set */ + char *field_name; /* ASCII name */ +} TIFFFieldInfo; + +extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + +#endif /* _TIFFIO_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.hxx b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.hxx new file mode 100644 index 0000000..ed994f1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffio.hxx @@ -0,0 +1,49 @@ +/* $Id: tiffio.hxx,v 1.3 2010-06-08 18:55:15 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFIO_HXX_ +#define _TIFFIO_HXX_ + +/* + * TIFF I/O library definitions which provide C++ streams API. + */ + +#include +#include "tiff.h" + +extern TIFF* TIFFStreamOpen(const char*, std::ostream *); +extern TIFF* TIFFStreamOpen(const char*, std::istream *); + +#endif /* _TIFFIO_HXX_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c++ + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffiop.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffiop.h new file mode 100644 index 0000000..53357d8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffiop.h @@ -0,0 +1,367 @@ +/* $Id: tiffiop.h,v 1.84 2012-05-30 01:50:17 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFIOP_ +#define _TIFFIOP_ +/* + * ``Library-private'' definitions. + */ + +#include "tif_config.h" + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_STRING_H +# include +#endif + +#ifdef HAVE_ASSERT_H +# include +#else +# define assert(x) +#endif + +#ifdef HAVE_SEARCH_H +# include +#else +extern void *lfind(const void *, const void *, size_t *, size_t, + int (*)(const void *, const void *)); +#endif + +#include "tiffio.h" + +#include "tif_dir.h" + +#ifndef STRIP_SIZE_DEFAULT +# define STRIP_SIZE_DEFAULT 8192 +#endif + +#define streq(a,b) (strcmp(a,b) == 0) + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +typedef struct client_info { + struct client_info *next; + void *data; + char *name; +} TIFFClientInfoLink; + +/* + * Typedefs for ``method pointers'' used internally. + * these are depriciated and provided only for backwards compatibility + */ +typedef unsigned char tidataval_t; /* internal image data value type */ +typedef tidataval_t* tidata_t; /* reference to internal image data */ + +typedef void (*TIFFVoidMethod)(TIFF*); +typedef int (*TIFFBoolMethod)(TIFF*); +typedef int (*TIFFPreMethod)(TIFF*, uint16); +typedef int (*TIFFCodeMethod)(TIFF* tif, uint8* buf, tmsize_t size, uint16 sample); +typedef int (*TIFFSeekMethod)(TIFF*, uint32); +typedef void (*TIFFPostMethod)(TIFF* tif, uint8* buf, tmsize_t size); +typedef uint32 (*TIFFStripMethod)(TIFF*, uint32); +typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*); + +struct tiff { + char* tif_name; /* name of open file */ + int tif_fd; /* open file descriptor */ + int tif_mode; /* open mode (O_*) */ + uint32 tif_flags; + #define TIFF_FILLORDER 0x00003 /* natural bit fill order for machine */ + #define TIFF_DIRTYHEADER 0x00004 /* header must be written on close */ + #define TIFF_DIRTYDIRECT 0x00008 /* current directory must be written */ + #define TIFF_BUFFERSETUP 0x00010 /* data buffers setup */ + #define TIFF_CODERSETUP 0x00020 /* encoder/decoder setup done */ + #define TIFF_BEENWRITING 0x00040 /* written 1+ scanlines to file */ + #define TIFF_SWAB 0x00080 /* byte swap file information */ + #define TIFF_NOBITREV 0x00100 /* inhibit bit reversal logic */ + #define TIFF_MYBUFFER 0x00200 /* my raw data buffer; free on close */ + #define TIFF_ISTILED 0x00400 /* file is tile, not strip- based */ + #define TIFF_MAPPED 0x00800 /* file is mapped into memory */ + #define TIFF_POSTENCODE 0x01000 /* need call to postencode routine */ + #define TIFF_INSUBIFD 0x02000 /* currently writing a subifd */ + #define TIFF_UPSAMPLED 0x04000 /* library is doing data up-sampling */ + #define TIFF_STRIPCHOP 0x08000 /* enable strip chopping support */ + #define TIFF_HEADERONLY 0x10000 /* read header only, do not process the first directory */ + #define TIFF_NOREADRAW 0x20000 /* skip reading of raw uncompressed image data */ + #define TIFF_INCUSTOMIFD 0x40000 /* currently writing a custom IFD */ + #define TIFF_BIGTIFF 0x80000 /* read/write bigtiff */ + #define TIFF_BUF4WRITE 0x100000 /* rawcc bytes are for writing */ + #define TIFF_DIRTYSTRIP 0x200000 /* stripoffsets/stripbytecount dirty*/ + #define TIFF_PERSAMPLE 0x400000 /* get/set per sample tags as arrays */ + #define TIFF_BUFFERMMAP 0x800000 /* read buffer (tif_rawdata) points into mmap() memory */ + uint64 tif_diroff; /* file offset of current directory */ + uint64 tif_nextdiroff; /* file offset of following directory */ + uint64* tif_dirlist; /* list of offsets to already seen directories to prevent IFD looping */ + uint16 tif_dirlistsize; /* number of entires in offset list */ + uint16 tif_dirnumber; /* number of already seen directories */ + TIFFDirectory tif_dir; /* internal rep of current directory */ + TIFFDirectory tif_customdir; /* custom IFDs are separated from the main ones */ + union { + TIFFHeaderCommon common; + TIFFHeaderClassic classic; + TIFFHeaderBig big; + } tif_header; + uint16 tif_header_size; /* file's header block and its length */ + uint32 tif_row; /* current scanline */ + uint16 tif_curdir; /* current directory (index) */ + uint32 tif_curstrip; /* current strip for read/write */ + uint64 tif_curoff; /* current offset for read/write */ + uint64 tif_dataoff; /* current offset for writing dir */ + /* SubIFD support */ + uint16 tif_nsubifd; /* remaining subifds to write */ + uint64 tif_subifdoff; /* offset for patching SubIFD link */ + /* tiling support */ + uint32 tif_col; /* current column (offset by row too) */ + uint32 tif_curtile; /* current tile for read/write */ + tmsize_t tif_tilesize; /* # of bytes in a tile */ + /* compression scheme hooks */ + int tif_decodestatus; + TIFFBoolMethod tif_fixuptags; /* called in TIFFReadDirectory */ + TIFFBoolMethod tif_setupdecode; /* called once before predecode */ + TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */ + TIFFBoolMethod tif_setupencode; /* called once before preencode */ + int tif_encodestatus; + TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */ + TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */ + TIFFCodeMethod tif_decoderow; /* scanline decoding routine */ + TIFFCodeMethod tif_encoderow; /* scanline encoding routine */ + TIFFCodeMethod tif_decodestrip; /* strip decoding routine */ + TIFFCodeMethod tif_encodestrip; /* strip encoding routine */ + TIFFCodeMethod tif_decodetile; /* tile decoding routine */ + TIFFCodeMethod tif_encodetile; /* tile encoding routine */ + TIFFVoidMethod tif_close; /* cleanup-on-close routine */ + TIFFSeekMethod tif_seek; /* position within a strip routine */ + TIFFVoidMethod tif_cleanup; /* cleanup state routine */ + TIFFStripMethod tif_defstripsize; /* calculate/constrain strip size */ + TIFFTileMethod tif_deftilesize; /* calculate/constrain tile size */ + uint8* tif_data; /* compression scheme private data */ + /* input/output buffering */ + tmsize_t tif_scanlinesize; /* # of bytes in a scanline */ + tmsize_t tif_scanlineskew; /* scanline skew for reading strips */ + uint8* tif_rawdata; /* raw data buffer */ + tmsize_t tif_rawdatasize; /* # of bytes in raw data buffer */ + tmsize_t tif_rawdataoff; /* rawdata offset within strip */ + tmsize_t tif_rawdataloaded;/* amount of data in rawdata */ + uint8* tif_rawcp; /* current spot in raw buffer */ + tmsize_t tif_rawcc; /* bytes unread from raw buffer */ + /* memory-mapped file support */ + uint8* tif_base; /* base of mapped file */ + tmsize_t tif_size; /* size of mapped file region (bytes, thus tmsize_t) */ + TIFFMapFileProc tif_mapproc; /* map file method */ + TIFFUnmapFileProc tif_unmapproc; /* unmap file method */ + /* input/output callback methods */ + thandle_t tif_clientdata; /* callback parameter */ + TIFFReadWriteProc tif_readproc; /* read method */ + TIFFReadWriteProc tif_writeproc; /* write method */ + TIFFSeekProc tif_seekproc; /* lseek method */ + TIFFCloseProc tif_closeproc; /* close method */ + TIFFSizeProc tif_sizeproc; /* filesize method */ + /* post-decoding support */ + TIFFPostMethod tif_postdecode; /* post decoding routine */ + /* tag support */ + TIFFField** tif_fields; /* sorted table of registered tags */ + size_t tif_nfields; /* # entries in registered tag table */ + const TIFFField* tif_foundfield; /* cached pointer to already found tag */ + TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */ + TIFFClientInfoLink* tif_clientinfo; /* extra client information. */ + /* Backward compatibility stuff. We need these two fields for + * setting up an old tag extension scheme. */ + TIFFFieldArray* tif_fieldscompat; + size_t tif_nfieldscompat; +}; + +#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */ + +#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0) +#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0) +#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0) +#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0) +#define TIFFReadFile(tif, buf, size) \ + ((*(tif)->tif_readproc)((tif)->tif_clientdata,(buf),(size))) +#define TIFFWriteFile(tif, buf, size) \ + ((*(tif)->tif_writeproc)((tif)->tif_clientdata,(buf),(size))) +#define TIFFSeekFile(tif, off, whence) \ + ((*(tif)->tif_seekproc)((tif)->tif_clientdata,(off),(whence))) +#define TIFFCloseFile(tif) \ + ((*(tif)->tif_closeproc)((tif)->tif_clientdata)) +#define TIFFGetFileSize(tif) \ + ((*(tif)->tif_sizeproc)((tif)->tif_clientdata)) +#define TIFFMapFileContents(tif, paddr, psize) \ + ((*(tif)->tif_mapproc)((tif)->tif_clientdata,(paddr),(psize))) +#define TIFFUnmapFileContents(tif, addr, size) \ + ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,(addr),(size))) + +/* + * Default Read/Seek/Write definitions. + */ +#ifndef ReadOK +#define ReadOK(tif, buf, size) \ + (TIFFReadFile((tif),(buf),(size))==(size)) +#endif +#ifndef SeekOK +#define SeekOK(tif, off) \ + (TIFFSeekFile((tif),(off),SEEK_SET)==(off)) +#endif +#ifndef WriteOK +#define WriteOK(tif, buf, size) \ + (TIFFWriteFile((tif),(buf),(size))==(size)) +#endif + +/* NB: the uint32 casts are to silence certain ANSI-C compilers */ +#define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \ + ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \ + 0U) +#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) +#define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y)) +#define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y))) +#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3) +#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y)) + +/* Safe multiply which returns zero if there is an integer overflow */ +#define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0) + +#define TIFFmax(A,B) ((A)>(B)?(A):(B)) +#define TIFFmin(A,B) ((A)<(B)?(A):(B)) + +#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0])) + +#if defined(__cplusplus) +extern "C" { +#endif +extern int _TIFFgetMode(const char* mode, const char* module); +extern int _TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s); +extern int _TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s); +extern int _TIFFNoTileEncode(TIFF*, uint8* pp, tmsize_t cc, uint16 s); +extern int _TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s); +extern int _TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s); +extern int _TIFFNoTileDecode(TIFF*, uint8* pp, tmsize_t cc, uint16 s); +extern void _TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc); +extern int _TIFFNoPreCode(TIFF* tif, uint16 s); +extern int _TIFFNoSeek(TIFF* tif, uint32 off); +extern void _TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc); +extern void _TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc); +extern void _TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc); +extern void _TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc); +extern int TIFFFlushData1(TIFF* tif); +extern int TIFFDefaultDirectory(TIFF* tif); +extern void _TIFFSetDefaultCompressionState(TIFF* tif); +extern int _TIFFRewriteField(TIFF *, uint16, TIFFDataType, tmsize_t, void *); +extern int TIFFSetCompressionScheme(TIFF* tif, int scheme); +extern int TIFFSetDefaultCompressionState(TIFF* tif); +extern uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s); +extern void _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th); +extern int _TIFFDataSize(TIFFDataType type); + +extern void _TIFFsetByteArray(void**, void*, uint32); +extern void _TIFFsetString(char**, char*); +extern void _TIFFsetShortArray(uint16**, uint16*, uint32); +extern void _TIFFsetLongArray(uint32**, uint32*, uint32); +extern void _TIFFsetFloatArray(float**, float*, uint32); +extern void _TIFFsetDoubleArray(double**, double*, uint32); + +extern void _TIFFprintAscii(FILE*, const char*); +extern void _TIFFprintAsciiTag(FILE*, const char*, const char*); + +extern TIFFErrorHandler _TIFFwarningHandler; +extern TIFFErrorHandler _TIFFerrorHandler; +extern TIFFErrorHandlerExt _TIFFwarningHandlerExt; +extern TIFFErrorHandlerExt _TIFFerrorHandlerExt; + +extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*); +extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*); +extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*); +extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*); + +extern double _TIFFUInt64ToDouble(uint64); +extern float _TIFFUInt64ToFloat(uint64); + +extern int TIFFInitDumpMode(TIFF*, int); +#ifdef PACKBITS_SUPPORT +extern int TIFFInitPackBits(TIFF*, int); +#endif +#ifdef CCITT_SUPPORT +extern int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int); +extern int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int); +#endif +#ifdef THUNDER_SUPPORT +extern int TIFFInitThunderScan(TIFF*, int); +#endif +#ifdef NEXT_SUPPORT +extern int TIFFInitNeXT(TIFF*, int); +#endif +#ifdef LZW_SUPPORT +extern int TIFFInitLZW(TIFF*, int); +#endif +#ifdef OJPEG_SUPPORT +extern int TIFFInitOJPEG(TIFF*, int); +#endif +#ifdef JPEG_SUPPORT +extern int TIFFInitJPEG(TIFF*, int); +#endif +#ifdef JBIG_SUPPORT +extern int TIFFInitJBIG(TIFF*, int); +#endif +#ifdef ZIP_SUPPORT +extern int TIFFInitZIP(TIFF*, int); +#endif +#ifdef PIXARLOG_SUPPORT +extern int TIFFInitPixarLog(TIFF*, int); +#endif +#ifdef LOGLUV_SUPPORT +extern int TIFFInitSGILog(TIFF*, int); +#endif +#ifdef LZMA_SUPPORT +extern int TIFFInitLZMA(TIFF*, int); +#endif +#ifdef VMS +extern const TIFFCodec _TIFFBuiltinCODECS[]; +#else +extern TIFFCodec _TIFFBuiltinCODECS[]; +#endif + +#if defined(__cplusplus) +} +#endif +#endif /* _TIFFIOP_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffvers.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffvers.h new file mode 100644 index 0000000..40edc81 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/tiffvers.h @@ -0,0 +1,9 @@ +#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.0.3\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." +/* + * This define can be used in code that requires + * compilation-related definitions specific to a + * version or versions of the library. Runtime + * version checking should be done based on the + * string returned by TIFFGetVersion. + */ +#define TIFFLIB_VERSION 20120922 diff --git a/thirdparty/LibTIFF/tiff-4.0.3/libtiff/uvcode.h b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/uvcode.h new file mode 100644 index 0000000..50f11d7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/libtiff/uvcode.h @@ -0,0 +1,180 @@ +/* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */ +#define UV_SQSIZ (float)0.003500 +#define UV_NDIVS 16289 +#define UV_VSTART (float)0.016940 +#define UV_NVS 163 +static struct { + float ustart; + short nus, ncum; +} uv_row[UV_NVS] = { + { (float)0.247663, 4, 0 }, + { (float)0.243779, 6, 4 }, + { (float)0.241684, 7, 10 }, + { (float)0.237874, 9, 17 }, + { (float)0.235906, 10, 26 }, + { (float)0.232153, 12, 36 }, + { (float)0.228352, 14, 48 }, + { (float)0.226259, 15, 62 }, + { (float)0.222371, 17, 77 }, + { (float)0.220410, 18, 94 }, + { (float)0.214710, 21, 112 }, + { (float)0.212714, 22, 133 }, + { (float)0.210721, 23, 155 }, + { (float)0.204976, 26, 178 }, + { (float)0.202986, 27, 204 }, + { (float)0.199245, 29, 231 }, + { (float)0.195525, 31, 260 }, + { (float)0.193560, 32, 291 }, + { (float)0.189878, 34, 323 }, + { (float)0.186216, 36, 357 }, + { (float)0.186216, 36, 393 }, + { (float)0.182592, 38, 429 }, + { (float)0.179003, 40, 467 }, + { (float)0.175466, 42, 507 }, + { (float)0.172001, 44, 549 }, + { (float)0.172001, 44, 593 }, + { (float)0.168612, 46, 637 }, + { (float)0.168612, 46, 683 }, + { (float)0.163575, 49, 729 }, + { (float)0.158642, 52, 778 }, + { (float)0.158642, 52, 830 }, + { (float)0.158642, 52, 882 }, + { (float)0.153815, 55, 934 }, + { (float)0.153815, 55, 989 }, + { (float)0.149097, 58, 1044 }, + { (float)0.149097, 58, 1102 }, + { (float)0.142746, 62, 1160 }, + { (float)0.142746, 62, 1222 }, + { (float)0.142746, 62, 1284 }, + { (float)0.138270, 65, 1346 }, + { (float)0.138270, 65, 1411 }, + { (float)0.138270, 65, 1476 }, + { (float)0.132166, 69, 1541 }, + { (float)0.132166, 69, 1610 }, + { (float)0.126204, 73, 1679 }, + { (float)0.126204, 73, 1752 }, + { (float)0.126204, 73, 1825 }, + { (float)0.120381, 77, 1898 }, + { (float)0.120381, 77, 1975 }, + { (float)0.120381, 77, 2052 }, + { (float)0.120381, 77, 2129 }, + { (float)0.112962, 82, 2206 }, + { (float)0.112962, 82, 2288 }, + { (float)0.112962, 82, 2370 }, + { (float)0.107450, 86, 2452 }, + { (float)0.107450, 86, 2538 }, + { (float)0.107450, 86, 2624 }, + { (float)0.107450, 86, 2710 }, + { (float)0.100343, 91, 2796 }, + { (float)0.100343, 91, 2887 }, + { (float)0.100343, 91, 2978 }, + { (float)0.095126, 95, 3069 }, + { (float)0.095126, 95, 3164 }, + { (float)0.095126, 95, 3259 }, + { (float)0.095126, 95, 3354 }, + { (float)0.088276, 100, 3449 }, + { (float)0.088276, 100, 3549 }, + { (float)0.088276, 100, 3649 }, + { (float)0.088276, 100, 3749 }, + { (float)0.081523, 105, 3849 }, + { (float)0.081523, 105, 3954 }, + { (float)0.081523, 105, 4059 }, + { (float)0.081523, 105, 4164 }, + { (float)0.074861, 110, 4269 }, + { (float)0.074861, 110, 4379 }, + { (float)0.074861, 110, 4489 }, + { (float)0.074861, 110, 4599 }, + { (float)0.068290, 115, 4709 }, + { (float)0.068290, 115, 4824 }, + { (float)0.068290, 115, 4939 }, + { (float)0.068290, 115, 5054 }, + { (float)0.063573, 119, 5169 }, + { (float)0.063573, 119, 5288 }, + { (float)0.063573, 119, 5407 }, + { (float)0.063573, 119, 5526 }, + { (float)0.057219, 124, 5645 }, + { (float)0.057219, 124, 5769 }, + { (float)0.057219, 124, 5893 }, + { (float)0.057219, 124, 6017 }, + { (float)0.050985, 129, 6141 }, + { (float)0.050985, 129, 6270 }, + { (float)0.050985, 129, 6399 }, + { (float)0.050985, 129, 6528 }, + { (float)0.050985, 129, 6657 }, + { (float)0.044859, 134, 6786 }, + { (float)0.044859, 134, 6920 }, + { (float)0.044859, 134, 7054 }, + { (float)0.044859, 134, 7188 }, + { (float)0.040571, 138, 7322 }, + { (float)0.040571, 138, 7460 }, + { (float)0.040571, 138, 7598 }, + { (float)0.040571, 138, 7736 }, + { (float)0.036339, 142, 7874 }, + { (float)0.036339, 142, 8016 }, + { (float)0.036339, 142, 8158 }, + { (float)0.036339, 142, 8300 }, + { (float)0.032139, 146, 8442 }, + { (float)0.032139, 146, 8588 }, + { (float)0.032139, 146, 8734 }, + { (float)0.032139, 146, 8880 }, + { (float)0.027947, 150, 9026 }, + { (float)0.027947, 150, 9176 }, + { (float)0.027947, 150, 9326 }, + { (float)0.023739, 154, 9476 }, + { (float)0.023739, 154, 9630 }, + { (float)0.023739, 154, 9784 }, + { (float)0.023739, 154, 9938 }, + { (float)0.019504, 158, 10092 }, + { (float)0.019504, 158, 10250 }, + { (float)0.019504, 158, 10408 }, + { (float)0.016976, 161, 10566 }, + { (float)0.016976, 161, 10727 }, + { (float)0.016976, 161, 10888 }, + { (float)0.016976, 161, 11049 }, + { (float)0.012639, 165, 11210 }, + { (float)0.012639, 165, 11375 }, + { (float)0.012639, 165, 11540 }, + { (float)0.009991, 168, 11705 }, + { (float)0.009991, 168, 11873 }, + { (float)0.009991, 168, 12041 }, + { (float)0.009016, 170, 12209 }, + { (float)0.009016, 170, 12379 }, + { (float)0.009016, 170, 12549 }, + { (float)0.006217, 173, 12719 }, + { (float)0.006217, 173, 12892 }, + { (float)0.005097, 175, 13065 }, + { (float)0.005097, 175, 13240 }, + { (float)0.005097, 175, 13415 }, + { (float)0.003909, 177, 13590 }, + { (float)0.003909, 177, 13767 }, + { (float)0.002340, 177, 13944 }, + { (float)0.002389, 170, 14121 }, + { (float)0.001068, 164, 14291 }, + { (float)0.001653, 157, 14455 }, + { (float)0.000717, 150, 14612 }, + { (float)0.001614, 143, 14762 }, + { (float)0.000270, 136, 14905 }, + { (float)0.000484, 129, 15041 }, + { (float)0.001103, 123, 15170 }, + { (float)0.001242, 115, 15293 }, + { (float)0.001188, 109, 15408 }, + { (float)0.001011, 103, 15517 }, + { (float)0.000709, 97, 15620 }, + { (float)0.000301, 89, 15717 }, + { (float)0.002416, 82, 15806 }, + { (float)0.003251, 76, 15888 }, + { (float)0.003246, 69, 15964 }, + { (float)0.004141, 62, 16033 }, + { (float)0.005963, 55, 16095 }, + { (float)0.008839, 47, 16150 }, + { (float)0.010490, 40, 16197 }, + { (float)0.016994, 31, 16237 }, + { (float)0.023659, 21, 16268 }, +}; +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/acinclude.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/acinclude.m4 new file mode 100644 index 0000000..b54feb7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/acinclude.m4 @@ -0,0 +1,851 @@ +dnl --------------------------------------------------------------------------- +dnl Message output +dnl --------------------------------------------------------------------------- +AC_DEFUN([LOC_MSG],[echo "$1"]) + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/vl_prog_cc_warnings.html +dnl --------------------------------------------------------------------------- + +dnl @synopsis VL_PROG_CC_WARNINGS([ANSI]) +dnl +dnl Enables a reasonable set of warnings for the C compiler. +dnl Optionally, if the first argument is nonempty, turns on flags which +dnl enforce and/or enable proper ANSI C if such are known with the +dnl compiler used. +dnl +dnl Currently this macro knows about GCC, Solaris C compiler, Digital +dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C +dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos +dnl 10.0.0.8) C compiler. +dnl +dnl @category C +dnl @author Ville Laurikari +dnl @version 2002-04-04 +dnl @license AllPermissive + +AC_DEFUN([VL_PROG_CC_WARNINGS], [ + ansi=$1 + if test -z "$ansi"; then + msg="for C compiler warning flags" + else + msg="for C compiler warning and ANSI conformance flags" + fi + AC_CACHE_CHECK($msg, vl_cv_prog_cc_warnings, [ + if test -n "$CC"; then + cat > conftest.c <&1 | grep -i "WorkShop" > /dev/null 2>&1 && + $CC -c -v -Xc conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-v" + else + vl_cv_prog_cc_warnings="-v -Xc" + fi + + dnl Digital Unix C compiler + elif $CC -V 2>&1 | grep -i "Digital UNIX Compiler" > /dev/null 2>&1 && + $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos" + else + vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1" + fi + + dnl C for AIX Compiler + elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 && + $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" + else + vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi" + fi + + dnl IRIX C compiler + elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 && + $CC -c -fullwarn -ansi -ansiE conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-fullwarn" + else + vl_cv_prog_cc_warnings="-fullwarn -ansi -ansiE" + fi + + dnl HP-UX C compiler + elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 && + $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="+w1" + else + vl_cv_prog_cc_warnings="+w1 -Aa" + fi + + dnl The NEC SX-5 (Super-UX 10) C compiler + elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 && + $CC -c -pvctl[,]fullmsg -Xc conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-pvctl[,]fullmsg" + else + vl_cv_prog_cc_warnings="-pvctl[,]fullmsg -Xc" + fi + + dnl The Cray C compiler (Unicos) + elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 && + $CC -c -h msglevel 2 conftest.c > /dev/null 2>&1 && + test -f conftest.o; then + if test -z "$ansi"; then + vl_cv_prog_cc_warnings="-h msglevel 2" + else + vl_cv_prog_cc_warnings="-h msglevel 2 -h conform" + fi + + fi + rm -f conftest.* + fi + if test -n "$vl_cv_prog_cc_warnings"; then + CFLAGS="$CFLAGS $vl_cv_prog_cc_warnings" + else + vl_cv_prog_cc_warnings="unknown" + fi + ]) +])dnl + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://autoconf-archive.cryp.to/ax_lang_compiler_ms.html +dnl --------------------------------------------------------------------------- + +dnl @synopsis AX_LANG_COMPILER_MS +dnl +dnl Check whether the compiler for the current language is Microsoft. +dnl +dnl This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU +dnl Autoconf implementation. +dnl +dnl @category InstalledPackages +dnl @author Braden McDaniel +dnl @version 2004-11-15 +dnl @license AllPermissive + +AC_DEFUN([AX_LANG_COMPILER_MS], +[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler], + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER + choke me +#endif +]])], + [ax_compiler_ms=yes], + [ax_compiler_ms=no]) +ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms +])]) + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/ax_check_gl.html +dnl --------------------------------------------------------------------------- + +dnl SYNOPSIS +dnl +dnl AX_CHECK_GL +dnl +dnl DESCRIPTION +dnl +dnl Check for an OpenGL implementation. If GL is found, the required +dnl compiler and linker flags are included in the output variables +dnl "GL_CFLAGS" and "GL_LIBS", respectively. If no usable GL implementation +dnl is found, "no_gl" is set to "yes". +dnl +dnl If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the +dnl header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These +dnl preprocessor definitions may not be mutually exclusive. +dnl +dnl LICENSE +dnl +dnl Copyright (c) 2009 Braden McDaniel +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation; either version 2 of the License, or (at your +dnl option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +dnl Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program. If not, see . +dnl +dnl As a special exception, the respective Autoconf Macro's copyright owner +dnl gives unlimited permission to copy, distribute and modify the configure +dnl scripts that are the output of Autoconf when processing the Macro. You +dnl need not follow the terms of the GNU General Public License when using +dnl or distributing such scripts, even though portions of the text of the +dnl Macro appear in them. The GNU General Public License (GPL) does govern +dnl all other use of the material that constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the Autoconf +dnl Macro released by the Autoconf Archive. When you make and distribute a +dnl modified version of the Autoconf Macro, you may extend this special +dnl exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CHECK_GL], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PATH_X])dnl +AC_REQUIRE([AX_PTHREAD])dnl + +AC_LANG_PUSH([C]) +AX_LANG_COMPILER_MS +AS_IF([test X$ax_compiler_ms = Xno], + [GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"]) + +dnl +dnl Use x_includes and x_libraries if they have been set (presumably by +dnl AC_PATH_X). +dnl +AS_IF([test "X$no_x" != "Xyes"], + [AS_IF([test -n "$x_includes"], + [GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"])] + AS_IF([test -n "$x_libraries"], + [GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"])) + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h]) +CPPFLAGS="${ax_save_CPPFLAGS}" + +AC_CHECK_HEADERS([windows.h]) + +m4_define([AX_CHECK_GL_PROGRAM], + [AC_LANG_PROGRAM([[ +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GL_H +# include +# elif defined(HAVE_OPENGL_GL_H) +# include +# else +# error no gl.h +# endif]], + [[glBegin(0)]])]) + +AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], +[ax_cv_check_gl_libgl="no" +case $host_cpu in + x86_64) ax_check_gl_libdir=lib64 ;; + *) ax_check_gl_libdir=lib ;; +esac +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" +LIBS="" +ax_check_libs="-lopengl32 -lGL" +for ax_lib in ${ax_check_libs}; do + AS_IF([test X$ax_compiler_ms = Xyes], + [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], + [ax_try_lib="${ax_lib}"]) + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="${ax_try_lib}"; break], + [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break], + [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])]) +done + +AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes], +[LIBS='-framework OpenGL' +AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], + [ax_cv_check_gl_libgl="$LIBS"])]) + +LIBS=${ax_save_LIBS} +CPPFLAGS=${ax_save_CPPFLAGS}]) + +AS_IF([test "X$ax_cv_check_gl_libgl" = Xno], + [no_gl=yes; GL_CFLAGS=""; GL_LIBS=""], + [GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"]) +AC_LANG_POP([C]) + +AC_SUBST([GL_CFLAGS]) +AC_SUBST([GL_LIBS]) +])dnl + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/ax_check_glu.html +dnl --------------------------------------------------------------------------- + +dnl SYNOPSIS +dnl +dnl AX_CHECK_GLU +dnl +dnl DESCRIPTION +dnl +dnl Check for GLU. If GLU is found, the required preprocessor and linker +dnl flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS", +dnl respectively. If no GLU implementation is found, "no_glu" is set to +dnl "yes". +dnl +dnl If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the +dnl header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These +dnl preprocessor definitions may not be mutually exclusive. +dnl +dnl Some implementations (in particular, some versions of Mac OS X) are +dnl known to treat the GLU tesselator callback function type as "GLvoid +dnl (*)(...)" rather than the standard "GLvoid (*)()". If the former +dnl condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB". +dnl +dnl LICENSE +dnl +dnl Copyright (c) 2009 Braden McDaniel +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation; either version 2 of the License, or (at your +dnl option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +dnl Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program. If not, see . +dnl +dnl As a special exception, the respective Autoconf Macro's copyright owner +dnl gives unlimited permission to copy, distribute and modify the configure +dnl scripts that are the output of Autoconf when processing the Macro. You +dnl need not follow the terms of the GNU General Public License when using +dnl or distributing such scripts, even though portions of the text of the +dnl Macro appear in them. The GNU General Public License (GPL) does govern +dnl all other use of the material that constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the Autoconf +dnl Macro released by the Autoconf Archive. When you make and distribute a +dnl modified version of the Autoconf Macro, you may extend this special +dnl exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CHECK_GLU], +[AC_REQUIRE([AX_CHECK_GL])dnl +AC_REQUIRE([AC_PROG_CXX])dnl +GLU_CFLAGS="${GL_CFLAGS}" + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h]) +CPPFLAGS="${ax_save_CPPFLAGS}" + +m4_define([AX_CHECK_GLU_PROGRAM], + [AC_LANG_PROGRAM([[ +# if defined(HAVE_WINDOWS_H) && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLU_H +# include +# elif defined(HAVE_OPENGL_GLU_H) +# include +# else +# error no glu.h +# endif]], + [[gluBeginCurve(0)]])]) + +AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], +[ax_cv_check_glu_libglu="no" +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" + +dnl +dnl First, check for the possibility that everything we need is already in +dnl GL_LIBS. +dnl +LIBS="${GL_LIBS} ${ax_save_LIBS}" +dnl +dnl libGLU typically links with libstdc++ on POSIX platforms. +dnl However, setting the language to C++ means that test program +dnl source is named "conftest.cc"; and Microsoft cl doesn't know what +dnl to do with such a file. +dnl +AC_LANG_PUSH([C++]) +AS_IF([test X$ax_compiler_ms = Xyes], + [AC_LANG_PUSH([C])]) +AC_LINK_IFELSE( +[AX_CHECK_GLU_PROGRAM], +[ax_cv_check_glu_libglu=yes], +[LIBS="" +ax_check_libs="-lglu32 -lGLU" +for ax_lib in ${ax_check_libs}; do + AS_IF([test X$ax_compiler_ms = Xyes], + [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], + [ax_try_lib="${ax_lib}"]) + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM], + [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) +done +]) +AS_IF([test X$ax_compiler_ms = Xyes], + [AC_LANG_POP([C])]) +AC_LANG_POP([C++]) + +LIBS=${ax_save_LIBS} +CPPFLAGS=${ax_save_CPPFLAGS}]) +AS_IF([test "X$ax_cv_check_glu_libglu" = Xno], + [no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""], + [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes], + [GLU_LIBS="$GL_LIBS"], + [GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])]) +AC_SUBST([GLU_CFLAGS]) +AC_SUBST([GLU_LIBS]) + +dnl +dnl Some versions of Mac OS X include a broken interpretation of the GLU +dnl tesselation callback function signature. +dnl +AS_IF([test "X$ax_cv_check_glu_libglu" != Xno], +[AC_CACHE_CHECK([for varargs GLU tesselator callback function type], + [ax_cv_varargs_glu_tesscb], +[ax_cv_varargs_glu_tesscb=no +ax_save_CFLAGS="$CFLAGS" +CFLAGS="$GL_CFLAGS $CFLAGS" +AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([[ +# ifdef HAVE_GL_GLU_H +# include +# else +# include +# endif]], + [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])], +[ax_cv_varargs_glu_tesscb=yes]) +CFLAGS="$ax_save_CFLAGS"]) +AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes], + [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], + [Use nonstandard varargs form for the GLU tesselator callback])])]) +]) + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/ax_check_glut.html +dnl --------------------------------------------------------------------------- + +dnl +dnl SYNOPSIS +dnl +dnl AX_CHECK_GLUT +dnl +dnl DESCRIPTION +dnl +dnl Check for GLUT. If GLUT is found, the required compiler and linker flags +dnl are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS", +dnl respectively. If GLUT is not found, "no_glut" is set to "yes". +dnl +dnl If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the +dnl header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These +dnl preprocessor definitions may not be mutually exclusive. +dnl +dnl LICENSE +dnl +dnl Copyright (c) 2009 Braden McDaniel +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation; either version 2 of the License, or (at your +dnl option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +dnl Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program. If not, see . +dnl +dnl As a special exception, the respective Autoconf Macro's copyright owner +dnl gives unlimited permission to copy, distribute and modify the configure +dnl scripts that are the output of Autoconf when processing the Macro. You +dnl need not follow the terms of the GNU General Public License when using +dnl or distributing such scripts, even though portions of the text of the +dnl Macro appear in them. The GNU General Public License (GPL) does govern +dnl all other use of the material that constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the Autoconf +dnl Macro released by the Autoconf Archive. When you make and distribute a +dnl modified version of the Autoconf Macro, you may extend this special +dnl exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_CHECK_GLUT], +[AC_REQUIRE([AX_CHECK_GLU])dnl +AC_REQUIRE([AC_PATH_XTRA])dnl + +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}" +AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h]) +CPPFLAGS="${ax_save_CPPFLAGS}" + +GLUT_CFLAGS=${GLU_CFLAGS} +GLUT_LIBS=${GLU_LIBS} + +m4_define([AX_CHECK_GLUT_PROGRAM], + [AC_LANG_PROGRAM([[ +# if HAVE_WINDOWS_H && defined(_WIN32) +# include +# endif +# ifdef HAVE_GL_GLUT_H +# include +# elif defined(HAVE_GLUT_GLUT_H) +# include +# else +# error no glut.h +# endif]], + [[glutMainLoop()]])]) + +dnl +dnl If X is present, assume GLUT depends on it. +dnl +AS_IF([test X$no_x != Xyes], + [GLUT_LIBS="${X_PRE_LIBS} -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"]) + +AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut], +[ax_cv_check_glut_libglut="no" +AC_LANG_PUSH(C) +ax_save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}" +ax_save_LIBS="${LIBS}" +LIBS="" +ax_check_libs="-lglut32 -lglut" +for ax_lib in ${ax_check_libs}; do + AS_IF([test X$ax_compiler_ms = Xyes], + [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], + [ax_try_lib="${ax_lib}"]) + LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" + AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], + [ax_cv_check_glut_libglut="${ax_try_lib}"; break]) +done + +AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes], +[LIBS='-framework GLUT' +AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], + [ax_cv_check_glut_libglut="$LIBS"])]) + +CPPFLAGS="${ax_save_CPPFLAGS}" +LIBS="${ax_save_LIBS}" +AC_LANG_POP(C)]) + +AS_IF([test "X$ax_cv_check_glut_libglut" = Xno], + [no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""], + [GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"]) + +AC_SUBST([GLUT_CFLAGS]) +AC_SUBST([GLUT_LIBS]) +])dnl + +dnl --------------------------------------------------------------------------- +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/autoconf-archive/ax_pthread.html +dnl --------------------------------------------------------------------------- + +dnl SYNOPSIS +dnl +dnl AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl DESCRIPTION +dnl +dnl This macro figures out how to build C programs using POSIX threads. It +dnl sets the PTHREAD_LIBS output variable to the threads library and linker +dnl flags, and the PTHREAD_CFLAGS output variable to any special C compiler +dnl flags that are needed. (The user can also force certain compiler +dnl flags/libs to be tested by setting these environment variables.) +dnl +dnl Also sets PTHREAD_CC to any special C compiler that is needed for +dnl multi-threaded programs (defaults to the value of CC otherwise). (This +dnl is necessary on AIX to use the special cc_r compiler alias.) +dnl +dnl NOTE: You are assumed to not only compile your program with these flags, +dnl but also link it with them as well. e.g. you should link with +dnl $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +dnl +dnl If you are only building threads programs, you may wish to use these +dnl variables in your default LIBS, CFLAGS, and CC: +dnl +dnl LIBS="$PTHREAD_LIBS $LIBS" +dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +dnl CC="$PTHREAD_CC" +dnl +dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +dnl has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +dnl (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a threads library +dnl is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +dnl is not found. If ACTION-IF-FOUND is not specified, the default action +dnl will define HAVE_PTHREAD. +dnl +dnl Please let the authors know if this macro fails on any platform, or if +dnl you have any other suggestions or comments. This macro was based on work +dnl by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +dnl from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +dnl Alejandro Forero Cuervo to the autoconf macro repository. We are also +dnl grateful for the helpful feedback of numerous users. +dnl +dnl LICENSE +dnl +dnl Copyright (c) 2008 Steven G. Johnson +dnl +dnl This program is free software: you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the +dnl Free Software Foundation, either version 3 of the License, or (at your +dnl option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +dnl Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program. If not, see . +dnl +dnl As a special exception, the respective Autoconf Macro's copyright owner +dnl gives unlimited permission to copy, distribute and modify the configure +dnl scripts that are the output of Autoconf when processing the Macro. You +dnl need not follow the terms of the GNU General Public License when using +dnl or distributing such scripts, even though portions of the text of the +dnl Macro appear in them. The GNU General Public License (GPL) does govern +dnl all other use of the material that constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the Autoconf +dnl Macro released by the Autoconf Archive. When you make and distribute a +dnl modified version of the Autoconf Macro, you may extend this special +dnl exception to the GPL to apply to your modified version as well. + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +ax_pthread_ok=no + +dnl We used to check for pthread.h first, but this fails if pthread.h +dnl requires special compiler flags (e.g. on True64 or Sequent). +dnl It gets checked for in the link test anyway. + +dnl First of all, check if the user has set any of the PTHREAD_LIBS, +dnl etcetera environment variables, and if threads linking works using +dnl them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +dnl We must check for the threads library under a number of different +dnl names; the ordering is very important because some systems +dnl (e.g. DEC) have both -lpthread and -lpthreads, where one of the +dnl libraries is broken (non-POSIX). + +dnl Create a list of thread flags to try. Items starting with a "-" are +dnl C compiler flags, and other items are library names, except for "none" +dnl which indicates that we try without any flags at all, and "pthread-config" +dnl which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +dnl The ordering *is* (sometimes) important. Some notes on the +dnl individual items follow: + +dnl pthreads: AIX (must check this before -lpthread) +dnl none: in case threads are in libc; should be tried before -Kthread and +dnl other compiler flags to prevent continual compiler warnings +dnl -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +dnl -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +dnl lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +dnl -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +dnl -pthreads: Solaris/gcc +dnl -mthreads: Mingw32/gcc, Lynx/gcc +dnl -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +dnl doesn't hurt to check since this sometimes defines pthreads too; +dnl also defines -D_REENTRANT) +dnl ... -mt is also the pthreads flag for HP/aCC +dnl pthread: Linux, etcetera +dnl --thread-safe: KAI C++ +dnl pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + dnl On Solaris (at least, for some versions), libc contains stubbed + dnl (non-functional) versions of the pthreads routines, so link-based + dnl tests will erroneously succeed. (We need to link with -pthreads/-mt/ + dnl -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + dnl a function called by this macro, so we could check for that, but + dnl who knows whether they'll stub that too in a future libc.) So, + dnl we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + *-darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + dnl Check for various functions. We must include pthread.h, + dnl since some functions may be macros. (On the Sequent, we + dnl need a special flag -Kthread to make this header compile.) + dnl We check for pthread_join because it is in -lpthread on IRIX + dnl while pthread_create is in libc. We check for pthread_attr_init + dnl due to DEC craziness with -lpthreads. We check for + dnl pthread_cleanup_push because it is one of the few pthread + dnl functions on Solaris that doesn't have a non-functional libc stub. + dnl We try pthread_create on general principles. + AC_TRY_LINK([#include + static void routine(void* a) {a=0;} + static void* start_routine(void* a) {return a;}], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th,0,start_routine,0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0); ], + [ax_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +dnl Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + dnl Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + dnl More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +dnl Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl AX_PTHREAD diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/libtool.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/libtool.m4 new file mode 100644 index 0000000..49216cb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/libtool.m4 @@ -0,0 +1,7982 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/ltoptions.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltoptions.m4 new file mode 100644 index 0000000..5d9acd8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/ltsugar.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/ltversion.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltversion.m4 new file mode 100644 index 0000000..07a8602 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/m4/lt~obsolete.m4 b/thirdparty/LibTIFF/tiff-4.0.3/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.am new file mode 100644 index 0000000..bcad9ba --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.am @@ -0,0 +1,98 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +dist_man1_MANS = \ + bmp2tiff.1 \ + fax2ps.1 \ + fax2tiff.1 \ + gif2tiff.1 \ + pal2rgb.1 \ + ppm2tiff.1 \ + ras2tiff.1 \ + raw2tiff.1 \ + rgb2ycbcr.1 \ + sgi2tiff.1 \ + thumbnail.1 \ + tiff2bw.1 \ + tiff2pdf.1 \ + tiff2ps.1 \ + tiff2rgba.1 \ + tiffcmp.1 \ + tiffcp.1 \ + tiffcrop.1 \ + tiffdither.1 \ + tiffdump.1 \ + tiffgt.1 \ + tiffinfo.1 \ + tiffmedian.1 \ + tiffset.1 \ + tiffsplit.1 \ + tiffsv.1 + +dist_man3_MANS = \ + libtiff.3tiff \ + TIFFbuffer.3tiff \ + TIFFClose.3tiff \ + TIFFcodec.3tiff \ + TIFFcolor.3tiff \ + TIFFDataWidth.3tiff \ + TIFFError.3tiff \ + TIFFFieldDataType.3tiff \ + TIFFFieldName.3tiff \ + TIFFFieldPassCount.3tiff \ + TIFFFieldReadCount.3tiff \ + TIFFFieldTag.3tiff \ + TIFFFieldWriteCount.3tiff \ + TIFFFlush.3tiff \ + TIFFGetField.3tiff \ + TIFFmemory.3tiff \ + TIFFOpen.3tiff \ + TIFFPrintDirectory.3tiff \ + TIFFquery.3tiff \ + TIFFReadDirectory.3tiff \ + TIFFReadEncodedStrip.3tiff \ + TIFFReadEncodedTile.3tiff \ + TIFFReadRawStrip.3tiff \ + TIFFReadRawTile.3tiff \ + TIFFReadRGBAImage.3tiff \ + TIFFReadRGBAStrip.3tiff \ + TIFFReadRGBATile.3tiff \ + TIFFReadScanline.3tiff \ + TIFFReadTile.3tiff \ + TIFFRGBAImage.3tiff \ + TIFFSetDirectory.3tiff \ + TIFFSetField.3tiff \ + TIFFsize.3tiff \ + TIFFstrip.3tiff \ + TIFFswab.3tiff \ + TIFFtile.3tiff \ + TIFFWarning.3tiff \ + TIFFWriteDirectory.3tiff \ + TIFFWriteEncodedStrip.3tiff \ + TIFFWriteEncodedTile.3tiff \ + TIFFWriteRawStrip.3tiff \ + TIFFWriteRawTile.3tiff \ + TIFFWriteScanline.3tiff \ + TIFFWriteTile.3tiff diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.in new file mode 100644 index 0000000..ff60f6f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/Makefile.in @@ -0,0 +1,661 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = man +DIST_COMMON = $(dist_man1_MANS) $(dist_man3_MANS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" +man3dir = $(mandir)/man3 +NROFF = nroff +MANS = $(dist_man1_MANS) $(dist_man3_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +dist_man1_MANS = \ + bmp2tiff.1 \ + fax2ps.1 \ + fax2tiff.1 \ + gif2tiff.1 \ + pal2rgb.1 \ + ppm2tiff.1 \ + ras2tiff.1 \ + raw2tiff.1 \ + rgb2ycbcr.1 \ + sgi2tiff.1 \ + thumbnail.1 \ + tiff2bw.1 \ + tiff2pdf.1 \ + tiff2ps.1 \ + tiff2rgba.1 \ + tiffcmp.1 \ + tiffcp.1 \ + tiffcrop.1 \ + tiffdither.1 \ + tiffdump.1 \ + tiffgt.1 \ + tiffinfo.1 \ + tiffmedian.1 \ + tiffset.1 \ + tiffsplit.1 \ + tiffsv.1 + +dist_man3_MANS = \ + libtiff.3tiff \ + TIFFbuffer.3tiff \ + TIFFClose.3tiff \ + TIFFcodec.3tiff \ + TIFFcolor.3tiff \ + TIFFDataWidth.3tiff \ + TIFFError.3tiff \ + TIFFFieldDataType.3tiff \ + TIFFFieldName.3tiff \ + TIFFFieldPassCount.3tiff \ + TIFFFieldReadCount.3tiff \ + TIFFFieldTag.3tiff \ + TIFFFieldWriteCount.3tiff \ + TIFFFlush.3tiff \ + TIFFGetField.3tiff \ + TIFFmemory.3tiff \ + TIFFOpen.3tiff \ + TIFFPrintDirectory.3tiff \ + TIFFquery.3tiff \ + TIFFReadDirectory.3tiff \ + TIFFReadEncodedStrip.3tiff \ + TIFFReadEncodedTile.3tiff \ + TIFFReadRawStrip.3tiff \ + TIFFReadRawTile.3tiff \ + TIFFReadRGBAImage.3tiff \ + TIFFReadRGBAStrip.3tiff \ + TIFFReadRGBATile.3tiff \ + TIFFReadScanline.3tiff \ + TIFFReadTile.3tiff \ + TIFFRGBAImage.3tiff \ + TIFFSetDirectory.3tiff \ + TIFFSetField.3tiff \ + TIFFsize.3tiff \ + TIFFstrip.3tiff \ + TIFFswab.3tiff \ + TIFFtile.3tiff \ + TIFFWarning.3tiff \ + TIFFWriteDirectory.3tiff \ + TIFFWriteEncodedStrip.3tiff \ + TIFFWriteEncodedTile.3tiff \ + TIFFWriteRawStrip.3tiff \ + TIFFWriteRawTile.3tiff \ + TIFFWriteScanline.3tiff \ + TIFFWriteTile.3tiff + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(dist_man1_MANS) + @$(NORMAL_INSTALL) + @list1='$(dist_man1_MANS)'; \ + list2=''; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-man3: $(dist_man3_MANS) + @$(NORMAL_INSTALL) + @list1='$(dist_man3_MANS)'; \ + list2=''; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ + done; } + +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(dist_man3_MANS)'; test -n "$(man3dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically 'make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man3 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 uninstall-man3 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-man3 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-man uninstall-man1 \ + uninstall-man3 + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFClose.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFClose.3tiff new file mode 100644 index 0000000..bcb7604 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFClose.3tiff @@ -0,0 +1,53 @@ +.\" $Id: TIFFClose.3tiff,v 1.3 2009-08-24 19:13:40 bfriesen Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFClose 3TIFF "November 2, 2005" "libtiff" +.SH NAME +TIFFClose \- close a previously opened +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "void TIFFClose(TIFF *" tif ")" +.SH DESCRIPTION +.IR TIFFClose +closes a file that was previously opened with +.BR TIFFOpen (3TIFF). +Any buffered data are flushed to the file, including the contents of the +current directory (if modified); and all resources are reclaimed. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +Likewise, warning messages are directed to the +.BR TIFFWarning (3TIFF) +routine. +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.BR TIFFOpen (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFDataWidth.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFDataWidth.3tiff new file mode 100644 index 0000000..cb274d8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFDataWidth.3tiff @@ -0,0 +1,74 @@ +.\" $Id: TIFFDataWidth.3tiff,v 1.3 2006-03-23 14:54:02 dron Exp $ +.\" +.\" Copyright (c) 2002, Andrey Kiselev +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFDataWidth 3TIFF "September 12, 2002" "libtiff" +.SH NAME +TIFFDataWidth \- Get the size of TIFF data types +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFDataWidth(TIFFDataType " type ")" +.SH DESCRIPTION +.I TIFFDataWidth +returns a size of +.I type +in bytes. +Currently following data types are supported: +.br +.I TIFF_BYTE +.br +.I TIFF_ASCII +.br +.I TIFF_SBYTE +.br +.I TIFF_UNDEFINED +.br +.I TIFF_SHORT +.br +.I TIFF_SSHORT +.br +.I TIFF_LONG +.br +.I TIFF_SLONG +.br +.I TIFF_FLOAT +.br +.I TIFF_IFD +.br +.I TIFF_RATIONAL +.br +.I TIFF_SRATIONAL +.br +.I TIFF_DOUBLE +.br +.SH "RETURN VALUES" +.br +.IR TIFFDataWidth +returns a number of bytes occupied by the item of given type. 0 returned when +uknown data type supplied. +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFError.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFError.3tiff new file mode 100644 index 0000000..761ff08 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFError.3tiff @@ -0,0 +1,69 @@ +.\" $Id: TIFFError.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFError 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFError, TIFFSetErrorHandler \- library error handling interface +.SH SYNOPSIS +.B "#include " +.sp +.BI "void TIFFError(const char *" module ", const char *" fmt ", " ... ")" +.sp +.B "#include " +.sp +.BI "typedef void (*TIFFErrorHandler)(const char *" module ", const char *" fmt ", va_list " ap ");" +.br +.B "TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler handler);" +.SH DESCRIPTION +.I TIFFError +invokes the library-wide error handling function to (normally) write an error +message to the +.BR stderr . +The +.I fmt +parameter is a +.IR printf (3S) +format string, and any number arguments can be supplied. The +.I module +parameter, if non-zero, is printed before the message; it typically is used to +identify the software module in which an error is detected. +.PP +Applications that desire to capture control in the event of an error should +use +.IR TIFFSetErrorHandler +to override the default error handler. +A +.SM NULL +(0) error handling function may be installed to suppress error messages. +.SH "RETURN VALUES" +.IR TIFFSetErrorHandler +returns a reference to the previous error handling function. +.SH "SEE ALSO" +.BR TIFFWarning (3TIFF), +.BR libtiff (3TIFF), +.BR printf (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldDataType.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldDataType.3tiff new file mode 100644 index 0000000..3efe697 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldDataType.3tiff @@ -0,0 +1,53 @@ +.\" $Id: TIFFFieldDataType.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldDataType 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldDataType \- Get TIFF data type from field information +.SH SYNOPSIS +.B "#include " +.sp +.BI "TIFFDataType TIFFFieldDataType(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldDataType +returns the data type stored in a TIFF field. +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldDataType +returns a member of the enum type +.BR TIFFDataType . +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldName.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldName.3tiff new file mode 100644 index 0000000..2755d18 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldName.3tiff @@ -0,0 +1,52 @@ +.\" $Id: TIFFFieldName.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldName 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldName \- Get TIFF field name from field information +.SH SYNOPSIS +.B "#include " +.sp +.BI "const char* TIFFFieldName(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldName +returns the textual name for a TIFF field. +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldName +returns a constant C string. +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldPassCount.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldPassCount.3tiff new file mode 100644 index 0000000..8f3c5d0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldPassCount.3tiff @@ -0,0 +1,73 @@ +.\" $Id: TIFFFieldPassCount.3tiff,v 1.1 2012-07-29 15:45:29 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldPassCount 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldPassCount \- Get whether to pass a count to TIFFGet/SetField +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFFieldPassCount(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldPassCount +returns true (nonzero) if +.BR TIFFGetField +and +.BR TIFFSetField +expect a +.I count +value to be passed before the actual data pointer. +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.P +When a +.I count +is required, it will be of type +.BR uint32 +when +.BR TIFFFieldReadCount +reports +.BR TIFF_VARIABLE2 , +and of type +.BR uint16 +otherwise. (This distinction is critical for use of +.BR TIFFGetField , +but normally not so for use of +.BR TIFFSetField .) +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldPassCount +returns an integer that is always 1 (true) or 0 (false). +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldReadCount.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldReadCount.3tiff new file mode 100644 index 0000000..cdb5858 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldReadCount.3tiff @@ -0,0 +1,77 @@ +.\" $Id: TIFFFieldReadCount.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldReadCount 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldReadCount \- Get number of values to be read from field +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFFieldReadCount(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldReadCount +returns the number of values available to be read from the specified +TIFF field; that is, the number of arguments that should be supplied to +.BR TIFFGetField . +For most field types this is a small positive integer, typically 1 or 2, +but there are some special values: +.br +.BR TIFF_VARIABLE +indicates that a variable number of values is possible; then, a +.BR uint16 +.I count +argument and a pointer +.I data +argument must be supplied to +.BR TIFFGetField . +.br +.BR TIFF_VARIABLE2 +is the same as +.BR TIFF_VARIABLE +except that the +.I count +argument must have type +.BR uint32 . +.br +.BR TIFF_SPP +indicates that the number of arguments is equal to the image's +number of samples per pixel. +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldReadCount +returns an integer. +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldTag.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldTag.3tiff new file mode 100644 index 0000000..bf8174e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldTag.3tiff @@ -0,0 +1,56 @@ +.\" $Id: TIFFFieldTag.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldTag 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldTag \- Get TIFF field tag value from field information +.SH SYNOPSIS +.B "#include " +.sp +.BI "uint32 TIFFFieldTag(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldTag +returns the numeric tag value for a TIFF field. +This can be compared to various constants exported by the +.BR libtiff +header files, such as +.BR TIFFTAG_IMAGEWIDTH . +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldTag +returns an integer tag value. +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldWriteCount.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldWriteCount.3tiff new file mode 100644 index 0000000..6330532 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFieldWriteCount.3tiff @@ -0,0 +1,88 @@ +.\" $Id: TIFFFieldWriteCount.3tiff,v 1.1 2012-07-29 15:45:30 tgl Exp $ +.\" +.\" Copyright (c) 2012, Tom Lane +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFieldWriteCount 3TIFF "July 26, 2012" "libtiff" +.SH NAME +TIFFFieldWriteCount \- Get number of values to be written to field +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFFieldWriteCount(const TIFFField* " fip ")" +.SH DESCRIPTION +.BR TIFFFieldWriteCount +returns the number of values to be written into the specified +TIFF field; that is, the number of arguments that should be supplied to +.BR TIFFSetField . +For most field types this is a small positive integer, typically 1 or 2, +but there are some special values: +.br +.BR TIFF_VARIABLE +indicates that a variable number of values is possible; then, a +.BR uint16 +.I count +argument and a pointer +.I data +argument must be supplied to +.BR TIFFSetField . +.br +.BR TIFF_VARIABLE2 +is the same as +.BR TIFF_VARIABLE +except that the +.I count +argument must have type +.BR uint32 . +(On most modern machines, this makes no practical difference, and the +.I count +argument can simply be an +.BR int +in either case.) +.br +.BR TIFF_SPP +indicates that the number of arguments must be equal to the image's +number of samples per pixel. +.P +.I fip +is a field information pointer previously returned by +.BR TIFFFindField , +.BR TIFFFieldWithTag , +or +.BR TIFFFieldWithName . +.P +For most field types, +.BR TIFFFieldWriteCount +returns the same value as +.BR TIFFFieldReadCount , +but there are some exceptions. +.br +.SH "RETURN VALUES" +.br +.BR TIFFFieldWriteCount +returns an integer. +.br +.SH "SEE ALSO" +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFlush.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFlush.3tiff new file mode 100644 index 0000000..af32350 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFFlush.3tiff @@ -0,0 +1,64 @@ +.\" $Id: TIFFFlush.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFFlush 3TIFF "December 16, 1991" "libtiff" +.SH NAME +TIFFFlush, TIFFFlushData \- flush pending writes to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFFlush(TIFF *" tif ")" +.br +.BI "int TIFFFlushData(TIFF *" tif ")" +.SH DESCRIPTION +.IR TIFFFlush +causes any pending writes for the specified file (including writes for the +current directory) to be done. In normal operation this call is never needed \- +the library automatically does any flushing required. +.PP +.IR TIFFFlushData +flushes any pending image data for the specified file to be written out; +directory-related data are not flushed. In normal operation this call is never +needed \- the library automatically does any flushing required. +.SH "RETURN VALUES" +0 is returned if an error is encountered, otherwise 1 is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteEncodedStrip (3TIFF), +.BR TIFFWriteEncodedTile (3TIFF), +.BR TIFFWriteRawStrip (3TIFF), +.BR TIFFWriteRawTile (3TIFF), +.BR TIFFWriteScanline (3TIFF), +.BR TIFFWriteTile (3TIFF) +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFGetField.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFGetField.3tiff new file mode 100644 index 0000000..0624ee9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFGetField.3tiff @@ -0,0 +1,229 @@ +.\" $Id: TIFFGetField.3tiff,v 1.6 2012-05-19 23:15:22 bfriesen Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFGetField 3TIFF "March 18, 2005" "libtiff" +.SH NAME +TIFFGetField, TIFFVGetField \- get the value(s) of a tag in an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFGetField(TIFF *" tif ", ttag_t " tag ", " ... ")" +.sp +.B "#include " +.sp +.BI "int TIFFVGetField(TIFF *" tif ", ttag_t " tag ", va_list " ap ")" +.br +.BI "int TIFFGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", " ... ")" +.br +.BI "int TIFFVGetFieldDefaulted(TIFF *" tif ", ttag_t " tag ", va_list " ap ")" +.SH DESCRIPTION +.IR TIFFGetField +returns the value of a tag or pseudo-tag associated with the the current +directory of the opened +.SM TIFF +file +.IR tif . +(A +.I pseudo-tag +is a parameter that is used to control the operation of the +.SM TIFF +library but whose value is not read or written to the underlying file.) The +file must have been previously opened with +.IR TIFFOpen (3TIFF). +The tag is identified by +.IR tag , +one of the values defined in the include file +.B tiff.h +(see also the table below). The type and number of values returned is +dependent on the tag being requested. The programming interface uses a +variable argument list as prescribed by the +.IR stdarg (3) +interface. The returned values should only be interpreted if +.IR TIFFGetField +returns 1. +.PP +.IR TIFFVGetField +is functionally equivalent to +.IR TIFFGetField +except that it takes a pointer to a variable argument list. +.I TIFFVGetField +is useful for layering interfaces on top of the functionality provided by +.IR TIFFGetField . +.PP +.IR TIFFGetFieldDefaulted +and +.IR TIFFVGetFieldDefaulted +are identical to +.IR TIFFGetField +and +.IR TIFFVGetField , +except that if a tag is not defined in the current directory and it has a +default value, then the default value is returned. +.PP +The tags understood by +.IR libtiff(3TIFF), +the number of parameter values, and the types for the returned values are +shown below. The data types are specified as in C and correspond to the types +used to specify tag values to +.IR TIFFSetField (3TIFF). +Remember that +.IR TIFFGetField +returns parameter values, so all the listed data types are pointers to storage +where values should be returned. +Consult the +.SM TIFF +specification (or relevant industry specification) for information on the +meaning of each tag and their possible values. +.PP +.nf +.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc*'u+2n +\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP +.sp 5p +TIFFTAG_ARTIST 1 char** +TIFFTAG_BADFAXLINES 1 uint32* +TIFFTAG_BITSPERSAMPLE 1 uint16* +TIFFTAG_CLEANFAXDATA 1 uint16* +TIFFTAG_COLORMAP 3 uint16** 1<" +.sp +.BI "TIFF* TIFFOpen(const char *" filename ", const char *" mode ")" +.br +.BI "TIFF* TIFFFdOpen(const int " fd ", const char *" filename ", const char *" mode ")" +.sp +.B "typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);" +.br +.B "typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);" +.br +.B "typedef int (*TIFFCloseProc)(thandle_t);" +.br +.B "typedef toff_t (*TIFFSizeProc)(thandle_t);" +.br +.B "typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);" +.br +.B "typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);" +.sp +.BI "TIFF* TIFFClientOpen(const char *" filename ", const char *" mode ", thandle_t " clientdata ", TIFFReadWriteProc " readproc ", TIFFReadWriteProc " writeproc ", TIFFSeekProc " seekproc ", TIFFCloseProc " closeproc ", TIFFSizeProc " sizeproc ", TIFFMapFileProc " mapproc ", TIFFUnmapFileProc " unmapproc ")" +.SH DESCRIPTION +.IR TIFFOpen +opens a +.SM TIFF +file whose name is +.I filename +and returns a handle to be used in subsequent calls to routines in +.IR libtiff . +If the open operation fails, then zero is returned. +The +.I mode +parameter specifies if the file is to be opened for reading (``r''), +writing (``w''), or appending (``a'') and, optionally, whether +to override certain default aspects of library operation (see below). +When a file is opened for appending, existing data will not +be touched; instead new data will be written as additional subfiles. +If an existing file is opened for writing, all previous data is +overwritten. +.PP +If a file is opened for reading, the first +.SM TIFF +directory in the file is automatically read +(also see +.IR TIFFSetDirectory (3TIFF) +for reading directories other than the first). +If a file is opened for writing or appending, a default directory +is automatically created for writing subsequent data. +This directory has all the default values specified in +.SM TIFF +Revision 6.0: +.IR BitsPerSample =1, +.IR ThreshHolding "=bilevel art scan," +.IR FillOrder =1 +(most significant bit of each data byte is filled first), +.IR Orientation =1 +(the 0th row represents the visual top of the image, and the 0th +column represents the visual left hand side), +.IR SamplesPerPixel =1, +.IR RowsPerStrip =infinity, +.IR ResolutionUnit =2 +(inches), and +.IR Compression =1 +(no compression). +To alter these values, or to define values for additional fields, +.IR TIFFSetField (3TIFF) +must be used. +.PP +.IR TIFFFdOpen +is like +.IR TIFFOpen +except that it opens a +.SM TIFF +file given an open file descriptor +.IR fd . +The file's name and mode must reflect that of the open descriptor. +The object associated with the file descriptor +.BR "must support random access" . +.PP +.IR TIFFClientOpen +is like +.IR TIFFOpen +except that the caller supplies a collection of functions that the +library will use to do \s-1UNIX\s+1-like I/O operations. +The +.I readproc +and +.I writeproc +are called to read and write data at the current file position. +.I seekproc +is called to change the current file position a la +.IR lseek (2). +.I closeproc +is invoked to release any resources associated with an open file. +.I sizeproc +is invoked to obtain the size in bytes of a file. +.I mapproc +and +.I unmapproc +are called to map and unmap a file's contents in memory; c.f. +.IR mmap (2) +and +.IR munmap (2). +The +.I clientdata +parameter is an opaque ``handle'' passed to the client-specified +routines passed as parameters to +.IR TIFFClientOpen . +.SH OPTIONS +The open mode parameter can include the following flags in +addition to the ``r'', ``w'', and ``a'' flags. +Note however that option flags must follow the read-write-append +specification. +.TP +.B l +When creating a new file force information be written with +Little-Endian byte order (but see below). +By default the library will create new files using the native +.SM CPU +byte order. +.TP +.B b +When creating a new file force information be written with +Big-Endian byte order (but see below). +By default the library will create new files using the native +.SM CPU +byte order. +.TP +.B L +Force image data that is read or written to be treated with +bits filled from Least Significant Bit (\s-1LSB\s+1) to +Most Significant Bit (\s-1MSB\s+1). +Note that this is the opposite to the way the library has +worked from its inception. +.TP +.B B +Force image data that is read or written to be treated with +bits filled from Most Significant Bit (\s-1MSB\s+1) to +Least Significant Bit (\s-1LSB\s+1); this is the default. +.TP +.B H +Force image data that is read or written to be treated with +bits filled in the same order as the native +.SM CPU. +.TP +.B M +Enable the use of memory-mapped files for images opened read-only. +If the underlying system does not support memory-mapped files +or if the specific image being opened cannot be memory-mapped +then the library will fallback to using the normal system interface +for reading information. +By default the library will attempt to use memory-mapped files. +.TP +.B m +Disable the use of memory-mapped files. +.TP +.B C +Enable the use of ``strip chopping'' when reading images +that are comprised of a single strip or tile of uncompressed data. +Strip chopping is a mechanism by which the library will automatically +convert the single-strip image to multiple strips, +each of which has about 8 Kilobytes of data. +This facility can be useful in reducing the amount of memory used +to read an image because the library normally reads each strip +in its entirety. +Strip chopping does however alter the apparent contents of the +image because when an image is divided into multiple strips it +looks as though the underlying file contains multiple separate +strips. +Finally, note that default handling of strip chopping is a compile-time +configuration parameter. +The default behaviour, for backwards compatibility, is to enable +strip chopping. +.TP +.B c +Disable the use of strip chopping when reading images. +.TP +.B h +Read TIFF header only, do not load the first image directory. That could be +useful in case of the broken first directory. We can open the file and proceed +to the other directories. +.SH "BYTE ORDER" +The +.SM TIFF +specification (\fBall versions\fP) states that compliant readers +.IR "must be capable of reading images written in either byte order" . +Nonetheless some software that claims to support the reading of +.SM TIFF +images is incapable of reading images in anything but the native +.SM CPU +byte order on which the software was written. +(Especially notorious +are applications written to run on Intel-based machines.) +By default the library will create new files with the native +byte-order of the +.SM CPU +on which the application is run. +This ensures optimal performance and is portable to any application +that conforms to the TIFF specification. +To force the library to use a specific byte-order when creating +a new file the ``b'' and ``l'' option flags may be included in +the call to open a file; for example, ``wb'' or ``wl''. +.SH "RETURN VALUES" +Upon successful completion +.IR TIFFOpen , +.IR TIFFFdOpen , +and +.IR TIFFClientOpen +return a +.SM TIFF +pointer. +Otherwise, NULL is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +Likewise, warning messages are directed to the +.IR TIFFWarning (3TIFF) +routine. +.PP +\fB"%s": Bad mode\fP. +The specified +.I mode +parameter was not one of ``r'' (read), ``w'' (write), or ``a'' (append). +.PP +.BR "%s: Cannot open" . +.IR TIFFOpen () +was unable to open the specified filename for read/writing. +.PP +.BR "Cannot read TIFF header" . +An error occurred while attempting to read the header information. +.PP +.BR "Error writing TIFF header" . +An error occurred while writing the default header information +for a new file. +.PP +.BR "Not a TIFF file, bad magic number %d (0x%x)" . +The magic number in the header was not (hex) +0x4d4d or (hex) 0x4949. +.PP +.BR "Not a TIFF file, bad version number %d (0x%x)" . +The version field in the header was not 42 (decimal). +.PP +.BR "Cannot append to file that has opposite byte ordering" . +A file with a byte ordering opposite to the native byte +ordering of the current machine was opened for appending (``a''). +This is a limitation of the library. +.SH "SEE ALSO" +.IR libtiff (3TIFF), +.IR TIFFClose (3TIFF) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFPrintDirectory.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFPrintDirectory.3tiff new file mode 100644 index 0000000..437b09e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFPrintDirectory.3tiff @@ -0,0 +1,70 @@ +.\" $Id: TIFFPrintDirectory.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFPrintDirectory 3TIFF "December 12, 1991" "libtiff" +.SH NAME +TIFFPrintDirectory \- print a description of a +.SM TIFF +directory +.SH SYNOPSIS +.B "#include " +.sp +.BI "void TIFFPrintDirectory(TIFF *" tif ", FILE *" fd ", long " flags ")" +.SH DESCRIPTION +.I TIFFPrintDirectory +prints a description of the current directory in the specified +.SM TIFF +file to the standard I/O output stream +.IR fd . +The +.I flags +parameter is used to control the +.I "level of detail" +of the printed information; it is a bit-or of the flags defined in +.BR tiffio.h : +.sp .5 +.nf +.ta \w'#define 'u +\w'TIFFPRINT_JPEGDCTABLES 'u +\w'0x200 'u +#define TIFFPRINT_NONE 0x0 /* no extra info */ +#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ +#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ +#define TIFFPRINT_COLORMAP 0x4 /* colormap */ +#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ +#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ +#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ +.fi +.SH NOTES +In C++ the +.I flags +parameter defaults to 0. +.SH "RETURN VALUES" +None. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.IR libtiff (3TIFF), +.IR TIFFOpen (3TIFF), +.IR TIFFReadDirectory (3TIFF), +.IR TIFFSetDirectory (3TIFF) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFRGBAImage.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFRGBAImage.3tiff new file mode 100644 index 0000000..ef1a85c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFRGBAImage.3tiff @@ -0,0 +1,286 @@ +.\" $Id: TIFFRGBAImage.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFRGBAImage 3TIFF "October 29, 2004" "libtiff" +.SH NAME +TIFFRGBAImageOK, TIFFRGBAImageBegin, TIFFRGBAImageGet, TIFFRGBAImageEnd +\- read and decode an image into a raster +.SH SYNOPSIS +.B "#include " +.sp +.B "typedef unsigned char TIFFRGBValue;" +.B "typedef struct _TIFFRGBAImage TIFFRGBAImage;" +.sp +.BI "int TIFFRGBAImageOK(TIFF *" tif ", char " emsg[1024] ")" +.br +.BI "int TIFFRGBAImageBegin(TIFFRGBAImage *" img ", TIFF* " tif ", int " stopOnError ", char " emsg[1024] ")" +.br +.BI "int TIFFRGBAImageGet(TIFFRGBAImage *" img ", uint32* " raster ", uint32 " width " , uint32 " height ")" +.br +.BI "void TIFFRGBAImageEnd(TIFFRGBAImage *" img ")" +.br +.SH DESCRIPTION +The routines described here provide a high-level interface +through which +.SM TIFF +images may be read into memory. +Images may be strip- or tile-based and have a variety of different +characteristics: bits/sample, samples/pixel, photometric, etc. +Decoding state is encapsulated in a +.I TIFFRGBAImage +structure making it possible to capture state for multiple images +and quickly switch between them. +The target raster format can be customized to a particular application's +needs by installing custom routines that manipulate image data +according to application requirements. +.PP +The default usage for these routines is: check if an image can +be processed using +.IR TIFFRGBAImageOK , +construct a decoder state block using +.IR TIFFRGBAImageBegin , +read and decode an image into a target raster using +.IR TIFFRGBAImageGet , +and then +release resources using +.IR TIFFRGBAImageEnd . +.I TIFFRGBAImageGet +can be called multiple times to decode an image using different +state parameters. +If multiple images are to be displayed and there is not enough +space for each of the decoded rasters, multiple state blocks can +be managed and then calls can be made to +.I TIFFRGBAImageGet +as needed to display an image. +.PP +The generated raster is assumed to be an array of +.I width +times +.I height +32-bit entries, where +.I width +must be less than or equal to the width of the image (\c +.I height +may be any non-zero size). +If the raster dimensions are smaller than the image, the image data +is cropped to the raster bounds. +If the raster height is greater than that of the image, then the +image data are placed in the lower part of the raster. +(Note that the raster is assume to be organized such that the pixel +at location (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; +with the raster origin in the +.B lower-left +hand corner.) +.PP +Raster pixels are 8-bit packed red, green, blue, alpha samples. +The macros +.IR TIFFGetR , +.IR TIFFGetG , +.IR TIFFGetB , +and +.I TIFFGetA +should be used to access individual samples. +Images without Associated Alpha matting information have a constant +Alpha of 1.0 (255). +.PP +.I TIFFRGBAImageGet +converts non-8-bit images by scaling sample values. +Palette, grayscale, bilevel, +.SM CMYK\c +, and YCbCr images are converted to +.SM RGB +transparently. +Raster pixels are returned uncorrected by any colorimetry information +present in the directory. +.PP +The parameter +.I stopOnError +specifies how to act if an error is encountered while reading +the image. +If +.I stopOnError +is non-zero, then an error will terminate the operation; otherwise +.I TIFFRGBAImageGet +will continue processing data until all the possible data in the +image have been requested. +.SH "ALTERNATE RASTER FORMATS" +To use the core support for reading and processing +.SM TIFF +images, but write the resulting raster data in a different format +one need only override the ``\fIput methods\fP'' used to store raster data. +These methods are are defined in the +.I TIFFRGBAImage +structure and initially setup by +.I TIFFRGBAImageBegin +to point to routines that pack raster data in the default +.SM ABGR +pixel format. +Two different routines are used according to the physical organization +of the image data in the file: +.IR PlanarConfiguration =1 +(packed samples), +and +.IR PlanarConfiguration =2 +(separated samples). +Note that this mechanism can be used to transform the data before +storing it in the raster. +For example one can convert data +to colormap indices for display on a colormap display. +.SH "SIMULTANEOUS RASTER STORE AND DISPLAY" +It is simple to display an image as it is being read into memory +by overriding the put methods as described above for supporting +alternate raster formats. +Simply keep a reference to the default put methods setup by +.I TIFFRGBAImageBegin +and then invoke them before or after each display operation. +For example, the +.IR tiffgt (1) +utility uses the following put method to update the display as +the raster is being filled: +.sp +.nf +.ft C +static void +putContigAndDraw(TIFFRGBAImage* img, uint32* raster, + uint32 x, uint32 y, uint32 w, uint32 h, + int32 fromskew, int32 toskew, + unsigned char* cp) +{ + (*putContig)(img, raster, x, y, w, h, fromskew, toskew, cp); + if (x+w == width) { + w = width; + if (img->orientation == ORIENTATION_TOPLEFT) + lrectwrite(0, y-(h-1), w-1, y, raster-x-(h-1)*w); + else + lrectwrite(0, y, w-1, y+h-1, raster); + } +} +.ft R +.fi +.sp +(the original routine provided by the library is saved in the +variable +.IR putContig .) +.SH "SUPPORTING ADDITIONAL TIFF FORMATS" +The +.I TIFFRGBAImage +routines support the most commonly encountered flavors of +.SM TIFF. +It is possible to extend this support by overriding the ``\fIget method\fP'' +invoked by +.I TIFFRGBAImageGet +to read +.SM TIFF +image data. +Details of doing this are a bit involved, it is best to make a copy +of an existing get method and modify it to suit the needs of an +application. +.SH NOTES +Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +.I SamplesPerPixel +minus +.IR ExtraSamples ). +.PP +Palette image colormaps that appear to be incorrectly written +as 8-bit values are automatically scaled to 16-bits. +.SH "RETURN VALUES" +All routines return +1 if the operation was successful. +Otherwise, 0 is returned if an error was encountered and +.I stopOnError +is zero. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Sorry, can not handle %d-bit pictures" . +The image had +.I BitsPerSample +other than 1, 2, 4, 8, or 16. +.PP +.BR "Sorry, can not handle %d-channel images" . +The image had +.I SamplesPerPixel +other than 1, 3, or 4. +.PP +\fBMissing needed "PhotometricInterpretation" tag\fP. +The image did not have a tag that describes how to display +the data. +.PP +\fBNo "PhotometricInterpretation" tag, assuming RGB\fP. +The image was missing a tag that describes how to display it, +but because it has 3 or 4 samples/pixel, it is assumed to be +.SM RGB. +.PP +\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. +The image was missing a tag that describes how to display it, +but because it has 1 sample/pixel, it is assumed to be a grayscale +or bilevel image. +.PP +.BR "No space for photometric conversion table" . +There was insufficient memory for a table used to convert +image samples to 8-bit +.SM RGB. +.PP +\fBMissing required "Colormap" tag\fP. +A Palette image did not have a required +.I Colormap +tag. +.PP +.BR "No space for tile buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "No space for strip buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "Can not handle format" . +The image has a format (combination of +.IR BitsPerSample , +.IR SamplesPerPixel , +and +.IR PhotometricInterpretation ) +that can not be handled. +.PP +.BR "No space for B&W mapping table" . +There was insufficient memory to allocate a table used to map +grayscale data to +.SM RGB. +.PP +.BR "No space for Palette mapping table" . +There was insufficient memory to allocate a table used to map +data to 8-bit +.SM RGB. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadRGBAImage (3TIFF), +.BR TIFFReadRGBAImageOriented (3TIFF), +.BR TIFFReadRGBAStrip (3TIFF), +.BR TIFFReadRGBATile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadDirectory.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadDirectory.3tiff new file mode 100644 index 0000000..000bf0a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadDirectory.3tiff @@ -0,0 +1,164 @@ +.\" $Id: TIFFReadDirectory.3tiff,v 1.3 2010-12-12 01:45:35 faxguy Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadDirectory 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFReadDirectory \- get the contents of the next directory in an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFReadDirectory(TIFF *" tif ")" +.SH DESCRIPTION +Read the next directory in the specified file and make it the current +directory. Applications only need to call +.I TIFFReadDirectory +to read multiple subfiles in a single +.SM TIFF +file\(em +the first directory in a file is automatically read when +.IR TIFFOpen +is called. +.SH NOTES +If the library is compiled with +.SM STRIPCHOP_SUPPORT +enabled, then images that have a single uncompressed strip or tile of data are +automatically treated as if they were made up of multiple strips or tiles of +approximately 8 kilobytes each. This operation is done only in-memory; it does +not alter the contents of the file. However, the construction of the ``chopped +strips'' is visible to the application through the number of strips [tiles] +returned by +.I TIFFNumberOfStrips +[\c +.IR TIFFNumberOfTiles ]. +.SH "RETURN VALUES" +If the next directory was successfully read, 1 is returned. Otherwise, 0 is +returned if an error was encountered, or if there are no more directories to +be read. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +All warning messages are directed to the +.IR TIFFWarning (3TIFF) +routine. +.PP +\fBSeek error accessing TIFF directory\fP. +An error occurred while positioning to the location of the +directory. +.PP +\fBWrong data type %d for field "%s"\fP. +The tag entry in the directory had an incorrect data type. +For example, an +.I ImageDescription +tag with a +.SM SHORT +data type. +.PP +\fBTIFF directory is missing required "%s" field\fP. +The specified tag is required to be present by the +.SM TIFF +5.0 specification, but is missing. +The directory is (usually) unusable. +.PP +\fB%s: Rational with zero denominator\fP. +A directory tag has a +.SM RATIONAL +value whose denominator is zero. +.PP +\fBIncorrect count %d for field "%s" (%lu, expecting %lu); tag ignored\fP. +The specified tag's count field is bad. +For example, a count other than 1 for a +.I SubFileType +tag. +.PP +\fBCannot handle different per-sample values for field "%s"\fP. +The tag has +.I SamplesPerPixel +values and they are not all the same; e.g. +.IR BitsPerSample . +The library is unable to handle images of this sort. +.PP +\fBCount mismatch for field "%s"; expecting %d, got %d\fP. +The count field in a +tag does not agree with the number expected by the library. +This should never happen, so if it does, the library refuses to +read the directory. +.PP +\fBInvalid TIFF directory; tags are not sorted in ascending order\fP. +The directory tags are not properly sorted as specified +in the +.SM TIFF +5.0 specification. +This error is not fatal. +.PP +\fBIgnoring unknown field with tag %d (0x%x)\fP. +An unknown tag was encountered in the directory; +the library ignores all such tags. +.PP +\fBTIFF directory is missing required "ImageLength" field\fP. +The image violates the specification by not having a necessary field. +There is no way for the library to recover from this error. +.PP +\fBTIFF directory is missing required "PlanarConfig" field\fP. +The image violates the specification by not having a necessary field. +There is no way for the library to recover from this error. +.PP +\fBTIFF directory is missing required "StripOffsets" field\fP. +The image has multiple strips, but is missing the tag that +specifies the file offset to each strip of data. +There is no way for the library to recover from this error. +.PP +\fBTIFF directory is missing required "TileOffsets" field\fP. +The image has multiple tiles, but is missing the tag that +specifies the file offset to each tile of data. +There is no way for the library to recover from this error. +.PP +\fBTIFF directory is missing required "StripByteCounts" field\fP. +The image has multiple strips, but is missing the tag that +specifies the size of each strip of data. +There is no way for the library to recover from this error. +.PP +\fBTIFF directory is missing required "StripByteCounts" field, calculating from imagelength\fP. +The image violates the specification by not having a necessary field. +However, when the image is comprised of only one strip or tile, the +library will estimate the missing value based on the file size. +.PP +\fBBogus "StripByteCounts" field, ignoring and calculating from imagelength\fP. +Certain vendors violate the specification by writing zero for +the StripByteCounts tag when they want to leave the value +unspecified. +If the image has a single strip, the library will estimate +the missing value based on the file size. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteDirectory (3TIFF), +.BR TIFFSetDirectory (3TIFF), +.BR TIFFSetSubDirectory (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedStrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedStrip.3tiff new file mode 100644 index 0000000..d2d7b67 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedStrip.3tiff @@ -0,0 +1,78 @@ +.\" $Id: TIFFReadEncodedStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadEncodedStrip 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFReadEncodedStrip \- read and decode a strip of data from an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFReadEncodedStrip(TIFF *" tif ", tstrip_t " strip ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Read the specified strip of data and place up to +.I size +bytes of decompressed information in the (user supplied) data buffer. +.SH NOTES +The value of +.I strip +is a ``raw strip number.'' +That is, the caller must take into account whether or not the data are +organized in separate planes (\c +.IR PlanarConfiguration =2). +To read a full strip of data the data buffer should typically be at least as +large as the number returned by +.BR TIFFStripSize (3TIFF). +If the -1 passed in +.I size +parameter, the whole strip will be read. You should be sure you have enough +space allocated for the buffer. +.PP +The library attempts to hide bit- and byte-ordering differences between the +image and the native machine by converting data to the native machine order. +Bit reversal is done if the +.I FillOrder +tag is opposite to the native machine bit order. 16- and 32-bit samples are +automatically byte-swapped if the file was written with a byte order opposite +to the native machine byte order, +.SH "RETURN VALUES" +The actual number of bytes of data that were placed in +.I buf +is returned; +.IR TIFFReadEncodedStrip +returns \-1 if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadRawStrip (3TIFF), +.BR TIFFReadScanline (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedTile.3tiff new file mode 100644 index 0000000..5f6d900 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadEncodedTile.3tiff @@ -0,0 +1,76 @@ +.\" $Id: TIFFReadEncodedTile.3tiff,v 1.3 2006-10-13 07:22:01 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadEncodedTile 3TIFF "October 13, 2006" "libtiff" +.SH NAME +TIFFReadEncodedTile \- read and decode a tile of data from an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFReadEncodedTile(TIFF *" tif ", ttile_t " tile ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Read the specified tile of data and place up to +.I size +bytes of decompressed information in the (user supplied) data buffer. +.SH NOTES +The value of +.I tile +is a ``raw tile number.'' +That is, the caller must take into account whether or not the data are +organized in separate planes (\c +.IR PlanarConfiguration =2). +.IR TIFFComputeTile +automatically does this when converting an (x,y,z,sample) coordinate quadruple +to a tile number. To read a full tile of data the data buffer should be at +least as large as the value returned by +.IR TIFFTileSize . +.PP +The library attempts to hide bit- and byte-ordering differences between the +image and the native machine by converting data to the native machine order. +Bit reversal is done if the +.I FillOrder +tag is opposite to the native machine bit order. 16- and 32-bit samples are +automatically byte-swapped if the file was written with a byte order opposite +to the native machine byte order, +.SH "RETURN VALUES" +The actual number of bytes of data that were placed in +.I buf +is returned; +.IR TIFFReadEncodedTile +returns \-1 if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadRawTile (3TIFF), +.BR TIFFReadTile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAImage.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAImage.3tiff new file mode 100644 index 0000000..5d43ce3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAImage.3tiff @@ -0,0 +1,218 @@ +.\" $Id: TIFFReadRGBAImage.3tiff,v 1.4 2006-10-13 07:22:01 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadRGBAImage 3TIFF "October 13, 2006" "libtiff" +.SH NAME +TIFFReadRGBAImage, TIFFReadRGBAImageOriented \- read and decode an image +into a fixed-format raster +.SH SYNOPSIS +.B "#include " +.sp +.B "#define TIFFGetR(abgr) ((abgr) & 0xff)" +.br +.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)" +.br +.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)" +.br +.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)" +.sp +.BI "int TIFFReadRGBAImage(TIFF *" tif ", uint32 " width ", uint32 " height ", uint32 *" raster ", int " stopOnError ")" +.br +.BI "int TIFFReadRGBAImageOriented(TIFF *" tif ", uint32 " width ", uint32 " height ", uint32 *" raster ", int " orientation ", int " stopOnError ")" +.br +.SH DESCRIPTION +.IR TIFFReadRGBAImage +reads a strip- or tile-based image into memory, storing the +result in the user supplied +.IR raster . +The raster is assumed to be an array of +.I width +times +.I height +32-bit entries, where +.I width +must be less than or equal to the width of the image (\c +.I height +may be any non-zero size). +If the raster dimensions are smaller than the image, the image data +is cropped to the raster bounds. +If the raster height is greater than that of the image, then the +image data are placed in the lower part of the raster. +(Note that the raster is assume to be organized such that the pixel +at location (\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; +with the raster origin in the lower-left hand corner.) +.PP +.IR TIFFReadRGBAImageOriented +works like +.IR TIFFReadRGBAImage +with except of that user can specify the raster origin position with the +.I orientation +parameter. Four orientations supported: +.TP +.B ORIENTATION_TOPLEFT +origin in top-left corner, +.TP +.B ORIENTATION_TOPRIGHT +origin in top-right corner, +.TP +.B ORIENTATION_BOTLEFT +origin in bottom-left corner +and +.TP +.B ORIENTATION_BOTRIGHT +origin in bottom-right corner. +.LP +If you choose +.B ORIENTATION_BOTLEFT +result will be the same as returned by the +.IR TIFFReadRGBAImage. +.PP +Raster pixels are 8-bit packed red, green, blue, alpha samples. +The macros +.IR TIFFGetR , +.IR TIFFGetG , +.IR TIFFGetB , +and +.I TIFFGetA +should be used to access individual samples. +Images without Associated Alpha matting information have a constant +Alpha of 1.0 (255). +.PP +.I TIFFReadRGBAImage +converts non-8-bit images by scaling sample values. +Palette, grayscale, bilevel, +.SM CMYK\c +, and YCbCr images are converted to +.SM RGB +transparently. +Raster pixels are returned uncorrected by any colorimetry information +present in the directory. +.PP +The paramater +.I stopOnError +specifies how to act if an error is encountered while reading +the image. +If +.I stopOnError +is non-zero, then an error will terminate the operation; otherwise +.I TIFFReadRGBAImage +will continue processing data until all the possible data in the +image have been requested. +.SH NOTES +In C++ the +.I stopOnError +parameter defaults to 0. +.PP +Samples must be either 1, 2, 4, 8, or 16 bits. +Colorimetric samples/pixel must be either 1, 3, or 4 (i.e. +.I SamplesPerPixel +minus +.IR ExtraSamples ). +.PP +Palettte image colormaps that appear to be incorrectly written +as 8-bit values are automatically scaled to 16-bits. +.PP +.I TIFFReadRGBAImage +is just a wrapper around the more general +.IR TIFFRGBAImage (3TIFF) +facilities. +.SH "RETURN VALUES" +1 is returned if the image was successfully read and converted. +Otherwise, 0 is returned if an error was encountered and +.I stopOnError +is zero. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Sorry, can not handle %d-bit pictures" . +The image had +.I BitsPerSample +other than 1, 2, 4, 8, or 16. +.PP +.BR "Sorry, can not handle %d-channel images" . +The image had +.I SamplesPerPixel +other than 1, 3, or 4. +.PP +\fBMissing needed "PhotometricInterpretation" tag\fP. +The image did not have a tag that describes how to display +the data. +.PP +\fBNo "PhotometricInterpretation" tag, assuming RGB\fP. +The image was missing a tag that describes how to display it, +but because it has 3 or 4 samples/pixel, it is assumed to be +.SM RGB. +.PP +\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. +The image was missing a tag that describes how to display it, +but because it has 1 sample/pixel, it is assumed to be a grayscale +or bilevel image. +.PP +.BR "No space for photometric conversion table" . +There was insufficient memory for a table used to convert +image samples to 8-bit +.SM RGB. +.PP +\fBMissing required "Colormap" tag\fP. +A Palette image did not have a required +.I Colormap +tag. +.PP +.BR "No space for tile buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "No space for strip buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "Can not handle format" . +The image has a format (combination of +.IR BitsPerSample , +.IR SamplesPerPixel , +and +.IR PhotometricInterpretation ) +that +.I TIFFReadRGBAImage +can not handle. +.PP +.BR "No space for B&W mapping table" . +There was insufficient memory to allocate a table used to map +grayscale data to +.SM RGB. +.PP +.BR "No space for Palette mapping table" . +There was insufficient memory to allocate a table used to map +data to 8-bit +.SM RGB. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFRGBAImage (3TIFF), +.BR TIFFReadRGBAStrip (3TIFF), +.BR TIFFReadRGBATile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAStrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAStrip.3tiff new file mode 100644 index 0000000..a8bb189 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBAStrip.3tiff @@ -0,0 +1,170 @@ +.\" $Id: TIFFReadRGBAStrip.3tiff,v 1.3 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadRGBAStrip 3TIFF "December 10, 1998" "libtiff" +.SH NAME +TIFFReadRGBAStrip \- read and decode an image strip into a fixed-format raster +.SH SYNOPSIS +.B "#include " +.sp +.B "#define TIFFGetR(abgr) ((abgr) & 0xff)" +.br +.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)" +.br +.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)" +.br +.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)" +.sp +.BI "int TIFFReadRGBAStrip(TIFF *" tif ", uint32 " row ", uint32 *" raster ")" +.SH DESCRIPTION +.IR TIFFReadRGBAStrip +reads a single strip of a strip-based image into memory, storing the result in +the user supplied RGBA +.IR raster . +The raster is assumed to be an array of width times rowsperstrip 32-bit +entries, where width is the width of the image (TIFFTAG_IMAGEWIDTH) and +rowsperstrip is the maximum lines in a strip (TIFFTAG_ROWSPERSTRIP). + +.PP +The +.IR row +value should be the row of the first row in the strip (strip * rowsperstrip, +zero based). + +.PP +Note that the raster is assume to be organized such that the pixel at location +(\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; with the +raster origin in the +.I lower-left hand corner +of the strip. That is bottom to top organization. When reading a partial last +strip in the file the last line of the image will begin at the beginning of +the buffer. + +.PP +Raster pixels are 8-bit packed red, green, blue, alpha samples. The macros +.IR TIFFGetR , +.IR TIFFGetG , +.IR TIFFGetB , +and +.I TIFFGetA +should be used to access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255). +.PP +See the +.IR TIFFRGBAImage (3TIFF) +page for more details on how various image types are converted to RGBA values. +.SH NOTES +Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must +be either 1, 3, or 4 (i.e. +.I SamplesPerPixel +minus +.IR ExtraSamples ). +.PP +Palette image colormaps that appear to be incorrectly written as 8-bit values +are automatically scaled to 16-bits. +.PP +.I TIFFReadRGBAStrip +is just a wrapper around the more general +.IR TIFFRGBAImage (3TIFF) +facilities. It's main advantage over the similar +.IR TIFFReadRGBAImage() +function is that for large images a single buffer capable of holding the whole +image doesn't need to be allocated, only enough for one strip. The +.IR TIFFReadRGBATile() +function does a similar operation for tiled images. +.SH "RETURN VALUES" +1 is returned if the image was successfully read and converted. +Otherwise, 0 is returned if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Sorry, can not handle %d-bit pictures" . +The image had +.I BitsPerSample +other than 1, 2, 4, 8, or 16. +.PP +.BR "Sorry, can not handle %d-channel images" . +The image had +.I SamplesPerPixel +other than 1, 3, or 4. +.PP +\fBMissing needed "PhotometricInterpretation" tag\fP. +The image did not have a tag that describes how to display the data. +.PP +\fBNo "PhotometricInterpretation" tag, assuming RGB\fP. +The image was missing a tag that describes how to display it, but because it +has 3 or 4 samples/pixel, it is assumed to be +.SM RGB. +.PP +\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. The image was +missing a tag that describes how to display it, but because it has 1 +sample/pixel, it is assumed to be a grayscale or bilevel image. +.PP +.BR "No space for photometric conversion table" . +There was insufficient memory for a table used to convert image samples to +8-bit +.SM RGB. +.PP +\fBMissing required "Colormap" tag\fP. +A Palette image did not have a required +.I Colormap +tag. +.PP +.BR "No space for tile buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "No space for strip buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "Can not handle format" . +The image has a format (combination of +.IR BitsPerSample , +.IR SamplesPerPixel , +and +.IR PhotometricInterpretation ) +that +.I TIFFReadRGBAImage +can not handle. +.PP +.BR "No space for B&W mapping table" . +There was insufficient memory to allocate a table used to map grayscale data +to +.SM RGB. +.PP +.BR "No space for Palette mapping table" . +There was insufficient memory to allocate a table used to map data to 8-bit +.SM RGB. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFRGBAImage (3TIFF), +.BR TIFFReadRGBAImage (3TIFF), +.BR TIFFReadRGBATile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBATile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBATile.3tiff new file mode 100644 index 0000000..dfae1a9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRGBATile.3tiff @@ -0,0 +1,171 @@ +.\" $Id: TIFFReadRGBATile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadRGBATile 3TIFF "December 10, 1998" "libtiff" +.SH NAME +TIFFReadRGBATile \- read and decode an image tile into a fixed-format raster +.SH SYNOPSIS +.B "#include " +.sp +.B "#define TIFFGetR(abgr) ((abgr) & 0xff)" +.br +.B "#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)" +.br +.B "#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)" +.br +.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)" +.sp +.BI "int TIFFReadRGBATile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 *" raster ")" +.SH DESCRIPTION +.IR TIFFReadRGBATile +reads a single tile of a tile-based image into memory, storing the result in +the user supplied RGBA +.IR raster . +The raster is assumed to be an array of width times length 32-bit entries, +where width is the width of a tile (TIFFTAG_TILEWIDTH) and length is the +height of a tile (TIFFTAG_TILELENGTH). + +.PP +The +.IR x +and +.IR y +values are the offsets from the top left corner to the top left corner of the +tile to be read. They must be an exact multiple of the tile width and length. + +.PP +Note that the raster is assume to be organized such that the pixel at location +(\fIx\fP,\fIy\fP) is \fIraster\fP[\fIy\fP*\fIwidth\fP+\fIx\fP]; with the +raster origin in the +.I lower-left hand corner +of the tile. That is bottom to top organization. Edge tiles which partly fall +off the image will be filled out with appropriate zeroed areas. + +.PP +Raster pixels are 8-bit packed red, green, blue, alpha samples. The macros +.IR TIFFGetR , +.IR TIFFGetG , +.IR TIFFGetB , +and +.I TIFFGetA +should be used to access individual samples. Images without Associated Alpha +matting information have a constant Alpha of 1.0 (255). +.PP +See the +.IR TIFFRGBAImage (3TIFF) +page for more details on how various image types are converted to RGBA values. +.SH NOTES +Samples must be either 1, 2, 4, 8, or 16 bits. Colorimetric samples/pixel must +be either 1, 3, or 4 (i.e. +.I SamplesPerPixel +minus +.IR ExtraSamples ). +.PP +Palette image colormaps that appear to be incorrectly written as 8-bit values +are automatically scaled to 16-bits. +.PP +.I TIFFReadRGBATile +is just a wrapper around the more general +.IR TIFFRGBAImage (3TIFF) +facilities. It's main advantage over the similar +.IR TIFFReadRGBAImage() +function is that for large images a single buffer capable of holding the whole +image doesn't need to be allocated, only enough for one tile. The +.IR TIFFReadRGBAStrip() +function does a similar operation for stripped images. +.SH "RETURN VALUES" +1 is returned if the image was successfully read and converted. +Otherwise, 0 is returned if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Sorry, can not handle %d-bit pictures" . +The image had +.I BitsPerSample +other than 1, 2, 4, 8, or 16. +.PP +.BR "Sorry, can not handle %d-channel images" . +The image had +.I SamplesPerPixel +other than 1, 3, or 4. +.PP +\fBMissing needed "PhotometricInterpretation" tag\fP. +The image did not have a tag that describes how to display the data. +.PP +\fBNo "PhotometricInterpretation" tag, assuming RGB\fP. +The image was missing a tag that describes how to display it, but because it +has 3 or 4 samples/pixel, it is assumed to be +.SM RGB. +.PP +\fBNo "PhotometricInterpretation" tag, assuming min-is-black\fP. +The image was missing a tag that describes how to display it, +but because it has 1 sample/pixel, it is assumed to be a grayscale +or bilevel image. +.PP +.BR "No space for photometric conversion table" . +There was insufficient memory for a table used to convert +image samples to 8-bit +.SM RGB. +.PP +\fBMissing required "Colormap" tag\fP. +A Palette image did not have a required +.I Colormap +tag. +.PP +.BR "No space for tile buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "No space for strip buffer" . +There was insufficient memory to allocate an i/o buffer. +.PP +.BR "Can not handle format" . +The image has a format (combination of +.IR BitsPerSample , +.IR SamplesPerPixel , +and +.IR PhotometricInterpretation ) +that +.I TIFFReadRGBAImage +can not handle. +.PP +.BR "No space for B&W mapping table" . +There was insufficient memory to allocate a table used to map +grayscale data to +.SM RGB. +.PP +.BR "No space for Palette mapping table" . +There was insufficient memory to allocate a table used to map data to 8-bit +.SM RGB. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFRGBAImage (3TIFF), +.BR TIFFReadRGBAImage (3TIFF), +.BR TIFFReadRGBAStrip (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawStrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawStrip.3tiff new file mode 100644 index 0000000..1f2d1d1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawStrip.3tiff @@ -0,0 +1,64 @@ +.\" $Id: TIFFReadRawStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadRawStrip 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFReadRawStrip \- return the undecoded contents of a strip of data from an +open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFReadRawStrip(TIFF *" tif ", tstrip_t " strip ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Read the contents of the specified strip into the (user supplied) data buffer. +Note that the value of +.I strip +is a ``raw strip number.'' That is, the caller must take into account whether +or not the data is organized in separate planes (\c +.IR PlanarConfiguration =2). +To read a full strip of data the data buffer should typically be at least as +large as the number returned by +.IR TIFFStripSize . +.SH "RETURN VALUES" +The actual number of bytes of data that were placed in +.I buf +is returned; +.IR TIFFReadEncodedStrip +returns \-1 if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadEncodedStrip (3TIFF), +.BR TIFFReadScanline (3TIFF), +.BR TIFFStripSize (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawTile.3tiff new file mode 100644 index 0000000..3945dd9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadRawTile.3tiff @@ -0,0 +1,65 @@ +.\" $Id: TIFFReadRawTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadRawTile 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFReadRawTile \- return an undecoded tile of data from an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFReadRawTile(TIFF *" tif ", ttile_t " tile ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Read the contents of the specified tile into the (user supplied) data buffer. +Note that the value of +.I tile +is a ``raw tile number.'' That is, the caller must take into account whether +or not the data is organized in separate planes (\c +.IR PlanarConfiguration =2). +.I TIFFComputeTile +automatically does this when converting an (x,y,z,sample) coordinate quadruple +to a tile number. To read a full tile of data the data buffer should typically +be at least as large as the value returned by +.IR TIFFTileSize . +.SH "RETURN VALUES" +The actual number of bytes of data that were placed in +.I buf +is returned; +.IR TIFFReadEncodedTile +returns \-1 if an error was encountered. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadEncodedTile (3TIFF), +.BR TIFFReadTile (3TIFF), +.BR TIFFTileSize (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadScanline.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadScanline.3tiff new file mode 100644 index 0000000..7baf651 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadScanline.3tiff @@ -0,0 +1,94 @@ +.\" $Id: TIFFReadScanline.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadScanline 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFReadScanline \- read and decode a scanline of data from an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")" +.SH DESCRIPTION +Read the data for the specified row into the (user supplied) data buffer +.IR buf . +The data are returned decompressed and, in the native byte- and bit-ordering, +but are otherwise packed (see further below). The buffer must be large enough +to hold an entire scanline of data. Applications should call the routine +.IR TIFFScanlineSize +to find out the size (in bytes) of a scanline buffer. +The +.I row +parameter is always used by +.IR TIFFReadScanline ; +the +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.SH NOTES +The library attempts to hide bit- and byte-ordering differences between the +image and the native machine by converting data to the native machine order. +Bit reversal is done if the +.I FillOrder +tag is opposite to the native machine bit order. 16- and 32-bit samples are +automatically byte-swapped if the file was written with a byte order opposite +to the native machine byte order, +.PP +In C++ the +.I sample +parameter defaults to 0. +.SH "RETURN VALUES" +.IR TIFFReadScanline +returns \-1 if it detects an error; otherwise 1 is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Compression algorithm does not support random access" . +Data was requested in a non-sequential order from a file that uses a +compression algorithm and that has +.I RowsPerStrip +greater than one. +That is, data in the image is stored in a compressed form, and with multiple +rows packed into a strip. In this case, the library does not support random +access to the data. The data should either be accessed sequentially, or the +file should be converted so that each strip is made up of one row of data. +.SH BUGS +Reading subsampled YCbCR data does not work correctly because, for +.IR PlanarConfiguration =2 +the size of a scanline is not calculated on a per-sample basis, and for +.IR PlanarConfiguration =1 +the library does not unpack the block-interleaved samples; use the strip- and +tile-based interfaces to read these formats. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadEncodedStrip (3TIFF), +.BR TIFFReadRawStrip (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadTile.3tiff new file mode 100644 index 0000000..4a9b20d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFReadTile.3tiff @@ -0,0 +1,84 @@ +.\" $Id: TIFFReadTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFReadTile 3TIFF "December 16, 1991" "libtiff" +.SH NAME +TIFFReadTile \- read and decode a tile of data from an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFReadTile(TIFF *" tif ", tdata_t " buf ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")" +.SH DESCRIPTION +Return the data for the tile +.I containing +the specified coordinates. The data placed in +.I buf +are returned decompressed and, typically, in the native byte- and +bit-ordering, but are otherwise packed (see further below). The buffer must be +large enough to hold an entire tile of data. Applications should call the +routine +.IR TIFFTileSize +to find out the size (in bytes) of a tile buffer. The +.I x +and +.I y +parameters are always used by +.IR TIFFReadTile . +The +.I z +parameter is used if the image is deeper than 1 slice (\c +.IR ImageDepth >1). +The +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.SH NOTES +The library attempts to hide bit- and byte-ordering differences between the +image and the native machine by converting data to the native machine order. +Bit reversal is done if the +.I FillOrder +tag is opposite to the native machine bit order. 16- and 32-bit samples are +automatically byte-swapped if the file was written with a byte order opposite +to the native machine byte order, +.SH "RETURN VALUES" +.IR TIFFReadTile +returns \-1 if it detects an error; otherwise the number of bytes in the +decoded tile is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFCheckTile (3TIFF), +.BR TIFFComputeTile (3TIFF), +.BR TIFFOpen (3TIFF), +.BR TIFFReadEncodedTile (3TIFF), +.BR TIFFReadRawTile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetDirectory.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetDirectory.3tiff new file mode 100644 index 0000000..162d310 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetDirectory.3tiff @@ -0,0 +1,79 @@ +.\" $Id: TIFFSetDirectory.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSetDirectory 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFSetDirectory, TIFFSetSubDirectory \- set the current directory for an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFSetDirectory(TIFF *" tif ", tdir_t " dirnum ")" +.br +.BI "int TIFFSetSubDirectory(TIFF *" tif ", uint32 " diroff ")" +.SH DESCRIPTION +.I TIFFSetDirectory +changes the current directory and reads its contents with +.IR TIFFReadDirectory . +The parameter +.I dirnum +specifies the subfile/directory as an integer number, with the first directory +numbered zero. +.PP +.I TIFFSetSubDirectory +acts like +.IR TIFFSetDirectory , +except the directory is specified as a file offset instead of an index; this +is required for accessing subdirectories linked through a +.I SubIFD +tag. +.SH "RETURN VALUES" +On successful return 1 is returned. Otherwise, 0 is returned if +.I dirnum +or +.I diroff +specifies a non-existent directory, or if an error was encountered while +reading the directory's contents. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "%s: Error fetching directory count" . +An error was encountered while reading the ``directory count'' field. +.PP +.BR "%s: Error fetching directory link" . +An error was encountered while reading the ``link value'' that points to the +next directory in a file. +.SH "SEE ALSO" +.IR TIFFCurrentDirectory (3TIFF), +.IR TIFFOpen (3TIFF), +.IR TIFFReadDirectory (3TIFF), +.IR TIFFWriteDirectory (3TIFF), +.IR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetField.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetField.3tiff new file mode 100644 index 0000000..33e9471 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFSetField.3tiff @@ -0,0 +1,217 @@ +.\" $Id: TIFFSetField.3tiff,v 1.5 2010-05-06 02:54:46 olivier Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSetField 3TIFF "October 29, 2004" "libtiff" +.SH NAME +TIFFSetField, TIFFVSetField \- set the value(s) of a tag in a +.SM TIFF +file open for writing +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFSetField(TIFF *" tif ", ttag_t " tag ", " ... ")" +.sp +.B "#include " +.sp +.BI "int TIFFVSetField(TIFF *" tif ", ttag_t " tag ", va_list " ap ")" +.SH DESCRIPTION +.IR TIFFSetField +sets the value of a field +or pseudo-tag in the current directory associated with +the open +.SM TIFF +file +.IR tif . +(A +.I pseudo-tag +is a parameter that is used to control the operation of the +.SM TIFF +library but whose value is not read or written to the underlying file.) +To set the value of a field +the file must have been previously opened for writing with +.IR TIFFOpen (3TIFF); +pseudo-tags can be set whether the file was opened for reading +or writing. +The field is identified by +.IR tag , +one of the values defined in the include file +.B tiff.h +(see also the table below). +The actual value is specified using a variable argument list, +as prescribed by the +.IR stdarg (3) +interface (\c +or, on some machines, the +.IR varargs (3) +interface.) +.PP +.IR TIFFVSetField +is functionally equivalent to +.IR TIFFSetField +except that it takes a pointer to a variable +argument list. +.I TIFFVSetField +is useful for writing routines that are layered +on top of the functionality provided by +.IR TIFFSetField . +.PP +The tags understood by +.IR libtiff , +the number of parameter values, and the +expected types for the parameter values are shown below. +The data types are: +.I char* +is null-terminated string and corresponds to the +.SM ASCII +data type; +.I uint16 +is an unsigned 16-bit value; +.I uint32 +is an unsigned 32-bit value; +.I uint16* +is an array of unsigned 16-bit values. +.I void* +is an array of data values of unspecified type. + +Consult the +.SM TIFF +specification for information on the meaning of each tag. +.PP +.nf +.ta \w'TIFFTAG_CONSECUTIVEBADFAXLINES'u+2n +\w'Count'u+2n +\w'TIFFFaxFillFunc \(dg'u+2n +\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP +.sp 5p +TIFFTAG_ARTIST 1 char* +TIFFTAG_BADFAXLINES 1 uint32 +TIFFTAG_BITSPERSAMPLE 1 uint16 \(dg +TIFFTAG_CLEANFAXDATA 1 uint16 +TIFFTAG_COLORMAP 3 uint16* 1< 0 +TIFFTAG_SAMPLEFORMAT 1 uint16 \(dg +TIFFTAG_SAMPLESPERPIXEL 1 uint16 \(dg value must be <= 4 +TIFFTAG_SMAXSAMPLEVALUE 1 double +TIFFTAG_SMINSAMPLEVALUE 1 double +TIFFTAG_SOFTWARE 1 char* +TIFFTAG_STONITS 1 double \(dg +TIFFTAG_SUBFILETYPE 1 uint32 +TIFFTAG_SUBIFD 2 uint16,uint32* count & offsets array +TIFFTAG_TARGETPRINTER 1 char* +TIFFTAG_THRESHHOLDING 1 uint16 +TIFFTAG_TILEDEPTH 1 uint32 \(dg +TIFFTAG_TILELENGTH 1 uint32 \(dg must be a multiple of 8 +TIFFTAG_TILEWIDTH 1 uint32 \(dg must be a multiple of 8 +TIFFTAG_TRANSFERFUNCTION 1 or 3\(dd uint16* 1<" +.sp +.BI "void TIFFWarning(const char *" module ", const char *" fmt ", " ... ")" +.sp +.B "#include " +.sp +.BI "typedef void (*TIFFWarningHandler)(const char *" module ", const char *" fmt ", va_list " ap ");" +.sp +.BI "TIFFWarningHandler TIFFSetWarningHandler(TIFFWarningHandler " handler ");" +.SH DESCRIPTION +.I TIFFWarning +invokes the library-wide warning handler function to (normally) write a +warning message to the +.BR stderr . +The +.I fmt +parameter is a +.IR printf (3S) +format string, and any number arguments can be supplied. The +.I module +parameter is interpreted as a string that, if non-zero, should be printed +before the message; it typically is used to identify the software module in +which a warning is detected. +.PP +Applications that desire to capture control in the event of a warning should +use +.IR TIFFSetWarningHandler +to override the default warning handler. +A +.SM NULL +(0) warning handler function may be installed to suppress error messages. +.SH "RETURN VALUES" +.IR TIFFSetWarningHandler +returns a reference to the previous error handling function. +.SH "SEE ALSO" +.BR TIFFError (3TIFF), +.BR libtiff (3TIFF), +.BR printf (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteDirectory.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteDirectory.3tiff new file mode 100644 index 0000000..b8de6bf --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteDirectory.3tiff @@ -0,0 +1,138 @@ +.\" $Id: TIFFWriteDirectory.3tiff,v 1.3 2010-12-12 01:45:35 faxguy Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteDirectory 3TIFF "September 26, 2001" "libtiff" +.SH NAME +TIFFWriteDirectory, TIFFRewriteDirectory, TIFFCheckpointDirectory \- write the +current directory in an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFWriteDirectory(TIFF *" tif ")" +.br +.BI "int TIFFRewriteDirectory(TIFF *" tif ")" +.br +.BI "int TIFFCheckpointDirectory(TIFF *" tif ")" +.SH DESCRIPTION +.IR TIFFWriteDirectory +will write the contents of the current directory to the file and setup to +create a new subfile in the same file. Applications only need to call +.IR TIFFWriteDirectory +when writing multiple subfiles to a single +.SM TIFF +file. +.IR TIFFWriteDirectory +is automatically called by +.IR TIFFClose +and +.IR TIFFFlush +to write a modified directory if the file is open for writing. +.PP +The +.IR TIFFRewriteDirectory +function operates similarly to +.IR TIFFWriteDirectory, +but can be called with directories previously read or written that already +have an established location in the file. It will rewrite the directory, +but instead of place it at it's old location (as +.IR TIFFWriteDirectory +would) it will place them at the end of the file, correcting the pointer from +the preceding directory or file header to point to it's new location. This +is particularly important in cases where the size of the directory and +pointed to data has grown, so it won't fit in the space available at the +old location. +.PP +The +.IR TIFFCheckpointDirectory +writes the current state of the tiff directory into the file to make what +is currently in the file readable. Unlike +.IR TIFFWriteDirectory, +.IR TIFFCheckpointDirectory +does not free up the directory data structures in memory, so they can be +updated (as strips/tiles are written) and written again. Reading such +a partial file you will at worst get a tiff read error for the first +strip/tile encountered that is incomplete, but you will at least get +all the valid data in the file before that. When the file is complete, +just use +.IR TIFFWriteDirectory +as usual to finish it off cleanly. +.SH "RETURN VALUES" +1 is returned when the contents are successfully written to the file. +Otherwise, 0 is returned if an error was encountered when writing +the directory contents. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "Error post-encoding before directory write" . +Before writing the contents of the current directory, any pending data are +flushed. This message indicates that an error occurred while doing this. +.PP +.BR "Error flushing data before directory write" . +Before writing the contents of the current directory, any pending data are +flushed. This message indicates that an error occurred while doing this. +.PP +.BR "Cannot write directory, out of space" . +There was not enough space to allocate a temporary area for the directory that +was to be written. +.PP +.BR "Error writing directory count" . +A write error occurred when writing the count of fields in the directory. +.PP +.BR "Error writing directory contents" . +A write error occurred when writing the directory fields. +.PP +.BR "Error writing directory link" . +A write error occurred when writing the link to the next directory. +.PP +\fBError writing data for field "%s"\fP. +A write error occurred when writing indirect data for the specified field. +.PP +.BR "Error writing TIFF header" . +A write error occurred when re-writing header at the front of the file. +.PP +.BR "Error fetching directory count" . +A read error occurred when fetching the directory count field for +a previous directory. +This can occur when setting up a link to the directory that is being +written. +.PP +.BR "Error fetching directory link" . +A read error occurred when fetching the directory link field for +a previous directory. +This can occur when setting up a link to the directory that is being +written. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFError (3TIFF), +.BR TIFFReadDirectory (3TIFF), +.BR TIFFSetDirectory (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedStrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedStrip.3tiff new file mode 100644 index 0000000..4130634 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedStrip.3tiff @@ -0,0 +1,102 @@ +.\" $Id: TIFFWriteEncodedStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteEncodedStrip 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFWritedEncodedStrip \- compress and write a strip of data to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFWriteEncodedStrip(TIFF *" tif ", tstrip_t " strip ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Compress +.I size +bytes of raw data from +.I buf +and write the result to the specified strip; replacing any previously written +data. Note that the value of +.I strip +is a ``raw strip number.'' That is, the caller must take into account whether +or not the data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.SH NOTES +The library writes encoded data using the native machine byte order. Correctly +implemented +.SM TIFF +readers are expected to do any necessary byte-swapping to correctly process +image data with BitsPerSample greater than 8. +.PP +The strip number must be valid according to the current settings of the +.I ImageLength +and +.I RowsPerStrip +tags. +An image may be dynamically grown by increasing the value of +.I ImageLength +prior to each call to +.IR TIFFWriteEncodedStrip . +.SH "RETURN VALUES" +\-1 is returned if an error was encountered. Otherwise, the value of +.IR size +is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +\fB%s: File not open for writing\fP. The file was opened for reading, not +writing. +.PP +\fBCan not write scanlines to a tiled image\fP. The image is assumed to be +organized in tiles because the +.I TileWidth +and +.I TileLength +tags have been set with +.IR TIFFSetField (3TIFF). +.PP +\fB%s: Must set "ImageWidth" before writing data\fP. +The image's width has not be set before the first write. See +.IR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: Must set "PlanarConfiguration" before writing data\fP. +The organization of data has not be defined before the first write. See +.IR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: No space for strip arrays"\fP. +There was not enough space for the arrays that hold strip offsets and byte +counts. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteScanline (3TIFF), +.BR TIFFWriteRawStrip (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedTile.3tiff new file mode 100644 index 0000000..4bb471f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteEncodedTile.3tiff @@ -0,0 +1,96 @@ +.\" $Id: TIFFWriteEncodedTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteEncodedTile 3TIFF "December 16, 1991" "libtiff" +.SH NAME +TIFFWritedEncodedTile \- compress and write a tile of data to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFWriteEncodedTile(TIFF *" tif ", ttile_t " tile ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Compress +.I size +bytes of raw data from +.I buf +and +.B append +the result to the end of the specified tile. Note that the value of +.I tile +is a ``raw tile number.'' That is, the caller must take into account whether +or not the data are organized in separate places (\c +.IR PlanarConfiguration =2). +.IR TIFFComputeTile +automatically does this when converting an (x,y,z,sample) coordinate quadruple +to a tile number. +.SH NOTES +The library writes encoded data using the native machine byte order. Correctly +implemented +.SM TIFF +readers are expected to do any necessary byte-swapping to correctly process +image data with BitsPerSample greater than 8. +.SH "RETURN VALUES" +\-1 is returned if an error was encountered. Otherwise, the value of +.IR size +is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.PP +\fB%s: File not open for writing\fP. +The file was opened for reading, not writing. +.PP +\fBCan not write tiles to a stripped image\fP. +The image is assumed to be organized in strips because neither of the +.I TileWidth +or +.I TileLength +tags have been set with +.BR TIFFSetField (3TIFF). +.PP +\fB%s: Must set "ImageWidth" before writing data\fP. The image's width has not +be set before the first write. See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: Must set "PlanarConfiguration" before writing data\fP. The organization +of data has not be defined before the first write. See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: No space for tile arrays"\fP. +There was not enough space for the arrays that hold tile offsets and byte +counts. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteTile (3TIFF), +.BR TIFFWriteRawTile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawStrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawStrip.3tiff new file mode 100644 index 0000000..0fed3aa --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawStrip.3tiff @@ -0,0 +1,96 @@ +.\" $Id: TIFFWriteRawStrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteRawstrip 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFWriteRawStrip \- write a strip of raw data to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFWriteRawStrip(TIFF *" tif ", tstrip_t " strip ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Append +.I size +bytes of raw data to the specified strip. +.SH NOTES +The strip number must be valid according to the current settings of the +.I ImageLength +and +.I RowsPerStrip +tags. +An image may be dynamically grown by increasing the value of +.I ImageLength +prior to each call to +.IR TIFFWriteRawStrip . +.SH "RETURN VALUES" +\-1 is returned if an error occurred. +Otherwise, the value of +.IR size +is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.PP +\fB%s: File not open for writing\fP. +The file was opened for reading, not writing. +.PP +\fBCan not write scanlines to a tiled image\fP. The image is assumed to be +organized in tiles because the +.I TileWidth +and +.I TileLength +tags have been set with +.BR TIFFSetField (3TIFF). +.PP +\fB%s: Must set "ImageWidth" before writing data\fP. +The image's width has not be set before the first write. +See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: Must set "PlanarConfiguration" before writing data\fP. +The organization of data has not be defined before the first write. +See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: No space for strip arrays"\fP. +There was not enough space for the arrays that hold strip +offsets and byte counts. +.PP +\fB%s: Strip %d out of range, max %d\fP. +The specified strip is not a valid strip according to the +currently specified image dimensions. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteEncodedStrip (3TIFF), +.BR TIFFWriteScanline (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawTile.3tiff new file mode 100644 index 0000000..d422e58 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteRawTile.3tiff @@ -0,0 +1,84 @@ +.\" $Id: TIFFWriteRawTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteRawtile 3TIFF "December 16, 1991" "libtiff" +.SH NAME +TIFFWriteRawTile \- write a tile of raw data to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFWriteRawTile(TIFF *" tif ", ttile_t " tile ", tdata_t " buf ", tsize_t " size ")" +.SH DESCRIPTION +Append +.I size +bytes of raw data to the specified tile. +.SH "RETURN VALUES" +\-1 is returned if an error occurred. Otherwise, the value of +.IR size +is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.PP +\fB%s: File not open for writing\fP. +The file was opened for reading, not writing. +.PP +\fBCan not write tiles to a stripped image\fP. +The image is assumed to be organized in strips because neither of the +.I TileWidth +or +.I TileLength +tags have been set with +.BR TIFFSetField (3TIFF). +.PP +\fB%s: Must set "ImageWidth" before writing data\fP. +The image's width has not be set before the first write. +See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: Must set "PlanarConfiguration" before writing data\fP. The organization +of data has not be defined before the first write. See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: No space for tile arrays"\fP. +There was not enough space for the arrays that hold tile offsets and byte +counts. +.PP +\fB%s: Specified tile %d out of range, max %d\fP. +The specified tile is not valid according to the currently specified image +dimensions. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteEncodedTile (3TIFF), +.BR TIFFWriteScanline (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteScanline.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteScanline.3tiff new file mode 100644 index 0000000..0dd35f5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteScanline.3tiff @@ -0,0 +1,154 @@ +.\" $Id: TIFFWriteScanline.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteScanline 3TIFF "December 16, 1991" "libtiff" +.SH NAME +TIFFWriteScanline \- write a scanline to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFWriteScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")" +.SH DESCRIPTION +Write data to a file at the specified row. The +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +The data are assumed to be uncompressed and in the native bit- and byte-order +of the host machine. The data written to the file is compressed according to +the compression scheme of the current +.SM TIFF +directory (see further below). If the current scanline is past the end of the +current subfile, the +.I ImageLength +field is automatically increased to include the scanline (except +for +.IR PlanarConfiguration =2, +where the +.I ImageLength +cannot be changed once the first data are written). If the +.I ImageLength +is increased, the +.I StripOffsets +and +.I StripByteCounts +fields are similarly enlarged to reflect data written past the previous end of +image. +.SH NOTES +The library writes encoded data using the native machine byte order. Correctly +implemented +.SM TIFF +readers are expected to do any necessary byte-swapping to correctly process +image data with BitsPerSample greater than 8. The library attempts to hide +bit-ordering differences between the image and the native machine by +converting data from the native machine order. +.PP +In C++ the +.I sample +parameter defaults to 0. +.PP +Once data are written to a file for the current directory, the values of +certain tags may not be altered; see +.IR TIFFSetField (3TIFF) +for more information. +.PP +It is not possible to write scanlines to a file that uses a tiled +organization. The routine +.IR TIFFIsTiled +can be used to determine if the file is organized as tiles or strips. +.SH "RETURN VALUES" +.IR TIFFWriteScanline +returns \-1 if it immediately detects an error and 1 for a successful write. +.SH DIAGNOSTICS +All error messages are directed to the +.IR TIFFError (3TIFF) +routine. +.PP +.BR "%s: File not open for writing . +The file was opened for reading, not writing. +.PP +.BR "Can not write scanlines to a tiled image" . +An attempt was made to write a scanline to a tiled image. The image is assumed +to be organized in tiles because the +.I TileWidth +and +.I TileLength +tags have been set with +.IR TIFFSetField (3TIFF). +.PP +.BR "Compression algorithm does not support random access" . +Data was written in a non-sequential order to a file that uses a compression +algorithm and that has +.I RowsPerStrip +greater than one. That is, data in the image is to be stored in a compressed +form, and with multiple rows packed into a strip. In this case, the library +does not support random access to the data. The data should either be written +as entire strips, sequentially by rows, or the value of +.I RowsPerStrip +should be set to one. +.PP +\fB%s: Must set "ImageWidth" before writing data\fP. +The image's width has not be set before the first write. +See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fB%s: Must set "PlanarConfiguration" before writing data\fP. +The organization of data has not be defined before the first write. +See +.BR TIFFSetField (3TIFF) +for information on how to do this. +.PP +\fBCan not change "ImageLength" when using separate planes\fP. Separate image +planes are being used (\c +.IR PlanarConfiguration =2), +but the number of rows has not been specified before the first write. The +library supports the dynamic growth of an image only when data are organized +in a contiguous manner (\c +.IR PlanarConfiguration =1). +.PP +.BR "%d: Sample out of range, max %d" . +The +.I sample +parameter was greater than the value of the SamplesPerPixel tag. +.PP +.BR "%s: No space for strip arrays . +There was not enough space for the arrays that hold strip offsets and byte +counts. +.SH BUGS +Writing subsampled YCbCR data does not work correctly because, for +.IR PlanarConfiguration =2 +the size of a scanline is not calculated on a per-sample basis, and for +.IR PlanarConfiguration =1 +the library does not pack the block-interleaved samples. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFWriteEncodedStrip (3TIFF), +.BR TIFFWriteRawStrip (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteTile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteTile.3tiff new file mode 100644 index 0000000..08250f7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFWriteTile.3tiff @@ -0,0 +1,77 @@ +.\" $Id: TIFFWriteTile.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFWriteTile 3TIFF "November 29, 1999" "libtiff" +.SH NAME +TIFFWriteTile \- encode and write a tile of data to an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFWriteTile(TIFF *" tif ", tdata_t " buf ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")" +.SH DESCRIPTION +Write the data for the tile +.I containing +the specified coordinates. The data in +.I buf +are is (potentially) compressed, and written to the indicated file, normally +being appended to the end of the file. The buffer must be contain an entire +tile of data. Applications should call the routine +.IR TIFFTileSize +to find out the size (in bytes) of a tile buffer. The +.I x +and +.I y +parameters are always used by +.IR TIFFWriteTile . +The +.I z +parameter is used if the image is deeper than 1 slice (\c +.IR ImageDepth >1). +The +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.SH "RETURN VALUES" +.IR TIFFWriteTile +returns \-1 if it detects an error; otherwise the number of bytes in the tile +is returned. +.SH DIAGNOSTICS +All error messages are directed to the +.BR TIFFError (3TIFF) +routine. +.SH "SEE ALSO" +.BR TIFFCheckTile (3TIFF), +.BR TIFFComputeTile (3TIFF), +.BR TIFFOpen (3TIFF), +.BR TIFFReadTile (3TIFF), +.BR TIFFWriteScanline (3TIFF), +.BR TIFFWriteEncodedTile (3TIFF), +.BR TIFFWriteRawTile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFbuffer.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFbuffer.3tiff new file mode 100644 index 0000000..a4446cd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFbuffer.3tiff @@ -0,0 +1,77 @@ +.\" $Id: TIFFbuffer.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1995 Sam Leffler +.\" Copyright (c) 1995 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFBUFFER 3TIFF "November 1, 2005" "libtiff" +.SH NAME +TIFFReadBufferSetup, TIFFWriteBufferSetup \- I/O buffering control routines +.SH SYNOPSIS +.nf +.B "#include " +.sp +.BI "int TIFFReadBufferSetup(TIFF *" tif ", tdata_t " buffer ", tsize_t " size ");" +.BI "int TIFFWriteBufferSetup(TIFF *" tif ", tdata_t " buffer ", tsize_t " size ");" +.fi +.SH DESCRIPTION +The following routines are provided for client-control of the I/O buffers used +by the library. Applications need never use these routines; they are provided +only for ``intelligent clients'' that wish to optimize memory usage and/or +eliminate potential copy operations that can occur when working with images +that have data stored without compression. +.PP +.I TIFFReadBufferSetup +sets up the data buffer used to read raw (encoded) data from a file. If the +specified pointer is +.SM NULL +(zero), then a buffer of the appropriate size is allocated. Otherwise the +caller must guarantee that the buffer is large enough to hold any individual +strip of raw data. +.I TIFFReadBufferSetup +returns a non-zero value if the setup was successful and zero otherwise. +.PP +.I TIFFWriteBufferSetup +sets up the data buffer used to write raw (encoded) data to a file. If the +specified +.I size +is \-1 then the buffer size is selected to hold a complete tile or strip, or +at least 8 kilobytes, whichever is greater. If the specified +.I buffer +is +.SM NULL +(zero), then a buffer of the appropriate size is dynamically allocated. +.I TIFFWriteBufferSetup +returns a non-zero value if the setup was successful and zero otherwise. +.SH DIAGNOSTICS +.BR "%s: No space for data buffer at scanline %ld" . +.I TIFFReadBufferSetup +was unable to dynamically allocate space for a data buffer. +.PP +.BR "%s: No space for output buffer" . +.I TIFFWriteBufferSetup +was unable to dynamically allocate space for a data buffer. +.SH "SEE ALSO" +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcodec.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcodec.3tiff new file mode 100644 index 0000000..78a0f02 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcodec.3tiff @@ -0,0 +1,82 @@ +.\" $Id: TIFFcodec.3tiff,v 1.3 2011-08-02 14:09:43 bfriesen Exp $ +.\" +.\" Copyright (c) 1995 Sam Leffler +.\" Copyright (c) 1995 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH CODEC 3TIFF "October 29, 2004" "libtiff" +.SH NAME +TIFFFindCODEC, TIFFRegisterCODEC, TIFFUnRegisterCODEC, TIFFIsCODECConfigured +\- codec-related utility routines +.SH SYNOPSIS +.B "#include " +.sp +.BI "const TIFFCodec* TIFFFindCODEC(uint16 " scheme ");" +.br +.BI "TIFFCodec* TIFFRegisterCODEC(uint16 " scheme ", const char *" method ", TIFFInitMethod " init ");" +.br +.BI "void TIFFUnRegisterCODEC(TIFFCodec *" codec ");" +.br +.BI "int TIFFIsCODECConfigured(uint16 " scheme ");" +.SH DESCRIPTION +.I libtiff +supports a variety of compression schemes implemented by software +.IR codecs . +Each codec adheres to a modular interface that provides for +the decoding and encoding of image data; as well as some other +methods for initialization, setup, cleanup, and the control +of default strip and tile sizes. +Codecs are identified by the associated value of the +.SM TIFF +.I Compression +tag; e.g. 5 for +.SM LZW +compression. +.PP +The +.I TIFFRegisterCODEC +routine can be used to +augment or override the set of codecs available to an application. +If the specified +.I scheme +already has a registered codec then it is +.I overridden +and any images with data encoded with this +compression scheme will be decoded using the supplied codec. +.PP +.I TIFFIsCODECConfigured +returns 1 if the codec is configured and working. Otherwise 0 will be returned. +.SH DIAGNOSTICS +.BR "No space to register compression scheme %s" . +.I TIFFRegisterCODEC +was unable to allocate memory for the data structures needed +to register a codec. +.PP +.BR "Cannot remove compression scheme %s; not registered" . +.I TIFFUnRegisterCODEC +did not locate the specified codec in the table of registered +compression schemes. +.SH "SEE ALSO" +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcolor.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcolor.3tiff new file mode 100644 index 0000000..e5d2727 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFcolor.3tiff @@ -0,0 +1,268 @@ +.\" $Id: TIFFcolor.3tiff,v 1.4 2009-11-30 12:22:26 fwarmerdam Exp $ +.\" +.\" Copyright (c) 2003, Andrey Kiselev +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH COLOR 3TIFF "December 21, 2003" "libtiff" +.SH NAME +TIFFYCbCrToRGBInit, TIFFYCbCrtoRGB, TIFFCIELabToRGBInit, TIFFCIELabToXYZ, +TIFFXYZToRGB \- color conversion routines. +.SH SYNOPSIS +.B "#include " +.sp +.BI "int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *" ycbcr ", float *" luma ", float *"refBlackWhite" );" +.br +.BI "void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *" ycbcr ", uint32 " Y ", int32 " Cb ", int32 " Cr ", uint32 *" R ", uint32 *" G ", uint32 *" B " );" +.sp +.BI "int TIFFCIELabToRGBInit(TIFFCIELabToRGB *" cielab ", const TIFFDisplay *" display ", float *" refWhite ");" +.br +.BI "void TIFFCIELabToXYZ(TIFFCIELabToRGB *" cielab ", uint32 " L ", int32 " a ", int32 " b ", float *" X ", float *" Y ", float *" Z ");" +.br +.BI "void TIFFXYZToRGB(TIFFCIELabToRGB *" cielab ", float " X ", float " Y ", float " Z" , uint32 *" R ", uint32 *" G ", uint32 *" B ");" +.SH DESCRIPTION +TIFF supports several color spaces for images stored in that format. There is +usually a problem of application to handle the data properly and convert +between different colorspaces for displaying and printing purposes. To +simplify this task libtiff implements several color conversion routines +itself. In particular, these routines used in +.B TIFFRGBAImage(3TIFF) +interface. +.PP +.B TIFFYCbCrToRGBInit() +used to initialize +.I YCbCr +to +.I RGB +conversion state. Allocating and freeing of the +.I ycbcr +structure belongs to programmer. +.I TIFFYCbCrToRGB +defined in +.B tiffio.h +as +.PP +.RS +.nf +typedef struct { /* YCbCr->RGB support */ + TIFFRGBValue* clamptab; /* range clamping table */ + int* Cr_r_tab; + int* Cb_b_tab; + int32* Cr_g_tab; + int32* Cb_g_tab; + int32* Y_tab; +} TIFFYCbCrToRGB; +.fi +.RE +.PP +.I luma +is a float array of three values representing proportions of the red, green +and blue in luminance, Y (see section 21 of the TIFF 6.0 specification, where +the YCbCr images discussed). +.I TIFFTAG_YCBCRCOEFFICIENTS +holds that values in TIFF file. +.I refBlackWhite +is a float array of 6 values which specifies a pair of headroom and footroom +image data values (codes) for each image component (see section 20 of the +TIFF 6.0 specification where the colorinmetry fields discussed). +.I TIFFTAG_REFERENCEBLACKWHITE +is responsible for storing these values in TIFF file. Following code snippet +should helps to understand the the technique: +.PP +.RS +.nf +float *luma, *refBlackWhite; +uint16 hs, vs; + +/* Initialize structures */ +ycbcr = (TIFFYCbCrToRGB*) + _TIFFmalloc(TIFFroundup(sizeof(TIFFYCbCrToRGB), sizeof(long)) + + 4*256*sizeof(TIFFRGBValue) + + 2*256*sizeof(int) + + 3*256*sizeof(int32)); +if (ycbcr == NULL) { + TIFFError("YCbCr->RGB", + "No space for YCbCr->RGB conversion state"); + exit(0); +} + +TIFFGetFieldDefaulted(tif, TIFFTAG_YCBCRCOEFFICIENTS, &luma); +TIFFGetFieldDefaulted(tif, TIFFTAG_REFERENCEBLACKWHITE, &refBlackWhite); +if (TIFFYCbCrToRGBInit(ycbcr, luma, refBlackWhite) < 0) + exit(0); + +/* Start conversion */ +uint32 r, g, b; +uint32 Y; +int32 Cb, Cr; + +for each pixel in image + TIFFYCbCrtoRGB(img->ycbcr, Y, Cb, Cr, &r, &g, &b); + +/* Free state structure */ +_TIFFfree(ycbcr); +.fi +.RE +.PP + +.PP +.B TIFFCIELabToRGBInit() +initializes the +.I CIE L*a*b* 1976 +to +.I RGB +conversion state. +.B TIFFCIELabToRGB +defined as +.PP +.RS +.nf +#define CIELABTORGB_TABLE_RANGE 1500 + +typedef struct { /* CIE Lab 1976->RGB support */ + int range; /* Size of conversion table */ + float rstep, gstep, bstep; + float X0, Y0, Z0; /* Reference white point */ + TIFFDisplay display; + float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ + float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ + float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ +} TIFFCIELabToRGB; +.fi +.RE +.PP +.I display +is a display device description, declared as +.PP +.RS +.nf +typedef struct { + float d_mat[3][3]; /* XYZ -> luminance matrix */ + float d_YCR; /* Light o/p for reference white */ + float d_YCG; + float d_YCB; + uint32 d_Vrwr; /* Pixel values for ref. white */ + uint32 d_Vrwg; + uint32 d_Vrwb; + float d_Y0R; /* Residual light for black pixel */ + float d_Y0G; + float d_Y0B; + float d_gammaR; /* Gamma values for the three guns */ + float d_gammaG; + float d_gammaB; +} TIFFDisplay; +.fi +.RE +.PP +For example, the one can use sRGB device, which has the following parameters: +.PP +.RS +.nf +TIFFDisplay display_sRGB = { + { /* XYZ -> luminance matrix */ + { 3.2410F, -1.5374F, -0.4986F }, + { -0.9692F, 1.8760F, 0.0416F }, + { 0.0556F, -0.2040F, 1.0570F } + }, + 100.0F, 100.0F, 100.0F, /* Light o/p for reference white */ + 255, 255, 255, /* Pixel values for ref. white */ + 1.0F, 1.0F, 1.0F, /* Residual light o/p for black pixel */ + 2.4F, 2.4F, 2.4F, /* Gamma values for the three guns */ +}; +.fi +.RE +.PP +.I refWhite +is a color temperature of the reference white. The +.I TIFFTAG_WHITEPOINT +contains the chromaticity of the white point of the image from where the +reference white can be calculated using following formulae: +.PP +.RS +refWhite_Y = 100.0 +.br +refWhite_X = whitePoint_x / whitePoint_y * refWhite_Y +.br +refWhite_Z = (1.0 - whitePoint_x - whitePoint_y) / whitePoint_y * refWhite_X +.br +.RE +.PP +The conversion itself performed in two steps: at the first one we will convert +.I CIE L*a*b* 1976 +to +.I CIE XYZ +using +.B TIFFCIELabToXYZ() +routine, and at the second step we will convert +.I CIE XYZ +to +.I RGB +using +.B TIFFXYZToRGB(). +Look at the code sample below: +.PP +.RS +.nf +float *whitePoint; +float refWhite[3]; + +/* Initialize structures */ +img->cielab = (TIFFCIELabToRGB *) + _TIFFmalloc(sizeof(TIFFCIELabToRGB)); +if (!cielab) { + TIFFError("CIE L*a*b*->RGB", + "No space for CIE L*a*b*->RGB conversion state."); + exit(0); +} + +TIFFGetFieldDefaulted(tif, TIFFTAG_WHITEPOINT, &whitePoint); +refWhite[1] = 100.0F; +refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1]; +refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1]) + / whitePoint[1] * refWhite[1]; +if (TIFFCIELabToRGBInit(cielab, &display_sRGB, refWhite) < 0) { + TIFFError("CIE L*a*b*->RGB", + "Failed to initialize CIE L*a*b*->RGB conversion state."); + _TIFFfree(cielab); + exit(0); +} + +/* Now we can start to convert */ +uint32 r, g, b; +uint32 L; +int32 a, b; +float X, Y, Z; + +for each pixel in image + TIFFCIELabToXYZ(cielab, L, a, b, &X, &Y, &Z); + TIFFXYZToRGB(cielab, X, Y, Z, &r, &g, &b); + +/* Don't forget to free the state structure */ +_TIFFfree(cielab); +.fi +.RE +.PP +.SH "SEE ALSO" +.BR TIFFRGBAImage (3TIFF) +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFmemory.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFmemory.3tiff new file mode 100644 index 0000000..55f446b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFmemory.3tiff @@ -0,0 +1,90 @@ +.\" $Id: TIFFmemory.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1995 Sam Leffler +.\" Copyright (c) 1995 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH MEMORY 3TIFF "October 15, 1995" "libtiff" +.SH NAME +_TIFFmalloc, \c +_TIFFrealloc, \c +_TIFFfree, \c +_TIFFmemset, \c +_TIFFmemcpy, \c +_TIFFmemcmp, \c +\- memory management-related functions for use with +.SM TIFF +files +.SH SYNOPSIS +.B "#include " +.sp +.BI "tdata_t _TIFFmalloc(tsize_t " size ");" +.br +.BI "tdata_t _TIFFrealloc(tdata_t " buffer ", tsize_t " size ");" +.br +.BI "void _TIFFfree(tdata_t " buffer ");" +.br +.BI "void _TIFFmemset(tdata_t " s ", int " c ", tsize_t " n ");" +.br +.BI "void _TIFFmemcpy(tdata_t " dest ", const tdata_t " src ", tsize_t " n ");" +.br +.BI "int _TIFFmemcmp(const tdata_t " s1 ", const tdata_t "s2 ", tsize_t " n ");" +.SH DESCRIPTION +These routines are provided for writing portable software that uses +.IR libtiff ; +they hide any memory-management related issues, such as dealing with segmented +architectures found on 16-bit machines. +.PP +.I _TIFFmalloc +and +.I _TIFFrealloc +are used to dynamically allocate and reallocate memory used by +.IR libtiff ; +such as memory passed into the I/O routines. Memory allocated through these +interfaces is released back to the system using the +.I _TIFFfree +routine. +.PP +Memory allocated through one of the above interfaces can be set to a known +value using +.IR _TIFFmemset , +copied to another memory location using +.IR _TIFFmemcpy , +or compared for equality using +.IR _TIFFmemcmp . +These routines conform to the equivalent +.SM ANSI +C routines: +.IR memset , +.IR memcpy , +and +.IR memcmp , +repsectively. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.BR malloc (3), +.BR memory (3), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFquery.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFquery.3tiff new file mode 100644 index 0000000..8bddc88 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFquery.3tiff @@ -0,0 +1,142 @@ +.\" $Id: TIFFquery.3tiff,v 1.1 2004-11-11 14:39:16 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH QUERY 3TIFF "October 29, 2004" "libtiff" +.SH NAME +TIFFCurrentRow, +TIFFCurrentStrip, +TIFFCurrentTile, +TIFFCurrentDirectory, +TIFFLastDirectory, +TIFFFileno, +TIFFFileName, +TIFFGetMode, +TIFFIsTiled, +TIFFIsByteSwapped, +TIFFIsUpSampled, +TIFFIsMSB2LSB, +TIFFGetVersion +\- query routines +.SH SYNOPSIS +.B "#include " +.sp +.BI "uint32 TIFFCurrentRow(TIFF* " tif ")" +.br +.BI "tstrip_t TIFFCurrentStrip(TIFF* " tif ")" +.br +.BI "ttile_t TIFFCurrentTile(TIFF* " tif ")" +.br +.BI "tdir_t TIFFCurrentDirectory(TIFF* " tif ")" +.br +.BI "int TIFFLastDirectory(TIFF* " tif ")" +.br +.BI "int TIFFFileno(TIFF* " tif ")" +.br +.BI "char* TIFFFileName(TIFF* " tif ")" +.br +.BI "int TIFFGetMode(TIFF* " tif ")" +.br +.BI "int TIFFIsTiled(TIFF* " tif ")" +.br +.BI "int TIFFIsByteSwapped(TIFF* " tif ")" +.br +.BI "int TIFFIsUpSampled(TIFF* " tif ")" +.br +.BI "int TIFFIsMSB2LSB(TIFF* " tif ")" +.br +.BI "const char* TIFFGetVersion(void)" +.SH DESCRIPTION +The following routines return status information about an open +.SM TIFF +file. +.PP +.IR TIFFCurrentDirectory +returns the index of the current directory (directories are numbered starting +at 0). This number is suitable for use with the +.IR TIFFSetDirectory +routine. +.PP +.IR TIFFLastDirectory +returns a non-zero value if the current directory is the last directory in the +file; otherwise zero is returned. +.PP +.IR TIFFCurrentRow , +.IR TIFFCurrentStrip , +and +.IR TIFFCurrentTile , +return the current row, strip, and tile, respectively, that is being read or +written. These values are updated each time a read or write is done. +.PP +.IR TIFFFileno +returns the underlying file descriptor used to access the +.SM TIFF +image in the filesystem. +.PP +.IR TIFFFileName +returns the pathname argument passed to +.IR TIFFOpen +or +.IR TIFFFdOpen . +.PP +.IR TIFFGetMode +returns the mode with which the underlying file was opened. On +.SM UNIX +systems, this is the value passed to the +.IR open (2) +system call. +.PP +.IR TIFFIsTiled +returns a non-zero value if the image data has a tiled organization. Zero is +returned if the image data is organized in strips. +.PP +.IR TIFFIsByteSwapped +returns a non-zero value if the image data was in a different byte-order than +the host machine. Zero is returned if the TIFF file and local host byte-orders +are the same. Note that TIFFReadTile(), TIFFReadStrip() and +TIFFReadScanline() functions already normally perform byte swapping to local +host order if needed. +.PP +.I TIFFIsUpSampled +returns a non-zero value if image data returned through the read interface +routines is being up-sampled. This can be useful to applications that want to +calculate I/O buffer sizes to reflect this usage (though the usual strip and +tile size routines already do this). +.PP +.I TIFFIsMSB2LSB +returns a non-zero value if the image data is being returned with bit 0 as the +most significant bit. +.PP +.IR TIFFGetVersion +returns an +.SM ASCII +string that has a version stamp for the +.SM TIFF +library software. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.IR libtiff (3TIFF), +.IR TIFFOpen (3TIFF), +.IR TIFFFdOpen (3TIFF) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFsize.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFsize.3tiff new file mode 100644 index 0000000..6de9084 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFsize.3tiff @@ -0,0 +1,59 @@ +.\" $Id: TIFFsize.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSIZE 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFScanlineSize, TIFFRasterScanlineSize, +\- return the size of various items associated with an open +.SM TIFF +file +.SH SYNOPSIS +.B "#include " +.sp +.BI "tsize_t TIFFRasterScanlineSize(TIFF *" tif ")" +.br +.BI "tsize_t TIFFScanlineSize(TIFF *" tif ")" +.SH DESCRIPTION +.I TIFFScanlineSize +returns the size in bytes of a row of data as it would be returned in a call +to +.IR TIFFReadScanline , +or as it would be expected in a call to +.IR TIFFWriteScanline . +.PP +.I TIFFRasterScanlineSize +returns the size in bytes of a complete decoded and packed raster scanline. +Note that this value may be different from the value returned by +.I TIFFScanlineSize +if data is stored as separate planes. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.BR TIFFOpen (3TIFF), +.BR TIFFReadScanline (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFstrip.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFstrip.3tiff new file mode 100644 index 0000000..bb9658e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFstrip.3tiff @@ -0,0 +1,99 @@ +.\" $Id: TIFFstrip.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1992-1997 Sam Leffler +.\" Copyright (c) 1992-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSTRIP 3TIFF "October 15, 1995" "libtiff" +.SH NAME +TIFFDefaultStripSize, TIFFStripSize, TIFFVStripSize, TIFFRawStripSize, +TIFFComputeStrip, TIFFNumberOfStrips \- strip-related utility routines +.SH SYNOPSIS +.B "#include " +.sp +.BI "uint32 TIFFDefaultStripSize(TIFF *" tif ", uint32 " estimate ")" +.br +.BI "tsize_t TIFFStripSize(TIFF *" tif ")" +.br +.BI "tsize_t TIFFVStripSize(TIFF *" tif ", uint32 " nrows ")" +.br +.BI "tsize_t TIFFRawStripSize(TIFF *" tif ", tstrip_t " strip ")" +.br +.BI "tstrip_t TIFFComputeStrip(TIFF *" tif ", uint32 " row ", tsample_t " sample ")" +.br +.BI "tstrip_t TIFFNumberOfStrips(TIFF *" tif ")" +.SH DESCRIPTION +.I TIFFDefaultStripSize +returns the number of rows for a reasonable-sized strip according to the +current settings of the +.IR ImageWidth , +.IR BitsPerSample , +.IR SamplesPerPixel , +tags and any compression-specific requirements. If the +.I estimate +parameter, if non-zero, then it is taken as an estimate of the desired strip +size and adjusted according to any compression-specific requirements. The +value returned by this function is typically used to define the +.I RowsPerStrip +tag. In lieu of any unusual requirements +.I TIFFDefaultStripSize +tries to create strips that have approximately +8 kilobytes of uncompressed data. +.PP +.IR TIFFStripSize +returns the equivalent size for a strip of data as it would be returned in a +call to +.IR TIFFReadEncodedStrip +or as it would be expected in a call to +.IR TIFFWriteEncodedStrip . +.PP +.I TIFFVStripSize +returns the number of bytes in a strip with +.I nrows +rows of data. +.PP +.I TIFFRawStripSize +returns the number of bytes in a raw strip (i.e. not decoded). +.PP +.IR TIFFComputeStrip +returns the strip that contains the specified coordinates. A valid strip is +always returned; out-of-range coordinate values are clamped to the bounds of +the image. The +.I row +parameter is always used in calculating a strip. The +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.PP +.IR TIFFNumberOfStrips +returns the number of strips in the image. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.BR TIFFReadEncodedStrip (3TIFF), +.BR TIFFReadRawStrip (3TIFF), +.BR TIFFWriteEncodedStrip (3TIFF), +.BR TIFFWriteRawStrip (3TIFF), +.BR libtiff (3TIFF), +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFswab.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFswab.3tiff new file mode 100644 index 0000000..d6432fa --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFswab.3tiff @@ -0,0 +1,80 @@ +.\" $Id: TIFFswab.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH SWAB 3TIFF "November 04, 2004" "libtiff" +.SH NAME +TIFFGetBitRevTable, TIFFReverseBits, TIFFSwabShort, TIFFSwabLong, +TIFFSwabArrayOfShort, TIFFSwabArrayOfLong \- byte- and bit-swapping routines +.SH SYNOPSIS +.B "#include " +.sp +.BI "const unsigned char* TIFFGetBitRevTable(int " reversed ")" +.br +.BI "void TIFFReverseBits(u_char *" data ", unsigned long " nbytes ")" +.br +.BI "void TIFFSwabShort(uint16 *" data ")" +.br +.BI "void TIFFSwabLong(uint32 *" data ")" +.br +.BI "void TIFFSwabArrayOfShort(uint16 *" data ", unsigned long " nshorts ")" +.br +.BI "void TIFFSwabArrayOfLong(uint32 *" data ", unsigned long " nlongs ")" +.SH DESCRIPTION +The following routines are used by the library to swap +16- and 32-bit data and to reverse the order of bits in bytes. +.PP +.IR TIFFSwabShort +and +.IR TIFFSwabLong +swap the bytes in a single 16-bit and 32-bit item, respectively. +.IR TIFFSwabArrayOfShort +and +.IR TIFFSwabArrayOfLong +swap the bytes in an array of 16-bit and 32-bit items, respectively. +.PP +.IR TIFFReverseBits +replaces each byte in +.I data +with the equivalent bit-reversed value. This operation is performed with a +lookup table, which is returned using the +.IR TIFFGetBitRevTable +function. +.I reversed +parameter specifies which table should be returned. Supply +.I 1 +if you want bit reversal table. Supply +.I 0 +to get the table that do not reverse bit values. It is a lookup table that can +be used as an +.IR "identity function" ; +i.e. +.IR "TIFFNoBitRevTable[n] == n" . +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFtile.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFtile.3tiff new file mode 100644 index 0000000..5431f31 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/TIFFtile.3tiff @@ -0,0 +1,131 @@ +.\" $Id: TIFFtile.3tiff,v 1.2 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFTILE 3TIFF "February 14, 1992" "libtiff" +.SH NAME +TIFFTileSize, TIFFTileRowSize, TIFFVTileSize, TIFFDefaultTileSize, +TIFFComputeTile, TIFFCheckTile, TIFFNumberOfTiles \- tile-related utility +routines +.SH SYNOPSIS +.B "#include " +.sp +.BI "void TIFFDefaultTileSize(TIFF *" tif ", uint32 *" tw ", uint32 *" th ")" +.br +.BI "tsize_t TIFFTileSize(TIFF *" tif ")" +.br +.BI "tsize_t TIFFTileRowSize(TIFF *" tif ")" +.br +.BI "tsize_t TIFFVTileSize(TIFF *" tif ", uint32 " nrows ")" +.br +.BI "ttile_t TIFFComputeTile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")" +.br +.BI "int TIFFCheckTile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")" +.br +.BI "ttile_t TIFFNumberOfTiles(TIFF *" tif ")" +.br +.SH DESCRIPTION +.I TIFFDefaultTileSize +returns the pixel width and height of a reasonable-sized tile; suitable for +setting up the +.I TileWidth +and +.I TileLength +tags. +If the +.I tw +and +.I th +values passed in are non-zero, then they are adjusted to reflect any +compression-specific requirements. The returned width and height are +constrained to be a multiple of 16 pixels to conform with the +.SM TIFF +specification. +.PP +.I TIFFTileSize +returns the equivalent size for a tile of data as it would be returned in a +call to +.I TIFFReadTile +or as it would be expected in a call to +.IR TIFFWriteTile . +.PP +.I TIFFVTileSize +returns the number of bytes in a row-aligned tile with +.I nrows +of data. +.PP +.I TIFFTileRowSize +returns the number of bytes of a row of data in a tile. +.PP +.IR TIFFComputeTile +returns the tile that contains the specified coordinates. A valid tile is +always returned; out-of-range coordinate values are clamped to the bounds of +the image. The +.I x +and +.I y +parameters are always used in calculating a tile. The +.I z +parameter is used if the image is deeper than 1 slice (\c +.IR ImageDepth >1). +The +.I sample +parameter is used only if data are organized in separate planes (\c +.IR PlanarConfiguration =2). +.PP +.IR TIFFCheckTile +returns a non-zero value if the supplied coordinates are within the bounds of +the image and zero otherwise. The +.I x +parameter is checked against the value of the +.I ImageWidth +tag. The +.I y +parameter is checked against the value of the +.I ImageLength +tag. The +.I z +parameter is checked against the value of the +.I ImageDepth +tag (if defined). The +.I sample +parameter is checked against the value of the +.I SamplesPerPixel +parameter if the data are organized in separate planes. +.PP +.IR TIFFNumberOfTiles +returns the number of tiles in the image. +.SH DIAGNOSTICS +None. +.SH "SEE ALSO" +.BR TIFFReadEncodedTile (3TIFF), +.BR TIFFReadRawTile (3TIFF), +.BR TIFFReadTile (3TIFF), +.BR TIFFWriteEncodedTile (3TIFF), +.BR TIFFWriteRawTile (3TIFF), +.BR TIFFWriteTile (3TIFF), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/bmp2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/bmp2tiff.1 new file mode 100644 index 0000000..f5d68ce --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/bmp2tiff.1 @@ -0,0 +1,85 @@ +.\" $Id: bmp2tiff.1,v 1.7 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 2004, Andrey Kiselev +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH BMP2TIFF 1 "15 October, 2004" "libtiff" +.SH NAME +bmp2tiff \- create a +.SM TIFF +file from a Microsoft Windows Device Independent Bitmap image file +.SH SYNOPSIS +.B bmp2tiff +[ +.I options +] +.I input.bmp +[ +.I input2.bmp ...\& +] +.I output.tiff +.SH DESCRIPTION +.I bmp2tiff +converts a Microsoft Windows Device Independent Bitmap image file to +.SM TIFF. +If several input BMP files are being specified the multipage +.SM TIFF +output file will be created. By default, the +.SM TIFF +image is created with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the PackBits algorithm (\c +.IR Compression =32773), +and with each strip no more than 8 kilobytes. +These characteristics can overridden, or explicitly specified +with the options described below. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm (the default), +.B "\-c jpeg" +for the baseline JPEG compression algorithm, +.B "\-c zip" +for the Deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch. +.TP +.BI \-r " number" +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.SH "SEE ALSO" +.BR gif2tiff (1), +.BR pal2rgb (1), +.BR ppm2tiff (1), +.BR raw2tiff (1), +.BR ras2tiff (1), +.BR sgi2tiff (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/fax2ps.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/fax2ps.1 new file mode 100644 index 0000000..9525f20 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/fax2ps.1 @@ -0,0 +1,159 @@ +.\" $Id: fax2ps.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.ds Ps PostScript +.if n .po 0 +.TH FAX2PS 1 "November 2, 2005" "libtiff" +.SH NAME +fax2ps \- convert a +.SM TIFF +facsimile to compressed \*(Ps\(tm +.SH SYNOPSIS +.B fax2ps +[ +.I options +] [ +.I file ...\& +] +.SH DESCRIPTION +.I fax2ps +reads one or more +.SM TIFF +facsimile image files and prints a compressed form of +\*(Ps on the standard output that is suitable for printing. +.PP +By default, each page is scaled to reflect the +image dimensions and resolutions stored in the file. +The +.B \-x +and +.B \-y +options can be used to specify the horizontal and vertical +image resolutions (lines/inch), respectively. +If the +.B \-S +option is specified, each page is scaled to fill an output page. +The default output page is 8.5 by 11 inches. +Alternate page dimensions can be specified in inches with the +.B \-W +and +.B \-H +options. +.PP +By default +.I fax2ps +generates \*(Ps for all pages in the file. +The +.B \-p +option can be used to select one or more pages from +a multi-page document. +.PP +.I fax2ps +generates a compressed form of \*(Ps that is +optimized for sending pages of text to a \*(Ps +printer attached to a host through a low-speed link (such +as a serial line). +Each output page is filled with white and then only +the black areas are drawn. +The \*(Ps specification of the black drawing operations +is optimized by using a special font that encodes the +move-draw operations required to fill +the black regions on the page. +This compression scheme typically results in a substantially +reduced \*(Ps description, relative to the straightforward +imaging of the page with a \*(Ps +.I image +operator. +This algorithm can, however, be ineffective +for continuous-tone and white-on-black images. +For these images, it sometimes is more efficient to send +the raster bitmap image directly; see +.BR tiff2ps (1). +.SH OPTIONS +.TP 10 +.BI \-p " number" +Print only the indicated page. +Multiple pages may be printed by specifying +this option more than once. +.TP 10 +.BI \-x " resolution" +Use +.I resolution +as the horizontal resolution, in dots/inch, of the image data. +By default this value is taken from the file. +.TP 10 +.BI \-y " resolution" +Use +.I resolution +as the vertical resolution, in lines/inch, of the image data. +By default this value is taken from the file. +.TP 10 +.B \-S +Scale each page of image data to fill the output page dimensions. +By default images are presented according to the dimension +information recorded in the +.SM TIFF +file. +.TP 10 +.BI \-W " width" +Use +.I width +as the width, in inches, of the output page. +.TP 10 +.BI \-H " height" +Use +.I height +as the height, in inches, of the output page. +.SH DIAGNOSTICS +Some messages about malformed +.SM TIFF +images come from the +.SM TIFF +library. +.PP +Various messages about badly formatted facsimile images +may be generated due to transmission errors in received +facsimile. +.I fax2ps +attempts to recover from such data errors by resynchronizing +decoding at the end of the current scanline. +This can result in long horizontal black lines in the resultant +\*(Ps image. +.SH NOTES +If the destination printer supports \*(Ps Level II then +it is always faster to just send the encoded bitmap generated +by the +.BR tiff2ps (1) +program. +.SH BUGS +.I fax2ps +should probably figure out when it is doing a poor +job of compressing the output and just generate +\*(Ps to image the bitmap raster instead. +.SH "SEE ALSO" +.BR tiff2ps (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/fax2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/fax2tiff.1 new file mode 100644 index 0000000..873cab1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/fax2tiff.1 @@ -0,0 +1,286 @@ +.\" $Id: fax2tiff.1,v 1.7 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH FAX2TIFF 1 "November 2, 2005" "libtiff" +.SH NAME +fax2tiff \- create a +.SM TIFF +Class F fax file from raw fax data +.SH SYNOPSIS +.B fax2tiff +[ +.I options +] [ +.B \-o +.I output.tif +] +.I input.raw +.SH DESCRIPTION +.I Fax2tiff +creates a +.SM TIFF +file containing +.SM CCITT +Group 3 or Group 4 encoded data from one or more files containing ``raw'' +Group 3 or Group 4 encoded data (typically obtained directly from a fax modem). +By default, each row of data in the resultant +.SM TIFF +file is 1-dimensionally encoded and +padded or truncated to 1728 pixels, as needed. +The resultant image is a set of low resolution (98 lines/inch) +or medium resolution (196 lines/inch) +pages, each of which is a single strip of data. +The generated file conforms to the +.SM TIFF +Class F (\c +.SM FAX\c +) specification for storing facsimile data. +This means, in particular, that each page of the data does +.B not +include the trailing +.I "return to control" +(\c +.SM RTC\c +) code; as required +for transmission by the +.SM CCITT +Group 3 specifications. +The old, ``classic'', format is created if the +.B \-c +option is used. +(The Class F format can also be requested with the +.B \-f +option.) +.PP +The default name of the output image is +.IR fax.tif ; +this can be changed with the +.B \-o +option. +Each input file is assumed to be a separate page of facsimile data +from the same document. +The order in which input files are specified on the command +line is the order in which the resultant pages appear in the +output file. +.SH OPTIONS +Options that affect the interpretation of input data are: +.TP +.B \-3 +Assume input data is +.SM CCITT +Group 3 encoded (default). +.TP +.B \-4 +Assume input data is +.SM CCITT +Group 4 encoded. +.TP +.B \-U +Assume input data is uncompressed (Group 3 or Group 4). +.TP +.B \-1 +Assume input data is encoded with the 1-dimensional version of the +.SM CCITT +Group 3 Huffman encoding algorithm (default). +.TP +.B \-2 +Assume input data is 2-dimensional version of the +.SM CCITT +Group 3 Huffman encoding algorithm. +.TP +.B \-P +Assume input data is +.B not +EOL-aligned (default). This option has effect with Group 3 encoded input only. +.TP +.B \-A +Assume input data is EOL-aligned. This option has effect with Group 3 +encoded input only. +.TP +.B \-M +Treat input data as having bits filled from most significant bit (\c +.SM MSB\c +) to most least bit (\c +.SM LSB\c +). +.TP +.B \-L +Treat input data as having bits filled from least significant bit (\c +.SM LSB\c +) to most significant bit (\c +.SM MSB\c +) (default). +.TP +.B \-B +Assume input data was encoded with black as 0 and white as 1. +.TP +.B \-W +Assume input data was encoded with black as 1 and white as 0 (default). +.TP +.B \-R +Specify the vertical resolution, in lines/inch, of the input images. +By default input are assumed to have a vertical resolution of 196 lines/inch. +If images are low resolution facsimile, a value of 98 lines/inch should +be specified. +.TP +.B \-X +Specify the width, in pixels, of the input images. +By default input are assumed to have a width of 1728 pixels. +.PP +Options that affect the output file format are: +.TP +.B \-o +Specify the name of the output file. +.TP +.B \-7 +Force output to be compressed with the +.SM CCITT +Group 3 Huffman encoding algorithm (default). +.TP +.B \-8 +Force output to be compressed with the +.SM CCITT +Group 4 Huffman encoding. +.TP +.B \-u +Force output to be uncompressed (Group 3 or Group 4). +.TP +.B \-5 +Force output to be encoded with the 1-dimensional version of the +.SM CCITT +Group 3 Huffman encoding algorithm. +.TP +.B \-6 +Force output to be encoded with the 2-dimensional version of the +.SM CCITT +Group 3 Huffman encoding algorithm (default). +.TP +.B \-a +Force the last bit of each +.I "End Of Line" +(\c +.SM EOL\c +) code to land on a byte boundary (default). This ``zero padding'' will +be reflected in the contents of the +.I Group3Options +tag of the resultant +.SM TIFF +file. This option has effect with Group 3 encoded output only. +.TP +.B \-p +Do not EOL-align output. This option has effect with Group 3 encoded +output only. +.TP +.B \-c +Generate "classic" Group 3 TIFF format. +.TP +.B \-f +Generate TIFF Class F (TIFF/F) format (default). +.TP +.B \-m +Force output data to have bits filled from most significant bit (\c +.SM MSB\c +) to most least bit (\c +.SM LSB\c +). +.TP +.B \-l +Force output data to have bits filled from least significant bit (\c +.SM LSB\c +) to most significant bit (\c +.SM MSB\c +) (default). +.TP +.B \-r +Specify the number of rows (scanlines) in each strip of data +written to the output file. +By default (or when value +.B 0 +is specified), +.I tiffcp +attempts to set the rows/strip +that no more than 8 kilobytes of data appear in a strip (with except of G3/G4 +compression schemes). If you specify special value +.B \-1 +it will results in infinite number of the rows per strip. The entire image +will be the one strip in that case. This is default in case of G3/G4 output +compression schemes. +.TP +.B \-s +Stretch the input image vertically by writing each input row of +data twice to the output file. +.TP +.B \-v +Force +.I fax2tiff +to print the number of rows of data it retrieved from the input file. +.TP +.B \-z +Force output to be compressed with the LZW encoding. +.SH DIAGNOSTICS +The following warnings and errors come from the decoding +routines in the library. +.PP +.BR "Warning, %s: Premature EOL at scanline %d (x %d).\en" . +The input data had a row that was shorter than the expected width. +The row is padded with white. +.PP +.BR "%s: Premature EOF at scanline %d (x %d).\en" . +The decoder ran out of data in the middle of a scanline. +The resultant row is padded with white. +.PP +.BR "%s: Bad code word at row %d, x %d\en" . +An invalid Group 3 +.I code +was encountered while decoding the input file. +The row number and horizontal position is given. +The remainder of the input row is discarded, while +the corresponding output row is padded with white. +.PP +.BR "%s: Bad 2D code word at scanline %d.\en" . +An invalid Group 4 or 2D Group 3 +.I code +was encountered while decoding the input file. +The row number and horizontal position is given. +The remainder of the input row is discarded, while +the corresponding output row is padded with white. +.SH BUGS +Input data are assumed to have a a ``top left'' orientation; +it should be possible to override this assumption +from the command line. +.SH "SEE ALSO" +.BR "\s-1CCITT\s+1 Recommendation T.4" +(Standardization of Group 3 Facsimile Apparatus for Document Transmission). +.PP +.BR "The Spirit of TIFF Class F", +an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies. +.PP +.BR tiffinfo (1), +.BR tiffdither (1), +.BR tiffgt (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/gif2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/gif2tiff.1 new file mode 100644 index 0000000..5f01d8d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/gif2tiff.1 @@ -0,0 +1,81 @@ +.\" $Id: gif2tiff.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH GIF2TIFF 1 "November 2, 2005" "libtiff" +.SH NAME +gif2tiff \- create a +.SM TIFF +file from a GIF87 format image file +.SH SYNOPSIS +.B gif2tiff +[ +.I options +] +.I input.gif +.I output.tif +.SH DESCRIPTION +.I Gif2tiff +converts a file in the GIF87 format to +.SM TIFF. +The +.SM TIFF +image is created as a palette image, with samples +compressed with the Lempel-Ziv & Welch algorithm (\c +.IR Compression =5). +These characteristics can overridden, or explicitly specified +with the options described below. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm, +.B "\-c zip" +for the Deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch (the default). +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.SH NOTES +The program is based on Paul Haeberli's +.I fromgif +program which, in turn, is based on Marcel J.E. Mol's GIF reader. +.SH BUGS +Should have more options to control output format. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/libtiff.3tiff b/thirdparty/LibTIFF/tiff-4.0.3/man/libtiff.3tiff new file mode 100644 index 0000000..59895d6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/libtiff.3tiff @@ -0,0 +1,545 @@ +.\" $Id: libtiff.3tiff,v 1.4 2012-07-29 15:45:30 tgl Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH INTRO 3TIFF "November 2, 2005" "libtiff" +.SH NAME +libtiff \- introduction to +.IR libtiff , +a library for reading and writing +.SM TIFF +files +.SH SYNOPSIS +.B "#include " +.sp +cc file.c +.B -ltiff +.SH DESCRIPTION +.I libtiff +is a library for reading and writing data files encoded with the +.I "Tag Image File" +format, Revision 6.0 (or revision 5.0 or revision 4.0). This file format is +suitable for archiving multi-color and monochromatic image data. +.PP +The library supports several compression algorithms, as indicated by the +.I Compression +field, including: +no compression (1), +.SM CCITT +1D Huffman compression (2), +.SM CCITT +Group 3 Facsimile compression (3), +.SM CCITT +Group 4 Facsimile compression (4), +Lempel-Ziv & Welch compression (5), +baseline JPEG compression (7), +word-aligned 1D Huffman compression (32771), +and +PackBits compression (32773). +In addition, several nonstandard compression algorithms are supported: the +4-bit compression algorithm used by the +.I ThunderScan +program (32809) (decompression only), NeXT's 2-bit compression algorithm +(32766) (decompression only), an experimental LZ-style algorithm known as +Deflate (32946), and an experimental CIE LogLuv compression scheme designed +for images with high dynamic range (32845 for LogL and 32845 for LogLuv). +Directory information may be in either little- or big-endian byte order\-byte +swapping is automatically done by the library. Data bit ordering may be either +Most Significant Bit (\c +.SM MSB\c +) to Least Significant Bit (\c +.SM LSB\c +) or +.SM LSB +to +.SM MSB. +Finally, the library does not support files in which the +.IR BitsPerSample , +.IR Compression , +.IR MinSampleValue , +or +.IR MaxSampleValue +fields are defined differently on a per-sample basis +(in Rev. 6.0 the +.I Compression +tag is not defined on a per-sample basis, so this is immaterial). +.SH "DATA TYPES" +The library makes extensive use of C typedefs to promote portability. +Two sets of typedefs are used, one for communication with clients +of the library and one for internal data structures and parsing of the +.SM TIFF +format. +The following typedefs are exposed to users either through function +definitions or through parameters passed through the varargs interfaces. +.in +.5i +.sp 5p +.ta +\w'typedef unsigned <\fIthing\fP> uint32; 'u +.nf +typedef unsigned short uint16; 16-bit unsigned integer +typedef unsigned <\fIthing\fP> uint32; 32-bit unsigned integer +.sp 5p +typedef unsigned int ttag_t; directory tag +typedef uint16 tdir_t; directory index +typedef uint16 tsample_t; sample number +typedef uint32 tstrip_t; strip number +typedef uint32 ttile_t; tile number +typedef int32 tsize_t; i/o size in bytes +typedef void* tdata_t; image data ref +typedef void* thandle_t; client data handle +typedef int32 toff_t; file offset +.fi +.sp 5p +.in -.5i +Note that +.IR tstrip_t , +.IR ttile_t , +and +.I tsize_t +are constrained to be no more than 32-bit quantities by 32-bit fields they are +stored in in the +.SM TIFF +image. +Likewise +.I tsample_t +is limited by the 16-bit field used to store the +.I SamplesPerPixel +tag. +.I tdir_t +constrains the maximum number of +.SM IFDs +that may appear in an image and may be an arbitrary size (w/o penalty). +.I ttag_t +must be either int, unsigned int, pointer, or double because the library uses +a varargs interface and +.SM "ANSI C" +restricts the type of the parameter before an ellipsis to be a promoted type. +.I toff_t +is defined as int32 because TIFF file offsets are (unsigned) 32-bit +quantities. A signed value is used because some interfaces return \-1 on +error. Finally, note that user-specified data references are passed as opaque +handles and only cast at the lowest layers where their type is presumed. +.SH "LIST OF ROUTINES" +The following routines are part of the library. Consult specific manual pages +for details on their operation; on most systems doing ``man function-name'' +will work. +.sp +.nf +.ta \w'TIFFCheckpointDirectory'u+2n +\fIName\fP \fIDescription\fP +.sp 5p +TIFFCheckpointDirectory writes the current state of the directory +TIFFCheckTile very x,y,z,sample is within image +TIFFCIELabToRGBInit initialize CIE L*a*b* 1976 to RGB conversion state +TIFFCIELabToXYZ perform CIE L*a*b* 1976 to CIE XYZ conversion +TIFFClientOpen open a file for reading or writing +TIFFClose close an open file +TIFFComputeStrip return strip containing y,sample +TIFFComputeTile return tile containing x,y,z,sample +TIFFCurrentDirectory return index of current directory +TIFFCurrentRow return index of current scanline +TIFFCurrentStrip return index of current strip +TIFFCurrentTile return index of current tile +TIFFDataWidth return the size of TIFF data types +TIFFError library error handler +TIFFFdOpen open a file for reading or writing +TIFFFieldDataType get data type from field information +TIFFFieldName get field name from field information +TIFFFieldPassCount get whether to pass a value count to Get/SetField +TIFFFieldReadCount get number of values to be read from field +TIFFFieldTag get tag value from field information +TIFFFieldWithName get field information given field name +TIFFFieldWithTag get field information given tag +TIFFFieldWriteCount get number of values to be written to field +TIFFFileName return name of open file +TIFFFileno return open file descriptor +TIFFFindCODEC find standard codec for the specific scheme +TIFFFindField get field information given tag and data type +TIFFFlush flush all pending writes +TIFFFlushData flush pending data writes +TIFFGetBitRevTable return bit reversal table +TIFFGetField return tag value in current directory +TIFFGetFieldDefaulted return tag value in current directory +TIFFGetMode return open file mode +TIFFGetVersion return library version string +TIFFIsCODECConfigured check, whether we have working codec +TIFFIsMSB2LSB return true if image data is being returned + with bit 0 as the most significant bit +TIFFIsTiled return true if image data is tiled +TIFFIsByteSwapped return true if image data is byte-swapped +TIFFNumberOfStrips return number of strips in an image +TIFFNumberOfTiles return number of tiles in an image +TIFFOpen open a file for reading or writing +TIFFPrintDirectory print description of the current directory +TIFFReadBufferSetup specify i/o buffer for reading +TIFFReadDirectory read the next directory +TIFFReadEncodedStrip read and decode a strip of data +TIFFReadEncodedTile read and decode a tile of data +TIFFReadRawStrip read a raw strip of data +TIFFReadRawTile read a raw tile of data +TIFFReadRGBAImage read an image into a fixed format raster +TIFFReadScanline read and decode a row of data +TIFFReadTile read and decode a tile of data +TIFFRegisterCODEC override standard codec for the specific scheme +TIFFReverseBits reverse bits in an array of bytes +TIFFRGBAImageBegin setup decoder state for TIFFRGBAImageGet +TIFFRGBAImageEnd release TIFFRGBAImage decoder state +TIFFRGBAImageGet read and decode an image +TIFFRGBAImageOK is image readable by TIFFRGBAImageGet +TIFFScanlineSize return size of a scanline +TIFFSetDirectory set the current directory +TIFFSetSubDirectory set the current directory +TIFFSetErrorHandler set error handler function +TIFFSetField set a tag's value in the current directory +TIFFSetWarningHandler set warning handler function +TIFFStripSize returns size of a strip +TIFFRawStripSize returns the number of bytes in a raw strip +TIFFSwabShort swap bytes of short +TIFFSwabLong swap bytes of long +TIFFSwabArrayOfShort swap bytes of an array of shorts +TIFFSwabArrayOfLong swap bytes of an array of longs +TIFFTileRowSize return size of a row in a tile +TIFFTileSize return size of a tile +TIFFUnRegisterCODEC unregisters the codec +TIFFVGetField return tag value in current directory +TIFFVGetFieldDefaulted return tag value in current directory +TIFFVSetField set a tag's value in the current directory +TIFFVStripSize returns the number of bytes in a strip +TIFFWarning library warning handler +TIFFWriteDirectory write the current directory +TIFFWriteEncodedStrip compress and write a strip of data +TIFFWriteEncodedTile compress and write a tile of data +TIFFWriteRawStrip write a raw strip of data +TIFFWriteRawTile write a raw tile of data +TIFFWriteScanline write a scanline of data +TIFFWriteTile compress and write a tile of data +TIFFXYZToRGB perform CIE XYZ to RGB conversion +TIFFYCbCrToRGBInit initialize YCbCr to RGB conversion state +TIFFYCbCrtoRGB perform YCbCr to RGB conversion +.sp +Auxiliary functions: +_TIFFfree free memory buffer +_TIFFmalloc dynamically allocate memory buffer +_TIFFmemcmp compare contents of the memory buffers +_TIFFmemcpy copy contents of the one buffer to another +_TIFFmemset fill memory buffer with a constant byte +_TIFFrealloc dynamically reallocate memory buffer + +.fi +.SH "TAG USAGE" +The table below lists the +.SM TIFF +tags that are recognized and handled by the library. +If no use is indicated in the table, then the library +reads and writes the tag, but does not use it internally. +Note that some tags are meaningful only when a particular +compression scheme is being used; e.g. +.I Group3Options +is only useful if +.I Compression +is set to +.SM CCITT +Group 3 encoding. +Tags of this sort are considered +.I codec-specific +tags and the library does not recognize them except when the +.I Compression +tag has been previously set to the relevant compression scheme. +.sp +.nf +.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Value'u+2n +\w'R/W'u+2n +\fITag Name\fP \fIValue\fP \fIR/W\fP \fILibrary Use/Notes\fP +.sp 5p +.nf +Artist 315 R/W +BadFaxLines 326 R/W +BitsPerSample 258 R/W lots +CellLength 265 parsed but ignored +CellWidth 264 parsed but ignored +CleanFaxData 327 R/W +ColorMap 320 R/W +ColorResponseUnit 300 parsed but ignored +Compression 259 R/W choosing codec +ConsecutiveBadFaxLines 328 R/W +Copyright 33432 R/W +DataType 32996 R obsoleted by SampleFormat tag +DateTime 306 R/W +DocumentName 269 R/W +DotRange 336 R/W +ExtraSamples 338 R/W lots +FaxRecvParams 34908 R/W +FaxSubAddress 34909 R/W +FaxRecvTime 34910 R/W +FillOrder 266 R/W control bit order +FreeByteCounts 289 parsed but ignored +FreeOffsets 288 parsed but ignored +GrayResponseCurve 291 parsed but ignored +GrayResponseUnit 290 parsed but ignored +Group3Options 292 R/W used by Group 3 codec +Group4Options 293 R/W +HostComputer 316 R/W +ImageDepth 32997 R/W tile/strip calculations +ImageDescription 270 R/W +ImageLength 257 R/W lots +ImageWidth 256 R/W lots +InkNames 333 R/W +InkSet 332 R/W +JPEGTables 347 R/W used by JPEG codec +Make 271 R/W +Matteing 32995 R obsoleted by ExtraSamples tag +MaxSampleValue 281 R/W +MinSampleValue 280 R/W +Model 272 R/W +NewSubFileType 254 R/W called SubFileType in spec +NumberOfInks 334 R/W +Orientation 274 R/W +PageName 285 R/W +PageNumber 297 R/W +PhotometricInterpretation 262 R/W used by Group 3 and JPEG codecs +PlanarConfiguration 284 R/W data i/o +Predictor 317 R/W used by LZW and Deflate codecs +PrimaryChromacities 319 R/W +ReferenceBlackWhite 532 R/W +ResolutionUnit 296 R/W used by Group 3 codec +RowsPerStrip 278 R/W data i/o +SampleFormat 339 R/W +SamplesPerPixel 277 R/W lots +SMinSampleValue 340 R/W +SMaxSampleValue 341 R/W +Software 305 R/W +StoNits 37439 R/W +StripByteCounts 279 R/W data i/o +StripOffsets 273 R/W data i/o +SubFileType 255 R/W called OSubFileType in spec +TargetPrinter 337 R/W +Thresholding 263 R/W +TileByteCounts 324 R/W data i/o +TileDepth 32998 R/W tile/strip calculations +TileLength 323 R/W data i/o +TileOffsets 324 R/W data i/o +TileWidth 322 R/W data i/o +TransferFunction 301 R/W +WhitePoint 318 R/W +XPosition 286 R/W +XResolution 282 R/W +YCbCrCoefficients 529 R/W used by TIFFRGBAImage support +YCbCrPositioning 531 R/W tile/strip size calulcations +YCbCrSubsampling 530 R/W +YPosition 286 R/W +YResolution 283 R/W used by Group 3 codec +.SH "PSEUDO TAGS" +In addition to the normal +.SM TIFF +tags the library supports a collection of +tags whose values lie in a range outside the valid range of +.SM TIFF +tags. +These tags are termed +.I pseud-tags +and are used to control various codec-specific functions within the library. +The table below summarizes the defined pseudo-tags. +.sp +.nf +.ta \w'TIFFTAG_JPEGTABLESMODE'u+2n +\w'Codec'u+2n +\w'R/W'u+2n +\fITag Name\fP \fICodec\fP \fIR/W\fP \fILibrary Use/Notes\fP +.sp 5p +.nf +TIFFTAG_FAXMODE G3 R/W general codec operation +TIFFTAG_FAXFILLFUNC G3/G4 R/W bitmap fill function +TIFFTAG_JPEGQUALITY JPEG R/W compression quality control +TIFFTAG_JPEGCOLORMODE JPEG R/W control colorspace conversions +TIFFTAG_JPEGTABLESMODE JPEG R/W control contents of \fIJPEGTables\fP tag +TIFFTAG_ZIPQUALITY Deflate R/W compression quality level +TIFFTAG_PIXARLOGDATAFMT PixarLog R/W user data format +TIFFTAG_PIXARLOGQUALITY PixarLog R/W compression quality level +TIFFTAG_SGILOGDATAFMT SGILog R/W user data format +.fi +.TP +.B TIFFTAG_FAXMODE +Control the operation of the Group 3 codec. +Possible values (independent bits that can be combined by +or'ing them together) are: +FAXMODE_CLASSIC +(enable old-style format in which the +.SM RTC +is written at the end of the last strip), +FAXMODE_NORTC +(opposite of +FAXMODE_CLASSIC; +also called +FAXMODE_CLASSF), +FAXMODE_NOEOL +(do not write +.SM EOL +codes at the start of each row of data), +FAXMODE_BYTEALIGN +(align each encoded row to an 8-bit boundary), +FAXMODE_WORDALIGN +(align each encoded row to an 16-bit boundary), +The default value is dependent on the compression scheme; this +pseudo-tag is used by the various G3 and G4 codecs to share code. +.TP +.B TIFFTAG_FAXFILLFUNC +Control the function used to convert arrays of black and white +runs to packed bit arrays. +This hook can be used to image decoded scanlines in multi-bit +depth rasters (e.g. for display in colormap mode) +or for other purposes. +The default value is a pointer to a builtin function that images +packed bilevel data. +.TP +.B TIFFTAG_IPTCNEWSPHOTO +Tag contaings image metadata per the IPTC newsphoto spec: Headline, +captioning, credit, etc... Used by most wire services. +.TP +.B TIFFTAG_PHOTOSHOP +Tag contains Photoshop captioning information and metadata. Photoshop +uses in parallel and redundantly alongside IPTCNEWSPHOTO information. +.TP +.B TIFFTAG_JPEGQUALITY +Control the compression quality level used in the baseline algorithm. +Note that quality levels are in the range 0-100 with a default value of 75. +.TP +.B TIFFTAG_JPEGCOLORMODE +Control whether or not conversion is done between +RGB and YCbCr colorspaces. +Possible values are: +JPEGCOLORMODE_RAW +(do not convert), and +JPEGCOLORMODE_RGB +(convert to/from RGB) +The default value is JPEGCOLORMODE_RAW. +.TP +.B TIFFTAG_JPEGTABLESMODE +Control the information written in the +.I JPEGTables +tag. +Possible values (independent bits that can be combined by +or'ing them together) are: +JPEGTABLESMODE_QUANT +(include quantization tables), +and +JPEGTABLESMODE_HUFF +(include Huffman encoding tables). +The default value is JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF. +.TP +.B TIFFTAG_ZIPQUALITY +Control the compression technique used by the Deflate codec. +Quality levels are in the range 1-9 with larger numbers yielding better +compression at the cost of more computation. +The default quality level is 6 which yields a good time-space tradeoff. +.TP +.B TIFFTAG_PIXARLOGDATAFMT +Control the format of user data passed +.I in +to the PixarLog codec when encoding and passed +.I out +from when decoding. +Possible values are: +PIXARLOGDATAFMT_8BIT +for 8-bit unsigned pixels, +PIXARLOGDATAFMT_8BITABGR +for 8-bit unsigned ABGR-ordered pixels, +PIXARLOGDATAFMT_11BITLOG +for 11-bit log-encoded raw data, +PIXARLOGDATAFMT_12BITPICIO +for 12-bit PICIO-compatible data, +PIXARLOGDATAFMT_16BIT +for 16-bit signed samples, +and +PIXARLOGDATAFMT_FLOAT +for 32-bit IEEE floating point samples. +.TP +.B TIFFTAG_PIXARLOGQUALITY +Control the compression technique used by the PixarLog codec. +This value is treated identically to TIFFTAG_ZIPQUALITY; see the +above description. +.TP +.B TIFFTAG_SGILOGDATAFMT +Control the format of client data passed +.I in +to the SGILog codec when encoding and passed +.I out +from when decoding. +Possible values are: +SGILOGDATAFMT_FLTXYZ +for converting between LogLuv and 32-bit IEEE floating valued XYZ pixels, +SGILOGDATAFMT_16BITLUV +for 16-bit encoded Luv pixels, +SGILOGDATAFMT_32BITRAW and SGILOGDATAFMT_24BITRAW +for no conversion of data, +SGILOGDATAFMT_8BITRGB +for returning 8-bit RGB data (valid only when decoding LogLuv-encoded data), +SGILOGDATAFMT_FLTY +for converting between LogL and 32-bit IEEE floating valued Y pixels, +SGILOGDATAFMT_16BITL +for 16-bit encoded L pixels, +and +SGILOGDATAFMT_8BITGRY +for returning 8-bit greyscale data +(valid only when decoding LogL-encoded data). +.SH DIAGNOSTICS +All error messages are directed through the +.IR TIFFError +routine. +By default messages are directed to +.B stderr +in the form: +.IR "module: message\en." +Warning messages are likewise directed through the +.IR TIFFWarning +routine. +.SH "SEE ALSO" +.BR fax2tiff (1), +.BR gif2tiff (1), +.BR pal2rgb (1), +.BR ppm2tiff (1), +.BR rgb2ycbcr (1), +.BR ras2tiff (1), +.BR raw2tiff (1), +.BR sgi2tiff (1), +.BR tiff2bw (1), +.BR tiffdither (1), +.BR tiffdump (1), +.BR tiffcp (1), +.BR tiffcmp (1), +.BR tiffgt (1), +.BR tiffinfo (1), +.BR tiffmedian (1), +.BR tiffsplit (1), +.BR tiffsv (1). +.PP +.BR "Tag Image File Format Specification \(em Revision 6.0" , +an Aldus Technical Memorandum. +.PP +.BR "The Spirit of TIFF Class F" , +an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies. +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ +.SH BUGS +The library does not support multi-sample images +where some samples have different bits/sample. +.PP +The library does not support random access to compressed data +that is organized with more than one row per tile or strip. diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/pal2rgb.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/pal2rgb.1 new file mode 100644 index 0000000..0ac2e5a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/pal2rgb.1 @@ -0,0 +1,111 @@ +.\" $Id: pal2rgb.1,v 1.3 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH PAL2RGB 1 "September 20, 2005" "libtiff" +.SH NAME +pal2rgb \- convert a palette color +.SM TIFF +image to a full color image +.SH SYNOPSIS +.B pal2rgb +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I Pal2rgb +converts a palette color +.SM TIFF +image to a full color image by +applying the colormap of the palette image to each sample +to generate a full color +.SM RGB +image. +.SH OPTIONS +Options that affect the interpretation of input data are: +.TP +.B \-C +This option overrides the default behavior of +.I pal2rgb +in determining whether or not +colormap entries contain 16-bit or 8-bit values. +By default the colormap is inspected and +if no colormap entry greater than 255 is found, +the colormap is assumed to have only 8-bit values; otherwise +16-bit values (as required by the +.SM TIFF +specification) are assumed. +The +.B \-C +option can be used to explicitly specify the number of +bits for colormap entries: +.B "\-C 8" +for 8-bit values, +.B "\-C 16" +for 16-bit values. +.PP +Options that affect the output file format are: +.TP +.B \-p +Explicitly select the planar configuration used in organizing +data samples in the output image: +.B "\-p contig" +for samples packed contiguously, and +.B "\-p separate" +for samples stored separately. +By default samples are packed. +.TP +.B \-c +Use the specific compression algorithm to encoded image data +in the output file: +.B "\-c packbits" +for Macintosh Packbits, +.B "\-c lzw" +for Lempel-Ziv & Welch, +.B "\-c zip" +for Deflate, +.B "\-c none" +for no compression. +If no compression-related option is specified, the input +file's compression algorithm is used. +.TP +.B \-r +Explicitly specify the number of rows in each strip of the +output file. +If the +.B \-r +option is not specified, a number is selected such that each +output strip has approximately 8 kilobytes of data in it. +.SH BUGS +Only 8-bit images are handled. +.SH "SEE ALSO" +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/ppm2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/ppm2tiff.1 new file mode 100644 index 0000000..882fd04 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/ppm2tiff.1 @@ -0,0 +1,105 @@ +.\" $Id: ppm2tiff.1,v 1.5 2006-03-01 11:20:33 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH PPM2TIFF 1 "March 1, 2006" "libtiff" +.SH NAME +ppm2tiff \- create a +.SM TIFF +file from +.SM PPM, PGM +and +.SM PBM +image files +.SH SYNOPSIS +.B ppm2tiff +[ +.I options +] [ +.I input.ppm +] +.I output.tif +.SH DESCRIPTION +.I ppm2tiff +converts a file in the +.SM PPM, PGM +and +.SM PBM +image formats to +.SM TIFF. +By default, the +.SM TIFF +image is created with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the Packbits algorithm (\c +.IR Compression =32773), +and with each strip no more than 8 kilobytes. These characteristics can be +overridden, or explicitly specified with the options described below +.PP +If the +.SM PPM +file contains greyscale data, then the +.I PhotometricInterpretation +tag is set to 1 (min-is-black), otherwise it is set to 2 (RGB). +.PP +If no +.SM PPM +file is specified on the command line, +.I ppm2tiff +will read from the standard input. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B none +for no compression, +.B packbits +for PackBits compression (will be used by default), +.B lzw +for Lempel-Ziv & Welch compression, +.B jpeg +for baseline JPEG compression, +.B zip +for Deflate compression, +.B g3 +for CCITT Group 3 (T.4) compression, +and +.B g4 +for CCITT Group 4 (T.6) compression. +.TP +.B \-r +Write data with a specified number of rows per strip; by default the number of +rows/strip is selected so that each strip is approximately 8 kilobytes. +.TP +.B \-R +Mark the resultant image to have the specified X and Y resolution (in +dots/inch). +.SH "SEE ALSO" +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/ras2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/ras2tiff.1 new file mode 100644 index 0000000..0c78ddb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/ras2tiff.1 @@ -0,0 +1,96 @@ +.\" $Id: ras2tiff.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH RAS2TIFF 1 "November 2, 2005" "libtiff" +.SH NAME +ras2tiff \- create a +.SM TIFF +file from a Sun rasterfile +.SH SYNOPSIS +.B ras2tiff +[ +.I options +] +.I input.ras +.I output.tif +.SH DESCRIPTION +.I ras2tiff +converts a file in the Sun rasterfile format to +.SM TIFF. +By default, the +.SM TIFF +image is created with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the Lempel-Ziv & Welch algorithm (\c +.IR Compression =5), +and with each strip no more than 8 kilobytes. +These characteristics can overridden, or explicitly specified +with the options described below. +.PP +Any colormap information in the rasterfile is carried over to the +.SM TIFF +file by including a +.I Colormap +tag in the output file. +If the rasterfile has a colormap, the +.I PhotometricInterpretation +tag is set to 3 (palette); +otherwise it is set to 2 (RGB) if the depth +is 24 or 1 (min-is-black) if the depth is not 24. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm, +.B "\-c jpeg" +for the baseline JPEG compression algorithm, +.B "\-c zip +for the Deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch (the default). +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.SH BUGS +Does not handle all possible rasterfiles. +In particular, +.I ras2tiff +does not handle run-length encoded images. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/raw2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/raw2tiff.1 new file mode 100644 index 0000000..3e832df --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/raw2tiff.1 @@ -0,0 +1,196 @@ +.\" $Id: raw2tiff.1,v 1.7 2009-08-24 19:13:40 bfriesen Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH RAW2TIFF 1 "November 2, 2005" "libtiff" +.SH NAME +raw2tiff \- create a +.SM TIFF +file from a raw data +.SH SYNOPSIS +.B raw2tiff +[ +.I options +] +.I input.raw +.I output.tif +.SH DESCRIPTION +.I raw2tiff +converts a raw byte sequence into +.SM TIFF. +By default, the +.SM TIFF +image is created with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the PackBits algorithm (\c +.IR Compression =32773), +and with each strip no more than 8 kilobytes. +These characteristics can overridden, or explicitly specified +with the options described below. +.SH OPTIONS +.TP +.BI \-H " number" +size of input image file header in bytes (0 by default). This amount of data +just will be skipped from the start of file while reading. +.TP +.BI \-w " number" +width of input image in pixels (can be guessed, see +.SM +.B "GUESSING THE IMAGE GEOMETRY" +below). +.TP +.BI \-l " number" +length of input image in lines (can be guessed, see +.SM +.B "GUESSING THE IMAGE GEOMETRY" +below). +.TP +.BI \-b " number" +number of bands in input image (1 by default). +.TP +.BI \-d " data_type" +type of samples in input image, where +.I data_type +may be: +.ta \w'\fBdouble \fR'u +.br +.B byte\t +8-bit unsigned integer (default), +.br +.B short\t +16-bit unsigned integer, +.br +.B long\t +32-bit unsigned integer, +.br +.B sbyte\t +8-bit signed integer, +.br +.B sshort\t +16-bit signed integer, +.br +.B slong\t +32-bit signed integer, +.br +.B float\t +32-bit IEEE floating point, +.br +.B double\t +64-bit IEEE floating point. +.TP +.BI \-i " config" +type of samples interleaving in input image, where +.I config +may be: +.ta \w'\fBpixel \fR'u +.br +.B pixel\t +pixel interleaved data (default), +.br +.B band\t +band interleaved data. +.TP +.BI \-p " photo" +photometric interpretation (color space) of the input image, where +.I photo +may be: +.ta \w'\fBminiswhite \fR'u +.br +.B miniswhite\t +white color represented with 0 value, +.br +.B minisblack\t +black color represented with 0 value (default), +.br +.B rgb\t +image has RGB color model, +.br +.B cmyk\t +image has CMYK (separated) color model, +.br +.B ycbcr\t +image has YCbCr color model, +.br +.B cielab\t +image has CIE L*a*b color model, +.br +.B icclab\t +image has ICC L*a*b color model, +.br +.B itulab\t +image has ITU L*a*b color model. +.TP +.B \-s +swap bytes fetched from the input file. +.TP +.B \-L +input data has LSB2MSB bit order (default). +.TP +.B \-M +input data has MSB2LSB bit order. +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm (the default), +.B "\-c jpeg" +for the baseline JPEG compression algorithm, +.B "\-c zip" +for the Deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch. +.TP +.BI \-r " number" +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.SH GUESSING THE IMAGE GEOMETRY +.I raw2tiff +can guess image width and height in case one or both of these parameters are +not specified. If you omit one of those parameters, the complementary one will +be calculated based on the file size (taking into account header size, number +of bands and data type). If you omit both parameters, the statistical approach +will be used. Utility will compute correlation coefficient between two lines +at the image center using several appropriate line sizes and the highest +absolute value of the coefficient will indicate the right line size. That is +why you should be cautious with the very large images, because guessing +process may take a while (depending on your system performance). Of course, the +utility can't guess the header size, number of bands and data type, so it +should be specified manually. If you don't know anything about your image, +just try with the several combinations of those options. +.P +There is no magic, it is just a mathematical statistics, so it can be wrong +in some cases. But for most ordinary images guessing method will work fine. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/rgb2ycbcr.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/rgb2ycbcr.1 new file mode 100644 index 0000000..01a332c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/rgb2ycbcr.1 @@ -0,0 +1,99 @@ +.\" $Header: /cvs/maptools/cvsroot/libtiff/man/rgb2ycbcr.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH RGB2YCBCR 1 "November 2, 2005" "libtiff" +.SH NAME +rgb2ycbcr \- convert non-YCbCr +.SM TIFF +images to a YCbCr +.SM TIFF +image +.SH SYNOPSIS +.B rgb2ycbcr +[ +.I options +] +.I "src1.tif src2.tif ... dst.tif" +.SH DESCRIPTION +.I rgb2ycbcr +converts +.SM RGB +color, greyscale, or bi-level +.SM TIFF +images to YCbCr images by transforming and sampling pixel data. If multiple +files are specified on the command line each source file is converted to a +separate directory in the destination file. +.PP +By default, chrominance samples are created by sampling +2 by 2 blocks of luminance values; this can be changed with the +.B \-h +and +.B \-v +options. +Output data are compressed with the +.SM PackBits +compression scheme, by default; an alternate scheme can be selected with the +.B \-c +option. +By default, output data are compressed in strips with +the number of rows in each strip selected so that the +size of a strip is never more than 8 kilobytes; +the +.B \-r +option can be used to explicitly set the number of +rows per strip. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm (the default), +.B "\-c jpeg" +for the JPEG compression algorithm, +.B "\-c zip" +for the deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch. +.TP +.B \-h +Set the horizontal sampling dimension to one of: 1, 2 (default), or 4. +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.TP +.B \-v +Set the vertical sampling dimension to one of: 1, 2 (default), or 4. +.SH "SEE ALSO" +.BR tiffinfo (1), +.BR tiffcp (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/sgi2tiff.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/sgi2tiff.1 new file mode 100644 index 0000000..650adb3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/sgi2tiff.1 @@ -0,0 +1,93 @@ +.\" $Id: sgi2tiff.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1991-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH SGI2TIFF 1 "November 2, 2005" "libtiff" +.SH NAME +sgi2tiff \- create a +.SM TIFF +file from an +.SM SGI +image file +.SH SYNOPSIS +.B sgi2tiff +[ +.I options +] +.I input.rgb +.I output.tif +.SH DESCRIPTION +.I sgi2tiff +converts a file in the +.SM SGI +image format to +.SM TIFF. +By default, the +.SM TIFF +image is created with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the Lempel-Ziv & Welch algorithm (\c +.IR Compression =5), +and with each strip no more than 8 kilobytes. +These characteristics can overridden, or explicitly specified +with the options described below. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm), +.B "\-c jpeg" +for the baseline JPEG compression algorithm, +.B "\-c zip +for the Deflate compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch (the default). +.TP +.B \-p +Explicitly select the planar configuration used in organizing +data samples in the output image: +.B "\-p contig" +for samples packed contiguously, and +.B "\-p separate" +for samples stored separately. +By default samples are packed. +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.SH BUGS +Does not record colormap information. +.SH "SEE ALSO" +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/thumbnail.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/thumbnail.1 new file mode 100644 index 0000000..f4172bb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/thumbnail.1 @@ -0,0 +1,90 @@ +.\" $Id: thumbnail.1,v 1.2 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1994-1997 Sam Leffler +.\" Copyright (c) 1994-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH THUMBNAIL 1 "November 2, 2005" "libtiff" +.SH NAME +thumbnail \- create a +.SM TIFF +file with thumbnail images +.SH SYNOPSIS +.B thumbnail +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I thumbnail +is a program written to show how one might use the +SubIFD tag (#330) to store thumbnail images. +.I thumbnail +copies a +.SM TIFF +Class F facsimile file to the output file +and for each image an 8-bit greyscale +.IR "thumbnail sketch" . +The output file contains the thumbnail image with the associated +full-resolution page linked below with the SubIFD tag. +.PP +By default, thumbnail images are 216 pixels wide by 274 pixels high. +Pixels are calculated by sampling and filtering the input image +with each pixel value passed through a contrast curve. +.SH OPTIONS +.TP +.B \-w +Specify the width of thumbnail images in pixels. +.TP +.B \-h +Specify the height of thumbnail images in pixels. +.TP +.B \-c +Specify a contrast curve to apply in generating the thumbnail images. +By default pixels values are passed through a linear contrast curve +that simply maps the pixel value ranges. +Alternative curves are: +.B exp50 +for a 50% exponential curve, +.B exp60 +for a 60% exponential curve, +.B exp70 +for a 70% exponential curve, +.B exp80 +for a 80% exponential curve, +.B exp90 +for a 90% exponential curve, +.B exp +for a pure exponential curve, +.B linear +for a linear curve. +.SH BUGS +There are no options to control the format of the saved thumbnail images. +.SH "SEE ALSO" +.BR tiffdump (1), +.BR tiffgt (1), +.BR tiffinfo (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2bw.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2bw.1 new file mode 100644 index 0000000..ccbe7e8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2bw.1 @@ -0,0 +1,94 @@ +.\" $Id: tiff2bw.1,v 1.3 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFF2BW 1 "November 2, 2005" "libtiff" +.SH NAME +tiff2bw \- convert a color +.SM TIFF +image to greyscale +.SH SYNOPSIS +.B tiff2bw +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I Tiff2bw +converts an +.SM RGB +or Palette color +.SM TIFF +image to a greyscale image by +combining percentages of the red, green, and blue channels. +By default, output samples are created by taking +28% of the red channel, 59% of the green channel, and 11% of +the blue channel. +To alter these percentages, the +.BR \-R , +.BR \-G , +and +.BR \-B +options may be used. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression, +.B "\-c packbits" +for the PackBits compression algorithm, +.B "\-c zip +for the Deflate compression algorithm, +.B "\-c g3 +for the CCITT Group 3 compression algorithm, +.B "\-c g4 +for the CCITT Group 4 compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch (the default). +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.TP +.B \-R +Specify the percentage of the red channel to use (default 28). +.TP +.B \-G +Specify the percentage of the green channel to use (default 59). +.TP +.B \-B +Specify the percentage of the blue channel to use (default 11). +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2pdf.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2pdf.1 new file mode 100644 index 0000000..ba670cf --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2pdf.1 @@ -0,0 +1,254 @@ +.\" $Id: tiff2pdf.1,v 1.7 2010-12-11 22:47:49 faxguy Exp $ +.\" +.\" Copyright (c) 2003 Ross Finlayson +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the name of +.\" Ross Finlayson may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Ross Finlayson. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL ROSS FINLAYSON BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.\" Process this file with +.\" groff -man -Tascii tiff2pdf.1 +.\" +.TH TIFF2PDF 1 "April 20, 2006" "libtiff" +.SH NAME +tiff2pdf \- convert a TIFF image to a PDF document +.SH SYNOPSIS +.B tiff2pdf +[ +.I options +] +.I input.tiff +.SH DESCRIPTION +.I tiff2pdf +opens a TIFF image and writes a PDF document to standard output. +.PP +The program converts one TIFF file to one PDF file, including multiple page +TIFF files, tiled TIFF files, black and white. grayscale, and color TIFF +files that contain data of TIFF photometric interpretations of bilevel, +grayscale, RGB, YCbCr, CMYK separation, and ICC L*a*b* as supported by +.I libtiff +and PDF. +.PP +If you have multiple TIFF files to convert into one PDF file then use +.I tiffcp +or other program to concatenate the files into a multiple page TIFF file. +If the input TIFF file is of huge dimensions (greater than 10000 pixels height +or width) convert the input image to a tiled TIFF if it is not already. +.PP +The standard output is standard output. Set the output file name with the +.BI \-o " output.pdf" +option. +.PP +All black and white files are compressed into a single strip CCITT G4 Fax +compressed PDF, unless tiled, where tiled black and white images are +compressed into tiled CCITT G4 Fax compressed PDF, +.I libtiff +CCITT support is assumed. +.PP +Color and grayscale data can be compressed using either JPEG compression, +ITU-T T.81, or Zip/Deflate LZ77 compression. Set the compression type using +the +.B \-j +or +.B \-z +options. JPEG compression support +requires that +.I libtiff +be configured with JPEG support, and Zip/Deflate compression support requires +that +.I libtiff +be configured with Zip support, in tiffconf.h. Use only one or the other of +.B \-j +and +.B \-z. +.PP +If the input TIFF contains single strip CCITT G4 Fax compressed information, +then that is written to the PDF file without transcoding, unless the options +of no compression and no passthrough are set, +.B \-d +and +.B \-n. +.PP +If the input TIFF contains JPEG or single strip Zip/Deflate compressed +information, and they are configured, then that is written to the PDF file +without transcoding, unless the options of no compression and no passthrough +are set. +.PP +The default page size upon which the TIFF image is placed is determined by +the resolution and extent of the image data. Default values for the TIFF +image resolution can be set using the +.B \-x +and +.B \-y +options. The page size can be set using the +.B \-p +option for paper size, or +.B \-w +and +.B \-l +for paper width and length, then each page of the TIFF image is centered on +its page. The distance unit for default resolution and page width and +length can be set by the +.B \-u +option, the default unit is inch. +.PP +Various items of the output document information can be set with the +.BR \-e , +.BR \-c , +.BR \-a , +.BR \-t , +.BR \-s , +and +.B \-k +options. Setting the argument of the option to "" for these +tags causes the relevant document information field to be not written. Some +of the document information values otherwise get their information from the +input TIFF image, the software, author, document name, and image description. +.PP +The Portable Document Format (PDF) specification is copyrighted by Adobe +Systems, Incorporated. +.SH OPTIONS +.TP +.BI \-o " output-file" +Set the output to go to file. +.I output-file +.TP +.B \-j +Compress with JPEG (requires +.I libjpeg +configured with +.IR libtiff ). +.TP +.B \-z +Compress with Zip/Deflate (requires +.I zlib +configured with +.IR libtiff ). +.TP +.BI \-q " quality" +Set the compression quality, 1-100 for JPEG. +.TP +.B \-n +Do not allow data to be converted without uncompressing, no compressed +data passthrough. +.TP +.BI \-b +Set PDF ``Interpolate'' user preference. +.TP +.B \-d +Do not compress (decompress). +.TP +.B \-i +Invert colors. +.TP +.BI \-p " paper-size" +Set paper size, e.g., +.BR letter , +.BR legal , +.BR A4 . +.TP +.B \-F +Cause the tiff to fill the PDF page. +.TP +.BR \-u " [" i | m ] +Set distance unit, +.B i +for inch, +.B m +for centimeter. +.TP +.BI \-w " width" +Set width in units. +.TP +.BI \-l " length" +Set length in units. +.TP +.BI \-x " xres" +Set x/width resolution default. +.TP +.BI \-y " yres" +Set y/length resolution default. +.TP +.BR \-r " [" d | o ] +Set +.B d +for resolution default for images without resolution, +.B o +for resolution override for all images. +.TP +.BI \-f +Set PDF ``Fit Window'' user preference. +.TP +.BI \-e " YYYYMMDDHHMMSS" +Set document information date, overrides image or current date/time default, +.I YYYYMMDDHHMMSS. +.TP +.BI \-c " creator" +Set document information creator, overrides image software default. +.TP +.BI \-a " author" +Set document information author, overrides image artist default. +.TP +.BI \-t " title" +Set document information title, overrides image document name default. +.TP +.BI \-s " subject" +Set document information subject, overrides image image description default. +.TP +.BI \-k " keywords" +Set document information keywords. +.TP +.B \-h +List usage reminder to stderr and exit. +.SH EXAMPLES +.TP +The following example would generate the file output.pdf from input.tiff. +.RS +.nf +tiff2pdf \-o output.pdf input.tiff +.fi +.RE +.PP +The following example would generate PDF output from input.tiff and write it +to standard output. +.RS +.nf +tiff2pdf input.tiff +.fi +.RE +.PP +The following example would generate the file output.pdf from input.tiff, +putting the image pages on a letter sized page, compressing the output +with JPEG, with JPEG quality 75, setting the title to ``Document'', and setting +the ``Fit Window'' option. +.RS +.nf +tiff2pdf \-p letter \-j \-q 75 \-t "Document" \-f \-o output.pdf input.tiff +.fi +.RE +.SH BUGS +Please report bugs via the web interface at +.IP +\%http://bugzilla.remotesensing.org/enter_bug.cgi?product=libtiff +.SH "SEE ALSO" +.BR libtiff (3), +.BR tiffcp (1), +.BR tiff2ps (1) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2ps.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2ps.1 new file mode 100644 index 0000000..c3a9bac --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2ps.1 @@ -0,0 +1,273 @@ +.\" $Id: tiff2ps.1,v 1.10 2009-01-12 02:05:19 bfriesen Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.ds Ps PostScript +.if n .po 0 +.TH TIFF2PS 1 "November 2, 2005" "libtiff" +.SH NAME +tiff2ps \- convert a +.SM TIFF +image to \*(Ps\*(Tm +.SH SYNOPSIS +.B tiff2ps +[ +.I options +] +.I "input.tif ..." +.SH DESCRIPTION +.I tiff2ps +reads +.SM TIFF +images and writes \*(Ps or Encapsulated \*(Ps (EPS) +on the standard output. +By default, +.I tiff2ps +writes Encapsulated \*(Ps for the first image in the specified +.SM TIFF +image file. +.PP +By default, +.I tiff2ps +will generate \*(Ps that fills a printed area specified +by the +.SM TIFF +tags in the input file. +If the file does not contain +.I XResolution +or +.I YResolution +tags, then the printed area is set according to the image dimensions. +The +.B \-w +and +.B \-h +options (see below) +can be used to set the dimensions of the printed area in inches; +overriding any relevant +.SM TIFF +tags. +.PP +The \*(Ps generated for +.SM RGB, +palette, and +.SM CMYK +images uses the +.I colorimage +operator. +The \*(Ps generated for +greyscale and bilevel images +uses the +.I image +operator. +When the +.I colorimage +operator is used, \*(Ps code to emulate this operator +on older \*(Ps printers is also generated. +Note that this emulation code can be very slow. +.PP +Color images with associated alpha data are composited over +a white background. +.SH OPTIONS +.TP +.B \-1 +Generate \*(Ps Level 1 (the default). +.TP +.B \-2 +Generate \*(Ps Level 2. +.TP +.B \-3 +Generate \*(Ps Level 3. It basically allows one to use the /flateDecode +filter for ZIP compressed TIFF images. +.TP +.B \-a +Generate output for all IFDs (pages) in the input file. +.TP +.B \-b +Specify the bottom margin for the output (in inches). This does not affect +the height of the printed image. +.TP +.B \-c +Center the image in the output. This option only shows an effect if both +the +.B \-w +and the +.B \-h +option are given. +.TP +.B \-d +Set the initial +.SM TIFF +directory to the specified directory number. +(NB: Directories are numbered starting at zero.) +This option is useful for selecting individual pages in a +multi-page (e.g. facsimile) file. +.TP +.B \-e +Force the generation of Encapsulated \*(Ps (implies +.BR \-z ). +.TP +.B \-h +Specify the vertical size of the printed area (in inches). +.TP +.B \-H +Specify the maximum height of image (in inches). Images with larger sizes will +be split in several pages. Option +.B \-L +may be used for specifying size of split images overlapping. +.TP +.B \-W +Specify the maximum width of image (in inches). Images with larger sizes will +be split in several pages. Options +.B \-L +and +.B \-W +are mutually exclusive. +.B \-i +Enable/disable pixel interpolation. This option requires a +single numeric value: zero to disable pixel interpolation and +non-zero to enable. The default is enabled. +.TP +.B \-L +Specify the size of overlapping for split images (in inches). Used in +conjunction with +.B \-H +option and +.B \-W +option. +.TP +.B \-l +Specify the left margin for the output (in inches). This does not affect +the width of the printed image. +.TP +.B \-m +Where possible render using the +.I imagemask +\*(Ps operator instead of the +.I image +operator. When this option is specified +.I tiff2ps +will use +.I imagemask +for rendering 1 bit deep images. If this option is not specified +or if the image depth is greater than 1 then the +.I image +operator is used. +.TP +.B \-o +Set the initial +.SM TIFF +directory to the +.SM IFD +at the specified file offset. +This option is useful for selecting thumbnail images and the +like which are hidden using the +.I SubIFD +tag. +.TP +.B \-p +Force the generation of (non-Encapsulated) \*(Ps. +.TP +.B \-r 90|180|270|auto +Rotate image by 90, 180, 270 degrees or auto. Auto picks the best +fit for the image on the specified paper size (eg portrait +or landscape) if -h or -w is specified. Rotation is in degrees +counterclockwise. Auto rotates 90 degrees ccw to produce landscape. +.TP +.B \-s +Generate output for a single IFD (page) in the input file. +.TP +.B \-w +Specify the horizontal size of the printed area (in inches). +.TP +.B \-x +Override resolution units specified in the TIFF as centimeters. +.TP +.B \-y +Override resolution units specified in the TIFF as inches. +.TP +.B \-z +When generating \*(Ps Level 2, data is scaled so that it does not +image into the +.I deadzone +on a page (the outer margin that the printing device is unable to mark). +This option suppresses this behavior. +When \*(Ps Level 1 is generated, data is imaged to the entire printed +page and this option has no affect. +.SH EXAMPLES +The following generates \*(Ps Level 2 for all pages of a facsimile: +.RS +.nf +tiff2ps \-a2 fax.tif | lpr +.fi +.RE +Note also that if you have version 2.6.1 or newer of Ghostscript then you +can efficiently preview facsimile generated with the above command. +.PP +To generate Encapsulated \*(Ps for a the image at directory 2 +of an image use: +.RS +.nf +tiff2ps \-d 1 foo.tif +.fi +.RE +(Notice that directories are numbered starting at zero.) +.PP +If you have a long image, it may be split in several pages: +.RS +.nf +tiff2ps \-h11 \-w8.5 \-H14 \-L.5 foo.tif > foo.ps +.fi +.RE +The page size is set to 8.5x11 by +.B \-w +and +.B \-h +options. We will accept a small amount of vertical compression, so +.B \-H +set to 14. Any pages between 11 and 14 inches will be fit onto one page. +Pages longer than 14 inches are cut off at 11 and continued on the next +page. The +.B \-L.5 +option says to repeat a half inch on the next page (to improve readability). +.SH BUGS +Because \*(Ps does not support the notion of a colormap, +8-bit palette images produce 24-bit \*(Ps images. +This conversion results in output that is six times +bigger than the original image and which takes a long time +to send to a printer over a serial line. +Matters are even worse for 4-, 2-, and 1-bit palette images. +.PP +Does not handle tiled images when generating \*(Ps Level I output. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffgt (1), +.BR tiffmedian (1), +.BR tiff2bw (1), +.BR tiffsv (1), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2rgba.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2rgba.1 new file mode 100644 index 0000000..c551656 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiff2rgba.1 @@ -0,0 +1,97 @@ +.\" $Id: tiff2rgba.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFF2RGBA 1 "November 2, 2005" "libtiff" +.SH NAME +tiff2rgba \- convert a +.SM TIFF +image to RGBA color space +.SH SYNOPSIS +.B tiff2rgba +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I Tiff2rgba +converts a wide variety of TIFF images into an RGBA TIFF image. This +includes the ability to translate different color spaces and photometric +interpretation into RGBA, support for alpha blending, and translation +of many different bit depths into a 32bit RGBA image. +.P +Internally this program is implemented using the +.I TIFFReadRGBAImage() +function, and it suffers any limitations of that image. This includes +limited support for > 8 BitsPerSample images, and flaws with some +esoteric combinations of BitsPerSample, photometric interpretation, +block organization and planar configuration. +.P +The generated images are stripped images with four samples per pixel +(red, green, blue and alpha) or if the +.B \-n +flag is used, three samples +per pixel (red, green, and blue). The resulting images are always planar +configuration contiguous. For this reason, this program is a useful utility +for transform exotic TIFF files into a form ingestible by almost any TIFF +supporting software. +.SH OPTIONS +.TP +.B \-c +Specify a compression scheme to use when writing image data: +.B "\-c none" +for no compression (the default), +.B "\-c packbits" +for the PackBits compression algorithm, +.B "\-c zip" +for the Deflate compression algorithm, +.B "\-c jpeg" +for the JPEG compression algorithm, +and +.B "\-c lzw" +for Lempel-Ziv & Welch. +.TP +.B \-r +Write data with a specified number of rows per strip; +by default the number of rows/strip is selected so that each strip +is approximately 8 kilobytes. +.TP +.B \-b +Process the image one block (strip/tile) at a time instead of by reading +the whole image into memory at once. This may be necessary for very large +images on systems with limited RAM. +.TP +.B \-n +Drop the alpha component from the output file, producing a pure RGB file. +Currently this does not work if the +.B \-b +flag is also in effect. +.SH "SEE ALSO" +.BR tiff2bw (1), +.BR TIFFReadRGBAImage (3t), +.BR libtiff (3) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcmp.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcmp.1 new file mode 100644 index 0000000..961d812 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcmp.1 @@ -0,0 +1,87 @@ +.\" $Id: tiffcmp.1,v 1.6 2009-08-24 19:13:40 bfriesen Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFCMP 1 "November 2, 2005" "libtiff" +.SH NAME +tiffcmp \- compare two +.SM TIFF +files +.SH SYNOPSIS +.B tiffcmp +[ +.I options +] +.I "file1.tif file2.tif" +.SH DESCRIPTION +.I Tiffcmp +compares the tags and data in two files created according +to the Tagged Image File Format, Revision 6.0. +The schemes used for compressing data in each file +are immaterial when data are compared\-data are compared on +a scanline-by-scanline basis after decompression. +Most directory tags are checked; notable exceptions are: +.IR GrayResponseCurve , +.IR ColorResponseCurve , +and +.IR ColorMap +tags. +Data will not be compared if any of the +.IR BitsPerSample , +.IR SamplesPerPixel , +or +.I ImageWidth +values are not equal. +By default, +.I tiffcmp +will terminate if it encounters any difference. +.SH OPTIONS +.TP +.B \-l +List each byte of image data that differs between the files. +.TP +.BI \-z " number" +List specified number of image data bytes that differs between the files. +.TP +.B \-t +Ignore any differences in directory tags. +.SH BUGS +Tags that are not recognized by the library are not +compared; they may also generate spurious diagnostics. +.PP +The image data of tiled files is not compared, since the +.I TIFFReadScanline() +function is used. An error will be reported for tiled files. +.PP +The pixel and/or sample number reported in differences may be off +in some exotic cases. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcp.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcp.1 new file mode 100644 index 0000000..5fdcc47 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcp.1 @@ -0,0 +1,306 @@ +.\" $Id: tiffcp.1,v 1.12 2010-12-23 13:38:47 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFCP 1 "February 24, 2007" "libtiff" +.SH NAME +tiffcp \- copy (and possibly convert) a +.SM TIFF +file +.SH SYNOPSIS +.B tiffcp +[ +.I options +] +.I "src1.tif ... srcN.tif dst.tif" +.SH DESCRIPTION +.I tiffcp +combines one or more files created according +to the Tag Image File Format, Revision 6.0 +into a single +.SM TIFF +file. +Because the output file may be compressed using a different +algorithm than the input files, +.I tiffcp +is most often used to convert between different compression +schemes. +.PP +By default, +.I tiffcp +will copy all the understood tags in a +.SM TIFF +directory of an input +file to the associated directory in the output file. +.PP +.I tiffcp +can be used to reorganize the storage characteristics of data +in a file, but it is explicitly intended to not alter or convert +the image data content in any way. +.SH OPTIONS +.TP +.BI \-b " image" +subtract the following monochrome image from all others +processed. This can be used to remove a noise bias +from a set of images. This bias image is typically an +image of noise the camera saw with its shutter closed. +.TP +.B \-B +Force output to be written with Big-Endian byte order. +This option only has an effect when the output file is created or +overwritten and not when it is appended to. +.TP +.B \-C +Suppress the use of ``strip chopping'' when reading images +that have a single strip/tile of uncompressed data. +.TP +.B \-c +Specify the compression to use for data written to the output file: +.B none +for no compression, +.B packbits +for PackBits compression, +.B lzw +for Lempel-Ziv & Welch compression, +.B zip +for Deflate compression, +.B lzma +for LZMA2 compression, +.B jpeg +for baseline JPEG compression, +.B g3 +for CCITT Group 3 (T.4) compression, +and +.B g4 +for CCITT Group 4 (T.6) compression. +By default +.I tiffcp +will compress data according to the value of the +.I Compression +tag found in the source file. +.IP +The +.SM CCITT +Group 3 and Group 4 compression algorithms can only +be used with bilevel data. +.IP +Group 3 compression can be specified together with several +T.4-specific options: +.B 1d +for 1-dimensional encoding, +.B 2d +for 2-dimensional encoding, +and +.B fill +to force each encoded scanline to be zero-filled so that the +terminating EOL code lies on a byte boundary. +Group 3-specific options are specified by appending a ``:''-separated +list to the ``g3'' option; e.g. +.B "\-c g3:2d:fill" +to get 2D-encoded data with byte-aligned EOL codes. +.IP +.SM LZW, Deflate +and +.SM LZMA2 +compression can be specified together with a +.I predictor +value. A predictor value of 2 causes each scanline of the output image to +undergo horizontal differencing before it is encoded; a value of 1 forces each +scanline to be encoded without differencing. A value 3 is for floating point +predictor which you can use if the encoded data are in floating point format. +LZW-specific options are specified by appending a ``:''-separated list to the +``lzw'' option; e.g. +.B "\-c lzw:2" +for +.SM LZW +compression with horizontal differencing. +.IP +.SM Deflate +and +.SM LZMA2 +encoders support various compression levels (or encoder presets) set as +character ``p'' and a preset number. ``p1'' is the fastest one with the worst +compression ratio and ``p9'' is the slowest but with the best possible ratio; +e.g. +.B "\-c zip:3:p9" +for +.SM Deflate +encoding with maximum compression level and floating point predictor. +.TP +.B \-f +Specify the bit fill order to use in writing output data. +By default, +.I tiffcp +will create a new file with the same fill order as the original. +Specifying +.B "\-f lsb2msb" +will force data to be written with the FillOrder tag set to +.SM LSB2MSB, +while +.B "\-f msb2lsb" +will force data to be written with the FillOrder tag set to +.SM MSB2LSB. +.TP +.B \-i +Ignore non-fatal read errors and continue processing of the input file. +.TP +.B \-l +Specify the length of a tile (in pixels). +.I tiffcp +attempts to set the tile dimensions so +that no more than 8 kilobytes of data appear in a tile. +.TP +.B \-L +Force output to be written with Little-Endian byte order. +This option only has an effect when the output file is created or +overwritten and not when it is appended to. +.TP +.B \-M +Suppress the use of memory-mapped files when reading images. +.TP +.B \-p +Specify the planar configuration to use in writing image data +that has one 8-bit sample per pixel. +By default, +.I tiffcp +will create a new file with the same planar configuration as +the original. +Specifying +.B "\-p contig" +will force data to be written with multi-sample data packed +together, while +.B "\-p separate" +will force samples to be written in separate planes. +.TP +.B \-r +Specify the number of rows (scanlines) in each strip of data +written to the output file. +By default (or when value +.B 0 +is specified), +.I tiffcp +attempts to set the rows/strip +that no more than 8 kilobytes of data appear in a strip. If you specify +special value +.B \-1 +it will results in infinite number of the rows per strip. The entire image +will be the one strip in that case. +.TP +.B \-s +Force the output file to be written with data organized in strips +(rather than tiles). +.TP +.B \-t +Force the output file to be written with data organized in tiles (rather than +strips). options can be used to force the resultant image to be written as +strips or tiles of data, respectively. +.TP +.B \-w +Specify the width of a tile (in pixels). +.I tiffcp +attempts to set the tile dimensions so that no more than 8 kilobytes of data +appear in a tile. +.I tiffcp +attempts to set the tile dimensions so that no more than 8 kilobytes of data +appear in a tile. +.TP +.B \-x +Force the output file to be written with PAGENUMBER value in sequence. +.TP +.BI \-,= character +substitute +.I character +for `,' in parsing image directory indices +in files. This is necessary if filenames contain commas. +Note that +.B \-,= +with whitespace immediately following will disable +the special meaning of the `,' entirely. See examples. +.SH EXAMPLES +The following concatenates two files and writes the result using +.SM LZW +encoding: +.RS +.nf +tiffcp \-c lzw a.tif b.tif result.tif +.fi +.RE +.PP +To convert a G3 1d-encoded +.SM TIFF +to a single strip of G4-encoded data the following might be used: +.RS +.nf +tiffcp \-c g4 \-r 10000 g3.tif g4.tif +.fi +.RE +(1000 is just a number that is larger than the number of rows in +the source file.) + +To extract a selected set of images from a multi-image TIFF file, the file +name may be immediately followed by a `,' separated list of image directory +indices. The first image is always in directory 0. Thus, to copy the 1st and +3rd images of image file ``album.tif'' to ``result.tif'': +.RS +.nf +tiffcp album.tif,0,2 result.tif +.fi +.RE + +A trailing comma denotes remaining images in sequence. The following command +will copy all image with except the first one: +.RS +.nf +tiffcp album.tif,1, result.tif +.fi +.RE + +Given file ``CCD.tif'' whose first image is a noise bias +followed by images which include that bias, +subtract the noise from all those images following it +(while decompressing) with the command: +.RS +.nf +tiffcp \-c none \-b CCD.tif CCD.tif,1, result.tif +.fi +.RE + +If the file above were named ``CCD,X.tif'', the +.B \-,= +option would +be required to correctly parse this filename with image numbers, +as follows: +.RS +.nf +tiffcp \-c none \-,=% \-b CCD,X.tif CCD,X%1%.tif result.tif +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcmp (1), +.BR tiffmedian (1), +.BR tiffsplit (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcrop.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcrop.1 new file mode 100644 index 0000000..0423fb2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffcrop.1 @@ -0,0 +1,571 @@ +.\" $Id: tiffcrop.1,v 1.7 2010-12-12 01:45:35 faxguy Exp $ +.\" tiffcrop -- a port of tiffcp.c extended to include extended processing of images +.\" +.\" Original code: +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.\" Additional code Copyright (c) 2006-2009 Richard Nolde +.\" Lasted Updated 9/2009 +.\" .if n .po 0 +.TH "TIFFCROP" "1" "December, 2008" "libtiff" "" +.SH "NAME" +tiffcrop \- select, copy, crop, convert, extract, and/or process one or more +.SM TIFF +files. +.SH "SYNOPSIS" +.B tiffcrop +[ +.I options +] +.I "src1.tif ... srcN.tif dst.tif" +.SH "DESCRIPTION" +.I Tiffcrop +processes one or more files created according +to the Tag Image File Format, Revision 6.0, specification +into one or more +.SM TIFF +file(s). +.I Tiffcrop +is most often used to extract portions of an image for processing +with bar code recognizer or OCR software when that software cannot +restrict the region of interest to a specific portion of the image +or to improve efficiency when the regions of interest must be rotated. +It can also be used to subdivide all or part of a processed image into +smaller sections and export individual images or sections of images +as separate files or separate images within one or more files derived +from the original input image or images. +.PP +The available functions can be grouped broadly into three classes: +.IP +Those that select individual images or sections of images from the input files. +The options \-N for sequences or lists of individual images in the input files, +\-Z for zones, \-z for regions, \-X and \-Y for fixed sized selections, +\-m for margins, \-U for units, and \-E for edge reference provide a variety of +ways to specify portions of the input image. +.IP +Those that allow the individual images or selections to be exported to one or +more output files in different groupings and control the organization of the +data in the output images. The options \-P for page size grouping, \-S for +subdivision into columns and rows and \-e for export mode options that produce +one or more files from each input image. The options \-r, \-s, \-t, \-w control +strip and tile format and sizes while \-B \-L \-c \-f modify the endian addressing +scheme, the compression options, and the bit fill sequence of images as they +are written. +.IP +Those that perform some action on each image that is selected from the input file. +The options include \-R for rotate, \-I for inversion of the photometric +interpretation and/or data values, and \-F to flip (mirror) the image horizontally +or vertically. +.PP + +Functions are applied to the input image(s) in the following order: +cropping, fixed area extraction, zone and region extraction, +inversion, mirroring, rotation. +.PP +Functions are applied to the output image(s) in the following order: +export mode options for grouping zones, regions, or images into +one or more files, +.I or +row and column divisions with output margins, +.I or +page size divisions with page orientation options. +.PP +Finally, strip, tile, byte order, output resolution, and compression options are +applied to all output images. +.PP +The output file(s) may be organized and compressed using a different +algorithm from the input files. +By default, +.I tiffcrop +will copy all the understood tags in a +.SM TIFF +directory of an input file to the associated directory in the output file. +Options can be used to force the resultant image to be written as strips +or tiles of data, respectively. +.PP +.I Tiffcrop +can be used to reorganize the storage characteristics of data +in a file, and to reorganize, extract, rotate, and otherwise +process the image data as specified at the same time whereas +tiffcp does not alter the image data within the file. +.PP +Using the options for selecting individual input images and the +options for exporting images and/or segments defined as zones or +regions of each input image, +.I tiffcrop +can perform the functions of tiffcp and tiffsplit in a single pass +while applying multiple operations to individual selections or images. +.PP +.SH "OPTIONS" +.TP +.B \-h +Display the syntax summary for tiffcrop. +.TP +.B \-v +Report the current version and last modification date for tiffcrop. +.TP +.B \-N odd|even|#,#\-#,#|last +Specify one or more series or range(s) of images within each file to process. +The words +.B odd +or +.B even +may be used to specify all odd or even numbered images counting from one. +Note that internally, TIFF images are numbered from zero rather than one +but since this convention is not obvious to most users, tiffcrop used 1 +to specifiy the first image in a multipage file. The word +.B last +may be used in place of a number in the sequence to indicate the +final image in the file without knowing how many images there are. +Ranges of images may be specified with a dash and multiple sets +can be indicated by joining them in a comma\-separated list. eg. use +.B \-N 1,5\-7,last +to process the 1st, 5th through 7th, and final image in the file. +.TP +.B \-E top|bottom|left|right +Specify the top, bottom, left, or right edge as the reference from +which to calcuate the width and length of crop regions or sequence +of postions for zones. When used with the \-e option for exporting +zones or regions, the reference edge determines how composite images +are arranged. Using \-E left or right causes successive zones or +regions to be merged horizontally whereas using \-E top or bottom +causes successive zones or regions to be arranged vertically. This +option has no effect on export layout when multiple zones or regions +are not being exported to composite images. Edges may be abbreviated +to the first letter. +.TP +.B \-e combined|divided|image|multiple|separate +Specify the export mode for images and selections from input images. +The final filename on the command line is considered to be the +destination file or filename stem for automatically generated +sequences of files. Modes may be abbreviated to the first letter. +.IP +combined All images and selections are written to a single file with +multiple selections from one image combined into a single image (default) +.IP +divided All images and selections are written to a single file +with each selection from one image written to a new image +.IP +image Each input image is written to a new file (numeric filename sequence) +with multiple selections from the image combined into one image +.IP +multiple Each input image is written to a new file (numeric filename sequence) +with each selection from the image written to a new image +.IP +separate Individual selections from each image are written to separate files +.TP +.B \-U in|cm|px +Specify the type of units to apply to dimensions for margins and +crop regions for input and output images. Inches or centimeters +are converted to pixels using the resolution unit specified in the +TIFF file (which defaults to inches if not specified in the IFD). +.TP +.B \-m #,#,#,# +Specify margins to be removed from the input image. The order must +be top, left, bottom, right with only commas separating the elements +of the list. Margins are scaled according to the current units and +removed before any other extractions are computed.. +.TP +.B \-X # +Set the horizontal (X\-axis) dimension of a region to extract relative to +the specified origin reference. If the origin is the top or bottom +edge, the X axis value will be assumed to start at the left edge. +.TP +.B \-Y # +Set the vertical (Y\-axis) dimension of a region to extract relative to +the specified origin reference. If the origin is the left or right +edge, the Y axis value will be assumed to start at the top. +.TP +.B \-Z #:#,#:# +Specify zones of the image designated as position X of Y equal sized portions +measured from the reference edge, eg 1:3 would be first third of the +image starting from the reference edge minus any margins specified +for the confining edges. Multiple zones can be specified as a comma +separated list but they must reference the same edge. To extract the +top quarter and the bottom third of an image you would use +.B \-Z 1:4,3:3. +.TP +.B \-z x1,y1,x2,y2: ... :xN,yN,xN+1,yN+1 +Specify a series of coordinates to define regions for processing and exporting. +The coordinates represent the top left and lower right corners of each region +in the current units, eg inch, cm, or pixels. Pixels are counted from one to +width or height and inches or cm are calculated from image resolution data. + +Each colon delimited series of four values represents the horizontal and vertical +offsets from the top and left edges of the image, regardless of the edge specified +with the \-E option. The first and third values represent the horizontal offsets of +the corner points from the left edge while the second and fourth values represent +the vertical offsets from the top edge. +.TP +.B \-F horiz|vert +Flip, ie mirror, the image or extracted region horizontally or vertically. +.TP +.B \-R 90|180|270 +Rotate the image or extracted region 90, 180, or 270 degrees clockwise. +.TP +.B \\-I [black|white|data|both] +Invert color space, eg dark to light for bilevel and grayscale images. +This can be used to modify negative images to positive or to correct +images that have the PHOTOMETRIC_INTERPRETATIN tag set incorrectly. +If the value is black or white, the PHOTOMETRIC_INTERPRETATION tag is set to +MinIsBlack or MinIsWhite, without altering the image data. If the argument +is data or both, the data values of the image are modified. Specifying both +inverts the data and the PHOTOMETRIC_INTERPRETATION tag, whereas using data +inverts the data but not the PHOTOMETRIC_INTERPRETATION tag. +No support for modifying the color space of color images in this release. +.TP +.B \-H # +Set the horizontal resolution of output images to # +expressed in the current units. +.TP +.B \-V # +Set the vertical resolution of the output images to # +expressed in the current units. +.TP +.B \-J # +Set the horizontal margin of an output page size to # +expressed in the current units when sectioning image into columns x rows +subimages using the \-S cols:rows option. +.TP +.B \-K # +Set the vertical margin of an output page size to # +expressed in the current units when sectioning image into columns x rows +submiages using the \-S cols:rows option. +.TP +.B \-O portrait|landscape|auto +Set the output orientation of the pages or sections. +Auto will use the arrangement that requires the fewest pages. +This option is only meaningful in conjunction with the -P +option to format an image to fit on a specific paper size. +.TP +.B \-P page +Format the output images to fit on page size paper. Use +\-P list to show the supported page sizes and dimensions. +You can define a custom page size by entering the width and length of the +page in the current units with the following format #.#x#.#. +.TP +.B \-S cols:rows +Divide each image into cols across and rows down equal sections. +.TP +.B \-B +Force output to be written with Big\-Endian byte order. +This option only has an effect when the output file is created or +overwritten and not when it is appended to. +.TP +.B \-C +Suppress the use of ``strip chopping'' when reading images +that have a single strip/tile of uncompressed data. +.TP +.B \-c +Specify the compression to use for data written to the output file: +.B none +for no compression, +.B packbits +for PackBits compression, +.B lzw +for Lempel\-Ziv & Welch compression, +.B jpeg +for baseline JPEG compression. +.B zip +for Deflate compression, +.B g3 +for CCITT Group 3 (T.4) compression, +and +.B g4 +for CCITT Group 4 (T.6) compression. +By default +.I tiffcrop +will compress data according to the value of the +.I Compression +tag found in the source file. +.IP +The +.SM CCITT +Group 3 and Group 4 compression algorithms can only +be used with bilevel data. +.IP +Group 3 compression can be specified together with several +T.4\-specific options: +.B 1d +for 1\-dimensional encoding, +.B 2d +for 2\-dimensional encoding, +and +.B fill +to force each encoded scanline to be zero\-filled so that the +terminating EOL code lies on a byte boundary. +Group 3\-specific options are specified by appending a ``:''\-separated +list to the ``g3'' option; e.g. +.B "\-c g3:2d:fill" +to get 2D\-encoded data with byte\-aligned EOL codes. +.IP +.SM LZW +compression can be specified together with a +.I predictor +value. +A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value +of 1 forces each scanline to be encoded without differencing. +LZW\-specific options are specified by appending a ``:''\-separated +list to the ``lzw'' option; e.g. +.B "\-c lzw:2" +for +.SM LZW +compression with horizontal differencing. +.TP +.B \-f +Specify the bit fill order to use in writing output data. +By default, +.I tiffcrop +will create a new file with the same fill order as the original. +Specifying +.B "\-f lsb2msb" +will force data to be written with the FillOrder tag set to +.SM LSB2MSB, +while +.B "\-f msb2lsb" +will force data to be written with the FillOrder tag set to +.SM MSB2LSB. +.TP +.B \-i +Ignore non\-fatal read errors and continue processing of the input file. +.TP +.B \-l +Specify the length of a tile (in pixels). +.I Tiffcrop +attempts to set the tile dimensions so +that no more than 8 kilobytes of data appear in a tile. +.TP +.B \-L +Force output to be written with Little\-Endian byte order. +This option only has an effect when the output file is created or +overwritten and not when it is appended to. +.TP +.B \-M +Suppress the use of memory\-mapped files when reading images. +.TP +.B \-p +Specify the planar configuration to use in writing image data +that has more than one sample per pixel. +By default, +.I tiffcrop +will create a new file with the same planar configuration as +the original. +Specifying +.B "\-p contig" +will force data to be written with multi\-sample data packed +together, while +.B "\-p separate" +will force samples to be written in separate planes. +.TP +.B \-r +Specify the number of rows (scanlines) in each strip of data +written to the output file. +By default (or when value +.B 0 +is specified), +.I tiffcrop +attempts to set the rows/strip that no more than 8 kilobytes of +data appear in a strip. If you specify the special value +.B \-1 +it will results in infinite number of the rows per strip. The entire image +will be the one strip in that case. +.TP +.B \-s +Force the output file to be written with data organized in strips +(rather than tiles). +.TP +.B \-t +Force the output file to be written with data organized in tiles +(rather than strips). +.TP +.B \-w +Specify the width of a tile (in pixels). +.I tiffcrop +attempts to set the tile dimensions so +that no more than 8 kilobytes of data appear in a tile. +.I tiffcrop +attempts to set the tile dimensions so +that no more than 8 kilobytes of data appear in a tile. +.TP +Debug and dump facility +.B \-D opt1:value1,opt2:value2,opt3:value3:opt4:value4 +Display program progress and/or dump raw data to non\-TIFF files. +Options include the following and must be joined as a comma +separated list. The use of this option is generally limited to +program debugging and development of future options. An equal sign +may be substituted for the colon in option:value pairs. +.IP +debug:N Display limited program progress indicators where larger N +increase the level of detail. +.IP +format:txt|raw Format any logged data as ASCII text or raw binary +values. ASCII text dumps include strings of ones and zeroes representing +the binary values in the image data plus identifying headers. +.IP +level:N Specify the level of detail presented in the dump files. +This can vary from dumps of the entire input or output image data to dumps +of data processed by specific functions. Current range of levels is 1 to 3. +.IP +input:full\-path\-to\-directory/input\-dumpname +.IP +output:full\-path\-to\-directory/output\-dumpname +.IP +When dump files are being written, each image will be written to a separate +file with the name built by adding a numeric sequence value to the dumpname +and an extension of .txt for ASCII dumps or .bin for binary dumps. + +The four debug/dump options are independent, though it makes little sense to +specify a dump file without specifying a detail level. +.IP +Note: Tiffcrop may be compiled with -DDEVELMODE to enable additional very + low level debug reporting. +.SH "EXAMPLES" +The following concatenates two files and writes the result using +.SM LZW +encoding: +.RS +.nf +tiffcrop \-c lzw a.tif b.tif result.tif +.fi +.RE +.PP +To convert a G3 1d\-encoded +.SM TIFF +to a single strip of G4\-encoded data the following might be used: +.RS +.nf +tiffcrop \-c g4 \-r 10000 g3.tif g4.tif +.fi +.RE +(1000 is just a number that is larger than the number of rows in +the source file.) + +To extract a selected set of images from a multi\-image TIFF file +use the \-N option described above. Thus, to copy the 1st and 3rd +images of image file "album.tif" to "result.tif": +.RS +.nf +tiffcrop \-N 1,3 album.tif result.tif +.fi +.RE +.PP +Invert a bilevel image scan of a microfilmed document and crop off margins of +0.25 inches on the left and right, 0.5 inch on the top, and 0.75 inch on the +bottom. From the remaining portion of the image, select the second and third +quarters, ie, one half of the area left from the center to each margin. +.RS +tiffcrop \-U in \-m 0.5,0.25,0.75,0.25 \-E left \-Z 2:4,3:4 \-I both MicrofilmNegative.tif MicrofilmPostiveCenter.tif +.fi +.RE +.PP +Extract only the final image of a large Architectural E sized +multipage TIFF file and rotate it 90 degrees clockwise while +reformatting the output to fit on tabloid sized sheets with one +quarter of an inch on each side: +.RS +tiffcrop \-N last \-R 90 \-O auto \-P tabloid \-U in \-J 0.25 \-K 0.25 \-H 300 \-V 300 Big\-PlatMap.tif BigPlatMap\-Tabloid.tif +.fi +.RE +The output images will have a specified resolution of 300 dpi in both +directions. The orientation of each page will be determined by whichever +choice requires the fewest pages. To specify a specific orientation, use +the portrait or landscape option. The paper size option does not resample +the image. It breaks each original image into a series of smaller images +that will fit on the target paper size at the specified resolution. +.fi +.RE +.PP +Extract two regions 2048 pixels wide by 2048 pixels high from each page of +a multi\-page input file and write each region to a separate output file. +.RS +tiffcrop \-U px \-z 1,1,2048,2048:1,2049,2048,4097 \-e separate CheckScans.tiff Check +.fi +.RE +The output file names will use the stem Check with a numeric suffix which is +incremented for each region of each image, eg Check\-001.tiff, Check\-002.tiff ... +Check\-NNN.tiff. To produce a unique file for each page of the input image +with one new image for each region of the input image on that page, change +the export option to \-e multiple. + +.SH "NOTES" +.PP +In general, bilevel, grayscale, palette and RGB(A) data with bit depths +from 1 to 32 bits should work in both interleaved and separate plane +formats. Unlike tiffcp, tiffcrop can read and write tiled images with +bits per sample that are not a multiple of 8 in both interleaved and +separate planar format. Floating point data types are supported at +bit depts of 16, 24, 32 and 64 bits per sample. +.PP +Not all images can be converted from one compression scheme to another. +Data with some photometric interpretations and/or bit depths are tied to +specific compression schemes and vice-versa, e.g. Group 3/4 compression +is only usable for bilevel data. JPEG compression is only usable on 8 +bit per sample data (or 12 bit if +.I LibTIFF +was compiled with 12 bit JPEG support). Support for OJPEG compressed +images is problematic at best. Since OJPEG compression is no longer +supported for writing images with LibTIFF, these images will be updated +to the newer JPEG compression when they are copied or processed. This +may cause the image to appear color shifted or distorted after conversion. +In some cases, it is possible to remove the original compression from +image data using the option -cnone. +.PP +Tiffcrop does not currently provide options to up or downsample data to +different bit depths or convert data from one photometric interpretation +to another, e.g. 16 bits per sample to 8 bits per sample or RGB to grayscale. +.PP +Tiffcrop is very loosely derived from code in +.I tiffcp +with extensive modifications and additions to support the selection of input +images and regions and the exporting of them to one or more output files in +various groupings. The image manipulation routines are entirely new and +additional ones may be added in the future. It will handle tiled images with +bit depths that are not a multiple of eight that tiffcp may refuse to read. +.PP +.I Tiffcrop +was designed to handle large files containing many moderate sized images +with memory usage that is independent of the number of images in the file. +In order to support compression modes that are not based on individual +scanlines, e.g. JPEG, it now reads images by strip or tile rather than by +indvidual scanlines. In addition to the memory required by the input and +output buffers associated with +.I LibTIFF +one or more buffers at least as large as the largest image to be read are +required. The design favors large volume document processing uses over +scientific or graphical manipulation of large datasets as might be found +in research or remote sensing scenarios. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcmp (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR tiffsplit (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdither.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdither.1 new file mode 100644 index 0000000..ab0d32a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdither.1 @@ -0,0 +1,132 @@ +.\" $Id: tiffdither.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFDITHER 1 "September 20, 2005" "libtiff" +.SH NAME +tiffdither \- convert a greyscale image to bilevel using dithering +.SH SYNOPSIS +.B tiffdither +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I tiffdither +converts a single channel 8-bit greyscale image to a bilevel image +using Floyd-Steinberg error propagation with thresholding. +.SH OPTIONS +.TP +.B \-c +Specify the compression to use for data written to the output file: +.B none +for no compression, +.B packbits +for PackBits compression, +.B lzw +for Lempel-Ziv & Welch compression, +.B zip +for Deflate compression, +.B g3 +for CCITT Group 3 (T.4) compression, +and +.B g4 +for CCITT Group 4 (T.6) compression. +By default +.I tiffdither +will compress data according to the value of the +.I Compression +tag found in the source file. +.IP +The +.SM CCITT +Group 3 and Group 4 compression algorithms can only +be used with bilevel data. +.IP +Group 3 compression can be specified together with several +T.4-specific options: +.B 1d +for 1-dimensional encoding, +.B 2d +for 2-dimensional encoding, +and +.B fill +to force each encoded scanline to be zero-filled so that the +terminating EOL code lies on a byte boundary. +Group 3-specific options are specified by appending a ``:''-separated +list to the ``g3'' option; e.g. +.B "\-c g3:2d:fill" +to get 2D-encoded data with byte-aligned EOL codes. +.IP +.SM LZW +compression can be specified together with a +.I predictor +value. +A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value +of 1 forces each scanline to be encoded without differencing. +LZW-specific options are specified by appending a ``:''-separated +list to the ``lzw'' option; e.g. +.B "\-c lzw:2" +for +.SM LZW +compression with horizontal differencing. +.TP +.B \-f +Specify the bit fill order to use in writing output data. +By default, +.I tiffdither +will create a new file with the same fill order as the original. +Specifying +.B "\-f lsb2msb" +will force data to be written with the +.I Fill\%Order +tag set to +.SM LSB2MSB , +while +.B "\-f msb2lsb" +will force data to be written with the +.I Fill\%Order +tag set to +.SM MSB2LSB . +.TP +.B \-t +Set the threshold value for dithering. +By default the threshold value is 128. +.SH NOTES +The dither algorithm is taken from the +.BR tiffmedian (1) +program (written by Paul Heckbert). +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR fax2tiff (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiff2bw (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdump.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdump.1 new file mode 100644 index 0000000..076f9ff --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffdump.1 @@ -0,0 +1,81 @@ +.\" $Id: tiffdump.1,v 1.5 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFDUMP 1 "October 23, 2005" "libtiff" +.SH NAME +tiffdump \- print verbatim information about +.SM TIFF +files +.SH SYNOPSIS +.B tiffdump +[ +.I options +] +.I "name \&..." +.SH DESCRIPTION +.I tiffdump +displays directory information from files created according +to the Tag Image File Format, Revision 6.0. +The header of each +.SM TIFF +file (magic number, version, and first directory offset) +is displayed, followed by the tag contents of each directory in the file. +For each tag, the name, data type, count, and value(s) is displayed. +When the symbolic name for a tag or data type is known, the symbolic +name is displayed followed by it's numeric (decimal) value. +Tag values are displayed enclosed in ``<>'' characters immediately +preceded by the value of the count field. +For example, an +.I ImageWidth +tag might be displayed as ``ImageWidth (256) SHORT (3) 1<800>''. +.PP +.I tiffdump +is particularly useful for investigating the contents of +.SM TIFF +files that +.I libtiff +does not understand. +.SH OPTIONS +.TP +.B \-h +Force numeric data to be printed in hexadecimal rather than the +default decimal. +.TP +.BI \-m " items" +Change the number of indirect data items that are printed. By default, this +will be 24. +.TP +.BI \-o " offset" +Dump the contents of the +.SM IFD +at the a particular file offset. +The file offset may be specified using the usual C-style syntax; +i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal. +.SH "SEE ALSO" +.BR tiffinfo (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffgt.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffgt.1 new file mode 100644 index 0000000..680a49a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffgt.1 @@ -0,0 +1,245 @@ +.\" $Id: tiffgt.1,v 1.4 2006-04-20 12:17:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFGT 1 "September 20, 2005" "libtiff" +.SH NAME +tiffgt \- display an image stored in a +.SM TIFF +file (Silicon Graphics version) +.SH SYNOPSIS +.B tiffgt +[ +.I options +] +.I "input.tif ..." +.SH DESCRIPTION +.I tiffgt +displays one or more images stored using the +Tag Image File Format, Revision 6.0. +Each image is placed in a fixed size window that the +user must position on the display (unless configured +otherwise through X defaults). +If the display has fewer than 24 bitplanes, or if the +image does not warrant full color, then +.SM RGB +color values are mapped to the closest values that exist in +the colormap (this is done using the +.I rgbi +routine found in the graphics utility library +.BR \-lgutil .) +.PP +.I tiffgt +correctly handles files with any of the following characteristics: +.sp .5 +.in +0.5i +.ta \w'\fIPhotometricInterpretation\fP 'u +.nf +\fIBitsPerSample\fP 1, 2, 4, 8, 16 +\fISamplesPerPixel\fP 1, 3, 4 (the 4th sample is ignored) +\fIPhotometricInterpretation\fP 0 (min-is-white), 1 (min-is-black), 2 (RGB), 3 (palette), 6 (YCbCr) +\fIPlanarConfiguration\fP 1 (contiguous), 2 (separate) +\fIOrientation\fP 1 (top-left), 4 (bottom-left) +.fi +.in -0.5i +.sp .5 +Data may be organized as strips or tiles and may be +compressed with any of the compression algorithms supported +by the +.IR libtiff (3) +library. +.PP +For palette images (\c +.IR PhotometricInterpretation =3), +.I tiffgt +inspects the colormap values and assumes either 16-bit +or 8-bit values according to the maximum value. +That is, if no colormap entry greater than 255 is found, +.I tiffgt +assumes the colormap has only 8-bit values; otherwise +it assumes 16-bit values. +This inspection is done to handle old images written by +previous (incorrect) versions of +.IR libtiff . +.PP +.I tiffgt +can be used to display multiple images one-at-a-time. +The left mouse button switches the display to the first image in the +.I next +file in the list of files specified on the command line. +The right mouse button switches to the first image in the +.I previous +file in the list. +The middle mouse button causes the first image in the first file +specified on the command line to be displayed. +In addition the following keyboard commands are recognized: +.TP +.B b +Use a +.I PhotometricInterpretation +of MinIsBlack in displaying the current image. +.TP +.B l +Use a +.I FillOrder +of lsb-to-msb in decoding the current image. +.TP +.B m +Use a +.I FillOrder +of msb-to-lsb in decoding the current image. +.TP +.B c +Use a colormap visual to display the current image. +.TP +.B r +Use a true color (24-bit RGB) visual to display the current image. +.TP +.B w +Use a +.I PhotometricInterpretation +of MinIsWhite in displaying the current image. +.TP +.B W +Toggle (enable/disable) display of warning messages from the +.SM TIFF +library when decoding images. +.TP +.B E +Toggle (enable/disable) display of error messages from the +.SM TIFF +library when decoding images. +.TP +.B z +Reset all parameters to their default settings (\c +.IR FillOrder , +.IR PhotometricInterpretation , +handling of warnings and errors). +.TP +.B PageUp +Display the previous image in the current file or the last +image in the previous file. +.TP +.B PageDown +Display the next image in the current file or the first image +in the next file. +.TP +.B Home +Display the first image in the current file. +.TP +.B End +Display the last image in the current file (unimplemented). +.SH OPTIONS +.TP +.B \-c +Force image display in a colormap window. +.TP +.B \-d +Specify an image to display by directory number. +By default the first image in the file is displayed. +Directories are numbered starting at zero. +.TP +.B \-e +Enable reporting of error messages from the +.SM TIFF +library. +By default +.I tiffgt +silently ignores images that cannot be read. +.TP +.B \-f +Force +.I tiffgt +to run as a foreground process. +By default +.I tiffgt +will place itself in the background once it has opened the +requested image file. +.TP +.B \-l +Force the presumed bit ordering to be +.SM LSB +to +.SM MSB. +.TP +.B \-m +Force the presumed bit ordering to be +.SM MSB +to +.SM LSB. +.TP +.B \-o +Specify an image to display by directory offset. +By default the first image in the file is displayed. +Directories offsets may be specified using C-style syntax; +i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal. +.TP +.B \-p +Override the value of the +.I PhotometricInterpretation +tag; the parameter may be one of: +.BR miniswhite , +.BR minisblack , +.BR rgb , +.BR palette , +.BR mask , +.BR separated , +.BR ycbcr , +and +.BR cielab . +.TP +.B \-r +Force image display in a full color window. +.TP +.B \-s +Stop on the first read error. +By default all errors in the input data are ignored and +.I tiffgt +does it's best to display as much of an image as possible. +.TP +.B \-w +Enable reporting of warning messages from the +.SM TIFF +library. +By default +.I tiffgt +ignores warning messages generated when reading an image. +.TP +.B \-v +Place information in the title bar describing +what type of window (full color or colormap) is being +used, the name of the input file, and the directory +index of the image (if non-zero). +By default, the window type is not shown in the title bar. +.SH BUGS +Images wider and taller than the display are silently truncated to avoid +crashing old versions of the window manager. +.SH "SEE ALSO" +.BR tiffdump (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffinfo.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffinfo.1 new file mode 100644 index 0000000..2d57375 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffinfo.1 @@ -0,0 +1,88 @@ +.\" $Id: tiffinfo.1,v 1.2 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFINFO 1 "November 2, 2005" "libtiff" +.SH NAME +tiffinfo \- print information about +.SM TIFF +files +.SH SYNOPSIS +.B tiffinfo +[ +.I options +] +.I "input.tif \&..." +.SH DESCRIPTION +.I Tiffinfo +displays information about files created according +to the Tag Image File Format, Revision 6.0. +By default, the contents of each +.SM TIFF +directory in each file +is displayed, with the value of each tag shown symbolically +(where sensible). +.SH OPTIONS +.TP +.B \-c +Display the colormap and color/gray response curves, if present. +.TP +.B \-D +In addition to displaying the directory tags, +read and decompress all the data in each image (but not display it). +.TP +.B \-d +In addition to displaying the directory tags, +print each byte of decompressed data in hexadecimal. +.TP +.B \-j +Display any \s-2JPEG\s0-related tags that are present. +.TP +.B \-o +Set the initial +.SM TIFF +directory according to the specified file offset. +The file offset may be specified using the usual C-style syntax; +i.e. a leading ``0x'' for hexadecimal and a leading ``0'' for octal. +.TP +.B \-s +Display the offsets and byte counts for each data strip in a directory. +.TP +.B \-z +Enable strip chopping when reading image data. +.TP +.B \-# +Set the initial +.SM TIFF +directory to +.IR # . +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffcp (1), +.BR tiffcmp (1), +.BR tiffmedian (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffmedian.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffmedian.1 new file mode 100644 index 0000000..c584b97 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffmedian.1 @@ -0,0 +1,112 @@ +.\" $Id: tiffmedian.1,v 1.3 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1990-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFMEDIAN 1 "November 2, 2005" "libtiff" +.SH NAME +tiffmedian \- apply the median cut algorithm to data in a +.SM TIFF +file +.SH SYNOPSIS +.B tiffmedian +[ +.I options +] +.I input.tif +.I output.tif +.SH DESCRIPTION +.I tiffmedian +applies the median cut algorithm to an +.SM RGB +image in +.I input.tif +to generate a palette image that is written to +.IR output.tif . +The generated colormap has, by default, 256 entries. +The image data is quantized by mapping each +pixel to the closest color values in the colormap. +.SH OPTIONS +.TP +.B \-c +Specify the compression to use for data written to the output file: +.B none +for no compression, +.B packbits +for PackBits compression, +.B lzw +for Lempel-Ziv & Welch compression, +and +.B zip +for Deflate compression. +By default +.I tiffmedian +will compress data according to the value of the +.I Compression +tag found in the source file. +.IP +.SM LZW +compression can be specified together with a +.I predictor +value. +A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value +of 1 forces each scanline to be encoded without differencing. +LZW-specific options are specified by appending a ``:''-separated +list to the ``lzw'' option; e.g. +.B "\-c lzw:2" +for +.SM LZW +compression with horizontal differencing. +.TP +.B \-C +Specify the number of entries to use in the generated colormap. +By default all 256 entries/colors are used. +.TP +.B \-f +Apply Floyd-Steinberg dithering before selecting a colormap entry. +.TP +.B \-r +Specify the number of rows (scanlines) in each strip of data +written to the output file. +By default, +.I tiffmedian +attempts to set the rows/strip +that no more than 8 kilobytes of data appear in a strip. +.SH NOTES +This program is derived from Paul Heckbert's +.I median +program. +.SH "SEE ALSO" +.BR pal2rgb (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffcmp (1), +.BR libtiff (3TIFF) +.PP +.BR "Color Image Quantization for Frame Buffer Display", +Paul Heckbert, SIGGRAPH proceedings, 1982, pp. 297-307. +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffset.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffset.1 new file mode 100644 index 0000000..ed0d12f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffset.1 @@ -0,0 +1,96 @@ +.\" $Id: tiffset.1,v 1.5 2011-03-26 12:07:20 fwarmerdam Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSET 1 "November 21, 2004" "libtiff" +.SH NAME +tiffset \- set a field in a +.SM TIFF +header +.SH SYNOPSIS +.B tiffset +[ +.I options +] +.I filename.tif +.SH DESCRIPTION +.I Tiffset +sets the value of a +.SM TIFF +header to a specified value. +.SH OPTIONS +.TP +.BI \-d " dirnumber" +change the current directory (starting at 0). +.TP +.BI \-s " tagnumber" "\fR [\fP" " count" "\fR ]\fP" " value ..." +Set the value of the named tag to the value or values specified. +.TP +.BI \-sd " diroffset" +change the current directory by offset. +.TP +.BI \-sf " tagnumber filename" +Set the value of the tag to the contents of filename. This option is +supported for ASCII tags only. +.SH EXAMPLES +The following example sets the image description tag (270) of a.tif to +the contents of the file descrip: +.RS +.nf +tiffset \-sf 270 descrip a.tif +.fi +.RE +.PP +The following example sets the artist tag (315) of a.tif to the string +``Anonymous'': +.RS +.nf +tiffset \-s 315 Anonymous a.tif +.fi +.RE +.PP +This example sets the resolution of the file a.tif to 300 dpi: +.RS +.nf +tiffset \-s 296 2 a.tif +tiffset \-s 282 300.0 a.tif +tiffset \-s 283 300.0 a.tif +.fi +.RE +.PP +Set the photometric interpretation of the third page of a.tif to +min-is-black (ie. inverts it): +.RS +.nf +tiffset -d 2 -s 262 1 a.tif +.fi +.RE +.SH "SEE ALSO" +.BR tiffdump (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsplit.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsplit.1 new file mode 100644 index 0000000..411ebf4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsplit.1 @@ -0,0 +1,69 @@ +.\" $Id: tiffsplit.1,v 1.6 2009-08-24 19:13:40 bfriesen Exp $ +.\" +.\" Copyright (c) 1992-1997 Sam Leffler +.\" Copyright (c) 1992-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSPLIT 1 "September 20, 2005" "libtiff" +.SH NAME +tiffsplit \- split a multi-image +.SM TIFF +into single-image +.SM TIFF +files +.SH SYNOPSIS +.B tiffsplit +.I src.tif +[ +.I prefix +] +.SH DESCRIPTION +.I tiffsplit +takes a multi-directory (page) +.SM TIFF +file and creates one or more single-directory (page) +.SM TIFF +files from it. +The output files are given names created by concatenating +a prefix, a lexically ordered +suffix in the range [\fIaaa\fP-\fIzzz\fP], the suffix +.I .tif +(e.g. +.IR xaaa.tif , +.IR xaab.tif , +.IR ... , +.IR xzzz.tif ). +If a prefix is not specified on the command line, +the default prefix of +.I x +is used. +.SH OPTIONS +None. +.SH BUGS +Only a select set of ``known tags'' is copied when splitting. +.SH "SEE ALSO" +.BR tiffcp (1), +.BR tiffinfo (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsv.1 b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsv.1 new file mode 100644 index 0000000..206df56 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/man/tiffsv.1 @@ -0,0 +1,142 @@ +.\" $Id: tiffsv.1,v 1.3 2005-11-02 11:07:19 dron Exp $ +.\" +.\" Copyright (c) 1988-1997 Sam Leffler +.\" Copyright (c) 1991-1997 Silicon Graphics, Inc. +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that (i) the above copyright notices and this permission notice appear in +.\" all copies of the software and related documentation, and (ii) the names of +.\" Sam Leffler and Silicon Graphics may not be used in any advertising or +.\" publicity relating to the software without the specific, prior written +.\" permission of Sam Leffler and Silicon Graphics. +.\" +.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +.\" +.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +.\" OF THIS SOFTWARE. +.\" +.if n .po 0 +.TH TIFFSV 1 "September 20, 2005" "libtiff" +.SH NAME +tiffsv \- save an image from the framebuffer in a +.SM TIFF +file (Silicon Graphics version) +.SH SYNOPSIS +.B tiffsv +[ +.I options +] +.I output.tif +[ +.I "x1 x2 y1 y2" +] +.SH DESCRIPTION +.I tiffsv +saves all or part of the framebuffer in a file using the +Tag Image File Format, Revision 6.0. +By default, the image is saved with data samples packed (\c +.IR PlanarConfiguration =1), +compressed with the Lempel-Ziv & Welch algorithm (\c +.IR Compression =5), +and with each strip no more than 8 kilobytes. +These characteristics can be overridden, or explicitly specified +with the options described below. +.SH OPTIONS +.TP +.B \-b +Save the image as a greyscale image +as if it were processed by +.IR tiff2bw (1). +This option is included for compatibility with the standard +.IR scrsave (6D) +program. +.TP +.B \-c +Specify the compression to use for data written to the output file: +.B none +for no compression, +.B packbits +for PackBits compression, +.B jpeg +for baseline JPEG compression, +.B zip +for Deflate compression, +and +.B lzw +for Lempel-Ziv & Welch compression (default). +.IP +.SM LZW +compression can be specified together with a +.I predictor +value. +A predictor value of 2 causes +each scanline of the output image to undergo horizontal +differencing before it is encoded; a value +of 1 forces each scanline to be encoded without differencing. +LZW-specific options are specified by appending a ``:''-separated +list to the ``lzw'' option; e.g. +.B "\-c lzw:2" +for +.SM LZW +compression with horizontal differencing. +.TP +.B \-p +Specify the planar configuration to use in writing image data. +By default, +.I tiffsv +will create a new file with the data samples packed contiguously. +Specifying +.B "\-p contig" +will force data to be written with multi-sample data packed +together, while +.B "\-p separate" +will force samples to be written in separate planes. +.TP +.B \-r +Specify the number of rows (scanlines) in each strip of data +written to the output file. +By default, +.I tiffsv +attempts to set the rows/strip +that no more than 8 kilobytes of data appear in a strip. +.SH NOTE +Except for the use of +.SM TIFF, +this program is equivalent to the standard +.I scrsave +program. +This means, for example, that you can use it in conjunction with +the standard +.IR icut +program simply by creating a link called +.IR scrsave , +or by creating a shell script called +.I scrsave +that invokes +.I tiffgt +with the appropriate options. +.SH BUGS +If data are saved compressed and in separate planes, then the +rows in each strip is silently set to one to avoid limitations +in the +.BR libtiff (3TIFF) +library. +.SH "SEE ALSO" +.BR scrsave (6D) +.BR pal2rgb (1), +.BR tiffdump (1), +.BR tiffgt (1), +.BR tiffinfo (1), +.BR tiffcp (1), +.BR tiffmedian (1), +.BR libtiff (3TIFF) +.PP +Libtiff library home page: +.BR http://www.remotesensing.org/libtiff/ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/nmake.opt b/thirdparty/LibTIFF/tiff-4.0.3/nmake.opt new file mode 100644 index 0000000..e31f711 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/nmake.opt @@ -0,0 +1,218 @@ +# $Id: nmake.opt,v 1.18 2006/06/07 16:33:45 dron Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Compile time parameters for MS Visual C++ compiler. +# You may edit this file to specify building options. + +# +###### Edit the following lines to choose a feature set you need. ####### +# + +# +# Select WINMODE_CONSOLE to build a library which reports errors to stderr, or +# WINMODE_WINDOWED to build such that errors are reported via MessageBox(). +# +WINMODE_CONSOLE = 1 +#WINMODE_WINDOWED = 1 + +# +# Comment out the following lines to disable internal codecs. +# +# Support for CCITT Group 3 & 4 algorithms +CCITT_SUPPORT = 1 +# Support for Macintosh PackBits algorithm +PACKBITS_SUPPORT = 1 +# Support for LZW algorithm +LZW_SUPPORT = 1 +# Support for ThunderScan 4-bit RLE algorithm +THUNDER_SUPPORT = 1 +# Support for NeXT 2-bit RLE algorithm +NEXT_SUPPORT = 1 +# Support for LogLuv high dynamic range encoding +LOGLUV_SUPPORT = 1 + +# +# Uncomment and edit following lines to enable JPEG support. +# +JPEG_SUPPORT = 1 +JPEGDIR = C:/depot/sdk/LibJPEG/jpeg-9 +JPEG_INCLUDE = -I$(JPEGDIR) +JPEG_LIB = $(JPEGDIR)/lib/libjpeg.lib + +# +# Uncomment and edit following lines to enable ZIP support +# (required for Deflate compression and Pixar log-format) +# +ZIP_SUPPORT = 1 +ZLIBDIR = C:/depot/sdk/zlib/zlib-1.2.7 +ZLIB_INCLUDE = -I$(ZLIBDIR) +ZLIB_LIB = $(ZLIBDIR)/lib/zlib.lib + +# +# Uncomment and edit following lines to enable ISO JBIG support +# +#JBIG_SUPPORT = 1 +#JBIGDIR = d:/projects/jbigkit +#JBIG_INCLUDE = -I$(JBIGDIR)/libjbig +#JBIG_LIB = $(JBIGDIR)/libjbig/jbig.lib + +# +# Uncomment following line to enable Pixar log-format algorithm +# (Zlib required). +# +#PIXARLOG_SUPPORT = 1 + +# +# Comment out the following lines to disable strip chopping +# (whether or not to convert single-strip uncompressed images to mutiple +# strips of specified size to reduce memory usage). Default strip size +# is 8192 bytes, it can be configured via the STRIP_SIZE_DEFAULT parameter +# +STRIPCHOP_SUPPORT = 1 +STRIP_SIZE_DEFAULT = 8192 + +# +# Comment out the following lines to disable treating the fourth sample with +# no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA +# files but don't mark the alpha properly. +# +EXTRASAMPLE_AS_ALPHA_SUPPORT = 1 + +# +# Comment out the following lines to disable picking up YCbCr subsampling +# info from the JPEG data stream to support files lacking the tag. +# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details. +# +CHECK_JPEG_YCBCR_SUBSAMPLING = 1 + +# +####################### Compiler related options. ####################### +# + +# +# Pick debug or optimized build flags. We default to an optimized build +# with no debugging information. +# NOTE: /EHsc option required if you want to build the C++ stream API +# +OPTFLAGS = /Ox /MD /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE +#OPTFLAGS = /Zi + +# +# Uncomment following line to enable using Windows Common RunTime Library +# instead of Windows specific system calls. See notes on top of tif_unix.c +# module for details. +# +USE_WIN_CRT_LIB = 1 + +# Compiler specific options. You may probably want to adjust compilation +# parameters in CFLAGS variable. Refer to your compiler documentation +# for the option reference. +# +MAKE = nmake /nologo +CC = cl /nologo +CXX = cl /nologo +AR = lib /nologo +LD = link /nologo + +CFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS) +CXXFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS) +EXTRAFLAGS = +LIBS = + +# Name of the output shared library +DLLNAME = libtiff.dll + +# +########### There is nothing to edit below this line normally. ########### +# + +# Set the native cpu bit order +EXTRAFLAGS = -DFILLODER_LSB2MSB $(EXTRAFLAGS) + +!IFDEF WINMODE_WINDOWED +EXTRAFLAGS = -DTIF_PLATFORM_WINDOWED $(EXTRAFLAGS) +LIBS = user32.lib $(LIBS) +!ELSE +EXTRAFLAGS = -DTIF_PLATFORM_CONSOLE $(EXTRAFLAGS) +!ENDIF + +# Codec stuff +!IFDEF CCITT_SUPPORT +EXTRAFLAGS = -DCCITT_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF PACKBITS_SUPPORT +EXTRAFLAGS = -DPACKBITS_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF LZW_SUPPORT +EXTRAFLAGS = -DLZW_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF THUNDER_SUPPORT +EXTRAFLAGS = -DTHUNDER_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF NEXT_SUPPORT +EXTRAFLAGS = -DNEXT_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF LOGLUV_SUPPORT +EXTRAFLAGS = -DLOGLUV_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF JPEG_SUPPORT +LIBS = $(LIBS) $(JPEG_LIB) +EXTRAFLAGS = -DJPEG_SUPPORT -DOJPEG_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF ZIP_SUPPORT +LIBS = $(LIBS) $(ZLIB_LIB) +EXTRAFLAGS = -DZIP_SUPPORT $(EXTRAFLAGS) +!IFDEF PIXARLOG_SUPPORT +EXTRAFLAGS = -DPIXARLOG_SUPPORT $(EXTRAFLAGS) +!ENDIF +!ENDIF + +!IFDEF JBIG_SUPPORT +LIBS = $(LIBS) $(JBIG_LIB) +EXTRAFLAGS = -DJBIG_SUPPORT $(EXTRAFLAGS) +!ENDIF + +!IFDEF STRIPCHOP_SUPPORT +EXTRAFLAGS = -DSTRIPCHOP_DEFAULT=TIFF_STRIPCHOP -DSTRIP_SIZE_DEFAULT=$(STRIP_SIZE_DEFAULT) $(EXTRAFLAGS) +!ENDIF + +!IFDEF EXTRASAMPLE_AS_ALPHA_SUPPORT +EXTRAFLAGS = -DDEFAULT_EXTRASAMPLE_AS_ALPHA $(EXTRAFLAGS) +!ENDIF + +!IFDEF CHECK_JPEG_YCBCR_SUBSAMPLING +EXTRAFLAGS = -DCHECK_JPEG_YCBCR_SUBSAMPLING $(EXTRAFLAGS) +!ENDIF + +!IFDEF USE_WIN_CRT_LIB +EXTRAFLAGS = -DAVOID_WIN32_FILEIO $(EXTRAFLAGS) +!ELSE +EXTRAFLAGS = -DUSE_WIN32_FILEIO $(EXTRAFLAGS) +!ENDIF diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.am new file mode 100644 index 0000000..94504fd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.am @@ -0,0 +1,31 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = Makefile.vc libport.h + +noinst_LTLIBRARIES = libport.la +libport_la_SOURCES = dummy.c libport.h +libport_la_LIBADD = @LTLIBOBJS@ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.in new file mode 100644 index 0000000..f268a9c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.in @@ -0,0 +1,605 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = port +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs getopt.c lfind.c \ + strcasecmp.c strtoul.c strtoull.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libport_la_DEPENDENCIES = @LTLIBOBJS@ +am_libport_la_OBJECTS = dummy.lo +libport_la_OBJECTS = $(am_libport_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libport_la_SOURCES) +DIST_SOURCES = $(libport_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = Makefile.vc libport.h +noinst_LTLIBRARIES = libport.la +libport_la_SOURCES = dummy.c libport.h +libport_la_LIBADD = @LTLIBOBJS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign port/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign port/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libport.la: $(libport_la_OBJECTS) $(libport_la_DEPENDENCIES) $(EXTRA_libport_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libport_la_OBJECTS) $(libport_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.vc new file mode 100644 index 0000000..f5c85c6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/Makefile.vc @@ -0,0 +1,43 @@ +# $Id: Makefile.vc,v 1.4 2006/03/23 14:54:02 dron Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# Makefile for MS Visual C and Watcom C compilers. +# +# To build: +# C:\libtiff\port> nmake /f makefile.vc + +!INCLUDE ..\nmake.opt + +OBJ = \ + strcasecmp.obj \ + getopt.obj + +all: libport.lib + +libport.lib: $(OBJ) + $(AR) /out:libport.lib $(OBJ) + +clean: + -del *.obj + -del *.lib + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/dummy.c b/thirdparty/LibTIFF/tiff-4.0.3/port/dummy.c new file mode 100644 index 0000000..46f93bc --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/dummy.c @@ -0,0 +1,12 @@ +/* $Id: dummy.c,v 1.3 2007/03/21 14:54:16 dron Exp $ */ + +/* + * Dummy function, just to be ensure that the library always will be created. + */ + +void +libport_dummy_function() +{ + return; +} + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/getopt.c b/thirdparty/LibTIFF/tiff-4.0.3/port/getopt.c new file mode 100644 index 0000000..6eff8ee --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/getopt.c @@ -0,0 +1,125 @@ +/* $Id: getopt.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; +__RCSID("$NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $"); +#endif + +#include +#include +#include "libport.h" + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(int argc, char * const argv[], const char *optstring) +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || *place == 0) { /* update scanning pointer */ + optreset = 0; + place = argv[optind]; + if (optind >= argc || *place++ != '-') { + /* Argument is absent or is not an option */ + place = EMSG; + return (-1); + } + optopt = *place++; + if (optopt == '-' && *place == 0) { + /* "--" => end of options */ + ++optind; + place = EMSG; + return (-1); + } + if (optopt == 0) { + /* Solitary '-', treat as a '-' option + if the program (eg su) is looking for it. */ + place = EMSG; + if (strchr(optstring, '-') == NULL) + return -1; + optopt = '-'; + } + } else + optopt = *place++; + + /* See if option letter is one the caller wanted... */ + if (optopt == ':' || (oli = strchr(optstring, optopt)) == NULL) { + if (*place == 0) + ++optind; + if (opterr && *optstring != ':') + (void)fprintf(stderr, + "unknown option -- %c\n", optopt); + return (BADCH); + } + + /* Does this option need an argument? */ + if (oli[1] != ':') { + /* don't need argument */ + optarg = NULL; + if (*place == 0) + ++optind; + } else { + /* Option-argument is either the rest of this argument or the + entire next argument. */ + if (*place) + optarg = place; + else if (argc > ++optind) + optarg = argv[optind]; + else { + /* option-argument absent */ + place = EMSG; + if (*optstring == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "option requires an argument -- %c\n", + optopt); + return (BADCH); + } + place = EMSG; + ++optind; + } + return (optopt); /* return option letter */ +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/lfind.c b/thirdparty/LibTIFF/tiff-4.0.3/port/lfind.c new file mode 100644 index 0000000..64b261c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/lfind.c @@ -0,0 +1,62 @@ +/* $Id: lfind.c,v 1.4 2007/01/15 18:40:39 mloskot Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Roger L. Snyder. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $"); +#endif + +#ifdef _WIN32_WCE +# include +#else +# include +#endif + +#ifndef NULL +# define NULL 0 +#endif + +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(element, key)) /* key found */ + return element; + + return NULL; +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/libport.h b/thirdparty/LibTIFF/tiff-4.0.3/port/libport.h new file mode 100644 index 0000000..802f478 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/libport.h @@ -0,0 +1,51 @@ +/* $Id: libport.h,v 1.2 2009-11-02 14:44:13 bfriesen Exp $ */ + +/* + * Copyright (c) 2009 Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _LIBPORT_ +#define _LIBPORT_ + +int getopt(int argc, char * const argv[], const char *optstring); +extern char *optarg; +extern int opterr; +extern int optind; +extern int optopt; + +int strcasecmp(const char *s1, const char *s2); + +#ifndef HAVE_GETOPT +# define HAVE_GETOPT 1 +#endif + +#if 0 +unsigned long strtoul(const char *nptr, char **endptr, int base); +#endif + +#if 0 +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)); +#endif + +#endif /* ndef _LIBPORT_ */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/strcasecmp.c b/thirdparty/LibTIFF/tiff-4.0.3/port/strcasecmp.c new file mode 100644 index 0000000..1ff4312 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/strcasecmp.c @@ -0,0 +1,51 @@ +/* $Id: strcasecmp.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: strcasecmp.c,v 1.16 2003/08/07 16:43:49 agc Exp $"); +#endif + +#include +#include +#include "libport.h" + +int +strcasecmp(const char *s1, const char *s2) +{ + const unsigned char *us1 = (const unsigned char *)s1, + *us2 = (const unsigned char *)s2; + + while (tolower(*us1) == tolower(*us2++)) + if (*us1++ == '\0') + return (0); + return (tolower(*us1) - tolower(*--us2)); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/strtoul.c b/thirdparty/LibTIFF/tiff-4.0.3/port/strtoul.c new file mode 100644 index 0000000..f7a9a1a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/strtoul.c @@ -0,0 +1,109 @@ +/* $Id: strtoul.c,v 1.2 2005/07/07 16:34:06 dron Exp $ */ + +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: strtoul.c,v 1.16 2003/08/07 16:43:45 agc Exp $"); +#endif + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +strtoul(const char *nptr, char **endptr, int base) +{ + const char *s; + unsigned long acc, cutoff; + int c; + int neg, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + s = nptr; + do { + c = (unsigned char) *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + cutoff = ULONG_MAX / (unsigned long)base; + cutlim = (int)(ULONG_MAX % (unsigned long)base); + for (acc = 0, any = 0;; c = (unsigned char) *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0) + continue; + if (acc > cutoff || (acc == cutoff && c > cutlim)) { + any = -1; + acc = ULONG_MAX; + errno = ERANGE; + } else { + any = 1; + acc *= (unsigned long)base; + acc += c; + } + } + if (neg && any > 0) + acc = -acc; + if (endptr != 0) + /* LINTED interface specification */ + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/port/strtoull.c b/thirdparty/LibTIFF/tiff-4.0.3/port/strtoull.c new file mode 100644 index 0000000..fb7739c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/port/strtoull.c @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long long +strtoull(const char *nptr, char **endptr, int base) +{ + const char *s; + unsigned long long acc; + char c; + unsigned long long cutoff; + int neg, any, cutlim; + + /* + * See strtoq for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace((unsigned char)c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULLONG_MAX / base; + cutlim = ULLONG_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.sln b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.sln new file mode 100644 index 0000000..8b4a05b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibTIFF", "LibTIFF.vcxproj", "{626FB2FD-B416-4A11-B899-BF1A847EAF81}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Debug|Win32.ActiveCfg = Debug|Win32 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Debug|Win32.Build.0 = Debug|Win32 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Debug|x64.ActiveCfg = Debug|x64 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Debug|x64.Build.0 = Debug|x64 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Release|Win32.ActiveCfg = Release|Win32 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Release|Win32.Build.0 = Release|Win32 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Release|x64.ActiveCfg = Release|x64 + {626FB2FD-B416-4A11-B899-BF1A847EAF81}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj new file mode 100644 index 0000000..a2a3314 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj @@ -0,0 +1,177 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {626FB2FD-B416-4A11-B899-BF1A847EAF81} + LibTIFF + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + ../../../../LibJPEG/jpeg-9;../../../../zlib/zlib-1.2.7;%(AdditionalIncludeDirectories) + + + true + + + + + Level3 + Disabled + ../../../../LibJPEG/jpeg-9;../../../../zlib/zlib-1.2.7;%(AdditionalIncludeDirectories) + + + true + + + + + Level3 + MaxSpeed + true + true + ../../../../LibJPEG/jpeg-9;../../../../zlib/zlib-1.2.7;%(AdditionalIncludeDirectories) + + + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + ../../../../LibJPEG/jpeg-9;../../../../zlib/zlib-1.2.7;%(AdditionalIncludeDirectories) + + + + + true + true + true + + + + + + \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj.filters b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj.filters new file mode 100644 index 0000000..b38911e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/prj/LibTIFF/LibTIFF.vcxproj.filters @@ -0,0 +1,180 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.am new file mode 100644 index 0000000..4e115c9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.am @@ -0,0 +1,292 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign + +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +# Environment parameters to be used during tests +TESTS_ENVIRONMENT = \ + MAKE="$(MAKE)" \ + MAKEFLAGS="$(MAKEFLAGS)" \ + MEMCHECK="$(MEMCHECK)" + +EXTRA_DIST = \ + $(TESTSCRIPTS) \ + $(IMAGES_EXTRA_DIST) \ + common.sh + +# All of the tests to execute via 'make check' +TESTS = $(check_PROGRAMS) $(TESTSCRIPTS) + +# Tests which are expected to fail +XFAIL_TESTS = + +# Extra files which should be cleaned by 'make clean' +CLEANFILES = test_packbits.tif o-* + +# Executable programs which need to be built in order to support tests +check_PROGRAMS = ascii_tag long_tag short_tag strip_rw rewrite raw_decode custom_dir + +# Test scripts to execute +TESTSCRIPTS = \ + bmp2tiff_palette.sh \ + bmp2tiff_rgb.sh \ + gif2tiff.sh \ + ppm2tiff_pbm.sh \ + ppm2tiff_pgm.sh \ + ppm2tiff_ppm.sh \ + tiffcp-g3.sh \ + tiffcp-g3-1d.sh \ + tiffcp-g3-1d-fill.sh \ + tiffcp-g3-2d.sh \ + tiffcp-g3-2d-fill.sh \ + tiffcp-g4.sh \ + tiffcp-logluv.sh \ + tiffcp-thumbnail.sh \ + tiffdump.sh \ + tiffinfo.sh \ + tiffcp-split.sh \ + tiffcp-split-join.sh \ + tiff2ps-PS1.sh \ + tiff2ps-PS2.sh \ + tiff2ps-PS3.sh \ + tiff2ps-EPS1.sh \ + tiff2pdf.sh \ + tiffcrop-doubleflip-logluv-3c-16b.sh \ + tiffcrop-doubleflip-minisblack-1c-16b.sh \ + tiffcrop-doubleflip-minisblack-1c-8b.sh \ + tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \ + tiffcrop-doubleflip-miniswhite-1c-1b.sh \ + tiffcrop-doubleflip-palette-1c-1b.sh \ + tiffcrop-doubleflip-palette-1c-4b.sh \ + tiffcrop-doubleflip-palette-1c-8b.sh \ + tiffcrop-doubleflip-rgb-3c-16b.sh \ + tiffcrop-doubleflip-rgb-3c-8b.sh \ + tiffcrop-extract-logluv-3c-16b.sh \ + tiffcrop-extract-minisblack-1c-16b.sh \ + tiffcrop-extract-minisblack-1c-8b.sh \ + tiffcrop-extract-minisblack-2c-8b-alpha.sh \ + tiffcrop-extract-miniswhite-1c-1b.sh \ + tiffcrop-extract-palette-1c-1b.sh \ + tiffcrop-extract-palette-1c-4b.sh \ + tiffcrop-extract-palette-1c-8b.sh \ + tiffcrop-extract-rgb-3c-16b.sh \ + tiffcrop-extract-rgb-3c-8b.sh \ + tiffcrop-extractz14-logluv-3c-16b.sh \ + tiffcrop-extractz14-minisblack-1c-16b.sh \ + tiffcrop-extractz14-minisblack-1c-8b.sh \ + tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \ + tiffcrop-extractz14-miniswhite-1c-1b.sh \ + tiffcrop-extractz14-palette-1c-1b.sh \ + tiffcrop-extractz14-palette-1c-4b.sh \ + tiffcrop-extractz14-palette-1c-8b.sh \ + tiffcrop-extractz14-rgb-3c-16b.sh \ + tiffcrop-extractz14-rgb-3c-8b.sh \ + tiffcrop-R90-logluv-3c-16b.sh \ + tiffcrop-R90-minisblack-1c-16b.sh \ + tiffcrop-R90-minisblack-1c-8b.sh \ + tiffcrop-R90-minisblack-2c-8b-alpha.sh \ + tiffcrop-R90-miniswhite-1c-1b.sh \ + tiffcrop-R90-palette-1c-1b.sh \ + tiffcrop-R90-palette-1c-4b.sh \ + tiffcrop-R90-palette-1c-8b.sh \ + tiffcrop-R90-rgb-3c-16b.sh \ + tiffcrop-R90-rgb-3c-8b.sh \ + tiff2rgba-logluv-3c-16b.sh \ + tiff2rgba-minisblack-1c-16b.sh \ + tiff2rgba-minisblack-1c-8b.sh \ + tiff2rgba-minisblack-2c-8b-alpha.sh \ + tiff2rgba-miniswhite-1c-1b.sh \ + tiff2rgba-palette-1c-1b.sh \ + tiff2rgba-palette-1c-4b.sh \ + tiff2rgba-palette-1c-8b.sh \ + tiff2rgba-rgb-3c-16b.sh \ + tiff2rgba-rgb-3c-8b.sh \ + tiff2rgba-quad-tile.jpg.sh + +# This list should contain all of the TIFF files in the 'images' +# subdirectory which are intended to be used as input images for +# tests. All of these files should use the extension ".tiff". +TIFFIMAGES = \ + images/logluv-3c-16b.tiff \ + images/minisblack-1c-16b.tiff \ + images/minisblack-1c-8b.tiff \ + images/minisblack-2c-8b-alpha.tiff \ + images/miniswhite-1c-1b.tiff \ + images/palette-1c-1b.tiff \ + images/palette-1c-4b.tiff \ + images/palette-1c-8b.tiff \ + images/rgb-3c-16b.tiff \ + images/rgb-3c-8b.tiff \ + images/quad-tile.jpg.tiff + +BMPIMAGES = \ + images/palette-1c-8b.bmp \ + images/rgb-3c-8b.bmp + +GIFIMAGES = \ + images/palette-1c-8b.gif + +PNMIMAGES = \ + images/minisblack-1c-8b.pgm \ + images/miniswhite-1c-1b.pbm \ + images/rgb-3c-8b.ppm + +# This list should include all of the files in the 'images' +# subdirectory which are intended to be distributed. This may include +# files which are not currently used by the tests. +IMAGES_EXTRA_DIST = \ + images/README.txt \ + $(BMPIMAGES) \ + $(GIFIMAGES) \ + $(PNMIMAGES) \ + $(TIFFIMAGES) + +noinst_HEADERS = tifftest.h + +ascii_tag_SOURCES = ascii_tag.c +ascii_tag_LDADD = $(LIBTIFF) +long_tag_SOURCES = long_tag.c check_tag.c +long_tag_LDADD = $(LIBTIFF) +short_tag_SOURCES = short_tag.c check_tag.c +short_tag_LDADD = $(LIBTIFF) +strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h +strip_rw_LDADD = $(LIBTIFF) +rewrite_SOURCES = rewrite_tag.c +rewrite_LDADD = $(LIBTIFF) +raw_decode_SOURCES = raw_decode.c +raw_decode_LDADD = $(LIBTIFF) +custom_dir_SOURCES = custom_dir.c +custom_dir_LDADD = $(LIBTIFF) + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff + +# memcheck: valgrind's memory access checker +memcheck: + $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check + +# ptrcheck: valgrind's experimental pointer checking tool. +ptrcheck: + $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check + +generate-tiff2rgba-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiff2rgba-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test rotations +generate-tiffcrop-R90-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test flip (mirror) +generate-tiffcrop-doubleflip-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test extracting a section 100 pixels wide and 100 pixels high +generate-tiffcrop-extract-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test extracting the first and fourth quarters from the left side. +generate-tiffcrop-extractz14-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +generate-tiffcrop-tests: \ + generate-tiffcrop-R90-tests \ + generate-tiffcrop-doubleflip-tests \ + generate-tiffcrop-extract-tests \ + generate-tiffcrop-extractz14-tests + +generate-tests: \ + generate-tiff2rgba-tests \ + generate-tiffcrop-tests diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.in new file mode 100644 index 0000000..0e40087 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/Makefile.in @@ -0,0 +1,1843 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +XFAIL_TESTS = +check_PROGRAMS = ascii_tag$(EXEEXT) long_tag$(EXEEXT) \ + short_tag$(EXEEXT) strip_rw$(EXEEXT) rewrite$(EXEEXT) \ + raw_decode$(EXEEXT) custom_dir$(EXEEXT) +subdir = test +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs \ + $(top_srcdir)/config/test-driver +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_ascii_tag_OBJECTS = ascii_tag.$(OBJEXT) +ascii_tag_OBJECTS = $(am_ascii_tag_OBJECTS) +ascii_tag_DEPENDENCIES = $(LIBTIFF) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_custom_dir_OBJECTS = custom_dir.$(OBJEXT) +custom_dir_OBJECTS = $(am_custom_dir_OBJECTS) +custom_dir_DEPENDENCIES = $(LIBTIFF) +am_long_tag_OBJECTS = long_tag.$(OBJEXT) check_tag.$(OBJEXT) +long_tag_OBJECTS = $(am_long_tag_OBJECTS) +long_tag_DEPENDENCIES = $(LIBTIFF) +am_raw_decode_OBJECTS = raw_decode.$(OBJEXT) +raw_decode_OBJECTS = $(am_raw_decode_OBJECTS) +raw_decode_DEPENDENCIES = $(LIBTIFF) +am_rewrite_OBJECTS = rewrite_tag.$(OBJEXT) +rewrite_OBJECTS = $(am_rewrite_OBJECTS) +rewrite_DEPENDENCIES = $(LIBTIFF) +am_short_tag_OBJECTS = short_tag.$(OBJEXT) check_tag.$(OBJEXT) +short_tag_OBJECTS = $(am_short_tag_OBJECTS) +short_tag_DEPENDENCIES = $(LIBTIFF) +am_strip_rw_OBJECTS = strip_rw.$(OBJEXT) strip.$(OBJEXT) \ + test_arrays.$(OBJEXT) +strip_rw_OBJECTS = $(am_strip_rw_OBJECTS) +strip_rw_DEPENDENCIES = $(LIBTIFF) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(ascii_tag_SOURCES) $(custom_dir_SOURCES) \ + $(long_tag_SOURCES) $(raw_decode_SOURCES) $(rewrite_SOURCES) \ + $(short_tag_SOURCES) $(strip_rw_SOURCES) +DIST_SOURCES = $(ascii_tag_SOURCES) $(custom_dir_SOURCES) \ + $(long_tag_SOURCES) $(raw_decode_SOURCES) $(rewrite_SOURCES) \ + $(short_tag_SOURCES) $(strip_rw_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +# Environment parameters to be used during tests +TESTS_ENVIRONMENT = \ + MAKE="$(MAKE)" \ + MAKEFLAGS="$(MAKEFLAGS)" \ + MEMCHECK="$(MEMCHECK)" + +EXTRA_DIST = \ + $(TESTSCRIPTS) \ + $(IMAGES_EXTRA_DIST) \ + common.sh + + +# All of the tests to execute via 'make check' +TESTS = $(check_PROGRAMS) $(TESTSCRIPTS) + +# Extra files which should be cleaned by 'make clean' +CLEANFILES = test_packbits.tif o-* + +# Test scripts to execute +TESTSCRIPTS = \ + bmp2tiff_palette.sh \ + bmp2tiff_rgb.sh \ + gif2tiff.sh \ + ppm2tiff_pbm.sh \ + ppm2tiff_pgm.sh \ + ppm2tiff_ppm.sh \ + tiffcp-g3.sh \ + tiffcp-g3-1d.sh \ + tiffcp-g3-1d-fill.sh \ + tiffcp-g3-2d.sh \ + tiffcp-g3-2d-fill.sh \ + tiffcp-g4.sh \ + tiffcp-logluv.sh \ + tiffcp-thumbnail.sh \ + tiffdump.sh \ + tiffinfo.sh \ + tiffcp-split.sh \ + tiffcp-split-join.sh \ + tiff2ps-PS1.sh \ + tiff2ps-PS2.sh \ + tiff2ps-PS3.sh \ + tiff2ps-EPS1.sh \ + tiff2pdf.sh \ + tiffcrop-doubleflip-logluv-3c-16b.sh \ + tiffcrop-doubleflip-minisblack-1c-16b.sh \ + tiffcrop-doubleflip-minisblack-1c-8b.sh \ + tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \ + tiffcrop-doubleflip-miniswhite-1c-1b.sh \ + tiffcrop-doubleflip-palette-1c-1b.sh \ + tiffcrop-doubleflip-palette-1c-4b.sh \ + tiffcrop-doubleflip-palette-1c-8b.sh \ + tiffcrop-doubleflip-rgb-3c-16b.sh \ + tiffcrop-doubleflip-rgb-3c-8b.sh \ + tiffcrop-extract-logluv-3c-16b.sh \ + tiffcrop-extract-minisblack-1c-16b.sh \ + tiffcrop-extract-minisblack-1c-8b.sh \ + tiffcrop-extract-minisblack-2c-8b-alpha.sh \ + tiffcrop-extract-miniswhite-1c-1b.sh \ + tiffcrop-extract-palette-1c-1b.sh \ + tiffcrop-extract-palette-1c-4b.sh \ + tiffcrop-extract-palette-1c-8b.sh \ + tiffcrop-extract-rgb-3c-16b.sh \ + tiffcrop-extract-rgb-3c-8b.sh \ + tiffcrop-extractz14-logluv-3c-16b.sh \ + tiffcrop-extractz14-minisblack-1c-16b.sh \ + tiffcrop-extractz14-minisblack-1c-8b.sh \ + tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \ + tiffcrop-extractz14-miniswhite-1c-1b.sh \ + tiffcrop-extractz14-palette-1c-1b.sh \ + tiffcrop-extractz14-palette-1c-4b.sh \ + tiffcrop-extractz14-palette-1c-8b.sh \ + tiffcrop-extractz14-rgb-3c-16b.sh \ + tiffcrop-extractz14-rgb-3c-8b.sh \ + tiffcrop-R90-logluv-3c-16b.sh \ + tiffcrop-R90-minisblack-1c-16b.sh \ + tiffcrop-R90-minisblack-1c-8b.sh \ + tiffcrop-R90-minisblack-2c-8b-alpha.sh \ + tiffcrop-R90-miniswhite-1c-1b.sh \ + tiffcrop-R90-palette-1c-1b.sh \ + tiffcrop-R90-palette-1c-4b.sh \ + tiffcrop-R90-palette-1c-8b.sh \ + tiffcrop-R90-rgb-3c-16b.sh \ + tiffcrop-R90-rgb-3c-8b.sh \ + tiff2rgba-logluv-3c-16b.sh \ + tiff2rgba-minisblack-1c-16b.sh \ + tiff2rgba-minisblack-1c-8b.sh \ + tiff2rgba-minisblack-2c-8b-alpha.sh \ + tiff2rgba-miniswhite-1c-1b.sh \ + tiff2rgba-palette-1c-1b.sh \ + tiff2rgba-palette-1c-4b.sh \ + tiff2rgba-palette-1c-8b.sh \ + tiff2rgba-rgb-3c-16b.sh \ + tiff2rgba-rgb-3c-8b.sh \ + tiff2rgba-quad-tile.jpg.sh + + +# This list should contain all of the TIFF files in the 'images' +# subdirectory which are intended to be used as input images for +# tests. All of these files should use the extension ".tiff". +TIFFIMAGES = \ + images/logluv-3c-16b.tiff \ + images/minisblack-1c-16b.tiff \ + images/minisblack-1c-8b.tiff \ + images/minisblack-2c-8b-alpha.tiff \ + images/miniswhite-1c-1b.tiff \ + images/palette-1c-1b.tiff \ + images/palette-1c-4b.tiff \ + images/palette-1c-8b.tiff \ + images/rgb-3c-16b.tiff \ + images/rgb-3c-8b.tiff \ + images/quad-tile.jpg.tiff + +BMPIMAGES = \ + images/palette-1c-8b.bmp \ + images/rgb-3c-8b.bmp + +GIFIMAGES = \ + images/palette-1c-8b.gif + +PNMIMAGES = \ + images/minisblack-1c-8b.pgm \ + images/miniswhite-1c-1b.pbm \ + images/rgb-3c-8b.ppm + + +# This list should include all of the files in the 'images' +# subdirectory which are intended to be distributed. This may include +# files which are not currently used by the tests. +IMAGES_EXTRA_DIST = \ + images/README.txt \ + $(BMPIMAGES) \ + $(GIFIMAGES) \ + $(PNMIMAGES) \ + $(TIFFIMAGES) + +noinst_HEADERS = tifftest.h +ascii_tag_SOURCES = ascii_tag.c +ascii_tag_LDADD = $(LIBTIFF) +long_tag_SOURCES = long_tag.c check_tag.c +long_tag_LDADD = $(LIBTIFF) +short_tag_SOURCES = short_tag.c check_tag.c +short_tag_LDADD = $(LIBTIFF) +strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h +strip_rw_LDADD = $(LIBTIFF) +rewrite_SOURCES = rewrite_tag.c +rewrite_LDADD = $(LIBTIFF) +raw_decode_SOURCES = raw_decode.c +raw_decode_LDADD = $(LIBTIFF) +custom_dir_SOURCES = custom_dir.c +custom_dir_LDADD = $(LIBTIFF) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +ascii_tag$(EXEEXT): $(ascii_tag_OBJECTS) $(ascii_tag_DEPENDENCIES) $(EXTRA_ascii_tag_DEPENDENCIES) + @rm -f ascii_tag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ascii_tag_OBJECTS) $(ascii_tag_LDADD) $(LIBS) +custom_dir$(EXEEXT): $(custom_dir_OBJECTS) $(custom_dir_DEPENDENCIES) $(EXTRA_custom_dir_DEPENDENCIES) + @rm -f custom_dir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(custom_dir_OBJECTS) $(custom_dir_LDADD) $(LIBS) +long_tag$(EXEEXT): $(long_tag_OBJECTS) $(long_tag_DEPENDENCIES) $(EXTRA_long_tag_DEPENDENCIES) + @rm -f long_tag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(long_tag_OBJECTS) $(long_tag_LDADD) $(LIBS) +raw_decode$(EXEEXT): $(raw_decode_OBJECTS) $(raw_decode_DEPENDENCIES) $(EXTRA_raw_decode_DEPENDENCIES) + @rm -f raw_decode$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(raw_decode_OBJECTS) $(raw_decode_LDADD) $(LIBS) +rewrite$(EXEEXT): $(rewrite_OBJECTS) $(rewrite_DEPENDENCIES) $(EXTRA_rewrite_DEPENDENCIES) + @rm -f rewrite$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rewrite_OBJECTS) $(rewrite_LDADD) $(LIBS) +short_tag$(EXEEXT): $(short_tag_OBJECTS) $(short_tag_DEPENDENCIES) $(EXTRA_short_tag_DEPENDENCIES) + @rm -f short_tag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(short_tag_OBJECTS) $(short_tag_LDADD) $(LIBS) +strip_rw$(EXEEXT): $(strip_rw_OBJECTS) $(strip_rw_DEPENDENCIES) $(EXTRA_strip_rw_DEPENDENCIES) + @rm -f strip_rw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(strip_rw_OBJECTS) $(strip_rw_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/custom_dir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long_tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw_decode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewrite_tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/short_tag.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strip_rw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_arrays.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# exand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all $(check_PROGRAMS) + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +ascii_tag.log: ascii_tag$(EXEEXT) + @p='ascii_tag$(EXEEXT)'; \ + b='ascii_tag'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +long_tag.log: long_tag$(EXEEXT) + @p='long_tag$(EXEEXT)'; \ + b='long_tag'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +short_tag.log: short_tag$(EXEEXT) + @p='short_tag$(EXEEXT)'; \ + b='short_tag'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +strip_rw.log: strip_rw$(EXEEXT) + @p='strip_rw$(EXEEXT)'; \ + b='strip_rw'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +rewrite.log: rewrite$(EXEEXT) + @p='rewrite$(EXEEXT)'; \ + b='rewrite'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raw_decode.log: raw_decode$(EXEEXT) + @p='raw_decode$(EXEEXT)'; \ + b='raw_decode'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +custom_dir.log: custom_dir$(EXEEXT) + @p='custom_dir$(EXEEXT)'; \ + b='custom_dir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +bmp2tiff_palette.sh.log: bmp2tiff_palette.sh + @p='bmp2tiff_palette.sh'; \ + b='bmp2tiff_palette.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +bmp2tiff_rgb.sh.log: bmp2tiff_rgb.sh + @p='bmp2tiff_rgb.sh'; \ + b='bmp2tiff_rgb.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +gif2tiff.sh.log: gif2tiff.sh + @p='gif2tiff.sh'; \ + b='gif2tiff.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +ppm2tiff_pbm.sh.log: ppm2tiff_pbm.sh + @p='ppm2tiff_pbm.sh'; \ + b='ppm2tiff_pbm.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +ppm2tiff_pgm.sh.log: ppm2tiff_pgm.sh + @p='ppm2tiff_pgm.sh'; \ + b='ppm2tiff_pgm.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +ppm2tiff_ppm.sh.log: ppm2tiff_ppm.sh + @p='ppm2tiff_ppm.sh'; \ + b='ppm2tiff_ppm.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g3.sh.log: tiffcp-g3.sh + @p='tiffcp-g3.sh'; \ + b='tiffcp-g3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g3-1d.sh.log: tiffcp-g3-1d.sh + @p='tiffcp-g3-1d.sh'; \ + b='tiffcp-g3-1d.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g3-1d-fill.sh.log: tiffcp-g3-1d-fill.sh + @p='tiffcp-g3-1d-fill.sh'; \ + b='tiffcp-g3-1d-fill.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g3-2d.sh.log: tiffcp-g3-2d.sh + @p='tiffcp-g3-2d.sh'; \ + b='tiffcp-g3-2d.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g3-2d-fill.sh.log: tiffcp-g3-2d-fill.sh + @p='tiffcp-g3-2d-fill.sh'; \ + b='tiffcp-g3-2d-fill.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-g4.sh.log: tiffcp-g4.sh + @p='tiffcp-g4.sh'; \ + b='tiffcp-g4.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-logluv.sh.log: tiffcp-logluv.sh + @p='tiffcp-logluv.sh'; \ + b='tiffcp-logluv.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-thumbnail.sh.log: tiffcp-thumbnail.sh + @p='tiffcp-thumbnail.sh'; \ + b='tiffcp-thumbnail.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffdump.sh.log: tiffdump.sh + @p='tiffdump.sh'; \ + b='tiffdump.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffinfo.sh.log: tiffinfo.sh + @p='tiffinfo.sh'; \ + b='tiffinfo.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-split.sh.log: tiffcp-split.sh + @p='tiffcp-split.sh'; \ + b='tiffcp-split.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcp-split-join.sh.log: tiffcp-split-join.sh + @p='tiffcp-split-join.sh'; \ + b='tiffcp-split-join.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2ps-PS1.sh.log: tiff2ps-PS1.sh + @p='tiff2ps-PS1.sh'; \ + b='tiff2ps-PS1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2ps-PS2.sh.log: tiff2ps-PS2.sh + @p='tiff2ps-PS2.sh'; \ + b='tiff2ps-PS2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2ps-PS3.sh.log: tiff2ps-PS3.sh + @p='tiff2ps-PS3.sh'; \ + b='tiff2ps-PS3.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2ps-EPS1.sh.log: tiff2ps-EPS1.sh + @p='tiff2ps-EPS1.sh'; \ + b='tiff2ps-EPS1.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2pdf.sh.log: tiff2pdf.sh + @p='tiff2pdf.sh'; \ + b='tiff2pdf.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-logluv-3c-16b.sh.log: tiffcrop-doubleflip-logluv-3c-16b.sh + @p='tiffcrop-doubleflip-logluv-3c-16b.sh'; \ + b='tiffcrop-doubleflip-logluv-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-minisblack-1c-16b.sh.log: tiffcrop-doubleflip-minisblack-1c-16b.sh + @p='tiffcrop-doubleflip-minisblack-1c-16b.sh'; \ + b='tiffcrop-doubleflip-minisblack-1c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-minisblack-1c-8b.sh.log: tiffcrop-doubleflip-minisblack-1c-8b.sh + @p='tiffcrop-doubleflip-minisblack-1c-8b.sh'; \ + b='tiffcrop-doubleflip-minisblack-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh.log: tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh + @p='tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh'; \ + b='tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-miniswhite-1c-1b.sh.log: tiffcrop-doubleflip-miniswhite-1c-1b.sh + @p='tiffcrop-doubleflip-miniswhite-1c-1b.sh'; \ + b='tiffcrop-doubleflip-miniswhite-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-palette-1c-1b.sh.log: tiffcrop-doubleflip-palette-1c-1b.sh + @p='tiffcrop-doubleflip-palette-1c-1b.sh'; \ + b='tiffcrop-doubleflip-palette-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-palette-1c-4b.sh.log: tiffcrop-doubleflip-palette-1c-4b.sh + @p='tiffcrop-doubleflip-palette-1c-4b.sh'; \ + b='tiffcrop-doubleflip-palette-1c-4b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-palette-1c-8b.sh.log: tiffcrop-doubleflip-palette-1c-8b.sh + @p='tiffcrop-doubleflip-palette-1c-8b.sh'; \ + b='tiffcrop-doubleflip-palette-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-rgb-3c-16b.sh.log: tiffcrop-doubleflip-rgb-3c-16b.sh + @p='tiffcrop-doubleflip-rgb-3c-16b.sh'; \ + b='tiffcrop-doubleflip-rgb-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-doubleflip-rgb-3c-8b.sh.log: tiffcrop-doubleflip-rgb-3c-8b.sh + @p='tiffcrop-doubleflip-rgb-3c-8b.sh'; \ + b='tiffcrop-doubleflip-rgb-3c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-logluv-3c-16b.sh.log: tiffcrop-extract-logluv-3c-16b.sh + @p='tiffcrop-extract-logluv-3c-16b.sh'; \ + b='tiffcrop-extract-logluv-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-minisblack-1c-16b.sh.log: tiffcrop-extract-minisblack-1c-16b.sh + @p='tiffcrop-extract-minisblack-1c-16b.sh'; \ + b='tiffcrop-extract-minisblack-1c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-minisblack-1c-8b.sh.log: tiffcrop-extract-minisblack-1c-8b.sh + @p='tiffcrop-extract-minisblack-1c-8b.sh'; \ + b='tiffcrop-extract-minisblack-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-minisblack-2c-8b-alpha.sh.log: tiffcrop-extract-minisblack-2c-8b-alpha.sh + @p='tiffcrop-extract-minisblack-2c-8b-alpha.sh'; \ + b='tiffcrop-extract-minisblack-2c-8b-alpha.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-miniswhite-1c-1b.sh.log: tiffcrop-extract-miniswhite-1c-1b.sh + @p='tiffcrop-extract-miniswhite-1c-1b.sh'; \ + b='tiffcrop-extract-miniswhite-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-palette-1c-1b.sh.log: tiffcrop-extract-palette-1c-1b.sh + @p='tiffcrop-extract-palette-1c-1b.sh'; \ + b='tiffcrop-extract-palette-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-palette-1c-4b.sh.log: tiffcrop-extract-palette-1c-4b.sh + @p='tiffcrop-extract-palette-1c-4b.sh'; \ + b='tiffcrop-extract-palette-1c-4b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-palette-1c-8b.sh.log: tiffcrop-extract-palette-1c-8b.sh + @p='tiffcrop-extract-palette-1c-8b.sh'; \ + b='tiffcrop-extract-palette-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-rgb-3c-16b.sh.log: tiffcrop-extract-rgb-3c-16b.sh + @p='tiffcrop-extract-rgb-3c-16b.sh'; \ + b='tiffcrop-extract-rgb-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extract-rgb-3c-8b.sh.log: tiffcrop-extract-rgb-3c-8b.sh + @p='tiffcrop-extract-rgb-3c-8b.sh'; \ + b='tiffcrop-extract-rgb-3c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-logluv-3c-16b.sh.log: tiffcrop-extractz14-logluv-3c-16b.sh + @p='tiffcrop-extractz14-logluv-3c-16b.sh'; \ + b='tiffcrop-extractz14-logluv-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-minisblack-1c-16b.sh.log: tiffcrop-extractz14-minisblack-1c-16b.sh + @p='tiffcrop-extractz14-minisblack-1c-16b.sh'; \ + b='tiffcrop-extractz14-minisblack-1c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-minisblack-1c-8b.sh.log: tiffcrop-extractz14-minisblack-1c-8b.sh + @p='tiffcrop-extractz14-minisblack-1c-8b.sh'; \ + b='tiffcrop-extractz14-minisblack-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-minisblack-2c-8b-alpha.sh.log: tiffcrop-extractz14-minisblack-2c-8b-alpha.sh + @p='tiffcrop-extractz14-minisblack-2c-8b-alpha.sh'; \ + b='tiffcrop-extractz14-minisblack-2c-8b-alpha.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-miniswhite-1c-1b.sh.log: tiffcrop-extractz14-miniswhite-1c-1b.sh + @p='tiffcrop-extractz14-miniswhite-1c-1b.sh'; \ + b='tiffcrop-extractz14-miniswhite-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-palette-1c-1b.sh.log: tiffcrop-extractz14-palette-1c-1b.sh + @p='tiffcrop-extractz14-palette-1c-1b.sh'; \ + b='tiffcrop-extractz14-palette-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-palette-1c-4b.sh.log: tiffcrop-extractz14-palette-1c-4b.sh + @p='tiffcrop-extractz14-palette-1c-4b.sh'; \ + b='tiffcrop-extractz14-palette-1c-4b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-palette-1c-8b.sh.log: tiffcrop-extractz14-palette-1c-8b.sh + @p='tiffcrop-extractz14-palette-1c-8b.sh'; \ + b='tiffcrop-extractz14-palette-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-rgb-3c-16b.sh.log: tiffcrop-extractz14-rgb-3c-16b.sh + @p='tiffcrop-extractz14-rgb-3c-16b.sh'; \ + b='tiffcrop-extractz14-rgb-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-extractz14-rgb-3c-8b.sh.log: tiffcrop-extractz14-rgb-3c-8b.sh + @p='tiffcrop-extractz14-rgb-3c-8b.sh'; \ + b='tiffcrop-extractz14-rgb-3c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-logluv-3c-16b.sh.log: tiffcrop-R90-logluv-3c-16b.sh + @p='tiffcrop-R90-logluv-3c-16b.sh'; \ + b='tiffcrop-R90-logluv-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-minisblack-1c-16b.sh.log: tiffcrop-R90-minisblack-1c-16b.sh + @p='tiffcrop-R90-minisblack-1c-16b.sh'; \ + b='tiffcrop-R90-minisblack-1c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-minisblack-1c-8b.sh.log: tiffcrop-R90-minisblack-1c-8b.sh + @p='tiffcrop-R90-minisblack-1c-8b.sh'; \ + b='tiffcrop-R90-minisblack-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-minisblack-2c-8b-alpha.sh.log: tiffcrop-R90-minisblack-2c-8b-alpha.sh + @p='tiffcrop-R90-minisblack-2c-8b-alpha.sh'; \ + b='tiffcrop-R90-minisblack-2c-8b-alpha.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-miniswhite-1c-1b.sh.log: tiffcrop-R90-miniswhite-1c-1b.sh + @p='tiffcrop-R90-miniswhite-1c-1b.sh'; \ + b='tiffcrop-R90-miniswhite-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-palette-1c-1b.sh.log: tiffcrop-R90-palette-1c-1b.sh + @p='tiffcrop-R90-palette-1c-1b.sh'; \ + b='tiffcrop-R90-palette-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-palette-1c-4b.sh.log: tiffcrop-R90-palette-1c-4b.sh + @p='tiffcrop-R90-palette-1c-4b.sh'; \ + b='tiffcrop-R90-palette-1c-4b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-palette-1c-8b.sh.log: tiffcrop-R90-palette-1c-8b.sh + @p='tiffcrop-R90-palette-1c-8b.sh'; \ + b='tiffcrop-R90-palette-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-rgb-3c-16b.sh.log: tiffcrop-R90-rgb-3c-16b.sh + @p='tiffcrop-R90-rgb-3c-16b.sh'; \ + b='tiffcrop-R90-rgb-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiffcrop-R90-rgb-3c-8b.sh.log: tiffcrop-R90-rgb-3c-8b.sh + @p='tiffcrop-R90-rgb-3c-8b.sh'; \ + b='tiffcrop-R90-rgb-3c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-logluv-3c-16b.sh.log: tiff2rgba-logluv-3c-16b.sh + @p='tiff2rgba-logluv-3c-16b.sh'; \ + b='tiff2rgba-logluv-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-minisblack-1c-16b.sh.log: tiff2rgba-minisblack-1c-16b.sh + @p='tiff2rgba-minisblack-1c-16b.sh'; \ + b='tiff2rgba-minisblack-1c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-minisblack-1c-8b.sh.log: tiff2rgba-minisblack-1c-8b.sh + @p='tiff2rgba-minisblack-1c-8b.sh'; \ + b='tiff2rgba-minisblack-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-minisblack-2c-8b-alpha.sh.log: tiff2rgba-minisblack-2c-8b-alpha.sh + @p='tiff2rgba-minisblack-2c-8b-alpha.sh'; \ + b='tiff2rgba-minisblack-2c-8b-alpha.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-miniswhite-1c-1b.sh.log: tiff2rgba-miniswhite-1c-1b.sh + @p='tiff2rgba-miniswhite-1c-1b.sh'; \ + b='tiff2rgba-miniswhite-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-palette-1c-1b.sh.log: tiff2rgba-palette-1c-1b.sh + @p='tiff2rgba-palette-1c-1b.sh'; \ + b='tiff2rgba-palette-1c-1b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-palette-1c-4b.sh.log: tiff2rgba-palette-1c-4b.sh + @p='tiff2rgba-palette-1c-4b.sh'; \ + b='tiff2rgba-palette-1c-4b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-palette-1c-8b.sh.log: tiff2rgba-palette-1c-8b.sh + @p='tiff2rgba-palette-1c-8b.sh'; \ + b='tiff2rgba-palette-1c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-rgb-3c-16b.sh.log: tiff2rgba-rgb-3c-16b.sh + @p='tiff2rgba-rgb-3c-16b.sh'; \ + b='tiff2rgba-rgb-3c-16b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-rgb-3c-8b.sh.log: tiff2rgba-rgb-3c-8b.sh + @p='tiff2rgba-rgb-3c-8b.sh'; \ + b='tiff2rgba-rgb-3c-8b.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +tiff2rgba-quad-tile.jpg.sh.log: tiff2rgba-quad-tile.jpg.sh + @p='tiff2rgba-quad-tile.jpg.sh'; \ + b='tiff2rgba-quad-tile.jpg.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(HEADERS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool cscopelist \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags uninstall uninstall-am + + +# memcheck: valgrind's memory access checker +memcheck: + $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check + +# ptrcheck: valgrind's experimental pointer checking tool. +ptrcheck: + $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check + +generate-tiff2rgba-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiff2rgba-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test rotations +generate-tiffcrop-R90-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test flip (mirror) +generate-tiffcrop-doubleflip-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test extracting a section 100 pixels wide and 100 pixels high +generate-tiffcrop-extract-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +# Test extracting the first and fourth quarters from the left side. +generate-tiffcrop-extractz14-tests: + for file in $(TIFFIMAGES) ; \ + do \ + base=`basename $$file .tiff` ; \ + testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \ + ( \ + echo "#!/bin/sh" ; \ + echo "# Generated file, master is Makefile.am" ; \ + echo ". \$${srcdir:-.}/common.sh" ; \ + echo "infile=\"\$$srcdir/$$file\"" ; \ + echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \ + echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \ + echo "f_tiffinfo_validate \$$outfile" ; \ + ) > $$testscript ; \ + chmod +x $$testscript ; \ + done + +generate-tiffcrop-tests: \ + generate-tiffcrop-R90-tests \ + generate-tiffcrop-doubleflip-tests \ + generate-tiffcrop-extract-tests \ + generate-tiffcrop-extractz14-tests + +generate-tests: \ + generate-tiff2rgba-tests \ + generate-tiffcrop-tests + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/ascii_tag.c b/thirdparty/LibTIFF/tiff-4.0.3/test/ascii_tag.c new file mode 100644 index 0000000..58f02eb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/ascii_tag.c @@ -0,0 +1,177 @@ +/* $Id: ascii_tag.c,v 1.7 2008/04/15 13:32:12 dron Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Module to test ASCII tags read/write functions. + */ + +#include "tif_config.h" + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" + +static const char filename[] = "ascii_test.tiff"; + +static const struct { + ttag_t tag; + const char *value; +} ascii_tags[] = { + { TIFFTAG_DOCUMENTNAME, "Test TIFF image" }, + { TIFFTAG_IMAGEDESCRIPTION, "Temporary test image" }, + { TIFFTAG_MAKE, "This is not scanned image" }, + { TIFFTAG_MODEL, "No scanner" }, + { TIFFTAG_PAGENAME, "Test page" }, + { TIFFTAG_SOFTWARE, "Libtiff library" }, + { TIFFTAG_DATETIME, "2004:09:10 16:09:00" }, + { TIFFTAG_ARTIST, "Andrey V. Kiselev" }, + { TIFFTAG_HOSTCOMPUTER, "Debian GNU/Linux (Sarge)" }, + { TIFFTAG_TARGETPRINTER, "No printer" }, + { TIFFTAG_COPYRIGHT, "Copyright (c) 2004, Andrey Kiselev" }, + { TIFFTAG_FAXSUBADDRESS, "Fax subaddress" }, + /* DGN tags */ + { TIFFTAG_UNIQUECAMERAMODEL, "No camera" }, + { TIFFTAG_CAMERASERIALNUMBER, "1234567890" } +}; +#define NTAGS (sizeof (ascii_tags) / sizeof (ascii_tags[0])) + +static const char ink_names[] = "Red\0Green\0Blue"; +const int ink_names_size = 15; + +int +main() +{ + TIFF *tif; + size_t i; + unsigned char buf[] = { 0, 127, 255 }; + char *value; + + /* Test whether we can write tags. */ + tif = TIFFOpen(filename, "w"); + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, 1)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, 1)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, sizeof(buf))) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB)) { + fprintf (stderr, "Can't set PhotometricInterpretation tag.\n"); + goto failure; + } + + for (i = 0; i < NTAGS; i++) { + if (!TIFFSetField(tif, ascii_tags[i].tag, + ascii_tags[i].value)) { + fprintf(stderr, "Can't set tag %lu.\n", + (unsigned long)ascii_tags[i].tag); + goto failure; + } + } + + /* InkNames tag has special form, so we handle it separately. */ + if (!TIFFSetField(tif, TIFFTAG_NUMBEROFINKS, 3)) { + fprintf (stderr, "Can't set tag %d (NUMBEROFINKS).\n", + TIFFTAG_NUMBEROFINKS); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_INKNAMES, ink_names_size, ink_names)) { + fprintf (stderr, "Can't set tag %d (INKNAMES).\n", + TIFFTAG_INKNAMES); + goto failure; + } + + /* Write dummy pixel data. */ + if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + TIFFClose(tif); + + /* Ok, now test whether we can read written values. */ + tif = TIFFOpen(filename, "r"); + if (!tif) { + fprintf (stderr, "Can't open test TIFF file %s.\n", filename); + return 1; + } + + for (i = 0; i < NTAGS; i++) { + if (!TIFFGetField(tif, ascii_tags[i].tag, &value) + || strcmp(value, ascii_tags[i].value)) { + fprintf(stderr, "Can't get tag %lu.\n", + (unsigned long)ascii_tags[i].tag); + goto failure; + } + } + + if (!TIFFGetField(tif, TIFFTAG_INKNAMES, &value) + || memcmp(value, ink_names, ink_names_size)) { + fprintf (stderr, "Can't get tag %d (INKNAMES).\n", + TIFFTAG_INKNAMES); + goto failure; + } + + TIFFClose(tif); + + /* All tests passed; delete file and exit with success status. */ + unlink(filename); + return 0; + +failure: + /* + * Something goes wrong; close file and return unsuccessful status. + * Do not remove the file for further manual investigation. + */ + TIFFClose(tif); + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_palette.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_palette.sh new file mode 100644 index 0000000..1992623 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_palette.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_PALETTE_1C_8B_BMP" +outfile="o-bmp2tiff_palette.tiff" +f_test_convert "$BMP2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_rgb.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_rgb.sh new file mode 100644 index 0000000..2e940ce --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/bmp2tiff_rgb.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_RGB_3C_8B_BMP" +outfile="o-bmp2tiff_rgb.tiff" +f_test_convert "$BMP2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/check_tag.c b/thirdparty/LibTIFF/tiff-4.0.3/test/check_tag.c new file mode 100644 index 0000000..4301180 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/check_tag.c @@ -0,0 +1,91 @@ +/* $Id: check_tag.c,v 1.3 2008/04/15 14:19:37 dron Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Helper testing routines. + */ + +#include "tiffio.h" + +int +CheckShortField(TIFF *tif, const ttag_t field, const uint16 value) +{ + uint16 tmp = 123; + + if (!TIFFGetField(tif, field, &tmp)) { + fprintf (stderr, "Problem fetching tag %lu.\n", + (unsigned long) field); + return -1; + } + if (tmp != value) { + fprintf (stderr, "Wrong SHORT value fetched for tag %lu.\n", + (unsigned long) field); + return -1; + } + + return 0; +} + +int +CheckShortPairedField(TIFF *tif, const ttag_t field, const uint16 *values) +{ + uint16 tmp[2] = { 123, 456 }; + + if (!TIFFGetField(tif, field, tmp, tmp + 1)) { + fprintf (stderr, "Problem fetching tag %lu.\n", + (unsigned long) field); + return -1; + } + if (tmp[0] != values[0] || tmp[1] != values[1]) { + fprintf (stderr, "Wrong SHORT PAIR fetched for tag %lu.\n", + (unsigned long) field); + return -1; + } + + return 0; +} + +int +CheckLongField(TIFF *tif, const ttag_t field, const uint32 value) +{ + uint32 tmp = 123; + + if (!TIFFGetField(tif, field, &tmp)) { + fprintf (stderr, "Problem fetching tag %lu.\n", + (unsigned long) field); + return -1; + } + if (tmp != value) { + fprintf (stderr, "Wrong LONG value fetched for tag %lu.\n", + (unsigned long) field); + return -1; + } + + return 0; +} + + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/common.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/common.sh new file mode 100644 index 0000000..643104b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/common.sh @@ -0,0 +1,129 @@ +# Common code fragment for tests +# +srcdir=${srcdir:-.} +BUILDDIR=`pwd` +SRCDIR=`dirname $0` +SRCDIR=`cd $SRCDIR && pwd` +TOPSRCDIR=`cd $srcdir/.. && pwd` +TOOLS=`cd ../tools && pwd` +IMAGES="${SRCDIR}/images" + +# Aliases for built tools +BMP2TIFF=${TOOLS}/bmp2tiff +FAX2PS=${TOOLS}/fax2ps +FAX2TIFF=${TOOLS}/fax2tiff +GIF2TIFF=${TOOLS}/gif2tiff +PAL2RGB=${TOOLS}/pal2rgb +PPM2TIFF=${TOOLS}/ppm2tiff +RAS2TIFF=${TOOLS}/ras2tiff +RAW2TIFF=${TOOLS}/raw2tiff +RGB2YCBCR=${TOOLS}/rgb2ycbcr +THUMBNAIL=${TOOLS}/thumbnail +TIFF2BW=${TOOLS}/tiff2bw +TIFF2PDF=${TOOLS}/tiff2pdf +TIFF2PS=${TOOLS}/tiff2ps +TIFF2RGBA=${TOOLS}/tiff2rgba +TIFFCMP=${TOOLS}/tiffcmp +TIFFCP=${TOOLS}/tiffcp +TIFFCROP=${TOOLS}/tiffcrop +TIFFDITHER=${TOOLS}/tiffdither +TIFFDUMP=${TOOLS}/tiffdump +TIFFINFO=${TOOLS}/tiffinfo +TIFFMEDIAN=${TOOLS}/tiffmedian +TIFFSET=${TOOLS}/tiffset +TIFFSPLIT=${TOOLS}/tiffsplit + +# Aliases for input test files +IMG_MINISBLACK_1C_16B=${IMAGES}/minisblack-1c-16b.tiff +IMG_MINISBLACK_1C_8B=${IMAGES}/minisblack-1c-8b.tiff +IMG_MINISWHITE_1C_1B=${IMAGES}/miniswhite-1c-1b.tiff +IMG_PALETTE_1C_1B=${IMAGES}/palette-1c-1b.tiff +IMG_PALETTE_1C_4B=${IMAGES}/palette-1c-4b.tiff +IMG_PALETTE_1C_8B=${IMAGES}/palette-1c-8b.tiff +IMG_RGB_3C_16B=${IMAGES}/rgb-3c-16b.tiff +IMG_RGB_3C_8B=${IMAGES}/rgb-3c-8b.tiff +IMG_MINISBLACK_2C_8B_ALPHA=${IMAGES}/minisblack-2c-8b-alpha.tiff + +IMG_PALETTE_1C_8B_BMP=${IMAGES}/palette-1c-8b.bmp +IMG_RGB_3C_8B_BMP=${IMAGES}/rgb-3c-8b.bmp + +IMG_PALETTE_1C_8B_GIF=${IMAGES}/palette-1c-8b.gif + +IMG_MINISWHITE_1C_1B_PBM=${IMAGES}/miniswhite-1c-1b.pbm +IMG_MINISBLACK_1C_8B_PGM=${IMAGES}/minisblack-1c-8b.pgm +IMG_RGB_3C_8B_PPM=${IMAGES}/rgb-3c-8b.ppm + +# All uncompressed image files +IMG_UNCOMPRESSED="${IMG_MINISBLACK_1C_16B} ${IMG_MINISBLACK_1C_8B} ${IMG_MINISWHITE_1C_1B} ${IMG_PALETTE_1C_1B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_4B} ${IMG_PALETTE_1C_8B} ${IMG_RGB_3C_8B}" + +# +# Test a simple convert-like command. +# +# f_test_convert command infile outfile +f_test_convert () +{ + command=$1 + infile=$2 + outfile=$3 + rm -f $outfile + echo "$MEMCHECK $command $infile $outfile" + eval $MEMCHECK $command $infile $outfile + status=$? + if [ $status != 0 ] ; then + echo "Returned failed status $status!" + echo "Output (if any) is in \"${outfile}\"." + exit $status + fi +} + +# +# Test a simple command which sends output to stdout +# +# f_test_stdout command infile outfile +f_test_stdout () +{ + command=$1 + infile=$2 + outfile=$3 + rm -f $outfile + echo "$MEMCHECK $command $infile > $outfile" + eval $MEMCHECK $command $infile > $outfile + status=$? + if [ $status != 0 ] ; then + echo "Returned failed status $status!" + echo "Output (if any) is in \"${outfile}\"." + exit $status + fi +} + +# +# Execute a simple command (e.g. tiffinfo) with one input file +# +# f_test_exec command infile +f_test_reader () +{ + command=$1 + infile=$2 + echo "$MEMCHECK $command $infile" + eval $MEMCHECK $command $infile + status=$? + if [ $status != 0 ] ; then + echo "Returned failed status $status!" + exit $status + fi +} + +# +# Execute tiffinfo on a specified file to validate it +# +# f_tiffinfo_validate infile +f_tiffinfo_validate () +{ + f_test_reader "$TIFFINFO -D" $1 +} + +if test "$VERBOSE" = TRUE +then + set -x +fi + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/custom_dir.c b/thirdparty/LibTIFF/tiff-4.0.3/test/custom_dir.c new file mode 100644 index 0000000..8e44830 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/custom_dir.c @@ -0,0 +1,247 @@ +/* $Id: custom_dir.c,v 1.2 2012-06-06 05:26:37 fwarmerdam Exp $ */ + +/* + * Copyright (c) 2012, Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Module to handling of custom directories like EXIF. + */ + +#include "tif_config.h" +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" +#include "tif_dir.h" +#include "tifftest.h" + +static const char filename[] = "custom_dir.tif"; + +#define SPP 3 /* Samples per pixel */ +const uint16 width = 1; +const uint16 length = 1; +const uint16 bps = 8; +const uint16 photometric = PHOTOMETRIC_RGB; +const uint16 rows_per_strip = 1; +const uint16 planarconfig = PLANARCONFIG_CONTIG; + +static TIFFField +customFields[] = { + { TIFFTAG_IMAGEWIDTH, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Custom1", NULL }, + { TIFFTAG_DOTRANGE, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "Custom2", NULL }, +}; + +static TIFFFieldArray customFieldArray = { tfiatOther, 0, 2, customFields }; + +int +main() +{ + TIFF *tif; + unsigned char buf[SPP] = { 0, 127, 255 }; + uint64 dir_offset = 0, dir_offset2 = 0; + uint64 read_dir_offset = 0, read_dir_offset2 = 0; + uint64 *dir_offset2_ptr = NULL; + char *ascii_value; + uint16 count16 = 0; + + + /* We write the main directory as a simple image. */ + tif = TIFFOpen(filename, "w+"); + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, SPP)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) { + fprintf (stderr, "Can't set PhotometricInterpretation tag.\n"); + goto failure; + } + + /* Write dummy pixel data. */ + if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + if (!TIFFWriteDirectory( tif )) { + fprintf (stderr, "TIFFWriteDirectory() failed.\n"); + goto failure; + } + + /* + * Now create an EXIF directory. + */ + if (TIFFCreateEXIFDirectory(tif) != 0) { + fprintf (stderr, "TIFFCreateEXIFDirectory() failed.\n" ); + goto failure; + } + + if (!TIFFSetField( tif, EXIFTAG_SPECTRALSENSITIVITY, "EXIF Spectral Sensitivity")) { + fprintf (stderr, "Can't write SPECTRALSENSITIVITY\n" ); + goto failure; + } + + if (!TIFFWriteCustomDirectory( tif, &dir_offset )) { + fprintf (stderr, "TIFFWriteCustomDirectory() with EXIF failed.\n"); + goto failure; + } + + /* + * Now create a custom directory with tags that conflict with mainline + * TIFF tags. + */ + + TIFFFreeDirectory( tif ); + if (TIFFCreateCustomDirectory(tif, &customFieldArray) != 0) { + fprintf (stderr, "TIFFCreateEXIFDirectory() failed.\n" ); + goto failure; + } + + if (!TIFFSetField( tif, TIFFTAG_IMAGEWIDTH, "*Custom1")) { /* not really IMAGEWIDTH */ + fprintf (stderr, "Can't write pseudo-IMAGEWIDTH.\n" ); + goto failure; + } + + if (!TIFFSetField( tif, TIFFTAG_DOTRANGE, "*Custom2")) { /* not really DOTWIDTH */ + fprintf (stderr, "Can't write pseudo-DOTWIDTH.\n" ); + goto failure; + } + + if (!TIFFWriteCustomDirectory( tif, &dir_offset2 )) { + fprintf (stderr, "TIFFWriteCustomDirectory() with EXIF failed.\n"); + goto failure; + } + + /* + * Go back to the first directory, and add the EXIFIFD pointer. + */ + TIFFSetDirectory(tif, 0); + TIFFSetField(tif, TIFFTAG_EXIFIFD, dir_offset ); + TIFFSetField(tif, TIFFTAG_SUBIFD, 1, &dir_offset2 ); + + TIFFClose(tif); + + /* Ok, now test whether we can read written values in the EXIF directory. */ + tif = TIFFOpen(filename, "r"); + + TIFFGetField(tif, TIFFTAG_EXIFIFD, &read_dir_offset ); + if( read_dir_offset != dir_offset ) { + fprintf (stderr, "Did not get expected EXIFIFD.\n" ); + goto failure; + } + + TIFFGetField(tif, TIFFTAG_SUBIFD, &count16, &dir_offset2_ptr ); + read_dir_offset2 = dir_offset2_ptr[0]; + if( read_dir_offset2 != dir_offset2 || count16 != 1) { + fprintf (stderr, "Did not get expected SUBIFD.\n" ); + goto failure; + } + + if( !TIFFReadEXIFDirectory(tif, read_dir_offset) ) { + fprintf (stderr, "TIFFReadEXIFDirectory() failed.\n" ); + goto failure; + } + + if (!TIFFGetField( tif, EXIFTAG_SPECTRALSENSITIVITY, &ascii_value) ) { + fprintf (stderr, "reading SPECTRALSENSITIVITY failed.\n" ); + goto failure; + } + + if( strcmp(ascii_value,"EXIF Spectral Sensitivity") != 0) { + fprintf (stderr, "got wrong SPECTRALSENSITIVITY value.\n" ); + goto failure; + } + + /* Try reading the Custom directory */ + + if( !TIFFReadCustomDirectory(tif, read_dir_offset2, &customFieldArray) ) { + fprintf (stderr, "TIFFReadCustomDirectory() failed.\n" ); + goto failure; + } + + if (!TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &ascii_value) ) { + fprintf (stderr, "reading pseudo-IMAGEWIDTH failed.\n" ); + goto failure; + } + + if( strcmp(ascii_value,"*Custom1") != 0) { + fprintf (stderr, "got wrong pseudo-IMAGEWIDTH value.\n" ); + goto failure; + } + + if (!TIFFGetField( tif, TIFFTAG_DOTRANGE, &ascii_value) ) { + fprintf (stderr, "reading pseudo-DOTRANGE failed.\n" ); + goto failure; + } + + if( strcmp(ascii_value,"*Custom2") != 0) { + fprintf (stderr, "got wrong pseudo-DOTRANGE value.\n" ); + goto failure; + } + + TIFFClose(tif); + + /* All tests passed; delete file and exit with success status. */ + unlink(filename); + return 0; + +failure: + /* + * Something goes wrong; close file and return unsuccessful status. + * Do not remove the file for further manual investigation. + */ + TIFFClose(tif); + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/gif2tiff.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/gif2tiff.sh new file mode 100644 index 0000000..6bf9a12 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/gif2tiff.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_PALETTE_1C_8B_GIF" +outfile="o-gif2tiff.tiff" +f_test_convert "$GIF2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/README.txt b/thirdparty/LibTIFF/tiff-4.0.3/test/images/README.txt new file mode 100644 index 0000000..17f6292 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/images/README.txt @@ -0,0 +1,29 @@ +The test files in this directory mostly have dimension 157x151. +The naming convention is + + photometric-channels-bits.tiff + +minisblack-1c-16b.tiff +minisblack-1c-8b.tiff +miniswhite-1c-1b.tiff +palette-1c-1b.tiff +palette-1c-4b.tiff +palette-1c-8b.tiff +rgb-3c-16b.tiff +rgb-3c-8b.tiff + +logluv-3c-16b.tiff: logluv compression/photometric interp +minisblack-2c-8b-alpha.tiff: grey+alpha + +BMP files (anchient BMPv2 since v3 does not work): + + palette-1c-8b.bmp + rgb-3c-8b.bmp + +GIF files (anchient GIF '87 since modern GIF does not work): + palette-1c-8b.gif + +PNM files: + minisblack-1c-8b.pgm + miniswhite-1c-1b.pbm + rgb-3c-8b.ppm diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/logluv-3c-16b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/logluv-3c-16b.tiff new file mode 100644 index 0000000..d43680f Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/logluv-3c-16b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-16b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-16b.tiff new file mode 100644 index 0000000..a8dbae7 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-16b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.pgm b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.pgm new file mode 100644 index 0000000..0faca40 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.pgm differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.tiff new file mode 100644 index 0000000..ea0f9ac Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-1c-8b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-2c-8b-alpha.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-2c-8b-alpha.tiff new file mode 100644 index 0000000..5fe8f58 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/minisblack-2c-8b-alpha.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.pbm b/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.pbm new file mode 100644 index 0000000..6cff929 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.pbm differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.tiff new file mode 100644 index 0000000..bfc0838 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/miniswhite-1c-1b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-1b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-1b.tiff new file mode 100644 index 0000000..25a1a32 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-1b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-4b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-4b.tiff new file mode 100644 index 0000000..38ba325 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-4b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.bmp b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.bmp new file mode 100644 index 0000000..215f4c5 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.bmp differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.gif b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.gif new file mode 100644 index 0000000..f83dfa3 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.gif differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.tiff new file mode 100644 index 0000000..b87685a Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/palette-1c-8b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/quad-tile.jpg.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/quad-tile.jpg.tiff new file mode 100644 index 0000000..99b0bc2 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/quad-tile.jpg.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-16b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-16b.tiff new file mode 100644 index 0000000..f1a0279 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-16b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.bmp b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.bmp new file mode 100644 index 0000000..e6a86dc Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.bmp differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.ppm b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.ppm new file mode 100644 index 0000000..6eca035 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.ppm differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.tiff b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.tiff new file mode 100644 index 0000000..f64d404 Binary files /dev/null and b/thirdparty/LibTIFF/tiff-4.0.3/test/images/rgb-3c-8b.tiff differ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/long_tag.c b/thirdparty/LibTIFF/tiff-4.0.3/test/long_tag.c new file mode 100644 index 0000000..e20b15b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/long_tag.c @@ -0,0 +1,156 @@ +/* $Id: long_tag.c,v 1.4 2008/03/28 01:42:06 bfriesen Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Module to test LONG tags read/write functions. + */ + +#include "tif_config.h" + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" + +extern int CheckLongField(TIFF *, ttag_t, uint32); + +const char *filename = "long_test.tiff"; + +static struct Tags { + ttag_t tag; + short count; + uint32 value; +} long_tags[] = { + { TIFFTAG_SUBFILETYPE, 1, FILETYPE_REDUCEDIMAGE|FILETYPE_PAGE|FILETYPE_MASK } +}; +#define NTAGS (sizeof (long_tags) / sizeof (long_tags[0])) + +const uint32 width = 1; +const uint32 length = 1; +const uint32 rows_per_strip = 1; + +int +main(int argc, char **argv) +{ + TIFF *tif; + unsigned int i; + unsigned char buf[3] = { 0, 127, 255 }; + (void) argc; + (void) argv; + + /* Test whether we can write tags. */ + tif = TIFFOpen(filename, "w"); + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 3)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB)) { + fprintf (stderr, "Can't set PhotometricInterpretation tag.\n"); + goto failure; + } + + for (i = 0; i < NTAGS; i++) { + if (!TIFFSetField(tif, long_tags[i].tag, + long_tags[i].value)) { + fprintf(stderr, "Can't set tag %d.\n", + (int)long_tags[i].tag); + goto failure; + } + } + + /* Write dummy pixel data. */ + if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + TIFFClose(tif); + + /* Ok, now test whether we can read written values. */ + tif = TIFFOpen(filename, "r"); + if (!tif) { + fprintf (stderr, "Can't open test TIFF file %s.\n", filename); + return 1; + } + + if (CheckLongField(tif, TIFFTAG_IMAGEWIDTH, width) < 0) + goto failure; + + if (CheckLongField(tif, TIFFTAG_IMAGELENGTH, length) < 0) + goto failure; + + if (CheckLongField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip) < 0) + goto failure; + + for (i = 0; i < NTAGS; i++) { + if (CheckLongField(tif, long_tags[i].tag, + long_tags[i].value) < 0) + goto failure; + } + + TIFFClose(tif); + + /* All tests passed; delete file and exit with success status. */ + unlink(filename); + return 0; + +failure: + /* Something goes wrong; close file and return unsuccessful status. */ + TIFFClose(tif); + unlink(filename); + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pbm.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pbm.sh new file mode 100644 index 0000000..68d9e45 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pbm.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_MINISWHITE_1C_1B_PBM" +outfile="o-ppm2tiff_pbm.tiff" +f_test_convert "$PPM2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pgm.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pgm.sh new file mode 100644 index 0000000..001ec70 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_pgm.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_MINISBLACK_1C_8B_PGM" +outfile="o-ppm2tiff_pgm.tiff" +f_test_convert "$PPM2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_ppm.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_ppm.sh new file mode 100644 index 0000000..8a81527 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/ppm2tiff_ppm.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$IMG_RGB_3C_8B_PPM" +outfile="o-ppm2tiff_ppm.tiff" +f_test_convert "$PPM2TIFF" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/raw_decode.c b/thirdparty/LibTIFF/tiff-4.0.3/test/raw_decode.c new file mode 100644 index 0000000..ec5c190 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/raw_decode.c @@ -0,0 +1,254 @@ +/* $Id: raw_decode.c,v 1.4 2012-07-06 17:05:16 bfriesen Exp $ */ + +/* + * Copyright (c) 2012, Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * The objective of this test suite is to test the JPEGRawDecode() + * interface via TIFReadEncodedTile(). This function with YCbCr subsampling + * is a frequent source of bugs. + */ + +#include "tif_config.h" + +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" + +#include "jpeglib.h" /* Needed for JPEG_LIB_VERSION */ + +static unsigned char cluster_0[] = { 0, 0, 2, 0, 138, 139 }; +static unsigned char cluster_64[] = { 0, 0, 9, 6, 134, 119 }; +static unsigned char cluster_128[] = { 44, 40, 63, 59, 230, 95 }; + +static int check_cluster( int cluster, unsigned char *buffer, unsigned char *expected_cluster ) { + unsigned char *target = buffer + cluster*6; + + if (memcmp(target, expected_cluster, 6) == 0) { + return 0; + } + + fprintf( stderr, "Cluster %d did not match expected results.\n", cluster ); + fprintf( stderr, + "Expect: %3d %3d %3d %3d\n" + " %3d %3d\n", + expected_cluster[0], expected_cluster[1], + expected_cluster[4], expected_cluster[5], + expected_cluster[2], expected_cluster[3] ); + fprintf( stderr, + " Got: %3d %3d %3d %3d\n" + " %3d %3d\n", + target[0], target[1], + target[4], target[5], + target[2], target[3] ); + return 1; +} + +static int check_rgb_pixel( int pixel, int red, int green, int blue, unsigned char *buffer ) { + unsigned char *rgb = buffer + 3 * pixel; + + if( rgb[0] == red && rgb[1] == green && rgb[2] == blue ) { + return 0; + } + + fprintf( stderr, "Pixel %d did not match expected results.\n", pixel ); + fprintf( stderr, "Expect: %3d %3d %3d\n", red, green, blue ); + fprintf( stderr, " Got: %3d %3d %3d\n", rgb[0], rgb[1], rgb[2] ); + return 1; +} + +static int check_rgba_pixel( int pixel, int red, int green, int blue, int alpha, uint32 *buffer ) { + /* RGBA images are upside down - adjust for normal ordering */ + int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128; + uint32 rgba = buffer[adjusted_pixel]; + + if( TIFFGetR(rgba) == (uint32) red && TIFFGetG(rgba) == (uint32) green && + TIFFGetB(rgba) == (uint32) blue && TIFFGetA(rgba) == (uint32) alpha ) { + return 0; + } + + fprintf( stderr, "Pixel %d did not match expected results.\n", pixel ); + fprintf( stderr, "Expect: %3d %3d %3d %3d\n", red, green, blue, alpha ); + fprintf( stderr, " Got: %3d %3d %3d %3d\n", + TIFFGetR(rgba), TIFFGetG(rgba), TIFFGetB(rgba), TIFFGetA(rgba) ); + return 1; +} + +int +main(int argc, char **argv) +{ + TIFF *tif; + static const char *srcfilerel = "images/quad-tile.jpg.tiff"; + char *srcdir = NULL; + char srcfile[1024]; + unsigned short h, v; + int status; + unsigned char *buffer; + uint32 *rgba_buffer; + tsize_t sz, szout; + unsigned int pixel_status = 0; + + (void) argc; + (void) argv; + + if ((srcdir = getenv("srcdir")) == NULL) { + srcdir = "."; + } + if ((strlen(srcdir) + 1 + strlen(srcfilerel)) >= sizeof(srcfile)) { + fprintf( stderr, "srcdir too long %s\n", srcdir); + exit( 1 ); + } + strcpy(srcfile,srcdir); + strcat(srcfile,"/"); + strcat(srcfile,srcfilerel); + + tif = TIFFOpen(srcfile,"r"); + if ( tif == NULL ) { + fprintf( stderr, "Could not open %s\n", srcfile); + exit( 1 ); + } + + status = TIFFGetField(tif,TIFFTAG_YCBCRSUBSAMPLING, &h, &v); + if ( status == 0 || h != 2 || v != 2) { + fprintf( stderr, "Could not retrieve subsampling tag.\n" ); + exit(1); + } + + /* + * What is the appropriate size of a YCbCr encoded tile? + */ + sz = TIFFTileSize(tif); + if( sz != 24576) { + fprintf(stderr, "tiles are %d bytes\n", (int)sz); + exit(1); + } + + buffer = (unsigned char *) malloc(sz); + + /* + * Read a tile in decompressed form, but still YCbCr subsampled. + */ + szout = TIFFReadEncodedTile(tif,9,buffer,sz); + if (szout != sz) { + fprintf( stderr, + "Did not get expected result code from TIFFReadEncodedTile()(%d instead of %d)\n", + (int) szout, (int) sz ); + return 1; + } + + if( check_cluster( 0, buffer, cluster_0 ) + || check_cluster( 64, buffer, cluster_64 ) + || check_cluster( 128, buffer, cluster_128 ) ) { + exit(1); + } + free(buffer); + + /* + * Read a tile using the built-in conversion to RGB format provided by the JPEG library. + */ + TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + + sz = TIFFTileSize(tif); + if( sz != 128*128*3) { + fprintf(stderr, "tiles are %d bytes\n", (int)sz); + exit(1); + } + + buffer = (unsigned char *) malloc(sz); + + szout = TIFFReadEncodedTile(tif,9,buffer,sz); + if (szout != sz) { + fprintf( stderr, + "Did not get expected result code from TIFFReadEncodedTile()(%d instead of %d)\n", + (int) szout, (int) sz ); + return 1; + } + +#if JPEG_LIB_VERSION >= 70 + pixel_status |= check_rgb_pixel( 0, 18, 0, 41, buffer ); + pixel_status |= check_rgb_pixel( 64, 0, 0, 0, buffer ); + pixel_status |= check_rgb_pixel( 512, 5, 34, 196, buffer ); +#else + pixel_status |= check_rgb_pixel( 0, 15, 0, 18, buffer ); + pixel_status |= check_rgb_pixel( 64, 0, 0, 2, buffer ); + pixel_status |= check_rgb_pixel( 512, 6, 36, 182, buffer ); +#endif + + free( buffer ); + + TIFFClose(tif); + + /* + * Reopen and test reading using the RGBA interface. + */ + tif = TIFFOpen(srcfile,"r"); + + sz = 128 * 128 * sizeof(uint32); + rgba_buffer = (uint32 *) malloc(sz); + + if (!TIFFReadRGBATile( tif, 1*128, 2*128, rgba_buffer )) { + fprintf( stderr, "TIFFReadRGBATile() returned failure code.\n" ); + return 1; + } + + /* + * Currently TIFFReadRGBATile() just uses JPEGCOLORMODE_RGB so this + * trivally matches the last results. Eventually we should actually + * accomplish it from the YCbCr subsampled buffer ourselves in which + * case the results may be subtly different but similar. + */ +#if JPEG_LIB_VERSION >= 70 + pixel_status |= check_rgba_pixel( 0, 18, 0, 41, 255, rgba_buffer ); + pixel_status |= check_rgba_pixel( 64, 0, 0, 0, 255, rgba_buffer ); + pixel_status |= check_rgba_pixel( 512, 5, 34, 196, 255, rgba_buffer ); +#else + pixel_status |= check_rgba_pixel( 0, 15, 0, 18, 255, rgba_buffer ); + pixel_status |= check_rgba_pixel( 64, 0, 0, 2, 255, rgba_buffer ); + pixel_status |= check_rgba_pixel( 512, 6, 36, 182, 255, rgba_buffer ); +#endif + + free( rgba_buffer ); + TIFFClose(tif); + + if (pixel_status) { + exit(1); + } + + exit( 0 ); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/rewrite_tag.c b/thirdparty/LibTIFF/tiff-4.0.3/test/rewrite_tag.c new file mode 100644 index 0000000..1023f16 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/rewrite_tag.c @@ -0,0 +1,346 @@ +/* $Id: rewrite_tag.c,v 1.5 2012-06-13 04:38:55 fwarmerdam Exp $ */ + +/* + * Copyright (c) 2007, Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Module to test _TIFFRewriteField(). + */ + +#include "tif_config.h" + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" +#include "tiffiop.h" + +const uint32 width = 10; +const uint32 length = 40; +const uint32 rows_per_strip = 1; + +int test_packbits() + +{ + TIFF *tif; + int i; + unsigned char buf[10] = {0,0,0,0,0,0,0,0,0,0}; + + int length = 20; + const char *filename = "test_packbits.tif"; + + /* Test whether we can write tags. */ + tif = TIFFOpen(filename, "w"); + + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS)) { + fprintf (stderr, "Can't set Compression tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + + for (i = 0; i < length; i++ ) + { + if( !TIFFWriteEncodedStrip( tif, i, buf, 10 ) ) + { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + } + + TIFFClose(tif); + + /* Test whether we can write tags. */ + + tif = TIFFOpen(filename, "r+"); + + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + buf[3] = 17; + buf[6] = 12; + + if( !TIFFWriteEncodedStrip( tif, 6, buf, 10 ) ) + { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + TIFFClose(tif); + + unlink(filename); + + return 0; + + failure: + /* Something goes wrong; close file and return unsuccessful status. */ + TIFFClose(tif); + /* unlink(filename); */ + + return 1; + +} + +/************************************************************************/ +/* rewrite_test() */ +/************************************************************************/ +int rewrite_test( const char *filename, int length, int bigtiff, + uint64 base_value ) + +{ + TIFF *tif; + int i; + unsigned char buf[10] = {5,6,7,8,9,10,11,12,13,14}; + uint64 *rowoffset, *rowbytes; + uint64 *upd_rowoffset; + uint64 *upd_bytecount; + + /* Test whether we can write tags. */ + if( bigtiff ) + tif = TIFFOpen(filename, "w8"); + else + tif = TIFFOpen(filename, "w4"); + + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS)) { + fprintf (stderr, "Can't set Compression tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + + for (i = 0; i < length; i++ ) + { + if( !TIFFWriteScanline( tif, buf, i, 0 ) ) + { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + } + + TIFFClose(tif); + + /* Ok, now test whether we can read written values. */ + tif = TIFFOpen(filename, "r+"); + if (!tif) { + fprintf (stderr, "Can't open test TIFF file %s.\n", filename); + return 1; + } + + if( !TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &rowoffset ) ) + { + fprintf (stderr, "Can't fetch STRIPOFFSETS.\n"); + goto failure; + } + + if( !TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &rowbytes ) ) + { + fprintf (stderr, "Can't fetch STRIPBYTECOUNTS.\n"); + goto failure; + } + + upd_rowoffset = (uint64 *) _TIFFmalloc(sizeof(uint64) * length); + for( i = 0; i < length; i++ ) + upd_rowoffset[i] = base_value + i*10; + + if( !_TIFFRewriteField( tif, TIFFTAG_STRIPOFFSETS, TIFF_LONG8, + length, upd_rowoffset ) ) + { + fprintf (stderr, "Can't rewrite STRIPOFFSETS.\n"); + goto failure; + } + + _TIFFfree( upd_rowoffset ); + + upd_bytecount = (uint64 *) _TIFFmalloc(sizeof(uint64) * length); + for( i = 0; i < length; i++ ) + upd_bytecount[i] = 100 + i*10; + + if( !_TIFFRewriteField( tif, TIFFTAG_STRIPBYTECOUNTS, TIFF_LONG8, + length, upd_bytecount ) ) + { + fprintf (stderr, "Can't rewrite STRIPBYTECOUNTS.\n"); + goto failure; + } + + _TIFFfree( upd_bytecount ); + + TIFFClose(tif); + + /* Reopen file and read back to verify contents */ + + tif = TIFFOpen(filename, "r"); + if (!tif) { + fprintf (stderr, "Can't open test TIFF file %s.\n", filename); + return 1; + } + + if( !TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &rowoffset ) ) + { + fprintf (stderr, "Can't fetch STRIPOFFSETS.\n"); + goto failure; + } + + for( i = 0; i < length; i++ ) + { + uint64 expect = base_value + i*10; + + if( rowoffset[i] != expect ) + { + fprintf( stderr, + "%s:STRIPOFFSETS[%d]: Got %X:%08X instead of %X:%08X.\n", + filename, i, + (int) (rowoffset[i] >> 32), + (int) (rowoffset[i]&0xFFFFFFFF), + (int) (expect >> 32), + (int) (expect & 0xFFFFFFFF) ); + goto failure; + } + } + + if( !TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &rowbytes ) ) + { + fprintf (stderr, "Can't fetch STRIPBYTECOUNTS.\n"); + goto failure; + } + + for( i = 0; i < length; i++ ) + { + uint64 expect = 100 + i*10; + + if( rowbytes[i] != expect ) + { + fprintf( stderr, + "%s:STRIPBYTECOUNTS[%d]: Got %X:%08X instead of %X:%08X.\n", + filename, i, + (int) (rowbytes[i] >> 32), + (int) (rowbytes[i] & 0xFFFFFFFF), + (int) (expect >> 32), + (int) (expect & 0xFFFFFFFF) ); + goto failure; + } + } + + TIFFClose( tif ); + + /* All tests passed; delete file and exit with success status. */ + unlink(filename); + return 0; + + failure: + /* Something goes wrong; close file and return unsuccessful status. */ + TIFFClose(tif); + /* unlink(filename); */ + + return 1; + +} + +/************************************************************************/ +/* main() */ +/************************************************************************/ +int +main(int argc, char **argv) +{ + (void) argc; + (void) argv; + int failure = 0; + + failure |= test_packbits(); + + /* test fairly normal use */ + failure |= rewrite_test( "rewrite1.tif", 10, 0, 100 ); + failure |= rewrite_test( "rewrite2.tif", 10, 1, 100 ); + + /* test case of fitting all in directory entry */ + failure |= rewrite_test( "rewrite3.tif", 1, 0, 100 ); + failure |= rewrite_test( "rewrite4.tif", 1, 1, 100 ); + + /* test with very large values that don't fit in 4bytes (bigtiff only) */ + failure |= rewrite_test( "rewrite5.tif", 1000, 1, 0x6000000000ULL ); + failure |= rewrite_test( "rewrite6.tif", 1, 1, 0x6000000000ULL ); + + return failure; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/short_tag.c b/thirdparty/LibTIFF/tiff-4.0.3/test/short_tag.c new file mode 100644 index 0000000..7d5a07c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/short_tag.c @@ -0,0 +1,205 @@ +/* $Id: short_tag.c,v 1.8 2008/04/15 14:20:30 dron Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Module to test SHORT tags read/write functions. + */ + +#include "tif_config.h" + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" +#include "tifftest.h" + +static const char filename[] = "short_test.tiff"; + +#define SPP 3 /* Samples per pixel */ +const uint16 width = 1; +const uint16 length = 1; +const uint16 bps = 8; +const uint16 photometric = PHOTOMETRIC_RGB; +const uint16 rows_per_strip = 1; +const uint16 planarconfig = PLANARCONFIG_CONTIG; + +static const struct { + const ttag_t tag; + const uint16 value; +} short_single_tags[] = { + { TIFFTAG_COMPRESSION, COMPRESSION_NONE }, + { TIFFTAG_FILLORDER, FILLORDER_MSB2LSB }, + { TIFFTAG_ORIENTATION, ORIENTATION_BOTRIGHT }, + { TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH }, + { TIFFTAG_MINSAMPLEVALUE, 23 }, + { TIFFTAG_MAXSAMPLEVALUE, 241 }, + { TIFFTAG_INKSET, INKSET_MULTIINK }, + { TIFFTAG_NUMBEROFINKS, SPP }, + { TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT } +}; +#define NSINGLETAGS (sizeof(short_single_tags) / sizeof(short_single_tags[0])) + +static const struct { + const ttag_t tag; + const uint16 values[2]; +} short_paired_tags[] = { + { TIFFTAG_PAGENUMBER, {1, 1} }, + { TIFFTAG_HALFTONEHINTS, {0, 255} }, + { TIFFTAG_DOTRANGE, {8, 16} }, + { TIFFTAG_YCBCRSUBSAMPLING, {2, 1} } +}; +#define NPAIREDTAGS (sizeof(short_paired_tags) / sizeof(short_paired_tags[0])) + +int +main() +{ + TIFF *tif; + size_t i; + unsigned char buf[SPP] = { 0, 127, 255 }; + + /* Test whether we can write tags. */ + tif = TIFFOpen(filename, "w"); + if (!tif) { + fprintf (stderr, "Can't create test TIFF file %s.\n", filename); + return 1; + } + + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, SPP)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) { + fprintf (stderr, "Can't set PhotometricInterpretation tag.\n"); + goto failure; + } + + for (i = 0; i < NSINGLETAGS; i++) { + if (!TIFFSetField(tif, short_single_tags[i].tag, + short_single_tags[i].value)) { + fprintf(stderr, "Can't set tag %lu.\n", + (unsigned long)short_single_tags[i].tag); + goto failure; + } + } + + for (i = 0; i < NPAIREDTAGS; i++) { + if (!TIFFSetField(tif, short_paired_tags[i].tag, + short_paired_tags[i].values[0], + short_paired_tags[i].values[1])) { + fprintf(stderr, "Can't set tag %lu.\n", + (unsigned long)short_paired_tags[i].tag); + goto failure; + } + } + + /* Write dummy pixel data. */ + if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + TIFFClose(tif); + + /* Ok, now test whether we can read written values. */ + tif = TIFFOpen(filename, "r"); + if (!tif) { + fprintf (stderr, "Can't open test TIFF file %s.\n", filename); + return 1; + } + + if (CheckLongField(tif, TIFFTAG_IMAGEWIDTH, width) < 0) + goto failure; + + if (CheckLongField(tif, TIFFTAG_IMAGELENGTH, length) < 0) + goto failure; + + if (CheckShortField(tif, TIFFTAG_BITSPERSAMPLE, bps) < 0) + goto failure; + + if (CheckShortField(tif, TIFFTAG_PHOTOMETRIC, photometric) < 0) + goto failure; + + if (CheckShortField(tif, TIFFTAG_SAMPLESPERPIXEL, SPP) < 0) + goto failure; + + if (CheckLongField(tif, TIFFTAG_ROWSPERSTRIP, rows_per_strip) < 0) + goto failure; + + if (CheckShortField(tif, TIFFTAG_PLANARCONFIG, planarconfig) < 0) + goto failure; + + for (i = 0; i < NSINGLETAGS; i++) { + if (CheckShortField(tif, short_single_tags[i].tag, + short_single_tags[i].value) < 0) + goto failure; + } + + for (i = 0; i < NPAIREDTAGS; i++) { + if (CheckShortPairedField(tif, short_paired_tags[i].tag, + short_paired_tags[i].values) < 0) + goto failure; + } + + TIFFClose(tif); + + /* All tests passed; delete file and exit with success status. */ + unlink(filename); + return 0; + +failure: + /* + * Something goes wrong; close file and return unsuccessful status. + * Do not remove the file for further manual investigation. + */ + TIFFClose(tif); + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/strip.c b/thirdparty/LibTIFF/tiff-4.0.3/test/strip.c new file mode 100644 index 0000000..447cb49 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/strip.c @@ -0,0 +1,290 @@ +/* $Id: strip.c,v 1.4 2008/03/28 01:42:06 bfriesen Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Functions to test strip interface of libtiff. + */ + +#include +#include + +#include "tiffio.h" + +int +write_strips(TIFF *tif, const tdata_t array, const tsize_t size) +{ + tstrip_t strip, nstrips; + tsize_t stripsize, offset; + + stripsize = TIFFStripSize(tif); + if (!stripsize) { + fprintf (stderr, "Wrong size of strip.\n"); + return -1; + } + + nstrips = TIFFNumberOfStrips(tif); + for (offset = 0, strip = 0; + offset < size && strip < nstrips; + offset+=stripsize, strip++) { + /* + * Properly write last strip. + */ + tsize_t bufsize = size - offset; + if (bufsize > stripsize) + bufsize = stripsize; + + if (TIFFWriteEncodedStrip(tif, strip, (char *)array + offset, + bufsize) != bufsize) { + fprintf (stderr, "Can't write strip %lu.\n", + (unsigned long)strip); + return -1; + } + } + + return 0; +} + +int +read_strips(TIFF *tif, const tdata_t array, const tsize_t size) +{ + tstrip_t strip, nstrips; + tsize_t stripsize, offset; + tdata_t buf = NULL; + + stripsize = TIFFStripSize(tif); + if (!stripsize) { + fprintf (stderr, "Wrong size of strip.\n"); + return -1; + } + + buf = _TIFFmalloc(stripsize); + if (!buf) { + fprintf (stderr, "Can't allocate space for strip buffer.\n"); + return -1; + } + + nstrips = TIFFNumberOfStrips(tif); + for (offset = 0, strip = 0; + offset < size && strip < nstrips; + offset+=stripsize, strip++) { + /* + * Properly read last strip. + */ + tsize_t bufsize = size - offset; + if (bufsize > stripsize) + bufsize = stripsize; + + if (TIFFReadEncodedStrip(tif, strip, buf, -1) != bufsize) { + fprintf (stderr, "Can't read strip %lu.\n", + (unsigned long)strip); + return -1; + } + if (memcmp(buf, (char *)array + offset, bufsize) != 0) { + fprintf (stderr, "Wrong data read for strip %lu.\n", + (unsigned long)strip); + _TIFFfree(buf); + return -1; + } + } + + _TIFFfree(buf); + + return 0; +} + +int +create_image_striped(const char *name, uint32 width, uint32 length, + uint32 rowsperstrip, uint16 compression, + uint16 spp, uint16 bps, uint16 photometric, + uint16 sampleformat, uint16 planarconfig, + const tdata_t array, const tsize_t size) +{ + TIFF *tif; + + /* Test whether we can write tags. */ + tif = TIFFOpen(name, "w"); + if (!tif) + goto openfailure; + + if (!TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width)) { + fprintf (stderr, "Can't set ImageWidth tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_IMAGELENGTH, length)) { + fprintf (stderr, "Can't set ImageLength tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps)) { + fprintf (stderr, "Can't set BitsPerSample tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, spp)) { + fprintf (stderr, "Can't set SamplesPerPixel tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip)) { + fprintf (stderr, "Can't set RowsPerStrip tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PLANARCONFIG, planarconfig)) { + fprintf (stderr, "Can't set PlanarConfiguration tag.\n"); + goto failure; + } + if (!TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric)) { + fprintf (stderr, "Can't set PhotometricInterpretation tag.\n"); + goto failure; + } + + if (write_strips(tif, array, size) < 0) { + fprintf (stderr, "Can't write image data.\n"); + goto failure; + } + + TIFFClose(tif); + return 0; + +failure: + TIFFClose(tif); +openfailure: + fprintf (stderr, "Can't create test TIFF file %s:\n" +" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n" +" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n" +" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n", + name, (long) width, (long) length, (long) rowsperstrip, + compression, bps, spp, sampleformat, planarconfig, + photometric); + return -1; +} + +int +read_image_striped(const char *name, uint32 width, uint32 length, + uint32 rowsperstrip, uint16 compression, + uint16 spp, uint16 bps, uint16 photometric, + uint16 sampleformat, uint16 planarconfig, + const tdata_t array, const tsize_t size) +{ + TIFF *tif; + uint16 value_u16; + uint32 value_u32; + + /* Test whether we can read written values. */ + tif = TIFFOpen(name, "r"); + if (!tif) + goto openfailure; + + if (TIFFIsTiled(tif)) { + fprintf (stderr, "Can't read image %s, it is tiled.\n", + name); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &value_u32) + || value_u32 != width) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGEWIDTH); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &value_u32) + || value_u32 != length) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGELENGTH); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &value_u16) + || value_u16 != bps) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_BITSPERSAMPLE); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &value_u16) + || value_u16 != photometric) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PHOTOMETRIC); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &value_u16) + || value_u16 != spp) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_SAMPLESPERPIXEL); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &value_u32) + || value_u32 != rowsperstrip) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_ROWSPERSTRIP); + goto failure; + } + if (!TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &value_u16) + || value_u16 != planarconfig) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_PLANARCONFIG); + goto failure; + } + + if (read_strips(tif, array, size) < 0) { + fprintf (stderr, "Can't read image data.\n"); + goto failure; + } + + TIFFClose(tif); + return 0; + +failure: + TIFFClose(tif); +openfailure: + fprintf (stderr, "Can't read test TIFF file %s:\n" +" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n" +" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n" +" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n", + name, (long) width, (long) length, (long) rowsperstrip, + compression, bps, spp, sampleformat, planarconfig, + photometric); + return -1; +} + +int +write_scanlines(TIFF *tif, const tdata_t array, const tsize_t size) +{ + uint32 length, row; + tsize_t scanlinesize, offset; + (void) size; + + if (!TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &length)) { + fprintf (stderr, "Can't get tag %d.\n", TIFFTAG_IMAGELENGTH); + return -1; + } + + scanlinesize = TIFFScanlineSize(tif); + if (!scanlinesize) { + fprintf (stderr, "Wrong size of scanline.\n"); + return -1; + } + + for (offset = 0, row = 0; row < length; offset+=scanlinesize, row++) { + if (TIFFWriteScanline(tif, (char *)array + offset, row, 0) < 0) { + fprintf (stderr, + "Can't write image data at row %lu.\n", (long) row); + return -1; + } + } + + return 0; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/strip_rw.c b/thirdparty/LibTIFF/tiff-4.0.3/test/strip_rw.c new file mode 100644 index 0000000..5247c0b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/strip_rw.c @@ -0,0 +1,157 @@ +/* $Id: strip_rw.c,v 1.6 2008/03/28 01:42:07 bfriesen Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Test libtiff input/output routines. + */ + +#include "tif_config.h" + +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" +#include "test_arrays.h" + +extern int +create_image_striped(const char *, uint32, uint32, uint32, uint16, uint16, + uint16, uint16, uint16, uint16, const tdata_t, + const tsize_t); +extern int +read_image_striped(const char *, uint32, uint32, uint32, uint16, uint16, + uint16, uint16, uint16, uint16, const tdata_t, + const tsize_t); + +const char *filename = "strip_test.tiff"; + +int +main(int argc, char **argv) +{ + uint32 rowsperstrip; + uint16 compression; + uint16 spp, bps, photometric, sampleformat, planarconfig; + (void) argc; + (void) argv; + + /* + * Test two special cases: image consisting from single line and image + * consisting from single column. + */ + rowsperstrip = 1; + compression = COMPRESSION_NONE; + spp = 1; + bps = 8; + photometric = PHOTOMETRIC_MINISBLACK; + sampleformat = SAMPLEFORMAT_UINT; + planarconfig = PLANARCONFIG_CONTIG; + + if (create_image_striped(filename, XSIZE * YSIZE, 1, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't create TIFF file %s.\n", filename); + goto failure; + } + if (read_image_striped(filename, XSIZE * YSIZE, 1, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't read TIFF file %s.\n", filename); + goto failure; + } + unlink(filename); + + if (create_image_striped(filename, 1, XSIZE * YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't create TIFF file %s.\n", filename); + goto failure; + } + if (read_image_striped(filename, 1, XSIZE * YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't read TIFF file %s.\n", filename); + goto failure; + } + unlink(filename); + + /* + * Test one-channel image with different parameters. + */ + rowsperstrip = 1; + spp = 1; + bps = 8; + photometric = PHOTOMETRIC_MINISBLACK; + sampleformat = SAMPLEFORMAT_UINT; + planarconfig = PLANARCONFIG_CONTIG; + + if (create_image_striped(filename, XSIZE, YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't create TIFF file %s.\n", filename); + goto failure; + } + if (read_image_striped(filename, XSIZE, YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't read TIFF file %s.\n", filename); + goto failure; + } + unlink(filename); + + rowsperstrip = YSIZE; + if (create_image_striped(filename, XSIZE, YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't create TIFF file %s.\n", filename); + goto failure; + } + if (read_image_striped(filename, XSIZE, YSIZE, rowsperstrip, + compression, spp, bps, photometric, + sampleformat, planarconfig, + (const tdata_t) byte_array1, byte_array1_size) < 0) { + fprintf (stderr, "Can't read TIFF file %s.\n", filename); + goto failure; + } + unlink(filename); + + return 0; + +failure: + unlink(filename); + return 1; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.c b/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.c new file mode 100644 index 0000000..8376766 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.c @@ -0,0 +1,829 @@ +/* $Id: test_arrays.c,v 1.3 2006/03/23 14:54:02 dron Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Numerical arrays used to test libtiff's read/write functions. + */ + +#include + +#include "test_arrays.h" + +const unsigned char byte_array1[XSIZE * YSIZE]= +{ +86, 84, 86, 90, 89, 85, 90, 78, 77, 79, 75, 77, 79, 86, +87, 83, 82, 87, 89, 88, 86, 87, 88, 87, 81, 84, 85, 85, +84, 86, 88, 91, 96, 95, 97, 95, 89, +85, 82, 81, 88, 89, 85, 89, 83, 74, 79, 76, 77, 80, 87, +87, 84, 84, 88, 90, 89, 87, 85, 87, 88, 83, 80, 82, 84, +85, 87, 90, 95, 96, 95, 95, 92, 90, +85, 81, 79, 84, 90, 87, 88, 88, 73, 79, 75, 76, 79, 88, +88, 87, 85, 90, 92, 89, 88, 88, 87, 86, 84, 82, 82, 83, +87, 89, 93, 94, 93, 93, 92, 92, 96, +85, 82, 76, 80, 88, 89, 88, 89, 73, 80, 75, 75, 77, 89, +92, 93, 91, 89, 94, 92, 90, 89, 88, 84, 84, 82, 82, 85, +88, 91, 94, 93, 93, 89, 90, 96, 96, +87, 83, 75, 77, 83, 89, 90, 90, 74, 78, 76, 76, 76, 84, +94, 100, 89, 92, 94, 92, 90, 89, 90, 85, 84, 83, 83, 87, +91, 92, 88, 92, 91, 88, 90, 97, 95, +89, 83, 74, 77, 82, 84, 90, 92, 78, 72, 76, 75, 75, 81, +95, 101, 95, 92, 95, 93, 90, 89, 90, 87, 86, 84, 86, 88, +90, 90, 87, 90, 89, 90, 89, 98, 98, +92, 84, 75, 76, 81, 81, 86, 91, 81, 72, 74, 74, 75, 81, +104, 108, 93, 92, 95, 94, 88, 87, 89, 87, 85, 85, 88, 89, +93, 91, 88, 88, 91, 88, 91, 106, 108, +93, 89, 78, 75, 77, 80, 85, 86, 85, 73, 72, 73, 74, 79, +102, 101, 88, 92, 93, 91, 87, 87, 86, 87, 85, 86, 88, 89, +94, 94, 90, 88, 85, 86, 98, 109, 113, +92, 93, 83, 76, 74, 79, 84, 85, 81, 75, 72, 73, 74, 79, +105, 86, 86, 92, 96, 98, 104, 86, 85, 85, 85, 88, 90, 90, +93, 92, 88, 87, 86, 89, 97, 110, 109, +92, 93, 89, 78, 79, 78, 89, 84, 75, 76, 73, 72, 73, 78, +105, 83, 82, 88, 83, 107, 95, 84, 85, 84, 86, 87, 90, 91, +92, 90, 88, 87, 89, 90, 91, 99, 107, +96, 94, 91, 82, 84, 86, 91, 87, 75, 74, 73, 73, 73, 77, +101, 86, 83, 89, 92, 99, 98, 86, 86, 87, 83, 84, 89, 89, +92, 92, 92, 96, 96, 87, 91, 90, 98, +96, 97, 94, 87, 88, 89, 92, 90, 79, 72, 73, 73, 74, 77, +100, 92, 84, 86, 98, 100, 92, 87, 88, 88, 84, 83, 87, 89, +91, 94, 94, 96, 93, 87, 87, 84, 109, +93, 92, 95, 92, 94, 93, 92, 91, 82, 72, 73, 74, 74, 76, +95, 89, 85, 84, 102, 89, 85, 88, 94, 86, 82, 83, 82, 91, +94, 97, 90, 92, 85, 90, 85, 79, 125, +89, 96, 94, 90, 94, 95, 91, 91, 85, 76, 72, 73, 74, 75, +88, 100, 83, 84, 84, 83, 85, 88, 90, 85, 84, 83, 84, 88, +92, 93, 90, 89, 84, 90, 94, 79, 139, +93, 97, 97, 93, 92, 95, 91, 90, 87, 81, 74, 73, 73, 74, +85, 97, 95, 95, 89, 86, 86, 92, 87, 85, 84, 90, 86, 85, +91, 87, 87, 86, 93, 124, 140, 106, 143, +101, 95, 97, 97, 96, 95, 84, 88, 87, 82, 78, 73, 73, 74, +82, 92, 104, 95, 88, 89, 87, 89, 86, 85, 86, 87, 87, 81, +81, 83, 91, 106, 131, 153, 151, 123, 133, +99, 101, 102, 99, 96, 90, 83, 82, 85, 84, 79, 76, 74, 74, +78, 81, 89, 96, 90, 93, 88, 88, 86, 88, 89, 95, 89, 82, +81, 85, 104, 118, 141, 160, 129, 137, 147, +103, 104, 98, 99, 90, 88, 81, 76, 81, 83, 79, 77, 75, 75, +75, 76, 80, 90, 94, 87, 86, 87, 92, 85, 85, 85, 87, 87, +89, 91, 112, 115, 145, 154, 145, 141, 147, +106, 103, 100, 99, 92, 82, 78, 75, 78, 81, 79, 77, 77, 78, +78, 76, 77, 81, 89, 87, 84, 84, 90, 86, 85, 84, 80, 85, +97, 104, 119, 119, 149, 147, 144, 146, 152, +107, 105, 103, 100, 93, 83, 78, 74, 74, 79, 78, 77, 76, 78, +80, 79, 76, 78, 83, 84, 81, 81, 84, 83, 82, 78, 78, 85, +86, 97, 105, 114, 145, 146, 148, 147, 150, +107, 105, 103, 97, 92, 84, 72, 72, 75, 77, 76, 75, 76, 79, +80, 80, 77, 76, 82, 81, 80, 81, 80, 80, 80, 77, 74, 74, +73, 77, 91, 110, 132, 141, 152, 152, 145, +107, 105, 103, 96, 92, 86, 73, 71, 73, 75, 75, 76, 76, 78, +80, 80, 80, 98, 80, 80, 82, 82, 80, 78, 76, 73, 71, 72, +71, 74, 80, 108, 119, 136, 158, 142, 137, +107, 104, 101, 97, 85, 87, 75, 70, 70, 74, 74, 75, 77, 78, +80, 82, 110, 117, 110, 78, 81, 83, 81, 78, 76, 73, 71, 69, +68, 71, 74, 95, 120, 138, 148, 143, 139 +}; + +const size_t byte_array1_size = sizeof(byte_array1); + +const unsigned char byte_array2[YSIZE * XSIZE] = +{ +77, 73, 76, 80, 79, 75, 82, 65, 62, 64, 59, 59, 61, 72, +70, 67, 65, 70, 71, 70, 68, 66, 65, 67, 66, 66, 66, 66, +66, 66, 66, 66, 66, 65, 63, 63, 62, +75, 71, 71, 79, 81, 75, 81, 73, 59, 65, 60, 60, 64, 73, +73, 68, 66, 70, 72, 71, 68, 66, 66, 67, 66, 66, 66, 67, +67, 67, 66, 67, 66, 64, 63, 63, 63, +76, 71, 66, 73, 81, 78, 80, 79, 59, 66, 60, 59, 62, 74, +74, 71, 67, 70, 73, 71, 68, 66, 65, 65, 66, 66, 67, 67, +67, 67, 67, 67, 66, 64, 64, 64, 64, +76, 72, 64, 68, 79, 81, 80, 80, 59, 68, 60, 59, 60, 75, +75, 73, 67, 68, 73, 72, 68, 66, 65, 63, 67, 67, 67, 67, +68, 67, 67, 66, 65, 64, 65, 65, 65, +79, 72, 63, 66, 73, 80, 83, 82, 60, 65, 61, 61, 60, 66, +75, 75, 65, 70, 73, 72, 68, 66, 65, 64, 68, 67, 68, 68, +68, 67, 67, 66, 65, 65, 65, 66, 65, +81, 73, 62, 65, 72, 74, 82, 85, 66, 59, 62, 60, 60, 63, +75, 76, 68, 69, 72, 72, 68, 66, 66, 65, 67, 68, 68, 68, +68, 68, 66, 66, 64, 66, 65, 66, 66, +84, 74, 64, 64, 70, 71, 78, 84, 70, 58, 60, 59, 59, 63, +75, 80, 73, 67, 72, 72, 68, 66, 66, 65, 66, 68, 68, 68, +68, 68, 66, 65, 65, 65, 66, 67, 68, +87, 81, 66, 63, 65, 68, 76, 76, 75, 59, 58, 59, 59, 60, +71, 92, 65, 64, 74, 72, 69, 67, 65, 65, 65, 68, 69, 68, +69, 67, 65, 65, 65, 65, 67, 68, 69, +86, 86, 73, 64, 62, 67, 75, 76, 70, 61, 58, 58, 59, 60, +81, 68, 59, 63, 74, 90, 99, 67, 65, 65, 64, 67, 68, 68, +68, 67, 65, 65, 66, 65, 66, 68, 68, +85, 85, 80, 66, 67, 67, 81, 74, 62, 63, 59, 58, 58, 60, +93, 61, 59, 59, 68, 115, 76, 67, 66, 64, 64, 66, 68, 68, +68, 66, 65, 65, 66, 65, 64, 65, 69, +90, 87, 83, 71, 74, 77, 83, 79, 63, 60, 59, 59, 58, 58, +90, 61, 59, 59, 67, 80, 71, 68, 66, 64, 63, 63, 68, 68, +68, 66, 65, 66, 67, 65, 64, 62, 87, +91, 92, 86, 76, 78, 81, 85, 82, 67, 59, 59, 59, 59, 60, +88, 72, 59, 60, 74, 80, 70, 67, 66, 64, 62, 60, 65, 68, +67, 66, 65, 67, 66, 64, 62, 59, 111, +84, 84, 87, 85, 87, 85, 84, 84, 72, 59, 59, 59, 59, 59, +73, 71, 62, 59, 100, 70, 70, 67, 66, 64, 60, 58, 58, 67, +68, 66, 65, 66, 64, 63, 59, 56, 131, +80, 90, 87, 83, 88, 89, 84, 83, 76, 64, 59, 59, 59, 58, +59, 97, 64, 62, 71, 68, 70, 73, 66, 63, 61, 58, 58, 62, +67, 66, 64, 65, 63, 63, 61, 57, 149, +86, 91, 92, 87, 85, 88, 83, 81, 78, 69, 61, 59, 59, 59, +59, 61, 83, 72, 67, 67, 69, 69, 66, 64, 61, 72, 56, 57, +64, 64, 64, 64, 65, 115, 150, 93, 151, +97, 89, 91, 92, 89, 88, 74, 80, 78, 71, 65, 59, 58, 59, +58, 59, 71, 72, 67, 70, 70, 69, 67, 64, 63, 66, 56, 54, +57, 59, 64, 87, 139, 162, 160, 128, 141, +94, 96, 97, 94, 89, 82, 71, 70, 76, 73, 67, 61, 59, 59, +58, 59, 61, 71, 67, 75, 70, 68, 70, 65, 63, 63, 59, 56, +54, 55, 90, 121, 149, 168, 138, 144, 157, +99, 100, 93, 93, 82, 80, 70, 62, 70, 72, 67, 63, 60, 60, +58, 58, 60, 68, 70, 70, 69, 68, 79, 68, 64, 62, 60, 59, +57, 57, 88, 120, 151, 162, 154, 149, 155, +103, 99, 95, 94, 84, 73, 67, 62, 65, 69, 67, 64, 63, 64, +63, 59, 60, 65, 71, 69, 69, 67, 78, 65, 63, 61, 59, 61, +60, 68, 100, 128, 155, 155, 152, 155, 164, +104, 102, 99, 95, 86, 74, 67, 61, 61, 66, 65, 63, 63, 64, +65, 63, 60, 63, 70, 69, 67, 67, 67, 65, 62, 60, 58, 57, +62, 58, 71, 117, 150, 154, 157, 155, 163, +104, 101, 99, 91, 84, 74, 59, 59, 62, 64, 63, 61, 62, 64, +64, 64, 61, 60, 69, 68, 67, 69, 67, 65, 62, 59, 58, 57, +57, 56, 59, 104, 137, 147, 159, 161, 158, +104, 101, 99, 90, 85, 77, 60, 57, 60, 62, 62, 62, 63, 64, +65, 65, 66, 100, 67, 67, 69, 69, 67, 65, 63, 60, 58, 56, +54, 55, 56, 77, 122, 142, 166, 157, 150, +104, 101, 97, 92, 77, 79, 64, 57, 57, 62, 62, 62, 64, 65, +66, 65, 115, 138, 129, 64, 68, 70, 68, 66, 64, 60, 58, 56, +53, 53, 56, 62, 115, 143, 157, 156, 159 +}; + +const size_t byte_array2_size = sizeof(byte_array2); + +const unsigned char byte_array3[YSIZE * XSIZE] = +{ +211, 221, 216, 201, 205, 216, 195, 236, 244, 237, 250, 250, 248, 218, +223, 232, 236, 224, 221, 221, 227, 231, 232, 227, 229, 227, 227, 225, +227, 225, 226, 226, 226, 228, 234, 234, 234, 216, 226, 228, 205, 200, +214, 198, 215, 250, 233, 247, 250, 242, 219, 220, 229, 235, 225, 217, +220, 227, 232, 230, 228, 229, 228, 227, 224, 225, 223, 226, 225, 226, +230, 233, 233, 234, 213, 227, 237, 220, 200, 204, 202, 201, 248, 231, +246, 250, 245, 214, 215, 223, 232, 225, 218, 218, 225, 230, 232, 231, +229, 227, 225, 224, 223, 226, 224, 225, 228, 229, 230, 232, 231, 215, +223, 242, 233, 206, 200, 201, 197, 250, 227, 250, 249, 248, 211, 212, +216, 233, 229, 216, 218, 225, 230, 232, 237, 226, 224, 224, 223, 225, +225, 224, 225, 228, 229, 231, 229, 231, 208, 220, 247, 238, 221, 202, +194, 194, 245, 237, 247, 247, 249, 234, 210, 212, 237, 222, 219, 217, +226, 229, 232, 235, 222, 222, 223, 223, 223, 224, 224, 227, 226, 229, +229, 228, 231, 200, 221, 247, 239, 224, 217, 196, 189, 229, 248, 245, +248, 250, 241, 210, 210, 230, 225, 218, 218, 224, 230, 230, 229, 224, +222, 222, 222, 222, 223, 225, 226, 231, 226, 228, 229, 230, 191, 216, +246, 245, 226, 228, 207, 191, 221, 251, 248, 249, 251, 245, 214, 214, +233, 229, 217, 217, 224, 229, 230, 229, 225, 220, 223, 221, 222, 224, +224, 227, 230, 227, 226, 229, 230, 187, 199, 238, 248, 242, 231, 213, +211, 209, 246, 248, 251, 251, 250, 226, 215, 236, 237, 217, 215, 222, +226, 229, 229, 227, 222, 222, 223, 222, 225, 227, 228, 226, 227, 228, +228, 230, 188, 189, 221, 243, 247, 237, 215, 209, 223, 241, 248, 248, +250, 248, 228, 234, 251, 239, 219, 210, 205, 224, 229, 228, 230, 221, +223, 223, 222, 226, 229, 228, 224, 227, 229, 230, 232, 190, 190, 201, +235, 236, 238, 198, 214, 243, 238, 248, 248, 250, 249, 215, 244, 250, +250, 240, 168, 220, 224, 228, 230, 231, 226, 221, 224, 223, 226, 230, +227, 226, 226, 230, 233, 234, 179, 185, 195, 224, 215, 210, 195, 204, +239, 245, 250, 250, 252, 254, 216, 243, 249, 249, 233, 210, 215, 223, +227, 230, 234, 234, 224, 223, 223, 227, 230, 226, 226, 228, 231, 235, +212, 178, 174, 190, 211, 207, 199, 189, 194, 230, 250, 250, 250, 253, +253, 222, 225, 250, 248, 218, 216, 217, 225, 226, 232, 239, 242, 229, +223, 224, 229, 230, 225, 228, 230, 236, 241, 183, 194, 194, 185, 190, +185, 190, 191, 191, 219, 250, 251, 250, 253, 254, 241, 225, 246, 249, +198, 217, 220, 224, 225, 234, 241, 242, 246, 224, 223, 227, 229, 227, +228, 234, 237, 245, 149, 203, 178, 182, 193, 185, 179, 191, 194, 211, +236, 252, 252, 254, 254, 253, 192, 240, 244, 235, 224, 220, 229, 224, +236, 239, 243, 244, 236, 224, 229, 230, 229, 231, 230, 233, 244, 128, +188, 177, 171, 184, 191, 182, 196, 197, 208, 224, 247, 253, 255, 252, +250, 248, 226, 216, 228, 230, 220, 220, 227, 234, 237, 231, 247, 244, +231, 231, 229, 228, 229, 182, 128, 196, 118, 160, 182, 174, 172, 179, +183, 216, 203, 206, 220, 236, 253, 254, 253, 253, 249, 225, 219, 232, +230, 220, 224, 227, 233, 237, 234, 244, 250, 245, 240, 224, 212, 174, +123, 124, 176, 127, 171, 163, 161, 167, 177, 198, 221, 228, 212, 215, +233, 245, 252, 255, 253, 252, 251, 223, 231, 216, 222, 227, 231, 231, +234, 227, 238, 245, 249, 244, 210, 177, 124, 129, 134, 124, 113, 156, +155, 172, 168, 197, 201, 224, 247, 224, 219, 233, 242, 249, 250, 252, +254, 252, 230, 230, 224, 224, 225, 225, 227, 232, 232, 235, 239, 239, +241, 213, 178, 131, 128, 128, 120, 114, 149, 157, 165, 168, 191, 218, +231, 246, 237, 226, 234, 241, 243, 239, 244, 252, 249, 237, 225, 226, +224, 227, 220, 229, 235, 235, 239, 238, 236, 230, 204, 177, 125, 131, +127, 117, 111, 146, 151, 158, 166, 187, 215, 230, 246, 246, 231, 238, +243, 246, 243, 241, 244, 253, 245, 226, 226, 229, 229, 229, 231, 236, +238, 241, 240, 241, 235, 224, 188, 134, 123, 127, 116, 116, 144, 151, +158, 173, 190, 214, 251, 250, 243, 236, 242, 249, 246, 241, 241, 244, +251, 251, 228, 230, 230, 226, 232, 231, 236, 241, 243, 244, 243, 243, +235, 200, 150, 128, 122, 119, 117, 144, 151, 156, 176, 190, 207, 246, +253, 244, 239, 244, 246, 244, 242, 240, 243, 249, 198, 239, 234, 226, +226, 228, 234, 238, 241, 244, 245, 247, 250, 244, 219, 182, 138, 118, +118, 116, 143, 150, 162, 173, 208, 205, 238, 253, 251, 241, 244, 244, +242, 243, 238, 246, 193, 146, 173, 246, 231, 223, 230, 232, 236, 240, +245, 247, 252, 252, 245, 233, 195, 138, 114, 118, 108 +}; + +const size_t byte_array3_size = sizeof(byte_array3); + +const float array_float1[YSIZE * XSIZE] = +{ +234.866, 229.404, 234.866, 245.790, 243.059, 232.135, 245.790, 213.018, +210.287, 215.749, 204.825, 210.287, 215.749, 234.866, 237.597, 226.673, +223.942, 237.597, 243.059, 240.328, 234.866, 237.597, 240.328, 237.597, +221.211, 229.404, 232.135, 232.135, 229.404, 234.866, 240.328, 248.521, +262.176, 259.445, 264.907, 259.445, 243.059, +232.135, 223.942, 221.211, 240.328, 243.059, 232.135, 243.059, 226.673, +202.094, 215.749, 207.556, 210.287, 218.480, 237.597, 237.597, 229.404, +229.404, 240.328, 245.790, 243.059, 237.597, 232.135, 237.597, 240.328, +226.673, 218.480, 223.942, 229.404, 232.135, 237.597, 245.790, 259.445, +262.176, 259.445, 259.445, 251.252, 245.790, +232.135, 221.211, 215.749, 229.404, 245.790, 237.597, 240.328, 240.328, +199.363, 215.749, 204.825, 207.556, 215.749, 240.328, 240.328, 237.597, +232.135, 245.790, 251.252, 243.059, 240.328, 240.328, 237.597, 234.866, +229.404, 223.942, 223.942, 226.673, 237.597, 243.059, 253.983, 256.714, +253.983, 253.983, 251.252, 251.252, 262.176, +232.135, 223.942, 207.556, 218.480, 240.328, 243.059, 240.328, 243.059, +199.363, 218.480, 204.825, 204.825, 210.287, 243.059, 251.252, 253.983, +248.521, 243.059, 256.714, 251.252, 245.790, 243.059, 240.328, 229.404, +229.404, 223.942, 223.942, 232.135, 240.328, 248.521, 256.714, 253.983, +253.983, 243.059, 245.790, 262.176, 262.176, +237.597, 226.673, 204.825, 210.287, 226.673, 243.059, 245.790, 245.790, +202.094, 213.018, 207.556, 207.556, 207.556, 229.404, 256.714, 273.100, +243.059, 251.252, 256.714, 251.252, 245.790, 243.059, 245.790, 232.135, +229.404, 226.673, 226.673, 237.597, 248.521, 251.252, 240.328, 251.252, +248.521, 240.328, 245.790, 264.907, 259.445, +243.059, 226.673, 202.094, 210.287, 223.942, 229.404, 245.790, 251.252, +213.018, 196.632, 207.556, 204.825, 204.825, 221.211, 259.445, 275.831, +259.445, 251.252, 259.445, 253.983, 245.790, 243.059, 245.790, 237.597, +234.866, 229.404, 234.866, 240.328, 245.790, 245.790, 237.597, 245.790, +243.059, 245.790, 243.059, 267.638, 267.638, +251.252, 229.404, 204.825, 207.556, 221.211, 221.211, 234.866, 248.521, +221.211, 196.632, 202.094, 202.094, 204.825, 221.211, 284.024, 294.948, +253.983, 251.252, 259.445, 256.714, 240.328, 237.597, 243.059, 237.597, +232.135, 232.135, 240.328, 243.059, 253.983, 248.521, 240.328, 240.328, +248.521, 240.328, 248.521, 289.486, 294.948, +253.983, 243.059, 213.018, 204.825, 210.287, 218.480, 232.135, 234.866, +232.135, 199.363, 196.632, 199.363, 202.094, 215.749, 278.562, 275.831, +240.328, 251.252, 253.983, 248.521, 237.597, 237.597, 234.866, 237.597, +232.135, 234.866, 240.328, 243.059, 256.714, 256.714, 245.790, 240.328, +232.135, 234.866, 267.638, 297.679, 308.603, +251.252, 253.983, 226.673, 207.556, 202.094, 215.749, 229.404, 232.135, +221.211, 204.825, 196.632, 199.363, 202.094, 215.749, 286.755, 234.866, +234.866, 251.252, 262.176, 267.638, 284.024, 234.866, 232.135, 232.135, +232.135, 240.328, 245.790, 245.790, 253.983, 251.252, 240.328, 237.597, +234.866, 243.059, 264.907, 300.410, 297.679, +251.252, 253.983, 243.059, 213.018, 215.749, 213.018, 243.059, 229.404, +204.825, 207.556, 199.363, 196.632, 199.363, 213.018, 286.755, 226.673, +223.942, 240.328, 226.673, 292.217, 259.445, 229.404, 232.135, 229.404, +234.866, 237.597, 245.790, 248.521, 251.252, 245.790, 240.328, 237.597, +243.059, 245.790, 248.521, 270.369, 292.217, +262.176, 256.714, 248.521, 223.942, 229.404, 234.866, 248.521, 237.597, +204.825, 202.094, 199.363, 199.363, 199.363, 210.287, 275.831, 234.866, +226.673, 243.059, 251.252, 270.369, 267.638, 234.866, 234.866, 237.597, +226.673, 229.404, 243.059, 243.059, 251.252, 251.252, 251.252, 262.176, +262.176, 237.597, 248.521, 245.790, 267.638, +262.176, 264.907, 256.714, 237.597, 240.328, 243.059, 251.252, 245.790, +215.749, 196.632, 199.363, 199.363, 202.094, 210.287, 273.100, 251.252, +229.404, 234.866, 267.638, 273.100, 251.252, 237.597, 240.328, 240.328, +229.404, 226.673, 237.597, 243.059, 248.521, 256.714, 256.714, 262.176, +253.983, 237.597, 237.597, 229.404, 297.679, +253.983, 251.252, 259.445, 251.252, 256.714, 253.983, 251.252, 248.521, +223.942, 196.632, 199.363, 202.094, 202.094, 207.556, 259.445, 243.059, +232.135, 229.404, 278.562, 243.059, 232.135, 240.328, 256.714, 234.866, +223.942, 226.673, 223.942, 248.521, 256.714, 264.907, 245.790, 251.252, +232.135, 245.790, 232.135, 215.749, 341.375, +243.059, 262.176, 256.714, 245.790, 256.714, 259.445, 248.521, 248.521, +232.135, 207.556, 196.632, 199.363, 202.094, 204.825, 240.328, 273.100, +226.673, 229.404, 229.404, 226.673, 232.135, 240.328, 245.790, 232.135, +229.404, 226.673, 229.404, 240.328, 251.252, 253.983, 245.790, 243.059, +229.404, 245.790, 256.714, 215.749, 379.609, +253.983, 264.907, 264.907, 253.983, 251.252, 259.445, 248.521, 245.790, +237.597, 221.211, 202.094, 199.363, 199.363, 202.094, 232.135, 264.907, +259.445, 259.445, 243.059, 234.866, 234.866, 251.252, 237.597, 232.135, +229.404, 245.790, 234.866, 232.135, 248.521, 237.597, 237.597, 234.866, +253.983, 338.644, 382.340, 289.486, 390.533, +275.831, 259.445, 264.907, 264.907, 262.176, 259.445, 229.404, 240.328, +237.597, 223.942, 213.018, 199.363, 199.363, 202.094, 223.942, 251.252, +284.024, 259.445, 240.328, 243.059, 237.597, 243.059, 234.866, 232.135, +234.866, 237.597, 237.597, 221.211, 221.211, 226.673, 248.521, 289.486, +357.761, 417.843, 412.381, 335.913, 363.223, +270.369, 275.831, 278.562, 270.369, 262.176, 245.790, 226.673, 223.942, +232.135, 229.404, 215.749, 207.556, 202.094, 202.094, 213.018, 221.211, +243.059, 262.176, 245.790, 253.983, 240.328, 240.328, 234.866, 240.328, +243.059, 259.445, 243.059, 223.942, 221.211, 232.135, 284.024, 322.258, +385.071, 436.960, 352.299, 374.147, 401.457, +281.293, 284.024, 267.638, 270.369, 245.790, 240.328, 221.211, 207.556, +221.211, 226.673, 215.749, 210.287, 204.825, 204.825, 204.825, 207.556, +218.480, 245.790, 256.714, 237.597, 234.866, 237.597, 251.252, 232.135, +232.135, 232.135, 237.597, 237.597, 243.059, 248.521, 305.872, 314.065, +395.995, 420.574, 395.995, 385.071, 401.457, +289.486, 281.293, 273.100, 270.369, 251.252, 223.942, 213.018, 204.825, +213.018, 221.211, 215.749, 210.287, 210.287, 213.018, 213.018, 207.556, +210.287, 221.211, 243.059, 237.597, 229.404, 229.404, 245.790, 234.866, +232.135, 229.404, 218.480, 232.135, 264.907, 284.024, 324.989, 324.989, +406.919, 401.457, 393.264, 398.726, 415.112, +292.217, 286.755, 281.293, 273.100, 253.983, 226.673, 213.018, 202.094, +202.094, 215.749, 213.018, 210.287, 207.556, 213.018, 218.480, 215.749, +207.556, 213.018, 226.673, 229.404, 221.211, 221.211, 229.404, 226.673, +223.942, 213.018, 213.018, 232.135, 234.866, 264.907, 286.755, 311.334, +395.995, 398.726, 404.188, 401.457, 409.650, +292.217, 286.755, 281.293, 264.907, 251.252, 229.404, 196.632, 196.632, +204.825, 210.287, 207.556, 204.825, 207.556, 215.749, 218.480, 218.480, +210.287, 207.556, 223.942, 221.211, 218.480, 221.211, 218.480, 218.480, +218.480, 210.287, 202.094, 202.094, 199.363, 210.287, 248.521, 300.410, +360.492, 385.071, 415.112, 415.112, 395.995, +292.217, 286.755, 281.293, 262.176, 251.252, 234.866, 199.363, 193.901, +199.363, 204.825, 204.825, 207.556, 207.556, 213.018, 218.480, 218.480, +218.480, 267.638, 218.480, 218.480, 223.942, 223.942, 218.480, 213.018, +207.556, 199.363, 193.901, 196.632, 193.901, 202.094, 218.480, 294.948, +324.989, 371.416, 431.498, 387.802, 374.147, +292.217, 284.024, 275.831, 264.907, 232.135, 237.597, 204.825, 191.170, +191.170, 202.094, 202.094, 204.825, 210.287, 213.018, 218.480, 223.942, +300.410, 319.527, 300.410, 213.018, 221.211, 226.673, 221.211, 213.018, +207.556, 199.363, 193.901, 188.439, 185.708, 193.901, 202.094, 259.445, +327.720, 376.878, 404.188, 390.533, 379.609 +}; + +const size_t array_float1_size = sizeof(array_float1); + +const float array_float2[YSIZE * XSIZE] = +{ +210.287, 199.363, 207.556, 218.480, 215.749, 204.825, 223.942, 177.515, +169.322, 174.784, 161.129, 161.129, 166.591, 196.632, 191.170, 182.977, +177.515, 191.170, 193.901, 191.170, 185.708, 180.246, 177.515, 182.977, +180.246, 180.246, 180.246, 180.246, 180.246, 180.246, 180.246, 180.246, +180.246, 177.515, 172.053, 172.053, 169.322, +204.825, 193.901, 193.901, 215.749, 221.211, 204.825, 221.211, 199.363, +161.129, 177.515, 163.860, 163.860, 174.784, 199.363, 199.363, 185.708, +180.246, 191.170, 196.632, 193.901, 185.708, 180.246, 180.246, 182.977, +180.246, 180.246, 180.246, 182.977, 182.977, 182.977, 180.246, 182.977, +180.246, 174.784, 172.053, 172.053, 172.053, +207.556, 193.901, 180.246, 199.363, 221.211, 213.018, 218.480, 215.749, +161.129, 180.246, 163.860, 161.129, 169.322, 202.094, 202.094, 193.901, +182.977, 191.170, 199.363, 193.901, 185.708, 180.246, 177.515, 177.515, +180.246, 180.246, 182.977, 182.977, 182.977, 182.977, 182.977, 182.977, +180.246, 174.784, 174.784, 174.784, 174.784, +207.556, 196.632, 174.784, 185.708, 215.749, 221.211, 218.480, 218.480, +161.129, 185.708, 163.860, 161.129, 163.860, 204.825, 204.825, 199.363, +182.977, 185.708, 199.363, 196.632, 185.708, 180.246, 177.515, 172.053, +182.977, 182.977, 182.977, 182.977, 185.708, 182.977, 182.977, 180.246, +177.515, 174.784, 177.515, 177.515, 177.515, +215.749, 196.632, 172.053, 180.246, 199.363, 218.480, 226.673, 223.942, +163.860, 177.515, 166.591, 166.591, 163.860, 180.246, 204.825, 204.825, +177.515, 191.170, 199.363, 196.632, 185.708, 180.246, 177.515, 174.784, +185.708, 182.977, 185.708, 185.708, 185.708, 182.977, 182.977, 180.246, +177.515, 177.515, 177.515, 180.246, 177.515, +221.211, 199.363, 169.322, 177.515, 196.632, 202.094, 223.942, 232.135, +180.246, 161.129, 169.322, 163.860, 163.860, 172.053, 204.825, 207.556, +185.708, 188.439, 196.632, 196.632, 185.708, 180.246, 180.246, 177.515, +182.977, 185.708, 185.708, 185.708, 185.708, 185.708, 180.246, 180.246, +174.784, 180.246, 177.515, 180.246, 180.246, +229.404, 202.094, 174.784, 174.784, 191.170, 193.901, 213.018, 229.404, +191.170, 158.398, 163.860, 161.129, 161.129, 172.053, 204.825, 218.480, +199.363, 182.977, 196.632, 196.632, 185.708, 180.246, 180.246, 177.515, +180.246, 185.708, 185.708, 185.708, 185.708, 185.708, 180.246, 177.515, +177.515, 177.515, 180.246, 182.977, 185.708, +237.597, 221.211, 180.246, 172.053, 177.515, 185.708, 207.556, 207.556, +204.825, 161.129, 158.398, 161.129, 161.129, 163.860, 193.901, 251.252, +177.515, 174.784, 202.094, 196.632, 188.439, 182.977, 177.515, 177.515, +177.515, 185.708, 188.439, 185.708, 188.439, 182.977, 177.515, 177.515, +177.515, 177.515, 182.977, 185.708, 188.439, +234.866, 234.866, 199.363, 174.784, 169.322, 182.977, 204.825, 207.556, +191.170, 166.591, 158.398, 158.398, 161.129, 163.860, 221.211, 185.708, +161.129, 172.053, 202.094, 245.790, 270.369, 182.977, 177.515, 177.515, +174.784, 182.977, 185.708, 185.708, 185.708, 182.977, 177.515, 177.515, +180.246, 177.515, 180.246, 185.708, 185.708, +232.135, 232.135, 218.480, 180.246, 182.977, 182.977, 221.211, 202.094, +169.322, 172.053, 161.129, 158.398, 158.398, 163.860, 253.983, 166.591, +161.129, 161.129, 185.708, 314.065, 207.556, 182.977, 180.246, 174.784, +174.784, 180.246, 185.708, 185.708, 185.708, 180.246, 177.515, 177.515, +180.246, 177.515, 174.784, 177.515, 188.439, +245.790, 237.597, 226.673, 193.901, 202.094, 210.287, 226.673, 215.749, +172.053, 163.860, 161.129, 161.129, 158.398, 158.398, 245.790, 166.591, +161.129, 161.129, 182.977, 218.480, 193.901, 185.708, 180.246, 174.784, +172.053, 172.053, 185.708, 185.708, 185.708, 180.246, 177.515, 180.246, +182.977, 177.515, 174.784, 169.322, 237.597, +248.521, 251.252, 234.866, 207.556, 213.018, 221.211, 232.135, 223.942, +182.977, 161.129, 161.129, 161.129, 161.129, 163.860, 240.328, 196.632, +161.129, 163.860, 202.094, 218.480, 191.170, 182.977, 180.246, 174.784, +169.322, 163.860, 177.515, 185.708, 182.977, 180.246, 177.515, 182.977, +180.246, 174.784, 169.322, 161.129, 303.141, +229.404, 229.404, 237.597, 232.135, 237.597, 232.135, 229.404, 229.404, +196.632, 161.129, 161.129, 161.129, 161.129, 161.129, 199.363, 193.901, +169.322, 161.129, 273.100, 191.170, 191.170, 182.977, 180.246, 174.784, +163.860, 158.398, 158.398, 182.977, 185.708, 180.246, 177.515, 180.246, +174.784, 172.053, 161.129, 152.936, 357.761, +218.480, 245.790, 237.597, 226.673, 240.328, 243.059, 229.404, 226.673, +207.556, 174.784, 161.129, 161.129, 161.129, 158.398, 161.129, 264.907, +174.784, 169.322, 193.901, 185.708, 191.170, 199.363, 180.246, 172.053, +166.591, 158.398, 158.398, 169.322, 182.977, 180.246, 174.784, 177.515, +172.053, 172.053, 166.591, 155.667, 406.919, +234.866, 248.521, 251.252, 237.597, 232.135, 240.328, 226.673, 221.211, +213.018, 188.439, 166.591, 161.129, 161.129, 161.129, 161.129, 166.591, +226.673, 196.632, 182.977, 182.977, 188.439, 188.439, 180.246, 174.784, +166.591, 196.632, 152.936, 155.667, 174.784, 174.784, 174.784, 174.784, +177.515, 314.065, 409.650, 253.983, 412.381, +264.907, 243.059, 248.521, 251.252, 243.059, 240.328, 202.094, 218.480, +213.018, 193.901, 177.515, 161.129, 158.398, 161.129, 158.398, 161.129, +193.901, 196.632, 182.977, 191.170, 191.170, 188.439, 182.977, 174.784, +172.053, 180.246, 152.936, 147.474, 155.667, 161.129, 174.784, 237.597, +379.609, 442.422, 436.960, 349.568, 385.071, +256.714, 262.176, 264.907, 256.714, 243.059, 223.942, 193.901, 191.170, +207.556, 199.363, 182.977, 166.591, 161.129, 161.129, 158.398, 161.129, +166.591, 193.901, 182.977, 204.825, 191.170, 185.708, 191.170, 177.515, +172.053, 172.053, 161.129, 152.936, 147.474, 150.205, 245.790, 330.451, +406.919, 458.808, 376.878, 393.264, 428.767, +270.369, 273.100, 253.983, 253.983, 223.942, 218.480, 191.170, 169.322, +191.170, 196.632, 182.977, 172.053, 163.860, 163.860, 158.398, 158.398, +163.860, 185.708, 191.170, 191.170, 188.439, 185.708, 215.749, 185.708, +174.784, 169.322, 163.860, 161.129, 155.667, 155.667, 240.328, 327.720, +412.381, 442.422, 420.574, 406.919, 423.305, +281.293, 270.369, 259.445, 256.714, 229.404, 199.363, 182.977, 169.322, +177.515, 188.439, 182.977, 174.784, 172.053, 174.784, 172.053, 161.129, +163.860, 177.515, 193.901, 188.439, 188.439, 182.977, 213.018, 177.515, +172.053, 166.591, 161.129, 166.591, 163.860, 185.708, 273.100, 349.568, +423.305, 423.305, 415.112, 423.305, 447.884, +284.024, 278.562, 270.369, 259.445, 234.866, 202.094, 182.977, 166.591, +166.591, 180.246, 177.515, 172.053, 172.053, 174.784, 177.515, 172.053, +163.860, 172.053, 191.170, 188.439, 182.977, 182.977, 182.977, 177.515, +169.322, 163.860, 158.398, 155.667, 169.322, 158.398, 193.901, 319.527, +409.650, 420.574, 428.767, 423.305, 445.153, +284.024, 275.831, 270.369, 248.521, 229.404, 202.094, 161.129, 161.129, +169.322, 174.784, 172.053, 166.591, 169.322, 174.784, 174.784, 174.784, +166.591, 163.860, 188.439, 185.708, 182.977, 188.439, 182.977, 177.515, +169.322, 161.129, 158.398, 155.667, 155.667, 152.936, 161.129, 284.024, +374.147, 401.457, 434.229, 439.691, 431.498, +284.024, 275.831, 270.369, 245.790, 232.135, 210.287, 163.860, 155.667, +163.860, 169.322, 169.322, 169.322, 172.053, 174.784, 177.515, 177.515, +180.246, 273.100, 182.977, 182.977, 188.439, 188.439, 182.977, 177.515, +172.053, 163.860, 158.398, 152.936, 147.474, 150.205, 152.936, 210.287, +333.182, 387.802, 453.346, 428.767, 409.650, +284.024, 275.831, 264.907, 251.252, 210.287, 215.749, 174.784, 155.667, +155.667, 169.322, 169.322, 169.322, 174.784, 177.515, 180.246, 177.515, +314.065, 376.878, 352.299, 174.784, 185.708, 191.170, 185.708, 180.246, +174.784, 163.860, 158.398, 152.936, 144.743, 144.743, 152.936, 169.322, +314.065, 390.533, 428.767, 426.036, 434.229 +}; + +const size_t array_float2_size = sizeof(array_float2); + +const double array_double1[YSIZE * XSIZE] = +{ +148.914762, 145.451628, 148.914762, 155.841030, 154.109463, 147.183195, +155.841030, 135.062226, 133.330659, 136.793793, 129.867525, 133.330659, +136.793793, 148.914762, 150.646329, 143.720061, 141.988494, 150.646329, +154.109463, 152.377896, 148.914762, 150.646329, 152.377896, 150.646329, +140.256927, 145.451628, 147.183195, 147.183195, 145.451628, 148.914762, +152.377896, 157.572597, 166.230432, 164.498865, 167.961999, 164.498865, +154.109463, +147.183195, 141.988494, 140.256927, 152.377896, 154.109463, 147.183195, +154.109463, 143.720061, 128.135958, 136.793793, 131.599092, 133.330659, +138.525360, 150.646329, 150.646329, 145.451628, 145.451628, 152.377896, +155.841030, 154.109463, 150.646329, 147.183195, 150.646329, 152.377896, +143.720061, 138.525360, 141.988494, 145.451628, 147.183195, 150.646329, +155.841030, 164.498865, 166.230432, 164.498865, 164.498865, 159.304164, +155.841030, +147.183195, 140.256927, 136.793793, 145.451628, 155.841030, 150.646329, +152.377896, 152.377896, 126.404391, 136.793793, 129.867525, 131.599092, +136.793793, 152.377896, 152.377896, 150.646329, 147.183195, 155.841030, +159.304164, 154.109463, 152.377896, 152.377896, 150.646329, 148.914762, +145.451628, 141.988494, 141.988494, 143.720061, 150.646329, 154.109463, +161.035731, 162.767298, 161.035731, 161.035731, 159.304164, 159.304164, +166.230432, +147.183195, 141.988494, 131.599092, 138.525360, 152.377896, 154.109463, +152.377896, 154.109463, 126.404391, 138.525360, 129.867525, 129.867525, +133.330659, 154.109463, 159.304164, 161.035731, 157.572597, 154.109463, +162.767298, 159.304164, 155.841030, 154.109463, 152.377896, 145.451628, +145.451628, 141.988494, 141.988494, 147.183195, 152.377896, 157.572597, +162.767298, 161.035731, 161.035731, 154.109463, 155.841030, 166.230432, +166.230432, +150.646329, 143.720061, 129.867525, 133.330659, 143.720061, 154.109463, +155.841030, 155.841030, 128.135958, 135.062226, 131.599092, 131.599092, +131.599092, 145.451628, 162.767298, 173.156700, 154.109463, 159.304164, +162.767298, 159.304164, 155.841030, 154.109463, 155.841030, 147.183195, +145.451628, 143.720061, 143.720061, 150.646329, 157.572597, 159.304164, +152.377896, 159.304164, 157.572597, 152.377896, 155.841030, 167.961999, +164.498865, +154.109463, 143.720061, 128.135958, 133.330659, 141.988494, 145.451628, +155.841030, 159.304164, 135.062226, 124.672824, 131.599092, 129.867525, +129.867525, 140.256927, 164.498865, 174.888267, 164.498865, 159.304164, +164.498865, 161.035731, 155.841030, 154.109463, 155.841030, 150.646329, +148.914762, 145.451628, 148.914762, 152.377896, 155.841030, 155.841030, +150.646329, 155.841030, 154.109463, 155.841030, 154.109463, 169.693566, +169.693566, +159.304164, 145.451628, 129.867525, 131.599092, 140.256927, 140.256927, +148.914762, 157.572597, 140.256927, 124.672824, 128.135958, 128.135958, +129.867525, 140.256927, 180.082968, 187.009236, 161.035731, 159.304164, +164.498865, 162.767298, 152.377896, 150.646329, 154.109463, 150.646329, +147.183195, 147.183195, 152.377896, 154.109463, 161.035731, 157.572597, +152.377896, 152.377896, 157.572597, 152.377896, 157.572597, 183.546102, +187.009236, +161.035731, 154.109463, 135.062226, 129.867525, 133.330659, 138.525360, +147.183195, 148.914762, 147.183195, 126.404391, 124.672824, 126.404391, +128.135958, 136.793793, 176.619834, 174.888267, 152.377896, 159.304164, +161.035731, 157.572597, 150.646329, 150.646329, 148.914762, 150.646329, +147.183195, 148.914762, 152.377896, 154.109463, 162.767298, 162.767298, +155.841030, 152.377896, 147.183195, 148.914762, 169.693566, 188.740803, +195.667071, +159.304164, 161.035731, 143.720061, 131.599092, 128.135958, 136.793793, +145.451628, 147.183195, 140.256927, 129.867525, 124.672824, 126.404391, +128.135958, 136.793793, 181.814535, 148.914762, 148.914762, 159.304164, +166.230432, 169.693566, 180.082968, 148.914762, 147.183195, 147.183195, +147.183195, 152.377896, 155.841030, 155.841030, 161.035731, 159.304164, +152.377896, 150.646329, 148.914762, 154.109463, 167.961999, 190.472370, +188.740803, +159.304164, 161.035731, 154.109463, 135.062226, 136.793793, 135.062226, +154.109463, 145.451628, 129.867525, 131.599092, 126.404391, 124.672824, +126.404391, 135.062226, 181.814535, 143.720061, 141.988494, 152.377896, +143.720061, 185.277669, 164.498865, 145.451628, 147.183195, 145.451628, +148.914762, 150.646329, 155.841030, 157.572597, 159.304164, 155.841030, +152.377896, 150.646329, 154.109463, 155.841030, 157.572597, 171.425133, +185.277669, +166.230432, 162.767298, 157.572597, 141.988494, 145.451628, 148.914762, +157.572597, 150.646329, 129.867525, 128.135958, 126.404391, 126.404391, +126.404391, 133.330659, 174.888267, 148.914762, 143.720061, 154.109463, +159.304164, 171.425133, 169.693566, 148.914762, 148.914762, 150.646329, +143.720061, 145.451628, 154.109463, 154.109463, 159.304164, 159.304164, +159.304164, 166.230432, 166.230432, 150.646329, 157.572597, 155.841030, +169.693566, +166.230432, 167.961999, 162.767298, 150.646329, 152.377896, 154.109463, +159.304164, 155.841030, 136.793793, 124.672824, 126.404391, 126.404391, +128.135958, 133.330659, 173.156700, 159.304164, 145.451628, 148.914762, +169.693566, 173.156700, 159.304164, 150.646329, 152.377896, 152.377896, +145.451628, 143.720061, 150.646329, 154.109463, 157.572597, 162.767298, +162.767298, 166.230432, 161.035731, 150.646329, 150.646329, 145.451628, +188.740803, +161.035731, 159.304164, 164.498865, 159.304164, 162.767298, 161.035731, +159.304164, 157.572597, 141.988494, 124.672824, 126.404391, 128.135958, +128.135958, 131.599092, 164.498865, 154.109463, 147.183195, 145.451628, +176.619834, 154.109463, 147.183195, 152.377896, 162.767298, 148.914762, +141.988494, 143.720061, 141.988494, 157.572597, 162.767298, 167.961999, +155.841030, 159.304164, 147.183195, 155.841030, 147.183195, 136.793793, +216.445875, +154.109463, 166.230432, 162.767298, 155.841030, 162.767298, 164.498865, +157.572597, 157.572597, 147.183195, 131.599092, 124.672824, 126.404391, +128.135958, 129.867525, 152.377896, 173.156700, 143.720061, 145.451628, +145.451628, 143.720061, 147.183195, 152.377896, 155.841030, 147.183195, +145.451628, 143.720061, 145.451628, 152.377896, 159.304164, 161.035731, +155.841030, 154.109463, 145.451628, 155.841030, 162.767298, 136.793793, +240.687813, +161.035731, 167.961999, 167.961999, 161.035731, 159.304164, 164.498865, +157.572597, 155.841030, 150.646329, 140.256927, 128.135958, 126.404391, +126.404391, 128.135958, 147.183195, 167.961999, 164.498865, 164.498865, +154.109463, 148.914762, 148.914762, 159.304164, 150.646329, 147.183195, +145.451628, 155.841030, 148.914762, 147.183195, 157.572597, 150.646329, +150.646329, 148.914762, 161.035731, 214.714308, 242.419380, 183.546102, +247.614081, +174.888267, 164.498865, 167.961999, 167.961999, 166.230432, 164.498865, +145.451628, 152.377896, 150.646329, 141.988494, 135.062226, 126.404391, +126.404391, 128.135958, 141.988494, 159.304164, 180.082968, 164.498865, +152.377896, 154.109463, 150.646329, 154.109463, 148.914762, 147.183195, +148.914762, 150.646329, 150.646329, 140.256927, 140.256927, 143.720061, +157.572597, 183.546102, 226.835277, 264.929751, 261.466617, 212.982741, +230.298411, +171.425133, 174.888267, 176.619834, 171.425133, 166.230432, 155.841030, +143.720061, 141.988494, 147.183195, 145.451628, 136.793793, 131.599092, +128.135958, 128.135958, 135.062226, 140.256927, 154.109463, 166.230432, +155.841030, 161.035731, 152.377896, 152.377896, 148.914762, 152.377896, +154.109463, 164.498865, 154.109463, 141.988494, 140.256927, 147.183195, +180.082968, 204.324906, 244.150947, 277.050720, 223.372143, 237.224679, +254.540349, +178.351401, 180.082968, 169.693566, 171.425133, 155.841030, 152.377896, +140.256927, 131.599092, 140.256927, 143.720061, 136.793793, 133.330659, +129.867525, 129.867525, 129.867525, 131.599092, 138.525360, 155.841030, +162.767298, 150.646329, 148.914762, 150.646329, 159.304164, 147.183195, +147.183195, 147.183195, 150.646329, 150.646329, 154.109463, 157.572597, +193.935504, 199.130205, 251.077215, 266.661318, 251.077215, 244.150947, +254.540349, +183.546102, 178.351401, 173.156700, 171.425133, 159.304164, 141.988494, +135.062226, 129.867525, 135.062226, 140.256927, 136.793793, 133.330659, +133.330659, 135.062226, 135.062226, 131.599092, 133.330659, 140.256927, +154.109463, 150.646329, 145.451628, 145.451628, 155.841030, 148.914762, +147.183195, 145.451628, 138.525360, 147.183195, 167.961999, 180.082968, +206.056473, 206.056473, 258.003483, 254.540349, 249.345648, 252.808782, +263.198184, +185.277669, 181.814535, 178.351401, 173.156700, 161.035731, 143.720061, +135.062226, 128.135958, 128.135958, 136.793793, 135.062226, 133.330659, +131.599092, 135.062226, 138.525360, 136.793793, 131.599092, 135.062226, +143.720061, 145.451628, 140.256927, 140.256927, 145.451628, 143.720061, +141.988494, 135.062226, 135.062226, 147.183195, 148.914762, 167.961999, +181.814535, 197.398638, 251.077215, 252.808782, 256.271916, 254.540349, +259.735050, +185.277669, 181.814535, 178.351401, 167.961999, 159.304164, 145.451628, +124.672824, 124.672824, 129.867525, 133.330659, 131.599092, 129.867525, +131.599092, 136.793793, 138.525360, 138.525360, 133.330659, 131.599092, +141.988494, 140.256927, 138.525360, 140.256927, 138.525360, 138.525360, +138.525360, 133.330659, 128.135958, 128.135958, 126.404391, 133.330659, +157.572597, 190.472370, 228.566844, 244.150947, 263.198184, 263.198184, +251.077215, +185.277669, 181.814535, 178.351401, 166.230432, 159.304164, 148.914762, +126.404391, 122.941257, 126.404391, 129.867525, 129.867525, 131.599092, +131.599092, 135.062226, 138.525360, 138.525360, 138.525360, 169.693566, +138.525360, 138.525360, 141.988494, 141.988494, 138.525360, 135.062226, +131.599092, 126.404391, 122.941257, 124.672824, 122.941257, 128.135958, +138.525360, 187.009236, 206.056473, 235.493112, 273.587586, 245.882514, +237.224679, +185.277669, 180.082968, 174.888267, 167.961999, 147.183195, 150.646329, +129.867525, 121.209690, 121.209690, 128.135958, 128.135958, 129.867525, +133.330659, 135.062226, 138.525360, 141.988494, 190.472370, 202.593339, +190.472370, 135.062226, 140.256927, 143.720061, 140.256927, 135.062226, +131.599092, 126.404391, 122.941257, 119.478123, 117.746556, 122.941257, +128.135958, 164.498865, 207.788040, 238.956246, 256.271916, 247.614081, +240.687813 +}; + +const size_t array_double1_size = sizeof(array_double1); + +const double array_double2[YSIZE * XSIZE] = +{ +133.330659, 126.404391, 131.599092, 138.525360, 136.793793, 129.867525, +141.988494, 112.551855, 107.357154, 110.820288, 102.162453, 102.162453, +105.625587, 124.672824, 121.209690, 116.014989, 112.551855, 121.209690, +122.941257, 121.209690, 117.746556, 114.283422, 112.551855, 116.014989, +114.283422, 114.283422, 114.283422, 114.283422, 114.283422, 114.283422, +114.283422, 114.283422, 114.283422, 112.551855, 109.088721, 109.088721, +107.357154, +129.867525, 122.941257, 122.941257, 136.793793, 140.256927, 129.867525, +140.256927, 126.404391, 102.162453, 112.551855, 103.894020, 103.894020, +110.820288, 126.404391, 126.404391, 117.746556, 114.283422, 121.209690, +124.672824, 122.941257, 117.746556, 114.283422, 114.283422, 116.014989, +114.283422, 114.283422, 114.283422, 116.014989, 116.014989, 116.014989, +114.283422, 116.014989, 114.283422, 110.820288, 109.088721, 109.088721, +109.088721, +131.599092, 122.941257, 114.283422, 126.404391, 140.256927, 135.062226, +138.525360, 136.793793, 102.162453, 114.283422, 103.894020, 102.162453, +107.357154, 128.135958, 128.135958, 122.941257, 116.014989, 121.209690, +126.404391, 122.941257, 117.746556, 114.283422, 112.551855, 112.551855, +114.283422, 114.283422, 116.014989, 116.014989, 116.014989, 116.014989, +116.014989, 116.014989, 114.283422, 110.820288, 110.820288, 110.820288, +110.820288, +131.599092, 124.672824, 110.820288, 117.746556, 136.793793, 140.256927, +138.525360, 138.525360, 102.162453, 117.746556, 103.894020, 102.162453, +103.894020, 129.867525, 129.867525, 126.404391, 116.014989, 117.746556, +126.404391, 124.672824, 117.746556, 114.283422, 112.551855, 109.088721, +116.014989, 116.014989, 116.014989, 116.014989, 117.746556, 116.014989, +116.014989, 114.283422, 112.551855, 110.820288, 112.551855, 112.551855, +112.551855, +136.793793, 124.672824, 109.088721, 114.283422, 126.404391, 138.525360, +143.720061, 141.988494, 103.894020, 112.551855, 105.625587, 105.625587, +103.894020, 114.283422, 129.867525, 129.867525, 112.551855, 121.209690, +126.404391, 124.672824, 117.746556, 114.283422, 112.551855, 110.820288, +117.746556, 116.014989, 117.746556, 117.746556, 117.746556, 116.014989, +116.014989, 114.283422, 112.551855, 112.551855, 112.551855, 114.283422, +112.551855, +140.256927, 126.404391, 107.357154, 112.551855, 124.672824, 128.135958, +141.988494, 147.183195, 114.283422, 102.162453, 107.357154, 103.894020, +103.894020, 109.088721, 129.867525, 131.599092, 117.746556, 119.478123, +124.672824, 124.672824, 117.746556, 114.283422, 114.283422, 112.551855, +116.014989, 117.746556, 117.746556, 117.746556, 117.746556, 117.746556, +114.283422, 114.283422, 110.820288, 114.283422, 112.551855, 114.283422, +114.283422, +145.451628, 128.135958, 110.820288, 110.820288, 121.209690, 122.941257, +135.062226, 145.451628, 121.209690, 100.430886, 103.894020, 102.162453, +102.162453, 109.088721, 129.867525, 138.525360, 126.404391, 116.014989, +124.672824, 124.672824, 117.746556, 114.283422, 114.283422, 112.551855, +114.283422, 117.746556, 117.746556, 117.746556, 117.746556, 117.746556, +114.283422, 112.551855, 112.551855, 112.551855, 114.283422, 116.014989, +117.746556, +150.646329, 140.256927, 114.283422, 109.088721, 112.551855, 117.746556, +131.599092, 131.599092, 129.867525, 102.162453, 100.430886, 102.162453, +102.162453, 103.894020, 122.941257, 159.304164, 112.551855, 110.820288, +128.135958, 124.672824, 119.478123, 116.014989, 112.551855, 112.551855, +112.551855, 117.746556, 119.478123, 117.746556, 119.478123, 116.014989, +112.551855, 112.551855, 112.551855, 112.551855, 116.014989, 117.746556, +119.478123, +148.914762, 148.914762, 126.404391, 110.820288, 107.357154, 116.014989, +129.867525, 131.599092, 121.209690, 105.625587, 100.430886, 100.430886, +102.162453, 103.894020, 140.256927, 117.746556, 102.162453, 109.088721, +128.135958, 155.841030, 171.425133, 116.014989, 112.551855, 112.551855, +110.820288, 116.014989, 117.746556, 117.746556, 117.746556, 116.014989, +112.551855, 112.551855, 114.283422, 112.551855, 114.283422, 117.746556, +117.746556, +147.183195, 147.183195, 138.525360, 114.283422, 116.014989, 116.014989, +140.256927, 128.135958, 107.357154, 109.088721, 102.162453, 100.430886, +100.430886, 103.894020, 161.035731, 105.625587, 102.162453, 102.162453, +117.746556, 199.130205, 131.599092, 116.014989, 114.283422, 110.820288, +110.820288, 114.283422, 117.746556, 117.746556, 117.746556, 114.283422, +112.551855, 112.551855, 114.283422, 112.551855, 110.820288, 112.551855, +119.478123, +155.841030, 150.646329, 143.720061, 122.941257, 128.135958, 133.330659, +143.720061, 136.793793, 109.088721, 103.894020, 102.162453, 102.162453, +100.430886, 100.430886, 155.841030, 105.625587, 102.162453, 102.162453, +116.014989, 138.525360, 122.941257, 117.746556, 114.283422, 110.820288, +109.088721, 109.088721, 117.746556, 117.746556, 117.746556, 114.283422, +112.551855, 114.283422, 116.014989, 112.551855, 110.820288, 107.357154, +150.646329, +157.572597, 159.304164, 148.914762, 131.599092, 135.062226, 140.256927, +147.183195, 141.988494, 116.014989, 102.162453, 102.162453, 102.162453, +102.162453, 103.894020, 152.377896, 124.672824, 102.162453, 103.894020, +128.135958, 138.525360, 121.209690, 116.014989, 114.283422, 110.820288, +107.357154, 103.894020, 112.551855, 117.746556, 116.014989, 114.283422, +112.551855, 116.014989, 114.283422, 110.820288, 107.357154, 102.162453, +192.203937, +145.451628, 145.451628, 150.646329, 147.183195, 150.646329, 147.183195, +145.451628, 145.451628, 124.672824, 102.162453, 102.162453, 102.162453, +102.162453, 102.162453, 126.404391, 122.941257, 107.357154, 102.162453, +173.156700, 121.209690, 121.209690, 116.014989, 114.283422, 110.820288, +103.894020, 100.430886, 100.430886, 116.014989, 117.746556, 114.283422, +112.551855, 114.283422, 110.820288, 109.088721, 102.162453, 96.967752, +226.835277, +138.525360, 155.841030, 150.646329, 143.720061, 152.377896, 154.109463, +145.451628, 143.720061, 131.599092, 110.820288, 102.162453, 102.162453, +102.162453, 100.430886, 102.162453, 167.961999, 110.820288, 107.357154, +122.941257, 117.746556, 121.209690, 126.404391, 114.283422, 109.088721, +105.625587, 100.430886, 100.430886, 107.357154, 116.014989, 114.283422, +110.820288, 112.551855, 109.088721, 109.088721, 105.625587, 98.699319, +258.003483, +148.914762, 157.572597, 159.304164, 150.646329, 147.183195, 152.377896, +143.720061, 140.256927, 135.062226, 119.478123, 105.625587, 102.162453, +102.162453, 102.162453, 102.162453, 105.625587, 143.720061, 124.672824, +116.014989, 116.014989, 119.478123, 119.478123, 114.283422, 110.820288, +105.625587, 124.672824, 96.967752, 98.699319, 110.820288, 110.820288, +110.820288, 110.820288, 112.551855, 199.130205, 259.735050, 161.035731, +261.466617, +167.961999, 154.109463, 157.572597, 159.304164, 154.109463, 152.377896, +128.135958, 138.525360, 135.062226, 122.941257, 112.551855, 102.162453, +100.430886, 102.162453, 100.430886, 102.162453, 122.941257, 124.672824, +116.014989, 121.209690, 121.209690, 119.478123, 116.014989, 110.820288, +109.088721, 114.283422, 96.967752, 93.504618, 98.699319, 102.162453, +110.820288, 150.646329, 240.687813, 280.513854, 277.050720, 221.640576, +244.150947, +162.767298, 166.230432, 167.961999, 162.767298, 154.109463, 141.988494, +122.941257, 121.209690, 131.599092, 126.404391, 116.014989, 105.625587, +102.162453, 102.162453, 100.430886, 102.162453, 105.625587, 122.941257, +116.014989, 129.867525, 121.209690, 117.746556, 121.209690, 112.551855, +109.088721, 109.088721, 102.162453, 96.967752, 93.504618, 95.236185, +155.841030, 209.519607, 258.003483, 290.903256, 238.956246, 249.345648, +271.856019, +171.425133, 173.156700, 161.035731, 161.035731, 141.988494, 138.525360, +121.209690, 107.357154, 121.209690, 124.672824, 116.014989, 109.088721, +103.894020, 103.894020, 100.430886, 100.430886, 103.894020, 117.746556, +121.209690, 121.209690, 119.478123, 117.746556, 136.793793, 117.746556, +110.820288, 107.357154, 103.894020, 102.162453, 98.699319, 98.699319, +152.377896, 207.788040, 261.466617, 280.513854, 266.661318, 258.003483, +268.392885, +178.351401, 171.425133, 164.498865, 162.767298, 145.451628, 126.404391, +116.014989, 107.357154, 112.551855, 119.478123, 116.014989, 110.820288, +109.088721, 110.820288, 109.088721, 102.162453, 103.894020, 112.551855, +122.941257, 119.478123, 119.478123, 116.014989, 135.062226, 112.551855, +109.088721, 105.625587, 102.162453, 105.625587, 103.894020, 117.746556, +173.156700, 221.640576, 268.392885, 268.392885, 263.198184, 268.392885, +283.976988, +180.082968, 176.619834, 171.425133, 164.498865, 148.914762, 128.135958, +116.014989, 105.625587, 105.625587, 114.283422, 112.551855, 109.088721, +109.088721, 110.820288, 112.551855, 109.088721, 103.894020, 109.088721, +121.209690, 119.478123, 116.014989, 116.014989, 116.014989, 112.551855, +107.357154, 103.894020, 100.430886, 98.699319, 107.357154, 100.430886, +122.941257, 202.593339, 259.735050, 266.661318, 271.856019, 268.392885, +282.245421, +180.082968, 174.888267, 171.425133, 157.572597, 145.451628, 128.135958, +102.162453, 102.162453, 107.357154, 110.820288, 109.088721, 105.625587, +107.357154, 110.820288, 110.820288, 110.820288, 105.625587, 103.894020, +119.478123, 117.746556, 116.014989, 119.478123, 116.014989, 112.551855, +107.357154, 102.162453, 100.430886, 98.699319, 98.699319, 96.967752, +102.162453, 180.082968, 237.224679, 254.540349, 275.319153, 278.782287, +273.587586, +180.082968, 174.888267, 171.425133, 155.841030, 147.183195, 133.330659, +103.894020, 98.699319, 103.894020, 107.357154, 107.357154, 107.357154, +109.088721, 110.820288, 112.551855, 112.551855, 114.283422, 173.156700, +116.014989, 116.014989, 119.478123, 119.478123, 116.014989, 112.551855, +109.088721, 103.894020, 100.430886, 96.967752, 93.504618, 95.236185, +96.967752, 133.330659, 211.251174, 245.882514, 287.440122, 271.856019, +259.735050, +180.082968, 174.888267, 167.961999, 159.304164, 133.330659, 136.793793, +110.820288, 98.699319, 98.699319, 107.357154, 107.357154, 107.357154, +110.820288, 112.551855, 114.283422, 112.551855, 199.130205, 238.956246, +223.372143, 110.820288, 117.746556, 121.209690, 117.746556, 114.283422, +110.820288, 103.894020, 100.430886, 96.967752, 91.773051, 91.773051, +96.967752, 107.357154, 199.130205, 247.614081, 271.856019, 270.124452, +275.319153 +}; + +const size_t array_double2_size = sizeof(array_double2); + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.h b/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.h new file mode 100644 index 0000000..5131b23 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/test_arrays.h @@ -0,0 +1,63 @@ +/* $Id: test_arrays.h,v 1.3 2006/03/23 14:54:02 dron Exp $ */ + +/* + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * TIFF Library + * + * Few declarations for the test numerical arrays. + */ + +#ifndef _TEST_ARRAYS_ +#define _TEST_ARRAYS_ + +#include + +#define XSIZE 37 +#define YSIZE 23 + +extern const unsigned char byte_array1[]; +extern const size_t byte_array1_size; + +extern const unsigned char byte_array2[]; +extern const size_t byte_array2_size; + +extern const unsigned char byte_array3[]; +extern const size_t byte_array3_size; + +extern const float array_float1[]; +extern const size_t array_float1_size; + +extern const float array_float2[]; +extern const size_t array_float2_size; + +extern const double array_double1[]; +extern const size_t array_double1_size; + +extern const double array_double2[]; +extern const size_t array_double2_size; + +#endif /* _TEST_ARRAYS_ */ + +/* vim: set ts=8 sts=8 sw=8 noet: */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2pdf.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2pdf.sh new file mode 100644 index 0000000..7669989 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2pdf.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiff2pdf +# +. ${srcdir:-.}/common.sh +f_test_stdout "${TIFF2PDF}" "${IMG_MINISWHITE_1C_1B}" "o-tiff2pdf.pdf" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-EPS1.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-EPS1.sh new file mode 100644 index 0000000..ebe6f04 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-EPS1.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffps with PostScript Level 1 encapsulated output +# +. ${srcdir:-.}/common.sh +f_test_stdout "${TIFF2PS} -e -1" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-EPS1.ps" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS1.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS1.sh new file mode 100644 index 0000000..6592159 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS1.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffps with PostScript Level 1 output +# +. ${srcdir:-.}/common.sh +f_test_stdout "${TIFF2PS} -a -p -1" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS1.ps" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS2.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS2.sh new file mode 100644 index 0000000..2a21606 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS2.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffps with PostScript Level 2 output +# +. ${srcdir:-.}/common.sh +f_test_stdout "${TIFF2PS} -a -p -2" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS2.ps" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS3.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS3.sh new file mode 100644 index 0000000..f9f34b6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2ps-PS3.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffps with PostScript Level 3 output +# +. ${srcdir:-.}/common.sh +f_test_stdout "${TIFF2PS} -a -p -3" "${IMG_MINISWHITE_1C_1B}" "o-tiff2ps-PS3.ps" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-logluv-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-logluv-3c-16b.sh new file mode 100644 index 0000000..bc9b311 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiff2rgba-logluv-3c-16b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-16b.sh new file mode 100644 index 0000000..5be7e65 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiff2rgba-minisblack-1c-16b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-8b.sh new file mode 100644 index 0000000..ce0507b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiff2rgba-minisblack-1c-8b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-2c-8b-alpha.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-2c-8b-alpha.sh new file mode 100644 index 0000000..2cbe81d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiff2rgba-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-miniswhite-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-miniswhite-1c-1b.sh new file mode 100644 index 0000000..3601502 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiff2rgba-miniswhite-1c-1b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-1b.sh new file mode 100644 index 0000000..091d798 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiff2rgba-palette-1c-1b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-4b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-4b.sh new file mode 100644 index 0000000..ee3898e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiff2rgba-palette-1c-4b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-8b.sh new file mode 100644 index 0000000..b1db606 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-palette-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-8b.tiff" +outfile="o-tiff2rgba-palette-1c-8b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-quad-tile.jpg.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-quad-tile.jpg.sh new file mode 100644 index 0000000..e921b97 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-quad-tile.jpg.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/quad-tile.jpg.tiff" +outfile="o-tiff2rgba-quad-tile.jpg.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-16b.sh new file mode 100644 index 0000000..954eb4f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiff2rgba-rgb-3c-16b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-8b.sh new file mode 100644 index 0000000..24f5cb0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiff2rgba-rgb-3c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-8b.tiff" +outfile="o-tiff2rgba-rgb-3c-8b.tiff" +f_test_convert "$TIFF2RGBA" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d-fill.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d-fill.sh new file mode 100644 index 0000000..ee12498 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d-fill.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G3 compression, 1 dimensional +# encoding, and zero-filled boundaries. +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g3:1d:fill" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-1d-fill.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d.sh new file mode 100644 index 0000000..c11ef97 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-1d.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G3 compression and 1 dimensional encoding. +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g3:1d" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-1d.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d-fill.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d-fill.sh new file mode 100644 index 0000000..c25825d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d-fill.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G3 compression, 2 dimensional +# encoding, and zero-filled boundaries. +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g3:2d:fill" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-2d-fill.tiff" diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d.sh new file mode 100644 index 0000000..5a59dd2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3-2d.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G3 compression and 2 dimensional encoding. +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g3:2d" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3-2d.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3.sh new file mode 100644 index 0000000..d7a0107 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g3.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G3 compression +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g3" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g3.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g4.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g4.sh new file mode 100644 index 0000000..fb8967a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-g4.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with G4 compression +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c g4" "${IMG_MINISWHITE_1C_1B}" "o-tiffcp-g4.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-logluv.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-logluv.sh new file mode 100644 index 0000000..3f62f57 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-logluv.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp with logluv compression +# +. ${srcdir:-.}/common.sh +f_test_convert "${TIFFCP} -c none" "${srcdir}/images/logluv-3c-16b.tiff" "o-tiffcp-logluv-raw.tiff" +f_test_convert "${TIFFCP} -c sgilog" "o-tiffcp-logluv-raw.tiff" "o-tiffcp-logluv-sgilog.tiff" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split-join.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split-join.sh new file mode 100644 index 0000000..d1e407c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split-join.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp + tiffsplit + tiffcp +# +# First we use tiffcp to join our test files into a multi-frame TIFF +# then we use tiffsplit to split them out again, and then we use +# tiffcp to recombine again. + +. ${srcdir:-.}/common.sh +conjoined=o-tiffcp-split-join-conjoined.tif +reconjoined=o-tiffcp-split-join-reconjoined.tif +splitfile=o-tiffcp-split-join-split- + +f_test_convert "${TIFFCP}" "${IMG_UNCOMPRESSED}" "${conjoined}" +f_test_convert "${TIFFSPLIT}" "${conjoined}" "${splitfile}" +f_test_convert "${TIFFCP}" "${splitfile}*" "${reconjoined}" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split.sh new file mode 100644 index 0000000..a2f98e3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-split.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Basic sanity check for tiffcp + tiffsplit +# +# First we use tiffcp to join our test files into a multi-frame TIFF +# and then we use tiffsplit to split them out again. +# +. ${srcdir:-.}/common.sh +conjoined=o-tiffcp-split-conjoined.tif +splitfile=o-tiffcp-split-split- + +f_test_convert "${TIFFCP}" "${IMG_UNCOMPRESSED}" "${conjoined}" +f_test_convert "${TIFFSPLIT}" "${conjoined}" "${splitfile}" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-thumbnail.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-thumbnail.sh new file mode 100644 index 0000000..789cd80 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcp-thumbnail.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Basic sanity check for thumbnail +# +. ${srcdir:-.}/common.sh + +outfile1=o-tiffcp-thumbnail-in.tif +outfile2=o-tiffcp-thumbnail-out.tif +f_test_convert "${TIFFCP} -c g3:1d" "${IMG_MINISWHITE_1C_1B}" "${outfile1}" +f_test_convert "${THUMBNAIL}" "${outfile1}" "${outfile2}" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-logluv-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-logluv-3c-16b.sh new file mode 100644 index 0000000..9ed219e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiffcrop-R90-logluv-3c-16b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-16b.sh new file mode 100644 index 0000000..faee731 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiffcrop-R90-minisblack-1c-16b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-8b.sh new file mode 100644 index 0000000..7acd5e7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiffcrop-R90-minisblack-1c-8b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-2c-8b-alpha.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-2c-8b-alpha.sh new file mode 100644 index 0000000..2ef9039 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiffcrop-R90-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-miniswhite-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-miniswhite-1c-1b.sh new file mode 100644 index 0000000..cae85f2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiffcrop-R90-miniswhite-1c-1b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-1b.sh new file mode 100644 index 0000000..ca68b88 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiffcrop-R90-palette-1c-1b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-4b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-4b.sh new file mode 100644 index 0000000..3cd96eb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiffcrop-R90-palette-1c-4b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-8b.sh new file mode 100644 index 0000000..daccfd3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-palette-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-8b.tiff" +outfile="o-tiffcrop-R90-palette-1c-8b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-16b.sh new file mode 100644 index 0000000..b1dddc3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiffcrop-R90-rgb-3c-16b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-8b.sh new file mode 100644 index 0000000..0a502c8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-R90-rgb-3c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-8b.tiff" +outfile="o-tiffcrop-R90-rgb-3c-8b.tiff" +f_test_convert "$TIFFCROP -R90" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-logluv-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-logluv-3c-16b.sh new file mode 100644 index 0000000..c1b19b9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiffcrop-doubleflip-logluv-3c-16b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-16b.sh new file mode 100644 index 0000000..1e2c4c9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiffcrop-doubleflip-minisblack-1c-16b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-8b.sh new file mode 100644 index 0000000..77798d9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiffcrop-doubleflip-minisblack-1c-8b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh new file mode 100644 index 0000000..b5b9db6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiffcrop-doubleflip-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-miniswhite-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-miniswhite-1c-1b.sh new file mode 100644 index 0000000..07aab91 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiffcrop-doubleflip-miniswhite-1c-1b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-1b.sh new file mode 100644 index 0000000..581f7eb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiffcrop-doubleflip-palette-1c-1b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-4b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-4b.sh new file mode 100644 index 0000000..d09b2aa --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiffcrop-doubleflip-palette-1c-4b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-8b.sh new file mode 100644 index 0000000..53a08ae --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-palette-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-8b.tiff" +outfile="o-tiffcrop-doubleflip-palette-1c-8b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-16b.sh new file mode 100644 index 0000000..7165ad5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiffcrop-doubleflip-rgb-3c-16b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-8b.sh new file mode 100644 index 0000000..6bfa067 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-doubleflip-rgb-3c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-8b.tiff" +outfile="o-tiffcrop-doubleflip-rgb-3c-8b.tiff" +f_test_convert "$TIFFCROP -F both" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-logluv-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-logluv-3c-16b.sh new file mode 100644 index 0000000..821694b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiffcrop-extract-logluv-3c-16b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-16b.sh new file mode 100644 index 0000000..603fc1c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiffcrop-extract-minisblack-1c-16b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-8b.sh new file mode 100644 index 0000000..6e473c5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiffcrop-extract-minisblack-1c-8b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-2c-8b-alpha.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-2c-8b-alpha.sh new file mode 100644 index 0000000..976e888 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiffcrop-extract-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-miniswhite-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-miniswhite-1c-1b.sh new file mode 100644 index 0000000..ca2b63c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiffcrop-extract-miniswhite-1c-1b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-1b.sh new file mode 100644 index 0000000..e4aca8e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiffcrop-extract-palette-1c-1b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-4b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-4b.sh new file mode 100644 index 0000000..18884e4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiffcrop-extract-palette-1c-4b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-8b.sh new file mode 100644 index 0000000..cd418e0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-palette-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-8b.tiff" +outfile="o-tiffcrop-extract-palette-1c-8b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-16b.sh new file mode 100644 index 0000000..a3899d3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiffcrop-extract-rgb-3c-16b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-8b.sh new file mode 100644 index 0000000..c03b037 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extract-rgb-3c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-8b.tiff" +outfile="o-tiffcrop-extract-rgb-3c-8b.tiff" +f_test_convert "$TIFFCROP -U px -E top -X 60 -Y 60" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-logluv-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-logluv-3c-16b.sh new file mode 100644 index 0000000..a617ad9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-logluv-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/logluv-3c-16b.tiff" +outfile="o-tiffcrop-extractz14-logluv-3c-16b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-16b.sh new file mode 100644 index 0000000..320fd5a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-16b.tiff" +outfile="o-tiffcrop-extractz14-minisblack-1c-16b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-8b.sh new file mode 100644 index 0000000..8df8578 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-1c-8b.tiff" +outfile="o-tiffcrop-extractz14-minisblack-1c-8b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-2c-8b-alpha.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-2c-8b-alpha.sh new file mode 100644 index 0000000..3e8ee15 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-minisblack-2c-8b-alpha.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/minisblack-2c-8b-alpha.tiff" +outfile="o-tiffcrop-extractz14-minisblack-2c-8b-alpha.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-miniswhite-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-miniswhite-1c-1b.sh new file mode 100644 index 0000000..2cbffaa --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-miniswhite-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/miniswhite-1c-1b.tiff" +outfile="o-tiffcrop-extractz14-miniswhite-1c-1b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-1b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-1b.sh new file mode 100644 index 0000000..e0b305f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-1b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-1b.tiff" +outfile="o-tiffcrop-extractz14-palette-1c-1b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-4b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-4b.sh new file mode 100644 index 0000000..980b2bb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-4b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-4b.tiff" +outfile="o-tiffcrop-extractz14-palette-1c-4b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-8b.sh new file mode 100644 index 0000000..af2e04c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-palette-1c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/palette-1c-8b.tiff" +outfile="o-tiffcrop-extractz14-palette-1c-8b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-16b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-16b.sh new file mode 100644 index 0000000..9bc76e3 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-16b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-16b.tiff" +outfile="o-tiffcrop-extractz14-rgb-3c-16b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-8b.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-8b.sh new file mode 100644 index 0000000..21f76b8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffcrop-extractz14-rgb-3c-8b.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Generated file, master is Makefile.am +. ${srcdir:-.}/common.sh +infile="$srcdir/images/rgb-3c-8b.tiff" +outfile="o-tiffcrop-extractz14-rgb-3c-8b.tiff" +f_test_convert "$TIFFCROP -E left -Z1:4,2:4" $infile $outfile +f_tiffinfo_validate $outfile diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffdump.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffdump.sh new file mode 100644 index 0000000..3cd7c10 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffdump.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffdump +# +. ${srcdir:-.}/common.sh +f_test_reader "${TIFFDUMP}" "${IMG_MINISWHITE_1C_1B}" \ No newline at end of file diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tiffinfo.sh b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffinfo.sh new file mode 100644 index 0000000..cb57248 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tiffinfo.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# Basic sanity check for tiffinfo. +# +. ${srcdir:-.}/common.sh +f_test_reader "${TIFFINFO} -c -D -d -j -s " "${IMG_MINISBLACK_1C_16B}" diff --git a/thirdparty/LibTIFF/tiff-4.0.3/test/tifftest.h b/thirdparty/LibTIFF/tiff-4.0.3/test/tifftest.h new file mode 100644 index 0000000..3305206 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/test/tifftest.h @@ -0,0 +1,42 @@ +/* $Id: tifftest.h,v 1.1 2008/04/15 14:18:36 dron Exp $ */ + +/* + * Copyright (c) 2008, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _TIFFTEST_ +#define _TIFFTEST_ + +/* + * TIFF Library + * + * Header file for helper testing routines. + */ + +#include "tiffio.h" + +int CheckShortField(TIFF *, const ttag_t, const uint16); +int CheckShortPairedField(TIFF *, const ttag_t, const uint16*); +int CheckLongField(TIFF *, const ttag_t, const uint32); + +#endif /* _TIFFTEST_ */ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/bmp2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/bmp2tiff.Po new file mode 100644 index 0000000..3fbb83a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/bmp2tiff.Po @@ -0,0 +1,127 @@ +bmp2tiff.o bmp2tiff.o: bmp2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/sys/types.h \ + /usr/include/sys/stat.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/sys/types.h: + +/usr/include/sys/stat.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2ps.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2ps.Po new file mode 100644 index 0000000..cd9490a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2ps.Po @@ -0,0 +1,127 @@ +fax2ps.o fax2ps.o: fax2ps.c ../libtiff/tif_config.h /usr/include/stdlib.h \ + /usr/include/Availability.h /usr/include/AvailabilityInternal.h \ + /usr/include/_types.h /usr/include/sys/_types.h \ + /usr/include/sys/cdefs.h /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/sys/wait.h \ + /usr/include/sys/signal.h /usr/include/sys/appleapiopts.h \ + /usr/include/machine/signal.h /usr/include/i386/signal.h \ + /usr/include/i386/_structs.h /usr/include/sys/_structs.h \ + /usr/include/machine/_structs.h /usr/include/mach/i386/_structs.h \ + /usr/include/sys/resource.h /usr/include/machine/endian.h \ + /usr/include/i386/endian.h /usr/include/sys/_endian.h \ + /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/stdio.h \ + /usr/include/secure/_stdio.h /usr/include/secure/_common.h \ + /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/time.h \ + /usr/include/_structs.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdlib.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/stdio.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/time.h: + +/usr/include/_structs.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2tiff.Po new file mode 100644 index 0000000..1684c33 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/fax2tiff.Po @@ -0,0 +1,133 @@ +fax2tiff.o fax2tiff.o: fax2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h /usr/include/fcntl.h \ + /usr/include/sys/fcntl.h ../libtiff/tiffiop.h ../libtiff/tif_config.h \ + /usr/include/sys/types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/assert.h \ + /usr/include/search.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/sys/types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/gif2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/gif2tiff.Po new file mode 100644 index 0000000..151c1c9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/gif2tiff.Po @@ -0,0 +1,118 @@ +gif2tiff.o gif2tiff.o: gif2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/pal2rgb.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/pal2rgb.Po new file mode 100644 index 0000000..56f818f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/pal2rgb.Po @@ -0,0 +1,118 @@ +pal2rgb.o pal2rgb.o: pal2rgb.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/string.h \ + /usr/include/strings.h /usr/include/secure/_string.h \ + /usr/include/stdlib.h /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/ctype.h /usr/include/runetype.h \ + /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + ../libtiff/tiffio.h ../libtiff/tiff.h ../libtiff/tiffconf.h \ + ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ppm2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ppm2tiff.Po new file mode 100644 index 0000000..9dea921 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ppm2tiff.Po @@ -0,0 +1,122 @@ +ppm2tiff.o ppm2tiff.o: ppm2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ras2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ras2tiff.Po new file mode 100644 index 0000000..aa69824 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ras2tiff.Po @@ -0,0 +1,120 @@ +ras2tiff.o ras2tiff.o: ras2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h rasterfile.h \ + ../libtiff/tiffio.h ../libtiff/tiff.h ../libtiff/tiffconf.h \ + ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +rasterfile.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/raw2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/raw2tiff.Po new file mode 100644 index 0000000..2d22c89 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/raw2tiff.Po @@ -0,0 +1,132 @@ +raw2tiff.o raw2tiff.o: raw2tiff.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/sys/stat.h \ + /usr/include/sys/types.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/sys/stat.h: + +/usr/include/sys/types.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/rgb2ycbcr.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/rgb2ycbcr.Po new file mode 100644 index 0000000..ce82c6e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/rgb2ycbcr.Po @@ -0,0 +1,134 @@ +rgb2ycbcr.o rgb2ycbcr.o: rgb2ycbcr.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/string.h \ + /usr/include/strings.h /usr/include/secure/_string.h \ + /usr/include/stdlib.h /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffiop.h ../libtiff/tif_config.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h /usr/include/sys/types.h \ + /usr/include/assert.h /usr/include/search.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h ../libtiff/tiffio.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +/usr/include/sys/types.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: + +../libtiff/tiffio.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgi2tiff.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgi2tiff.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgi2tiff.Po @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgisv.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgisv.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/sgisv.Po @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/thumbnail.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/thumbnail.Po new file mode 100644 index 0000000..6ebc254 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/thumbnail.Po @@ -0,0 +1,118 @@ +thumbnail.o thumbnail.o: thumbnail.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2bw.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2bw.Po new file mode 100644 index 0000000..253c603 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2bw.Po @@ -0,0 +1,118 @@ +tiff2bw.o tiff2bw.o: tiff2bw.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + ../libtiff/tiffio.h ../libtiff/tiff.h ../libtiff/tiffconf.h \ + ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2pdf.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2pdf.Po new file mode 100644 index 0000000..cac7deb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2pdf.Po @@ -0,0 +1,149 @@ +tiff2pdf.o tiff2pdf.o: tiff2pdf.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/time.h /usr/include/_structs.h \ + /usr/include/errno.h /usr/include/sys/errno.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h /usr/include/fcntl.h \ + /usr/include/sys/fcntl.h ../libtiff/tiffiop.h ../libtiff/tif_config.h \ + /usr/include/sys/types.h /usr/include/assert.h /usr/include/search.h \ + ../libtiff/tiffio.h ../libtiff/tiff.h ../libtiff/tiffconf.h \ + ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h ../libtiff/tiffio.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/time.h: + +/usr/include/_structs.h: + +/usr/include/errno.h: + +/usr/include/sys/errno.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/sys/types.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: + +../libtiff/tiffio.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2ps.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2ps.Po new file mode 100644 index 0000000..a0b7b62 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2ps.Po @@ -0,0 +1,123 @@ +tiff2ps.o tiff2ps.o: tiff2ps.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/time.h \ + /usr/include/_structs.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/time.h: + +/usr/include/_structs.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2rgba.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2rgba.Po new file mode 100644 index 0000000..b4e61fa --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiff2rgba.Po @@ -0,0 +1,134 @@ +tiff2rgba.o tiff2rgba.o: tiff2rgba.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/string.h \ + /usr/include/strings.h /usr/include/secure/_string.h \ + /usr/include/stdlib.h /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffiop.h ../libtiff/tif_config.h \ + /usr/include/fcntl.h /usr/include/sys/fcntl.h /usr/include/sys/types.h \ + /usr/include/assert.h /usr/include/search.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h ../libtiff/tiffio.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +/usr/include/sys/types.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: + +../libtiff/tiffio.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcmp.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcmp.Po new file mode 100644 index 0000000..cd0f0ce --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcmp.Po @@ -0,0 +1,118 @@ +tiffcmp.o tiffcmp.o: tiffcmp.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcp.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcp.Po new file mode 100644 index 0000000..56fe324 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcp.Po @@ -0,0 +1,119 @@ +tiffcp.o tiffcp.o: tiffcp.c ../libtiff/tif_config.h /usr/include/stdio.h \ + /usr/include/sys/cdefs.h /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/ctype.h \ + /usr/include/runetype.h /usr/include/assert.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/include/assert.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcrop.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcrop.Po new file mode 100644 index 0000000..de8ac29 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffcrop.Po @@ -0,0 +1,167 @@ +tiffcrop.o tiffcrop.o: tiffcrop.c ../libtiff/tif_config.h \ + ../libtiff/tiffiop.h ../libtiff/tif_config.h /usr/include/fcntl.h \ + /usr/include/sys/fcntl.h /usr/include/sys/_types.h \ + /usr/include/sys/cdefs.h /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/sys/types.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/types.h \ + /usr/include/i386/types.h /usr/include/i386/_types.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/sys/_structs.h \ + /usr/include/string.h /usr/include/_types.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/secure/_common.h \ + /usr/include/assert.h /usr/include/search.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/include/stdio.h /usr/include/secure/_stdio.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h /usr/include/stdlib.h /usr/include/sys/wait.h \ + /usr/include/sys/signal.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/machine/_structs.h /usr/include/mach/i386/_structs.h \ + /usr/include/sys/resource.h /usr/include/alloca.h /usr/include/math.h \ + /usr/include/architecture/i386/math.h /usr/include/ctype.h \ + /usr/include/runetype.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h \ + /usr/include/limits.h /usr/include/machine/limits.h \ + /usr/include/i386/limits.h /usr/include/i386/_limits.h \ + /usr/include/sys/syslimits.h /usr/include/sys/stat.h \ + /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + /usr/include/stdint.h ../libtiff/tiffio.h + +../libtiff/tif_config.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +/usr/include/sys/_types.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/sys/types.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/sys/_structs.h: + +/usr/include/string.h: + +/usr/include/_types.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/secure/_common.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/include/stdio.h: + +/usr/include/secure/_stdio.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/alloca.h: + +/usr/include/math.h: + +/usr/include/architecture/i386/math.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h: + +/usr/include/limits.h: + +/usr/include/machine/limits.h: + +/usr/include/i386/limits.h: + +/usr/include/i386/_limits.h: + +/usr/include/sys/syslimits.h: + +/usr/include/sys/stat.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/stdint.h: + +../libtiff/tiffio.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdither.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdither.Po new file mode 100644 index 0000000..f1c5e81 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdither.Po @@ -0,0 +1,113 @@ +tiffdither.o tiffdither.o: tiffdither.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdump.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdump.Po new file mode 100644 index 0000000..90ccd87 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffdump.Po @@ -0,0 +1,125 @@ +tiffdump.o tiffdump.o: tiffdump.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h /usr/include/fcntl.h \ + /usr/include/sys/fcntl.h /usr/include/sys/types.h ../libtiff/tiffio.h \ + ../libtiff/tiff.h ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + /usr/include/ctype.h /usr/include/runetype.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +/usr/include/sys/types.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +/usr/include/ctype.h: + +/usr/include/runetype.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Po @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Tpo b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Tpo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffgt-tiffgt.Tpo diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffinfo.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffinfo.Po new file mode 100644 index 0000000..0108ae7 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffinfo.Po @@ -0,0 +1,135 @@ +tiffinfo.o tiffinfo.o: tiffinfo.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/strings.h \ + /usr/include/unistd.h /usr/include/sys/unistd.h \ + /usr/include/sys/select.h /usr/include/sys/_select.h \ + ../libtiff/tiffiop.h ../libtiff/tif_config.h /usr/include/fcntl.h \ + /usr/include/sys/fcntl.h /usr/include/sys/types.h /usr/include/assert.h \ + /usr/include/search.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \ + ../libtiff/tif_dir.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/strings.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffiop.h: + +../libtiff/tif_config.h: + +/usr/include/fcntl.h: + +/usr/include/sys/fcntl.h: + +/usr/include/sys/types.h: + +/usr/include/assert.h: + +/usr/include/search.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: + +../libtiff/tif_dir.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffmedian.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffmedian.Po new file mode 100644 index 0000000..4fd779b --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffmedian.Po @@ -0,0 +1,113 @@ +tiffmedian.o tiffmedian.o: tiffmedian.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h /usr/include/unistd.h \ + /usr/include/sys/unistd.h /usr/include/sys/select.h \ + /usr/include/sys/_select.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/unistd.h: + +/usr/include/sys/unistd.h: + +/usr/include/sys/select.h: + +/usr/include/sys/_select.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffset.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffset.Po new file mode 100644 index 0000000..cf76bef --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffset.Po @@ -0,0 +1,100 @@ +tiffset.o tiffset.o: tiffset.c /usr/include/stdio.h \ + /usr/include/sys/cdefs.h /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/string.h \ + /usr/include/strings.h /usr/include/secure/_string.h \ + /usr/include/stdlib.h /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffsplit.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffsplit.Po new file mode 100644 index 0000000..ab7c099 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/tiffsplit.Po @@ -0,0 +1,103 @@ +tiffsplit.o tiffsplit.o: tiffsplit.c ../libtiff/tif_config.h \ + /usr/include/stdio.h /usr/include/sys/cdefs.h \ + /usr/include/sys/_symbol_aliasing.h \ + /usr/include/sys/_posix_availability.h /usr/include/Availability.h \ + /usr/include/AvailabilityInternal.h /usr/include/_types.h \ + /usr/include/sys/_types.h /usr/include/machine/_types.h \ + /usr/include/i386/_types.h /usr/include/secure/_stdio.h \ + /usr/include/secure/_common.h /usr/include/stdlib.h \ + /usr/include/sys/wait.h /usr/include/sys/signal.h \ + /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \ + /usr/include/i386/signal.h /usr/include/i386/_structs.h \ + /usr/include/sys/_structs.h /usr/include/machine/_structs.h \ + /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \ + /usr/include/machine/endian.h /usr/include/i386/endian.h \ + /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \ + /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \ + /usr/include/machine/types.h /usr/include/i386/types.h \ + /usr/include/i386/_types.h /usr/include/string.h /usr/include/strings.h \ + /usr/include/secure/_string.h ../libtiff/tiffio.h ../libtiff/tiff.h \ + ../libtiff/tiffconf.h ../libtiff/tiffvers.h \ + /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h + +../libtiff/tif_config.h: + +/usr/include/stdio.h: + +/usr/include/sys/cdefs.h: + +/usr/include/sys/_symbol_aliasing.h: + +/usr/include/sys/_posix_availability.h: + +/usr/include/Availability.h: + +/usr/include/AvailabilityInternal.h: + +/usr/include/_types.h: + +/usr/include/sys/_types.h: + +/usr/include/machine/_types.h: + +/usr/include/i386/_types.h: + +/usr/include/secure/_stdio.h: + +/usr/include/secure/_common.h: + +/usr/include/stdlib.h: + +/usr/include/sys/wait.h: + +/usr/include/sys/signal.h: + +/usr/include/sys/appleapiopts.h: + +/usr/include/machine/signal.h: + +/usr/include/i386/signal.h: + +/usr/include/i386/_structs.h: + +/usr/include/sys/_structs.h: + +/usr/include/machine/_structs.h: + +/usr/include/mach/i386/_structs.h: + +/usr/include/sys/resource.h: + +/usr/include/machine/endian.h: + +/usr/include/i386/endian.h: + +/usr/include/sys/_endian.h: + +/usr/include/libkern/_OSByteOrder.h: + +/usr/include/libkern/i386/_OSByteOrder.h: + +/usr/include/alloca.h: + +/usr/include/machine/types.h: + +/usr/include/i386/types.h: + +/usr/include/i386/_types.h: + +/usr/include/string.h: + +/usr/include/strings.h: + +/usr/include/secure/_string.h: + +../libtiff/tiffio.h: + +../libtiff/tiff.h: + +../libtiff/tiffconf.h: + +../libtiff/tiffvers.h: + +/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ycbcr.Po b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ycbcr.Po new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/.deps/ycbcr.Po @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile new file mode 100644 index 0000000..394fbb6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile @@ -0,0 +1,923 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# tools/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/tiff +pkgincludedir = $(includedir)/tiff +pkglibdir = $(libdir)/tiff +pkglibexecdir = $(libexecdir)/tiff +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i386-apple-darwin11.3.0 +host_triplet = i386-apple-darwin11.3.0 +bin_PROGRAMS = bmp2tiff$(EXEEXT) fax2ps$(EXEEXT) fax2tiff$(EXEEXT) \ + gif2tiff$(EXEEXT) pal2rgb$(EXEEXT) ppm2tiff$(EXEEXT) \ + ras2tiff$(EXEEXT) raw2tiff$(EXEEXT) rgb2ycbcr$(EXEEXT) \ + thumbnail$(EXEEXT) tiff2bw$(EXEEXT) tiff2pdf$(EXEEXT) \ + tiff2ps$(EXEEXT) tiff2rgba$(EXEEXT) tiffcmp$(EXEEXT) \ + tiffcp$(EXEEXT) tiffcrop$(EXEEXT) tiffdither$(EXEEXT) \ + tiffdump$(EXEEXT) tiffinfo$(EXEEXT) tiffmedian$(EXEEXT) \ + tiffset$(EXEEXT) tiffsplit$(EXEEXT) $(am__EXEEXT_1) +am__append_1 = tiffgt +EXTRA_PROGRAMS = sgi2tiff$(EXEEXT) sgisv$(EXEEXT) ycbcr$(EXEEXT) +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = tiffgt$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_bmp2tiff_OBJECTS = bmp2tiff.$(OBJEXT) +bmp2tiff_OBJECTS = $(am_bmp2tiff_OBJECTS) +bmp2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +am_fax2ps_OBJECTS = fax2ps.$(OBJEXT) +fax2ps_OBJECTS = $(am_fax2ps_OBJECTS) +fax2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_fax2tiff_OBJECTS = fax2tiff.$(OBJEXT) +fax2tiff_OBJECTS = $(am_fax2tiff_OBJECTS) +fax2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_gif2tiff_OBJECTS = gif2tiff.$(OBJEXT) +gif2tiff_OBJECTS = $(am_gif2tiff_OBJECTS) +gif2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_pal2rgb_OBJECTS = pal2rgb.$(OBJEXT) +pal2rgb_OBJECTS = $(am_pal2rgb_OBJECTS) +pal2rgb_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_ppm2tiff_OBJECTS = ppm2tiff.$(OBJEXT) +ppm2tiff_OBJECTS = $(am_ppm2tiff_OBJECTS) +ppm2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_ras2tiff_OBJECTS = ras2tiff.$(OBJEXT) +ras2tiff_OBJECTS = $(am_ras2tiff_OBJECTS) +ras2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_raw2tiff_OBJECTS = raw2tiff.$(OBJEXT) +raw2tiff_OBJECTS = $(am_raw2tiff_OBJECTS) +raw2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_rgb2ycbcr_OBJECTS = rgb2ycbcr.$(OBJEXT) +rgb2ycbcr_OBJECTS = $(am_rgb2ycbcr_OBJECTS) +rgb2ycbcr_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +sgi2tiff_SOURCES = sgi2tiff.c +sgi2tiff_OBJECTS = sgi2tiff.$(OBJEXT) +sgi2tiff_LDADD = $(LDADD) +sgisv_SOURCES = sgisv.c +sgisv_OBJECTS = sgisv.$(OBJEXT) +sgisv_LDADD = $(LDADD) +am_thumbnail_OBJECTS = thumbnail.$(OBJEXT) +thumbnail_OBJECTS = $(am_thumbnail_OBJECTS) +thumbnail_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2bw_OBJECTS = tiff2bw.$(OBJEXT) +tiff2bw_OBJECTS = $(am_tiff2bw_OBJECTS) +tiff2bw_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2pdf_OBJECTS = tiff2pdf.$(OBJEXT) +tiff2pdf_OBJECTS = $(am_tiff2pdf_OBJECTS) +tiff2pdf_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2ps_OBJECTS = tiff2ps.$(OBJEXT) +tiff2ps_OBJECTS = $(am_tiff2ps_OBJECTS) +tiff2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2rgba_OBJECTS = tiff2rgba.$(OBJEXT) +tiff2rgba_OBJECTS = $(am_tiff2rgba_OBJECTS) +tiff2rgba_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcmp_OBJECTS = tiffcmp.$(OBJEXT) +tiffcmp_OBJECTS = $(am_tiffcmp_OBJECTS) +tiffcmp_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcp_OBJECTS = tiffcp.$(OBJEXT) +tiffcp_OBJECTS = $(am_tiffcp_OBJECTS) +tiffcp_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcrop_OBJECTS = tiffcrop.$(OBJEXT) +tiffcrop_OBJECTS = $(am_tiffcrop_OBJECTS) +tiffcrop_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffdither_OBJECTS = tiffdither.$(OBJEXT) +tiffdither_OBJECTS = $(am_tiffdither_OBJECTS) +tiffdither_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffdump_OBJECTS = tiffdump.$(OBJEXT) +tiffdump_OBJECTS = $(am_tiffdump_OBJECTS) +tiffdump_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffgt_OBJECTS = tiffgt-tiffgt.$(OBJEXT) +tiffgt_OBJECTS = $(am_tiffgt_OBJECTS) +am__DEPENDENCIES_1 = +tiffgt_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +tiffgt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(tiffgt_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_tiffinfo_OBJECTS = tiffinfo.$(OBJEXT) +tiffinfo_OBJECTS = $(am_tiffinfo_OBJECTS) +tiffinfo_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffmedian_OBJECTS = tiffmedian.$(OBJEXT) +tiffmedian_OBJECTS = $(am_tiffmedian_OBJECTS) +tiffmedian_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffset_OBJECTS = tiffset.$(OBJEXT) +tiffset_OBJECTS = $(am_tiffset_OBJECTS) +tiffset_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffsplit_OBJECTS = tiffsplit.$(OBJEXT) +tiffsplit_OBJECTS = $(am_tiffsplit_OBJECTS) +tiffsplit_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +ycbcr_SOURCES = ycbcr.c +ycbcr_OBJECTS = ycbcr.$(OBJEXT) +ycbcr_LDADD = $(LDADD) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) $(fax2tiff_SOURCES) \ + $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) $(ppm2tiff_SOURCES) \ + $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) $(rgb2ycbcr_SOURCES) \ + sgi2tiff.c sgisv.c $(thumbnail_SOURCES) $(tiff2bw_SOURCES) \ + $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) $(tiff2rgba_SOURCES) \ + $(tiffcmp_SOURCES) $(tiffcp_SOURCES) $(tiffcrop_SOURCES) \ + $(tiffdither_SOURCES) $(tiffdump_SOURCES) $(tiffgt_SOURCES) \ + $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) $(tiffset_SOURCES) \ + $(tiffsplit_SOURCES) ycbcr.c +DIST_SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) \ + $(fax2tiff_SOURCES) $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) \ + $(ppm2tiff_SOURCES) $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) \ + $(rgb2ycbcr_SOURCES) sgi2tiff.c sgisv.c $(thumbnail_SOURCES) \ + $(tiff2bw_SOURCES) $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) \ + $(tiff2rgba_SOURCES) $(tiffcmp_SOURCES) $(tiffcp_SOURCES) \ + $(tiffcrop_SOURCES) $(tiffdither_SOURCES) $(tiffdump_SOURCES) \ + $(tiffgt_SOURCES) $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) \ + $(tiffset_SOURCES) $(tiffsplit_SOURCES) ycbcr.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run aclocal-1.12 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AS = as +AUTOCONF = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run autoconf +AUTOHEADER = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run autoheader +AUTOMAKE = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run automake-1.12 +AWK = awk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 -Wall -W +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = dsymutil +DUMPBIN = +ECHO_C = \c +ECHO_N = +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GLUT_CFLAGS = -D_THREAD_SAFE -pthread +GLUT_LIBS = -lglut -lSM -lICE -lXi -lGLU -lGL -L/usr/X11/lib -lX11 -lm +GLU_CFLAGS = -D_THREAD_SAFE -pthread +GLU_LIBS = -lGLU -lGL -L/usr/X11/lib -lX11 -lm +GL_CFLAGS = -D_THREAD_SAFE -pthread +GL_LIBS = -lGL -L/usr/X11/lib -lX11 -lm +GREP = /usr/bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld +LDFLAGS = +LIBDIR = +LIBOBJS = +LIBS = -lz +LIBTIFF_ALPHA_VERSION = +LIBTIFF_DOCDIR = ${prefix}/share/doc/tiff-4.0.3 +LIBTIFF_MAJOR_VERSION = 4 +LIBTIFF_MICRO_VERSION = 3 +LIBTIFF_MINOR_VERSION = 0 +LIBTIFF_RELEASE_DATE = 20130221 +LIBTIFF_VERSION = 4.0.3 +LIBTIFF_VERSION_INFO = 7:0:2 +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = lipo +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = ../config/install-sh -c -d +NM = /usr/bin/nm +NMEDIT = nmedit +OBJDUMP = false +OBJEXT = o +OTOOL = otool +OTOOL64 = : +PACKAGE = tiff +PACKAGE_BUGREPORT = tiff@lists.maptools.org +PACKAGE_NAME = LibTIFF Software +PACKAGE_STRING = LibTIFF Software 4.0.3 +PACKAGE_TARNAME = tiff +PACKAGE_URL = +PACKAGE_VERSION = 4.0.3 +PATH_SEPARATOR = : +PTHREAD_CC = gcc +PTHREAD_CFLAGS = -D_THREAD_SAFE -pthread +PTHREAD_LIBS = +RANLIB = ranlib +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 4.0.3 +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = -L/usr/X11/lib -R/usr/X11/lib +X_PRE_LIBS = -lSM -lICE +abs_builddir = /depot/sdk/LibTIFF/tiff-4.0.3/tools +abs_srcdir = /depot/sdk/LibTIFF/tiff-4.0.3/tools +abs_top_builddir = /depot/sdk/LibTIFF/tiff-4.0.3 +abs_top_srcdir = /depot/sdk/LibTIFF/tiff-4.0.3 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +ax_pthread_config = +bindir = ${exec_prefix}/bin +build = i386-apple-darwin11.3.0 +build_alias = +build_cpu = i386 +build_os = darwin11.3.0 +build_vendor = apple +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i386-apple-darwin11.3.0 +host_alias = +host_cpu = i386 +host_os = darwin11.3.0 +host_vendor = apple +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +tiff_libs_private = -lz +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +LIBPORT = $(top_builddir)/port/libport.la +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +EXTRA_DIST = Makefile.vc +#AM_LDFLAGS = $(LIBDIR) +bmp2tiff_SOURCES = bmp2tiff.c +bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +fax2ps_SOURCES = fax2ps.c +fax2ps_LDADD = $(LIBTIFF) $(LIBPORT) +fax2tiff_SOURCES = fax2tiff.c +fax2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +gif2tiff_SOURCES = gif2tiff.c +gif2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +pal2rgb_SOURCES = pal2rgb.c +pal2rgb_LDADD = $(LIBTIFF) $(LIBPORT) +ppm2tiff_SOURCES = ppm2tiff.c +ppm2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +ras2tiff_SOURCES = ras2tiff.c rasterfile.h +ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +raw2tiff_SOURCES = raw2tiff.c +raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +rgb2ycbcr_SOURCES = rgb2ycbcr.c +rgb2ycbcr_LDADD = $(LIBTIFF) $(LIBPORT) +thumbnail_SOURCES = thumbnail.c +thumbnail_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2bw_SOURCES = tiff2bw.c +tiff2bw_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2pdf_SOURCES = tiff2pdf.c +tiff2pdf_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2ps_SOURCES = tiff2ps.c +tiff2ps_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2rgba_SOURCES = tiff2rgba.c +tiff2rgba_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcmp_SOURCES = tiffcmp.c +tiffcmp_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcp_SOURCES = tiffcp.c +tiffcp_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcrop_SOURCES = tiffcrop.c +tiffcrop_LDADD = $(LIBTIFF) $(LIBPORT) +tiffdither_SOURCES = tiffdither.c +tiffdither_LDADD = $(LIBTIFF) $(LIBPORT) +tiffdump_SOURCES = tiffdump.c +tiffdump_LDADD = $(LIBTIFF) $(LIBPORT) +tiffinfo_SOURCES = tiffinfo.c +tiffinfo_LDADD = $(LIBTIFF) $(LIBPORT) +tiffmedian_SOURCES = tiffmedian.c +tiffmedian_LDADD = $(LIBTIFF) $(LIBPORT) +tiffset_SOURCES = tiffset.c +tiffset_LDADD = $(LIBTIFF) $(LIBPORT) +tiffsplit_SOURCES = tiffsplit.c +tiffsplit_LDADD = $(LIBTIFF) $(LIBPORT) +tiffgt_SOURCES = tiffgt.c +tiffgt_CFLAGS = $(CFLAGS) $(GLUT_CFLAGS) $(AM_CFLAGS) +tiffgt_LDADD = $(LIBTIFF) $(LIBPORT) $(X_LIBS) $(GLUT_LIBS) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +bmp2tiff$(EXEEXT): $(bmp2tiff_OBJECTS) $(bmp2tiff_DEPENDENCIES) $(EXTRA_bmp2tiff_DEPENDENCIES) + @rm -f bmp2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bmp2tiff_OBJECTS) $(bmp2tiff_LDADD) $(LIBS) +fax2ps$(EXEEXT): $(fax2ps_OBJECTS) $(fax2ps_DEPENDENCIES) $(EXTRA_fax2ps_DEPENDENCIES) + @rm -f fax2ps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fax2ps_OBJECTS) $(fax2ps_LDADD) $(LIBS) +fax2tiff$(EXEEXT): $(fax2tiff_OBJECTS) $(fax2tiff_DEPENDENCIES) $(EXTRA_fax2tiff_DEPENDENCIES) + @rm -f fax2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fax2tiff_OBJECTS) $(fax2tiff_LDADD) $(LIBS) +gif2tiff$(EXEEXT): $(gif2tiff_OBJECTS) $(gif2tiff_DEPENDENCIES) $(EXTRA_gif2tiff_DEPENDENCIES) + @rm -f gif2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gif2tiff_OBJECTS) $(gif2tiff_LDADD) $(LIBS) +pal2rgb$(EXEEXT): $(pal2rgb_OBJECTS) $(pal2rgb_DEPENDENCIES) $(EXTRA_pal2rgb_DEPENDENCIES) + @rm -f pal2rgb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pal2rgb_OBJECTS) $(pal2rgb_LDADD) $(LIBS) +ppm2tiff$(EXEEXT): $(ppm2tiff_OBJECTS) $(ppm2tiff_DEPENDENCIES) $(EXTRA_ppm2tiff_DEPENDENCIES) + @rm -f ppm2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppm2tiff_OBJECTS) $(ppm2tiff_LDADD) $(LIBS) +ras2tiff$(EXEEXT): $(ras2tiff_OBJECTS) $(ras2tiff_DEPENDENCIES) $(EXTRA_ras2tiff_DEPENDENCIES) + @rm -f ras2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ras2tiff_OBJECTS) $(ras2tiff_LDADD) $(LIBS) +raw2tiff$(EXEEXT): $(raw2tiff_OBJECTS) $(raw2tiff_DEPENDENCIES) $(EXTRA_raw2tiff_DEPENDENCIES) + @rm -f raw2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(raw2tiff_OBJECTS) $(raw2tiff_LDADD) $(LIBS) +rgb2ycbcr$(EXEEXT): $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_DEPENDENCIES) $(EXTRA_rgb2ycbcr_DEPENDENCIES) + @rm -f rgb2ycbcr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_LDADD) $(LIBS) +sgi2tiff$(EXEEXT): $(sgi2tiff_OBJECTS) $(sgi2tiff_DEPENDENCIES) $(EXTRA_sgi2tiff_DEPENDENCIES) + @rm -f sgi2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sgi2tiff_OBJECTS) $(sgi2tiff_LDADD) $(LIBS) +sgisv$(EXEEXT): $(sgisv_OBJECTS) $(sgisv_DEPENDENCIES) $(EXTRA_sgisv_DEPENDENCIES) + @rm -f sgisv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sgisv_OBJECTS) $(sgisv_LDADD) $(LIBS) +thumbnail$(EXEEXT): $(thumbnail_OBJECTS) $(thumbnail_DEPENDENCIES) $(EXTRA_thumbnail_DEPENDENCIES) + @rm -f thumbnail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(thumbnail_OBJECTS) $(thumbnail_LDADD) $(LIBS) +tiff2bw$(EXEEXT): $(tiff2bw_OBJECTS) $(tiff2bw_DEPENDENCIES) $(EXTRA_tiff2bw_DEPENDENCIES) + @rm -f tiff2bw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2bw_OBJECTS) $(tiff2bw_LDADD) $(LIBS) +tiff2pdf$(EXEEXT): $(tiff2pdf_OBJECTS) $(tiff2pdf_DEPENDENCIES) $(EXTRA_tiff2pdf_DEPENDENCIES) + @rm -f tiff2pdf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2pdf_OBJECTS) $(tiff2pdf_LDADD) $(LIBS) +tiff2ps$(EXEEXT): $(tiff2ps_OBJECTS) $(tiff2ps_DEPENDENCIES) $(EXTRA_tiff2ps_DEPENDENCIES) + @rm -f tiff2ps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2ps_OBJECTS) $(tiff2ps_LDADD) $(LIBS) +tiff2rgba$(EXEEXT): $(tiff2rgba_OBJECTS) $(tiff2rgba_DEPENDENCIES) $(EXTRA_tiff2rgba_DEPENDENCIES) + @rm -f tiff2rgba$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2rgba_OBJECTS) $(tiff2rgba_LDADD) $(LIBS) +tiffcmp$(EXEEXT): $(tiffcmp_OBJECTS) $(tiffcmp_DEPENDENCIES) $(EXTRA_tiffcmp_DEPENDENCIES) + @rm -f tiffcmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcmp_OBJECTS) $(tiffcmp_LDADD) $(LIBS) +tiffcp$(EXEEXT): $(tiffcp_OBJECTS) $(tiffcp_DEPENDENCIES) $(EXTRA_tiffcp_DEPENDENCIES) + @rm -f tiffcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcp_OBJECTS) $(tiffcp_LDADD) $(LIBS) +tiffcrop$(EXEEXT): $(tiffcrop_OBJECTS) $(tiffcrop_DEPENDENCIES) $(EXTRA_tiffcrop_DEPENDENCIES) + @rm -f tiffcrop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcrop_OBJECTS) $(tiffcrop_LDADD) $(LIBS) +tiffdither$(EXEEXT): $(tiffdither_OBJECTS) $(tiffdither_DEPENDENCIES) $(EXTRA_tiffdither_DEPENDENCIES) + @rm -f tiffdither$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffdither_OBJECTS) $(tiffdither_LDADD) $(LIBS) +tiffdump$(EXEEXT): $(tiffdump_OBJECTS) $(tiffdump_DEPENDENCIES) $(EXTRA_tiffdump_DEPENDENCIES) + @rm -f tiffdump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffdump_OBJECTS) $(tiffdump_LDADD) $(LIBS) +tiffgt$(EXEEXT): $(tiffgt_OBJECTS) $(tiffgt_DEPENDENCIES) $(EXTRA_tiffgt_DEPENDENCIES) + @rm -f tiffgt$(EXEEXT) + $(AM_V_CCLD)$(tiffgt_LINK) $(tiffgt_OBJECTS) $(tiffgt_LDADD) $(LIBS) +tiffinfo$(EXEEXT): $(tiffinfo_OBJECTS) $(tiffinfo_DEPENDENCIES) $(EXTRA_tiffinfo_DEPENDENCIES) + @rm -f tiffinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffinfo_OBJECTS) $(tiffinfo_LDADD) $(LIBS) +tiffmedian$(EXEEXT): $(tiffmedian_OBJECTS) $(tiffmedian_DEPENDENCIES) $(EXTRA_tiffmedian_DEPENDENCIES) + @rm -f tiffmedian$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffmedian_OBJECTS) $(tiffmedian_LDADD) $(LIBS) +tiffset$(EXEEXT): $(tiffset_OBJECTS) $(tiffset_DEPENDENCIES) $(EXTRA_tiffset_DEPENDENCIES) + @rm -f tiffset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffset_OBJECTS) $(tiffset_LDADD) $(LIBS) +tiffsplit$(EXEEXT): $(tiffsplit_OBJECTS) $(tiffsplit_DEPENDENCIES) $(EXTRA_tiffsplit_DEPENDENCIES) + @rm -f tiffsplit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffsplit_OBJECTS) $(tiffsplit_LDADD) $(LIBS) +ycbcr$(EXEEXT): $(ycbcr_OBJECTS) $(ycbcr_DEPENDENCIES) $(EXTRA_ycbcr_DEPENDENCIES) + @rm -f ycbcr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ycbcr_OBJECTS) $(ycbcr_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/bmp2tiff.Po +include ./$(DEPDIR)/fax2ps.Po +include ./$(DEPDIR)/fax2tiff.Po +include ./$(DEPDIR)/gif2tiff.Po +include ./$(DEPDIR)/pal2rgb.Po +include ./$(DEPDIR)/ppm2tiff.Po +include ./$(DEPDIR)/ras2tiff.Po +include ./$(DEPDIR)/raw2tiff.Po +include ./$(DEPDIR)/rgb2ycbcr.Po +include ./$(DEPDIR)/sgi2tiff.Po +include ./$(DEPDIR)/sgisv.Po +include ./$(DEPDIR)/thumbnail.Po +include ./$(DEPDIR)/tiff2bw.Po +include ./$(DEPDIR)/tiff2pdf.Po +include ./$(DEPDIR)/tiff2ps.Po +include ./$(DEPDIR)/tiff2rgba.Po +include ./$(DEPDIR)/tiffcmp.Po +include ./$(DEPDIR)/tiffcp.Po +include ./$(DEPDIR)/tiffcrop.Po +include ./$(DEPDIR)/tiffdither.Po +include ./$(DEPDIR)/tiffdump.Po +include ./$(DEPDIR)/tiffgt-tiffgt.Po +include ./$(DEPDIR)/tiffinfo.Po +include ./$(DEPDIR)/tiffmedian.Po +include ./$(DEPDIR)/tiffset.Po +include ./$(DEPDIR)/tiffsplit.Po +include ./$(DEPDIR)/ycbcr.Po + +.c.o: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +tiffgt-tiffgt.o: tiffgt.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -MT tiffgt-tiffgt.o -MD -MP -MF $(DEPDIR)/tiffgt-tiffgt.Tpo -c -o tiffgt-tiffgt.o `test -f 'tiffgt.c' || echo '$(srcdir)/'`tiffgt.c + $(AM_V_at)$(am__mv) $(DEPDIR)/tiffgt-tiffgt.Tpo $(DEPDIR)/tiffgt-tiffgt.Po +# $(AM_V_CC)source='tiffgt.c' object='tiffgt-tiffgt.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -c -o tiffgt-tiffgt.o `test -f 'tiffgt.c' || echo '$(srcdir)/'`tiffgt.c + +tiffgt-tiffgt.obj: tiffgt.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -MT tiffgt-tiffgt.obj -MD -MP -MF $(DEPDIR)/tiffgt-tiffgt.Tpo -c -o tiffgt-tiffgt.obj `if test -f 'tiffgt.c'; then $(CYGPATH_W) 'tiffgt.c'; else $(CYGPATH_W) '$(srcdir)/tiffgt.c'; fi` + $(AM_V_at)$(am__mv) $(DEPDIR)/tiffgt-tiffgt.Tpo $(DEPDIR)/tiffgt-tiffgt.Po +# $(AM_V_CC)source='tiffgt.c' object='tiffgt-tiffgt.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -c -o tiffgt-tiffgt.obj `if test -f 'tiffgt.c'; then $(CYGPATH_W) 'tiffgt.c'; else $(CYGPATH_W) '$(srcdir)/tiffgt.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + + +echo: + (echo $(CFLAGS)) + (echo $(tiffgt_CFLAGS)) + (echo $(GL_CFLAGS)) + (echo $(GLU_CFLAGS)) + (echo $(GLUT_CFLAGS)) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.am new file mode 100644 index 0000000..6497f2d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.am @@ -0,0 +1,145 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +LIBPORT = $(top_builddir)/port/libport.la +LIBTIFF = $(top_builddir)/libtiff/libtiff.la + +EXTRA_DIST = Makefile.vc + +bin_PROGRAMS = \ + bmp2tiff \ + fax2ps \ + fax2tiff \ + gif2tiff \ + pal2rgb \ + ppm2tiff \ + ras2tiff \ + raw2tiff \ + rgb2ycbcr \ + thumbnail \ + tiff2bw \ + tiff2pdf \ + tiff2ps \ + tiff2rgba \ + tiffcmp \ + tiffcp \ + tiffcrop \ + tiffdither \ + tiffdump \ + tiffinfo \ + tiffmedian \ + tiffset \ + tiffsplit +if HAVE_OPENGL +bin_PROGRAMS += tiffgt +endif + +EXTRA_PROGRAMS = sgi2tiff sgisv ycbcr + +if HAVE_RPATH +AM_LDFLAGS = $(LIBDIR) +endif + +bmp2tiff_SOURCES = bmp2tiff.c +bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +fax2ps_SOURCES = fax2ps.c +fax2ps_LDADD = $(LIBTIFF) $(LIBPORT) + +fax2tiff_SOURCES = fax2tiff.c +fax2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +gif2tiff_SOURCES = gif2tiff.c +gif2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +pal2rgb_SOURCES = pal2rgb.c +pal2rgb_LDADD = $(LIBTIFF) $(LIBPORT) + +ppm2tiff_SOURCES = ppm2tiff.c +ppm2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +ras2tiff_SOURCES = ras2tiff.c rasterfile.h +ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +raw2tiff_SOURCES = raw2tiff.c +raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT) + +rgb2ycbcr_SOURCES = rgb2ycbcr.c +rgb2ycbcr_LDADD = $(LIBTIFF) $(LIBPORT) + +thumbnail_SOURCES = thumbnail.c +thumbnail_LDADD = $(LIBTIFF) $(LIBPORT) + +tiff2bw_SOURCES = tiff2bw.c +tiff2bw_LDADD = $(LIBTIFF) $(LIBPORT) + +tiff2pdf_SOURCES = tiff2pdf.c +tiff2pdf_LDADD = $(LIBTIFF) $(LIBPORT) + +tiff2ps_SOURCES = tiff2ps.c +tiff2ps_LDADD = $(LIBTIFF) $(LIBPORT) + +tiff2rgba_SOURCES = tiff2rgba.c +tiff2rgba_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffcmp_SOURCES = tiffcmp.c +tiffcmp_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffcp_SOURCES = tiffcp.c +tiffcp_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffcrop_SOURCES = tiffcrop.c +tiffcrop_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffdither_SOURCES = tiffdither.c +tiffdither_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffdump_SOURCES = tiffdump.c +tiffdump_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffinfo_SOURCES = tiffinfo.c +tiffinfo_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffmedian_SOURCES = tiffmedian.c +tiffmedian_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffset_SOURCES = tiffset.c +tiffset_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffsplit_SOURCES = tiffsplit.c +tiffsplit_LDADD = $(LIBTIFF) $(LIBPORT) + +tiffgt_SOURCES = tiffgt.c +tiffgt_CFLAGS = $(CFLAGS) $(GLUT_CFLAGS) $(AM_CFLAGS) +tiffgt_LDADD = $(LIBTIFF) $(LIBPORT) $(X_LIBS) $(GLUT_LIBS) + +AM_CPPFLAGS = -I$(top_srcdir)/libtiff + +echo: + (echo $(CFLAGS)) + (echo $(tiffgt_CFLAGS)) + (echo $(GL_CFLAGS)) + (echo $(GLU_CFLAGS)) + (echo $(GLUT_CFLAGS)) diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.in new file mode 100644 index 0000000..b49b1f1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.in @@ -0,0 +1,923 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = bmp2tiff$(EXEEXT) fax2ps$(EXEEXT) fax2tiff$(EXEEXT) \ + gif2tiff$(EXEEXT) pal2rgb$(EXEEXT) ppm2tiff$(EXEEXT) \ + ras2tiff$(EXEEXT) raw2tiff$(EXEEXT) rgb2ycbcr$(EXEEXT) \ + thumbnail$(EXEEXT) tiff2bw$(EXEEXT) tiff2pdf$(EXEEXT) \ + tiff2ps$(EXEEXT) tiff2rgba$(EXEEXT) tiffcmp$(EXEEXT) \ + tiffcp$(EXEEXT) tiffcrop$(EXEEXT) tiffdither$(EXEEXT) \ + tiffdump$(EXEEXT) tiffinfo$(EXEEXT) tiffmedian$(EXEEXT) \ + tiffset$(EXEEXT) tiffsplit$(EXEEXT) $(am__EXEEXT_1) +@HAVE_OPENGL_TRUE@am__append_1 = tiffgt +EXTRA_PROGRAMS = sgi2tiff$(EXEEXT) sgisv$(EXEEXT) ycbcr$(EXEEXT) +subdir = tools +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_OPENGL_TRUE@am__EXEEXT_1 = tiffgt$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_bmp2tiff_OBJECTS = bmp2tiff.$(OBJEXT) +bmp2tiff_OBJECTS = $(am_bmp2tiff_OBJECTS) +bmp2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_fax2ps_OBJECTS = fax2ps.$(OBJEXT) +fax2ps_OBJECTS = $(am_fax2ps_OBJECTS) +fax2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_fax2tiff_OBJECTS = fax2tiff.$(OBJEXT) +fax2tiff_OBJECTS = $(am_fax2tiff_OBJECTS) +fax2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_gif2tiff_OBJECTS = gif2tiff.$(OBJEXT) +gif2tiff_OBJECTS = $(am_gif2tiff_OBJECTS) +gif2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_pal2rgb_OBJECTS = pal2rgb.$(OBJEXT) +pal2rgb_OBJECTS = $(am_pal2rgb_OBJECTS) +pal2rgb_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_ppm2tiff_OBJECTS = ppm2tiff.$(OBJEXT) +ppm2tiff_OBJECTS = $(am_ppm2tiff_OBJECTS) +ppm2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_ras2tiff_OBJECTS = ras2tiff.$(OBJEXT) +ras2tiff_OBJECTS = $(am_ras2tiff_OBJECTS) +ras2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_raw2tiff_OBJECTS = raw2tiff.$(OBJEXT) +raw2tiff_OBJECTS = $(am_raw2tiff_OBJECTS) +raw2tiff_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_rgb2ycbcr_OBJECTS = rgb2ycbcr.$(OBJEXT) +rgb2ycbcr_OBJECTS = $(am_rgb2ycbcr_OBJECTS) +rgb2ycbcr_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +sgi2tiff_SOURCES = sgi2tiff.c +sgi2tiff_OBJECTS = sgi2tiff.$(OBJEXT) +sgi2tiff_LDADD = $(LDADD) +sgisv_SOURCES = sgisv.c +sgisv_OBJECTS = sgisv.$(OBJEXT) +sgisv_LDADD = $(LDADD) +am_thumbnail_OBJECTS = thumbnail.$(OBJEXT) +thumbnail_OBJECTS = $(am_thumbnail_OBJECTS) +thumbnail_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2bw_OBJECTS = tiff2bw.$(OBJEXT) +tiff2bw_OBJECTS = $(am_tiff2bw_OBJECTS) +tiff2bw_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2pdf_OBJECTS = tiff2pdf.$(OBJEXT) +tiff2pdf_OBJECTS = $(am_tiff2pdf_OBJECTS) +tiff2pdf_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2ps_OBJECTS = tiff2ps.$(OBJEXT) +tiff2ps_OBJECTS = $(am_tiff2ps_OBJECTS) +tiff2ps_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiff2rgba_OBJECTS = tiff2rgba.$(OBJEXT) +tiff2rgba_OBJECTS = $(am_tiff2rgba_OBJECTS) +tiff2rgba_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcmp_OBJECTS = tiffcmp.$(OBJEXT) +tiffcmp_OBJECTS = $(am_tiffcmp_OBJECTS) +tiffcmp_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcp_OBJECTS = tiffcp.$(OBJEXT) +tiffcp_OBJECTS = $(am_tiffcp_OBJECTS) +tiffcp_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffcrop_OBJECTS = tiffcrop.$(OBJEXT) +tiffcrop_OBJECTS = $(am_tiffcrop_OBJECTS) +tiffcrop_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffdither_OBJECTS = tiffdither.$(OBJEXT) +tiffdither_OBJECTS = $(am_tiffdither_OBJECTS) +tiffdither_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffdump_OBJECTS = tiffdump.$(OBJEXT) +tiffdump_OBJECTS = $(am_tiffdump_OBJECTS) +tiffdump_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffgt_OBJECTS = tiffgt-tiffgt.$(OBJEXT) +tiffgt_OBJECTS = $(am_tiffgt_OBJECTS) +am__DEPENDENCIES_1 = +tiffgt_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +tiffgt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(tiffgt_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_tiffinfo_OBJECTS = tiffinfo.$(OBJEXT) +tiffinfo_OBJECTS = $(am_tiffinfo_OBJECTS) +tiffinfo_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffmedian_OBJECTS = tiffmedian.$(OBJEXT) +tiffmedian_OBJECTS = $(am_tiffmedian_OBJECTS) +tiffmedian_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffset_OBJECTS = tiffset.$(OBJEXT) +tiffset_OBJECTS = $(am_tiffset_OBJECTS) +tiffset_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +am_tiffsplit_OBJECTS = tiffsplit.$(OBJEXT) +tiffsplit_OBJECTS = $(am_tiffsplit_OBJECTS) +tiffsplit_DEPENDENCIES = $(LIBTIFF) $(LIBPORT) +ycbcr_SOURCES = ycbcr.c +ycbcr_OBJECTS = ycbcr.$(OBJEXT) +ycbcr_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) $(fax2tiff_SOURCES) \ + $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) $(ppm2tiff_SOURCES) \ + $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) $(rgb2ycbcr_SOURCES) \ + sgi2tiff.c sgisv.c $(thumbnail_SOURCES) $(tiff2bw_SOURCES) \ + $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) $(tiff2rgba_SOURCES) \ + $(tiffcmp_SOURCES) $(tiffcp_SOURCES) $(tiffcrop_SOURCES) \ + $(tiffdither_SOURCES) $(tiffdump_SOURCES) $(tiffgt_SOURCES) \ + $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) $(tiffset_SOURCES) \ + $(tiffsplit_SOURCES) ycbcr.c +DIST_SOURCES = $(bmp2tiff_SOURCES) $(fax2ps_SOURCES) \ + $(fax2tiff_SOURCES) $(gif2tiff_SOURCES) $(pal2rgb_SOURCES) \ + $(ppm2tiff_SOURCES) $(ras2tiff_SOURCES) $(raw2tiff_SOURCES) \ + $(rgb2ycbcr_SOURCES) sgi2tiff.c sgisv.c $(thumbnail_SOURCES) \ + $(tiff2bw_SOURCES) $(tiff2pdf_SOURCES) $(tiff2ps_SOURCES) \ + $(tiff2rgba_SOURCES) $(tiffcmp_SOURCES) $(tiffcp_SOURCES) \ + $(tiffcrop_SOURCES) $(tiffdither_SOURCES) $(tiffdump_SOURCES) \ + $(tiffgt_SOURCES) $(tiffinfo_SOURCES) $(tiffmedian_SOURCES) \ + $(tiffset_SOURCES) $(tiffsplit_SOURCES) ycbcr.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +LIBPORT = $(top_builddir)/port/libport.la +LIBTIFF = $(top_builddir)/libtiff/libtiff.la +EXTRA_DIST = Makefile.vc +@HAVE_RPATH_TRUE@AM_LDFLAGS = $(LIBDIR) +bmp2tiff_SOURCES = bmp2tiff.c +bmp2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +fax2ps_SOURCES = fax2ps.c +fax2ps_LDADD = $(LIBTIFF) $(LIBPORT) +fax2tiff_SOURCES = fax2tiff.c +fax2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +gif2tiff_SOURCES = gif2tiff.c +gif2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +pal2rgb_SOURCES = pal2rgb.c +pal2rgb_LDADD = $(LIBTIFF) $(LIBPORT) +ppm2tiff_SOURCES = ppm2tiff.c +ppm2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +ras2tiff_SOURCES = ras2tiff.c rasterfile.h +ras2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +raw2tiff_SOURCES = raw2tiff.c +raw2tiff_LDADD = $(LIBTIFF) $(LIBPORT) +rgb2ycbcr_SOURCES = rgb2ycbcr.c +rgb2ycbcr_LDADD = $(LIBTIFF) $(LIBPORT) +thumbnail_SOURCES = thumbnail.c +thumbnail_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2bw_SOURCES = tiff2bw.c +tiff2bw_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2pdf_SOURCES = tiff2pdf.c +tiff2pdf_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2ps_SOURCES = tiff2ps.c +tiff2ps_LDADD = $(LIBTIFF) $(LIBPORT) +tiff2rgba_SOURCES = tiff2rgba.c +tiff2rgba_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcmp_SOURCES = tiffcmp.c +tiffcmp_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcp_SOURCES = tiffcp.c +tiffcp_LDADD = $(LIBTIFF) $(LIBPORT) +tiffcrop_SOURCES = tiffcrop.c +tiffcrop_LDADD = $(LIBTIFF) $(LIBPORT) +tiffdither_SOURCES = tiffdither.c +tiffdither_LDADD = $(LIBTIFF) $(LIBPORT) +tiffdump_SOURCES = tiffdump.c +tiffdump_LDADD = $(LIBTIFF) $(LIBPORT) +tiffinfo_SOURCES = tiffinfo.c +tiffinfo_LDADD = $(LIBTIFF) $(LIBPORT) +tiffmedian_SOURCES = tiffmedian.c +tiffmedian_LDADD = $(LIBTIFF) $(LIBPORT) +tiffset_SOURCES = tiffset.c +tiffset_LDADD = $(LIBTIFF) $(LIBPORT) +tiffsplit_SOURCES = tiffsplit.c +tiffsplit_LDADD = $(LIBTIFF) $(LIBPORT) +tiffgt_SOURCES = tiffgt.c +tiffgt_CFLAGS = $(CFLAGS) $(GLUT_CFLAGS) $(AM_CFLAGS) +tiffgt_LDADD = $(LIBTIFF) $(LIBPORT) $(X_LIBS) $(GLUT_LIBS) +AM_CPPFLAGS = -I$(top_srcdir)/libtiff +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign tools/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +bmp2tiff$(EXEEXT): $(bmp2tiff_OBJECTS) $(bmp2tiff_DEPENDENCIES) $(EXTRA_bmp2tiff_DEPENDENCIES) + @rm -f bmp2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bmp2tiff_OBJECTS) $(bmp2tiff_LDADD) $(LIBS) +fax2ps$(EXEEXT): $(fax2ps_OBJECTS) $(fax2ps_DEPENDENCIES) $(EXTRA_fax2ps_DEPENDENCIES) + @rm -f fax2ps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fax2ps_OBJECTS) $(fax2ps_LDADD) $(LIBS) +fax2tiff$(EXEEXT): $(fax2tiff_OBJECTS) $(fax2tiff_DEPENDENCIES) $(EXTRA_fax2tiff_DEPENDENCIES) + @rm -f fax2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fax2tiff_OBJECTS) $(fax2tiff_LDADD) $(LIBS) +gif2tiff$(EXEEXT): $(gif2tiff_OBJECTS) $(gif2tiff_DEPENDENCIES) $(EXTRA_gif2tiff_DEPENDENCIES) + @rm -f gif2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gif2tiff_OBJECTS) $(gif2tiff_LDADD) $(LIBS) +pal2rgb$(EXEEXT): $(pal2rgb_OBJECTS) $(pal2rgb_DEPENDENCIES) $(EXTRA_pal2rgb_DEPENDENCIES) + @rm -f pal2rgb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pal2rgb_OBJECTS) $(pal2rgb_LDADD) $(LIBS) +ppm2tiff$(EXEEXT): $(ppm2tiff_OBJECTS) $(ppm2tiff_DEPENDENCIES) $(EXTRA_ppm2tiff_DEPENDENCIES) + @rm -f ppm2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppm2tiff_OBJECTS) $(ppm2tiff_LDADD) $(LIBS) +ras2tiff$(EXEEXT): $(ras2tiff_OBJECTS) $(ras2tiff_DEPENDENCIES) $(EXTRA_ras2tiff_DEPENDENCIES) + @rm -f ras2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ras2tiff_OBJECTS) $(ras2tiff_LDADD) $(LIBS) +raw2tiff$(EXEEXT): $(raw2tiff_OBJECTS) $(raw2tiff_DEPENDENCIES) $(EXTRA_raw2tiff_DEPENDENCIES) + @rm -f raw2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(raw2tiff_OBJECTS) $(raw2tiff_LDADD) $(LIBS) +rgb2ycbcr$(EXEEXT): $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_DEPENDENCIES) $(EXTRA_rgb2ycbcr_DEPENDENCIES) + @rm -f rgb2ycbcr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rgb2ycbcr_OBJECTS) $(rgb2ycbcr_LDADD) $(LIBS) +sgi2tiff$(EXEEXT): $(sgi2tiff_OBJECTS) $(sgi2tiff_DEPENDENCIES) $(EXTRA_sgi2tiff_DEPENDENCIES) + @rm -f sgi2tiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sgi2tiff_OBJECTS) $(sgi2tiff_LDADD) $(LIBS) +sgisv$(EXEEXT): $(sgisv_OBJECTS) $(sgisv_DEPENDENCIES) $(EXTRA_sgisv_DEPENDENCIES) + @rm -f sgisv$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sgisv_OBJECTS) $(sgisv_LDADD) $(LIBS) +thumbnail$(EXEEXT): $(thumbnail_OBJECTS) $(thumbnail_DEPENDENCIES) $(EXTRA_thumbnail_DEPENDENCIES) + @rm -f thumbnail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(thumbnail_OBJECTS) $(thumbnail_LDADD) $(LIBS) +tiff2bw$(EXEEXT): $(tiff2bw_OBJECTS) $(tiff2bw_DEPENDENCIES) $(EXTRA_tiff2bw_DEPENDENCIES) + @rm -f tiff2bw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2bw_OBJECTS) $(tiff2bw_LDADD) $(LIBS) +tiff2pdf$(EXEEXT): $(tiff2pdf_OBJECTS) $(tiff2pdf_DEPENDENCIES) $(EXTRA_tiff2pdf_DEPENDENCIES) + @rm -f tiff2pdf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2pdf_OBJECTS) $(tiff2pdf_LDADD) $(LIBS) +tiff2ps$(EXEEXT): $(tiff2ps_OBJECTS) $(tiff2ps_DEPENDENCIES) $(EXTRA_tiff2ps_DEPENDENCIES) + @rm -f tiff2ps$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2ps_OBJECTS) $(tiff2ps_LDADD) $(LIBS) +tiff2rgba$(EXEEXT): $(tiff2rgba_OBJECTS) $(tiff2rgba_DEPENDENCIES) $(EXTRA_tiff2rgba_DEPENDENCIES) + @rm -f tiff2rgba$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiff2rgba_OBJECTS) $(tiff2rgba_LDADD) $(LIBS) +tiffcmp$(EXEEXT): $(tiffcmp_OBJECTS) $(tiffcmp_DEPENDENCIES) $(EXTRA_tiffcmp_DEPENDENCIES) + @rm -f tiffcmp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcmp_OBJECTS) $(tiffcmp_LDADD) $(LIBS) +tiffcp$(EXEEXT): $(tiffcp_OBJECTS) $(tiffcp_DEPENDENCIES) $(EXTRA_tiffcp_DEPENDENCIES) + @rm -f tiffcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcp_OBJECTS) $(tiffcp_LDADD) $(LIBS) +tiffcrop$(EXEEXT): $(tiffcrop_OBJECTS) $(tiffcrop_DEPENDENCIES) $(EXTRA_tiffcrop_DEPENDENCIES) + @rm -f tiffcrop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffcrop_OBJECTS) $(tiffcrop_LDADD) $(LIBS) +tiffdither$(EXEEXT): $(tiffdither_OBJECTS) $(tiffdither_DEPENDENCIES) $(EXTRA_tiffdither_DEPENDENCIES) + @rm -f tiffdither$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffdither_OBJECTS) $(tiffdither_LDADD) $(LIBS) +tiffdump$(EXEEXT): $(tiffdump_OBJECTS) $(tiffdump_DEPENDENCIES) $(EXTRA_tiffdump_DEPENDENCIES) + @rm -f tiffdump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffdump_OBJECTS) $(tiffdump_LDADD) $(LIBS) +tiffgt$(EXEEXT): $(tiffgt_OBJECTS) $(tiffgt_DEPENDENCIES) $(EXTRA_tiffgt_DEPENDENCIES) + @rm -f tiffgt$(EXEEXT) + $(AM_V_CCLD)$(tiffgt_LINK) $(tiffgt_OBJECTS) $(tiffgt_LDADD) $(LIBS) +tiffinfo$(EXEEXT): $(tiffinfo_OBJECTS) $(tiffinfo_DEPENDENCIES) $(EXTRA_tiffinfo_DEPENDENCIES) + @rm -f tiffinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffinfo_OBJECTS) $(tiffinfo_LDADD) $(LIBS) +tiffmedian$(EXEEXT): $(tiffmedian_OBJECTS) $(tiffmedian_DEPENDENCIES) $(EXTRA_tiffmedian_DEPENDENCIES) + @rm -f tiffmedian$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffmedian_OBJECTS) $(tiffmedian_LDADD) $(LIBS) +tiffset$(EXEEXT): $(tiffset_OBJECTS) $(tiffset_DEPENDENCIES) $(EXTRA_tiffset_DEPENDENCIES) + @rm -f tiffset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffset_OBJECTS) $(tiffset_LDADD) $(LIBS) +tiffsplit$(EXEEXT): $(tiffsplit_OBJECTS) $(tiffsplit_DEPENDENCIES) $(EXTRA_tiffsplit_DEPENDENCIES) + @rm -f tiffsplit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tiffsplit_OBJECTS) $(tiffsplit_LDADD) $(LIBS) +ycbcr$(EXEEXT): $(ycbcr_OBJECTS) $(ycbcr_DEPENDENCIES) $(EXTRA_ycbcr_DEPENDENCIES) + @rm -f ycbcr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ycbcr_OBJECTS) $(ycbcr_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmp2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2ps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pal2rgb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppm2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ras2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb2ycbcr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgi2tiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgisv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumbnail.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2bw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2pdf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2ps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiff2rgba.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffcrop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdither.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffdump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffgt-tiffgt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffmedian.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiffsplit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ycbcr.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +tiffgt-tiffgt.o: tiffgt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -MT tiffgt-tiffgt.o -MD -MP -MF $(DEPDIR)/tiffgt-tiffgt.Tpo -c -o tiffgt-tiffgt.o `test -f 'tiffgt.c' || echo '$(srcdir)/'`tiffgt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tiffgt-tiffgt.Tpo $(DEPDIR)/tiffgt-tiffgt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tiffgt.c' object='tiffgt-tiffgt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -c -o tiffgt-tiffgt.o `test -f 'tiffgt.c' || echo '$(srcdir)/'`tiffgt.c + +tiffgt-tiffgt.obj: tiffgt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -MT tiffgt-tiffgt.obj -MD -MP -MF $(DEPDIR)/tiffgt-tiffgt.Tpo -c -o tiffgt-tiffgt.obj `if test -f 'tiffgt.c'; then $(CYGPATH_W) 'tiffgt.c'; else $(CYGPATH_W) '$(srcdir)/tiffgt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tiffgt-tiffgt.Tpo $(DEPDIR)/tiffgt-tiffgt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tiffgt.c' object='tiffgt-tiffgt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tiffgt_CFLAGS) $(CFLAGS) -c -o tiffgt-tiffgt.obj `if test -f 'tiffgt.c'; then $(CYGPATH_W) 'tiffgt.c'; else $(CYGPATH_W) '$(srcdir)/tiffgt.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + + +echo: + (echo $(CFLAGS)) + (echo $(tiffgt_CFLAGS)) + (echo $(GL_CFLAGS)) + (echo $(GLU_CFLAGS)) + (echo $(GLUT_CFLAGS)) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.vc new file mode 100644 index 0000000..c8d69cd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/Makefile.vc @@ -0,0 +1,52 @@ +# $Id: Makefile.vc,v 1.15 2009-01-22 20:53:07 fwarmerdam Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# Makefile for MS Visual C and Watcom C compilers. +# +# To build: +# C:\libtiff\tools> nmake /f makefile.vc + +!INCLUDE ..\nmake.opt + +TARGETS = bmp2tiff.exe tiffinfo.exe tiffdump.exe fax2tiff.exe \ + fax2ps.exe gif2tiff.exe pal2rgb.exe ppm2tiff.exe \ + rgb2ycbcr.exe thumbnail.exe ras2tiff.exe raw2tiff.exe \ + tiff2bw.exe tiff2rgba.exe tiff2pdf.exe tiff2ps.exe \ + tiffcmp.exe tiffcp.exe tiffcrop.exe tiffdither.exe \ + tiffmedian.exe tiffset.exe tiffsplit.exe + +INCL = -I..\libtiff -I..\port -DNEED_LIBPORT +LIBS = $(LIBS) ..\port\libport.lib ..\libtiff\libtiff.lib + +default: $(TARGETS) + +.c.exe: + $(CC) $(CFLAGS) $*.c $(EXTRA_OBJ) $(LIBS) + +tiffgt.exe: + $(CC) $(CFLAGS) tiffgt.c $(EXTRA_OBJ) $(LIBS) + +clean: + -del *.exe + -del *.exe.manifest + -del *.obj diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/bmp2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/bmp2tiff.c new file mode 100644 index 0000000..c66a8d2 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/bmp2tiff.c @@ -0,0 +1,854 @@ +/* $Id: bmp2tiff.c,v 1.23 2010-03-10 18:56:49 bfriesen Exp $ + * + * Project: libtiff tools + * Purpose: Convert Windows BMP files in TIFF. + * Author: Andrey Kiselev, dron@ak4719.spb.edu + * + ****************************************************************************** + * Copyright (c) 2004, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_FCNTL_H +# include +#endif + +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +enum BMPType +{ + BMPT_WIN4, /* BMP used in Windows 3.0/NT 3.51/95 */ + BMPT_WIN5, /* BMP used in Windows NT 4.0/98/Me/2000/XP */ + BMPT_OS21, /* BMP used in OS/2 PM 1.x */ + BMPT_OS22 /* BMP used in OS/2 PM 2.x */ +}; + +/* + * Bitmap file consists of a BMPFileHeader structure followed by a + * BMPInfoHeader structure. An array of BMPColorEntry structures (also called + * a colour table) follows the bitmap information header structure. The colour + * table is followed by a second array of indexes into the colour table (the + * actual bitmap data). Data may be comressed, for 4-bpp and 8-bpp used RLE + * compression. + * + * +---------------------+ + * | BMPFileHeader | + * +---------------------+ + * | BMPInfoHeader | + * +---------------------+ + * | BMPColorEntry array | + * +---------------------+ + * | Colour-index array | + * +---------------------+ + * + * All numbers stored in Intel order with least significant byte first. + */ + +enum BMPComprMethod +{ + BMPC_RGB = 0L, /* Uncompressed */ + BMPC_RLE8 = 1L, /* RLE for 8 bpp images */ + BMPC_RLE4 = 2L, /* RLE for 4 bpp images */ + BMPC_BITFIELDS = 3L, /* Bitmap is not compressed and the colour table + * consists of three DWORD color masks that specify + * the red, green, and blue components of each + * pixel. This is valid when used with + * 16- and 32-bpp bitmaps. */ + BMPC_JPEG = 4L, /* Indicates that the image is a JPEG image. */ + BMPC_PNG = 5L /* Indicates that the image is a PNG image. */ +}; + +enum BMPLCSType /* Type of logical color space. */ +{ + BMPLT_CALIBRATED_RGB = 0, /* This value indicates that endpoints and + * gamma values are given in the appropriate + * fields. */ + BMPLT_DEVICE_RGB = 1, + BMPLT_DEVICE_CMYK = 2 +}; + +typedef struct +{ + int32 iCIEX; + int32 iCIEY; + int32 iCIEZ; +} BMPCIEXYZ; + +typedef struct /* This structure contains the x, y, and z */ +{ /* coordinates of the three colors that */ + /* correspond */ + BMPCIEXYZ iCIERed; /* to the red, green, and blue endpoints for */ + BMPCIEXYZ iCIEGreen; /* a specified logical color space. */ + BMPCIEXYZ iCIEBlue; +} BMPCIEXYZTriple; + +typedef struct +{ + char bType[2]; /* Signature "BM" */ + uint32 iSize; /* Size in bytes of the bitmap file. Should + * always be ignored while reading because + * of error in Windows 3.0 SDK's description + * of this field */ + uint16 iReserved1; /* Reserved, set as 0 */ + uint16 iReserved2; /* Reserved, set as 0 */ + uint32 iOffBits; /* Offset of the image from file start in bytes */ +} BMPFileHeader; + +/* File header size in bytes: */ +const int BFH_SIZE = 14; + +typedef struct +{ + uint32 iSize; /* Size of BMPInfoHeader structure in bytes. + * Should be used to determine start of the + * colour table */ + int32 iWidth; /* Image width */ + int32 iHeight; /* Image height. If positive, image has bottom + * left origin, if negative --- top left. */ + int16 iPlanes; /* Number of image planes (must be set to 1) */ + int16 iBitCount; /* Number of bits per pixel (1, 4, 8, 16, 24 + * or 32). If 0 then the number of bits per + * pixel is specified or is implied by the + * JPEG or PNG format. */ + uint32 iCompression; /* Compression method */ + uint32 iSizeImage; /* Size of uncomressed image in bytes. May + * be 0 for BMPC_RGB bitmaps. If iCompression + * is BI_JPEG or BI_PNG, iSizeImage indicates + * the size of the JPEG or PNG image buffer. */ + int32 iXPelsPerMeter; /* X resolution, pixels per meter (0 if not used) */ + int32 iYPelsPerMeter; /* Y resolution, pixels per meter (0 if not used) */ + uint32 iClrUsed; /* Size of colour table. If 0, iBitCount should + * be used to calculate this value + * (1< 0) ? info_hdr.iHeight : -info_hdr.iHeight; + + switch (info_hdr.iBitCount) + { + case 1: + case 4: + case 8: + nbands = 1; + depth = info_hdr.iBitCount; + photometric = PHOTOMETRIC_PALETTE; + /* Allocate memory for colour table and read it. */ + if (info_hdr.iClrUsed) + clr_tbl_size = + ((uint32)(1< 0) + offset = file_hdr.iOffBits+(length-row-1)*size; + else + offset = file_hdr.iOffBits + row * size; + if (lseek(fd, offset, SEEK_SET) == (off_t)-1) { + TIFFError(infilename, + "scanline %lu: Seek error", + (unsigned long) row); + break; + } + + if (read(fd, scanbuf, size) < 0) { + TIFFError(infilename, + "scanline %lu: Read error", + (unsigned long) row); + break; + } + + rearrangePixels(scanbuf, width, info_hdr.iBitCount); + + if (TIFFWriteScanline(out, scanbuf, row, 0)<0) { + TIFFError(infilename, + "scanline %lu: Write error", + (unsigned long) row); + break; + } + } + + _TIFFfree(scanbuf); + +/* -------------------------------------------------------------------- */ +/* Read compressed image data. */ +/* -------------------------------------------------------------------- */ + + } else if ( info_hdr.iCompression == BMPC_RLE8 + || info_hdr.iCompression == BMPC_RLE4 ) { + uint32 i, j, k, runlength; + uint32 compr_size, uncompr_size; + unsigned char *comprbuf; + unsigned char *uncomprbuf; + + compr_size = file_hdr.iSize - file_hdr.iOffBits; + uncompr_size = width * length; + comprbuf = (unsigned char *) _TIFFmalloc( compr_size ); + if (!comprbuf) { + TIFFError(infilename, + "Can't allocate space for compressed scanline buffer"); + goto bad3; + } + uncomprbuf = (unsigned char *)_TIFFmalloc(uncompr_size); + if (!uncomprbuf) { + TIFFError(infilename, + "Can't allocate space for uncompressed scanline buffer"); + goto bad3; + } + + lseek(fd, file_hdr.iOffBits, SEEK_SET); + read(fd, comprbuf, compr_size); + i = 0; + j = 0; + if (info_hdr.iBitCount == 8) { /* RLE8 */ + while(j < uncompr_size && i < compr_size) { + if ( comprbuf[i] ) { + runlength = comprbuf[i++]; + while( runlength > 0 + && j < uncompr_size + && i < compr_size ) { + uncomprbuf[j++] = comprbuf[i]; + runlength--; + } + i++; + } else { + i++; + if (comprbuf[i] == 0) /* Next scanline */ + i++; + else if (comprbuf[i] == 1) /* End of image */ + break; + else if (comprbuf[i] == 2) { /* Move to... */ + i++; + if (i < compr_size - 1) { + j+=comprbuf[i]+comprbuf[i+1]*width; + i += 2; + } + else + break; + } else { /* Absolute mode */ + runlength = comprbuf[i++]; + for (k = 0; k < runlength && j < uncompr_size && i < compr_size; k++) + uncomprbuf[j++] = comprbuf[i++]; + if ( k & 0x01 ) + i++; + } + } + } + } + else { /* RLE4 */ + while( j < uncompr_size && i < compr_size ) { + if ( comprbuf[i] ) { + runlength = comprbuf[i++]; + while( runlength > 0 && j < uncompr_size && i < compr_size ) { + if ( runlength & 0x01 ) + uncomprbuf[j++] = (comprbuf[i] & 0xF0) >> 4; + else + uncomprbuf[j++] = comprbuf[i] & 0x0F; + runlength--; + } + i++; + } else { + i++; + if (comprbuf[i] == 0) /* Next scanline */ + i++; + else if (comprbuf[i] == 1) /* End of image */ + break; + else if (comprbuf[i] == 2) { /* Move to... */ + i++; + if (i < compr_size - 1) { + j+=comprbuf[i]+comprbuf[i+1]*width; + i += 2; + } + else + break; + } else { /* Absolute mode */ + runlength = comprbuf[i++]; + for (k = 0; k < runlength && j < uncompr_size && i < compr_size; k++) { + if (k & 0x01) + uncomprbuf[j++] = comprbuf[i++] & 0x0F; + else + uncomprbuf[j++] = (comprbuf[i] & 0xF0) >> 4; + } + if (k & 0x01) + i++; + } + } + } + } + + _TIFFfree(comprbuf); + + for (row = 0; row < length; row++) { + if (TIFFWriteScanline(out, + uncomprbuf + (length - row - 1) * width, + row, 0) < 0) { + TIFFError(infilename, + "scanline %lu: Write error.\n", + (unsigned long) row); + } + } + + _TIFFfree(uncomprbuf); + } + TIFFWriteDirectory(out); + if (blue_tbl) { + _TIFFfree(blue_tbl); + blue_tbl=NULL; + } + if (green_tbl) { + _TIFFfree(green_tbl); + green_tbl=NULL; + } + if (red_tbl) { + _TIFFfree(red_tbl); + red_tbl=NULL; + } + } + +bad3: + if (blue_tbl) + _TIFFfree(blue_tbl); +bad2: + if (green_tbl) + _TIFFfree(green_tbl); +bad1: + if (red_tbl) + _TIFFfree(red_tbl); +bad: + close(fd); + + if (out) + TIFFClose(out); + return 0; +} + +/* + * Image data in BMP file stored in BGR (or ABGR) format. We should rearrange + * pixels to RGB (RGBA) format. + */ +static void +rearrangePixels(char *buf, uint32 width, uint32 bit_count) +{ + char tmp; + uint32 i; + + switch(bit_count) { + case 16: /* FIXME: need a sample file */ + break; + case 24: + for (i = 0; i < width; i++, buf += 3) { + tmp = *buf; + *buf = *(buf + 2); + *(buf + 2) = tmp; + } + break; + case 32: + { + char *buf1 = buf; + + for (i = 0; i < width; i++, buf += 4) { + tmp = *buf; + *buf1++ = *(buf + 2); + *buf1++ = *(buf + 1); + *buf1++ = tmp; + } + } + break; + default: + break; + } +} + +static int +processCompressOptions(char* opt) +{ + if (strcmp(opt, "none") == 0) + compression = COMPRESSION_NONE; + else if (strcmp(opt, "packbits") == 0) + compression = COMPRESSION_PACKBITS; + else if (strncmp(opt, "jpeg", 4) == 0) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strncmp(opt, "lzw", 3) == 0) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strncmp(opt, "zip", 3) == 0) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +static char* stuff[] = { +"bmp2tiff --- convert Windows BMP files to TIFF", +"usage: bmp2tiff [options] input.bmp [input2.bmp ...] output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c jpeg[:opts]compress output with JPEG encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +" -o out.tif write output to out.tif", +" -h this help message", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2ps.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2ps.c new file mode 100644 index 0000000..b8cdf89 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2ps.c @@ -0,0 +1,449 @@ +/* $Id: fax2ps.c,v 1.27 2011-04-02 19:30:20 bfriesen Exp $" */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ +#include "tif_config.h" + +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +float defxres = 204.; /* default x resolution (pixels/inch) */ +float defyres = 98.; /* default y resolution (lines/inch) */ +const float half = 0.5; +const float points = 72.0; +float pageWidth = 0; /* image page width (inches) */ +float pageHeight = 0; /* image page length (inches) */ +int scaleToPage = 0; /* if true, scale raster to page dimensions */ +int totalPages = 0; /* total # pages printed */ +int row; /* current output row */ +int maxline = 512; /* max output line of PostScript */ + +/* + * Turn a bit-mapped scanline into the appropriate sequence + * of PostScript characters to be rendered. + * + * Original version written by Bret D. Whissel, + * Florida State University Meteorology Department + * March 13-15, 1995. + */ +static void +printruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) +{ + static struct { + char white, black; + unsigned short width; + } WBarr[] = { + { 'd', 'n', 512 }, { 'e', 'o', 256 }, { 'f', 'p', 128 }, + { 'g', 'q', 64 }, { 'h', 'r', 32 }, { 'i', 's', 16 }, + { 'j', 't', 8 }, { 'k', 'u', 4 }, { 'l', 'v', 2 }, + { 'm', 'w', 1 } + }; + static char* svalue = + " !\"#$&'*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abc"; + int colormode = 1; /* 0 for white, 1 for black */ + uint32 runlength = 0; + int n = maxline; + uint32 x = 0; + int l; + + (void) buf; + printf("%d m(", row++); + while (runs < erun) { + if (runlength <= 0) { + colormode ^= 1; + runlength = *runs++; + if (x+runlength > lastx) + runlength = runs[-1] = lastx-x; + x += runlength; + if (!colormode && runs == erun) + break; /* don't bother printing the final white run */ + } + /* + * If a runlength is greater than 6 pixels, then spit out + * black or white characters until the runlength drops to + * 6 or less. Once a runlength is <= 6, then combine black + * and white runlengths until a 6-pixel pattern is obtained. + * Then write out the special character. Six-pixel patterns + * were selected since 64 patterns is the largest power of + * two less than the 92 "easily printable" PostScript + * characters (i.e., no escape codes or octal chars). + */ + l = 0; + while (runlength > 6) { /* Run is greater than six... */ + if (runlength >= WBarr[l].width) { + if (n == 0) { + putchar('\n'); + n = maxline; + } + putchar(colormode ? WBarr[l].black : WBarr[l].white), n--; + runlength -= WBarr[l].width; + } else + l++; + } + while (runlength > 0 && runlength <= 6) { + uint32 bitsleft = 6; + int t = 0; + while (bitsleft) { + if (runlength <= bitsleft) { + if (colormode) + t |= ((1 << runlength)-1) << (bitsleft-runlength); + bitsleft -= runlength; + runlength = 0; + if (bitsleft) { + if (runs >= erun) + break; + colormode ^= 1; + runlength = *runs++; + if (x+runlength > lastx) + runlength = runs[-1] = lastx-x; + x += runlength; + } + } else { /* runlength exceeds bits left */ + if (colormode) + t |= ((1 << bitsleft)-1); + runlength -= bitsleft; + bitsleft = 0; + } + } + if (n == 0) { + putchar('\n'); + n = maxline; + } + putchar(svalue[t]), n--; + } + } + printf(")s\n"); +} + +/* + * Create a special PostScript font for printing FAX documents. By taking + * advantage of the font-cacheing mechanism, a substantial speed-up in + * rendering time is realized. + */ +static void +emitFont(FILE* fd) +{ + static const char* fontPrologue[] = { + "/newfont 10 dict def newfont begin /FontType 3 def /FontMatrix [1", + "0 0 1 0 0] def /FontBBox [0 0 512 1] def /Encoding 256 array def", + "0 1 31{Encoding exch /255 put}for 120 1 255{Encoding exch /255", + "put}for Encoding 37 /255 put Encoding 40 /255 put Encoding 41 /255", + "put Encoding 92 /255 put /count 0 def /ls{Encoding exch count 3", + "string cvs cvn put /count count 1 add def}def 32 1 36{ls}for", + "38 1 39{ls}for 42 1 91{ls}for 93 1 99{ls}for /count 100", + "def 100 1 119{ls}for /CharDict 5 dict def CharDict begin /white", + "{dup 255 eq{pop}{1 dict begin 100 sub neg 512 exch bitshift", + "/cw exch def cw 0 0 0 cw 1 setcachedevice end}ifelse}def /black", + "{dup 255 eq{pop}{1 dict begin 110 sub neg 512 exch bitshift", + "/cw exch def cw 0 0 0 cw 1 setcachedevice 0 0 moveto cw 0 rlineto", + "0 1 rlineto cw neg 0 rlineto closepath fill end}ifelse}def /numbuild", + "{dup 255 eq{pop}{6 0 0 0 6 1 setcachedevice 0 1 5{0 moveto", + "dup 32 and 32 eq{1 0 rlineto 0 1 rlineto -1 0 rlineto closepath", + "fill newpath}if 1 bitshift}for pop}ifelse}def /.notdef {}", + "def /255 {}def end /BuildChar{exch begin dup 110 ge{Encoding", + "exch get 3 string cvs cvi CharDict /black get}{dup 100 ge {Encoding", + "exch get 3 string cvs cvi CharDict /white get}{Encoding exch get", + "3 string cvs cvi CharDict /numbuild get}ifelse}ifelse exec end", + "}def end /Bitfont newfont definefont 1 scalefont setfont", + NULL + }; + int i; + for (i = 0; fontPrologue[i] != NULL; i++) + fprintf(fd, "%s\n", fontPrologue[i]); +} + +void +printTIF(TIFF* tif, uint16 pageNumber) +{ + uint32 w, h; + uint16 unit, compression; + float xres, yres, scale = 1.0; + tstrip_t s, ns; + time_t creation_time; + + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); + if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression) + || compression < COMPRESSION_CCITTRLE + || compression > COMPRESSION_CCITT_T6) + return; + if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) || !xres) { + TIFFWarning(TIFFFileName(tif), + "No x-resolution, assuming %g dpi", defxres); + xres = defxres; + } + if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) || !yres) { + TIFFWarning(TIFFFileName(tif), + "No y-resolution, assuming %g lpi", defyres); + yres = defyres; /* XXX */ + } + if (TIFFGetField(tif, TIFFTAG_RESOLUTIONUNIT, &unit) && + unit == RESUNIT_CENTIMETER) { + xres *= 2.54F; + yres *= 2.54F; + } + if (pageWidth == 0) + pageWidth = w / xres; + if (pageHeight == 0) + pageHeight = h / yres; + + printf("%%!PS-Adobe-3.0\n"); + printf("%%%%Creator: fax2ps\n"); +#ifdef notdef + printf("%%%%Title: %s\n", file); +#endif + creation_time = time(0); + printf("%%%%CreationDate: %s", ctime(&creation_time)); + printf("%%%%Origin: 0 0\n"); + printf("%%%%BoundingBox: 0 0 %u %u\n", + (int)(pageWidth * points), (int)(pageHeight * points)); /* XXX */ + printf("%%%%Pages: (atend)\n"); + printf("%%%%EndComments\n"); + printf("%%%%BeginProlog\n"); + emitFont(stdout); + printf("/d{bind def}def\n"); /* bind and def proc */ + printf("/m{0 exch moveto}d\n"); + printf("/s{show}d\n"); + printf("/p{showpage}d \n"); /* end page */ + printf("%%%%EndProlog\n"); + printf("%%%%Page: \"%u\" %u\n", pageNumber, pageNumber); + printf("/$pageTop save def gsave\n"); + if (scaleToPage) + scale = pageHeight / (h/yres) < pageWidth / (w/xres) ? + pageHeight / (h/yres) : pageWidth / (w/xres); + printf("%g %g translate\n", + points * (pageWidth - scale*w/xres) * half, + points * (scale*h/yres + (pageHeight - scale*h/yres) * half)); + printf("%g %g scale\n", points/xres*scale, -points/yres*scale); + printf("0 setgray\n"); + TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, printruns); + ns = TIFFNumberOfStrips(tif); + row = 0; + for (s = 0; s < ns; s++) + (void) TIFFReadEncodedStrip(tif, s, (tdata_t) NULL, (tsize_t) -1); + printf("p\n"); + printf("grestore $pageTop restore\n"); + totalPages++; +} + +#define GetPageNumber(tif) \ +TIFFGetField(tif, TIFFTAG_PAGENUMBER, &pn, &ptotal) + +int +findPage(TIFF* tif, uint16 pageNumber) +{ + uint16 pn = (uint16) -1; + uint16 ptotal = (uint16) -1; + if (GetPageNumber(tif)) { + while (pn != (pageNumber-1) && TIFFReadDirectory(tif) && GetPageNumber(tif)) + ; + return (pn == (pageNumber-1)); + } else + return (TIFFSetDirectory(tif, (tdir_t)(pageNumber-1))); +} + +void +fax2ps(TIFF* tif, uint16 npages, uint16* pages, char* filename) +{ + if (npages > 0) { + uint16 pn, ptotal; + int i; + + if (!GetPageNumber(tif)) + fprintf(stderr, "%s: No page numbers, counting directories.\n", + filename); + for (i = 0; i < npages; i++) { + if (findPage(tif, pages[i])) + printTIF(tif, pages[i]); + else + fprintf(stderr, "%s: No page number %d\n", filename, pages[i]); + } + } else { + uint16 pageNumber = 0; + do + printTIF(tif, pageNumber++); + while (TIFFReadDirectory(tif)); + } +} + +#undef GetPageNumber + +static int +pcompar(const void* va, const void* vb) +{ + const int* pa = (const int*) va; + const int* pb = (const int*) vb; + return (*pa - *pb); +} + +static void usage(int code); + +int +main(int argc, char** argv) +{ + extern int optind; + extern char* optarg; + uint16 *pages = NULL, npages = 0, pageNumber; + int c, dowarnings = 0; /* if 1, enable library warnings */ + TIFF* tif; + + while ((c = getopt(argc, argv, "l:p:x:y:W:H:wS")) != -1) + switch (c) { + case 'H': /* page height */ + pageHeight = (float)atof(optarg); + break; + case 'S': /* scale to page */ + scaleToPage = 1; + break; + case 'W': /* page width */ + pageWidth = (float)atof(optarg); + break; + case 'p': /* print specific page */ + pageNumber = (uint16)atoi(optarg); + if (pages) + pages = (uint16*) realloc(pages, (npages+1)*sizeof(uint16)); + else + pages = (uint16*) malloc(sizeof(uint16)); + pages[npages++] = pageNumber; + break; + case 'w': + dowarnings = 1; + break; + case 'x': + defxres = (float)atof(optarg); + break; + case 'y': + defyres = (float)atof(optarg); + break; + case 'l': + maxline = atoi(optarg); + break; + case '?': + usage(-1); + } + if (npages > 0) + qsort(pages, npages, sizeof(uint16), pcompar); + if (!dowarnings) + TIFFSetWarningHandler(0); + if (optind < argc) { + do { + tif = TIFFOpen(argv[optind], "r"); + if (tif) { + fax2ps(tif, npages, pages, argv[optind]); + TIFFClose(tif); + } else + fprintf(stderr, "%s: Can not open, or not a TIFF file.\n", + argv[optind]); + } while (++optind < argc); + } else { + int n; + FILE* fd; + char buf[16*1024]; + + fd = tmpfile(); + if (fd == NULL) { + fprintf(stderr, "Could not obtain temporary file.\n"); + exit(-2); + } +#if defined(HAVE_SETMODE) && defined(O_BINARY) + setmode(fileno(stdin), O_BINARY); +#endif + while ((n = read(fileno(stdin), buf, sizeof (buf))) > 0) + write(fileno(fd), buf, n); + lseek(fileno(fd), 0, SEEK_SET); +#if defined(_WIN32) && defined(USE_WIN32_FILEIO) + tif = TIFFFdOpen(_get_osfhandle(fileno(fd)), "temp", "r"); +#else + tif = TIFFFdOpen(fileno(fd), "temp", "r"); +#endif + if (tif) { + fax2ps(tif, npages, pages, ""); + TIFFClose(tif); + } else + fprintf(stderr, "Can not open, or not a TIFF file.\n"); + fclose(fd); + } + printf("%%%%Trailer\n"); + printf("%%%%Pages: %u\n", totalPages); + printf("%%%%EOF\n"); + + return (0); +} + +char* stuff[] = { +"usage: fax2ps [options] [input.tif ...]", +"where options are:", +" -w suppress warning messages", +" -l chars set maximum output line length for generated PostScript", +" -p page# select page to print (can use multiple times)", +" -x xres set default horizontal resolution of input data (dpi)", +" -y yres set default vertical resolution of input data (lpi)", +" -S scale output to page size", +" -W width set output page width (inches), default is 8.5", +" -H height set output page height (inches), default is 11", +NULL +}; + +static void +usage(int code) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(code); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2tiff.c new file mode 100644 index 0000000..8881e5f --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/fax2tiff.c @@ -0,0 +1,469 @@ +/* $Id: fax2tiff.c,v 1.22 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1990-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * Convert a CCITT Group 3 or 4 FAX file to TIFF Group 3 or 4 format. + */ +#include "tif_config.h" + +#include +#include /* should have atof & getopt */ + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffiop.h" + +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) + +TIFF *faxTIFF; +char *rowbuf; +char *refbuf; + +uint32 xsize = 1728; +int verbose; +int stretch; +uint16 badfaxrun; +uint32 badfaxlines; + +int copyFaxFile(TIFF* tifin, TIFF* tifout); +static void usage(void); + +int +main(int argc, char* argv[]) +{ + FILE *in; + TIFF *out = NULL; + TIFFErrorHandler whandler = NULL; + int compression_in = COMPRESSION_CCITTFAX3; + int compression_out = COMPRESSION_CCITTFAX3; + int fillorder_in = FILLORDER_LSB2MSB; + int fillorder_out = FILLORDER_LSB2MSB; + uint32 group3options_in = 0; /* 1d-encoded */ + uint32 group3options_out = 0; /* 1d-encoded */ + uint32 group4options_in = 0; /* compressed */ + uint32 group4options_out = 0; /* compressed */ + uint32 defrowsperstrip = (uint32) 0; + uint32 rowsperstrip; + int photometric_in = PHOTOMETRIC_MINISWHITE; + int photometric_out = PHOTOMETRIC_MINISWHITE; + int mode = FAXMODE_CLASSF; + int rows; + int c; + int pn, npages; + float resY = 196.0; + extern int optind; + extern char* optarg; + + + while ((c = getopt(argc, argv, "R:X:o:1234ABLMPUW5678abcflmprsuvwz?")) != -1) + switch (c) { + /* input-related options */ + case '3': /* input is g3-encoded */ + compression_in = COMPRESSION_CCITTFAX3; + break; + case '4': /* input is g4-encoded */ + compression_in = COMPRESSION_CCITTFAX4; + break; + case 'U': /* input is uncompressed (g3 and g4) */ + group3options_in |= GROUP3OPT_UNCOMPRESSED; + group4options_in |= GROUP4OPT_UNCOMPRESSED; + break; + case '1': /* input is 1d-encoded (g3 only) */ + group3options_in &= ~GROUP3OPT_2DENCODING; + break; + case '2': /* input is 2d-encoded (g3 only) */ + group3options_in |= GROUP3OPT_2DENCODING; + break; + case 'P': /* input has not-aligned EOL (g3 only) */ + group3options_in &= ~GROUP3OPT_FILLBITS; + break; + case 'A': /* input has aligned EOL (g3 only) */ + group3options_in |= GROUP3OPT_FILLBITS; + break; + case 'W': /* input has 0 mean white */ + photometric_in = PHOTOMETRIC_MINISWHITE; + break; + case 'B': /* input has 0 mean black */ + photometric_in = PHOTOMETRIC_MINISBLACK; + break; + case 'L': /* input has lsb-to-msb fillorder */ + fillorder_in = FILLORDER_LSB2MSB; + break; + case 'M': /* input has msb-to-lsb fillorder */ + fillorder_in = FILLORDER_MSB2LSB; + break; + case 'R': /* input resolution */ + resY = (float) atof(optarg); + break; + case 'X': /* input width */ + xsize = (uint32) atoi(optarg); + break; + + /* output-related options */ + case '7': /* generate g3-encoded output */ + compression_out = COMPRESSION_CCITTFAX3; + break; + case '8': /* generate g4-encoded output */ + compression_out = COMPRESSION_CCITTFAX4; + break; + case 'u': /* generate uncompressed output (g3 and g4) */ + group3options_out |= GROUP3OPT_UNCOMPRESSED; + group4options_out |= GROUP4OPT_UNCOMPRESSED; + break; + case '5': /* generate 1d-encoded output (g3 only) */ + group3options_out &= ~GROUP3OPT_2DENCODING; + break; + case '6': /* generate 2d-encoded output (g3 only) */ + group3options_out |= GROUP3OPT_2DENCODING; + break; + case 'c': /* generate "classic" g3 format */ + mode = FAXMODE_CLASSIC; + break; + case 'f': /* generate Class F format */ + mode = FAXMODE_CLASSF; + break; + case 'm': /* output's fillorder is msb-to-lsb */ + fillorder_out = FILLORDER_MSB2LSB; + break; + case 'l': /* output's fillorder is lsb-to-msb */ + fillorder_out = FILLORDER_LSB2MSB; + break; + case 'o': + out = TIFFOpen(optarg, "w"); + if (out == NULL) { + fprintf(stderr, + "%s: Can not create or open %s\n", + argv[0], optarg); + return EXIT_FAILURE; + } + break; + case 'a': /* generate EOL-aligned output (g3 only) */ + group3options_out |= GROUP3OPT_FILLBITS; + break; + case 'p': /* generate not EOL-aligned output (g3 only) */ + group3options_out &= ~GROUP3OPT_FILLBITS; + break; + case 'r': /* rows/strip */ + defrowsperstrip = atol(optarg); + break; + case 's': /* stretch image by dup'ng scanlines */ + stretch = 1; + break; + case 'w': /* undocumented -- for testing */ + photometric_out = PHOTOMETRIC_MINISWHITE; + break; + case 'b': /* undocumented -- for testing */ + photometric_out = PHOTOMETRIC_MINISBLACK; + break; + case 'z': /* undocumented -- for testing */ + compression_out = COMPRESSION_LZW; + break; + case 'v': /* -v for info */ + verbose++; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + npages = argc - optind; + if (npages < 1) + usage(); + + rowbuf = _TIFFmalloc(TIFFhowmany8(xsize)); + refbuf = _TIFFmalloc(TIFFhowmany8(xsize)); + if (rowbuf == NULL || refbuf == NULL) { + fprintf(stderr, "%s: Not enough memory\n", argv[0]); + return (EXIT_FAILURE); + } + + if (out == NULL) { + out = TIFFOpen("fax.tif", "w"); + if (out == NULL) { + fprintf(stderr, "%s: Can not create fax.tif\n", + argv[0]); + return (EXIT_FAILURE); + } + } + + faxTIFF = TIFFClientOpen("(FakeInput)", "w", + /* TIFFClientOpen() fails if we don't set existing value here */ + TIFFClientdata(out), + TIFFGetReadProc(out), TIFFGetWriteProc(out), + TIFFGetSeekProc(out), TIFFGetCloseProc(out), + TIFFGetSizeProc(out), TIFFGetMapFileProc(out), + TIFFGetUnmapFileProc(out)); + if (faxTIFF == NULL) { + fprintf(stderr, "%s: Can not create fake input file\n", + argv[0]); + return (EXIT_FAILURE); + } + TIFFSetMode(faxTIFF, O_RDONLY); + TIFFSetField(faxTIFF, TIFFTAG_IMAGEWIDTH, xsize); + TIFFSetField(faxTIFF, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(faxTIFF, TIFFTAG_BITSPERSAMPLE, 1); + TIFFSetField(faxTIFF, TIFFTAG_FILLORDER, fillorder_in); + TIFFSetField(faxTIFF, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(faxTIFF, TIFFTAG_PHOTOMETRIC, photometric_in); + TIFFSetField(faxTIFF, TIFFTAG_YRESOLUTION, resY); + TIFFSetField(faxTIFF, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); + + /* NB: this must be done after directory info is setup */ + TIFFSetField(faxTIFF, TIFFTAG_COMPRESSION, compression_in); + if (compression_in == COMPRESSION_CCITTFAX3) + TIFFSetField(faxTIFF, TIFFTAG_GROUP3OPTIONS, group3options_in); + else if (compression_in == COMPRESSION_CCITTFAX4) + TIFFSetField(faxTIFF, TIFFTAG_GROUP4OPTIONS, group4options_in); + for (pn = 0; optind < argc; pn++, optind++) { + in = fopen(argv[optind], "rb"); + if (in == NULL) { + fprintf(stderr, + "%s: %s: Can not open\n", argv[0], argv[optind]); + continue; + } +#if defined(_WIN32) && defined(USE_WIN32_FILEIO) + TIFFSetClientdata(faxTIFF, (thandle_t)_get_osfhandle(fileno(in))); +#else + TIFFSetClientdata(faxTIFF, (thandle_t)fileno(in)); +#endif + TIFFSetFileName(faxTIFF, (const char*)argv[optind]); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, xsize); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression_out); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric_out); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1); + switch (compression_out) { + /* g3 */ + case COMPRESSION_CCITTFAX3: + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, + group3options_out); + TIFFSetField(out, TIFFTAG_FAXMODE, mode); + rowsperstrip = + (defrowsperstrip)?defrowsperstrip:(uint32)-1L; + break; + + /* g4 */ + case COMPRESSION_CCITTFAX4: + TIFFSetField(out, TIFFTAG_GROUP4OPTIONS, + group4options_out); + TIFFSetField(out, TIFFTAG_FAXMODE, mode); + rowsperstrip = + (defrowsperstrip)?defrowsperstrip:(uint32)-1L; + break; + + default: + rowsperstrip = (defrowsperstrip) ? + defrowsperstrip : TIFFDefaultStripSize(out, 0); + } + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder_out); + TIFFSetField(out, TIFFTAG_SOFTWARE, "fax2tiff"); + TIFFSetField(out, TIFFTAG_XRESOLUTION, 204.0); + if (!stretch) { + TIFFGetField(faxTIFF, TIFFTAG_YRESOLUTION, &resY); + TIFFSetField(out, TIFFTAG_YRESOLUTION, resY); + } else + TIFFSetField(out, TIFFTAG_YRESOLUTION, 196.); + TIFFSetField(out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); + TIFFSetField(out, TIFFTAG_PAGENUMBER, pn, npages); + + if (!verbose) + whandler = TIFFSetWarningHandler(NULL); + rows = copyFaxFile(faxTIFF, out); + fclose(in); + if (!verbose) + (void) TIFFSetWarningHandler(whandler); + + TIFFSetField(out, TIFFTAG_IMAGELENGTH, rows); + + if (verbose) { + fprintf(stderr, "%s:\n", argv[optind]); + fprintf(stderr, "%d rows in input\n", rows); + fprintf(stderr, "%ld total bad rows\n", + (long) badfaxlines); + fprintf(stderr, "%d max consecutive bad rows\n", badfaxrun); + } + if (compression_out == COMPRESSION_CCITTFAX3 && + mode == FAXMODE_CLASSF) { + TIFFSetField(out, TIFFTAG_BADFAXLINES, badfaxlines); + TIFFSetField(out, TIFFTAG_CLEANFAXDATA, badfaxlines ? + CLEANFAXDATA_REGENERATED : CLEANFAXDATA_CLEAN); + TIFFSetField(out, TIFFTAG_CONSECUTIVEBADFAXLINES, badfaxrun); + } + TIFFWriteDirectory(out); + } + TIFFClose(out); + _TIFFfree(rowbuf); + _TIFFfree(refbuf); + return (EXIT_SUCCESS); +} + +int +copyFaxFile(TIFF* tifin, TIFF* tifout) +{ + uint32 row; + uint32 linesize = TIFFhowmany8(xsize); + uint16 badrun; + int ok; + + tifin->tif_rawdatasize = (tmsize_t)TIFFGetFileSize(tifin); + tifin->tif_rawdata = _TIFFmalloc(tifin->tif_rawdatasize); + if (tifin->tif_rawdata == NULL) { + TIFFError(tifin->tif_name, "Not enough memory"); + return (0); + } + if (!ReadOK(tifin, tifin->tif_rawdata, tifin->tif_rawdatasize)) { + TIFFError(tifin->tif_name, "Read error at scanline 0"); + return (0); + } + tifin->tif_rawcp = tifin->tif_rawdata; + tifin->tif_rawcc = tifin->tif_rawdatasize; + + (*tifin->tif_setupdecode)(tifin); + (*tifin->tif_predecode)(tifin, (tsample_t) 0); + tifin->tif_row = 0; + badfaxlines = 0; + badfaxrun = 0; + + _TIFFmemset(refbuf, 0, linesize); + row = 0; + badrun = 0; /* current run of bad lines */ + while (tifin->tif_rawcc > 0) { + ok = (*tifin->tif_decoderow)(tifin, (tdata_t) rowbuf, + linesize, 0); + if (!ok) { + badfaxlines++; + badrun++; + /* regenerate line from previous good line */ + _TIFFmemcpy(rowbuf, refbuf, linesize); + } else { + if (badrun > badfaxrun) + badfaxrun = badrun; + badrun = 0; + _TIFFmemcpy(refbuf, rowbuf, linesize); + } + tifin->tif_row++; + + if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) { + fprintf(stderr, "%s: Write error at row %ld.\n", + tifout->tif_name, (long) row); + break; + } + row++; + if (stretch) { + if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) { + fprintf(stderr, "%s: Write error at row %ld.\n", + tifout->tif_name, (long) row); + break; + } + row++; + } + } + if (badrun > badfaxrun) + badfaxrun = badrun; + _TIFFfree(tifin->tif_rawdata); + return (row); +} + +char* stuff[] = { +"usage: fax2tiff [options] input.raw...", +"where options are:", +" -3 input data is G3-encoded [default]", +" -4 input data is G4-encoded", +" -U input data is uncompressed (G3 or G4)", +" -1 input data is 1D-encoded (G3 only) [default]", +" -2 input data is 2D-encoded (G3 only)", +" -P input is not EOL-aligned (G3 only) [default]", +" -A input is EOL-aligned (G3 only)", +" -M input data has MSB2LSB bit order", +" -L input data has LSB2MSB bit order [default]", +" -B input data has min 0 means black", +" -W input data has min 0 means white [default]", +" -R # input data has # resolution (lines/inch) [default is 196]", +" -X # input data has # width [default is 1728]", +"", +" -o out.tif write output to out.tif", +" -7 generate G3-encoded output [default]", +" -8 generate G4-encoded output", +" -u generate uncompressed output (G3 or G4)", +" -5 generate 1D-encoded output (G3 only)", +" -6 generate 2D-encoded output (G3 only) [default]", +" -p generate not EOL-aligned output (G3 only)", +" -a generate EOL-aligned output (G3 only) [default]", +" -c generate \"classic\" TIFF format", +" -f generate TIFF Class F (TIFF/F) format [default]", +" -m output fill order is MSB2LSB", +" -l output fill order is LSB2MSB [default]", +" -r # make each strip have no more than # rows", +" -s stretch image by duplicating scanlines", +" -v print information about conversion work", +" -z generate LZW compressed output", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(EXIT_FAILURE); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/gif2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/gif2tiff.c new file mode 100644 index 0000000..17f7a19 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/gif2tiff.c @@ -0,0 +1,530 @@ +/* $Id: gif2tiff.c,v 1.12 2010-12-15 00:22:44 faxguy Exp $ */ + +/* + * Copyright (c) 1990-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * convert a GIF file into a TIFF file. + * based on Paul Haeberli's fromgif program which in turn is + * based on a GIF file reader by Marcel J.E. Mol March 23 1989 + * + * if input is 320 by 200 pixel aspect is probably 1.2 + * if input is 640 350 pixel aspect is probably 1.37 + * + */ +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#define GIFGAMMA (1.5) /* smaller makes output img brighter */ +#define IMAX 0xffff /* max intensity value */ +#define EXTRAFUDGE 128 /* some people write BAD .gif files */ + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +unsigned short gamtab[256]; + +void +makegamtab(float gam) +{ + int i; + + for(i=0; i<256; i++) + gamtab[i] = (unsigned short) (IMAX*pow(i/255.0,gam)+0.5); +} + +char* stuff[] = { +"usage: gif2tiff [options] input.gif output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +#define COLSIZE 256 + +unsigned char *stackp; +unsigned int prefix[4096]; +unsigned char suffix[4096]; +unsigned char stack[4096]; +int datasize,codesize,codemask; /* Decoder working variables */ +int clear,eoi; /* Special code values */ +int avail, oldcode; + +FILE *infile; +int global; /* Is there a global color map? */ +int globalbits; /* Number of bits of global colors */ +unsigned char globalmap[COLSIZE][3];/* RGB values for global color map */ +unsigned char *raster; /* Decoded image data */ +unsigned long width, height; +unsigned short red[COLSIZE]; +unsigned short green[COLSIZE]; +unsigned short blue[COLSIZE]; +char *filename, *imagename; + +static uint16 compression = COMPRESSION_PACKBITS; +static uint16 predictor = 0; +static uint32 rowsperstrip = (uint32) -1; +static int processCompressOptions(char*); + +int convert(void); +int checksignature(void); +void readscreen(void); +int readgifimage(char*); +void readextension(void); +int readraster(void); +int process(int, unsigned char**); +void initcolors(unsigned char [COLSIZE][3], int); +void rasterize(int, char*); + +int +main(int argc, char* argv[]) +{ + extern int optind; + extern char *optarg; + int c, status; + + while ((c = getopt(argc, argv, "c:r:")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 2) + usage(); + + makegamtab(GIFGAMMA); + filename = argv[optind]; + imagename = argv[optind+1]; + if ((infile = fopen(imagename, "rb")) != NULL) { + int c; + fclose(infile); + printf("overwrite %s? ", imagename); fflush(stdout); + c = getc(stdin); + if (c != 'y' && c != 'Y') + return (1); + } + if ((infile = fopen(filename, "rb")) == NULL) { + perror(filename); + return (1); + } + status = convert(); + fclose(infile); + return (status); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +int +convert(void) +{ + int ch; + char* mode = "w"; + + if (!checksignature()) + return (-1); + readscreen(); + while ((ch = getc(infile)) != ';' && ch != EOF) { + switch (ch) { + case '\0': break; /* this kludge for non-standard files */ + case ',': if (!readgifimage(mode)) + return (-1); + mode = "a"; /* subsequent images append */ + break; + case '!': readextension(); + break; + default: fprintf(stderr, "illegal GIF block type\n"); + return (-1); + } + } + return (0); +} + +int +checksignature(void) +{ + char buf[6]; + + fread(buf,1,6,infile); + if (strncmp(buf,"GIF",3)) { + fprintf(stderr, "file is not a GIF file\n"); + return 0; + } + if (strncmp(&buf[3],"87a",3)) { + fprintf(stderr, "unknown GIF version number\n"); + return 0; + } + return 1; +} + +/* + * readscreen - + * Get information which is global to all the images stored + * in the file + */ +void +readscreen(void) +{ + unsigned char buf[7]; + + fread(buf,1,7,infile); + global = buf[4] & 0x80; + if (global) { + globalbits = (buf[4] & 0x07) + 1; + fread(globalmap,3,((size_t)1)< 0; count = getc(infile)) { + fread(buf,1,count,infile); + for (ch=buf; count-- > 0; ch++) { + datum += (unsigned long) *ch << bits; + bits += 8; + while (bits >= codesize) { + code = datum & codemask; + datum >>= codesize; + bits -= codesize; + if (code == eoi) { /* This kludge put in */ + goto exitloop; /* because some GIF files*/ + } /* aren't standard */ + if (!process(code, &fill)) { + status = 0; + goto exitloop; + } + } + } + if (fill >= raster + width*height) { + fprintf(stderr, "raster full before eoi code\n"); + break; + } + } +exitloop: + if (fill != raster + width*height) { + fprintf(stderr, "warning: wrong rastersize: %ld bytes\n", + (long) (fill-raster)); + fprintf(stderr, " instead of %ld bytes\n", + (long) width*height); + } + return status; +} + +/* + * process - + * Process a compression code. "clear" resets the code table. + * Otherwise make a new code table entry, and output the bytes + * associated with the code. + */ +int +process(register int code, unsigned char** fill) +{ + int incode; + static unsigned char firstchar; + + if (code == clear) { + codesize = datasize + 1; + codemask = (1 << codesize) - 1; + avail = clear + 2; + oldcode = -1; + return 1; + } + + if (oldcode == -1) { + *(*fill)++ = suffix[code]; + firstchar = oldcode = code; + return 1; + } + if (code > avail) { + fprintf(stderr, "code %d too large for %d\n", code, avail); + return 0; + } + + incode = code; + if (code == avail) { /* the first code is always < avail */ + *stackp++ = firstchar; + code = oldcode; + } + while (code > clear) { + *stackp++ = suffix[code]; + code = prefix[code]; + } + + *stackp++ = firstchar = suffix[code]; + prefix[avail] = oldcode; + suffix[avail] = firstchar; + avail++; + + if (((avail & codemask) == 0) && (avail < 4096)) { + codesize++; + codemask += avail; + } + oldcode = incode; + do { + *(*fill)++ = *--stackp; + } while (stackp > stack); + return 1; +} + +/* + * initcolors - + * Convert a color map (local or global) to arrays with R, G and B + * values. + * + */ +void +initcolors(unsigned char colormap[COLSIZE][3], int ncolors) +{ + register int i; + + for (i = 0; i < ncolors; i++) { + red[i] = gamtab[colormap[i][0]]; + green[i] = gamtab[colormap[i][1]]; + blue[i] = gamtab[colormap[i][2]]; + } +} + +void +rasterize(int interleaved, char* mode) +{ + register unsigned long row; + unsigned char *newras; + unsigned char *ras; + TIFF *tif; + tstrip_t strip; + tsize_t stripsize; + + if ((newras = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) { + fprintf(stderr, "not enough memory for image\n"); + return; + } +#define DRAWSEGMENT(offset, step) { \ + for (row = offset; row < height; row += step) { \ + _TIFFmemcpy(newras + row*width, ras, width);\ + ras += width; \ + } \ + } + ras = raster; + if (interleaved) { + DRAWSEGMENT(0, 8); + DRAWSEGMENT(4, 8); + DRAWSEGMENT(2, 4); + DRAWSEGMENT(1, 2); + } else + DRAWSEGMENT(0, 1); +#undef DRAWSEGMENT + + tif = TIFFOpen(imagename, mode); + if (!tif) { + TIFFError(imagename,"Can not open output image"); + exit(-1); + } + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) width); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32) height); + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, + rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip)); + TIFFSetField(tif, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor); + break; + } + TIFFSetField(tif, TIFFTAG_COLORMAP, red, green, blue); + TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + strip = 0; + stripsize = TIFFStripSize(tif); + for (row=0; row height-row) { + rowsperstrip = height-row; + stripsize = TIFFVStripSize(tif, rowsperstrip); + } + if (TIFFWriteEncodedStrip(tif, strip, newras+row*width, stripsize) < 0) + break; + strip++; + } + TIFFClose(tif); + + _TIFFfree(newras); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/pal2rgb.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/pal2rgb.c new file mode 100644 index 0000000..8608aad --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/pal2rgb.c @@ -0,0 +1,435 @@ +/* $Id: pal2rgb.c,v 1.13 2010-07-02 12:02:56 dron Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +static void usage(void); +static void cpTags(TIFF* in, TIFF* out); + +static int +checkcmap(int n, uint16* r, uint16* g, uint16* b) +{ + while (n-- > 0) + if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) + return (16); + fprintf(stderr, "Warning, assuming 8-bit colormap.\n"); + return (8); +} + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) + +static uint16 compression = (uint16) -1; +static uint16 predictor = 0; +static int quality = 75; /* JPEG quality */ +static int jpegcolormode = JPEGCOLORMODE_RGB; +static int processCompressOptions(char*); + +int +main(int argc, char* argv[]) +{ + uint16 bitspersample, shortv; + uint32 imagewidth, imagelength; + uint16 config = PLANARCONFIG_CONTIG; + uint32 rowsperstrip = (uint32) -1; + uint16 photometric = PHOTOMETRIC_RGB; + uint16 *rmap, *gmap, *bmap; + uint32 row; + int cmap = -1; + TIFF *in, *out; + int c; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "C:c:p:r:")) != -1) + switch (c) { + case 'C': /* force colormap interpretation */ + cmap = atoi(optarg); + break; + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'p': /* planar configuration */ + if (streq(optarg, "separate")) + config = PLANARCONFIG_SEPARATE; + else if (streq(optarg, "contig")) + config = PLANARCONFIG_CONTIG; + else + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 2) + usage(); + in = TIFFOpen(argv[optind], "r"); + if (in == NULL) + return (-1); + if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &shortv) || + shortv != PHOTOMETRIC_PALETTE) { + fprintf(stderr, "%s: Expecting a palette image.\n", + argv[optind]); + return (-1); + } + if (!TIFFGetField(in, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) { + fprintf(stderr, + "%s: No colormap (not a valid palette image).\n", + argv[optind]); + return (-1); + } + bitspersample = 0; + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); + if (bitspersample != 8) { + fprintf(stderr, "%s: Sorry, can only handle 8-bit images.\n", + argv[optind]); + return (-1); + } + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return (-2); + cpTags(in, out); + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength); + if (compression != (uint16)-1) + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + else + TIFFGetField(in, TIFFTAG_COMPRESSION, &compression); + switch (compression) { + case COMPRESSION_JPEG: + if (jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + else + photometric = PHOTOMETRIC_RGB; + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip)); + (void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv); + if (cmap == -1) + cmap = checkcmap(1<= 0; i--) { +#define CVT(x) (((x) * 255) / ((1L<<16)-1)) + rmap[i] = CVT(rmap[i]); + gmap[i] = CVT(gmap[i]); + bmap[i] = CVT(bmap[i]); + } + } + { unsigned char *ibuf, *obuf; + register unsigned char* pp; + register uint32 x; + ibuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(in)); + obuf = (unsigned char*)_TIFFmalloc(TIFFScanlineSize(out)); + switch (config) { + case PLANARCONFIG_CONTIG: + for (row = 0; row < imagelength; row++) { + if (!TIFFReadScanline(in, ibuf, row, 0)) + goto done; + pp = obuf; + for (x = 0; x < imagewidth; x++) { + *pp++ = (unsigned char) rmap[ibuf[x]]; + *pp++ = (unsigned char) gmap[ibuf[x]]; + *pp++ = (unsigned char) bmap[ibuf[x]]; + } + if (!TIFFWriteScanline(out, obuf, row, 0)) + goto done; + } + break; + case PLANARCONFIG_SEPARATE: + for (row = 0; row < imagelength; row++) { + if (!TIFFReadScanline(in, ibuf, row, 0)) + goto done; + for (pp = obuf, x = 0; x < imagewidth; x++) + *pp++ = (unsigned char) rmap[ibuf[x]]; + if (!TIFFWriteScanline(out, obuf, row, 0)) + goto done; + for (pp = obuf, x = 0; x < imagewidth; x++) + *pp++ = (unsigned char) gmap[ibuf[x]]; + if (!TIFFWriteScanline(out, obuf, row, 0)) + goto done; + for (pp = obuf, x = 0; x < imagewidth; x++) + *pp++ = (unsigned char) bmap[ibuf[x]]; + if (!TIFFWriteScanline(out, obuf, row, 0)) + goto done; + } + break; + } + _TIFFfree(ibuf); + _TIFFfree(obuf); + } +done: + (void) TIFFClose(in); + (void) TIFFClose(out); + return (0); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) +#define CopyField4(tag, v1, v2, v3, v4) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4) + +static void +cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type) +{ + switch (type) { + case TIFF_SHORT: + if (count == 1) { + uint16 shortv; + CopyField(tag, shortv); + } else if (count == 2) { + uint16 shortv1, shortv2; + CopyField2(tag, shortv1, shortv2); + } else if (count == 4) { + uint16 *tr, *tg, *tb, *ta; + CopyField4(tag, tr, tg, tb, ta); + } else if (count == (uint16) -1) { + uint16 shortv1; + uint16* shortav; + CopyField2(tag, shortv1, shortav); + } + break; + case TIFF_LONG: + { uint32 longv; + CopyField(tag, longv); + } + break; + case TIFF_RATIONAL: + if (count == 1) { + float floatv; + CopyField(tag, floatv); + } else if (count == (uint16) -1) { + float* floatav; + CopyField(tag, floatav); + } + break; + case TIFF_ASCII: + { char* stringv; + CopyField(tag, stringv); + } + break; + case TIFF_DOUBLE: + if (count == 1) { + double doublev; + CopyField(tag, doublev); + } else if (count == (uint16) -1) { + double* doubleav; + CopyField(tag, doubleav); + } + break; + default: + TIFFError(TIFFFileName(in), + "Data type %d is not supported, tag %d skipped.", + tag, type); + } +} + +#undef CopyField4 +#undef CopyField3 +#undef CopyField2 +#undef CopyField + +static struct cpTag { + uint16 tag; + uint16 count; + TIFFDataType type; +} tags[] = { + { TIFFTAG_IMAGEWIDTH, 1, TIFF_LONG }, + { TIFFTAG_IMAGELENGTH, 1, TIFF_LONG }, + { TIFFTAG_BITSPERSAMPLE, 1, TIFF_SHORT }, + { TIFFTAG_COMPRESSION, 1, TIFF_SHORT }, + { TIFFTAG_FILLORDER, 1, TIFF_SHORT }, + { TIFFTAG_ROWSPERSTRIP, 1, TIFF_LONG }, + { TIFFTAG_GROUP3OPTIONS, 1, TIFF_LONG }, + { TIFFTAG_SUBFILETYPE, 1, TIFF_LONG }, + { TIFFTAG_THRESHHOLDING, 1, TIFF_SHORT }, + { TIFFTAG_DOCUMENTNAME, 1, TIFF_ASCII }, + { TIFFTAG_IMAGEDESCRIPTION, 1, TIFF_ASCII }, + { TIFFTAG_MAKE, 1, TIFF_ASCII }, + { TIFFTAG_MODEL, 1, TIFF_ASCII }, + { TIFFTAG_ORIENTATION, 1, TIFF_SHORT }, + { TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_PAGENAME, 1, TIFF_ASCII }, + { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG }, + { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT }, + { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT }, + { TIFFTAG_SOFTWARE, 1, TIFF_ASCII }, + { TIFFTAG_DATETIME, 1, TIFF_ASCII }, + { TIFFTAG_ARTIST, 1, TIFF_ASCII }, + { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII }, + { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL }, + { TIFFTAG_PRIMARYCHROMATICITIES, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, + { TIFFTAG_BADFAXLINES, 1, TIFF_LONG }, + { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT }, + { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG }, + { TIFFTAG_INKSET, 1, TIFF_SHORT }, + { TIFFTAG_INKNAMES, 1, TIFF_ASCII }, + { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, + { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, + { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, + { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT }, + { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT }, + { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL }, +}; +#define NTAGS (sizeof (tags) / sizeof (tags[0])) + +static void +cpTags(TIFF* in, TIFF* out) +{ + struct cpTag *p; + for (p = tags; p < &tags[NTAGS]; p++) + cpTag(in, out, p->tag, p->count, p->type); +} +#undef NTAGS + +char* stuff[] = { +"usage: pal2rgb [options] input.tif output.tif", +"where options are:", +" -p contig pack samples contiguously (e.g. RGBRGB...)", +" -p separate store samples separately (e.g. RRR...GGG...BBB...)", +" -r # make each strip have no more than # rows", +" -C 8 assume 8-bit colormap values (instead of 16-bit)", +" -C 16 assume 16-bit colormap values", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/ppm2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/ppm2tiff.c new file mode 100644 index 0000000..f78d5d4 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/ppm2tiff.c @@ -0,0 +1,366 @@ +/* $Id: ppm2tiff.c,v 1.16 2010-04-10 19:22:34 bfriesen Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +static uint16 compression = COMPRESSION_PACKBITS; +static uint16 predictor = 0; +static int quality = 75; /* JPEG quality */ +static int jpegcolormode = JPEGCOLORMODE_RGB; +static uint32 g3opts; + +static void usage(void); +static int processCompressOptions(char*); + +static void +BadPPM(char* file) +{ + fprintf(stderr, "%s: Not a PPM file.\n", file); + exit(-2); +} + +int +main(int argc, char* argv[]) +{ + uint16 photometric = 0; + uint32 rowsperstrip = (uint32) -1; + double resolution = -1; + unsigned char *buf = NULL; + tsize_t linebytes = 0; + uint16 spp = 1; + uint16 bpp = 8; + TIFF *out; + FILE *in; + unsigned int w, h, prec, row; + char *infile; + int c; + extern int optind; + extern char* optarg; + + if (argc < 2) { + fprintf(stderr, "%s: Too few arguments\n", argv[0]); + usage(); + } + while ((c = getopt(argc, argv, "c:r:R:")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case 'R': /* resolution */ + resolution = atof(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + + if (optind + 2 < argc) { + fprintf(stderr, "%s: Too many arguments\n", argv[0]); + usage(); + } + + /* + * If only one file is specified, read input from + * stdin; otherwise usage is: ppm2tiff input output. + */ + if (argc - optind > 1) { + infile = argv[optind++]; + in = fopen(infile, "rb"); + if (in == NULL) { + fprintf(stderr, "%s: Can not open.\n", infile); + return (-1); + } + } else { + infile = ""; + in = stdin; +#if defined(HAVE_SETMODE) && defined(O_BINARY) + setmode(fileno(stdin), O_BINARY); +#endif + } + + if (fgetc(in) != 'P') + BadPPM(infile); + switch (fgetc(in)) { + case '4': /* it's a PBM file */ + bpp = 1; + spp = 1; + photometric = PHOTOMETRIC_MINISWHITE; + break; + case '5': /* it's a PGM file */ + bpp = 8; + spp = 1; + photometric = PHOTOMETRIC_MINISBLACK; + break; + case '6': /* it's a PPM file */ + bpp = 8; + spp = 3; + photometric = PHOTOMETRIC_RGB; + if (compression == COMPRESSION_JPEG && + jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + break; + default: + BadPPM(infile); + } + + /* Parse header */ + while(1) { + if (feof(in)) + BadPPM(infile); + c = fgetc(in); + /* Skip whitespaces (blanks, TABs, CRs, LFs) */ + if (strchr(" \t\r\n", c)) + continue; + + /* Check for comment line */ + if (c == '#') { + do { + c = fgetc(in); + } while(!(strchr("\r\n", c) || feof(in))); + continue; + } + + ungetc(c, in); + break; + } + switch (bpp) { + case 1: + if (fscanf(in, " %u %u", &w, &h) != 2) + BadPPM(infile); + if (fgetc(in) != '\n') + BadPPM(infile); + break; + case 8: + if (fscanf(in, " %u %u %u", &w, &h, &prec) != 3) + BadPPM(infile); + if (fgetc(in) != '\n' || prec != 255) + BadPPM(infile); + break; + } + out = TIFFOpen(argv[optind], "w"); + if (out == NULL) + return (-4); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) w); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) h); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bpp); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_JPEG: + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + case COMPRESSION_CCITTFAX3: + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts); + break; + } + switch (bpp) { + case 1: + linebytes = (spp * w + (8 - 1)) / 8; + if (rowsperstrip == (uint32) -1) { + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, h); + } else { + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + } + break; + case 8: + linebytes = spp * w; + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + break; + } + if (TIFFScanlineSize(out) > linebytes) + buf = (unsigned char *)_TIFFmalloc(linebytes); + else + buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); + if (resolution > 0) { + TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution); + TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution); + TIFFSetField(out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); + } + for (row = 0; row < h; row++) { + if (fread(buf, linebytes, 1, in) != 1) { + fprintf(stderr, "%s: scanline %lu: Read error.\n", + infile, (unsigned long) row); + break; + } + if (TIFFWriteScanline(out, buf, row, 0) < 0) + break; + } + (void) TIFFClose(out); + if (buf) + _TIFFfree(buf); + return (0); +} + +static void +processG3Options(char* cp) +{ + g3opts = 0; + if( (cp = strchr(cp, ':')) ) { + do { + cp++; + if (strneq(cp, "1d", 2)) + g3opts &= ~GROUP3OPT_2DENCODING; + else if (strneq(cp, "2d", 2)) + g3opts |= GROUP3OPT_2DENCODING; + else if (strneq(cp, "fill", 4)) + g3opts |= GROUP3OPT_FILLBITS; + else + usage(); + } while( (cp = strchr(cp, ':')) ); + } +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while (cp) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "g3", 2)) { + processG3Options(opt); + compression = COMPRESSION_CCITTFAX3; + } else if (streq(opt, "g4")) { + compression = COMPRESSION_CCITTFAX4; + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +char* stuff[] = { +"usage: ppm2tiff [options] input.ppm output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +" -R # set x&y resolution (dpi)", +"", +" -c jpeg[:opts] compress output with JPEG encoding", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding (the default)", +" -c g3[:opts] compress output with CCITT Group 3 encoding", +" -c g4 compress output with CCITT Group 4 encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/ras2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/ras2tiff.c new file mode 100644 index 0000000..ec8a071 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/ras2tiff.c @@ -0,0 +1,316 @@ +/* $Id: ras2tiff.c,v 1.18 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "rasterfile.h" +#include "tiffio.h" + +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +static uint16 compression = (uint16) -1; +static int jpegcolormode = JPEGCOLORMODE_RGB; +static int quality = 75; /* JPEG quality */ +static uint16 predictor = 0; + +static void usage(void); +static int processCompressOptions(char*); + +int +main(int argc, char* argv[]) +{ + unsigned char* buf; + long row; + tsize_t linebytes, scanline; + TIFF *out; + FILE *in; + struct rasterfile h; + uint16 photometric; + uint16 config = PLANARCONFIG_CONTIG; + uint32 rowsperstrip = (uint32) -1; + int c; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "c:r:h")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case 'h': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 2) + usage(); + in = fopen(argv[optind], "rb"); + if (in == NULL) { + fprintf(stderr, "%s: Can not open.\n", argv[optind]); + return (-1); + } + if (fread(&h, sizeof (h), 1, in) != 1) { + fprintf(stderr, "%s: Can not read header.\n", argv[optind]); + fclose(in); + return (-2); + } + if (strcmp(h.ras_magic, RAS_MAGIC) == 0) { +#ifndef WORDS_BIGENDIAN + TIFFSwabLong((uint32 *)&h.ras_width); + TIFFSwabLong((uint32 *)&h.ras_height); + TIFFSwabLong((uint32 *)&h.ras_depth); + TIFFSwabLong((uint32 *)&h.ras_length); + TIFFSwabLong((uint32 *)&h.ras_type); + TIFFSwabLong((uint32 *)&h.ras_maptype); + TIFFSwabLong((uint32 *)&h.ras_maplength); +#endif + } else if (strcmp(h.ras_magic, RAS_MAGIC_INV) == 0) { +#ifdef WORDS_BIGENDIAN + TIFFSwabLong((uint32 *)&h.ras_width); + TIFFSwabLong((uint32 *)&h.ras_height); + TIFFSwabLong((uint32 *)&h.ras_depth); + TIFFSwabLong((uint32 *)&h.ras_length); + TIFFSwabLong((uint32 *)&h.ras_type); + TIFFSwabLong((uint32 *)&h.ras_maptype); + TIFFSwabLong((uint32 *)&h.ras_maplength); +#endif + } else { + fprintf(stderr, "%s: Not a rasterfile.\n", argv[optind]); + fclose(in); + return (-3); + } + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + { + fclose(in); + return (-4); + } + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) h.ras_width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) h.ras_height); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, h.ras_depth > 8 ? 3 : 1); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, h.ras_depth > 1 ? 8 : 1); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + if (h.ras_maptype != RMT_NONE) { + uint16* red; + register uint16* map; + register int i, j; + int mapsize; + + buf = (unsigned char *)_TIFFmalloc(h.ras_maplength); + if (buf == NULL) { + fprintf(stderr, "No space to read in colormap.\n"); + return (-5); + } + if (fread(buf, h.ras_maplength, 1, in) != 1) { + fprintf(stderr, "%s: Read error on colormap.\n", + argv[optind]); + return (-6); + } + mapsize = 1< mapsize*3) { + fprintf(stderr, + "%s: Huh, %ld colormap entries, should be %d?\n", + argv[optind], h.ras_maplength, mapsize*3); + return (-7); + } + red = (uint16*)_TIFFmalloc(mapsize * 3 * sizeof (uint16)); + if (red == NULL) { + fprintf(stderr, "No space for colormap.\n"); + return (-8); + } + map = red; + for (j = 0; j < 3; j++) { +#define SCALE(x) (((x)*((1L<<16)-1))/255) + for (i = h.ras_maplength/3; i-- > 0;) + *map++ = SCALE(*buf++); + if ((i = h.ras_maplength/3) < mapsize) { + i = mapsize - i; + _TIFFmemset(map, 0, i*sizeof (uint16)); + map += i; + } + } + TIFFSetField(out, TIFFTAG_COLORMAP, + red, red + mapsize, red + 2*mapsize); + photometric = PHOTOMETRIC_PALETTE; + if (compression == (uint16) -1) + compression = COMPRESSION_PACKBITS; + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + } else { + /* XXX this is bogus... */ + photometric = h.ras_depth == 24 ? + PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK; + if (compression == (uint16) -1) + compression = COMPRESSION_LZW; + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + } + switch (compression) { + case COMPRESSION_JPEG: + if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); + linebytes = ((h.ras_depth*h.ras_width+15) >> 3) &~ 1; + scanline = TIFFScanlineSize(out); + if (scanline > linebytes) { + buf = (unsigned char *)_TIFFmalloc(scanline); + _TIFFmemset(buf+linebytes, 0, scanline-linebytes); + } else + buf = (unsigned char *)_TIFFmalloc(linebytes); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + for (row = 0; row < h.ras_height; row++) { + if (fread(buf, linebytes, 1, in) != 1) { + fprintf(stderr, "%s: scanline %ld: Read error.\n", + argv[optind], row); + break; + } + if (h.ras_type == RT_STANDARD && h.ras_depth == 24) { + tsize_t cc = h.ras_width; + unsigned char* cp = buf; +#define SWAP(a,b) { unsigned char t = (a); (a) = (b); (b) = t; } + do { + SWAP(cp[0], cp[2]); + cp += 3; + } while (--cc); + } + if (TIFFWriteScanline(out, buf, row, 0) < 0) + break; + } + (void) TIFFClose(out); + fclose(in); + return (0); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +char* stuff[] = { +"usage: ras2tiff [options] input.ras output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c jpeg[:opts] compress output with JPEG encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +" -h this help message", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/rasterfile.h b/thirdparty/LibTIFF/tiff-4.0.3/tools/rasterfile.h new file mode 100644 index 0000000..833e095 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/rasterfile.h @@ -0,0 +1,42 @@ +/* $Header: /cvs/libtiff/tools/rasterfile.h,v 1.3 2003/11/12 19:14:33 dron Exp $ */ + +/* + * Description of header for files containing raster images + */ +struct rasterfile { + char ras_magic[4]; /* magic number */ + long ras_width; /* width (pixels) of image */ + long ras_height; /* height (pixels) of image */ + long ras_depth; /* depth (1, 8, or 24 bits) of pixel */ + long ras_length; /* length (bytes) of image */ + long ras_type; /* type of file; see RT_* below */ + long ras_maptype; /* type of colormap; see RMT_* below */ + long ras_maplength; /* length (bytes) of following map */ + /* color map follows for ras_maplength bytes, followed by image */ +}; +#define RAS_MAGIC "\x59\xa6\x6a\x95" +#define RAS_MAGIC_INV "\x95\x6a\xa6\x59" + + /* Sun supported ras_type's */ +#define RT_OLD 0 /* Raw pixrect image in 68000 byte order */ +#define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */ +#define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */ +#define RT_EXPERIMENTAL 0xffff /* Reserved for testing */ + + /* Sun registered ras_maptype's */ +#define RMT_RAW 2 + /* Sun supported ras_maptype's */ +#define RMT_NONE 0 /* ras_maplength is expected to be 0 */ +#define RMT_EQUAL_RGB 1 /* red[ras_maplength/3],green[],blue[] */ + +/* + * NOTES: + * Each line of the image is rounded out to a multiple of 16 bits. + * This corresponds to the rounding convention used by the memory pixrect + * package (/usr/include/pixrect/memvar.h) of the SunWindows system. + * The ras_encoding field (always set to 0 by Sun's supported software) + * was renamed to ras_length in release 2.0. As a result, rasterfiles + * of type 0 generated by the old software claim to have 0 length; for + * compatibility, code reading rasterfiles must be prepared to compute the + * true length from the width, height, and depth fields. + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/raw2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/raw2tiff.c new file mode 100644 index 0000000..9ab980e --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/raw2tiff.c @@ -0,0 +1,651 @@ +/* $Id: raw2tiff.c,v 1.25 2010-03-10 18:56:49 bfriesen Exp $ + * + * Project: libtiff tools + * Purpose: Convert raw byte sequences in TIFF images + * Author: Andrey Kiselev, dron@ak4719.spb.edu + * + ****************************************************************************** + * Copyright (c) 2002, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#if HAVE_FCNTL_H +# include +#endif + +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +typedef enum { + PIXEL, + BAND +} InterleavingType; + +static uint16 compression = (uint16) -1; +static int jpegcolormode = JPEGCOLORMODE_RGB; +static int quality = 75; /* JPEG quality */ +static uint16 predictor = 0; + +static void swapBytesInScanline(void *, uint32, TIFFDataType); +static int guessSize(int, TIFFDataType, off_t, uint32, int, + uint32 *, uint32 *); +static double correlation(void *, void *, uint32, TIFFDataType); +static void usage(void); +static int processCompressOptions(char*); + +int +main(int argc, char* argv[]) +{ + uint32 width = 0, length = 0, linebytes, bufsize; + uint32 nbands = 1; /* number of bands in input image*/ + off_t hdr_size = 0; /* size of the header to skip */ + TIFFDataType dtype = TIFF_BYTE; + int16 depth = 1; /* bytes per pixel in input image */ + int swab = 0; /* byte swapping flag */ + InterleavingType interleaving = 0; /* interleaving type flag */ + uint32 rowsperstrip = (uint32) -1; + uint16 photometric = PHOTOMETRIC_MINISBLACK; + uint16 config = PLANARCONFIG_CONTIG; + uint16 fillorder = FILLORDER_LSB2MSB; + int fd; + char *outfilename = NULL; + TIFF *out; + + uint32 row, col, band; + int c; + unsigned char *buf = NULL, *buf1 = NULL; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "c:r:H:w:l:b:d:LMp:si:o:h")) != -1) { + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case 'H': /* size of input image file header */ + hdr_size = atoi(optarg); + break; + case 'w': /* input image width */ + width = atoi(optarg); + break; + case 'l': /* input image length */ + length = atoi(optarg); + break; + case 'b': /* number of bands in input image */ + nbands = atoi(optarg); + break; + case 'd': /* type of samples in input image */ + if (strncmp(optarg, "byte", 4) == 0) + dtype = TIFF_BYTE; + else if (strncmp(optarg, "short", 5) == 0) + dtype = TIFF_SHORT; + else if (strncmp(optarg, "long", 4) == 0) + dtype = TIFF_LONG; + else if (strncmp(optarg, "sbyte", 5) == 0) + dtype = TIFF_SBYTE; + else if (strncmp(optarg, "sshort", 6) == 0) + dtype = TIFF_SSHORT; + else if (strncmp(optarg, "slong", 5) == 0) + dtype = TIFF_SLONG; + else if (strncmp(optarg, "float", 5) == 0) + dtype = TIFF_FLOAT; + else if (strncmp(optarg, "double", 6) == 0) + dtype = TIFF_DOUBLE; + else + dtype = TIFF_BYTE; + depth = TIFFDataWidth(dtype); + break; + case 'L': /* input has lsb-to-msb fillorder */ + fillorder = FILLORDER_LSB2MSB; + break; + case 'M': /* input has msb-to-lsb fillorder */ + fillorder = FILLORDER_MSB2LSB; + break; + case 'p': /* photometric interpretation */ + if (strncmp(optarg, "miniswhite", 10) == 0) + photometric = PHOTOMETRIC_MINISWHITE; + else if (strncmp(optarg, "minisblack", 10) == 0) + photometric = PHOTOMETRIC_MINISBLACK; + else if (strncmp(optarg, "rgb", 3) == 0) + photometric = PHOTOMETRIC_RGB; + else if (strncmp(optarg, "cmyk", 4) == 0) + photometric = PHOTOMETRIC_SEPARATED; + else if (strncmp(optarg, "ycbcr", 5) == 0) + photometric = PHOTOMETRIC_YCBCR; + else if (strncmp(optarg, "cielab", 6) == 0) + photometric = PHOTOMETRIC_CIELAB; + else if (strncmp(optarg, "icclab", 6) == 0) + photometric = PHOTOMETRIC_ICCLAB; + else if (strncmp(optarg, "itulab", 6) == 0) + photometric = PHOTOMETRIC_ITULAB; + else + photometric = PHOTOMETRIC_MINISBLACK; + break; + case 's': /* do we need to swap bytes? */ + swab = 1; + break; + case 'i': /* type of interleaving */ + if (strncmp(optarg, "pixel", 4) == 0) + interleaving = PIXEL; + else if (strncmp(optarg, "band", 6) == 0) + interleaving = BAND; + else + interleaving = 0; + break; + case 'o': + outfilename = optarg; + break; + case 'h': + usage(); + default: + break; + } + } + + if (argc - optind < 2) + usage(); + + fd = open(argv[optind], O_RDONLY|O_BINARY, 0); + if (fd < 0) { + fprintf(stderr, "%s: %s: Cannot open input file.\n", + argv[0], argv[optind]); + return (-1); + } + + if (guessSize(fd, dtype, hdr_size, nbands, swab, &width, &length) < 0) + return 1; + + if (outfilename == NULL) + outfilename = argv[optind+1]; + out = TIFFOpen(outfilename, "w"); + if (out == NULL) { + fprintf(stderr, "%s: %s: Cannot open file for output.\n", + argv[0], outfilename); + return (-1); + } + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, length); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, nbands); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, depth * 8); + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); + switch (dtype) { + case TIFF_BYTE: + case TIFF_SHORT: + case TIFF_LONG: + TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); + break; + case TIFF_SBYTE: + case TIFF_SSHORT: + case TIFF_SLONG: + TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); + break; + case TIFF_FLOAT: + case TIFF_DOUBLE: + TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); + break; + default: + TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_VOID); + break; + } + if (compression == (uint16) -1) + compression = COMPRESSION_PACKBITS; + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_JPEG: + if (photometric == PHOTOMETRIC_RGB + && jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + switch(interleaving) { + case BAND: /* band interleaved data */ + linebytes = width * depth; + buf = (unsigned char *)_TIFFmalloc(linebytes); + break; + case PIXEL: /* pixel interleaved data */ + default: + linebytes = width * nbands * depth; + break; + } + bufsize = width * nbands * depth; + buf1 = (unsigned char *)_TIFFmalloc(bufsize); + + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + if (rowsperstrip > length) { + rowsperstrip = length; + } + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip ); + + lseek(fd, hdr_size, SEEK_SET); /* Skip the file header */ + for (row = 0; row < length; row++) { + switch(interleaving) { + case BAND: /* band interleaved data */ + for (band = 0; band < nbands; band++) { + lseek(fd, + hdr_size + (length*band+row)*linebytes, + SEEK_SET); + if (read(fd, buf, linebytes) < 0) { + fprintf(stderr, + "%s: %s: scanline %lu: Read error.\n", + argv[0], argv[optind], + (unsigned long) row); + break; + } + if (swab) /* Swap bytes if needed */ + swapBytesInScanline(buf, width, dtype); + for (col = 0; col < width; col++) + memcpy(buf1 + (col*nbands+band)*depth, + buf + col * depth, depth); + } + break; + case PIXEL: /* pixel interleaved data */ + default: + if (read(fd, buf1, bufsize) < 0) { + fprintf(stderr, + "%s: %s: scanline %lu: Read error.\n", + argv[0], argv[optind], + (unsigned long) row); + break; + } + if (swab) /* Swap bytes if needed */ + swapBytesInScanline(buf1, width, dtype); + break; + } + + if (TIFFWriteScanline(out, buf1, row, 0) < 0) { + fprintf(stderr, "%s: %s: scanline %lu: Write error.\n", + argv[0], outfilename, (unsigned long) row); + break; + } + } + if (buf) + _TIFFfree(buf); + if (buf1) + _TIFFfree(buf1); + TIFFClose(out); + return (0); +} + +static void +swapBytesInScanline(void *buf, uint32 width, TIFFDataType dtype) +{ + switch (dtype) { + case TIFF_SHORT: + case TIFF_SSHORT: + TIFFSwabArrayOfShort((uint16*)buf, + (unsigned long)width); + break; + case TIFF_LONG: + case TIFF_SLONG: + TIFFSwabArrayOfLong((uint32*)buf, + (unsigned long)width); + break; + /* case TIFF_FLOAT: */ /* FIXME */ + case TIFF_DOUBLE: + TIFFSwabArrayOfDouble((double*)buf, + (unsigned long)width); + break; + default: + break; + } +} + +static int +guessSize(int fd, TIFFDataType dtype, off_t hdr_size, uint32 nbands, + int swab, uint32 *width, uint32 *length) +{ + const float longt = 40.0; /* maximum possible height/width ratio */ + char *buf1, *buf2; + struct stat filestat; + uint32 w, h, scanlinesize, imagesize; + uint32 depth = TIFFDataWidth(dtype); + float cor_coef = 0, tmp; + + fstat(fd, &filestat); + + if (filestat.st_size < hdr_size) { + fprintf(stderr, "Too large header size specified.\n"); + return -1; + } + + imagesize = (filestat.st_size - hdr_size) / nbands / depth; + + if (*width != 0 && *length == 0) { + fprintf(stderr, "Image height is not specified.\n"); + + *length = imagesize / *width; + + fprintf(stderr, "Height is guessed as %lu.\n", + (unsigned long)*length); + + return 1; + } else if (*width == 0 && *length != 0) { + fprintf(stderr, "Image width is not specified.\n"); + + *width = imagesize / *length; + + fprintf(stderr, "Width is guessed as %lu.\n", + (unsigned long)*width); + + return 1; + } else if (*width == 0 && *length == 0) { + fprintf(stderr, "Image width and height are not specified.\n"); + + for (w = (uint32) sqrt(imagesize / longt); + w < sqrt(imagesize * longt); + w++) { + if (imagesize % w == 0) { + scanlinesize = w * depth; + buf1 = _TIFFmalloc(scanlinesize); + buf2 = _TIFFmalloc(scanlinesize); + h = imagesize / w; + lseek(fd, hdr_size + (int)(h/2)*scanlinesize, + SEEK_SET); + read(fd, buf1, scanlinesize); + read(fd, buf2, scanlinesize); + if (swab) { + swapBytesInScanline(buf1, w, dtype); + swapBytesInScanline(buf2, w, dtype); + } + tmp = (float) fabs(correlation(buf1, buf2, + w, dtype)); + if (tmp > cor_coef) { + cor_coef = tmp; + *width = w, *length = h; + } + + _TIFFfree(buf1); + _TIFFfree(buf2); + } + } + + fprintf(stderr, + "Width is guessed as %lu, height is guessed as %lu.\n", + (unsigned long)*width, (unsigned long)*length); + + return 1; + } else { + if (filestat.st_size<(off_t)(hdr_size+(*width)*(*length)*nbands*depth)) { + fprintf(stderr, "Input file too small.\n"); + return -1; + } + } + + return 1; +} + +/* Calculate correlation coefficient between two numeric vectors */ +static double +correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype) +{ + double X, Y, M1 = 0.0, M2 = 0.0, D1 = 0.0, D2 = 0.0, K = 0.0; + uint32 i; + + switch (dtype) { + case TIFF_BYTE: + default: + for (i = 0; i < n_elem; i++) { + X = ((unsigned char *)buf1)[i]; + Y = ((unsigned char *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_SBYTE: + for (i = 0; i < n_elem; i++) { + X = ((signed char *)buf1)[i]; + Y = ((signed char *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_SHORT: + for (i = 0; i < n_elem; i++) { + X = ((uint16 *)buf1)[i]; + Y = ((uint16 *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_SSHORT: + for (i = 0; i < n_elem; i++) { + X = ((int16 *)buf1)[i]; + Y = ((int16 *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_LONG: + for (i = 0; i < n_elem; i++) { + X = ((uint32 *)buf1)[i]; + Y = ((uint32 *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_SLONG: + for (i = 0; i < n_elem; i++) { + X = ((int32 *)buf1)[i]; + Y = ((int32 *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_FLOAT: + for (i = 0; i < n_elem; i++) { + X = ((float *)buf1)[i]; + Y = ((float *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + case TIFF_DOUBLE: + for (i = 0; i < n_elem; i++) { + X = ((double *)buf1)[i]; + Y = ((double *)buf2)[i]; + M1 += X, M2 += Y; + D1 += X * X, D2 += Y * Y; + K += X * Y; + } + break; + } + + M1 /= n_elem; + M2 /= n_elem; + D1 -= M1 * M1 * n_elem; + D2 -= M2 * M2 * n_elem; + K = (K - M1 * M2 * n_elem) / sqrt(D1 * D2); + + return K; +} + +static int +processCompressOptions(char* opt) +{ + if (strcmp(opt, "none") == 0) + compression = COMPRESSION_NONE; + else if (strcmp(opt, "packbits") == 0) + compression = COMPRESSION_PACKBITS; + else if (strncmp(opt, "jpeg", 4) == 0) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strncmp(opt, "lzw", 3) == 0) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strncmp(opt, "zip", 3) == 0) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +static char* stuff[] = { +"raw2tiff --- tool for converting raw byte sequences in TIFF images", +"usage: raw2tiff [options] input.raw output.tif", +"where options are:", +" -L input data has LSB2MSB bit order (default)", +" -M input data has MSB2LSB bit order", +" -r # make each strip have no more than # rows", +" -H # size of input image file header in bytes (0 by default)", +" -w # width of input image in pixels", +" -l # length of input image in lines", +" -b # number of bands in input image (1 by default)", +"", +" -d data_type type of samples in input image", +"where data_type may be:", +" byte 8-bit unsigned integer (default)", +" short 16-bit unsigned integer", +" long 32-bit unsigned integer", +" sbyte 8-bit signed integer", +" sshort 16-bit signed integer", +" slong 32-bit signed integer", +" float 32-bit IEEE floating point", +" double 64-bit IEEE floating point", +"", +" -p photo photometric interpretation (color space) of the input image", +"where photo may be:", +" miniswhite white color represented with 0 value", +" minisblack black color represented with 0 value (default)", +" rgb image has RGB color model", +" cmyk image has CMYK (separated) color model", +" ycbcr image has YCbCr color model", +" cielab image has CIE L*a*b color model", +" icclab image has ICC L*a*b color model", +" itulab image has ITU L*a*b color model", +"", +" -s swap bytes fetched from input file", +"", +" -i config type of samples interleaving in input image", +"where config may be:", +" pixel pixel interleaved data (default)", +" band band interleaved data", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c jpeg[:opts] compress output with JPEG encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +" -o out.tif write output to out.tif", +" -h this help message", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/rgb2ycbcr.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/rgb2ycbcr.c new file mode 100644 index 0000000..162aac1 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/rgb2ycbcr.c @@ -0,0 +1,390 @@ +/* $Id: rgb2ycbcr.c,v 1.14 2011-05-31 17:03:16 bfriesen Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffiop.h" +#include "tiffio.h" + +#define streq(a,b) (strcmp(a,b) == 0) +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) + +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define roundup(x, y) (howmany(x,y)*((uint32)(y))) + +#define LumaRed ycbcrCoeffs[0] +#define LumaGreen ycbcrCoeffs[1] +#define LumaBlue ycbcrCoeffs[2] + +uint16 compression = COMPRESSION_PACKBITS; +uint32 rowsperstrip = (uint32) -1; + +uint16 horizSubSampling = 2; /* YCbCr horizontal subsampling */ +uint16 vertSubSampling = 2; /* YCbCr vertical subsampling */ +float ycbcrCoeffs[3] = { .299F, .587F, .114F }; +/* default coding range is CCIR Rec 601-1 with no headroom/footroom */ +float refBlackWhite[6] = { 0.F, 255.F, 128.F, 255.F, 128.F, 255.F }; + +static int tiffcvt(TIFF* in, TIFF* out); +static void usage(int code); +static void setupLumaTables(void); + +int +main(int argc, char* argv[]) +{ + TIFF *in, *out; + int c; + extern int optind; + extern char *optarg; + + while ((c = getopt(argc, argv, "c:h:r:v:z")) != -1) + switch (c) { + case 'c': + if (streq(optarg, "none")) + compression = COMPRESSION_NONE; + else if (streq(optarg, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (streq(optarg, "lzw")) + compression = COMPRESSION_LZW; + else if (streq(optarg, "jpeg")) + compression = COMPRESSION_JPEG; + else if (streq(optarg, "zip")) + compression = COMPRESSION_ADOBE_DEFLATE; + else + usage(-1); + break; + case 'h': + horizSubSampling = atoi(optarg); + break; + case 'v': + vertSubSampling = atoi(optarg); + break; + case 'r': + rowsperstrip = atoi(optarg); + break; + case 'z': /* CCIR Rec 601-1 w/ headroom/footroom */ + refBlackWhite[0] = 16.; + refBlackWhite[1] = 235.; + refBlackWhite[2] = 128.; + refBlackWhite[3] = 240.; + refBlackWhite[4] = 128.; + refBlackWhite[5] = 240.; + break; + case '?': + usage(0); + /*NOTREACHED*/ + } + if (argc - optind < 2) + usage(-1); + out = TIFFOpen(argv[argc-1], "w"); + if (out == NULL) + return (-2); + setupLumaTables(); + for (; optind < argc-1; optind++) { + in = TIFFOpen(argv[optind], "r"); + if (in != NULL) { + do { + if (!tiffcvt(in, out) || + !TIFFWriteDirectory(out)) { + (void) TIFFClose(out); + return (1); + } + } while (TIFFReadDirectory(in)); + (void) TIFFClose(in); + } + } + (void) TIFFClose(out); + return (0); +} + +float *lumaRed; +float *lumaGreen; +float *lumaBlue; +float D1, D2; +int Yzero; + +static float* +setupLuma(float c) +{ + float *v = (float *)_TIFFmalloc(256 * sizeof (float)); + int i; + for (i = 0; i < 256; i++) + v[i] = c * i; + return (v); +} + +static unsigned +V2Code(float f, float RB, float RW, int CR) +{ + unsigned int c = (unsigned int)((((f)*(RW-RB)/CR)+RB)+.5); + return (c > 255 ? 255 : c); +} + +static void +setupLumaTables(void) +{ + lumaRed = setupLuma(LumaRed); + lumaGreen = setupLuma(LumaGreen); + lumaBlue = setupLuma(LumaBlue); + D1 = 1.F/(2.F - 2.F*LumaBlue); + D2 = 1.F/(2.F - 2.F*LumaRed); + Yzero = V2Code(0, refBlackWhite[0], refBlackWhite[1], 255); +} + +static void +cvtClump(unsigned char* op, uint32* raster, uint32 ch, uint32 cw, uint32 w) +{ + float Y, Cb = 0, Cr = 0; + uint32 j, k; + /* + * Convert ch-by-cw block of RGB + * to YCbCr and sample accordingly. + */ + for (k = 0; k < ch; k++) { + for (j = 0; j < cw; j++) { + uint32 RGB = (raster - k*w)[j]; + Y = lumaRed[TIFFGetR(RGB)] + + lumaGreen[TIFFGetG(RGB)] + + lumaBlue[TIFFGetB(RGB)]; + /* accumulate chrominance */ + Cb += (TIFFGetB(RGB) - Y) * D1; + Cr += (TIFFGetR(RGB) - Y) * D2; + /* emit luminence */ + *op++ = V2Code(Y, + refBlackWhite[0], refBlackWhite[1], 255); + } + for (; j < horizSubSampling; j++) + *op++ = Yzero; + } + for (; k < vertSubSampling; k++) { + for (j = 0; j < horizSubSampling; j++) + *op++ = Yzero; + } + /* emit sampled chrominance values */ + *op++ = V2Code(Cb / (ch*cw), refBlackWhite[2], refBlackWhite[3], 127); + *op++ = V2Code(Cr / (ch*cw), refBlackWhite[4], refBlackWhite[5], 127); +} +#undef LumaRed +#undef LumaGreen +#undef LumaBlue +#undef V2Code + +/* + * Convert a strip of RGB data to YCbCr and + * sample to generate the output data. + */ +static void +cvtStrip(unsigned char* op, uint32* raster, uint32 nrows, uint32 width) +{ + uint32 x; + int clumpSize = vertSubSampling * horizSubSampling + 2; + uint32 *tp; + + for (; nrows >= vertSubSampling; nrows -= vertSubSampling) { + tp = raster; + for (x = width; x >= horizSubSampling; x -= horizSubSampling) { + cvtClump(op, tp, + vertSubSampling, horizSubSampling, width); + op += clumpSize; + tp += horizSubSampling; + } + if (x > 0) { + cvtClump(op, tp, vertSubSampling, x, width); + op += clumpSize; + } + raster -= vertSubSampling*width; + } + if (nrows > 0) { + tp = raster; + for (x = width; x >= horizSubSampling; x -= horizSubSampling) { + cvtClump(op, tp, nrows, horizSubSampling, width); + op += clumpSize; + tp += horizSubSampling; + } + if (x > 0) + cvtClump(op, tp, nrows, x, width); + } +} + +static int +cvtRaster(TIFF* tif, uint32* raster, uint32 width, uint32 height) +{ + uint32 y; + tstrip_t strip = 0; + tsize_t cc, acc; + unsigned char* buf; + uint32 rwidth = roundup(width, horizSubSampling); + uint32 rheight = roundup(height, vertSubSampling); + uint32 nrows = (rowsperstrip > rheight ? rheight : rowsperstrip); + uint32 rnrows = roundup(nrows,vertSubSampling); + + cc = rnrows*rwidth + + 2*((rnrows*rwidth) / (horizSubSampling*vertSubSampling)); + buf = (unsigned char*)_TIFFmalloc(cc); + // FIXME unchecked malloc + for (y = height; (int32) y > 0; y -= nrows) { + uint32 nr = (y > nrows ? nrows : y); + cvtStrip(buf, raster + (y-1)*width, nr, width); + nr = roundup(nr, vertSubSampling); + acc = nr*rwidth + + 2*((nr*rwidth)/(horizSubSampling*vertSubSampling)); + if (!TIFFWriteEncodedStrip(tif, strip++, buf, acc)) { + _TIFFfree(buf); + return (0); + } + } + _TIFFfree(buf); + return (1); +} + +static int +tiffcvt(TIFF* in, TIFF* out) +{ + uint32 width, height; /* image width & height */ + uint32* raster; /* retrieve RGBA image */ + uint16 shortv; + float floatv; + char *stringv; + uint32 longv; + int result; + size_t pixel_count; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); + pixel_count = width * height; + + /* XXX: Check the integer overflow. */ + if (!width || !height || pixel_count / width != height) { + TIFFError(TIFFFileName(in), + "Malformed input file; " + "can't allocate buffer for raster of %lux%lu size", + (unsigned long)width, (unsigned long)height); + return 0; + } + + raster = (uint32*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32), + "raster buffer"); + if (raster == 0) { + TIFFError(TIFFFileName(in), + "Failed to allocate buffer (%lu elements of %lu each)", + (unsigned long)pixel_count, + (unsigned long)sizeof(uint32)); + return (0); + } + + if (!TIFFReadRGBAImage(in, width, height, raster, 0)) { + _TIFFfree(raster); + return (0); + } + + CopyField(TIFFTAG_SUBFILETYPE, longv); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, height); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + if (compression == COMPRESSION_JPEG) + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW); + CopyField(TIFFTAG_FILLORDER, shortv); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3); + CopyField(TIFFTAG_XRESOLUTION, floatv); + CopyField(TIFFTAG_YRESOLUTION, floatv); + CopyField(TIFFTAG_RESOLUTIONUNIT, shortv); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + { char buf[2048]; + char *cp = strrchr(TIFFFileName(in), '/'); + sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in)); + TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf); + } + TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion()); + CopyField(TIFFTAG_DOCUMENTNAME, stringv); + + TIFFSetField(out, TIFFTAG_REFERENCEBLACKWHITE, refBlackWhite); + TIFFSetField(out, TIFFTAG_YCBCRSUBSAMPLING, + horizSubSampling, vertSubSampling); + TIFFSetField(out, TIFFTAG_YCBCRPOSITIONING, YCBCRPOSITION_CENTERED); + TIFFSetField(out, TIFFTAG_YCBCRCOEFFICIENTS, ycbcrCoeffs); + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + result = cvtRaster(out, raster, width, height); + _TIFFfree(raster); + return result; +} + +char* stuff[] = { + "usage: rgb2ycbcr [-c comp] [-r rows] [-h N] [-v N] input... output\n", + "where comp is one of the following compression algorithms:\n", + " jpeg\t\tJPEG encoding\n", + " lzw\t\tLempel-Ziv & Welch encoding\n", + " zip\t\tdeflate encoding\n", + " packbits\tPackBits encoding (default)\n", + " none\t\tno compression\n", + "and the other options are:\n", + " -r\trows/strip\n", + " -h\thorizontal sampling factor (1,2,4)\n", + " -v\tvertical sampling factor (1,2,4)\n", + NULL +}; + +static void +usage(int code) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(code); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/sgi2tiff.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/sgi2tiff.c new file mode 100644 index 0000000..227e621 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/sgi2tiff.c @@ -0,0 +1,335 @@ +/* $Id: sgi2tiff.c,v 1.6 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include + +#include "tiffio.h" + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +static short config = PLANARCONFIG_CONTIG; +static uint16 compression = COMPRESSION_PACKBITS; +static uint16 predictor = 0; +static uint16 fillorder = 0; +static uint32 rowsperstrip = (uint32) -1; +static int jpegcolormode = JPEGCOLORMODE_RGB; +static int quality = 75; /* JPEG quality */ +static uint16 photometric; + +static void usage(void); +static int cpContig(IMAGE*, TIFF*); +static int cpSeparate(IMAGE*, TIFF*); +static int processCompressOptions(char*); + +/* XXX image library has no prototypes */ +extern IMAGE* iopen(const char*, const char*); +extern void iclose(IMAGE*); +extern void getrow(IMAGE*, short*, int, int); + +int +main(int argc, char* argv[]) +{ + IMAGE *in; + TIFF *out; + int c; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "c:p:r:")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'f': /* fill order */ + if (streq(optarg, "lsb2msb")) + fillorder = FILLORDER_LSB2MSB; + else if (streq(optarg, "msb2lsb")) + fillorder = FILLORDER_MSB2LSB; + else + usage(); + break; + case 'p': /* planar configuration */ + if (streq(optarg, "separate")) + config = PLANARCONFIG_SEPARATE; + else if (streq(optarg, "contig")) + config = PLANARCONFIG_CONTIG; + else + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 2) + usage(); + in = iopen(argv[optind], "r"); + if (in == NULL) + return (-1); + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return (-2); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) in->xsize); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) in->ysize); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + if (in->zsize == 1) + photometric = PHOTOMETRIC_MINISBLACK; + else + photometric = PHOTOMETRIC_RGB; + switch (compression) { + case COMPRESSION_JPEG: + if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, photometric); + if (fillorder != 0) + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, in->zsize); + if (in->zsize > 3) { + uint16 v[1]; + v[0] = EXTRASAMPLE_UNASSALPHA; + TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v); + } + TIFFSetField(out, TIFFTAG_MINSAMPLEVALUE, (uint16) in->min); + TIFFSetField(out, TIFFTAG_MAXSAMPLEVALUE, (uint16) in->max); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + if (config != PLANARCONFIG_SEPARATE) + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + else /* force 1 row/strip for library limitation */ + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, 1L); + if (in->name[0] != '\0') + TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, in->name); + if (config == PLANARCONFIG_CONTIG) + cpContig(in, out); + else + cpSeparate(in, out); + (void) iclose(in); + (void) TIFFClose(out); + return (0); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + defcompression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +static int +cpContig(IMAGE* in, TIFF* out) +{ + tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out)); + short *r = NULL; + int x, y; + + if (in->zsize == 3) { + short *g, *b; + + r = (short *)_TIFFmalloc(3 * in->xsize * sizeof (short)); + g = r + in->xsize; + b = g + in->xsize; + for (y = in->ysize-1; y >= 0; y--) { + uint8* pp = (uint8*) buf; + + getrow(in, r, y, 0); + getrow(in, g, y, 1); + getrow(in, b, y, 2); + for (x = 0; x < in->xsize; x++) { + pp[0] = r[x]; + pp[1] = g[x]; + pp[2] = b[x]; + pp += 3; + } + if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0) + goto bad; + } + } else if (in->zsize == 4) { + short *g, *b, *a; + + r = (short *)_TIFFmalloc(4 * in->xsize * sizeof (short)); + g = r + in->xsize; + b = g + in->xsize; + a = b + in->xsize; + for (y = in->ysize-1; y >= 0; y--) { + uint8* pp = (uint8*) buf; + + getrow(in, r, y, 0); + getrow(in, g, y, 1); + getrow(in, b, y, 2); + getrow(in, a, y, 3); + for (x = 0; x < in->xsize; x++) { + pp[0] = r[x]; + pp[1] = g[x]; + pp[2] = b[x]; + pp[3] = a[x]; + pp += 4; + } + if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0) + goto bad; + } + } else { + uint8* pp = (uint8*) buf; + + r = (short *)_TIFFmalloc(in->xsize * sizeof (short)); + for (y = in->ysize-1; y >= 0; y--) { + getrow(in, r, y, 0); + for (x = in->xsize-1; x >= 0; x--) + pp[x] = r[x]; + if (TIFFWriteScanline(out, buf, in->ysize-y-1, 0) < 0) + goto bad; + } + } + if (r) + _TIFFfree(r); + _TIFFfree(buf); + return (1); +bad: + if (r) + _TIFFfree(r); + _TIFFfree(buf); + return (0); +} + +static int +cpSeparate(IMAGE* in, TIFF* out) +{ + tdata_t buf = _TIFFmalloc(TIFFScanlineSize(out)); + short *r = (short *)_TIFFmalloc(in->xsize * sizeof (short)); + uint8* pp = (uint8*) buf; + int x, y, z; + + for (z = 0; z < in->zsize; z++) { + for (y = in->ysize-1; y >= 0; y--) { + getrow(in, r, y, z); + for (x = 0; x < in->xsize; x++) + pp[x] = r[x]; + if (TIFFWriteScanline(out, buf, in->ysize-y-1, z) < 0) + goto bad; + } + } + _TIFFfree(r); + _TIFFfree(buf); + return (1); +bad: + _TIFFfree(r); + _TIFFfree(buf); + return (0); +} + +char* stuff[] = { +"usage: sgi2tiff [options] input.rgb output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +"", +" -p contig pack samples contiguously (e.g. RGBRGB...)", +" -p separate store samples separately (e.g. RRR...GGG...BBB...)", +"", +" -f lsb2msb force lsb-to-msb FillOrder for output", +" -f msb2lsb force msb-to-lsb FillOrder for output", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c jpeg[:opts]compress output with JPEG encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/sgisv.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/sgisv.c new file mode 100644 index 0000000..e0d91e0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/sgisv.c @@ -0,0 +1,316 @@ +/* $Id: sgisv.c,v 1.6 2010-03-10 18:56:49 bfriesen Exp $ */ + +/* + * Copyright (c) 1990-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include +#include + +#include "tiffio.h" + +typedef unsigned char unsigned char; +typedef unsigned long uint32; + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +uint32 rowsperstrip = (uint32) -1; +uint16 compression = COMPRESSION_PACKBITS; +uint16 config = PLANARCONFIG_CONTIG; +uint16 predictor = 0; +int xmaxscreen; +int ymaxscreen; +uint16 photometric = PHOTOMETRIC_RGB; +int jpegcolormode = JPEGCOLORMODE_RGB; +int quality = 75; /* JPEG quality */ + +static void usage(void); +static void tiffsv(char*, int, int, int, int); + +int +main(int argc, char* argv[]) +{ + int c; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "c:p:r:")) != -1) + switch (c) { + case 'b': /* save as b&w */ + photometric = PHOTOMETRIC_MINISBLACK; + break; + case 'c': /* compression scheme */ + if (streq(optarg, "none")) + compression = COMPRESSION_NONE; + else if (streq(optarg, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(optarg, "jpeg", 4)) { + char* cp = strchr(optarg, ':'); + if (cp && isdigit(cp[1])) + quality = atoi(cp+1); + if (cp && strchr(cp, 'r')) + jpegcolormode = JPEGCOLORMODE_RAW; + compression = COMPRESSION_JPEG; + } else if (strneq(optarg, "lzw", 3)) { + char* cp = strchr(optarg, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else + usage(); + break; + case 'p': /* planar configuration */ + if (streq(optarg, "separate")) + config = PLANARCONFIG_SEPARATE; + else if (streq(optarg, "contig")) + config = PLANARCONFIG_CONTIG; + else + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 1 && argc - optind != 5) + usage(); + xmaxscreen = getgdesc(GD_XPMAX)-1; + ymaxscreen = getgdesc(GD_YPMAX)-1; + foreground(); + noport(); + winopen("tiffsv"); + if (argc - optind == 5) + tiffsv(argv[optind], + atoi(argv[optind+1]), atoi(argv[optind+2]), + atoi(argv[optind+3]), atoi(argv[optind+4])); + else + tiffsv(argv[optind], 0, xmaxscreen, 0, ymaxscreen); + return (0); +} + +char* stuff[] = { +"usage: tiffsv [options] outimage.tif [x1 x2 y1 y2] [-b]", +"where options are:", +" -p contig pack samples contiguously (e.g. RGBRGB...)", +" -p separate store samples separately (e.g. RRR...GGG...BBB...)", +"", +" -r # make each strip have no more than # rows", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c jpeg[:opts]compress output with JPEG encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"", +"LZW options:", +" # set predictor value for Lempel-Ziv & Welch encoding", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +static void +svRGBSeparate(TIFF* tif, uint32* ss, int xsize, int ysize) +{ + tsize_t stripsize = TIFFStripSize(tif); + unsigned char *rbuf = (unsigned char *)_TIFFmalloc(3*stripsize); + unsigned char *gbuf = rbuf + stripsize; + unsigned char *bbuf = gbuf + stripsize; + register int y; + + for (y = 0; y <= ysize; y += rowsperstrip) { + unsigned char *rp, *gp, *bp; + register int x; + register uint32 n; + + n = rowsperstrip; + if (n > ysize-y+1) + n = ysize-y+1; + rp = rbuf; gp = gbuf; bp = bbuf; + do { + for (x = 0; x <= xsize; x++) { + uint32 v = ss[x]; + rp[x] = v; + gp[x] = v >> 8; + bp[x] = v >> 16; + } + rp += xsize+1, gp += xsize+1, bp += xsize+1; + ss += xsize+1; + } while (--n); + if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,0), + rbuf, stripsize) < 0) + break; + if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,1), + gbuf, stripsize) < 0) + break; + if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,2), + bbuf, stripsize) < 0) + break; + } + _TIFFfree(rbuf); +} + +static void +svRGBContig(TIFF* tif, uint32* ss, int xsize, int ysize) +{ + register int x, y; + tsize_t stripsize = TIFFStripSize(tif); + unsigned char *strip = (unsigned char *)_TIFFmalloc(stripsize); + + for (y = 0; y <= ysize; y += rowsperstrip) { + register unsigned char *pp = strip; + register uint32 n; + + n = rowsperstrip; + if (n > ysize-y+1) + n = ysize-y+1; + do { + for (x = 0; x <= xsize; x++) { + uint32 v = ss[x]; + pp[0] = v; + pp[1] = v >> 8; + pp[2] = v >> 16; + pp += 3; + } + ss += xsize+1; + } while (--n); + if (TIFFWriteEncodedStrip(tif, TIFFComputeStrip(tif,y,0), + strip, stripsize) < 0) + break; + } + _TIFFfree(strip); +} + +#undef RED +#undef GREEN +#undef BLUE +#define CVT(x) (((x)*255)/100) +#define RED CVT(28) /* 28% */ +#define GREEN CVT(59) /* 59% */ +#define BLUE CVT(11) /* 11% */ + +static void +svGrey(TIFF* tif, uint32* ss, int xsize, int ysize) +{ + register int x, y; + unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif)); + + for (y = 0; y <= ysize; y++) { + for (x = 0; x <= xsize; x++) { + unsigned char *cp = (unsigned char *)&ss[x]; + buf[x] = (RED*cp[3] + GREEN*cp[2] + BLUE*cp[1]) >> 8; + } + if (TIFFWriteScanline(tif, buf, (uint32) y, 0) < 0) + break; + ss += xsize+1; + } + _TIFFfree(buf); +} + +#define MIN(a,b) ((a)<(b)?(a):(b)) +#define ABS(x) ((x)<0?-(x):(x)) + +static void +tiffsv(char* name, int x1, int x2, int y1, int y2) +{ + TIFF *tif; + int xsize, ysize; + int xorg, yorg; + uint32 *scrbuf; + + xorg = MIN(x1,x2); + yorg = MIN(y1,y2); + if (xorg<0) + xorg = 0; + if (yorg<0) + yorg = 0; + xsize = ABS(x2-x1); + ysize = ABS(y2-y1); + if (xorg+xsize > xmaxscreen) + xsize = xmaxscreen-xorg; + if (yorg+ysize > ymaxscreen) + ysize = ymaxscreen-yorg; + tif = TIFFOpen(name, "w"); + TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) (xsize+1)); + TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32) (ysize+1)); + TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, + photometric == PHOTOMETRIC_RGB ? 3 : 1); + TIFFSetField(tif, TIFFTAG_PLANARCONFIG, config); + TIFFSetField(tif, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_JPEG: + if (photometric == PHOTOMETRIC_RGB && jpegcolormode == JPEGCOLORMODE_RGB) + photometric = PHOTOMETRIC_YCBCR; + TIFFSetField(tif, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + if (predictor != 0) + TIFFSetField(tif, TIFFTAG_PREDICTOR, predictor); + break; + } + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric); + TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_BOTLEFT); + rowsperstrip = TIFFDefaultStripSize(tif, rowsperstrip); + TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + scrbuf = (uint32 *)_TIFFmalloc((xsize+1)*(ysize+1)*sizeof (uint32)); + readdisplay(xorg, yorg, xorg+xsize, yorg+ysize, scrbuf, RD_FREEZE); + if (photometric == PHOTOMETRIC_RGB) { + if (config == PLANARCONFIG_SEPARATE) + svRGBSeparate(tif, scrbuf, xsize, ysize); + else + svRGBContig(tif, scrbuf, xsize, ysize); + } else + svGrey(tif, scrbuf, xsize, ysize); + (void) TIFFClose(tif); + _TIFFfree((char *)scrbuf); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/thumbnail.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/thumbnail.c new file mode 100644 index 0000000..fd1cba5 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/thumbnail.c @@ -0,0 +1,659 @@ +/* $Id: thumbnail.c,v 1.16 2010-07-02 12:02:56 dron Exp $ */ + +/* + * Copyright (c) 1994-1997 Sam Leffler + * Copyright (c) 1994-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#define streq(a,b) (strcmp(a,b) == 0) + +#ifndef TIFFhowmany8 +# define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) +#endif + +typedef enum { + EXP50, + EXP60, + EXP70, + EXP80, + EXP90, + EXP, + LINEAR +} Contrast; + +static uint32 tnw = 216; /* thumbnail width */ +static uint32 tnh = 274; /* thumbnail height */ +static Contrast contrast = LINEAR; /* current contrast */ +static uint8* thumbnail; + +static int cpIFD(TIFF*, TIFF*); +static int generateThumbnail(TIFF*, TIFF*); +static void initScale(); +static void usage(void); + +extern char* optarg; +extern int optind; + +int +main(int argc, char* argv[]) +{ + TIFF* in; + TIFF* out; + int c; + + while ((c = getopt(argc, argv, "w:h:c:")) != -1) { + switch (c) { + case 'w': tnw = strtoul(optarg, NULL, 0); break; + case 'h': tnh = strtoul(optarg, NULL, 0); break; + case 'c': contrast = streq(optarg, "exp50") ? EXP50 : + streq(optarg, "exp60") ? EXP60 : + streq(optarg, "exp70") ? EXP70 : + streq(optarg, "exp80") ? EXP80 : + streq(optarg, "exp90") ? EXP90 : + streq(optarg, "exp") ? EXP : + streq(optarg, "linear")? LINEAR : + EXP; + break; + default: usage(); + } + } + if (argc-optind != 2) + usage(); + + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return 2; + in = TIFFOpen(argv[optind], "r"); + if( in == NULL ) + return 2; + + thumbnail = (uint8*) _TIFFmalloc(tnw * tnh); + if (!thumbnail) { + TIFFError(TIFFFileName(in), + "Can't allocate space for thumbnail buffer."); + return 1; + } + + if (in != NULL) { + initScale(); + do { + if (!generateThumbnail(in, out)) + goto bad; + if (!cpIFD(in, out) || !TIFFWriteDirectory(out)) + goto bad; + } while (TIFFReadDirectory(in)); + (void) TIFFClose(in); + } + (void) TIFFClose(out); + return 0; +bad: + (void) TIFFClose(out); + return 1; +} + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) +#define CopyField4(tag, v1, v2, v3, v4) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4) + +static void +cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type) +{ + switch (type) { + case TIFF_SHORT: + if (count == 1) { + uint16 shortv; + CopyField(tag, shortv); + } else if (count == 2) { + uint16 shortv1, shortv2; + CopyField2(tag, shortv1, shortv2); + } else if (count == 4) { + uint16 *tr, *tg, *tb, *ta; + CopyField4(tag, tr, tg, tb, ta); + } else if (count == (uint16) -1) { + uint16 shortv1; + uint16* shortav; + CopyField2(tag, shortv1, shortav); + } + break; + case TIFF_LONG: + { uint32 longv; + CopyField(tag, longv); + } + break; + case TIFF_LONG8: + { uint64 longv8; + CopyField(tag, longv8); + } + break; + case TIFF_SLONG8: + { int64 longv8; + CopyField(tag, longv8); + } + break; + case TIFF_RATIONAL: + if (count == 1) { + float floatv; + CopyField(tag, floatv); + } else if (count == (uint16) -1) { + float* floatav; + CopyField(tag, floatav); + } + break; + case TIFF_ASCII: + { char* stringv; + CopyField(tag, stringv); + } + break; + case TIFF_DOUBLE: + if (count == 1) { + double doublev; + CopyField(tag, doublev); + } else if (count == (uint16) -1) { + double* doubleav; + CopyField(tag, doubleav); + } + break; + case TIFF_IFD8: + { toff_t ifd8; + CopyField(tag, ifd8); + } + break; default: + TIFFError(TIFFFileName(in), + "Data type %d is not supported, tag %d skipped.", + tag, type); + } +} + +#undef CopyField4 +#undef CopyField3 +#undef CopyField2 +#undef CopyField + +static struct cpTag { + uint16 tag; + uint16 count; + TIFFDataType type; +} tags[] = { + { TIFFTAG_IMAGEWIDTH, 1, TIFF_LONG }, + { TIFFTAG_IMAGELENGTH, 1, TIFF_LONG }, + { TIFFTAG_BITSPERSAMPLE, 1, TIFF_SHORT }, + { TIFFTAG_COMPRESSION, 1, TIFF_SHORT }, + { TIFFTAG_FILLORDER, 1, TIFF_SHORT }, + { TIFFTAG_SAMPLESPERPIXEL, 1, TIFF_SHORT }, + { TIFFTAG_ROWSPERSTRIP, 1, TIFF_LONG }, + { TIFFTAG_PLANARCONFIG, 1, TIFF_SHORT }, + { TIFFTAG_GROUP3OPTIONS, 1, TIFF_LONG }, + { TIFFTAG_SUBFILETYPE, 1, TIFF_LONG }, + { TIFFTAG_PHOTOMETRIC, 1, TIFF_SHORT }, + { TIFFTAG_THRESHHOLDING, 1, TIFF_SHORT }, + { TIFFTAG_DOCUMENTNAME, 1, TIFF_ASCII }, + { TIFFTAG_IMAGEDESCRIPTION, 1, TIFF_ASCII }, + { TIFFTAG_MAKE, 1, TIFF_ASCII }, + { TIFFTAG_MODEL, 1, TIFF_ASCII }, + { TIFFTAG_ORIENTATION, 1, TIFF_SHORT }, + { TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_PAGENAME, 1, TIFF_ASCII }, + { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG }, + { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT }, + { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT }, + { TIFFTAG_SOFTWARE, 1, TIFF_ASCII }, + { TIFFTAG_DATETIME, 1, TIFF_ASCII }, + { TIFFTAG_ARTIST, 1, TIFF_ASCII }, + { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII }, + { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL }, + { TIFFTAG_PRIMARYCHROMATICITIES, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, + { TIFFTAG_BADFAXLINES, 1, TIFF_LONG }, + { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT }, + { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG }, + { TIFFTAG_INKSET, 1, TIFF_SHORT }, + { TIFFTAG_INKNAMES, 1, TIFF_ASCII }, + { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, + { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, + { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, + { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT }, + { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT }, + { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT }, +}; +#define NTAGS (sizeof (tags) / sizeof (tags[0])) + +static void +cpTags(TIFF* in, TIFF* out) +{ + struct cpTag *p; + for (p = tags; p < &tags[NTAGS]; p++) + cpTag(in, out, p->tag, p->count, p->type); +} +#undef NTAGS + +static int +cpStrips(TIFF* in, TIFF* out) +{ + tsize_t bufsize = TIFFStripSize(in); + unsigned char *buf = (unsigned char *)_TIFFmalloc(bufsize); + + if (buf) { + tstrip_t s, ns = TIFFNumberOfStrips(in); + uint64 *bytecounts; + + TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &bytecounts); + for (s = 0; s < ns; s++) { + if (bytecounts[s] > (uint64) bufsize) { + buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[s]); + if (!buf) + goto bad; + bufsize = (tmsize_t)bytecounts[s]; + } + if (TIFFReadRawStrip(in, s, buf, (tmsize_t)bytecounts[s]) < 0 || + TIFFWriteRawStrip(out, s, buf, (tmsize_t)bytecounts[s]) < 0) { + _TIFFfree(buf); + return 0; + } + } + _TIFFfree(buf); + return 1; + } + +bad: + TIFFError(TIFFFileName(in), + "Can't allocate space for strip buffer."); + return 0; +} + +static int +cpTiles(TIFF* in, TIFF* out) +{ + tsize_t bufsize = TIFFTileSize(in); + unsigned char *buf = (unsigned char *)_TIFFmalloc(bufsize); + + if (buf) { + ttile_t t, nt = TIFFNumberOfTiles(in); + uint64 *bytecounts; + + TIFFGetField(in, TIFFTAG_TILEBYTECOUNTS, &bytecounts); + for (t = 0; t < nt; t++) { + if (bytecounts[t] > (uint64) bufsize) { + buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[t]); + if (!buf) + goto bad; + bufsize = (tmsize_t)bytecounts[t]; + } + if (TIFFReadRawTile(in, t, buf, (tmsize_t)bytecounts[t]) < 0 || + TIFFWriteRawTile(out, t, buf, (tmsize_t)bytecounts[t]) < 0) { + _TIFFfree(buf); + return 0; + } + } + _TIFFfree(buf); + return 1; + } + +bad: + TIFFError(TIFFFileName(in), + "Can't allocate space for tile buffer."); + return (0); +} + +static int +cpIFD(TIFF* in, TIFF* out) +{ + cpTags(in, out); + if (TIFFIsTiled(in)) { + if (!cpTiles(in, out)) + return (0); + } else { + if (!cpStrips(in, out)) + return (0); + } + return (1); +} + +static uint16 photometric; /* current photometric of raster */ +static uint16 filterWidth; /* filter width in pixels */ +static uint32 stepSrcWidth; /* src image stepping width */ +static uint32 stepDstWidth; /* dest stepping width */ +static uint8* src0; /* horizontal bit stepping (start) */ +static uint8* src1; /* horizontal bit stepping (middle) */ +static uint8* src2; /* horizontal bit stepping (end) */ +static uint32* rowoff; /* row offset for stepping */ +static uint8 cmap[256]; /* colormap indexes */ +static uint8 bits[256]; /* count of bits set */ + +static void +setupBitsTables() +{ + int i; + for (i = 0; i < 256; i++) { + int n = 0; + if (i&0x01) n++; + if (i&0x02) n++; + if (i&0x04) n++; + if (i&0x08) n++; + if (i&0x10) n++; + if (i&0x20) n++; + if (i&0x40) n++; + if (i&0x80) n++; + bits[i] = n; + } +} + +static int clamp(float v, int low, int high) + { return (v < low ? low : v > high ? high : (int)v); } + +#ifndef M_E +#define M_E 2.7182818284590452354 +#endif + +static void +expFill(float pct[], uint32 p, uint32 n) +{ + uint32 i; + uint32 c = (p * n) / 100; + for (i = 1; i < c; i++) + pct[i] = (float) (1-exp(i/((double)(n-1)))/ M_E); + for (; i < n; i++) + pct[i] = 0.; +} + +static void +setupCmap() +{ + float pct[256]; /* known to be large enough */ + uint32 i; + pct[0] = 1; /* force white */ + switch (contrast) { + case EXP50: expFill(pct, 50, 256); break; + case EXP60: expFill(pct, 60, 256); break; + case EXP70: expFill(pct, 70, 256); break; + case EXP80: expFill(pct, 80, 256); break; + case EXP90: expFill(pct, 90, 256); break; + case EXP: expFill(pct, 100, 256); break; + case LINEAR: + for (i = 1; i < 256; i++) + pct[i] = 1-((float)i)/(256-1); + break; + } + switch (photometric) { + case PHOTOMETRIC_MINISWHITE: + for (i = 0; i < 256; i++) + cmap[i] = clamp(255*pct[(256-1)-i], 0, 255); + break; + case PHOTOMETRIC_MINISBLACK: + for (i = 0; i < 256; i++) + cmap[i] = clamp(255*pct[i], 0, 255); + break; + } +} + +static void +initScale() +{ + src0 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw); + src1 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw); + src2 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw); + rowoff = (uint32*) _TIFFmalloc(sizeof (uint32) * tnw); + filterWidth = 0; + stepDstWidth = stepSrcWidth = 0; + setupBitsTables(); +} + +/* + * Calculate the horizontal accumulation parameteres + * according to the widths of the src and dst images. + */ +static void +setupStepTables(uint32 sw) +{ + if (stepSrcWidth != sw || stepDstWidth != tnw) { + int step = sw; + int limit = tnw; + int err = 0; + uint32 sx = 0; + uint32 x; + int fw; + uint8 b; + for (x = 0; x < tnw; x++) { + uint32 sx0 = sx; + err += step; + while (err >= limit) { + err -= limit; + sx++; + } + rowoff[x] = sx0 >> 3; + fw = sx - sx0; /* width */ + b = (fw < 8) ? 0xff<<(8-fw) : 0xff; + src0[x] = b >> (sx0&7); + fw -= 8 - (sx0&7); + if (fw < 0) + fw = 0; + src1[x] = fw >> 3; + fw -= (fw>>3)<<3; + src2[x] = 0xff << (8-fw); + } + stepSrcWidth = sw; + stepDstWidth = tnw; + } +} + +static void +setrow(uint8* row, uint32 nrows, const uint8* rows[]) +{ + uint32 x; + uint32 area = nrows * filterWidth; + for (x = 0; x < tnw; x++) { + uint32 mask0 = src0[x]; + uint32 fw = src1[x]; + uint32 mask1 = src1[x]; + uint32 off = rowoff[x]; + uint32 acc = 0; + uint32 y, i; + for (y = 0; y < nrows; y++) { + const uint8* src = rows[y] + off; + acc += bits[*src++ & mask0]; + switch (fw) { + default: + for (i = fw; i > 8; i--) + acc += bits[*src++]; + /* fall thru... */ + case 8: acc += bits[*src++]; + case 7: acc += bits[*src++]; + case 6: acc += bits[*src++]; + case 5: acc += bits[*src++]; + case 4: acc += bits[*src++]; + case 3: acc += bits[*src++]; + case 2: acc += bits[*src++]; + case 1: acc += bits[*src++]; + case 0: break; + } + acc += bits[*src & mask1]; + } + *row++ = cmap[(255*acc)/area]; + } +} + +/* + * Install the specified image. The + * image is resized to fit the display page using + * a box filter. The resultant pixels are mapped + * with a user-selectable contrast curve. + */ +static void +setImage1(const uint8* br, uint32 rw, uint32 rh) +{ + int step = rh; + int limit = tnh; + int err = 0; + int bpr = TIFFhowmany8(rw); + int sy = 0; + uint8* row = thumbnail; + uint32 dy; + for (dy = 0; dy < tnh; dy++) { + const uint8* rows[256]; + uint32 nrows = 1; + fprintf(stderr, "bpr=%d, sy=%d, bpr*sy=%d\n", bpr, sy, bpr*sy); + rows[0] = br + bpr*sy; + err += step; + while (err >= limit) { + err -= limit; + sy++; + if (err >= limit) + rows[nrows++] = br + bpr*sy; + } + setrow(row, nrows, rows); + row += tnw; + } +} + +static void +setImage(const uint8* br, uint32 rw, uint32 rh) +{ + filterWidth = (uint16) ceil((double) rw / (double) tnw); + setupStepTables(rw); + setImage1(br, rw, rh); +} + +static int +generateThumbnail(TIFF* in, TIFF* out) +{ + unsigned char* raster; + unsigned char* rp; + uint32 sw, sh, rps; + uint16 bps, spp; + tsize_t rowsize, rastersize; + tstrip_t s, ns = TIFFNumberOfStrips(in); + toff_t diroff[1]; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &sw); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &sh); + TIFFGetFieldDefaulted(in, TIFFTAG_BITSPERSAMPLE, &bps); + TIFFGetFieldDefaulted(in, TIFFTAG_SAMPLESPERPIXEL, &spp); + TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps); + if (spp != 1 || bps != 1) + return 0; + rowsize = TIFFScanlineSize(in); + rastersize = sh * rowsize; + fprintf(stderr, "rastersize=%u\n", (unsigned int)rastersize); + raster = (unsigned char*)_TIFFmalloc(rastersize); + if (!raster) { + TIFFError(TIFFFileName(in), + "Can't allocate space for raster buffer."); + return 0; + } + rp = raster; + for (s = 0; s < ns; s++) { + (void) TIFFReadEncodedStrip(in, s, rp, -1); + rp += rps * rowsize; + } + TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric); + setupCmap(); + setImage(raster, sw, sh); + _TIFFfree(raster); + + TIFFSetField(out, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) tnw); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) tnh); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (uint16) 8); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, (uint16) 1); + TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + cpTag(in, out, TIFFTAG_SOFTWARE, (uint16) -1, TIFF_ASCII); + cpTag(in, out, TIFFTAG_IMAGEDESCRIPTION, (uint16) -1, TIFF_ASCII); + cpTag(in, out, TIFFTAG_DATETIME, (uint16) -1, TIFF_ASCII); + cpTag(in, out, TIFFTAG_HOSTCOMPUTER, (uint16) -1, TIFF_ASCII); + diroff[0] = 0UL; + TIFFSetField(out, TIFFTAG_SUBIFD, 1, diroff); + return (TIFFWriteEncodedStrip(out, 0, thumbnail, tnw*tnh) != -1 && + TIFFWriteDirectory(out) != -1); +} + +char* stuff[] = { +"usage: thumbnail [options] input.tif output.tif", +"where options are:", +" -h # specify thumbnail image height (default is 274)", +" -w # specify thumbnail image width (default is 216)", +"", +" -c linear use linear contrast curve", +" -c exp50 use 50% exponential contrast curve", +" -c exp60 use 60% exponential contrast curve", +" -c exp70 use 70% exponential contrast curve", +" -c exp80 use 80% exponential contrast curve", +" -c exp90 use 90% exponential contrast curve", +" -c exp use pure exponential contrast curve", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2bw.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2bw.c new file mode 100644 index 0000000..bda754a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2bw.c @@ -0,0 +1,471 @@ +/* $Id: tiff2bw.c,v 1.15 2010-07-02 12:02:56 dron Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#define streq(a,b) (strcmp((a),(b)) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +/* x% weighting -> fraction of full color */ +#define PCT(x) (((x)*255+127)/100) +int RED = PCT(30); /* 30% */ +int GREEN = PCT(59); /* 59% */ +int BLUE = PCT(11); /* 11% */ + +static void usage(void); +static int processCompressOptions(char*); + +static void +compresscontig(unsigned char* out, unsigned char* rgb, uint32 n) +{ + register int v, red = RED, green = GREEN, blue = BLUE; + + while (n-- > 0) { + v = red*(*rgb++); + v += green*(*rgb++); + v += blue*(*rgb++); + *out++ = v>>8; + } +} + +static void +compresssep(unsigned char* out, + unsigned char* r, unsigned char* g, unsigned char* b, uint32 n) +{ + register uint32 red = RED, green = GREEN, blue = BLUE; + + while (n-- > 0) + *out++ = (unsigned char) + ((red*(*r++) + green*(*g++) + blue*(*b++)) >> 8); +} + +static int +checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b) +{ + while (n-- > 0) + if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) + return (16); + TIFFWarning(TIFFFileName(tif), "Assuming 8-bit colormap"); + return (8); +} + +static void +compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap) +{ + register int v, red = RED, green = GREEN, blue = BLUE; + + while (n-- > 0) { + unsigned int ix = *data++; + v = red*rmap[ix]; + v += green*gmap[ix]; + v += blue*bmap[ix]; + *out++ = v>>8; + } +} + +static uint16 compression = (uint16) -1; +static uint16 predictor = 0; +static int jpegcolormode = JPEGCOLORMODE_RGB; +static int quality = 75; /* JPEG quality */ + +static void cpTags(TIFF* in, TIFF* out); + +int +main(int argc, char* argv[]) +{ + uint32 rowsperstrip = (uint32) -1; + TIFF *in, *out; + uint32 w, h; + uint16 samplesperpixel; + uint16 bitspersample; + uint16 config; + uint16 photometric; + uint16* red; + uint16* green; + uint16* blue; + tsize_t rowsize; + register uint32 row; + register tsample_t s; + unsigned char *inbuf, *outbuf; + char thing[1024]; + int c; + extern int optind; + extern char *optarg; + + while ((c = getopt(argc, argv, "c:r:R:G:B:")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case 'R': + RED = PCT(atoi(optarg)); + break; + case 'G': + GREEN = PCT(atoi(optarg)); + break; + case 'B': + BLUE = PCT(atoi(optarg)); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind < 2) + usage(); + in = TIFFOpen(argv[optind], "r"); + if (in == NULL) + return (-1); + photometric = 0; + TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric); + if (photometric != PHOTOMETRIC_RGB && photometric != PHOTOMETRIC_PALETTE ) { + fprintf(stderr, + "%s: Bad photometric; can only handle RGB and Palette images.\n", + argv[optind]); + return (-1); + } + TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + if (samplesperpixel != 1 && samplesperpixel != 3) { + fprintf(stderr, "%s: Bad samples/pixel %u.\n", + argv[optind], samplesperpixel); + return (-1); + } + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); + if (bitspersample != 8) { + fprintf(stderr, + " %s: Sorry, only handle 8-bit samples.\n", argv[optind]); + return (-1); + } + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &w); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); + + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return (-1); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, w); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, h); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + cpTags(in, out); + if (compression != (uint16) -1) { + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_JPEG: + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + } + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); + sprintf(thing, "B&W version of %s", argv[optind]); + TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing); + TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw"); + outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + +#define pack(a,b) ((a)<<8 | (b)) + switch (pack(photometric, config)) { + case pack(PHOTOMETRIC_PALETTE, PLANARCONFIG_CONTIG): + case pack(PHOTOMETRIC_PALETTE, PLANARCONFIG_SEPARATE): + TIFFGetField(in, TIFFTAG_COLORMAP, &red, &green, &blue); + /* + * Convert 16-bit colormap to 8-bit (unless it looks + * like an old-style 8-bit colormap). + */ + if (checkcmap(in, 1<= 0; i--) { + red[i] = CVT(red[i]); + green[i] = CVT(green[i]); + blue[i] = CVT(blue[i]); + } +#undef CVT + } + inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + for (row = 0; row < h; row++) { + if (TIFFReadScanline(in, inbuf, row, 0) < 0) + break; + compresspalette(outbuf, inbuf, w, red, green, blue); + if (TIFFWriteScanline(out, outbuf, row, 0) < 0) + break; + } + break; + case pack(PHOTOMETRIC_RGB, PLANARCONFIG_CONTIG): + inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + for (row = 0; row < h; row++) { + if (TIFFReadScanline(in, inbuf, row, 0) < 0) + break; + compresscontig(outbuf, inbuf, w); + if (TIFFWriteScanline(out, outbuf, row, 0) < 0) + break; + } + break; + case pack(PHOTOMETRIC_RGB, PLANARCONFIG_SEPARATE): + rowsize = TIFFScanlineSize(in); + inbuf = (unsigned char *)_TIFFmalloc(3*rowsize); + for (row = 0; row < h; row++) { + for (s = 0; s < 3; s++) + if (TIFFReadScanline(in, + inbuf+s*rowsize, row, s) < 0) + return (-1); + compresssep(outbuf, + inbuf, inbuf+rowsize, inbuf+2*rowsize, w); + if (TIFFWriteScanline(out, outbuf, row, 0) < 0) + break; + } + break; + } +#undef pack + TIFFClose(out); + return (0); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + compression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) +#define CopyField4(tag, v1, v2, v3, v4) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4) + +static void +cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type) +{ + switch (type) { + case TIFF_SHORT: + if (count == 1) { + uint16 shortv; + CopyField(tag, shortv); + } else if (count == 2) { + uint16 shortv1, shortv2; + CopyField2(tag, shortv1, shortv2); + } else if (count == 4) { + uint16 *tr, *tg, *tb, *ta; + CopyField4(tag, tr, tg, tb, ta); + } else if (count == (uint16) -1) { + uint16 shortv1; + uint16* shortav; + CopyField2(tag, shortv1, shortav); + } + break; + case TIFF_LONG: + { uint32 longv; + CopyField(tag, longv); + } + break; + case TIFF_RATIONAL: + if (count == 1) { + float floatv; + CopyField(tag, floatv); + } else if (count == (uint16) -1) { + float* floatav; + CopyField(tag, floatav); + } + break; + case TIFF_ASCII: + { char* stringv; + CopyField(tag, stringv); + } + break; + case TIFF_DOUBLE: + if (count == 1) { + double doublev; + CopyField(tag, doublev); + } else if (count == (uint16) -1) { + double* doubleav; + CopyField(tag, doubleav); + } + break; + default: + TIFFError(TIFFFileName(in), + "Data type %d is not supported, tag %d skipped.", + tag, type); + } +} + +#undef CopyField4 +#undef CopyField3 +#undef CopyField2 +#undef CopyField + +static struct cpTag { + uint16 tag; + uint16 count; + TIFFDataType type; +} tags[] = { + { TIFFTAG_SUBFILETYPE, 1, TIFF_LONG }, + { TIFFTAG_THRESHHOLDING, 1, TIFF_SHORT }, + { TIFFTAG_DOCUMENTNAME, 1, TIFF_ASCII }, + { TIFFTAG_IMAGEDESCRIPTION, 1, TIFF_ASCII }, + { TIFFTAG_MAKE, 1, TIFF_ASCII }, + { TIFFTAG_MODEL, 1, TIFF_ASCII }, + { TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_PAGENAME, 1, TIFF_ASCII }, + { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT }, + { TIFFTAG_SOFTWARE, 1, TIFF_ASCII }, + { TIFFTAG_DATETIME, 1, TIFF_ASCII }, + { TIFFTAG_ARTIST, 1, TIFF_ASCII }, + { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII }, + { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL }, + { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, + { TIFFTAG_INKSET, 1, TIFF_SHORT }, + { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, + { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, + { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, + { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT }, + { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT }, + { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT }, + { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_STONITS, 1, TIFF_DOUBLE }, +}; +#define NTAGS (sizeof (tags) / sizeof (tags[0])) + +static void +cpTags(TIFF* in, TIFF* out) +{ + struct cpTag *p; + for (p = tags; p < &tags[NTAGS]; p++) + cpTag(in, out, p->tag, p->count, p->type); +} +#undef NTAGS + +char* stuff[] = { +"usage: tiff2bw [options] input.tif output.tif", +"where options are:", +" -R % use #% from red channel", +" -G % use #% from green channel", +" -B % use #% from blue channel", +"", +" -r # make each strip have no more than # rows", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding", +" -c g3[:opts] compress output with CCITT Group 3 encoding", +" -c g4 compress output with CCITT Group 4 encoding", +" -c none use no compression algorithm on output", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2pdf.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2pdf.c new file mode 100644 index 0000000..356328c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2pdf.c @@ -0,0 +1,5388 @@ +/* $Id: tiff2pdf.c,v 1.69 2012-07-19 15:43:41 tgl Exp $ + * + * tiff2pdf - converts a TIFF image to a PDF document + * + * Copyright (c) 2003 Ross Finlayson + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the name of + * Ross Finlayson may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Ross Finlayson. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL ROSS FINLAYSON BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include +#include +#include + +#if HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffiop.h" +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#define TIFF2PDF_MODULE "tiff2pdf" + +#define PS_UNIT_SIZE 72.0F + +/* This type is of PDF color spaces. */ +typedef enum { + T2P_CS_BILEVEL = 0x01, /* Bilevel, black and white */ + T2P_CS_GRAY = 0x02, /* Single channel */ + T2P_CS_RGB = 0x04, /* Three channel tristimulus RGB */ + T2P_CS_CMYK = 0x08, /* Four channel CMYK print inkset */ + T2P_CS_LAB = 0x10, /* Three channel L*a*b* color space */ + T2P_CS_PALETTE = 0x1000,/* One of the above with a color map */ + T2P_CS_CALGRAY = 0x20, /* Calibrated single channel */ + T2P_CS_CALRGB = 0x40, /* Calibrated three channel tristimulus RGB */ + T2P_CS_ICCBASED = 0x80 /* ICC profile color specification */ +} t2p_cs_t; + +/* This type is of PDF compression types. */ +typedef enum{ + T2P_COMPRESS_NONE=0x00 +#ifdef CCITT_SUPPORT + , T2P_COMPRESS_G4=0x01 +#endif +#if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT) + , T2P_COMPRESS_JPEG=0x02 +#endif +#ifdef ZIP_SUPPORT + , T2P_COMPRESS_ZIP=0x04 +#endif +} t2p_compress_t; + +/* This type is whether TIFF image data can be used in PDF without transcoding. */ +typedef enum{ + T2P_TRANSCODE_RAW=0x01, /* The raw data from the input can be used without recompressing */ + T2P_TRANSCODE_ENCODE=0x02 /* The data from the input is perhaps unencoded and reencoded */ +} t2p_transcode_t; + +/* This type is of information about the data samples of the input image. */ +typedef enum{ + T2P_SAMPLE_NOTHING=0x0000, /* The unencoded samples are normal for the output colorspace */ + T2P_SAMPLE_ABGR_TO_RGB=0x0001, /* The unencoded samples are the result of ReadRGBAImage */ + T2P_SAMPLE_RGBA_TO_RGB=0x0002, /* The unencoded samples are contiguous RGBA */ + T2P_SAMPLE_RGBAA_TO_RGB=0x0004, /* The unencoded samples are RGBA with premultiplied alpha */ + T2P_SAMPLE_YCBCR_TO_RGB=0x0008, + T2P_SAMPLE_YCBCR_TO_LAB=0x0010, + T2P_SAMPLE_REALIZE_PALETTE=0x0020, /* The unencoded samples are indexes into the color map */ + T2P_SAMPLE_SIGNED_TO_UNSIGNED=0x0040, /* The unencoded samples are signed instead of unsignd */ + T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED=0x0040, /* The L*a*b* samples have a* and b* signed */ + T2P_SAMPLE_PLANAR_SEPARATE_TO_CONTIG=0x0100 /* The unencoded samples are separate instead of contiguous */ +} t2p_sample_t; + +/* This type is of error status of the T2P struct. */ +typedef enum{ + T2P_ERR_OK = 0, /* This is the value of t2p->t2p_error when there is no error */ + T2P_ERR_ERROR = 1 /* This is the value of t2p->t2p_error when there was an error */ +} t2p_err_t; + +/* This struct defines a logical page of a TIFF. */ +typedef struct { + tdir_t page_directory; + uint32 page_number; + ttile_t page_tilecount; + uint32 page_extra; +} T2P_PAGE; + +/* This struct defines a PDF rectangle's coordinates. */ +typedef struct { + float x1; + float y1; + float x2; + float y2; + float mat[9]; +} T2P_BOX; + +/* This struct defines a tile of a PDF. */ +typedef struct { + T2P_BOX tile_box; +} T2P_TILE; + +/* This struct defines information about the tiles on a PDF page. */ +typedef struct { + ttile_t tiles_tilecount; + uint32 tiles_tilewidth; + uint32 tiles_tilelength; + uint32 tiles_tilecountx; + uint32 tiles_tilecounty; + uint32 tiles_edgetilewidth; + uint32 tiles_edgetilelength; + T2P_TILE* tiles_tiles; +} T2P_TILES; + +/* This struct is the context of a function to generate PDF from a TIFF. */ +typedef struct { + t2p_err_t t2p_error; + T2P_PAGE* tiff_pages; + T2P_TILES* tiff_tiles; + tdir_t tiff_pagecount; + uint16 tiff_compression; + uint16 tiff_photometric; + uint16 tiff_fillorder; + uint16 tiff_bitspersample; + uint16 tiff_samplesperpixel; + uint16 tiff_planar; + uint32 tiff_width; + uint32 tiff_length; + float tiff_xres; + float tiff_yres; + uint16 tiff_orientation; + toff_t tiff_dataoffset; + tsize_t tiff_datasize; + uint16 tiff_resunit; + uint16 pdf_centimeters; + uint16 pdf_overrideres; + uint16 pdf_overridepagesize; + float pdf_defaultxres; + float pdf_defaultyres; + float pdf_xres; + float pdf_yres; + float pdf_defaultpagewidth; + float pdf_defaultpagelength; + float pdf_pagewidth; + float pdf_pagelength; + float pdf_imagewidth; + float pdf_imagelength; + int pdf_image_fillpage; /* 0 (default: no scaling, 1:scale imagesize to pagesize */ + T2P_BOX pdf_mediabox; + T2P_BOX pdf_imagebox; + uint16 pdf_majorversion; + uint16 pdf_minorversion; + uint32 pdf_catalog; + uint32 pdf_pages; + uint32 pdf_info; + uint32 pdf_palettecs; + uint16 pdf_fitwindow; + uint32 pdf_startxref; +#define TIFF2PDF_FILEID_SIZE 33 + char pdf_fileid[TIFF2PDF_FILEID_SIZE]; +#define TIFF2PDF_DATETIME_SIZE 17 + char pdf_datetime[TIFF2PDF_DATETIME_SIZE]; +#define TIFF2PDF_CREATOR_SIZE 512 + char pdf_creator[TIFF2PDF_CREATOR_SIZE]; +#define TIFF2PDF_AUTHOR_SIZE 512 + char pdf_author[TIFF2PDF_AUTHOR_SIZE]; +#define TIFF2PDF_TITLE_SIZE 512 + char pdf_title[TIFF2PDF_TITLE_SIZE]; +#define TIFF2PDF_SUBJECT_SIZE 512 + char pdf_subject[TIFF2PDF_SUBJECT_SIZE]; +#define TIFF2PDF_KEYWORDS_SIZE 512 + char pdf_keywords[TIFF2PDF_KEYWORDS_SIZE]; + t2p_cs_t pdf_colorspace; + uint16 pdf_colorspace_invert; + uint16 pdf_switchdecode; + uint16 pdf_palettesize; + unsigned char* pdf_palette; + int pdf_labrange[4]; + t2p_compress_t pdf_defaultcompression; + uint16 pdf_defaultcompressionquality; + t2p_compress_t pdf_compression; + uint16 pdf_compressionquality; + uint16 pdf_nopassthrough; + t2p_transcode_t pdf_transcode; + t2p_sample_t pdf_sample; + uint32* pdf_xrefoffsets; + uint32 pdf_xrefcount; + tdir_t pdf_page; +#ifdef OJPEG_SUPPORT + tdata_t pdf_ojpegdata; + uint32 pdf_ojpegdatalength; + uint32 pdf_ojpegiflength; +#endif + float tiff_whitechromaticities[2]; + float tiff_primarychromaticities[6]; + float tiff_referenceblackwhite[2]; + float* tiff_transferfunction[3]; + int pdf_image_interpolate; /* 0 (default) : do not interpolate, + 1 : interpolate */ + uint16 tiff_transferfunctioncount; + uint32 pdf_icccs; + uint32 tiff_iccprofilelength; + tdata_t tiff_iccprofile; + + /* fields for custom read/write procedures */ + FILE *outputfile; + int outputdisable; + tsize_t outputwritten; +} T2P; + +/* These functions are called by main. */ + +void tiff2pdf_usage(void); +int tiff2pdf_match_paper_size(float*, float*, char*); + +/* These functions are used to generate a PDF from a TIFF. */ + +#ifdef __cplusplus +extern "C" { +#endif + +T2P* t2p_init(void); +void t2p_validate(T2P*); +tsize_t t2p_write_pdf(T2P*, TIFF*, TIFF*); +void t2p_free(T2P*); + +#ifdef __cplusplus +} +#endif + +void t2p_read_tiff_init(T2P*, TIFF*); +int t2p_cmp_t2p_page(const void*, const void*); +void t2p_read_tiff_data(T2P*, TIFF*); +void t2p_read_tiff_size(T2P*, TIFF*); +void t2p_read_tiff_size_tile(T2P*, TIFF*, ttile_t); +int t2p_tile_is_right_edge(T2P_TILES, ttile_t); +int t2p_tile_is_bottom_edge(T2P_TILES, ttile_t); +int t2p_tile_is_edge(T2P_TILES, ttile_t); +int t2p_tile_is_corner_edge(T2P_TILES, ttile_t); +tsize_t t2p_readwrite_pdf_image(T2P*, TIFF*, TIFF*); +tsize_t t2p_readwrite_pdf_image_tile(T2P*, TIFF*, TIFF*, ttile_t); +#ifdef OJPEG_SUPPORT +int t2p_process_ojpeg_tables(T2P*, TIFF*); +#endif +#ifdef JPEG_SUPPORT +int t2p_process_jpeg_strip(unsigned char*, tsize_t*, unsigned char*, tsize_t*, tstrip_t, uint32); +#endif +void t2p_tile_collapse_left(tdata_t, tsize_t, uint32, uint32, uint32); +void t2p_write_advance_directory(T2P*, TIFF*); +tsize_t t2p_sample_planar_separate_to_contig(T2P*, unsigned char*, unsigned char*, tsize_t); +tsize_t t2p_sample_realize_palette(T2P*, unsigned char*); +tsize_t t2p_sample_abgr_to_rgb(tdata_t, uint32); +tsize_t t2p_sample_rgba_to_rgb(tdata_t, uint32); +tsize_t t2p_sample_rgbaa_to_rgb(tdata_t, uint32); +tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t, uint32); +tsize_t t2p_write_pdf_header(T2P*, TIFF*); +tsize_t t2p_write_pdf_obj_start(uint32, TIFF*); +tsize_t t2p_write_pdf_obj_end(TIFF*); +tsize_t t2p_write_pdf_name(unsigned char*, TIFF*); +tsize_t t2p_write_pdf_string(char*, TIFF*); +tsize_t t2p_write_pdf_stream(tdata_t, tsize_t, TIFF*); +tsize_t t2p_write_pdf_stream_start(TIFF*); +tsize_t t2p_write_pdf_stream_end(TIFF*); +tsize_t t2p_write_pdf_stream_dict(tsize_t, uint32, TIFF*); +tsize_t t2p_write_pdf_stream_dict_start(TIFF*); +tsize_t t2p_write_pdf_stream_dict_end(TIFF*); +tsize_t t2p_write_pdf_stream_length(tsize_t, TIFF*); +tsize_t t2p_write_pdf_catalog(T2P*, TIFF*); +tsize_t t2p_write_pdf_info(T2P*, TIFF*, TIFF*); +void t2p_pdf_currenttime(T2P*); +void t2p_pdf_tifftime(T2P*, TIFF*); +tsize_t t2p_write_pdf_pages(T2P*, TIFF*); +tsize_t t2p_write_pdf_page(uint32, T2P*, TIFF*); +void t2p_compose_pdf_page(T2P*); +void t2p_compose_pdf_page_orient(T2P_BOX*, uint16); +void t2p_compose_pdf_page_orient_flip(T2P_BOX*, uint16); +tsize_t t2p_write_pdf_page_content(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_stream_dict(ttile_t, T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_cs(T2P*, TIFF*); +tsize_t t2p_write_pdf_transfer(T2P*, TIFF*); +tsize_t t2p_write_pdf_transfer_dict(T2P*, TIFF*, uint16); +tsize_t t2p_write_pdf_transfer_stream(T2P*, TIFF*, uint16); +tsize_t t2p_write_pdf_xobject_calcs(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_icccs(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_icccs_dict(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_icccs_stream(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_cs_stream(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_decode(T2P*, TIFF*); +tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t, T2P*, TIFF*); +tsize_t t2p_write_pdf_xreftable(T2P*, TIFF*); +tsize_t t2p_write_pdf_trailer(T2P*, TIFF*); + +static void +t2p_disable(TIFF *tif) +{ + T2P *t2p = (T2P*) TIFFClientdata(tif); + t2p->outputdisable = 1; +} + +static void +t2p_enable(TIFF *tif) +{ + T2P *t2p = (T2P*) TIFFClientdata(tif); + t2p->outputdisable = 0; +} + +/* + * Procs for TIFFClientOpen + */ + +static tmsize_t +t2pReadFile(TIFF *tif, tdata_t data, tmsize_t size) +{ + thandle_t client = TIFFClientdata(tif); + TIFFReadWriteProc proc = TIFFGetReadProc(tif); + if (proc) + return proc(client, data, size); + return -1; +} + +static tmsize_t +t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size) +{ + thandle_t client = TIFFClientdata(tif); + TIFFReadWriteProc proc = TIFFGetWriteProc(tif); + if (proc) + return proc(client, data, size); + return -1; +} + +static uint64 +t2pSeekFile(TIFF *tif, toff_t offset, int whence) +{ + thandle_t client = TIFFClientdata(tif); + TIFFSeekProc proc = TIFFGetSeekProc(tif); + if (proc) + return proc(client, offset, whence); + return -1; +} + +static tmsize_t +t2p_readproc(thandle_t handle, tdata_t data, tmsize_t size) +{ + (void) handle, (void) data, (void) size; + return -1; +} + +static tmsize_t +t2p_writeproc(thandle_t handle, tdata_t data, tmsize_t size) +{ + T2P *t2p = (T2P*) handle; + if (t2p->outputdisable <= 0 && t2p->outputfile) { + tsize_t written = fwrite(data, 1, size, t2p->outputfile); + t2p->outputwritten += written; + return written; + } + return size; +} + +static uint64 +t2p_seekproc(thandle_t handle, uint64 offset, int whence) +{ + T2P *t2p = (T2P*) handle; + if (t2p->outputdisable <= 0 && t2p->outputfile) + return fseek(t2p->outputfile, (long) offset, whence); + return offset; +} + +static int +t2p_closeproc(thandle_t handle) +{ + (void) handle; + return 0; +} + +static uint64 +t2p_sizeproc(thandle_t handle) +{ + (void) handle; + return -1; +} + +static int +t2p_mapproc(thandle_t handle, void **data, toff_t *offset) +{ + (void) handle, (void) data, (void) offset; + return -1; +} + +static void +t2p_unmapproc(thandle_t handle, void *data, toff_t offset) +{ + (void) handle, (void) data, (void) offset; +} + +static uint64 +checkAdd64(uint64 summand1, uint64 summand2, T2P* t2p) +{ + uint64 bytes = summand1 + summand2; + + if (bytes - summand1 != summand2) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + bytes = 0; + } + + return bytes; +} + +static uint64 +checkMultiply64(uint64 first, uint64 second, T2P* t2p) +{ + uint64 bytes = first * second; + + if (second && bytes / second != first) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + bytes = 0; + } + + return bytes; +} + +/* + + This is the main function. + + The program converts one TIFF file to one PDF file, including multiple page + TIFF files, tiled TIFF files, black and white. grayscale, and color TIFF + files that contain data of TIFF photometric interpretations of bilevel, + grayscale, RGB, YCbCr, CMYK separation, and ICC L*a*b* as supported by + libtiff and PDF. + + If you have multiple TIFF files to convert into one PDF file then use tiffcp + or other program to concatenate the files into a multiple page TIFF file. + If the input TIFF file is of huge dimensions (greater than 10000 pixels height + or width) convert the input image to a tiled TIFF if it is not already. + + The standard output is standard output. Set the output file name with the + "-o output.pdf" option. + + All black and white files are compressed into a single strip CCITT G4 Fax + compressed PDF, unless tiled, where tiled black and white images are + compressed into tiled CCITT G4 Fax compressed PDF, libtiff CCITT support + is assumed. + + Color and grayscale data can be compressed using either JPEG compression, + ITU-T T.81, or Zip/Deflate LZ77 compression, per PNG 1.2 and RFC 1951. Set + the compression type using the -j or -z options. JPEG compression support + requires that libtiff be configured with JPEG support, and Zip/Deflate + compression support requires that libtiff is configured with Zip support, + in tiffconf.h. Use only one or the other of -j and -z. The -q option + sets the image compression quality, that is 1-100 with libjpeg JPEG + compression and one of 1, 10, 11, 12, 13, 14, or 15 for PNG group compression + predictor methods, add 100, 200, ..., 900 to set zlib compression quality 1-9. + PNG Group differencing predictor methods are not currently implemented. + + If the input TIFF contains single strip CCITT G4 Fax compressed information, + then that is written to the PDF file without transcoding, unless the options + of no compression and no passthrough are set, -d and -n. + + If the input TIFF contains JPEG or single strip Zip/Deflate compressed + information, and they are configured, then that is written to the PDF file + without transcoding, unless the options of no compression and no passthrough + are set. + + The default page size upon which the TIFF image is placed is determined by + the resolution and extent of the image data. Default values for the TIFF + image resolution can be set using the -x and -y options. The page size can + be set using the -p option for paper size, or -w and -l for paper width and + length, then each page of the TIFF image is centered on its page. The + distance unit for default resolution and page width and length can be set + by the -u option, the default unit is inch. + + Various items of the output document information can be set with the -e, -c, + -a, -t, -s, and -k tags. Setting the argument of the option to "" for these + tags causes the relevant document information field to be not written. Some + of the document information values otherwise get their information from the + input TIFF image, the software, author, document name, and image description. + + The output PDF file conforms to the PDF 1.1 specification or PDF 1.2 if using + Zip/Deflate compression. + + The Portable Document Format (PDF) specification is copyrighted by Adobe + Systems, Incorporated. Todos derechos reservados. + + Here is a listing of the usage example and the options to the tiff2pdf + program that is part of the libtiff distribution. Options followed by + a colon have a required argument. + + usage: tiff2pdf [options] input.tif + + options: + -o: output to file name + + -j: compress with JPEG (requires libjpeg configured with libtiff) + -z: compress with Zip/Deflate (requires zlib configured with libtiff) + -q: compression quality + -n: no compressed data passthrough + -d: do not compress (decompress) + -i: invert colors + -u: set distance unit, 'i' for inch, 'm' for centimeter + -x: set x resolution default + -y: set y resolution default + -w: width in units + -l: length in units + -r: 'd' for resolution default, 'o' for resolution override + -p: paper size, eg "letter", "legal", "a4" + -F: make the tiff fill the PDF page + -f: set pdf "fit window" user preference + -b: set PDF "Interpolate" user preference + -e: date, overrides image or current date/time default, YYYYMMDDHHMMSS + -c: creator, overrides image software default + -a: author, overrides image artist default + -t: title, overrides image document name default + -s: subject, overrides image image description default + -k: keywords + + -h: usage + + examples: + + tiff2pdf -o output.pdf input.tiff + + The above example would generate the file output.pdf from input.tiff. + + tiff2pdf input.tiff + + The above example would generate PDF output from input.tiff and write it + to standard output. + + tiff2pdf -j -p letter -o output.pdf input.tiff + + The above example would generate the file output.pdf from input.tiff, + putting the image pages on a letter sized page, compressing the output + with JPEG. + + Please report bugs through: + + http://bugzilla.remotesensing.org/buglist.cgi?product=libtiff + + See also libtiff.3t, tiffcp. + */ + +int main(int argc, char** argv){ + + extern char *optarg; + extern int optind; + const char *outfilename = NULL; + T2P *t2p = NULL; + TIFF *input = NULL, *output = NULL; + int c, ret = EXIT_SUCCESS; + + t2p = t2p_init(); + + if (t2p == NULL){ + TIFFError(TIFF2PDF_MODULE, "Can't initialize context"); + goto fail; + } + + while (argv && + (c = getopt(argc, argv, + "o:q:u:x:y:w:l:r:p:e:c:a:t:s:k:jzndifbhF")) != -1){ + switch (c) { + case 'o': + outfilename = optarg; + break; +#ifdef JPEG_SUPPORT + case 'j': + t2p->pdf_defaultcompression=T2P_COMPRESS_JPEG; + break; +#endif +#ifndef JPEG_SUPPORT + case 'j': + TIFFWarning( + TIFF2PDF_MODULE, + "JPEG support in libtiff required for JPEG compression, ignoring option"); + break; +#endif +#ifdef ZIP_SUPPORT + case 'z': + t2p->pdf_defaultcompression=T2P_COMPRESS_ZIP; + break; +#endif +#ifndef ZIP_SUPPORT + case 'z': + TIFFWarning( + TIFF2PDF_MODULE, + "Zip support in libtiff required for Zip compression, ignoring option"); + break; +#endif + case 'q': + t2p->pdf_defaultcompressionquality=atoi(optarg); + break; + case 'n': + t2p->pdf_nopassthrough=1; + break; + case 'd': + t2p->pdf_defaultcompression=T2P_COMPRESS_NONE; + break; + case 'u': + if(optarg[0]=='m'){ + t2p->pdf_centimeters=1; + } + break; + case 'x': + t2p->pdf_defaultxres = + (float)atof(optarg) / (t2p->pdf_centimeters?2.54F:1.0F); + break; + case 'y': + t2p->pdf_defaultyres = + (float)atof(optarg) / (t2p->pdf_centimeters?2.54F:1.0F); + break; + case 'w': + t2p->pdf_overridepagesize=1; + t2p->pdf_defaultpagewidth = + ((float)atof(optarg) * PS_UNIT_SIZE) / (t2p->pdf_centimeters?2.54F:1.0F); + break; + case 'l': + t2p->pdf_overridepagesize=1; + t2p->pdf_defaultpagelength = + ((float)atof(optarg) * PS_UNIT_SIZE) / (t2p->pdf_centimeters?2.54F:1.0F); + break; + case 'r': + if(optarg[0]=='o'){ + t2p->pdf_overrideres=1; + } + break; + case 'p': + if(tiff2pdf_match_paper_size( + &(t2p->pdf_defaultpagewidth), + &(t2p->pdf_defaultpagelength), + optarg)){ + t2p->pdf_overridepagesize=1; + } else { + TIFFWarning(TIFF2PDF_MODULE, + "Unknown paper size %s, ignoring option", + optarg); + } + break; + case 'i': + t2p->pdf_colorspace_invert=1; + break; + case 'F': + t2p->pdf_image_fillpage = 1; + break; + case 'f': + t2p->pdf_fitwindow=1; + break; + case 'e': + if (strlen(optarg) == 0) { + t2p->pdf_datetime[0] = '\0'; + } else { + t2p->pdf_datetime[0] = 'D'; + t2p->pdf_datetime[1] = ':'; + strncpy(t2p->pdf_datetime + 2, optarg, + sizeof(t2p->pdf_datetime) - 3); + t2p->pdf_datetime[sizeof(t2p->pdf_datetime) - 1] = '\0'; + } + break; + case 'c': + strncpy(t2p->pdf_creator, optarg, sizeof(t2p->pdf_creator) - 1); + t2p->pdf_creator[sizeof(t2p->pdf_creator) - 1] = '\0'; + break; + case 'a': + strncpy(t2p->pdf_author, optarg, sizeof(t2p->pdf_author) - 1); + t2p->pdf_author[sizeof(t2p->pdf_author) - 1] = '\0'; + break; + case 't': + strncpy(t2p->pdf_title, optarg, sizeof(t2p->pdf_title) - 1); + t2p->pdf_title[sizeof(t2p->pdf_title) - 1] = '\0'; + break; + case 's': + strncpy(t2p->pdf_subject, optarg, sizeof(t2p->pdf_subject) - 1); + t2p->pdf_subject[sizeof(t2p->pdf_subject) - 1] = '\0'; + break; + case 'k': + strncpy(t2p->pdf_keywords, optarg, sizeof(t2p->pdf_keywords) - 1); + t2p->pdf_keywords[sizeof(t2p->pdf_keywords) - 1] = '\0'; + break; + case 'b': + t2p->pdf_image_interpolate = 1; + break; + case 'h': + case '?': + tiff2pdf_usage(); + goto success; + break; + } + } + + /* + * Input + */ + if(argc > optind) { + input = TIFFOpen(argv[optind++], "r"); + if (input==NULL) { + TIFFError(TIFF2PDF_MODULE, + "Can't open input file %s for reading", + argv[optind-1]); + goto fail; + } + } else { + TIFFError(TIFF2PDF_MODULE, "No input file specified"); + tiff2pdf_usage(); + goto fail; + } + + if(argc > optind) { + TIFFError(TIFF2PDF_MODULE, + "No support for multiple input files"); + tiff2pdf_usage(); + goto fail; + } + + /* + * Output + */ + t2p->outputdisable = 0; + if (outfilename) { + t2p->outputfile = fopen(outfilename, "wb"); + if (t2p->outputfile == NULL) { + TIFFError(TIFF2PDF_MODULE, + "Can't open output file %s for writing", + outfilename); + goto fail; + } + } else { + outfilename = "-"; + t2p->outputfile = stdout; + } + + output = TIFFClientOpen(outfilename, "w", (thandle_t) t2p, + t2p_readproc, t2p_writeproc, t2p_seekproc, + t2p_closeproc, t2p_sizeproc, + t2p_mapproc, t2p_unmapproc); + if (output == NULL) { + TIFFError(TIFF2PDF_MODULE, + "Can't initialize output descriptor"); + goto fail; + } + + /* + * Validate + */ + t2p_validate(t2p); + t2pSeekFile(output, (toff_t) 0, SEEK_SET); + + /* + * Write + */ + t2p_write_pdf(t2p, input, output); + if (t2p->t2p_error != 0) { + TIFFError(TIFF2PDF_MODULE, + "An error occurred creating output PDF file"); + goto fail; + } + + goto success; +fail: + ret = EXIT_FAILURE; +success: + if(input != NULL) + TIFFClose(input); + if (output != NULL) + TIFFClose(output); + if (t2p != NULL) + t2p_free(t2p); + return ret; + +} + +void tiff2pdf_usage(){ + char* lines[]={ + "usage: tiff2pdf [options] input.tiff", + "options:", + " -o: output to file name", +#ifdef JPEG_SUPPORT + " -j: compress with JPEG", +#endif +#ifdef ZIP_SUPPORT + " -z: compress with Zip/Deflate", +#endif + " -q: compression quality", + " -n: no compressed data passthrough", + " -d: do not compress (decompress)", + " -i: invert colors", + " -u: set distance unit, 'i' for inch, 'm' for centimeter", + " -x: set x resolution default in dots per unit", + " -y: set y resolution default in dots per unit", + " -w: width in units", + " -l: length in units", + " -r: 'd' for resolution default, 'o' for resolution override", + " -p: paper size, eg \"letter\", \"legal\", \"A4\"", + " -F: make the tiff fill the PDF page", + " -f: set PDF \"Fit Window\" user preference", + " -e: date, overrides image or current date/time default, YYYYMMDDHHMMSS", + " -c: sets document creator, overrides image software default", + " -a: sets document author, overrides image artist default", + " -t: sets document title, overrides image document name default", + " -s: sets document subject, overrides image image description default", + " -k: sets document keywords", + " -b: set PDF \"Interpolate\" user preference", + " -h: usage", + NULL + }; + int i=0; + + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i=0;lines[i]!=NULL;i++){ + fprintf(stderr, "%s\n", lines[i]); + } + + return; +} + +int tiff2pdf_match_paper_size(float* width, float* length, char* papersize){ + + size_t i, len; + const char* sizes[]={ + "LETTER", "A4", "LEGAL", + "EXECUTIVE", "LETTER", "LEGAL", "LEDGER", "TABLOID", + "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", + "A10", "A9", "A8", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0", + "2A0", "4A0", "2A", "4A", + "B10", "B9", "B8", "B7", "B6", "B5", "B4", "B3", "B2", "B1", "B0", + "JISB10", "JISB9", "JISB8", "JISB7", "JISB6", "JISB5", "JISB4", + "JISB3", "JISB2", "JISB1", "JISB0", + "C10", "C9", "C8", "C7", "C6", "C5", "C4", "C3", "C2", "C1", "C0", + "RA2", "RA1", "RA0", "SRA4", "SRA3", "SRA2", "SRA1", "SRA0", + "A3EXTRA", "A4EXTRA", + "STATEMENT", "FOLIO", "QUARTO", + NULL + } ; + const int widths[]={ + 612, 595, 612, + 522, 612,612,792,792, + 612,792,1224,1584,2448,2016,792,2016,2448,2880, + 74,105,147,210,298,420,595,842,1191,1684,2384,3370,4768,3370,4768, + 88,125,176,249,354,499,709,1001,1417,2004,2835, + 91,128,181,258,363,516,729,1032,1460,2064,2920, + 79,113,162,230,323,459,649,918,1298,1298,2599, + 1219,1729,2438,638,907,1276,1814,2551, + 914,667, + 396, 612, 609, + 0 + }; + const int lengths[]={ + 792,842,1008, + 756,792,1008,1224,1224, + 792,1224,1584,2448,3168,2880,6480,10296,12672,10296, + 105,147,210,298,420,595,842,1191,1684,2384,3370,4768,6741,4768,6741, + 125,176,249,354,499,709,1001,1417,2004,2835,4008, + 128,181,258,363,516,729,1032,1460,2064,2920,4127, + 113,162,230,323,459,649,918,1298,1837,1837,3677, + 1729,2438,3458,907,1276,1814,2551,3628, + 1262,914, + 612, 936, 780, + 0 + }; + + len=strlen(papersize); + for(i=0;ipdf_majorversion=1; + t2p->pdf_minorversion=1; + t2p->pdf_defaultxres=300.0; + t2p->pdf_defaultyres=300.0; + t2p->pdf_defaultpagewidth=612.0; + t2p->pdf_defaultpagelength=792.0; + t2p->pdf_xrefcount=3; /* Catalog, Info, Pages */ + + return(t2p); +} + +/* + * This function frees a T2P context struct pointer and any allocated data fields of it. + */ + +void t2p_free(T2P* t2p) +{ + int i = 0; + + if (t2p != NULL) { + if(t2p->pdf_xrefoffsets != NULL){ + _TIFFfree( (tdata_t) t2p->pdf_xrefoffsets); + } + if(t2p->tiff_pages != NULL){ + _TIFFfree( (tdata_t) t2p->tiff_pages); + } + for(i=0;itiff_pagecount;i++){ + if(t2p->tiff_tiles[i].tiles_tiles != NULL){ + _TIFFfree( (tdata_t) t2p->tiff_tiles[i].tiles_tiles); + } + } + if(t2p->tiff_tiles != NULL){ + _TIFFfree( (tdata_t) t2p->tiff_tiles); + } + if(t2p->pdf_palette != NULL){ + _TIFFfree( (tdata_t) t2p->pdf_palette); + } +#ifdef OJPEG_SUPPORT + if(t2p->pdf_ojpegdata != NULL){ + _TIFFfree( (tdata_t) t2p->pdf_ojpegdata); + } +#endif + _TIFFfree( (tdata_t) t2p ); + } + + return; +} + +/* + This function validates the values of a T2P context struct pointer + before calling t2p_write_pdf with it. +*/ + +void t2p_validate(T2P* t2p){ + +#ifdef JPEG_SUPPORT + if(t2p->pdf_defaultcompression==T2P_COMPRESS_JPEG){ + if(t2p->pdf_defaultcompressionquality>100 || + t2p->pdf_defaultcompressionquality<1){ + t2p->pdf_defaultcompressionquality=0; + } + } +#endif +#ifdef ZIP_SUPPORT + if(t2p->pdf_defaultcompression==T2P_COMPRESS_ZIP){ + uint16 m=t2p->pdf_defaultcompressionquality%100; + if(t2p->pdf_defaultcompressionquality/100 > 9 || + (m>1 && m<10) || m>15){ + t2p->pdf_defaultcompressionquality=0; + } + if(t2p->pdf_defaultcompressionquality%100 !=0){ + t2p->pdf_defaultcompressionquality/=100; + t2p->pdf_defaultcompressionquality*=100; + TIFFError( + TIFF2PDF_MODULE, + "PNG Group predictor differencing not implemented, assuming compression quality %u", + t2p->pdf_defaultcompressionquality); + } + t2p->pdf_defaultcompressionquality%=100; + if(t2p->pdf_minorversion<2){t2p->pdf_minorversion=2;} + } +#endif + (void)0; + + return; +} + + +/* + This function scans the input TIFF file for pages. It attempts + to determine which IFD's of the TIFF file contain image document + pages. For each, it gathers some information that has to do + with the output of the PDF document as a whole. +*/ + +void t2p_read_tiff_init(T2P* t2p, TIFF* input){ + + tdir_t directorycount=0; + tdir_t i=0; + uint16 pagen=0; + uint16 paged=0; + uint16 xuint16=0; + + directorycount=TIFFNumberOfDirectories(input); + t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(directorycount * sizeof(T2P_PAGE)); + if(t2p->tiff_pages==NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for tiff_pages array, %s", + (unsigned long) directorycount * sizeof(T2P_PAGE), + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + _TIFFmemset( t2p->tiff_pages, 0x00, directorycount * sizeof(T2P_PAGE)); + t2p->tiff_tiles = (T2P_TILES*) _TIFFmalloc(directorycount * sizeof(T2P_TILES)); + if(t2p->tiff_tiles==NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for tiff_tiles array, %s", + (unsigned long) directorycount * sizeof(T2P_TILES), + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + _TIFFmemset( t2p->tiff_tiles, 0x00, directorycount * sizeof(T2P_TILES)); + for(i=0;it2p_error = T2P_ERR_ERROR; + return; + } + if(TIFFGetField(input, TIFFTAG_PAGENUMBER, &pagen, &paged)){ + if((pagen>paged) && (paged != 0)){ + t2p->tiff_pages[t2p->tiff_pagecount].page_number = + paged; + } else { + t2p->tiff_pages[t2p->tiff_pagecount].page_number = + pagen; + } + goto ispage2; + } + if(TIFFGetField(input, TIFFTAG_SUBFILETYPE, &subfiletype)){ + if ( ((subfiletype & FILETYPE_PAGE) != 0) + || (subfiletype == 0)){ + goto ispage; + } else { + goto isnotpage; + } + } + if(TIFFGetField(input, TIFFTAG_OSUBFILETYPE, &subfiletype)){ + if ((subfiletype == OFILETYPE_IMAGE) + || (subfiletype == OFILETYPE_PAGE) + || (subfiletype == 0) ){ + goto ispage; + } else { + goto isnotpage; + } + } + ispage: + t2p->tiff_pages[t2p->tiff_pagecount].page_number=t2p->tiff_pagecount; + ispage2: + t2p->tiff_pages[t2p->tiff_pagecount].page_directory=i; + if(TIFFIsTiled(input)){ + t2p->tiff_pages[t2p->tiff_pagecount].page_tilecount = + TIFFNumberOfTiles(input); + } + t2p->tiff_pagecount++; + isnotpage: + (void)0; + } + + qsort((void*) t2p->tiff_pages, t2p->tiff_pagecount, + sizeof(T2P_PAGE), t2p_cmp_t2p_page); + + for(i=0;itiff_pagecount;i++){ + t2p->pdf_xrefcount += 5; + TIFFSetDirectory(input, t2p->tiff_pages[i].page_directory ); + if((TIFFGetField(input, TIFFTAG_PHOTOMETRIC, &xuint16) + && (xuint16==PHOTOMETRIC_PALETTE)) + || TIFFGetField(input, TIFFTAG_INDEXED, &xuint16)) { + t2p->tiff_pages[i].page_extra++; + t2p->pdf_xrefcount++; + } +#ifdef ZIP_SUPPORT + if (TIFFGetField(input, TIFFTAG_COMPRESSION, &xuint16)) { + if( (xuint16== COMPRESSION_DEFLATE || + xuint16== COMPRESSION_ADOBE_DEFLATE) && + ((t2p->tiff_pages[i].page_tilecount != 0) + || TIFFNumberOfStrips(input)==1) && + (t2p->pdf_nopassthrough==0) ){ + if(t2p->pdf_minorversion<2){t2p->pdf_minorversion=2;} + } + } +#endif + if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION, + &(t2p->tiff_transferfunction[0]), + &(t2p->tiff_transferfunction[1]), + &(t2p->tiff_transferfunction[2]))) { + if(t2p->tiff_transferfunction[1] != + t2p->tiff_transferfunction[0]) { + t2p->tiff_transferfunctioncount = 3; + t2p->tiff_pages[i].page_extra += 4; + t2p->pdf_xrefcount += 4; + } else { + t2p->tiff_transferfunctioncount = 1; + t2p->tiff_pages[i].page_extra += 2; + t2p->pdf_xrefcount += 2; + } + if(t2p->pdf_minorversion < 2) + t2p->pdf_minorversion = 2; + } else { + t2p->tiff_transferfunctioncount=0; + } + if( TIFFGetField( + input, + TIFFTAG_ICCPROFILE, + &(t2p->tiff_iccprofilelength), + &(t2p->tiff_iccprofile)) != 0){ + t2p->tiff_pages[i].page_extra++; + t2p->pdf_xrefcount++; + if(t2p->pdf_minorversion<3){t2p->pdf_minorversion=3;} + } + t2p->tiff_tiles[i].tiles_tilecount= + t2p->tiff_pages[i].page_tilecount; + if( (TIFFGetField(input, TIFFTAG_PLANARCONFIG, &xuint16) != 0) + && (xuint16 == PLANARCONFIG_SEPARATE ) ){ + TIFFGetField(input, TIFFTAG_SAMPLESPERPIXEL, &xuint16); + t2p->tiff_tiles[i].tiles_tilecount/= xuint16; + } + if( t2p->tiff_tiles[i].tiles_tilecount > 0){ + t2p->pdf_xrefcount += + (t2p->tiff_tiles[i].tiles_tilecount -1)*2; + TIFFGetField(input, + TIFFTAG_TILEWIDTH, + &( t2p->tiff_tiles[i].tiles_tilewidth) ); + TIFFGetField(input, + TIFFTAG_TILELENGTH, + &( t2p->tiff_tiles[i].tiles_tilelength) ); + t2p->tiff_tiles[i].tiles_tiles = + (T2P_TILE*) _TIFFmalloc( + t2p->tiff_tiles[i].tiles_tilecount + * sizeof(T2P_TILE) ); + if( t2p->tiff_tiles[i].tiles_tiles == NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_read_tiff_init, %s", + (unsigned long) t2p->tiff_tiles[i].tiles_tilecount * sizeof(T2P_TILE), + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + } + } + + return; +} + +/* + * This function is used by qsort to sort a T2P_PAGE* array of page structures + * by page number. + */ + +int t2p_cmp_t2p_page(const void* e1, const void* e2){ + + return( ((T2P_PAGE*)e1)->page_number - ((T2P_PAGE*)e2)->page_number ); +} + +/* + This function sets the input directory to the directory of a given + page and determines information about the image. It checks + the image characteristics to determine if it is possible to convert + the image data into a page of PDF output, setting values of the T2P + struct for this page. It determines what color space is used in + the output PDF to represent the image. + + It determines if the image can be converted as raw data without + requiring transcoding of the image data. +*/ + +void t2p_read_tiff_data(T2P* t2p, TIFF* input){ + + int i=0; + uint16* r; + uint16* g; + uint16* b; + uint16* a; + uint16 xuint16; + uint16* xuint16p; + float* xfloatp; + + t2p->pdf_transcode = T2P_TRANSCODE_ENCODE; + t2p->pdf_sample = T2P_SAMPLE_NOTHING; + t2p->pdf_switchdecode = t2p->pdf_colorspace_invert; + + + TIFFSetDirectory(input, t2p->tiff_pages[t2p->pdf_page].page_directory); + + TIFFGetField(input, TIFFTAG_IMAGEWIDTH, &(t2p->tiff_width)); + if(t2p->tiff_width == 0){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with zero width", + TIFFFileName(input) ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + + TIFFGetField(input, TIFFTAG_IMAGELENGTH, &(t2p->tiff_length)); + if(t2p->tiff_length == 0){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with zero length", + TIFFFileName(input) ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + + if(TIFFGetField(input, TIFFTAG_COMPRESSION, &(t2p->tiff_compression)) == 0){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with no compression tag", + TIFFFileName(input) ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + + } + if( TIFFIsCODECConfigured(t2p->tiff_compression) == 0){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with compression type %u: not configured", + TIFFFileName(input), + t2p->tiff_compression + ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + + } + + TIFFGetFieldDefaulted(input, TIFFTAG_BITSPERSAMPLE, &(t2p->tiff_bitspersample)); + switch(t2p->tiff_bitspersample){ + case 1: + case 2: + case 4: + case 8: + break; + case 0: + TIFFWarning( + TIFF2PDF_MODULE, + "Image %s has 0 bits per sample, assuming 1", + TIFFFileName(input)); + t2p->tiff_bitspersample=1; + break; + default: + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with %u bits per sample", + TIFFFileName(input), + t2p->tiff_bitspersample); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + + TIFFGetFieldDefaulted(input, TIFFTAG_SAMPLESPERPIXEL, &(t2p->tiff_samplesperpixel)); + if(t2p->tiff_samplesperpixel>4){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with %u samples per pixel", + TIFFFileName(input), + t2p->tiff_samplesperpixel); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + if(t2p->tiff_samplesperpixel==0){ + TIFFWarning( + TIFF2PDF_MODULE, + "Image %s has 0 samples per pixel, assuming 1", + TIFFFileName(input)); + t2p->tiff_samplesperpixel=1; + } + + if(TIFFGetField(input, TIFFTAG_SAMPLEFORMAT, &xuint16) != 0 ){ + switch(xuint16){ + case 0: + case 1: + case 4: + break; + default: + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with sample format %u", + TIFFFileName(input), + xuint16); + t2p->t2p_error = T2P_ERR_ERROR; + return; + break; + } + } + + TIFFGetFieldDefaulted(input, TIFFTAG_FILLORDER, &(t2p->tiff_fillorder)); + + if(TIFFGetField(input, TIFFTAG_PHOTOMETRIC, &(t2p->tiff_photometric)) == 0){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with no photometric interpretation tag", + TIFFFileName(input) ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + + } + + switch(t2p->tiff_photometric){ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + if (t2p->tiff_bitspersample==1){ + t2p->pdf_colorspace=T2P_CS_BILEVEL; + if(t2p->tiff_photometric==PHOTOMETRIC_MINISWHITE){ + t2p->pdf_switchdecode ^= 1; + } + } else { + t2p->pdf_colorspace=T2P_CS_GRAY; + if(t2p->tiff_photometric==PHOTOMETRIC_MINISWHITE){ + t2p->pdf_switchdecode ^= 1; + } + } + break; + case PHOTOMETRIC_RGB: + t2p->pdf_colorspace=T2P_CS_RGB; + if(t2p->tiff_samplesperpixel == 3){ + break; + } + if(TIFFGetField(input, TIFFTAG_INDEXED, &xuint16)){ + if(xuint16==1) + goto photometric_palette; + } + if(t2p->tiff_samplesperpixel > 3) { + if(t2p->tiff_samplesperpixel == 4) { + t2p->pdf_colorspace = T2P_CS_RGB; + if(TIFFGetField(input, + TIFFTAG_EXTRASAMPLES, + &xuint16, &xuint16p) + && xuint16 == 1) { + if(xuint16p[0] == EXTRASAMPLE_ASSOCALPHA){ + t2p->pdf_sample=T2P_SAMPLE_RGBAA_TO_RGB; + break; + } + if(xuint16p[0] == EXTRASAMPLE_UNASSALPHA){ + t2p->pdf_sample=T2P_SAMPLE_RGBA_TO_RGB; + break; + } + TIFFWarning( + TIFF2PDF_MODULE, + "RGB image %s has 4 samples per pixel, assuming RGBA", + TIFFFileName(input)); + break; + } + t2p->pdf_colorspace=T2P_CS_CMYK; + t2p->pdf_switchdecode ^= 1; + TIFFWarning( + TIFF2PDF_MODULE, + "RGB image %s has 4 samples per pixel, assuming inverse CMYK", + TIFFFileName(input)); + break; + } else { + TIFFError( + TIFF2PDF_MODULE, + "No support for RGB image %s with %u samples per pixel", + TIFFFileName(input), + t2p->tiff_samplesperpixel); + t2p->t2p_error = T2P_ERR_ERROR; + break; + } + } else { + TIFFError( + TIFF2PDF_MODULE, + "No support for RGB image %s with %u samples per pixel", + TIFFFileName(input), + t2p->tiff_samplesperpixel); + t2p->t2p_error = T2P_ERR_ERROR; + break; + } + case PHOTOMETRIC_PALETTE: + photometric_palette: + if(t2p->tiff_samplesperpixel!=1){ + TIFFError( + TIFF2PDF_MODULE, + "No support for palettized image %s with not one sample per pixel", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + t2p->pdf_colorspace=T2P_CS_RGB | T2P_CS_PALETTE; + t2p->pdf_palettesize=0x0001<tiff_bitspersample; + if(!TIFFGetField(input, TIFFTAG_COLORMAP, &r, &g, &b)){ + TIFFError( + TIFF2PDF_MODULE, + "Palettized image %s has no color map", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + if(t2p->pdf_palette != NULL){ + _TIFFfree(t2p->pdf_palette); + t2p->pdf_palette=NULL; + } + t2p->pdf_palette = (unsigned char*) + _TIFFmalloc(t2p->pdf_palettesize*3); + if(t2p->pdf_palette==NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %u bytes of memory for t2p_read_tiff_image, %s", + t2p->pdf_palettesize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + for(i=0;ipdf_palettesize;i++){ + t2p->pdf_palette[(i*3)] = (unsigned char) (r[i]>>8); + t2p->pdf_palette[(i*3)+1]= (unsigned char) (g[i]>>8); + t2p->pdf_palette[(i*3)+2]= (unsigned char) (b[i]>>8); + } + t2p->pdf_palettesize *= 3; + break; + case PHOTOMETRIC_SEPARATED: + if(TIFFGetField(input, TIFFTAG_INDEXED, &xuint16)){ + if(xuint16==1){ + goto photometric_palette_cmyk; + } + } + if( TIFFGetField(input, TIFFTAG_INKSET, &xuint16) ){ + if(xuint16 != INKSET_CMYK){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s because its inkset is not CMYK", + TIFFFileName(input) ); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + } + if(t2p->tiff_samplesperpixel==4){ + t2p->pdf_colorspace=T2P_CS_CMYK; + } else { + TIFFError( + TIFF2PDF_MODULE, + "No support for %s because it has %u samples per pixel", + TIFFFileName(input), + t2p->tiff_samplesperpixel); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + break; + photometric_palette_cmyk: + if(t2p->tiff_samplesperpixel!=1){ + TIFFError( + TIFF2PDF_MODULE, + "No support for palettized CMYK image %s with not one sample per pixel", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + t2p->pdf_colorspace=T2P_CS_CMYK | T2P_CS_PALETTE; + t2p->pdf_palettesize=0x0001<tiff_bitspersample; + if(!TIFFGetField(input, TIFFTAG_COLORMAP, &r, &g, &b, &a)){ + TIFFError( + TIFF2PDF_MODULE, + "Palettized image %s has no color map", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + if(t2p->pdf_palette != NULL){ + _TIFFfree(t2p->pdf_palette); + t2p->pdf_palette=NULL; + } + t2p->pdf_palette = (unsigned char*) + _TIFFmalloc(t2p->pdf_palettesize*4); + if(t2p->pdf_palette==NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %u bytes of memory for t2p_read_tiff_image, %s", + t2p->pdf_palettesize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + for(i=0;ipdf_palettesize;i++){ + t2p->pdf_palette[(i*4)] = (unsigned char) (r[i]>>8); + t2p->pdf_palette[(i*4)+1]= (unsigned char) (g[i]>>8); + t2p->pdf_palette[(i*4)+2]= (unsigned char) (b[i]>>8); + t2p->pdf_palette[(i*4)+3]= (unsigned char) (a[i]>>8); + } + t2p->pdf_palettesize *= 4; + break; + case PHOTOMETRIC_YCBCR: + t2p->pdf_colorspace=T2P_CS_RGB; + if(t2p->tiff_samplesperpixel==1){ + t2p->pdf_colorspace=T2P_CS_GRAY; + t2p->tiff_photometric=PHOTOMETRIC_MINISBLACK; + break; + } + t2p->pdf_sample=T2P_SAMPLE_YCBCR_TO_RGB; +#ifdef JPEG_SUPPORT + if(t2p->pdf_defaultcompression==T2P_COMPRESS_JPEG){ + t2p->pdf_sample=T2P_SAMPLE_NOTHING; + } +#endif + break; + case PHOTOMETRIC_CIELAB: + t2p->pdf_labrange[0]= -127; + t2p->pdf_labrange[1]= 127; + t2p->pdf_labrange[2]= -127; + t2p->pdf_labrange[3]= 127; + t2p->pdf_sample=T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED; + t2p->pdf_colorspace=T2P_CS_LAB; + break; + case PHOTOMETRIC_ICCLAB: + t2p->pdf_labrange[0]= 0; + t2p->pdf_labrange[1]= 255; + t2p->pdf_labrange[2]= 0; + t2p->pdf_labrange[3]= 255; + t2p->pdf_colorspace=T2P_CS_LAB; + break; + case PHOTOMETRIC_ITULAB: + t2p->pdf_labrange[0]=-85; + t2p->pdf_labrange[1]=85; + t2p->pdf_labrange[2]=-75; + t2p->pdf_labrange[3]=124; + t2p->pdf_sample=T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED; + t2p->pdf_colorspace=T2P_CS_LAB; + break; + case PHOTOMETRIC_LOGL: + case PHOTOMETRIC_LOGLUV: + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with photometric interpretation LogL/LogLuv", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + default: + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with photometric interpretation %u", + TIFFFileName(input), + t2p->tiff_photometric); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + + if(TIFFGetField(input, TIFFTAG_PLANARCONFIG, &(t2p->tiff_planar))){ + switch(t2p->tiff_planar){ + case 0: + TIFFWarning( + TIFF2PDF_MODULE, + "Image %s has planar configuration 0, assuming 1", + TIFFFileName(input)); + t2p->tiff_planar=PLANARCONFIG_CONTIG; + case PLANARCONFIG_CONTIG: + break; + case PLANARCONFIG_SEPARATE: + t2p->pdf_sample=T2P_SAMPLE_PLANAR_SEPARATE_TO_CONTIG; + if(t2p->tiff_bitspersample!=8){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with separated planar configuration and %u bits per sample", + TIFFFileName(input), + t2p->tiff_bitspersample); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + break; + default: + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with planar configuration %u", + TIFFFileName(input), + t2p->tiff_planar); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + } + + TIFFGetFieldDefaulted(input, TIFFTAG_ORIENTATION, + &(t2p->tiff_orientation)); + if(t2p->tiff_orientation>8){ + TIFFWarning(TIFF2PDF_MODULE, + "Image %s has orientation %u, assuming 0", + TIFFFileName(input), t2p->tiff_orientation); + t2p->tiff_orientation=0; + } + + if(TIFFGetField(input, TIFFTAG_XRESOLUTION, &(t2p->tiff_xres) ) == 0){ + t2p->tiff_xres=0.0; + } + if(TIFFGetField(input, TIFFTAG_YRESOLUTION, &(t2p->tiff_yres) ) == 0){ + t2p->tiff_yres=0.0; + } + TIFFGetFieldDefaulted(input, TIFFTAG_RESOLUTIONUNIT, + &(t2p->tiff_resunit)); + if(t2p->tiff_resunit == RESUNIT_CENTIMETER) { + t2p->tiff_xres *= 2.54F; + t2p->tiff_yres *= 2.54F; + } else if (t2p->tiff_resunit != RESUNIT_INCH + && t2p->pdf_centimeters != 0) { + t2p->tiff_xres *= 2.54F; + t2p->tiff_yres *= 2.54F; + } + + t2p_compose_pdf_page(t2p); + + t2p->pdf_transcode = T2P_TRANSCODE_ENCODE; + if(t2p->pdf_nopassthrough==0){ +#ifdef CCITT_SUPPORT + if(t2p->tiff_compression==COMPRESSION_CCITTFAX4 + ){ + if(TIFFIsTiled(input) || (TIFFNumberOfStrips(input)==1) ){ + t2p->pdf_transcode = T2P_TRANSCODE_RAW; + t2p->pdf_compression=T2P_COMPRESS_G4; + } + } +#endif +#ifdef ZIP_SUPPORT + if(t2p->tiff_compression== COMPRESSION_ADOBE_DEFLATE + || t2p->tiff_compression==COMPRESSION_DEFLATE){ + if(TIFFIsTiled(input) || (TIFFNumberOfStrips(input)==1) ){ + t2p->pdf_transcode = T2P_TRANSCODE_RAW; + t2p->pdf_compression=T2P_COMPRESS_ZIP; + } + } +#endif +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression==COMPRESSION_OJPEG){ + t2p->pdf_transcode = T2P_TRANSCODE_RAW; + t2p->pdf_compression=T2P_COMPRESS_JPEG; + t2p_process_ojpeg_tables(t2p, input); + } +#endif +#ifdef JPEG_SUPPORT + if(t2p->tiff_compression==COMPRESSION_JPEG){ + t2p->pdf_transcode = T2P_TRANSCODE_RAW; + t2p->pdf_compression=T2P_COMPRESS_JPEG; + } +#endif + (void)0; + } + + if(t2p->pdf_transcode!=T2P_TRANSCODE_RAW){ + t2p->pdf_compression = t2p->pdf_defaultcompression; + } + +#ifdef JPEG_SUPPORT + if(t2p->pdf_defaultcompression==T2P_COMPRESS_JPEG){ + if(t2p->pdf_colorspace & T2P_CS_PALETTE){ + t2p->pdf_sample|=T2P_SAMPLE_REALIZE_PALETTE; + t2p->pdf_colorspace ^= T2P_CS_PALETTE; + t2p->tiff_pages[t2p->pdf_page].page_extra--; + } + } + if(t2p->tiff_compression==COMPRESSION_JPEG){ + if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with JPEG compression and separated planar configuration", + TIFFFileName(input)); + t2p->t2p_error=T2P_ERR_ERROR; + return; + } + } +#endif +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression==COMPRESSION_OJPEG){ + if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){ + TIFFError( + TIFF2PDF_MODULE, + "No support for %s with OJPEG compression and separated planar configuration", + TIFFFileName(input)); + t2p->t2p_error=T2P_ERR_ERROR; + return; + } + } +#endif + + if(t2p->pdf_sample & T2P_SAMPLE_REALIZE_PALETTE){ + if(t2p->pdf_colorspace & T2P_CS_CMYK){ + t2p->tiff_samplesperpixel=4; + t2p->tiff_photometric=PHOTOMETRIC_SEPARATED; + } else { + t2p->tiff_samplesperpixel=3; + t2p->tiff_photometric=PHOTOMETRIC_RGB; + } + } + + if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION, + &(t2p->tiff_transferfunction[0]), + &(t2p->tiff_transferfunction[1]), + &(t2p->tiff_transferfunction[2]))) { + if(t2p->tiff_transferfunction[1] != + t2p->tiff_transferfunction[0]) { + t2p->tiff_transferfunctioncount=3; + } else { + t2p->tiff_transferfunctioncount=1; + } + } else { + t2p->tiff_transferfunctioncount=0; + } + if(TIFFGetField(input, TIFFTAG_WHITEPOINT, &xfloatp)!=0){ + t2p->tiff_whitechromaticities[0]=xfloatp[0]; + t2p->tiff_whitechromaticities[1]=xfloatp[1]; + if(t2p->pdf_colorspace & T2P_CS_GRAY){ + t2p->pdf_colorspace |= T2P_CS_CALGRAY; + } + if(t2p->pdf_colorspace & T2P_CS_RGB){ + t2p->pdf_colorspace |= T2P_CS_CALRGB; + } + } + if(TIFFGetField(input, TIFFTAG_PRIMARYCHROMATICITIES, &xfloatp)!=0){ + t2p->tiff_primarychromaticities[0]=xfloatp[0]; + t2p->tiff_primarychromaticities[1]=xfloatp[1]; + t2p->tiff_primarychromaticities[2]=xfloatp[2]; + t2p->tiff_primarychromaticities[3]=xfloatp[3]; + t2p->tiff_primarychromaticities[4]=xfloatp[4]; + t2p->tiff_primarychromaticities[5]=xfloatp[5]; + if(t2p->pdf_colorspace & T2P_CS_RGB){ + t2p->pdf_colorspace |= T2P_CS_CALRGB; + } + } + if(t2p->pdf_colorspace & T2P_CS_LAB){ + if(TIFFGetField(input, TIFFTAG_WHITEPOINT, &xfloatp) != 0){ + t2p->tiff_whitechromaticities[0]=xfloatp[0]; + t2p->tiff_whitechromaticities[1]=xfloatp[1]; + } else { + t2p->tiff_whitechromaticities[0]=0.3457F; /* 0.3127F; */ + t2p->tiff_whitechromaticities[1]=0.3585F; /* 0.3290F; */ + } + } + if(TIFFGetField(input, + TIFFTAG_ICCPROFILE, + &(t2p->tiff_iccprofilelength), + &(t2p->tiff_iccprofile))!=0){ + t2p->pdf_colorspace |= T2P_CS_ICCBASED; + } else { + t2p->tiff_iccprofilelength=0; + t2p->tiff_iccprofile=NULL; + } + +#ifdef CCITT_SUPPORT + if( t2p->tiff_bitspersample==1 && + t2p->tiff_samplesperpixel==1){ + t2p->pdf_compression = T2P_COMPRESS_G4; + } +#endif + + + return; +} + +/* + This function returns the necessary size of a data buffer to contain the raw or + uncompressed image data from the input TIFF for a page. +*/ + +void t2p_read_tiff_size(T2P* t2p, TIFF* input){ + + uint64* sbc=NULL; +#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT) + unsigned char* jpt=NULL; + tstrip_t i=0; + tstrip_t stripcount=0; +#endif + uint64 k = 0; + + if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){ +#ifdef CCITT_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_G4 ){ + TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc); + t2p->tiff_datasize=(tmsize_t)sbc[0]; + return; + } +#endif +#ifdef ZIP_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_ZIP){ + TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc); + t2p->tiff_datasize=(tmsize_t)sbc[0]; + return; + } +#endif +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_OJPEG){ + if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){ + TIFFError(TIFF2PDF_MODULE, + "Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + stripcount=TIFFNumberOfStrips(input); + for(i=0;itiff_dataoffset))){ + if(t2p->tiff_dataoffset != 0){ + if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){ + if((uint64)t2p->tiff_datasize < k) { + TIFFWarning(TIFF2PDF_MODULE, + "Input file %s has short JPEG interchange file byte count", + TIFFFileName(input)); + t2p->pdf_ojpegiflength=t2p->tiff_datasize; + k = checkAdd64(k, t2p->tiff_datasize, t2p); + k = checkAdd64(k, 6, t2p); + k = checkAdd64(k, stripcount, t2p); + k = checkAdd64(k, stripcount, t2p); + t2p->tiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + return; + } + return; + }else { + TIFFError(TIFF2PDF_MODULE, + "Input file %s missing field: TIFFTAG_JPEGIFBYTECOUNT", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + } + } + k = checkAdd64(k, stripcount, t2p); + k = checkAdd64(k, stripcount, t2p); + k = checkAdd64(k, 2048, t2p); + t2p->tiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + return; + } +#endif +#ifdef JPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_JPEG) { + uint32 count = 0; + if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0 ){ + if(count > 4){ + k += count; + k -= 2; /* don't use EOI of header */ + } + } else { + k = 2; /* SOI for first strip */ + } + stripcount=TIFFNumberOfStrips(input); + if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){ + TIFFError(TIFF2PDF_MODULE, + "Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } + for(i=0;itiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + return; + } +#endif + (void) 0; + } + k = checkMultiply64(TIFFScanlineSize(input), t2p->tiff_length, t2p); + if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){ + k = checkMultiply64(k, t2p->tiff_samplesperpixel, t2p); + } + if (k == 0) { + /* Assume we had overflow inside TIFFScanlineSize */ + t2p->t2p_error = T2P_ERR_ERROR; + } + + t2p->tiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + + return; +} + +/* + This function returns the necessary size of a data buffer to contain the raw or + uncompressed image data from the input TIFF for a tile of a page. +*/ + +void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){ + + uint64* tbc = NULL; + uint16 edge=0; +#ifdef JPEG_SUPPORT + unsigned char* jpt; +#endif + uint64 k; + + edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile); + edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile); + + if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){ + if(edge +#if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT) + && !(t2p->pdf_compression==T2P_COMPRESS_JPEG) +#endif + ){ + t2p->tiff_datasize=TIFFTileSize(input); + if (t2p->tiff_datasize == 0) { + /* Assume we had overflow inside TIFFTileSize */ + t2p->t2p_error = T2P_ERR_ERROR; + } + return; + } else { + TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc); + k=tbc[tile]; +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression==COMPRESSION_OJPEG){ + k = checkAdd64(k, 2048, t2p); + } +#endif +#ifdef JPEG_SUPPORT + if(t2p->tiff_compression==COMPRESSION_JPEG) { + uint32 count = 0; + if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt)!=0){ + if(count > 4){ + k = checkAdd64(k, count, t2p); + k -= 2; /* don't use EOI of header or SOI of tile */ + } + } + } +#endif + t2p->tiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + return; + } + } + k = TIFFTileSize(input); + if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){ + k = checkMultiply64(k, t2p->tiff_samplesperpixel, t2p); + } + if (k == 0) { + /* Assume we had overflow inside TIFFTileSize */ + t2p->t2p_error = T2P_ERR_ERROR; + } + + t2p->tiff_datasize = (tsize_t) k; + if ((uint64) t2p->tiff_datasize != k) { + TIFFError(TIFF2PDF_MODULE, "Integer overflow"); + t2p->t2p_error = T2P_ERR_ERROR; + } + + return; +} + +/* + * This functions returns a non-zero value when the tile is on the right edge + * and does not have full imaged tile width. + */ + +int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){ + + if( ((tile+1) % tiles.tiles_tilecountx == 0) + && (tiles.tiles_edgetilewidth != 0) ){ + return(1); + } else { + return(0); + } +} + +/* + * This functions returns a non-zero value when the tile is on the bottom edge + * and does not have full imaged tile length. + */ + +int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){ + + if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) ) + && (tiles.tiles_edgetilelength != 0) ){ + return(1); + } else { + return(0); + } +} + +/* + * This function returns a non-zero value when the tile is a right edge tile + * or a bottom edge tile. + */ + +int t2p_tile_is_edge(T2P_TILES tiles, ttile_t tile){ + + return(t2p_tile_is_right_edge(tiles, tile) | t2p_tile_is_bottom_edge(tiles, tile) ); +} + +/* + This function returns a non-zero value when the tile is a right edge tile and a bottom + edge tile. +*/ + +int t2p_tile_is_corner_edge(T2P_TILES tiles, ttile_t tile){ + + return(t2p_tile_is_right_edge(tiles, tile) & t2p_tile_is_bottom_edge(tiles, tile) ); +} + + +/* + This function reads the raster image data from the input TIFF for an image and writes + the data to the output PDF XObject image dictionary stream. It returns the amount written + or zero on error. +*/ + +tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){ + + tsize_t written=0; + unsigned char* buffer=NULL; + unsigned char* samplebuffer=NULL; + tsize_t bufferoffset=0; + tsize_t samplebufferoffset=0; + tsize_t read=0; + tstrip_t i=0; + tstrip_t j=0; + tstrip_t stripcount=0; + tsize_t stripsize=0; + tsize_t sepstripcount=0; + tsize_t sepstripsize=0; +#ifdef OJPEG_SUPPORT + toff_t inputoffset=0; + uint16 h_samp=1; + uint16 v_samp=1; + uint16 ri=1; + uint32 rows=0; +#endif +#ifdef JPEG_SUPPORT + unsigned char* jpt; + float* xfloatp; + uint64* sbc; + unsigned char* stripbuffer; + tsize_t striplength=0; + uint32 max_striplength=0; +#endif + + /* Fail if prior error (in particular, can't trust tiff_datasize) */ + if (t2p->t2p_error != T2P_ERR_OK) + return(0); + + if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){ +#ifdef CCITT_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_G4){ + buffer = (unsigned char*) + _TIFFmalloc(t2p->tiff_datasize); + if (buffer == NULL) { + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + TIFFReadRawStrip(input, 0, (tdata_t) buffer, + t2p->tiff_datasize); + if (t2p->tiff_fillorder==FILLORDER_LSB2MSB){ + /* + * make sure is lsb-to-msb + * bit-endianness fill order + */ + TIFFReverseBits(buffer, + t2p->tiff_datasize); + } + t2pWriteFile(output, (tdata_t) buffer, + t2p->tiff_datasize); + _TIFFfree(buffer); + return(t2p->tiff_datasize); + } +#endif +#ifdef ZIP_SUPPORT + if (t2p->pdf_compression == T2P_COMPRESS_ZIP) { + buffer = (unsigned char*) + _TIFFmalloc(t2p->tiff_datasize); + if(buffer == NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + TIFFReadRawStrip(input, 0, (tdata_t) buffer, + t2p->tiff_datasize); + if (t2p->tiff_fillorder==FILLORDER_LSB2MSB) { + TIFFReverseBits(buffer, + t2p->tiff_datasize); + } + t2pWriteFile(output, (tdata_t) buffer, + t2p->tiff_datasize); + _TIFFfree(buffer); + return(t2p->tiff_datasize); + } +#endif +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_OJPEG) { + + if(t2p->tiff_dataoffset != 0) { + buffer = (unsigned char*) + _TIFFmalloc(t2p->tiff_datasize); + if(buffer == NULL) { + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + if(t2p->pdf_ojpegiflength==0){ + inputoffset=t2pSeekFile(input, 0, + SEEK_CUR); + t2pSeekFile(input, + t2p->tiff_dataoffset, + SEEK_SET); + t2pReadFile(input, (tdata_t) buffer, + t2p->tiff_datasize); + t2pSeekFile(input, inputoffset, + SEEK_SET); + t2pWriteFile(output, (tdata_t) buffer, + t2p->tiff_datasize); + _TIFFfree(buffer); + return(t2p->tiff_datasize); + } else { + inputoffset=t2pSeekFile(input, 0, + SEEK_CUR); + t2pSeekFile(input, + t2p->tiff_dataoffset, + SEEK_SET); + bufferoffset = t2pReadFile(input, + (tdata_t) buffer, + t2p->pdf_ojpegiflength); + t2p->pdf_ojpegiflength = 0; + t2pSeekFile(input, inputoffset, + SEEK_SET); + TIFFGetField(input, + TIFFTAG_YCBCRSUBSAMPLING, + &h_samp, &v_samp); + buffer[bufferoffset++]= 0xff; + buffer[bufferoffset++]= 0xdd; + buffer[bufferoffset++]= 0x00; + buffer[bufferoffset++]= 0x04; + h_samp*=8; + v_samp*=8; + ri=(t2p->tiff_width+h_samp-1) / h_samp; + TIFFGetField(input, + TIFFTAG_ROWSPERSTRIP, + &rows); + ri*=(rows+v_samp-1)/v_samp; + buffer[bufferoffset++]= (ri>>8) & 0xff; + buffer[bufferoffset++]= ri & 0xff; + stripcount=TIFFNumberOfStrips(input); + for(i=0;ipdf_ojpegdata){ + TIFFError(TIFF2PDF_MODULE, + "No support for OJPEG image %s with bad tables", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + buffer = (unsigned char*) + _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + _TIFFmemcpy(buffer, t2p->pdf_ojpegdata, t2p->pdf_ojpegdatalength); + bufferoffset=t2p->pdf_ojpegdatalength; + stripcount=TIFFNumberOfStrips(input); + for(i=0;it2p_error = T2P_ERR_ERROR; + return(0); + } + return(t2p->tiff_datasize); + } +#endif +#ifdef JPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_JPEG) { + uint32 count = 0; + buffer = (unsigned char*) + _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + if (TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) { + if(count > 4) { + _TIFFmemcpy(buffer, jpt, count); + bufferoffset += count - 2; + } + } + stripcount=TIFFNumberOfStrips(input); + TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc); + for(i=0;imax_striplength) max_striplength=sbc[i]; + } + stripbuffer = (unsigned char*) + _TIFFmalloc(max_striplength); + if(stripbuffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s", + max_striplength, + TIFFFileName(input)); + _TIFFfree(buffer); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + for(i=0;itiff_length)){ + TIFFError(TIFF2PDF_MODULE, + "Can't process JPEG data in input file %s", + TIFFFileName(input)); + _TIFFfree(samplebuffer); + _TIFFfree(buffer); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + } + buffer[bufferoffset++]=0xff; + buffer[bufferoffset++]=0xd9; + t2pWriteFile(output, (tdata_t) buffer, bufferoffset); + _TIFFfree(stripbuffer); + _TIFFfree(buffer); + return(bufferoffset); + } +#endif + (void)0; + } + + if(t2p->pdf_sample==T2P_SAMPLE_NOTHING){ + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + stripsize=TIFFStripSize(input); + stripcount=TIFFNumberOfStrips(input); + for(i=0;it2p_error=T2P_ERR_ERROR; + return(0); + } + bufferoffset+=read; + } + } else { + if(t2p->pdf_sample & T2P_SAMPLE_PLANAR_SEPARATE_TO_CONTIG){ + + sepstripsize=TIFFStripSize(input); + sepstripcount=TIFFNumberOfStrips(input); + + stripsize=sepstripsize*t2p->tiff_samplesperpixel; + stripcount=sepstripcount/t2p->tiff_samplesperpixel; + + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + samplebuffer = (unsigned char*) _TIFFmalloc(stripsize); + if(samplebuffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + for(i=0;itiff_samplesperpixel;j++){ + read = + TIFFReadEncodedStrip(input, + i + j*stripcount, + (tdata_t) &(samplebuffer[samplebufferoffset]), + sepstripsize); + if(read==-1){ + TIFFError(TIFF2PDF_MODULE, + "Error on decoding strip %u of %s", + i + j*stripcount, + TIFFFileName(input)); + _TIFFfree(buffer); + t2p->t2p_error=T2P_ERR_ERROR; + return(0); + } + samplebufferoffset+=read; + } + t2p_sample_planar_separate_to_contig( + t2p, + &(buffer[bufferoffset]), + samplebuffer, + samplebufferoffset); + bufferoffset+=samplebufferoffset; + } + _TIFFfree(samplebuffer); + goto dataready; + } + + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + memset(buffer, 0, t2p->tiff_datasize); + stripsize=TIFFStripSize(input); + stripcount=TIFFNumberOfStrips(input); + for(i=0;it2p_error=T2P_ERR_ERROR; + return(0); + } + bufferoffset+=read; + } + + if(t2p->pdf_sample & T2P_SAMPLE_REALIZE_PALETTE){ + // FIXME: overflow? + samplebuffer=(unsigned char*)_TIFFrealloc( + (tdata_t) buffer, + t2p->tiff_datasize * t2p->tiff_samplesperpixel); + if(samplebuffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + _TIFFfree(buffer); + } else { + buffer=samplebuffer; + t2p->tiff_datasize *= t2p->tiff_samplesperpixel; + } + t2p_sample_realize_palette(t2p, buffer); + } + + if(t2p->pdf_sample & T2P_SAMPLE_RGBA_TO_RGB){ + t2p->tiff_datasize=t2p_sample_rgba_to_rgb( + (tdata_t)buffer, + t2p->tiff_width*t2p->tiff_length); + } + + if(t2p->pdf_sample & T2P_SAMPLE_RGBAA_TO_RGB){ + t2p->tiff_datasize=t2p_sample_rgbaa_to_rgb( + (tdata_t)buffer, + t2p->tiff_width*t2p->tiff_length); + } + + if(t2p->pdf_sample & T2P_SAMPLE_YCBCR_TO_RGB){ + samplebuffer=(unsigned char*)_TIFFrealloc( + (tdata_t)buffer, + t2p->tiff_width*t2p->tiff_length*4); + if(samplebuffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + _TIFFfree(buffer); + return(0); + } else { + buffer=samplebuffer; + } + if(!TIFFReadRGBAImageOriented( + input, + t2p->tiff_width, + t2p->tiff_length, + (uint32*)buffer, + ORIENTATION_TOPLEFT, + 0)){ + TIFFError(TIFF2PDF_MODULE, + "Can't use TIFFReadRGBAImageOriented to extract RGB image from %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + t2p->tiff_datasize=t2p_sample_abgr_to_rgb( + (tdata_t) buffer, + t2p->tiff_width*t2p->tiff_length); + + } + + if(t2p->pdf_sample & T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED){ + t2p->tiff_datasize=t2p_sample_lab_signed_to_unsigned( + (tdata_t)buffer, + t2p->tiff_width*t2p->tiff_length); + } + } + +dataready: + + t2p_disable(output); + TIFFSetField(output, TIFFTAG_PHOTOMETRIC, t2p->tiff_photometric); + TIFFSetField(output, TIFFTAG_BITSPERSAMPLE, t2p->tiff_bitspersample); + TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL, t2p->tiff_samplesperpixel); + TIFFSetField(output, TIFFTAG_IMAGEWIDTH, t2p->tiff_width); + TIFFSetField(output, TIFFTAG_IMAGELENGTH, t2p->tiff_length); + TIFFSetField(output, TIFFTAG_ROWSPERSTRIP, t2p->tiff_length); + TIFFSetField(output, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(output, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); + + switch(t2p->pdf_compression){ + case T2P_COMPRESS_NONE: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + break; +#ifdef CCITT_SUPPORT + case T2P_COMPRESS_G4: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4); + break; +#endif +#ifdef JPEG_SUPPORT + case T2P_COMPRESS_JPEG: + if(t2p->tiff_photometric==PHOTOMETRIC_YCBCR) { + uint16 hor = 0, ver = 0; + if (TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &hor, &ver) !=0 ) { + if(hor != 0 && ver != 0){ + TIFFSetField(output, TIFFTAG_YCBCRSUBSAMPLING, hor, ver); + } + } + if(TIFFGetField(input, TIFFTAG_REFERENCEBLACKWHITE, &xfloatp)!=0){ + TIFFSetField(output, TIFFTAG_REFERENCEBLACKWHITE, xfloatp); + } + } + if(TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_JPEG)==0){ + TIFFError(TIFF2PDF_MODULE, + "Unable to use JPEG compression for input %s and output %s", + TIFFFileName(input), + TIFFFileName(output)); + _TIFFfree(buffer); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + TIFFSetField(output, TIFFTAG_JPEGTABLESMODE, 0); + + if(t2p->pdf_colorspace & (T2P_CS_RGB | T2P_CS_LAB)){ + TIFFSetField(output, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR){ + TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } else { + TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW); + } + } + if(t2p->pdf_colorspace & T2P_CS_GRAY){ + (void)0; + } + if(t2p->pdf_colorspace & T2P_CS_CMYK){ + (void)0; + } + if(t2p->pdf_defaultcompressionquality != 0){ + TIFFSetField(output, + TIFFTAG_JPEGQUALITY, + t2p->pdf_defaultcompressionquality); + } + + break; +#endif +#ifdef ZIP_SUPPORT + case T2P_COMPRESS_ZIP: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE); + if(t2p->pdf_defaultcompressionquality%100 != 0){ + TIFFSetField(output, + TIFFTAG_PREDICTOR, + t2p->pdf_defaultcompressionquality % 100); + } + if(t2p->pdf_defaultcompressionquality/100 != 0){ + TIFFSetField(output, + TIFFTAG_ZIPQUALITY, + (t2p->pdf_defaultcompressionquality / 100)); + } + break; +#endif + default: + break; + } + + t2p_enable(output); + t2p->outputwritten = 0; +#ifdef JPEG_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_JPEG + && t2p->tiff_photometric == PHOTOMETRIC_YCBCR){ + bufferoffset = TIFFWriteEncodedStrip(output, (tstrip_t)0, + buffer, + stripsize * stripcount); + } else +#endif + { + bufferoffset = TIFFWriteEncodedStrip(output, (tstrip_t)0, + buffer, + t2p->tiff_datasize); + } + if (buffer != NULL) { + _TIFFfree(buffer); + buffer=NULL; + } + + if (bufferoffset == (tsize_t)-1) { + TIFFError(TIFF2PDF_MODULE, + "Error writing encoded strip to output PDF %s", + TIFFFileName(output)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + + written = t2p->outputwritten; + return(written); +} + +/* + * This function reads the raster image data from the input TIFF for an image + * tile and writes the data to the output PDF XObject image dictionary stream + * for the tile. It returns the amount written or zero on error. + */ + +tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){ + + uint16 edge=0; + tsize_t written=0; + unsigned char* buffer=NULL; + tsize_t bufferoffset=0; + unsigned char* samplebuffer=NULL; + tsize_t samplebufferoffset=0; + tsize_t read=0; + uint16 i=0; + ttile_t tilecount=0; + tsize_t tilesize=0; + ttile_t septilecount=0; + tsize_t septilesize=0; +#ifdef JPEG_SUPPORT + unsigned char* jpt; + float* xfloatp; + uint32 xuint32=0; +#endif + + /* Fail if prior error (in particular, can't trust tiff_datasize) */ + if (t2p->t2p_error != T2P_ERR_OK) + return(0); + + edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile); + edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile); + + if( (t2p->pdf_transcode == T2P_TRANSCODE_RAW) && ((edge == 0) +#if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT) + || (t2p->pdf_compression == T2P_COMPRESS_JPEG) +#endif + ) + ){ +#ifdef CCITT_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_G4){ + buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + TIFFReadRawTile(input, tile, (tdata_t) buffer, t2p->tiff_datasize); + if (t2p->tiff_fillorder==FILLORDER_LSB2MSB){ + TIFFReverseBits(buffer, t2p->tiff_datasize); + } + t2pWriteFile(output, (tdata_t) buffer, t2p->tiff_datasize); + _TIFFfree(buffer); + return(t2p->tiff_datasize); + } +#endif +#ifdef ZIP_SUPPORT + if(t2p->pdf_compression == T2P_COMPRESS_ZIP){ + buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + TIFFReadRawTile(input, tile, (tdata_t) buffer, t2p->tiff_datasize); + if (t2p->tiff_fillorder==FILLORDER_LSB2MSB){ + TIFFReverseBits(buffer, t2p->tiff_datasize); + } + t2pWriteFile(output, (tdata_t) buffer, t2p->tiff_datasize); + _TIFFfree(buffer); + return(t2p->tiff_datasize); + } +#endif +#ifdef OJPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_OJPEG){ + if(! t2p->pdf_ojpegdata){ + TIFFError(TIFF2PDF_MODULE, + "No support for OJPEG image %s with " + "bad tables", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + _TIFFmemcpy(buffer, t2p->pdf_ojpegdata, t2p->pdf_ojpegdatalength); + if(edge!=0){ + if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile)){ + buffer[7]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength >> 8) & 0xff; + buffer[8]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength ) & 0xff; + } + if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile)){ + buffer[9]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth >> 8) & 0xff; + buffer[10]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth ) & 0xff; + } + } + bufferoffset=t2p->pdf_ojpegdatalength; + bufferoffset+=TIFFReadRawTile(input, + tile, + (tdata_t) &(((unsigned char*)buffer)[bufferoffset]), + -1); + ((unsigned char*)buffer)[bufferoffset++]=0xff; + ((unsigned char*)buffer)[bufferoffset++]=0xd9; + t2pWriteFile(output, (tdata_t) buffer, bufferoffset); + _TIFFfree(buffer); + return(bufferoffset); + } +#endif +#ifdef JPEG_SUPPORT + if(t2p->tiff_compression == COMPRESSION_JPEG){ + unsigned char table_end[2]; + uint32 count = 0; + buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0) { + if (count > 0) { + _TIFFmemcpy(buffer, jpt, count); + bufferoffset += count - 2; + table_end[0] = buffer[bufferoffset-2]; + table_end[1] = buffer[bufferoffset-1]; + } + if (count > 0) { + xuint32 = bufferoffset; + bufferoffset += TIFFReadRawTile( + input, + tile, + (tdata_t) &(((unsigned char*)buffer)[bufferoffset-2]), + -1); + buffer[xuint32-2]=table_end[0]; + buffer[xuint32-1]=table_end[1]; + } else { + bufferoffset += TIFFReadRawTile( + input, + tile, + (tdata_t) &(((unsigned char*)buffer)[bufferoffset]), + -1); + } + } + t2pWriteFile(output, (tdata_t) buffer, bufferoffset); + _TIFFfree(buffer); + return(bufferoffset); + } +#endif + (void)0; + } + + if(t2p->pdf_sample==T2P_SAMPLE_NOTHING){ + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory for " + "t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + + read = TIFFReadEncodedTile( + input, + tile, + (tdata_t) &buffer[bufferoffset], + t2p->tiff_datasize); + if(read==-1){ + TIFFError(TIFF2PDF_MODULE, + "Error on decoding tile %u of %s", + tile, + TIFFFileName(input)); + _TIFFfree(buffer); + t2p->t2p_error=T2P_ERR_ERROR; + return(0); + } + + } else { + + if(t2p->pdf_sample == T2P_SAMPLE_PLANAR_SEPARATE_TO_CONTIG){ + septilesize=TIFFTileSize(input); + septilecount=TIFFNumberOfTiles(input); + tilesize=septilesize*t2p->tiff_samplesperpixel; + tilecount=septilecount/t2p->tiff_samplesperpixel; + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + samplebuffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(samplebuffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + samplebufferoffset=0; + for(i=0;itiff_samplesperpixel;i++){ + read = + TIFFReadEncodedTile(input, + tile + i*tilecount, + (tdata_t) &(samplebuffer[samplebufferoffset]), + septilesize); + if(read==-1){ + TIFFError(TIFF2PDF_MODULE, + "Error on decoding tile %u of %s", + tile + i*tilecount, + TIFFFileName(input)); + _TIFFfree(samplebuffer); + _TIFFfree(buffer); + t2p->t2p_error=T2P_ERR_ERROR; + return(0); + } + samplebufferoffset+=read; + } + t2p_sample_planar_separate_to_contig( + t2p, + &(buffer[bufferoffset]), + samplebuffer, + samplebufferoffset); + bufferoffset+=samplebufferoffset; + _TIFFfree(samplebuffer); + } + + if(buffer==NULL){ + buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize); + if(buffer==NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %lu bytes of memory " + "for t2p_readwrite_pdf_image_tile, %s", + (unsigned long) t2p->tiff_datasize, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + read = TIFFReadEncodedTile( + input, + tile, + (tdata_t) &buffer[bufferoffset], + t2p->tiff_datasize); + if(read==-1){ + TIFFError(TIFF2PDF_MODULE, + "Error on decoding tile %u of %s", + tile, + TIFFFileName(input)); + _TIFFfree(buffer); + t2p->t2p_error=T2P_ERR_ERROR; + return(0); + } + } + + if(t2p->pdf_sample & T2P_SAMPLE_RGBA_TO_RGB){ + t2p->tiff_datasize=t2p_sample_rgba_to_rgb( + (tdata_t)buffer, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth + *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } + + if(t2p->pdf_sample & T2P_SAMPLE_RGBAA_TO_RGB){ + t2p->tiff_datasize=t2p_sample_rgbaa_to_rgb( + (tdata_t)buffer, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth + *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } + + if(t2p->pdf_sample & T2P_SAMPLE_YCBCR_TO_RGB){ + TIFFError(TIFF2PDF_MODULE, + "No support for YCbCr to RGB in tile for %s", + TIFFFileName(input)); + _TIFFfree(buffer); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + + if(t2p->pdf_sample & T2P_SAMPLE_LAB_SIGNED_TO_UNSIGNED){ + t2p->tiff_datasize=t2p_sample_lab_signed_to_unsigned( + (tdata_t)buffer, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth + *t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } + } + + if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) != 0){ + t2p_tile_collapse_left( + buffer, + TIFFTileRowSize(input), + t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth, + t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } + + + t2p_disable(output); + TIFFSetField(output, TIFFTAG_PHOTOMETRIC, t2p->tiff_photometric); + TIFFSetField(output, TIFFTAG_BITSPERSAMPLE, t2p->tiff_bitspersample); + TIFFSetField(output, TIFFTAG_SAMPLESPERPIXEL, t2p->tiff_samplesperpixel); + if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) == 0){ + TIFFSetField( + output, + TIFFTAG_IMAGEWIDTH, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); + } else { + TIFFSetField( + output, + TIFFTAG_IMAGEWIDTH, + t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); + } + if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile) == 0){ + TIFFSetField( + output, + TIFFTAG_IMAGELENGTH, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + TIFFSetField( + output, + TIFFTAG_ROWSPERSTRIP, + t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } else { + TIFFSetField( + output, + TIFFTAG_IMAGELENGTH, + t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); + TIFFSetField( + output, + TIFFTAG_ROWSPERSTRIP, + t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); + } + TIFFSetField(output, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(output, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); + + switch(t2p->pdf_compression){ + case T2P_COMPRESS_NONE: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + break; +#ifdef CCITT_SUPPORT + case T2P_COMPRESS_G4: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4); + break; +#endif +#ifdef JPEG_SUPPORT + case T2P_COMPRESS_JPEG: + if (t2p->tiff_photometric==PHOTOMETRIC_YCBCR) { + uint16 hor = 0, ver = 0; + if (TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &hor, &ver)!=0) { + if (hor != 0 && ver != 0) { + TIFFSetField(output, TIFFTAG_YCBCRSUBSAMPLING, hor, ver); + } + } + if(TIFFGetField(input, TIFFTAG_REFERENCEBLACKWHITE, &xfloatp)!=0){ + TIFFSetField(output, TIFFTAG_REFERENCEBLACKWHITE, xfloatp); + } + } + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_JPEG); + TIFFSetField(output, TIFFTAG_JPEGTABLESMODE, 0); /* JPEGTABLESMODE_NONE */ + if(t2p->pdf_colorspace & (T2P_CS_RGB | T2P_CS_LAB)){ + TIFFSetField(output, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR){ + TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } else { + TIFFSetField(output, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RAW); + } + } + if(t2p->pdf_colorspace & T2P_CS_GRAY){ + (void)0; + } + if(t2p->pdf_colorspace & T2P_CS_CMYK){ + (void)0; + } + if(t2p->pdf_defaultcompressionquality != 0){ + TIFFSetField(output, + TIFFTAG_JPEGQUALITY, + t2p->pdf_defaultcompressionquality); + } + break; +#endif +#ifdef ZIP_SUPPORT + case T2P_COMPRESS_ZIP: + TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE); + if(t2p->pdf_defaultcompressionquality%100 != 0){ + TIFFSetField(output, + TIFFTAG_PREDICTOR, + t2p->pdf_defaultcompressionquality % 100); + } + if(t2p->pdf_defaultcompressionquality/100 != 0){ + TIFFSetField(output, + TIFFTAG_ZIPQUALITY, + (t2p->pdf_defaultcompressionquality / 100)); + } + break; +#endif + default: + break; + } + + t2p_enable(output); + t2p->outputwritten = 0; + bufferoffset = TIFFWriteEncodedStrip(output, (tstrip_t) 0, buffer, + TIFFStripSize(output)); + if (buffer != NULL) { + _TIFFfree(buffer); + buffer = NULL; + } + if (bufferoffset == -1) { + TIFFError(TIFF2PDF_MODULE, + "Error writing encoded tile to output PDF %s", + TIFFFileName(output)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + + written = t2p->outputwritten; + + return(written); +} + +#ifdef OJPEG_SUPPORT +int t2p_process_ojpeg_tables(T2P* t2p, TIFF* input){ + uint16 proc=0; + void* q; + uint32 q_length=0; + void* dc; + uint32 dc_length=0; + void* ac; + uint32 ac_length=0; + uint16* lp; + uint16* pt; + uint16 h_samp=1; + uint16 v_samp=1; + unsigned char* ojpegdata; + uint16 table_count; + uint32 offset_table; + uint32 offset_ms_l; + uint32 code_count; + uint32 i=0; + uint32 dest=0; + uint16 ri=0; + uint32 rows=0; + + if(!TIFFGetField(input, TIFFTAG_JPEGPROC, &proc)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGProc field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(proc!=JPEGPROC_BASELINE && proc!=JPEGPROC_LOSSLESS){ + TIFFError(TIFF2PDF_MODULE, + "Bad JPEGProc field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(!TIFFGetField(input, TIFFTAG_JPEGQTABLES, &q_length, &q)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGQTables field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(q_length < (64U * t2p->tiff_samplesperpixel)){ + TIFFError(TIFF2PDF_MODULE, + "Bad JPEGQTables field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(!TIFFGetField(input, TIFFTAG_JPEGDCTABLES, &dc_length, &dc)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGDCTables field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(proc==JPEGPROC_BASELINE){ + if(!TIFFGetField(input, TIFFTAG_JPEGACTABLES, &ac_length, &ac)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGACTables field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + } else { + if(!TIFFGetField(input, TIFFTAG_JPEGLOSSLESSPREDICTORS, &lp)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGLosslessPredictors field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + if(!TIFFGetField(input, TIFFTAG_JPEGPOINTTRANSFORM, &pt)){ + TIFFError(TIFF2PDF_MODULE, + "Missing JPEGPointTransform field in OJPEG image %s", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + } + if(!TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &h_samp, &v_samp)){ + h_samp=1; + v_samp=1; + } + if(t2p->pdf_ojpegdata != NULL){ + _TIFFfree(t2p->pdf_ojpegdata); + t2p->pdf_ojpegdata=NULL; + } + t2p->pdf_ojpegdata = _TIFFmalloc(2048); + if(t2p->pdf_ojpegdata == NULL){ + TIFFError(TIFF2PDF_MODULE, + "Can't allocate %u bytes of memory for t2p_process_ojpeg_tables, %s", + 2048, + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return(0); + } + _TIFFmemset(t2p->pdf_ojpegdata, 0x00, 2048); + t2p->pdf_ojpegdatalength = 0; + table_count=t2p->tiff_samplesperpixel; + if(proc==JPEGPROC_BASELINE){ + if(table_count>2) table_count=2; + } + ojpegdata=(unsigned char*)t2p->pdf_ojpegdata; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xd8; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xff; + if(proc==JPEGPROC_BASELINE){ + ojpegdata[t2p->pdf_ojpegdatalength++]=0xc0; + } else { + ojpegdata[t2p->pdf_ojpegdatalength++]=0xc3; + } + ojpegdata[t2p->pdf_ojpegdatalength++]=0x00; + ojpegdata[t2p->pdf_ojpegdatalength++]=(8 + 3*t2p->tiff_samplesperpixel); + ojpegdata[t2p->pdf_ojpegdatalength++]=(t2p->tiff_bitspersample & 0xff); + if(TIFFIsTiled(input)){ + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength >> 8) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength ) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth >> 8) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth ) & 0xff; + } else { + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_length >> 8) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_length ) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_width >> 8) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= + (t2p->tiff_width ) & 0xff; + } + ojpegdata[t2p->pdf_ojpegdatalength++]=(t2p->tiff_samplesperpixel & 0xff); + for(i=0;itiff_samplesperpixel;i++){ + ojpegdata[t2p->pdf_ojpegdatalength++]=i; + if(i==0){ + ojpegdata[t2p->pdf_ojpegdatalength] |= h_samp<<4 & 0xf0;; + ojpegdata[t2p->pdf_ojpegdatalength++] |= v_samp & 0x0f; + } else { + ojpegdata[t2p->pdf_ojpegdatalength++]= 0x11; + } + ojpegdata[t2p->pdf_ojpegdatalength++]=i; + } + for(dest=0;desttiff_samplesperpixel;dest++){ + ojpegdata[t2p->pdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xdb; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x00; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x43; + ojpegdata[t2p->pdf_ojpegdatalength++]=dest; + _TIFFmemcpy( &(ojpegdata[t2p->pdf_ojpegdatalength++]), + &(((unsigned char*)q)[64*dest]), 64); + t2p->pdf_ojpegdatalength+=64; + } + offset_table=0; + for(dest=0;destpdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xc4; + offset_ms_l=t2p->pdf_ojpegdatalength; + t2p->pdf_ojpegdatalength+=2; + ojpegdata[t2p->pdf_ojpegdatalength++]=dest & 0x0f; + _TIFFmemcpy( &(ojpegdata[t2p->pdf_ojpegdatalength]), + &(((unsigned char*)dc)[offset_table]), 16); + code_count=0; + offset_table+=16; + for(i=0;i<16;i++){ + code_count+=ojpegdata[t2p->pdf_ojpegdatalength++]; + } + ojpegdata[offset_ms_l]=((19+code_count)>>8) & 0xff; + ojpegdata[offset_ms_l+1]=(19+code_count) & 0xff; + _TIFFmemcpy( &(ojpegdata[t2p->pdf_ojpegdatalength]), + &(((unsigned char*)dc)[offset_table]), code_count); + offset_table+=code_count; + t2p->pdf_ojpegdatalength+=code_count; + } + if(proc==JPEGPROC_BASELINE){ + offset_table=0; + for(dest=0;destpdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xc4; + offset_ms_l=t2p->pdf_ojpegdatalength; + t2p->pdf_ojpegdatalength+=2; + ojpegdata[t2p->pdf_ojpegdatalength] |= 0x10; + ojpegdata[t2p->pdf_ojpegdatalength++] |=dest & 0x0f; + _TIFFmemcpy( &(ojpegdata[t2p->pdf_ojpegdatalength]), + &(((unsigned char*)ac)[offset_table]), 16); + code_count=0; + offset_table+=16; + for(i=0;i<16;i++){ + code_count+=ojpegdata[t2p->pdf_ojpegdatalength++]; + } + ojpegdata[offset_ms_l]=((19+code_count)>>8) & 0xff; + ojpegdata[offset_ms_l+1]=(19+code_count) & 0xff; + _TIFFmemcpy( &(ojpegdata[t2p->pdf_ojpegdatalength]), + &(((unsigned char*)ac)[offset_table]), code_count); + offset_table+=code_count; + t2p->pdf_ojpegdatalength+=code_count; + } + } + if(TIFFNumberOfStrips(input)>1){ + ojpegdata[t2p->pdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xdd; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x00; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x04; + h_samp*=8; + v_samp*=8; + ri=(t2p->tiff_width+h_samp-1) / h_samp; + TIFFGetField(input, TIFFTAG_ROWSPERSTRIP, &rows); + ri*=(rows+v_samp-1)/v_samp; + ojpegdata[t2p->pdf_ojpegdatalength++]= (ri>>8) & 0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]= ri & 0xff; + } + ojpegdata[t2p->pdf_ojpegdatalength++]=0xff; + ojpegdata[t2p->pdf_ojpegdatalength++]=0xda; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x00; + ojpegdata[t2p->pdf_ojpegdatalength++]=(6 + 2*t2p->tiff_samplesperpixel); + ojpegdata[t2p->pdf_ojpegdatalength++]=t2p->tiff_samplesperpixel & 0xff; + for(i=0;itiff_samplesperpixel;i++){ + ojpegdata[t2p->pdf_ojpegdatalength++]= i & 0xff; + if(proc==JPEGPROC_BASELINE){ + ojpegdata[t2p->pdf_ojpegdatalength] |= + ( ( (i>(table_count-1U)) ? (table_count-1U) : i) << 4U) & 0xf0; + ojpegdata[t2p->pdf_ojpegdatalength++] |= + ( (i>(table_count-1U)) ? (table_count-1U) : i) & 0x0f; + } else { + ojpegdata[t2p->pdf_ojpegdatalength++] = (i << 4) & 0xf0; + } + } + if(proc==JPEGPROC_BASELINE){ + t2p->pdf_ojpegdatalength++; + ojpegdata[t2p->pdf_ojpegdatalength++]=0x3f; + t2p->pdf_ojpegdatalength++; + } else { + ojpegdata[t2p->pdf_ojpegdatalength++]= (lp[0] & 0xff); + t2p->pdf_ojpegdatalength++; + ojpegdata[t2p->pdf_ojpegdatalength++]= (pt[0] & 0x0f); + } + + return(1); +} +#endif + +#ifdef JPEG_SUPPORT +int t2p_process_jpeg_strip( + unsigned char* strip, + tsize_t* striplength, + unsigned char* buffer, + tsize_t* bufferoffset, + tstrip_t no, + uint32 height){ + + tsize_t i=0; + uint16 ri =0; + uint16 v_samp=1; + uint16 h_samp=1; + int j=0; + + i++; + + while(i<(*striplength)){ + switch( strip[i] ){ + case 0xd8: + /* SOI - start of image */ + _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2); + *bufferoffset+=2; + i+=2; + break; + case 0xc0: + case 0xc1: + case 0xc3: + case 0xc9: + case 0xca: + if(no==0){ + _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); + for(j=0;j>4) > h_samp) + h_samp = (buffer[*bufferoffset+11+(2*j)]>>4); + if( (buffer[*bufferoffset+11+(2*j)] & 0x0f) > v_samp) + v_samp = (buffer[*bufferoffset+11+(2*j)] & 0x0f); + } + v_samp*=8; + h_samp*=8; + ri=((( ((uint16)(buffer[*bufferoffset+5])<<8) | + (uint16)(buffer[*bufferoffset+6]) )+v_samp-1)/ + v_samp); + ri*=((( ((uint16)(buffer[*bufferoffset+7])<<8) | + (uint16)(buffer[*bufferoffset+8]) )+h_samp-1)/ + h_samp); + buffer[*bufferoffset+5]= + (unsigned char) ((height>>8) & 0xff); + buffer[*bufferoffset+6]= + (unsigned char) (height & 0xff); + *bufferoffset+=strip[i+2]+2; + i+=strip[i+2]+2; + + buffer[(*bufferoffset)++]=0xff; + buffer[(*bufferoffset)++]=0xdd; + buffer[(*bufferoffset)++]=0x00; + buffer[(*bufferoffset)++]=0x04; + buffer[(*bufferoffset)++]=(ri >> 8) & 0xff; + buffer[(*bufferoffset)++]= ri & 0xff; + } else { + i+=strip[i+2]+2; + } + break; + case 0xc4: + case 0xdb: + _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); + *bufferoffset+=strip[i+2]+2; + i+=strip[i+2]+2; + break; + case 0xda: + if(no==0){ + _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2); + *bufferoffset+=strip[i+2]+2; + i+=strip[i+2]+2; + } else { + buffer[(*bufferoffset)++]=0xff; + buffer[(*bufferoffset)++]= + (unsigned char)(0xd0 | ((no-1)%8)); + i+=strip[i+2]+2; + } + _TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), (*striplength)-i-1); + *bufferoffset+=(*striplength)-i-1; + return(1); + default: + i+=strip[i+2]+2; + } + } + + + return(0); +} +#endif + +/* + This functions converts a tilewidth x tilelength buffer of samples into an edgetilewidth x + tilelength buffer of samples. +*/ +void t2p_tile_collapse_left( + tdata_t buffer, + tsize_t scanwidth, + uint32 tilewidth, + uint32 edgetilewidth, + uint32 tilelength){ + + uint32 i; + tsize_t edgescanwidth=0; + + edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth; + for(i=0;it2p_error = T2P_ERR_ERROR; + return; + } + t2p_enable(output); + return; +} + +tsize_t t2p_sample_planar_separate_to_contig( + T2P* t2p, + unsigned char* buffer, + unsigned char* samplebuffer, + tsize_t samplebuffersize){ + + tsize_t stride=0; + tsize_t i=0; + tsize_t j=0; + + stride=samplebuffersize/t2p->tiff_samplesperpixel; + for(i=0;itiff_samplesperpixel;j++){ + buffer[i*t2p->tiff_samplesperpixel + j] = samplebuffer[i + j*stride]; + } + } + + return(samplebuffersize); +} + +tsize_t t2p_sample_realize_palette(T2P* t2p, unsigned char* buffer){ + + uint32 sample_count=0; + uint16 component_count=0; + uint32 palette_offset=0; + uint32 sample_offset=0; + uint32 i=0; + uint32 j=0; + sample_count=t2p->tiff_width*t2p->tiff_length; + component_count=t2p->tiff_samplesperpixel; + + for(i=sample_count;i>0;i--){ + palette_offset=buffer[i-1] * component_count; + sample_offset= (i-1) * component_count; + for(j=0;jpdf_palette[palette_offset+j]; + } + } + + return(0); +} + +/* + This functions converts in place a buffer of ABGR interleaved data + into RGB interleaved data, discarding A. +*/ + +tsize_t t2p_sample_abgr_to_rgb(tdata_t data, uint32 samplecount) +{ + uint32 i=0; + uint32 sample=0; + + for(i=0;i>8) & 0xff); + ((char*)data)[i*3+2]= (char) ((sample>>16) & 0xff); + } + + return(i*3); +} + +/* + * This functions converts in place a buffer of RGBA interleaved data + * into RGB interleaved data, discarding A. + */ + +tsize_t +t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount) +{ + uint32 i; + + for(i = 0; i < samplecount; i++) + memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3); + + return(i * 3); +} + +/* + * This functions converts in place a buffer of RGBA interleaved data + * into RGB interleaved data, adding 255-A to each component sample. + */ + +tsize_t +t2p_sample_rgba_to_rgb(tdata_t data, uint32 samplecount) +{ + uint32 i = 0; + uint32 sample = 0; + uint8 alpha = 0; + + for (i = 0; i < samplecount; i++) { + sample=((uint32*)data)[i]; + alpha=(uint8)((255 - ((sample >> 24) & 0xff))); + ((uint8 *)data)[i * 3] = (uint8) ((sample >> 16) & 0xff) + alpha; + ((uint8 *)data)[i * 3 + 1] = (uint8) ((sample >> 8) & 0xff) + alpha; + ((uint8 *)data)[i * 3 + 2] = (uint8) (sample & 0xff) + alpha; + } + + return (i * 3); +} + +/* + This function converts the a and b samples of Lab data from signed + to unsigned. +*/ + +tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t buffer, uint32 samplecount){ + + uint32 i=0; + + for(i=0;ipdf_majorversion&0xff, t2p->pdf_minorversion&0xff); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7); + + return(written); +} + +/* + This function writes the beginning of a PDF object to output. +*/ + +tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + buflen=sprintf(buffer, "%lu", (unsigned long)number); + written += t2pWriteFile(output, (tdata_t) buffer, buflen ); + written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7); + + return(written); +} + +/* + This function writes the end of a PDF object to output. +*/ + +tsize_t t2p_write_pdf_obj_end(TIFF* output){ + + tsize_t written=0; + + written += t2pWriteFile(output, (tdata_t) "endobj\n", 7); + + return(written); +} + +/* + This function writes a PDF name object to output. +*/ + +tsize_t t2p_write_pdf_name(unsigned char* name, TIFF* output){ + + tsize_t written=0; + uint32 i=0; + char buffer[64]; + uint16 nextchar=0; + size_t namelen=0; + + namelen = strlen((char *)name); + if (namelen>126) { + namelen=126; + } + written += t2pWriteFile(output, (tdata_t) "/", 1); + for (i=0;i 0x7E){ + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + nextchar=1; + } + if (nextchar==0){ + switch (name[i]){ + case 0x23: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x25: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x28: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x29: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x2F: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x3C: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x3E: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x5B: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x5D: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x7B: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + case 0x7D: + sprintf(buffer, "#%.2X", name[i]); + buffer[sizeof(buffer) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) buffer, 3); + break; + default: + written += t2pWriteFile(output, (tdata_t) &name[i], 1); + } + } + nextchar=0; + } + written += t2pWriteFile(output, (tdata_t) " ", 1); + + return(written); +} + +/* + * This function writes a PDF string object to output. + */ + +tsize_t t2p_write_pdf_string(char* pdfstr, TIFF* output) +{ + tsize_t written = 0; + uint32 i = 0; + char buffer[64]; + size_t len = 0; + + len = strlen(pdfstr); + written += t2pWriteFile(output, (tdata_t) "(", 1); + for (i=0; i>\n", 4); + + return(written); +} + +/* + This function writes a number to output. +*/ + +tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + buflen=sprintf(buffer, "%lu", (unsigned long)len); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + + return(written); +} + +/* + * This function writes the PDF Catalog structure to output. + */ + +tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output) +{ + tsize_t written = 0; + char buffer[16]; + int buflen = 0; + + written += t2pWriteFile(output, + (tdata_t)"<< \n/Type /Catalog \n/Pages ", + 27); + buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages); + written += t2pWriteFile(output, (tdata_t) buffer, + TIFFmin((size_t)buflen, sizeof(buffer) - 1)); + written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); + if(t2p->pdf_fitwindow){ + written += t2pWriteFile(output, + (tdata_t) "/ViewerPreferences <>\n", + 39); + } + written += t2pWriteFile(output, (tdata_t)">>\n", 3); + + return(written); +} + +/* + This function writes the PDF Info structure to output. +*/ + +tsize_t t2p_write_pdf_info(T2P* t2p, TIFF* input, TIFF* output) +{ + tsize_t written = 0; + char* info; + char buffer[512]; + + if(t2p->pdf_datetime[0] == '\0') + t2p_pdf_tifftime(t2p, input); + if (strlen(t2p->pdf_datetime) > 0) { + written += t2pWriteFile(output, (tdata_t) "<< \n/CreationDate ", 18); + written += t2p_write_pdf_string(t2p->pdf_datetime, output); + written += t2pWriteFile(output, (tdata_t) "\n/ModDate ", 10); + written += t2p_write_pdf_string(t2p->pdf_datetime, output); + } + written += t2pWriteFile(output, (tdata_t) "\n/Producer ", 11); + _TIFFmemset((tdata_t)buffer, 0x00, sizeof(buffer)); + snprintf(buffer, sizeof(buffer), "libtiff / tiff2pdf - %d", TIFFLIB_VERSION); + written += t2p_write_pdf_string(buffer, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + if (t2p->pdf_creator[0] != '\0') { + written += t2pWriteFile(output, (tdata_t) "/Creator ", 9); + written += t2p_write_pdf_string(t2p->pdf_creator, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } else { + if (TIFFGetField(input, TIFFTAG_SOFTWARE, &info) != 0 && info) { + if(strlen(info) >= sizeof(t2p->pdf_creator)) + info[sizeof(t2p->pdf_creator) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) "/Creator ", 9); + written += t2p_write_pdf_string(info, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + } + if (t2p->pdf_author[0] != '\0') { + written += t2pWriteFile(output, (tdata_t) "/Author ", 8); + written += t2p_write_pdf_string(t2p->pdf_author, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } else { + if ((TIFFGetField(input, TIFFTAG_ARTIST, &info) != 0 + || TIFFGetField(input, TIFFTAG_COPYRIGHT, &info) != 0) + && info) { + if (strlen(info) >= sizeof(t2p->pdf_author)) + info[sizeof(t2p->pdf_author) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) "/Author ", 8); + written += t2p_write_pdf_string(info, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + } + if (t2p->pdf_title[0] != '\0') { + written += t2pWriteFile(output, (tdata_t) "/Title ", 7); + written += t2p_write_pdf_string(t2p->pdf_title, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } else { + if (TIFFGetField(input, TIFFTAG_DOCUMENTNAME, &info) != 0){ + if(strlen(info) > 511) { + info[512] = '\0'; + } + written += t2pWriteFile(output, (tdata_t) "/Title ", 7); + written += t2p_write_pdf_string(info, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + } + if (t2p->pdf_subject[0] != '\0') { + written += t2pWriteFile(output, (tdata_t) "/Subject ", 9); + written += t2p_write_pdf_string(t2p->pdf_subject, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } else { + if (TIFFGetField(input, TIFFTAG_IMAGEDESCRIPTION, &info) != 0 && info) { + if (strlen(info) >= sizeof(t2p->pdf_subject)) + info[sizeof(t2p->pdf_subject) - 1] = '\0'; + written += t2pWriteFile(output, (tdata_t) "/Subject ", 9); + written += t2p_write_pdf_string(info, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + } + if (t2p->pdf_keywords[0] != '\0') { + written += t2pWriteFile(output, (tdata_t) "/Keywords ", 10); + written += t2p_write_pdf_string(t2p->pdf_keywords, output); + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + written += t2pWriteFile(output, (tdata_t) ">> \n", 4); + + return(written); +} + +/* + * This function fills a string of a T2P struct with the current time as a PDF + * date string, it is called by t2p_pdf_tifftime. + */ + +void t2p_pdf_currenttime(T2P* t2p) +{ + struct tm* currenttime; + time_t timenow; + + if (time(&timenow) == (time_t) -1) { + TIFFError(TIFF2PDF_MODULE, + "Can't get the current time: %s", strerror(errno)); + timenow = (time_t) 0; + } + + currenttime = localtime(&timenow); + snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime), + "D:%.4d%.2d%.2d%.2d%.2d%.2d", + (currenttime->tm_year + 1900) % 65536, + (currenttime->tm_mon + 1) % 256, + (currenttime->tm_mday) % 256, + (currenttime->tm_hour) % 256, + (currenttime->tm_min) % 256, + (currenttime->tm_sec) % 256); + + return; +} + +/* + * This function fills a string of a T2P struct with the date and time of a + * TIFF file if it exists or the current time as a PDF date string. + */ + +void t2p_pdf_tifftime(T2P* t2p, TIFF* input) +{ + char* datetime; + + if (TIFFGetField(input, TIFFTAG_DATETIME, &datetime) != 0 + && (strlen(datetime) >= 19) ){ + t2p->pdf_datetime[0]='D'; + t2p->pdf_datetime[1]=':'; + t2p->pdf_datetime[2]=datetime[0]; + t2p->pdf_datetime[3]=datetime[1]; + t2p->pdf_datetime[4]=datetime[2]; + t2p->pdf_datetime[5]=datetime[3]; + t2p->pdf_datetime[6]=datetime[5]; + t2p->pdf_datetime[7]=datetime[6]; + t2p->pdf_datetime[8]=datetime[8]; + t2p->pdf_datetime[9]=datetime[9]; + t2p->pdf_datetime[10]=datetime[11]; + t2p->pdf_datetime[11]=datetime[12]; + t2p->pdf_datetime[12]=datetime[14]; + t2p->pdf_datetime[13]=datetime[15]; + t2p->pdf_datetime[14]=datetime[17]; + t2p->pdf_datetime[15]=datetime[18]; + t2p->pdf_datetime[16] = '\0'; + } else { + t2p_pdf_currenttime(t2p); + } + + return; +} + +/* + * This function writes a PDF Pages Tree structure to output. + */ + +tsize_t t2p_write_pdf_pages(T2P* t2p, TIFF* output) +{ + tsize_t written=0; + tdir_t i=0; + char buffer[16]; + int buflen=0; + + int page=0; + written += t2pWriteFile(output, + (tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26); + page = t2p->pdf_pages+1; + for (i=0;itiff_pagecount;i++){ + buflen=sprintf(buffer, "%d", page); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + if ( ((i+1)%8)==0 ) { + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + page +=3; + page += t2p->tiff_pages[i].page_extra; + if(t2p->tiff_pages[i].page_tilecount>0){ + page += (2 * t2p->tiff_pages[i].page_tilecount); + } else { + page +=2; + } + } + written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10); + _TIFFmemset(buffer, 0x00, 16); + buflen=sprintf(buffer, "%d", t2p->tiff_pagecount); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6); + + return(written); +} + +/* + This function writes a PDF Page structure to output. +*/ + +tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){ + + unsigned int i=0; + tsize_t written=0; + char buffer[16]; + int buflen=0; + + written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); + written += t2pWriteFile(output, (tdata_t) "/MediaBox [", 11); + buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x2); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y2); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "] \n", 3); + written += t2pWriteFile(output, (tdata_t) "/Contents ", 10); + buflen=sprintf(buffer, "%lu", (unsigned long)(object + 1)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6); + written += t2pWriteFile(output, (tdata_t) "/Resources << \n", 15); + if( t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount != 0 ){ + written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12); + for(i=0;itiff_tiles[t2p->pdf_page].tiles_tilecount;i++){ + written += t2pWriteFile(output, (tdata_t) "/Im", 3); + buflen = sprintf(buffer, "%u", t2p->pdf_page+1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "_", 1); + buflen = sprintf(buffer, "%u", i+1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + buflen = sprintf( + buffer, + "%lu", + (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + if(i%4==3){ + written += t2pWriteFile(output, (tdata_t) "\n", 1); + } + } + written += t2pWriteFile(output, (tdata_t) ">>\n", 3); + } else { + written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12); + written += t2pWriteFile(output, (tdata_t) "/Im", 3); + buflen = sprintf(buffer, "%u", t2p->pdf_page+1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + buflen = sprintf( + buffer, + "%lu", + (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + written += t2pWriteFile(output, (tdata_t) ">>\n", 3); + } + if(t2p->tiff_transferfunctioncount != 0) { + written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13); + t2pWriteFile(output, (tdata_t) "/GS1 ", 5); + buflen = sprintf( + buffer, + "%lu", + (unsigned long)(object + 3)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + written += t2pWriteFile(output, (tdata_t) ">> \n", 4); + } + written += t2pWriteFile(output, (tdata_t) "/ProcSet [ ", 11); + if(t2p->pdf_colorspace == T2P_CS_BILEVEL + || t2p->pdf_colorspace == T2P_CS_GRAY + ){ + written += t2pWriteFile(output, (tdata_t) "/ImageB ", 8); + } else { + written += t2pWriteFile(output, (tdata_t) "/ImageC ", 8); + if(t2p->pdf_colorspace & T2P_CS_PALETTE){ + written += t2pWriteFile(output, (tdata_t) "/ImageI ", 8); + } + } + written += t2pWriteFile(output, (tdata_t) "]\n>>\n>>\n", 8); + + return(written); +} + +/* + This function composes the page size and image and tile locations on a page. +*/ + +void t2p_compose_pdf_page(T2P* t2p){ + + uint32 i=0; + uint32 i2=0; + T2P_TILE* tiles=NULL; + T2P_BOX* boxp=NULL; + uint32 tilecountx=0; + uint32 tilecounty=0; + uint32 tilewidth=0; + uint32 tilelength=0; + int istiled=0; + float f=0; + float width_ratio=0; + float length_ratio=0; + + t2p->pdf_xres = t2p->tiff_xres; + t2p->pdf_yres = t2p->tiff_yres; + if(t2p->pdf_overrideres) { + t2p->pdf_xres = t2p->pdf_defaultxres; + t2p->pdf_yres = t2p->pdf_defaultyres; + } + if(t2p->pdf_xres == 0.0) + t2p->pdf_xres = t2p->pdf_defaultxres; + if(t2p->pdf_yres == 0.0) + t2p->pdf_yres = t2p->pdf_defaultyres; + if (t2p->pdf_image_fillpage) { + width_ratio = t2p->pdf_defaultpagewidth/t2p->tiff_width; + length_ratio = t2p->pdf_defaultpagelength/t2p->tiff_length; + if (width_ratio < length_ratio ) { + t2p->pdf_imagewidth = t2p->pdf_defaultpagewidth; + t2p->pdf_imagelength = t2p->tiff_length * width_ratio; + } else { + t2p->pdf_imagewidth = t2p->tiff_width * length_ratio; + t2p->pdf_imagelength = t2p->pdf_defaultpagelength; + } + } else if (t2p->tiff_resunit != RESUNIT_CENTIMETER /* RESUNIT_NONE and */ + && t2p->tiff_resunit != RESUNIT_INCH) { /* other cases */ + t2p->pdf_imagewidth = ((float)(t2p->tiff_width))/t2p->pdf_xres; + t2p->pdf_imagelength = ((float)(t2p->tiff_length))/t2p->pdf_yres; + } else { + t2p->pdf_imagewidth = + ((float)(t2p->tiff_width))*PS_UNIT_SIZE/t2p->pdf_xres; + t2p->pdf_imagelength = + ((float)(t2p->tiff_length))*PS_UNIT_SIZE/t2p->pdf_yres; + } + if(t2p->pdf_overridepagesize != 0) { + t2p->pdf_pagewidth = t2p->pdf_defaultpagewidth; + t2p->pdf_pagelength = t2p->pdf_defaultpagelength; + } else { + t2p->pdf_pagewidth = t2p->pdf_imagewidth; + t2p->pdf_pagelength = t2p->pdf_imagelength; + } + t2p->pdf_mediabox.x1=0.0; + t2p->pdf_mediabox.y1=0.0; + t2p->pdf_mediabox.x2=t2p->pdf_pagewidth; + t2p->pdf_mediabox.y2=t2p->pdf_pagelength; + t2p->pdf_imagebox.x1=0.0; + t2p->pdf_imagebox.y1=0.0; + t2p->pdf_imagebox.x2=t2p->pdf_imagewidth; + t2p->pdf_imagebox.y2=t2p->pdf_imagelength; + if(t2p->pdf_overridepagesize!=0){ + t2p->pdf_imagebox.x1+=((t2p->pdf_pagewidth-t2p->pdf_imagewidth)/2.0F); + t2p->pdf_imagebox.y1+=((t2p->pdf_pagelength-t2p->pdf_imagelength)/2.0F); + t2p->pdf_imagebox.x2+=((t2p->pdf_pagewidth-t2p->pdf_imagewidth)/2.0F); + t2p->pdf_imagebox.y2+=((t2p->pdf_pagelength-t2p->pdf_imagelength)/2.0F); + } + if(t2p->tiff_orientation > 4){ + f=t2p->pdf_mediabox.x2; + t2p->pdf_mediabox.x2=t2p->pdf_mediabox.y2; + t2p->pdf_mediabox.y2=f; + } + istiled=((t2p->tiff_tiles[t2p->pdf_page]).tiles_tilecount==0) ? 0 : 1; + if(istiled==0){ + t2p_compose_pdf_page_orient(&(t2p->pdf_imagebox), t2p->tiff_orientation); + return; + } else { + tilewidth=(t2p->tiff_tiles[t2p->pdf_page]).tiles_tilewidth; + tilelength=(t2p->tiff_tiles[t2p->pdf_page]).tiles_tilelength; + tilecountx=(t2p->tiff_width + + tilewidth -1)/ + tilewidth; + (t2p->tiff_tiles[t2p->pdf_page]).tiles_tilecountx=tilecountx; + tilecounty=(t2p->tiff_length + + tilelength -1)/ + tilelength; + (t2p->tiff_tiles[t2p->pdf_page]).tiles_tilecounty=tilecounty; + (t2p->tiff_tiles[t2p->pdf_page]).tiles_edgetilewidth= + t2p->tiff_width % tilewidth; + (t2p->tiff_tiles[t2p->pdf_page]).tiles_edgetilelength= + t2p->tiff_length % tilelength; + tiles=(t2p->tiff_tiles[t2p->pdf_page]).tiles_tiles; + for(i2=0;i2x1 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * i * tilewidth) + / (float)t2p->tiff_width); + boxp->x2 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * (i+1) * tilewidth) + / (float)t2p->tiff_width); + boxp->y1 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * (i2+1) * tilelength) + / (float)t2p->tiff_length); + boxp->y2 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * i2 * tilelength) + / (float)t2p->tiff_length); + } + boxp=&(tiles[i2*tilecountx+i].tile_box); + boxp->x1 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * i * tilewidth) + / (float)t2p->tiff_width); + boxp->x2 = t2p->pdf_imagebox.x2; + boxp->y1 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * (i2+1) * tilelength) + / (float)t2p->tiff_length); + boxp->y2 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * i2 * tilelength) + / (float)t2p->tiff_length); + } + for(i=0;ix1 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * i * tilewidth) + / (float)t2p->tiff_width); + boxp->x2 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * (i+1) * tilewidth) + / (float)t2p->tiff_width); + boxp->y1 = t2p->pdf_imagebox.y1; + boxp->y2 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * i2 * tilelength) + / (float)t2p->tiff_length); + } + boxp=&(tiles[i2*tilecountx+i].tile_box); + boxp->x1 = + t2p->pdf_imagebox.x1 + + ((float)(t2p->pdf_imagewidth * i * tilewidth) + / (float)t2p->tiff_width); + boxp->x2 = t2p->pdf_imagebox.x2; + boxp->y1 = t2p->pdf_imagebox.y1; + boxp->y2 = + t2p->pdf_imagebox.y2 + - ((float)(t2p->pdf_imagelength * i2 * tilelength) + / (float)t2p->tiff_length); + } + if(t2p->tiff_orientation==0 || t2p->tiff_orientation==1){ + for(i=0;i<(t2p->tiff_tiles[t2p->pdf_page]).tiles_tilecount;i++){ + t2p_compose_pdf_page_orient( &(tiles[i].tile_box) , 0); + } + return; + } + for(i=0;i<(t2p->tiff_tiles[t2p->pdf_page]).tiles_tilecount;i++){ + boxp=&(tiles[i].tile_box); + boxp->x1 -= t2p->pdf_imagebox.x1; + boxp->x2 -= t2p->pdf_imagebox.x1; + boxp->y1 -= t2p->pdf_imagebox.y1; + boxp->y2 -= t2p->pdf_imagebox.y1; + if(t2p->tiff_orientation==2 || t2p->tiff_orientation==3){ + boxp->x1 = t2p->pdf_imagebox.x2 - t2p->pdf_imagebox.x1 - boxp->x1; + boxp->x2 = t2p->pdf_imagebox.x2 - t2p->pdf_imagebox.x1 - boxp->x2; + } + if(t2p->tiff_orientation==3 || t2p->tiff_orientation==4){ + boxp->y1 = t2p->pdf_imagebox.y2 - t2p->pdf_imagebox.y1 - boxp->y1; + boxp->y2 = t2p->pdf_imagebox.y2 - t2p->pdf_imagebox.y1 - boxp->y2; + } + if(t2p->tiff_orientation==8 || t2p->tiff_orientation==5){ + boxp->y1 = t2p->pdf_imagebox.y2 - t2p->pdf_imagebox.y1 - boxp->y1; + boxp->y2 = t2p->pdf_imagebox.y2 - t2p->pdf_imagebox.y1 - boxp->y2; + } + if(t2p->tiff_orientation==5 || t2p->tiff_orientation==6){ + boxp->x1 = t2p->pdf_imagebox.x2 - t2p->pdf_imagebox.x1 - boxp->x1; + boxp->x2 = t2p->pdf_imagebox.x2 - t2p->pdf_imagebox.x1 - boxp->x2; + } + if(t2p->tiff_orientation > 4){ + f=boxp->x1; + boxp->x1 = boxp->y1; + boxp->y1 = f; + f=boxp->x2; + boxp->x2 = boxp->y2; + boxp->y2 = f; + t2p_compose_pdf_page_orient_flip(boxp, t2p->tiff_orientation); + } else { + t2p_compose_pdf_page_orient(boxp, t2p->tiff_orientation); + } + + } + + return; +} + +void t2p_compose_pdf_page_orient(T2P_BOX* boxp, uint16 orientation){ + + float m1[9]; + float f=0.0; + + if( boxp->x1 > boxp->x2){ + f=boxp->x1; + boxp->x1=boxp->x2; + boxp->x2 = f; + } + if( boxp->y1 > boxp->y2){ + f=boxp->y1; + boxp->y1=boxp->y2; + boxp->y2 = f; + } + boxp->mat[0]=m1[0]=boxp->x2-boxp->x1; + boxp->mat[1]=m1[1]=0.0; + boxp->mat[2]=m1[2]=0.0; + boxp->mat[3]=m1[3]=0.0; + boxp->mat[4]=m1[4]=boxp->y2-boxp->y1; + boxp->mat[5]=m1[5]=0.0; + boxp->mat[6]=m1[6]=boxp->x1; + boxp->mat[7]=m1[7]=boxp->y1; + boxp->mat[8]=m1[8]=1.0; + switch(orientation){ + case 0: + case 1: + break; + case 2: + boxp->mat[0]=0.0F-m1[0]; + boxp->mat[6]+=m1[0]; + break; + case 3: + boxp->mat[0]=0.0F-m1[0]; + boxp->mat[4]=0.0F-m1[4]; + boxp->mat[6]+=m1[0]; + boxp->mat[7]+=m1[4]; + break; + case 4: + boxp->mat[4]=0.0F-m1[4]; + boxp->mat[7]+=m1[4]; + break; + case 5: + boxp->mat[0]=0.0F; + boxp->mat[1]=0.0F-m1[0]; + boxp->mat[3]=0.0F-m1[4]; + boxp->mat[4]=0.0F; + boxp->mat[6]+=m1[4]; + boxp->mat[7]+=m1[0]; + break; + case 6: + boxp->mat[0]=0.0F; + boxp->mat[1]=0.0F-m1[0]; + boxp->mat[3]=m1[4]; + boxp->mat[4]=0.0F; + boxp->mat[7]+=m1[0]; + break; + case 7: + boxp->mat[0]=0.0F; + boxp->mat[1]=m1[0]; + boxp->mat[3]=m1[4]; + boxp->mat[4]=0.0F; + break; + case 8: + boxp->mat[0]=0.0F; + boxp->mat[1]=m1[0]; + boxp->mat[3]=0.0F-m1[4]; + boxp->mat[4]=0.0F; + boxp->mat[6]+=m1[4]; + break; + } + + return; +} + +void t2p_compose_pdf_page_orient_flip(T2P_BOX* boxp, uint16 orientation){ + + float m1[9]; + float f=0.0; + + if( boxp->x1 > boxp->x2){ + f=boxp->x1; + boxp->x1=boxp->x2; + boxp->x2 = f; + } + if( boxp->y1 > boxp->y2){ + f=boxp->y1; + boxp->y1=boxp->y2; + boxp->y2 = f; + } + boxp->mat[0]=m1[0]=boxp->x2-boxp->x1; + boxp->mat[1]=m1[1]=0.0F; + boxp->mat[2]=m1[2]=0.0F; + boxp->mat[3]=m1[3]=0.0F; + boxp->mat[4]=m1[4]=boxp->y2-boxp->y1; + boxp->mat[5]=m1[5]=0.0F; + boxp->mat[6]=m1[6]=boxp->x1; + boxp->mat[7]=m1[7]=boxp->y1; + boxp->mat[8]=m1[8]=1.0F; + switch(orientation){ + case 5: + boxp->mat[0]=0.0F; + boxp->mat[1]=0.0F-m1[4]; + boxp->mat[3]=0.0F-m1[0]; + boxp->mat[4]=0.0F; + boxp->mat[6]+=m1[0]; + boxp->mat[7]+=m1[4]; + break; + case 6: + boxp->mat[0]=0.0F; + boxp->mat[1]=0.0F-m1[4]; + boxp->mat[3]=m1[0]; + boxp->mat[4]=0.0F; + boxp->mat[7]+=m1[4]; + break; + case 7: + boxp->mat[0]=0.0F; + boxp->mat[1]=m1[4]; + boxp->mat[3]=m1[0]; + boxp->mat[4]=0.0F; + break; + case 8: + boxp->mat[0]=0.0F; + boxp->mat[1]=m1[4]; + boxp->mat[3]=0.0F-m1[0]; + boxp->mat[4]=0.0F; + boxp->mat[6]+=m1[0]; + break; + } + + return; +} + +/* + This function writes a PDF Contents stream to output. +*/ + +tsize_t t2p_write_pdf_page_content_stream(T2P* t2p, TIFF* output){ + + tsize_t written=0; + ttile_t i=0; + char buffer[512]; + int buflen=0; + T2P_BOX box; + + if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount>0){ + for(i=0;itiff_tiles[t2p->pdf_page].tiles_tilecount; i++){ + box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box; + buflen=sprintf(buffer, + "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n", + t2p->tiff_transferfunctioncount?"/GS1 gs ":"", + box.mat[0], + box.mat[1], + box.mat[3], + box.mat[4], + box.mat[6], + box.mat[7], + t2p->pdf_page + 1, + (long)(i + 1)); + written += t2p_write_pdf_stream(buffer, buflen, output); + } + } else { + box=t2p->pdf_imagebox; + buflen=sprintf(buffer, + "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n", + t2p->tiff_transferfunctioncount?"/GS1 gs ":"", + box.mat[0], + box.mat[1], + box.mat[3], + box.mat[4], + box.mat[6], + box.mat[7], + t2p->pdf_page+1); + written += t2p_write_pdf_stream(buffer, buflen, output); + } + + return(written); +} + +/* + This function writes a PDF Image XObject stream dictionary to output. +*/ + +tsize_t t2p_write_pdf_xobject_stream_dict(ttile_t tile, + T2P* t2p, + TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); + written += t2pWriteFile(output, + (tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im", + 42); + buflen=sprintf(buffer, "%u", t2p->pdf_page+1); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + if(tile != 0){ + written += t2pWriteFile(output, (tdata_t) "_", 1); + buflen=sprintf(buffer, "%lu", (unsigned long)tile); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } + written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8); + _TIFFmemset((tdata_t)buffer, 0x00, 16); + if(tile==0){ + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_width); + } else { + if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){ + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); + } else { + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); + } + } + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9); + _TIFFmemset((tdata_t)buffer, 0x00, 16); + if(tile==0){ + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_length); + } else { + if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){ + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); + } else { + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + } + } + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19); + _TIFFmemset((tdata_t)buffer, 0x00, 16); + buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13); + written += t2p_write_pdf_xobject_cs(t2p, output); + if (t2p->pdf_image_interpolate) + written += t2pWriteFile(output, + (tdata_t) "\n/Interpolate true", 18); + if( (t2p->pdf_switchdecode != 0) +#ifdef CCITT_SUPPORT + && ! (t2p->pdf_colorspace == T2P_CS_BILEVEL + && t2p->pdf_compression == T2P_COMPRESS_G4) +#endif + ){ + written += t2p_write_pdf_xobject_decode(t2p, output); + } + written += t2p_write_pdf_xobject_stream_filter(tile, t2p, output); + + return(written); +} + +/* + * This function writes a PDF Image XObject Colorspace name to output. + */ + + +tsize_t t2p_write_pdf_xobject_cs(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[128]; + int buflen=0; + + float X_W=1.0; + float Y_W=1.0; + float Z_W=1.0; + + if( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){ + written += t2p_write_pdf_xobject_icccs(t2p, output); + return(written); + } + if( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){ + written += t2pWriteFile(output, (tdata_t) "[ /Indexed ", 11); + t2p->pdf_colorspace ^= T2P_CS_PALETTE; + written += t2p_write_pdf_xobject_cs(t2p, output); + t2p->pdf_colorspace |= T2P_CS_PALETTE; + buflen=sprintf(buffer, "%u", (0x0001 << t2p->tiff_bitspersample)-1 ); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " ", 1); + _TIFFmemset(buffer, 0x00, 16); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_palettecs ); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7); + return(written); + } + if(t2p->pdf_colorspace & T2P_CS_BILEVEL){ + written += t2pWriteFile(output, (tdata_t) "/DeviceGray \n", 13); + } + if(t2p->pdf_colorspace & T2P_CS_GRAY){ + if(t2p->pdf_colorspace & T2P_CS_CALGRAY){ + written += t2p_write_pdf_xobject_calcs(t2p, output); + } else { + written += t2pWriteFile(output, (tdata_t) "/DeviceGray \n", 13); + } + } + if(t2p->pdf_colorspace & T2P_CS_RGB){ + if(t2p->pdf_colorspace & T2P_CS_CALRGB){ + written += t2p_write_pdf_xobject_calcs(t2p, output); + } else { + written += t2pWriteFile(output, (tdata_t) "/DeviceRGB \n", 12); + } + } + if(t2p->pdf_colorspace & T2P_CS_CMYK){ + written += t2pWriteFile(output, (tdata_t) "/DeviceCMYK \n", 13); + } + if(t2p->pdf_colorspace & T2P_CS_LAB){ + written += t2pWriteFile(output, (tdata_t) "[/Lab << \n", 10); + written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12); + X_W = t2p->tiff_whitechromaticities[0]; + Y_W = t2p->tiff_whitechromaticities[1]; + Z_W = 1.0F - (X_W + Y_W); + X_W /= Y_W; + Z_W /= Y_W; + Y_W = 1.0F; + buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/Range ", 7); + buflen=sprintf(buffer, "[%d %d %d %d] \n", + t2p->pdf_labrange[0], + t2p->pdf_labrange[1], + t2p->pdf_labrange[2], + t2p->pdf_labrange[3]); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) ">>] \n", 5); + + } + + return(written); +} + +tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25); + if(t2p->tiff_transferfunctioncount == 1){ + buflen=sprintf(buffer, "%lu", + (unsigned long)(t2p->pdf_xrefcount + 1)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + } else { + written += t2pWriteFile(output, (tdata_t) "[ ", 2); + buflen=sprintf(buffer, "%lu", + (unsigned long)(t2p->pdf_xrefcount + 1)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + buflen=sprintf(buffer, "%lu", + (unsigned long)(t2p->pdf_xrefcount + 2)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + buflen=sprintf(buffer, "%lu", + (unsigned long)(t2p->pdf_xrefcount + 3)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R ", 5); + written += t2pWriteFile(output, (tdata_t) "/Identity ] ", 12); + } + + written += t2pWriteFile(output, (tdata_t) " >> \n", 5); + + return(written); +} + +tsize_t t2p_write_pdf_transfer_dict(T2P* t2p, TIFF* output, uint16 i){ + + tsize_t written=0; + char buffer[32]; + int buflen=0; + (void)i; /* XXX */ + + written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17); + written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19); + written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18); + buflen=sprintf(buffer, "/Size [%u] \n", (1<tiff_bitspersample)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19); + written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output); + + return(written); +} + +tsize_t t2p_write_pdf_transfer_stream(T2P* t2p, TIFF* output, uint16 i){ + + tsize_t written=0; + + written += t2p_write_pdf_stream( + t2p->tiff_transferfunction[i], + (((tsize_t)1)<<(t2p->tiff_bitspersample+1)), + output); + + return(written); +} + +/* + This function writes a PDF Image XObject Colorspace array to output. +*/ + +tsize_t t2p_write_pdf_xobject_calcs(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[128]; + int buflen=0; + + float X_W=0.0; + float Y_W=0.0; + float Z_W=0.0; + float X_R=0.0; + float Y_R=0.0; + float Z_R=0.0; + float X_G=0.0; + float Y_G=0.0; + float Z_G=0.0; + float X_B=0.0; + float Y_B=0.0; + float Z_B=0.0; + float x_w=0.0; + float y_w=0.0; + float z_w=0.0; + float x_r=0.0; + float y_r=0.0; + float x_g=0.0; + float y_g=0.0; + float x_b=0.0; + float y_b=0.0; + float R=1.0; + float G=1.0; + float B=1.0; + + written += t2pWriteFile(output, (tdata_t) "[", 1); + if(t2p->pdf_colorspace & T2P_CS_CALGRAY){ + written += t2pWriteFile(output, (tdata_t) "/CalGray ", 9); + X_W = t2p->tiff_whitechromaticities[0]; + Y_W = t2p->tiff_whitechromaticities[1]; + Z_W = 1.0F - (X_W + Y_W); + X_W /= Y_W; + Z_W /= Y_W; + Y_W = 1.0F; + } + if(t2p->pdf_colorspace & T2P_CS_CALRGB){ + written += t2pWriteFile(output, (tdata_t) "/CalRGB ", 8); + x_w = t2p->tiff_whitechromaticities[0]; + y_w = t2p->tiff_whitechromaticities[1]; + x_r = t2p->tiff_primarychromaticities[0]; + y_r = t2p->tiff_primarychromaticities[1]; + x_g = t2p->tiff_primarychromaticities[2]; + y_g = t2p->tiff_primarychromaticities[3]; + x_b = t2p->tiff_primarychromaticities[4]; + y_b = t2p->tiff_primarychromaticities[5]; + z_w = y_w * ((x_g - x_b)*y_r - (x_r-x_b)*y_g + (x_r-x_g)*y_b); + Y_R = (y_r/R) * ((x_g-x_b)*y_w - (x_w-x_b)*y_g + (x_w-x_g)*y_b) / z_w; + X_R = Y_R * x_r / y_r; + Z_R = Y_R * (((1-x_r)/y_r)-1); + Y_G = ((0.0F-(y_g))/G) * ((x_r-x_b)*y_w - (x_w-x_b)*y_r + (x_w-x_r)*y_b) / z_w; + X_G = Y_G * x_g / y_g; + Z_G = Y_G * (((1-x_g)/y_g)-1); + Y_B = (y_b/B) * ((x_r-x_g)*y_w - (x_w-x_g)*y_r + (x_w-x_r)*y_g) / z_w; + X_B = Y_B * x_b / y_b; + Z_B = Y_B * (((1-x_b)/y_b)-1); + X_W = (X_R * R) + (X_G * G) + (X_B * B); + Y_W = (Y_R * R) + (Y_G * G) + (Y_B * B); + Z_W = (Z_R * R) + (Z_G * G) + (Z_B * B); + X_W /= Y_W; + Z_W /= Y_W; + Y_W = 1.0; + } + written += t2pWriteFile(output, (tdata_t) "<< \n", 4); + if(t2p->pdf_colorspace & T2P_CS_CALGRAY){ + written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12); + buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/Gamma 2.2 \n", 12); + } + if(t2p->pdf_colorspace & T2P_CS_CALRGB){ + written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12); + buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/Matrix ", 8); + buflen=sprintf(buffer, "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", + X_R, Y_R, Z_R, + X_G, Y_G, Z_G, + X_B, Y_B, Z_B); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/Gamma [2.2 2.2 2.2] \n", 22); + } + written += t2pWriteFile(output, (tdata_t) ">>] \n", 5); + + return(written); +} + +/* + This function writes a PDF Image XObject Colorspace array to output. +*/ + +tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_icccs); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7); + + return(written); +} + +tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + written += t2pWriteFile(output, (tdata_t) "/N ", 3); + buflen=sprintf(buffer, "%u \n", t2p->tiff_samplesperpixel); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11); + t2p->pdf_colorspace ^= T2P_CS_ICCBASED; + written += t2p_write_pdf_xobject_cs(t2p, output); + t2p->pdf_colorspace |= T2P_CS_ICCBASED; + written += t2p_write_pdf_stream_dict(t2p->tiff_iccprofilelength, 0, output); + + return(written); +} + +tsize_t t2p_write_pdf_xobject_icccs_stream(T2P* t2p, TIFF* output){ + + tsize_t written=0; + + written += t2p_write_pdf_stream( + (tdata_t) t2p->tiff_iccprofile, + (tsize_t) t2p->tiff_iccprofilelength, + output); + + return(written); +} + +/* + This function writes a palette stream for an indexed color space to output. +*/ + +tsize_t t2p_write_pdf_xobject_palettecs_stream(T2P* t2p, TIFF* output){ + + tsize_t written=0; + + written += t2p_write_pdf_stream( + (tdata_t) t2p->pdf_palette, + (tsize_t) t2p->pdf_palettesize, + output); + + return(written); +} + +/* + This function writes a PDF Image XObject Decode array to output. +*/ + +tsize_t t2p_write_pdf_xobject_decode(T2P* t2p, TIFF* output){ + + tsize_t written=0; + int i=0; + + written += t2pWriteFile(output, (tdata_t) "/Decode [ ", 10); + for (i=0;itiff_samplesperpixel;i++){ + written += t2pWriteFile(output, (tdata_t) "1 0 ", 4); + } + written += t2pWriteFile(output, (tdata_t) "]\n", 2); + + return(written); +} + +/* + This function writes a PDF Image XObject stream filter name and parameters to + output. +*/ + +tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[16]; + int buflen=0; + + if(t2p->pdf_compression==T2P_COMPRESS_NONE){ + return(written); + } + written += t2pWriteFile(output, (tdata_t) "/Filter ", 8); + switch(t2p->pdf_compression){ +#ifdef CCITT_SUPPORT + case T2P_COMPRESS_G4: + written += t2pWriteFile(output, (tdata_t) "/CCITTFaxDecode ", 16); + written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13); + written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9); + if(tile==0){ + written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); + buflen=sprintf(buffer, "%lu", + (unsigned long)t2p->tiff_width); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); + buflen=sprintf(buffer, "%lu", + (unsigned long)t2p->tiff_length); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } else { + if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){ + written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } else { + written += t2pWriteFile(output, (tdata_t) "/Columns ", 9); + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } + if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){ + written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } else { + written += t2pWriteFile(output, (tdata_t) " /Rows ", 7); + buflen=sprintf( + buffer, + "%lu", + (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + } + } + if(t2p->pdf_switchdecode == 0){ + written += t2pWriteFile(output, (tdata_t) " /BlackIs1 true ", 16); + } + written += t2pWriteFile(output, (tdata_t) ">>\n", 3); + break; +#endif +#ifdef JPEG_SUPPORT + case T2P_COMPRESS_JPEG: + written += t2pWriteFile(output, (tdata_t) "/DCTDecode ", 11); + + if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR) { + written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13); + written += t2pWriteFile(output, (tdata_t) "<< /ColorTransform 0 >>\n", 24); + } + break; +#endif +#ifdef ZIP_SUPPORT + case T2P_COMPRESS_ZIP: + written += t2pWriteFile(output, (tdata_t) "/FlateDecode ", 13); + if(t2p->pdf_compressionquality%100){ + written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13); + written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14); + _TIFFmemset(buffer, 0x00, 16); + buflen=sprintf(buffer, "%u", t2p->pdf_compressionquality%100); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " /Columns ", 10); + _TIFFmemset(buffer, 0x00, 16); + buflen = sprintf(buffer, "%lu", + (unsigned long)t2p->tiff_width); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " /Colors ", 9); + _TIFFmemset(buffer, 0x00, 16); + buflen=sprintf(buffer, "%u", t2p->tiff_samplesperpixel); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19); + _TIFFmemset(buffer, 0x00, 16); + buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) ">>\n", 3); + } + break; +#endif + default: + break; + } + + return(written); +} + +/* + This function writes a PDF xref table to output. +*/ + +tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){ + + tsize_t written=0; + char buffer[21]; + int buflen=0; + uint32 i=0; + + written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7); + buflen=sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount + 1)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22); + for (i=0;ipdf_xrefcount;i++){ + sprintf(buffer, "%.10lu 00000 n \n", + (unsigned long)t2p->pdf_xrefoffsets[i]); + written += t2pWriteFile(output, (tdata_t) buffer, 20); + } + + return(written); +} + +/* + * This function writes a PDF trailer to output. + */ + +tsize_t t2p_write_pdf_trailer(T2P* t2p, TIFF* output) +{ + + tsize_t written = 0; + char buffer[32]; + int buflen = 0; + size_t i = 0; + + for (i = 0; i < sizeof(t2p->pdf_fileid) - 8; i += 8) + snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand()); + + written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17); + buflen = sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount+1)); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + _TIFFmemset(buffer, 0x00, 32); + written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_catalog); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + _TIFFmemset(buffer, 0x00, 32); + written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_info); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + _TIFFmemset(buffer, 0x00, 32); + written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11); + written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid, + sizeof(t2p->pdf_fileid) - 1); + written += t2pWriteFile(output, (tdata_t) "><", 2); + written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid, + sizeof(t2p->pdf_fileid) - 1); + written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16); + buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_startxref); + written += t2pWriteFile(output, (tdata_t) buffer, buflen); + _TIFFmemset(buffer, 0x00, 32); + written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7); + + return(written); +} + +/* + + This function writes a PDF to a file given a pointer to a TIFF. + + The idea with using a TIFF* as output for a PDF file is that the file + can be created with TIFFClientOpen for memory-mapped use within the TIFF + library, and TIFFWriteEncodedStrip can be used to write compressed data to + the output. The output is not actually a TIFF file, it is a PDF file. + + This function uses only t2pWriteFile and TIFFWriteEncodedStrip to write to + the output TIFF file. When libtiff would otherwise be writing data to the + output file, the write procedure of the TIFF structure is replaced with an + empty implementation. + + The first argument to the function is an initialized and validated T2P + context struct pointer. + + The second argument to the function is the TIFF* that is the input that has + been opened for reading and no other functions have been called upon it. + + The third argument to the function is the TIFF* that is the output that has + been opened for writing. It has to be opened so that it hasn't written any + data to the output. If the output is seekable then it's OK to seek to the + beginning of the file. The function only writes to the output PDF and does + not seek. See the example usage in the main() function. + + TIFF* output = TIFFOpen("output.pdf", "w"); + assert(output != NULL); + + if(output->tif_seekproc != NULL){ + t2pSeekFile(output, (toff_t) 0, SEEK_SET); + } + + This function returns the file size of the output PDF file. On error it + returns zero and the t2p->t2p_error variable is set to T2P_ERR_ERROR. + + After this function completes, call t2p_free on t2p, TIFFClose on input, + and TIFFClose on output. +*/ + +tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){ + + tsize_t written=0; + ttile_t i2=0; + tsize_t streamlen=0; + uint16 i=0; + + t2p_read_tiff_init(t2p, input); + if(t2p->t2p_error!=T2P_ERR_OK){return(0);} + t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(t2p->pdf_xrefcount * sizeof(uint32) ); + if(t2p->pdf_xrefoffsets==NULL){ + TIFFError( + TIFF2PDF_MODULE, + "Can't allocate %u bytes of memory for t2p_write_pdf", + (unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) ); + t2p->t2p_error = T2P_ERR_ERROR; + return(written); + } + t2p->pdf_xrefcount=0; + t2p->pdf_catalog=1; + t2p->pdf_info=2; + t2p->pdf_pages=3; + written += t2p_write_pdf_header(t2p, output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + t2p->pdf_catalog=t2p->pdf_xrefcount; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_catalog(t2p, output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + t2p->pdf_info=t2p->pdf_xrefcount; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_info(t2p, input, output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + t2p->pdf_pages=t2p->pdf_xrefcount; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_pages(t2p, output); + written += t2p_write_pdf_obj_end(output); + for(t2p->pdf_page=0;t2p->pdf_pagetiff_pagecount;t2p->pdf_page++){ + t2p_read_tiff_data(t2p, input); + if(t2p->t2p_error!=T2P_ERR_OK){return(0);} + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_page(t2p->pdf_xrefcount, t2p, output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + written += t2p_write_pdf_page_content_stream(t2p, output); + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_length(streamlen, output); + written += t2p_write_pdf_obj_end(output); + if(t2p->tiff_transferfunctioncount != 0){ + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_transfer(t2p, output); + written += t2p_write_pdf_obj_end(output); + for(i=0; i < t2p->tiff_transferfunctioncount; i++){ + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_transfer_dict(t2p, output, i); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + written += t2p_write_pdf_transfer_stream(t2p, output, i); + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + } + } + if( (t2p->pdf_colorspace & T2P_CS_PALETTE) != 0){ + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + t2p->pdf_palettecs=t2p->pdf_xrefcount; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_stream_dict(t2p->pdf_palettesize, 0, output); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + written += t2p_write_pdf_xobject_palettecs_stream(t2p, output); + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + } + if( (t2p->pdf_colorspace & T2P_CS_ICCBASED) != 0){ + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + t2p->pdf_icccs=t2p->pdf_xrefcount; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_xobject_icccs_dict(t2p, output); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + written += t2p_write_pdf_xobject_icccs_stream(t2p, output); + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + } + if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount !=0){ + for(i2=0;i2tiff_tiles[t2p->pdf_page].tiles_tilecount;i2++){ + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_xobject_stream_dict( + i2+1, + t2p, + output); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + t2p_read_tiff_size_tile(t2p, input, i2); + written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2); + t2p_write_advance_directory(t2p, output); + if(t2p->t2p_error!=T2P_ERR_OK){return(0);} + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_length(streamlen, output); + written += t2p_write_pdf_obj_end(output); + } + } else { + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_dict_start(output); + written += t2p_write_pdf_xobject_stream_dict( + 0, + t2p, + output); + written += t2p_write_pdf_stream_dict_end(output); + written += t2p_write_pdf_stream_start(output); + streamlen=written; + t2p_read_tiff_size(t2p, input); + written += t2p_readwrite_pdf_image(t2p, input, output); + t2p_write_advance_directory(t2p, output); + if(t2p->t2p_error!=T2P_ERR_OK){return(0);} + streamlen=written-streamlen; + written += t2p_write_pdf_stream_end(output); + written += t2p_write_pdf_obj_end(output); + t2p->pdf_xrefoffsets[t2p->pdf_xrefcount++]=written; + written += t2p_write_pdf_obj_start(t2p->pdf_xrefcount, output); + written += t2p_write_pdf_stream_length(streamlen, output); + written += t2p_write_pdf_obj_end(output); + } + } + t2p->pdf_startxref = written; + written += t2p_write_pdf_xreftable(t2p, output); + written += t2p_write_pdf_trailer(t2p, output); + t2p_disable(output); + + return(written); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2ps.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2ps.c new file mode 100644 index 0000000..372230a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2ps.c @@ -0,0 +1,3073 @@ +/* $Id: tiff2ps.c,v 1.49 2011-05-31 17:10:18 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include /* for atof */ +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +/* + * Revision history + * + * 2010-Sep-17 + * Richard Nolde: Reinstate code from Feb 2009 that never got + * accepted into CVS with major modifications to handle -H and -W + * options. Replaced original PlaceImage function with several + * new functions that make support for multiple output pages + * from a single image easier to understand. Added additional + * warning messages for incompatible command line options. + * Add new command line options to specify PageOrientation + * Document Structuring Comment for landscape or portrait + * and code to determine the values from ouput width and height + * if not specified on the command line. + * Add new command line option to specify document creator + * as an alterntive to the string "tiff2ps" following model + * of patch submitted by Thomas Jarosch for specifiying a + * document title which is also supported now. + * + * 2009-Feb-11 + * Richard Nolde: Added support for rotations of 90, 180, 270 + * and auto using -r <90|180|270|auto>. Auto picks the best + * fit for the image on the specified paper size (eg portrait + * or landscape) if -h or -w is specified. Rotation is in + * degrees counterclockwise since that is how Postscript does + * it. The auto opption rotates the image 90 degrees ccw to + * produce landscape if that is a better fit than portait. + * + * Cleaned up code in TIFF2PS and broke into smaller functions + * to simplify rotations. + * + * Identified incompatible options and returned errors, eg + * -i for imagemask operator is only available for Level2 or + * Level3 Postscript in the current implmentation since there + * is a difference in the way the operands are called for Level1 + * and there is no function to provide the Level1 version. + * -H was not handled properly if -h and/or -w were specified. + * It should only clip the masked images if the scaled image + * exceeds the maxPageHeight specified with -H. + * + * New design allows for all of the following combinations: + * Conversion of TIFF to Postscript with optional rotations + * of 90, 180, 270, or auto degrees counterclockwise + * Conversion of TIFF to Postscript with entire image scaled + * to maximum of values spedified with -h or -w while + * maintaining aspect ratio. Same rotations apply. + * Conversion of TIFF to Postscript with clipping of output + * viewport to height specified with -H, producing multiple + * pages at this height and original width as needed. + * Same rotations apply. + * Conversion of TIFF to Postscript with image scaled to + * maximum specified by -h and -w and the resulting scaled + * image is presented in an output viewport clipped by -H height. + * The same rotations apply. + * + * Added maxPageWidth option using -W flag. MaxPageHeight and + * MaxPageWidth are mutually exclusive since the aspect ratio + * cannot be maintained if you set both. + * Rewrote PlaceImage to allow maxPageHeight and maxPageWidth + * options to work with values smaller or larger than the + * physical paper size and still preserve the aspect ratio. + * This is accomplished by creating multiple pages across + * as well as down if need be. + * + * 2001-Mar-21 + * I (Bruce A. Mallett) added this revision history comment ;) + * + * Fixed PS_Lvl2page() code which outputs non-ASCII85 raw + * data. Moved test for when to output a line break to + * *after* the output of a character. This just serves + * to fix an eye-nuisance where the first line of raw + * data was one character shorter than subsequent lines. + * + * Added an experimental ASCII85 encoder which can be used + * only when there is a single buffer of bytes to be encoded. + * This version is much faster at encoding a straight-line + * buffer of data because it can avoid a lot of the loop + * overhead of the byte-by-byte version. To use this version + * you need to define EXP_ASCII85ENCODER (experimental ...). + * + * Added bug fix given by Michael Schmidt to PS_Lvl2page() + * in which an end-of-data marker ('>') was not being output + * when producing non-ASCII85 encoded PostScript Level 2 + * data. + * + * Fixed PS_Lvl2colorspace() so that it no longer assumes that + * a TIFF having more than 2 planes is a CMYK. This routine + * no longer looks at the samples per pixel but instead looks + * at the "photometric" value. This change allows support of + * CMYK TIFFs. + * + * Modified the PostScript L2 imaging loop so as to test if + * the input stream is still open before attempting to do a + * flushfile on it. This was done because some RIPs close + * the stream after doing the image operation. + * + * Got rid of the realloc() being done inside a loop in the + * PSRawDataBW() routine. The code now walks through the + * byte-size array outside the loop to determine the largest + * size memory block that will be needed. + * + * Added "-m" switch to ask tiff2ps to, where possible, use the + * "imagemask" operator instead of the "image" operator. + * + * Added the "-i #" switch to allow interpolation to be disabled. + * + * Unrolled a loop or two to improve performance. + */ + +/* + * Define EXP_ASCII85ENCODER if you want to use an experimental + * version of the ASCII85 encoding routine. The advantage of + * using this routine is that tiff2ps will convert to ASCII85 + * encoding at between 3 and 4 times the speed as compared to + * using the old (non-experimental) encoder. The disadvantage + * is that you will be using a new (and unproven) encoding + * routine. So user beware, you have been warned! + */ + +#define EXP_ASCII85ENCODER + +/* + * NB: this code assumes uint32 works with printf's %l[ud]. + */ +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +int ascii85 = FALSE; /* use ASCII85 encoding */ +int interpolate = TRUE; /* interpolate level2 image */ +int level2 = FALSE; /* generate PostScript level 2 */ +int level3 = FALSE; /* generate PostScript level 3 */ +int printAll = FALSE; /* print all images in file */ +int generateEPSF = TRUE; /* generate Encapsulated PostScript */ +int PSduplex = FALSE; /* enable duplex printing */ +int PStumble = FALSE; /* enable top edge binding */ +int PSavoiddeadzone = TRUE; /* enable avoiding printer deadzone */ +double maxPageHeight = 0; /* maximum height to select from image and print per page */ +double maxPageWidth = 0; /* maximum width to select from image and print per page */ +double splitOverlap = 0; /* amount for split pages to overlag */ +int rotation = 0; /* optional value for rotation angle */ +int auto_rotate = 0; /* rotate image for best fit on the page */ +char *filename = NULL; /* input filename */ +char *title = NULL; /* optional document title string */ +char *creator = NULL; /* optional document creator string */ +char pageOrientation[12]; /* set optional PageOrientation DSC to Landscape or Portrait */ +int useImagemask = FALSE; /* Use imagemask instead of image operator */ +uint16 res_unit = 0; /* Resolution units: 2 - inches, 3 - cm */ + +/* + * ASCII85 Encoding Support. + */ +unsigned char ascii85buf[10]; +int ascii85count; +int ascii85breaklen; + +int TIFF2PS(FILE*, TIFF*, double, double, double, double, int); +void PSpage(FILE*, TIFF*, uint32, uint32); +void PSColorContigPreamble(FILE*, uint32, uint32, int); +void PSColorSeparatePreamble(FILE*, uint32, uint32, int); +void PSDataColorContig(FILE*, TIFF*, uint32, uint32, int); +void PSDataColorSeparate(FILE*, TIFF*, uint32, uint32, int); +void PSDataPalette(FILE*, TIFF*, uint32, uint32); +void PSDataBW(FILE*, TIFF*, uint32, uint32); +void PSRawDataBW(FILE*, TIFF*, uint32, uint32); +void Ascii85Init(void); +void Ascii85Put(unsigned char code, FILE* fd); +void Ascii85Flush(FILE* fd); +void PSHead(FILE*, double, double, double, double); +void PSTail(FILE*, int); +int psStart(FILE *, int, int, int *, double *, double, double, double, + double, double, double, double, double, double, double); +int psPageSize(FILE *, int, double, double, double, double, double, double); +int psRotateImage(FILE *, int, double, double, double, double); +int psMaskImage(FILE *, TIFF *, int, int, int *, double, double, + double, double, double, double, double, double, double); +int psScaleImage(FILE *, double, int, int, double, double, double, double, + double, double); +int get_viewport (double, double, double, double, double *, double *, int); +int exportMaskedImage(FILE *, double, double, double, double, int, int, + double, double, double, int, int); + +#if defined( EXP_ASCII85ENCODER) +tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l ); +#endif + +static void usage(int); + +int +main(int argc, char* argv[]) +{ + int dirnum = -1, c, np = 0; + int centered = 0; + double bottommargin = 0; + double leftmargin = 0; + double pageWidth = 0; + double pageHeight = 0; + uint32 diroff = 0; + extern char *optarg; + extern int optind; + FILE* output = stdout; + + pageOrientation[0] = '\0'; + + while ((c = getopt(argc, argv, "b:d:h:H:W:L:i:w:l:o:O:P:C:r:t:acemxyzps1238DT")) != -1) + switch (c) { + case 'b': + bottommargin = atof(optarg); + break; + case 'c': + centered = 1; + break; + case 'C': + creator = optarg; + break; + case 'd': /* without -a, this only processes one image at this IFD */ + dirnum = atoi(optarg); + break; + case 'D': + PSduplex = TRUE; + break; + case 'i': + interpolate = atoi(optarg) ? TRUE:FALSE; + break; + case 'T': + PStumble = TRUE; + break; + case 'e': + PSavoiddeadzone = FALSE; + generateEPSF = TRUE; + break; + case 'h': + pageHeight = atof(optarg); + break; + case 'H': + maxPageHeight = atof(optarg); + break; + case 'W': + maxPageWidth = atof(optarg); + break; + case 'L': + splitOverlap = atof(optarg); + break; + case 'm': + useImagemask = TRUE; + break; + case 'o': + switch (optarg[0]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': diroff = (uint32) strtoul(optarg, NULL, 0); + break; + default: TIFFError ("-o", "Offset must be a numeric value."); + exit (1); + } + break; + case 'O': /* XXX too bad -o is already taken */ + output = fopen(optarg, "w"); + if (output == NULL) { + fprintf(stderr, + "%s: %s: Cannot open output file.\n", + argv[0], optarg); + exit(-2); + } + break; + case 'P': + switch (optarg[0]) + { + case 'l': + case 'L': strcpy (pageOrientation, "Landscape"); + break; + case 'p': + case 'P': strcpy (pageOrientation, "Portrait"); + break; + default: TIFFError ("-P", "Page orientation must be Landscape or Portrait"); + exit (-1); + } + break; + case 'l': + leftmargin = atof(optarg); + break; + case 'a': /* removed fall through to generate warning below, R Nolde 09-01-2010 */ + printAll = TRUE; + break; + case 'p': + generateEPSF = FALSE; + break; + case 'r': + if (strcmp (optarg, "auto") == 0) + { + rotation = 0; + auto_rotate = TRUE; + } + else + { + rotation = atoi(optarg); + auto_rotate = FALSE; + } + switch (rotation) + { + case 0: + case 90: + case 180: + case 270: + break; + default: + fprintf (stderr, "Rotation angle must be 90, 180, 270 (degrees ccw) or auto\n"); + exit (-1); + } + break; + case 's': + printAll = FALSE; + break; + case 't': + title = optarg; + break; + case 'w': + pageWidth = atof(optarg); + break; + case 'z': + PSavoiddeadzone = FALSE; + break; + case '1': + level2 = FALSE; + level3 = FALSE; + ascii85 = FALSE; + break; + case '2': + level2 = TRUE; + ascii85 = TRUE; /* default to yes */ + break; + case '3': + level3 = TRUE; + ascii85 = TRUE; /* default to yes */ + break; + case '8': + ascii85 = FALSE; + break; + case 'x': + res_unit = RESUNIT_CENTIMETER; + break; + case 'y': + res_unit = RESUNIT_INCH; + break; + case '?': + usage(-1); + } + + if (useImagemask == TRUE) + { + if ((level2 == FALSE) && (level3 == FALSE)) + { + TIFFError ("-m "," imagemask operator requres Postscript Level2 or Level3"); + exit (1); + } + } + + if (pageWidth && (maxPageWidth > pageWidth)) + { + TIFFError ("-W", "Max viewport width cannot exceed page width"); + exit (1); + } + + if (pageHeight && (maxPageHeight > pageHeight)) + { + TIFFError ("-H", "Max viewport height cannot exceed page height"); + exit (1); + } + + /* auto rotate requires a specified page width and height */ + if (auto_rotate == TRUE) + { + if ((pageWidth == 0) || (pageHeight == 0)) + TIFFWarning ("-r auto", " requires page height and width specified with -h and -w"); + + if ((maxPageWidth > 0) || (maxPageHeight > 0)) + { + TIFFError ("-r auto", " is incompatible with maximum page width/height specified by -H or -W"); + exit (1); + } + } + if ((maxPageWidth > 0) && (maxPageHeight > 0)) + { + TIFFError ("-H and -W", " Use only one of -H or -W to define a viewport"); + exit (1); + } + + if ((generateEPSF == TRUE) && (printAll == TRUE)) + { + TIFFError(" -e and -a", "Warning: Cannot generate Encapsulated Postscript for multiple images"); + generateEPSF = FALSE; + } + + if ((generateEPSF == TRUE) && (PSduplex == TRUE)) + { + TIFFError(" -e and -D", "Warning: Encapsulated Postscript does not support Duplex option"); + PSduplex = FALSE; + } + + if ((generateEPSF == TRUE) && (PStumble == TRUE)) + { + TIFFError(" -e and -T", "Warning: Encapsulated Postscript does not support Top Edge Binding option"); + PStumble = FALSE; + } + + if ((generateEPSF == TRUE) && (PSavoiddeadzone == TRUE)) + PSavoiddeadzone = FALSE; + + for (; argc - optind > 0; optind++) { + TIFF* tif = TIFFOpen(filename = argv[optind], "r"); + if (tif != NULL) { + if (dirnum != -1 + && !TIFFSetDirectory(tif, (tdir_t)dirnum)) + return (-1); + else if (diroff != 0 && + !TIFFSetSubDirectory(tif, diroff)) + return (-1); + np = TIFF2PS(output, tif, pageWidth, pageHeight, + leftmargin, bottommargin, centered); + if (np < 0) + { + TIFFError("Error", "Unable to process %s", filename); + } + TIFFClose(tif); + } + } + if (np) + PSTail(output, np); + else + usage(-1); + if (output != stdout) + fclose(output); + return (0); +} + +static uint16 samplesperpixel; +static uint16 bitspersample; +static uint16 planarconfiguration; +static uint16 photometric; +static uint16 compression; +static uint16 extrasamples; +static int alpha; + +static int +checkImage(TIFF* tif) +{ + switch (photometric) { + case PHOTOMETRIC_YCBCR: + if ((compression == COMPRESSION_JPEG || compression == COMPRESSION_OJPEG) + && planarconfiguration == PLANARCONFIG_CONTIG) { + /* can rely on libjpeg to convert to RGB */ + TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, + JPEGCOLORMODE_RGB); + photometric = PHOTOMETRIC_RGB; + } else { + if (level2 || level3) + break; + TIFFError(filename, "Can not handle image with %s", + "PhotometricInterpretation=YCbCr"); + return (0); + } + /* fall thru... */ + case PHOTOMETRIC_RGB: + if (alpha && bitspersample != 8) { + TIFFError(filename, + "Can not handle %d-bit/sample RGB image with alpha", + bitspersample); + return (0); + } + /* fall thru... */ + case PHOTOMETRIC_SEPARATED: + case PHOTOMETRIC_PALETTE: + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_MINISWHITE: + break; + case PHOTOMETRIC_LOGL: + case PHOTOMETRIC_LOGLUV: + if (compression != COMPRESSION_SGILOG && + compression != COMPRESSION_SGILOG24) { + TIFFError(filename, + "Can not handle %s data with compression other than SGILog", + (photometric == PHOTOMETRIC_LOGL) ? + "LogL" : "LogLuv" + ); + return (0); + } + /* rely on library to convert to RGB/greyscale */ + TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT); + photometric = (photometric == PHOTOMETRIC_LOGL) ? + PHOTOMETRIC_MINISBLACK : PHOTOMETRIC_RGB; + bitspersample = 8; + break; + case PHOTOMETRIC_CIELAB: + /* fall thru... */ + default: + TIFFError(filename, + "Can not handle image with PhotometricInterpretation=%d", + photometric); + return (0); + } + switch (bitspersample) { + case 1: case 2: + case 4: case 8: + case 16: + break; + default: + TIFFError(filename, "Can not handle %d-bit/sample image", + bitspersample); + return (0); + } + if (planarconfiguration == PLANARCONFIG_SEPARATE && extrasamples > 0) + TIFFWarning(filename, "Ignoring extra samples"); + return (1); +} + +#define PS_UNIT_SIZE 72.0F +#define PSUNITS(npix,res) ((npix) * (PS_UNIT_SIZE / (res))) + +static char RGBcolorimage[] = "\ +/bwproc {\n\ + rgbproc\n\ + dup length 3 idiv string 0 3 0\n\ + 5 -1 roll {\n\ + add 2 1 roll 1 sub dup 0 eq {\n\ + pop 3 idiv\n\ + 3 -1 roll\n\ + dup 4 -1 roll\n\ + dup 3 1 roll\n\ + 5 -1 roll put\n\ + 1 add 3 0\n\ + } { 2 1 roll } ifelse\n\ + } forall\n\ + pop pop pop\n\ +} def\n\ +/colorimage where {pop} {\n\ + /colorimage {pop pop /rgbproc exch def {bwproc} image} bind def\n\ +} ifelse\n\ +"; + +/* + * Adobe Photoshop requires a comment line of the form: + * + * %ImageData:
    + * <1 for binary|2 for hex> "data start" + * + * It is claimed to be part of some future revision of the EPS spec. + */ +static void +PhotoshopBanner(FILE* fd, uint32 w, uint32 h, int bs, int nc, char* startline) +{ + fprintf(fd, "%%ImageData: %ld %ld %d %d 0 %d 2 \"", + (long) w, (long) h, bitspersample, nc, bs); + fprintf(fd, startline, nc); + fprintf(fd, "\"\n"); +} + +/* Convert pixel width and height pw, ph, to points pprw, pprh + * using image resolution and resolution units from TIFF tags. + * pw : image width in pixels + * ph : image height in pixels + * pprw : image width in PS units (72 dpi) + * pprh : image height in PS units (72 dpi) + */ +static void +setupPageState(TIFF* tif, uint32* pw, uint32* ph, double* pprw, double* pprh) +{ + float xres = 0.0F, yres = 0.0F; + + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, pw); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, ph); + if (res_unit == 0) /* Not specified as command line option */ + if (!TIFFGetFieldDefaulted(tif, TIFFTAG_RESOLUTIONUNIT, &res_unit)) + res_unit = RESUNIT_INCH; + /* + * Calculate printable area. + */ + if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) + || fabs(xres) < 0.0000001) + xres = PS_UNIT_SIZE; + if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) + || fabs(yres) < 0.0000001) + yres = PS_UNIT_SIZE; + switch (res_unit) { + case RESUNIT_CENTIMETER: + xres *= 2.54F, yres *= 2.54F; + break; + case RESUNIT_INCH: + break; + case RESUNIT_NONE: /* Subsequent code assumes we have converted to inches! */ + res_unit = RESUNIT_INCH; + break; + default: /* Last ditch guess for unspecified RESUNIT case + * check that the resolution is not inches before scaling it. + * Moved to end of function with additional check, RJN, 08-31-2010 + * if (xres != PS_UNIT_SIZE || yres != PS_UNIT_SIZE) + * xres *= PS_UNIT_SIZE, yres *= PS_UNIT_SIZE; + */ + break; + } + /* This is a hack to deal with images that have no meaningful Resolution Size + * but may have x and/or y resolutions of 1 pixel per undefined unit. + */ + if ((xres > 1.0) && (xres != PS_UNIT_SIZE)) + *pprw = PSUNITS(*pw, xres); + else + *pprw = PSUNITS(*pw, PS_UNIT_SIZE); + if ((yres > 1.0) && (yres != PS_UNIT_SIZE)) + *pprh = PSUNITS(*ph, yres); + else + *pprh = PSUNITS(*ph, PS_UNIT_SIZE); +} + +static int +isCCITTCompression(TIFF* tif) +{ + uint16 compress; + TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress); + return (compress == COMPRESSION_CCITTFAX3 || + compress == COMPRESSION_CCITTFAX4 || + compress == COMPRESSION_CCITTRLE || + compress == COMPRESSION_CCITTRLEW); +} + +static tsize_t tf_bytesperrow; +static tsize_t ps_bytesperrow; +static tsize_t tf_rowsperstrip; +static tsize_t tf_numberstrips; +static char *hex = "0123456789abcdef"; + +/* + * Pagewidth and pageheight are the output size in points, + * may refer to values specified with -h and -w, or to + * values read from the image if neither -h nor -w are used. + * Imagewidth and imageheight are image size in points. + * Ximages and Yimages are number of pages across and down. + * Only one of maxPageHeight or maxPageWidth can be used. + * These are global variables unfortunately. + */ +int get_subimage_count(double pagewidth, double pageheight, + double imagewidth, double imageheight, + int *ximages, int *yimages, + int rotation, double scale) +{ + int pages = 1; + double splitheight = 0; /* Requested Max Height in points */ + double splitwidth = 0; /* Requested Max Width in points */ + double overlap = 0; /* Repeated edge width in points */ + + splitheight = maxPageHeight * PS_UNIT_SIZE; + splitwidth = maxPageWidth * PS_UNIT_SIZE; + overlap = splitOverlap * PS_UNIT_SIZE; + pagewidth *= PS_UNIT_SIZE; + pageheight *= PS_UNIT_SIZE; + + if ((imagewidth < 1.0) || (imageheight < 1.0)) + { + TIFFError("get_subimage_count", "Invalid image width or height"); + return (0); + } + + switch (rotation) + { + case 0: + case 180: if (splitheight > 0) /* -H maxPageHeight */ + { + if (imageheight > splitheight) /* More than one vertical image segment */ + { + if (pagewidth) + *ximages = (int)ceil((scale * imagewidth) / (pagewidth - overlap)); + else + *ximages = 1; + *yimages = (int)ceil((scale * imageheight) / (splitheight - overlap)); /* Max vert pages needed */ + } + else + { + if (pagewidth) + *ximages = (int)ceil((scale * imagewidth) / (pagewidth - overlap)); /* Max horz pages needed */ + else + *ximages = 1; + *yimages = 1; /* Max vert pages needed */ + } + } + else + { + if (splitwidth > 0) /* -W maxPageWidth */ + { + if (imagewidth >splitwidth) + { + *ximages = (int)ceil((scale * imagewidth) / (splitwidth - overlap)); /* Max horz pages needed */ + if (pageheight) + *yimages = (int)ceil((scale * imageheight) / (pageheight - overlap)); /* Max vert pages needed */ + else + *yimages = 1; + } + else + { + *ximages = 1; /* Max vert pages needed */ + if (pageheight) + *yimages = (int)ceil((scale * imageheight) / (pageheight - overlap)); /* Max vert pages needed */ + else + *yimages = 1; + } + } + else + { + *ximages = 1; + *yimages = 1; + } + } + break; + case 90: + case 270: if (splitheight > 0) /* -H maxPageHeight */ + { + if (imagewidth > splitheight) /* More than one vertical image segment */ + { + *yimages = (int)ceil((scale * imagewidth) / (splitheight - overlap)); /* Max vert pages needed */ + if (pagewidth) + *ximages = (int)ceil((scale * imageheight) / (pagewidth - overlap)); /* Max horz pages needed */ + else + *ximages = 1; + } + else + { + *yimages = 1; /* Max vert pages needed */ + if (pagewidth) + *ximages = (int)ceil((scale * imageheight) / (pagewidth - overlap)); /* Max horz pages needed */ + else + *ximages = 1; + } + } + else + { + if (splitwidth > 0) /* -W maxPageWidth */ + { + if (imageheight > splitwidth) + { + if (pageheight) + *yimages = (int)ceil((scale * imagewidth) / (pageheight - overlap)); /* Max vert pages needed */ + else + *yimages = 1; + *ximages = (int)ceil((scale * imageheight) / (splitwidth - overlap)); /* Max horz pages needed */ + } + else + { + if (pageheight) + *yimages = (int)ceil((scale * imagewidth) / (pageheight - overlap)); /* Max horz pages needed */ + else + *yimages = 1; + *ximages = 1; /* Max vert pages needed */ + } + } + else + { + *ximages = 1; + *yimages = 1; + } + } + break; + default: *ximages = 1; + *yimages = 1; + } + pages = (*ximages) * (*yimages); + return (pages); + } + +/* New version of PlaceImage that handles only the translation and rotation + * for a single output page. + */ +int exportMaskedImage(FILE *fp, double pagewidth, double pageheight, + double imagewidth, double imageheight, + int row, int column, + double left_offset, double bott_offset, + double scale, int center, int rotation) + { + double xtran = 0.0; + double ytran = 0.0; + + double xscale = 1.0; + double yscale = 1.0; + + double splitheight = 0; /* Requested Max Height in points */ + double splitwidth = 0; /* Requested Max Width in points */ + double overlap = 0; /* Repeated edge width in points */ + double subimage_height = 0.0; + + splitheight = maxPageHeight * PS_UNIT_SIZE; + splitwidth = maxPageWidth * PS_UNIT_SIZE; + overlap = splitOverlap * PS_UNIT_SIZE; + xscale = scale * imagewidth; + yscale = scale * imageheight; + + if ((xscale < 0.0) || (yscale < 0.0)) + { + TIFFError("exportMaskedImage", "Invalid parameters."); + return (-1); + } + + /* If images are cropped to a vewport with -H or -W, the output pages are shifted to + * the top of each output page rather than the Postscript default lower edge. + */ + switch (rotation) + { + case 0: + case 180: if (splitheight > 0) /* -H maxPageHeight */ + { + if (splitheight < imageheight) /* More than one vertical image segments */ + { + xtran = -1.0 * column * (pagewidth - overlap); + subimage_height = imageheight - ((splitheight - overlap) * row); + ytran = pageheight - subimage_height * (pageheight / splitheight); + } + else /* Only one page in vertical direction */ + { + xtran = -1.0 * column * (pagewidth - overlap); + ytran = splitheight - imageheight; + } + } + else + { + if (splitwidth > 0) /* maxPageWidth */ + { + if (splitwidth < imagewidth) + { + xtran = -1.0 * column * splitwidth; + ytran = -1.0 * row * (pageheight - overlap); + } + else /* Only one page in horizontal direction */ + { + ytran = -1.0 * row * (pageheight - overlap); + xtran = 0; + } + } + else /* Simple case, no splitting */ + { + ytran = pageheight - imageheight; + xtran = 0; + } + } + bott_offset += ytran / (center ? 2 : 1); + left_offset += xtran / (center ? 2 : 1); + break; + case 90: + case 270: if (splitheight > 0) /* -H maxPageHeight */ + { + if (splitheight < imagewidth) /* More than one vertical image segments */ + { + xtran = -1.0 * column * (pageheight - overlap); + /* Commented code places image at bottom of page instead of top. + ytran = -1.0 * row * splitheight; + */ + if (row == 0) + ytran = -1.0 * (imagewidth - splitheight); + else + ytran = -1.0 * (imagewidth - (splitheight - overlap) * (row + 1)); + } + else /* Only one page in vertical direction */ + { + xtran = -1.0 * column * (pageheight - overlap); + ytran = splitheight - imagewidth; + } + } + else + { + if (splitwidth > 0) /* maxPageWidth */ + { + if (splitwidth < imageheight) + { + xtran = -1.0 * column * splitwidth; + ytran = -1.0 * row * (pagewidth - overlap); + } + else /* Only one page in horizontal direction */ + { + ytran = -1.0 * row * (pagewidth - overlap); + xtran = 0; + } + } + else /* Simple case, no splitting */ + { + ytran = pageheight - imageheight; + xtran = 0; /* pagewidth - imagewidth; */ + } + } + bott_offset += ytran / (center ? 2 : 1); + left_offset += xtran / (center ? 2 : 1); + break; + default: xtran = 0; + ytran = 0; + } + + switch (rotation) + { + case 0: fprintf(fp, "%f %f translate\n", left_offset, bott_offset); + fprintf(fp, "%f %f scale\n", xscale, yscale); + break; + case 180: fprintf(fp, "%f %f translate\n", left_offset, bott_offset); + fprintf(fp, "%f %f scale\n1 1 translate 180 rotate\n", xscale, yscale); + break; + case 90: fprintf(fp, "%f %f translate\n", left_offset, bott_offset); + fprintf(fp, "%f %f scale\n1 0 translate 90 rotate\n", yscale, xscale); + break; + case 270: fprintf(fp, "%f %f translate\n", left_offset, bott_offset); + fprintf(fp, "%f %f scale\n0 1 translate 270 rotate\n", yscale, xscale); + break; + default: TIFFError ("exportMaskedImage", "Unsupported rotation angle %d. No rotation", rotation); + fprintf( fp, "%f %f scale\n", xscale, yscale); + break; + } + + return (0); + } + +/* Rotate an image without scaling or clipping */ +int psRotateImage (FILE * fd, int rotation, double pswidth, double psheight, + double left_offset, double bottom_offset) + { + if ((left_offset != 0.0) || (bottom_offset != 0)) + fprintf (fd, "%f %f translate\n", left_offset, bottom_offset); + + /* Exchange width and height for 90/270 rotations */ + switch (rotation) + { + case 0: fprintf (fd, "%f %f scale\n", pswidth, psheight); + break; + case 90: fprintf (fd, "%f %f scale\n1 0 translate 90 rotate\n", psheight, pswidth); + break; + case 180: fprintf (fd, "%f %f scale\n1 1 translate 180 rotate\n", pswidth, psheight); + break; + case 270: fprintf (fd, "%f %f scale\n0 1 translate 270 rotate\n", psheight, pswidth); + break; + default: TIFFError ("psRotateImage", "Unsupported rotation %d.", rotation); + fprintf( fd, "%f %f scale\n", pswidth, psheight); + return (1); + } + return (0); + } + +/* Scale and rotate an image to a single output page. */ +int psScaleImage(FILE * fd, double scale, int rotation, int center, + double reqwidth, double reqheight, double pswidth, double psheight, + double left_offset, double bottom_offset) + { + double hcenter = 0.0, vcenter = 0.0; + + /* Adjust offsets for centering */ + if (center) + { + switch (rotation) + { + case 90: vcenter = (reqheight - pswidth * scale) / 2; + hcenter = (reqwidth - psheight * scale) / 2; + fprintf (fd, "%f %f translate\n", hcenter, vcenter); + fprintf (fd, "%f %f scale\n1 0 translate 90 rotate\n", psheight * scale, pswidth * scale); + break; + case 180: hcenter = (reqwidth - pswidth * scale) / 2; + vcenter = (reqheight - psheight * scale) / 2; + fprintf (fd, "%f %f translate\n", hcenter, vcenter); + fprintf (fd, "%f %f scale\n1 1 translate 180 rotate\n", pswidth * scale, psheight * scale); + break; + case 270: vcenter = (reqheight - pswidth * scale) / 2; + hcenter = (reqwidth - psheight * scale) / 2; + fprintf (fd, "%f %f translate\n", hcenter, vcenter); + fprintf (fd, "%f %f scale\n0 1 translate 270 rotate\n", psheight * scale, pswidth * scale); + break; + case 0: + default: hcenter = (reqwidth - pswidth * scale) / 2; + vcenter = (reqheight - psheight * scale) / 2; + fprintf (fd, "%f %f translate\n", hcenter, vcenter); + fprintf (fd, "%f %f scale\n", pswidth * scale, psheight * scale); + break; + } + } + else /* Not centered */ + { + switch (rotation) + { + case 0: fprintf (fd, "%f %f translate\n", left_offset ? left_offset : 0.0, + bottom_offset ? bottom_offset : reqheight - (psheight * scale)); + fprintf (fd, "%f %f scale\n", pswidth * scale, psheight * scale); + break; + case 90: fprintf (fd, "%f %f translate\n", left_offset ? left_offset : 0.0, + bottom_offset ? bottom_offset : reqheight - (pswidth * scale)); + fprintf (fd, "%f %f scale\n1 0 translate 90 rotate\n", psheight * scale, pswidth * scale); + break; + case 180: fprintf (fd, "%f %f translate\n", left_offset ? left_offset : 0.0, + bottom_offset ? bottom_offset : reqheight - (psheight * scale)); + fprintf (fd, "%f %f scale\n1 1 translate 180 rotate\n", pswidth * scale, psheight * scale); + break; + case 270: fprintf (fd, "%f %f translate\n", left_offset ? left_offset : 0.0, + bottom_offset ? bottom_offset : reqheight - (pswidth * scale)); + fprintf (fd, "%f %f scale\n0 1 translate 270 rotate\n", psheight * scale, pswidth * scale); + break; + default: TIFFError ("psScaleImage", "Unsupported rotation %d", rotation); + fprintf (fd, "%f %f scale\n", pswidth * scale, psheight * scale); + return (1); + } + } + + return (0); + } + +/* This controls the visible portion of the page which is displayed. + * N.B. Setting maxPageHeight no longer sets pageheight if not set explicitly + */ +int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight, + double reqwidth, double reqheight, double pswidth, double psheight) + { + double xscale = 1.0, yscale = 1.0, scale = 1.0; + double splitheight; + double splitwidth; + double new_width; + double new_height; + + splitheight = maxPageHeight * PS_UNIT_SIZE; + splitwidth = maxPageWidth * PS_UNIT_SIZE; + + switch (rotation) + { + case 0: + case 180: if ((splitheight > 0) || (splitwidth > 0)) + { + if (pgwidth != 0 || pgheight != 0) + { + xscale = reqwidth / (splitwidth ? splitwidth : pswidth); + yscale = reqheight / (splitheight ? splitheight : psheight); + scale = (xscale < yscale) ? xscale : yscale; + } + new_width = splitwidth ? splitwidth : scale * pswidth; + new_height = splitheight ? splitheight : scale * psheight; + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (new_width > new_height) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)new_width, (long)new_height); + fprintf (fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + new_width, new_height); + } + else /* No viewport defined with -H or -W */ + { + if ((pgwidth == 0) && (pgheight == 0)) /* Image not scaled */ + { + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (pswidth > psheight) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)pswidth, (long)psheight); + fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + pswidth, psheight); + } + else /* Image scaled */ + { + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (reqwidth > reqheight) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)reqwidth, (long)reqheight); + fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + reqwidth, reqheight); + } + } + break; + case 90: + case 270: if ((splitheight > 0) || (splitwidth > 0)) + { + if (pgwidth != 0 || pgheight != 0) + { + xscale = reqwidth / (splitwidth ? splitwidth : pswidth); + yscale = reqheight / (splitheight ? splitheight : psheight); + scale = (xscale < yscale) ? xscale : yscale; + } + new_width = splitwidth ? splitwidth : scale * psheight; + new_height = splitheight ? splitheight : scale * pswidth; + + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (new_width > new_height) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)new_width, (long)new_height); + fprintf (fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + new_width, new_height); + } + else + { + if ((pgwidth == 0) && (pgheight == 0)) /* Image not scaled */ + { + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (psheight > pswidth) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)psheight, (long)pswidth); + fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + psheight, pswidth); + } + else /* Image scaled */ + { + if (strlen(pageOrientation)) + fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation); + else + fprintf (fd, "%%%%PageOrientation: %s\n", (reqwidth > reqheight) ? "Landscape" : "Portrait"); + fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)reqwidth, (long)reqheight); + fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n", + reqwidth, reqheight); + } + } + break; + default: TIFFError ("psPageSize", "Invalid rotation %d", rotation); + return (1); + } + fputs("<<\n /Policies <<\n /PageSize 3\n >>\n>> setpagedevice\n", fd); + + return (0); + } /* end psPageSize */ + +/* Mask an image as a series of pages, each only showing a section defined + * by the maxPageHeight or maxPageWidth options. + */ +int psMaskImage(FILE *fd, TIFF *tif, int rotation, int center, + int *npages, double pixwidth, double pixheight, + double left_margin, double bottom_margin, + double pgwidth, double pgheight, + double pswidth, double psheight, double scale) + { + int i, j; + int ximages = 1, yimages = 1; + int pages = *npages; + double view_width = 0; + double view_height = 0; + + if (get_viewport (pgwidth, pgheight, pswidth, psheight, &view_width, &view_height, rotation)) + { + TIFFError ("get_viewport", "Unable to set image viewport"); + return (-1); + } + + if (get_subimage_count(pgwidth, pgheight, pswidth, psheight, + &ximages, &yimages, rotation, scale) < 1) + { + TIFFError("get_subimage_count", "Invalid image count: %d columns, %d rows", ximages, yimages); + return (-1); + } + + for (i = 0; i < yimages; i++) + { + for (j = 0; j < ximages; j++) + { + pages++; + *npages = pages; + fprintf(fd, "%%%%Page: %d %d\n", pages, pages); + + /* Write out the PageSize info for non EPS files */ + if (!generateEPSF && ( level2 || level3 )) + { + if (psPageSize(fd, rotation, pgwidth, pgheight, + view_width, view_height, pswidth, psheight)) + return (-1); + } + fprintf(fd, "gsave\n"); + fprintf(fd, "100 dict begin\n"); + if (exportMaskedImage(fd, view_width, view_height, pswidth, psheight, + i, j, left_margin, bottom_margin, + scale, center, rotation)) + { + TIFFError("exportMaskedImage", "Invalid image parameters."); + return (-1); + } + PSpage(fd, tif, pixwidth, pixheight); + fprintf(fd, "end\n"); + fprintf(fd, "grestore\n"); + fprintf(fd, "showpage\n"); + } + } + + return (pages); + } + +/* Compute scale factor and write out file header */ +int psStart(FILE *fd, int npages, int auto_rotate, int *rotation, double *scale, + double ox, double oy, double pgwidth, double pgheight, + double reqwidth, double reqheight, double pswidth, double psheight, + double left_offset, double bottom_offset) + { + double maxsource = 0.0; /* Used for auto rotations */ + double maxtarget = 0.0; + double xscale = 1.0, yscale = 1.0; + double splitheight; + double splitwidth; + double view_width = 0.0, view_height = 0.0; + double page_width = 0.0, page_height = 0.0; + + /* Splitheight and splitwidth are in inches */ + splitheight = maxPageHeight * PS_UNIT_SIZE; + splitwidth = maxPageWidth * PS_UNIT_SIZE; + + page_width = pgwidth * PS_UNIT_SIZE; + page_height = pgheight * PS_UNIT_SIZE; + + /* If user has specified a page width and height and requested the + * image to be auto-rotated to fit on that media, we match the + * longest dimension of the image to the longest dimension of the + * target media but we have to ignore auto rotate if user specified + * maxPageHeight since this makes life way too complicated. */ + if (auto_rotate) + { + if ((splitheight != 0) || (splitwidth != 0)) + { + TIFFError ("psStart", "Auto-rotate is incompatible with page splitting "); + return (1); + } + + /* Find longest edges in image and output media */ + maxsource = (pswidth >= psheight) ? pswidth : psheight; + maxtarget = (reqwidth >= reqheight) ? reqwidth : reqheight; + + if (((maxsource == pswidth) && (maxtarget != reqwidth)) || + ((maxsource == psheight) && (maxtarget != reqheight))) + { /* optimal orientaion does not match input orientation */ + *rotation = 90; + xscale = (reqwidth - left_offset)/psheight; + yscale = (reqheight - bottom_offset)/pswidth; + } + else /* optimal orientaion matches input orientation */ + { + xscale = (reqwidth - left_offset)/pswidth; + yscale = (reqheight - bottom_offset)/psheight; + } + *scale = (xscale < yscale) ? xscale : yscale; + + /* Do not scale image beyound original size */ + if (*scale > 1.0) + *scale = 1.0; + + /* Set the size of the displayed image to requested page size + * and optimal orientation. + */ + if (!npages) + PSHead(fd, reqwidth, reqheight, ox, oy); + + return (0); + } + + /* N.B. If pgwidth or pgheight are set from maxPageHeight/Width, + * we have a problem with the tests below under splitheight. + */ + + switch (*rotation) /* Auto rotate has NOT been specified */ + { + case 0: + case 180: if ((splitheight != 0) || (splitwidth != 0)) + { /* Viewport clipped to maxPageHeight or maxPageWidth */ + if ((page_width != 0) || (page_height != 0)) /* Image scaled */ + { + xscale = (reqwidth - left_offset) / (page_width ? page_width : pswidth); + yscale = (reqheight - bottom_offset) / (page_height ? page_height : psheight); + *scale = (xscale < yscale) ? xscale : yscale; + /* + if (*scale > 1.0) + *scale = 1.0; + */ + } + else /* Image clipped but not scaled */ + *scale = 1.0; + + view_width = splitwidth ? splitwidth : *scale * pswidth; + view_height = splitheight ? splitheight: *scale * psheight; + } + else /* Viewport not clipped to maxPageHeight or maxPageWidth */ + { + if ((page_width != 0) || (page_height != 0)) + { /* Image scaled */ + xscale = (reqwidth - left_offset) / pswidth; + yscale = (reqheight - bottom_offset) / psheight; + + view_width = reqwidth; + view_height = reqheight; + } + else + { /* Image not scaled */ + xscale = (pswidth - left_offset)/pswidth; + yscale = (psheight - bottom_offset)/psheight; + + view_width = pswidth; + view_height = psheight; + } + } + break; + case 90: + case 270: if ((splitheight != 0) || (splitwidth != 0)) + { /* Viewport clipped to maxPageHeight or maxPageWidth */ + if ((page_width != 0) || (page_height != 0)) /* Image scaled */ + { + xscale = (reqwidth - left_offset)/ psheight; + yscale = (reqheight - bottom_offset)/ pswidth; + *scale = (xscale < yscale) ? xscale : yscale; + /* + if (*scale > 1.0) + *scale = 1.0; + */ + } + else /* Image clipped but not scaled */ + *scale = 1.0; + view_width = splitwidth ? splitwidth : *scale * psheight; + view_height = splitheight ? splitheight : *scale * pswidth; + } + else /* Viewport not clipped to maxPageHeight or maxPageWidth */ + { + if ((page_width != 0) || (page_height != 0)) /* Image scaled */ + { + xscale = (reqwidth - left_offset) / psheight; + yscale = (reqheight - bottom_offset) / pswidth; + + view_width = reqwidth; + view_height = reqheight; + } + else + { + xscale = (pswidth - left_offset)/ psheight; + yscale = (psheight - bottom_offset)/ pswidth; + + view_width = psheight; + view_height = pswidth; + } + } + break; + default: TIFFError ("psPageSize", "Invalid rotation %d", *rotation); + return (1); + } + + if (!npages) + PSHead(fd, (page_width ? page_width : view_width), (page_height ? page_height : view_height), ox, oy); + + *scale = (xscale < yscale) ? xscale : yscale; + if (*scale > 1.0) + *scale = 1.0; + + return (0); + } + +int get_viewport (double pgwidth, double pgheight, double pswidth, double psheight, + double *view_width, double *view_height, int rotation) + { + /* Only one of maxPageHeight or maxPageWidth can be specified */ + if (maxPageHeight != 0) /* Clip the viewport to maxPageHeight on each page */ + { + *view_height = maxPageHeight * PS_UNIT_SIZE; + /* + * if (res_unit == RESUNIT_CENTIMETER) + * *view_height /= 2.54F; + */ + } + else + { + if (pgheight != 0) /* User has set PageHeight with -h flag */ + { + *view_height = pgheight * PS_UNIT_SIZE; /* Postscript size for Page Height in inches */ + /* if (res_unit == RESUNIT_CENTIMETER) + * *view_height /= 2.54F; + */ + } + else /* If no width or height are specified, use the original size from image */ + switch (rotation) + { + default: + case 0: + case 180: *view_height = psheight; + break; + case 90: + case 270: *view_height = pswidth; + break; + } + } + + if (maxPageWidth != 0) /* Clip the viewport to maxPageWidth on each page */ + { + *view_width = maxPageWidth * PS_UNIT_SIZE; + /* if (res_unit == RESUNIT_CENTIMETER) + * *view_width /= 2.54F; + */ + } + else + { + if (pgwidth != 0) /* User has set PageWidth with -w flag */ + { + *view_width = pgwidth * PS_UNIT_SIZE; /* Postscript size for Page Width in inches */ + /* if (res_unit == RESUNIT_CENTIMETER) + * *view_width /= 2.54F; + */ + } + else /* If no width or height are specified, use the original size from image */ + switch (rotation) + { + default: + case 0: + case 180: *view_width = pswidth; + break; + case 90: + case 270: *view_width = psheight; /* (*view_height / psheight) * psheight; */ + break; + } + } + + return (0); + } + +/* pgwidth and pgheight specify page width and height in inches from -h and -w flags + * lm and bm are the LeftMargin and BottomMargin in inches + * center causes the image to be centered on the page if the paper size is + * larger than the image size + * returns the sequence number of the page processed or -1 on error + */ + +int TIFF2PS(FILE* fd, TIFF* tif, double pgwidth, double pgheight, double lm, double bm, int center) + { + uint32 pixwidth = 0, pixheight = 0; /* Image width and height in pixels */ + double ox = 0.0, oy = 0.0; /* Offset from current Postscript origin */ + double pswidth, psheight; /* Original raw image width and height in points */ + double view_width, view_height; /* Viewport width and height in points */ + double scale = 1.0; + double left_offset = lm * PS_UNIT_SIZE; + double bottom_offset = bm * PS_UNIT_SIZE; + uint32 subfiletype; + uint16* sampleinfo; + static int npages = 0; + + if (!TIFFGetField(tif, TIFFTAG_XPOSITION, &ox)) + ox = 0; + if (!TIFFGetField(tif, TIFFTAG_YPOSITION, &oy)) + oy = 0; + + /* Consolidated all the tag information into one code segment, Richard Nolde */ + do { + tf_numberstrips = TIFFNumberOfStrips(tif); + TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &tf_rowsperstrip); + TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample); + TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &planarconfiguration); + TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression); + TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, &extrasamples, &sampleinfo); + alpha = (extrasamples == 1 && sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA); + if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) + { + switch (samplesperpixel - extrasamples) + { + case 1: if (isCCITTCompression(tif)) + photometric = PHOTOMETRIC_MINISWHITE; + else + photometric = PHOTOMETRIC_MINISBLACK; + break; + case 3: photometric = PHOTOMETRIC_RGB; + break; + case 4: photometric = PHOTOMETRIC_SEPARATED; + break; + } + } + + /* Read image tags for width and height in pixels pixwidth, pixheight, + * and convert to points pswidth, psheight + */ + setupPageState(tif, &pixwidth, &pixheight, &pswidth, &psheight); + view_width = pswidth; + view_height = psheight; + + if (get_viewport (pgwidth, pgheight, pswidth, psheight, &view_width, &view_height, rotation)) + { + TIFFError("get_viewport", "Unable to set image viewport"); + return (1); + } + + /* Write the Postscript file header with Bounding Box and Page Size definitions */ + if (psStart(fd, npages, auto_rotate, &rotation, &scale, ox, oy, + pgwidth, pgheight, view_width, view_height, pswidth, psheight, + left_offset, bottom_offset)) + return (-1); + + if (checkImage(tif)) /* Aborts if unsupported image parameters */ + { + tf_bytesperrow = TIFFScanlineSize(tif); + + /* Set viewport clipping and scaling options */ + if ((maxPageHeight) || (maxPageWidth) || (pgwidth != 0) || (pgheight != 0)) + { + if ((maxPageHeight) || (maxPageWidth)) /* used -H or -W option */ + { + if (psMaskImage(fd, tif, rotation, center, &npages, pixwidth, pixheight, + left_offset, bottom_offset, pgwidth, pgheight, + pswidth, psheight, scale) < 0) + return (-1); + } + else /* N.B. Setting maxPageHeight no longer sets pgheight */ + { + if (pgwidth != 0 || pgheight != 0) + { + /* User did not specify a maxium page height or width using -H or -W flag + * but did use -h or -w flag to scale to a specific size page. + */ + npages++; + fprintf(fd, "%%%%Page: %d %d\n", npages, npages); + + if (!generateEPSF && ( level2 || level3 )) + { + /* Write out the PageSize info for non EPS files */ + if (psPageSize(fd, rotation, pgwidth, pgheight, + view_width, view_height, pswidth, psheight)) + return (-1); + } + fprintf(fd, "gsave\n"); + fprintf(fd, "100 dict begin\n"); + if (psScaleImage(fd, scale, rotation, center, view_width, view_height, + pswidth, psheight, left_offset, bottom_offset)) + return (-1); + + PSpage(fd, tif, pixwidth, pixheight); + fprintf(fd, "end\n"); + fprintf(fd, "grestore\n"); + fprintf(fd, "showpage\n"); + } + } + } + else /* Simple rotation: user did not use -H, -W, -h or -w */ + { + npages++; + fprintf(fd, "%%%%Page: %d %d\n", npages, npages); + + if (!generateEPSF && ( level2 || level3 )) + { + /* Write out the PageSize info for non EPS files */ + if (psPageSize(fd, rotation, pgwidth, pgheight, + view_width, view_height, pswidth, psheight)) + return (-1); + } + fprintf(fd, "gsave\n"); + fprintf(fd, "100 dict begin\n"); + if (psRotateImage(fd, rotation, pswidth, psheight, left_offset, bottom_offset)) + return (-1); + + PSpage(fd, tif, pixwidth, pixheight); + fprintf(fd, "end\n"); + fprintf(fd, "grestore\n"); + fprintf(fd, "showpage\n"); + } + } + if (generateEPSF) + break; + TIFFGetFieldDefaulted(tif, TIFFTAG_SUBFILETYPE, &subfiletype); + } while (((subfiletype & FILETYPE_PAGE) || printAll) && TIFFReadDirectory(tif)); + +return(npages); +} + +static char DuplexPreamble[] = "\ +%%BeginFeature: *Duplex True\n\ +systemdict begin\n\ + /languagelevel where { pop languagelevel } { 1 } ifelse\n\ + 2 ge { 1 dict dup /Duplex true put setpagedevice }\n\ + { statusdict /setduplex known { statusdict begin setduplex true end } if\n\ + } ifelse\n\ +end\n\ +%%EndFeature\n\ +"; + +static char TumblePreamble[] = "\ +%%BeginFeature: *Tumble True\n\ +systemdict begin\n\ + /languagelevel where { pop languagelevel } { 1 } ifelse\n\ + 2 ge { 1 dict dup /Tumble true put setpagedevice }\n\ + { statusdict /settumble known { statusdict begin true settumble end } if\n\ + } ifelse\n\ +end\n\ +%%EndFeature\n\ +"; + +static char AvoidDeadZonePreamble[] = "\ +gsave newpath clippath pathbbox grestore\n\ + 4 2 roll 2 copy translate\n\ + exch 3 1 roll sub 3 1 roll sub exch\n\ + currentpagedevice /PageSize get aload pop\n\ + exch 3 1 roll div 3 1 roll div abs exch abs\n\ + 2 copy gt { exch } if pop\n\ + dup 1 lt { dup scale } { pop } ifelse\n\ +"; + +void +PSHead(FILE *fd, double pagewidth, double pageheight, double xoff, double yoff) +{ + time_t t; + + t = time(0); + fprintf(fd, "%%!PS-Adobe-3.0%s\n", generateEPSF ? " EPSF-3.0" : ""); + fprintf(fd, "%%%%Creator: %s\n", creator ? creator : "tiff2ps"); + fprintf(fd, "%%%%Title: %s\n", title ? title : filename); + fprintf(fd, "%%%%CreationDate: %s", ctime(&t)); + fprintf(fd, "%%%%DocumentData: Clean7Bit\n"); + /* NB: should use PageBoundingBox for each page instead of BoundingBox * + * PageBoundingBox DSC added in PSPageSize function, R Nolde 09-01-2010 + */ + fprintf(fd, "%%%%Origin: %ld %ld\n", (long) xoff, (long) yoff); + fprintf(fd, "%%%%BoundingBox: 0 0 %ld %ld\n", + (long) ceil(pagewidth), (long) ceil(pageheight)); + + fprintf(fd, "%%%%LanguageLevel: %d\n", (level3 ? 3 : (level2 ? 2 : 1))); + if (generateEPSF == TRUE) + fprintf(fd, "%%%%Pages: 1 1\n"); + else + fprintf(fd, "%%%%Pages: (atend)\n"); + fprintf(fd, "%%%%EndComments\n"); + if (generateEPSF == FALSE) + { + fprintf(fd, "%%%%BeginSetup\n"); + if (PSduplex) + fprintf(fd, "%s", DuplexPreamble); + if (PStumble) + fprintf(fd, "%s", TumblePreamble); + if (PSavoiddeadzone && (level2 || level3)) + fprintf(fd, "%s", AvoidDeadZonePreamble); + fprintf(fd, "%%%%EndSetup\n"); + } +} + +void +PSTail(FILE *fd, int npages) +{ + fprintf(fd, "%%%%Trailer\n"); + if (generateEPSF == FALSE) + fprintf(fd, "%%%%Pages: %d\n", npages); + fprintf(fd, "%%%%EOF\n"); +} + +static int +checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b) +{ + (void) tif; + while (n-- > 0) + if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) + return (16); + TIFFWarning(filename, "Assuming 8-bit colormap"); + return (8); +} + +static void +PS_Lvl2colorspace(FILE* fd, TIFF* tif) +{ + uint16 *rmap, *gmap, *bmap; + int i, num_colors; + const char * colorspace_p; + + switch ( photometric ) + { + case PHOTOMETRIC_SEPARATED: + colorspace_p = "CMYK"; + break; + + case PHOTOMETRIC_RGB: + colorspace_p = "RGB"; + break; + + default: + colorspace_p = "Gray"; + } + + /* + * Set up PostScript Level 2 colorspace according to + * section 4.8 in the PostScript refenence manual. + */ + fputs("% PostScript Level 2 only.\n", fd); + if (photometric != PHOTOMETRIC_PALETTE) { + if (photometric == PHOTOMETRIC_YCBCR) { + /* MORE CODE HERE */ + } + fprintf(fd, "/Device%s setcolorspace\n", colorspace_p ); + return; + } + + /* + * Set up an indexed/palette colorspace + */ + num_colors = (1 << bitspersample); + if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) { + TIFFError(filename, + "Palette image w/o \"Colormap\" tag"); + return; + } + if (checkcmap(tif, num_colors, rmap, gmap, bmap) == 16) { + /* + * Convert colormap to 8-bits values. + */ +#define CVT(x) (((x) * 255) / ((1L<<16)-1)) + for (i = 0; i < num_colors; i++) { + rmap[i] = CVT(rmap[i]); + gmap[i] = CVT(gmap[i]); + bmap[i] = CVT(bmap[i]); + } +#undef CVT + } + fprintf(fd, "[ /Indexed /DeviceRGB %d", num_colors - 1); + if (ascii85) { + Ascii85Init(); + fputs("\n<~", fd); + ascii85breaklen -= 2; + } else + fputs(" <", fd); + for (i = 0; i < num_colors; i++) { + if (ascii85) { + Ascii85Put((unsigned char)rmap[i], fd); + Ascii85Put((unsigned char)gmap[i], fd); + Ascii85Put((unsigned char)bmap[i], fd); + } else { + fputs((i % 8) ? " " : "\n ", fd); + fprintf(fd, "%02x%02x%02x", + rmap[i], gmap[i], bmap[i]); + } + } + if (ascii85) + Ascii85Flush(fd); + else + fputs(">\n", fd); + fputs("] setcolorspace\n", fd); +} + +static int +PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + int use_rawdata; + uint32 tile_width, tile_height; + uint16 predictor, minsamplevalue, maxsamplevalue; + int repeat_count; + char im_h[64], im_x[64], im_y[64]; + char * imageOp = "image"; + + if ( useImagemask && (bitspersample == 1) ) + imageOp = "imagemask"; + + (void)strcpy(im_x, "0"); + (void)sprintf(im_y, "%lu", (long) h); + (void)sprintf(im_h, "%lu", (long) h); + tile_width = w; + tile_height = h; + if (TIFFIsTiled(tif)) { + repeat_count = TIFFNumberOfTiles(tif); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tile_width); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &tile_height); + if (tile_width > w || tile_height > h || + (w % tile_width) != 0 || (h % tile_height != 0)) { + /* + * The tiles does not fit image width and height. + * Set up a clip rectangle for the image unit square. + */ + fputs("0 0 1 1 rectclip\n", fd); + } + if (tile_width < w) { + fputs("/im_x 0 def\n", fd); + (void)strcpy(im_x, "im_x neg"); + } + if (tile_height < h) { + fputs("/im_y 0 def\n", fd); + (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h); + } + } else { + repeat_count = tf_numberstrips; + tile_height = tf_rowsperstrip; + if (tile_height > h) + tile_height = h; + if (repeat_count > 1) { + fputs("/im_y 0 def\n", fd); + fprintf(fd, "/im_h %lu def\n", + (unsigned long) tile_height); + (void)strcpy(im_h, "im_h"); + (void)sprintf(im_y, "%lu im_y sub", (unsigned long) h); + } + } + + /* + * Output start of exec block + */ + fputs("{ % exec\n", fd); + + if (repeat_count > 1) + fprintf(fd, "%d { %% repeat\n", repeat_count); + + /* + * Output filter options and image dictionary. + */ + if (ascii85) + fputs(" /im_stream currentfile /ASCII85Decode filter def\n", + fd); + fputs(" <<\n", fd); + fputs(" /ImageType 1\n", fd); + fprintf(fd, " /Width %lu\n", (unsigned long) tile_width); + /* + * Workaround for some software that may crash when last strip + * of image contains fewer number of scanlines than specified + * by the `/Height' variable. So for stripped images with multiple + * strips we will set `/Height' as `im_h', because one is + * recalculated for each strip - including the (smaller) final strip. + * For tiled images and images with only one strip `/Height' will + * contain number of scanlines in tile (or image height in case of + * one-stripped image). + */ + if (TIFFIsTiled(tif) || tf_numberstrips == 1) + fprintf(fd, " /Height %lu\n", (unsigned long) tile_height); + else + fprintf(fd, " /Height im_h\n"); + + if (planarconfiguration == PLANARCONFIG_SEPARATE && samplesperpixel > 1) + fputs(" /MultipleDataSources true\n", fd); + fprintf(fd, " /ImageMatrix [ %lu 0 0 %ld %s %s ]\n", + (unsigned long) w, - (long)h, im_x, im_y); + fprintf(fd, " /BitsPerComponent %d\n", bitspersample); + fprintf(fd, " /Interpolate %s\n", interpolate ? "true" : "false"); + + switch (samplesperpixel - extrasamples) { + case 1: + switch (photometric) { + case PHOTOMETRIC_MINISBLACK: + fputs(" /Decode [0 1]\n", fd); + break; + case PHOTOMETRIC_MINISWHITE: + switch (compression) { + case COMPRESSION_CCITTRLE: + case COMPRESSION_CCITTRLEW: + case COMPRESSION_CCITTFAX3: + case COMPRESSION_CCITTFAX4: + /* + * Manage inverting with /Blackis1 flag + * since there migth be uncompressed parts + */ + fputs(" /Decode [0 1]\n", fd); + break; + default: + /* + * ERROR... + */ + fputs(" /Decode [1 0]\n", fd); + break; + } + break; + case PHOTOMETRIC_PALETTE: + TIFFGetFieldDefaulted(tif, TIFFTAG_MINSAMPLEVALUE, + &minsamplevalue); + TIFFGetFieldDefaulted(tif, TIFFTAG_MAXSAMPLEVALUE, + &maxsamplevalue); + fprintf(fd, " /Decode [%u %u]\n", + minsamplevalue, maxsamplevalue); + break; + default: + /* + * ERROR ? + */ + fputs(" /Decode [0 1]\n", fd); + break; + } + break; + case 3: + switch (photometric) { + case PHOTOMETRIC_RGB: + fputs(" /Decode [0 1 0 1 0 1]\n", fd); + break; + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + default: + /* + * ERROR?? + */ + fputs(" /Decode [0 1 0 1 0 1]\n", fd); + break; + } + break; + case 4: + /* + * ERROR?? + */ + fputs(" /Decode [0 1 0 1 0 1 0 1]\n", fd); + break; + } + fputs(" /DataSource", fd); + if (planarconfiguration == PLANARCONFIG_SEPARATE && + samplesperpixel > 1) + fputs(" [", fd); + if (ascii85) + fputs(" im_stream", fd); + else + fputs(" currentfile /ASCIIHexDecode filter", fd); + + use_rawdata = TRUE; + switch (compression) { + case COMPRESSION_NONE: /* 1: uncompressed */ + break; + case COMPRESSION_CCITTRLE: /* 2: CCITT modified Huffman RLE */ + case COMPRESSION_CCITTRLEW: /* 32771: #1 w/ word alignment */ + case COMPRESSION_CCITTFAX3: /* 3: CCITT Group 3 fax encoding */ + case COMPRESSION_CCITTFAX4: /* 4: CCITT Group 4 fax encoding */ + fputs("\n\t<<\n", fd); + if (compression == COMPRESSION_CCITTFAX3) { + uint32 g3_options; + + fputs("\t /EndOfLine true\n", fd); + fputs("\t /EndOfBlock false\n", fd); + if (!TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, + &g3_options)) + g3_options = 0; + if (g3_options & GROUP3OPT_2DENCODING) + fprintf(fd, "\t /K %s\n", im_h); + if (g3_options & GROUP3OPT_UNCOMPRESSED) + fputs("\t /Uncompressed true\n", fd); + if (g3_options & GROUP3OPT_FILLBITS) + fputs("\t /EncodedByteAlign true\n", fd); + } + if (compression == COMPRESSION_CCITTFAX4) { + uint32 g4_options; + + fputs("\t /K -1\n", fd); + TIFFGetFieldDefaulted(tif, TIFFTAG_GROUP4OPTIONS, + &g4_options); + if (g4_options & GROUP4OPT_UNCOMPRESSED) + fputs("\t /Uncompressed true\n", fd); + } + if (!(tile_width == w && w == 1728U)) + fprintf(fd, "\t /Columns %lu\n", + (unsigned long) tile_width); + fprintf(fd, "\t /Rows %s\n", im_h); + if (compression == COMPRESSION_CCITTRLE || + compression == COMPRESSION_CCITTRLEW) { + fputs("\t /EncodedByteAlign true\n", fd); + fputs("\t /EndOfBlock false\n", fd); + } + if (photometric == PHOTOMETRIC_MINISBLACK) + fputs("\t /BlackIs1 true\n", fd); + fprintf(fd, "\t>> /CCITTFaxDecode filter"); + break; + case COMPRESSION_LZW: /* 5: Lempel-Ziv & Welch */ + TIFFGetFieldDefaulted(tif, TIFFTAG_PREDICTOR, &predictor); + if (predictor == 2) { + fputs("\n\t<<\n", fd); + fprintf(fd, "\t /Predictor %u\n", predictor); + fprintf(fd, "\t /Columns %lu\n", + (unsigned long) tile_width); + fprintf(fd, "\t /Colors %u\n", samplesperpixel); + fprintf(fd, "\t /BitsPerComponent %u\n", + bitspersample); + fputs("\t>>", fd); + } + fputs(" /LZWDecode filter", fd); + break; + case COMPRESSION_DEFLATE: /* 5: ZIP */ + case COMPRESSION_ADOBE_DEFLATE: + if ( level3 ) { + TIFFGetFieldDefaulted(tif, TIFFTAG_PREDICTOR, &predictor); + if (predictor > 1) { + fprintf(fd, "\t %% PostScript Level 3 only."); + fputs("\n\t<<\n", fd); + fprintf(fd, "\t /Predictor %u\n", predictor); + fprintf(fd, "\t /Columns %lu\n", + (unsigned long) tile_width); + fprintf(fd, "\t /Colors %u\n", samplesperpixel); + fprintf(fd, "\t /BitsPerComponent %u\n", + bitspersample); + fputs("\t>>", fd); + } + fputs(" /FlateDecode filter", fd); + } else { + use_rawdata = FALSE ; + } + break; + case COMPRESSION_PACKBITS: /* 32773: Macintosh RLE */ + fputs(" /RunLengthDecode filter", fd); + use_rawdata = TRUE; + break; + case COMPRESSION_OJPEG: /* 6: !6.0 JPEG */ + case COMPRESSION_JPEG: /* 7: %JPEG DCT compression */ +#ifdef notdef + /* + * Code not tested yet + */ + fputs(" /DCTDecode filter", fd); + use_rawdata = TRUE; +#else + use_rawdata = FALSE; +#endif + break; + case COMPRESSION_NEXT: /* 32766: NeXT 2-bit RLE */ + case COMPRESSION_THUNDERSCAN: /* 32809: ThunderScan RLE */ + case COMPRESSION_PIXARFILM: /* 32908: Pixar companded 10bit LZW */ + case COMPRESSION_JBIG: /* 34661: ISO JBIG */ + use_rawdata = FALSE; + break; + case COMPRESSION_SGILOG: /* 34676: SGI LogL or LogLuv */ + case COMPRESSION_SGILOG24: /* 34677: SGI 24-bit LogLuv */ + use_rawdata = FALSE; + break; + default: + /* + * ERROR... + */ + use_rawdata = FALSE; + break; + } + if (planarconfiguration == PLANARCONFIG_SEPARATE && + samplesperpixel > 1) { + uint16 i; + + /* + * NOTE: This code does not work yet... + */ + for (i = 1; i < samplesperpixel; i++) + fputs(" dup", fd); + fputs(" ]", fd); + } + + fprintf( fd, "\n >> %s\n", imageOp ); + if (ascii85) + fputs(" im_stream status { im_stream flushfile } if\n", fd); + if (repeat_count > 1) { + if (tile_width < w) { + fprintf(fd, " /im_x im_x %lu add def\n", + (unsigned long) tile_width); + if (tile_height < h) { + fprintf(fd, " im_x %lu ge {\n", + (unsigned long) w); + fputs(" /im_x 0 def\n", fd); + fprintf(fd, " /im_y im_y %lu add def\n", + (unsigned long) tile_height); + fputs(" } if\n", fd); + } + } + if (tile_height < h) { + if (tile_width >= w) { + fprintf(fd, " /im_y im_y %lu add def\n", + (unsigned long) tile_height); + if (!TIFFIsTiled(tif)) { + fprintf(fd, " /im_h %lu im_y sub", + (unsigned long) h); + fprintf(fd, " dup %lu gt { pop", + (unsigned long) tile_height); + fprintf(fd, " %lu } if def\n", + (unsigned long) tile_height); + } + } + } + fputs("} repeat\n", fd); + } + /* + * End of exec function + */ + fputs("}\n", fd); + + return(use_rawdata); +} + +/* Flip the byte order of buffers with 16 bit samples */ +static void +PS_FlipBytes(unsigned char* buf, tsize_t count) +{ + int i; + unsigned char temp; + + if (count <= 0 || bitspersample <= 8) { + return; + } + + count--; + + for (i = 0; i < count; i += 2) { + temp = buf[i]; + buf[i] = buf[i + 1]; + buf[i + 1] = temp; + } +} + +#define MAXLINE 36 + +int +PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + uint16 fillorder; + int use_rawdata, tiled_image, breaklen = MAXLINE; + uint32 chunk_no, num_chunks; + uint64 *bc; + unsigned char *buf_data, *cp; + tsize_t chunk_size, byte_count; + +#if defined( EXP_ASCII85ENCODER ) + tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */ + uint8 * ascii85_p = 0; /* Holds ASCII85 encoded data */ +#endif + + PS_Lvl2colorspace(fd, tif); + use_rawdata = PS_Lvl2ImageDict(fd, tif, w, h); + +/* See http://bugzilla.remotesensing.org/show_bug.cgi?id=80 */ +#ifdef ENABLE_BROKEN_BEGINENDDATA + fputs("%%BeginData:\n", fd); +#endif + fputs("exec\n", fd); + + tiled_image = TIFFIsTiled(tif); + if (tiled_image) { + num_chunks = TIFFNumberOfTiles(tif); + TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc); + } else { + num_chunks = TIFFNumberOfStrips(tif); + TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc); + } + + if (use_rawdata) { + chunk_size = (tsize_t) bc[0]; + for (chunk_no = 1; chunk_no < num_chunks; chunk_no++) + if ((tsize_t) bc[chunk_no] > chunk_size) + chunk_size = (tsize_t) bc[chunk_no]; + } else { + if (tiled_image) + chunk_size = TIFFTileSize(tif); + else + chunk_size = TIFFStripSize(tif); + } + buf_data = (unsigned char *)_TIFFmalloc(chunk_size); + if (!buf_data) { + TIFFError(filename, "Can't alloc %lu bytes for %s.", + (unsigned long) chunk_size, tiled_image ? "tiles" : "strips"); + return(FALSE); + } + +#if defined( EXP_ASCII85ENCODER ) + if ( ascii85 ) { + /* + * Allocate a buffer to hold the ASCII85 encoded data. Note + * that it is allocated with sufficient room to hold the + * encoded data (5*chunk_size/4) plus the EOD marker (+8) + * and formatting line breaks. The line breaks are more + * than taken care of by using 6*chunk_size/4 rather than + * 5*chunk_size/4. + */ + + ascii85_p = _TIFFmalloc( (chunk_size+(chunk_size/2)) + 8 ); + + if ( !ascii85_p ) { + _TIFFfree( buf_data ); + + TIFFError( filename, "Cannot allocate ASCII85 encoding buffer." ); + return ( FALSE ); + } + } +#endif + + TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder); + for (chunk_no = 0; chunk_no < num_chunks; chunk_no++) { + if (ascii85) + Ascii85Init(); + else + breaklen = MAXLINE; + if (use_rawdata) { + if (tiled_image) + byte_count = TIFFReadRawTile(tif, chunk_no, + buf_data, chunk_size); + else + byte_count = TIFFReadRawStrip(tif, chunk_no, + buf_data, chunk_size); + if (fillorder == FILLORDER_LSB2MSB) + TIFFReverseBits(buf_data, byte_count); + } else { + if (tiled_image) + byte_count = TIFFReadEncodedTile(tif, + chunk_no, buf_data, + chunk_size); + else + byte_count = TIFFReadEncodedStrip(tif, + chunk_no, buf_data, + chunk_size); + } + if (byte_count < 0) { + TIFFError(filename, "Can't read %s %d.", + tiled_image ? "tile" : "strip", chunk_no); + if (ascii85) + Ascii85Put('\0', fd); + } + /* + * for 16 bits, the two bytes must be most significant + * byte first + */ + if (bitspersample == 16 && !TIFFIsBigEndian(tif)) { + PS_FlipBytes(buf_data, byte_count); + } + /* + * For images with alpha, matte against a white background; + * i.e. Cback * (1 - Aimage) where Cback = 1. We will fill the + * lower part of the buffer with the modified values. + * + * XXX: needs better solution + */ + if (alpha) { + int adjust, i, j = 0; + int ncomps = samplesperpixel - extrasamples; + for (i = 0; i < byte_count; i+=samplesperpixel) { + adjust = 255 - buf_data[i + ncomps]; + switch (ncomps) { + case 1: + buf_data[j++] = buf_data[i] + adjust; + break; + case 2: + buf_data[j++] = buf_data[i] + adjust; + buf_data[j++] = buf_data[i+1] + adjust; + break; + case 3: + buf_data[j++] = buf_data[i] + adjust; + buf_data[j++] = buf_data[i+1] + adjust; + buf_data[j++] = buf_data[i+2] + adjust; + break; + } + } + byte_count -= j; + } + + if (ascii85) { +#if defined( EXP_ASCII85ENCODER ) + ascii85_l = Ascii85EncodeBlock(ascii85_p, 1, buf_data, byte_count ); + + if ( ascii85_l > 0 ) + fwrite( ascii85_p, ascii85_l, 1, fd ); +#else + for (cp = buf_data; byte_count > 0; byte_count--) + Ascii85Put(*cp++, fd); +#endif + } + else + { + for (cp = buf_data; byte_count > 0; byte_count--) { + putc(hex[((*cp)>>4)&0xf], fd); + putc(hex[(*cp)&0xf], fd); + cp++; + + if (--breaklen <= 0) { + putc('\n', fd); + breaklen = MAXLINE; + } + } + } + + if ( !ascii85 ) { + if ( level2 || level3 ) + putc( '>', fd ); + putc('\n', fd); + } +#if !defined( EXP_ASCII85ENCODER ) + else + Ascii85Flush(fd); +#endif + } + +#if defined( EXP_ASCII85ENCODER ) + if ( ascii85_p ) + _TIFFfree( ascii85_p ); +#endif + + _TIFFfree(buf_data); +#ifdef ENABLE_BROKEN_BEGINENDDATA + fputs("%%EndData\n", fd); +#endif + return(TRUE); +} + +void +PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + char * imageOp = "image"; + + if ( useImagemask && (bitspersample == 1) ) + imageOp = "imagemask"; + + if ((level2 || level3) && PS_Lvl2page(fd, tif, w, h)) + return; + ps_bytesperrow = tf_bytesperrow - (extrasamples * bitspersample / 8)*w; + switch (photometric) { + case PHOTOMETRIC_RGB: + if (planarconfiguration == PLANARCONFIG_CONTIG) { + fprintf(fd, "%s", RGBcolorimage); + PSColorContigPreamble(fd, w, h, 3); + PSDataColorContig(fd, tif, w, h, 3); + } else { + PSColorSeparatePreamble(fd, w, h, 3); + PSDataColorSeparate(fd, tif, w, h, 3); + } + break; + case PHOTOMETRIC_SEPARATED: + /* XXX should emit CMYKcolorimage */ + if (planarconfiguration == PLANARCONFIG_CONTIG) { + PSColorContigPreamble(fd, w, h, 4); + PSDataColorContig(fd, tif, w, h, 4); + } else { + PSColorSeparatePreamble(fd, w, h, 4); + PSDataColorSeparate(fd, tif, w, h, 4); + } + break; + case PHOTOMETRIC_PALETTE: + fprintf(fd, "%s", RGBcolorimage); + PhotoshopBanner(fd, w, h, 1, 3, "false 3 colorimage"); + fprintf(fd, "/scanLine %ld string def\n", + (long) ps_bytesperrow * 3L); + fprintf(fd, "%lu %lu 8\n", + (unsigned long) w, (unsigned long) h); + fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", + (unsigned long) w, (unsigned long) h, (unsigned long) h); + fprintf(fd, "{currentfile scanLine readhexstring pop} bind\n"); + fprintf(fd, "false 3 colorimage\n"); + PSDataPalette(fd, tif, w, h); + break; + case PHOTOMETRIC_MINISBLACK: + case PHOTOMETRIC_MINISWHITE: + PhotoshopBanner(fd, w, h, 1, 1, imageOp); + fprintf(fd, "/scanLine %ld string def\n", + (long) ps_bytesperrow); + fprintf(fd, "%lu %lu %d\n", + (unsigned long) w, (unsigned long) h, bitspersample); + fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", + (unsigned long) w, (unsigned long) h, (unsigned long) h); + fprintf(fd, + "{currentfile scanLine readhexstring pop} bind\n"); + fprintf(fd, "%s\n", imageOp); + PSDataBW(fd, tif, w, h); + break; + } + putc('\n', fd); +} + +void +PSColorContigPreamble(FILE* fd, uint32 w, uint32 h, int nc) +{ + ps_bytesperrow = nc * (tf_bytesperrow / samplesperpixel); + PhotoshopBanner(fd, w, h, 1, nc, "false %d colorimage"); + fprintf(fd, "/line %ld string def\n", (long) ps_bytesperrow); + fprintf(fd, "%lu %lu %d\n", + (unsigned long) w, (unsigned long) h, bitspersample); + fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n", + (unsigned long) w, (unsigned long) h, (unsigned long) h); + fprintf(fd, "{currentfile line readhexstring pop} bind\n"); + fprintf(fd, "false %d colorimage\n", nc); +} + +void +PSColorSeparatePreamble(FILE* fd, uint32 w, uint32 h, int nc) +{ + int i; + + PhotoshopBanner(fd, w, h, ps_bytesperrow, nc, "true %d colorimage"); + for (i = 0; i < nc; i++) + fprintf(fd, "/line%d %ld string def\n", + i, (long) ps_bytesperrow); + fprintf(fd, "%lu %lu %d\n", + (unsigned long) w, (unsigned long) h, bitspersample); + fprintf(fd, "[%lu 0 0 -%lu 0 %lu] \n", + (unsigned long) w, (unsigned long) h, (unsigned long) h); + for (i = 0; i < nc; i++) + fprintf(fd, "{currentfile line%d readhexstring pop}bind\n", i); + fprintf(fd, "true %d colorimage\n", nc); +} + +#define DOBREAK(len, howmany, fd) \ + if (((len) -= (howmany)) <= 0) { \ + putc('\n', fd); \ + (len) = MAXLINE-(howmany); \ + } +#define PUTHEX(c,fd) putc(hex[((c)>>4)&0xf],fd); putc(hex[(c)&0xf],fd) + +void +PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc) +{ + uint32 row; + int breaklen = MAXLINE, es = samplesperpixel - nc; + tsize_t cc; + unsigned char *tf_buf; + unsigned char *cp, c; + + (void) w; + tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow); + if (tf_buf == NULL) { + TIFFError(filename, "No space for scanline buffer"); + return; + } + for (row = 0; row < h; row++) { + if (TIFFReadScanline(tif, tf_buf, row, 0) < 0) + break; + cp = tf_buf; + /* + * for 16 bits, the two bytes must be most significant + * byte first + */ + if (bitspersample == 16 && !HOST_BIGENDIAN) { + PS_FlipBytes(cp, tf_bytesperrow); + } + if (alpha) { + int adjust; + cc = 0; + for (; cc < tf_bytesperrow; cc += samplesperpixel) { + DOBREAK(breaklen, nc, fd); + /* + * For images with alpha, matte against + * a white background; i.e. + * Cback * (1 - Aimage) + * where Cback = 1. + */ + adjust = 255 - cp[nc]; + switch (nc) { + case 4: c = *cp++ + adjust; PUTHEX(c,fd); + case 3: c = *cp++ + adjust; PUTHEX(c,fd); + case 2: c = *cp++ + adjust; PUTHEX(c,fd); + case 1: c = *cp++ + adjust; PUTHEX(c,fd); + } + cp += es; + } + } else { + cc = 0; + for (; cc < tf_bytesperrow; cc += samplesperpixel) { + DOBREAK(breaklen, nc, fd); + switch (nc) { + case 4: c = *cp++; PUTHEX(c,fd); + case 3: c = *cp++; PUTHEX(c,fd); + case 2: c = *cp++; PUTHEX(c,fd); + case 1: c = *cp++; PUTHEX(c,fd); + } + cp += es; + } + } + } + _TIFFfree((char *) tf_buf); +} + +void +PSDataColorSeparate(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc) +{ + uint32 row; + int breaklen = MAXLINE; + tsize_t cc; + tsample_t s, maxs; + unsigned char *tf_buf; + unsigned char *cp, c; + + (void) w; + tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow); + if (tf_buf == NULL) { + TIFFError(filename, "No space for scanline buffer"); + return; + } + maxs = (samplesperpixel > nc ? nc : samplesperpixel); + for (row = 0; row < h; row++) { + for (s = 0; s < maxs; s++) { + if (TIFFReadScanline(tif, tf_buf, row, s) < 0) + break; + for (cp = tf_buf, cc = 0; cc < tf_bytesperrow; cc++) { + DOBREAK(breaklen, 1, fd); + c = *cp++; + PUTHEX(c,fd); + } + } + } + _TIFFfree((char *) tf_buf); +} + +#define PUTRGBHEX(c,fd) \ + PUTHEX(rmap[c],fd); PUTHEX(gmap[c],fd); PUTHEX(bmap[c],fd) + +void +PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + uint16 *rmap, *gmap, *bmap; + uint32 row; + int breaklen = MAXLINE, nc; + tsize_t cc; + unsigned char *tf_buf; + unsigned char *cp, c; + + (void) w; + if (!TIFFGetField(tif, TIFFTAG_COLORMAP, &rmap, &gmap, &bmap)) { + TIFFError(filename, "Palette image w/o \"Colormap\" tag"); + return; + } + switch (bitspersample) { + case 8: case 4: case 2: case 1: + break; + default: + TIFFError(filename, "Depth %d not supported", bitspersample); + return; + } + nc = 3 * (8 / bitspersample); + tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow); + if (tf_buf == NULL) { + TIFFError(filename, "No space for scanline buffer"); + return; + } + if (checkcmap(tif, 1<= 0; i--) { + rmap[i] = CVT(rmap[i]); + gmap[i] = CVT(gmap[i]); + bmap[i] = CVT(bmap[i]); + } +#undef CVT + } + for (row = 0; row < h; row++) { + if (TIFFReadScanline(tif, tf_buf, row, 0) < 0) + break; + for (cp = tf_buf, cc = 0; cc < tf_bytesperrow; cc++) { + DOBREAK(breaklen, nc, fd); + switch (bitspersample) { + case 8: + c = *cp++; PUTRGBHEX(c, fd); + break; + case 4: + c = *cp++; PUTRGBHEX(c&0xf, fd); + c >>= 4; PUTRGBHEX(c, fd); + break; + case 2: + c = *cp++; PUTRGBHEX(c&0x3, fd); + c >>= 2; PUTRGBHEX(c&0x3, fd); + c >>= 2; PUTRGBHEX(c&0x3, fd); + c >>= 2; PUTRGBHEX(c, fd); + break; + case 1: + c = *cp++; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c&0x1, fd); + c >>= 1; PUTRGBHEX(c, fd); + break; + } + } + } + _TIFFfree((char *) tf_buf); +} + +void +PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + int breaklen = MAXLINE; + unsigned char* tf_buf; + unsigned char* cp; + tsize_t stripsize = TIFFStripSize(tif); + tstrip_t s; + +#if defined( EXP_ASCII85ENCODER ) + tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */ + uint8 *ascii85_p = 0; /* Holds ASCII85 encoded data */ +#endif + + (void) w; (void) h; + tf_buf = (unsigned char *) _TIFFmalloc(stripsize); + if (tf_buf == NULL) { + TIFFError(filename, "No space for scanline buffer"); + return; + } + + // FIXME + memset(tf_buf, 0, stripsize); + +#if defined( EXP_ASCII85ENCODER ) + if ( ascii85 ) { + /* + * Allocate a buffer to hold the ASCII85 encoded data. Note + * that it is allocated with sufficient room to hold the + * encoded data (5*stripsize/4) plus the EOD marker (+8) + * and formatting line breaks. The line breaks are more + * than taken care of by using 6*stripsize/4 rather than + * 5*stripsize/4. + */ + + ascii85_p = _TIFFmalloc( (stripsize+(stripsize/2)) + 8 ); + + if ( !ascii85_p ) { + _TIFFfree( tf_buf ); + + TIFFError( filename, "Cannot allocate ASCII85 encoding buffer." ); + return; + } + } +#endif + + if (ascii85) + Ascii85Init(); + + for (s = 0; s < TIFFNumberOfStrips(tif); s++) { + tmsize_t cc = TIFFReadEncodedStrip(tif, s, tf_buf, stripsize); + if (cc < 0) { + TIFFError(filename, "Can't read strip"); + break; + } + cp = tf_buf; + if (photometric == PHOTOMETRIC_MINISWHITE) { + for (cp += cc; --cp >= tf_buf;) + *cp = ~*cp; + cp++; + } + /* + * for 16 bits, the two bytes must be most significant + * byte first + */ + if (bitspersample == 16 && !HOST_BIGENDIAN) { + PS_FlipBytes(cp, cc); + } + if (ascii85) { +#if defined( EXP_ASCII85ENCODER ) + if (alpha) { + int adjust, i; + for (i = 0; i < cc; i+=2) { + adjust = 255 - cp[i + 1]; + cp[i / 2] = cp[i] + adjust; + } + cc /= 2; + } + + ascii85_l = Ascii85EncodeBlock( ascii85_p, 1, cp, cc ); + + if ( ascii85_l > 0 ) + fwrite( ascii85_p, ascii85_l, 1, fd ); +#else + while (cc-- > 0) + Ascii85Put(*cp++, fd); +#endif /* EXP_ASCII85_ENCODER */ + } else { + unsigned char c; + + if (alpha) { + int adjust; + while (cc-- > 0) { + DOBREAK(breaklen, 1, fd); + /* + * For images with alpha, matte against + * a white background; i.e. + * Cback * (1 - Aimage) + * where Cback = 1. + */ + adjust = 255 - cp[1]; + c = *cp++ + adjust; PUTHEX(c,fd); + cp++, cc--; + } + } else { + while (cc-- > 0) { + c = *cp++; + DOBREAK(breaklen, 1, fd); + PUTHEX(c, fd); + } + } + } + } + + if ( !ascii85 ) + { + if ( level2 || level3) + fputs(">\n", fd); + } +#if !defined( EXP_ASCII85ENCODER ) + else + Ascii85Flush(fd); +#else + if ( ascii85_p ) + _TIFFfree( ascii85_p ); +#endif + + _TIFFfree(tf_buf); +} + +void +PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h) +{ + uint64 *bc; + uint32 bufsize; + int breaklen = MAXLINE; + tmsize_t cc; + uint16 fillorder; + unsigned char *tf_buf; + unsigned char *cp, c; + tstrip_t s; + +#if defined( EXP_ASCII85ENCODER ) + tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */ + uint8 * ascii85_p = 0; /* Holds ASCII85 encoded data */ +#endif + + (void) w; (void) h; + TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder); + TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc); + + /* + * Find largest strip: + */ + + bufsize = (uint32) bc[0]; + + for ( s = 0; ++s < (tstrip_t)tf_numberstrips; ) { + if ( bc[s] > bufsize ) + bufsize = (uint32) bc[s]; + } + + tf_buf = (unsigned char*) _TIFFmalloc(bufsize); + if (tf_buf == NULL) { + TIFFError(filename, "No space for strip buffer"); + return; + } + +#if defined( EXP_ASCII85ENCODER ) + if ( ascii85 ) { + /* + * Allocate a buffer to hold the ASCII85 encoded data. Note + * that it is allocated with sufficient room to hold the + * encoded data (5*bufsize/4) plus the EOD marker (+8) + * and formatting line breaks. The line breaks are more + * than taken care of by using 6*bufsize/4 rather than + * 5*bufsize/4. + */ + + ascii85_p = _TIFFmalloc( (bufsize+(bufsize/2)) + 8 ); + + if ( !ascii85_p ) { + _TIFFfree( tf_buf ); + + TIFFError( filename, "Cannot allocate ASCII85 encoding buffer." ); + return; + } + } +#endif + + for (s = 0; s < (tstrip_t) tf_numberstrips; s++) { + cc = TIFFReadRawStrip(tif, s, tf_buf, (tmsize_t) bc[s]); + if (cc < 0) { + TIFFError(filename, "Can't read strip"); + break; + } + if (fillorder == FILLORDER_LSB2MSB) + TIFFReverseBits(tf_buf, cc); + if (!ascii85) { + for (cp = tf_buf; cc > 0; cc--) { + DOBREAK(breaklen, 1, fd); + c = *cp++; + PUTHEX(c, fd); + } + fputs(">\n", fd); + breaklen = MAXLINE; + } else { + Ascii85Init(); +#if defined( EXP_ASCII85ENCODER ) + ascii85_l = Ascii85EncodeBlock( ascii85_p, 1, tf_buf, cc ); + + if ( ascii85_l > 0 ) + fwrite( ascii85_p, ascii85_l, 1, fd ); +#else + for (cp = tf_buf; cc > 0; cc--) + Ascii85Put(*cp++, fd); + Ascii85Flush(fd); +#endif /* EXP_ASCII85ENCODER */ + } + } + _TIFFfree((char *) tf_buf); + +#if defined( EXP_ASCII85ENCODER ) + if ( ascii85_p ) + _TIFFfree( ascii85_p ); +#endif +} + +void +Ascii85Init(void) +{ + ascii85breaklen = 2*MAXLINE; + ascii85count = 0; +} + +static char* +Ascii85Encode(unsigned char* raw) +{ + static char encoded[6]; + uint32 word; + + word = (((raw[0]<<8)+raw[1])<<16) + (raw[2]<<8) + raw[3]; + if (word != 0L) { + uint32 q; + uint16 w1; + + q = word / (85L*85*85*85); /* actually only a byte */ + encoded[0] = (char) (q + '!'); + + word -= q * (85L*85*85*85); q = word / (85L*85*85); + encoded[1] = (char) (q + '!'); + + word -= q * (85L*85*85); q = word / (85*85); + encoded[2] = (char) (q + '!'); + + w1 = (uint16) (word - q*(85L*85)); + encoded[3] = (char) ((w1 / 85) + '!'); + encoded[4] = (char) ((w1 % 85) + '!'); + encoded[5] = '\0'; + } else + encoded[0] = 'z', encoded[1] = '\0'; + return (encoded); +} + +void +Ascii85Put(unsigned char code, FILE* fd) +{ + ascii85buf[ascii85count++] = code; + if (ascii85count >= 4) { + unsigned char* p; + int n; + + for (n = ascii85count, p = ascii85buf; n >= 4; n -= 4, p += 4) { + char* cp; + for (cp = Ascii85Encode(p); *cp; cp++) { + putc(*cp, fd); + if (--ascii85breaklen == 0) { + putc('\n', fd); + ascii85breaklen = 2*MAXLINE; + } + } + } + _TIFFmemcpy(ascii85buf, p, n); + ascii85count = n; + } +} + +void +Ascii85Flush(FILE* fd) +{ + if (ascii85count > 0) { + char* res; + _TIFFmemset(&ascii85buf[ascii85count], 0, 3); + res = Ascii85Encode(ascii85buf); + fwrite(res[0] == 'z' ? "!!!!" : res, ascii85count + 1, 1, fd); + } + fputs("~>\n", fd); +} +#if defined( EXP_ASCII85ENCODER) + +#define A85BREAKCNTR ascii85breaklen +#define A85BREAKLEN (2*MAXLINE) + +/***************************************************************************** +* +* Name: Ascii85EncodeBlock( ascii85_p, f_eod, raw_p, raw_l ) +* +* Description: This routine will encode the raw data in the buffer described +* by raw_p and raw_l into ASCII85 format and store the encoding +* in the buffer given by ascii85_p. +* +* Parameters: ascii85_p - A buffer supplied by the caller which will +* contain the encoded ASCII85 data. +* f_eod - Flag: Nz means to end the encoded buffer with +* an End-Of-Data marker. +* raw_p - Pointer to the buffer of data to be encoded +* raw_l - Number of bytes in raw_p[] to be encoded +* +* Returns: (int) < 0 Error, see errno +* >= 0 Number of bytes written to ascii85_p[]. +* +* Notes: An external variable given by A85BREAKCNTR is used to +* determine when to insert newline characters into the +* encoded data. As each byte is placed into ascii85_p this +* external is decremented. If the variable is decrement to +* or past zero then a newline is inserted into ascii85_p +* and the A85BREAKCNTR is then reset to A85BREAKLEN. +* Note: for efficiency reasons the A85BREAKCNTR variable +* is not actually checked on *every* character +* placed into ascii85_p but often only for every +* 5 characters. +* +* THE CALLER IS RESPONSIBLE FOR ENSURING THAT ASCII85_P[] IS +* SUFFICIENTLY LARGE TO THE ENCODED DATA! +* You will need at least 5 * (raw_l/4) bytes plus space for +* newline characters and space for an EOD marker (if +* requested). A safe calculation is to use 6*(raw_l/4) + 8 +* to size ascii85_p. +* +*****************************************************************************/ + +tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l ) + +{ + char ascii85[5]; /* Encoded 5 tuple */ + tsize_t ascii85_l; /* Number of bytes written to ascii85_p[] */ + int rc; /* Return code */ + uint32 val32; /* Unencoded 4 tuple */ + + ascii85_l = 0; /* Nothing written yet */ + + if ( raw_p ) + { + --raw_p; /* Prepare for pre-increment fetches */ + + for ( ; raw_l > 3; raw_l -= 4 ) + { + val32 = *(++raw_p) << 24; + val32 += *(++raw_p) << 16; + val32 += *(++raw_p) << 8; + val32 += *(++raw_p); + + if ( val32 == 0 ) /* Special case */ + { + ascii85_p[ascii85_l] = 'z'; + rc = 1; + } + + else + { + ascii85[4] = (char) ((val32 % 85) + 33); + val32 /= 85; + + ascii85[3] = (char) ((val32 % 85) + 33); + val32 /= 85; + + ascii85[2] = (char) ((val32 % 85) + 33); + val32 /= 85; + + ascii85[1] = (char) ((val32 % 85) + 33); + ascii85[0] = (char) ((val32 / 85) + 33); + + _TIFFmemcpy( &ascii85_p[ascii85_l], ascii85, sizeof(ascii85) ); + rc = sizeof(ascii85); + } + + ascii85_l += rc; + + if ( (A85BREAKCNTR -= rc) <= 0 ) + { + ascii85_p[ascii85_l] = '\n'; + ++ascii85_l; + A85BREAKCNTR = A85BREAKLEN; + } + } + + /* + * Output any straggler bytes: + */ + + if ( raw_l > 0 ) + { + tsize_t len; /* Output this many bytes */ + + len = raw_l + 1; + val32 = *++raw_p << 24; /* Prime the pump */ + + if ( --raw_l > 0 ) val32 += *(++raw_p) << 16; + if ( --raw_l > 0 ) val32 += *(++raw_p) << 8; + + val32 /= 85; + + ascii85[3] = (char) ((val32 % 85) + 33); + val32 /= 85; + + ascii85[2] = (char) ((val32 % 85) + 33); + val32 /= 85; + + ascii85[1] = (char) ((val32 % 85) + 33); + ascii85[0] = (char) ((val32 / 85) + 33); + + _TIFFmemcpy( &ascii85_p[ascii85_l], ascii85, len ); + ascii85_l += len; + } + } + + /* + * If requested add an ASCII85 End Of Data marker: + */ + + if ( f_eod ) + { + ascii85_p[ascii85_l++] = '~'; + ascii85_p[ascii85_l++] = '>'; + ascii85_p[ascii85_l++] = '\n'; + } + + return ( ascii85_l ); + +} /* Ascii85EncodeBlock() */ + +#endif /* EXP_ASCII85ENCODER */ + + +char* stuff[] = { +"usage: tiff2ps [options] input.tif ...", +"where options are:", +" -1 generate PostScript Level 1 (default)", +" -2 generate PostScript Level 2", +" -3 generate PostScript Level 3", +" -8 disable use of ASCII85 encoding with PostScript Level 2/3", +" -a convert all directories in file (default is first), Not EPS", +" -b # set the bottom margin to # inches", +" -c center image (-b and -l still add to this)", +" -d # set initial directory to # counting from zero", +" -D enable duplex printing (two pages per sheet of paper)", +" -e generate Encapsulated PostScript (EPS) (implies -z)", +" -h # set printed page height to # inches (no default)", +" -w # set printed page width to # inches (no default)", +" -H # split image if height is more than # inches", +" -P L or P set optional PageOrientation DSC comment to Landscape or Portrait", +" -W # split image if width is more than # inches", +" -L # overLap split images by # inches", +" -i # enable/disable (Nz/0) pixel interpolation (default: enable)", +" -l # set the left margin to # inches", +" -m use \"imagemask\" operator instead of \"image\"", +" -o # convert directory at file offset # bytes", +" -O file write PostScript to file instead of standard output", +" -p generate regular PostScript", +" -r # or auto rotate by 90, 180, 270 degrees or auto", +" -s generate PostScript for a single image", +" -t name set postscript document title. Otherwise the filename is used", +" -T print pages for top edge binding", +" -x override resolution units as centimeters", +" -y override resolution units as inches", +" -z enable printing in the deadzone (only for PostScript Level 2/3)", +NULL +}; + +static void +usage(int code) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(code); +} + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2rgba.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2rgba.c new file mode 100644 index 0000000..737167c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiff2rgba.c @@ -0,0 +1,541 @@ +/* $Id: tiff2rgba.c,v 1.19 2011-02-23 21:46:09 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1991-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffiop.h" +#include "tiffio.h" + +#define streq(a,b) (strcmp(a,b) == 0) +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) + +#ifndef howmany +#define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#define roundup(x, y) (howmany(x,y)*((uint32)(y))) + +uint16 compression = COMPRESSION_PACKBITS; +uint32 rowsperstrip = (uint32) -1; +int process_by_block = 0; /* default is whole image at once */ +int no_alpha = 0; +int bigtiff_output = 0; + + +static int tiffcvt(TIFF* in, TIFF* out); +static void usage(int code); + +int +main(int argc, char* argv[]) +{ + TIFF *in, *out; + int c; + extern int optind; + extern char *optarg; + + while ((c = getopt(argc, argv, "c:r:t:bn8")) != -1) + switch (c) { + case 'b': + process_by_block = 1; + break; + + case 'c': + if (streq(optarg, "none")) + compression = COMPRESSION_NONE; + else if (streq(optarg, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (streq(optarg, "lzw")) + compression = COMPRESSION_LZW; + else if (streq(optarg, "jpeg")) + compression = COMPRESSION_JPEG; + else if (streq(optarg, "zip")) + compression = COMPRESSION_DEFLATE; + else + usage(-1); + break; + + case 'r': + rowsperstrip = atoi(optarg); + break; + + case 't': + rowsperstrip = atoi(optarg); + break; + + case 'n': + no_alpha = 1; + break; + + case '8': + bigtiff_output = 1; + break; + + case '?': + usage(0); + /*NOTREACHED*/ + } + + if (argc - optind < 2) + usage(-1); + + out = TIFFOpen(argv[argc-1], bigtiff_output?"w8":"w"); + if (out == NULL) + return (-2); + + for (; optind < argc-1; optind++) { + in = TIFFOpen(argv[optind], "r"); + if (in != NULL) { + do { + if (!tiffcvt(in, out) || + !TIFFWriteDirectory(out)) { + (void) TIFFClose(out); + (void) TIFFClose(in); + return (1); + } + } while (TIFFReadDirectory(in)); + (void) TIFFClose(in); + } + } + (void) TIFFClose(out); + return (0); +} + +static int +cvt_by_tile( TIFF *in, TIFF *out ) + +{ + uint32* raster; /* retrieve RGBA image */ + uint32 width, height; /* image width & height */ + uint32 tile_width, tile_height; + uint32 row, col; + uint32 *wrk_line; + int ok = 1; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); + + if( !TIFFGetField(in, TIFFTAG_TILEWIDTH, &tile_width) + || !TIFFGetField(in, TIFFTAG_TILELENGTH, &tile_height) ) { + TIFFError(TIFFFileName(in), "Source image not tiled"); + return (0); + } + + TIFFSetField(out, TIFFTAG_TILEWIDTH, tile_width ); + TIFFSetField(out, TIFFTAG_TILELENGTH, tile_height ); + + /* + * Allocate tile buffer + */ + raster = (uint32*)_TIFFmalloc(tile_width * tile_height * sizeof (uint32)); + if (raster == 0) { + TIFFError(TIFFFileName(in), "No space for raster buffer"); + return (0); + } + + /* + * Allocate a scanline buffer for swapping during the vertical + * mirroring pass. + */ + wrk_line = (uint32*)_TIFFmalloc(tile_width * sizeof (uint32)); + if (!wrk_line) { + TIFFError(TIFFFileName(in), "No space for raster scanline buffer"); + ok = 0; + } + + /* + * Loop over the tiles. + */ + for( row = 0; ok && row < height; row += tile_height ) + { + for( col = 0; ok && col < width; col += tile_width ) + { + uint32 i_row; + + /* Read the tile into an RGBA array */ + if (!TIFFReadRGBATile(in, col, row, raster)) { + ok = 0; + break; + } + + + /* + * XXX: raster array has 4-byte unsigned integer type, that is why + * we should rearrange it here. + */ +#if HOST_BIGENDIAN + TIFFSwabArrayOfLong(raster, tile_width * tile_height); +#endif + + /* + * For some reason the TIFFReadRGBATile() function chooses the + * lower left corner as the origin. Vertically mirror scanlines. + */ + for( i_row = 0; i_row < tile_height / 2; i_row++ ) + { + uint32 *top_line, *bottom_line; + + top_line = raster + tile_width * i_row; + bottom_line = raster + tile_width * (tile_height-i_row-1); + + _TIFFmemcpy(wrk_line, top_line, 4*tile_width); + _TIFFmemcpy(top_line, bottom_line, 4*tile_width); + _TIFFmemcpy(bottom_line, wrk_line, 4*tile_width); + } + + /* + * Write out the result in a tile. + */ + + if( TIFFWriteEncodedTile( out, + TIFFComputeTile( out, col, row, 0, 0), + raster, + 4 * tile_width * tile_height ) == -1 ) + { + ok = 0; + break; + } + } + } + + _TIFFfree( raster ); + _TIFFfree( wrk_line ); + + return ok; +} + +static int +cvt_by_strip( TIFF *in, TIFF *out ) + +{ + uint32* raster; /* retrieve RGBA image */ + uint32 width, height; /* image width & height */ + uint32 row; + uint32 *wrk_line; + int ok = 1; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); + + if( !TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip) ) { + TIFFError(TIFFFileName(in), "Source image not in strips"); + return (0); + } + + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + /* + * Allocate strip buffer + */ + raster = (uint32*)_TIFFmalloc(width * rowsperstrip * sizeof (uint32)); + if (raster == 0) { + TIFFError(TIFFFileName(in), "No space for raster buffer"); + return (0); + } + + /* + * Allocate a scanline buffer for swapping during the vertical + * mirroring pass. + */ + wrk_line = (uint32*)_TIFFmalloc(width * sizeof (uint32)); + if (!wrk_line) { + TIFFError(TIFFFileName(in), "No space for raster scanline buffer"); + ok = 0; + } + + /* + * Loop over the strips. + */ + for( row = 0; ok && row < height; row += rowsperstrip ) + { + int rows_to_write, i_row; + + /* Read the strip into an RGBA array */ + if (!TIFFReadRGBAStrip(in, row, raster)) { + ok = 0; + break; + } + + /* + * XXX: raster array has 4-byte unsigned integer type, that is why + * we should rearrange it here. + */ +#if HOST_BIGENDIAN + TIFFSwabArrayOfLong(raster, width * rowsperstrip); +#endif + + /* + * Figure out the number of scanlines actually in this strip. + */ + if( row + rowsperstrip > height ) + rows_to_write = height - row; + else + rows_to_write = rowsperstrip; + + /* + * For some reason the TIFFReadRGBAStrip() function chooses the + * lower left corner as the origin. Vertically mirror scanlines. + */ + + for( i_row = 0; i_row < rows_to_write / 2; i_row++ ) + { + uint32 *top_line, *bottom_line; + + top_line = raster + width * i_row; + bottom_line = raster + width * (rows_to_write-i_row-1); + + _TIFFmemcpy(wrk_line, top_line, 4*width); + _TIFFmemcpy(top_line, bottom_line, 4*width); + _TIFFmemcpy(bottom_line, wrk_line, 4*width); + } + + /* + * Write out the result in a strip + */ + + if( TIFFWriteEncodedStrip( out, row / rowsperstrip, raster, + 4 * rows_to_write * width ) == -1 ) + { + ok = 0; + break; + } + } + + _TIFFfree( raster ); + _TIFFfree( wrk_line ); + + return ok; +} + +/* + * cvt_whole_image() + * + * read the whole image into one big RGBA buffer and then write out + * strips from that. This is using the traditional TIFFReadRGBAImage() + * API that we trust. + */ + +static int +cvt_whole_image( TIFF *in, TIFF *out ) + +{ + uint32* raster; /* retrieve RGBA image */ + uint32 width, height; /* image width & height */ + uint32 row; + size_t pixel_count; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); + pixel_count = width * height; + + /* XXX: Check the integer overflow. */ + if (!width || !height || pixel_count / width != height) { + TIFFError(TIFFFileName(in), + "Malformed input file; can't allocate buffer for raster of %lux%lu size", + (unsigned long)width, (unsigned long)height); + return 0; + } + + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + raster = (uint32*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32), "raster buffer"); + if (raster == 0) { + TIFFError(TIFFFileName(in), "Failed to allocate buffer (%lu elements of %lu each)", + (unsigned long)pixel_count, (unsigned long)sizeof(uint32)); + return (0); + } + + /* Read the image in one chunk into an RGBA array */ + if (!TIFFReadRGBAImageOriented(in, width, height, raster, + ORIENTATION_TOPLEFT, 0)) { + _TIFFfree(raster); + return (0); + } + + /* + * XXX: raster array has 4-byte unsigned integer type, that is why + * we should rearrange it here. + */ +#if HOST_BIGENDIAN + TIFFSwabArrayOfLong(raster, width * height); +#endif + + /* + * Do we want to strip away alpha components? + */ + if (no_alpha) + { + size_t count = pixel_count; + unsigned char *src, *dst; + + src = dst = (unsigned char *) raster; + while (count > 0) + { + *(dst++) = *(src++); + *(dst++) = *(src++); + *(dst++) = *(src++); + src++; + count--; + } + } + + /* + * Write out the result in strips + */ + for (row = 0; row < height; row += rowsperstrip) + { + unsigned char * raster_strip; + int rows_to_write; + int bytes_per_pixel; + + if (no_alpha) + { + raster_strip = ((unsigned char *) raster) + 3 * row * width; + bytes_per_pixel = 3; + } + else + { + raster_strip = (unsigned char *) (raster + row * width); + bytes_per_pixel = 4; + } + + if( row + rowsperstrip > height ) + rows_to_write = height - row; + else + rows_to_write = rowsperstrip; + + if( TIFFWriteEncodedStrip( out, row / rowsperstrip, raster_strip, + bytes_per_pixel * rows_to_write * width ) == -1 ) + { + _TIFFfree( raster ); + return 0; + } + } + + _TIFFfree( raster ); + + return 1; +} + + +static int +tiffcvt(TIFF* in, TIFF* out) +{ + uint32 width, height; /* image width & height */ + uint16 shortv; + float floatv; + char *stringv; + uint32 longv; + uint16 v[1]; + + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height); + + CopyField(TIFFTAG_SUBFILETYPE, longv); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, height); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); + + CopyField(TIFFTAG_FILLORDER, shortv); + TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); + + if( no_alpha ) + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3); + else + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 4); + + if( !no_alpha ) + { + v[0] = EXTRASAMPLE_ASSOCALPHA; + TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, v); + } + + CopyField(TIFFTAG_XRESOLUTION, floatv); + CopyField(TIFFTAG_YRESOLUTION, floatv); + CopyField(TIFFTAG_RESOLUTIONUNIT, shortv); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion()); + CopyField(TIFFTAG_DOCUMENTNAME, stringv); + + if( process_by_block && TIFFIsTiled( in ) ) + return( cvt_by_tile( in, out ) ); + else if( process_by_block ) + return( cvt_by_strip( in, out ) ); + else + return( cvt_whole_image( in, out ) ); +} + +static char* stuff[] = { + "usage: tiff2rgba [-c comp] [-r rows] [-b] [-n] [-8] input... output", + "where comp is one of the following compression algorithms:", + " jpeg\t\tJPEG encoding", + " zip\t\tLempel-Ziv & Welch encoding", + " lzw\t\tLempel-Ziv & Welch encoding", + " packbits\tPackBits encoding", + " none\t\tno compression", + "and the other options are:", + " -r\trows/strip", + " -b (progress by block rather than as a whole image)", + " -n don't emit alpha component.", + " -8 write BigTIFF file instead of ClassicTIFF", + NULL +}; + +static void +usage(int code) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(code); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcmp.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcmp.c new file mode 100644 index 0000000..bc7dac9 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcmp.c @@ -0,0 +1,644 @@ +/* $Id: tiffcmp.c,v 1.16 2010-03-10 18:56:50 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +static int stopondiff = 1; +static int stoponfirsttag = 1; +static uint16 bitspersample = 1; +static uint16 samplesperpixel = 1; +static uint16 sampleformat = SAMPLEFORMAT_UINT; +static uint32 imagewidth; +static uint32 imagelength; + +static void usage(void); +static int tiffcmp(TIFF*, TIFF*); +static int cmptags(TIFF*, TIFF*); +static int ContigCompare(int, uint32, unsigned char*, unsigned char*, tsize_t); +static int SeparateCompare(int, int, uint32, unsigned char*, unsigned char*); +static void PrintIntDiff(uint32, int, uint32, uint32, uint32); +static void PrintFloatDiff(uint32, int, uint32, double, double); + +static void leof(const char*, uint32, int); + +int +main(int argc, char* argv[]) +{ + TIFF *tif1, *tif2; + int c, dirnum; + extern int optind; + extern char* optarg; + + while ((c = getopt(argc, argv, "ltz:")) != -1) + switch (c) { + case 'l': + stopondiff = 0; + break; + case 'z': + stopondiff = atoi(optarg); + break; + case 't': + stoponfirsttag = 0; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind < 2) + usage(); + tif1 = TIFFOpen(argv[optind], "r"); + if (tif1 == NULL) + return (-1); + tif2 = TIFFOpen(argv[optind+1], "r"); + if (tif2 == NULL) + return (-2); + dirnum = 0; + while (tiffcmp(tif1, tif2)) { + if (!TIFFReadDirectory(tif1)) { + if (!TIFFReadDirectory(tif2)) + break; + printf("No more directories for %s\n", + TIFFFileName(tif1)); + return (1); + } else if (!TIFFReadDirectory(tif2)) { + printf("No more directories for %s\n", + TIFFFileName(tif2)); + return (1); + } + printf("Directory %d:\n", ++dirnum); + } + + TIFFClose(tif1); + TIFFClose(tif2); + return (0); +} + +char* stuff[] = { +"usage: tiffcmp [options] file1 file2", +"where options are:", +" -l list each byte of image data that differs between the files", +" -z # list specified number of bytes that differs between the files", +" -t ignore any differences in directory tags", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +#define checkEOF(tif, row, sample) { \ + leof(TIFFFileName(tif), row, sample); \ + goto bad; \ +} + +static int CheckShortTag(TIFF*, TIFF*, int, char*); +static int CheckShort2Tag(TIFF*, TIFF*, int, char*); +static int CheckShortArrayTag(TIFF*, TIFF*, int, char*); +static int CheckLongTag(TIFF*, TIFF*, int, char*); +static int CheckFloatTag(TIFF*, TIFF*, int, char*); +static int CheckStringTag(TIFF*, TIFF*, int, char*); + +static int +tiffcmp(TIFF* tif1, TIFF* tif2) +{ + uint16 config1, config2; + tsize_t size1; + uint32 row; + tsample_t s; + unsigned char *buf1, *buf2; + + if (!CheckShortTag(tif1, tif2, TIFFTAG_BITSPERSAMPLE, "BitsPerSample")) + return (0); + if (!CheckShortTag(tif1, tif2, TIFFTAG_SAMPLESPERPIXEL, "SamplesPerPixel")) + return (0); + if (!CheckLongTag(tif1, tif2, TIFFTAG_IMAGEWIDTH, "ImageWidth")) + return (0); + if (!cmptags(tif1, tif2)) + return (1); + (void) TIFFGetField(tif1, TIFFTAG_BITSPERSAMPLE, &bitspersample); + (void) TIFFGetField(tif1, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + (void) TIFFGetField(tif1, TIFFTAG_SAMPLEFORMAT, &sampleformat); + (void) TIFFGetField(tif1, TIFFTAG_IMAGEWIDTH, &imagewidth); + (void) TIFFGetField(tif1, TIFFTAG_IMAGELENGTH, &imagelength); + (void) TIFFGetField(tif1, TIFFTAG_PLANARCONFIG, &config1); + (void) TIFFGetField(tif2, TIFFTAG_PLANARCONFIG, &config2); + buf1 = (unsigned char *)_TIFFmalloc(size1 = TIFFScanlineSize(tif1)); + buf2 = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif2)); + if (buf1 == NULL || buf2 == NULL) { + fprintf(stderr, "No space for scanline buffers\n"); + exit(-1); + } + if (config1 != config2 && bitspersample != 8 && samplesperpixel > 1) { + fprintf(stderr, +"Can't handle different planar configuration w/ different bits/sample\n"); + goto bad; + } +#define pack(a,b) ((a)<<8)|(b) + switch (pack(config1, config2)) { + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG): + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(tif2, buf2, row, 0) < 0) + checkEOF(tif2, row, -1) + for (s = 0; s < samplesperpixel; s++) { + if (TIFFReadScanline(tif1, buf1, row, s) < 0) + checkEOF(tif1, row, s) + if (SeparateCompare(1, s, row, buf2, buf1) < 0) + goto bad1; + } + } + break; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE): + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(tif1, buf1, row, 0) < 0) + checkEOF(tif1, row, -1) + for (s = 0; s < samplesperpixel; s++) { + if (TIFFReadScanline(tif2, buf2, row, s) < 0) + checkEOF(tif2, row, s) + if (SeparateCompare(0, s, row, buf1, buf2) < 0) + goto bad1; + } + } + break; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE): + for (s = 0; s < samplesperpixel; s++) + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(tif1, buf1, row, s) < 0) + checkEOF(tif1, row, s) + if (TIFFReadScanline(tif2, buf2, row, s) < 0) + checkEOF(tif2, row, s) + if (ContigCompare(s, row, buf1, buf2, size1) < 0) + goto bad1; + } + break; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG): + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(tif1, buf1, row, 0) < 0) + checkEOF(tif1, row, -1) + if (TIFFReadScanline(tif2, buf2, row, 0) < 0) + checkEOF(tif2, row, -1) + if (ContigCompare(-1, row, buf1, buf2, size1) < 0) + goto bad1; + } + break; + } + if (buf1) _TIFFfree(buf1); + if (buf2) _TIFFfree(buf2); + return (1); +bad: + if (stopondiff) + exit(1); +bad1: + if (buf1) _TIFFfree(buf1); + if (buf2) _TIFFfree(buf2); + return (0); +} + +#define CmpShortField(tag, name) \ + if (!CheckShortTag(tif1, tif2, tag, name) && stoponfirsttag) return (0) +#define CmpShortField2(tag, name) \ + if (!CheckShort2Tag(tif1, tif2, tag, name) && stoponfirsttag) return (0) +#define CmpLongField(tag, name) \ + if (!CheckLongTag(tif1, tif2, tag, name) && stoponfirsttag) return (0) +#define CmpFloatField(tag, name) \ + if (!CheckFloatTag(tif1, tif2, tag, name) && stoponfirsttag) return (0) +#define CmpStringField(tag, name) \ + if (!CheckStringTag(tif1, tif2, tag, name) && stoponfirsttag) return (0) +#define CmpShortArrayField(tag, name) \ + if (!CheckShortArrayTag(tif1, tif2, tag, name) && stoponfirsttag) return (0) + +static int +cmptags(TIFF* tif1, TIFF* tif2) +{ + CmpLongField(TIFFTAG_SUBFILETYPE, "SubFileType"); + CmpLongField(TIFFTAG_IMAGEWIDTH, "ImageWidth"); + CmpLongField(TIFFTAG_IMAGELENGTH, "ImageLength"); + CmpShortField(TIFFTAG_BITSPERSAMPLE, "BitsPerSample"); + CmpShortField(TIFFTAG_COMPRESSION, "Compression"); + CmpShortField(TIFFTAG_PREDICTOR, "Predictor"); + CmpShortField(TIFFTAG_PHOTOMETRIC, "PhotometricInterpretation"); + CmpShortField(TIFFTAG_THRESHHOLDING, "Thresholding"); + CmpShortField(TIFFTAG_FILLORDER, "FillOrder"); + CmpShortField(TIFFTAG_ORIENTATION, "Orientation"); + CmpShortField(TIFFTAG_SAMPLESPERPIXEL, "SamplesPerPixel"); + CmpShortField(TIFFTAG_MINSAMPLEVALUE, "MinSampleValue"); + CmpShortField(TIFFTAG_MAXSAMPLEVALUE, "MaxSampleValue"); + CmpShortField(TIFFTAG_SAMPLEFORMAT, "SampleFormat"); + CmpFloatField(TIFFTAG_XRESOLUTION, "XResolution"); + CmpFloatField(TIFFTAG_YRESOLUTION, "YResolution"); + CmpLongField(TIFFTAG_GROUP3OPTIONS, "Group3Options"); + CmpLongField(TIFFTAG_GROUP4OPTIONS, "Group4Options"); + CmpShortField(TIFFTAG_RESOLUTIONUNIT, "ResolutionUnit"); + CmpShortField(TIFFTAG_PLANARCONFIG, "PlanarConfiguration"); + CmpLongField(TIFFTAG_ROWSPERSTRIP, "RowsPerStrip"); + CmpFloatField(TIFFTAG_XPOSITION, "XPosition"); + CmpFloatField(TIFFTAG_YPOSITION, "YPosition"); + CmpShortField(TIFFTAG_GRAYRESPONSEUNIT, "GrayResponseUnit"); + CmpShortField(TIFFTAG_COLORRESPONSEUNIT, "ColorResponseUnit"); +#ifdef notdef + { uint16 *graycurve; + CmpField(TIFFTAG_GRAYRESPONSECURVE, graycurve); + } + { uint16 *red, *green, *blue; + CmpField3(TIFFTAG_COLORRESPONSECURVE, red, green, blue); + } + { uint16 *red, *green, *blue; + CmpField3(TIFFTAG_COLORMAP, red, green, blue); + } +#endif + CmpShortField2(TIFFTAG_PAGENUMBER, "PageNumber"); + CmpStringField(TIFFTAG_ARTIST, "Artist"); + CmpStringField(TIFFTAG_IMAGEDESCRIPTION,"ImageDescription"); + CmpStringField(TIFFTAG_MAKE, "Make"); + CmpStringField(TIFFTAG_MODEL, "Model"); + CmpStringField(TIFFTAG_SOFTWARE, "Software"); + CmpStringField(TIFFTAG_DATETIME, "DateTime"); + CmpStringField(TIFFTAG_HOSTCOMPUTER, "HostComputer"); + CmpStringField(TIFFTAG_PAGENAME, "PageName"); + CmpStringField(TIFFTAG_DOCUMENTNAME, "DocumentName"); + CmpShortField(TIFFTAG_MATTEING, "Matteing"); + CmpShortArrayField(TIFFTAG_EXTRASAMPLES,"ExtraSamples"); + return (1); +} + +static int +ContigCompare(int sample, uint32 row, + unsigned char* p1, unsigned char* p2, tsize_t size) +{ + uint32 pix; + int ppb = 8 / bitspersample; + int samples_to_test; + + if (memcmp(p1, p2, size) == 0) + return 0; + + samples_to_test = (sample == -1) ? samplesperpixel : 1; + + switch (bitspersample) { + case 1: case 2: case 4: case 8: + { + unsigned char *pix1 = p1, *pix2 = p2; + + for (pix = 0; pix < imagewidth; pix += ppb) { + int s; + + for(s = 0; s < samples_to_test; s++) { + if (*pix1 != *pix2) { + if( sample == -1 ) + PrintIntDiff(row, s, pix, *pix1, *pix2); + else + PrintIntDiff(row, sample, pix, *pix1, *pix2); + } + + pix1++; + pix2++; + } + } + break; + } + case 16: + { + uint16 *pix1 = (uint16 *)p1, *pix2 = (uint16 *)p2; + + for (pix = 0; pix < imagewidth; pix++) { + int s; + + for(s = 0; s < samples_to_test; s++) { + if (*pix1 != *pix2) + PrintIntDiff(row, sample, pix, *pix1, *pix2); + + pix1++; + pix2++; + } + } + break; + } + case 32: + if (sampleformat == SAMPLEFORMAT_UINT + || sampleformat == SAMPLEFORMAT_INT) { + uint32 *pix1 = (uint32 *)p1, *pix2 = (uint32 *)p2; + + for (pix = 0; pix < imagewidth; pix++) { + int s; + + for(s = 0; s < samples_to_test; s++) { + if (*pix1 != *pix2) { + PrintIntDiff(row, sample, pix, + *pix1, *pix2); + } + + pix1++; + pix2++; + } + } + } else if (sampleformat == SAMPLEFORMAT_IEEEFP) { + float *pix1 = (float *)p1, *pix2 = (float *)p2; + + for (pix = 0; pix < imagewidth; pix++) { + int s; + + for(s = 0; s < samples_to_test; s++) { + if (fabs(*pix1 - *pix2) < 0.000000000001) { + PrintFloatDiff(row, sample, pix, + *pix1, *pix2); + } + + pix1++; + pix2++; + } + } + } else { + fprintf(stderr, "Sample format %d is not supported.\n", + sampleformat); + return -1; + } + break; + default: + fprintf(stderr, "Bit depth %d is not supported.\n", bitspersample); + return -1; + } + + return 0; +} + +static void +PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2) +{ + if (sample < 0) + sample = 0; + switch (bitspersample) { + case 1: + case 2: + case 4: + { + int32 mask1, mask2, s; + + mask1 = ~((-1) << bitspersample); + s = (8 - bitspersample); + mask2 = mask1 << s; + for (; mask2 && pix < imagewidth; + mask2 >>= bitspersample, s -= bitspersample, pix++) { + if ((w1 & mask2) ^ (w2 & mask2)) { + printf( + "Scanline %lu, pixel %lu, sample %d: %01x %01x\n", + (unsigned long) row, + (unsigned long) pix, + sample, + (unsigned int)((w1 >> s) & mask1), + (unsigned int)((w2 >> s) & mask1)); + if (--stopondiff == 0) + exit(1); + } + } + break; + } + case 8: + printf("Scanline %lu, pixel %lu, sample %d: %02x %02x\n", + (unsigned long) row, (unsigned long) pix, sample, + (unsigned int) w1, (unsigned int) w2); + if (--stopondiff == 0) + exit(1); + break; + case 16: + printf("Scanline %lu, pixel %lu, sample %d: %04x %04x\n", + (unsigned long) row, (unsigned long) pix, sample, + (unsigned int) w1, (unsigned int) w2); + if (--stopondiff == 0) + exit(1); + break; + case 32: + printf("Scanline %lu, pixel %lu, sample %d: %08x %08x\n", + (unsigned long) row, (unsigned long) pix, sample, + (unsigned int) w1, (unsigned int) w2); + if (--stopondiff == 0) + exit(1); + break; + default: + break; + } +} + +static void +PrintFloatDiff(uint32 row, int sample, uint32 pix, double w1, double w2) +{ + if (sample < 0) + sample = 0; + switch (bitspersample) { + case 32: + printf("Scanline %lu, pixel %lu, sample %d: %g %g\n", + (long) row, (long) pix, sample, w1, w2); + if (--stopondiff == 0) + exit(1); + break; + default: + break; + } +} + +static int +SeparateCompare(int reversed, int sample, uint32 row, + unsigned char* cp1, unsigned char* p2) +{ + uint32 npixels = imagewidth; + int pixel; + + cp1 += sample; + for (pixel = 0; npixels-- > 0; pixel++, cp1 += samplesperpixel, p2++) { + if (*cp1 != *p2) { + printf("Scanline %lu, pixel %lu, sample %ld: ", + (long) row, (long) pixel, (long) sample); + if (reversed) + printf("%02x %02x\n", *p2, *cp1); + else + printf("%02x %02x\n", *cp1, *p2); + if (--stopondiff == 0) + exit(1); + } + } + + return 0; +} + +static int +checkTag(TIFF* tif1, TIFF* tif2, int tag, char* name, void* p1, void* p2) +{ + + if (TIFFGetField(tif1, tag, p1)) { + if (!TIFFGetField(tif2, tag, p2)) { + printf("%s tag appears only in %s\n", + name, TIFFFileName(tif1)); + return (0); + } + return (1); + } else if (TIFFGetField(tif2, tag, p2)) { + printf("%s tag appears only in %s\n", name, TIFFFileName(tif2)); + return (0); + } + return (-1); +} + +#define CHECK(cmp, fmt) { \ + switch (checkTag(tif1,tif2,tag,name,&v1,&v2)) { \ + case 1: if (cmp) \ + case -1: return (1); \ + printf(fmt, name, v1, v2); \ + } \ + return (0); \ +} + +static int +CheckShortTag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + uint16 v1, v2; + CHECK(v1 == v2, "%s: %u %u\n"); +} + +static int +CheckShort2Tag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + uint16 v11, v12, v21, v22; + + if (TIFFGetField(tif1, tag, &v11, &v12)) { + if (!TIFFGetField(tif2, tag, &v21, &v22)) { + printf("%s tag appears only in %s\n", + name, TIFFFileName(tif1)); + return (0); + } + if (v11 == v21 && v12 == v22) + return (1); + printf("%s: <%u,%u> <%u,%u>\n", name, v11, v12, v21, v22); + } else if (TIFFGetField(tif2, tag, &v21, &v22)) + printf("%s tag appears only in %s\n", name, TIFFFileName(tif2)); + else + return (1); + return (0); +} + +static int +CheckShortArrayTag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + uint16 n1, *a1; + uint16 n2, *a2; + + if (TIFFGetField(tif1, tag, &n1, &a1)) { + if (!TIFFGetField(tif2, tag, &n2, &a2)) { + printf("%s tag appears only in %s\n", + name, TIFFFileName(tif1)); + return (0); + } + if (n1 == n2) { + char* sep; + uint16 i; + + if (memcmp(a1, a2, n1 * sizeof(uint16)) == 0) + return (1); + printf("%s: value mismatch, <%u:", name, n1); + sep = ""; + for (i = 0; i < n1; i++) + printf("%s%u", sep, a1[i]), sep = ","; + printf("> and <%u: ", n2); + sep = ""; + for (i = 0; i < n2; i++) + printf("%s%u", sep, a2[i]), sep = ","; + printf(">\n"); + } else + printf("%s: %u items in %s, %u items in %s", name, + n1, TIFFFileName(tif1), + n2, TIFFFileName(tif2) + ); + } else if (TIFFGetField(tif2, tag, &n2, &a2)) + printf("%s tag appears only in %s\n", name, TIFFFileName(tif2)); + else + return (1); + return (0); +} + +static int +CheckLongTag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + uint32 v1, v2; + CHECK(v1 == v2, "%s: %u %u\n"); +} + +static int +CheckFloatTag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + float v1, v2; + CHECK(v1 == v2, "%s: %g %g\n"); +} + +static int +CheckStringTag(TIFF* tif1, TIFF* tif2, int tag, char* name) +{ + char *v1, *v2; + CHECK(strcmp(v1, v2) == 0, "%s: \"%s\" \"%s\"\n"); +} + +static void +leof(const char* name, uint32 row, int s) +{ + + printf("%s: EOF at scanline %lu", name, (unsigned long)row); + if (s >= 0) + printf(", sample %d", s); + printf("\n"); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcp.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcp.c new file mode 100644 index 0000000..0f81b19 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcp.c @@ -0,0 +1,1860 @@ +/* $Id: tiffcp.c,v 1.49 2010-12-23 13:38:47 dron Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Revised: 2/18/01 BAR -- added syntax for extracting single images from + * multi-image TIFF files. + * + * New syntax is: sourceFileName,image# + * + * image# ranges from 0.. where n is the # of images in the file. + * There may be no white space between the comma and the filename or + * image number. + * + * Example: tiffcp source.tif,1 destination.tif + * + * Copies the 2nd image in source.tif to the destination. + * + ***** + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#if defined(VMS) +# define unlink delete +#endif + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +#define TRUE 1 +#define FALSE 0 + +static int outtiled = -1; +static uint32 tilewidth; +static uint32 tilelength; + +static uint16 config; +static uint16 compression; +static uint16 predictor; +static int preset; +static uint16 fillorder; +static uint16 orientation; +static uint32 rowsperstrip; +static uint32 g3opts; +static int ignore = FALSE; /* if true, ignore read errors */ +static uint32 defg3opts = (uint32) -1; +static int quality = 75; /* JPEG quality */ +static int jpegcolormode = JPEGCOLORMODE_RGB; +static uint16 defcompression = (uint16) -1; +static uint16 defpredictor = (uint16) -1; +static int defpreset = -1; + +static int tiffcp(TIFF*, TIFF*); +static int processCompressOptions(char*); +static void usage(void); + +static char comma = ','; /* (default) comma separator character */ +static TIFF* bias = NULL; +static int pageNum = 0; +static int pageInSeq = 0; + +static int nextSrcImage (TIFF *tif, char **imageSpec) +/* + seek to the next image specified in *imageSpec + returns 1 if success, 0 if no more images to process + *imageSpec=NULL if subsequent images should be processed in sequence +*/ +{ + if (**imageSpec == comma) { /* if not @comma, we've done all images */ + char *start = *imageSpec + 1; + tdir_t nextImage = (tdir_t)strtol(start, imageSpec, 0); + if (start == *imageSpec) nextImage = TIFFCurrentDirectory (tif); + if (**imageSpec) + { + if (**imageSpec == comma) { + /* a trailing comma denotes remaining images in sequence */ + if ((*imageSpec)[1] == '\0') *imageSpec = NULL; + }else{ + fprintf (stderr, + "Expected a %c separated image # list after %s\n", + comma, TIFFFileName (tif)); + exit (-4); /* syntax error */ + } + } + if (TIFFSetDirectory (tif, nextImage)) return 1; + fprintf (stderr, "%s%c%d not found!\n", + TIFFFileName(tif), comma, (int) nextImage); + } + return 0; +} + + +static TIFF* openSrcImage (char **imageSpec) +/* + imageSpec points to a pointer to a filename followed by optional ,image#'s + Open the TIFF file and assign *imageSpec to either NULL if there are + no images specified, or a pointer to the next image number text +*/ +{ + TIFF *tif; + char *fn = *imageSpec; + *imageSpec = strchr (fn, comma); + if (*imageSpec) { /* there is at least one image number specifier */ + **imageSpec = '\0'; + tif = TIFFOpen (fn, "r"); + /* but, ignore any single trailing comma */ + if (!(*imageSpec)[1]) {*imageSpec = NULL; return tif;} + if (tif) { + **imageSpec = comma; /* replace the comma */ + if (!nextSrcImage(tif, imageSpec)) { + TIFFClose (tif); + tif = NULL; + } + } + }else + tif = TIFFOpen (fn, "r"); + return tif; +} + +int +main(int argc, char* argv[]) +{ + uint16 defconfig = (uint16) -1; + uint16 deffillorder = 0; + uint32 deftilewidth = (uint32) -1; + uint32 deftilelength = (uint32) -1; + uint32 defrowsperstrip = (uint32) 0; + uint64 diroff = 0; + TIFF* in; + TIFF* out; + char mode[10]; + char* mp = mode; + int c; + extern int optind; + extern char* optarg; + + *mp++ = 'w'; + *mp = '\0'; + while ((c = getopt(argc, argv, ",:b:c:f:l:o:z:p:r:w:aistBLMC8x")) != -1) + switch (c) { + case ',': + if (optarg[0] != '=') usage(); + comma = optarg[1]; + break; + case 'b': /* this file is bias image subtracted from others */ + if (bias) { + fputs ("Only 1 bias image may be specified\n", stderr); + exit (-2); + } + { + uint16 samples = (uint16) -1; + char **biasFn = &optarg; + bias = openSrcImage (biasFn); + if (!bias) exit (-5); + if (TIFFIsTiled (bias)) { + fputs ("Bias image must be organized in strips\n", stderr); + exit (-7); + } + TIFFGetField(bias, TIFFTAG_SAMPLESPERPIXEL, &samples); + if (samples != 1) { + fputs ("Bias image must be monochrome\n", stderr); + exit (-7); + } + } + break; + case 'a': /* append to output */ + mode[0] = 'a'; + break; + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'f': /* fill order */ + if (streq(optarg, "lsb2msb")) + deffillorder = FILLORDER_LSB2MSB; + else if (streq(optarg, "msb2lsb")) + deffillorder = FILLORDER_MSB2LSB; + else + usage(); + break; + case 'i': /* ignore errors */ + ignore = TRUE; + break; + case 'l': /* tile length */ + outtiled = TRUE; + deftilelength = atoi(optarg); + break; + case 'o': /* initial directory offset */ + diroff = strtoul(optarg, NULL, 0); + break; + case 'p': /* planar configuration */ + if (streq(optarg, "separate")) + defconfig = PLANARCONFIG_SEPARATE; + else if (streq(optarg, "contig")) + defconfig = PLANARCONFIG_CONTIG; + else + usage(); + break; + case 'r': /* rows/strip */ + defrowsperstrip = atol(optarg); + break; + case 's': /* generate stripped output */ + outtiled = FALSE; + break; + case 't': /* generate tiled output */ + outtiled = TRUE; + break; + case 'w': /* tile width */ + outtiled = TRUE; + deftilewidth = atoi(optarg); + break; + case 'B': + *mp++ = 'b'; *mp = '\0'; + break; + case 'L': + *mp++ = 'l'; *mp = '\0'; + break; + case 'M': + *mp++ = 'm'; *mp = '\0'; + break; + case 'C': + *mp++ = 'c'; *mp = '\0'; + break; + case '8': + *mp++ = '8'; *mp = '\0'; + break; + case 'x': + pageInSeq = 1; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind < 2) + usage(); + out = TIFFOpen(argv[argc-1], mode); + if (out == NULL) + return (-2); + if ((argc - optind) == 2) + pageNum = -1; + for (; optind < argc-1 ; optind++) { + char *imageCursor = argv[optind]; + in = openSrcImage (&imageCursor); + if (in == NULL) { + (void) TIFFClose(out); + return (-3); + } + if (diroff != 0 && !TIFFSetSubDirectory(in, diroff)) { + TIFFError(TIFFFileName(in), + "Error, setting subdirectory at " TIFF_UINT64_FORMAT, diroff); + (void) TIFFClose(in); + (void) TIFFClose(out); + return (1); + } + for (;;) { + config = defconfig; + compression = defcompression; + predictor = defpredictor; + preset = defpreset; + fillorder = deffillorder; + rowsperstrip = defrowsperstrip; + tilewidth = deftilewidth; + tilelength = deftilelength; + g3opts = defg3opts; + if (!tiffcp(in, out) || !TIFFWriteDirectory(out)) { + (void) TIFFClose(in); + (void) TIFFClose(out); + return (1); + } + if (imageCursor) { /* seek next image directory */ + if (!nextSrcImage(in, &imageCursor)) break; + }else + if (!TIFFReadDirectory(in)) break; + } + (void) TIFFClose(in); + } + + (void) TIFFClose(out); + return (0); +} + +static void +processZIPOptions(char* cp) +{ + if ( (cp = strchr(cp, ':')) ) { + do { + cp++; + if (isdigit((int)*cp)) + defpredictor = atoi(cp); + else if (*cp == 'p') + defpreset = atoi(++cp); + else + usage(); + } while( (cp = strchr(cp, ':')) ); + } +} + +static void +processG3Options(char* cp) +{ + if( (cp = strchr(cp, ':')) ) { + if (defg3opts == (uint32) -1) + defg3opts = 0; + do { + cp++; + if (strneq(cp, "1d", 2)) + defg3opts &= ~GROUP3OPT_2DENCODING; + else if (strneq(cp, "2d", 2)) + defg3opts |= GROUP3OPT_2DENCODING; + else if (strneq(cp, "fill", 4)) + defg3opts |= GROUP3OPT_FILLBITS; + else + usage(); + } while( (cp = strchr(cp, ':')) ); + } +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) { + defcompression = COMPRESSION_NONE; + } else if (streq(opt, "packbits")) { + defcompression = COMPRESSION_PACKBITS; + } else if (strneq(opt, "jpeg", 4)) { + char* cp = strchr(opt, ':'); + + defcompression = COMPRESSION_JPEG; + while( cp ) + { + if (isdigit((int)cp[1])) + quality = atoi(cp+1); + else if (cp[1] == 'r' ) + jpegcolormode = JPEGCOLORMODE_RAW; + else + usage(); + + cp = strchr(cp+1,':'); + } + } else if (strneq(opt, "g3", 2)) { + processG3Options(opt); + defcompression = COMPRESSION_CCITTFAX3; + } else if (streq(opt, "g4")) { + defcompression = COMPRESSION_CCITTFAX4; + } else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + defpredictor = atoi(cp+1); + defcompression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + processZIPOptions(opt); + defcompression = COMPRESSION_ADOBE_DEFLATE; + } else if (strneq(opt, "lzma", 4)) { + processZIPOptions(opt); + defcompression = COMPRESSION_LZMA; + } else if (strneq(opt, "jbig", 4)) { + defcompression = COMPRESSION_JBIG; + } else if (strneq(opt, "sgilog", 6)) { + defcompression = COMPRESSION_SGILOG; + } else + return (0); + return (1); +} + +char* stuff[] = { +"usage: tiffcp [options] input... output", +"where options are:", +" -a append to output instead of overwriting", +" -o offset set initial directory offset", +" -p contig pack samples contiguously (e.g. RGBRGB...)", +" -p separate store samples separately (e.g. RRR...GGG...BBB...)", +" -s write output in strips", +" -t write output in tiles", +" -8 write BigTIFF instead of default ClassicTIFF", +" -i ignore read errors", +" -b file[,#] bias (dark) monochrome image to be subtracted from all others", +" -,=% use % rather than , to separate image #'s (per Note below)", +"", +" -r # make each strip have no more than # rows", +" -w # set output tile width (pixels)", +" -l # set output tile length (pixels)", +"", +" -f lsb2msb force lsb-to-msb FillOrder for output", +" -f msb2lsb force msb-to-lsb FillOrder for output", +"", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c lzma[:opts] compress output with LZMA2 encoding", +" -c jpeg[:opts] compress output with JPEG encoding", +" -c jbig compress output with ISO JBIG encoding", +" -c packbits compress output with packbits encoding", +" -c g3[:opts] compress output with CCITT Group 3 encoding", +" -c g4 compress output with CCITT Group 4 encoding", +" -c sgilog compress output with SGILOG encoding", +" -c none use no compression algorithm on output", +" -x force the merged tiff pages in sequence", +"", +"Group 3 options:", +" 1d use default CCITT Group 3 1D-encoding", +" 2d use optional CCITT Group 3 2D-encoding", +" fill byte-align EOL codes", +"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs", +"", +"JPEG options:", +" # set compression quality level (0-100, default 75)", +" r output color image as RGB rather than YCbCr", +"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality", +"", +"LZW, Deflate (ZIP) and LZMA2 options:", +" # set predictor value", +" p# set compression level (preset)", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing,", +"-c zip:3:p9 for Deflate encoding with maximum compression level and floating", +"point predictor.", +"", +"Note that input filenames may be of the form filename,x,y,z", +"where x, y, and z specify image numbers in the filename to copy.", +"example: tiffcp -c none -b esp.tif,1 esp.tif,0 test.tif", +" subtract 2nd image in esp.tif from 1st yielding uncompressed result test.tif", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) +#define CopyField4(tag, v1, v2, v3, v4) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4) + +static void +cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type) +{ + switch (type) { + case TIFF_SHORT: + if (count == 1) { + uint16 shortv; + CopyField(tag, shortv); + } else if (count == 2) { + uint16 shortv1, shortv2; + CopyField2(tag, shortv1, shortv2); + } else if (count == 4) { + uint16 *tr, *tg, *tb, *ta; + CopyField4(tag, tr, tg, tb, ta); + } else if (count == (uint16) -1) { + uint16 shortv1; + uint16* shortav; + CopyField2(tag, shortv1, shortav); + } + break; + case TIFF_LONG: + { uint32 longv; + CopyField(tag, longv); + } + break; + case TIFF_RATIONAL: + if (count == 1) { + float floatv; + CopyField(tag, floatv); + } else if (count == (uint16) -1) { + float* floatav; + CopyField(tag, floatav); + } + break; + case TIFF_ASCII: + { char* stringv; + CopyField(tag, stringv); + } + break; + case TIFF_DOUBLE: + if (count == 1) { + double doublev; + CopyField(tag, doublev); + } else if (count == (uint16) -1) { + double* doubleav; + CopyField(tag, doubleav); + } + break; + default: + TIFFError(TIFFFileName(in), + "Data type %d is not supported, tag %d skipped.", + tag, type); + } +} + +static struct cpTag { + uint16 tag; + uint16 count; + TIFFDataType type; +} tags[] = { + { TIFFTAG_SUBFILETYPE, 1, TIFF_LONG }, + { TIFFTAG_THRESHHOLDING, 1, TIFF_SHORT }, + { TIFFTAG_DOCUMENTNAME, 1, TIFF_ASCII }, + { TIFFTAG_IMAGEDESCRIPTION, 1, TIFF_ASCII }, + { TIFFTAG_MAKE, 1, TIFF_ASCII }, + { TIFFTAG_MODEL, 1, TIFF_ASCII }, + { TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_PAGENAME, 1, TIFF_ASCII }, + { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT }, + { TIFFTAG_SOFTWARE, 1, TIFF_ASCII }, + { TIFFTAG_DATETIME, 1, TIFF_ASCII }, + { TIFFTAG_ARTIST, 1, TIFF_ASCII }, + { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII }, + { TIFFTAG_WHITEPOINT, (uint16) -1, TIFF_RATIONAL }, + { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, + { TIFFTAG_INKSET, 1, TIFF_SHORT }, + { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, + { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, + { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, + { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT }, + { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT }, + { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT }, + { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_STONITS, 1, TIFF_DOUBLE }, +}; +#define NTAGS (sizeof (tags) / sizeof (tags[0])) + +#define CopyTag(tag, count, type) cpTag(in, out, tag, count, type) + +typedef int (*copyFunc) + (TIFF* in, TIFF* out, uint32 l, uint32 w, uint16 samplesperpixel); +static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16); + +/* PODD */ + +static int +tiffcp(TIFF* in, TIFF* out) +{ + uint16 bitspersample, samplesperpixel; + uint16 input_compression, input_photometric; + copyFunc cf; + uint32 width, length; + struct cpTag* p; + + CopyField(TIFFTAG_IMAGEWIDTH, width); + CopyField(TIFFTAG_IMAGELENGTH, length); + CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample); + CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); + if (compression != (uint16)-1) + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + else + CopyField(TIFFTAG_COMPRESSION, compression); + TIFFGetFieldDefaulted(in, TIFFTAG_COMPRESSION, &input_compression); + TIFFGetFieldDefaulted(in, TIFFTAG_PHOTOMETRIC, &input_photometric); + if (input_compression == COMPRESSION_JPEG) { + /* Force conversion to RGB */ + TIFFSetField(in, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } else if (input_photometric == PHOTOMETRIC_YCBCR) { + /* Otherwise, can't handle subsampled input */ + uint16 subsamplinghor,subsamplingver; + + TIFFGetFieldDefaulted(in, TIFFTAG_YCBCRSUBSAMPLING, + &subsamplinghor, &subsamplingver); + if (subsamplinghor!=1 || subsamplingver!=1) { + fprintf(stderr, "tiffcp: %s: Can't copy/convert subsampled image.\n", + TIFFFileName(in)); + return FALSE; + } + } + if (compression == COMPRESSION_JPEG) { + if (input_photometric == PHOTOMETRIC_RGB && + jpegcolormode == JPEGCOLORMODE_RGB) + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + else + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, input_photometric); + } + else if (compression == COMPRESSION_SGILOG + || compression == COMPRESSION_SGILOG24) + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, + samplesperpixel == 1 ? + PHOTOMETRIC_LOGL : PHOTOMETRIC_LOGLUV); + else + CopyTag(TIFFTAG_PHOTOMETRIC, 1, TIFF_SHORT); + if (fillorder != 0) + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + else + CopyTag(TIFFTAG_FILLORDER, 1, TIFF_SHORT); + /* + * Will copy `Orientation' tag from input image + */ + TIFFGetFieldDefaulted(in, TIFFTAG_ORIENTATION, &orientation); + switch (orientation) { + case ORIENTATION_BOTRIGHT: + case ORIENTATION_RIGHTBOT: /* XXX */ + TIFFWarning(TIFFFileName(in), "using bottom-left orientation"); + orientation = ORIENTATION_BOTLEFT; + /* fall thru... */ + case ORIENTATION_LEFTBOT: /* XXX */ + case ORIENTATION_BOTLEFT: + break; + case ORIENTATION_TOPRIGHT: + case ORIENTATION_RIGHTTOP: /* XXX */ + default: + TIFFWarning(TIFFFileName(in), "using top-left orientation"); + orientation = ORIENTATION_TOPLEFT; + /* fall thru... */ + case ORIENTATION_LEFTTOP: /* XXX */ + case ORIENTATION_TOPLEFT: + break; + } + TIFFSetField(out, TIFFTAG_ORIENTATION, orientation); + /* + * Choose tiles/strip for the output image according to + * the command line arguments (-tiles, -strips) and the + * structure of the input image. + */ + if (outtiled == -1) + outtiled = TIFFIsTiled(in); + if (outtiled) { + /* + * Setup output file's tile width&height. If either + * is not specified, use either the value from the + * input image or, if nothing is defined, use the + * library default. + */ + if (tilewidth == (uint32) -1) + TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth); + if (tilelength == (uint32) -1) + TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength); + TIFFDefaultTileSize(out, &tilewidth, &tilelength); + TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth); + TIFFSetField(out, TIFFTAG_TILELENGTH, tilelength); + } else { + /* + * RowsPerStrip is left unspecified: use either the + * value from the input image or, if nothing is defined, + * use the library default. + */ + if (rowsperstrip == (uint32) 0) { + if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, + &rowsperstrip)) { + rowsperstrip = + TIFFDefaultStripSize(out, rowsperstrip); + } + if (rowsperstrip > length && rowsperstrip != (uint32)-1) + rowsperstrip = length; + } + else if (rowsperstrip == (uint32) -1) + rowsperstrip = length; + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + } + if (config != (uint16) -1) + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + else + CopyField(TIFFTAG_PLANARCONFIG, config); + if (samplesperpixel <= 4) + CopyTag(TIFFTAG_TRANSFERFUNCTION, 4, TIFF_SHORT); + CopyTag(TIFFTAG_COLORMAP, 4, TIFF_SHORT); +/* SMinSampleValue & SMaxSampleValue */ + switch (compression) { + case COMPRESSION_JPEG: + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, jpegcolormode); + break; + case COMPRESSION_JBIG: + CopyTag(TIFFTAG_FAXRECVPARAMS, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII); + CopyTag(TIFFTAG_FAXDCS, 1, TIFF_ASCII); + break; + case COMPRESSION_LZW: + case COMPRESSION_ADOBE_DEFLATE: + case COMPRESSION_DEFLATE: + case COMPRESSION_LZMA: + if (predictor != (uint16)-1) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + else + CopyField(TIFFTAG_PREDICTOR, predictor); + if (preset != -1) { + if (compression == COMPRESSION_ADOBE_DEFLATE + || compression == COMPRESSION_DEFLATE) + TIFFSetField(out, TIFFTAG_ZIPQUALITY, preset); + else if (compression == COMPRESSION_LZMA) + TIFFSetField(out, TIFFTAG_LZMAPRESET, preset); + } + break; + case COMPRESSION_CCITTFAX3: + case COMPRESSION_CCITTFAX4: + if (compression == COMPRESSION_CCITTFAX3) { + if (g3opts != (uint32) -1) + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, + g3opts); + else + CopyField(TIFFTAG_GROUP3OPTIONS, g3opts); + } else + CopyTag(TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG); + CopyTag(TIFFTAG_BADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_CLEANFAXDATA, 1, TIFF_LONG); + CopyTag(TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVPARAMS, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII); + break; + } + { + uint32 len32; + void** data; + if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data)) + TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data); + } + { + uint16 ninks; + const char* inknames; + if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) { + TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks); + if (TIFFGetField(in, TIFFTAG_INKNAMES, &inknames)) { + int inknameslen = strlen(inknames) + 1; + const char* cp = inknames; + while (ninks > 1) { + cp = strchr(cp, '\0'); + cp++; + inknameslen += (strlen(cp) + 1); + ninks--; + } + TIFFSetField(out, TIFFTAG_INKNAMES, inknameslen, inknames); + } + } + } + { + unsigned short pg0, pg1; + + if (pageInSeq == 1) { + if (pageNum < 0) /* only one input file */ { + if (TIFFGetField(in, TIFFTAG_PAGENUMBER, &pg0, &pg1)) + TIFFSetField(out, TIFFTAG_PAGENUMBER, pg0, pg1); + } else + TIFFSetField(out, TIFFTAG_PAGENUMBER, pageNum++, 0); + + } else { + if (TIFFGetField(in, TIFFTAG_PAGENUMBER, &pg0, &pg1)) { + if (pageNum < 0) /* only one input file */ + TIFFSetField(out, TIFFTAG_PAGENUMBER, pg0, pg1); + else + TIFFSetField(out, TIFFTAG_PAGENUMBER, pageNum++, 0); + } + } + } + + for (p = tags; p < &tags[NTAGS]; p++) + CopyTag(p->tag, p->count, p->type); + + cf = pickCopyFunc(in, out, bitspersample, samplesperpixel); + return (cf ? (*cf)(in, out, length, width, samplesperpixel) : FALSE); +} + +/* + * Copy Functions. + */ +#define DECLAREcpFunc(x) \ +static int x(TIFF* in, TIFF* out, \ + uint32 imagelength, uint32 imagewidth, tsample_t spp) + +#define DECLAREreadFunc(x) \ +static int x(TIFF* in, \ + uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp) +typedef int (*readFunc)(TIFF*, uint8*, uint32, uint32, tsample_t); + +#define DECLAREwriteFunc(x) \ +static int x(TIFF* out, \ + uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp) +typedef int (*writeFunc)(TIFF*, uint8*, uint32, uint32, tsample_t); + +/* + * Contig -> contig by scanline for rows/strip change. + */ +DECLAREcpFunc(cpContig2ContigByRow) +{ + tsize_t scanlinesize = TIFFScanlineSize(in); + tdata_t buf; + uint32 row; + + buf = _TIFFmalloc(scanlinesize); + if (!buf) + return 0; + _TIFFmemset(buf, 0, scanlinesize); + (void) imagewidth; (void) spp; + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(in, buf, row, 0) < 0 && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + goto bad; + } + if (TIFFWriteScanline(out, buf, row, 0) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write scanline %lu", + (unsigned long) row); + goto bad; + } + } + _TIFFfree(buf); + return 1; +bad: + _TIFFfree(buf); + return 0; +} + + +typedef void biasFn (void *image, void *bias, uint32 pixels); + +#define subtract(bits) \ +static void subtract##bits (void *i, void *b, uint32 pixels)\ +{\ + uint##bits *image = i;\ + uint##bits *bias = b;\ + while (pixels--) {\ + *image = *image > *bias ? *image-*bias : 0;\ + image++, bias++; \ + } \ +} + +subtract(8) +subtract(16) +subtract(32) + +static biasFn *lineSubtractFn (unsigned bits) +{ + switch (bits) { + case 8: return subtract8; + case 16: return subtract16; + case 32: return subtract32; + } + return NULL; +} + +/* + * Contig -> contig by scanline while subtracting a bias image. + */ +DECLAREcpFunc(cpBiasedContig2Contig) +{ + if (spp == 1) { + tsize_t biasSize = TIFFScanlineSize(bias); + tsize_t bufSize = TIFFScanlineSize(in); + tdata_t buf, biasBuf; + uint32 biasWidth = 0, biasLength = 0; + TIFFGetField(bias, TIFFTAG_IMAGEWIDTH, &biasWidth); + TIFFGetField(bias, TIFFTAG_IMAGELENGTH, &biasLength); + if (biasSize == bufSize && + imagelength == biasLength && imagewidth == biasWidth) { + uint16 sampleBits = 0; + biasFn *subtractLine; + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &sampleBits); + subtractLine = lineSubtractFn (sampleBits); + if (subtractLine) { + uint32 row; + buf = _TIFFmalloc(bufSize); + biasBuf = _TIFFmalloc(bufSize); + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(in, buf, row, 0) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + goto bad; + } + if (TIFFReadScanline(bias, biasBuf, row, 0) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read biased scanline %lu", + (unsigned long) row); + goto bad; + } + subtractLine (buf, biasBuf, imagewidth); + if (TIFFWriteScanline(out, buf, row, 0) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write scanline %lu", + (unsigned long) row); + goto bad; + } + } + + _TIFFfree(buf); + _TIFFfree(biasBuf); + TIFFSetDirectory(bias, + TIFFCurrentDirectory(bias)); /* rewind */ + return 1; +bad: + _TIFFfree(buf); + _TIFFfree(biasBuf); + return 0; + } else { + TIFFError(TIFFFileName(in), + "No support for biasing %d bit pixels\n", + sampleBits); + return 0; + } + } + TIFFError(TIFFFileName(in), + "Bias image %s,%d\nis not the same size as %s,%d\n", + TIFFFileName(bias), TIFFCurrentDirectory(bias), + TIFFFileName(in), TIFFCurrentDirectory(in)); + return 0; + } else { + TIFFError(TIFFFileName(in), + "Can't bias %s,%d as it has >1 Sample/Pixel\n", + TIFFFileName(in), TIFFCurrentDirectory(in)); + return 0; + } + +} + + +/* + * Strip -> strip for change in encoding. + */ +DECLAREcpFunc(cpDecodedStrips) +{ + tsize_t stripsize = TIFFStripSize(in); + tdata_t buf = _TIFFmalloc(stripsize); + + (void) imagewidth; (void) spp; + if (buf) { + tstrip_t s, ns = TIFFNumberOfStrips(in); + uint32 row = 0; + _TIFFmemset(buf, 0, stripsize); + for (s = 0; s < ns; s++) { + tsize_t cc = (row + rowsperstrip > imagelength) ? + TIFFVStripSize(in, imagelength - row) : stripsize; + if (TIFFReadEncodedStrip(in, s, buf, cc) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read strip %lu", + (unsigned long) s); + goto bad; + } + if (TIFFWriteEncodedStrip(out, s, buf, cc) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write strip %lu", + (unsigned long) s); + goto bad; + } + row += rowsperstrip; + } + _TIFFfree(buf); + return 1; + } else { + TIFFError(TIFFFileName(in), + "Error, can't allocate memory buffer of size %lu " + "to read strips", (unsigned long) stripsize); + return 0; + } + +bad: + _TIFFfree(buf); + return 0; +} + +/* + * Separate -> separate by row for rows/strip change. + */ +DECLAREcpFunc(cpSeparate2SeparateByRow) +{ + tsize_t scanlinesize = TIFFScanlineSize(in); + tdata_t buf; + uint32 row; + tsample_t s; + + (void) imagewidth; + buf = _TIFFmalloc(scanlinesize); + if (!buf) + return 0; + _TIFFmemset(buf, 0, scanlinesize); + for (s = 0; s < spp; s++) { + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(in, buf, row, s) < 0 && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + goto bad; + } + if (TIFFWriteScanline(out, buf, row, s) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write scanline %lu", + (unsigned long) row); + goto bad; + } + } + } + _TIFFfree(buf); + return 1; +bad: + _TIFFfree(buf); + return 0; +} + +/* + * Contig -> separate by row. + */ +DECLAREcpFunc(cpContig2SeparateByRow) +{ + tsize_t scanlinesizein = TIFFScanlineSize(in); + tsize_t scanlinesizeout = TIFFScanlineSize(out); + tdata_t inbuf; + tdata_t outbuf; + register uint8 *inp, *outp; + register uint32 n; + uint32 row; + tsample_t s; + + inbuf = _TIFFmalloc(scanlinesizein); + outbuf = _TIFFmalloc(scanlinesizeout); + if (!inbuf || !outbuf) + return 0; + _TIFFmemset(inbuf, 0, scanlinesizein); + _TIFFmemset(outbuf, 0, scanlinesizeout); + /* unpack channels */ + for (s = 0; s < spp; s++) { + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(in, inbuf, row, 0) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + goto bad; + } + inp = ((uint8*)inbuf) + s; + outp = (uint8*)outbuf; + for (n = imagewidth; n-- > 0;) { + *outp++ = *inp; + inp += spp; + } + if (TIFFWriteScanline(out, outbuf, row, s) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write scanline %lu", + (unsigned long) row); + goto bad; + } + } + } + if (inbuf) _TIFFfree(inbuf); + if (outbuf) _TIFFfree(outbuf); + return 1; +bad: + if (inbuf) _TIFFfree(inbuf); + if (outbuf) _TIFFfree(outbuf); + return 0; +} + +/* + * Separate -> contig by row. + */ +DECLAREcpFunc(cpSeparate2ContigByRow) +{ + tsize_t scanlinesizein = TIFFScanlineSize(in); + tsize_t scanlinesizeout = TIFFScanlineSize(out); + tdata_t inbuf; + tdata_t outbuf; + register uint8 *inp, *outp; + register uint32 n; + uint32 row; + tsample_t s; + + inbuf = _TIFFmalloc(scanlinesizein); + outbuf = _TIFFmalloc(scanlinesizeout); + if (!inbuf || !outbuf) + return 0; + _TIFFmemset(inbuf, 0, scanlinesizein); + _TIFFmemset(outbuf, 0, scanlinesizeout); + for (row = 0; row < imagelength; row++) { + /* merge channels */ + for (s = 0; s < spp; s++) { + if (TIFFReadScanline(in, inbuf, row, s) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + goto bad; + } + inp = (uint8*)inbuf; + outp = ((uint8*)outbuf) + s; + for (n = imagewidth; n-- > 0;) { + *outp = *inp++; + outp += spp; + } + } + if (TIFFWriteScanline(out, outbuf, row, 0) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write scanline %lu", + (unsigned long) row); + goto bad; + } + } + if (inbuf) _TIFFfree(inbuf); + if (outbuf) _TIFFfree(outbuf); + return 1; +bad: + if (inbuf) _TIFFfree(inbuf); + if (outbuf) _TIFFfree(outbuf); + return 0; +} + +static void +cpStripToTile(uint8* out, uint8* in, + uint32 rows, uint32 cols, int outskew, int inskew) +{ + while (rows-- > 0) { + uint32 j = cols; + while (j-- > 0) + *out++ = *in++; + out += outskew; + in += inskew; + } +} + +static void +cpContigBufToSeparateBuf(uint8* out, uint8* in, + uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, + int bytes_per_sample ) +{ + while (rows-- > 0) { + uint32 j = cols; + while (j-- > 0) + { + int n = bytes_per_sample; + + while( n-- ) { + *out++ = *in++; + } + in += (spp-1) * bytes_per_sample; + } + out += outskew; + in += inskew; + } +} + +static void +cpSeparateBufToContigBuf(uint8* out, uint8* in, + uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, + int bytes_per_sample) +{ + while (rows-- > 0) { + uint32 j = cols; + while (j-- > 0) { + int n = bytes_per_sample; + + while( n-- ) { + *out++ = *in++; + } + out += (spp-1)*bytes_per_sample; + } + out += outskew; + in += inskew; + } +} + +static int +cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout, + uint32 imagelength, uint32 imagewidth, tsample_t spp) +{ + int status = 0; + tdata_t buf = NULL; + tsize_t scanlinesize = TIFFRasterScanlineSize(in); + tsize_t bytes = scanlinesize * (tsize_t)imagelength; + /* + * XXX: Check for integer overflow. + */ + if (scanlinesize + && imagelength + && bytes / (tsize_t)imagelength == scanlinesize) { + buf = _TIFFmalloc(bytes); + if (buf) { + if ((*fin)(in, (uint8*)buf, imagelength, + imagewidth, spp)) { + status = (*fout)(out, (uint8*)buf, + imagelength, imagewidth, spp); + } + _TIFFfree(buf); + } else { + TIFFError(TIFFFileName(in), + "Error, can't allocate space for image buffer"); + } + } else { + TIFFError(TIFFFileName(in), "Error, no space for image buffer"); + } + + return status; +} + +DECLAREreadFunc(readContigStripsIntoBuffer) +{ + tsize_t scanlinesize = TIFFScanlineSize(in); + uint8* bufp = buf; + uint32 row; + + (void) imagewidth; (void) spp; + for (row = 0; row < imagelength; row++) { + if (TIFFReadScanline(in, (tdata_t) bufp, row, 0) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + return 0; + } + bufp += scanlinesize; + } + + return 1; +} + +DECLAREreadFunc(readSeparateStripsIntoBuffer) +{ + int status = 1; + tsize_t scanlinesize = TIFFScanlineSize(in); + tdata_t scanline; + if (!scanlinesize) + return 0; + + scanline = _TIFFmalloc(scanlinesize); + if (!scanline) + return 0; + _TIFFmemset(scanline, 0, scanlinesize); + (void) imagewidth; + if (scanline) { + uint8* bufp = (uint8*) buf; + uint32 row; + tsample_t s; + for (row = 0; row < imagelength; row++) { + /* merge channels */ + for (s = 0; s < spp; s++) { + uint8* bp = bufp + s; + tsize_t n = scanlinesize; + uint8* sbuf = scanline; + + if (TIFFReadScanline(in, scanline, row, s) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read scanline %lu", + (unsigned long) row); + status = 0; + goto done; + } + while (n-- > 0) + *bp = *sbuf++, bp += spp; + } + bufp += scanlinesize * spp; + } + } + +done: + _TIFFfree(scanline); + return status; +} + +DECLAREreadFunc(readContigTilesIntoBuffer) +{ + int status = 1; + tsize_t tilesize = TIFFTileSize(in); + tdata_t tilebuf; + uint32 imagew = TIFFScanlineSize(in); + uint32 tilew = TIFFTileRowSize(in); + int iskew = imagew - tilew; + uint8* bufp = (uint8*) buf; + uint32 tw, tl; + uint32 row; + + (void) spp; + tilebuf = _TIFFmalloc(tilesize); + if (tilebuf == 0) + return 0; + _TIFFmemset(tilebuf, 0, tilesize); + (void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw); + (void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl); + + for (row = 0; row < imagelength; row += tl) { + uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl; + uint32 colb = 0; + uint32 col; + + for (col = 0; col < imagewidth; col += tw) { + if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read tile at %lu %lu", + (unsigned long) col, + (unsigned long) row); + status = 0; + goto done; + } + if (colb + tilew > imagew) { + uint32 width = imagew - colb; + uint32 oskew = tilew - width; + cpStripToTile(bufp + colb, + tilebuf, nrow, width, + oskew + iskew, oskew ); + } else + cpStripToTile(bufp + colb, + tilebuf, nrow, tilew, + iskew, 0); + colb += tilew; + } + bufp += imagew * nrow; + } +done: + _TIFFfree(tilebuf); + return status; +} + +DECLAREreadFunc(readSeparateTilesIntoBuffer) +{ + int status = 1; + uint32 imagew = TIFFRasterScanlineSize(in); + uint32 tilew = TIFFTileRowSize(in); + int iskew = imagew - tilew*spp; + tsize_t tilesize = TIFFTileSize(in); + tdata_t tilebuf; + uint8* bufp = (uint8*) buf; + uint32 tw, tl; + uint32 row; + uint16 bps, bytes_per_sample; + + tilebuf = _TIFFmalloc(tilesize); + if (tilebuf == 0) + return 0; + _TIFFmemset(tilebuf, 0, tilesize); + (void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw); + (void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl); + (void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps); + assert( bps % 8 == 0 ); + bytes_per_sample = bps/8; + + for (row = 0; row < imagelength; row += tl) { + uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl; + uint32 colb = 0; + uint32 col; + + for (col = 0; col < imagewidth; col += tw) { + tsample_t s; + + for (s = 0; s < spp; s++) { + if (TIFFReadTile(in, tilebuf, col, row, 0, s) < 0 + && !ignore) { + TIFFError(TIFFFileName(in), + "Error, can't read tile at %lu %lu, " + "sample %lu", + (unsigned long) col, + (unsigned long) row, + (unsigned long) s); + status = 0; + goto done; + } + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + if (colb + tilew*spp > imagew) { + uint32 width = imagew - colb; + int oskew = tilew*spp - width; + cpSeparateBufToContigBuf( + bufp+colb+s*bytes_per_sample, + tilebuf, nrow, + width/(spp*bytes_per_sample), + oskew + iskew, + oskew/spp, spp, + bytes_per_sample); + } else + cpSeparateBufToContigBuf( + bufp+colb+s*bytes_per_sample, + tilebuf, nrow, tw, + iskew, 0, spp, + bytes_per_sample); + } + colb += tilew*spp; + } + bufp += imagew * nrow; + } +done: + _TIFFfree(tilebuf); + return status; +} + +DECLAREwriteFunc(writeBufferToContigStrips) +{ + uint32 row, rowsperstrip; + tstrip_t strip = 0; + + (void) imagewidth; (void) spp; + (void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + for (row = 0; row < imagelength; row += rowsperstrip) { + uint32 nrows = (row+rowsperstrip > imagelength) ? + imagelength-row : rowsperstrip; + tsize_t stripsize = TIFFVStripSize(out, nrows); + if (TIFFWriteEncodedStrip(out, strip++, buf, stripsize) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write strip %u", strip - 1); + return 0; + } + buf += stripsize; + } + return 1; +} + +DECLAREwriteFunc(writeBufferToSeparateStrips) +{ + uint32 rowsize = imagewidth * spp; + uint32 rowsperstrip; + tsize_t stripsize = TIFFStripSize(out); + tdata_t obuf; + tstrip_t strip = 0; + tsample_t s; + + obuf = _TIFFmalloc(stripsize); + if (obuf == NULL) + return (0); + _TIFFmemset(obuf, 0, stripsize); + (void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + for (s = 0; s < spp; s++) { + uint32 row; + for (row = 0; row < imagelength; row += rowsperstrip) { + uint32 nrows = (row+rowsperstrip > imagelength) ? + imagelength-row : rowsperstrip; + tsize_t stripsize = TIFFVStripSize(out, nrows); + + cpContigBufToSeparateBuf( + obuf, (uint8*) buf + row*rowsize + s, + nrows, imagewidth, 0, 0, spp, 1); + if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write strip %u", + strip - 1); + _TIFFfree(obuf); + return 0; + } + } + } + _TIFFfree(obuf); + return 1; + +} + +DECLAREwriteFunc(writeBufferToContigTiles) +{ + uint32 imagew = TIFFScanlineSize(out); + uint32 tilew = TIFFTileRowSize(out); + int iskew = imagew - tilew; + tsize_t tilesize = TIFFTileSize(out); + tdata_t obuf; + uint8* bufp = (uint8*) buf; + uint32 tl, tw; + uint32 row; + + (void) spp; + + obuf = _TIFFmalloc(TIFFTileSize(out)); + if (obuf == NULL) + return 0; + _TIFFmemset(obuf, 0, tilesize); + (void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl); + (void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw); + for (row = 0; row < imagelength; row += tilelength) { + uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl; + uint32 colb = 0; + uint32 col; + + for (col = 0; col < imagewidth; col += tw) { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + if (colb + tilew > imagew) { + uint32 width = imagew - colb; + int oskew = tilew - width; + cpStripToTile(obuf, bufp + colb, nrow, width, + oskew, oskew + iskew); + } else + cpStripToTile(obuf, bufp + colb, nrow, tilew, + 0, iskew); + if (TIFFWriteTile(out, obuf, col, row, 0, 0) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write tile at %lu %lu", + (unsigned long) col, + (unsigned long) row); + _TIFFfree(obuf); + return 0; + } + colb += tilew; + } + bufp += nrow * imagew; + } + _TIFFfree(obuf); + return 1; +} + +DECLAREwriteFunc(writeBufferToSeparateTiles) +{ + uint32 imagew = TIFFScanlineSize(out); + tsize_t tilew = TIFFTileRowSize(out); + uint32 iimagew = TIFFRasterScanlineSize(out); + int iskew = iimagew - tilew*spp; + tsize_t tilesize = TIFFTileSize(out); + tdata_t obuf; + uint8* bufp = (uint8*) buf; + uint32 tl, tw; + uint32 row; + uint16 bps, bytes_per_sample; + + obuf = _TIFFmalloc(TIFFTileSize(out)); + if (obuf == NULL) + return 0; + _TIFFmemset(obuf, 0, tilesize); + (void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl); + (void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw); + (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps); + assert( bps % 8 == 0 ); + bytes_per_sample = bps/8; + + for (row = 0; row < imagelength; row += tl) { + uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl; + uint32 colb = 0; + uint32 col; + + for (col = 0; col < imagewidth; col += tw) { + tsample_t s; + for (s = 0; s < spp; s++) { + /* + * Tile is clipped horizontally. Calculate + * visible portion and skewing factors. + */ + if (colb + tilew > imagew) { + uint32 width = (imagew - colb); + int oskew = tilew - width; + + cpContigBufToSeparateBuf(obuf, + bufp + (colb*spp) + s, + nrow, width/bytes_per_sample, + oskew, (oskew*spp)+iskew, spp, + bytes_per_sample); + } else + cpContigBufToSeparateBuf(obuf, + bufp + (colb*spp) + s, + nrow, tilewidth, + 0, iskew, spp, + bytes_per_sample); + if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) { + TIFFError(TIFFFileName(out), + "Error, can't write tile at %lu %lu " + "sample %lu", + (unsigned long) col, + (unsigned long) row, + (unsigned long) s); + _TIFFfree(obuf); + return 0; + } + } + colb += tilew; + } + bufp += nrow * iimagew; + } + _TIFFfree(obuf); + return 1; +} + +/* + * Contig strips -> contig tiles. + */ +DECLAREcpFunc(cpContigStrips2ContigTiles) +{ + return cpImage(in, out, + readContigStripsIntoBuffer, + writeBufferToContigTiles, + imagelength, imagewidth, spp); +} + +/* + * Contig strips -> separate tiles. + */ +DECLAREcpFunc(cpContigStrips2SeparateTiles) +{ + return cpImage(in, out, + readContigStripsIntoBuffer, + writeBufferToSeparateTiles, + imagelength, imagewidth, spp); +} + +/* + * Separate strips -> contig tiles. + */ +DECLAREcpFunc(cpSeparateStrips2ContigTiles) +{ + return cpImage(in, out, + readSeparateStripsIntoBuffer, + writeBufferToContigTiles, + imagelength, imagewidth, spp); +} + +/* + * Separate strips -> separate tiles. + */ +DECLAREcpFunc(cpSeparateStrips2SeparateTiles) +{ + return cpImage(in, out, + readSeparateStripsIntoBuffer, + writeBufferToSeparateTiles, + imagelength, imagewidth, spp); +} + +/* + * Contig strips -> contig tiles. + */ +DECLAREcpFunc(cpContigTiles2ContigTiles) +{ + return cpImage(in, out, + readContigTilesIntoBuffer, + writeBufferToContigTiles, + imagelength, imagewidth, spp); +} + +/* + * Contig tiles -> separate tiles. + */ +DECLAREcpFunc(cpContigTiles2SeparateTiles) +{ + return cpImage(in, out, + readContigTilesIntoBuffer, + writeBufferToSeparateTiles, + imagelength, imagewidth, spp); +} + +/* + * Separate tiles -> contig tiles. + */ +DECLAREcpFunc(cpSeparateTiles2ContigTiles) +{ + return cpImage(in, out, + readSeparateTilesIntoBuffer, + writeBufferToContigTiles, + imagelength, imagewidth, spp); +} + +/* + * Separate tiles -> separate tiles (tile dimension change). + */ +DECLAREcpFunc(cpSeparateTiles2SeparateTiles) +{ + return cpImage(in, out, + readSeparateTilesIntoBuffer, + writeBufferToSeparateTiles, + imagelength, imagewidth, spp); +} + +/* + * Contig tiles -> contig tiles (tile dimension change). + */ +DECLAREcpFunc(cpContigTiles2ContigStrips) +{ + return cpImage(in, out, + readContigTilesIntoBuffer, + writeBufferToContigStrips, + imagelength, imagewidth, spp); +} + +/* + * Contig tiles -> separate strips. + */ +DECLAREcpFunc(cpContigTiles2SeparateStrips) +{ + return cpImage(in, out, + readContigTilesIntoBuffer, + writeBufferToSeparateStrips, + imagelength, imagewidth, spp); +} + +/* + * Separate tiles -> contig strips. + */ +DECLAREcpFunc(cpSeparateTiles2ContigStrips) +{ + return cpImage(in, out, + readSeparateTilesIntoBuffer, + writeBufferToContigStrips, + imagelength, imagewidth, spp); +} + +/* + * Separate tiles -> separate strips. + */ +DECLAREcpFunc(cpSeparateTiles2SeparateStrips) +{ + return cpImage(in, out, + readSeparateTilesIntoBuffer, + writeBufferToSeparateStrips, + imagelength, imagewidth, spp); +} + +/* + * Select the appropriate copy function to use. + */ +static copyFunc +pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel) +{ + uint16 shortv; + uint32 w, l, tw, tl; + int bychunk; + + (void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv); + if (shortv != config && bitspersample != 8 && samplesperpixel > 1) { + fprintf(stderr, + "%s: Cannot handle different planar configuration w/ bits/sample != 8\n", + TIFFFileName(in)); + return (NULL); + } + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &w); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &l); + if (!(TIFFIsTiled(out) || TIFFIsTiled(in))) { + uint32 irps = (uint32) -1L; + TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &irps); + /* if biased, force decoded copying to allow image subtraction */ + bychunk = !bias && (rowsperstrip == irps); + }else{ /* either in or out is tiled */ + if (bias) { + fprintf(stderr, + "%s: Cannot handle tiled configuration w/bias image\n", + TIFFFileName(in)); + return (NULL); + } + if (TIFFIsTiled(out)) { + if (!TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw)) + tw = w; + if (!TIFFGetField(in, TIFFTAG_TILELENGTH, &tl)) + tl = l; + bychunk = (tw == tilewidth && tl == tilelength); + } else { /* out's not, so in must be tiled */ + TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(in, TIFFTAG_TILELENGTH, &tl); + bychunk = (tw == w && tl == rowsperstrip); + } + } +#define T 1 +#define F 0 +#define pack(a,b,c,d,e) ((long)(((a)<<11)|((b)<<3)|((c)<<2)|((d)<<1)|(e))) + switch(pack(shortv,config,TIFFIsTiled(in),TIFFIsTiled(out),bychunk)) { + /* Strips -> Tiles */ + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, F,T,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, F,T,T): + return cpContigStrips2ContigTiles; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, F,T,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, F,T,T): + return cpContigStrips2SeparateTiles; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, F,T,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, F,T,T): + return cpSeparateStrips2ContigTiles; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,T,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,T,T): + return cpSeparateStrips2SeparateTiles; + /* Tiles -> Tiles */ + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, T,T,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, T,T,T): + return cpContigTiles2ContigTiles; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, T,T,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, T,T,T): + return cpContigTiles2SeparateTiles; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, T,T,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, T,T,T): + return cpSeparateTiles2ContigTiles; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,T,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,T,T): + return cpSeparateTiles2SeparateTiles; + /* Tiles -> Strips */ + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, T,F,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, T,F,T): + return cpContigTiles2ContigStrips; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, T,F,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, T,F,T): + return cpContigTiles2SeparateStrips; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, T,F,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, T,F,T): + return cpSeparateTiles2ContigStrips; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,F,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, T,F,T): + return cpSeparateTiles2SeparateStrips; + /* Strips -> Strips */ + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, F,F,F): + return bias ? cpBiasedContig2Contig : cpContig2ContigByRow; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_CONTIG, F,F,T): + return cpDecodedStrips; + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, F,F,F): + case pack(PLANARCONFIG_CONTIG, PLANARCONFIG_SEPARATE, F,F,T): + return cpContig2SeparateByRow; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, F,F,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_CONTIG, F,F,T): + return cpSeparate2ContigByRow; + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,F,F): + case pack(PLANARCONFIG_SEPARATE, PLANARCONFIG_SEPARATE, F,F,T): + return cpSeparate2SeparateByRow; + } +#undef pack +#undef F +#undef T + fprintf(stderr, "tiffcp: %s: Don't know how to copy/convert image.\n", + TIFFFileName(in)); + return (NULL); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcrop.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcrop.c new file mode 100644 index 0000000..9cd5d86 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffcrop.c @@ -0,0 +1,9066 @@ +/* $Id: tiffcrop.c,v 1.20 2010-12-14 02:03:24 faxguy Exp $ */ + +/* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of + * the image data through additional options listed below + * + * Original code: + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * Additions (c) Richard Nolde 2006-2010 + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS OR ANY OTHER COPYRIGHT + * HOLDERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND + * ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE + * OR PERFORMANCE OF THIS SOFTWARE. + * + * Some portions of the current code are derived from tiffcp, primarly in + * the areas of lowlevel reading and writing of TAGS, scanlines and tiles though + * some of the original functions have been extended to support arbitrary bit + * depths. These functions are presented at the top of this file. + * + * Add support for the options below to extract sections of image(s) + * and to modify the whole image or selected portions of each image by + * rotations, mirroring, and colorscale/colormap inversion of selected + * types of TIFF images when appropriate. Some color model dependent + * functions are restricted to bilevel or 8 bit per sample data. + * See the man page for the full explanations. + * + * New Options: + * -h Display the syntax guide. + * -v Report the version and last build date for tiffcrop and libtiff. + * -z x1,y1,x2,y2:x3,y3,x4,y4:..xN,yN,xN + 1, yN + 1 + * Specify a series of coordinates to define rectangular + * regions by the top left and lower right corners. + * -e c|d|i|m|s export mode for images and selections from input images + * combined All images and selections are written to a single file (default) + * with multiple selections from one image combined into a single image + * divided All images and selections are written to a single file + * with each selection from one image written to a new image + * image Each input image is written to a new file (numeric filename sequence) + * with multiple selections from the image combined into one image + * multiple Each input image is written to a new file (numeric filename sequence) + * with each selection from the image written to a new image + * separated Individual selections from each image are written to separate files + * -U units [in, cm, px ] inches, centimeters or pixels + * -H # Set horizontal resolution of output images to # + * -V # Set vertical resolution of output images to # + * -J # Horizontal margin of output page to # expressed in current + * units when sectioning image into columns x rows + * using the -S cols:rows option. + * -K # Vertical margin of output page to # expressed in current + * units when sectioning image into columns x rows + * using the -S cols:rows option. + * -X # Horizontal dimension of region to extract expressed in current + * units + * -Y # Vertical dimension of region to extract expressed in current + * units + * -O orient Orientation for output image, portrait, landscape, auto + * -P page Page size for output image segments, eg letter, legal, tabloid, + * etc. + * -S cols:rows Divide the image into equal sized segments using cols across + * and rows down + * -E t|l|r|b Edge to use as origin + * -m #,#,#,# Margins from edges for selection: top, left, bottom, right + * (commas separated) + * -Z #:#,#:# Zones of the image designated as zone X of Y, + * eg 1:3 would be first of three equal portions measured + * from reference edge + * -N odd|even|#,#-#,#|last + * Select sequences and/or ranges of images within file + * to process. The words odd or even may be used to specify + * all odd or even numbered images the word last may be used + * in place of a number in the sequence to indicate the final + * image in the file without knowing how many images there are. + * -R # Rotate image or crop selection by 90,180,or 270 degrees + * clockwise + * -F h|v Flip (mirror) image or crop selection horizontally + * or vertically + * -I [black|white|data|both] + * Invert color space, eg dark to light for bilevel and grayscale images + * If argument is white or black, set the PHOTOMETRIC_INTERPRETATION + * tag to MinIsBlack or MinIsWhite without altering the image data + * If the argument is data or both, the image data are modified: + * both inverts the data and the PHOTOMETRIC_INTERPRETATION tag, + * data inverts the data but not the PHOTOMETRIC_INTERPRETATION tag + * -D input:,output:,format:,level:N,debug:N + * Dump raw data for input and/or output images to individual files + * in raw (binary) format or text (ASCII) representing binary data + * as strings of 1s and 0s. The filename arguments are used as stems + * from which individual files are created for each image. Text format + * includes annotations for image parameters and scanline info. Level + * selects which functions dump data, with higher numbers selecting + * lower level, scanline level routines. Debug reports a limited set + * of messages to monitor progess without enabling dump logs. + */ + +static char tiffcrop_version_id[] = "2.4"; +static char tiffcrop_rev_date[] = "12-13-2010"; + +#include "tif_config.h" +#include "tiffiop.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_STDINT_H +# include +#endif + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#if defined(VMS) +# define unlink delete +#endif + +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + +#ifndef streq +#define streq(a,b) (strcmp((a),(b)) == 0) +#endif +#define strneq(a,b,n) (strncmp((a),(b),(n)) == 0) + +#define TRUE 1 +#define FALSE 0 + +#ifndef TIFFhowmany +#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) +#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) +#endif + +/* + * Definitions and data structures required to support cropping and image + * manipulations. + */ + +#define EDGE_TOP 1 +#define EDGE_LEFT 2 +#define EDGE_BOTTOM 3 +#define EDGE_RIGHT 4 +#define EDGE_CENTER 5 + +#define MIRROR_HORIZ 1 +#define MIRROR_VERT 2 +#define MIRROR_BOTH 3 +#define ROTATECW_90 8 +#define ROTATECW_180 16 +#define ROTATECW_270 32 +#define ROTATE_ANY ROTATECW_90 || ROTATECW_180 || ROTATECW_270 + +#define CROP_NONE 0 +#define CROP_MARGINS 1 +#define CROP_WIDTH 2 +#define CROP_LENGTH 4 +#define CROP_ZONES 8 +#define CROP_REGIONS 16 +#define CROP_ROTATE 32 +#define CROP_MIRROR 64 +#define CROP_INVERT 128 + +/* Modes for writing out images and selections */ +#define ONE_FILE_COMPOSITE 0 /* One file, sections combined sections */ +#define ONE_FILE_SEPARATED 1 /* One file, sections to new IFDs */ +#define FILE_PER_IMAGE_COMPOSITE 2 /* One file per image, combined sections */ +#define FILE_PER_IMAGE_SEPARATED 3 /* One file per input image */ +#define FILE_PER_SELECTION 4 /* One file per selection */ + +#define COMPOSITE_IMAGES 0 /* Selections combined into one image */ +#define SEPARATED_IMAGES 1 /* Selections saved to separate images */ + +#define STRIP 1 +#define TILE 2 + +#define MAX_REGIONS 8 /* number of regions to extract from a single page */ +#define MAX_OUTBUFFS 8 /* must match larger of zones or regions */ +#define MAX_SECTIONS 32 /* number of sections per page to write to output */ +#define MAX_IMAGES 2048 /* number of images in descrete list, not in the file */ +#define MAX_SAMPLES 8 /* maximum number of samples per pixel supported */ +#define MAX_BITS_PER_SAMPLE 64 /* maximum bit depth supported */ +#define MAX_EXPORT_PAGES 999999 /* maximum number of export pages per file */ + +#define DUMP_NONE 0 +#define DUMP_TEXT 1 +#define DUMP_RAW 2 + +/* Offsets into buffer for margins and fixed width and length segments */ +struct offset { + uint32 tmargin; + uint32 lmargin; + uint32 bmargin; + uint32 rmargin; + uint32 crop_width; + uint32 crop_length; + uint32 startx; + uint32 endx; + uint32 starty; + uint32 endy; +}; + +/* Description of a zone within the image. Position 1 of 3 zones would be + * the first third of the image. These are computed after margins and + * width/length requests are applied so that you can extract multiple + * zones from within a larger region for OCR or barcode recognition. + */ + +struct buffinfo { + uint32 size; /* size of this buffer */ + unsigned char *buffer; /* address of the allocated buffer */ +}; + +struct zone { + int position; /* ordinal of segment to be extracted */ + int total; /* total equal sized divisions of crop area */ + }; + +struct pageseg { + uint32 x1; /* index of left edge */ + uint32 x2; /* index of right edge */ + uint32 y1; /* index of top edge */ + uint32 y2; /* index of bottom edge */ + int position; /* ordinal of segment to be extracted */ + int total; /* total equal sized divisions of crop area */ + uint32 buffsize; /* size of buffer needed to hold the cropped zone */ +}; + +struct coordpairs { + double X1; /* index of left edge in current units */ + double X2; /* index of right edge in current units */ + double Y1; /* index of top edge in current units */ + double Y2; /* index of bottom edge in current units */ +}; + +struct region { + uint32 x1; /* pixel offset of left edge */ + uint32 x2; /* pixel offset of right edge */ + uint32 y1; /* pixel offset of top edge */ + uint32 y2; /* picel offset of bottom edge */ + uint32 width; /* width in pixels */ + uint32 length; /* length in pixels */ + uint32 buffsize; /* size of buffer needed to hold the cropped region */ + unsigned char *buffptr; /* address of start of the region */ +}; + +/* Cropping parameters from command line and image data + * Note: This should be renamed to proc_opts and expanded to include all current globals + * if possible, but each function that accesses global variables will have to be redone. + */ +struct crop_mask { + double width; /* Selection width for master crop region in requested units */ + double length; /* Selection length for master crop region in requesed units */ + double margins[4]; /* Top, left, bottom, right margins */ + float xres; /* Horizontal resolution read from image*/ + float yres; /* Vertical resolution read from image */ + uint32 combined_width; /* Width of combined cropped zones */ + uint32 combined_length; /* Length of combined cropped zones */ + uint32 bufftotal; /* Size of buffer needed to hold all the cropped region */ + uint16 img_mode; /* Composite or separate images created from zones or regions */ + uint16 exp_mode; /* Export input images or selections to one or more files */ + uint16 crop_mode; /* Crop options to be applied */ + uint16 res_unit; /* Resolution unit for margins and selections */ + uint16 edge_ref; /* Reference edge for sections extraction and combination */ + uint16 rotation; /* Clockwise rotation of the extracted region or image */ + uint16 mirror; /* Mirror extracted region or image horizontally or vertically */ + uint16 invert; /* Invert the color map of image or region */ + uint16 photometric; /* Status of photometric interpretation for inverted image */ + uint16 selections; /* Number of regions or zones selected */ + uint16 regions; /* Number of regions delimited by corner coordinates */ + struct region regionlist[MAX_REGIONS]; /* Regions within page or master crop region */ + uint16 zones; /* Number of zones delimited by Ordinal:Total requested */ + struct zone zonelist[MAX_REGIONS]; /* Zones indices to define a region */ + struct coordpairs corners[MAX_REGIONS]; /* Coordinates of upper left and lower right corner */ +}; + +#define MAX_PAPERNAMES 49 +#define MAX_PAPERNAME_LENGTH 15 +#define DEFAULT_RESUNIT RESUNIT_INCH +#define DEFAULT_PAGE_HEIGHT 14.0 +#define DEFAULT_PAGE_WIDTH 8.5 +#define DEFAULT_RESOLUTION 300 +#define DEFAULT_PAPER_SIZE "legal" + +#define ORIENTATION_NONE 0 +#define ORIENTATION_PORTRAIT 1 +#define ORIENTATION_LANDSCAPE 2 +#define ORIENTATION_SEASCAPE 4 +#define ORIENTATION_AUTO 16 + +#define PAGE_MODE_NONE 0 +#define PAGE_MODE_RESOLUTION 1 +#define PAGE_MODE_PAPERSIZE 2 +#define PAGE_MODE_MARGINS 4 +#define PAGE_MODE_ROWSCOLS 8 + +#define INVERT_DATA_ONLY 10 +#define INVERT_DATA_AND_TAG 11 + +struct paperdef { + char name[MAX_PAPERNAME_LENGTH]; + double width; + double length; + double asratio; + }; + +/* European page sizes corrected from update sent by + * thomas . jarosch @ intra2net . com on 5/7/2010 + * Paper Size Width Length Aspect Ratio */ +struct paperdef PaperTable[MAX_PAPERNAMES] = { + {"default", 8.500, 14.000, 0.607}, + {"pa4", 8.264, 11.000, 0.751}, + {"letter", 8.500, 11.000, 0.773}, + {"legal", 8.500, 14.000, 0.607}, + {"half-letter", 8.500, 5.514, 1.542}, + {"executive", 7.264, 10.528, 0.690}, + {"tabloid", 11.000, 17.000, 0.647}, + {"11x17", 11.000, 17.000, 0.647}, + {"ledger", 17.000, 11.000, 1.545}, + {"archa", 9.000, 12.000, 0.750}, + {"archb", 12.000, 18.000, 0.667}, + {"archc", 18.000, 24.000, 0.750}, + {"archd", 24.000, 36.000, 0.667}, + {"arche", 36.000, 48.000, 0.750}, + {"csheet", 17.000, 22.000, 0.773}, + {"dsheet", 22.000, 34.000, 0.647}, + {"esheet", 34.000, 44.000, 0.773}, + {"superb", 11.708, 17.042, 0.687}, + {"commercial", 4.139, 9.528, 0.434}, + {"monarch", 3.889, 7.528, 0.517}, + {"envelope-dl", 4.333, 8.681, 0.499}, + {"envelope-c5", 6.389, 9.028, 0.708}, + {"europostcard", 4.139, 5.833, 0.710}, + {"a0", 33.110, 46.811, 0.707}, + {"a1", 23.386, 33.110, 0.706}, + {"a2", 16.535, 23.386, 0.707}, + {"a3", 11.693, 16.535, 0.707}, + {"a4", 8.268, 11.693, 0.707}, + {"a5", 5.827, 8.268, 0.705}, + {"a6", 4.134, 5.827, 0.709}, + {"a7", 2.913, 4.134, 0.705}, + {"a8", 2.047, 2.913, 0.703}, + {"a9", 1.457, 2.047, 0.712}, + {"a10", 1.024, 1.457, 0.703}, + {"b0", 39.370, 55.669, 0.707}, + {"b1", 27.835, 39.370, 0.707}, + {"b2", 19.685, 27.835, 0.707}, + {"b3", 13.898, 19.685, 0.706}, + {"b4", 9.843, 13.898, 0.708}, + {"b5", 6.929, 9.843, 0.704}, + {"b6", 4.921, 6.929, 0.710}, + {"c0", 36.102, 51.063, 0.707}, + {"c1", 25.512, 36.102, 0.707}, + {"c2", 18.031, 25.512, 0.707}, + {"c3", 12.756, 18.031, 0.707}, + {"c4", 9.016, 12.756, 0.707}, + {"c5", 6.378, 9.016, 0.707}, + {"c6", 4.488, 6.378, 0.704}, + {"", 0.000, 0.000, 1.000} +}; + +/* Structure to define input image parameters */ +struct image_data { + float xres; + float yres; + uint32 width; + uint32 length; + uint16 res_unit; + uint16 bps; + uint16 spp; + uint16 planar; + uint16 photometric; + uint16 orientation; + uint16 compression; + uint16 adjustments; +}; + +/* Structure to define the output image modifiers */ +struct pagedef { + char name[16]; + double width; /* width in pixels */ + double length; /* length in pixels */ + double hmargin; /* margins to subtract from width of sections */ + double vmargin; /* margins to subtract from height of sections */ + double hres; /* horizontal resolution for output */ + double vres; /* vertical resolution for output */ + uint32 mode; /* bitmask of modifiers to page format */ + uint16 res_unit; /* resolution unit for output image */ + unsigned int rows; /* number of section rows */ + unsigned int cols; /* number of section cols */ + unsigned int orient; /* portrait, landscape, seascape, auto */ +}; + +struct dump_opts { + int debug; + int format; + int level; + char mode[4]; + char infilename[PATH_MAX + 1]; + char outfilename[PATH_MAX + 1]; + FILE *infile; + FILE *outfile; + }; + +/* globals */ +static int outtiled = -1; +static uint32 tilewidth = 0; +static uint32 tilelength = 0; + +static uint16 config = 0; +static uint16 compression = 0; +static uint16 predictor = 0; +static uint16 fillorder = 0; +static uint32 rowsperstrip = 0; +static uint32 g3opts = 0; +static int ignore = FALSE; /* if true, ignore read errors */ +static uint32 defg3opts = (uint32) -1; +static int quality = 100; /* JPEG quality */ +/* static int jpegcolormode = -1; was JPEGCOLORMODE_RGB; */ +static int jpegcolormode = JPEGCOLORMODE_RGB; +static uint16 defcompression = (uint16) -1; +static uint16 defpredictor = (uint16) -1; +static int pageNum = 0; +static int little_endian = 1; + +/* Functions adapted from tiffcp with additions or significant modifications */ +static int readContigStripsIntoBuffer (TIFF*, uint8*); +static int readSeparateStripsIntoBuffer (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *); +static int readContigTilesIntoBuffer (TIFF*, uint8*, uint32, uint32, uint32, uint32, tsample_t, uint16); +static int readSeparateTilesIntoBuffer (TIFF*, uint8*, uint32, uint32, uint32, uint32, tsample_t, uint16); +static int writeBufferToContigStrips (TIFF*, uint8*, uint32); +static int writeBufferToContigTiles (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *); +static int writeBufferToSeparateStrips (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *); +static int writeBufferToSeparateTiles (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *); +static int extractContigSamplesToBuffer (uint8 *, uint8 *, uint32, uint32, tsample_t, + uint16, uint16, struct dump_opts *); +static int processCompressOptions(char*); +static void usage(void); + +/* All other functions by Richard Nolde, not found in tiffcp */ +static void initImageData (struct image_data *); +static void initCropMasks (struct crop_mask *); +static void initPageSetup (struct pagedef *, struct pageseg *, struct buffinfo []); +static void initDumpOptions(struct dump_opts *); + +/* Command line and file naming functions */ +void process_command_opts (int, char *[], char *, char *, uint32 *, + uint16 *, uint16 *, uint32 *, uint32 *, uint32 *, + struct crop_mask *, struct pagedef *, + struct dump_opts *, + unsigned int *, unsigned int *); +static int update_output_file (TIFF **, char *, int, char *, unsigned int *); + + +/* * High level functions for whole image manipulation */ +static int get_page_geometry (char *, struct pagedef*); +static int computeInputPixelOffsets(struct crop_mask *, struct image_data *, + struct offset *); +static int computeOutputPixelOffsets (struct crop_mask *, struct image_data *, + struct pagedef *, struct pageseg *, + struct dump_opts *); +static int loadImage(TIFF *, struct image_data *, struct dump_opts *, unsigned char **); +static int correct_orientation(struct image_data *, unsigned char **); +static int getCropOffsets(struct image_data *, struct crop_mask *, struct dump_opts *); +static int processCropSelections(struct image_data *, struct crop_mask *, + unsigned char **, struct buffinfo []); +static int writeSelections(TIFF *, TIFF **, struct crop_mask *, struct image_data *, + struct dump_opts *, struct buffinfo [], + char *, char *, unsigned int*, unsigned int); + +/* Section functions */ +static int createImageSection(uint32, unsigned char **); +static int extractImageSection(struct image_data *, struct pageseg *, + unsigned char *, unsigned char *); +static int writeSingleSection(TIFF *, TIFF *, struct image_data *, + struct dump_opts *, uint32, uint32, + double, double, unsigned char *); +static int writeImageSections(TIFF *, TIFF *, struct image_data *, + struct pagedef *, struct pageseg *, + struct dump_opts *, unsigned char *, + unsigned char **); +/* Whole image functions */ +static int createCroppedImage(struct image_data *, struct crop_mask *, + unsigned char **, unsigned char **); +static int writeCroppedImage(TIFF *, TIFF *, struct image_data *image, + struct dump_opts * dump, + uint32, uint32, unsigned char *, int, int); + +/* Image manipulation functions */ +static int rotateContigSamples8bits(uint16, uint16, uint16, uint32, + uint32, uint32, uint8 *, uint8 *); +static int rotateContigSamples16bits(uint16, uint16, uint16, uint32, + uint32, uint32, uint8 *, uint8 *); +static int rotateContigSamples24bits(uint16, uint16, uint16, uint32, + uint32, uint32, uint8 *, uint8 *); +static int rotateContigSamples32bits(uint16, uint16, uint16, uint32, + uint32, uint32, uint8 *, uint8 *); +static int rotateImage(uint16, struct image_data *, uint32 *, uint32 *, + unsigned char **); +static int mirrorImage(uint16, uint16, uint16, uint32, uint32, + unsigned char *); +static int invertImage(uint16, uint16, uint16, uint32, uint32, + unsigned char *); + +/* Functions to reverse the sequence of samples in a scanline */ +static int reverseSamples8bits (uint16, uint16, uint32, uint8 *, uint8 *); +static int reverseSamples16bits (uint16, uint16, uint32, uint8 *, uint8 *); +static int reverseSamples24bits (uint16, uint16, uint32, uint8 *, uint8 *); +static int reverseSamples32bits (uint16, uint16, uint32, uint8 *, uint8 *); +static int reverseSamplesBytes (uint16, uint16, uint32, uint8 *, uint8 *); + +/* Functions for manipulating individual samples in an image */ +static int extractSeparateRegion(struct image_data *, struct crop_mask *, + unsigned char *, unsigned char *, int); +static int extractCompositeRegions(struct image_data *, struct crop_mask *, + unsigned char *, unsigned char *); +static int extractContigSamples8bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32); +static int extractContigSamples16bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32); +static int extractContigSamples24bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32); +static int extractContigSamples32bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32); +static int extractContigSamplesBytes (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32); +static int extractContigSamplesShifted8bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32, + int); +static int extractContigSamplesShifted16bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32, + int); +static int extractContigSamplesShifted24bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32, + int); +static int extractContigSamplesShifted32bits (uint8 *, uint8 *, uint32, + tsample_t, uint16, uint16, + tsample_t, uint32, uint32, + int); +static int extractContigSamplesToTileBuffer(uint8 *, uint8 *, uint32, uint32, + uint32, uint32, tsample_t, uint16, + uint16, uint16, struct dump_opts *); + +/* Functions to combine separate planes into interleaved planes */ +static int combineSeparateSamples8bits (uint8 *[], uint8 *, uint32, uint32, + uint16, uint16, FILE *, int, int); +static int combineSeparateSamples16bits (uint8 *[], uint8 *, uint32, uint32, + uint16, uint16, FILE *, int, int); +static int combineSeparateSamples24bits (uint8 *[], uint8 *, uint32, uint32, + uint16, uint16, FILE *, int, int); +static int combineSeparateSamples32bits (uint8 *[], uint8 *, uint32, uint32, + uint16, uint16, FILE *, int, int); +static int combineSeparateSamplesBytes (unsigned char *[], unsigned char *, + uint32, uint32, tsample_t, uint16, + FILE *, int, int); + +static int combineSeparateTileSamples8bits (uint8 *[], uint8 *, uint32, uint32, + uint32, uint32, uint16, uint16, + FILE *, int, int); +static int combineSeparateTileSamples16bits (uint8 *[], uint8 *, uint32, uint32, + uint32, uint32, uint16, uint16, + FILE *, int, int); +static int combineSeparateTileSamples24bits (uint8 *[], uint8 *, uint32, uint32, + uint32, uint32, uint16, uint16, + FILE *, int, int); +static int combineSeparateTileSamples32bits (uint8 *[], uint8 *, uint32, uint32, + uint32, uint32, uint16, uint16, + FILE *, int, int); +static int combineSeparateTileSamplesBytes (unsigned char *[], unsigned char *, + uint32, uint32, uint32, uint32, + tsample_t, uint16, FILE *, int, int); + +/* Dump functions for debugging */ +static void dump_info (FILE *, int, char *, char *, ...); +static int dump_data (FILE *, int, char *, unsigned char *, uint32); +static int dump_byte (FILE *, int, char *, unsigned char); +static int dump_short (FILE *, int, char *, uint16); +static int dump_long (FILE *, int, char *, uint32); +static int dump_wide (FILE *, int, char *, uint64); +static int dump_buffer (FILE *, int, uint32, uint32, uint32, unsigned char *); + +/* End function declarations */ +/* Functions derived in whole or in part from tiffcp */ +/* The following functions are taken largely intact from tiffcp */ + +static char* usage_info[] = { +"usage: tiffcrop [options] source1 ... sourceN destination", +"where options are:", +" -h Print this syntax listing", +" -v Print tiffcrop version identifier and last revision date", +" ", +" -a Append to output instead of overwriting", +" -d offset Set initial directory offset, counting first image as one, not zero", +" -p contig Pack samples contiguously (e.g. RGBRGB...)", +" -p separate Store samples separately (e.g. RRR...GGG...BBB...)", +" -s Write output in strips", +" -t Write output in tiles", +" -i Ignore read errors", +" ", +" -r # Make each strip have no more than # rows", +" -w # Set output tile width (pixels)", +" -l # Set output tile length (pixels)", +" ", +" -f lsb2msb Force lsb-to-msb FillOrder for output", +" -f msb2lsb Force msb-to-lsb FillOrder for output", +"", +" -c lzw[:opts] Compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] Compress output with deflate encoding", +" -c jpeg[:opts] Compress output with JPEG encoding", +" -c packbits Compress output with packbits encoding", +" -c g3[:opts] Compress output with CCITT Group 3 encoding", +" -c g4 Compress output with CCITT Group 4 encoding", +" -c none Use no compression algorithm on output", +" ", +"Group 3 options:", +" 1d Use default CCITT Group 3 1D-encoding", +" 2d Use optional CCITT Group 3 2D-encoding", +" fill Byte-align EOL codes", +"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs", +" ", +"JPEG options:", +" # Set compression quality level (0-100, default 100)", +" raw Output color image as raw YCbCr", +" rgb Output color image as RGB", +"For example, -c jpeg:rgb:50 to get JPEG-encoded RGB data with 50% comp. quality", +" ", +"LZW and deflate options:", +" # Set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +" ", +"Page and selection options:", +" -N odd|even|#,#-#,#|last sequences and ranges of images within file to process", +" The words odd or even may be used to specify all odd or even numbered images.", +" The word last may be used in place of a number in the sequence to indicate.", +" The final image in the file without knowing how many images there are.", +" Numbers are counted from one even though TIFF IFDs are counted from zero.", +" ", +" -E t|l|r|b edge to use as origin for width and length of crop region", +" -U units [in, cm, px ] inches, centimeters or pixels", +" ", +" -m #,#,#,# margins from edges for selection: top, left, bottom, right separated by commas", +" -X # horizontal dimension of region to extract expressed in current units", +" -Y # vertical dimension of region to extract expressed in current units", +" -Z #:#,#:# zones of the image designated as position X of Y,", +" eg 1:3 would be first of three equal portions measured from reference edge", +" -z x1,y1,x2,y2:...:xN,yN,xN+1,yN+1", +" regions of the image designated by upper left and lower right coordinates", +"", +"Export grouping options:", +" -e c|d|i|m|s export mode for images and selections from input images.", +" When exporting a composite image from multiple zones or regions", +" (combined and image modes), the selections must have equal sizes", +" for the axis perpendicular to the edge specified with -E.", +" c|combined All images and selections are written to a single file (default).", +" with multiple selections from one image combined into a single image.", +" d|divided All images and selections are written to a single file", +" with each selection from one image written to a new image.", +" i|image Each input image is written to a new file (numeric filename sequence)", +" with multiple selections from the image combined into one image.", +" m|multiple Each input image is written to a new file (numeric filename sequence)", +" with each selection from the image written to a new image.", +" s|separated Individual selections from each image are written to separate files.", +"", +"Output options:", +" -H # Set horizontal resolution of output images to #", +" -V # Set vertical resolution of output images to #", +" -J # Set horizontal margin of output page to # expressed in current units", +" when sectioning image into columns x rows using the -S cols:rows option", +" -K # Set verticalal margin of output page to # expressed in current units", +" when sectioning image into columns x rows using the -S cols:rows option", +" ", +" -O orient orientation for output image, portrait, landscape, auto", +" -P page page size for output image segments, eg letter, legal, tabloid, etc", +" use #.#x#.# to specify a custom page size in the currently defined units", +" where #.# represents the width and length", +" -S cols:rows Divide the image into equal sized segments using cols across and rows down.", +" ", +" -F hor|vert|both", +" flip (mirror) image or region horizontally, vertically, or both", +" -R # [90,180,or 270] degrees clockwise rotation of image or extracted region", +" -I [black|white|data|both]", +" invert color space, eg dark to light for bilevel and grayscale images", +" If argument is white or black, set the PHOTOMETRIC_INTERPRETATION ", +" tag to MinIsBlack or MinIsWhite without altering the image data", +" If the argument is data or both, the image data are modified:", +" both inverts the data and the PHOTOMETRIC_INTERPRETATION tag,", +" data inverts the data but not the PHOTOMETRIC_INTERPRETATION tag", +" ", +"-D opt1:value1,opt2:value2,opt3:value3:opt4:value4", +" Debug/dump program progress and/or data to non-TIFF files.", +" Options include the following and must be joined as a comma", +" separate list. The use of this option is generally limited to", +" program debugging and development of future options.", +" ", +" debug:N Display limited program progress indicators where larger N", +" increase the level of detail. Note: Tiffcrop may be compiled with", +" -DDEVELMODE to enable additional very low level debug reporting.", +"", +" Format:txt|raw Format any logged data as ASCII text or raw binary ", +" values. ASCII text dumps include strings of ones and zeroes", +" representing the binary values in the image data plus identifying headers.", +" ", +" level:N Specify the level of detail presented in the dump files.", +" This can vary from dumps of the entire input or output image data to dumps", +" of data processed by specific functions. Current range of levels is 1 to 3.", +" ", +" input:full-path-to-directory/input-dumpname", +" ", +" output:full-path-to-directory/output-dumpnaem", +" ", +" When dump files are being written, each image will be written to a separate", +" file with the name built by adding a numeric sequence value to the dumpname", +" and an extension of .txt for ASCII dumps or .bin for binary dumps.", +" ", +" The four debug/dump options are independent, though it makes little sense to", +" specify a dump file without specifying a detail level.", +" ", +NULL +}; + +/* This function could be modified to pass starting sample offset + * and number of samples as args to select fewer than spp + * from input image. These would then be passed to individual + * extractContigSampleXX routines. + */ +static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, + uint32 imagelength, + uint32 imagewidth, + uint32 tw, uint32 tl, + tsample_t spp, uint16 bps) + { + int status = 1; + tsample_t sample = 0; + tsample_t count = spp; + uint32 row, col, trow; + uint32 nrow, ncol; + uint32 dst_rowsize, shift_width; + uint32 bytes_per_sample, bytes_per_pixel; + uint32 trailing_bits, prev_trailing_bits; + uint32 tile_rowsize = TIFFTileRowSize(in); + uint32 src_offset, dst_offset; + uint32 row_offset, col_offset; + uint8 *bufp = (uint8*) buf; + unsigned char *src = NULL; + unsigned char *dst = NULL; + tsize_t tbytes = 0, tile_buffsize = 0; + tsize_t tilesize = TIFFTileSize(in); + unsigned char *tilebuf = NULL; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + + if ((bps % 8) == 0) + shift_width = 0; + else + { + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + } + + tile_buffsize = tilesize; + + if (tilesize < (tsize_t)(tl * tile_rowsize)) + { +#ifdef DEBUG2 + TIFFError("readContigTilesIntoBuffer", + "Tilesize %lu is too small, using alternate calculation %u", + tilesize, tl * tile_rowsize); +#endif + tile_buffsize = tl * tile_rowsize; + } + + tilebuf = _TIFFmalloc(tile_buffsize); + if (tilebuf == 0) + return 0; + + dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; + for (row = 0; row < imagelength; row += tl) + { + nrow = (row + tl > imagelength) ? imagelength - row : tl; + for (col = 0; col < imagewidth; col += tw) + { + tbytes = TIFFReadTile(in, tilebuf, col, row, 0, 0); + if (tbytes < tilesize && !ignore) + { + TIFFError(TIFFFileName(in), + "Error, can't read tile at row %lu col %lu, Read %lu bytes of %lu", + (unsigned long) col, (unsigned long) row, (unsigned long)tbytes, + (unsigned long)tilesize); + status = 0; + _TIFFfree(tilebuf); + return status; + } + + row_offset = row * dst_rowsize; + col_offset = ((col * bps * spp) + 7)/ 8; + bufp = buf + row_offset + col_offset; + + if (col + tw > imagewidth) + ncol = imagewidth - col; + else + ncol = tw; + + /* Each tile scanline will start on a byte boundary but it + * has to be merged into the scanline for the entire + * image buffer and the previous segment may not have + * ended on a byte boundary + */ + /* Optimization for common bit depths, all samples */ + if (((bps % 8) == 0) && (count == spp)) + { + for (trow = 0; trow < nrow; trow++) + { + src_offset = trow * tile_rowsize; + _TIFFmemcpy (bufp, tilebuf + src_offset, (ncol * spp * bps) / 8); + bufp += (imagewidth * bps * spp) / 8; + } + } + else + { + /* Bit depths not a multiple of 8 and/or extract fewer than spp samples */ + prev_trailing_bits = trailing_bits = 0; + trailing_bits = (ncol * bps * spp) % 8; + + /* for (trow = 0; tl < nrow; trow++) */ + for (trow = 0; trow < nrow; trow++) + { + src_offset = trow * tile_rowsize; + src = tilebuf + src_offset; + dst_offset = (row + trow) * dst_rowsize; + dst = buf + dst_offset + col_offset; + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, ncol, sample, + spp, bps, count, 0, ncol)) + { + TIFFError("readContigTilesIntoBuffer", + "Unable to extract row %d from tile %lu", + row, (unsigned long)TIFFCurrentTile(in)); + return 1; + } + break; + case 1: if (bps == 1) + { + if (extractContigSamplesShifted8bits (src, dst, ncol, + sample, spp, + bps, count, + 0, ncol, + prev_trailing_bits)) + { + TIFFError("readContigTilesIntoBuffer", + "Unable to extract row %d from tile %lu", + row, (unsigned long)TIFFCurrentTile(in)); + return 1; + } + break; + } + else + if (extractContigSamplesShifted16bits (src, dst, ncol, + sample, spp, + bps, count, + 0, ncol, + prev_trailing_bits)) + { + TIFFError("readContigTilesIntoBuffer", + "Unable to extract row %d from tile %lu", + row, (unsigned long)TIFFCurrentTile(in)); + return 1; + } + break; + case 2: if (extractContigSamplesShifted24bits (src, dst, ncol, + sample, spp, + bps, count, + 0, ncol, + prev_trailing_bits)) + { + TIFFError("readContigTilesIntoBuffer", + "Unable to extract row %d from tile %lu", + row, (unsigned long)TIFFCurrentTile(in)); + return 1; + } + break; + case 3: + case 4: + case 5: if (extractContigSamplesShifted32bits (src, dst, ncol, + sample, spp, + bps, count, + 0, ncol, + prev_trailing_bits)) + { + TIFFError("readContigTilesIntoBuffer", + "Unable to extract row %d from tile %lu", + row, (unsigned long)TIFFCurrentTile(in)); + return 1; + } + break; + default: TIFFError("readContigTilesIntoBuffer", "Unsupported bit depth %d", bps); + return 1; + } + } + prev_trailing_bits += trailing_bits; + if (prev_trailing_bits > 7) + prev_trailing_bits-= 8; + } + } + } + + _TIFFfree(tilebuf); + return status; + } + +static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf, + uint32 imagelength, uint32 imagewidth, + uint32 tw, uint32 tl, + uint16 spp, uint16 bps) + { + int i, status = 1, sample; + int shift_width, bytes_per_pixel; + uint16 bytes_per_sample; + uint32 row, col; /* Current row and col of image */ + uint32 nrow, ncol; /* Number of rows and cols in current tile */ + uint32 row_offset, col_offset; /* Output buffer offsets */ + tsize_t tbytes = 0, tilesize = TIFFTileSize(in); + tsample_t s; + uint8* bufp = (uint8*)obuf; + unsigned char *srcbuffs[MAX_SAMPLES]; + unsigned char *tbuff = NULL; + + bytes_per_sample = (bps + 7) / 8; + + for (sample = 0; (sample < spp) && (sample < MAX_SAMPLES); sample++) + { + srcbuffs[sample] = NULL; + tbuff = (unsigned char *)_TIFFmalloc(tilesize + 8); + if (!tbuff) + { + TIFFError ("readSeparateTilesIntoBuffer", + "Unable to allocate tile read buffer for sample %d", sample); + for (i = 0; i < sample; i++) + _TIFFfree (srcbuffs[i]); + return 0; + } + srcbuffs[sample] = tbuff; + } + /* Each tile contains only the data for a single plane + * arranged in scanlines of tw * bytes_per_sample bytes. + */ + for (row = 0; row < imagelength; row += tl) + { + nrow = (row + tl > imagelength) ? imagelength - row : tl; + for (col = 0; col < imagewidth; col += tw) + { + for (s = 0; s < spp; s++) + { /* Read each plane of a tile set into srcbuffs[s] */ + tbytes = TIFFReadTile(in, srcbuffs[s], col, row, 0, s); + if (tbytes < 0 && !ignore) + { + TIFFError(TIFFFileName(in), + "Error, can't read tile for row %lu col %lu, " + "sample %lu", + (unsigned long) col, (unsigned long) row, + (unsigned long) s); + status = 0; + for (sample = 0; (sample < spp) && (sample < MAX_SAMPLES); sample++) + { + tbuff = srcbuffs[sample]; + if (tbuff != NULL) + _TIFFfree(tbuff); + } + return status; + } + } + /* Tiles on the right edge may be padded out to tw + * which must be a multiple of 16. + * Ncol represents the visible (non padding) portion. + */ + if (col + tw > imagewidth) + ncol = imagewidth - col; + else + ncol = tw; + + row_offset = row * (((imagewidth * spp * bps) + 7) / 8); + col_offset = ((col * spp * bps) + 7) / 8; + bufp = obuf + row_offset + col_offset; + + if ((bps % 8) == 0) + { + if (combineSeparateTileSamplesBytes(srcbuffs, bufp, ncol, nrow, imagewidth, + tw, spp, bps, NULL, 0, 0)) + { + status = 0; + break; + } + } + else + { + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + switch (shift_width) + { + case 1: if (combineSeparateTileSamples8bits (srcbuffs, bufp, ncol, nrow, + imagewidth, tw, spp, bps, + NULL, 0, 0)) + { + status = 0; + break; + } + break; + case 2: if (combineSeparateTileSamples16bits (srcbuffs, bufp, ncol, nrow, + imagewidth, tw, spp, bps, + NULL, 0, 0)) + { + status = 0; + break; + } + break; + case 3: if (combineSeparateTileSamples24bits (srcbuffs, bufp, ncol, nrow, + imagewidth, tw, spp, bps, + NULL, 0, 0)) + { + status = 0; + break; + } + break; + case 4: + case 5: + case 6: + case 7: + case 8: if (combineSeparateTileSamples32bits (srcbuffs, bufp, ncol, nrow, + imagewidth, tw, spp, bps, + NULL, 0, 0)) + { + status = 0; + break; + } + break; + default: TIFFError ("readSeparateTilesIntoBuffer", "Unsupported bit depth: %d", bps); + status = 0; + break; + } + } + } + } + + for (sample = 0; (sample < spp) && (sample < MAX_SAMPLES); sample++) + { + tbuff = srcbuffs[sample]; + if (tbuff != NULL) + _TIFFfree(tbuff); + } + + return status; + } + +static int writeBufferToContigStrips(TIFF* out, uint8* buf, uint32 imagelength) + { + uint32 row, nrows, rowsperstrip; + tstrip_t strip = 0; + tsize_t stripsize; + + TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + for (row = 0; row < imagelength; row += rowsperstrip) + { + nrows = (row + rowsperstrip > imagelength) ? + imagelength - row : rowsperstrip; + stripsize = TIFFVStripSize(out, nrows); + if (TIFFWriteEncodedStrip(out, strip++, buf, stripsize) < 0) + { + TIFFError(TIFFFileName(out), "Error, can't write strip %u", strip - 1); + return 1; + } + buf += stripsize; + } + + return 0; + } + +/* Abandon plans to modify code so that plannar orientation separate images + * do not have all samples for each channel written before all samples + * for the next channel have been abandoned. + * Libtiff internals seem to depend on all data for a given sample + * being contiguous within a strip or tile when PLANAR_CONFIG is + * separate. All strips or tiles of a given plane are written + * before any strips or tiles of a different plane are stored. + */ +static int +writeBufferToSeparateStrips (TIFF* out, uint8* buf, + uint32 length, uint32 width, uint16 spp, + struct dump_opts *dump) + { + uint8 *src; + uint16 bps; + uint32 row, nrows, rowsize, rowsperstrip; + uint32 bytes_per_sample; + tsample_t s; + tstrip_t strip = 0; + tsize_t stripsize = TIFFStripSize(out); + tsize_t rowstripsize, scanlinesize = TIFFScanlineSize(out); + tsize_t total_bytes = 0; + tdata_t obuf; + + (void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + (void) TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps); + bytes_per_sample = (bps + 7) / 8; + rowsize = ((bps * spp * width) + 7) / 8; /* source has interleaved samples */ + rowstripsize = rowsperstrip * bytes_per_sample * (width + 1); + + obuf = _TIFFmalloc (rowstripsize); + if (obuf == NULL) + return 1; + + for (s = 0; s < spp; s++) + { + for (row = 0; row < length; row += rowsperstrip) + { + nrows = (row + rowsperstrip > length) ? length - row : rowsperstrip; + + stripsize = TIFFVStripSize(out, nrows); + src = buf + (row * rowsize); + total_bytes += stripsize; + memset (obuf, '\0', rowstripsize); + if (extractContigSamplesToBuffer(obuf, src, nrows, width, s, spp, bps, dump)) + { + _TIFFfree(obuf); + return 1; + } + if ((dump->outfile != NULL) && (dump->level == 1)) + { + dump_info(dump->outfile, dump->format,"", + "Sample %2d, Strip: %2d, bytes: %4d, Row %4d, bytes: %4d, Input offset: %6d", + s + 1, strip + 1, stripsize, row + 1, scanlinesize, src - buf); + dump_buffer(dump->outfile, dump->format, nrows, scanlinesize, row, obuf); + } + + if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0) + { + TIFFError(TIFFFileName(out), "Error, can't write strip %u", strip - 1); + _TIFFfree(obuf); + return 1; + } + } + } + + _TIFFfree(obuf); + return 0; +} + +/* Extract all planes from contiguous buffer into a single tile buffer + * to be written out as a tile. + */ +static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength, + uint32 imagewidth, tsample_t spp, + struct dump_opts* dump) + { + uint16 bps; + uint32 tl, tw; + uint32 row, col, nrow, ncol; + uint32 src_rowsize, col_offset; + uint32 tile_rowsize = TIFFTileRowSize(out); + uint8* bufp = (uint8*) buf; + tsize_t tile_buffsize = 0; + tsize_t tilesize = TIFFTileSize(out); + unsigned char *tilebuf = NULL; + + TIFFGetField(out, TIFFTAG_TILELENGTH, &tl); + TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps); + + tile_buffsize = tilesize; + if (tilesize < (tsize_t)(tl * tile_rowsize)) + { +#ifdef DEBUG2 + TIFFError("writeBufferToContigTiles", + "Tilesize %lu is too small, using alternate calculation %u", + tilesize, tl * tile_rowsize); +#endif + tile_buffsize = tl * tile_rowsize; + } + + tilebuf = _TIFFmalloc(tile_buffsize); + if (tilebuf == 0) + return 1; + + src_rowsize = ((imagewidth * spp * bps) + 7) / 8; + for (row = 0; row < imagelength; row += tl) + { + nrow = (row + tl > imagelength) ? imagelength - row : tl; + for (col = 0; col < imagewidth; col += tw) + { + /* Calculate visible portion of tile. */ + if (col + tw > imagewidth) + ncol = imagewidth - col; + else + ncol = tw; + + col_offset = (((col * bps * spp) + 7) / 8); + bufp = buf + (row * src_rowsize) + col_offset; + if (extractContigSamplesToTileBuffer(tilebuf, bufp, nrow, ncol, imagewidth, + tw, 0, spp, spp, bps, dump) > 0) + { + TIFFError("writeBufferToContigTiles", + "Unable to extract data to tile for row %lu, col %lu", + (unsigned long) row, (unsigned long)col); + _TIFFfree(tilebuf); + return 1; + } + + if (TIFFWriteTile(out, tilebuf, col, row, 0, 0) < 0) + { + TIFFError("writeBufferToContigTiles", + "Cannot write tile at %lu %lu", + (unsigned long) col, (unsigned long) row); + _TIFFfree(tilebuf); + return 1; + } + } + } + _TIFFfree(tilebuf); + + return 0; + } /* end writeBufferToContigTiles */ + +/* Extract each plane from contiguous buffer into a single tile buffer + * to be written out as a tile. + */ +static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength, + uint32 imagewidth, tsample_t spp, + struct dump_opts * dump) + { + tdata_t obuf = _TIFFmalloc(TIFFTileSize(out)); + uint32 tl, tw; + uint32 row, col, nrow, ncol; + uint32 src_rowsize, col_offset; + uint16 bps; + tsample_t s; + uint8* bufp = (uint8*) buf; + + if (obuf == NULL) + return 1; + + TIFFGetField(out, TIFFTAG_TILELENGTH, &tl); + TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps); + src_rowsize = ((imagewidth * spp * bps) + 7) / 8; + + for (row = 0; row < imagelength; row += tl) + { + nrow = (row + tl > imagelength) ? imagelength - row : tl; + for (col = 0; col < imagewidth; col += tw) + { + /* Calculate visible portion of tile. */ + if (col + tw > imagewidth) + ncol = imagewidth - col; + else + ncol = tw; + + col_offset = (((col * bps * spp) + 7) / 8); + bufp = buf + (row * src_rowsize) + col_offset; + + for (s = 0; s < spp; s++) + { + if (extractContigSamplesToTileBuffer(obuf, bufp, nrow, ncol, imagewidth, + tw, s, 1, spp, bps, dump) > 0) + { + TIFFError("writeBufferToSeparateTiles", + "Unable to extract data to tile for row %lu, col %lu sample %d", + (unsigned long) row, (unsigned long)col, (int)s); + _TIFFfree(obuf); + return 1; + } + + if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) + { + TIFFError("writeBufferToseparateTiles", + "Cannot write tile at %lu %lu sample %lu", + (unsigned long) col, (unsigned long) row, + (unsigned long) s); + _TIFFfree(obuf); + return 1; + } + } + } + } + _TIFFfree(obuf); + + return 0; + } /* end writeBufferToSeparateTiles */ + +static void +processG3Options(char* cp) +{ + if( (cp = strchr(cp, ':')) ) { + if (defg3opts == (uint32) -1) + defg3opts = 0; + do { + cp++; + if (strneq(cp, "1d", 2)) + defg3opts &= ~GROUP3OPT_2DENCODING; + else if (strneq(cp, "2d", 2)) + defg3opts |= GROUP3OPT_2DENCODING; + else if (strneq(cp, "fill", 4)) + defg3opts |= GROUP3OPT_FILLBITS; + else + usage(); + } while( (cp = strchr(cp, ':')) ); + } +} + +static int +processCompressOptions(char* opt) + { + char* cp = NULL; + + if (strneq(opt, "none",4)) + { + defcompression = COMPRESSION_NONE; + } + else if (streq(opt, "packbits")) + { + defcompression = COMPRESSION_PACKBITS; + } + else if (strneq(opt, "jpeg", 4)) + { + cp = strchr(opt, ':'); + defcompression = COMPRESSION_JPEG; + + while (cp) + { + if (isdigit((int)cp[1])) + quality = atoi(cp + 1); + else if (strneq(cp + 1, "raw", 3 )) + jpegcolormode = JPEGCOLORMODE_RAW; + else if (strneq(cp + 1, "rgb", 3 )) + jpegcolormode = JPEGCOLORMODE_RGB; + else + usage(); + cp = strchr(cp + 1, ':'); + } + } + else if (strneq(opt, "g3", 2)) + { + processG3Options(opt); + defcompression = COMPRESSION_CCITTFAX3; + } + else if (streq(opt, "g4")) + { + defcompression = COMPRESSION_CCITTFAX4; + } + else if (strneq(opt, "lzw", 3)) + { + cp = strchr(opt, ':'); + if (cp) + defpredictor = atoi(cp+1); + defcompression = COMPRESSION_LZW; + } + else if (strneq(opt, "zip", 3)) + { + cp = strchr(opt, ':'); + if (cp) + defpredictor = atoi(cp+1); + defcompression = COMPRESSION_ADOBE_DEFLATE; + } + else + return (0); + + return (1); + } + +static void +usage(void) + { + int i; + + fprintf(stderr, "\n%s\n", TIFFGetVersion()); + for (i = 0; usage_info[i] != NULL; i++) + fprintf(stderr, "%s\n", usage_info[i]); + exit(-1); + } + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) +#define CopyField4(tag, v1, v2, v3, v4) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4) + +static void +cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type) +{ + switch (type) { + case TIFF_SHORT: + if (count == 1) { + uint16 shortv; + CopyField(tag, shortv); + } else if (count == 2) { + uint16 shortv1, shortv2; + CopyField2(tag, shortv1, shortv2); + } else if (count == 4) { + uint16 *tr, *tg, *tb, *ta; + CopyField4(tag, tr, tg, tb, ta); + } else if (count == (uint16) -1) { + uint16 shortv1; + uint16* shortav; + CopyField2(tag, shortv1, shortav); + } + break; + case TIFF_LONG: + { uint32 longv; + CopyField(tag, longv); + } + break; + case TIFF_RATIONAL: + if (count == 1) { + float floatv; + CopyField(tag, floatv); + } else if (count == (uint16) -1) { + float* floatav; + CopyField(tag, floatav); + } + break; + case TIFF_ASCII: + { char* stringv; + CopyField(tag, stringv); + } + break; + case TIFF_DOUBLE: + if (count == 1) { + double doublev; + CopyField(tag, doublev); + } else if (count == (uint16) -1) { + double* doubleav; + CopyField(tag, doubleav); + } + break; + default: + TIFFError(TIFFFileName(in), + "Data type %d is not supported, tag %d skipped", + tag, type); + } +} + +static struct cpTag { + uint16 tag; + uint16 count; + TIFFDataType type; +} tags[] = { + { TIFFTAG_SUBFILETYPE, 1, TIFF_LONG }, + { TIFFTAG_THRESHHOLDING, 1, TIFF_SHORT }, + { TIFFTAG_DOCUMENTNAME, 1, TIFF_ASCII }, + { TIFFTAG_IMAGEDESCRIPTION, 1, TIFF_ASCII }, + { TIFFTAG_MAKE, 1, TIFF_ASCII }, + { TIFFTAG_MODEL, 1, TIFF_ASCII }, + { TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT }, + { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL }, + { TIFFTAG_PAGENAME, 1, TIFF_ASCII }, + { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL }, + { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT }, + { TIFFTAG_SOFTWARE, 1, TIFF_ASCII }, + { TIFFTAG_DATETIME, 1, TIFF_ASCII }, + { TIFFTAG_ARTIST, 1, TIFF_ASCII }, + { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII }, + { TIFFTAG_WHITEPOINT, (uint16) -1, TIFF_RATIONAL }, + { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT }, + { TIFFTAG_INKSET, 1, TIFF_SHORT }, + { TIFFTAG_DOTRANGE, 2, TIFF_SHORT }, + { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII }, + { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT }, + { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT }, + { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT }, + { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL }, + { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT }, + { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE }, + { TIFFTAG_STONITS, 1, TIFF_DOUBLE }, +}; +#define NTAGS (sizeof (tags) / sizeof (tags[0])) + +#define CopyTag(tag, count, type) cpTag(in, out, tag, count, type) + +/* Functions written by Richard Nolde, with exceptions noted. */ +void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 *dirnum, + uint16 *defconfig, uint16 *deffillorder, uint32 *deftilewidth, + uint32 *deftilelength, uint32 *defrowsperstrip, + struct crop_mask *crop_data, struct pagedef *page, + struct dump_opts *dump, + unsigned int *imagelist, unsigned int *image_count ) + { + int c, good_args = 0; + char *opt_offset = NULL; /* Position in string of value sought */ + char *opt_ptr = NULL; /* Pointer to next token in option set */ + char *sep = NULL; /* Pointer to a token separator */ + unsigned int i, j, start, end; + extern int optind; + extern char* optarg; + + *mp++ = 'w'; + *mp = '\0'; + while ((c = getopt(argc, argv, + "ac:d:e:f:hil:m:p:r:stvw:z:BCD:E:F:H:I:J:K:LMN:O:P:R:S:U:V:X:Y:Z:")) != -1) + { + good_args++; + switch (c) { + case 'a': mode[0] = 'a'; /* append to output */ + break; + case 'c': if (!processCompressOptions(optarg)) /* compression scheme */ + { + TIFFError ("Unknown compression option", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'd': start = strtoul(optarg, NULL, 0); /* initial IFD offset */ + if (start == 0) + { + TIFFError ("","Directory offset must be greater than zero"); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + *dirnum = start - 1; + break; + case 'e': switch (tolower(optarg[0])) /* image export modes*/ + { + case 'c': crop_data->exp_mode = ONE_FILE_COMPOSITE; + crop_data->img_mode = COMPOSITE_IMAGES; + break; /* Composite */ + case 'd': crop_data->exp_mode = ONE_FILE_SEPARATED; + crop_data->img_mode = SEPARATED_IMAGES; + break; /* Divided */ + case 'i': crop_data->exp_mode = FILE_PER_IMAGE_COMPOSITE; + crop_data->img_mode = COMPOSITE_IMAGES; + break; /* Image */ + case 'm': crop_data->exp_mode = FILE_PER_IMAGE_SEPARATED; + crop_data->img_mode = SEPARATED_IMAGES; + break; /* Multiple */ + case 's': crop_data->exp_mode = FILE_PER_SELECTION; + crop_data->img_mode = SEPARATED_IMAGES; + break; /* Sections */ + default: TIFFError ("Unknown export mode","%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'f': if (streq(optarg, "lsb2msb")) /* fill order */ + *deffillorder = FILLORDER_LSB2MSB; + else if (streq(optarg, "msb2lsb")) + *deffillorder = FILLORDER_MSB2LSB; + else + { + TIFFError ("Unknown fill order", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'h': usage(); + break; + case 'i': ignore = TRUE; /* ignore errors */ + break; + case 'l': outtiled = TRUE; /* tile length */ + *deftilelength = atoi(optarg); + break; + case 'p': /* planar configuration */ + if (streq(optarg, "separate")) + *defconfig = PLANARCONFIG_SEPARATE; + else if (streq(optarg, "contig")) + *defconfig = PLANARCONFIG_CONTIG; + else + { + TIFFError ("Unkown planar configuration", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'r': /* rows/strip */ + *defrowsperstrip = atol(optarg); + break; + case 's': /* generate stripped output */ + outtiled = FALSE; + break; + case 't': /* generate tiled output */ + outtiled = TRUE; + break; + case 'v': TIFFError("Library Release", "%s", TIFFGetVersion()); + TIFFError ("Tiffcrop version", "%s, last updated: %s", + tiffcrop_version_id, tiffcrop_rev_date); + TIFFError ("Tiffcp code", "Copyright (c) 1988-1997 Sam Leffler"); + TIFFError (" ", "Copyright (c) 1991-1997 Silicon Graphics, Inc"); + TIFFError ("Tiffcrop additions", "Copyright (c) 2007-2010 Richard Nolde"); + exit (0); + break; + case 'w': /* tile width */ + outtiled = TRUE; + *deftilewidth = atoi(optarg); + break; + case 'z': /* regions of an image specified as x1,y1,x2,y2:x3,y3,x4,y4 etc */ + crop_data->crop_mode |= CROP_REGIONS; + for (i = 0, opt_ptr = strtok (optarg, ":"); + ((opt_ptr != NULL) && (i < MAX_REGIONS)); + (opt_ptr = strtok (NULL, ":")), i++) + { + crop_data->regions++; + if (sscanf(opt_ptr, "%lf,%lf,%lf,%lf", + &crop_data->corners[i].X1, &crop_data->corners[i].Y1, + &crop_data->corners[i].X2, &crop_data->corners[i].Y2) != 4) + { + TIFFError ("Unable to parse coordinates for region", "%d %s", i, optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + } + /* check for remaining elements over MAX_REGIONS */ + if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) + { + TIFFError ("Region list exceeds limit of", "%d regions %s", MAX_REGIONS, optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1);; + } + break; + /* options for file open modes */ + case 'B': *mp++ = 'b'; *mp = '\0'; + break; + case 'L': *mp++ = 'l'; *mp = '\0'; + break; + case 'M': *mp++ = 'm'; *mp = '\0'; + break; + case 'C': *mp++ = 'c'; *mp = '\0'; + break; + /* options for Debugging / data dump */ + case 'D': for (i = 0, opt_ptr = strtok (optarg, ","); + (opt_ptr != NULL); + (opt_ptr = strtok (NULL, ",")), i++) + { + opt_offset = strpbrk(opt_ptr, ":="); + if (opt_offset == NULL) + { + TIFFError("Invalid dump option", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + + *opt_offset = '\0'; + /* convert option to lowercase */ + end = strlen (opt_ptr); + for (i = 0; i < end; i++) + *(opt_ptr + i) = tolower(*(opt_ptr + i)); + /* Look for dump format specification */ + if (strncmp(opt_ptr, "for", 3) == 0) + { + /* convert value to lowercase */ + end = strlen (opt_offset + 1); + for (i = 1; i <= end; i++) + *(opt_offset + i) = tolower(*(opt_offset + i)); + /* check dump format value */ + if (strncmp (opt_offset + 1, "txt", 3) == 0) + { + dump->format = DUMP_TEXT; + strcpy (dump->mode, "w"); + } + else + { + if (strncmp(opt_offset + 1, "raw", 3) == 0) + { + dump->format = DUMP_RAW; + strcpy (dump->mode, "wb"); + } + else + { + TIFFError("parse_command_opts", "Unknown dump format %s", opt_offset + 1); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + } + } + else + { /* Look for dump level specification */ + if (strncmp (opt_ptr, "lev", 3) == 0) + dump->level = atoi(opt_offset + 1); + /* Look for input data dump file name */ + if (strncmp (opt_ptr, "in", 2) == 0) + { + strncpy (dump->infilename, opt_offset + 1, PATH_MAX - 20); + dump->infilename[PATH_MAX - 20] = '\0'; + } + /* Look for output data dump file name */ + if (strncmp (opt_ptr, "out", 3) == 0) + { + strncpy (dump->outfilename, opt_offset + 1, PATH_MAX - 20); + dump->outfilename[PATH_MAX - 20] = '\0'; + } + if (strncmp (opt_ptr, "deb", 3) == 0) + dump->debug = atoi(opt_offset + 1); + } + } + if ((strlen(dump->infilename)) || (strlen(dump->outfilename))) + { + if (dump->level == 1) + TIFFError("","Defaulting to dump level 1, no data."); + if (dump->format == DUMP_NONE) + { + TIFFError("", "You must specify a dump format for dump files"); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + } + break; + + /* image manipulation routine options */ + case 'm': /* margins to exclude from selection, uppercase M was already used */ + /* order of values must be TOP, LEFT, BOTTOM, RIGHT */ + crop_data->crop_mode |= CROP_MARGINS; + for (i = 0, opt_ptr = strtok (optarg, ",:"); + ((opt_ptr != NULL) && (i < 4)); + (opt_ptr = strtok (NULL, ",:")), i++) + { + crop_data->margins[i] = atof(opt_ptr); + } + break; + case 'E': /* edge reference */ + switch (tolower(optarg[0])) + { + case 't': crop_data->edge_ref = EDGE_TOP; + break; + case 'b': crop_data->edge_ref = EDGE_BOTTOM; + break; + case 'l': crop_data->edge_ref = EDGE_LEFT; + break; + case 'r': crop_data->edge_ref = EDGE_RIGHT; + break; + default: TIFFError ("Edge reference must be top, bottom, left, or right", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'F': /* flip eg mirror image or cropped segment, M was already used */ + crop_data->crop_mode |= CROP_MIRROR; + switch (tolower(optarg[0])) + { + case 'h': crop_data->mirror = MIRROR_HORIZ; + break; + case 'v': crop_data->mirror = MIRROR_VERT; + break; + case 'b': crop_data->mirror = MIRROR_BOTH; + break; + default: TIFFError ("Flip mode must be horiz, vert, or both", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'H': /* set horizontal resolution to new value */ + page->hres = atof (optarg); + page->mode |= PAGE_MODE_RESOLUTION; + break; + case 'I': /* invert the color space, eg black to white */ + crop_data->crop_mode |= CROP_INVERT; + /* The PHOTOMETIC_INTERPRETATION tag may be updated */ + if (streq(optarg, "black")) + { + crop_data->photometric = PHOTOMETRIC_MINISBLACK; + continue; + } + if (streq(optarg, "white")) + { + crop_data->photometric = PHOTOMETRIC_MINISWHITE; + continue; + } + if (streq(optarg, "data")) + { + crop_data->photometric = INVERT_DATA_ONLY; + continue; + } + if (streq(optarg, "both")) + { + crop_data->photometric = INVERT_DATA_AND_TAG; + continue; + } + + TIFFError("Missing or unknown option for inverting PHOTOMETRIC_INTERPRETATION", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + break; + case 'J': /* horizontal margin for sectioned ouput pages */ + page->hmargin = atof(optarg); + page->mode |= PAGE_MODE_MARGINS; + break; + case 'K': /* vertical margin for sectioned ouput pages*/ + page->vmargin = atof(optarg); + page->mode |= PAGE_MODE_MARGINS; + break; + case 'N': /* list of images to process */ + for (i = 0, opt_ptr = strtok (optarg, ","); + ((opt_ptr != NULL) && (i < MAX_IMAGES)); + (opt_ptr = strtok (NULL, ","))) + { /* We do not know how many images are in file yet + * so we build a list to include the maximum allowed + * and follow it until we hit the end of the file. + * Image count is not accurate for odd, even, last + * so page numbers won't be valid either. + */ + if (streq(opt_ptr, "odd")) + { + for (j = 1; j <= MAX_IMAGES; j += 2) + imagelist[i++] = j; + *image_count = (MAX_IMAGES - 1) / 2; + break; + } + else + { + if (streq(opt_ptr, "even")) + { + for (j = 2; j <= MAX_IMAGES; j += 2) + imagelist[i++] = j; + *image_count = MAX_IMAGES / 2; + break; + } + else + { + if (streq(opt_ptr, "last")) + imagelist[i++] = MAX_IMAGES; + else /* single value between commas */ + { + sep = strpbrk(opt_ptr, ":-"); + if (!sep) + imagelist[i++] = atoi(opt_ptr); + else + { + *sep = '\0'; + start = atoi (opt_ptr); + if (!strcmp((sep + 1), "last")) + end = MAX_IMAGES; + else + end = atoi (sep + 1); + for (j = start; j <= end && j - start + i < MAX_IMAGES; j++) + imagelist[i++] = j; + } + } + } + } + } + *image_count = i; + break; + case 'O': /* page orientation */ + switch (tolower(optarg[0])) + { + case 'a': page->orient = ORIENTATION_AUTO; + break; + case 'p': page->orient = ORIENTATION_PORTRAIT; + break; + case 'l': page->orient = ORIENTATION_LANDSCAPE; + break; + default: TIFFError ("Orientation must be portrait, landscape, or auto.", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'P': /* page size selection */ + if (sscanf(optarg, "%lfx%lf", &page->width, &page->length) == 2) + { + strcpy (page->name, "Custom"); + page->mode |= PAGE_MODE_PAPERSIZE; + break; + } + if (get_page_geometry (optarg, page)) + { + if (!strcmp(optarg, "list")) + { + TIFFError("", "Name Width Length (in inches)"); + for (i = 0; i < MAX_PAPERNAMES - 1; i++) + TIFFError ("", "%-15.15s %5.2f %5.2f", + PaperTable[i].name, PaperTable[i].width, + PaperTable[i].length); + exit (-1); + } + + TIFFError ("Invalid paper size", "%s", optarg); + TIFFError ("", "Select one of:"); + TIFFError("", "Name Width Length (in inches)"); + for (i = 0; i < MAX_PAPERNAMES - 1; i++) + TIFFError ("", "%-15.15s %5.2f %5.2f", + PaperTable[i].name, PaperTable[i].width, + PaperTable[i].length); + exit (-1); + } + else + { + page->mode |= PAGE_MODE_PAPERSIZE; + } + break; + case 'R': /* rotate image or cropped segment */ + crop_data->crop_mode |= CROP_ROTATE; + switch (strtoul(optarg, NULL, 0)) + { + case 90: crop_data->rotation = (uint16)90; + break; + case 180: crop_data->rotation = (uint16)180; + break; + case 270: crop_data->rotation = (uint16)270; + break; + default: TIFFError ("Rotation must be 90, 180, or 270 degrees clockwise", "%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'S': /* subdivide into Cols:Rows sections, eg 3:2 would be 3 across and 2 down */ + sep = strpbrk(optarg, ",:"); + if (sep) + { + *sep = '\0'; + page->cols = atoi(optarg); + page->rows = atoi(sep +1); + } + else + { + page->cols = atoi(optarg); + page->rows = atoi(optarg); + } + if ((page->cols * page->rows) > MAX_SECTIONS) + { + TIFFError ("Limit for subdivisions, ie rows x columns, exceeded", "%d", MAX_SECTIONS); + exit (-1); + } + page->mode |= PAGE_MODE_ROWSCOLS; + break; + case 'U': /* units for measurements and offsets */ + if (streq(optarg, "in")) + { + crop_data->res_unit = RESUNIT_INCH; + page->res_unit = RESUNIT_INCH; + } + else if (streq(optarg, "cm")) + { + crop_data->res_unit = RESUNIT_CENTIMETER; + page->res_unit = RESUNIT_CENTIMETER; + } + else if (streq(optarg, "px")) + { + crop_data->res_unit = RESUNIT_NONE; + page->res_unit = RESUNIT_NONE; + } + else + { + TIFFError ("Illegal unit of measure","%s", optarg); + TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + } + break; + case 'V': /* set vertical resolution to new value */ + page->vres = atof (optarg); + page->mode |= PAGE_MODE_RESOLUTION; + break; + case 'X': /* selection width */ + crop_data->crop_mode |= CROP_WIDTH; + crop_data->width = atof(optarg); + break; + case 'Y': /* selection length */ + crop_data->crop_mode |= CROP_LENGTH; + crop_data->length = atof(optarg); + break; + case 'Z': /* zones of an image X:Y read as zone X of Y */ + crop_data->crop_mode |= CROP_ZONES; + for (i = 0, opt_ptr = strtok (optarg, ","); + ((opt_ptr != NULL) && (i < MAX_REGIONS)); + (opt_ptr = strtok (NULL, ",")), i++) + { + crop_data->zones++; + opt_offset = strchr(opt_ptr, ':'); + *opt_offset = '\0'; + crop_data->zonelist[i].position = atoi(opt_ptr); + crop_data->zonelist[i].total = atoi(opt_offset + 1); + } + /* check for remaining elements over MAX_REGIONS */ + if ((opt_ptr != NULL) && (i >= MAX_REGIONS)) + { + TIFFError("Zone list exceeds region limit", "%d", MAX_REGIONS); + exit (-1); + } + break; + case '?': TIFFError ("For valid options type", "tiffcrop -h"); + exit (-1); + /*NOTREACHED*/ + } + } + } /* end process_command_opts */ + +/* Start a new output file if one has not been previously opened or + * autoindex is set to non-zero. Update page and file counters + * so TIFFTAG PAGENUM will be correct in image. + */ +static int +update_output_file (TIFF **tiffout, char *mode, int autoindex, + char *outname, unsigned int *page) + { + static int findex = 0; /* file sequence indicator */ + char *sep; + char filenum[16]; + char export_ext[16]; + char exportname[PATH_MAX]; + + if (autoindex && (*tiffout != NULL)) + { + /* Close any export file that was previously opened */ + TIFFClose (*tiffout); + *tiffout = NULL; + } + + strcpy (export_ext, ".tiff"); + memset (exportname, '\0', PATH_MAX); + + /* Leave room for page number portion of the new filename */ + strncpy (exportname, outname, PATH_MAX - 16); + if (*tiffout == NULL) /* This is a new export file */ + { + if (autoindex) + { /* create a new filename for each export */ + findex++; + if ((sep = strstr(exportname, ".tif")) || (sep = strstr(exportname, ".TIF"))) + { + strncpy (export_ext, sep, 5); + *sep = '\0'; + } + else + strncpy (export_ext, ".tiff", 5); + export_ext[5] = '\0'; + + /* MAX_EXPORT_PAGES limited to 6 digits to prevent string overflow of pathname */ + if (findex > MAX_EXPORT_PAGES) + { + TIFFError("update_output_file", "Maximum of %d pages per file exceeded", MAX_EXPORT_PAGES); + return 1; + } + + sprintf (filenum, "-%03d%s", findex, export_ext); + filenum[14] = '\0'; + strncat (exportname, filenum, 15); + } + exportname[PATH_MAX - 1] = '\0'; + + *tiffout = TIFFOpen(exportname, mode); + if (*tiffout == NULL) + { + TIFFError("update_output_file", "Unable to open output file %s", exportname); + return 1; + } + *page = 0; + + return 0; + } + else + (*page)++; + + return 0; + } /* end update_output_file */ + + +int +main(int argc, char* argv[]) + { + extern int optind; + uint16 defconfig = (uint16) -1; + uint16 deffillorder = 0; + uint32 deftilewidth = (uint32) 0; + uint32 deftilelength = (uint32) 0; + uint32 defrowsperstrip = (uint32) 0; + uint32 dirnum = 0; + + TIFF *in = NULL; + TIFF *out = NULL; + char mode[10]; + char *mp = mode; + + /** RJN additions **/ + struct image_data image; /* Image parameters for one image */ + struct crop_mask crop; /* Cropping parameters for all images */ + struct pagedef page; /* Page definition for output pages */ + struct pageseg sections[MAX_SECTIONS]; /* Sections of one output page */ + struct buffinfo seg_buffs[MAX_SECTIONS]; /* Segment buffer sizes and pointers */ + struct dump_opts dump; /* Data dump options */ + unsigned char *read_buff = NULL; /* Input image data buffer */ + unsigned char *crop_buff = NULL; /* Crop area buffer */ + unsigned char *sect_buff = NULL; /* Image section buffer */ + unsigned char *sect_src = NULL; /* Image section buffer pointer */ + unsigned int imagelist[MAX_IMAGES + 1]; /* individually specified images */ + unsigned int image_count = 0; + unsigned int dump_images = 0; + unsigned int next_image = 0; + unsigned int next_page = 0; + unsigned int total_pages = 0; + unsigned int total_images = 0; + unsigned int end_of_input = FALSE; + int seg, length; + char temp_filename[PATH_MAX + 1]; + + little_endian = *((unsigned char *)&little_endian) & '1'; + + initImageData(&image); + initCropMasks(&crop); + initPageSetup(&page, sections, seg_buffs); + initDumpOptions(&dump); + + process_command_opts (argc, argv, mp, mode, &dirnum, &defconfig, + &deffillorder, &deftilewidth, &deftilelength, &defrowsperstrip, + &crop, &page, &dump, imagelist, &image_count); + + if (argc - optind < 2) + usage(); + + if ((argc - optind) == 2) + pageNum = -1; + else + total_images = 0; + /* read multiple input files and write to output file(s) */ + while (optind < argc - 1) + { + in = TIFFOpen (argv[optind], "r"); + if (in == NULL) + return (-3); + + /* If only one input file is specified, we can use directory count */ + total_images = TIFFNumberOfDirectories(in); + if (image_count == 0) + { + dirnum = 0; + total_pages = total_images; /* Only valid with single input file */ + } + else + { + dirnum = (tdir_t)(imagelist[next_image] - 1); + next_image++; + + /* Total pages only valid for enumerated list of pages not derived + * using odd, even, or last keywords. + */ + if (image_count > total_images) + image_count = total_images; + + total_pages = image_count; + } + + /* MAX_IMAGES is used for special case "last" in selection list */ + if (dirnum == (MAX_IMAGES - 1)) + dirnum = total_images - 1; + + if (dirnum > (total_images)) + { + TIFFError (TIFFFileName(in), + "Invalid image number %d, File contains only %d images", + (int)dirnum + 1, total_images); + if (out != NULL) + (void) TIFFClose(out); + return (1); + } + + if (dirnum != 0 && !TIFFSetDirectory(in, (tdir_t)dirnum)) + { + TIFFError(TIFFFileName(in),"Error, setting subdirectory at %d", dirnum); + if (out != NULL) + (void) TIFFClose(out); + return (1); + } + + end_of_input = FALSE; + while (end_of_input == FALSE) + { + config = defconfig; + compression = defcompression; + predictor = defpredictor; + fillorder = deffillorder; + rowsperstrip = defrowsperstrip; + tilewidth = deftilewidth; + tilelength = deftilelength; + g3opts = defg3opts; + + if (dump.format != DUMP_NONE) + { + /* manage input and/or output dump files here */ + dump_images++; + length = strlen(dump.infilename); + if (length > 0) + { + if (dump.infile != NULL) + fclose (dump.infile); + + /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes + fewer than PATH_MAX */ + memset (temp_filename, '\0', PATH_MAX + 1); + sprintf (temp_filename, "%s-read-%03d.%s", dump.infilename, dump_images, + (dump.format == DUMP_TEXT) ? "txt" : "raw"); + if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL) + { + TIFFError ("Unable to open dump file for writing", "%s", temp_filename); + exit (-1); + } + dump_info(dump.infile, dump.format, "Reading image","%d from %s", + dump_images, TIFFFileName(in)); + } + length = strlen(dump.outfilename); + if (length > 0) + { + if (dump.outfile != NULL) + fclose (dump.outfile); + + /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes + fewer than PATH_MAX */ + memset (temp_filename, '\0', PATH_MAX + 1); + sprintf (temp_filename, "%s-write-%03d.%s", dump.outfilename, dump_images, + (dump.format == DUMP_TEXT) ? "txt" : "raw"); + if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL) + { + TIFFError ("Unable to open dump file for writing", "%s", temp_filename); + exit (-1); + } + dump_info(dump.outfile, dump.format, "Writing image","%d from %s", + dump_images, TIFFFileName(in)); + } + } + + if (dump.debug) + TIFFError("main", "Reading image %4d of %4d total pages.", dirnum + 1, total_pages); + + if (loadImage(in, &image, &dump, &read_buff)) + { + TIFFError("main", "Unable to load source image"); + exit (-1); + } + + /* Correct the image orientation if it was not ORIENTATION_TOPLEFT. + */ + if (image.adjustments != 0) + { + if (correct_orientation(&image, &read_buff)) + TIFFError("main", "Unable to correct image orientation"); + } + + if (getCropOffsets(&image, &crop, &dump)) + { + TIFFError("main", "Unable to define crop regions"); + exit (-1); + } + + if (crop.selections > 0) + { + if (processCropSelections(&image, &crop, &read_buff, seg_buffs)) + { + TIFFError("main", "Unable to process image selections"); + exit (-1); + } + } + else /* Single image segment without zones or regions */ + { + if (createCroppedImage(&image, &crop, &read_buff, &crop_buff)) + { + TIFFError("main", "Unable to create output image"); + exit (-1); + } + } + if (page.mode == PAGE_MODE_NONE) + { /* Whole image or sections not based on output page size */ + if (crop.selections > 0) + { + writeSelections(in, &out, &crop, &image, &dump, seg_buffs, + mp, argv[argc - 1], &next_page, total_pages); + } + else /* One file all images and sections */ + { + if (update_output_file (&out, mp, crop.exp_mode, argv[argc - 1], + &next_page)) + exit (1); + if (writeCroppedImage(in, out, &image, &dump,crop.combined_width, + crop.combined_length, crop_buff, next_page, total_pages)) + { + TIFFError("main", "Unable to write new image"); + exit (-1); + } + } + } + else + { + /* If we used a crop buffer, our data is there, otherwise it is + * in the read_buffer + */ + if (crop_buff != NULL) + sect_src = crop_buff; + else + sect_src = read_buff; + /* Break input image into pages or rows and columns */ + if (computeOutputPixelOffsets(&crop, &image, &page, sections, &dump)) + { + TIFFError("main", "Unable to compute output section data"); + exit (-1); + } + /* If there are multiple files on the command line, the final one is assumed + * to be the output filename into which the images are written. + */ + if (update_output_file (&out, mp, crop.exp_mode, argv[argc - 1], &next_page)) + exit (1); + + if (writeImageSections(in, out, &image, &page, sections, &dump, sect_src, §_buff)) + { + TIFFError("main", "Unable to write image sections"); + exit (-1); + } + } + + /* No image list specified, just read the next image */ + if (image_count == 0) + dirnum++; + else + { + dirnum = (tdir_t)(imagelist[next_image] - 1); + next_image++; + } + + if (dirnum == MAX_IMAGES - 1) + dirnum = TIFFNumberOfDirectories(in) - 1; + + if (!TIFFSetDirectory(in, (tdir_t)dirnum)) + end_of_input = TRUE; + } + TIFFClose(in); + optind++; + } + + /* If we did not use the read buffer as the crop buffer */ + if (read_buff) + _TIFFfree(read_buff); + + if (crop_buff) + _TIFFfree(crop_buff); + + if (sect_buff) + _TIFFfree(sect_buff); + + /* Clean up any segment buffers used for zones or regions */ + for (seg = 0; seg < crop.selections; seg++) + _TIFFfree (seg_buffs[seg].buffer); + + if (dump.format != DUMP_NONE) + { + if (dump.infile != NULL) + fclose (dump.infile); + + if (dump.outfile != NULL) + { + dump_info (dump.outfile, dump.format, "", "Completed run for %s", TIFFFileName(out)); + fclose (dump.outfile); + } + } + + TIFFClose(out); + + return (0); + } /* end main */ + + +/* Debugging functions */ +static int dump_data (FILE *dumpfile, int format, char *dump_tag, unsigned char *data, uint32 count) + { + int j, k; + uint32 i; + char dump_array[10]; + unsigned char bitset; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + if (format == DUMP_TEXT) + { + fprintf (dumpfile," %s ", dump_tag); + for (i = 0; i < count; i++) + { + for (j = 0, k = 7; j < 8; j++, k--) + { + bitset = (*(data + i)) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&dump_array[j], (bitset) ? "1" : "0"); + } + dump_array[8] = '\0'; + fprintf (dumpfile," %s", dump_array); + } + fprintf (dumpfile,"\n"); + } + else + { + if ((fwrite (data, 1, count, dumpfile)) != count) + { + TIFFError ("", "Unable to write binary data to dump file"); + return (1); + } + } + + return (0); + } + +static int dump_byte (FILE *dumpfile, int format, char *dump_tag, unsigned char data) + { + int j, k; + char dump_array[10]; + unsigned char bitset; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + if (format == DUMP_TEXT) + { + fprintf (dumpfile," %s ", dump_tag); + for (j = 0, k = 7; j < 8; j++, k--) + { + bitset = data & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&dump_array[j], (bitset) ? "1" : "0"); + } + dump_array[8] = '\0'; + fprintf (dumpfile," %s\n", dump_array); + } + else + { + if ((fwrite (&data, 1, 1, dumpfile)) != 1) + { + TIFFError ("", "Unable to write binary data to dump file"); + return (1); + } + } + + return (0); + } + +static int dump_short (FILE *dumpfile, int format, char *dump_tag, uint16 data) + { + int j, k; + char dump_array[20]; + unsigned char bitset; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + if (format == DUMP_TEXT) + { + fprintf (dumpfile," %s ", dump_tag); + for (j = 0, k = 15; k >= 0; j++, k--) + { + bitset = data & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&dump_array[j], (bitset) ? "1" : "0"); + if ((k % 8) == 0) + sprintf(&dump_array[++j], " "); + } + dump_array[17] = '\0'; + fprintf (dumpfile," %s\n", dump_array); + } + else + { + if ((fwrite (&data, 2, 1, dumpfile)) != 2) + { + TIFFError ("", "Unable to write binary data to dump file"); + return (1); + } + } + + return (0); + } + +static int dump_long (FILE *dumpfile, int format, char *dump_tag, uint32 data) + { + int j, k; + char dump_array[40]; + unsigned char bitset; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + if (format == DUMP_TEXT) + { + fprintf (dumpfile," %s ", dump_tag); + for (j = 0, k = 31; k >= 0; j++, k--) + { + bitset = data & (((uint32)1 << k)) ? 1 : 0; + sprintf(&dump_array[j], (bitset) ? "1" : "0"); + if ((k % 8) == 0) + sprintf(&dump_array[++j], " "); + } + dump_array[35] = '\0'; + fprintf (dumpfile," %s\n", dump_array); + } + else + { + if ((fwrite (&data, 4, 1, dumpfile)) != 4) + { + TIFFError ("", "Unable to write binary data to dump file"); + return (1); + } + } + return (0); + } + +static int dump_wide (FILE *dumpfile, int format, char *dump_tag, uint64 data) + { + int j, k; + char dump_array[80]; + unsigned char bitset; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + if (format == DUMP_TEXT) + { + fprintf (dumpfile," %s ", dump_tag); + for (j = 0, k = 63; k >= 0; j++, k--) + { + bitset = data & (((uint64)1 << k)) ? 1 : 0; + sprintf(&dump_array[j], (bitset) ? "1" : "0"); + if ((k % 8) == 0) + sprintf(&dump_array[++j], " "); + } + dump_array[71] = '\0'; + fprintf (dumpfile," %s\n", dump_array); + } + else + { + if ((fwrite (&data, 8, 1, dumpfile)) != 8) + { + TIFFError ("", "Unable to write binary data to dump file"); + return (1); + } + } + + return (0); + } + +static void dump_info(FILE *dumpfile, int format, char *prefix, char *msg, ...) + { + if (format == DUMP_TEXT) + { + va_list ap; + va_start(ap, msg); + fprintf(dumpfile, "%s ", prefix); + vfprintf(dumpfile, msg, ap); + fprintf(dumpfile, "\n"); + } + } + +static int dump_buffer (FILE* dumpfile, int format, uint32 rows, uint32 width, + uint32 row, unsigned char *buff) + { + int j, k; + uint32 i; + unsigned char * dump_ptr; + + if (dumpfile == NULL) + { + TIFFError ("", "Invalid FILE pointer for dump file"); + return (1); + } + + for (i = 0; i < rows; i++) + { + dump_ptr = buff + (i * width); + if (format == DUMP_TEXT) + dump_info (dumpfile, format, "", + "Row %4d, %d bytes at offset %d", + row + i + 1, width, row * width); + + for (j = 0, k = width; k >= 10; j += 10, k -= 10, dump_ptr += 10) + dump_data (dumpfile, format, "", dump_ptr, 10); + if (k > 0) + dump_data (dumpfile, format, "", dump_ptr, k); + } + return (0); + } + +/* Extract one or more samples from an interleaved buffer. If count == 1, + * only the sample plane indicated by sample will be extracted. If count > 1, + * count samples beginning at sample will be extracted. Portions of a + * scanline can be extracted by specifying a start and end value. + */ + +static int +extractContigSamplesBytes (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end) + { + int i, bytes_per_sample, sindex; + uint32 col, dst_rowsize, bit_offset; + uint32 src_byte, src_bit; + uint8 *src = in; + uint8 *dst = out; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("extractContigSamplesBytes","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamplesBytes", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamplesBytes", + "Invalid end column value %d ignored", end); + end = cols; + } + + dst_rowsize = (bps * (end - start) * count) / 8; + + bytes_per_sample = (bps + 7) / 8; + /* Optimize case for copying all samples */ + if (count == spp) + { + src = in + (start * spp * bytes_per_sample); + _TIFFmemcpy (dst, src, dst_rowsize); + } + else + { + for (col = start; col < end; col++) + { + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + bit_offset = col * bps * spp; + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + src = in + src_byte; + for (i = 0; i < bytes_per_sample; i++) + *dst++ = *src++; + } + } + } + + return (0); + } /* end extractContigSamplesBytes */ + +static int +extractContigSamples8bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint8 maskbits = 0, matchbits = 0; + uint8 buff1 = 0, buff2 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("extractContigSamples8bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamples8bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamples8bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = 0; + maskbits = (uint8)-1 >> ( 8 - bps); + buff1 = buff2 = 0; + for (col = start; col < end; col++) + { /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (8 - src_bit - bps); + buff1 = ((*src) & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + *dst++ = buff2; + buff2 = buff1; + ready_bits -= 8; + } + else + buff2 = (buff2 | (buff1 >> ready_bits)); + ready_bits += bps; + } + } + + while (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamples8bits */ + +static int +extractContigSamples16bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint16 maskbits = 0, matchbits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("extractContigSamples16bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamples16bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamples16bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = 0; + maskbits = (uint16)-1 >> (16 - bps); + + for (col = start; col < end; col++) + { /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (16 - src_bit - bps); + + if (little_endian) + buff1 = (src[0] << 8) | src[1]; + else + buff1 = (src[1] << 8) | src[0]; + + buff1 = (buff1 & matchbits) << (src_bit); + if (ready_bits < 8) /* add another bps bits to the buffer */ + { + bytebuff = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamples16bits */ + + +static int +extractContigSamples24bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint32 maskbits = 0, matchbits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((in == NULL) || (out == NULL)) + { + TIFFError("extractContigSamples24bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamples24bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamples24bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = 0; + maskbits = (uint32)-1 >> ( 32 - bps); + for (col = start; col < end; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (32 - src_bit - bps); + if (little_endian) + buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + else + buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + buff1 = (buff1 & matchbits) << (src_bit); + + if (ready_bits < 16) /* add another bps bits to the buffer */ + { + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamples24bits */ + +static int +extractContigSamples32bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end) + { + int ready_bits = 0, sindex = 0, shift_width = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 maskbits = 0, matchbits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((in == NULL) || (out == NULL)) + { + TIFFError("extractContigSamples32bits","Invalid input or output buffer"); + return (1); + } + + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamples32bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamples32bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + shift_width = ((bps + 7) / 8) + 1; + ready_bits = 0; + maskbits = (uint64)-1 >> ( 64 - bps); + for (col = start; col < end; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (64 - src_bit - bps); + if (little_endian) + { + longbuff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + longbuff2 = longbuff1; + } + + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + buff1 = (buff3 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 32) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamples32bits */ + +static int +extractContigSamplesShifted8bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end, + int shift) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint8 maskbits = 0, matchbits = 0; + uint8 buff1 = 0, buff2 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("extractContigSamplesShifted8bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamplesShifted8bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamplesShifted8bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = shift; + maskbits = (uint8)-1 >> ( 8 - bps); + buff1 = buff2 = 0; + for (col = start; col < end; col++) + { /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (8 - src_bit - bps); + buff1 = ((*src) & matchbits) << (src_bit); + if ((col == start) && (sindex == sample)) + buff2 = *src & ((uint8)-1) << (shift); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + *dst++ |= buff2; + buff2 = buff1; + ready_bits -= 8; + } + else + buff2 = buff2 | (buff1 >> ready_bits); + ready_bits += bps; + } + } + + while (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamplesShifted8bits */ + +static int +extractContigSamplesShifted16bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end, + int shift) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint16 maskbits = 0, matchbits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("extractContigSamplesShifted16bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamplesShifted16bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamplesShifted16bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = shift; + maskbits = (uint16)-1 >> (16 - bps); + for (col = start; col < end; col++) + { /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (16 - src_bit - bps); + if (little_endian) + buff1 = (src[0] << 8) | src[1]; + else + buff1 = (src[1] << 8) | src[0]; + + if ((col == start) && (sindex == sample)) + buff2 = buff1 & ((uint16)-1) << (8 - shift); + + buff1 = (buff1 & matchbits) << (src_bit); + + if (ready_bits < 8) /* add another bps bits to the buffer */ + buff2 = buff2 | (buff1 >> ready_bits); + else /* If we have a full buffer's worth, write it out */ + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + } + + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamplesShifted16bits */ + + +static int +extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end, + int shift) + { + int ready_bits = 0, sindex = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint32 maskbits = 0, matchbits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((in == NULL) || (out == NULL)) + { + TIFFError("extractContigSamplesShifted24bits","Invalid input or output buffer"); + return (1); + } + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamplesShifted24bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamplesShifted24bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + ready_bits = shift; + maskbits = (uint32)-1 >> ( 32 - bps); + for (col = start; col < end; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (32 - src_bit - bps); + if (little_endian) + buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + else + buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + + if ((col == start) && (sindex == sample)) + buff2 = buff1 & ((uint32)-1) << (16 - shift); + + buff1 = (buff1 & matchbits) << (src_bit); + + if (ready_bits < 16) /* add another bps bits to the buffer */ + { + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamplesShifted24bits */ + +static int +extractContigSamplesShifted32bits (uint8 *in, uint8 *out, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + tsample_t count, uint32 start, uint32 end, + int shift) + { + int ready_bits = 0, sindex = 0, shift_width = 0; + uint32 col, src_byte, src_bit, bit_offset; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 maskbits = 0, matchbits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + uint8 *src = in; + uint8 *dst = out; + + if ((in == NULL) || (out == NULL)) + { + TIFFError("extractContigSamplesShifted32bits","Invalid input or output buffer"); + return (1); + } + + + if ((start > end) || (start > cols)) + { + TIFFError ("extractContigSamplesShifted32bits", + "Invalid start column value %d ignored", start); + start = 0; + } + if ((end == 0) || (end > cols)) + { + TIFFError ("extractContigSamplesShifted32bits", + "Invalid end column value %d ignored", end); + end = cols; + } + + shift_width = ((bps + 7) / 8) + 1; + ready_bits = shift; + maskbits = (uint64)-1 >> ( 64 - bps); + for (col = start; col < end; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps * spp; + for (sindex = sample; (sindex < spp) && (sindex < (sample + count)); sindex++) + { + if (sindex == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sindex * bps)) / 8; + src_bit = (bit_offset + (sindex * bps)) % 8; + } + + src = in + src_byte; + matchbits = maskbits << (64 - src_bit - bps); + if (little_endian) + { + longbuff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + longbuff2 = longbuff1; + } + + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + if ((col == start) && (sindex == sample)) + buff2 = buff3 & ((uint64)-1) << (32 - shift); + + buff1 = (buff3 & matchbits) << (src_bit); + + if (ready_bits < 32) + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + return (0); + } /* end extractContigSamplesShifted32bits */ + +static int +extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols, + tsample_t sample, uint16 spp, uint16 bps, + struct dump_opts *dump) + { + int shift_width, bytes_per_sample, bytes_per_pixel; + uint32 src_rowsize, src_offset, row, first_col = 0; + uint32 dst_rowsize, dst_offset; + tsample_t count = 1; + uint8 *src, *dst; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if ((bps % 8) == 0) + shift_width = 0; + else + { + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + } + src_rowsize = ((bps * spp * cols) + 7) / 8; + dst_rowsize = ((bps * cols) + 7) / 8; + + if ((dump->outfile != NULL) && (dump->level == 4)) + { + dump_info (dump->outfile, dump->format, "extractContigSamplesToBuffer", + "Sample %d, %d rows", sample + 1, rows + 1); + } + for (row = 0; row < rows; row++) + { + src_offset = row * src_rowsize; + dst_offset = row * dst_rowsize; + src = in + src_offset; + dst = out + dst_offset; + + /* pack the data into the scanline */ + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, cols, sample, + spp, bps, count, first_col, cols)) + return (1); + break; + case 1: if (bps == 1) + { + if (extractContigSamples8bits (src, dst, cols, sample, + spp, bps, count, first_col, cols)) + return (1); + break; + } + else + if (extractContigSamples16bits (src, dst, cols, sample, + spp, bps, count, first_col, cols)) + return (1); + break; + case 2: if (extractContigSamples24bits (src, dst, cols, sample, + spp, bps, count, first_col, cols)) + return (1); + break; + case 3: + case 4: + case 5: if (extractContigSamples32bits (src, dst, cols, sample, + spp, bps, count, first_col, cols)) + return (1); + break; + default: TIFFError ("extractContigSamplesToBuffer", "Unsupported bit depth: %d", bps); + return (1); + } + if ((dump->outfile != NULL) && (dump->level == 4)) + dump_buffer(dump->outfile, dump->format, 1, dst_rowsize, row, dst); + } + + return (0); + } /* end extractContigSamplesToBuffer */ + +static int +extractContigSamplesToTileBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols, + uint32 imagewidth, uint32 tilewidth, tsample_t sample, + uint16 count, uint16 spp, uint16 bps, struct dump_opts *dump) + { + int shift_width, bytes_per_sample, bytes_per_pixel; + uint32 src_rowsize, src_offset, row; + uint32 dst_rowsize, dst_offset; + uint8 *src, *dst; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if ((bps % 8) == 0) + shift_width = 0; + else + { + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + } + + if ((dump->outfile != NULL) && (dump->level == 4)) + { + dump_info (dump->outfile, dump->format, "extractContigSamplesToTileBuffer", + "Sample %d, %d rows", sample + 1, rows + 1); + } + + src_rowsize = ((bps * spp * imagewidth) + 7) / 8; + dst_rowsize = ((bps * tilewidth * count) + 7) / 8; + + for (row = 0; row < rows; row++) + { + src_offset = row * src_rowsize; + dst_offset = row * dst_rowsize; + src = in + src_offset; + dst = out + dst_offset; + + /* pack the data into the scanline */ + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, cols, sample, + spp, bps, count, 0, cols)) + return (1); + break; + case 1: if (bps == 1) + { + if (extractContigSamples8bits (src, dst, cols, sample, + spp, bps, count, 0, cols)) + return (1); + break; + } + else + if (extractContigSamples16bits (src, dst, cols, sample, + spp, bps, count, 0, cols)) + return (1); + break; + case 2: if (extractContigSamples24bits (src, dst, cols, sample, + spp, bps, count, 0, cols)) + return (1); + break; + case 3: + case 4: + case 5: if (extractContigSamples32bits (src, dst, cols, sample, + spp, bps, count, 0, cols)) + return (1); + break; + default: TIFFError ("extractContigSamplesToTileBuffer", "Unsupported bit depth: %d", bps); + return (1); + } + if ((dump->outfile != NULL) && (dump->level == 4)) + dump_buffer(dump->outfile, dump->format, 1, dst_rowsize, row, dst); + } + + return (0); + } /* end extractContigSamplesToTileBuffer */ + +static int readContigStripsIntoBuffer (TIFF* in, uint8* buf) + { + uint8* bufp = buf; + int32 bytes_read = 0; + uint16 strip, nstrips = TIFFNumberOfStrips(in); + uint32 stripsize = TIFFStripSize(in); + uint32 rows = 0; + uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps); + tsize_t scanline_size = TIFFScanlineSize(in); + + for (strip = 0; strip < nstrips; strip++) + { + bytes_read = TIFFReadEncodedStrip (in, strip, bufp, -1); + rows = bytes_read / scanline_size; + if ((strip < (nstrips - 1)) && (bytes_read != (int32)stripsize)) + TIFFError("", "Strip %d: read %lu bytes, strip size %lu", + (int)strip + 1, (unsigned long) bytes_read, (unsigned long)stripsize); + + if (bytes_read < 0 && !ignore) + { + TIFFError("", "Error reading strip %lu after %lu rows", + (unsigned long) strip, (unsigned long)rows); + return 0; + } + bufp += bytes_read; + } + + return 1; + } /* end readContigStripsIntoBuffer */ + +static int +combineSeparateSamplesBytes (unsigned char *srcbuffs[], unsigned char *out, + uint32 cols, uint32 rows, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int i, bytes_per_sample; + uint32 row, col, col_offset, src_rowsize, dst_rowsize, row_offset; + unsigned char *src; + unsigned char *dst; + tsample_t s; + + src = srcbuffs[0]; + dst = out; + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateSamplesBytes","Invalid buffer address"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + + src_rowsize = ((bps * cols) + 7) / 8; + dst_rowsize = ((bps * spp * cols) + 7) / 8; + for (row = 0; row < rows; row++) + { + if ((dumpfile != NULL) && (level == 2)) + { + for (s = 0; s < spp; s++) + { + dump_info (dumpfile, format, "combineSeparateSamplesBytes","Input data, Sample %d", s); + dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize)); + } + } + dst = out + (row * dst_rowsize); + row_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + col_offset = row_offset + (col * (bps / 8)); + for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + src = srcbuffs[s] + col_offset; + for (i = 0; i < bytes_per_sample; i++) + *(dst + i) = *(src + i); + src += bytes_per_sample; + dst += bytes_per_sample; + } + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateSamplesBytes","Output data, combined samples"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateSamplesBytes */ + +static int +combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0; + int bytes_per_sample = 0; + uint32 src_rowsize, dst_rowsize, src_offset; + uint32 bit_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint8 maskbits = 0, matchbits = 0; + uint8 buff1 = 0, buff2 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[32]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateSamples8bits","Invalid input or output buffer"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + src_rowsize = ((bps * cols) + 7) / 8; + dst_rowsize = ((bps * cols * spp) + 7) / 8; + maskbits = (uint8)-1 >> ( 8 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (8 - src_bit - bps); + /* load up next sample from each plane */ + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + buff1 = ((*src) & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + *dst++ = buff2; + buff2 = buff1; + ready_bits -= 8; + strcpy (action, "Flush"); + } + else + { + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Match bits", matchbits); + dump_byte (dumpfile, format, "Src bits", *src); + dump_byte (dumpfile, format, "Buff1 bits", buff1); + dump_byte (dumpfile, format, "Buff2 bits", buff2); + dump_info (dumpfile, format, "","%s", action); + } + } + } + + if (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Final bits", buff1); + } + } + + if ((dumpfile != NULL) && (level >= 2)) + { + dump_info (dumpfile, format, "combineSeparateSamples8bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateSamples8bits */ + +static int +combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0, bytes_per_sample = 0; + uint32 src_rowsize, dst_rowsize; + uint32 bit_offset, src_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint16 maskbits = 0, matchbits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateSamples16bits","Invalid input or output buffer"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + src_rowsize = ((bps * cols) + 7) / 8; + dst_rowsize = ((bps * cols * spp) + 7) / 8; + maskbits = (uint16)-1 >> (16 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (16 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + buff1 = (src[0] << 8) | src[1]; + else + buff1 = (src[1] << 8) | src[0]; + + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + + dump_short (dumpfile, format, "Match bits", matchbits); + dump_data (dumpfile, format, "Src bits", src, 2); + dump_short (dumpfile, format, "Buff1 bits", buff1); + dump_short (dumpfile, format, "Buff2 bits", buff2); + dump_byte (dumpfile, format, "Write byte", bytebuff); + dump_info (dumpfile, format, "","Ready bits: %d, %s", ready_bits, action); + } + } + } + + /* catch any trailing bits at the end of the line */ + if (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Final bits", bytebuff); + } + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateSamples16bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateSamples16bits */ + +static int +combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0, bytes_per_sample = 0; + uint32 src_rowsize, dst_rowsize; + uint32 bit_offset, src_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint32 maskbits = 0, matchbits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateSamples24bits","Invalid input or output buffer"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + src_rowsize = ((bps * cols) + 7) / 8; + dst_rowsize = ((bps * cols * spp) + 7) / 8; + maskbits = (uint32)-1 >> ( 32 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (32 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + else + buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 16) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "","Ready bits: %d, %s", ready_bits, action); + } + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits); + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateSamples24bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateSamples24bits */ + +static int +combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0, bytes_per_sample = 0, shift_width = 0; + uint32 src_rowsize, dst_rowsize, bit_offset, src_offset; + uint32 src_byte = 0, src_bit = 0; + uint32 row, col; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 maskbits = 0, matchbits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateSamples32bits","Invalid input or output buffer"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + src_rowsize = ((bps * cols) + 7) / 8; + dst_rowsize = ((bps * cols * spp) + 7) / 8; + maskbits = (uint64)-1 >> ( 64 - bps); + shift_width = ((bps + 7) / 8) + 1; + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (64 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + { + longbuff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + longbuff2 = longbuff1; + } + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + buff1 = (buff3 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 32) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Sample %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_wide (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 8); + dump_wide (dumpfile, format, "Buff1 bits ", buff1); + dump_wide (dumpfile, format, "Buff2 bits ", buff2); + dump_info (dumpfile, format, "", "Ready bits: %d, %s", ready_bits, action); + } + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits); + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateSamples32bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out); + } + } + + return (0); + } /* end combineSeparateSamples32bits */ + +static int +combineSeparateTileSamplesBytes (unsigned char *srcbuffs[], unsigned char *out, + uint32 cols, uint32 rows, uint32 imagewidth, + uint32 tw, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int i, bytes_per_sample; + uint32 row, col, col_offset, src_rowsize, dst_rowsize, src_offset; + unsigned char *src; + unsigned char *dst; + tsample_t s; + + src = srcbuffs[0]; + dst = out; + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateTileSamplesBytes","Invalid buffer address"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + src_rowsize = ((bps * tw) + 7) / 8; + dst_rowsize = imagewidth * bytes_per_sample * spp; + for (row = 0; row < rows; row++) + { + if ((dumpfile != NULL) && (level == 2)) + { + for (s = 0; s < spp; s++) + { + dump_info (dumpfile, format, "combineSeparateTileSamplesBytes","Input data, Sample %d", s); + dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize)); + } + } + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; +#ifdef DEVELMODE + TIFFError("","Tile row %4d, Src offset %6d Dst offset %6d", + row, src_offset, dst - out); +#endif + for (col = 0; col < cols; col++) + { + col_offset = src_offset + (col * (bps / 8)); + for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + src = srcbuffs[s] + col_offset; + for (i = 0; i < bytes_per_sample; i++) + *(dst + i) = *(src + i); + dst += bytes_per_sample; + } + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateTileSamplesBytes","Output data, combined samples"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateTileSamplesBytes */ + +static int +combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint32 imagewidth, + uint32 tw, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0; + uint32 src_rowsize, dst_rowsize, src_offset; + uint32 bit_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint8 maskbits = 0, matchbits = 0; + uint8 buff1 = 0, buff2 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[32]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateTileSamples8bits","Invalid input or output buffer"); + return (1); + } + + src_rowsize = ((bps * tw) + 7) / 8; + dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; + maskbits = (uint8)-1 >> ( 8 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (8 - src_bit - bps); + /* load up next sample from each plane */ + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + buff1 = ((*src) & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + *dst++ = buff2; + buff2 = buff1; + ready_bits -= 8; + strcpy (action, "Flush"); + } + else + { + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Match bits", matchbits); + dump_byte (dumpfile, format, "Src bits", *src); + dump_byte (dumpfile, format, "Buff1 bits", buff1); + dump_byte (dumpfile, format, "Buff2 bits", buff2); + dump_info (dumpfile, format, "","%s", action); + } + } + } + + if (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Final bits", buff1); + } + } + + if ((dumpfile != NULL) && (level >= 2)) + { + dump_info (dumpfile, format, "combineSeparateTileSamples8bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateTileSamples8bits */ + +static int +combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint32 imagewidth, + uint32 tw, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0; + uint32 src_rowsize, dst_rowsize; + uint32 bit_offset, src_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint16 maskbits = 0, matchbits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateTileSamples16bits","Invalid input or output buffer"); + return (1); + } + + src_rowsize = ((bps * tw) + 7) / 8; + dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; + maskbits = (uint16)-1 >> (16 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (16 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + buff1 = (src[0] << 8) | src[1]; + else + buff1 = (src[1] << 8) | src[0]; + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + + dump_short (dumpfile, format, "Match bits", matchbits); + dump_data (dumpfile, format, "Src bits", src, 2); + dump_short (dumpfile, format, "Buff1 bits", buff1); + dump_short (dumpfile, format, "Buff2 bits", buff2); + dump_byte (dumpfile, format, "Write byte", bytebuff); + dump_info (dumpfile, format, "","Ready bits: %d, %s", ready_bits, action); + } + } + } + + /* catch any trailing bits at the end of the line */ + if (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + dump_byte (dumpfile, format, "Final bits", bytebuff); + } + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateTileSamples16bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateTileSamples16bits */ + +static int +combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint32 imagewidth, + uint32 tw, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0; + uint32 src_rowsize, dst_rowsize; + uint32 bit_offset, src_offset; + uint32 row, col, src_byte = 0, src_bit = 0; + uint32 maskbits = 0, matchbits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateTileSamples24bits","Invalid input or output buffer"); + return (1); + } + + src_rowsize = ((bps * tw) + 7) / 8; + dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; + maskbits = (uint32)-1 >> ( 32 - bps); + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (32 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + else + buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 16) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "","Ready bits: %d, %s", ready_bits, action); + } + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits); + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateTileSamples24bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); + } + } + + return (0); + } /* end combineSeparateTileSamples24bits */ + +static int +combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols, + uint32 rows, uint32 imagewidth, + uint32 tw, uint16 spp, uint16 bps, + FILE *dumpfile, int format, int level) + { + int ready_bits = 0, shift_width = 0; + uint32 src_rowsize, dst_rowsize, bit_offset, src_offset; + uint32 src_byte = 0, src_bit = 0; + uint32 row, col; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 maskbits = 0, matchbits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + tsample_t s; + unsigned char *src = in[0]; + unsigned char *dst = out; + char action[8]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("combineSeparateTileSamples32bits","Invalid input or output buffer"); + return (1); + } + + src_rowsize = ((bps * tw) + 7) / 8; + dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; + maskbits = (uint64)-1 >> ( 64 - bps); + shift_width = ((bps + 7) / 8) + 1; + + for (row = 0; row < rows; row++) + { + ready_bits = 0; + buff1 = buff2 = 0; + dst = out + (row * dst_rowsize); + src_offset = row * src_rowsize; + for (col = 0; col < cols; col++) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = col * bps; + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + + matchbits = maskbits << (64 - src_bit - bps); + for (s = 0; s < spp; s++) + { + src = in[s] + src_offset + src_byte; + if (little_endian) + { + longbuff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + longbuff2 = longbuff1; + } + + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + buff1 = (buff3 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 32) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + strcpy (action, "Flush"); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + strcpy (action, "Update"); + } + ready_bits += bps; + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Sample %d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, s, src_byte, src_bit, dst - out); + dump_wide (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 8); + dump_wide (dumpfile, format, "Buff1 bits ", buff1); + dump_wide (dumpfile, format, "Buff2 bits ", buff2); + dump_info (dumpfile, format, "", "Ready bits: %d, %s", ready_bits, action); + } + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + if ((dumpfile != NULL) && (level == 3)) + { + dump_info (dumpfile, format, "", + "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", + row + 1, col + 1, src_byte, src_bit, dst - out); + + dump_long (dumpfile, format, "Match bits ", matchbits); + dump_data (dumpfile, format, "Src bits ", src, 4); + dump_long (dumpfile, format, "Buff1 bits ", buff1); + dump_long (dumpfile, format, "Buff2 bits ", buff2); + dump_byte (dumpfile, format, "Write bits1", bytebuff1); + dump_byte (dumpfile, format, "Write bits2", bytebuff2); + dump_info (dumpfile, format, "", "Ready bits: %2d", ready_bits); + } + + if ((dumpfile != NULL) && (level == 2)) + { + dump_info (dumpfile, format, "combineSeparateTileSamples32bits","Output data"); + dump_buffer(dumpfile, format, 1, dst_rowsize, row, out); + } + } + + return (0); + } /* end combineSeparateTileSamples32bits */ + + +static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length, + uint32 width, uint16 spp, + struct dump_opts *dump) + { + int i, j, bytes_per_sample, bytes_per_pixel, shift_width, result = 1; + int32 bytes_read = 0; + uint16 bps, nstrips, planar, strips_per_sample; + uint32 src_rowsize, dst_rowsize, rows_processed, rps; + uint32 rows_this_strip = 0; + tsample_t s; + tstrip_t strip; + tsize_t scanlinesize = TIFFScanlineSize(in); + tsize_t stripsize = TIFFStripSize(in); + unsigned char *srcbuffs[MAX_SAMPLES]; + unsigned char *buff = NULL; + unsigned char *dst = NULL; + + if (obuf == NULL) + { + TIFFError("readSeparateStripsIntoBuffer","Invalid buffer argument"); + return (0); + } + + memset (srcbuffs, '\0', sizeof(srcbuffs)); + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps); + TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &planar); + TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps); + if (rps > length) + rps = length; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + src_rowsize = ((bps * width) + 7) / 8; + dst_rowsize = ((bps * width * spp) + 7) / 8; + dst = obuf; + + if ((dump->infile != NULL) && (dump->level == 3)) + { + dump_info (dump->infile, dump->format, "", + "Image width %d, length %d, Scanline size, %4d bytes", + width, length, scanlinesize); + dump_info (dump->infile, dump->format, "", + "Bits per sample %d, Samples per pixel %d, Shift width %d", + bps, spp, shift_width); + } + + /* Libtiff seems to assume/require that data for separate planes are + * written one complete plane after another and not interleaved in any way. + * Multiple scanlines and possibly strips of the same plane must be + * written before data for any other plane. + */ + nstrips = TIFFNumberOfStrips(in); + strips_per_sample = nstrips /spp; + + for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + srcbuffs[s] = NULL; + buff = _TIFFmalloc(stripsize); + if (!buff) + { + TIFFError ("readSeparateStripsIntoBuffer", + "Unable to allocate strip read buffer for sample %d", s); + for (i = 0; i < s; i++) + _TIFFfree (srcbuffs[i]); + return 0; + } + srcbuffs[s] = buff; + } + + rows_processed = 0; + for (j = 0; (j < strips_per_sample) && (result == 1); j++) + { + for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + buff = srcbuffs[s]; + strip = (s * strips_per_sample) + j; + bytes_read = TIFFReadEncodedStrip (in, strip, buff, stripsize); + rows_this_strip = bytes_read / src_rowsize; + if (bytes_read < 0 && !ignore) + { + TIFFError(TIFFFileName(in), + "Error, can't read strip %lu for sample %d", + (unsigned long) strip, s + 1); + result = 0; + break; + } +#ifdef DEVELMODE + TIFFError("", "Strip %2d, read %5d bytes for %4d scanlines, shift width %d", + strip, bytes_read, rows_this_strip, shift_width); +#endif + } + + if (rps > rows_this_strip) + rps = rows_this_strip; + dst = obuf + (dst_rowsize * rows_processed); + if ((bps % 8) == 0) + { + if (combineSeparateSamplesBytes (srcbuffs, dst, width, rps, + spp, bps, dump->infile, + dump->format, dump->level)) + { + result = 0; + break; + } + } + else + { + switch (shift_width) + { + case 1: if (combineSeparateSamples8bits (srcbuffs, dst, width, rps, + spp, bps, dump->infile, + dump->format, dump->level)) + { + result = 0; + break; + } + break; + case 2: if (combineSeparateSamples16bits (srcbuffs, dst, width, rps, + spp, bps, dump->infile, + dump->format, dump->level)) + { + result = 0; + break; + } + break; + case 3: if (combineSeparateSamples24bits (srcbuffs, dst, width, rps, + spp, bps, dump->infile, + dump->format, dump->level)) + { + result = 0; + break; + } + break; + case 4: + case 5: + case 6: + case 7: + case 8: if (combineSeparateSamples32bits (srcbuffs, dst, width, rps, + spp, bps, dump->infile, + dump->format, dump->level)) + { + result = 0; + break; + } + break; + default: TIFFError ("readSeparateStripsIntoBuffer", "Unsupported bit depth: %d", bps); + result = 0; + break; + } + } + + if ((rows_processed + rps) > length) + { + rows_processed = length; + rps = length - rows_processed; + } + else + rows_processed += rps; + } + + /* free any buffers allocated for each plane or scanline and + * any temporary buffers + */ + for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + buff = srcbuffs[s]; + if (buff != NULL) + _TIFFfree(buff); + } + + return (result); + } /* end readSeparateStripsIntoBuffer */ + +static int +get_page_geometry (char *name, struct pagedef *page) + { + char *ptr; + int n; + + for (ptr = name; *ptr; ptr++) + *ptr = (char)tolower((int)*ptr); + + for (n = 0; n < MAX_PAPERNAMES; n++) + { + if (strcmp(name, PaperTable[n].name) == 0) + { + page->width = PaperTable[n].width; + page->length = PaperTable[n].length; + strncpy (page->name, PaperTable[n].name, 15); + page->name[15] = '\0'; + return (0); + } + } + + return (1); + } + + +static void +initPageSetup (struct pagedef *page, struct pageseg *pagelist, + struct buffinfo seg_buffs[]) + { + int i; + + strcpy (page->name, ""); + page->mode = PAGE_MODE_NONE; + page->res_unit = RESUNIT_NONE; + page->hres = 0.0; + page->vres = 0.0; + page->width = 0.0; + page->length = 0.0; + page->hmargin = 0.0; + page->vmargin = 0.0; + page->rows = 0; + page->cols = 0; + page->orient = ORIENTATION_NONE; + + for (i = 0; i < MAX_SECTIONS; i++) + { + pagelist[i].x1 = (uint32)0; + pagelist[i].x2 = (uint32)0; + pagelist[i].y1 = (uint32)0; + pagelist[i].y2 = (uint32)0; + pagelist[i].buffsize = (uint32)0; + pagelist[i].position = 0; + pagelist[i].total = 0; + } + + for (i = 0; i < MAX_OUTBUFFS; i++) + { + seg_buffs[i].size = 0; + seg_buffs[i].buffer = NULL; + } + } + +static void +initImageData (struct image_data *image) + { + image->xres = 0.0; + image->yres = 0.0; + image->width = 0; + image->length = 0; + image->res_unit = RESUNIT_NONE; + image->bps = 0; + image->spp = 0; + image->planar = 0; + image->photometric = 0; + image->orientation = 0; + image->compression = COMPRESSION_NONE; + image->adjustments = 0; + } + +static void +initCropMasks (struct crop_mask *cps) + { + int i; + + cps->crop_mode = CROP_NONE; + cps->res_unit = RESUNIT_NONE; + cps->edge_ref = EDGE_TOP; + cps->width = 0; + cps->length = 0; + for (i = 0; i < 4; i++) + cps->margins[i] = 0.0; + cps->bufftotal = (uint32)0; + cps->combined_width = (uint32)0; + cps->combined_length = (uint32)0; + cps->rotation = (uint16)0; + cps->photometric = INVERT_DATA_AND_TAG; + cps->mirror = (uint16)0; + cps->invert = (uint16)0; + cps->zones = (uint32)0; + cps->regions = (uint32)0; + for (i = 0; i < MAX_REGIONS; i++) + { + cps->corners[i].X1 = 0.0; + cps->corners[i].X2 = 0.0; + cps->corners[i].Y1 = 0.0; + cps->corners[i].Y2 = 0.0; + cps->regionlist[i].x1 = 0; + cps->regionlist[i].x2 = 0; + cps->regionlist[i].y1 = 0; + cps->regionlist[i].y2 = 0; + cps->regionlist[i].width = 0; + cps->regionlist[i].length = 0; + cps->regionlist[i].buffsize = 0; + cps->regionlist[i].buffptr = NULL; + cps->zonelist[i].position = 0; + cps->zonelist[i].total = 0; + } + cps->exp_mode = ONE_FILE_COMPOSITE; + cps->img_mode = COMPOSITE_IMAGES; + } + +static void initDumpOptions(struct dump_opts *dump) + { + dump->debug = 0; + dump->format = DUMP_NONE; + dump->level = 1; + sprintf (dump->mode, "w"); + memset (dump->infilename, '\0', PATH_MAX + 1); + memset (dump->outfilename, '\0',PATH_MAX + 1); + dump->infile = NULL; + dump->outfile = NULL; + } + +/* Compute pixel offsets into the image for margins and fixed regions */ +static int +computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image, + struct offset *off) + { + double scale; + float xres, yres; + /* Values for these offsets are in pixels from start of image, not bytes, + * and are indexed from zero to width - 1 or length - 1 */ + uint32 tmargin, bmargin, lmargin, rmargin; + uint32 startx, endx; /* offsets of first and last columns to extract */ + uint32 starty, endy; /* offsets of first and last row to extract */ + uint32 width, length, crop_width, crop_length; + uint32 i, max_width, max_length, zwidth, zlength, buffsize; + uint32 x1, x2, y1, y2; + + if (image->res_unit != RESUNIT_INCH && image->res_unit != RESUNIT_CENTIMETER) + { + xres = 1.0; + yres = 1.0; + } + else + { + if (((image->xres == 0) || (image->yres == 0)) && + (crop->res_unit != RESUNIT_NONE) && + ((crop->crop_mode & CROP_REGIONS) || (crop->crop_mode & CROP_MARGINS) || + (crop->crop_mode & CROP_LENGTH) || (crop->crop_mode & CROP_WIDTH))) + { + TIFFError("computeInputPixelOffsets", "Cannot compute margins or fixed size sections without image resolution"); + TIFFError("computeInputPixelOffsets", "Specify units in pixels and try again"); + return (-1); + } + xres = image->xres; + yres = image->yres; + } + + /* Translate user units to image units */ + scale = 1.0; + switch (crop->res_unit) { + case RESUNIT_CENTIMETER: + if (image->res_unit == RESUNIT_INCH) + scale = 1.0/2.54; + break; + case RESUNIT_INCH: + if (image->res_unit == RESUNIT_CENTIMETER) + scale = 2.54; + break; + case RESUNIT_NONE: /* Dimensions in pixels */ + default: + break; + } + + if (crop->crop_mode & CROP_REGIONS) + { + max_width = max_length = 0; + for (i = 0; i < crop->regions; i++) + { + if ((crop->res_unit == RESUNIT_INCH) || (crop->res_unit == RESUNIT_CENTIMETER)) + { + x1 = (uint32) (crop->corners[i].X1 * scale * xres); + x2 = (uint32) (crop->corners[i].X2 * scale * xres); + y1 = (uint32) (crop->corners[i].Y1 * scale * yres); + y2 = (uint32) (crop->corners[i].Y2 * scale * yres); + } + else + { + x1 = (uint32) (crop->corners[i].X1); + x2 = (uint32) (crop->corners[i].X2); + y1 = (uint32) (crop->corners[i].Y1); + y2 = (uint32) (crop->corners[i].Y2); + } + if (x1 < 1) + crop->regionlist[i].x1 = 0; + else + crop->regionlist[i].x1 = (uint32) (x1 - 1); + + if (x2 > image->width - 1) + crop->regionlist[i].x2 = image->width - 1; + else + crop->regionlist[i].x2 = (uint32) (x2 - 1); + zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1; + + if (y1 < 1) + crop->regionlist[i].y1 = 0; + else + crop->regionlist[i].y1 = (uint32) (y1 - 1); + + if (y2 > image->length - 1) + crop->regionlist[i].y2 = image->length - 1; + else + crop->regionlist[i].y2 = (uint32) (y2 - 1); + + zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; + + if (zwidth > max_width) + max_width = zwidth; + if (zlength > max_length) + max_length = zlength; + + buffsize = (uint32) + (((zwidth * image->bps * image->spp + 7 ) / 8) * (zlength + 1)); + + crop->regionlist[i].buffsize = buffsize; + crop->bufftotal += buffsize; + if (crop->img_mode == COMPOSITE_IMAGES) + { + switch (crop->edge_ref) + { + case EDGE_LEFT: + case EDGE_RIGHT: + crop->combined_length = zlength; + crop->combined_width += zwidth; + break; + case EDGE_BOTTOM: + case EDGE_TOP: /* width from left, length from top */ + default: + crop->combined_width = zwidth; + crop->combined_length += zlength; + break; + } + } + } + return (0); + } + + /* Convert crop margins into offsets into image + * Margins are expressed as pixel rows and columns, not bytes + */ + if (crop->crop_mode & CROP_MARGINS) + { + if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER) + { /* User has specified pixels as reference unit */ + tmargin = (uint32)(crop->margins[0]); + lmargin = (uint32)(crop->margins[1]); + bmargin = (uint32)(crop->margins[2]); + rmargin = (uint32)(crop->margins[3]); + } + else + { /* inches or centimeters specified */ + tmargin = (uint32)(crop->margins[0] * scale * yres); + lmargin = (uint32)(crop->margins[1] * scale * xres); + bmargin = (uint32)(crop->margins[2] * scale * yres); + rmargin = (uint32)(crop->margins[3] * scale * xres); + } + + if ((lmargin + rmargin) > image->width) + { + TIFFError("computeInputPixelOffsets", "Combined left and right margins exceed image width"); + lmargin = (uint32) 0; + rmargin = (uint32) 0; + return (-1); + } + if ((tmargin + bmargin) > image->length) + { + TIFFError("computeInputPixelOffsets", "Combined top and bottom margins exceed image length"); + tmargin = (uint32) 0; + bmargin = (uint32) 0; + return (-1); + } + } + else + { /* no margins requested */ + tmargin = (uint32) 0; + lmargin = (uint32) 0; + bmargin = (uint32) 0; + rmargin = (uint32) 0; + } + + /* Width, height, and margins are expressed as pixel offsets into image */ + if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER) + { + if (crop->crop_mode & CROP_WIDTH) + width = (uint32)crop->width; + else + width = image->width - lmargin - rmargin; + + if (crop->crop_mode & CROP_LENGTH) + length = (uint32)crop->length; + else + length = image->length - tmargin - bmargin; + } + else + { + if (crop->crop_mode & CROP_WIDTH) + width = (uint32)(crop->width * scale * image->xres); + else + width = image->width - lmargin - rmargin; + + if (crop->crop_mode & CROP_LENGTH) + length = (uint32)(crop->length * scale * image->yres); + else + length = image->length - tmargin - bmargin; + } + + off->tmargin = tmargin; + off->bmargin = bmargin; + off->lmargin = lmargin; + off->rmargin = rmargin; + + /* Calculate regions defined by margins, width, and length. + * Coordinates expressed as 0 to imagewidth - 1, imagelength - 1, + * since they are used to compute offsets into buffers */ + switch (crop->edge_ref) { + case EDGE_BOTTOM: + startx = lmargin; + if ((startx + width) >= (image->width - rmargin)) + endx = image->width - rmargin - 1; + else + endx = startx + width - 1; + + endy = image->length - bmargin - 1; + if ((endy - length) <= tmargin) + starty = tmargin; + else + starty = endy - length + 1; + break; + case EDGE_RIGHT: + endx = image->width - rmargin - 1; + if ((endx - width) <= lmargin) + startx = lmargin; + else + startx = endx - width + 1; + + starty = tmargin; + if ((starty + length) >= (image->length - bmargin)) + endy = image->length - bmargin - 1; + else + endy = starty + length - 1; + break; + case EDGE_TOP: /* width from left, length from top */ + case EDGE_LEFT: + default: + startx = lmargin; + if ((startx + width) >= (image->width - rmargin)) + endx = image->width - rmargin - 1; + else + endx = startx + width - 1; + + starty = tmargin; + if ((starty + length) >= (image->length - bmargin)) + endy = image->length - bmargin - 1; + else + endy = starty + length - 1; + break; + } + off->startx = startx; + off->starty = starty; + off->endx = endx; + off->endy = endy; + + crop_width = endx - startx + 1; + crop_length = endy - starty + 1; + + if (crop_width <= 0) + { + TIFFError("computeInputPixelOffsets", + "Invalid left/right margins and /or image crop width requested"); + return (-1); + } + if (crop_width > image->width) + crop_width = image->width; + + if (crop_length <= 0) + { + TIFFError("computeInputPixelOffsets", + "Invalid top/bottom margins and /or image crop length requested"); + return (-1); + } + if (crop_length > image->length) + crop_length = image->length; + + off->crop_width = crop_width; + off->crop_length = crop_length; + + return (0); + } /* end computeInputPixelOffsets */ + +/* + * Translate crop options into pixel offsets for one or more regions of the image. + * Options are applied in this order: margins, specific width and length, zones, + * but all are optional. Margins are relative to each edge. Width, length and + * zones are relative to the specified reference edge. Zones are expressed as + * X:Y where X is the ordinal value in a set of Y equal sized portions. eg. + * 2:3 would indicate the middle third of the region qualified by margins and + * any explicit width and length specified. Regions are specified by coordinates + * of the top left and lower right corners with range 1 to width or height. + */ + +static int +getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opts *dump) + { + struct offset offsets; + int i; + int32 test; + uint32 seg, total, need_buff = 0; + uint32 buffsize; + uint32 zwidth, zlength; + + memset(&offsets, '\0', sizeof(struct offset)); + crop->bufftotal = 0; + crop->combined_width = (uint32)0; + crop->combined_length = (uint32)0; + crop->selections = 0; + + /* Compute pixel offsets if margins or fixed width or length specified */ + if ((crop->crop_mode & CROP_MARGINS) || + (crop->crop_mode & CROP_REGIONS) || + (crop->crop_mode & CROP_LENGTH) || + (crop->crop_mode & CROP_WIDTH)) + { + if (computeInputPixelOffsets(crop, image, &offsets)) + { + TIFFError ("getCropOffsets", "Unable to compute crop margins"); + return (-1); + } + need_buff = TRUE; + crop->selections = crop->regions; + /* Regions are only calculated from top and left edges with no margins */ + if (crop->crop_mode & CROP_REGIONS) + return (0); + } + else + { /* cropped area is the full image */ + offsets.tmargin = 0; + offsets.lmargin = 0; + offsets.bmargin = 0; + offsets.rmargin = 0; + offsets.crop_width = image->width; + offsets.crop_length = image->length; + offsets.startx = 0; + offsets.endx = image->width - 1; + offsets.starty = 0; + offsets.endy = image->length - 1; + need_buff = FALSE; + } + + if (dump->outfile != NULL) + { + dump_info (dump->outfile, dump->format, "", "Margins: Top: %d Left: %d Bottom: %d Right: %d", + offsets.tmargin, offsets.lmargin, offsets.bmargin, offsets.rmargin); + dump_info (dump->outfile, dump->format, "", "Crop region within margins: Adjusted Width: %6d Length: %6d", + offsets.crop_width, offsets.crop_length); + } + + if (!(crop->crop_mode & CROP_ZONES)) /* no crop zones requested */ + { + if (need_buff == FALSE) /* No margins or fixed width or length areas */ + { + crop->selections = 0; + crop->combined_width = image->width; + crop->combined_length = image->length; + return (0); + } + else + { + /* Use one region for margins and fixed width or length areas + * even though it was not formally declared as a region. + */ + crop->selections = 1; + crop->zones = 1; + crop->zonelist[0].total = 1; + crop->zonelist[0].position = 1; + } + } + else + crop->selections = crop->zones; + + for (i = 0; i < crop->zones; i++) + { + seg = crop->zonelist[i].position; + total = crop->zonelist[i].total; + + switch (crop->edge_ref) + { + case EDGE_LEFT: /* zones from left to right, length from top */ + zlength = offsets.crop_length; + crop->regionlist[i].y1 = offsets.starty; + crop->regionlist[i].y2 = offsets.endy; + + crop->regionlist[i].x1 = offsets.startx + + (uint32)(offsets.crop_width * 1.0 * (seg - 1) / total); + test = (int32)offsets.startx + + (int32)(offsets.crop_width * 1.0 * seg / total); + if (test < 1 ) + crop->regionlist[i].x2 = 0; + else + { + if (test > (int32)(image->width - 1)) + crop->regionlist[i].x2 = image->width - 1; + else + crop->regionlist[i].x2 = test - 1; + } + zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1; + + /* This is passed to extractCropZone or extractCompositeZones */ + crop->combined_length = (uint32)zlength; + if (crop->exp_mode == COMPOSITE_IMAGES) + crop->combined_width += (uint32)zwidth; + else + crop->combined_width = (uint32)zwidth; + break; + case EDGE_BOTTOM: /* width from left, zones from bottom to top */ + zwidth = offsets.crop_width; + crop->regionlist[i].x1 = offsets.startx; + crop->regionlist[i].x2 = offsets.endx; + + test = offsets.endy - (uint32)(offsets.crop_length * 1.0 * seg / total); + if (test < 1 ) + crop->regionlist[i].y1 = 0; + else + crop->regionlist[i].y1 = test + 1; + + test = offsets.endy - (offsets.crop_length * 1.0 * (seg - 1) / total); + if (test < 1 ) + crop->regionlist[i].y2 = 0; + else + { + if (test > (int32)(image->length - 1)) + crop->regionlist[i].y2 = image->length - 1; + else + crop->regionlist[i].y2 = test; + } + zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; + + /* This is passed to extractCropZone or extractCompositeZones */ + if (crop->exp_mode == COMPOSITE_IMAGES) + crop->combined_length += (uint32)zlength; + else + crop->combined_length = (uint32)zlength; + crop->combined_width = (uint32)zwidth; + break; + case EDGE_RIGHT: /* zones from right to left, length from top */ + zlength = offsets.crop_length; + crop->regionlist[i].y1 = offsets.starty; + crop->regionlist[i].y2 = offsets.endy; + + crop->regionlist[i].x1 = offsets.startx + + (uint32)(offsets.crop_width * (total - seg) * 1.0 / total); + test = offsets.startx + + (offsets.crop_width * (total - seg + 1) * 1.0 / total); + if (test < 1 ) + crop->regionlist[i].x2 = 0; + else + { + if (test > (int32)(image->width - 1)) + crop->regionlist[i].x2 = image->width - 1; + else + crop->regionlist[i].x2 = test - 1; + } + zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1; + + /* This is passed to extractCropZone or extractCompositeZones */ + crop->combined_length = (uint32)zlength; + if (crop->exp_mode == COMPOSITE_IMAGES) + crop->combined_width += (uint32)zwidth; + else + crop->combined_width = (uint32)zwidth; + break; + case EDGE_TOP: /* width from left, zones from top to bottom */ + default: + zwidth = offsets.crop_width; + crop->regionlist[i].x1 = offsets.startx; + crop->regionlist[i].x2 = offsets.endx; + + crop->regionlist[i].y1 = offsets.starty + (uint32)(offsets.crop_length * 1.0 * (seg - 1) / total); + test = offsets.starty + (uint32)(offsets.crop_length * 1.0 * seg / total); + if (test < 1 ) + crop->regionlist[i].y2 = 0; + else + { + if (test > (int32)(image->length - 1)) + crop->regionlist[i].y2 = image->length - 1; + else + crop->regionlist[i].y2 = test - 1; + } + zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; + + /* This is passed to extractCropZone or extractCompositeZones */ + if (crop->exp_mode == COMPOSITE_IMAGES) + crop->combined_length += (uint32)zlength; + else + crop->combined_length = (uint32)zlength; + crop->combined_width = (uint32)zwidth; + break; + } /* end switch statement */ + + buffsize = (uint32) + ((((zwidth * image->bps * image->spp) + 7 ) / 8) * (zlength + 1)); + crop->regionlist[i].width = (uint32) zwidth; + crop->regionlist[i].length = (uint32) zlength; + crop->regionlist[i].buffsize = buffsize; + crop->bufftotal += buffsize; + + + if (dump->outfile != NULL) + dump_info (dump->outfile, dump->format, "", "Zone %d, width: %4d, length: %4d, x1: %4d x2: %4d y1: %4d y2: %4d", + i + 1, (uint32)zwidth, (uint32)zlength, + crop->regionlist[i].x1, crop->regionlist[i].x2, + crop->regionlist[i].y1, crop->regionlist[i].y2); + } + + return (0); + } /* end getCropOffsets */ + + +static int +computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image, + struct pagedef *page, struct pageseg *sections, + struct dump_opts* dump) + { + double scale; + double pwidth, plength; /* Output page width and length in user units*/ + uint32 iwidth, ilength; /* Input image width and length in pixels*/ + uint32 owidth, olength; /* Output image width and length in pixels*/ + uint32 orows, ocols; /* rows and cols for output */ + uint32 hmargin, vmargin; /* Horizontal and vertical margins */ + uint32 x1, x2, y1, y2, line_bytes; + unsigned int orientation; + uint32 i, j, k; + + scale = 1.0; + if (page->res_unit == RESUNIT_NONE) + page->res_unit = image->res_unit; + + switch (image->res_unit) { + case RESUNIT_CENTIMETER: + if (page->res_unit == RESUNIT_INCH) + scale = 1.0/2.54; + break; + case RESUNIT_INCH: + if (page->res_unit == RESUNIT_CENTIMETER) + scale = 2.54; + break; + case RESUNIT_NONE: /* Dimensions in pixels */ + default: + break; + } + + /* get width, height, resolutions of input image selection */ + if (crop->combined_width > 0) + iwidth = crop->combined_width; + else + iwidth = image->width; + if (crop->combined_length > 0) + ilength = crop->combined_length; + else + ilength = image->length; + + if (page->hres <= 1.0) + page->hres = image->xres; + if (page->vres <= 1.0) + page->vres = image->yres; + + if ((page->hres < 1.0) || (page->vres < 1.0)) + { + TIFFError("computeOutputPixelOffsets", + "Invalid horizontal or vertical resolution specified or read from input image"); + return (1); + } + + /* If no page sizes are being specified, we just use the input image size to + * calculate maximum margins that can be taken from image. + */ + if (page->width <= 0) + pwidth = iwidth; + else + pwidth = page->width; + + if (page->length <= 0) + plength = ilength; + else + plength = page->length; + + if (dump->debug) + { + TIFFError("", "Page size: %s, Vres: %3.2f, Hres: %3.2f, " + "Hmargin: %3.2f, Vmargin: %3.2f", + page->name, page->vres, page->hres, + page->hmargin, page->vmargin); + TIFFError("", "Res_unit: %d, Scale: %3.2f, Page width: %3.2f, length: %3.2f", + page->res_unit, scale, pwidth, plength); + } + + /* compute margins at specified unit and resolution */ + if (page->mode & PAGE_MODE_MARGINS) + { + if (page->res_unit == RESUNIT_INCH || page->res_unit == RESUNIT_CENTIMETER) + { /* inches or centimeters specified */ + hmargin = (uint32)(page->hmargin * scale * page->hres * ((image->bps + 7)/ 8)); + vmargin = (uint32)(page->vmargin * scale * page->vres * ((image->bps + 7)/ 8)); + } + else + { /* Otherwise user has specified pixels as reference unit */ + hmargin = (uint32)(page->hmargin * scale * ((image->bps + 7)/ 8)); + vmargin = (uint32)(page->vmargin * scale * ((image->bps + 7)/ 8)); + } + + if ((hmargin * 2.0) > (pwidth * page->hres)) + { + TIFFError("computeOutputPixelOffsets", + "Combined left and right margins exceed page width"); + hmargin = (uint32) 0; + return (-1); + } + if ((vmargin * 2.0) > (plength * page->vres)) + { + TIFFError("computeOutputPixelOffsets", + "Combined top and bottom margins exceed page length"); + vmargin = (uint32) 0; + return (-1); + } + } + else + { + hmargin = 0; + vmargin = 0; + } + + if (page->mode & PAGE_MODE_ROWSCOLS ) + { + /* Maybe someday but not for now */ + if (page->mode & PAGE_MODE_MARGINS) + TIFFError("computeOutputPixelOffsets", + "Output margins cannot be specified with rows and columns"); + + owidth = TIFFhowmany(iwidth, page->cols); + olength = TIFFhowmany(ilength, page->rows); + } + else + { + if (page->mode & PAGE_MODE_PAPERSIZE ) + { + owidth = (uint32)((pwidth * page->hres) - (hmargin * 2)); + olength = (uint32)((plength * page->vres) - (vmargin * 2)); + } + else + { + owidth = (uint32)(iwidth - (hmargin * 2 * page->hres)); + olength = (uint32)(ilength - (vmargin * 2 * page->vres)); + } + } + + if (owidth > iwidth) + owidth = iwidth; + if (olength > ilength) + olength = ilength; + + /* Compute the number of pages required for Portrait or Landscape */ + switch (page->orient) + { + case ORIENTATION_NONE: + case ORIENTATION_PORTRAIT: + ocols = TIFFhowmany(iwidth, owidth); + orows = TIFFhowmany(ilength, olength); + orientation = ORIENTATION_PORTRAIT; + break; + + case ORIENTATION_LANDSCAPE: + ocols = TIFFhowmany(iwidth, olength); + orows = TIFFhowmany(ilength, owidth); + x1 = olength; + olength = owidth; + owidth = x1; + orientation = ORIENTATION_LANDSCAPE; + break; + + case ORIENTATION_AUTO: + default: + x1 = TIFFhowmany(iwidth, owidth); + x2 = TIFFhowmany(ilength, olength); + y1 = TIFFhowmany(iwidth, olength); + y2 = TIFFhowmany(ilength, owidth); + + if ( (x1 * x2) < (y1 * y2)) + { /* Portrait */ + ocols = x1; + orows = x2; + orientation = ORIENTATION_PORTRAIT; + } + else + { /* Landscape */ + ocols = y1; + orows = y2; + x1 = olength; + olength = owidth; + owidth = x1; + orientation = ORIENTATION_LANDSCAPE; + } + } + + if (ocols < 1) + ocols = 1; + if (orows < 1) + orows = 1; + + /* If user did not specify rows and cols, set them from calcuation */ + if (page->rows < 1) + page->rows = orows; + if (page->cols < 1) + page->cols = ocols; + + line_bytes = TIFFhowmany8(owidth * image->bps) * image->spp; + + if ((page->rows * page->cols) > MAX_SECTIONS) + { + TIFFError("computeOutputPixelOffsets", + "Rows and Columns exceed maximum sections\nIncrease resolution or reduce sections"); + return (-1); + } + + /* build the list of offsets for each output section */ + for (k = 0, i = 0 && k <= MAX_SECTIONS; i < orows; i++) + { + y1 = (uint32)(olength * i); + y2 = (uint32)(olength * (i + 1) - 1); + if (y2 >= ilength) + y2 = ilength - 1; + for (j = 0; j < ocols; j++, k++) + { + x1 = (uint32)(owidth * j); + x2 = (uint32)(owidth * (j + 1) - 1); + if (x2 >= iwidth) + x2 = iwidth - 1; + sections[k].x1 = x1; + sections[k].x2 = x2; + sections[k].y1 = y1; + sections[k].y2 = y2; + sections[k].buffsize = line_bytes * olength; + sections[k].position = k + 1; + sections[k].total = orows * ocols; + } + } + return (0); + } /* end computeOutputPixelOffsets */ + +static int +loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned char **read_ptr) + { + uint32 i; + float xres = 0.0, yres = 0.0; + uint16 nstrips = 0, ntiles = 0, planar = 0; + uint16 bps = 0, spp = 0, res_unit = 0; + uint16 orientation = 0; + uint16 input_compression = 0, input_photometric = 0; + uint16 subsampling_horiz, subsampling_vert; + uint32 width = 0, length = 0; + uint32 stsize = 0, tlsize = 0, buffsize = 0, scanlinesize = 0; + uint32 tw = 0, tl = 0; /* Tile width and length */ + uint32 tile_rowsize = 0; + unsigned char *read_buff = NULL; + unsigned char *new_buff = NULL; + int readunit = 0; + static uint32 prev_readsize = 0; + + TIFFGetFieldDefaulted(in, TIFFTAG_BITSPERSAMPLE, &bps); + TIFFGetFieldDefaulted(in, TIFFTAG_SAMPLESPERPIXEL, &spp); + TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &planar); + TIFFGetFieldDefaulted(in, TIFFTAG_ORIENTATION, &orientation); + if (! TIFFGetFieldDefaulted(in, TIFFTAG_PHOTOMETRIC, &input_photometric)) + TIFFError("loadImage","Image lacks Photometric interpreation tag"); + if (! TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width)) + TIFFError("loadimage","Image lacks image width tag"); + if(! TIFFGetField(in, TIFFTAG_IMAGELENGTH, &length)) + TIFFError("loadimage","Image lacks image length tag"); + TIFFGetFieldDefaulted(in, TIFFTAG_XRESOLUTION, &xres); + TIFFGetFieldDefaulted(in, TIFFTAG_YRESOLUTION, &yres); + if (!TIFFGetFieldDefaulted(in, TIFFTAG_RESOLUTIONUNIT, &res_unit)) + res_unit = RESUNIT_INCH; + if (!TIFFGetField(in, TIFFTAG_COMPRESSION, &input_compression)) + input_compression = COMPRESSION_NONE; + +#ifdef DEBUG2 + char compressionid[16]; + + switch (input_compression) + { + case COMPRESSION_NONE: /* 1 dump mode */ + strcpy (compressionid, "None/dump"); + break; + case COMPRESSION_CCITTRLE: /* 2 CCITT modified Huffman RLE */ + strcpy (compressionid, "Huffman RLE"); + break; + case COMPRESSION_CCITTFAX3: /* 3 CCITT Group 3 fax encoding */ + strcpy (compressionid, "Group3 Fax"); + break; + case COMPRESSION_CCITTFAX4: /* 4 CCITT Group 4 fax encoding */ + strcpy (compressionid, "Group4 Fax"); + break; + case COMPRESSION_LZW: /* 5 Lempel-Ziv & Welch */ + strcpy (compressionid, "LZW"); + break; + case COMPRESSION_OJPEG: /* 6 !6.0 JPEG */ + strcpy (compressionid, "Old Jpeg"); + break; + case COMPRESSION_JPEG: /* 7 %JPEG DCT compression */ + strcpy (compressionid, "New Jpeg"); + break; + case COMPRESSION_NEXT: /* 32766 NeXT 2-bit RLE */ + strcpy (compressionid, "Next RLE"); + break; + case COMPRESSION_CCITTRLEW: /* 32771 #1 w/ word alignment */ + strcpy (compressionid, "CITTRLEW"); + break; + case COMPRESSION_PACKBITS: /* 32773 Macintosh RLE */ + strcpy (compressionid, "Mac Packbits"); + break; + case COMPRESSION_THUNDERSCAN: /* 32809 ThunderScan RLE */ + strcpy (compressionid, "Thunderscan"); + break; + case COMPRESSION_IT8CTPAD: /* 32895 IT8 CT w/padding */ + strcpy (compressionid, "IT8 padded"); + break; + case COMPRESSION_IT8LW: /* 32896 IT8 Linework RLE */ + strcpy (compressionid, "IT8 RLE"); + break; + case COMPRESSION_IT8MP: /* 32897 IT8 Monochrome picture */ + strcpy (compressionid, "IT8 mono"); + break; + case COMPRESSION_IT8BL: /* 32898 IT8 Binary line art */ + strcpy (compressionid, "IT8 lineart"); + break; + case COMPRESSION_PIXARFILM: /* 32908 Pixar companded 10bit LZW */ + strcpy (compressionid, "Pixar 10 bit"); + break; + case COMPRESSION_PIXARLOG: /* 32909 Pixar companded 11bit ZIP */ + strcpy (compressionid, "Pixar 11bit"); + break; + case COMPRESSION_DEFLATE: /* 32946 Deflate compression */ + strcpy (compressionid, "Deflate"); + break; + case COMPRESSION_ADOBE_DEFLATE: /* 8 Deflate compression */ + strcpy (compressionid, "Adobe deflate"); + break; + default: + strcpy (compressionid, "None/unknown"); + break; + } + TIFFError("loadImage", "Input compression %s", compressionid); +#endif + + scanlinesize = TIFFScanlineSize(in); + image->bps = bps; + image->spp = spp; + image->planar = planar; + image->width = width; + image->length = length; + image->xres = xres; + image->yres = yres; + image->res_unit = res_unit; + image->compression = input_compression; + image->photometric = input_photometric; +#ifdef DEBUG2 + char photometricid[12]; + + switch (input_photometric) + { + case PHOTOMETRIC_MINISWHITE: + strcpy (photometricid, "MinIsWhite"); + break; + case PHOTOMETRIC_MINISBLACK: + strcpy (photometricid, "MinIsBlack"); + break; + case PHOTOMETRIC_RGB: + strcpy (photometricid, "RGB"); + break; + case PHOTOMETRIC_PALETTE: + strcpy (photometricid, "Palette"); + break; + case PHOTOMETRIC_MASK: + strcpy (photometricid, "Mask"); + break; + case PHOTOMETRIC_SEPARATED: + strcpy (photometricid, "Separated"); + break; + case PHOTOMETRIC_YCBCR: + strcpy (photometricid, "YCBCR"); + break; + case PHOTOMETRIC_CIELAB: + strcpy (photometricid, "CIELab"); + break; + case PHOTOMETRIC_ICCLAB: + strcpy (photometricid, "ICCLab"); + break; + case PHOTOMETRIC_ITULAB: + strcpy (photometricid, "ITULab"); + break; + case PHOTOMETRIC_LOGL: + strcpy (photometricid, "LogL"); + break; + case PHOTOMETRIC_LOGLUV: + strcpy (photometricid, "LOGLuv"); + break; + default: + strcpy (photometricid, "Unknown"); + break; + } + TIFFError("loadImage", "Input photometric interpretation %s", photometricid); + +#endif + image->orientation = orientation; + switch (orientation) + { + case 0: + case ORIENTATION_TOPLEFT: + image->adjustments = 0; + break; + case ORIENTATION_TOPRIGHT: + image->adjustments = MIRROR_HORIZ; + break; + case ORIENTATION_BOTRIGHT: + image->adjustments = ROTATECW_180; + break; + case ORIENTATION_BOTLEFT: + image->adjustments = MIRROR_VERT; + break; + case ORIENTATION_LEFTTOP: + image->adjustments = MIRROR_VERT | ROTATECW_90; + break; + case ORIENTATION_RIGHTTOP: + image->adjustments = ROTATECW_90; + break; + case ORIENTATION_RIGHTBOT: + image->adjustments = MIRROR_VERT | ROTATECW_270; + break; + case ORIENTATION_LEFTBOT: + image->adjustments = ROTATECW_270; + break; + default: + image->adjustments = 0; + image->orientation = ORIENTATION_TOPLEFT; + } + + if ((bps == 0) || (spp == 0)) + { + TIFFError("loadImage", "Invalid samples per pixel (%d) or bits per sample (%d)", + spp, bps); + return (-1); + } + + if (TIFFIsTiled(in)) + { + readunit = TILE; + tlsize = TIFFTileSize(in); + ntiles = TIFFNumberOfTiles(in); + TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(in, TIFFTAG_TILELENGTH, &tl); + + tile_rowsize = TIFFTileRowSize(in); + buffsize = tlsize * ntiles; + + + if (buffsize < (uint32)(ntiles * tl * tile_rowsize)) + { + buffsize = ntiles * tl * tile_rowsize; +#ifdef DEBUG2 + TIFFError("loadImage", + "Tilesize %u is too small, using ntiles * tilelength * tilerowsize %lu", + tlsize, (unsigned long)buffsize); +#endif + } + + if (dump->infile != NULL) + dump_info (dump->infile, dump->format, "", + "Tilesize: %u, Number of Tiles: %u, Tile row size: %u", + tlsize, ntiles, tile_rowsize); + } + else + { + readunit = STRIP; + TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + stsize = TIFFStripSize(in); + nstrips = TIFFNumberOfStrips(in); + buffsize = stsize * nstrips; + + if (buffsize < (uint32) (((length * width * spp * bps) + 7) / 8)) + { + buffsize = ((length * width * spp * bps) + 7) / 8; +#ifdef DEBUG2 + TIFFError("loadImage", + "Stripsize %u is too small, using imagelength * width * spp * bps / 8 = %lu", + stsize, (unsigned long)buffsize); +#endif + } + + if (dump->infile != NULL) + dump_info (dump->infile, dump->format, "", + "Stripsize: %u, Number of Strips: %u, Rows per Strip: %u, Scanline size: %u", + stsize, nstrips, rowsperstrip, scanlinesize); + } + + if (input_compression == COMPRESSION_JPEG) + { /* Force conversion to RGB */ + jpegcolormode = JPEGCOLORMODE_RGB; + TIFFSetField(in, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } + /* The clause up to the read statement is taken from Tom Lane's tiffcp patch */ + else + { /* Otherwise, can't handle subsampled input */ + if (input_photometric == PHOTOMETRIC_YCBCR) + { + TIFFGetFieldDefaulted(in, TIFFTAG_YCBCRSUBSAMPLING, + &subsampling_horiz, &subsampling_vert); + if (subsampling_horiz != 1 || subsampling_vert != 1) + { + TIFFError("loadImage", + "Can't copy/convert subsampled image with subsampling %d horiz %d vert", + subsampling_horiz, subsampling_vert); + return (-1); + } + } + } + + read_buff = *read_ptr; + if (!read_buff) + read_buff = (unsigned char *)_TIFFmalloc(buffsize); + else + { + if (prev_readsize < buffsize) + { + new_buff = _TIFFrealloc(read_buff, buffsize); + if (!new_buff) + { + free (read_buff); + read_buff = (unsigned char *)_TIFFmalloc(buffsize); + } + else + read_buff = new_buff; + } + } + + if (!read_buff) + { + TIFFError("loadImage", "Unable to allocate/reallocate read buffer"); + return (-1); + } + + prev_readsize = buffsize; + *read_ptr = read_buff; + + /* N.B. The read functions used copy separate plane data into a buffer as interleaved + * samples rather than separate planes so the same logic works to extract regions + * regardless of the way the data are organized in the input file. + */ + switch (readunit) { + case STRIP: + if (planar == PLANARCONFIG_CONTIG) + { + if (!(readContigStripsIntoBuffer(in, read_buff))) + { + TIFFError("loadImage", "Unable to read contiguous strips into buffer"); + return (-1); + } + } + else + { + if (!(readSeparateStripsIntoBuffer(in, read_buff, length, width, spp, dump))) + { + TIFFError("loadImage", "Unable to read separate strips into buffer"); + return (-1); + } + } + break; + + case TILE: + if (planar == PLANARCONFIG_CONTIG) + { + if (!(readContigTilesIntoBuffer(in, read_buff, length, width, tw, tl, spp, bps))) + { + TIFFError("loadImage", "Unable to read contiguous tiles into buffer"); + return (-1); + } + } + else + { + if (!(readSeparateTilesIntoBuffer(in, read_buff, length, width, tw, tl, spp, bps))) + { + TIFFError("loadImage", "Unable to read separate tiles into buffer"); + return (-1); + } + } + break; + default: TIFFError("loadImage", "Unsupported image file format"); + return (-1); + break; + } + if ((dump->infile != NULL) && (dump->level == 2)) + { + dump_info (dump->infile, dump->format, "loadImage", + "Image width %d, length %d, Raw image data, %4d bytes", + width, length, buffsize); + dump_info (dump->infile, dump->format, "", + "Bits per sample %d, Samples per pixel %d", bps, spp); + + for (i = 0; i < length; i++) + dump_buffer(dump->infile, dump->format, 1, scanlinesize, + i, read_buff + (i * scanlinesize)); + } + return (0); + } /* end loadImage */ + +static int correct_orientation(struct image_data *image, unsigned char **work_buff_ptr) + { + uint16 mirror, rotation; + unsigned char *work_buff; + + work_buff = *work_buff_ptr; + if ((image == NULL) || (work_buff == NULL)) + { + TIFFError ("correct_orientatin", "Invalid image or buffer pointer"); + return (-1); + } + + if ((image->adjustments & MIRROR_HORIZ) || (image->adjustments & MIRROR_VERT)) + { + mirror = (uint16)(image->adjustments & MIRROR_BOTH); + if (mirrorImage(image->spp, image->bps, mirror, + image->width, image->length, work_buff)) + { + TIFFError ("correct_orientation", "Unable to mirror image"); + return (-1); + } + } + + if (image->adjustments & ROTATE_ANY) + { + if (image->adjustments & ROTATECW_90) + rotation = (uint16) 90; + else + if (image->adjustments & ROTATECW_180) + rotation = (uint16) 180; + else + if (image->adjustments & ROTATECW_270) + rotation = (uint16) 270; + else + { + TIFFError ("correct_orientation", "Invalid rotation value: %d", + image->adjustments & ROTATE_ANY); + return (-1); + } + + if (rotateImage(rotation, image, &image->width, &image->length, work_buff_ptr)) + { + TIFFError ("correct_orientation", "Unable to rotate image"); + return (-1); + } + image->orientation = ORIENTATION_TOPLEFT; + } + + return (0); + } /* end correct_orientation */ + + +/* Extract multiple zones from an image and combine into a single composite image */ +static int +extractCompositeRegions(struct image_data *image, struct crop_mask *crop, + unsigned char *read_buff, unsigned char *crop_buff) + { + int shift_width, bytes_per_sample, bytes_per_pixel; + uint32 i, trailing_bits, prev_trailing_bits; + uint32 row, first_row, last_row, first_col, last_col; + uint32 src_rowsize, dst_rowsize, src_offset, dst_offset; + uint32 crop_width, crop_length, img_width, img_length; + uint32 prev_length, prev_width, composite_width; + uint16 bps, spp; + uint8 *src, *dst; + tsample_t count, sample = 0; /* Update to extract one or more samples */ + + img_width = image->width; + img_length = image->length; + bps = image->bps; + spp = image->spp; + count = spp; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if ((bps % 8) == 0) + shift_width = 0; + else + { + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + } + src = read_buff; + dst = crop_buff; + + /* These are setup for adding additional sections */ + prev_width = prev_length = 0; + prev_trailing_bits = trailing_bits = 0; + composite_width = crop->combined_width; + crop->combined_width = 0; + crop->combined_length = 0; + + for (i = 0; i < crop->selections; i++) + { + /* rows, columns, width, length are expressed in pixels */ + first_row = crop->regionlist[i].y1; + last_row = crop->regionlist[i].y2; + first_col = crop->regionlist[i].x1; + last_col = crop->regionlist[i].x2; + + crop_width = last_col - first_col + 1; + crop_length = last_row - first_row + 1; + + /* These should not be needed for composite images */ + crop->regionlist[i].width = crop_width; + crop->regionlist[i].length = crop_length; + crop->regionlist[i].buffptr = crop_buff; + + src_rowsize = ((img_width * bps * spp) + 7) / 8; + dst_rowsize = (((crop_width * bps * count) + 7) / 8); + + switch (crop->edge_ref) + { + default: + case EDGE_TOP: + case EDGE_BOTTOM: + if ((i > 0) && (crop_width != crop->regionlist[i - 1].width)) + { + TIFFError ("extractCompositeRegions", + "Only equal width regions can be combined for -E top or bottom"); + return (1); + } + + crop->combined_width = crop_width; + crop->combined_length += crop_length; + + for (row = first_row; row <= last_row; row++) + { + src_offset = row * src_rowsize; + dst_offset = (row - first_row) * dst_rowsize; + src = read_buff + src_offset; + dst = crop_buff + dst_offset + (prev_length * dst_rowsize); + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, img_width, sample, + spp, bps, count, first_col, + last_col + 1)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 1: if (bps == 1) + { + if (extractContigSamplesShifted8bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + } + else + if (extractContigSamplesShifted16bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 2: if (extractContigSamplesShifted24bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 3: + case 4: + case 5: if (extractContigSamplesShifted32bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + default: TIFFError("extractCompositeRegions", "Unsupported bit depth %d", bps); + return (1); + } + } + prev_length += crop_length; + break; + case EDGE_LEFT: /* splice the pieces of each row together, side by side */ + case EDGE_RIGHT: + if ((i > 0) && (crop_length != crop->regionlist[i - 1].length)) + { + TIFFError ("extractCompositeRegions", + "Only equal length regions can be combined for -E left or right"); + return (1); + } + crop->combined_width += crop_width; + crop->combined_length = crop_length; + dst_rowsize = (((composite_width * bps * count) + 7) / 8); + trailing_bits = (crop_width * bps * count) % 8; + for (row = first_row; row <= last_row; row++) + { + src_offset = row * src_rowsize; + dst_offset = (row - first_row) * dst_rowsize; + src = read_buff + src_offset; + dst = crop_buff + dst_offset + prev_width; + + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 1: if (bps == 1) + { + if (extractContigSamplesShifted8bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + } + else + if (extractContigSamplesShifted16bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 2: if (extractContigSamplesShifted24bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + case 3: + case 4: + case 5: if (extractContigSamplesShifted32bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractCompositeRegions", + "Unable to extract row %d", row); + return (1); + } + break; + default: TIFFError("extractCompositeRegions", "Unsupported bit depth %d", bps); + return (1); + } + } + prev_width += (crop_width * bps * count) / 8; + prev_trailing_bits += trailing_bits; + if (prev_trailing_bits > 7) + prev_trailing_bits-= 8; + break; + } + } + if (crop->combined_width != composite_width) + TIFFError("combineSeparateRegions","Combined width does not match composite width"); + + return (0); + } /* end extractCompositeRegions */ + +/* Copy a single region of input buffer to an output buffer. + * The read functions used copy separate plane data into a buffer + * as interleaved samples rather than separate planes so the same + * logic works to extract regions regardless of the way the data + * are organized in the input file. This function can be used to + * extract one or more samples from the input image by updating the + * parameters for starting sample and number of samples to copy in the + * fifth and eighth arguments of the call to extractContigSamples. + * They would be passed as new elements of the crop_mask struct. + */ + +static int +extractSeparateRegion(struct image_data *image, struct crop_mask *crop, + unsigned char *read_buff, unsigned char *crop_buff, + int region) + { + int shift_width, prev_trailing_bits = 0; + uint32 bytes_per_sample, bytes_per_pixel; + uint32 src_rowsize, dst_rowsize; + uint32 row, first_row, last_row, first_col, last_col; + uint32 src_offset, dst_offset; + uint32 crop_width, crop_length, img_width, img_length; + uint16 bps, spp; + uint8 *src, *dst; + tsample_t count, sample = 0; /* Update to extract more or more samples */ + + img_width = image->width; + img_length = image->length; + bps = image->bps; + spp = image->spp; + count = spp; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if ((bps % 8) == 0) + shift_width = 0; /* Byte aligned data only */ + else + { + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + } + + /* rows, columns, width, length are expressed in pixels */ + first_row = crop->regionlist[region].y1; + last_row = crop->regionlist[region].y2; + first_col = crop->regionlist[region].x1; + last_col = crop->regionlist[region].x2; + + crop_width = last_col - first_col + 1; + crop_length = last_row - first_row + 1; + + crop->regionlist[region].width = crop_width; + crop->regionlist[region].length = crop_length; + crop->regionlist[region].buffptr = crop_buff; + + src = read_buff; + dst = crop_buff; + src_rowsize = ((img_width * bps * spp) + 7) / 8; + dst_rowsize = (((crop_width * bps * spp) + 7) / 8); + + for (row = first_row; row <= last_row; row++) + { + src_offset = row * src_rowsize; + dst_offset = (row - first_row) * dst_rowsize; + src = read_buff + src_offset; + dst = crop_buff + dst_offset; + + switch (shift_width) + { + case 0: if (extractContigSamplesBytes (src, dst, img_width, sample, + spp, bps, count, first_col, + last_col + 1)) + { + TIFFError("extractSeparateRegion", + "Unable to extract row %d", row); + return (1); + } + break; + case 1: if (bps == 1) + { + if (extractContigSamplesShifted8bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractSeparateRegion", + "Unable to extract row %d", row); + return (1); + } + break; + } + else + if (extractContigSamplesShifted16bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractSeparateRegion", + "Unable to extract row %d", row); + return (1); + } + break; + case 2: if (extractContigSamplesShifted24bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractSeparateRegion", + "Unable to extract row %d", row); + return (1); + } + break; + case 3: + case 4: + case 5: if (extractContigSamplesShifted32bits (src, dst, img_width, + sample, spp, bps, count, + first_col, last_col + 1, + prev_trailing_bits)) + { + TIFFError("extractSeparateRegion", + "Unable to extract row %d", row); + return (1); + } + break; + default: TIFFError("extractSeparateRegion", "Unsupported bit depth %d", bps); + return (1); + } + } + + return (0); + } /* end extractSeparateRegion */ + +static int +extractImageSection(struct image_data *image, struct pageseg *section, + unsigned char *src_buff, unsigned char *sect_buff) + { + unsigned char bytebuff1, bytebuff2; + unsigned char *src, *dst; + + uint32 img_width, img_length, img_rowsize; + uint32 j, shift1, shift2, trailing_bits; + uint32 row, first_row, last_row, first_col, last_col; + uint32 src_offset, dst_offset, row_offset, col_offset; + uint32 offset1, offset2, full_bytes; + uint32 sect_width, sect_length; + uint16 bps, spp; + +#ifdef DEVELMODE + int k; + unsigned char bitset; + static char *bitarray = NULL; +#endif + + img_width = image->width; + img_length = image->length; + bps = image->bps; + spp = image->spp; + + src = src_buff; + dst = sect_buff; + src_offset = 0; + dst_offset = 0; + +#ifdef DEVELMODE + if (bitarray == NULL) + { + if ((bitarray = (char *)malloc(img_width)) == NULL) + { + TIFFError ("", "DEBUG: Unable to allocate debugging bitarray"); + return (-1); + } + } +#endif + + /* rows, columns, width, length are expressed in pixels */ + first_row = section->y1; + last_row = section->y2; + first_col = section->x1; + last_col = section->x2; + + sect_width = last_col - first_col + 1; + sect_length = last_row - first_row + 1; + img_rowsize = ((img_width * bps + 7) / 8) * spp; + full_bytes = (sect_width * spp * bps) / 8; /* number of COMPLETE bytes per row in section */ + trailing_bits = (sect_width * bps) % 8; + +#ifdef DEVELMODE + TIFFError ("", "First row: %d, last row: %d, First col: %d, last col: %d\n", + first_row, last_row, first_col, last_col); + TIFFError ("", "Image width: %d, Image length: %d, bps: %d, spp: %d\n", + img_width, img_length, bps, spp); + TIFFError ("", "Sect width: %d, Sect length: %d, full bytes: %d trailing bits %d\n", + sect_width, sect_length, full_bytes, trailing_bits); +#endif + + if ((bps % 8) == 0) + { + col_offset = first_col * spp * bps / 8; + for (row = first_row; row <= last_row; row++) + { + /* row_offset = row * img_width * spp * bps / 8; */ + row_offset = row * img_rowsize; + src_offset = row_offset + col_offset; + +#ifdef DEVELMODE + TIFFError ("", "Src offset: %8d, Dst offset: %8d", src_offset, dst_offset); +#endif + _TIFFmemcpy (sect_buff + dst_offset, src_buff + src_offset, full_bytes); + dst_offset += full_bytes; + } + } + else + { /* bps != 8 */ + shift1 = spp * ((first_col * bps) % 8); + shift2 = spp * ((last_col * bps) % 8); + for (row = first_row; row <= last_row; row++) + { + /* pull out the first byte */ + row_offset = row * img_rowsize; + offset1 = row_offset + (first_col * bps / 8); + offset2 = row_offset + (last_col * bps / 8); + +#ifdef DEVELMODE + for (j = 0, k = 7; j < 8; j++, k--) + { + bitset = *(src_buff + offset1) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + sprintf(&bitarray[8], " "); + sprintf(&bitarray[9], " "); + for (j = 10, k = 7; j < 18; j++, k--) + { + bitset = *(src_buff + offset2) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + bitarray[18] = '\0'; + TIFFError ("", "Row: %3d Offset1: %d, Shift1: %d, Offset2: %d, Shift2: %d\n", + row, offset1, shift1, offset2, shift2); +#endif + + bytebuff1 = bytebuff2 = 0; + if (shift1 == 0) /* the region is byte and sample alligned */ + { + _TIFFmemcpy (sect_buff + dst_offset, src_buff + offset1, full_bytes); + +#ifdef DEVELMODE + TIFFError ("", " Alligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset); + sprintf(&bitarray[18], "\n"); + sprintf(&bitarray[19], "\t"); + for (j = 20, k = 7; j < 28; j++, k--) + { + bitset = *(sect_buff + dst_offset) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + bitarray[28] = ' '; + bitarray[29] = ' '; +#endif + dst_offset += full_bytes; + + if (trailing_bits != 0) + { + bytebuff2 = src_buff[offset2] & ((unsigned char)255 << (7 - shift2)); + sect_buff[dst_offset] = bytebuff2; +#ifdef DEVELMODE + TIFFError ("", " Trailing bits src offset: %8d, Dst offset: %8d\n", + offset2, dst_offset); + for (j = 30, k = 7; j < 38; j++, k--) + { + bitset = *(sect_buff + dst_offset) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + bitarray[38] = '\0'; + TIFFError ("", "\tFirst and last bytes before and after masking:\n\t%s\n\n", bitarray); +#endif + dst_offset++; + } + } + else /* each destination byte will have to be built from two source bytes*/ + { +#ifdef DEVELMODE + TIFFError ("", " Unalligned data src offset: %8d, Dst offset: %8d\n", offset1 , dst_offset); +#endif + for (j = 0; j <= full_bytes; j++) + { + bytebuff1 = src_buff[offset1 + j] & ((unsigned char)255 >> shift1); + bytebuff2 = src_buff[offset1 + j + 1] & ((unsigned char)255 << (7 - shift1)); + sect_buff[dst_offset + j] = (bytebuff1 << shift1) | (bytebuff2 >> (8 - shift1)); + } +#ifdef DEVELMODE + sprintf(&bitarray[18], "\n"); + sprintf(&bitarray[19], "\t"); + for (j = 20, k = 7; j < 28; j++, k--) + { + bitset = *(sect_buff + dst_offset) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + bitarray[28] = ' '; + bitarray[29] = ' '; +#endif + dst_offset += full_bytes; + + if (trailing_bits != 0) + { +#ifdef DEVELMODE + TIFFError ("", " Trailing bits src offset: %8d, Dst offset: %8d\n", offset1 + full_bytes, dst_offset); +#endif + if (shift2 > shift1) + { + bytebuff1 = src_buff[offset1 + full_bytes] & ((unsigned char)255 << (7 - shift2)); + bytebuff2 = bytebuff1 & ((unsigned char)255 << shift1); + sect_buff[dst_offset] = bytebuff2; +#ifdef DEVELMODE + TIFFError ("", " Shift2 > Shift1\n"); +#endif + } + else + { + if (shift2 < shift1) + { + bytebuff2 = ((unsigned char)255 << (shift1 - shift2 - 1)); + sect_buff[dst_offset] &= bytebuff2; +#ifdef DEVELMODE + TIFFError ("", " Shift2 < Shift1\n"); +#endif + } +#ifdef DEVELMODE + else + TIFFError ("", " Shift2 == Shift1\n"); +#endif + } + } +#ifdef DEVELMODE + sprintf(&bitarray[28], " "); + sprintf(&bitarray[29], " "); + for (j = 30, k = 7; j < 38; j++, k--) + { + bitset = *(sect_buff + dst_offset) & (((unsigned char)1 << k)) ? 1 : 0; + sprintf(&bitarray[j], (bitset) ? "1" : "0"); + } + bitarray[38] = '\0'; + TIFFError ("", "\tFirst and last bytes before and after masking:\n\t%s\n\n", bitarray); +#endif + dst_offset++; + } + } + } + + return (0); + } /* end extractImageSection */ + +static int +writeSelections(TIFF *in, TIFF **out, struct crop_mask *crop, + struct image_data *image, struct dump_opts *dump, + struct buffinfo seg_buffs[], char *mp, char *filename, + unsigned int *page, unsigned int total_pages) + { + int i, page_count; + int autoindex = 0; + unsigned char *crop_buff = NULL; + + /* Where we open a new file depends on the export mode */ + switch (crop->exp_mode) + { + case ONE_FILE_COMPOSITE: /* Regions combined into single image */ + autoindex = 0; + crop_buff = seg_buffs[0].buffer; + if (update_output_file (out, mp, autoindex, filename, page)) + return (1); + page_count = total_pages; + if (writeCroppedImage(in, *out, image, dump, + crop->combined_width, + crop->combined_length, + crop_buff, *page, total_pages)) + { + TIFFError("writeRegions", "Unable to write new image"); + return (-1); + } + break; + case ONE_FILE_SEPARATED: /* Regions as separated images */ + autoindex = 0; + if (update_output_file (out, mp, autoindex, filename, page)) + return (1); + page_count = crop->selections * total_pages; + for (i = 0; i < crop->selections; i++) + { + crop_buff = seg_buffs[i].buffer; + if (writeCroppedImage(in, *out, image, dump, + crop->regionlist[i].width, + crop->regionlist[i].length, + crop_buff, *page, page_count)) + { + TIFFError("writeRegions", "Unable to write new image"); + return (-1); + } + } + break; + case FILE_PER_IMAGE_COMPOSITE: /* Regions as composite image */ + autoindex = 1; + if (update_output_file (out, mp, autoindex, filename, page)) + return (1); + + crop_buff = seg_buffs[0].buffer; + if (writeCroppedImage(in, *out, image, dump, + crop->combined_width, + crop->combined_length, + crop_buff, *page, total_pages)) + { + TIFFError("writeRegions", "Unable to write new image"); + return (-1); + } + break; + case FILE_PER_IMAGE_SEPARATED: /* Regions as separated images */ + autoindex = 1; + page_count = crop->selections; + if (update_output_file (out, mp, autoindex, filename, page)) + return (1); + + for (i = 0; i < crop->selections; i++) + { + crop_buff = seg_buffs[i].buffer; + /* Write the current region to the current file */ + if (writeCroppedImage(in, *out, image, dump, + crop->regionlist[i].width, + crop->regionlist[i].length, + crop_buff, *page, page_count)) + { + TIFFError("writeRegions", "Unable to write new image"); + return (-1); + } + } + break; + case FILE_PER_SELECTION: + autoindex = 1; + page_count = 1; + for (i = 0; i < crop->selections; i++) + { + if (update_output_file (out, mp, autoindex, filename, page)) + return (1); + + crop_buff = seg_buffs[i].buffer; + /* Write the current region to the current file */ + if (writeCroppedImage(in, *out, image, dump, + crop->regionlist[i].width, + crop->regionlist[i].length, + crop_buff, *page, page_count)) + { + TIFFError("writeRegions", "Unable to write new image"); + return (-1); + } + } + break; + default: return (1); + } + + return (0); + } /* end writeRegions */ + +static int +writeImageSections(TIFF *in, TIFF *out, struct image_data *image, + struct pagedef *page, struct pageseg *sections, + struct dump_opts * dump, unsigned char *src_buff, + unsigned char **sect_buff_ptr) + { + double hres, vres; + uint32 i, k, width, length, sectsize; + unsigned char *sect_buff = *sect_buff_ptr; + + hres = page->hres; + vres = page->vres; + + k = page->cols * page->rows; + if ((k < 1) || (k > MAX_SECTIONS)) + { + TIFFError("writeImageSections", + "%d Rows and Columns exceed maximum sections\nIncrease resolution or reduce sections", k); + return (-1); + } + + for (i = 0; i < k; i++) + { + width = sections[i].x2 - sections[i].x1 + 1; + length = sections[i].y2 - sections[i].y1 + 1; + sectsize = (uint32) + ceil((width * image->bps + 7) / (double)8) * image->spp * length; + /* allocate a buffer if we don't have one already */ + if (createImageSection(sectsize, sect_buff_ptr)) + { + TIFFError("writeImageSections", "Unable to allocate section buffer"); + exit (-1); + } + sect_buff = *sect_buff_ptr; + + if (extractImageSection (image, §ions[i], src_buff, sect_buff)) + { + TIFFError("writeImageSections", "Unable to extract image sections"); + exit (-1); + } + + /* call the write routine here instead of outside the loop */ + if (writeSingleSection(in, out, image, dump, width, length, hres, vres, sect_buff)) + { + TIFFError("writeImageSections", "Unable to write image section"); + exit (-1); + } + } + + return (0); + } /* end writeImageSections */ + +/* Code in this function is heavily indebted to code in tiffcp + * with modifications by Richard Nolde to handle orientation correctly. + * It will have to be updated significantly if support is added to + * extract one or more samples from original image since the + * original code assumes we are always copying all samples. + */ +static int +writeSingleSection(TIFF *in, TIFF *out, struct image_data *image, + struct dump_opts *dump, uint32 width, uint32 length, + double hres, double vres, + unsigned char *sect_buff) + { + uint16 bps, spp; + uint16 input_compression, input_photometric; + uint16 input_planar; + struct cpTag* p; + + /* Calling this seems to reset the compression mode on the TIFF *in file. + TIFFGetField(in, TIFFTAG_JPEGCOLORMODE, &input_jpeg_colormode); + */ + input_compression = image->compression; + input_photometric = image->photometric; + + spp = image->spp; + bps = image->bps; + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, length); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bps); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp); + +#ifdef DEBUG2 + TIFFError("writeSingleSection", "Input compression: %s", + (input_compression == COMPRESSION_OJPEG) ? "Old Jpeg" : + ((input_compression == COMPRESSION_JPEG) ? "New Jpeg" : "Non Jpeg")); +#endif + /* This is the global variable compression which is set + * if the user has specified a command line option for + * a compression option. Should be passed around in one + * of the parameters instead of as a global. If no user + * option specified it will still be (uint16) -1. */ + if (compression != (uint16)-1) + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + else + { /* OJPEG is no longer supported for writing so upgrade to JPEG */ + if (input_compression == COMPRESSION_OJPEG) + { + compression = COMPRESSION_JPEG; + jpegcolormode = JPEGCOLORMODE_RAW; + TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_JPEG); + } + else /* Use the compression from the input file */ + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + } + + if (compression == COMPRESSION_JPEG) + { + if ((input_photometric == PHOTOMETRIC_PALETTE) || /* color map indexed */ + (input_photometric == PHOTOMETRIC_MASK)) /* holdout mask */ + { + TIFFError ("writeSingleSection", + "JPEG compression cannot be used with %s image data", + (input_photometric == PHOTOMETRIC_PALETTE) ? + "palette" : "mask"); + return (-1); + } + if ((input_photometric == PHOTOMETRIC_RGB) && + (jpegcolormode == JPEGCOLORMODE_RGB)) + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + else + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, input_photometric); + } + else + { + if (compression == COMPRESSION_SGILOG || compression == COMPRESSION_SGILOG24) + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, spp == 1 ? + PHOTOMETRIC_LOGL : PHOTOMETRIC_LOGLUV); + else + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, image->photometric); + } + +#ifdef DEBUG2 + TIFFError("writeSingleSection", "Input photometric: %s", + (input_photometric == PHOTOMETRIC_RGB) ? "RGB" : + ((input_photometric == PHOTOMETRIC_YCBCR) ? "YCbCr" : "Not RGB or YCbCr")); +#endif + + if (((input_photometric == PHOTOMETRIC_LOGL) || + (input_photometric == PHOTOMETRIC_LOGLUV)) && + ((compression != COMPRESSION_SGILOG) && + (compression != COMPRESSION_SGILOG24))) + { + TIFFError("writeSingleSection", + "LogL and LogLuv source data require SGI_LOG or SGI_LOG24 compression"); + return (-1); + } + + if (fillorder != 0) + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + else + CopyTag(TIFFTAG_FILLORDER, 1, TIFF_SHORT); + + /* The loadimage function reads input orientation and sets + * image->orientation. The correct_image_orientation function + * applies the required rotation and mirror operations to + * present the data in TOPLEFT orientation and updates + * image->orientation if any transforms are performed, + * as per EXIF standard. + */ + TIFFSetField(out, TIFFTAG_ORIENTATION, image->orientation); + + /* + * Choose tiles/strip for the output image according to + * the command line arguments (-tiles, -strips) and the + * structure of the input image. + */ + if (outtiled == -1) + outtiled = TIFFIsTiled(in); + if (outtiled) { + /* + * Setup output file's tile width&height. If either + * is not specified, use either the value from the + * input image or, if nothing is defined, use the + * library default. + */ + if (tilewidth == (uint32) 0) + TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth); + if (tilelength == (uint32) 0) + TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength); + + if (tilewidth == 0 || tilelength == 0) + TIFFDefaultTileSize(out, &tilewidth, &tilelength); + TIFFDefaultTileSize(out, &tilewidth, &tilelength); + TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth); + TIFFSetField(out, TIFFTAG_TILELENGTH, tilelength); + } else { + /* + * RowsPerStrip is left unspecified: use either the + * value from the input image or, if nothing is defined, + * use the library default. + */ + if (rowsperstrip == (uint32) 0) + { + if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip)) + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + if (compression != COMPRESSION_JPEG) + { + if (rowsperstrip > length) + rowsperstrip = length; + } + } + else + if (rowsperstrip == (uint32) -1) + rowsperstrip = length; + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + } + + TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &input_planar); + if (config != (uint16) -1) + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + else + CopyField(TIFFTAG_PLANARCONFIG, config); + if (spp <= 4) + CopyTag(TIFFTAG_TRANSFERFUNCTION, 4, TIFF_SHORT); + CopyTag(TIFFTAG_COLORMAP, 4, TIFF_SHORT); + +/* SMinSampleValue & SMaxSampleValue */ + switch (compression) { + /* These are references to GLOBAL variables set by defaults + * and /or the compression flag + */ + case COMPRESSION_JPEG: + if (((bps % 8) == 0) || ((bps % 12) == 0)) + { + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } + else + { + TIFFError("writeSingleSection", + "JPEG compression requires 8 or 12 bits per sample"); + return (-1); + } + break; + case COMPRESSION_LZW: + case COMPRESSION_ADOBE_DEFLATE: + case COMPRESSION_DEFLATE: + if (predictor != (uint16)-1) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + else + CopyField(TIFFTAG_PREDICTOR, predictor); + break; + case COMPRESSION_CCITTFAX3: + case COMPRESSION_CCITTFAX4: + if (compression == COMPRESSION_CCITTFAX3) { + if (g3opts != (uint32) -1) + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts); + else + CopyField(TIFFTAG_GROUP3OPTIONS, g3opts); + } else + CopyTag(TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG); + CopyTag(TIFFTAG_BADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_CLEANFAXDATA, 1, TIFF_LONG); + CopyTag(TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVPARAMS, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII); + break; + } + { uint32 len32; + void** data; + if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data)) + TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data); + } + { uint16 ninks; + const char* inknames; + if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) { + TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks); + if (TIFFGetField(in, TIFFTAG_INKNAMES, &inknames)) { + int inknameslen = strlen(inknames) + 1; + const char* cp = inknames; + while (ninks > 1) { + cp = strchr(cp, '\0'); + if (cp) { + cp++; + inknameslen += (strlen(cp) + 1); + } + ninks--; + } + TIFFSetField(out, TIFFTAG_INKNAMES, inknameslen, inknames); + } + } + } + { + unsigned short pg0, pg1; + if (TIFFGetField(in, TIFFTAG_PAGENUMBER, &pg0, &pg1)) { + if (pageNum < 0) /* only one input file */ + TIFFSetField(out, TIFFTAG_PAGENUMBER, pg0, pg1); + else + TIFFSetField(out, TIFFTAG_PAGENUMBER, pageNum++, 0); + } + } + + for (p = tags; p < &tags[NTAGS]; p++) + CopyTag(p->tag, p->count, p->type); + + /* Update these since they are overwritten from input res by loop above */ + TIFFSetField(out, TIFFTAG_XRESOLUTION, (float)hres); + TIFFSetField(out, TIFFTAG_YRESOLUTION, (float)vres); + + /* Compute the tile or strip dimensions and write to disk */ + if (outtiled) + { + if (config == PLANARCONFIG_CONTIG) + writeBufferToContigTiles (out, sect_buff, length, width, spp, dump); + else + writeBufferToSeparateTiles (out, sect_buff, length, width, spp, dump); + } + else + { + if (config == PLANARCONFIG_CONTIG) + writeBufferToContigStrips (out, sect_buff, length); + else + writeBufferToSeparateStrips(out, sect_buff, length, width, spp, dump); + } + + if (!TIFFWriteDirectory(out)) + { + TIFFClose(out); + return (-1); + } + + return (0); + } /* end writeSingleSection */ + + +/* Create a buffer to write one section at a time */ +static int +createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr) + { + unsigned char *sect_buff = NULL; + unsigned char *new_buff = NULL; + static uint32 prev_sectsize = 0; + + sect_buff = *sect_buff_ptr; + + if (!sect_buff) + { + sect_buff = (unsigned char *)_TIFFmalloc(sectsize); + *sect_buff_ptr = sect_buff; + _TIFFmemset(sect_buff, 0, sectsize); + } + else + { + if (prev_sectsize < sectsize) + { + new_buff = _TIFFrealloc(sect_buff, sectsize); + if (!new_buff) + { + free (sect_buff); + sect_buff = (unsigned char *)_TIFFmalloc(sectsize); + } + else + sect_buff = new_buff; + + _TIFFmemset(sect_buff, 0, sectsize); + } + } + + if (!sect_buff) + { + TIFFError("createImageSection", "Unable to allocate/reallocate section buffer"); + return (-1); + } + prev_sectsize = sectsize; + *sect_buff_ptr = sect_buff; + + return (0); + } /* end createImageSection */ + + +/* Process selections defined by regions, zones, margins, or fixed sized areas */ +static int +processCropSelections(struct image_data *image, struct crop_mask *crop, + unsigned char **read_buff_ptr, struct buffinfo seg_buffs[]) + { + int i; + uint32 width, length, total_width, total_length; + tsize_t cropsize; + unsigned char *crop_buff = NULL; + unsigned char *read_buff = NULL; + unsigned char *next_buff = NULL; + tsize_t prev_cropsize = 0; + + read_buff = *read_buff_ptr; + + if (crop->img_mode == COMPOSITE_IMAGES) + { + cropsize = crop->bufftotal; + crop_buff = seg_buffs[0].buffer; + if (!crop_buff) + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + else + { + prev_cropsize = seg_buffs[0].size; + if (prev_cropsize < cropsize) + { + next_buff = _TIFFrealloc(crop_buff, cropsize); + if (! next_buff) + { + _TIFFfree (crop_buff); + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + } + else + crop_buff = next_buff; + } + } + + if (!crop_buff) + { + TIFFError("processCropSelections", "Unable to allocate/reallocate crop buffer"); + return (-1); + } + + _TIFFmemset(crop_buff, 0, cropsize); + seg_buffs[0].buffer = crop_buff; + seg_buffs[0].size = cropsize; + + /* Checks for matching width or length as required */ + if (extractCompositeRegions(image, crop, read_buff, crop_buff) != 0) + return (1); + + if (crop->crop_mode & CROP_INVERT) + { + switch (crop->photometric) + { + /* Just change the interpretation */ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + image->photometric = crop->photometric; + break; + case INVERT_DATA_ONLY: + case INVERT_DATA_AND_TAG: + if (invertImage(image->photometric, image->spp, image->bps, + crop->combined_width, crop->combined_length, crop_buff)) + { + TIFFError("processCropSelections", + "Failed to invert colorspace for composite regions"); + return (-1); + } + if (crop->photometric == INVERT_DATA_AND_TAG) + { + switch (image->photometric) + { + case PHOTOMETRIC_MINISWHITE: + image->photometric = PHOTOMETRIC_MINISBLACK; + break; + case PHOTOMETRIC_MINISBLACK: + image->photometric = PHOTOMETRIC_MINISWHITE; + break; + default: + break; + } + } + break; + default: break; + } + } + + /* Mirror and Rotate will not work with multiple regions unless they are the same width */ + if (crop->crop_mode & CROP_MIRROR) + { + if (mirrorImage(image->spp, image->bps, crop->mirror, + crop->combined_width, crop->combined_length, crop_buff)) + { + TIFFError("processCropSelections", "Failed to mirror composite regions %s", + (crop->rotation == MIRROR_HORIZ) ? "horizontally" : "vertically"); + return (-1); + } + } + + if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */ + { + if (rotateImage(crop->rotation, image, &crop->combined_width, + &crop->combined_length, &crop_buff)) + { + TIFFError("processCropSelections", + "Failed to rotate composite regions by %d degrees", crop->rotation); + return (-1); + } + seg_buffs[0].buffer = crop_buff; + seg_buffs[0].size = (((crop->combined_width * image->bps + 7 ) / 8) + * image->spp) * crop->combined_length; + } + } + else /* Separated Images */ + { + total_width = total_length = 0; + for (i = 0; i < crop->selections; i++) + { + cropsize = crop->bufftotal; + crop_buff = seg_buffs[i].buffer; + if (!crop_buff) + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + else + { + prev_cropsize = seg_buffs[0].size; + if (prev_cropsize < cropsize) + { + next_buff = _TIFFrealloc(crop_buff, cropsize); + if (! next_buff) + { + _TIFFfree (crop_buff); + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + } + else + crop_buff = next_buff; + } + } + + if (!crop_buff) + { + TIFFError("processCropSelections", "Unable to allocate/reallocate crop buffer"); + return (-1); + } + + _TIFFmemset(crop_buff, 0, cropsize); + seg_buffs[i].buffer = crop_buff; + seg_buffs[i].size = cropsize; + + if (extractSeparateRegion(image, crop, read_buff, crop_buff, i)) + { + TIFFError("processCropSelections", "Unable to extract cropped region %d from image", i); + return (-1); + } + + width = crop->regionlist[i].width; + length = crop->regionlist[i].length; + + if (crop->crop_mode & CROP_INVERT) + { + switch (crop->photometric) + { + /* Just change the interpretation */ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + image->photometric = crop->photometric; + break; + case INVERT_DATA_ONLY: + case INVERT_DATA_AND_TAG: + if (invertImage(image->photometric, image->spp, image->bps, + width, length, crop_buff)) + { + TIFFError("processCropSelections", + "Failed to invert colorspace for region"); + return (-1); + } + if (crop->photometric == INVERT_DATA_AND_TAG) + { + switch (image->photometric) + { + case PHOTOMETRIC_MINISWHITE: + image->photometric = PHOTOMETRIC_MINISBLACK; + break; + case PHOTOMETRIC_MINISBLACK: + image->photometric = PHOTOMETRIC_MINISWHITE; + break; + default: + break; + } + } + break; + default: break; + } + } + + if (crop->crop_mode & CROP_MIRROR) + { + if (mirrorImage(image->spp, image->bps, crop->mirror, + width, length, crop_buff)) + { + TIFFError("processCropSelections", "Failed to mirror crop region %s", + (crop->rotation == MIRROR_HORIZ) ? "horizontally" : "vertically"); + return (-1); + } + } + + if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */ + { + if (rotateImage(crop->rotation, image, &crop->regionlist[i].width, + &crop->regionlist[i].length, &crop_buff)) + { + TIFFError("processCropSelections", + "Failed to rotate crop region by %d degrees", crop->rotation); + return (-1); + } + total_width += crop->regionlist[i].width; + total_length += crop->regionlist[i].length; + crop->combined_width = total_width; + crop->combined_length = total_length; + seg_buffs[i].buffer = crop_buff; + seg_buffs[i].size = (((crop->regionlist[i].width * image->bps + 7 ) / 8) + * image->spp) * crop->regionlist[i].length; + } + } + } + return (0); + } /* end processCropSelections */ + +/* Copy the crop section of the data from the current image into a buffer + * and adjust the IFD values to reflect the new size. If no cropping is + * required, use the origial read buffer as the crop buffer. + * + * There is quite a bit of redundancy between this routine and the more + * specialized processCropSelections, but this provides + * the most optimized path when no Zones or Regions are required. + */ +static int +createCroppedImage(struct image_data *image, struct crop_mask *crop, + unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr) + { + tsize_t cropsize; + unsigned char *read_buff = NULL; + unsigned char *crop_buff = NULL; + unsigned char *new_buff = NULL; + static tsize_t prev_cropsize = 0; + + read_buff = *read_buff_ptr; + + /* process full image, no crop buffer needed */ + crop_buff = read_buff; + *crop_buff_ptr = read_buff; + crop->combined_width = image->width; + crop->combined_length = image->length; + + cropsize = crop->bufftotal; + crop_buff = *crop_buff_ptr; + if (!crop_buff) + { + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + *crop_buff_ptr = crop_buff; + _TIFFmemset(crop_buff, 0, cropsize); + prev_cropsize = cropsize; + } + else + { + if (prev_cropsize < cropsize) + { + new_buff = _TIFFrealloc(crop_buff, cropsize); + if (!new_buff) + { + free (crop_buff); + crop_buff = (unsigned char *)_TIFFmalloc(cropsize); + } + else + crop_buff = new_buff; + _TIFFmemset(crop_buff, 0, cropsize); + } + } + + if (!crop_buff) + { + TIFFError("createCroppedImage", "Unable to allocate/reallocate crop buffer"); + return (-1); + } + *crop_buff_ptr = crop_buff; + + if (crop->crop_mode & CROP_INVERT) + { + switch (crop->photometric) + { + /* Just change the interpretation */ + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + image->photometric = crop->photometric; + break; + case INVERT_DATA_ONLY: + case INVERT_DATA_AND_TAG: + if (invertImage(image->photometric, image->spp, image->bps, + crop->combined_width, crop->combined_length, crop_buff)) + { + TIFFError("createCroppedImage", + "Failed to invert colorspace for image or cropped selection"); + return (-1); + } + if (crop->photometric == INVERT_DATA_AND_TAG) + { + switch (image->photometric) + { + case PHOTOMETRIC_MINISWHITE: + image->photometric = PHOTOMETRIC_MINISBLACK; + break; + case PHOTOMETRIC_MINISBLACK: + image->photometric = PHOTOMETRIC_MINISWHITE; + break; + default: + break; + } + } + break; + default: break; + } + } + + if (crop->crop_mode & CROP_MIRROR) + { + if (mirrorImage(image->spp, image->bps, crop->mirror, + crop->combined_width, crop->combined_length, crop_buff)) + { + TIFFError("createCroppedImage", "Failed to mirror image or cropped selection %s", + (crop->rotation == MIRROR_HORIZ) ? "horizontally" : "vertically"); + return (-1); + } + } + + if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */ + { + if (rotateImage(crop->rotation, image, &crop->combined_width, + &crop->combined_length, crop_buff_ptr)) + { + TIFFError("createCroppedImage", + "Failed to rotate image or cropped selection by %d degrees", crop->rotation); + return (-1); + } + } + + if (crop_buff == read_buff) /* we used the read buffer for the crop buffer */ + *read_buff_ptr = NULL; /* so we don't try to free it later */ + + return (0); + } /* end createCroppedImage */ + + +/* Code in this function is heavily indebted to code in tiffcp + * with modifications by Richard Nolde to handle orientation correctly. + * It will have to be updated significantly if support is added to + * extract one or more samples from original image since the + * original code assumes we are always copying all samples. + * Use of global variables for config, compression and others + * should be replaced by addition to the crop_mask struct (which + * will be renamed to proc_opts indicating that is controlls + * user supplied processing options, not just cropping) and + * then passed in as an argument. + */ +static int +writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image, + struct dump_opts *dump, uint32 width, uint32 length, + unsigned char *crop_buff, int pagenum, int total_pages) + { + uint16 bps, spp; + uint16 input_compression, input_photometric; + uint16 input_planar; + struct cpTag* p; + + input_compression = image->compression; + input_photometric = image->photometric; + spp = image->spp; + bps = image->bps; + + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, width); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, length); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bps); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp); + +#ifdef DEBUG2 + TIFFError("writeCroppedImage", "Input compression: %s", + (input_compression == COMPRESSION_OJPEG) ? "Old Jpeg" : + ((input_compression == COMPRESSION_JPEG) ? "New Jpeg" : "Non Jpeg")); +#endif + + if (compression != (uint16)-1) + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + else + { + if (input_compression == COMPRESSION_OJPEG) + { + compression = COMPRESSION_JPEG; + jpegcolormode = JPEGCOLORMODE_RAW; + TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_JPEG); + } + else + CopyField(TIFFTAG_COMPRESSION, compression); + } + + if (compression == COMPRESSION_JPEG) + { + if ((input_photometric == PHOTOMETRIC_PALETTE) || /* color map indexed */ + (input_photometric == PHOTOMETRIC_MASK)) /* $holdout mask */ + { + TIFFError ("writeCroppedImage", + "JPEG compression cannot be used with %s image data", + (input_photometric == PHOTOMETRIC_PALETTE) ? + "palette" : "mask"); + return (-1); + } + if ((input_photometric == PHOTOMETRIC_RGB) && + (jpegcolormode == JPEGCOLORMODE_RGB)) + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_YCBCR); + else + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, input_photometric); + } + else + { + if (compression == COMPRESSION_SGILOG || compression == COMPRESSION_SGILOG24) + { + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, spp == 1 ? + PHOTOMETRIC_LOGL : PHOTOMETRIC_LOGLUV); + } + else + { + if (input_compression == COMPRESSION_SGILOG || + input_compression == COMPRESSION_SGILOG24) + { + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, spp == 1 ? + PHOTOMETRIC_LOGL : PHOTOMETRIC_LOGLUV); + } + else + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, image->photometric); + } + } + + if (((input_photometric == PHOTOMETRIC_LOGL) || + (input_photometric == PHOTOMETRIC_LOGLUV)) && + ((compression != COMPRESSION_SGILOG) && + (compression != COMPRESSION_SGILOG24))) + { + TIFFError("writeCroppedImage", + "LogL and LogLuv source data require SGI_LOG or SGI_LOG24 compression"); + return (-1); + } + + if (fillorder != 0) + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + else + CopyTag(TIFFTAG_FILLORDER, 1, TIFF_SHORT); + + /* The loadimage function reads input orientation and sets + * image->orientation. The correct_image_orientation function + * applies the required rotation and mirror operations to + * present the data in TOPLEFT orientation and updates + * image->orientation if any transforms are performed, + * as per EXIF standard. + */ + TIFFSetField(out, TIFFTAG_ORIENTATION, image->orientation); + + /* + * Choose tiles/strip for the output image according to + * the command line arguments (-tiles, -strips) and the + * structure of the input image. + */ + if (outtiled == -1) + outtiled = TIFFIsTiled(in); + if (outtiled) { + /* + * Setup output file's tile width&height. If either + * is not specified, use either the value from the + * input image or, if nothing is defined, use the + * library default. + */ + if (tilewidth == (uint32) 0) + TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth); + if (tilelength == (uint32) 0) + TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength); + + if (tilewidth == 0 || tilelength == 0) + TIFFDefaultTileSize(out, &tilewidth, &tilelength); + TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth); + TIFFSetField(out, TIFFTAG_TILELENGTH, tilelength); + } else { + /* + * RowsPerStrip is left unspecified: use either the + * value from the input image or, if nothing is defined, + * use the library default. + */ + if (rowsperstrip == (uint32) 0) + { + if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip)) + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + if (compression != COMPRESSION_JPEG) + { + if (rowsperstrip > length) + rowsperstrip = length; + } + } + else + if (rowsperstrip == (uint32) -1) + rowsperstrip = length; + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + } + + TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &input_planar); + if (config != (uint16) -1) + TIFFSetField(out, TIFFTAG_PLANARCONFIG, config); + else + CopyField(TIFFTAG_PLANARCONFIG, config); + if (spp <= 4) + CopyTag(TIFFTAG_TRANSFERFUNCTION, 4, TIFF_SHORT); + CopyTag(TIFFTAG_COLORMAP, 4, TIFF_SHORT); + +/* SMinSampleValue & SMaxSampleValue */ + switch (compression) { + case COMPRESSION_JPEG: + if (((bps % 8) == 0) || ((bps % 12) == 0)) + { + TIFFSetField(out, TIFFTAG_JPEGQUALITY, quality); + TIFFSetField(out, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } + else + { + TIFFError("writeCroppedImage", + "JPEG compression requires 8 or 12 bits per sample"); + return (-1); + } + break; + case COMPRESSION_LZW: + case COMPRESSION_ADOBE_DEFLATE: + case COMPRESSION_DEFLATE: + if (predictor != (uint16)-1) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + else + CopyField(TIFFTAG_PREDICTOR, predictor); + break; + case COMPRESSION_CCITTFAX3: + case COMPRESSION_CCITTFAX4: + if (bps != 1) + { + TIFFError("writeCroppedImage", + "Group 3/4 compression is not usable with bps > 1"); + return (-1); + } + if (compression == COMPRESSION_CCITTFAX3) { + if (g3opts != (uint32) -1) + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts); + else + CopyField(TIFFTAG_GROUP3OPTIONS, g3opts); + } else + CopyTag(TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG); + CopyTag(TIFFTAG_BADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_CLEANFAXDATA, 1, TIFF_LONG); + CopyTag(TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVPARAMS, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXRECVTIME, 1, TIFF_LONG); + CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII); + break; + case COMPRESSION_NONE: + break; + default: break; + } + { uint32 len32; + void** data; + if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data)) + TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data); + } + { uint16 ninks; + const char* inknames; + if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) { + TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks); + if (TIFFGetField(in, TIFFTAG_INKNAMES, &inknames)) { + int inknameslen = strlen(inknames) + 1; + const char* cp = inknames; + while (ninks > 1) { + cp = strchr(cp, '\0'); + if (cp) { + cp++; + inknameslen += (strlen(cp) + 1); + } + ninks--; + } + TIFFSetField(out, TIFFTAG_INKNAMES, inknameslen, inknames); + } + } + } + { + unsigned short pg0, pg1; + if (TIFFGetField(in, TIFFTAG_PAGENUMBER, &pg0, &pg1)) { + TIFFSetField(out, TIFFTAG_PAGENUMBER, pagenum, total_pages); + } + } + + for (p = tags; p < &tags[NTAGS]; p++) + CopyTag(p->tag, p->count, p->type); + + /* Compute the tile or strip dimensions and write to disk */ + if (outtiled) + { + if (config == PLANARCONFIG_CONTIG) + { + if (writeBufferToContigTiles (out, crop_buff, length, width, spp, dump)) + TIFFError("","Unable to write contiguous tile data for page %d", pagenum); + } + else + { + if (writeBufferToSeparateTiles (out, crop_buff, length, width, spp, dump)) + TIFFError("","Unable to write separate tile data for page %d", pagenum); + } + } + else + { + if (config == PLANARCONFIG_CONTIG) + { + if (writeBufferToContigStrips (out, crop_buff, length)) + TIFFError("","Unable to write contiguous strip data for page %d", pagenum); + } + else + { + if (writeBufferToSeparateStrips(out, crop_buff, length, width, spp, dump)) + TIFFError("","Unable to write separate strip data for page %d", pagenum); + } + } + + if (!TIFFWriteDirectory(out)) + { + TIFFError("","Failed to write IFD for page number %d", pagenum); + TIFFClose(out); + return (-1); + } + + return (0); + } /* end writeCroppedImage */ + +static int +rotateContigSamples8bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width, + uint32 length, uint32 col, uint8 *src, uint8 *dst) + { + int ready_bits = 0; + uint32 src_byte = 0, src_bit = 0; + uint32 row, rowsize = 0, bit_offset = 0; + uint8 matchbits = 0, maskbits = 0; + uint8 buff1 = 0, buff2 = 0; + uint8 *next; + tsample_t sample; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("rotateContigSamples8bits","Invalid src or destination buffer"); + return (1); + } + + rowsize = ((bps * spp * width) + 7) / 8; + ready_bits = 0; + maskbits = (uint8)-1 >> ( 8 - bps); + buff1 = buff2 = 0; + + for (row = 0; row < length ; row++) + { + bit_offset = col * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + src_bit = (bit_offset + (sample * bps)) % 8; + } + + switch (rotation) + { + case 90: next = src + src_byte - (row * rowsize); + break; + case 270: next = src + src_byte + (row * rowsize); + break; + default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation); + return (1); + } + matchbits = maskbits << (8 - src_bit - bps); + buff1 = ((*next) & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + *dst++ = buff2; + buff2 = buff1; + ready_bits -= 8; + } + else + { + buff2 = (buff2 | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + if (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + } + + return (0); + } /* end rotateContigSamples8bits */ + + +static int +rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width, + uint32 length, uint32 col, uint8 *src, uint8 *dst) + { + int ready_bits = 0; + uint32 row, rowsize, bit_offset; + uint32 src_byte = 0, src_bit = 0; + uint16 matchbits = 0, maskbits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + uint8 *next; + tsample_t sample; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("rotateContigSamples16bits","Invalid src or destination buffer"); + return (1); + } + + rowsize = ((bps * spp * width) + 7) / 8; + ready_bits = 0; + maskbits = (uint16)-1 >> (16 - bps); + buff1 = buff2 = 0; + for (row = 0; row < length; row++) + { + bit_offset = col * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + src_bit = (bit_offset + (sample * bps)) % 8; + } + + switch (rotation) + { + case 90: next = src + src_byte - (row * rowsize); + break; + case 270: next = src + src_byte + (row * rowsize); + break; + default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation); + return (1); + } + matchbits = maskbits << (16 - src_bit - bps); + if (little_endian) + buff1 = (next[0] << 8) | next[1]; + else + buff1 = (next[1] << 8) | next[0]; + + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 8) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + } + else + { /* add another bps bits to the buffer */ + bytebuff = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + if (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + } + + return (0); + } /* end rotateContigSamples16bits */ + +static int +rotateContigSamples24bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width, + uint32 length, uint32 col, uint8 *src, uint8 *dst) + { + int ready_bits = 0; + uint32 row, rowsize, bit_offset; + uint32 src_byte = 0, src_bit = 0; + uint32 matchbits = 0, maskbits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + uint8 *next; + tsample_t sample; + + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("rotateContigSamples24bits","Invalid src or destination buffer"); + return (1); + } + + rowsize = ((bps * spp * width) + 7) / 8; + ready_bits = 0; + maskbits = (uint32)-1 >> (32 - bps); + buff1 = buff2 = 0; + for (row = 0; row < length; row++) + { + bit_offset = col * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + src_bit = (bit_offset + (sample * bps)) % 8; + } + + switch (rotation) + { + case 90: next = src + src_byte - (row * rowsize); + break; + case 270: next = src + src_byte + (row * rowsize); + break; + default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation); + return (1); + } + matchbits = maskbits << (32 - src_bit - bps); + if (little_endian) + buff1 = (next[0] << 24) | (next[1] << 16) | (next[2] << 8) | next[3]; + else + buff1 = (next[3] << 24) | (next[2] << 16) | (next[1] << 8) | next[0]; + buff1 = (buff1 & matchbits) << (src_bit); + + /* If we have a full buffer's worth, write it out */ + if (ready_bits >= 16) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + } + else + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + return (0); + } /* end rotateContigSamples24bits */ + +static int +rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width, + uint32 length, uint32 col, uint8 *src, uint8 *dst) + { + int ready_bits = 0, shift_width = 0; + int bytes_per_sample, bytes_per_pixel; + uint32 row, rowsize, bit_offset; + uint32 src_byte, src_bit; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 maskbits = 0, matchbits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + uint8 *next; + tsample_t sample; + + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("rotateContigSamples24bits","Invalid src or destination buffer"); + return (1); + } + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + rowsize = ((bps * spp * width) + 7) / 8; + ready_bits = 0; + maskbits = (uint64)-1 >> (64 - bps); + buff1 = buff2 = 0; + for (row = 0; row < length; row++) + { + bit_offset = col * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + src_bit = (bit_offset + (sample * bps)) % 8; + } + + switch (rotation) + { + case 90: next = src + src_byte - (row * rowsize); + break; + case 270: next = src + src_byte + (row * rowsize); + break; + default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation); + return (1); + } + matchbits = maskbits << (64 - src_bit - bps); + if (little_endian) + { + longbuff1 = (next[0] << 24) | (next[1] << 16) | (next[2] << 8) | next[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (next[3] << 24) | (next[2] << 16) | (next[1] << 8) | next[0]; + longbuff2 = longbuff1; + } + + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + buff1 = (buff3 & matchbits) << (src_bit); + + if (ready_bits < 32) + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + return (0); + } /* end rotateContigSamples32bits */ + + +/* Rotate an image by a multiple of 90 degrees clockwise */ +static int +rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width, + uint32 *img_length, unsigned char **ibuff_ptr) + { + int shift_width; + uint32 bytes_per_pixel, bytes_per_sample; + uint32 row, rowsize, src_offset, dst_offset; + uint32 i, col, width, length; + uint32 colsize, buffsize, col_offset, pix_offset; + unsigned char *ibuff; + unsigned char *src; + unsigned char *dst; + uint16 spp, bps; + float res_temp; + unsigned char *rbuff = NULL; + + width = *img_width; + length = *img_length; + spp = image->spp; + bps = image->bps; + + rowsize = ((bps * spp * width) + 7) / 8; + colsize = ((bps * spp * length) + 7) / 8; + if ((colsize * width) > (rowsize * length)) + buffsize = (colsize + 1) * width; + else + buffsize = (rowsize + 1) * length; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + switch (rotation) + { + case 0: + case 360: return (0); + case 90: + case 180: + case 270: break; + default: TIFFError("rotateImage", "Invalid rotation angle %d", rotation); + return (-1); + } + + if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize))) + { + TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize); + return (-1); + } + _TIFFmemset(rbuff, '\0', buffsize); + + ibuff = *ibuff_ptr; + switch (rotation) + { + case 180: if ((bps % 8) == 0) /* byte alligned data */ + { + src = ibuff; + pix_offset = (spp * bps) / 8; + for (row = 0; row < length; row++) + { + dst_offset = (length - row - 1) * rowsize; + for (col = 0; col < width; col++) + { + col_offset = (width - col - 1) * pix_offset; + dst = rbuff + dst_offset + col_offset; + + for (i = 0; i < bytes_per_pixel; i++) + *dst++ = *src++; + } + } + } + else + { /* non 8 bit per sample data */ + for (row = 0; row < length; row++) + { + src_offset = row * rowsize; + dst_offset = (length - row - 1) * rowsize; + src = ibuff + src_offset; + dst = rbuff + dst_offset; + switch (shift_width) + { + case 1: if (bps == 1) + { + if (reverseSamples8bits(spp, bps, width, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + } + if (reverseSamples16bits(spp, bps, width, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 2: if (reverseSamples24bits(spp, bps, width, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 3: + case 4: + case 5: if (reverseSamples32bits(spp, bps, width, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + default: TIFFError("rotateImage","Unsupported bit depth %d", bps); + _TIFFfree(rbuff); + return (-1); + } + } + } + _TIFFfree(ibuff); + *(ibuff_ptr) = rbuff; + break; + + case 90: if ((bps % 8) == 0) /* byte aligned data */ + { + for (col = 0; col < width; col++) + { + src_offset = ((length - 1) * rowsize) + (col * bytes_per_pixel); + dst_offset = col * colsize; + src = ibuff + src_offset; + dst = rbuff + dst_offset; + for (row = length; row > 0; row--) + { + for (i = 0; i < bytes_per_pixel; i++) + *dst++ = *(src + i); + src -= rowsize; + } + } + } + else + { /* non 8 bit per sample data */ + for (col = 0; col < width; col++) + { + src_offset = (length - 1) * rowsize; + dst_offset = col * colsize; + src = ibuff + src_offset; + dst = rbuff + dst_offset; + switch (shift_width) + { + case 1: if (bps == 1) + { + if (rotateContigSamples8bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + } + if (rotateContigSamples16bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 2: if (rotateContigSamples24bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 3: + case 4: + case 5: if (rotateContigSamples32bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + default: TIFFError("rotateImage","Unsupported bit depth %d", bps); + _TIFFfree(rbuff); + return (-1); + } + } + } + _TIFFfree(ibuff); + *(ibuff_ptr) = rbuff; + + *img_width = length; + *img_length = width; + image->width = length; + image->length = width; + res_temp = image->xres; + image->xres = image->yres; + image->yres = res_temp; + break; + + case 270: if ((bps % 8) == 0) /* byte aligned data */ + { + for (col = 0; col < width; col++) + { + src_offset = col * bytes_per_pixel; + dst_offset = (width - col - 1) * colsize; + src = ibuff + src_offset; + dst = rbuff + dst_offset; + for (row = length; row > 0; row--) + { + for (i = 0; i < bytes_per_pixel; i++) + *dst++ = *(src + i); + src += rowsize; + } + } + } + else + { /* non 8 bit per sample data */ + for (col = 0; col < width; col++) + { + src_offset = 0; + dst_offset = (width - col - 1) * colsize; + src = ibuff + src_offset; + dst = rbuff + dst_offset; + switch (shift_width) + { + case 1: if (bps == 1) + { + if (rotateContigSamples8bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + } + if (rotateContigSamples16bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 2: if (rotateContigSamples24bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + case 3: + case 4: + case 5: if (rotateContigSamples32bits(rotation, spp, bps, width, + length, col, src, dst)) + { + _TIFFfree(rbuff); + return (-1); + } + break; + default: TIFFError("rotateImage","Unsupported bit depth %d", bps); + _TIFFfree(rbuff); + return (-1); + } + } + } + _TIFFfree(ibuff); + *(ibuff_ptr) = rbuff; + + *img_width = length; + *img_length = width; + image->width = length; + image->length = width; + res_temp = image->xres; + image->xres = image->yres; + image->yres = res_temp; + break; + default: + break; + } + + return (0); + } /* end rotateImage */ + +static int +reverseSamples8bits (uint16 spp, uint16 bps, uint32 width, + uint8 *ibuff, uint8 *obuff) + { + int ready_bits = 0; + uint32 col; + uint32 src_byte, src_bit; + uint32 bit_offset = 0; + uint8 match_bits = 0, mask_bits = 0; + uint8 buff1 = 0, buff2 = 0; + unsigned char *src; + unsigned char *dst; + tsample_t sample; + + if ((ibuff == NULL) || (obuff == NULL)) + { + TIFFError("reverseSamples8bits","Invalid image or work buffer"); + return (1); + } + + ready_bits = 0; + mask_bits = (uint8)-1 >> ( 8 - bps); + dst = obuff; + for (col = width; col > 0; col--) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = (col - 1) * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + src_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + src_bit = (bit_offset + (sample * bps)) % 8; + } + + src = ibuff + src_byte; + match_bits = mask_bits << (8 - src_bit - bps); + buff1 = ((*src) & match_bits) << (src_bit); + + if (ready_bits < 8) + buff2 = (buff2 | (buff1 >> ready_bits)); + else /* If we have a full buffer's worth, write it out */ + { + *dst++ = buff2; + buff2 = buff1; + ready_bits -= 8; + } + ready_bits += bps; + } + } + if (ready_bits > 0) + { + buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); + *dst++ = buff1; + } + + return (0); + } /* end reverseSamples8bits */ + + +static int +reverseSamples16bits (uint16 spp, uint16 bps, uint32 width, + uint8 *ibuff, uint8 *obuff) + { + int ready_bits = 0; + uint32 col; + uint32 src_byte = 0, high_bit = 0; + uint32 bit_offset = 0; + uint16 match_bits = 0, mask_bits = 0; + uint16 buff1 = 0, buff2 = 0; + uint8 bytebuff = 0; + unsigned char *src; + unsigned char *dst; + tsample_t sample; + + if ((ibuff == NULL) || (obuff == NULL)) + { + TIFFError("reverseSample16bits","Invalid image or work buffer"); + return (1); + } + + ready_bits = 0; + mask_bits = (uint16)-1 >> (16 - bps); + dst = obuff; + for (col = width; col > 0; col--) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = (col - 1) * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + high_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + high_bit = (bit_offset + (sample * bps)) % 8; + } + + src = ibuff + src_byte; + match_bits = mask_bits << (16 - high_bit - bps); + if (little_endian) + buff1 = (src[0] << 8) | src[1]; + else + buff1 = (src[1] << 8) | src[0]; + buff1 = (buff1 & match_bits) << (high_bit); + + if (ready_bits < 8) + { /* add another bps bits to the buffer */ + bytebuff = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + ready_bits -= 8; + /* shift in new bits */ + buff2 = ((buff2 << 8) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + if (ready_bits > 0) + { + bytebuff = (buff2 >> 8); + *dst++ = bytebuff; + } + + return (0); + } /* end reverseSamples16bits */ + +static int +reverseSamples24bits (uint16 spp, uint16 bps, uint32 width, + uint8 *ibuff, uint8 *obuff) + { + int ready_bits = 0; + uint32 col; + uint32 src_byte = 0, high_bit = 0; + uint32 bit_offset = 0; + uint32 match_bits = 0, mask_bits = 0; + uint32 buff1 = 0, buff2 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0; + unsigned char *src; + unsigned char *dst; + tsample_t sample; + + if ((ibuff == NULL) || (obuff == NULL)) + { + TIFFError("reverseSamples24bits","Invalid image or work buffer"); + return (1); + } + + ready_bits = 0; + mask_bits = (uint32)-1 >> (32 - bps); + dst = obuff; + for (col = width; col > 0; col--) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = (col - 1) * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + high_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + high_bit = (bit_offset + (sample * bps)) % 8; + } + + src = ibuff + src_byte; + match_bits = mask_bits << (32 - high_bit - bps); + if (little_endian) + buff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + else + buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + buff1 = (buff1 & match_bits) << (high_bit); + + if (ready_bits < 16) + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 16); + *dst++ = bytebuff2; + ready_bits -= 16; + + /* shift in new bits */ + buff2 = ((buff2 << 16) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + + /* catch any trailing bits at the end of the line */ + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 24); + *dst++ = bytebuff1; + + buff2 = (buff2 << 8); + bytebuff2 = bytebuff1; + ready_bits -= 8; + } + + return (0); + } /* end reverseSamples24bits */ + + +static int +reverseSamples32bits (uint16 spp, uint16 bps, uint32 width, + uint8 *ibuff, uint8 *obuff) + { + int ready_bits = 0, shift_width = 0; + int bytes_per_sample, bytes_per_pixel; + uint32 bit_offset; + uint32 src_byte = 0, high_bit = 0; + uint32 col; + uint32 longbuff1 = 0, longbuff2 = 0; + uint64 mask_bits = 0, match_bits = 0; + uint64 buff1 = 0, buff2 = 0, buff3 = 0; + uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0; + unsigned char *src; + unsigned char *dst; + tsample_t sample; + + if ((ibuff == NULL) || (obuff == NULL)) + { + TIFFError("reverseSamples32bits","Invalid image or work buffer"); + return (1); + } + + ready_bits = 0; + mask_bits = (uint64)-1 >> (64 - bps); + dst = obuff; + + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + for (col = width; col > 0; col--) + { + /* Compute src byte(s) and bits within byte(s) */ + bit_offset = (col - 1) * bps * spp; + for (sample = 0; sample < spp; sample++) + { + if (sample == 0) + { + src_byte = bit_offset / 8; + high_bit = bit_offset % 8; + } + else + { + src_byte = (bit_offset + (sample * bps)) / 8; + high_bit = (bit_offset + (sample * bps)) % 8; + } + + src = ibuff + src_byte; + match_bits = mask_bits << (64 - high_bit - bps); + if (little_endian) + { + longbuff1 = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3]; + longbuff2 = longbuff1; + } + else + { + longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0]; + longbuff2 = longbuff1; + } + buff3 = ((uint64)longbuff1 << 32) | longbuff2; + buff1 = (buff3 & match_bits) << (high_bit); + + if (ready_bits < 32) + { /* add another bps bits to the buffer */ + bytebuff1 = bytebuff2 = bytebuff3 = bytebuff4 = 0; + buff2 = (buff2 | (buff1 >> ready_bits)); + } + else /* If we have a full buffer's worth, write it out */ + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + bytebuff2 = (buff2 >> 48); + *dst++ = bytebuff2; + bytebuff3 = (buff2 >> 40); + *dst++ = bytebuff3; + bytebuff4 = (buff2 >> 32); + *dst++ = bytebuff4; + ready_bits -= 32; + + /* shift in new bits */ + buff2 = ((buff2 << 32) | (buff1 >> ready_bits)); + } + ready_bits += bps; + } + } + while (ready_bits > 0) + { + bytebuff1 = (buff2 >> 56); + *dst++ = bytebuff1; + buff2 = (buff2 << 8); + ready_bits -= 8; + } + + return (0); + } /* end reverseSamples32bits */ + +static int +reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width, + uint8 *src, uint8 *dst) + { + int i; + uint32 col, bytes_per_pixel, col_offset; + uint8 bytebuff1; + unsigned char swapbuff[32]; + + if ((src == NULL) || (dst == NULL)) + { + TIFFError("reverseSamplesBytes","Invalid input or output buffer"); + return (1); + } + + bytes_per_pixel = ((bps * spp) + 7) / 8; + switch (bps / 8) + { + case 8: /* Use memcpy for multiple bytes per sample data */ + case 4: + case 3: + case 2: for (col = 0; col < (width / 2); col++) + { + col_offset = col * bytes_per_pixel; + _TIFFmemcpy (swapbuff, src + col_offset, bytes_per_pixel); + _TIFFmemcpy (src + col_offset, dst - col_offset - bytes_per_pixel, bytes_per_pixel); + _TIFFmemcpy (dst - col_offset - bytes_per_pixel, swapbuff, bytes_per_pixel); + } + break; + case 1: /* Use byte copy only for single byte per sample data */ + for (col = 0; col < (width / 2); col++) + { + for (i = 0; i < spp; i++) + { + bytebuff1 = *src; + *src++ = *(dst - spp + i); + *(dst - spp + i) = bytebuff1; + } + dst -= spp; + } + break; + default: TIFFError("reverseSamplesBytes","Unsupported bit depth %d", bps); + return (1); + } + return (0); + } /* end reverseSamplesBytes */ + + +/* Mirror an image horizontally or vertically */ +static int +mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length, unsigned char *ibuff) + { + int shift_width; + uint32 bytes_per_pixel, bytes_per_sample; + uint32 row, rowsize, row_offset; + unsigned char *line_buff = NULL; + unsigned char *src; + unsigned char *dst; + + src = ibuff; + rowsize = ((width * bps * spp) + 7) / 8; + switch (mirror) + { + case MIRROR_BOTH: + case MIRROR_VERT: + line_buff = (unsigned char *)_TIFFmalloc(rowsize); + if (line_buff == NULL) + { + TIFFError ("mirrorImage", "Unable to allocate mirror line buffer of %1u bytes", rowsize); + return (-1); + } + + dst = ibuff + (rowsize * (length - 1)); + for (row = 0; row < length / 2; row++) + { + _TIFFmemcpy(line_buff, src, rowsize); + _TIFFmemcpy(src, dst, rowsize); + _TIFFmemcpy(dst, line_buff, rowsize); + src += (rowsize); + dst -= (rowsize); + } + if (line_buff) + _TIFFfree(line_buff); + if (mirror == MIRROR_VERT) + break; + case MIRROR_HORIZ : + if ((bps % 8) == 0) /* byte alligned data */ + { + for (row = 0; row < length; row++) + { + row_offset = row * rowsize; + src = ibuff + row_offset; + dst = ibuff + row_offset + rowsize; + if (reverseSamplesBytes(spp, bps, width, src, dst)) + { + return (-1); + } + } + } + else + { /* non 8 bit per sample data */ + if (!(line_buff = (unsigned char *)_TIFFmalloc(rowsize + 1))) + { + TIFFError("mirrorImage", "Unable to allocate mirror line buffer"); + return (-1); + } + bytes_per_sample = (bps + 7) / 8; + bytes_per_pixel = ((bps * spp) + 7) / 8; + if (bytes_per_pixel < (bytes_per_sample + 1)) + shift_width = bytes_per_pixel; + else + shift_width = bytes_per_sample + 1; + + for (row = 0; row < length; row++) + { + row_offset = row * rowsize; + src = ibuff + row_offset; + _TIFFmemset (line_buff, '\0', rowsize); + switch (shift_width) + { + case 1: if (reverseSamples16bits(spp, bps, width, src, line_buff)) + { + _TIFFfree(line_buff); + return (-1); + } + _TIFFmemcpy (src, line_buff, rowsize); + break; + case 2: if (reverseSamples24bits(spp, bps, width, src, line_buff)) + { + _TIFFfree(line_buff); + return (-1); + } + _TIFFmemcpy (src, line_buff, rowsize); + break; + case 3: + case 4: + case 5: if (reverseSamples32bits(spp, bps, width, src, line_buff)) + { + _TIFFfree(line_buff); + return (-1); + } + _TIFFmemcpy (src, line_buff, rowsize); + break; + default: TIFFError("mirrorImage","Unsupported bit depth %d", bps); + _TIFFfree(line_buff); + return (-1); + } + } + if (line_buff) + _TIFFfree(line_buff); + } + break; + + default: TIFFError ("mirrorImage", "Invalid mirror axis %d", mirror); + return (-1); + break; + } + + return (0); + } + +/* Invert the light and dark values for a bilevel or grayscale image */ +static int +invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 length, unsigned char *work_buff) + { + uint32 row, col; + unsigned char bytebuff1, bytebuff2, bytebuff3, bytebuff4; + unsigned char *src; + uint16 *src_uint16; + uint32 *src_uint32; + + if (spp != 1) + { + TIFFError("invertImage", "Image inversion not supported for more than one sample per pixel"); + return (-1); + } + + if (photometric != PHOTOMETRIC_MINISWHITE && photometric != PHOTOMETRIC_MINISBLACK) + { + TIFFError("invertImage", "Only black and white and grayscale images can be inverted"); + return (-1); + } + + src = work_buff; + if (src == NULL) + { + TIFFError ("invertImage", "Invalid crop buffer passed to invertImage"); + return (-1); + } + + switch (bps) + { + case 32: src_uint32 = (uint32 *)src; + for (row = 0; row < length; row++) + for (col = 0; col < width; col++) + { + *src_uint32 = (uint32)0xFFFFFFFF - *src_uint32; + src_uint32++; + } + break; + case 16: src_uint16 = (uint16 *)src; + for (row = 0; row < length; row++) + for (col = 0; col < width; col++) + { + *src_uint16 = (uint16)0xFFFF - *src_uint16; + src_uint16++; + } + break; + case 8: for (row = 0; row < length; row++) + for (col = 0; col < width; col++) + { + *src = (uint8)255 - *src; + src++; + } + break; + case 4: for (row = 0; row < length; row++) + for (col = 0; col < width; col++) + { + bytebuff1 = 16 - (uint8)(*src & 240 >> 4); + bytebuff2 = 16 - (*src & 15); + *src = bytebuff1 << 4 & bytebuff2; + src++; + } + break; + case 2: for (row = 0; row < length; row++) + for (col = 0; col < width; col++) + { + bytebuff1 = 4 - (uint8)(*src & 192 >> 6); + bytebuff2 = 4 - (uint8)(*src & 48 >> 4); + bytebuff3 = 4 - (uint8)(*src & 12 >> 2); + bytebuff4 = 4 - (uint8)(*src & 3); + *src = (bytebuff1 << 6) || (bytebuff2 << 4) || (bytebuff3 << 2) || bytebuff4; + src++; + } + break; + case 1: for (row = 0; row < length; row++) + for (col = 0; col < width; col += 8 /(spp * bps)) + { + *src = ~(*src); + src++; + } + break; + default: TIFFError("invertImage", "Unsupported bit depth %d", bps); + return (-1); + } + + return (0); + } + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdither.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdither.c new file mode 100644 index 0000000..3a377ac --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdither.c @@ -0,0 +1,333 @@ +/* $Id: tiffdither.c,v 1.12 2010-03-10 18:56:50 bfriesen Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) + +uint32 imagewidth; +uint32 imagelength; +int threshold = 128; + +static void usage(void); + +/* + * Floyd-Steinberg error propragation with threshold. + * This code is stolen from tiffmedian. + */ +static void +fsdither(TIFF* in, TIFF* out) +{ + unsigned char *outline, *inputline, *inptr; + short *thisline, *nextline, *tmpptr; + register unsigned char *outptr; + register short *thisptr, *nextptr; + register uint32 i, j; + uint32 imax, jmax; + int lastline, lastpixel; + int bit; + tsize_t outlinesize; + + imax = imagelength - 1; + jmax = imagewidth - 1; + inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + thisline = (short *)_TIFFmalloc(imagewidth * sizeof (short)); + nextline = (short *)_TIFFmalloc(imagewidth * sizeof (short)); + outlinesize = TIFFScanlineSize(out); + outline = (unsigned char *) _TIFFmalloc(outlinesize); + + /* + * Get first line + */ + if (TIFFReadScanline(in, inputline, 0, 0) <= 0) + goto skip_on_error; + + inptr = inputline; + nextptr = nextline; + for (j = 0; j < imagewidth; ++j) + *nextptr++ = *inptr++; + for (i = 1; i < imagelength; ++i) { + tmpptr = thisline; + thisline = nextline; + nextline = tmpptr; + lastline = (i == imax); + if (TIFFReadScanline(in, inputline, i, 0) <= 0) + break; + inptr = inputline; + nextptr = nextline; + for (j = 0; j < imagewidth; ++j) + *nextptr++ = *inptr++; + thisptr = thisline; + nextptr = nextline; + _TIFFmemset(outptr = outline, 0, outlinesize); + bit = 0x80; + for (j = 0; j < imagewidth; ++j) { + register int v; + + lastpixel = (j == jmax); + v = *thisptr++; + if (v < 0) + v = 0; + else if (v > 255) + v = 255; + if (v > threshold) { + *outptr |= bit; + v -= 255; + } + bit >>= 1; + if (bit == 0) { + outptr++; + bit = 0x80; + } + if (!lastpixel) + thisptr[0] += v * 7 / 16; + if (!lastline) { + if (j != 0) + nextptr[-1] += v * 3 / 16; + *nextptr++ += v * 5 / 16; + if (!lastpixel) + nextptr[0] += v / 16; + } + } + if (TIFFWriteScanline(out, outline, i-1, 0) < 0) + break; + } + skip_on_error: + _TIFFfree(inputline); + _TIFFfree(thisline); + _TIFFfree(nextline); + _TIFFfree(outline); +} + +static uint16 compression = COMPRESSION_PACKBITS; +static uint16 predictor = 0; +static uint32 group3options = 0; + +static void +processG3Options(char* cp) +{ + if ((cp = strchr(cp, ':'))) { + do { + cp++; + if (strneq(cp, "1d", 2)) + group3options &= ~GROUP3OPT_2DENCODING; + else if (strneq(cp, "2d", 2)) + group3options |= GROUP3OPT_2DENCODING; + else if (strneq(cp, "fill", 4)) + group3options |= GROUP3OPT_FILLBITS; + else + usage(); + } while ((cp = strchr(cp, ':'))); + } +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "g3", 2)) { + processG3Options(opt); + compression = COMPRESSION_CCITTFAX3; + } else if (streq(opt, "g4")) + compression = COMPRESSION_CCITTFAX4; + else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +int +main(int argc, char* argv[]) +{ + TIFF *in, *out; + uint16 samplesperpixel, bitspersample = 1, shortv; + float floatv; + char thing[1024]; + uint32 rowsperstrip = (uint32) -1; + uint16 fillorder = 0; + int c; + extern int optind; + extern char *optarg; + + while ((c = getopt(argc, argv, "c:f:r:t:")) != -1) + switch (c) { + case 'c': /* compression scheme */ + if (!processCompressOptions(optarg)) + usage(); + break; + case 'f': /* fill order */ + if (streq(optarg, "lsb2msb")) + fillorder = FILLORDER_LSB2MSB; + else if (streq(optarg, "msb2lsb")) + fillorder = FILLORDER_MSB2LSB; + else + usage(); + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case 't': + threshold = atoi(optarg); + if (threshold < 0) + threshold = 0; + else if (threshold > 255) + threshold = 255; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind < 2) + usage(); + in = TIFFOpen(argv[optind], "r"); + if (in == NULL) + return (-1); + TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + if (samplesperpixel != 1) { + fprintf(stderr, "%s: Not a b&w image.\n", argv[0]); + return (-1); + } + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); + if (bitspersample != 8) { + fprintf(stderr, + " %s: Sorry, only handle 8-bit samples.\n", argv[0]); + return (-1); + } + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return (-1); + CopyField(TIFFTAG_IMAGEWIDTH, imagewidth); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, imagelength-1); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1); + TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + if (fillorder) + TIFFSetField(out, TIFFTAG_FILLORDER, fillorder); + else + CopyField(TIFFTAG_FILLORDER, shortv); + sprintf(thing, "Dithered B&W version of %s", argv[optind]); + TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing); + CopyField(TIFFTAG_PHOTOMETRIC, shortv); + CopyField(TIFFTAG_ORIENTATION, shortv); + CopyField(TIFFTAG_XRESOLUTION, floatv); + CopyField(TIFFTAG_YRESOLUTION, floatv); + CopyField(TIFFTAG_RESOLUTIONUNIT, shortv); + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + switch (compression) { + case COMPRESSION_CCITTFAX3: + TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, group3options); + break; + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + fsdither(in, out); + TIFFClose(in); + TIFFClose(out); + return (0); +} + +char* stuff[] = { +"usage: tiffdither [options] input.tif output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +" -f lsb2msb force lsb-to-msb FillOrder for output", +" -f msb2lsb force msb-to-lsb FillOrder for output", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding", +" -c g3[:opts] compress output with CCITT Group 3 encoding", +" -c g4 compress output with CCITT Group 4 encoding", +" -c none use no compression algorithm on output", +"", +"Group 3 options:", +" 1d use default CCITT Group 3 1D-encoding", +" 2d use optional CCITT Group 3 2D-encoding", +" fill byte-align EOL codes", +"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdump.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdump.c new file mode 100644 index 0000000..c1caafb --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffdump.c @@ -0,0 +1,855 @@ +/* $Id: tiffdump.c,v 1.26 2012-06-15 21:51:54 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_IO_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#include "tiffio.h" + +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +static union +{ + TIFFHeaderClassic classic; + TIFFHeaderBig big; + TIFFHeaderCommon common; +} hdr; +char* appname; +char* curfile; +int swabflag; +int bigendian; +int bigtiff; +uint32 maxitems = 24; /* maximum indirect data items to print */ + +const char* bytefmt = "%s%#02x"; /* BYTE */ +const char* sbytefmt = "%s%d"; /* SBYTE */ +const char* shortfmt = "%s%u"; /* SHORT */ +const char* sshortfmt = "%s%d"; /* SSHORT */ +const char* longfmt = "%s%lu"; /* LONG */ +const char* slongfmt = "%s%ld"; /* SLONG */ +const char* ifdfmt = "%s%#04lx"; /* IFD offset */ +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) +const char* long8fmt = "%s%I64u"; /* LONG8 */ +const char* slong8fmt = "%s%I64d"; /* SLONG8 */ +const char* ifd8fmt = "%s%#08I64x"; /* IFD offset8*/ +#else +const char* long8fmt = "%s%llu"; /* LONG8 */ +const char* slong8fmt = "%s%lld"; /* SLONG8 */ +const char* ifd8fmt = "%s%#08llx"; /* IFD offset8*/ +#endif +const char* rationalfmt = "%s%g"; /* RATIONAL */ +const char* srationalfmt = "%s%g"; /* SRATIONAL */ +const char* floatfmt = "%s%g"; /* FLOAT */ +const char* doublefmt = "%s%g"; /* DOUBLE */ + +static void dump(int, uint64); +extern int optind; +extern char* optarg; + +void +usage() +{ + fprintf(stderr, "usage: %s [-h] [-o offset] [-m maxitems] file.tif ...\n", appname); + exit(-1); +} + +int +main(int argc, char* argv[]) +{ + int one = 1, fd; + int multiplefiles = (argc > 1); + int c; + uint64 diroff = 0; + bigendian = (*(char *)&one == 0); + + appname = argv[0]; + while ((c = getopt(argc, argv, "m:o:h")) != -1) { + switch (c) { + case 'h': /* print values in hex */ + shortfmt = "%s%#x"; + sshortfmt = "%s%#x"; + longfmt = "%s%#lx"; + slongfmt = "%s%#lx"; + break; + case 'o': + diroff = (uint64) strtoul(optarg, NULL, 0); + break; + case 'm': + maxitems = strtoul(optarg, NULL, 0); + break; + default: + usage(); + } + } + if (optind >= argc) + usage(); + for (; optind < argc; optind++) { + fd = open(argv[optind], O_RDONLY|O_BINARY, 0); + if (fd < 0) { + perror(argv[0]); + return (-1); + } + if (multiplefiles) + printf("%s:\n", argv[optind]); + curfile = argv[optind]; + swabflag = 0; + bigtiff = 0; + dump(fd, diroff); + close(fd); + } + return (0); +} + +#define ord(e) ((int)e) + +static uint64 ReadDirectory(int, unsigned, uint64); +static void ReadError(char*); +static void Error(const char*, ...); +static void Fatal(const char*, ...); + +static void +dump(int fd, uint64 diroff) +{ + unsigned i; + + lseek(fd, (off_t) 0, 0); + if (read(fd, (char*) &hdr, sizeof (TIFFHeaderCommon)) != sizeof (TIFFHeaderCommon)) + ReadError("TIFF header"); + if (hdr.common.tiff_magic != TIFF_BIGENDIAN + && hdr.common.tiff_magic != TIFF_LITTLEENDIAN && +#if HOST_BIGENDIAN + /* MDI is sensitive to the host byte order, unlike TIFF */ + MDI_BIGENDIAN != hdr.common.tiff_magic +#else + MDI_LITTLEENDIAN != hdr.common.tiff_magic +#endif + ) { + Fatal("Not a TIFF or MDI file, bad magic number %u (%#x)", + hdr.common.tiff_magic, hdr.common.tiff_magic); + } + if (hdr.common.tiff_magic == TIFF_BIGENDIAN + || hdr.common.tiff_magic == MDI_BIGENDIAN) + swabflag = !bigendian; + else + swabflag = bigendian; + if (swabflag) + TIFFSwabShort(&hdr.common.tiff_version); + if (hdr.common.tiff_version==42) + { + if (read(fd, (char*) &hdr.classic.tiff_diroff, 4) != 4) + ReadError("TIFF header"); + if (swabflag) + TIFFSwabLong(&hdr.classic.tiff_diroff); + printf("Magic: %#x <%s-endian> Version: %#x <%s>\n", + hdr.classic.tiff_magic, + hdr.classic.tiff_magic == TIFF_BIGENDIAN ? "big" : "little", + 42,"ClassicTIFF"); + if (diroff == 0) + diroff = hdr.classic.tiff_diroff; + } + else if (hdr.common.tiff_version==43) + { + if (read(fd, (char*) &hdr.big.tiff_offsetsize, 12) != 12) + ReadError("TIFF header"); + if (swabflag) + { + TIFFSwabShort(&hdr.big.tiff_offsetsize); + TIFFSwabShort(&hdr.big.tiff_unused); + TIFFSwabLong8(&hdr.big.tiff_diroff); + } + printf("Magic: %#x <%s-endian> Version: %#x <%s>\n", + hdr.big.tiff_magic, + hdr.big.tiff_magic == TIFF_BIGENDIAN ? "big" : "little", + 43,"BigTIFF"); + printf("OffsetSize: %#x Unused: %#x\n", + hdr.big.tiff_offsetsize,hdr.big.tiff_unused); + if (diroff == 0) + diroff = hdr.big.tiff_diroff; + bigtiff = 1; + } + else + Fatal("Not a TIFF file, bad version number %u (%#x)", + hdr.common.tiff_version, hdr.common.tiff_version); + for (i = 0; diroff != 0; i++) { + if (i > 0) + putchar('\n'); + diroff = ReadDirectory(fd, i, diroff); + } +} + +static const int datawidth[] = { + 0, /* 00 = undefined */ + 1, /* 01 = TIFF_BYTE */ + 1, /* 02 = TIFF_ASCII */ + 2, /* 03 = TIFF_SHORT */ + 4, /* 04 = TIFF_LONG */ + 8, /* 05 = TIFF_RATIONAL */ + 1, /* 06 = TIFF_SBYTE */ + 1, /* 07 = TIFF_UNDEFINED */ + 2, /* 08 = TIFF_SSHORT */ + 4, /* 09 = TIFF_SLONG */ + 8, /* 10 = TIFF_SRATIONAL */ + 4, /* 11 = TIFF_FLOAT */ + 8, /* 12 = TIFF_DOUBLE */ + 4, /* 13 = TIFF_IFD */ + 0, /* 14 = undefined */ + 0, /* 15 = undefined */ + 8, /* 16 = TIFF_LONG8 */ + 8, /* 17 = TIFF_SLONG8 */ + 8, /* 18 = TIFF_IFD8 */ +}; +#define NWIDTHS (sizeof (datawidth) / sizeof (datawidth[0])) +static void PrintTag(FILE*, uint16); +static void PrintType(FILE*, uint16); +static void PrintData(FILE*, uint16, uint32, unsigned char*); + +/* + * Read the next TIFF directory from a file + * and convert it to the internal format. + * We read directories sequentially. + */ +static uint64 +ReadDirectory(int fd, unsigned int ix, uint64 off) +{ + uint16 dircount; + uint32 direntrysize; + void* dirmem = NULL; + uint64 nextdiroff = 0; + uint32 n; + uint8* dp; + + if (off == 0) /* no more directories */ + goto done; +#if defined(__WIN32__) && defined(_MSC_VER) + if (_lseeki64(fd, (__int64)off, SEEK_SET) != (__int64)off) { +#else + if (lseek(fd, (off_t)off, SEEK_SET) != (off_t)off) { +#endif + Fatal("Seek error accessing TIFF directory"); + goto done; + } + if (!bigtiff) { + if (read(fd, (char*) &dircount, sizeof (uint16)) != sizeof (uint16)) { + ReadError("directory count"); + goto done; + } + if (swabflag) + TIFFSwabShort(&dircount); + direntrysize = 12; + } else { + uint64 dircount64 = 0; + if (read(fd, (char*) &dircount64, sizeof (uint64)) != sizeof (uint64)) { + ReadError("directory count"); + goto done; + } + if (swabflag) + TIFFSwabLong8(&dircount64); + if (dircount64>0xFFFF) { + Error("Sanity check on directory count failed"); + goto done; + } + dircount = (uint16)dircount64; + direntrysize = 20; + } + dirmem = _TIFFmalloc(dircount * direntrysize); + if (dirmem == NULL) { + Fatal("No space for TIFF directory"); + goto done; + } + n = read(fd, (char*) dirmem, dircount*direntrysize); + if (n != dircount*direntrysize) { + n /= direntrysize; + Error( +#if defined(__WIN32__) && defined(_MSC_VER) + "Could only read %lu of %u entries in directory at offset %#I64x", + (unsigned long)n, dircount, (unsigned __int64) off); +#else + "Could only read %lu of %u entries in directory at offset %#llx", + (unsigned long)n, dircount, (unsigned long long) off); +#endif + dircount = n; + nextdiroff = 0; + } else { + if (!bigtiff) { + uint32 nextdiroff32; + if (read(fd, (char*) &nextdiroff32, sizeof (uint32)) != sizeof (uint32)) + nextdiroff32 = 0; + if (swabflag) + TIFFSwabLong(&nextdiroff32); + nextdiroff = nextdiroff32; + } else { + if (read(fd, (char*) &nextdiroff, sizeof (uint64)) != sizeof (uint64)) + nextdiroff = 0; + if (swabflag) + TIFFSwabLong8(&nextdiroff); + } + } +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + printf("Directory %u: offset %I64u (%#I64x) next %I64u (%#I64x)\n", ix, + (unsigned __int64)off, (unsigned __int64)off, + (unsigned __int64)nextdiroff, (unsigned __int64)nextdiroff); +#else + printf("Directory %u: offset %llu (%#llx) next %llu (%#llx)\n", ix, + (unsigned long long)off, (unsigned long long)off, + (unsigned long long)nextdiroff, (unsigned long long)nextdiroff); +#endif + for (dp = (uint8*)dirmem, n = dircount; n > 0; n--) { + uint16 tag; + uint16 type; + uint16 typewidth; + uint64 count; + uint64 datasize; + int datafits; + void* datamem; + uint64 dataoffset; + int datatruncated; + tag = *(uint16*)dp; + if (swabflag) + TIFFSwabShort(&tag); + dp += sizeof(uint16); + type = *(uint16*)dp; + dp += sizeof(uint16); + if (swabflag) + TIFFSwabShort(&type); + PrintTag(stdout, tag); + putchar(' '); + PrintType(stdout, type); + putchar(' '); + if (!bigtiff) + { + uint32 count32; + count32 = *(uint32*)dp; + if (swabflag) + TIFFSwabLong(&count32); + dp += sizeof(uint32); + count = count32; + } + else + { + count = *(uint64*)dp; + if (swabflag) + TIFFSwabLong8(&count); + dp += sizeof(uint64); + } +#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__)) + printf("%I64u<", (unsigned __int64)count); +#else + printf("%llu<", (unsigned long long)count); +#endif + if (type >= NWIDTHS) + typewidth = 0; + else + typewidth = datawidth[type]; + datasize = count*typewidth; + datafits = 1; + datamem = dp; + dataoffset = 0; + datatruncated = 0; + if (!bigtiff) + { + if (datasize>4) + { + uint32 dataoffset32; + datafits = 0; + datamem = NULL; + dataoffset32 = *(uint32*)dp; + if (swabflag) + TIFFSwabLong(&dataoffset32); + dataoffset = dataoffset32; + } + dp += sizeof(uint32); + } + else + { + if (datasize>8) + { + datafits = 0; + datamem = NULL; + dataoffset = *(uint64*)dp; + if (swabflag) + TIFFSwabLong8(&dataoffset); + } + dp += sizeof(uint64); + } + if (datasize>0x10000) + { + datatruncated = 1; + count = 0x10000/typewidth; + datasize = count*typewidth; + } + if (count>maxitems) + { + datatruncated = 1; + count = maxitems; + datasize = count*typewidth; + } + if (!datafits) + { + datamem = _TIFFmalloc((uint32)datasize); + if (datamem) { +#if defined(__WIN32__) && defined(_MSC_VER) + if (_lseeki64(fd, (__int64)dataoffset, SEEK_SET) + != (__int64)dataoffset) +#else + if (lseek(fd, (off_t)dataoffset, 0) != + (off_t)dataoffset) +#endif + { + Error( + "Seek error accessing tag %u value", tag); + _TIFFfree(datamem); + datamem = NULL; + } + if (read(fd, datamem, (size_t)datasize) != (TIFF_SSIZE_T)datasize) + { + Error( + "Read error accessing tag %u value", tag); + _TIFFfree(datamem); + datamem = NULL; + } + } else + Error("No space for data for tag %u",tag); + } + if (datamem) + { + if (swabflag) + { + switch (type) + { + case TIFF_BYTE: + case TIFF_ASCII: + case TIFF_SBYTE: + case TIFF_UNDEFINED: + break; + case TIFF_SHORT: + case TIFF_SSHORT: + TIFFSwabArrayOfShort((uint16*)datamem,(tmsize_t)count); + break; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + case TIFF_IFD: + TIFFSwabArrayOfLong((uint32*)datamem,(tmsize_t)count); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + TIFFSwabArrayOfLong((uint32*)datamem,(tmsize_t)count*2); + break; + case TIFF_DOUBLE: + case TIFF_LONG8: + case TIFF_SLONG8: + case TIFF_IFD8: + TIFFSwabArrayOfLong8((uint64*)datamem,(tmsize_t)count); + break; + } + } + PrintData(stdout,type,(uint32)count,datamem); + if (datatruncated) + printf(" ..."); + if (!datafits) + _TIFFfree(datamem); + } + printf(">\n"); + } +done: + if (dirmem) + _TIFFfree((char *)dirmem); + return (nextdiroff); +} + +static const struct tagname { + uint16 tag; + const char* name; +} tagnames[] = { + { TIFFTAG_SUBFILETYPE, "SubFileType" }, + { TIFFTAG_OSUBFILETYPE, "OldSubFileType" }, + { TIFFTAG_IMAGEWIDTH, "ImageWidth" }, + { TIFFTAG_IMAGELENGTH, "ImageLength" }, + { TIFFTAG_BITSPERSAMPLE, "BitsPerSample" }, + { TIFFTAG_COMPRESSION, "Compression" }, + { TIFFTAG_PHOTOMETRIC, "Photometric" }, + { TIFFTAG_THRESHHOLDING, "Threshholding" }, + { TIFFTAG_CELLWIDTH, "CellWidth" }, + { TIFFTAG_CELLLENGTH, "CellLength" }, + { TIFFTAG_FILLORDER, "FillOrder" }, + { TIFFTAG_DOCUMENTNAME, "DocumentName" }, + { TIFFTAG_IMAGEDESCRIPTION, "ImageDescription" }, + { TIFFTAG_MAKE, "Make" }, + { TIFFTAG_MODEL, "Model" }, + { TIFFTAG_STRIPOFFSETS, "StripOffsets" }, + { TIFFTAG_ORIENTATION, "Orientation" }, + { TIFFTAG_SAMPLESPERPIXEL, "SamplesPerPixel" }, + { TIFFTAG_ROWSPERSTRIP, "RowsPerStrip" }, + { TIFFTAG_STRIPBYTECOUNTS, "StripByteCounts" }, + { TIFFTAG_MINSAMPLEVALUE, "MinSampleValue" }, + { TIFFTAG_MAXSAMPLEVALUE, "MaxSampleValue" }, + { TIFFTAG_XRESOLUTION, "XResolution" }, + { TIFFTAG_YRESOLUTION, "YResolution" }, + { TIFFTAG_PLANARCONFIG, "PlanarConfig" }, + { TIFFTAG_PAGENAME, "PageName" }, + { TIFFTAG_XPOSITION, "XPosition" }, + { TIFFTAG_YPOSITION, "YPosition" }, + { TIFFTAG_FREEOFFSETS, "FreeOffsets" }, + { TIFFTAG_FREEBYTECOUNTS, "FreeByteCounts" }, + { TIFFTAG_GRAYRESPONSEUNIT, "GrayResponseUnit" }, + { TIFFTAG_GRAYRESPONSECURVE,"GrayResponseCurve" }, + { TIFFTAG_GROUP3OPTIONS, "Group3Options" }, + { TIFFTAG_GROUP4OPTIONS, "Group4Options" }, + { TIFFTAG_RESOLUTIONUNIT, "ResolutionUnit" }, + { TIFFTAG_PAGENUMBER, "PageNumber" }, + { TIFFTAG_COLORRESPONSEUNIT,"ColorResponseUnit" }, + { TIFFTAG_TRANSFERFUNCTION, "TransferFunction" }, + { TIFFTAG_SOFTWARE, "Software" }, + { TIFFTAG_DATETIME, "DateTime" }, + { TIFFTAG_ARTIST, "Artist" }, + { TIFFTAG_HOSTCOMPUTER, "HostComputer" }, + { TIFFTAG_PREDICTOR, "Predictor" }, + { TIFFTAG_WHITEPOINT, "Whitepoint" }, + { TIFFTAG_PRIMARYCHROMATICITIES,"PrimaryChromaticities" }, + { TIFFTAG_COLORMAP, "Colormap" }, + { TIFFTAG_HALFTONEHINTS, "HalftoneHints" }, + { TIFFTAG_TILEWIDTH, "TileWidth" }, + { TIFFTAG_TILELENGTH, "TileLength" }, + { TIFFTAG_TILEOFFSETS, "TileOffsets" }, + { TIFFTAG_TILEBYTECOUNTS, "TileByteCounts" }, + { TIFFTAG_BADFAXLINES, "BadFaxLines" }, + { TIFFTAG_CLEANFAXDATA, "CleanFaxData" }, + { TIFFTAG_CONSECUTIVEBADFAXLINES, "ConsecutiveBadFaxLines" }, + { TIFFTAG_SUBIFD, "SubIFD" }, + { TIFFTAG_INKSET, "InkSet" }, + { TIFFTAG_INKNAMES, "InkNames" }, + { TIFFTAG_NUMBEROFINKS, "NumberOfInks" }, + { TIFFTAG_DOTRANGE, "DotRange" }, + { TIFFTAG_TARGETPRINTER, "TargetPrinter" }, + { TIFFTAG_EXTRASAMPLES, "ExtraSamples" }, + { TIFFTAG_SAMPLEFORMAT, "SampleFormat" }, + { TIFFTAG_SMINSAMPLEVALUE, "SMinSampleValue" }, + { TIFFTAG_SMAXSAMPLEVALUE, "SMaxSampleValue" }, + { TIFFTAG_JPEGPROC, "JPEGProcessingMode" }, + { TIFFTAG_JPEGIFOFFSET, "JPEGInterchangeFormat" }, + { TIFFTAG_JPEGIFBYTECOUNT, "JPEGInterchangeFormatLength" }, + { TIFFTAG_JPEGRESTARTINTERVAL,"JPEGRestartInterval" }, + { TIFFTAG_JPEGLOSSLESSPREDICTORS,"JPEGLosslessPredictors" }, + { TIFFTAG_JPEGPOINTTRANSFORM,"JPEGPointTransform" }, + { TIFFTAG_JPEGTABLES, "JPEGTables" }, + { TIFFTAG_JPEGQTABLES, "JPEGQTables" }, + { TIFFTAG_JPEGDCTABLES, "JPEGDCTables" }, + { TIFFTAG_JPEGACTABLES, "JPEGACTables" }, + { TIFFTAG_YCBCRCOEFFICIENTS,"YCbCrCoefficients" }, + { TIFFTAG_YCBCRSUBSAMPLING, "YCbCrSubsampling" }, + { TIFFTAG_YCBCRPOSITIONING, "YCbCrPositioning" }, + { TIFFTAG_REFERENCEBLACKWHITE, "ReferenceBlackWhite" }, + { TIFFTAG_REFPTS, "IgReferencePoints (Island Graphics)" }, + { TIFFTAG_REGIONTACKPOINT, "IgRegionTackPoint (Island Graphics)" }, + { TIFFTAG_REGIONWARPCORNERS,"IgRegionWarpCorners (Island Graphics)" }, + { TIFFTAG_REGIONAFFINE, "IgRegionAffine (Island Graphics)" }, + { TIFFTAG_MATTEING, "OBSOLETE Matteing (Silicon Graphics)" }, + { TIFFTAG_DATATYPE, "OBSOLETE DataType (Silicon Graphics)" }, + { TIFFTAG_IMAGEDEPTH, "ImageDepth (Silicon Graphics)" }, + { TIFFTAG_TILEDEPTH, "TileDepth (Silicon Graphics)" }, + { 32768, "OLD BOGUS Matteing tag" }, + { TIFFTAG_COPYRIGHT, "Copyright" }, + { TIFFTAG_ICCPROFILE, "ICC Profile" }, + { TIFFTAG_JBIGOPTIONS, "JBIG Options" }, + { TIFFTAG_STONITS, "StoNits" }, +}; +#define NTAGS (sizeof (tagnames) / sizeof (tagnames[0])) + +static void +PrintTag(FILE* fd, uint16 tag) +{ + const struct tagname *tp; + + for (tp = tagnames; tp < &tagnames[NTAGS]; tp++) + if (tp->tag == tag) { + fprintf(fd, "%s (%u)", tp->name, tag); + return; + } + fprintf(fd, "%u (%#x)", tag, tag); +} + +static void +PrintType(FILE* fd, uint16 type) +{ + static const char *typenames[] = { + "0", + "BYTE", + "ASCII", + "SHORT", + "LONG", + "RATIONAL", + "SBYTE", + "UNDEFINED", + "SSHORT", + "SLONG", + "SRATIONAL", + "FLOAT", + "DOUBLE", + "IFD", + "14", + "15", + "LONG8", + "SLONG8", + "IFD8" + }; +#define NTYPES (sizeof (typenames) / sizeof (typenames[0])) + + if (type < NTYPES) + fprintf(fd, "%s (%u)", typenames[type], type); + else + fprintf(fd, "%u (%#x)", type, type); +} +#undef NTYPES + +#include + +static void +PrintASCII(FILE* fd, uint32 cc, const unsigned char* cp) +{ + for (; cc > 0; cc--, cp++) { + const char* tp; + + if (isprint(*cp)) { + fputc(*cp, fd); + continue; + } + for (tp = "\tt\bb\rr\nn\vv"; *tp; tp++) + if (*tp++ == *cp) + break; + if (*tp) + fprintf(fd, "\\%c", *tp); + else if (*cp) + fprintf(fd, "\\%03o", *cp); + else + fprintf(fd, "\\0"); + } +} + +static void +PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data) +{ + char* sep = ""; + + switch (type) { + case TIFF_BYTE: + while (count-- > 0) + fprintf(fd, bytefmt, sep, *data++), sep = " "; + break; + case TIFF_SBYTE: + while (count-- > 0) + fprintf(fd, sbytefmt, sep, *(char *)data++), sep = " "; + break; + case TIFF_UNDEFINED: + while (count-- > 0) + fprintf(fd, bytefmt, sep, *data++), sep = " "; + break; + case TIFF_ASCII: + PrintASCII(fd, count, data); + break; + case TIFF_SHORT: { + uint16 *wp = (uint16*)data; + while (count-- > 0) + fprintf(fd, shortfmt, sep, *wp++), sep = " "; + break; + } + case TIFF_SSHORT: { + int16 *wp = (int16*)data; + while (count-- > 0) + fprintf(fd, sshortfmt, sep, *wp++), sep = " "; + break; + } + case TIFF_LONG: { + uint32 *lp = (uint32*)data; + while (count-- > 0) { + fprintf(fd, longfmt, sep, (unsigned long) *lp++); + sep = " "; + } + break; + } + case TIFF_SLONG: { + int32 *lp = (int32*)data; + while (count-- > 0) + fprintf(fd, slongfmt, sep, (long) *lp++), sep = " "; + break; + } + case TIFF_LONG8: { + uint64 *llp = (uint64*)data; + while (count-- > 0) { +#if defined(__WIN32__) && defined(_MSC_VER) + fprintf(fd, long8fmt, sep, (unsigned __int64) *llp++); +#else + fprintf(fd, long8fmt, sep, (unsigned long long) *llp++); +#endif + sep = " "; + } + break; + } + case TIFF_SLONG8: { + int64 *llp = (int64*)data; + while (count-- > 0) +#if defined(__WIN32__) && defined(_MSC_VER) + fprintf(fd, slong8fmt, sep, (__int64) *llp++), sep = " "; +#else + fprintf(fd, slong8fmt, sep, (long long) *llp++), sep = " "; +#endif + break; + } + case TIFF_RATIONAL: { + uint32 *lp = (uint32*)data; + while (count-- > 0) { + if (lp[1] == 0) + fprintf(fd, "%sNan (%lu/%lu)", sep, + (unsigned long) lp[0], + (unsigned long) lp[1]); + else + fprintf(fd, rationalfmt, sep, + (double)lp[0] / (double)lp[1]); + sep = " "; + lp += 2; + } + break; + } + case TIFF_SRATIONAL: { + int32 *lp = (int32*)data; + while (count-- > 0) { + if (lp[1] == 0) + fprintf(fd, "%sNan (%ld/%ld)", sep, + (long) lp[0], (long) lp[1]); + else + fprintf(fd, srationalfmt, sep, + (double)lp[0] / (double)lp[1]); + sep = " "; + lp += 2; + } + break; + } + case TIFF_FLOAT: { + float *fp = (float *)data; + while (count-- > 0) + fprintf(fd, floatfmt, sep, *fp++), sep = " "; + break; + } + case TIFF_DOUBLE: { + double *dp = (double *)data; + while (count-- > 0) + fprintf(fd, doublefmt, sep, *dp++), sep = " "; + break; + } + case TIFF_IFD: { + uint32 *lp = (uint32*)data; + while (count-- > 0) { + fprintf(fd, ifdfmt, sep, (unsigned long) *lp++); + sep = " "; + } + break; + } + case TIFF_IFD8: { + uint64 *llp = (uint64*)data; + while (count-- > 0) { +#if defined(__WIN32__) && defined(_MSC_VER) + fprintf(fd, ifd8fmt, sep, (unsigned __int64) *llp++); +#else + fprintf(fd, ifd8fmt, sep, (unsigned long long) *llp++); +#endif + sep = " "; + } + break; + } + } +} + +static void +ReadError(char* what) +{ + Fatal("Error while reading %s", what); +} + +#include + +static void +vError(FILE* fd, const char* fmt, va_list ap) +{ + fprintf(fd, "%s: ", curfile); + vfprintf(fd, fmt, ap); + fprintf(fd, ".\n"); +} + +static void +Error(const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vError(stderr, fmt, ap); + va_end(ap); +} + +static void +Fatal(const char* fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vError(stderr, fmt, ap); + va_end(ap); + exit(-1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffgt.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffgt.c new file mode 100644 index 0000000..de42039 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffgt.c @@ -0,0 +1,466 @@ +/* $Id: tiffgt.c,v 1.10 2010-07-01 15:56:56 dron Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * Copyright (c) 2003, Andrey Kiselev + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" +#include +#include +#include +#include + +#if HAVE_APPLE_OPENGL_FRAMEWORK +# include +# include +#else +# include +# include +#endif + +#include "tiffio.h" +#include "tiffiop.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +static uint32 width = 0, height = 0; /* window width & height */ +static uint32* raster = NULL; /* displayable image */ +static TIFFRGBAImage img; +static int order0 = 0, order; +static uint16 photo0 = (uint16) -1, photo; +static int stoponerr = 0; /* stop on read error */ +static int verbose = 0; +#define TITLE_LENGTH 1024 +static char title[TITLE_LENGTH]; /* window title line */ +static uint32 xmax, ymax; +static char** filelist = NULL; +static int fileindex; +static int filenum; +static TIFFErrorHandler oerror; +static TIFFErrorHandler owarning; + +static void cleanup_and_exit(void); +static int initImage(void); +static int prevImage(void); +static int nextImage(void); +static void setWindowSize(void); +static void usage(void); +static uint16 photoArg(const char*); +static void raster_draw(void); +static void raster_reshape(int, int); +static void raster_keys(unsigned char, int, int); +static void raster_special(int, int, int); + +extern char* optarg; +extern int optind; +static TIFF* tif = NULL; + +int +main(int argc, char* argv[]) +{ + int c; + int dirnum = -1; + uint32 diroff = 0; + + oerror = TIFFSetErrorHandler(NULL); + owarning = TIFFSetWarningHandler(NULL); + while ((c = getopt(argc, argv, "d:o:p:eflmsvw?")) != -1) + switch (c) { + case 'd': + dirnum = atoi(optarg); + break; + case 'e': + oerror = TIFFSetErrorHandler(oerror); + break; + case 'l': + order0 = FILLORDER_LSB2MSB; + break; + case 'm': + order0 = FILLORDER_MSB2LSB; + break; + case 'o': + diroff = strtoul(optarg, NULL, 0); + break; + case 'p': + photo0 = photoArg(optarg); + break; + case 's': + stoponerr = 1; + break; + case 'w': + owarning = TIFFSetWarningHandler(owarning); + break; + case 'v': + verbose = 1; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + filenum = argc - optind; + if ( filenum < 1) + usage(); + + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); + + /* + * Get the screen size + */ + xmax = glutGet(GLUT_SCREEN_WIDTH); + ymax = glutGet(GLUT_SCREEN_HEIGHT); + + /* + * Use 90% of the screen size + */ + xmax = xmax - xmax / 10.0; + ymax = ymax - ymax / 10.0; + + filelist = (char **) _TIFFmalloc(filenum * sizeof(char*)); + if (!filelist) { + TIFFError(argv[0], "Can not allocate space for the file list."); + return 1; + } + _TIFFmemcpy(filelist, argv + optind, filenum * sizeof(char*)); + fileindex = -1; + if (nextImage() < 0) { + _TIFFfree(filelist); + return 2; + } + /* + * Set initial directory if user-specified + * file was opened successfully. + */ + if (dirnum != -1 && !TIFFSetDirectory(tif, dirnum)) + TIFFError(argv[0], "Error, seeking to directory %d", dirnum); + if (diroff != 0 && !TIFFSetSubDirectory(tif, diroff)) + TIFFError(argv[0], "Error, setting subdirectory at %#x", diroff); + order = order0; + photo = photo0; + if (initImage() < 0){ + _TIFFfree(filelist); + return 3; + } + /* + * Create a new window or reconfigure an existing + * one to suit the image to be displayed. + */ + glutInitWindowSize(width, height); + snprintf(title, TITLE_LENGTH - 1, "%s [%u]", filelist[fileindex], + (unsigned int) TIFFCurrentDirectory(tif)); + glutCreateWindow(title); + glutDisplayFunc(raster_draw); + glutReshapeFunc(raster_reshape); + glutKeyboardFunc(raster_keys); + glutSpecialFunc(raster_special); + glutMainLoop(); + + cleanup_and_exit(); + return 0; +} + +static void +cleanup_and_exit(void) +{ + TIFFRGBAImageEnd(&img); + if (filelist != NULL) + _TIFFfree(filelist); + if (raster != NULL) + _TIFFfree(raster); + if (tif != NULL) + TIFFClose(tif); + exit(0); +} + +static int +initImage(void) +{ + uint32 w, h; + + if (order) + TIFFSetField(tif, TIFFTAG_FILLORDER, order); + if (photo != (uint16) -1) + TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photo); + if (!TIFFRGBAImageBegin(&img, tif, stoponerr, title)) { + TIFFError(filelist[fileindex], "%s", title); + TIFFClose(tif); + tif = NULL; + return -1; + } + + /* + * Setup the image raster as required. + */ + h = img.height; + w = img.width; + if (h > ymax) { + w = (int)(w * ((float)ymax / h)); + h = ymax; + } + if (w > xmax) { + h = (int)(h * ((float)xmax / w)); + w = xmax; + } + + if (w != width || h != height) { + uint32 rastersize = + _TIFFMultiply32(tif, img.width, img.height, "allocating raster buffer"); + if (raster != NULL) + _TIFFfree(raster), raster = NULL; + raster = (uint32*) _TIFFCheckMalloc(tif, rastersize, sizeof (uint32), + "allocating raster buffer"); + if (raster == NULL) { + width = height = 0; + TIFFError(filelist[fileindex], "No space for raster buffer"); + cleanup_and_exit(); + } + width = w; + height = h; + } + TIFFRGBAImageGet(&img, raster, img.width, img.height); +#if HOST_BIGENDIAN + TIFFSwabArrayOfLong(raster,img.width*img.height); +#endif + return 0; +} + +static int +prevImage(void) +{ + if (fileindex > 0) + fileindex--; + else if (tif) + return fileindex; + if (tif) + TIFFClose(tif); + tif = TIFFOpen(filelist[fileindex], "r"); + if (tif == NULL) + return -1; + return fileindex; +} + +static int +nextImage(void) +{ + if (fileindex < filenum - 1) + fileindex++; + else if (tif) + return fileindex; + if (tif) + TIFFClose(tif); + tif = TIFFOpen(filelist[fileindex], "r"); + if (tif == NULL) + return -1; + return fileindex; +} + +static void +setWindowSize(void) +{ + glutReshapeWindow(width, height); +} + +static void +raster_draw(void) +{ + glDrawPixels(img.width, img.height, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) raster); +} + +static void +raster_reshape(int win_w, int win_h) +{ + GLfloat xratio = (GLfloat)win_w/img.width; + GLfloat yratio = (GLfloat)win_h/img.height; + int ratio = (int)(((xratio > yratio)?xratio:yratio) * 100); + + glPixelZoom(xratio, yratio); + glViewport(0, 0, win_w, win_h); + snprintf(title, 1024, "%s [%u] %d%%", filelist[fileindex], + (unsigned int) TIFFCurrentDirectory(tif), ratio); + glutSetWindowTitle(title); +} + +static void +raster_keys(unsigned char key, int x, int y) +{ + switch (key) { + case 'b': /* photometric MinIsBlack */ + photo = PHOTOMETRIC_MINISBLACK; + initImage(); + break; + case 'l': /* lsb-to-msb FillOrder */ + order = FILLORDER_LSB2MSB; + initImage(); + break; + case 'm': /* msb-to-lsb FillOrder */ + order = FILLORDER_MSB2LSB; + initImage(); + break; + case 'w': /* photometric MinIsWhite */ + photo = PHOTOMETRIC_MINISWHITE; + initImage(); + break; + case 'W': /* toggle warnings */ + owarning = TIFFSetWarningHandler(owarning); + initImage(); + break; + case 'E': /* toggle errors */ + oerror = TIFFSetErrorHandler(oerror); + initImage(); + break; + case 'z': /* reset to defaults */ + case 'Z': + order = order0; + photo = photo0; + if (owarning == NULL) + owarning = TIFFSetWarningHandler(NULL); + if (oerror == NULL) + oerror = TIFFSetErrorHandler(NULL); + initImage(); + break; + case 'q': /* exit */ + case '\033': + cleanup_and_exit(); + } + glutPostRedisplay(); +} + +static void +raster_special(int key, int x, int y) +{ + switch (key) { + case GLUT_KEY_PAGE_UP: /* previous logical image */ + if (TIFFCurrentDirectory(tif) > 0) { + if (TIFFSetDirectory(tif, + TIFFCurrentDirectory(tif)-1)) { + initImage(); + setWindowSize(); + } + } else { + TIFFRGBAImageEnd(&img); + prevImage(); + initImage(); + setWindowSize(); + } + break; + case GLUT_KEY_PAGE_DOWN: /* next logical image */ + if (!TIFFLastDirectory(tif)) { + if (TIFFReadDirectory(tif)) { + initImage(); + setWindowSize(); + } + } else { + TIFFRGBAImageEnd(&img); + nextImage(); + initImage(); + setWindowSize(); + } + break; + case GLUT_KEY_HOME: /* 1st image in current file */ + if (TIFFSetDirectory(tif, 0)) { + TIFFRGBAImageEnd(&img); + initImage(); + setWindowSize(); + } + break; + case GLUT_KEY_END: /* last image in current file */ + TIFFRGBAImageEnd(&img); + while (!TIFFLastDirectory(tif)) + TIFFReadDirectory(tif); + initImage(); + setWindowSize(); + break; + } + glutPostRedisplay(); +} + + + +char* stuff[] = { +"usage: tiffgt [options] file.tif", +"where options are:", +" -c use colormap visual", +" -d dirnum set initial directory (default is 0)", +" -e enable display of TIFF error messages", +" -l force lsb-to-msb FillOrder", +" -m force msb-to-lsb FillOrder", +" -o offset set initial directory offset", +" -p photo override photometric interpretation", +" -r use fullcolor visual", +" -s stop decoding on first error (default is ignore errors)", +" -v enable verbose mode", +" -w enable display of TIFF warning messages", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +static uint16 +photoArg(const char* arg) +{ + if (strcmp(arg, "miniswhite") == 0) + return (PHOTOMETRIC_MINISWHITE); + else if (strcmp(arg, "minisblack") == 0) + return (PHOTOMETRIC_MINISBLACK); + else if (strcmp(arg, "rgb") == 0) + return (PHOTOMETRIC_RGB); + else if (strcmp(arg, "palette") == 0) + return (PHOTOMETRIC_PALETTE); + else if (strcmp(arg, "mask") == 0) + return (PHOTOMETRIC_MASK); + else if (strcmp(arg, "separated") == 0) + return (PHOTOMETRIC_SEPARATED); + else if (strcmp(arg, "ycbcr") == 0) + return (PHOTOMETRIC_YCBCR); + else if (strcmp(arg, "cielab") == 0) + return (PHOTOMETRIC_CIELAB); + else if (strcmp(arg, "logl") == 0) + return (PHOTOMETRIC_LOGL); + else if (strcmp(arg, "logluv") == 0) + return (PHOTOMETRIC_LOGLUV); + else + return ((uint16) -1); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffinfo.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffinfo.c new file mode 100644 index 0000000..ae1a5f6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffinfo.c @@ -0,0 +1,472 @@ +/* $Id: tiffinfo.c,v 1.21 2012-06-06 06:05:29 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1988-1997 Sam Leffler + * Copyright (c) 1991-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_STRINGS_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffiop.h" + +static TIFFErrorHandler old_error_handler = 0; +static int status = 0; /* exit status */ +static int showdata = 0; /* show data */ +static int rawdata = 0; /* show raw/decoded data */ +static int showwords = 0; /* show data as bytes/words */ +static int readdata = 0; /* read data in file */ +static int stoponerr = 1; /* stop on first read error */ + +static void usage(void); +static void tiffinfo(TIFF*, uint16, long, int); + +static void +PrivateErrorHandler(const char* module, const char* fmt, va_list ap) +{ + if (old_error_handler) + (*old_error_handler)(module,fmt,ap); + status = 1; +} + +int +main(int argc, char* argv[]) +{ + int dirnum = -1, multiplefiles, c; + uint16 order = 0; + TIFF* tif; + extern int optind; + extern char* optarg; + long flags = 0; + uint64 diroff = 0; + int chopstrips = 0; /* disable strip chopping */ + + while ((c = getopt(argc, argv, "f:o:cdDSjilmrsvwz0123456789")) != -1) + switch (c) { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + dirnum = atoi(&argv[optind-1][1]); + break; + case 'd': + showdata++; + /* fall thru... */ + case 'D': + readdata++; + break; + case 'c': + flags |= TIFFPRINT_COLORMAP | TIFFPRINT_CURVES; + break; + case 'f': /* fill order */ + if (streq(optarg, "lsb2msb")) + order = FILLORDER_LSB2MSB; + else if (streq(optarg, "msb2lsb")) + order = FILLORDER_MSB2LSB; + else + usage(); + break; + case 'i': + stoponerr = 0; + break; + case 'o': + diroff = strtoul(optarg, NULL, 0); + break; + case 'j': + flags |= TIFFPRINT_JPEGQTABLES | + TIFFPRINT_JPEGACTABLES | + TIFFPRINT_JPEGDCTABLES; + break; + case 'r': + rawdata = 1; + break; + case 's': + flags |= TIFFPRINT_STRIPS; + break; + case 'w': + showwords = 1; + break; + case 'z': + chopstrips = 1; + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (optind >= argc) + usage(); + + old_error_handler = TIFFSetErrorHandler(PrivateErrorHandler); + + multiplefiles = (argc - optind > 1); + for (; optind < argc; optind++) { + if (multiplefiles) + printf("%s:\n", argv[optind]); + tif = TIFFOpen(argv[optind], chopstrips ? "rC" : "rc"); + if (tif != NULL) { + if (dirnum != -1) { + if (TIFFSetDirectory(tif, (tdir_t) dirnum)) + tiffinfo(tif, order, flags, 1); + } else if (diroff != 0) { + if (TIFFSetSubDirectory(tif, diroff)) + tiffinfo(tif, order, flags, 1); + } else { + do { + toff_t offset; + + tiffinfo(tif, order, flags, 1); + if (TIFFGetField(tif, TIFFTAG_EXIFIFD, + &offset)) { + if (TIFFReadEXIFDirectory(tif, offset)) { + tiffinfo(tif, order, flags, 0); + } + } + } while (TIFFReadDirectory(tif)); + } + TIFFClose(tif); + } + } + return (status); +} + +char* stuff[] = { +"usage: tiffinfo [options] input...", +"where options are:", +" -D read data", +" -i ignore read errors", +" -c display data for grey/color response curve or colormap", +" -d display raw/decoded image data", +" -f lsb2msb force lsb-to-msb FillOrder for input", +" -f msb2lsb force msb-to-lsb FillOrder for input", +" -j show JPEG tables", +" -o offset set initial directory offset", +" -r read/display raw image data instead of decoded data", +" -s display strip offsets and byte counts", +" -w display raw data in words rather than bytes", +" -z enable strip chopping", +" -# set initial directory (first directory is # 0)", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +static void +ShowStrip(tstrip_t strip, unsigned char* pp, uint32 nrow, tsize_t scanline) +{ + register tsize_t cc; + + printf("Strip %lu:\n", (unsigned long) strip); + while (nrow-- > 0) { + for (cc = 0; cc < scanline; cc++) { + printf(" %02x", *pp++); + if (((cc+1) % 24) == 0) + putchar('\n'); + } + putchar('\n'); + } +} + +void +TIFFReadContigStripData(TIFF* tif) +{ + unsigned char *buf; + tsize_t scanline = TIFFScanlineSize(tif); + + buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif)); + if (buf) { + uint32 row, h=0; + uint32 rowsperstrip = (uint32)-1; + + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + for (row = 0; row < h; row += rowsperstrip) { + uint32 nrow = (row+rowsperstrip > h ? + h-row : rowsperstrip); + tstrip_t strip = TIFFComputeStrip(tif, row, 0); + if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) { + if (stoponerr) + break; + } else if (showdata) + ShowStrip(strip, buf, nrow, scanline); + } + _TIFFfree(buf); + } +} + +void +TIFFReadSeparateStripData(TIFF* tif) +{ + unsigned char *buf; + tsize_t scanline = TIFFScanlineSize(tif); + + buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif)); + if (buf) { + uint32 row, h; + uint32 rowsperstrip = (uint32)-1; + tsample_t s, samplesperpixel; + + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); + TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + for (row = 0; row < h; row += rowsperstrip) { + for (s = 0; s < samplesperpixel; s++) { + uint32 nrow = (row+rowsperstrip > h ? + h-row : rowsperstrip); + tstrip_t strip = TIFFComputeStrip(tif, row, s); + if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) { + if (stoponerr) + break; + } else if (showdata) + ShowStrip(strip, buf, nrow, scanline); + } + } + _TIFFfree(buf); + } +} + +static void +ShowTile(uint32 row, uint32 col, tsample_t sample, + unsigned char* pp, uint32 nrow, tsize_t rowsize) +{ + uint32 cc; + + printf("Tile (%lu,%lu", (unsigned long) row, (unsigned long) col); + if (sample != (tsample_t) -1) + printf(",%u", sample); + printf("):\n"); + while (nrow-- > 0) { + for (cc = 0; cc < (uint32) rowsize; cc++) { + printf(" %02x", *pp++); + if (((cc+1) % 24) == 0) + putchar('\n'); + } + putchar('\n'); + } +} + +void +TIFFReadContigTileData(TIFF* tif) +{ + unsigned char *buf; + tsize_t rowsize = TIFFTileRowSize(tif); + + buf = (unsigned char *)_TIFFmalloc(TIFFTileSize(tif)); + if (buf) { + uint32 tw, th, w, h; + uint32 row, col; + + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + for (row = 0; row < h; row += th) { + for (col = 0; col < w; col += tw) { + if (TIFFReadTile(tif, buf, col, row, 0, 0) < 0) { + if (stoponerr) + break; + } else if (showdata) + ShowTile(row, col, (tsample_t) -1, buf, th, rowsize); + } + } + _TIFFfree(buf); + } +} + +void +TIFFReadSeparateTileData(TIFF* tif) +{ + unsigned char *buf; + tsize_t rowsize = TIFFTileRowSize(tif); + + buf = (unsigned char *)_TIFFmalloc(TIFFTileSize(tif)); + if (buf) { + uint32 tw, th, w, h; + uint32 row, col; + tsample_t s, samplesperpixel; + + TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); + TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); + TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); + TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + for (row = 0; row < h; row += th) { + for (col = 0; col < w; col += tw) { + for (s = 0; s < samplesperpixel; s++) { + if (TIFFReadTile(tif, buf, col, row, 0, s) < 0) { + if (stoponerr) + break; + } else if (showdata) + ShowTile(row, col, s, buf, th, rowsize); + } + } + } + _TIFFfree(buf); + } +} + +void +TIFFReadData(TIFF* tif) +{ + uint16 config = PLANARCONFIG_CONTIG; + + TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &config); + if (TIFFIsTiled(tif)) { + if (config == PLANARCONFIG_CONTIG) + TIFFReadContigTileData(tif); + else + TIFFReadSeparateTileData(tif); + } else { + if (config == PLANARCONFIG_CONTIG) + TIFFReadContigStripData(tif); + else + TIFFReadSeparateStripData(tif); + } +} + +static void +ShowRawBytes(unsigned char* pp, uint32 n) +{ + uint32 i; + + for (i = 0; i < n; i++) { + printf(" %02x", *pp++); + if (((i+1) % 24) == 0) + printf("\n "); + } + putchar('\n'); +} + +static void +ShowRawWords(uint16* pp, uint32 n) +{ + uint32 i; + + for (i = 0; i < n; i++) { + printf(" %04x", *pp++); + if (((i+1) % 15) == 0) + printf("\n "); + } + putchar('\n'); +} + +void +TIFFReadRawData(TIFF* tif, int bitrev) +{ + tstrip_t nstrips = TIFFNumberOfStrips(tif); + const char* what = TIFFIsTiled(tif) ? "Tile" : "Strip"; + uint64* stripbc; + + TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbc); + if (nstrips > 0) { + uint32 bufsize = (uint32) stripbc[0]; + tdata_t buf = _TIFFmalloc(bufsize); + tstrip_t s; + + for (s = 0; s < nstrips; s++) { + if (stripbc[s] > bufsize) { + buf = _TIFFrealloc(buf, (tmsize_t)stripbc[s]); + bufsize = (uint32) stripbc[s]; + } + if (buf == NULL) { + fprintf(stderr, + "Cannot allocate buffer to read strip %lu\n", + (unsigned long) s); + break; + } + if (TIFFReadRawStrip(tif, s, buf, (tmsize_t) stripbc[s]) < 0) { + fprintf(stderr, "Error reading strip %lu\n", + (unsigned long) s); + if (stoponerr) + break; + } else if (showdata) { + if (bitrev) { + TIFFReverseBits(buf, (tmsize_t)stripbc[s]); + printf("%s %lu: (bit reversed)\n ", + what, (unsigned long) s); + } else + printf("%s %lu:\n ", what, + (unsigned long) s); + if (showwords) + ShowRawWords((uint16*) buf, (uint32) stripbc[s]>>1); + else + ShowRawBytes((unsigned char*) buf, (uint32) stripbc[s]); + } + } + if (buf != NULL) + _TIFFfree(buf); + } +} + +static void +tiffinfo(TIFF* tif, uint16 order, long flags, int is_image) +{ + TIFFPrintDirectory(tif, stdout, flags); + if (!readdata || !is_image) + return; + if (rawdata) { + if (order) { + uint16 o; + TIFFGetFieldDefaulted(tif, + TIFFTAG_FILLORDER, &o); + TIFFReadRawData(tif, o != order); + } else + TIFFReadRawData(tif, 0); + } else { + if (order) + TIFFSetField(tif, TIFFTAG_FILLORDER, order); + TIFFReadData(tif); + } +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffmedian.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffmedian.c new file mode 100644 index 0000000..6501494 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffmedian.c @@ -0,0 +1,906 @@ +/* $Id: tiffmedian.c,v 1.10 2010-03-10 18:56:50 bfriesen Exp $ */ + +/* + * Apply median cut on an image. + * + * tiffmedian [-c n] [-f] input output + * -C n - set colortable size. Default is 256. + * -f - use Floyd-Steinberg dithering. + * -c lzw - compress output with LZW + * -c none - use no compression on output + * -c packbits - use packbits compression on output + * -r n - create output with n rows/strip of data + * (by default the compression scheme and rows/strip are taken + * from the input file) + * + * Notes: + * + * [1] Floyd-Steinberg dither: + * I should point out that the actual fractions we used were, assuming + * you are at X, moving left to right: + * + * X 7/16 + * 3/16 5/16 1/16 + * + * Note that the error goes to four neighbors, not three. I think this + * will probably do better (at least for black and white) than the + * 3/8-3/8-1/4 distribution, at the cost of greater processing. I have + * seen the 3/8-3/8-1/4 distribution described as "our" algorithm before, + * but I have no idea who the credit really belongs to. + + * Also, I should add that if you do zig-zag scanning (see my immediately + * previous message), it is sufficient (but not quite as good) to send + * half the error one pixel ahead (e.g. to the right on lines you scan + * left to right), and half one pixel straight down. Again, this is for + * black and white; I've not tried it with color. + * -- + * Lou Steinberg + * + * [2] Color Image Quantization for Frame Buffer Display, Paul Heckbert, + * Siggraph '82 proceedings, pp. 297-307 + */ + +#include "tif_config.h" + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef NEED_LIBPORT +# include "libport.h" +#endif + +#include "tiffio.h" + +#define MAX_CMAP_SIZE 256 + +#define streq(a,b) (strcmp(a,b) == 0) +#define strneq(a,b,n) (strncmp(a,b,n) == 0) + +#define COLOR_DEPTH 8 +#define MAX_COLOR 256 + +#define B_DEPTH 5 /* # bits/pixel to use */ +#define B_LEN (1L< MAX_CMAP_SIZE) { + fprintf(stderr, + "-c: colormap too big, max %d\n", + MAX_CMAP_SIZE); + usage(); + } + break; + case 'f': /* dither */ + dither = 1; + break; + case 'r': /* rows/strip */ + rowsperstrip = atoi(optarg); + break; + case '?': + usage(); + /*NOTREACHED*/ + } + if (argc - optind != 2) + usage(); + in = TIFFOpen(argv[optind], "r"); + if (in == NULL) + return (-1); + TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth); + TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength); + TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bitspersample); + TIFFGetField(in, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); + if (bitspersample != 8 && bitspersample != 16) { + fprintf(stderr, "%s: Image must have at least 8-bits/sample\n", + argv[optind]); + return (-3); + } + if (!TIFFGetField(in, TIFFTAG_PHOTOMETRIC, &photometric) || + photometric != PHOTOMETRIC_RGB || samplesperpixel < 3) { + fprintf(stderr, "%s: Image must have RGB data\n", argv[optind]); + return (-4); + } + TIFFGetField(in, TIFFTAG_PLANARCONFIG, &config); + if (config != PLANARCONFIG_CONTIG) { + fprintf(stderr, "%s: Can only handle contiguous data packing\n", + argv[optind]); + return (-5); + } + + /* + * STEP 1: create empty boxes + */ + usedboxes = NULL; + box_list = freeboxes = (Colorbox *)_TIFFmalloc(num_colors*sizeof (Colorbox)); + freeboxes[0].next = &freeboxes[1]; + freeboxes[0].prev = NULL; + for (i = 1; i < num_colors-1; ++i) { + freeboxes[i].next = &freeboxes[i+1]; + freeboxes[i].prev = &freeboxes[i-1]; + } + freeboxes[num_colors-1].next = NULL; + freeboxes[num_colors-1].prev = &freeboxes[num_colors-2]; + + /* + * STEP 2: get histogram, initialize first box + */ + ptr = freeboxes; + freeboxes = ptr->next; + if (freeboxes) + freeboxes->prev = NULL; + ptr->next = usedboxes; + usedboxes = ptr; + if (ptr->next) + ptr->next->prev = ptr; + get_histogram(in, ptr); + + /* + * STEP 3: continually subdivide boxes until no more free + * boxes remain or until all colors assigned. + */ + while (freeboxes != NULL) { + ptr = largest_box(); + if (ptr != NULL) + splitbox(ptr); + else + freeboxes = NULL; + } + + /* + * STEP 4: assign colors to all boxes + */ + for (i = 0, ptr = usedboxes; ptr != NULL; ++i, ptr = ptr->next) { + rm[i] = ((ptr->rmin + ptr->rmax) << COLOR_SHIFT) / 2; + gm[i] = ((ptr->gmin + ptr->gmax) << COLOR_SHIFT) / 2; + bm[i] = ((ptr->bmin + ptr->bmax) << COLOR_SHIFT) / 2; + } + + /* We're done with the boxes now */ + _TIFFfree(box_list); + freeboxes = usedboxes = NULL; + + /* + * STEP 5: scan histogram and map all values to closest color + */ + /* 5a: create cell list as described in Heckbert[2] */ + ColorCells = (C_cell **)_TIFFmalloc(C_LEN*C_LEN*C_LEN*sizeof (C_cell*)); + _TIFFmemset(ColorCells, 0, C_LEN*C_LEN*C_LEN*sizeof (C_cell*)); + /* 5b: create mapping from truncated pixel space to color + table entries */ + map_colortable(); + + /* + * STEP 6: scan image, match input values to table entries + */ + out = TIFFOpen(argv[optind+1], "w"); + if (out == NULL) + return (-2); + + CopyField(TIFFTAG_SUBFILETYPE, longv); + CopyField(TIFFTAG_IMAGEWIDTH, longv); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (short)COLOR_DEPTH); + if (compression != (uint16)-1) { + TIFFSetField(out, TIFFTAG_COMPRESSION, compression); + switch (compression) { + case COMPRESSION_LZW: + case COMPRESSION_DEFLATE: + if (predictor != 0) + TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); + break; + } + } else + CopyField(TIFFTAG_COMPRESSION, compression); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, (short)PHOTOMETRIC_PALETTE); + CopyField(TIFFTAG_ORIENTATION, shortv); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, (short)1); + CopyField(TIFFTAG_PLANARCONFIG, shortv); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, + TIFFDefaultStripSize(out, rowsperstrip)); + CopyField(TIFFTAG_MINSAMPLEVALUE, shortv); + CopyField(TIFFTAG_MAXSAMPLEVALUE, shortv); + CopyField(TIFFTAG_RESOLUTIONUNIT, shortv); + CopyField(TIFFTAG_XRESOLUTION, floatv); + CopyField(TIFFTAG_YRESOLUTION, floatv); + CopyField(TIFFTAG_XPOSITION, floatv); + CopyField(TIFFTAG_YPOSITION, floatv); + + if (dither) + quant_fsdither(in, out); + else + quant(in, out); + /* + * Scale colormap to TIFF-required 16-bit values. + */ +#define SCALE(x) (((x)*((1L<<16)-1))/255) + for (i = 0; i < MAX_CMAP_SIZE; ++i) { + rm[i] = SCALE(rm[i]); + gm[i] = SCALE(gm[i]); + bm[i] = SCALE(bm[i]); + } + TIFFSetField(out, TIFFTAG_COLORMAP, rm, gm, bm); + (void) TIFFClose(out); + return (0); +} + +static int +processCompressOptions(char* opt) +{ + if (streq(opt, "none")) + compression = COMPRESSION_NONE; + else if (streq(opt, "packbits")) + compression = COMPRESSION_PACKBITS; + else if (strneq(opt, "lzw", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_LZW; + } else if (strneq(opt, "zip", 3)) { + char* cp = strchr(opt, ':'); + if (cp) + predictor = atoi(cp+1); + compression = COMPRESSION_DEFLATE; + } else + return (0); + return (1); +} + +char* stuff[] = { +"usage: tiffmedian [options] input.tif output.tif", +"where options are:", +" -r # make each strip have no more than # rows", +" -C # create a colormap with # entries", +" -f use Floyd-Steinberg dithering", +" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding", +" -c zip[:opts] compress output with deflate encoding", +" -c packbits compress output with packbits encoding", +" -c none use no compression algorithm on output", +"", +"LZW and deflate options:", +" # set predictor value", +"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing", +NULL +}; + +static void +usage(void) +{ + char buf[BUFSIZ]; + int i; + + setbuf(stderr, buf); + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + for (i = 0; stuff[i] != NULL; i++) + fprintf(stderr, "%s\n", stuff[i]); + exit(-1); +} + +static void +get_histogram(TIFF* in, Colorbox* box) +{ + register unsigned char *inptr; + register int red, green, blue; + register uint32 j, i; + unsigned char *inputline; + + inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + if (inputline == NULL) { + fprintf(stderr, "No space for scanline buffer\n"); + exit(-1); + } + box->rmin = box->gmin = box->bmin = 999; + box->rmax = box->gmax = box->bmax = -1; + box->total = imagewidth * imagelength; + + { register uint32 *ptr = &histogram[0][0][0]; + for (i = B_LEN*B_LEN*B_LEN; i-- > 0;) + *ptr++ = 0; + } + for (i = 0; i < imagelength; i++) { + if (TIFFReadScanline(in, inputline, i, 0) <= 0) + break; + inptr = inputline; + for (j = imagewidth; j-- > 0;) { + red = *inptr++ >> COLOR_SHIFT; + green = *inptr++ >> COLOR_SHIFT; + blue = *inptr++ >> COLOR_SHIFT; + if (red < box->rmin) + box->rmin = red; + if (red > box->rmax) + box->rmax = red; + if (green < box->gmin) + box->gmin = green; + if (green > box->gmax) + box->gmax = green; + if (blue < box->bmin) + box->bmin = blue; + if (blue > box->bmax) + box->bmax = blue; + histogram[red][green][blue]++; + } + } + _TIFFfree(inputline); +} + +static Colorbox * +largest_box(void) +{ + register Colorbox *p, *b; + register uint32 size; + + b = NULL; + size = 0; + for (p = usedboxes; p != NULL; p = p->next) + if ((p->rmax > p->rmin || p->gmax > p->gmin || + p->bmax > p->bmin) && p->total > size) + size = (b = p)->total; + return (b); +} + +static void +splitbox(Colorbox* ptr) +{ + uint32 hist2[B_LEN]; + int first=0, last=0; + register Colorbox *new; + register uint32 *iptr, *histp; + register int i, j; + register int ir,ig,ib; + register uint32 sum, sum1, sum2; + enum { RED, GREEN, BLUE } axis; + + /* + * See which axis is the largest, do a histogram along that + * axis. Split at median point. Contract both new boxes to + * fit points and return + */ + i = ptr->rmax - ptr->rmin; + if (i >= ptr->gmax - ptr->gmin && i >= ptr->bmax - ptr->bmin) + axis = RED; + else if (ptr->gmax - ptr->gmin >= ptr->bmax - ptr->bmin) + axis = GREEN; + else + axis = BLUE; + /* get histogram along longest axis */ + switch (axis) { + case RED: + histp = &hist2[ptr->rmin]; + for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) { + *histp = 0; + for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) { + iptr = &histogram[ir][ig][ptr->bmin]; + for (ib = ptr->bmin; ib <= ptr->bmax; ++ib) + *histp += *iptr++; + } + histp++; + } + first = ptr->rmin; + last = ptr->rmax; + break; + case GREEN: + histp = &hist2[ptr->gmin]; + for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) { + *histp = 0; + for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) { + iptr = &histogram[ir][ig][ptr->bmin]; + for (ib = ptr->bmin; ib <= ptr->bmax; ++ib) + *histp += *iptr++; + } + histp++; + } + first = ptr->gmin; + last = ptr->gmax; + break; + case BLUE: + histp = &hist2[ptr->bmin]; + for (ib = ptr->bmin; ib <= ptr->bmax; ++ib) { + *histp = 0; + for (ir = ptr->rmin; ir <= ptr->rmax; ++ir) { + iptr = &histogram[ir][ptr->gmin][ib]; + for (ig = ptr->gmin; ig <= ptr->gmax; ++ig) { + *histp += *iptr; + iptr += B_LEN; + } + } + histp++; + } + first = ptr->bmin; + last = ptr->bmax; + break; + } + /* find median point */ + sum2 = ptr->total / 2; + histp = &hist2[first]; + sum = 0; + for (i = first; i <= last && (sum += *histp++) < sum2; ++i) + ; + if (i == first) + i++; + + /* Create new box, re-allocate points */ + new = freeboxes; + freeboxes = new->next; + if (freeboxes) + freeboxes->prev = NULL; + if (usedboxes) + usedboxes->prev = new; + new->next = usedboxes; + usedboxes = new; + + histp = &hist2[first]; + for (sum1 = 0, j = first; j < i; j++) + sum1 += *histp++; + for (sum2 = 0, j = i; j <= last; j++) + sum2 += *histp++; + new->total = sum1; + ptr->total = sum2; + + new->rmin = ptr->rmin; + new->rmax = ptr->rmax; + new->gmin = ptr->gmin; + new->gmax = ptr->gmax; + new->bmin = ptr->bmin; + new->bmax = ptr->bmax; + switch (axis) { + case RED: + new->rmax = i-1; + ptr->rmin = i; + break; + case GREEN: + new->gmax = i-1; + ptr->gmin = i; + break; + case BLUE: + new->bmax = i-1; + ptr->bmin = i; + break; + } + shrinkbox(new); + shrinkbox(ptr); +} + +static void +shrinkbox(Colorbox* box) +{ + register uint32 *histp; + register int ir, ig, ib; + + if (box->rmax > box->rmin) { + for (ir = box->rmin; ir <= box->rmax; ++ir) + for (ig = box->gmin; ig <= box->gmax; ++ig) { + histp = &histogram[ir][ig][box->bmin]; + for (ib = box->bmin; ib <= box->bmax; ++ib) + if (*histp++ != 0) { + box->rmin = ir; + goto have_rmin; + } + } + have_rmin: + if (box->rmax > box->rmin) + for (ir = box->rmax; ir >= box->rmin; --ir) + for (ig = box->gmin; ig <= box->gmax; ++ig) { + histp = &histogram[ir][ig][box->bmin]; + ib = box->bmin; + for (; ib <= box->bmax; ++ib) + if (*histp++ != 0) { + box->rmax = ir; + goto have_rmax; + } + } + } +have_rmax: + if (box->gmax > box->gmin) { + for (ig = box->gmin; ig <= box->gmax; ++ig) + for (ir = box->rmin; ir <= box->rmax; ++ir) { + histp = &histogram[ir][ig][box->bmin]; + for (ib = box->bmin; ib <= box->bmax; ++ib) + if (*histp++ != 0) { + box->gmin = ig; + goto have_gmin; + } + } + have_gmin: + if (box->gmax > box->gmin) + for (ig = box->gmax; ig >= box->gmin; --ig) + for (ir = box->rmin; ir <= box->rmax; ++ir) { + histp = &histogram[ir][ig][box->bmin]; + ib = box->bmin; + for (; ib <= box->bmax; ++ib) + if (*histp++ != 0) { + box->gmax = ig; + goto have_gmax; + } + } + } +have_gmax: + if (box->bmax > box->bmin) { + for (ib = box->bmin; ib <= box->bmax; ++ib) + for (ir = box->rmin; ir <= box->rmax; ++ir) { + histp = &histogram[ir][box->gmin][ib]; + for (ig = box->gmin; ig <= box->gmax; ++ig) { + if (*histp != 0) { + box->bmin = ib; + goto have_bmin; + } + histp += B_LEN; + } + } + have_bmin: + if (box->bmax > box->bmin) + for (ib = box->bmax; ib >= box->bmin; --ib) + for (ir = box->rmin; ir <= box->rmax; ++ir) { + histp = &histogram[ir][box->gmin][ib]; + ig = box->gmin; + for (; ig <= box->gmax; ++ig) { + if (*histp != 0) { + box->bmax = ib; + goto have_bmax; + } + histp += B_LEN; + } + } + } +have_bmax: + ; +} + +static C_cell * +create_colorcell(int red, int green, int blue) +{ + register int ir, ig, ib, i; + register C_cell *ptr; + int mindist, next_n; + register int tmp, dist, n; + + ir = red >> (COLOR_DEPTH-C_DEPTH); + ig = green >> (COLOR_DEPTH-C_DEPTH); + ib = blue >> (COLOR_DEPTH-C_DEPTH); + ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell)); + *(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr; + ptr->num_ents = 0; + + /* + * Step 1: find all colors inside this cell, while we're at + * it, find distance of centermost point to furthest corner + */ + mindist = 99999999; + for (i = 0; i < num_colors; ++i) { + if (rm[i]>>(COLOR_DEPTH-C_DEPTH) != ir || + gm[i]>>(COLOR_DEPTH-C_DEPTH) != ig || + bm[i]>>(COLOR_DEPTH-C_DEPTH) != ib) + continue; + ptr->entries[ptr->num_ents][0] = i; + ptr->entries[ptr->num_ents][1] = 0; + ++ptr->num_ents; + tmp = rm[i] - red; + if (tmp < (MAX_COLOR/C_LEN/2)) + tmp = MAX_COLOR/C_LEN-1 - tmp; + dist = tmp*tmp; + tmp = gm[i] - green; + if (tmp < (MAX_COLOR/C_LEN/2)) + tmp = MAX_COLOR/C_LEN-1 - tmp; + dist += tmp*tmp; + tmp = bm[i] - blue; + if (tmp < (MAX_COLOR/C_LEN/2)) + tmp = MAX_COLOR/C_LEN-1 - tmp; + dist += tmp*tmp; + if (dist < mindist) + mindist = dist; + } + + /* + * Step 3: find all points within that distance to cell. + */ + for (i = 0; i < num_colors; ++i) { + if (rm[i] >> (COLOR_DEPTH-C_DEPTH) == ir && + gm[i] >> (COLOR_DEPTH-C_DEPTH) == ig && + bm[i] >> (COLOR_DEPTH-C_DEPTH) == ib) + continue; + dist = 0; + if ((tmp = red - rm[i]) > 0 || + (tmp = rm[i] - (red + MAX_COLOR/C_LEN-1)) > 0 ) + dist += tmp*tmp; + if ((tmp = green - gm[i]) > 0 || + (tmp = gm[i] - (green + MAX_COLOR/C_LEN-1)) > 0 ) + dist += tmp*tmp; + if ((tmp = blue - bm[i]) > 0 || + (tmp = bm[i] - (blue + MAX_COLOR/C_LEN-1)) > 0 ) + dist += tmp*tmp; + if (dist < mindist) { + ptr->entries[ptr->num_ents][0] = i; + ptr->entries[ptr->num_ents][1] = dist; + ++ptr->num_ents; + } + } + + /* + * Sort color cells by distance, use cheap exchange sort + */ + for (n = ptr->num_ents - 1; n > 0; n = next_n) { + next_n = 0; + for (i = 0; i < n; ++i) + if (ptr->entries[i][1] > ptr->entries[i+1][1]) { + tmp = ptr->entries[i][0]; + ptr->entries[i][0] = ptr->entries[i+1][0]; + ptr->entries[i+1][0] = tmp; + tmp = ptr->entries[i][1]; + ptr->entries[i][1] = ptr->entries[i+1][1]; + ptr->entries[i+1][1] = tmp; + next_n = i; + } + } + return (ptr); +} + +static void +map_colortable(void) +{ + register uint32 *histp = &histogram[0][0][0]; + register C_cell *cell; + register int j, tmp, d2, dist; + int ir, ig, ib, i; + + for (ir = 0; ir < B_LEN; ++ir) + for (ig = 0; ig < B_LEN; ++ig) + for (ib = 0; ib < B_LEN; ++ib, histp++) { + if (*histp == 0) { + *histp = -1; + continue; + } + cell = *(ColorCells + + (((ir>>(B_DEPTH-C_DEPTH)) << C_DEPTH*2) + + ((ig>>(B_DEPTH-C_DEPTH)) << C_DEPTH) + + (ib>>(B_DEPTH-C_DEPTH)))); + if (cell == NULL ) + cell = create_colorcell( + ir << COLOR_SHIFT, + ig << COLOR_SHIFT, + ib << COLOR_SHIFT); + dist = 9999999; + for (i = 0; i < cell->num_ents && + dist > cell->entries[i][1]; ++i) { + j = cell->entries[i][0]; + d2 = rm[j] - (ir << COLOR_SHIFT); + d2 *= d2; + tmp = gm[j] - (ig << COLOR_SHIFT); + d2 += tmp*tmp; + tmp = bm[j] - (ib << COLOR_SHIFT); + d2 += tmp*tmp; + if (d2 < dist) { + dist = d2; + *histp = j; + } + } + } +} + +/* + * straight quantization. Each pixel is mapped to the colors + * closest to it. Color values are rounded to the nearest color + * table entry. + */ +static void +quant(TIFF* in, TIFF* out) +{ + unsigned char *outline, *inputline; + register unsigned char *outptr, *inptr; + register uint32 i, j; + register int red, green, blue; + + inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + outline = (unsigned char *)_TIFFmalloc(imagewidth); + for (i = 0; i < imagelength; i++) { + if (TIFFReadScanline(in, inputline, i, 0) <= 0) + break; + inptr = inputline; + outptr = outline; + for (j = 0; j < imagewidth; j++) { + red = *inptr++ >> COLOR_SHIFT; + green = *inptr++ >> COLOR_SHIFT; + blue = *inptr++ >> COLOR_SHIFT; + *outptr++ = (unsigned char)histogram[red][green][blue]; + } + if (TIFFWriteScanline(out, outline, i, 0) < 0) + break; + } + _TIFFfree(inputline); + _TIFFfree(outline); +} + +#define SWAP(type,a,b) { type p; p = a; a = b; b = p; } + +#define GetInputLine(tif, row, bad) \ + if (TIFFReadScanline(tif, inputline, row, 0) <= 0) \ + bad; \ + inptr = inputline; \ + nextptr = nextline; \ + for (j = 0; j < imagewidth; ++j) { \ + *nextptr++ = *inptr++; \ + *nextptr++ = *inptr++; \ + *nextptr++ = *inptr++; \ + } +#define GetComponent(raw, cshift, c) \ + cshift = raw; \ + if (cshift < 0) \ + cshift = 0; \ + else if (cshift >= MAX_COLOR) \ + cshift = MAX_COLOR-1; \ + c = cshift; \ + cshift >>= COLOR_SHIFT; + +static void +quant_fsdither(TIFF* in, TIFF* out) +{ + unsigned char *outline, *inputline, *inptr; + short *thisline, *nextline; + register unsigned char *outptr; + register short *thisptr, *nextptr; + register uint32 i, j; + uint32 imax, jmax; + int lastline, lastpixel; + + imax = imagelength - 1; + jmax = imagewidth - 1; + inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in)); + thisline = (short *)_TIFFmalloc(imagewidth * 3 * sizeof (short)); + nextline = (short *)_TIFFmalloc(imagewidth * 3 * sizeof (short)); + outline = (unsigned char *) _TIFFmalloc(TIFFScanlineSize(out)); + + GetInputLine(in, 0, goto bad); /* get first line */ + for (i = 1; i <= imagelength; ++i) { + SWAP(short *, thisline, nextline); + lastline = (i >= imax); + if (i <= imax) + GetInputLine(in, i, break); + thisptr = thisline; + nextptr = nextline; + outptr = outline; + for (j = 0; j < imagewidth; ++j) { + int red, green, blue; + register int oval, r2, g2, b2; + + lastpixel = (j == jmax); + GetComponent(*thisptr++, r2, red); + GetComponent(*thisptr++, g2, green); + GetComponent(*thisptr++, b2, blue); + oval = histogram[r2][g2][b2]; + if (oval == -1) { + int ci; + register int cj, tmp, d2, dist; + register C_cell *cell; + + cell = *(ColorCells + + (((r2>>(B_DEPTH-C_DEPTH)) << C_DEPTH*2) + + ((g2>>(B_DEPTH-C_DEPTH)) << C_DEPTH ) + + (b2>>(B_DEPTH-C_DEPTH)))); + if (cell == NULL) + cell = create_colorcell(red, + green, blue); + dist = 9999999; + for (ci = 0; ci < cell->num_ents && dist > cell->entries[ci][1]; ++ci) { + cj = cell->entries[ci][0]; + d2 = (rm[cj] >> COLOR_SHIFT) - r2; + d2 *= d2; + tmp = (gm[cj] >> COLOR_SHIFT) - g2; + d2 += tmp*tmp; + tmp = (bm[cj] >> COLOR_SHIFT) - b2; + d2 += tmp*tmp; + if (d2 < dist) { + dist = d2; + oval = cj; + } + } + histogram[r2][g2][b2] = oval; + } + *outptr++ = oval; + red -= rm[oval]; + green -= gm[oval]; + blue -= bm[oval]; + if (!lastpixel) { + thisptr[0] += blue * 7 / 16; + thisptr[1] += green * 7 / 16; + thisptr[2] += red * 7 / 16; + } + if (!lastline) { + if (j != 0) { + nextptr[-3] += blue * 3 / 16; + nextptr[-2] += green * 3 / 16; + nextptr[-1] += red * 3 / 16; + } + nextptr[0] += blue * 5 / 16; + nextptr[1] += green * 5 / 16; + nextptr[2] += red * 5 / 16; + if (!lastpixel) { + nextptr[3] += blue / 16; + nextptr[4] += green / 16; + nextptr[5] += red / 16; + } + nextptr += 3; + } + } + if (TIFFWriteScanline(out, outline, i-1, 0) < 0) + break; + } +bad: + _TIFFfree(inputline); + _TIFFfree(thisline); + _TIFFfree(nextline); + _TIFFfree(outline); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffset.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffset.c new file mode 100644 index 0000000..3b4b9f0 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffset.c @@ -0,0 +1,340 @@ +/****************************************************************************** + * $Id: tiffset.c,v 1.17 2012-07-29 15:45:30 tgl Exp $ + * + * Project: libtiff tools + * Purpose: Mainline for setting metadata in existing TIFF files. + * Author: Frank Warmerdam, warmerdam@pobox.com + * + ****************************************************************************** + * Copyright (c) 2000, Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + ****************************************************************************** + */ + + +#include +#include +#include + +#include "tiffio.h" + +static char* usageMsg[] = { +"usage: tiffset [options] filename", +"where options are:", +" -s [count] ... set the tag value", +" -d set the directory", +" -sd set the subdirectory", +" -sf read the tag value from file (for ASCII tags only)", +NULL +}; + +static void +usage(void) +{ + int i; + for (i = 0; usageMsg[i]; i++) + fprintf(stderr, "%s\n", usageMsg[i]); + exit(-1); +} + +static const TIFFField * +GetField(TIFF *tiff, const char *tagname) +{ + const TIFFField *fip; + + if( atoi(tagname) > 0 ) + fip = TIFFFieldWithTag(tiff, (ttag_t)atoi(tagname)); + else + fip = TIFFFieldWithName(tiff, tagname); + + if (!fip) { + fprintf( stderr, "Field name \"%s\" is not recognised.\n", tagname ); + return (TIFFField *)NULL; + } + + return fip; +} + +int +main(int argc, char* argv[]) +{ + TIFF *tiff; + int arg_index; + + if (argc < 2) + usage(); + + tiff = TIFFOpen(argv[argc-1], "r+"); + if (tiff == NULL) + return 2; + + for( arg_index = 1; arg_index < argc-1; arg_index++ ) { + if (strcmp(argv[arg_index],"-d") == 0 && arg_index < argc-2) { + arg_index++; + if( TIFFSetDirectory(tiff, atoi(argv[arg_index]) ) != 1 ) + { + fprintf( stderr, "Failed to set directory=%s\n", argv[arg_index] ); + return 6; + } + arg_index++; + } + if (strcmp(argv[arg_index],"-sd") == 0 && arg_index < argc-2) { + arg_index++; + if( TIFFSetSubDirectory(tiff, atoi(argv[arg_index]) ) != 1 ) + { + fprintf( stderr, "Failed to set sub directory=%s\n", argv[arg_index] ); + return 7; + } + arg_index++; + } + if (strcmp(argv[arg_index],"-s") == 0 && arg_index < argc-3) { + const TIFFField *fip; + const char *tagname; + + arg_index++; + tagname = argv[arg_index]; + fip = GetField(tiff, tagname); + + if (!fip) + return 3; + + arg_index++; + if (TIFFFieldDataType(fip) == TIFF_ASCII) { + if (TIFFSetField(tiff, TIFFFieldTag(fip), argv[arg_index]) != 1) + fprintf( stderr, "Failed to set %s=%s\n", + TIFFFieldName(fip), argv[arg_index] ); + } else if (TIFFFieldWriteCount(fip) > 0 + || TIFFFieldWriteCount(fip) == TIFF_VARIABLE) { + int ret = 1; + short wc; + + if (TIFFFieldWriteCount(fip) == TIFF_VARIABLE) + wc = atoi(argv[arg_index++]); + else + wc = TIFFFieldWriteCount(fip); + + if (argc - arg_index < wc) { + fprintf( stderr, + "Number of tag values is not enough. " + "Expected %d values for %s tag, got %d\n", + wc, TIFFFieldName(fip), argc - arg_index); + return 4; + } + + if (wc > 1) { + int i, size; + void *array; + + switch (TIFFFieldDataType(fip)) { + /* + * XXX: We can't use TIFFDataWidth() + * to determine the space needed to store + * the value. For TIFF_RATIONAL values + * TIFFDataWidth() returns 8, but we use 4-byte + * float to represent rationals. + */ + case TIFF_BYTE: + case TIFF_ASCII: + case TIFF_SBYTE: + case TIFF_UNDEFINED: + default: + size = 1; + break; + + case TIFF_SHORT: + case TIFF_SSHORT: + size = 2; + break; + + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_FLOAT: + case TIFF_IFD: + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + size = 4; + break; + + case TIFF_DOUBLE: + size = 8; + break; + } + + array = _TIFFmalloc(wc * size); + if (!array) { + fprintf(stderr, "No space for %s tag\n", + tagname); + return 4; + } + + switch (TIFFFieldDataType(fip)) { + case TIFF_BYTE: + for (i = 0; i < wc; i++) + ((uint8 *)array)[i] = atoi(argv[arg_index+i]); + break; + case TIFF_SHORT: + for (i = 0; i < wc; i++) + ((uint16 *)array)[i] = atoi(argv[arg_index+i]); + break; + case TIFF_SBYTE: + for (i = 0; i < wc; i++) + ((int8 *)array)[i] = atoi(argv[arg_index+i]); + break; + case TIFF_SSHORT: + for (i = 0; i < wc; i++) + ((int16 *)array)[i] = atoi(argv[arg_index+i]); + break; + case TIFF_LONG: + for (i = 0; i < wc; i++) + ((uint32 *)array)[i] = atol(argv[arg_index+i]); + break; + case TIFF_SLONG: + case TIFF_IFD: + for (i = 0; i < wc; i++) + ((uint32 *)array)[i] = atol(argv[arg_index+i]); + break; + case TIFF_DOUBLE: + for (i = 0; i < wc; i++) + ((double *)array)[i] = atof(argv[arg_index+i]); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + for (i = 0; i < wc; i++) + ((float *)array)[i] = (float)atof(argv[arg_index+i]); + break; + default: + break; + } + + if (TIFFFieldPassCount(fip)) { + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + wc, array); + } else if (TIFFFieldTag(fip) == TIFFTAG_PAGENUMBER + || TIFFFieldTag(fip) == TIFFTAG_HALFTONEHINTS + || TIFFFieldTag(fip) == TIFFTAG_YCBCRSUBSAMPLING + || TIFFFieldTag(fip) == TIFFTAG_DOTRANGE) { + if (TIFFFieldDataType(fip) == TIFF_BYTE) { + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + ((uint8 *)array)[0], ((uint8 *)array)[1]); + } else if (TIFFFieldDataType(fip) == TIFF_SHORT) { + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + ((uint16 *)array)[0], ((uint16 *)array)[1]); + } + } else { + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + array); + } + + _TIFFfree(array); + } else { + switch (TIFFFieldDataType(fip)) { + case TIFF_BYTE: + case TIFF_SHORT: + case TIFF_SBYTE: + case TIFF_SSHORT: + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + atoi(argv[arg_index++])); + break; + case TIFF_LONG: + case TIFF_SLONG: + case TIFF_IFD: + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + atol(argv[arg_index++])); + break; + case TIFF_DOUBLE: + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + atof(argv[arg_index++])); + break; + case TIFF_RATIONAL: + case TIFF_SRATIONAL: + case TIFF_FLOAT: + ret = TIFFSetField(tiff, TIFFFieldTag(fip), + (float)atof(argv[arg_index++])); + break; + default: + break; + } + } + + if (ret != 1) + fprintf(stderr, "Failed to set %s\n", TIFFFieldName(fip)); + arg_index += wc; + } + } else if (strcmp(argv[arg_index],"-sf") == 0 && arg_index < argc-3) { + FILE *fp; + const TIFFField *fip; + char *text; + size_t len; + + arg_index++; + fip = GetField(tiff, argv[arg_index]); + + if (!fip) + return 3; + + if (TIFFFieldDataType(fip) != TIFF_ASCII) { + fprintf( stderr, + "Only ASCII tags can be set from file. " + "%s is not ASCII tag.\n", TIFFFieldName(fip) ); + return 5; + } + + arg_index++; + fp = fopen( argv[arg_index], "rt" ); + if(fp == NULL) { + perror( argv[arg_index] ); + continue; + } + + text = (char *) malloc(1000000); + len = fread( text, 1, 999999, fp ); + text[len] = '\0'; + + fclose( fp ); + + if(TIFFSetField( tiff, TIFFFieldTag(fip), text ) != 1) { + fprintf(stderr, "Failed to set %s from file %s\n", + TIFFFieldName(fip), argv[arg_index]); + } + + _TIFFfree( text ); + arg_index++; + } else { + fprintf(stderr, "Unrecognised option: %s\n", + argv[arg_index]); + usage(); + } + } + + TIFFRewriteDirectory(tiff); + TIFFClose(tiff); + return 0; +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffsplit.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffsplit.c new file mode 100644 index 0000000..fa43d63 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tiffsplit.c @@ -0,0 +1,303 @@ +/* $Id: tiffsplit.c,v 1.22 2011-10-22 17:03:01 bfriesen Exp $ */ + +/* + * Copyright (c) 1992-1997 Sam Leffler + * Copyright (c) 1992-1997 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "tif_config.h" + +#include +#include +#include + +#include "tiffio.h" + +#ifndef HAVE_GETOPT +extern int getopt(int, char**, char*); +#endif + +#define CopyField(tag, v) \ + if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v) +#define CopyField2(tag, v1, v2) \ + if (TIFFGetField(in, tag, &v1, &v2)) TIFFSetField(out, tag, v1, v2) +#define CopyField3(tag, v1, v2, v3) \ + if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3) + +#define PATH_LENGTH 8192 + +static const char TIFF_SUFFIX[] = ".tif"; + +static char fname[PATH_LENGTH]; + +static int tiffcp(TIFF*, TIFF*); +static void newfilename(void); +static int cpStrips(TIFF*, TIFF*); +static int cpTiles(TIFF*, TIFF*); + +int +main(int argc, char* argv[]) +{ + TIFF *in, *out; + + if (argc < 2) { + fprintf(stderr, "%s\n\n", TIFFGetVersion()); + fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n"); + return (-3); + } + if (argc > 2) { + strncpy(fname, argv[2], sizeof(fname)); + fname[sizeof(fname) - 1] = '\0'; + } + in = TIFFOpen(argv[1], "r"); + if (in != NULL) { + do { + size_t path_len; + char *path; + + newfilename(); + + path_len = strlen(fname) + sizeof(TIFF_SUFFIX); + path = (char *) _TIFFmalloc(path_len); + strncpy(path, fname, path_len); + path[path_len - 1] = '\0'; + strncat(path, TIFF_SUFFIX, path_len - strlen(path) - 1); + out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl"); + _TIFFfree(path); + + if (out == NULL) + return (-2); + if (!tiffcp(in, out)) + return (-1); + TIFFClose(out); + } while (TIFFReadDirectory(in)); + (void) TIFFClose(in); + } + return (0); +} + +static void +newfilename(void) +{ + static int first = 1; + static long lastTurn; + static long fnum; + static short defname; + static char *fpnt; + + if (first) { + if (fname[0]) { + fpnt = fname + strlen(fname); + defname = 0; + } else { + fname[0] = 'x'; + fpnt = fname + 1; + defname = 1; + } + first = 0; + } +#define MAXFILES 17576 + if (fnum == MAXFILES) { + if (!defname || fname[0] == 'z') { + fprintf(stderr, "tiffsplit: too many files.\n"); + exit(1); + } + fname[0]++; + fnum = 0; + } + if (fnum % 676 == 0) { + if (fnum != 0) { + /* + * advance to next letter every 676 pages + * condition for 'z'++ will be covered above + */ + fpnt[0]++; + } else { + /* + * set to 'a' if we are on the very first file + */ + fpnt[0] = 'a'; + } + /* + * set the value of the last turning point + */ + lastTurn = fnum; + } + /* + * start from 0 every 676 times (provided by lastTurn) + * this keeps us within a-z boundaries + */ + fpnt[1] = (char)((fnum - lastTurn) / 26) + 'a'; + /* + * cycle last letter every file, from a-z, then repeat + */ + fpnt[2] = (char)(fnum % 26) + 'a'; + fnum++; +} + +static int +tiffcp(TIFF* in, TIFF* out) +{ + uint16 bitspersample, samplesperpixel, compression, shortv, *shortav; + uint32 w, l; + float floatv; + char *stringv; + uint32 longv; + + CopyField(TIFFTAG_SUBFILETYPE, longv); + CopyField(TIFFTAG_TILEWIDTH, w); + CopyField(TIFFTAG_TILELENGTH, l); + CopyField(TIFFTAG_IMAGEWIDTH, w); + CopyField(TIFFTAG_IMAGELENGTH, l); + CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample); + CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); + CopyField(TIFFTAG_COMPRESSION, compression); + if (compression == COMPRESSION_JPEG) { + uint32 count = 0; + void *table = NULL; + if (TIFFGetField(in, TIFFTAG_JPEGTABLES, &count, &table) + && count > 0 && table) { + TIFFSetField(out, TIFFTAG_JPEGTABLES, count, table); + } + } + CopyField(TIFFTAG_PHOTOMETRIC, shortv); + CopyField(TIFFTAG_PREDICTOR, shortv); + CopyField(TIFFTAG_THRESHHOLDING, shortv); + CopyField(TIFFTAG_FILLORDER, shortv); + CopyField(TIFFTAG_ORIENTATION, shortv); + CopyField(TIFFTAG_MINSAMPLEVALUE, shortv); + CopyField(TIFFTAG_MAXSAMPLEVALUE, shortv); + CopyField(TIFFTAG_XRESOLUTION, floatv); + CopyField(TIFFTAG_YRESOLUTION, floatv); + CopyField(TIFFTAG_GROUP3OPTIONS, longv); + CopyField(TIFFTAG_GROUP4OPTIONS, longv); + CopyField(TIFFTAG_RESOLUTIONUNIT, shortv); + CopyField(TIFFTAG_PLANARCONFIG, shortv); + CopyField(TIFFTAG_ROWSPERSTRIP, longv); + CopyField(TIFFTAG_XPOSITION, floatv); + CopyField(TIFFTAG_YPOSITION, floatv); + CopyField(TIFFTAG_IMAGEDEPTH, longv); + CopyField(TIFFTAG_TILEDEPTH, longv); + CopyField(TIFFTAG_SAMPLEFORMAT, shortv); + CopyField2(TIFFTAG_EXTRASAMPLES, shortv, shortav); + { uint16 *red, *green, *blue; + CopyField3(TIFFTAG_COLORMAP, red, green, blue); + } + { uint16 shortv2; + CopyField2(TIFFTAG_PAGENUMBER, shortv, shortv2); + } + CopyField(TIFFTAG_ARTIST, stringv); + CopyField(TIFFTAG_IMAGEDESCRIPTION, stringv); + CopyField(TIFFTAG_MAKE, stringv); + CopyField(TIFFTAG_MODEL, stringv); + CopyField(TIFFTAG_SOFTWARE, stringv); + CopyField(TIFFTAG_DATETIME, stringv); + CopyField(TIFFTAG_HOSTCOMPUTER, stringv); + CopyField(TIFFTAG_PAGENAME, stringv); + CopyField(TIFFTAG_DOCUMENTNAME, stringv); + CopyField(TIFFTAG_BADFAXLINES, longv); + CopyField(TIFFTAG_CLEANFAXDATA, longv); + CopyField(TIFFTAG_CONSECUTIVEBADFAXLINES, longv); + CopyField(TIFFTAG_FAXRECVPARAMS, longv); + CopyField(TIFFTAG_FAXRECVTIME, longv); + CopyField(TIFFTAG_FAXSUBADDRESS, stringv); + CopyField(TIFFTAG_FAXDCS, stringv); + if (TIFFIsTiled(in)) + return (cpTiles(in, out)); + else + return (cpStrips(in, out)); +} + +static int +cpStrips(TIFF* in, TIFF* out) +{ + tmsize_t bufsize = TIFFStripSize(in); + unsigned char *buf = (unsigned char *)_TIFFmalloc(bufsize); + + if (buf) { + tstrip_t s, ns = TIFFNumberOfStrips(in); + uint64 *bytecounts; + + if (!TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &bytecounts)) { + fprintf(stderr, "tiffsplit: strip byte counts are missing\n"); + return (0); + } + for (s = 0; s < ns; s++) { + if (bytecounts[s] > (uint64)bufsize) { + buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[s]); + if (!buf) + return (0); + bufsize = (tmsize_t)bytecounts[s]; + } + if (TIFFReadRawStrip(in, s, buf, (tmsize_t)bytecounts[s]) < 0 || + TIFFWriteRawStrip(out, s, buf, (tmsize_t)bytecounts[s]) < 0) { + _TIFFfree(buf); + return (0); + } + } + _TIFFfree(buf); + return (1); + } + return (0); +} + +static int +cpTiles(TIFF* in, TIFF* out) +{ + tmsize_t bufsize = TIFFTileSize(in); + unsigned char *buf = (unsigned char *)_TIFFmalloc(bufsize); + + if (buf) { + ttile_t t, nt = TIFFNumberOfTiles(in); + uint64 *bytecounts; + + if (!TIFFGetField(in, TIFFTAG_TILEBYTECOUNTS, &bytecounts)) { + fprintf(stderr, "tiffsplit: tile byte counts are missing\n"); + return (0); + } + for (t = 0; t < nt; t++) { + if (bytecounts[t] > (uint64) bufsize) { + buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[t]); + if (!buf) + return (0); + bufsize = (tmsize_t)bytecounts[t]; + } + if (TIFFReadRawTile(in, t, buf, (tmsize_t)bytecounts[t]) < 0 || + TIFFWriteRawTile(out, t, buf, (tmsize_t)bytecounts[t]) < 0) { + _TIFFfree(buf); + return (0); + } + } + _TIFFfree(buf); + return (1); + } + return (0); +} + +/* vim: set ts=8 sts=8 sw=8 noet: */ +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/dummy.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/dummy.Plo new file mode 100644 index 0000000..6b3a36d --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/dummy.Plo @@ -0,0 +1 @@ +dummy.lo dummy.o: dummy.c diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/getopt.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/getopt.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/getopt.Plo @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/lfind.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/lfind.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/lfind.Plo @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strcasecmp.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strcasecmp.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strcasecmp.Plo @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoul.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoul.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoul.Plo @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoull.Plo b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoull.Plo new file mode 100644 index 0000000..9ce06a8 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/.deps/strtoull.Plo @@ -0,0 +1 @@ +# dummy diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile new file mode 100644 index 0000000..e1329d6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile @@ -0,0 +1,605 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# tools/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/tiff +pkgincludedir = $(includedir)/tiff +pkglibdir = $(libdir)/tiff +pkglibexecdir = $(libexecdir)/tiff +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = i386-apple-darwin11.3.0 +host_triplet = i386-apple-darwin11.3.0 +subdir = port +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs getopt.c lfind.c \ + strcasecmp.c strtoul.c strtoull.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libport_la_DEPENDENCIES = +am_libport_la_OBJECTS = dummy.lo +libport_la_OBJECTS = $(am_libport_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libport_la_SOURCES) +DIST_SOURCES = $(libport_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run aclocal-1.12 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AS = as +AUTOCONF = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run autoconf +AUTOHEADER = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run autoheader +AUTOMAKE = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run automake-1.12 +AWK = awk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -arch i386 -Wall -W +CPP = gcc -E +CPPFLAGS = -I/depot/sdk/LibJPEG/jpeg-9 +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -arch i386 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = dsymutil +DUMPBIN = +ECHO_C = \c +ECHO_N = +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GLUT_CFLAGS = -D_THREAD_SAFE -pthread +GLUT_LIBS = -lglut -lSM -lICE -lXi -lGLU -lGL -L/usr/X11/lib -lX11 -lm +GLU_CFLAGS = -D_THREAD_SAFE -pthread +GLU_LIBS = -lGLU -lGL -L/usr/X11/lib -lX11 -lm +GL_CFLAGS = -D_THREAD_SAFE -pthread +GL_LIBS = -lGL -L/usr/X11/lib -lX11 -lm +GREP = /usr/bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld +LDFLAGS = -L/depot/sdk/LibJPEG/jpeg-9 +LIBDIR = +LIBOBJS = +LIBS = -ljpeg -lz +LIBTIFF_ALPHA_VERSION = +LIBTIFF_DOCDIR = ${prefix}/share/doc/tiff-4.0.3 +LIBTIFF_MAJOR_VERSION = 4 +LIBTIFF_MICRO_VERSION = 3 +LIBTIFF_MINOR_VERSION = 0 +LIBTIFF_RELEASE_DATE = 20130221 +LIBTIFF_VERSION = 4.0.3 +LIBTIFF_VERSION_INFO = 7:0:2 +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = lipo +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = ../config/install-sh -c -d +NM = /usr/bin/nm +NMEDIT = nmedit +OBJDUMP = false +OBJEXT = o +OTOOL = otool +OTOOL64 = : +PACKAGE = tiff +PACKAGE_BUGREPORT = tiff@lists.maptools.org +PACKAGE_NAME = LibTIFF Software +PACKAGE_STRING = LibTIFF Software 4.0.3 +PACKAGE_TARNAME = tiff +PACKAGE_URL = +PACKAGE_VERSION = 4.0.3 +PATH_SEPARATOR = : +PTHREAD_CC = gcc +PTHREAD_CFLAGS = -D_THREAD_SAFE -pthread +PTHREAD_LIBS = +RANLIB = ranlib +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 4.0.3 +XMKMF = +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = -L/usr/X11/lib -R/usr/X11/lib +X_PRE_LIBS = -lSM -lICE +abs_builddir = /depot/sdk/LibTIFF/tiff-4.0.3/tools +abs_srcdir = /depot/sdk/LibTIFF/tiff-4.0.3/tools +abs_top_builddir = /depot/sdk/LibTIFF/tiff-4.0.3 +abs_top_srcdir = /depot/sdk/LibTIFF/tiff-4.0.3 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +ax_pthread_config = +bindir = ${exec_prefix}/bin +build = i386-apple-darwin11.3.0 +build_alias = +build_cpu = i386 +build_os = darwin11.3.0 +build_vendor = apple +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = i386-apple-darwin11.3.0 +host_alias = +host_cpu = i386 +host_os = darwin11.3.0 +host_vendor = apple +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /depot/sdk/LibTIFF/tiff-4.0.3/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +tiff_libs_private = -ljpeg -lz +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +EXTRA_DIST = Makefile.vc libport.h +noinst_LTLIBRARIES = libport.la +libport_la_SOURCES = dummy.c libport.h +libport_la_LIBADD = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign port/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign port/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libport.la: $(libport_la_OBJECTS) $(libport_la_DEPENDENCIES) $(EXTRA_libport_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libport_la_OBJECTS) $(libport_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include $(DEPDIR)/getopt.Plo +include $(DEPDIR)/lfind.Plo +include $(DEPDIR)/strcasecmp.Plo +include $(DEPDIR)/strtoul.Plo +include $(DEPDIR)/strtoull.Plo +include ./$(DEPDIR)/dummy.Plo + +.c.o: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.am b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.am new file mode 100644 index 0000000..94504fd --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.am @@ -0,0 +1,31 @@ +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +EXTRA_DIST = Makefile.vc libport.h + +noinst_LTLIBRARIES = libport.la +libport_la_SOURCES = dummy.c libport.h +libport_la_LIBADD = @LTLIBOBJS@ + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.in b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.in new file mode 100644 index 0000000..f268a9c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.in @@ -0,0 +1,605 @@ +# Makefile.in generated by automake 1.12.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Tag Image File Format (TIFF) Software +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Process this file with automake to produce Makefile.in. + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = port +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/depcomp \ + $(top_srcdir)/config/mkinstalldirs getopt.c lfind.c \ + strcasecmp.c strtoul.c strtoull.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \ + $(top_builddir)/libtiff/tiffconf.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libport_la_DEPENDENCIES = @LTLIBOBJS@ +am_libport_la_OBJECTS = dummy.lo +libport_la_OBJECTS = $(am_libport_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libport_la_SOURCES) +DIST_SOURCES = $(libport_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +GLU_CFLAGS = @GLU_CFLAGS@ +GLU_LIBS = @GLU_LIBS@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBDIR = @LIBDIR@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTIFF_ALPHA_VERSION = @LIBTIFF_ALPHA_VERSION@ +LIBTIFF_DOCDIR = @LIBTIFF_DOCDIR@ +LIBTIFF_MAJOR_VERSION = @LIBTIFF_MAJOR_VERSION@ +LIBTIFF_MICRO_VERSION = @LIBTIFF_MICRO_VERSION@ +LIBTIFF_MINOR_VERSION = @LIBTIFF_MINOR_VERSION@ +LIBTIFF_RELEASE_DATE = @LIBTIFF_RELEASE_DATE@ +LIBTIFF_VERSION = @LIBTIFF_VERSION@ +LIBTIFF_VERSION_INFO = @LIBTIFF_VERSION_INFO@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +tiff_libs_private = @tiff_libs_private@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = Makefile.vc libport.h +noinst_LTLIBRARIES = libport.la +libport_la_SOURCES = dummy.c libport.h +libport_la_LIBADD = @LTLIBOBJS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign port/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign port/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libport.la: $(libport_la_OBJECTS) $(libport_la_DEPENDENCIES) $(EXTRA_libport_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libport_la_OBJECTS) $(libport_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.vc b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.vc new file mode 100644 index 0000000..f5c85c6 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/Makefile.vc @@ -0,0 +1,43 @@ +# $Id: Makefile.vc,v 1.4 2006/03/23 14:54:02 dron Exp $ +# +# Copyright (C) 2004, Andrey Kiselev +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# +# Makefile for MS Visual C and Watcom C compilers. +# +# To build: +# C:\libtiff\port> nmake /f makefile.vc + +!INCLUDE ..\nmake.opt + +OBJ = \ + strcasecmp.obj \ + getopt.obj + +all: libport.lib + +libport.lib: $(OBJ) + $(AR) /out:libport.lib $(OBJ) + +clean: + -del *.obj + -del *.lib + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/dummy.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/dummy.c new file mode 100644 index 0000000..46f93bc --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/dummy.c @@ -0,0 +1,12 @@ +/* $Id: dummy.c,v 1.3 2007/03/21 14:54:16 dron Exp $ */ + +/* + * Dummy function, just to be ensure that the library always will be created. + */ + +void +libport_dummy_function() +{ + return; +} + diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/getopt.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/getopt.c new file mode 100644 index 0000000..6eff8ee --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/getopt.c @@ -0,0 +1,125 @@ +/* $Id: getopt.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; +__RCSID("$NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $"); +#endif + +#include +#include +#include "libport.h" + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(int argc, char * const argv[], const char *optstring) +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || *place == 0) { /* update scanning pointer */ + optreset = 0; + place = argv[optind]; + if (optind >= argc || *place++ != '-') { + /* Argument is absent or is not an option */ + place = EMSG; + return (-1); + } + optopt = *place++; + if (optopt == '-' && *place == 0) { + /* "--" => end of options */ + ++optind; + place = EMSG; + return (-1); + } + if (optopt == 0) { + /* Solitary '-', treat as a '-' option + if the program (eg su) is looking for it. */ + place = EMSG; + if (strchr(optstring, '-') == NULL) + return -1; + optopt = '-'; + } + } else + optopt = *place++; + + /* See if option letter is one the caller wanted... */ + if (optopt == ':' || (oli = strchr(optstring, optopt)) == NULL) { + if (*place == 0) + ++optind; + if (opterr && *optstring != ':') + (void)fprintf(stderr, + "unknown option -- %c\n", optopt); + return (BADCH); + } + + /* Does this option need an argument? */ + if (oli[1] != ':') { + /* don't need argument */ + optarg = NULL; + if (*place == 0) + ++optind; + } else { + /* Option-argument is either the rest of this argument or the + entire next argument. */ + if (*place) + optarg = place; + else if (argc > ++optind) + optarg = argv[optind]; + else { + /* option-argument absent */ + place = EMSG; + if (*optstring == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "option requires an argument -- %c\n", + optopt); + return (BADCH); + } + place = EMSG; + ++optind; + } + return (optopt); /* return option letter */ +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/lfind.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/lfind.c new file mode 100644 index 0000000..64b261c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/lfind.c @@ -0,0 +1,62 @@ +/* $Id: lfind.c,v 1.4 2007/01/15 18:40:39 mloskot Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Roger L. Snyder. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $"); +#endif + +#ifdef _WIN32_WCE +# include +#else +# include +#endif + +#ifndef NULL +# define NULL 0 +#endif + +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(element, key)) /* key found */ + return element; + + return NULL; +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/libport.h b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/libport.h new file mode 100644 index 0000000..802f478 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/libport.h @@ -0,0 +1,51 @@ +/* $Id: libport.h,v 1.2 2009-11-02 14:44:13 bfriesen Exp $ */ + +/* + * Copyright (c) 2009 Frank Warmerdam + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the names of + * Sam Leffler and Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Sam Leffler and Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef _LIBPORT_ +#define _LIBPORT_ + +int getopt(int argc, char * const argv[], const char *optstring); +extern char *optarg; +extern int opterr; +extern int optind; +extern int optopt; + +int strcasecmp(const char *s1, const char *s2); + +#ifndef HAVE_GETOPT +# define HAVE_GETOPT 1 +#endif + +#if 0 +unsigned long strtoul(const char *nptr, char **endptr, int base); +#endif + +#if 0 +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)); +#endif + +#endif /* ndef _LIBPORT_ */ diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strcasecmp.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strcasecmp.c new file mode 100644 index 0000000..1ff4312 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strcasecmp.c @@ -0,0 +1,51 @@ +/* $Id: strcasecmp.c,v 1.3 2009-01-22 20:53:07 fwarmerdam Exp $ */ + +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: strcasecmp.c,v 1.16 2003/08/07 16:43:49 agc Exp $"); +#endif + +#include +#include +#include "libport.h" + +int +strcasecmp(const char *s1, const char *s2) +{ + const unsigned char *us1 = (const unsigned char *)s1, + *us2 = (const unsigned char *)s2; + + while (tolower(*us1) == tolower(*us2++)) + if (*us1++ == '\0') + return (0); + return (tolower(*us1) - tolower(*--us2)); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoul.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoul.c new file mode 100644 index 0000000..f7a9a1a --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoul.c @@ -0,0 +1,109 @@ +/* $Id: strtoul.c,v 1.2 2005/07/07 16:34:06 dron Exp $ */ + +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: strtoul.c,v 1.16 2003/08/07 16:43:45 agc Exp $"); +#endif + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +strtoul(const char *nptr, char **endptr, int base) +{ + const char *s; + unsigned long acc, cutoff; + int c; + int neg, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + s = nptr; + do { + c = (unsigned char) *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + cutoff = ULONG_MAX / (unsigned long)base; + cutlim = (int)(ULONG_MAX % (unsigned long)base); + for (acc = 0, any = 0;; c = (unsigned char) *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0) + continue; + if (acc > cutoff || (acc == cutoff && c > cutlim)) { + any = -1; + acc = ULONG_MAX; + errno = ERANGE; + } else { + any = 1; + acc *= (unsigned long)base; + acc += c; + } + } + if (neg && any > 0) + acc = -acc; + if (endptr != 0) + /* LINTED interface specification */ + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoull.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoull.c new file mode 100644 index 0000000..fb7739c --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/tools/strtoull.c @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +/* + * Convert a string to an unsigned long long integer. + * + * Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long long +strtoull(const char *nptr, char **endptr, int base) +{ + const char *s; + unsigned long long acc; + char c; + unsigned long long cutoff; + int neg, any, cutlim; + + /* + * See strtoq for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace((unsigned char)c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X') && + ((s[1] >= '0' && s[1] <= '9') || + (s[1] >= 'A' && s[1] <= 'F') || + (s[1] >= 'a' && s[1] <= 'f'))) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + acc = any = 0; + if (base < 2 || base > 36) + goto noconv; + + cutoff = ULLONG_MAX / base; + cutlim = ULLONG_MAX % base; + for ( ; ; c = *s++) { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'Z') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'z') + c -= 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULLONG_MAX; + errno = ERANGE; + } else if (!any) { +noconv: + errno = EINVAL; + } else if (neg) + acc = -acc; + if (endptr != NULL) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/thirdparty/LibTIFF/tiff-4.0.3/tools/ycbcr.c b/thirdparty/LibTIFF/tiff-4.0.3/tools/ycbcr.c new file mode 100644 index 0000000..8f72447 --- /dev/null +++ b/thirdparty/LibTIFF/tiff-4.0.3/tools/ycbcr.c @@ -0,0 +1,168 @@ +float ycbcrCoeffs[3] = { .299, .587, .114 }; +/* default coding range is CCIR Rec 601-1 with no headroom/footroom */ +unsigned long refBlackWhite[6] = { 0, 255, 128, 255, 128, 255 }; + +#define LumaRed ycbcrCoeffs[0] +#define LumaGreen ycbcrCoeffs[1] +#define LumaBlue ycbcrCoeffs[2] + +long eRtotal = 0; +long eGtotal = 0; +long eBtotal = 0; +long preveRtotal = 0; +long preveGtotal = 0; +long preveBtotal = 0; +unsigned long AbseRtotal = 0; +unsigned long AbseGtotal = 0; +unsigned long AbseBtotal = 0; +unsigned long eCodes = 0; +unsigned long preveCodes = 0; +unsigned long eBits = 0; +unsigned long preveBits = 0; + +static void setupLumaTables(); +static int abs(int v) { return (v < 0 ? -v : v); } +static double pct(int v,double range) { return (v*100. / range); } +static void check(int R, int G, int B); + +float D1, D2; +float D3, D4; +float D5, D6; + +int +main(int argc, char** argv) +{ + int R, G, B; + + if (argc > 1) { + refBlackWhite[0] = 16; + refBlackWhite[1] = 235; + refBlackWhite[2] = 128; + refBlackWhite[3] = 240; + refBlackWhite[4] = 128; + refBlackWhite[5] = 240; + } + D3 = 2 - 2*LumaRed; + D4 = 2 - 2*LumaBlue; + D1 = 1. / D3; + D2 = 1. / D4; + D5 = D3*LumaRed / LumaGreen; + D6 = D4*LumaBlue / LumaGreen; + setupLumaTables(); + for (R = 0; R < 256; R++) { + for (G = 0; G < 256; G++) + for (B = 0; B < 256; B++) + check(R, G, B); + printf("[%3u] c %u/%u b %u/%u (R %u/%d/%u G %u/%d/%u B %u/%d/%u)\n" + , R + , eCodes - preveCodes, eCodes + , eBits - preveBits, eBits + , abs(AbseRtotal - preveRtotal), eRtotal , AbseRtotal + , abs(AbseGtotal - preveGtotal), eGtotal , AbseGtotal + , abs(AbseBtotal - preveBtotal), eBtotal , AbseBtotal + ); + preveRtotal = AbseRtotal; + preveGtotal = AbseGtotal; + preveBtotal = AbseBtotal; + preveCodes = eCodes; + preveBits = eBits; + } + printf("%u total codes\n", 256*256*256); + printf("total error: %u codes %u bits (R %d/%u G %d/%u B %d/%u)\n" + , eCodes + , eBits + , eRtotal , AbseRtotal + , eGtotal , AbseGtotal + , eBtotal , AbseBtotal + ); + return (0); +} + +float *lumaRed; +float *lumaGreen; +float *lumaBlue; + +static float* +setupLuma(float c) +{ + float *v = (float *)_TIFFmalloc(256 * sizeof (float)); + int i; + for (i = 0; i < 256; i++) + v[i] = c * i; + return (v); +} + +static void +setupLumaTables(void) +{ + lumaRed = setupLuma(LumaRed); + lumaGreen = setupLuma(LumaGreen); + lumaBlue = setupLuma(LumaBlue); +} + +static unsigned +V2Code(float f, unsigned long RB, unsigned long RW, int CR) +{ + unsigned int c = (unsigned int)((((f)*(RW-RB)/CR)+RB)+.5); + return (c > 255 ? 255 : c); +} + +#define Code2V(c, RB, RW, CR) ((((c)-(int)RB)*(float)CR)/(float)(RW-RB)) + +#define CLAMP(f,min,max) \ + (int)((f)+.5 < (min) ? (min) : (f)+.5 > (max) ? (max) : (f)+.5) + +static +void +check(int R, int G, int B) +{ + float Y, Cb, Cr; + int iY, iCb, iCr; + float rY, rCb, rCr; + float rR, rG, rB; + int eR, eG, eB; + + Y = lumaRed[R] + lumaGreen[G] + lumaBlue[B]; + Cb = (B - Y)*D2; + Cr = (R - Y)*D1; + iY = V2Code(Y, refBlackWhite[0], refBlackWhite[1], 255); + iCb = V2Code(Cb, refBlackWhite[2], refBlackWhite[3], 127); + iCr = V2Code(Cr, refBlackWhite[4], refBlackWhite[5], 127); + rCb = Code2V(iCb, refBlackWhite[2], refBlackWhite[3], 127); + rCr = Code2V(iCr, refBlackWhite[4], refBlackWhite[5], 127); + rY = Code2V(iY, refBlackWhite[0], refBlackWhite[1], 255); + rR = rY + rCr*D3; + rB = rY + rCb*D4; + rG = rY - rCb*D6 - rCr*D5; + eR = R - CLAMP(rR,0,255); + eG = G - CLAMP(rG,0,255); + eB = B - CLAMP(rB,0,255); + if (abs(eR) > 1 || abs(eG) > 1 || abs(eB) > 1) { + printf("R %u G %u B %u", R, G, B); + printf(" Y %g Cb %g Cr %g", Y, Cb, Cr); + printf(" iY %u iCb %u iCr %u", iY, iCb, iCr); + printf("\n -> Y %g Cb %g Cr %g", rY, rCb, rCr); + printf(" R %g (%u) G %g (%u) B %g (%u) E=[%d %d %d])\n" + , rR, CLAMP(rR,0,255) + , rG, CLAMP(rG,0,255) + , rB, CLAMP(rB,0,255) + , eR, eG, eB + ); + } + eRtotal += eR; + eGtotal += eG; + eBtotal += eB; + AbseRtotal += abs(eR); + AbseGtotal += abs(eG); + AbseBtotal += abs(eB); + if (eR | eG | eB) + eCodes++; + eBits += abs(eR) + abs(eG) + abs(eB); +} +/* + * Local Variables: + * mode: c + * c-basic-offset: 8 + * fill-column: 78 + * End: + */ diff --git a/thirdparty/Lz4/Lz4_131/.travis.yml b/thirdparty/Lz4/Lz4_131/.travis.yml new file mode 100644 index 0000000..87cb9a9 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/.travis.yml @@ -0,0 +1,35 @@ +language: c +compiler: gcc +script: make test-travis +before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq gcc-arm-linux-gnueabi + - sudo apt-get install -qq clang + - sudo apt-get install -qq g++-multilib + - sudo apt-get install -qq gcc-multilib + - sudo apt-get install -qq valgrind + - sudo apt-get install -qq python3 + +env: + - LZ4_TRAVIS_CI_ENV=travis-install + - LZ4_TRAVIS_CI_ENV=examples + - LZ4_TRAVIS_CI_ENV=cmake + - LZ4_TRAVIS_CI_ENV=clangtest + - LZ4_TRAVIS_CI_ENV=sanitize + - LZ4_TRAVIS_CI_ENV=staticAnalyze + - LZ4_TRAVIS_CI_ENV=gpptest + - LZ4_TRAVIS_CI_ENV=armtest + - LZ4_TRAVIS_CI_ENV=versionsTest + - LZ4_TRAVIS_CI_ENV=test-lz4 + - LZ4_TRAVIS_CI_ENV=test-lz4c + - LZ4_TRAVIS_CI_ENV=test-lz4c32 + - LZ4_TRAVIS_CI_ENV=test-fullbench + - LZ4_TRAVIS_CI_ENV=test-fullbench32 + - LZ4_TRAVIS_CI_ENV=test-fuzzer + - LZ4_TRAVIS_CI_ENV=test-fuzzer32 + - LZ4_TRAVIS_CI_ENV=test-frametest + - LZ4_TRAVIS_CI_ENV=test-frametest32 + - LZ4_TRAVIS_CI_ENV=test-mem + +matrix: + fast_finish: true diff --git a/thirdparty/Lz4/Lz4_131/Makefile b/thirdparty/Lz4/Lz4_131/Makefile new file mode 100644 index 0000000..d1b0d0c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/Makefile @@ -0,0 +1,132 @@ +# ################################################################ +# LZ4 - Makefile +# Copyright (C) Yann Collet 2011-2015 +# All rights reserved. +# +# BSD license +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# You can contact the author at : +# - LZ4 source repository : https://github.com/Cyan4973/lz4 +# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c +# ################################################################ + +# Version number +export VERSION=131 +export RELEASE=r$(VERSION) + +DESTDIR?= +PREFIX ?= /usr/local + +LIBDIR ?= $(PREFIX)/lib +INCLUDEDIR=$(PREFIX)/include +PRGDIR = programs +LZ4DIR = lib + + +# Select test target for Travis CI's Build Matrix +ifneq (,$(filter test-%,$(LZ4_TRAVIS_CI_ENV))) +TRAVIS_TARGET=prg-travis +else +TRAVIS_TARGET=$(LZ4_TRAVIS_CI_ENV) +endif + +# Define nul output +ifneq (,$(filter Windows%,$(OS))) +VOID = nul +else +VOID = /dev/null +endif + + +.PHONY: default all lib lz4programs clean test versionsTest + +default: lz4programs + +all: lib + @cd $(PRGDIR); $(MAKE) -e all + +lib: + @cd $(LZ4DIR); $(MAKE) -e all + +lz4programs: + @cd $(PRGDIR); $(MAKE) -e + +clean: + @cd $(PRGDIR); $(MAKE) clean > $(VOID) + @cd $(LZ4DIR); $(MAKE) clean > $(VOID) + @cd examples; $(MAKE) clean > $(VOID) + @cd versionsTest; $(MAKE) clean > $(VOID) + @echo Cleaning completed + + +#------------------------------------------------------------------------ +#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) + +install: + @cd $(LZ4DIR); $(MAKE) -e install + @cd $(PRGDIR); $(MAKE) -e install + +uninstall: + @cd $(LZ4DIR); $(MAKE) uninstall + @cd $(PRGDIR); $(MAKE) uninstall + +travis-install: + sudo $(MAKE) install + +test: + @cd $(PRGDIR); $(MAKE) -e test + +test-travis: $(TRAVIS_TARGET) + +cmake: + @cd cmake_unofficial; cmake CMakeLists.txt; $(MAKE) + +gpptest: clean + $(MAKE) all CC=g++ CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +clangtest: clean + $(MAKE) all CC=clang CPPFLAGS="-Werror -Wconversion -Wno-sign-conversion" + +sanitize: clean + $(MAKE) test CC=clang CPPFLAGS="-g -fsanitize=undefined" FUZZER_TIME="-T1mn" NB_LOOPS=-i1 + +staticAnalyze: clean + CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all + +armtest: clean + cd lib; $(MAKE) -e all CC=arm-linux-gnueabi-gcc CPPFLAGS="-Werror" + cd programs; $(MAKE) -e bins CC=arm-linux-gnueabi-gcc CPPFLAGS="-Werror" + +versionsTest: clean + @cd versionsTest; $(MAKE) + +examples: + cd lib; $(MAKE) -e + cd programs; $(MAKE) -e lz4 + cd examples; $(MAKE) -e test + +prg-travis: + @cd $(PRGDIR); $(MAKE) -e test-travis + +endif diff --git a/thirdparty/Lz4/Lz4_131/NEWS b/thirdparty/Lz4/Lz4_131/NEWS new file mode 100644 index 0000000..781687d --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/NEWS @@ -0,0 +1,178 @@ +r131 +New : Dos/DJGPP target, thanks to Louis Santillan (#114) +Added : Example using lz4frame library, by Zbigniew Jędrzejewski-Szmek (#118) +Changed: xxhash symbols are modified (namespace emulation) within liblz4 + +r130: +Fixed : incompatibility sparse mode vs console, reported by Yongwoon Cho (#105) +Fixed : LZ4IO exits too early when frame crc not present, reported by Yongwoon Cho (#106) +Fixed : incompatibility sparse mode vs append mode, reported by Takayuki Matsuoka (#110) +Performance fix : big compression speed boost for clang (+30%) +New : cross-version test, by Takayuki Matsuoka + +r129: +Added : LZ4_compress_fast(), LZ4_compress_fast_continue() +Added : LZ4_compress_destSize() +Changed: New lz4 and lz4hc compression API. Previous function prototypes still supported. +Changed: Sparse file support enabled by default +New : LZ4 CLI improved performance compressing/decompressing multiple files (#86, kind contribution from Kyle J. Harper & Takayuki Matsuoka) +Fixed : GCC 4.9+ optimization bug - Reported by Markus Trippelsdorf, Greg Slazinski & Evan Nemerson +Changed: Enums converted to LZ4F_ namespace convention - by Takayuki Matsuoka +Added : AppVeyor CI environment, for Visual tests - Suggested by Takayuki Matsuoka +Modified:Obsolete functions generate warnings - Suggested by Evan Nemerson, contributed by Takayuki Matsuoka +Fixed : Bug #75 (unfinished stream), reported by Yongwoon Cho +Updated: Documentation converted to MarkDown format + +r128: +New : lz4cli sparse file support (Requested by Neil Wilson, and contributed by Takayuki Matsuoka) +New : command -m, to compress multiple files in a single command (suggested by Kyle J. Harper) +Fixed : Restored lz4hc compression ratio (slightly lower since r124) +New : lz4 cli supports long commands (suggested by Takayuki Matsuoka) +New : lz4frame & lz4cli frame content size support +New : lz4frame supports skippable frames, as requested by Sergey Cherepanov +Changed: Default "make install" directory is /usr/local, as notified by Ron Johnson +New : lz4 cli supports "pass-through" mode, requested by Neil Wilson +New : datagen can generate sparse files +New : scan-build tests, thanks to kind help by Takayuki Matsuoka +New : g++ compatibility tests +New : arm cross-compilation test, thanks to kind help by Takayuki Matsuoka +Fixed : Fuzzer + frametest compatibility with NetBSD (issue #48, reported by Thomas Klausner) +Added : Visual project directory +Updated: Man page & Specification + +r127: +N/A : added a file on SVN + +r126: +New : lz4frame API is now integrated into liblz4 +Fixed : GCC 4.9 bug on highest performance settings, reported by Greg Slazinski +Fixed : bug within LZ4 HC streaming mode, reported by James Boyle +Fixed : older compiler don't like nameless unions, reported by Cheyi Lin +Changed : lz4 is C90 compatible +Changed : added -pedantic option, fixed a few mminor warnings + +r125: +Changed : endian and alignment code +Changed : directory structure : new "lib" directory +Updated : lz4io, now uses lz4frame +Improved: slightly improved decoding speed +Fixed : LZ4_compress_limitedOutput(); Special thanks to Christopher Speller ! +Fixed : some alignment warnings under clang +Fixed : deprecated function LZ4_slideInputBufferHC() + +r124: +New : LZ4 HC streaming mode +Fixed : LZ4F_compressBound() using null preferencesPtr +Updated : xxHash to r38 +Updated library number, to 1.4.0 + +r123: +Added : experimental lz4frame API, thanks to Takayuki Matsuoka and Christopher Jackson for testings +Fix : s390x support, thanks to Nobuhiro Iwamatsu +Fix : test mode (-t) no longer requires confirmation, thanks to Thary Nguyen + +r122: +Fix : AIX & AIX64 support (SamG) +Fix : mips 64-bits support (lew van) +Added : Examples directory, using code examples from Takayuki Matsuoka +Updated : Framing specification, to v1.4.1 +Updated : xxHash, to r36 + +r121: +Added : Makefile : install for kFreeBSD and Hurd (Nobuhiro Iwamatsu) +Fix : Makefile : install for OS-X and BSD, thanks to Takayuki Matsuoka + +r120: +Modified : Streaming API, using strong types +Added : LZ4_versionNumber(), thanks to Takayuki Matsuoka +Fix : OS-X : library install name, thanks to Clemens Lang +Updated : Makefile : synchronize library version number with lz4.h, thanks to Takayuki Matsuoka +Updated : Makefile : stricter compilation flags +Added : pkg-config, thanks to Zbigniew Jędrzejewski-Szmek (issue 135) +Makefile : lz4-test only test native binaries, as suggested by Michał Górny (issue 136) +Updated : xxHash to r35 + +r119: +Fix : Issue 134 : extended malicious address space overflow in 32-bits mode for some specific configurations + +r118: +New : LZ4 Streaming API (Fast version), special thanks to Takayuki Matsuoka +New : datagen : parametrable synthetic data generator for tests +Improved : fuzzer, support more test cases, more parameters, ability to jump to specific test +fix : support ppc64le platform (issue 131) +fix : Issue 52 (malicious address space overflow in 32-bits mode when using large custom format) +fix : Makefile : minor issue 130 : header files permissions + +r117: +Added : man pages for lz4c and lz4cat +Added : automated tests on Travis, thanks to Takayuki Matsuoka ! +fix : block-dependency command line (issue 127) +fix : lz4fullbench (issue 128) + +r116: +hotfix (issue 124 & 125) + +r115: +Added : lz4cat utility, installed on POSX systems (issue 118) +OS-X compatible compilation of dynamic library (issue 115) + +r114: +Makefile : library correctly compiled with -O3 switch (issue 114) +Makefile : library compilation compatible with clang +Makefile : library is versioned and linked (issue 119) +lz4.h : no more static inline prototypes (issue 116) +man : improved header/footer (issue 111) +Makefile : Use system default $(CC) & $(MAKE) variables (issue 112) +xxhash : updated to r34 + +r113: +Large decompression speed improvement for GCC 32-bits. Thanks to Valery Croizier ! +LZ4HC : Compression Level is now a programmable parameter (CLI from 4 to 9) +Separated IO routines from command line (lz4io.c) +Version number into lz4.h (suggested by Francesc Alted) + +r112: +quickfix + +r111 : +Makefile : added capability to install libraries +Modified Directory tree, to better separate libraries from programs. + +r110 : +lz4 & lz4hc : added capability to allocate state & stream state with custom allocator (issue 99) +fuzzer & fullbench : updated to test new functions +man : documented -l command (Legacy format, for Linux kernel compression) (issue 102) +cmake : improved version by Mika Attila, building programs and libraries (issue 100) +xxHash : updated to r33 +Makefile : clean also delete local package .tar.gz + +r109 : +lz4.c : corrected issue 98 (LZ4_compress_limitedOutput()) +Makefile : can specify version number from makefile + +r108 : +lz4.c : corrected compression efficiency issue 97 in 64-bits chained mode (-BD) for streams > 4 GB (thanks Roman Strashkin for reporting) + +r107 : +Makefile : support DESTDIR for staged installs. Thanks Jorge Aparicio. +Makefile : make install installs both lz4 and lz4c (Jorge Aparicio) +Makefile : removed -Wno-implicit-declaration compilation switch +lz4cli.c : include for isatty() (Luca Barbato) +lz4.h : introduced LZ4_MAX_INPUT_SIZE constant (Shay Green) +lz4.h : LZ4_compressBound() : unified macro and inline definitions (Shay Green) +lz4.h : LZ4_decompressSafe_partial() : clarify comments (Shay Green) +lz4.c : LZ4_compress() verify input size condition (Shay Green) +bench.c : corrected a bug in free memory size evaluation +cmake : install into bin/ directory (Richard Yao) +cmake : check for just C compiler (Elan Ruusamae) + +r106 : +Makefile : make dist modify text files in the package to respect Unix EoL convention +lz4cli.c : corrected small display bug in HC mode + +r105 : +Makefile : New install script and man page, contributed by Prasad Pandit +lz4cli.c : Minor modifications, for easier extensibility +COPYING : added license file +LZ4_Streaming_Format.odt : modified file name to remove white space characters +Makefile : .exe suffix now properly added only for Windows target diff --git a/thirdparty/Lz4/Lz4_131/README.md b/thirdparty/Lz4/Lz4_131/README.md new file mode 100644 index 0000000..a6ba716 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/README.md @@ -0,0 +1,88 @@ +LZ4 - Extremely fast compression +================================ + +LZ4 is lossless compression algorithm, +providing compression speed at 400 MB/s per core, +scalable with multi-cores CPU. +It also features an extremely fast decoder, +with speed in multiple GB/s per core, +typically reaching RAM speed limits on multi-core systems. + +Speed can be tuned dynamically, selecting an "acceleration" factor +which trades compression ratio for more speed up. +On the other end, a high compression derivative, LZ4_HC, is also provided, +trading CPU time for improved compression ratio. +All versions feature the same excellent decompression speed. + + +|Branch |Status | +|------------|---------| +|master | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] | +|dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] | + +[travisMasterBadge]: https://travis-ci.org/Cyan4973/lz4.svg?branch=master "Continuous Integration test suite" +[travisDevBadge]: https://travis-ci.org/Cyan4973/lz4.svg?branch=dev "Continuous Integration test suite" +[travisLink]: https://ci.appveyor.com/project/YannCollet/lz4 +[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/v6kxv9si529477cq/branch/master?svg=true "Visual test suite" +[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/v6kxv9si529477cq/branch/dev?svg=true "Visual test suite" +[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4 +[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch" +[coverlink]: https://scan.coverity.com/projects/4735 + +> **Branch Policy:** + +> - The "master" branch is considered stable, at all times. +> - The "dev" branch is the one where all contributions must be merged + before being promoted to master. +> + If you plan to propose a patch, please commit into the "dev" branch, + or its own feature branch. + Direct commit to "master" are not permitted. + +Benchmarks +------------------------- + +The benchmark uses the [Open-Source Benchmark program by m^2 (v0.14.3)] +compiled with GCC v4.8.2 on Linux Mint 64-bits v17. +The reference system uses a Core i5-4300U @1.9GHz. +Benchmark evaluates the compression of reference [Silesia Corpus] +in single-thread mode. + +| Compressor | Ratio | Compression | Decompression | +| ---------- | ----- | ----------- | ------------- | +| memcpy | 1.000 | 4200 MB/s | 4200 MB/s | +|**LZ4 fast 17 (r129)**| 1.607 |**690 MB/s** | **2220 MB/s** | +|**LZ4 default (r129)**|**2.101**|**385 MB/s** | **1850 MB/s** | +| LZO 2.06 | 2.108 | 350 MB/s | 510 MB/s | +| QuickLZ 1.5.1.b6 | 2.238 | 320 MB/s | 380 MB/s | +| Snappy 1.1.0 | 2.091 | 250 MB/s | 960 MB/s | +| LZF v3.6 | 2.073 | 175 MB/s | 500 MB/s | +| zlib 1.2.8 -1 | 2.730 | 59 MB/s | 250 MB/s | +|**LZ4 HC (r129)** |**2.720**| 22 MB/s | **1830 MB/s** | +| zlib 1.2.8 -6 | 3.099 | 18 MB/s | 270 MB/s | + + +Documentation +------------------------- + +The raw LZ4 block compression format is detailed within [lz4_Block_format]. + +To compress an arbitrarily long file or data stream, multiple blocks are required. +Organizing these blocks and providing a common header format to handle their content +is the purpose of the Frame format, defined into [lz4_Frame_format]. +Interoperable versions of LZ4 must respect this frame format. + + +Other source versions +------------------------- + +Beyond the C reference source, +many contributors have created versions of lz4 in multiple languages +(Java, C#, Python, Perl, Ruby, etc.). +A list of known source ports is maintained on the [LZ4 Homepage]. + + +[Open-Source Benchmark program by m^2 (v0.14.3)]: http://encode.ru/threads/1371-Filesystem-benchmark?p=34029&viewfull=1#post34029 +[Silesia Corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia +[lz4_Block_format]: lz4_Block_format.md +[lz4_Frame_format]: lz4_Frame_format.md +[LZ4 Homepage]: http://www.lz4.org \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/cmake_unofficial/CMakeLists.txt b/thirdparty/Lz4/Lz4_131/cmake_unofficial/CMakeLists.txt new file mode 100644 index 0000000..a986f43 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/cmake_unofficial/CMakeLists.txt @@ -0,0 +1,95 @@ +PROJECT(LZ4 C) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LZ4 compression library") +set(CPACK_PACKAGE_VERSION_MAJOR 1) +set(CPACK_PACKAGE_VERSION_MINOR 5) +set(CPACK_PACKAGE_VERSION_PATCH r128) +set(VERSION_STRING " \"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\" ") +include(CPack) + +cmake_minimum_required (VERSION 2.6) +INCLUDE (CheckTypeSize) +check_type_size("void *" SIZEOF_VOID_P) +IF( ${SIZEOF_VOID_P} STREQUAL "8" ) + set (CMAKE_SYSTEM_PROCESSOR "64bit") + MESSAGE( STATUS "64 bit architecture detected size of void * is " ${SIZEOF_VOID_P}) +ENDIF() + +option(BUILD_TOOLS "Build the command line tools" ON) +option(BUILD_LIBS "Build the libraries in addition to the tools" ON) + +IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + SET(GNU_COMPATIBLE_COMPILER 1) +ENDIF() + +if(GNU_COMPATIBLE_COMPILER) +if(UNIX AND BUILD_LIBS) + add_definitions(-fPIC) +endif() +endif() + +set(LZ4_DIR ../lib/) +set(PRG_DIR ../programs/) +set(LZ4_SRCS_LIB ${LZ4_DIR}lz4.c ${LZ4_DIR}lz4hc.c ${LZ4_DIR}lz4.h ${LZ4_DIR}lz4hc.h ${LZ4_DIR}lz4frame.c ${LZ4_DIR}lz4frame.h ${LZ4_DIR}xxhash.c) +set(LZ4_SRCS ${LZ4_DIR}lz4frame.c ${LZ4_DIR}xxhash.c ${PRG_DIR}bench.c ${PRG_DIR}lz4cli.c ${PRG_DIR}lz4io.c) + +if(BUILD_TOOLS AND NOT BUILD_LIBS) + set(LZ4_SRCS ${LZ4_SRCS} ${LZ4_SRCS_LIB}) +endif() + +if(BUILD_TOOLS) + add_executable(lz4 ${LZ4_SRCS}) + install(TARGETS lz4 RUNTIME DESTINATION "bin/") +endif() + +if(BUILD_LIBS) + add_library(liblz4 ${LZ4_SRCS_LIB}) + + set_target_properties(liblz4 PROPERTIES + OUTPUT_NAME lz4 + SOVERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}" + ) + + install(TARGETS liblz4 + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + + install(FILES + ${LZ4_DIR}/lz4.h + ${LZ4_DIR}/lz4hc.h + ${LZ4_DIR}/lz4frame.h + DESTINATION include + ) + + if(BUILD_TOOLS) + target_link_libraries(lz4 liblz4) + endif() +endif() + + +#warnings + +if(MSVC) +ADD_DEFINITIONS("-W4") +endif() +if(GNU_COMPATIBLE_COMPILER) +ADD_DEFINITIONS("-Wall") +endif() +if(CMAKE_COMPILER_IS_GNUCXX) +ADD_DEFINITIONS("-Wextra") +ADD_DEFINITIONS("-Wundef") +ADD_DEFINITIONS("-Wshadow") +ADD_DEFINITIONS("-Wcast-align") +ADD_DEFINITIONS("-Wstrict-prototypes") +endif(CMAKE_COMPILER_IS_GNUCXX) +if(GNU_COMPATIBLE_COMPILER AND + (NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")) +ADD_DEFINITIONS("-std=c99") +endif() +ADD_DEFINITIONS("-DLZ4_VERSION=\"${CPACK_PACKAGE_VERSION_PATCH}\"") +INCLUDE_DIRECTORIES (${LZ4_DIR}) + + + + diff --git a/thirdparty/Lz4/Lz4_131/contrib/djgpp/LICENSE b/thirdparty/Lz4/Lz4_131/contrib/djgpp/LICENSE new file mode 100644 index 0000000..fee0d3b --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/contrib/djgpp/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014, lpsantil +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/thirdparty/Lz4/Lz4_131/contrib/djgpp/Makefile b/thirdparty/Lz4/Lz4_131/contrib/djgpp/Makefile new file mode 100644 index 0000000..8cd3580 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/contrib/djgpp/Makefile @@ -0,0 +1,130 @@ +# Copyright (c) 2015, Louis P. Santillan +# All rights reserved. +# See LICENSE for licensing details. +DESTDIR ?= /opt/local + +# Pulled the code below from lib/Makefile. Might be nicer to derive this somehow without sed +# Version numbers +VERSION ?= 129 +RELEASE ?= r$(VERSION) +LIBVER_MAJOR=$(shell sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h) +LIBVER_MINOR=$(shell sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h) +LIBVER_PATCH=$(shell sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lib/lz4.h) +LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) + +###################################################################### + +CROSS ?= i586-pc-msdosdjgpp +CC = $(CROSS)-gcc +AR = $(CROSS)-ar +LD = $(CROSS)-gcc + +CFLAGS ?= -O3 -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\" +LDFLAGS ?= -s +SRC = programs/bench.c programs/lz4io.c programs/lz4cli.c +OBJ = $(SRC:.c=.o) +SDEPS = $(SRC:.c=.d) +IDIR = lib +EDIR = . +EXE = lz4.exe +LNK = lz4 +LDIR = lib +LSRC = lib/lz4.c lib/lz4hc.c lib/lz4frame.c lib/xxhash.c +INC = $(LSRC:.c=.h) +LOBJ = $(LSRC:.c=.o) +LSDEPS = $(LSRC:.c=.d) +LIB = $(LDIR)/lib$(LNK).a + +# Since LDFLAGS defaults to "-s", probably better to override unless +# you have a default you would like to maintain +ifeq ($(WITH_DEBUG), 1) + CFLAGS += -g + LDFLAGS += -g +endif + +# Since LDFLAGS defaults to "-s", probably better to override unless +# you have a default you would like to maintain +ifeq ($(WITH_PROFILING), 1) + CFLAGS += -pg + LDFLAGS += -pg +endif + +%.o: %.c $(INC) Makefile + $(CC) $(CFLAGS) -MMD -MP -I$(IDIR) -c $< -o $@ + +%.exe: %.o $(LIB) Makefile + $(LD) $< -L$(LDIR) -l$(LNK) $(LDFLAGS) $(LIBDEP) -o $@ + +###################################################################### +######################## DO NOT MODIFY BELOW ######################### +###################################################################### + +.PHONY: all install uninstall showconfig gstat gpush + +all: $(LIB) $(EXE) + +$(LIB): $(LOBJ) + $(AR) -rcs $@ $^ + +$(EXE): $(LOBJ) $(OBJ) + $(LD) $(LDFLAGS) $(LOBJ) $(OBJ) -o $(EDIR)/$@ + +clean: + rm -f $(OBJ) $(EXE) $(LOBJ) $(LIB) *.tmp $(SDEPS) $(LSDEPS) $(TSDEPS) + +install: $(INC) $(LIB) $(EXE) + mkdir -p $(DESTDIR)/bin $(DESTDIR)/include $(DESTDIR)/lib + rm -f .footprint + echo $(DESTDIR)/bin/$(EXE) >> .footprint + cp -v $(EXE) $(DESTDIR)/bin/ + @for T in $(LIB); \ + do ( \ + echo $(DESTDIR)/$$T >> .footprint; \ + cp -v --parents $$T $(DESTDIR) \ + ); done + @for T in $(INC); \ + do ( \ + echo $(DESTDIR)/include/`basename -a $$T` >> .footprint; \ + cp -v $$T $(DESTDIR)/include/ \ + ); done + +uninstall: .footprint + @for T in $(shell cat .footprint); do rm -v $$T; done + +-include $(SDEPS) $(LSDEPS) + +showconfig: + @echo "PWD="$(PWD) + @echo "VERSION="$(VERSION) + @echo "RELEASE="$(RELEASE) + @echo "LIBVER_MAJOR="$(LIBVER_MAJOR) + @echo "LIBVER_MINOR="$(LIBVER_MINOR) + @echo "LIBVER_PATCH="$(LIBVER_PATCH) + @echo "LIBVER="$(LIBVER) + @echo "CROSS="$(CROSS) + @echo "CC="$(CC) + @echo "AR="$(AR) + @echo "LD="$(LD) + @echo "DESTDIR="$(DESTDIR) + @echo "CFLAGS="$(CFLAGS) + @echo "LDFLAGS="$(LDFLAGS) + @echo "SRC="$(SRC) + @echo "OBJ="$(OBJ) + @echo "IDIR="$(IDIR) + @echo "INC="$(INC) + @echo "EDIR="$(EDIR) + @echo "EXE="$(EXE) + @echo "LDIR="$(LDIR) + @echo "LSRC="$(LSRC) + @echo "LOBJ="$(LOBJ) + @echo "LNK="$(LNK) + @echo "LIB="$(LIB) + @echo "SDEPS="$(SDEPS) + @echo "LSDEPS="$(LSDEPS) + +gstat: + git status + +gpush: + git commit + git push diff --git a/thirdparty/Lz4/Lz4_131/contrib/djgpp/README.MD b/thirdparty/Lz4/Lz4_131/contrib/djgpp/README.MD new file mode 100644 index 0000000..0f4cae6 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/contrib/djgpp/README.MD @@ -0,0 +1,21 @@ +# lz4 for DOS/djgpp +This file details on how to compile lz4.exe, and liblz4.a for use on DOS/djgpp using +Andrew Wu's build-djgpp cross compilers ([GH][0], [Binaries][1]) on OSX, Linux. + +## Setup +* Download a djgpp tarball [binaries][1] for your platform. +* Extract and install it (`tar jxvf djgpp-linux64-gcc492.tar.bz2`). Note the path. We'll assume `/home/user/djgpp`. +* Add the `bin` folder to your `PATH`. In bash, do `export PATH=/home/user/djgpp/bin:$PATH`. +* The `Makefile` in `contrib/djgpp/` sets up `CC`, `AR`, `LD` for you. So, `CC=i586-pc-msdosdjgpp-gcc`, `AR=i586-pc-msdosdjgpp-ar`, `LD=i586-pc-msdosdjgpp-gcc`. + +## Building LZ4 for DOS +In the base dir of lz4 and with `contrib/djgpp/Makefile`, try: +Try: +* `make -f contrib/djgpp/Makefile` +* `make -f contrib/djgpp/Makefile liblz4.a` +* `make -f contrib/djgpp/Makefile lz4.exe` +* `make -f contrib/djgpp/Makefile DESTDIR=/home/user/dos install`, however it doesn't make much sense on a \*nix. +* You can also do `make -f contrib/djgpp/Makefile uninstall` + +[0]: https://github.com/andrewwutw/build-djgpp +[1]: https://github.com/andrewwutw/build-djgpp/releases diff --git a/thirdparty/Lz4/Lz4_131/examples/.gitignore b/thirdparty/Lz4/Lz4_131/examples/.gitignore new file mode 100644 index 0000000..4893866 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/.gitignore @@ -0,0 +1,8 @@ +/Makefile.lz4* +/printVersion +/doubleBuffer +/ringBuffer +/ringBufferHC +/lineCompress +/frameCompress +/*.exe diff --git a/thirdparty/Lz4/Lz4_131/examples/HCStreaming_ringBuffer.c b/thirdparty/Lz4/Lz4_131/examples/HCStreaming_ringBuffer.c new file mode 100644 index 0000000..cfae9d7 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/HCStreaming_ringBuffer.c @@ -0,0 +1,239 @@ +// LZ4 HC streaming API example : ring buffer +// Based on previous work from Takayuki Matsuoka + + +/************************************** + * Compiler Options + **************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# define _CRT_SECURE_NO_WARNINGS // for MSVC +# define snprintf sprintf_s +#endif + +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-braces" /* GCC bug 53119 : doesn't accept { 0 } as initializer (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119) */ +#endif + + +/************************************** + * Includes + **************************************/ +#include "lz4hc.h" +#include "lz4.h" + +#include +#include +#include +#include + +enum { + MESSAGE_MAX_BYTES = 1024, + RING_BUFFER_BYTES = 1024 * 8 + MESSAGE_MAX_BYTES, + DEC_BUFFER_BYTES = RING_BUFFER_BYTES + MESSAGE_MAX_BYTES // Intentionally larger to test unsynchronized ring buffers +}; + + +size_t write_int32(FILE* fp, int32_t i) { + return fwrite(&i, sizeof(i), 1, fp); +} + +size_t write_bin(FILE* fp, const void* array, int arrayBytes) { + return fwrite(array, 1, arrayBytes, fp); +} + +size_t read_int32(FILE* fp, int32_t* i) { + return fread(i, sizeof(*i), 1, fp); +} + +size_t read_bin(FILE* fp, void* array, int arrayBytes) { + return fread(array, 1, arrayBytes, fp); +} + + +void test_compress(FILE* outFp, FILE* inpFp) +{ + LZ4_streamHC_t lz4Stream_body = { 0 }; + LZ4_streamHC_t* lz4Stream = &lz4Stream_body; + + static char inpBuf[RING_BUFFER_BYTES]; + int inpOffset = 0; + + for(;;) + { + // Read random length ([1,MESSAGE_MAX_BYTES]) data to the ring buffer. + char* const inpPtr = &inpBuf[inpOffset]; + const int randomLength = (rand() % MESSAGE_MAX_BYTES) + 1; + const int inpBytes = (int) read_bin(inpFp, inpPtr, randomLength); + if (0 == inpBytes) break; + + { + char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)]; + const int cmpBytes = LZ4_compressHC_continue(lz4Stream, inpPtr, cmpBuf, inpBytes); + + if(cmpBytes <= 0) break; + write_int32(outFp, cmpBytes); + write_bin(outFp, cmpBuf, cmpBytes); + + inpOffset += inpBytes; + + // Wraparound the ringbuffer offset + if(inpOffset >= RING_BUFFER_BYTES - MESSAGE_MAX_BYTES) + inpOffset = 0; + } + } + + write_int32(outFp, 0); +} + + +void test_decompress(FILE* outFp, FILE* inpFp) +{ + static char decBuf[DEC_BUFFER_BYTES]; + int decOffset = 0; + LZ4_streamDecode_t lz4StreamDecode_body = { 0 }; + LZ4_streamDecode_t* lz4StreamDecode = &lz4StreamDecode_body; + + for(;;) + { + int cmpBytes = 0; + char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)]; + + { + const size_t r0 = read_int32(inpFp, &cmpBytes); + size_t r1; + if(r0 != 1 || cmpBytes <= 0) + break; + + r1 = read_bin(inpFp, cmpBuf, cmpBytes); + if(r1 != (size_t) cmpBytes) + break; + } + + { + char* const decPtr = &decBuf[decOffset]; + const int decBytes = LZ4_decompress_safe_continue( + lz4StreamDecode, cmpBuf, decPtr, cmpBytes, MESSAGE_MAX_BYTES); + if(decBytes <= 0) + break; + + decOffset += decBytes; + write_bin(outFp, decPtr, decBytes); + + // Wraparound the ringbuffer offset + if(decOffset >= DEC_BUFFER_BYTES - MESSAGE_MAX_BYTES) + decOffset = 0; + } + } +} + + +// Compare 2 files content +// return 0 if identical +// return ByteNb>0 if different +size_t compare(FILE* f0, FILE* f1) +{ + size_t result = 1; + + for (;;) + { + char b0[65536]; + char b1[65536]; + const size_t r0 = fread(b0, 1, sizeof(b0), f0); + const size_t r1 = fread(b1, 1, sizeof(b1), f1); + + if ((r0==0) && (r1==0)) return 0; // success + + if (r0 != r1) + { + size_t smallest = r0; + if (r1 +#include +#include +#include + +enum { + BLOCK_BYTES = 1024 * 8, +// BLOCK_BYTES = 1024 * 64, +}; + + +size_t write_int(FILE* fp, int i) { + return fwrite(&i, sizeof(i), 1, fp); +} + +size_t write_bin(FILE* fp, const void* array, size_t arrayBytes) { + return fwrite(array, 1, arrayBytes, fp); +} + +size_t read_int(FILE* fp, int* i) { + return fread(i, sizeof(*i), 1, fp); +} + +size_t read_bin(FILE* fp, void* array, size_t arrayBytes) { + return fread(array, 1, arrayBytes, fp); +} + + +void test_compress(FILE* outFp, FILE* inpFp) +{ + LZ4_stream_t lz4Stream_body; + LZ4_stream_t* lz4Stream = &lz4Stream_body; + + char inpBuf[2][BLOCK_BYTES]; + int inpBufIndex = 0; + + LZ4_resetStream(lz4Stream); + + for(;;) { + char* const inpPtr = inpBuf[inpBufIndex]; + const int inpBytes = (int) read_bin(inpFp, inpPtr, BLOCK_BYTES); + if(0 == inpBytes) { + break; + } + + { + char cmpBuf[LZ4_COMPRESSBOUND(BLOCK_BYTES)]; + const int cmpBytes = LZ4_compress_fast_continue( + lz4Stream, inpPtr, cmpBuf, inpBytes, sizeof(cmpBuf), 1); + if(cmpBytes <= 0) { + break; + } + write_int(outFp, cmpBytes); + write_bin(outFp, cmpBuf, (size_t) cmpBytes); + } + + inpBufIndex = (inpBufIndex + 1) % 2; + } + + write_int(outFp, 0); +} + + +void test_decompress(FILE* outFp, FILE* inpFp) +{ + LZ4_streamDecode_t lz4StreamDecode_body; + LZ4_streamDecode_t* lz4StreamDecode = &lz4StreamDecode_body; + + char decBuf[2][BLOCK_BYTES]; + int decBufIndex = 0; + + LZ4_setStreamDecode(lz4StreamDecode, NULL, 0); + + for(;;) { + char cmpBuf[LZ4_COMPRESSBOUND(BLOCK_BYTES)]; + int cmpBytes = 0; + + { + const size_t readCount0 = read_int(inpFp, &cmpBytes); + if(readCount0 != 1 || cmpBytes <= 0) { + break; + } + + const size_t readCount1 = read_bin(inpFp, cmpBuf, (size_t) cmpBytes); + if(readCount1 != (size_t) cmpBytes) { + break; + } + } + + { + char* const decPtr = decBuf[decBufIndex]; + const int decBytes = LZ4_decompress_safe_continue( + lz4StreamDecode, cmpBuf, decPtr, cmpBytes, BLOCK_BYTES); + if(decBytes <= 0) { + break; + } + write_bin(outFp, decPtr, (size_t) decBytes); + } + + decBufIndex = (decBufIndex + 1) % 2; + } +} + + +int compare(FILE* fp0, FILE* fp1) +{ + int result = 0; + + while(0 == result) { + char b0[65536]; + char b1[65536]; + const size_t r0 = read_bin(fp0, b0, sizeof(b0)); + const size_t r1 = read_bin(fp1, b1, sizeof(b1)); + + result = (int) r0 - (int) r1; + + if(0 == r0 || 0 == r1) { + break; + } + if(0 == result) { + result = memcmp(b0, b1, r0); + } + } + + return result; +} + + +int main(int argc, char* argv[]) +{ + char inpFilename[256] = { 0 }; + char lz4Filename[256] = { 0 }; + char decFilename[256] = { 0 }; + + if(argc < 2) { + printf("Please specify input filename\n"); + return 0; + } + + snprintf(inpFilename, 256, "%s", argv[1]); + snprintf(lz4Filename, 256, "%s.lz4s-%d", argv[1], BLOCK_BYTES); + snprintf(decFilename, 256, "%s.lz4s-%d.dec", argv[1], BLOCK_BYTES); + + printf("inp = [%s]\n", inpFilename); + printf("lz4 = [%s]\n", lz4Filename); + printf("dec = [%s]\n", decFilename); + + // compress + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* outFp = fopen(lz4Filename, "wb"); + + printf("compress : %s -> %s\n", inpFilename, lz4Filename); + test_compress(outFp, inpFp); + printf("compress : done\n"); + + fclose(outFp); + fclose(inpFp); + } + + // decompress + { + FILE* inpFp = fopen(lz4Filename, "rb"); + FILE* outFp = fopen(decFilename, "wb"); + + printf("decompress : %s -> %s\n", lz4Filename, decFilename); + test_decompress(outFp, inpFp); + printf("decompress : done\n"); + + fclose(outFp); + fclose(inpFp); + } + + // verify + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* decFp = fopen(decFilename, "rb"); + + printf("verify : %s <-> %s\n", inpFilename, decFilename); + const int cmp = compare(inpFp, decFp); + if(0 == cmp) { + printf("verify : OK\n"); + } else { + printf("verify : NG\n"); + } + + fclose(decFp); + fclose(inpFp); + } + + return 0; +} diff --git a/thirdparty/Lz4/Lz4_131/examples/blockStreaming_doubleBuffer.md b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_doubleBuffer.md new file mode 100644 index 0000000..3027ea3 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_doubleBuffer.md @@ -0,0 +1,100 @@ +# LZ4 Streaming API Example : Double Buffer +by *Takayuki Matsuoka* + +`blockStreaming_doubleBuffer.c` is LZ4 Straming API example which implements double buffer (de)compression. + +Please note : + + - Firstly, read "LZ4 Streaming API Basics". + - This is relatively advanced application example. + - Output file is not compatible with lz4frame and platform dependent. + + +## What's the point of this example ? + + - Handle huge file in small amount of memory + - Always better compression ratio than Block API + - Uniform block size + + +## How the compression works + +First of all, allocate "Double Buffer" for input and LZ4 compressed data buffer for output. +Double buffer has two pages, "first" page (Page#1) and "second" page (Page#2). + +``` + Double Buffer + + Page#1 Page#2 + +---------+---------+ + | Block#1 | | + +----+----+---------+ + | + v + {Out#1} + + + Prefix Dependency + +---------+ + | | + v | + +---------+----+----+ + | Block#1 | Block#2 | + +---------+----+----+ + | + v + {Out#2} + + + External Dictionary Mode + +---------+ + | | + | v + +----+----+---------+ + | Block#3 | Block#2 | + +----+----+---------+ + | + v + {Out#3} + + + Prefix Dependency + +---------+ + | | + v | + +---------+----+----+ + | Block#3 | Block#4 | + +---------+----+----+ + | + v + {Out#4} +``` + +Next, read first block to double buffer's first page. And compress it by `LZ4_compress_continue()`. +For the first time, LZ4 doesn't know any previous dependencies, +so it just compress the line without dependencies and generates compressed block {Out#1} to LZ4 compressed data buffer. +After that, write {Out#1} to the file. + +Next, read second block to double buffer's second page. And compress it. +In this time, LZ4 can use dependency to Block#1 to improve compression ratio. +This dependency is called "Prefix mode". + +Next, read third block to double buffer's *first* page. And compress it. +Also this time, LZ4 can use dependency to Block#2. +This dependency is called "External Dictonaly mode". + +Continue these procedure to the end of the file. + + +## How the decompression works + +Decompression will do reverse order. + + - Read first compressed block. + - Decompress it to the first page and write that page to the file. + - Read second compressed block. + - Decompress it to the second page and write that page to the file. + - Read third compressed block. + - Decompress it to the *first* page and write that page to the file. + +Continue these procedure to the end of the compressed file. diff --git a/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.c b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.c new file mode 100644 index 0000000..f449aa3 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.c @@ -0,0 +1,211 @@ +// LZ4 streaming API example : line-by-line logfile compression +// Copyright : Takayuki Matsuoka + + +#ifdef _MSC_VER /* Visual Studio */ +# define _CRT_SECURE_NO_WARNINGS +# define snprintf sprintf_s +#endif +#include "lz4.h" + +#include +#include +#include +#include + +static size_t write_uint16(FILE* fp, uint16_t i) +{ + return fwrite(&i, sizeof(i), 1, fp); +} + +static size_t write_bin(FILE* fp, const void* array, int arrayBytes) +{ + return fwrite(array, 1, arrayBytes, fp); +} + +static size_t read_uint16(FILE* fp, uint16_t* i) +{ + return fread(i, sizeof(*i), 1, fp); +} + +static size_t read_bin(FILE* fp, void* array, int arrayBytes) +{ + return fread(array, 1, arrayBytes, fp); +} + + +static void test_compress( + FILE* outFp, + FILE* inpFp, + size_t messageMaxBytes, + size_t ringBufferBytes) +{ + LZ4_stream_t* const lz4Stream = LZ4_createStream(); + const size_t cmpBufBytes = LZ4_COMPRESSBOUND(messageMaxBytes); + char* const cmpBuf = (char*) malloc(cmpBufBytes); + char* const inpBuf = (char*) malloc(ringBufferBytes); + int inpOffset = 0; + + for ( ; ; ) + { + char* const inpPtr = &inpBuf[inpOffset]; + +#if 0 + // Read random length data to the ring buffer. + const int randomLength = (rand() % messageMaxBytes) + 1; + const int inpBytes = (int) read_bin(inpFp, inpPtr, randomLength); + if (0 == inpBytes) break; +#else + // Read line to the ring buffer. + int inpBytes = 0; + if (!fgets(inpPtr, (int) messageMaxBytes, inpFp)) + break; + inpBytes = (int) strlen(inpPtr); +#endif + + { + const int cmpBytes = LZ4_compress_fast_continue( + lz4Stream, inpPtr, cmpBuf, inpBytes, cmpBufBytes, 1); + if (cmpBytes <= 0) break; + write_uint16(outFp, (uint16_t) cmpBytes); + write_bin(outFp, cmpBuf, cmpBytes); + + // Add and wraparound the ringbuffer offset + inpOffset += inpBytes; + if ((size_t)inpOffset >= ringBufferBytes - messageMaxBytes) inpOffset = 0; + } + } + write_uint16(outFp, 0); + + free(inpBuf); + free(cmpBuf); + LZ4_freeStream(lz4Stream); +} + + +static void test_decompress( + FILE* outFp, + FILE* inpFp, + size_t messageMaxBytes, + size_t ringBufferBytes) +{ + LZ4_streamDecode_t* const lz4StreamDecode = LZ4_createStreamDecode(); + char* const cmpBuf = (char*) malloc(LZ4_COMPRESSBOUND(messageMaxBytes)); + char* const decBuf = (char*) malloc(ringBufferBytes); + int decOffset = 0; + + for ( ; ; ) + { + uint16_t cmpBytes = 0; + + if (read_uint16(inpFp, &cmpBytes) != 1) break; + if (cmpBytes <= 0) break; + if (read_bin(inpFp, cmpBuf, cmpBytes) != cmpBytes) break; + + { + char* const decPtr = &decBuf[decOffset]; + const int decBytes = LZ4_decompress_safe_continue( + lz4StreamDecode, cmpBuf, decPtr, cmpBytes, (int) messageMaxBytes); + if (decBytes <= 0) break; + write_bin(outFp, decPtr, decBytes); + + // Add and wraparound the ringbuffer offset + decOffset += decBytes; + if ((size_t)decOffset >= ringBufferBytes - messageMaxBytes) decOffset = 0; + } + } + + free(decBuf); + free(cmpBuf); + LZ4_freeStreamDecode(lz4StreamDecode); +} + + +static int compare(FILE* f0, FILE* f1) +{ + int result = 0; + const size_t tempBufferBytes = 65536; + char* const b0 = (char*) malloc(tempBufferBytes); + char* const b1 = (char*) malloc(tempBufferBytes); + + while(0 == result) + { + const size_t r0 = fread(b0, 1, tempBufferBytes, f0); + const size_t r1 = fread(b1, 1, tempBufferBytes, f1); + + result = (int) r0 - (int) r1; + + if (0 == r0 || 0 == r1) break; + if (0 == result) result = memcmp(b0, b1, r0); + } + + free(b1); + free(b0); + return result; +} + + +int main(int argc, char* argv[]) +{ + enum { + MESSAGE_MAX_BYTES = 1024, + RING_BUFFER_BYTES = 1024 * 256 + MESSAGE_MAX_BYTES, + }; + + char inpFilename[256] = { 0 }; + char lz4Filename[256] = { 0 }; + char decFilename[256] = { 0 }; + + if (argc < 2) + { + printf("Please specify input filename\n"); + return 0; + } + + snprintf(inpFilename, 256, "%s", argv[1]); + snprintf(lz4Filename, 256, "%s.lz4s", argv[1]); + snprintf(decFilename, 256, "%s.lz4s.dec", argv[1]); + + printf("inp = [%s]\n", inpFilename); + printf("lz4 = [%s]\n", lz4Filename); + printf("dec = [%s]\n", decFilename); + + // compress + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* outFp = fopen(lz4Filename, "wb"); + + test_compress(outFp, inpFp, MESSAGE_MAX_BYTES, RING_BUFFER_BYTES); + + fclose(outFp); + fclose(inpFp); + } + + // decompress + { + FILE* inpFp = fopen(lz4Filename, "rb"); + FILE* outFp = fopen(decFilename, "wb"); + + test_decompress(outFp, inpFp, MESSAGE_MAX_BYTES, RING_BUFFER_BYTES); + + fclose(outFp); + fclose(inpFp); + } + + // verify + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* decFp = fopen(decFilename, "rb"); + + const int cmp = compare(inpFp, decFp); + if (0 == cmp) + printf("Verify : OK\n"); + else + printf("Verify : NG\n"); + + fclose(decFp); + fclose(inpFp); + } + + return 0; +} diff --git a/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.md b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.md new file mode 100644 index 0000000..4735f92 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_lineByLine.md @@ -0,0 +1,122 @@ +# LZ4 Streaming API Example : Line by Line Text Compression +by *Takayuki Matsuoka* + +`blockStreaming_lineByLine.c` is LZ4 Straming API example which implements line by line incremental (de)compression. + +Please note the following restrictions : + + - Firstly, read "LZ4 Streaming API Basics". + - This is relatively advanced application example. + - Output file is not compatible with lz4frame and platform dependent. + + +## What's the point of this example ? + + - Line by line incremental (de)compression. + - Handle huge file in small amount of memory + - Generally better compression ratio than Block API + - Non-uniform block size + + +## How the compression works + +First of all, allocate "Ring Buffer" for input and LZ4 compressed data buffer for output. + +``` +(1) + Ring Buffer + + +--------+ + | Line#1 | + +---+----+ + | + v + {Out#1} + + +(2) + Prefix Mode Dependency + +----+ + | | + v | + +--------+-+------+ + | Line#1 | Line#2 | + +--------+---+----+ + | + v + {Out#2} + + +(3) + Prefix Prefix + +----+ +----+ + | | | | + v | v | + +--------+-+------+-+------+ + | Line#1 | Line#2 | Line#3 | + +--------+--------+---+----+ + | + v + {Out#3} + + +(4) + External Dictionary Mode + +----+ +----+ + | | | | + v | v | + ------+--------+-+------+-+--------+ + | .... | Line#X | Line#X+1 | + ------+--------+--------+-----+----+ + ^ | + | v + | {Out#X+1} + | + Reset + + +(5) + Prefix + +-----+ + | | + v | + ------+--------+--------+----------+--+-------+ + | .... | Line#X | Line#X+1 | Line#X+2 | + ------+--------+--------+----------+-----+----+ + ^ | + | v + | {Out#X+2} + | + Reset +``` + +Next (see (1)), read first line to ringbuffer and compress it by `LZ4_compress_continue()`. +For the first time, LZ4 doesn't know any previous dependencies, +so it just compress the line without dependencies and generates compressed line {Out#1} to LZ4 compressed data buffer. +After that, write {Out#1} to the file and forward ringbuffer offset. + +Do the same things to second line (see (2)). +But in this time, LZ4 can use dependency to Line#1 to improve compression ratio. +This dependency is called "Prefix mode". + +Eventually, we'll reach end of ringbuffer at Line#X (see (4)). +This time, we should reset ringbuffer offset. +After resetting, at Line#X+1 pointer is not adjacent, but LZ4 still maintain its memory. +This is called "External Dictionary Mode". + +In Line#X+2 (see (5)), finally LZ4 forget almost all memories but still remains Line#X+1. +This is the same situation as Line#2. + +Continue these procedure to the end of text file. + + +## How the decompression works + +Decompression will do reverse order. + + - Read compressed line from the file to buffer. + - Decompress it to the ringbuffer. + - Output decompressed plain text line to the file. + - Forward ringbuffer offset. If offset exceedes end of the ringbuffer, reset it. + +Continue these procedure to the end of the compressed file. diff --git a/thirdparty/Lz4/Lz4_131/examples/blockStreaming_ringBuffer.c b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_ringBuffer.c new file mode 100644 index 0000000..beb5e66 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/blockStreaming_ringBuffer.c @@ -0,0 +1,200 @@ +// LZ4 streaming API example : ring buffer +// Based on sample code from Takayuki Matsuoka + + +/************************************** + * Compiler Options + **************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# define _CRT_SECURE_NO_WARNINGS // for MSVC +# define snprintf sprintf_s +#endif +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wmissing-braces" /* GCC bug 53119 : doesn't accept { 0 } as initializer (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119) */ +#endif + + +/************************************** + * Includes + **************************************/ +#include +#include +#include +#include +#include "lz4.h" + + +enum { + MESSAGE_MAX_BYTES = 1024, + RING_BUFFER_BYTES = 1024 * 8 + MESSAGE_MAX_BYTES, + DECODE_RING_BUFFER = RING_BUFFER_BYTES + MESSAGE_MAX_BYTES // Intentionally larger, to test unsynchronized ring buffers +}; + + +size_t write_int32(FILE* fp, int32_t i) { + return fwrite(&i, sizeof(i), 1, fp); +} + +size_t write_bin(FILE* fp, const void* array, int arrayBytes) { + return fwrite(array, 1, arrayBytes, fp); +} + +size_t read_int32(FILE* fp, int32_t* i) { + return fread(i, sizeof(*i), 1, fp); +} + +size_t read_bin(FILE* fp, void* array, int arrayBytes) { + return fread(array, 1, arrayBytes, fp); +} + + +void test_compress(FILE* outFp, FILE* inpFp) +{ + LZ4_stream_t lz4Stream_body = { 0 }; + LZ4_stream_t* lz4Stream = &lz4Stream_body; + + static char inpBuf[RING_BUFFER_BYTES]; + int inpOffset = 0; + + for(;;) { + // Read random length ([1,MESSAGE_MAX_BYTES]) data to the ring buffer. + char* const inpPtr = &inpBuf[inpOffset]; + const int randomLength = (rand() % MESSAGE_MAX_BYTES) + 1; + const int inpBytes = (int) read_bin(inpFp, inpPtr, randomLength); + if (0 == inpBytes) break; + + { + char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)]; + const int cmpBytes = LZ4_compress_continue(lz4Stream, inpPtr, cmpBuf, inpBytes); + if(cmpBytes <= 0) break; + write_int32(outFp, cmpBytes); + write_bin(outFp, cmpBuf, cmpBytes); + + inpOffset += inpBytes; + + // Wraparound the ringbuffer offset + if(inpOffset >= RING_BUFFER_BYTES - MESSAGE_MAX_BYTES) inpOffset = 0; + } + } + + write_int32(outFp, 0); +} + + +void test_decompress(FILE* outFp, FILE* inpFp) +{ + static char decBuf[DECODE_RING_BUFFER]; + int decOffset = 0; + LZ4_streamDecode_t lz4StreamDecode_body = { 0 }; + LZ4_streamDecode_t* lz4StreamDecode = &lz4StreamDecode_body; + + for(;;) { + int cmpBytes = 0; + char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)]; + + { + const size_t r0 = read_int32(inpFp, &cmpBytes); + if(r0 != 1 || cmpBytes <= 0) break; + + const size_t r1 = read_bin(inpFp, cmpBuf, cmpBytes); + if(r1 != (size_t) cmpBytes) break; + } + + { + char* const decPtr = &decBuf[decOffset]; + const int decBytes = LZ4_decompress_safe_continue( + lz4StreamDecode, cmpBuf, decPtr, cmpBytes, MESSAGE_MAX_BYTES); + if(decBytes <= 0) break; + decOffset += decBytes; + write_bin(outFp, decPtr, decBytes); + + // Wraparound the ringbuffer offset + if(decOffset >= DECODE_RING_BUFFER - MESSAGE_MAX_BYTES) decOffset = 0; + } + } +} + + +int compare(FILE* f0, FILE* f1) +{ + int result = 0; + + while(0 == result) { + char b0[65536]; + char b1[65536]; + const size_t r0 = fread(b0, 1, sizeof(b0), f0); + const size_t r1 = fread(b1, 1, sizeof(b1), f1); + + result = (int) r0 - (int) r1; + + if(0 == r0 || 0 == r1) { + break; + } + if(0 == result) { + result = memcmp(b0, b1, r0); + } + } + + return result; +} + + +int main(int argc, char** argv) +{ + char inpFilename[256] = { 0 }; + char lz4Filename[256] = { 0 }; + char decFilename[256] = { 0 }; + + if(argc < 2) { + printf("Please specify input filename\n"); + return 0; + } + + snprintf(inpFilename, 256, "%s", argv[1]); + snprintf(lz4Filename, 256, "%s.lz4s-%d", argv[1], 0); + snprintf(decFilename, 256, "%s.lz4s-%d.dec", argv[1], 0); + + printf("inp = [%s]\n", inpFilename); + printf("lz4 = [%s]\n", lz4Filename); + printf("dec = [%s]\n", decFilename); + + // compress + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* outFp = fopen(lz4Filename, "wb"); + + test_compress(outFp, inpFp); + + fclose(outFp); + fclose(inpFp); + } + + // decompress + { + FILE* inpFp = fopen(lz4Filename, "rb"); + FILE* outFp = fopen(decFilename, "wb"); + + test_decompress(outFp, inpFp); + + fclose(outFp); + fclose(inpFp); + } + + // verify + { + FILE* inpFp = fopen(inpFilename, "rb"); + FILE* decFp = fopen(decFilename, "rb"); + + const int cmp = compare(inpFp, decFp); + if(0 == cmp) { + printf("Verify : OK\n"); + } else { + printf("Verify : NG\n"); + } + + fclose(decFp); + fclose(inpFp); + } + + return 0; +} diff --git a/thirdparty/Lz4/Lz4_131/examples/frameCompress.c b/thirdparty/Lz4/Lz4_131/examples/frameCompress.c new file mode 100644 index 0000000..b52b042 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/frameCompress.c @@ -0,0 +1,169 @@ +// LZ4frame API example : compress a file +// Based on sample code from Zbigniew Jędrzejewski-Szmek + +#include +#include +#include +#include + +#include + +#define BUF_SIZE (16*1024) +#define LZ4_HEADER_SIZE 19 +#define LZ4_FOOTER_SIZE 4 + +static const LZ4F_preferences_t lz4_preferences = { + { LZ4F_max256KB, LZ4F_blockLinked, LZ4F_noContentChecksum, LZ4F_frame, 0, { 0, 0 } }, + 0, /* compression level */ + 0, /* autoflush */ + { 0, 0, 0, 0 }, /* reserved, must be set to 0 */ +}; + +static int compress_file(FILE *in, FILE *out, size_t *size_in, size_t *size_out) { + LZ4F_errorCode_t r; + LZ4F_compressionContext_t ctx; + char *src, *buf = NULL; + size_t size, n, k, count_in = 0, count_out, offset = 0, frame_size; + + r = LZ4F_createCompressionContext(&ctx, LZ4F_VERSION); + if (LZ4F_isError(r)) { + printf("Failed to create context: error %zu", r); + return 1; + } + r = 1; + + src = malloc(BUF_SIZE); + if (!src) { + printf("Not enough memory"); + goto cleanup; + } + + frame_size = LZ4F_compressBound(BUF_SIZE, &lz4_preferences); + size = frame_size + LZ4_HEADER_SIZE + LZ4_FOOTER_SIZE; + buf = malloc(size); + if (!buf) { + printf("Not enough memory"); + goto cleanup; + } + + n = offset = count_out = LZ4F_compressBegin(ctx, buf, size, &lz4_preferences); + if (LZ4F_isError(n)) { + printf("Failed to start compression: error %zu", n); + goto cleanup; + } + + printf("Buffer size is %zu bytes, header size %zu bytes\n", size, n); + + for (;;) { + k = fread(src, 1, BUF_SIZE, in); + if (k == 0) + break; + count_in += k; + + n = LZ4F_compressUpdate(ctx, buf + offset, size - offset, src, k, NULL); + if (LZ4F_isError(n)) { + printf("Compression failed: error %zu", n); + goto cleanup; + } + + offset += n; + count_out += n; + if (size - offset < frame_size + LZ4_FOOTER_SIZE) { + printf("Writing %zu bytes\n", offset); + + k = fwrite(buf, 1, offset, out); + if (k < offset) { + if (ferror(out)) + printf("Write failed"); + else + printf("Short write"); + goto cleanup; + } + + offset = 0; + } + } + + n = LZ4F_compressEnd(ctx, buf + offset, size - offset, NULL); + if (LZ4F_isError(n)) { + printf("Failed to end compression: error %zu", n); + goto cleanup; + } + + offset += n; + count_out += n; + printf("Writing %zu bytes\n", offset); + + k = fwrite(buf, 1, offset, out); + if (k < offset) { + if (ferror(out)) + printf("Write failed"); + else + printf("Short write"); + goto cleanup; + } + + *size_in = count_in; + *size_out = count_out; + r = 0; + cleanup: + if (ctx) + LZ4F_freeCompressionContext(ctx); + free(src); + free(buf); + return r; +} + +static int compress(const char *input, const char *output) { + char *tmp = NULL; + FILE *in = NULL, *out = NULL; + size_t size_in = 0, size_out = 0; + int r = 1; + + if (!output) { + size_t len = strlen(input); + + output = tmp = malloc(len + 5); + if (!tmp) { + printf("Not enough memory"); + return 1; + } + strcpy(tmp, input); + strcpy(tmp + len, ".lz4"); + } + + in = fopen(input, "rb"); + if (!in) { + fprintf(stderr, "Failed to open input file %s: %s\n", input, strerror(errno)); + goto cleanup; + } + + out = fopen(output, "wb"); + if (!out) { + fprintf(stderr, "Failed to open output file %s: %s\n", output, strerror(errno)); + goto cleanup; + } + + r = compress_file(in, out, &size_in, &size_out); + if (r == 0) + printf("%s: %zu → %zu bytes, %.1f%%\n", + input, size_in, size_out, + (double)size_out / size_in * 100); + cleanup: + if (in) + fclose(in); + if (out) + fclose(out); + free(tmp); + return r; +} + + +int main(int argc, char **argv) { + if (argc < 2 || argc > 3) { + fprintf(stderr, "Syntax: %s \n", argv[0]); + return EXIT_FAILURE; + } + + return compress(argv[1], argv[2]); +} diff --git a/thirdparty/Lz4/Lz4_131/examples/printVersion.c b/thirdparty/Lz4/Lz4_131/examples/printVersion.c new file mode 100644 index 0000000..8607139 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/printVersion.c @@ -0,0 +1,13 @@ +// LZ4 trivial example : print Library version number +// Copyright : Takayuki Matsuoka & Yann Collet + + +#include +#include "lz4.h" + +int main(int argc, char** argv) +{ + (void)argc; (void)argv; + printf("Hello World ! LZ4 Library version = %d\n", LZ4_versionNumber()); + return 0; +} diff --git a/thirdparty/Lz4/Lz4_131/examples/streaming_api_basics.md b/thirdparty/Lz4/Lz4_131/examples/streaming_api_basics.md new file mode 100644 index 0000000..a88d733 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/examples/streaming_api_basics.md @@ -0,0 +1,87 @@ +# LZ4 Streaming API Basics +by *Takayuki Matsuoka* +## LZ4 API sets + +LZ4 has the following API sets : + + - "Auto Framing" API (lz4frame.h) : + This is most recommended API for usual application. + It guarantees interoperability with other LZ4 framing format compliant tools/libraries + such as LZ4 command line utility, node-lz4, etc. + - "Block" API : This is recommended for simple purpose. + It compress single raw memory block to LZ4 memory block and vice versa. + - "Streaming" API : This is designed for complex thing. + For example, compress huge stream data in restricted memory environment. + +Basically, you should use "Auto Framing" API. +But if you want to write advanced application, it's time to use Block or Streaming APIs. + + +## What is difference between Block and Streaming API ? + +Block API (de)compresses single contiguous memory block. +In other words, LZ4 library find redundancy from single contiguous memory block. +Streaming API does same thing but (de)compress multiple adjacent contiguous memory block. +So LZ4 library could find more redundancy than Block API. + +The following figure shows difference between API and block sizes. +In these figures, original data is splitted to 4KiBytes contiguous chunks. + +``` +Original Data + +---------------+---------------+----+----+----+ + | 4KiB Chunk A | 4KiB Chunk B | C | D |... | + +---------------+---------------+----+----+----+ + +Example (1) : Block API, 4KiB Block + +---------------+---------------+----+----+----+ + | 4KiB Chunk A | 4KiB Chunk B | C | D |... | + +---------------+---------------+----+----+----+ + | Block #1 | Block #2 | #3 | #4 |... | + +---------------+---------------+----+----+----+ + + (No Dependency) + + +Example (2) : Block API, 8KiB Block + +---------------+---------------+----+----+----+ + | 4KiB Chunk A | 4KiB Chunk B | C | D |... | + +---------------+---------------+----+----+----+ + | Block #1 |Block #2 |... | + +--------------------+----------+-------+-+----+ + ^ | ^ | + | | | | + +--------------+ +----+ + Internal Dependency Internal Dependency + + +Example (3) : Streaming API, 4KiB Block + +---------------+---------------+-----+----+----+ + | 4KiB Chunk A | 4KiB Chunk B | C | D |... | + +---------------+---------------+-----+----+----+ + | Block #1 | Block #2 | #3 | #4 |... | + +---------------+----+----------+-+---+-+--+----+ + ^ | ^ | ^ | + | | | | | | + +--------------+ +--------+ +---+ + Dependency Dependency Dependency +``` + + - In example (1), there is no dependency. + All blocks are compressed independently. + - In example (2), naturally 8KiBytes block has internal dependency. + But still block #1 and #2 are compressed independently. + - In example (3), block #2 has dependency to #1, + also #3 has dependency to #2 and #1, #4 has #3, #2 and #1, and so on. + +Here, we can observe difference between example (2) and (3). +In (2), there's no dependency between chunk B and C, but (3) has dependency between B and C. +This dependency improves compression ratio. + + +## Restriction of Streaming API + +For the efficiency, Streaming API doesn't keep mirror copy of dependent (de)compressed memory. +This means users should keep these dependent (de)compressed memory explicitly. +Usually, "Dependent memory" is previous adjacent contiguous memory up to 64KiBytes. +LZ4 will not access further memories. diff --git a/thirdparty/Lz4/Lz4_131/lib/LICENSE b/thirdparty/Lz4/Lz4_131/lib/LICENSE new file mode 100644 index 0000000..b566df3 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/LICENSE @@ -0,0 +1,24 @@ +LZ4 Library +Copyright (c) 2011-2014, Yann Collet +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/lib/Makefile b/thirdparty/Lz4/Lz4_131/lib/Makefile new file mode 100644 index 0000000..02ddd3b --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/Makefile @@ -0,0 +1,117 @@ +# ################################################################ +# LZ4 library - Makefile +# Copyright (C) Yann Collet 2011-2015 +# All rights reserved. +# +# BSD license +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# You can contact the author at : +# - LZ4 source repository : https://github.com/Cyan4973/lz4 +# - LZ4 forum froup : https://groups.google.com/forum/#!forum/lz4c +# ################################################################ + +# Version numbers +VERSION ?= 129 +LIBVER_MAJOR=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER_MINOR=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER_PATCH=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < lz4.h` +LIBVER=$(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH) + +DESTDIR?= +PREFIX ?= /usr/local +CFLAGS ?= -O3 +CFLAGS += -I. -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic -DXXH_NAMESPACE=LZ4_ + +LIBDIR?= $(PREFIX)/lib +INCLUDEDIR=$(PREFIX)/include + + +# OS X linker doesn't support -soname, and use different extension +# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html +ifeq ($(shell uname), Darwin) + SHARED_EXT = dylib + SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT) + SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT) + SONAME_FLAGS = -install_name $(PREFIX)/lib/liblz4.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER) +else + SONAME_FLAGS = -Wl,-soname=liblz4.$(SHARED_EXT).$(LIBVER_MAJOR) + SHARED_EXT = so + SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR) + SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) +endif + +default: liblz4 + +all: liblz4 + +liblz4: lz4.c lz4hc.c lz4frame.c xxhash.c + @echo compiling static library + @$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ + @$(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o + @echo compiling dynamic library $(LIBVER) + @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) + @echo creating versioned links + @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR) + @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT) + +clean: + @rm -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc + @echo Cleaning library completed + + +#------------------------------------------------------------------------ +#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) + +liblz4.pc: liblz4.pc.in Makefile + @echo creating pkgconfig + @sed -e 's|@PREFIX@|$(PREFIX)|' \ + -e 's|@LIBDIR@|$(LIBDIR)|' \ + -e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \ + -e 's|@VERSION@|$(VERSION)|' \ + $< >$@ + +install: liblz4 liblz4.pc + @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ + @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) + @cp -a liblz4.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR) + @cp -a liblz4.$(SHARED_EXT) $(DESTDIR)$(LIBDIR) + @cp -a liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ + @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a + @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h + @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @install -m 644 lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h + @echo lz4 static and shared library installed + +uninstall: + @rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) + @rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) + @rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/liblz4.pc + @[ -x $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_VER) + @[ -f $(DESTDIR)$(LIBDIR)/liblz4.a ] && rm -f $(DESTDIR)$(LIBDIR)/liblz4.a + @[ -f $(DESTDIR)$(INCLUDEDIR)/lz4.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4.h + @[ -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @[ -f $(DESTDIR)$(INCLUDEDIR)/lz4frame.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4frame.h + @echo lz4 libraries successfully uninstalled + +endif diff --git a/thirdparty/Lz4/Lz4_131/lib/README.md b/thirdparty/Lz4/Lz4_131/lib/README.md new file mode 100644 index 0000000..f6ebf5e --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/README.md @@ -0,0 +1,21 @@ +LZ4 - Library Files +================================ + +The __lib__ directory contains several files, but you don't necessarily need them all. + +To integrate fast LZ4 compression/decompression into your program, you basically just need "**lz4.c**" and "**lz4.h**". + +For more compression at the cost of compression speed (while preserving decompression speed), use **lz4hc** on top of regular lz4. `lz4hc` only provides compression functions. It also needs `lz4` to compile properly. + +If you want to produce files or data streams compatible with `lz4` command line utility, use **lz4frame**. This library encapsulates lz4-compressed blocks into the [official interoperable frame format]. In order to work properly, lz4frame needs lz4 and lz4hc, and also **xxhash**, which provides error detection algorithm. +(_Advanced stuff_ : It's possible to hide xxhash symbols into a local namespace. This is what `liblz4` does, to avoid symbol duplication in case a user program would link to several libraries containing xxhash symbols.) + +A more complex "lz4frame_static.h" is also provided, although its usage is not recommended. It contains definitions which are not guaranteed to remain stable within future versions. Use for static linking ***only***. + +The other files are not source code. There are : + + - LICENSE : contains the BSD license text + - Makefile : script to compile or install lz4 library (static or dynamic) + - liblz4.pc.in : for pkg-config (make install) + +[official interoperable frame format]: ../lz4_Frame_format.md diff --git a/thirdparty/Lz4/Lz4_131/lib/liblz4.pc.in b/thirdparty/Lz4/Lz4_131/lib/liblz4.pc.in new file mode 100644 index 0000000..0d05152 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/liblz4.pc.in @@ -0,0 +1,14 @@ +# LZ4 - Fast LZ compression algorithm +# Copyright (C) 2011-2014, Yann Collet. +# BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + +prefix=@PREFIX@ +libdir=@LIBDIR@ +includedir=@INCLUDEDIR@ + +Name: lz4 +Description: fast lossless compression algorithm library +URL: http://code.google.com/p/lz4/ +Version: @VERSION@ +Libs: -L@LIBDIR@ -llz4 +Cflags: -I@INCLUDEDIR@ diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4.c b/thirdparty/Lz4/Lz4_131/lib/lz4.c new file mode 100644 index 0000000..08cf6b5 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4.c @@ -0,0 +1,1516 @@ +/* + LZ4 - Fast LZ compression algorithm + Copyright (C) 2011-2015, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + + +/************************************** +* Tuning parameters +**************************************/ +/* + * HEAPMODE : + * Select how default compression functions will allocate memory for their hash table, + * in memory stack (0:default, fastest), or in memory heap (1:requires malloc()). + */ +#define HEAPMODE 0 + +/* + * ACCELERATION_DEFAULT : + * Select "acceleration" for LZ4_compress_fast() when parameter value <= 0 + */ +#define ACCELERATION_DEFAULT 1 + + +/************************************** +* CPU Feature Detection +**************************************/ +/* + * LZ4_FORCE_SW_BITCOUNT + * Define this parameter if your target system or compiler does not support hardware bit count + */ +#if defined(_MSC_VER) && defined(_WIN32_WCE) /* Visual Studio for Windows CE does not support Hardware bit count */ +# define LZ4_FORCE_SW_BITCOUNT +#endif + + +/************************************** +* Includes +**************************************/ +#include "lz4.h" + + +/************************************** +* Compiler Options +**************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# define FORCE_INLINE static __forceinline +# include +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# pragma warning(disable : 4293) /* disable: C4293: too large shift (32-bits) */ +#else +# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# if defined(__GNUC__) || defined(__clang__) +# define FORCE_INLINE static inline __attribute__((always_inline)) +# else +# define FORCE_INLINE static inline +# endif +# else +# define FORCE_INLINE static +# endif /* __STDC_VERSION__ */ +#endif /* _MSC_VER */ + +/* LZ4_GCC_VERSION is defined into lz4.h */ +#if (LZ4_GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) +# define expect(expr,value) (__builtin_expect ((expr),(value)) ) +#else +# define expect(expr,value) (expr) +#endif + +#define likely(expr) expect((expr) != 0, 1) +#define unlikely(expr) expect((expr) != 0, 0) + + +/************************************** +* Memory routines +**************************************/ +#include /* malloc, calloc, free */ +#define ALLOCATOR(n,s) calloc(n,s) +#define FREEMEM free +#include /* memset, memcpy */ +#define MEM_INIT memset + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + + +/************************************** +* Reading and writing into memory +**************************************/ +#define STEPSIZE sizeof(size_t) + +static unsigned LZ4_64bits(void) { return sizeof(void*)==8; } + +static unsigned LZ4_isLittleEndian(void) +{ + const union { U32 i; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */ + return one.c[0]; +} + + +static U16 LZ4_read16(const void* memPtr) +{ + U16 val16; + memcpy(&val16, memPtr, 2); + return val16; +} + +static U16 LZ4_readLE16(const void* memPtr) +{ + if (LZ4_isLittleEndian()) + { + return LZ4_read16(memPtr); + } + else + { + const BYTE* p = (const BYTE*)memPtr; + return (U16)((U16)p[0] + (p[1]<<8)); + } +} + +static void LZ4_writeLE16(void* memPtr, U16 value) +{ + if (LZ4_isLittleEndian()) + { + memcpy(memPtr, &value, 2); + } + else + { + BYTE* p = (BYTE*)memPtr; + p[0] = (BYTE) value; + p[1] = (BYTE)(value>>8); + } +} + +static U32 LZ4_read32(const void* memPtr) +{ + U32 val32; + memcpy(&val32, memPtr, 4); + return val32; +} + +static U64 LZ4_read64(const void* memPtr) +{ + U64 val64; + memcpy(&val64, memPtr, 8); + return val64; +} + +static size_t LZ4_read_ARCH(const void* p) +{ + if (LZ4_64bits()) + return (size_t)LZ4_read64(p); + else + return (size_t)LZ4_read32(p); +} + + +static void LZ4_copy4(void* dstPtr, const void* srcPtr) { memcpy(dstPtr, srcPtr, 4); } + +static void LZ4_copy8(void* dstPtr, const void* srcPtr) { memcpy(dstPtr, srcPtr, 8); } + +/* customized version of memcpy, which may overwrite up to 7 bytes beyond dstEnd */ +static void LZ4_wildCopy(void* dstPtr, const void* srcPtr, void* dstEnd) +{ + BYTE* d = (BYTE*)dstPtr; + const BYTE* s = (const BYTE*)srcPtr; + BYTE* e = (BYTE*)dstEnd; + do { LZ4_copy8(d,s); d+=8; s+=8; } while (d>3); +# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT) + return (__builtin_ctzll((U64)val) >> 3); +# else + static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 }; + return DeBruijnBytePos[((U64)((val & -(long long)val) * 0x0218A392CDABBD3FULL)) >> 58]; +# endif + } + else /* 32 bits */ + { +# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) + unsigned long r; + _BitScanForward( &r, (U32)val ); + return (int)(r>>3); +# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT) + return (__builtin_ctz((U32)val) >> 3); +# else + static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 }; + return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27]; +# endif + } + } + else /* Big Endian CPU */ + { + if (LZ4_64bits()) + { +# if defined(_MSC_VER) && defined(_WIN64) && !defined(LZ4_FORCE_SW_BITCOUNT) + unsigned long r = 0; + _BitScanReverse64( &r, val ); + return (unsigned)(r>>3); +# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT) + return (__builtin_clzll((U64)val) >> 3); +# else + unsigned r; + if (!(val>>32)) { r=4; } else { r=0; val>>=32; } + if (!(val>>16)) { r+=2; val>>=8; } else { val>>=24; } + r += (!val); + return r; +# endif + } + else /* 32 bits */ + { +# if defined(_MSC_VER) && !defined(LZ4_FORCE_SW_BITCOUNT) + unsigned long r = 0; + _BitScanReverse( &r, (unsigned long)val ); + return (unsigned)(r>>3); +# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT) + return (__builtin_clz((U32)val) >> 3); +# else + unsigned r; + if (!(val>>16)) { r=2; val>>=8; } else { r=0; val>>=24; } + r += (!val); + return r; +# endif + } + } +} + +static unsigned LZ4_count(const BYTE* pIn, const BYTE* pMatch, const BYTE* pInLimit) +{ + const BYTE* const pStart = pIn; + + while (likely(pIn compression run slower on incompressible data */ + + +/************************************** +* Local Structures and types +**************************************/ +typedef struct { + U32 hashTable[HASH_SIZE_U32]; + U32 currentOffset; + U32 initCheck; + const BYTE* dictionary; + BYTE* bufferStart; /* obsolete, used for slideInputBuffer */ + U32 dictSize; +} LZ4_stream_t_internal; + +typedef enum { notLimited = 0, limitedOutput = 1 } limitedOutput_directive; +typedef enum { byPtr, byU32, byU16 } tableType_t; + +typedef enum { noDict = 0, withPrefix64k, usingExtDict } dict_directive; +typedef enum { noDictIssue = 0, dictSmall } dictIssue_directive; + +typedef enum { endOnOutputSize = 0, endOnInputSize = 1 } endCondition_directive; +typedef enum { full = 0, partial = 1 } earlyEnd_directive; + + +/************************************** +* Local Utils +**************************************/ +int LZ4_versionNumber (void) { return LZ4_VERSION_NUMBER; } +int LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); } +int LZ4_sizeofState() { return LZ4_STREAMSIZE; } + + + +/******************************** +* Compression functions +********************************/ + +static U32 LZ4_hashSequence(U32 sequence, tableType_t const tableType) +{ + if (tableType == byU16) + return (((sequence) * 2654435761U) >> ((MINMATCH*8)-(LZ4_HASHLOG+1))); + else + return (((sequence) * 2654435761U) >> ((MINMATCH*8)-LZ4_HASHLOG)); +} + +static const U64 prime5bytes = 889523592379ULL; +static U32 LZ4_hashSequence64(size_t sequence, tableType_t const tableType) +{ + const U32 hashLog = (tableType == byU16) ? LZ4_HASHLOG+1 : LZ4_HASHLOG; + const U32 hashMask = (1<> (40 - hashLog)) & hashMask; +} + +static U32 LZ4_hashSequenceT(size_t sequence, tableType_t const tableType) +{ + if (LZ4_64bits()) + return LZ4_hashSequence64(sequence, tableType); + return LZ4_hashSequence((U32)sequence, tableType); +} + +static U32 LZ4_hashPosition(const void* p, tableType_t tableType) { return LZ4_hashSequenceT(LZ4_read_ARCH(p), tableType); } + +static void LZ4_putPositionOnHash(const BYTE* p, U32 h, void* tableBase, tableType_t const tableType, const BYTE* srcBase) +{ + switch (tableType) + { + case byPtr: { const BYTE** hashTable = (const BYTE**)tableBase; hashTable[h] = p; return; } + case byU32: { U32* hashTable = (U32*) tableBase; hashTable[h] = (U32)(p-srcBase); return; } + case byU16: { U16* hashTable = (U16*) tableBase; hashTable[h] = (U16)(p-srcBase); return; } + } +} + +static void LZ4_putPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) +{ + U32 h = LZ4_hashPosition(p, tableType); + LZ4_putPositionOnHash(p, h, tableBase, tableType, srcBase); +} + +static const BYTE* LZ4_getPositionOnHash(U32 h, void* tableBase, tableType_t tableType, const BYTE* srcBase) +{ + if (tableType == byPtr) { const BYTE** hashTable = (const BYTE**) tableBase; return hashTable[h]; } + if (tableType == byU32) { U32* hashTable = (U32*) tableBase; return hashTable[h] + srcBase; } + { U16* hashTable = (U16*) tableBase; return hashTable[h] + srcBase; } /* default, to ensure a return */ +} + +static const BYTE* LZ4_getPosition(const BYTE* p, void* tableBase, tableType_t tableType, const BYTE* srcBase) +{ + U32 h = LZ4_hashPosition(p, tableType); + return LZ4_getPositionOnHash(h, tableBase, tableType, srcBase); +} + +FORCE_INLINE int LZ4_compress_generic( + void* const ctx, + const char* const source, + char* const dest, + const int inputSize, + const int maxOutputSize, + const limitedOutput_directive outputLimited, + const tableType_t tableType, + const dict_directive dict, + const dictIssue_directive dictIssue, + const U32 acceleration) +{ + LZ4_stream_t_internal* const dictPtr = (LZ4_stream_t_internal*)ctx; + + const BYTE* ip = (const BYTE*) source; + const BYTE* base; + const BYTE* lowLimit; + const BYTE* const lowRefLimit = ip - dictPtr->dictSize; + const BYTE* const dictionary = dictPtr->dictionary; + const BYTE* const dictEnd = dictionary + dictPtr->dictSize; + const size_t dictDelta = dictEnd - (const BYTE*)source; + const BYTE* anchor = (const BYTE*) source; + const BYTE* const iend = ip + inputSize; + const BYTE* const mflimit = iend - MFLIMIT; + const BYTE* const matchlimit = iend - LASTLITERALS; + + BYTE* op = (BYTE*) dest; + BYTE* const olimit = op + maxOutputSize; + + U32 forwardH; + size_t refDelta=0; + + /* Init conditions */ + if ((U32)inputSize > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size, too large (or negative) */ + switch(dict) + { + case noDict: + default: + base = (const BYTE*)source; + lowLimit = (const BYTE*)source; + break; + case withPrefix64k: + base = (const BYTE*)source - dictPtr->currentOffset; + lowLimit = (const BYTE*)source - dictPtr->dictSize; + break; + case usingExtDict: + base = (const BYTE*)source - dictPtr->currentOffset; + lowLimit = (const BYTE*)source; + break; + } + if ((tableType == byU16) && (inputSize>=LZ4_64Klimit)) return 0; /* Size too large (not within 64K limit) */ + if (inputSize> LZ4_skipTrigger); + + if (unlikely(forwardIp > mflimit)) goto _last_literals; + + match = LZ4_getPositionOnHash(h, ctx, tableType, base); + if (dict==usingExtDict) + { + if (match<(const BYTE*)source) + { + refDelta = dictDelta; + lowLimit = dictionary; + } + else + { + refDelta = 0; + lowLimit = (const BYTE*)source; + } + } + forwardH = LZ4_hashPosition(forwardIp, tableType); + LZ4_putPositionOnHash(ip, h, ctx, tableType, base); + + } while ( ((dictIssue==dictSmall) ? (match < lowRefLimit) : 0) + || ((tableType==byU16) ? 0 : (match + MAX_DISTANCE < ip)) + || (LZ4_read32(match+refDelta) != LZ4_read32(ip)) ); + } + + /* Catch up */ + while ((ip>anchor) && (match+refDelta > lowLimit) && (unlikely(ip[-1]==match[refDelta-1]))) { ip--; match--; } + + { + /* Encode Literal length */ + unsigned litLength = (unsigned)(ip - anchor); + token = op++; + if ((outputLimited) && (unlikely(op + litLength + (2 + 1 + LASTLITERALS) + (litLength/255) > olimit))) + return 0; /* Check output limit */ + if (litLength>=RUN_MASK) + { + int len = (int)litLength-RUN_MASK; + *token=(RUN_MASK<= 255 ; len-=255) *op++ = 255; + *op++ = (BYTE)len; + } + else *token = (BYTE)(litLength< matchlimit) limit = matchlimit; + matchLength = LZ4_count(ip+MINMATCH, match+MINMATCH, limit); + ip += MINMATCH + matchLength; + if (ip==limit) + { + unsigned more = LZ4_count(ip, (const BYTE*)source, matchlimit); + matchLength += more; + ip += more; + } + } + else + { + matchLength = LZ4_count(ip+MINMATCH, match+MINMATCH, matchlimit); + ip += MINMATCH + matchLength; + } + + if ((outputLimited) && (unlikely(op + (1 + LASTLITERALS) + (matchLength>>8) > olimit))) + return 0; /* Check output limit */ + if (matchLength>=ML_MASK) + { + *token += ML_MASK; + matchLength -= ML_MASK; + for (; matchLength >= 510 ; matchLength-=510) { *op++ = 255; *op++ = 255; } + if (matchLength >= 255) { matchLength-=255; *op++ = 255; } + *op++ = (BYTE)matchLength; + } + else *token += (BYTE)(matchLength); + } + + anchor = ip; + + /* Test end of chunk */ + if (ip > mflimit) break; + + /* Fill table */ + LZ4_putPosition(ip-2, ctx, tableType, base); + + /* Test next position */ + match = LZ4_getPosition(ip, ctx, tableType, base); + if (dict==usingExtDict) + { + if (match<(const BYTE*)source) + { + refDelta = dictDelta; + lowLimit = dictionary; + } + else + { + refDelta = 0; + lowLimit = (const BYTE*)source; + } + } + LZ4_putPosition(ip, ctx, tableType, base); + if ( ((dictIssue==dictSmall) ? (match>=lowRefLimit) : 1) + && (match+MAX_DISTANCE>=ip) + && (LZ4_read32(match+refDelta)==LZ4_read32(ip)) ) + { token=op++; *token=0; goto _next_match; } + + /* Prepare next loop */ + forwardH = LZ4_hashPosition(++ip, tableType); + } + +_last_literals: + /* Encode Last Literals */ + { + const size_t lastRun = (size_t)(iend - anchor); + if ((outputLimited) && ((op - (BYTE*)dest) + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > (U32)maxOutputSize)) + return 0; /* Check output limit */ + if (lastRun >= RUN_MASK) + { + size_t accumulator = lastRun - RUN_MASK; + *op++ = RUN_MASK << ML_BITS; + for(; accumulator >= 255 ; accumulator-=255) *op++ = 255; + *op++ = (BYTE) accumulator; + } + else + { + *op++ = (BYTE)(lastRun<= LZ4_compressBound(inputSize)) + { + if (inputSize < LZ4_64Klimit) + return LZ4_compress_generic(state, source, dest, inputSize, 0, notLimited, byU16, noDict, noDictIssue, acceleration); + else + return LZ4_compress_generic(state, source, dest, inputSize, 0, notLimited, LZ4_64bits() ? byU32 : byPtr, noDict, noDictIssue, acceleration); + } + else + { + if (inputSize < LZ4_64Klimit) + return LZ4_compress_generic(state, source, dest, inputSize, maxOutputSize, limitedOutput, byU16, noDict, noDictIssue, acceleration); + else + return LZ4_compress_generic(state, source, dest, inputSize, maxOutputSize, limitedOutput, LZ4_64bits() ? byU32 : byPtr, noDict, noDictIssue, acceleration); + } +} + + +int LZ4_compress_fast(const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration) +{ +#if (HEAPMODE) + void* ctxPtr = ALLOCATOR(1, sizeof(LZ4_stream_t)); /* malloc-calloc always properly aligned */ +#else + LZ4_stream_t ctx; + void* ctxPtr = &ctx; +#endif + + int result = LZ4_compress_fast_extState(ctxPtr, source, dest, inputSize, maxOutputSize, acceleration); + +#if (HEAPMODE) + FREEMEM(ctxPtr); +#endif + return result; +} + + +int LZ4_compress_default(const char* source, char* dest, int inputSize, int maxOutputSize) +{ + return LZ4_compress_fast(source, dest, inputSize, maxOutputSize, 1); +} + + +/* hidden debug function */ +/* strangely enough, gcc generates faster code when this function is uncommented, even if unused */ +int LZ4_compress_fast_force(const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration) +{ + LZ4_stream_t ctx; + + LZ4_resetStream(&ctx); + + if (inputSize < LZ4_64Klimit) + return LZ4_compress_generic(&ctx, source, dest, inputSize, maxOutputSize, limitedOutput, byU16, noDict, noDictIssue, acceleration); + else + return LZ4_compress_generic(&ctx, source, dest, inputSize, maxOutputSize, limitedOutput, LZ4_64bits() ? byU32 : byPtr, noDict, noDictIssue, acceleration); +} + + +/******************************** +* destSize variant +********************************/ + +static int LZ4_compress_destSize_generic( + void* const ctx, + const char* const src, + char* const dst, + int* const srcSizePtr, + const int targetDstSize, + const tableType_t tableType) +{ + const BYTE* ip = (const BYTE*) src; + const BYTE* base = (const BYTE*) src; + const BYTE* lowLimit = (const BYTE*) src; + const BYTE* anchor = ip; + const BYTE* const iend = ip + *srcSizePtr; + const BYTE* const mflimit = iend - MFLIMIT; + const BYTE* const matchlimit = iend - LASTLITERALS; + + BYTE* op = (BYTE*) dst; + BYTE* const oend = op + targetDstSize; + BYTE* const oMaxLit = op + targetDstSize - 2 /* offset */ - 8 /* because 8+MINMATCH==MFLIMIT */ - 1 /* token */; + BYTE* const oMaxMatch = op + targetDstSize - (LASTLITERALS + 1 /* token */); + BYTE* const oMaxSeq = oMaxLit - 1 /* token */; + + U32 forwardH; + + + /* Init conditions */ + if (targetDstSize < 1) return 0; /* Impossible to store anything */ + if ((U32)*srcSizePtr > (U32)LZ4_MAX_INPUT_SIZE) return 0; /* Unsupported input size, too large (or negative) */ + if ((tableType == byU16) && (*srcSizePtr>=LZ4_64Klimit)) return 0; /* Size too large (not within 64K limit) */ + if (*srcSizePtr> LZ4_skipTrigger); + + if (unlikely(forwardIp > mflimit)) + goto _last_literals; + + match = LZ4_getPositionOnHash(h, ctx, tableType, base); + forwardH = LZ4_hashPosition(forwardIp, tableType); + LZ4_putPositionOnHash(ip, h, ctx, tableType, base); + + } while ( ((tableType==byU16) ? 0 : (match + MAX_DISTANCE < ip)) + || (LZ4_read32(match) != LZ4_read32(ip)) ); + } + + /* Catch up */ + while ((ip>anchor) && (match > lowLimit) && (unlikely(ip[-1]==match[-1]))) { ip--; match--; } + + { + /* Encode Literal length */ + unsigned litLength = (unsigned)(ip - anchor); + token = op++; + if (op + ((litLength+240)/255) + litLength > oMaxLit) + { + /* Not enough space for a last match */ + op--; + goto _last_literals; + } + if (litLength>=RUN_MASK) + { + unsigned len = litLength - RUN_MASK; + *token=(RUN_MASK<= 255 ; len-=255) *op++ = 255; + *op++ = (BYTE)len; + } + else *token = (BYTE)(litLength< oMaxMatch) + { + /* Match description too long : reduce it */ + matchLength = (15-1) + (oMaxMatch-op) * 255; + } + //printf("offset %5i, matchLength%5i \n", (int)(ip-match), matchLength + MINMATCH); + ip += MINMATCH + matchLength; + + if (matchLength>=ML_MASK) + { + *token += ML_MASK; + matchLength -= ML_MASK; + while (matchLength >= 255) { matchLength-=255; *op++ = 255; } + *op++ = (BYTE)matchLength; + } + else *token += (BYTE)(matchLength); + } + + anchor = ip; + + /* Test end of block */ + if (ip > mflimit) break; + if (op > oMaxSeq) break; + + /* Fill table */ + LZ4_putPosition(ip-2, ctx, tableType, base); + + /* Test next position */ + match = LZ4_getPosition(ip, ctx, tableType, base); + LZ4_putPosition(ip, ctx, tableType, base); + if ( (match+MAX_DISTANCE>=ip) + && (LZ4_read32(match)==LZ4_read32(ip)) ) + { token=op++; *token=0; goto _next_match; } + + /* Prepare next loop */ + forwardH = LZ4_hashPosition(++ip, tableType); + } + +_last_literals: + /* Encode Last Literals */ + { + size_t lastRunSize = (size_t)(iend - anchor); + if (op + 1 /* token */ + ((lastRunSize+240)/255) /* litLength */ + lastRunSize /* literals */ > oend) + { + /* adapt lastRunSize to fill 'dst' */ + lastRunSize = (oend-op) - 1; + lastRunSize -= (lastRunSize+240)/255; + } + ip = anchor + lastRunSize; + + if (lastRunSize >= RUN_MASK) + { + size_t accumulator = lastRunSize - RUN_MASK; + *op++ = RUN_MASK << ML_BITS; + for(; accumulator >= 255 ; accumulator-=255) *op++ = 255; + *op++ = (BYTE) accumulator; + } + else + { + *op++ = (BYTE)(lastRunSize<= LZ4_compressBound(*srcSizePtr)) /* compression success is guaranteed */ + { + return LZ4_compress_fast_extState(state, src, dst, *srcSizePtr, targetDstSize, 1); + } + else + { + if (*srcSizePtr < LZ4_64Klimit) + return LZ4_compress_destSize_generic(state, src, dst, srcSizePtr, targetDstSize, byU16); + else + return LZ4_compress_destSize_generic(state, src, dst, srcSizePtr, targetDstSize, LZ4_64bits() ? byU32 : byPtr); + } +} + + +int LZ4_compress_destSize(const char* src, char* dst, int* srcSizePtr, int targetDstSize) +{ +#if (HEAPMODE) + void* ctx = ALLOCATOR(1, sizeof(LZ4_stream_t)); /* malloc-calloc always properly aligned */ +#else + LZ4_stream_t ctxBody; + void* ctx = &ctxBody; +#endif + + int result = LZ4_compress_destSize_extState(ctx, src, dst, srcSizePtr, targetDstSize); + +#if (HEAPMODE) + FREEMEM(ctx); +#endif + return result; +} + + + +/******************************** +* Streaming functions +********************************/ + +LZ4_stream_t* LZ4_createStream(void) +{ + LZ4_stream_t* lz4s = (LZ4_stream_t*)ALLOCATOR(8, LZ4_STREAMSIZE_U64); + LZ4_STATIC_ASSERT(LZ4_STREAMSIZE >= sizeof(LZ4_stream_t_internal)); /* A compilation error here means LZ4_STREAMSIZE is not large enough */ + LZ4_resetStream(lz4s); + return lz4s; +} + +void LZ4_resetStream (LZ4_stream_t* LZ4_stream) +{ + MEM_INIT(LZ4_stream, 0, sizeof(LZ4_stream_t)); +} + +int LZ4_freeStream (LZ4_stream_t* LZ4_stream) +{ + FREEMEM(LZ4_stream); + return (0); +} + + +#define HASH_UNIT sizeof(size_t) +int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize) +{ + LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict; + const BYTE* p = (const BYTE*)dictionary; + const BYTE* const dictEnd = p + dictSize; + const BYTE* base; + + if ((dict->initCheck) || (dict->currentOffset > 1 GB)) /* Uninitialized structure, or reuse overflow */ + LZ4_resetStream(LZ4_dict); + + if (dictSize < (int)HASH_UNIT) + { + dict->dictionary = NULL; + dict->dictSize = 0; + return 0; + } + + if ((dictEnd - p) > 64 KB) p = dictEnd - 64 KB; + dict->currentOffset += 64 KB; + base = p - dict->currentOffset; + dict->dictionary = p; + dict->dictSize = (U32)(dictEnd - p); + dict->currentOffset += dict->dictSize; + + while (p <= dictEnd-HASH_UNIT) + { + LZ4_putPosition(p, dict->hashTable, byU32, base); + p+=3; + } + + return dict->dictSize; +} + + +static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, const BYTE* src) +{ + if ((LZ4_dict->currentOffset > 0x80000000) || + ((size_t)LZ4_dict->currentOffset > (size_t)src)) /* address space overflow */ + { + /* rescale hash table */ + U32 delta = LZ4_dict->currentOffset - 64 KB; + const BYTE* dictEnd = LZ4_dict->dictionary + LZ4_dict->dictSize; + int i; + for (i=0; ihashTable[i] < delta) LZ4_dict->hashTable[i]=0; + else LZ4_dict->hashTable[i] -= delta; + } + LZ4_dict->currentOffset = 64 KB; + if (LZ4_dict->dictSize > 64 KB) LZ4_dict->dictSize = 64 KB; + LZ4_dict->dictionary = dictEnd - LZ4_dict->dictSize; + } +} + + +int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration) +{ + LZ4_stream_t_internal* streamPtr = (LZ4_stream_t_internal*)LZ4_stream; + const BYTE* const dictEnd = streamPtr->dictionary + streamPtr->dictSize; + + const BYTE* smallest = (const BYTE*) source; + if (streamPtr->initCheck) return 0; /* Uninitialized structure detected */ + if ((streamPtr->dictSize>0) && (smallest>dictEnd)) smallest = dictEnd; + LZ4_renormDictT(streamPtr, smallest); + if (acceleration < 1) acceleration = ACCELERATION_DEFAULT; + + /* Check overlapping input/dictionary space */ + { + const BYTE* sourceEnd = (const BYTE*) source + inputSize; + if ((sourceEnd > streamPtr->dictionary) && (sourceEnd < dictEnd)) + { + streamPtr->dictSize = (U32)(dictEnd - sourceEnd); + if (streamPtr->dictSize > 64 KB) streamPtr->dictSize = 64 KB; + if (streamPtr->dictSize < 4) streamPtr->dictSize = 0; + streamPtr->dictionary = dictEnd - streamPtr->dictSize; + } + } + + /* prefix mode : source data follows dictionary */ + if (dictEnd == (const BYTE*)source) + { + int result; + if ((streamPtr->dictSize < 64 KB) && (streamPtr->dictSize < streamPtr->currentOffset)) + result = LZ4_compress_generic(LZ4_stream, source, dest, inputSize, maxOutputSize, limitedOutput, byU32, withPrefix64k, dictSmall, acceleration); + else + result = LZ4_compress_generic(LZ4_stream, source, dest, inputSize, maxOutputSize, limitedOutput, byU32, withPrefix64k, noDictIssue, acceleration); + streamPtr->dictSize += (U32)inputSize; + streamPtr->currentOffset += (U32)inputSize; + return result; + } + + /* external dictionary mode */ + { + int result; + if ((streamPtr->dictSize < 64 KB) && (streamPtr->dictSize < streamPtr->currentOffset)) + result = LZ4_compress_generic(LZ4_stream, source, dest, inputSize, maxOutputSize, limitedOutput, byU32, usingExtDict, dictSmall, acceleration); + else + result = LZ4_compress_generic(LZ4_stream, source, dest, inputSize, maxOutputSize, limitedOutput, byU32, usingExtDict, noDictIssue, acceleration); + streamPtr->dictionary = (const BYTE*)source; + streamPtr->dictSize = (U32)inputSize; + streamPtr->currentOffset += (U32)inputSize; + return result; + } +} + + +/* Hidden debug function, to force external dictionary mode */ +int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_dict, const char* source, char* dest, int inputSize) +{ + LZ4_stream_t_internal* streamPtr = (LZ4_stream_t_internal*)LZ4_dict; + int result; + const BYTE* const dictEnd = streamPtr->dictionary + streamPtr->dictSize; + + const BYTE* smallest = dictEnd; + if (smallest > (const BYTE*) source) smallest = (const BYTE*) source; + LZ4_renormDictT((LZ4_stream_t_internal*)LZ4_dict, smallest); + + result = LZ4_compress_generic(LZ4_dict, source, dest, inputSize, 0, notLimited, byU32, usingExtDict, noDictIssue, 1); + + streamPtr->dictionary = (const BYTE*)source; + streamPtr->dictSize = (U32)inputSize; + streamPtr->currentOffset += (U32)inputSize; + + return result; +} + + +int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize) +{ + LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict; + const BYTE* previousDictEnd = dict->dictionary + dict->dictSize; + + if ((U32)dictSize > 64 KB) dictSize = 64 KB; /* useless to define a dictionary > 64 KB */ + if ((U32)dictSize > dict->dictSize) dictSize = dict->dictSize; + + memmove(safeBuffer, previousDictEnd - dictSize, dictSize); + + dict->dictionary = (const BYTE*)safeBuffer; + dict->dictSize = (U32)dictSize; + + return dictSize; +} + + + +/******************************* +* Decompression functions +*******************************/ +/* + * This generic decompression function cover all use cases. + * It shall be instantiated several times, using different sets of directives + * Note that it is essential this generic function is really inlined, + * in order to remove useless branches during compilation optimization. + */ +FORCE_INLINE int LZ4_decompress_generic( + const char* const source, + char* const dest, + int inputSize, + int outputSize, /* If endOnInput==endOnInputSize, this value is the max size of Output Buffer. */ + + int endOnInput, /* endOnOutputSize, endOnInputSize */ + int partialDecoding, /* full, partial */ + int targetOutputSize, /* only used if partialDecoding==partial */ + int dict, /* noDict, withPrefix64k, usingExtDict */ + const BYTE* const lowPrefix, /* == dest if dict == noDict */ + const BYTE* const dictStart, /* only if dict==usingExtDict */ + const size_t dictSize /* note : = 0 if noDict */ + ) +{ + /* Local Variables */ + const BYTE* ip = (const BYTE*) source; + const BYTE* const iend = ip + inputSize; + + BYTE* op = (BYTE*) dest; + BYTE* const oend = op + outputSize; + BYTE* cpy; + BYTE* oexit = op + targetOutputSize; + const BYTE* const lowLimit = lowPrefix - dictSize; + + const BYTE* const dictEnd = (const BYTE*)dictStart + dictSize; + const size_t dec32table[] = {4, 1, 2, 1, 4, 4, 4, 4}; + const size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3}; + + const int safeDecode = (endOnInput==endOnInputSize); + const int checkOffset = ((safeDecode) && (dictSize < (int)(64 KB))); + + + /* Special cases */ + if ((partialDecoding) && (oexit> oend-MFLIMIT)) oexit = oend-MFLIMIT; /* targetOutputSize too high => decode everything */ + if ((endOnInput) && (unlikely(outputSize==0))) return ((inputSize==1) && (*ip==0)) ? 0 : -1; /* Empty output buffer */ + if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0?1:-1); + + + /* Main Loop */ + while (1) + { + unsigned token; + size_t length; + const BYTE* match; + + /* get literal length */ + token = *ip++; + if ((length=(token>>ML_BITS)) == RUN_MASK) + { + unsigned s; + do + { + s = *ip++; + length += s; + } + while (likely((endOnInput)?ip(partialDecoding?oexit:oend-MFLIMIT)) || (ip+length>iend-(2+1+LASTLITERALS))) ) + || ((!endOnInput) && (cpy>oend-COPYLENGTH))) + { + if (partialDecoding) + { + if (cpy > oend) goto _output_error; /* Error : write attempt beyond end of output buffer */ + if ((endOnInput) && (ip+length > iend)) goto _output_error; /* Error : read attempt beyond end of input buffer */ + } + else + { + if ((!endOnInput) && (cpy != oend)) goto _output_error; /* Error : block decoding must stop exactly there */ + if ((endOnInput) && ((ip+length != iend) || (cpy > oend))) goto _output_error; /* Error : input must be consumed */ + } + memcpy(op, ip, length); + ip += length; + op += length; + break; /* Necessarily EOF, due to parsing restrictions */ + } + LZ4_wildCopy(op, ip, cpy); + ip += length; op = cpy; + + /* get offset */ + match = cpy - LZ4_readLE16(ip); ip+=2; + if ((checkOffset) && (unlikely(match < lowLimit))) goto _output_error; /* Error : offset outside destination buffer */ + + /* get matchlength */ + length = token & ML_MASK; + if (length == ML_MASK) + { + unsigned s; + do + { + if ((endOnInput) && (ip > iend-LASTLITERALS)) goto _output_error; + s = *ip++; + length += s; + } while (s==255); + if ((safeDecode) && unlikely((size_t)(op+length)<(size_t)op)) goto _output_error; /* overflow detection */ + } + length += MINMATCH; + + /* check external dictionary */ + if ((dict==usingExtDict) && (match < lowPrefix)) + { + if (unlikely(op+length > oend-LASTLITERALS)) goto _output_error; /* doesn't respect parsing restriction */ + + if (length <= (size_t)(lowPrefix-match)) + { + /* match can be copied as a single segment from external dictionary */ + match = dictEnd - (lowPrefix-match); + memmove(op, match, length); op += length; + } + else + { + /* match encompass external dictionary and current segment */ + size_t copySize = (size_t)(lowPrefix-match); + memcpy(op, dictEnd - copySize, copySize); + op += copySize; + copySize = length - copySize; + if (copySize > (size_t)(op-lowPrefix)) /* overlap within current segment */ + { + BYTE* const endOfMatch = op + copySize; + const BYTE* copyFrom = lowPrefix; + while (op < endOfMatch) *op++ = *copyFrom++; + } + else + { + memcpy(op, lowPrefix, copySize); + op += copySize; + } + } + continue; + } + + /* copy repeated sequence */ + cpy = op + length; + if (unlikely((op-match)<8)) + { + const size_t dec64 = dec64table[op-match]; + op[0] = match[0]; + op[1] = match[1]; + op[2] = match[2]; + op[3] = match[3]; + match += dec32table[op-match]; + LZ4_copy4(op+4, match); + op += 8; match -= dec64; + } else { LZ4_copy8(op, match); op+=8; match+=8; } + + if (unlikely(cpy>oend-12)) + { + if (cpy > oend-LASTLITERALS) goto _output_error; /* Error : last LASTLITERALS bytes must be literals */ + if (op < oend-8) + { + LZ4_wildCopy(op, match, oend-8); + match += (oend-8) - op; + op = oend-8; + } + while (opprefixSize = (size_t) dictSize; + lz4sd->prefixEnd = (const BYTE*) dictionary + dictSize; + lz4sd->externalDict = NULL; + lz4sd->extDictSize = 0; + return 1; +} + +/* +*_continue() : + These decoding functions allow decompression of multiple blocks in "streaming" mode. + Previously decoded blocks must still be available at the memory position where they were decoded. + If it's not possible, save the relevant part of decoded data into a safe buffer, + and indicate where it stands using LZ4_setStreamDecode() +*/ +int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxOutputSize) +{ + LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode; + int result; + + if (lz4sd->prefixEnd == (BYTE*)dest) + { + result = LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, + endOnInputSize, full, 0, + usingExtDict, lz4sd->prefixEnd - lz4sd->prefixSize, lz4sd->externalDict, lz4sd->extDictSize); + if (result <= 0) return result; + lz4sd->prefixSize += result; + lz4sd->prefixEnd += result; + } + else + { + lz4sd->extDictSize = lz4sd->prefixSize; + lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize; + result = LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, + endOnInputSize, full, 0, + usingExtDict, (BYTE*)dest, lz4sd->externalDict, lz4sd->extDictSize); + if (result <= 0) return result; + lz4sd->prefixSize = result; + lz4sd->prefixEnd = (BYTE*)dest + result; + } + + return result; +} + +int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int originalSize) +{ + LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode; + int result; + + if (lz4sd->prefixEnd == (BYTE*)dest) + { + result = LZ4_decompress_generic(source, dest, 0, originalSize, + endOnOutputSize, full, 0, + usingExtDict, lz4sd->prefixEnd - lz4sd->prefixSize, lz4sd->externalDict, lz4sd->extDictSize); + if (result <= 0) return result; + lz4sd->prefixSize += originalSize; + lz4sd->prefixEnd += originalSize; + } + else + { + lz4sd->extDictSize = lz4sd->prefixSize; + lz4sd->externalDict = (BYTE*)dest - lz4sd->extDictSize; + result = LZ4_decompress_generic(source, dest, 0, originalSize, + endOnOutputSize, full, 0, + usingExtDict, (BYTE*)dest, lz4sd->externalDict, lz4sd->extDictSize); + if (result <= 0) return result; + lz4sd->prefixSize = originalSize; + lz4sd->prefixEnd = (BYTE*)dest + originalSize; + } + + return result; +} + + +/* +Advanced decoding functions : +*_usingDict() : + These decoding functions work the same as "_continue" ones, + the dictionary must be explicitly provided within parameters +*/ + +FORCE_INLINE int LZ4_decompress_usingDict_generic(const char* source, char* dest, int compressedSize, int maxOutputSize, int safe, const char* dictStart, int dictSize) +{ + if (dictSize==0) + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, safe, full, 0, noDict, (BYTE*)dest, NULL, 0); + if (dictStart+dictSize == dest) + { + if (dictSize >= (int)(64 KB - 1)) + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, safe, full, 0, withPrefix64k, (BYTE*)dest-64 KB, NULL, 0); + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, safe, full, 0, noDict, (BYTE*)dest-dictSize, NULL, 0); + } + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, safe, full, 0, usingExtDict, (BYTE*)dest, (const BYTE*)dictStart, dictSize); +} + +int LZ4_decompress_safe_usingDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize) +{ + return LZ4_decompress_usingDict_generic(source, dest, compressedSize, maxOutputSize, 1, dictStart, dictSize); +} + +int LZ4_decompress_fast_usingDict(const char* source, char* dest, int originalSize, const char* dictStart, int dictSize) +{ + return LZ4_decompress_usingDict_generic(source, dest, 0, originalSize, 0, dictStart, dictSize); +} + +/* debug function */ +int LZ4_decompress_safe_forceExtDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize) +{ + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, endOnInputSize, full, 0, usingExtDict, (BYTE*)dest, (const BYTE*)dictStart, dictSize); +} + + +/*************************************************** +* Obsolete Functions +***************************************************/ +/* obsolete compression functions */ +int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize) { return LZ4_compress_default(source, dest, inputSize, maxOutputSize); } +int LZ4_compress(const char* source, char* dest, int inputSize) { return LZ4_compress_default(source, dest, inputSize, LZ4_compressBound(inputSize)); } +int LZ4_compress_limitedOutput_withState (void* state, const char* src, char* dst, int srcSize, int dstSize) { return LZ4_compress_fast_extState(state, src, dst, srcSize, dstSize, 1); } +int LZ4_compress_withState (void* state, const char* src, char* dst, int srcSize) { return LZ4_compress_fast_extState(state, src, dst, srcSize, LZ4_compressBound(srcSize), 1); } +int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_stream, const char* src, char* dst, int srcSize, int maxDstSize) { return LZ4_compress_fast_continue(LZ4_stream, src, dst, srcSize, maxDstSize, 1); } +int LZ4_compress_continue (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize) { return LZ4_compress_fast_continue(LZ4_stream, source, dest, inputSize, LZ4_compressBound(inputSize), 1); } + +/* +These function names are deprecated and should no longer be used. +They are only provided here for compatibility with older user programs. +- LZ4_uncompress is totally equivalent to LZ4_decompress_fast +- LZ4_uncompress_unknownOutputSize is totally equivalent to LZ4_decompress_safe +*/ +int LZ4_uncompress (const char* source, char* dest, int outputSize) { return LZ4_decompress_fast(source, dest, outputSize); } +int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize) { return LZ4_decompress_safe(source, dest, isize, maxOutputSize); } + + +/* Obsolete Streaming functions */ + +int LZ4_sizeofStreamState() { return LZ4_STREAMSIZE; } + +static void LZ4_init(LZ4_stream_t_internal* lz4ds, BYTE* base) +{ + MEM_INIT(lz4ds, 0, LZ4_STREAMSIZE); + lz4ds->bufferStart = base; +} + +int LZ4_resetStreamState(void* state, char* inputBuffer) +{ + if ((((size_t)state) & 3) != 0) return 1; /* Error : pointer is not aligned on 4-bytes boundary */ + LZ4_init((LZ4_stream_t_internal*)state, (BYTE*)inputBuffer); + return 0; +} + +void* LZ4_create (char* inputBuffer) +{ + void* lz4ds = ALLOCATOR(8, LZ4_STREAMSIZE_U64); + LZ4_init ((LZ4_stream_t_internal*)lz4ds, (BYTE*)inputBuffer); + return lz4ds; +} + +char* LZ4_slideInputBuffer (void* LZ4_Data) +{ + LZ4_stream_t_internal* ctx = (LZ4_stream_t_internal*)LZ4_Data; + int dictSize = LZ4_saveDict((LZ4_stream_t*)LZ4_Data, (char*)ctx->bufferStart, 64 KB); + return (char*)(ctx->bufferStart + dictSize); +} + +/* Obsolete streaming decompression functions */ + +int LZ4_decompress_safe_withPrefix64k(const char* source, char* dest, int compressedSize, int maxOutputSize) +{ + return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, endOnInputSize, full, 0, withPrefix64k, (BYTE*)dest - 64 KB, NULL, 64 KB); +} + +int LZ4_decompress_fast_withPrefix64k(const char* source, char* dest, int originalSize) +{ + return LZ4_decompress_generic(source, dest, 0, originalSize, endOnOutputSize, full, 0, withPrefix64k, (BYTE*)dest - 64 KB, NULL, 64 KB); +} + +#endif /* LZ4_COMMONDEFS_ONLY */ + diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4.h b/thirdparty/Lz4/Lz4_131/lib/lz4.h new file mode 100644 index 0000000..3e74002 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4.h @@ -0,0 +1,360 @@ +/* + LZ4 - Fast LZ compression algorithm + Header File + Copyright (C) 2011-2015, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +#pragma once + +#if defined (__cplusplus) +extern "C" { +#endif + +/* + * lz4.h provides block compression functions, and gives full buffer control to programmer. + * If you need to generate inter-operable compressed data (respecting LZ4 frame specification), + * and can let the library handle its own memory, please use lz4frame.h instead. +*/ + +/************************************** +* Version +**************************************/ +#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */ +#define LZ4_VERSION_MINOR 7 /* for new (non-breaking) interface capabilities */ +#define LZ4_VERSION_RELEASE 1 /* for tweaks, bug-fixes, or development */ +#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE) +int LZ4_versionNumber (void); + +/************************************** +* Tuning parameter +**************************************/ +/* + * LZ4_MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache + */ +#define LZ4_MEMORY_USAGE 14 + + +/************************************** +* Simple Functions +**************************************/ + +int LZ4_compress_default(const char* source, char* dest, int sourceSize, int maxDestSize); +int LZ4_decompress_safe (const char* source, char* dest, int compressedSize, int maxDecompressedSize); + +/* +LZ4_compress_default() : + Compresses 'sourceSize' bytes from buffer 'source' + into already allocated 'dest' buffer of size 'maxDestSize'. + Compression is guaranteed to succeed if 'maxDestSize' >= LZ4_compressBound(sourceSize). + It also runs faster, so it's a recommended setting. + If the function cannot compress 'source' into a more limited 'dest' budget, + compression stops *immediately*, and the function result is zero. + As a consequence, 'dest' content is not valid. + This function never writes outside 'dest' buffer, nor read outside 'source' buffer. + sourceSize : Max supported value is LZ4_MAX_INPUT_VALUE + maxDestSize : full or partial size of buffer 'dest' (which must be already allocated) + return : the number of bytes written into buffer 'dest' (necessarily <= maxOutputSize) + or 0 if compression fails + +LZ4_decompress_safe() : + compressedSize : is the precise full size of the compressed block. + maxDecompressedSize : is the size of destination buffer, which must be already allocated. + return : the number of bytes decompressed into destination buffer (necessarily <= maxDecompressedSize) + If destination buffer is not large enough, decoding will stop and output an error code (<0). + If the source stream is detected malformed, the function will stop decoding and return a negative result. + This function is protected against buffer overflow exploits, including malicious data packets. + It never writes outside output buffer, nor reads outside input buffer. +*/ + + +/************************************** +* Advanced Functions +**************************************/ +#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */ +#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) + +/* +LZ4_compressBound() : + Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible) + This function is primarily useful for memory allocation purposes (destination buffer size). + Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example). + Note that LZ4_compress_default() compress faster when dest buffer size is >= LZ4_compressBound(srcSize) + inputSize : max supported value is LZ4_MAX_INPUT_SIZE + return : maximum output size in a "worst case" scenario + or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE) +*/ +int LZ4_compressBound(int inputSize); + +/* +LZ4_compress_fast() : + Same as LZ4_compress_default(), but allows to select an "acceleration" factor. + The larger the acceleration value, the faster the algorithm, but also the lesser the compression. + It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed. + An acceleration value of "1" is the same as regular LZ4_compress_default() + Values <= 0 will be replaced by ACCELERATION_DEFAULT (see lz4.c), which is 1. +*/ +int LZ4_compress_fast (const char* source, char* dest, int sourceSize, int maxDestSize, int acceleration); + + +/* +LZ4_compress_fast_extState() : + Same compression function, just using an externally allocated memory space to store compression state. + Use LZ4_sizeofState() to know how much memory must be allocated, + and allocate it on 8-bytes boundaries (using malloc() typically). + Then, provide it as 'void* state' to compression function. +*/ +int LZ4_sizeofState(void); +int LZ4_compress_fast_extState (void* state, const char* source, char* dest, int inputSize, int maxDestSize, int acceleration); + + +/* +LZ4_compress_destSize() : + Reverse the logic, by compressing as much data as possible from 'source' buffer + into already allocated buffer 'dest' of size 'targetDestSize'. + This function either compresses the entire 'source' content into 'dest' if it's large enough, + or fill 'dest' buffer completely with as much data as possible from 'source'. + *sourceSizePtr : will be modified to indicate how many bytes where read from 'source' to fill 'dest'. + New value is necessarily <= old value. + return : Nb bytes written into 'dest' (necessarily <= targetDestSize) + or 0 if compression fails +*/ +int LZ4_compress_destSize (const char* source, char* dest, int* sourceSizePtr, int targetDestSize); + + +/* +LZ4_decompress_fast() : + originalSize : is the original and therefore uncompressed size + return : the number of bytes read from the source buffer (in other words, the compressed size) + If the source stream is detected malformed, the function will stop decoding and return a negative result. + Destination buffer must be already allocated. Its size must be a minimum of 'originalSize' bytes. + note : This function fully respect memory boundaries for properly formed compressed data. + It is a bit faster than LZ4_decompress_safe(). + However, it does not provide any protection against intentionally modified data stream (malicious input). + Use this function in trusted environment only (data to decode comes from a trusted source). +*/ +int LZ4_decompress_fast (const char* source, char* dest, int originalSize); + +/* +LZ4_decompress_safe_partial() : + This function decompress a compressed block of size 'compressedSize' at position 'source' + into destination buffer 'dest' of size 'maxDecompressedSize'. + The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached, + reducing decompression time. + return : the number of bytes decoded in the destination buffer (necessarily <= maxDecompressedSize) + Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller. + Always control how many bytes were decoded. + If the source stream is detected malformed, the function will stop decoding and return a negative result. + This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets +*/ +int LZ4_decompress_safe_partial (const char* source, char* dest, int compressedSize, int targetOutputSize, int maxDecompressedSize); + + +/*********************************************** +* Streaming Compression Functions +***********************************************/ +#define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4) +#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(long long)) +/* + * LZ4_stream_t + * information structure to track an LZ4 stream. + * important : init this structure content before first use ! + * note : only allocated directly the structure if you are statically linking LZ4 + * If you are using liblz4 as a DLL, please use below construction methods instead. + */ +typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t; + +/* + * LZ4_resetStream + * Use this function to init an allocated LZ4_stream_t structure + */ +void LZ4_resetStream (LZ4_stream_t* streamPtr); + +/* + * LZ4_createStream will allocate and initialize an LZ4_stream_t structure + * LZ4_freeStream releases its memory. + * In the context of a DLL (liblz4), please use these methods rather than the static struct. + * They are more future proof, in case of a change of LZ4_stream_t size. + */ +LZ4_stream_t* LZ4_createStream(void); +int LZ4_freeStream (LZ4_stream_t* streamPtr); + +/* + * LZ4_loadDict + * Use this function to load a static dictionary into LZ4_stream. + * Any previous data will be forgotten, only 'dictionary' will remain in memory. + * Loading a size of 0 is allowed. + * Return : dictionary size, in bytes (necessarily <= 64 KB) + */ +int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize); + +/* + * LZ4_compress_fast_continue + * Compress buffer content 'src', using data from previously compressed blocks as dictionary to improve compression ratio. + * Important : Previous data blocks are assumed to still be present and unmodified ! + * 'dst' buffer must be already allocated. + * If maxDstSize >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster. + * If not, and if compressed data cannot fit into 'dst' buffer size, compression stops, and function returns a zero. + */ +int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int maxDstSize, int acceleration); + +/* + * LZ4_saveDict + * If previously compressed data block is not guaranteed to remain available at its memory location + * save it into a safer place (char* safeBuffer) + * Note : you don't need to call LZ4_loadDict() afterwards, + * dictionary is immediately usable, you can therefore call LZ4_compress_fast_continue() + * Return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error + */ +int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int dictSize); + + +/************************************************ +* Streaming Decompression Functions +************************************************/ + +#define LZ4_STREAMDECODESIZE_U64 4 +#define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long)) +typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t; +/* + * LZ4_streamDecode_t + * information structure to track an LZ4 stream. + * init this structure content using LZ4_setStreamDecode or memset() before first use ! + * + * In the context of a DLL (liblz4) please prefer usage of construction methods below. + * They are more future proof, in case of a change of LZ4_streamDecode_t size in the future. + * LZ4_createStreamDecode will allocate and initialize an LZ4_streamDecode_t structure + * LZ4_freeStreamDecode releases its memory. + */ +LZ4_streamDecode_t* LZ4_createStreamDecode(void); +int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream); + +/* + * LZ4_setStreamDecode + * Use this function to instruct where to find the dictionary. + * Setting a size of 0 is allowed (same effect as reset). + * Return : 1 if OK, 0 if error + */ +int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize); + +/* +*_continue() : + These decoding functions allow decompression of multiple blocks in "streaming" mode. + Previously decoded blocks *must* remain available at the memory position where they were decoded (up to 64 KB) + In the case of a ring buffers, decoding buffer must be either : + - Exactly same size as encoding buffer, with same update rule (block boundaries at same positions) + In which case, the decoding & encoding ring buffer can have any size, including very small ones ( < 64 KB). + - Larger than encoding buffer, by a minimum of maxBlockSize more bytes. + maxBlockSize is implementation dependent. It's the maximum size you intend to compress into a single block. + In which case, encoding and decoding buffers do not need to be synchronized, + and encoding ring buffer can have any size, including small ones ( < 64 KB). + - _At least_ 64 KB + 8 bytes + maxBlockSize. + In which case, encoding and decoding buffers do not need to be synchronized, + and encoding ring buffer can have any size, including larger than decoding buffer. + Whenever these conditions are not possible, save the last 64KB of decoded data into a safe buffer, + and indicate where it is saved using LZ4_setStreamDecode() +*/ +int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxDecompressedSize); +int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int originalSize); + + +/* +Advanced decoding functions : +*_usingDict() : + These decoding functions work the same as + a combination of LZ4_setStreamDecode() followed by LZ4_decompress_x_continue() + They are stand-alone. They don't need nor update an LZ4_streamDecode_t structure. +*/ +int LZ4_decompress_safe_usingDict (const char* source, char* dest, int compressedSize, int maxDecompressedSize, const char* dictStart, int dictSize); +int LZ4_decompress_fast_usingDict (const char* source, char* dest, int originalSize, const char* dictStart, int dictSize); + + + +/************************************** +* Obsolete Functions +**************************************/ +/* Deprecate Warnings */ +/* Should these warnings messages be a problem, + it is generally possible to disable them, + with -Wno-deprecated-declarations for gcc + or _CRT_SECURE_NO_WARNINGS in Visual for example. + You can also define LZ4_DEPRECATE_WARNING_DEFBLOCK. */ +#ifndef LZ4_DEPRECATE_WARNING_DEFBLOCK +# define LZ4_DEPRECATE_WARNING_DEFBLOCK +# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +# if (LZ4_GCC_VERSION >= 405) || defined(__clang__) +# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) +# elif (LZ4_GCC_VERSION >= 301) +# define LZ4_DEPRECATED(message) __attribute__((deprecated)) +# elif defined(_MSC_VER) +# define LZ4_DEPRECATED(message) __declspec(deprecated(message)) +# else +# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") +# define LZ4_DEPRECATED(message) +# endif +#endif /* LZ4_DEPRECATE_WARNING_DEFBLOCK */ + +/* Obsolete compression functions */ +/* These functions are planned to start generate warnings by r131 approximately */ +int LZ4_compress (const char* source, char* dest, int sourceSize); +int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize); +int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); +int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); +int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize); +int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize); + +/* Obsolete decompression functions */ +/* These function names are completely deprecated and must no longer be used. + They are only provided here for compatibility with older programs. + - LZ4_uncompress is the same as LZ4_decompress_fast + - LZ4_uncompress_unknownOutputSize is the same as LZ4_decompress_safe + These function prototypes are now disabled; uncomment them only if you really need them. + It is highly recommended to stop using these prototypes and migrate to maintained ones */ +/* int LZ4_uncompress (const char* source, char* dest, int outputSize); */ +/* int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); */ + +/* Obsolete streaming functions; use new streaming interface whenever possible */ +LZ4_DEPRECATED("use LZ4_createStream() instead") void* LZ4_create (char* inputBuffer); +LZ4_DEPRECATED("use LZ4_createStream() instead") int LZ4_sizeofStreamState(void); +LZ4_DEPRECATED("use LZ4_resetStream() instead") int LZ4_resetStreamState(void* state, char* inputBuffer); +LZ4_DEPRECATED("use LZ4_saveDict() instead") char* LZ4_slideInputBuffer (void* state); + +/* Obsolete streaming decoding functions */ +LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize); +LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize); + + +#if defined (__cplusplus) +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4frame.c b/thirdparty/Lz4/Lz4_131/lib/lz4frame.c new file mode 100644 index 0000000..e5458bb --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4frame.c @@ -0,0 +1,1479 @@ +/* +LZ4 auto-framing library +Copyright (C) 2011-2015, Yann Collet. + +BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +You can contact the author at : +- LZ4 source repository : https://github.com/Cyan4973/lz4 +- LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/* LZ4F is a stand-alone API to create LZ4-compressed Frames +* in full conformance with specification v1.5.0 +* All related operations, including memory management, are handled by the library. +* */ + + +/************************************** +* Compiler Options +**************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +#endif + + +/************************************** +* Memory routines +**************************************/ +#include /* malloc, calloc, free */ +#define ALLOCATOR(s) calloc(1,s) +#define FREEMEM free +#include /* memset, memcpy, memmove */ +#define MEM_INIT memset + + +/************************************** +* Includes +**************************************/ +#include "lz4frame_static.h" +#include "lz4.h" +#include "lz4hc.h" +#include "xxhash.h" + + +/************************************** +* Basic Types +**************************************/ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include +typedef uint8_t BYTE; +typedef uint16_t U16; +typedef uint32_t U32; +typedef int32_t S32; +typedef uint64_t U64; +#else +typedef unsigned char BYTE; +typedef unsigned short U16; +typedef unsigned int U32; +typedef signed int S32; +typedef unsigned long long U64; +#endif + + +/************************************** +* Constants +**************************************/ +#define KB *(1<<10) +#define MB *(1<<20) +#define GB *(1<<30) + +#define _1BIT 0x01 +#define _2BITS 0x03 +#define _3BITS 0x07 +#define _4BITS 0x0F +#define _8BITS 0xFF + +#define LZ4F_MAGIC_SKIPPABLE_START 0x184D2A50U +#define LZ4F_MAGICNUMBER 0x184D2204U +#define LZ4F_BLOCKUNCOMPRESSED_FLAG 0x80000000U +#define LZ4F_BLOCKSIZEID_DEFAULT LZ4F_max64KB + +static const size_t minFHSize = 7; +static const size_t maxFHSize = 15; +static const size_t BHSize = 4; +static const int minHClevel = 3; + + +/************************************** +* Structures and local types +**************************************/ +typedef struct LZ4F_cctx_s +{ + LZ4F_preferences_t prefs; + U32 version; + U32 cStage; + size_t maxBlockSize; + size_t maxBufferSize; + BYTE* tmpBuff; + BYTE* tmpIn; + size_t tmpInSize; + U64 totalInSize; + XXH32_state_t xxh; + void* lz4CtxPtr; + U32 lz4CtxLevel; /* 0: unallocated; 1: LZ4_stream_t; 3: LZ4_streamHC_t */ +} LZ4F_cctx_t; + +typedef struct LZ4F_dctx_s +{ + LZ4F_frameInfo_t frameInfo; + U32 version; + U32 dStage; + U64 frameRemainingSize; + size_t maxBlockSize; + size_t maxBufferSize; + const BYTE* srcExpect; + BYTE* tmpIn; + size_t tmpInSize; + size_t tmpInTarget; + BYTE* tmpOutBuffer; + const BYTE* dict; + size_t dictSize; + BYTE* tmpOut; + size_t tmpOutSize; + size_t tmpOutStart; + XXH32_state_t xxh; + BYTE header[16]; +} LZ4F_dctx_t; + + +/************************************** +* Error management +**************************************/ +#define LZ4F_GENERATE_STRING(STRING) #STRING, +static const char* LZ4F_errorStrings[] = { LZ4F_LIST_ERRORS(LZ4F_GENERATE_STRING) }; + + +unsigned LZ4F_isError(LZ4F_errorCode_t code) +{ + return (code > (LZ4F_errorCode_t)(-LZ4F_ERROR_maxCode)); +} + +const char* LZ4F_getErrorName(LZ4F_errorCode_t code) +{ + static const char* codeError = "Unspecified error code"; + if (LZ4F_isError(code)) return LZ4F_errorStrings[-(int)(code)]; + return codeError; +} + + +/************************************** +* Private functions +**************************************/ +static size_t LZ4F_getBlockSize(unsigned blockSizeID) +{ + static const size_t blockSizes[4] = { 64 KB, 256 KB, 1 MB, 4 MB }; + + if (blockSizeID == 0) blockSizeID = LZ4F_BLOCKSIZEID_DEFAULT; + blockSizeID -= 4; + if (blockSizeID > 3) return (size_t)-LZ4F_ERROR_maxBlockSize_invalid; + return blockSizes[blockSizeID]; +} + + +/* unoptimized version; solves endianess & alignment issues */ +static U32 LZ4F_readLE32 (const BYTE* srcPtr) +{ + U32 value32 = srcPtr[0]; + value32 += (srcPtr[1]<<8); + value32 += (srcPtr[2]<<16); + value32 += ((U32)srcPtr[3])<<24; + return value32; +} + +static void LZ4F_writeLE32 (BYTE* dstPtr, U32 value32) +{ + dstPtr[0] = (BYTE)value32; + dstPtr[1] = (BYTE)(value32 >> 8); + dstPtr[2] = (BYTE)(value32 >> 16); + dstPtr[3] = (BYTE)(value32 >> 24); +} + +static U64 LZ4F_readLE64 (const BYTE* srcPtr) +{ + U64 value64 = srcPtr[0]; + value64 += ((U64)srcPtr[1]<<8); + value64 += ((U64)srcPtr[2]<<16); + value64 += ((U64)srcPtr[3]<<24); + value64 += ((U64)srcPtr[4]<<32); + value64 += ((U64)srcPtr[5]<<40); + value64 += ((U64)srcPtr[6]<<48); + value64 += ((U64)srcPtr[7]<<56); + return value64; +} + +static void LZ4F_writeLE64 (BYTE* dstPtr, U64 value64) +{ + dstPtr[0] = (BYTE)value64; + dstPtr[1] = (BYTE)(value64 >> 8); + dstPtr[2] = (BYTE)(value64 >> 16); + dstPtr[3] = (BYTE)(value64 >> 24); + dstPtr[4] = (BYTE)(value64 >> 32); + dstPtr[5] = (BYTE)(value64 >> 40); + dstPtr[6] = (BYTE)(value64 >> 48); + dstPtr[7] = (BYTE)(value64 >> 56); +} + + +static BYTE LZ4F_headerChecksum (const void* header, size_t length) +{ + U32 xxh = XXH32(header, length, 0); + return (BYTE)(xxh >> 8); +} + + +/************************************** +* Simple compression functions +**************************************/ +static LZ4F_blockSizeID_t LZ4F_optimalBSID(const LZ4F_blockSizeID_t requestedBSID, const size_t srcSize) +{ + LZ4F_blockSizeID_t proposedBSID = LZ4F_max64KB; + size_t maxBlockSize = 64 KB; + while (requestedBSID > proposedBSID) + { + if (srcSize <= maxBlockSize) + return proposedBSID; + proposedBSID = (LZ4F_blockSizeID_t)((int)proposedBSID + 1); + maxBlockSize <<= 2; + } + return requestedBSID; +} + + +size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr) +{ + LZ4F_preferences_t prefs; + size_t headerSize; + size_t streamSize; + + if (preferencesPtr!=NULL) prefs = *preferencesPtr; + else memset(&prefs, 0, sizeof(prefs)); + + prefs.frameInfo.blockSizeID = LZ4F_optimalBSID(prefs.frameInfo.blockSizeID, srcSize); + prefs.autoFlush = 1; + + headerSize = maxFHSize; /* header size, including magic number and frame content size*/ + streamSize = LZ4F_compressBound(srcSize, &prefs); + + return headerSize + streamSize; +} + + +/* LZ4F_compressFrame() +* Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.5.0, in a single step. +* The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case. +* You can get the minimum value of dstMaxSize by using LZ4F_compressFrameBound() +* If this condition is not respected, LZ4F_compressFrame() will fail (result is an errorCode) +* The LZ4F_preferences_t structure is optional : you can provide NULL as argument. All preferences will then be set to default. +* The result of the function is the number of bytes written into dstBuffer. +* The function outputs an error code if it fails (can be tested using LZ4F_isError()) +*/ +size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr) +{ + LZ4F_cctx_t cctxI; + LZ4_stream_t lz4ctx; + LZ4F_preferences_t prefs; + LZ4F_compressOptions_t options; + LZ4F_errorCode_t errorCode; + BYTE* const dstStart = (BYTE*) dstBuffer; + BYTE* dstPtr = dstStart; + BYTE* const dstEnd = dstStart + dstMaxSize; + + memset(&cctxI, 0, sizeof(cctxI)); /* works because no allocation */ + memset(&options, 0, sizeof(options)); + + cctxI.version = LZ4F_VERSION; + cctxI.maxBufferSize = 5 MB; /* mess with real buffer size to prevent allocation; works because autoflush==1 & stableSrc==1 */ + + if (preferencesPtr!=NULL) + prefs = *preferencesPtr; + else + memset(&prefs, 0, sizeof(prefs)); + if (prefs.frameInfo.contentSize != 0) + prefs.frameInfo.contentSize = (U64)srcSize; /* auto-correct content size if selected (!=0) */ + + if (prefs.compressionLevel < (int)minHClevel) + { + cctxI.lz4CtxPtr = &lz4ctx; + cctxI.lz4CtxLevel = 1; + } + + prefs.frameInfo.blockSizeID = LZ4F_optimalBSID(prefs.frameInfo.blockSizeID, srcSize); + prefs.autoFlush = 1; + if (srcSize <= LZ4F_getBlockSize(prefs.frameInfo.blockSizeID)) + prefs.frameInfo.blockMode = LZ4F_blockIndependent; /* no need for linked blocks */ + + options.stableSrc = 1; + + if (dstMaxSize < LZ4F_compressFrameBound(srcSize, &prefs)) + return (size_t)-LZ4F_ERROR_dstMaxSize_tooSmall; + + errorCode = LZ4F_compressBegin(&cctxI, dstBuffer, dstMaxSize, &prefs); /* write header */ + if (LZ4F_isError(errorCode)) return errorCode; + dstPtr += errorCode; /* header size */ + + errorCode = LZ4F_compressUpdate(&cctxI, dstPtr, dstEnd-dstPtr, srcBuffer, srcSize, &options); + if (LZ4F_isError(errorCode)) return errorCode; + dstPtr += errorCode; + + errorCode = LZ4F_compressEnd(&cctxI, dstPtr, dstEnd-dstPtr, &options); /* flush last block, and generate suffix */ + if (LZ4F_isError(errorCode)) return errorCode; + dstPtr += errorCode; + + if (prefs.compressionLevel >= (int)minHClevel) /* no allocation necessary with lz4 fast */ + FREEMEM(cctxI.lz4CtxPtr); + + return (dstPtr - dstStart); +} + + +/*********************************** +* Advanced compression functions +***********************************/ + +/* LZ4F_createCompressionContext() : +* The first thing to do is to create a compressionContext object, which will be used in all compression operations. +* This is achieved using LZ4F_createCompressionContext(), which takes as argument a version and an LZ4F_preferences_t structure. +* The version provided MUST be LZ4F_VERSION. It is intended to track potential version differences between different binaries. +* The function will provide a pointer to an allocated LZ4F_compressionContext_t object. +* If the result LZ4F_errorCode_t is not OK_NoError, there was an error during context creation. +* Object can release its memory using LZ4F_freeCompressionContext(); +*/ +LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_compressionContext_t* LZ4F_compressionContextPtr, unsigned version) +{ + LZ4F_cctx_t* cctxPtr; + + cctxPtr = (LZ4F_cctx_t*)ALLOCATOR(sizeof(LZ4F_cctx_t)); + if (cctxPtr==NULL) return (LZ4F_errorCode_t)(-LZ4F_ERROR_allocation_failed); + + cctxPtr->version = version; + cctxPtr->cStage = 0; /* Next stage : write header */ + + *LZ4F_compressionContextPtr = (LZ4F_compressionContext_t)cctxPtr; + + return LZ4F_OK_NoError; +} + + +LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_compressionContext_t LZ4F_compressionContext) +{ + LZ4F_cctx_t* cctxPtr = (LZ4F_cctx_t*)LZ4F_compressionContext; + + if (cctxPtr != NULL) /* null pointers can be safely provided to this function, like free() */ + { + FREEMEM(cctxPtr->lz4CtxPtr); + FREEMEM(cctxPtr->tmpBuff); + FREEMEM(LZ4F_compressionContext); + } + + return LZ4F_OK_NoError; +} + + +/* LZ4F_compressBegin() : +* will write the frame header into dstBuffer. +* dstBuffer must be large enough to accommodate a header (dstMaxSize). Maximum header size is LZ4F_MAXHEADERFRAME_SIZE bytes. +* The result of the function is the number of bytes written into dstBuffer for the header +* or an error code (can be tested using LZ4F_isError()) +*/ +size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const LZ4F_preferences_t* preferencesPtr) +{ + LZ4F_preferences_t prefNull; + LZ4F_cctx_t* cctxPtr = (LZ4F_cctx_t*)compressionContext; + BYTE* const dstStart = (BYTE*)dstBuffer; + BYTE* dstPtr = dstStart; + BYTE* headerStart; + size_t requiredBuffSize; + + if (dstMaxSize < maxFHSize) return (size_t)-LZ4F_ERROR_dstMaxSize_tooSmall; + if (cctxPtr->cStage != 0) return (size_t)-LZ4F_ERROR_GENERIC; + memset(&prefNull, 0, sizeof(prefNull)); + if (preferencesPtr == NULL) preferencesPtr = &prefNull; + cctxPtr->prefs = *preferencesPtr; + + /* ctx Management */ + { + U32 tableID = (cctxPtr->prefs.compressionLevel < minHClevel) ? 1 : 2; /* 0:nothing ; 1:LZ4 table ; 2:HC tables */ + if (cctxPtr->lz4CtxLevel < tableID) + { + FREEMEM(cctxPtr->lz4CtxPtr); + if (cctxPtr->prefs.compressionLevel < minHClevel) + cctxPtr->lz4CtxPtr = (void*)LZ4_createStream(); + else + cctxPtr->lz4CtxPtr = (void*)LZ4_createStreamHC(); + cctxPtr->lz4CtxLevel = tableID; + } + } + + /* Buffer Management */ + if (cctxPtr->prefs.frameInfo.blockSizeID == 0) cctxPtr->prefs.frameInfo.blockSizeID = LZ4F_BLOCKSIZEID_DEFAULT; + cctxPtr->maxBlockSize = LZ4F_getBlockSize(cctxPtr->prefs.frameInfo.blockSizeID); + + requiredBuffSize = cctxPtr->maxBlockSize + ((cctxPtr->prefs.frameInfo.blockMode == LZ4F_blockLinked) * 128 KB); + if (preferencesPtr->autoFlush) + requiredBuffSize = (cctxPtr->prefs.frameInfo.blockMode == LZ4F_blockLinked) * 64 KB; /* just needs dict */ + + if (cctxPtr->maxBufferSize < requiredBuffSize) + { + cctxPtr->maxBufferSize = requiredBuffSize; + FREEMEM(cctxPtr->tmpBuff); + cctxPtr->tmpBuff = (BYTE*)ALLOCATOR(requiredBuffSize); + if (cctxPtr->tmpBuff == NULL) return (size_t)-LZ4F_ERROR_allocation_failed; + } + cctxPtr->tmpIn = cctxPtr->tmpBuff; + cctxPtr->tmpInSize = 0; + XXH32_reset(&(cctxPtr->xxh), 0); + if (cctxPtr->prefs.compressionLevel < minHClevel) + LZ4_resetStream((LZ4_stream_t*)(cctxPtr->lz4CtxPtr)); + else + LZ4_resetStreamHC((LZ4_streamHC_t*)(cctxPtr->lz4CtxPtr), cctxPtr->prefs.compressionLevel); + + /* Magic Number */ + LZ4F_writeLE32(dstPtr, LZ4F_MAGICNUMBER); + dstPtr += 4; + headerStart = dstPtr; + + /* FLG Byte */ + *dstPtr++ = (BYTE)(((1 & _2BITS) << 6) /* Version('01') */ + + ((cctxPtr->prefs.frameInfo.blockMode & _1BIT ) << 5) /* Block mode */ + + ((cctxPtr->prefs.frameInfo.contentChecksumFlag & _1BIT ) << 2) /* Frame checksum */ + + ((cctxPtr->prefs.frameInfo.contentSize > 0) << 3)); /* Frame content size */ + /* BD Byte */ + *dstPtr++ = (BYTE)((cctxPtr->prefs.frameInfo.blockSizeID & _3BITS) << 4); + /* Optional Frame content size field */ + if (cctxPtr->prefs.frameInfo.contentSize) + { + LZ4F_writeLE64(dstPtr, cctxPtr->prefs.frameInfo.contentSize); + dstPtr += 8; + cctxPtr->totalInSize = 0; + } + /* CRC Byte */ + *dstPtr = LZ4F_headerChecksum(headerStart, dstPtr - headerStart); + dstPtr++; + + cctxPtr->cStage = 1; /* header written, now request input data block */ + + return (dstPtr - dstStart); +} + + +/* LZ4F_compressBound() : gives the size of Dst buffer given a srcSize to handle worst case situations. +* The LZ4F_frameInfo_t structure is optional : +* you can provide NULL as argument, preferences will then be set to cover worst case situations. +* */ +size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr) +{ + LZ4F_preferences_t prefsNull; + memset(&prefsNull, 0, sizeof(prefsNull)); + prefsNull.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; /* worst case */ + { + const LZ4F_preferences_t* prefsPtr = (preferencesPtr==NULL) ? &prefsNull : preferencesPtr; + LZ4F_blockSizeID_t bid = prefsPtr->frameInfo.blockSizeID; + size_t blockSize = LZ4F_getBlockSize(bid); + unsigned nbBlocks = (unsigned)(srcSize / blockSize) + 1; + size_t lastBlockSize = prefsPtr->autoFlush ? srcSize % blockSize : blockSize; + size_t blockInfo = 4; /* default, without block CRC option */ + size_t frameEnd = 4 + (prefsPtr->frameInfo.contentChecksumFlag*4); + + return (blockInfo * nbBlocks) + (blockSize * (nbBlocks-1)) + lastBlockSize + frameEnd;; + } +} + + +typedef int (*compressFunc_t)(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level); + +static size_t LZ4F_compressBlock(void* dst, const void* src, size_t srcSize, compressFunc_t compress, void* lz4ctx, int level) +{ + /* compress one block */ + BYTE* cSizePtr = (BYTE*)dst; + U32 cSize; + cSize = (U32)compress(lz4ctx, (const char*)src, (char*)(cSizePtr+4), (int)(srcSize), (int)(srcSize-1), level); + LZ4F_writeLE32(cSizePtr, cSize); + if (cSize == 0) /* compression failed */ + { + cSize = (U32)srcSize; + LZ4F_writeLE32(cSizePtr, cSize + LZ4F_BLOCKUNCOMPRESSED_FLAG); + memcpy(cSizePtr+4, src, srcSize); + } + return cSize + 4; +} + + +static int LZ4F_localLZ4_compress_limitedOutput_withState(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level) +{ + (void) level; + return LZ4_compress_limitedOutput_withState(ctx, src, dst, srcSize, dstSize); +} + +static int LZ4F_localLZ4_compress_limitedOutput_continue(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level) +{ + (void) level; + return LZ4_compress_limitedOutput_continue((LZ4_stream_t*)ctx, src, dst, srcSize, dstSize); +} + +static int LZ4F_localLZ4_compressHC_limitedOutput_continue(void* ctx, const char* src, char* dst, int srcSize, int dstSize, int level) +{ + (void) level; + return LZ4_compress_HC_continue((LZ4_streamHC_t*)ctx, src, dst, srcSize, dstSize); +} + +static compressFunc_t LZ4F_selectCompression(LZ4F_blockMode_t blockMode, int level) +{ + if (level < minHClevel) + { + if (blockMode == LZ4F_blockIndependent) return LZ4F_localLZ4_compress_limitedOutput_withState; + return LZ4F_localLZ4_compress_limitedOutput_continue; + } + if (blockMode == LZ4F_blockIndependent) return LZ4_compress_HC_extStateHC; + return LZ4F_localLZ4_compressHC_limitedOutput_continue; +} + +static int LZ4F_localSaveDict(LZ4F_cctx_t* cctxPtr) +{ + if (cctxPtr->prefs.compressionLevel < minHClevel) + return LZ4_saveDict ((LZ4_stream_t*)(cctxPtr->lz4CtxPtr), (char*)(cctxPtr->tmpBuff), 64 KB); + return LZ4_saveDictHC ((LZ4_streamHC_t*)(cctxPtr->lz4CtxPtr), (char*)(cctxPtr->tmpBuff), 64 KB); +} + +typedef enum { notDone, fromTmpBuffer, fromSrcBuffer } LZ4F_lastBlockStatus; + +/* LZ4F_compressUpdate() +* LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary. +* The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case. +* If this condition is not respected, LZ4F_compress() will fail (result is an errorCode) +* You can get the minimum value of dstMaxSize by using LZ4F_compressBound() +* The LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. +* The result of the function is the number of bytes written into dstBuffer : it can be zero, meaning input data was just buffered. +* The function outputs an error code if it fails (can be tested using LZ4F_isError()) +*/ +size_t LZ4F_compressUpdate(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_compressOptions_t* compressOptionsPtr) +{ + LZ4F_compressOptions_t cOptionsNull; + LZ4F_cctx_t* cctxPtr = (LZ4F_cctx_t*)compressionContext; + size_t blockSize = cctxPtr->maxBlockSize; + const BYTE* srcPtr = (const BYTE*)srcBuffer; + const BYTE* const srcEnd = srcPtr + srcSize; + BYTE* const dstStart = (BYTE*)dstBuffer; + BYTE* dstPtr = dstStart; + LZ4F_lastBlockStatus lastBlockCompressed = notDone; + compressFunc_t compress; + + + if (cctxPtr->cStage != 1) return (size_t)-LZ4F_ERROR_GENERIC; + if (dstMaxSize < LZ4F_compressBound(srcSize, &(cctxPtr->prefs))) return (size_t)-LZ4F_ERROR_dstMaxSize_tooSmall; + memset(&cOptionsNull, 0, sizeof(cOptionsNull)); + if (compressOptionsPtr == NULL) compressOptionsPtr = &cOptionsNull; + + /* select compression function */ + compress = LZ4F_selectCompression(cctxPtr->prefs.frameInfo.blockMode, cctxPtr->prefs.compressionLevel); + + /* complete tmp buffer */ + if (cctxPtr->tmpInSize > 0) /* some data already within tmp buffer */ + { + size_t sizeToCopy = blockSize - cctxPtr->tmpInSize; + if (sizeToCopy > srcSize) + { + /* add src to tmpIn buffer */ + memcpy(cctxPtr->tmpIn + cctxPtr->tmpInSize, srcBuffer, srcSize); + srcPtr = srcEnd; + cctxPtr->tmpInSize += srcSize; + /* still needs some CRC */ + } + else + { + /* complete tmpIn block and then compress it */ + lastBlockCompressed = fromTmpBuffer; + memcpy(cctxPtr->tmpIn + cctxPtr->tmpInSize, srcBuffer, sizeToCopy); + srcPtr += sizeToCopy; + + dstPtr += LZ4F_compressBlock(dstPtr, cctxPtr->tmpIn, blockSize, compress, cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); + + if (cctxPtr->prefs.frameInfo.blockMode==LZ4F_blockLinked) cctxPtr->tmpIn += blockSize; + cctxPtr->tmpInSize = 0; + } + } + + while ((size_t)(srcEnd - srcPtr) >= blockSize) + { + /* compress full block */ + lastBlockCompressed = fromSrcBuffer; + dstPtr += LZ4F_compressBlock(dstPtr, srcPtr, blockSize, compress, cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); + srcPtr += blockSize; + } + + if ((cctxPtr->prefs.autoFlush) && (srcPtr < srcEnd)) + { + /* compress remaining input < blockSize */ + lastBlockCompressed = fromSrcBuffer; + dstPtr += LZ4F_compressBlock(dstPtr, srcPtr, srcEnd - srcPtr, compress, cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); + srcPtr = srcEnd; + } + + /* preserve dictionary if necessary */ + if ((cctxPtr->prefs.frameInfo.blockMode==LZ4F_blockLinked) && (lastBlockCompressed==fromSrcBuffer)) + { + if (compressOptionsPtr->stableSrc) + { + cctxPtr->tmpIn = cctxPtr->tmpBuff; + } + else + { + int realDictSize = LZ4F_localSaveDict(cctxPtr); + if (realDictSize==0) return (size_t)-LZ4F_ERROR_GENERIC; + cctxPtr->tmpIn = cctxPtr->tmpBuff + realDictSize; + } + } + + /* keep tmpIn within limits */ + if ((cctxPtr->tmpIn + blockSize) > (cctxPtr->tmpBuff + cctxPtr->maxBufferSize) /* necessarily LZ4F_blockLinked && lastBlockCompressed==fromTmpBuffer */ + && !(cctxPtr->prefs.autoFlush)) + { + int realDictSize = LZ4F_localSaveDict(cctxPtr); + cctxPtr->tmpIn = cctxPtr->tmpBuff + realDictSize; + } + + /* some input data left, necessarily < blockSize */ + if (srcPtr < srcEnd) + { + /* fill tmp buffer */ + size_t sizeToCopy = srcEnd - srcPtr; + memcpy(cctxPtr->tmpIn, srcPtr, sizeToCopy); + cctxPtr->tmpInSize = sizeToCopy; + } + + if (cctxPtr->prefs.frameInfo.contentChecksumFlag == LZ4F_contentChecksumEnabled) + XXH32_update(&(cctxPtr->xxh), srcBuffer, srcSize); + + cctxPtr->totalInSize += srcSize; + return dstPtr - dstStart; +} + + +/* LZ4F_flush() +* Should you need to create compressed data immediately, without waiting for a block to be filled, +* you can call LZ4_flush(), which will immediately compress any remaining data stored within compressionContext. +* The result of the function is the number of bytes written into dstBuffer +* (it can be zero, this means there was no data left within compressionContext) +* The function outputs an error code if it fails (can be tested using LZ4F_isError()) +* The LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. +*/ +size_t LZ4F_flush(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* compressOptionsPtr) +{ + LZ4F_cctx_t* cctxPtr = (LZ4F_cctx_t*)compressionContext; + BYTE* const dstStart = (BYTE*)dstBuffer; + BYTE* dstPtr = dstStart; + compressFunc_t compress; + + + if (cctxPtr->tmpInSize == 0) return 0; /* nothing to flush */ + if (cctxPtr->cStage != 1) return (size_t)-LZ4F_ERROR_GENERIC; + if (dstMaxSize < (cctxPtr->tmpInSize + 8)) return (size_t)-LZ4F_ERROR_dstMaxSize_tooSmall; /* +8 : block header(4) + block checksum(4) */ + (void)compressOptionsPtr; /* not yet useful */ + + /* select compression function */ + compress = LZ4F_selectCompression(cctxPtr->prefs.frameInfo.blockMode, cctxPtr->prefs.compressionLevel); + + /* compress tmp buffer */ + dstPtr += LZ4F_compressBlock(dstPtr, cctxPtr->tmpIn, cctxPtr->tmpInSize, compress, cctxPtr->lz4CtxPtr, cctxPtr->prefs.compressionLevel); + if (cctxPtr->prefs.frameInfo.blockMode==LZ4F_blockLinked) cctxPtr->tmpIn += cctxPtr->tmpInSize; + cctxPtr->tmpInSize = 0; + + /* keep tmpIn within limits */ + if ((cctxPtr->tmpIn + cctxPtr->maxBlockSize) > (cctxPtr->tmpBuff + cctxPtr->maxBufferSize)) /* necessarily LZ4F_blockLinked */ + { + int realDictSize = LZ4F_localSaveDict(cctxPtr); + cctxPtr->tmpIn = cctxPtr->tmpBuff + realDictSize; + } + + return dstPtr - dstStart; +} + + +/* LZ4F_compressEnd() +* When you want to properly finish the compressed frame, just call LZ4F_compressEnd(). +* It will flush whatever data remained within compressionContext (like LZ4_flush()) +* but also properly finalize the frame, with an endMark and a checksum. +* The result of the function is the number of bytes written into dstBuffer (necessarily >= 4 (endMark size)) +* The function outputs an error code if it fails (can be tested using LZ4F_isError()) +* The LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. +* compressionContext can then be used again, starting with LZ4F_compressBegin(). The preferences will remain the same. +*/ +size_t LZ4F_compressEnd(LZ4F_compressionContext_t compressionContext, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* compressOptionsPtr) +{ + LZ4F_cctx_t* cctxPtr = (LZ4F_cctx_t*)compressionContext; + BYTE* const dstStart = (BYTE*)dstBuffer; + BYTE* dstPtr = dstStart; + size_t errorCode; + + errorCode = LZ4F_flush(compressionContext, dstBuffer, dstMaxSize, compressOptionsPtr); + if (LZ4F_isError(errorCode)) return errorCode; + dstPtr += errorCode; + + LZ4F_writeLE32(dstPtr, 0); + dstPtr+=4; /* endMark */ + + if (cctxPtr->prefs.frameInfo.contentChecksumFlag == LZ4F_contentChecksumEnabled) + { + U32 xxh = XXH32_digest(&(cctxPtr->xxh)); + LZ4F_writeLE32(dstPtr, xxh); + dstPtr+=4; /* content Checksum */ + } + + cctxPtr->cStage = 0; /* state is now re-usable (with identical preferences) */ + + if (cctxPtr->prefs.frameInfo.contentSize) + { + if (cctxPtr->prefs.frameInfo.contentSize != cctxPtr->totalInSize) + return (size_t)-LZ4F_ERROR_frameSize_wrong; + } + + return dstPtr - dstStart; +} + + +/********************************** +* Decompression functions +**********************************/ + +/* Resource management */ + +/* LZ4F_createDecompressionContext() : +* The first thing to do is to create a decompressionContext object, which will be used in all decompression operations. +* This is achieved using LZ4F_createDecompressionContext(). +* The function will provide a pointer to a fully allocated and initialized LZ4F_decompressionContext object. +* If the result LZ4F_errorCode_t is not zero, there was an error during context creation. +* Object can release its memory using LZ4F_freeDecompressionContext(); +*/ +LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_decompressionContext_t* LZ4F_decompressionContextPtr, unsigned versionNumber) +{ + LZ4F_dctx_t* dctxPtr; + + dctxPtr = (LZ4F_dctx_t*)ALLOCATOR(sizeof(LZ4F_dctx_t)); + if (dctxPtr==NULL) return (LZ4F_errorCode_t)-LZ4F_ERROR_GENERIC; + + dctxPtr->version = versionNumber; + *LZ4F_decompressionContextPtr = (LZ4F_decompressionContext_t)dctxPtr; + return LZ4F_OK_NoError; +} + +LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_decompressionContext_t LZ4F_decompressionContext) +{ + LZ4F_errorCode_t result = LZ4F_OK_NoError; + LZ4F_dctx_t* dctxPtr = (LZ4F_dctx_t*)LZ4F_decompressionContext; + if (dctxPtr != NULL) /* can accept NULL input, like free() */ + { + result = (LZ4F_errorCode_t)dctxPtr->dStage; + FREEMEM(dctxPtr->tmpIn); + FREEMEM(dctxPtr->tmpOutBuffer); + FREEMEM(dctxPtr); + } + return result; +} + + +/* ******************************************************************** */ +/* ********************* Decompression ******************************** */ +/* ******************************************************************** */ + +typedef enum { dstage_getHeader=0, dstage_storeHeader, + dstage_getCBlockSize, dstage_storeCBlockSize, + dstage_copyDirect, + dstage_getCBlock, dstage_storeCBlock, + dstage_decodeCBlock, dstage_decodeCBlock_intoDst, + dstage_decodeCBlock_intoTmp, dstage_flushOut, + dstage_getSuffix, dstage_storeSuffix, + dstage_getSFrameSize, dstage_storeSFrameSize, + dstage_skipSkippable +} dStage_t; + + +/* LZ4F_decodeHeader + return : nb Bytes read from srcVoidPtr (necessarily <= srcSize) + or an error code (testable with LZ4F_isError()) + output : set internal values of dctx, such as + dctxPtr->frameInfo and dctxPtr->dStage. + input : srcVoidPtr points at the **beginning of the frame** +*/ +static size_t LZ4F_decodeHeader(LZ4F_dctx_t* dctxPtr, const void* srcVoidPtr, size_t srcSize) +{ + BYTE FLG, BD, HC; + unsigned version, blockMode, blockChecksumFlag, contentSizeFlag, contentChecksumFlag, blockSizeID; + size_t bufferNeeded; + size_t frameHeaderSize; + const BYTE* srcPtr = (const BYTE*)srcVoidPtr; + + /* need to decode header to get frameInfo */ + if (srcSize < minFHSize) return (size_t)-LZ4F_ERROR_frameHeader_incomplete; /* minimal frame header size */ + memset(&(dctxPtr->frameInfo), 0, sizeof(dctxPtr->frameInfo)); + + /* special case : skippable frames */ + if ((LZ4F_readLE32(srcPtr) & 0xFFFFFFF0U) == LZ4F_MAGIC_SKIPPABLE_START) + { + dctxPtr->frameInfo.frameType = LZ4F_skippableFrame; + if (srcVoidPtr == (void*)(dctxPtr->header)) + { + dctxPtr->tmpInSize = srcSize; + dctxPtr->tmpInTarget = 8; + dctxPtr->dStage = dstage_storeSFrameSize; + return srcSize; + } + else + { + dctxPtr->dStage = dstage_getSFrameSize; + return 4; + } + } + + /* control magic number */ + if (LZ4F_readLE32(srcPtr) != LZ4F_MAGICNUMBER) return (size_t)-LZ4F_ERROR_frameType_unknown; + dctxPtr->frameInfo.frameType = LZ4F_frame; + + /* Flags */ + FLG = srcPtr[4]; + version = (FLG>>6) & _2BITS; + blockMode = (FLG>>5) & _1BIT; + blockChecksumFlag = (FLG>>4) & _1BIT; + contentSizeFlag = (FLG>>3) & _1BIT; + contentChecksumFlag = (FLG>>2) & _1BIT; + + /* Frame Header Size */ + frameHeaderSize = contentSizeFlag ? maxFHSize : minFHSize; + + if (srcSize < frameHeaderSize) + { + /* not enough input to fully decode frame header */ + if (srcPtr != dctxPtr->header) + memcpy(dctxPtr->header, srcPtr, srcSize); + dctxPtr->tmpInSize = srcSize; + dctxPtr->tmpInTarget = frameHeaderSize; + dctxPtr->dStage = dstage_storeHeader; + return srcSize; + } + + BD = srcPtr[5]; + blockSizeID = (BD>>4) & _3BITS; + + /* validate */ + if (version != 1) return (size_t)-LZ4F_ERROR_headerVersion_wrong; /* Version Number, only supported value */ + if (blockChecksumFlag != 0) return (size_t)-LZ4F_ERROR_blockChecksum_unsupported; /* Not supported for the time being */ + if (((FLG>>0)&_2BITS) != 0) return (size_t)-LZ4F_ERROR_reservedFlag_set; /* Reserved bits */ + if (((BD>>7)&_1BIT) != 0) return (size_t)-LZ4F_ERROR_reservedFlag_set; /* Reserved bit */ + if (blockSizeID < 4) return (size_t)-LZ4F_ERROR_maxBlockSize_invalid; /* 4-7 only supported values for the time being */ + if (((BD>>0)&_4BITS) != 0) return (size_t)-LZ4F_ERROR_reservedFlag_set; /* Reserved bits */ + + /* check */ + HC = LZ4F_headerChecksum(srcPtr+4, frameHeaderSize-5); + if (HC != srcPtr[frameHeaderSize-1]) return (size_t)-LZ4F_ERROR_headerChecksum_invalid; /* Bad header checksum error */ + + /* save */ + dctxPtr->frameInfo.blockMode = (LZ4F_blockMode_t)blockMode; + dctxPtr->frameInfo.contentChecksumFlag = (LZ4F_contentChecksum_t)contentChecksumFlag; + dctxPtr->frameInfo.blockSizeID = (LZ4F_blockSizeID_t)blockSizeID; + dctxPtr->maxBlockSize = LZ4F_getBlockSize(blockSizeID); + if (contentSizeFlag) + dctxPtr->frameRemainingSize = dctxPtr->frameInfo.contentSize = LZ4F_readLE64(srcPtr+6); + + /* init */ + if (contentChecksumFlag) XXH32_reset(&(dctxPtr->xxh), 0); + + /* alloc */ + bufferNeeded = dctxPtr->maxBlockSize + ((dctxPtr->frameInfo.blockMode==LZ4F_blockLinked) * 128 KB); + if (bufferNeeded > dctxPtr->maxBufferSize) /* tmp buffers too small */ + { + FREEMEM(dctxPtr->tmpIn); + FREEMEM(dctxPtr->tmpOutBuffer); + dctxPtr->maxBufferSize = bufferNeeded; + dctxPtr->tmpIn = (BYTE*)ALLOCATOR(dctxPtr->maxBlockSize); + if (dctxPtr->tmpIn == NULL) return (size_t)-LZ4F_ERROR_GENERIC; + dctxPtr->tmpOutBuffer= (BYTE*)ALLOCATOR(dctxPtr->maxBufferSize); + if (dctxPtr->tmpOutBuffer== NULL) return (size_t)-LZ4F_ERROR_GENERIC; + } + dctxPtr->tmpInSize = 0; + dctxPtr->tmpInTarget = 0; + dctxPtr->dict = dctxPtr->tmpOutBuffer; + dctxPtr->dictSize = 0; + dctxPtr->tmpOut = dctxPtr->tmpOutBuffer; + dctxPtr->tmpOutStart = 0; + dctxPtr->tmpOutSize = 0; + + dctxPtr->dStage = dstage_getCBlockSize; + + return frameHeaderSize; +} + + +/* LZ4F_getFrameInfo() +* This function decodes frame header information, such as blockSize. +* It is optional : you could start by calling directly LZ4F_decompress() instead. +* The objective is to extract header information without starting decompression, typically for allocation purposes. +* LZ4F_getFrameInfo() can also be used *after* starting decompression, on a valid LZ4F_decompressionContext_t. +* The number of bytes read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value). +* You are expected to resume decompression from where it stopped (srcBuffer + *srcSizePtr) +* The function result is an hint of the better srcSize to use for next call to LZ4F_decompress, +* or an error code which can be tested using LZ4F_isError(). +*/ +LZ4F_errorCode_t LZ4F_getFrameInfo(LZ4F_decompressionContext_t dCtx, LZ4F_frameInfo_t* frameInfoPtr, + const void* srcBuffer, size_t* srcSizePtr) +{ + LZ4F_dctx_t* dctxPtr = (LZ4F_dctx_t*)dCtx; + + if (dctxPtr->dStage > dstage_storeHeader) /* note : requires dstage_* header related to be at beginning of enum */ + { + size_t o=0, i=0; + /* frameInfo already decoded */ + *srcSizePtr = 0; + *frameInfoPtr = dctxPtr->frameInfo; + return LZ4F_decompress(dCtx, NULL, &o, NULL, &i, NULL); + } + else + { + size_t o=0; + size_t nextSrcSize = LZ4F_decompress(dCtx, NULL, &o, srcBuffer, srcSizePtr, NULL); + if (dctxPtr->dStage <= dstage_storeHeader) /* note : requires dstage_* header related to be at beginning of enum */ + return (size_t)-LZ4F_ERROR_frameHeader_incomplete; + *frameInfoPtr = dctxPtr->frameInfo; + return nextSrcSize; + } +} + + +/* trivial redirector, for common prototype */ +static int LZ4F_decompress_safe (const char* source, char* dest, int compressedSize, int maxDecompressedSize, const char* dictStart, int dictSize) +{ + (void)dictStart; (void)dictSize; + return LZ4_decompress_safe (source, dest, compressedSize, maxDecompressedSize); +} + + +static void LZ4F_updateDict(LZ4F_dctx_t* dctxPtr, const BYTE* dstPtr, size_t dstSize, const BYTE* dstPtr0, unsigned withinTmp) +{ + if (dctxPtr->dictSize==0) + dctxPtr->dict = (const BYTE*)dstPtr; /* priority to dictionary continuity */ + + if (dctxPtr->dict + dctxPtr->dictSize == dstPtr) /* dictionary continuity */ + { + dctxPtr->dictSize += dstSize; + return; + } + + if (dstPtr - dstPtr0 + dstSize >= 64 KB) /* dstBuffer large enough to become dictionary */ + { + dctxPtr->dict = (const BYTE*)dstPtr0; + dctxPtr->dictSize = dstPtr - dstPtr0 + dstSize; + return; + } + + if ((withinTmp) && (dctxPtr->dict == dctxPtr->tmpOutBuffer)) + { + /* assumption : dctxPtr->dict + dctxPtr->dictSize == dctxPtr->tmpOut + dctxPtr->tmpOutStart */ + dctxPtr->dictSize += dstSize; + return; + } + + if (withinTmp) /* copy relevant dict portion in front of tmpOut within tmpOutBuffer */ + { + size_t preserveSize = dctxPtr->tmpOut - dctxPtr->tmpOutBuffer; + size_t copySize = 64 KB - dctxPtr->tmpOutSize; + const BYTE* oldDictEnd = dctxPtr->dict + dctxPtr->dictSize - dctxPtr->tmpOutStart; + if (dctxPtr->tmpOutSize > 64 KB) copySize = 0; + if (copySize > preserveSize) copySize = preserveSize; + + memcpy(dctxPtr->tmpOutBuffer + preserveSize - copySize, oldDictEnd - copySize, copySize); + + dctxPtr->dict = dctxPtr->tmpOutBuffer; + dctxPtr->dictSize = preserveSize + dctxPtr->tmpOutStart + dstSize; + return; + } + + if (dctxPtr->dict == dctxPtr->tmpOutBuffer) /* copy dst into tmp to complete dict */ + { + if (dctxPtr->dictSize + dstSize > dctxPtr->maxBufferSize) /* tmp buffer not large enough */ + { + size_t preserveSize = 64 KB - dstSize; /* note : dstSize < 64 KB */ + memcpy(dctxPtr->tmpOutBuffer, dctxPtr->dict + dctxPtr->dictSize - preserveSize, preserveSize); + dctxPtr->dictSize = preserveSize; + } + memcpy(dctxPtr->tmpOutBuffer + dctxPtr->dictSize, dstPtr, dstSize); + dctxPtr->dictSize += dstSize; + return; + } + + /* join dict & dest into tmp */ + { + size_t preserveSize = 64 KB - dstSize; /* note : dstSize < 64 KB */ + if (preserveSize > dctxPtr->dictSize) preserveSize = dctxPtr->dictSize; + memcpy(dctxPtr->tmpOutBuffer, dctxPtr->dict + dctxPtr->dictSize - preserveSize, preserveSize); + memcpy(dctxPtr->tmpOutBuffer + preserveSize, dstPtr, dstSize); + dctxPtr->dict = dctxPtr->tmpOutBuffer; + dctxPtr->dictSize = preserveSize + dstSize; + } +} + + + +/* LZ4F_decompress() +* Call this function repetitively to regenerate data compressed within srcBuffer. +* The function will attempt to decode *srcSizePtr from srcBuffer, into dstBuffer of maximum size *dstSizePtr. +* +* The number of bytes regenerated into dstBuffer will be provided within *dstSizePtr (necessarily <= original value). +* +* The number of bytes effectively read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value). +* If the number of bytes read is < number of bytes provided, then the decompression operation is not complete. +* You will have to call it again, continuing from where it stopped. +* +* The function result is an hint of the better srcSize to use for next call to LZ4F_decompress. +* Basically, it's the size of the current (or remaining) compressed block + header of next block. +* Respecting the hint provides some boost to performance, since it allows less buffer shuffling. +* Note that this is just a hint, you can always provide any srcSize you want. +* When a frame is fully decoded, the function result will be 0. +* If decompression failed, function result is an error code which can be tested using LZ4F_isError(). +*/ +size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext, + void* dstBuffer, size_t* dstSizePtr, + const void* srcBuffer, size_t* srcSizePtr, + const LZ4F_decompressOptions_t* decompressOptionsPtr) +{ + LZ4F_dctx_t* dctxPtr = (LZ4F_dctx_t*)decompressionContext; + LZ4F_decompressOptions_t optionsNull; + const BYTE* const srcStart = (const BYTE*)srcBuffer; + const BYTE* const srcEnd = srcStart + *srcSizePtr; + const BYTE* srcPtr = srcStart; + BYTE* const dstStart = (BYTE*)dstBuffer; + BYTE* const dstEnd = dstStart + *dstSizePtr; + BYTE* dstPtr = dstStart; + const BYTE* selectedIn = NULL; + unsigned doAnotherStage = 1; + size_t nextSrcSizeHint = 1; + + + memset(&optionsNull, 0, sizeof(optionsNull)); + if (decompressOptionsPtr==NULL) decompressOptionsPtr = &optionsNull; + *srcSizePtr = 0; + *dstSizePtr = 0; + + /* expect to continue decoding src buffer where it left previously */ + if (dctxPtr->srcExpect != NULL) + { + if (srcStart != dctxPtr->srcExpect) return (size_t)-LZ4F_ERROR_srcPtr_wrong; + } + + /* programmed as a state machine */ + + while (doAnotherStage) + { + + switch(dctxPtr->dStage) + { + + case dstage_getHeader: + { + if ((size_t)(srcEnd-srcPtr) >= maxFHSize) /* enough to decode - shortcut */ + { + LZ4F_errorCode_t errorCode = LZ4F_decodeHeader(dctxPtr, srcPtr, srcEnd-srcPtr); + if (LZ4F_isError(errorCode)) return errorCode; + srcPtr += errorCode; + break; + } + dctxPtr->tmpInSize = 0; + dctxPtr->tmpInTarget = minFHSize; /* minimum to attempt decode */ + dctxPtr->dStage = dstage_storeHeader; + } + + case dstage_storeHeader: + { + size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; + if (sizeToCopy > (size_t)(srcEnd - srcPtr)) sizeToCopy = srcEnd - srcPtr; + memcpy(dctxPtr->header + dctxPtr->tmpInSize, srcPtr, sizeToCopy); + dctxPtr->tmpInSize += sizeToCopy; + srcPtr += sizeToCopy; + if (dctxPtr->tmpInSize < dctxPtr->tmpInTarget) + { + nextSrcSizeHint = (dctxPtr->tmpInTarget - dctxPtr->tmpInSize) + BHSize; /* rest of header + nextBlockHeader */ + doAnotherStage = 0; /* not enough src data, ask for some more */ + break; + } + { + LZ4F_errorCode_t errorCode = LZ4F_decodeHeader(dctxPtr, dctxPtr->header, dctxPtr->tmpInTarget); + if (LZ4F_isError(errorCode)) return errorCode; + } + break; + } + + case dstage_getCBlockSize: + { + if ((size_t)(srcEnd - srcPtr) >= BHSize) + { + selectedIn = srcPtr; + srcPtr += BHSize; + } + else + { + /* not enough input to read cBlockSize field */ + dctxPtr->tmpInSize = 0; + dctxPtr->dStage = dstage_storeCBlockSize; + } + } + + if (dctxPtr->dStage == dstage_storeCBlockSize) + case dstage_storeCBlockSize: + { + size_t sizeToCopy = BHSize - dctxPtr->tmpInSize; + if (sizeToCopy > (size_t)(srcEnd - srcPtr)) sizeToCopy = srcEnd - srcPtr; + memcpy(dctxPtr->tmpIn + dctxPtr->tmpInSize, srcPtr, sizeToCopy); + srcPtr += sizeToCopy; + dctxPtr->tmpInSize += sizeToCopy; + if (dctxPtr->tmpInSize < BHSize) /* not enough input to get full cBlockSize; wait for more */ + { + nextSrcSizeHint = BHSize - dctxPtr->tmpInSize; + doAnotherStage = 0; + break; + } + selectedIn = dctxPtr->tmpIn; + } + + /* case dstage_decodeCBlockSize: */ /* no more direct access, to prevent scan-build warning */ + { + size_t nextCBlockSize = LZ4F_readLE32(selectedIn) & 0x7FFFFFFFU; + if (nextCBlockSize==0) /* frameEnd signal, no more CBlock */ + { + dctxPtr->dStage = dstage_getSuffix; + break; + } + if (nextCBlockSize > dctxPtr->maxBlockSize) return (size_t)-LZ4F_ERROR_GENERIC; /* invalid cBlockSize */ + dctxPtr->tmpInTarget = nextCBlockSize; + if (LZ4F_readLE32(selectedIn) & LZ4F_BLOCKUNCOMPRESSED_FLAG) + { + dctxPtr->dStage = dstage_copyDirect; + break; + } + dctxPtr->dStage = dstage_getCBlock; + if (dstPtr==dstEnd) + { + nextSrcSizeHint = nextCBlockSize + BHSize; + doAnotherStage = 0; + } + break; + } + + case dstage_copyDirect: /* uncompressed block */ + { + size_t sizeToCopy = dctxPtr->tmpInTarget; + if ((size_t)(srcEnd-srcPtr) < sizeToCopy) sizeToCopy = srcEnd - srcPtr; /* not enough input to read full block */ + if ((size_t)(dstEnd-dstPtr) < sizeToCopy) sizeToCopy = dstEnd - dstPtr; + memcpy(dstPtr, srcPtr, sizeToCopy); + if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), srcPtr, sizeToCopy); + if (dctxPtr->frameInfo.contentSize) dctxPtr->frameRemainingSize -= sizeToCopy; + + /* dictionary management */ + if (dctxPtr->frameInfo.blockMode==LZ4F_blockLinked) + LZ4F_updateDict(dctxPtr, dstPtr, sizeToCopy, dstStart, 0); + + srcPtr += sizeToCopy; + dstPtr += sizeToCopy; + if (sizeToCopy == dctxPtr->tmpInTarget) /* all copied */ + { + dctxPtr->dStage = dstage_getCBlockSize; + break; + } + dctxPtr->tmpInTarget -= sizeToCopy; /* still need to copy more */ + nextSrcSizeHint = dctxPtr->tmpInTarget + BHSize; + doAnotherStage = 0; + break; + } + + case dstage_getCBlock: /* entry from dstage_decodeCBlockSize */ + { + if ((size_t)(srcEnd-srcPtr) < dctxPtr->tmpInTarget) + { + dctxPtr->tmpInSize = 0; + dctxPtr->dStage = dstage_storeCBlock; + break; + } + selectedIn = srcPtr; + srcPtr += dctxPtr->tmpInTarget; + dctxPtr->dStage = dstage_decodeCBlock; + break; + } + + case dstage_storeCBlock: + { + size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; + if (sizeToCopy > (size_t)(srcEnd-srcPtr)) sizeToCopy = srcEnd-srcPtr; + memcpy(dctxPtr->tmpIn + dctxPtr->tmpInSize, srcPtr, sizeToCopy); + dctxPtr->tmpInSize += sizeToCopy; + srcPtr += sizeToCopy; + if (dctxPtr->tmpInSize < dctxPtr->tmpInTarget) /* need more input */ + { + nextSrcSizeHint = (dctxPtr->tmpInTarget - dctxPtr->tmpInSize) + BHSize; + doAnotherStage=0; + break; + } + selectedIn = dctxPtr->tmpIn; + dctxPtr->dStage = dstage_decodeCBlock; + break; + } + + case dstage_decodeCBlock: + { + if ((size_t)(dstEnd-dstPtr) < dctxPtr->maxBlockSize) /* not enough place into dst : decode into tmpOut */ + dctxPtr->dStage = dstage_decodeCBlock_intoTmp; + else + dctxPtr->dStage = dstage_decodeCBlock_intoDst; + break; + } + + case dstage_decodeCBlock_intoDst: + { + int (*decoder)(const char*, char*, int, int, const char*, int); + int decodedSize; + + if (dctxPtr->frameInfo.blockMode == LZ4F_blockLinked) + decoder = LZ4_decompress_safe_usingDict; + else + decoder = LZ4F_decompress_safe; + + decodedSize = decoder((const char*)selectedIn, (char*)dstPtr, (int)dctxPtr->tmpInTarget, (int)dctxPtr->maxBlockSize, (const char*)dctxPtr->dict, (int)dctxPtr->dictSize); + if (decodedSize < 0) return (size_t)-LZ4F_ERROR_GENERIC; /* decompression failed */ + if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), dstPtr, decodedSize); + if (dctxPtr->frameInfo.contentSize) dctxPtr->frameRemainingSize -= decodedSize; + + /* dictionary management */ + if (dctxPtr->frameInfo.blockMode==LZ4F_blockLinked) + LZ4F_updateDict(dctxPtr, dstPtr, decodedSize, dstStart, 0); + + dstPtr += decodedSize; + dctxPtr->dStage = dstage_getCBlockSize; + break; + } + + case dstage_decodeCBlock_intoTmp: + { + /* not enough place into dst : decode into tmpOut */ + int (*decoder)(const char*, char*, int, int, const char*, int); + int decodedSize; + + if (dctxPtr->frameInfo.blockMode == LZ4F_blockLinked) + decoder = LZ4_decompress_safe_usingDict; + else + decoder = LZ4F_decompress_safe; + + /* ensure enough place for tmpOut */ + if (dctxPtr->frameInfo.blockMode == LZ4F_blockLinked) + { + if (dctxPtr->dict == dctxPtr->tmpOutBuffer) + { + if (dctxPtr->dictSize > 128 KB) + { + memcpy(dctxPtr->tmpOutBuffer, dctxPtr->dict + dctxPtr->dictSize - 64 KB, 64 KB); + dctxPtr->dictSize = 64 KB; + } + dctxPtr->tmpOut = dctxPtr->tmpOutBuffer + dctxPtr->dictSize; + } + else /* dict not within tmp */ + { + size_t reservedDictSpace = dctxPtr->dictSize; + if (reservedDictSpace > 64 KB) reservedDictSpace = 64 KB; + dctxPtr->tmpOut = dctxPtr->tmpOutBuffer + reservedDictSpace; + } + } + + /* Decode */ + decodedSize = decoder((const char*)selectedIn, (char*)dctxPtr->tmpOut, (int)dctxPtr->tmpInTarget, (int)dctxPtr->maxBlockSize, (const char*)dctxPtr->dict, (int)dctxPtr->dictSize); + if (decodedSize < 0) return (size_t)-LZ4F_ERROR_decompressionFailed; /* decompression failed */ + if (dctxPtr->frameInfo.contentChecksumFlag) XXH32_update(&(dctxPtr->xxh), dctxPtr->tmpOut, decodedSize); + if (dctxPtr->frameInfo.contentSize) dctxPtr->frameRemainingSize -= decodedSize; + dctxPtr->tmpOutSize = decodedSize; + dctxPtr->tmpOutStart = 0; + dctxPtr->dStage = dstage_flushOut; + break; + } + + case dstage_flushOut: /* flush decoded data from tmpOut to dstBuffer */ + { + size_t sizeToCopy = dctxPtr->tmpOutSize - dctxPtr->tmpOutStart; + if (sizeToCopy > (size_t)(dstEnd-dstPtr)) sizeToCopy = dstEnd-dstPtr; + memcpy(dstPtr, dctxPtr->tmpOut + dctxPtr->tmpOutStart, sizeToCopy); + + /* dictionary management */ + if (dctxPtr->frameInfo.blockMode==LZ4F_blockLinked) + LZ4F_updateDict(dctxPtr, dstPtr, sizeToCopy, dstStart, 1); + + dctxPtr->tmpOutStart += sizeToCopy; + dstPtr += sizeToCopy; + + /* end of flush ? */ + if (dctxPtr->tmpOutStart == dctxPtr->tmpOutSize) + { + dctxPtr->dStage = dstage_getCBlockSize; + break; + } + nextSrcSizeHint = BHSize; + doAnotherStage = 0; /* still some data to flush */ + break; + } + + case dstage_getSuffix: + { + size_t suffixSize = dctxPtr->frameInfo.contentChecksumFlag * 4; + if (dctxPtr->frameRemainingSize) return (size_t)-LZ4F_ERROR_frameSize_wrong; /* incorrect frame size decoded */ + if (suffixSize == 0) /* frame completed */ + { + nextSrcSizeHint = 0; + dctxPtr->dStage = dstage_getHeader; + doAnotherStage = 0; + break; + } + if ((srcEnd - srcPtr) < 4) /* not enough size for entire CRC */ + { + dctxPtr->tmpInSize = 0; + dctxPtr->dStage = dstage_storeSuffix; + } + else + { + selectedIn = srcPtr; + srcPtr += 4; + } + } + + if (dctxPtr->dStage == dstage_storeSuffix) + case dstage_storeSuffix: + { + size_t sizeToCopy = 4 - dctxPtr->tmpInSize; + if (sizeToCopy > (size_t)(srcEnd - srcPtr)) sizeToCopy = srcEnd - srcPtr; + memcpy(dctxPtr->tmpIn + dctxPtr->tmpInSize, srcPtr, sizeToCopy); + srcPtr += sizeToCopy; + dctxPtr->tmpInSize += sizeToCopy; + if (dctxPtr->tmpInSize < 4) /* not enough input to read complete suffix */ + { + nextSrcSizeHint = 4 - dctxPtr->tmpInSize; + doAnotherStage=0; + break; + } + selectedIn = dctxPtr->tmpIn; + } + + /* case dstage_checkSuffix: */ /* no direct call, to avoid scan-build warning */ + { + U32 readCRC = LZ4F_readLE32(selectedIn); + U32 resultCRC = XXH32_digest(&(dctxPtr->xxh)); + if (readCRC != resultCRC) return (size_t)-LZ4F_ERROR_contentChecksum_invalid; + nextSrcSizeHint = 0; + dctxPtr->dStage = dstage_getHeader; + doAnotherStage = 0; + break; + } + + case dstage_getSFrameSize: + { + if ((srcEnd - srcPtr) >= 4) + { + selectedIn = srcPtr; + srcPtr += 4; + } + else + { + /* not enough input to read cBlockSize field */ + dctxPtr->tmpInSize = 4; + dctxPtr->tmpInTarget = 8; + dctxPtr->dStage = dstage_storeSFrameSize; + } + } + + if (dctxPtr->dStage == dstage_storeSFrameSize) + case dstage_storeSFrameSize: + { + size_t sizeToCopy = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; + if (sizeToCopy > (size_t)(srcEnd - srcPtr)) sizeToCopy = srcEnd - srcPtr; + memcpy(dctxPtr->header + dctxPtr->tmpInSize, srcPtr, sizeToCopy); + srcPtr += sizeToCopy; + dctxPtr->tmpInSize += sizeToCopy; + if (dctxPtr->tmpInSize < dctxPtr->tmpInTarget) /* not enough input to get full sBlockSize; wait for more */ + { + nextSrcSizeHint = dctxPtr->tmpInTarget - dctxPtr->tmpInSize; + doAnotherStage = 0; + break; + } + selectedIn = dctxPtr->header + 4; + } + + /* case dstage_decodeSFrameSize: */ /* no direct access */ + { + size_t SFrameSize = LZ4F_readLE32(selectedIn); + dctxPtr->frameInfo.contentSize = SFrameSize; + dctxPtr->tmpInTarget = SFrameSize; + dctxPtr->dStage = dstage_skipSkippable; + break; + } + + case dstage_skipSkippable: + { + size_t skipSize = dctxPtr->tmpInTarget; + if (skipSize > (size_t)(srcEnd-srcPtr)) skipSize = srcEnd-srcPtr; + srcPtr += skipSize; + dctxPtr->tmpInTarget -= skipSize; + doAnotherStage = 0; + nextSrcSizeHint = dctxPtr->tmpInTarget; + if (nextSrcSizeHint) break; + dctxPtr->dStage = dstage_getHeader; + break; + } + } + } + + /* preserve dictionary within tmp if necessary */ + if ( (dctxPtr->frameInfo.blockMode==LZ4F_blockLinked) + &&(dctxPtr->dict != dctxPtr->tmpOutBuffer) + &&(!decompressOptionsPtr->stableDst) + &&((unsigned)(dctxPtr->dStage-1) < (unsigned)(dstage_getSuffix-1)) + ) + { + if (dctxPtr->dStage == dstage_flushOut) + { + size_t preserveSize = dctxPtr->tmpOut - dctxPtr->tmpOutBuffer; + size_t copySize = 64 KB - dctxPtr->tmpOutSize; + const BYTE* oldDictEnd = dctxPtr->dict + dctxPtr->dictSize - dctxPtr->tmpOutStart; + if (dctxPtr->tmpOutSize > 64 KB) copySize = 0; + if (copySize > preserveSize) copySize = preserveSize; + + memcpy(dctxPtr->tmpOutBuffer + preserveSize - copySize, oldDictEnd - copySize, copySize); + + dctxPtr->dict = dctxPtr->tmpOutBuffer; + dctxPtr->dictSize = preserveSize + dctxPtr->tmpOutStart; + } + else + { + size_t newDictSize = dctxPtr->dictSize; + const BYTE* oldDictEnd = dctxPtr->dict + dctxPtr->dictSize; + if ((newDictSize) > 64 KB) newDictSize = 64 KB; + + memcpy(dctxPtr->tmpOutBuffer, oldDictEnd - newDictSize, newDictSize); + + dctxPtr->dict = dctxPtr->tmpOutBuffer; + dctxPtr->dictSize = newDictSize; + dctxPtr->tmpOut = dctxPtr->tmpOutBuffer + newDictSize; + } + } + + /* require function to be called again from position where it stopped */ + if (srcPtrsrcExpect = srcPtr; + else + dctxPtr->srcExpect = NULL; + + *srcSizePtr = (srcPtr - srcStart); + *dstSizePtr = (dstPtr - dstStart); + return nextSrcSizeHint; +} diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4frame.h b/thirdparty/Lz4/Lz4_131/lib/lz4frame.h new file mode 100644 index 0000000..05fbc5f --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4frame.h @@ -0,0 +1,303 @@ +/* + LZ4 auto-framing library + Header File + Copyright (C) 2011-2015, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/* LZ4F is a stand-alone API to create LZ4-compressed frames + * fully conformant to specification v1.5.1. + * All related operations, including memory management, are handled by the library. + * You don't need lz4.h when using lz4frame.h. + * */ + +#pragma once + +#if defined (__cplusplus) +extern "C" { +#endif + +/************************************** +* Includes +**************************************/ +#include /* size_t */ + + +/************************************** + * Error management + * ************************************/ +typedef size_t LZ4F_errorCode_t; + +unsigned LZ4F_isError(LZ4F_errorCode_t code); +const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /* return error code string; useful for debugging */ + + +/************************************** + * Frame compression types + * ************************************/ +//#define LZ4F_DISABLE_OBSOLETE_ENUMS +#ifndef LZ4F_DISABLE_OBSOLETE_ENUMS +# define LZ4F_OBSOLETE_ENUM(x) ,x +#else +# define LZ4F_OBSOLETE_ENUM(x) +#endif + +typedef enum { + LZ4F_default=0, + LZ4F_max64KB=4, + LZ4F_max256KB=5, + LZ4F_max1MB=6, + LZ4F_max4MB=7 + LZ4F_OBSOLETE_ENUM(max64KB = LZ4F_max64KB) + LZ4F_OBSOLETE_ENUM(max256KB = LZ4F_max256KB) + LZ4F_OBSOLETE_ENUM(max1MB = LZ4F_max1MB) + LZ4F_OBSOLETE_ENUM(max4MB = LZ4F_max4MB) +} LZ4F_blockSizeID_t; + +typedef enum { + LZ4F_blockLinked=0, + LZ4F_blockIndependent + LZ4F_OBSOLETE_ENUM(blockLinked = LZ4F_blockLinked) + LZ4F_OBSOLETE_ENUM(blockIndependent = LZ4F_blockIndependent) +} LZ4F_blockMode_t; + +typedef enum { + LZ4F_noContentChecksum=0, + LZ4F_contentChecksumEnabled + LZ4F_OBSOLETE_ENUM(noContentChecksum = LZ4F_noContentChecksum) + LZ4F_OBSOLETE_ENUM(contentChecksumEnabled = LZ4F_contentChecksumEnabled) +} LZ4F_contentChecksum_t; + +typedef enum { + LZ4F_frame=0, + LZ4F_skippableFrame + LZ4F_OBSOLETE_ENUM(skippableFrame = LZ4F_skippableFrame) +} LZ4F_frameType_t; + +#ifndef LZ4F_DISABLE_OBSOLETE_ENUMS +typedef LZ4F_blockSizeID_t blockSizeID_t; +typedef LZ4F_blockMode_t blockMode_t; +typedef LZ4F_frameType_t frameType_t; +typedef LZ4F_contentChecksum_t contentChecksum_t; +#endif + +typedef struct { + LZ4F_blockSizeID_t blockSizeID; /* max64KB, max256KB, max1MB, max4MB ; 0 == default */ + LZ4F_blockMode_t blockMode; /* blockLinked, blockIndependent ; 0 == default */ + LZ4F_contentChecksum_t contentChecksumFlag; /* noContentChecksum, contentChecksumEnabled ; 0 == default */ + LZ4F_frameType_t frameType; /* LZ4F_frame, skippableFrame ; 0 == default */ + unsigned long long contentSize; /* Size of uncompressed (original) content ; 0 == unknown */ + unsigned reserved[2]; /* must be zero for forward compatibility */ +} LZ4F_frameInfo_t; + +typedef struct { + LZ4F_frameInfo_t frameInfo; + int compressionLevel; /* 0 == default (fast mode); values above 16 count as 16; values below 0 count as 0 */ + unsigned autoFlush; /* 1 == always flush (reduce need for tmp buffer) */ + unsigned reserved[4]; /* must be zero for forward compatibility */ +} LZ4F_preferences_t; + + +/*********************************** + * Simple compression function + * *********************************/ +size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr); + +size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr); +/* LZ4F_compressFrame() + * Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.5.1 + * The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case. + * You can get the minimum value of dstMaxSize by using LZ4F_compressFrameBound() + * If this condition is not respected, LZ4F_compressFrame() will fail (result is an errorCode) + * The LZ4F_preferences_t structure is optional : you can provide NULL as argument. All preferences will be set to default. + * The result of the function is the number of bytes written into dstBuffer. + * The function outputs an error code if it fails (can be tested using LZ4F_isError()) + */ + + + +/********************************** +* Advanced compression functions +**********************************/ +typedef struct LZ4F_cctx_s* LZ4F_compressionContext_t; /* must be aligned on 8-bytes */ + +typedef struct { + unsigned stableSrc; /* 1 == src content will remain available on future calls to LZ4F_compress(); avoid saving src content within tmp buffer as future dictionary */ + unsigned reserved[3]; +} LZ4F_compressOptions_t; + +/* Resource Management */ + +#define LZ4F_VERSION 100 +LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_compressionContext_t* cctxPtr, unsigned version); +LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_compressionContext_t cctx); +/* LZ4F_createCompressionContext() : + * The first thing to do is to create a compressionContext object, which will be used in all compression operations. + * This is achieved using LZ4F_createCompressionContext(), which takes as argument a version and an LZ4F_preferences_t structure. + * The version provided MUST be LZ4F_VERSION. It is intended to track potential version differences between different binaries. + * The function will provide a pointer to a fully allocated LZ4F_compressionContext_t object. + * If the result LZ4F_errorCode_t is not zero, there was an error during context creation. + * Object can release its memory using LZ4F_freeCompressionContext(); + */ + + +/* Compression */ + +size_t LZ4F_compressBegin(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_preferences_t* prefsPtr); +/* LZ4F_compressBegin() : + * will write the frame header into dstBuffer. + * dstBuffer must be large enough to accommodate a header (dstMaxSize). Maximum header size is 15 bytes. + * The LZ4F_preferences_t structure is optional : you can provide NULL as argument, all preferences will then be set to default. + * The result of the function is the number of bytes written into dstBuffer for the header + * or an error code (can be tested using LZ4F_isError()) + */ + +size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* prefsPtr); +/* LZ4F_compressBound() : + * Provides the minimum size of Dst buffer given srcSize to handle worst case situations. + * Different preferences can produce different results. + * prefsPtr is optional : you can provide NULL as argument, all preferences will then be set to cover worst case. + * This function includes frame termination cost (4 bytes, or 8 if frame checksum is enabled) + */ + +size_t LZ4F_compressUpdate(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_compressOptions_t* cOptPtr); +/* LZ4F_compressUpdate() + * LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary. + * The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case. + * You can get the minimum value of dstMaxSize by using LZ4F_compressBound(). + * If this condition is not respected, LZ4F_compress() will fail (result is an errorCode). + * LZ4F_compressUpdate() doesn't guarantee error recovery, so you have to reset compression context when an error occurs. + * The LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. + * The result of the function is the number of bytes written into dstBuffer : it can be zero, meaning input data was just buffered. + * The function outputs an error code if it fails (can be tested using LZ4F_isError()) + */ + +size_t LZ4F_flush(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* cOptPtr); +/* LZ4F_flush() + * Should you need to generate compressed data immediately, without waiting for the current block to be filled, + * you can call LZ4_flush(), which will immediately compress any remaining data buffered within cctx. + * Note that dstMaxSize must be large enough to ensure the operation will be successful. + * LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. + * The result of the function is the number of bytes written into dstBuffer + * (it can be zero, this means there was no data left within cctx) + * The function outputs an error code if it fails (can be tested using LZ4F_isError()) + */ + +size_t LZ4F_compressEnd(LZ4F_compressionContext_t cctx, void* dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t* cOptPtr); +/* LZ4F_compressEnd() + * When you want to properly finish the compressed frame, just call LZ4F_compressEnd(). + * It will flush whatever data remained within compressionContext (like LZ4_flush()) + * but also properly finalize the frame, with an endMark and a checksum. + * The result of the function is the number of bytes written into dstBuffer (necessarily >= 4 (endMark), or 8 if optional frame checksum is enabled) + * The function outputs an error code if it fails (can be tested using LZ4F_isError()) + * The LZ4F_compressOptions_t structure is optional : you can provide NULL as argument. + * A successful call to LZ4F_compressEnd() makes cctx available again for next compression task. + */ + + +/*********************************** +* Decompression functions +***********************************/ + +typedef struct LZ4F_dctx_s* LZ4F_decompressionContext_t; /* must be aligned on 8-bytes */ + +typedef struct { + unsigned stableDst; /* guarantee that decompressed data will still be there on next function calls (avoid storage into tmp buffers) */ + unsigned reserved[3]; +} LZ4F_decompressOptions_t; + + +/* Resource management */ + +LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_decompressionContext_t* dctxPtr, unsigned version); +LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_decompressionContext_t dctx); +/* LZ4F_createDecompressionContext() : + * The first thing to do is to create an LZ4F_decompressionContext_t object, which will be used in all decompression operations. + * This is achieved using LZ4F_createDecompressionContext(). + * The version provided MUST be LZ4F_VERSION. It is intended to track potential breaking differences between different versions. + * The function will provide a pointer to a fully allocated and initialized LZ4F_decompressionContext_t object. + * The result is an errorCode, which can be tested using LZ4F_isError(). + * dctx memory can be released using LZ4F_freeDecompressionContext(); + * The result of LZ4F_freeDecompressionContext() is indicative of the current state of decompressionContext when being released. + * That is, it should be == 0 if decompression has been completed fully and correctly. + */ + + +/* Decompression */ + +size_t LZ4F_getFrameInfo(LZ4F_decompressionContext_t dctx, + LZ4F_frameInfo_t* frameInfoPtr, + const void* srcBuffer, size_t* srcSizePtr); +/* LZ4F_getFrameInfo() + * This function decodes frame header information (such as max blockSize, frame checksum, etc.). + * Its usage is optional : you can start by calling directly LZ4F_decompress() instead. + * The objective is to extract frame header information, typically for allocation purposes. + * LZ4F_getFrameInfo() can also be used anytime *after* starting decompression, on any valid LZ4F_decompressionContext_t. + * The result is *copied* into an existing LZ4F_frameInfo_t structure which must be already allocated. + * The number of bytes read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value). + * The function result is an hint of how many srcSize bytes LZ4F_decompress() expects for next call, + * or an error code which can be tested using LZ4F_isError() + * (typically, when there is not enough src bytes to fully decode the frame header) + * You are expected to resume decompression from where it stopped (srcBuffer + *srcSizePtr) + */ + +size_t LZ4F_decompress(LZ4F_decompressionContext_t dctx, + void* dstBuffer, size_t* dstSizePtr, + const void* srcBuffer, size_t* srcSizePtr, + const LZ4F_decompressOptions_t* dOptPtr); +/* LZ4F_decompress() + * Call this function repetitively to regenerate data compressed within srcBuffer. + * The function will attempt to decode *srcSizePtr bytes from srcBuffer, into dstBuffer of maximum size *dstSizePtr. + * + * The number of bytes regenerated into dstBuffer will be provided within *dstSizePtr (necessarily <= original value). + * + * The number of bytes read from srcBuffer will be provided within *srcSizePtr (necessarily <= original value). + * If number of bytes read is < number of bytes provided, then decompression operation is not completed. + * It typically happens when dstBuffer is not large enough to contain all decoded data. + * LZ4F_decompress() must be called again, starting from where it stopped (srcBuffer + *srcSizePtr) + * The function will check this condition, and refuse to continue if it is not respected. + * + * dstBuffer is supposed to be flushed between each call to the function, since its content will be overwritten. + * dst arguments can be changed at will with each consecutive call to the function. + * + * The function result is an hint of how many srcSize bytes LZ4F_decompress() expects for next call. + * Schematically, it's the size of the current (or remaining) compressed block + header of next block. + * Respecting the hint provides some boost to performance, since it does skip intermediate buffers. + * This is just a hint, you can always provide any srcSize you want. + * When a frame is fully decoded, the function result will be 0 (no more data expected). + * If decompression failed, function result is an error code, which can be tested using LZ4F_isError(). + * + * After a frame is fully decoded, dctx can be used again to decompress another frame. + */ + + +#if defined (__cplusplus) +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4frame_static.h b/thirdparty/Lz4/Lz4_131/lib/lz4frame_static.h new file mode 100644 index 0000000..0d90975 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4frame_static.h @@ -0,0 +1,81 @@ +/* + LZ4 auto-framing library + Header File for static linking only + Copyright (C) 2011-2015, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +#pragma once + +#if defined (__cplusplus) +extern "C" { +#endif + +/* lz4frame_static.h should be used solely in the context of static linking. + * It contains definitions which may still change overtime. + * Never use it in the context of DLL linking. + * */ + + +/************************************** +* Includes +**************************************/ +#include "lz4frame.h" + + +/************************************** + * Error management + * ************************************/ +#define LZ4F_LIST_ERRORS(ITEM) \ + ITEM(OK_NoError) ITEM(ERROR_GENERIC) \ + ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \ + ITEM(ERROR_compressionLevel_invalid) \ + ITEM(ERROR_headerVersion_wrong) ITEM(ERROR_blockChecksum_unsupported) ITEM(ERROR_reservedFlag_set) \ + ITEM(ERROR_allocation_failed) \ + ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \ + ITEM(ERROR_frameHeader_incomplete) ITEM(ERROR_frameType_unknown) ITEM(ERROR_frameSize_wrong) \ + ITEM(ERROR_srcPtr_wrong) \ + ITEM(ERROR_decompressionFailed) \ + ITEM(ERROR_headerChecksum_invalid) ITEM(ERROR_contentChecksum_invalid) \ + ITEM(ERROR_maxCode) + +//#define LZ4F_DISABLE_OLD_ENUMS +#ifndef LZ4F_DISABLE_OLD_ENUMS +#define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM, ENUM = LZ4F_##ENUM, +#else +#define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM, +#endif +typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM) } LZ4F_errorCodes; /* enum is exposed, to handle specific errors; compare function result to -enum value */ + + +#if defined (__cplusplus) +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4hc.c b/thirdparty/Lz4/Lz4_131/lib/lz4hc.c new file mode 100644 index 0000000..bbe7a9d --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4hc.c @@ -0,0 +1,731 @@ +/* + LZ4 HC - High Compression Mode of LZ4 + Copyright (C) 2011-2015, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + + + +/************************************** +* Tuning Parameter +**************************************/ +static const int LZ4HC_compressionLevel_default = 9; + + +/************************************** +* Includes +**************************************/ +#include "lz4hc.h" + + +/************************************** +* Local Compiler Options +**************************************/ +#if defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wunused-function" +#endif + +#if defined (__clang__) +# pragma clang diagnostic ignored "-Wunused-function" +#endif + + +/************************************** +* Common LZ4 definition +**************************************/ +#define LZ4_COMMONDEFS_ONLY +#include "lz4.c" + + +/************************************** +* Local Constants +**************************************/ +#define DICTIONARY_LOGSIZE 16 +#define MAXD (1<> ((MINMATCH*8)-HASH_LOG)) +//#define DELTANEXTU16(p) chainTable[(p) & MAXD_MASK] /* flexible, MAXD dependent */ +#define DELTANEXTU16(p) chainTable[(U16)(p)] /* faster */ + +static U32 LZ4HC_hashPtr(const void* ptr) { return HASH_FUNCTION(LZ4_read32(ptr)); } + + + +/************************************** +* HC Compression +**************************************/ +static void LZ4HC_init (LZ4HC_Data_Structure* hc4, const BYTE* start) +{ + MEM_INIT((void*)hc4->hashTable, 0, sizeof(hc4->hashTable)); + MEM_INIT(hc4->chainTable, 0xFF, sizeof(hc4->chainTable)); + hc4->nextToUpdate = 64 KB; + hc4->base = start - 64 KB; + hc4->end = start; + hc4->dictBase = start - 64 KB; + hc4->dictLimit = 64 KB; + hc4->lowLimit = 64 KB; +} + + +/* Update chains up to ip (excluded) */ +FORCE_INLINE void LZ4HC_Insert (LZ4HC_Data_Structure* hc4, const BYTE* ip) +{ + U16* chainTable = hc4->chainTable; + U32* HashTable = hc4->hashTable; + const BYTE* const base = hc4->base; + const U32 target = (U32)(ip - base); + U32 idx = hc4->nextToUpdate; + + while(idx < target) + { + U32 h = LZ4HC_hashPtr(base+idx); + size_t delta = idx - HashTable[h]; + if (delta>MAX_DISTANCE) delta = MAX_DISTANCE; + DELTANEXTU16(idx) = (U16)delta; + HashTable[h] = idx; + idx++; + } + + hc4->nextToUpdate = target; +} + + +FORCE_INLINE int LZ4HC_InsertAndFindBestMatch (LZ4HC_Data_Structure* hc4, /* Index table will be updated */ + const BYTE* ip, const BYTE* const iLimit, + const BYTE** matchpos, + const int maxNbAttempts) +{ + U16* const chainTable = hc4->chainTable; + U32* const HashTable = hc4->hashTable; + const BYTE* const base = hc4->base; + const BYTE* const dictBase = hc4->dictBase; + const U32 dictLimit = hc4->dictLimit; + const U32 lowLimit = (hc4->lowLimit + 64 KB > (U32)(ip-base)) ? hc4->lowLimit : (U32)(ip - base) - (64 KB - 1); + U32 matchIndex; + const BYTE* match; + int nbAttempts=maxNbAttempts; + size_t ml=0; + + /* HC4 match finder */ + LZ4HC_Insert(hc4, ip); + matchIndex = HashTable[LZ4HC_hashPtr(ip)]; + + while ((matchIndex>=lowLimit) && (nbAttempts)) + { + nbAttempts--; + if (matchIndex >= dictLimit) + { + match = base + matchIndex; + if (*(match+ml) == *(ip+ml) + && (LZ4_read32(match) == LZ4_read32(ip))) + { + size_t mlt = LZ4_count(ip+MINMATCH, match+MINMATCH, iLimit) + MINMATCH; + if (mlt > ml) { ml = mlt; *matchpos = match; } + } + } + else + { + match = dictBase + matchIndex; + if (LZ4_read32(match) == LZ4_read32(ip)) + { + size_t mlt; + const BYTE* vLimit = ip + (dictLimit - matchIndex); + if (vLimit > iLimit) vLimit = iLimit; + mlt = LZ4_count(ip+MINMATCH, match+MINMATCH, vLimit) + MINMATCH; + if ((ip+mlt == vLimit) && (vLimit < iLimit)) + mlt += LZ4_count(ip+mlt, base+dictLimit, iLimit); + if (mlt > ml) { ml = mlt; *matchpos = base + matchIndex; } /* virtual matchpos */ + } + } + matchIndex -= DELTANEXTU16(matchIndex); + } + + return (int)ml; +} + + +FORCE_INLINE int LZ4HC_InsertAndGetWiderMatch ( + LZ4HC_Data_Structure* hc4, + const BYTE* const ip, + const BYTE* const iLowLimit, + const BYTE* const iHighLimit, + int longest, + const BYTE** matchpos, + const BYTE** startpos, + const int maxNbAttempts) +{ + U16* const chainTable = hc4->chainTable; + U32* const HashTable = hc4->hashTable; + const BYTE* const base = hc4->base; + const U32 dictLimit = hc4->dictLimit; + const BYTE* const lowPrefixPtr = base + dictLimit; + const U32 lowLimit = (hc4->lowLimit + 64 KB > (U32)(ip-base)) ? hc4->lowLimit : (U32)(ip - base) - (64 KB - 1); + const BYTE* const dictBase = hc4->dictBase; + U32 matchIndex; + int nbAttempts = maxNbAttempts; + int delta = (int)(ip-iLowLimit); + + + /* First Match */ + LZ4HC_Insert(hc4, ip); + matchIndex = HashTable[LZ4HC_hashPtr(ip)]; + + while ((matchIndex>=lowLimit) && (nbAttempts)) + { + nbAttempts--; + if (matchIndex >= dictLimit) + { + const BYTE* matchPtr = base + matchIndex; + if (*(iLowLimit + longest) == *(matchPtr - delta + longest)) + if (LZ4_read32(matchPtr) == LZ4_read32(ip)) + { + int mlt = MINMATCH + LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, iHighLimit); + int back = 0; + + while ((ip+back>iLowLimit) + && (matchPtr+back > lowPrefixPtr) + && (ip[back-1] == matchPtr[back-1])) + back--; + + mlt -= back; + + if (mlt > longest) + { + longest = (int)mlt; + *matchpos = matchPtr+back; + *startpos = ip+back; + } + } + } + else + { + const BYTE* matchPtr = dictBase + matchIndex; + if (LZ4_read32(matchPtr) == LZ4_read32(ip)) + { + size_t mlt; + int back=0; + const BYTE* vLimit = ip + (dictLimit - matchIndex); + if (vLimit > iHighLimit) vLimit = iHighLimit; + mlt = LZ4_count(ip+MINMATCH, matchPtr+MINMATCH, vLimit) + MINMATCH; + if ((ip+mlt == vLimit) && (vLimit < iHighLimit)) + mlt += LZ4_count(ip+mlt, base+dictLimit, iHighLimit); + while ((ip+back > iLowLimit) && (matchIndex+back > lowLimit) && (ip[back-1] == matchPtr[back-1])) back--; + mlt -= back; + if ((int)mlt > longest) { longest = (int)mlt; *matchpos = base + matchIndex + back; *startpos = ip+back; } + } + } + matchIndex -= DELTANEXTU16(matchIndex); + } + + return longest; +} + + +typedef enum { noLimit = 0, limitedOutput = 1 } limitedOutput_directive; + +#define LZ4HC_DEBUG 0 +#if LZ4HC_DEBUG +static unsigned debug = 0; +#endif + +FORCE_INLINE int LZ4HC_encodeSequence ( + const BYTE** ip, + BYTE** op, + const BYTE** anchor, + int matchLength, + const BYTE* const match, + limitedOutput_directive limitedOutputBuffer, + BYTE* oend) +{ + int length; + BYTE* token; + +#if LZ4HC_DEBUG + if (debug) printf("literal : %u -- match : %u -- offset : %u\n", (U32)(*ip - *anchor), (U32)matchLength, (U32)(*ip-match)); +#endif + + /* Encode Literal length */ + length = (int)(*ip - *anchor); + token = (*op)++; + if ((limitedOutputBuffer) && ((*op + (length>>8) + length + (2 + 1 + LASTLITERALS)) > oend)) return 1; /* Check output limit */ + if (length>=(int)RUN_MASK) { int len; *token=(RUN_MASK< 254 ; len-=255) *(*op)++ = 255; *(*op)++ = (BYTE)len; } + else *token = (BYTE)(length<>8) + (1 + LASTLITERALS) > oend)) return 1; /* Check output limit */ + if (length>=(int)ML_MASK) { *token+=ML_MASK; length-=ML_MASK; for(; length > 509 ; length-=510) { *(*op)++ = 255; *(*op)++ = 255; } if (length > 254) { length-=255; *(*op)++ = 255; } *(*op)++ = (BYTE)length; } + else *token += (BYTE)(length); + + /* Prepare next loop */ + *ip += matchLength; + *anchor = *ip; + + return 0; +} + + +static int LZ4HC_compress_generic ( + void* ctxvoid, + const char* source, + char* dest, + int inputSize, + int maxOutputSize, + int compressionLevel, + limitedOutput_directive limit + ) +{ + LZ4HC_Data_Structure* ctx = (LZ4HC_Data_Structure*) ctxvoid; + const BYTE* ip = (const BYTE*) source; + const BYTE* anchor = ip; + const BYTE* const iend = ip + inputSize; + const BYTE* const mflimit = iend - MFLIMIT; + const BYTE* const matchlimit = (iend - LASTLITERALS); + + BYTE* op = (BYTE*) dest; + BYTE* const oend = op + maxOutputSize; + + unsigned maxNbAttempts; + int ml, ml2, ml3, ml0; + const BYTE* ref=NULL; + const BYTE* start2=NULL; + const BYTE* ref2=NULL; + const BYTE* start3=NULL; + const BYTE* ref3=NULL; + const BYTE* start0; + const BYTE* ref0; + + + /* init */ + if (compressionLevel > g_maxCompressionLevel) compressionLevel = g_maxCompressionLevel; + if (compressionLevel < 1) compressionLevel = LZ4HC_compressionLevel_default; + maxNbAttempts = 1 << (compressionLevel-1); + ctx->end += inputSize; + + ip++; + + /* Main Loop */ + while (ip < mflimit) + { + ml = LZ4HC_InsertAndFindBestMatch (ctx, ip, matchlimit, (&ref), maxNbAttempts); + if (!ml) { ip++; continue; } + + /* saved, in case we would skip too much */ + start0 = ip; + ref0 = ref; + ml0 = ml; + +_Search2: + if (ip+ml < mflimit) + ml2 = LZ4HC_InsertAndGetWiderMatch(ctx, ip + ml - 2, ip + 1, matchlimit, ml, &ref2, &start2, maxNbAttempts); + else ml2 = ml; + + if (ml2 == ml) /* No better match */ + { + if (LZ4HC_encodeSequence(&ip, &op, &anchor, ml, ref, limit, oend)) return 0; + continue; + } + + if (start0 < ip) + { + if (start2 < ip + ml0) /* empirical */ + { + ip = start0; + ref = ref0; + ml = ml0; + } + } + + /* Here, start0==ip */ + if ((start2 - ip) < 3) /* First Match too small : removed */ + { + ml = ml2; + ip = start2; + ref =ref2; + goto _Search2; + } + +_Search3: + /* + * Currently we have : + * ml2 > ml1, and + * ip1+3 <= ip2 (usually < ip1+ml1) + */ + if ((start2 - ip) < OPTIMAL_ML) + { + int correction; + int new_ml = ml; + if (new_ml > OPTIMAL_ML) new_ml = OPTIMAL_ML; + if (ip+new_ml > start2 + ml2 - MINMATCH) new_ml = (int)(start2 - ip) + ml2 - MINMATCH; + correction = new_ml - (int)(start2 - ip); + if (correction > 0) + { + start2 += correction; + ref2 += correction; + ml2 -= correction; + } + } + /* Now, we have start2 = ip+new_ml, with new_ml = min(ml, OPTIMAL_ML=18) */ + + if (start2 + ml2 < mflimit) + ml3 = LZ4HC_InsertAndGetWiderMatch(ctx, start2 + ml2 - 3, start2, matchlimit, ml2, &ref3, &start3, maxNbAttempts); + else ml3 = ml2; + + if (ml3 == ml2) /* No better match : 2 sequences to encode */ + { + /* ip & ref are known; Now for ml */ + if (start2 < ip+ml) ml = (int)(start2 - ip); + /* Now, encode 2 sequences */ + if (LZ4HC_encodeSequence(&ip, &op, &anchor, ml, ref, limit, oend)) return 0; + ip = start2; + if (LZ4HC_encodeSequence(&ip, &op, &anchor, ml2, ref2, limit, oend)) return 0; + continue; + } + + if (start3 < ip+ml+3) /* Not enough space for match 2 : remove it */ + { + if (start3 >= (ip+ml)) /* can write Seq1 immediately ==> Seq2 is removed, so Seq3 becomes Seq1 */ + { + if (start2 < ip+ml) + { + int correction = (int)(ip+ml - start2); + start2 += correction; + ref2 += correction; + ml2 -= correction; + if (ml2 < MINMATCH) + { + start2 = start3; + ref2 = ref3; + ml2 = ml3; + } + } + + if (LZ4HC_encodeSequence(&ip, &op, &anchor, ml, ref, limit, oend)) return 0; + ip = start3; + ref = ref3; + ml = ml3; + + start0 = start2; + ref0 = ref2; + ml0 = ml2; + goto _Search2; + } + + start2 = start3; + ref2 = ref3; + ml2 = ml3; + goto _Search3; + } + + /* + * OK, now we have 3 ascending matches; let's write at least the first one + * ip & ref are known; Now for ml + */ + if (start2 < ip+ml) + { + if ((start2 - ip) < (int)ML_MASK) + { + int correction; + if (ml > OPTIMAL_ML) ml = OPTIMAL_ML; + if (ip + ml > start2 + ml2 - MINMATCH) ml = (int)(start2 - ip) + ml2 - MINMATCH; + correction = ml - (int)(start2 - ip); + if (correction > 0) + { + start2 += correction; + ref2 += correction; + ml2 -= correction; + } + } + else + { + ml = (int)(start2 - ip); + } + } + if (LZ4HC_encodeSequence(&ip, &op, &anchor, ml, ref, limit, oend)) return 0; + + ip = start2; + ref = ref2; + ml = ml2; + + start2 = start3; + ref2 = ref3; + ml2 = ml3; + + goto _Search3; + } + + /* Encode Last Literals */ + { + int lastRun = (int)(iend - anchor); + if ((limit) && (((char*)op - dest) + lastRun + 1 + ((lastRun+255-RUN_MASK)/255) > (U32)maxOutputSize)) return 0; /* Check output limit */ + if (lastRun>=(int)RUN_MASK) { *op++=(RUN_MASK< 254 ; lastRun-=255) *op++ = 255; *op++ = (BYTE) lastRun; } + else *op++ = (BYTE)(lastRun<base = NULL; + ((LZ4HC_Data_Structure*)LZ4_streamHCPtr)->compressionLevel = (unsigned)compressionLevel; +} + +int LZ4_loadDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, const char* dictionary, int dictSize) +{ + LZ4HC_Data_Structure* ctxPtr = (LZ4HC_Data_Structure*) LZ4_streamHCPtr; + if (dictSize > 64 KB) + { + dictionary += dictSize - 64 KB; + dictSize = 64 KB; + } + LZ4HC_init (ctxPtr, (const BYTE*)dictionary); + if (dictSize >= 4) LZ4HC_Insert (ctxPtr, (const BYTE*)dictionary +(dictSize-3)); + ctxPtr->end = (const BYTE*)dictionary + dictSize; + return dictSize; +} + + +/* compression */ + +static void LZ4HC_setExternalDict(LZ4HC_Data_Structure* ctxPtr, const BYTE* newBlock) +{ + if (ctxPtr->end >= ctxPtr->base + 4) + LZ4HC_Insert (ctxPtr, ctxPtr->end-3); /* Referencing remaining dictionary content */ + /* Only one memory segment for extDict, so any previous extDict is lost at this stage */ + ctxPtr->lowLimit = ctxPtr->dictLimit; + ctxPtr->dictLimit = (U32)(ctxPtr->end - ctxPtr->base); + ctxPtr->dictBase = ctxPtr->base; + ctxPtr->base = newBlock - ctxPtr->dictLimit; + ctxPtr->end = newBlock; + ctxPtr->nextToUpdate = ctxPtr->dictLimit; /* match referencing will resume from there */ +} + +static int LZ4_compressHC_continue_generic (LZ4HC_Data_Structure* ctxPtr, + const char* source, char* dest, + int inputSize, int maxOutputSize, limitedOutput_directive limit) +{ + /* auto-init if forgotten */ + if (ctxPtr->base == NULL) + LZ4HC_init (ctxPtr, (const BYTE*) source); + + /* Check overflow */ + if ((size_t)(ctxPtr->end - ctxPtr->base) > 2 GB) + { + size_t dictSize = (size_t)(ctxPtr->end - ctxPtr->base) - ctxPtr->dictLimit; + if (dictSize > 64 KB) dictSize = 64 KB; + + LZ4_loadDictHC((LZ4_streamHC_t*)ctxPtr, (const char*)(ctxPtr->end) - dictSize, (int)dictSize); + } + + /* Check if blocks follow each other */ + if ((const BYTE*)source != ctxPtr->end) + LZ4HC_setExternalDict(ctxPtr, (const BYTE*)source); + + /* Check overlapping input/dictionary space */ + { + const BYTE* sourceEnd = (const BYTE*) source + inputSize; + const BYTE* dictBegin = ctxPtr->dictBase + ctxPtr->lowLimit; + const BYTE* dictEnd = ctxPtr->dictBase + ctxPtr->dictLimit; + if ((sourceEnd > dictBegin) && ((const BYTE*)source < dictEnd)) + { + if (sourceEnd > dictEnd) sourceEnd = dictEnd; + ctxPtr->lowLimit = (U32)(sourceEnd - ctxPtr->dictBase); + if (ctxPtr->dictLimit - ctxPtr->lowLimit < 4) ctxPtr->lowLimit = ctxPtr->dictLimit; + } + } + + return LZ4HC_compress_generic (ctxPtr, source, dest, inputSize, maxOutputSize, ctxPtr->compressionLevel, limit); +} + +int LZ4_compress_HC_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize, int maxOutputSize) +{ + if (maxOutputSize < LZ4_compressBound(inputSize)) + return LZ4_compressHC_continue_generic ((LZ4HC_Data_Structure*)LZ4_streamHCPtr, source, dest, inputSize, maxOutputSize, limitedOutput); + else + return LZ4_compressHC_continue_generic ((LZ4HC_Data_Structure*)LZ4_streamHCPtr, source, dest, inputSize, maxOutputSize, noLimit); +} + + +/* dictionary saving */ + +int LZ4_saveDictHC (LZ4_streamHC_t* LZ4_streamHCPtr, char* safeBuffer, int dictSize) +{ + LZ4HC_Data_Structure* streamPtr = (LZ4HC_Data_Structure*)LZ4_streamHCPtr; + int prefixSize = (int)(streamPtr->end - (streamPtr->base + streamPtr->dictLimit)); + if (dictSize > 64 KB) dictSize = 64 KB; + if (dictSize < 4) dictSize = 0; + if (dictSize > prefixSize) dictSize = prefixSize; + memmove(safeBuffer, streamPtr->end - dictSize, dictSize); + { + U32 endIndex = (U32)(streamPtr->end - streamPtr->base); + streamPtr->end = (const BYTE*)safeBuffer + dictSize; + streamPtr->base = streamPtr->end - endIndex; + streamPtr->dictLimit = endIndex - dictSize; + streamPtr->lowLimit = endIndex - dictSize; + if (streamPtr->nextToUpdate < streamPtr->dictLimit) streamPtr->nextToUpdate = streamPtr->dictLimit; + } + return dictSize; +} + + +/*********************************** +* Deprecated Functions +***********************************/ +/* Deprecated compression functions */ +/* These functions are planned to start generate warnings by r131 approximately */ +int LZ4_compressHC(const char* src, char* dst, int srcSize) { return LZ4_compress_HC (src, dst, srcSize, LZ4_compressBound(srcSize), 0); } +int LZ4_compressHC_limitedOutput(const char* src, char* dst, int srcSize, int maxDstSize) { return LZ4_compress_HC(src, dst, srcSize, maxDstSize, 0); } +int LZ4_compressHC2(const char* src, char* dst, int srcSize, int cLevel) { return LZ4_compress_HC (src, dst, srcSize, LZ4_compressBound(srcSize), cLevel); } +int LZ4_compressHC2_limitedOutput(const char* src, char* dst, int srcSize, int maxDstSize, int cLevel) { return LZ4_compress_HC(src, dst, srcSize, maxDstSize, cLevel); } +int LZ4_compressHC_withStateHC (void* state, const char* src, char* dst, int srcSize) { return LZ4_compress_HC_extStateHC (state, src, dst, srcSize, LZ4_compressBound(srcSize), 0); } +int LZ4_compressHC_limitedOutput_withStateHC (void* state, const char* src, char* dst, int srcSize, int maxDstSize) { return LZ4_compress_HC_extStateHC (state, src, dst, srcSize, maxDstSize, 0); } +int LZ4_compressHC2_withStateHC (void* state, const char* src, char* dst, int srcSize, int cLevel) { return LZ4_compress_HC_extStateHC(state, src, dst, srcSize, LZ4_compressBound(srcSize), cLevel); } +int LZ4_compressHC2_limitedOutput_withStateHC (void* state, const char* src, char* dst, int srcSize, int maxDstSize, int cLevel) { return LZ4_compress_HC_extStateHC(state, src, dst, srcSize, maxDstSize, cLevel); } +int LZ4_compressHC_continue (LZ4_streamHC_t* ctx, const char* src, char* dst, int srcSize) { return LZ4_compress_HC_continue (ctx, src, dst, srcSize, LZ4_compressBound(srcSize)); } +int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* ctx, const char* src, char* dst, int srcSize, int maxDstSize) { return LZ4_compress_HC_continue (ctx, src, dst, srcSize, maxDstSize); } + + +/* Deprecated streaming functions */ +/* These functions currently generate deprecation warnings */ +int LZ4_sizeofStreamStateHC(void) { return LZ4_STREAMHCSIZE; } + +int LZ4_resetStreamStateHC(void* state, char* inputBuffer) +{ + if ((((size_t)state) & (sizeof(void*)-1)) != 0) return 1; /* Error : pointer is not aligned for pointer (32 or 64 bits) */ + LZ4HC_init((LZ4HC_Data_Structure*)state, (const BYTE*)inputBuffer); + ((LZ4HC_Data_Structure*)state)->inputBuffer = (BYTE*)inputBuffer; + return 0; +} + +void* LZ4_createHC (char* inputBuffer) +{ + void* hc4 = ALLOCATOR(1, sizeof(LZ4HC_Data_Structure)); + if (hc4 == NULL) return NULL; /* not enough memory */ + LZ4HC_init ((LZ4HC_Data_Structure*)hc4, (const BYTE*)inputBuffer); + ((LZ4HC_Data_Structure*)hc4)->inputBuffer = (BYTE*)inputBuffer; + return hc4; +} + +int LZ4_freeHC (void* LZ4HC_Data) +{ + FREEMEM(LZ4HC_Data); + return (0); +} + +int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel) +{ + return LZ4HC_compress_generic (LZ4HC_Data, source, dest, inputSize, 0, compressionLevel, noLimit); +} + +int LZ4_compressHC2_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel) +{ + return LZ4HC_compress_generic (LZ4HC_Data, source, dest, inputSize, maxOutputSize, compressionLevel, limitedOutput); +} + +char* LZ4_slideInputBufferHC(void* LZ4HC_Data) +{ + LZ4HC_Data_Structure* hc4 = (LZ4HC_Data_Structure*)LZ4HC_Data; + int dictSize = LZ4_saveDictHC((LZ4_streamHC_t*)LZ4HC_Data, (char*)(hc4->inputBuffer), 64 KB); + return (char*)(hc4->inputBuffer + dictSize); +} diff --git a/thirdparty/Lz4/Lz4_131/lib/lz4hc.h b/thirdparty/Lz4/Lz4_131/lib/lz4hc.h new file mode 100644 index 0000000..431f7c8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/lz4hc.h @@ -0,0 +1,189 @@ +/* + LZ4 HC - High Compression Mode of LZ4 + Header File + Copyright (C) 2011-2015, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +#pragma once + + +#if defined (__cplusplus) +extern "C" { +#endif + +/***************************** +* Includes +*****************************/ +#include /* size_t */ + + +/************************************** +* Block Compression +**************************************/ +int LZ4_compress_HC (const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); +/* +LZ4_compress_HC : + Destination buffer 'dst' must be already allocated. + Compression completion is guaranteed if 'dst' buffer is sized to handle worst circumstances (data not compressible) + Worst size evaluation is provided by function LZ4_compressBound() (see "lz4.h") + srcSize : Max supported value is LZ4_MAX_INPUT_SIZE (see "lz4.h") + compressionLevel : Recommended values are between 4 and 9, although any value between 0 and 16 will work. + 0 means "use default value" (see lz4hc.c). + Values >16 behave the same as 16. + return : the number of bytes written into buffer 'dst' + or 0 if compression fails. +*/ + + +/* Note : + Decompression functions are provided within LZ4 source code (see "lz4.h") (BSD license) +*/ + + +int LZ4_sizeofStateHC(void); +int LZ4_compress_HC_extStateHC(void* state, const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); +/* +LZ4_compress_HC_extStateHC() : + Use this function if you prefer to manually allocate memory for compression tables. + To know how much memory must be allocated for the compression tables, use : + int LZ4_sizeofStateHC(); + + Allocated memory must be aligned on 8-bytes boundaries (which a normal malloc() will do properly). + + The allocated memory can then be provided to the compression functions using 'void* state' parameter. + LZ4_compress_HC_extStateHC() is equivalent to previously described function. + It just uses externally allocated memory for stateHC. +*/ + + +/************************************** +* Streaming Compression +**************************************/ +#define LZ4_STREAMHCSIZE 262192 +#define LZ4_STREAMHCSIZE_SIZET (LZ4_STREAMHCSIZE / sizeof(size_t)) +typedef struct { size_t table[LZ4_STREAMHCSIZE_SIZET]; } LZ4_streamHC_t; +/* + LZ4_streamHC_t + This structure allows static allocation of LZ4 HC streaming state. + State must then be initialized using LZ4_resetStreamHC() before first use. + + Static allocation should only be used in combination with static linking. + If you want to use LZ4 as a DLL, please use construction functions below, which are future-proof. +*/ + + +LZ4_streamHC_t* LZ4_createStreamHC(void); +int LZ4_freeStreamHC (LZ4_streamHC_t* streamHCPtr); +/* + These functions create and release memory for LZ4 HC streaming state. + Newly created states are already initialized. + Existing state space can be re-used anytime using LZ4_resetStreamHC(). + If you use LZ4 as a DLL, use these functions instead of static structure allocation, + to avoid size mismatch between different versions. +*/ + +void LZ4_resetStreamHC (LZ4_streamHC_t* streamHCPtr, int compressionLevel); +int LZ4_loadDictHC (LZ4_streamHC_t* streamHCPtr, const char* dictionary, int dictSize); + +int LZ4_compress_HC_continue (LZ4_streamHC_t* streamHCPtr, const char* src, char* dst, int srcSize, int maxDstSize); + +int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSize); + +/* + These functions compress data in successive blocks of any size, using previous blocks as dictionary. + One key assumption is that previous blocks (up to 64 KB) remain read-accessible while compressing next blocks. + There is an exception for ring buffers, which can be smaller 64 KB. + Such case is automatically detected and correctly handled by LZ4_compress_HC_continue(). + + Before starting compression, state must be properly initialized, using LZ4_resetStreamHC(). + A first "fictional block" can then be designated as initial dictionary, using LZ4_loadDictHC() (Optional). + + Then, use LZ4_compress_HC_continue() to compress each successive block. + It works like LZ4_compress_HC(), but use previous memory blocks as dictionary to improve compression. + Previous memory blocks (including initial dictionary when present) must remain accessible and unmodified during compression. + As a reminder, size 'dst' buffer to handle worst cases, using LZ4_compressBound(), to ensure success of compression operation. + + If, for any reason, previous data blocks can't be preserved unmodified in memory during next compression block, + you must save it to a safer memory space, using LZ4_saveDictHC(). + Return value of LZ4_saveDictHC() is the size of dictionary effectively saved into 'safeBuffer'. +*/ + + + +/************************************** +* Deprecated Functions +**************************************/ +/* Deprecate Warnings */ +/* Should these warnings messages be a problem, + it is generally possible to disable them, + with -Wno-deprecated-declarations for gcc + or _CRT_SECURE_NO_WARNINGS in Visual for example. + You can also define LZ4_DEPRECATE_WARNING_DEFBLOCK. */ +#ifndef LZ4_DEPRECATE_WARNING_DEFBLOCK +# define LZ4_DEPRECATE_WARNING_DEFBLOCK +# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +# if (LZ4_GCC_VERSION >= 405) || defined(__clang__) +# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) +# elif (LZ4_GCC_VERSION >= 301) +# define LZ4_DEPRECATED(message) __attribute__((deprecated)) +# elif defined(_MSC_VER) +# define LZ4_DEPRECATED(message) __declspec(deprecated(message)) +# else +# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") +# define LZ4_DEPRECATED(message) +# endif +#endif // LZ4_DEPRECATE_WARNING_DEFBLOCK + +/* compression functions */ +/* these functions are planned to trigger warning messages by r131 approximately */ +int LZ4_compressHC (const char* source, char* dest, int inputSize); +int LZ4_compressHC_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize); +int LZ4_compressHC2 (const char* source, char* dest, int inputSize, int compressionLevel); +int LZ4_compressHC2_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +int LZ4_compressHC_withStateHC (void* state, const char* source, char* dest, int inputSize); +int LZ4_compressHC_limitedOutput_withStateHC (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); +int LZ4_compressHC2_withStateHC (void* state, const char* source, char* dest, int inputSize, int compressionLevel); +int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +int LZ4_compressHC_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize); +int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize, int maxOutputSize); + +/* Streaming functions following the older model; should no longer be used */ +LZ4_DEPRECATED("use LZ4_createStreamHC() instead") void* LZ4_createHC (char* inputBuffer); +LZ4_DEPRECATED("use LZ4_saveDictHC() instead") char* LZ4_slideInputBufferHC (void* LZ4HC_Data); +LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") int LZ4_freeHC (void* LZ4HC_Data); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") int LZ4_compressHC2_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_createStreamHC() instead") int LZ4_sizeofStreamStateHC(void); +LZ4_DEPRECATED("use LZ4_resetStreamHC() instead") int LZ4_resetStreamStateHC(void* state, char* inputBuffer); + + +#if defined (__cplusplus) +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/lib/xxhash.c b/thirdparty/Lz4/Lz4_131/lib/xxhash.c new file mode 100644 index 0000000..e6fb8f1 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/xxhash.c @@ -0,0 +1,915 @@ +/* +xxHash - Fast Hash algorithm +Copyright (C) 2012-2015, Yann Collet + +BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +You can contact the author at : +- xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + + +/************************************** +* Tuning parameters +**************************************/ +/* Unaligned memory access is automatically enabled for "common" CPU, such as x86. + * For others CPU, the compiler will be more cautious, and insert extra code to ensure aligned access is respected. + * If you know your target CPU supports unaligned memory access, you want to force this option manually to improve performance. + * You can also enable this parameter if you know your input data will always be aligned (boundaries of 4, for U32). + */ +#if defined(__ARM_FEATURE_UNALIGNED) || defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) +# define XXH_USE_UNALIGNED_ACCESS 1 +#endif + +/* XXH_ACCEPT_NULL_INPUT_POINTER : + * If the input pointer is a null pointer, xxHash default behavior is to trigger a memory access error, since it is a bad pointer. + * When this option is enabled, xxHash output for null input pointers will be the same as a null-length input. + * By default, this option is disabled. To enable it, uncomment below define : + */ +/* #define XXH_ACCEPT_NULL_INPUT_POINTER 1 */ + +/* XXH_FORCE_NATIVE_FORMAT : + * By default, xxHash library provides endian-independant Hash values, based on little-endian convention. + * Results are therefore identical for little-endian and big-endian CPU. + * This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format. + * Should endian-independance be of no importance for your application, you may set the #define below to 1. + * It will improve speed for Big-endian CPU. + * This option has no impact on Little_Endian CPU. + */ +#define XXH_FORCE_NATIVE_FORMAT 0 + + +/************************************** +* Compiler Specific Options +***************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# define FORCE_INLINE static __forceinline +#else +# if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# ifdef __GNUC__ +# define FORCE_INLINE static inline __attribute__((always_inline)) +# else +# define FORCE_INLINE static inline +# endif +# else +# define FORCE_INLINE static +# endif /* __STDC_VERSION__ */ +#endif + + +/************************************** +* Includes & Memory related functions +***************************************/ +#include "xxhash.h" +/* Modify the local functions below should you wish to use some other memory routines */ +/* for malloc(), free() */ +#include +static void* XXH_malloc(size_t s) { return malloc(s); } +static void XXH_free (void* p) { free(p); } +/* for memcpy() */ +#include +static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); } + + +/************************************** +* Basic Types +***************************************/ +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + +static U32 XXH_read32(const void* memPtr) +{ + U32 val32; + memcpy(&val32, memPtr, 4); + return val32; +} + +static U64 XXH_read64(const void* memPtr) +{ + U64 val64; + memcpy(&val64, memPtr, 8); + return val64; +} + + + +/****************************************** +* Compiler-specific Functions and Macros +******************************************/ +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) + +/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */ +#if defined(_MSC_VER) +# define XXH_rotl32(x,r) _rotl(x,r) +# define XXH_rotl64(x,r) _rotl64(x,r) +#else +# define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r))) +# define XXH_rotl64(x,r) ((x << r) | (x >> (64 - r))) +#endif + +#if defined(_MSC_VER) /* Visual Studio */ +# define XXH_swap32 _byteswap_ulong +# define XXH_swap64 _byteswap_uint64 +#elif GCC_VERSION >= 403 +# define XXH_swap32 __builtin_bswap32 +# define XXH_swap64 __builtin_bswap64 +#else +static U32 XXH_swap32 (U32 x) +{ + return ((x << 24) & 0xff000000 ) | + ((x << 8) & 0x00ff0000 ) | + ((x >> 8) & 0x0000ff00 ) | + ((x >> 24) & 0x000000ff ); +} +static U64 XXH_swap64 (U64 x) +{ + return ((x << 56) & 0xff00000000000000ULL) | + ((x << 40) & 0x00ff000000000000ULL) | + ((x << 24) & 0x0000ff0000000000ULL) | + ((x << 8) & 0x000000ff00000000ULL) | + ((x >> 8) & 0x00000000ff000000ULL) | + ((x >> 24) & 0x0000000000ff0000ULL) | + ((x >> 40) & 0x000000000000ff00ULL) | + ((x >> 56) & 0x00000000000000ffULL); +} +#endif + + +/*************************************** +* Architecture Macros +***************************************/ +typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess; +#ifndef XXH_CPU_LITTLE_ENDIAN /* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example using a compiler switch */ +static const int one = 1; +# define XXH_CPU_LITTLE_ENDIAN (*(const char*)(&one)) +#endif + + +/***************************** +* Memory reads +*****************************/ +typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment; + +FORCE_INLINE U32 XXH_readLE32_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read32(ptr) : XXH_swap32(XXH_read32(ptr)); + else + return endian==XXH_littleEndian ? *(const U32*)ptr : XXH_swap32(*(const U32*)ptr); +} + +FORCE_INLINE U32 XXH_readLE32(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE32_align(ptr, endian, XXH_unaligned); +} + +FORCE_INLINE U64 XXH_readLE64_align(const void* ptr, XXH_endianess endian, XXH_alignment align) +{ + if (align==XXH_unaligned) + return endian==XXH_littleEndian ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr)); + else + return endian==XXH_littleEndian ? *(const U64*)ptr : XXH_swap64(*(const U64*)ptr); +} + +FORCE_INLINE U64 XXH_readLE64(const void* ptr, XXH_endianess endian) +{ + return XXH_readLE64_align(ptr, endian, XXH_unaligned); +} + + +/*************************************** +* Macros +***************************************/ +#define XXH_STATIC_ASSERT(c) { enum { XXH_static_assert = 1/(!!(c)) }; } /* use only *after* variable declarations */ + + +/*************************************** +* Constants +***************************************/ +#define PRIME32_1 2654435761U +#define PRIME32_2 2246822519U +#define PRIME32_3 3266489917U +#define PRIME32_4 668265263U +#define PRIME32_5 374761393U + +#define PRIME64_1 11400714785074694791ULL +#define PRIME64_2 14029467366897019727ULL +#define PRIME64_3 1609587929392839161ULL +#define PRIME64_4 9650029242287828579ULL +#define PRIME64_5 2870177450012600261ULL + + +/***************************** +* Simple Hash Functions +*****************************/ +FORCE_INLINE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U32 h32; +#define XXH_get32bits(p) XXH_readLE32_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) + { + len=0; + bEnd=p=(const BYTE*)(size_t)16; + } +#endif + + if (len>=16) + { + const BYTE* const limit = bEnd - 16; + U32 v1 = seed + PRIME32_1 + PRIME32_2; + U32 v2 = seed + PRIME32_2; + U32 v3 = seed + 0; + U32 v4 = seed - PRIME32_1; + + do + { + v1 += XXH_get32bits(p) * PRIME32_2; + v1 = XXH_rotl32(v1, 13); + v1 *= PRIME32_1; + p+=4; + v2 += XXH_get32bits(p) * PRIME32_2; + v2 = XXH_rotl32(v2, 13); + v2 *= PRIME32_1; + p+=4; + v3 += XXH_get32bits(p) * PRIME32_2; + v3 = XXH_rotl32(v3, 13); + v3 *= PRIME32_1; + p+=4; + v4 += XXH_get32bits(p) * PRIME32_2; + v4 = XXH_rotl32(v4, 13); + v4 *= PRIME32_1; + p+=4; + } + while (p<=limit); + + h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18); + } + else + { + h32 = seed + PRIME32_5; + } + + h32 += (U32) len; + + while (p+4<=bEnd) + { + h32 += XXH_get32bits(p) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4 ; + p+=4; + } + + while (p> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +unsigned XXH32 (const void* input, size_t len, unsigned seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH32_state_t state; + XXH32_reset(&state, seed); + XXH32_update(&state, input, len); + return XXH32_digest(&state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + +# if !defined(XXH_USE_UNALIGNED_ACCESS) + if ((((size_t)input) & 3) == 0) /* Input is 4-bytes aligned, leverage the speed benefit */ + { + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } +# endif + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH32_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + +FORCE_INLINE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH_endianess endian, XXH_alignment align) +{ + const BYTE* p = (const BYTE*)input; + const BYTE* bEnd = p + len; + U64 h64; +#define XXH_get64bits(p) XXH_readLE64_align(p, endian, align) + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (p==NULL) + { + len=0; + bEnd=p=(const BYTE*)(size_t)32; + } +#endif + + if (len>=32) + { + const BYTE* const limit = bEnd - 32; + U64 v1 = seed + PRIME64_1 + PRIME64_2; + U64 v2 = seed + PRIME64_2; + U64 v3 = seed + 0; + U64 v4 = seed - PRIME64_1; + + do + { + v1 += XXH_get64bits(p) * PRIME64_2; + p+=8; + v1 = XXH_rotl64(v1, 31); + v1 *= PRIME64_1; + v2 += XXH_get64bits(p) * PRIME64_2; + p+=8; + v2 = XXH_rotl64(v2, 31); + v2 *= PRIME64_1; + v3 += XXH_get64bits(p) * PRIME64_2; + p+=8; + v3 = XXH_rotl64(v3, 31); + v3 *= PRIME64_1; + v4 += XXH_get64bits(p) * PRIME64_2; + p+=8; + v4 = XXH_rotl64(v4, 31); + v4 *= PRIME64_1; + } + while (p<=limit); + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + + v1 *= PRIME64_2; + v1 = XXH_rotl64(v1, 31); + v1 *= PRIME64_1; + h64 ^= v1; + h64 = h64 * PRIME64_1 + PRIME64_4; + + v2 *= PRIME64_2; + v2 = XXH_rotl64(v2, 31); + v2 *= PRIME64_1; + h64 ^= v2; + h64 = h64 * PRIME64_1 + PRIME64_4; + + v3 *= PRIME64_2; + v3 = XXH_rotl64(v3, 31); + v3 *= PRIME64_1; + h64 ^= v3; + h64 = h64 * PRIME64_1 + PRIME64_4; + + v4 *= PRIME64_2; + v4 = XXH_rotl64(v4, 31); + v4 *= PRIME64_1; + h64 ^= v4; + h64 = h64 * PRIME64_1 + PRIME64_4; + } + else + { + h64 = seed + PRIME64_5; + } + + h64 += (U64) len; + + while (p+8<=bEnd) + { + U64 k1 = XXH_get64bits(p); + k1 *= PRIME64_2; + k1 = XXH_rotl64(k1,31); + k1 *= PRIME64_1; + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) + { + h64 ^= (U64)(XXH_get32bits(p)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + + +unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed) +{ +#if 0 + /* Simple version, good for code maintenance, but unfortunately slow for small inputs */ + XXH64_state_t state; + XXH64_reset(&state, seed); + XXH64_update(&state, input, len); + return XXH64_digest(&state); +#else + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + +# if !defined(XXH_USE_UNALIGNED_ACCESS) + if ((((size_t)input) & 7)==0) /* Input is aligned, let's leverage the speed advantage */ + { + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_aligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_aligned); + } +# endif + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_endian_align(input, len, seed, XXH_littleEndian, XXH_unaligned); + else + return XXH64_endian_align(input, len, seed, XXH_bigEndian, XXH_unaligned); +#endif +} + +/**************************************************** +* Advanced Hash Functions +****************************************************/ + +/*** Allocation ***/ +typedef struct +{ + U64 total_len; + U32 seed; + U32 v1; + U32 v2; + U32 v3; + U32 v4; + U32 mem32[4]; /* defined as U32 for alignment */ + U32 memsize; +} XXH_istate32_t; + +typedef struct +{ + U64 total_len; + U64 seed; + U64 v1; + U64 v2; + U64 v3; + U64 v4; + U64 mem64[4]; /* defined as U64 for alignment */ + U32 memsize; +} XXH_istate64_t; + + +XXH32_state_t* XXH32_createState(void) +{ + XXH_STATIC_ASSERT(sizeof(XXH32_state_t) >= sizeof(XXH_istate32_t)); /* A compilation error here means XXH32_state_t is not large enough */ + return (XXH32_state_t*)XXH_malloc(sizeof(XXH32_state_t)); +} +XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + +XXH64_state_t* XXH64_createState(void) +{ + XXH_STATIC_ASSERT(sizeof(XXH64_state_t) >= sizeof(XXH_istate64_t)); /* A compilation error here means XXH64_state_t is not large enough */ + return (XXH64_state_t*)XXH_malloc(sizeof(XXH64_state_t)); +} +XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr) +{ + XXH_free(statePtr); + return XXH_OK; +} + + +/*** Hash feed ***/ + +XXH_errorcode XXH32_reset(XXH32_state_t* state_in, U32 seed) +{ + XXH_istate32_t* state = (XXH_istate32_t*) state_in; + state->seed = seed; + state->v1 = seed + PRIME32_1 + PRIME32_2; + state->v2 = seed + PRIME32_2; + state->v3 = seed + 0; + state->v4 = seed - PRIME32_1; + state->total_len = 0; + state->memsize = 0; + return XXH_OK; +} + +XXH_errorcode XXH64_reset(XXH64_state_t* state_in, unsigned long long seed) +{ + XXH_istate64_t* state = (XXH_istate64_t*) state_in; + state->seed = seed; + state->v1 = seed + PRIME64_1 + PRIME64_2; + state->v2 = seed + PRIME64_2; + state->v3 = seed + 0; + state->v4 = seed - PRIME64_1; + state->total_len = 0; + state->memsize = 0; + return XXH_OK; +} + + +FORCE_INLINE XXH_errorcode XXH32_update_endian (XXH32_state_t* state_in, const void* input, size_t len, XXH_endianess endian) +{ + XXH_istate32_t* state = (XXH_istate32_t *) state_in; + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len += len; + + if (state->memsize + len < 16) /* fill in tmp buffer */ + { + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, len); + state->memsize += (U32)len; + return XXH_OK; + } + + if (state->memsize) /* some data left from previous update */ + { + XXH_memcpy((BYTE*)(state->mem32) + state->memsize, input, 16-state->memsize); + { + const U32* p32 = state->mem32; + state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; + state->v1 = XXH_rotl32(state->v1, 13); + state->v1 *= PRIME32_1; + p32++; + state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; + state->v2 = XXH_rotl32(state->v2, 13); + state->v2 *= PRIME32_1; + p32++; + state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; + state->v3 = XXH_rotl32(state->v3, 13); + state->v3 *= PRIME32_1; + p32++; + state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; + state->v4 = XXH_rotl32(state->v4, 13); + state->v4 *= PRIME32_1; + p32++; + } + p += 16-state->memsize; + state->memsize = 0; + } + + if (p <= bEnd-16) + { + const BYTE* const limit = bEnd - 16; + U32 v1 = state->v1; + U32 v2 = state->v2; + U32 v3 = state->v3; + U32 v4 = state->v4; + + do + { + v1 += XXH_readLE32(p, endian) * PRIME32_2; + v1 = XXH_rotl32(v1, 13); + v1 *= PRIME32_1; + p+=4; + v2 += XXH_readLE32(p, endian) * PRIME32_2; + v2 = XXH_rotl32(v2, 13); + v2 *= PRIME32_1; + p+=4; + v3 += XXH_readLE32(p, endian) * PRIME32_2; + v3 = XXH_rotl32(v3, 13); + v3 *= PRIME32_1; + p+=4; + v4 += XXH_readLE32(p, endian) * PRIME32_2; + v4 = XXH_rotl32(v4, 13); + v4 *= PRIME32_1; + p+=4; + } + while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) + { + XXH_memcpy(state->mem32, p, bEnd-p); + state->memsize = (int)(bEnd-p); + } + + return XXH_OK; +} + +XXH_errorcode XXH32_update (XXH32_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH32_update_endian(state_in, input, len, XXH_bigEndian); +} + + + +FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t* state_in, XXH_endianess endian) +{ + const XXH_istate32_t* state = (const XXH_istate32_t*) state_in; + const BYTE * p = (const BYTE*)state->mem32; + const BYTE* bEnd = (const BYTE*)(state->mem32) + state->memsize; + U32 h32; + + if (state->total_len >= 16) + { + h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18); + } + else + { + h32 = state->seed + PRIME32_5; + } + + h32 += (U32) state->total_len; + + while (p+4<=bEnd) + { + h32 += XXH_readLE32(p, endian) * PRIME32_3; + h32 = XXH_rotl32(h32, 17) * PRIME32_4; + p+=4; + } + + while (p> 15; + h32 *= PRIME32_2; + h32 ^= h32 >> 13; + h32 *= PRIME32_3; + h32 ^= h32 >> 16; + + return h32; +} + + +U32 XXH32_digest (const XXH32_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH32_digest_endian(state_in, XXH_littleEndian); + else + return XXH32_digest_endian(state_in, XXH_bigEndian); +} + + +FORCE_INLINE XXH_errorcode XXH64_update_endian (XXH64_state_t* state_in, const void* input, size_t len, XXH_endianess endian) +{ + XXH_istate64_t * state = (XXH_istate64_t *) state_in; + const BYTE* p = (const BYTE*)input; + const BYTE* const bEnd = p + len; + +#ifdef XXH_ACCEPT_NULL_INPUT_POINTER + if (input==NULL) return XXH_ERROR; +#endif + + state->total_len += len; + + if (state->memsize + len < 32) /* fill in tmp buffer */ + { + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, len); + state->memsize += (U32)len; + return XXH_OK; + } + + if (state->memsize) /* some data left from previous update */ + { + XXH_memcpy(((BYTE*)state->mem64) + state->memsize, input, 32-state->memsize); + { + const U64* p64 = state->mem64; + state->v1 += XXH_readLE64(p64, endian) * PRIME64_2; + state->v1 = XXH_rotl64(state->v1, 31); + state->v1 *= PRIME64_1; + p64++; + state->v2 += XXH_readLE64(p64, endian) * PRIME64_2; + state->v2 = XXH_rotl64(state->v2, 31); + state->v2 *= PRIME64_1; + p64++; + state->v3 += XXH_readLE64(p64, endian) * PRIME64_2; + state->v3 = XXH_rotl64(state->v3, 31); + state->v3 *= PRIME64_1; + p64++; + state->v4 += XXH_readLE64(p64, endian) * PRIME64_2; + state->v4 = XXH_rotl64(state->v4, 31); + state->v4 *= PRIME64_1; + p64++; + } + p += 32-state->memsize; + state->memsize = 0; + } + + if (p+32 <= bEnd) + { + const BYTE* const limit = bEnd - 32; + U64 v1 = state->v1; + U64 v2 = state->v2; + U64 v3 = state->v3; + U64 v4 = state->v4; + + do + { + v1 += XXH_readLE64(p, endian) * PRIME64_2; + v1 = XXH_rotl64(v1, 31); + v1 *= PRIME64_1; + p+=8; + v2 += XXH_readLE64(p, endian) * PRIME64_2; + v2 = XXH_rotl64(v2, 31); + v2 *= PRIME64_1; + p+=8; + v3 += XXH_readLE64(p, endian) * PRIME64_2; + v3 = XXH_rotl64(v3, 31); + v3 *= PRIME64_1; + p+=8; + v4 += XXH_readLE64(p, endian) * PRIME64_2; + v4 = XXH_rotl64(v4, 31); + v4 *= PRIME64_1; + p+=8; + } + while (p<=limit); + + state->v1 = v1; + state->v2 = v2; + state->v3 = v3; + state->v4 = v4; + } + + if (p < bEnd) + { + XXH_memcpy(state->mem64, p, bEnd-p); + state->memsize = (int)(bEnd-p); + } + + return XXH_OK; +} + +XXH_errorcode XXH64_update (XXH64_state_t* state_in, const void* input, size_t len) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_update_endian(state_in, input, len, XXH_littleEndian); + else + return XXH64_update_endian(state_in, input, len, XXH_bigEndian); +} + + + +FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state_in, XXH_endianess endian) +{ + const XXH_istate64_t * state = (const XXH_istate64_t *) state_in; + const BYTE * p = (const BYTE*)state->mem64; + const BYTE* bEnd = (const BYTE*)state->mem64 + state->memsize; + U64 h64; + + if (state->total_len >= 32) + { + U64 v1 = state->v1; + U64 v2 = state->v2; + U64 v3 = state->v3; + U64 v4 = state->v4; + + h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18); + + v1 *= PRIME64_2; + v1 = XXH_rotl64(v1, 31); + v1 *= PRIME64_1; + h64 ^= v1; + h64 = h64*PRIME64_1 + PRIME64_4; + + v2 *= PRIME64_2; + v2 = XXH_rotl64(v2, 31); + v2 *= PRIME64_1; + h64 ^= v2; + h64 = h64*PRIME64_1 + PRIME64_4; + + v3 *= PRIME64_2; + v3 = XXH_rotl64(v3, 31); + v3 *= PRIME64_1; + h64 ^= v3; + h64 = h64*PRIME64_1 + PRIME64_4; + + v4 *= PRIME64_2; + v4 = XXH_rotl64(v4, 31); + v4 *= PRIME64_1; + h64 ^= v4; + h64 = h64*PRIME64_1 + PRIME64_4; + } + else + { + h64 = state->seed + PRIME64_5; + } + + h64 += (U64) state->total_len; + + while (p+8<=bEnd) + { + U64 k1 = XXH_readLE64(p, endian); + k1 *= PRIME64_2; + k1 = XXH_rotl64(k1,31); + k1 *= PRIME64_1; + h64 ^= k1; + h64 = XXH_rotl64(h64,27) * PRIME64_1 + PRIME64_4; + p+=8; + } + + if (p+4<=bEnd) + { + h64 ^= (U64)(XXH_readLE32(p, endian)) * PRIME64_1; + h64 = XXH_rotl64(h64, 23) * PRIME64_2 + PRIME64_3; + p+=4; + } + + while (p> 33; + h64 *= PRIME64_2; + h64 ^= h64 >> 29; + h64 *= PRIME64_3; + h64 ^= h64 >> 32; + + return h64; +} + + +unsigned long long XXH64_digest (const XXH64_state_t* state_in) +{ + XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN; + + if ((endian_detected==XXH_littleEndian) || XXH_FORCE_NATIVE_FORMAT) + return XXH64_digest_endian(state_in, XXH_littleEndian); + else + return XXH64_digest_endian(state_in, XXH_bigEndian); +} + + diff --git a/thirdparty/Lz4/Lz4_131/lib/xxhash.h b/thirdparty/Lz4/Lz4_131/lib/xxhash.h new file mode 100644 index 0000000..c60aa61 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lib/xxhash.h @@ -0,0 +1,192 @@ +/* + xxHash - Extremely Fast Hash algorithm + Header File + Copyright (C) 2012-2015, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + +/* Notice extracted from xxHash homepage : + +xxHash is an extremely fast Hash algorithm, running at RAM speed limits. +It also successfully passes all tests from the SMHasher suite. + +Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) + +Name Speed Q.Score Author +xxHash 5.4 GB/s 10 +CrapWow 3.2 GB/s 2 Andrew +MumurHash 3a 2.7 GB/s 10 Austin Appleby +SpookyHash 2.0 GB/s 10 Bob Jenkins +SBox 1.4 GB/s 9 Bret Mulvey +Lookup3 1.2 GB/s 9 Bob Jenkins +SuperFastHash 1.2 GB/s 1 Paul Hsieh +CityHash64 1.05 GB/s 10 Pike & Alakuijala +FNV 0.55 GB/s 5 Fowler, Noll, Vo +CRC32 0.43 GB/s 9 +MD5-32 0.33 GB/s 10 Ronald L. Rivest +SHA1-32 0.28 GB/s 10 + +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. +10 is a perfect score. + +A 64-bits version, named XXH64, is available since r35. +It offers much better speed, but for 64-bits applications only. +Name Speed on 64 bits Speed on 32 bits +XXH64 13.8 GB/s 1.9 GB/s +XXH32 6.8 GB/s 6.0 GB/s +*/ + +#pragma once + +#if defined (__cplusplus) +extern "C" { +#endif + + +/***************************** +* Definitions +*****************************/ +#include /* size_t */ +typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + + +/***************************** +* Namespace Emulation +*****************************/ +/* Motivations : + +If you need to include xxHash into your library, +but wish to avoid xxHash symbols to be present on your library interface +in an effort to avoid potential name collision if another library also includes xxHash, + +you can use XXH_NAMESPACE, which will automatically prefix any symbol from xxHash +with the value of XXH_NAMESPACE (so avoid to keep it NULL, and avoid numeric values). + +Note that no change is required within the calling program : +it can still call xxHash functions using their regular name. +They will be automatically translated by this header. +*/ +#ifdef XXH_NAMESPACE +# define XXH_CAT(A,B) A##B +# define XXH_NAME2(A,B) XXH_CAT(A,B) +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +#endif + + +/***************************** +* Simple Hash Functions +*****************************/ + +unsigned int XXH32 (const void* input, size_t length, unsigned seed); +unsigned long long XXH64 (const void* input, size_t length, unsigned long long seed); + +/* +XXH32() : + Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input". + The memory between input & input+length must be valid (allocated and read-accessible). + "seed" can be used to alter the result predictably. + This function successfully passes all SMHasher tests. + Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s +XXH64() : + Calculate the 64-bits hash of sequence of length "len" stored at memory address "input". + Faster on 64-bits systems. Slower on 32-bits systems. +*/ + + + +/***************************** +* Advanced Hash Functions +*****************************/ +typedef struct { long long ll[ 6]; } XXH32_state_t; +typedef struct { long long ll[11]; } XXH64_state_t; + +/* +These structures allow static allocation of XXH states. +States must then be initialized using XXHnn_reset() before first use. + +If you prefer dynamic allocation, please refer to functions below. +*/ + +XXH32_state_t* XXH32_createState(void); +XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); + +XXH64_state_t* XXH64_createState(void); +XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); + +/* +These functions create and release memory for XXH state. +States must then be initialized using XXHnn_reset() before first use. +*/ + + +XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned seed); +XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); +unsigned int XXH32_digest (const XXH32_state_t* statePtr); + +XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); +XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); +unsigned long long XXH64_digest (const XXH64_state_t* statePtr); + +/* +These functions calculate the xxHash of an input provided in multiple smaller packets, +as opposed to an input provided as a single block. + +XXH state space must first be allocated, using either static or dynamic method provided above. + +Start a new hash by initializing state with a seed, using XXHnn_reset(). + +Then, feed the hash state by calling XXHnn_update() as many times as necessary. +Obviously, input must be valid, meaning allocated and read accessible. +The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. + +Finally, you can produce a hash anytime, by using XXHnn_digest(). +This function returns the final nn-bits hash. +You can nonetheless continue feeding the hash state with more input, +and therefore get some new hashes, by calling again XXHnn_digest(). + +When you are done, don't forget to free XXH state space, using typically XXHnn_freeState(). +*/ + + +#if defined (__cplusplus) +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/lz4_32.lib b/thirdparty/Lz4/Lz4_131/lz4_32.lib new file mode 100644 index 0000000..b84990b Binary files /dev/null and b/thirdparty/Lz4/Lz4_131/lz4_32.lib differ diff --git a/thirdparty/Lz4/Lz4_131/lz4_64.lib b/thirdparty/Lz4/Lz4_131/lz4_64.lib new file mode 100644 index 0000000..6fb261c Binary files /dev/null and b/thirdparty/Lz4/Lz4_131/lz4_64.lib differ diff --git a/thirdparty/Lz4/Lz4_131/lz4_Block_format.md b/thirdparty/Lz4/Lz4_131/lz4_Block_format.md new file mode 100644 index 0000000..ea568d8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lz4_Block_format.md @@ -0,0 +1,127 @@ +LZ4 Block Format Description +============================ +Last revised: 2015-05-07. +Author : Yann Collet + + +This specification is intended for developers +willing to produce LZ4-compatible compressed data blocks +using any programming language. + +LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding. +There is no entropy encoder back-end nor framing layer. +The latter is assumed to be handled by other parts of the system (see [LZ4 Frame format]). +This design is assumed to favor simplicity and speed. +It helps later on for optimizations, compactness, and features. + +This document describes only the block format, +not how the compressor nor decompressor actually work. +The correctness of the decompressor should not depend +on implementation details of the compressor, and vice versa. + +[LZ4 Frame format]: LZ4_Frame_format.md + + + +Compressed block format +----------------------- +An LZ4 compressed block is composed of sequences. +A sequence is a suite of literals (not-compressed bytes), +followed by a match copy. + +Each sequence starts with a token. +The token is a one byte value, separated into two 4-bits fields. +Therefore each field ranges from 0 to 15. + + +The first field uses the 4 high-bits of the token. +It provides the length of literals to follow. + +If the field value is 0, then there is no literal. +If it is 15, then we need to add some more bytes to indicate the full length. +Each additional byte then represent a value from 0 to 255, +which is added to the previous value to produce a total length. +When the byte value is 255, another byte is output. +There can be any number of bytes following the token. There is no "size limit". +(Side note : this is why a not-compressible input block is expanded by 0.4%). + +Example 1 : A length of 48 will be represented as : + + - 15 : value for the 4-bits High field + - 33 : (=48-15) remaining length to reach 48 + +Example 2 : A length of 280 will be represented as : + + - 15 : value for the 4-bits High field + - 255 : following byte is maxed, since 280-15 >= 255 + - 10 : (=280 - 15 - 255) ) remaining length to reach 280 + +Example 3 : A length of 15 will be represented as : + + - 15 : value for the 4-bits High field + - 0 : (=15-15) yes, the zero must be output + +Following the token and optional length bytes, are the literals themselves. +They are exactly as numerous as previously decoded (length of literals). +It's possible that there are zero literal. + + +Following the literals is the match copy operation. + +It starts by the offset. +This is a 2 bytes value, in little endian format +(the 1st byte is the "low" byte, the 2nd one is the "high" byte). + +The offset represents the position of the match to be copied from. +1 means "current position - 1 byte". +The maximum offset value is 65535, 65536 cannot be coded. +Note that 0 is an invalid value, not used. + +Then we need to extract the match length. +For this, we use the second token field, the low 4-bits. +Value, obviously, ranges from 0 to 15. +However here, 0 means that the copy operation will be minimal. +The minimum length of a match, called minmatch, is 4. +As a consequence, a 0 value means 4 bytes, and a value of 15 means 19+ bytes. +Similar to literal length, on reaching the highest possible value (15), +we output additional bytes, one at a time, with values ranging from 0 to 255. +They are added to total to provide the final match length. +A 255 value means there is another byte to read and add. +There is no limit to the number of optional bytes that can be output this way. +(This points towards a maximum achievable compression ratio of about 250). + +With the offset and the matchlength, +the decoder can now proceed to copy the data from the already decoded buffer. +On decoding the matchlength, we reach the end of the compressed sequence, +and therefore start another one. + + +Parsing restrictions +----------------------- +There are specific parsing rules to respect in order to remain compatible +with assumptions made by the decoder : + +1. The last 5 bytes are always literals +2. The last match must start at least 12 bytes before end of block. + Consequently, a block with less than 13 bytes cannot be compressed. + +These rules are in place to ensure that the decoder +will never read beyond the input buffer, nor write beyond the output buffer. + +Note that the last sequence is also incomplete, +and stops right after literals. + + +Additional notes +----------------------- +There is no assumption nor limits to the way the compressor +searches and selects matches within the source data block. +It could be a fast scan, a multi-probe, a full search using BST, +standard hash chains or MMC, well whatever. + +Advanced parsing strategies can also be implemented, such as lazy match, +or full optimal parsing. + +All these trade-off offer distinctive speed/memory/compression advantages. +Whatever the method used by the compressor, its result will be decodable +by any LZ4 decoder if it follows the format specification described above. diff --git a/thirdparty/Lz4/Lz4_131/lz4_Frame_format.md b/thirdparty/Lz4/Lz4_131/lz4_Frame_format.md new file mode 100644 index 0000000..73d3cba --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/lz4_Frame_format.md @@ -0,0 +1,385 @@ +LZ4 Frame Format Description +============================ + +###Notices + +Copyright (c) 2013-2015 Yann Collet + +Permission is granted to copy and distribute this document +for any purpose and without charge, +including translations into other languages +and incorporation into compilations, +provided that the copyright notice and this notice are preserved, +and that any substantive changes or deletions from the original +are clearly marked. +Distribution of this document is unlimited. + +###Version + +1.5.1 (31/03/2015) + + +Introduction +------------ + +The purpose of this document is to define a lossless compressed data format, +that is independent of CPU type, operating system, +file system and character set, suitable for +File compression, Pipe and streaming compression +using the [LZ4 algorithm](http://www.lz4.info). + +The data can be produced or consumed, +even for an arbitrarily long sequentially presented input data stream, +using only an a priori bounded amount of intermediate storage, +and hence can be used in data communications. +The format uses the LZ4 compression method, +and optional [xxHash-32 checksum method](https://github.com/Cyan4973/xxHash), +for detection of data corruption. + +The data format defined by this specification +does not attempt to allow random access to compressed data. + +This specification is intended for use by implementers of software +to compress data into LZ4 format and/or decompress data from LZ4 format. +The text of the specification assumes a basic background in programming +at the level of bits and other primitive data representations. + +Unless otherwise indicated below, +a compliant compressor must produce data sets +that conform to the specifications presented here. +It doesn’t need to support all options though. + +A compliant decompressor must be able to decompress +at least one working set of parameters +that conforms to the specifications presented here. +It may also ignore checksums. +Whenever it does not support a specific parameter within the compressed stream, +it must produce a non-ambiguous error code +and associated error message explaining which parameter is unsupported. + + +General Structure of LZ4 Frame format +------------------------------------- + +| MagicNb | F. Descriptor | Block | (...) | EndMark | C. Checksum | +|:-------:|:-------------:| ----- | ----- | ------- | ----------- | +| 4 bytes | 3-11 bytes | | | 4 bytes | 4 bytes | + +__Magic Number__ + +4 Bytes, Little endian format. +Value : 0x184D2204 + +__Frame Descriptor__ + +3 to 11 Bytes, to be detailed in the next part. +Most important part of the spec. + +__Data Blocks__ + +To be detailed later on. +That’s where compressed data is stored. + +__EndMark__ + +The flow of blocks ends when the last data block has a size of “0”. +The size is expressed as a 32-bits value. + +__Content Checksum__ + +Content Checksum verify that the full content has been decoded correctly. +The content checksum is the result +of [xxh32() hash function](https://github.com/Cyan4973/xxHash) +digesting the original (decoded) data as input, and a seed of zero. +Content checksum is only present when its associated flag +is set in the frame descriptor. +Content Checksum validates the result, +that all blocks were fully transmitted in the correct order and without error, +and also that the encoding/decoding process itself generated no distortion. +Its usage is recommended. + +__Frame Concatenation__ + +In some circumstances, it may be preferable to append multiple frames, +for example in order to add new data to an existing compressed file +without re-framing it. + +In such case, each frame has its own set of descriptor flags. +Each frame is considered independent. +The only relation between frames is their sequential order. + +The ability to decode multiple concatenated frames +within a single stream or file +is left outside of this specification. +As an example, the reference lz4 command line utility behavior is +to decode all concatenated frames in their sequential order. + + +Frame Descriptor +---------------- + +| FLG | BD | (Content Size) | HC | +| ------- | ------- |:--------------:| ------- | +| 1 byte | 1 byte | 0 - 8 bytes | 1 byte | + +The descriptor uses a minimum of 3 bytes, +and up to 11 bytes depending on optional parameters. + +__FLG byte__ + +| BitNb | 7-6 | 5 | 4 | 3 | 2 | 1-0 | +| ------- | ------- | ------- | --------- | ------- | --------- | -------- | +|FieldName| Version | B.Indep | B.Checksum| C.Size | C.Checksum|*Reserved*| + + +__BD byte__ + +| BitNb | 7 | 6-5-4 | 3-2-1-0 | +| ------- | -------- | ------------ | -------- | +|FieldName|*Reserved*| Block MaxSize|*Reserved*| + +In the tables, bit 7 is highest bit, while bit 0 is lowest. + +__Version Number__ + +2-bits field, must be set to “01”. +Any other value cannot be decoded by this version of the specification. +Other version numbers will use different flag layouts. + +__Block Independence flag__ + +If this flag is set to “1”, blocks are independent. +If this flag is set to “0”, each block depends on previous ones +(up to LZ4 window size, which is 64 KB). +In such case, it’s necessary to decode all blocks in sequence. + +Block dependency improves compression ratio, especially for small blocks. +On the other hand, it makes direct jumps or multi-threaded decoding impossible. + +__Block checksum flag__ + +If this flag is set, each data block will be followed by a 4-bytes checksum, +calculated by using the xxHash-32 algorithm on the raw (compressed) data block. +The intention is to detect data corruption (storage or transmission errors) +immediately, before decoding. +Block checksum usage is optional. + +__Content Size flag__ + +If this flag is set, the uncompressed size of data included within the frame +will be present as an 8 bytes unsigned little endian value, after the flags. +Content Size usage is optional. + +__Content checksum flag__ + +If this flag is set, a content checksum will be appended after the EndMark. + +Recommended value : “1” (content checksum is present) + +__Block Maximum Size__ + +This information is intended to help the decoder allocate memory. +Size here refers to the original (uncompressed) data size. +Block Maximum Size is one value among the following table : + +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +| --- | --- | --- | --- | ----- | ------ | ---- | ---- | +| N/A | N/A | N/A | N/A | 64 KB | 256 KB | 1 MB | 4 MB | + +The decoder may refuse to allocate block sizes above a (system-specific) size. +Unused values may be used in a future revision of the spec. +A decoder conformant to the current version of the spec +is only able to decode blocksizes defined in this spec. + +__Reserved bits__ + +Value of reserved bits **must** be 0 (zero). +Reserved bit might be used in a future version of the specification, +typically enabling new optional features. +If this happens, a decoder respecting the current version of the specification +shall not be able to decode such a frame. + +__Content Size__ + +This is the original (uncompressed) size. +This information is optional, and only present if the associated flag is set. +Content size is provided using unsigned 8 Bytes, for a maximum of 16 HexaBytes. +Format is Little endian. +This value is informational, typically for display or memory allocation. +It can be skipped by a decoder, or used to validate content correctness. + +__Header Checksum__ + +One-byte checksum of combined descriptor fields, including optional ones. +The value is the second byte of xxh32() : ` (xxh32()>>8) & 0xFF ` +using zero as a seed, +and the full Frame Descriptor as an input +(including optional fields when they are present). +A wrong checksum indicates an error in the descriptor. +Header checksum is informational and can be skipped. + + +Data Blocks +----------- + +| Block Size | data | (Block Checksum) | +|:----------:| ------ |:----------------:| +| 4 bytes | | 0 - 4 bytes | + + +__Block Size__ + +This field uses 4-bytes, format is little-endian. + +The highest bit is “1” if data in the block is uncompressed. + +The highest bit is “0” if data in the block is compressed by LZ4. + +All other bits give the size, in bytes, of the following data block +(the size does not include the block checksum if present). + +Block Size shall never be larger than Block Maximum Size. +Such a thing could happen for incompressible source data. +In such case, such a data block shall be passed in uncompressed format. + +__Data__ + +Where the actual data to decode stands. +It might be compressed or not, depending on previous field indications. +Uncompressed size of Data can be any size, up to “block maximum size”. +Note that data block is not necessarily full : +an arbitrary “flush” may happen anytime. Any block can be “partially filled”. + +__Block checksum__ + +Only present if the associated flag is set. +This is a 4-bytes checksum value, in little endian format, +calculated by using the xxHash-32 algorithm on the raw (undecoded) data block, +and a seed of zero. +The intention is to detect data corruption (storage or transmission errors) +before decoding. + +Block checksum is cumulative with Content checksum. + + +Skippable Frames +---------------- + +| Magic Number | Frame Size | User Data | +|:------------:|:----------:| --------- | +| 4 bytes | 4 bytes | | + +Skippable frames allow the integration of user-defined data +into a flow of concatenated frames. +Its design is pretty straightforward, +with the sole objective to allow the decoder to quickly skip +over user-defined data and continue decoding. + +For the purpose of facilitating identification, +it is discouraged to start a flow of concatenated frames with a skippable frame. +If there is a need to start such a flow with some user data +encapsulated into a skippable frame, +it’s recommended to start with a zero-byte LZ4 frame +followed by a skippable frame. +This will make it easier for file type identifiers. + + +__Magic Number__ + +4 Bytes, Little endian format. +Value : 0x184D2A5X, which means any value from 0x184D2A50 to 0x184D2A5F. +All 16 values are valid to identify a skippable frame. + +__Frame Size__ + +This is the size, in bytes, of the following User Data +(without including the magic number nor the size field itself). +4 Bytes, Little endian format, unsigned 32-bits. +This means User Data can’t be bigger than (2^32-1) Bytes. + +__User Data__ + +User Data can be anything. Data will just be skipped by the decoder. + + +Legacy frame +------------ + +The Legacy frame format was defined into the initial versions of “LZ4Demo”. +Newer compressors should not use this format anymore, as it is too restrictive. + +Main characteristics of the legacy format : + +- Fixed block size : 8 MB. +- All blocks must be completely filled, except the last one. +- All blocks are always compressed, even when compression is detrimental. +- The last block is detected either because + it is followed by the “EOF” (End of File) mark, + or because it is followed by a known Frame Magic Number. +- No checksum +- Convention is Little endian + +| MagicNb | B.CSize | CData | B.CSize | CData | (...) | EndMark | +| ------- | ------- | ----- | ------- | ----- | ------- | ------- | +| 4 bytes | 4 bytes | CSize | 4 bytes | CSize | x times | EOF | + + +__Magic Number__ + +4 Bytes, Little endian format. +Value : 0x184C2102 + +__Block Compressed Size__ + +This is the size, in bytes, of the following compressed data block. +4 Bytes, Little endian format. + +__Data__ + +Where the actual compressed data stands. +Data is always compressed, even when compression is detrimental. + +__EndMark__ + +End of legacy frame is implicit only. +It must be followed by a standard EOF (End Of File) signal, +wether it is a file or a stream. + +Alternatively, if the frame is followed by a valid Frame Magic Number, +it is considered completed. +It makes legacy frames compatible with frame concatenation. + +Any other value will be interpreted as a block size, +and trigger an error if it does not fit within acceptable range. + + +Version changes +--------------- + +1.5.1 : changed format to MarkDown compatible + +1.5 : removed Dictionary ID from specification + +1.4.1 : changed wording from “stream” to “frame” + +1.4 : added skippable streams, re-added stream checksum + +1.3 : modified header checksum + +1.2 : reduced choice of “block size”, to postpone decision on “dynamic size of BlockSize Field”. + +1.1 : optional fields are now part of the descriptor + +1.0 : changed “block size” specification, adding a compressed/uncompressed flag + +0.9 : reduced scale of “block maximum size” table + +0.8 : removed : high compression flag + +0.7 : removed : stream checksum + +0.6 : settled : stream size uses 8 bytes, endian convention is little endian + +0.5: added copyright notice + +0.4 : changed format to Google Doc compatible OpenDocument \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/programs/.gitignore b/thirdparty/Lz4/Lz4_131/programs/.gitignore new file mode 100644 index 0000000..f7fc991 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/.gitignore @@ -0,0 +1,2 @@ +/lz4 +/*.exe diff --git a/thirdparty/Lz4/Lz4_131/programs/COPYING b/thirdparty/Lz4/Lz4_131/programs/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/thirdparty/Lz4/Lz4_131/programs/Makefile b/thirdparty/Lz4/Lz4_131/programs/Makefile new file mode 100644 index 0000000..f422902 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/Makefile @@ -0,0 +1,310 @@ +# ########################################################################## +# LZ4 programs - Makefile +# Copyright (C) Yann Collet 2011-2015 +# +# GPL v2 License +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# You can contact the author at : +# - LZ4 source repository : https://github.com/Cyan4973/lz4 +# - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +# ########################################################################## +# lz4 : Command Line Utility, supporting gzip-like arguments +# lz4c : CLU, supporting also legacy lz4demo arguments +# lz4c32: Same as lz4c, but forced to compile in 32-bits mode +# fuzzer : Test tool, to check lz4 integrity on target platform +# fuzzer32: Same as fuzzer, but forced to compile in 32-bits mode +# frametest : Test tool, to check lz4frame integrity on target platform +# frametest32: Same as frametest, but forced to compile in 32-bits mode +# fullbench : Precisely measure speed for each LZ4 function variant +# fullbench32: Same as fullbench, but forced to compile in 32-bits mode +# datagen : generates synthetic data samples for tests & benchmarks +# ########################################################################## + +RELEASE?= r131 + +DESTDIR?= +PREFIX ?= /usr/local +CFLAGS ?= -O3 +CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"$(RELEASE)\" +FLAGS := -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) + +BINDIR := $(PREFIX)/bin +MANDIR := $(PREFIX)/share/man/man1 +LZ4DIR := ../lib + + +# Define *.exe as extension for Windows systems +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +VOID = nul +else +EXT = +VOID = /dev/null +endif + + +# Select test target for Travis CI's Build Matrix +TRAVIS_TARGET:= $(LZ4_TRAVIS_CI_ENV) +TEST_FILES := COPYING +TEST_TARGETS := test-native +FUZZER_TIME := -T9mn + + +default: lz4 + +m32: lz4c32 fullbench32 fuzzer32 frametest32 + +bins: lz4 lz4c fullbench fuzzer frametest datagen + +all: bins m32 + +lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c + $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) + +lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c + $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT) + +fullbench : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +fullbench32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c + $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + +fuzzer : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +fuzzer32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c fuzzer.c + $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + +frametest: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +frametest32: $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c frametest.c + $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + +datagen : datagen.c datagencli.c + $(CC) $(FLAGS) $^ -o $@$(EXT) + +clean: + @rm -f core *.o *.test tmp* \ + lz4$(EXT) lz4c$(EXT) lz4c32$(EXT) \ + fullbench$(EXT) fullbench32$(EXT) \ + fuzzer$(EXT) fuzzer32$(EXT) \ + frametest$(EXT) frametest32$(EXT) \ + datagen$(EXT) + @echo Cleaning completed + + +#------------------------------------------------------------------------ +#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) + +install: lz4 lz4c + @echo Installing binaries + @install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/ + @install -m 755 lz4 $(DESTDIR)$(BINDIR)/lz4 + @ln -sf lz4 $(DESTDIR)$(BINDIR)/lz4cat + @ln -sf lz4 $(DESTDIR)$(BINDIR)/unlz4 + @install -m 755 lz4c $(DESTDIR)$(BINDIR)/lz4c + @echo Installing man pages + @install -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1 + @ln -sf lz4.1 $(DESTDIR)$(MANDIR)/lz4c.1 + @ln -sf lz4.1 $(DESTDIR)$(MANDIR)/lz4cat.1 + @ln -sf lz4.1 $(DESTDIR)$(MANDIR)/unlz4.1 + @echo lz4 installation completed + +uninstall: + rm -f $(DESTDIR)$(BINDIR)/lz4cat + rm -f $(DESTDIR)$(BINDIR)/unlz4 + [ -x $(DESTDIR)$(BINDIR)/lz4 ] && rm -f $(DESTDIR)$(BINDIR)/lz4 + [ -x $(DESTDIR)$(BINDIR)/lz4c ] && rm -f $(DESTDIR)$(BINDIR)/lz4c + [ -f $(DESTDIR)$(MANDIR)/lz4.1 ] && rm -f $(DESTDIR)$(MANDIR)/lz4.1 + rm -f $(DESTDIR)$(MANDIR)/lz4c.1 + rm -f $(DESTDIR)$(MANDIR)/lz4cat.1 + rm -f $(DESTDIR)$(MANDIR)/unlz4.1 + @echo lz4 programs successfully uninstalled + +test: test-lz4 test-lz4c test-frametest test-fullbench test-fuzzer test-mem + +test32: test-lz4c32 test-frametest32 test-fullbench32 test-fuzzer32 test-mem32 + +test-all: test test32 + +test-travis: $(TRAVIS_TARGET) + +test-lz4-sparse: lz4 datagen + @echo "\n ---- test sparse file support ----" + ./datagen -g5M -P100 > tmpSrc + ./lz4 -B4D tmpSrc | ./lz4 -dv --sparse > tmpB4 + diff -s tmpSrc tmpB4 + ./lz4 -B5D tmpSrc | ./lz4 -dv --sparse > tmpB5 + diff -s tmpSrc tmpB5 + ./lz4 -B6D tmpSrc | ./lz4 -dv --sparse > tmpB6 + diff -s tmpSrc tmpB6 + ./lz4 -B7D tmpSrc | ./lz4 -dv --sparse > tmpB7 + diff -s tmpSrc tmpB7 + ./lz4 tmpSrc | ./lz4 -dv --no-sparse > tmpNoSparse + diff -s tmpSrc tmpNoSparse + ls -ls tmp* + ./datagen -s1 -g1200007 -P100 | ./lz4 | ./lz4 -dv --sparse > tmpOdd # Odd size file (to not finish on an exact nb of blocks) + ./datagen -s1 -g1200007 -P100 | diff -s - tmpOdd + ls -ls tmpOdd + @rm tmp* + @echo "\n Compatibility with Console :" + echo "Hello World 1 !" | ./lz4 | ./lz4 -d -c + echo "Hello World 2 !" | ./lz4 | ./lz4 -d | cat + echo "Hello World 3 !" | ./lz4 --no-frame-crc | ./lz4 -d -c + @echo "\n Compatibility with Append :" + ./datagen -P100 -g1M > tmp1M + cat tmp1M tmp1M > tmp2M + ./lz4 -B5 -v tmp1M tmpC + ./lz4 -d -v tmpC tmpR + ./lz4 -d -v tmpC >> tmpR + ls -ls tmp* + diff tmp2M tmpR + @rm tmp* + + + +test-lz4-contentSize: lz4 datagen + @echo "\n ---- test original size support ----" + ./datagen -g15M > tmp + ./lz4 -v tmp | ./lz4 -t + ./lz4 -v --content-size tmp | ./lz4 -d > tmp2 + diff -s tmp tmp2 + # test large size [2-4] GB + @./datagen -g3G -P100 | ./lz4 | ./lz4 --decompress --force --sparse - tmp + @ls -ls tmp + ./lz4 --quiet --content-size tmp | ./lz4 --verbose --decompress --force --sparse - tmp2 + @ls -ls tmp2 + @rm tmp* + +test-lz4-frame-concatenation: lz4 datagen + @echo "\n ---- test frame concatenation ----" + @echo -n > empty.test + @echo hi > nonempty.test + cat nonempty.test empty.test nonempty.test > orig.test + @./lz4 -zq empty.test > empty.lz4.test + @./lz4 -zq nonempty.test > nonempty.lz4.test + cat nonempty.lz4.test empty.lz4.test nonempty.lz4.test > concat.lz4.test + ./lz4 -d concat.lz4.test > result.test + sdiff orig.test result.test + @rm *.test + @echo frame concatenation test completed + +test-lz4-multiple: lz4 datagen + @echo "\n ---- test multiple files ----" + @./datagen -s1 > tmp1 2> $(VOID) + @./datagen -s2 -g100K > tmp2 2> $(VOID) + @./datagen -s3 -g1M > tmp3 2> $(VOID) + ./lz4 -f -m tmp* + ls -ls tmp* + rm tmp1 tmp2 tmp3 + ./lz4 -df -m *.lz4 + ls -ls tmp* + ./lz4 -f -m tmp1 notHere tmp2; echo $$? + @rm tmp* + +test-lz4-basic: lz4 datagen + @echo "\n ---- test lz4 basic compression/decompression ----" + ./datagen -g0 | ./lz4 -v | ./lz4 -t + ./datagen -g16KB | ./lz4 -9 | ./lz4 -t + ./datagen -g20KB > tmpSrc + ./lz4 < tmpSrc | ./lz4 -d > tmpRes + diff -q tmpSrc tmpRes + ./lz4 --no-frame-crc < tmpSrc | ./lz4 -d > tmpRes + diff -q tmpSrc tmpRes + ./datagen | ./lz4 | ./lz4 -t + ./datagen -g6M -P99 | ./lz4 -9BD | ./lz4 -t + ./datagen -g17M | ./lz4 -9v | ./lz4 -qt + ./datagen -g33M | ./lz4 --no-frame-crc | ./lz4 -t + ./datagen -g256MB | ./lz4 -vqB4D | ./lz4 -t + ./datagen -g6GB | ./lz4 -vqB5D | ./lz4 -qt + ./datagen -g6GB | ./lz4 -vq9BD | ./lz4 -qt + @rm tmp* + +test-lz4: lz4 datagen test-lz4-basic test-lz4-multiple test-lz4-sparse test-lz4-contentSize test-lz4-frame-concatenation + @echo "\n ---- test pass-through ----" + ./datagen | ./lz4 -tf + +test-lz4c: lz4c datagen + @echo "\n ---- test lz4c version ----" + ./datagen -g256MB | ./lz4c -l -v | ./lz4c -t + +test-interop-32-64: lz4 lz4c32 datagen + @echo "\n ---- test interoperability 32-bits -vs- 64 bits ----" + ./datagen -g16KB | ./lz4c32 -9 | ./lz4 -t + ./datagen -P10 | ./lz4 -9B4 | ./lz4c32 -t + ./datagen | ./lz4c32 | ./lz4 -t + ./datagen -g1M | ./lz4 -3B5 | ./lz4c32 -t + ./datagen -g256MB | ./lz4c32 -vqB4D | ./lz4 -qt + ./datagen -g1G -P90 | ./lz4 | ./lz4c32 -t + ./datagen -g6GB | ./lz4c32 -vq9BD | ./lz4 -qt + +test-lz4c32-basic: lz4c32 datagen + @echo "\n ---- test lz4c32 32-bits version ----" + ./datagen -g16KB | ./lz4c32 -9 | ./lz4c32 -t + ./datagen | ./lz4c32 | ./lz4c32 -t + ./datagen -g256MB | ./lz4c32 -vqB4D | ./lz4c32 -qt + ./datagen -g6GB | ./lz4c32 -vqB5D | ./lz4c32 -qt + +test-lz4c32: test-lz4c32-basic test-interop-32-64 + +test-fullbench: fullbench + ./fullbench --no-prompt $(NB_LOOPS) $(TEST_FILES) + +test-fullbench32: fullbench32 + ./fullbench32 --no-prompt $(NB_LOOPS) $(TEST_FILES) + +test-fuzzer: fuzzer + ./fuzzer $(FUZZER_TIME) + +test-fuzzer32: fuzzer32 + ./fuzzer32 $(FUZZER_TIME) + +test-frametest: frametest + ./frametest $(FUZZER_TIME) + +test-frametest32: frametest32 + ./frametest32 $(FUZZER_TIME) + +test-mem: lz4 datagen fuzzer frametest fullbench + @echo "\n ---- valgrind tests : memory analyzer ----" + valgrind --leak-check=yes --error-exitcode=1 ./datagen -g50M > $(VOID) + ./datagen -g16KB > tmp + valgrind --leak-check=yes --error-exitcode=1 ./lz4 -9 -BD -f tmp $(VOID) + ./datagen -g16KB -s2 > tmp2 + ./datagen -g16KB -s3 > tmp3 + valgrind --leak-check=yes --error-exitcode=1 ./lz4 --force --multiple tmp tmp2 tmp3 + ./datagen -g16MB > tmp + valgrind --leak-check=yes --error-exitcode=1 ./lz4 -9 -B5D -f tmp tmp2 + valgrind --leak-check=yes --error-exitcode=1 ./lz4 -t tmp2 + valgrind --leak-check=yes --error-exitcode=1 ./lz4 -bi1 tmp + valgrind --leak-check=yes --error-exitcode=1 ./fullbench -i1 tmp tmp2 + ./datagen -g256MB > tmp + valgrind --leak-check=yes --error-exitcode=1 ./lz4 -B4D -f -vq tmp $(VOID) + rm tmp* + valgrind --leak-check=yes --error-exitcode=1 ./fuzzer -i64 -t1 + valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256 + +test-mem32: lz4c32 datagen +# unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system... + +endif diff --git a/thirdparty/Lz4/Lz4_131/programs/bench.c b/thirdparty/Lz4/Lz4_131/programs/bench.c new file mode 100644 index 0000000..9f949c4 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/bench.c @@ -0,0 +1,437 @@ +/* + bench.c - Demo program to benchmark open-source compression algorithms + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Compiler Options +***************************************/ +#if defined(_MSC_VER) || defined(_WIN32) +# define _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_DEPRECATE /* VS2005 */ +# define BMK_LEGACY_TIMER 1 /* S_ISREG & gettimeofday() are not supported by MSVC */ +#endif + +/* Unix Large Files support (>4GB) */ +#define _FILE_OFFSET_BITS 64 +#if (defined(__sun__) && (!defined(__LP64__))) /* Sun Solaris 32-bits requires specific definitions */ +# define _LARGEFILE_SOURCE +#elif ! defined(__LP64__) /* No point defining Large file for 64 bit */ +# define _LARGEFILE64_SOURCE +#endif + + +/************************************** +* Includes +***************************************/ +#include /* malloc */ +#include /* fprintf, fopen, ftello64 */ +#include /* stat64 */ +#include /* stat64 */ + +/* Use ftime() if gettimeofday() is not available on your target */ +#if defined(BMK_LEGACY_TIMER) +# include /* timeb, ftime */ +#else +# include /* gettimeofday */ +#endif + +#include "lz4.h" +#define COMPRESSOR0 LZ4_compress_local +static int LZ4_compress_local(const char* src, char* dst, int srcSize, int dstSize, int clevel) { (void)clevel; return LZ4_compress_default(src, dst, srcSize, dstSize); } +#include "lz4hc.h" +#define COMPRESSOR1 LZ4_compress_HC +#define DEFAULTCOMPRESSOR COMPRESSOR0 + +#include "xxhash.h" + + +/************************************** +* Compiler specifics +***************************************/ +#if !defined(S_ISREG) +# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) +#endif + + +/************************************** +* Basic Types +***************************************/ +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + + +/************************************** +* Constants +***************************************/ +#define NBLOOPS 3 +#define TIMELOOP 2000 + +#define KB *(1 <<10) +#define MB *(1 <<20) +#define GB *(1U<<30) + +#define MAX_MEM (2 GB - 64 MB) +#define DEFAULT_CHUNKSIZE (4 MB) + + +/************************************** +* Local structures +***************************************/ +struct chunkParameters +{ + U32 id; + char* origBuffer; + char* compressedBuffer; + int origSize; + int compressedSize; +}; + +struct compressionParameters +{ + int (*compressionFunction)(const char* src, char* dst, int srcSize, int dstSize, int cLevel); + int (*decompressionFunction)(const char* src, char* dst, int dstSize); +}; + + +/************************************** +* MACRO +***************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) + + +/************************************** +* Benchmark Parameters +***************************************/ +static int chunkSize = DEFAULT_CHUNKSIZE; +static int nbIterations = NBLOOPS; +static int BMK_pause = 0; + +void BMK_setBlocksize(int bsize) { chunkSize = bsize; } + +void BMK_setNbIterations(int nbLoops) +{ + nbIterations = nbLoops; + DISPLAY("- %i iterations -\n", nbIterations); +} + +void BMK_setPause(void) { BMK_pause = 1; } + + +/********************************************************* +* Private functions +**********************************************************/ + +#if defined(BMK_LEGACY_TIMER) + +static int BMK_GetMilliStart(void) +{ + /* Based on Legacy ftime() + Rolls over every ~ 12.1 days (0x100000/24/60/60) + Use GetMilliSpan to correct for rollover */ + struct timeb tb; + int nCount; + ftime( &tb ); + nCount = (int) (tb.millitm + (tb.time & 0xfffff) * 1000); + return nCount; +} + +#else + +static int BMK_GetMilliStart(void) +{ + /* Based on newer gettimeofday() + Use GetMilliSpan to correct for rollover */ + struct timeval tv; + int nCount; + gettimeofday(&tv, NULL); + nCount = (int) (tv.tv_usec/1000 + (tv.tv_sec & 0xfffff) * 1000); + return nCount; +} + +#endif + + +static int BMK_GetMilliSpan( int nTimeStart ) +{ + int nSpan = BMK_GetMilliStart() - nTimeStart; + if ( nSpan < 0 ) + nSpan += 0x100000 * 1000; + return nSpan; +} + + +static size_t BMK_findMaxMem(U64 requiredMem) +{ + size_t step = 64 MB; + BYTE* testmem=NULL; + + requiredMem = (((requiredMem >> 26) + 1) << 26); + requiredMem += 2*step; + if (requiredMem > MAX_MEM) requiredMem = MAX_MEM; + + while (!testmem) + { + if (requiredMem > step) requiredMem -= step; + else requiredMem >>= 1; + testmem = (BYTE*) malloc ((size_t)requiredMem); + } + free (testmem); + + /* keep some space available */ + if (requiredMem > step) requiredMem -= step; + else requiredMem >>= 1; + + return (size_t)requiredMem; +} + + +static U64 BMK_GetFileSize(const char* infilename) +{ + int r; +#if defined(_MSC_VER) + struct _stat64 statbuf; + r = _stat64(infilename, &statbuf); +#else + struct stat statbuf; + r = stat(infilename, &statbuf); +#endif + if (r || !S_ISREG(statbuf.st_mode)) return 0; /* No good... */ + return (U64)statbuf.st_size; +} + + +/********************************************************* +* Public function +**********************************************************/ + +int BMK_benchFiles(const char** fileNamesTable, int nbFiles, int cLevel) +{ + int fileIdx=0; + char* orig_buff; + struct compressionParameters compP; + int cfunctionId; + + U64 totals = 0; + U64 totalz = 0; + double totalc = 0.; + double totald = 0.; + + + /* Init */ + if (cLevel <= 3) cfunctionId = 0; else cfunctionId = 1; + switch (cfunctionId) + { +#ifdef COMPRESSOR0 + case 0 : compP.compressionFunction = COMPRESSOR0; break; +#endif +#ifdef COMPRESSOR1 + case 1 : compP.compressionFunction = COMPRESSOR1; break; +#endif + default : compP.compressionFunction = DEFAULTCOMPRESSOR; + } + compP.decompressionFunction = LZ4_decompress_fast; + + /* Loop for each file */ + while (fileIdx inFileSize) benchedSize = (size_t)inFileSize; + if (benchedSize < inFileSize) + { + DISPLAY("Not enough memory for '%s' full size; testing %i MB only...\n", inFileName, (int)(benchedSize>>20)); + } + + /* Alloc */ + chunkP = (struct chunkParameters*) malloc(((benchedSize / (size_t)chunkSize)+1) * sizeof(struct chunkParameters)); + orig_buff = (char*)malloc((size_t)benchedSize); + nbChunks = (int) ((int)benchedSize / chunkSize) + 1; + maxCompressedChunkSize = LZ4_compressBound(chunkSize); + compressedBuffSize = nbChunks * maxCompressedChunkSize; + compressedBuffer = (char*)malloc((size_t)compressedBuffSize); + + if (!orig_buff || !compressedBuffer) + { + DISPLAY("\nError: not enough memory!\n"); + free(orig_buff); + free(compressedBuffer); + free(chunkP); + fclose(inFile); + return 12; + } + + /* Init chunks data */ + { + int i; + size_t remaining = benchedSize; + char* in = orig_buff; + char* out = compressedBuffer; + for (i=0; i chunkSize) { chunkP[i].origSize = chunkSize; remaining -= chunkSize; } else { chunkP[i].origSize = (int)remaining; remaining = 0; } + chunkP[i].compressedBuffer = out; out += maxCompressedChunkSize; + chunkP[i].compressedSize = 0; + } + } + + /* Fill input buffer */ + DISPLAY("Loading %s... \r", inFileName); + readSize = fread(orig_buff, 1, benchedSize, inFile); + fclose(inFile); + + if (readSize != benchedSize) + { + DISPLAY("\nError: problem reading file '%s' !! \n", inFileName); + free(orig_buff); + free(compressedBuffer); + free(chunkP); + return 13; + } + + /* Calculating input Checksum */ + crcOrig = XXH32(orig_buff, (unsigned int)benchedSize,0); + + + /* Bench */ + { + int loopNb, chunkNb; + size_t cSize=0; + double fastestC = 100000000., fastestD = 100000000.; + double ratio=0.; + U32 crcCheck=0; + + DISPLAY("\r%79s\r", ""); + for (loopNb = 1; loopNb <= nbIterations; loopNb++) + { + int nbLoops; + int milliTime; + + /* Compression */ + DISPLAY("%1i-%-14.14s : %9i ->\r", loopNb, inFileName, (int)benchedSize); + { size_t i; for (i=0; i %9i (%5.2f%%),%7.1f MB/s\r", loopNb, inFileName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / fastestC / 1000.); + + /* Decompression */ + { size_t i; for (i=0; i %9i (%5.2f%%),%7.1f MB/s ,%7.1f MB/s \r", loopNb, inFileName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / fastestC / 1000., (double)benchedSize / fastestD / 1000.); + + /* CRC Checking */ + crcCheck = XXH32(orig_buff, (unsigned int)benchedSize,0); + if (crcOrig!=crcCheck) { DISPLAY("\n!!! WARNING !!! %14s : Invalid Checksum : %x != %x\n", inFileName, (unsigned)crcOrig, (unsigned)crcCheck); break; } + } + + if (crcOrig==crcCheck) + { + if (ratio<100.) + DISPLAY("%-16.16s : %9i -> %9i (%5.2f%%),%7.1f MB/s ,%7.1f MB/s \n", inFileName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / fastestC / 1000., (double)benchedSize / fastestD / 1000.); + else + DISPLAY("%-16.16s : %9i -> %9i (%5.1f%%),%7.1f MB/s ,%7.1f MB/s \n", inFileName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / fastestC / 1000., (double)benchedSize / fastestD / 1000.); + } + totals += benchedSize; + totalz += cSize; + totalc += fastestC; + totald += fastestD; + } + + free(orig_buff); + free(compressedBuffer); + free(chunkP); + } + + if (nbFiles > 1) + DISPLAY("%-16.16s :%10llu ->%10llu (%5.2f%%), %6.1f MB/s , %6.1f MB/s\n", " TOTAL", (long long unsigned int)totals, (long long unsigned int)totalz, (double)totalz/(double)totals*100., (double)totals/totalc/1000., (double)totals/totald/1000.); + + if (BMK_pause) { DISPLAY("\npress enter...\n"); (void)getchar(); } + + return 0; +} + + + diff --git a/thirdparty/Lz4/Lz4_131/programs/bench.h b/thirdparty/Lz4/Lz4_131/programs/bench.h new file mode 100644 index 0000000..c04fb17 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/bench.h @@ -0,0 +1,33 @@ +/* + bench.h - Demo program to benchmark open-source compression algorithm + Copyright (C) Yann Collet 2012-2015 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +#pragma once + + +/* Main function */ +int BMK_benchFiles(const char** fileNamesTable, int nbFiles, int cLevel); + +/* Set Parameters */ +void BMK_setBlocksize(int bsize); +void BMK_setNbIterations(int nbLoops); +void BMK_setPause(void); + diff --git a/thirdparty/Lz4/Lz4_131/programs/datagen.c b/thirdparty/Lz4/Lz4_131/programs/datagen.c new file mode 100644 index 0000000..9df9da8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/datagen.c @@ -0,0 +1,227 @@ +/* + datagen.c - compressible data generator test tool + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - ZSTD source repository : https://github.com/Cyan4973/zstd + - Public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Includes +**************************************/ +#include /* malloc */ +#include /* FILE, fwrite */ +#include /* memcpy */ + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + + +/************************************** +* OS-specific Includes +**************************************/ +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) +# include /* _O_BINARY */ +# include /* _setmode, _isatty */ +# define SET_BINARY_MODE(file) _setmode(_fileno(file), _O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + + +/************************************** +* Constants +**************************************/ +#define KB *(1 <<10) + +#define PRIME1 2654435761U +#define PRIME2 2246822519U + + +/************************************** +* Local types +**************************************/ +#define LTLOG 13 +#define LTSIZE (1<> (32 - r))) +static unsigned int RDG_rand(U32* src) +{ + U32 rand32 = *src; + rand32 *= PRIME1; + rand32 ^= PRIME2; + rand32 = RDG_rotl32(rand32, 13); + *src = rand32; + return rand32; +} + + +static void RDG_fillLiteralDistrib(litDistribTable lt, double ld) +{ + U32 i = 0; + BYTE character = '0'; + BYTE firstChar = '('; + BYTE lastChar = '}'; + + if (ld==0.0) + { + character = 0; + firstChar = 0; + lastChar =255; + } + while (i LTSIZE) weight = LTSIZE-i; + end = i + weight; + while (i < end) lt[i++] = character; + character++; + if (character > lastChar) character = firstChar; + } +} + + +static BYTE RDG_genChar(U32* seed, const litDistribTable lt) +{ + U32 id = RDG_rand(seed) & LTMASK; + return (lt[id]); +} + + +#define RDG_DICTSIZE (32 KB) +#define RDG_RAND15BITS ((RDG_rand(seed) >> 3) & 32767) +#define RDG_RANDLENGTH ( ((RDG_rand(seed) >> 7) & 7) ? (RDG_rand(seed) & 15) : (RDG_rand(seed) & 511) + 15) +void RDG_genBlock(void* buffer, size_t buffSize, size_t prefixSize, double matchProba, litDistribTable lt, unsigned* seedPtr) +{ + BYTE* buffPtr = (BYTE*)buffer; + const U32 matchProba32 = (U32)(32768 * matchProba); + size_t pos = prefixSize; + U32* seed = seedPtr; + + /* special case */ + while (matchProba >= 1.0) + { + size_t size0 = RDG_rand(seed) & 3; + size0 = (size_t)1 << (16 + size0 * 2); + size0 += RDG_rand(seed) & (size0-1); /* because size0 is power of 2*/ + if (buffSize < pos + size0) + { + memset(buffPtr+pos, 0, buffSize-pos); + return; + } + memset(buffPtr+pos, 0, size0); + pos += size0; + buffPtr[pos-1] = RDG_genChar(seed, lt); + } + + /* init */ + if (pos==0) buffPtr[0] = RDG_genChar(seed, lt), pos=1; + + /* Generate compressible data */ + while (pos < buffSize) + { + /* Select : Literal (char) or Match (within 32K) */ + if (RDG_RAND15BITS < matchProba32) + { + /* Copy (within 32K) */ + size_t match; + size_t d; + int length = RDG_RANDLENGTH + 4; + U32 offset = RDG_RAND15BITS + 1; + if (offset > pos) offset = (U32)pos; + match = pos - offset; + d = pos + length; + if (d > buffSize) d = buffSize; + while (pos < d) buffPtr[pos++] = buffPtr[match++]; + } + else + { + /* Literal (noise) */ + size_t d; + size_t length = RDG_RANDLENGTH; + d = pos + length; + if (d > buffSize) d = buffSize; + while (pos < d) buffPtr[pos++] = RDG_genChar(seed, lt); + } + } +} + + +void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba, unsigned seed) +{ + litDistribTable lt; + if (litProba==0.0) litProba = matchProba / 4.5; + RDG_fillLiteralDistrib(lt, litProba); + RDG_genBlock(buffer, size, 0, matchProba, lt, &seed); +} + + +#define RDG_BLOCKSIZE (128 KB) +void RDG_genOut(unsigned long long size, double matchProba, double litProba, unsigned seed) +{ + BYTE buff[RDG_DICTSIZE + RDG_BLOCKSIZE]; + U64 total = 0; + size_t genBlockSize = RDG_BLOCKSIZE; + litDistribTable lt; + + /* init */ + if (litProba==0.0) litProba = matchProba / 4.5; + RDG_fillLiteralDistrib(lt, litProba); + SET_BINARY_MODE(stdout); + + /* Generate dict */ + RDG_genBlock(buff, RDG_DICTSIZE, 0, matchProba, lt, &seed); + + /* Generate compressible data */ + while (total < size) + { + RDG_genBlock(buff, RDG_DICTSIZE+RDG_BLOCKSIZE, RDG_DICTSIZE, matchProba, lt, &seed); + if (size-total < RDG_BLOCKSIZE) genBlockSize = (size_t)(size-total); + total += genBlockSize; + fwrite(buff, 1, genBlockSize, stdout); + /* update dict */ + memcpy(buff, buff + RDG_BLOCKSIZE, RDG_DICTSIZE); + } +} diff --git a/thirdparty/Lz4/Lz4_131/programs/datagen.h b/thirdparty/Lz4/Lz4_131/programs/datagen.h new file mode 100644 index 0000000..631d146 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/datagen.h @@ -0,0 +1,40 @@ +/* + datagen.h - compressible data generator header + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - ZSTD source repository : https://github.com/Cyan4973/zstd + - Public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + + +#include /* size_t */ + +void RDG_genOut(unsigned long long size, double matchProba, double litProba, unsigned seed); +void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba, unsigned seed); +/* RDG_genOut + Generate 'size' bytes of compressible data into stdout. + Compressibility can be controlled using 'matchProba'. + 'LitProba' is optional, and affect variability of bytes. If litProba==0.0, default value is used. + Generated data can be selected using 'seed'. + If (matchProba, litProba and seed) are equal, the function always generate the same content. + + RDG_genBuffer + Same as RDG_genOut, but generate data into provided buffer +*/ diff --git a/thirdparty/Lz4/Lz4_131/programs/datagencli.c b/thirdparty/Lz4/Lz4_131/programs/datagencli.c new file mode 100644 index 0000000..601cb0a --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/datagencli.c @@ -0,0 +1,193 @@ +/* + datagencli.c + compressible data command line generator + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - ZSTD source repository : https://github.com/Cyan4973/zstd + - Public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Includes +**************************************/ +#include /* fprintf, stderr */ +#include "datagen.h" /* RDG_generate */ + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + + +/************************************** +* Constants +**************************************/ +#ifndef ZSTD_VERSION +# define ZSTD_VERSION "r1" +#endif + +#define KB *(1 <<10) +#define MB *(1 <<20) +#define GB *(1U<<30) + +#define SIZE_DEFAULT (64 KB) +#define SEED_DEFAULT 0 +#define COMPRESSIBILITY_DEFAULT 50 + + +/************************************** +* Macros +**************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); } +static unsigned displayLevel = 2; + + +/********************************************************* +* Command line +*********************************************************/ +static int usage(char* programName) +{ + DISPLAY( "Compressible data generator\n"); + DISPLAY( "Usage :\n"); + DISPLAY( " %s [size] [args]\n", programName); + DISPLAY( "\n"); + DISPLAY( "Arguments :\n"); + DISPLAY( " -g# : generate # data (default:%i)\n", SIZE_DEFAULT); + DISPLAY( " -s# : Select seed (default:%i)\n", SEED_DEFAULT); + DISPLAY( " -P# : Select compressibility in %% (default:%i%%)\n", COMPRESSIBILITY_DEFAULT); + DISPLAY( " -h : display help and exit\n"); + DISPLAY( "Special values :\n"); + DISPLAY( " -P0 : generate incompressible noise\n"); + DISPLAY( " -P100 : generate sparse files\n"); + return 0; +} + + +int main(int argc, char** argv) +{ + int argNb; + double proba = (double)COMPRESSIBILITY_DEFAULT / 100; + double litProba = 0.0; + U64 size = SIZE_DEFAULT; + U32 seed = SEED_DEFAULT; + char* programName; + + /* Check command line */ + programName = argv[0]; + for(argNb=1; argNb='0') && (*argument<='9')) + { + size *= 10; + size += *argument - '0'; + argument++; + } + if (*argument=='K') { size <<= 10; argument++; } + if (*argument=='M') { size <<= 20; argument++; } + if (*argument=='G') { size <<= 30; argument++; } + if (*argument=='B') { argument++; } + break; + case 's': + argument++; + seed=0; + while ((*argument>='0') && (*argument<='9')) + { + seed *= 10; + seed += *argument - '0'; + argument++; + } + break; + case 'P': + argument++; + proba=0.0; + while ((*argument>='0') && (*argument<='9')) + { + proba *= 10; + proba += *argument - '0'; + argument++; + } + if (proba>100.) proba=100.; + proba /= 100.; + break; + case 'L': /* hidden argument : Literal distribution probability */ + argument++; + litProba=0.; + while ((*argument>='0') && (*argument<='9')) + { + litProba *= 10; + litProba += *argument - '0'; + argument++; + } + if (litProba>100.) litProba=100.; + litProba /= 100.; + break; + case 'v': + displayLevel = 4; + argument++; + break; + default: + return usage(programName); + } + } + + } + } + + DISPLAYLEVEL(4, "Data Generator %s \n", ZSTD_VERSION); + DISPLAYLEVEL(3, "Seed = %u \n", seed); + if (proba!=COMPRESSIBILITY_DEFAULT) DISPLAYLEVEL(3, "Compressibility : %i%%\n", (U32)(proba*100)); + + RDG_genOut(size, proba, litProba, seed); + DISPLAYLEVEL(1, "\n"); + + return 0; +} diff --git a/thirdparty/Lz4/Lz4_131/programs/frametest.c b/thirdparty/Lz4/Lz4_131/programs/frametest.c new file mode 100644 index 0000000..46ec030 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/frametest.c @@ -0,0 +1,925 @@ +/* + frameTest - test tool for lz4frame + Copyright (C) Yann Collet 2014-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Compiler specific +**************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# pragma warning(disable : 4146) /* disable: C4146: minus unsigned expression */ +#endif + +/* S_ISREG & gettimeofday() are not supported by MSVC */ +#if defined(_MSC_VER) || defined(_WIN32) +# define FUZ_LEGACY_TIMER 1 +#endif + + +/************************************** +* Includes +**************************************/ +#include /* malloc, free */ +#include /* fprintf */ +#include /* strcmp */ +#include "lz4frame_static.h" +#include "xxhash.h" /* XXH64 */ + +/* Use ftime() if gettimeofday() is not available on your target */ +#if defined(FUZ_LEGACY_TIMER) +# include /* timeb, ftime */ +#else +# include /* gettimeofday */ +#endif + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include +typedef uint8_t BYTE; +typedef uint16_t U16; +typedef uint32_t U32; +typedef int32_t S32; +typedef uint64_t U64; +#else +typedef unsigned char BYTE; +typedef unsigned short U16; +typedef unsigned int U32; +typedef signed int S32; +typedef unsigned long long U64; +#endif + + +/* unoptimized version; solves endianess & alignment issues */ +static void FUZ_writeLE32 (void* dstVoidPtr, U32 value32) +{ + BYTE* dstPtr = (BYTE*)dstVoidPtr; + dstPtr[0] = (BYTE)value32; + dstPtr[1] = (BYTE)(value32 >> 8); + dstPtr[2] = (BYTE)(value32 >> 16); + dstPtr[3] = (BYTE)(value32 >> 24); +} + + +/************************************** +* Constants +**************************************/ +#ifndef LZ4_VERSION +# define LZ4_VERSION "" +#endif + +#define LZ4F_MAGIC_SKIPPABLE_START 0x184D2A50U + +#define KB *(1U<<10) +#define MB *(1U<<20) +#define GB *(1U<<30) + +static const U32 nbTestsDefault = 256 KB; +#define COMPRESSIBLE_NOISE_LENGTH (2 MB) +#define FUZ_COMPRESSIBILITY_DEFAULT 50 +static const U32 prime1 = 2654435761U; +static const U32 prime2 = 2246822519U; + + + +/************************************** +* Macros +**************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); } +#define DISPLAYUPDATE(l, ...) if (displayLevel>=l) { \ + if ((FUZ_GetMilliSpan(g_time) > refreshRate) || (displayLevel>=4)) \ + { g_time = FUZ_GetMilliStart(); DISPLAY(__VA_ARGS__); \ + if (displayLevel>=4) fflush(stdout); } } +static const U32 refreshRate = 150; +static U32 g_time = 0; + + +/***************************************** +* Local Parameters +*****************************************/ +static U32 no_prompt = 0; +static char* programName; +static U32 displayLevel = 2; +static U32 pause = 0; + + +/********************************************************* +* Fuzzer functions +*********************************************************/ +#if defined(FUZ_LEGACY_TIMER) + +static U32 FUZ_GetMilliStart(void) +{ + struct timeb tb; + U32 nCount; + ftime( &tb ); + nCount = (U32) (((tb.time & 0xFFFFF) * 1000) + tb.millitm); + return nCount; +} + +#else + +static U32 FUZ_GetMilliStart(void) +{ + struct timeval tv; + U32 nCount; + gettimeofday(&tv, NULL); + nCount = (U32) (tv.tv_usec/1000 + (tv.tv_sec & 0xfffff) * 1000); + return nCount; +} + +#endif + + +static U32 FUZ_GetMilliSpan(U32 nTimeStart) +{ + U32 nCurrent = FUZ_GetMilliStart(); + U32 nSpan = nCurrent - nTimeStart; + if (nTimeStart > nCurrent) + nSpan += 0x100000 * 1000; + return nSpan; +} + + +# define FUZ_rotl32(x,r) ((x << r) | (x >> (32 - r))) +unsigned int FUZ_rand(unsigned int* src) +{ + U32 rand32 = *src; + rand32 *= prime1; + rand32 += prime2; + rand32 = FUZ_rotl32(rand32, 13); + *src = rand32; + return rand32 >> 5; +} + + +#define FUZ_RAND15BITS (FUZ_rand(seed) & 0x7FFF) +#define FUZ_RANDLENGTH ( (FUZ_rand(seed) & 3) ? (FUZ_rand(seed) % 15) : (FUZ_rand(seed) % 510) + 15) +static void FUZ_fillCompressibleNoiseBuffer(void* buffer, unsigned bufferSize, double proba, U32* seed) +{ + BYTE* BBuffer = (BYTE*)buffer; + unsigned pos = 0; + U32 P32 = (U32)(32768 * proba); + + /* First Byte */ + BBuffer[pos++] = (BYTE)(FUZ_rand(seed)); + + while (pos < bufferSize) + { + /* Select : Literal (noise) or copy (within 64K) */ + if (FUZ_RAND15BITS < P32) + { + /* Copy (within 64K) */ + unsigned match, end; + unsigned length = FUZ_RANDLENGTH + 4; + unsigned offset = FUZ_RAND15BITS + 1; + if (offset > pos) offset = pos; + if (pos + length > bufferSize) length = bufferSize - pos; + match = pos - offset; + end = pos + length; + while (pos < end) BBuffer[pos++] = BBuffer[match++]; + } + else + { + /* Literal (noise) */ + unsigned end; + unsigned length = FUZ_RANDLENGTH; + if (pos + length > bufferSize) length = bufferSize - pos; + end = pos + length; + while (pos < end) BBuffer[pos++] = (BYTE)(FUZ_rand(seed) >> 5); + } + } +} + + +static unsigned FUZ_highbit(U32 v32) +{ + unsigned nbBits = 0; + if (v32==0) return 0; + while (v32) + { + v32 >>= 1; + nbBits ++; + } + return nbBits; +} + + +int basicTests(U32 seed, double compressibility) +{ + int testResult = 0; + void* CNBuffer; + void* compressedBuffer; + void* decodedBuffer; + U32 randState = seed; + size_t cSize, testSize; + LZ4F_preferences_t prefs; + LZ4F_decompressionContext_t dCtx = NULL; + LZ4F_compressionContext_t cctx = NULL; + U64 crcOrig; + + /* Create compressible test buffer */ + memset(&prefs, 0, sizeof(prefs)); + CNBuffer = malloc(COMPRESSIBLE_NOISE_LENGTH); + compressedBuffer = malloc(LZ4F_compressFrameBound(COMPRESSIBLE_NOISE_LENGTH, NULL)); + decodedBuffer = malloc(COMPRESSIBLE_NOISE_LENGTH); + FUZ_fillCompressibleNoiseBuffer(CNBuffer, COMPRESSIBLE_NOISE_LENGTH, compressibility, &randState); + crcOrig = XXH64(CNBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + + /* Trivial tests : one-step frame */ + testSize = COMPRESSIBLE_NOISE_LENGTH; + DISPLAYLEVEL(3, "Using NULL preferences : \n"); + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, NULL), CNBuffer, testSize, NULL); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "Decompression test : \n"); + { + size_t decodedBufferSize = COMPRESSIBLE_NOISE_LENGTH; + size_t compressedBufferSize = cSize; + BYTE* op = (BYTE*)decodedBuffer; + BYTE* const oend = (BYTE*)decodedBuffer + COMPRESSIBLE_NOISE_LENGTH; + BYTE* ip = (BYTE*)compressedBuffer; + BYTE* const iend = (BYTE*)compressedBuffer + cSize; + U64 crcDest; + + LZ4F_errorCode_t errorCode = LZ4F_createDecompressionContext(&dCtx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) goto _output_error; + + DISPLAYLEVEL(3, "Single Block : \n"); + errorCode = LZ4F_decompress(dCtx, decodedBuffer, &decodedBufferSize, compressedBuffer, &compressedBufferSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + if (crcDest != crcOrig) goto _output_error; + DISPLAYLEVEL(3, "Regenerated %i bytes \n", (int)decodedBufferSize); + + DISPLAYLEVEL(4, "Reusing decompression context \n"); + { + size_t iSize = compressedBufferSize - 4; + const BYTE* cBuff = (const BYTE*) compressedBuffer; + DISPLAYLEVEL(3, "Missing last 4 bytes : "); + errorCode = LZ4F_decompress(dCtx, decodedBuffer, &decodedBufferSize, cBuff, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + if (!errorCode) goto _output_error; + DISPLAYLEVEL(3, "indeed, request %u bytes \n", (unsigned)errorCode); + cBuff += iSize; + iSize = errorCode; + errorCode = LZ4F_decompress(dCtx, decodedBuffer, &decodedBufferSize, cBuff, &iSize, NULL); + if (errorCode != 0) goto _output_error; + crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + if (crcDest != crcOrig) goto _output_error; + } + + { + size_t oSize = 0; + size_t iSize = 0; + LZ4F_frameInfo_t fi; + + DISPLAYLEVEL(3, "Start by feeding 0 bytes, to get next input size : "); + errorCode = LZ4F_decompress(dCtx, NULL, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + DISPLAYLEVEL(3, " %u \n", (unsigned)errorCode); + + DISPLAYLEVEL(3, "get FrameInfo on null input : "); + errorCode = LZ4F_getFrameInfo(dCtx, &fi, ip, &iSize); + if (errorCode != (size_t)-LZ4F_ERROR_frameHeader_incomplete) goto _output_error; + DISPLAYLEVEL(3, " correctly failed : %s \n", LZ4F_getErrorName(errorCode)); + + DISPLAYLEVEL(3, "get FrameInfo on not enough input : "); + iSize = 6; + errorCode = LZ4F_getFrameInfo(dCtx, &fi, ip, &iSize); + if (errorCode != (size_t)-LZ4F_ERROR_frameHeader_incomplete) goto _output_error; + DISPLAYLEVEL(3, " correctly failed : %s \n", LZ4F_getErrorName(errorCode)); + ip += iSize; + + DISPLAYLEVEL(3, "get FrameInfo on enough input : "); + iSize = 15 - iSize; + errorCode = LZ4F_getFrameInfo(dCtx, &fi, ip, &iSize); + if (LZ4F_isError(errorCode)) goto _output_error; + DISPLAYLEVEL(3, " correctly decoded \n"); + ip += iSize; + } + + DISPLAYLEVEL(3, "Byte after byte : \n"); + while (ip < iend) + { + size_t oSize = oend-op; + size_t iSize = 1; + errorCode = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += oSize; + ip += iSize; + } + crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + if (crcDest != crcOrig) goto _output_error; + DISPLAYLEVEL(3, "Regenerated %u/%u bytes \n", (unsigned)(op-(BYTE*)decodedBuffer), COMPRESSIBLE_NOISE_LENGTH); + + errorCode = LZ4F_freeDecompressionContext(dCtx); + if (LZ4F_isError(errorCode)) goto _output_error; + } + + DISPLAYLEVEL(3, "Using 64 KB block : \n"); + prefs.frameInfo.blockSizeID = LZ4F_max64KB; + prefs.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "without checksum : \n"); + prefs.frameInfo.contentChecksumFlag = LZ4F_noContentChecksum; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "Using 256 KB block : \n"); + prefs.frameInfo.blockSizeID = LZ4F_max256KB; + prefs.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "Decompression test : \n"); + { + size_t decodedBufferSize = COMPRESSIBLE_NOISE_LENGTH; + unsigned maxBits = FUZ_highbit((U32)decodedBufferSize); + BYTE* op = (BYTE*)decodedBuffer; + BYTE* const oend = (BYTE*)decodedBuffer + COMPRESSIBLE_NOISE_LENGTH; + BYTE* ip = (BYTE*)compressedBuffer; + BYTE* const iend = (BYTE*)compressedBuffer + cSize; + U64 crcDest; + + LZ4F_errorCode_t errorCode = LZ4F_createDecompressionContext(&dCtx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) goto _output_error; + + DISPLAYLEVEL(3, "random segment sizes : \n"); + while (ip < iend) + { + unsigned nbBits = FUZ_rand(&randState) % maxBits; + size_t iSize = (FUZ_rand(&randState) & ((1< (size_t)(iend-ip)) iSize = iend-ip; + //DISPLAY("%7i : + %6i\n", (int)(ip-(BYTE*)compressedBuffer), (int)iSize); + errorCode = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += oSize; + ip += iSize; + } + crcDest = XXH64(decodedBuffer, COMPRESSIBLE_NOISE_LENGTH, 1); + if (crcDest != crcOrig) goto _output_error; + DISPLAYLEVEL(3, "Regenerated %i bytes \n", (int)decodedBufferSize); + + errorCode = LZ4F_freeDecompressionContext(dCtx); + if (LZ4F_isError(errorCode)) goto _output_error; + } + + DISPLAYLEVEL(3, "without checksum : \n"); + prefs.frameInfo.contentChecksumFlag = LZ4F_noContentChecksum; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "Using 1 MB block : \n"); + prefs.frameInfo.blockSizeID = LZ4F_max1MB; + prefs.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "without checksum : \n"); + prefs.frameInfo.contentChecksumFlag = LZ4F_noContentChecksum; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "Using 4 MB block : \n"); + prefs.frameInfo.blockSizeID = LZ4F_max4MB; + prefs.frameInfo.contentChecksumFlag = LZ4F_contentChecksumEnabled; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + DISPLAYLEVEL(3, "without checksum : \n"); + prefs.frameInfo.contentChecksumFlag = LZ4F_noContentChecksum; + cSize = LZ4F_compressFrame(compressedBuffer, LZ4F_compressFrameBound(testSize, &prefs), CNBuffer, testSize, &prefs); + if (LZ4F_isError(cSize)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)cSize); + + { + size_t errorCode; + BYTE* const ostart = (BYTE*)compressedBuffer; + BYTE* op = ostart; + errorCode = LZ4F_createCompressionContext(&cctx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) goto _output_error; + + DISPLAYLEVEL(3, "compress without frameSize : \n"); + memset(&(prefs.frameInfo), 0, sizeof(prefs.frameInfo)); + errorCode = LZ4F_compressBegin(cctx, compressedBuffer, testSize, &prefs); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressUpdate(cctx, op, LZ4F_compressBound(testSize, &prefs), CNBuffer, testSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressEnd(cctx, compressedBuffer, testSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)(op-ostart)); + + DISPLAYLEVEL(3, "compress with frameSize : \n"); + prefs.frameInfo.contentSize = testSize; + op = ostart; + errorCode = LZ4F_compressBegin(cctx, compressedBuffer, testSize, &prefs); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressUpdate(cctx, op, LZ4F_compressBound(testSize, &prefs), CNBuffer, testSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressEnd(cctx, compressedBuffer, testSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + DISPLAYLEVEL(3, "Compressed %i bytes into a %i bytes frame \n", (int)testSize, (int)(op-ostart)); + + DISPLAYLEVEL(3, "compress with wrong frameSize : \n"); + prefs.frameInfo.contentSize = testSize+1; + op = ostart; + errorCode = LZ4F_compressBegin(cctx, compressedBuffer, testSize, &prefs); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressUpdate(cctx, op, LZ4F_compressBound(testSize, &prefs), CNBuffer, testSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += errorCode; + errorCode = LZ4F_compressEnd(cctx, op, testSize, NULL); + if (LZ4F_isError(errorCode)) { DISPLAYLEVEL(3, "Error correctly detected : %s \n", LZ4F_getErrorName(errorCode)); } + else + goto _output_error; + + errorCode = LZ4F_freeCompressionContext(cctx); + if (LZ4F_isError(errorCode)) goto _output_error; + cctx = NULL; + } + + DISPLAYLEVEL(3, "Skippable frame test : \n"); + { + size_t decodedBufferSize = COMPRESSIBLE_NOISE_LENGTH; + unsigned maxBits = FUZ_highbit((U32)decodedBufferSize); + BYTE* op = (BYTE*)decodedBuffer; + BYTE* const oend = (BYTE*)decodedBuffer + COMPRESSIBLE_NOISE_LENGTH; + BYTE* ip = (BYTE*)compressedBuffer; + BYTE* iend = (BYTE*)compressedBuffer + cSize + 8; + + LZ4F_errorCode_t errorCode = LZ4F_createDecompressionContext(&dCtx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) goto _output_error; + + /* generate skippable frame */ + FUZ_writeLE32(ip, LZ4F_MAGIC_SKIPPABLE_START); + FUZ_writeLE32(ip+4, (U32)cSize); + + DISPLAYLEVEL(3, "random segment sizes : \n"); + while (ip < iend) + { + unsigned nbBits = FUZ_rand(&randState) % maxBits; + size_t iSize = (FUZ_rand(&randState) & ((1< (size_t)(iend-ip)) iSize = iend-ip; + errorCode = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += oSize; + ip += iSize; + } + DISPLAYLEVEL(3, "Skipped %i bytes \n", (int)decodedBufferSize); + + /* generate zero-size skippable frame */ + DISPLAYLEVEL(3, "zero-size skippable frame\n"); + ip = (BYTE*)compressedBuffer; + op = (BYTE*)decodedBuffer; + FUZ_writeLE32(ip, LZ4F_MAGIC_SKIPPABLE_START+1); + FUZ_writeLE32(ip+4, 0); + iend = ip+8; + + while (ip < iend) + { + unsigned nbBits = FUZ_rand(&randState) % maxBits; + size_t iSize = (FUZ_rand(&randState) & ((1< (size_t)(iend-ip)) iSize = iend-ip; + errorCode = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += oSize; + ip += iSize; + } + DISPLAYLEVEL(3, "Skipped %i bytes \n", (int)(ip - (BYTE*)compressedBuffer - 8)); + + DISPLAYLEVEL(3, "Skippable frame header complete in first call \n"); + ip = (BYTE*)compressedBuffer; + op = (BYTE*)decodedBuffer; + FUZ_writeLE32(ip, LZ4F_MAGIC_SKIPPABLE_START+2); + FUZ_writeLE32(ip+4, 10); + iend = ip+18; + while (ip < iend) + { + size_t iSize = 10; + size_t oSize = 10; + if (iSize > (size_t)(iend-ip)) iSize = iend-ip; + errorCode = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL); + if (LZ4F_isError(errorCode)) goto _output_error; + op += oSize; + ip += iSize; + } + DISPLAYLEVEL(3, "Skipped %i bytes \n", (int)(ip - (BYTE*)compressedBuffer - 8)); + } + + DISPLAY("Basic tests completed \n"); +_end: + free(CNBuffer); + free(compressedBuffer); + free(decodedBuffer); + LZ4F_freeDecompressionContext(dCtx); dCtx = NULL; + LZ4F_freeCompressionContext(cctx); cctx = NULL; + return testResult; + +_output_error: + testResult = 1; + DISPLAY("Error detected ! \n"); + goto _end; +} + + +static void locateBuffDiff(const void* buff1, const void* buff2, size_t size, unsigned nonContiguous) +{ + int p=0; + const BYTE* b1=(const BYTE*)buff1; + const BYTE* b2=(const BYTE*)buff2; + if (nonContiguous) + { + DISPLAY("Non-contiguous output test (%i bytes)\n", (int)size); + return; + } + while (b1[p]==b2[p]) p++; + DISPLAY("Error at pos %i/%i : %02X != %02X \n", p, (int)size, b1[p], b2[p]); +} + + +static const U32 srcDataLength = 9 MB; /* needs to be > 2x4MB to test large blocks */ + +int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressibility, U32 duration) +{ + unsigned testResult = 0; + unsigned testNb = 0; + void* srcBuffer = NULL; + void* compressedBuffer = NULL; + void* decodedBuffer = NULL; + U32 coreRand = seed; + LZ4F_decompressionContext_t dCtx = NULL; + LZ4F_compressionContext_t cCtx = NULL; + size_t result; + const U32 startTime = FUZ_GetMilliStart(); + XXH64_state_t xxh64; +# define CHECK(cond, ...) if (cond) { DISPLAY("Error => "); DISPLAY(__VA_ARGS__); \ + DISPLAY(" (seed %u, test nb %u) \n", seed, testNb); goto _output_error; } + + + /* Init */ + duration *= 1000; + + /* Create buffers */ + result = LZ4F_createDecompressionContext(&dCtx, LZ4F_VERSION); + CHECK(LZ4F_isError(result), "Allocation failed (error %i)", (int)result); + result = LZ4F_createCompressionContext(&cCtx, LZ4F_VERSION); + CHECK(LZ4F_isError(result), "Allocation failed (error %i)", (int)result); + srcBuffer = malloc(srcDataLength); + CHECK(srcBuffer==NULL, "srcBuffer Allocation failed"); + compressedBuffer = malloc(LZ4F_compressFrameBound(srcDataLength, NULL)); + CHECK(compressedBuffer==NULL, "compressedBuffer Allocation failed"); + decodedBuffer = calloc(1, srcDataLength); /* calloc avoids decodedBuffer being considered "garbage" by scan-build */ + CHECK(decodedBuffer==NULL, "decodedBuffer Allocation failed"); + FUZ_fillCompressibleNoiseBuffer(srcBuffer, srcDataLength, compressibility, &coreRand); + + /* jump to requested testNb */ + for (testNb =0; (testNb < startTest); testNb++) (void)FUZ_rand(&coreRand); // sync randomizer + + /* main fuzzer test loop */ + for ( ; (testNb < nbTests) || (duration > FUZ_GetMilliSpan(startTime)) ; testNb++) + { + U32 randState = coreRand ^ prime1; + unsigned BSId = 4 + (FUZ_rand(&randState) & 3); + unsigned BMId = FUZ_rand(&randState) & 1; + unsigned CCflag = FUZ_rand(&randState) & 1; + unsigned autoflush = (FUZ_rand(&randState) & 7) == 2; + LZ4F_preferences_t prefs; + LZ4F_compressOptions_t cOptions; + LZ4F_decompressOptions_t dOptions; + unsigned nbBits = (FUZ_rand(&randState) % (FUZ_highbit(srcDataLength-1) - 1)) + 1; + size_t srcSize = (FUZ_rand(&randState) & ((1< (size_t)(iend-ip)) iSize = iend-ip; + cOptions.stableSrc = ((FUZ_rand(&randState) & 3) == 1); + + result = LZ4F_compressUpdate(cCtx, op, oSize, ip, iSize, &cOptions); + CHECK(LZ4F_isError(result), "Compression failed (error %i)", (int)result); + op += result; + ip += iSize; + + if (forceFlush) + { + result = LZ4F_flush(cCtx, op, oend-op, &cOptions); + CHECK(LZ4F_isError(result), "Compression failed (error %i)", (int)result); + op += result; + } + } + result = LZ4F_compressEnd(cCtx, op, oend-op, &cOptions); + CHECK(LZ4F_isError(result), "Compression completion failed (error %i)", (int)result); + op += result; + cSize = op-(BYTE*)compressedBuffer; + } + + { + const BYTE* ip = (const BYTE*)compressedBuffer; + const BYTE* const iend = ip + cSize; + BYTE* op = (BYTE*)decodedBuffer; + BYTE* const oend = op + srcDataLength; + size_t totalOut = 0; + unsigned maxBits = FUZ_highbit((U32)cSize); + unsigned nonContiguousDst = (FUZ_rand(&randState) & 3) == 1; + nonContiguousDst += FUZ_rand(&randState) & nonContiguousDst; /* 0=>0; 1=>1,2 */ + XXH64_reset(&xxh64, 1); + if (maxBits < 3) maxBits = 3; + while (ip < iend) + { + unsigned nbBitsI = (FUZ_rand(&randState) % (maxBits-1)) + 1; + unsigned nbBitsO = (FUZ_rand(&randState) % (maxBits)) + 1; + size_t iSize = (FUZ_rand(&randState) & ((1< (size_t)(iend-ip)) iSize = iend-ip; + if (oSize > (size_t)(oend-op)) oSize = oend-op; + dOptions.stableDst = FUZ_rand(&randState) & 1; + if (nonContiguousDst==2) dOptions.stableDst = 0; + result = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, &dOptions); + if (result == (size_t)-LZ4F_ERROR_contentChecksum_invalid) + locateBuffDiff((BYTE*)srcBuffer+srcStart, decodedBuffer, srcSize, nonContiguousDst); + CHECK(LZ4F_isError(result), "Decompression failed (error %i:%s)", (int)result, LZ4F_getErrorName((LZ4F_errorCode_t)result)); + XXH64_update(&xxh64, op, (U32)oSize); + totalOut += oSize; + op += oSize; + ip += iSize; + op += nonContiguousDst; + if (nonContiguousDst==2) op = (BYTE*)decodedBuffer; /* overwritten destination */ + } + CHECK(result != 0, "Frame decompression failed (error %i)", (int)result); + if (totalOut) /* otherwise, it's a skippable frame */ + { + crcDecoded = XXH64_digest(&xxh64); + if (crcDecoded != crcOrig) locateBuffDiff((BYTE*)srcBuffer+srcStart, decodedBuffer, srcSize, nonContiguousDst); + CHECK(crcDecoded != crcOrig, "Decompression corruption"); + } + } + } + + DISPLAYLEVEL(2, "\rAll tests completed \n"); + +_end: + LZ4F_freeDecompressionContext(dCtx); + LZ4F_freeCompressionContext(cCtx); + free(srcBuffer); + free(compressedBuffer); + free(decodedBuffer); + + if (pause) + { + DISPLAY("press enter to finish \n"); + (void)getchar(); + } + return testResult; + +_output_error: + testResult = 1; + goto _end; +} + + +int FUZ_usage(void) +{ + DISPLAY( "Usage :\n"); + DISPLAY( " %s [args]\n", programName); + DISPLAY( "\n"); + DISPLAY( "Arguments :\n"); + DISPLAY( " -i# : Nb of tests (default:%u) \n", nbTestsDefault); + DISPLAY( " -T# : Duration of tests, in seconds (default: use Nb of tests) \n"); + DISPLAY( " -s# : Select seed (default:prompt user)\n"); + DISPLAY( " -t# : Select starting test number (default:0)\n"); + DISPLAY( " -p# : Select compressibility in %% (default:%i%%)\n", FUZ_COMPRESSIBILITY_DEFAULT); + DISPLAY( " -v : verbose\n"); + DISPLAY( " -h : display help and exit\n"); + return 0; +} + + +int main(int argc, char** argv) +{ + U32 seed=0; + int seedset=0; + int argNb; + int nbTests = nbTestsDefault; + int testNb = 0; + int proba = FUZ_COMPRESSIBILITY_DEFAULT; + int result=0; + U32 duration=0; + + /* Check command line */ + programName = argv[0]; + for(argNb=1; argNb='0') && (*argument<='9')) + { + nbTests *= 10; + nbTests += *argument - '0'; + argument++; + } + break; + + case 'T': + argument++; + nbTests = 0; duration = 0; + for (;;) + { + switch(*argument) + { + case 'm': duration *= 60; argument++; continue; + case 's': + case 'n': argument++; continue; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': duration *= 10; duration += *argument++ - '0'; continue; + } + break; + } + break; + + case 's': + argument++; + seed=0; + seedset=1; + while ((*argument>='0') && (*argument<='9')) + { + seed *= 10; + seed += *argument - '0'; + argument++; + } + break; + case 't': + argument++; + testNb=0; + while ((*argument>='0') && (*argument<='9')) + { + testNb *= 10; + testNb += *argument - '0'; + argument++; + } + break; + case 'P': /* compressibility % */ + argument++; + proba=0; + while ((*argument>='0') && (*argument<='9')) + { + proba *= 10; + proba += *argument - '0'; + argument++; + } + if (proba<0) proba=0; + if (proba>100) proba=100; + break; + default: + ; + return FUZ_usage(); + } + } + } + } + + /* Get Seed */ + printf("Starting lz4frame tester (%i-bits, %s)\n", (int)(sizeof(size_t)*8), LZ4_VERSION); + + if (!seedset) seed = FUZ_GetMilliStart() % 10000; + printf("Seed = %u\n", seed); + if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) printf("Compressibility : %i%%\n", proba); + + if (nbTests<=0) nbTests=1; + + if (testNb==0) result = basicTests(seed, ((double)proba) / 100); + if (result) return 1; + return fuzzerTests(seed, nbTests, testNb, ((double)proba) / 100, duration); +} diff --git a/thirdparty/Lz4/Lz4_131/programs/fullbench.c b/thirdparty/Lz4/Lz4_131/programs/fullbench.c new file mode 100644 index 0000000..0d08a40 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/fullbench.c @@ -0,0 +1,1006 @@ +/* + bench.c - Demo program to benchmark open-source compression algorithm + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Compiler Options +**************************************/ +/* Disable some Visual warning messages */ +#define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_DEPRECATE /* VS2005 */ + +/* Unix Large Files support (>4GB) */ +#if (defined(__sun__) && (!defined(__LP64__))) // Sun Solaris 32-bits requires specific definitions +# define _LARGEFILE_SOURCE +# define _FILE_OFFSET_BITS 64 +#elif ! defined(__LP64__) // No point defining Large file for 64 bit +# define _LARGEFILE64_SOURCE +#endif + +// S_ISREG & gettimeofday() are not supported by MSVC +#if defined(_MSC_VER) || defined(_WIN32) +# define BMK_LEGACY_TIMER 1 +#endif + + +/************************************** +* Includes +**************************************/ +#include /* malloc, free */ +#include /* fprintf, fopen, ftello64 */ +#include /* stat64 */ +#include /* stat64 */ +#include /* strcmp */ + +/* Use ftime() if gettimeofday() is not available on your target */ +#if defined(BMK_LEGACY_TIMER) +# include /* timeb, ftime */ +#else +# include /* gettimeofday */ +#endif + +#include "lz4.h" +#include "lz4hc.h" +#include "lz4frame.h" + +#include "xxhash.h" + + +/************************************** +* Compiler Options +**************************************/ +/* S_ISREG & gettimeofday() are not supported by MSVC */ +#if !defined(S_ISREG) +# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) +#endif + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */ +# include + typedef uint8_t BYTE; + typedef uint16_t U16; + typedef uint32_t U32; + typedef int32_t S32; + typedef uint64_t U64; +#else + typedef unsigned char BYTE; + typedef unsigned short U16; + typedef unsigned int U32; + typedef signed int S32; + typedef unsigned long long U64; +#endif + + +/************************************** +* Constants +**************************************/ +#define PROGRAM_DESCRIPTION "LZ4 speed analyzer" +#ifndef LZ4_VERSION +# define LZ4_VERSION "" +#endif +#define AUTHOR "Yann Collet" +#define WELCOME_MESSAGE "*** %s %s %i-bits, by %s (%s) ***\n", PROGRAM_DESCRIPTION, LZ4_VERSION, (int)(sizeof(void*)*8), AUTHOR, __DATE__ + +#define NBLOOPS 6 +#define TIMELOOP 2500 + +#define KB *(1 <<10) +#define MB *(1 <<20) +#define GB *(1U<<30) + +#define KNUTH 2654435761U +#define MAX_MEM (1920 MB) +#define DEFAULT_CHUNKSIZE (4 MB) + +#define ALL_COMPRESSORS 0 +#define ALL_DECOMPRESSORS 0 + + +/************************************** +* Local structures +**************************************/ +struct chunkParameters +{ + U32 id; + char* origBuffer; + char* compressedBuffer; + int origSize; + int compressedSize; +}; + + +/************************************** +* Macros +**************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define PROGRESS(...) g_noPrompt ? 0 : DISPLAY(__VA_ARGS__) + + +/************************************** +* Benchmark Parameters +**************************************/ +static int g_chunkSize = DEFAULT_CHUNKSIZE; +static int g_nbIterations = NBLOOPS; +static int g_pause = 0; +static int g_compressionTest = 1; +static int g_compressionAlgo = ALL_COMPRESSORS; +static int g_decompressionTest = 1; +static int g_decompressionAlgo = ALL_DECOMPRESSORS; +static int g_noPrompt = 0; + +static void BMK_setBlocksize(int bsize) +{ + g_chunkSize = bsize; + DISPLAY("-Using Block Size of %i KB-\n", g_chunkSize>>10); +} + +static void BMK_setNbIterations(int nbLoops) +{ + g_nbIterations = nbLoops; + DISPLAY("- %i iterations -\n", g_nbIterations); +} + +static void BMK_setPause(void) +{ + g_pause = 1; +} + + +/********************************************************* +* Private functions +*********************************************************/ + +#if defined(BMK_LEGACY_TIMER) + +static int BMK_GetMilliStart(void) +{ + /* Based on Legacy ftime() + * Rolls over every ~ 12.1 days (0x100000/24/60/60) + * Use GetMilliSpan to correct for rollover */ + struct timeb tb; + int nCount; + ftime( &tb ); + nCount = (int) (tb.millitm + (tb.time & 0xfffff) * 1000); + return nCount; +} + +#else + +static int BMK_GetMilliStart(void) +{ + /* Based on newer gettimeofday() + * Use GetMilliSpan to correct for rollover */ + struct timeval tv; + int nCount; + gettimeofday(&tv, NULL); + nCount = (int) (tv.tv_usec/1000 + (tv.tv_sec & 0xfffff) * 1000); + return nCount; +} + +#endif + + +static int BMK_GetMilliSpan( int nTimeStart ) +{ + int nSpan = BMK_GetMilliStart() - nTimeStart; + if ( nSpan < 0 ) + nSpan += 0x100000 * 1000; + return nSpan; +} + + +static size_t BMK_findMaxMem(U64 requiredMem) +{ + size_t step = 64 MB; + BYTE* testmem=NULL; + + requiredMem = (((requiredMem >> 26) + 1) << 26); + requiredMem += 2*step; + if (requiredMem > MAX_MEM) requiredMem = MAX_MEM; + + while (!testmem) + { + if (requiredMem > step) requiredMem -= step; + else requiredMem >>= 1; + testmem = (BYTE*) malloc ((size_t)requiredMem); + } + free (testmem); + + /* keep some space available */ + if (requiredMem > step) requiredMem -= step; + else requiredMem >>= 1; + + return (size_t)requiredMem; +} + + +static U64 BMK_GetFileSize(char* infilename) +{ + int r; +#if defined(_MSC_VER) + struct _stat64 statbuf; + r = _stat64(infilename, &statbuf); +#else + struct stat statbuf; + r = stat(infilename, &statbuf); +#endif + if (r || !S_ISREG(statbuf.st_mode)) return 0; /* No good... */ + return (U64)statbuf.st_size; +} + + +/********************************************************* +* Benchmark function +*********************************************************/ +#ifdef __SSSE3__ + +#include + +/* Idea proposed by Terje Mathisen */ +static BYTE stepSize16[17] = {16,16,16,15,16,15,12,14,16,9,10,11,12,13,14,15,16}; +static __m128i replicateTable[17] = { + {0,0,0,0,0,0,0,0,0,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,1,0,1,0,1,0,1,0,1,0,1,0,1}, + {0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0}, + {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3}, + {0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0}, + {0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3}, + {0,1,2,3,4,5,6,0,1,2,3,4,5,6,0,1}, + {0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7}, + {0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6}, + {0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}, + {0,1,2,3,4,5,6,7,8,9,10,0,1,2,3,4}, + {0,1,2,3,4,5,6,7,8,9,10,11,0,1,2,3}, + {0,1,2,3,4,5,6,7,8,9,10,11,12,0,1,2}, + {0,1,2,3,4,5,6,7,8,9,10,11,12,13,0,1}, + {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0}, + {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; +static BYTE stepSize32[17] = {32,32,32,30,32,30,30,28,32,27,30,22,24,26,28,30,16}; +static __m128i replicateTable2[17] = { + {0,0,0,0,0,0,0,0,0,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,1,0,1,0,1,0,1,0,1,0,1,0,1}, + {1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1}, + {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3}, + {1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1}, + {4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1}, + {2,3,4,5,6,0,1,2,3,4,5,6,0,1,2,3}, + {0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7}, + {7,8,0,1,2,3,4,5,6,7,8,0,1,2,3,4}, + {6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1}, + {5,6,7,8,9,10,0,1,2,3,4,5,6,7,8,9}, + {4,5,6,7,8,9,10,11,0,1,2,3,4,5,6,7}, + {3,4,5,6,7,8,9,10,11,12,0,1,2,3,4,5}, + {2,3,4,5,6,7,8,9,10,11,12,13,0,1,2,3}, + {1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,1}, + {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}}; + +U32 lz4_decode_sse(BYTE* dest, BYTE* src, U32 srcLength) +{ + BYTE* d = dest, *e = src+srcLength; + unsigned token, lit_len, mat_len; + __m128i a; + BYTE* dstore, *msrc; + + if (!srcLength) return 0; + goto start; + + do { + U32 step; + unsigned mat_offset = src[0] + (src[1] << 8); + src += 2; + msrc = d - mat_offset; + if (mat_len == 15) { + do { + token = *src++; + mat_len += token; + } while (token == 255); + } + mat_len += 4; + + dstore = d; + d += mat_len; + + if (mat_offset <= 16) + { // Bulk store only! + __m128i a2; + a = _mm_loadu_si128((const __m128i *)msrc); + a2 = _mm_shuffle_epi8(a, replicateTable2[mat_offset]); + a = _mm_shuffle_epi8(a, replicateTable[mat_offset]); + step = stepSize32[mat_offset]; + do { + _mm_storeu_si128((__m128i *)dstore, a); + _mm_storeu_si128((__m128i *)(dstore+16), a2); + dstore += step; + } while (dstore < d); + } + else + { + do + { + a = _mm_loadu_si128((const __m128i *)msrc); + _mm_storeu_si128((__m128i *)dstore, a); + msrc += sizeof(a); + dstore += sizeof(a); + } while (dstore < d); + } +start: + token = *src++; + lit_len = token >> 4; + mat_len = token & 15; + if (token >= 0xf0) { // lit_len == 15 + do { + token = *src++; + lit_len += token; + } while (token == 255); + } + dstore = d; + msrc = src; + d += lit_len; + src += lit_len; + do { + a = _mm_loadu_si128((const __m128i *)msrc); + _mm_storeu_si128((__m128i *)dstore, a); + msrc += sizeof(a); + dstore += sizeof(a); + } while (dstore < d); + } while (src < e); + + return (U32)(d-dest); +} +#endif // __SSSE3__ + + +static LZ4_stream_t LZ4_stream; +static void local_LZ4_resetDictT(void) +{ + LZ4_resetStream(&LZ4_stream); +} + +static void local_LZ4_createStream(void) +{ + LZ4_resetStream(&LZ4_stream); +} + +static int local_LZ4_saveDict(const char* in, char* out, int inSize) +{ + (void)in; + return LZ4_saveDict(&LZ4_stream, out, inSize); +} + +static int local_LZ4_compress_limitedOutput(const char* in, char* out, int inSize) +{ + return LZ4_compress_limitedOutput(in, out, inSize, LZ4_compressBound(inSize)-1); +} + +static int local_LZ4_compress_default_large(const char* in, char* out, int inSize) +{ + return LZ4_compress_default(in, out, inSize, LZ4_compressBound(inSize)); +} + +static int local_LZ4_compress_default_small(const char* in, char* out, int inSize) +{ + return LZ4_compress_default(in, out, inSize, LZ4_compressBound(inSize)-1); +} + +static int local_LZ4_compress_fast0(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast(in, out, inSize, LZ4_compressBound(inSize), 0); +} + +static int local_LZ4_compress_fast1(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast(in, out, inSize, LZ4_compressBound(inSize), 1); +} + +static int local_LZ4_compress_fast2(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast(in, out, inSize, LZ4_compressBound(inSize), 2); +} + +static int local_LZ4_compress_fast17(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast(in, out, inSize, LZ4_compressBound(inSize), 17); +} + +static int local_LZ4_compress_fast_extState0(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast_extState(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize), 0); +} + +static int local_LZ4_compress_fast_continue0(const char* in, char* out, int inSize) +{ + return LZ4_compress_fast_continue(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize), 0); +} + +static int local_LZ4_compress_withState(const char* in, char* out, int inSize) +{ + return LZ4_compress_withState(&LZ4_stream, in, out, inSize); +} + +static int local_LZ4_compress_limitedOutput_withState(const char* in, char* out, int inSize) +{ + return LZ4_compress_limitedOutput_withState(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize)-1); +} + +static int local_LZ4_compress_continue(const char* in, char* out, int inSize) +{ + return LZ4_compress_continue(&LZ4_stream, in, out, inSize); +} + +static int local_LZ4_compress_limitedOutput_continue(const char* in, char* out, int inSize) +{ + return LZ4_compress_limitedOutput_continue(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize)-1); +} + +/* declare hidden function */ +int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize); + +static int local_LZ4_compress_forceDict(const char* in, char* out, int inSize) +{ + return LZ4_compress_forceExtDict(&LZ4_stream, in, out, inSize); +} + + +/* HC compression functions */ +LZ4_streamHC_t LZ4_streamHC; +static void local_LZ4_resetStreamHC(void) +{ + LZ4_resetStreamHC(&LZ4_streamHC, 0); +} + +static int local_LZ4_saveDictHC(const char* in, char* out, int inSize) +{ + (void)in; + return LZ4_saveDictHC(&LZ4_streamHC, out, inSize); +} + +static int local_LZ4_compressHC_withStateHC(const char* in, char* out, int inSize) +{ + return LZ4_compressHC_withStateHC(&LZ4_streamHC, in, out, inSize); +} + +static int local_LZ4_compressHC_limitedOutput_withStateHC(const char* in, char* out, int inSize) +{ + return LZ4_compressHC_limitedOutput_withStateHC(&LZ4_streamHC, in, out, inSize, LZ4_compressBound(inSize)-1); +} + +static int local_LZ4_compressHC_limitedOutput(const char* in, char* out, int inSize) +{ + return LZ4_compressHC_limitedOutput(in, out, inSize, LZ4_compressBound(inSize)-1); +} + +static int local_LZ4_compressHC_continue(const char* in, char* out, int inSize) +{ + return LZ4_compressHC_continue(&LZ4_streamHC, in, out, inSize); +} + +static int local_LZ4_compressHC_limitedOutput_continue(const char* in, char* out, int inSize) +{ + return LZ4_compressHC_limitedOutput_continue(&LZ4_streamHC, in, out, inSize, LZ4_compressBound(inSize)-1); +} + + +/* decompression functions */ +static int local_LZ4_decompress_fast(const char* in, char* out, int inSize, int outSize) +{ + (void)inSize; + LZ4_decompress_fast(in, out, outSize); + return outSize; +} + +static int local_LZ4_decompress_fast_usingDict(const char* in, char* out, int inSize, int outSize) +{ + (void)inSize; + LZ4_decompress_fast_usingDict(in, out, outSize, out - 65536, 65536); + return outSize; +} + +static int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int inSize, int outSize) +{ + (void)inSize; + LZ4_decompress_safe_usingDict(in, out, inSize, outSize, out - 65536, 65536); + return outSize; +} + +extern int LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize, const char* dict, int dictSize); + +static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize) +{ + (void)inSize; + LZ4_decompress_safe_forceExtDict(in, out, inSize, outSize, out - 65536, 65536); + return outSize; +} + +static int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSize, int outSize) +{ + return LZ4_decompress_safe_partial(in, out, inSize, outSize - 5, outSize); +} + + +/* frame functions */ +static int local_LZ4F_compressFrame(const char* in, char* out, int inSize) +{ + return (int)LZ4F_compressFrame(out, 2*inSize + 16, in, inSize, NULL); +} + +static LZ4F_decompressionContext_t g_dCtx; + +static int local_LZ4F_decompress(const char* in, char* out, int inSize, int outSize) +{ + size_t srcSize = inSize; + size_t dstSize = outSize; + size_t result; + result = LZ4F_decompress(g_dCtx, out, &dstSize, in, &srcSize, NULL); + if (result!=0) { DISPLAY("Error decompressing frame : unfinished frame\n"); exit(8); } + if (srcSize != (size_t)inSize) { DISPLAY("Error decompressing frame : read size incorrect\n"); exit(9); } + return (int)dstSize; +} + + +#define NB_COMPRESSION_ALGORITHMS 100 +#define NB_DECOMPRESSION_ALGORITHMS 100 +int fullSpeedBench(char** fileNamesTable, int nbFiles) +{ + int fileIdx=0; + size_t errorCode; + + /* Init */ + errorCode = LZ4F_createDecompressionContext(&g_dCtx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) { DISPLAY("dctx allocation issue \n"); return 10; } + + /* Loop for each fileName */ + while (fileIdx inFileSize) benchedSize = (size_t)inFileSize; + if (benchedSize < inFileSize) + DISPLAY("Not enough memory for '%s' full size; testing %i MB only...\n", inFileName, (int)(benchedSize>>20)); + + /* Allocation */ + chunkP = (struct chunkParameters*) malloc(((benchedSize / (size_t)g_chunkSize)+1) * sizeof(struct chunkParameters)); + orig_buff = (char*) malloc(benchedSize); + nbChunks = (int) ((benchedSize + (g_chunkSize-1)) / g_chunkSize); + maxCompressedChunkSize = LZ4_compressBound(g_chunkSize); + compressedBuffSize = nbChunks * maxCompressedChunkSize; + compressed_buff = (char*)malloc((size_t)compressedBuffSize); + if(!chunkP || !orig_buff || !compressed_buff) + { + DISPLAY("\nError: not enough memory!\n"); + fclose(inFile); + free(orig_buff); + free(compressed_buff); + free(chunkP); + return(12); + } + + /* Fill in src buffer */ + DISPLAY("Loading %s... \r", inFileName); + readSize = fread(orig_buff, 1, benchedSize, inFile); + fclose(inFile); + + if(readSize != benchedSize) + { + DISPLAY("\nError: problem reading file '%s' !! \n", inFileName); + free(orig_buff); + free(compressed_buff); + free(chunkP); + return 13; + } + + /* Calculating input Checksum */ + crcOriginal = XXH32(orig_buff, benchedSize,0); + + + /* Bench */ + { + int loopNb, nb_loops, chunkNb, cAlgNb, dAlgNb; + size_t cSize=0; + double ratio=0.; + + DISPLAY("\r%79s\r", ""); + DISPLAY(" %s : \n", inFileName); + + /* Bench Compression Algorithms */ + for (cAlgNb=0; (cAlgNb <= NB_COMPRESSION_ALGORITHMS) && (g_compressionTest); cAlgNb++) + { + const char* compressorName; + int (*compressionFunction)(const char*, char*, int); + void (*initFunction)(void) = NULL; + double bestTime = 100000000.; + + /* filter compressionAlgo only */ + if ((g_compressionAlgo != ALL_COMPRESSORS) && (g_compressionAlgo != cAlgNb)) continue; + + /* Init data chunks */ + { + int i; + size_t remaining = benchedSize; + char* in = orig_buff; + char* out = compressed_buff; + nbChunks = (int) (((int)benchedSize + (g_chunkSize-1))/ g_chunkSize); + for (i=0; i g_chunkSize) { chunkP[i].origSize = g_chunkSize; remaining -= g_chunkSize; } else { chunkP[i].origSize = (int)remaining; remaining = 0; } + chunkP[i].compressedBuffer = out; out += maxCompressedChunkSize; + chunkP[i].compressedSize = 0; + } + } + + switch(cAlgNb) + { + case 0 : DISPLAY("Compression functions : \n"); continue; + case 1 : compressionFunction = local_LZ4_compress_default_large; compressorName = "LZ4_compress_default"; break; + case 2 : compressionFunction = local_LZ4_compress_default_small; compressorName = "LZ4_compress_default(small dst)"; break; + case 3 : compressionFunction = local_LZ4_compress_fast0; compressorName = "LZ4_compress_fast(0)"; break; + case 4 : compressionFunction = local_LZ4_compress_fast1; compressorName = "LZ4_compress_fast(1)"; break; + case 5 : compressionFunction = local_LZ4_compress_fast2; compressorName = "LZ4_compress_fast(2)"; break; + case 6 : compressionFunction = local_LZ4_compress_fast17; compressorName = "LZ4_compress_fast(17)"; break; + case 7 : compressionFunction = local_LZ4_compress_fast_extState0; compressorName = "LZ4_compress_fast_extState(0)"; break; + case 8 : compressionFunction = local_LZ4_compress_fast_continue0; initFunction = local_LZ4_createStream; compressorName = "LZ4_compress_fast_continue(0)"; break; + + case 10: compressionFunction = LZ4_compressHC; compressorName = "LZ4_compressHC"; break; + case 11: compressionFunction = local_LZ4_compressHC_limitedOutput; compressorName = "LZ4_compressHC_limitedOutput"; break; + case 12 : compressionFunction = local_LZ4_compressHC_withStateHC; compressorName = "LZ4_compressHC_withStateHC"; break; + case 13: compressionFunction = local_LZ4_compressHC_limitedOutput_withStateHC; compressorName = "LZ4_compressHC_limitedOutput_withStateHC"; break; + case 14: compressionFunction = local_LZ4_compressHC_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_continue"; break; + case 15: compressionFunction = local_LZ4_compressHC_limitedOutput_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_limitedOutput_continue"; break; + case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break; + case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame"; + chunkP[0].origSize = (int)benchedSize; nbChunks=1; + break; + case 40: compressionFunction = local_LZ4_saveDict; compressorName = "LZ4_saveDict"; + LZ4_loadDict(&LZ4_stream, chunkP[0].origBuffer, chunkP[0].origSize); + break; + case 41: compressionFunction = local_LZ4_saveDictHC; compressorName = "LZ4_saveDictHC"; + LZ4_loadDictHC(&LZ4_streamHC, chunkP[0].origBuffer, chunkP[0].origSize); + break; + case 60: DISPLAY("Obsolete compression functions : \n"); continue; + case 61: compressionFunction = LZ4_compress; compressorName = "LZ4_compress"; break; + case 62: compressionFunction = local_LZ4_compress_limitedOutput; compressorName = "LZ4_compress_limitedOutput"; break; + case 63: compressionFunction = local_LZ4_compress_withState; compressorName = "LZ4_compress_withState"; break; + case 64: compressionFunction = local_LZ4_compress_limitedOutput_withState; compressorName = "LZ4_compress_limitedOutput_withState"; break; + case 65: compressionFunction = local_LZ4_compress_continue; initFunction = local_LZ4_createStream; compressorName = "LZ4_compress_continue"; break; + case 66: compressionFunction = local_LZ4_compress_limitedOutput_continue; initFunction = local_LZ4_createStream; compressorName = "LZ4_compress_limitedOutput_continue"; break; + default : + continue; /* unknown ID : just skip */ + } + + for (loopNb = 1; loopNb <= g_nbIterations; loopNb++) + { + double averageTime; + int milliTime; + + PROGRESS("%1i- %-28.28s :%9i ->\r", loopNb, compressorName, (int)benchedSize); + { size_t i; for (i=0; i%9i (%5.2f%%),%7.1f MB/s\r", loopNb, compressorName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / bestTime / 1000.); + } + + if (ratio<100.) + DISPLAY("%2i-%-28.28s :%9i ->%9i (%5.2f%%),%7.1f MB/s\n", cAlgNb, compressorName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / bestTime / 1000.); + else + DISPLAY("%2i-%-28.28s :%9i ->%9i (%5.1f%%),%7.1f MB/s\n", cAlgNb, compressorName, (int)benchedSize, (int)cSize, ratio, (double)benchedSize / bestTime / 1000.); + } + + /* Prepare layout for decompression */ + /* Init data chunks */ + { + int i; + size_t remaining = benchedSize; + char* in = orig_buff; + char* out = compressed_buff; + + nbChunks = (int) (((int)benchedSize + (g_chunkSize-1))/ g_chunkSize); + for (i=0; i g_chunkSize) { chunkP[i].origSize = g_chunkSize; remaining -= g_chunkSize; } else { chunkP[i].origSize = (int)remaining; remaining = 0; } + chunkP[i].compressedBuffer = out; out += maxCompressedChunkSize; + chunkP[i].compressedSize = 0; + } + } + for (chunkNb=0; chunkNb\r", loopNb, dName, (int)benchedSize); + + nb_loops = 0; + milliTime = BMK_GetMilliStart(); + while(BMK_GetMilliStart() == milliTime); + milliTime = BMK_GetMilliStart(); + while(BMK_GetMilliSpan(milliTime) < TIMELOOP) + { + for (chunkNb=0; chunkNb %7.1f MB/s\r", loopNb, dName, (int)benchedSize, (double)benchedSize / bestTime / 1000.); + + /* CRC Checking */ + crcDecoded = XXH32(orig_buff, (int)benchedSize, 0); + if (crcOriginal!=crcDecoded) { DISPLAY("\n!!! WARNING !!! %14s : Invalid Checksum : %x != %x\n", inFileName, (unsigned)crcOriginal, (unsigned)crcDecoded); exit(1); } + } + + DISPLAY("%2i-%-29.29s :%10i -> %7.1f MB/s\n", dAlgNb, dName, (int)benchedSize, (double)benchedSize / bestTime / 1000.); + } + } + free(orig_buff); + free(compressed_buff); + free(chunkP); + } + + LZ4F_freeDecompressionContext(g_dCtx); + if (g_pause) { printf("press enter...\n"); (void)getchar(); } + + return 0; +} + + +static int usage(char* exename) +{ + DISPLAY( "Usage :\n"); + DISPLAY( " %s [arg] file1 file2 ... fileX\n", exename); + DISPLAY( "Arguments :\n"); + DISPLAY( " -c : compression tests only\n"); + DISPLAY( " -d : decompression tests only\n"); + DISPLAY( " -H/-h : Help (this text + advanced options)\n"); + return 0; +} + +static int usage_advanced(void) +{ + DISPLAY( "\nAdvanced options :\n"); + DISPLAY( " -c# : test only compression function # [1-%i]\n", NB_COMPRESSION_ALGORITHMS); + DISPLAY( " -d# : test only decompression function # [1-%i]\n", NB_DECOMPRESSION_ALGORITHMS); + DISPLAY( " -i# : iteration loops [1-9](default : %i)\n", NBLOOPS); + DISPLAY( " -B# : Block size [4-7](default : 7)\n"); + return 0; +} + +static int badusage(char* exename) +{ + DISPLAY("Wrong parameters\n"); + usage(exename); + return 0; +} + +int main(int argc, char** argv) +{ + int i, + filenamesStart=2; + char* exename=argv[0]; + char* input_filename=0; + + // Welcome message + DISPLAY(WELCOME_MESSAGE); + + if (argc<2) { badusage(exename); return 1; } + + for(i=1; i= '0') && (argument[1]<= '9')) + { + g_compressionAlgo *= 10; + g_compressionAlgo += argument[1] - '0'; + argument++; + } + break; + + // Select decompression algorithm only + case 'd': + g_compressionTest = 0; + while ((argument[1]>= '0') && (argument[1]<= '9')) + { + g_decompressionAlgo *= 10; + g_decompressionAlgo += argument[1] - '0'; + argument++; + } + break; + + // Display help on usage + case 'h' : + case 'H': usage(exename); usage_advanced(); return 0; + + // Modify Block Properties + case 'B': + while (argument[1]!=0) + switch(argument[1]) + { + case '4': + case '5': + case '6': + case '7': + { + int B = argument[1] - '0'; + int S = 1 << (8 + 2*B); + BMK_setBlocksize(S); + argument++; + break; + } + case 'D': argument++; break; + default : goto _exit_blockProperties; + } +_exit_blockProperties: + break; + + // Modify Nb Iterations + case 'i': + if ((argument[1] >='0') && (argument[1] <='9')) + { + int iters = argument[1] - '0'; + BMK_setNbIterations(iters); + argument++; + } + break; + + // Pause at the end (hidden option) + case 'p': BMK_setPause(); break; + + // Unknown command + default : badusage(exename); return 1; + } + } + continue; + } + + // first provided filename is input + if (!input_filename) { input_filename=argument; filenamesStart=i; continue; } + + } + + // No input filename ==> Error + if(!input_filename) { badusage(exename); return 1; } + + return fullSpeedBench(argv+filenamesStart, argc-filenamesStart); + +} + diff --git a/thirdparty/Lz4/Lz4_131/programs/fuzzer.c b/thirdparty/Lz4/Lz4_131/programs/fuzzer.c new file mode 100644 index 0000000..f1da1a8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/fuzzer.c @@ -0,0 +1,1233 @@ +/* + fuzzer.c - Fuzzer test tool for LZ4 + Copyright (C) Yann Collet 2012-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source mirror : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/************************************** +* Compiler options +**************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# define _CRT_SECURE_NO_WARNINGS /* fgets */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +# pragma warning(disable : 4146) /* disable: C4146: minus unsigned expression */ +# pragma warning(disable : 4310) /* disable: C4310: constant char value > 127 */ +#endif + +/* S_ISREG & gettimeofday() are not supported by MSVC */ +#if defined(_MSC_VER) || defined(_WIN32) +# define FUZ_LEGACY_TIMER 1 +#endif + + +/************************************** +* Includes +**************************************/ +#include +#include /* fgets, sscanf */ +#include /* strcmp */ +#include "lz4.h" +#include "lz4hc.h" +#include "xxhash.h" + +/* Use ftime() if gettimeofday() is not available on your target */ +#if defined(FUZ_LEGACY_TIMER) +# include /* timeb, ftime */ +#else +# include /* gettimeofday */ +#endif + + +/************************************** +* Basic Types +**************************************/ +#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# include +typedef uint8_t BYTE; +typedef uint16_t U16; +typedef uint32_t U32; +typedef int32_t S32; +typedef uint64_t U64; +#else +typedef unsigned char BYTE; +typedef unsigned short U16; +typedef unsigned int U32; +typedef signed int S32; +typedef unsigned long long U64; +#endif + + +/************************************** +* Constants +**************************************/ +#ifndef LZ4_VERSION +# define LZ4_VERSION "" +#endif + +#define NB_ATTEMPTS (1<<16) +#define COMPRESSIBLE_NOISE_LENGTH (1 << 21) +#define FUZ_MAX_BLOCK_SIZE (1 << 17) +#define FUZ_MAX_DICT_SIZE (1 << 15) +#define FUZ_COMPRESSIBILITY_DEFAULT 60 +#define PRIME1 2654435761U +#define PRIME2 2246822519U +#define PRIME3 3266489917U + +#define KB *(1U<<10) +#define MB *(1U<<20) +#define GB *(1U<<30) + + +/***************************************** +* Macros +*****************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } +static int g_displayLevel = 2; +static const U32 g_refreshRate = 250; +static U32 g_time = 0; + + +/********************************************************* +* Fuzzer functions +*********************************************************/ +#if defined(FUZ_LEGACY_TIMER) + +static U32 FUZ_GetMilliStart(void) +{ + struct timeb tb; + U32 nCount; + ftime( &tb ); + nCount = (U32) (((tb.time & 0xFFFFF) * 1000) + tb.millitm); + return nCount; +} + +#else + +static U32 FUZ_GetMilliStart(void) +{ + struct timeval tv; + U32 nCount; + gettimeofday(&tv, NULL); + nCount = (U32) (tv.tv_usec/1000 + (tv.tv_sec & 0xfffff) * 1000); + return nCount; +} + +#endif + + +static U32 FUZ_GetMilliSpan(U32 nTimeStart) +{ + U32 nCurrent = FUZ_GetMilliStart(); + U32 nSpan = nCurrent - nTimeStart; + if (nTimeStart > nCurrent) + nSpan += 0x100000 * 1000; + return nSpan; +} + +static U32 FUZ_rotl32(U32 u32, U32 nbBits) +{ + return ((u32 << nbBits) | (u32 >> (32 - nbBits))); +} + +static U32 FUZ_rand(U32* src) +{ + U32 rand32 = *src; + rand32 *= PRIME1; + rand32 ^= PRIME2; + rand32 = FUZ_rotl32(rand32, 13); + *src = rand32; + return rand32; +} + + +#define FUZ_RAND15BITS ((FUZ_rand(seed) >> 3) & 32767) +#define FUZ_RANDLENGTH ( ((FUZ_rand(seed) >> 7) & 3) ? (FUZ_rand(seed) % 15) : (FUZ_rand(seed) % 510) + 15) +static void FUZ_fillCompressibleNoiseBuffer(void* buffer, size_t bufferSize, double proba, U32* seed) +{ + BYTE* BBuffer = (BYTE*)buffer; + size_t pos = 0; + U32 P32 = (U32)(32768 * proba); + + /* First Bytes */ + while (pos < 20) + BBuffer[pos++] = (BYTE)(FUZ_rand(seed)); + + while (pos < bufferSize) + { + /* Select : Literal (noise) or copy (within 64K) */ + if (FUZ_RAND15BITS < P32) + { + /* Copy (within 64K) */ + size_t match, d; + size_t length = FUZ_RANDLENGTH + 4; + size_t offset = FUZ_RAND15BITS + 1; + while (offset > pos) offset >>= 1; + d = pos + length; + while (d > bufferSize) d = bufferSize; + match = pos - offset; + while (pos < d) BBuffer[pos++] = BBuffer[match++]; + } + else + { + /* Literal (noise) */ + size_t d; + size_t length = FUZ_RANDLENGTH; + d = pos + length; + if (d > bufferSize) d = bufferSize; + while (pos < d) BBuffer[pos++] = (BYTE)(FUZ_rand(seed) >> 5); + } + } +} + + +#define MAX_NB_BUFF_I134 150 +#define BLOCKSIZE_I134 (32 MB) +static int FUZ_AddressOverflow(void) +{ + char* buffers[MAX_NB_BUFF_I134+1]; + int i, nbBuff=0; + int highAddress = 0; + + DISPLAY("Overflow tests : "); + + /* Only possible in 32-bits */ + if (sizeof(void*)==8) + { + DISPLAY("64 bits mode : no overflow \n"); + fflush(stdout); + return 0; + } + + buffers[0] = (char*)malloc(BLOCKSIZE_I134); + buffers[1] = (char*)malloc(BLOCKSIZE_I134); + if ((!buffers[0]) || (!buffers[1])) + { + DISPLAY("not enough memory for tests \n"); + return 0; + } + + for (nbBuff=2; nbBuff < MAX_NB_BUFF_I134; nbBuff++) + { + DISPLAY("%3i \b\b\b\b", nbBuff); + buffers[nbBuff] = (char*)malloc(BLOCKSIZE_I134); + if (buffers[nbBuff]==NULL) goto _endOfTests; + //DISPLAY("%08X ", (U32)(size_t)(buffers[nbBuff])); fflush(stdout); + + if (((size_t)buffers[nbBuff] > (size_t)0x80000000) && (!highAddress)) + { + DISPLAY("high address detected : "); + fflush(stdout); + highAddress=1; + } + + { + size_t sizeToGenerateOverflow = (size_t)(- ((size_t)buffers[nbBuff-1]) + 512); + int nbOf255 = (int)((sizeToGenerateOverflow / 255) + 1); + char* input = buffers[nbBuff-1]; + char* output = buffers[nbBuff]; + int r; + input[0] = (char)0xF0; // Literal length overflow + input[1] = (char)0xFF; + input[2] = (char)0xFF; + input[3] = (char)0xFF; + for(i = 4; i <= nbOf255+4; i++) input[i] = (char)0xff; + r = LZ4_decompress_safe(input, output, nbOf255+64, BLOCKSIZE_I134); + if (r>0) goto _overflowError; + input[0] = (char)0x1F; // Match length overflow + input[1] = (char)0x01; + input[2] = (char)0x01; + input[3] = (char)0x00; + r = LZ4_decompress_safe(input, output, nbOf255+64, BLOCKSIZE_I134); + if (r>0) goto _overflowError; + + output = buffers[nbBuff-2]; // Reverse in/out pointer order + input[0] = (char)0xF0; // Literal length overflow + input[1] = (char)0xFF; + input[2] = (char)0xFF; + input[3] = (char)0xFF; + r = LZ4_decompress_safe(input, output, nbOf255+64, BLOCKSIZE_I134); + if (r>0) goto _overflowError; + input[0] = (char)0x1F; // Match length overflow + input[1] = (char)0x01; + input[2] = (char)0x01; + input[3] = (char)0x00; + r = LZ4_decompress_safe(input, output, nbOf255+64, BLOCKSIZE_I134); + if (r>0) goto _overflowError; + } + } + + nbBuff++; +_endOfTests: + for (i=0 ; i g_refreshRate) || (g_displayLevel>=3)) + { + g_time = FUZ_GetMilliStart(); + DISPLAY("\r%5u ", testNb); + if (g_displayLevel>=3) fflush(stdout); + } +} + + +static void FUZ_findDiff(const void* buff1, const void* buff2) +{ + const BYTE* b1 = (const BYTE*)buff1; + const BYTE* b2 = (const BYTE*)buff2; + size_t i=0; + while (b1[i]==b2[i]) i++; + DISPLAY("Wrong Byte at position %u\n", (unsigned)i); +} + + +static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double compressibility, U32 duration) +{ + unsigned long long bytes = 0; + unsigned long long cbytes = 0; + unsigned long long hcbytes = 0; + unsigned long long ccbytes = 0; + void* CNBuffer; + char* compressedBuffer; + char* decodedBuffer; +# define FUZ_max LZ4_COMPRESSBOUND(LEN) + int ret; + unsigned cycleNb; +# define FUZ_CHECKTEST(cond, ...) if (cond) { printf("Test %u : ", testNb); printf(__VA_ARGS__); \ + printf(" (seed %u, cycle %u) \n", seed, cycleNb); goto _output_error; } +# define FUZ_DISPLAYTEST { testNb++; g_displayLevel<3 ? 0 : printf("%2u\b\b", testNb); if (g_displayLevel==4) fflush(stdout); } + void* stateLZ4 = malloc(LZ4_sizeofState()); + void* stateLZ4HC = malloc(LZ4_sizeofStateHC()); + LZ4_stream_t LZ4dict; + LZ4_streamHC_t LZ4dictHC; + U32 crcOrig, crcCheck; + U32 coreRandState = seed; + U32 randState = coreRandState ^ PRIME3; + int result = 0; + const U32 startTime = FUZ_GetMilliStart(); + + + /* init */ + memset(&LZ4dict, 0, sizeof(LZ4dict)); + duration *= 1000; + + /* Create compressible test buffer */ + CNBuffer = malloc(COMPRESSIBLE_NOISE_LENGTH); + FUZ_fillCompressibleNoiseBuffer(CNBuffer, COMPRESSIBLE_NOISE_LENGTH, compressibility, &randState); + compressedBuffer = (char*)malloc(LZ4_compressBound(FUZ_MAX_BLOCK_SIZE)); + decodedBuffer = (char*)malloc(FUZ_MAX_DICT_SIZE + FUZ_MAX_BLOCK_SIZE); + + /* move to startCycle */ + for (cycleNb = 0; cycleNb < startCycle; cycleNb++) + { + (void)FUZ_rand(&coreRandState); + + if (0) /* some problems are related to dictionary re-use; in this case, enable this loop */ + { + int dictSize, blockSize, blockStart; + char* dict; + char* block; + FUZ_displayUpdate(cycleNb); + randState = coreRandState ^ PRIME3; + blockSize = FUZ_rand(&randState) % FUZ_MAX_BLOCK_SIZE; + blockStart = FUZ_rand(&randState) % (COMPRESSIBLE_NOISE_LENGTH - blockSize); + dictSize = FUZ_rand(&randState) % FUZ_MAX_DICT_SIZE; + if (dictSize > blockStart) dictSize = blockStart; + block = ((char*)CNBuffer) + blockStart; + dict = block - dictSize; + LZ4_loadDict(&LZ4dict, dict, dictSize); + LZ4_compress_continue(&LZ4dict, block, compressedBuffer, blockSize); + LZ4_loadDict(&LZ4dict, dict, dictSize); + LZ4_compress_continue(&LZ4dict, block, compressedBuffer, blockSize); + LZ4_loadDict(&LZ4dict, dict, dictSize); + LZ4_compress_continue(&LZ4dict, block, compressedBuffer, blockSize); + } + } + + /* Main test loop */ + for (cycleNb = startCycle; (cycleNb < nbCycles) || (FUZ_GetMilliSpan(startTime) < duration) ; cycleNb++) + { + U32 testNb = 0; + char* dict; + char* block; + int dictSize, blockSize, blockStart, compressedSize, HCcompressedSize; + int blockContinueCompressedSize; + + FUZ_displayUpdate(cycleNb); + (void)FUZ_rand(&coreRandState); + randState = coreRandState ^ PRIME3; + + /* Select block to test */ + blockSize = FUZ_rand(&randState) % FUZ_MAX_BLOCK_SIZE; + blockStart = FUZ_rand(&randState) % (COMPRESSIBLE_NOISE_LENGTH - blockSize); + dictSize = FUZ_rand(&randState) % FUZ_MAX_DICT_SIZE; + if (dictSize > blockStart) dictSize = blockStart; + block = ((char*)CNBuffer) + blockStart; + dict = block - dictSize; + + /* Compression tests */ + + /* Test compression destSize */ + FUZ_DISPLAYTEST; + { + int srcSize = blockSize; + int targetSize = srcSize * ((FUZ_rand(&randState) & 127)+1) >> 7; + char endCheck = FUZ_rand(&randState) & 255; + compressedBuffer[targetSize] = endCheck; + ret = LZ4_compress_destSize(block, compressedBuffer, &srcSize, targetSize); + FUZ_CHECKTEST(ret > targetSize, "LZ4_compress_destSize() result larger than dst buffer !"); + FUZ_CHECKTEST(compressedBuffer[targetSize] != endCheck, "LZ4_compress_destSize() overwrite dst buffer !"); + FUZ_CHECKTEST(srcSize > blockSize, "LZ4_compress_destSize() fed more than src buffer !"); + DISPLAYLEVEL(5, "destSize : %7i/%7i; content%7i/%7i ", ret, targetSize, srcSize, blockSize); + if (targetSize>0) + { + FUZ_CHECKTEST((ret==0), "LZ4_compress_destSize() compression failed"); + /* check correctness */ + FUZ_DISPLAYTEST; + + crcOrig = XXH32(block, srcSize, 0); + compressedSize = ret; + endCheck = FUZ_rand(&randState) & 255; + decodedBuffer[srcSize] = endCheck; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize, srcSize); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_safe() failed on data compressed by LZ4_compress_destSize"); + FUZ_CHECKTEST(ret!=srcSize, "LZ4_decompress_safe() failed : did not fully decompressed data"); + FUZ_CHECKTEST(decodedBuffer[srcSize] != endCheck, "LZ4_decompress_safe() overwrite dst buffer !"); + crcCheck = XXH32(decodedBuffer, srcSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe() corrupted decoded data"); + + DISPLAYLEVEL(5, " OK \n"); + } + else + DISPLAYLEVEL(5, " \n"); + } + + /* Test compression HC */ + FUZ_DISPLAYTEST; + ret = LZ4_compressHC(block, compressedBuffer, blockSize); + FUZ_CHECKTEST(ret==0, "LZ4_compressHC() failed"); + HCcompressedSize = ret; + + /* Test compression HC using external state */ + FUZ_DISPLAYTEST; + ret = LZ4_compressHC_withStateHC(stateLZ4HC, block, compressedBuffer, blockSize); + FUZ_CHECKTEST(ret==0, "LZ4_compressHC_withStateHC() failed"); + + /* Test compression using external state */ + FUZ_DISPLAYTEST; + ret = LZ4_compress_withState(stateLZ4, block, compressedBuffer, blockSize); + FUZ_CHECKTEST(ret==0, "LZ4_compress_withState() failed"); + + /* Test compression */ + FUZ_DISPLAYTEST; + ret = LZ4_compress(block, compressedBuffer, blockSize); + FUZ_CHECKTEST(ret==0, "LZ4_compress() failed"); + compressedSize = ret; + + /* Decompression tests */ + + crcOrig = XXH32(block, blockSize, 0); + + /* Test decoding with output size being exactly what's necessary => must work */ + FUZ_DISPLAYTEST; + ret = LZ4_decompress_fast(compressedBuffer, decodedBuffer, blockSize); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_fast failed despite correct space"); + FUZ_CHECKTEST(ret!=compressedSize, "LZ4_decompress_fast failed : did not fully read compressed data"); + crcCheck = XXH32(decodedBuffer, blockSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_fast corrupted decoded data"); + + /* Test decoding with one byte missing => must fail */ + FUZ_DISPLAYTEST; + decodedBuffer[blockSize-1] = 0; + ret = LZ4_decompress_fast(compressedBuffer, decodedBuffer, blockSize-1); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_fast should have failed, due to Output Size being too small"); + FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_fast overrun specified output buffer"); + + /* Test decoding with one byte too much => must fail */ + FUZ_DISPLAYTEST; + ret = LZ4_decompress_fast(compressedBuffer, decodedBuffer, blockSize+1); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_fast should have failed, due to Output Size being too large"); + + /* Test decoding with output size exactly what's necessary => must work */ + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize, blockSize); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_safe failed despite sufficient space"); + FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe did not regenerate original data"); + FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe overrun specified output buffer size"); + crcCheck = XXH32(decodedBuffer, blockSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe corrupted decoded data"); + + // Test decoding with more than enough output size => must work + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + decodedBuffer[blockSize+1] = 0; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize, blockSize+1); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_safe failed despite amply sufficient space"); + FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe did not regenerate original data"); + //FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe wrote more than (unknown) target size"); // well, is that an issue ? + FUZ_CHECKTEST(decodedBuffer[blockSize+1], "LZ4_decompress_safe overrun specified output buffer size"); + crcCheck = XXH32(decodedBuffer, blockSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe corrupted decoded data"); + + // Test decoding with output size being one byte too short => must fail + FUZ_DISPLAYTEST; + decodedBuffer[blockSize-1] = 0; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize, blockSize-1); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe should have failed, due to Output Size being one byte too short"); + FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe overrun specified output buffer size"); + + // Test decoding with output size being 10 bytes too short => must fail + FUZ_DISPLAYTEST; + if (blockSize>10) + { + decodedBuffer[blockSize-10] = 0; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize, blockSize-10); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe should have failed, due to Output Size being 10 bytes too short"); + FUZ_CHECKTEST(decodedBuffer[blockSize-10], "LZ4_decompress_safe overrun specified output buffer size"); + } + + // Test decoding with input size being one byte too short => must fail + FUZ_DISPLAYTEST; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize-1, blockSize); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe should have failed, due to input size being one byte too short (blockSize=%i, ret=%i, compressedSize=%i)", blockSize, ret, compressedSize); + + // Test decoding with input size being one byte too large => must fail + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + ret = LZ4_decompress_safe(compressedBuffer, decodedBuffer, compressedSize+1, blockSize); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe should have failed, due to input size being too large"); + FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe overrun specified output buffer size"); + + // Test partial decoding with target output size being max/2 => must work + FUZ_DISPLAYTEST; + ret = LZ4_decompress_safe_partial(compressedBuffer, decodedBuffer, compressedSize, blockSize/2, blockSize); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_safe_partial failed despite sufficient space"); + + // Test partial decoding with target output size being just below max => must work + FUZ_DISPLAYTEST; + ret = LZ4_decompress_safe_partial(compressedBuffer, decodedBuffer, compressedSize, blockSize-3, blockSize); + FUZ_CHECKTEST(ret<0, "LZ4_decompress_safe_partial failed despite sufficient space"); + + /* Test Compression with limited output size */ + + /* Test compression with output size being exactly what's necessary (should work) */ + FUZ_DISPLAYTEST; + ret = LZ4_compress_limitedOutput(block, compressedBuffer, blockSize, compressedSize); + FUZ_CHECKTEST(ret==0, "LZ4_compress_limitedOutput() failed despite sufficient space"); + + /* Test compression with output size being exactly what's necessary and external state (should work) */ + FUZ_DISPLAYTEST; + ret = LZ4_compress_limitedOutput_withState(stateLZ4, block, compressedBuffer, blockSize, compressedSize); + FUZ_CHECKTEST(ret==0, "LZ4_compress_limitedOutput_withState() failed despite sufficient space"); + + /* Test HC compression with output size being exactly what's necessary (should work) */ + FUZ_DISPLAYTEST; + ret = LZ4_compressHC_limitedOutput(block, compressedBuffer, blockSize, HCcompressedSize); + FUZ_CHECKTEST(ret==0, "LZ4_compressHC_limitedOutput() failed despite sufficient space"); + + /* Test HC compression with output size being exactly what's necessary (should work) */ + FUZ_DISPLAYTEST; + ret = LZ4_compressHC_limitedOutput_withStateHC(stateLZ4HC, block, compressedBuffer, blockSize, HCcompressedSize); + FUZ_CHECKTEST(ret==0, "LZ4_compressHC_limitedOutput_withStateHC() failed despite sufficient space"); + + /* Test compression with missing bytes into output buffer => must fail */ + FUZ_DISPLAYTEST; + { + int missingBytes = (FUZ_rand(&randState) % 0x3F) + 1; + if (missingBytes >= compressedSize) missingBytes = compressedSize-1; + missingBytes += !missingBytes; /* avoid special case missingBytes==0 */ + compressedBuffer[compressedSize-missingBytes] = 0; + ret = LZ4_compress_limitedOutput(block, compressedBuffer, blockSize, compressedSize-missingBytes); + FUZ_CHECKTEST(ret, "LZ4_compress_limitedOutput should have failed (output buffer too small by %i byte)", missingBytes); + FUZ_CHECKTEST(compressedBuffer[compressedSize-missingBytes], "LZ4_compress_limitedOutput overran output buffer ! (%i missingBytes)", missingBytes) + } + + /* Test HC compression with missing bytes into output buffer => must fail */ + FUZ_DISPLAYTEST; + { + int missingBytes = (FUZ_rand(&randState) % 0x3F) + 1; + if (missingBytes >= HCcompressedSize) missingBytes = HCcompressedSize-1; + missingBytes += !missingBytes; /* avoid special case missingBytes==0 */ + compressedBuffer[HCcompressedSize-missingBytes] = 0; + ret = LZ4_compressHC_limitedOutput(block, compressedBuffer, blockSize, HCcompressedSize-missingBytes); + FUZ_CHECKTEST(ret, "LZ4_compressHC_limitedOutput should have failed (output buffer too small by %i byte)", missingBytes); + FUZ_CHECKTEST(compressedBuffer[HCcompressedSize-missingBytes], "LZ4_compressHC_limitedOutput overran output buffer ! (%i missingBytes)", missingBytes) + } + + + /********************/ + /* Dictionary tests */ + /********************/ + + /* Compress using dictionary */ + FUZ_DISPLAYTEST; + { + LZ4_stream_t LZ4_stream; + LZ4_resetStream(&LZ4_stream); + LZ4_compress_continue (&LZ4_stream, dict, compressedBuffer, dictSize); /* Just to fill hash tables */ + blockContinueCompressedSize = LZ4_compress_continue (&LZ4_stream, block, compressedBuffer, blockSize); + FUZ_CHECKTEST(blockContinueCompressedSize==0, "LZ4_compress_continue failed"); + } + + /* Decompress with dictionary as prefix */ + FUZ_DISPLAYTEST; + memcpy(decodedBuffer, dict, dictSize); + ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer+dictSize, blockSize, decodedBuffer, dictSize); + FUZ_CHECKTEST(ret!=blockContinueCompressedSize, "LZ4_decompress_fast_withPrefix64k did not read all compressed block input"); + crcCheck = XXH32(decodedBuffer+dictSize, blockSize, 0); + if (crcCheck!=crcOrig) + { + int i=0; + while (block[i]==decodedBuffer[i]) i++; + printf("Wrong Byte at position %i/%i\n", i, blockSize); + + } + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_fast_withPrefix64k corrupted decoded data (dict %i)", dictSize); + + FUZ_DISPLAYTEST; + ret = LZ4_decompress_safe_usingDict(compressedBuffer, decodedBuffer+dictSize, blockContinueCompressedSize, blockSize, decodedBuffer, dictSize); + FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); + crcCheck = XXH32(decodedBuffer+dictSize, blockSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe_usingDict corrupted decoded data"); + + /* Compress using External dictionary */ + FUZ_DISPLAYTEST; + dict -= (FUZ_rand(&randState) & 0xF) + 1; /* Separation, so it is an ExtDict */ + if (dict < (char*)CNBuffer) dict = (char*)CNBuffer; + LZ4_loadDict(&LZ4dict, dict, dictSize); + blockContinueCompressedSize = LZ4_compress_continue(&LZ4dict, block, compressedBuffer, blockSize); + FUZ_CHECKTEST(blockContinueCompressedSize==0, "LZ4_compress_continue failed"); + + FUZ_DISPLAYTEST; + LZ4_loadDict(&LZ4dict, dict, dictSize); + ret = LZ4_compress_limitedOutput_continue(&LZ4dict, block, compressedBuffer, blockSize, blockContinueCompressedSize-1); + FUZ_CHECKTEST(ret>0, "LZ4_compress_limitedOutput_continue using ExtDict should fail : one missing byte for output buffer : %i written, %i buffer", ret, blockContinueCompressedSize); + + FUZ_DISPLAYTEST; + LZ4_loadDict(&LZ4dict, dict, dictSize); + ret = LZ4_compress_limitedOutput_continue(&LZ4dict, block, compressedBuffer, blockSize, blockContinueCompressedSize); + FUZ_CHECKTEST(ret!=blockContinueCompressedSize, "LZ4_compress_limitedOutput_compressed size is different (%i != %i)", ret, blockContinueCompressedSize); + FUZ_CHECKTEST(ret<=0, "LZ4_compress_limitedOutput_continue should work : enough size available within output buffer"); + + /* Decompress with dictionary as external */ + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize, dict, dictSize); + FUZ_CHECKTEST(ret!=blockContinueCompressedSize, "LZ4_decompress_fast_usingDict did not read all compressed block input"); + FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_fast_usingDict overrun specified output buffer size") + crcCheck = XXH32(decodedBuffer, blockSize, 0); + if (crcCheck!=crcOrig) + FUZ_findDiff(block, decodedBuffer); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_fast_usingDict corrupted decoded data (dict %i)", dictSize); + + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + ret = LZ4_decompress_safe_usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); + FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); + FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output buffer size") + crcCheck = XXH32(decodedBuffer, blockSize, 0); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe_usingDict corrupted decoded data"); + + FUZ_DISPLAYTEST; + decodedBuffer[blockSize-1] = 0; + ret = LZ4_decompress_fast_usingDict(compressedBuffer, decodedBuffer, blockSize-1, dict, dictSize); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_fast_usingDict should have failed : wrong original size (-1 byte)"); + FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_fast_usingDict overrun specified output buffer size"); + + FUZ_DISPLAYTEST; + decodedBuffer[blockSize-1] = 0; + ret = LZ4_decompress_safe_usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-1, dict, dictSize); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe_usingDict should have failed : not enough output size (-1 byte)"); + FUZ_CHECKTEST(decodedBuffer[blockSize-1], "LZ4_decompress_safe_usingDict overrun specified output buffer size"); + + FUZ_DISPLAYTEST; + { + U32 missingBytes = (FUZ_rand(&randState) & 0xF) + 2; + if ((U32)blockSize > missingBytes) + { + decodedBuffer[blockSize-missingBytes] = 0; + ret = LZ4_decompress_safe_usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize-missingBytes, dict, dictSize); + FUZ_CHECKTEST(ret>=0, "LZ4_decompress_safe_usingDict should have failed : output buffer too small (-%u byte)", missingBytes); + FUZ_CHECKTEST(decodedBuffer[blockSize-missingBytes], "LZ4_decompress_safe_usingDict overrun specified output buffer size (-%u byte) (blockSize=%i)", missingBytes, blockSize); + } + } + + /* Compress HC using External dictionary */ + FUZ_DISPLAYTEST; + dict -= (FUZ_rand(&randState) & 7); /* even bigger separation */ + if (dict < (char*)CNBuffer) dict = (char*)CNBuffer; + LZ4_resetStreamHC (&LZ4dictHC, FUZ_rand(&randState) & 0x7); + LZ4_loadDictHC(&LZ4dictHC, dict, dictSize); + blockContinueCompressedSize = LZ4_compressHC_continue(&LZ4dictHC, block, compressedBuffer, blockSize); + FUZ_CHECKTEST(blockContinueCompressedSize==0, "LZ4_compressHC_continue failed"); + + FUZ_DISPLAYTEST; + LZ4_loadDictHC(&LZ4dictHC, dict, dictSize); + ret = LZ4_compressHC_limitedOutput_continue(&LZ4dictHC, block, compressedBuffer, blockSize, blockContinueCompressedSize-1); + FUZ_CHECKTEST(ret>0, "LZ4_compressHC_limitedOutput_continue using ExtDict should fail : one missing byte for output buffer"); + + FUZ_DISPLAYTEST; + LZ4_loadDictHC(&LZ4dictHC, dict, dictSize); + ret = LZ4_compressHC_limitedOutput_continue(&LZ4dictHC, block, compressedBuffer, blockSize, blockContinueCompressedSize); + FUZ_CHECKTEST(ret!=blockContinueCompressedSize, "LZ4_compress_limitedOutput_compressed size is different (%i != %i)", ret, blockContinueCompressedSize); + FUZ_CHECKTEST(ret<=0, "LZ4_compress_limitedOutput_continue should work : enough size available within output buffer"); + + FUZ_DISPLAYTEST; + decodedBuffer[blockSize] = 0; + ret = LZ4_decompress_safe_usingDict(compressedBuffer, decodedBuffer, blockContinueCompressedSize, blockSize, dict, dictSize); + FUZ_CHECKTEST(ret!=blockSize, "LZ4_decompress_safe_usingDict did not regenerate original data"); + FUZ_CHECKTEST(decodedBuffer[blockSize], "LZ4_decompress_safe_usingDict overrun specified output buffer size") + crcCheck = XXH32(decodedBuffer, blockSize, 0); + if (crcCheck!=crcOrig) + FUZ_findDiff(block, decodedBuffer); + FUZ_CHECKTEST(crcCheck!=crcOrig, "LZ4_decompress_safe_usingDict corrupted decoded data"); + + /* ***** End of tests *** */ + /* Fill stats */ + bytes += blockSize; + cbytes += compressedSize; + hcbytes += HCcompressedSize; + ccbytes += blockContinueCompressedSize; + } + + if (nbCycles<=1) nbCycles = cycleNb; /* end by time */ + bytes += !bytes; /* avoid division by 0 */ + printf("\r%7u /%7u - ", cycleNb, nbCycles); + printf("all tests completed successfully \n"); + printf("compression ratio: %0.3f%%\n", (double)cbytes/bytes*100); + printf("HC compression ratio: %0.3f%%\n", (double)hcbytes/bytes*100); + printf("ratio with dict: %0.3f%%\n", (double)ccbytes/bytes*100); + + /* release memory */ + { +_exit: + free(CNBuffer); + free(compressedBuffer); + free(decodedBuffer); + free(stateLZ4); + free(stateLZ4HC); + return result; + +_output_error: + result = 1; + goto _exit; + } +} + + +#define testInputSize (192 KB) +#define testCompressedSize (128 KB) +#define ringBufferSize (8 KB) + +static void FUZ_unitTests(void) +{ + const unsigned testNb = 0; + const unsigned seed = 0; + const unsigned cycleNb= 0; + char testInput[testInputSize]; + char testCompressed[testCompressedSize]; + char testVerify[testInputSize]; + char ringBuffer[ringBufferSize]; + U32 randState = 1; + + /* Init */ + FUZ_fillCompressibleNoiseBuffer(testInput, testInputSize, 0.50, &randState); + + /* 32-bits address space overflow test */ + FUZ_AddressOverflow(); + + /* LZ4 streaming tests */ + { + LZ4_stream_t* statePtr; + LZ4_stream_t streamingState; + U64 crcOrig; + U64 crcNew; + int result; + + /* Allocation test */ + statePtr = LZ4_createStream(); + FUZ_CHECKTEST(statePtr==NULL, "LZ4_createStream() allocation failed"); + LZ4_freeStream(statePtr); + + /* simple compression test */ + crcOrig = XXH64(testInput, testCompressedSize, 0); + LZ4_resetStream(&streamingState); + result = LZ4_compress_limitedOutput_continue(&streamingState, testInput, testCompressed, testCompressedSize, testCompressedSize-1); + FUZ_CHECKTEST(result==0, "LZ4_compress_limitedOutput_continue() compression failed"); + + result = LZ4_decompress_safe(testCompressed, testVerify, result, testCompressedSize); + FUZ_CHECKTEST(result!=(int)testCompressedSize, "LZ4_decompress_safe() decompression failed"); + crcNew = XXH64(testVerify, testCompressedSize, 0); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe() decompression corruption"); + + /* ring buffer test */ + { + XXH64_state_t xxhOrig; + XXH64_state_t xxhNew; + LZ4_streamDecode_t decodeState; + const U32 maxMessageSizeLog = 10; + const U32 maxMessageSizeMask = (1< ringBufferSize) rNext = 0; + if (dNext + messageSize > dBufferSize) dNext = 0; + } + } + } + + /* LZ4 HC streaming tests */ + { + LZ4_streamHC_t* sp; + LZ4_streamHC_t sHC; + U64 crcOrig; + U64 crcNew; + int result; + + /* Allocation test */ + sp = LZ4_createStreamHC(); + FUZ_CHECKTEST(sp==NULL, "LZ4_createStreamHC() allocation failed"); + LZ4_freeStreamHC(sp); + + /* simple HC compression test */ + crcOrig = XXH64(testInput, testCompressedSize, 0); + LZ4_resetStreamHC(&sHC, 0); + result = LZ4_compressHC_limitedOutput_continue(&sHC, testInput, testCompressed, testCompressedSize, testCompressedSize-1); + FUZ_CHECKTEST(result==0, "LZ4_compressHC_limitedOutput_continue() compression failed"); + + result = LZ4_decompress_safe(testCompressed, testVerify, result, testCompressedSize); + FUZ_CHECKTEST(result!=(int)testCompressedSize, "LZ4_decompress_safe() decompression failed"); + crcNew = XXH64(testVerify, testCompressedSize, 0); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe() decompression corruption"); + + /* simple dictionary HC compression test */ + crcOrig = XXH64(testInput + 64 KB, testCompressedSize, 0); + LZ4_resetStreamHC(&sHC, 0); + LZ4_loadDictHC(&sHC, testInput, 64 KB); + result = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + 64 KB, testCompressed, testCompressedSize, testCompressedSize-1); + FUZ_CHECKTEST(result==0, "LZ4_compressHC_limitedOutput_continue() dictionary compression failed : result = %i", result); + + result = LZ4_decompress_safe_usingDict(testCompressed, testVerify, result, testCompressedSize, testInput, 64 KB); + FUZ_CHECKTEST(result!=(int)testCompressedSize, "LZ4_decompress_safe() simple dictionary decompression test failed"); + crcNew = XXH64(testVerify, testCompressedSize, 0); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe() simple dictionary decompression test : corruption"); + + /* multiple HC compression test with dictionary */ + { + int result1, result2; + int segSize = testCompressedSize / 2; + crcOrig = XXH64(testInput + segSize, testCompressedSize, 0); + LZ4_resetStreamHC(&sHC, 0); + LZ4_loadDictHC(&sHC, testInput, segSize); + result1 = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + segSize, testCompressed, segSize, segSize -1); + FUZ_CHECKTEST(result1==0, "LZ4_compressHC_limitedOutput_continue() dictionary compression failed : result = %i", result1); + result2 = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + 2*segSize, testCompressed+result1, segSize, segSize-1); + FUZ_CHECKTEST(result2==0, "LZ4_compressHC_limitedOutput_continue() dictionary compression failed : result = %i", result2); + + result = LZ4_decompress_safe_usingDict(testCompressed, testVerify, result1, segSize, testInput, segSize); + FUZ_CHECKTEST(result!=segSize, "LZ4_decompress_safe() dictionary decompression part 1 failed"); + result = LZ4_decompress_safe_usingDict(testCompressed+result1, testVerify+segSize, result2, segSize, testInput, 2*segSize); + FUZ_CHECKTEST(result!=segSize, "LZ4_decompress_safe() dictionary decompression part 2 failed"); + crcNew = XXH64(testVerify, testCompressedSize, 0); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe() dictionary decompression corruption"); + } + + /* remote dictionary HC compression test */ + crcOrig = XXH64(testInput + 64 KB, testCompressedSize, 0); + LZ4_resetStreamHC(&sHC, 0); + LZ4_loadDictHC(&sHC, testInput, 32 KB); + result = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + 64 KB, testCompressed, testCompressedSize, testCompressedSize-1); + FUZ_CHECKTEST(result==0, "LZ4_compressHC_limitedOutput_continue() remote dictionary failed : result = %i", result); + + result = LZ4_decompress_safe_usingDict(testCompressed, testVerify, result, testCompressedSize, testInput, 32 KB); + FUZ_CHECKTEST(result!=(int)testCompressedSize, "LZ4_decompress_safe_usingDict() decompression failed following remote dictionary HC compression test"); + crcNew = XXH64(testVerify, testCompressedSize, 0); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe_usingDict() decompression corruption"); + + /* multiple HC compression with ext. dictionary */ + { + XXH64_state_t crcOrigState; + XXH64_state_t crcNewState; + const char* dict = testInput + 3; + int dictSize = (FUZ_rand(&randState) & 8191); + char* dst = testVerify; + + size_t segStart = dictSize + 7; + int segSize = (FUZ_rand(&randState) & 8191); + int segNb = 1; + + LZ4_resetStreamHC(&sHC, 0); + LZ4_loadDictHC(&sHC, dict, dictSize); + + XXH64_reset(&crcOrigState, 0); + XXH64_reset(&crcNewState, 0); + + while (segStart + segSize < testInputSize) + { + XXH64_update(&crcOrigState, testInput + segStart, segSize); + crcOrig = XXH64_digest(&crcOrigState); + result = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + segStart, testCompressed, segSize, LZ4_compressBound(segSize)); + FUZ_CHECKTEST(result==0, "LZ4_compressHC_limitedOutput_continue() dictionary compression failed : result = %i", result); + + result = LZ4_decompress_safe_usingDict(testCompressed, dst, result, segSize, dict, dictSize); + FUZ_CHECKTEST(result!=segSize, "LZ4_decompress_safe_usingDict() dictionary decompression part %i failed", segNb); + XXH64_update(&crcNewState, dst, segSize); + crcNew = XXH64_digest(&crcNewState); + if (crcOrig!=crcNew) + { + size_t c=0; + while (dst[c] == testInput[segStart+c]) c++; + DISPLAY("Bad decompression at %u / %u \n", (U32)c, (U32)segSize); + } + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe_usingDict() part %i corruption", segNb); + + dict = dst; + //dict = testInput + segStart; + dictSize = segSize; + + dst += segSize + 1; + segNb ++; + + segStart += segSize + (FUZ_rand(&randState) & 0xF) + 1; + segSize = (FUZ_rand(&randState) & 8191); + } + } + + /* ring buffer test */ + { + XXH64_state_t xxhOrig; + XXH64_state_t xxhNew; + LZ4_streamDecode_t decodeState; + const U32 maxMessageSizeLog = 10; + const U32 maxMessageSizeMask = (1< ringBufferSize) rNext = 0; + if (dNext + messageSize > dBufferSize) dNext = 0; + } + } + + /* small decoder-side ring buffer test */ + { + XXH64_state_t xxhOrig; + XXH64_state_t xxhNew; + LZ4_streamDecode_t decodeState; + const U32 maxMessageSizeLog = 12; + const U32 maxMessageSizeMask = (1< dBufferSize) dNext = 0; + + while (totalMessageSize < 9 MB) + { + XXH64_update(&xxhOrig, testInput + iNext, messageSize); + crcOrig = XXH64_digest(&xxhOrig); + + result = LZ4_compressHC_limitedOutput_continue(&sHC, testInput + iNext, testCompressed, messageSize, testCompressedSize-ringBufferSize); + FUZ_CHECKTEST(result==0, "LZ4_compressHC_limitedOutput_continue() compression failed"); + + result = LZ4_decompress_safe_continue(&decodeState, testCompressed, testVerify + dNext, result, messageSize); + FUZ_CHECKTEST(result!=(int)messageSize, "64K D.ringBuffer : LZ4_decompress_safe() test failed"); + + XXH64_update(&xxhNew, testVerify + dNext, messageSize); + crcNew = XXH64_digest(&xxhNew); + if (crcOrig != crcNew) + FUZ_findDiff(testInput + iNext, testVerify + dNext); + FUZ_CHECKTEST(crcOrig!=crcNew, "LZ4_decompress_safe() decompression corruption during small decoder-side ring buffer test"); + + /* prepare next message */ + dNext += messageSize; + totalMessageSize += messageSize; + messageSize = (FUZ_rand(&randState) & maxMessageSizeMask) + 1; + iNext = (FUZ_rand(&randState) & 65535); + if (dNext > dBufferSize) dNext = 0; + } + } + } + + printf("All unit tests completed successfully \n"); + return; +_output_error: + exit(1); +} + + +static int FUZ_usage(char* programName) +{ + DISPLAY( "Usage :\n"); + DISPLAY( " %s [args]\n", programName); + DISPLAY( "\n"); + DISPLAY( "Arguments :\n"); + DISPLAY( " -i# : Nb of tests (default:%i) \n", NB_ATTEMPTS); + DISPLAY( " -T# : Duration of tests, in seconds (default: use Nb of tests) \n"); + DISPLAY( " -s# : Select seed (default:prompt user)\n"); + DISPLAY( " -t# : Select starting test number (default:0)\n"); + DISPLAY( " -P# : Select compressibility in %% (default:%i%%)\n", FUZ_COMPRESSIBILITY_DEFAULT); + DISPLAY( " -v : verbose\n"); + DISPLAY( " -p : pause at the end\n"); + DISPLAY( " -h : display help and exit\n"); + return 0; +} + + +int main(int argc, char** argv) +{ + U32 seed=0; + int seedset=0; + int argNb; + int nbTests = NB_ATTEMPTS; + int testNb = 0; + int proba = FUZ_COMPRESSIBILITY_DEFAULT; + int pause = 0; + char* programName = argv[0]; + U32 duration = 0; + + /* Check command line */ + for(argNb=1; argNb='0') && (*argument<='9')) + { + nbTests *= 10; + nbTests += *argument - '0'; + argument++; + } + break; + + case 'T': + argument++; + nbTests = 0; duration = 0; + for (;;) + { + switch(*argument) + { + case 'm': duration *= 60; argument++; continue; + case 's': + case 'n': argument++; continue; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': duration *= 10; duration += *argument++ - '0'; continue; + } + break; + } + break; + + case 's': + argument++; + seed=0; seedset=1; + while ((*argument>='0') && (*argument<='9')) + { + seed *= 10; + seed += *argument - '0'; + argument++; + } + break; + + case 't': /* select starting test nb */ + argument++; + testNb=0; + while ((*argument>='0') && (*argument<='9')) + { + testNb *= 10; + testNb += *argument - '0'; + argument++; + } + break; + + case 'P': /* change probability */ + argument++; + proba=0; + while ((*argument>='0') && (*argument<='9')) + { + proba *= 10; + proba += *argument - '0'; + argument++; + } + if (proba<0) proba=0; + if (proba>100) proba=100; + break; + default: ; + } + } + } + } + + printf("Starting LZ4 fuzzer (%i-bits, %s)\n", (int)(sizeof(size_t)*8), LZ4_VERSION); + + if (!seedset) seed = FUZ_GetMilliStart() % 10000; + printf("Seed = %u\n", seed); + if (proba!=FUZ_COMPRESSIBILITY_DEFAULT) printf("Compressibility : %i%%\n", proba); + + if ((seedset==0) && (testNb==0)) FUZ_unitTests(); + + if (nbTests<=0) nbTests=1; + + { + int result = FUZ_test(seed, nbTests, testNb, ((double)proba) / 100, duration); + if (pause) + { + DISPLAY("press enter ... \n"); + (void)getchar(); + } + return result; + } +} diff --git a/thirdparty/Lz4/Lz4_131/programs/lz4.1 b/thirdparty/Lz4/Lz4_131/programs/lz4.1 new file mode 100644 index 0000000..414da48 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/lz4.1 @@ -0,0 +1,221 @@ +\" +\" lz4.1: This is a manual page for 'lz4' program. This file is part of the +\" lz4 project. +\" Author: Yann Collet +\" + +\" No hyphenation +.hy 0 +.nr HY 0 + +.TH lz4 "1" "2015-03-21" "lz4" "User Commands" +.SH NAME +\fBlz4, unlz4, lz4cat\fR \- Compress or decompress .lz4 files + +.SH SYNOPSIS +.TP 5 +\fBlz4\fR [\fBOPTIONS\fR] [-|INPUT-FILE] +.PP +.B unlz4 +is equivalent to +.BR "lz4 \-d" +.br +.B lz4cat +is equivalent to +.BR "lz4 \-dc" +.br +.PP +When writing scripts that need to decompress files, +it is recommended to always use the name +.B lz4 +with appropriate arguments +.RB ( "lz4 \-d" +or +.BR "lz4 \-dc" ) +instead of the names +.B unlz4 +and +.BR lz4cat . + + +.SH DESCRIPTION +.PP +\fBlz4\fR is an extremely fast lossless compression algorithm, +based on \fBbyte-aligned LZ77\fR family of compression scheme. +\fBlz4\fR offers compression speeds of 400 MB/s per core, linearly scalable with multi-core CPUs. +It features an extremely fast decoder, with speed in multiple GB/s per core, +typically reaching RAM speed limit on multi-core systems. +.B lz4 +supports a command line syntax similar to +.BR gzip (1). +The native file format is the +.B .lz4 +format. + +.SS "Concatenation of .lz4 files" +It is possible to concatenate +.B .lz4 +files as is. +.B lz4 +will decompress such files as if they were a single +.B .lz4 +file. For example: + lz4 file1 > foo.lz4 + lz4 file2 >> foo.lz4 + then + lz4cat foo.lz4 + is equivalent to : + cat file1 file2 + +.PP + +.SH OPTIONS +. +.SS "Short commands concatenation" +In some cases, some options can be expressed using short command +.B "-x" +or long command +.B "--long-word" . +Short commands can be concatenated together. For example, +.B "-d -c" +is equivalent to +.B "-dc" . +Long commands cannot be concatenated. +They must be clearly separated by a space. +.SS "Multiple commands" +When multiple contradictory commands are issued on a same command line, +only the latest one will be applied. +. +.SS "Operation mode" +.TP +.BR \-z ", " \-\-compress +Compress. +This is the default operation mode +when no operation mode option is specified , +no other operation mode is implied from the command name +(for example, +.B unlz4 +implies +.B \-\-decompress ), +nor from the input file name +(for example, a file extension +.B .lz4 +implies +.B \-\-decompress +by default). +.B -z +can also be used to force compression of an already compressed +.B .lz4 +file. +.TP +.BR \-d ", " \-\-decompress ", " \-\-uncompress +Decompress. +.B --decompress +is also the default operation when the input filename has an +.B .lz4 +extensionq +.TP +.BR \-t ", " \-\-test +Test the integrity of compressed +.B .lz4 +files. +The decompressed data is discarded. +No files are created nor removed. +. +.SS "Operation modifiers" +.TP +.B \-1 + fast compression (default) +.TP +.B \-9 + high compression + +.TP +.BR \-f ", " --[no-]force + This option has several effects: +.RS +.IP \(bu 3 +If the target file already exists, +overwrite it without prompting. +.IP \(bu 3 +When used with +.B \-\-decompress +and +.B lz4 +cannot recognize the type of the source file, +copy the source file as is to standard output. +This allows +.B lz4cat +.B \-\-force +to be used like +.BR cat (1) +for files that have not been compressed with +.BR lz4 . +.RE + +.TP +.BR \-c ", " \--stdout ", " \--to-stdout + force write to standard output, even if it is the console + +.TP +.BR \-m ", " \--multiple + Multiple file names. + By default, the second filename is used as the output filename for the compressed file. + With +.B -m +, you can specify any number of input filenames. Each of them will be compressed +independently, and the resulting name of the compressed file will be +.B filename.lz4 +. + +.TP +.B \-B# + block size [4-7](default : 7) + B4= 64KB ; B5= 256KB ; B6= 1MB ; B7= 4MB +.TP +.B \-BD + block dependency (improve compression ratio) +.TP +.B \--[no-]frame-crc + select frame checksum (default:enabled) +.TP +.B \--[no-]content-size + header includes original size (default:not present) + Note : this option can only be activated when the original size can be determined, +hence for a file. It won't work with unknown source size, such as stdin or pipe. +.TP +.B \--[no-]sparse + sparse mode support (default:enabled on file, disabled on stdout) +.TP +.B \-l + use Legacy format (useful for Linux Kernel compression) +. +.SS "Other options" +.TP +.BR \-v ", " --verbose + verbose mode +.TP +.BR \-q ", " --quiet + suppress warnings; specify twice to suppress errors too +.TP +.B \-h/\-H + display help/long help and exit +.TP +.BR \-V ", " \--version + display Version number and exit +.TP +.BR \-k ", " \--keep + Don't delete source file. +This is default behavior anyway, so this option is just for compatibility with gzip/xz. +.TP +.B \-b + benchmark file(s) +.TP +.B \-i# + iteration loops [1-9](default : 3), benchmark mode only + +.SH BUGS +Report bugs at: https://github.com/Cyan4973/lz4 + +.SH AUTHOR +Yann Collet diff --git a/thirdparty/Lz4/Lz4_131/programs/lz4cli.c b/thirdparty/Lz4/Lz4_131/programs/lz4cli.c new file mode 100644 index 0000000..cc5c96a --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/lz4cli.c @@ -0,0 +1,567 @@ +/* + LZ4cli - LZ4 Command Line Interface + Copyright (C) Yann Collet 2011-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +/* + Note : this is stand-alone program. + It is not part of LZ4 compression library, it is a user program of the LZ4 library. + The license of LZ4 library is BSD. + The license of xxHash library is BSD. + The license of this compression CLI program is GPLv2. +*/ + +/************************************** +* Tuning parameters +***************************************/ +/* ENABLE_LZ4C_LEGACY_OPTIONS : + Control the availability of -c0, -c1 and -hc legacy arguments + Default : Legacy options are disabled */ +/* #define ENABLE_LZ4C_LEGACY_OPTIONS */ + + +/************************************** +* Compiler Options +***************************************/ +/* Disable some Visual warning messages */ +#ifdef _MSC_VER +# define _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_DEPRECATE /* VS2005 */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +#endif + +#define _POSIX_SOURCE 1 /* for fileno() within on unix */ + + +/**************************** +* Includes +*****************************/ +#include /* fprintf, getchar */ +#include /* exit, calloc, free */ +#include /* strcmp, strlen */ +#include "bench.h" /* BMK_benchFile, BMK_SetNbIterations, BMK_SetBlocksize, BMK_SetPause */ +#include "lz4io.h" /* LZ4IO_compressFilename, LZ4IO_decompressFilename, LZ4IO_compressMultipleFilenames */ + + +/**************************** +* OS-specific Includes +*****************************/ +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) +# include /* _isatty */ +# if defined(__DJGPP__) +# include +# define _isatty isatty +# define _fileno fileno +# endif +# ifdef __MINGW32__ + int _fileno(FILE *stream); /* MINGW somehow forgets to include this prototype into */ +# endif +# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream)) +#else +# include /* isatty */ +# define IS_CONSOLE(stdStream) isatty(fileno(stdStream)) +#endif + + +/***************************** +* Constants +******************************/ +#define COMPRESSOR_NAME "LZ4 command line interface" +#ifndef LZ4_VERSION +# define LZ4_VERSION "r128" +#endif +#define AUTHOR "Yann Collet" +#define WELCOME_MESSAGE "*** %s %i-bits %s, by %s (%s) ***\n", COMPRESSOR_NAME, (int)(sizeof(void*)*8), LZ4_VERSION, AUTHOR, __DATE__ +#define LZ4_EXTENSION ".lz4" +#define LZ4CAT "lz4cat" +#define UNLZ4 "unlz4" + +#define KB *(1U<<10) +#define MB *(1U<<20) +#define GB *(1U<<30) + +#define LZ4_BLOCKSIZEID_DEFAULT 7 + + +/************************************** +* Macros +***************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); } +static unsigned displayLevel = 2; /* 0 : no display ; 1: errors only ; 2 : downgradable normal ; 3 : non-downgradable normal; 4 : + information */ + + +/************************************** +* Local Variables +***************************************/ +static char* programName; + + +/************************************** +* Exceptions +***************************************/ +#define DEBUG 0 +#define DEBUGOUTPUT(...) if (DEBUG) DISPLAY(__VA_ARGS__); +#define EXM_THROW(error, ...) \ +{ \ + DEBUGOUTPUT("Error defined at %s, line %i : \n", __FILE__, __LINE__); \ + DISPLAYLEVEL(1, "Error %i : ", error); \ + DISPLAYLEVEL(1, __VA_ARGS__); \ + DISPLAYLEVEL(1, "\n"); \ + exit(error); \ +} + + +/************************************** +* Version modifiers +***************************************/ +#define EXTENDED_ARGUMENTS +#define EXTENDED_HELP +#define EXTENDED_FORMAT +#define DEFAULT_COMPRESSOR LZ4IO_compressFilename +#define DEFAULT_DECOMPRESSOR LZ4IO_decompressFilename +int LZ4IO_compressFilename_Legacy(const char* input_filename, const char* output_filename, int compressionlevel); /* hidden function */ + + +/***************************** +* Functions +*****************************/ +static int usage(void) +{ + DISPLAY( "Usage :\n"); + DISPLAY( " %s [arg] [input] [output]\n", programName); + DISPLAY( "\n"); + DISPLAY( "input : a filename\n"); + DISPLAY( " with no FILE, or when FILE is - or %s, read standard input\n", stdinmark); + DISPLAY( "Arguments :\n"); + DISPLAY( " -1 : Fast compression (default) \n"); + DISPLAY( " -9 : High compression \n"); + DISPLAY( " -d : decompression (default for %s extension)\n", LZ4_EXTENSION); + DISPLAY( " -z : force compression\n"); + DISPLAY( " -f : overwrite output without prompting \n"); + DISPLAY( " -h/-H : display help/long help and exit\n"); + return 0; +} + +static int usage_advanced(void) +{ + DISPLAY(WELCOME_MESSAGE); + usage(); + DISPLAY( "\n"); + DISPLAY( "Advanced arguments :\n"); + DISPLAY( " -V : display Version number and exit\n"); + DISPLAY( " -v : verbose mode\n"); + DISPLAY( " -q : suppress warnings; specify twice to suppress errors too\n"); + DISPLAY( " -c : force write to standard output, even if it is the console\n"); + DISPLAY( " -t : test compressed file integrity\n"); + DISPLAY( " -m : multiple input files (implies automatic output filenames)\n"); + DISPLAY( " -l : compress using Legacy format (Linux kernel compression)\n"); + DISPLAY( " -B# : Block size [4-7](default : 7)\n"); + DISPLAY( " -BD : Block dependency (improve compression ratio)\n"); + /* DISPLAY( " -BX : enable block checksum (default:disabled)\n"); *//* Option currently inactive */ + DISPLAY( "--no-frame-crc : disable stream checksum (default:enabled)\n"); + DISPLAY( "--content-size : compressed frame includes original size (default:not present)\n"); + DISPLAY( "--[no-]sparse : sparse mode (default:enabled on file, disabled on stdout)\n"); + DISPLAY( "Benchmark arguments :\n"); + DISPLAY( " -b : benchmark file(s)\n"); + DISPLAY( " -i# : iteration loops [1-9](default : 3), benchmark mode only\n"); +#if defined(ENABLE_LZ4C_LEGACY_OPTIONS) + DISPLAY( "Legacy arguments :\n"); + DISPLAY( " -c0 : fast compression\n"); + DISPLAY( " -c1 : high compression\n"); + DISPLAY( " -hc : high compression\n"); + DISPLAY( " -y : overwrite output without prompting \n"); +#endif /* ENABLE_LZ4C_LEGACY_OPTIONS */ + EXTENDED_HELP; + return 0; +} + +static int usage_longhelp(void) +{ + usage_advanced(); + DISPLAY( "\n"); + DISPLAY( "Which values can get [output] ? \n"); + DISPLAY( "[output] : a filename\n"); + DISPLAY( " '%s', or '-' for standard output (pipe mode)\n", stdoutmark); + DISPLAY( " '%s' to discard output (test mode)\n", NULL_OUTPUT); + DISPLAY( "[output] can be left empty. In this case, it receives the following value : \n"); + DISPLAY( " - if stdout is not the console, then [output] = stdout \n"); + DISPLAY( " - if stdout is console : \n"); + DISPLAY( " + if compression selected, output to filename%s \n", LZ4_EXTENSION); + DISPLAY( " + if decompression selected, output to filename without '%s'\n", LZ4_EXTENSION); + DISPLAY( " > if input filename has no '%s' extension : error\n", LZ4_EXTENSION); + DISPLAY( "\n"); + DISPLAY( "Compression levels : \n"); + DISPLAY( "There are technically 2 accessible compression levels.\n"); + DISPLAY( "-0 ... -2 => Fast compression\n"); + DISPLAY( "-3 ... -9 => High compression\n"); + DISPLAY( "\n"); + DISPLAY( "stdin, stdout and the console : \n"); + DISPLAY( "To protect the console from binary flooding (bad argument mistake)\n"); + DISPLAY( "%s will refuse to read from console, or write to console \n", programName); + DISPLAY( "except if '-c' command is specified, to force output to console \n"); + DISPLAY( "\n"); + DISPLAY( "Simple example :\n"); + DISPLAY( "1 : compress 'filename' fast, using default output name 'filename.lz4'\n"); + DISPLAY( " %s filename\n", programName); + DISPLAY( "\n"); + DISPLAY( "Arguments can be appended together, or provided independently. For example :\n"); + DISPLAY( "2 : compress 'filename' in high compression mode, overwrite output if exists\n"); + DISPLAY( " %s -f9 filename \n", programName); + DISPLAY( " is equivalent to :\n"); + DISPLAY( " %s -f -9 filename \n", programName); + DISPLAY( "\n"); + DISPLAY( "%s can be used in 'pure pipe mode', for example :\n", programName); + DISPLAY( "3 : compress data stream from 'generator', send result to 'consumer'\n"); + DISPLAY( " generator | %s | consumer \n", programName); +#if defined(ENABLE_LZ4C_LEGACY_OPTIONS) + DISPLAY( "\n"); + DISPLAY( "Warning :\n"); + DISPLAY( "Legacy arguments take precedence. Therefore : \n"); + DISPLAY( " %s -hc filename\n", programName); + DISPLAY( "means 'compress filename in high compression mode'\n"); + DISPLAY( "It is not equivalent to :\n"); + DISPLAY( " %s -h -c filename\n", programName); + DISPLAY( "which would display help text and exit\n"); +#endif /* ENABLE_LZ4C_LEGACY_OPTIONS */ + return 0; +} + +static int badusage(void) +{ + DISPLAYLEVEL(1, "Incorrect parameters\n"); + if (displayLevel >= 1) usage(); + exit(1); +} + + +static void waitEnter(void) +{ + DISPLAY("Press enter to continue...\n"); + (void)getchar(); +} + + +int main(int argc, char** argv) +{ + int i, + cLevel=0, + decode=0, + bench=0, + legacy_format=0, + forceStdout=0, + forceCompress=0, + main_pause=0, + multiple_inputs=0, + operationResult=0; + const char* input_filename=0; + const char* output_filename=0; + char* dynNameSpace=0; + const char** inFileNames = NULL; + unsigned ifnIdx=0; + char nullOutput[] = NULL_OUTPUT; + char extension[] = LZ4_EXTENSION; + int blockSize; + + /* Init */ + programName = argv[0]; + LZ4IO_setOverwrite(0); + blockSize = LZ4IO_setBlockSizeID(LZ4_BLOCKSIZEID_DEFAULT); + + /* lz4cat predefined behavior */ + if (!strcmp(programName, LZ4CAT)) { decode=1; forceStdout=1; output_filename=stdoutmark; displayLevel=1; } + if (!strcmp(programName, UNLZ4)) { decode=1; } + + /* command switches */ + for(i=1; i='0') && (*argument<='9')) + { + cLevel = 0; + while ((*argument >= '0') && (*argument <= '9')) + { + cLevel *= 10; + cLevel += *argument - '0'; + argument++; + } + argument--; + continue; + } + + switch(argument[0]) + { + /* Display help */ + case 'V': DISPLAY(WELCOME_MESSAGE); goto _cleanup; /* Version */ + case 'h': usage_advanced(); goto _cleanup; + case 'H': usage_longhelp(); goto _cleanup; + + /* Compression (default) */ + case 'z': forceCompress = 1; break; + + /* Use Legacy format (ex : Linux kernel compression) */ + case 'l': legacy_format = 1; blockSize = 8 MB; break; + + /* Decoding */ + case 'd': decode=1; break; + + /* Force stdout, even if stdout==console */ + case 'c': forceStdout=1; output_filename=stdoutmark; displayLevel=1; break; + + /* Test integrity */ + case 't': decode=1; LZ4IO_setOverwrite(1); output_filename=nulmark; break; + + /* Overwrite */ + case 'f': LZ4IO_setOverwrite(1); break; + + /* Verbose mode */ + case 'v': displayLevel=4; break; + + /* Quiet mode */ + case 'q': if (displayLevel) displayLevel--; break; + + /* keep source file (default anyway, so useless) (for xz/lzma compatibility) */ + case 'k': break; + + /* Modify Block Properties */ + case 'B': + while (argument[1]!=0) + { + int exitBlockProperties=0; + switch(argument[1]) + { + case '4': + case '5': + case '6': + case '7': + { + int B = argument[1] - '0'; + blockSize = LZ4IO_setBlockSizeID(B); + BMK_setBlocksize(blockSize); + argument++; + break; + } + case 'D': LZ4IO_setBlockMode(LZ4IO_blockLinked); argument++; break; + case 'X': LZ4IO_setBlockChecksumMode(1); argument ++; break; /* currently disabled */ + default : exitBlockProperties=1; + } + if (exitBlockProperties) break; + } + break; + + /* Benchmark */ + case 'b': bench=1; multiple_inputs=1; + if (inFileNames == NULL) + inFileNames = (const char**) malloc(argc * sizeof(char*)); + break; + + /* Treat non-option args as input files. See https://code.google.com/p/lz4/issues/detail?id=151 */ + case 'm': multiple_inputs=1; + if (inFileNames == NULL) + inFileNames = (const char**) malloc(argc * sizeof(char*)); + break; + + /* Modify Nb Iterations (benchmark only) */ + case 'i': + { + unsigned iters = 0; + while ((argument[1] >='0') && (argument[1] <='9')) + { + iters *= 10; + iters += argument[1] - '0'; + argument++; + } + BMK_setNbIterations(iters); + } + break; + + /* Pause at the end (hidden option) */ + case 'p': main_pause=1; BMK_setPause(); break; + + /* Specific commands for customized versions */ + EXTENDED_ARGUMENTS; + + /* Unrecognised command */ + default : badusage(); + } + } + continue; + } + + /* Store in *inFileNames[] if -m is used. */ + if (multiple_inputs) { inFileNames[ifnIdx++]=argument; continue; } + + /* Store first non-option arg in input_filename to preserve original cli logic. */ + if (!input_filename) { input_filename=argument; continue; } + + /* Second non-option arg in output_filename to preserve original cli logic. */ + if (!output_filename) + { + output_filename=argument; + if (!strcmp (output_filename, nullOutput)) output_filename = nulmark; + continue; + } + + /* 3rd non-option arg should not exist */ + DISPLAYLEVEL(1, "Warning : %s won't be used ! Do you want multiple input files (-m) ? \n", argument); + } + + DISPLAYLEVEL(3, WELCOME_MESSAGE); + if (!decode) DISPLAYLEVEL(4, "Blocks size : %i KB\n", blockSize>>10); + + /* No input filename ==> use stdin */ + if (multiple_inputs) input_filename = inFileNames[0], output_filename = (const char*)(inFileNames[0]); + if(!input_filename) { input_filename=stdinmark; } + + /* Check if input is defined as console; trigger an error in this case */ + if (!strcmp(input_filename, stdinmark) && IS_CONSOLE(stdin) ) badusage(); + + /* Check if benchmark is selected */ + if (bench) + { + int bmkResult = BMK_benchFiles(inFileNames, ifnIdx, cLevel); + free((void*)inFileNames); + return bmkResult; + } + + /* No output filename ==> try to select one automatically (when possible) */ + while (!output_filename) + { + if (!IS_CONSOLE(stdout)) { output_filename=stdoutmark; break; } /* Default to stdout whenever possible (i.e. not a console) */ + if ((!decode) && !(forceCompress)) /* auto-determine compression or decompression, based on file extension */ + { + size_t l = strlen(input_filename); + if (!strcmp(input_filename+(l-4), LZ4_EXTENSION)) decode=1; + } + if (!decode) /* compression to file */ + { + size_t l = strlen(input_filename); + dynNameSpace = (char*)calloc(1,l+5); + if (dynNameSpace==NULL) exit(1); + strcpy(dynNameSpace, input_filename); + strcat(dynNameSpace, LZ4_EXTENSION); + output_filename = dynNameSpace; + DISPLAYLEVEL(2, "Compressed filename will be : %s \n", output_filename); + break; + } + /* decompression to file (automatic name will work only if input filename has correct format extension) */ + { + size_t outl; + size_t inl = strlen(input_filename); + dynNameSpace = (char*)calloc(1,inl+1); + strcpy(dynNameSpace, input_filename); + outl = inl; + if (inl>4) + while ((outl >= inl-4) && (input_filename[outl] == extension[outl-inl+4])) dynNameSpace[outl--]=0; + if (outl != inl-5) { DISPLAYLEVEL(1, "Cannot determine an output filename\n"); badusage(); } + output_filename = dynNameSpace; + DISPLAYLEVEL(2, "Decoding file %s \n", output_filename); + } + } + + /* Check if output is defined as console; trigger an error in this case */ + if (!strcmp(output_filename,stdoutmark) && IS_CONSOLE(stdout) && !forceStdout) badusage(); + + /* Downgrade notification level in pure pipe mode (stdin + stdout) and multiple file mode */ + if (!strcmp(input_filename, stdinmark) && !strcmp(output_filename,stdoutmark) && (displayLevel==2)) displayLevel=1; + if ((multiple_inputs) && (displayLevel==2)) displayLevel=1; + + + /* IO Stream/File */ + LZ4IO_setNotificationLevel(displayLevel); + if (decode) + { + if (multiple_inputs) + operationResult = LZ4IO_decompressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION); + else + DEFAULT_DECOMPRESSOR(input_filename, output_filename); + } + else + { + /* compression is default action */ + if (legacy_format) + { + DISPLAYLEVEL(3, "! Generating compressed LZ4 using Legacy format (deprecated) ! \n"); + LZ4IO_compressFilename_Legacy(input_filename, output_filename, cLevel); + } + else + { + if (multiple_inputs) + operationResult = LZ4IO_compressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION, cLevel); + else + DEFAULT_COMPRESSOR(input_filename, output_filename, cLevel); + } + } + +_cleanup: + if (main_pause) waitEnter(); + free(dynNameSpace); + free((void*)inFileNames); + return operationResult; +} diff --git a/thirdparty/Lz4/Lz4_131/programs/lz4io.c b/thirdparty/Lz4/Lz4_131/programs/lz4io.c new file mode 100644 index 0000000..14bbf0e --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/programs/lz4io.c @@ -0,0 +1,1051 @@ +/* + LZ4io.c - LZ4 File/Stream Interface + Copyright (C) Yann Collet 2011-2015 + + GPL v2 License + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + You can contact the author at : + - LZ4 source repository : https://github.com/Cyan4973/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +/* + Note : this is stand-alone program. + It is not part of LZ4 compression library, it is a user code of the LZ4 library. + - The license of LZ4 library is BSD. + - The license of xxHash library is BSD. + - The license of this source file is GPLv2. +*/ + +/************************************** +* Compiler Options +**************************************/ +#ifdef _MSC_VER /* Visual Studio */ +# define _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_DEPRECATE /* VS2005 */ +# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ +#endif + +#define _LARGE_FILES /* Large file support on 32-bits AIX */ +#define _FILE_OFFSET_BITS 64 /* Large file support on 32-bits unix */ + + +/***************************** +* Includes +*****************************/ +#include /* fprintf, fopen, fread, stdin, stdout, fflush, getchar */ +#include /* malloc, free */ +#include /* strcmp, strlen */ +#include /* clock */ +#include /* stat64 */ +#include /* stat64 */ +#include "lz4io.h" +#include "lz4.h" /* still required for legacy format */ +#include "lz4hc.h" /* still required for legacy format */ +#include "lz4frame.h" + + +/****************************** +* OS-specific Includes +******************************/ +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32) +# include /* _O_BINARY */ +# include /* _setmode, _fileno, _get_osfhandle */ +# if !defined(__DJGPP__) +# define SET_BINARY_MODE(file) { int unused=_setmode(_fileno(file), _O_BINARY); (void)unused; } +# include /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */ +# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); } +# if defined(_MSC_VER) && (_MSC_VER >= 1400) /* Avoid MSVC fseek()'s 2GiB barrier */ +# define fseek _fseeki64 +# endif +# else +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +# define SET_SPARSE_FILE_MODE(file) +# endif +#else +# define SET_BINARY_MODE(file) +# define SET_SPARSE_FILE_MODE(file) +#endif + +#if !defined(S_ISREG) +# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) +#endif + + +/***************************** +* Constants +*****************************/ +#define KB *(1 <<10) +#define MB *(1 <<20) +#define GB *(1U<<30) + +#define _1BIT 0x01 +#define _2BITS 0x03 +#define _3BITS 0x07 +#define _4BITS 0x0F +#define _8BITS 0xFF + +#define MAGICNUMBER_SIZE 4 +#define LZ4IO_MAGICNUMBER 0x184D2204 +#define LZ4IO_SKIPPABLE0 0x184D2A50 +#define LZ4IO_SKIPPABLEMASK 0xFFFFFFF0 +#define LEGACY_MAGICNUMBER 0x184C2102 + +#define CACHELINE 64 +#define LEGACY_BLOCKSIZE (8 MB) +#define MIN_STREAM_BUFSIZE (192 KB) +#define LZ4IO_BLOCKSIZEID_DEFAULT 7 + +#define sizeT sizeof(size_t) +#define maskT (sizeT - 1) + + +/************************************** +* Macros +**************************************/ +#define DISPLAY(...) fprintf(stderr, __VA_ARGS__) +#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } +static int g_displayLevel = 0; /* 0 : no display ; 1: errors ; 2 : + result + interaction + warnings ; 3 : + progression; 4 : + information */ + +#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \ + if ((LZ4IO_GetMilliSpan(g_time) > refreshRate) || (g_displayLevel>=4)) \ + { g_time = clock(); DISPLAY(__VA_ARGS__); \ + if (g_displayLevel>=4) fflush(stdout); } } +static const unsigned refreshRate = 150; +static clock_t g_time = 0; + + +/************************************** +* Local Parameters +**************************************/ +static int g_overwrite = 1; +static int g_blockSizeId = LZ4IO_BLOCKSIZEID_DEFAULT; +static int g_blockChecksum = 0; +static int g_streamChecksum = 1; +static int g_blockIndependence = 1; +static int g_sparseFileSupport = 1; +static int g_contentSizeFlag = 0; + +static const int minBlockSizeID = 4; +static const int maxBlockSizeID = 7; + + +/************************************** +* Exceptions +***************************************/ +#define DEBUG 0 +#define DEBUGOUTPUT(...) if (DEBUG) DISPLAY(__VA_ARGS__); +#define EXM_THROW(error, ...) \ +{ \ + DEBUGOUTPUT("Error defined at %s, line %i : \n", __FILE__, __LINE__); \ + DISPLAYLEVEL(1, "Error %i : ", error); \ + DISPLAYLEVEL(1, __VA_ARGS__); \ + DISPLAYLEVEL(1, "\n"); \ + exit(error); \ +} + + +/************************************** +* Version modifiers +**************************************/ +#define EXTENDED_ARGUMENTS +#define EXTENDED_HELP +#define EXTENDED_FORMAT +#define DEFAULT_DECOMPRESSOR LZ4IO_decompressLZ4F + + +/* ************************************************** */ +/* ****************** Parameters ******************** */ +/* ************************************************** */ + +/* Default setting : overwrite = 1; return : overwrite mode (0/1) */ +int LZ4IO_setOverwrite(int yes) +{ + g_overwrite = (yes!=0); + return g_overwrite; +} + +/* blockSizeID : valid values : 4-5-6-7 */ +int LZ4IO_setBlockSizeID(int bsid) +{ + static const int blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB }; + if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return -1; + g_blockSizeId = bsid; + return blockSizeTable[g_blockSizeId-minBlockSizeID]; +} + +int LZ4IO_setBlockMode(LZ4IO_blockMode_t blockMode) +{ + g_blockIndependence = (blockMode == LZ4IO_blockIndependent); + return g_blockIndependence; +} + +/* Default setting : no checksum */ +int LZ4IO_setBlockChecksumMode(int xxhash) +{ + g_blockChecksum = (xxhash != 0); + return g_blockChecksum; +} + +/* Default setting : checksum enabled */ +int LZ4IO_setStreamChecksumMode(int xxhash) +{ + g_streamChecksum = (xxhash != 0); + return g_streamChecksum; +} + +/* Default setting : 0 (no notification) */ +int LZ4IO_setNotificationLevel(int level) +{ + g_displayLevel = level; + return g_displayLevel; +} + +/* Default setting : 0 (disabled) */ +int LZ4IO_setSparseFile(int enable) +{ + g_sparseFileSupport = (enable!=0); + return g_sparseFileSupport; +} + +/* Default setting : 0 (disabled) */ +int LZ4IO_setContentSize(int enable) +{ + g_contentSizeFlag = (enable!=0); + return g_contentSizeFlag; +} + +static unsigned LZ4IO_GetMilliSpan(clock_t nPrevious) +{ + clock_t nCurrent = clock(); + unsigned nSpan = (unsigned)(((nCurrent - nPrevious) * 1000) / CLOCKS_PER_SEC); + return nSpan; +} + +static unsigned long long LZ4IO_GetFileSize(const char* infilename) +{ + int r; +#if defined(_MSC_VER) + struct _stat64 statbuf; + r = _stat64(infilename, &statbuf); +#else + struct stat statbuf; + r = stat(infilename, &statbuf); +#endif + if (r || !S_ISREG(statbuf.st_mode)) return 0; /* failure, or is not a regular file */ + return (unsigned long long)statbuf.st_size; +} + + +/* ************************************************************************ ** +** ********************** LZ4 File / Pipe compression ********************* ** +** ************************************************************************ */ + +static int LZ4IO_GetBlockSize_FromBlockId (int id) { return (1 << (8 + (2 * id))); } +static int LZ4IO_isSkippableMagicNumber(unsigned int magic) { return (magic & LZ4IO_SKIPPABLEMASK) == LZ4IO_SKIPPABLE0; } + + +static int LZ4IO_getFiles(const char* input_filename, const char* output_filename, FILE** pfinput, FILE** pfoutput) +{ + + if (!strcmp (input_filename, stdinmark)) + { + DISPLAYLEVEL(4,"Using stdin for input\n"); + *pfinput = stdin; + SET_BINARY_MODE(stdin); + } + else + { + *pfinput = fopen(input_filename, "rb"); + } + + if ( *pfinput==0 ) + { + DISPLAYLEVEL(1, "Unable to access file for processing: %s\n", input_filename); + return 1; + } + + if (!strcmp (output_filename, stdoutmark)) + { + DISPLAYLEVEL(4,"Using stdout for output\n"); + *pfoutput = stdout; + SET_BINARY_MODE(stdout); + if (g_sparseFileSupport==1) + { + g_sparseFileSupport = 0; + DISPLAYLEVEL(4, "Sparse File Support is automatically disabled on stdout ; try --sparse \n"); + } + } + else + { + /* Check if destination file already exists */ + *pfoutput=0; + if (output_filename != nulmark) *pfoutput = fopen( output_filename, "rb" ); + if (*pfoutput!=0) + { + fclose(*pfoutput); + if (!g_overwrite) + { + int ch = 'Y'; + DISPLAYLEVEL(2, "Warning : %s already exists\n", output_filename); + if ((g_displayLevel <= 1) || (*pfinput == stdin)) + EXM_THROW(11, "Operation aborted : %s already exists", output_filename); /* No interaction possible */ + DISPLAYLEVEL(2, "Overwrite ? (Y/n) : "); + while((ch = getchar()) != '\n' && ch != EOF) /* flush integrated */ + if ((ch!='Y') && (ch!='y')) EXM_THROW(12, "No. Operation aborted : %s already exists", output_filename); + } + } + *pfoutput = fopen( output_filename, "wb" ); + } + + if (*pfoutput==0) EXM_THROW(13, "Pb opening %s", output_filename); + + return 0; +} + + + +/*************************************** +* Legacy Compression +***************************************/ + +/* unoptimized version; solves endianess & alignment issues */ +static void LZ4IO_writeLE32 (void* p, unsigned value32) +{ + unsigned char* dstPtr = (unsigned char*)p; + dstPtr[0] = (unsigned char)value32; + dstPtr[1] = (unsigned char)(value32 >> 8); + dstPtr[2] = (unsigned char)(value32 >> 16); + dstPtr[3] = (unsigned char)(value32 >> 24); +} + +static int LZ4IO_LZ4_compress(const char* src, char* dst, int srcSize, int dstSize, int cLevel) +{ + (void)cLevel; + return LZ4_compress_fast(src, dst, srcSize, dstSize, 1); +} + +/* LZ4IO_compressFilename_Legacy : + * This function is intentionally "hidden" (not published in .h) + * It generates compressed streams using the old 'legacy' format */ +int LZ4IO_compressFilename_Legacy(const char* input_filename, const char* output_filename, int compressionlevel) +{ + int (*compressionFunction)(const char* src, char* dst, int srcSize, int dstSize, int cLevel); + unsigned long long filesize = 0; + unsigned long long compressedfilesize = MAGICNUMBER_SIZE; + char* in_buff; + char* out_buff; + const int outBuffSize = LZ4_compressBound(LEGACY_BLOCKSIZE); + FILE* finput; + FILE* foutput; + clock_t start, end; + size_t sizeCheck; + + + /* Init */ + start = clock(); + if (compressionlevel < 3) compressionFunction = LZ4IO_LZ4_compress; else compressionFunction = LZ4_compress_HC; + + if (LZ4IO_getFiles(input_filename, output_filename, &finput, &foutput)) + EXM_THROW(20, "File error"); + + /* Allocate Memory */ + in_buff = (char*)malloc(LEGACY_BLOCKSIZE); + out_buff = (char*)malloc(outBuffSize); + if (!in_buff || !out_buff) EXM_THROW(21, "Allocation error : not enough memory"); + + /* Write Archive Header */ + LZ4IO_writeLE32(out_buff, LEGACY_MAGICNUMBER); + sizeCheck = fwrite(out_buff, 1, MAGICNUMBER_SIZE, foutput); + if (sizeCheck!=MAGICNUMBER_SIZE) EXM_THROW(22, "Write error : cannot write header"); + + /* Main Loop */ + while (1) + { + unsigned int outSize; + /* Read Block */ + int inSize = (int) fread(in_buff, (size_t)1, (size_t)LEGACY_BLOCKSIZE, finput); + if( inSize<=0 ) break; + filesize += inSize; + + /* Compress Block */ + outSize = compressionFunction(in_buff, out_buff+4, inSize, outBuffSize, compressionlevel); + compressedfilesize += outSize+4; + DISPLAYUPDATE(2, "\rRead : %i MB ==> %.2f%% ", (int)(filesize>>20), (double)compressedfilesize/filesize*100); + + /* Write Block */ + LZ4IO_writeLE32(out_buff, outSize); + sizeCheck = fwrite(out_buff, 1, outSize+4, foutput); + if (sizeCheck!=(size_t)(outSize+4)) EXM_THROW(23, "Write error : cannot write compressed block"); + } + + /* Status */ + end = clock(); + DISPLAYLEVEL(2, "\r%79s\r", ""); + filesize += !filesize; /* avoid divide by zero */ + DISPLAYLEVEL(2,"Compressed %llu bytes into %llu bytes ==> %.2f%%\n", + (unsigned long long) filesize, (unsigned long long) compressedfilesize, (double)compressedfilesize/filesize*100); + { + double seconds = (double)(end - start)/CLOCKS_PER_SEC; + DISPLAYLEVEL(4,"Done in %.2f s ==> %.2f MB/s\n", seconds, (double)filesize / seconds / 1024 / 1024); + } + + /* Close & Free */ + free(in_buff); + free(out_buff); + fclose(finput); + fclose(foutput); + + return 0; +} + + +/********************************************* +* Compression using Frame format +*********************************************/ + +typedef struct { + void* srcBuffer; + size_t srcBufferSize; + void* dstBuffer; + size_t dstBufferSize; + LZ4F_compressionContext_t ctx; +} cRess_t; + +static cRess_t LZ4IO_createCResources(void) +{ + const size_t blockSize = (size_t)LZ4IO_GetBlockSize_FromBlockId (g_blockSizeId); + cRess_t ress; + LZ4F_errorCode_t errorCode; + + errorCode = LZ4F_createCompressionContext(&(ress.ctx), LZ4F_VERSION); + if (LZ4F_isError(errorCode)) EXM_THROW(30, "Allocation error : can't create LZ4F context : %s", LZ4F_getErrorName(errorCode)); + + /* Allocate Memory */ + ress.srcBuffer = malloc(blockSize); + ress.srcBufferSize = blockSize; + ress.dstBufferSize = LZ4F_compressFrameBound(blockSize, NULL); /* cover worst case */ + ress.dstBuffer = malloc(ress.dstBufferSize); + if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(31, "Allocation error : not enough memory"); + + return ress; +} + +static void LZ4IO_freeCResources(cRess_t ress) +{ + LZ4F_errorCode_t errorCode; + free(ress.srcBuffer); + free(ress.dstBuffer); + errorCode = LZ4F_freeCompressionContext(ress.ctx); + if (LZ4F_isError(errorCode)) EXM_THROW(38, "Error : can't free LZ4F context resource : %s", LZ4F_getErrorName(errorCode)); +} + +/* + * LZ4IO_compressFilename_extRess() + * result : 0 : compression completed correctly + * 1 : missing or pb opening srcFileName + */ +static int LZ4IO_compressFilename_extRess(cRess_t ress, const char* srcFileName, const char* dstFileName, int compressionLevel) +{ + unsigned long long filesize = 0; + unsigned long long compressedfilesize = 0; + FILE* srcFile; + FILE* dstFile; + void* const srcBuffer = ress.srcBuffer; + void* const dstBuffer = ress.dstBuffer; + const size_t dstBufferSize = ress.dstBufferSize; + const size_t blockSize = (size_t)LZ4IO_GetBlockSize_FromBlockId (g_blockSizeId); + size_t sizeCheck, headerSize, readSize; + LZ4F_compressionContext_t ctx = ress.ctx; /* just a pointer */ + LZ4F_preferences_t prefs; + + + /* Init */ + memset(&prefs, 0, sizeof(prefs)); + + /* File check */ + if (LZ4IO_getFiles(srcFileName, dstFileName, &srcFile, &dstFile)) return 1; + + /* Set compression parameters */ + prefs.autoFlush = 1; + prefs.compressionLevel = compressionLevel; + prefs.frameInfo.blockMode = (LZ4F_blockMode_t)g_blockIndependence; + prefs.frameInfo.blockSizeID = (LZ4F_blockSizeID_t)g_blockSizeId; + prefs.frameInfo.contentChecksumFlag = (LZ4F_contentChecksum_t)g_streamChecksum; + if (g_contentSizeFlag) + { + unsigned long long fileSize = LZ4IO_GetFileSize(srcFileName); + prefs.frameInfo.contentSize = fileSize; /* == 0 if input == stdin */ + if (fileSize==0) + DISPLAYLEVEL(3, "Warning : cannot determine uncompressed frame content size \n"); + } + + /* read first block */ + readSize = fread(srcBuffer, (size_t)1, blockSize, srcFile); + filesize += readSize; + + /* single-block file */ + if (readSize < blockSize) + { + /* Compress in single pass */ + size_t cSize = LZ4F_compressFrame(dstBuffer, dstBufferSize, srcBuffer, readSize, &prefs); + if (LZ4F_isError(cSize)) EXM_THROW(34, "Compression failed : %s", LZ4F_getErrorName(cSize)); + compressedfilesize += cSize; + DISPLAYUPDATE(2, "\rRead : %u MB ==> %.2f%% ", + (unsigned)(filesize>>20), (double)compressedfilesize/(filesize+!filesize)*100); /* avoid division by zero */ + + /* Write Block */ + sizeCheck = fwrite(dstBuffer, 1, cSize, dstFile); + if (sizeCheck!=cSize) EXM_THROW(35, "Write error : cannot write compressed block"); + } + + else + + /* multiple-blocks file */ + { + /* Write Archive Header */ + headerSize = LZ4F_compressBegin(ctx, dstBuffer, dstBufferSize, &prefs); + if (LZ4F_isError(headerSize)) EXM_THROW(32, "File header generation failed : %s", LZ4F_getErrorName(headerSize)); + sizeCheck = fwrite(dstBuffer, 1, headerSize, dstFile); + if (sizeCheck!=headerSize) EXM_THROW(33, "Write error : cannot write header"); + compressedfilesize += headerSize; + + /* Main Loop */ + while (readSize>0) + { + size_t outSize; + + /* Compress Block */ + outSize = LZ4F_compressUpdate(ctx, dstBuffer, dstBufferSize, srcBuffer, readSize, NULL); + if (LZ4F_isError(outSize)) EXM_THROW(34, "Compression failed : %s", LZ4F_getErrorName(outSize)); + compressedfilesize += outSize; + DISPLAYUPDATE(2, "\rRead : %u MB ==> %.2f%% ", (unsigned)(filesize>>20), (double)compressedfilesize/filesize*100); + + /* Write Block */ + sizeCheck = fwrite(dstBuffer, 1, outSize, dstFile); + if (sizeCheck!=outSize) EXM_THROW(35, "Write error : cannot write compressed block"); + + /* Read next block */ + readSize = fread(srcBuffer, (size_t)1, (size_t)blockSize, srcFile); + filesize += readSize; + } + + /* End of Stream mark */ + headerSize = LZ4F_compressEnd(ctx, dstBuffer, dstBufferSize, NULL); + if (LZ4F_isError(headerSize)) EXM_THROW(36, "End of file generation failed : %s", LZ4F_getErrorName(headerSize)); + + sizeCheck = fwrite(dstBuffer, 1, headerSize, dstFile); + if (sizeCheck!=headerSize) EXM_THROW(37, "Write error : cannot write end of stream"); + compressedfilesize += headerSize; + } + + /* Release files */ + fclose (srcFile); + fclose (dstFile); + + /* Final Status */ + DISPLAYLEVEL(2, "\r%79s\r", ""); + DISPLAYLEVEL(2, "Compressed %llu bytes into %llu bytes ==> %.2f%%\n", + filesize, compressedfilesize, (double)compressedfilesize/(filesize + !filesize)*100); /* avoid division by zero */ + + return 0; +} + + +int LZ4IO_compressFilename(const char* srcFileName, const char* dstFileName, int compressionLevel) +{ + clock_t start, end; + cRess_t ress; + int issueWithSrcFile = 0; + + /* Init */ + start = clock(); + ress = LZ4IO_createCResources(); + + /* Compress File */ + issueWithSrcFile += LZ4IO_compressFilename_extRess(ress, srcFileName, dstFileName, compressionLevel); + + /* Free resources */ + LZ4IO_freeCResources(ress); + + /* Final Status */ + end = clock(); + { + double seconds = (double)(end - start) / CLOCKS_PER_SEC; + DISPLAYLEVEL(4, "Completed in %.2f sec \n", seconds); + } + + return issueWithSrcFile; +} + + +#define FNSPACE 30 +int LZ4IO_compressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix, int compressionLevel) +{ + int i; + int missed_files = 0; + char* dstFileName = (char*)malloc(FNSPACE); + size_t ofnSize = FNSPACE; + const size_t suffixSize = strlen(suffix); + cRess_t ress; + + /* init */ + ress = LZ4IO_createCResources(); + + /* loop on each file */ + for (i=0; i 1 GB) + { + int seekResult = fseek(file, 1 GB, SEEK_CUR); + if (seekResult != 0) EXM_THROW(71, "1 GB skip error (sparse file support)"); + storedSkips -= 1 GB; + } + + while (ptrT < bufferTEnd) + { + size_t seg0SizeT = segmentSizeT; + size_t nb0T; + int seekResult; + + /* count leading zeros */ + if (seg0SizeT > bufferSizeT) seg0SizeT = bufferSizeT; + bufferSizeT -= seg0SizeT; + for (nb0T=0; (nb0T < seg0SizeT) && (ptrT[nb0T] == 0); nb0T++) ; + storedSkips += (unsigned)(nb0T * sizeT); + + if (nb0T != seg0SizeT) /* not all 0s */ + { + size_t sizeCheck; + seekResult = fseek(file, storedSkips, SEEK_CUR); + if (seekResult) EXM_THROW(72, "Sparse skip error ; try --no-sparse"); + storedSkips = 0; + seg0SizeT -= nb0T; + ptrT += nb0T; + sizeCheck = fwrite(ptrT, sizeT, seg0SizeT, file); + if (sizeCheck != seg0SizeT) EXM_THROW(73, "Write error : cannot write decoded block"); + } + ptrT += seg0SizeT; + } + + if (bufferSize & maskT) /* size not multiple of sizeT : implies end of block */ + { + const char* const restStart = (const char*)bufferTEnd; + const char* restPtr = restStart; + size_t restSize = bufferSize & maskT; + const char* const restEnd = restStart + restSize; + for (; (restPtr < restEnd) && (*restPtr == 0); restPtr++) ; + storedSkips += (unsigned) (restPtr - restStart); + if (restPtr != restEnd) + { + size_t sizeCheck; + int seekResult = fseek(file, storedSkips, SEEK_CUR); + if (seekResult) EXM_THROW(74, "Sparse skip error ; try --no-sparse"); + storedSkips = 0; + sizeCheck = fwrite(restPtr, 1, restEnd - restPtr, file); + if (sizeCheck != (size_t)(restEnd - restPtr)) EXM_THROW(75, "Write error : cannot write decoded end of block"); + } + } + + return storedSkips; +} + +static void LZ4IO_fwriteSparseEnd(FILE* file, unsigned storedSkips) +{ + char lastZeroByte[1] = { 0 }; + + if (storedSkips>0) /* implies g_sparseFileSupport */ + { + int seekResult; + size_t sizeCheck; + storedSkips --; + seekResult = fseek(file, storedSkips, SEEK_CUR); + if (seekResult != 0) EXM_THROW(69, "Final skip error (sparse file)\n"); + sizeCheck = fwrite(lastZeroByte, 1, 1, file); + if (sizeCheck != 1) EXM_THROW(69, "Write error : cannot write last zero\n"); + } +} + + +static unsigned g_magicRead = 0; +static unsigned long long LZ4IO_decodeLegacyStream(FILE* finput, FILE* foutput) +{ + unsigned long long filesize = 0; + char* in_buff; + char* out_buff; + unsigned storedSkips = 0; + + /* Allocate Memory */ + in_buff = (char*)malloc(LZ4_compressBound(LEGACY_BLOCKSIZE)); + out_buff = (char*)malloc(LEGACY_BLOCKSIZE); + if (!in_buff || !out_buff) EXM_THROW(51, "Allocation error : not enough memory"); + + /* Main Loop */ + while (1) + { + int decodeSize; + size_t sizeCheck; + unsigned int blockSize; + + /* Block Size */ + sizeCheck = fread(in_buff, 1, 4, finput); + if (sizeCheck==0) break; /* Nothing to read : file read is completed */ + blockSize = LZ4IO_readLE32(in_buff); /* Convert to Little Endian */ + if (blockSize > LZ4_COMPRESSBOUND(LEGACY_BLOCKSIZE)) + { /* Cannot read next block : maybe new stream ? */ + g_magicRead = blockSize; + break; + } + + /* Read Block */ + sizeCheck = fread(in_buff, 1, blockSize, finput); + if (sizeCheck!=blockSize) EXM_THROW(52, "Read error : cannot access compressed block !"); + + /* Decode Block */ + decodeSize = LZ4_decompress_safe(in_buff, out_buff, blockSize, LEGACY_BLOCKSIZE); + if (decodeSize < 0) EXM_THROW(53, "Decoding Failed ! Corrupted input detected !"); + filesize += decodeSize; + + /* Write Block */ + storedSkips = LZ4IO_fwriteSparse(foutput, out_buff, decodeSize, storedSkips); + } + + LZ4IO_fwriteSparseEnd(foutput, storedSkips); + + /* Free */ + free(in_buff); + free(out_buff); + + return filesize; +} + + + +typedef struct { + void* srcBuffer; + size_t srcBufferSize; + void* dstBuffer; + size_t dstBufferSize; + LZ4F_decompressionContext_t dCtx; +} dRess_t; + +static const size_t LZ4IO_dBufferSize = 64 KB; + +static dRess_t LZ4IO_createDResources(void) +{ + dRess_t ress; + LZ4F_errorCode_t errorCode; + + /* init */ + errorCode = LZ4F_createDecompressionContext(&ress.dCtx, LZ4F_VERSION); + if (LZ4F_isError(errorCode)) EXM_THROW(60, "Can't create LZ4F context : %s", LZ4F_getErrorName(errorCode)); + + /* Allocate Memory */ + ress.srcBufferSize = LZ4IO_dBufferSize; + ress.srcBuffer = malloc(ress.srcBufferSize); + ress.dstBufferSize = LZ4IO_dBufferSize; + ress.dstBuffer = malloc(ress.dstBufferSize); + if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(61, "Allocation error : not enough memory"); + + return ress; +} + +static void LZ4IO_freeDResources(dRess_t ress) +{ + LZ4F_errorCode_t errorCode = LZ4F_freeDecompressionContext(ress.dCtx); + if (LZ4F_isError(errorCode)) EXM_THROW(69, "Error : can't free LZ4F context resource : %s", LZ4F_getErrorName(errorCode)); + free(ress.srcBuffer); + free(ress.dstBuffer); +} + + +static unsigned long long LZ4IO_decompressLZ4F(dRess_t ress, FILE* srcFile, FILE* dstFile) +{ + unsigned long long filesize = 0; + LZ4F_errorCode_t nextToLoad; + unsigned storedSkips = 0; + + /* Init feed with magic number (already consumed from FILE* sFile) */ + { + size_t inSize = MAGICNUMBER_SIZE; + size_t outSize= 0; + LZ4IO_writeLE32(ress.srcBuffer, LZ4IO_MAGICNUMBER); + nextToLoad = LZ4F_decompress(ress.dCtx, ress.dstBuffer, &outSize, ress.srcBuffer, &inSize, NULL); + if (LZ4F_isError(nextToLoad)) EXM_THROW(62, "Header error : %s", LZ4F_getErrorName(nextToLoad)); + } + + /* Main Loop */ + for (;nextToLoad;) + { + size_t readSize; + size_t pos = 0; + size_t decodedBytes = ress.dstBufferSize; + + /* Read input */ + if (nextToLoad > ress.srcBufferSize) nextToLoad = ress.srcBufferSize; + readSize = fread(ress.srcBuffer, 1, nextToLoad, srcFile); + if (!readSize) + break; /* empty file or stream */ + + while ((pos < readSize) || (decodedBytes == ress.dstBufferSize)) /* still to read, or still to flush */ + { + /* Decode Input (at least partially) */ + size_t remaining = readSize - pos; + decodedBytes = ress.dstBufferSize; + nextToLoad = LZ4F_decompress(ress.dCtx, ress.dstBuffer, &decodedBytes, (char*)(ress.srcBuffer)+pos, &remaining, NULL); + if (LZ4F_isError(nextToLoad)) EXM_THROW(66, "Decompression error : %s", LZ4F_getErrorName(nextToLoad)); + pos += remaining; + + if (decodedBytes) + { + /* Write Block */ + filesize += decodedBytes; + DISPLAYUPDATE(2, "\rDecompressed : %u MB ", (unsigned)(filesize>>20)); + storedSkips = LZ4IO_fwriteSparse(dstFile, ress.dstBuffer, decodedBytes, storedSkips); + } + + if (!nextToLoad) break; + } + } + + LZ4IO_fwriteSparseEnd(dstFile, storedSkips); + + if (nextToLoad!=0) + EXM_THROW(67, "Unfinished stream"); + + return filesize; +} + + +#define PTSIZE (64 KB) +#define PTSIZET (PTSIZE / sizeof(size_t)) +static unsigned long long LZ4IO_passThrough(FILE* finput, FILE* foutput, unsigned char MNstore[MAGICNUMBER_SIZE]) +{ + size_t buffer[PTSIZET]; + size_t read = 1, sizeCheck; + unsigned long long total = MAGICNUMBER_SIZE; + unsigned storedSkips = 0; + + sizeCheck = fwrite(MNstore, 1, MAGICNUMBER_SIZE, foutput); + if (sizeCheck != MAGICNUMBER_SIZE) EXM_THROW(50, "Pass-through write error"); + + while (read) + { + read = fread(buffer, 1, PTSIZE, finput); + total += read; + storedSkips = LZ4IO_fwriteSparse(foutput, buffer, read, storedSkips); + } + + LZ4IO_fwriteSparseEnd(foutput, storedSkips); + return total; +} + + +#define ENDOFSTREAM ((unsigned long long)-1) +static unsigned long long selectDecoder(dRess_t ress, FILE* finput, FILE* foutput) +{ + unsigned char MNstore[MAGICNUMBER_SIZE]; + unsigned magicNumber, size; + int errorNb; + size_t nbReadBytes; + static unsigned nbCalls = 0; + + /* init */ + nbCalls++; + + /* Check Archive Header */ + if (g_magicRead) + { + magicNumber = g_magicRead; + g_magicRead = 0; + } + else + { + nbReadBytes = fread(MNstore, 1, MAGICNUMBER_SIZE, finput); + if (nbReadBytes==0) return ENDOFSTREAM; /* EOF */ + if (nbReadBytes != MAGICNUMBER_SIZE) EXM_THROW(40, "Unrecognized header : Magic Number unreadable"); + magicNumber = LZ4IO_readLE32(MNstore); /* Little Endian format */ + } + if (LZ4IO_isSkippableMagicNumber(magicNumber)) magicNumber = LZ4IO_SKIPPABLE0; /* fold skippable magic numbers */ + + switch(magicNumber) + { + case LZ4IO_MAGICNUMBER: + return LZ4IO_decompressLZ4F(ress, finput, foutput); + case LEGACY_MAGICNUMBER: + DISPLAYLEVEL(4, "Detected : Legacy format \n"); + return LZ4IO_decodeLegacyStream(finput, foutput); + case LZ4IO_SKIPPABLE0: + DISPLAYLEVEL(4, "Skipping detected skippable area \n"); + nbReadBytes = fread(MNstore, 1, 4, finput); + if (nbReadBytes != 4) EXM_THROW(42, "Stream error : skippable size unreadable"); + size = LZ4IO_readLE32(MNstore); /* Little Endian format */ + errorNb = fseek(finput, size, SEEK_CUR); + if (errorNb != 0) EXM_THROW(43, "Stream error : cannot skip skippable area"); + return selectDecoder(ress, finput, foutput); + EXTENDED_FORMAT; + default: + if (nbCalls == 1) /* just started */ + { + if (g_overwrite) + return LZ4IO_passThrough(finput, foutput, MNstore); + EXM_THROW(44,"Unrecognized header : file cannot be decoded"); /* Wrong magic number at the beginning of 1st stream */ + } + DISPLAYLEVEL(2, "Stream followed by unrecognized data\n"); + return ENDOFSTREAM; + } +} + + +static int LZ4IO_decompressFile_extRess(dRess_t ress, const char* input_filename, const char* output_filename) +{ + unsigned long long filesize = 0, decodedSize=0; + FILE* finput; + FILE* foutput; + + + /* Init */ + if (LZ4IO_getFiles(input_filename, output_filename, &finput, &foutput)) + return 1; + + /* sparse file */ + if (g_sparseFileSupport) { SET_SPARSE_FILE_MODE(foutput); } + + /* Loop over multiple streams */ + do + { + decodedSize = selectDecoder(ress, finput, foutput); + if (decodedSize != ENDOFSTREAM) + filesize += decodedSize; + } while (decodedSize != ENDOFSTREAM); + + /* Final Status */ + DISPLAYLEVEL(2, "\r%79s\r", ""); + DISPLAYLEVEL(2, "Successfully decoded %llu bytes \n", filesize); + + /* Close */ + fclose(finput); + fclose(foutput); + + return 0; +} + + +int LZ4IO_decompressFilename(const char* input_filename, const char* output_filename) +{ + dRess_t ress; + clock_t start, end; + int missingFiles = 0; + + start = clock(); + + ress = LZ4IO_createDResources(); + missingFiles += LZ4IO_decompressFile_extRess(ress, input_filename, output_filename); + LZ4IO_freeDResources(ress); + + end = clock(); + if (end==start) end=start+1; + { + double seconds = (double)(end - start)/CLOCKS_PER_SEC; + DISPLAYLEVEL(4, "Done in %.2f sec \n", seconds); + } + + return missingFiles; +} + + +#define MAXSUFFIXSIZE 8 +int LZ4IO_decompressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix) +{ + int i; + int skippedFiles = 0; + int missingFiles = 0; + char* outFileName = (char*)malloc(FNSPACE); + size_t ofnSize = FNSPACE; + const size_t suffixSize = strlen(suffix); + const char* suffixPtr; + dRess_t ress; + + if (outFileName==NULL) exit(1); /* not enough memory */ + ress = LZ4IO_createDResources(); + + for (i=0; i + dst_lz4c32 = '{}/lz4c32.{}'.format(tmp_dir, tag) # /path/to/lz4/test/lz4test/lz4c32. + if not os.path.isfile(dst_lz4c) or not os.path.isfile(dst_lz4c32) or tag == head: + if tag != head: + r_dir = '{}/{}'.format(tmp_dir, tag) # /path/to/lz4/test/lz4test/ + os.makedirs(r_dir, exist_ok=True) + os.chdir(clone_dir) + git(['--work-tree=' + r_dir, 'checkout', tag, '--', '.'], False) + os.chdir(r_dir + '/programs') # /path/to/lz4/lz4test//programs + make(['clean', 'lz4c', 'lz4c32'], False) + else: + os.chdir(programs_dir) + make(['lz4c', 'lz4c32'], False) + shutil.copy2('lz4c', dst_lz4c) + shutil.copy2('lz4c32', dst_lz4c32) + + # Compress test.dat by all released lz4c and lz4c32 + print('Compress test.dat by all released lz4c and lz4c32') + os.chdir(tmp_dir) + for lz4 in glob.glob("*.lz4"): + os.remove(lz4) + for tag in tags: + proc(['./lz4c.' + tag, '-1fz', test_dat, test_dat + '_1_64_' + tag + '.lz4']) + proc(['./lz4c.' + tag, '-9fz', test_dat, test_dat + '_9_64_' + tag + '.lz4']) + proc(['./lz4c32.' + tag, '-1fz', test_dat, test_dat + '_1_32_' + tag + '.lz4']) + proc(['./lz4c32.' + tag, '-9fz', test_dat, test_dat + '_9_32_' + tag + '.lz4']) + + print('Full list of compressed files') + lz4s = sorted(glob.glob('*.lz4')) + for lz4 in lz4s: + print(lz4 + ' : ' + repr(os.path.getsize(lz4))) + + # Remove duplicated .lz4 files + print('') + print('Duplicated files') + lz4s = sorted(glob.glob('*.lz4')) + for i, lz4 in enumerate(lz4s): + if not os.path.isfile(lz4): + continue + for j in range(i+1, len(lz4s)): + lz4t = lz4s[j] + if not os.path.isfile(lz4t): + continue + if filecmp.cmp(lz4, lz4t): + os.remove(lz4t) + print('{} == {}'.format(lz4, lz4t)) + + print('Enumerate only different compressed files') + lz4s = sorted(glob.glob('*.lz4')) + for lz4 in lz4s: + print(lz4 + ' : ' + repr(os.path.getsize(lz4)) + ', ' + sha1_of_file(lz4)) + + # Decompress remained .lz4 files by all released lz4c and lz4c32 + print('Decompression tests and verifications') + lz4s = sorted(glob.glob('*.lz4')) + for dec in glob.glob("*.dec"): + os.remove(dec) + for lz4 in lz4s: + print(lz4, end=" ") + for tag in tags: + print(tag, end=" ") + proc(['./lz4c.' + tag, '-df', lz4, lz4 + '_d64_' + tag + '.dec']) + proc(['./lz4c32.' + tag, '-df', lz4, lz4 + '_d32_' + tag + '.dec']) + print(' OK') # well, here, decompression has worked; but file is not yet verified + + # Compare all '.dec' files with test_dat + decs = glob.glob('*.dec') + for dec in decs: + if not filecmp.cmp(dec, test_dat): + print('ERR : ' + dec) + error_code = 1 + else: + print('OK : ' + dec) + os.remove(dec) + + if error_code != 0: + print('ERROR') + + sys.exit(error_code) diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj b/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj new file mode 100644 index 0000000..bea4943 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D745AE2F-596A-403A-9B91-81A8C6779243} + Win32Proj + datagen + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj.filters b/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj.filters new file mode 100644 index 0000000..a75ef9e --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/datagen/datagen.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers sources + + + Fichiers sources + + + + + Fichiers d%27en-tête + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj b/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj new file mode 100644 index 0000000..0f8a38d --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7} + Win32Proj + frametest + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj.filters b/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj.filters new file mode 100644 index 0000000..20bec78 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/frametest/frametest.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj b/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj new file mode 100644 index 0000000..d8b628b --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E} + Win32Proj + fullbench + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj.filters b/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj.filters new file mode 100644 index 0000000..afc9867 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/fullbench/fullbench.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj b/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj new file mode 100644 index 0000000..37ba2eb --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj @@ -0,0 +1,175 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {18B9F1A7-9C66-4352-898B-30804DADE0FD} + Win32Proj + fuzzer + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj.filters b/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj.filters new file mode 100644 index 0000000..d740975 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/fuzzer/fuzzer.vcxproj.filters @@ -0,0 +1,42 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/lz4.sln b/thirdparty/Lz4/Lz4_131/visual/2012/lz4.sln new file mode 100644 index 0000000..c8d891a --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/lz4.sln @@ -0,0 +1,66 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2012 for Windows Desktop +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "lz4\lz4.vcxproj", "{E30329AC-0057-4FE0-8FDA-7F650D398C4C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fuzzer", "fuzzer\fuzzer.vcxproj", "{18B9F1A7-9C66-4352-898B-30804DADE0FD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullbench", "fullbench\fullbench.vcxproj", "{6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frametest", "frametest\frametest.vcxproj", "{39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datagen", "datagen\datagen.vcxproj", "{D745AE2F-596A-403A-9B91-81A8C6779243}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Debug|Win32.ActiveCfg = Debug|Win32 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Debug|Win32.Build.0 = Debug|Win32 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Debug|x64.ActiveCfg = Debug|x64 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Debug|x64.Build.0 = Debug|x64 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Release|Win32.ActiveCfg = Release|Win32 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Release|Win32.Build.0 = Release|Win32 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Release|x64.ActiveCfg = Release|x64 + {E30329AC-0057-4FE0-8FDA-7F650D398C4C}.Release|x64.Build.0 = Release|x64 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Debug|Win32.ActiveCfg = Debug|Win32 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Debug|Win32.Build.0 = Debug|Win32 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Debug|x64.ActiveCfg = Debug|x64 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Debug|x64.Build.0 = Debug|x64 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Release|Win32.ActiveCfg = Release|Win32 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Release|Win32.Build.0 = Release|Win32 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Release|x64.ActiveCfg = Release|x64 + {18B9F1A7-9C66-4352-898B-30804DADE0FD}.Release|x64.Build.0 = Release|x64 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Debug|Win32.ActiveCfg = Debug|Win32 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Debug|Win32.Build.0 = Debug|Win32 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Debug|x64.ActiveCfg = Debug|x64 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Debug|x64.Build.0 = Debug|x64 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Release|Win32.ActiveCfg = Release|Win32 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Release|Win32.Build.0 = Release|Win32 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Release|x64.ActiveCfg = Release|x64 + {6A4DF4EF-C77F-43C6-8901-DDCD20879E4E}.Release|x64.Build.0 = Release|x64 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Debug|Win32.ActiveCfg = Debug|Win32 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Debug|Win32.Build.0 = Debug|Win32 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Debug|x64.ActiveCfg = Debug|x64 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Debug|x64.Build.0 = Debug|x64 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Release|Win32.ActiveCfg = Release|Win32 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Release|Win32.Build.0 = Release|Win32 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Release|x64.ActiveCfg = Release|x64 + {39AD6ECC-8BAD-4368-95E4-A1AA2F077BB7}.Release|x64.Build.0 = Release|x64 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Debug|Win32.ActiveCfg = Debug|Win32 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Debug|Win32.Build.0 = Debug|Win32 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Debug|x64.ActiveCfg = Debug|x64 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Debug|x64.Build.0 = Debug|x64 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|Win32.ActiveCfg = Release|Win32 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|Win32.Build.0 = Release|Win32 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|x64.ActiveCfg = Release|x64 + {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj b/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj new file mode 100644 index 0000000..afe11d3 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj @@ -0,0 +1,182 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {E30329AC-0057-4FE0-8FDA-7F650D398C4C} + Win32Proj + lz4 + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + true + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + $(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + true + /analyze:stacksize18000 %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj.filters b/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj.filters new file mode 100644 index 0000000..3f8b2c5 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/visual/2012/lz4/lz4.vcxproj.filters @@ -0,0 +1,63 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + Fichiers sources + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj new file mode 100644 index 0000000..4a673d6 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj @@ -0,0 +1,380 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + MinSizeRel + x64 + + + Release + Win32 + + + MinSizeRel + Win32 + + + Release + x64 + + + RelWithDebInfo + Win32 + + + RelWithDebInfo + x64 + + + + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68} + Win32Proj + Win32 + ALL_BUILD + + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + + + + + Build all projects + Build all projects + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + Build all projects + Build all projects + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + Build all projects + Build all projects + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + Build all projects + Build all projects + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + C:\Libraries\C++\Lz4\bin\CMakeFiles\ALL_BUILD + + + + + + + + 780E2CF6-B95B-4509-A8D3-911628525375 + + + 16F08DF1-D385-4C80-A4F8-7E0F09D4313F + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj.filters new file mode 100644 index 0000000..c03e505 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/ALL_BUILD.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + + CMake Rules + + + + + + + + {1B37BC7F-0564-4C49-8D72-61A6B8DCC219} + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeCache.txt b/thirdparty/Lz4/Lz4_131/vs2010/CMakeCache.txt new file mode 100644 index 0000000..1594af4 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeCache.txt @@ -0,0 +1,313 @@ +# This is the CMakeCache file. +# For build in directory: c:/Libraries/C++/Lz4/bin +# It was generated by CMake: C:/Program Files (x86)/CMake 2.8/bin/cmake.exe +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Build the libraries in addition to the tools +BUILD_LIBS:BOOL=ON + +//Build the command line tools +BUILD_TOOLS:BOOL=OFF + +//Semicolon separated list of supported configuration types, only +// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything +// else will be ignored. +CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 + +//Flags used by the compiler during release minsize builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG + +//Flags used by the compiler during release builds (/MD /Ob1 /Oi +// /Ot /Oy /Gs will produce slightly less optimized but smaller +// files). +CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG + +//Flags used by the compiler during Release with Debug Info builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG + +//Libraries linked by defalut with all C applications. +CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING=' /machine:X86 ' + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/LZ4 + +//Path to a program. +CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/link.exe + +//make program +CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~2/MICROS~2.0/Common7/IDE/devenv.com + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING=' /machine:X86 ' + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=LZ4 + +//RC compiler +CMAKE_RC_COMPILER:FILEPATH=rc + +//Flags for Fortran compiler. +CMAKE_RC_FLAGS:STRING=' ' + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING=' /machine:X86 ' + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=OFF + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=OFF + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If true, cmake will use relative paths in makefiles and projects. +CMAKE_USE_RELATIVE_PATHS:BOOL=OFF + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=OFF + +//Enable to build NSIS packages +CPACK_BINARY_NSIS:BOOL=ON + +//Enable to build WiX packages +CPACK_BINARY_WIX:BOOL=OFF + +//Enable to build ZIP packages +CPACK_BINARY_ZIP:BOOL=OFF + +//Enable to build ZIP source packages +CPACK_SOURCE_ZIP:BOOL=ON + +//Value Computed by CMake +LZ4_BINARY_DIR:STATIC=C:/Libraries/C++/Lz4/bin + +//Value Computed by CMake +LZ4_SOURCE_DIR:STATIC=C:/Libraries/C++/Lz4/cmake_unofficial + +//Dependencies for target +liblz4_LIB_DEPENDS:STATIC= + + +######################## +# INTERNAL cache entries +######################## + +//Stored GUID +ALL_BUILD_GUID_CMAKE:INTERNAL=B0A290EA-4CFB-4E3A-991C-34A2B27EAD68 +//ADVANCED property for variable: CMAKE_BUILD_TOOL +CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1 +//What is the target build tool cmake is generating for. +CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~2/MICROS~2.0/Common7/IDE/devenv.com +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=c:/Libraries/C++/Lz4/bin +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=8 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=12 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=C:/Program Files (x86)/CMake 2.8/bin/cmake.exe +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files (x86)/CMake 2.8/bin/cpack.exe +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files (x86)/CMake 2.8/bin/ctest.exe +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES +CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=C:/Program Files (x86)/CMake 2.8/bin/cmake-gui.exe +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Visual Studio 10 +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Start directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=C:/Libraries/C++/Lz4/cmake_unofficial +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_COMPILER +CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1 +CMAKE_RC_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RC_FLAGS +CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=C:/Program Files (x86)/CMake 2.8/share/cmake-2.8 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Suppress Warnings that are meant for the author of the CMakeLists.txt +// files. +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE +//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS +CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CPACK_BINARY_NSIS +CPACK_BINARY_NSIS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CPACK_BINARY_WIX +CPACK_BINARY_WIX-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CPACK_BINARY_ZIP +CPACK_BINARY_ZIP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CPACK_SOURCE_ZIP +CPACK_SOURCE_ZIP-ADVANCED:INTERNAL=1 +//Result of TRY_COMPILE +HAVE_SIZEOF_VOID_P:INTERNAL=TRUE +//Have include stddef.h +HAVE_STDDEF_H:INTERNAL=1 +//Have include stdint.h +HAVE_STDINT_H:INTERNAL=1 +//Have include sys/types.h +HAVE_SYS_TYPES_H:INTERNAL=1 +//Stored GUID +INSTALL_GUID_CMAKE:INTERNAL=B665A634-91FE-4DD7-99C6-C149C402DEF6 +//Stored GUID +PACKAGE_GUID_CMAKE:INTERNAL=5D29D2D7-E2D6-4121-BA4A-E4DCBE626291 +//Stored GUID +SG_Filter_CMake Rules_GUID_CMAKE:INTERNAL=1B37BC7F-0564-4C49-8D72-61A6B8DCC219 +//Stored GUID +SG_Filter_Header Files_GUID_CMAKE:INTERNAL=E0317FBC-45B2-4A87-A66F-09FDC58F5715 +//Stored GUID +SG_Filter_Object Files_GUID_CMAKE:INTERNAL=0F60AC71-D792-4A57-8C48-1DDD06998E6F +//Stored GUID +SG_Filter_Resources_GUID_CMAKE:INTERNAL=E67B5B33-BDC9-4207-8784-213D8526CB63 +//Stored GUID +SG_Filter_Source Files_GUID_CMAKE:INTERNAL=0989D84A-2833-45CF-89B7-AA6632154F2F +//CHECK_TYPE_SIZE: sizeof(void *) +SIZEOF_VOID_P:INTERNAL=4 +//Stored GUID +ZERO_CHECK_GUID_CMAKE:INTERNAL=780E2CF6-B95B-4509-A8D3-911628525375 +//Stored GUID +liblz4_GUID_CMAKE:INTERNAL=16F08DF1-D385-4C80-A4F8-7E0F09D4313F +//Stored GUID +lz4_GUID_CMAKE:INTERNAL=C4244369-A6B8-4DC6-831C-53F6F03AE0F4 + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake new file mode 100644 index 0000000..79bb387 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake @@ -0,0 +1,56 @@ +set(CMAKE_C_COMPILER "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "MSVC") +set(CMAKE_C_COMPILER_VERSION "16.0.40219.1") +set(CMAKE_C_PLATFORM_ID "Windows") +set(MSVC_C_ARCHITECTURE_ID X86) +set(CMAKE_AR "") +set(CMAKE_RANLIB "") +set(CMAKE_LINKER "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/link.exe") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "4") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin new file mode 100644 index 0000000..52b98ec Binary files /dev/null and b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin differ diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeRCCompiler.cmake b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeRCCompiler.cmake new file mode 100644 index 0000000..f71ace0 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeRCCompiler.cmake @@ -0,0 +1,6 @@ +set(CMAKE_RC_COMPILER "rc") +set(CMAKE_RC_COMPILER_ARG1 "") +set(CMAKE_RC_COMPILER_LOADED 1) +set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc) +set(CMAKE_RC_OUTPUT_EXTENSION .res) +set(CMAKE_RC_COMPILER_ENV_VAR "RC") diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeSystem.cmake b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeSystem.cmake new file mode 100644 index 0000000..c10783e --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Windows-6.1") +set(CMAKE_HOST_SYSTEM_NAME "Windows") +set(CMAKE_HOST_SYSTEM_VERSION "6.1") +set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") + + + +set(CMAKE_SYSTEM "Windows-6.1") +set(CMAKE_SYSTEM_NAME "Windows") +set(CMAKE_SYSTEM_VERSION "6.1") +set(CMAKE_SYSTEM_PROCESSOR "AMD64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 0000000..cba81d4 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,389 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100) + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_C = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) +# if defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" +# else +# if __IBMC__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +/* Analog VisualDSP++ >= 4.5.6 */ +#elif defined(__VISUALDSPVERSION__) +# define COMPILER_ID "ADSP" + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) + +/* Analog VisualDSP++ < 4.5.6 */ +#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" + +/* IAR Systems compiler for embedded systems. + http://www.iar.com */ +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +/* sdcc, the small devices C compiler for embedded systems, + http://sdcc.sourceforge.net */ +#elif defined(SDCC) +# define COMPILER_ID "SDCC" + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + +/* This compiler is either not known or is too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" + +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# define ARCHITECTURE_ID "ARM" + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif + (void)argv; + return require; +} +#endif diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.exe b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.exe new file mode 100644 index 0000000..98779ff Binary files /dev/null and b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.exe differ diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.vcxproj new file mode 100644 index 0000000..ff57f23 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.vcxproj @@ -0,0 +1,52 @@ + + + + + Debug + Win32 + + + + {CAE07175-D007-4FC3-BFE8-47B392814159} + CompilerIdC + Win32Proj + + + + Application + + MultiByte + + + + <_ProjectFileVersion>10.0.30319.1 + .\ + $(Configuration)\ + false + + + + Disabled + %(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebugDLL + + + TurnOffAllWarnings + + + + + false + Console + + + for %%i in (cl.exe) do %40echo CMAKE_C_COMPILER=%%~$PATH:i + + + + + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CMakeOutput.log b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..bb54850 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CMakeOutput.log @@ -0,0 +1,134 @@ +The system is: Windows - 6.1 - AMD64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: +Build flags: +Id flags: + +The output was: +0 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: CompilerIdC, Configuration: Debug Win32 ------ +1> CMakeCCompilerId.c +1> CompilerIdC.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CompilerIdC\.\CompilerIdC.exe +1> CMAKE_C_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.exe" + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.vcxproj" + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.vcxproj.user" + +The C compiler identification is MSVC, found in "C:/Libraries/C++/Lz4/bin/CMakeFiles/2.8.12.2/CompilerIdC/CompilerIdC.exe" + +Determining if the C compiler works passed with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec3104864655 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec3104864655, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec3104864655.dir\Debug\\" /Fd"cmTryCompileExec3104864655.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt testCCompiler.c +1> +1> testCCompiler.c +1> cmTryCompileExec3104864655.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec3104864655.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec3345049186 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec3345049186, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec3345049186.dir\Debug\\" /Fd"cmTryCompileExec3345049186.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt "..\..\..\..\..\..\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompilerABI.c" +1> +1> CMakeCCompilerABI.c +1> cmTryCompileExec3345049186.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec3345049186.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Determining if the include file sys/types.h exists passed with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2810492839 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec2810492839, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2810492839.dir\Debug\\" /Fd"cmTryCompileExec2810492839.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt CheckIncludeFile.c +1> +1> CheckIncludeFile.c +1> cmTryCompileExec2810492839.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec2810492839.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Determining if the include file stdint.h exists passed with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec993810014 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec993810014, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec993810014.dir\Debug\\" /Fd"cmTryCompileExec993810014.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt CheckIncludeFile.c +1> +1> CheckIncludeFile.c +1> cmTryCompileExec993810014.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec993810014.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Determining if the include file stddef.h exists passed with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec3725845484 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec3725845484, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec3725845484.dir\Debug\\" /Fd"cmTryCompileExec3725845484.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt CheckIncludeFile.c +1> +1> CheckIncludeFile.c +1> cmTryCompileExec3725845484.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec3725845484.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + +Determining size of void * passed with the following output: +Change Dir: C:/Libraries/C++/Lz4/bin/CMakeFiles/CMakeTmp + +Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2757005426 + +Microsoft (R) Visual Studio Version 10.0.40219.1. +Copyright (C) Microsoft Corp. All rights reserved. +1>------ Build started: Project: cmTryCompileExec2757005426, Configuration: Debug Win32 ------ +1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 +1> Copyright (C) Microsoft Corporation. All rights reserved. +1> +1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _SCL_SECURE_NO_WARNINGS /D _WINDLL /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2757005426.dir\Debug\\" /Fd"cmTryCompileExec2757005426.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt ..\CheckTypeSize\SIZEOF_VOID_P.c +1> +1> SIZEOF_VOID_P.c +1> cmTryCompileExec2757005426.vcxproj -> C:\Libraries\C++\Lz4\bin\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec2757005426.exe +========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.bin b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.bin new file mode 100644 index 0000000..3612d33 Binary files /dev/null and b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.bin differ diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.c b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.c new file mode 100644 index 0000000..f7de2f8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.c @@ -0,0 +1,40 @@ +#include +#include +#include + + +#undef KEY +#if defined(__i386) +# define KEY '_','_','i','3','8','6' +#elif defined(__x86_64) +# define KEY '_','_','x','8','6','_','6','4' +#elif defined(__ppc__) +# define KEY '_','_','p','p','c','_','_' +#elif defined(__ppc64__) +# define KEY '_','_','p','p','c','6','4','_','_' +#endif + +#define SIZE (sizeof(void *)) +char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[', + ('0' + ((SIZE / 10000)%10)), + ('0' + ((SIZE / 1000)%10)), + ('0' + ((SIZE / 100)%10)), + ('0' + ((SIZE / 10)%10)), + ('0' + (SIZE % 10)), + ']', +#ifdef KEY + ' ','k','e','y','[', KEY, ']', +#endif + '\0'}; + +#ifdef __CLASSIC_C__ +int main(argc, argv) int argc; char *argv[]; +#else +int main(int argc, char *argv[]) +#endif +{ + int require = 0; + require += info_size[argc]; + (void)argv; + return require; +} diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/TargetDirectories.txt b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..12e10e0 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,3 @@ +C:/Libraries/C++/Lz4/bin/CMakeFiles/ALL_BUILD.dir +C:/Libraries/C++/Lz4/bin/CMakeFiles/ZERO_CHECK.dir +C:/Libraries/C++/Lz4/bin/CMakeFiles/liblz4.dir diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/cmake.check_cache b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule new file mode 100644 index 0000000..2d3998c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ALL_BUILD.rule @@ -0,0 +1 @@ +# generated from CMake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule new file mode 100644 index 0000000..2d3998c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule @@ -0,0 +1 @@ +# generated from CMake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule new file mode 100644 index 0000000..2d3998c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule @@ -0,0 +1 @@ +# generated from CMake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule new file mode 100644 index 0000000..2d3998c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule @@ -0,0 +1 @@ +# generated from CMake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule new file mode 100644 index 0000000..2d3998c --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule @@ -0,0 +1 @@ +# generated from CMake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp new file mode 100644 index 0000000..9b5f49f --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp @@ -0,0 +1 @@ +# CMake generation timestamp file for this directory. diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.depend b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.depend new file mode 100644 index 0000000..c198b88 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.depend @@ -0,0 +1,20 @@ +# CMake generation dependency list for this directory. +C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt +C:/Libraries/C++/Lz4/bin/CMakeFiles/2.8.12.2/CMakeSystem.cmake +C:/Libraries/C++/Lz4/bin/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeGenericSystem.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/WindowsPaths.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-MSVC-C.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-MSVC.cmake +C:/Libraries/C++/Lz4/bin/CMakeFiles/2.8.12.2/CMakeRCCompiler.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CPack.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CPackComponent.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPackConfig.cmake.in +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPackConfig.cmake.in +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CheckTypeSize.cmake +C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CheckIncludeFile.cmake diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.list b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.list new file mode 100644 index 0000000..b934892 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CMakeFiles/generate.stamp.list @@ -0,0 +1 @@ +C:/Libraries/C++/Lz4/bin/CMakeFiles/generate.stamp diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CPackConfig.cmake b/thirdparty/Lz4/Lz4_131/vs2010/CPackConfig.cmake new file mode 100644 index 0000000..ee5fae2 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CPackConfig.cmake @@ -0,0 +1,67 @@ +# This file will be configured to contain variables for CPack. These variables +# should be set in the CMake list file of the project before CPack module is +# included. The list of available CPACK_xxx variables and their associated +# documentation may be obtained using +# cpack --help-variable-list +# +# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME) +# and some are specific to a generator +# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables +# usually begin with CPACK__xxxx. + + +SET(CPACK_BINARY_BUNDLE "") +SET(CPACK_BINARY_CYGWIN "") +SET(CPACK_BINARY_DEB "") +SET(CPACK_BINARY_DRAGNDROP "") +SET(CPACK_BINARY_NSIS "ON") +SET(CPACK_BINARY_OSXX11 "") +SET(CPACK_BINARY_PACKAGEMAKER "") +SET(CPACK_BINARY_RPM "") +SET(CPACK_BINARY_STGZ "") +SET(CPACK_BINARY_TBZ2 "") +SET(CPACK_BINARY_TGZ "") +SET(CPACK_BINARY_TZ "") +SET(CPACK_BINARY_WIX "OFF") +SET(CPACK_BINARY_ZIP "OFF") +SET(CPACK_CMAKE_GENERATOR "Visual Studio 10") +SET(CPACK_COMPONENTS_ALL "") +SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE") +SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE") +SET(CPACK_GENERATOR "NSIS") +SET(CPACK_INSTALL_CMAKE_PROJECTS "C:/Libraries/C++/Lz4/bin;LZ4;ALL;/") +SET(CPACK_INSTALL_PREFIX "C:/Program Files (x86)/LZ4") +SET(CPACK_MODULE_PATH "") +SET(CPACK_NSIS_DISPLAY_NAME "LZ4 1.5.r128") +SET(CPACK_NSIS_INSTALLER_ICON_CODE "") +SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") +SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") +SET(CPACK_NSIS_PACKAGE_NAME "LZ4 1.5.r128") +SET(CPACK_OUTPUT_CONFIG_FILE "C:/Libraries/C++/Lz4/bin/CPackConfig.cmake") +SET(CPACK_PACKAGE_DEFAULT_LOCATION "/") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericDescription.txt") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LZ4 compression library") +SET(CPACK_PACKAGE_FILE_NAME "LZ4-1.5.r128-win32") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "LZ4 1.5.r128") +SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "LZ4 1.5.r128") +SET(CPACK_PACKAGE_NAME "LZ4") +SET(CPACK_PACKAGE_RELOCATABLE "true") +SET(CPACK_PACKAGE_VENDOR "Humanity") +SET(CPACK_PACKAGE_VERSION "1.5.r128") +SET(CPACK_PACKAGE_VERSION_MAJOR "1") +SET(CPACK_PACKAGE_VERSION_MINOR "5") +SET(CPACK_PACKAGE_VERSION_PATCH "r128") +SET(CPACK_RESOURCE_FILE_LICENSE "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericLicense.txt") +SET(CPACK_RESOURCE_FILE_README "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericDescription.txt") +SET(CPACK_RESOURCE_FILE_WELCOME "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericWelcome.txt") +SET(CPACK_SET_DESTDIR "OFF") +SET(CPACK_SOURCE_CYGWIN "") +SET(CPACK_SOURCE_GENERATOR "ZIP") +SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "C:/Libraries/C++/Lz4/bin/CPackSourceConfig.cmake") +SET(CPACK_SOURCE_TBZ2 "") +SET(CPACK_SOURCE_TGZ "") +SET(CPACK_SOURCE_TZ "") +SET(CPACK_SOURCE_ZIP "ON") +SET(CPACK_SYSTEM_NAME "win32") +SET(CPACK_TOPLEVEL_TAG "win32") +SET(CPACK_WIX_SIZEOF_VOID_P "4") diff --git a/thirdparty/Lz4/Lz4_131/vs2010/CPackSourceConfig.cmake b/thirdparty/Lz4/Lz4_131/vs2010/CPackSourceConfig.cmake new file mode 100644 index 0000000..ad02a56 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/CPackSourceConfig.cmake @@ -0,0 +1,74 @@ +# This file will be configured to contain variables for CPack. These variables +# should be set in the CMake list file of the project before CPack module is +# included. The list of available CPACK_xxx variables and their associated +# documentation may be obtained using +# cpack --help-variable-list +# +# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME) +# and some are specific to a generator +# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables +# usually begin with CPACK__xxxx. + + +SET(CPACK_BINARY_BUNDLE "") +SET(CPACK_BINARY_CYGWIN "") +SET(CPACK_BINARY_DEB "") +SET(CPACK_BINARY_DRAGNDROP "") +SET(CPACK_BINARY_NSIS "ON") +SET(CPACK_BINARY_OSXX11 "") +SET(CPACK_BINARY_PACKAGEMAKER "") +SET(CPACK_BINARY_RPM "") +SET(CPACK_BINARY_STGZ "") +SET(CPACK_BINARY_TBZ2 "") +SET(CPACK_BINARY_TGZ "") +SET(CPACK_BINARY_TZ "") +SET(CPACK_BINARY_WIX "OFF") +SET(CPACK_BINARY_ZIP "OFF") +SET(CPACK_CMAKE_GENERATOR "Visual Studio 10") +SET(CPACK_COMPONENTS_ALL "") +SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE") +SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE") +SET(CPACK_GENERATOR "ZIP") +SET(CPACK_IGNORE_FILES "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#") +SET(CPACK_INSTALLED_DIRECTORIES "C:/Libraries/C++/Lz4/cmake_unofficial;/") +SET(CPACK_INSTALL_CMAKE_PROJECTS "") +SET(CPACK_INSTALL_PREFIX "C:/Program Files (x86)/LZ4") +SET(CPACK_MODULE_PATH "") +SET(CPACK_NSIS_DISPLAY_NAME "LZ4 1.5.r128") +SET(CPACK_NSIS_INSTALLER_ICON_CODE "") +SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") +SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") +SET(CPACK_NSIS_PACKAGE_NAME "LZ4 1.5.r128") +SET(CPACK_OUTPUT_CONFIG_FILE "C:/Libraries/C++/Lz4/bin/CPackConfig.cmake") +SET(CPACK_PACKAGE_DEFAULT_LOCATION "/") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericDescription.txt") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LZ4 compression library") +SET(CPACK_PACKAGE_FILE_NAME "LZ4-1.5.r128-Source") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "LZ4 1.5.r128") +SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "LZ4 1.5.r128") +SET(CPACK_PACKAGE_NAME "LZ4") +SET(CPACK_PACKAGE_RELOCATABLE "true") +SET(CPACK_PACKAGE_VENDOR "Humanity") +SET(CPACK_PACKAGE_VERSION "1.5.r128") +SET(CPACK_PACKAGE_VERSION_MAJOR "1") +SET(CPACK_PACKAGE_VERSION_MINOR "5") +SET(CPACK_PACKAGE_VERSION_PATCH "r128") +SET(CPACK_RESOURCE_FILE_LICENSE "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericLicense.txt") +SET(CPACK_RESOURCE_FILE_README "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericDescription.txt") +SET(CPACK_RESOURCE_FILE_WELCOME "C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CPack.GenericWelcome.txt") +SET(CPACK_SET_DESTDIR "OFF") +SET(CPACK_SOURCE_CYGWIN "") +SET(CPACK_SOURCE_GENERATOR "ZIP") +SET(CPACK_SOURCE_IGNORE_FILES "/CVS/;/\\.svn/;/\\.bzr/;/\\.hg/;/\\.git/;\\.swp$;\\.#;/#") +SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "C:/Libraries/C++/Lz4/cmake_unofficial;/") +SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "C:/Libraries/C++/Lz4/bin/CPackSourceConfig.cmake") +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "LZ4-1.5.r128-Source") +SET(CPACK_SOURCE_TBZ2 "") +SET(CPACK_SOURCE_TGZ "") +SET(CPACK_SOURCE_TOPLEVEL_TAG "win32-Source") +SET(CPACK_SOURCE_TZ "") +SET(CPACK_SOURCE_ZIP "ON") +SET(CPACK_STRIP_FILES "") +SET(CPACK_SYSTEM_NAME "win32") +SET(CPACK_TOPLEVEL_TAG "win32-Source") +SET(CPACK_WIX_SIZEOF_VOID_P "4") diff --git a/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj new file mode 100644 index 0000000..a9d0099 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj @@ -0,0 +1,406 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + MinSizeRel + x64 + + + Release + Win32 + + + MinSizeRel + Win32 + + + Release + x64 + + + RelWithDebInfo + Win32 + + + RelWithDebInfo + x64 + + + + {B665A634-91FE-4DD7-99C6-C149C402DEF6} + Win32Proj + Win32 + INSTALL + + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/INSTALL_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\INSTALL_force + + + + + B0A290EA-4CFB-4E3A-991C-34A2B27EAD68 + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj.filters new file mode 100644 index 0000000..ba9fff3 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/INSTALL.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + CMake Rules + + + + + {1B37BC7F-0564-4C49-8D72-61A6B8DCC219} + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/LZ4.sln b/thirdparty/Lz4/Lz4_131/vs2010/LZ4.sln new file mode 100644 index 0000000..3302a47 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/LZ4.sln @@ -0,0 +1,106 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}" + ProjectSection(ProjectDependencies) = postProject + {780E2CF6-B95B-4509-A8D3-911628525375} = {780E2CF6-B95B-4509-A8D3-911628525375} + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F} = {16F08DF1-D385-4C80-A4F8-7E0F09D4313F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INSTALL", "INSTALL.vcxproj", "{B665A634-91FE-4DD7-99C6-C149C402DEF6}" + ProjectSection(ProjectDependencies) = postProject + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68} = {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PACKAGE", "PACKAGE.vcxproj", "{5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}" + ProjectSection(ProjectDependencies) = postProject + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68} = {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{780E2CF6-B95B-4509-A8D3-911628525375}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4", "liblz4.vcxproj", "{16F08DF1-D385-4C80-A4F8-7E0F09D4313F}" + ProjectSection(ProjectDependencies) = postProject + {780E2CF6-B95B-4509-A8D3-911628525375} = {780E2CF6-B95B-4509-A8D3-911628525375} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + MinSizeRel|Win32 = MinSizeRel|Win32 + MinSizeRel|x64 = MinSizeRel|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + RelWithDebInfo|Win32 = RelWithDebInfo|Win32 + RelWithDebInfo|x64 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Debug|Win32.ActiveCfg = Debug|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Debug|Win32.Build.0 = Debug|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Debug|x64.ActiveCfg = Debug|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Debug|x64.Build.0 = Debug|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Release|Win32.ActiveCfg = Release|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Release|Win32.Build.0 = Release|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Release|x64.ActiveCfg = Release|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.Release|x64.Build.0 = Release|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {B0A290EA-4CFB-4E3A-991C-34A2B27EAD68}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.Debug|Win32.ActiveCfg = Debug|Win32 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.Debug|x64.ActiveCfg = Debug|x64 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.Release|Win32.ActiveCfg = Release|Win32 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.Release|x64.ActiveCfg = Release|x64 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {B665A634-91FE-4DD7-99C6-C149C402DEF6}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.Debug|Win32.ActiveCfg = Debug|Win32 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.Debug|x64.ActiveCfg = Debug|x64 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.Release|Win32.ActiveCfg = Release|Win32 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.Release|x64.ActiveCfg = Release|x64 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.Debug|Win32.ActiveCfg = Debug|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.Debug|Win32.Build.0 = Debug|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.Debug|x64.ActiveCfg = Debug|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.Debug|x64.Build.0 = Debug|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.Release|Win32.ActiveCfg = Release|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.Release|Win32.Build.0 = Release|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.Release|x64.ActiveCfg = Release|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.Release|x64.Build.0 = Release|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 + {780E2CF6-B95B-4509-A8D3-911628525375}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {780E2CF6-B95B-4509-A8D3-911628525375}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Debug|Win32.ActiveCfg = Debug|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Debug|Win32.Build.0 = Debug|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Debug|x64.ActiveCfg = Debug|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Debug|x64.Build.0 = Debug|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Release|Win32.ActiveCfg = Release|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Release|Win32.Build.0 = Release|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Release|x64.ActiveCfg = Release|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.Release|x64.Build.0 = Release|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj new file mode 100644 index 0000000..97ada76 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj @@ -0,0 +1,438 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + MinSizeRel + x64 + + + Release + Win32 + + + MinSizeRel + Win32 + + + Release + x64 + + + RelWithDebInfo + Win32 + + + RelWithDebInfo + x64 + + + + {5D29D2D7-E2D6-4121-BA4A-E4DCBE626291} + Win32Proj + Win32 + PACKAGE + + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + false + MultiByte + + + + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + setlocal +cd C:\Libraries\C++\Lz4\bin +if %errorlevel% neq 0 goto :cmEnd +C: +if %errorlevel% neq 0 goto :cmEnd +"C:\Program Files (x86)\CMake 2.8\bin\cpack.exe" -C $(Configuration) --config ./CPackConfig.cmake +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + + + + + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + + + + + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +cd . +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/PACKAGE_force.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + C:\Libraries\C++\Lz4\bin\CMakeFiles\PACKAGE_force + + + + + B0A290EA-4CFB-4E3A-991C-34A2B27EAD68 + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj.filters new file mode 100644 index 0000000..ef83a38 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/PACKAGE.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + CMake Rules + + + + + {1B37BC7F-0564-4C49-8D72-61A6B8DCC219} + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj new file mode 100644 index 0000000..637d4f1 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj @@ -0,0 +1,382 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + MinSizeRel + x64 + + + Release + Win32 + + + MinSizeRel + Win32 + + + Release + x64 + + + RelWithDebInfo + Win32 + + + RelWithDebInfo + x64 + + + + {780E2CF6-B95B-4509-A8D3-911628525375} + Win32Proj + Win32 + ZERO_CHECK + + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + Utility + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + $(Platform)\$(Configuration)\$(ProjectName)\ + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + Checking Build System + Checking Build System + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Checking Build System + Checking Build System + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Checking Build System + Checking Build System + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Checking Build System + Checking Build System + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "$(SolutionPath)" +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/generate.stamp.rule;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + + + + + + + + + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + + + + + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + + + + + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + + + + + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:/Libraries/C++/Lz4/bin/CMakeFiles/e900ecaa291cea520b30854a0011de63/ZERO_CHECK.rule;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + C:\Libraries\C++\Lz4\bin\CMakeFiles\ZERO_CHECK + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj.filters new file mode 100644 index 0000000..d87d997 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/ZERO_CHECK.vcxproj.filters @@ -0,0 +1,19 @@ + + + + + CMake Rules + + + CMake Rules + + + + + + + + {1B37BC7F-0564-4C49-8D72-61A6B8DCC219} + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/cmake_install.cmake b/thirdparty/Lz4/Lz4_131/vs2010/cmake_install.cmake new file mode 100644 index 0000000..92b630e --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/cmake_install.cmake @@ -0,0 +1,59 @@ +# Install script for directory: C:/Libraries/C++/Lz4/cmake_unofficial + +# Set the install prefix +IF(NOT DEFINED CMAKE_INSTALL_PREFIX) + SET(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/LZ4") +ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) +STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + IF(BUILD_TYPE) + STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + ELSE(BUILD_TYPE) + SET(CMAKE_INSTALL_CONFIG_NAME "Release") + ENDIF(BUILD_TYPE) + MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + +# Set the component getting installed. +IF(NOT CMAKE_INSTALL_COMPONENT) + IF(COMPONENT) + MESSAGE(STATUS "Install component: \"${COMPONENT}\"") + SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + ELSE(COMPONENT) + SET(CMAKE_INSTALL_COMPONENT) + ENDIF(COMPONENT) +ENDIF(NOT CMAKE_INSTALL_COMPONENT) + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + IF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Dd][Ee][Bb][Uu][Gg])$") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "C:/Libraries/C++/Lz4/bin/Debug/lz4.lib") + ELSEIF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "C:/Libraries/C++/Lz4/bin/Release/lz4.lib") + ELSEIF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Mm][Ii][Nn][Ss][Ii][Zz][Ee][Rr][Ee][Ll])$") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "C:/Libraries/C++/Lz4/bin/MinSizeRel/lz4.lib") + ELSEIF("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "C:/Libraries/C++/Lz4/bin/RelWithDebInfo/lz4.lib") + ENDIF() +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + +IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES + "C:/Libraries/C++/Lz4/cmake_unofficial/../lib//lz4.h" + "C:/Libraries/C++/Lz4/cmake_unofficial/../lib//lz4hc.h" + "C:/Libraries/C++/Lz4/cmake_unofficial/../lib//lz4frame.h" + ) +ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified") + +IF(CMAKE_INSTALL_COMPONENT) + SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +ELSE(CMAKE_INSTALL_COMPONENT) + SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +ENDIF(CMAKE_INSTALL_COMPONENT) + +FILE(WRITE "C:/Libraries/C++/Lz4/bin/${CMAKE_INSTALL_MANIFEST}" "") +FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES}) + FILE(APPEND "C:/Libraries/C++/Lz4/bin/${CMAKE_INSTALL_MANIFEST}" "${file}\n") +ENDFOREACH(file) diff --git a/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj new file mode 100644 index 0000000..1fc70f8 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj @@ -0,0 +1,481 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + MinSizeRel + x64 + + + Release + Win32 + + + MinSizeRel + Win32 + + + Release + x64 + + + RelWithDebInfo + Win32 + + + RelWithDebInfo + x64 + + + + {16F08DF1-D385-4C80-A4F8-7E0F09D4313F} + Win32Proj + Win32 + liblz4 + + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + C:\Libraries\C++\Lz4\bin\Debug\ + C:\Libraries\C++\Lz4\bin\Debug\ + liblz4.dir\Debug\ + liblz4.dir\Debug\ + lz4 + lz4 + .lib + .lib + C:\Libraries\C++\Lz4\bin\Release\ + C:\Libraries\C++\Lz4\bin\Release\ + liblz4.dir\Release\ + liblz4.dir\Release\ + lz4 + lz4 + .lib + .lib + C:\Libraries\C++\Lz4\bin\MinSizeRel\ + C:\Libraries\C++\Lz4\bin\MinSizeRel\ + liblz4.dir\MinSizeRel\ + liblz4.dir\MinSizeRel\ + lz4 + lz4 + .lib + .lib + C:\Libraries\C++\Lz4\bin\RelWithDebInfo\ + C:\Libraries\C++\Lz4\bin\RelWithDebInfo\ + liblz4.dir\RelWithDebInfo\ + liblz4.dir\RelWithDebInfo\ + lz4 + lz4 + .lib + .lib + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Debug/ + EnableFastChecks + CompileAsC + ProgramDatabase + + + Disabled + Disabled + NotUsing + MultiThreadedDebugDLL + Level4 + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Debug";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Debug/ + EnableFastChecks + CompileAsC + ProgramDatabase + + + Disabled + Disabled + NotUsing + MultiThreadedDebugDLL + Level4 + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Debug";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Release/ + CompileAsC + + + AnySuitable + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Release";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Release/ + CompileAsC + + + AnySuitable + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Release";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + MinSizeRel/ + CompileAsC + + + OnlyExplicitInline + MinSpace + NotUsing + MultiThreadedDLL + Level4 + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="MinSizeRel";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + MinSizeRel/ + CompileAsC + + + OnlyExplicitInline + MinSpace + NotUsing + MultiThreadedDLL + Level4 + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="MinSizeRel";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + RelWithDebInfo/ + CompileAsC + ProgramDatabase + + + OnlyExplicitInline + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="RelWithDebInfo";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + RelWithDebInfo/ + CompileAsC + ProgramDatabase + + + OnlyExplicitInline + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="RelWithDebInfo";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + + + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + + + + + + + + + + + + + + 780E2CF6-B95B-4509-A8D3-911628525375 + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj.filters new file mode 100644 index 0000000..fe2514f --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/liblz4.vcxproj.filters @@ -0,0 +1,39 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + + + + {0989D84A-2833-45CF-89B7-AA6632154F2F} + + + {E0317FBC-45B2-4A87-A66F-09FDC58F5715} + + + diff --git a/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj b/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj new file mode 100644 index 0000000..c05fbbd --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj @@ -0,0 +1,320 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + MinSizeRel + Win32 + + + RelWithDebInfo + Win32 + + + + {C4244369-A6B8-4DC6-831C-53F6F03AE0F4} + Win32Proj + Win32 + lz4 + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + <_ProjectFileVersion>10.0.20506.1 + C:\Libraries\C++\Lz4\bin\Debug\ + lz4.dir\Debug\ + lz4 + .exe + true + true + C:\Libraries\C++\Lz4\bin\Release\ + lz4.dir\Release\ + lz4 + .exe + false + true + C:\Libraries\C++\Lz4\bin\MinSizeRel\ + lz4.dir\MinSizeRel\ + lz4 + .exe + false + true + C:\Libraries\C++\Lz4\bin\RelWithDebInfo\ + lz4.dir\RelWithDebInfo\ + lz4 + .exe + true + true + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Debug/ + EnableFastChecks + CompileAsC + ProgramDatabase + + + Disabled + Disabled + NotUsing + MultiThreadedDebugDLL + Level4 + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Debug";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;_DEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + /machine:X86 /debug %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;Debug\lz4.lib + %(AdditionalLibraryDirectories) + true + C:/Libraries/C++/Lz4/bin/Debug/lz4.lib + C:/Libraries/C++/Lz4/bin/Debug/lz4.pdb + Console + + + + false + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + Release/ + CompileAsC + + + AnySuitable + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="Release";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + /machine:X86 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;Release\lz4.lib + %(AdditionalLibraryDirectories) + false + C:/Libraries/C++/Lz4/bin/Release/lz4.lib + C:/Libraries/C++/Lz4/bin/Release/lz4.pdb + Console + + + + false + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + MinSizeRel/ + CompileAsC + + + OnlyExplicitInline + MinSpace + NotUsing + MultiThreadedDLL + Level4 + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="MinSizeRel";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + /machine:X86 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;MinSizeRel\lz4.lib + %(AdditionalLibraryDirectories) + false + C:/Libraries/C++/Lz4/bin/MinSizeRel/lz4.lib + C:/Libraries/C++/Lz4/bin/MinSizeRel/lz4.pdb + Console + + + + false + + + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + RelWithDebInfo/ + CompileAsC + ProgramDatabase + + + OnlyExplicitInline + MaxSpeed + NotUsing + MultiThreadedDLL + Level4 + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION="r128";CMAKE_INTDIR="RelWithDebInfo";%(PreprocessorDefinitions) + $(IntDir) + + + WIN32;_WINDOWS;NDEBUG;LZ4_VERSION=\"r128\";CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + + + C:\Libraries\C++\Lz4\cmake_unofficial\..\lib;%(AdditionalIncludeDirectories) + $(IntDir) + %(Filename).h + %(Filename).tlb + %(Filename)_i.c + %(Filename)_p.c + + + /machine:X86 /debug %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;RelWithDebInfo\lz4.lib + %(AdditionalLibraryDirectories) + true + C:/Libraries/C++/Lz4/bin/RelWithDebInfo/lz4.lib + C:/Libraries/C++/Lz4/bin/RelWithDebInfo/lz4.pdb + Console + + + + false + + + + + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS10FindMake.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystem.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerId.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CompilerId\VS-10.vcxproj.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeClDeps.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeFindBinUtils.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCompilerCommon.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerABI.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeParseImplicitLinkInfo.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompilerABI.c;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.c.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\CheckTypeSize\SIZEOF_VOID_P.c;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS10FindMake.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystem.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerId.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CompilerId\VS-10.vcxproj.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeClDeps.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeFindBinUtils.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCompilerCommon.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerABI.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeParseImplicitLinkInfo.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompilerABI.c;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.c.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\CheckTypeSize\SIZEOF_VOID_P.c;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS10FindMake.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystem.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerId.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CompilerId\VS-10.vcxproj.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeClDeps.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeFindBinUtils.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCompilerCommon.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerABI.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeParseImplicitLinkInfo.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompilerABI.c;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.c.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\CheckTypeSize\SIZEOF_VOID_P.c;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + Building Custom Rule C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt + setlocal +"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -HC:/Libraries/C++/Lz4/cmake_unofficial -BC:/Libraries/C++/Lz4/bin --check-stamp-file C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp +if %errorlevel% neq 0 goto :cmEnd +:cmEnd +endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone +:cmErrorLevel +exit /b %1 +:cmDone +if %errorlevel% neq 0 goto :VCEnd + C:/Libraries/C++/Lz4/cmake_unofficial/CMakeLists.txt;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeVS10FindMake.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystem.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerId.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CompilerId\VS-10.vcxproj.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeClDeps.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeFindBinUtils.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestRCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeTestCompilerCommon.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeDetermineCompilerABI.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeParseImplicitLinkInfo.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompilerABI.c;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CMakeCCompiler.cmake.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\2.8.12.2\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPack.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CPackComponent.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Templates\CPackConfig.cmake.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.cmake;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckIncludeFile.c.in;C:\Program Files (x86)\CMake 2.8\share\cmake-2.8\Modules\CheckTypeSize.c.in;C:\Libraries\C++\Lz4\bin\CMakeFiles\CheckTypeSize\SIZEOF_VOID_P.c;C:\Libraries\C++\Lz4\cmake_unofficial\CMakeLists.txt;%(AdditionalInputs) + C:\Libraries\C++\Lz4\bin\CMakeFiles\generate.stamp + + + + + + + + + + + + 780E2CF6-B95B-4509-A8D3-911628525375 + + + 16F08DF1-D385-4C80-A4F8-7E0F09D4313F + + + + + + \ No newline at end of file diff --git a/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj.filters b/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj.filters new file mode 100644 index 0000000..dc35921 --- /dev/null +++ b/thirdparty/Lz4/Lz4_131/vs2010/lz4.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + + + + {0989D84A-2833-45CF-89B7-AA6632154F2F} + + + diff --git a/thirdparty/boost/.gitignore b/thirdparty/boost/.gitignore new file mode 100644 index 0000000..137b4d5 --- /dev/null +++ b/thirdparty/boost/.gitignore @@ -0,0 +1 @@ +boost_* diff --git a/thirdparty/boost/copy_boost.txt b/thirdparty/boost/copy_boost.txt new file mode 100644 index 0000000..69b0bc0 --- /dev/null +++ b/thirdparty/boost/copy_boost.txt @@ -0,0 +1 @@ +Copy boost_1_55_0 to this directory. diff --git a/thirdparty/glew/glew-1.9.0/LICENSE.txt b/thirdparty/glew/glew-1.9.0/LICENSE.txt new file mode 100644 index 0000000..f707804 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/LICENSE.txt @@ -0,0 +1,73 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2007, Milan Ikits +Copyright (C) 2002-2007, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/thirdparty/glew/glew-1.9.0/Makefile b/thirdparty/glew/glew-1.9.0/Makefile new file mode 100644 index 0000000..77d693d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/Makefile @@ -0,0 +1,392 @@ +#!gmake +## The OpenGL Extension Wrangler Library +## Copyright (C) 2002-2008, Milan Ikits +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002, Lev Povalahev +## All rights reserved. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are met: +## +## * Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimer. +## * Redistributions in binary form must reproduce the above copyright notice, +## this list of conditions and the following disclaimer in the documentation +## and/or other materials provided with the distribution. +## * The name of the author may be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +## THE POSSIBILITY OF SUCH DAMAGE. + +include config/version + +SHELL = /bin/sh +SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;') +SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1) + +ifeq ($(SYSTEM.SUPPORTED), 1) +include config/Makefile.$(SYSTEM) +else +$(error "Platform '$(SYSTEM)' not supported") +endif + +GLEW_DEST ?= /usr +BINDIR ?= $(GLEW_DEST)/bin +LIBDIR ?= $(GLEW_DEST)/lib +INCDIR ?= $(GLEW_DEST)/include/GL + +TARDIR = ../glew-$(GLEW_VERSION) +TARBALL = ../glew-$(GLEW_VERSION).tar.gz + +DIST_DIR = glew-$(GLEW_VERSION) +DIST_WIN32 = glew-$(GLEW_VERSION)-win32.zip +DIST_SRC_ZIP = glew-$(GLEW_VERSION).zip +DIST_SRC_TGZ = glew-$(GLEW_VERSION).tgz + +# To disable stripping of binaries either: +# - use STRIP= on gmake command-line +# - edit this makefile to set STRIP to the empty string +# +# To disable symlinks: +# - use LN= on gmake command-line + +AR ?= ar +INSTALL ?= install +STRIP ?= strip +RM ?= rm -f +LN ?= ln -sf + +ifeq ($(MAKECMDGOALS), debug) +OPT = -g +else +OPT = $(POPT) +endif +INCLUDE = -Iinclude +CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA) + +all debug: glew.lib glew.lib.mx glew.bin + +# GLEW shared and static libraries + +LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL) +LIB.LIBS := $(GL_LDFLAGS) + +LIB.SRCS := src/glew.c +LIB.SRCS.NAMES := $(notdir $(LIB.SRCS)) + +LIB.OBJS := $(addprefix tmp/$(SYSTEM)/default/static/,$(LIB.SRCS.NAMES)) +LIB.OBJS := $(LIB.OBJS:.c=.o) +LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/default/shared/,$(LIB.SRCS.NAMES)) +LIB.SOBJS := $(LIB.SOBJS:.c=.o) + +LIB.OBJS.MX := $(addprefix tmp/$(SYSTEM)/mx/static/,$(LIB.SRCS.NAMES)) +LIB.OBJS.MX := $(LIB.OBJS.MX:.c=.o) +LIB.SOBJS.MX := $(addprefix tmp/$(SYSTEM)/mx/shared/,$(LIB.SRCS.NAMES)) +LIB.SOBJS.MX := $(LIB.SOBJS.MX:.c=.o) + +glew.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC) glew.pc + +lib: + mkdir lib + +lib/$(LIB.STATIC): $(LIB.OBJS) + $(AR) cr $@ $^ +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +lib/$(LIB.SHARED): $(LIB.SOBJS) + $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) +ifneq ($(LN),) + $(LN) $(LIB.SHARED) lib/$(LIB.SONAME) + $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK) +endif +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +tmp/$(SYSTEM)/default/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +tmp/$(SYSTEM)/default/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $< + +glew.pc: glew.pc.in + sed \ + -e "s|@prefix@|$(GLEW_DEST)|g" \ + -e "s|@libdir@|$(LIBDIR)|g" \ + -e "s|@exec_prefix@|$(BINDIR)|g" \ + -e "s|@includedir@|$(INCDIR)|g" \ + -e "s|@version@|$(GLEW_VERSION)|g" \ + -e "s|@cflags@||g" \ + -e "s|@libname@|GLEW|g" \ + < $< > $@ + +# GLEW MX static and shared libraries + +glew.lib.mx: lib lib/$(LIB.SHARED.MX) lib/$(LIB.STATIC.MX) glewmx.pc + +lib/$(LIB.STATIC.MX): $(LIB.OBJS.MX) + $(AR) cr $@ $^ + +lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX) + $(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) +ifneq ($(LN),) + $(LN) $(LIB.SHARED.MX) lib/$(LIB.SONAME.MX) + $(LN) $(LIB.SHARED.MX) lib/$(LIB.DEVLNK.MX) +endif +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +tmp/$(SYSTEM)/mx/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU -DGLEW_MX -DGLEW_STATIC $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +tmp/$(SYSTEM)/mx/shared/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU -DGLEW_MX $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $< + +glewmx.pc: glew.pc.in + sed \ + -e "s|@prefix@|$(GLEW_DEST)|g" \ + -e "s|@libdir@|$(LIBDIR)|g" \ + -e "s|@exec_prefix@|$(BINDIR)|g" \ + -e "s|@includedir@|$(INCDIR)|g" \ + -e "s|@version@|$(GLEW_VERSION)|g" \ + -e "s|@cflags@|-DGLEW_MX|g" \ + -e "s|@libname@|GLEWmx|g" \ + < $< > $@ + +# GLEW utility programs + +BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL) + +GLEWINFO.BIN := glewinfo$(BIN.SUFFIX) +GLEWINFO.BIN.SRC := src/glewinfo.c +GLEWINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(GLEWINFO.BIN.SRC))) +GLEWINFO.BIN.OBJ := $(GLEWINFO.BIN.OBJ:.c=.o) + +VISUALINFO.BIN := visualinfo$(BIN.SUFFIX) +VISUALINFO.BIN.SRC := src/visualinfo.c +VISUALINFO.BIN.OBJ := $(addprefix tmp/$(SYSTEM)/default/shared/,$(notdir $(VISUALINFO.BIN.SRC))) +VISUALINFO.BIN.OBJ := $(VISUALINFO.BIN.OBJ:.c=.o) + +glew.bin: glew.lib bin bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) + +bin: + mkdir bin + +bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED) + $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS) +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED) + $(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS) +ifneq ($(STRIP),) + $(STRIP) -x $@ +endif + +$(GLEWINFO.BIN.OBJ): $(GLEWINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +$(VISUALINFO.BIN.OBJ): $(VISUALINFO.BIN.SRC) include/GL/glew.h include/GL/wglew.h include/GL/glxew.h + @mkdir -p $(dir $@) + $(CC) -DGLEW_NO_GLU $(CFLAGS) $(CFLAGS.SO) -o $@ -c $< + +# Install targets + +install.all: install install.mx install.bin + +install: install.include install.lib install.pkgconfig + +install.mx: install.include install.lib.mx install.pkgconfig.mx + +install.lib: glew.lib + $(INSTALL) -d -m 0755 $(LIBDIR) +# runtime +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -d -m 0755 $(BINDIR) + $(INSTALL) -m 0755 lib/$(LIB.SHARED) $(BINDIR)/ +else + $(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/ +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME) +endif + +# development files +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/ +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK) +endif + $(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/ + +install.lib.mx: glew.lib.mx + $(INSTALL) -d -m 0755 $(LIBDIR) +# runtime +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -d -m 0755 $(BINDIR) + $(INSTALL) -m 0755 lib/$(LIB.SHARED.MX) $(BINDIR)/ +else + $(INSTALL) -m 0644 lib/$(LIB.SHARED.MX) $(LIBDIR)/ +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.SONAME.MX) +endif +# development files +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(INSTALL) -m 0644 lib/$(LIB.DEVLNK.MX) $(LIBDIR)/ +endif +ifneq ($(LN),) + $(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.DEVLNK.MX) +endif + $(INSTALL) -m 0644 lib/$(LIB.STATIC.MX) $(LIBDIR)/ + +install.bin: glew.bin + $(INSTALL) -d -m 0755 $(BINDIR) + $(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) $(BINDIR)/ + +install.include: + $(INSTALL) -d -m 0755 $(INCDIR) + $(INSTALL) -m 0644 include/GL/wglew.h $(INCDIR)/ + $(INSTALL) -m 0644 include/GL/glew.h $(INCDIR)/ + $(INSTALL) -m 0644 include/GL/glxew.h $(INCDIR)/ + +install.pkgconfig: glew.pc + $(INSTALL) -d -m 0755 $(LIBDIR) + $(INSTALL) -d -m 0755 $(LIBDIR)/pkgconfig + $(INSTALL) -m 0644 glew.pc $(LIBDIR)/pkgconfig/ + +install.pkgconfig.mx: glewmx.pc + $(INSTALL) -d -m 0755 $(LIBDIR) + $(INSTALL) -d -m 0755 $(LIBDIR)/pkgconfig + $(INSTALL) -m 0644 glewmx.pc $(LIBDIR)/pkgconfig/ + +uninstall: + $(RM) $(INCDIR)/wglew.h + $(RM) $(INCDIR)/glew.h + $(RM) $(INCDIR)/glxew.h + $(RM) $(LIBDIR)/$(LIB.DEVLNK) $(LIBDIR)/$(LIB.DEVLNK.MX) +ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) + $(RM) $(BINDIR)/$(LIB.SHARED) $(BINDIR)/$(LIB.SHARED.MX) +else + $(RM) $(LIBDIR)/$(LIB.SONAME) $(LIBDIR)/$(LIB.SONAME.MX) + $(RM) $(LIBDIR)/$(LIB.SHARED) $(LIBDIR)/$(LIB.SHARED.MX) +endif + $(RM) $(LIBDIR)/$(LIB.STATIC) $(LIBDIR)/$(LIB.STATIC.MX) + $(RM) $(BINDIR)/$(GLEWINFO.BIN) $(BINDIR)/$(VISUALINFO.BIN) + +clean: + $(RM) -r tmp/ + $(RM) -r lib/ + $(RM) -r bin/ + $(RM) glew.pc glewmx.pc + +distclean: clean + find . -name \*~ | xargs $(RM) + find . -name .\*.sw\? | xargs $(RM) + +# Distributions + +dist-win32: + $(RM) -r $(TARDIR) + mkdir -p $(TARDIR) + mkdir -p $(TARDIR)/bin + mkdir -p $(TARDIR)/lib + cp -a include $(TARDIR) + cp -a doc $(TARDIR) + cp -a *.txt $(TARDIR) + cp -a lib/glew32.lib $(TARDIR)/lib + cp -a lib/glew32s.lib $(TARDIR)/lib + cp -a lib/glew32mx.lib $(TARDIR)/lib + cp -a lib/glew32mxs.lib $(TARDIR)/lib + cp -a bin/glew32.dll $(TARDIR)/bin + cp -a bin/glew32mx.dll $(TARDIR)/bin + cp -a bin/glewinfo.exe $(TARDIR)/bin + cp -a bin/visualinfo.exe $(TARDIR)/bin + find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r + find $(TARDIR) -name .svn | xargs $(RM) -r + find $(TARDIR) -name "*.patch" | xargs $(RM) -r + unix2dos $(TARDIR)/include/GL/*.h + unix2dos $(TARDIR)/doc/*.txt + unix2dos $(TARDIR)/doc/*.html + unix2dos $(TARDIR)/*.txt + rm -f ../$(DIST_WIN32) + cd .. && zip -rv9 $(DIST_WIN32) $(DIST_DIR) + +dist-src: + $(RM) -r $(TARDIR) + mkdir -p $(TARDIR) + mkdir -p $(TARDIR)/bin + mkdir -p $(TARDIR)/lib + cp -a auto $(TARDIR) + $(RM) -Rf $(TARDIR)/auto/registry + cp -a build $(TARDIR) + cp -a config $(TARDIR) + cp -a src $(TARDIR) + cp -a doc $(TARDIR) + cp -a include $(TARDIR) + cp -a *.txt $(TARDIR) + cp -a Makefile $(TARDIR) + cp -a glew.pc.in $(TARDIR) + find $(TARDIR) -name '*.o' | xargs $(RM) -r + find $(TARDIR) -name '*~' | xargs $(RM) -r + find $(TARDIR) -name CVS -o -name .cvsignore | xargs $(RM) -r + find $(TARDIR) -name .svn | xargs $(RM) -r + find $(TARDIR) -name "*.patch" | xargs $(RM) -r + unix2dos $(TARDIR)/Makefile + unix2dos $(TARDIR)/config/* + unix2dos $(TARDIR)/auto/core/* + unix2dos $(TARDIR)/auto/extensions/* + find $(TARDIR) -name '*.h' | xargs unix2dos + find $(TARDIR) -name '*.c' | xargs unix2dos + find $(TARDIR) -name '*.txt' | xargs unix2dos + find $(TARDIR) -name '*.html' | xargs unix2dos + find $(TARDIR) -name '*.css' | xargs unix2dos + find $(TARDIR) -name '*.sh' | xargs unix2dos + find $(TARDIR) -name '*.pl' | xargs unix2dos + find $(TARDIR) -name 'Makefile' | xargs unix2dos + find $(TARDIR) -name '*.in' | xargs unix2dos + find $(TARDIR) -name '*.pm' | xargs unix2dos + find $(TARDIR) -name '*.rc' | xargs unix2dos + rm -f ../$(DIST_SRC_ZIP) + cd .. && zip -rv9 $(DIST_SRC_ZIP) $(DIST_DIR) + dos2unix $(TARDIR)/Makefile + dos2unix $(TARDIR)/config/* + dos2unix $(TARDIR)/auto/core/* + dos2unix $(TARDIR)/auto/extensions/* + find $(TARDIR) -name '*.h' | xargs dos2unix + find $(TARDIR) -name '*.c' | xargs dos2unix + find $(TARDIR) -name '*.txt' | xargs dos2unix + find $(TARDIR) -name '*.html' | xargs dos2unix + find $(TARDIR) -name '*.css' | xargs dos2unix + find $(TARDIR) -name '*.sh' | xargs dos2unix + find $(TARDIR) -name '*.pl' | xargs dos2unix + find $(TARDIR) -name 'Makefile' | xargs dos2unix + find $(TARDIR) -name '*.in' | xargs dos2unix + find $(TARDIR) -name '*.pm' | xargs dos2unix + find $(TARDIR) -name '*.rc' | xargs dos2unix + cd .. && env GZIP=-9 tar cvzf $(DIST_SRC_TGZ) $(DIST_DIR) + +extensions: + $(MAKE) -C auto + +.PHONY: clean distclean tardist dist-win32 dist-src diff --git a/thirdparty/glew/glew-1.9.0/README.txt b/thirdparty/glew/glew-1.9.0/README.txt new file mode 100644 index 0000000..1b19c53 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/README.txt @@ -0,0 +1,18 @@ +See doc/index.html for more information. + +If you downloaded the tarball from the GLEW website, you just need to: + + Unix: + + make + + Windows: + + use the project file in build/vc6/ + +If you wish to build GLEW from scratch (update the extension data from +the net or add your own extension information), you need a Unix +environment (including wget, perl, and GNU make). The extension data +is regenerated from the top level source directory with: + + make extensions diff --git a/thirdparty/glew/glew-1.9.0/TODO.txt b/thirdparty/glew/glew-1.9.0/TODO.txt new file mode 100644 index 0000000..d2701b6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/TODO.txt @@ -0,0 +1,12 @@ +Major: + - add support for windows mini-client drivers + - add windows installer (msi) + - separate build of static and shared object files (for mingw and + cygwin) + - start designing GLEW 2.0 + +Minor: + - make auto scripts work with text mode cygwin mounts + - add support for all SUN, MTX, and OML extensions + - make auto/Makefile more robust against auto/core/*~ mistakes + - web poll on separating glew, glxew and wglew diff --git a/thirdparty/glew/glew-1.9.0/auto/Makefile b/thirdparty/glew/glew-1.9.0/auto/Makefile new file mode 100644 index 0000000..c6914d4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/Makefile @@ -0,0 +1,368 @@ +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +include ../config/version + +#GLEW_SPLIT_SOURCE = yes + +SHELL = bash +REGISTRY = registry +REGISTRY_URL = http://www.opengl.org/registry/ +#http://oss.sgi.com/projects/ogl-sample/registry/ +BIN = bin +SRC = src +CORE = core +EXT = extensions +BLACKLIST = blacklist + +GL_CORE_SPEC := $(CORE)/GL_VERSION* +GLX_CORE_SPEC := $(CORE)/GLX_VERSION* +ifeq (custom,$(MAKECMDGOALS)) +#GL_CORE_SPEC := $(shell grep GL_VERSION custom.txt | sed 's/\(.*\)/$(CORE)\/\1/g;') +GL_EXT_SPEC := $(shell grep "^[ \t]*GL_" custom.txt | grep -v GL_VERSION | sed 's/\(.*\)/$(EXT)\/\1/g;') +WGL_EXT_SPEC := $(shell grep "^[ \t]*WGL_" custom.txt | sed 's/\(.*\)/$(EXT)\/\1/g;') +#GLX_CORE_SPEC := $(shell grep GLX_VERSION custom.txt | sed 's/\(.*\)/$(CORE)\/\1/g;') +GLX_EXT_SPEC := $(shell grep "^[ \t]*GLX_" custom.txt | grep -v GLX_VERSION | sed 's/\(.*\)/$(EXT)\/\1/g;') +else +GL_EXT_SPEC := $(EXT)/GL_* +WGL_EXT_SPEC := $(EXT)/WGL_* +GLX_EXT_SPEC := $(EXT)/GLX_* +endif + +PARSE_SPEC = parse_spec.pl +SYSTEM = $(strip $(shell uname -s)) + +TOP = .. +I.DEST = $(TOP)/include/GL +S.DEST = $(TOP)/src +D.DEST = $(TOP)/doc +B.DEST = $(TOP)/build + +I.TARGETS = \ + $(I.DEST)/glew.h \ + $(I.DEST)/wglew.h \ + $(I.DEST)/glxew.h + +ifeq (yes,$(GLEW_SPLIT_SOURCE)) +S.TARGETS = \ + $(S.DEST)/glew_def.c \ + $(S.DEST)/glew_init.c \ + $(S.DEST)/glew_str.c \ + $(S.DEST)/glewinfo.c +else +S.TARGETS = \ + $(S.DEST)/glew.c \ + $(S.DEST)/glewinfo.c +endif + +D.TARGETS = \ + $(D.DEST)/index.html \ + $(D.DEST)/install.html \ + $(D.DEST)/basic.html \ + $(D.DEST)/advanced.html \ + $(D.DEST)/build.html \ + $(D.DEST)/credits.html \ + $(D.DEST)/log.html \ + $(D.DEST)/glew.html \ + $(D.DEST)/wglew.html \ + $(D.DEST)/glxew.html + +B.TARGETS = \ + $(B.DEST)/glew.rc \ + $(B.DEST)/glewinfo.rc \ + $(B.DEST)/visualinfo.rc + +all custom: $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS) + +registry: $(REGISTRY)/.dummy +ext: $(EXT)/.dummy + +$(REGISTRY)/.dummy: $(BIN)/update_registry.sh + @echo "--------------------------------------------------------------------" + @echo "Downloading registry" + @echo "--------------------------------------------------------------------" + $(BIN)/update_registry.sh $(REGISTRY) $(REGISTRY_URL) + touch $@ + +$(EXT)/.dummy: $(REGISTRY)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating descriptors" + @echo "--------------------------------------------------------------------" + rm -rf $(EXT) + $(BIN)/update_ext.sh $(EXT) $(REGISTRY) $(BLACKLIST) +ifeq ($(patsubst Darwin%,Darwin,$(SYSTEM)), Darwin) + find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \ + xargs -J % cp % $(EXT) +else + find $(CORE) -maxdepth 1 -type f | grep -v VERSION | grep -v "~" | \ + xargs cp --target-directory=$(EXT) +endif + touch $@ + +$(I.DEST)/glew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.h" + @echo "--------------------------------------------------------------------" + test -d $(I.DEST) || mkdir -p $(I.DEST) + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/mesa_license.h >> $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/glew_head.h >> $@ + $(BIN)/make_header.pl GLAPIENTRY GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_header.pl GLAPIENTRY GL $(GL_EXT_SPEC) >> $@ + echo -e "/* ------------------------------------------------------------------------- */\n\n#if defined(GLEW_MX) && defined(_WIN32)\n#define GLEW_FUN_EXPORT\n#else\n#define GLEW_FUN_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@ + echo -e "#if defined(GLEW_MX)\n#define GLEW_VAR_EXPORT\n#else\n#define GLEW_VAR_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n" >> $@ + echo -e "#if defined(GLEW_MX) && defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@ + $(BIN)/make_struct_fun.pl GLEW_FUN_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + echo -e "\n#if defined(GLEW_MX) && !defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@ + $(BIN)/make_struct_var.pl GLEW_VAR_EXPORT $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + echo -e "\n#ifdef GLEW_MX\n}; /* GLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ + perl -e 's/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;/' -pi $@ + rm -f $@.bak + cat $(SRC)/glew_tail.h >> $@ + +$(I.DEST)/wglew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating wglew.h" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/wglew_head.h >> $@ + $(BIN)/make_header.pl WINAPI WGL $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/wglew_mid.h >> $@ + echo -e "\n#ifdef GLEW_MX\nstruct WGLEWContextStruct\n{\n#endif /* GLEW_MX */" >> $@ + $(BIN)/make_struct_fun.pl WGLEW_FUN_EXPORT $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_struct_var.pl WGLEW_VAR_EXPORT $(WGL_EXT_SPEC) >> $@ + echo -e "\n#ifdef GLEW_MX\n}; /* WGLEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ + cat $(SRC)/wglew_tail.h >> $@ + +$(I.DEST)/glxew.h: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glxew.h" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/mesa_license.h >> $@ + cat $(SRC)/khronos_license.h >> $@ + cat $(SRC)/glxew_head.h >> $@ + $(BIN)/make_header.pl '' GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_header.pl '' GLX $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glxew_mid.h >> $@ + $(BIN)/make_struct_fun.pl GLXEW_FUN_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + echo -e "\n#if defined(GLEW_MX)\nstruct GLXEWContextStruct\n{\n#endif /* GLEW_MX */\n" >> $@ + $(BIN)/make_struct_var.pl GLXEW_VAR_EXPORT $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + echo -e "\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n" >> $@ + perl -e 's/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;/' -pi $@ + cat $(SRC)/glxew_tail.h >> $@ + +$(S.DEST)/glew.c: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.c" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/glew_head.c >> $@ + echo -e "\n#if !defined(_WIN32) || !defined(GLEW_MX)" >> $@ + $(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\n#endif /* !WIN32 || !GLEW_MX */" >> $@ + echo -e "\n#if !defined(GLEW_MX)" >> $@; + echo -e "\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\n#endif /* !GLEW_MX */\n" >> $@; + $(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_gl.c >> $@ + $(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@ + $(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}\n" >> $@ + echo -e "\n#if defined(_WIN32)" >> $@ + echo -e "\n#if !defined(GLEW_MX)" >> $@ + $(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@ + echo -e "\n#endif /* !GLEW_MX */\n" >> $@; + $(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_wgl.c >> $@ + $(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}" >> $@; + echo -e "\n#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ + echo -e "\n#if !defined(GLEW_MX)" >> $@; + echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@ + echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@ + echo -e "\n#endif /* !GLEW_MX */\n" >> $@; + $(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_glx.c >> $@ + $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ + $(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}" >> $@ + echo -e "\n#endif /* !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */\n" >> $@; + cat $(SRC)/glew_init_tail.c >> $@ + cat $(SRC)/glew_str_head.c >> $@ + $(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_wgl.c >> $@ + $(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_glx.c >> $@ + $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_tail.c >> $@ + perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ + perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ + perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ + perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@ + rm -f $@.bak + +$(S.DEST)/glew_def.c: $(EXT)/.dummy + cp -f $(SRC)/glew_license.h $@ + echo -e "#include \"glew_utils.h\"\n\n#if !defined(_WIN32) || !defined(GLEW_MX)" >> $@ + $(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\n#endif /* !WIN32 || !GLEW_MX */" >> $@ + echo -e "\n#if !defined(GLEW_MX)\n\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@ + echo -e "\n#if defined(_WIN32)" >> $@ + $(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@ + $(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@ + echo -e "\n#endif /* _WIN32 */" >> $@ + echo -e "\n#endif /* !GLEW_MX */" >> $@; + echo -e "\n#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ + echo -e "\n#if !defined(GLEW_MX)" >> $@; + echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@ + echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@ + echo -e "\n#endif /* !GLEW_MX */" >> $@; + echo -e "\n#endif /* !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */" >> $@; + rm -f $@.bak + +$(S.DEST)/glew_init.c: $(EXT)/.dummy + cp -f $(SRC)/glew_license.h $@ + echo -e "#include \"glew_utils.h\"\n" >> $@ + $(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_gl.c >> $@ + $(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@ + $(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}\n\n#if defined(_WIN32)\n" >> $@; + $(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_wgl.c >> $@ + $(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}\n\n" >> $@; + echo -e "\n#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)\n" >> $@ + $(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_init_glx.c >> $@ + $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ + $(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@ + echo -e "\n return GLEW_OK;\n}\n\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@; + cat $(SRC)/glew_init_tail.c >> $@ + perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ + perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@ + perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ + perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ + perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@ + rm -f $@.bak + +$(S.DEST)/glew_str.c: $(EXT)/.dummy + cp -f $(SRC)/glew_license.h $@ + echo -e "\n#include \"glew_utils.h\"\n" >> $@ + cat $(SRC)/glew_str_head.c >> $@ + $(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_wgl.c >> $@ + $(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_glx.c >> $@ + $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glew_str_tail.c >> $@ +# perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ +# perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ + rm -f $@.bak + +$(S.DEST)/glewinfo.c: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glewinfo.c" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/glew_license.h $@ + cat $(SRC)/glewinfo_head.c >> $@ + $(BIN)/make_info.pl $(GL_CORE_SPEC) >> $@ + $(BIN)/make_info.pl $(GL_EXT_SPEC) >> $@ + echo -e "#ifdef _WIN32\n" >> $@ + $(BIN)/make_info.pl $(WGL_EXT_SPEC) >> $@ + echo -e "#else /* _UNIX */\n" >> $@ + $(BIN)/make_info.pl $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_info.pl $(GLX_EXT_SPEC) >> $@ + echo -e "#endif /* _WIN32 */\n" >> $@ + + cat $(SRC)/glewinfo_gl.c >> $@ + $(BIN)/make_info_list.pl $(GL_CORE_SPEC) >> $@ + $(BIN)/make_info_list.pl $(GL_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_wgl.c >> $@ + $(BIN)/make_info_list.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_glx.c >> $@ + $(BIN)/make_info_list.pl $(GLX_CORE_SPEC) >> $@ + $(BIN)/make_info_list.pl $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/glewinfo_tail.c >> $@ + perl -e 's/"glColorSubTable"/"glBlendEquation", glBlendEquation == NULL);\n glewInfoFunc("glColorSubTable"/g' -pi $@ + rm -f $@.bak + +# Update documentation + +$(D.DEST)/%.html: doc/%.html + @echo "--------------------------------------------------------------------" + @echo "Creating $(@F)" + @echo "--------------------------------------------------------------------" + cat $(SRC)/header.html $< $(SRC)/footer.html | \ + perl -pe 's#(.*)#\1#' > $@ + +$(D.DEST)/glew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "

    Supported OpenGL Extensions

    \n" >> $@ + $(BIN)/make_html.pl $(GL_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#(.*)#\1#' $@ + +$(D.DEST)/wglew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating wglew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "

    Supported WGL Extensions

    \n" >> $@ + $(BIN)/make_html.pl $(WGL_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#(.*)#\1#' $@ + +$(D.DEST)/glxew.html: $(EXT)/.dummy + @echo "--------------------------------------------------------------------" + @echo "Creating glxew.html" + @echo "--------------------------------------------------------------------" + cp -f $(SRC)/header.html $@ + echo -e "

    Supported GLX Extensions

    \n" >> $@ + $(BIN)/make_html.pl $(GLX_EXT_SPEC) >> $@ + cat $(SRC)/footer.html >> $@ + perl -i -pe 's#(.*)#\1#' $@ + +$(B.DEST)/%.rc: src/%.rc $(EXT)/.dummy + perl -e "s/GLEW_MAJOR/$(GLEW_MAJOR)/g;s/GLEW_MINOR/$(GLEW_MINOR)/g;s/GLEW_MICRO/$(GLEW_MICRO)/g;" -p $< > $@ + +clean: + rm -rf $(I.TARGETS) $(S.TARGETS) $(D.TARGETS) $(B.TARGETS) + +clobber: clean + rm -rf $(EXT) + +destroy: clobber + rm -rf $(REGISTRY) diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make.pl new file mode 100644 index 0000000..f382263 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make.pl @@ -0,0 +1,187 @@ +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +my %regex = ( + extname => qr/^[A-Z][A-Za-z0-9_]+$/, + exturl => qr/^http.+$/, + function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i, + token => qr/^([A-Z][A-Z0-9_x]*)\s+((?:0x)?[0-9A-Fa-f]+|[A-Z][A-Z0-9_]*)$/, + type => qr/^typedef\s+(.+)$/, + exact => qr/.*;$/, +); + +# prefix function name with glew +sub prefixname($) +{ + my $name = $_[0]; + $name =~ s/^(.*?)gl/__$1glew/; + return $name; +} + +# prefix function name with glew +sub prefix_varname($) +{ + my $name = $_[0]; + $name =~ s/^(.*?)GL(X*?)EW/__$1GL$2EW/; + return $name; +} + +#--------------------------------------------------------------------------------------- + +sub make_exact($) +{ + my $exact = $_[0]; + $exact =~ s/(; |{)/$1\n/g; + return $exact; +} + +sub make_separator($) +{ + my $extname = $_[0]; + my $l = length $extname; + my $s = (71 - $l)/2; + print "/* "; + my $j = 3; + for (my $i = 0; $i < $s; $i++) + { + print "-"; + $j++; + } + print " $_[0] "; + $j += $l + 2; + while ($j < 76) + { + print "-"; + $j++; + } + print " */\n\n"; +} + +#--------------------------------------------------------------------------------------- + +sub parse_ext($) +{ + my $filename = shift; + my %functions = (); + my %tokens = (); + my @types = (); + my @exacts = (); + my $extname = ""; # Full extension name GL_FOO_extension + my $exturl = ""; # Info URL + my $extstring = ""; # Relevant extension string + + open EXT, "<$filename" or return; + + # As of GLEW 1.5.3 the first three lines _must_ be + # the extension name, the URL and the GL extension + # string (which might be different to the name) + # + # For example GL_NV_geometry_program4 is available + # iff GL_NV_gpu_program4 appears in the extension + # string. + # + # For core OpenGL versions, the third line should + # be blank. + # + # If the URL is unknown, the second line should be + # blank. + + $extname = readline(*EXT); + $exturl = readline(*EXT); + $extstring = readline(*EXT); + + chomp($extname); + chomp($exturl); + chomp($extstring); + + while() + { + chomp; + if (s/^\s+//) + { + if (/$regex{exact}/) + { + push @exacts, $_; + } + elsif (/$regex{type}/) + { + push @types, $_; + } + elsif (/$regex{token}/) + { + my ($name, $value) = ($1, $2); + $tokens{$name} = $value; + } + elsif (/$regex{function}/) + { + my ($return, $name, $parms) = ($1, $2, $3); + $functions{$name} = { + rtype => $return, + parms => $parms, + }; + } else { + print STDERR "'$_' matched no regex.\n"; + } + } + } + + close EXT; + + return ($extname, $exturl, $extstring, \@types, \%tokens, \%functions, \@exacts); +} + +sub output_tokens($$) +{ + my ($tbl, $fnc) = @_; + if (keys %{$tbl}) + { + local $, = "\n"; + print "\n"; + print map { &{$fnc}($_, $tbl->{$_}) } sort { hex ${$tbl}{$a} <=> hex ${$tbl}{$b} } keys %{$tbl}; + print "\n"; + } else { + print STDERR "no keys in table!\n"; + } +} + +sub output_types($$) +{ + my ($tbl, $fnc) = @_; + if (scalar @{$tbl}) + { + local $, = "\n"; + print "\n"; + print map { &{$fnc}($_) } sort @{$tbl}; + print "\n"; + } +} + +sub output_decls($$) +{ + my ($tbl, $fnc) = @_; + if (keys %{$tbl}) + { + local $, = "\n"; + print "\n"; + print map { &{$fnc}($_, $tbl->{$_}) } sort keys %{$tbl}; + print "\n"; + } +} + +sub output_exacts($$) +{ + my ($tbl, $fnc) = @_; + if (scalar @{$tbl}) + { + local $, = "\n"; + print "\n"; + print map { &{$fnc}($_) } sort @{$tbl}; + print "\n"; + } +} + diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_def_fun.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_def_fun.pl new file mode 100644 index 0000000..40e67d5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_def_fun.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +# function pointer declaration +sub make_pfn_decl($%) +{ + return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;"; +} + +my @extlist = (); +my %extensions = (); + +our $type = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + output_decls($functions, \&make_pfn_decl); + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_def_var.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_def_var.pl new file mode 100644 index 0000000..e484194 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_def_var.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +my @extlist = (); +my %extensions = (); + +our $type = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_header.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_header.pl new file mode 100644 index 0000000..934ef77 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_header.pl @@ -0,0 +1,71 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +# token +sub make_define($$) +{ + return "#define $_[0] $_[1]" +} + +# type declaration +sub make_type($$) +{ + return "@_;" +} + +# function pointer type declaration +sub make_pfn_type($%) +{ + our $api; + return join(' ', "typedef", $_[1]->{rtype}, + "($api * PFN" . (uc $_[0]) . "PROC)", + "(" . $_[1]->{parms} . ")") . ";"; +} + +# function name alias +sub make_pfn_alias($%) +{ + our $type; + return join(" ", "#define", $_[0], $type . "EW_GET_FUN(" . prefixname($_[0]) . ")") +} + +my @extlist = (); +my %extensions = (); + +our $api = shift; +our $type = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + + make_separator($extname); + print "#ifndef $extname\n#define $extname 1\n"; + output_tokens($tokens, \&make_define); + output_types($types, \&make_type); + output_exacts($exacts, \&make_exact); + output_decls($functions, \&make_pfn_type); + output_decls($functions, \&make_pfn_alias); + + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + + print "\n#define $extvar " . $type . "EW_GET_VAR(" . prefix_varname($extvar) . ")\n"; + print "\n#endif /* $extname */\n\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_html.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_html.pl new file mode 100644 index 0000000..ee58196 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_html.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +#--------------------------------------------------------------------------------------- + +my @extlist = (); +my %extensions = (); +my $group = ""; +my $cur_group = ""; + +if (@ARGV) +{ + @extlist = @ARGV; + my $n = 1; + print "\n"; + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + $cur_group = $extname; + $cur_group =~ s/^(?:W?)GL(?:X?)_([A-Z0-9]+?)_.*$/$1/; + $extname =~ s/^(?:W?)GL(?:X?)_(.*)$/$1/; + if ($cur_group ne $group) + { + if ($group ne "") + { + print "\n"; + } + $group = $cur_group; + } + + { + if ($exturl) + { + print "\n"; + } + else + { + print "\n"; + } + $n++; + } + } + print "

    $n $extname
    $n $extname
    \n" +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_info.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_info.pl new file mode 100644 index 0000000..5d0c7f6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_info.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +#--------------------------------------------------------------------------------------- + +# function pointer definition +sub make_pfn_info($%) +{ + my $name = $_[0]; + return " glewInfoFunc(\"$_[0]\", $name == NULL);"; +} + +#--------------------------------------------------------------------------------------- + +my @extlist = (); +my %extensions = (); + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + my $extpre = $extname; + $extpre =~ s/(GLX|GLW|GL).*/$1/; + $extpre = lc $extpre; + + #make_separator($extname); + print "#ifdef $extname\n\n"; + print "static void _glewInfo_$extname (void)\n{\n"; + if ($extvar =~ /VERSION/) + { + print " glewPrintExt(\"$extname\", $extvar, $extvar, $extvar);\n"; + } + else + { + print " glewPrintExt(\"$extname\", $extvar, $extpre" . + "ewIsSupported(\"$extname\"), $extpre" . + "ewGetExtension(\"$extstring\"));\n"; + } + output_decls($functions, \&make_pfn_info); + print "}\n\n"; + print "#endif /* $extname */\n\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_info_list.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_info_list.pl new file mode 100644 index 0000000..a55106d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_info_list.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +#--------------------------------------------------------------------------------------- + +# function pointer definition +sub make_pfn_def($%) +{ + return "PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . " = NULL;"; +} + +# function pointer definition +sub make_init_call($%) +{ + my $name = prefixname($_[0]); + return " r = r || (" . $name . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $name . "\")) == NULL;"; +} + +#--------------------------------------------------------------------------------------- + +my @extlist = (); +my %extensions = (); + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + + print "#ifdef $extname\n"; + print " _glewInfo_$extname();\n"; + print "#endif /* $extname */\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_init.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_init.pl new file mode 100644 index 0000000..70abc98 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_init.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +#------------------------------------------------------------------------------- + +# function pointer definition +sub make_pfn_def_init($%) +{ + #my $name = prefixname($_[0]); + return " r = ((" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress((const GLubyte*)\"" . $_[0] . "\")) == NULL) || r;"; +} + +#------------------------------------------------------------------------------- + +my @extlist = (); +my %extensions = (); + +our $type = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = + parse_ext($ext); + + #make_separator($extname); + print "#ifdef $extname\n\n"; + my $extvar = $extname; + my $extvardef = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + if (keys %$functions) + { + print "static GLboolean _glewInit_$extname (" . $type . + "EW_CONTEXT_ARG_DEF_INIT)\n{\n GLboolean r = GL_FALSE;\n"; + output_decls($functions, \&make_pfn_def_init); + print "\n return r;\n}\n\n"; + } + #print "\nGLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n\n"; + print "#endif /* $extname */\n\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_list.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_list.pl new file mode 100644 index 0000000..a1eb665 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_list.pl @@ -0,0 +1,66 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +#--------------------------------------------------------------------------------------- + +# function pointer definition +sub make_init_call($%) +{ + my $name = prefixname($_[0]); + return " r = r || (" . $_[0] . " = (PFN" . (uc $_[0]) . "PROC)glewGetProcAddress(\"" . $name . "\")) == NULL;"; +} + +#--------------------------------------------------------------------------------------- + +my @extlist = (); +my %extensions = (); + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + + my $extpre = $extname; + $extpre =~ s/^(W?)GL(X?).*$/\l$1gl\l$2ew/; + + #my $pextvar = prefix_varname($extvar); + + print "#ifdef $extname\n"; + + if (length($extstring)) + { + print " CONST_CAST(" . $extvar . ") = _glewSearchExtension(\"$extstring\", extStart, extEnd);\n"; + } + + if (keys %$functions) + { + if ($extname =~ /WGL_.*/) + { + print " if (glewExperimental || " . $extvar . "|| crippled) CONST_CAST(" . $extvar . ")= !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n"; + } + else + { + print " if (glewExperimental || " . $extvar . ") CONST_CAST(" . $extvar . ") = !_glewInit_$extname(GLEW_CONTEXT_ARG_VAR_INIT);\n"; + } + } + print "#endif /* $extname */\n"; + } + +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_str.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_str.pl new file mode 100644 index 0000000..ac4a366 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_str.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +my @extlist = (); +my %extensions = (); + +if (@ARGV) +{ + @extlist = @ARGV; + + my $curexttype = ""; + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $exttype = $extname; + $exttype =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$3/; + my $extrem = $extname; + $extrem =~ s/(W*?)GL(X*?)_(.*?_)(.*)/$4/; + my $extvar = $extname; + $extvar =~ s/(W*)GL(X*)_/$1GL$2EW_/; + if(!($exttype =~ $curexttype)) + { + if(length($curexttype) > 0) + { + print " }\n"; + } + print " if (_glewStrSame2(&pos, &len, (const GLubyte*)\"$exttype\", " . length($exttype) . "))\n"; + print " {\n"; + $curexttype = $exttype; + } + print "#ifdef $extname\n"; + print " if (_glewStrSame3(&pos, &len, (const GLubyte*)\"$extrem\", ". length($extrem) . "))\n"; + #print " return $extvar;\n"; + print " {\n"; + print " ret = $extvar;\n"; + print " continue;\n"; + print " }\n"; + print "#endif\n"; + } + + print " }\n"; +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_fun.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_fun.pl new file mode 100644 index 0000000..c885960 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_fun.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +# function pointer declaration +sub make_pfn_decl($%) +{ + our $export; + return $export . " PFN" . (uc $_[0]) . "PROC " . prefixname($_[0]) . ";"; +} + +my @extlist = (); +my %extensions = (); + +our $export = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + output_decls($functions, \&make_pfn_decl); + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_var.pl b/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_var.pl new file mode 100644 index 0000000..c7ba2f4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/make_struct_var.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +do 'bin/make.pl'; + +my @extlist = (); +my %extensions = (); + +our $export = shift; + +if (@ARGV) +{ + @extlist = @ARGV; + + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + print $export . " GLboolean " . prefix_varname($extvar) . ";\n"; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/parse_spec.pl b/thirdparty/glew/glew-1.9.0/auto/bin/parse_spec.pl new file mode 100644 index 0000000..ad9861d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/parse_spec.pl @@ -0,0 +1,352 @@ +#!/usr/bin/perl +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +use strict; +use warnings; + +sub compile_regex +{ + my $regex = join('', @_); + return qr/$regex/ +} + +my @sections = ( + "Name", + "Name Strings?", + "New Procedures and Functions", + "New Tokens", + "Additions to Chapter.*", +); + +my %typemap = ( + bitfield => "GLbitfield", + boolean => "GLboolean", + # fsck up in EXT_vertex_array + Boolean => "GLboolean", + byte => "GLbyte", + clampd => "GLclampd", + clampf => "GLclampf", + double => "GLdouble", + enum => "GLenum", + # Intel fsck up + Glenum => "GLenum", + float => "GLfloat", + half => "GLhalf", + int => "GLint", + short => "GLshort", + sizei => "GLsizei", + ubyte => "GLubyte", + uint => "GLuint", + ushort => "GLushort", + DMbuffer => "void *", + # Nvidia video output fsck up + int64EXT => "GLint64EXT", + uint64EXT=> "GLuint64EXT", + + # ARB VBO introduces these. + + sizeiptr => "GLsizeiptr", + intptr => "GLintptr", + sizeiptrARB => "GLsizeiptrARB", + intptrARB => "GLintptrARB", + + # ARB shader objects introduces these, charARB is at least 8 bits, + # handleARB is at least 32 bits + charARB => "GLcharARB", + handleARB => "GLhandleARB", + + char => "GLchar", + + # OpenGL 3.2 and GL_ARB_sync + + int64 => "GLint64", + uint64 => "GLuint64", + sync => "GLsync", + + # AMD_debug_output + + DEBUGPROCAMD => "GLDEBUGPROCAMD", + + # ARB_debug_output + + DEBUGPROCARB => "GLDEBUGPROCARB", + + # KHR_debug + + DEBUGPROC => "GLDEBUGPROC", + + vdpauSurfaceNV => "GLvdpauSurfaceNV", + + # GLX 1.3 defines new types which might not be available at compile time + + #GLXFBConfig => "void*", + #GLXFBConfigID => "XID", + #GLXContextID => "XID", + #GLXWindow => "XID", + #GLXPbuffer => "XID", + + # Weird stuff to some SGIX extension + + #GLXFBConfigSGIX => "void*", + #GLXFBConfigIDSGIX => "XID", + +); + +my %voidtypemap = ( + void => "GLvoid", +); + +my %taboo_tokens = ( + GL_ZERO => 1, +); + +# list of function definitions to be ignored, unless they are being defined in +# the given spec. This is an ugly hack arround the fact that people writing +# spec files seem to shut down all brain activity while they are at this task. +# +# This will be moved to its own file eventually. +# +# (mem, 2003-03-19) + +my %fnc_ignore_list = ( + "BindProgramARB" => "ARB_vertex_program", + "ColorSubTableEXT" => "EXT_color_subtable", + "DeleteProgramsARB" => "ARB_vertex_program", + "GenProgramsARB" => "ARB_vertex_program", + "GetProgramEnvParameterdvARB" => "ARB_vertex_program", + "GetProgramEnvParameterfvARB" => "ARB_vertex_program", + "GetProgramLocalParameterdvARB" => "ARB_vertex_program", + "GetProgramLocalParameterfvARB" => "ARB_vertex_program", + "GetProgramStringARB" => "ARB_vertex_program", + "GetProgramivARB" => "ARB_vertex_program", + "IsProgramARB" => "ARB_vertex_program", + "ProgramEnvParameter4dARB" => "ARB_vertex_program", + "ProgramEnvParameter4dvARB" => "ARB_vertex_program", + "ProgramEnvParameter4fARB" => "ARB_vertex_program", + "ProgramEnvParameter4fvARB" => "ARB_vertex_program", + "ProgramLocalParameter4dARB" => "ARB_vertex_program", + "ProgramLocalParameter4dvARB" => "ARB_vertex_program", + "ProgramLocalParameter4fARB" => "ARB_vertex_program", + "ProgramLocalParameter4fvARB" => "ARB_vertex_program", + "ProgramStringARB" => "ARB_vertex_program", + "glXCreateContextAttribsARB" => "ARB_create_context_profile", + "wglCreateContextAttribsARB" => "WGL_ARB_create_context_profile", +); + +my %regex = ( + eofnc => qr/(?:\);?$|^$)/, # )$ | );$ | ^$ + extname => qr/^[A-Z][A-Za-z0-9_]+$/, + none => qr/^\(none\)$/, + function => qr/^(.+) ([a-z][a-z0-9_]*) \((.+)\)$/i, + prefix => qr/^(?:[aw]?gl|glX)/, # gl | agl | wgl | glX + tprefix => qr/^(?:[AW]?GL|GLX)_/, # GL_ | AGL_ | WGL_ | GLX_ + section => compile_regex('^(', join('|', @sections), ')$'), # sections in spec + token => qr/^([A-Z0-9][A-Z0-9_x]*):?\s+((?:0x)?[0-9A-F]+)(.*)$/, # define tokens + types => compile_regex('\b(', join('|', keys %typemap), ')\b'), # var types + voidtype => compile_regex('\b(', keys %voidtypemap, ')\b '), # void type +); + +# reshapes the the function declaration from multiline to single line form +sub normalize_prototype +{ + local $_ = join(" ", @_); + s/\s+/ /g; # multiple whitespace -> single space + s/\<.*\>//g; # remove from direct state access extension + s/\<.*$//g; # remove incomplete from direct state access extension + s/\s*\(\s*/ \(/; # exactly one space before ( and none after + s/\s*\)\s*/\)/; # no space before or after ) + s/\s*\*([a-zA-Z])/\* $1/; # "* identifier" + s/\*wgl/\* wgl/; # "* wgl" + s/\*glX/\* glX/; # "* glX" + s/\.\.\./void/; # ... -> void + s/;$//; # remove ; at the end of the line + return $_; +} + +# Ugly hack to work arround the fact that functions are declared in more +# than one spec file. +sub ignore_function($$) +{ + return exists($fnc_ignore_list{$_[0]}) && $fnc_ignore_list{$_[0]} ne $_[1] +} + +sub parse_spec($) +{ + my $filename = shift; + my $extname = ""; + my $vendortag = ""; + my @extnames = (); + my %functions = (); + my %tokens = (); + + my $section = ""; + my @fnc = (); + + my %proc = ( + "Name" => sub { + if (/^([a-z0-9]+)_([a-z0-9_]+)/i) + { + $extname = "$1_$2"; + $vendortag = $1; + } + }, + + "Name Strings" => sub { + # Add extension name to extension list + + # Initially use $extname if (none) specified + if (/$regex{none}/) + { + $_ = $extname; + } + + if (/$regex{extname}/) + { + # prefix with "GL_" if prefix not present + s/^/GL_/ unless /$regex{tprefix}/o; + # Add extension name to extension list + push @extnames, $_; + } + }, + + "New Procedures and Functions" => sub { + # if line matches end of function + if (/$regex{eofnc}/) + { + # add line to function declaration + push @fnc, $_; + + # if normalized version of function looks like a function + if (normalize_prototype(@fnc) =~ /$regex{function}/) + { + # get return type, name, and arguments from regex + my ($return, $name, $parms) = ($1, $2, $3); + if (!ignore_function($name, $extname)) + { + # prefix with "gl" if prefix not present + $name =~ s/^/gl/ unless $name =~ /$regex{prefix}/; + # is this a pure GL function? + if ($name =~ /^gl/ && $name !~ /^glX/) + { + # apply typemaps + $return =~ s/$regex{types}/$typemap{$1}/og; + $return =~ s/void\*/GLvoid */og; + $parms =~ s/$regex{types}/$typemap{$1}/og; + $parms =~ s/$regex{voidtype}/$voidtypemap{$1}/og; + } + # add to functions hash + $functions{$name} = { + rtype => $return, + parms => $parms, + }; + } + } + # reset function declaration + @fnc = (); + } elsif ($_ ne "" and $_ ne "None") { + # if not eof, add line to function declaration + push @fnc, $_ + } + }, + + "New Tokens" => sub { + if (/$regex{token}/) + { + my ($name, $value) = ($1, $2); + # prefix with "GL_" if prefix not present + $name =~ s/^/GL_/ unless $name =~ /$regex{tprefix}/; + # Add (name, value) pair to tokens hash, unless it's taboo + $tokens{$name} = $value unless exists $taboo_tokens{$name}; + } + }, + ); + + # Some people can't read, the template clearly says "Name String_s_" + $proc{"Name String"} = $proc{"Name Strings"}; + + # Open spec file + open SPEC, "<$filename" or return; + + # For each line of SPEC + while() + { + # Delete trailing newline character + chomp; + # Remove trailing white spaces + s/\s+$//; + # If starts with a capital letter, it must be a new section + if (/^[A-Z]/) + { + # Match section name with one of the predefined names + $section = /$regex{section}/o ? $1 : "default"; + } else { + # Line is internal to a section + # Remove leading whitespace + s/^\s+//; + # Call appropriate section processing function if it exists + &{$proc{$section}} if exists $proc{$section}; + } + } + + close SPEC; + + return ($extname, \@extnames, \%tokens, \%functions); +} + +#---------------------------------------------------------------------------------------- + +my @speclist = (); +my %extensions = (); + +my $ext_dir = shift; +my $reg_http = "http://www.opengl.org/registry/specs/"; +#my $reg_http = "http://oss.sgi.com/projects/ogl-sample/"; + +# Take command line arguments or read list from file +if (@ARGV) +{ + @speclist = @ARGV; +} else { + local $/; #??? + @speclist = split "\n", (<>); +} + +foreach my $spec (sort @speclist) +{ + my ($extname, $extnames, $tokens, $functions) = parse_spec($spec); + + foreach my $ext (@{$extnames}) + { + my $info = "$ext_dir/" . $ext; + open EXT, ">$info"; + print EXT $ext . "\n"; # Extension name + my $specname = $spec; + $specname =~ s/registry\///; + print EXT $reg_http . $specname . "\n"; # Extension info URL + print EXT $ext . "\n"; # Extension string + + my $prefix = $ext; + $prefix =~ s/^(.+?)(_.+)$/$1/; + foreach my $token (sort { hex ${$tokens}{$a} <=> hex ${$tokens}{$b} } keys %{$tokens}) + { + if ($token =~ /^$prefix\_.*/i) + { + print EXT "\t" . $token . " " . ${\%{$tokens}}{$token} . "\n"; + } + } + foreach my $function (sort keys %{$functions}) + { + if ($function =~ /^$prefix.*/i) + { + print EXT "\t" . ${$functions}{$function}{rtype} . " " . $function . " (" . ${$functions}{$function}{parms} . ")" . "\n"; + } + } + close EXT; + } +} diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/update_ext.sh b/thirdparty/glew/glew-1.9.0/auto/bin/update_ext.sh new file mode 100644 index 0000000..1d521b4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/update_ext.sh @@ -0,0 +1,434 @@ +#!/bin/bash +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. +## +## Parameters: +## +## $1: Extensions directory +## $2: Registry directory +## $3: The black list + +set -e + +if [ ! -d $1 ] ; then + mkdir $1 + +# Parse each of the extensions in the registry + find $2 -name doc -type d -prune -o -name \*.txt -print | \ + grep -v -f $3 | sort | bin/parse_spec.pl $1 + +# fix GL_NV_texture_compression_vtc + grep -v EXT $1/GL_NV_texture_compression_vtc > tmp + mv tmp $1/GL_NV_texture_compression_vtc + +# remove duplicates from GL_ARB_vertex_program and GL_ARB_fragment_program + grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_fragment_program > tmp + mv tmp $1/GL_ARB_fragment_program + +# remove duplicates from GLX_EXT_visual_rating and GLX_EXT_visual_info + grep -v -F -f $1/GLX_EXT_visual_info $1/GLX_EXT_visual_rating > tmp + mv tmp $1/GLX_EXT_visual_rating + +# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetBooleanIndexedvEXT but with different parameter names + grep -v glGetBooleanIndexedvEXT $1/GL_EXT_transform_feedback > tmp + mv tmp $1/GL_EXT_transform_feedback + +# GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetIntegerIndexedvEXT but with different parameter names + grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp + mv tmp $1/GL_EXT_transform_feedback + +# remove duplicates from GL_NV_video_capture and GLX_NV_video_capture + grep -v glX $1/GL_NV_video_capture > tmp + mv tmp $1/GL_NV_video_capture + +# add missing functions to GL_NV_video_capture + cat >> $1/GL_NV_video_capture <> $1/WGL_NV_video_capture <> $1/GLX_NV_video_capture < tmp + mv tmp $1/GL_NV_present_video + +# fix WGL_NV_present_video + cat >> $1/WGL_NV_present_video <> $1/WGL_NV_video_output < tmp + mv tmp $1/GL_NV_occlusion_query + perl -e's/OCCLUSION_TEST_HP.*/OCCLUSION_TEST_HP 0x8165/' -pi \ + $1/GL_HP_occlusion_test + perl -e's/OCCLUSION_TEST_RESULT_HP.*/OCCLUSION_TEST_RESULT_HP 0x8166/' -pi \ + $1/GL_HP_occlusion_test + +# fix GLvoid in GL_ARB_vertex_buffer_objects + perl -e 's/ void\*/ GLvoid\*/g' -pi \ + $1/GL_ARB_vertex_buffer_object + +# add deprecated constants to GL_ATI_fragment_shader + cat >> $1/GL_ATI_fragment_shader <> $1/GL_NV_texture_shader <> $1/WGL_ATI_pixel_format_float <> $1/WGL_ARB_make_current_read <> $1/WGL_EXT_make_current_read <> $1/GL_ARB_vertex_buffer_object <> $1/GLX_EXT_import_context <> $1/GLX_OML_swap_method <> $1/GLX_SGIX_fbconfig <> $1/GLX_SGIX_pbuffer <> $1/GL_NV_half_float <> $1/WGL_ARB_pbuffer <> $1/WGL_EXT_pbuffer < tmp + mv tmp $1/GL_ARB_fragment_shader + grep -v -F -f $1/GL_ARB_shader_objects $1/GL_ARB_vertex_shader > tmp + mv tmp $1/GL_ARB_vertex_shader + +# remove duplicates in GL_ARB_vertex_program and GL_ARB_vertex_shader + grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_vertex_shader > tmp + mv tmp $1/GL_ARB_vertex_shader + +# remove triplicates in GL_ARB_fragment_program, GL_ARB_fragment_shader, +# and GL_ARB_vertex_shader + grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_fragment_shader > tmp + mv tmp $1/GL_ARB_fragment_shader + grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_vertex_shader > tmp + mv tmp $1/GL_ARB_vertex_shader + +# remove duplicates in GL_EXT_direct_state_access + grep -v "glGetBooleanIndexedvEXT" $1/GL_EXT_direct_state_access > tmp + mv tmp $1/GL_EXT_direct_state_access + grep -v "glGetIntegerIndexedvEXT" $1/GL_EXT_direct_state_access > tmp + mv tmp $1/GL_EXT_direct_state_access + grep -v "glDisableIndexedEXT" $1/GL_EXT_direct_state_access > tmp + mv tmp $1/GL_EXT_direct_state_access + grep -v "glEnableIndexedEXT" $1/GL_EXT_direct_state_access > tmp + mv tmp $1/GL_EXT_direct_state_access + grep -v "glIsEnabledIndexedEXT" $1/GL_EXT_direct_state_access > tmp + mv tmp $1/GL_EXT_direct_state_access + +# remove duplicates in GL_NV_explicit_multisample + grep -v "glGetBooleanIndexedvEXT" $1/GL_NV_explicit_multisample > tmp + mv tmp $1/GL_NV_explicit_multisample + grep -v "glGetIntegerIndexedvEXT" $1/GL_NV_explicit_multisample > tmp + mv tmp $1/GL_NV_explicit_multisample + +# fix bugs in GL_ARB_vertex_shader + grep -v "GL_FLOAT" $1/GL_ARB_vertex_shader > tmp + mv tmp $1/GL_ARB_vertex_shader + perl -e 's/handle /GLhandleARB /g' -pi $1/GL_ARB_vertex_shader + +# fix bugs in GL_ARB_shader_objects + grep -v "GL_FLOAT " $1/GL_ARB_shader_objects > tmp + mv tmp $1/GL_ARB_shader_objects + grep -v "GL_INT " $1/GL_ARB_shader_objects > tmp + mv tmp $1/GL_ARB_shader_objects + +# add typedefs to GL_ARB_shader_objects + cat >> $1/GL_ARB_shader_objects <> $1/GL_ARB_transpose_matrix <> $1/GL_EXT_framebuffer_multisample < tmp + mv tmp $1/GL_NV_gpu_program_fp64 + +# Filter glGetUniformui64vNV from GL_NV_shader_buffer_load + grep -v "glGetUniformui64vNV" $1/GL_NV_shader_buffer_load > tmp + mv tmp $1/GL_NV_shader_buffer_load + +# Filter out profile enumerations from GLX_ARB_create_context + grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp + mv tmp $1/GLX_ARB_create_context + +# Filter only profile related enumerations for GLX_ARB_create_context_profile + head -n3 $1/GLX_ARB_create_context_profile > tmp + grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp + mv tmp $1/GLX_ARB_create_context_profile + +# Filter out profile enumerations from WGL_ARB_create_context + grep -v "_PROFILE_" $1/WGL_ARB_create_context > tmp + mv tmp $1/WGL_ARB_create_context + +# Filter only profile related enumerations for WGL_ARB_create_context_profile + head -n3 $1/WGL_ARB_create_context_profile > tmp + grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp + mv tmp $1/WGL_ARB_create_context_profile + +# add missing function to GLX_NV_copy_image + cat >> $1/GLX_NV_copy_image <> $1/WGL_NV_copy_image < tmp +# mv tmp $1/GL_ARB_separate_shader_objects + +# Filter out EXT functions from GL_ARB_viewport_array + grep -v "EXT" $1/GL_ARB_viewport_array > tmp + mv tmp $1/GL_ARB_viewport_array + +# Additional enumerations for GL_NV_vertex_buffer_unified_memory +# These are mentioned in GL_ARB_draw_indirect.txt + + cat >> $1/GL_NV_vertex_buffer_unified_memory < tmp + mv tmp $1/GL_ARB_debug_output + +# Filter glGetPointerv from GL_EXT_vertex_array +# It's part of OpenGL 1.1, after all + + grep -v "glGetPointerv" $1/GL_EXT_vertex_array > tmp + mv tmp $1/GL_EXT_vertex_array + +# add typedef to GL_AMD_debug_output +# parse_spec.pl can't parse typedefs from New Types section, but ought to + cat >> $1/GL_AMD_debug_output <> $1/GL_ARB_debug_output <> $1/GL_KHR_debug <> $1/GL_ARB_cl_event < tmp + mv tmp $1/GL_ARB_gpu_shader_fp64 + +# add missing functions to GL_EXT_direct_state_access (GL_ARB_gpu_shader_fp64 related) + cat >> $1/GL_EXT_direct_state_access < tmp + mv tmp $1/GL_AMD_performance_monitor + grep -v 'GL_FLOAT ' $1/GL_AMD_performance_monitor > tmp + mv tmp $1/GL_AMD_performance_monitor + +# Filter out GL_STORAGE_CACHED_APPLE and GL_STORAGE_SHARED_APPLE from GL_APPLE_texture_range + grep -v 'GL_STORAGE_CACHED_APPLE ' $1/GL_APPLE_texture_range > tmp + mv tmp $1/GL_APPLE_texture_range + grep -v 'GL_STORAGE_SHARED_APPLE ' $1/GL_APPLE_texture_range > tmp + mv tmp $1/GL_APPLE_texture_range + +# Filter out GL_RED from GL_ARB_texture_rg + grep -v 'GL_RED ' $1/GL_ARB_texture_rg > tmp + mv tmp $1/GL_ARB_texture_rg + +# Filter out _EXT enums from GL_ARB_texture_storage + grep -v '_EXT ' $1/GL_ARB_texture_storage > tmp + mv tmp $1/GL_ARB_texture_storage + +# Filter out TEXTURE_3D enums from GL_EXT_paletted_texture + grep -v 'TEXTURE_3D' $1/GL_EXT_paletted_texture > tmp + mv tmp $1/GL_EXT_paletted_texture + +# Filter out GL_VERSION_1_1 enums from GL_AMD_stencil_operation_extended + grep -v '0x150' $1/GL_AMD_stencil_operation_extended > tmp + mv tmp $1/GL_AMD_stencil_operation_extended + +# Filter out from GL_APPLE_ycbcr_422 + grep -v 'GL_UNSIGNED_SHORT_8_8_APPLE' $1/GL_APPLE_ycbcr_422 > tmp + mv tmp $1/GL_APPLE_ycbcr_422 + grep -v 'GL_UNSIGNED_SHORT_8_8_REV_APPLE' $1/GL_APPLE_ycbcr_422 > tmp + mv tmp $1/GL_APPLE_ycbcr_422 + +# Filter out GL_FRAGMENT_DEPTH_EXT from GL_EXT_light_texture + grep -v 'GL_FRAGMENT_DEPTH_EXT' $1/GL_EXT_light_texture > tmp + mv tmp $1/GL_EXT_light_texture + +# Filter out GL_MULTISAMPLE_BIT_EXT from GL_SGIS_multisample + grep -v 'GL_MULTISAMPLE_BIT_EXT' $1/GL_SGIS_multisample > tmp + mv tmp $1/GL_SGIS_multisample + +# Filter out GL_COMPRESSED_RGB_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1 + grep -v 'GL_COMPRESSED_RGB_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp + mv tmp $1/GL_EXT_texture_compression_dxt1 + +# Filter out GL_COMPRESSED_RGBA_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1 + grep -v 'GL_COMPRESSED_RGBA_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp + mv tmp $1/GL_EXT_texture_compression_dxt1 + +# clean up + rm -f $1/*.bak + +fi diff --git a/thirdparty/glew/glew-1.9.0/auto/bin/update_registry.sh b/thirdparty/glew/glew-1.9.0/auto/bin/update_registry.sh new file mode 100644 index 0000000..a03573f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/bin/update_registry.sh @@ -0,0 +1,33 @@ +#!/bin/sh +## +## Copyright (C) 2002-2008, Marcelo E. Magallon +## Copyright (C) 2002-2008, Milan Ikits +## +## This program is distributed under the terms and conditions of the GNU +## General Public License Version 2 as published by the Free Software +## Foundation or, at your option, any later version. + +set -e + +if [ ! -d $1 ] ; then + mkdir $1 +fi +cd $1 + +# wget used to return 0 (success), but more recent versions +# don't so we don't want to bail out in failure mode +# eventhough everything is fine. + +set +e + +wget \ + --mirror \ + --no-parent \ + --no-host-directories \ + --cut-dirs=2 \ + --accept=txt,html \ + $2 + +echo 'wget exit code: ' $? + +exit 0 diff --git a/thirdparty/glew/glew-1.9.0/auto/blacklist b/thirdparty/glew/glew-1.9.0/auto/blacklist new file mode 100644 index 0000000..6cd0e11 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/blacklist @@ -0,0 +1,14 @@ +EXT/draw_range_elements.txt +EXT/static_vertex_array.txt +EXT/vertex_array_set.alt.txt +EXT/vertex_array_set.txt +EXT/nurbs_tessellator.txt +EXT/object_space_tess.txt +SGI/filter4_parameters.txt +SGIS/texture_color_mask.txt +SGIX/dmbuffer.txt +SGIX/instruments.txt +SGIX/video_source.txt +SGIX/hyperpipe_group.txt +OES/OES_fixed_point.txt +OES/OES_query_matrix.txt diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_AMD_gpu_association b/thirdparty/glew/glew-1.9.0/auto/core/GLX_AMD_gpu_association new file mode 100644 index 0000000..e5561d9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_AMD_gpu_association @@ -0,0 +1,13 @@ +GLX_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt +GLX_AMD_gpu_association + GLX_GPU_VENDOR_AMD 0x1F00 + GLX_GPU_RENDERER_STRING_AMD 0x1F01 + GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + GLX_GPU_RAM_AMD 0x21A3 + GLX_GPU_CLOCK_AMD 0x21A4 + GLX_GPU_NUM_PIPES_AMD 0x21A5 + GLX_GPU_NUM_SIMD_AMD 0x21A6 + GLX_GPU_NUM_RB_AMD 0x21A7 + GLX_GPU_NUM_SPI_AMD 0x21A8 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_ARB_get_proc_address b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ARB_get_proc_address new file mode 100644 index 0000000..5c066d7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ARB_get_proc_address @@ -0,0 +1,4 @@ +GLX_ARB_get_proc_address +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt +GLX_ARB_get_proc_address + extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_pixel_format_float b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_pixel_format_float new file mode 100644 index 0000000..854ca71 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_pixel_format_float @@ -0,0 +1,4 @@ +GLX_ATI_pixel_format_float + +GLX_ATI_pixel_format_float + GLX_RGBA_FLOAT_ATI_BIT 0x00000100 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_render_texture b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_render_texture new file mode 100644 index 0000000..254eb9f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_ATI_render_texture @@ -0,0 +1,41 @@ +GLX_ATI_render_texture + +GLX_ATI_render_texture + GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 + GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 + GLX_TEXTURE_FORMAT_ATI 0x9802 + GLX_TEXTURE_TARGET_ATI 0x9803 + GLX_MIPMAP_TEXTURE_ATI 0x9804 + GLX_TEXTURE_RGB_ATI 0x9805 + GLX_TEXTURE_RGBA_ATI 0x9806 + GLX_NO_TEXTURE_ATI 0x9807 + GLX_TEXTURE_CUBE_MAP_ATI 0x9808 + GLX_TEXTURE_1D_ATI 0x9809 + GLX_TEXTURE_2D_ATI 0x980A + GLX_MIPMAP_LEVEL_ATI 0x980B + GLX_CUBE_MAP_FACE_ATI 0x980C + GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D + GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E + GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 + GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 + GLX_FRONT_LEFT_ATI 0x9813 + GLX_FRONT_RIGHT_ATI 0x9814 + GLX_BACK_LEFT_ATI 0x9815 + GLX_BACK_RIGHT_ATI 0x9816 + GLX_AUX0_ATI 0x9817 + GLX_AUX1_ATI 0x9818 + GLX_AUX2_ATI 0x9819 + GLX_AUX3_ATI 0x981A + GLX_AUX4_ATI 0x981B + GLX_AUX5_ATI 0x981C + GLX_AUX6_ATI 0x981D + GLX_AUX7_ATI 0x981E + GLX_AUX8_ATI 0x981F + GLX_AUX9_ATI 0x9820 + GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 + GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + void glXBindTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXReleaseTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXDrawableAttribATI (Display *dpy, GLXDrawable draw, const int *attrib_list) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es2_profile b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es2_profile new file mode 100644 index 0000000..3093baa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es2_profile @@ -0,0 +1,4 @@ +GLX_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt +GLX_EXT_create_context_es2_profile + GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es_profile b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es_profile new file mode 100644 index 0000000..845f65e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_create_context_es_profile @@ -0,0 +1,4 @@ +GLX_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt +GLX_EXT_create_context_es_profile + GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_fbconfig_packed_float b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_fbconfig_packed_float new file mode 100644 index 0000000..7c7822d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_fbconfig_packed_float @@ -0,0 +1,5 @@ +GLX_EXT_fbconfig_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GLX_EXT_fbconfig_packed_float + GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_framebuffer_sRGB new file mode 100644 index 0000000..f51c484 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_EXT_framebuffer_sRGB @@ -0,0 +1,4 @@ +GLX_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GLX_EXT_framebuffer_sRGB + GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_MESA_swap_control b/thirdparty/glew/glew-1.9.0/auto/core/GLX_MESA_swap_control new file mode 100644 index 0000000..4416519 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_MESA_swap_control @@ -0,0 +1,5 @@ +GLX_MESA_swap_control +http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec +GLX_MESA_swap_control + int glXGetSwapIntervalMESA (void) + int glXSwapIntervalMESA (unsigned int interval) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_float_buffer b/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_float_buffer new file mode 100644 index 0000000..cc9185e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_float_buffer @@ -0,0 +1,4 @@ +GLX_NV_float_buffer +http://cvs1.nvidia.com/inc/GL/glxtokens.h +GLX_NV_float_buffer + GLX_FLOAT_COMPONENTS_NV 0x20B0 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_vertex_array_range new file mode 100644 index 0000000..11afe17 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_NV_vertex_array_range @@ -0,0 +1,5 @@ +GLX_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +GLX_NV_vertex_array_range + void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void glXFreeMemoryNV (void *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIS_shared_multisample b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIS_shared_multisample new file mode 100644 index 0000000..274e90f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIS_shared_multisample @@ -0,0 +1,5 @@ +GLX_SGIS_shared_multisample + +GLX_SGIS_shared_multisample + GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 + GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_hyperpipe b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_hyperpipe new file mode 100644 index 0000000..79ec302 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_hyperpipe @@ -0,0 +1,25 @@ +GLX_SGIX_hyperpipe +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt +GLX_SGIX_hyperpipe + GLX_HYPERPIPE_ID_SGIX 0x8030 + GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 + GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 + GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 + GLX_PIPE_RECT_SGIX 0x00000001 + GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 + GLX_HYPERPIPE_STEREO_SGIX 0x00000003 + GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 + GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 + GLX_BAD_HYPERPIPE_SGIX 92 + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits; + GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes) + int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId) + GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes) + int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId) + int glXBindHyperpipeSGIX (Display *dpy, int hpId) + int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList) + int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList) + int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_barrier b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_barrier new file mode 100644 index 0000000..57dd60d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_barrier @@ -0,0 +1,5 @@ +GLX_SGIX_swap_barrier +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt +GLX_SGIX_swap_barrier + void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier) + Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_group b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_group new file mode 100644 index 0000000..3530604 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGIX_swap_group @@ -0,0 +1,4 @@ +GLX_SGIX_swap_group +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt +GLX_SGIX_swap_group + void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGI_video_sync b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGI_video_sync new file mode 100644 index 0000000..dcdb968 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SGI_video_sync @@ -0,0 +1,5 @@ +GLX_SGI_video_sync +http://www.opengl.org/registry/specs/SGI/video_sync.txt +GLX_SGI_video_sync + int glXGetVideoSyncSGI (unsigned int* count) + int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_SUN_video_resize b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SUN_video_resize new file mode 100644 index 0000000..0a0cefe --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_SUN_video_resize @@ -0,0 +1,7 @@ +GLX_SUN_video_resize +http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt +GLX_SUN_video_resize + GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + GLX_VIDEO_RESIZE_SUN 0x8171 + int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor) + int glXGetVideoResizeSUN (Display* display, GLXDrawable window, float* factor) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_2 b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_2 new file mode 100644 index 0000000..39d7a09 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_2 @@ -0,0 +1,4 @@ +GLX_VERSION_1_2 +http://www.opengl.org/documentation/specs/glx/glx1.2.ps +GLX_VERSION_1_2 + Display* glXGetCurrentDisplay (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_3 b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_3 new file mode 100644 index 0000000..46eedb9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_3 @@ -0,0 +1,82 @@ +GLX_VERSION_1_3 +http://www.opengl.org/documentation/specs/glx/glx1.3.pdf +GLX_VERSION_1_3 + GLX_WINDOW_BIT 0x00000001 + GLX_PIXMAP_BIT 0x00000002 + GLX_PBUFFER_BIT 0x00000004 + GLX_RGBA_BIT 0x00000001 + GLX_COLOR_INDEX_BIT 0x00000002 + GLX_PBUFFER_CLOBBER_MASK 0x08000000 + GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 + GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 + GLX_BACK_LEFT_BUFFER_BIT 0x00000004 + GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 + GLX_AUX_BUFFERS_BIT 0x00000010 + GLX_DEPTH_BUFFER_BIT 0x00000020 + GLX_STENCIL_BUFFER_BIT 0x00000040 + GLX_ACCUM_BUFFER_BIT 0x00000080 + GLX_CONFIG_CAVEAT 0x20 + GLX_X_VISUAL_TYPE 0x22 + GLX_TRANSPARENT_TYPE 0x23 + GLX_TRANSPARENT_INDEX_VALUE 0x24 + GLX_TRANSPARENT_RED_VALUE 0x25 + GLX_TRANSPARENT_GREEN_VALUE 0x26 + GLX_TRANSPARENT_BLUE_VALUE 0x27 + GLX_TRANSPARENT_ALPHA_VALUE 0x28 + GLX_DONT_CARE 0xFFFFFFFF + GLX_NONE 0x8000 + GLX_SLOW_CONFIG 0x8001 + GLX_TRUE_COLOR 0x8002 + GLX_DIRECT_COLOR 0x8003 + GLX_PSEUDO_COLOR 0x8004 + GLX_STATIC_COLOR 0x8005 + GLX_GRAY_SCALE 0x8006 + GLX_STATIC_GRAY 0x8007 + GLX_TRANSPARENT_RGB 0x8008 + GLX_TRANSPARENT_INDEX 0x8009 + GLX_VISUAL_ID 0x800B + GLX_SCREEN 0x800C + GLX_NON_CONFORMANT_CONFIG 0x800D + GLX_DRAWABLE_TYPE 0x8010 + GLX_RENDER_TYPE 0x8011 + GLX_X_RENDERABLE 0x8012 + GLX_FBCONFIG_ID 0x8013 + GLX_RGBA_TYPE 0x8014 + GLX_COLOR_INDEX_TYPE 0x8015 + GLX_MAX_PBUFFER_WIDTH 0x8016 + GLX_MAX_PBUFFER_HEIGHT 0x8017 + GLX_MAX_PBUFFER_PIXELS 0x8018 + GLX_PRESERVED_CONTENTS 0x801B + GLX_LARGEST_PBUFFER 0x801C + GLX_WIDTH 0x801D + GLX_HEIGHT 0x801E + GLX_EVENT_MASK 0x801F + GLX_DAMAGED 0x8020 + GLX_SAVED 0x8021 + GLX_WINDOW 0x8022 + GLX_PBUFFER 0x8023 + GLX_PBUFFER_HEIGHT 0x8040 + GLX_PBUFFER_WIDTH 0x8041 + GLXFBConfig* glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements) + GLXFBConfig* glXGetFBConfigs (Display *dpy, int screen, int *nelements) + XVisualInfo* glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config) + int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value) + GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list) + void glXDestroyWindow (Display *dpy, GLXWindow win) + GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list) + void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap) + GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list) + void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf) + void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value) + GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) + Bool glXMakeContextCurrent (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx) + GLXDrawable glXGetCurrentReadDrawable (void) + int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value) + void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask) + void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask) + typedef XID GLXWindow + typedef XID GLXPbuffer + typedef XID GLXFBConfigID + typedef struct __GLXFBConfigRec *GLXFBConfig + typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent; + typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent; diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_4 b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_4 new file mode 100644 index 0000000..1382621 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GLX_VERSION_1_4 @@ -0,0 +1,6 @@ +GLX_VERSION_1_4 +http://www.opengl.org/documentation/specs/glx/glx1.4.pdf +GLX_VERSION_1_4 + GLX_SAMPLE_BUFFERS 100000 + GLX_SAMPLES 100001 + extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_float_pixels b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_float_pixels new file mode 100644 index 0000000..2bf7458 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_float_pixels @@ -0,0 +1,17 @@ +GL_APPLE_float_pixels +http://www.opengl.org/registry/specs/APPLE/float_pixels.txt +GL_APPLE_float_pixels + GL_HALF_APPLE 0x140B + GL_COLOR_FLOAT_APPLE 0x8A0F + GL_RGBA_FLOAT32_APPLE 0x8814 + GL_RGB_FLOAT32_APPLE 0x8815 + GL_ALPHA_FLOAT32_APPLE 0x8816 + GL_INTENSITY_FLOAT32_APPLE 0x8817 + GL_LUMINANCE_FLOAT32_APPLE 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 + GL_RGBA_FLOAT16_APPLE 0x881A + GL_RGB_FLOAT16_APPLE 0x881B + GL_ALPHA_FLOAT16_APPLE 0x881C + GL_INTENSITY_FLOAT16_APPLE 0x881D + GL_LUMINANCE_FLOAT16_APPLE 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_pixel_buffer b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_pixel_buffer new file mode 100644 index 0000000..7449f29 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_pixel_buffer @@ -0,0 +1,4 @@ +GL_APPLE_pixel_buffer + +GL_APPLE_pixel_buffer + GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_texture_range b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_texture_range new file mode 100644 index 0000000..7ca9b9b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_APPLE_texture_range @@ -0,0 +1,12 @@ +GL_APPLE_texture_range +http://www.opengl.org/registry/specs/APPLE/texture_range.txt +GL_APPLE_texture_range + GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC + GL_STORAGE_PRIVATE_APPLE 0x85BD + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 + GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 + void glTextureRangeAPPLE (GLenum target, GLsizei length, GLvoid *pointer) + void glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid **params) + diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_draw_instanced b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_draw_instanced new file mode 100644 index 0000000..4140bea --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_draw_instanced @@ -0,0 +1,3 @@ +GL_ARB_draw_instanced +http://www.opengl.org/registry/specs/ARB/draw_instanced.txt +GL_ARB_draw_instanced diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_imaging b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_imaging new file mode 100644 index 0000000..0efd0c1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_imaging @@ -0,0 +1,112 @@ +GL_ARB_imaging + +GL_ARB_imaging + GL_CONSTANT_COLOR 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR 0x8002 + GL_CONSTANT_ALPHA 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + GL_BLEND_COLOR 0x8005 + GL_FUNC_ADD 0x8006 + GL_MIN 0x8007 + GL_MAX 0x8008 + GL_BLEND_EQUATION 0x8009 + GL_FUNC_SUBTRACT 0x800A + GL_FUNC_REVERSE_SUBTRACT 0x800B + GL_CONVOLUTION_1D 0x8010 + GL_CONVOLUTION_2D 0x8011 + GL_SEPARABLE_2D 0x8012 + GL_CONVOLUTION_BORDER_MODE 0x8013 + GL_CONVOLUTION_FILTER_SCALE 0x8014 + GL_CONVOLUTION_FILTER_BIAS 0x8015 + GL_REDUCE 0x8016 + GL_CONVOLUTION_FORMAT 0x8017 + GL_CONVOLUTION_WIDTH 0x8018 + GL_CONVOLUTION_HEIGHT 0x8019 + GL_MAX_CONVOLUTION_WIDTH 0x801A + GL_MAX_CONVOLUTION_HEIGHT 0x801B + GL_POST_CONVOLUTION_RED_SCALE 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F + GL_POST_CONVOLUTION_RED_BIAS 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 + GL_HISTOGRAM 0x8024 + GL_PROXY_HISTOGRAM 0x8025 + GL_HISTOGRAM_WIDTH 0x8026 + GL_HISTOGRAM_FORMAT 0x8027 + GL_HISTOGRAM_RED_SIZE 0x8028 + GL_HISTOGRAM_GREEN_SIZE 0x8029 + GL_HISTOGRAM_BLUE_SIZE 0x802A + GL_HISTOGRAM_ALPHA_SIZE 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE 0x802C + GL_HISTOGRAM_SINK 0x802D + GL_MINMAX 0x802E + GL_MINMAX_FORMAT 0x802F + GL_MINMAX_SINK 0x8030 + GL_TABLE_TOO_LARGE 0x8031 + GL_COLOR_MATRIX 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB + GL_COLOR_TABLE 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 + GL_PROXY_COLOR_TABLE 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 + GL_COLOR_TABLE_SCALE 0x80D6 + GL_COLOR_TABLE_BIAS 0x80D7 + GL_COLOR_TABLE_FORMAT 0x80D8 + GL_COLOR_TABLE_WIDTH 0x80D9 + GL_COLOR_TABLE_RED_SIZE 0x80DA + GL_COLOR_TABLE_GREEN_SIZE 0x80DB + GL_COLOR_TABLE_BLUE_SIZE 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF + GL_IGNORE_BORDER 0x8150 + GL_CONSTANT_BORDER 0x8151 + GL_WRAP_BORDER 0x8152 + GL_REPLICATE_BORDER 0x8153 + GL_CONVOLUTION_BORDER_COLOR 0x8154 + void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) + void glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) + void glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params) + void glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) + void glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table) + void glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params) + void glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glResetHistogram (GLenum target) + void glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) + void glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params) + void glMinmax (GLenum target, GLenum internalformat, GLboolean sink) + void glResetMinmax (GLenum target) + void glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params) + void glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) + void glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) + void glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params) + void glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glConvolutionParameteri (GLenum target, GLenum pname, GLint params) + void glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params) + void glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image) + void glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params) + void glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) + void glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) + void glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_instanced_arrays b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_instanced_arrays new file mode 100644 index 0000000..b1c8873 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_instanced_arrays @@ -0,0 +1,7 @@ +GL_ARB_instanced_arrays +http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt +GL_ARB_instanced_arrays + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + void glVertexAttribDivisorARB (GLuint index, GLuint divisor) + void glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_internalformat_query2 b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_internalformat_query2 new file mode 100644 index 0000000..fc84d27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_internalformat_query2 @@ -0,0 +1,116 @@ +GL_ARB_internalformat_query2 +http://www.opengl.org/registry/specs/ARB/internalformat_query2.txt +GL_ARB_internalformat_query2 + GL_TEXTURE_1D 0x0DE0 + GL_TEXTURE_2D 0x0DE1 + GL_TEXTURE_3D 0x806F + GL_SAMPLES 0x80A9 + GL_INTERNALFORMAT_SUPPORTED 0x826F + GL_INTERNALFORMAT_PREFERRED 0x8270 + GL_INTERNALFORMAT_RED_SIZE 0x8271 + GL_INTERNALFORMAT_GREEN_SIZE 0x8272 + GL_INTERNALFORMAT_BLUE_SIZE 0x8273 + GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 + GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 + GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 + GL_INTERNALFORMAT_SHARED_SIZE 0x8277 + GL_INTERNALFORMAT_RED_TYPE 0x8278 + GL_INTERNALFORMAT_GREEN_TYPE 0x8279 + GL_INTERNALFORMAT_BLUE_TYPE 0x827A + GL_INTERNALFORMAT_ALPHA_TYPE 0x827B + GL_INTERNALFORMAT_DEPTH_TYPE 0x827C + GL_INTERNALFORMAT_STENCIL_TYPE 0x827D + GL_MAX_WIDTH 0x827E + GL_MAX_HEIGHT 0x827F + GL_MAX_DEPTH 0x8280 + GL_MAX_LAYERS 0x8281 + GL_MAX_COMBINED_DIMENSIONS 0x8282 + GL_COLOR_COMPONENTS 0x8283 + GL_DEPTH_COMPONENTS 0x8284 + GL_STENCIL_COMPONENTS 0x8285 + GL_COLOR_RENDERABLE 0x8286 + GL_DEPTH_RENDERABLE 0x8287 + GL_STENCIL_RENDERABLE 0x8288 + GL_FRAMEBUFFER_RENDERABLE 0x8289 + GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A + GL_FRAMEBUFFER_BLEND 0x828B + GL_READ_PIXELS 0x828C + GL_READ_PIXELS_FORMAT 0x828D + GL_READ_PIXELS_TYPE 0x828E + GL_TEXTURE_IMAGE_FORMAT 0x828F + GL_TEXTURE_IMAGE_TYPE 0x8290 + GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 + GL_GET_TEXTURE_IMAGE_TYPE 0x8292 + GL_MIPMAP 0x8293 + GL_MANUAL_GENERATE_MIPMAP 0x8294 + GL_AUTO_GENERATE_MIPMAP 0x8295 + GL_COLOR_ENCODING 0x8296 + GL_SRGB_READ 0x8297 + GL_SRGB_WRITE 0x8298 + GL_SRGB_DECODE_ARB 0x8299 + GL_FILTER 0x829A + GL_VERTEX_TEXTURE 0x829B + GL_TESS_CONTROL_TEXTURE 0x829C + GL_TESS_EVALUATION_TEXTURE 0x829D + GL_GEOMETRY_TEXTURE 0x829E + GL_FRAGMENT_TEXTURE 0x829F + GL_COMPUTE_TEXTURE 0x82A0 + GL_TEXTURE_SHADOW 0x82A1 + GL_TEXTURE_GATHER 0x82A2 + GL_TEXTURE_GATHER_SHADOW 0x82A3 + GL_SHADER_IMAGE_LOAD 0x82A4 + GL_SHADER_IMAGE_STORE 0x82A5 + GL_SHADER_IMAGE_ATOMIC 0x82A6 + GL_IMAGE_TEXEL_SIZE 0x82A7 + GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 + GL_IMAGE_PIXEL_FORMAT 0x82A9 + GL_IMAGE_PIXEL_TYPE 0x82AA + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 + GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 + GL_CLEAR_BUFFER 0x82B4 + GL_TEXTURE_VIEW 0x82B5 + GL_VIEW_COMPATIBILITY_CLASS 0x82B6 + GL_FULL_SUPPORT 0x82B7 + GL_CAVEAT_SUPPORT 0x82B8 + GL_IMAGE_CLASS_4_X_32 0x82B9 + GL_IMAGE_CLASS_2_X_32 0x82BA + GL_IMAGE_CLASS_1_X_32 0x82BB + GL_IMAGE_CLASS_4_X_16 0x82BC + GL_IMAGE_CLASS_2_X_16 0x82BD + GL_IMAGE_CLASS_1_X_16 0x82BE + GL_IMAGE_CLASS_4_X_8 0x82BF + GL_IMAGE_CLASS_2_X_8 0x82C0 + GL_IMAGE_CLASS_1_X_8 0x82C1 + GL_IMAGE_CLASS_11_11_10 0x82C2 + GL_IMAGE_CLASS_10_10_10_2 0x82C3 + GL_VIEW_CLASS_128_BITS 0x82C4 + GL_VIEW_CLASS_96_BITS 0x82C5 + GL_VIEW_CLASS_64_BITS 0x82C6 + GL_VIEW_CLASS_48_BITS 0x82C7 + GL_VIEW_CLASS_32_BITS 0x82C8 + GL_VIEW_CLASS_24_BITS 0x82C9 + GL_VIEW_CLASS_16_BITS 0x82CA + GL_VIEW_CLASS_8_BITS 0x82CB + GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC + GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD + GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE + GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF + GL_VIEW_CLASS_RGTC1_RED 0x82D0 + GL_VIEW_CLASS_RGTC2_RG 0x82D1 + GL_VIEW_CLASS_BPTC_UNORM 0x82D2 + GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + GL_TEXTURE_RECTANGLE 0x84F5 + GL_TEXTURE_1D_ARRAY 0x8C18 + GL_TEXTURE_2D_ARRAY 0x8C1A + GL_TEXTURE_BUFFER 0x8C2A + GL_RENDERBUFFER 0x8D41 + GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 + GL_TEXTURE_2D_MULTISAMPLE 0x9100 + GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 + GL_NUM_SAMPLE_COUNTS 0x9380 + void glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_matrix_palette b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_matrix_palette new file mode 100644 index 0000000..4b67c15 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_matrix_palette @@ -0,0 +1,18 @@ +GL_ARB_matrix_palette +http://oss.sgi.com/projects/ogl-sample/registry/ARB/matrix_palette.txt +GL_ARB_matrix_palette + GL_MATRIX_PALETTE_ARB 0x8840 + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 + GL_MAX_PALETTE_MATRICES_ARB 0x8842 + GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 + GL_MATRIX_INDEX_ARRAY_ARB 0x8844 + GL_CURRENT_MATRIX_INDEX_ARB 0x8845 + GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 + GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 + GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + void glCurrentPaletteMatrixARB (GLint index) + void glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, GLvoid *pointer) + void glMatrixIndexubvARB (GLint size, GLubyte *indices) + void glMatrixIndexusvARB (GLint size, GLushort *indices) + void glMatrixIndexuivARB (GLint size, GLuint *indices) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_multitexture b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_multitexture new file mode 100644 index 0000000..ee80791 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_multitexture @@ -0,0 +1,72 @@ +GL_ARB_multitexture +http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt +GL_ARB_multitexture + GL_TEXTURE0_ARB 0x84C0 + GL_TEXTURE1_ARB 0x84C1 + GL_TEXTURE2_ARB 0x84C2 + GL_TEXTURE3_ARB 0x84C3 + GL_TEXTURE4_ARB 0x84C4 + GL_TEXTURE5_ARB 0x84C5 + GL_TEXTURE6_ARB 0x84C6 + GL_TEXTURE7_ARB 0x84C7 + GL_TEXTURE8_ARB 0x84C8 + GL_TEXTURE9_ARB 0x84C9 + GL_TEXTURE10_ARB 0x84CA + GL_TEXTURE11_ARB 0x84CB + GL_TEXTURE12_ARB 0x84CC + GL_TEXTURE13_ARB 0x84CD + GL_TEXTURE14_ARB 0x84CE + GL_TEXTURE15_ARB 0x84CF + GL_TEXTURE16_ARB 0x84D0 + GL_TEXTURE17_ARB 0x84D1 + GL_TEXTURE18_ARB 0x84D2 + GL_TEXTURE19_ARB 0x84D3 + GL_TEXTURE20_ARB 0x84D4 + GL_TEXTURE21_ARB 0x84D5 + GL_TEXTURE22_ARB 0x84D6 + GL_TEXTURE23_ARB 0x84D7 + GL_TEXTURE24_ARB 0x84D8 + GL_TEXTURE25_ARB 0x84D9 + GL_TEXTURE26_ARB 0x84DA + GL_TEXTURE27_ARB 0x84DB + GL_TEXTURE28_ARB 0x84DC + GL_TEXTURE29_ARB 0x84DD + GL_TEXTURE30_ARB 0x84DE + GL_TEXTURE31_ARB 0x84DF + GL_ACTIVE_TEXTURE_ARB 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 + GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + void glActiveTextureARB (GLenum texture) + void glClientActiveTextureARB (GLenum texture) + void glMultiTexCoord1dARB (GLenum target, GLdouble s) + void glMultiTexCoord1dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord1fARB (GLenum target, GLfloat s) + void glMultiTexCoord1fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord1iARB (GLenum target, GLint s) + void glMultiTexCoord1ivARB (GLenum target, const GLint *v) + void glMultiTexCoord1sARB (GLenum target, GLshort s) + void glMultiTexCoord1svARB (GLenum target, const GLshort *v) + void glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord2iARB (GLenum target, GLint s, GLint t) + void glMultiTexCoord2ivARB (GLenum target, const GLint *v) + void glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2svARB (GLenum target, const GLshort *v) + void glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3ivARB (GLenum target, const GLint *v) + void glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3svARB (GLenum target, const GLshort *v) + void glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4ivARB (GLenum target, const GLint *v) + void glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4svARB (GLenum target, const GLshort *v) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_robustness b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_robustness new file mode 100644 index 0000000..cdeeb4f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_robustness @@ -0,0 +1,30 @@ +GL_ARB_robustness +http://www.opengl.org/registry/specs/ARB/robustness.txt +GL_ARB_robustness + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 + GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GL_GUILTY_CONTEXT_RESET_ARB 0x8253 + GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 + GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 + GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GL_NO_RESET_NOTIFICATION_ARB 0x8261 + GLenum glGetGraphicsResetStatusARB (void) + void glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table) + void glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void* img) + void glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image) + void glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v) + void glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v) + void glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint* v) + void glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat* values) + void glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint* values) + void glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort* values) + void glGetnPolygonStippleARB (GLsizei bufSize, GLubyte* pattern) + void glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span) + void glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img) + void glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble* params) + void glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat* params) + void glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint* params) + void glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint* params) + void glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_separate_shader_objects b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_separate_shader_objects new file mode 100644 index 0000000..b90b68a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_separate_shader_objects @@ -0,0 +1,72 @@ +GL_ARB_separate_shader_objects +http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt +GL_ARB_separate_shader_objects + GL_VERTEX_SHADER_BIT 0x00000001 + GL_FRAGMENT_SHADER_BIT 0x00000002 + GL_GEOMETRY_SHADER_BIT 0x00000004 + GL_TESS_CONTROL_SHADER_BIT 0x00000008 + GL_TESS_EVALUATION_SHADER_BIT 0x00000010 + GL_PROGRAM_SEPARABLE 0x8258 + GL_ACTIVE_PROGRAM 0x8259 + GL_PROGRAM_PIPELINE_BINDING 0x825A + GL_ALL_SHADER_BITS 0xFFFFFFFF + void glActiveShaderProgram (GLuint pipeline, GLuint program) + void glBindProgramPipeline (GLuint pipeline) + GLuint glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar ** strings) + void glDeleteProgramPipelines (GLsizei n, const GLuint* pipelines) + void glGenProgramPipelines (GLsizei n, GLuint* pipelines) + void glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog) + void glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint* params) + GLboolean glIsProgramPipeline (GLuint pipeline) + void glProgramUniform1d (GLuint program, GLint location, GLdouble x) + void glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform1f (GLuint program, GLint location, GLfloat x) + void glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1i (GLuint program, GLint location, GLint x) + void glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1ui (GLuint program, GLint location, GLuint x) + void glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2d (GLuint program, GLint location, GLdouble x, GLdouble y) + void glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform2f (GLuint program, GLint location, GLfloat x, GLfloat y) + void glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2i (GLuint program, GLint location, GLint x, GLint y) + void glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2ui (GLuint program, GLint location, GLuint x, GLuint y) + void glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) + void glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform3f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) + void glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3i (GLuint program, GLint location, GLint x, GLint y, GLint z) + void glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z) + void glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform4f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4i (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) + void glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program) + void glValidateProgramPipeline (GLuint pipeline) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_attrib_64bit b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_attrib_64bit new file mode 100644 index 0000000..079dce2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_attrib_64bit @@ -0,0 +1,19 @@ +GL_ARB_vertex_attrib_64bit +http://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt +GL_ARB_vertex_attrib_64bit + GL_DOUBLE_MAT2 0x8F46 + GL_DOUBLE_MAT3 0x8F47 + GL_DOUBLE_MAT4 0x8F48 + GL_DOUBLE_VEC2 0x8FFC + GL_DOUBLE_VEC3 0x8FFD + GL_DOUBLE_VEC4 0x8FFE + void glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble* params) + void glVertexAttribL1d (GLuint index, GLdouble x) + void glVertexAttribL1dv (GLuint index, const GLdouble* v) + void glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dv (GLuint index, const GLdouble* v) + void glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dv (GLuint index, const GLdouble* v) + void glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dv (GLuint index, const GLdouble* v) + void glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_blend b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_blend new file mode 100644 index 0000000..8da2c78 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ARB_vertex_blend @@ -0,0 +1,55 @@ +GL_ARB_vertex_blend +http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_blend.txt +GL_ARB_vertex_blend + GL_MAX_VERTEX_UNITS_ARB 0x86A4 + GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 + GL_WEIGHT_SUM_UNITY_ARB 0x86A6 + GL_VERTEX_BLEND_ARB 0x86A7 + GL_CURRENT_WEIGHT_ARB 0x86A8 + GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 + GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA + GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB + GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC + GL_WEIGHT_ARRAY_ARB 0x86AD + GL_MODELVIEW0_ARB 0x1700 + GL_MODELVIEW1_ARB 0x850A + GL_MODELVIEW2_ARB 0x8722 + GL_MODELVIEW3_ARB 0x8723 + GL_MODELVIEW4_ARB 0x8724 + GL_MODELVIEW5_ARB 0x8725 + GL_MODELVIEW6_ARB 0x8726 + GL_MODELVIEW7_ARB 0x8727 + GL_MODELVIEW8_ARB 0x8728 + GL_MODELVIEW9_ARB 0x8729 + GL_MODELVIEW10_ARB 0x872A + GL_MODELVIEW11_ARB 0x872B + GL_MODELVIEW12_ARB 0x872C + GL_MODELVIEW13_ARB 0x872D + GL_MODELVIEW14_ARB 0x872E + GL_MODELVIEW15_ARB 0x872F + GL_MODELVIEW16_ARB 0x8730 + GL_MODELVIEW17_ARB 0x8731 + GL_MODELVIEW18_ARB 0x8732 + GL_MODELVIEW19_ARB 0x8733 + GL_MODELVIEW20_ARB 0x8734 + GL_MODELVIEW21_ARB 0x8735 + GL_MODELVIEW22_ARB 0x8736 + GL_MODELVIEW23_ARB 0x8737 + GL_MODELVIEW24_ARB 0x8738 + GL_MODELVIEW25_ARB 0x8739 + GL_MODELVIEW26_ARB 0x873A + GL_MODELVIEW27_ARB 0x873B + GL_MODELVIEW28_ARB 0x873C + GL_MODELVIEW29_ARB 0x873D + GL_MODELVIEW30_ARB 0x873E + GL_MODELVIEW31_ARB 0x873F + void glWeightbvARB (GLint size, GLbyte *weights) + void glWeightsvARB (GLint size, GLshort *weights) + void glWeightivARB (GLint size, GLint *weights) + void glWeightfvARB (GLint size, GLfloat *weights) + void glWeightdvARB (GLint size, GLdouble *weights) + void glWeightubvARB (GLint size, GLubyte *weights) + void glWeightusvARB (GLint size, GLushort *weights) + void glWeightuivARB (GLint size, GLuint *weights) + void glWeightPointerARB (GLint size, GLenum type, GLsizei stride, GLvoid *pointer) + void glVertexBlendARB (GLint count) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_point_sprites b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_point_sprites new file mode 100644 index 0000000..0f4f574 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_point_sprites @@ -0,0 +1,9 @@ +GL_ATIX_point_sprites +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_point_sprites + GL_TEXTURE_POINT_MODE_ATIX 0x60B0 + GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 + GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 + GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 + GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 + GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_combine3 b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_combine3 new file mode 100644 index 0000000..537426b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_combine3 @@ -0,0 +1,6 @@ +GL_ATIX_texture_env_combine3 +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_texture_env_combine3 + GL_MODULATE_ADD_ATIX 0x8744 + GL_MODULATE_SIGNED_ADD_ATIX 0x8745 + GL_MODULATE_SUBTRACT_ATIX 0x8746 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_route b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_route new file mode 100644 index 0000000..939ae09 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_texture_env_route @@ -0,0 +1,6 @@ +GL_ATIX_texture_env_route +http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATIX_texture_env_route.txt +GL_ATIX_texture_env_route + GL_SECONDARY_COLOR_ATIX 0x8747 + GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 + GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_vertex_shader_output_point_size b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_vertex_shader_output_point_size new file mode 100644 index 0000000..277a313 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATIX_vertex_shader_output_point_size @@ -0,0 +1,4 @@ +GL_ATIX_vertex_shader_output_point_size +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_vertex_shader_output_point_size + GL_OUTPUT_POINT_SIZE_ATIX 0x610E diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_envmap_bumpmap b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_envmap_bumpmap new file mode 100644 index 0000000..fbd9925 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_envmap_bumpmap @@ -0,0 +1,15 @@ +GL_ATI_envmap_bumpmap +http://oss.sgi.com/projects/ogl-sample/registry/ATI/envmap_bumpmap.txt +GL_ATI_envmap_bumpmap + GL_BUMP_ROT_MATRIX_ATI 0x8775 + GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 + GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 + GL_BUMP_TEX_UNITS_ATI 0x8778 + GL_DUDV_ATI 0x8779 + GL_DU8DV8_ATI 0x877A + GL_BUMP_ENVMAP_ATI 0x877B + GL_BUMP_TARGET_ATI 0x877C + void glTexBumpParameterivATI (GLenum pname, GLint *param) + void glTexBumpParameterfvATI (GLenum pname, GLfloat *param) + void glGetTexBumpParameterivATI (GLenum pname, GLint *param) + void glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_map_object_buffer b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_map_object_buffer new file mode 100644 index 0000000..573afd2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_map_object_buffer @@ -0,0 +1,5 @@ +GL_ATI_map_object_buffer +http://www.opengl.org/registry/specs/ATI/map_object_buffer.txt +GL_ATI_map_object_buffer + GLvoid * glMapObjectBufferATI (GLuint buffer) + void glUnmapObjectBufferATI (GLuint buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_pn_triangles b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_pn_triangles new file mode 100644 index 0000000..a61e27a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_pn_triangles @@ -0,0 +1,14 @@ +GL_ATI_pn_triangles +http://www.opengl.org/registry/specs/ATI/pn_triangles.txt +GL_ATI_pn_triangles + GL_PN_TRIANGLES_ATI 0x87F0 + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 + GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 + GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + void glPNTrianglesiATI (GLenum pname, GLint param) + void glPNTrianglesfATI (GLenum pname, GLfloat param) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_separate_stencil b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_separate_stencil new file mode 100644 index 0000000..be55bb4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_separate_stencil @@ -0,0 +1,9 @@ +GL_ATI_separate_stencil +http://www.opengl.org/registry/specs/ATI/separate_stencil.txt +GL_ATI_separate_stencil + GL_STENCIL_BACK_FUNC_ATI 0x8800 + GL_STENCIL_BACK_FAIL_ATI 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + void glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_shader_texture_lod b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_shader_texture_lod new file mode 100644 index 0000000..5fbc624 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_shader_texture_lod @@ -0,0 +1,3 @@ +GL_ATI_shader_texture_lod + +GL_ATI_shader_texture_lod diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_texture_compression_3dc b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_texture_compression_3dc new file mode 100644 index 0000000..2548b30 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_texture_compression_3dc @@ -0,0 +1,4 @@ +GL_ATI_texture_compression_3dc + +GL_ATI_texture_compression_3dc + GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_vertex_streams b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_vertex_streams new file mode 100644 index 0000000..060f844 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_ATI_vertex_streams @@ -0,0 +1,58 @@ +GL_ATI_vertex_streams +http://www.opengl.org/registry/specs/ATI/vertex_streams.txt +GL_ATI_vertex_streams + GL_MAX_VERTEX_STREAMS_ATI 0x876B + GL_VERTEX_SOURCE_ATI 0x876C + GL_VERTEX_STREAM0_ATI 0x876D + GL_VERTEX_STREAM1_ATI 0x876E + GL_VERTEX_STREAM2_ATI 0x876F + GL_VERTEX_STREAM3_ATI 0x8770 + GL_VERTEX_STREAM4_ATI 0x8771 + GL_VERTEX_STREAM5_ATI 0x8772 + GL_VERTEX_STREAM6_ATI 0x8773 + GL_VERTEX_STREAM7_ATI 0x8774 + void glClientActiveVertexStreamATI (GLenum stream) + void glVertexBlendEnviATI (GLenum pname, GLint param) + void glVertexBlendEnvfATI (GLenum pname, GLfloat param) + void glVertexStream1sATI (GLenum stream, GLshort x) + void glVertexStream1svATI (GLenum stream, const GLshort *coords) + void glVertexStream1iATI (GLenum stream, GLint x) + void glVertexStream1ivATI (GLenum stream, const GLint *coords) + void glVertexStream1fATI (GLenum stream, GLfloat x) + void glVertexStream1fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream1dATI (GLenum stream, GLdouble x) + void glVertexStream1dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream2sATI (GLenum stream, GLshort x, GLshort y) + void glVertexStream2svATI (GLenum stream, const GLshort *coords) + void glVertexStream2iATI (GLenum stream, GLint x, GLint y) + void glVertexStream2ivATI (GLenum stream, const GLint *coords) + void glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y) + void glVertexStream2fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y) + void glVertexStream2dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glVertexStream3svATI (GLenum stream, const GLshort *coords) + void glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glVertexStream3ivATI (GLenum stream, const GLint *coords) + void glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glVertexStream3fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glVertexStream3dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexStream4svATI (GLenum stream, const GLshort *coords) + void glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w) + void glVertexStream4ivATI (GLenum stream, const GLint *coords) + void glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexStream4fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexStream4dvATI (GLenum stream, const GLdouble *coords) + void glNormalStream3bATI (GLenum stream, GLbyte x, GLbyte y, GLbyte z) + void glNormalStream3bvATI (GLenum stream, const GLbyte *coords) + void glNormalStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glNormalStream3svATI (GLenum stream, const GLshort *coords) + void glNormalStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glNormalStream3ivATI (GLenum stream, const GLint *coords) + void glNormalStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glNormalStream3fvATI (GLenum stream, const GLfloat *coords) + void glNormalStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glNormalStream3dvATI (GLenum stream, const GLdouble *coords) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_Cg_shader b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_Cg_shader new file mode 100644 index 0000000..34d3152 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_Cg_shader @@ -0,0 +1,5 @@ +GL_EXT_Cg_shader +http://download.nvidia.com/developer/GLSL/GLSL%20Release%20Notes%20for%20Release%2060.pdf +GL_EXT_Cg_shader + GL_CG_VERTEX_SHADER_EXT 0x890E + GL_CG_FRAGMENT_SHADER_EXT 0x890F diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_bindable_uniform b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_bindable_uniform new file mode 100644 index 0000000..809123b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_bindable_uniform @@ -0,0 +1,12 @@ +GL_EXT_bindable_uniform +http://developer.download.nvidia.com/opengl/specs/GL_EXT_bindable_uniform.txt +GL_EXT_bindable_uniform + GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 + GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 + GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 + GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED + GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + GL_UNIFORM_BUFFER_EXT 0x8DEE + void glUniformBufferEXT (GLuint program, GLint location, GLuint buffer) + GLint glGetUniformBufferSizeEXT (GLuint program, GLint location) + GLintptr glGetUniformOffsetEXT (GLuint program, GLint location) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_debug_marker b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_debug_marker new file mode 100644 index 0000000..9d0628c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_debug_marker @@ -0,0 +1,6 @@ +GL_EXT_debug_marker +http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt +GL_EXT_debug_marker + void glInsertEventMarkerEXT (GLsizei length, const GLchar* marker) + void glPushGroupMarkerEXT (GLsizei length, const GLchar* marker) + void glPopGroupMarkerEXT (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_depth_bounds_test b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_depth_bounds_test new file mode 100644 index 0000000..62528b7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_depth_bounds_test @@ -0,0 +1,6 @@ +GL_EXT_depth_bounds_test +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_depth_bounds_test.txt +GL_EXT_depth_bounds_test + GL_DEPTH_BOUNDS_TEST_EXT 0x8890 + GL_DEPTH_BOUNDS_EXT 0x8891 + void glDepthBoundsEXT (GLclampd zmin, GLclampd zmax) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_instanced b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_instanced new file mode 100644 index 0000000..afafa27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_instanced @@ -0,0 +1,5 @@ +GL_EXT_draw_instanced +http://developer.download.nvidia.com/opengl/specs/GL_EXT_draw_instanced.txt +GL_EXT_draw_instanced + void glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_range_elements b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_range_elements new file mode 100644 index 0000000..347ce62 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_draw_range_elements @@ -0,0 +1,6 @@ +GL_EXT_draw_range_elements +http://oss.sgi.com/projects/ogl-sample/registry/EXT/draw_range_elements.txt +GL_EXT_draw_range_elements + GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 + GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + void glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_fog_coord b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_fog_coord new file mode 100644 index 0000000..ac7868a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_fog_coord @@ -0,0 +1,16 @@ +GL_EXT_fog_coord +http://oss.sgi.com/projects/ogl-sample/registry/EXT/fog_coord.txt +GL_EXT_fog_coord + GL_FOG_COORDINATE_SOURCE_EXT 0x8450 + GL_FOG_COORDINATE_EXT 0x8451 + GL_FRAGMENT_DEPTH_EXT 0x8452 + GL_CURRENT_FOG_COORDINATE_EXT 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 + GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + void glFogCoordfEXT (GLfloat coord) + void glFogCoordfvEXT (const GLfloat *coord) + void glFogCoorddEXT (GLdouble coord) + void glFogCoorddvEXT (const GLdouble *coord) + void glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_framebuffer_sRGB new file mode 100644 index 0000000..4ca897b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +GL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GL_EXT_framebuffer_sRGB + GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_geometry_shader4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_geometry_shader4 new file mode 100644 index 0000000..f6f6785 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_geometry_shader4 @@ -0,0 +1,26 @@ +GL_EXT_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_geometry_shader4.txt +GL_EXT_geometry_shader4 + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE + GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA + GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + GL_PROGRAM_POINT_SIZE_EXT 0x8642 + void glProgramParameteriEXT (GLuint program, GLenum pname, GLint value) + void glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_program_parameters b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_program_parameters new file mode 100644 index 0000000..9048c98 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_program_parameters @@ -0,0 +1,5 @@ +GL_EXT_gpu_program_parameters +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_program_parameters.txt +GL_EXT_gpu_program_parameters + void glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_shader4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_shader4 new file mode 100644 index 0000000..0e89f0d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_gpu_shader4 @@ -0,0 +1,63 @@ +GL_EXT_gpu_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_shader4.txt +GL_EXT_gpu_shader4 + GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 + GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 + GL_SAMPLER_BUFFER_EXT 0x8DC2 + GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 + GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 + GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 + GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 + GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 + GL_INT_SAMPLER_1D_EXT 0x8DC9 + GL_INT_SAMPLER_2D_EXT 0x8DCA + GL_INT_SAMPLER_3D_EXT 0x8DCB + GL_INT_SAMPLER_CUBE_EXT 0x8DCC + GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD + GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE + GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF + GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 + GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD + void glGetUniformuivEXT (GLuint program, GLint location, GLuint *params) + void glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name) + GLint glGetFragDataLocationEXT (GLuint program, const GLchar *name) + void glUniform1uiEXT (GLint location, GLuint v0) + void glUniform2uiEXT (GLint location, GLuint v0, GLuint v1) + void glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2) + void glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value) + void glVertexAttribI1iEXT (GLuint index, GLint x) + void glVertexAttribI2iEXT (GLuint index, GLint x, GLint y) + void glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z) + void glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w) + void glVertexAttribI1uiEXT (GLuint index, GLuint x) + void glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y) + void glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z) + void glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glVertexAttribI1ivEXT (GLuint index, const GLint *v) + void glVertexAttribI2ivEXT (GLuint index, const GLint *v) + void glVertexAttribI3ivEXT (GLuint index, const GLint *v) + void glVertexAttribI4ivEXT (GLuint index, const GLint *v) + void glVertexAttribI1uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI2uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI3uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4bvEXT (GLuint index, const GLbyte *v) + void glVertexAttribI4svEXT (GLuint index, const GLshort *v) + void glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v) + void glVertexAttribI4usvEXT (GLuint index, const GLushort *v) + void glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) + void glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params) + void glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_packed_float b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_packed_float new file mode 100644 index 0000000..bcb2255 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_packed_float @@ -0,0 +1,6 @@ +GL_EXT_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GL_EXT_packed_float + GL_R11F_G11F_B10F_EXT 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B + GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_pixel_buffer_object b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_pixel_buffer_object new file mode 100644 index 0000000..a7f8f2c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_pixel_buffer_object @@ -0,0 +1,7 @@ +GL_EXT_pixel_buffer_object +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_pixel_buffer_object.txt +GL_EXT_pixel_buffer_object + GL_PIXEL_PACK_BUFFER_EXT 0x88EB + GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_secondary_color b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_secondary_color new file mode 100644 index 0000000..e915455 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_secondary_color @@ -0,0 +1,27 @@ +GL_EXT_secondary_color +http://oss.sgi.com/projects/ogl-sample/registry/EXT/secondary_color.txt +GL_EXT_secondary_color + GL_COLOR_SUM_EXT 0x8458 + GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D + GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + void glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bvEXT (const GLbyte *v) + void glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dvEXT (const GLdouble *v) + void glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fvEXT (const GLfloat *v) + void glSecondaryColor3iEXT (GLint red, GLint green, GLint blue) + void glSecondaryColor3ivEXT (const GLint *v) + void glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3svEXT (const GLshort *v) + void glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubvEXT (const GLubyte *v) + void glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uivEXT (const GLuint *v) + void glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usvEXT (const GLushort *v) + void glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_array b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_array new file mode 100644 index 0000000..11877f0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_array @@ -0,0 +1,12 @@ +GL_EXT_texture_array +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_array.txt +GL_EXT_texture_array + GL_TEXTURE_1D_ARRAY_EXT 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + GL_TEXTURE_2D_ARRAY_EXT 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + void glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_buffer_object b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_buffer_object new file mode 100644 index 0000000..c00e1f3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_buffer_object @@ -0,0 +1,9 @@ +GL_EXT_texture_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_buffer_object.txt +GL_EXT_texture_buffer_object + GL_TEXTURE_BUFFER_EXT 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B + GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + void glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_latc b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_latc new file mode 100644 index 0000000..ddf8d26 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_latc @@ -0,0 +1,7 @@ +GL_EXT_texture_compression_latc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_latc.txt +GL_EXT_texture_compression_latc + GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_rgtc b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_rgtc new file mode 100644 index 0000000..7c5c57f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_compression_rgtc @@ -0,0 +1,7 @@ +GL_EXT_texture_compression_rgtc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_rgtc.txt +GL_EXT_texture_compression_rgtc + GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC + GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD + GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_cube_map b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_cube_map new file mode 100644 index 0000000..5909f48 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_cube_map @@ -0,0 +1,15 @@ +GL_EXT_texture_cube_map +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_cube_map.txt +GL_EXT_texture_cube_map + GL_NORMAL_MAP_EXT 0x8511 + GL_REFLECTION_MAP_EXT 0x8512 + GL_TEXTURE_CUBE_MAP_EXT 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_edge_clamp b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_edge_clamp new file mode 100644 index 0000000..4df0997 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_edge_clamp @@ -0,0 +1,4 @@ +GL_EXT_texture_edge_clamp +http://www.opengl.org/developers/documentation/Version1.2/1.2specs/texture_edge_clamp.txt +GL_EXT_texture_edge_clamp + GL_CLAMP_TO_EDGE_EXT 0x812F diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_integer b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_integer new file mode 100644 index 0000000..1c57e40 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_integer @@ -0,0 +1,56 @@ +GL_EXT_texture_integer +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_integer.txt +GL_EXT_texture_integer + GL_RGBA32UI_EXT 0x8D70 + GL_RGB32UI_EXT 0x8D71 + GL_ALPHA32UI_EXT 0x8D72 + GL_INTENSITY32UI_EXT 0x8D73 + GL_LUMINANCE32UI_EXT 0x8D74 + GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 + GL_RGBA16UI_EXT 0x8D76 + GL_RGB16UI_EXT 0x8D77 + GL_ALPHA16UI_EXT 0x8D78 + GL_INTENSITY16UI_EXT 0x8D79 + GL_LUMINANCE16UI_EXT 0x8D7A + GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B + GL_RGBA8UI_EXT 0x8D7C + GL_RGB8UI_EXT 0x8D7D + GL_ALPHA8UI_EXT 0x8D7E + GL_INTENSITY8UI_EXT 0x8D7F + GL_LUMINANCE8UI_EXT 0x8D80 + GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 + GL_RGBA32I_EXT 0x8D82 + GL_RGB32I_EXT 0x8D83 + GL_ALPHA32I_EXT 0x8D84 + GL_INTENSITY32I_EXT 0x8D85 + GL_LUMINANCE32I_EXT 0x8D86 + GL_LUMINANCE_ALPHA32I_EXT 0x8D87 + GL_RGBA16I_EXT 0x8D88 + GL_RGB16I_EXT 0x8D89 + GL_ALPHA16I_EXT 0x8D8A + GL_INTENSITY16I_EXT 0x8D8B + GL_LUMINANCE16I_EXT 0x8D8C + GL_LUMINANCE_ALPHA16I_EXT 0x8D8D + GL_RGBA8I_EXT 0x8D8E + GL_RGB8I_EXT 0x8D8F + GL_ALPHA8I_EXT 0x8D90 + GL_INTENSITY8I_EXT 0x8D91 + GL_LUMINANCE8I_EXT 0x8D92 + GL_LUMINANCE_ALPHA8I_EXT 0x8D93 + GL_RED_INTEGER_EXT 0x8D94 + GL_GREEN_INTEGER_EXT 0x8D95 + GL_BLUE_INTEGER_EXT 0x8D96 + GL_ALPHA_INTEGER_EXT 0x8D97 + GL_RGB_INTEGER_EXT 0x8D98 + GL_RGBA_INTEGER_EXT 0x8D99 + GL_BGR_INTEGER_EXT 0x8D9A + GL_BGRA_INTEGER_EXT 0x8D9B + GL_LUMINANCE_INTEGER_EXT 0x8D9C + GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D + GL_RGBA_INTEGER_MODE_EXT 0x8D9E + void glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params) + void glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params) + void glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params) + void glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params) + void glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha) + void glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_rectangle new file mode 100644 index 0000000..4028a9e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_rectangle @@ -0,0 +1,7 @@ +GL_EXT_texture_rectangle +http://developer.apple.com/opengl/extensions/ext_texture_rectangle.html +GL_EXT_texture_rectangle + GL_TEXTURE_RECTANGLE_EXT 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_shared_exponent b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_shared_exponent new file mode 100644 index 0000000..4ff7efc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_texture_shared_exponent @@ -0,0 +1,6 @@ +GL_EXT_texture_shared_exponent +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_shared_exponent.txt +GL_EXT_texture_shared_exponent + GL_RGB9_E5_EXT 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E + GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_timer_query b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_timer_query new file mode 100644 index 0000000..390e6fc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_timer_query @@ -0,0 +1,6 @@ +GL_EXT_timer_query +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_timer_query.txt +GL_EXT_timer_query + GL_TIME_ELAPSED_EXT 0x88BF + void glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params) + void glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_vertex_shader b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_vertex_shader new file mode 100644 index 0000000..eb125b6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_EXT_vertex_shader @@ -0,0 +1,156 @@ +GL_EXT_vertex_shader +http://oss.sgi.com/projects/ogl-sample/registry/EXT/vertex_shader.txt +GL_EXT_vertex_shader + GL_VERTEX_SHADER_EXT 0x8780 + GL_VERTEX_SHADER_BINDING_EXT 0x8781 + GL_OP_INDEX_EXT 0x8782 + GL_OP_NEGATE_EXT 0x8783 + GL_OP_DOT3_EXT 0x8784 + GL_OP_DOT4_EXT 0x8785 + GL_OP_MUL_EXT 0x8786 + GL_OP_ADD_EXT 0x8787 + GL_OP_MADD_EXT 0x8788 + GL_OP_FRAC_EXT 0x8789 + GL_OP_MAX_EXT 0x878A + GL_OP_MIN_EXT 0x878B + GL_OP_SET_GE_EXT 0x878C + GL_OP_SET_LT_EXT 0x878D + GL_OP_CLAMP_EXT 0x878E + GL_OP_FLOOR_EXT 0x878F + GL_OP_ROUND_EXT 0x8790 + GL_OP_EXP_BASE_2_EXT 0x8791 + GL_OP_LOG_BASE_2_EXT 0x8792 + GL_OP_POWER_EXT 0x8793 + GL_OP_RECIP_EXT 0x8794 + GL_OP_RECIP_SQRT_EXT 0x8795 + GL_OP_SUB_EXT 0x8796 + GL_OP_CROSS_PRODUCT_EXT 0x8797 + GL_OP_MULTIPLY_MATRIX_EXT 0x8798 + GL_OP_MOV_EXT 0x8799 + GL_OUTPUT_VERTEX_EXT 0x879A + GL_OUTPUT_COLOR0_EXT 0x879B + GL_OUTPUT_COLOR1_EXT 0x879C + GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D + GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E + GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F + GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 + GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 + GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 + GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 + GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 + GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 + GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 + GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 + GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 + GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 + GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA + GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB + GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC + GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD + GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE + GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF + GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 + GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 + GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 + GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 + GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 + GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 + GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 + GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 + GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 + GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 + GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA + GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB + GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC + GL_OUTPUT_FOG_EXT 0x87BD + GL_SCALAR_EXT 0x87BE + GL_VECTOR_EXT 0x87BF + GL_MATRIX_EXT 0x87C0 + GL_VARIANT_EXT 0x87C1 + GL_INVARIANT_EXT 0x87C2 + GL_LOCAL_CONSTANT_EXT 0x87C3 + GL_LOCAL_EXT 0x87C4 + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 + GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 + GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE + GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF + GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 + GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 + GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 + GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 + GL_X_EXT 0x87D5 + GL_Y_EXT 0x87D6 + GL_Z_EXT 0x87D7 + GL_W_EXT 0x87D8 + GL_NEGATIVE_X_EXT 0x87D9 + GL_NEGATIVE_Y_EXT 0x87DA + GL_NEGATIVE_Z_EXT 0x87DB + GL_NEGATIVE_W_EXT 0x87DC + GL_ZERO_EXT 0x87DD + GL_ONE_EXT 0x87DE + GL_NEGATIVE_ONE_EXT 0x87DF + GL_NORMALIZED_RANGE_EXT 0x87E0 + GL_FULL_RANGE_EXT 0x87E1 + GL_CURRENT_VERTEX_EXT 0x87E2 + GL_MVP_MATRIX_EXT 0x87E3 + GL_VARIANT_VALUE_EXT 0x87E4 + GL_VARIANT_DATATYPE_EXT 0x87E5 + GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 + GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 + GL_VARIANT_ARRAY_EXT 0x87E8 + GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 + GL_INVARIANT_VALUE_EXT 0x87EA + GL_INVARIANT_DATATYPE_EXT 0x87EB + GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC + GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + + void glBeginVertexShaderEXT (void) + void glEndVertexShaderEXT (void) + void glBindVertexShaderEXT (GLuint id) + GLuint glGenVertexShadersEXT (GLuint range) + void glDeleteVertexShaderEXT (GLuint id) + void glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1) + void glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2) + void glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) + void glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glInsertComponentEXT (GLuint res, GLuint src, GLuint num) + void glExtractComponentEXT (GLuint res, GLuint src, GLuint num) + GLuint glGenSymbolsEXT (GLenum dataType, GLenum storageType, GLenum range, GLuint components) + void glSetInvariantEXT (GLuint id, GLenum type, GLvoid *addr) + void glSetLocalConstantEXT (GLuint id, GLenum type, GLvoid *addr) + void glVariantbvEXT (GLuint id, GLbyte *addr) + void glVariantsvEXT (GLuint id, GLshort *addr) + void glVariantivEXT (GLuint id, GLint *addr) + void glVariantfvEXT (GLuint id, GLfloat *addr) + void glVariantdvEXT (GLuint id, GLdouble *addr) + void glVariantubvEXT (GLuint id, GLubyte *addr) + void glVariantusvEXT (GLuint id, GLushort *addr) + void glVariantuivEXT (GLuint id, GLuint *addr) + void glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, GLvoid *addr) + void glEnableVariantClientStateEXT (GLuint id) + void glDisableVariantClientStateEXT (GLuint id) + GLuint glBindLightParameterEXT (GLenum light, GLenum value) + GLuint glBindMaterialParameterEXT (GLenum face, GLenum value) + GLuint glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value) + GLuint glBindTextureUnitParameterEXT (GLenum unit, GLenum value) + GLuint glBindParameterEXT (GLenum value) + GLboolean glIsVariantEnabledEXT (GLuint id, GLenum cap) + void glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid **data) + void glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_KTX_buffer_region b/thirdparty/glew/glew-1.9.0/auto/core/GL_KTX_buffer_region new file mode 100644 index 0000000..adc6c6f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_KTX_buffer_region @@ -0,0 +1,12 @@ +GL_KTX_buffer_region + +GL_KTX_buffer_region + GL_KTX_FRONT_REGION 0x0 + GL_KTX_BACK_REGION 0x1 + GL_KTX_Z_REGION 0x2 + GL_KTX_STENCIL_REGION 0x3 + GLuint glBufferRegionEnabled (void) + GLuint glNewBufferRegion (GLenum region) + void glDeleteBufferRegion (GLenum region) + void glReadBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height) + void glDrawBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NVX_gpu_memory_info b/thirdparty/glew/glew-1.9.0/auto/core/GL_NVX_gpu_memory_info new file mode 100644 index 0000000..6dd7bdd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NVX_gpu_memory_info @@ -0,0 +1,8 @@ +GL_NVX_gpu_memory_info +http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt +GL_NVX_gpu_memory_info + GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 + GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 + GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 + GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A + GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_buffer_float b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_buffer_float new file mode 100644 index 0000000..493b245 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_buffer_float @@ -0,0 +1,10 @@ +GL_NV_depth_buffer_float +http://developer.download.nvidia.com/opengl/specs/GL_NV_depth_buffer_float.txt +GL_NV_depth_buffer_float + GL_DEPTH_COMPONENT32F_NV 0x8DAB + GL_DEPTH32F_STENCIL8_NV 0x8DAC + GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD + GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + void glDepthRangedNV (GLdouble zNear, GLdouble zFar) + void glClearDepthdNV (GLdouble depth) + void glDepthBoundsdNV (GLdouble zmin, GLdouble zmax) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_range_unclamped b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_range_unclamped new file mode 100644 index 0000000..62b4e59 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_depth_range_unclamped @@ -0,0 +1,8 @@ +GL_NV_depth_range_unclamped + +GL_NV_depth_range_unclamped + GL_SAMPLE_COUNT_BITS_NV 0x8864 + GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 + GL_QUERY_RESULT_NV 0x8866 + GL_QUERY_RESULT_AVAILABLE_NV 0x8867 + GL_SAMPLE_COUNT_NV 0x8914 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program2 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program2 new file mode 100644 index 0000000..7fb59ee --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program2 @@ -0,0 +1,8 @@ +GL_NV_fragment_program2 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program2.txt +GL_NV_fragment_program2 + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 + GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 + GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program4 new file mode 100644 index 0000000..0ae2598 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program4 @@ -0,0 +1,3 @@ +GL_NV_fragment_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_fragment_program4.txt +GL_NV_gpu_program4 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program_option b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program_option new file mode 100644 index 0000000..7af9731 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_fragment_program_option @@ -0,0 +1,3 @@ +GL_NV_fragment_program_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt +GL_NV_fragment_program_option diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_framebuffer_multisample_coverage b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_framebuffer_multisample_coverage new file mode 100644 index 0000000..d1d0660 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_framebuffer_multisample_coverage @@ -0,0 +1,8 @@ +GL_NV_framebuffer_multisample_coverage +http://developer.download.nvidia.com/opengl/specs/GL_NV_framebuffer_multisample_coverage.txt +GL_NV_framebuffer_multisample_coverage + GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB + GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 + GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 + GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + void glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_program4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_program4 new file mode 100644 index 0000000..3f82b19 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_program4 @@ -0,0 +1,7 @@ +GL_NV_geometry_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_program4.txt +GL_NV_gpu_program4 + GL_GEOMETRY_PROGRAM_NV 0x8C26 + GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 + GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + void glProgramVertexLimitNV (GLenum target, GLint limit) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_shader4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_shader4 new file mode 100644 index 0000000..2040c0d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_geometry_shader4 @@ -0,0 +1,3 @@ +GL_NV_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_shader4.txt +GL_NV_geometry_shader4 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program4 new file mode 100644 index 0000000..030f68e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program4 @@ -0,0 +1,23 @@ +GL_NV_gpu_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_gpu_program4.txt +GL_NV_gpu_program4 + GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 + GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 + GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 + GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 + GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 + GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 + GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + void glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) + void glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program5 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program5 new file mode 100644 index 0000000..18bb28f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_gpu_program5 @@ -0,0 +1,9 @@ +GL_NV_gpu_program5 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program5 + GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C + GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_parameter_buffer_object b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_parameter_buffer_object new file mode 100644 index 0000000..d2525a1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_parameter_buffer_object @@ -0,0 +1,11 @@ +GL_NV_parameter_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_NV_parameter_buffer_object.txt +GL_NV_parameter_buffer_object + GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 + GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 + GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 + GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 + void glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params) + void glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params) + void glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_path_rendering b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_path_rendering new file mode 100644 index 0000000..a3239b4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_path_rendering @@ -0,0 +1,182 @@ +GL_NV_path_rendering +http://www.opengl.org/registry/specs/NV/path_rendering.txt +GL_NV_path_rendering + GL_CLOSE_PATH_NV 0x00 + GL_BOLD_BIT_NV 0x01 + GL_GLYPH_WIDTH_BIT_NV 0x01 + GL_GLYPH_HEIGHT_BIT_NV 0x02 + GL_ITALIC_BIT_NV 0x02 + GL_MOVE_TO_NV 0x02 + GL_RELATIVE_MOVE_TO_NV 0x03 + GL_LINE_TO_NV 0x04 + GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 + GL_RELATIVE_LINE_TO_NV 0x05 + GL_HORIZONTAL_LINE_TO_NV 0x06 + GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 + GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 + GL_VERTICAL_LINE_TO_NV 0x08 + GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 + GL_QUADRATIC_CURVE_TO_NV 0x0A + GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B + GL_CUBIC_CURVE_TO_NV 0x0C + GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D + GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E + GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F + GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 + GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 + GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 + GL_SMALL_CCW_ARC_TO_NV 0x12 + GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 + GL_SMALL_CW_ARC_TO_NV 0x14 + GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 + GL_LARGE_CCW_ARC_TO_NV 0x16 + GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 + GL_LARGE_CW_ARC_TO_NV 0x18 + GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 + GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 + GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 + GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 + GL_RESTART_PATH_NV 0xF0 + GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 + GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 + GL_RECT_NV 0xF6 + GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 + GL_CIRCULAR_CW_ARC_TO_NV 0xFA + GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC + GL_ARC_TO_NV 0xFE + GL_RELATIVE_ARC_TO_NV 0xFF + GL_GLYPH_HAS_KERNING_BIT_NV 0x100 + GL_PRIMARY_COLOR_NV 0x852C + GL_SECONDARY_COLOR_NV 0x852D + GL_PRIMARY_COLOR 0x8577 + GL_PATH_FORMAT_SVG_NV 0x9070 + GL_PATH_FORMAT_PS_NV 0x9071 + GL_STANDARD_FONT_NAME_NV 0x9072 + GL_SYSTEM_FONT_NAME_NV 0x9073 + GL_FILE_NAME_NV 0x9074 + GL_PATH_STROKE_WIDTH_NV 0x9075 + GL_PATH_END_CAPS_NV 0x9076 + GL_PATH_INITIAL_END_CAP_NV 0x9077 + GL_PATH_TERMINAL_END_CAP_NV 0x9078 + GL_PATH_JOIN_STYLE_NV 0x9079 + GL_PATH_MITER_LIMIT_NV 0x907A + GL_PATH_DASH_CAPS_NV 0x907B + GL_PATH_INITIAL_DASH_CAP_NV 0x907C + GL_PATH_TERMINAL_DASH_CAP_NV 0x907D + GL_PATH_DASH_OFFSET_NV 0x907E + GL_PATH_CLIENT_LENGTH_NV 0x907F + GL_PATH_FILL_MODE_NV 0x9080 + GL_PATH_FILL_MASK_NV 0x9081 + GL_PATH_FILL_COVER_MODE_NV 0x9082 + GL_PATH_STROKE_COVER_MODE_NV 0x9083 + GL_PATH_STROKE_MASK_NV 0x9084 + GL_COUNT_UP_NV 0x9088 + GL_COUNT_DOWN_NV 0x9089 + GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A + GL_CONVEX_HULL_NV 0x908B + GL_BOUNDING_BOX_NV 0x908D + GL_TRANSLATE_X_NV 0x908E + GL_TRANSLATE_Y_NV 0x908F + GL_TRANSLATE_2D_NV 0x9090 + GL_TRANSLATE_3D_NV 0x9091 + GL_AFFINE_2D_NV 0x9092 + GL_AFFINE_3D_NV 0x9094 + GL_TRANSPOSE_AFFINE_2D_NV 0x9096 + GL_TRANSPOSE_AFFINE_3D_NV 0x9098 + GL_UTF8_NV 0x909A + GL_UTF16_NV 0x909B + GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C + GL_PATH_COMMAND_COUNT_NV 0x909D + GL_PATH_COORD_COUNT_NV 0x909E + GL_PATH_DASH_ARRAY_COUNT_NV 0x909F + GL_PATH_COMPUTED_LENGTH_NV 0x90A0 + GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 + GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 + GL_SQUARE_NV 0x90A3 + GL_ROUND_NV 0x90A4 + GL_TRIANGULAR_NV 0x90A5 + GL_BEVEL_NV 0x90A6 + GL_MITER_REVERT_NV 0x90A7 + GL_MITER_TRUNCATE_NV 0x90A8 + GL_SKIP_MISSING_GLYPH_NV 0x90A9 + GL_USE_MISSING_GLYPH_NV 0x90AA + GL_PATH_ERROR_POSITION_NV 0x90AB + GL_PATH_FOG_GEN_MODE_NV 0x90AC + GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD + GL_ADJACENT_PAIRS_NV 0x90AE + GL_FIRST_TO_REST_NV 0x90AF + GL_PATH_GEN_MODE_NV 0x90B0 + GL_PATH_GEN_COEFF_NV 0x90B1 + GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 + GL_PATH_GEN_COMPONENTS_NV 0x90B3 + GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 + GL_MOVE_TO_RESETS_NV 0x90B5 + GL_MOVE_TO_CONTINUES_NV 0x90B6 + GL_PATH_STENCIL_FUNC_NV 0x90B7 + GL_PATH_STENCIL_REF_NV 0x90B8 + GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 + GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD + GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE + GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF + GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 + GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 + GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 + GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 + GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 + GL_FONT_ASCENDER_BIT_NV 0x00200000 + GL_FONT_DESCENDER_BIT_NV 0x00400000 + GL_FONT_HEIGHT_BIT_NV 0x00800000 + GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 + GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 + GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 + GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 + GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + void glCopyPathNV (GLuint resultPath, GLuint srcPath) + void glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverFillPathNV (GLuint path, GLenum coverMode) + void glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverStrokePathNV (GLuint name, GLenum coverMode) + void glDeletePathsNV (GLuint path, GLsizei range) + GLuint glGenPathsNV (GLsizei range) + void glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat* value) + void glGetPathColorGenivNV (GLenum color, GLenum pname, GLint* value) + void glGetPathCommandsNV (GLuint name, GLubyte* commands) + void glGetPathCoordsNV (GLuint name, GLfloat* coords) + void glGetPathDashArrayNV (GLuint name, GLfloat* dashArray) + GLfloat glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments) + void glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics) + void glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics) + void glGetPathParameterfvNV (GLuint name, GLenum param, GLfloat* value) + void glGetPathParameterivNV (GLuint name, GLenum param, GLint* value) + void glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing) + void glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat* value) + void glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint* value) + void glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight) + GLboolean glIsPathNV (GLuint path) + GLboolean glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y) + GLboolean glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y) + void glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs) + void glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords) + void glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords) + void glPathCoverDepthFuncNV (GLenum zfunc) + void glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat* dashArray) + void glPathFogGenNV (GLenum genMode) + void glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathParameterfNV (GLuint path, GLenum pname, GLfloat value) + void glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat* value) + void glPathParameteriNV (GLuint path, GLenum pname, GLint value) + void glPathParameterivNV (GLuint path, GLenum pname, const GLint* value) + void glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units) + void glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask) + void glPathStringNV (GLuint path, GLenum format, GLsizei length, const void* pathString) + void glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords) + void glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords) + void glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs) + GLboolean glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY) + void glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask) + void glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask) + void glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues) + void glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_present_video b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_present_video new file mode 100644 index 0000000..893c74c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_present_video @@ -0,0 +1,15 @@ +GL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GL_NV_present_video + GL_FRAME_NV 0x8E26 + GL_FIELDS_NV 0x8E27 + GL_CURRENT_TIME_NV 0x8E28 + GL_NUM_FILL_STREAMS_NV 0x8E29 + GL_PRESENT_TIME_NV 0x8E2A + GL_PRESENT_DURATION_NV 0x8E2B + void glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT* params) + void glGetVideoivNV (GLuint video_slot, GLenum pname, GLint* params) + void glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT* params) + void glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint* params) + void glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3) + void glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_tessellation_program5 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_tessellation_program5 new file mode 100644 index 0000000..b663c97 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_tessellation_program5 @@ -0,0 +1,8 @@ +GL_NV_tessellation_program5 +http://www.opengl.org/registry/specs/NV/tessellation_program5.txt +GL_NV_gpu_program5 + GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 + GL_TESS_CONTROL_PROGRAM_NV 0x891E + GL_TESS_EVALUATION_PROGRAM_NV 0x891F + GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 + GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_transform_feedback b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_transform_feedback new file mode 100644 index 0000000..fce4757 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_transform_feedback @@ -0,0 +1,39 @@ +GL_NV_transform_feedback +http://developer.download.nvidia.com/opengl/specs/GL_NV_transform_feedback.txt +GL_NV_transform_feedback + GL_BACK_PRIMARY_COLOR_NV 0x8C77 + GL_BACK_SECONDARY_COLOR_NV 0x8C78 + GL_TEXTURE_COORD_NV 0x8C79 + GL_CLIP_DISTANCE_NV 0x8C7A + GL_VERTEX_ID_NV 0x8C7B + GL_PRIMITIVE_ID_NV 0x8C7C + GL_GENERIC_ATTRIB_NV 0x8C7D + GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 + GL_ACTIVE_VARYINGS_NV 0x8C81 + GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 + GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 + GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 + GL_PRIMITIVES_GENERATED_NV 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 + GL_RASTERIZER_DISCARD_NV 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B + GL_INTERLEAVED_ATTRIBS_NV 0x8C8C + GL_SEPARATE_ATTRIBS_NV 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + void glBeginTransformFeedbackNV (GLenum primitiveMode) + void glEndTransformFeedbackNV (void) + void glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode) + void glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer) + void glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode) + void glActiveVaryingNV (GLuint program, const GLchar *name) + GLint glGetVaryingLocationNV (GLuint program, const GLchar *name) + void glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) + void glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vdpau_interop b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vdpau_interop new file mode 100644 index 0000000..a2b68b2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vdpau_interop @@ -0,0 +1,18 @@ +GL_NV_vdpau_interop +http://www.opengl.org/registry/specs/NV/vdpau_interop.txt +GL_NV_vdpau_interop + GL_SURFACE_STATE_NV 0x86EB + GL_SURFACE_REGISTERED_NV 0x86FD + GL_SURFACE_MAPPED_NV 0x8700 + GL_WRITE_DISCARD_NV 0x88BE + void glVDPAUFiniNV (void) + void glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values) + void glVDPAUInitNV (const void* vdpDevice, const GLvoid*getProcAddress) + void glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface) + void glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces) + GLvdpauSurfaceNV glVDPAURegisterOutputSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + GLvdpauSurfaceNV glVDPAURegisterVideoSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + void glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access) + void glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces) + void glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface) + typedef GLintptr GLvdpauSurfaceNV diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program2_option b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program2_option new file mode 100644 index 0000000..1fecc4c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program2_option @@ -0,0 +1,5 @@ +GL_NV_vertex_program2_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program2_option.txt +GL_NV_vertex_program2_option + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program3 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program3 new file mode 100644 index 0000000..6510e06 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program3 @@ -0,0 +1,4 @@ +GL_NV_vertex_program3 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program3.txt +GL_NV_vertex_program3 + MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program4 new file mode 100644 index 0000000..c51d08a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_NV_vertex_program4 @@ -0,0 +1,4 @@ +GL_NV_vertex_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_vertex_program4.txt +GL_NV_gpu_program4 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_error_string b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_error_string new file mode 100644 index 0000000..c5ff4ce --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_error_string @@ -0,0 +1,4 @@ +GL_REGAL_error_string +https://github.com/p3/regal +GL_REGAL_error_string + const GLchar* glErrorStringREGAL (GLenum error) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_extension_query b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_extension_query new file mode 100644 index 0000000..5bf7245 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_extension_query @@ -0,0 +1,5 @@ +GL_REGAL_extension_query +https://github.com/p3/regal +GL_REGAL_extension_query + GLboolean glGetExtensionREGAL (const GLchar* ext) + GLboolean glIsSupportedREGAL (const GLchar* ext) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_log b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_log new file mode 100644 index 0000000..7f0ca4d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_REGAL_log @@ -0,0 +1,12 @@ +GL_REGAL_log +http://www.opengl.org/registry/specs/REGAL/log.txt +GL_REGAL_log + GL_LOG_ERROR_REGAL 0x9319 + GL_LOG_WARNING_REGAL 0x931A + GL_LOG_INFO_REGAL 0x931B + GL_LOG_APP_REGAL 0x931C + GL_LOG_DRIVER_REGAL 0x931D + GL_LOG_INTERNAL_REGAL 0x931E + GL_LOG_DEBUG_REGAL 0x931F + GL_LOG_STATUS_REGAL 0x9320 + GL_LOG_HTTP_REGAL 0x9321 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_SGIX_shadow b/thirdparty/glew/glew-1.9.0/auto/core/GL_SGIX_shadow new file mode 100644 index 0000000..2b34cc8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_SGIX_shadow @@ -0,0 +1,7 @@ +GL_SGIX_shadow +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/shadow.txt +GL_SGIX_shadow + GL_TEXTURE_COMPARE_SGIX 0x819A + GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B + GL_TEXTURE_LEQUAL_R_SGIX 0x819C + GL_TEXTURE_GEQUAL_R_SGIX 0x819D diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_SUN_read_video_pixels b/thirdparty/glew/glew-1.9.0/auto/core/GL_SUN_read_video_pixels new file mode 100644 index 0000000..faa55f9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_SUN_read_video_pixels @@ -0,0 +1,4 @@ +GL_SUN_read_video_pixels +http://wwws.sun.com/software/graphics/opengl/extensions/gl_sun_read_video_pixels.txt +GL_SUN_read_video_pixels + void glReadVideoPixelsSUN (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2 new file mode 100644 index 0000000..fb55054 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2 @@ -0,0 +1,48 @@ +GL_VERSION_1_2 +http://www.opengl.org/documentation/specs/version1.2/opengl1.2.1.pdf + + GL_UNSIGNED_BYTE_3_3_2 0x8032 + GL_UNSIGNED_SHORT_4_4_4_4 0x8033 + GL_UNSIGNED_SHORT_5_5_5_1 0x8034 + GL_UNSIGNED_INT_8_8_8_8 0x8035 + GL_UNSIGNED_INT_10_10_10_2 0x8036 + GL_RESCALE_NORMAL 0x803A + GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 + GL_UNSIGNED_SHORT_5_6_5 0x8363 + GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 + GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 + GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 + GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 + GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 + GL_BGR 0x80E0 + GL_BGRA 0x80E1 + GL_MAX_ELEMENTS_VERTICES 0x80E8 + GL_MAX_ELEMENTS_INDICES 0x80E9 + GL_CLAMP_TO_EDGE 0x812F + GL_TEXTURE_MIN_LOD 0x813A + GL_TEXTURE_MAX_LOD 0x813B + GL_TEXTURE_BASE_LEVEL 0x813C + GL_TEXTURE_MAX_LEVEL 0x813D + GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 + GL_SINGLE_COLOR 0x81F9 + GL_SEPARATE_SPECULAR_COLOR 0x81FA + GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 + GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 + GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 + GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 + GL_ALIASED_POINT_SIZE_RANGE 0x846D + GL_ALIASED_LINE_WIDTH_RANGE 0x846E + GL_PACK_SKIP_IMAGES 0x806B + GL_PACK_IMAGE_HEIGHT 0x806C + GL_UNPACK_SKIP_IMAGES 0x806D + GL_UNPACK_IMAGE_HEIGHT 0x806E + GL_TEXTURE_3D 0x806F + GL_PROXY_TEXTURE_3D 0x8070 + GL_TEXTURE_DEPTH 0x8071 + GL_TEXTURE_WRAP_R 0x8072 + GL_MAX_3D_TEXTURE_SIZE 0x8073 + GL_TEXTURE_BINDING_3D 0x806A + void glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) + void glTexImage3D (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) + void glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) + void glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2_1 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2_1 new file mode 100644 index 0000000..a6ecf24 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_2_1 @@ -0,0 +1,3 @@ +GL_VERSION_1_2_1 +http://www.opengl.org/documentation/specs/version1.2/opengl1.2.1.pdf + diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_3 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_3 new file mode 100644 index 0000000..737ad7c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_3 @@ -0,0 +1,146 @@ +GL_VERSION_1_3 +http://www.opengl.org/documentation/specs/version1.3/glspec13.pdf + + GL_TEXTURE0 0x84C0 + GL_TEXTURE1 0x84C1 + GL_TEXTURE2 0x84C2 + GL_TEXTURE3 0x84C3 + GL_TEXTURE4 0x84C4 + GL_TEXTURE5 0x84C5 + GL_TEXTURE6 0x84C6 + GL_TEXTURE7 0x84C7 + GL_TEXTURE8 0x84C8 + GL_TEXTURE9 0x84C9 + GL_TEXTURE10 0x84CA + GL_TEXTURE11 0x84CB + GL_TEXTURE12 0x84CC + GL_TEXTURE13 0x84CD + GL_TEXTURE14 0x84CE + GL_TEXTURE15 0x84CF + GL_TEXTURE16 0x84D0 + GL_TEXTURE17 0x84D1 + GL_TEXTURE18 0x84D2 + GL_TEXTURE19 0x84D3 + GL_TEXTURE20 0x84D4 + GL_TEXTURE21 0x84D5 + GL_TEXTURE22 0x84D6 + GL_TEXTURE23 0x84D7 + GL_TEXTURE24 0x84D8 + GL_TEXTURE25 0x84D9 + GL_TEXTURE26 0x84DA + GL_TEXTURE27 0x84DB + GL_TEXTURE28 0x84DC + GL_TEXTURE29 0x84DD + GL_TEXTURE30 0x84DE + GL_TEXTURE31 0x84DF + GL_ACTIVE_TEXTURE 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + GL_MAX_TEXTURE_UNITS 0x84E2 + GL_NORMAL_MAP 0x8511 + GL_REFLECTION_MAP 0x8512 + GL_TEXTURE_CUBE_MAP 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A + GL_PROXY_TEXTURE_CUBE_MAP 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C + GL_COMPRESSED_ALPHA 0x84E9 + GL_COMPRESSED_LUMINANCE 0x84EA + GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB + GL_COMPRESSED_INTENSITY 0x84EC + GL_COMPRESSED_RGB 0x84ED + GL_COMPRESSED_RGBA 0x84EE + GL_TEXTURE_COMPRESSION_HINT 0x84EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 + GL_TEXTURE_COMPRESSED 0x86A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 + GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + GL_MULTISAMPLE 0x809D + GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E + GL_SAMPLE_ALPHA_TO_ONE 0x809F + GL_SAMPLE_COVERAGE 0x80A0 + GL_SAMPLE_BUFFERS 0x80A8 + GL_SAMPLES 0x80A9 + GL_SAMPLE_COVERAGE_VALUE 0x80AA + GL_SAMPLE_COVERAGE_INVERT 0x80AB + GL_MULTISAMPLE_BIT 0x20000000 + GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 + GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 + GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 + GL_TRANSPOSE_COLOR_MATRIX 0x84E6 + GL_COMBINE 0x8570 + GL_COMBINE_RGB 0x8571 + GL_COMBINE_ALPHA 0x8572 + GL_SOURCE0_RGB 0x8580 + GL_SOURCE1_RGB 0x8581 + GL_SOURCE2_RGB 0x8582 + GL_SOURCE0_ALPHA 0x8588 + GL_SOURCE1_ALPHA 0x8589 + GL_SOURCE2_ALPHA 0x858A + GL_OPERAND0_RGB 0x8590 + GL_OPERAND1_RGB 0x8591 + GL_OPERAND2_RGB 0x8592 + GL_OPERAND0_ALPHA 0x8598 + GL_OPERAND1_ALPHA 0x8599 + GL_OPERAND2_ALPHA 0x859A + GL_RGB_SCALE 0x8573 + GL_ADD_SIGNED 0x8574 + GL_INTERPOLATE 0x8575 + GL_SUBTRACT 0x84E7 + GL_CONSTANT 0x8576 + GL_PRIMARY_COLOR 0x8577 + GL_PREVIOUS 0x8578 + GL_DOT3_RGB 0x86AE + GL_DOT3_RGBA 0x86AF + GL_CLAMP_TO_BORDER 0x812D + + void glActiveTexture (GLenum texture) + void glClientActiveTexture (GLenum texture) + void glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) + void glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) + void glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) + void glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) + void glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) + void glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) + void glGetCompressedTexImage (GLenum target, GLint lod, GLvoid *img) + void glLoadTransposeMatrixd (const GLdouble m[16]) + void glLoadTransposeMatrixf (const GLfloat m[16]) + void glMultTransposeMatrixd (const GLdouble m[16]) + void glMultTransposeMatrixf (const GLfloat m[16]) + void glMultiTexCoord1d (GLenum target, GLdouble s) + void glMultiTexCoord1dv (GLenum target, const GLdouble *v) + void glMultiTexCoord1f (GLenum target, GLfloat s) + void glMultiTexCoord1fv (GLenum target, const GLfloat *v) + void glMultiTexCoord1i (GLenum target, GLint s) + void glMultiTexCoord1iv (GLenum target, const GLint *v) + void glMultiTexCoord1s (GLenum target, GLshort s) + void glMultiTexCoord1sv (GLenum target, const GLshort *v) + void glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dv (GLenum target, const GLdouble *v) + void glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fv (GLenum target, const GLfloat *v) + void glMultiTexCoord2i (GLenum target, GLint s, GLint t) + void glMultiTexCoord2iv (GLenum target, const GLint *v) + void glMultiTexCoord2s (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2sv (GLenum target, const GLshort *v) + void glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dv (GLenum target, const GLdouble *v) + void glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fv (GLenum target, const GLfloat *v) + void glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3iv (GLenum target, const GLint *v) + void glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3sv (GLenum target, const GLshort *v) + void glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dv (GLenum target, const GLdouble *v) + void glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fv (GLenum target, const GLfloat *v) + void glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4iv (GLenum target, const GLint *v) + void glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4sv (GLenum target, const GLshort *v) + void glSampleCoverage (GLclampf value, GLboolean invert) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_4 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_4 new file mode 100644 index 0000000..ed5b4e8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_4 @@ -0,0 +1,89 @@ +GL_VERSION_1_4 +http://www.opengl.org/documentation/specs/version1.4/glspec14.pdf + + GL_GENERATE_MIPMAP 0x8191 + GL_GENERATE_MIPMAP_HINT 0x8192 + GL_DEPTH_COMPONENT16 0x81A5 + GL_DEPTH_COMPONENT24 0x81A6 + GL_DEPTH_COMPONENT32 0x81A7 + GL_TEXTURE_DEPTH_SIZE 0x884A + GL_DEPTH_TEXTURE_MODE 0x884B + GL_TEXTURE_COMPARE_MODE 0x884C + GL_TEXTURE_COMPARE_FUNC 0x884D + GL_COMPARE_R_TO_TEXTURE 0x884E + GL_FOG_COORDINATE_SOURCE 0x8450 + GL_FOG_COORDINATE 0x8451 + GL_FRAGMENT_DEPTH 0x8452 + GL_CURRENT_FOG_COORDINATE 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 + GL_FOG_COORDINATE_ARRAY 0x8457 + GL_POINT_SIZE_MIN 0x8126 + GL_POINT_SIZE_MAX 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE 0x8128 + GL_POINT_DISTANCE_ATTENUATION 0x8129 + GL_COLOR_SUM 0x8458 + GL_CURRENT_SECONDARY_COLOR 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D + GL_SECONDARY_COLOR_ARRAY 0x845E + GL_BLEND_DST_RGB 0x80C8 + GL_BLEND_SRC_RGB 0x80C9 + GL_BLEND_DST_ALPHA 0x80CA + GL_BLEND_SRC_ALPHA 0x80CB + GL_INCR_WRAP 0x8507 + GL_DECR_WRAP 0x8508 + GL_TEXTURE_FILTER_CONTROL 0x8500 + GL_TEXTURE_LOD_BIAS 0x8501 + GL_MAX_TEXTURE_LOD_BIAS 0x84FD + GL_MIRRORED_REPEAT 0x8370 + void glBlendEquation (GLenum mode) + void glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) + void glFogCoordf (GLfloat coord) + void glFogCoordfv (const GLfloat *coord) + void glFogCoordd (GLdouble coord) + void glFogCoorddv (const GLdouble *coord) + void glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer) + void glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount) + void glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount) + void glPointParameteri (GLenum pname, GLint param) + void glPointParameteriv (GLenum pname, const GLint *params) + void glPointParameterf (GLenum pname, GLfloat param) + void glPointParameterfv (GLenum pname, const GLfloat *params) + void glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bv (const GLbyte *v) + void glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dv (const GLdouble *v) + void glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fv (const GLfloat *v) + void glSecondaryColor3i (GLint red, GLint green, GLint blue) + void glSecondaryColor3iv (const GLint *v) + void glSecondaryColor3s (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3sv (const GLshort *v) + void glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubv (const GLubyte *v) + void glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uiv (const GLuint *v) + void glSecondaryColor3us (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usv (const GLushort *v) + void glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) + void glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) + void glWindowPos2d (GLdouble x, GLdouble y) + void glWindowPos2f (GLfloat x, GLfloat y) + void glWindowPos2i (GLint x, GLint y) + void glWindowPos2s (GLshort x, GLshort y) + void glWindowPos2dv (const GLdouble *p) + void glWindowPos2fv (const GLfloat *p) + void glWindowPos2iv (const GLint *p) + void glWindowPos2sv (const GLshort *p) + void glWindowPos3d (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3f (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3i (GLint x, GLint y, GLint z) + void glWindowPos3s (GLshort x, GLshort y, GLshort z) + void glWindowPos3dv (const GLdouble *p) + void glWindowPos3fv (const GLfloat *p) + void glWindowPos3iv (const GLint *p) + void glWindowPos3sv (const GLshort *p) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_5 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_5 new file mode 100644 index 0000000..d1ec8d4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_1_5 @@ -0,0 +1,74 @@ +GL_VERSION_1_5 +http://www.opengl.org/documentation/specs/version1.5/glspec15.pdf + + GL_BUFFER_SIZE 0x8764 + GL_BUFFER_USAGE 0x8765 + GL_QUERY_COUNTER_BITS 0x8864 + GL_CURRENT_QUERY 0x8865 + GL_QUERY_RESULT 0x8866 + GL_QUERY_RESULT_AVAILABLE 0x8867 + GL_ARRAY_BUFFER 0x8892 + GL_ELEMENT_ARRAY_BUFFER 0x8893 + GL_ARRAY_BUFFER_BINDING 0x8894 + GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 + GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 + GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 + GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 + GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D + GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F + GL_READ_ONLY 0x88B8 + GL_WRITE_ONLY 0x88B9 + GL_READ_WRITE 0x88BA + GL_BUFFER_ACCESS 0x88BB + GL_BUFFER_MAPPED 0x88BC + GL_BUFFER_MAP_POINTER 0x88BD + GL_STREAM_DRAW 0x88E0 + GL_STREAM_READ 0x88E1 + GL_STREAM_COPY 0x88E2 + GL_STATIC_DRAW 0x88E4 + GL_STATIC_READ 0x88E5 + GL_STATIC_COPY 0x88E6 + GL_DYNAMIC_DRAW 0x88E8 + GL_DYNAMIC_READ 0x88E9 + GL_DYNAMIC_COPY 0x88EA + GL_SAMPLES_PASSED 0x8914 + GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE + GL_FOG_COORD GL_FOG_COORDINATE + GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE + GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE + GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE + GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER + GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY + GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING + GL_SRC0_RGB GL_SOURCE0_RGB + GL_SRC1_RGB GL_SOURCE1_RGB + GL_SRC2_RGB GL_SOURCE2_RGB + GL_SRC0_ALPHA GL_SOURCE0_ALPHA + GL_SRC1_ALPHA GL_SOURCE1_ALPHA + GL_SRC2_ALPHA GL_SOURCE2_ALPHA + void glGenQueries (GLsizei n, GLuint* ids) + void glDeleteQueries (GLsizei n, const GLuint* ids) + GLboolean glIsQuery (GLuint id) + void glBeginQuery (GLenum target, GLuint id) + void glEndQuery (GLenum target) + void glGetQueryiv (GLenum target, GLenum pname, GLint* params) + void glGetQueryObjectiv (GLuint id, GLenum pname, GLint* params) + void glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint* params) + void glBindBuffer (GLenum target, GLuint buffer) + void glDeleteBuffers (GLsizei n, const GLuint* buffers) + void glGenBuffers (GLsizei n, GLuint* buffers) + GLboolean glIsBuffer (GLuint buffer) + void glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) + void glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) + void glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data) + GLvoid* glMapBuffer (GLenum target, GLenum access) + GLboolean glUnmapBuffer (GLenum target) + void glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params) + void glGetBufferPointerv (GLenum target, GLenum pname, GLvoid** params) + typedef ptrdiff_t GLsizeiptr + typedef ptrdiff_t GLintptr diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_0 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_0 new file mode 100644 index 0000000..2b65bd8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_0 @@ -0,0 +1,180 @@ +GL_VERSION_2_0 +http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf + + GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION + GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 + GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 + GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 + GL_CURRENT_VERTEX_ATTRIB 0x8626 + GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 + GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 + GL_STENCIL_BACK_FUNC 0x8800 + GL_STENCIL_BACK_FAIL 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 + GL_MAX_DRAW_BUFFERS 0x8824 + GL_DRAW_BUFFER0 0x8825 + GL_DRAW_BUFFER1 0x8826 + GL_DRAW_BUFFER2 0x8827 + GL_DRAW_BUFFER3 0x8828 + GL_DRAW_BUFFER4 0x8829 + GL_DRAW_BUFFER5 0x882A + GL_DRAW_BUFFER6 0x882B + GL_DRAW_BUFFER7 0x882C + GL_DRAW_BUFFER8 0x882D + GL_DRAW_BUFFER9 0x882E + GL_DRAW_BUFFER10 0x882F + GL_DRAW_BUFFER11 0x8830 + GL_DRAW_BUFFER12 0x8831 + GL_DRAW_BUFFER13 0x8832 + GL_DRAW_BUFFER14 0x8833 + GL_DRAW_BUFFER15 0x8834 + GL_BLEND_EQUATION_ALPHA 0x883D + GL_POINT_SPRITE 0x8861 + GL_COORD_REPLACE 0x8862 + GL_MAX_VERTEX_ATTRIBS 0x8869 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A + GL_MAX_TEXTURE_COORDS 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 + GL_FRAGMENT_SHADER 0x8B30 + GL_VERTEX_SHADER 0x8B31 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 + GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A + GL_MAX_VARYING_FLOATS 0x8B4B + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D + GL_SHADER_TYPE 0x8B4F + GL_FLOAT_VEC2 0x8B50 + GL_FLOAT_VEC3 0x8B51 + GL_FLOAT_VEC4 0x8B52 + GL_INT_VEC2 0x8B53 + GL_INT_VEC3 0x8B54 + GL_INT_VEC4 0x8B55 + GL_BOOL 0x8B56 + GL_BOOL_VEC2 0x8B57 + GL_BOOL_VEC3 0x8B58 + GL_BOOL_VEC4 0x8B59 + GL_FLOAT_MAT2 0x8B5A + GL_FLOAT_MAT3 0x8B5B + GL_FLOAT_MAT4 0x8B5C + GL_SAMPLER_1D 0x8B5D + GL_SAMPLER_2D 0x8B5E + GL_SAMPLER_3D 0x8B5F + GL_SAMPLER_CUBE 0x8B60 + GL_SAMPLER_1D_SHADOW 0x8B61 + GL_SAMPLER_2D_SHADOW 0x8B62 + GL_DELETE_STATUS 0x8B80 + GL_COMPILE_STATUS 0x8B81 + GL_LINK_STATUS 0x8B82 + GL_VALIDATE_STATUS 0x8B83 + GL_INFO_LOG_LENGTH 0x8B84 + GL_ATTACHED_SHADERS 0x8B85 + GL_ACTIVE_UNIFORMS 0x8B86 + GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 + GL_SHADER_SOURCE_LENGTH 0x8B88 + GL_ACTIVE_ATTRIBUTES 0x8B89 + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A + GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B + GL_SHADING_LANGUAGE_VERSION 0x8B8C + GL_CURRENT_PROGRAM 0x8B8D + GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 + GL_LOWER_LEFT 0x8CA1 + GL_UPPER_LEFT 0x8CA2 + GL_STENCIL_BACK_REF 0x8CA3 + GL_STENCIL_BACK_VALUE_MASK 0x8CA4 + GL_STENCIL_BACK_WRITEMASK 0x8CA5 + void glBlendEquationSeparate (GLenum, GLenum) + void glDrawBuffers (GLsizei n, const GLenum* bufs) + void glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) + void glStencilMaskSeparate (GLenum, GLuint) + void glAttachShader (GLuint program, GLuint shader) + void glBindAttribLocation (GLuint program, GLuint index, const GLchar* name) + void glCompileShader (GLuint shader) + GLuint glCreateProgram (void) + GLuint glCreateShader (GLenum type) + void glDeleteProgram (GLuint program) + void glDeleteShader (GLuint shader) + void glDetachShader (GLuint program, GLuint shader) + void glDisableVertexAttribArray (GLuint) + void glEnableVertexAttribArray (GLuint) + void glGetActiveAttrib (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) + void glGetActiveUniform (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) + void glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders) + GLint glGetAttribLocation (GLuint program, const GLchar* name) + void glGetProgramiv (GLuint program, GLenum pname, GLint* param) + void glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog) + void glGetShaderiv (GLuint shader, GLenum pname, GLint* param) + void glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog) + void glShaderSource (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths) + GLint glGetUniformLocation (GLuint program, const GLchar* name) + void glGetUniformfv (GLuint program, GLint location, GLfloat* params) + void glGetUniformiv (GLuint program, GLint location, GLint* params) + void glGetVertexAttribdv (GLuint, GLenum, GLdouble*) + void glGetVertexAttribfv (GLuint, GLenum, GLfloat*) + void glGetVertexAttribiv (GLuint, GLenum, GLint*) + void glGetVertexAttribPointerv (GLuint, GLenum, GLvoid**) + GLboolean glIsProgram (GLuint program) + GLboolean glIsShader (GLuint shader) + void glLinkProgram (GLuint program) + void glGetShaderSource (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source) + void glUseProgram (GLuint program) + void glUniform1f (GLint location, GLfloat v0) + void glUniform1fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform1i (GLint location, GLint v0) + void glUniform1iv (GLint location, GLsizei count, const GLint* value) + void glUniform2f (GLint location, GLfloat v0, GLfloat v1) + void glUniform2fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform2i (GLint location, GLint v0, GLint v1) + void glUniform2iv (GLint location, GLsizei count, const GLint* value) + void glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glUniform3fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform3i (GLint location, GLint v0, GLint v1, GLint v2) + void glUniform3iv (GLint location, GLsizei count, const GLint* value) + void glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glUniform4fv (GLint location, GLsizei count, const GLfloat* value) + void glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glUniform4iv (GLint location, GLsizei count, const GLint* value) + void glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glValidateProgram (GLuint program) + void glVertexAttrib1d (GLuint index, GLdouble x) + void glVertexAttrib1dv (GLuint index, const GLdouble* v) + void glVertexAttrib1f (GLuint index, GLfloat x) + void glVertexAttrib1fv (GLuint index, const GLfloat* v) + void glVertexAttrib1s (GLuint index, GLshort x) + void glVertexAttrib1sv (GLuint index, const GLshort* v) + void glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dv (GLuint index, const GLdouble* v) + void glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fv (GLuint index, const GLfloat* v) + void glVertexAttrib2s (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2sv (GLuint index, const GLshort* v) + void glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dv (GLuint index, const GLdouble* v) + void glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fv (GLuint index, const GLfloat* v) + void glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3sv (GLuint index, const GLshort* v) + void glVertexAttrib4Nbv (GLuint index, const GLbyte* v) + void glVertexAttrib4Niv (GLuint index, const GLint* v) + void glVertexAttrib4Nsv (GLuint index, const GLshort* v) + void glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4Nubv (GLuint index, const GLubyte* v) + void glVertexAttrib4Nuiv (GLuint index, const GLuint* v) + void glVertexAttrib4Nusv (GLuint index, const GLushort* v) + void glVertexAttrib4bv (GLuint index, const GLbyte* v) + void glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dv (GLuint index, const GLdouble* v) + void glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fv (GLuint index, const GLfloat* v) + void glVertexAttrib4iv (GLuint index, const GLint* v) + void glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4sv (GLuint index, const GLshort* v) + void glVertexAttrib4ubv (GLuint index, const GLubyte* v) + void glVertexAttrib4uiv (GLuint index, const GLuint* v) + void glVertexAttrib4usv (GLuint index, const GLushort* v) + void glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_1 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_1 new file mode 100644 index 0000000..51aa95b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_2_1 @@ -0,0 +1,32 @@ +GL_VERSION_2_1 +http://www.opengl.org/documentation/specs/version2.1/glspec21.pdf + + GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F + GL_PIXEL_PACK_BUFFER 0x88EB + GL_PIXEL_UNPACK_BUFFER 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF + GL_FLOAT_MAT2x3 0x8B65 + GL_FLOAT_MAT2x4 0x8B66 + GL_FLOAT_MAT3x2 0x8B67 + GL_FLOAT_MAT3x4 0x8B68 + GL_FLOAT_MAT4x2 0x8B69 + GL_FLOAT_MAT4x3 0x8B6A + GL_SRGB 0x8C40 + GL_SRGB8 0x8C41 + GL_SRGB_ALPHA 0x8C42 + GL_SRGB8_ALPHA8 0x8C43 + GL_SLUMINANCE_ALPHA 0x8C44 + GL_SLUMINANCE8_ALPHA8 0x8C45 + GL_SLUMINANCE 0x8C46 + GL_SLUMINANCE8 0x8C47 + GL_COMPRESSED_SRGB 0x8C48 + GL_COMPRESSED_SRGB_ALPHA 0x8C49 + GL_COMPRESSED_SLUMINANCE 0x8C4A + GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + void glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) + void glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_0 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_0 new file mode 100644 index 0000000..869d654 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_0 @@ -0,0 +1,165 @@ +GL_VERSION_3_0 +http://www.opengl.org/registry/doc/glspec30.20080811.pdf + + GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB + GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 + GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 + GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 + GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 + GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 + GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 + GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES + GL_MAJOR_VERSION 0x821B + GL_MINOR_VERSION 0x821C + GL_NUM_EXTENSIONS 0x821D + GL_CONTEXT_FLAGS 0x821E + GL_DEPTH_BUFFER 0x8223 + GL_STENCIL_BUFFER 0x8224 + GL_COMPRESSED_RED 0x8225 + GL_COMPRESSED_RG 0x8226 + GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 + GL_RGBA32F 0x8814 + GL_RGB32F 0x8815 + GL_RGBA16F 0x881A + GL_RGB16F 0x881B + GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD + GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF + GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 + GL_CLAMP_VERTEX_COLOR 0x891A + GL_CLAMP_FRAGMENT_COLOR 0x891B + GL_CLAMP_READ_COLOR 0x891C + GL_FIXED_ONLY 0x891D + GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS + GL_TEXTURE_RED_TYPE 0x8C10 + GL_TEXTURE_GREEN_TYPE 0x8C11 + GL_TEXTURE_BLUE_TYPE 0x8C12 + GL_TEXTURE_ALPHA_TYPE 0x8C13 + GL_TEXTURE_LUMINANCE_TYPE 0x8C14 + GL_TEXTURE_INTENSITY_TYPE 0x8C15 + GL_TEXTURE_DEPTH_TYPE 0x8C16 + GL_TEXTURE_1D_ARRAY 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 + GL_TEXTURE_2D_ARRAY 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D + GL_R11F_G11F_B10F 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + GL_RGB9_E5 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E + GL_TEXTURE_SHARED_SIZE 0x8C3F + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 + GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 + GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 + GL_PRIMITIVES_GENERATED 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 + GL_RASTERIZER_DISCARD 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B + GL_INTERLEAVED_ATTRIBS 0x8C8C + GL_SEPARATE_ATTRIBS 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F + GL_RGBA32UI 0x8D70 + GL_RGB32UI 0x8D71 + GL_RGBA16UI 0x8D76 + GL_RGB16UI 0x8D77 + GL_RGBA8UI 0x8D7C + GL_RGB8UI 0x8D7D + GL_RGBA32I 0x8D82 + GL_RGB32I 0x8D83 + GL_RGBA16I 0x8D88 + GL_RGB16I 0x8D89 + GL_RGBA8I 0x8D8E + GL_RGB8I 0x8D8F + GL_RED_INTEGER 0x8D94 + GL_GREEN_INTEGER 0x8D95 + GL_BLUE_INTEGER 0x8D96 + GL_ALPHA_INTEGER 0x8D97 + GL_RGB_INTEGER 0x8D98 + GL_RGBA_INTEGER 0x8D99 + GL_BGR_INTEGER 0x8D9A + GL_BGRA_INTEGER 0x8D9B + GL_SAMPLER_1D_ARRAY 0x8DC0 + GL_SAMPLER_2D_ARRAY 0x8DC1 + GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 + GL_SAMPLER_CUBE_SHADOW 0x8DC5 + GL_UNSIGNED_INT_VEC2 0x8DC6 + GL_UNSIGNED_INT_VEC3 0x8DC7 + GL_UNSIGNED_INT_VEC4 0x8DC8 + GL_INT_SAMPLER_1D 0x8DC9 + GL_INT_SAMPLER_2D 0x8DCA + GL_INT_SAMPLER_3D 0x8DCB + GL_INT_SAMPLER_CUBE 0x8DCC + GL_INT_SAMPLER_1D_ARRAY 0x8DCE + GL_INT_SAMPLER_2D_ARRAY 0x8DCF + GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 + GL_QUERY_WAIT 0x8E13 + GL_QUERY_NO_WAIT 0x8E14 + GL_QUERY_BY_REGION_WAIT 0x8E15 + GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + void glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean) + void glGetBooleani_v (GLenum, GLuint, GLboolean*) + void glEnablei (GLenum, GLuint) + void glDisablei (GLenum, GLuint) + GLboolean glIsEnabledi (GLenum, GLuint) + void glBeginTransformFeedback (GLenum) + void glEndTransformFeedback (void) + void glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar **, GLenum) + void glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *) + void glClampColor (GLenum, GLenum) + void glBeginConditionalRender (GLuint, GLenum) + void glEndConditionalRender (void) + void glVertexAttribI1i (GLuint, GLint) + void glVertexAttribI2i (GLuint, GLint, GLint) + void glVertexAttribI3i (GLuint, GLint, GLint, GLint) + void glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint) + void glVertexAttribI1ui (GLuint, GLuint) + void glVertexAttribI2ui (GLuint, GLuint, GLuint) + void glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint) + void glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint) + void glVertexAttribI1iv (GLuint, const GLint*) + void glVertexAttribI2iv (GLuint, const GLint*) + void glVertexAttribI3iv (GLuint, const GLint*) + void glVertexAttribI4iv (GLuint, const GLint*) + void glVertexAttribI1uiv (GLuint, const GLuint*) + void glVertexAttribI2uiv (GLuint, const GLuint*) + void glVertexAttribI3uiv (GLuint, const GLuint*) + void glVertexAttribI4uiv (GLuint, const GLuint*) + void glVertexAttribI4bv (GLuint, const GLbyte*) + void glVertexAttribI4sv (GLuint, const GLshort*) + void glVertexAttribI4ubv (GLuint, const GLubyte*) + void glVertexAttribI4usv (GLuint, const GLushort*) + void glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid*) + void glGetVertexAttribIiv (GLuint, GLenum, GLint*) + void glGetVertexAttribIuiv (GLuint, GLenum, GLuint*) + void glGetUniformuiv (GLuint, GLint, GLuint*) + void glBindFragDataLocation (GLuint, GLuint, const GLchar*) + GLint glGetFragDataLocation (GLuint, const GLchar*) + void glUniform1ui (GLint, GLuint) + void glUniform2ui (GLint, GLuint, GLuint) + void glUniform3ui (GLint, GLuint, GLuint, GLuint) + void glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint) + void glUniform1uiv (GLint, GLsizei, const GLuint*) + void glUniform2uiv (GLint, GLsizei, const GLuint*) + void glUniform3uiv (GLint, GLsizei, const GLuint*) + void glUniform4uiv (GLint, GLsizei, const GLuint*) + void glTexParameterIiv (GLenum, GLenum, const GLint*) + void glTexParameterIuiv (GLenum, GLenum, const GLuint*) + void glGetTexParameterIiv (GLenum, GLenum, GLint*) + void glGetTexParameterIuiv (GLenum, GLenum, GLuint*) + void glClearBufferiv (GLenum, GLint, const GLint*) + void glClearBufferuiv (GLenum, GLint, const GLuint*) + void glClearBufferfv (GLenum, GLint, const GLfloat*) + void glClearBufferfi (GLenum, GLint, GLfloat, GLint) + const GLubyte* glGetStringi (GLenum, GLuint) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_1 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_1 new file mode 100644 index 0000000..3e387a3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_1 @@ -0,0 +1,41 @@ +GL_VERSION_3_1 +http://www.opengl.org/registry/doc/glspec30.20080811.pdf + + GL_SAMPLER_2D_RECT 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW 0x8B64 + GL_SAMPLER_BUFFER 0x8DC2 + GL_INT_SAMPLER_2D_RECT 0x8DCD + GL_INT_SAMPLER_BUFFER 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 + GL_TEXTURE_BUFFER 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B + GL_TEXTURE_BINDING_BUFFER 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D + GL_TEXTURE_BUFFER_FORMAT 0x8C2E + GL_TEXTURE_RECTANGLE 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 + GL_RED_SNORM 0x8F90 + GL_RG_SNORM 0x8F91 + GL_RGB_SNORM 0x8F92 + GL_RGBA_SNORM 0x8F93 + GL_R8_SNORM 0x8F94 + GL_RG8_SNORM 0x8F95 + GL_RGB8_SNORM 0x8F96 + GL_RGBA8_SNORM 0x8F97 + GL_R16_SNORM 0x8F98 + GL_RG16_SNORM 0x8F99 + GL_RGB16_SNORM 0x8F9A + GL_RGBA16_SNORM 0x8F9B + GL_SIGNED_NORMALIZED 0x8F9C + GL_PRIMITIVE_RESTART 0x8F9D + GL_PRIMITIVE_RESTART_INDEX 0x8F9E + GL_BUFFER_ACCESS_FLAGS 0x911F + GL_BUFFER_MAP_LENGTH 0x9120 + GL_BUFFER_MAP_OFFSET 0x9121 + void glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei) + void glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei) + void glTexBuffer (GLenum, GLenum, GLuint) + void glPrimitiveRestartIndex (GLuint) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_2 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_2 new file mode 100644 index 0000000..81ba55d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_2 @@ -0,0 +1,28 @@ +GL_VERSION_3_2 +http://www.opengl.org/registry/doc/glspec32.core.20090803.pdf + + GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 + GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 + GL_LINES_ADJACENCY 0x000A + GL_LINE_STRIP_ADJACENCY 0x000B + GL_TRIANGLES_ADJACENCY 0x000C + GL_TRIANGLE_STRIP_ADJACENCY 0x000D + GL_PROGRAM_POINT_SIZE 0x8642 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 + GL_GEOMETRY_SHADER 0x8DD9 + GL_GEOMETRY_VERTICES_OUT 0x8916 + GL_GEOMETRY_INPUT_TYPE 0x8917 + GL_GEOMETRY_OUTPUT_TYPE 0x8918 + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 + GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 + GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 + GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 + GL_CONTEXT_PROFILE_MASK 0x9126 + void glGetInteger64i_v (GLenum, GLuint, GLint64 *) + void glGetBufferParameteri64v (GLenum, GLenum, GLint64 *) + void glFramebufferTexture (GLenum, GLenum, GLuint, GLint) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_3 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_3 new file mode 100644 index 0000000..a302081 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_3_3 @@ -0,0 +1,11 @@ +GL_VERSION_3_3 +http://www.opengl.org/registry/doc/glspec32.core.20090803.pdf + + GL_TEXTURE_SWIZZLE_R 0x8E42 + GL_TEXTURE_SWIZZLE_G 0x8E43 + GL_TEXTURE_SWIZZLE_B 0x8E44 + GL_TEXTURE_SWIZZLE_A 0x8E45 + GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + GL_RGB10_A2UI 0x906F + GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE + void glVertexAttribDivisor (GLuint index, GLuint divisor) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_0 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_0 new file mode 100644 index 0000000..9a118c9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_0 @@ -0,0 +1,25 @@ +GL_VERSION_4_0 +http://www.opengl.org/registry/doc/glspec32.core.20090803.pdf + + GL_SAMPLE_SHADING 0x8C36 + GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 + GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F + GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F + GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B + GL_SAMPLER_CUBE_MAP_ARRAY 0x900C + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D + GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + void glMinSampleShading (GLclampf value) + void glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendEquationi (GLuint buf, GLenum mode) + void glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + void glBlendFunci (GLuint buf, GLenum src, GLenum dst) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_1 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_1 new file mode 100644 index 0000000..4c51e00 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_1 @@ -0,0 +1,3 @@ +GL_VERSION_4_1 +http://www.opengl.org/registry/doc/glspec41.core.20100725.pdf + diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_2 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_2 new file mode 100644 index 0000000..401fb63 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_2 @@ -0,0 +1,8 @@ +GL_VERSION_4_2 +http://www.opengl.org/registry/doc/glspec42.core.20110822.pdf + + GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_3 b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_3 new file mode 100644 index 0000000..333109f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_VERSION_4_3 @@ -0,0 +1,5 @@ +GL_VERSION_4_3 +http://www.opengl.org/registry/ + + GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/GL_WIN_swap_hint b/thirdparty/glew/glew-1.9.0/auto/core/GL_WIN_swap_hint new file mode 100644 index 0000000..6916189 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/GL_WIN_swap_hint @@ -0,0 +1,4 @@ +GL_WIN_swap_hint +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_16zy.asp +GL_WIN_swap_hint + void glAddSwapHintRectWIN (GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_ARB_create_context b/thirdparty/glew/glew-1.9.0/auto/core/WGL_ARB_create_context new file mode 100644 index 0000000..20b3119 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_ARB_create_context @@ -0,0 +1,12 @@ +WGL_ARB_create_context +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context + WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 + WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 + WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 + WGL_CONTEXT_FLAGS_ARB 0x2094 + ERROR_INVALID_VERSION_ARB 0x2095 + ERROR_INVALID_PROFILE_ARB 0x2096 + HGLRC wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int* attribList) diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_ATI_render_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/core/WGL_ATI_render_texture_rectangle new file mode 100644 index 0000000..55df114 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_ATI_render_texture_rectangle @@ -0,0 +1,4 @@ +WGL_ATI_render_texture_rectangle + +WGL_ATI_render_texture_rectangle + WGL_TEXTURE_RECTANGLE_ATI 0x21A5 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es2_profile b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es2_profile new file mode 100644 index 0000000..ca9881a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es2_profile @@ -0,0 +1,4 @@ +WGL_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es2_profile.txt +WGL_EXT_create_context_es2_profile + WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es_profile b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es_profile new file mode 100644 index 0000000..6eb7cdd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_create_context_es_profile @@ -0,0 +1,4 @@ +WGL_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es_profile.txt +WGL_EXT_create_context_es_profile + WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_framebuffer_sRGB new file mode 100644 index 0000000..e4a4032 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_framebuffer_sRGB @@ -0,0 +1,4 @@ +WGL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +WGL_EXT_framebuffer_sRGB + WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_pixel_format_packed_float b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_pixel_format_packed_float new file mode 100644 index 0000000..30925fc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_EXT_pixel_format_packed_float @@ -0,0 +1,4 @@ +WGL_EXT_pixel_format_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +WGL_EXT_pixel_format_packed_float + WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_gpu_affinity b/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_gpu_affinity new file mode 100644 index 0000000..f722204 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_gpu_affinity @@ -0,0 +1,12 @@ +WGL_NV_gpu_affinity +http://developer.download.nvidia.com/opengl/specs/WGL_nv_gpu_affinity.txt +WGL_NV_gpu_affinity + WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 + WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + BOOL wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu) + BOOL wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice) + HDC wglCreateAffinityDCNV (const HGPUNV *phGpuList) + BOOL wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu) + BOOL wglDeleteDCNV (HDC hdc) + DECLARE_HANDLE(HGPUNV); + typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; diff --git a/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_vertex_array_range new file mode 100644 index 0000000..ca22d31 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/core/WGL_NV_vertex_array_range @@ -0,0 +1,5 @@ +WGL_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +WGL_NV_vertex_array_range + void * wglAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void wglFreeMemoryNV (void *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/custom.txt b/thirdparty/glew/glew-1.9.0/auto/custom.txt new file mode 100644 index 0000000..b797b95 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/custom.txt @@ -0,0 +1,7 @@ +WGL_ARB_extensions_string +WGL_EXT_extensions_string +WGL_ARB_pixel_format +WGL_ARB_pbuffer +WGL_NV_float_buffer +WGL_ATI_pixel_format_float +WGL_ARB_multisample diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/advanced.html b/thirdparty/glew/glew-1.9.0/auto/doc/advanced.html new file mode 100644 index 0000000..4bf2aa8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/advanced.html @@ -0,0 +1,169 @@ +

    Automatic Code Generation

    + +

    +Starting from release 1.1.0, the source code and parts of the +documentation are automatically generated from the extension +specifications in a two-step process. In the first step, +specification files from the OpenGL registry are downloaded and +parsed. Skeleton descriptors are created for each extension. These +descriptors contain all necessary information for creating the source +code and documentation in a simple and compact format, including the +name of the extension, url link to the specification, tokens, function +declarations, typedefs and struct definitions. In the second step, +the header files as well as the library and glewinfo source are +generated from the descriptor files. The code generation scripts are +located in the auto subdirectory. +

    + +

    +The code generation scripts require GNU make, wget, and perl. On +Windows, the simplest way to get access to these tools is to install +Cygwin, but make sure that the +root directory is mounted in binary mode. The makefile in the +auto directory provides the following build targets: +

    + + + + + + + + + + + + +
    makeCreate the source files from the descriptors.
    If the +descriptors do not exist, create them from the spec files.
    If the spec +files do not exist, download them from the OpenGL repository.
    make cleanDelete the source files.
    make clobberDelete the source files and the descriptors.
    make destroyDelete the source files, the descriptors, and the spec files.
    make customCreate the source files for the extensions +listed in auto/custom.txt.
    See "Custom Code +Generation" below for more details.
    + +

    Adding a New Extension

    + +

    +To add a new extension, create a descriptor file for the extension in +auto/core and rerun the code generation scripts by typing +make clean; make in the auto directory. +

    + +

    +The format of the descriptor file is given below. Items in +brackets are optional. +

    + +

    +<Extension Name>
    +[<URL of Specification File>]
    +    [<Token Name> <Token Value>]
    +    [<Token Name> <Token Value>]
    +    ...
    +    [<Typedef>]
    +    [<Typedef>]
    +    ...
    +    [<Function Signature>]
    +    [<Function Signature>]
    +    ...
    + +

    + + + +

    +Take a look at one of the files in auto/core for an +example. Note that typedefs and function signatures should not be +terminated with a semicolon. +

    + +

    Custom Code Generation

    +

    +Starting from GLEW 1.3.0, it is possible to control which extensions +to include in the libarary by specifying a list in +auto/custom.txt. This is useful when you do not need all the +extensions and would like to reduce the size of the source files. +Type make clean; make custom in the auto directory +to rerun the scripts with the custom list of extensions. +

    + +

    +For example, the following is the list of extensions needed to get GLEW and the +utilities to compile. +

    + +

    +WGL_ARB_extensions_string
    +WGL_ARB_multisample
    +WGL_ARB_pixel_format
    +WGL_ARB_pbuffer
    +WGL_EXT_extensions_string
    +WGL_ATI_pixel_format_float
    +WGL_NV_float_buffer
    +

    + +

    Multiple Rendering Contexts (GLEW MX)

    + +

    Starting with release 1.2.0, thread-safe support for multiple +rendering contexts, possibly with different capabilities, is +available. Since this is not required by most users, it is not added +to the binary releases to maintain compatibility between different +versions. To include multi-context support, you have to do the +following:

    +
      +
    1. Compile and use GLEW with the GLEW_MX preprocessor token +defined.
    2. +
    3. For each rendering context, create a GLEWContext object +that will be available as long as the rendering context exists.
    4. +
    5. Define a macro or function called glewGetContext() that +returns a pointer to the GLEWContext object associated with +the rendering context from which OpenGL/WGL/GLX calls are issued. This +dispatch mechanism is primitive, but generic. +
    6. Make sure that you call glewInit() after creating the +GLEWContext object in each rendering context. Note, that the +GLEWContext pointer returned by glewGetContext() has +to reside in global or thread-local memory. +
    + +

    Note that according to the MSDN +WGL documentation, you have to initialize the entry points for +every rendering context that use pixel formats with different +capabilities For example, the pixel formats provided by the generic +software OpenGL implementation by Microsoft vs. the hardware +accelerated pixel formats have different capabilities. GLEW by +default ignores this requirement, and does not define per-context +entry points (you can however do this using the steps described +above). Assuming a global namespace for the entry points works in +most situations, because typically all hardware accelerated pixel +formats provide the same entry points and capabilities. This means +that unless you use the multi-context version of GLEW, you need to +call glewInit() only once in your program, or more precisely, +once per process.

    + +

    Separate Namespace

    + +

    +To avoid name clashes when linking with libraries that include the +same symbols, extension entry points are declared in a separate +namespace (release 1.1.0 and up). This is achieved by aliasing OpenGL +function names to their GLEW equivalents. For instance, +glFancyFunction is simply an alias to +glewFancyFunction. The separate namespace does not effect +token and function pointer definitions. +

    + +

    Known Issues

    + +

    +GLEW requires GLX 1.2 for compatibility with GLUT. +

    + diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/basic.html b/thirdparty/glew/glew-1.9.0/auto/doc/basic.html new file mode 100644 index 0000000..693575b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/basic.html @@ -0,0 +1,180 @@ +

    Initializing GLEW

    +

    +First you need to create a valid OpenGL rendering context and call +glewInit() to initialize the extension entry points. If +glewInit() returns GLEW_OK, the initialization +succeeded and you can use the available extensions as well as core +OpenGL functionality. For example: +

    + +

    +#include <GL/glew.h>
    +#include <GL/glut.h>
    +...
    +glutInit(&argc, argv);
    +glutCreateWindow("GLEW Test");
    +GLenum err = glewInit();
    +if (GLEW_OK != err)
    +{
    +  /* Problem: glewInit failed, something is seriously wrong. */
    +  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
    +  ...
    +}
    +fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
    +

    + +

    Checking for Extensions

    + +

    +Starting from GLEW 1.1.0, you can find out if a particular extension +is available on your platform by querying globally defined variables +of the form GLEW_{extension_name}: +

    + +

    +if (GLEW_ARB_vertex_program)
    +{
    +  /* It is safe to use the ARB_vertex_program extension here. */
    +  glGenProgramsARB(...);
    +}
    +

    + +

    +In GLEW 1.0.x, a global structure was used for this task. To ensure +binary compatibility between releases, the struct was replaced with a +set of variables. +

    + +

    +You can also check for core OpenGL functionality. For example, to +see if OpenGL 1.3 is supported, do the following: +

    + +

    +if (GLEW_VERSION_1_3)
    +{
    +  /* Yay! OpenGL 1.3 is supported! */
    +}
    +

    + +

    +In general, you can check if GLEW_{extension_name} or +GLEW_VERSION_{version} is true or false. +

    + +

    +It is also possible to perform extension checks from string +input. Starting from the 1.3.0 release, use glewIsSupported +to check if the required core or extension functionality is +available: +

    + +

    +if (glewIsSupported("GL_VERSION_1_4  GL_ARB_point_sprite"))
    +{
    +  /* Great, we have OpenGL 1.4 + point sprites. */
    +}
    +

    + +

    +For extensions only, glewGetExtension provides a slower alternative +(GLEW 1.0.x-1.2.x). Note that in the 1.3.0 release +glewGetExtension was replaced with +glewIsSupported. +

    + +

    +if (glewGetExtension("GL_ARB_fragment_program"))
    +{
    +  /* Looks like ARB_fragment_program is supported. */
    +}
    +

    + +

    Experimental Drivers

    + +

    +GLEW obtains information on the supported extensions from the graphics +driver. Experimental or pre-release drivers, however, might not +report every available extension through the standard mechanism, in +which case GLEW will report it unsupported. To circumvent this +situation, the glewExperimental global switch can be turned +on by setting it to GL_TRUE before calling +glewInit(), which ensures that all extensions with valid +entry points will be exposed. +

    + +

    Platform Specific Extensions

    + +

    +Platform specific extensions are separated into two header files: +wglew.h and glxew.h, which define the available +WGL and GLX extensions. To determine if a certain +extension is supported, query WGLEW_{extension name} or +GLXEW_{extension_name}. For example: +

    + +

    +#include <GL/wglew.h>
    +
    +if (WGLEW_ARB_pbuffer)
    +{
    +  /* OK, we can use pbuffers. */
    +}
    +else
    +{
    +  /* Sorry, pbuffers will not work on this platform. */
    +}
    +

    + +

    +Alternatively, use wglewIsSupported or +glxewIsSupported to check for extensions from a string: +

    + +

    +if (wglewIsSupported("WGL_ARB_pbuffer"))
    +{
    +  /* OK, we can use pbuffers. */
    +}
    +

    + +

    Utilities

    + +

    +GLEW provides two command-line utilities: one for creating a list of +available extensions and visuals; and another for verifying extension +entry points. +

    + +

    visualinfo: extensions and visuals

    + +

    +visualinfo is an extended version of glxinfo. The +Windows version creates a file called visualinfo.txt, which +contains a list of available OpenGL, WGL, and GLU extensions as well +as a table of visuals aka. pixel formats. Pbuffer and MRT capable +visuals are also included. For additional usage information, type +visualinfo -h. +

    + +

    glewinfo: extension verification utility

    + +

    +glewinfo allows you to verify the entry points for the +extensions supported on your platform. The Windows version +reports the results to a text file called glewinfo.txt. The +Unix version prints the results to stdout. +

    + +

    Windows usage:

    +
    glewinfo [-pf <id>]
    + +

    where <id> is the pixel format id for which the +capabilities are displayed.

    + +

    Unix usage:

    +
    glewinfo [-display <dpy>] [-visual <id>]
    + +

    where <dpy> is the X11 display and <id> is +the visual id for which the capabilities are displayed.

    + diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/credits.html b/thirdparty/glew/glew-1.9.0/auto/doc/credits.html new file mode 100644 index 0000000..7f1b8d9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/credits.html @@ -0,0 +1,25 @@ +

    Credits

    + +

    +GLEW was developed by Milan +Ikits and Marcelo +Magallon. They also perform occasional maintainance to make sure +that GLEW stays in mint condition. Aaron Lefohn, Joe Kniss, and Chris +Wyman were the first users and also assisted with the design and +debugging process. The acronym GLEW originates from Aaron Lefohn. +Pasi Kärkkäinen identified and fixed several problems with +GLX and SDL. Nate Robins created the wglinfo utility, to +which modifications were made by Michael Wimmer. +

    + +

    Copyright

    + +

    +GLEW is originally derived from the EXTGL project by Lev Povalahev. +The source code is licensed under the Modified BSD +License, the Mesa 3-D License (MIT +License), and the Khronos License (MIT +License). The automatic code generation scripts are released under +the GNU GPL. +

    diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/index.html b/thirdparty/glew/glew-1.9.0/auto/doc/index.html new file mode 100644 index 0000000..2e6db99 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/index.html @@ -0,0 +1,105 @@ +

    +The OpenGL Extension Wrangler Library (GLEW) is a cross-platform +open-source C/C++ extension loading library. GLEW provides efficient +run-time mechanisms for determining which OpenGL extensions are +supported on the target platform. OpenGL core and extension +functionality is exposed in a single header file. GLEW has been +tested on a variety of operating systems, including Windows, Linux, +Mac OS X, FreeBSD, Irix, and Solaris. +

    + +

    Download Center

    +

    +GLEW is distributed +as source and precompiled binaries. The latest release is +1.9.0 +[08-06-12]: +

    +

    +

    +

    + + + +
    + + + + + + + + + + + + + + + +
    Source +ZIP |  +TGZ
    Binaries +Windows 32-bit |  +64-bit  +
    +
    +

    +

    +An up-to-date copy is also available from the project repository: +

    +

    +git clone git://glew.git.sourceforge.net/gitroot/glew/glew +

    + +

    Supported Extensions

    +

    +The latest release contains support for OpenGL 4.3 and the following extensions: +

    + + +

    News

    +
      +
    • [08-06-12] GLEW 1.9.0 adds support for OpenGL 4.3, new extensions
    • +
    • [07-17-12] GLEW 1.8.0 fixes minor bugs and adds new extensions
    • +
    • [08-26-11] GLEW 1.7.0 adds support for OpenGL 4.2, new extensions, fixes bugs
    • +
    • [04-27-11] GLEW 1.6.0 fixes minor bugs and adds eight new extensions
    • +
    • [01-31-11] GLEW 1.5.8 fixes minor bugs and adds two new extensions
    • +
    • [11-03-10] GLEW 1.5.7 fixes minor bugs and adds one new extension
    • +
    • [09-07-10] GLEW 1.5.6 adds support for OpenGL 4.1, fixes bugs
    • +
    • [07-13-10] GLEW 1.5.5 fixes minor bugs and adds new extensions
    • +
    • [04-21-10] GLEW 1.5.4 adds support for OpenGL 3.3, OpenGL 4.0 and new extensions, fixes bugs
    • +
    • [02-28-10] GLEW 1.5.3 fixes minor bugs and adds three new extensions
    • +
    • [12-31-09] GLEW 1.5.2 adds support for OpenGL 3.1, OpenGL 3.2 and new extensions
    • +
    • [11-03-08] GLEW 1.5.1 adds support for OpenGL 3.0 and 31 new extensions
    • +
    • [12-27-07] GLEW 1.5.0 is released under less restrictive licenses
    • +
    • [04-27-07] GLEW 1.4.0 is released
    • +
    • [03-08-07] GLEW is included in the NVIDIA OpenGL SDK
    • +
    • [03-04-07] GLEW 1.3.6 is released
    • +
    • [02-28-07] Repository is migrated to SVN
    • +
    • [02-25-07] GLEW is included in the OpenGL SDK
    • +
    • [11-21-06] GLEW 1.3.5 adds OpenGL 2.1 and NVIDIA G80 extensions
    • +
    • [03-04-06] GLEW 1.3.4 adds support for five new extensions
    • +
    • [05-16-05] GLEW 1.3.3 is released
    • +
    • [03-16-05] GLEW 1.3.2 adds support for GL_APPLE_pixel_buffer
    • +
    • [02-11-05] gljava and sdljava provide a Java binding to OpenGL via GLEW
    • +
    • [02-02-05] GLEW 1.3.1 adds support for GL_EXT_framebuffer_object
    • +
    • [01-04-05] GLEW 1.3.0 adds core OpenGL 2.0 support plus many enhancements
    • +
    • [12-22-04] GLEWpy Python wrapper announced
    • +
    • [12-12-04] Mailing lists created on sourceforge
    • +
    • [12-06-04] GLEW 1.2.5 adds new extensions and support for FreeBSD
    • +
    + +

    Links

    + + diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/install.html b/thirdparty/glew/glew-1.9.0/auto/doc/install.html new file mode 100644 index 0000000..448aafd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/install.html @@ -0,0 +1,126 @@ +

    Installation

    + +

    +To use the shared library version of GLEW, you need to copy the +headers and libraries into their destination directories. On Windows +this typically boils down to copying: +

    + + + + + + + + + + +
    bin/glew32.dll    to    %SystemRoot%/system32
    lib/glew32.lib    to    {VC Root}/Lib
    include/GL/glew.h    to    {VC Root}/Include/GL
    include/GL/wglew.h    to    {VC Root}/Include/GL
    +

    +

    + +

    +where {VC Root} is the Visual C++ root directory, typically +C:/Program Files/Microsoft Visual Studio/VC98 for Visual +Studio 6.0 or C:/Program Files/Microsoft Visual +Studio .NET 2003/Vc7/PlatformSDK for Visual Studio .NET. +

    + +

    +On Unix, typing make install will attempt to install GLEW +into /usr/include/GL and /usr/lib. You can +customize the installation target via the GLEW_DEST +environment variable if you do not have write access to these +directories. +

    + +

    Building Your Project with GLEW

    +

    +There are two ways to build your project with GLEW. +

    +

    Including the source files / project file

    +

    +The simpler but less flexible way is to include glew.h and +glew.c into your project. On Windows, you also need to +define the GLEW_STATIC preprocessor token when building a +static library or executable, and the GLEW_BUILD preprocessor +token when building a dll. You also need to replace +<GL/gl.h> and <GL/glu.h> with +<glew.h> in your code and set the appropriate include +flag (-I) to tell the compiler where to look for it. For +example: +

    +

    +#include <glew.h>
    +#include <GL/glut.h>
    +<gl, glu, and glut functionality is available here>
    +

    +

    +Depending on where you put glew.h you may also need to change +the include directives in glew.c. Note that if you are using +GLEW together with GLUT, you have to include glew.h first. +In addition, glew.h includes glu.h, so you do not +need to include it separately. +

    +

    +On Windows, you also have the option of adding the supplied project +file glew_static.dsp to your workspace (solution) and compile +it together with your other projects. In this case you also need to +change the GLEW_BUILD preprocessor constant to +GLEW_STATIC when building a static library or executable, +otherwise you get build errors. +

    +

    +Note that GLEW does not use the C +runtime library, so it does not matter which version (single-threaded, +multi-threaded or multi-threaded DLL) it is linked with (without +debugging information). It is, however, always a good idea to compile all +your projects including GLEW with the same C runtime settings. +

    + +

    Using GLEW as a shared library

    + +

    +Alternatively, you can use the provided project files / makefile to +build a separate shared library you can link your projects with later. +In this case the best practice is to install glew.h, +glew32.lib, and glew32.dll / libGLEW.so to +where the OpenGL equivalents gl.h, opengl32.lib, and +opengl32.dll / libGL.so are located. Note that you +need administrative privileges to do this. If you do not have +administrator access and your system administrator will not do it for +you, you can install GLEW into your own lib and include subdirectories +and tell the compiler where to find it. Then you can just replace +<GL/gl.h> with <GL/glew.h> in your +program: +

    + +

    +#include <GL/glew.h>
    +#include <GL/glut.h>
    +<gl, glu, and glut functionality is available here>
    +

    + +

    +or: +

    + +

    +#include <GL/glew.h>
    +<gl and glu functionality is available here>
    +

    + +

    +Remember to link your project with glew32.lib, +glu32.lib, and opengl32.lib on Windows and +libGLEW.so, libGLU.so, and libGL.so on +Unix (-lGLEW -lGLU -lGL). +

    + +

    +It is important to keep in mind that glew.h includes neither +windows.h nor gl.h. Also, GLEW will warn you by +issuing a preprocessor error in case you have included gl.h, +glext.h, or glATI.h before glew.h. +

    + diff --git a/thirdparty/glew/glew-1.9.0/auto/doc/log.html b/thirdparty/glew/glew-1.9.0/auto/doc/log.html new file mode 100644 index 0000000..ca6f619 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/doc/log.html @@ -0,0 +1,850 @@ +

    Change Log

    + +
    +
      +
    • 1.9.0 [08-06-12] +
        +
      • New features: +
          +
        • Support for OpenGL 4.2 +
        +
      • New extensions: +
          +
        • GL_ARB_ES3_compatibility +
        • GL_ARB_clear_buffer_object +
        • GL_ARB_compute_shader +
        • GL_ARB_copy_image +
        • GL_ARB_explicit_uniform_location +
        • GL_ARB_fragment_layer_viewport +
        • GL_ARB_framebuffer_no_attachments +
        • GL_ARB_internalformat_query2 +
        • GL_ARB_multi_draw_indirect +
        • GL_ARB_program_interface_query +
        • GL_ARB_robust_buffer_access_behavior +
        • GL_ARB_robustness_application_isolation +
        • GL_ARB_robustness_share_group_isolation +
        • GL_ARB_shader_image_size +
        • GL_ARB_shader_storage_buffer_object +
        • GL_ARB_stencil_texturing +
        • GL_ARB_texture_buffer_range +
        • GL_ARB_texture_query_levels +
        • GL_ARB_texture_storage_multisample +
        • GL_ARB_texture_view +
        • GL_ARB_vertex_attrib_binding +
        • GL_EXT_debug_marker +
        • GL_KHR_debug +
        • GL_REGAL_error_string +
        • GL_REGAL_extension_query +
        • GL_REGAL_log +
        • GLX_ARB_robustness_application_isolation +
        • GLX_ARB_robustness_share_group_isolation +
        • GLX_EXT_create_context_es_profile +
        • WGL_EXT_create_context_es_profile +
        +
      • Bug fixes: +
          +
        • Not using GLU library for Makefile builds. +
        +
      +
    + +
    +
      +
    • 1.8.0 [07-17-12] +
        +
      • New extensions: +
          +
        • GL_AMD_pinned_memory +
        • GL_AMD_query_buffer_object +
        • GL_AMD_stencil_operation_extended +
        • GL_AMD_vertex_shader_layer +
        • GL_AMD_vertex_shader_viewport_index +
        • GL_NV_bindless_texture +
        • GL_NV_shader_atomic_float +
        • GLX_EXT_swap_control_tear +
        • WGL_EXT_swap_control_tear +
        • WGL_NV_DX_interop2 +
        +
      • Bug fixes: +
          +
        • MS Visual Studio 2010 projects added +
        • GLX_NV_video_out replaces GLX_NV_video_output +
        • ANSI C prototype for glewInit +
        • Improved CentOS build support +
        • Improved GL_ARB_gpu_shader_fp64 support +
        • ARB_texture_compression_bptc and ARB_copy_buffer constants +
        • Linux needs to define GLEW_STATIC for static library builds +
        • Custom code generation problem resolved +
        • GLEWAPIENTRY added to glew.h for calling convention customization +
        • Correction for glPathStencilDepthOffsetNV +
        • Resolve OSX gcc warnings +
        • Added build support for NetBSD +
        +
      +
    + +
    +
      +
    • 1.7.0 [08-26-11] +
        +
      • New features: +
          +
        • Support for OpenGL 4.2 +
        +
      • New extensions: +
          +
        • GL_AMD_multi_draw_indirect +
        • GL_ARB_base_instance +
        • GL_ARB_compressed_texture_pixel_storage +
        • GL_ARB_conservative_depth +
        • GL_ARB_internalformat_query +
        • GL_ARB_map_buffer_alignment +
        • GL_ARB_shader_atomic_counters +
        • GL_ARB_shader_image_load_store +
        • GL_ARB_shading_language_420pack +
        • GL_ARB_shading_language_packing +
        • GL_ARB_texture_storage +
        • GL_ARB_transform_feedback_instanced +
        • GL_EXT_framebuffer_multisample_blit_scaled +
        • GL_NV_path_rendering +
        • GL_NV_path_rendering +
        • GLX_MESA_swap_control +
        +
      • Bug fixes: +
          +
        • const qualifiers for GL 1.4 MultiDrawArrays, MultiDrawElements +
        • Add glGetGraphicsResetStatusARB to GL_ARB_robustness +
        • Remove EXT suffix from GL_KTX_buffer_region entry points +
        • Solaris needs inttypes.h +
        • Add ERROR_INVALID_VERSION_ARB and ERROR_INVALID_PROFILE_ARB to WGL_ARB_create_context +
        • Add GLX_MESA_swap_control +
        • Set -install_name for OSX +
        • Add 64-bit darwin build option (SYSTEM=darwin_x86-64) +
        • Add GL_NV_path_rendering +
        +
      +
    + +
    +
      +
    • 1.6.0 [04-27-11] +
        +
      • New extensions: +
          +
        • GL_AMD_blend_minmax_factor +
        • GL_AMD_sample_positions +
        • GL_EXT_x11_sync_object +
        • GL_NV_texture_multisample +
        • GL_NV_video_capture +
        • GLX_NV_video_capture +
        • WGL_NV_DX_interop +
        • WGL_NV_video_capture +
        +
      • Bug fixes: +
          +
        • Define GLEW_NO_GLU for no glu dependency. +
        • mx suffix for GLEW MX libraries, build both libraries by default. +
        • Cygwin build improvements +
        • Soname of GLEWmx shared libraries +
        • Query GL extension string only once +
        • GLX_OML_sync_control no longer requires C99 +
        • glDraw*InstancedARB moved from GL_ARB_draw_instanced to GL_ARB_instanced_arrays +
        • glFramebufferTextureLayerEXT moved from GL_EXT_geometry_shader4 to GL_EXT_texture_array +
        • Fixes for BSD build +
        +
      +
    + +
    +
      +
    • 1.5.8 [01-31-11] +
        +
      • New extensions: +
          +
        • GL_AMD_depth_clamp_separate +
        • GL_EXT_texture_sRGB_decode +
        +
      • Bug fixes: +
          +
        • Borland C++ fix for __int64 +
        • GL_DOUBLE_MATNxM enumerants for OpenGL 4.0 +
        • Correction to glGetTransformFeedbackVarying +
        • Correction to glSecondaryColorPointer +
        • Corrections to glGetVertexAttribPointerv and glGetShaderSource +
        • Switched code repository from svn to git +
        +
      +
    + +
    +
      +
    • 1.5.7 [11-03-10] +
        +
      • New extension: +
          +
        • GL_NVX_gpu_memory_info +
        +
      • Bug fixes: +
          +
        • Improved mingw32 build support +
        • Improved cygwin build support +
        • glGetPointervEXT fix +
        • Add GLEW_VERSION_1_2_1 +
        +
      +
    + +
    +
      +
    • 1.5.6 [09-07-10] +
        +
      • New features: +
          +
        • Support for OpenGL 4.1 +
        +
      • New extensions: +
          +
        • GL_ARB_ES2_compatibility +
        • GL_ARB_cl_event +
        • GL_ARB_debug_output +
        • GL_ARB_get_program_binary +
        • GL_ARB_robustness +
        • GL_ARB_separate_shader_objects +
        • GL_ARB_shader_precision +
        • GL_ARB_shader_stencil_export +
        • GL_ARB_vertex_attrib_64bit +
        • GL_ARB_viewport_array +
        • GLX_ARB_create_context_robustness +
        • GLX_EXT_create_context_es2_profile +
        • WGL_ARB_create_context_robustness +
        • WGL_EXT_create_context_es2_profile +
        +
      +
    + +
    +
      +
    • 1.5.5 [07-13-10] +
        +
      • New extensions: +
          +
        • GL_AMD_debug_output +
        • GL_AMD_name_gen_delete +
        • GL_AMD_transform_feedback3_lines_triangles +
        • GL_NV_multisample_coverage +
        • GL_NV_vdpau_interop +
        • GLX_AMD_gpu_association +
        • GLX_NV_multisample_coverage +
        • WGL_NV_multisample_coverage +
        +
      • Bug fixes: +
          +
        • Compilation issue with GLX_SGI_video_sync +
        • OpenGL 4.0 double-precision uniform functions added +
        • Constness of glPointParameterfvARB and glPointParameterfvEXT +
        • Added glVertexAttribDivisor +
        • Compilation issue with Nvidia GLX headers +
        +
      +
    + +
    +
      +
    • 1.5.4 [04-21-10] +
        +
      • New features: +
          +
        • Support for OpenGL 3.3 +
        • Support for OpenGL 4.0 +
        +
      • New extensions: +
          +
        • GL_AMD_conservative_depth +
        • GL_ARB_blend_func_extended +
        • GL_ARB_draw_indirect +
        • GL_ARB_explicit_attrib_location +
        • GL_ARB_gpu_shader5 +
        • GL_ARB_gpu_shader_fp64 +
        • GL_ARB_occlusion_query2 +
        • GL_ARB_sampler_objects +
        • GL_ARB_shader_bit_encoding +
        • GL_ARB_shader_subroutine +
        • GL_ARB_shading_language_include +
        • GL_ARB_tessellation_shader +
        • GL_ARB_texture_buffer_object_rgb32 +
        • GL_ARB_texture_compression_bptc +
        • GL_ARB_texture_rgb10_a2ui +
        • GL_ARB_texture_swizzle +
        • GL_ARB_timer_query +
        • GL_ARB_transform_feedback2 +
        • GL_ARB_transform_feedback3 +
        • GL_ARB_vertex_type_2_10_10_10_rev +
        • GL_EXT_shader_image_load_store +
        • GL_EXT_vertex_attrib_64bit +
        • GL_NV_gpu_program5 +
        • GL_NV_gpu_program_fp64 +
        • GL_NV_gpu_shader5 +
        • GL_NV_tessellation_program5 +
        • GL_NV_vertex_attrib_integer_64bit +
        • GLX_ARB_vertex_buffer_object +
        +
      • Bug fixes: +
          +
        • Parameter constness fix for glPointParameteriv and glPointParameterfv +
        +
      +
    + +
    +
      +
    • 1.5.3 [02-28-10] +
        +
      • New extensions: +
          +
        • GLX_INTEL_swap_event +
        • GL_AMD_seamless_cubemap_per_texture +
        • GL_AMD_shader_stencil_export +
        +
      • Bug fixes: +
          +
        • Correct version detection for GL 3.1 and 3.2 +
        • Missing 3.1 enumerants +
        • Add glew.pc +
        +
      +
    + +
    +
      +
    • 1.5.2 [12-31-09] +
        +
      • New features: +
          +
        • Support for OpenGL 3.1 +
        • Support for OpenGL 3.2 +
        +
      • New extensions: +
          +
        • GL_AMD_draw_buffers_blend +
        • GL_AMD_performance_monitor +
        • GL_AMD_texture_texture4 +
        • GL_AMD_vertex_shader_tessellator +
        • GL_APPLE_aux_depth_stencil +
        • GL_APPLE_object_purgeable +
        • GL_APPLE_rgb_422 +
        • GL_APPLE_row_bytes +
        • GL_APPLE_vertex_program_evaluators +
        • GL_ARB_compatibility +
        • GL_ARB_copy_buffer +
        • GL_ARB_depth_clamp +
        • GL_ARB_draw_buffers_blend +
        • GL_ARB_draw_elements_base_vertex +
        • GL_ARB_fragment_coord_conventions +
        • GL_ARB_provoking_vertex +
        • GL_ARB_sample_shading +
        • GL_ARB_seamless_cube_map +
        • GL_ARB_shader_texture_lod +
        • GL_ARB_sync +
        • GL_ARB_texture_cube_map_array +
        • GL_ARB_texture_gather +
        • GL_ARB_texture_multisample +
        • GL_ARB_texture_query_lod +
        • GL_ARB_uniform_buffer_object +
        • GL_ARB_vertex_array_bgra +
        • GL_ATI_meminfo +
        • GL_EXT_provoking_vertex +
        • GL_EXT_separate_shader_objects +
        • GL_EXT_texture_snorm +
        • GL_NV_copy_image +
        • GL_NV_parameter_buffer_object2 +
        • GL_NV_shader_buffer_load +
        • GL_NV_texture_barrier +
        • GL_NV_transform_feedback2 +
        • GL_NV_vertex_buffer_unified_memory +
        • WGL_AMD_gpu_association +
        • WGL_ARB_create_context_profile +
        • WGL_NV_copy_image +
        • GLX_ARB_create_context_profile +
        • GLX_EXT_swap_control +
        • GLX_NV_copy_image +
        +
      • Bug fixes: +
          +
        • DOS line endings for windows .zip archives only. +
        • glTransformFeedbackVaryings arguments. +
        • Resource leak in glewinfo and visualinfo tools. +
        • WIN32_LEAN_AND_MEAN preprocessor pollution. +
        • Fixed version detection for GLEW_VERSION_2_1 and GLEW_VERSION_3_0. +
        • MesaGLUT glut.h GLAPIENTRY dependency. +
        • glFramebufferTextureLayer correction. +
        • OSX compiler warnings resolved. +
        • Cygwin linking to opengl32 by default, rather than X11 OpenGL. +
        • SnowLeopard (OSX 10.6) gl.h detection. +
        • Use $(STRIP) consistently. +
        +
      +
    + +
    +
      +
    • 1.5.1 [11-03-08] +
        +
      • New features: +
          +
        • Support for OpenGL 3.0 +
        +
      • New extensions: +
          +
        • GL_ARB_depth_buffer_float +
        • GL_ARB_draw_instance, +
        • GL_ARB_framebuffer_object +
        • GL_ARB_framebuffer_sRGB +
        • GL_ARB_geometry_shader4 +
        • GL_ARB_half_float_pixel +
        • GL_ARB_half_float_vertex +
        • GL_ARB_instanced_arrays +
        • GL_ARB_map_buffer_range +
        • GL_ARB_texture_buffer_object +
        • GL_ARB_texture_compression_rgtc +
        • GL_ARB_vertex_array_object +
        • GL_EXT_direct_state_access +
        • GL_EXT_texture_swizzle +
        • GL_EXT_transform_feedback +
        • GL_EXT_vertex_array_bgra +
        • GL_NV_conditional_render +
        • GL_NV_explicit_multisample +
        • GL_NV_present_video +
        • GL_SGIS_point_line_texgen +
        • GL_SGIX_convolution_accuracy +
        • WGL_ARB_create_context +
        • WGL_ARB_framebuffer_sRGB +
        • WGL_NV_present_video +
        • WGL_NV_swap_group +
        • WGL_NV_video_output +
        • GLX_ARB_create_context +
        • GLX_ARB_framebuffer_sRGB +
        • GLX_NV_present_video +
        • GLX_NV_swap_group +
        • GLX_NV_video_output +
        +
      • Bug fixes: +
          +
        • Licensing issues with documentation +
        • Problems with long long and _MSC_VER on MINGW +
        • Incorrect parameter for glGetUniformLocation +
        • glewGetExtension fails on last entry +
        • Incomplete GL_NV_texture_shader tokens +
        • Scripting problems on Cygwin +
        • Incorrect definition for GLint on OS X +
        +
      +
    + +
    +
      +
    • 1.5.0 [12-27-07] +
        +
      • New features: +
          +
        • Licensing change (BSD, Mesa 3-D, Khronos) +
        • Switch to using registry on www.opengl.org +
        • Support for major and minor version strings +
        +
      • New extensions: +
          +
        • GL_APPLE_flush_buffer_range +
        • GL_GREMEDY_frame_terminator +
        • GLX_EXT_texture_from_pixmap +
        +
      • Bug fixes: +
          +
        • Incorrent 64-bit type definitions +
        • Do not strip static library on install +
        • Missing tokens in GL_ATI_fragment_shader and WGL_{ARB,EXT}_make_current_read +
        • Missing tokens in GL_VERSION_2_1 +
        • Missing functions in GL_VERSION_1_4 +
        • Incorrect parameter type for glXCopyContext +
        +
      +
    +
    +
      +
    • 1.4.0 [04-27-07] +
        +
      • New features: +
          +
        • Extension variables are declared const to avoid possible +corruption of their values +
        +
      • New extensions: +
          +
        • GL_NV_depth_range_unclamped +
        +
      • Bug fixes: +
          +
        • Incorrect tokens in GL_NV_transform_feedback and GL_NV_framebuffer_multisample_coverage +
        • Incorrect function names in GL_EXT_gpu_program_parameters +
        • Missing tokens in GL_EXT_framebuffer_multisample +
        • GLEW_MX initialization problem for WGL_{ARB,EXT}_extensions_string +
        +
      +
    +
    +
      +
    • 1.3.6 [03-04-07] +
        +
      • New extensions: +
          +
        • GL_ATI_shader_texture_lod +
        • GL_EXT_gpu_program_parameters +
        • GL_NV_geometry_shader4 +
        • WGL_NV_gpu_affinity +
        • GLX_SGIX_hyperpipe +
        +
      • Bug fixes: +
          +
        • Missing include guards in glxew.h +
        • Makefile and install problems for Cygwin builds +
        • Install problem for Linux AMD64 builds +
        • Incorrent token in GL_ATI_texture_compression_3dc +
        • Missing tokens from GL_ATIX_point_sprites +
        +
      +
    +
    +
      +
    • 1.3.5 [11-21-06] +
        +
      • New features: +
          +
        • Support for core OpenGL 2.1 +
        • Debug support for glewIsSupported +
        +
      • New extensions: +
          +
        • GL_EXT_bindable_uniform +
        • GL_EXT_draw_buffers2 +
        • GL_EXT_draw_instanced +
        • GL_EXT_framebuffer_sRGB +
        • GL_EXT_geometry_shader4 +
        • GL_EXT_gpu_shader4 +
        • GL_EXT_packed_float +
        • GL_EXT_texture_array +
        • GL_EXT_texture_buffer_object +
        • GL_EXT_texture_compression_latc +
        • GL_EXT_texture_compression_rgtc +
        • GL_EXT_texture_integer +
        • GL_EXT_texture_shared_exponent +
        • GL_EXT_timer_query +
        • GL_NV_depth_buffer_float +
        • GL_NV_fragment_program4 +
        • GL_NV_framebuffer_multisample_coverage +
        • GL_NV_geometry_program4 +
        • GL_NV_gpu_program4 +
        • GL_NV_parameter_buffer_object +
        • GL_NV_transform_feedback +
        • GL_NV_vertex_program4 +
        • GL_OES_byte_coordinates +
        • GL_OES_compressed_paletted_texture +
        • GL_OES_read_format +
        • GL_OES_single_precision +
        • WGL_EXT_pixel_format_packed_float +
        • WGL_EXT_framebuffer_sRGB +
        • GLX_EXT_fbconfig_packed_float +
        • GLX_EXT_framebuffer_sRGB +
        +
      • Bug fixes: +
          +
        • Wrong GLXContext definition on Solaris +
        • Makefile problem for parallel builds +
        +
      +
    +
    +
      +
    • 1.3.4 [03-04-06] +
        +
      • New extensions: +
          +
        • GL_EXT_framebuffer_blit +
        • GL_EXT_framebuffer_multisample +
        • GL_EXT_packed_depth_stencil +
        • GL_MESAX_texture_stack +
        • WGL_3DL_stereo_control +
        +
      +
        +
      • Bug fixes: +
          +
        • glBlendEquation missing from GL_ARB_imaging +
        • Wrong APIENTRY definition for Cygwin +
        • Incorrect OS X OpenGL types +
        • Unix 64-bit installation patch +
        +
      +
    +
    +
      +
    • 1.3.3 [05-16-05] +
        +
      • New feature: +
          +
        • Code generation option to split source into multiple files +
        +
      +
        +
      • Bug fixes: +
          +
        • OpenGL 2.0 core initialization problems +
        • Wrong value for token GL_SHADER_TYPE +
        • Missing tokens in GL_ATI_fragment_shader +
        • Missing entry points in GL_ARB_transpose_matrix +
        +
      +
    +
    +
      +
    • 1.3.2 [03-16-05] +
        +
      • New extension: +
          +
        • GL_APPLE_pixel_buffer +
        +
      • Bug fixes: +
          +
        • Missing OpenGL 2.0 entry points +
        • Missing tokens in GL_SGIX_shadow +
        • MinGW makefile problem +
        • Check for incorrect OpenGL version string on SiS hardware +
        • Documentation update to meet the HTML 4.01 Transitional specification +
        +
      +
    +
    +
      +
    • 1.3.1 [02-02-05] +
        +
      • New features: +
          +
        • Consistent Unix and Windows versioning +
        +
      • New extensions: +
          +
        • GL_EXT_framebuffer_object +
        • GL_ARB_pixel_buffer_object +
        +
      • Bug fixes: +
          +
        • Missing OpenGL 2.0 tokens +
        • Incorrect typedefs (GLhandleARB and GLhalf) +
        • Borland compiler problems +
        +
      +
    +
    +
      +
    • 1.3.0 [01-04-05] +
        +
      • New features: +
          +
        • Support for core OpenGL 2.0 +
        • glewIsSupported provides efficient string-based extension checks +
        • Custom code generation from a list of extensions +
        • Makefile changes +
        +
      • New extensions: +
          +
        • WGL_ATI_render_texture_rectangle +
        +
      • Bug fixes: +
          +
        • Incorrect function signature in OpenGL 1.5 core +
        +
      +
    +
    +
      +
    • 1.2.5 [12-06-04] +
        +
      • New extensions: +
          +
        • GL_ATI_texture_compression_3dc +
        • GL_EXT_Cg_shader +
        • GL_EXT_draw_range_elements +
        • GL_KTX_buffer_region +
        +
      • Bug fixes: +
          +
        • OpenGL version detection bug +
        • Problems with wxWindows and MinGW compilation +
        • visualinfo compilation problem with GLEW_MX specified +
        • Wrong token name in OpenGL 1.5 core +
        +
      • Support for FreeBSD +
      +
    +
    +
      +
    • 1.2.4 [09-06-04] +
        +
      • Added ARB_draw_buffers and ARB_texture_rectangle +
      • Fixed bug in ARB_shader_objects +
      • Replaced wglinfo with visualinfo +
      +
    +
    +
      +
    • 1.2.3 [06-10-04] +
        +
      • Added GL_NV_fragment_program2, GL_NV_fragment_program_option, GL_NV_vertex_program2_option, GL_NV_vertex_program3 +
      • Bug fix in GL_ARB_vertex_blend +
      +
    +
    +
      +
    • 1.2.2 [05-08-04] +
        +
      • Added GL_EXT_pixel_buffer_object, removed GL_NV_element_array +
      • Fixed GLEW_MX problems +
      • Bug fix in GL_EXT_texture_rectangle and wglinfo +
      +
    +
    +
      +
    • 1.2.1 [03-18-04] +
        +
      • Bug fix in OpenGL version query (early release of 1.2.0 contained this bug) +
      • Bug fix in GL_ARB_shader_objects and temporary bug fix in GL_ARB_vertex_shader +
      • Added flags on GDI support and multisampling to wglinfo +
      +
    +
    +
      +
    • 1.2.0 [02-19-04] +
        +
      • Added full OpenGL 1.5 support +
      • Added support for multiple rendering contexts with different capabilities +
      • Added command line flags to glewinfo for selecting displays and visuals +
      • Added GLX_SGIS_multisample, GLX_SUN_video_resize, and GL_SUN_read_video_pixels +
      • Added MinGW/MSYS support +
      • Bug fixes in GL_ARB_shader_objects and the OS X build +
      +
    +
    +
      +
    • 1.1.4 [12-15-03] +
        +
      • Added GL_APPLE_float_pixels, GL_APPLE_texture_range, +GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, +GLX_ATI_pixel_format_float, and GLX_ATI_render_texture +
      • Bug fixes in GL_ATI_map_object_buffer and GL_ATI_fragment_shader +
      +
    +
    +
      +
    • 1.1.3 [10-28-03] +
        +
      • Added Solaris and Darwin support +
      • Added GL_ARB_fragment_shader, GL_ARB_shader_objects, and GL_ARB_vertex_shader +
      • Fixed bug in GL_WIN_swap_hint +
      • Removed glewinfo's dependency on GLUT +
      +
    +
    +
      +
    • 1.1.2 [09-15-03] +
        +
      • Removed dependency on WGL_{ARB,EXT}_extensions_string to make GLEW run on Matrox cards +
      • Added glewGetString for querying the GLEW version string +
      +
    +
    +
      +
    • 1.1.1 [08-11-03] +
        +
      • Added GLX_NV_float_buffer, GL_ARB_shading_language_100, and GL_ARB_texture_non_power_of_two +
      • Fixed bug in GL_ARB_vertex_buffer_object +
      • Minor updates in documentation +
      +
    +
    +
      +
    • 1.1.0 [07-08-03] +
        +
      • Added automatic code generation +
      • Added almost every extension in the registry +
      • Added separate namespace +
      • Added Irix support +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.7 [06-29-03] +
        +
      • Added GL_EXT_depth_bounds_test +
      • Fixed typos +
      +
    +
    +
      +
    • 1.0.6 [05-05-03] +
        +
      • Added ARB_vertex_buffer_object and NV_half_float +
      • Updated wglinfo +
      • Temporary Linux bug fixes (problems with SDL and MESA) +
      +
    +
    +
      +
    • 1.0.5 [02-17-03] +
        +
      • Bug fixes +
      • Added wglinfo +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.4 [02-02-03] +
        +
      • Added NV_texture_expand_normal +
      • Added mingw support +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.3 [01-09-03] +
        +
      • Cleaned up ATI extensions +
      • Changed function prototypes to match glext.h +
      • Added EXT_texture3D +
      • Fixed typos in ATI_vertex_attrib_array_object and ATI_draw_buffers +
      +
    +
    +
      +
    • 1.0.2 [12-21-02] +
        +
      • Added list of supported extensions to documentation +
      • Added NV_half_float and NV_texgen_emboss +
      +
    +
    +
      +
    • 1.0.1 [12-17-02] +
        +
      • Bug fixes +
      • Added glewGetExtension +
      +
    +
    +
      +
    • 1.0.0 [12-12-02] +
        +
      • Initial release +
      +
    +
    + diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/.dummy b/thirdparty/glew/glew-1.9.0/auto/extensions/.dummy new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/.dummy diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_3DFX_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_3DFX_multisample new file mode 100644 index 0000000..01b2150 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_3DFX_multisample @@ -0,0 +1,5 @@ +GLX_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/3dfx_multisample.txt +GLX_3DFX_multisample + GLX_SAMPLE_BUFFERS_3DFX 0x8050 + GLX_SAMPLES_3DFX 0x8051 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_AMD_gpu_association b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_AMD_gpu_association new file mode 100644 index 0000000..e5561d9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_AMD_gpu_association @@ -0,0 +1,13 @@ +GLX_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/glx_gpu_association.txt +GLX_AMD_gpu_association + GLX_GPU_VENDOR_AMD 0x1F00 + GLX_GPU_RENDERER_STRING_AMD 0x1F01 + GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + GLX_GPU_RAM_AMD 0x21A3 + GLX_GPU_CLOCK_AMD 0x21A4 + GLX_GPU_NUM_PIPES_AMD 0x21A5 + GLX_GPU_NUM_SIMD_AMD 0x21A6 + GLX_GPU_NUM_RB_AMD 0x21A7 + GLX_GPU_NUM_SPI_AMD 0x21A8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context new file mode 100644 index 0000000..f7b7de6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context @@ -0,0 +1,9 @@ +GLX_ARB_create_context +http://www.opengl.org/registry/specs/ARB/glx_create_context.txt +GLX_ARB_create_context + GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 + GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 + GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 + GLX_CONTEXT_FLAGS_ARB 0x2094 + GLXContext glXCreateContextAttribsARB (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_profile new file mode 100644 index 0000000..15540ce --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_profile @@ -0,0 +1,6 @@ +GLX_ARB_create_context_profile +http://www.opengl.org/registry/specs/ARB/glx_create_context.txt +GLX_ARB_create_context_profile + GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 + GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 + GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_robustness b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_robustness new file mode 100644 index 0000000..ae37863 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_create_context_robustness @@ -0,0 +1,7 @@ +GLX_ARB_create_context_robustness +http://www.opengl.org/registry/specs/ARB/glx_create_context_robustness.txt +GLX_ARB_create_context_robustness + GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 + GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GLX_NO_RESET_NOTIFICATION_ARB 0x8261 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_fbconfig_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_fbconfig_float new file mode 100644 index 0000000..0e93c1b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_fbconfig_float @@ -0,0 +1,5 @@ +GLX_ARB_fbconfig_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +GLX_ARB_fbconfig_float + GLX_RGBA_FLOAT_BIT 0x00000004 + GLX_RGBA_FLOAT_TYPE 0x20B9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_framebuffer_sRGB new file mode 100644 index 0000000..b1b0ced --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_framebuffer_sRGB @@ -0,0 +1,4 @@ +GLX_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +GLX_ARB_framebuffer_sRGB + GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_get_proc_address b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_get_proc_address new file mode 100644 index 0000000..5c066d7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_get_proc_address @@ -0,0 +1,4 @@ +GLX_ARB_get_proc_address +http://oss.sgi.com/projects/ogl-sample/registry/ARB/get_proc_address.txt +GLX_ARB_get_proc_address + extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_multisample new file mode 100644 index 0000000..abae704 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_multisample @@ -0,0 +1,5 @@ +GLX_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +GLX_ARB_multisample + GLX_SAMPLE_BUFFERS_ARB 100000 + GLX_SAMPLES_ARB 100001 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_application_isolation b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_application_isolation new file mode 100644 index 0000000..9966ed8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_application_isolation @@ -0,0 +1,4 @@ +GLX_ARB_robustness_application_isolation +http://www.opengl.org/registry/specs/ARB/glx_robustness_isolation.txt +GLX_ARB_robustness_application_isolation + GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_share_group_isolation b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_share_group_isolation new file mode 100644 index 0000000..450877f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_robustness_share_group_isolation @@ -0,0 +1,4 @@ +GLX_ARB_robustness_share_group_isolation +http://www.opengl.org/registry/specs/ARB/glx_robustness_isolation.txt +GLX_ARB_robustness_share_group_isolation + GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_vertex_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_vertex_buffer_object new file mode 100644 index 0000000..cb570ce --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ARB_vertex_buffer_object @@ -0,0 +1,4 @@ +GLX_ARB_vertex_buffer_object +http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt +GLX_ARB_vertex_buffer_object + GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_pixel_format_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_pixel_format_float new file mode 100644 index 0000000..854ca71 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_pixel_format_float @@ -0,0 +1,4 @@ +GLX_ATI_pixel_format_float + +GLX_ATI_pixel_format_float + GLX_RGBA_FLOAT_ATI_BIT 0x00000100 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_render_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_render_texture new file mode 100644 index 0000000..254eb9f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_ATI_render_texture @@ -0,0 +1,41 @@ +GLX_ATI_render_texture + +GLX_ATI_render_texture + GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 + GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 + GLX_TEXTURE_FORMAT_ATI 0x9802 + GLX_TEXTURE_TARGET_ATI 0x9803 + GLX_MIPMAP_TEXTURE_ATI 0x9804 + GLX_TEXTURE_RGB_ATI 0x9805 + GLX_TEXTURE_RGBA_ATI 0x9806 + GLX_NO_TEXTURE_ATI 0x9807 + GLX_TEXTURE_CUBE_MAP_ATI 0x9808 + GLX_TEXTURE_1D_ATI 0x9809 + GLX_TEXTURE_2D_ATI 0x980A + GLX_MIPMAP_LEVEL_ATI 0x980B + GLX_CUBE_MAP_FACE_ATI 0x980C + GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D + GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E + GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 + GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 + GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 + GLX_FRONT_LEFT_ATI 0x9813 + GLX_FRONT_RIGHT_ATI 0x9814 + GLX_BACK_LEFT_ATI 0x9815 + GLX_BACK_RIGHT_ATI 0x9816 + GLX_AUX0_ATI 0x9817 + GLX_AUX1_ATI 0x9818 + GLX_AUX2_ATI 0x9819 + GLX_AUX3_ATI 0x981A + GLX_AUX4_ATI 0x981B + GLX_AUX5_ATI 0x981C + GLX_AUX6_ATI 0x981D + GLX_AUX7_ATI 0x981E + GLX_AUX8_ATI 0x981F + GLX_AUX9_ATI 0x9820 + GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 + GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + void glXBindTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXReleaseTexImageATI (Display *dpy, GLXPbuffer pbuf, int buffer) + void glXDrawableAttribATI (Display *dpy, GLXDrawable draw, const int *attrib_list) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es2_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es2_profile new file mode 100644 index 0000000..3093baa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es2_profile @@ -0,0 +1,4 @@ +GLX_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es2_profile.txt +GLX_EXT_create_context_es2_profile + GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es_profile new file mode 100644 index 0000000..845f65e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_create_context_es_profile @@ -0,0 +1,4 @@ +GLX_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/glx_create_context_es_profile.txt +GLX_EXT_create_context_es_profile + GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_fbconfig_packed_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_fbconfig_packed_float new file mode 100644 index 0000000..7c7822d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_fbconfig_packed_float @@ -0,0 +1,5 @@ +GLX_EXT_fbconfig_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GLX_EXT_fbconfig_packed_float + GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_framebuffer_sRGB new file mode 100644 index 0000000..f51c484 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_framebuffer_sRGB @@ -0,0 +1,4 @@ +GLX_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GLX_EXT_framebuffer_sRGB + GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_import_context b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_import_context new file mode 100644 index 0000000..ecca5fd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_import_context @@ -0,0 +1,11 @@ +GLX_EXT_import_context +http://www.opengl.org/registry/specs/EXT/import_context.txt +GLX_EXT_import_context + GLX_SHARE_CONTEXT_EXT 0x800A + GLX_VISUAL_ID_EXT 0x800B + GLX_SCREEN_EXT 0x800C + void glXFreeContextEXT (Display* dpy, GLXContext context) + GLXContextID glXGetContextIDEXT (const GLXContext context) + GLXContext glXImportContextEXT (Display* dpy, GLXContextID contextID) + int glXQueryContextInfoEXT (Display* dpy, GLXContext context, int attribute,int *value) + typedef XID GLXContextID diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_scene_marker b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_scene_marker new file mode 100644 index 0000000..5c3fa86 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_scene_marker @@ -0,0 +1,3 @@ +GLX_EXT_scene_marker +http://www.opengl.org/registry/specs/EXT/scene_marker.txt +GLX_EXT_scene_marker diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control new file mode 100644 index 0000000..56372c0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control @@ -0,0 +1,6 @@ +GLX_EXT_swap_control +http://www.opengl.org/registry/specs/EXT/swap_control.txt +GLX_EXT_swap_control + GLX_SWAP_INTERVAL_EXT 0x20F1 + GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + void glXSwapIntervalEXT (Display* dpy, GLXDrawable drawable, int interval) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control_tear b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control_tear new file mode 100644 index 0000000..e80d58c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_swap_control_tear @@ -0,0 +1,4 @@ +GLX_EXT_swap_control_tear +http://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt +GLX_EXT_swap_control_tear + GLX_LATE_SWAPS_TEAR_EXT 0x20F3 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_texture_from_pixmap b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_texture_from_pixmap new file mode 100644 index 0000000..f835207 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_texture_from_pixmap @@ -0,0 +1,36 @@ +GLX_EXT_texture_from_pixmap +http://www.opengl.org/registry/specs/EXT/texture_from_pixmap.txt +GLX_EXT_texture_from_pixmap + GLX_TEXTURE_1D_BIT_EXT 0x00000001 + GLX_TEXTURE_2D_BIT_EXT 0x00000002 + GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 + GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 + GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 + GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 + GLX_Y_INVERTED_EXT 0x20D4 + GLX_TEXTURE_FORMAT_EXT 0x20D5 + GLX_TEXTURE_TARGET_EXT 0x20D6 + GLX_MIPMAP_TEXTURE_EXT 0x20D7 + GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 + GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 + GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + GLX_TEXTURE_1D_EXT 0x20DB + GLX_TEXTURE_2D_EXT 0x20DC + GLX_TEXTURE_RECTANGLE_EXT 0x20DD + GLX_FRONT_LEFT_EXT 0x20DE + GLX_FRONT_RIGHT_EXT 0x20DF + GLX_BACK_LEFT_EXT 0x20E0 + GLX_BACK_RIGHT_EXT 0x20E1 + GLX_AUX0_EXT 0x20E2 + GLX_AUX1_EXT 0x20E3 + GLX_AUX2_EXT 0x20E4 + GLX_AUX3_EXT 0x20E5 + GLX_AUX4_EXT 0x20E6 + GLX_AUX5_EXT 0x20E7 + GLX_AUX6_EXT 0x20E8 + GLX_AUX7_EXT 0x20E9 + GLX_AUX8_EXT 0x20EA + GLX_AUX9_EXT 0x20EB + void glXBindTexImageEXT (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list) + void glXReleaseTexImageEXT (Display* display, GLXDrawable drawable, int buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_info b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_info new file mode 100644 index 0000000..7db919c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_info @@ -0,0 +1,19 @@ +GLX_EXT_visual_info +http://www.opengl.org/registry/specs/EXT/visual_info.txt +GLX_EXT_visual_info + GLX_X_VISUAL_TYPE_EXT 0x22 + GLX_TRANSPARENT_TYPE_EXT 0x23 + GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 + GLX_TRANSPARENT_RED_VALUE_EXT 0x25 + GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 + GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 + GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 + GLX_NONE_EXT 0x8000 + GLX_TRUE_COLOR_EXT 0x8002 + GLX_DIRECT_COLOR_EXT 0x8003 + GLX_PSEUDO_COLOR_EXT 0x8004 + GLX_STATIC_COLOR_EXT 0x8005 + GLX_GRAY_SCALE_EXT 0x8006 + GLX_STATIC_GRAY_EXT 0x8007 + GLX_TRANSPARENT_RGB_EXT 0x8008 + GLX_TRANSPARENT_INDEX_EXT 0x8009 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_rating b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_rating new file mode 100644 index 0000000..fc86674 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_EXT_visual_rating @@ -0,0 +1,6 @@ +GLX_EXT_visual_rating +http://www.opengl.org/registry/specs/EXT/visual_rating.txt +GLX_EXT_visual_rating + GLX_VISUAL_CAVEAT_EXT 0x20 + GLX_SLOW_VISUAL_EXT 0x8001 + GLX_NON_CONFORMANT_VISUAL_EXT 0x800D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_INTEL_swap_event b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_INTEL_swap_event new file mode 100644 index 0000000..d9a7f7c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_INTEL_swap_event @@ -0,0 +1,7 @@ +GLX_INTEL_swap_event +http://www.opengl.org/registry/specs/INTEL/swap_event.txt +GLX_INTEL_swap_event + GLX_EXCHANGE_COMPLETE_INTEL 0x8180 + GLX_COPY_COMPLETE_INTEL 0x8181 + GLX_FLIP_COMPLETE_INTEL 0x8182 + GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_agp_offset b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_agp_offset new file mode 100644 index 0000000..5f307cd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_agp_offset @@ -0,0 +1,4 @@ +GLX_MESA_agp_offset +http://www.opengl.org/registry/specs/MESA/agp_offset.txt +GLX_MESA_agp_offset + unsigned int glXGetAGPOffsetMESA (const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_copy_sub_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_copy_sub_buffer new file mode 100644 index 0000000..b6557e7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_copy_sub_buffer @@ -0,0 +1,4 @@ +GLX_MESA_copy_sub_buffer +http://www.opengl.org/registry/specs/MESA/copy_sub_buffer.txt +GLX_MESA_copy_sub_buffer + void glXCopySubBufferMESA (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_pixmap_colormap b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_pixmap_colormap new file mode 100644 index 0000000..e59956c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_pixmap_colormap @@ -0,0 +1,4 @@ +GLX_MESA_pixmap_colormap +http://www.opengl.org/registry/specs/MESA/pixmap_colormap.txt +GLX_MESA_pixmap_colormap + GLXPixmap glXCreateGLXPixmapMESA (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_release_buffers b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_release_buffers new file mode 100644 index 0000000..cfd1091 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_release_buffers @@ -0,0 +1,4 @@ +GLX_MESA_release_buffers +http://www.opengl.org/registry/specs/MESA/release_buffers.txt +GLX_MESA_release_buffers + Bool glXReleaseBuffersMESA (Display* dpy, GLXDrawable d) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_set_3dfx_mode b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_set_3dfx_mode new file mode 100644 index 0000000..03a263d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_set_3dfx_mode @@ -0,0 +1,6 @@ +GLX_MESA_set_3dfx_mode +http://www.opengl.org/registry/specs/MESA/set_3dfx_mode.txt +GLX_MESA_set_3dfx_mode + GLX_3DFX_WINDOW_MODE_MESA 0x1 + GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + GLboolean glXSet3DfxModeMESA (GLint mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_swap_control b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_swap_control new file mode 100644 index 0000000..4416519 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_MESA_swap_control @@ -0,0 +1,5 @@ +GLX_MESA_swap_control +http://cgit.freedesktop.org/mesa/mesa/plain/docs/MESA_swap_control.spec +GLX_MESA_swap_control + int glXGetSwapIntervalMESA (void) + int glXSwapIntervalMESA (unsigned int interval) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_copy_image b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_copy_image new file mode 100644 index 0000000..acaef8c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_copy_image @@ -0,0 +1,4 @@ +GLX_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +GLX_NV_copy_image + void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_float_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_float_buffer new file mode 100644 index 0000000..cc9185e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_float_buffer @@ -0,0 +1,4 @@ +GLX_NV_float_buffer +http://cvs1.nvidia.com/inc/GL/glxtokens.h +GLX_NV_float_buffer + GLX_FLOAT_COMPONENTS_NV 0x20B0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_multisample_coverage b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_multisample_coverage new file mode 100644 index 0000000..ccd3b5c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_multisample_coverage @@ -0,0 +1,5 @@ +GLX_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +GLX_NV_multisample_coverage + GLX_COLOR_SAMPLES_NV 0x20B3 + GLX_COVERAGE_SAMPLES_NV 100001 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_present_video b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_present_video new file mode 100644 index 0000000..0078079 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_present_video @@ -0,0 +1,6 @@ +GLX_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GLX_NV_present_video + GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + int glXBindVideoDeviceNV (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list) + unsigned int* glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_swap_group b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_swap_group new file mode 100644 index 0000000..ec40bca --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_swap_group @@ -0,0 +1,9 @@ +GLX_NV_swap_group +http://www.opengl.org/registry/specs/NV/glx_swap_group.txt +GLX_NV_swap_group + Bool glXBindSwapBarrierNV (Display* dpy, GLuint group, GLuint barrier) + Bool glXJoinSwapGroupNV (Display* dpy, GLXDrawable drawable, GLuint group) + Bool glXQueryFrameCountNV (Display* dpy, int screen, GLuint *count) + Bool glXQueryMaxSwapGroupsNV (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers) + Bool glXQuerySwapGroupNV (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier) + Bool glXResetFrameCountNV (Display* dpy, int screen) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_vertex_array_range new file mode 100644 index 0000000..11afe17 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_vertex_array_range @@ -0,0 +1,5 @@ +GLX_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +GLX_NV_vertex_array_range + void * glXAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void glXFreeMemoryNV (void *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_capture b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_capture new file mode 100644 index 0000000..8dfd00a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_capture @@ -0,0 +1,12 @@ +GLX_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +GLX_NV_video_capture + GLX_DEVICE_ID_NV 0x20CD + GLX_UNIQUE_ID_NV 0x20CE + GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + int glXBindVideoCaptureDeviceNV (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device) + GLXVideoCaptureDeviceNV * glXEnumerateVideoCaptureDevicesNV (Display* dpy, int screen, int *nelements) + void glXLockVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device) + int glXQueryVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value) + void glXReleaseVideoCaptureDeviceNV (Display* dpy, GLXVideoCaptureDeviceNV device) + typedef XID GLXVideoCaptureDeviceNV diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_out b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_out new file mode 100644 index 0000000..ecfe318 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_NV_video_out @@ -0,0 +1,19 @@ +GLX_NV_video_out +http://www.opengl.org/registry/specs/NV/glx_video_out.txt +GLX_NV_video_out + GLX_VIDEO_OUT_COLOR_NV 0x20C3 + GLX_VIDEO_OUT_ALPHA_NV 0x20C4 + GLX_VIDEO_OUT_DEPTH_NV 0x20C5 + GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 + GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 + GLX_VIDEO_OUT_FRAME_NV 0x20C8 + GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 + GLX_VIDEO_OUT_FIELD_2_NV 0x20CA + GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB + GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + int glXBindVideoImageNV (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer) + int glXGetVideoDeviceNV (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice) + int glXGetVideoInfoNV (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo) + int glXReleaseVideoDeviceNV (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice) + int glXReleaseVideoImageNV (Display* dpy, GLXPbuffer pbuf) + int glXSendPbufferToVideoNV (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_swap_method b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_swap_method new file mode 100644 index 0000000..1ad2d4f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_swap_method @@ -0,0 +1,7 @@ +GLX_OML_swap_method +http://www.opengl.org/registry/specs/OML/glx_swap_method.txt +GLX_OML_swap_method + GLX_SWAP_METHOD_OML 0x8060 + GLX_SWAP_EXCHANGE_OML 0x8061 + GLX_SWAP_COPY_OML 0x8062 + GLX_SWAP_UNDEFINED_OML 0x8063 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_sync_control b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_sync_control new file mode 100644 index 0000000..5de293b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_OML_sync_control @@ -0,0 +1,8 @@ +GLX_OML_sync_control +http://www.opengl.org/registry/specs/OML/glx_sync_control.txt +GLX_OML_sync_control + Bool glXGetMscRateOML (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator) + Bool glXGetSyncValuesOML (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc) + int64_t glXSwapBuffersMscOML (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) + Bool glXWaitForMscOML (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc) + Bool glXWaitForSbcOML (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_blended_overlay b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_blended_overlay new file mode 100644 index 0000000..27cc982 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_blended_overlay @@ -0,0 +1,4 @@ +GLX_SGIS_blended_overlay +http://www.opengl.org/registry/specs/SGIS/blended_overlay.txt +GLX_SGIS_blended_overlay + GLX_BLENDED_RGBA_SGIS 0x8025 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_color_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_color_range new file mode 100644 index 0000000..5416dcb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_color_range @@ -0,0 +1,12 @@ +GLX_SGIS_color_range +http://www.opengl.org/registry/specs/SGIS/color_range.txt +GLX_SGIS_color_range + GLX_MAX_GREEN_SGIS 0 + GLX_MIN_RED_SGIS 0 + GLX_MIN_BLUE_SGIS 0 + GLX_MAX_RED_SGIS 0 + GLX_MAX_ALPHA_SGIS 0 + GLX_MIN_GREEN_SGIS 0 + GLX_MIN_ALPHA_SGIS 0 + GLX_EXTENDED_RANGE_SGIS 0 + GLX_MAX_BLUE_SGIS 0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_multisample new file mode 100644 index 0000000..9d22b47 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_multisample @@ -0,0 +1,5 @@ +GLX_SGIS_multisample +http://www.opengl.org/registry/specs/SGIS/multisample.txt +GLX_SGIS_multisample + GLX_SAMPLE_BUFFERS_SGIS 100000 + GLX_SAMPLES_SGIS 100001 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_shared_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_shared_multisample new file mode 100644 index 0000000..274e90f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIS_shared_multisample @@ -0,0 +1,5 @@ +GLX_SGIS_shared_multisample + +GLX_SGIS_shared_multisample + GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 + GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_fbconfig b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_fbconfig new file mode 100644 index 0000000..ac0d049 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_fbconfig @@ -0,0 +1,22 @@ +GLX_SGIX_fbconfig +http://www.opengl.org/registry/specs/SGIX/fbconfig.txt +GLX_SGIX_fbconfig + GLX_WINDOW_BIT_SGIX 0x00000001 + GLX_RGBA_BIT_SGIX 0x00000001 + GLX_PIXMAP_BIT_SGIX 0x00000002 + GLX_COLOR_INDEX_BIT_SGIX 0x00000002 + GLX_SCREEN_EXT 0x800C + GLX_DRAWABLE_TYPE_SGIX 0x8010 + GLX_RENDER_TYPE_SGIX 0x8011 + GLX_X_RENDERABLE_SGIX 0x8012 + GLX_FBCONFIG_ID_SGIX 0x8013 + GLX_RGBA_TYPE_SGIX 0x8014 + GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + GLXFBConfigSGIX* glXChooseFBConfigSGIX (Display *dpy, int screen, const int *attrib_list, int *nelements) + GLXContext glXCreateContextWithConfigSGIX (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) + GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display* dpy, GLXFBConfig config, Pixmap pixmap) + int glXGetFBConfigAttribSGIX (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value) + GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display* dpy, XVisualInfo *vis) + XVisualInfo* glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfig config) + typedef XID GLXFBConfigIDSGIX + typedef struct __GLXFBConfigRec *GLXFBConfigSGIX diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_hyperpipe b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_hyperpipe new file mode 100644 index 0000000..79ec302 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_hyperpipe @@ -0,0 +1,25 @@ +GLX_SGIX_hyperpipe +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/hyperpipe_group.txt +GLX_SGIX_hyperpipe + GLX_HYPERPIPE_ID_SGIX 0x8030 + GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 + GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 + GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 + GLX_PIPE_RECT_SGIX 0x00000001 + GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 + GLX_HYPERPIPE_STEREO_SGIX 0x00000003 + GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 + GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 + GLX_BAD_HYPERPIPE_SGIX 92 + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect; + typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits; + GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes) + int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId) + GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes) + int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId) + int glXBindHyperpipeSGIX (Display *dpy, int hpId) + int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList) + int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList) + int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_pbuffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_pbuffer new file mode 100644 index 0000000..4acf71c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_pbuffer @@ -0,0 +1,35 @@ +GLX_SGIX_pbuffer +http://www.opengl.org/registry/specs/SGIX/pbuffer.txt +GLX_SGIX_pbuffer + GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 + GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 + GLX_PBUFFER_BIT_SGIX 0x00000004 + GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 + GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 + GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 + GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 + GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 + GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 + GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 + GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 + GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 + GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 + GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 + GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A + GLX_PRESERVED_CONTENTS_SGIX 0x801B + GLX_LARGEST_PBUFFER_SGIX 0x801C + GLX_WIDTH_SGIX 0x801D + GLX_HEIGHT_SGIX 0x801E + GLX_EVENT_MASK_SGIX 0x801F + GLX_DAMAGED_SGIX 0x8020 + GLX_SAVED_SGIX 0x8021 + GLX_WINDOW_SGIX 0x8022 + GLX_PBUFFER_SGIX 0x8023 + GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + GLXPbuffer glXCreateGLXPbufferSGIX (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list) + void glXDestroyGLXPbufferSGIX (Display* dpy, GLXPbuffer pbuf) + void glXGetSelectedEventSGIX (Display* dpy, GLXDrawable drawable, unsigned long *mask) + void glXQueryGLXPbufferSGIX (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value) + void glXSelectEventSGIX (Display* dpy, GLXDrawable drawable, unsigned long mask) + typedef XID GLXPbufferSGIX + typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_barrier b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_barrier new file mode 100644 index 0000000..57dd60d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_barrier @@ -0,0 +1,5 @@ +GLX_SGIX_swap_barrier +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_barrier.txt +GLX_SGIX_swap_barrier + void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier) + Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_group b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_group new file mode 100644 index 0000000..3530604 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_swap_group @@ -0,0 +1,4 @@ +GLX_SGIX_swap_group +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/swap_group.txt +GLX_SGIX_swap_group + void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_video_resize b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_video_resize new file mode 100644 index 0000000..cc91996 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_video_resize @@ -0,0 +1,10 @@ +GLX_SGIX_video_resize +http://www.opengl.org/registry/specs/SGIX/video_resize.txt +GLX_SGIX_video_resize + GLX_SYNC_FRAME_SGIX 0x00000000 + GLX_SYNC_SWAP_SGIX 0x00000001 + int glXBindChannelToWindowSGIX (Display* display, int screen, int channel, Window window) + int glXChannelRectSGIX (Display* display, int screen, int channel, int x, int y, int w, int h) + int glXChannelRectSyncSGIX (Display* display, int screen, int channel, GLenum synctype) + int glXQueryChannelDeltasSGIX (Display* display, int screen, int channel, int *x, int *y, int *w, int *h) + int glXQueryChannelRectSGIX (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_visual_select_group b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_visual_select_group new file mode 100644 index 0000000..6c00691 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGIX_visual_select_group @@ -0,0 +1,4 @@ +GLX_SGIX_visual_select_group +http://www.opengl.org/registry/specs/SGIX/visual_select_group.txt +GLX_SGIX_visual_select_group + GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_cushion b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_cushion new file mode 100644 index 0000000..ce47e63 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_cushion @@ -0,0 +1,4 @@ +GLX_SGI_cushion +http://www.opengl.org/registry/specs/SGI/cushion.txt +GLX_SGI_cushion + void glXCushionSGI (Display* dpy, Window window, float cushion) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_make_current_read b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_make_current_read new file mode 100644 index 0000000..857611e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_make_current_read @@ -0,0 +1,5 @@ +GLX_SGI_make_current_read +http://www.opengl.org/registry/specs/SGI/make_current_read.txt +GLX_SGI_make_current_read + GLXDrawable glXGetCurrentReadDrawableSGI (void) + Bool glXMakeCurrentReadSGI (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_swap_control b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_swap_control new file mode 100644 index 0000000..bab97bd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_swap_control @@ -0,0 +1,4 @@ +GLX_SGI_swap_control +http://www.opengl.org/registry/specs/SGI/swap_control.txt +GLX_SGI_swap_control + int glXSwapIntervalSGI (int interval) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_video_sync b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_video_sync new file mode 100644 index 0000000..dcdb968 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SGI_video_sync @@ -0,0 +1,5 @@ +GLX_SGI_video_sync +http://www.opengl.org/registry/specs/SGI/video_sync.txt +GLX_SGI_video_sync + int glXGetVideoSyncSGI (unsigned int* count) + int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int* count) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_get_transparent_index b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_get_transparent_index new file mode 100644 index 0000000..f3b3b64 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_get_transparent_index @@ -0,0 +1,4 @@ +GLX_SUN_get_transparent_index +http://www.opengl.org/registry/specs/SUN/get_transparent_index.txt +GLX_SUN_get_transparent_index + Status glXGetTransparentIndexSUN (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_video_resize b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_video_resize new file mode 100644 index 0000000..0a0cefe --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GLX_SUN_video_resize @@ -0,0 +1,7 @@ +GLX_SUN_video_resize +http://wwws.sun.com/software/graphics/opengl/extensions/glx_sun_video_resize.txt +GLX_SUN_video_resize + GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + GLX_VIDEO_RESIZE_SUN 0x8171 + int glXVideoResizeSUN (Display* display, GLXDrawable window, float factor) + int glXGetVideoResizeSUN (Display* display, GLXDrawable window, float* factor) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_multisample new file mode 100644 index 0000000..7a58d3a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_multisample @@ -0,0 +1,7 @@ +GL_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/3dfx_multisample.txt +GL_3DFX_multisample + GL_MULTISAMPLE_3DFX 0x86B2 + GL_SAMPLE_BUFFERS_3DFX 0x86B3 + GL_SAMPLES_3DFX 0x86B4 + GL_MULTISAMPLE_BIT_3DFX 0x20000000 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_tbuffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_tbuffer new file mode 100644 index 0000000..d62d4c7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_tbuffer @@ -0,0 +1,4 @@ +GL_3DFX_tbuffer +http://www.opengl.org/registry/specs/3DFX/tbuffer.txt +GL_3DFX_tbuffer + void glTbufferMask3DFX (GLuint mask) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_texture_compression_FXT1 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_texture_compression_FXT1 new file mode 100644 index 0000000..c0e4581 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_3DFX_texture_compression_FXT1 @@ -0,0 +1,5 @@ +GL_3DFX_texture_compression_FXT1 +http://www.opengl.org/registry/specs/3DFX/texture_compression_FXT1.txt +GL_3DFX_texture_compression_FXT1 + GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 + GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_blend_minmax_factor b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_blend_minmax_factor new file mode 100644 index 0000000..e4730e2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_blend_minmax_factor @@ -0,0 +1,5 @@ +GL_AMD_blend_minmax_factor +http://www.opengl.org/registry/specs/AMD/blend_minmax_factor.txt +GL_AMD_blend_minmax_factor + GL_FACTOR_MIN_AMD 0x901C + GL_FACTOR_MAX_AMD 0x901D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_conservative_depth b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_conservative_depth new file mode 100644 index 0000000..c4489ed --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_conservative_depth @@ -0,0 +1,3 @@ +GL_AMD_conservative_depth +http://www.opengl.org/registry/specs/AMD/conservative_depth.txt +GL_AMD_conservative_depth diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_debug_output b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_debug_output new file mode 100644 index 0000000..80e5e78 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_debug_output @@ -0,0 +1,22 @@ +GL_AMD_debug_output +http://www.opengl.org/registry/specs/AMD/debug_output.txt +GL_AMD_debug_output + GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 + GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 + GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 + GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 + GL_DEBUG_SEVERITY_LOW_AMD 0x9148 + GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 + GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A + GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B + GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C + GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D + GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E + GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F + GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + void glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void* userParam) + void glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message) + typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_depth_clamp_separate b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_depth_clamp_separate new file mode 100644 index 0000000..6ad60e4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_depth_clamp_separate @@ -0,0 +1,5 @@ +GL_AMD_depth_clamp_separate +http://www.opengl.org/registry/specs/AMD/depth_clamp_separate.txt +GL_AMD_depth_clamp_separate + GL_DEPTH_CLAMP_NEAR_AMD 0x901E + GL_DEPTH_CLAMP_FAR_AMD 0x901F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_draw_buffers_blend b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_draw_buffers_blend new file mode 100644 index 0000000..74b33a1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_draw_buffers_blend @@ -0,0 +1,7 @@ +GL_AMD_draw_buffers_blend +http://www.opengl.org/registry/specs/AMD/draw_buffers_blend.txt +GL_AMD_draw_buffers_blend + void glBlendEquationIndexedAMD (GLuint buf, GLenum mode) + void glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst) + void glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_multi_draw_indirect b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_multi_draw_indirect new file mode 100644 index 0000000..07119e1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_multi_draw_indirect @@ -0,0 +1,5 @@ +GL_AMD_multi_draw_indirect +http://www.opengl.org/registry/specs/AMD/multi_draw_indirect.txt +GL_AMD_multi_draw_indirect + void glMultiDrawArraysIndirectAMD (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride) + void glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_name_gen_delete b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_name_gen_delete new file mode 100644 index 0000000..71322c6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_name_gen_delete @@ -0,0 +1,11 @@ +GL_AMD_name_gen_delete +http://www.opengl.org/registry/specs/AMD/name_gen_delete.txt +GL_AMD_name_gen_delete + GL_DATA_BUFFER_AMD 0x9151 + GL_PERFORMANCE_MONITOR_AMD 0x9152 + GL_QUERY_OBJECT_AMD 0x9153 + GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 + GL_SAMPLER_OBJECT_AMD 0x9155 + void glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint* names) + void glGenNamesAMD (GLenum identifier, GLuint num, GLuint* names) + GLboolean glIsNameAMD (GLenum identifier, GLuint name) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_performance_monitor b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_performance_monitor new file mode 100644 index 0000000..799483d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_performance_monitor @@ -0,0 +1,21 @@ +GL_AMD_performance_monitor +http://www.opengl.org/registry/specs/AMD/performance_monitor.txt +GL_AMD_performance_monitor + GL_COUNTER_TYPE_AMD 0x8BC0 + GL_COUNTER_RANGE_AMD 0x8BC1 + GL_UNSIGNED_INT64_AMD 0x8BC2 + GL_PERCENTAGE_AMD 0x8BC3 + GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 + GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 + GL_PERFMON_RESULT_AMD 0x8BC6 + void glBeginPerfMonitorAMD (GLuint monitor) + void glDeletePerfMonitorsAMD (GLsizei n, GLuint* monitors) + void glEndPerfMonitorAMD (GLuint monitor) + void glGenPerfMonitorsAMD (GLsizei n, GLuint* monitors) + void glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten) + void glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void* data) + void glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString) + void glGetPerfMonitorCountersAMD (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters) + void glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString) + void glGetPerfMonitorGroupsAMD (GLint* numGroups, GLsizei groupsSize, GLuint *groups) + void glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_pinned_memory b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_pinned_memory new file mode 100644 index 0000000..dd433e3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_pinned_memory @@ -0,0 +1,4 @@ +GL_AMD_pinned_memory +http://www.opengl.org/registry/specs/AMD/pinned_memory.txt +GL_AMD_pinned_memory + GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_query_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_query_buffer_object new file mode 100644 index 0000000..83fe8ba --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_query_buffer_object @@ -0,0 +1,6 @@ +GL_AMD_query_buffer_object +http://www.opengl.org/registry/specs/AMD/query_buffer_object.txt +GL_AMD_query_buffer_object + GL_QUERY_BUFFER_AMD 0x9192 + GL_QUERY_BUFFER_BINDING_AMD 0x9193 + GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_sample_positions b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_sample_positions new file mode 100644 index 0000000..18c5180 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_sample_positions @@ -0,0 +1,5 @@ +GL_AMD_sample_positions +http://www.opengl.org/registry/specs/AMD/sample_positions.txt +GL_AMD_sample_positions + GL_SUBSAMPLE_DISTANCE_AMD 0x883F + void glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat* val) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_seamless_cubemap_per_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_seamless_cubemap_per_texture new file mode 100644 index 0000000..3565655 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_seamless_cubemap_per_texture @@ -0,0 +1,4 @@ +GL_AMD_seamless_cubemap_per_texture +http://www.opengl.org/registry/specs/AMD/seamless_cubemap_per_texture.txt +GL_AMD_seamless_cubemap_per_texture + GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_shader_stencil_export b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_shader_stencil_export new file mode 100644 index 0000000..a7b91d7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_shader_stencil_export @@ -0,0 +1,3 @@ +GL_AMD_shader_stencil_export +http://www.opengl.org/registry/specs/AMD/shader_stencil_export.txt +GL_AMD_shader_stencil_export diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_stencil_operation_extended b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_stencil_operation_extended new file mode 100644 index 0000000..01843a7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_stencil_operation_extended @@ -0,0 +1,8 @@ +GL_AMD_stencil_operation_extended +http://www.opengl.org/registry/specs/AMD/stencil_operation_extended.txt +GL_AMD_stencil_operation_extended + GL_SET_AMD 0x874A + GL_REPLACE_VALUE_AMD 0x874B + GL_STENCIL_OP_VALUE_AMD 0x874C + GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + void glStencilOpValueAMD (GLenum face, GLuint value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_texture_texture4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_texture_texture4 new file mode 100644 index 0000000..5736c5a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_texture_texture4 @@ -0,0 +1,3 @@ +GL_AMD_texture_texture4 +http://www.opengl.org/registry/specs/AMD/texture_texture4.txt +GL_AMD_texture_texture4 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_transform_feedback3_lines_triangles b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_transform_feedback3_lines_triangles new file mode 100644 index 0000000..b12af58 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_transform_feedback3_lines_triangles @@ -0,0 +1,3 @@ +GL_AMD_transform_feedback3_lines_triangles +http://www.opengl.org/registry/specs/AMD/transform_feedback3_lines_triangles.txt +GL_AMD_transform_feedback3_lines_triangles diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_layer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_layer new file mode 100644 index 0000000..d1578b2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_layer @@ -0,0 +1,3 @@ +GL_AMD_vertex_shader_layer +http://www.opengl.org/registry/specs/AMD/vertex_shader_layer.txt +GL_AMD_vertex_shader_layer diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_tessellator b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_tessellator new file mode 100644 index 0000000..db9e4b8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_tessellator @@ -0,0 +1,12 @@ +GL_AMD_vertex_shader_tessellator +http://www.opengl.org/registry/specs/AMD/vertex_shader_tessellator.txt +GL_AMD_vertex_shader_tessellator + GL_SAMPLER_BUFFER_AMD 0x9001 + GL_INT_SAMPLER_BUFFER_AMD 0x9002 + GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 + GL_TESSELLATION_MODE_AMD 0x9004 + GL_TESSELLATION_FACTOR_AMD 0x9005 + GL_DISCRETE_AMD 0x9006 + GL_CONTINUOUS_AMD 0x9007 + void glTessellationFactorAMD (GLfloat factor) + void glTessellationModeAMD (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_viewport_index b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_viewport_index new file mode 100644 index 0000000..88d7e14 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_AMD_vertex_shader_viewport_index @@ -0,0 +1,3 @@ +GL_AMD_vertex_shader_viewport_index +http://www.opengl.org/registry/specs/AMD/vertex_shader_viewport_index.txt +GL_AMD_vertex_shader_viewport_index diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_aux_depth_stencil b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_aux_depth_stencil new file mode 100644 index 0000000..34339d3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_aux_depth_stencil @@ -0,0 +1,4 @@ +GL_APPLE_aux_depth_stencil +http://www.opengl.org/registry/specs/APPLE/aux_depth_stencil.txt +GL_APPLE_aux_depth_stencil + GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_client_storage b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_client_storage new file mode 100644 index 0000000..287b632 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_client_storage @@ -0,0 +1,4 @@ +GL_APPLE_client_storage +http://www.opengl.org/registry/specs/APPLE/client_storage.txt +GL_APPLE_client_storage + GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_element_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_element_array new file mode 100644 index 0000000..c999f27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_element_array @@ -0,0 +1,11 @@ +GL_APPLE_element_array +http://www.opengl.org/registry/specs/APPLE/element_array.txt +GL_APPLE_element_array + GL_ELEMENT_ARRAY_APPLE 0x8A0C + GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D + GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + void glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count) + void glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count) + void glElementPointerAPPLE (GLenum type, const void* pointer) + void glMultiDrawElementArrayAPPLE (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount) + void glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_fence b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_fence new file mode 100644 index 0000000..1886b38 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_fence @@ -0,0 +1,13 @@ +GL_APPLE_fence +http://www.opengl.org/registry/specs/APPLE/fence.txt +GL_APPLE_fence + GL_DRAW_PIXELS_APPLE 0x8A0A + GL_FENCE_APPLE 0x8A0B + void glDeleteFencesAPPLE (GLsizei n, const GLuint* fences) + void glFinishFenceAPPLE (GLuint fence) + void glFinishObjectAPPLE (GLenum object, GLint name) + void glGenFencesAPPLE (GLsizei n, GLuint* fences) + GLboolean glIsFenceAPPLE (GLuint fence) + void glSetFenceAPPLE (GLuint fence) + GLboolean glTestFenceAPPLE (GLuint fence) + GLboolean glTestObjectAPPLE (GLenum object, GLuint name) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_float_pixels b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_float_pixels new file mode 100644 index 0000000..2bf7458 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_float_pixels @@ -0,0 +1,17 @@ +GL_APPLE_float_pixels +http://www.opengl.org/registry/specs/APPLE/float_pixels.txt +GL_APPLE_float_pixels + GL_HALF_APPLE 0x140B + GL_COLOR_FLOAT_APPLE 0x8A0F + GL_RGBA_FLOAT32_APPLE 0x8814 + GL_RGB_FLOAT32_APPLE 0x8815 + GL_ALPHA_FLOAT32_APPLE 0x8816 + GL_INTENSITY_FLOAT32_APPLE 0x8817 + GL_LUMINANCE_FLOAT32_APPLE 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 + GL_RGBA_FLOAT16_APPLE 0x881A + GL_RGB_FLOAT16_APPLE 0x881B + GL_ALPHA_FLOAT16_APPLE 0x881C + GL_INTENSITY_FLOAT16_APPLE 0x881D + GL_LUMINANCE_FLOAT16_APPLE 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_flush_buffer_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_flush_buffer_range new file mode 100644 index 0000000..243cff8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_flush_buffer_range @@ -0,0 +1,7 @@ +GL_APPLE_flush_buffer_range +http://www.opengl.org/registry/specs/APPLE/flush_buffer_range.txt +GL_APPLE_flush_buffer_range + GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 + GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + void glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param) + void glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_object_purgeable b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_object_purgeable new file mode 100644 index 0000000..a428e77 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_object_purgeable @@ -0,0 +1,12 @@ +GL_APPLE_object_purgeable +http://www.opengl.org/registry/specs/APPLE/object_purgeable.txt +GL_APPLE_object_purgeable + GL_BUFFER_OBJECT_APPLE 0x85B3 + GL_RELEASED_APPLE 0x8A19 + GL_VOLATILE_APPLE 0x8A1A + GL_RETAINED_APPLE 0x8A1B + GL_UNDEFINED_APPLE 0x8A1C + GL_PURGEABLE_APPLE 0x8A1D + void glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint* params) + GLenum glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option) + GLenum glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_pixel_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_pixel_buffer new file mode 100644 index 0000000..7449f29 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_pixel_buffer @@ -0,0 +1,4 @@ +GL_APPLE_pixel_buffer + +GL_APPLE_pixel_buffer + GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_rgb_422 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_rgb_422 new file mode 100644 index 0000000..00e4355 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_rgb_422 @@ -0,0 +1,6 @@ +GL_APPLE_rgb_422 +http://www.opengl.org/registry/specs/APPLE/rgb_422.txt +GL_APPLE_rgb_422 + GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA + GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB + GL_RGB_422_APPLE 0x8A1F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_row_bytes b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_row_bytes new file mode 100644 index 0000000..0c60b92 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_row_bytes @@ -0,0 +1,5 @@ +GL_APPLE_row_bytes +http://www.opengl.org/registry/specs/APPLE/row_bytes.txt +GL_APPLE_row_bytes + GL_PACK_ROW_BYTES_APPLE 0x8A15 + GL_UNPACK_ROW_BYTES_APPLE 0x8A16 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_specular_vector b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_specular_vector new file mode 100644 index 0000000..98a18fa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_specular_vector @@ -0,0 +1,4 @@ +GL_APPLE_specular_vector +http://www.opengl.org/registry/specs/APPLE/specular_vector.txt +GL_APPLE_specular_vector + GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_texture_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_texture_range new file mode 100644 index 0000000..7ca9b9b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_texture_range @@ -0,0 +1,12 @@ +GL_APPLE_texture_range +http://www.opengl.org/registry/specs/APPLE/texture_range.txt +GL_APPLE_texture_range + GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC + GL_STORAGE_PRIVATE_APPLE 0x85BD + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 + GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 + void glTextureRangeAPPLE (GLenum target, GLsizei length, GLvoid *pointer) + void glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid **params) + diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_transform_hint b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_transform_hint new file mode 100644 index 0000000..ac713eb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_transform_hint @@ -0,0 +1,4 @@ +GL_APPLE_transform_hint +http://www.opengl.org/registry/specs/APPLE/transform_hint.txt +GL_APPLE_transform_hint + GL_TRANSFORM_HINT_APPLE 0x85B1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_object new file mode 100644 index 0000000..95da66d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_object @@ -0,0 +1,8 @@ +GL_APPLE_vertex_array_object +http://www.opengl.org/registry/specs/APPLE/vertex_array_object.txt +GL_APPLE_vertex_array_object + GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + void glBindVertexArrayAPPLE (GLuint array) + void glDeleteVertexArraysAPPLE (GLsizei n, const GLuint* arrays) + void glGenVertexArraysAPPLE (GLsizei n, const GLuint* arrays) + GLboolean glIsVertexArrayAPPLE (GLuint array) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_range new file mode 100644 index 0000000..1536f07 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_array_range @@ -0,0 +1,14 @@ +GL_APPLE_vertex_array_range +http://www.opengl.org/registry/specs/APPLE/vertex_array_range.txt +GL_APPLE_vertex_array_range + GL_VERTEX_ARRAY_RANGE_APPLE 0x851D + GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E + GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 + GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 + GL_STORAGE_CLIENT_APPLE 0x85B4 + GL_STORAGE_CACHED_APPLE 0x85BE + GL_STORAGE_SHARED_APPLE 0x85BF + void glFlushVertexArrayRangeAPPLE (GLsizei length, void* pointer) + void glVertexArrayParameteriAPPLE (GLenum pname, GLint param) + void glVertexArrayRangeAPPLE (GLsizei length, void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_program_evaluators b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_program_evaluators new file mode 100644 index 0000000..4bc8dea --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_vertex_program_evaluators @@ -0,0 +1,20 @@ +GL_APPLE_vertex_program_evaluators +http://www.opengl.org/registry/specs/APPLE/vertex_program_evaluators.txt +GL_APPLE_vertex_program_evaluators + GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 + GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 + GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 + GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 + GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 + GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 + GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 + GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 + GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 + GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + void glDisableVertexAttribAPPLE (GLuint index, GLenum pname) + void glEnableVertexAttribAPPLE (GLuint index, GLenum pname) + GLboolean glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname) + void glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points) + void glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points) + void glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points) + void glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_ycbcr_422 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_ycbcr_422 new file mode 100644 index 0000000..70c9649 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_APPLE_ycbcr_422 @@ -0,0 +1,4 @@ +GL_APPLE_ycbcr_422 +http://www.opengl.org/registry/specs/APPLE/ycbcr_422.txt +GL_APPLE_ycbcr_422 + GL_YCBCR_422_APPLE 0x85B9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES2_compatibility b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES2_compatibility new file mode 100644 index 0000000..802ee5c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES2_compatibility @@ -0,0 +1,24 @@ +GL_ARB_ES2_compatibility +http://www.opengl.org/registry/specs/ARB/ES2_compatibility.txt +GL_ARB_ES2_compatibility + GL_FIXED 0x140C + GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A + GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B + GL_RGB565 0x8D62 + GL_LOW_FLOAT 0x8DF0 + GL_MEDIUM_FLOAT 0x8DF1 + GL_HIGH_FLOAT 0x8DF2 + GL_LOW_INT 0x8DF3 + GL_MEDIUM_INT 0x8DF4 + GL_HIGH_INT 0x8DF5 + GL_SHADER_BINARY_FORMATS 0x8DF8 + GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + GL_SHADER_COMPILER 0x8DFA + GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB + GL_MAX_VARYING_VECTORS 0x8DFC + GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + void glClearDepthf (GLclampf d) + void glDepthRangef (GLclampf n, GLclampf f) + void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision) + void glReleaseShaderCompiler (void) + void glShaderBinary (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES3_compatibility b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES3_compatibility new file mode 100644 index 0000000..9ce1c0f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_ES3_compatibility @@ -0,0 +1,16 @@ +GL_ARB_ES3_compatibility +http://www.opengl.org/registry/specs/ARB/ES3_compatibility.txt +GL_ARB_ES3_compatibility + GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 + GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A + GL_MAX_ELEMENT_INDEX 0x8D6B + GL_COMPRESSED_R11_EAC 0x9270 + GL_COMPRESSED_SIGNED_R11_EAC 0x9271 + GL_COMPRESSED_RG11_EAC 0x9272 + GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 + GL_COMPRESSED_RGB8_ETC2 0x9274 + GL_COMPRESSED_SRGB8_ETC2 0x9275 + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 + GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_arrays_of_arrays b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_arrays_of_arrays new file mode 100644 index 0000000..e5556c1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_arrays_of_arrays @@ -0,0 +1,3 @@ +GL_ARB_arrays_of_arrays +http://www.opengl.org/registry/specs/ARB/arrays_of_arrays.txt +GL_ARB_arrays_of_arrays diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_base_instance b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_base_instance new file mode 100644 index 0000000..29e82ff --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_base_instance @@ -0,0 +1,6 @@ +GL_ARB_base_instance +http://www.opengl.org/registry/specs/ARB/base_instance.txt +GL_ARB_base_instance + void glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance) + void glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance) + void glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_blend_func_extended b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_blend_func_extended new file mode 100644 index 0000000..ba3f941 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_blend_func_extended @@ -0,0 +1,9 @@ +GL_ARB_blend_func_extended +http://www.opengl.org/registry/specs/ARB/blend_func_extended.txt +GL_ARB_blend_func_extended + GL_SRC1_COLOR 0x88F9 + GL_ONE_MINUS_SRC1_COLOR 0x88FA + GL_ONE_MINUS_SRC1_ALPHA 0x88FB + GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + void glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) + GLint glGetFragDataIndex (GLuint program, const GLchar * name) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_cl_event b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_cl_event new file mode 100644 index 0000000..9d0b9b5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_cl_event @@ -0,0 +1,8 @@ +GL_ARB_cl_event +http://www.opengl.org/registry/specs/ARB/cl_event.txt +GL_ARB_cl_event + GL_SYNC_CL_EVENT_ARB 0x8240 + GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + GLsync glCreateSyncFromCLeventARB (cl_context context, cl_event event, GLbitfield flags) + typedef struct _cl_context *cl_context + typedef struct _cl_event *cl_event diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_clear_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_clear_buffer_object new file mode 100644 index 0000000..41863ff --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_clear_buffer_object @@ -0,0 +1,7 @@ +GL_ARB_clear_buffer_object +http://www.opengl.org/registry/specs/ARB/clear_buffer_object.txt +GL_ARB_clear_buffer_object + void glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data) + void glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data) + void glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data) + void glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_color_buffer_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_color_buffer_float new file mode 100644 index 0000000..1d7ad05 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_color_buffer_float @@ -0,0 +1,9 @@ +GL_ARB_color_buffer_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +GL_ARB_color_buffer_float + GL_RGBA_FLOAT_MODE_ARB 0x8820 + GL_CLAMP_VERTEX_COLOR_ARB 0x891A + GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B + GL_CLAMP_READ_COLOR_ARB 0x891C + GL_FIXED_ONLY_ARB 0x891D + void glClampColorARB (GLenum target, GLenum clamp) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compatibility b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compatibility new file mode 100644 index 0000000..60200c4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compatibility @@ -0,0 +1,3 @@ +GL_ARB_compatibility +http://www.opengl.org/registry/specs/ARB/compatibility.txt +GL_ARB_compatibility diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compressed_texture_pixel_storage b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compressed_texture_pixel_storage new file mode 100644 index 0000000..276737f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compressed_texture_pixel_storage @@ -0,0 +1,11 @@ +GL_ARB_compressed_texture_pixel_storage +http://www.opengl.org/registry/specs/ARB/compressed_texture_pixel_storage.txt +GL_ARB_compressed_texture_pixel_storage + GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 + GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 + GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A + GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B + GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C + GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D + GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compute_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compute_shader new file mode 100644 index 0000000..f85789f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_compute_shader @@ -0,0 +1,23 @@ +GL_ARB_compute_shader +http://www.opengl.org/registry/specs/ARB/compute_shader.txt +GL_ARB_compute_shader + GL_COMPUTE_SHADER_BIT 0x00000020 + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 + GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 + GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 + GL_COMPUTE_WORK_GROUP_SIZE 0x8267 + GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB + GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED + GL_DISPATCH_INDIRECT_BUFFER 0x90EE + GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF + GL_COMPUTE_SHADER 0x91B9 + GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC + GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD + GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE + GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + void glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) + void glDispatchComputeIndirect (GLintptr indirect) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_conservative_depth b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_conservative_depth new file mode 100644 index 0000000..bae6028 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_conservative_depth @@ -0,0 +1,3 @@ +GL_ARB_conservative_depth +http://www.opengl.org/registry/specs/ARB/conservative_depth.txt +GL_ARB_conservative_depth diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_buffer new file mode 100644 index 0000000..64f58b0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_buffer @@ -0,0 +1,6 @@ +GL_ARB_copy_buffer +http://www.opengl.org/registry/specs/ARB/copy_buffer.txt +GL_ARB_copy_buffer + GL_COPY_READ_BUFFER 0x8F36 + GL_COPY_WRITE_BUFFER 0x8F37 + void glCopyBufferSubData (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_image b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_image new file mode 100644 index 0000000..08d5116 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_copy_image @@ -0,0 +1,4 @@ +GL_ARB_copy_image +http://www.opengl.org/registry/specs/ARB/copy_image.txt +GL_ARB_copy_image + void glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_debug_output b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_debug_output new file mode 100644 index 0000000..cb75aa4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_debug_output @@ -0,0 +1,30 @@ +GL_ARB_debug_output +http://www.opengl.org/registry/specs/ARB/debug_output.txt +GL_ARB_debug_output + GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 + GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 + GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 + GL_DEBUG_SOURCE_API_ARB 0x8246 + GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 + GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 + GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 + GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A + GL_DEBUG_SOURCE_OTHER_ARB 0x824B + GL_DEBUG_TYPE_ERROR_ARB 0x824C + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E + GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F + GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 + GL_DEBUG_TYPE_OTHER_ARB 0x8251 + GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 + GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 + GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 + GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 + GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + void glDebugMessageCallbackARB (GLDEBUGPROCARB callback, void* userParam) + void glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog) + typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_buffer_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_buffer_float new file mode 100644 index 0000000..f18f121 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_buffer_float @@ -0,0 +1,6 @@ +GL_ARB_depth_buffer_float +http://www.opengl.org/registry/specs/ARB/depth_buffer_float.txt +GL_ARB_depth_buffer_float + GL_DEPTH_COMPONENT32F 0x8CAC + GL_DEPTH32F_STENCIL8 0x8CAD + GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_clamp new file mode 100644 index 0000000..31cffa7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_clamp @@ -0,0 +1,4 @@ +GL_ARB_depth_clamp +http://www.opengl.org/registry/specs/ARB/depth_clamp.txt +GL_ARB_depth_clamp + GL_DEPTH_CLAMP 0x864F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_texture new file mode 100644 index 0000000..d1aa476 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_depth_texture @@ -0,0 +1,8 @@ +GL_ARB_depth_texture +http://www.opengl.org/registry/specs/ARB/depth_texture.txt +GL_ARB_depth_texture + GL_DEPTH_COMPONENT16_ARB 0x81A5 + GL_DEPTH_COMPONENT24_ARB 0x81A6 + GL_DEPTH_COMPONENT32_ARB 0x81A7 + GL_TEXTURE_DEPTH_SIZE_ARB 0x884A + GL_DEPTH_TEXTURE_MODE_ARB 0x884B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers new file mode 100644 index 0000000..8c96b61 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers @@ -0,0 +1,21 @@ +GL_ARB_draw_buffers +http://www.opengl.org/registry/specs/ARB/draw_buffers.txt +GL_ARB_draw_buffers + GL_MAX_DRAW_BUFFERS_ARB 0x8824 + GL_DRAW_BUFFER0_ARB 0x8825 + GL_DRAW_BUFFER1_ARB 0x8826 + GL_DRAW_BUFFER2_ARB 0x8827 + GL_DRAW_BUFFER3_ARB 0x8828 + GL_DRAW_BUFFER4_ARB 0x8829 + GL_DRAW_BUFFER5_ARB 0x882A + GL_DRAW_BUFFER6_ARB 0x882B + GL_DRAW_BUFFER7_ARB 0x882C + GL_DRAW_BUFFER8_ARB 0x882D + GL_DRAW_BUFFER9_ARB 0x882E + GL_DRAW_BUFFER10_ARB 0x882F + GL_DRAW_BUFFER11_ARB 0x8830 + GL_DRAW_BUFFER12_ARB 0x8831 + GL_DRAW_BUFFER13_ARB 0x8832 + GL_DRAW_BUFFER14_ARB 0x8833 + GL_DRAW_BUFFER15_ARB 0x8834 + void glDrawBuffersARB (GLsizei n, const GLenum* bufs) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers_blend b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers_blend new file mode 100644 index 0000000..4f63320 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_buffers_blend @@ -0,0 +1,7 @@ +GL_ARB_draw_buffers_blend +http://www.opengl.org/registry/specs/ARB/draw_buffers_blend.txt +GL_ARB_draw_buffers_blend + void glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha) + void glBlendEquationiARB (GLuint buf, GLenum mode) + void glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + void glBlendFunciARB (GLuint buf, GLenum src, GLenum dst) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_elements_base_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_elements_base_vertex new file mode 100644 index 0000000..85c5be7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_elements_base_vertex @@ -0,0 +1,7 @@ +GL_ARB_draw_elements_base_vertex +http://www.opengl.org/registry/specs/ARB/draw_elements_base_vertex.txt +GL_ARB_draw_elements_base_vertex + void glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex) + void glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex) + void glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex) + void glMultiDrawElementsBaseVertex (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_indirect b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_indirect new file mode 100644 index 0000000..1423bc6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_indirect @@ -0,0 +1,7 @@ +GL_ARB_draw_indirect +http://www.opengl.org/registry/specs/ARB/draw_indirect.txt +GL_ARB_draw_indirect + GL_DRAW_INDIRECT_BUFFER 0x8F3F + GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + void glDrawArraysIndirect (GLenum mode, const void* indirect) + void glDrawElementsIndirect (GLenum mode, GLenum type, const void* indirect) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_instanced b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_instanced new file mode 100644 index 0000000..4140bea --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_draw_instanced @@ -0,0 +1,3 @@ +GL_ARB_draw_instanced +http://www.opengl.org/registry/specs/ARB/draw_instanced.txt +GL_ARB_draw_instanced diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_attrib_location b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_attrib_location new file mode 100644 index 0000000..76fe9ca --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_attrib_location @@ -0,0 +1,3 @@ +GL_ARB_explicit_attrib_location +http://www.opengl.org/registry/specs/ARB/explicit_attrib_location.txt +GL_ARB_explicit_attrib_location diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_uniform_location b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_uniform_location new file mode 100644 index 0000000..03b7c03 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_explicit_uniform_location @@ -0,0 +1,4 @@ +GL_ARB_explicit_uniform_location +http://www.opengl.org/registry/specs/ARB/explicit_uniform_location.txt +GL_ARB_explicit_uniform_location + GL_MAX_UNIFORM_LOCATIONS 0x826E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_coord_conventions b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_coord_conventions new file mode 100644 index 0000000..f54b1fe --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_coord_conventions @@ -0,0 +1,3 @@ +GL_ARB_fragment_coord_conventions +http://www.opengl.org/registry/specs/ARB/fragment_coord_conventions.txt +GL_ARB_fragment_coord_conventions diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_layer_viewport b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_layer_viewport new file mode 100644 index 0000000..2171179 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_layer_viewport @@ -0,0 +1,3 @@ +GL_ARB_fragment_layer_viewport +http://www.opengl.org/registry/specs/ARB/fragment_layer_viewport.txt +GL_ARB_fragment_layer_viewport diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program new file mode 100644 index 0000000..ce63a34 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program @@ -0,0 +1,18 @@ +GL_ARB_fragment_program +http://www.opengl.org/registry/specs/ARB/fragment_program.txt +GL_ARB_fragment_program + GL_FRAGMENT_PROGRAM_ARB 0x8804 + GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 + GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 + GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 + GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 + GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 + GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A + GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B + GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C + GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E + GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F + GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 + GL_MAX_TEXTURE_COORDS_ARB 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program_shadow b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program_shadow new file mode 100644 index 0000000..cce0d48 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_program_shadow @@ -0,0 +1,3 @@ +GL_ARB_fragment_program_shadow +http://www.opengl.org/registry/specs/ARB/fragment_program_shadow.txt +GL_ARB_fragment_program_shadow diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_shader new file mode 100644 index 0000000..07f4773 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_fragment_shader @@ -0,0 +1,6 @@ +GL_ARB_fragment_shader +http://www.opengl.org/registry/specs/ARB/fragment_shader.txt +GL_ARB_fragment_shader + GL_FRAGMENT_SHADER_ARB 0x8B30 + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 + GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_no_attachments b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_no_attachments new file mode 100644 index 0000000..be382a3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_no_attachments @@ -0,0 +1,16 @@ +GL_ARB_framebuffer_no_attachments +http://www.opengl.org/registry/specs/ARB/framebuffer_no_attachments.txt +GL_ARB_framebuffer_no_attachments + GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 + GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 + GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 + GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 + GL_MAX_FRAMEBUFFER_WIDTH 0x9315 + GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 + GL_MAX_FRAMEBUFFER_LAYERS 0x9317 + GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + void glFramebufferParameteri (GLenum target, GLenum pname, GLint param) + void glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint* params) + void glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint* params) + void glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_object new file mode 100644 index 0000000..bb217e2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_object @@ -0,0 +1,97 @@ +GL_ARB_framebuffer_object +http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt +GL_ARB_framebuffer_object + GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 + GL_FRAMEBUFFER_DEFAULT 0x8218 + GL_FRAMEBUFFER_UNDEFINED 0x8219 + GL_DEPTH_STENCIL_ATTACHMENT 0x821A + GL_INDEX 0x8222 + GL_MAX_RENDERBUFFER_SIZE 0x84E8 + GL_DEPTH_STENCIL 0x84F9 + GL_UNSIGNED_INT_24_8 0x84FA + GL_DEPTH24_STENCIL8 0x88F0 + GL_TEXTURE_STENCIL_SIZE 0x88F1 + GL_UNSIGNED_NORMALIZED 0x8C17 + GL_SRGB 0x8C40 + GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 + GL_FRAMEBUFFER_BINDING 0x8CA6 + GL_RENDERBUFFER_BINDING 0x8CA7 + GL_READ_FRAMEBUFFER 0x8CA8 + GL_DRAW_FRAMEBUFFER 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING 0x8CAA + GL_RENDERBUFFER_SAMPLES 0x8CAB + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 + GL_FRAMEBUFFER_COMPLETE 0x8CD5 + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC + GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD + GL_MAX_COLOR_ATTACHMENTS 0x8CDF + GL_COLOR_ATTACHMENT0 0x8CE0 + GL_COLOR_ATTACHMENT1 0x8CE1 + GL_COLOR_ATTACHMENT2 0x8CE2 + GL_COLOR_ATTACHMENT3 0x8CE3 + GL_COLOR_ATTACHMENT4 0x8CE4 + GL_COLOR_ATTACHMENT5 0x8CE5 + GL_COLOR_ATTACHMENT6 0x8CE6 + GL_COLOR_ATTACHMENT7 0x8CE7 + GL_COLOR_ATTACHMENT8 0x8CE8 + GL_COLOR_ATTACHMENT9 0x8CE9 + GL_COLOR_ATTACHMENT10 0x8CEA + GL_COLOR_ATTACHMENT11 0x8CEB + GL_COLOR_ATTACHMENT12 0x8CEC + GL_COLOR_ATTACHMENT13 0x8CED + GL_COLOR_ATTACHMENT14 0x8CEE + GL_COLOR_ATTACHMENT15 0x8CEF + GL_DEPTH_ATTACHMENT 0x8D00 + GL_STENCIL_ATTACHMENT 0x8D20 + GL_FRAMEBUFFER 0x8D40 + GL_RENDERBUFFER 0x8D41 + GL_RENDERBUFFER_WIDTH 0x8D42 + GL_RENDERBUFFER_HEIGHT 0x8D43 + GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 + GL_STENCIL_INDEX1 0x8D46 + GL_STENCIL_INDEX4 0x8D47 + GL_STENCIL_INDEX8 0x8D48 + GL_STENCIL_INDEX16 0x8D49 + GL_RENDERBUFFER_RED_SIZE 0x8D50 + GL_RENDERBUFFER_GREEN_SIZE 0x8D51 + GL_RENDERBUFFER_BLUE_SIZE 0x8D52 + GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 + GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 + GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 + GL_MAX_SAMPLES 0x8D57 + void glBindFramebuffer (GLenum target, GLuint framebuffer) + void glBindRenderbuffer (GLenum target, GLuint renderbuffer) + void glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + GLenum glCheckFramebufferStatus (GLenum target) + void glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers) + void glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers) + void glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) + void glFramebufferTextureLayer (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer) + void glGenFramebuffers (GLsizei n, GLuint* framebuffers) + void glGenRenderbuffers (GLsizei n, GLuint* renderbuffers) + void glGenerateMipmap (GLenum target) + void glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params) + void glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params) + GLboolean glIsFramebuffer (GLuint framebuffer) + GLboolean glIsRenderbuffer (GLuint renderbuffer) + void glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) + void glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_sRGB new file mode 100644 index 0000000..c9909bc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_framebuffer_sRGB @@ -0,0 +1,4 @@ +GL_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +GL_ARB_framebuffer_sRGB + GL_FRAMEBUFFER_SRGB 0x8DB9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_geometry_shader4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_geometry_shader4 new file mode 100644 index 0000000..76cfcbf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_geometry_shader4 @@ -0,0 +1,26 @@ +GL_ARB_geometry_shader4 +http://www.opengl.org/registry/specs/ARB/geometry_shader4.txt +GL_ARB_geometry_shader4 + GL_LINES_ADJACENCY_ARB 0xA + GL_LINE_STRIP_ADJACENCY_ARB 0xB + GL_TRIANGLES_ADJACENCY_ARB 0xC + GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD + GL_PROGRAM_POINT_SIZE_ARB 0x8642 + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 + GL_GEOMETRY_SHADER_ARB 0x8DD9 + GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA + GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC + GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + void glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) + void glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glProgramParameteriARB (GLuint program, GLenum pname, GLint value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_get_program_binary b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_get_program_binary new file mode 100644 index 0000000..dcd725d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_get_program_binary @@ -0,0 +1,10 @@ +GL_ARB_get_program_binary +http://www.opengl.org/registry/specs/ARB/get_program_binary.txt +GL_ARB_get_program_binary + GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 + GL_PROGRAM_BINARY_LENGTH 0x8741 + GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE + GL_PROGRAM_BINARY_FORMATS 0x87FF + void glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary) + void glProgramBinary (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length) + void glProgramParameteri (GLuint program, GLenum pname, GLint value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader5 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader5 new file mode 100644 index 0000000..816c894 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader5 @@ -0,0 +1,9 @@ +GL_ARB_gpu_shader5 +http://www.opengl.org/registry/specs/ARB/gpu_shader5.txt +GL_ARB_gpu_shader5 + GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D + GL_MAX_VERTEX_STREAMS 0x8E71 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader_fp64 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader_fp64 new file mode 100644 index 0000000..7e6e6ec --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_gpu_shader_fp64 @@ -0,0 +1,33 @@ +GL_ARB_gpu_shader_fp64 +http://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt +GL_ARB_gpu_shader_fp64 + GL_DOUBLE_MAT2 0x8F46 + GL_DOUBLE_MAT3 0x8F47 + GL_DOUBLE_MAT4 0x8F48 + GL_DOUBLE_MAT2x3 0x8F49 + GL_DOUBLE_MAT2x4 0x8F4A + GL_DOUBLE_MAT3x2 0x8F4B + GL_DOUBLE_MAT3x4 0x8F4C + GL_DOUBLE_MAT4x2 0x8F4D + GL_DOUBLE_MAT4x3 0x8F4E + GL_DOUBLE_VEC2 0x8FFC + GL_DOUBLE_VEC3 0x8FFD + GL_DOUBLE_VEC4 0x8FFE + void glGetUniformdv (GLuint program, GLint location, GLdouble* params) + void glUniform1d (GLint location, GLdouble x) + void glUniform1dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform2d (GLint location, GLdouble x, GLdouble y) + void glUniform2dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z) + void glUniform3dv (GLint location, GLsizei count, const GLdouble* value) + void glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glUniform4dv (GLint location, GLsizei count, const GLdouble* value) + void glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_pixel b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_pixel new file mode 100644 index 0000000..6cc72e8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_pixel @@ -0,0 +1,4 @@ +GL_ARB_half_float_pixel +http://www.opengl.org/registry/specs/ARB/half_float_pixel.txt +GL_ARB_half_float_pixel + GL_HALF_FLOAT_ARB 0x140B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_vertex new file mode 100644 index 0000000..2ecbbc3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_half_float_vertex @@ -0,0 +1,4 @@ +GL_ARB_half_float_vertex +http://www.opengl.org/registry/specs/ARB/half_float_vertex.txt +GL_ARB_half_float_vertex + GL_HALF_FLOAT 0x140B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_imaging b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_imaging new file mode 100644 index 0000000..0efd0c1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_imaging @@ -0,0 +1,112 @@ +GL_ARB_imaging + +GL_ARB_imaging + GL_CONSTANT_COLOR 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR 0x8002 + GL_CONSTANT_ALPHA 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + GL_BLEND_COLOR 0x8005 + GL_FUNC_ADD 0x8006 + GL_MIN 0x8007 + GL_MAX 0x8008 + GL_BLEND_EQUATION 0x8009 + GL_FUNC_SUBTRACT 0x800A + GL_FUNC_REVERSE_SUBTRACT 0x800B + GL_CONVOLUTION_1D 0x8010 + GL_CONVOLUTION_2D 0x8011 + GL_SEPARABLE_2D 0x8012 + GL_CONVOLUTION_BORDER_MODE 0x8013 + GL_CONVOLUTION_FILTER_SCALE 0x8014 + GL_CONVOLUTION_FILTER_BIAS 0x8015 + GL_REDUCE 0x8016 + GL_CONVOLUTION_FORMAT 0x8017 + GL_CONVOLUTION_WIDTH 0x8018 + GL_CONVOLUTION_HEIGHT 0x8019 + GL_MAX_CONVOLUTION_WIDTH 0x801A + GL_MAX_CONVOLUTION_HEIGHT 0x801B + GL_POST_CONVOLUTION_RED_SCALE 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F + GL_POST_CONVOLUTION_RED_BIAS 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 + GL_HISTOGRAM 0x8024 + GL_PROXY_HISTOGRAM 0x8025 + GL_HISTOGRAM_WIDTH 0x8026 + GL_HISTOGRAM_FORMAT 0x8027 + GL_HISTOGRAM_RED_SIZE 0x8028 + GL_HISTOGRAM_GREEN_SIZE 0x8029 + GL_HISTOGRAM_BLUE_SIZE 0x802A + GL_HISTOGRAM_ALPHA_SIZE 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE 0x802C + GL_HISTOGRAM_SINK 0x802D + GL_MINMAX 0x802E + GL_MINMAX_FORMAT 0x802F + GL_MINMAX_SINK 0x8030 + GL_TABLE_TOO_LARGE 0x8031 + GL_COLOR_MATRIX 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB + GL_COLOR_TABLE 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 + GL_PROXY_COLOR_TABLE 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 + GL_COLOR_TABLE_SCALE 0x80D6 + GL_COLOR_TABLE_BIAS 0x80D7 + GL_COLOR_TABLE_FORMAT 0x80D8 + GL_COLOR_TABLE_WIDTH 0x80D9 + GL_COLOR_TABLE_RED_SIZE 0x80DA + GL_COLOR_TABLE_GREEN_SIZE 0x80DB + GL_COLOR_TABLE_BLUE_SIZE 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF + GL_IGNORE_BORDER 0x8150 + GL_CONSTANT_BORDER 0x8151 + GL_WRAP_BORDER 0x8152 + GL_REPLICATE_BORDER 0x8153 + GL_CONVOLUTION_BORDER_COLOR 0x8154 + void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) + void glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) + void glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params) + void glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) + void glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table) + void glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params) + void glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glResetHistogram (GLenum target) + void glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) + void glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params) + void glMinmax (GLenum target, GLenum internalformat, GLboolean sink) + void glResetMinmax (GLenum target) + void glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params) + void glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) + void glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) + void glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params) + void glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params) + void glConvolutionParameteri (GLenum target, GLenum pname, GLint params) + void glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params) + void glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image) + void glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params) + void glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params) + void glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) + void glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) + void glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_instanced_arrays b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_instanced_arrays new file mode 100644 index 0000000..b1c8873 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_instanced_arrays @@ -0,0 +1,7 @@ +GL_ARB_instanced_arrays +http://www.opengl.org/registry/specs/ARB/instanced_arrays.txt +GL_ARB_instanced_arrays + GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + void glVertexAttribDivisorARB (GLuint index, GLuint divisor) + void glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query new file mode 100644 index 0000000..ac1831e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query @@ -0,0 +1,5 @@ +GL_ARB_internalformat_query +http://www.opengl.org/registry/specs/ARB/internalformat_query.txt +GL_ARB_internalformat_query + GL_NUM_SAMPLE_COUNTS 0x9380 + void glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query2 new file mode 100644 index 0000000..fc84d27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_internalformat_query2 @@ -0,0 +1,116 @@ +GL_ARB_internalformat_query2 +http://www.opengl.org/registry/specs/ARB/internalformat_query2.txt +GL_ARB_internalformat_query2 + GL_TEXTURE_1D 0x0DE0 + GL_TEXTURE_2D 0x0DE1 + GL_TEXTURE_3D 0x806F + GL_SAMPLES 0x80A9 + GL_INTERNALFORMAT_SUPPORTED 0x826F + GL_INTERNALFORMAT_PREFERRED 0x8270 + GL_INTERNALFORMAT_RED_SIZE 0x8271 + GL_INTERNALFORMAT_GREEN_SIZE 0x8272 + GL_INTERNALFORMAT_BLUE_SIZE 0x8273 + GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 + GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 + GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 + GL_INTERNALFORMAT_SHARED_SIZE 0x8277 + GL_INTERNALFORMAT_RED_TYPE 0x8278 + GL_INTERNALFORMAT_GREEN_TYPE 0x8279 + GL_INTERNALFORMAT_BLUE_TYPE 0x827A + GL_INTERNALFORMAT_ALPHA_TYPE 0x827B + GL_INTERNALFORMAT_DEPTH_TYPE 0x827C + GL_INTERNALFORMAT_STENCIL_TYPE 0x827D + GL_MAX_WIDTH 0x827E + GL_MAX_HEIGHT 0x827F + GL_MAX_DEPTH 0x8280 + GL_MAX_LAYERS 0x8281 + GL_MAX_COMBINED_DIMENSIONS 0x8282 + GL_COLOR_COMPONENTS 0x8283 + GL_DEPTH_COMPONENTS 0x8284 + GL_STENCIL_COMPONENTS 0x8285 + GL_COLOR_RENDERABLE 0x8286 + GL_DEPTH_RENDERABLE 0x8287 + GL_STENCIL_RENDERABLE 0x8288 + GL_FRAMEBUFFER_RENDERABLE 0x8289 + GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A + GL_FRAMEBUFFER_BLEND 0x828B + GL_READ_PIXELS 0x828C + GL_READ_PIXELS_FORMAT 0x828D + GL_READ_PIXELS_TYPE 0x828E + GL_TEXTURE_IMAGE_FORMAT 0x828F + GL_TEXTURE_IMAGE_TYPE 0x8290 + GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 + GL_GET_TEXTURE_IMAGE_TYPE 0x8292 + GL_MIPMAP 0x8293 + GL_MANUAL_GENERATE_MIPMAP 0x8294 + GL_AUTO_GENERATE_MIPMAP 0x8295 + GL_COLOR_ENCODING 0x8296 + GL_SRGB_READ 0x8297 + GL_SRGB_WRITE 0x8298 + GL_SRGB_DECODE_ARB 0x8299 + GL_FILTER 0x829A + GL_VERTEX_TEXTURE 0x829B + GL_TESS_CONTROL_TEXTURE 0x829C + GL_TESS_EVALUATION_TEXTURE 0x829D + GL_GEOMETRY_TEXTURE 0x829E + GL_FRAGMENT_TEXTURE 0x829F + GL_COMPUTE_TEXTURE 0x82A0 + GL_TEXTURE_SHADOW 0x82A1 + GL_TEXTURE_GATHER 0x82A2 + GL_TEXTURE_GATHER_SHADOW 0x82A3 + GL_SHADER_IMAGE_LOAD 0x82A4 + GL_SHADER_IMAGE_STORE 0x82A5 + GL_SHADER_IMAGE_ATOMIC 0x82A6 + GL_IMAGE_TEXEL_SIZE 0x82A7 + GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 + GL_IMAGE_PIXEL_FORMAT 0x82A9 + GL_IMAGE_PIXEL_TYPE 0x82AA + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 + GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 + GL_CLEAR_BUFFER 0x82B4 + GL_TEXTURE_VIEW 0x82B5 + GL_VIEW_COMPATIBILITY_CLASS 0x82B6 + GL_FULL_SUPPORT 0x82B7 + GL_CAVEAT_SUPPORT 0x82B8 + GL_IMAGE_CLASS_4_X_32 0x82B9 + GL_IMAGE_CLASS_2_X_32 0x82BA + GL_IMAGE_CLASS_1_X_32 0x82BB + GL_IMAGE_CLASS_4_X_16 0x82BC + GL_IMAGE_CLASS_2_X_16 0x82BD + GL_IMAGE_CLASS_1_X_16 0x82BE + GL_IMAGE_CLASS_4_X_8 0x82BF + GL_IMAGE_CLASS_2_X_8 0x82C0 + GL_IMAGE_CLASS_1_X_8 0x82C1 + GL_IMAGE_CLASS_11_11_10 0x82C2 + GL_IMAGE_CLASS_10_10_10_2 0x82C3 + GL_VIEW_CLASS_128_BITS 0x82C4 + GL_VIEW_CLASS_96_BITS 0x82C5 + GL_VIEW_CLASS_64_BITS 0x82C6 + GL_VIEW_CLASS_48_BITS 0x82C7 + GL_VIEW_CLASS_32_BITS 0x82C8 + GL_VIEW_CLASS_24_BITS 0x82C9 + GL_VIEW_CLASS_16_BITS 0x82CA + GL_VIEW_CLASS_8_BITS 0x82CB + GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC + GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD + GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE + GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF + GL_VIEW_CLASS_RGTC1_RED 0x82D0 + GL_VIEW_CLASS_RGTC2_RG 0x82D1 + GL_VIEW_CLASS_BPTC_UNORM 0x82D2 + GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + GL_TEXTURE_RECTANGLE 0x84F5 + GL_TEXTURE_1D_ARRAY 0x8C18 + GL_TEXTURE_2D_ARRAY 0x8C1A + GL_TEXTURE_BUFFER 0x8C2A + GL_RENDERBUFFER 0x8D41 + GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 + GL_TEXTURE_2D_MULTISAMPLE 0x9100 + GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 + GL_NUM_SAMPLE_COUNTS 0x9380 + void glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_invalidate_subdata b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_invalidate_subdata new file mode 100644 index 0000000..5a91657 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_invalidate_subdata @@ -0,0 +1,9 @@ +GL_ARB_invalidate_subdata +http://www.opengl.org/registry/specs/ARB/invalidate_subdata.txt +GL_ARB_invalidate_subdata + void glInvalidateBufferData (GLuint buffer) + void glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length) + void glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments) + void glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) + void glInvalidateTexImage (GLuint texture, GLint level) + void glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_alignment b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_alignment new file mode 100644 index 0000000..dbb3b36 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_alignment @@ -0,0 +1,4 @@ +GL_ARB_map_buffer_alignment +http://www.opengl.org/registry/specs/ARB/map_buffer_alignment.txt +GL_ARB_map_buffer_alignment + GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_range new file mode 100644 index 0000000..6c55bf6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_map_buffer_range @@ -0,0 +1,11 @@ +GL_ARB_map_buffer_range +http://www.opengl.org/registry/specs/ARB/map_buffer_range.txt +GL_ARB_map_buffer_range + GL_MAP_READ_BIT 0x0001 + GL_MAP_WRITE_BIT 0x0002 + GL_MAP_INVALIDATE_RANGE_BIT 0x0004 + GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 + GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 + GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + void glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length) + GLvoid * glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_matrix_palette b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_matrix_palette new file mode 100644 index 0000000..4b67c15 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_matrix_palette @@ -0,0 +1,18 @@ +GL_ARB_matrix_palette +http://oss.sgi.com/projects/ogl-sample/registry/ARB/matrix_palette.txt +GL_ARB_matrix_palette + GL_MATRIX_PALETTE_ARB 0x8840 + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 + GL_MAX_PALETTE_MATRICES_ARB 0x8842 + GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 + GL_MATRIX_INDEX_ARRAY_ARB 0x8844 + GL_CURRENT_MATRIX_INDEX_ARB 0x8845 + GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 + GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 + GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + void glCurrentPaletteMatrixARB (GLint index) + void glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, GLvoid *pointer) + void glMatrixIndexubvARB (GLint size, GLubyte *indices) + void glMatrixIndexusvARB (GLint size, GLushort *indices) + void glMatrixIndexuivARB (GLint size, GLuint *indices) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multi_draw_indirect b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multi_draw_indirect new file mode 100644 index 0000000..7947cba --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multi_draw_indirect @@ -0,0 +1,5 @@ +GL_ARB_multi_draw_indirect +http://www.opengl.org/registry/specs/ARB/multi_draw_indirect.txt +GL_ARB_multi_draw_indirect + void glMultiDrawArraysIndirect (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride) + void glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multisample new file mode 100644 index 0000000..6abf9e7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multisample @@ -0,0 +1,13 @@ +GL_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +GL_ARB_multisample + GL_MULTISAMPLE_ARB 0x809D + GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E + GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F + GL_SAMPLE_COVERAGE_ARB 0x80A0 + GL_SAMPLE_BUFFERS_ARB 0x80A8 + GL_SAMPLES_ARB 0x80A9 + GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA + GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB + GL_MULTISAMPLE_BIT_ARB 0x20000000 + void glSampleCoverageARB (GLclampf value, GLboolean invert) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multitexture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multitexture new file mode 100644 index 0000000..ee80791 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_multitexture @@ -0,0 +1,72 @@ +GL_ARB_multitexture +http://oss.sgi.com/projects/ogl-sample/registry/ARB/multitexture.txt +GL_ARB_multitexture + GL_TEXTURE0_ARB 0x84C0 + GL_TEXTURE1_ARB 0x84C1 + GL_TEXTURE2_ARB 0x84C2 + GL_TEXTURE3_ARB 0x84C3 + GL_TEXTURE4_ARB 0x84C4 + GL_TEXTURE5_ARB 0x84C5 + GL_TEXTURE6_ARB 0x84C6 + GL_TEXTURE7_ARB 0x84C7 + GL_TEXTURE8_ARB 0x84C8 + GL_TEXTURE9_ARB 0x84C9 + GL_TEXTURE10_ARB 0x84CA + GL_TEXTURE11_ARB 0x84CB + GL_TEXTURE12_ARB 0x84CC + GL_TEXTURE13_ARB 0x84CD + GL_TEXTURE14_ARB 0x84CE + GL_TEXTURE15_ARB 0x84CF + GL_TEXTURE16_ARB 0x84D0 + GL_TEXTURE17_ARB 0x84D1 + GL_TEXTURE18_ARB 0x84D2 + GL_TEXTURE19_ARB 0x84D3 + GL_TEXTURE20_ARB 0x84D4 + GL_TEXTURE21_ARB 0x84D5 + GL_TEXTURE22_ARB 0x84D6 + GL_TEXTURE23_ARB 0x84D7 + GL_TEXTURE24_ARB 0x84D8 + GL_TEXTURE25_ARB 0x84D9 + GL_TEXTURE26_ARB 0x84DA + GL_TEXTURE27_ARB 0x84DB + GL_TEXTURE28_ARB 0x84DC + GL_TEXTURE29_ARB 0x84DD + GL_TEXTURE30_ARB 0x84DE + GL_TEXTURE31_ARB 0x84DF + GL_ACTIVE_TEXTURE_ARB 0x84E0 + GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 + GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + void glActiveTextureARB (GLenum texture) + void glClientActiveTextureARB (GLenum texture) + void glMultiTexCoord1dARB (GLenum target, GLdouble s) + void glMultiTexCoord1dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord1fARB (GLenum target, GLfloat s) + void glMultiTexCoord1fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord1iARB (GLenum target, GLint s) + void glMultiTexCoord1ivARB (GLenum target, const GLint *v) + void glMultiTexCoord1sARB (GLenum target, GLshort s) + void glMultiTexCoord1svARB (GLenum target, const GLshort *v) + void glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t) + void glMultiTexCoord2dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t) + void glMultiTexCoord2fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord2iARB (GLenum target, GLint s, GLint t) + void glMultiTexCoord2ivARB (GLenum target, const GLint *v) + void glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t) + void glMultiTexCoord2svARB (GLenum target, const GLshort *v) + void glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r) + void glMultiTexCoord3dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r) + void glMultiTexCoord3fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r) + void glMultiTexCoord3ivARB (GLenum target, const GLint *v) + void glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r) + void glMultiTexCoord3svARB (GLenum target, const GLshort *v) + void glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) + void glMultiTexCoord4dvARB (GLenum target, const GLdouble *v) + void glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) + void glMultiTexCoord4fvARB (GLenum target, const GLfloat *v) + void glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q) + void glMultiTexCoord4ivARB (GLenum target, const GLint *v) + void glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) + void glMultiTexCoord4svARB (GLenum target, const GLshort *v) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query new file mode 100644 index 0000000..18e10aa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query @@ -0,0 +1,16 @@ +GL_ARB_occlusion_query +http://www.opengl.org/registry/specs/ARB/occlusion_query.txt +GL_ARB_occlusion_query + GL_QUERY_COUNTER_BITS_ARB 0x8864 + GL_CURRENT_QUERY_ARB 0x8865 + GL_QUERY_RESULT_ARB 0x8866 + GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 + GL_SAMPLES_PASSED_ARB 0x8914 + void glBeginQueryARB (GLenum target, GLuint id) + void glDeleteQueriesARB (GLsizei n, const GLuint* ids) + void glEndQueryARB (GLenum target) + void glGenQueriesARB (GLsizei n, GLuint* ids) + void glGetQueryObjectivARB (GLuint id, GLenum pname, GLint* params) + void glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint* params) + void glGetQueryivARB (GLenum target, GLenum pname, GLint* params) + GLboolean glIsQueryARB (GLuint id) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query2 new file mode 100644 index 0000000..5dad013 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_occlusion_query2 @@ -0,0 +1,4 @@ +GL_ARB_occlusion_query2 +http://www.opengl.org/registry/specs/ARB/occlusion_query2.txt +GL_ARB_occlusion_query2 + GL_ANY_SAMPLES_PASSED 0x8C2F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_pixel_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_pixel_buffer_object new file mode 100644 index 0000000..ccec4cc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_pixel_buffer_object @@ -0,0 +1,7 @@ +GL_ARB_pixel_buffer_object +http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt +GL_ARB_pixel_buffer_object + GL_PIXEL_PACK_BUFFER_ARB 0x88EB + GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_parameters b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_parameters new file mode 100644 index 0000000..174ccb6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_parameters @@ -0,0 +1,9 @@ +GL_ARB_point_parameters +http://www.opengl.org/registry/specs/ARB/point_parameters.txt +GL_ARB_point_parameters + GL_POINT_SIZE_MIN_ARB 0x8126 + GL_POINT_SIZE_MAX_ARB 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 + GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + void glPointParameterfARB (GLenum pname, GLfloat param) + void glPointParameterfvARB (GLenum pname, const GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_sprite b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_sprite new file mode 100644 index 0000000..8f2c2e8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_point_sprite @@ -0,0 +1,5 @@ +GL_ARB_point_sprite +http://www.opengl.org/registry/specs/ARB/point_sprite.txt +GL_ARB_point_sprite + GL_POINT_SPRITE_ARB 0x8861 + GL_COORD_REPLACE_ARB 0x8862 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_program_interface_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_program_interface_query new file mode 100644 index 0000000..48e1bfb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_program_interface_query @@ -0,0 +1,56 @@ +GL_ARB_program_interface_query +http://www.opengl.org/registry/specs/ARB/program_interface_query.txt +GL_ARB_program_interface_query + GL_UNIFORM 0x92E1 + GL_UNIFORM_BLOCK 0x92E2 + GL_PROGRAM_INPUT 0x92E3 + GL_PROGRAM_OUTPUT 0x92E4 + GL_BUFFER_VARIABLE 0x92E5 + GL_SHADER_STORAGE_BLOCK 0x92E6 + GL_IS_PER_PATCH 0x92E7 + GL_VERTEX_SUBROUTINE 0x92E8 + GL_TESS_CONTROL_SUBROUTINE 0x92E9 + GL_TESS_EVALUATION_SUBROUTINE 0x92EA + GL_GEOMETRY_SUBROUTINE 0x92EB + GL_FRAGMENT_SUBROUTINE 0x92EC + GL_COMPUTE_SUBROUTINE 0x92ED + GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE + GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 + GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 + GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 + GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 + GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 + GL_ACTIVE_RESOURCES 0x92F5 + GL_MAX_NAME_LENGTH 0x92F6 + GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 + GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 + GL_NAME_LENGTH 0x92F9 + GL_TYPE 0x92FA + GL_ARRAY_SIZE 0x92FB + GL_OFFSET 0x92FC + GL_BLOCK_INDEX 0x92FD + GL_ARRAY_STRIDE 0x92FE + GL_MATRIX_STRIDE 0x92FF + GL_IS_ROW_MAJOR 0x9300 + GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 + GL_BUFFER_BINDING 0x9302 + GL_BUFFER_DATA_SIZE 0x9303 + GL_NUM_ACTIVE_VARIABLES 0x9304 + GL_ACTIVE_VARIABLES 0x9305 + GL_REFERENCED_BY_VERTEX_SHADER 0x9306 + GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 + GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 + GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 + GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A + GL_REFERENCED_BY_COMPUTE_SHADER 0x930B + GL_TOP_LEVEL_ARRAY_SIZE 0x930C + GL_TOP_LEVEL_ARRAY_STRIDE 0x930D + GL_LOCATION 0x930E + GL_LOCATION_INDEX 0x930F + void glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint* params) + GLuint glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar* name) + GLint glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar* name) + GLint glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar* name) + void glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name) + void glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_provoking_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_provoking_vertex new file mode 100644 index 0000000..3e2f16d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_provoking_vertex @@ -0,0 +1,8 @@ +GL_ARB_provoking_vertex +http://www.opengl.org/registry/specs/ARB/provoking_vertex.txt +GL_ARB_provoking_vertex + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C + GL_FIRST_VERTEX_CONVENTION 0x8E4D + GL_LAST_VERTEX_CONVENTION 0x8E4E + GL_PROVOKING_VERTEX 0x8E4F + void glProvokingVertex (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robust_buffer_access_behavior b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robust_buffer_access_behavior new file mode 100644 index 0000000..ed417c9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robust_buffer_access_behavior @@ -0,0 +1,3 @@ +GL_ARB_robust_buffer_access_behavior +http://www.opengl.org/registry/specs/ARB/robust_buffer_access_behavior.txt +GL_ARB_robust_buffer_access_behavior diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness new file mode 100644 index 0000000..cdeeb4f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness @@ -0,0 +1,30 @@ +GL_ARB_robustness +http://www.opengl.org/registry/specs/ARB/robustness.txt +GL_ARB_robustness + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 + GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + GL_GUILTY_CONTEXT_RESET_ARB 0x8253 + GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 + GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 + GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + GL_NO_RESET_NOTIFICATION_ARB 0x8261 + GLenum glGetGraphicsResetStatusARB (void) + void glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table) + void glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void* img) + void glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image) + void glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v) + void glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v) + void glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint* v) + void glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values) + void glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat* values) + void glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint* values) + void glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort* values) + void glGetnPolygonStippleARB (GLsizei bufSize, GLubyte* pattern) + void glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span) + void glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img) + void glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble* params) + void glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat* params) + void glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint* params) + void glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint* params) + void glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_application_isolation b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_application_isolation new file mode 100644 index 0000000..0bf9663 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_application_isolation @@ -0,0 +1,3 @@ +GL_ARB_robustness_application_isolation +http://www.opengl.org/registry/specs/ARB/robustness_isolation.txt +GL_ARB_robustness_application_isolation diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_share_group_isolation b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_share_group_isolation new file mode 100644 index 0000000..3a9fb0e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_robustness_share_group_isolation @@ -0,0 +1,3 @@ +GL_ARB_robustness_share_group_isolation +http://www.opengl.org/registry/specs/ARB/robustness_isolation.txt +GL_ARB_robustness_share_group_isolation diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sample_shading b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sample_shading new file mode 100644 index 0000000..0d8b105 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sample_shading @@ -0,0 +1,6 @@ +GL_ARB_sample_shading +http://www.opengl.org/registry/specs/ARB/sample_shading.txt +GL_ARB_sample_shading + GL_SAMPLE_SHADING_ARB 0x8C36 + GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + void glMinSampleShadingARB (GLclampf value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sampler_objects b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sampler_objects new file mode 100644 index 0000000..c942390 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sampler_objects @@ -0,0 +1,18 @@ +GL_ARB_sampler_objects +http://www.opengl.org/registry/specs/ARB/sampler_objects.txt +GL_ARB_sampler_objects + GL_SAMPLER_BINDING 0x8919 + void glBindSampler (GLuint unit, GLuint sampler) + void glDeleteSamplers (GLsizei count, const GLuint * samplers) + void glGenSamplers (GLsizei count, GLuint* samplers) + void glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint* params) + void glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint* params) + void glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat* params) + void glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint* params) + GLboolean glIsSampler (GLuint sampler) + void glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint* params) + void glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint* params) + void glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param) + void glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat* params) + void glSamplerParameteri (GLuint sampler, GLenum pname, GLint param) + void glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_seamless_cube_map b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_seamless_cube_map new file mode 100644 index 0000000..c6b5941 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_seamless_cube_map @@ -0,0 +1,4 @@ +GL_ARB_seamless_cube_map +http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt +GL_ARB_seamless_cube_map + GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_separate_shader_objects b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_separate_shader_objects new file mode 100644 index 0000000..b90b68a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_separate_shader_objects @@ -0,0 +1,72 @@ +GL_ARB_separate_shader_objects +http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt +GL_ARB_separate_shader_objects + GL_VERTEX_SHADER_BIT 0x00000001 + GL_FRAGMENT_SHADER_BIT 0x00000002 + GL_GEOMETRY_SHADER_BIT 0x00000004 + GL_TESS_CONTROL_SHADER_BIT 0x00000008 + GL_TESS_EVALUATION_SHADER_BIT 0x00000010 + GL_PROGRAM_SEPARABLE 0x8258 + GL_ACTIVE_PROGRAM 0x8259 + GL_PROGRAM_PIPELINE_BINDING 0x825A + GL_ALL_SHADER_BITS 0xFFFFFFFF + void glActiveShaderProgram (GLuint pipeline, GLuint program) + void glBindProgramPipeline (GLuint pipeline) + GLuint glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar ** strings) + void glDeleteProgramPipelines (GLsizei n, const GLuint* pipelines) + void glGenProgramPipelines (GLsizei n, GLuint* pipelines) + void glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog) + void glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint* params) + GLboolean glIsProgramPipeline (GLuint pipeline) + void glProgramUniform1d (GLuint program, GLint location, GLdouble x) + void glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform1f (GLuint program, GLint location, GLfloat x) + void glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1i (GLuint program, GLint location, GLint x) + void glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1ui (GLuint program, GLint location, GLuint x) + void glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2d (GLuint program, GLint location, GLdouble x, GLdouble y) + void glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform2f (GLuint program, GLint location, GLfloat x, GLfloat y) + void glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2i (GLuint program, GLint location, GLint x, GLint y) + void glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2ui (GLuint program, GLint location, GLuint x, GLuint y) + void glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) + void glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform3f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) + void glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3i (GLuint program, GLint location, GLint x, GLint y, GLint z) + void glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z) + void glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4d (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble* value) + void glProgramUniform4f (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4i (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) + void glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4ui (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value) + void glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program) + void glValidateProgramPipeline (GLuint pipeline) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_atomic_counters b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_atomic_counters new file mode 100644 index 0000000..3093371 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_atomic_counters @@ -0,0 +1,33 @@ +GL_ARB_shader_atomic_counters +http://www.opengl.org/registry/specs/ARB/shader_atomic_counters.txt +GL_ARB_shader_atomic_counters + GL_ATOMIC_COUNTER_BUFFER 0x92C0 + GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 + GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 + GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 + GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 + GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 + GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 + GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 + GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 + GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA + GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + void glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_bit_encoding b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_bit_encoding new file mode 100644 index 0000000..9c00ed7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_bit_encoding @@ -0,0 +1,3 @@ +GL_ARB_shader_bit_encoding +http://www.opengl.org/registry/specs/ARB/shader_bit_encoding.txt +GL_ARB_shader_bit_encoding diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_load_store b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_load_store new file mode 100644 index 0000000..649c7e6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_load_store @@ -0,0 +1,69 @@ +GL_ARB_shader_image_load_store +http://www.opengl.org/registry/specs/ARB/shader_image_load_store.txt +GL_ARB_shader_image_load_store + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 + GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 + GL_UNIFORM_BARRIER_BIT 0x00000004 + GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 + GL_COMMAND_BARRIER_BIT 0x00000040 + GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 + GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 + GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 + GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 + GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 + GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 + GL_MAX_IMAGE_UNITS 0x8F38 + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 + GL_IMAGE_BINDING_NAME 0x8F3A + GL_IMAGE_BINDING_LEVEL 0x8F3B + GL_IMAGE_BINDING_LAYERED 0x8F3C + GL_IMAGE_BINDING_LAYER 0x8F3D + GL_IMAGE_BINDING_ACCESS 0x8F3E + GL_IMAGE_1D 0x904C + GL_IMAGE_2D 0x904D + GL_IMAGE_3D 0x904E + GL_IMAGE_2D_RECT 0x904F + GL_IMAGE_CUBE 0x9050 + GL_IMAGE_BUFFER 0x9051 + GL_IMAGE_1D_ARRAY 0x9052 + GL_IMAGE_2D_ARRAY 0x9053 + GL_IMAGE_CUBE_MAP_ARRAY 0x9054 + GL_IMAGE_2D_MULTISAMPLE 0x9055 + GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 + GL_INT_IMAGE_1D 0x9057 + GL_INT_IMAGE_2D 0x9058 + GL_INT_IMAGE_3D 0x9059 + GL_INT_IMAGE_2D_RECT 0x905A + GL_INT_IMAGE_CUBE 0x905B + GL_INT_IMAGE_BUFFER 0x905C + GL_INT_IMAGE_1D_ARRAY 0x905D + GL_INT_IMAGE_2D_ARRAY 0x905E + GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F + GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 + GL_UNSIGNED_INT_IMAGE_1D 0x9062 + GL_UNSIGNED_INT_IMAGE_2D 0x9063 + GL_UNSIGNED_INT_IMAGE_3D 0x9064 + GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 + GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 + GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 + GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 + GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C + GL_MAX_IMAGE_SAMPLES 0x906D + GL_IMAGE_BINDING_FORMAT 0x906E + GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 + GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC + GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD + GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE + GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF + GL_ALL_BARRIER_BITS 0xFFFFFFFF + void glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) + void glMemoryBarrier (GLbitfield barriers) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_size b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_size new file mode 100644 index 0000000..10d2603 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_image_size @@ -0,0 +1,3 @@ +GL_ARB_shader_image_size +http://www.opengl.org/registry/specs/ARB/shader_image_size.txt +GL_ARB_shader_image_size diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_objects b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_objects new file mode 100644 index 0000000..fc24d97 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_objects @@ -0,0 +1,78 @@ +GL_ARB_shader_objects +http://www.opengl.org/registry/specs/ARB/shader_objects.txt +GL_ARB_shader_objects + GL_PROGRAM_OBJECT_ARB 0x8B40 + GL_SHADER_OBJECT_ARB 0x8B48 + GL_OBJECT_TYPE_ARB 0x8B4E + GL_OBJECT_SUBTYPE_ARB 0x8B4F + GL_FLOAT_VEC2_ARB 0x8B50 + GL_FLOAT_VEC3_ARB 0x8B51 + GL_FLOAT_VEC4_ARB 0x8B52 + GL_INT_VEC2_ARB 0x8B53 + GL_INT_VEC3_ARB 0x8B54 + GL_INT_VEC4_ARB 0x8B55 + GL_BOOL_ARB 0x8B56 + GL_BOOL_VEC2_ARB 0x8B57 + GL_BOOL_VEC3_ARB 0x8B58 + GL_BOOL_VEC4_ARB 0x8B59 + GL_FLOAT_MAT2_ARB 0x8B5A + GL_FLOAT_MAT3_ARB 0x8B5B + GL_FLOAT_MAT4_ARB 0x8B5C + GL_SAMPLER_1D_ARB 0x8B5D + GL_SAMPLER_2D_ARB 0x8B5E + GL_SAMPLER_3D_ARB 0x8B5F + GL_SAMPLER_CUBE_ARB 0x8B60 + GL_SAMPLER_1D_SHADOW_ARB 0x8B61 + GL_SAMPLER_2D_SHADOW_ARB 0x8B62 + GL_SAMPLER_2D_RECT_ARB 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + GL_OBJECT_DELETE_STATUS_ARB 0x8B80 + GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 + GL_OBJECT_LINK_STATUS_ARB 0x8B82 + GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 + GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 + GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 + GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 + GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 + GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + void glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj) + void glCompileShaderARB (GLhandleARB shaderObj) + GLhandleARB glCreateProgramObjectARB (void) + GLhandleARB glCreateShaderObjectARB (GLenum shaderType) + void glDeleteObjectARB (GLhandleARB obj) + void glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj) + void glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name) + void glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj) + GLhandleARB glGetHandleARB (GLenum pname) + void glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog) + void glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat* params) + void glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint* params) + void glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source) + GLint glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB* name) + void glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat* params) + void glGetUniformivARB (GLhandleARB programObj, GLint location, GLint* params) + void glLinkProgramARB (GLhandleARB programObj) + void glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length) + void glUniform1fARB (GLint location, GLfloat v0) + void glUniform1fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform1iARB (GLint location, GLint v0) + void glUniform1ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform2fARB (GLint location, GLfloat v0, GLfloat v1) + void glUniform2fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform2iARB (GLint location, GLint v0, GLint v1) + void glUniform2ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glUniform3fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2) + void glUniform3ivARB (GLint location, GLsizei count, const GLint* value) + void glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glUniform4fvARB (GLint location, GLsizei count, const GLfloat* value) + void glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glUniform4ivARB (GLint location, GLsizei count, const GLint* value) + void glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glUseProgramObjectARB (GLhandleARB programObj) + void glValidateProgramARB (GLhandleARB programObj) + typedef char GLcharARB + typedef unsigned int GLhandleARB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_precision b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_precision new file mode 100644 index 0000000..9197990 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_precision @@ -0,0 +1,3 @@ +GL_ARB_shader_precision +http://www.opengl.org/registry/specs/ARB/shader_precision.txt +GL_ARB_shader_precision diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_stencil_export b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_stencil_export new file mode 100644 index 0000000..d708ea2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_stencil_export @@ -0,0 +1,3 @@ +GL_ARB_shader_stencil_export +http://www.opengl.org/registry/specs/ARB/shader_stencil_export.txt +GL_ARB_shader_stencil_export diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_storage_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_storage_buffer_object new file mode 100644 index 0000000..3243ab0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_storage_buffer_object @@ -0,0 +1,20 @@ +GL_ARB_shader_storage_buffer_object +http://www.opengl.org/registry/specs/ARB/shader_storage_buffer_object.txt +GL_ARB_shader_storage_buffer_object + GL_SHADER_STORAGE_BARRIER_BIT 0x2000 + GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 + GL_SHADER_STORAGE_BUFFER 0x90D2 + GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 + GL_SHADER_STORAGE_BUFFER_START 0x90D4 + GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD + GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + void glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_subroutine b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_subroutine new file mode 100644 index 0000000..0befae3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_subroutine @@ -0,0 +1,20 @@ +GL_ARB_shader_subroutine +http://www.opengl.org/registry/specs/ARB/shader_subroutine.txt +GL_ARB_shader_subroutine + GL_ACTIVE_SUBROUTINES 0x8DE5 + GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 + GL_MAX_SUBROUTINES 0x8DE7 + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 + GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 + GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A + GL_COMPATIBLE_SUBROUTINES 0x8E4B + void glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name) + void glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name) + void glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values) + void glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint* values) + GLuint glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar* name) + GLint glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar* name) + void glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint* params) + void glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint* indices) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_texture_lod b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_texture_lod new file mode 100644 index 0000000..1366c86 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shader_texture_lod @@ -0,0 +1,3 @@ +GL_ARB_shader_texture_lod +http://www.opengl.org/registry/specs/ARB/shader_texture_lod.txt +GL_ARB_shader_texture_lod diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_100 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_100 new file mode 100644 index 0000000..53cd0d4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_100 @@ -0,0 +1,4 @@ +GL_ARB_shading_language_100 +http://www.opengl.org/registry/specs/ARB/shading_language_100.txt +GL_ARB_shading_language_100 + GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_420pack b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_420pack new file mode 100644 index 0000000..7f1bcc7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_420pack @@ -0,0 +1,3 @@ +GL_ARB_shading_language_420pack +http://www.opengl.org/registry/specs/ARB/shading_language_420pack.txt +GL_ARB_shading_language_420pack diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_include b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_include new file mode 100644 index 0000000..91911d2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_include @@ -0,0 +1,12 @@ +GL_ARB_shading_language_include +http://www.opengl.org/registry/specs/ARB/shading_language_include.txt +GL_ARB_shading_language_include + GL_SHADER_INCLUDE_ARB 0x8DAE + GL_NAMED_STRING_LENGTH_ARB 0x8DE9 + GL_NAMED_STRING_TYPE_ARB 0x8DEA + void glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar ** path, const GLint *length) + void glDeleteNamedStringARB (GLint namelen, const GLchar* name) + void glGetNamedStringARB (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string) + void glGetNamedStringivARB (GLint namelen, const GLchar* name, GLenum pname, GLint *params) + GLboolean glIsNamedStringARB (GLint namelen, const GLchar* name) + void glNamedStringARB (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_packing b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_packing new file mode 100644 index 0000000..2c47033 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shading_language_packing @@ -0,0 +1,3 @@ +GL_ARB_shading_language_packing +http://www.opengl.org/registry/specs/ARB/shading_language_packing.txt +GL_ARB_shading_language_packing diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow new file mode 100644 index 0000000..eeaca30 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow @@ -0,0 +1,6 @@ +GL_ARB_shadow +http://www.opengl.org/registry/specs/ARB/shadow.txt +GL_ARB_shadow + GL_TEXTURE_COMPARE_MODE_ARB 0x884C + GL_TEXTURE_COMPARE_FUNC_ARB 0x884D + GL_COMPARE_R_TO_TEXTURE_ARB 0x884E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow_ambient b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow_ambient new file mode 100644 index 0000000..d2e13a0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_shadow_ambient @@ -0,0 +1,4 @@ +GL_ARB_shadow_ambient +http://www.opengl.org/registry/specs/ARB/shadow_ambient.txt +GL_ARB_shadow_ambient + GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_stencil_texturing b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_stencil_texturing new file mode 100644 index 0000000..f82fb1c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_stencil_texturing @@ -0,0 +1,4 @@ +GL_ARB_stencil_texturing +http://www.opengl.org/registry/specs/ARB/stencil_texturing.txt +GL_ARB_stencil_texturing + GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sync b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sync new file mode 100644 index 0000000..883dc89 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_sync @@ -0,0 +1,25 @@ +GL_ARB_sync +http://www.opengl.org/registry/specs/ARB/sync.txt +GL_ARB_sync + GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 + GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 + GL_OBJECT_TYPE 0x9112 + GL_SYNC_CONDITION 0x9113 + GL_SYNC_STATUS 0x9114 + GL_SYNC_FLAGS 0x9115 + GL_SYNC_FENCE 0x9116 + GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 + GL_UNSIGNALED 0x9118 + GL_SIGNALED 0x9119 + GL_ALREADY_SIGNALED 0x911A + GL_TIMEOUT_EXPIRED 0x911B + GL_CONDITION_SATISFIED 0x911C + GL_WAIT_FAILED 0x911D + GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + GLenum glClientWaitSync (GLsync GLsync,GLbitfield flags,GLuint64 timeout) + void glDeleteSync (GLsync GLsync) + GLsync glFenceSync (GLenum condition,GLbitfield flags) + void glGetInteger64v (GLenum pname, GLint64* params) + void glGetSynciv (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values) + GLboolean glIsSync (GLsync GLsync) + void glWaitSync (GLsync GLsync,GLbitfield flags,GLuint64 timeout) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_tessellation_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_tessellation_shader new file mode 100644 index 0000000..c737650 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_tessellation_shader @@ -0,0 +1,37 @@ +GL_ARB_tessellation_shader +http://www.opengl.org/registry/specs/ARB/tessellation_shader.txt +GL_ARB_tessellation_shader + GL_PATCHES 0xE + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F + GL_PATCH_VERTICES 0x8E72 + GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 + GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 + GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 + GL_TESS_GEN_MODE 0x8E76 + GL_TESS_GEN_SPACING 0x8E77 + GL_TESS_GEN_VERTEX_ORDER 0x8E78 + GL_TESS_GEN_POINT_MODE 0x8E79 + GL_ISOLINES 0x8E7A + GL_FRACTIONAL_ODD 0x8E7B + GL_FRACTIONAL_EVEN 0x8E7C + GL_MAX_PATCH_VERTICES 0x8E7D + GL_MAX_TESS_GEN_LEVEL 0x8E7E + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 + GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 + GL_TESS_EVALUATION_SHADER 0x8E87 + GL_TESS_CONTROL_SHADER 0x8E88 + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + void glPatchParameterfv (GLenum pname, const GLfloat* values) + void glPatchParameteri (GLenum pname, GLint value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_border_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_border_clamp new file mode 100644 index 0000000..14e74fb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_border_clamp @@ -0,0 +1,4 @@ +GL_ARB_texture_border_clamp +http://www.opengl.org/registry/specs/ARB/texture_border_clamp.txt +GL_ARB_texture_border_clamp + GL_CLAMP_TO_BORDER_ARB 0x812D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object new file mode 100644 index 0000000..bae7fc6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object @@ -0,0 +1,9 @@ +GL_ARB_texture_buffer_object +http://www.opengl.org/registry/specs/ARB/texture_buffer_object.txt +GL_ARB_texture_buffer_object + GL_TEXTURE_BUFFER_ARB 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B + GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + void glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object_rgb32 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object_rgb32 new file mode 100644 index 0000000..ddac257 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_object_rgb32 @@ -0,0 +1,3 @@ +GL_ARB_texture_buffer_object_rgb32 +http://www.opengl.org/registry/specs/ARB/texture_buffer_object_rgb32.txt +GL_ARB_texture_buffer_object_rgb32 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_range new file mode 100644 index 0000000..88e519a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_buffer_range @@ -0,0 +1,8 @@ +GL_ARB_texture_buffer_range +http://www.opengl.org/registry/specs/ARB/texture_buffer_range.txt +GL_ARB_texture_buffer_range + GL_TEXTURE_BUFFER_OFFSET 0x919D + GL_TEXTURE_BUFFER_SIZE 0x919E + GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + void glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression new file mode 100644 index 0000000..c32a6fb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression @@ -0,0 +1,21 @@ +GL_ARB_texture_compression +http://www.opengl.org/registry/specs/ARB/texture_compression.txt +GL_ARB_texture_compression + GL_COMPRESSED_ALPHA_ARB 0x84E9 + GL_COMPRESSED_LUMINANCE_ARB 0x84EA + GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB + GL_COMPRESSED_INTENSITY_ARB 0x84EC + GL_COMPRESSED_RGB_ARB 0x84ED + GL_COMPRESSED_RGBA_ARB 0x84EE + GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF + GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 + GL_TEXTURE_COMPRESSED_ARB 0x86A1 + GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 + GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + void glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data) + void glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) + void glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) + void glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data) + void glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) + void glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) + void glGetCompressedTexImageARB (GLenum target, GLint lod, void* img) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_bptc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_bptc new file mode 100644 index 0000000..a476d78 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_bptc @@ -0,0 +1,7 @@ +GL_ARB_texture_compression_bptc +http://www.opengl.org/registry/specs/ARB/texture_compression_bptc.txt +GL_ARB_texture_compression_bptc + GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_rgtc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_rgtc new file mode 100644 index 0000000..233597e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_compression_rgtc @@ -0,0 +1,7 @@ +GL_ARB_texture_compression_rgtc +http://www.opengl.org/registry/specs/ARB/texture_compression_rgtc.txt +GL_ARB_texture_compression_rgtc + GL_COMPRESSED_RED_RGTC1 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC + GL_COMPRESSED_RG_RGTC2 0x8DBD + GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map new file mode 100644 index 0000000..67f232e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map @@ -0,0 +1,15 @@ +GL_ARB_texture_cube_map +http://www.opengl.org/registry/specs/ARB/texture_cube_map.txt +GL_ARB_texture_cube_map + GL_NORMAL_MAP_ARB 0x8511 + GL_REFLECTION_MAP_ARB 0x8512 + GL_TEXTURE_CUBE_MAP_ARB 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map_array new file mode 100644 index 0000000..fcb7223 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_cube_map_array @@ -0,0 +1,10 @@ +GL_ARB_texture_cube_map_array +http://www.opengl.org/registry/specs/ARB/texture_cube_map_array.txt +GL_ARB_texture_cube_map_array + GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B + GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D + GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_add b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_add new file mode 100644 index 0000000..9f6f889 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_add @@ -0,0 +1,3 @@ +GL_ARB_texture_env_add +http://www.opengl.org/registry/specs/ARB/texture_env_add.txt +GL_ARB_texture_env_add diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_combine b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_combine new file mode 100644 index 0000000..94d689e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_combine @@ -0,0 +1,25 @@ +GL_ARB_texture_env_combine +http://www.opengl.org/registry/specs/ARB/texture_env_combine.txt +GL_ARB_texture_env_combine + GL_SUBTRACT_ARB 0x84E7 + GL_COMBINE_ARB 0x8570 + GL_COMBINE_RGB_ARB 0x8571 + GL_COMBINE_ALPHA_ARB 0x8572 + GL_RGB_SCALE_ARB 0x8573 + GL_ADD_SIGNED_ARB 0x8574 + GL_INTERPOLATE_ARB 0x8575 + GL_CONSTANT_ARB 0x8576 + GL_PRIMARY_COLOR_ARB 0x8577 + GL_PREVIOUS_ARB 0x8578 + GL_SOURCE0_RGB_ARB 0x8580 + GL_SOURCE1_RGB_ARB 0x8581 + GL_SOURCE2_RGB_ARB 0x8582 + GL_SOURCE0_ALPHA_ARB 0x8588 + GL_SOURCE1_ALPHA_ARB 0x8589 + GL_SOURCE2_ALPHA_ARB 0x858A + GL_OPERAND0_RGB_ARB 0x8590 + GL_OPERAND1_RGB_ARB 0x8591 + GL_OPERAND2_RGB_ARB 0x8592 + GL_OPERAND0_ALPHA_ARB 0x8598 + GL_OPERAND1_ALPHA_ARB 0x8599 + GL_OPERAND2_ALPHA_ARB 0x859A diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_crossbar b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_crossbar new file mode 100644 index 0000000..93aa97f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_crossbar @@ -0,0 +1,3 @@ +GL_ARB_texture_env_crossbar +http://www.opengl.org/registry/specs/ARB/texture_env_crossbar.txt +GL_ARB_texture_env_crossbar diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_dot3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_dot3 new file mode 100644 index 0000000..6e6587f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_env_dot3 @@ -0,0 +1,5 @@ +GL_ARB_texture_env_dot3 +http://www.opengl.org/registry/specs/ARB/texture_env_dot3.txt +GL_ARB_texture_env_dot3 + GL_DOT3_RGB_ARB 0x86AE + GL_DOT3_RGBA_ARB 0x86AF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_float new file mode 100644 index 0000000..14d0de6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_float @@ -0,0 +1,23 @@ +GL_ARB_texture_float +http://www.opengl.org/registry/specs/ARB/texture_float.txt +GL_ARB_texture_float + GL_RGBA32F_ARB 0x8814 + GL_RGB32F_ARB 0x8815 + GL_ALPHA32F_ARB 0x8816 + GL_INTENSITY32F_ARB 0x8817 + GL_LUMINANCE32F_ARB 0x8818 + GL_LUMINANCE_ALPHA32F_ARB 0x8819 + GL_RGBA16F_ARB 0x881A + GL_RGB16F_ARB 0x881B + GL_ALPHA16F_ARB 0x881C + GL_INTENSITY16F_ARB 0x881D + GL_LUMINANCE16F_ARB 0x881E + GL_LUMINANCE_ALPHA16F_ARB 0x881F + GL_TEXTURE_RED_TYPE_ARB 0x8C10 + GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 + GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 + GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 + GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 + GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 + GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 + GL_UNSIGNED_NORMALIZED_ARB 0x8C17 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_gather b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_gather new file mode 100644 index 0000000..0f5fd18 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_gather @@ -0,0 +1,6 @@ +GL_ARB_texture_gather +http://www.opengl.org/registry/specs/ARB/texture_gather.txt +GL_ARB_texture_gather + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F + GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_mirrored_repeat b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_mirrored_repeat new file mode 100644 index 0000000..6d664e9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_mirrored_repeat @@ -0,0 +1,4 @@ +GL_ARB_texture_mirrored_repeat +http://www.opengl.org/registry/specs/ARB/texture_mirrored_repeat.txt +GL_ARB_texture_mirrored_repeat + GL_MIRRORED_REPEAT_ARB 0x8370 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_multisample new file mode 100644 index 0000000..9e0e896 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_multisample @@ -0,0 +1,28 @@ +GL_ARB_texture_multisample +http://www.opengl.org/registry/specs/ARB/texture_multisample.txt +GL_ARB_texture_multisample + GL_SAMPLE_POSITION 0x8E50 + GL_SAMPLE_MASK 0x8E51 + GL_SAMPLE_MASK_VALUE 0x8E52 + GL_MAX_SAMPLE_MASK_WORDS 0x8E59 + GL_TEXTURE_2D_MULTISAMPLE 0x9100 + GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 + GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 + GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 + GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 + GL_TEXTURE_SAMPLES 0x9106 + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 + GL_SAMPLER_2D_MULTISAMPLE 0x9108 + GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A + GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D + GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E + GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F + GL_MAX_INTEGER_SAMPLES 0x9110 + void glGetMultisamplefv (GLenum pname, GLuint index, GLfloat* val) + void glSampleMaski (GLuint index, GLbitfield mask) + void glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_non_power_of_two b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_non_power_of_two new file mode 100644 index 0000000..c711111 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_non_power_of_two @@ -0,0 +1,3 @@ +GL_ARB_texture_non_power_of_two +http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt +GL_ARB_texture_non_power_of_two diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_levels b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_levels new file mode 100644 index 0000000..4250f8b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_levels @@ -0,0 +1,3 @@ +GL_ARB_texture_query_levels +http://www.opengl.org/registry/specs/ARB/texture_query_levels.txt +GL_ARB_texture_query_levels diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_lod b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_lod new file mode 100644 index 0000000..981dc84 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_query_lod @@ -0,0 +1,3 @@ +GL_ARB_texture_query_lod +http://www.opengl.org/registry/specs/ARB/texture_query_lod.txt +GL_ARB_texture_query_lod diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rectangle new file mode 100644 index 0000000..33915d1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rectangle @@ -0,0 +1,9 @@ +GL_ARB_texture_rectangle +http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt +GL_ARB_texture_rectangle + GL_TEXTURE_RECTANGLE_ARB 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 + GL_SAMPLER_2D_RECT_ARB 0x8B63 + GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rg b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rg new file mode 100644 index 0000000..2187ff6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rg @@ -0,0 +1,27 @@ +GL_ARB_texture_rg +http://www.opengl.org/registry/specs/ARB/texture_rg.txt +GL_ARB_texture_rg + GL_COMPRESSED_RED 0x8225 + GL_COMPRESSED_RG 0x8226 + GL_RG 0x8227 + GL_RG_INTEGER 0x8228 + GL_R8 0x8229 + GL_R16 0x822A + GL_RG8 0x822B + GL_RG16 0x822C + GL_R16F 0x822D + GL_R32F 0x822E + GL_RG16F 0x822F + GL_RG32F 0x8230 + GL_R8I 0x8231 + GL_R8UI 0x8232 + GL_R16I 0x8233 + GL_R16UI 0x8234 + GL_R32I 0x8235 + GL_R32UI 0x8236 + GL_RG8I 0x8237 + GL_RG8UI 0x8238 + GL_RG16I 0x8239 + GL_RG16UI 0x823A + GL_RG32I 0x823B + GL_RG32UI 0x823C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rgb10_a2ui b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rgb10_a2ui new file mode 100644 index 0000000..7e5d4db --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_rgb10_a2ui @@ -0,0 +1,4 @@ +GL_ARB_texture_rgb10_a2ui +http://www.opengl.org/registry/specs/ARB/texture_rgb10_a2ui.txt +GL_ARB_texture_rgb10_a2ui + GL_RGB10_A2UI 0x906F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage new file mode 100644 index 0000000..2c33f63 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage @@ -0,0 +1,10 @@ +GL_ARB_texture_storage +http://www.opengl.org/registry/specs/ARB/texture_storage.txt +GL_ARB_texture_storage + GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + void glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) + void glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) + void glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) + void glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) + void glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage_multisample new file mode 100644 index 0000000..c2bcc3f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_storage_multisample @@ -0,0 +1,7 @@ +GL_ARB_texture_storage_multisample +http://www.opengl.org/registry/specs/ARB/texture_storage_multisample.txt +GL_ARB_texture_storage_multisample + void glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) + void glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) + void glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_swizzle b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_swizzle new file mode 100644 index 0000000..4553324 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_swizzle @@ -0,0 +1,8 @@ +GL_ARB_texture_swizzle +http://www.opengl.org/registry/specs/ARB/texture_swizzle.txt +GL_ARB_texture_swizzle + GL_TEXTURE_SWIZZLE_R 0x8E42 + GL_TEXTURE_SWIZZLE_G 0x8E43 + GL_TEXTURE_SWIZZLE_B 0x8E44 + GL_TEXTURE_SWIZZLE_A 0x8E45 + GL_TEXTURE_SWIZZLE_RGBA 0x8E46 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_view b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_view new file mode 100644 index 0000000..7b86f69 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_texture_view @@ -0,0 +1,9 @@ +GL_ARB_texture_view +http://www.opengl.org/registry/specs/ARB/texture_view.txt +GL_ARB_texture_view + GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB + GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC + GL_TEXTURE_VIEW_MIN_LAYER 0x82DD + GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE + GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + void glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_timer_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_timer_query new file mode 100644 index 0000000..6f64ace --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_timer_query @@ -0,0 +1,8 @@ +GL_ARB_timer_query +http://www.opengl.org/registry/specs/ARB/timer_query.txt +GL_ARB_timer_query + GL_TIME_ELAPSED 0x88BF + GL_TIMESTAMP 0x8E28 + void glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64* params) + void glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64* params) + void glQueryCounter (GLuint id, GLenum target) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback2 new file mode 100644 index 0000000..06c3626 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback2 @@ -0,0 +1,14 @@ +GL_ARB_transform_feedback2 +http://www.opengl.org/registry/specs/ARB/transform_feedback2.txt +GL_ARB_transform_feedback2 + GL_TRANSFORM_FEEDBACK 0x8E22 + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 + GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + void glBindTransformFeedback (GLenum target, GLuint id) + void glDeleteTransformFeedbacks (GLsizei n, const GLuint* ids) + void glDrawTransformFeedback (GLenum mode, GLuint id) + void glGenTransformFeedbacks (GLsizei n, GLuint* ids) + GLboolean glIsTransformFeedback (GLuint id) + void glPauseTransformFeedback (void) + void glResumeTransformFeedback (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback3 new file mode 100644 index 0000000..37e8f35 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback3 @@ -0,0 +1,9 @@ +GL_ARB_transform_feedback3 +http://www.opengl.org/registry/specs/ARB/transform_feedback3.txt +GL_ARB_transform_feedback3 + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 + GL_MAX_VERTEX_STREAMS 0x8E71 + void glBeginQueryIndexed (GLenum target, GLuint index, GLuint id) + void glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream) + void glEndQueryIndexed (GLenum target, GLuint index) + void glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback_instanced b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback_instanced new file mode 100644 index 0000000..8953038 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transform_feedback_instanced @@ -0,0 +1,5 @@ +GL_ARB_transform_feedback_instanced +http://www.opengl.org/registry/specs/ARB/transform_feedback_instanced.txt +GL_ARB_transform_feedback_instanced + void glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount) + void glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transpose_matrix b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transpose_matrix new file mode 100644 index 0000000..e869bd5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_transpose_matrix @@ -0,0 +1,11 @@ +GL_ARB_transpose_matrix +http://www.opengl.org/registry/specs/ARB/transpose_matrix.txt +GL_ARB_transpose_matrix + GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 + GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 + GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 + GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + void glLoadTransposeMatrixfARB (GLfloat m[16]) + void glLoadTransposeMatrixdARB (GLdouble m[16]) + void glMultTransposeMatrixfARB (GLfloat m[16]) + void glMultTransposeMatrixdARB (GLdouble m[16]) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_uniform_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_uniform_buffer_object new file mode 100644 index 0000000..0dedf1b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_uniform_buffer_object @@ -0,0 +1,46 @@ +GL_ARB_uniform_buffer_object +http://www.opengl.org/registry/specs/ARB/uniform_buffer_object.txt +GL_ARB_uniform_buffer_object + GL_UNIFORM_BUFFER 0x8A11 + GL_UNIFORM_BUFFER_BINDING 0x8A28 + GL_UNIFORM_BUFFER_START 0x8A29 + GL_UNIFORM_BUFFER_SIZE 0x8A2A + GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B + GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C + GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D + GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E + GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F + GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 + GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 + GL_UNIFORM_TYPE 0x8A37 + GL_UNIFORM_SIZE 0x8A38 + GL_UNIFORM_NAME_LENGTH 0x8A39 + GL_UNIFORM_BLOCK_INDEX 0x8A3A + GL_UNIFORM_OFFSET 0x8A3B + GL_UNIFORM_ARRAY_STRIDE 0x8A3C + GL_UNIFORM_MATRIX_STRIDE 0x8A3D + GL_UNIFORM_IS_ROW_MAJOR 0x8A3E + GL_UNIFORM_BLOCK_BINDING 0x8A3F + GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 + GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 + GL_INVALID_INDEX 0xFFFFFFFF + void glBindBufferBase (GLenum target, GLuint index, GLuint buffer) + void glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName) + void glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params) + void glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName) + void glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params) + void glGetIntegeri_v (GLenum target, GLuint index, GLint* data) + GLuint glGetUniformBlockIndex (GLuint program, const GLchar* uniformBlockName) + void glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices) + void glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_bgra b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_bgra new file mode 100644 index 0000000..cf4ef09 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_bgra @@ -0,0 +1,4 @@ +GL_ARB_vertex_array_bgra +http://www.opengl.org/registry/specs/ARB/vertex_array_bgra.txt +GL_ARB_vertex_array_bgra + GL_BGRA 0x80E1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_object new file mode 100644 index 0000000..efe7d7c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_array_object @@ -0,0 +1,8 @@ +GL_ARB_vertex_array_object +http://www.opengl.org/registry/specs/ARB/vertex_array_object.txt +GL_ARB_vertex_array_object + GL_VERTEX_ARRAY_BINDING 0x85B5 + void glBindVertexArray (GLuint array) + void glDeleteVertexArrays (GLsizei n, const GLuint* arrays) + void glGenVertexArrays (GLsizei n, GLuint* arrays) + GLboolean glIsVertexArray (GLuint array) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_64bit b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_64bit new file mode 100644 index 0000000..079dce2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_64bit @@ -0,0 +1,19 @@ +GL_ARB_vertex_attrib_64bit +http://www.opengl.org/registry/specs/ARB/vertex_attrib_64bit.txt +GL_ARB_vertex_attrib_64bit + GL_DOUBLE_MAT2 0x8F46 + GL_DOUBLE_MAT3 0x8F47 + GL_DOUBLE_MAT4 0x8F48 + GL_DOUBLE_VEC2 0x8FFC + GL_DOUBLE_VEC3 0x8FFD + GL_DOUBLE_VEC4 0x8FFE + void glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble* params) + void glVertexAttribL1d (GLuint index, GLdouble x) + void glVertexAttribL1dv (GLuint index, const GLdouble* v) + void glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dv (GLuint index, const GLdouble* v) + void glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dv (GLuint index, const GLdouble* v) + void glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dv (GLuint index, const GLdouble* v) + void glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_binding b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_binding new file mode 100644 index 0000000..7b65234 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_attrib_binding @@ -0,0 +1,16 @@ +GL_ARB_vertex_attrib_binding +http://www.opengl.org/registry/specs/ARB/vertex_attrib_binding.txt +GL_ARB_vertex_attrib_binding + GL_VERTEX_ATTRIB_BINDING 0x82D4 + GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 + GL_VERTEX_BINDING_DIVISOR 0x82D6 + GL_VERTEX_BINDING_OFFSET 0x82D7 + GL_VERTEX_BINDING_STRIDE 0x82D8 + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 + GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + void glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) + void glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) + void glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) + void glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) + void glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_blend b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_blend new file mode 100644 index 0000000..8da2c78 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_blend @@ -0,0 +1,55 @@ +GL_ARB_vertex_blend +http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_blend.txt +GL_ARB_vertex_blend + GL_MAX_VERTEX_UNITS_ARB 0x86A4 + GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 + GL_WEIGHT_SUM_UNITY_ARB 0x86A6 + GL_VERTEX_BLEND_ARB 0x86A7 + GL_CURRENT_WEIGHT_ARB 0x86A8 + GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 + GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA + GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB + GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC + GL_WEIGHT_ARRAY_ARB 0x86AD + GL_MODELVIEW0_ARB 0x1700 + GL_MODELVIEW1_ARB 0x850A + GL_MODELVIEW2_ARB 0x8722 + GL_MODELVIEW3_ARB 0x8723 + GL_MODELVIEW4_ARB 0x8724 + GL_MODELVIEW5_ARB 0x8725 + GL_MODELVIEW6_ARB 0x8726 + GL_MODELVIEW7_ARB 0x8727 + GL_MODELVIEW8_ARB 0x8728 + GL_MODELVIEW9_ARB 0x8729 + GL_MODELVIEW10_ARB 0x872A + GL_MODELVIEW11_ARB 0x872B + GL_MODELVIEW12_ARB 0x872C + GL_MODELVIEW13_ARB 0x872D + GL_MODELVIEW14_ARB 0x872E + GL_MODELVIEW15_ARB 0x872F + GL_MODELVIEW16_ARB 0x8730 + GL_MODELVIEW17_ARB 0x8731 + GL_MODELVIEW18_ARB 0x8732 + GL_MODELVIEW19_ARB 0x8733 + GL_MODELVIEW20_ARB 0x8734 + GL_MODELVIEW21_ARB 0x8735 + GL_MODELVIEW22_ARB 0x8736 + GL_MODELVIEW23_ARB 0x8737 + GL_MODELVIEW24_ARB 0x8738 + GL_MODELVIEW25_ARB 0x8739 + GL_MODELVIEW26_ARB 0x873A + GL_MODELVIEW27_ARB 0x873B + GL_MODELVIEW28_ARB 0x873C + GL_MODELVIEW29_ARB 0x873D + GL_MODELVIEW30_ARB 0x873E + GL_MODELVIEW31_ARB 0x873F + void glWeightbvARB (GLint size, GLbyte *weights) + void glWeightsvARB (GLint size, GLshort *weights) + void glWeightivARB (GLint size, GLint *weights) + void glWeightfvARB (GLint size, GLfloat *weights) + void glWeightdvARB (GLint size, GLdouble *weights) + void glWeightubvARB (GLint size, GLubyte *weights) + void glWeightusvARB (GLint size, GLushort *weights) + void glWeightuivARB (GLint size, GLuint *weights) + void glWeightPointerARB (GLint size, GLenum type, GLsizei stride, GLvoid *pointer) + void glVertexBlendARB (GLint count) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_buffer_object new file mode 100644 index 0000000..bd2ddfa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_buffer_object @@ -0,0 +1,47 @@ +GL_ARB_vertex_buffer_object +http://www.opengl.org/registry/specs/ARB/vertex_buffer_object.txt +GL_ARB_vertex_buffer_object + GL_BUFFER_SIZE_ARB 0x8764 + GL_BUFFER_USAGE_ARB 0x8765 + GL_ARRAY_BUFFER_ARB 0x8892 + GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 + GL_ARRAY_BUFFER_BINDING_ARB 0x8894 + GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 + GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 + GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 + GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 + GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D + GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F + GL_READ_ONLY_ARB 0x88B8 + GL_WRITE_ONLY_ARB 0x88B9 + GL_READ_WRITE_ARB 0x88BA + GL_BUFFER_ACCESS_ARB 0x88BB + GL_BUFFER_MAPPED_ARB 0x88BC + GL_BUFFER_MAP_POINTER_ARB 0x88BD + GL_STREAM_DRAW_ARB 0x88E0 + GL_STREAM_READ_ARB 0x88E1 + GL_STREAM_COPY_ARB 0x88E2 + GL_STATIC_DRAW_ARB 0x88E4 + GL_STATIC_READ_ARB 0x88E5 + GL_STATIC_COPY_ARB 0x88E6 + GL_DYNAMIC_DRAW_ARB 0x88E8 + GL_DYNAMIC_READ_ARB 0x88E9 + GL_DYNAMIC_COPY_ARB 0x88EA + void glBindBufferARB (GLenum target, GLuint buffer) + void glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage) + void glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data) + void glDeleteBuffersARB (GLsizei n, const GLuint* buffers) + void glGenBuffersARB (GLsizei n, GLuint* buffers) + void glGetBufferParameterivARB (GLenum target, GLenum pname, GLint* params) + void glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid** params) + void glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data) + GLboolean glIsBufferARB (GLuint buffer) + GLvoid * glMapBufferARB (GLenum target, GLenum access) + GLboolean glUnmapBufferARB (GLenum target) + typedef ptrdiff_t GLsizeiptrARB + typedef ptrdiff_t GLintptrARB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_program b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_program new file mode 100644 index 0000000..81fd69d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_program @@ -0,0 +1,144 @@ +GL_ARB_vertex_program +http://www.opengl.org/registry/specs/ARB/vertex_program.txt +GL_ARB_vertex_program + GL_COLOR_SUM_ARB 0x8458 + GL_VERTEX_PROGRAM_ARB 0x8620 + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 + GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 + GL_PROGRAM_LENGTH_ARB 0x8627 + GL_PROGRAM_STRING_ARB 0x8628 + GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E + GL_MAX_PROGRAM_MATRICES_ARB 0x862F + GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 + GL_CURRENT_MATRIX_ARB 0x8641 + GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 + GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 + GL_PROGRAM_ERROR_POSITION_ARB 0x864B + GL_PROGRAM_BINDING_ARB 0x8677 + GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A + GL_PROGRAM_ERROR_STRING_ARB 0x8874 + GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 + GL_PROGRAM_FORMAT_ARB 0x8876 + GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 + GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 + GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 + GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 + GL_PROGRAM_TEMPORARIES_ARB 0x88A4 + GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 + GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 + GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 + GL_PROGRAM_PARAMETERS_ARB 0x88A8 + GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 + GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA + GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB + GL_PROGRAM_ATTRIBS_ARB 0x88AC + GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD + GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE + GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF + GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 + GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 + GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 + GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 + GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 + GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 + GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 + GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 + GL_MATRIX0_ARB 0x88C0 + GL_MATRIX1_ARB 0x88C1 + GL_MATRIX2_ARB 0x88C2 + GL_MATRIX3_ARB 0x88C3 + GL_MATRIX4_ARB 0x88C4 + GL_MATRIX5_ARB 0x88C5 + GL_MATRIX6_ARB 0x88C6 + GL_MATRIX7_ARB 0x88C7 + GL_MATRIX8_ARB 0x88C8 + GL_MATRIX9_ARB 0x88C9 + GL_MATRIX10_ARB 0x88CA + GL_MATRIX11_ARB 0x88CB + GL_MATRIX12_ARB 0x88CC + GL_MATRIX13_ARB 0x88CD + GL_MATRIX14_ARB 0x88CE + GL_MATRIX15_ARB 0x88CF + GL_MATRIX16_ARB 0x88D0 + GL_MATRIX17_ARB 0x88D1 + GL_MATRIX18_ARB 0x88D2 + GL_MATRIX19_ARB 0x88D3 + GL_MATRIX20_ARB 0x88D4 + GL_MATRIX21_ARB 0x88D5 + GL_MATRIX22_ARB 0x88D6 + GL_MATRIX23_ARB 0x88D7 + GL_MATRIX24_ARB 0x88D8 + GL_MATRIX25_ARB 0x88D9 + GL_MATRIX26_ARB 0x88DA + GL_MATRIX27_ARB 0x88DB + GL_MATRIX28_ARB 0x88DC + GL_MATRIX29_ARB 0x88DD + GL_MATRIX30_ARB 0x88DE + GL_MATRIX31_ARB 0x88DF + void glBindProgramARB (GLenum target, GLuint program) + void glDeleteProgramsARB (GLsizei n, const GLuint* programs) + void glDisableVertexAttribArrayARB (GLuint index) + void glEnableVertexAttribArrayARB (GLuint index) + void glGenProgramsARB (GLsizei n, GLuint* programs) + void glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble* params) + void glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat* params) + void glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble* params) + void glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat* params) + void glGetProgramStringARB (GLenum target, GLenum pname, void* string) + void glGetProgramivARB (GLenum target, GLenum pname, GLint* params) + void glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid** pointer) + void glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble* params) + void glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribivARB (GLuint index, GLenum pname, GLint* params) + GLboolean glIsProgramARB (GLuint program) + void glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble* params) + void glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat* params) + void glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble* params) + void glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat* params) + void glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void* string) + void glVertexAttrib1dARB (GLuint index, GLdouble x) + void glVertexAttrib1dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib1fARB (GLuint index, GLfloat x) + void glVertexAttrib1fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib1sARB (GLuint index, GLshort x) + void glVertexAttrib1svARB (GLuint index, const GLshort* v) + void glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2svARB (GLuint index, const GLshort* v) + void glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3svARB (GLuint index, const GLshort* v) + void glVertexAttrib4NbvARB (GLuint index, const GLbyte* v) + void glVertexAttrib4NivARB (GLuint index, const GLint* v) + void glVertexAttrib4NsvARB (GLuint index, const GLshort* v) + void glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4NubvARB (GLuint index, const GLubyte* v) + void glVertexAttrib4NuivARB (GLuint index, const GLuint* v) + void glVertexAttrib4NusvARB (GLuint index, const GLushort* v) + void glVertexAttrib4bvARB (GLuint index, const GLbyte* v) + void glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dvARB (GLuint index, const GLdouble* v) + void glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fvARB (GLuint index, const GLfloat* v) + void glVertexAttrib4ivARB (GLuint index, const GLint* v) + void glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4svARB (GLuint index, const GLshort* v) + void glVertexAttrib4ubvARB (GLuint index, const GLubyte* v) + void glVertexAttrib4uivARB (GLuint index, const GLuint* v) + void glVertexAttrib4usvARB (GLuint index, const GLushort* v) + void glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_shader new file mode 100644 index 0000000..08f5fe1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_shader @@ -0,0 +1,13 @@ +GL_ARB_vertex_shader +http://www.opengl.org/registry/specs/ARB/vertex_shader.txt +GL_ARB_vertex_shader + GL_VERTEX_SHADER_ARB 0x8B31 + GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A + GL_MAX_VARYING_FLOATS_ARB 0x8B4B + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D + GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 + GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + void glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB* name) + void glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name) + GLint glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB* name) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_type_2_10_10_10_rev b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_type_2_10_10_10_rev new file mode 100644 index 0000000..5259063 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_vertex_type_2_10_10_10_rev @@ -0,0 +1,43 @@ +GL_ARB_vertex_type_2_10_10_10_rev +http://www.opengl.org/registry/specs/ARB/vertex_type_2_10_10_10_rev.txt +GL_ARB_vertex_type_2_10_10_10_rev + GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 + GL_INT_2_10_10_10_REV 0x8D9F + void glColorP3ui (GLenum type, GLuint color) + void glColorP3uiv (GLenum type, const GLuint* color) + void glColorP4ui (GLenum type, GLuint color) + void glColorP4uiv (GLenum type, const GLuint* color) + void glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint* coords) + void glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords) + void glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint* coords) + void glNormalP3ui (GLenum type, GLuint coords) + void glNormalP3uiv (GLenum type, const GLuint* coords) + void glSecondaryColorP3ui (GLenum type, GLuint color) + void glSecondaryColorP3uiv (GLenum type, const GLuint* color) + void glTexCoordP1ui (GLenum type, GLuint coords) + void glTexCoordP1uiv (GLenum type, const GLuint* coords) + void glTexCoordP2ui (GLenum type, GLuint coords) + void glTexCoordP2uiv (GLenum type, const GLuint* coords) + void glTexCoordP3ui (GLenum type, GLuint coords) + void glTexCoordP3uiv (GLenum type, const GLuint* coords) + void glTexCoordP4ui (GLenum type, GLuint coords) + void glTexCoordP4uiv (GLenum type, const GLuint* coords) + void glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value) + void glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint* value) + void glVertexP2ui (GLenum type, GLuint value) + void glVertexP2uiv (GLenum type, const GLuint* value) + void glVertexP3ui (GLenum type, GLuint value) + void glVertexP3uiv (GLenum type, const GLuint* value) + void glVertexP4ui (GLenum type, GLuint value) + void glVertexP4uiv (GLenum type, const GLuint* value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_viewport_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_viewport_array new file mode 100644 index 0000000..f333200 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_viewport_array @@ -0,0 +1,26 @@ +GL_ARB_viewport_array +http://www.opengl.org/registry/specs/ARB/viewport_array.txt +GL_ARB_viewport_array + GL_DEPTH_RANGE 0x0B70 + GL_VIEWPORT 0x0BA2 + GL_SCISSOR_BOX 0x0C10 + GL_SCISSOR_TEST 0x0C11 + GL_MAX_VIEWPORTS 0x825B + GL_VIEWPORT_SUBPIXEL_BITS 0x825C + GL_VIEWPORT_BOUNDS_RANGE 0x825D + GL_LAYER_PROVOKING_VERTEX 0x825E + GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F + GL_UNDEFINED_VERTEX 0x8260 + GL_FIRST_VERTEX_CONVENTION 0x8E4D + GL_LAST_VERTEX_CONVENTION 0x8E4E + GL_PROVOKING_VERTEX 0x8E4F + void glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd * v) + void glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f) + void glGetDoublei_v (GLenum target, GLuint index, GLdouble* data) + void glGetFloati_v (GLenum target, GLuint index, GLfloat* data) + void glScissorArrayv (GLuint first, GLsizei count, const GLint * v) + void glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height) + void glScissorIndexedv (GLuint index, const GLint * v) + void glViewportArrayv (GLuint first, GLsizei count, const GLfloat * v) + void glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) + void glViewportIndexedfv (GLuint index, const GLfloat * v) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_window_pos b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_window_pos new file mode 100644 index 0000000..15e5bf5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ARB_window_pos @@ -0,0 +1,19 @@ +GL_ARB_window_pos +http://www.opengl.org/registry/specs/ARB/window_pos.txt +GL_ARB_window_pos + void glWindowPos2dARB (GLdouble x, GLdouble y) + void glWindowPos2dvARB (const GLdouble* p) + void glWindowPos2fARB (GLfloat x, GLfloat y) + void glWindowPos2fvARB (const GLfloat* p) + void glWindowPos2iARB (GLint x, GLint y) + void glWindowPos2ivARB (const GLint* p) + void glWindowPos2sARB (GLshort x, GLshort y) + void glWindowPos2svARB (const GLshort* p) + void glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3dvARB (const GLdouble* p) + void glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3fvARB (const GLfloat* p) + void glWindowPos3iARB (GLint x, GLint y, GLint z) + void glWindowPos3ivARB (const GLint* p) + void glWindowPos3sARB (GLshort x, GLshort y, GLshort z) + void glWindowPos3svARB (const GLshort* p) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_point_sprites b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_point_sprites new file mode 100644 index 0000000..0f4f574 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_point_sprites @@ -0,0 +1,9 @@ +GL_ATIX_point_sprites +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_point_sprites + GL_TEXTURE_POINT_MODE_ATIX 0x60B0 + GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 + GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 + GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 + GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 + GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_combine3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_combine3 new file mode 100644 index 0000000..537426b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_combine3 @@ -0,0 +1,6 @@ +GL_ATIX_texture_env_combine3 +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_texture_env_combine3 + GL_MODULATE_ADD_ATIX 0x8744 + GL_MODULATE_SIGNED_ADD_ATIX 0x8745 + GL_MODULATE_SUBTRACT_ATIX 0x8746 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_route b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_route new file mode 100644 index 0000000..939ae09 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_texture_env_route @@ -0,0 +1,6 @@ +GL_ATIX_texture_env_route +http://www.ati.com/developer/sdk/RadeonSDK/Html/Info/ATIX_texture_env_route.txt +GL_ATIX_texture_env_route + GL_SECONDARY_COLOR_ATIX 0x8747 + GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 + GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_vertex_shader_output_point_size b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_vertex_shader_output_point_size new file mode 100644 index 0000000..277a313 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATIX_vertex_shader_output_point_size @@ -0,0 +1,4 @@ +GL_ATIX_vertex_shader_output_point_size +http://www.ati.com/developer/atiopengl.pdf +GL_ATIX_vertex_shader_output_point_size + GL_OUTPUT_POINT_SIZE_ATIX 0x610E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_draw_buffers b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_draw_buffers new file mode 100644 index 0000000..3496637 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_draw_buffers @@ -0,0 +1,21 @@ +GL_ATI_draw_buffers +http://www.opengl.org/registry/specs/ATI/draw_buffers.txt +GL_ATI_draw_buffers + GL_MAX_DRAW_BUFFERS_ATI 0x8824 + GL_DRAW_BUFFER0_ATI 0x8825 + GL_DRAW_BUFFER1_ATI 0x8826 + GL_DRAW_BUFFER2_ATI 0x8827 + GL_DRAW_BUFFER3_ATI 0x8828 + GL_DRAW_BUFFER4_ATI 0x8829 + GL_DRAW_BUFFER5_ATI 0x882A + GL_DRAW_BUFFER6_ATI 0x882B + GL_DRAW_BUFFER7_ATI 0x882C + GL_DRAW_BUFFER8_ATI 0x882D + GL_DRAW_BUFFER9_ATI 0x882E + GL_DRAW_BUFFER10_ATI 0x882F + GL_DRAW_BUFFER11_ATI 0x8830 + GL_DRAW_BUFFER12_ATI 0x8831 + GL_DRAW_BUFFER13_ATI 0x8832 + GL_DRAW_BUFFER14_ATI 0x8833 + GL_DRAW_BUFFER15_ATI 0x8834 + void glDrawBuffersATI (GLsizei n, const GLenum* bufs) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_element_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_element_array new file mode 100644 index 0000000..8ad72ce --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_element_array @@ -0,0 +1,9 @@ +GL_ATI_element_array +http://www.opengl.org/registry/specs/ATI/element_array.txt +GL_ATI_element_array + GL_ELEMENT_ARRAY_ATI 0x8768 + GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 + GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + void glDrawElementArrayATI (GLenum mode, GLsizei count) + void glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count) + void glElementPointerATI (GLenum type, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_envmap_bumpmap b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_envmap_bumpmap new file mode 100644 index 0000000..fbd9925 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_envmap_bumpmap @@ -0,0 +1,15 @@ +GL_ATI_envmap_bumpmap +http://oss.sgi.com/projects/ogl-sample/registry/ATI/envmap_bumpmap.txt +GL_ATI_envmap_bumpmap + GL_BUMP_ROT_MATRIX_ATI 0x8775 + GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 + GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 + GL_BUMP_TEX_UNITS_ATI 0x8778 + GL_DUDV_ATI 0x8779 + GL_DU8DV8_ATI 0x877A + GL_BUMP_ENVMAP_ATI 0x877B + GL_BUMP_TARGET_ATI 0x877C + void glTexBumpParameterivATI (GLenum pname, GLint *param) + void glTexBumpParameterfvATI (GLenum pname, GLfloat *param) + void glGetTexBumpParameterivATI (GLenum pname, GLint *param) + void glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_fragment_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_fragment_shader new file mode 100644 index 0000000..2154d27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_fragment_shader @@ -0,0 +1,71 @@ +GL_ATI_fragment_shader +http://www.opengl.org/registry/specs/ATI/fragment_shader.txt +GL_ATI_fragment_shader + GL_RED_BIT_ATI 0x00000001 + GL_2X_BIT_ATI 0x00000001 + GL_4X_BIT_ATI 0x00000002 + GL_GREEN_BIT_ATI 0x00000002 + GL_COMP_BIT_ATI 0x00000002 + GL_BLUE_BIT_ATI 0x00000004 + GL_8X_BIT_ATI 0x00000004 + GL_NEGATE_BIT_ATI 0x00000004 + GL_BIAS_BIT_ATI 0x00000008 + GL_HALF_BIT_ATI 0x00000008 + GL_QUARTER_BIT_ATI 0x00000010 + GL_EIGHTH_BIT_ATI 0x00000020 + GL_SATURATE_BIT_ATI 0x00000040 + GL_FRAGMENT_SHADER_ATI 0x8920 + GL_REG_0_ATI 0x8921 + GL_REG_1_ATI 0x8922 + GL_REG_2_ATI 0x8923 + GL_REG_3_ATI 0x8924 + GL_REG_4_ATI 0x8925 + GL_REG_5_ATI 0x8926 + GL_CON_0_ATI 0x8941 + GL_CON_1_ATI 0x8942 + GL_CON_2_ATI 0x8943 + GL_CON_3_ATI 0x8944 + GL_CON_4_ATI 0x8945 + GL_CON_5_ATI 0x8946 + GL_CON_6_ATI 0x8947 + GL_CON_7_ATI 0x8948 + GL_MOV_ATI 0x8961 + GL_ADD_ATI 0x8963 + GL_MUL_ATI 0x8964 + GL_SUB_ATI 0x8965 + GL_DOT3_ATI 0x8966 + GL_DOT4_ATI 0x8967 + GL_MAD_ATI 0x8968 + GL_LERP_ATI 0x8969 + GL_CND_ATI 0x896A + GL_CND0_ATI 0x896B + GL_DOT2_ADD_ATI 0x896C + GL_SECONDARY_INTERPOLATOR_ATI 0x896D + GL_SWIZZLE_STR_ATI 0x8976 + GL_SWIZZLE_STQ_ATI 0x8977 + GL_SWIZZLE_STR_DR_ATI 0x8978 + GL_SWIZZLE_STQ_DQ_ATI 0x8979 + void glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) + void glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) + void glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) + void glBeginFragmentShaderATI (void) + void glBindFragmentShaderATI (GLuint id) + void glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod) + void glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod) + void glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod) + void glDeleteFragmentShaderATI (GLuint id) + void glEndFragmentShaderATI (void) + GLuint glGenFragmentShadersATI (GLuint range) + void glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle) + void glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle) + void glSetFragmentShaderConstantATI (GLuint dst, const GLfloat* value) + GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E + GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F + GL_NUM_PASSES_ATI 0x8970 + GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 + GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 + GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 + GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 + GL_COLOR_ALPHA_PAIRING_ATI 0x8975 + GL_SWIZZLE_STRQ_ATI 0x897A + GL_SWIZZLE_STRQ_DQ_ATI 0x897B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_map_object_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_map_object_buffer new file mode 100644 index 0000000..573afd2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_map_object_buffer @@ -0,0 +1,5 @@ +GL_ATI_map_object_buffer +http://www.opengl.org/registry/specs/ATI/map_object_buffer.txt +GL_ATI_map_object_buffer + GLvoid * glMapObjectBufferATI (GLuint buffer) + void glUnmapObjectBufferATI (GLuint buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_meminfo b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_meminfo new file mode 100644 index 0000000..5a5719b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_meminfo @@ -0,0 +1,6 @@ +GL_ATI_meminfo +http://www.opengl.org/registry/specs/ATI/meminfo.txt +GL_ATI_meminfo + GL_VBO_FREE_MEMORY_ATI 0x87FB + GL_TEXTURE_FREE_MEMORY_ATI 0x87FC + GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_pn_triangles b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_pn_triangles new file mode 100644 index 0000000..a61e27a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_pn_triangles @@ -0,0 +1,14 @@ +GL_ATI_pn_triangles +http://www.opengl.org/registry/specs/ATI/pn_triangles.txt +GL_ATI_pn_triangles + GL_PN_TRIANGLES_ATI 0x87F0 + GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 + GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 + GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 + GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 + GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 + GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 + GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 + GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + void glPNTrianglesiATI (GLenum pname, GLint param) + void glPNTrianglesfATI (GLenum pname, GLfloat param) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_separate_stencil b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_separate_stencil new file mode 100644 index 0000000..be55bb4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_separate_stencil @@ -0,0 +1,9 @@ +GL_ATI_separate_stencil +http://www.opengl.org/registry/specs/ATI/separate_stencil.txt +GL_ATI_separate_stencil + GL_STENCIL_BACK_FUNC_ATI 0x8800 + GL_STENCIL_BACK_FAIL_ATI 0x8801 + GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 + GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + void glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) + void glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_shader_texture_lod b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_shader_texture_lod new file mode 100644 index 0000000..5fbc624 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_shader_texture_lod @@ -0,0 +1,3 @@ +GL_ATI_shader_texture_lod + +GL_ATI_shader_texture_lod diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_text_fragment_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_text_fragment_shader new file mode 100644 index 0000000..926c300 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_text_fragment_shader @@ -0,0 +1,4 @@ +GL_ATI_text_fragment_shader +http://www.opengl.org/registry/specs/ATI/text_fragment_shader.txt +GL_ATI_text_fragment_shader + GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_compression_3dc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_compression_3dc new file mode 100644 index 0000000..2548b30 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_compression_3dc @@ -0,0 +1,4 @@ +GL_ATI_texture_compression_3dc + +GL_ATI_texture_compression_3dc + GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_env_combine3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_env_combine3 new file mode 100644 index 0000000..e65c170 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_env_combine3 @@ -0,0 +1,6 @@ +GL_ATI_texture_env_combine3 +http://www.opengl.org/registry/specs/ATI/texture_env_combine3.txt +GL_ATI_texture_env_combine3 + GL_MODULATE_ADD_ATI 0x8744 + GL_MODULATE_SIGNED_ADD_ATI 0x8745 + GL_MODULATE_SUBTRACT_ATI 0x8746 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_float new file mode 100644 index 0000000..d8c9b89 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_float @@ -0,0 +1,15 @@ +GL_ATI_texture_float +http://www.opengl.org/registry/specs/ATI/texture_float.txt +GL_ATI_texture_float + GL_RGBA_FLOAT32_ATI 0x8814 + GL_RGB_FLOAT32_ATI 0x8815 + GL_ALPHA_FLOAT32_ATI 0x8816 + GL_INTENSITY_FLOAT32_ATI 0x8817 + GL_LUMINANCE_FLOAT32_ATI 0x8818 + GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 + GL_RGBA_FLOAT16_ATI 0x881A + GL_RGB_FLOAT16_ATI 0x881B + GL_ALPHA_FLOAT16_ATI 0x881C + GL_INTENSITY_FLOAT16_ATI 0x881D + GL_LUMINANCE_FLOAT16_ATI 0x881E + GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_mirror_once b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_mirror_once new file mode 100644 index 0000000..a1dabaf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_texture_mirror_once @@ -0,0 +1,5 @@ +GL_ATI_texture_mirror_once +http://www.opengl.org/registry/specs/ATI/texture_mirror_once.txt +GL_ATI_texture_mirror_once + GL_MIRROR_CLAMP_ATI 0x8742 + GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_array_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_array_object new file mode 100644 index 0000000..5e1a06a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_array_object @@ -0,0 +1,23 @@ +GL_ATI_vertex_array_object +http://www.opengl.org/registry/specs/ATI/vertex_array_object.txt +GL_ATI_vertex_array_object + GL_STATIC_ATI 0x8760 + GL_DYNAMIC_ATI 0x8761 + GL_PRESERVE_ATI 0x8762 + GL_DISCARD_ATI 0x8763 + GL_OBJECT_BUFFER_SIZE_ATI 0x8764 + GL_OBJECT_BUFFER_USAGE_ATI 0x8765 + GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 + GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + void glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) + void glFreeObjectBufferATI (GLuint buffer) + void glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat* params) + void glGetArrayObjectivATI (GLenum array, GLenum pname, GLint* params) + void glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat* params) + void glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint* params) + void glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat* params) + void glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint* params) + GLboolean glIsObjectBufferATI (GLuint buffer) + GLuint glNewObjectBufferATI (GLsizei size, const void* pointer, GLenum usage) + void glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve) + void glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_attrib_array_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_attrib_array_object new file mode 100644 index 0000000..c8ce994 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_attrib_array_object @@ -0,0 +1,6 @@ +GL_ATI_vertex_attrib_array_object +http://www.opengl.org/registry/specs/ATI/vertex_attrib_array_object.txt +GL_ATI_vertex_attrib_array_object + void glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint* params) + void glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_streams b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_streams new file mode 100644 index 0000000..060f844 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_ATI_vertex_streams @@ -0,0 +1,58 @@ +GL_ATI_vertex_streams +http://www.opengl.org/registry/specs/ATI/vertex_streams.txt +GL_ATI_vertex_streams + GL_MAX_VERTEX_STREAMS_ATI 0x876B + GL_VERTEX_SOURCE_ATI 0x876C + GL_VERTEX_STREAM0_ATI 0x876D + GL_VERTEX_STREAM1_ATI 0x876E + GL_VERTEX_STREAM2_ATI 0x876F + GL_VERTEX_STREAM3_ATI 0x8770 + GL_VERTEX_STREAM4_ATI 0x8771 + GL_VERTEX_STREAM5_ATI 0x8772 + GL_VERTEX_STREAM6_ATI 0x8773 + GL_VERTEX_STREAM7_ATI 0x8774 + void glClientActiveVertexStreamATI (GLenum stream) + void glVertexBlendEnviATI (GLenum pname, GLint param) + void glVertexBlendEnvfATI (GLenum pname, GLfloat param) + void glVertexStream1sATI (GLenum stream, GLshort x) + void glVertexStream1svATI (GLenum stream, const GLshort *coords) + void glVertexStream1iATI (GLenum stream, GLint x) + void glVertexStream1ivATI (GLenum stream, const GLint *coords) + void glVertexStream1fATI (GLenum stream, GLfloat x) + void glVertexStream1fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream1dATI (GLenum stream, GLdouble x) + void glVertexStream1dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream2sATI (GLenum stream, GLshort x, GLshort y) + void glVertexStream2svATI (GLenum stream, const GLshort *coords) + void glVertexStream2iATI (GLenum stream, GLint x, GLint y) + void glVertexStream2ivATI (GLenum stream, const GLint *coords) + void glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y) + void glVertexStream2fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y) + void glVertexStream2dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glVertexStream3svATI (GLenum stream, const GLshort *coords) + void glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glVertexStream3ivATI (GLenum stream, const GLint *coords) + void glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glVertexStream3fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glVertexStream3dvATI (GLenum stream, const GLdouble *coords) + void glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexStream4svATI (GLenum stream, const GLshort *coords) + void glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w) + void glVertexStream4ivATI (GLenum stream, const GLint *coords) + void glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexStream4fvATI (GLenum stream, const GLfloat *coords) + void glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexStream4dvATI (GLenum stream, const GLdouble *coords) + void glNormalStream3bATI (GLenum stream, GLbyte x, GLbyte y, GLbyte z) + void glNormalStream3bvATI (GLenum stream, const GLbyte *coords) + void glNormalStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z) + void glNormalStream3svATI (GLenum stream, const GLshort *coords) + void glNormalStream3iATI (GLenum stream, GLint x, GLint y, GLint z) + void glNormalStream3ivATI (GLenum stream, const GLint *coords) + void glNormalStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z) + void glNormalStream3fvATI (GLenum stream, const GLfloat *coords) + void glNormalStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z) + void glNormalStream3dvATI (GLenum stream, const GLdouble *coords) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_422_pixels b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_422_pixels new file mode 100644 index 0000000..70d3d57 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_422_pixels @@ -0,0 +1,7 @@ +GL_EXT_422_pixels +http://www.opengl.org/registry/specs/EXT/422_pixels.txt +GL_EXT_422_pixels + GL_422_EXT 0x80CC + GL_422_REV_EXT 0x80CD + GL_422_AVERAGE_EXT 0x80CE + GL_422_REV_AVERAGE_EXT 0x80CF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_Cg_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_Cg_shader new file mode 100644 index 0000000..34d3152 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_Cg_shader @@ -0,0 +1,5 @@ +GL_EXT_Cg_shader +http://download.nvidia.com/developer/GLSL/GLSL%20Release%20Notes%20for%20Release%2060.pdf +GL_EXT_Cg_shader + GL_CG_VERTEX_SHADER_EXT 0x890E + GL_CG_FRAGMENT_SHADER_EXT 0x890F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_abgr b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_abgr new file mode 100644 index 0000000..9c86889 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_abgr @@ -0,0 +1,4 @@ +GL_EXT_abgr +http://www.opengl.org/registry/specs/EXT/abgr.txt +GL_EXT_abgr + GL_ABGR_EXT 0x8000 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bgra b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bgra new file mode 100644 index 0000000..afe1c01 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bgra @@ -0,0 +1,5 @@ +GL_EXT_bgra +http://www.opengl.org/registry/specs/EXT/bgra.txt +GL_EXT_bgra + GL_BGR_EXT 0x80E0 + GL_BGRA_EXT 0x80E1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bindable_uniform b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bindable_uniform new file mode 100644 index 0000000..809123b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_bindable_uniform @@ -0,0 +1,12 @@ +GL_EXT_bindable_uniform +http://developer.download.nvidia.com/opengl/specs/GL_EXT_bindable_uniform.txt +GL_EXT_bindable_uniform + GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 + GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 + GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 + GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED + GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + GL_UNIFORM_BUFFER_EXT 0x8DEE + void glUniformBufferEXT (GLuint program, GLint location, GLuint buffer) + GLint glGetUniformBufferSizeEXT (GLuint program, GLint location) + GLintptr glGetUniformOffsetEXT (GLuint program, GLint location) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_color b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_color new file mode 100644 index 0000000..706181e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_color @@ -0,0 +1,9 @@ +GL_EXT_blend_color +http://www.opengl.org/registry/specs/EXT/blend_color.txt +GL_EXT_blend_color + GL_CONSTANT_COLOR_EXT 0x8001 + GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 + GL_CONSTANT_ALPHA_EXT 0x8003 + GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 + GL_BLEND_COLOR_EXT 0x8005 + void glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_equation_separate b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_equation_separate new file mode 100644 index 0000000..7ac5975 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_equation_separate @@ -0,0 +1,6 @@ +GL_EXT_blend_equation_separate +http://www.opengl.org/registry/specs/EXT/blend_equation_separate.txt +GL_EXT_blend_equation_separate + GL_BLEND_EQUATION_RGB_EXT 0x8009 + GL_BLEND_EQUATION_ALPHA_EXT 0x883D + void glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_func_separate b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_func_separate new file mode 100644 index 0000000..9517afc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_func_separate @@ -0,0 +1,8 @@ +GL_EXT_blend_func_separate +http://www.opengl.org/registry/specs/EXT/blend_func_separate.txt +GL_EXT_blend_func_separate + GL_BLEND_DST_RGB_EXT 0x80C8 + GL_BLEND_SRC_RGB_EXT 0x80C9 + GL_BLEND_DST_ALPHA_EXT 0x80CA + GL_BLEND_SRC_ALPHA_EXT 0x80CB + void glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_logic_op b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_logic_op new file mode 100644 index 0000000..7e3027d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_logic_op @@ -0,0 +1,3 @@ +GL_EXT_blend_logic_op +http://www.opengl.org/registry/specs/EXT/blend_logic_op.txt +GL_EXT_blend_logic_op diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_minmax b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_minmax new file mode 100644 index 0000000..fee5af6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_minmax @@ -0,0 +1,8 @@ +GL_EXT_blend_minmax +http://www.opengl.org/registry/specs/EXT/blend_minmax.txt +GL_EXT_blend_minmax + GL_FUNC_ADD_EXT 0x8006 + GL_MIN_EXT 0x8007 + GL_MAX_EXT 0x8008 + GL_BLEND_EQUATION_EXT 0x8009 + void glBlendEquationEXT (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_subtract b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_subtract new file mode 100644 index 0000000..8b9348b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_blend_subtract @@ -0,0 +1,5 @@ +GL_EXT_blend_subtract +http://www.opengl.org/registry/specs/EXT/blend_subtract.txt +GL_EXT_blend_subtract + GL_FUNC_SUBTRACT_EXT 0x800A + GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_clip_volume_hint b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_clip_volume_hint new file mode 100644 index 0000000..8959276 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_clip_volume_hint @@ -0,0 +1,4 @@ +GL_EXT_clip_volume_hint +http://www.opengl.org/registry/specs/EXT/clip_volume_hint.txt +GL_EXT_clip_volume_hint + GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cmyka b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cmyka new file mode 100644 index 0000000..824654f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cmyka @@ -0,0 +1,7 @@ +GL_EXT_cmyka +http://www.opengl.org/registry/specs/EXT/cmyka.txt +GL_EXT_cmyka + GL_CMYK_EXT 0x800C + GL_CMYKA_EXT 0x800D + GL_PACK_CMYK_HINT_EXT 0x800E + GL_UNPACK_CMYK_HINT_EXT 0x800F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_color_subtable b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_color_subtable new file mode 100644 index 0000000..398c313 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_color_subtable @@ -0,0 +1,5 @@ +GL_EXT_color_subtable +http://www.opengl.org/registry/specs/EXT/color_subtable.txt +GL_EXT_color_subtable + void glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data) + void glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_compiled_vertex_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_compiled_vertex_array new file mode 100644 index 0000000..0f8c5dc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_compiled_vertex_array @@ -0,0 +1,7 @@ +GL_EXT_compiled_vertex_array +http://www.opengl.org/registry/specs/EXT/compiled_vertex_array.txt +GL_EXT_compiled_vertex_array + GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 + GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + void glLockArraysEXT (GLint first, GLsizei count) + void glUnlockArraysEXT (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_convolution b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_convolution new file mode 100644 index 0000000..7fda5a6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_convolution @@ -0,0 +1,36 @@ +GL_EXT_convolution +http://www.opengl.org/registry/specs/EXT/convolution.txt +GL_EXT_convolution + GL_CONVOLUTION_1D_EXT 0x8010 + GL_CONVOLUTION_2D_EXT 0x8011 + GL_SEPARABLE_2D_EXT 0x8012 + GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 + GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 + GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 + GL_REDUCE_EXT 0x8016 + GL_CONVOLUTION_FORMAT_EXT 0x8017 + GL_CONVOLUTION_WIDTH_EXT 0x8018 + GL_CONVOLUTION_HEIGHT_EXT 0x8019 + GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A + GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B + GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C + GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D + GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E + GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F + GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 + GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 + GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 + GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + void glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image) + void glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image) + void glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat param) + void glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint param) + void glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint* params) + void glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) + void glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void* image) + void glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span) + void glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_coordinate_frame b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_coordinate_frame new file mode 100644 index 0000000..c85f235 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_coordinate_frame @@ -0,0 +1,19 @@ +GL_EXT_coordinate_frame +http://www.opengl.org/registry/specs/EXT/coordinate_frame.txt +GL_EXT_coordinate_frame + GL_TANGENT_ARRAY_EXT 0x8439 + GL_BINORMAL_ARRAY_EXT 0x843A + GL_CURRENT_TANGENT_EXT 0x843B + GL_CURRENT_BINORMAL_EXT 0x843C + GL_TANGENT_ARRAY_TYPE_EXT 0x843E + GL_TANGENT_ARRAY_STRIDE_EXT 0x843F + GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 + GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 + GL_TANGENT_ARRAY_POINTER_EXT 0x8442 + GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 + GL_MAP1_TANGENT_EXT 0x8444 + GL_MAP2_TANGENT_EXT 0x8445 + GL_MAP1_BINORMAL_EXT 0x8446 + GL_MAP2_BINORMAL_EXT 0x8447 + void glBinormalPointerEXT (GLenum type, GLsizei stride, void* pointer) + void glTangentPointerEXT (GLenum type, GLsizei stride, void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_copy_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_copy_texture new file mode 100644 index 0000000..4fff03e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_copy_texture @@ -0,0 +1,8 @@ +GL_EXT_copy_texture +http://www.opengl.org/registry/specs/EXT/copy_texture.txt +GL_EXT_copy_texture + void glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cull_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cull_vertex new file mode 100644 index 0000000..0808ea2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_cull_vertex @@ -0,0 +1,8 @@ +GL_EXT_cull_vertex +http://www.opengl.org/registry/specs/EXT/cull_vertex.txt +GL_EXT_cull_vertex + GL_CULL_VERTEX_EXT 0x81AA + GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB + GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + void glCullParameterdvEXT (GLenum pname, GLdouble* params) + void glCullParameterfvEXT (GLenum pname, GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_debug_marker b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_debug_marker new file mode 100644 index 0000000..9d0628c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_debug_marker @@ -0,0 +1,6 @@ +GL_EXT_debug_marker +http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt +GL_EXT_debug_marker + void glInsertEventMarkerEXT (GLsizei length, const GLchar* marker) + void glPushGroupMarkerEXT (GLsizei length, const GLchar* marker) + void glPopGroupMarkerEXT (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_depth_bounds_test b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_depth_bounds_test new file mode 100644 index 0000000..62528b7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_depth_bounds_test @@ -0,0 +1,6 @@ +GL_EXT_depth_bounds_test +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_depth_bounds_test.txt +GL_EXT_depth_bounds_test + GL_DEPTH_BOUNDS_TEST_EXT 0x8890 + GL_DEPTH_BOUNDS_EXT 0x8891 + void glDepthBoundsEXT (GLclampd zmin, GLclampd zmax) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_direct_state_access b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_direct_state_access new file mode 100644 index 0000000..993dd37 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_direct_state_access @@ -0,0 +1,236 @@ +GL_EXT_direct_state_access +http://www.opengl.org/registry/specs/EXT/direct_state_access.txt +GL_EXT_direct_state_access + GL_PROGRAM_MATRIX_EXT 0x8E2D + GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E + GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + void glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture) + GLenum glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target) + void glClientAttribDefaultEXT (GLbitfield mask) + void glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data) + void glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) + void glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) + void glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data) + void glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) + void glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) + void glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data) + void glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) + void glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) + void glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data) + void glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) + void glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) + void glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) + void glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) + void glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) + void glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) + void glDisableClientStateIndexedEXT (GLenum array, GLuint index) + void glDisableClientStateiEXT (GLenum array, GLuint index) + void glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index) + void glDisableVertexArrayEXT (GLuint vaobj, GLenum array) + void glEnableClientStateIndexedEXT (GLenum array, GLuint index) + void glEnableClientStateiEXT (GLenum array, GLuint index) + void glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index) + void glEnableVertexArrayEXT (GLuint vaobj, GLenum array) + void glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length) + void glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode) + void glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum* bufs) + void glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode) + void glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target) + void glGenerateTextureMipmapEXT (GLuint texture, GLenum target) + void glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, void* img) + void glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint level, void* img) + void glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble* params) + void glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble* params) + void glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat* params) + void glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat* params) + void glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint* param) + void glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat* params) + void glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params) + void glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params) + void glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint* params) + void glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels) + void glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params) + void glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params) + void glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint* params) + void glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat* params) + void glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint* params) + void glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint* params) + void glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void** params) + void glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data) + void glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params) + void glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint* params) + void glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint* params) + void glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble* params) + void glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat* params) + void glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void* string) + void glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint* params) + void glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint* params) + void glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid** params) + void glGetPointeri_vEXT (GLenum pname, GLuint index, GLvoid** params) + void glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels) + void glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params) + void glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params) + void glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint* params) + void glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint* params) + void glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat* params) + void glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint* params) + void glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint* param) + void glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint* param) + void glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param) + void glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, GLvoid** param) + GLvoid * glMapNamedBufferEXT (GLuint buffer, GLenum access) + GLvoid * glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access) + void glMatrixFrustumEXT (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) + void glMatrixLoadIdentityEXT (GLenum matrixMode) + void glMatrixLoadTransposedEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixLoadTransposefEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixLoaddEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixLoadfEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixMultTransposedEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixMultTransposefEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixMultdEXT (GLenum matrixMode, const GLdouble* m) + void glMatrixMultfEXT (GLenum matrixMode, const GLfloat* m) + void glMatrixOrthoEXT (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) + void glMatrixPopEXT (GLenum matrixMode) + void glMatrixPushEXT (GLenum matrixMode) + void glMatrixRotatedEXT (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) + void glMatrixRotatefEXT (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) + void glMatrixScaledEXT (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) + void glMatrixScalefEXT (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) + void glMatrixTranslatedEXT (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) + void glMatrixTranslatefEXT (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) + void glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) + void glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer) + void glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param) + void glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params) + void glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param) + void glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* params) + void glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param) + void glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params) + void glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param) + void glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params) + void glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param) + void glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint* params) + void glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels) + void glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) + void glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) + void glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* params) + void glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint* params) + void glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param) + void glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param) + void glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param) + void glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint* param) + void glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer) + void glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels) + void glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) + void glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) + void glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage) + void glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data) + void glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) + void glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) + void glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) + void glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face) + void glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer) + void glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble* params) + void glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat* params) + void glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint* params) + void glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint* params) + void glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params) + void glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params) + void glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string) + void glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height) + void glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) + void glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + void glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0) + void glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform1iEXT (GLuint program, GLint location, GLint v0) + void glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0) + void glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1) + void glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1) + void glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1) + void glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) + void glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2) + void glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) + void glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) + void glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat* value) + void glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) + void glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint* value) + void glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint* value) + void glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) + void glPushClientAttribDefaultEXT (GLbitfield mask) + void glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) + void glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels) + void glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) + void glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) + void glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint* params) + void glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint* params) + void glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param) + void glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat* param) + void glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param) + void glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint* param) + void glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer) + void glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels) + void glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) + void glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) + GLboolean glUnmapNamedBufferEXT (GLuint buffer) + void glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset) + void glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset) + void glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x) + void glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y) + void glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) + void glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value) + void glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value) + void glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value) + void glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value) + void glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) + void glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_buffers2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_buffers2 new file mode 100644 index 0000000..3917eb8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_buffers2 @@ -0,0 +1,9 @@ +GL_EXT_draw_buffers2 +http://www.opengl.org/registry/specs/EXT/draw_buffers2.txt +GL_EXT_draw_buffers2 + void glColorMaskIndexedEXT (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) + void glDisableIndexedEXT (GLenum target, GLuint index) + void glEnableIndexedEXT (GLenum target, GLuint index) + void glGetBooleanIndexedvEXT (GLenum value, GLuint index, GLboolean* data) + void glGetIntegerIndexedvEXT (GLenum value, GLuint index, GLint* data) + GLboolean glIsEnabledIndexedEXT (GLenum target, GLuint index) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_instanced b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_instanced new file mode 100644 index 0000000..afafa27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_instanced @@ -0,0 +1,5 @@ +GL_EXT_draw_instanced +http://developer.download.nvidia.com/opengl/specs/GL_EXT_draw_instanced.txt +GL_EXT_draw_instanced + void glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount) + void glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_range_elements b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_range_elements new file mode 100644 index 0000000..347ce62 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_draw_range_elements @@ -0,0 +1,6 @@ +GL_EXT_draw_range_elements +http://oss.sgi.com/projects/ogl-sample/registry/EXT/draw_range_elements.txt +GL_EXT_draw_range_elements + GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 + GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + void glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fog_coord b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fog_coord new file mode 100644 index 0000000..ac7868a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fog_coord @@ -0,0 +1,16 @@ +GL_EXT_fog_coord +http://oss.sgi.com/projects/ogl-sample/registry/EXT/fog_coord.txt +GL_EXT_fog_coord + GL_FOG_COORDINATE_SOURCE_EXT 0x8450 + GL_FOG_COORDINATE_EXT 0x8451 + GL_FRAGMENT_DEPTH_EXT 0x8452 + GL_CURRENT_FOG_COORDINATE_EXT 0x8453 + GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 + GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 + GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 + GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + void glFogCoordfEXT (GLfloat coord) + void glFogCoordfvEXT (const GLfloat *coord) + void glFogCoorddEXT (GLdouble coord) + void glFogCoorddvEXT (const GLdouble *coord) + void glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fragment_lighting b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fragment_lighting new file mode 100644 index 0000000..ab6888d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_fragment_lighting @@ -0,0 +1,35 @@ +GL_EXT_fragment_lighting +http://www.opengl.org/registry/specs/EXT/fragment_lighting.txt +GL_EXT_fragment_lighting + GL_FRAGMENT_LIGHTING_EXT 0x8400 + GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 + GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 + GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 + GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 + GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 + GL_CURRENT_RASTER_NORMAL_EXT 0x8406 + GL_LIGHT_ENV_MODE_EXT 0x8407 + GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 + GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 + GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A + GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B + GL_FRAGMENT_LIGHT0_EXT 0x840C + GL_FRAGMENT_LIGHT7_EXT 0x8413 + void glFragmentColorMaterialEXT (GLenum face, GLenum mode) + void glFragmentLightModelfEXT (GLenum pname, GLfloat param) + void glFragmentLightModelfvEXT (GLenum pname, GLfloat* params) + void glFragmentLightModeliEXT (GLenum pname, GLint param) + void glFragmentLightModelivEXT (GLenum pname, GLint* params) + void glFragmentLightfEXT (GLenum light, GLenum pname, GLfloat param) + void glFragmentLightfvEXT (GLenum light, GLenum pname, GLfloat* params) + void glFragmentLightiEXT (GLenum light, GLenum pname, GLint param) + void glFragmentLightivEXT (GLenum light, GLenum pname, GLint* params) + void glFragmentMaterialfEXT (GLenum face, GLenum pname, const GLfloat param) + void glFragmentMaterialfvEXT (GLenum face, GLenum pname, const GLfloat* params) + void glFragmentMaterialiEXT (GLenum face, GLenum pname, const GLint param) + void glFragmentMaterialivEXT (GLenum face, GLenum pname, const GLint* params) + void glGetFragmentLightfvEXT (GLenum light, GLenum pname, GLfloat* params) + void glGetFragmentLightivEXT (GLenum light, GLenum pname, GLint* params) + void glGetFragmentMaterialfvEXT (GLenum face, GLenum pname, const GLfloat* params) + void glGetFragmentMaterialivEXT (GLenum face, GLenum pname, const GLint* params) + void glLightEnviEXT (GLenum pname, GLint param) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_blit b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_blit new file mode 100644 index 0000000..22110c2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_blit @@ -0,0 +1,8 @@ +GL_EXT_framebuffer_blit +http://www.opengl.org/registry/specs/EXT/framebuffer_blit.txt +GL_EXT_framebuffer_blit + GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 + GL_READ_FRAMEBUFFER_EXT 0x8CA8 + GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 + GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + void glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample new file mode 100644 index 0000000..c512933 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample @@ -0,0 +1,9 @@ +GL_EXT_framebuffer_multisample +http://www.opengl.org/registry/specs/EXT/framebuffer_multisample.txt +GL_EXT_framebuffer_multisample + GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 + GL_MAX_SAMPLES_EXT 0x8D57 + void glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 + GL_MAX_SAMPLES_EXT 0x8D57 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample_blit_scaled b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample_blit_scaled new file mode 100644 index 0000000..706faae --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_multisample_blit_scaled @@ -0,0 +1,5 @@ +GL_EXT_framebuffer_multisample_blit_scaled +http://www.opengl.org/registry/specs/EXT/framebuffer_multisample_blit_scaled.txt +GL_EXT_framebuffer_multisample_blit_scaled + GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA + GL_SCALED_RESOLVE_NICEST_EXT 0x90BB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_object new file mode 100644 index 0000000..1fb4998 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_object @@ -0,0 +1,71 @@ +GL_EXT_framebuffer_object +http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt +GL_EXT_framebuffer_object + GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 + GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 + GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 + GL_RENDERBUFFER_BINDING_EXT 0x8CA7 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 + GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 + GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 + GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC + GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD + GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF + GL_COLOR_ATTACHMENT0_EXT 0x8CE0 + GL_COLOR_ATTACHMENT1_EXT 0x8CE1 + GL_COLOR_ATTACHMENT2_EXT 0x8CE2 + GL_COLOR_ATTACHMENT3_EXT 0x8CE3 + GL_COLOR_ATTACHMENT4_EXT 0x8CE4 + GL_COLOR_ATTACHMENT5_EXT 0x8CE5 + GL_COLOR_ATTACHMENT6_EXT 0x8CE6 + GL_COLOR_ATTACHMENT7_EXT 0x8CE7 + GL_COLOR_ATTACHMENT8_EXT 0x8CE8 + GL_COLOR_ATTACHMENT9_EXT 0x8CE9 + GL_COLOR_ATTACHMENT10_EXT 0x8CEA + GL_COLOR_ATTACHMENT11_EXT 0x8CEB + GL_COLOR_ATTACHMENT12_EXT 0x8CEC + GL_COLOR_ATTACHMENT13_EXT 0x8CED + GL_COLOR_ATTACHMENT14_EXT 0x8CEE + GL_COLOR_ATTACHMENT15_EXT 0x8CEF + GL_DEPTH_ATTACHMENT_EXT 0x8D00 + GL_STENCIL_ATTACHMENT_EXT 0x8D20 + GL_FRAMEBUFFER_EXT 0x8D40 + GL_RENDERBUFFER_EXT 0x8D41 + GL_RENDERBUFFER_WIDTH_EXT 0x8D42 + GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 + GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 + GL_STENCIL_INDEX1_EXT 0x8D46 + GL_STENCIL_INDEX4_EXT 0x8D47 + GL_STENCIL_INDEX8_EXT 0x8D48 + GL_STENCIL_INDEX16_EXT 0x8D49 + GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 + GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 + GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 + GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 + GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 + GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + void glBindFramebufferEXT (GLenum target, GLuint framebuffer) + void glBindRenderbufferEXT (GLenum target, GLuint renderbuffer) + GLenum glCheckFramebufferStatusEXT (GLenum target) + void glDeleteFramebuffersEXT (GLsizei n, const GLuint* framebuffers) + void glDeleteRenderbuffersEXT (GLsizei n, const GLuint* renderbuffers) + void glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + void glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + void glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) + void glGenFramebuffersEXT (GLsizei n, GLuint* framebuffers) + void glGenRenderbuffersEXT (GLsizei n, GLuint* renderbuffers) + void glGenerateMipmapEXT (GLenum target) + void glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint* params) + void glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint* params) + GLboolean glIsFramebufferEXT (GLuint framebuffer) + GLboolean glIsRenderbufferEXT (GLuint renderbuffer) + void glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_sRGB new file mode 100644 index 0000000..4ca897b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_framebuffer_sRGB @@ -0,0 +1,5 @@ +GL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +GL_EXT_framebuffer_sRGB + GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_geometry_shader4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_geometry_shader4 new file mode 100644 index 0000000..f6f6785 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_geometry_shader4 @@ -0,0 +1,26 @@ +GL_EXT_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_geometry_shader4.txt +GL_EXT_geometry_shader4 + GL_GEOMETRY_SHADER_EXT 0x8DD9 + GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD + GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE + GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA + GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB + GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 + GL_LINES_ADJACENCY_EXT 0xA + GL_LINE_STRIP_ADJACENCY_EXT 0xB + GL_TRIANGLES_ADJACENCY_EXT 0xC + GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 + GL_PROGRAM_POINT_SIZE_EXT 0x8642 + void glProgramParameteriEXT (GLuint program, GLenum pname, GLint value) + void glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level) + void glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_program_parameters b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_program_parameters new file mode 100644 index 0000000..9048c98 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_program_parameters @@ -0,0 +1,5 @@ +GL_EXT_gpu_program_parameters +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_program_parameters.txt +GL_EXT_gpu_program_parameters + void glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) + void glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_shader4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_shader4 new file mode 100644 index 0000000..0e89f0d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_gpu_shader4 @@ -0,0 +1,63 @@ +GL_EXT_gpu_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_EXT_gpu_shader4.txt +GL_EXT_gpu_shader4 + GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 + GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 + GL_SAMPLER_BUFFER_EXT 0x8DC2 + GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 + GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 + GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 + GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 + GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 + GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 + GL_INT_SAMPLER_1D_EXT 0x8DC9 + GL_INT_SAMPLER_2D_EXT 0x8DCA + GL_INT_SAMPLER_3D_EXT 0x8DCB + GL_INT_SAMPLER_CUBE_EXT 0x8DCC + GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD + GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE + GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF + GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 + GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 + GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 + GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 + GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 + GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 + GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD + void glGetUniformuivEXT (GLuint program, GLint location, GLuint *params) + void glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name) + GLint glGetFragDataLocationEXT (GLuint program, const GLchar *name) + void glUniform1uiEXT (GLint location, GLuint v0) + void glUniform2uiEXT (GLint location, GLuint v0, GLuint v1) + void glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2) + void glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) + void glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value) + void glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value) + void glVertexAttribI1iEXT (GLuint index, GLint x) + void glVertexAttribI2iEXT (GLuint index, GLint x, GLint y) + void glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z) + void glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w) + void glVertexAttribI1uiEXT (GLuint index, GLuint x) + void glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y) + void glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z) + void glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glVertexAttribI1ivEXT (GLuint index, const GLint *v) + void glVertexAttribI2ivEXT (GLuint index, const GLint *v) + void glVertexAttribI3ivEXT (GLuint index, const GLint *v) + void glVertexAttribI4ivEXT (GLuint index, const GLint *v) + void glVertexAttribI1uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI2uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI3uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4uivEXT (GLuint index, const GLuint *v) + void glVertexAttribI4bvEXT (GLuint index, const GLbyte *v) + void glVertexAttribI4svEXT (GLuint index, const GLshort *v) + void glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v) + void glVertexAttribI4usvEXT (GLuint index, const GLushort *v) + void glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) + void glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params) + void glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_histogram b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_histogram new file mode 100644 index 0000000..14dfb52 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_histogram @@ -0,0 +1,26 @@ +GL_EXT_histogram +http://www.opengl.org/registry/specs/EXT/histogram.txt +GL_EXT_histogram + GL_HISTOGRAM_EXT 0x8024 + GL_PROXY_HISTOGRAM_EXT 0x8025 + GL_HISTOGRAM_WIDTH_EXT 0x8026 + GL_HISTOGRAM_FORMAT_EXT 0x8027 + GL_HISTOGRAM_RED_SIZE_EXT 0x8028 + GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 + GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A + GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B + GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C + GL_HISTOGRAM_SINK_EXT 0x802D + GL_MINMAX_EXT 0x802E + GL_MINMAX_FORMAT_EXT 0x802F + GL_MINMAX_SINK_EXT 0x8030 + void glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values) + void glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values) + void glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint* params) + void glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) + void glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink) + void glResetHistogramEXT (GLenum target) + void glResetMinmaxEXT (GLenum target) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_array_formats b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_array_formats new file mode 100644 index 0000000..cc11b98 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_array_formats @@ -0,0 +1,3 @@ +GL_EXT_index_array_formats +http://www.opengl.org/registry/specs/EXT/index_array_formats.txt +GL_EXT_index_array_formats diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_func b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_func new file mode 100644 index 0000000..8431c5a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_func @@ -0,0 +1,4 @@ +GL_EXT_index_func +http://www.opengl.org/registry/specs/EXT/index_func.txt +GL_EXT_index_func + void glIndexFuncEXT (GLenum func, GLfloat ref) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_material b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_material new file mode 100644 index 0000000..7bb43d6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_material @@ -0,0 +1,4 @@ +GL_EXT_index_material +http://www.opengl.org/registry/specs/EXT/index_material.txt +GL_EXT_index_material + void glIndexMaterialEXT (GLenum face, GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_texture new file mode 100644 index 0000000..c4ee051 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_index_texture @@ -0,0 +1,3 @@ +GL_EXT_index_texture +http://www.opengl.org/registry/specs/EXT/index_texture.txt +GL_EXT_index_texture diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_light_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_light_texture new file mode 100644 index 0000000..1330121 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_light_texture @@ -0,0 +1,15 @@ +GL_EXT_light_texture +http://www.opengl.org/registry/specs/EXT/light_texture.txt +GL_EXT_light_texture + GL_FRAGMENT_MATERIAL_EXT 0x8349 + GL_FRAGMENT_NORMAL_EXT 0x834A + GL_FRAGMENT_COLOR_EXT 0x834C + GL_ATTENUATION_EXT 0x834D + GL_SHADOW_ATTENUATION_EXT 0x834E + GL_TEXTURE_APPLICATION_MODE_EXT 0x834F + GL_TEXTURE_LIGHT_EXT 0x8350 + GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 + GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + void glApplyTextureEXT (GLenum mode) + void glTextureLightEXT (GLenum pname) + void glTextureMaterialEXT (GLenum face, GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_misc_attribute b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_misc_attribute new file mode 100644 index 0000000..ad4cee0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_misc_attribute @@ -0,0 +1,3 @@ +GL_EXT_misc_attribute +http://www.opengl.org/registry/specs/EXT/misc_attribute.txt +GL_EXT_misc_attribute diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multi_draw_arrays b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multi_draw_arrays new file mode 100644 index 0000000..347f829 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multi_draw_arrays @@ -0,0 +1,5 @@ +GL_EXT_multi_draw_arrays +http://www.opengl.org/registry/specs/EXT/multi_draw_arrays.txt +GL_EXT_multi_draw_arrays + void glMultiDrawArraysEXT (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount) + void glMultiDrawElementsEXT (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multisample new file mode 100644 index 0000000..bdb1e16 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_multisample @@ -0,0 +1,22 @@ +GL_EXT_multisample +http://www.opengl.org/registry/specs/EXT/wgl_multisample.txt +GL_EXT_multisample + GL_MULTISAMPLE_EXT 0x809D + GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E + GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + GL_SAMPLE_MASK_EXT 0x80A0 + GL_1PASS_EXT 0x80A1 + GL_2PASS_0_EXT 0x80A2 + GL_2PASS_1_EXT 0x80A3 + GL_4PASS_0_EXT 0x80A4 + GL_4PASS_1_EXT 0x80A5 + GL_4PASS_2_EXT 0x80A6 + GL_4PASS_3_EXT 0x80A7 + GL_SAMPLE_BUFFERS_EXT 0x80A8 + GL_SAMPLES_EXT 0x80A9 + GL_SAMPLE_MASK_VALUE_EXT 0x80AA + GL_SAMPLE_MASK_INVERT_EXT 0x80AB + GL_SAMPLE_PATTERN_EXT 0x80AC + GL_MULTISAMPLE_BIT_EXT 0x20000000 + void glSampleMaskEXT (GLclampf value, GLboolean invert) + void glSamplePatternEXT (GLenum pattern) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_depth_stencil b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_depth_stencil new file mode 100644 index 0000000..44a711c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_depth_stencil @@ -0,0 +1,7 @@ +GL_EXT_packed_depth_stencil +http://www.opengl.org/registry/specs/EXT/packed_depth_stencil.txt +GL_EXT_packed_depth_stencil + GL_DEPTH_STENCIL_EXT 0x84F9 + GL_UNSIGNED_INT_24_8_EXT 0x84FA + GL_DEPTH24_STENCIL8_EXT 0x88F0 + GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_float new file mode 100644 index 0000000..bcb2255 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_float @@ -0,0 +1,6 @@ +GL_EXT_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +GL_EXT_packed_float + GL_R11F_G11F_B10F_EXT 0x8C3A + GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B + GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_pixels b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_pixels new file mode 100644 index 0000000..ba47d59 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_packed_pixels @@ -0,0 +1,8 @@ +GL_EXT_packed_pixels +http://www.opengl.org/registry/specs/EXT/packed_pixels.txt +GL_EXT_packed_pixels + GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 + GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 + GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 + GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 + GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_paletted_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_paletted_texture new file mode 100644 index 0000000..cfbbe83 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_paletted_texture @@ -0,0 +1,28 @@ +GL_EXT_paletted_texture +http://www.opengl.org/registry/specs/EXT/paletted_texture.txt +GL_EXT_paletted_texture + GL_TEXTURE_1D 0x0DE0 + GL_TEXTURE_2D 0x0DE1 + GL_PROXY_TEXTURE_1D 0x8063 + GL_PROXY_TEXTURE_2D 0x8064 + GL_COLOR_TABLE_FORMAT_EXT 0x80D8 + GL_COLOR_TABLE_WIDTH_EXT 0x80D9 + GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA + GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB + GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF + GL_COLOR_INDEX1_EXT 0x80E2 + GL_COLOR_INDEX2_EXT 0x80E3 + GL_COLOR_INDEX4_EXT 0x80E4 + GL_COLOR_INDEX8_EXT 0x80E5 + GL_COLOR_INDEX12_EXT 0x80E6 + GL_COLOR_INDEX16_EXT 0x80E7 + GL_TEXTURE_INDEX_SIZE_EXT 0x80ED + GL_TEXTURE_CUBE_MAP_ARB 0x8513 + GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + void glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data) + void glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void* data) + void glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat* params) + void glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_buffer_object new file mode 100644 index 0000000..a7f8f2c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_buffer_object @@ -0,0 +1,7 @@ +GL_EXT_pixel_buffer_object +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_pixel_buffer_object.txt +GL_EXT_pixel_buffer_object + GL_PIXEL_PACK_BUFFER_EXT 0x88EB + GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC + GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform new file mode 100644 index 0000000..30fdbfb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform @@ -0,0 +1,18 @@ +GL_EXT_pixel_transform +http://www.opengl.org/registry/specs/EXT/pixel_transform.txt +GL_EXT_pixel_transform + GL_PIXEL_TRANSFORM_2D_EXT 0x8330 + GL_PIXEL_MAG_FILTER_EXT 0x8331 + GL_PIXEL_MIN_FILTER_EXT 0x8332 + GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 + GL_CUBIC_EXT 0x8334 + GL_AVERAGE_EXT 0x8335 + GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 + GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 + GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + void glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint* params) + void glPixelTransformParameterfEXT (GLenum target, GLenum pname, const GLfloat param) + void glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat* params) + void glPixelTransformParameteriEXT (GLenum target, GLenum pname, const GLint param) + void glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform_color_table b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform_color_table new file mode 100644 index 0000000..c53b731 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_pixel_transform_color_table @@ -0,0 +1,3 @@ +GL_EXT_pixel_transform_color_table +http://www.opengl.org/registry/specs/EXT/pixel_transform_color_table.txt +GL_EXT_pixel_transform_color_table diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_point_parameters b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_point_parameters new file mode 100644 index 0000000..fab73cc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_point_parameters @@ -0,0 +1,9 @@ +GL_EXT_point_parameters +http://www.opengl.org/registry/specs/EXT/point_parameters.txt +GL_EXT_point_parameters + GL_POINT_SIZE_MIN_EXT 0x8126 + GL_POINT_SIZE_MAX_EXT 0x8127 + GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 + GL_DISTANCE_ATTENUATION_EXT 0x8129 + void glPointParameterfEXT (GLenum pname, GLfloat param) + void glPointParameterfvEXT (GLenum pname, const GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_polygon_offset b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_polygon_offset new file mode 100644 index 0000000..66d81eb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_polygon_offset @@ -0,0 +1,7 @@ +GL_EXT_polygon_offset +http://www.opengl.org/registry/specs/EXT/polygon_offset.txt +GL_EXT_polygon_offset + GL_POLYGON_OFFSET_EXT 0x8037 + GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 + GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + void glPolygonOffsetEXT (GLfloat factor, GLfloat bias) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_provoking_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_provoking_vertex new file mode 100644 index 0000000..8512a05 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_provoking_vertex @@ -0,0 +1,8 @@ +GL_EXT_provoking_vertex +http://www.opengl.org/registry/specs/EXT/provoking_vertex.txt +GL_EXT_provoking_vertex + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C + GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D + GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E + GL_PROVOKING_VERTEX_EXT 0x8E4F + void glProvokingVertexEXT (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_rescale_normal b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_rescale_normal new file mode 100644 index 0000000..d87b45d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_rescale_normal @@ -0,0 +1,4 @@ +GL_EXT_rescale_normal +http://www.opengl.org/registry/specs/EXT/rescale_normal.txt +GL_EXT_rescale_normal + GL_RESCALE_NORMAL_EXT 0x803A diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_scene_marker b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_scene_marker new file mode 100644 index 0000000..0ac0093 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_scene_marker @@ -0,0 +1,5 @@ +GL_EXT_scene_marker +http://www.opengl.org/registry/specs/EXT/scene_marker.txt +GL_EXT_scene_marker + void glBeginSceneEXT (void) + void glEndSceneEXT (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_secondary_color b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_secondary_color new file mode 100644 index 0000000..e915455 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_secondary_color @@ -0,0 +1,27 @@ +GL_EXT_secondary_color +http://oss.sgi.com/projects/ogl-sample/registry/EXT/secondary_color.txt +GL_EXT_secondary_color + GL_COLOR_SUM_EXT 0x8458 + GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C + GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D + GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + void glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue) + void glSecondaryColor3bvEXT (const GLbyte *v) + void glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue) + void glSecondaryColor3dvEXT (const GLdouble *v) + void glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue) + void glSecondaryColor3fvEXT (const GLfloat *v) + void glSecondaryColor3iEXT (GLint red, GLint green, GLint blue) + void glSecondaryColor3ivEXT (const GLint *v) + void glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue) + void glSecondaryColor3svEXT (const GLshort *v) + void glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue) + void glSecondaryColor3ubvEXT (const GLubyte *v) + void glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue) + void glSecondaryColor3uivEXT (const GLuint *v) + void glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue) + void glSecondaryColor3usvEXT (const GLushort *v) + void glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_shader_objects b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_shader_objects new file mode 100644 index 0000000..cdba287 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_shader_objects @@ -0,0 +1,7 @@ +GL_EXT_separate_shader_objects +http://www.opengl.org/registry/specs/EXT/separate_shader_objects.txt +GL_EXT_separate_shader_objects + GL_ACTIVE_PROGRAM_EXT 0x8B8D + void glActiveProgramEXT (GLuint program) + GLuint glCreateShaderProgramEXT (GLenum type, const GLchar* string) + void glUseShaderProgramEXT (GLenum type, GLuint program) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_specular_color b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_specular_color new file mode 100644 index 0000000..4b71768 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_separate_specular_color @@ -0,0 +1,6 @@ +GL_EXT_separate_specular_color +http://www.opengl.org/registry/specs/EXT/separate_specular_color.txt +GL_EXT_separate_specular_color + GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 + GL_SINGLE_COLOR_EXT 0x81F9 + GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shader_image_load_store b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shader_image_load_store new file mode 100644 index 0000000..a6845b4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shader_image_load_store @@ -0,0 +1,60 @@ +GL_EXT_shader_image_load_store +http://www.opengl.org/registry/specs/EXT/shader_image_load_store.txt +GL_EXT_shader_image_load_store + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 + GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 + GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 + GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 + GL_COMMAND_BARRIER_BIT_EXT 0x00000040 + GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 + GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 + GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 + GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 + GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 + GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 + GL_MAX_IMAGE_UNITS_EXT 0x8F38 + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 + GL_IMAGE_BINDING_NAME_EXT 0x8F3A + GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B + GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C + GL_IMAGE_BINDING_LAYER_EXT 0x8F3D + GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E + GL_IMAGE_1D_EXT 0x904C + GL_IMAGE_2D_EXT 0x904D + GL_IMAGE_3D_EXT 0x904E + GL_IMAGE_2D_RECT_EXT 0x904F + GL_IMAGE_CUBE_EXT 0x9050 + GL_IMAGE_BUFFER_EXT 0x9051 + GL_IMAGE_1D_ARRAY_EXT 0x9052 + GL_IMAGE_2D_ARRAY_EXT 0x9053 + GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 + GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 + GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 + GL_INT_IMAGE_1D_EXT 0x9057 + GL_INT_IMAGE_2D_EXT 0x9058 + GL_INT_IMAGE_3D_EXT 0x9059 + GL_INT_IMAGE_2D_RECT_EXT 0x905A + GL_INT_IMAGE_CUBE_EXT 0x905B + GL_INT_IMAGE_BUFFER_EXT 0x905C + GL_INT_IMAGE_1D_ARRAY_EXT 0x905D + GL_INT_IMAGE_2D_ARRAY_EXT 0x905E + GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F + GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 + GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 + GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 + GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 + GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 + GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 + GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 + GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 + GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C + GL_MAX_IMAGE_SAMPLES_EXT 0x906D + GL_IMAGE_BINDING_FORMAT_EXT 0x906E + GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + void glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format) + void glMemoryBarrierEXT (GLbitfield barriers) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shadow_funcs b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shadow_funcs new file mode 100644 index 0000000..d92a7c4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shadow_funcs @@ -0,0 +1,3 @@ +GL_EXT_shadow_funcs +http://www.opengl.org/registry/specs/EXT/shadow_funcs.txt +GL_EXT_shadow_funcs diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shared_texture_palette b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shared_texture_palette new file mode 100644 index 0000000..7ca0875 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_shared_texture_palette @@ -0,0 +1,4 @@ +GL_EXT_shared_texture_palette +http://www.opengl.org/registry/specs/EXT/shared_texture_palette.txt +GL_EXT_shared_texture_palette + GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_clear_tag b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_clear_tag new file mode 100644 index 0000000..a117d0e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_clear_tag @@ -0,0 +1,5 @@ +GL_EXT_stencil_clear_tag +http://www.opengl.org/registry/specs/EXT/stencil_clear_tag.txt +GL_EXT_stencil_clear_tag + GL_STENCIL_TAG_BITS_EXT 0x88F2 + GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_two_side b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_two_side new file mode 100644 index 0000000..4145dc8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_two_side @@ -0,0 +1,6 @@ +GL_EXT_stencil_two_side +http://www.opengl.org/registry/specs/EXT/stencil_two_side.txt +GL_EXT_stencil_two_side + GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 + GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + void glActiveStencilFaceEXT (GLenum face) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_wrap b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_wrap new file mode 100644 index 0000000..b9ee8eb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_stencil_wrap @@ -0,0 +1,5 @@ +GL_EXT_stencil_wrap +http://www.opengl.org/registry/specs/EXT/stencil_wrap.txt +GL_EXT_stencil_wrap + GL_INCR_WRAP_EXT 0x8507 + GL_DECR_WRAP_EXT 0x8508 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_subtexture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_subtexture new file mode 100644 index 0000000..1592146 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_subtexture @@ -0,0 +1,6 @@ +GL_EXT_subtexture +http://www.opengl.org/registry/specs/EXT/subtexture.txt +GL_EXT_subtexture + void glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels) + void glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) + void glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture new file mode 100644 index 0000000..5e78f29 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture @@ -0,0 +1,45 @@ +GL_EXT_texture +http://www.opengl.org/registry/specs/EXT/texture.txt +GL_EXT_texture + GL_ALPHA4_EXT 0x803B + GL_ALPHA8_EXT 0x803C + GL_ALPHA12_EXT 0x803D + GL_ALPHA16_EXT 0x803E + GL_LUMINANCE4_EXT 0x803F + GL_LUMINANCE8_EXT 0x8040 + GL_LUMINANCE12_EXT 0x8041 + GL_LUMINANCE16_EXT 0x8042 + GL_LUMINANCE4_ALPHA4_EXT 0x8043 + GL_LUMINANCE6_ALPHA2_EXT 0x8044 + GL_LUMINANCE8_ALPHA8_EXT 0x8045 + GL_LUMINANCE12_ALPHA4_EXT 0x8046 + GL_LUMINANCE12_ALPHA12_EXT 0x8047 + GL_LUMINANCE16_ALPHA16_EXT 0x8048 + GL_INTENSITY_EXT 0x8049 + GL_INTENSITY4_EXT 0x804A + GL_INTENSITY8_EXT 0x804B + GL_INTENSITY12_EXT 0x804C + GL_INTENSITY16_EXT 0x804D + GL_RGB2_EXT 0x804E + GL_RGB4_EXT 0x804F + GL_RGB5_EXT 0x8050 + GL_RGB8_EXT 0x8051 + GL_RGB10_EXT 0x8052 + GL_RGB12_EXT 0x8053 + GL_RGB16_EXT 0x8054 + GL_RGBA2_EXT 0x8055 + GL_RGBA4_EXT 0x8056 + GL_RGB5_A1_EXT 0x8057 + GL_RGBA8_EXT 0x8058 + GL_RGB10_A2_EXT 0x8059 + GL_RGBA12_EXT 0x805A + GL_RGBA16_EXT 0x805B + GL_TEXTURE_RED_SIZE_EXT 0x805C + GL_TEXTURE_GREEN_SIZE_EXT 0x805D + GL_TEXTURE_BLUE_SIZE_EXT 0x805E + GL_TEXTURE_ALPHA_SIZE_EXT 0x805F + GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 + GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 + GL_REPLACE_EXT 0x8062 + GL_PROXY_TEXTURE_1D_EXT 0x8063 + GL_PROXY_TEXTURE_2D_EXT 0x8064 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture3D b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture3D new file mode 100644 index 0000000..5f248ba --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture3D @@ -0,0 +1,13 @@ +GL_EXT_texture3D +http://www.opengl.org/registry/specs/EXT/texture3D.txt +GL_EXT_texture3D + GL_PACK_SKIP_IMAGES_EXT 0x806B + GL_PACK_IMAGE_HEIGHT_EXT 0x806C + GL_UNPACK_SKIP_IMAGES_EXT 0x806D + GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E + GL_TEXTURE_3D_EXT 0x806F + GL_PROXY_TEXTURE_3D_EXT 0x8070 + GL_TEXTURE_DEPTH_EXT 0x8071 + GL_TEXTURE_WRAP_R_EXT 0x8072 + GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + void glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_array new file mode 100644 index 0000000..11877f0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_array @@ -0,0 +1,12 @@ +GL_EXT_texture_array +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_array.txt +GL_EXT_texture_array + GL_TEXTURE_1D_ARRAY_EXT 0x8C18 + GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 + GL_TEXTURE_2D_ARRAY_EXT 0x8C1A + GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B + GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C + GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF + GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E + void glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_buffer_object new file mode 100644 index 0000000..c00e1f3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_buffer_object @@ -0,0 +1,9 @@ +GL_EXT_texture_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_buffer_object.txt +GL_EXT_texture_buffer_object + GL_TEXTURE_BUFFER_EXT 0x8C2A + GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B + GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D + GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + void glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_dxt1 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_dxt1 new file mode 100644 index 0000000..7abb15c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_dxt1 @@ -0,0 +1,3 @@ +GL_EXT_texture_compression_dxt1 +http://www.opengl.org/registry/specs/EXT/texture_compression_dxt1.txt +GL_EXT_texture_compression_dxt1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_latc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_latc new file mode 100644 index 0000000..ddf8d26 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_latc @@ -0,0 +1,7 @@ +GL_EXT_texture_compression_latc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_latc.txt +GL_EXT_texture_compression_latc + GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_rgtc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_rgtc new file mode 100644 index 0000000..7c5c57f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_rgtc @@ -0,0 +1,7 @@ +GL_EXT_texture_compression_rgtc +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_compression_rgtc.txt +GL_EXT_texture_compression_rgtc + GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB + GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC + GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD + GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_s3tc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_s3tc new file mode 100644 index 0000000..6369ded --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_compression_s3tc @@ -0,0 +1,7 @@ +GL_EXT_texture_compression_s3tc +http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt +GL_EXT_texture_compression_s3tc + GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_cube_map b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_cube_map new file mode 100644 index 0000000..5909f48 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_cube_map @@ -0,0 +1,15 @@ +GL_EXT_texture_cube_map +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_cube_map.txt +GL_EXT_texture_cube_map + GL_NORMAL_MAP_EXT 0x8511 + GL_REFLECTION_MAP_EXT 0x8512 + GL_TEXTURE_CUBE_MAP_EXT 0x8513 + GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 + GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A + GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B + GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_edge_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_edge_clamp new file mode 100644 index 0000000..4df0997 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_edge_clamp @@ -0,0 +1,4 @@ +GL_EXT_texture_edge_clamp +http://www.opengl.org/developers/documentation/Version1.2/1.2specs/texture_edge_clamp.txt +GL_EXT_texture_edge_clamp + GL_CLAMP_TO_EDGE_EXT 0x812F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env new file mode 100644 index 0000000..73017c2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env @@ -0,0 +1,14 @@ +GL_EXT_texture_env +http://www.opengl.org/registry/specs/EXT/texture_env.txt +GL_EXT_texture_env + GL_TEXTURE_ENV0_EXT 0 + GL_TEXTURE_ENV_SHIFT_EXT 0 + GL_ENV_BLEND_EXT 0 + GL_ENV_ADD_EXT 0 + GL_ENV_REPLACE_EXT 0 + GL_ENV_SUBTRACT_EXT 0 + GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 + GL_ENV_REVERSE_BLEND_EXT 0 + GL_ENV_REVERSE_SUBTRACT_EXT 0 + GL_ENV_COPY_EXT 0 + GL_ENV_MODULATE_EXT 0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_add b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_add new file mode 100644 index 0000000..11eead6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_add @@ -0,0 +1,3 @@ +GL_EXT_texture_env_add +http://www.opengl.org/registry/specs/EXT/texture_env_add.txt +GL_EXT_texture_env_add diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_combine b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_combine new file mode 100644 index 0000000..dda8891 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_combine @@ -0,0 +1,24 @@ +GL_EXT_texture_env_combine +http://www.opengl.org/registry/specs/EXT/texture_env_combine.txt +GL_EXT_texture_env_combine + GL_COMBINE_EXT 0x8570 + GL_COMBINE_RGB_EXT 0x8571 + GL_COMBINE_ALPHA_EXT 0x8572 + GL_RGB_SCALE_EXT 0x8573 + GL_ADD_SIGNED_EXT 0x8574 + GL_INTERPOLATE_EXT 0x8575 + GL_CONSTANT_EXT 0x8576 + GL_PRIMARY_COLOR_EXT 0x8577 + GL_PREVIOUS_EXT 0x8578 + GL_SOURCE0_RGB_EXT 0x8580 + GL_SOURCE1_RGB_EXT 0x8581 + GL_SOURCE2_RGB_EXT 0x8582 + GL_SOURCE0_ALPHA_EXT 0x8588 + GL_SOURCE1_ALPHA_EXT 0x8589 + GL_SOURCE2_ALPHA_EXT 0x858A + GL_OPERAND0_RGB_EXT 0x8590 + GL_OPERAND1_RGB_EXT 0x8591 + GL_OPERAND2_RGB_EXT 0x8592 + GL_OPERAND0_ALPHA_EXT 0x8598 + GL_OPERAND1_ALPHA_EXT 0x8599 + GL_OPERAND2_ALPHA_EXT 0x859A diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_dot3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_dot3 new file mode 100644 index 0000000..3b740d6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_env_dot3 @@ -0,0 +1,5 @@ +GL_EXT_texture_env_dot3 +http://www.opengl.org/registry/specs/EXT/texture_env_dot3.txt +GL_EXT_texture_env_dot3 + GL_DOT3_RGB_EXT 0x8740 + GL_DOT3_RGBA_EXT 0x8741 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_filter_anisotropic b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_filter_anisotropic new file mode 100644 index 0000000..1e4d780 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_filter_anisotropic @@ -0,0 +1,5 @@ +GL_EXT_texture_filter_anisotropic +http://www.opengl.org/registry/specs/EXT/texture_filter_anisotropic.txt +GL_EXT_texture_filter_anisotropic + GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE + GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_integer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_integer new file mode 100644 index 0000000..1c57e40 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_integer @@ -0,0 +1,56 @@ +GL_EXT_texture_integer +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_integer.txt +GL_EXT_texture_integer + GL_RGBA32UI_EXT 0x8D70 + GL_RGB32UI_EXT 0x8D71 + GL_ALPHA32UI_EXT 0x8D72 + GL_INTENSITY32UI_EXT 0x8D73 + GL_LUMINANCE32UI_EXT 0x8D74 + GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 + GL_RGBA16UI_EXT 0x8D76 + GL_RGB16UI_EXT 0x8D77 + GL_ALPHA16UI_EXT 0x8D78 + GL_INTENSITY16UI_EXT 0x8D79 + GL_LUMINANCE16UI_EXT 0x8D7A + GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B + GL_RGBA8UI_EXT 0x8D7C + GL_RGB8UI_EXT 0x8D7D + GL_ALPHA8UI_EXT 0x8D7E + GL_INTENSITY8UI_EXT 0x8D7F + GL_LUMINANCE8UI_EXT 0x8D80 + GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 + GL_RGBA32I_EXT 0x8D82 + GL_RGB32I_EXT 0x8D83 + GL_ALPHA32I_EXT 0x8D84 + GL_INTENSITY32I_EXT 0x8D85 + GL_LUMINANCE32I_EXT 0x8D86 + GL_LUMINANCE_ALPHA32I_EXT 0x8D87 + GL_RGBA16I_EXT 0x8D88 + GL_RGB16I_EXT 0x8D89 + GL_ALPHA16I_EXT 0x8D8A + GL_INTENSITY16I_EXT 0x8D8B + GL_LUMINANCE16I_EXT 0x8D8C + GL_LUMINANCE_ALPHA16I_EXT 0x8D8D + GL_RGBA8I_EXT 0x8D8E + GL_RGB8I_EXT 0x8D8F + GL_ALPHA8I_EXT 0x8D90 + GL_INTENSITY8I_EXT 0x8D91 + GL_LUMINANCE8I_EXT 0x8D92 + GL_LUMINANCE_ALPHA8I_EXT 0x8D93 + GL_RED_INTEGER_EXT 0x8D94 + GL_GREEN_INTEGER_EXT 0x8D95 + GL_BLUE_INTEGER_EXT 0x8D96 + GL_ALPHA_INTEGER_EXT 0x8D97 + GL_RGB_INTEGER_EXT 0x8D98 + GL_RGBA_INTEGER_EXT 0x8D99 + GL_BGR_INTEGER_EXT 0x8D9A + GL_BGRA_INTEGER_EXT 0x8D9B + GL_LUMINANCE_INTEGER_EXT 0x8D9C + GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D + GL_RGBA_INTEGER_MODE_EXT 0x8D9E + void glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params) + void glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params) + void glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params) + void glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params) + void glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha) + void glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_lod_bias b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_lod_bias new file mode 100644 index 0000000..2166126 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_lod_bias @@ -0,0 +1,6 @@ +GL_EXT_texture_lod_bias +http://www.opengl.org/registry/specs/EXT/texture_lod_bias.txt +GL_EXT_texture_lod_bias + GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD + GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 + GL_TEXTURE_LOD_BIAS_EXT 0x8501 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_mirror_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_mirror_clamp new file mode 100644 index 0000000..6e3471c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_mirror_clamp @@ -0,0 +1,6 @@ +GL_EXT_texture_mirror_clamp +http://www.opengl.org/registry/specs/EXT/texture_mirror_clamp.txt +GL_EXT_texture_mirror_clamp + GL_MIRROR_CLAMP_EXT 0x8742 + GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 + GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_object new file mode 100644 index 0000000..13d4cde --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_object @@ -0,0 +1,14 @@ +GL_EXT_texture_object +http://www.opengl.org/registry/specs/EXT/texture_object.txt +GL_EXT_texture_object + GL_TEXTURE_PRIORITY_EXT 0x8066 + GL_TEXTURE_RESIDENT_EXT 0x8067 + GL_TEXTURE_1D_BINDING_EXT 0x8068 + GL_TEXTURE_2D_BINDING_EXT 0x8069 + GL_TEXTURE_3D_BINDING_EXT 0x806A + GLboolean glAreTexturesResidentEXT (GLsizei n, const GLuint* textures, GLboolean* residences) + void glBindTextureEXT (GLenum target, GLuint texture) + void glDeleteTexturesEXT (GLsizei n, const GLuint* textures) + void glGenTexturesEXT (GLsizei n, GLuint* textures) + GLboolean glIsTextureEXT (GLuint texture) + void glPrioritizeTexturesEXT (GLsizei n, const GLuint* textures, const GLclampf* priorities) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_perturb_normal b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_perturb_normal new file mode 100644 index 0000000..b852190 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_perturb_normal @@ -0,0 +1,6 @@ +GL_EXT_texture_perturb_normal +http://www.opengl.org/registry/specs/EXT/texture_perturb_normal.txt +GL_EXT_texture_perturb_normal + GL_PERTURB_EXT 0x85AE + GL_TEXTURE_NORMAL_EXT 0x85AF + void glTextureNormalEXT (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_rectangle new file mode 100644 index 0000000..4028a9e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_rectangle @@ -0,0 +1,7 @@ +GL_EXT_texture_rectangle +http://developer.apple.com/opengl/extensions/ext_texture_rectangle.html +GL_EXT_texture_rectangle + GL_TEXTURE_RECTANGLE_EXT 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB new file mode 100644 index 0000000..e38d9a9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB @@ -0,0 +1,19 @@ +GL_EXT_texture_sRGB +http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt +GL_EXT_texture_sRGB + GL_SRGB_EXT 0x8C40 + GL_SRGB8_EXT 0x8C41 + GL_SRGB_ALPHA_EXT 0x8C42 + GL_SRGB8_ALPHA8_EXT 0x8C43 + GL_SLUMINANCE_ALPHA_EXT 0x8C44 + GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 + GL_SLUMINANCE_EXT 0x8C46 + GL_SLUMINANCE8_EXT 0x8C47 + GL_COMPRESSED_SRGB_EXT 0x8C48 + GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 + GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A + GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B + GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB_decode b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB_decode new file mode 100644 index 0000000..28f0248 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_sRGB_decode @@ -0,0 +1,6 @@ +GL_EXT_texture_sRGB_decode +http://www.opengl.org/registry/specs/EXT/texture_sRGB_decode.txt +GL_EXT_texture_sRGB_decode + GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 + GL_DECODE_EXT 0x8A49 + GL_SKIP_DECODE_EXT 0x8A4A diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_shared_exponent b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_shared_exponent new file mode 100644 index 0000000..4ff7efc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_shared_exponent @@ -0,0 +1,6 @@ +GL_EXT_texture_shared_exponent +http://developer.download.nvidia.com/opengl/specs/GL_EXT_texture_shared_exponent.txt +GL_EXT_texture_shared_exponent + GL_RGB9_E5_EXT 0x8C3D + GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E + GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_snorm b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_snorm new file mode 100644 index 0000000..493a8be --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_snorm @@ -0,0 +1,28 @@ +GL_EXT_texture_snorm +http://www.opengl.org/registry/specs/EXT/texture_snorm.txt +GL_EXT_texture_snorm + GL_RED_SNORM 0x8F90 + GL_RG_SNORM 0x8F91 + GL_RGB_SNORM 0x8F92 + GL_RGBA_SNORM 0x8F93 + GL_R8_SNORM 0x8F94 + GL_RG8_SNORM 0x8F95 + GL_RGB8_SNORM 0x8F96 + GL_RGBA8_SNORM 0x8F97 + GL_R16_SNORM 0x8F98 + GL_RG16_SNORM 0x8F99 + GL_RGB16_SNORM 0x8F9A + GL_RGBA16_SNORM 0x8F9B + GL_SIGNED_NORMALIZED 0x8F9C + GL_ALPHA_SNORM 0x9010 + GL_LUMINANCE_SNORM 0x9011 + GL_LUMINANCE_ALPHA_SNORM 0x9012 + GL_INTENSITY_SNORM 0x9013 + GL_ALPHA8_SNORM 0x9014 + GL_LUMINANCE8_SNORM 0x9015 + GL_LUMINANCE8_ALPHA8_SNORM 0x9016 + GL_INTENSITY8_SNORM 0x9017 + GL_ALPHA16_SNORM 0x9018 + GL_LUMINANCE16_SNORM 0x9019 + GL_LUMINANCE16_ALPHA16_SNORM 0x901A + GL_INTENSITY16_SNORM 0x901B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_swizzle b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_swizzle new file mode 100644 index 0000000..2d2884b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_texture_swizzle @@ -0,0 +1,8 @@ +GL_EXT_texture_swizzle +http://www.opengl.org/registry/specs/EXT/texture_swizzle.txt +GL_EXT_texture_swizzle + GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 + GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 + GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 + GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 + GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_timer_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_timer_query new file mode 100644 index 0000000..390e6fc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_timer_query @@ -0,0 +1,6 @@ +GL_EXT_timer_query +http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_timer_query.txt +GL_EXT_timer_query + GL_TIME_ELAPSED_EXT 0x88BF + void glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params) + void glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_transform_feedback b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_transform_feedback new file mode 100644 index 0000000..d15cf61 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_transform_feedback @@ -0,0 +1,25 @@ +GL_EXT_transform_feedback +http://www.opengl.org/registry/specs/EXT/transform_feedback.txt +GL_EXT_transform_feedback + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 + GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 + GL_PRIMITIVES_GENERATED_EXT 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 + GL_RASTERIZER_DISCARD_EXT 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B + GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C + GL_SEPARATE_ATTRIBS_EXT 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + void glBeginTransformFeedbackEXT (GLenum primitiveMode) + void glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer) + void glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glEndTransformFeedbackEXT (void) + void glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name) + void glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar ** varyings, GLenum bufferMode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array new file mode 100644 index 0000000..b61b38f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array @@ -0,0 +1,44 @@ +GL_EXT_vertex_array +http://www.opengl.org/registry/specs/EXT/vertex_array.txt +GL_EXT_vertex_array + GL_DOUBLE_EXT 0x140A + GL_VERTEX_ARRAY_EXT 0x8074 + GL_NORMAL_ARRAY_EXT 0x8075 + GL_COLOR_ARRAY_EXT 0x8076 + GL_INDEX_ARRAY_EXT 0x8077 + GL_TEXTURE_COORD_ARRAY_EXT 0x8078 + GL_EDGE_FLAG_ARRAY_EXT 0x8079 + GL_VERTEX_ARRAY_SIZE_EXT 0x807A + GL_VERTEX_ARRAY_TYPE_EXT 0x807B + GL_VERTEX_ARRAY_STRIDE_EXT 0x807C + GL_VERTEX_ARRAY_COUNT_EXT 0x807D + GL_NORMAL_ARRAY_TYPE_EXT 0x807E + GL_NORMAL_ARRAY_STRIDE_EXT 0x807F + GL_NORMAL_ARRAY_COUNT_EXT 0x8080 + GL_COLOR_ARRAY_SIZE_EXT 0x8081 + GL_COLOR_ARRAY_TYPE_EXT 0x8082 + GL_COLOR_ARRAY_STRIDE_EXT 0x8083 + GL_COLOR_ARRAY_COUNT_EXT 0x8084 + GL_INDEX_ARRAY_TYPE_EXT 0x8085 + GL_INDEX_ARRAY_STRIDE_EXT 0x8086 + GL_INDEX_ARRAY_COUNT_EXT 0x8087 + GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 + GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A + GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B + GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C + GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D + GL_VERTEX_ARRAY_POINTER_EXT 0x808E + GL_NORMAL_ARRAY_POINTER_EXT 0x808F + GL_COLOR_ARRAY_POINTER_EXT 0x8090 + GL_INDEX_ARRAY_POINTER_EXT 0x8091 + GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 + GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + void glArrayElementEXT (GLint i) + void glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer) + void glDrawArraysEXT (GLenum mode, GLint first, GLsizei count) + void glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean* pointer) + void glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void* pointer) + void glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void* pointer) + void glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer) + void glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array_bgra b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array_bgra new file mode 100644 index 0000000..ea2f99b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_array_bgra @@ -0,0 +1,4 @@ +GL_EXT_vertex_array_bgra +http://www.opengl.org/registry/specs/EXT/vertex_array_bgra.txt +GL_EXT_vertex_array_bgra + GL_BGRA 0x80E1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_attrib_64bit b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_attrib_64bit new file mode 100644 index 0000000..10626ef --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_attrib_64bit @@ -0,0 +1,26 @@ +GL_EXT_vertex_attrib_64bit +http://www.opengl.org/registry/specs/EXT/vertex_attrib_64bit.txt +GL_EXT_vertex_attrib_64bit + GL_DOUBLE_MAT2_EXT 0x8F46 + GL_DOUBLE_MAT3_EXT 0x8F47 + GL_DOUBLE_MAT4_EXT 0x8F48 + GL_DOUBLE_MAT2x3_EXT 0x8F49 + GL_DOUBLE_MAT2x4_EXT 0x8F4A + GL_DOUBLE_MAT3x2_EXT 0x8F4B + GL_DOUBLE_MAT3x4_EXT 0x8F4C + GL_DOUBLE_MAT4x2_EXT 0x8F4D + GL_DOUBLE_MAT4x3_EXT 0x8F4E + GL_DOUBLE_VEC2_EXT 0x8FFC + GL_DOUBLE_VEC3_EXT 0x8FFD + GL_DOUBLE_VEC4_EXT 0x8FFE + void glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble* params) + void glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset) + void glVertexAttribL1dEXT (GLuint index, GLdouble x) + void glVertexAttribL1dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y) + void glVertexAttribL2dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttribL3dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttribL4dvEXT (GLuint index, const GLdouble* v) + void glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_shader new file mode 100644 index 0000000..eb125b6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_shader @@ -0,0 +1,156 @@ +GL_EXT_vertex_shader +http://oss.sgi.com/projects/ogl-sample/registry/EXT/vertex_shader.txt +GL_EXT_vertex_shader + GL_VERTEX_SHADER_EXT 0x8780 + GL_VERTEX_SHADER_BINDING_EXT 0x8781 + GL_OP_INDEX_EXT 0x8782 + GL_OP_NEGATE_EXT 0x8783 + GL_OP_DOT3_EXT 0x8784 + GL_OP_DOT4_EXT 0x8785 + GL_OP_MUL_EXT 0x8786 + GL_OP_ADD_EXT 0x8787 + GL_OP_MADD_EXT 0x8788 + GL_OP_FRAC_EXT 0x8789 + GL_OP_MAX_EXT 0x878A + GL_OP_MIN_EXT 0x878B + GL_OP_SET_GE_EXT 0x878C + GL_OP_SET_LT_EXT 0x878D + GL_OP_CLAMP_EXT 0x878E + GL_OP_FLOOR_EXT 0x878F + GL_OP_ROUND_EXT 0x8790 + GL_OP_EXP_BASE_2_EXT 0x8791 + GL_OP_LOG_BASE_2_EXT 0x8792 + GL_OP_POWER_EXT 0x8793 + GL_OP_RECIP_EXT 0x8794 + GL_OP_RECIP_SQRT_EXT 0x8795 + GL_OP_SUB_EXT 0x8796 + GL_OP_CROSS_PRODUCT_EXT 0x8797 + GL_OP_MULTIPLY_MATRIX_EXT 0x8798 + GL_OP_MOV_EXT 0x8799 + GL_OUTPUT_VERTEX_EXT 0x879A + GL_OUTPUT_COLOR0_EXT 0x879B + GL_OUTPUT_COLOR1_EXT 0x879C + GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D + GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E + GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F + GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 + GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 + GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 + GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 + GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 + GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 + GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 + GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 + GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 + GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 + GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA + GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB + GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC + GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD + GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE + GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF + GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 + GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 + GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 + GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 + GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 + GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 + GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 + GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 + GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 + GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 + GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA + GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB + GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC + GL_OUTPUT_FOG_EXT 0x87BD + GL_SCALAR_EXT 0x87BE + GL_VECTOR_EXT 0x87BF + GL_MATRIX_EXT 0x87C0 + GL_VARIANT_EXT 0x87C1 + GL_INVARIANT_EXT 0x87C2 + GL_LOCAL_CONSTANT_EXT 0x87C3 + GL_LOCAL_EXT 0x87C4 + GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 + GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 + GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 + GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 + GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 + GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA + GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB + GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD + GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE + GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF + GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 + GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 + GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 + GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 + GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 + GL_X_EXT 0x87D5 + GL_Y_EXT 0x87D6 + GL_Z_EXT 0x87D7 + GL_W_EXT 0x87D8 + GL_NEGATIVE_X_EXT 0x87D9 + GL_NEGATIVE_Y_EXT 0x87DA + GL_NEGATIVE_Z_EXT 0x87DB + GL_NEGATIVE_W_EXT 0x87DC + GL_ZERO_EXT 0x87DD + GL_ONE_EXT 0x87DE + GL_NEGATIVE_ONE_EXT 0x87DF + GL_NORMALIZED_RANGE_EXT 0x87E0 + GL_FULL_RANGE_EXT 0x87E1 + GL_CURRENT_VERTEX_EXT 0x87E2 + GL_MVP_MATRIX_EXT 0x87E3 + GL_VARIANT_VALUE_EXT 0x87E4 + GL_VARIANT_DATATYPE_EXT 0x87E5 + GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 + GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 + GL_VARIANT_ARRAY_EXT 0x87E8 + GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 + GL_INVARIANT_VALUE_EXT 0x87EA + GL_INVARIANT_DATATYPE_EXT 0x87EB + GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC + GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + + void glBeginVertexShaderEXT (void) + void glEndVertexShaderEXT (void) + void glBindVertexShaderEXT (GLuint id) + GLuint glGenVertexShadersEXT (GLuint range) + void glDeleteVertexShaderEXT (GLuint id) + void glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1) + void glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2) + void glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3) + void glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW) + void glInsertComponentEXT (GLuint res, GLuint src, GLuint num) + void glExtractComponentEXT (GLuint res, GLuint src, GLuint num) + GLuint glGenSymbolsEXT (GLenum dataType, GLenum storageType, GLenum range, GLuint components) + void glSetInvariantEXT (GLuint id, GLenum type, GLvoid *addr) + void glSetLocalConstantEXT (GLuint id, GLenum type, GLvoid *addr) + void glVariantbvEXT (GLuint id, GLbyte *addr) + void glVariantsvEXT (GLuint id, GLshort *addr) + void glVariantivEXT (GLuint id, GLint *addr) + void glVariantfvEXT (GLuint id, GLfloat *addr) + void glVariantdvEXT (GLuint id, GLdouble *addr) + void glVariantubvEXT (GLuint id, GLubyte *addr) + void glVariantusvEXT (GLuint id, GLushort *addr) + void glVariantuivEXT (GLuint id, GLuint *addr) + void glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, GLvoid *addr) + void glEnableVariantClientStateEXT (GLuint id) + void glDisableVariantClientStateEXT (GLuint id) + GLuint glBindLightParameterEXT (GLenum light, GLenum value) + GLuint glBindMaterialParameterEXT (GLenum face, GLenum value) + GLuint glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value) + GLuint glBindTextureUnitParameterEXT (GLenum unit, GLenum value) + GLuint glBindParameterEXT (GLenum value) + GLboolean glIsVariantEnabledEXT (GLuint id, GLenum cap) + void glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid **data) + void glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data) + void glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data) + void glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data) + void glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_weighting b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_weighting new file mode 100644 index 0000000..7a5a0f0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_vertex_weighting @@ -0,0 +1,19 @@ +GL_EXT_vertex_weighting +http://www.opengl.org/registry/specs/EXT/vertex_weighting.txt +GL_EXT_vertex_weighting + GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 + GL_MODELVIEW0_MATRIX_EXT 0x0BA6 + GL_MODELVIEW0_EXT 0x1700 + GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 + GL_MODELVIEW1_MATRIX_EXT 0x8506 + GL_VERTEX_WEIGHTING_EXT 0x8509 + GL_MODELVIEW1_EXT 0x850A + GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B + GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C + GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D + GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E + GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F + GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + void glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, void* pointer) + void glVertexWeightfEXT (GLfloat weight) + void glVertexWeightfvEXT (GLfloat* weight) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_x11_sync_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_x11_sync_object new file mode 100644 index 0000000..fff826b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_EXT_x11_sync_object @@ -0,0 +1,5 @@ +GL_EXT_x11_sync_object +http://www.opengl.org/registry/specs/EXT/x11_sync_object.txt +GL_EXT_x11_sync_object + GL_SYNC_X11_FENCE_EXT 0x90E1 + GLsync glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_frame_terminator b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_frame_terminator new file mode 100644 index 0000000..2832f55 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_frame_terminator @@ -0,0 +1,4 @@ +GL_GREMEDY_frame_terminator +http://www.opengl.org/registry/specs/GREMEDY/frame_terminator.txt +GL_GREMEDY_frame_terminator + void glFrameTerminatorGREMEDY (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_string_marker b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_string_marker new file mode 100644 index 0000000..34f07f9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_GREMEDY_string_marker @@ -0,0 +1,4 @@ +GL_GREMEDY_string_marker +http://www.opengl.org/registry/specs/GREMEDY/string_marker.txt +GL_GREMEDY_string_marker + void glStringMarkerGREMEDY (GLsizei len, const void* string) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_convolution_border_modes b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_convolution_border_modes new file mode 100644 index 0000000..cfcdca0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_convolution_border_modes @@ -0,0 +1,3 @@ +GL_HP_convolution_border_modes +http://www.opengl.org/registry/specs/HP/convolution_border_modes.txt +GL_HP_convolution_border_modes diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_image_transform b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_image_transform new file mode 100644 index 0000000..c184239 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_image_transform @@ -0,0 +1,9 @@ +GL_HP_image_transform +http://www.opengl.org/registry/specs/HP/image_transform.txt +GL_HP_image_transform + void glGetImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat* params) + void glGetImageTransformParameterivHP (GLenum target, GLenum pname, const GLint* params) + void glImageTransformParameterfHP (GLenum target, GLenum pname, const GLfloat param) + void glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat* params) + void glImageTransformParameteriHP (GLenum target, GLenum pname, const GLint param) + void glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_occlusion_test b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_occlusion_test new file mode 100644 index 0000000..f3e091e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_occlusion_test @@ -0,0 +1,5 @@ +GL_HP_occlusion_test +http://www.opengl.org/registry/specs/HP/occlusion_test.txt +GL_HP_occlusion_test + GL_OCCLUSION_TEST_RESULT_HP 0x8166 + GL_OCCLUSION_TEST_HP 0x8165 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_texture_lighting b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_texture_lighting new file mode 100644 index 0000000..d5d3f73 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_HP_texture_lighting @@ -0,0 +1,3 @@ +GL_HP_texture_lighting +http://www.opengl.org/registry/specs/HP/texture_lighting.txt +GL_HP_texture_lighting diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_cull_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_cull_vertex new file mode 100644 index 0000000..1b9c4d2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_cull_vertex @@ -0,0 +1,4 @@ +GL_IBM_cull_vertex +http://www.opengl.org/registry/specs/IBM/cull_vertex.txt +GL_IBM_cull_vertex + GL_CULL_VERTEX_IBM 103050 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_multimode_draw_arrays b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_multimode_draw_arrays new file mode 100644 index 0000000..be45e8c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_multimode_draw_arrays @@ -0,0 +1,5 @@ +GL_IBM_multimode_draw_arrays +http://www.opengl.org/registry/specs/IBM/multimode_draw_arrays.txt +GL_IBM_multimode_draw_arrays + void glMultiModeDrawArraysIBM (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride) + void glMultiModeDrawElementsIBM (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_rasterpos_clip b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_rasterpos_clip new file mode 100644 index 0000000..b219297 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_rasterpos_clip @@ -0,0 +1,4 @@ +GL_IBM_rasterpos_clip +http://www.opengl.org/registry/specs/IBM/rasterpos_clip.txt +GL_IBM_rasterpos_clip + GL_RASTER_POSITION_UNCLIPPED_IBM 103010 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_static_data b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_static_data new file mode 100644 index 0000000..b31f7f9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_static_data @@ -0,0 +1,5 @@ +GL_IBM_static_data +http://www.opengl.org/registry/specs/IBM/static_data.txt +GL_IBM_static_data + GL_ALL_STATIC_DATA_IBM 103060 + GL_STATIC_VERTEX_ARRAY_IBM 103061 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_texture_mirrored_repeat b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_texture_mirrored_repeat new file mode 100644 index 0000000..bf41e8e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_texture_mirrored_repeat @@ -0,0 +1,4 @@ +GL_IBM_texture_mirrored_repeat +http://www.opengl.org/registry/specs/IBM/texture_mirrored_repeat.txt +GL_IBM_texture_mirrored_repeat + GL_MIRRORED_REPEAT_IBM 0x8370 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_vertex_array_lists b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_vertex_array_lists new file mode 100644 index 0000000..a03313c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_IBM_vertex_array_lists @@ -0,0 +1,27 @@ +GL_IBM_vertex_array_lists +http://www.opengl.org/registry/specs/IBM/vertex_array_lists.txt +GL_IBM_vertex_array_lists + GL_VERTEX_ARRAY_LIST_IBM 103070 + GL_NORMAL_ARRAY_LIST_IBM 103071 + GL_COLOR_ARRAY_LIST_IBM 103072 + GL_INDEX_ARRAY_LIST_IBM 103073 + GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 + GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 + GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 + GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 + GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 + GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 + GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 + GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 + GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 + GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 + GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 + GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + void glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glEdgeFlagPointerListIBM (GLint stride, const GLboolean ** pointer, GLint ptrstride) + void glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) + void glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_color_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_color_clamp new file mode 100644 index 0000000..15d27ef --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_color_clamp @@ -0,0 +1,11 @@ +GL_INGR_color_clamp +http://www.opengl.org/registry/specs/INGR/color_clamp.txt +GL_INGR_color_clamp + GL_RED_MIN_CLAMP_INGR 0x8560 + GL_GREEN_MIN_CLAMP_INGR 0x8561 + GL_BLUE_MIN_CLAMP_INGR 0x8562 + GL_ALPHA_MIN_CLAMP_INGR 0x8563 + GL_RED_MAX_CLAMP_INGR 0x8564 + GL_GREEN_MAX_CLAMP_INGR 0x8565 + GL_BLUE_MAX_CLAMP_INGR 0x8566 + GL_ALPHA_MAX_CLAMP_INGR 0x8567 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_interlace_read b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_interlace_read new file mode 100644 index 0000000..0523564 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INGR_interlace_read @@ -0,0 +1,4 @@ +GL_INGR_interlace_read +http://www.opengl.org/registry/specs/INGR/interlace_read.txt +GL_INGR_interlace_read + GL_INTERLACE_READ_INGR 0x8568 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_parallel_arrays b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_parallel_arrays new file mode 100644 index 0000000..925a619 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_parallel_arrays @@ -0,0 +1,12 @@ +GL_INTEL_parallel_arrays +http://www.opengl.org/registry/specs/INTEL/parallel_arrays.txt +GL_INTEL_parallel_arrays + GL_PARALLEL_ARRAYS_INTEL 0x83F4 + GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 + GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 + GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 + GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + void glColorPointervINTEL (GLint size, GLenum type, const void** pointer) + void glNormalPointervINTEL (GLenum type, const void** pointer) + void glTexCoordPointervINTEL (GLint size, GLenum type, const void** pointer) + void glVertexPointervINTEL (GLint size, GLenum type, const void** pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_texture_scissor b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_texture_scissor new file mode 100644 index 0000000..732944b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_INTEL_texture_scissor @@ -0,0 +1,5 @@ +GL_INTEL_texture_scissor +http://www.opengl.org/registry/specs/INTEL/texture_scissor.txt +GL_INTEL_texture_scissor + void glTexScissorFuncINTEL (GLenum target, GLenum lfunc, GLenum hfunc) + void glTexScissorINTEL (GLenum target, GLclampf tlow, GLclampf thigh) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_debug b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_debug new file mode 100644 index 0000000..cd0eb6c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_debug @@ -0,0 +1,54 @@ +GL_KHR_debug +http://www.opengl.org/registry/specs/KHR/debug.txt +GL_KHR_debug + GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 + GL_STACK_OVERFLOW 0x0503 + GL_STACK_UNDERFLOW 0x0504 + GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 + GL_DEBUG_CALLBACK_FUNCTION 0x8244 + GL_DEBUG_CALLBACK_USER_PARAM 0x8245 + GL_DEBUG_SOURCE_API 0x8246 + GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 + GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 + GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 + GL_DEBUG_SOURCE_APPLICATION 0x824A + GL_DEBUG_SOURCE_OTHER 0x824B + GL_DEBUG_TYPE_ERROR 0x824C + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E + GL_DEBUG_TYPE_PORTABILITY 0x824F + GL_DEBUG_TYPE_PERFORMANCE 0x8250 + GL_DEBUG_TYPE_OTHER 0x8251 + GL_DEBUG_TYPE_MARKER 0x8268 + GL_DEBUG_TYPE_PUSH_GROUP 0x8269 + GL_DEBUG_TYPE_POP_GROUP 0x826A + GL_DEBUG_SEVERITY_NOTIFICATION 0x826B + GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C + GL_DEBUG_GROUP_STACK_DEPTH 0x826D + GL_BUFFER 0x82E0 + GL_SHADER 0x82E1 + GL_PROGRAM 0x82E2 + GL_QUERY 0x82E3 + GL_PROGRAM_PIPELINE 0x82E4 + GL_SAMPLER 0x82E6 + GL_DISPLAY_LIST 0x82E7 + GL_MAX_LABEL_LENGTH 0x82E8 + GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 + GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 + GL_DEBUG_LOGGED_MESSAGES 0x9145 + GL_DEBUG_SEVERITY_HIGH 0x9146 + GL_DEBUG_SEVERITY_MEDIUM 0x9147 + GL_DEBUG_SEVERITY_LOW 0x9148 + GL_DEBUG_OUTPUT 0x92E0 + void glDebugMessageCallback (GLDEBUGPROC callback, void* userParam) + void glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled) + void glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) + GLuint glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog) + void glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label) + void glGetObjectPtrLabel (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label) + void glGetPointerv (GLenum pname, void** params) + void glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar* label) + void glObjectPtrLabel (void* ptr, GLsizei length, const GLchar* label) + void glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar * message) + typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_texture_compression_astc_ldr b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_texture_compression_astc_ldr new file mode 100644 index 0000000..f6fbaaf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KHR_texture_compression_astc_ldr @@ -0,0 +1,31 @@ +GL_KHR_texture_compression_astc_ldr +http://www.opengl.org/registry/specs/KHR/texture_compression_astc_ldr.txt +GL_KHR_texture_compression_astc_ldr + GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 + GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 + GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 + GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 + GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 + GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 + GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 + GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 + GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 + GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 + GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA + GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB + GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC + GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KTX_buffer_region b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KTX_buffer_region new file mode 100644 index 0000000..adc6c6f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_KTX_buffer_region @@ -0,0 +1,12 @@ +GL_KTX_buffer_region + +GL_KTX_buffer_region + GL_KTX_FRONT_REGION 0x0 + GL_KTX_BACK_REGION 0x1 + GL_KTX_Z_REGION 0x2 + GL_KTX_STENCIL_REGION 0x3 + GLuint glBufferRegionEnabled (void) + GLuint glNewBufferRegion (GLenum region) + void glDeleteBufferRegion (GLenum region) + void glReadBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height) + void glDrawBufferRegion (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESAX_texture_stack b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESAX_texture_stack new file mode 100644 index 0000000..1e7c58d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESAX_texture_stack @@ -0,0 +1,9 @@ +GL_MESAX_texture_stack +http://www.opengl.org/registry/specs/MESAX/texture_stack.txt +GL_MESAX_texture_stack + GL_TEXTURE_1D_STACK_MESAX 0x8759 + GL_TEXTURE_2D_STACK_MESAX 0x875A + GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B + GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C + GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D + GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_pack_invert b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_pack_invert new file mode 100644 index 0000000..dca9c64 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_pack_invert @@ -0,0 +1,4 @@ +GL_MESA_pack_invert +http://www.opengl.org/registry/specs/MESA/pack_invert.txt +GL_MESA_pack_invert + GL_PACK_INVERT_MESA 0x8758 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_resize_buffers b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_resize_buffers new file mode 100644 index 0000000..39649bd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_resize_buffers @@ -0,0 +1,4 @@ +GL_MESA_resize_buffers +http://www.opengl.org/registry/specs/MESA/resize_buffers.txt +GL_MESA_resize_buffers + void glResizeBuffersMESA (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_window_pos b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_window_pos new file mode 100644 index 0000000..290c52c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_window_pos @@ -0,0 +1,27 @@ +GL_MESA_window_pos +http://www.opengl.org/registry/specs/MESA/window_pos.txt +GL_MESA_window_pos + void glWindowPos2dMESA (GLdouble x, GLdouble y) + void glWindowPos2dvMESA (const GLdouble* p) + void glWindowPos2fMESA (GLfloat x, GLfloat y) + void glWindowPos2fvMESA (const GLfloat* p) + void glWindowPos2iMESA (GLint x, GLint y) + void glWindowPos2ivMESA (const GLint* p) + void glWindowPos2sMESA (GLshort x, GLshort y) + void glWindowPos2svMESA (const GLshort* p) + void glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z) + void glWindowPos3dvMESA (const GLdouble* p) + void glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z) + void glWindowPos3fvMESA (const GLfloat* p) + void glWindowPos3iMESA (GLint x, GLint y, GLint z) + void glWindowPos3ivMESA (const GLint* p) + void glWindowPos3sMESA (GLshort x, GLshort y, GLshort z) + void glWindowPos3svMESA (const GLshort* p) + void glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble) + void glWindowPos4dvMESA (const GLdouble* p) + void glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glWindowPos4fvMESA (const GLfloat* p) + void glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w) + void glWindowPos4ivMESA (const GLint* p) + void glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w) + void glWindowPos4svMESA (const GLshort* p) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_ycbcr_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_ycbcr_texture new file mode 100644 index 0000000..f26d387 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_MESA_ycbcr_texture @@ -0,0 +1,6 @@ +GL_MESA_ycbcr_texture +http://www.opengl.org/registry/specs/MESA/ycbcr_texture.txt +GL_MESA_ycbcr_texture + GL_UNSIGNED_SHORT_8_8_MESA 0x85BA + GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB + GL_YCBCR_MESA 0x8757 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NVX_gpu_memory_info b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NVX_gpu_memory_info new file mode 100644 index 0000000..6dd7bdd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NVX_gpu_memory_info @@ -0,0 +1,8 @@ +GL_NVX_gpu_memory_info +http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt +GL_NVX_gpu_memory_info + GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 + GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 + GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 + GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A + GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_bindless_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_bindless_texture new file mode 100644 index 0000000..5f1b6df --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_bindless_texture @@ -0,0 +1,16 @@ +GL_NV_bindless_texture +http://www.opengl.org/registry/specs/NV/bindless_texture.txt +GL_NV_bindless_texture + GLuint64 glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format) + GLuint64 glGetTextureHandleNV (GLuint texture) + GLuint64 glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler) + GLboolean glIsImageHandleResidentNV (GLuint64 handle) + GLboolean glIsTextureHandleResidentNV (GLuint64 handle) + void glMakeImageHandleNonResidentNV (GLuint64 handle) + void glMakeImageHandleResidentNV (GLuint64 handle, GLenum access) + void glMakeTextureHandleNonResidentNV (GLuint64 handle) + void glMakeTextureHandleResidentNV (GLuint64 handle) + void glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value) + void glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64* values) + void glUniformHandleui64NV (GLint location, GLuint64 value) + void glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64* value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_blend_square b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_blend_square new file mode 100644 index 0000000..8aafdcc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_blend_square @@ -0,0 +1,3 @@ +GL_NV_blend_square +http://www.opengl.org/registry/specs/NV/blend_square.txt +GL_NV_blend_square diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_conditional_render b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_conditional_render new file mode 100644 index 0000000..f22d1af --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_conditional_render @@ -0,0 +1,9 @@ +GL_NV_conditional_render +http://www.opengl.org/registry/specs/NV/conditional_render.txt +GL_NV_conditional_render + GL_QUERY_WAIT_NV 0x8E13 + GL_QUERY_NO_WAIT_NV 0x8E14 + GL_QUERY_BY_REGION_WAIT_NV 0x8E15 + GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + void glBeginConditionalRenderNV (GLuint id, GLenum mode) + void glEndConditionalRenderNV (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_depth_to_color b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_depth_to_color new file mode 100644 index 0000000..7d48642 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_depth_to_color @@ -0,0 +1,5 @@ +GL_NV_copy_depth_to_color +http://www.opengl.org/registry/specs/NV/copy_depth_to_color.txt +GL_NV_copy_depth_to_color + GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E + GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_image b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_image new file mode 100644 index 0000000..0cf53fd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_copy_image @@ -0,0 +1,4 @@ +GL_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +GL_NV_copy_image + void glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_buffer_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_buffer_float new file mode 100644 index 0000000..493b245 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_buffer_float @@ -0,0 +1,10 @@ +GL_NV_depth_buffer_float +http://developer.download.nvidia.com/opengl/specs/GL_NV_depth_buffer_float.txt +GL_NV_depth_buffer_float + GL_DEPTH_COMPONENT32F_NV 0x8DAB + GL_DEPTH32F_STENCIL8_NV 0x8DAC + GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD + GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + void glDepthRangedNV (GLdouble zNear, GLdouble zFar) + void glClearDepthdNV (GLdouble depth) + void glDepthBoundsdNV (GLdouble zmin, GLdouble zmax) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_clamp new file mode 100644 index 0000000..561a0c5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_clamp @@ -0,0 +1,4 @@ +GL_NV_depth_clamp +http://www.opengl.org/registry/specs/NV/depth_clamp.txt +GL_NV_depth_clamp + GL_DEPTH_CLAMP_NV 0x864F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_range_unclamped b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_range_unclamped new file mode 100644 index 0000000..62b4e59 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_depth_range_unclamped @@ -0,0 +1,8 @@ +GL_NV_depth_range_unclamped + +GL_NV_depth_range_unclamped + GL_SAMPLE_COUNT_BITS_NV 0x8864 + GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 + GL_QUERY_RESULT_NV 0x8866 + GL_QUERY_RESULT_AVAILABLE_NV 0x8867 + GL_SAMPLE_COUNT_NV 0x8914 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_evaluators b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_evaluators new file mode 100644 index 0000000..531ea7f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_evaluators @@ -0,0 +1,36 @@ +GL_NV_evaluators +http://www.opengl.org/registry/specs/NV/evaluators.txt +GL_NV_evaluators + GL_EVAL_2D_NV 0x86C0 + GL_EVAL_TRIANGULAR_2D_NV 0x86C1 + GL_MAP_TESSELLATION_NV 0x86C2 + GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 + GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 + GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 + GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 + GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 + GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 + GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 + GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA + GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB + GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC + GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD + GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE + GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF + GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 + GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 + GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 + GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 + GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 + GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 + GL_MAX_MAP_TESSELLATION_NV 0x86D6 + GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + void glEvalMapsNV (GLenum target, GLenum mode) + void glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat* params) + void glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint* params) + void glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points) + void glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat* params) + void glGetMapParameterivNV (GLenum target, GLenum pname, GLint* params) + void glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points) + void glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat* params) + void glMapParameterivNV (GLenum target, GLenum pname, const GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_explicit_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_explicit_multisample new file mode 100644 index 0000000..0b87a17 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_explicit_multisample @@ -0,0 +1,16 @@ +GL_NV_explicit_multisample +http://www.opengl.org/registry/specs/NV/explicit_multisample.txt +GL_NV_explicit_multisample + GL_SAMPLE_POSITION_NV 0x8E50 + GL_SAMPLE_MASK_NV 0x8E51 + GL_SAMPLE_MASK_VALUE_NV 0x8E52 + GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 + GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 + GL_TEXTURE_RENDERBUFFER_NV 0x8E55 + GL_SAMPLER_RENDERBUFFER_NV 0x8E56 + GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 + GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 + GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + void glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat* val) + void glSampleMaskIndexedNV (GLuint index, GLbitfield mask) + void glTexRenderbufferNV (GLenum target, GLuint renderbuffer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fence b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fence new file mode 100644 index 0000000..e59833f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fence @@ -0,0 +1,13 @@ +GL_NV_fence +http://www.opengl.org/registry/specs/NV/fence.txt +GL_NV_fence + GL_ALL_COMPLETED_NV 0x84F2 + GL_FENCE_STATUS_NV 0x84F3 + GL_FENCE_CONDITION_NV 0x84F4 + void glDeleteFencesNV (GLsizei n, const GLuint* fences) + void glFinishFenceNV (GLuint fence) + void glGenFencesNV (GLsizei n, GLuint* fences) + void glGetFenceivNV (GLuint fence, GLenum pname, GLint* params) + GLboolean glIsFenceNV (GLuint fence) + void glSetFenceNV (GLuint fence, GLenum condition) + GLboolean glTestFenceNV (GLuint fence) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_float_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_float_buffer new file mode 100644 index 0000000..f44ae43 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_float_buffer @@ -0,0 +1,18 @@ +GL_NV_float_buffer +http://www.opengl.org/registry/specs/NV/float_buffer.txt +GL_NV_float_buffer + GL_FLOAT_R_NV 0x8880 + GL_FLOAT_RG_NV 0x8881 + GL_FLOAT_RGB_NV 0x8882 + GL_FLOAT_RGBA_NV 0x8883 + GL_FLOAT_R16_NV 0x8884 + GL_FLOAT_R32_NV 0x8885 + GL_FLOAT_RG16_NV 0x8886 + GL_FLOAT_RG32_NV 0x8887 + GL_FLOAT_RGB16_NV 0x8888 + GL_FLOAT_RGB32_NV 0x8889 + GL_FLOAT_RGBA16_NV 0x888A + GL_FLOAT_RGBA32_NV 0x888B + GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C + GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D + GL_FLOAT_RGBA_MODE_NV 0x888E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fog_distance b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fog_distance new file mode 100644 index 0000000..9cee59b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fog_distance @@ -0,0 +1,6 @@ +GL_NV_fog_distance +http://www.opengl.org/registry/specs/NV/fog_distance.txt +GL_NV_fog_distance + GL_FOG_DISTANCE_MODE_NV 0x855A + GL_EYE_RADIAL_NV 0x855B + GL_EYE_PLANE_ABSOLUTE_NV 0x855C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program new file mode 100644 index 0000000..298808c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program @@ -0,0 +1,15 @@ +GL_NV_fragment_program +http://www.opengl.org/registry/specs/NV/fragment_program.txt +GL_NV_fragment_program + GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 + GL_FRAGMENT_PROGRAM_NV 0x8870 + GL_MAX_TEXTURE_COORDS_NV 0x8871 + GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 + GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 + GL_PROGRAM_ERROR_STRING_NV 0x8874 + void glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params) + void glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params) + void glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]) + void glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program2 new file mode 100644 index 0000000..7fb59ee --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program2 @@ -0,0 +1,8 @@ +GL_NV_fragment_program2 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program2.txt +GL_NV_fragment_program2 + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 + GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 + GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program4 new file mode 100644 index 0000000..0ae2598 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program4 @@ -0,0 +1,3 @@ +GL_NV_fragment_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_fragment_program4.txt +GL_NV_gpu_program4 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program_option b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program_option new file mode 100644 index 0000000..7af9731 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_fragment_program_option @@ -0,0 +1,3 @@ +GL_NV_fragment_program_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt +GL_NV_fragment_program_option diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_framebuffer_multisample_coverage b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_framebuffer_multisample_coverage new file mode 100644 index 0000000..d1d0660 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_framebuffer_multisample_coverage @@ -0,0 +1,8 @@ +GL_NV_framebuffer_multisample_coverage +http://developer.download.nvidia.com/opengl/specs/GL_NV_framebuffer_multisample_coverage.txt +GL_NV_framebuffer_multisample_coverage + GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB + GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 + GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 + GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + void glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_program4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_program4 new file mode 100644 index 0000000..3f82b19 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_program4 @@ -0,0 +1,7 @@ +GL_NV_geometry_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_program4.txt +GL_NV_gpu_program4 + GL_GEOMETRY_PROGRAM_NV 0x8C26 + GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 + GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + void glProgramVertexLimitNV (GLenum target, GLint limit) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_shader4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_shader4 new file mode 100644 index 0000000..2040c0d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_geometry_shader4 @@ -0,0 +1,3 @@ +GL_NV_geometry_shader4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_geometry_shader4.txt +GL_NV_geometry_shader4 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program4 new file mode 100644 index 0000000..030f68e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program4 @@ -0,0 +1,23 @@ +GL_NV_gpu_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_gpu_program4.txt +GL_NV_gpu_program4 + GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 + GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 + GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 + GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 + GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 + GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 + GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 + GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + void glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) + void glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w) + void glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params) + void glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params) + void glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) + void glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params) + void glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program5 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program5 new file mode 100644 index 0000000..18bb28f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program5 @@ -0,0 +1,9 @@ +GL_NV_gpu_program5 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program5 + GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C + GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program_fp64 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program_fp64 new file mode 100644 index 0000000..b710ca5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_program_fp64 @@ -0,0 +1,3 @@ +GL_NV_gpu_program_fp64 +http://www.opengl.org/registry/specs/NV/gpu_program5.txt +GL_NV_gpu_program_fp64 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_shader5 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_shader5 new file mode 100644 index 0000000..705286e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_gpu_shader5 @@ -0,0 +1,65 @@ +GL_NV_gpu_shader5 +http://www.opengl.org/registry/specs/NV/gpu_shader5.txt +GL_NV_gpu_shader5 + GL_INT64_NV 0x140E + GL_UNSIGNED_INT64_NV 0x140F + GL_INT8_NV 0x8FE0 + GL_INT8_VEC2_NV 0x8FE1 + GL_INT8_VEC3_NV 0x8FE2 + GL_INT8_VEC4_NV 0x8FE3 + GL_INT16_NV 0x8FE4 + GL_INT16_VEC2_NV 0x8FE5 + GL_INT16_VEC3_NV 0x8FE6 + GL_INT16_VEC4_NV 0x8FE7 + GL_INT64_VEC2_NV 0x8FE9 + GL_INT64_VEC3_NV 0x8FEA + GL_INT64_VEC4_NV 0x8FEB + GL_UNSIGNED_INT8_NV 0x8FEC + GL_UNSIGNED_INT8_VEC2_NV 0x8FED + GL_UNSIGNED_INT8_VEC3_NV 0x8FEE + GL_UNSIGNED_INT8_VEC4_NV 0x8FEF + GL_UNSIGNED_INT16_NV 0x8FF0 + GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 + GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 + GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 + GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 + GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 + GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 + GL_FLOAT16_NV 0x8FF8 + GL_FLOAT16_VEC2_NV 0x8FF9 + GL_FLOAT16_VEC3_NV 0x8FFA + GL_FLOAT16_VEC4_NV 0x8FFB + void glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT* params) + void glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT* params) + void glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x) + void glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x) + void glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y) + void glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y) + void glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT* value) + void glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform1i64NV (GLint location, GLint64EXT x) + void glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform1ui64NV (GLint location, GLuint64EXT x) + void glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y) + void glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y) + void glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) + void glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT* value) + void glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_half_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_half_float new file mode 100644 index 0000000..ca309e9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_half_float @@ -0,0 +1,51 @@ +GL_NV_half_float +http://www.opengl.org/registry/specs/NV/half_float.txt +GL_NV_half_float + GL_HALF_FLOAT_NV 0x140B + void glColor3hNV (GLhalf red, GLhalf green, GLhalf blue) + void glColor3hvNV (const GLhalf* v) + void glColor4hNV (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha) + void glColor4hvNV (const GLhalf* v) + void glFogCoordhNV (GLhalf fog) + void glFogCoordhvNV (const GLhalf* fog) + void glMultiTexCoord1hNV (GLenum target, GLhalf s) + void glMultiTexCoord1hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord2hNV (GLenum target, GLhalf s, GLhalf t) + void glMultiTexCoord2hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord3hNV (GLenum target, GLhalf s, GLhalf t, GLhalf r) + void glMultiTexCoord3hvNV (GLenum target, const GLhalf* v) + void glMultiTexCoord4hNV (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q) + void glMultiTexCoord4hvNV (GLenum target, const GLhalf* v) + void glNormal3hNV (GLhalf nx, GLhalf ny, GLhalf nz) + void glNormal3hvNV (const GLhalf* v) + void glSecondaryColor3hNV (GLhalf red, GLhalf green, GLhalf blue) + void glSecondaryColor3hvNV (const GLhalf* v) + void glTexCoord1hNV (GLhalf s) + void glTexCoord1hvNV (const GLhalf* v) + void glTexCoord2hNV (GLhalf s, GLhalf t) + void glTexCoord2hvNV (const GLhalf* v) + void glTexCoord3hNV (GLhalf s, GLhalf t, GLhalf r) + void glTexCoord3hvNV (const GLhalf* v) + void glTexCoord4hNV (GLhalf s, GLhalf t, GLhalf r, GLhalf q) + void glTexCoord4hvNV (const GLhalf* v) + void glVertex2hNV (GLhalf x, GLhalf y) + void glVertex2hvNV (const GLhalf* v) + void glVertex3hNV (GLhalf x, GLhalf y, GLhalf z) + void glVertex3hvNV (const GLhalf* v) + void glVertex4hNV (GLhalf x, GLhalf y, GLhalf z, GLhalf w) + void glVertex4hvNV (const GLhalf* v) + void glVertexAttrib1hNV (GLuint index, GLhalf x) + void glVertexAttrib1hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib2hNV (GLuint index, GLhalf x, GLhalf y) + void glVertexAttrib2hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib3hNV (GLuint index, GLhalf x, GLhalf y, GLhalf z) + void glVertexAttrib3hvNV (GLuint index, const GLhalf* v) + void glVertexAttrib4hNV (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w) + void glVertexAttrib4hvNV (GLuint index, const GLhalf* v) + void glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalf* v) + void glVertexWeighthNV (GLhalf weight) + void glVertexWeighthvNV (const GLhalf* weight) + typedef unsigned short GLhalf diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_light_max_exponent b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_light_max_exponent new file mode 100644 index 0000000..cacd6a2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_light_max_exponent @@ -0,0 +1,5 @@ +GL_NV_light_max_exponent +http://www.opengl.org/registry/specs/NV/light_max_exponent.txt +GL_NV_light_max_exponent + GL_MAX_SHININESS_NV 0x8504 + GL_MAX_SPOT_EXPONENT_NV 0x8505 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_coverage b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_coverage new file mode 100644 index 0000000..34e762f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_coverage @@ -0,0 +1,5 @@ +GL_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +GL_NV_multisample_coverage + GL_COVERAGE_SAMPLES_NV 0x80A9 + GL_COLOR_SAMPLES_NV 0x8E20 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_filter_hint b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_filter_hint new file mode 100644 index 0000000..cad0240 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_multisample_filter_hint @@ -0,0 +1,4 @@ +GL_NV_multisample_filter_hint +http://www.opengl.org/registry/specs/NV/multisample_filter_hint.txt +GL_NV_multisample_filter_hint + GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_occlusion_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_occlusion_query new file mode 100644 index 0000000..b3b1a14 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_occlusion_query @@ -0,0 +1,14 @@ +GL_NV_occlusion_query +http://www.opengl.org/registry/specs/NV/occlusion_query.txt +GL_NV_occlusion_query + GL_PIXEL_COUNTER_BITS_NV 0x8864 + GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 + GL_PIXEL_COUNT_NV 0x8866 + GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + void glBeginOcclusionQueryNV (GLuint id) + void glDeleteOcclusionQueriesNV (GLsizei n, const GLuint* ids) + void glEndOcclusionQueryNV (void) + void glGenOcclusionQueriesNV (GLsizei n, GLuint* ids) + void glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint* params) + void glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint* params) + GLboolean glIsOcclusionQueryNV (GLuint id) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_packed_depth_stencil b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_packed_depth_stencil new file mode 100644 index 0000000..e0de7ab --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_packed_depth_stencil @@ -0,0 +1,5 @@ +GL_NV_packed_depth_stencil +http://www.opengl.org/registry/specs/NV/packed_depth_stencil.txt +GL_NV_packed_depth_stencil + GL_DEPTH_STENCIL_NV 0x84F9 + GL_UNSIGNED_INT_24_8_NV 0x84FA diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object new file mode 100644 index 0000000..d2525a1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object @@ -0,0 +1,11 @@ +GL_NV_parameter_buffer_object +http://developer.download.nvidia.com/opengl/specs/GL_NV_parameter_buffer_object.txt +GL_NV_parameter_buffer_object + GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 + GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 + GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 + GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 + void glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params) + void glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params) + void glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object2 new file mode 100644 index 0000000..d281d02 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_parameter_buffer_object2 @@ -0,0 +1,3 @@ +GL_NV_parameter_buffer_object2 +http://www.opengl.org/registry/specs/NV/parameter_buffer_object2.txt +GL_NV_parameter_buffer_object2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_path_rendering b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_path_rendering new file mode 100644 index 0000000..a3239b4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_path_rendering @@ -0,0 +1,182 @@ +GL_NV_path_rendering +http://www.opengl.org/registry/specs/NV/path_rendering.txt +GL_NV_path_rendering + GL_CLOSE_PATH_NV 0x00 + GL_BOLD_BIT_NV 0x01 + GL_GLYPH_WIDTH_BIT_NV 0x01 + GL_GLYPH_HEIGHT_BIT_NV 0x02 + GL_ITALIC_BIT_NV 0x02 + GL_MOVE_TO_NV 0x02 + GL_RELATIVE_MOVE_TO_NV 0x03 + GL_LINE_TO_NV 0x04 + GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 + GL_RELATIVE_LINE_TO_NV 0x05 + GL_HORIZONTAL_LINE_TO_NV 0x06 + GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 + GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 + GL_VERTICAL_LINE_TO_NV 0x08 + GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 + GL_QUADRATIC_CURVE_TO_NV 0x0A + GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B + GL_CUBIC_CURVE_TO_NV 0x0C + GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D + GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E + GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F + GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 + GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 + GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 + GL_SMALL_CCW_ARC_TO_NV 0x12 + GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 + GL_SMALL_CW_ARC_TO_NV 0x14 + GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 + GL_LARGE_CCW_ARC_TO_NV 0x16 + GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 + GL_LARGE_CW_ARC_TO_NV 0x18 + GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 + GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 + GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 + GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 + GL_RESTART_PATH_NV 0xF0 + GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 + GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 + GL_RECT_NV 0xF6 + GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 + GL_CIRCULAR_CW_ARC_TO_NV 0xFA + GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC + GL_ARC_TO_NV 0xFE + GL_RELATIVE_ARC_TO_NV 0xFF + GL_GLYPH_HAS_KERNING_BIT_NV 0x100 + GL_PRIMARY_COLOR_NV 0x852C + GL_SECONDARY_COLOR_NV 0x852D + GL_PRIMARY_COLOR 0x8577 + GL_PATH_FORMAT_SVG_NV 0x9070 + GL_PATH_FORMAT_PS_NV 0x9071 + GL_STANDARD_FONT_NAME_NV 0x9072 + GL_SYSTEM_FONT_NAME_NV 0x9073 + GL_FILE_NAME_NV 0x9074 + GL_PATH_STROKE_WIDTH_NV 0x9075 + GL_PATH_END_CAPS_NV 0x9076 + GL_PATH_INITIAL_END_CAP_NV 0x9077 + GL_PATH_TERMINAL_END_CAP_NV 0x9078 + GL_PATH_JOIN_STYLE_NV 0x9079 + GL_PATH_MITER_LIMIT_NV 0x907A + GL_PATH_DASH_CAPS_NV 0x907B + GL_PATH_INITIAL_DASH_CAP_NV 0x907C + GL_PATH_TERMINAL_DASH_CAP_NV 0x907D + GL_PATH_DASH_OFFSET_NV 0x907E + GL_PATH_CLIENT_LENGTH_NV 0x907F + GL_PATH_FILL_MODE_NV 0x9080 + GL_PATH_FILL_MASK_NV 0x9081 + GL_PATH_FILL_COVER_MODE_NV 0x9082 + GL_PATH_STROKE_COVER_MODE_NV 0x9083 + GL_PATH_STROKE_MASK_NV 0x9084 + GL_COUNT_UP_NV 0x9088 + GL_COUNT_DOWN_NV 0x9089 + GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A + GL_CONVEX_HULL_NV 0x908B + GL_BOUNDING_BOX_NV 0x908D + GL_TRANSLATE_X_NV 0x908E + GL_TRANSLATE_Y_NV 0x908F + GL_TRANSLATE_2D_NV 0x9090 + GL_TRANSLATE_3D_NV 0x9091 + GL_AFFINE_2D_NV 0x9092 + GL_AFFINE_3D_NV 0x9094 + GL_TRANSPOSE_AFFINE_2D_NV 0x9096 + GL_TRANSPOSE_AFFINE_3D_NV 0x9098 + GL_UTF8_NV 0x909A + GL_UTF16_NV 0x909B + GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C + GL_PATH_COMMAND_COUNT_NV 0x909D + GL_PATH_COORD_COUNT_NV 0x909E + GL_PATH_DASH_ARRAY_COUNT_NV 0x909F + GL_PATH_COMPUTED_LENGTH_NV 0x90A0 + GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 + GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 + GL_SQUARE_NV 0x90A3 + GL_ROUND_NV 0x90A4 + GL_TRIANGULAR_NV 0x90A5 + GL_BEVEL_NV 0x90A6 + GL_MITER_REVERT_NV 0x90A7 + GL_MITER_TRUNCATE_NV 0x90A8 + GL_SKIP_MISSING_GLYPH_NV 0x90A9 + GL_USE_MISSING_GLYPH_NV 0x90AA + GL_PATH_ERROR_POSITION_NV 0x90AB + GL_PATH_FOG_GEN_MODE_NV 0x90AC + GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD + GL_ADJACENT_PAIRS_NV 0x90AE + GL_FIRST_TO_REST_NV 0x90AF + GL_PATH_GEN_MODE_NV 0x90B0 + GL_PATH_GEN_COEFF_NV 0x90B1 + GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 + GL_PATH_GEN_COMPONENTS_NV 0x90B3 + GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 + GL_MOVE_TO_RESETS_NV 0x90B5 + GL_MOVE_TO_CONTINUES_NV 0x90B6 + GL_PATH_STENCIL_FUNC_NV 0x90B7 + GL_PATH_STENCIL_REF_NV 0x90B8 + GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 + GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD + GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE + GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF + GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 + GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 + GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 + GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 + GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 + GL_FONT_ASCENDER_BIT_NV 0x00200000 + GL_FONT_DESCENDER_BIT_NV 0x00400000 + GL_FONT_HEIGHT_BIT_NV 0x00800000 + GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 + GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 + GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 + GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 + GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + void glCopyPathNV (GLuint resultPath, GLuint srcPath) + void glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverFillPathNV (GLuint path, GLenum coverMode) + void glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues) + void glCoverStrokePathNV (GLuint name, GLenum coverMode) + void glDeletePathsNV (GLuint path, GLsizei range) + GLuint glGenPathsNV (GLsizei range) + void glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat* value) + void glGetPathColorGenivNV (GLenum color, GLenum pname, GLint* value) + void glGetPathCommandsNV (GLuint name, GLubyte* commands) + void glGetPathCoordsNV (GLuint name, GLfloat* coords) + void glGetPathDashArrayNV (GLuint name, GLfloat* dashArray) + GLfloat glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments) + void glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics) + void glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics) + void glGetPathParameterfvNV (GLuint name, GLenum param, GLfloat* value) + void glGetPathParameterivNV (GLuint name, GLenum param, GLint* value) + void glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing) + void glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat* value) + void glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint* value) + void glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight) + GLboolean glIsPathNV (GLuint path) + GLboolean glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y) + GLboolean glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y) + void glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs) + void glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords) + void glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords) + void glPathCoverDepthFuncNV (GLenum zfunc) + void glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat* dashArray) + void glPathFogGenNV (GLenum genMode) + void glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale) + void glPathParameterfNV (GLuint path, GLenum pname, GLfloat value) + void glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat* value) + void glPathParameteriNV (GLuint path, GLenum pname, GLint value) + void glPathParameterivNV (GLuint path, GLenum pname, const GLint* value) + void glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units) + void glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask) + void glPathStringNV (GLuint path, GLenum format, GLsizei length, const void* pathString) + void glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords) + void glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords) + void glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs) + GLboolean glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY) + void glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask) + void glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues) + void glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask) + void glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues) + void glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_pixel_data_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_pixel_data_range new file mode 100644 index 0000000..dd18c9c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_pixel_data_range @@ -0,0 +1,11 @@ +GL_NV_pixel_data_range +http://www.opengl.org/registry/specs/NV/pixel_data_range.txt +GL_NV_pixel_data_range + GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 + GL_READ_PIXEL_DATA_RANGE_NV 0x8879 + GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A + GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B + GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C + GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + void glFlushPixelDataRangeNV (GLenum target) + void glPixelDataRangeNV (GLenum target, GLsizei length, void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_point_sprite b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_point_sprite new file mode 100644 index 0000000..cb79d31 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_point_sprite @@ -0,0 +1,8 @@ +GL_NV_point_sprite +http://www.opengl.org/registry/specs/NV/point_sprite.txt +GL_NV_point_sprite + GL_POINT_SPRITE_NV 0x8861 + GL_COORD_REPLACE_NV 0x8862 + GL_POINT_SPRITE_R_MODE_NV 0x8863 + void glPointParameteriNV (GLenum pname, GLint param) + void glPointParameterivNV (GLenum pname, const GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_present_video b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_present_video new file mode 100644 index 0000000..893c74c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_present_video @@ -0,0 +1,15 @@ +GL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +GL_NV_present_video + GL_FRAME_NV 0x8E26 + GL_FIELDS_NV 0x8E27 + GL_CURRENT_TIME_NV 0x8E28 + GL_NUM_FILL_STREAMS_NV 0x8E29 + GL_PRESENT_TIME_NV 0x8E2A + GL_PRESENT_DURATION_NV 0x8E2B + void glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT* params) + void glGetVideoivNV (GLuint video_slot, GLenum pname, GLint* params) + void glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT* params) + void glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint* params) + void glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3) + void glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_primitive_restart b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_primitive_restart new file mode 100644 index 0000000..ebd1f7a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_primitive_restart @@ -0,0 +1,7 @@ +GL_NV_primitive_restart +http://www.opengl.org/registry/specs/NV/primitive_restart.txt +GL_NV_primitive_restart + GL_PRIMITIVE_RESTART_NV 0x8558 + GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + void glPrimitiveRestartIndexNV (GLuint index) + void glPrimitiveRestartNV (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners new file mode 100644 index 0000000..e9255ab --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners @@ -0,0 +1,67 @@ +GL_NV_register_combiners +http://www.opengl.org/registry/specs/NV/register_combiners.txt +GL_NV_register_combiners + GL_REGISTER_COMBINERS_NV 0x8522 + GL_VARIABLE_A_NV 0x8523 + GL_VARIABLE_B_NV 0x8524 + GL_VARIABLE_C_NV 0x8525 + GL_VARIABLE_D_NV 0x8526 + GL_VARIABLE_E_NV 0x8527 + GL_VARIABLE_F_NV 0x8528 + GL_VARIABLE_G_NV 0x8529 + GL_CONSTANT_COLOR0_NV 0x852A + GL_CONSTANT_COLOR1_NV 0x852B + GL_PRIMARY_COLOR_NV 0x852C + GL_SECONDARY_COLOR_NV 0x852D + GL_SPARE0_NV 0x852E + GL_SPARE1_NV 0x852F + GL_DISCARD_NV 0x8530 + GL_E_TIMES_F_NV 0x8531 + GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 + GL_UNSIGNED_IDENTITY_NV 0x8536 + GL_UNSIGNED_INVERT_NV 0x8537 + GL_EXPAND_NORMAL_NV 0x8538 + GL_EXPAND_NEGATE_NV 0x8539 + GL_HALF_BIAS_NORMAL_NV 0x853A + GL_HALF_BIAS_NEGATE_NV 0x853B + GL_SIGNED_IDENTITY_NV 0x853C + GL_SIGNED_NEGATE_NV 0x853D + GL_SCALE_BY_TWO_NV 0x853E + GL_SCALE_BY_FOUR_NV 0x853F + GL_SCALE_BY_ONE_HALF_NV 0x8540 + GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 + GL_COMBINER_INPUT_NV 0x8542 + GL_COMBINER_MAPPING_NV 0x8543 + GL_COMBINER_COMPONENT_USAGE_NV 0x8544 + GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 + GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 + GL_COMBINER_MUX_SUM_NV 0x8547 + GL_COMBINER_SCALE_NV 0x8548 + GL_COMBINER_BIAS_NV 0x8549 + GL_COMBINER_AB_OUTPUT_NV 0x854A + GL_COMBINER_CD_OUTPUT_NV 0x854B + GL_COMBINER_SUM_OUTPUT_NV 0x854C + GL_MAX_GENERAL_COMBINERS_NV 0x854D + GL_NUM_GENERAL_COMBINERS_NV 0x854E + GL_COLOR_SUM_CLAMP_NV 0x854F + GL_COMBINER0_NV 0x8550 + GL_COMBINER1_NV 0x8551 + GL_COMBINER2_NV 0x8552 + GL_COMBINER3_NV 0x8553 + GL_COMBINER4_NV 0x8554 + GL_COMBINER5_NV 0x8555 + GL_COMBINER6_NV 0x8556 + GL_COMBINER7_NV 0x8557 + void glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) + void glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum) + void glCombinerParameterfNV (GLenum pname, GLfloat param) + void glCombinerParameterfvNV (GLenum pname, const GLfloat* params) + void glCombinerParameteriNV (GLenum pname, GLint param) + void glCombinerParameterivNV (GLenum pname, const GLint* params) + void glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage) + void glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params) + void glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params) + void glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat* params) + void glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint* params) + void glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat* params) + void glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners2 new file mode 100644 index 0000000..166db25 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_register_combiners2 @@ -0,0 +1,6 @@ +GL_NV_register_combiners2 +http://www.opengl.org/registry/specs/NV/register_combiners2.txt +GL_NV_register_combiners2 + GL_PER_STAGE_CONSTANTS_NV 0x8535 + void glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat* params) + void glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_atomic_float b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_atomic_float new file mode 100644 index 0000000..b6f2c7a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_atomic_float @@ -0,0 +1,3 @@ +GL_NV_shader_atomic_float +http://www.opengl.org/registry/specs/NV/shader_atomic_float.txt +GL_NV_shader_atomic_float diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_buffer_load b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_buffer_load new file mode 100644 index 0000000..e58a6b1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_shader_buffer_load @@ -0,0 +1,19 @@ +GL_NV_shader_buffer_load +http://www.opengl.org/registry/specs/NV/shader_buffer_load.txt +GL_NV_shader_buffer_load + GL_BUFFER_GPU_ADDRESS_NV 0x8F1D + GL_GPU_ADDRESS_NV 0x8F34 + GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + void glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT* params) + void glGetIntegerui64vNV (GLenum value, GLuint64EXT* result) + void glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT* params) + GLboolean glIsBufferResidentNV (GLenum target) + GLboolean glIsNamedBufferResidentNV (GLuint buffer) + void glMakeBufferNonResidentNV (GLenum target) + void glMakeBufferResidentNV (GLenum target, GLenum access) + void glMakeNamedBufferNonResidentNV (GLuint buffer) + void glMakeNamedBufferResidentNV (GLuint buffer, GLenum access) + void glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value) + void glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value) + void glUniformui64NV (GLint location, GLuint64EXT value) + void glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT* value) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_tessellation_program5 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_tessellation_program5 new file mode 100644 index 0000000..b663c97 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_tessellation_program5 @@ -0,0 +1,8 @@ +GL_NV_tessellation_program5 +http://www.opengl.org/registry/specs/NV/tessellation_program5.txt +GL_NV_gpu_program5 + GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 + GL_TESS_CONTROL_PROGRAM_NV 0x891E + GL_TESS_EVALUATION_PROGRAM_NV 0x891F + GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 + GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_emboss b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_emboss new file mode 100644 index 0000000..0b7492e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_emboss @@ -0,0 +1,6 @@ +GL_NV_texgen_emboss +http://www.opengl.org/registry/specs/NV/texgen_emboss.txt +GL_NV_texgen_emboss + GL_EMBOSS_LIGHT_NV 0x855D + GL_EMBOSS_CONSTANT_NV 0x855E + GL_EMBOSS_MAP_NV 0x855F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_reflection b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_reflection new file mode 100644 index 0000000..252b3d1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texgen_reflection @@ -0,0 +1,5 @@ +GL_NV_texgen_reflection +http://www.opengl.org/registry/specs/NV/texgen_reflection.txt +GL_NV_texgen_reflection + GL_NORMAL_MAP_NV 0x8511 + GL_REFLECTION_MAP_NV 0x8512 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_barrier b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_barrier new file mode 100644 index 0000000..ec6ce68 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_barrier @@ -0,0 +1,4 @@ +GL_NV_texture_barrier +http://www.opengl.org/registry/specs/NV/texture_barrier.txt +GL_NV_texture_barrier + void glTextureBarrierNV (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_compression_vtc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_compression_vtc new file mode 100644 index 0000000..86cfb6e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_compression_vtc @@ -0,0 +1,3 @@ +GL_NV_texture_compression_vtc +http://www.opengl.org/registry/specs/NV/texture_compression_vtc.txt +GL_NV_texture_compression_vtc diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_env_combine4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_env_combine4 new file mode 100644 index 0000000..1e1adab --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_env_combine4 @@ -0,0 +1,8 @@ +GL_NV_texture_env_combine4 +http://www.opengl.org/registry/specs/NV/texture_env_combine4.txt +GL_NV_texture_env_combine4 + GL_COMBINE4_NV 0x8503 + GL_SOURCE3_RGB_NV 0x8583 + GL_SOURCE3_ALPHA_NV 0x858B + GL_OPERAND3_RGB_NV 0x8593 + GL_OPERAND3_ALPHA_NV 0x859B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_expand_normal b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_expand_normal new file mode 100644 index 0000000..9d9b39b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_expand_normal @@ -0,0 +1,4 @@ +GL_NV_texture_expand_normal +http://www.opengl.org/registry/specs/NV/texture_expand_normal.txt +GL_NV_texture_expand_normal + GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_multisample new file mode 100644 index 0000000..1e0bc3b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_multisample @@ -0,0 +1,11 @@ +GL_NV_texture_multisample +http://www.opengl.org/registry/specs/NV/texture_multisample.txt +GL_NV_texture_multisample + GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 + GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + void glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) + void glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations) + void glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) + void glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_rectangle new file mode 100644 index 0000000..4da2762 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_rectangle @@ -0,0 +1,7 @@ +GL_NV_texture_rectangle +http://www.opengl.org/registry/specs/NV/texture_rectangle.txt +GL_NV_texture_rectangle + GL_TEXTURE_RECTANGLE_NV 0x84F5 + GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 + GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 + GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader new file mode 100644 index 0000000..826db8f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader @@ -0,0 +1,76 @@ +GL_NV_texture_shader +http://www.opengl.org/registry/specs/NV/texture_shader.txt +GL_NV_texture_shader + GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C + GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D + GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E + GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 + GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB + GL_DSDT_MAG_INTENSITY_NV 0x86DC + GL_SHADER_CONSISTENT_NV 0x86DD + GL_TEXTURE_SHADER_NV 0x86DE + GL_SHADER_OPERATION_NV 0x86DF + GL_CULL_MODES_NV 0x86E0 + GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 + GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 + GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 + GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 + GL_CONST_EYE_NV 0x86E5 + GL_PASS_THROUGH_NV 0x86E6 + GL_CULL_FRAGMENT_NV 0x86E7 + GL_OFFSET_TEXTURE_2D_NV 0x86E8 + GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 + GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA + GL_DOT_PRODUCT_NV 0x86EC + GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED + GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE + GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 + GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 + GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 + GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 + GL_HILO_NV 0x86F4 + GL_DSDT_NV 0x86F5 + GL_DSDT_MAG_NV 0x86F6 + GL_DSDT_MAG_VIB_NV 0x86F7 + GL_HILO16_NV 0x86F8 + GL_SIGNED_HILO_NV 0x86F9 + GL_SIGNED_HILO16_NV 0x86FA + GL_SIGNED_RGBA_NV 0x86FB + GL_SIGNED_RGBA8_NV 0x86FC + GL_SIGNED_RGB_NV 0x86FE + GL_SIGNED_RGB8_NV 0x86FF + GL_SIGNED_LUMINANCE_NV 0x8701 + GL_SIGNED_LUMINANCE8_NV 0x8702 + GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 + GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 + GL_SIGNED_ALPHA_NV 0x8705 + GL_SIGNED_ALPHA8_NV 0x8706 + GL_SIGNED_INTENSITY_NV 0x8707 + GL_SIGNED_INTENSITY8_NV 0x8708 + GL_DSDT8_NV 0x8709 + GL_DSDT8_MAG8_NV 0x870A + GL_DSDT8_MAG8_INTENSITY8_NV 0x870B + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + GL_HI_SCALE_NV 0x870E + GL_LO_SCALE_NV 0x870F + GL_DS_SCALE_NV 0x8710 + GL_DT_SCALE_NV 0x8711 + GL_MAGNITUDE_SCALE_NV 0x8712 + GL_VIBRANCE_SCALE_NV 0x8713 + GL_HI_BIAS_NV 0x8714 + GL_LO_BIAS_NV 0x8715 + GL_DS_BIAS_NV 0x8716 + GL_DT_BIAS_NV 0x8717 + GL_MAGNITUDE_BIAS_NV 0x8718 + GL_VIBRANCE_BIAS_NV 0x8719 + GL_TEXTURE_BORDER_VALUES_NV 0x871A + GL_TEXTURE_HI_SIZE_NV 0x871B + GL_TEXTURE_LO_SIZE_NV 0x871C + GL_TEXTURE_DS_SIZE_NV 0x871D + GL_TEXTURE_DT_SIZE_NV 0x871E + GL_TEXTURE_MAG_SIZE_NV 0x871F + GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 + GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 + GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader2 new file mode 100644 index 0000000..c5cc92d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader2 @@ -0,0 +1,31 @@ +GL_NV_texture_shader2 +http://www.opengl.org/registry/specs/NV/texture_shader2.txt +GL_NV_texture_shader2 + GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA + GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB + GL_DSDT_MAG_INTENSITY_NV 0x86DC + GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF + GL_HILO_NV 0x86F4 + GL_DSDT_NV 0x86F5 + GL_DSDT_MAG_NV 0x86F6 + GL_DSDT_MAG_VIB_NV 0x86F7 + GL_HILO16_NV 0x86F8 + GL_SIGNED_HILO_NV 0x86F9 + GL_SIGNED_HILO16_NV 0x86FA + GL_SIGNED_RGBA_NV 0x86FB + GL_SIGNED_RGBA8_NV 0x86FC + GL_SIGNED_RGB_NV 0x86FE + GL_SIGNED_RGB8_NV 0x86FF + GL_SIGNED_LUMINANCE_NV 0x8701 + GL_SIGNED_LUMINANCE8_NV 0x8702 + GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 + GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 + GL_SIGNED_ALPHA_NV 0x8705 + GL_SIGNED_ALPHA8_NV 0x8706 + GL_SIGNED_INTENSITY_NV 0x8707 + GL_SIGNED_INTENSITY8_NV 0x8708 + GL_DSDT8_NV 0x8709 + GL_DSDT8_MAG8_NV 0x870A + GL_DSDT8_MAG8_INTENSITY8_NV 0x870B + GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C + GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader3 new file mode 100644 index 0000000..5cc042b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_texture_shader3 @@ -0,0 +1,20 @@ +GL_NV_texture_shader3 +http://www.opengl.org/registry/specs/NV/texture_shader3.txt +GL_NV_texture_shader3 + GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 + GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 + GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 + GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 + GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 + GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 + GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 + GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 + GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A + GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B + GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C + GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D + GL_HILO8_NV 0x885E + GL_SIGNED_HILO8_NV 0x885F + GL_FORCE_BLUE_TO_ONE_NV 0x8860 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback new file mode 100644 index 0000000..fce4757 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback @@ -0,0 +1,39 @@ +GL_NV_transform_feedback +http://developer.download.nvidia.com/opengl/specs/GL_NV_transform_feedback.txt +GL_NV_transform_feedback + GL_BACK_PRIMARY_COLOR_NV 0x8C77 + GL_BACK_SECONDARY_COLOR_NV 0x8C78 + GL_TEXTURE_COORD_NV 0x8C79 + GL_CLIP_DISTANCE_NV 0x8C7A + GL_VERTEX_ID_NV 0x8C7B + GL_PRIMITIVE_ID_NV 0x8C7C + GL_GENERIC_ATTRIB_NV 0x8C7D + GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 + GL_ACTIVE_VARYINGS_NV 0x8C81 + GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 + GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 + GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 + GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 + GL_PRIMITIVES_GENERATED_NV 0x8C87 + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 + GL_RASTERIZER_DISCARD_NV 0x8C89 + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B + GL_INTERLEAVED_ATTRIBS_NV 0x8C8C + GL_SEPARATE_ATTRIBS_NV 0x8C8D + GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + void glBeginTransformFeedbackNV (GLenum primitiveMode) + void glEndTransformFeedbackNV (void) + void glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode) + void glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) + void glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset) + void glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer) + void glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode) + void glActiveVaryingNV (GLuint program, const GLchar *name) + GLint glGetVaryingLocationNV (GLuint program, const GLchar *name) + void glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name) + void glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback2 new file mode 100644 index 0000000..5513687 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_transform_feedback2 @@ -0,0 +1,14 @@ +GL_NV_transform_feedback2 +http://www.opengl.org/registry/specs/NV/transform_feedback2.txt +GL_NV_transform_feedback2 + GL_TRANSFORM_FEEDBACK_NV 0x8E22 + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 + GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + void glBindTransformFeedbackNV (GLenum target, GLuint id) + void glDeleteTransformFeedbacksNV (GLsizei n, const GLuint* ids) + void glDrawTransformFeedbackNV (GLenum mode, GLuint id) + void glGenTransformFeedbacksNV (GLsizei n, GLuint* ids) + GLboolean glIsTransformFeedbackNV (GLuint id) + void glPauseTransformFeedbackNV (void) + void glResumeTransformFeedbackNV (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vdpau_interop b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vdpau_interop new file mode 100644 index 0000000..a2b68b2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vdpau_interop @@ -0,0 +1,18 @@ +GL_NV_vdpau_interop +http://www.opengl.org/registry/specs/NV/vdpau_interop.txt +GL_NV_vdpau_interop + GL_SURFACE_STATE_NV 0x86EB + GL_SURFACE_REGISTERED_NV 0x86FD + GL_SURFACE_MAPPED_NV 0x8700 + GL_WRITE_DISCARD_NV 0x88BE + void glVDPAUFiniNV (void) + void glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values) + void glVDPAUInitNV (const void* vdpDevice, const GLvoid*getProcAddress) + void glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface) + void glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces) + GLvdpauSurfaceNV glVDPAURegisterOutputSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + GLvdpauSurfaceNV glVDPAURegisterVideoSurfaceNV (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames) + void glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access) + void glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces) + void glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface) + typedef GLintptr GLvdpauSurfaceNV diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range new file mode 100644 index 0000000..32396aa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range @@ -0,0 +1,10 @@ +GL_NV_vertex_array_range +http://www.opengl.org/registry/specs/NV/vertex_array_range.txt +GL_NV_vertex_array_range + GL_VERTEX_ARRAY_RANGE_NV 0x851D + GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E + GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 + GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + void glFlushVertexArrayRangeNV (void) + void glVertexArrayRangeNV (GLsizei length, void* pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range2 new file mode 100644 index 0000000..00fa72c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_array_range2 @@ -0,0 +1,4 @@ +GL_NV_vertex_array_range2 +http://www.opengl.org/registry/specs/NV/vertex_array_range2.txt +GL_NV_vertex_array_range2 + GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_attrib_integer_64bit b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_attrib_integer_64bit new file mode 100644 index 0000000..a34bb36 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_attrib_integer_64bit @@ -0,0 +1,24 @@ +GL_NV_vertex_attrib_integer_64bit +http://www.opengl.org/registry/specs/NV/vertex_attrib_integer_64bit.txt +GL_NV_vertex_attrib_integer_64bit + GL_INT64_NV 0x140E + GL_UNSIGNED_INT64_NV 0x140F + void glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT* params) + void glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT* params) + void glVertexAttribL1i64NV (GLuint index, GLint64EXT x) + void glVertexAttribL1i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x) + void glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y) + void glVertexAttribL2i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y) + void glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z) + void glVertexAttribL3i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z) + void glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w) + void glVertexAttribL4i64vNV (GLuint index, const GLint64EXT* v) + void glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w) + void glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT* v) + void glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_buffer_unified_memory b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_buffer_unified_memory new file mode 100644 index 0000000..9ed7aa5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_buffer_unified_memory @@ -0,0 +1,40 @@ +GL_NV_vertex_buffer_unified_memory +http://www.opengl.org/registry/specs/NV/vertex_buffer_unified_memory.txt +GL_NV_vertex_buffer_unified_memory + GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E + GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F + GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 + GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 + GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 + GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 + GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 + GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 + GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 + GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 + GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 + GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 + GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A + GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B + GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C + GL_COLOR_ARRAY_LENGTH_NV 0x8F2D + GL_INDEX_ARRAY_LENGTH_NV 0x8F2E + GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F + GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 + GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 + GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 + GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 + void glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length) + void glColorFormatNV (GLint size, GLenum type, GLsizei stride) + void glEdgeFlagFormatNV (GLsizei stride) + void glFogCoordFormatNV (GLenum type, GLsizei stride) + void glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT result[]) + void glIndexFormatNV (GLenum type, GLsizei stride) + void glNormalFormatNV (GLenum type, GLsizei stride) + void glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride) + void glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride) + void glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride) + void glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride) + void glVertexFormatNV (GLint size, GLenum type, GLsizei stride) + GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 + GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 + GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program new file mode 100644 index 0000000..b02d1f5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program @@ -0,0 +1,150 @@ +GL_NV_vertex_program +http://www.opengl.org/registry/specs/NV/vertex_program.txt +GL_NV_vertex_program + GL_VERTEX_PROGRAM_NV 0x8620 + GL_VERTEX_STATE_PROGRAM_NV 0x8621 + GL_ATTRIB_ARRAY_SIZE_NV 0x8623 + GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 + GL_ATTRIB_ARRAY_TYPE_NV 0x8625 + GL_CURRENT_ATTRIB_NV 0x8626 + GL_PROGRAM_LENGTH_NV 0x8627 + GL_PROGRAM_STRING_NV 0x8628 + GL_MODELVIEW_PROJECTION_NV 0x8629 + GL_IDENTITY_NV 0x862A + GL_INVERSE_NV 0x862B + GL_TRANSPOSE_NV 0x862C + GL_INVERSE_TRANSPOSE_NV 0x862D + GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E + GL_MAX_TRACK_MATRICES_NV 0x862F + GL_MATRIX0_NV 0x8630 + GL_MATRIX1_NV 0x8631 + GL_MATRIX2_NV 0x8632 + GL_MATRIX3_NV 0x8633 + GL_MATRIX4_NV 0x8634 + GL_MATRIX5_NV 0x8635 + GL_MATRIX6_NV 0x8636 + GL_MATRIX7_NV 0x8637 + GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 + GL_CURRENT_MATRIX_NV 0x8641 + GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 + GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 + GL_PROGRAM_PARAMETER_NV 0x8644 + GL_ATTRIB_ARRAY_POINTER_NV 0x8645 + GL_PROGRAM_TARGET_NV 0x8646 + GL_PROGRAM_RESIDENT_NV 0x8647 + GL_TRACK_MATRIX_NV 0x8648 + GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 + GL_VERTEX_PROGRAM_BINDING_NV 0x864A + GL_PROGRAM_ERROR_POSITION_NV 0x864B + GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 + GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 + GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 + GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 + GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 + GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 + GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 + GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 + GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 + GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 + GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A + GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B + GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C + GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D + GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E + GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F + GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 + GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 + GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 + GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 + GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 + GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 + GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 + GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 + GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 + GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 + GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A + GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B + GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C + GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D + GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E + GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F + GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 + GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 + GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 + GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 + GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 + GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 + GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 + GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 + GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 + GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 + GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A + GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B + GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C + GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D + GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E + GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + GLboolean glAreProgramsResidentNV (GLsizei n, const GLuint* ids, GLboolean *residences) + void glBindProgramNV (GLenum target, GLuint id) + void glDeleteProgramsNV (GLsizei n, const GLuint* ids) + void glExecuteProgramNV (GLenum target, GLuint id, const GLfloat* params) + void glGenProgramsNV (GLsizei n, GLuint* ids) + void glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble* params) + void glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat* params) + void glGetProgramStringNV (GLuint id, GLenum pname, GLubyte* program) + void glGetProgramivNV (GLuint id, GLenum pname, GLint* params) + void glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint* params) + void glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid** pointer) + void glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble* params) + void glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat* params) + void glGetVertexAttribivNV (GLuint index, GLenum pname, GLint* params) + GLboolean glIsProgramNV (GLuint id) + void glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte* program) + void glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble* params) + void glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat* params) + void glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei num, const GLdouble* params) + void glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei num, const GLfloat* params) + void glRequestResidentProgramsNV (GLsizei n, GLuint* ids) + void glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform) + void glVertexAttrib1dNV (GLuint index, GLdouble x) + void glVertexAttrib1dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib1fNV (GLuint index, GLfloat x) + void glVertexAttrib1fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib1sNV (GLuint index, GLshort x) + void glVertexAttrib1svNV (GLuint index, const GLshort* v) + void glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y) + void glVertexAttrib2dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y) + void glVertexAttrib2fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y) + void glVertexAttrib2svNV (GLuint index, const GLshort* v) + void glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z) + void glVertexAttrib3dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z) + void glVertexAttrib3fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z) + void glVertexAttrib3svNV (GLuint index, const GLshort* v) + void glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) + void glVertexAttrib4dvNV (GLuint index, const GLdouble* v) + void glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glVertexAttrib4fvNV (GLuint index, const GLfloat* v) + void glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) + void glVertexAttrib4svNV (GLuint index, const GLshort* v) + void glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) + void glVertexAttrib4ubvNV (GLuint index, const GLubyte* v) + void glVertexAttribPointerNV (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer) + void glVertexAttribs1dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs1fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs1svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs2dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs2fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs2svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs3dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs3fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs3svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs4dvNV (GLuint index, GLsizei n, const GLdouble* v) + void glVertexAttribs4fvNV (GLuint index, GLsizei n, const GLfloat* v) + void glVertexAttribs4svNV (GLuint index, GLsizei n, const GLshort* v) + void glVertexAttribs4ubvNV (GLuint index, GLsizei n, const GLubyte* v) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program1_1 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program1_1 new file mode 100644 index 0000000..929248a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program1_1 @@ -0,0 +1,3 @@ +GL_NV_vertex_program1_1 +http://www.opengl.org/registry/specs/NV/vertex_program1_1.txt +GL_NV_vertex_program1_1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2 new file mode 100644 index 0000000..e80c7a4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2 @@ -0,0 +1,3 @@ +GL_NV_vertex_program2 +http://www.opengl.org/registry/specs/NV/vertex_program2.txt +GL_NV_vertex_program2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2_option b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2_option new file mode 100644 index 0000000..1fecc4c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program2_option @@ -0,0 +1,5 @@ +GL_NV_vertex_program2_option +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program2_option.txt +GL_NV_vertex_program2_option + GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 + GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program3 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program3 new file mode 100644 index 0000000..6510e06 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program3 @@ -0,0 +1,4 @@ +GL_NV_vertex_program3 +http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_vertex_program3.txt +GL_NV_vertex_program3 + MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program4 new file mode 100644 index 0000000..c51d08a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_vertex_program4 @@ -0,0 +1,4 @@ +GL_NV_vertex_program4 +http://developer.download.nvidia.com/opengl/specs/GL_NV_vertex_program4.txt +GL_NV_gpu_program4 + GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_video_capture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_video_capture new file mode 100644 index 0000000..181d637 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_NV_video_capture @@ -0,0 +1,44 @@ +GL_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +GL_NV_video_capture + GL_VIDEO_BUFFER_NV 0x9020 + GL_VIDEO_BUFFER_BINDING_NV 0x9021 + GL_FIELD_UPPER_NV 0x9022 + GL_FIELD_LOWER_NV 0x9023 + GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 + GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 + GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 + GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 + GL_VIDEO_BUFFER_PITCH_NV 0x9028 + GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 + GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A + GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B + GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C + GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D + GL_PARTIAL_SUCCESS_NV 0x902E + GL_SUCCESS_NV 0x902F + GL_FAILURE_NV 0x9030 + GL_YCBYCR8_422_NV 0x9031 + GL_YCBAYCR8A_4224_NV 0x9032 + GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 + GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 + GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 + GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 + GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 + GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 + GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 + GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A + GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B + GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + void glBeginVideoCaptureNV (GLuint video_capture_slot) + void glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset) + void glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture) + void glEndVideoCaptureNV (GLuint video_capture_slot) + void glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint* params) + GLenum glVideoCaptureNV (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time) + void glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params) + void glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params) + void glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params) + void glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params) + void glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params) + void glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_byte_coordinates b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_byte_coordinates new file mode 100644 index 0000000..cf9d509 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_byte_coordinates @@ -0,0 +1,4 @@ +GL_OES_byte_coordinates +http://www.opengl.org/registry/specs/OES/OES_byte_coordinates.txt +GL_OES_byte_coordinates + GL_BYTE 0x1400 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_compressed_paletted_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_compressed_paletted_texture new file mode 100644 index 0000000..d883838 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_compressed_paletted_texture @@ -0,0 +1,13 @@ +GL_OES_compressed_paletted_texture +http://www.opengl.org/registry/specs/OES/OES_compressed_paletted_texture.txt +GL_OES_compressed_paletted_texture + GL_PALETTE4_RGB8_OES 0x8B90 + GL_PALETTE4_RGBA8_OES 0x8B91 + GL_PALETTE4_R5_G6_B5_OES 0x8B92 + GL_PALETTE4_RGBA4_OES 0x8B93 + GL_PALETTE4_RGB5_A1_OES 0x8B94 + GL_PALETTE8_RGB8_OES 0x8B95 + GL_PALETTE8_RGBA8_OES 0x8B96 + GL_PALETTE8_R5_G6_B5_OES 0x8B97 + GL_PALETTE8_RGBA4_OES 0x8B98 + GL_PALETTE8_RGB5_A1_OES 0x8B99 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_read_format b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_read_format new file mode 100644 index 0000000..08e91a4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_read_format @@ -0,0 +1,5 @@ +GL_OES_read_format +http://www.opengl.org/registry/specs/OES/OES_read_format.txt +GL_OES_read_format + GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A + GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_single_precision b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_single_precision new file mode 100644 index 0000000..8702c6d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OES_single_precision @@ -0,0 +1,9 @@ +GL_OES_single_precision +http://www.opengl.org/registry/specs/OES/OES_single_precision.txt +GL_OES_single_precision + void glClearDepthfOES (GLclampd depth) + void glClipPlanefOES (GLenum plane, const GLfloat* equation) + void glDepthRangefOES (GLclampf n, GLclampf f) + void glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) + void glGetClipPlanefOES (GLenum plane, GLfloat* equation) + void glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_interlace b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_interlace new file mode 100644 index 0000000..384a43b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_interlace @@ -0,0 +1,5 @@ +GL_OML_interlace +http://www.opengl.org/registry/specs/OML/interlace.txt +GL_OML_interlace + GL_INTERLACE_OML 0x8980 + GL_INTERLACE_READ_OML 0x8981 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_resample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_resample new file mode 100644 index 0000000..6e702bf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_resample @@ -0,0 +1,9 @@ +GL_OML_resample +http://www.opengl.org/registry/specs/OML/resample.txt +GL_OML_resample + GL_PACK_RESAMPLE_OML 0x8984 + GL_UNPACK_RESAMPLE_OML 0x8985 + GL_RESAMPLE_REPLICATE_OML 0x8986 + GL_RESAMPLE_ZERO_FILL_OML 0x8987 + GL_RESAMPLE_AVERAGE_OML 0x8988 + GL_RESAMPLE_DECIMATE_OML 0x8989 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_subsample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_subsample new file mode 100644 index 0000000..3406ae7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_OML_subsample @@ -0,0 +1,5 @@ +GL_OML_subsample +http://www.opengl.org/registry/specs/OML/subsample.txt +GL_OML_subsample + GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 + GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_misc_hints b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_misc_hints new file mode 100644 index 0000000..b8e88bd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_misc_hints @@ -0,0 +1,23 @@ +GL_PGI_misc_hints +http://www.opengl.org/registry/specs/PGI/misc_hints.txt +GL_PGI_misc_hints + GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 + GL_CONSERVE_MEMORY_HINT_PGI 107005 + GL_RECLAIM_MEMORY_HINT_PGI 107006 + GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 + GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 + GL_ALWAYS_FAST_HINT_PGI 107020 + GL_ALWAYS_SOFT_HINT_PGI 107021 + GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 + GL_ALLOW_DRAW_WIN_HINT_PGI 107023 + GL_ALLOW_DRAW_FRG_HINT_PGI 107024 + GL_ALLOW_DRAW_MEM_HINT_PGI 107025 + GL_STRICT_DEPTHFUNC_HINT_PGI 107030 + GL_STRICT_LIGHTING_HINT_PGI 107031 + GL_STRICT_SCISSOR_HINT_PGI 107032 + GL_FULL_STIPPLE_HINT_PGI 107033 + GL_CLIP_NEAR_HINT_PGI 107040 + GL_CLIP_FAR_HINT_PGI 107041 + GL_WIDE_LINE_HINT_PGI 107042 + GL_BACK_NORMALS_HINT_PGI 107043 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_vertex_hints b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_vertex_hints new file mode 100644 index 0000000..3550952 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_PGI_vertex_hints @@ -0,0 +1,25 @@ +GL_PGI_vertex_hints +http://www.opengl.org/registry/specs/PGI/vertex_hints.txt +GL_PGI_vertex_hints + GL_VERTEX23_BIT_PGI 0x00000004 + GL_VERTEX4_BIT_PGI 0x00000008 + GL_COLOR3_BIT_PGI 0x00010000 + GL_COLOR4_BIT_PGI 0x00020000 + GL_EDGEFLAG_BIT_PGI 0x00040000 + GL_INDEX_BIT_PGI 0x00080000 + GL_MAT_AMBIENT_BIT_PGI 0x00100000 + GL_VERTEX_DATA_HINT_PGI 107050 + GL_VERTEX_CONSISTENT_HINT_PGI 107051 + GL_MATERIAL_SIDE_HINT_PGI 107052 + GL_MAX_VERTEX_HINT_PGI 107053 + GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 + GL_MAT_DIFFUSE_BIT_PGI 0x00400000 + GL_MAT_EMISSION_BIT_PGI 0x00800000 + GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 + GL_MAT_SHININESS_BIT_PGI 0x02000000 + GL_MAT_SPECULAR_BIT_PGI 0x04000000 + GL_NORMAL_BIT_PGI 0x08000000 + GL_TEXCOORD1_BIT_PGI 0x10000000 + GL_TEXCOORD2_BIT_PGI 0x20000000 + GL_TEXCOORD3_BIT_PGI 0x40000000 + GL_TEXCOORD4_BIT_PGI 0x80000000 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_error_string b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_error_string new file mode 100644 index 0000000..c5ff4ce --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_error_string @@ -0,0 +1,4 @@ +GL_REGAL_error_string +https://github.com/p3/regal +GL_REGAL_error_string + const GLchar* glErrorStringREGAL (GLenum error) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_extension_query b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_extension_query new file mode 100644 index 0000000..5bf7245 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_extension_query @@ -0,0 +1,5 @@ +GL_REGAL_extension_query +https://github.com/p3/regal +GL_REGAL_extension_query + GLboolean glGetExtensionREGAL (const GLchar* ext) + GLboolean glIsSupportedREGAL (const GLchar* ext) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_log b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_log new file mode 100644 index 0000000..7f0ca4d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REGAL_log @@ -0,0 +1,12 @@ +GL_REGAL_log +http://www.opengl.org/registry/specs/REGAL/log.txt +GL_REGAL_log + GL_LOG_ERROR_REGAL 0x9319 + GL_LOG_WARNING_REGAL 0x931A + GL_LOG_INFO_REGAL 0x931B + GL_LOG_APP_REGAL 0x931C + GL_LOG_DRIVER_REGAL 0x931D + GL_LOG_INTERNAL_REGAL 0x931E + GL_LOG_DEBUG_REGAL 0x931F + GL_LOG_STATUS_REGAL 0x9320 + GL_LOG_HTTP_REGAL 0x9321 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REND_screen_coordinates b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REND_screen_coordinates new file mode 100644 index 0000000..d4447ea --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_REND_screen_coordinates @@ -0,0 +1,5 @@ +GL_REND_screen_coordinates +http://www.opengl.org/registry/specs/REND/screen_coordinates.txt +GL_REND_screen_coordinates + GL_SCREEN_COORDINATES_REND 0x8490 + GL_INVERTED_SCREEN_W_REND 0x8491 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_S3_s3tc b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_S3_s3tc new file mode 100644 index 0000000..1d9d71c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_S3_s3tc @@ -0,0 +1,9 @@ +GL_S3_s3tc +http://www.opengl.org/registry/specs/S3/s3tc.txt +GL_S3_s3tc + GL_RGB_S3TC 0x83A0 + GL_RGB4_S3TC 0x83A1 + GL_RGBA_S3TC 0x83A2 + GL_RGBA4_S3TC 0x83A3 + GL_RGBA_DXT5_S3TC 0x83A4 + GL_RGBA4_DXT5_S3TC 0x83A5 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_color_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_color_range new file mode 100644 index 0000000..71d39c5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_color_range @@ -0,0 +1,12 @@ +GL_SGIS_color_range +http://www.opengl.org/registry/specs/SGIS/color_range.txt +GL_SGIS_color_range + GL_EXTENDED_RANGE_SGIS 0x85A5 + GL_MIN_RED_SGIS 0x85A6 + GL_MAX_RED_SGIS 0x85A7 + GL_MIN_GREEN_SGIS 0x85A8 + GL_MAX_GREEN_SGIS 0x85A9 + GL_MIN_BLUE_SGIS 0x85AA + GL_MAX_BLUE_SGIS 0x85AB + GL_MIN_ALPHA_SGIS 0x85AC + GL_MAX_ALPHA_SGIS 0x85AD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_detail_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_detail_texture new file mode 100644 index 0000000..178f7b2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_detail_texture @@ -0,0 +1,5 @@ +GL_SGIS_detail_texture +http://www.opengl.org/registry/specs/SGIS/detail_texture.txt +GL_SGIS_detail_texture + void glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat* points) + void glGetDetailTexFuncSGIS (GLenum target, GLfloat* points) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_fog_function b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_fog_function new file mode 100644 index 0000000..3716d97 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_fog_function @@ -0,0 +1,5 @@ +GL_SGIS_fog_function +http://www.opengl.org/registry/specs/SGIS/fog_func.txt +GL_SGIS_fog_function + void glFogFuncSGIS (GLsizei n, const GLfloat* points) + void glGetFogFuncSGIS (GLfloat* points) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_generate_mipmap b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_generate_mipmap new file mode 100644 index 0000000..cc7b27b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_generate_mipmap @@ -0,0 +1,5 @@ +GL_SGIS_generate_mipmap +http://www.opengl.org/registry/specs/SGIS/generate_mipmap.txt +GL_SGIS_generate_mipmap + GL_GENERATE_MIPMAP_SGIS 0x8191 + GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_multisample new file mode 100644 index 0000000..16523a8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_multisample @@ -0,0 +1,21 @@ +GL_SGIS_multisample +http://www.opengl.org/registry/specs/SGIS/multisample.txt +GL_SGIS_multisample + GL_MULTISAMPLE_SGIS 0x809D + GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E + GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F + GL_SAMPLE_MASK_SGIS 0x80A0 + GL_1PASS_SGIS 0x80A1 + GL_2PASS_0_SGIS 0x80A2 + GL_2PASS_1_SGIS 0x80A3 + GL_4PASS_0_SGIS 0x80A4 + GL_4PASS_1_SGIS 0x80A5 + GL_4PASS_2_SGIS 0x80A6 + GL_4PASS_3_SGIS 0x80A7 + GL_SAMPLE_BUFFERS_SGIS 0x80A8 + GL_SAMPLES_SGIS 0x80A9 + GL_SAMPLE_MASK_VALUE_SGIS 0x80AA + GL_SAMPLE_MASK_INVERT_SGIS 0x80AB + GL_SAMPLE_PATTERN_SGIS 0x80AC + void glSampleMaskSGIS (GLclampf value, GLboolean invert) + void glSamplePatternSGIS (GLenum pattern) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_pixel_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_pixel_texture new file mode 100644 index 0000000..5939eb2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_pixel_texture @@ -0,0 +1,3 @@ +GL_SGIS_pixel_texture +http://www.opengl.org/registry/specs/SGIS/pixel_texture.txt +GL_SGIS_pixel_texture diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_point_line_texgen b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_point_line_texgen new file mode 100644 index 0000000..ccf383d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_point_line_texgen @@ -0,0 +1,11 @@ +GL_SGIS_point_line_texgen +http://www.opengl.org/registry/specs/SGIS/point_line_texgen.txt +GL_SGIS_point_line_texgen + GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 + GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 + GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 + GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 + GL_EYE_POINT_SGIS 0x81F4 + GL_OBJECT_POINT_SGIS 0x81F5 + GL_EYE_LINE_SGIS 0x81F6 + GL_OBJECT_LINE_SGIS 0x81F7 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_sharpen_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_sharpen_texture new file mode 100644 index 0000000..3ac1f6a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_sharpen_texture @@ -0,0 +1,5 @@ +GL_SGIS_sharpen_texture +http://www.opengl.org/registry/specs/SGIS/sharpen_texture.txt +GL_SGIS_sharpen_texture + void glGetSharpenTexFuncSGIS (GLenum target, GLfloat* points) + void glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat* points) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture4D b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture4D new file mode 100644 index 0000000..00bf6a7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture4D @@ -0,0 +1,5 @@ +GL_SGIS_texture4D +http://www.opengl.org/registry/specs/SGIS/texture4D.txt +GL_SGIS_texture4D + void glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels) + void glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_border_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_border_clamp new file mode 100644 index 0000000..d397e7d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_border_clamp @@ -0,0 +1,4 @@ +GL_SGIS_texture_border_clamp +http://www.opengl.org/registry/specs/SGIS/texture_border_clamp.txt +GL_SGIS_texture_border_clamp + GL_CLAMP_TO_BORDER_SGIS 0x812D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_edge_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_edge_clamp new file mode 100644 index 0000000..6b0fe03 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_edge_clamp @@ -0,0 +1,4 @@ +GL_SGIS_texture_edge_clamp +http://www.opengl.org/registry/specs/SGIS/texture_edge_clamp.txt +GL_SGIS_texture_edge_clamp + GL_CLAMP_TO_EDGE_SGIS 0x812F diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_filter4 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_filter4 new file mode 100644 index 0000000..49fda19 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_filter4 @@ -0,0 +1,5 @@ +GL_SGIS_texture_filter4 +http://www.opengl.org/registry/specs/SGIS/texture_filter4.txt +GL_SGIS_texture_filter4 + void glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat* weights) + void glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_lod b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_lod new file mode 100644 index 0000000..c731a5f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_lod @@ -0,0 +1,7 @@ +GL_SGIS_texture_lod +http://www.opengl.org/registry/specs/SGIS/texture_lod.txt +GL_SGIS_texture_lod + GL_TEXTURE_MIN_LOD_SGIS 0x813A + GL_TEXTURE_MAX_LOD_SGIS 0x813B + GL_TEXTURE_BASE_LEVEL_SGIS 0x813C + GL_TEXTURE_MAX_LEVEL_SGIS 0x813D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_select b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_select new file mode 100644 index 0000000..ba51bc8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIS_texture_select @@ -0,0 +1,3 @@ +GL_SGIS_texture_select +http://www.opengl.org/registry/specs/SGIS/texture_select.txt +GL_SGIS_texture_select diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async new file mode 100644 index 0000000..05f0454 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async @@ -0,0 +1,10 @@ +GL_SGIX_async +http://www.opengl.org/registry/specs/SGIX/async.txt +GL_SGIX_async + GL_ASYNC_MARKER_SGIX 0x8329 + void glAsyncMarkerSGIX (GLuint marker) + void glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range) + GLint glFinishAsyncSGIX (GLuint* markerp) + GLuint glGenAsyncMarkersSGIX (GLsizei range) + GLboolean glIsAsyncMarkerSGIX (GLuint marker) + GLint glPollAsyncSGIX (GLuint* markerp) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_histogram b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_histogram new file mode 100644 index 0000000..ff5b40b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_histogram @@ -0,0 +1,5 @@ +GL_SGIX_async_histogram +http://www.opengl.org/registry/specs/SGIX/async_histogram.txt +GL_SGIX_async_histogram + GL_ASYNC_HISTOGRAM_SGIX 0x832C + GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_pixel b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_pixel new file mode 100644 index 0000000..7afb9df --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_async_pixel @@ -0,0 +1,9 @@ +GL_SGIX_async_pixel +http://www.opengl.org/registry/specs/SGIX/async_pixel.txt +GL_SGIX_async_pixel + GL_ASYNC_TEX_IMAGE_SGIX 0x835C + GL_ASYNC_DRAW_PIXELS_SGIX 0x835D + GL_ASYNC_READ_PIXELS_SGIX 0x835E + GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F + GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 + GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_blend_alpha_minmax b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_blend_alpha_minmax new file mode 100644 index 0000000..4451124 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_blend_alpha_minmax @@ -0,0 +1,5 @@ +GL_SGIX_blend_alpha_minmax +http://www.opengl.org/registry/specs/SGIX/blend_alpha_minmax.txt +GL_SGIX_blend_alpha_minmax + GL_ALPHA_MIN_SGIX 0x8320 + GL_ALPHA_MAX_SGIX 0x8321 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_clipmap b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_clipmap new file mode 100644 index 0000000..d467486 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_clipmap @@ -0,0 +1,3 @@ +GL_SGIX_clipmap +http://www.opengl.org/registry/specs/SGIX/clipmap.txt +GL_SGIX_clipmap diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_convolution_accuracy b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_convolution_accuracy new file mode 100644 index 0000000..064ff2c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_convolution_accuracy @@ -0,0 +1,4 @@ +GL_SGIX_convolution_accuracy +http://www.opengl.org/registry/specs/SGIX/convolution_accuracy.txt +GL_SGIX_convolution_accuracy + GL_CONVOLUTION_HINT_SGIX 0x8316 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_depth_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_depth_texture new file mode 100644 index 0000000..5c5914e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_depth_texture @@ -0,0 +1,6 @@ +GL_SGIX_depth_texture +http://www.opengl.org/registry/specs/SGIX/depth_texture.txt +GL_SGIX_depth_texture + GL_DEPTH_COMPONENT16_SGIX 0x81A5 + GL_DEPTH_COMPONENT24_SGIX 0x81A6 + GL_DEPTH_COMPONENT32_SGIX 0x81A7 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_flush_raster b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_flush_raster new file mode 100644 index 0000000..9e62248 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_flush_raster @@ -0,0 +1,4 @@ +GL_SGIX_flush_raster +http://www.opengl.org/registry/specs/SGIX/flush_raster.txt +GL_SGIX_flush_raster + void glFlushRasterSGIX (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_offset b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_offset new file mode 100644 index 0000000..da1009a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_offset @@ -0,0 +1,5 @@ +GL_SGIX_fog_offset +http://www.opengl.org/registry/specs/SGIX/fog_offset.txt +GL_SGIX_fog_offset + GL_FOG_OFFSET_SGIX 0x8198 + GL_FOG_OFFSET_VALUE_SGIX 0x8199 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_texture new file mode 100644 index 0000000..3da0eda --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fog_texture @@ -0,0 +1,7 @@ +GL_SGIX_fog_texture +http://www.opengl.org/registry/specs/SGIX/fog_texture.txt +GL_SGIX_fog_texture + GL_TEXTURE_FOG_SGIX 0 + GL_FOG_PATCHY_FACTOR_SGIX 0 + GL_FRAGMENT_FOG_SGIX 0 + void glTextureFogSGIX (GLenum pname) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fragment_specular_lighting b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fragment_specular_lighting new file mode 100644 index 0000000..35937c9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_fragment_specular_lighting @@ -0,0 +1,20 @@ +GL_SGIX_fragment_specular_lighting +http://www.opengl.org/registry/specs/SGIX/fragment_specular_lighting.txt +GL_SGIX_fragment_specular_lighting + void glFragmentColorMaterialSGIX (GLenum face, GLenum mode) + void glFragmentLightModelfSGIX (GLenum pname, GLfloat param) + void glFragmentLightModelfvSGIX (GLenum pname, GLfloat* params) + void glFragmentLightModeliSGIX (GLenum pname, GLint param) + void glFragmentLightModelivSGIX (GLenum pname, GLint* params) + void glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param) + void glFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat* params) + void glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param) + void glFragmentLightivSGIX (GLenum light, GLenum pname, GLint* params) + void glFragmentMaterialfSGIX (GLenum face, GLenum pname, const GLfloat param) + void glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat* params) + void glFragmentMaterialiSGIX (GLenum face, GLenum pname, const GLint param) + void glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint* params) + void glGetFragmentLightfvSGIX (GLenum light, GLenum value, GLfloat* data) + void glGetFragmentLightivSGIX (GLenum light, GLenum value, GLint* data) + void glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat* data) + void glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint* data) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_framezoom b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_framezoom new file mode 100644 index 0000000..a1569ac --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_framezoom @@ -0,0 +1,4 @@ +GL_SGIX_framezoom +http://www.opengl.org/registry/specs/SGIX/framezoom.txt +GL_SGIX_framezoom + void glFrameZoomSGIX (GLint factor) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_interlace b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_interlace new file mode 100644 index 0000000..54d351e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_interlace @@ -0,0 +1,4 @@ +GL_SGIX_interlace +http://www.opengl.org/registry/specs/SGIX/interlace.txt +GL_SGIX_interlace + GL_INTERLACE_SGIX 0x8094 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ir_instrument1 b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ir_instrument1 new file mode 100644 index 0000000..a6c586e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ir_instrument1 @@ -0,0 +1,3 @@ +GL_SGIX_ir_instrument1 +http://www.opengl.org/registry/specs/SGIX/ir_instrument1.txt +GL_SGIX_ir_instrument1 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_list_priority b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_list_priority new file mode 100644 index 0000000..187219b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_list_priority @@ -0,0 +1,3 @@ +GL_SGIX_list_priority +http://www.opengl.org/registry/specs/SGIX/list_priority.txt +GL_SGIX_list_priority diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture new file mode 100644 index 0000000..20bab95 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture @@ -0,0 +1,4 @@ +GL_SGIX_pixel_texture +http://www.opengl.org/registry/specs/SGIX/sgix_pixel_texture.txt +GL_SGIX_pixel_texture + void glPixelTexGenSGIX (GLenum mode) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture_bits b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture_bits new file mode 100644 index 0000000..e550316 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_pixel_texture_bits @@ -0,0 +1,3 @@ +GL_SGIX_pixel_texture_bits +http://www.opengl.org/registry/specs/SGIX/pixel_texture_bits.txt +GL_SGIX_pixel_texture_bits diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_reference_plane b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_reference_plane new file mode 100644 index 0000000..acce076 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_reference_plane @@ -0,0 +1,4 @@ +GL_SGIX_reference_plane +http://www.opengl.org/registry/specs/SGIX/reference_plane.txt +GL_SGIX_reference_plane + void glReferencePlaneSGIX (const GLdouble* equation) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_resample b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_resample new file mode 100644 index 0000000..526e380 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_resample @@ -0,0 +1,8 @@ +GL_SGIX_resample +http://www.opengl.org/registry/specs/SGIX/resample.txt +GL_SGIX_resample + GL_PACK_RESAMPLE_SGIX 0x842E + GL_UNPACK_RESAMPLE_SGIX 0x842F + GL_RESAMPLE_DECIMATE_SGIX 0x8430 + GL_RESAMPLE_REPLICATE_SGIX 0x8433 + GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow new file mode 100644 index 0000000..2b34cc8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow @@ -0,0 +1,7 @@ +GL_SGIX_shadow +http://oss.sgi.com/projects/ogl-sample/registry/SGIX/shadow.txt +GL_SGIX_shadow + GL_TEXTURE_COMPARE_SGIX 0x819A + GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B + GL_TEXTURE_LEQUAL_R_SGIX 0x819C + GL_TEXTURE_GEQUAL_R_SGIX 0x819D diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow_ambient b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow_ambient new file mode 100644 index 0000000..b3476b1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_shadow_ambient @@ -0,0 +1,4 @@ +GL_SGIX_shadow_ambient +http://www.opengl.org/registry/specs/SGIX/shadow_ambient.txt +GL_SGIX_shadow_ambient + GL_SHADOW_AMBIENT_SGIX 0x80BF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_sprite b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_sprite new file mode 100644 index 0000000..427a779 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_sprite @@ -0,0 +1,7 @@ +GL_SGIX_sprite +http://www.opengl.org/registry/specs/SGIX/sprite.txt +GL_SGIX_sprite + void glSpriteParameterfSGIX (GLenum pname, GLfloat param) + void glSpriteParameterfvSGIX (GLenum pname, GLfloat* params) + void glSpriteParameteriSGIX (GLenum pname, GLint param) + void glSpriteParameterivSGIX (GLenum pname, GLint* params) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_tag_sample_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_tag_sample_buffer new file mode 100644 index 0000000..e17f53e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_tag_sample_buffer @@ -0,0 +1,4 @@ +GL_SGIX_tag_sample_buffer +http://www.opengl.org/registry/specs/SGIX/tag_sample_buffer.txt +GL_SGIX_tag_sample_buffer + void glTagSampleBufferSGIX (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_add_env b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_add_env new file mode 100644 index 0000000..19db14c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_add_env @@ -0,0 +1,3 @@ +GL_SGIX_texture_add_env +http://www.opengl.org/registry/specs/SGIX/texture_env_add.txt +GL_SGIX_texture_add_env diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_coordinate_clamp b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_coordinate_clamp new file mode 100644 index 0000000..cd6862d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_coordinate_clamp @@ -0,0 +1,6 @@ +GL_SGIX_texture_coordinate_clamp +http://www.opengl.org/registry/specs/SGIX/texture_coordinate_clamp.txt +GL_SGIX_texture_coordinate_clamp + GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 + GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A + GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_lod_bias b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_lod_bias new file mode 100644 index 0000000..2f8dfb6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_lod_bias @@ -0,0 +1,3 @@ +GL_SGIX_texture_lod_bias +http://www.opengl.org/registry/specs/SGIX/texture_lod_bias.txt +GL_SGIX_texture_lod_bias diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_multi_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_multi_buffer new file mode 100644 index 0000000..0990319 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_multi_buffer @@ -0,0 +1,4 @@ +GL_SGIX_texture_multi_buffer +http://www.opengl.org/registry/specs/SGIX/texture_multi_buffer.txt +GL_SGIX_texture_multi_buffer + GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_range b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_range new file mode 100644 index 0000000..2299caf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_range @@ -0,0 +1,31 @@ +GL_SGIX_texture_range +http://www.opengl.org/registry/specs/SGIX/texture_range.txt +GL_SGIX_texture_range + GL_RGB_SIGNED_SGIX 0x85E0 + GL_RGBA_SIGNED_SGIX 0x85E1 + GL_ALPHA_SIGNED_SGIX 0x85E2 + GL_LUMINANCE_SIGNED_SGIX 0x85E3 + GL_INTENSITY_SIGNED_SGIX 0x85E4 + GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 + GL_RGB16_SIGNED_SGIX 0x85E6 + GL_RGBA16_SIGNED_SGIX 0x85E7 + GL_ALPHA16_SIGNED_SGIX 0x85E8 + GL_LUMINANCE16_SIGNED_SGIX 0x85E9 + GL_INTENSITY16_SIGNED_SGIX 0x85EA + GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB + GL_RGB_EXTENDED_RANGE_SGIX 0x85EC + GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED + GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE + GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF + GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 + GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 + GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 + GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 + GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 + GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 + GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 + GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 + GL_MIN_LUMINANCE_SGIS 0x85F8 + GL_MAX_LUMINANCE_SGIS 0x85F9 + GL_MIN_INTENSITY_SGIS 0x85FA + GL_MAX_INTENSITY_SGIS 0x85FB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_scale_bias b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_scale_bias new file mode 100644 index 0000000..83ff2ff --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_texture_scale_bias @@ -0,0 +1,7 @@ +GL_SGIX_texture_scale_bias +http://www.opengl.org/registry/specs/SGIX/texture_scale_bias.txt +GL_SGIX_texture_scale_bias + GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 + GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A + GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B + GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip new file mode 100644 index 0000000..9877255 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip @@ -0,0 +1,5 @@ +GL_SGIX_vertex_preclip +http://www.opengl.org/registry/specs/SGIX/vertex_preclip.txt +GL_SGIX_vertex_preclip + GL_VERTEX_PRECLIP_SGIX 0x83EE + GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip_hint b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip_hint new file mode 100644 index 0000000..285bded --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_vertex_preclip_hint @@ -0,0 +1,5 @@ +GL_SGIX_vertex_preclip_hint +http://www.opengl.org/registry/specs/SGIX/vertex_preclip.txt +GL_SGIX_vertex_preclip_hint + GL_VERTEX_PRECLIP_SGIX 0x83EE + GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ycrcb b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ycrcb new file mode 100644 index 0000000..19e6034 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGIX_ycrcb @@ -0,0 +1,3 @@ +GL_SGIX_ycrcb +http://www.opengl.org/registry/specs/SGIX/ycrcb.txt +GL_SGIX_ycrcb diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_matrix b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_matrix new file mode 100644 index 0000000..7db7e20 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_matrix @@ -0,0 +1,14 @@ +GL_SGI_color_matrix +http://www.opengl.org/registry/specs/SGI/color_matrix.txt +GL_SGI_color_matrix + GL_COLOR_MATRIX_SGI 0x80B1 + GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 + GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 + GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 + GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 + GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 + GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 + GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 + GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 + GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA + GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_table b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_table new file mode 100644 index 0000000..756ba49 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_color_table @@ -0,0 +1,26 @@ +GL_SGI_color_table +http://www.opengl.org/registry/specs/SGI/color_table.txt +GL_SGI_color_table + GL_COLOR_TABLE_SGI 0x80D0 + GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 + GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 + GL_PROXY_COLOR_TABLE_SGI 0x80D3 + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 + GL_COLOR_TABLE_SCALE_SGI 0x80D6 + GL_COLOR_TABLE_BIAS_SGI 0x80D7 + GL_COLOR_TABLE_FORMAT_SGI 0x80D8 + GL_COLOR_TABLE_WIDTH_SGI 0x80D9 + GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA + GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB + GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC + GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD + GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE + GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + void glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat* params) + void glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint* params) + void glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table) + void glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) + void glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat* params) + void glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint* params) + void glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void* table) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_texture_color_table b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_texture_color_table new file mode 100644 index 0000000..2993170 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SGI_texture_color_table @@ -0,0 +1,5 @@ +GL_SGI_texture_color_table +http://www.opengl.org/registry/specs/SGI/texture_color_table.txt +GL_SGI_texture_color_table + GL_TEXTURE_COLOR_TABLE_SGI 0x80BC + GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUNX_constant_data b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUNX_constant_data new file mode 100644 index 0000000..5fe63c5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUNX_constant_data @@ -0,0 +1,6 @@ +GL_SUNX_constant_data +http://www.opengl.org/registry/specs/SUNX/constant_data.txt +GL_SUNX_constant_data + GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 + GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + void glFinishTextureSUNX (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_convolution_border_modes b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_convolution_border_modes new file mode 100644 index 0000000..0c6fda8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_convolution_border_modes @@ -0,0 +1,4 @@ +GL_SUN_convolution_border_modes +http://www.opengl.org/registry/specs/SUN/convolution_border_modes.txt +GL_SUN_convolution_border_modes + GL_WRAP_BORDER_SUN 0x81D4 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_global_alpha b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_global_alpha new file mode 100644 index 0000000..d7c5274 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_global_alpha @@ -0,0 +1,13 @@ +GL_SUN_global_alpha +http://www.opengl.org/registry/specs/SUN/global_alpha.txt +GL_SUN_global_alpha + GL_GLOBAL_ALPHA_SUN 0x81D9 + GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + void glGlobalAlphaFactorbSUN (GLbyte factor) + void glGlobalAlphaFactordSUN (GLdouble factor) + void glGlobalAlphaFactorfSUN (GLfloat factor) + void glGlobalAlphaFactoriSUN (GLint factor) + void glGlobalAlphaFactorsSUN (GLshort factor) + void glGlobalAlphaFactorubSUN (GLubyte factor) + void glGlobalAlphaFactoruiSUN (GLuint factor) + void glGlobalAlphaFactorusSUN (GLushort factor) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_mesh_array b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_mesh_array new file mode 100644 index 0000000..28229bf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_mesh_array @@ -0,0 +1,5 @@ +GL_SUN_mesh_array +http://www.opengl.org/registry/specs/SUN/mesh_array.txt +GL_SUN_mesh_array + GL_QUAD_MESH_SUN 0x8614 + GL_TRIANGLE_MESH_SUN 0x8615 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_read_video_pixels b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_read_video_pixels new file mode 100644 index 0000000..faa55f9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_read_video_pixels @@ -0,0 +1,4 @@ +GL_SUN_read_video_pixels +http://wwws.sun.com/software/graphics/opengl/extensions/gl_sun_read_video_pixels.txt +GL_SUN_read_video_pixels + void glReadVideoPixelsSUN (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_slice_accum b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_slice_accum new file mode 100644 index 0000000..404237d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_slice_accum @@ -0,0 +1,4 @@ +GL_SUN_slice_accum +http://www.opengl.org/registry/specs/SUN/slice_accum.txt +GL_SUN_slice_accum + GL_SLICE_ACCUM_SUN 0x85CC diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_triangle_list b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_triangle_list new file mode 100644 index 0000000..a42af1f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_triangle_list @@ -0,0 +1,27 @@ +GL_SUN_triangle_list +http://www.opengl.org/registry/specs/SUN/triangle_list.txt +GL_SUN_triangle_list + GL_RESTART_SUN 0x01 + GL_REPLACE_MIDDLE_SUN 0x02 + GL_REPLACE_OLDEST_SUN 0x03 + GL_TRIANGLE_LIST_SUN 0x81D7 + GL_REPLACEMENT_CODE_SUN 0x81D8 + GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 + GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 + GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 + GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 + GL_R1UI_V3F_SUN 0x85C4 + GL_R1UI_C4UB_V3F_SUN 0x85C5 + GL_R1UI_C3F_V3F_SUN 0x85C6 + GL_R1UI_N3F_V3F_SUN 0x85C7 + GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 + GL_R1UI_T2F_V3F_SUN 0x85C9 + GL_R1UI_T2F_N3F_V3F_SUN 0x85CA + GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + void glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void* pointer) + void glReplacementCodeubSUN (GLubyte code) + void glReplacementCodeubvSUN (const GLubyte* code) + void glReplacementCodeuiSUN (GLuint code) + void glReplacementCodeuivSUN (const GLuint* code) + void glReplacementCodeusSUN (GLushort code) + void glReplacementCodeusvSUN (const GLushort* code) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_vertex b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_vertex new file mode 100644 index 0000000..0111c01 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_SUN_vertex @@ -0,0 +1,43 @@ +GL_SUN_vertex +http://www.opengl.org/registry/specs/SUN/vertex.txt +GL_SUN_vertex + void glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glColor3fVertex3fvSUN (const GLfloat* c, const GLfloat *v) + void glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glColor4fNormal3fVertex3fvSUN (const GLfloat* c, const GLfloat *n, const GLfloat *v) + void glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y) + void glColor4ubVertex2fvSUN (const GLubyte* c, const GLfloat *v) + void glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glColor4ubVertex3fvSUN (const GLubyte* c, const GLfloat *v) + void glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glNormal3fVertex3fvSUN (const GLfloat* n, const GLfloat *v) + void glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor3fVertex3fvSUN (const GLuint* rc, const GLfloat *c, const GLfloat *v) + void glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint* rc, const GLubyte *c, const GLfloat *v) + void glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v) + void glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint* rc, const GLfloat *tc, const GLfloat *v) + void glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z) + void glReplacementCodeuiVertex3fvSUN (const GLuint* rc, const GLfloat *v) + void glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor3fVertex3fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *v) + void glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fColor4ubVertex3fvSUN (const GLfloat* tc, const GLubyte *c, const GLfloat *v) + void glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fNormal3fVertex3fvSUN (const GLfloat* tc, const GLfloat *n, const GLfloat *v) + void glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) + void glTexCoord2fVertex3fvSUN (const GLfloat* tc, const GLfloat *v) + void glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) + void glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + void glTexCoord4fVertex4fvSUN (const GLfloat* tc, const GLfloat *v) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_phong_shading b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_phong_shading new file mode 100644 index 0000000..9faadb8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_phong_shading @@ -0,0 +1,5 @@ +GL_WIN_phong_shading +http://www.opengl.org/registry/specs/WIN/phong_shading.txt +GL_WIN_phong_shading + GL_PHONG_WIN 0x80EA + GL_PHONG_HINT_WIN 0x80EB diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_specular_fog b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_specular_fog new file mode 100644 index 0000000..2cfcd01 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_specular_fog @@ -0,0 +1,4 @@ +GL_WIN_specular_fog +http://www.opengl.org/registry/specs/WIN/specular_fog.txt +GL_WIN_specular_fog + GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_swap_hint b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_swap_hint new file mode 100644 index 0000000..6916189 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/GL_WIN_swap_hint @@ -0,0 +1,4 @@ +GL_WIN_swap_hint +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_16zy.asp +GL_WIN_swap_hint + void glAddSwapHintRectWIN (GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DFX_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DFX_multisample new file mode 100644 index 0000000..f0d91e9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DFX_multisample @@ -0,0 +1,5 @@ +WGL_3DFX_multisample +http://www.opengl.org/registry/specs/3DFX/3dfx_multisample.txt +WGL_3DFX_multisample + WGL_SAMPLE_BUFFERS_3DFX 0x2060 + WGL_SAMPLES_3DFX 0x2061 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DL_stereo_control b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DL_stereo_control new file mode 100644 index 0000000..88fb1bb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_3DL_stereo_control @@ -0,0 +1,8 @@ +WGL_3DL_stereo_control +http://www.opengl.org/registry/specs/3DL/stereo_control.txt +WGL_3DL_stereo_control + WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 + WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 + WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 + WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + BOOL wglSetStereoEmitterState3DL (HDC hDC, UINT uState) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_AMD_gpu_association b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_AMD_gpu_association new file mode 100644 index 0000000..359b9ba --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_AMD_gpu_association @@ -0,0 +1,22 @@ +WGL_AMD_gpu_association +http://www.opengl.org/registry/specs/AMD/wgl_gpu_association.txt +WGL_AMD_gpu_association + WGL_GPU_VENDOR_AMD 0x1F00 + WGL_GPU_RENDERER_STRING_AMD 0x1F01 + WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 + WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 + WGL_GPU_RAM_AMD 0x21A3 + WGL_GPU_CLOCK_AMD 0x21A4 + WGL_GPU_NUM_PIPES_AMD 0x21A5 + WGL_GPU_NUM_SIMD_AMD 0x21A6 + WGL_GPU_NUM_RB_AMD 0x21A7 + WGL_GPU_NUM_SPI_AMD 0x21A8 + VOID wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) + HGLRC wglCreateAssociatedContextAMD (UINT id) + HGLRC wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int* attribList) + BOOL wglDeleteAssociatedContextAMD (HGLRC hglrc) + UINT wglGetContextGPUIDAMD (HGLRC hglrc) + HGLRC wglGetCurrentAssociatedContextAMD (void) + UINT wglGetGPUIDsAMD (UINT maxCount, UINT* ids) + INT wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void* data) + BOOL wglMakeAssociatedContextCurrentAMD (HGLRC hglrc) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_buffer_region b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_buffer_region new file mode 100644 index 0000000..719f648 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_buffer_region @@ -0,0 +1,11 @@ +WGL_ARB_buffer_region +http://www.opengl.org/registry/specs/ARB/wgl_buffer_region.txt +WGL_ARB_buffer_region + WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 + WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 + WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 + WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + HANDLE wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType) + VOID wglDeleteBufferRegionARB (HANDLE hRegion) + BOOL wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc) + BOOL wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context new file mode 100644 index 0000000..20b3119 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context @@ -0,0 +1,12 @@ +WGL_ARB_create_context +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context + WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 + WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 + WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 + WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 + WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 + WGL_CONTEXT_FLAGS_ARB 0x2094 + ERROR_INVALID_VERSION_ARB 0x2095 + ERROR_INVALID_PROFILE_ARB 0x2096 + HGLRC wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int* attribList) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_profile new file mode 100644 index 0000000..1b3c104 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_profile @@ -0,0 +1,6 @@ +WGL_ARB_create_context_profile +http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt +WGL_ARB_create_context_profile + WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 + WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 + WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_robustness b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_robustness new file mode 100644 index 0000000..772f03f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_create_context_robustness @@ -0,0 +1,7 @@ +WGL_ARB_create_context_robustness +http://www.opengl.org/registry/specs/ARB/wgl_create_context_robustness.txt +WGL_ARB_create_context_robustness + WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 + WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 + WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 + WGL_NO_RESET_NOTIFICATION_ARB 0x8261 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_extensions_string b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_extensions_string new file mode 100644 index 0000000..1c13879 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_extensions_string @@ -0,0 +1,4 @@ +WGL_ARB_extensions_string +http://www.opengl.org/registry/specs/ARB/wgl_extensions_string.txt +WGL_ARB_extensions_string + const char* wglGetExtensionsStringARB (HDC hdc) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_framebuffer_sRGB new file mode 100644 index 0000000..b166c5b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_framebuffer_sRGB @@ -0,0 +1,4 @@ +WGL_ARB_framebuffer_sRGB +http://www.opengl.org/registry/specs/ARB/framebuffer_sRGB.txt +WGL_ARB_framebuffer_sRGB + WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_make_current_read b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_make_current_read new file mode 100644 index 0000000..352f9cf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_make_current_read @@ -0,0 +1,7 @@ +WGL_ARB_make_current_read +http://www.opengl.org/registry/specs/ARB/wgl_make_current_read.txt +WGL_ARB_make_current_read + HDC wglGetCurrentReadDCARB (VOID) + BOOL wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc) + ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 + ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_multisample new file mode 100644 index 0000000..8f9f5c3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_multisample @@ -0,0 +1,5 @@ +WGL_ARB_multisample +http://www.opengl.org/registry/specs/ARB/multisample.txt +WGL_ARB_multisample + WGL_SAMPLE_BUFFERS_ARB 0x2041 + WGL_SAMPLES_ARB 0x2042 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pbuffer b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pbuffer new file mode 100644 index 0000000..fa9f7c9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pbuffer @@ -0,0 +1,17 @@ +WGL_ARB_pbuffer +http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt +WGL_ARB_pbuffer + WGL_DRAW_TO_PBUFFER_ARB 0x202D + WGL_MAX_PBUFFER_PIXELS_ARB 0x202E + WGL_MAX_PBUFFER_WIDTH_ARB 0x202F + WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 + WGL_PBUFFER_LARGEST_ARB 0x2033 + WGL_PBUFFER_WIDTH_ARB 0x2034 + WGL_PBUFFER_HEIGHT_ARB 0x2035 + WGL_PBUFFER_LOST_ARB 0x2036 + HPBUFFERARB wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList) + BOOL wglDestroyPbufferARB (HPBUFFERARB hPbuffer) + HDC wglGetPbufferDCARB (HPBUFFERARB hPbuffer) + BOOL wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int* piValue) + int wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC) + DECLARE_HANDLE(HPBUFFERARB); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format new file mode 100644 index 0000000..553353f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format @@ -0,0 +1,55 @@ +WGL_ARB_pixel_format +http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt +WGL_ARB_pixel_format + WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 + WGL_DRAW_TO_WINDOW_ARB 0x2001 + WGL_DRAW_TO_BITMAP_ARB 0x2002 + WGL_ACCELERATION_ARB 0x2003 + WGL_NEED_PALETTE_ARB 0x2004 + WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 + WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 + WGL_SWAP_METHOD_ARB 0x2007 + WGL_NUMBER_OVERLAYS_ARB 0x2008 + WGL_NUMBER_UNDERLAYS_ARB 0x2009 + WGL_TRANSPARENT_ARB 0x200A + WGL_SHARE_DEPTH_ARB 0x200C + WGL_SHARE_STENCIL_ARB 0x200D + WGL_SHARE_ACCUM_ARB 0x200E + WGL_SUPPORT_GDI_ARB 0x200F + WGL_SUPPORT_OPENGL_ARB 0x2010 + WGL_DOUBLE_BUFFER_ARB 0x2011 + WGL_STEREO_ARB 0x2012 + WGL_PIXEL_TYPE_ARB 0x2013 + WGL_COLOR_BITS_ARB 0x2014 + WGL_RED_BITS_ARB 0x2015 + WGL_RED_SHIFT_ARB 0x2016 + WGL_GREEN_BITS_ARB 0x2017 + WGL_GREEN_SHIFT_ARB 0x2018 + WGL_BLUE_BITS_ARB 0x2019 + WGL_BLUE_SHIFT_ARB 0x201A + WGL_ALPHA_BITS_ARB 0x201B + WGL_ALPHA_SHIFT_ARB 0x201C + WGL_ACCUM_BITS_ARB 0x201D + WGL_ACCUM_RED_BITS_ARB 0x201E + WGL_ACCUM_GREEN_BITS_ARB 0x201F + WGL_ACCUM_BLUE_BITS_ARB 0x2020 + WGL_ACCUM_ALPHA_BITS_ARB 0x2021 + WGL_DEPTH_BITS_ARB 0x2022 + WGL_STENCIL_BITS_ARB 0x2023 + WGL_AUX_BUFFERS_ARB 0x2024 + WGL_NO_ACCELERATION_ARB 0x2025 + WGL_GENERIC_ACCELERATION_ARB 0x2026 + WGL_FULL_ACCELERATION_ARB 0x2027 + WGL_SWAP_EXCHANGE_ARB 0x2028 + WGL_SWAP_COPY_ARB 0x2029 + WGL_SWAP_UNDEFINED_ARB 0x202A + WGL_TYPE_RGBA_ARB 0x202B + WGL_TYPE_COLORINDEX_ARB 0x202C + WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 + WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 + WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 + WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A + WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + BOOL wglChoosePixelFormatARB (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats) + BOOL wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues) + BOOL wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format_float b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format_float new file mode 100644 index 0000000..f45294c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_pixel_format_float @@ -0,0 +1,4 @@ +WGL_ARB_pixel_format_float +http://www.opengl.org/registry/specs/ARB/color_buffer_float.txt +WGL_ARB_pixel_format_float + WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_render_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_render_texture new file mode 100644 index 0000000..7821263 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ARB_render_texture @@ -0,0 +1,39 @@ +WGL_ARB_render_texture +http://www.opengl.org/registry/specs/ARB/wgl_render_texture.txt +WGL_ARB_render_texture + WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 + WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 + WGL_TEXTURE_FORMAT_ARB 0x2072 + WGL_TEXTURE_TARGET_ARB 0x2073 + WGL_MIPMAP_TEXTURE_ARB 0x2074 + WGL_TEXTURE_RGB_ARB 0x2075 + WGL_TEXTURE_RGBA_ARB 0x2076 + WGL_NO_TEXTURE_ARB 0x2077 + WGL_TEXTURE_CUBE_MAP_ARB 0x2078 + WGL_TEXTURE_1D_ARB 0x2079 + WGL_TEXTURE_2D_ARB 0x207A + WGL_MIPMAP_LEVEL_ARB 0x207B + WGL_CUBE_MAP_FACE_ARB 0x207C + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D + WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E + WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 + WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 + WGL_FRONT_LEFT_ARB 0x2083 + WGL_FRONT_RIGHT_ARB 0x2084 + WGL_BACK_LEFT_ARB 0x2085 + WGL_BACK_RIGHT_ARB 0x2086 + WGL_AUX0_ARB 0x2087 + WGL_AUX1_ARB 0x2088 + WGL_AUX2_ARB 0x2089 + WGL_AUX3_ARB 0x208A + WGL_AUX4_ARB 0x208B + WGL_AUX5_ARB 0x208C + WGL_AUX6_ARB 0x208D + WGL_AUX7_ARB 0x208E + WGL_AUX8_ARB 0x208F + WGL_AUX9_ARB 0x2090 + BOOL wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) + BOOL wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer) + BOOL wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int* piAttribList) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_pixel_format_float b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_pixel_format_float new file mode 100644 index 0000000..ba6f51a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_pixel_format_float @@ -0,0 +1,6 @@ +WGL_ATI_pixel_format_float +http://www.opengl.org/registry/specs/ATI/pixel_format_float.txt +WGL_ATI_pixel_format_float + WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 + GL_RGBA_FLOAT_MODE_ATI 0x8820 + GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_render_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_render_texture_rectangle new file mode 100644 index 0000000..55df114 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_ATI_render_texture_rectangle @@ -0,0 +1,4 @@ +WGL_ATI_render_texture_rectangle + +WGL_ATI_render_texture_rectangle + WGL_TEXTURE_RECTANGLE_ATI 0x21A5 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es2_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es2_profile new file mode 100644 index 0000000..ca9881a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es2_profile @@ -0,0 +1,4 @@ +WGL_EXT_create_context_es2_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es2_profile.txt +WGL_EXT_create_context_es2_profile + WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es_profile b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es_profile new file mode 100644 index 0000000..6eb7cdd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_create_context_es_profile @@ -0,0 +1,4 @@ +WGL_EXT_create_context_es_profile +http://www.opengl.org/registry/specs/EXT/wgl_create_context_es_profile.txt +WGL_EXT_create_context_es_profile + WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_depth_float b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_depth_float new file mode 100644 index 0000000..f8f3efe --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_depth_float @@ -0,0 +1,4 @@ +WGL_EXT_depth_float +http://www.opengl.org/registry/specs/EXT/wgl_depth_float.txt +WGL_EXT_depth_float + WGL_DEPTH_FLOAT_EXT 0x2040 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_display_color_table b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_display_color_table new file mode 100644 index 0000000..4de4a3d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_display_color_table @@ -0,0 +1,7 @@ +WGL_EXT_display_color_table +http://www.opengl.org/registry/specs/EXT/wgl_display_color_table.txt +WGL_EXT_display_color_table + GLboolean wglBindDisplayColorTableEXT (GLushort id) + GLboolean wglCreateDisplayColorTableEXT (GLushort id) + void wglDestroyDisplayColorTableEXT (GLushort id) + GLboolean wglLoadDisplayColorTableEXT (GLushort* table, GLuint length) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_extensions_string b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_extensions_string new file mode 100644 index 0000000..1f0cda0 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_extensions_string @@ -0,0 +1,4 @@ +WGL_EXT_extensions_string +http://www.opengl.org/registry/specs/EXT/wgl_extensions_string.txt +WGL_EXT_extensions_string + const char* wglGetExtensionsStringEXT (void) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_framebuffer_sRGB b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_framebuffer_sRGB new file mode 100644 index 0000000..e4a4032 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_framebuffer_sRGB @@ -0,0 +1,4 @@ +WGL_EXT_framebuffer_sRGB +http://developer.download.nvidia.com/opengl/specs/GL_EXT_framebuffer_sRGB.txt +WGL_EXT_framebuffer_sRGB + WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_make_current_read b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_make_current_read new file mode 100644 index 0000000..d92c307 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_make_current_read @@ -0,0 +1,6 @@ +WGL_EXT_make_current_read +http://www.opengl.org/registry/specs/EXT/wgl_make_current_read.txt +WGL_EXT_make_current_read + HDC wglGetCurrentReadDCEXT (VOID) + BOOL wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc) + ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_multisample b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_multisample new file mode 100644 index 0000000..e419a33 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_multisample @@ -0,0 +1,5 @@ +WGL_EXT_multisample +http://www.opengl.org/registry/specs/EXT/wgl_multisample.txt +WGL_EXT_multisample + WGL_SAMPLE_BUFFERS_EXT 0x2041 + WGL_SAMPLES_EXT 0x2042 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pbuffer b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pbuffer new file mode 100644 index 0000000..d32a950 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pbuffer @@ -0,0 +1,18 @@ +WGL_EXT_pbuffer +http://www.opengl.org/registry/specs/EXT/wgl_pbuffer.txt +WGL_EXT_pbuffer + WGL_DRAW_TO_PBUFFER_EXT 0x202D + WGL_MAX_PBUFFER_PIXELS_EXT 0x202E + WGL_MAX_PBUFFER_WIDTH_EXT 0x202F + WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 + WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 + WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 + WGL_PBUFFER_LARGEST_EXT 0x2033 + WGL_PBUFFER_WIDTH_EXT 0x2034 + WGL_PBUFFER_HEIGHT_EXT 0x2035 + HPBUFFEREXT wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList) + BOOL wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer) + HDC wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer) + BOOL wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue) + int wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC) + DECLARE_HANDLE(HPBUFFEREXT); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format new file mode 100644 index 0000000..6b18933 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format @@ -0,0 +1,51 @@ +WGL_EXT_pixel_format +http://www.opengl.org/registry/specs/EXT/wgl_pixel_format.txt +WGL_EXT_pixel_format + WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 + WGL_DRAW_TO_WINDOW_EXT 0x2001 + WGL_DRAW_TO_BITMAP_EXT 0x2002 + WGL_ACCELERATION_EXT 0x2003 + WGL_NEED_PALETTE_EXT 0x2004 + WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 + WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 + WGL_SWAP_METHOD_EXT 0x2007 + WGL_NUMBER_OVERLAYS_EXT 0x2008 + WGL_NUMBER_UNDERLAYS_EXT 0x2009 + WGL_TRANSPARENT_EXT 0x200A + WGL_TRANSPARENT_VALUE_EXT 0x200B + WGL_SHARE_DEPTH_EXT 0x200C + WGL_SHARE_STENCIL_EXT 0x200D + WGL_SHARE_ACCUM_EXT 0x200E + WGL_SUPPORT_GDI_EXT 0x200F + WGL_SUPPORT_OPENGL_EXT 0x2010 + WGL_DOUBLE_BUFFER_EXT 0x2011 + WGL_STEREO_EXT 0x2012 + WGL_PIXEL_TYPE_EXT 0x2013 + WGL_COLOR_BITS_EXT 0x2014 + WGL_RED_BITS_EXT 0x2015 + WGL_RED_SHIFT_EXT 0x2016 + WGL_GREEN_BITS_EXT 0x2017 + WGL_GREEN_SHIFT_EXT 0x2018 + WGL_BLUE_BITS_EXT 0x2019 + WGL_BLUE_SHIFT_EXT 0x201A + WGL_ALPHA_BITS_EXT 0x201B + WGL_ALPHA_SHIFT_EXT 0x201C + WGL_ACCUM_BITS_EXT 0x201D + WGL_ACCUM_RED_BITS_EXT 0x201E + WGL_ACCUM_GREEN_BITS_EXT 0x201F + WGL_ACCUM_BLUE_BITS_EXT 0x2020 + WGL_ACCUM_ALPHA_BITS_EXT 0x2021 + WGL_DEPTH_BITS_EXT 0x2022 + WGL_STENCIL_BITS_EXT 0x2023 + WGL_AUX_BUFFERS_EXT 0x2024 + WGL_NO_ACCELERATION_EXT 0x2025 + WGL_GENERIC_ACCELERATION_EXT 0x2026 + WGL_FULL_ACCELERATION_EXT 0x2027 + WGL_SWAP_EXCHANGE_EXT 0x2028 + WGL_SWAP_COPY_EXT 0x2029 + WGL_SWAP_UNDEFINED_EXT 0x202A + WGL_TYPE_RGBA_EXT 0x202B + WGL_TYPE_COLORINDEX_EXT 0x202C + BOOL wglChoosePixelFormatEXT (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats) + BOOL wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues) + BOOL wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format_packed_float b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format_packed_float new file mode 100644 index 0000000..30925fc --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_pixel_format_packed_float @@ -0,0 +1,4 @@ +WGL_EXT_pixel_format_packed_float +http://developer.download.nvidia.com/opengl/specs/GL_EXT_packed_float.txt +WGL_EXT_pixel_format_packed_float + WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control new file mode 100644 index 0000000..c3d63f5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control @@ -0,0 +1,5 @@ +WGL_EXT_swap_control +http://www.opengl.org/registry/specs/EXT/wgl_swap_control.txt +WGL_EXT_swap_control + int wglGetSwapIntervalEXT (void) + BOOL wglSwapIntervalEXT (int interval) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control_tear b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control_tear new file mode 100644 index 0000000..722a471 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_EXT_swap_control_tear @@ -0,0 +1,3 @@ +WGL_EXT_swap_control_tear +http://www.opengl.org/registry/specs/EXT/wgl_swap_control_tear.txt +WGL_EXT_swap_control_tear diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_digital_video_control b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_digital_video_control new file mode 100644 index 0000000..6dff1d3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_digital_video_control @@ -0,0 +1,9 @@ +WGL_I3D_digital_video_control +http://www.opengl.org/registry/specs/I3D/wgl_digital_video_control.txt +WGL_I3D_digital_video_control + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 + WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 + WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 + WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + BOOL wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int* piValue) + BOOL wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int* piValue) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_gamma b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_gamma new file mode 100644 index 0000000..6df2a59 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_gamma @@ -0,0 +1,9 @@ +WGL_I3D_gamma +http://www.opengl.org/registry/specs/I3D/wgl_gamma.txt +WGL_I3D_gamma + WGL_GAMMA_TABLE_SIZE_I3D 0x204E + WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + BOOL wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue) + BOOL wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int* piValue) + BOOL wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue) + BOOL wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int* piValue) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_genlock b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_genlock new file mode 100644 index 0000000..ef6a7aa --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_genlock @@ -0,0 +1,24 @@ +WGL_I3D_genlock +http://www.opengl.org/registry/specs/I3D/wgl_genlock.txt +WGL_I3D_genlock + WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 + WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 + WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 + WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 + WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 + WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 + WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A + WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B + WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + BOOL wglDisableGenlockI3D (HDC hDC) + BOOL wglEnableGenlockI3D (HDC hDC) + BOOL wglGenlockSampleRateI3D (HDC hDC, UINT uRate) + BOOL wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay) + BOOL wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge) + BOOL wglGenlockSourceI3D (HDC hDC, UINT uSource) + BOOL wglGetGenlockSampleRateI3D (HDC hDC, UINT* uRate) + BOOL wglGetGenlockSourceDelayI3D (HDC hDC, UINT* uDelay) + BOOL wglGetGenlockSourceEdgeI3D (HDC hDC, UINT* uEdge) + BOOL wglGetGenlockSourceI3D (HDC hDC, UINT* uSource) + BOOL wglIsEnabledGenlockI3D (HDC hDC, BOOL* pFlag) + BOOL wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_image_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_image_buffer new file mode 100644 index 0000000..fa4a66d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_image_buffer @@ -0,0 +1,9 @@ +WGL_I3D_image_buffer +http://www.opengl.org/registry/specs/I3D/wgl_image_buffer.txt +WGL_I3D_image_buffer + WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 + WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + BOOL wglAssociateImageBufferEventsI3D (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count) + LPVOID wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags) + BOOL wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress) + BOOL wglReleaseImageBufferEventsI3D (HDC hdc, LPVOID* pAddress, UINT count) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_lock b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_lock new file mode 100644 index 0000000..76cf91f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_lock @@ -0,0 +1,7 @@ +WGL_I3D_swap_frame_lock +http://www.opengl.org/registry/specs/I3D/wgl_swap_frame_lock.txt +WGL_I3D_swap_frame_lock + BOOL wglDisableFrameLockI3D (VOID) + BOOL wglEnableFrameLockI3D (VOID) + BOOL wglIsEnabledFrameLockI3D (BOOL* pFlag) + BOOL wglQueryFrameLockMasterI3D (BOOL* pFlag) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_usage b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_usage new file mode 100644 index 0000000..59546a5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_I3D_swap_frame_usage @@ -0,0 +1,7 @@ +WGL_I3D_swap_frame_usage +http://www.opengl.org/registry/specs/I3D/wgl_swap_frame_usage.txt +WGL_I3D_swap_frame_usage + BOOL wglBeginFrameTrackingI3D (void) + BOOL wglEndFrameTrackingI3D (void) + BOOL wglGetFrameUsageI3D (float* pUsage) + BOOL wglQueryFrameTrackingI3D (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop new file mode 100644 index 0000000..d08807e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop @@ -0,0 +1,14 @@ +WGL_NV_DX_interop +http://www.opengl.org/registry/specs/NV/DX_interop.txt +WGL_NV_DX_interop + WGL_ACCESS_READ_ONLY_NV 0x0000 + WGL_ACCESS_READ_WRITE_NV 0x0001 + WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + BOOL wglDXCloseDeviceNV (HANDLE hDevice) + BOOL wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE* hObjects) + BOOL wglDXObjectAccessNV (HANDLE hObject, GLenum access) + HANDLE wglDXOpenDeviceNV (void* dxDevice) + HANDLE wglDXRegisterObjectNV (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access) + BOOL wglDXSetResourceShareHandleNV (void* dxObject, HANDLE shareHandle) + BOOL wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE* hObjects) + BOOL wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop2 b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop2 new file mode 100644 index 0000000..93eb623 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_DX_interop2 @@ -0,0 +1,3 @@ +WGL_NV_DX_interop2 +http://www.opengl.org/registry/specs/NV/DX_interop2.txt +WGL_NV_DX_interop2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_copy_image b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_copy_image new file mode 100644 index 0000000..8b2a919 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_copy_image @@ -0,0 +1,4 @@ +WGL_NV_copy_image +http://www.opengl.org/registry/specs/NV/copy_image.txt +WGL_NV_copy_image + BOOL wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_float_buffer b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_float_buffer new file mode 100644 index 0000000..508e82e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_float_buffer @@ -0,0 +1,12 @@ +WGL_NV_float_buffer +http://www.opengl.org/registry/specs/NV/float_buffer.txt +WGL_NV_float_buffer + WGL_FLOAT_COMPONENTS_NV 0x20B0 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 + WGL_TEXTURE_FLOAT_R_NV 0x20B5 + WGL_TEXTURE_FLOAT_RG_NV 0x20B6 + WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 + WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_gpu_affinity b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_gpu_affinity new file mode 100644 index 0000000..f722204 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_gpu_affinity @@ -0,0 +1,12 @@ +WGL_NV_gpu_affinity +http://developer.download.nvidia.com/opengl/specs/WGL_nv_gpu_affinity.txt +WGL_NV_gpu_affinity + WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 + WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + BOOL wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu) + BOOL wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice) + HDC wglCreateAffinityDCNV (const HGPUNV *phGpuList) + BOOL wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu) + BOOL wglDeleteDCNV (HDC hdc) + DECLARE_HANDLE(HGPUNV); + typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_multisample_coverage b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_multisample_coverage new file mode 100644 index 0000000..c36ab46 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_multisample_coverage @@ -0,0 +1,5 @@ +WGL_NV_multisample_coverage +http://www.opengl.org/registry/specs/NV/multisample_coverage.txt +WGL_NV_multisample_coverage + WGL_COVERAGE_SAMPLES_NV 0x2042 + WGL_COLOR_SAMPLES_NV 0x20B9 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_present_video b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_present_video new file mode 100644 index 0000000..4e62467 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_present_video @@ -0,0 +1,8 @@ +WGL_NV_present_video +http://www.opengl.org/registry/specs/NV/present_video.txt +WGL_NV_present_video + WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + BOOL wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList) + int wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList) + BOOL wglQueryCurrentContextNV (int iAttribute, int* piValue) + DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_depth_texture b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_depth_texture new file mode 100644 index 0000000..c2e359a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_depth_texture @@ -0,0 +1,9 @@ +WGL_NV_render_depth_texture +http://www.opengl.org/registry/specs/NV/render_depth_texture.txt +WGL_NV_render_depth_texture + WGL_NO_TEXTURE_ARB 0x2077 + WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 + WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 + WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 + WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 + WGL_DEPTH_COMPONENT_NV 0x20A7 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_texture_rectangle b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_texture_rectangle new file mode 100644 index 0000000..ada7e7e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_render_texture_rectangle @@ -0,0 +1,6 @@ +WGL_NV_render_texture_rectangle +http://www.opengl.org/registry/specs/NV/render_texture_rectangle.txt +WGL_NV_render_texture_rectangle + WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 + WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 + WGL_TEXTURE_RECTANGLE_NV 0x20A2 diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_swap_group b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_swap_group new file mode 100644 index 0000000..c114a49 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_swap_group @@ -0,0 +1,9 @@ +WGL_NV_swap_group +http://www.opengl.org/registry/specs/NV/wgl_swap_group.txt +WGL_NV_swap_group + BOOL wglBindSwapBarrierNV (GLuint group, GLuint barrier) + BOOL wglJoinSwapGroupNV (HDC hDC, GLuint group) + BOOL wglQueryFrameCountNV (HDC hDC, GLuint* count) + BOOL wglQueryMaxSwapGroupsNV (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers) + BOOL wglQuerySwapGroupNV (HDC hDC, GLuint* group, GLuint *barrier) + BOOL wglResetFrameCountNV (HDC hDC) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_vertex_array_range b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_vertex_array_range new file mode 100644 index 0000000..ca22d31 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_vertex_array_range @@ -0,0 +1,5 @@ +WGL_NV_vertex_array_range +http://oss.sgi.com/projects/ogl-sample/registry/NV/vertex_array_range.txt +WGL_NV_vertex_array_range + void * wglAllocateMemoryNV (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority) + void wglFreeMemoryNV (void *pointer) diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_capture b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_capture new file mode 100644 index 0000000..b381472 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_capture @@ -0,0 +1,11 @@ +WGL_NV_video_capture +http://www.opengl.org/registry/specs/NV/video_capture.txt +WGL_NV_video_capture + WGL_UNIQUE_ID_NV 0x20CE + WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + BOOL wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice) + UINT wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList) + BOOL wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice) + BOOL wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue) + BOOL wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice) + DECLARE_HANDLE(HVIDEOINPUTDEVICENV); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_output b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_output new file mode 100644 index 0000000..87f243f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_NV_video_output @@ -0,0 +1,23 @@ +WGL_NV_video_output +http://www.opengl.org/registry/specs/NV/wgl_video_out.txt +WGL_NV_video_output + WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 + WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 + WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 + WGL_VIDEO_OUT_COLOR_NV 0x20C3 + WGL_VIDEO_OUT_ALPHA_NV 0x20C4 + WGL_VIDEO_OUT_DEPTH_NV 0x20C5 + WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 + WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 + WGL_VIDEO_OUT_FRAME 0x20C8 + WGL_VIDEO_OUT_FIELD_1 0x20C9 + WGL_VIDEO_OUT_FIELD_2 0x20CA + WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB + WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + BOOL wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer) + BOOL wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice) + BOOL wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo) + BOOL wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice) + BOOL wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer) + BOOL wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock) + DECLARE_HANDLE(HPVIDEODEV); diff --git a/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_OML_sync_control b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_OML_sync_control new file mode 100644 index 0000000..d3265c8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/extensions/WGL_OML_sync_control @@ -0,0 +1,9 @@ +WGL_OML_sync_control +http://www.opengl.org/registry/specs/OML/wgl_sync_control.txt +WGL_OML_sync_control + BOOL wglGetMscRateOML (HDC hdc, INT32* numerator, INT32 *denominator) + BOOL wglGetSyncValuesOML (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc) + INT64 wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder) + INT64 wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder) + BOOL wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc) + BOOL wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc) diff --git a/thirdparty/glew/glew-1.9.0/auto/lib/OpenGL/Spec.pm b/thirdparty/glew/glew-1.9.0/auto/lib/OpenGL/Spec.pm new file mode 100644 index 0000000..1311b39 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/lib/OpenGL/Spec.pm @@ -0,0 +1,202 @@ +package OpenGL::Spec; + +# A very simple task further complicated by the fact that some people +# can't read, others use legacy Operating Systems, and others don't give +# a damn about using a halfway decent text editor. +# +# The code to parse the _template_ is so simple and straightforward... +# yet the code to parse the real spec files is this mess. + +my %typemap = ( + bitfield => "GLbitfield", + boolean => "GLboolean", + # fsck up in EXT_vertex_array + Boolean => "GLboolean", + byte => "GLbyte", + clampd => "GLclampd", + clampf => "GLclampf", + double => "GLdouble", + enum => "GLenum", + # Intel fsck up + Glenum => "GLenum", + float => "GLfloat", + half => "GLuint", + int => "GLint", + short => "GLshort", + sizei => "GLsizei", + ubyte => "GLubyte", + uint => "GLuint", + ushort => "GLushort", + DMbuffer => "void *", + + # ARB VBO introduces these + sizeiptrARB => "GLsizeiptrARB", + intptrARB => "GLintptrARB", + + # ARB shader objects introduces these, charARB is at least 8 bits, + # handleARB is at least 32 bits + charARB => "GLcharARB", + handleARB => "GLhandleARB", + + # GLX 1.3 defines new types which might not be available at compile time + #GLXFBConfig => "void*", + #GLXFBConfigID => "XID", + #GLXContextID => "XID", + #GLXWindow => "XID", + #GLXPbuffer => "XID", + + # Weird stuff for some SGIX extension + #GLXFBConfigSGIX => "void*", + #GLXFBConfigIDSGIX => "XID", +); + +my %void_typemap = ( + void => "GLvoid", +); + +my $section_re = qr{^[A-Z]}; +my $function_re = qr{^(.+) ([a-z][a-z0-9_]*) \((.+)\)$}i; +my $token_re = qr{^([A-Z0-9][A-Z0-9_]*):?\s+((?:0x)?[0-9A-F]+)(.*)$}; +my $prefix_re = qr{^(?:AGL | GLX | WGL)_}x; +my $eofnc_re = qr{ \);?$ | ^$ }x; +my $function_re = qr{^(.+) ([a-z][a-z0-9_]*) \((.+)\)$}i; +my $prefix_re = qr{^(?:gl | agl | wgl | glX)}x; +my $types_re = __compile_wordlist_cap(keys %typemap); +my $voidtype_re = __compile_wordlist_cap(keys %void_typemap); + +sub new($) +{ + my $class = shift; + my $self = { section => {} }; + $self->{filename} = shift; + local $/; + open(my $fh, "<$self->{filename}") or die "Can't open $self->{filename}"; + my $content = <$fh>; + my $section; + my $s = $self->{section}; + + $content =~ s{[ \t]+$}{}mg; + # Join lines that end with a word-character and ones that *begin* + # with one + $content =~ s{(\w)\n(\w)}{$1 $2}sg; + + foreach (split /\n/, $content) + { + if (/$section_re/) + { + chomp; + s/^Name String$/Name Strings/; # Fix common mistake + $section = $_; + $s->{$section} = ""; + } + elsif (defined $section and exists $s->{$section}) + { + s{^\s+}{}mg; # Remove leading whitespace + $s->{$section} .= $_ . "\n"; + } + } + + $s->{$_} =~ s{(?:^\n+|\n+$)}{}s foreach keys %$s; + + bless $self, $class; +} + +sub sections() +{ + my $self = shift; + keys %{$self->{section}}; +} + +sub name() +{ + my $self = shift; + $self->{section}->{Name}; +} + +sub name_strings() +{ + my $self = shift; + split("\n", $self->{section}->{"Name Strings"}); +} + +sub tokens() +{ + my $self = shift; + my %tokens = (); + foreach (split /\n/, $self->{section}->{"New Tokens"}) + { + next unless /$token_re/; + my ($name, $value) = ($1, $2); + $name =~ s{^}{GL_} unless $name =~ /$prefix_re/; + $tokens{$name} = $value; + } + + return %tokens; +} + +sub functions() +{ + my $self = shift; + my %functions = (); + my @fnc = (); + + foreach (split /\n/, $self->{section}->{"New Procedures and Functions"}) + { + push @fnc, $_ unless ($_ eq "" or $_ eq "None"); + + next unless /$eofnc_re/; + + if (__normalize_proto(@fnc) =~ /$function_re/) + { + my ($return, $name, $parms) = ($1, $2, $3); + if (!__ignore_function($name, $extname)) + { + $name =~ s/^/gl/ unless $name =~ /$prefix_re/; + if ($name =~ /^gl/ && $name !~ /^glX/) + { + $return =~ s/$types_re/$typemap{$1}/g; + $return =~ s/$voidtype_re/$void_typemap{$1}/g; + $parms =~ s/$types_re/$typemap{$1}/g; + $parms =~ s/$voidtype_re/$void_typemap{$1}/g; + } + $functions{$name} = { + rtype => $return, + parms => $parms, + }; + } + } + @fnc = (); + } + + return %functions; +} + +sub __normalize_proto +{ + local $_ = join(" ", @_); + s/\s+/ /g; # multiple whitespace -> single space + s/\s*\(\s*/ \(/; # exactly one space before ( and none after + s/\s*\)\s*/\)/; # no after before or after ) + s/\s*\*([a-zA-Z])/\* $1/; # "* identifier" XXX: g missing? + s/\*wgl/\* wgl/; # "* wgl" XXX: why doesn't the + s/\*glX/\* glX/; # "* glX" previous re catch this? + s/\.\.\./void/; # ... -> void + s/;$//; # remove ; at the end of the line + return $_; +} + +sub __ignore_function +{ + return 0; +} + +sub __compile_regex +{ + my $regex = join('', @_); + return qr/$regex/ +} + +sub __compile_wordlist_cap +{ + __compile_regex('\b(', join('|', @_), ')\b'); +} diff --git a/thirdparty/glew/glew-1.9.0/auto/src/footer.html b/thirdparty/glew/glew-1.9.0/auto/src/footer.html new file mode 100644 index 0000000..3adb9c1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/footer.html @@ -0,0 +1,4 @@ + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew.rc b/thirdparty/glew/glew-1.9.0/auto/src/glew.rc new file mode 100644 index 0000000..5674cc9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew.rc @@ -0,0 +1,77 @@ + +#include + +#ifdef GLEW_MX +# ifdef GLEW_STATIC +# ifdef _DEBUG +# define FILENAME "glew32mxsd.dll" +# else +# define FILENAME "glew32mxs.dll" +# endif +# else +# ifdef _DEBUG +# define FILENAME "glew32mxd.dll" +# else +# define FILENAME "glew32mx.dll" +# endif +# endif +#else +# ifdef GLEW_STATIC +# ifdef _DEBUG +# define FILENAME "glew32sd.dll" +# else +# define FILENAME "glew32s.dll" +# endif +# else +# ifdef _DEBUG +# define FILENAME "glew32d.dll" +# else +# define FILENAME "glew32.dll" +# endif +# endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +#ifdef GLEW_STATIC +FILETYPE VFT_STATIC_LIB +#else +FILETYPE VFT_DLL +#endif +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "The OpenGL Extension Wrangler Library\r\nCopyright (C) 2002-2008, Milan Ikits \r\nCopyright (C) 2002-2008, Marcelo E. Magallon \r\nCopyright (C) 2002, Lev Povalahev\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without \r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, \r\n this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, \r\n this list of conditions and the following disclaimer in the documentation \r\n and/or other materials provided with the distribution.\r\n* The name of the author may be used to endorse or promote products \r\n derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' \r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\nTHE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n\r\nMesa 3-D graphics library\r\n\r\nVersion: 7.0\r\n\r\nCopyright (C) 1999-2007 Brian Paul All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a\r\ncopy of this software and associated documentation files (the ''Software''),\r\nto deal in the Software without restriction, including without limitation\r\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\r\nand/or sell copies of the Software, and to permit persons to whom the\r\nSoftware is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included\r\nin all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\r\nBRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n\r\nCopyright (c) 2007 The Khronos Group Inc.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a\r\ncopy of this software and/or associated documentation files (the\r\n''Materials''), to deal in the Materials without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Materials, and to\r\npermit persons to whom the Materials are furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included\r\nin all copies or substantial portions of the Materials.\r\n\r\nTHE MATERIALS ARE PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nMATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "The OpenGL Extension Wrangler Library\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "GLEW\0" + VALUE "LegalCopyright", "� 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_head.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_head.c new file mode 100644 index 0000000..d12e8c2 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_head.c @@ -0,0 +1,247 @@ +#include + +#if defined(_WIN32) +# include +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = dlopen("libRegal.dylib", RTLD_LAZY); +#else + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); +#endif + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#else + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#endif + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Define GLboolean const cast. + */ +#define CONST_CAST(x) (*(GLboolean*)&x) + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return (s[i] == '\0' || s[i] == c) ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_head.h b/thirdparty/glew/glew-1.9.0/auto/src/glew_head.h new file mode 100644 index 0000000..ac72d63 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_head.h @@ -0,0 +1,1105 @@ +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __GL_H__ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_init_gl.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_gl.c new file mode 100644 index 0000000..5f9bf65 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_gl.c @@ -0,0 +1,71 @@ +/* ------------------------------------------------------------------------- */ + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + start = (const GLubyte*)glGetString(GL_EXTENSIONS); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot; + GLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + CONST_CAST(GLEW_VERSION_4_3) = ( major > 4 ) || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + /* query opengl extensions string */ + extStart = glGetString(GL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte*)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_init_glx.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_glx.c new file mode 100644 index 0000000..f5b393b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_glx.c @@ -0,0 +1,53 @@ +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + break; + case 2: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_init_tail.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_tail.c new file mode 100644 index 0000000..90188bf --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_tail.c @@ -0,0 +1,57 @@ +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"GLEW_VERSION_STRING", + (const GLubyte*)"GLEW_VERSION_MAJOR_STRING", + (const GLubyte*)"GLEW_VERSION_MINOR_STRING", + (const GLubyte*)"GLEW_VERSION_MICRO_STRING" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum GLEWAPIENTRY wglewContextInit (void); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +extern GLenum GLEWAPIENTRY glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_init_wgl.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_wgl.c new file mode 100644 index 0000000..7e76099 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_init_wgl.c @@ -0,0 +1,41 @@ +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_license.h b/thirdparty/glew/glew-1.9.0/auto/src/glew_license.h new file mode 100644 index 0000000..5c3e781 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_license.h @@ -0,0 +1,31 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_str_glx.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_glx.c new file mode 100644 index 0000000..ea2ba36 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_glx.c @@ -0,0 +1,21 @@ + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__ANDROID__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_str_head.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_head.c new file mode 100644 index 0000000..ebeb48d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_head.c @@ -0,0 +1,13 @@ +#ifdef GLEW_MX +GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_str_tail.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_tail.c new file mode 100644 index 0000000..caa9572 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_tail.c @@ -0,0 +1,7 @@ + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_str_wgl.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_wgl.c new file mode 100644 index 0000000..20552bd --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_str_wgl.c @@ -0,0 +1,21 @@ + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_tail.h b/thirdparty/glew/glew-1.9.0/auto/src/glew_tail.h new file mode 100644 index 0000000..54023e3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_tail.h @@ -0,0 +1,74 @@ +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.c b/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.c new file mode 100644 index 0000000..e31f048 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.c @@ -0,0 +1,162 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#if defined(_WIN32) +# include +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include +#endif + +#include "glew_utils.h" + +#if defined(__APPLE__) +#include +#include +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + NSSymbol symbol; + char* symbolName; + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); + free(symbolName); + return symbol ? NSAddressOfSymbol(symbol) : NULL; +} +#endif /* __APPLE__ */ + +#if defined(__sgi) || defined (__sun) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun */ + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ + +GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + while (s+i != NULL && s[i] != '\0') i++; + return i; +} + +GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + while (s+i != NULL && s[i] != '\0' && s[i] != c) i++; + return i; +} + +GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + while (i < n && a+i != NULL && b+i != NULL && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + *a++; + *na--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; + if (i == nb && (*na == nb || *a[i] == ' ' || *a[i] == '\n' || *a[i] == '\r' || *a[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.h b/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.h new file mode 100644 index 0000000..e25d8b9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glew_utils.h @@ -0,0 +1,101 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef __glew_utils_h__ +#define __glew_utils_h__ + +#include +#if defined(_WIN32) +# include +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#else +# if defined(__APPLE__) + extern void* NSGLGetProcAddress (const GLubyte* name); +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +# else +# if defined(__sgi) || defined(__sun) + extern void* dlGetProcAddress (const GLubyte* name); +# define glewGetProcAddress(name) dlGetProcAddress(name) +# else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +# endif +# endif +#endif + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the string processing functionality required in the library. + */ +extern GLuint _glewStrLen (const GLubyte* s); +extern GLuint _glewStrCLen (const GLubyte* s, GLubyte c); +extern GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n); +extern GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb); +extern GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb); +extern GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) + +#endif /* __glew_utils_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glewinfo.rc b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo.rc new file mode 100644 index 0000000..60b001d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo.rc @@ -0,0 +1,57 @@ + +#include + +#ifdef GLEW_MX +# ifdef _DEBUG +# define FILENAME "glewinfo-mxd.exe" +# else +# define FILENAME "glewinfo-mx.exe" +# endif +#else +# ifdef _DEBUG +# define FILENAME "glewinfod.exe" +# else +# define FILENAME "glewinfo.exe" +# endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "The OpenGL Extension Wrangler Library\r\nCopyright (C) 2002-2008, Milan Ikits \r\nCopyright (C) 2002-2008, Marcelo E. Magallon \r\nCopyright (C) 2002, Lev Povalahev\r\nAll rights reserved.\r\n \r\nRedistribution and use in source and binary forms, with or without \r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, \r\n this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, \r\n this list of conditions and the following disclaimer in the documentation \r\n and/or other materials provided with the distribution.\r\n* The name of the author may be used to endorse or promote products \r\n derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' \r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\nTHE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nLicense Applicability. Except to the extent portions of this file are\r\nmade subject to an alternative license as permitted in the SGI Free\r\nSoftware License B, Version 1.1 (the 'License'), the contents of this\r\nfile are subject only to the provisions of the License. You may not use\r\nthis file except in compliance with the License. You may obtain a copy\r\nof the License at Silicon Graphics, Inc., attn: Legal Services, 1600\r\nAmphitheatre Parkway, Mountain View, CA 94043-1351, or at:\r\n\r\nhttp://oss.sgi.com/projects/FreeB\r\n\r\nNote that, as provided in the License, the Software is distributed on an\r\n'AS IS' basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS\r\nDISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND\r\nCONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A\r\nPARTICULAR PURPOSE, AND NON-INFRINGEMENT.\r\n\r\nOriginal Code. The Original Code is: OpenGL Sample Implementation,\r\nVersion 1.2.1, released January 26, 2000, developed by Silicon Graphics,\r\nInc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.\r\nCopyright in any portions created by third parties is as indicated\r\nelsewhere herein. All Rights Reserved.\r\n\r\nAdditional Notice Provisions: This software was created using the\r\nOpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has\r\nnot been independently verified as being compliant with the OpenGL(R)\r\nversion 1.2.1 Specification.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Utility for verifying extension entry points\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "glewinfo\0" + VALUE "LegalCopyright", "� 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_gl.c b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_gl.c new file mode 100644 index 0000000..9d7835d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_gl.c @@ -0,0 +1,7 @@ +/* ------------------------------------------------------------------------ */ + +static void glewInfo (void) +{ +#ifdef GL_VERSION_1_1 + _glewInfo_GL_VERSION_1_1(); +#endif /* GL_VERSION_1_1 */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_glx.c b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_glx.c new file mode 100644 index 0000000..287d7e1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_glx.c @@ -0,0 +1,6 @@ +} + +#else /* _UNIX */ + +static void glxewInfo () +{ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_head.c b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_head.c new file mode 100644 index 0000000..95a36a7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_head.c @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#if defined(_WIN32) +#include +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#include +#endif + +#ifdef GLEW_REGAL +#include +#endif + +static FILE* f; + +#ifdef GLEW_MX +GLEWContext _glewctx; +#define glewGetContext() (&_glewctx) +#ifdef _WIN32 +WGLEWContext _wglewctx; +#define wglewGetContext() (&_wglewctx) +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLXEWContext _glxewctx; +#define glxewGetContext() (&_glxewctx) +#endif +#endif + +#if defined(_WIN32) +GLboolean glewCreateContext (int* pixelformat); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewCreateContext (const char* display, int* visual); +#else +GLboolean glewCreateContext (); +#endif + +#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual); +#endif + +void glewDestroyContext (); + +/* ------------------------------------------------------------------------- */ + +static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3) +{ + unsigned int i; + fprintf(f, "\n%s:", name); + for (i=0; i<62-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s ", def1 ? "OK" : "MISSING"); + if (def1 != def2) + fprintf(f, "[%s] ", def2 ? "OK" : "MISSING"); + if (def1 != def3) + fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING"); + else + fprintf(f, "\n"); + for (i=0; i]\n"); +#else + fprintf(stderr, "Usage: glewinfo [-display ] [-visual ]\n"); +#endif + return 1; + } +#endif + +#if defined(_WIN32) + if (GL_TRUE == glewCreateContext(&visual)) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + if (GL_TRUE == glewCreateContext()) +#else + if (GL_TRUE == glewCreateContext(display, &visual)) +#endif + { + fprintf(stderr, "Error: glewCreateContext failed\n"); + glewDestroyContext(); + return 1; + } + glewExperimental = GL_TRUE; +#ifdef GLEW_MX + err = glewContextInit(glewGetContext()); +#ifdef _WIN32 + err = err || wglewContextInit(wglewGetContext()); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + err = err || glxewContextInit(glxewGetContext()); +#endif + +#else + err = glewInit(); +#endif + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + glewDestroyContext(); + return 1; + } +#if defined(_WIN32) + f = fopen("glewinfo.txt", "w"); + if (f == NULL) f = stdout; +#else + f = stdout; +#endif + fprintf(f, "---------------------------\n"); + fprintf(f, " GLEW Extension Info\n"); + fprintf(f, "---------------------------\n\n"); + fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); +#if defined(_WIN32) + fprintf(f, "Reporting capabilities of pixelformat %d\n", visual); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", + display == NULL ? getenv("DISPLAY") : display, visual); +#endif + fprintf(f, "Running on a %s from %s\n", + glGetString(GL_RENDERER), glGetString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION)); + glewInfo(); +#if defined(_WIN32) + wglewInfo(); +#else + glxewInfo(); +#endif + if (f != stdout) fclose(f); + glewDestroyContext(); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual) +{ + int p = 0; + while (p < argc) + { +#if defined(_WIN32) + if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + *display = 0; + *visual = strtol(argv[p++], NULL, 0); + } + else + return GL_TRUE; +#else + if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + *display = argv[p++]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + *visual = (int)strtol(argv[p++], NULL, 0); + } + else + return GL_TRUE; +#endif + } + return GL_FALSE; +} +#endif + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) + +HWND wnd = NULL; +HDC dc = NULL; +HGLRC rc = NULL; + +GLboolean glewCreateContext (int* pixelformat) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL); + if (NULL == wnd) return GL_TRUE; + /* get the device context */ + dc = GetDC(wnd); + if (NULL == dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (*pixelformat == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + *pixelformat = ChoosePixelFormat(dc, &pfd); + if (*pixelformat == 0) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(dc, *pixelformat, &pfd)) return GL_TRUE; + /* create rendering context */ + rc = wglCreateContext(dc); + if (NULL == rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != rc) wglMakeCurrent(NULL, NULL); + if (NULL != rc) wglDeleteContext(rc); + if (NULL != wnd && NULL != dc) ReleaseDC(wnd, dc); + if (NULL != wnd) DestroyWindow(wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#include + +AGLContext ctx, octx; + +GLboolean glewCreateContext () +{ + int attrib[] = { AGL_RGBA, AGL_NONE }; + AGLPixelFormat pf; + /*int major, minor; + SetPortWindowPort(wnd); + aglGetVersion(&major, &minor); + fprintf(stderr, "GL %d.%d\n", major, minor);*/ + pf = aglChoosePixelFormat(NULL, 0, attrib); + if (NULL == pf) return GL_TRUE; + ctx = aglCreateContext(pf, NULL); + if (NULL == ctx || AGL_NO_ERROR != aglGetError()) return GL_TRUE; + aglDestroyPixelFormat(pf); + /*aglSetDrawable(ctx, GetWindowPort(wnd));*/ + octx = aglGetCurrentContext(); + if (GL_FALSE == aglSetCurrentContext(ctx)) return GL_TRUE; + /* Needed for Regal on the Mac */ + #if defined(GLEW_REGAL) && defined(__APPLE__) + RegalMakeCurrent(octx); + #endif + return GL_FALSE; +} + +void glewDestroyContext () +{ + aglSetCurrentContext(octx); + if (NULL != ctx) aglDestroyContext(ctx); +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +Display* dpy = NULL; +XVisualInfo* vi = NULL; +XVisualInfo* vis = NULL; +GLXContext ctx = NULL; +Window wnd = 0; +Colormap cmap = 0; + +GLboolean glewCreateContext (const char* display, int* visual) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* open display */ + dpy = XOpenDisplay(display); + if (NULL == dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + if (*visual == -1) + { + vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib); + if (NULL == vi) return GL_TRUE; + *visual = (int)XVisualIDFromVisual(vi->visual); + } + else + { + int n_vis, i; + vis = XGetVisualInfo(dpy, 0, NULL, &n_vis); + for (i=0; iscreen), 0, 0, 1, 1, 1, 0, 0);*/ + cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = cmap; + wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen), + 0, 0, 1, 1, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); + if (NULL != dpy && 0 != wnd) XDestroyWindow(dpy, wnd); + if (NULL != dpy && 0 != cmap) XFreeColormap(dpy, cmap); + if (NULL != vis) + XFree(vis); + else if (NULL != vi) + XFree(vi); + if (NULL != dpy) XCloseDisplay(dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_wgl.c b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_wgl.c new file mode 100644 index 0000000..61f101a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glewinfo_wgl.c @@ -0,0 +1,8 @@ +} + +/* ------------------------------------------------------------------------ */ + +#ifdef _WIN32 + +static void wglewInfo () +{ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glxew_head.h b/thirdparty/glew/glew-1.9.0/auto/src/glxew_head.h new file mode 100644 index 0000000..16fdfa4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glxew_head.h @@ -0,0 +1,106 @@ +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glxew_mid.h b/thirdparty/glew/glew-1.9.0/auto/src/glxew_mid.h new file mode 100644 index 0000000..cfcd20d --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glxew_mid.h @@ -0,0 +1,9 @@ +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT +#else +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/glxew_tail.h b/thirdparty/glew/glew-1.9.0/auto/src/glxew_tail.h new file mode 100644 index 0000000..39e9953 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/glxew_tail.h @@ -0,0 +1,30 @@ +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/header.html b/thirdparty/glew/glew-1.9.0/auto/src/header.html new file mode 100644 index 0000000..d93f9e9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/header.html @@ -0,0 +1,99 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/khronos_license.h b/thirdparty/glew/glew-1.9.0/auto/src/khronos_license.h new file mode 100644 index 0000000..420cd72 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/khronos_license.h @@ -0,0 +1,23 @@ +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/mesa_license.h b/thirdparty/glew/glew-1.9.0/auto/src/mesa_license.h new file mode 100644 index 0000000..3350cca --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/mesa_license.h @@ -0,0 +1,24 @@ +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/visualinfo.rc b/thirdparty/glew/glew-1.9.0/auto/src/visualinfo.rc new file mode 100644 index 0000000..2373944 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/visualinfo.rc @@ -0,0 +1,57 @@ + +#include + +#ifdef GLEW_MX +# ifdef _DEBUG +# define FILENAME "visualinfo-mxd.exe" +# else +# define FILENAME "visualinfo-mx.exe" +# endif +#else +# ifdef _DEBUG +# define FILENAME "visualinfod.exe" +# else +# define FILENAME "visualinfo.exe" +# endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +VS_VERSION_INFO VERSIONINFO +FILEVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +PRODUCTVERSION GLEW_MAJOR, GLEW_MINOR, GLEW_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0x0L +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "The OpenGL Extension Wrangler Library\r\nCopyright (C) 2002-2008, Milan Ikits \r\nCopyright (C) 2002-2008, Marcelo E. Magallon \r\nCopyright (C) 2002, Lev Povalahev\r\nAll rights reserved.\r\n \r\nRedistribution and use in source and binary forms, with or without \r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, \r\n this list of conditions and the following disclaimer.\r\n* Redistributions in binary form must reproduce the above copyright notice, \r\n this list of conditions and the following disclaimer in the documentation \r\n and/or other materials provided with the distribution.\r\n* The name of the author may be used to endorse or promote products \r\n derived from this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' \r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \r\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \r\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\r\nTHE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nLicense Applicability. Except to the extent portions of this file are\r\nmade subject to an alternative license as permitted in the SGI Free\r\nSoftware License B, Version 1.1 (the 'License'), the contents of this\r\nfile are subject only to the provisions of the License. You may not use\r\nthis file except in compliance with the License. You may obtain a copy\r\nof the License at Silicon Graphics, Inc., attn: Legal Services, 1600\r\nAmphitheatre Parkway, Mountain View, CA 94043-1351, or at:\r\n\r\nhttp://oss.sgi.com/projects/FreeB\r\n\r\nNote that, as provided in the License, the Software is distributed on an\r\n'AS IS' basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS\r\nDISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND\r\nCONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A\r\nPARTICULAR PURPOSE, AND NON-INFRINGEMENT.\r\n\r\nOriginal Code. The Original Code is: OpenGL Sample Implementation,\r\nVersion 1.2.1, released January 26, 2000, developed by Silicon Graphics,\r\nInc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.\r\nCopyright in any portions created by third parties is as indicated\r\nelsewhere herein. All Rights Reserved.\r\n\r\nAdditional Notice Provisions: This software was created using the\r\nOpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has\r\nnot been independently verified as being compliant with the OpenGL(R)\r\nversion 1.2.1 Specification.\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "Utility for listing pixelformat capabilities\0" + VALUE "FileVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "InternalName", "visualinfo\0" + VALUE "LegalCopyright", "� 2002-2008 Milan Ikits & Marcelo Magallon\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", FILENAME "\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "The OpenGL Extension Wrangler Library\0" + VALUE "ProductVersion", "GLEW_MAJOR,GLEW_MINOR,GLEW_MICRO,0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/thirdparty/glew/glew-1.9.0/auto/src/wglew_head.h b/thirdparty/glew/glew-1.9.0/auto/src/wglew_head.h new file mode 100644 index 0000000..df88503 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/wglew_head.h @@ -0,0 +1,36 @@ +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + diff --git a/thirdparty/glew/glew-1.9.0/auto/src/wglew_mid.h b/thirdparty/glew/glew-1.9.0/auto/src/wglew_mid.h new file mode 100644 index 0000000..a0a5ade --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/wglew_mid.h @@ -0,0 +1,9 @@ +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ diff --git a/thirdparty/glew/glew-1.9.0/auto/src/wglew_tail.h b/thirdparty/glew/glew-1.9.0/auto/src/wglew_tail.h new file mode 100644 index 0000000..9bbe945 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/auto/src/wglew_tail.h @@ -0,0 +1,32 @@ +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/bin/32bit/glew32.dll b/thirdparty/glew/glew-1.9.0/bin/32bit/glew32.dll new file mode 100644 index 0000000..53c041d Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/bin/32bit/glew32.dll differ diff --git a/thirdparty/glew/glew-1.9.0/bin/32bit/glew32mx.dll b/thirdparty/glew/glew-1.9.0/bin/32bit/glew32mx.dll new file mode 100644 index 0000000..ddd865f Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/bin/32bit/glew32mx.dll differ diff --git a/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll b/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll new file mode 100644 index 0000000..3a21d79 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll differ diff --git a/thirdparty/glew/glew-1.9.0/bin/64bit/glew32mx.dll b/thirdparty/glew/glew-1.9.0/bin/64bit/glew32mx.dll new file mode 100644 index 0000000..a010d0e Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/bin/64bit/glew32mx.dll differ diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.cygming b/thirdparty/glew/glew-1.9.0/config/Makefile.cygming new file mode 100644 index 0000000..afdd851 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.cygming @@ -0,0 +1,25 @@ +NAME = glew32 +GLEW_DEST = /usr +BINDIR = /usr/bin +LIBDIR = /usr/lib/mingw +INCDIR = /usr/include/mingw/GL +# use gcc for linking, with ld it does not work +CC := gcc -mno-cygwin +LD := gcc -mno-cygwin +LN := +CFLAGS.SO = -DGLEW_BUILD +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = -L$(LIBDIR) +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) +LIB.SONAME.MX = lib$(NAME)mx.dll +LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib +LIB.SHARED.MX = $(NAME)mx.dll +LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.cygwin b/thirdparty/glew/glew-1.9.0/config/Makefile.cygwin new file mode 100644 index 0000000..b044273 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.cygwin @@ -0,0 +1,24 @@ +NAME = GLEW +GLEW_DEST ?= /usr +# use gcc for linking, with ld it does not work +CC := cc +LD := cc +LN := +LDFLAGS.EXTRA = +LIBDIR = $(GLEW_DEST)/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = cyg$(NAME)-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.DEVLNK = lib$(NAME).dll.a +LIB.SHARED = cyg$(NAME)-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK) +LIB.SONAME.MX = cyg$(NAME)mx-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.DEVLNK.MX = lib$(NAME)mx.dll.a +LIB.SHARED.MX = cyg$(NAME)mx-$(GLEW_MAJOR)-$(GLEW_MINOR).dll +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.darwin b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin new file mode 100644 index 0000000..f6f86ed --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin @@ -0,0 +1,28 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA = -dynamic -fno-common +#CFLAGS.EXTRA += -no-cpp-precomp +PICFLAG = -fPIC +LDFLAGS.EXTRA = +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11 +else +LDFLAGS.GL = -framework AGL -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) +LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib +LIB.DEVLNK.MX = lib$(NAME)mx.dylib +LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-ppc b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-ppc new file mode 100644 index 0000000..1162998 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-ppc @@ -0,0 +1,28 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA = -arch ppc -dynamic -fno-common +#CFLAGS.EXTRA += -no-cpp-precomp +PICFLAG = -fPIC +LDFLAGS.EXTRA = -arch ppc +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11 +else +LDFLAGS.GL = -framework AGL -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) +LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib +LIB.DEVLNK.MX = lib$(NAME)mx.dylib +LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-x86_64 b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-x86_64 new file mode 100644 index 0000000..18ab312 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.darwin-x86_64 @@ -0,0 +1,28 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +CFLAGS.EXTRA = -arch x86_64 -dynamic -fno-common +#CFLAGS.EXTRA += -no-cpp-precomp +PICFLAG = -fPIC +LDFLAGS.EXTRA = -arch x86_64 +ifneq (undefined, $(origin GLEW_APPLE_GLX)) +CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX' +LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGL -lXext -lX11 +else +LDFLAGS.GL = -framework AGL -framework OpenGL +endif +LDFLAGS.STATIC = +LDFLAGS.DYNAMIC = +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib +LIB.DEVLNK = lib$(NAME).dylib +LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) +LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib +LIB.DEVLNK.MX = lib$(NAME)mx.dylib +LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.fedora-mingw32 b/thirdparty/glew/glew-1.9.0/config/Makefile.fedora-mingw32 new file mode 100644 index 0000000..f27db34 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.fedora-mingw32 @@ -0,0 +1,11 @@ +# For cross-compiling from Linux to Windows x86 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=fedora-mingw32 +# + +include config/Makefile.linux-mingw32 + +CC := i686-pc-mingw32-gcc +LD := i686-pc-mingw32-ld +LDFLAGS.GL += -L/usr/i686-pc-mingw32/sys-root/mingw/lib diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.freebsd b/thirdparty/glew/glew-1.9.0/config/Makefile.freebsd new file mode 100644 index 0000000..ab9d9d9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.freebsd @@ -0,0 +1,22 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I/usr/X11R6/include +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.gnu b/thirdparty/glew/glew-1.9.0/config/Makefile.gnu new file mode 100644 index 0000000..09b7230 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.gnu @@ -0,0 +1,22 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +PICFLAG = -fPIC +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.irix b/thirdparty/glew/glew-1.9.0/config/Makefile.irix new file mode 100644 index 0000000..a1be5ee --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.irix @@ -0,0 +1,22 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +ABI = -64# -n32 +CC += $(ABI) +LD += $(ABI) +LDFLAGS.EXTRA = +LDFLAGS.GL = -lGL -lXext -lX11 +NAME = GLEW +WARN = -fullwarn -woff 1110,1498 +POPT = -O2 -OPT:Olimit=0 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.kfreebsd b/thirdparty/glew/glew-1.9.0/config/Makefile.kfreebsd new file mode 100644 index 0000000..b3747e1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.kfreebsd @@ -0,0 +1,22 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +PICFLAG = -fPIC +LDFLAGS.EXTRA = -L/usr/X11R6/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname $(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -Wl,-soname $(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.linux b/thirdparty/glew/glew-1.9.0/config/Makefile.linux new file mode 100644 index 0000000..b9f5181 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.linux @@ -0,0 +1,29 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = cc +PICFLAG = -fPIC +M_ARCH ?= $(shell uname -m) +ifeq (x86_64,${M_ARCH}) +LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64 +LIBDIR = $(GLEW_DEST)/lib64 +else +LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib +LIBDIR = $(GLEW_DEST)/lib +endif +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw32 b/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw32 new file mode 100644 index 0000000..d9573a7 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw32 @@ -0,0 +1,26 @@ +# For cross-compiling from Linux to Windows x86 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=linux-mingw32 +# + +NAME := glew32 +CC := i586-mingw32msvc-gcc +LD := i586-mingw32msvc-ld +LN := +STRIP := +CFLAGS.SO = -DGLEW_BUILD +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) +LIB.SONAME.MX = lib$(NAME)mx.dll +LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib +LIB.SHARED.MX = $(NAME)mx.dll +LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) --out-implib lib/$(LIB.DEVLNK.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw64 b/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw64 new file mode 100644 index 0000000..6093351 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.linux-mingw64 @@ -0,0 +1,26 @@ +# For cross-compiling from Linux to Windows amd64 using mingw32 +# http://www.mingw.org/ +# +# $ make SYSTEM=linux-mingw64 +# + +NAME := glew32 +CC := amd64-mingw32msvc-gcc +LD := amd64-mingw32msvc-ld +LN := +STRIP := +CFLAGS.SO = -DGLEW_BUILD +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO = -shared -soname $(LIB.SONAME) --out-implib lib/$(LIB.DEVLNK) +LIB.SONAME.MX = lib$(NAME)mx.dll +LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib +LIB.SHARED.MX = $(NAME)mx.dll +LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) --out-implib lib/$(LIB.DEVLNK.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.mingw b/thirdparty/glew/glew-1.9.0/config/Makefile.mingw new file mode 100644 index 0000000..e74fd3c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.mingw @@ -0,0 +1,21 @@ +NAME = glew32 +# use gcc for linking, with ld it does not work +CC := gcc +LD := gcc +LN := +CFLAGS.SO = -DGLEW_BUILD +LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 +LDFLAGS.EXTRA = -L/mingw/lib +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = .exe +LIB.SONAME = lib$(NAME).dll +LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib +LIB.SHARED = $(NAME).dll +LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) +LIB.SONAME.MX = lib$(NAME)mx.dll +LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib +LIB.SHARED.MX = $(NAME)mx.dll +LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO) +LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.netbsd b/thirdparty/glew/glew-1.9.0/config/Makefile.netbsd new file mode 100644 index 0000000..5f69cd6 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.netbsd @@ -0,0 +1,22 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +LDFLAGS.EXTRA = -L/usr/X11R7/lib -R /usr/X11R7/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +LDFLAGS.STATIC = -Wl,-Bstatic +LDFLAGS.DYNAMIC = -Wl,-Bdynamic +CFLAGS.EXTRA += -I/usr/X11R7/include -fPIC +NAME = GLEW +WARN = -Wall -W +POPT = -O2 +BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -soname $(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -soname $(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.solaris b/thirdparty/glew/glew-1.9.0/config/Makefile.solaris new file mode 100644 index 0000000..befba5a --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.solaris @@ -0,0 +1,18 @@ +NAME = $(GLEW_NAME) +CC = cc +LD = ld +CFLAGS.EXTRA = -I/usr/openwin/include +LDFLAGS.SO = -G +LDFLAGS.EXTRA = -L/usr/openwin/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +NAME = GLEW +BIN.SUFFIX = +POPT = -xO2 +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a diff --git a/thirdparty/glew/glew-1.9.0/config/Makefile.solaris-gcc b/thirdparty/glew/glew-1.9.0/config/Makefile.solaris-gcc new file mode 100644 index 0000000..c0373f4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/Makefile.solaris-gcc @@ -0,0 +1,20 @@ +NAME = $(GLEW_NAME) +CC = gcc +LD = ld +CFLAGS.EXTRA = -I/usr/openwin/include +LDFLAGS.SO = -G +LDFLAGS.EXTRA = -L/usr/openwin/lib +LDFLAGS.GL = -lXmu -lXi -lGL -lXext -lX11 +NAME = GLEW +BIN.SUFFIX = +POPT = -O2 +LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(SO_VERSION) +LIB.STATIC = lib$(NAME).a +LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) +LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR) +LIB.DEVLNK.MX = lib$(NAME)mx.so +LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION) +LIB.STATIC.MX = lib$(NAME)mx.a +LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX) diff --git a/thirdparty/glew/glew-1.9.0/config/config.guess b/thirdparty/glew/glew-1.9.0/config/config.guess new file mode 100644 index 0000000..116b959 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/config.guess @@ -0,0 +1,1523 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# 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. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# 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 + +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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +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 + +# 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=`(/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 ;; + *) 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*|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 + # 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}" + 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 /* 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 + + 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/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + 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 + #include + + 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 + 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 ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*: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-gnu`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/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + 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="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + 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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + 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' /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 + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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 ;; + 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 + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + 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 + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + 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 + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < 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/thirdparty/glew/glew-1.9.0/config/version b/thirdparty/glew/glew-1.9.0/config/version new file mode 100644 index 0000000..53a0fc5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/config/version @@ -0,0 +1,7 @@ +GLEW_MAJOR = 1 +GLEW_MINOR = 9 +GLEW_MICRO = 0 +GLEW_VERSION = $(GLEW_MAJOR).$(GLEW_MINOR).$(GLEW_MICRO) +GLEW_NAME = GLEW +SO_MAJOR = $(GLEW_MAJOR).$(GLEW_MINOR) +SO_VERSION = $(GLEW_VERSION) diff --git a/thirdparty/glew/glew-1.9.0/doc/advanced.html b/thirdparty/glew/glew-1.9.0/doc/advanced.html new file mode 100644 index 0000000..1607d01 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/advanced.html @@ -0,0 +1,272 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Automatic Code Generation

    + +

    +Starting from release 1.1.0, the source code and parts of the +documentation are automatically generated from the extension +specifications in a two-step process. In the first step, +specification files from the OpenGL registry are downloaded and +parsed. Skeleton descriptors are created for each extension. These +descriptors contain all necessary information for creating the source +code and documentation in a simple and compact format, including the +name of the extension, url link to the specification, tokens, function +declarations, typedefs and struct definitions. In the second step, +the header files as well as the library and glewinfo source are +generated from the descriptor files. The code generation scripts are +located in the auto subdirectory. +

    + +

    +The code generation scripts require GNU make, wget, and perl. On +Windows, the simplest way to get access to these tools is to install +Cygwin, but make sure that the +root directory is mounted in binary mode. The makefile in the +auto directory provides the following build targets: +

    + + + + + + + + + + + + +
    makeCreate the source files from the descriptors.
    If the +descriptors do not exist, create them from the spec files.
    If the spec +files do not exist, download them from the OpenGL repository.
    make cleanDelete the source files.
    make clobberDelete the source files and the descriptors.
    make destroyDelete the source files, the descriptors, and the spec files.
    make customCreate the source files for the extensions +listed in auto/custom.txt.
    See "Custom Code +Generation" below for more details.
    + +

    Adding a New Extension

    + +

    +To add a new extension, create a descriptor file for the extension in +auto/core and rerun the code generation scripts by typing +make clean; make in the auto directory. +

    + +

    +The format of the descriptor file is given below. Items in +brackets are optional. +

    + +

    +<Extension Name>
    +[<URL of Specification File>]
    +    [<Token Name> <Token Value>]
    +    [<Token Name> <Token Value>]
    +    ...
    +    [<Typedef>]
    +    [<Typedef>]
    +    ...
    +    [<Function Signature>]
    +    [<Function Signature>]
    +    ...
    + +

    + + + +

    +Take a look at one of the files in auto/core for an +example. Note that typedefs and function signatures should not be +terminated with a semicolon. +

    + +

    Custom Code Generation

    +

    +Starting from GLEW 1.3.0, it is possible to control which extensions +to include in the libarary by specifying a list in +auto/custom.txt. This is useful when you do not need all the +extensions and would like to reduce the size of the source files. +Type make clean; make custom in the auto directory +to rerun the scripts with the custom list of extensions. +

    + +

    +For example, the following is the list of extensions needed to get GLEW and the +utilities to compile. +

    + +

    +WGL_ARB_extensions_string
    +WGL_ARB_multisample
    +WGL_ARB_pixel_format
    +WGL_ARB_pbuffer
    +WGL_EXT_extensions_string
    +WGL_ATI_pixel_format_float
    +WGL_NV_float_buffer
    +

    + +

    Multiple Rendering Contexts (GLEW MX)

    + +

    Starting with release 1.2.0, thread-safe support for multiple +rendering contexts, possibly with different capabilities, is +available. Since this is not required by most users, it is not added +to the binary releases to maintain compatibility between different +versions. To include multi-context support, you have to do the +following:

    +
      +
    1. Compile and use GLEW with the GLEW_MX preprocessor token +defined.
    2. +
    3. For each rendering context, create a GLEWContext object +that will be available as long as the rendering context exists.
    4. +
    5. Define a macro or function called glewGetContext() that +returns a pointer to the GLEWContext object associated with +the rendering context from which OpenGL/WGL/GLX calls are issued. This +dispatch mechanism is primitive, but generic. +
    6. Make sure that you call glewInit() after creating the +GLEWContext object in each rendering context. Note, that the +GLEWContext pointer returned by glewGetContext() has +to reside in global or thread-local memory. +
    + +

    Note that according to the MSDN +WGL documentation, you have to initialize the entry points for +every rendering context that use pixel formats with different +capabilities For example, the pixel formats provided by the generic +software OpenGL implementation by Microsoft vs. the hardware +accelerated pixel formats have different capabilities. GLEW by +default ignores this requirement, and does not define per-context +entry points (you can however do this using the steps described +above). Assuming a global namespace for the entry points works in +most situations, because typically all hardware accelerated pixel +formats provide the same entry points and capabilities. This means +that unless you use the multi-context version of GLEW, you need to +call glewInit() only once in your program, or more precisely, +once per process.

    + +

    Separate Namespace

    + +

    +To avoid name clashes when linking with libraries that include the +same symbols, extension entry points are declared in a separate +namespace (release 1.1.0 and up). This is achieved by aliasing OpenGL +function names to their GLEW equivalents. For instance, +glFancyFunction is simply an alias to +glewFancyFunction. The separate namespace does not effect +token and function pointer definitions. +

    + +

    Known Issues

    + +

    +GLEW requires GLX 1.2 for compatibility with GLUT. +

    + + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/basic.html b/thirdparty/glew/glew-1.9.0/doc/basic.html new file mode 100644 index 0000000..3283ce9 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/basic.html @@ -0,0 +1,283 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Initializing GLEW

    +

    +First you need to create a valid OpenGL rendering context and call +glewInit() to initialize the extension entry points. If +glewInit() returns GLEW_OK, the initialization +succeeded and you can use the available extensions as well as core +OpenGL functionality. For example: +

    + +

    +#include <GL/glew.h>
    +#include <GL/glut.h>
    +...
    +glutInit(&argc, argv);
    +glutCreateWindow("GLEW Test");
    +GLenum err = glewInit();
    +if (GLEW_OK != err)
    +{
    +  /* Problem: glewInit failed, something is seriously wrong. */
    +  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
    +  ...
    +}
    +fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
    +

    + +

    Checking for Extensions

    + +

    +Starting from GLEW 1.1.0, you can find out if a particular extension +is available on your platform by querying globally defined variables +of the form GLEW_{extension_name}: +

    + +

    +if (GLEW_ARB_vertex_program)
    +{
    +  /* It is safe to use the ARB_vertex_program extension here. */
    +  glGenProgramsARB(...);
    +}
    +

    + +

    +In GLEW 1.0.x, a global structure was used for this task. To ensure +binary compatibility between releases, the struct was replaced with a +set of variables. +

    + +

    +You can also check for core OpenGL functionality. For example, to +see if OpenGL 1.3 is supported, do the following: +

    + +

    +if (GLEW_VERSION_1_3)
    +{
    +  /* Yay! OpenGL 1.3 is supported! */
    +}
    +

    + +

    +In general, you can check if GLEW_{extension_name} or +GLEW_VERSION_{version} is true or false. +

    + +

    +It is also possible to perform extension checks from string +input. Starting from the 1.3.0 release, use glewIsSupported +to check if the required core or extension functionality is +available: +

    + +

    +if (glewIsSupported("GL_VERSION_1_4  GL_ARB_point_sprite"))
    +{
    +  /* Great, we have OpenGL 1.4 + point sprites. */
    +}
    +

    + +

    +For extensions only, glewGetExtension provides a slower alternative +(GLEW 1.0.x-1.2.x). Note that in the 1.3.0 release +glewGetExtension was replaced with +glewIsSupported. +

    + +

    +if (glewGetExtension("GL_ARB_fragment_program"))
    +{
    +  /* Looks like ARB_fragment_program is supported. */
    +}
    +

    + +

    Experimental Drivers

    + +

    +GLEW obtains information on the supported extensions from the graphics +driver. Experimental or pre-release drivers, however, might not +report every available extension through the standard mechanism, in +which case GLEW will report it unsupported. To circumvent this +situation, the glewExperimental global switch can be turned +on by setting it to GL_TRUE before calling +glewInit(), which ensures that all extensions with valid +entry points will be exposed. +

    + +

    Platform Specific Extensions

    + +

    +Platform specific extensions are separated into two header files: +wglew.h and glxew.h, which define the available +WGL and GLX extensions. To determine if a certain +extension is supported, query WGLEW_{extension name} or +GLXEW_{extension_name}. For example: +

    + +

    +#include <GL/wglew.h>
    +
    +if (WGLEW_ARB_pbuffer)
    +{
    +  /* OK, we can use pbuffers. */
    +}
    +else
    +{
    +  /* Sorry, pbuffers will not work on this platform. */
    +}
    +

    + +

    +Alternatively, use wglewIsSupported or +glxewIsSupported to check for extensions from a string: +

    + +

    +if (wglewIsSupported("WGL_ARB_pbuffer"))
    +{
    +  /* OK, we can use pbuffers. */
    +}
    +

    + +

    Utilities

    + +

    +GLEW provides two command-line utilities: one for creating a list of +available extensions and visuals; and another for verifying extension +entry points. +

    + +

    visualinfo: extensions and visuals

    + +

    +visualinfo is an extended version of glxinfo. The +Windows version creates a file called visualinfo.txt, which +contains a list of available OpenGL, WGL, and GLU extensions as well +as a table of visuals aka. pixel formats. Pbuffer and MRT capable +visuals are also included. For additional usage information, type +visualinfo -h. +

    + +

    glewinfo: extension verification utility

    + +

    +glewinfo allows you to verify the entry points for the +extensions supported on your platform. The Windows version +reports the results to a text file called glewinfo.txt. The +Unix version prints the results to stdout. +

    + +

    Windows usage:

    +
    glewinfo [-pf <id>]
    + +

    where <id> is the pixel format id for which the +capabilities are displayed.

    + +

    Unix usage:

    +
    glewinfo [-display <dpy>] [-visual <id>]
    + +

    where <dpy> is the X11 display and <id> is +the visual id for which the capabilities are displayed.

    + + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/credits.html b/thirdparty/glew/glew-1.9.0/doc/credits.html new file mode 100644 index 0000000..28d0b3f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/credits.html @@ -0,0 +1,128 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Credits

    + +

    +GLEW was developed by Milan +Ikits and Marcelo +Magallon. They also perform occasional maintainance to make sure +that GLEW stays in mint condition. Aaron Lefohn, Joe Kniss, and Chris +Wyman were the first users and also assisted with the design and +debugging process. The acronym GLEW originates from Aaron Lefohn. +Pasi Kärkkäinen identified and fixed several problems with +GLX and SDL. Nate Robins created the wglinfo utility, to +which modifications were made by Michael Wimmer. +

    + +

    Copyright

    + +

    +GLEW is originally derived from the EXTGL project by Lev Povalahev. +The source code is licensed under the Modified BSD +License, the Mesa 3-D License (MIT +License), and the Khronos License (MIT +License). The automatic code generation scripts are released under +the GNU GPL. +

    + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/glew.css b/thirdparty/glew/glew-1.9.0/doc/glew.css new file mode 100644 index 0000000..1bb7dd1 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/glew.css @@ -0,0 +1,187 @@ +h1 +{ + color: black; + font: 23px "Verdana", "Arial", "Helvetica", sans-serif; + font-weight: bold; + text-align: center; + margin-top: 12px; + margin-bottom: 18px; +} + +h2 +{ + color: black; + font: 18px "Verdana", "Arial", "Helvetica", sans-serif; + font-weight: bold; + text-align: left; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 18px; + margin-bottom: 12px; +} + +h3 +{ + color: black; + font: 17px "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; + padding-top: 0px; + padding-bottom: 0px; + margin-top: 12px; + margin-bottom: 12px; +} + +small +{ + font: 8pt "Verdana", "Arial", "Helvetica", sans-serif; +} + +body +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; +} + +td +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; +} + +tt +{ + color: rgb(0,120,0); +} +/* color: maroon; */ + +td.num +{ + color: lightgrey; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: right; +} + +blockquote +{ + color: rgb(0,120,0); + background: #f0f0f0; + text-align: left; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 6px; + padding-bottom: 0px; + margin-top: 0px; + padding-top: 0px; + border-top: 0px; + border-width: 0px; +} + +pre +{ + color: rgb(0,120,0); + background: #f0f0f0; + text-align: left; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 6px; + padding-bottom: 0px; + margin-top: 0px; + padding-top: 0px; + border-top: 0px; + border-width: 0px; +} + +p +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: left; + margin-bottom: 0px; + padding-bottom: 6px; + margin-top: 0px; + padding-top: 0px; +} + +p.right +{ + color: black; + font: 10pt "Verdana", "Arial", "Helvetica", sans-serif; + text-align: right; + margin-bottom: 0px; + padding-bottom: 6px; + margin-top: 0px; + padding-top: 0px; +} + +p.pre +{ + color: rgb(0,120,0); + font: 10pt "Courier New", "Courier", monospace; + background: #f0f0f0; + text-align: left; + margin-top: 0px; + margin-bottom: 6px; + margin-left: 40px; + margin-right: 40px; + padding-top: 0px; + padding-bottom: 6px; + padding-left: 6px; + padding-right: 6px; + border-top: 0px; + border-width: 0px; +} + +a:link +{ + color: rgb(0,0,139); + text-decoration: none; +} + +a:visited +{ + color: rgb(220,20,60); + text-decoration: none; +} + +a:hover +{ + color: rgb(220,20,60); + text-decoration: underline; + background: "#e8e8e8"; +} + +ul +{ + list-style-type: disc; + text-align: left; + margin-left: 40px; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 3px; +} + +ul.none +{ + list-style-type: none; +} + +ol +{ + text-align: left; + margin-left: 40px; + margin-top: 0px; + padding-top: 0px; + margin-bottom: 0px; + padding-bottom: 12px; +} + +hr +{ + color: maroon; + background-color: maroon; + height: 1px; + border: 0px; + width: 80%; +} diff --git a/thirdparty/glew/glew-1.9.0/doc/glew.html b/thirdparty/glew/glew-1.9.0/doc/glew.html new file mode 100644 index 0000000..e239834 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/glew.html @@ -0,0 +1,590 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Supported OpenGL Extensions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    1 3DFX_multisample
    2 3DFX_tbuffer
    3 3DFX_texture_compression_FXT1

    4 AMD_blend_minmax_factor
    5 AMD_conservative_depth
    6 AMD_debug_output
    7 AMD_depth_clamp_separate
    8 AMD_draw_buffers_blend
    9 AMD_multi_draw_indirect
    10 AMD_name_gen_delete
    11 AMD_performance_monitor
    12 AMD_pinned_memory
    13 AMD_query_buffer_object
    14 AMD_sample_positions
    15 AMD_seamless_cubemap_per_texture
    16 AMD_shader_stencil_export
    17 AMD_stencil_operation_extended
    18 AMD_texture_texture4
    19 AMD_transform_feedback3_lines_triangles
    20 AMD_vertex_shader_layer
    21 AMD_vertex_shader_tessellator
    22 AMD_vertex_shader_viewport_index

    23 APPLE_aux_depth_stencil
    24 APPLE_client_storage
    25 APPLE_element_array
    26 APPLE_fence
    27 APPLE_float_pixels
    28 APPLE_flush_buffer_range
    29 APPLE_object_purgeable
    30 APPLE_pixel_buffer
    31 APPLE_rgb_422
    32 APPLE_row_bytes
    33 APPLE_specular_vector
    34 APPLE_texture_range
    35 APPLE_transform_hint
    36 APPLE_vertex_array_object
    37 APPLE_vertex_array_range
    38 APPLE_vertex_program_evaluators
    39 APPLE_ycbcr_422

    40 ARB_ES2_compatibility
    41 ARB_ES3_compatibility
    42 ARB_arrays_of_arrays
    43 ARB_base_instance
    44 ARB_blend_func_extended
    45 ARB_cl_event
    46 ARB_clear_buffer_object
    47 ARB_color_buffer_float
    48 ARB_compatibility
    49 ARB_compressed_texture_pixel_storage
    50 ARB_compute_shader
    51 ARB_conservative_depth
    52 ARB_copy_buffer
    53 ARB_copy_image
    54 ARB_debug_output
    55 ARB_depth_buffer_float
    56 ARB_depth_clamp
    57 ARB_depth_texture
    58 ARB_draw_buffers
    59 ARB_draw_buffers_blend
    60 ARB_draw_elements_base_vertex
    61 ARB_draw_indirect
    62 ARB_draw_instanced
    63 ARB_explicit_attrib_location
    64 ARB_explicit_uniform_location
    65 ARB_fragment_coord_conventions
    66 ARB_fragment_layer_viewport
    67 ARB_fragment_program
    68 ARB_fragment_program_shadow
    69 ARB_fragment_shader
    70 ARB_framebuffer_no_attachments
    71 ARB_framebuffer_object
    72 ARB_framebuffer_sRGB
    73 ARB_geometry_shader4
    74 ARB_get_program_binary
    75 ARB_gpu_shader5
    76 ARB_gpu_shader_fp64
    77 ARB_half_float_pixel
    78 ARB_half_float_vertex
    79 ARB_imaging
    80 ARB_instanced_arrays
    81 ARB_internalformat_query
    82 ARB_internalformat_query2
    83 ARB_invalidate_subdata
    84 ARB_map_buffer_alignment
    85 ARB_map_buffer_range
    86 ARB_matrix_palette
    87 ARB_multi_draw_indirect
    88 ARB_multisample
    89 ARB_multitexture
    90 ARB_occlusion_query
    91 ARB_occlusion_query2
    92 ARB_pixel_buffer_object
    93 ARB_point_parameters
    94 ARB_point_sprite
    95 ARB_program_interface_query
    96 ARB_provoking_vertex
    97 ARB_robust_buffer_access_behavior
    98 ARB_robustness
    99 ARB_robustness_application_isolation
    100 ARB_robustness_share_group_isolation
    101 ARB_sample_shading
    102 ARB_sampler_objects
    103 ARB_seamless_cube_map
    104 ARB_separate_shader_objects
    105 ARB_shader_atomic_counters
    106 ARB_shader_bit_encoding
    107 ARB_shader_image_load_store
    108 ARB_shader_image_size
    109 ARB_shader_objects
    110 ARB_shader_precision
    111 ARB_shader_stencil_export
    112 ARB_shader_storage_buffer_object
    113 ARB_shader_subroutine
    114 ARB_shader_texture_lod
    115 ARB_shading_language_100
    116 ARB_shading_language_420pack
    117 ARB_shading_language_include
    118 ARB_shading_language_packing
    119 ARB_shadow
    120 ARB_shadow_ambient
    121 ARB_stencil_texturing
    122 ARB_sync
    123 ARB_tessellation_shader
    124 ARB_texture_border_clamp
    125 ARB_texture_buffer_object
    126 ARB_texture_buffer_object_rgb32
    127 ARB_texture_buffer_range
    128 ARB_texture_compression
    129 ARB_texture_compression_bptc
    130 ARB_texture_compression_rgtc
    131 ARB_texture_cube_map
    132 ARB_texture_cube_map_array
    133 ARB_texture_env_add
    134 ARB_texture_env_combine
    135 ARB_texture_env_crossbar
    136 ARB_texture_env_dot3
    137 ARB_texture_float
    138 ARB_texture_gather
    139 ARB_texture_mirrored_repeat
    140 ARB_texture_multisample
    141 ARB_texture_non_power_of_two
    142 ARB_texture_query_levels
    143 ARB_texture_query_lod
    144 ARB_texture_rectangle
    145 ARB_texture_rg
    146 ARB_texture_rgb10_a2ui
    147 ARB_texture_storage
    148 ARB_texture_storage_multisample
    149 ARB_texture_swizzle
    150 ARB_texture_view
    151 ARB_timer_query
    152 ARB_transform_feedback2
    153 ARB_transform_feedback3
    154 ARB_transform_feedback_instanced
    155 ARB_transpose_matrix
    156 ARB_uniform_buffer_object
    157 ARB_vertex_array_bgra
    158 ARB_vertex_array_object
    159 ARB_vertex_attrib_64bit
    160 ARB_vertex_attrib_binding
    161 ARB_vertex_blend
    162 ARB_vertex_buffer_object
    163 ARB_vertex_program
    164 ARB_vertex_shader
    165 ARB_vertex_type_2_10_10_10_rev
    166 ARB_viewport_array
    167 ARB_window_pos

    168 ATIX_point_sprites
    169 ATIX_texture_env_combine3
    170 ATIX_texture_env_route
    171 ATIX_vertex_shader_output_point_size

    172 ATI_draw_buffers
    173 ATI_element_array
    174 ATI_envmap_bumpmap
    175 ATI_fragment_shader
    176 ATI_map_object_buffer
    177 ATI_meminfo
    178 ATI_pn_triangles
    179 ATI_separate_stencil
    180 ATI_shader_texture_lod
    181 ATI_text_fragment_shader
    182 ATI_texture_compression_3dc
    183 ATI_texture_env_combine3
    184 ATI_texture_float
    185 ATI_texture_mirror_once
    186 ATI_vertex_array_object
    187 ATI_vertex_attrib_array_object
    188 ATI_vertex_streams

    189 EXT_422_pixels
    190 EXT_Cg_shader
    191 EXT_abgr
    192 EXT_bgra
    193 EXT_bindable_uniform
    194 EXT_blend_color
    195 EXT_blend_equation_separate
    196 EXT_blend_func_separate
    197 EXT_blend_logic_op
    198 EXT_blend_minmax
    199 EXT_blend_subtract
    200 EXT_clip_volume_hint
    201 EXT_cmyka
    202 EXT_color_subtable
    203 EXT_compiled_vertex_array
    204 EXT_convolution
    205 EXT_coordinate_frame
    206 EXT_copy_texture
    207 EXT_cull_vertex
    208 EXT_debug_marker
    209 EXT_depth_bounds_test
    210 EXT_direct_state_access
    211 EXT_draw_buffers2
    212 EXT_draw_instanced
    213 EXT_draw_range_elements
    214 EXT_fog_coord
    215 EXT_fragment_lighting
    216 EXT_framebuffer_blit
    217 EXT_framebuffer_multisample
    218 EXT_framebuffer_multisample_blit_scaled
    219 EXT_framebuffer_object
    220 EXT_framebuffer_sRGB
    221 EXT_geometry_shader4
    222 EXT_gpu_program_parameters
    223 EXT_gpu_shader4
    224 EXT_histogram
    225 EXT_index_array_formats
    226 EXT_index_func
    227 EXT_index_material
    228 EXT_index_texture
    229 EXT_light_texture
    230 EXT_misc_attribute
    231 EXT_multi_draw_arrays
    232 EXT_multisample
    233 EXT_packed_depth_stencil
    234 EXT_packed_float
    235 EXT_packed_pixels
    236 EXT_paletted_texture
    237 EXT_pixel_buffer_object
    238 EXT_pixel_transform
    239 EXT_pixel_transform_color_table
    240 EXT_point_parameters
    241 EXT_polygon_offset
    242 EXT_provoking_vertex
    243 EXT_rescale_normal
    244 EXT_scene_marker
    245 EXT_secondary_color
    246 EXT_separate_shader_objects
    247 EXT_separate_specular_color
    248 EXT_shader_image_load_store
    249 EXT_shadow_funcs
    250 EXT_shared_texture_palette
    251 EXT_stencil_clear_tag
    252 EXT_stencil_two_side
    253 EXT_stencil_wrap
    254 EXT_subtexture
    255 EXT_texture
    256 EXT_texture3D
    257 EXT_texture_array
    258 EXT_texture_buffer_object
    259 EXT_texture_compression_dxt1
    260 EXT_texture_compression_latc
    261 EXT_texture_compression_rgtc
    262 EXT_texture_compression_s3tc
    263 EXT_texture_cube_map
    264 EXT_texture_edge_clamp
    265 EXT_texture_env
    266 EXT_texture_env_add
    267 EXT_texture_env_combine
    268 EXT_texture_env_dot3
    269 EXT_texture_filter_anisotropic
    270 EXT_texture_integer
    271 EXT_texture_lod_bias
    272 EXT_texture_mirror_clamp
    273 EXT_texture_object
    274 EXT_texture_perturb_normal
    275 EXT_texture_rectangle
    276 EXT_texture_sRGB
    277 EXT_texture_sRGB_decode
    278 EXT_texture_shared_exponent
    279 EXT_texture_snorm
    280 EXT_texture_swizzle
    281 EXT_timer_query
    282 EXT_transform_feedback
    283 EXT_vertex_array
    284 EXT_vertex_array_bgra
    285 EXT_vertex_attrib_64bit
    286 EXT_vertex_shader
    287 EXT_vertex_weighting
    288 EXT_x11_sync_object

    289 GREMEDY_frame_terminator
    290 GREMEDY_string_marker

    291 HP_convolution_border_modes
    292 HP_image_transform
    293 HP_occlusion_test
    294 HP_texture_lighting

    295 IBM_cull_vertex
    296 IBM_multimode_draw_arrays
    297 IBM_rasterpos_clip
    298 IBM_static_data
    299 IBM_texture_mirrored_repeat
    300 IBM_vertex_array_lists

    301 INGR_color_clamp
    302 INGR_interlace_read

    303 INTEL_parallel_arrays
    304 INTEL_texture_scissor

    305 KHR_debug
    306 KHR_texture_compression_astc_ldr

    307 KTX_buffer_region

    308 MESAX_texture_stack

    309 MESA_pack_invert
    310 MESA_resize_buffers
    311 MESA_window_pos
    312 MESA_ycbcr_texture

    313 NVX_gpu_memory_info

    314 NV_bindless_texture
    315 NV_blend_square
    316 NV_conditional_render
    317 NV_copy_depth_to_color
    318 NV_copy_image
    319 NV_depth_buffer_float
    320 NV_depth_clamp
    321 NV_depth_range_unclamped
    322 NV_evaluators
    323 NV_explicit_multisample
    324 NV_fence
    325 NV_float_buffer
    326 NV_fog_distance
    327 NV_fragment_program
    328 NV_fragment_program2
    329 NV_fragment_program4
    330 NV_fragment_program_option
    331 NV_framebuffer_multisample_coverage
    332 NV_geometry_program4
    333 NV_geometry_shader4
    334 NV_gpu_program4
    335 NV_gpu_program5
    336 NV_gpu_program_fp64
    337 NV_gpu_shader5
    338 NV_half_float
    339 NV_light_max_exponent
    340 NV_multisample_coverage
    341 NV_multisample_filter_hint
    342 NV_occlusion_query
    343 NV_packed_depth_stencil
    344 NV_parameter_buffer_object
    345 NV_parameter_buffer_object2
    346 NV_path_rendering
    347 NV_pixel_data_range
    348 NV_point_sprite
    349 NV_present_video
    350 NV_primitive_restart
    351 NV_register_combiners
    352 NV_register_combiners2
    353 NV_shader_atomic_float
    354 NV_shader_buffer_load
    355 NV_tessellation_program5
    356 NV_texgen_emboss
    357 NV_texgen_reflection
    358 NV_texture_barrier
    359 NV_texture_compression_vtc
    360 NV_texture_env_combine4
    361 NV_texture_expand_normal
    362 NV_texture_multisample
    363 NV_texture_rectangle
    364 NV_texture_shader
    365 NV_texture_shader2
    366 NV_texture_shader3
    367 NV_transform_feedback
    368 NV_transform_feedback2
    369 NV_vdpau_interop
    370 NV_vertex_array_range
    371 NV_vertex_array_range2
    372 NV_vertex_attrib_integer_64bit
    373 NV_vertex_buffer_unified_memory
    374 NV_vertex_program
    375 NV_vertex_program1_1
    376 NV_vertex_program2
    377 NV_vertex_program2_option
    378 NV_vertex_program3
    379 NV_vertex_program4
    380 NV_video_capture

    381 OES_byte_coordinates
    382 OES_compressed_paletted_texture
    383 OES_read_format
    384 OES_single_precision

    385 OML_interlace
    386 OML_resample
    387 OML_subsample

    388 PGI_misc_hints
    389 PGI_vertex_hints

    390 REGAL_error_string
    391 REGAL_extension_query
    392 REGAL_log

    393 REND_screen_coordinates

    394 S3_s3tc

    395 SGIS_color_range
    396 SGIS_detail_texture
    397 SGIS_fog_function
    398 SGIS_generate_mipmap
    399 SGIS_multisample
    400 SGIS_pixel_texture
    401 SGIS_point_line_texgen
    402 SGIS_sharpen_texture
    403 SGIS_texture4D
    404 SGIS_texture_border_clamp
    405 SGIS_texture_edge_clamp
    406 SGIS_texture_filter4
    407 SGIS_texture_lod
    408 SGIS_texture_select

    409 SGIX_async
    410 SGIX_async_histogram
    411 SGIX_async_pixel
    412 SGIX_blend_alpha_minmax
    413 SGIX_clipmap
    414 SGIX_convolution_accuracy
    415 SGIX_depth_texture
    416 SGIX_flush_raster
    417 SGIX_fog_offset
    418 SGIX_fog_texture
    419 SGIX_fragment_specular_lighting
    420 SGIX_framezoom
    421 SGIX_interlace
    422 SGIX_ir_instrument1
    423 SGIX_list_priority
    424 SGIX_pixel_texture
    425 SGIX_pixel_texture_bits
    426 SGIX_reference_plane
    427 SGIX_resample
    428 SGIX_shadow
    429 SGIX_shadow_ambient
    430 SGIX_sprite
    431 SGIX_tag_sample_buffer
    432 SGIX_texture_add_env
    433 SGIX_texture_coordinate_clamp
    434 SGIX_texture_lod_bias
    435 SGIX_texture_multi_buffer
    436 SGIX_texture_range
    437 SGIX_texture_scale_bias
    438 SGIX_vertex_preclip
    439 SGIX_vertex_preclip_hint
    440 SGIX_ycrcb

    441 SGI_color_matrix
    442 SGI_color_table
    443 SGI_texture_color_table

    444 SUNX_constant_data

    445 SUN_convolution_border_modes
    446 SUN_global_alpha
    447 SUN_mesh_array
    448 SUN_read_video_pixels
    449 SUN_slice_accum
    450 SUN_triangle_list
    451 SUN_vertex

    452 WIN_phong_shading
    453 WIN_specular_fog
    454 WIN_swap_hint
    + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/glew.png b/thirdparty/glew/glew-1.9.0/doc/glew.png new file mode 100644 index 0000000..d46550f Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/doc/glew.png differ diff --git a/thirdparty/glew/glew-1.9.0/doc/glew.txt b/thirdparty/glew/glew-1.9.0/doc/glew.txt new file mode 100644 index 0000000..31a31d3 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/glew.txt @@ -0,0 +1,28 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2008, Milan Ikits +Copyright (C) 2002-2008, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/thirdparty/glew/glew-1.9.0/doc/glxew.html b/thirdparty/glew/glew-1.9.0/doc/glxew.html new file mode 100644 index 0000000..9464770 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/glxew.html @@ -0,0 +1,178 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Supported GLX Extensions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    1 3DFX_multisample

    2 AMD_gpu_association

    3 ARB_create_context
    4 ARB_create_context_profile
    5 ARB_create_context_robustness
    6 ARB_fbconfig_float
    7 ARB_framebuffer_sRGB
    8 ARB_get_proc_address
    9 ARB_multisample
    10 ARB_robustness_application_isolation
    11 ARB_robustness_share_group_isolation
    12 ARB_vertex_buffer_object

    13 ATI_pixel_format_float
    14 ATI_render_texture

    15 EXT_create_context_es2_profile
    16 EXT_create_context_es_profile
    17 EXT_fbconfig_packed_float
    18 EXT_framebuffer_sRGB
    19 EXT_import_context
    20 EXT_scene_marker
    21 EXT_swap_control
    22 EXT_swap_control_tear
    23 EXT_texture_from_pixmap
    24 EXT_visual_info
    25 EXT_visual_rating

    26 INTEL_swap_event

    27 MESA_agp_offset
    28 MESA_copy_sub_buffer
    29 MESA_pixmap_colormap
    30 MESA_release_buffers
    31 MESA_set_3dfx_mode
    32 MESA_swap_control

    33 NV_copy_image
    34 NV_float_buffer
    35 NV_multisample_coverage
    36 NV_present_video
    37 NV_swap_group
    38 NV_vertex_array_range
    39 NV_video_capture
    40 NV_video_out

    41 OML_swap_method
    42 OML_sync_control

    43 SGIS_blended_overlay
    44 SGIS_color_range
    45 SGIS_multisample
    46 SGIS_shared_multisample

    47 SGIX_fbconfig
    48 SGIX_hyperpipe
    49 SGIX_pbuffer
    50 SGIX_swap_barrier
    51 SGIX_swap_group
    52 SGIX_video_resize
    53 SGIX_visual_select_group

    54 SGI_cushion
    55 SGI_make_current_read
    56 SGI_swap_control
    57 SGI_video_sync

    58 SUN_get_transparent_index
    59 SUN_video_resize
    + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/gpl.txt b/thirdparty/glew/glew-1.9.0/doc/gpl.txt new file mode 100644 index 0000000..b7b5f53 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/gpl.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/thirdparty/glew/glew-1.9.0/doc/index.html b/thirdparty/glew/glew-1.9.0/doc/index.html new file mode 100644 index 0000000..4132529 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/index.html @@ -0,0 +1,208 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    +The OpenGL Extension Wrangler Library (GLEW) is a cross-platform +open-source C/C++ extension loading library. GLEW provides efficient +run-time mechanisms for determining which OpenGL extensions are +supported on the target platform. OpenGL core and extension +functionality is exposed in a single header file. GLEW has been +tested on a variety of operating systems, including Windows, Linux, +Mac OS X, FreeBSD, Irix, and Solaris. +

    + +

    Download Center

    +

    +GLEW is distributed +as source and precompiled binaries. The latest release is +1.9.0 +[08-06-12]: +

    +

    +

    +

    + + + +
    + + + + + + + + + + + + + + + +
    Source +ZIP |  +TGZ
    Binaries +Windows 32-bit |  +64-bit  +
    +
    +

    +

    +An up-to-date copy is also available from the project repository: +

    +

    +git clone git://glew.git.sourceforge.net/gitroot/glew/glew +

    + +

    Supported Extensions

    +

    +The latest release contains support for OpenGL 4.3 and the following extensions: +

    + + +

    News

    +
      +
    • [08-06-12] GLEW 1.9.0 adds support for OpenGL 4.3, new extensions
    • +
    • [07-17-12] GLEW 1.8.0 fixes minor bugs and adds new extensions
    • +
    • [08-26-11] GLEW 1.7.0 adds support for OpenGL 4.2, new extensions, fixes bugs
    • +
    • [04-27-11] GLEW 1.6.0 fixes minor bugs and adds eight new extensions
    • +
    • [01-31-11] GLEW 1.5.8 fixes minor bugs and adds two new extensions
    • +
    • [11-03-10] GLEW 1.5.7 fixes minor bugs and adds one new extension
    • +
    • [09-07-10] GLEW 1.5.6 adds support for OpenGL 4.1, fixes bugs
    • +
    • [07-13-10] GLEW 1.5.5 fixes minor bugs and adds new extensions
    • +
    • [04-21-10] GLEW 1.5.4 adds support for OpenGL 3.3, OpenGL 4.0 and new extensions, fixes bugs
    • +
    • [02-28-10] GLEW 1.5.3 fixes minor bugs and adds three new extensions
    • +
    • [12-31-09] GLEW 1.5.2 adds support for OpenGL 3.1, OpenGL 3.2 and new extensions
    • +
    • [11-03-08] GLEW 1.5.1 adds support for OpenGL 3.0 and 31 new extensions
    • +
    • [12-27-07] GLEW 1.5.0 is released under less restrictive licenses
    • +
    • [04-27-07] GLEW 1.4.0 is released
    • +
    • [03-08-07] GLEW is included in the NVIDIA OpenGL SDK
    • +
    • [03-04-07] GLEW 1.3.6 is released
    • +
    • [02-28-07] Repository is migrated to SVN
    • +
    • [02-25-07] GLEW is included in the OpenGL SDK
    • +
    • [11-21-06] GLEW 1.3.5 adds OpenGL 2.1 and NVIDIA G80 extensions
    • +
    • [03-04-06] GLEW 1.3.4 adds support for five new extensions
    • +
    • [05-16-05] GLEW 1.3.3 is released
    • +
    • [03-16-05] GLEW 1.3.2 adds support for GL_APPLE_pixel_buffer
    • +
    • [02-11-05] gljava and sdljava provide a Java binding to OpenGL via GLEW
    • +
    • [02-02-05] GLEW 1.3.1 adds support for GL_EXT_framebuffer_object
    • +
    • [01-04-05] GLEW 1.3.0 adds core OpenGL 2.0 support plus many enhancements
    • +
    • [12-22-04] GLEWpy Python wrapper announced
    • +
    • [12-12-04] Mailing lists created on sourceforge
    • +
    • [12-06-04] GLEW 1.2.5 adds new extensions and support for FreeBSD
    • +
    + +

    Links

    + + + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/install.html b/thirdparty/glew/glew-1.9.0/doc/install.html new file mode 100644 index 0000000..3f4e8c4 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/install.html @@ -0,0 +1,229 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Installation

    + +

    +To use the shared library version of GLEW, you need to copy the +headers and libraries into their destination directories. On Windows +this typically boils down to copying: +

    + + + + + + + + + + +
    bin/glew32.dll    to    %SystemRoot%/system32
    lib/glew32.lib    to    {VC Root}/Lib
    include/GL/glew.h    to    {VC Root}/Include/GL
    include/GL/wglew.h    to    {VC Root}/Include/GL
    +

    +

    + +

    +where {VC Root} is the Visual C++ root directory, typically +C:/Program Files/Microsoft Visual Studio/VC98 for Visual +Studio 6.0 or C:/Program Files/Microsoft Visual +Studio .NET 2003/Vc7/PlatformSDK for Visual Studio .NET. +

    + +

    +On Unix, typing make install will attempt to install GLEW +into /usr/include/GL and /usr/lib. You can +customize the installation target via the GLEW_DEST +environment variable if you do not have write access to these +directories. +

    + +

    Building Your Project with GLEW

    +

    +There are two ways to build your project with GLEW. +

    +

    Including the source files / project file

    +

    +The simpler but less flexible way is to include glew.h and +glew.c into your project. On Windows, you also need to +define the GLEW_STATIC preprocessor token when building a +static library or executable, and the GLEW_BUILD preprocessor +token when building a dll. You also need to replace +<GL/gl.h> and <GL/glu.h> with +<glew.h> in your code and set the appropriate include +flag (-I) to tell the compiler where to look for it. For +example: +

    +

    +#include <glew.h>
    +#include <GL/glut.h>
    +<gl, glu, and glut functionality is available here>
    +

    +

    +Depending on where you put glew.h you may also need to change +the include directives in glew.c. Note that if you are using +GLEW together with GLUT, you have to include glew.h first. +In addition, glew.h includes glu.h, so you do not +need to include it separately. +

    +

    +On Windows, you also have the option of adding the supplied project +file glew_static.dsp to your workspace (solution) and compile +it together with your other projects. In this case you also need to +change the GLEW_BUILD preprocessor constant to +GLEW_STATIC when building a static library or executable, +otherwise you get build errors. +

    +

    +Note that GLEW does not use the C +runtime library, so it does not matter which version (single-threaded, +multi-threaded or multi-threaded DLL) it is linked with (without +debugging information). It is, however, always a good idea to compile all +your projects including GLEW with the same C runtime settings. +

    + +

    Using GLEW as a shared library

    + +

    +Alternatively, you can use the provided project files / makefile to +build a separate shared library you can link your projects with later. +In this case the best practice is to install glew.h, +glew32.lib, and glew32.dll / libGLEW.so to +where the OpenGL equivalents gl.h, opengl32.lib, and +opengl32.dll / libGL.so are located. Note that you +need administrative privileges to do this. If you do not have +administrator access and your system administrator will not do it for +you, you can install GLEW into your own lib and include subdirectories +and tell the compiler where to find it. Then you can just replace +<GL/gl.h> with <GL/glew.h> in your +program: +

    + +

    +#include <GL/glew.h>
    +#include <GL/glut.h>
    +<gl, glu, and glut functionality is available here>
    +

    + +

    +or: +

    + +

    +#include <GL/glew.h>
    +<gl and glu functionality is available here>
    +

    + +

    +Remember to link your project with glew32.lib, +glu32.lib, and opengl32.lib on Windows and +libGLEW.so, libGLU.so, and libGL.so on +Unix (-lGLEW -lGLU -lGL). +

    + +

    +It is important to keep in mind that glew.h includes neither +windows.h nor gl.h. Also, GLEW will warn you by +issuing a preprocessor error in case you have included gl.h, +glext.h, or glATI.h before glew.h. +

    + + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/khronos.txt b/thirdparty/glew/glew-1.9.0/doc/khronos.txt new file mode 100644 index 0000000..ffc271c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/khronos.txt @@ -0,0 +1,20 @@ +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/thirdparty/glew/glew-1.9.0/doc/log.html b/thirdparty/glew/glew-1.9.0/doc/log.html new file mode 100644 index 0000000..5f0436b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/log.html @@ -0,0 +1,953 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Change Log

    + +
    +
      +
    • 1.9.0 [08-06-12] +
        +
      • New features: +
          +
        • Support for OpenGL 4.2 +
        +
      • New extensions: +
          +
        • GL_ARB_ES3_compatibility +
        • GL_ARB_clear_buffer_object +
        • GL_ARB_compute_shader +
        • GL_ARB_copy_image +
        • GL_ARB_explicit_uniform_location +
        • GL_ARB_fragment_layer_viewport +
        • GL_ARB_framebuffer_no_attachments +
        • GL_ARB_internalformat_query2 +
        • GL_ARB_multi_draw_indirect +
        • GL_ARB_program_interface_query +
        • GL_ARB_robust_buffer_access_behavior +
        • GL_ARB_robustness_application_isolation +
        • GL_ARB_robustness_share_group_isolation +
        • GL_ARB_shader_image_size +
        • GL_ARB_shader_storage_buffer_object +
        • GL_ARB_stencil_texturing +
        • GL_ARB_texture_buffer_range +
        • GL_ARB_texture_query_levels +
        • GL_ARB_texture_storage_multisample +
        • GL_ARB_texture_view +
        • GL_ARB_vertex_attrib_binding +
        • GL_EXT_debug_marker +
        • GL_KHR_debug +
        • GL_REGAL_error_string +
        • GL_REGAL_extension_query +
        • GL_REGAL_log +
        • GLX_ARB_robustness_application_isolation +
        • GLX_ARB_robustness_share_group_isolation +
        • GLX_EXT_create_context_es_profile +
        • WGL_EXT_create_context_es_profile +
        +
      • Bug fixes: +
          +
        • Not using GLU library for Makefile builds. +
        +
      +
    + +
    +
      +
    • 1.8.0 [07-17-12] +
        +
      • New extensions: +
          +
        • GL_AMD_pinned_memory +
        • GL_AMD_query_buffer_object +
        • GL_AMD_stencil_operation_extended +
        • GL_AMD_vertex_shader_layer +
        • GL_AMD_vertex_shader_viewport_index +
        • GL_NV_bindless_texture +
        • GL_NV_shader_atomic_float +
        • GLX_EXT_swap_control_tear +
        • WGL_EXT_swap_control_tear +
        • WGL_NV_DX_interop2 +
        +
      • Bug fixes: +
          +
        • MS Visual Studio 2010 projects added +
        • GLX_NV_video_out replaces GLX_NV_video_output +
        • ANSI C prototype for glewInit +
        • Improved CentOS build support +
        • Improved GL_ARB_gpu_shader_fp64 support +
        • ARB_texture_compression_bptc and ARB_copy_buffer constants +
        • Linux needs to define GLEW_STATIC for static library builds +
        • Custom code generation problem resolved +
        • GLEWAPIENTRY added to glew.h for calling convention customization +
        • Correction for glPathStencilDepthOffsetNV +
        • Resolve OSX gcc warnings +
        • Added build support for NetBSD +
        +
      +
    + +
    +
      +
    • 1.7.0 [08-26-11] +
        +
      • New features: +
          +
        • Support for OpenGL 4.2 +
        +
      • New extensions: +
          +
        • GL_AMD_multi_draw_indirect +
        • GL_ARB_base_instance +
        • GL_ARB_compressed_texture_pixel_storage +
        • GL_ARB_conservative_depth +
        • GL_ARB_internalformat_query +
        • GL_ARB_map_buffer_alignment +
        • GL_ARB_shader_atomic_counters +
        • GL_ARB_shader_image_load_store +
        • GL_ARB_shading_language_420pack +
        • GL_ARB_shading_language_packing +
        • GL_ARB_texture_storage +
        • GL_ARB_transform_feedback_instanced +
        • GL_EXT_framebuffer_multisample_blit_scaled +
        • GL_NV_path_rendering +
        • GL_NV_path_rendering +
        • GLX_MESA_swap_control +
        +
      • Bug fixes: +
          +
        • const qualifiers for GL 1.4 MultiDrawArrays, MultiDrawElements +
        • Add glGetGraphicsResetStatusARB to GL_ARB_robustness +
        • Remove EXT suffix from GL_KTX_buffer_region entry points +
        • Solaris needs inttypes.h +
        • Add ERROR_INVALID_VERSION_ARB and ERROR_INVALID_PROFILE_ARB to WGL_ARB_create_context +
        • Add GLX_MESA_swap_control +
        • Set -install_name for OSX +
        • Add 64-bit darwin build option (SYSTEM=darwin_x86-64) +
        • Add GL_NV_path_rendering +
        +
      +
    + +
    +
      +
    • 1.6.0 [04-27-11] +
        +
      • New extensions: +
          +
        • GL_AMD_blend_minmax_factor +
        • GL_AMD_sample_positions +
        • GL_EXT_x11_sync_object +
        • GL_NV_texture_multisample +
        • GL_NV_video_capture +
        • GLX_NV_video_capture +
        • WGL_NV_DX_interop +
        • WGL_NV_video_capture +
        +
      • Bug fixes: +
          +
        • Define GLEW_NO_GLU for no glu dependency. +
        • mx suffix for GLEW MX libraries, build both libraries by default. +
        • Cygwin build improvements +
        • Soname of GLEWmx shared libraries +
        • Query GL extension string only once +
        • GLX_OML_sync_control no longer requires C99 +
        • glDraw*InstancedARB moved from GL_ARB_draw_instanced to GL_ARB_instanced_arrays +
        • glFramebufferTextureLayerEXT moved from GL_EXT_geometry_shader4 to GL_EXT_texture_array +
        • Fixes for BSD build +
        +
      +
    + +
    +
      +
    • 1.5.8 [01-31-11] +
        +
      • New extensions: +
          +
        • GL_AMD_depth_clamp_separate +
        • GL_EXT_texture_sRGB_decode +
        +
      • Bug fixes: +
          +
        • Borland C++ fix for __int64 +
        • GL_DOUBLE_MATNxM enumerants for OpenGL 4.0 +
        • Correction to glGetTransformFeedbackVarying +
        • Correction to glSecondaryColorPointer +
        • Corrections to glGetVertexAttribPointerv and glGetShaderSource +
        • Switched code repository from svn to git +
        +
      +
    + +
    +
      +
    • 1.5.7 [11-03-10] +
        +
      • New extension: +
          +
        • GL_NVX_gpu_memory_info +
        +
      • Bug fixes: +
          +
        • Improved mingw32 build support +
        • Improved cygwin build support +
        • glGetPointervEXT fix +
        • Add GLEW_VERSION_1_2_1 +
        +
      +
    + +
    +
      +
    • 1.5.6 [09-07-10] +
        +
      • New features: +
          +
        • Support for OpenGL 4.1 +
        +
      • New extensions: +
          +
        • GL_ARB_ES2_compatibility +
        • GL_ARB_cl_event +
        • GL_ARB_debug_output +
        • GL_ARB_get_program_binary +
        • GL_ARB_robustness +
        • GL_ARB_separate_shader_objects +
        • GL_ARB_shader_precision +
        • GL_ARB_shader_stencil_export +
        • GL_ARB_vertex_attrib_64bit +
        • GL_ARB_viewport_array +
        • GLX_ARB_create_context_robustness +
        • GLX_EXT_create_context_es2_profile +
        • WGL_ARB_create_context_robustness +
        • WGL_EXT_create_context_es2_profile +
        +
      +
    + +
    +
      +
    • 1.5.5 [07-13-10] +
        +
      • New extensions: +
          +
        • GL_AMD_debug_output +
        • GL_AMD_name_gen_delete +
        • GL_AMD_transform_feedback3_lines_triangles +
        • GL_NV_multisample_coverage +
        • GL_NV_vdpau_interop +
        • GLX_AMD_gpu_association +
        • GLX_NV_multisample_coverage +
        • WGL_NV_multisample_coverage +
        +
      • Bug fixes: +
          +
        • Compilation issue with GLX_SGI_video_sync +
        • OpenGL 4.0 double-precision uniform functions added +
        • Constness of glPointParameterfvARB and glPointParameterfvEXT +
        • Added glVertexAttribDivisor +
        • Compilation issue with Nvidia GLX headers +
        +
      +
    + +
    +
      +
    • 1.5.4 [04-21-10] +
        +
      • New features: +
          +
        • Support for OpenGL 3.3 +
        • Support for OpenGL 4.0 +
        +
      • New extensions: +
          +
        • GL_AMD_conservative_depth +
        • GL_ARB_blend_func_extended +
        • GL_ARB_draw_indirect +
        • GL_ARB_explicit_attrib_location +
        • GL_ARB_gpu_shader5 +
        • GL_ARB_gpu_shader_fp64 +
        • GL_ARB_occlusion_query2 +
        • GL_ARB_sampler_objects +
        • GL_ARB_shader_bit_encoding +
        • GL_ARB_shader_subroutine +
        • GL_ARB_shading_language_include +
        • GL_ARB_tessellation_shader +
        • GL_ARB_texture_buffer_object_rgb32 +
        • GL_ARB_texture_compression_bptc +
        • GL_ARB_texture_rgb10_a2ui +
        • GL_ARB_texture_swizzle +
        • GL_ARB_timer_query +
        • GL_ARB_transform_feedback2 +
        • GL_ARB_transform_feedback3 +
        • GL_ARB_vertex_type_2_10_10_10_rev +
        • GL_EXT_shader_image_load_store +
        • GL_EXT_vertex_attrib_64bit +
        • GL_NV_gpu_program5 +
        • GL_NV_gpu_program_fp64 +
        • GL_NV_gpu_shader5 +
        • GL_NV_tessellation_program5 +
        • GL_NV_vertex_attrib_integer_64bit +
        • GLX_ARB_vertex_buffer_object +
        +
      • Bug fixes: +
          +
        • Parameter constness fix for glPointParameteriv and glPointParameterfv +
        +
      +
    + +
    +
      +
    • 1.5.3 [02-28-10] +
        +
      • New extensions: +
          +
        • GLX_INTEL_swap_event +
        • GL_AMD_seamless_cubemap_per_texture +
        • GL_AMD_shader_stencil_export +
        +
      • Bug fixes: +
          +
        • Correct version detection for GL 3.1 and 3.2 +
        • Missing 3.1 enumerants +
        • Add glew.pc +
        +
      +
    + +
    +
      +
    • 1.5.2 [12-31-09] +
        +
      • New features: +
          +
        • Support for OpenGL 3.1 +
        • Support for OpenGL 3.2 +
        +
      • New extensions: +
          +
        • GL_AMD_draw_buffers_blend +
        • GL_AMD_performance_monitor +
        • GL_AMD_texture_texture4 +
        • GL_AMD_vertex_shader_tessellator +
        • GL_APPLE_aux_depth_stencil +
        • GL_APPLE_object_purgeable +
        • GL_APPLE_rgb_422 +
        • GL_APPLE_row_bytes +
        • GL_APPLE_vertex_program_evaluators +
        • GL_ARB_compatibility +
        • GL_ARB_copy_buffer +
        • GL_ARB_depth_clamp +
        • GL_ARB_draw_buffers_blend +
        • GL_ARB_draw_elements_base_vertex +
        • GL_ARB_fragment_coord_conventions +
        • GL_ARB_provoking_vertex +
        • GL_ARB_sample_shading +
        • GL_ARB_seamless_cube_map +
        • GL_ARB_shader_texture_lod +
        • GL_ARB_sync +
        • GL_ARB_texture_cube_map_array +
        • GL_ARB_texture_gather +
        • GL_ARB_texture_multisample +
        • GL_ARB_texture_query_lod +
        • GL_ARB_uniform_buffer_object +
        • GL_ARB_vertex_array_bgra +
        • GL_ATI_meminfo +
        • GL_EXT_provoking_vertex +
        • GL_EXT_separate_shader_objects +
        • GL_EXT_texture_snorm +
        • GL_NV_copy_image +
        • GL_NV_parameter_buffer_object2 +
        • GL_NV_shader_buffer_load +
        • GL_NV_texture_barrier +
        • GL_NV_transform_feedback2 +
        • GL_NV_vertex_buffer_unified_memory +
        • WGL_AMD_gpu_association +
        • WGL_ARB_create_context_profile +
        • WGL_NV_copy_image +
        • GLX_ARB_create_context_profile +
        • GLX_EXT_swap_control +
        • GLX_NV_copy_image +
        +
      • Bug fixes: +
          +
        • DOS line endings for windows .zip archives only. +
        • glTransformFeedbackVaryings arguments. +
        • Resource leak in glewinfo and visualinfo tools. +
        • WIN32_LEAN_AND_MEAN preprocessor pollution. +
        • Fixed version detection for GLEW_VERSION_2_1 and GLEW_VERSION_3_0. +
        • MesaGLUT glut.h GLAPIENTRY dependency. +
        • glFramebufferTextureLayer correction. +
        • OSX compiler warnings resolved. +
        • Cygwin linking to opengl32 by default, rather than X11 OpenGL. +
        • SnowLeopard (OSX 10.6) gl.h detection. +
        • Use $(STRIP) consistently. +
        +
      +
    + +
    +
      +
    • 1.5.1 [11-03-08] +
        +
      • New features: +
          +
        • Support for OpenGL 3.0 +
        +
      • New extensions: +
          +
        • GL_ARB_depth_buffer_float +
        • GL_ARB_draw_instance, +
        • GL_ARB_framebuffer_object +
        • GL_ARB_framebuffer_sRGB +
        • GL_ARB_geometry_shader4 +
        • GL_ARB_half_float_pixel +
        • GL_ARB_half_float_vertex +
        • GL_ARB_instanced_arrays +
        • GL_ARB_map_buffer_range +
        • GL_ARB_texture_buffer_object +
        • GL_ARB_texture_compression_rgtc +
        • GL_ARB_vertex_array_object +
        • GL_EXT_direct_state_access +
        • GL_EXT_texture_swizzle +
        • GL_EXT_transform_feedback +
        • GL_EXT_vertex_array_bgra +
        • GL_NV_conditional_render +
        • GL_NV_explicit_multisample +
        • GL_NV_present_video +
        • GL_SGIS_point_line_texgen +
        • GL_SGIX_convolution_accuracy +
        • WGL_ARB_create_context +
        • WGL_ARB_framebuffer_sRGB +
        • WGL_NV_present_video +
        • WGL_NV_swap_group +
        • WGL_NV_video_output +
        • GLX_ARB_create_context +
        • GLX_ARB_framebuffer_sRGB +
        • GLX_NV_present_video +
        • GLX_NV_swap_group +
        • GLX_NV_video_output +
        +
      • Bug fixes: +
          +
        • Licensing issues with documentation +
        • Problems with long long and _MSC_VER on MINGW +
        • Incorrect parameter for glGetUniformLocation +
        • glewGetExtension fails on last entry +
        • Incomplete GL_NV_texture_shader tokens +
        • Scripting problems on Cygwin +
        • Incorrect definition for GLint on OS X +
        +
      +
    + +
    +
      +
    • 1.5.0 [12-27-07] +
        +
      • New features: +
          +
        • Licensing change (BSD, Mesa 3-D, Khronos) +
        • Switch to using registry on www.opengl.org +
        • Support for major and minor version strings +
        +
      • New extensions: +
          +
        • GL_APPLE_flush_buffer_range +
        • GL_GREMEDY_frame_terminator +
        • GLX_EXT_texture_from_pixmap +
        +
      • Bug fixes: +
          +
        • Incorrent 64-bit type definitions +
        • Do not strip static library on install +
        • Missing tokens in GL_ATI_fragment_shader and WGL_{ARB,EXT}_make_current_read +
        • Missing tokens in GL_VERSION_2_1 +
        • Missing functions in GL_VERSION_1_4 +
        • Incorrect parameter type for glXCopyContext +
        +
      +
    +
    +
      +
    • 1.4.0 [04-27-07] +
        +
      • New features: +
          +
        • Extension variables are declared const to avoid possible +corruption of their values +
        +
      • New extensions: +
          +
        • GL_NV_depth_range_unclamped +
        +
      • Bug fixes: +
          +
        • Incorrect tokens in GL_NV_transform_feedback and GL_NV_framebuffer_multisample_coverage +
        • Incorrect function names in GL_EXT_gpu_program_parameters +
        • Missing tokens in GL_EXT_framebuffer_multisample +
        • GLEW_MX initialization problem for WGL_{ARB,EXT}_extensions_string +
        +
      +
    +
    +
      +
    • 1.3.6 [03-04-07] +
        +
      • New extensions: +
          +
        • GL_ATI_shader_texture_lod +
        • GL_EXT_gpu_program_parameters +
        • GL_NV_geometry_shader4 +
        • WGL_NV_gpu_affinity +
        • GLX_SGIX_hyperpipe +
        +
      • Bug fixes: +
          +
        • Missing include guards in glxew.h +
        • Makefile and install problems for Cygwin builds +
        • Install problem for Linux AMD64 builds +
        • Incorrent token in GL_ATI_texture_compression_3dc +
        • Missing tokens from GL_ATIX_point_sprites +
        +
      +
    +
    +
      +
    • 1.3.5 [11-21-06] +
        +
      • New features: +
          +
        • Support for core OpenGL 2.1 +
        • Debug support for glewIsSupported +
        +
      • New extensions: +
          +
        • GL_EXT_bindable_uniform +
        • GL_EXT_draw_buffers2 +
        • GL_EXT_draw_instanced +
        • GL_EXT_framebuffer_sRGB +
        • GL_EXT_geometry_shader4 +
        • GL_EXT_gpu_shader4 +
        • GL_EXT_packed_float +
        • GL_EXT_texture_array +
        • GL_EXT_texture_buffer_object +
        • GL_EXT_texture_compression_latc +
        • GL_EXT_texture_compression_rgtc +
        • GL_EXT_texture_integer +
        • GL_EXT_texture_shared_exponent +
        • GL_EXT_timer_query +
        • GL_NV_depth_buffer_float +
        • GL_NV_fragment_program4 +
        • GL_NV_framebuffer_multisample_coverage +
        • GL_NV_geometry_program4 +
        • GL_NV_gpu_program4 +
        • GL_NV_parameter_buffer_object +
        • GL_NV_transform_feedback +
        • GL_NV_vertex_program4 +
        • GL_OES_byte_coordinates +
        • GL_OES_compressed_paletted_texture +
        • GL_OES_read_format +
        • GL_OES_single_precision +
        • WGL_EXT_pixel_format_packed_float +
        • WGL_EXT_framebuffer_sRGB +
        • GLX_EXT_fbconfig_packed_float +
        • GLX_EXT_framebuffer_sRGB +
        +
      • Bug fixes: +
          +
        • Wrong GLXContext definition on Solaris +
        • Makefile problem for parallel builds +
        +
      +
    +
    +
      +
    • 1.3.4 [03-04-06] +
        +
      • New extensions: +
          +
        • GL_EXT_framebuffer_blit +
        • GL_EXT_framebuffer_multisample +
        • GL_EXT_packed_depth_stencil +
        • GL_MESAX_texture_stack +
        • WGL_3DL_stereo_control +
        +
      +
        +
      • Bug fixes: +
          +
        • glBlendEquation missing from GL_ARB_imaging +
        • Wrong APIENTRY definition for Cygwin +
        • Incorrect OS X OpenGL types +
        • Unix 64-bit installation patch +
        +
      +
    +
    +
      +
    • 1.3.3 [05-16-05] +
        +
      • New feature: +
          +
        • Code generation option to split source into multiple files +
        +
      +
        +
      • Bug fixes: +
          +
        • OpenGL 2.0 core initialization problems +
        • Wrong value for token GL_SHADER_TYPE +
        • Missing tokens in GL_ATI_fragment_shader +
        • Missing entry points in GL_ARB_transpose_matrix +
        +
      +
    +
    +
      +
    • 1.3.2 [03-16-05] +
        +
      • New extension: +
          +
        • GL_APPLE_pixel_buffer +
        +
      • Bug fixes: +
          +
        • Missing OpenGL 2.0 entry points +
        • Missing tokens in GL_SGIX_shadow +
        • MinGW makefile problem +
        • Check for incorrect OpenGL version string on SiS hardware +
        • Documentation update to meet the HTML 4.01 Transitional specification +
        +
      +
    +
    +
      +
    • 1.3.1 [02-02-05] +
        +
      • New features: +
          +
        • Consistent Unix and Windows versioning +
        +
      • New extensions: +
          +
        • GL_EXT_framebuffer_object +
        • GL_ARB_pixel_buffer_object +
        +
      • Bug fixes: +
          +
        • Missing OpenGL 2.0 tokens +
        • Incorrect typedefs (GLhandleARB and GLhalf) +
        • Borland compiler problems +
        +
      +
    +
    +
      +
    • 1.3.0 [01-04-05] +
        +
      • New features: +
          +
        • Support for core OpenGL 2.0 +
        • glewIsSupported provides efficient string-based extension checks +
        • Custom code generation from a list of extensions +
        • Makefile changes +
        +
      • New extensions: +
          +
        • WGL_ATI_render_texture_rectangle +
        +
      • Bug fixes: +
          +
        • Incorrect function signature in OpenGL 1.5 core +
        +
      +
    +
    +
      +
    • 1.2.5 [12-06-04] +
        +
      • New extensions: +
          +
        • GL_ATI_texture_compression_3dc +
        • GL_EXT_Cg_shader +
        • GL_EXT_draw_range_elements +
        • GL_KTX_buffer_region +
        +
      • Bug fixes: +
          +
        • OpenGL version detection bug +
        • Problems with wxWindows and MinGW compilation +
        • visualinfo compilation problem with GLEW_MX specified +
        • Wrong token name in OpenGL 1.5 core +
        +
      • Support for FreeBSD +
      +
    +
    +
      +
    • 1.2.4 [09-06-04] +
        +
      • Added ARB_draw_buffers and ARB_texture_rectangle +
      • Fixed bug in ARB_shader_objects +
      • Replaced wglinfo with visualinfo +
      +
    +
    +
      +
    • 1.2.3 [06-10-04] +
        +
      • Added GL_NV_fragment_program2, GL_NV_fragment_program_option, GL_NV_vertex_program2_option, GL_NV_vertex_program3 +
      • Bug fix in GL_ARB_vertex_blend +
      +
    +
    +
      +
    • 1.2.2 [05-08-04] +
        +
      • Added GL_EXT_pixel_buffer_object, removed GL_NV_element_array +
      • Fixed GLEW_MX problems +
      • Bug fix in GL_EXT_texture_rectangle and wglinfo +
      +
    +
    +
      +
    • 1.2.1 [03-18-04] +
        +
      • Bug fix in OpenGL version query (early release of 1.2.0 contained this bug) +
      • Bug fix in GL_ARB_shader_objects and temporary bug fix in GL_ARB_vertex_shader +
      • Added flags on GDI support and multisampling to wglinfo +
      +
    +
    +
      +
    • 1.2.0 [02-19-04] +
        +
      • Added full OpenGL 1.5 support +
      • Added support for multiple rendering contexts with different capabilities +
      • Added command line flags to glewinfo for selecting displays and visuals +
      • Added GLX_SGIS_multisample, GLX_SUN_video_resize, and GL_SUN_read_video_pixels +
      • Added MinGW/MSYS support +
      • Bug fixes in GL_ARB_shader_objects and the OS X build +
      +
    +
    +
      +
    • 1.1.4 [12-15-03] +
        +
      • Added GL_APPLE_float_pixels, GL_APPLE_texture_range, +GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, +GLX_ATI_pixel_format_float, and GLX_ATI_render_texture +
      • Bug fixes in GL_ATI_map_object_buffer and GL_ATI_fragment_shader +
      +
    +
    +
      +
    • 1.1.3 [10-28-03] +
        +
      • Added Solaris and Darwin support +
      • Added GL_ARB_fragment_shader, GL_ARB_shader_objects, and GL_ARB_vertex_shader +
      • Fixed bug in GL_WIN_swap_hint +
      • Removed glewinfo's dependency on GLUT +
      +
    +
    +
      +
    • 1.1.2 [09-15-03] +
        +
      • Removed dependency on WGL_{ARB,EXT}_extensions_string to make GLEW run on Matrox cards +
      • Added glewGetString for querying the GLEW version string +
      +
    +
    +
      +
    • 1.1.1 [08-11-03] +
        +
      • Added GLX_NV_float_buffer, GL_ARB_shading_language_100, and GL_ARB_texture_non_power_of_two +
      • Fixed bug in GL_ARB_vertex_buffer_object +
      • Minor updates in documentation +
      +
    +
    +
      +
    • 1.1.0 [07-08-03] +
        +
      • Added automatic code generation +
      • Added almost every extension in the registry +
      • Added separate namespace +
      • Added Irix support +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.7 [06-29-03] +
        +
      • Added GL_EXT_depth_bounds_test +
      • Fixed typos +
      +
    +
    +
      +
    • 1.0.6 [05-05-03] +
        +
      • Added ARB_vertex_buffer_object and NV_half_float +
      • Updated wglinfo +
      • Temporary Linux bug fixes (problems with SDL and MESA) +
      +
    +
    +
      +
    • 1.0.5 [02-17-03] +
        +
      • Bug fixes +
      • Added wglinfo +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.4 [02-02-03] +
        +
      • Added NV_texture_expand_normal +
      • Added mingw support +
      • Updated documentation +
      +
    +
    +
      +
    • 1.0.3 [01-09-03] +
        +
      • Cleaned up ATI extensions +
      • Changed function prototypes to match glext.h +
      • Added EXT_texture3D +
      • Fixed typos in ATI_vertex_attrib_array_object and ATI_draw_buffers +
      +
    +
    +
      +
    • 1.0.2 [12-21-02] +
        +
      • Added list of supported extensions to documentation +
      • Added NV_half_float and NV_texgen_emboss +
      +
    +
    +
      +
    • 1.0.1 [12-17-02] +
        +
      • Bug fixes +
      • Added glewGetExtension +
      +
    +
    +
      +
    • 1.0.0 [12-12-02] +
        +
      • Initial release +
      +
    +
    + + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/doc/mesa.txt b/thirdparty/glew/glew-1.9.0/doc/mesa.txt new file mode 100644 index 0000000..a82dd4b --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/mesa.txt @@ -0,0 +1,21 @@ +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/thirdparty/glew/glew-1.9.0/doc/new.png b/thirdparty/glew/glew-1.9.0/doc/new.png new file mode 100644 index 0000000..7ce2b47 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/doc/new.png differ diff --git a/thirdparty/glew/glew-1.9.0/doc/ogl_sm.jpg b/thirdparty/glew/glew-1.9.0/doc/ogl_sm.jpg new file mode 100644 index 0000000..f318d76 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/doc/ogl_sm.jpg differ diff --git a/thirdparty/glew/glew-1.9.0/doc/wglew.html b/thirdparty/glew/glew-1.9.0/doc/wglew.html new file mode 100644 index 0000000..8e178bb --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/doc/wglew.html @@ -0,0 +1,165 @@ + + + + + + +GLEW: The OpenGL Extension Wrangler Library + + + + + + + + +
    + + + + + + + + +
    + + + + + + + +
    Latest Release: 1.9.0

    GLEW Logo

    + + + + + + + + + + + +
    Download
    Usage
    Building
    Installation
    Source Generation
    Credits & Copyright
    Change Log
    Project Page
    Mailing Lists
    Bug Tracker
    +

    +
    + + + + + +
    Last Update: 08-06-12
    + OpenGL Logo + SourceForge Logo +
    +
    +
    + +

    The OpenGL Extension Wrangler Library

    + + + + +

    Supported WGL Extensions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    1 3DFX_multisample

    2 3DL_stereo_control

    3 AMD_gpu_association

    4 ARB_buffer_region
    5 ARB_create_context
    6 ARB_create_context_profile
    7 ARB_create_context_robustness
    8 ARB_extensions_string
    9 ARB_framebuffer_sRGB
    10 ARB_make_current_read
    11 ARB_multisample
    12 ARB_pbuffer
    13 ARB_pixel_format
    14 ARB_pixel_format_float
    15 ARB_render_texture

    16 ATI_pixel_format_float
    17 ATI_render_texture_rectangle

    18 EXT_create_context_es2_profile
    19 EXT_create_context_es_profile
    20 EXT_depth_float
    21 EXT_display_color_table
    22 EXT_extensions_string
    23 EXT_framebuffer_sRGB
    24 EXT_make_current_read
    25 EXT_multisample
    26 EXT_pbuffer
    27 EXT_pixel_format
    28 EXT_pixel_format_packed_float
    29 EXT_swap_control
    30 EXT_swap_control_tear

    31 I3D_digital_video_control
    32 I3D_gamma
    33 I3D_genlock
    34 I3D_image_buffer
    35 I3D_swap_frame_lock
    36 I3D_swap_frame_usage

    37 NV_DX_interop
    38 NV_DX_interop2
    39 NV_copy_image
    40 NV_float_buffer
    41 NV_gpu_affinity
    42 NV_multisample_coverage
    43 NV_present_video
    44 NV_render_depth_texture
    45 NV_render_texture_rectangle
    46 NV_swap_group
    47 NV_vertex_array_range
    48 NV_video_capture
    49 NV_video_output

    50 OML_sync_control
    + +
    + + diff --git a/thirdparty/glew/glew-1.9.0/glew.pc.in b/thirdparty/glew/glew-1.9.0/glew.pc.in new file mode 100644 index 0000000..10e946f --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/glew.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: glew +Description: The OpenGL Extension Wrangler library +Version: @version@ +Cflags: -I${includedir} @cflags@ +Libs: -L${libdir} -l@libname@ diff --git a/thirdparty/glew/glew-1.9.0/include/GL/glew.h b/thirdparty/glew/glew-1.9.0/include/GL/glew.h new file mode 100644 index 0000000..3962f7c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/include/GL/glew.h @@ -0,0 +1,17132 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __GL_H__ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_SAMPLES 0x80A9 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_RENDERBUFFER 0x8D41 +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar ** path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT) +#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT) +#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT) +#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT) +#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GL_TEXTURE_ENV0_EXT 0 +#define GL_ENV_BLEND_EXT 0 +#define GL_TEXTURE_ENV_SHIFT_EXT 0 +#define GL_ENV_REPLACE_EXT 0 +#define GL_ENV_ADD_EXT 0 +#define GL_ENV_SUBTRACT_EXT 0 +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 +#define GL_ENV_REVERSE_SUBTRACT_EXT 0 +#define GL_ENV_REVERSE_BLEND_EXT 0 +#define GL_ENV_COPY_EXT 0 +#define GL_ENV_MODULATE_EXT 0 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar ** varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETPOINTERVPROC) (GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glGetPointerv GLEW_GET_FUN(__glewGetPointerv) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GL_BYTE 0x1400 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/include/GL/glxew.h b/thirdparty/glew/glew-1.9.0/include/GL/glxew.h new file mode 100644 index 0000000..9335b27 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/include/GL/glxew.h @@ -0,0 +1,1637 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) + +#endif /* GLX_NV_video_out */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLX_MIN_RED_SGIS 0 +#define GLX_MAX_GREEN_SGIS 0 +#define GLX_MIN_BLUE_SGIS 0 +#define GLX_MAX_ALPHA_SGIS 0 +#define GLX_MIN_GREEN_SGIS 0 +#define GLX_MIN_ALPHA_SGIS 0 +#define GLX_MAX_RED_SGIS 0 +#define GLX_EXTENDED_RANGE_SGIS 0 +#define GLX_MAX_BLUE_SGIS 0 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT +#else +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/include/GL/wglew.h b/thirdparty/glew/glew-1.9.0/include/GL/wglew.h new file mode 100644 index 0000000..c0f59f5 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/include/GL/wglew.h @@ -0,0 +1,1397 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew32.lib b/thirdparty/glew/glew-1.9.0/lib/glew32.lib new file mode 100644 index 0000000..301a234 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew32.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew32mx.lib b/thirdparty/glew/glew-1.9.0/lib/glew32mx.lib new file mode 100644 index 0000000..2f609f6 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew32mx.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew32mxs.lib b/thirdparty/glew/glew-1.9.0/lib/glew32mxs.lib new file mode 100644 index 0000000..b6b31b6 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew32mxs.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew32s.lib b/thirdparty/glew/glew-1.9.0/lib/glew32s.lib new file mode 100644 index 0000000..589a5bb Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew32s.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew64.lib b/thirdparty/glew/glew-1.9.0/lib/glew64.lib new file mode 100644 index 0000000..1982f98 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew64.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew64mx.lib b/thirdparty/glew/glew-1.9.0/lib/glew64mx.lib new file mode 100644 index 0000000..53e03b2 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew64mx.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew64mxs.lib b/thirdparty/glew/glew-1.9.0/lib/glew64mxs.lib new file mode 100644 index 0000000..6e731b2 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew64mxs.lib differ diff --git a/thirdparty/glew/glew-1.9.0/lib/glew64s.lib b/thirdparty/glew/glew-1.9.0/lib/glew64s.lib new file mode 100644 index 0000000..4316171 Binary files /dev/null and b/thirdparty/glew/glew-1.9.0/lib/glew64s.lib differ diff --git a/thirdparty/glew/glew-1.9.0/src/glew.c b/thirdparty/glew/glew-1.9.0/src/glew.c new file mode 100644 index 0000000..cf430f8 --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/src/glew.c @@ -0,0 +1,16972 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#if defined(_WIN32) +# include +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +# include +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + void* addr; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = dlopen("libRegal.dylib", RTLD_LAZY); +#else + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); +#endif + } + if( !image ) return NULL; + addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { +#ifdef GLEW_REGAL + image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#else + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#endif + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +#elif defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +#elif defined(__ANDROID__) +# define glewGetProcAddress(name) NULL /* TODO */ +#else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +#endif + +/* + * Define GLboolean const cast. + */ +#define CONST_CAST(x) (*(GLboolean*)&x) + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return (s[i] == '\0' || s[i] == c) ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) +{ + const GLubyte* p; + GLuint len = _glewStrLen((const GLubyte*)name); + p = start; + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +#if !defined(_WIN32) || !defined(GLEW_MX) + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; +PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; +PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; +PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; +PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; +PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; + +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; + +PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; +PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; +PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; + +PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; + +PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; +PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; +PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; +PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; +PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; +PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; +PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; +PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; +PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; + +PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; +PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; +PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; +PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; +PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; +PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; +PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; +PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; + +PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; + +PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; +PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; +PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; +PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; +PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; +PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; +PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; +PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; +PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; +PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; +PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; +PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; +PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; +PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; +PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; +PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; +PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT = NULL; +PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT = NULL; +PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT = NULL; +PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT = NULL; +PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; +PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; +PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; +PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; +PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; +PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; + +PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; +PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; + +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; +PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; +PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; +PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; +PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; +PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; +PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; +PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; +PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; +PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; +PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; +PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; +PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; +PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; +PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; +PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; +PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; +PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; +PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; +PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; +PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; +PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; +PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; +PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; +PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; +PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; +PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; +PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; +PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; +PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; +PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; +PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; +PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; +PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; + +PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; + +PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; +PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; +PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; +PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; +PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; +PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; +PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; + +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; + +PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; +PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; +PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; +PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; +PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; +PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; +PFNGLGETPOINTERVPROC __glewGetPointerv = NULL; +PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; +PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; +PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; + +PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; +PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; +PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; +PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; +PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; +PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; +PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; +PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; +PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; +PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; +PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + +PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; +PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; +PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; + +PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; + +PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; + +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; + +PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; +PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; +PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; +PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; +PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; +PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; +PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; +PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; +PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; +PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; +PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; +PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; +PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; +PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; +PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; +PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; +PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; +PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; +PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; +PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; +PFNGLISPATHNVPROC __glewIsPathNV = NULL; +PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; +PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; +PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; +PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; +PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; +PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; +PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; +PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; +PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; +PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; +PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; +PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; +PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; +PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; +PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; +PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; +PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; +PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; +PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; +PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; +PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; +PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; +PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; +PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; + +PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; +PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; +PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; +PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; +PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; +PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; +PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; + +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; +PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; +PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; +PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; + +PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; +PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; +PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; +PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; +PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; +PFNGLORTHOFOESPROC __glewOrthofOES = NULL; + +PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; + +PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; +PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_VERSION_4_2 = GL_FALSE; +GLboolean __GLEW_VERSION_4_3 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; +GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; +GLboolean __GLEW_AMD_sample_positions = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; +GLboolean __GLEW_ARB_base_instance = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; +GLboolean __GLEW_ARB_compute_shader = GL_FALSE; +GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_copy_image = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; +GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; +GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage = GL_FALSE; +GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_texture_view = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_debug_marker = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_float = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_integer = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; +GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; +GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KHR_debug = GL_FALSE; +GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NV_bindless_texture = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_path_rendering = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_multisample = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_NV_video_capture = GL_FALSE; +GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; +GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; +GLboolean __GLEW_OES_read_format = GL_FALSE; +GLboolean __GLEW_OES_single_precision = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_REGAL_error_string = GL_FALSE; +GLboolean __GLEW_REGAL_extension_query = GL_FALSE; +GLboolean __GLEW_REGAL_log = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_2_1 + +#endif /* GL_VERSION_1_2_1 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; + r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_VERSION_2_1 + +static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; + r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; + r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; + r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; + r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; + r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_1 */ + +#ifdef GL_VERSION_3_0 + +static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_1 + +#endif /* GL_VERSION_4_1 */ + +#ifdef GL_VERSION_4_2 + +#endif /* GL_VERSION_4_2 */ + +#ifdef GL_VERSION_4_3 + +#endif /* GL_VERSION_4_3 */ + +#ifdef GL_3DFX_multisample + +#endif /* GL_3DFX_multisample */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_3DFX_texture_compression_FXT1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifdef GL_AMD_blend_minmax_factor + +#endif /* GL_AMD_blend_minmax_factor */ + +#ifdef GL_AMD_conservative_depth + +#endif /* GL_AMD_conservative_depth */ + +#ifdef GL_AMD_debug_output + +static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_depth_clamp_separate + +#endif /* GL_AMD_depth_clamp_separate */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_multi_draw_indirect + +static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; + r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_multi_draw_indirect */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_pinned_memory + +#endif /* GL_AMD_pinned_memory */ + +#ifdef GL_AMD_query_buffer_object + +#endif /* GL_AMD_query_buffer_object */ + +#ifdef GL_AMD_sample_positions + +static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_sample_positions */ + +#ifdef GL_AMD_seamless_cubemap_per_texture + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifdef GL_AMD_shader_stencil_export + +#endif /* GL_AMD_shader_stencil_export */ + +#ifdef GL_AMD_stencil_operation_extended + +static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_stencil_operation_extended */ + +#ifdef GL_AMD_texture_texture4 + +#endif /* GL_AMD_texture_texture4 */ + +#ifdef GL_AMD_transform_feedback3_lines_triangles + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifdef GL_AMD_vertex_shader_layer + +#endif /* GL_AMD_vertex_shader_layer */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_AMD_vertex_shader_viewport_index + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifdef GL_APPLE_aux_depth_stencil + +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifdef GL_APPLE_client_storage + +#endif /* GL_APPLE_client_storage */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_float_pixels + +#endif /* GL_APPLE_float_pixels */ + +#ifdef GL_APPLE_flush_buffer_range + +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; + r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_flush_buffer_range */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_pixel_buffer + +#endif /* GL_APPLE_pixel_buffer */ + +#ifdef GL_APPLE_rgb_422 + +#endif /* GL_APPLE_rgb_422 */ + +#ifdef GL_APPLE_row_bytes + +#endif /* GL_APPLE_row_bytes */ + +#ifdef GL_APPLE_specular_vector + +#endif /* GL_APPLE_specular_vector */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_transform_hint + +#endif /* GL_APPLE_transform_hint */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_vertex_program_evaluators + +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_APPLE_ycbcr_422 + +#endif /* GL_APPLE_ycbcr_422 */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_ES3_compatibility + +#endif /* GL_ARB_ES3_compatibility */ + +#ifdef GL_ARB_arrays_of_arrays + +#endif /* GL_ARB_arrays_of_arrays */ + +#ifdef GL_ARB_base_instance + +static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_base_instance */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_clear_buffer_object + +static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; + r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; + r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; + r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_clear_buffer_object */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_compatibility + +#endif /* GL_ARB_compatibility */ + +#ifdef GL_ARB_compressed_texture_pixel_storage + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifdef GL_ARB_compute_shader + +static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; + r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_compute_shader */ + +#ifdef GL_ARB_conservative_depth + +#endif /* GL_ARB_conservative_depth */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_copy_image + +static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_image */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_depth_buffer_float + +#endif /* GL_ARB_depth_buffer_float */ + +#ifdef GL_ARB_depth_clamp + +#endif /* GL_ARB_depth_clamp */ + +#ifdef GL_ARB_depth_texture + +#endif /* GL_ARB_depth_texture */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_draw_buffers_blend + +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers_blend */ + +#ifdef GL_ARB_draw_elements_base_vertex + +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_draw_instanced + +#endif /* GL_ARB_draw_instanced */ + +#ifdef GL_ARB_explicit_attrib_location + +#endif /* GL_ARB_explicit_attrib_location */ + +#ifdef GL_ARB_explicit_uniform_location + +#endif /* GL_ARB_explicit_uniform_location */ + +#ifdef GL_ARB_fragment_coord_conventions + +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifdef GL_ARB_fragment_layer_viewport + +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifdef GL_ARB_fragment_program + +#endif /* GL_ARB_fragment_program */ + +#ifdef GL_ARB_fragment_program_shadow + +#endif /* GL_ARB_fragment_program_shadow */ + +#ifdef GL_ARB_fragment_shader + +#endif /* GL_ARB_fragment_shader */ + +#ifdef GL_ARB_framebuffer_no_attachments + +static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; + r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; + r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; + r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_framebuffer_sRGB + +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_gpu_shader5 + +#endif /* GL_ARB_gpu_shader5 */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_half_float_pixel + +#endif /* GL_ARB_half_float_pixel */ + +#ifdef GL_ARB_half_float_vertex + +#endif /* GL_ARB_half_float_vertex */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_internalformat_query + +static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query */ + +#ifdef GL_ARB_internalformat_query2 + +static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_internalformat_query2 */ + +#ifdef GL_ARB_invalidate_subdata + +static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; + r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; + r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; + r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; + r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; + r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_invalidate_subdata */ + +#ifdef GL_ARB_map_buffer_alignment + +#endif /* GL_ARB_map_buffer_alignment */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multi_draw_indirect + +static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; + r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multi_draw_indirect */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_occlusion_query2 + +#endif /* GL_ARB_occlusion_query2 */ + +#ifdef GL_ARB_pixel_buffer_object + +#endif /* GL_ARB_pixel_buffer_object */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_point_sprite + +#endif /* GL_ARB_point_sprite */ + +#ifdef GL_ARB_program_interface_query + +static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; + r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; + r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; + r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; + r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; + r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_program_interface_query */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_robust_buffer_access_behavior + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_robustness_application_isolation + +#endif /* GL_ARB_robustness_application_isolation */ + +#ifdef GL_ARB_robustness_share_group_isolation + +#endif /* GL_ARB_robustness_share_group_isolation */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_seamless_cube_map + +#endif /* GL_ARB_seamless_cube_map */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_atomic_counters + +static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_atomic_counters */ + +#ifdef GL_ARB_shader_bit_encoding + +#endif /* GL_ARB_shader_bit_encoding */ + +#ifdef GL_ARB_shader_image_load_store + +static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; + r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_image_load_store */ + +#ifdef GL_ARB_shader_image_size + +#endif /* GL_ARB_shader_image_size */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shader_precision + +#endif /* GL_ARB_shader_precision */ + +#ifdef GL_ARB_shader_stencil_export + +#endif /* GL_ARB_shader_stencil_export */ + +#ifdef GL_ARB_shader_storage_buffer_object + +static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifdef GL_ARB_shader_subroutine + +static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shader_texture_lod + +#endif /* GL_ARB_shader_texture_lod */ + +#ifdef GL_ARB_shading_language_100 + +#endif /* GL_ARB_shading_language_100 */ + +#ifdef GL_ARB_shading_language_420pack + +#endif /* GL_ARB_shading_language_420pack */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_shading_language_packing + +#endif /* GL_ARB_shading_language_packing */ + +#ifdef GL_ARB_shadow + +#endif /* GL_ARB_shadow */ + +#ifdef GL_ARB_shadow_ambient + +#endif /* GL_ARB_shadow_ambient */ + +#ifdef GL_ARB_stencil_texturing + +#endif /* GL_ARB_stencil_texturing */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_border_clamp + +#endif /* GL_ARB_texture_border_clamp */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_object_rgb32 + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifdef GL_ARB_texture_buffer_range + +static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; + r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_range */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_compression_bptc + +#endif /* GL_ARB_texture_compression_bptc */ + +#ifdef GL_ARB_texture_compression_rgtc + +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifdef GL_ARB_texture_cube_map + +#endif /* GL_ARB_texture_cube_map */ + +#ifdef GL_ARB_texture_cube_map_array + +#endif /* GL_ARB_texture_cube_map_array */ + +#ifdef GL_ARB_texture_env_add + +#endif /* GL_ARB_texture_env_add */ + +#ifdef GL_ARB_texture_env_combine + +#endif /* GL_ARB_texture_env_combine */ + +#ifdef GL_ARB_texture_env_crossbar + +#endif /* GL_ARB_texture_env_crossbar */ + +#ifdef GL_ARB_texture_env_dot3 + +#endif /* GL_ARB_texture_env_dot3 */ + +#ifdef GL_ARB_texture_float + +#endif /* GL_ARB_texture_float */ + +#ifdef GL_ARB_texture_gather + +#endif /* GL_ARB_texture_gather */ + +#ifdef GL_ARB_texture_mirrored_repeat + +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifdef GL_ARB_texture_multisample + +static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_multisample */ + +#ifdef GL_ARB_texture_non_power_of_two + +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifdef GL_ARB_texture_query_levels + +#endif /* GL_ARB_texture_query_levels */ + +#ifdef GL_ARB_texture_query_lod + +#endif /* GL_ARB_texture_query_lod */ + +#ifdef GL_ARB_texture_rectangle + +#endif /* GL_ARB_texture_rectangle */ + +#ifdef GL_ARB_texture_rg + +#endif /* GL_ARB_texture_rg */ + +#ifdef GL_ARB_texture_rgb10_a2ui + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifdef GL_ARB_texture_storage + +static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; + r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; + r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; + r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; + r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; + r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage */ + +#ifdef GL_ARB_texture_storage_multisample + +static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; + r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; + r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; + r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_storage_multisample */ + +#ifdef GL_ARB_texture_swizzle + +#endif /* GL_ARB_texture_swizzle */ + +#ifdef GL_ARB_texture_view + +static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_view */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transform_feedback_instanced + +static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; + r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_bgra + +#endif /* GL_ARB_vertex_array_bgra */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_attrib_binding + +static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; + r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; + r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; + r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; + r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; + r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATIX_point_sprites + +#endif /* GL_ATIX_point_sprites */ + +#ifdef GL_ATIX_texture_env_combine3 + +#endif /* GL_ATIX_texture_env_combine3 */ + +#ifdef GL_ATIX_texture_env_route + +#endif /* GL_ATIX_texture_env_route */ + +#ifdef GL_ATIX_vertex_shader_output_point_size + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_meminfo + +#endif /* GL_ATI_meminfo */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_shader_texture_lod + +#endif /* GL_ATI_shader_texture_lod */ + +#ifdef GL_ATI_text_fragment_shader + +#endif /* GL_ATI_text_fragment_shader */ + +#ifdef GL_ATI_texture_compression_3dc + +#endif /* GL_ATI_texture_compression_3dc */ + +#ifdef GL_ATI_texture_env_combine3 + +#endif /* GL_ATI_texture_env_combine3 */ + +#ifdef GL_ATI_texture_float + +#endif /* GL_ATI_texture_float */ + +#ifdef GL_ATI_texture_mirror_once + +#endif /* GL_ATI_texture_mirror_once */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; + r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; + r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; + r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; + r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; + r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; + r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; + r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_422_pixels + +#endif /* GL_EXT_422_pixels */ + +#ifdef GL_EXT_Cg_shader + +#endif /* GL_EXT_Cg_shader */ + +#ifdef GL_EXT_abgr + +#endif /* GL_EXT_abgr */ + +#ifdef GL_EXT_bgra + +#endif /* GL_EXT_bgra */ + +#ifdef GL_EXT_bindable_uniform + +static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; + r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; + r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_bindable_uniform */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_logic_op + +#endif /* GL_EXT_blend_logic_op */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_blend_subtract + +#endif /* GL_EXT_blend_subtract */ + +#ifdef GL_EXT_clip_volume_hint + +#endif /* GL_EXT_clip_volume_hint */ + +#ifdef GL_EXT_cmyka + +#endif /* GL_EXT_cmyka */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_debug_marker + +static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; + r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; + r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_debug_marker */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dEXT")) == NULL) || r; + r = ((glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dvEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dEXT")) == NULL) || r; + r = ((glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dvEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dEXT")) == NULL) || r; + r = ((glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dvEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dEXT")) == NULL) || r; + r = ((glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dvEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_draw_buffers2 + +static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; + r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; + r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; + r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; + r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; + r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers2 */ + +#ifdef GL_EXT_draw_instanced + +static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; + r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_instanced */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_framebuffer_sRGB + +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifdef GL_EXT_geometry_shader4 + +static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; + r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_geometry_shader4 */ + +#ifdef GL_EXT_gpu_program_parameters + +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; + r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_program_parameters */ + +#ifdef GL_EXT_gpu_shader4 + +static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; + r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; + r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; + r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; + r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; + r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; + r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; + r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; + r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; + r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; + r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; + r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; + r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; + r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; + r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; + r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; + r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; + r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; + r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; + r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; + r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; + r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; + r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; + r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; + r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; + r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; + r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; + r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; + r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; + r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; + r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; + r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; + r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; + r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_shader4 */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_array_formats + +#endif /* GL_EXT_index_array_formats */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_index_texture + +#endif /* GL_EXT_index_texture */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_misc_attribute + +#endif /* GL_EXT_misc_attribute */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_packed_depth_stencil + +#endif /* GL_EXT_packed_depth_stencil */ + +#ifdef GL_EXT_packed_float + +#endif /* GL_EXT_packed_float */ + +#ifdef GL_EXT_packed_pixels + +#endif /* GL_EXT_packed_pixels */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_buffer_object + +#endif /* GL_EXT_pixel_buffer_object */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_pixel_transform_color_table + +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_rescale_normal + +#endif /* GL_EXT_rescale_normal */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_separate_specular_color + +#endif /* GL_EXT_separate_specular_color */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shadow_funcs + +#endif /* GL_EXT_shadow_funcs */ + +#ifdef GL_EXT_shared_texture_palette + +#endif /* GL_EXT_shared_texture_palette */ + +#ifdef GL_EXT_stencil_clear_tag + +#endif /* GL_EXT_stencil_clear_tag */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_stencil_wrap + +#endif /* GL_EXT_stencil_wrap */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture + +#endif /* GL_EXT_texture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_array + +static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_array */ + +#ifdef GL_EXT_texture_buffer_object + +static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_buffer_object */ + +#ifdef GL_EXT_texture_compression_dxt1 + +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifdef GL_EXT_texture_compression_latc + +#endif /* GL_EXT_texture_compression_latc */ + +#ifdef GL_EXT_texture_compression_rgtc + +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifdef GL_EXT_texture_compression_s3tc + +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifdef GL_EXT_texture_cube_map + +#endif /* GL_EXT_texture_cube_map */ + +#ifdef GL_EXT_texture_edge_clamp + +#endif /* GL_EXT_texture_edge_clamp */ + +#ifdef GL_EXT_texture_env + +#endif /* GL_EXT_texture_env */ + +#ifdef GL_EXT_texture_env_add + +#endif /* GL_EXT_texture_env_add */ + +#ifdef GL_EXT_texture_env_combine + +#endif /* GL_EXT_texture_env_combine */ + +#ifdef GL_EXT_texture_env_dot3 + +#endif /* GL_EXT_texture_env_dot3 */ + +#ifdef GL_EXT_texture_filter_anisotropic + +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifdef GL_EXT_texture_integer + +static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; + r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; + r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; + r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; + r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; + r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_integer */ + +#ifdef GL_EXT_texture_lod_bias + +#endif /* GL_EXT_texture_lod_bias */ + +#ifdef GL_EXT_texture_mirror_clamp + +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_rectangle + +#endif /* GL_EXT_texture_rectangle */ + +#ifdef GL_EXT_texture_sRGB + +#endif /* GL_EXT_texture_sRGB */ + +#ifdef GL_EXT_texture_sRGB_decode + +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifdef GL_EXT_texture_shared_exponent + +#endif /* GL_EXT_texture_shared_exponent */ + +#ifdef GL_EXT_texture_snorm + +#endif /* GL_EXT_texture_snorm */ + +#ifdef GL_EXT_texture_swizzle + +#endif /* GL_EXT_texture_swizzle */ + +#ifdef GL_EXT_timer_query + +static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; + r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_timer_query */ + +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_array_bgra + +#endif /* GL_EXT_vertex_array_bgra */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_EXT_x11_sync_object + +static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_x11_sync_object */ + +#ifdef GL_GREMEDY_frame_terminator + +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_frame_terminator */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_convolution_border_modes + +#endif /* GL_HP_convolution_border_modes */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_HP_occlusion_test + +#endif /* GL_HP_occlusion_test */ + +#ifdef GL_HP_texture_lighting + +#endif /* GL_HP_texture_lighting */ + +#ifdef GL_IBM_cull_vertex + +#endif /* GL_IBM_cull_vertex */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_rasterpos_clip + +#endif /* GL_IBM_rasterpos_clip */ + +#ifdef GL_IBM_static_data + +#endif /* GL_IBM_static_data */ + +#ifdef GL_IBM_texture_mirrored_repeat + +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INGR_color_clamp + +#endif /* GL_INGR_color_clamp */ + +#ifdef GL_INGR_interlace_read + +#endif /* GL_INGR_interlace_read */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KHR_debug + +static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; + r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; + r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; + r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; + r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; + r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; + r = ((glGetPointerv = (PFNGLGETPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetPointerv")) == NULL) || r; + r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; + r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; + r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; + + return r; +} + +#endif /* GL_KHR_debug */ + +#ifdef GL_KHR_texture_compression_astc_ldr + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; + r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; + r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; + r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; + r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESAX_texture_stack + +#endif /* GL_MESAX_texture_stack */ + +#ifdef GL_MESA_pack_invert + +#endif /* GL_MESA_pack_invert */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_MESA_ycbcr_texture + +#endif /* GL_MESA_ycbcr_texture */ + +#ifdef GL_NVX_gpu_memory_info + +#endif /* GL_NVX_gpu_memory_info */ + +#ifdef GL_NV_bindless_texture + +static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; + r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; + r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; + r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; + r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; + r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; + r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; + r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; + r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; + r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; + r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; + r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_bindless_texture */ + +#ifdef GL_NV_blend_square + +#endif /* GL_NV_blend_square */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_copy_depth_to_color + +#endif /* GL_NV_copy_depth_to_color */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ + +#ifdef GL_NV_depth_buffer_float + +static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; + r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; + r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_depth_buffer_float */ + +#ifdef GL_NV_depth_clamp + +#endif /* GL_NV_depth_clamp */ + +#ifdef GL_NV_depth_range_unclamped + +#endif /* GL_NV_depth_range_unclamped */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_float_buffer + +#endif /* GL_NV_float_buffer */ + +#ifdef GL_NV_fog_distance + +#endif /* GL_NV_fog_distance */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_fragment_program2 + +#endif /* GL_NV_fragment_program2 */ + +#ifdef GL_NV_fragment_program4 + +#endif /* GL_NV_fragment_program4 */ + +#ifdef GL_NV_fragment_program_option + +#endif /* GL_NV_fragment_program_option */ + +#ifdef GL_NV_framebuffer_multisample_coverage + +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifdef GL_NV_geometry_program4 + +static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_geometry_program4 */ + +#ifdef GL_NV_geometry_shader4 + +#endif /* GL_NV_geometry_shader4 */ + +#ifdef GL_NV_gpu_program4 + +static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; + r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; + r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_program4 */ + +#ifdef GL_NV_gpu_program5 + +#endif /* GL_NV_gpu_program5 */ + +#ifdef GL_NV_gpu_program_fp64 + +#endif /* GL_NV_gpu_program_fp64 */ + +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_light_max_exponent + +#endif /* GL_NV_light_max_exponent */ + +#ifdef GL_NV_multisample_coverage + +#endif /* GL_NV_multisample_coverage */ + +#ifdef GL_NV_multisample_filter_hint + +#endif /* GL_NV_multisample_filter_hint */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_packed_depth_stencil + +#endif /* GL_NV_packed_depth_stencil */ + +#ifdef GL_NV_parameter_buffer_object + +static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; + r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; + r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_parameter_buffer_object */ + +#ifdef GL_NV_parameter_buffer_object2 + +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifdef GL_NV_path_rendering + +static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; + r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; + r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; + r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; + r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; + r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; + r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; + r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; + r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; + r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; + r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; + r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; + r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; + r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; + r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; + r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; + r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; + r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; + r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; + r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; + r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; + r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; + r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; + r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; + r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; + r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; + r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; + r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; + r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; + r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; + r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; + r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; + r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; + r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; + r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; + r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; + r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; + r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; + r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; + r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; + r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; + r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; + r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; + r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; + r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; + r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; + r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; + r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; + r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_path_rendering */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_shader_atomic_float + +#endif /* GL_NV_shader_atomic_float */ + +#ifdef GL_NV_shader_buffer_load + +static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_shader_buffer_load */ + +#ifdef GL_NV_tessellation_program5 + +#endif /* GL_NV_tessellation_program5 */ + +#ifdef GL_NV_texgen_emboss + +#endif /* GL_NV_texgen_emboss */ + +#ifdef GL_NV_texgen_reflection + +#endif /* GL_NV_texgen_reflection */ + +#ifdef GL_NV_texture_barrier + +static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_compression_vtc + +#endif /* GL_NV_texture_compression_vtc */ + +#ifdef GL_NV_texture_env_combine4 + +#endif /* GL_NV_texture_env_combine4 */ + +#ifdef GL_NV_texture_expand_normal + +#endif /* GL_NV_texture_expand_normal */ + +#ifdef GL_NV_texture_multisample + +static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; + r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_multisample */ + +#ifdef GL_NV_texture_rectangle + +#endif /* GL_NV_texture_rectangle */ + +#ifdef GL_NV_texture_shader + +#endif /* GL_NV_texture_shader */ + +#ifdef GL_NV_texture_shader2 + +#endif /* GL_NV_texture_shader2 */ + +#ifdef GL_NV_texture_shader3 + +#endif /* GL_NV_texture_shader3 */ + +#ifdef GL_NV_transform_feedback + +static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; + r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; + r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; + r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; + r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; + r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; + r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; + r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; + r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; + r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback */ + +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_array_range2 + +#endif /* GL_NV_vertex_array_range2 */ + +#ifdef GL_NV_vertex_attrib_integer_64bit + +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_vertex_program1_1 + +#endif /* GL_NV_vertex_program1_1 */ + +#ifdef GL_NV_vertex_program2 + +#endif /* GL_NV_vertex_program2 */ + +#ifdef GL_NV_vertex_program2_option + +#endif /* GL_NV_vertex_program2_option */ + +#ifdef GL_NV_vertex_program3 + +#endif /* GL_NV_vertex_program3 */ + +#ifdef GL_NV_vertex_program4 + +#endif /* GL_NV_vertex_program4 */ + +#ifdef GL_NV_video_capture + +static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; + r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; + r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; + r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; + r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; + r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; + r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_video_capture */ + +#ifdef GL_OES_byte_coordinates + +#endif /* GL_OES_byte_coordinates */ + +#ifdef GL_OES_compressed_paletted_texture + +#endif /* GL_OES_compressed_paletted_texture */ + +#ifdef GL_OES_read_format + +#endif /* GL_OES_read_format */ + +#ifdef GL_OES_single_precision + +static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; + r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; + r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; + r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; + r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; + r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; + + return r; +} + +#endif /* GL_OES_single_precision */ + +#ifdef GL_OML_interlace + +#endif /* GL_OML_interlace */ + +#ifdef GL_OML_resample + +#endif /* GL_OML_resample */ + +#ifdef GL_OML_subsample + +#endif /* GL_OML_subsample */ + +#ifdef GL_PGI_misc_hints + +#endif /* GL_PGI_misc_hints */ + +#ifdef GL_PGI_vertex_hints + +#endif /* GL_PGI_vertex_hints */ + +#ifdef GL_REGAL_error_string + +static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_error_string */ + +#ifdef GL_REGAL_extension_query + +static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; + r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; + + return r; +} + +#endif /* GL_REGAL_extension_query */ + +#ifdef GL_REGAL_log + +#endif /* GL_REGAL_log */ + +#ifdef GL_REND_screen_coordinates + +#endif /* GL_REND_screen_coordinates */ + +#ifdef GL_S3_s3tc + +#endif /* GL_S3_s3tc */ + +#ifdef GL_SGIS_color_range + +#endif /* GL_SGIS_color_range */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_generate_mipmap + +#endif /* GL_SGIS_generate_mipmap */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_pixel_texture + +#endif /* GL_SGIS_pixel_texture */ + +#ifdef GL_SGIS_point_line_texgen + +#endif /* GL_SGIS_point_line_texgen */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_border_clamp + +#endif /* GL_SGIS_texture_border_clamp */ + +#ifdef GL_SGIS_texture_edge_clamp + +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIS_texture_lod + +#endif /* GL_SGIS_texture_lod */ + +#ifdef GL_SGIS_texture_select + +#endif /* GL_SGIS_texture_select */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_async_histogram + +#endif /* GL_SGIX_async_histogram */ + +#ifdef GL_SGIX_async_pixel + +#endif /* GL_SGIX_async_pixel */ + +#ifdef GL_SGIX_blend_alpha_minmax + +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifdef GL_SGIX_clipmap + +#endif /* GL_SGIX_clipmap */ + +#ifdef GL_SGIX_convolution_accuracy + +#endif /* GL_SGIX_convolution_accuracy */ + +#ifdef GL_SGIX_depth_texture + +#endif /* GL_SGIX_depth_texture */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_offset + +#endif /* GL_SGIX_fog_offset */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_interlace + +#endif /* GL_SGIX_interlace */ + +#ifdef GL_SGIX_ir_instrument1 + +#endif /* GL_SGIX_ir_instrument1 */ + +#ifdef GL_SGIX_list_priority + +#endif /* GL_SGIX_list_priority */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_pixel_texture_bits + +#endif /* GL_SGIX_pixel_texture_bits */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_resample + +#endif /* GL_SGIX_resample */ + +#ifdef GL_SGIX_shadow + +#endif /* GL_SGIX_shadow */ + +#ifdef GL_SGIX_shadow_ambient + +#endif /* GL_SGIX_shadow_ambient */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_texture_add_env + +#endif /* GL_SGIX_texture_add_env */ + +#ifdef GL_SGIX_texture_coordinate_clamp + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifdef GL_SGIX_texture_lod_bias + +#endif /* GL_SGIX_texture_lod_bias */ + +#ifdef GL_SGIX_texture_multi_buffer + +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifdef GL_SGIX_texture_range + +#endif /* GL_SGIX_texture_range */ + +#ifdef GL_SGIX_texture_scale_bias + +#endif /* GL_SGIX_texture_scale_bias */ + +#ifdef GL_SGIX_vertex_preclip + +#endif /* GL_SGIX_vertex_preclip */ + +#ifdef GL_SGIX_vertex_preclip_hint + +#endif /* GL_SGIX_vertex_preclip_hint */ + +#ifdef GL_SGIX_ycrcb + +#endif /* GL_SGIX_ycrcb */ + +#ifdef GL_SGI_color_matrix + +#endif /* GL_SGI_color_matrix */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_texture_color_table + +#endif /* GL_SGI_texture_color_table */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_convolution_border_modes + +#endif /* GL_SUN_convolution_border_modes */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_mesh_array + +#endif /* GL_SUN_mesh_array */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_slice_accum + +#endif /* GL_SUN_slice_accum */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_phong_shading + +#endif /* GL_WIN_phong_shading */ + +#ifdef GL_WIN_specular_fog + +#endif /* GL_WIN_specular_fog */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +GLboolean GLEWAPIENTRY glewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + start = (const GLubyte*)glGetString(GL_EXTENSIONS); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot; + GLint major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + CONST_CAST(GLEW_VERSION_4_3) = ( major > 4 ) || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + + /* query opengl extensions string */ + extStart = glGetString(GL_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte*)""; + extEnd = extStart + _glewStrLen(extStart); + + /* initialize extensions */ +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_2_1 +#endif /* GL_VERSION_1_2_1 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_VERSION_2_1 + if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_1 */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_1 +#endif /* GL_VERSION_4_1 */ +#ifdef GL_VERSION_4_2 +#endif /* GL_VERSION_4_2 */ +#ifdef GL_VERSION_4_3 +#endif /* GL_VERSION_4_3 */ +#ifdef GL_3DFX_multisample + CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); +#endif /* GL_3DFX_multisample */ +#ifdef GL_3DFX_tbuffer + CONST_CAST(GLEW_3DFX_tbuffer) = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); + if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_3DFX_texture_compression_FXT1 + CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); +#endif /* GL_3DFX_texture_compression_FXT1 */ +#ifdef GL_AMD_blend_minmax_factor + CONST_CAST(GLEW_AMD_blend_minmax_factor) = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); +#endif /* GL_AMD_blend_minmax_factor */ +#ifdef GL_AMD_conservative_depth + CONST_CAST(GLEW_AMD_conservative_depth) = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); +#endif /* GL_AMD_conservative_depth */ +#ifdef GL_AMD_debug_output + CONST_CAST(GLEW_AMD_debug_output) = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_depth_clamp_separate + CONST_CAST(GLEW_AMD_depth_clamp_separate) = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); +#endif /* GL_AMD_depth_clamp_separate */ +#ifdef GL_AMD_draw_buffers_blend + CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_multi_draw_indirect + CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_multi_draw_indirect */ +#ifdef GL_AMD_name_gen_delete + CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); + if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_performance_monitor + CONST_CAST(GLEW_AMD_performance_monitor) = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); + if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_pinned_memory + CONST_CAST(GLEW_AMD_pinned_memory) = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); +#endif /* GL_AMD_pinned_memory */ +#ifdef GL_AMD_query_buffer_object + CONST_CAST(GLEW_AMD_query_buffer_object) = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); +#endif /* GL_AMD_query_buffer_object */ +#ifdef GL_AMD_sample_positions + CONST_CAST(GLEW_AMD_sample_positions) = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); + if (glewExperimental || GLEW_AMD_sample_positions) CONST_CAST(GLEW_AMD_sample_positions) = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_sample_positions */ +#ifdef GL_AMD_seamless_cubemap_per_texture + CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); +#endif /* GL_AMD_seamless_cubemap_per_texture */ +#ifdef GL_AMD_shader_stencil_export + CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); +#endif /* GL_AMD_shader_stencil_export */ +#ifdef GL_AMD_stencil_operation_extended + CONST_CAST(GLEW_AMD_stencil_operation_extended) = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); + if (glewExperimental || GLEW_AMD_stencil_operation_extended) CONST_CAST(GLEW_AMD_stencil_operation_extended) = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_stencil_operation_extended */ +#ifdef GL_AMD_texture_texture4 + CONST_CAST(GLEW_AMD_texture_texture4) = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); +#endif /* GL_AMD_texture_texture4 */ +#ifdef GL_AMD_transform_feedback3_lines_triangles + CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); +#endif /* GL_AMD_transform_feedback3_lines_triangles */ +#ifdef GL_AMD_vertex_shader_layer + CONST_CAST(GLEW_AMD_vertex_shader_layer) = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_layer */ +#ifdef GL_AMD_vertex_shader_tessellator + CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_AMD_vertex_shader_viewport_index + CONST_CAST(GLEW_AMD_vertex_shader_viewport_index) = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); +#endif /* GL_AMD_vertex_shader_viewport_index */ +#ifdef GL_APPLE_aux_depth_stencil + CONST_CAST(GLEW_APPLE_aux_depth_stencil) = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); +#endif /* GL_APPLE_aux_depth_stencil */ +#ifdef GL_APPLE_client_storage + CONST_CAST(GLEW_APPLE_client_storage) = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); +#endif /* GL_APPLE_client_storage */ +#ifdef GL_APPLE_element_array + CONST_CAST(GLEW_APPLE_element_array) = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + CONST_CAST(GLEW_APPLE_fence) = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_float_pixels + CONST_CAST(GLEW_APPLE_float_pixels) = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); +#endif /* GL_APPLE_float_pixels */ +#ifdef GL_APPLE_flush_buffer_range + CONST_CAST(GLEW_APPLE_flush_buffer_range) = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_flush_buffer_range */ +#ifdef GL_APPLE_object_purgeable + CONST_CAST(GLEW_APPLE_object_purgeable) = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_pixel_buffer + CONST_CAST(GLEW_APPLE_pixel_buffer) = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); +#endif /* GL_APPLE_pixel_buffer */ +#ifdef GL_APPLE_rgb_422 + CONST_CAST(GLEW_APPLE_rgb_422) = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); +#endif /* GL_APPLE_rgb_422 */ +#ifdef GL_APPLE_row_bytes + CONST_CAST(GLEW_APPLE_row_bytes) = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); +#endif /* GL_APPLE_row_bytes */ +#ifdef GL_APPLE_specular_vector + CONST_CAST(GLEW_APPLE_specular_vector) = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); +#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_texture_range + CONST_CAST(GLEW_APPLE_texture_range) = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_transform_hint + CONST_CAST(GLEW_APPLE_transform_hint) = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); +#endif /* GL_APPLE_transform_hint */ +#ifdef GL_APPLE_vertex_array_object + CONST_CAST(GLEW_APPLE_vertex_array_object) = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + CONST_CAST(GLEW_APPLE_vertex_array_range) = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_vertex_program_evaluators + CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_APPLE_ycbcr_422 + CONST_CAST(GLEW_APPLE_ycbcr_422) = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); +#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_ARB_ES2_compatibility + CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); + if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_ES3_compatibility + CONST_CAST(GLEW_ARB_ES3_compatibility) = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); +#endif /* GL_ARB_ES3_compatibility */ +#ifdef GL_ARB_arrays_of_arrays + CONST_CAST(GLEW_ARB_arrays_of_arrays) = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); +#endif /* GL_ARB_arrays_of_arrays */ +#ifdef GL_ARB_base_instance + CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); + if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_base_instance */ +#ifdef GL_ARB_blend_func_extended + CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); + if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_cl_event + CONST_CAST(GLEW_ARB_cl_event) = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); + if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_clear_buffer_object + CONST_CAST(GLEW_ARB_clear_buffer_object) = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_clear_buffer_object) CONST_CAST(GLEW_ARB_clear_buffer_object) = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_clear_buffer_object */ +#ifdef GL_ARB_color_buffer_float + CONST_CAST(GLEW_ARB_color_buffer_float) = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_compatibility + CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); +#endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_compressed_texture_pixel_storage + CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); +#endif /* GL_ARB_compressed_texture_pixel_storage */ +#ifdef GL_ARB_compute_shader + CONST_CAST(GLEW_ARB_compute_shader) = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_compute_shader) CONST_CAST(GLEW_ARB_compute_shader) = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_compute_shader */ +#ifdef GL_ARB_conservative_depth + CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); +#endif /* GL_ARB_conservative_depth */ +#ifdef GL_ARB_copy_buffer + CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_copy_image + CONST_CAST(GLEW_ARB_copy_image) = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_ARB_copy_image) CONST_CAST(GLEW_ARB_copy_image) = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_image */ +#ifdef GL_ARB_debug_output + CONST_CAST(GLEW_ARB_debug_output) = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); + if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_depth_buffer_float + CONST_CAST(GLEW_ARB_depth_buffer_float) = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); +#endif /* GL_ARB_depth_buffer_float */ +#ifdef GL_ARB_depth_clamp + CONST_CAST(GLEW_ARB_depth_clamp) = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); +#endif /* GL_ARB_depth_clamp */ +#ifdef GL_ARB_depth_texture + CONST_CAST(GLEW_ARB_depth_texture) = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); +#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_draw_buffers + CONST_CAST(GLEW_ARB_draw_buffers) = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_draw_buffers_blend + CONST_CAST(GLEW_ARB_draw_buffers_blend) = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + CONST_CAST(GLEW_ARB_draw_indirect) = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_draw_instanced + CONST_CAST(GLEW_ARB_draw_instanced) = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); +#endif /* GL_ARB_draw_instanced */ +#ifdef GL_ARB_explicit_attrib_location + CONST_CAST(GLEW_ARB_explicit_attrib_location) = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); +#endif /* GL_ARB_explicit_attrib_location */ +#ifdef GL_ARB_explicit_uniform_location + CONST_CAST(GLEW_ARB_explicit_uniform_location) = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); +#endif /* GL_ARB_explicit_uniform_location */ +#ifdef GL_ARB_fragment_coord_conventions + CONST_CAST(GLEW_ARB_fragment_coord_conventions) = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); +#endif /* GL_ARB_fragment_coord_conventions */ +#ifdef GL_ARB_fragment_layer_viewport + CONST_CAST(GLEW_ARB_fragment_layer_viewport) = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); +#endif /* GL_ARB_fragment_layer_viewport */ +#ifdef GL_ARB_fragment_program + CONST_CAST(GLEW_ARB_fragment_program) = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); +#endif /* GL_ARB_fragment_program */ +#ifdef GL_ARB_fragment_program_shadow + CONST_CAST(GLEW_ARB_fragment_program_shadow) = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); +#endif /* GL_ARB_fragment_program_shadow */ +#ifdef GL_ARB_fragment_shader + CONST_CAST(GLEW_ARB_fragment_shader) = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); +#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_framebuffer_no_attachments + CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_no_attachments */ +#ifdef GL_ARB_framebuffer_object + CONST_CAST(GLEW_ARB_framebuffer_object) = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_framebuffer_sRGB + CONST_CAST(GLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_ARB_framebuffer_sRGB */ +#ifdef GL_ARB_geometry_shader4 + CONST_CAST(GLEW_ARB_geometry_shader4) = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + CONST_CAST(GLEW_ARB_get_program_binary) = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); + if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_gpu_shader5 + CONST_CAST(GLEW_ARB_gpu_shader5) = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); +#endif /* GL_ARB_gpu_shader5 */ +#ifdef GL_ARB_gpu_shader_fp64 + CONST_CAST(GLEW_ARB_gpu_shader_fp64) = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_half_float_pixel + CONST_CAST(GLEW_ARB_half_float_pixel) = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); +#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_half_float_vertex + CONST_CAST(GLEW_ARB_half_float_vertex) = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); +#endif /* GL_ARB_half_float_vertex */ +#ifdef GL_ARB_imaging + CONST_CAST(GLEW_ARB_imaging) = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); + if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_instanced_arrays + CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); + if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_internalformat_query + CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query */ +#ifdef GL_ARB_internalformat_query2 + CONST_CAST(GLEW_ARB_internalformat_query2) = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_internalformat_query2) CONST_CAST(GLEW_ARB_internalformat_query2) = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_internalformat_query2 */ +#ifdef GL_ARB_invalidate_subdata + CONST_CAST(GLEW_ARB_invalidate_subdata) = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); + if (glewExperimental || GLEW_ARB_invalidate_subdata) CONST_CAST(GLEW_ARB_invalidate_subdata) = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_invalidate_subdata */ +#ifdef GL_ARB_map_buffer_alignment + CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); +#endif /* GL_ARB_map_buffer_alignment */ +#ifdef GL_ARB_map_buffer_range + CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_map_buffer_range */ +#ifdef GL_ARB_matrix_palette + CONST_CAST(GLEW_ARB_matrix_palette) = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); + if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multi_draw_indirect + CONST_CAST(GLEW_ARB_multi_draw_indirect) = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multi_draw_indirect) CONST_CAST(GLEW_ARB_multi_draw_indirect) = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multi_draw_indirect */ +#ifdef GL_ARB_multisample + CONST_CAST(GLEW_ARB_multisample) = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + CONST_CAST(GLEW_ARB_multitexture) = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); + if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + CONST_CAST(GLEW_ARB_occlusion_query) = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_occlusion_query2 + CONST_CAST(GLEW_ARB_occlusion_query2) = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); +#endif /* GL_ARB_occlusion_query2 */ +#ifdef GL_ARB_pixel_buffer_object + CONST_CAST(GLEW_ARB_pixel_buffer_object) = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); +#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_point_parameters + CONST_CAST(GLEW_ARB_point_parameters) = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_point_sprite + CONST_CAST(GLEW_ARB_point_sprite) = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); +#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_program_interface_query + CONST_CAST(GLEW_ARB_program_interface_query) = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_program_interface_query) CONST_CAST(GLEW_ARB_program_interface_query) = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_program_interface_query */ +#ifdef GL_ARB_provoking_vertex + CONST_CAST(GLEW_ARB_provoking_vertex) = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_robust_buffer_access_behavior + CONST_CAST(GLEW_ARB_robust_buffer_access_behavior) = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); +#endif /* GL_ARB_robust_buffer_access_behavior */ +#ifdef GL_ARB_robustness + CONST_CAST(GLEW_ARB_robustness) = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); + if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_robustness_application_isolation + CONST_CAST(GLEW_ARB_robustness_application_isolation) = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_application_isolation */ +#ifdef GL_ARB_robustness_share_group_isolation + CONST_CAST(GLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GL_ARB_robustness_share_group_isolation */ +#ifdef GL_ARB_sample_shading + CONST_CAST(GLEW_ARB_sample_shading) = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + CONST_CAST(GLEW_ARB_sampler_objects) = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_seamless_cube_map + CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); +#endif /* GL_ARB_seamless_cube_map */ +#ifdef GL_ARB_separate_shader_objects + CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_atomic_counters + CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_atomic_counters */ +#ifdef GL_ARB_shader_bit_encoding + CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); +#endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_image_load_store + CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_image_load_store */ +#ifdef GL_ARB_shader_image_size + CONST_CAST(GLEW_ARB_shader_image_size) = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); +#endif /* GL_ARB_shader_image_size */ +#ifdef GL_ARB_shader_objects + CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shader_precision + CONST_CAST(GLEW_ARB_shader_precision) = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); +#endif /* GL_ARB_shader_precision */ +#ifdef GL_ARB_shader_stencil_export + CONST_CAST(GLEW_ARB_shader_stencil_export) = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); +#endif /* GL_ARB_shader_stencil_export */ +#ifdef GL_ARB_shader_storage_buffer_object + CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_storage_buffer_object */ +#ifdef GL_ARB_shader_subroutine + CONST_CAST(GLEW_ARB_shader_subroutine) = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shader_texture_lod + CONST_CAST(GLEW_ARB_shader_texture_lod) = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); +#endif /* GL_ARB_shader_texture_lod */ +#ifdef GL_ARB_shading_language_100 + CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); +#endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_420pack + CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); +#endif /* GL_ARB_shading_language_420pack */ +#ifdef GL_ARB_shading_language_include + CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); + if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shading_language_packing + CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); +#endif /* GL_ARB_shading_language_packing */ +#ifdef GL_ARB_shadow + CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); +#endif /* GL_ARB_shadow */ +#ifdef GL_ARB_shadow_ambient + CONST_CAST(GLEW_ARB_shadow_ambient) = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); +#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_stencil_texturing + CONST_CAST(GLEW_ARB_stencil_texturing) = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); +#endif /* GL_ARB_stencil_texturing */ +#ifdef GL_ARB_sync + CONST_CAST(GLEW_ARB_sync) = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); + if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + CONST_CAST(GLEW_ARB_tessellation_shader) = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_border_clamp + CONST_CAST(GLEW_ARB_texture_border_clamp) = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); +#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_texture_buffer_object + CONST_CAST(GLEW_ARB_texture_buffer_object) = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_object_rgb32 + CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); +#endif /* GL_ARB_texture_buffer_object_rgb32 */ +#ifdef GL_ARB_texture_buffer_range + CONST_CAST(GLEW_ARB_texture_buffer_range) = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_buffer_range) CONST_CAST(GLEW_ARB_texture_buffer_range) = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_range */ +#ifdef GL_ARB_texture_compression + CONST_CAST(GLEW_ARB_texture_compression) = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_compression_bptc + CONST_CAST(GLEW_ARB_texture_compression_bptc) = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_bptc */ +#ifdef GL_ARB_texture_compression_rgtc + CONST_CAST(GLEW_ARB_texture_compression_rgtc) = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_ARB_texture_compression_rgtc */ +#ifdef GL_ARB_texture_cube_map + CONST_CAST(GLEW_ARB_texture_cube_map) = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map */ +#ifdef GL_ARB_texture_cube_map_array + CONST_CAST(GLEW_ARB_texture_cube_map_array) = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); +#endif /* GL_ARB_texture_cube_map_array */ +#ifdef GL_ARB_texture_env_add + CONST_CAST(GLEW_ARB_texture_env_add) = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); +#endif /* GL_ARB_texture_env_add */ +#ifdef GL_ARB_texture_env_combine + CONST_CAST(GLEW_ARB_texture_env_combine) = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); +#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_env_crossbar + CONST_CAST(GLEW_ARB_texture_env_crossbar) = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); +#endif /* GL_ARB_texture_env_crossbar */ +#ifdef GL_ARB_texture_env_dot3 + CONST_CAST(GLEW_ARB_texture_env_dot3) = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); +#endif /* GL_ARB_texture_env_dot3 */ +#ifdef GL_ARB_texture_float + CONST_CAST(GLEW_ARB_texture_float) = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); +#endif /* GL_ARB_texture_float */ +#ifdef GL_ARB_texture_gather + CONST_CAST(GLEW_ARB_texture_gather) = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); +#endif /* GL_ARB_texture_gather */ +#ifdef GL_ARB_texture_mirrored_repeat + CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_ARB_texture_mirrored_repeat */ +#ifdef GL_ARB_texture_multisample + CONST_CAST(GLEW_ARB_texture_multisample) = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_non_power_of_two + CONST_CAST(GLEW_ARB_texture_non_power_of_two) = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); +#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_query_levels + CONST_CAST(GLEW_ARB_texture_query_levels) = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); +#endif /* GL_ARB_texture_query_levels */ +#ifdef GL_ARB_texture_query_lod + CONST_CAST(GLEW_ARB_texture_query_lod) = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); +#endif /* GL_ARB_texture_query_lod */ +#ifdef GL_ARB_texture_rectangle + CONST_CAST(GLEW_ARB_texture_rectangle) = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); +#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_texture_rg + CONST_CAST(GLEW_ARB_texture_rg) = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); +#endif /* GL_ARB_texture_rg */ +#ifdef GL_ARB_texture_rgb10_a2ui + CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); +#endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_storage + CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage */ +#ifdef GL_ARB_texture_storage_multisample + CONST_CAST(GLEW_ARB_texture_storage_multisample) = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_storage_multisample) CONST_CAST(GLEW_ARB_texture_storage_multisample) = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_storage_multisample */ +#ifdef GL_ARB_texture_swizzle + CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); +#endif /* GL_ARB_texture_swizzle */ +#ifdef GL_ARB_texture_view + CONST_CAST(GLEW_ARB_texture_view) = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); + if (glewExperimental || GLEW_ARB_texture_view) CONST_CAST(GLEW_ARB_texture_view) = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_view */ +#ifdef GL_ARB_timer_query + CONST_CAST(GLEW_ARB_timer_query) = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + CONST_CAST(GLEW_ARB_transform_feedback2) = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transform_feedback_instanced + CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback_instanced */ +#ifdef GL_ARB_transpose_matrix + CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); + if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + CONST_CAST(GLEW_ARB_uniform_buffer_object) = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_bgra + CONST_CAST(GLEW_ARB_vertex_array_bgra) = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); +#endif /* GL_ARB_vertex_array_bgra */ +#ifdef GL_ARB_vertex_array_object + CONST_CAST(GLEW_ARB_vertex_array_object) = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_attrib_binding + CONST_CAST(GLEW_ARB_vertex_attrib_binding) = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_attrib_binding) CONST_CAST(GLEW_ARB_vertex_attrib_binding) = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_binding */ +#ifdef GL_ARB_vertex_blend + CONST_CAST(GLEW_ARB_vertex_blend) = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + CONST_CAST(GLEW_ARB_vertex_buffer_object) = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + CONST_CAST(GLEW_ARB_vertex_program) = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + CONST_CAST(GLEW_ARB_vertex_shader) = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + CONST_CAST(GLEW_ARB_viewport_array) = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); + if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_viewport_array */ +#ifdef GL_ARB_window_pos + CONST_CAST(GLEW_ARB_window_pos) = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATIX_point_sprites + CONST_CAST(GLEW_ATIX_point_sprites) = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); +#endif /* GL_ATIX_point_sprites */ +#ifdef GL_ATIX_texture_env_combine3 + CONST_CAST(GLEW_ATIX_texture_env_combine3) = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATIX_texture_env_combine3 */ +#ifdef GL_ATIX_texture_env_route + CONST_CAST(GLEW_ATIX_texture_env_route) = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); +#endif /* GL_ATIX_texture_env_route */ +#ifdef GL_ATIX_vertex_shader_output_point_size + CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); +#endif /* GL_ATIX_vertex_shader_output_point_size */ +#ifdef GL_ATI_draw_buffers + CONST_CAST(GLEW_ATI_draw_buffers) = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); + if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + CONST_CAST(GLEW_ATI_element_array) = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); + if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + CONST_CAST(GLEW_ATI_envmap_bumpmap) = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + CONST_CAST(GLEW_ATI_fragment_shader) = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); + if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + CONST_CAST(GLEW_ATI_map_object_buffer) = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); + if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_meminfo + CONST_CAST(GLEW_ATI_meminfo) = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); +#endif /* GL_ATI_meminfo */ +#ifdef GL_ATI_pn_triangles + CONST_CAST(GLEW_ATI_pn_triangles) = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); + if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + CONST_CAST(GLEW_ATI_separate_stencil) = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); + if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_shader_texture_lod + CONST_CAST(GLEW_ATI_shader_texture_lod) = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); +#endif /* GL_ATI_shader_texture_lod */ +#ifdef GL_ATI_text_fragment_shader + CONST_CAST(GLEW_ATI_text_fragment_shader) = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); +#endif /* GL_ATI_text_fragment_shader */ +#ifdef GL_ATI_texture_compression_3dc + CONST_CAST(GLEW_ATI_texture_compression_3dc) = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); +#endif /* GL_ATI_texture_compression_3dc */ +#ifdef GL_ATI_texture_env_combine3 + CONST_CAST(GLEW_ATI_texture_env_combine3) = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); +#endif /* GL_ATI_texture_env_combine3 */ +#ifdef GL_ATI_texture_float + CONST_CAST(GLEW_ATI_texture_float) = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); +#endif /* GL_ATI_texture_float */ +#ifdef GL_ATI_texture_mirror_once + CONST_CAST(GLEW_ATI_texture_mirror_once) = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); +#endif /* GL_ATI_texture_mirror_once */ +#ifdef GL_ATI_vertex_array_object + CONST_CAST(GLEW_ATI_vertex_array_object) = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + CONST_CAST(GLEW_ATI_vertex_streams) = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); + if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_422_pixels + CONST_CAST(GLEW_EXT_422_pixels) = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); +#endif /* GL_EXT_422_pixels */ +#ifdef GL_EXT_Cg_shader + CONST_CAST(GLEW_EXT_Cg_shader) = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); +#endif /* GL_EXT_Cg_shader */ +#ifdef GL_EXT_abgr + CONST_CAST(GLEW_EXT_abgr) = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); +#endif /* GL_EXT_abgr */ +#ifdef GL_EXT_bgra + CONST_CAST(GLEW_EXT_bgra) = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); +#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_bindable_uniform + CONST_CAST(GLEW_EXT_bindable_uniform) = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_bindable_uniform */ +#ifdef GL_EXT_blend_color + CONST_CAST(GLEW_EXT_blend_color) = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + CONST_CAST(GLEW_EXT_blend_equation_separate) = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_separate + CONST_CAST(GLEW_EXT_blend_func_separate) = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_logic_op + CONST_CAST(GLEW_EXT_blend_logic_op) = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); +#endif /* GL_EXT_blend_logic_op */ +#ifdef GL_EXT_blend_minmax + CONST_CAST(GLEW_EXT_blend_minmax) = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); + if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_blend_subtract + CONST_CAST(GLEW_EXT_blend_subtract) = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); +#endif /* GL_EXT_blend_subtract */ +#ifdef GL_EXT_clip_volume_hint + CONST_CAST(GLEW_EXT_clip_volume_hint) = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); +#endif /* GL_EXT_clip_volume_hint */ +#ifdef GL_EXT_cmyka + CONST_CAST(GLEW_EXT_cmyka) = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); +#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_color_subtable + CONST_CAST(GLEW_EXT_color_subtable) = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); + if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + CONST_CAST(GLEW_EXT_compiled_vertex_array) = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + CONST_CAST(GLEW_EXT_convolution) = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); + if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + CONST_CAST(GLEW_EXT_coordinate_frame) = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); + if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_texture + CONST_CAST(GLEW_EXT_copy_texture) = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + CONST_CAST(GLEW_EXT_cull_vertex) = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_debug_marker + CONST_CAST(GLEW_EXT_debug_marker) = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_debug_marker) CONST_CAST(GLEW_EXT_debug_marker) = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_debug_marker */ +#ifdef GL_EXT_depth_bounds_test + CONST_CAST(GLEW_EXT_depth_bounds_test) = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); + if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + CONST_CAST(GLEW_EXT_direct_state_access) = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); + if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_draw_buffers2 + CONST_CAST(GLEW_EXT_draw_buffers2) = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_instanced + CONST_CAST(GLEW_EXT_draw_instanced) = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_instanced */ +#ifdef GL_EXT_draw_range_elements + CONST_CAST(GLEW_EXT_draw_range_elements) = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); + if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_fog_coord + CONST_CAST(GLEW_EXT_fog_coord) = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + CONST_CAST(GLEW_EXT_fragment_lighting) = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + CONST_CAST(GLEW_EXT_framebuffer_blit) = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ +#ifdef GL_EXT_framebuffer_object + CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_framebuffer_sRGB + CONST_CAST(GLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GL_EXT_framebuffer_sRGB */ +#ifdef GL_EXT_geometry_shader4 + CONST_CAST(GLEW_EXT_geometry_shader4) = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_geometry_shader4 */ +#ifdef GL_EXT_gpu_program_parameters + CONST_CAST(GLEW_EXT_gpu_program_parameters) = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_program_parameters */ +#ifdef GL_EXT_gpu_shader4 + CONST_CAST(GLEW_EXT_gpu_shader4) = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); + if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_shader4 */ +#ifdef GL_EXT_histogram + CONST_CAST(GLEW_EXT_histogram) = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); + if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_array_formats + CONST_CAST(GLEW_EXT_index_array_formats) = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); +#endif /* GL_EXT_index_array_formats */ +#ifdef GL_EXT_index_func + CONST_CAST(GLEW_EXT_index_func) = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + CONST_CAST(GLEW_EXT_index_material) = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); + if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_index_texture + CONST_CAST(GLEW_EXT_index_texture) = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); +#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_light_texture + CONST_CAST(GLEW_EXT_light_texture) = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_misc_attribute + CONST_CAST(GLEW_EXT_misc_attribute) = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); +#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_multi_draw_arrays + CONST_CAST(GLEW_EXT_multi_draw_arrays) = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multisample + CONST_CAST(GLEW_EXT_multisample) = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); + if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_packed_depth_stencil + CONST_CAST(GLEW_EXT_packed_depth_stencil) = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); +#endif /* GL_EXT_packed_depth_stencil */ +#ifdef GL_EXT_packed_float + CONST_CAST(GLEW_EXT_packed_float) = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); +#endif /* GL_EXT_packed_float */ +#ifdef GL_EXT_packed_pixels + CONST_CAST(GLEW_EXT_packed_pixels) = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); +#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_paletted_texture + CONST_CAST(GLEW_EXT_paletted_texture) = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_buffer_object + CONST_CAST(GLEW_EXT_pixel_buffer_object) = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); +#endif /* GL_EXT_pixel_buffer_object */ +#ifdef GL_EXT_pixel_transform + CONST_CAST(GLEW_EXT_pixel_transform) = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); + if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_pixel_transform_color_table + CONST_CAST(GLEW_EXT_pixel_transform_color_table) = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); +#endif /* GL_EXT_pixel_transform_color_table */ +#ifdef GL_EXT_point_parameters + CONST_CAST(GLEW_EXT_point_parameters) = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); + if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + CONST_CAST(GLEW_EXT_polygon_offset) = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); + if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_provoking_vertex + CONST_CAST(GLEW_EXT_provoking_vertex) = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); + if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_rescale_normal + CONST_CAST(GLEW_EXT_rescale_normal) = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); +#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_scene_marker + CONST_CAST(GLEW_EXT_scene_marker) = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); + if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); + if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_separate_shader_objects + CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); + if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_separate_specular_color + CONST_CAST(GLEW_EXT_separate_specular_color) = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); +#endif /* GL_EXT_separate_specular_color */ +#ifdef GL_EXT_shader_image_load_store + CONST_CAST(GLEW_EXT_shader_image_load_store) = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); + if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shadow_funcs + CONST_CAST(GLEW_EXT_shadow_funcs) = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); +#endif /* GL_EXT_shadow_funcs */ +#ifdef GL_EXT_shared_texture_palette + CONST_CAST(GLEW_EXT_shared_texture_palette) = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); +#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_stencil_clear_tag + CONST_CAST(GLEW_EXT_stencil_clear_tag) = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); +#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_stencil_two_side + CONST_CAST(GLEW_EXT_stencil_two_side) = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); + if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_stencil_wrap + CONST_CAST(GLEW_EXT_stencil_wrap) = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); +#endif /* GL_EXT_stencil_wrap */ +#ifdef GL_EXT_subtexture + CONST_CAST(GLEW_EXT_subtexture) = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); + if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture + CONST_CAST(GLEW_EXT_texture) = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); +#endif /* GL_EXT_texture */ +#ifdef GL_EXT_texture3D + CONST_CAST(GLEW_EXT_texture3D) = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_array + CONST_CAST(GLEW_EXT_texture_array) = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_array) CONST_CAST(GLEW_EXT_texture_array) = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_array */ +#ifdef GL_EXT_texture_buffer_object + CONST_CAST(GLEW_EXT_texture_buffer_object) = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_buffer_object */ +#ifdef GL_EXT_texture_compression_dxt1 + CONST_CAST(GLEW_EXT_texture_compression_dxt1) = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); +#endif /* GL_EXT_texture_compression_dxt1 */ +#ifdef GL_EXT_texture_compression_latc + CONST_CAST(GLEW_EXT_texture_compression_latc) = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_latc */ +#ifdef GL_EXT_texture_compression_rgtc + CONST_CAST(GLEW_EXT_texture_compression_rgtc) = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_rgtc */ +#ifdef GL_EXT_texture_compression_s3tc + CONST_CAST(GLEW_EXT_texture_compression_s3tc) = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); +#endif /* GL_EXT_texture_compression_s3tc */ +#ifdef GL_EXT_texture_cube_map + CONST_CAST(GLEW_EXT_texture_cube_map) = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); +#endif /* GL_EXT_texture_cube_map */ +#ifdef GL_EXT_texture_edge_clamp + CONST_CAST(GLEW_EXT_texture_edge_clamp) = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_edge_clamp */ +#ifdef GL_EXT_texture_env + CONST_CAST(GLEW_EXT_texture_env) = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); +#endif /* GL_EXT_texture_env */ +#ifdef GL_EXT_texture_env_add + CONST_CAST(GLEW_EXT_texture_env_add) = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); +#endif /* GL_EXT_texture_env_add */ +#ifdef GL_EXT_texture_env_combine + CONST_CAST(GLEW_EXT_texture_env_combine) = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); +#endif /* GL_EXT_texture_env_combine */ +#ifdef GL_EXT_texture_env_dot3 + CONST_CAST(GLEW_EXT_texture_env_dot3) = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); +#endif /* GL_EXT_texture_env_dot3 */ +#ifdef GL_EXT_texture_filter_anisotropic + CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); +#endif /* GL_EXT_texture_filter_anisotropic */ +#ifdef GL_EXT_texture_integer + CONST_CAST(GLEW_EXT_texture_integer) = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_integer */ +#ifdef GL_EXT_texture_lod_bias + CONST_CAST(GLEW_EXT_texture_lod_bias) = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); +#endif /* GL_EXT_texture_lod_bias */ +#ifdef GL_EXT_texture_mirror_clamp + CONST_CAST(GLEW_EXT_texture_mirror_clamp) = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); +#endif /* GL_EXT_texture_mirror_clamp */ +#ifdef GL_EXT_texture_object + CONST_CAST(GLEW_EXT_texture_object) = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + CONST_CAST(GLEW_EXT_texture_perturb_normal) = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_rectangle + CONST_CAST(GLEW_EXT_texture_rectangle) = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); +#endif /* GL_EXT_texture_rectangle */ +#ifdef GL_EXT_texture_sRGB + CONST_CAST(GLEW_EXT_texture_sRGB) = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB */ +#ifdef GL_EXT_texture_sRGB_decode + CONST_CAST(GLEW_EXT_texture_sRGB_decode) = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); +#endif /* GL_EXT_texture_sRGB_decode */ +#ifdef GL_EXT_texture_shared_exponent + CONST_CAST(GLEW_EXT_texture_shared_exponent) = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); +#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_snorm + CONST_CAST(GLEW_EXT_texture_snorm) = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); +#endif /* GL_EXT_texture_snorm */ +#ifdef GL_EXT_texture_swizzle + CONST_CAST(GLEW_EXT_texture_swizzle) = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); +#endif /* GL_EXT_texture_swizzle */ +#ifdef GL_EXT_timer_query + CONST_CAST(GLEW_EXT_timer_query) = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); + if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + CONST_CAST(GLEW_EXT_transform_feedback) = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_transform_feedback */ +#ifdef GL_EXT_vertex_array + CONST_CAST(GLEW_EXT_vertex_array) = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_bgra + CONST_CAST(GLEW_EXT_vertex_array_bgra) = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); +#endif /* GL_EXT_vertex_array_bgra */ +#ifdef GL_EXT_vertex_attrib_64bit + CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_attrib_64bit */ +#ifdef GL_EXT_vertex_shader + CONST_CAST(GLEW_EXT_vertex_shader) = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + CONST_CAST(GLEW_EXT_vertex_weighting) = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); + if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_EXT_x11_sync_object + CONST_CAST(GLEW_EXT_x11_sync_object) = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); + if (glewExperimental || GLEW_EXT_x11_sync_object) CONST_CAST(GLEW_EXT_x11_sync_object) = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_x11_sync_object */ +#ifdef GL_GREMEDY_frame_terminator + CONST_CAST(GLEW_GREMEDY_frame_terminator) = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_frame_terminator */ +#ifdef GL_GREMEDY_string_marker + CONST_CAST(GLEW_GREMEDY_string_marker) = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); + if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_convolution_border_modes + CONST_CAST(GLEW_HP_convolution_border_modes) = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); +#endif /* GL_HP_convolution_border_modes */ +#ifdef GL_HP_image_transform + CONST_CAST(GLEW_HP_image_transform) = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); + if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_HP_image_transform */ +#ifdef GL_HP_occlusion_test + CONST_CAST(GLEW_HP_occlusion_test) = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); +#endif /* GL_HP_occlusion_test */ +#ifdef GL_HP_texture_lighting + CONST_CAST(GLEW_HP_texture_lighting) = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); +#endif /* GL_HP_texture_lighting */ +#ifdef GL_IBM_cull_vertex + CONST_CAST(GLEW_IBM_cull_vertex) = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); +#endif /* GL_IBM_cull_vertex */ +#ifdef GL_IBM_multimode_draw_arrays + CONST_CAST(GLEW_IBM_multimode_draw_arrays) = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_rasterpos_clip + CONST_CAST(GLEW_IBM_rasterpos_clip) = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); +#endif /* GL_IBM_rasterpos_clip */ +#ifdef GL_IBM_static_data + CONST_CAST(GLEW_IBM_static_data) = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); +#endif /* GL_IBM_static_data */ +#ifdef GL_IBM_texture_mirrored_repeat + CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); +#endif /* GL_IBM_texture_mirrored_repeat */ +#ifdef GL_IBM_vertex_array_lists + CONST_CAST(GLEW_IBM_vertex_array_lists) = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); + if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INGR_color_clamp + CONST_CAST(GLEW_INGR_color_clamp) = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); +#endif /* GL_INGR_color_clamp */ +#ifdef GL_INGR_interlace_read + CONST_CAST(GLEW_INGR_interlace_read) = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); +#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_parallel_arrays + CONST_CAST(GLEW_INTEL_parallel_arrays) = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_texture_scissor + CONST_CAST(GLEW_INTEL_texture_scissor) = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); + if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KHR_debug + CONST_CAST(GLEW_KHR_debug) = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); + if (glewExperimental || GLEW_KHR_debug) CONST_CAST(GLEW_KHR_debug) = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KHR_debug */ +#ifdef GL_KHR_texture_compression_astc_ldr + CONST_CAST(GLEW_KHR_texture_compression_astc_ldr) = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); +#endif /* GL_KHR_texture_compression_astc_ldr */ +#ifdef GL_KTX_buffer_region + CONST_CAST(GLEW_KTX_buffer_region) = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); + if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESAX_texture_stack + CONST_CAST(GLEW_MESAX_texture_stack) = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); +#endif /* GL_MESAX_texture_stack */ +#ifdef GL_MESA_pack_invert + CONST_CAST(GLEW_MESA_pack_invert) = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); +#endif /* GL_MESA_pack_invert */ +#ifdef GL_MESA_resize_buffers + CONST_CAST(GLEW_MESA_resize_buffers) = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); + if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + CONST_CAST(GLEW_MESA_window_pos) = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); + if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_window_pos */ +#ifdef GL_MESA_ycbcr_texture + CONST_CAST(GLEW_MESA_ycbcr_texture) = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); +#endif /* GL_MESA_ycbcr_texture */ +#ifdef GL_NVX_gpu_memory_info + CONST_CAST(GLEW_NVX_gpu_memory_info) = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); +#endif /* GL_NVX_gpu_memory_info */ +#ifdef GL_NV_bindless_texture + CONST_CAST(GLEW_NV_bindless_texture) = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); + if (glewExperimental || GLEW_NV_bindless_texture) CONST_CAST(GLEW_NV_bindless_texture) = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_bindless_texture */ +#ifdef GL_NV_blend_square + CONST_CAST(GLEW_NV_blend_square) = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); +#endif /* GL_NV_blend_square */ +#ifdef GL_NV_conditional_render + CONST_CAST(GLEW_NV_conditional_render) = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); + if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_copy_depth_to_color + CONST_CAST(GLEW_NV_copy_depth_to_color) = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); +#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NV_copy_image + CONST_CAST(GLEW_NV_copy_image) = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_copy_image */ +#ifdef GL_NV_depth_buffer_float + CONST_CAST(GLEW_NV_depth_buffer_float) = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_depth_buffer_float */ +#ifdef GL_NV_depth_clamp + CONST_CAST(GLEW_NV_depth_clamp) = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); +#endif /* GL_NV_depth_clamp */ +#ifdef GL_NV_depth_range_unclamped + CONST_CAST(GLEW_NV_depth_range_unclamped) = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); +#endif /* GL_NV_depth_range_unclamped */ +#ifdef GL_NV_evaluators + CONST_CAST(GLEW_NV_evaluators) = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); + if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + CONST_CAST(GLEW_NV_explicit_multisample) = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_explicit_multisample */ +#ifdef GL_NV_fence + CONST_CAST(GLEW_NV_fence) = _glewSearchExtension("GL_NV_fence", extStart, extEnd); + if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fence */ +#ifdef GL_NV_float_buffer + CONST_CAST(GLEW_NV_float_buffer) = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); +#endif /* GL_NV_float_buffer */ +#ifdef GL_NV_fog_distance + CONST_CAST(GLEW_NV_fog_distance) = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); +#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_program + CONST_CAST(GLEW_NV_fragment_program) = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_fragment_program2 + CONST_CAST(GLEW_NV_fragment_program2) = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); +#endif /* GL_NV_fragment_program2 */ +#ifdef GL_NV_fragment_program4 + CONST_CAST(GLEW_NV_fragment_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_fragment_program_option + CONST_CAST(GLEW_NV_fragment_program_option) = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); +#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_multisample_coverage + CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_framebuffer_multisample_coverage */ +#ifdef GL_NV_geometry_program4 + CONST_CAST(GLEW_NV_geometry_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_geometry_shader4 + CONST_CAST(GLEW_NV_geometry_shader4) = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); +#endif /* GL_NV_geometry_shader4 */ +#ifdef GL_NV_gpu_program4 + CONST_CAST(GLEW_NV_gpu_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_program5 + CONST_CAST(GLEW_NV_gpu_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_gpu_program5 */ +#ifdef GL_NV_gpu_program_fp64 + CONST_CAST(GLEW_NV_gpu_program_fp64) = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); +#endif /* GL_NV_gpu_program_fp64 */ +#ifdef GL_NV_gpu_shader5 + CONST_CAST(GLEW_NV_gpu_shader5) = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); + if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_shader5 */ +#ifdef GL_NV_half_float + CONST_CAST(GLEW_NV_half_float) = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); + if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_light_max_exponent + CONST_CAST(GLEW_NV_light_max_exponent) = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); +#endif /* GL_NV_light_max_exponent */ +#ifdef GL_NV_multisample_coverage + CONST_CAST(GLEW_NV_multisample_coverage) = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); +#endif /* GL_NV_multisample_coverage */ +#ifdef GL_NV_multisample_filter_hint + CONST_CAST(GLEW_NV_multisample_filter_hint) = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); +#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_occlusion_query + CONST_CAST(GLEW_NV_occlusion_query) = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); + if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_packed_depth_stencil + CONST_CAST(GLEW_NV_packed_depth_stencil) = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); +#endif /* GL_NV_packed_depth_stencil */ +#ifdef GL_NV_parameter_buffer_object + CONST_CAST(GLEW_NV_parameter_buffer_object) = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); + if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_parameter_buffer_object2 + CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); +#endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_path_rendering + CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); + if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_path_rendering */ +#ifdef GL_NV_pixel_data_range + CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + CONST_CAST(GLEW_NV_point_sprite) = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); + if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_present_video + CONST_CAST(GLEW_NV_present_video) = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); + if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_present_video */ +#ifdef GL_NV_primitive_restart + CONST_CAST(GLEW_NV_primitive_restart) = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); + if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + CONST_CAST(GLEW_NV_register_combiners) = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + CONST_CAST(GLEW_NV_register_combiners2) = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); + if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_shader_atomic_float + CONST_CAST(GLEW_NV_shader_atomic_float) = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); +#endif /* GL_NV_shader_atomic_float */ +#ifdef GL_NV_shader_buffer_load + CONST_CAST(GLEW_NV_shader_buffer_load) = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); + if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_tessellation_program5 + CONST_CAST(GLEW_NV_tessellation_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_texgen_emboss + CONST_CAST(GLEW_NV_texgen_emboss) = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); +#endif /* GL_NV_texgen_emboss */ +#ifdef GL_NV_texgen_reflection + CONST_CAST(GLEW_NV_texgen_reflection) = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); +#endif /* GL_NV_texgen_reflection */ +#ifdef GL_NV_texture_barrier + CONST_CAST(GLEW_NV_texture_barrier) = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_compression_vtc + CONST_CAST(GLEW_NV_texture_compression_vtc) = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); +#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_texture_env_combine4 + CONST_CAST(GLEW_NV_texture_env_combine4) = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); +#endif /* GL_NV_texture_env_combine4 */ +#ifdef GL_NV_texture_expand_normal + CONST_CAST(GLEW_NV_texture_expand_normal) = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); +#endif /* GL_NV_texture_expand_normal */ +#ifdef GL_NV_texture_multisample + CONST_CAST(GLEW_NV_texture_multisample) = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); + if (glewExperimental || GLEW_NV_texture_multisample) CONST_CAST(GLEW_NV_texture_multisample) = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_multisample */ +#ifdef GL_NV_texture_rectangle + CONST_CAST(GLEW_NV_texture_rectangle) = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); +#endif /* GL_NV_texture_rectangle */ +#ifdef GL_NV_texture_shader + CONST_CAST(GLEW_NV_texture_shader) = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); +#endif /* GL_NV_texture_shader */ +#ifdef GL_NV_texture_shader2 + CONST_CAST(GLEW_NV_texture_shader2) = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); +#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_shader3 + CONST_CAST(GLEW_NV_texture_shader3) = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); +#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_transform_feedback + CONST_CAST(GLEW_NV_transform_feedback) = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + CONST_CAST(GLEW_NV_transform_feedback2) = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); + if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + CONST_CAST(GLEW_NV_vdpau_interop) = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); + if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vdpau_interop */ +#ifdef GL_NV_vertex_array_range + CONST_CAST(GLEW_NV_vertex_array_range) = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_array_range2 + CONST_CAST(GLEW_NV_vertex_array_range2) = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); +#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_attrib_integer_64bit + CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_buffer_unified_memory */ +#ifdef GL_NV_vertex_program + CONST_CAST(GLEW_NV_vertex_program) = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); + if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_vertex_program1_1 + CONST_CAST(GLEW_NV_vertex_program1_1) = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); +#endif /* GL_NV_vertex_program1_1 */ +#ifdef GL_NV_vertex_program2 + CONST_CAST(GLEW_NV_vertex_program2) = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); +#endif /* GL_NV_vertex_program2 */ +#ifdef GL_NV_vertex_program2_option + CONST_CAST(GLEW_NV_vertex_program2_option) = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); +#endif /* GL_NV_vertex_program2_option */ +#ifdef GL_NV_vertex_program3 + CONST_CAST(GLEW_NV_vertex_program3) = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); +#endif /* GL_NV_vertex_program3 */ +#ifdef GL_NV_vertex_program4 + CONST_CAST(GLEW_NV_vertex_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); +#endif /* GL_NV_vertex_program4 */ +#ifdef GL_NV_video_capture + CONST_CAST(GLEW_NV_video_capture) = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLEW_NV_video_capture) CONST_CAST(GLEW_NV_video_capture) = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_video_capture */ +#ifdef GL_OES_byte_coordinates + CONST_CAST(GLEW_OES_byte_coordinates) = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); +#endif /* GL_OES_byte_coordinates */ +#ifdef GL_OES_compressed_paletted_texture + CONST_CAST(GLEW_OES_compressed_paletted_texture) = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); +#endif /* GL_OES_compressed_paletted_texture */ +#ifdef GL_OES_read_format + CONST_CAST(GLEW_OES_read_format) = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); +#endif /* GL_OES_read_format */ +#ifdef GL_OES_single_precision + CONST_CAST(GLEW_OES_single_precision) = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); + if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_OES_single_precision */ +#ifdef GL_OML_interlace + CONST_CAST(GLEW_OML_interlace) = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); +#endif /* GL_OML_interlace */ +#ifdef GL_OML_resample + CONST_CAST(GLEW_OML_resample) = _glewSearchExtension("GL_OML_resample", extStart, extEnd); +#endif /* GL_OML_resample */ +#ifdef GL_OML_subsample + CONST_CAST(GLEW_OML_subsample) = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); +#endif /* GL_OML_subsample */ +#ifdef GL_PGI_misc_hints + CONST_CAST(GLEW_PGI_misc_hints) = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); +#endif /* GL_PGI_misc_hints */ +#ifdef GL_PGI_vertex_hints + CONST_CAST(GLEW_PGI_vertex_hints) = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); +#endif /* GL_PGI_vertex_hints */ +#ifdef GL_REGAL_error_string + CONST_CAST(GLEW_REGAL_error_string) = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_error_string) CONST_CAST(GLEW_REGAL_error_string) = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_error_string */ +#ifdef GL_REGAL_extension_query + CONST_CAST(GLEW_REGAL_extension_query) = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); + if (glewExperimental || GLEW_REGAL_extension_query) CONST_CAST(GLEW_REGAL_extension_query) = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_REGAL_extension_query */ +#ifdef GL_REGAL_log + CONST_CAST(GLEW_REGAL_log) = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); +#endif /* GL_REGAL_log */ +#ifdef GL_REND_screen_coordinates + CONST_CAST(GLEW_REND_screen_coordinates) = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); +#endif /* GL_REND_screen_coordinates */ +#ifdef GL_S3_s3tc + CONST_CAST(GLEW_S3_s3tc) = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); +#endif /* GL_S3_s3tc */ +#ifdef GL_SGIS_color_range + CONST_CAST(GLEW_SGIS_color_range) = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); +#endif /* GL_SGIS_color_range */ +#ifdef GL_SGIS_detail_texture + CONST_CAST(GLEW_SGIS_detail_texture) = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + CONST_CAST(GLEW_SGIS_fog_function) = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_generate_mipmap + CONST_CAST(GLEW_SGIS_generate_mipmap) = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); +#endif /* GL_SGIS_generate_mipmap */ +#ifdef GL_SGIS_multisample + CONST_CAST(GLEW_SGIS_multisample) = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_pixel_texture + CONST_CAST(GLEW_SGIS_pixel_texture) = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); +#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_point_line_texgen + CONST_CAST(GLEW_SGIS_point_line_texgen) = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); +#endif /* GL_SGIS_point_line_texgen */ +#ifdef GL_SGIS_sharpen_texture + CONST_CAST(GLEW_SGIS_sharpen_texture) = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + CONST_CAST(GLEW_SGIS_texture4D) = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_border_clamp + CONST_CAST(GLEW_SGIS_texture_border_clamp) = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_border_clamp */ +#ifdef GL_SGIS_texture_edge_clamp + CONST_CAST(GLEW_SGIS_texture_edge_clamp) = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); +#endif /* GL_SGIS_texture_edge_clamp */ +#ifdef GL_SGIS_texture_filter4 + CONST_CAST(GLEW_SGIS_texture_filter4) = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); + if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIS_texture_lod + CONST_CAST(GLEW_SGIS_texture_lod) = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); +#endif /* GL_SGIS_texture_lod */ +#ifdef GL_SGIS_texture_select + CONST_CAST(GLEW_SGIS_texture_select) = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); +#endif /* GL_SGIS_texture_select */ +#ifdef GL_SGIX_async + CONST_CAST(GLEW_SGIX_async) = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_async_histogram + CONST_CAST(GLEW_SGIX_async_histogram) = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); +#endif /* GL_SGIX_async_histogram */ +#ifdef GL_SGIX_async_pixel + CONST_CAST(GLEW_SGIX_async_pixel) = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); +#endif /* GL_SGIX_async_pixel */ +#ifdef GL_SGIX_blend_alpha_minmax + CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); +#endif /* GL_SGIX_blend_alpha_minmax */ +#ifdef GL_SGIX_clipmap + CONST_CAST(GLEW_SGIX_clipmap) = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); +#endif /* GL_SGIX_clipmap */ +#ifdef GL_SGIX_convolution_accuracy + CONST_CAST(GLEW_SGIX_convolution_accuracy) = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); +#endif /* GL_SGIX_convolution_accuracy */ +#ifdef GL_SGIX_depth_texture + CONST_CAST(GLEW_SGIX_depth_texture) = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); +#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_flush_raster + CONST_CAST(GLEW_SGIX_flush_raster) = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_offset + CONST_CAST(GLEW_SGIX_fog_offset) = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); +#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_texture + CONST_CAST(GLEW_SGIX_fog_texture) = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + CONST_CAST(GLEW_SGIX_framezoom) = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_interlace + CONST_CAST(GLEW_SGIX_interlace) = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); +#endif /* GL_SGIX_interlace */ +#ifdef GL_SGIX_ir_instrument1 + CONST_CAST(GLEW_SGIX_ir_instrument1) = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); +#endif /* GL_SGIX_ir_instrument1 */ +#ifdef GL_SGIX_list_priority + CONST_CAST(GLEW_SGIX_list_priority) = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); +#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_pixel_texture + CONST_CAST(GLEW_SGIX_pixel_texture) = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_pixel_texture_bits + CONST_CAST(GLEW_SGIX_pixel_texture_bits) = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); +#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_reference_plane + CONST_CAST(GLEW_SGIX_reference_plane) = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_resample + CONST_CAST(GLEW_SGIX_resample) = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); +#endif /* GL_SGIX_resample */ +#ifdef GL_SGIX_shadow + CONST_CAST(GLEW_SGIX_shadow) = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); +#endif /* GL_SGIX_shadow */ +#ifdef GL_SGIX_shadow_ambient + CONST_CAST(GLEW_SGIX_shadow_ambient) = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); +#endif /* GL_SGIX_shadow_ambient */ +#ifdef GL_SGIX_sprite + CONST_CAST(GLEW_SGIX_sprite) = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + CONST_CAST(GLEW_SGIX_tag_sample_buffer) = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_texture_add_env + CONST_CAST(GLEW_SGIX_texture_add_env) = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); +#endif /* GL_SGIX_texture_add_env */ +#ifdef GL_SGIX_texture_coordinate_clamp + CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); +#endif /* GL_SGIX_texture_coordinate_clamp */ +#ifdef GL_SGIX_texture_lod_bias + CONST_CAST(GLEW_SGIX_texture_lod_bias) = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_texture_multi_buffer + CONST_CAST(GLEW_SGIX_texture_multi_buffer) = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); +#endif /* GL_SGIX_texture_multi_buffer */ +#ifdef GL_SGIX_texture_range + CONST_CAST(GLEW_SGIX_texture_range) = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); +#endif /* GL_SGIX_texture_range */ +#ifdef GL_SGIX_texture_scale_bias + CONST_CAST(GLEW_SGIX_texture_scale_bias) = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); +#endif /* GL_SGIX_texture_scale_bias */ +#ifdef GL_SGIX_vertex_preclip + CONST_CAST(GLEW_SGIX_vertex_preclip) = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip */ +#ifdef GL_SGIX_vertex_preclip_hint + CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); +#endif /* GL_SGIX_vertex_preclip_hint */ +#ifdef GL_SGIX_ycrcb + CONST_CAST(GLEW_SGIX_ycrcb) = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); +#endif /* GL_SGIX_ycrcb */ +#ifdef GL_SGI_color_matrix + CONST_CAST(GLEW_SGI_color_matrix) = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); +#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGI_color_table + CONST_CAST(GLEW_SGI_color_table) = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); + if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_texture_color_table + CONST_CAST(GLEW_SGI_texture_color_table) = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); +#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SUNX_constant_data + CONST_CAST(GLEW_SUNX_constant_data) = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); + if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_convolution_border_modes + CONST_CAST(GLEW_SUN_convolution_border_modes) = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); +#endif /* GL_SUN_convolution_border_modes */ +#ifdef GL_SUN_global_alpha + CONST_CAST(GLEW_SUN_global_alpha) = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); + if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_mesh_array + CONST_CAST(GLEW_SUN_mesh_array) = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); +#endif /* GL_SUN_mesh_array */ +#ifdef GL_SUN_read_video_pixels + CONST_CAST(GLEW_SUN_read_video_pixels) = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); + if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_slice_accum + CONST_CAST(GLEW_SUN_slice_accum) = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); +#endif /* GL_SUN_slice_accum */ +#ifdef GL_SUN_triangle_list + CONST_CAST(GLEW_SUN_triangle_list) = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); + if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + CONST_CAST(GLEW_SUN_vertex) = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); + if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_phong_shading + CONST_CAST(GLEW_WIN_phong_shading) = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); +#endif /* GL_WIN_phong_shading */ +#ifdef GL_WIN_specular_fog + CONST_CAST(GLEW_WIN_specular_fog) = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); +#endif /* GL_WIN_specular_fog */ +#ifdef GL_WIN_swap_hint + CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); + if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_WIN_swap_hint */ + + return GLEW_OK; +} + + +#if defined(_WIN32) + +#if !defined(GLEW_MX) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; +PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; +PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; +PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; +PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; +PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; +PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; +PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; +PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; +PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; +PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; +PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; + +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; +PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; +PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; +PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; +PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop = GL_FALSE; +GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_capture = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef WGL_3DFX_multisample + +#endif /* WGL_3DFX_multisample */ + +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + +#ifdef WGL_ARB_create_context_profile + +#endif /* WGL_ARB_create_context_profile */ + +#ifdef WGL_ARB_create_context_robustness + +#endif /* WGL_ARB_create_context_robustness */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_framebuffer_sRGB + +#endif /* WGL_ARB_framebuffer_sRGB */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_multisample + +#endif /* WGL_ARB_multisample */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_pixel_format_float + +#endif /* WGL_ARB_pixel_format_float */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_ATI_pixel_format_float + +#endif /* WGL_ATI_pixel_format_float */ + +#ifdef WGL_ATI_render_texture_rectangle + +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifdef WGL_EXT_create_context_es2_profile + +#endif /* WGL_EXT_create_context_es2_profile */ + +#ifdef WGL_EXT_create_context_es_profile + +#endif /* WGL_EXT_create_context_es_profile */ + +#ifdef WGL_EXT_depth_float + +#endif /* WGL_EXT_depth_float */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_framebuffer_sRGB + +#endif /* WGL_EXT_framebuffer_sRGB */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_multisample + +#endif /* WGL_EXT_multisample */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_pixel_format_packed_float + +#endif /* WGL_EXT_pixel_format_packed_float */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_EXT_swap_control_tear + +#endif /* WGL_EXT_swap_control_tear */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_DX_interop + +static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; + r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; + r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; + r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; + r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; + r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; + r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; + r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_DX_interop */ + +#ifdef WGL_NV_DX_interop2 + +#endif /* WGL_NV_DX_interop2 */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_float_buffer + +#endif /* WGL_NV_float_buffer */ + +#ifdef WGL_NV_gpu_affinity + +static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; + r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; + r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; + r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; + r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_gpu_affinity */ + +#ifdef WGL_NV_multisample_coverage + +#endif /* WGL_NV_multisample_coverage */ + +#ifdef WGL_NV_present_video + +static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_render_depth_texture + +#endif /* WGL_NV_render_depth_texture */ + +#ifdef WGL_NV_render_texture_rectangle + +#endif /* WGL_NV_render_texture_rectangle */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_NV_video_capture + +static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_capture */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + start = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (start == 0) + return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + const GLubyte* extStart; + const GLubyte* extEnd; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* query wgl extension string */ + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + extStart = (const GLubyte*)""; + else + extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); + else + extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + CONST_CAST(WGLEW_3DFX_multisample) = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + CONST_CAST(WGLEW_3DL_stereo_control) = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + CONST_CAST(WGLEW_AMD_gpu_association) = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_AMD_gpu_association */ +#ifdef WGL_ARB_buffer_region + CONST_CAST(WGLEW_ARB_buffer_region) = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_create_context + CONST_CAST(WGLEW_ARB_create_context) = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_profile + CONST_CAST(WGLEW_ARB_create_context_profile) = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + CONST_CAST(WGLEW_ARB_create_context_robustness) = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); +#endif /* WGL_ARB_create_context_robustness */ +#ifdef WGL_ARB_extensions_string + CONST_CAST(WGLEW_ARB_extensions_string) = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_ARB_framebuffer_sRGB */ +#ifdef WGL_ARB_make_current_read + CONST_CAST(WGLEW_ARB_make_current_read) = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + CONST_CAST(WGLEW_ARB_multisample) = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + CONST_CAST(WGLEW_ARB_pbuffer) = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + CONST_CAST(WGLEW_ARB_pixel_format) = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + CONST_CAST(WGLEW_ARB_pixel_format_float) = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + CONST_CAST(WGLEW_ARB_render_texture) = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ATI_pixel_format_float + CONST_CAST(WGLEW_ATI_pixel_format_float) = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + CONST_CAST(WGLEW_ATI_render_texture_rectangle) = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_create_context_es2_profile + CONST_CAST(WGLEW_EXT_create_context_es2_profile) = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_create_context_es_profile + CONST_CAST(WGLEW_EXT_create_context_es_profile) = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); +#endif /* WGL_EXT_create_context_es_profile */ +#ifdef WGL_EXT_depth_float + CONST_CAST(WGLEW_EXT_depth_float) = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + CONST_CAST(WGLEW_EXT_display_color_table) = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + CONST_CAST(WGLEW_EXT_extensions_string) = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_framebuffer_sRGB + CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* WGL_EXT_framebuffer_sRGB */ +#ifdef WGL_EXT_make_current_read + CONST_CAST(WGLEW_EXT_make_current_read) = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + CONST_CAST(WGLEW_EXT_multisample) = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + CONST_CAST(WGLEW_EXT_pbuffer) = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + CONST_CAST(WGLEW_EXT_pixel_format) = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_pixel_format_packed_float + CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); +#endif /* WGL_EXT_pixel_format_packed_float */ +#ifdef WGL_EXT_swap_control + CONST_CAST(WGLEW_EXT_swap_control) = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_EXT_swap_control_tear + CONST_CAST(WGLEW_EXT_swap_control_tear) = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); +#endif /* WGL_EXT_swap_control_tear */ +#ifdef WGL_I3D_digital_video_control + CONST_CAST(WGLEW_I3D_digital_video_control) = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + CONST_CAST(WGLEW_I3D_gamma) = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + CONST_CAST(WGLEW_I3D_genlock) = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + CONST_CAST(WGLEW_I3D_image_buffer) = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + CONST_CAST(WGLEW_I3D_swap_frame_lock) = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + CONST_CAST(WGLEW_I3D_swap_frame_usage) = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_DX_interop + CONST_CAST(WGLEW_NV_DX_interop) = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); + if (glewExperimental || WGLEW_NV_DX_interop|| crippled) CONST_CAST(WGLEW_NV_DX_interop)= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_DX_interop */ +#ifdef WGL_NV_DX_interop2 + CONST_CAST(WGLEW_NV_DX_interop2) = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); +#endif /* WGL_NV_DX_interop2 */ +#ifdef WGL_NV_copy_image + CONST_CAST(WGLEW_NV_copy_image) = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_float_buffer + CONST_CAST(WGLEW_NV_float_buffer) = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_gpu_affinity + CONST_CAST(WGLEW_NV_gpu_affinity) = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + CONST_CAST(WGLEW_NV_multisample_coverage) = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + CONST_CAST(WGLEW_NV_present_video) = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); + if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_present_video */ +#ifdef WGL_NV_render_depth_texture + CONST_CAST(WGLEW_NV_render_depth_texture) = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + CONST_CAST(WGLEW_NV_render_texture_rectangle) = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + CONST_CAST(WGLEW_NV_swap_group) = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_swap_group */ +#ifdef WGL_NV_vertex_array_range + CONST_CAST(WGLEW_NV_vertex_array_range) = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_capture + CONST_CAST(WGLEW_NV_video_capture) = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_capture|| crippled) CONST_CAST(WGLEW_NV_video_capture)= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_capture */ +#ifdef WGL_NV_video_output + CONST_CAST(WGLEW_NV_video_output) = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); + if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_output */ +#ifdef WGL_OML_sync_control + CONST_CAST(WGLEW_OML_sync_control) = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + +PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; +PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; +PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; +PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; +PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; +PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; +PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; +PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; +PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; +GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; +GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_MESA_swap_control = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_capture = GL_FALSE; +GLboolean __GLXEW_NV_video_out = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_VERSION_1_4 + +#endif /* GLX_VERSION_1_4 */ + +#ifdef GLX_3DFX_multisample + +#endif /* GLX_3DFX_multisample */ + +#ifdef GLX_AMD_gpu_association + +#endif /* GLX_AMD_gpu_association */ + +#ifdef GLX_ARB_create_context + +static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* GLX_ARB_create_context */ + +#ifdef GLX_ARB_create_context_profile + +#endif /* GLX_ARB_create_context_profile */ + +#ifdef GLX_ARB_create_context_robustness + +#endif /* GLX_ARB_create_context_robustness */ + +#ifdef GLX_ARB_fbconfig_float + +#endif /* GLX_ARB_fbconfig_float */ + +#ifdef GLX_ARB_framebuffer_sRGB + +#endif /* GLX_ARB_framebuffer_sRGB */ + +#ifdef GLX_ARB_get_proc_address + +#endif /* GLX_ARB_get_proc_address */ + +#ifdef GLX_ARB_multisample + +#endif /* GLX_ARB_multisample */ + +#ifdef GLX_ARB_robustness_application_isolation + +#endif /* GLX_ARB_robustness_application_isolation */ + +#ifdef GLX_ARB_robustness_share_group_isolation + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +#ifdef GLX_ARB_vertex_buffer_object + +#endif /* GLX_ARB_vertex_buffer_object */ + +#ifdef GLX_ATI_pixel_format_float + +#endif /* GLX_ATI_pixel_format_float */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_create_context_es2_profile + +#endif /* GLX_EXT_create_context_es2_profile */ + +#ifdef GLX_EXT_create_context_es_profile + +#endif /* GLX_EXT_create_context_es_profile */ + +#ifdef GLX_EXT_fbconfig_packed_float + +#endif /* GLX_EXT_fbconfig_packed_float */ + +#ifdef GLX_EXT_framebuffer_sRGB + +#endif /* GLX_EXT_framebuffer_sRGB */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_scene_marker + +#endif /* GLX_EXT_scene_marker */ + +#ifdef GLX_EXT_swap_control + +static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ + +#ifdef GLX_EXT_swap_control_tear + +#endif /* GLX_EXT_swap_control_tear */ + +#ifdef GLX_EXT_texture_from_pixmap + +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; + r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_texture_from_pixmap */ + +#ifdef GLX_EXT_visual_info + +#endif /* GLX_EXT_visual_info */ + +#ifdef GLX_EXT_visual_rating + +#endif /* GLX_EXT_visual_rating */ + +#ifdef GLX_INTEL_swap_event + +#endif /* GLX_INTEL_swap_event */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_MESA_swap_control + +static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; + r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_swap_control */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_float_buffer + +#endif /* GLX_NV_float_buffer */ + +#ifdef GLX_NV_multisample_coverage + +#endif /* GLX_NV_multisample_coverage */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_NV_video_capture + +static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; + r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_capture */ + +#ifdef GLX_NV_video_out + +static GLboolean _glewInit_GLX_NV_video_out (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_out */ + +#ifdef GLX_OML_swap_method + +#endif /* GLX_OML_swap_method */ + +#ifdef GLX_OML_sync_control + +static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIS_blended_overlay + +#endif /* GLX_SGIS_blended_overlay */ + +#ifdef GLX_SGIS_color_range + +#endif /* GLX_SGIS_color_range */ + +#ifdef GLX_SGIS_multisample + +#endif /* GLX_SGIS_multisample */ + +#ifdef GLX_SGIS_shared_multisample + +#endif /* GLX_SGIS_shared_multisample */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_hyperpipe + +static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; + r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_hyperpipe */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGIX_visual_select_group + +#endif /* GLX_SGIX_visual_select_group */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + const GLubyte* start; + const GLubyte* end; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == start) return GL_FALSE; + end = start + _glewStrLen(start); + return _glewSearchExtension(name, start, end); +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + const GLubyte* extStart; + const GLubyte* extEnd; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + break; + case 2: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* query GLX extension string */ + extStart = 0; + if (glXGetCurrentDisplay != NULL) + extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (extStart == 0) + extStart = (const GLubyte *)""; + extEnd = extStart + _glewStrLen(extStart); + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + CONST_CAST(GLXEW_3DFX_multisample) = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + CONST_CAST(GLXEW_AMD_gpu_association) = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_create_context + CONST_CAST(GLXEW_ARB_create_context) = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); + if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_profile + CONST_CAST(GLXEW_ARB_create_context_profile) = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + CONST_CAST(GLXEW_ARB_create_context_robustness) = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); +#endif /* GLX_ARB_create_context_robustness */ +#ifdef GLX_ARB_fbconfig_float + CONST_CAST(GLXEW_ARB_fbconfig_float) = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_ARB_framebuffer_sRGB */ +#ifdef GLX_ARB_get_proc_address + CONST_CAST(GLXEW_ARB_get_proc_address) = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + CONST_CAST(GLXEW_ARB_multisample) = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_robustness_application_isolation + CONST_CAST(GLXEW_ARB_robustness_application_isolation) = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_application_isolation */ +#ifdef GLX_ARB_robustness_share_group_isolation + CONST_CAST(GLXEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); +#endif /* GLX_ARB_robustness_share_group_isolation */ +#ifdef GLX_ARB_vertex_buffer_object + CONST_CAST(GLXEW_ARB_vertex_buffer_object) = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); +#endif /* GLX_ARB_vertex_buffer_object */ +#ifdef GLX_ATI_pixel_format_float + CONST_CAST(GLXEW_ATI_pixel_format_float) = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + CONST_CAST(GLXEW_ATI_render_texture) = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); + if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_create_context_es2_profile + CONST_CAST(GLXEW_EXT_create_context_es2_profile) = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_create_context_es_profile + CONST_CAST(GLXEW_EXT_create_context_es_profile) = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); +#endif /* GLX_EXT_create_context_es_profile */ +#ifdef GLX_EXT_fbconfig_packed_float + CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); +#endif /* GLX_EXT_fbconfig_packed_float */ +#ifdef GLX_EXT_framebuffer_sRGB + CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); +#endif /* GLX_EXT_framebuffer_sRGB */ +#ifdef GLX_EXT_import_context + CONST_CAST(GLXEW_EXT_import_context) = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_scene_marker + CONST_CAST(GLXEW_EXT_scene_marker) = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_swap_control + CONST_CAST(GLXEW_EXT_swap_control) = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_swap_control_tear + CONST_CAST(GLXEW_EXT_swap_control_tear) = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); +#endif /* GLX_EXT_swap_control_tear */ +#ifdef GLX_EXT_texture_from_pixmap + CONST_CAST(GLXEW_EXT_texture_from_pixmap) = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_texture_from_pixmap */ +#ifdef GLX_EXT_visual_info + CONST_CAST(GLXEW_EXT_visual_info) = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + CONST_CAST(GLXEW_EXT_visual_rating) = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + CONST_CAST(GLXEW_INTEL_swap_event) = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); +#endif /* GLX_INTEL_swap_event */ +#ifdef GLX_MESA_agp_offset + CONST_CAST(GLXEW_MESA_agp_offset) = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + CONST_CAST(GLXEW_MESA_copy_sub_buffer) = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + CONST_CAST(GLXEW_MESA_pixmap_colormap) = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_release_buffers + CONST_CAST(GLXEW_MESA_release_buffers) = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_MESA_swap_control + CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_swap_control */ +#ifdef GLX_NV_copy_image + CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); + if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_float_buffer + CONST_CAST(GLXEW_NV_float_buffer) = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + CONST_CAST(GLXEW_NV_multisample_coverage) = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + CONST_CAST(GLXEW_NV_present_video) = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); + if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_swap_group + CONST_CAST(GLXEW_NV_swap_group) = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_swap_group */ +#ifdef GLX_NV_vertex_array_range + CONST_CAST(GLXEW_NV_vertex_array_range) = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); + if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_capture + CONST_CAST(GLXEW_NV_video_capture) = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_capture) CONST_CAST(GLXEW_NV_video_capture) = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_capture */ +#ifdef GLX_NV_video_out + CONST_CAST(GLXEW_NV_video_out) = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); + if (glewExperimental || GLXEW_NV_video_out) CONST_CAST(GLXEW_NV_video_out) = !_glewInit_GLX_NV_video_out(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_out */ +#ifdef GLX_OML_swap_method + CONST_CAST(GLXEW_OML_swap_method) = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); +#endif /* GLX_OML_swap_method */ +#ifdef GLX_OML_sync_control + CONST_CAST(GLXEW_OML_sync_control) = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); + if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + CONST_CAST(GLXEW_SGIS_blended_overlay) = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + CONST_CAST(GLXEW_SGIS_color_range) = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + CONST_CAST(GLXEW_SGIS_multisample) = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + CONST_CAST(GLXEW_SGIS_shared_multisample) = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + CONST_CAST(GLXEW_SGIX_fbconfig) = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_hyperpipe + CONST_CAST(GLXEW_SGIX_hyperpipe) = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_hyperpipe */ +#ifdef GLX_SGIX_pbuffer + CONST_CAST(GLXEW_SGIX_pbuffer) = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + CONST_CAST(GLXEW_SGIX_swap_barrier) = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + CONST_CAST(GLXEW_SGIX_swap_group) = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + CONST_CAST(GLXEW_SGIX_video_resize) = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + CONST_CAST(GLXEW_SGIX_visual_select_group) = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + CONST_CAST(GLXEW_SGI_cushion) = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + CONST_CAST(GLXEW_SGI_make_current_read) = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + CONST_CAST(GLXEW_SGI_swap_control) = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + CONST_CAST(GLXEW_SGI_video_sync) = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); + if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + CONST_CAST(GLXEW_SUN_get_transparent_index) = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + CONST_CAST(GLXEW_SUN_video_resize) = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); + if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"1.9.0", + (const GLubyte*)"1", + (const GLubyte*)"9", + (const GLubyte*)"0" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum GLEWAPIENTRY wglewContextInit (void); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) +extern GLenum GLEWAPIENTRY glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum GLEWAPIENTRY glewInit (void) +{ + GLenum r; + r = glewContextInit(); + if ( r != 0 ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ +#ifdef GLEW_MX +GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif +#ifdef GL_VERSION_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) + { + ret = GLEW_VERSION_2_1; + continue; + } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif +#ifdef GL_VERSION_4_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) + { + ret = GLEW_VERSION_4_2; + continue; + } +#endif +#ifdef GL_VERSION_4_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) + { + ret = GLEW_VERSION_4_3; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_blend_minmax_factor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) + { + ret = GLEW_AMD_blend_minmax_factor; + continue; + } +#endif +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_AMD_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_pinned_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) + { + ret = GLEW_AMD_pinned_memory; + continue; + } +#endif +#ifdef GL_AMD_query_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) + { + ret = GLEW_AMD_query_buffer_object; + continue; + } +#endif +#ifdef GL_AMD_sample_positions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) + { + ret = GLEW_AMD_sample_positions; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_stencil_operation_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) + { + ret = GLEW_AMD_stencil_operation_extended; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_layer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) + { + ret = GLEW_AMD_vertex_shader_layer; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_viewport_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) + { + ret = GLEW_AMD_vertex_shader_viewport_index; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_flush_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) + { + ret = GLEW_APPLE_flush_buffer_range; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_ES3_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) + { + ret = GLEW_ARB_ES3_compatibility; + continue; + } +#endif +#ifdef GL_ARB_arrays_of_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) + { + ret = GLEW_ARB_arrays_of_arrays; + continue; + } +#endif +#ifdef GL_ARB_base_instance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) + { + ret = GLEW_ARB_base_instance; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_clear_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) + { + ret = GLEW_ARB_clear_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_compressed_texture_pixel_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) + { + ret = GLEW_ARB_compressed_texture_pixel_storage; + continue; + } +#endif +#ifdef GL_ARB_compute_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) + { + ret = GLEW_ARB_compute_shader; + continue; + } +#endif +#ifdef GL_ARB_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_ARB_conservative_depth; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_ARB_copy_image; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_explicit_uniform_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) + { + ret = GLEW_ARB_explicit_uniform_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_layer_viewport + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) + { + ret = GLEW_ARB_fragment_layer_viewport; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_no_attachments + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) + { + ret = GLEW_ARB_framebuffer_no_attachments; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) + { + ret = GLEW_ARB_internalformat_query; + continue; + } +#endif +#ifdef GL_ARB_internalformat_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) + { + ret = GLEW_ARB_internalformat_query2; + continue; + } +#endif +#ifdef GL_ARB_invalidate_subdata + if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) + { + ret = GLEW_ARB_invalidate_subdata; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_alignment + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) + { + ret = GLEW_ARB_map_buffer_alignment; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multi_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) + { + ret = GLEW_ARB_multi_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_program_interface_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) + { + ret = GLEW_ARB_program_interface_query; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_robust_buffer_access_behavior + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) + { + ret = GLEW_ARB_robust_buffer_access_behavior; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GL_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_atomic_counters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) + { + ret = GLEW_ARB_shader_atomic_counters; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_ARB_shader_image_load_store; + continue; + } +#endif +#ifdef GL_ARB_shader_image_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) + { + ret = GLEW_ARB_shader_image_size; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_storage_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) + { + ret = GLEW_ARB_shader_storage_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shading_language_420pack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) + { + ret = GLEW_ARB_shading_language_420pack; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shading_language_packing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) + { + ret = GLEW_ARB_shading_language_packing; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_stencil_texturing + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) + { + ret = GLEW_ARB_stencil_texturing; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) + { + ret = GLEW_ARB_texture_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_query_levels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) + { + ret = GLEW_ARB_texture_query_levels; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) + { + ret = GLEW_ARB_texture_storage; + continue; + } +#endif +#ifdef GL_ARB_texture_storage_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) + { + ret = GLEW_ARB_texture_storage_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_texture_view + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) + { + ret = GLEW_ARB_texture_view; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) + { + ret = GLEW_ARB_transform_feedback_instanced; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_binding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) + { + ret = GLEW_ARB_vertex_attrib_binding; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ATI_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_bindable_uniform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) + { + ret = GLEW_EXT_bindable_uniform; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_debug_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) + { + ret = GLEW_EXT_debug_marker; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) + { + ret = GLEW_EXT_draw_buffers2; + continue; + } +#endif +#ifdef GL_EXT_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_EXT_draw_instanced; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample_blit_scaled + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) + { + ret = GLEW_EXT_framebuffer_multisample_blit_scaled; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_EXT_geometry_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_program_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) + { + ret = GLEW_EXT_gpu_program_parameters; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) + { + ret = GLEW_EXT_gpu_shader4; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_EXT_packed_float; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_EXT_texture_array; + continue; + } +#endif +#ifdef GL_EXT_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_EXT_texture_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_EXT_texture_compression_latc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_EXT_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_integer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) + { + ret = GLEW_EXT_texture_integer; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif +#ifdef GL_EXT_texture_shared_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) + { + ret = GLEW_EXT_texture_shared_exponent; + continue; + } +#endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_EXT_timer_query; + continue; + } +#endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif +#ifdef GL_EXT_x11_sync_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) + { + ret = GLEW_EXT_x11_sync_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_frame_terminator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) + { + ret = GLEW_GREMEDY_frame_terminator; + continue; + } +#endif +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) + { +#ifdef GL_KHR_debug + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) + { + ret = GLEW_KHR_debug; + continue; + } +#endif +#ifdef GL_KHR_texture_compression_astc_ldr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) + { + ret = GLEW_KHR_texture_compression_astc_ldr; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_bindless_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) + { + ret = GLEW_NV_bindless_texture; + continue; + } +#endif +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_NV_depth_buffer_float; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_depth_range_unclamped + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) + { + ret = GLEW_NV_depth_range_unclamped; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) + { + ret = GLEW_NV_fragment_program4; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) + { + ret = GLEW_NV_framebuffer_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_geometry_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) + { + ret = GLEW_NV_geometry_program4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_NV_geometry_shader4; + continue; + } +#endif +#ifdef GL_NV_gpu_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) + { + ret = GLEW_NV_gpu_program4; + continue; + } +#endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) + { + ret = GLEW_NV_parameter_buffer_object; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_path_rendering + if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) + { + ret = GLEW_NV_path_rendering; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_shader_atomic_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) + { + ret = GLEW_NV_shader_atomic_float; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_NV_texture_multisample; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_NV_transform_feedback; + continue; + } +#endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif +#ifdef GL_NV_vertex_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) + { + ret = GLEW_NV_vertex_program4; + continue; + } +#endif +#ifdef GL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLEW_NV_video_capture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) + { +#ifdef GL_OES_byte_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) + { + ret = GLEW_OES_byte_coordinates; + continue; + } +#endif +#ifdef GL_OES_compressed_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) + { + ret = GLEW_OES_compressed_paletted_texture; + continue; + } +#endif +#ifdef GL_OES_read_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) + { + ret = GLEW_OES_read_format; + continue; + } +#endif +#ifdef GL_OES_single_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) + { + ret = GLEW_OES_single_precision; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) + { +#ifdef GL_REGAL_error_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) + { + ret = GLEW_REGAL_error_string; + continue; + } +#endif +#ifdef GL_REGAL_extension_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) + { + ret = GLEW_REGAL_extension_query; + continue; + } +#endif +#ifdef GL_REGAL_log + if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) + { + ret = GLEW_REGAL_log; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) +#else +GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = WGLEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) + { + ret = WGLEW_EXT_pixel_format_packed_float; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif +#ifdef WGL_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = WGLEW_EXT_swap_control_tear; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_DX_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) + { + ret = WGLEW_NV_DX_interop; + continue; + } +#endif +#ifdef WGL_NV_DX_interop2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) + { + ret = WGLEW_NV_DX_interop2; + continue; + } +#endif +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_gpu_affinity + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) + { + ret = WGLEW_NV_gpu_affinity; + continue; + } +#endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef WGL_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = WGLEW_NV_video_capture; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__ANDROID__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif +#ifdef GLX_ARB_robustness_application_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) + { + ret = GLXEW_ARB_robustness_application_isolation; + continue; + } +#endif +#ifdef GLX_ARB_robustness_share_group_isolation + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) + { + ret = GLXEW_ARB_robustness_share_group_isolation; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_create_context_es_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) + { + ret = GLXEW_EXT_create_context_es_profile; + continue; + } +#endif +#ifdef GLX_EXT_fbconfig_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) + { + ret = GLXEW_EXT_fbconfig_packed_float; + continue; + } +#endif +#ifdef GLX_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_swap_control_tear + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) + { + ret = GLXEW_EXT_swap_control_tear; + continue; + } +#endif +#ifdef GLX_EXT_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = GLXEW_EXT_texture_from_pixmap; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif +#ifdef GLX_MESA_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_MESA_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GLX_NV_video_capture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) + { + ret = GLXEW_NV_video_capture; + continue; + } +#endif +#ifdef GLX_NV_video_out + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) + { + ret = GLXEW_NV_video_out; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#ifdef GLX_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_hyperpipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) + { + ret = GLXEW_SGIX_hyperpipe; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/thirdparty/glew/glew-1.9.0/src/glewinfo.c b/thirdparty/glew/glew-1.9.0/src/glewinfo.c new file mode 100644 index 0000000..d7a733c --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/src/glewinfo.c @@ -0,0 +1,9984 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#if defined(_WIN32) +#include +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#include +#endif + +#ifdef GLEW_REGAL +#include +#endif + +static FILE* f; + +#ifdef GLEW_MX +GLEWContext _glewctx; +#define glewGetContext() (&_glewctx) +#ifdef _WIN32 +WGLEWContext _wglewctx; +#define wglewGetContext() (&_wglewctx) +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLXEWContext _glxewctx; +#define glxewGetContext() (&_glxewctx) +#endif +#endif + +#if defined(_WIN32) +GLboolean glewCreateContext (int* pixelformat); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewCreateContext (const char* display, int* visual); +#else +GLboolean glewCreateContext (); +#endif + +#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual); +#endif + +void glewDestroyContext (); + +/* ------------------------------------------------------------------------- */ + +static void glewPrintExt (const char* name, GLboolean def1, GLboolean def2, GLboolean def3) +{ + unsigned int i; + fprintf(f, "\n%s:", name); + for (i=0; i<62-strlen(name); i++) fprintf(f, " "); + fprintf(f, "%s ", def1 ? "OK" : "MISSING"); + if (def1 != def2) + fprintf(f, "[%s] ", def2 ? "OK" : "MISSING"); + if (def1 != def3) + fprintf(f, "[%s]\n", def3 ? "OK" : "MISSING"); + else + fprintf(f, "\n"); + for (i=0; i]\n"); +#else + fprintf(stderr, "Usage: glewinfo [-display ] [-visual ]\n"); +#endif + return 1; + } +#endif + +#if defined(_WIN32) + if (GL_TRUE == glewCreateContext(&visual)) +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + if (GL_TRUE == glewCreateContext()) +#else + if (GL_TRUE == glewCreateContext(display, &visual)) +#endif + { + fprintf(stderr, "Error: glewCreateContext failed\n"); + glewDestroyContext(); + return 1; + } + glewExperimental = GL_TRUE; +#ifdef GLEW_MX + err = glewContextInit(glewGetContext()); +#ifdef _WIN32 + err = err || wglewContextInit(wglewGetContext()); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + err = err || glxewContextInit(glxewGetContext()); +#endif + +#else + err = glewInit(); +#endif + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + glewDestroyContext(); + return 1; + } +#if defined(_WIN32) + f = fopen("glewinfo.txt", "w"); + if (f == NULL) f = stdout; +#else + f = stdout; +#endif + fprintf(f, "---------------------------\n"); + fprintf(f, " GLEW Extension Info\n"); + fprintf(f, "---------------------------\n\n"); + fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); +#if defined(_WIN32) + fprintf(f, "Reporting capabilities of pixelformat %d\n", visual); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", + display == NULL ? getenv("DISPLAY") : display, visual); +#endif + fprintf(f, "Running on a %s from %s\n", + glGetString(GL_RENDERER), glGetString(GL_VENDOR)); + fprintf(f, "OpenGL version %s is supported\n", glGetString(GL_VERSION)); + glewInfo(); +#if defined(_WIN32) + wglewInfo(); +#else + glxewInfo(); +#endif + if (f != stdout) fclose(f); + glewDestroyContext(); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual) +{ + int p = 0; + while (p < argc) + { +#if defined(_WIN32) + if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + *display = 0; + *visual = strtol(argv[p++], NULL, 0); + } + else + return GL_TRUE; +#else + if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + *display = argv[p++]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + *visual = (int)strtol(argv[p++], NULL, 0); + } + else + return GL_TRUE; +#endif + } + return GL_FALSE; +} +#endif + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) + +HWND wnd = NULL; +HDC dc = NULL; +HGLRC rc = NULL; + +GLboolean glewCreateContext (int* pixelformat) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL); + if (NULL == wnd) return GL_TRUE; + /* get the device context */ + dc = GetDC(wnd); + if (NULL == dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (*pixelformat == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + *pixelformat = ChoosePixelFormat(dc, &pfd); + if (*pixelformat == 0) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(dc, *pixelformat, &pfd)) return GL_TRUE; + /* create rendering context */ + rc = wglCreateContext(dc); + if (NULL == rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != rc) wglMakeCurrent(NULL, NULL); + if (NULL != rc) wglDeleteContext(rc); + if (NULL != wnd && NULL != dc) ReleaseDC(wnd, dc); + if (NULL != wnd) DestroyWindow(wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#include + +AGLContext ctx, octx; + +GLboolean glewCreateContext () +{ + int attrib[] = { AGL_RGBA, AGL_NONE }; + AGLPixelFormat pf; + /*int major, minor; + SetPortWindowPort(wnd); + aglGetVersion(&major, &minor); + fprintf(stderr, "GL %d.%d\n", major, minor);*/ + pf = aglChoosePixelFormat(NULL, 0, attrib); + if (NULL == pf) return GL_TRUE; + ctx = aglCreateContext(pf, NULL); + if (NULL == ctx || AGL_NO_ERROR != aglGetError()) return GL_TRUE; + aglDestroyPixelFormat(pf); + /*aglSetDrawable(ctx, GetWindowPort(wnd));*/ + octx = aglGetCurrentContext(); + if (GL_FALSE == aglSetCurrentContext(ctx)) return GL_TRUE; + /* Needed for Regal on the Mac */ + #if defined(GLEW_REGAL) && defined(__APPLE__) + RegalMakeCurrent(octx); + #endif + return GL_FALSE; +} + +void glewDestroyContext () +{ + aglSetCurrentContext(octx); + if (NULL != ctx) aglDestroyContext(ctx); +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +Display* dpy = NULL; +XVisualInfo* vi = NULL; +XVisualInfo* vis = NULL; +GLXContext ctx = NULL; +Window wnd = 0; +Colormap cmap = 0; + +GLboolean glewCreateContext (const char* display, int* visual) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* open display */ + dpy = XOpenDisplay(display); + if (NULL == dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + if (*visual == -1) + { + vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib); + if (NULL == vi) return GL_TRUE; + *visual = (int)XVisualIDFromVisual(vi->visual); + } + else + { + int n_vis, i; + vis = XGetVisualInfo(dpy, 0, NULL, &n_vis); + for (i=0; iscreen), 0, 0, 1, 1, 1, 0, 0);*/ + cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = cmap; + wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen), + 0, 0, 1, 1, 0, vi->depth, InputOutput, vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + return GL_FALSE; +} + +void glewDestroyContext () +{ + if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); + if (NULL != dpy && 0 != wnd) XDestroyWindow(dpy, wnd); + if (NULL != dpy && 0 != cmap) XFreeColormap(dpy, cmap); + if (NULL != vis) + XFree(vis); + else if (NULL != vi) + XFree(vi); + if (NULL != dpy) XCloseDisplay(dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ diff --git a/thirdparty/glew/glew-1.9.0/src/visualinfo.c b/thirdparty/glew/glew-1.9.0/src/visualinfo.c new file mode 100644 index 0000000..b8bb59e --- /dev/null +++ b/thirdparty/glew/glew-1.9.0/src/visualinfo.c @@ -0,0 +1,1178 @@ +/* +** visualinfo.c +** +** Copyright (C) Nate Robins, 1997 +** Michael Wimmer, 1999 +** Milan Ikits, 2002-2008 +** +** visualinfo is a small utility that displays all available visuals, +** aka. pixelformats, in an OpenGL system along with renderer version +** information. It shows a table of all the visuals that support OpenGL +** along with their capabilities. The format of the table is similar to +** that of glxinfo on Unix systems: +** +** visual ~= pixel format descriptor +** id = visual id (integer from 1 - max visuals) +** tp = type (wn: window, pb: pbuffer, wp: window & pbuffer, bm: bitmap) +** ac = acceleration (ge: generic, fu: full, no: none) +** fm = format (i: integer, f: float, c: color index) +** db = double buffer (y = yes) +** sw = swap method (x: exchange, c: copy, u: undefined) +** st = stereo (y = yes) +** sz = total # bits +** r = # bits of red +** g = # bits of green +** b = # bits of blue +** a = # bits of alpha +** axbf = # aux buffers +** dpth = # bits of depth +** stcl = # bits of stencil +*/ + +#include +#include +#include +#include +#if defined(_WIN32) +#include +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) +#include +#else +#include +#endif + +#ifdef GLEW_MX +GLEWContext _glewctx; +# define glewGetContext() (&_glewctx) +# ifdef _WIN32 +WGLEWContext _wglewctx; +# define wglewGetContext() (&_wglewctx) +# elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +GLXEWContext _glxewctx; +# define glxewGetContext() (&_glxewctx) +# endif +#endif /* GLEW_MX */ + +typedef struct GLContextStruct +{ +#ifdef _WIN32 + HWND wnd; + HDC dc; + HGLRC rc; +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + AGLContext ctx, octx; +#else + Display* dpy; + XVisualInfo* vi; + GLXContext ctx; + Window wnd; + Colormap cmap; +#endif +} GLContext; + +void InitContext (GLContext* ctx); +GLboolean CreateContext (GLContext* ctx); +void DestroyContext (GLContext* ctx); +void VisualInfo (GLContext* ctx); +void PrintExtensions (const char* s); +GLboolean ParseArgs (int argc, char** argv); + +int showall = 0; +int displaystdout = 0; +int verbose = 0; +int drawableonly = 0; + +char* display = NULL; +int visual = -1; + +FILE* file = 0; + +int +main (int argc, char** argv) +{ + GLenum err; + GLContext ctx; + + /* ---------------------------------------------------------------------- */ + /* parse arguments */ + if (GL_TRUE == ParseArgs(argc-1, argv+1)) + { +#if defined(_WIN32) + fprintf(stderr, "Usage: visualinfo [-a] [-s] [-h] [-pf ]\n"); + fprintf(stderr, " -a: show all visuals\n"); + fprintf(stderr, " -s: display to stdout instead of visualinfo.txt\n"); + fprintf(stderr, " -pf : use given pixelformat\n"); + fprintf(stderr, " -h: this screen\n"); +#else + fprintf(stderr, "Usage: visualinfo [-h] [-display ] [-visual ]\n"); + fprintf(stderr, " -h: this screen\n"); + fprintf(stderr, " -display : use given display\n"); + fprintf(stderr, " -visual : use given visual\n"); +#endif + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* create OpenGL rendering context */ + InitContext(&ctx); + if (GL_TRUE == CreateContext(&ctx)) + { + fprintf(stderr, "Error: CreateContext failed\n"); + DestroyContext(&ctx); + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* initialize GLEW */ + glewExperimental = GL_TRUE; +#ifdef GLEW_MX + err = glewContextInit(glewGetContext()); +# ifdef _WIN32 + err = err || wglewContextInit(wglewGetContext()); +# elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + err = err || glxewContextInit(glxewGetContext()); +# endif +#else + err = glewInit(); +#endif + if (GLEW_OK != err) + { + fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); + DestroyContext(&ctx); + return 1; + } + + /* ---------------------------------------------------------------------- */ + /* open file */ +#if defined(_WIN32) + if (!displaystdout) + file = fopen("visualinfo.txt", "w"); + if (file == NULL) + file = stdout; +#else + file = stdout; +#endif + + /* ---------------------------------------------------------------------- */ + /* output header information */ + /* OpenGL extensions */ + fprintf(file, "OpenGL vendor string: %s\n", glGetString(GL_VENDOR)); + fprintf(file, "OpenGL renderer string: %s\n", glGetString(GL_RENDERER)); + fprintf(file, "OpenGL version string: %s\n", glGetString(GL_VERSION)); + fprintf(file, "OpenGL extensions (GL_): \n"); + PrintExtensions((char*)glGetString(GL_EXTENSIONS)); + +#ifndef GLEW_NO_GLU + /* GLU extensions */ + fprintf(file, "GLU version string: %s\n", gluGetString(GLU_VERSION)); + fprintf(file, "GLU extensions (GLU_): \n"); + PrintExtensions((char*)gluGetString(GLU_EXTENSIONS)); +#endif + + /* ---------------------------------------------------------------------- */ + /* extensions string */ +#if defined(_WIN32) + /* WGL extensions */ + if (WGLEW_ARB_extensions_string || WGLEW_EXT_extensions_string) + { + fprintf(file, "WGL extensions (WGL_): \n"); + PrintExtensions(wglGetExtensionsStringARB ? + (char*)wglGetExtensionsStringARB(ctx.dc) : + (char*)wglGetExtensionsStringEXT()); + } +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +#else + /* GLX extensions */ + fprintf(file, "GLX extensions (GLX_): \n"); + PrintExtensions(glXQueryExtensionsString(glXGetCurrentDisplay(), + DefaultScreen(glXGetCurrentDisplay()))); +#endif + + /* ---------------------------------------------------------------------- */ + /* enumerate all the formats */ + VisualInfo(&ctx); + + /* ---------------------------------------------------------------------- */ + /* release resources */ + DestroyContext(&ctx); + if (file != stdout) + fclose(file); + return 0; +} + +/* do the magic to separate all extensions with comma's, except + for the last one that _may_ terminate in a space. */ +void PrintExtensions (const char* s) +{ + char t[80]; + int i=0; + char* p=0; + + t[79] = '\0'; + while (*s) + { + t[i++] = *s; + if(*s == ' ') + { + if (*(s+1) != '\0') { + t[i-1] = ','; + t[i] = ' '; + p = &t[i++]; + } + else /* zoinks! last one terminated in a space! */ + { + t[i-1] = '\0'; + } + } + if(i > 80 - 5) + { + *p = t[i] = '\0'; + fprintf(file, " %s\n", t); + p++; + i = (int)strlen(p); + strcpy(t, p); + } + s++; + } + t[i] = '\0'; + fprintf(file, " %s.\n", t); +} + +/* ---------------------------------------------------------------------- */ + +#if defined(_WIN32) + +void +VisualInfoARB (GLContext* ctx) +{ + int attrib[32], value[32], n_attrib, n_pbuffer=0, n_float=0; + int i, pf, maxpf; + unsigned int c; + + /* to get pbuffer capable pixel formats */ + attrib[0] = WGL_DRAW_TO_PBUFFER_ARB; + attrib[1] = GL_TRUE; + attrib[2] = 0; + wglChoosePixelFormatARB(ctx->dc, attrib, 0, 1, &pf, &c); + /* query number of pixel formats */ + attrib[0] = WGL_NUMBER_PIXEL_FORMATS_ARB; + wglGetPixelFormatAttribivARB(ctx->dc, 0, 0, 1, attrib, value); + maxpf = value[0]; + for (i=0; i<32; i++) + value[i] = 0; + + attrib[0] = WGL_SUPPORT_OPENGL_ARB; + attrib[1] = WGL_DRAW_TO_WINDOW_ARB; + attrib[2] = WGL_DRAW_TO_BITMAP_ARB; + attrib[3] = WGL_ACCELERATION_ARB; + /* WGL_NO_ACCELERATION_ARB, WGL_GENERIC_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB */ + attrib[4] = WGL_SWAP_METHOD_ARB; + /* WGL_SWAP_EXCHANGE_ARB, WGL_SWAP_COPY_ARB, WGL_SWAP_UNDEFINED_ARB */ + attrib[5] = WGL_DOUBLE_BUFFER_ARB; + attrib[6] = WGL_STEREO_ARB; + attrib[7] = WGL_PIXEL_TYPE_ARB; + /* WGL_TYPE_RGBA_ARB, WGL_TYPE_COLORINDEX_ARB, + WGL_TYPE_RGBA_FLOAT_ATI (WGL_ATI_pixel_format_float) */ + /* Color buffer information */ + attrib[8] = WGL_COLOR_BITS_ARB; + attrib[9] = WGL_RED_BITS_ARB; + attrib[10] = WGL_GREEN_BITS_ARB; + attrib[11] = WGL_BLUE_BITS_ARB; + attrib[12] = WGL_ALPHA_BITS_ARB; + /* Accumulation buffer information */ + attrib[13] = WGL_ACCUM_BITS_ARB; + attrib[14] = WGL_ACCUM_RED_BITS_ARB; + attrib[15] = WGL_ACCUM_GREEN_BITS_ARB; + attrib[16] = WGL_ACCUM_BLUE_BITS_ARB; + attrib[17] = WGL_ACCUM_ALPHA_BITS_ARB; + /* Depth, stencil, and aux buffer information */ + attrib[18] = WGL_DEPTH_BITS_ARB; + attrib[19] = WGL_STENCIL_BITS_ARB; + attrib[20] = WGL_AUX_BUFFERS_ARB; + /* Layer information */ + attrib[21] = WGL_NUMBER_OVERLAYS_ARB; + attrib[22] = WGL_NUMBER_UNDERLAYS_ARB; + attrib[23] = WGL_SWAP_LAYER_BUFFERS_ARB; + attrib[24] = WGL_SAMPLES_ARB; + attrib[25] = WGL_SUPPORT_GDI_ARB; + n_attrib = 26; + if (WGLEW_ARB_pbuffer) + { + attrib[n_attrib] = WGL_DRAW_TO_PBUFFER_ARB; + n_pbuffer = n_attrib; + n_attrib++; + } + if (WGLEW_NV_float_buffer) + { + attrib[n_attrib] = WGL_FLOAT_COMPONENTS_NV; + n_float = n_attrib; + n_attrib++; + } + + if (!verbose) + { + /* print table header */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | layer |\n"); + fprintf(file, " | id | tp ac gd fm db sw st ms | sz r g b a | bf th cl | sz r g b a | ov un sw |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + wglGetPixelFormatAttribivARB(ctx->dc, i, 0, n_attrib, attrib, value); + /* only describe this format if it supports OpenGL */ + if (!value[0]) continue; + /* by default show only fully accelerated window or pbuffer capable visuals */ + if (!showall + && ((value[2] && !value[1]) + || (!WGLEW_ARB_pbuffer || !value[n_pbuffer]) + || (value[3] != WGL_FULL_ACCELERATION_ARB))) continue; + /* print out the information for this visual */ + /* visual id */ + fprintf(file, " |% 4d | ", i); + /* visual type */ + if (value[1]) + { + if (WGLEW_ARB_pbuffer && value[n_pbuffer]) fprintf(file, "wp "); + else fprintf(file, "wn "); + } + else + { + if (value[2]) fprintf(file, "bm "); + else if (WGLEW_ARB_pbuffer && value[n_pbuffer]) fprintf(file, "pb "); + } + /* acceleration */ + fprintf(file, "%s ", value[3] == WGL_FULL_ACCELERATION_ARB ? "fu" : + value[3] == WGL_GENERIC_ACCELERATION_ARB ? "ge" : + value[3] == WGL_NO_ACCELERATION_ARB ? "no" : ". "); + /* gdi support */ + fprintf(file, " %c ", value[25] ? 'y' : '.'); + /* format */ + if (WGLEW_NV_float_buffer && value[n_float]) fprintf(file, " f "); + else if (WGLEW_ATI_pixel_format_float && value[7] == WGL_TYPE_RGBA_FLOAT_ATI) fprintf(file, " f "); + else if (value[7] == WGL_TYPE_RGBA_ARB) fprintf(file, " i "); + else if (value[7] == WGL_TYPE_COLORINDEX_ARB) fprintf(file, " c "); + else if (value[7] == WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT) fprintf(file," p "); + else fprintf(file," ? "); + /* double buffer */ + fprintf(file, " %c ", value[5] ? 'y' : '.'); + /* swap method */ + if (value[4] == WGL_SWAP_EXCHANGE_ARB) fprintf(file, " x "); + else if (value[4] == WGL_SWAP_COPY_ARB) fprintf(file, " c "); + else if (value[4] == WGL_SWAP_UNDEFINED_ARB) fprintf(file, " . "); + else fprintf(file, " . "); + /* stereo */ + fprintf(file, " %c ", value[6] ? 'y' : '.'); + /* multisample */ + if (value[24] > 0) + fprintf(file, "%2d | ", value[24]); + else + fprintf(file, " . | "); + /* color size */ + if (value[8]) fprintf(file, "%3d ", value[8]); + else fprintf(file, " . "); + /* red */ + if (value[9]) fprintf(file, "%2d ", value[9]); + else fprintf(file, " . "); + /* green */ + if (value[10]) fprintf(file, "%2d ", value[10]); + else fprintf(file, " . "); + /* blue */ + if (value[11]) fprintf(file, "%2d ", value[11]); + else fprintf(file, " . "); + /* alpha */ + if (value[12]) fprintf(file, "%2d | ", value[12]); + else fprintf(file, " . | "); + /* aux buffers */ + if (value[20]) fprintf(file, "%2d ", value[20]); + else fprintf(file, " . "); + /* depth */ + if (value[18]) fprintf(file, "%2d ", value[18]); + else fprintf(file, " . "); + /* stencil */ + if (value[19]) fprintf(file, "%2d | ", value[19]); + else fprintf(file, " . | "); + /* accum size */ + if (value[13]) fprintf(file, "%3d ", value[13]); + else fprintf(file, " . "); + /* accum red */ + if (value[14]) fprintf(file, "%2d ", value[14]); + else fprintf(file, " . "); + /* accum green */ + if (value[15]) fprintf(file, "%2d ", value[15]); + else fprintf(file, " . "); + /* accum blue */ + if (value[16]) fprintf(file, "%2d ", value[16]); + else fprintf(file, " . "); + /* accum alpha */ + if (value[17]) fprintf(file, "%2d | ", value[17]); + else fprintf(file, " . | "); + /* overlay */ + if (value[21]) fprintf(file, "%2d ", value[21]); + else fprintf(file, " . "); + /* underlay */ + if (value[22]) fprintf(file, "%2d ", value[22]); + else fprintf(file, " . "); + /* layer swap */ + if (value[23]) fprintf(file, "y "); + else fprintf(file, " . "); + fprintf(file, "|\n"); + } + /* print table footer */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | layer |\n"); + fprintf(file, " | id | tp ac gd fm db sw st ms | sz r g b a | bf th cl | sz r g b a | ov un sw |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-----------------+----------+\n"); + } + else /* verbose */ + { +#if 0 + fprintf(file, "\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && !(pfd.dwFlags & PFD_DRAW_TO_WINDOW))) continue; + fprintf(file, "Visual ID: %2d depth=%d class=%s\n", i, pfd.cDepthBits, + pfd.cColorBits <= 8 ? "PseudoColor" : "TrueColor"); + fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%d stereo=%d\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", pfd.dwFlags & PFD_DOUBLEBUFFER, pfd.dwFlags & PFD_STEREO); + fprintf(file, " generic=%d generic accelerated=%d\n", (pfd.dwFlags & PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT, (pfd.dwFlags & PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED); + fprintf(file, " rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits); + fprintf(file, " auxBuffers=%d depthSize=%d stencilSize=%d\n", pfd.cAuxBuffers, pfd.cDepthBits, pfd.cStencilBits); + fprintf(file, " accum: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cAccumRedBits, pfd.cAccumGreenBits, pfd.cAccumBlueBits, pfd.cAccumAlphaBits); + fprintf(file, " multiSample=%d multisampleBuffers=%d\n", 0, 0); + fprintf(file, " Opaque.\n"); + } +#endif + } +} + +void +VisualInfoGDI (GLContext* ctx) +{ + int i, maxpf; + PIXELFORMATDESCRIPTOR pfd; + + /* calling DescribePixelFormat() with NULL pfd (!!!) return maximum + number of pixel formats */ + maxpf = DescribePixelFormat(ctx->dc, 1, 0, NULL); + + if (!verbose) + { + fprintf(file, "-----------------------------------------------------------------------------\n"); + fprintf(file, " visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms \n"); + fprintf(file, " id dep tp sp sz l ci b ro ne ac sz sz sz sz bf th cl sz r g b a ns b\n"); + fprintf(file, "-----------------------------------------------------------------------------\n"); + + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && (pfd.dwFlags & PFD_DRAW_TO_BITMAP))) continue; + /* other criteria could be tested here for actual pixel format + choosing in an application: + + for (...each pixel format...) { + if (pfd.dwFlags & PFD_SUPPORT_OPENGL && + pfd.dwFlags & PFD_DOUBLEBUFFER && + pfd.cDepthBits >= 24 && + pfd.cColorBits >= 24) + { + goto found; + } + } + ... not found so exit ... + found: + ... found so use it ... + */ + /* print out the information for this pixel format */ + fprintf(file, "0x%02x ", i); + fprintf(file, "%3d ", pfd.cColorBits); + if(pfd.dwFlags & PFD_DRAW_TO_WINDOW) fprintf(file, "wn "); + else if(pfd.dwFlags & PFD_DRAW_TO_BITMAP) fprintf(file, "bm "); + else fprintf(file, "pb "); + /* should find transparent pixel from LAYERPLANEDESCRIPTOR */ + fprintf(file, " . "); + fprintf(file, "%3d ", pfd.cColorBits); + /* bReserved field indicates number of over/underlays */ + if(pfd.bReserved) fprintf(file, " %d ", pfd.bReserved); + else fprintf(file, " . "); + fprintf(file, " %c ", pfd.iPixelType == PFD_TYPE_RGBA ? 'r' : 'c'); + fprintf(file, "%c ", pfd.dwFlags & PFD_DOUBLEBUFFER ? 'y' : '.'); + fprintf(file, " %c ", pfd.dwFlags & PFD_STEREO ? 'y' : '.'); + /* added: */ + fprintf(file, " %c ", pfd.dwFlags & PFD_GENERIC_FORMAT ? 'y' : '.'); + fprintf(file, " %c ", pfd.dwFlags & PFD_GENERIC_ACCELERATED ? 'y' : '.'); + if(pfd.cRedBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cRedBits); + else fprintf(file, " . "); + if(pfd.cGreenBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cGreenBits); + else fprintf(file, " . "); + if(pfd.cBlueBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cBlueBits); + else fprintf(file, " . "); + if(pfd.cAlphaBits && pfd.iPixelType == PFD_TYPE_RGBA) + fprintf(file, "%2d ", pfd.cAlphaBits); + else fprintf(file, " . "); + if(pfd.cAuxBuffers) fprintf(file, "%2d ", pfd.cAuxBuffers); + else fprintf(file, " . "); + if(pfd.cDepthBits) fprintf(file, "%2d ", pfd.cDepthBits); + else fprintf(file, " . "); + if(pfd.cStencilBits) fprintf(file, "%2d ", pfd.cStencilBits); + else fprintf(file, " . "); + if(pfd.cAccumBits) fprintf(file, "%3d ", pfd.cAccumBits); + else fprintf(file, " . "); + if(pfd.cAccumRedBits) fprintf(file, "%2d ", pfd.cAccumRedBits); + else fprintf(file, " . "); + if(pfd.cAccumGreenBits) fprintf(file, "%2d ", pfd.cAccumGreenBits); + else fprintf(file, " . "); + if(pfd.cAccumBlueBits) fprintf(file, "%2d ", pfd.cAccumBlueBits); + else fprintf(file, " . "); + if(pfd.cAccumAlphaBits) fprintf(file, "%2d ", pfd.cAccumAlphaBits); + else fprintf(file, " . "); + /* no multisample in win32 */ + fprintf(file, " . .\n"); + } + /* print table footer */ + fprintf(file, "-----------------------------------------------------------------------------\n"); + fprintf(file, " visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms \n"); + fprintf(file, " id dep tp sp sz l ci b ro ne ac sz sz sz sz bf th cl sz r g b a ns b\n"); + fprintf(file, "-----------------------------------------------------------------------------\n"); + } + else /* verbose */ + { + fprintf(file, "\n"); + /* loop through all the pixel formats */ + for(i = 1; i <= maxpf; i++) + { + DescribePixelFormat(ctx->dc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + /* only describe this format if it supports OpenGL */ + if(!(pfd.dwFlags & PFD_SUPPORT_OPENGL) + || (drawableonly && !(pfd.dwFlags & PFD_DRAW_TO_WINDOW))) continue; + fprintf(file, "Visual ID: %2d depth=%d class=%s\n", i, pfd.cDepthBits, + pfd.cColorBits <= 8 ? "PseudoColor" : "TrueColor"); + fprintf(file, " bufferSize=%d level=%d renderType=%s doubleBuffer=%ld stereo=%ld\n", pfd.cColorBits, pfd.bReserved, pfd.iPixelType == PFD_TYPE_RGBA ? "rgba" : "ci", pfd.dwFlags & PFD_DOUBLEBUFFER, pfd.dwFlags & PFD_STEREO); + fprintf(file, " generic=%d generic accelerated=%d\n", (pfd.dwFlags & PFD_GENERIC_FORMAT) == PFD_GENERIC_FORMAT, (pfd.dwFlags & PFD_GENERIC_ACCELERATED) == PFD_GENERIC_ACCELERATED); + fprintf(file, " rgba: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cRedBits, pfd.cGreenBits, pfd.cBlueBits, pfd.cAlphaBits); + fprintf(file, " auxBuffers=%d depthSize=%d stencilSize=%d\n", pfd.cAuxBuffers, pfd.cDepthBits, pfd.cStencilBits); + fprintf(file, " accum: redSize=%d greenSize=%d blueSize=%d alphaSize=%d\n", pfd.cAccumRedBits, pfd.cAccumGreenBits, pfd.cAccumBlueBits, pfd.cAccumAlphaBits); + fprintf(file, " multiSample=%d multisampleBuffers=%d\n", 0, 0); + fprintf(file, " Opaque.\n"); + } + } +} + +void +VisualInfo (GLContext* ctx) +{ + if (WGLEW_ARB_pixel_format) + VisualInfoARB(ctx); + else + VisualInfoGDI(ctx); +} + +/* ---------------------------------------------------------------------- */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +void +VisualInfo (GLContext* ctx) +{ +/* + int attrib[] = { AGL_RGBA, AGL_NONE }; + AGLPixelFormat pf; + GLint value; + pf = aglChoosePixelFormat(NULL, 0, attrib); + while (pf != NULL) + { + aglDescribePixelFormat(pf, GL_RGBA, &value); + fprintf(stderr, "%d\n", value); + pf = aglNextPixelFormat(pf); + } +*/ +} + +#else /* GLX */ + +void +VisualInfo (GLContext* ctx) +{ + int n_fbc; + GLXFBConfig* fbc; + int value, ret, i; + + fbc = glXGetFBConfigs(ctx->dpy, DefaultScreen(ctx->dpy), &n_fbc); + + if (fbc) + { + if (!verbose) + { + /* print table header */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + fprintf(file, " | | visual | color | ax dp st | accum | ms | cav |\n"); + fprintf(file, " | id | tp xr cl fm db st lv xp | sz r g b a | bf th cl | r g b a | ns b | eat |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + /* loop through all the fbcs */ + for (i=0; idpy, fbc[i], GLX_FBCONFIG_ID, &value); + if (ret != Success) + { + fprintf(file, "| ? |"); + } + else + { + fprintf(file, " |% 4d | ", value); + } + /* visual type */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DRAWABLE_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (value & GLX_WINDOW_BIT) + { + if (value & GLX_PBUFFER_BIT) + { + fprintf(file, "wp "); + } + else + { + fprintf(file, "wn "); + } + } + else + { + if (value & GLX_PBUFFER_BIT) + { + fprintf(file, "pb "); + } + else if (value & GLX_PIXMAP_BIT) + { + fprintf(file, "pm "); + } + else + { + fprintf(file, " ? "); + } + } + } + /* x renderable */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_X_RENDERABLE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, value ? " y " : " n "); + } + /* class */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_X_VISUAL_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (GLX_TRUE_COLOR == value) + fprintf(file, "tc "); + else if (GLX_DIRECT_COLOR == value) + fprintf(file, "dc "); + else if (GLX_PSEUDO_COLOR == value) + fprintf(file, "pc "); + else if (GLX_STATIC_COLOR == value) + fprintf(file, "sc "); + else if (GLX_GRAY_SCALE == value) + fprintf(file, "gs "); + else if (GLX_STATIC_GRAY == value) + fprintf(file, "sg "); + else if (GLX_X_VISUAL_TYPE == value) + fprintf(file, " . "); + else + fprintf(file, " ? "); + } + /* format */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_RENDER_TYPE, &value); + if (ret != Success) + { + fprintf(file, " ? "); + } + else + { + if (GLXEW_NV_float_buffer) + { + int ret2, value2; + ret2 = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_FLOAT_COMPONENTS_NV, &value2); + if (Success == ret2 && GL_TRUE == value2) + { + fprintf(file, " f "); + } + else if (value & GLX_RGBA_BIT) + fprintf(file, " i "); + else if (value & GLX_COLOR_INDEX_BIT) + fprintf(file, " c "); + else + fprintf(file, " ? "); + } + else + { + if (value & GLX_RGBA_FLOAT_ATI_BIT) + fprintf(file, " f "); + else if (value & GLX_RGBA_BIT) + fprintf(file, " i "); + else if (value & GLX_COLOR_INDEX_BIT) + fprintf(file, " c "); + else + fprintf(file, " ? "); + } + } + /* double buffer */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DOUBLEBUFFER, &value); + fprintf(file, " %c ", Success != ret ? '?' : (value ? 'y' : '.')); + /* stereo */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_STEREO, &value); + fprintf(file, " %c ", Success != ret ? '?' : (value ? 'y' : '.')); + /* level */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_LEVEL, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, "%2d ", value); + } + /* transparency */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_TRANSPARENT_TYPE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (GLX_TRANSPARENT_RGB == value) + fprintf(file, " r | "); + else if (GLX_TRANSPARENT_INDEX == value) + fprintf(file, " i | "); + else if (GLX_NONE == value) + fprintf(file, " . | "); + else + fprintf(file, " ? | "); + } + /* color size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_BUFFER_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%3d ", value); + else + fprintf(file, " . "); + } + /* red size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_RED_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* green size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_GREEN_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* blue size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_BLUE_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* alpha size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ALPHA_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* aux buffers */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_AUX_BUFFERS, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* depth size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_DEPTH_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* stencil size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_STENCIL_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* accum red size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_RED_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum green size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_GREEN_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum blue size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_BLUE_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + if (value) + fprintf(file, "%2d ", value); + else + fprintf(file, " . "); + } + /* accum alpha size */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_ACCUM_ALPHA_SIZE, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + if (value) + fprintf(file, "%2d | ", value); + else + fprintf(file, " . | "); + } + /* multisample */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_SAMPLES, &value); + if (Success != ret) + { + fprintf(file, " ? "); + } + else + { + fprintf(file, "%2d ", value); + } + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_SAMPLE_BUFFERS, &value); + if (Success != ret) + { + fprintf(file, " ? | "); + } + else + { + fprintf(file, "%2d | ", value); + } + /* caveat */ + ret = glXGetFBConfigAttrib(ctx->dpy, fbc[i], GLX_CONFIG_CAVEAT, &value); + if (Success != ret) + { + fprintf(file, "???? |"); + } + else + { + if (GLX_NONE == value) + fprintf(file, "none |\n"); + else if (GLX_SLOW_CONFIG == value) + fprintf(file, "slow |\n"); + else if (GLX_NON_CONFORMANT_CONFIG == value) + fprintf(file, "ncft |\n"); + else + fprintf(file, "???? |\n"); + } + } + /* print table footer */ + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + fprintf(file, " | id | tp xr cl fm db st lv xp | sz r g b a | bf th cl | r g b a | ns b | eat |\n"); + fprintf(file, " | | visual | color | ax dp st | accum | ms | cav |\n"); + fprintf(file, " +-----+-------------------------+-----------------+----------+-------------+-------+------+\n"); + } + } +} + +#endif + +/* ------------------------------------------------------------------------ */ + +#if defined(_WIN32) + +void InitContext (GLContext* ctx) +{ + ctx->wnd = NULL; + ctx->dc = NULL; + ctx->rc = NULL; +} + +GLboolean CreateContext (GLContext* ctx) +{ + WNDCLASS wc; + PIXELFORMATDESCRIPTOR pfd; + /* check for input */ + if (NULL == ctx) return GL_TRUE; + /* register window class */ + ZeroMemory(&wc, sizeof(WNDCLASS)); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = DefWindowProc; + wc.lpszClassName = "GLEW"; + if (0 == RegisterClass(&wc)) return GL_TRUE; + /* create window */ + ctx->wnd = CreateWindow("GLEW", "GLEW", 0, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, + GetModuleHandle(NULL), NULL); + if (NULL == ctx->wnd) return GL_TRUE; + /* get the device context */ + ctx->dc = GetDC(ctx->wnd); + if (NULL == ctx->dc) return GL_TRUE; + /* find pixel format */ + ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); + if (visual == -1) /* find default */ + { + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + visual = ChoosePixelFormat(ctx->dc, &pfd); + if (0 == visual) return GL_TRUE; + } + /* set the pixel format for the dc */ + if (FALSE == SetPixelFormat(ctx->dc, visual, &pfd)) return GL_TRUE; + /* create rendering context */ + ctx->rc = wglCreateContext(ctx->dc); + if (NULL == ctx->rc) return GL_TRUE; + if (FALSE == wglMakeCurrent(ctx->dc, ctx->rc)) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + if (NULL != ctx->rc) wglMakeCurrent(NULL, NULL); + if (NULL != ctx->rc) wglDeleteContext(wglGetCurrentContext()); + if (NULL != ctx->wnd && NULL != ctx->dc) ReleaseDC(ctx->wnd, ctx->dc); + if (NULL != ctx->wnd) DestroyWindow(ctx->wnd); + UnregisterClass("GLEW", GetModuleHandle(NULL)); +} + +/* ------------------------------------------------------------------------ */ + +#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) + +void InitContext (GLContext* ctx) +{ + ctx->ctx = NULL; + ctx->octx = NULL; +} + +GLboolean CreateContext (GLContext* ctx) +{ + int attrib[] = { AGL_RGBA, AGL_NONE }; + AGLPixelFormat pf; + /* check input */ + if (NULL == ctx) return GL_TRUE; + /*int major, minor; + SetPortWindowPort(wnd); + aglGetVersion(&major, &minor); + fprintf(stderr, "GL %d.%d\n", major, minor);*/ + pf = aglChoosePixelFormat(NULL, 0, attrib); + if (NULL == pf) return GL_TRUE; + ctx->ctx = aglCreateContext(pf, NULL); + if (NULL == ctx->ctx || AGL_NO_ERROR != aglGetError()) return GL_TRUE; + aglDestroyPixelFormat(pf); + /*aglSetDrawable(ctx, GetWindowPort(wnd));*/ + ctx->octx = aglGetCurrentContext(); + if (GL_FALSE == aglSetCurrentContext(ctx->ctx)) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL == ctx) return; + aglSetCurrentContext(ctx->octx); + if (NULL != ctx->ctx) aglDestroyContext(ctx->ctx); +} + +/* ------------------------------------------------------------------------ */ + +#else /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +void InitContext (GLContext* ctx) +{ + ctx->dpy = NULL; + ctx->vi = NULL; + ctx->ctx = NULL; + ctx->wnd = 0; + ctx->cmap = 0; +} + +GLboolean CreateContext (GLContext* ctx) +{ + int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; + int erb, evb; + XSetWindowAttributes swa; + /* check input */ + if (NULL == ctx) return GL_TRUE; + /* open display */ + ctx->dpy = XOpenDisplay(display); + if (NULL == ctx->dpy) return GL_TRUE; + /* query for glx */ + if (!glXQueryExtension(ctx->dpy, &erb, &evb)) return GL_TRUE; + /* choose visual */ + ctx->vi = glXChooseVisual(ctx->dpy, DefaultScreen(ctx->dpy), attrib); + if (NULL == ctx->vi) return GL_TRUE; + /* create context */ + ctx->ctx = glXCreateContext(ctx->dpy, ctx->vi, None, True); + if (NULL == ctx->ctx) return GL_TRUE; + /* create window */ + /*wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);*/ + ctx->cmap = XCreateColormap(ctx->dpy, RootWindow(ctx->dpy, ctx->vi->screen), + ctx->vi->visual, AllocNone); + swa.border_pixel = 0; + swa.colormap = ctx->cmap; + ctx->wnd = XCreateWindow(ctx->dpy, RootWindow(ctx->dpy, ctx->vi->screen), + 0, 0, 1, 1, 0, ctx->vi->depth, InputOutput, ctx->vi->visual, + CWBorderPixel | CWColormap, &swa); + /* make context current */ + if (!glXMakeCurrent(ctx->dpy, ctx->wnd, ctx->ctx)) return GL_TRUE; + return GL_FALSE; +} + +void DestroyContext (GLContext* ctx) +{ + if (NULL != ctx->dpy && NULL != ctx->ctx) glXDestroyContext(ctx->dpy, ctx->ctx); + if (NULL != ctx->dpy && 0 != ctx->wnd) XDestroyWindow(ctx->dpy, ctx->wnd); + if (NULL != ctx->dpy && 0 != ctx->cmap) XFreeColormap(ctx->dpy, ctx->cmap); + if (NULL != ctx->vi) XFree(ctx->vi); + if (NULL != ctx->dpy) XCloseDisplay(ctx->dpy); +} + +#endif /* __UNIX || (__APPLE__ && GLEW_APPLE_GLX) */ + +GLboolean ParseArgs (int argc, char** argv) +{ + int p = 0; + while (p < argc) + { +#if defined(_WIN32) + if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + display = NULL; + visual = strtol(argv[p], NULL, 0); + } + else if (!strcmp(argv[p], "-a")) + { + showall = 1; + } + else if (!strcmp(argv[p], "-s")) + { + displaystdout = 1; + } + else if (!strcmp(argv[p], "-h")) + { + return GL_TRUE; + } + else + return GL_TRUE; +#else + if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + display = argv[p]; + } + else if (!strcmp(argv[p], "-visual")) + { + if (++p >= argc) return GL_TRUE; + visual = (int)strtol(argv[p], NULL, 0); + } + else if (!strcmp(argv[p], "-h")) + { + return GL_TRUE; + } + else + return GL_TRUE; +#endif + p++; + } + return GL_FALSE; +} diff --git a/thirdparty/glut/3.7.6/README-win32.txt b/thirdparty/glut/3.7.6/README-win32.txt new file mode 100644 index 0000000..d079229 --- /dev/null +++ b/thirdparty/glut/3.7.6/README-win32.txt @@ -0,0 +1,613 @@ + + + GLUT for Win32 README + --------------------- + + +VERSION/INFO: + + This is GLUT for Win32 version 3.7.6 as of Nov 8th 2001. + See the COPYRIGHT section for distribution and copyright notices. + Send all bug reports and questions for this version of GLUT to + Nate Robins [nate@pobox.com]. + + For more information about GLUT for Win32, see the web page: + www.pobox.com/~nate/glut.html or subscribe to the GLUT for Win32 + mailing list by sending e-mail to majordomo@perp.com with + "subscribe glut" in the body of the message. + + For general information about GLUT, see the GLUT web page: + http://reality.sgi.com/opengl/glut3/glut3.html and be sure to + check the GLUT FAQ first for any questions that you may have: + http://reality.sgi.com/opengl/glut3/glut-faq.html + + +COMPILING/INSTALLATION: + + o Precompiled versions of the DLL and import library can be + found on the GLUT for Win32 web page mentioned above. + + o Microsoft Developer Studio 6 workspace and project files have + been included in the source code distribution. + + To build the glut dll: + First, open Microsoft Developer Studio. + Then, select File -> Open Workspace and find the glut.dsw file + in the file dialog and double-click on it. + Finally, select Build -> Build glut32.dll. + When the build is finished, it will copy: + glut32.dll to %WinDir%\System, + glut32.lib to $(MSDevDir)\..\..\VC98\lib, and + glut.h to $(MSDevDir)\..\..\VC98\include\GL. + + Additional workspace files have been included in the progs, test + and lib directories to build the progs, tests and libs respectively. + + +BORLAND NOTES: + + From what I understand, Borland supplies a utility that + converts Microsoft Visual C++ .libs into Borland compatible + files. Therefore, the best method for Borland users is + probably to get the precompiled versions of the library and + convert the library. To create an import library for Borland + from the DLLs, use the following command (from a command prompt): + IMPLIB glut32.lib glut32.dll + If IMPLIB crashes when called this way, try + IMPLIB glut32.lib glut32.def + using the glut32.def file in this distribution. + + +FORTRAN NOTES: + + Bill Mitchell [william.mitchell@nist.gov] has put considerable + effort into getting GLUT to work with different compilers for + Fortran 90. He indicates that you should copy the f90glut.h + file to your $(MSDevDir)\..\..\VC98\include\GL directory. + Then, just build GLUT as usual. The Fortran 90 interface, f90gl, + can be obtained at http://math.nist.gov/f90gl and contains + installation instructions and usage examples. + + +MISC NOTES: + + o Overlay support is not implemented, nor are there any plans to + implement it in the near future. + + o To customize the windows icon, you can use the resource name + GLUT_ICON. For example, create an icon named "glut.ico", and + create a file called glut.rc that contains the following: + GLUT_ICON ICON glut.ico + then compile the glut.rc file with the following: + rc /r glut + and link the resulting glut.res file into your executable + (just like you would an object file). + Alternatively, you can simply add the glut.rc file to your + project if you are using Microsoft Developer Studio. + + +IMPLEMENTATION DEPENDENT DIFFERENCES: + + There are a few differences between the Win32 version of GLUT + and the X11 version of GLUT. Those are outlined here. Note + that MOST of these differences are allowed by the GLUT + specification. Bugs and unsupported features are outlined in + the UNSUPPORTED/BUGS section. + + o glutInit: + The following command line options have no meaning (and are + ignored) in GLUT for Win32: + -display, -indirect, -direct, -sync. + + o glutInitWindowPosition, glutPositionWindow: + Win32 has two different coordinate systems for windows. + One is in terms of client space and the other is the whole + window space (including the decorations). If you + glutPositionWindow(0, 0), GLUT for Win32 will place the + window CLIENT area at 0, 0. This will cause the window + decorations (title bar and left edge) to be OFF-SCREEN, but + it gives the user the most flexibility in positioning. + HOWEVER, if the user specifies glutInitWindowPosition(0, 0), + the window is placed relative to window space at 0, 0. + This will cause the window to be opened in the upper left + corner with all the decorations showing. This behaviour is + acceptable under the current GLUT specification. + + o glutSetIconTitle, glutSetWindowTitle: + There is no separation between Icon title and Window title + in Win32. Therefore, setting an icon title in Win32 has + no effect. + + o glutSetCursor: + As indicated in the GLUT specification, cursors may be + different on different platforms. This is the case in GLUT + for Win32. For the most part, the cursors will match the + meaning, but not necessarily the shape. Notable exceptions + are the GLUT_CURSOR_INFO & GLUT_CURSOR_SPRAY which use the + crosshair cursor and the GLUT_CURSOR_CYCLE which uses the + 'no' or 'destroy' cursor in Win32. + + o glutVisibilityFunc: + Win32 seems to be unable to determine if a window is fully + obscured. Therefore, the visibility of a GLUT window is + only reflected by its Iconic, Hidden or Shown state. That + is, even if a window is fully obscured, in GLUT for Win32, + it is still "visible". + + o glutEntryFunc: + Window Focus is handled differently in Win32 and X. + Specifically, the "window manager" in Win32 uses a "click to + focus" policy. That is, in order for a window to receive + focus, a mouse button must be clicked in it. Likewise, in + order for a window to loose focus, a mouse button must be + clicked outside the window (or in another window). + Therefore, the Enter and Leave notification provided by GLUT + may behave differently in the Win32 and in X11 versions. + There is a viable workaround for this. A program called + "Tweak UI" is provided by Microsoft which can be used to + change the focus policy in Win32 to "focus follows mouse". + It is available from the Microsoft Web Pages: + http://www.microsoft.com/windows/software/PowerToy.htm + + o glutCopyColormap: + GLUT for Win32 always copies the colormap. There is never + any sharing of colormaps. This is probably okay, since + Win32 merges the logical palette and the physical palette + anyway, so even if there are two windows with totally + different colors in their colormaps, Win32 will find a + (hopefully) good match between them. + + o glutIdleFunc + menus: + The glut idle function will NOT be called when a menu is + active. This causes all animation to stop when a menu is + active (in general, this is probably okay). Timer + functions will still fire, however. If the timer callback + draws into the rendering context, the drawing will not show + up until after the menu has finished, though. + + +UNSUPPORTED/BUGS: + + o glutAttachMenu: + Win32 only likes to work with left and right mouse buttons. + Especially so with popup menus. Therefore, when attaching + the menu to the middle mouse button, the LEFT mouse button + must be used to select from the menu. + + o glutSpaceball*, glutButtonBox*, glutTablet*, glutDials*: + None of the special input devices are supported at this + time. + + o When resizing or moving a GLUT for Win32 window, no updating + is performed. This causes the window to leave "tracks" on + the screen when getting bigger or when previously obscured + parts are being revealed. I put in a bit of a kludgy + workaround for those that absolutely can't have the weird + lines. The reshape callback is called multiple times for + reshapes. Therefore, in the reshape callback, some drawing + can be done. It should probably be limited to a color buffer + clear. + + o The video resizing capabilities of GLUT 3.3+ for X11 is + currently unimplemented (this is probably ok, since it + really isn't part of the spec until 4.0). I doubt that + this will ever be part of GLUT for Win32, since there is no + hardware to support it. A hack could simply change the + resolution of the desktop. + + +CHANGES/FIXES: + + (Nov 8, '01) + x Released 3.7.6 + + (Nov 8, '01) + x Changed fullscreen mode from TOPMOST back to simply TOP, since + (it turns out) many people use windows atop a GLUT window. + + (Nov 8, '01) + x Added code to prevent CPU spiking when no idle function is + registered. Otherwise, if an idle function is registered, spike + CPU so that the idle function gets all the attention it needs and + if this is a problem on the program side, the user can stick a + sleep() in their idle function. I believe that this strikes the + best balance betweeen GLUT being fast, and also being "nice" to + other processes. Thanks to James Wright for reporting this bug. + + (Nov 8, '01) + x Fixed bug in motion callback handler which wasn't setting the + current window, so multiple window apps (e.g., any GLUI app) + wouldn't get the callback correctly. + + (Oct 4, '01) + x Fixed bug in glutEnterGameMode() that caused new windows to not + be in "fullscreen" mode, so they got window decorations. + + (Oct 4, '01) + x Fixed bug in glutEnterGameMode() that caused new windows to not + be in "fullscreen" mode, so they got window decorations. + + (Oct 3, '01) + x Fixed bug in getVisualInfoFromString(): visuals not reloaded on + display mode change. Reload visuals each time they are queried. + This fixes a problem with Win32 because the list of availabe Visuals + (Pixelformats) changes after a change in displaymode. The problem + occurs when switching to gamemode and back. Thanks to Michael + Wimmer for pointing this out & providing the fix. + + (Oct 3, '01) + x Fixed bug in XGetVisualInfo(): pixelformats enumerated incorrectly. + Passing 0 as a pixelformat index to DescribePixelFormat gives + unpredictible results (e.g., this fails on the Voodoo opengl32.dll + and always reports 0 as the last available pixelformat index). + Thanks to Michael Wimmer for pointing this out & providing the fix. + + (Oct 3, '01) + x Fixed bug in glXGetConfig(): pixelformats enumerated incorrectly. The + test was OpenGL support OR draw to window, but should be AND. Thanks + to Michael Wimmer for pointing this out & providing the fix. + + (Sep 28, '01) + x Fixed glutChangeToSubMenu()/glutChangeToMenuEntry() bug where if you + went back and forth between a submenu and a plain entry, the submenu + wouldn't be updated properly. + + (Sep 28, '01) + x glutSetIconTitle() is now a nop. + + (Sep 28, '01) + x glutFullScreen() now sets the window as TOPMOST, therefore, the + window will always be on top (this essentially disables alt-tabbing). + + (Sep 28, '01) + x The key repeat ignore flag is now honored correctly. + + (Sep 28, '01) + x Key presses are now reported more accurately and fully, in + particular, modified up events (i.e., SHIFT-2) are now reported + correctly. + + (Sep 28, '01) + x Subwindows nested arbitrarily deep get their keyboard callbacks + correctly now. + + (Sep 28, '01) + x Major rewrite of the window procedure code to clean it up and make + way for other bug fixes. + + (Sep 23, '01) + x Fixed noof example program to use RAND_MAX instead of assumed + max of 2147483647.0. (Now it looks _much_ better!) + + (Sep 22, '01) + x Fixed sunlight example program. globe.raw data file was corrupt, + added a new one. + + (Sep 22, '01) + x Fixed zcomposite example program to print message if overlay + support is not found (instead of crashing). + + (Jan 22, '01) + x Fixed malloc(0) bug in Win32 version of XGetVisualInfo. Thanks + to Kekoa Proudfoot for bringing this to my attention. + + (Dec 12, '00) + x Added data files for the advanced & advanced97 programs. + + (Dec 12, '00) + x Added Developer Studio 6 project and workspace files for pretty + much everything (the stuff left out was usually unix specific). + + (Dec 7, '00) + x Fixed several compilation problems & corrupt files. Thanks to + Alexander Stohr for bringing these to my attention and providing + detailed fixes. + + (Dec 6, '00) + x Fixed compiler support for lcc. Thanks to Gordon for bringing + this to my attention and debugging fixes. + + (Nov 8, '00) + x Fixed submenu problem (sometimes the menu callback was not + called for valid items). Thanks to Michael Keeley. + + (Oct 16, '00) + x Corrected corrupt duck.iv file. Thanks to Jon Willeke for finding + this problem. + + (Sept 27, '00) + x Fixed bug in processWorkList that could cause a hang. Thanks to + Bill Volz & Daniel Azuma. + + (Sept 26, '00) + x Added mui DLL project file (thanks to DMWeldy@ugsolutions.com). + + (Sept 9, '00) + x Fixed Delete key bug (crash when no keyboard callback was + registered, but a special key callback was). Thanks to + Kent Bowling (kent_bowling@hotmail.com) for finding this bug. + + (May 18, '00) + x Fixed subwindow keyboard callbacks. + + (May 22, '97) + o Menus don't work under Windows 95 + x Fixed! Added a unique identifier to each menu item, and a + search function to grab a menu item given the unique identifier. + + (May 21, '97) + o A few minor bug fixes here and there. + x Thanks to Bruce Silberman and Chris Vale for their help with + this. We now have a DLL! + + (Apr 25, '97) + o DLL version of the library is coming (as soon as I figure out + how to do it -- if you know, let me know). + x Thanks to Bruce Silberman and Chris Vale for their help with + this. We now have a DLL! + + (Apr 24, '97) + x Added returns to KEY_DOWN etc messages so that the F10 key + doesn't toggle the system menu anymore. + + (Apr 7, '97) + o Palette is incorrect for modes other than TrueColor. + x Fixed this by forcing a default palette in modes that aren't + Truecolor in order to 'simulate' it. The applications + program shouldn't have to do this IMHO, but I guess we + can't argue with Microsoft (well, we can, but what good + will it do?). + + (Apr 2, '97) + x Added glut.ide file for Borland users. + + (Apr 2, '97) + x Fixed a bug in the WM_QUERYNEWPALETTE message. Wasn't + checking for a null colormap, then de-ref'd it. Oops. + + (Mar 13, '97) + o glutTimerFunc: + Currently, GLUT for Win32 programs busy waits when there is + an outstanding timer event (i.e., there is no select() + call). I haven't found this to be a problem, but I plan to + fix it just because I can't bear the thought of a busy wait. + x Added a timer event and a wait in the main loop. This fixes + the CPU spike. + + (Mar 11, '97) + x Fixed subwindow visibility. The visibility callback of + subwindows wasn't being called, now it is. + + (Mar 11, '97) + o glutGetHDC, glutGetHWND: + In order to support additional dialog boxes, wgl fonts, and + a host of other Win32 dependent structures, two functions + have been added that operate on the current window in GLUT. + The first (glutGetHDC) returns a handle to the current + windows device context. The second (glutGetHWND) returns + handle to the current window. + x Took these out to preserve GLUT portability. + + (Mar 11, '97) + x Fixed the glutWarpPointer() coordinates. Were relative to + the screen, now relative to window (client area) origin + (which is what they're supposed to be). + + (Mar 11, '97) + o glutCreateMenu, glutIdleFunc: + Menu's are modal in Win32. That is, they don't allow any + messages to be processed while they are up. Therefore, if + an idle function exists, it will not be called while + processing a menu. + x Fixed! I've put in a timer function that fires every + millisecond while a menu is up. The timer function handles + idle and timer events only (which should be the only + functions that are firing when a menu is up anyway). + + (Mar 7 '97) + x Fixed minor bugs tracked down by the example programs. + + (Mar 6, '97) + x Merged 3.3 GLUT for X11 into 3.2 GLUT for Win32. New code + structure allows for EASY merging! + + o In Win32, the parent gets the right to set the cursor of + any of its children. Therefore, a child windows cursor + will 'blink' between its cursor and its parent. + x Fixed this by checking whether the cursor is in a child + window or not. + + (Feb 28 '97) + o On initial bringup apps are getting 2 display callbacks. + x Fixed by the Fev 28 re-write. + + o Some multiple window (not subwindow) functionality is messed up. + See the sphere.exe program. + x Fixed by the Feb 28 re-write. + + o GLUT for Win32 supports color index mode ONLY in a paletted + display mode (i.e., 256 or 16 color mode). + x Fixed this in the re-write. If you can get a color index + visual (pixel format) you can use color index mode. + + (Feb 28 '97) + o Quite a few bugs (and incompatibilities) were being caused + by the structure that I used in the previous port of GLUT. + Therefore I decided that it would be best to "get back to + the roots". I re-implemented most of glut trying to stick + with the structure layed out by Mark. The result is a much + more stable version that passes ALL (!) (except overlay) + the tests provided by Mark. In addition, this new + structure will allow future enhancements by Mark to be + integrated much more quickly into the Win32 version. Also, + I'm now ordering the bugs in reverse, so that the most + recently fixed appear at the top of the list. + + (9/8/96) + o Changed the glutGetModifiers code to produce an error if not + called in the core input callbacks. + + (9/11/96) + o If the alt key is pressed with more than one other modifier key + it acts as if it is stuck -- it stays selected until pressed + and released again. + x Fixed. + + (9/12/96) + o When a submenu is attached to a menu, sometimes a GPF occurs. + Fixed. Needed to set the submenu before referencing it's members. + + o Kenny: Also, one little problem, I attached the menu to the + right-button, but when the left-button is pressed I detach + it to give the right-button new meaning; if I pop-up the menu and I + don't want to select anything, like most users, I click off of the + menu to make it disappear. When I do this, I get a GLUT error and + the program terminates because I am altering the menu attachment + from within the button press while the menu is active. + x Fixed. Needed to finish the menu when the user presses the button, + not just when a button is released. + + o GLUT for Win32 emulates a middle mouse button by checking if + both mouse buttons are down. This causes a lot of problems with + the menu and other multiple mouse button things. + x Fixed. No more middle mouse button emulation. Perhaps it would + be a good idea to emulate the middle mouse button (if not present) + with a key? + + (9/15/96) + o Added code to accept a user defined icon. If no icon is provided, + a default icon is loaded. + + (9/19/96) + o Shane: Command line options seem to be screwed up. (9/13) + x Fixed. The geometry command line was broken, and so was the + gldebug command line. + + o Fixed a bug in the default glut reshape. It was looking for the + parent of the current window and GPF'ing if there wasn't a parent. + Put in a check for a parent, and if none is there, use the + child. + + o Idle function sucks up all processor cycles. (9/8/96) + x I don't know if this is avoidable. If you have a tight rendering + loop, it may be that the processor time is going to be sucked up + no matter what. You can add a sleep() to the end of your render + loop if you would like to yeild to other processes and you don't + care too much about the speed of your rendering loop. If you have + Hardware that supports OpenGL (like a 3Dpro card, or GLint card) + then this should be less of a problem, since it won't be rendering + in software. (9/11/96) + + o If a window is fully obscured by another window, the visibility + callback is NOT called. As far as I can tell, this is a limitation + of the Win32 api, but a workaround is being searched for. (9/8/96) + x Limitation of the Win32 API + + o Fixed the entry functions. They only work if the keyboard focus + changes. Therefore, in most Win32 systems, the mouse must be + pressed outside of the window to get a GLUT_LEFT message and + then pressed inside the window for a GLUT_ENTERED message. + + o Alt modifier key doesn't work with keyboard callback. (9/8/96) + x Probably okay, because the glut spec says that these keys can + be intercepted by the system (which the alt key is...) (9/11/96) + + (11/17/96) + o glutRemoveMenuItem() not working properly. + x Thanks to Gary (grc@maple.civeng.rutgers.edu) for the fix to + this one. + + o Timer functions are messed up. + x Thanks to Joseph Galbraith for the fix to this one. + + (12/9/96) + o One (minor) difference came up between the X version of glut + and the nt one which you should know about. It is not a new + problem, and it concerns co-ords returned to the pointer + callbacks. (glutMotionFunc, glutMouseFunc) + Under X, you get co-ords in the range 0 +/- 2^15, under NT + you get 0..2^16. This is only really a problem when moving + above or to the left of the window. + eg dragging one pixel ABOVE the window will give :- + under x11 : y = -1 + under nt : y = 2^16 -1 + x Put in fix provided by Shane Clauson. + + (12/17/96) + o Idle functions not working properly for multiple windows. + x Fixed this by posting an idle message to every window in the + window list when idle. + + (12/18/96) + o glutSetCursor() was misbehaving (lthomas@cco.caltech.edu). + x Win32 requires that the hCursor member of the window class + be set to NULL when the class is registered or whenever the + mouse is moved, the original cursor is replaced (go + figure!). Now sets the cursor whenever a WM_MOUSEMOVE message + is received, because the WM_SETCURSOR event resets the cursor + even when in the decoration area. + + o Geometry is not being handled quite right. The numbers don't + take into account the window decorations. That is, if I say + make a window 100x100, then the WHOLE window (not just the + client area) is 100x100. Therefore, the client (opengl) area + is smaller than 100x100. (9/8/96) + x Fixed. Added code to subtract the decoration size on glutGet() + and add the decoration size on glutReshapeWindow(). + + o Multiple glutPostRedisplay() calls are NOT being combined. + To get round the "coalesce" problem on glutPostRedisplay, + the easiest solution is to roll-your-own coalesce by + keeping a global "dirty" flag in the app (eg replace all + calls to glutPostRedisplay with image_dirty=TRUE;), and to + handle image_dirty with a single glutPostRedisplay in the + idle callback when required. (erk - but increases + performance for my particular app (a rendering engine on + the end of a pipleine with a stream of graphics updates) by + a couple of orders of magnitude ! ) (9/8/96) + x Added code to coalesce redisplays. Every idle cycle, a + check is made to see which windows need redisplay, if they + need it, a redisplay is posted. The glutPostRedisplay() + call is just a stub that sets a flag. + + +THANKS: + + Special thanks to the following people for extensive testing, + suggestions, fixes and help: + + Alexander Stohr + Shane Clauson + Kenny Hoff + Richard Readings + Paul McQuesten + Philip Winston + JaeWoo Ahn + Joseph Galbraith + Paula Higgins + Sam Fortin + Chris Vale + Bill Mitchell + + and of course, the original author of GLUT: + Mark Kilgard. + + and many others... + + +COPYRIGHT: + +The OpenGL Utility Toolkit distribution for Win32 (Windows NT & +Windows 95) contains source code modified from the original source +code for GLUT version 3.3 which was developed by Mark J. Kilgard. The +original source code for GLUT is Copyright 1997 by Mark J. Kilgard. +GLUT for Win32 is Copyright 1997 by Nate Robins and is not in the +public domain, but it is freely distributable without licensing fees. +It is provided without guarantee or warrantee expressed or implied. +It was ported with the permission of Mark J. Kilgard by Nate Robins. + +THIS SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +OpenGL (R) is a registered trademark of Silicon Graphics, Inc. diff --git a/thirdparty/glut/3.7.6/include/GL/glut.h b/thirdparty/glut/3.7.6/include/GL/glut.h new file mode 100644 index 0000000..0e6ddfb --- /dev/null +++ b/thirdparty/glut/3.7.6/include/GL/glut.h @@ -0,0 +1,716 @@ +#ifndef __glut_h__ +#define __glut_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ + +/* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. */ + +#if defined(_WIN32) + +/* GLUT 3.7 now tries to avoid including + to avoid name space pollution, but Win32's + needs APIENTRY and WINGDIAPI defined properly. */ +# if 0 + /* This would put tons of macros and crap in our clean name space. */ +# define WIN32_LEAN_AND_MEAN +# include +# else + /* XXX This is from Win32's */ +# ifndef APIENTRY +# define GLUT_APIENTRY_DEFINED +# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +# endif + /* XXX This is from Win32's */ +# ifndef CALLBACK +# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) || defined(__LCC__) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +# endif + /* XXX Hack for lcc compiler. It doesn't support __declspec(dllimport), just __stdcall. */ +# if defined( __LCC__ ) +# undef WINGDIAPI +# define WINGDIAPI __stdcall +# else + /* XXX This is from Win32's and */ +# ifndef WINGDIAPI +# define GLUT_WINGDIAPI_DEFINED +# define WINGDIAPI __declspec(dllimport) +# endif +# endif + /* XXX This is from Win32's */ +# ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +# endif +# endif + +/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA + in your compile preprocessor options. */ +# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA) +# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ +/* To enable automatic SGI OpenGL for Windows library usage for GLUT, + define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */ +# ifdef GLUT_USE_SGI_OPENGL +# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */ +# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */ +# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */ +# else +# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ +# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */ +# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ +# endif +# endif + +/* To disable supression of annoying warnings about floats being promoted + to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor + options. */ +# ifndef GLUT_NO_WARNING_DISABLE +# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */ +# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +# endif + +/* Win32 has an annoying issue where there are multiple C run-time + libraries (CRTs). If the executable is linked with a different CRT + from the GLUT DLL, the GLUT DLL will not share the same CRT static + data seen by the executable. In particular, atexit callbacks registered + in the executable will not be called if GLUT calls its (different) + exit routine). GLUT is typically built with the + "/MD" option (the CRT with multithreading DLL support), but the Visual + C++ linker default is "/ML" (the single threaded CRT). + + One workaround to this issue is requiring users to always link with + the same CRT as GLUT is compiled with. That requires users supply a + non-standard option. GLUT 3.7 has its own built-in workaround where + the executable's "exit" function pointer is covertly passed to GLUT. + GLUT then calls the executable's exit function pointer to ensure that + any "atexit" calls registered by the application are called if GLUT + needs to exit. + + Note that the __glut*WithExit routines should NEVER be called directly. + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ + +/* XXX This is from Win32's */ +# if !defined(_MSC_VER) && !defined(__cdecl) + /* Define __cdecl for non-Microsoft compilers. */ +# define __cdecl +# define GLUT_DEFINED___CDECL +# endif +# ifndef _CRTIMP +# ifdef _NTSDK + /* Definition compatible with NT SDK */ +# define _CRTIMP +# else + /* Current definition */ +# ifdef _DLL +# define _CRTIMP __declspec(dllimport) +# else +# define _CRTIMP +# endif +# endif +# define GLUT_DEFINED__CRTIMP +# endif + +/* GLUT API entry point declarations for Win32. */ +# ifdef GLUT_BUILDING_LIB +# define GLUTAPI __declspec(dllexport) +# else +# ifdef _DLL +# define GLUTAPI __declspec(dllimport) +# else +# define GLUTAPI extern +# endif +# endif + +/* GLUT callback calling convention for Win32. */ +# define GLUTCALLBACK __cdecl + +#endif /* _WIN32 */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) +# ifndef GLUT_BUILDING_LIB +extern _CRTIMP void __cdecl exit(int); +# endif +#else +/* non-Win32 case. */ +/* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */ +# define APIENTRY +# define GLUT_APIENTRY_DEFINED +# define CALLBACK +/* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */ +# define GLUTAPI extern +# define GLUTCALLBACK +/* Prototype exit for the non-Win32 case (see above). */ +extern void exit(int); +#endif + +/** + GLUT API revision history: + + GLUT_API_VERSION is updated to reflect incompatible GLUT + API changes (interface changes, semantic changes, deletions, + or additions). + + GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 + + GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, + extension. Supports new input devices like tablet, dial and button + box, and Spaceball. Easy to query OpenGL extensions. + + GLUT_API_VERSION=3 glutMenuStatus added. + + GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, + glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic + video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, + glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, + glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). +**/ +#ifndef GLUT_API_VERSION /* allow this to be overriden */ +#define GLUT_API_VERSION 3 +#endif + +/** + GLUT implementation revision history: + + GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT + API revisions and implementation revisions (ie, bug fixes). + + GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of + GLUT Xlib-based implementation. 11/29/94 + + GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of + GLUT Xlib-based implementation providing GLUT version 2 + interfaces. + + GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 + + GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 + + GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 + + GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 + + GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner + and video resize. 1/3/97 + + GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. + + GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. + + GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. + + GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. + + GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. + + GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa +**/ +#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ +#define GLUT_XLIB_IMPLEMENTATION 15 +#endif + +/* Display mode bit masks. */ +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 +#if (GLUT_API_VERSION >= 2) +#define GLUT_MULTISAMPLE 128 +#define GLUT_STEREO 256 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_LUMINANCE 512 +#endif + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +#if (GLUT_API_VERSION >= 2) +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 +#endif + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Menu usage state. */ +#define GLUT_MENU_NOT_IN_USE 0 +#define GLUT_MENU_IN_USE 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Window status state. */ +#define GLUT_HIDDEN 0 +#define GLUT_FULLY_RETAINED 1 +#define GLUT_PARTIALLY_RETAINED 2 +#define GLUT_FULLY_COVERED 3 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +#if defined(_WIN32) +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) +#endif +#else +/* Stroke font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutStrokeRoman; +GLUTAPI void *glutStrokeMonoRoman; + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN (&glutStrokeRoman) +#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) + +/* Bitmap font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutBitmap9By15; +GLUTAPI void *glutBitmap8By13; +GLUTAPI void *glutBitmapTimesRoman10; +GLUTAPI void *glutBitmapTimesRoman24; +GLUTAPI void *glutBitmapHelvetica10; +GLUTAPI void *glutBitmapHelvetica12; +GLUTAPI void *glutBitmapHelvetica18; + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) +#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) +#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) +#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) +#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) +#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) +#endif +#endif + +/* glutGet parameters. */ +#define GLUT_WINDOW_X ((GLenum) 100) +#define GLUT_WINDOW_Y ((GLenum) 101) +#define GLUT_WINDOW_WIDTH ((GLenum) 102) +#define GLUT_WINDOW_HEIGHT ((GLenum) 103) +#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104) +#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105) +#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106) +#define GLUT_WINDOW_RED_SIZE ((GLenum) 107) +#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108) +#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109) +#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110) +#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111) +#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112) +#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113) +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114) +#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115) +#define GLUT_WINDOW_RGBA ((GLenum) 116) +#define GLUT_WINDOW_PARENT ((GLenum) 117) +#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118) +#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119) +#if (GLUT_API_VERSION >= 2) +#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120) +#define GLUT_WINDOW_STEREO ((GLenum) 121) +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_WINDOW_CURSOR ((GLenum) 122) +#endif +#define GLUT_SCREEN_WIDTH ((GLenum) 200) +#define GLUT_SCREEN_HEIGHT ((GLenum) 201) +#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202) +#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203) +#define GLUT_MENU_NUM_ITEMS ((GLenum) 300) +#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400) +#define GLUT_INIT_WINDOW_X ((GLenum) 500) +#define GLUT_INIT_WINDOW_Y ((GLenum) 501) +#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502) +#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503) +#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504) +#if (GLUT_API_VERSION >= 2) +#define GLUT_ELAPSED_TIME ((GLenum) 700) +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123) +#endif + +#if (GLUT_API_VERSION >= 2) +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD ((GLenum) 600) +#define GLUT_HAS_MOUSE ((GLenum) 601) +#define GLUT_HAS_SPACEBALL ((GLenum) 602) +#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603) +#define GLUT_HAS_TABLET ((GLenum) 604) +#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605) +#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606) +#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607) +#define GLUT_NUM_DIALS ((GLenum) 608) +#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609) +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610) +#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611) +#define GLUT_HAS_JOYSTICK ((GLenum) 612) +#define GLUT_OWNS_JOYSTICK ((GLenum) 613) +#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614) +#define GLUT_JOYSTICK_AXES ((GLenum) 615) +#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616) +#endif + +#if (GLUT_API_VERSION >= 3) +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800) +#define GLUT_LAYER_IN_USE ((GLenum) 801) +#define GLUT_HAS_OVERLAY ((GLenum) 802) +#define GLUT_TRANSPARENT_INDEX ((GLenum) 803) +#define GLUT_NORMAL_DAMAGED ((GLenum) 804) +#define GLUT_OVERLAY_DAMAGED ((GLenum) 805) + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900) +#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901) +#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902) +#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903) +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904) +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905) +#define GLUT_VIDEO_RESIZE_X ((GLenum) 906) +#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907) +#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908) +#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909) +#endif + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL ((GLenum) 0) +#define GLUT_OVERLAY ((GLenum) 1) + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 +#endif + +/* GLUT initialization sub-API. */ +GLUTAPI void APIENTRY glutInit(int *argcp, char **argv); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static void APIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } +#define glutInit glutInit_ATEXIT_HACK +#endif +#endif +GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void APIENTRY glutInitDisplayString(const char *string); +#endif +GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void APIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int APIENTRY glutCreateWindow(const char *title); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK +#endif +#endif +GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void APIENTRY glutDestroyWindow(int win); +GLUTAPI void APIENTRY glutPostRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void APIENTRY glutPostWindowRedisplay(int win); +#endif +GLUTAPI void APIENTRY glutSwapBuffers(void); +GLUTAPI int APIENTRY glutGetWindow(void); +GLUTAPI void APIENTRY glutSetWindow(int win); +GLUTAPI void APIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void APIENTRY glutSetIconTitle(const char *title); +GLUTAPI void APIENTRY glutPositionWindow(int x, int y); +GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void APIENTRY glutPopWindow(void); +GLUTAPI void APIENTRY glutPushWindow(void); +GLUTAPI void APIENTRY glutIconifyWindow(void); +GLUTAPI void APIENTRY glutShowWindow(void); +GLUTAPI void APIENTRY glutHideWindow(void); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void APIENTRY glutFullScreen(void); +GLUTAPI void APIENTRY glutSetCursor(int cursor); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void APIENTRY glutWarpPointer(int x, int y); +#endif + +/* GLUT overlay sub-API. */ +GLUTAPI void APIENTRY glutEstablishOverlay(void); +GLUTAPI void APIENTRY glutRemoveOverlay(void); +GLUTAPI void APIENTRY glutUseLayer(GLenum layer); +GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win); +#endif +GLUTAPI void APIENTRY glutShowOverlay(void); +GLUTAPI void APIENTRY glutHideOverlay(void); +#endif + +/* GLUT menu sub-API. */ +GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int)); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); } +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK +#endif +#endif +GLUTAPI void APIENTRY glutDestroyMenu(int menu); +GLUTAPI int APIENTRY glutGetMenu(void); +GLUTAPI void APIENTRY glutSetMenu(int menu); +GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void APIENTRY glutRemoveMenuItem(int item); +GLUTAPI void APIENTRY glutAttachMenu(int button); +GLUTAPI void APIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height)); +GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value); +GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state)); +#if (GLUT_API_VERSION >= 2) +GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value)); +GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y)); +GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void)); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state)); +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); +#endif +#endif +#endif + +/* GLUT color index sub-API. */ +GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); +GLUTAPI void APIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int APIENTRY glutGet(GLenum type); +GLUTAPI int APIENTRY glutDeviceGet(GLenum type); +#if (GLUT_API_VERSION >= 2) +/* GLUT extension support sub-API */ +GLUTAPI int APIENTRY glutExtensionSupported(const char *name); +#endif +#if (GLUT_API_VERSION >= 3) +GLUTAPI int APIENTRY glutGetModifiers(void); +GLUTAPI int APIENTRY glutLayerGet(GLenum type); +#endif + +/* GLUT font sub-API */ +GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI int APIENTRY glutBitmapLength(void *font, const unsigned char *string); +GLUTAPI int APIENTRY glutStrokeLength(void *font, const unsigned char *string); +#endif + +/* GLUT pre-built models sub-API */ +GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCube(GLdouble size); +GLUTAPI void APIENTRY glutSolidCube(GLdouble size); +GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutWireDodecahedron(void); +GLUTAPI void APIENTRY glutSolidDodecahedron(void); +GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void APIENTRY glutWireOctahedron(void); +GLUTAPI void APIENTRY glutSolidOctahedron(void); +GLUTAPI void APIENTRY glutWireTetrahedron(void); +GLUTAPI void APIENTRY glutSolidTetrahedron(void); +GLUTAPI void APIENTRY glutWireIcosahedron(void); +GLUTAPI void APIENTRY glutSolidIcosahedron(void); + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* GLUT video resize sub-API. */ +GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param); +GLUTAPI void APIENTRY glutSetupVideoResizing(void); +GLUTAPI void APIENTRY glutStopVideoResizing(void); +GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height); +GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height); + +/* GLUT debugging sub-API. */ +GLUTAPI void APIENTRY glutReportErrors(void); +#endif + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +/* GLUT device control sub-API. */ +/* glutSetKeyRepeat modes. */ +#define GLUT_KEY_REPEAT_OFF 0 +#define GLUT_KEY_REPEAT_ON 1 +#define GLUT_KEY_REPEAT_DEFAULT 2 + +/* Joystick button masks. */ +#define GLUT_JOYSTICK_BUTTON_A 1 +#define GLUT_JOYSTICK_BUTTON_B 2 +#define GLUT_JOYSTICK_BUTTON_C 4 +#define GLUT_JOYSTICK_BUTTON_D 8 + +GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore); +GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode); +GLUTAPI void APIENTRY glutForceJoystickFunc(void); + +/* GLUT game mode sub-API. */ +/* glutGameModeGet. */ +#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0) +#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1) +#define GLUT_GAME_MODE_WIDTH ((GLenum) 2) +#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3) +#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4) +#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5) +#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6) + +GLUTAPI void APIENTRY glutGameModeString(const char *string); +GLUTAPI int APIENTRY glutEnterGameMode(void); +GLUTAPI void APIENTRY glutLeaveGameMode(void); +GLUTAPI int APIENTRY glutGameModeGet(GLenum mode); +#endif + +#ifdef __cplusplus +} + +#endif + +#ifdef GLUT_APIENTRY_DEFINED +# undef GLUT_APIENTRY_DEFINED +# undef APIENTRY +#endif + +#ifdef GLUT_WINGDIAPI_DEFINED +# undef GLUT_WINGDIAPI_DEFINED +# undef WINGDIAPI +#endif + +#ifdef GLUT_DEFINED___CDECL +# undef GLUT_DEFINED___CDECL +# undef __cdecl +#endif + +#ifdef GLUT_DEFINED__CRTIMP +# undef GLUT_DEFINED__CRTIMP +# undef _CRTIMP +#endif + +#endif /* __glut_h__ */ diff --git a/thirdparty/glut/3.7.6/lib/glut.def b/thirdparty/glut/3.7.6/lib/glut.def new file mode 100644 index 0000000..d7d0240 --- /dev/null +++ b/thirdparty/glut/3.7.6/lib/glut.def @@ -0,0 +1,126 @@ +DESCRIPTION 'OpenGL Utility Toolkit for Win32' + +VERSION 3.7 + +EXPORTS + + glutAddMenuEntry + glutAddSubMenu + glutAttachMenu + glutBitmapCharacter + glutBitmapLength + glutBitmapWidth + glutButtonBoxFunc + glutChangeToMenuEntry + glutChangeToSubMenu + glutCopyColormap + glutCreateMenu + __glutCreateMenuWithExit + glutCreateSubWindow + glutCreateWindow + __glutCreateWindowWithExit + glutDestroyMenu + glutDestroyWindow + glutDetachMenu + glutDeviceGet + glutDialsFunc + glutDisplayFunc + glutEnterGameMode + glutEntryFunc + glutEstablishOverlay + glutExtensionSupported + glutForceJoystickFunc + glutFullScreen + glutGameModeGet + glutGameModeString + glutGet + glutGetColor + glutGetMenu + glutGetModifiers + glutGetWindow + glutHideOverlay + glutHideWindow + glutIconifyWindow + glutIdleFunc + glutIgnoreKeyRepeat + glutInit + __glutInitWithExit + glutInitDisplayMode + glutInitDisplayString + glutInitWindowPosition + glutInitWindowSize + glutJoystickFunc + glutKeyboardFunc + glutKeyboardUpFunc + glutLayerGet + glutLeaveGameMode + glutMainLoop + glutMenuStateFunc + glutMenuStatusFunc + glutMotionFunc + glutMouseFunc + glutOverlayDisplayFunc + glutPassiveMotionFunc + glutPopWindow + glutPositionWindow + glutPostOverlayRedisplay + glutPostRedisplay + glutPostWindowOverlayRedisplay + glutPostWindowRedisplay + glutPushWindow + glutRemoveMenuItem + glutRemoveOverlay + glutReportErrors + glutReshapeFunc + glutReshapeWindow + glutSetColor + glutSetCursor + glutSetIconTitle + glutSetKeyRepeat + glutSetMenu + glutSetWindow + glutSetWindowTitle + glutSetupVideoResizing + glutShowOverlay + glutShowWindow + glutSolidCone + glutSolidCube + glutSolidDodecahedron + glutSolidIcosahedron + glutSolidOctahedron + glutSolidSphere + glutSolidTeapot + glutSolidTetrahedron + glutSolidTorus + glutSpaceballButtonFunc + glutSpaceballMotionFunc + glutSpaceballRotateFunc + glutSpecialFunc + glutSpecialUpFunc + glutStopVideoResizing + glutStrokeCharacter + glutStrokeLength + glutStrokeWidth + glutSwapBuffers + glutTabletButtonFunc + glutTabletMotionFunc + glutTimerFunc + glutUseLayer + glutVideoPan + glutVideoResize + glutVideoResizeGet + glutVisibilityFunc + glutWarpPointer + glutWindowStatusFunc + glutWireCone + glutWireCube + glutWireDodecahedron + glutWireIcosahedron + glutWireOctahedron + glutWireSphere + glutWireTeapot + glutWireTetrahedron + glutWireTorus +; __glutSetFCB +; __glutGetFCB + diff --git a/thirdparty/glut/3.7.6/lib/glut32.dll b/thirdparty/glut/3.7.6/lib/glut32.dll new file mode 100644 index 0000000..a0c08b2 Binary files /dev/null and b/thirdparty/glut/3.7.6/lib/glut32.dll differ diff --git a/thirdparty/glut/3.7.6/lib/glut32.lib b/thirdparty/glut/3.7.6/lib/glut32.lib new file mode 100644 index 0000000..b93eff8 Binary files /dev/null and b/thirdparty/glut/3.7.6/lib/glut32.lib differ diff --git a/thirdparty/glut/3.7.6/lib/glut64.dll b/thirdparty/glut/3.7.6/lib/glut64.dll new file mode 100644 index 0000000..5df6d98 Binary files /dev/null and b/thirdparty/glut/3.7.6/lib/glut64.dll differ diff --git a/thirdparty/glut/3.7.6/lib/glut64.lib b/thirdparty/glut/3.7.6/lib/glut64.lib new file mode 100644 index 0000000..d5f244d Binary files /dev/null and b/thirdparty/glut/3.7.6/lib/glut64.lib differ diff --git a/thirdparty/libusb/libusb-1.0.9/AUTHORS b/thirdparty/libusb/libusb-1.0.9/AUTHORS new file mode 100644 index 0000000..b43d995 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/AUTHORS @@ -0,0 +1,45 @@ +Copyright (C) 2007-2009 Daniel Drake +Copyright (c) 2001 Johannes Erdfelt +Copyright (C) 2008-2012 Nathan Hjelm +Copyright (C) 2009-2012 Pete Batard +Copyright (C) 2010 Michael Plante +Copyright (C) 2010-2012 Peter Stuge +Copyright (C) 2011-2012 Hans de Goede +Copyright (C) 2012 Martin Pieuchot + +Other contributors: +Alan Ott +Alan Stern +Alex Vatchenko +Artem Egorkine +Aurelien Jarno +Bastien Nocera +Brian Shirley +David Engraf +David Moore +Felipe Balbi +Graeme Gill +Hans de Goede +Hans Ulrich Niedermann +Hector Martin +Hoi-Ho Chan +James Hanko +Konrad Rzepecki +Ludovic Rousseau +Martin Koegler +Martin Pieuchot +Mike Frysinger +Mikhail Gusarov +Orin Eman +Pekka Nikander +Peter Stuge +Rob Walker +Sean McBride +Sebastian Pipping +Stephan Meyer +Thomas Röfer +Toby Peterson +Trygve Laugstøl +Vasily Khoruzhick +Vitali Lovich +Xiaofan Chen diff --git a/thirdparty/libusb/libusb-1.0.9/COPYING b/thirdparty/libusb/libusb-1.0.9/COPYING new file mode 100644 index 0000000..5ab7695 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/thirdparty/libusb/libusb-1.0.9/ChangeLog b/thirdparty/libusb/libusb-1.0.9/ChangeLog new file mode 100644 index 0000000..298a7b2 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/ChangeLog @@ -0,0 +1,4377 @@ +commit ab9cd5a7be637f7b793987971a706b1d11c27ded +Author: Peter Stuge +Date: Fri Apr 20 08:10:11 2012 +0200 + + libusb-1.0.9 + +commit 696400ad83531bcf944c71164a46f9ccb6a33df3 +Author: Peter Stuge +Date: Fri Apr 20 08:08:34 2012 +0200 + + AUTHORS: Update list of contributors + +commit 19f94537ea55586dd85f8d627fcfaa6173069ea1 +Author: Peter Stuge +Date: Fri Apr 20 06:41:34 2012 +0200 + + AUTHORS: Add Martin Pieuchot as copyright holder + +commit 1a1c633d7912a2565f6af0c9294e10a759d40e05 +Author: Peter Stuge +Date: Fri Apr 20 06:41:12 2012 +0200 + + AUTHORS: Add Hans de Goede as copyright holder + +commit 9477f793341d59cc861acb283e6cb03b5730ac91 +Author: Peter Stuge +Date: Fri Apr 20 06:40:45 2012 +0200 + + AUTHORS: Add Peter Stuge as copyright holder + +commit 4b0dfe9770356af3c51103a9b3d63c5f8cc63d8b +Author: Pete Batard +Date: Mon Apr 2 15:47:53 2012 +0100 + + AUTHORS: Update Pete Batard's copyright years and email address + + libusbx.git commit f98eaca0985364be00fcfde3fd3884075092a4e9 + + [stuge: Remove unrelated changes] + +commit 9f0ea78357b7b1654cb3e7de6ff57f5f378b68f1 +Author: Peter Stuge +Date: Fri Apr 20 08:35:04 2012 +0200 + + AUTHORS: Update Nathan Hjelm's copyright years + +commit 8d38506ebc9fb57a40113e5a7739572a42b826d8 +Author: Peter Stuge +Date: Fri Apr 20 06:36:08 2012 +0200 + + README: Add the BSDs, punctuation, mailinglist link, and remove Daniel + +commit 05cbe2de45806db309343cdf298d8569c55863e5 +Author: James Hanko +Date: Wed Oct 19 17:32:34 2011 -0700 + + Linux: Search for /dev/usbdev. USB device special files + + If neither the (now deprecated) usbfs filesystem nor udev is available + then libusb searches for device nodes also in /dev where they may be + created if the kernel was built with the option CONFIG_USB_DEVICE_CLASS. + This helps on embedded systems such as Android, and all mdev users. + + Fixes #119. + +commit a806d169e6b5f675289cb9307fcd6b908edd9219 +Author: Peter Stuge +Date: Fri Apr 20 04:32:47 2012 +0200 + + Add a timestamp in log messages + + Fixes #34. + +commit 03f4d40c748506c85f88427dd53afd5c663a2929 +Author: Peter Stuge +Date: Fri Apr 20 02:24:44 2012 +0200 + + Include library version in the very first libusb_init() debug message + +commit 84d5eafd1f24a1c6f77f0c2a2ad40e1fbfdea381 +Author: Martin Pieuchot +Date: Thu Apr 19 13:33:36 2012 +0200 + + OpenBSD: Provide libusb_get_device_speed() data + + Because the different speed values used by the libusb and OpenBSD's + usb_device_info structure are compatible, keep the code simple and + just copy the value returned by the USB_GET_DEVICEINFO ioctl() call. + + Fixes #45. + +commit c145ec09732fac2eef53accc07314040d22b64a5 +Author: Peter Stuge +Date: Fri Apr 20 00:11:01 2012 +0200 + + doc/Makefile.am: Remove username from SF web rsync upload command + + Commit c407a2d97b6f8715d3452257a0adac40a20178e6 did it for tarballs. + + libusbx.git commit ca159f15737e9097a4d031c9950f281c42af040a + +commit 6506013c6d4face34cfec79dd0584e9f528cbc6a +Author: Pete Batard +Date: Tue Apr 10 13:30:24 2012 +0100 + + Windows: Remove #define compile time options in the backend source code + + * The DYNAMIC_FDS, AUTO_CLAIM and FORCE_INSTANT_TIMEOUTS options + were introduced for development/testing and don't appear to be + used by the Windows backend users => remove them. + + libusbx.git commit 4cccbed825fe1dc138121640a6497d7d05aac159 + +commit e291e369b975692dfa1a0f029244af597fa61220 +Author: Pete Batard +Date: Tue Apr 10 13:05:37 2012 +0100 + + Windows: Warn on one libusb_get_device_list() memory allocation failure + + libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b + +commit 2f40a03ea0552cd8b5ce3d7667b20dc04da061da +Author: Pete Batard +Date: Tue Apr 10 13:05:37 2012 +0100 + + Windows: Add textual error name to debug message on auto-release errors + + libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b + +commit 3c7f85a49b42ac36c6d41294858518c554ac4694 +Author: Pete Batard +Date: Tue Apr 10 13:05:37 2012 +0100 + + Windows: Silence warning about unused function guid_to_string() + + Commit 6b1982b1bd321b55698ce537e64648e8aec85f6f removed the #ifdef + around guid_to_string() but this ended up causing a warning when + the function wasn't being called. Add it back with correct _MSC_VER. + + libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b + + [stuge: Rewrite commit message for libusb.git] + +commit eb55963a6b33799ea76c34f538f21e86f235ea62 +Author: Pete Batard +Date: Tue Apr 10 13:05:37 2012 +0100 + + Windows: Base DUMMY_HANDLE on LONG_PTR instead of LONG + + libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b + +commit d930865987de523061eca259a7fed11aea626831 +Author: Pete Batard +Date: Tue Apr 10 13:05:37 2012 +0100 + + Windows: Prefer calloc() over malloc() and cast all allocations + + This silences VS2010 intellisense warnings on memory allocation. + + libusbx.git commit 24d595aa71e7fd0f14d40e933a33f852f7269c8b + +commit df35117ce58b74fa530baaaccc30adaf432398ea +Author: Peter Stuge +Date: Thu Apr 19 22:55:44 2012 +0200 + + Add libusb_get_version() API function + + Let's see how this will be used. Fixes #53. + + libusbx.git commit 37dfd16c8c2f36c81c86de303072def0dc405e32 + + [stuge: Remove unrelated changes] + [stuge: Add struct libusb_version member rc for release candidate suffix] + [stuge: Add struct libusb_version member describe for git describe output] + +commit 29d5f63c5765f36ea65b55c4cd5f36e1f10a4dae +Author: Peter Stuge +Date: Thu Apr 19 22:25:07 2012 +0200 + + Windows: Rename VS2005 solution and add VS2010 project files + + libusbx.git commit fcad0941e52eb2fd6d57d3327f420db14dfabf0b + + [stuge: Remove xusb references] + [stuge: Add newlines at end of new files] + [stuge: Rename libusb_20??.sln to libusb_vs20??.sln] + +commit b217ec1f904c4382010a3a834a7c58d595b594cf +Author: Pete Batard +Date: Sat Mar 31 22:32:56 2012 +0100 + + libusb/Makefile.am: Fix missing DLL .def file from make dist + + libusbx.git commit 10dc1ea9a799b13b7423968130da812aa97289bf + + [stuge: Use EXTRA_DIST in libusb/Makefile.am instead] + +commit 54cb51d8417e0128eb9088bf628db138c9daa2a0 +Author: Pete Batard +Date: Sat Mar 31 22:14:47 2012 +0100 + + Makefile.am: Fix msvc dir not being included in make dist + + libusbx.git commit a8a80b60a14e3a8269e42dedf34fda66da8e0e50 + +commit 38d5ba472c6cb728ec818a0c8d964b632c8a7992 +Author: Hans de Goede +Date: Fri Mar 30 13:40:32 2012 +0100 + + Linux: Don't spam the console with 'device unconfigured' errors + + libusbx.git commit 3c968be61befc47d33562843e5479ff67303b0c4 + +commit 93f14087b2e79d71ba1e53c0b9c7da655dd1258e +Author: Nathan Hjelm +Date: Thu Apr 19 05:52:58 2012 -0600 + + Darwin: Silence warning: cast from pointer to integer of different size + + As per http://marc.info/?m=133483651109899 + + Reported-by: Xiaofan Chen + +commit 0efc2086646200d8dee86cbbb1e98136383a05c3 +Author: Pete Batard +Date: Thu Mar 29 23:21:25 2012 +0100 + + .gitattributes: Add export-ignore for .gitattributs and .gitignore + + This keeps the git files out of archives created by gitweb. + + libusbx.git commit 2250152b251243f75c951533ae7b1139a785cfe6 + + [stuge: Removed unrelated whitespace changes] + +commit a7ef55c02f0116b94cb75831e5d90ad258c662f8 +Author: Pete Batard +Date: Wed Mar 28 01:02:02 2012 +0100 + + Windows: fix Clang warnings about unused assignations + + libusbx.git commit c0e7b289fdb35687b90263b14426319d2b96b132 + +commit ac8eed67e1595ee5a069623e48362d8a85dcb252 +Author: Pete Batard +Date: Mon Mar 26 23:34:25 2012 +0100 + + configure.ac: LT_LANG([Windows Resource]) makes windres check redundant + + libusbx.git commit 4f9fd6a29a712b0e3312983e9ff153e6d7ed0822 + +commit 89ce6f7d05dc8ff4a441a01b192d2e20857f6c48 +Author: Pete Batard +Date: Tue Mar 27 00:03:07 2012 +0100 + + Windows: Bring .vcproj x86_64 output directories in line with x86_32 + + libusbx.git commit abdb4437ea1897226076fa706651e350dba1cfd5 + +commit 77743c6f5b3cfa2d06dcb32204bc65d8bd4fec80 +Author: Hans de Goede +Date: Fri Mar 9 11:31:11 2012 +0100 + + Linux: Fix a comment in handle_iso_completion() + + Fix the comment at the end of handle_iso_completion, we don't stop on + urbs / isoc packets with less data then requested, which is a good + thing since it is a normal condition for isoc transfers. + + Signed-off-by: Hans de Goede + +commit 5b87c2c7475a8d68270e19336afec0c5a08579ca +Author: Hans de Goede +Date: Fri Mar 9 11:31:10 2012 +0100 + + Linux: Remove bogus status handling from handle_iso_completion() + + Remove a useless check+set of status because: + 1. The check is always true; and + 2. The new value is never used + + Signed-off-by: Hans de Goede + +commit e23d8f67eab947e5d41216e0139f0a50d1342ef8 +Author: Hans de Goede +Date: Fri Mar 9 11:31:09 2012 +0100 + + Linux: Translate isoc packet status codes to LIBUSB_TRANSFER_ codes + + During testing of my usbredir code I hit a scenario where my libusb + app was seeing EXDEV as status in the transfer's iso_packet_desc. + + This happened because we didn't translate linux negative errno errors + in each isoc packet's status to LIBUSB_TRANSFER_ status codes! This + patch adds these translations. + + Signed-off-by: Hans de Goede + +commit 7199bc2c9c351b553b6175a588237ee793719281 +Author: Hans de Goede +Date: Fri Mar 9 11:31:08 2012 +0100 + + Linux: Fix URB return code handling + + During testing of my usbredir code I hit a case where EOVERFLOW was not + handled in handle_control_completion(). Instead of just fixing this one + case I've audited (and fixed where necessary) all handle_foo_completion() + functions to know about all errors documented in + linux/Documentation/usb/error-codes.txt. + + Note that for handle_iso_completion() this patch actually removes the + handling of some codes, since these can never occur on an iso urb (they + can only occur on the iso packets included in the urb, see the next patch + in this series). Also, in case an unknown status is encountered on an iso + urb this patch sets the urb's status to ERROR rather then leaving it at + completed. + + Signed-off-by: Hans de Goede + +commit 98bc7b8d125c2756deadfc889dcefd4e6f2fcd02 +Author: Hans de Goede +Date: Fri Mar 9 11:31:07 2012 +0100 + + Don't print an error when libusb_cancel_transfer() fails with NOT_FOUND + + As stated in the documentation for libusb_cancel_transfer(), + LIBUSB_ERROR_NOT_FOUND is an expected return value for + libusb_cancel_transfer() under certain circumstances, so + printing an error every time this happens is undesirable. + + Even more so because under Linux IOCTL_USBFS_DISCARDURB sets errno + to EINVAL when the kernel can't not find the urb in the kernel's + urbs-in-flight list, which means that the urb has already completed + at the host controller level but it has not necessarily been reaped + yet. IOW under Linux libusb_cancel_transfer() may yield a result of + LIBUSB_ERROR_NOT_FOUND *before* the transfer's callback has been + called! In conclusion there is no way for applications to avoid + calling libusb_cancel_transfer() on already completed transfers, + and these errors can and do happen frequently for some USB traffic. + + Signed-off-by: Hans de Goede + +commit 4db8275da59996eb1c22d2e9e9c527fa58b288ad +Author: Hans de Goede +Date: Fri Mar 9 11:31:06 2012 +0100 + + Linux: Fix cancel_transfer return value when cancelling a multi-urb transfer + + If we fail to cancel the last urb of a multi-urb transfer because it + has already completed (errno == EINVAL on DISCARD_URB), then the entire + transfer has already completed, so returning NOT_FOUND is consistent + with what the documentation for libusb_cancel_transfer() says. + + But if we've successfully cancelled the last urb, and then another urb + fails with errno == EINVAL, this means that we've still cancelled the + transfer, as it has only *partially* completed. + + Signed-off-by: Hans de Goede + +commit b22253ba9cbd399299b534a8c5e3bbac3f240963 +Author: Peter Stuge +Date: Thu Apr 19 04:05:29 2012 +0200 + + libusb-1.0.pc: Mention OpenBSD and NetBSD in description + +commit 6aa0fc60d94e3123de230d3fbc9196814c0e466e +Author: Peter Stuge +Date: Mon Apr 16 05:59:44 2012 +0200 + + io.c: Add debug message with the callback address on completed transfer + +commit de41604560a57b2279ac1d0a10b8192a9224d284 +Author: Xiaofan Chen +Date: Sun Apr 15 11:50:27 2012 +0800 + + Experimental support for NetBSD using the OpenBSD backend + + Signed-off-by: Xiaofan Chen + +commit 404054cb508881c9bd6bc575b66c4f509046b4af +Author: Peter Stuge +Date: Thu Apr 19 00:41:45 2012 +0200 + + configure.ac: Separate per-OS backend selection from per-backend settings + +commit 2eba7e4197cf9afa77451186e1a116ee3ae91adc +Author: Xiaofan Chen +Date: Sun Apr 15 07:17:18 2012 +0800 + + Linux: Silence unused variable warnings when without CLOCK_MONOTONIC + + Signed-off-by: Xiaofan Chen + +commit bc790a9c414871cc1d33f1c7686048434a700e45 +Author: Peter Stuge +Date: Sat Apr 7 05:20:36 2012 +0200 + + examples: Use snprintf() instead of sprintf() in dpfp and dpfp_threaded + + The OpenBSD C compiler generates a warning for every use of sprintf() + and for a good reason. Reported in http://marc.info/?m=133376187514495 + + Reported-by: Xiaofan Chen + +commit bffa232dca51bcc41df71c5735fa56370b7509ad +Author: Peter Stuge +Date: Sat Apr 7 03:55:36 2012 +0200 + + OpenBSD: Fix warning: 'hpriv' may be used uninitialized + + As reported in http://marc.info/?m=133376187514495 + + The variable would be used uninitialized when the internal list of + open devices is empty as obsd_handle_events() checks which device + the event fd belongs to, which can not actually happen, but if it + ever does happen then we will now return LIBUSB_ERROR_NO_DEVICE. + + Reported-by: Xiaofan Chen + +commit 6b1982b1bd321b55698ce537e64648e8aec85f6f +Author: Moses McKnight +Date: Fri Mar 30 21:53:20 2012 -0500 + + Windows: Fix build on VC++2003 which doesn't support variadic macros + + Change _MSC_VER tests to check for >= 1400 instead of > 1200 because + Visual C++ did not support variadic macros until VC++2005, as per + http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx + + Since usbi_dbg() is a function and not a macro with the old MS C + compilers the functions guid_to_string() and windows_error_str() + need to be compiled unconditionally, and the compiler should remove + the dead code when debug logging is disabled on newer compilers. + +commit 58ac0355e547080c82d02685a32480b891383d3d +Author: Peter Stuge +Date: Sat Mar 31 03:44:40 2012 +0200 + + Windows: Don't use a log function body macro for old MS compilers + + The duplication is a lot more straightforward than the previous LOG_BODY + macro, which also didn't handle the special debug case correctly. The + duplicated code is fortunately not very long. + +commit 76af4c99bd6122c1dd7b58858b669c919d8c8806 +Author: Peter Stuge +Date: Thu Mar 22 01:52:59 2012 +0100 + + libusbi.h: Add IS_EPIN() IS_EPOUT() IS_XFERIN() and IS_XFEROUT() macros + + The macros make backend code a little simpler to read, since the + transfer and endpoint direction is checked in several places across + the supported platforms. + +commit e3d0a4cb9e2f9872c9fdbb22d7ded169e111fc8f +Author: Peter Stuge +Date: Wed Feb 22 14:21:54 2012 +0100 + + Add LIBUSB_TRANSFER_ADD_ZERO_PACKET flag to indicate need for ZLP + + Some protocols which use USB require an extra zero length data packet + to signal end-of-transfer on bulk endpoints, if the last data packet + is exactly wMaxPacketSize bytes long. + + This flag allows applications to inform libusb about this requirement, + so that libusb can handle the issue transparently. + + At the moment the new flag is only supported on Linux, and submitting + a transfer with the flag set returns an error at submit time on other + systems. Hopefully implementations will soon follow for other systems. + + References #6. + +commit 7e0c747cc5ed0a31f38dff5eb5f03d4043b05ada +Author: Peter Stuge +Date: Sun Feb 19 06:58:16 2012 +0100 + + libusb.h: Add comma after last value in enums to ease future expansion + +commit c20ec7a927c05e0b960269751c26ab2b6e0b39ab +Author: Peter Stuge +Date: Sun Feb 19 05:39:33 2012 +0100 + + Linux: Rework bulk continuation check to generic kernel version check + + The old check_flag_bulk_continuation() tested for one specific running + kernel version. The new kernel_version_ge() instead allows to test the + running kernel version against major, minor and sublevel parameters. + +commit cf8f5a7be821099b143fcea8e4ba553daa22818b +Author: Peter Stuge +Date: Sun Feb 19 05:32:10 2012 +0100 + + OpenBSD: Correctly catch attempts to do isochronous OUT transfers + + LIBUSB_ENDPOINT_OUT is the value of the direction bit, which is 0 for + OUT transfers, so the previous condition could never evaluate to true. + +commit ae8e86cffb81858af5eeddbf2ea1aec6d55f573d +Author: Peter Stuge +Date: Sun Feb 19 00:42:20 2012 +0100 + + Darwin: Do not reject devices with product id 0x0000 + + Fixes #128. + +commit 4630fc22cff8ad3e1afa9b223378c0aabe282b5c +Author: Peter Stuge +Date: Mon Feb 13 16:59:51 2012 +0100 + + Do not call timerfd functions when timerfd is not being used + + When libusb was built with timerfd support but used on a system + without timerfd support the library would hang indefinitely on + completion of the first transfer, since timerfd functions were + being called unconditionally and the error returned when timerfd + was not being used caused a confused internal state. + + Many thanks to Ivo Smits for looking into the issue, proposing + an initial solution, and helping with testing! Fixes #73. + +commit c40f3df1efbb9232b525e5f675746762ca2304b8 +Author: Michael Plante +Date: Sun Feb 12 13:49:35 2012 -0500 + + Windows: Fix MSVC6 IDE warning on line continuation in libusb-1.0.rc + + * libusb\libusb-1.0.rc(21): Could not find the file LIBUSB_RC. + * only shows up first time after opening workspace. + * shows up on either build or clean. + * not actually due to rc.exe, but prior to it. + * probably an IDE bug. + * does not show up when running an exported makefile. + + Signed-off-by: Michael Plante + +commit 5526841023101bafa280755c3bd19fc44b9c32a0 +Author: Pete Batard +Date: Sat Jan 7 23:30:23 2012 +0000 + + Windows: Add Renesas SuperSpeed support for libusb_get_device_speed() + + * tests conducted using a Renesas PCIE USB 3.0 controller and driver and + a mass storage USB 3.0 confirm that USB_NODE_CONNECTION_INFORMATION_EX + uses (undocumented) value 3 for SuperSpeed + +commit 3df437680f8f5406795ec5f32d96612d327b2ca4 +Author: Peter Stuge +Date: Fri Feb 10 18:06:43 2012 +0100 + + autogen.sh: Try to use libtoolize before trying glibtoolize + + This helps on Mac OS X where an old glibtoolize is included in the + system and newer, manually installed, versions provide libtoolize. + + See also http://marc.info/?m=132490560131894 + +commit 4afbc78fe09bfc3dd7a609e5f82e9272c9e6226d +Author: Peter Stuge +Date: Wed Feb 8 15:54:21 2012 +0100 + + Rename the lsusb example program to listdevs + + This is intended to reduce confusion with the much more significant + lsusb utility which is part of the usbutils package. + +commit 57ab55159298b7057e0dd9b3854f7fd1550588ed +Author: Sean McBride +Date: Fri Dec 9 13:44:21 2011 -0500 + + core.c: Fix clang warning about useless store to a variable + +commit 32bbbd133e24c24d02646c0f7d1963404d4955f2 +Author: Sean McBride +Date: Fri Dec 9 13:43:46 2011 -0500 + + Darwin: Clarify comments on event thread creation and termination + +commit 6cf3285a4e0dfaec0fe53b8eb6a9281e3c5bcb6c +Author: Sean McBride +Date: Fri Dec 9 13:43:46 2011 -0500 + + Darwin: Fix incorrect mutex protection of libusb_darwin_acfl global + +commit 662ced422cf1ffce68753296a81dccf87f3a1c57 +Author: Sean McBride +Date: Fri Dec 9 13:43:46 2011 -0500 + + Darwin: Use retained runloop variable instead of CFRunLoopGetCurrent() + +commit 952a9bb6116afc69c4bae4714c2eb0713bf62a6d +Author: Sean McBride +Date: Fri Dec 9 13:37:22 2011 -0500 + + Darwin: Fix libusb_init() and libusb_exit() refcount race condition + + Use OSAtomicIncrement32Barrier() and OSAtomicDecrement32Barrier() + in darwin_init() and darwin_exit() to be thread safe. + +commit 721cc1c19fc8e88c4482ab3d1e8a34fa100c403c +Author: Sean McBride +Date: Fri Dec 9 13:33:28 2011 -0500 + + threads_posix.c: Fix prototype warning by including threads_posix.h + +commit f6ef0fca4b36657c1a0885c18cc4c4afcb4f7339 +Author: Dave Camarillo +Date: Fri Sep 23 11:56:58 2011 +0100 + + Windows: Fix crash during enumeration with >= 64 connected devices + + * indexes were outgrowing the unref_list array before realloc, + resulting in out of bound access and crash. + +commit e280760331e8b39ad3530235653644654166b322 +Author: Pete Batard +Date: Tue Oct 26 16:31:13 2010 +0100 + + Windows MSVC6: Remove SetupAPI, AdvAPI32 and OLE32 dependencies + + * this ensures that libusb dependent applications only need + to link with libusb on Windows + * (copied from Pete's msvc08 mods to msvc6 by Michael) + +commit fa66c93253855c9146011a6854d65df6d390039f +Author: Pete Batard +Date: Tue Dec 13 21:18:10 2011 -0500 + + Windows: Output an error message on calls to libusb_get_pollfds() + + Signed-off-by: Michael Plante + +commit 637145ed29ee7c7b13ac45d10cf1f798fc06cbd9 +Author: Pete Batard +Date: Thu Jun 3 22:14:20 2010 -0500 + + io.c: Fix comment since pthreads isn't the only threading libusb uses + +commit bb37939ab44a54a054f73e2f381808b12fb9cb33 +Author: Michael Plante +Date: Mon Aug 2 19:59:12 2010 -0500 + + libusb.h: Cast in libusb_get_string_descriptor() to avoid MSVC6 warning + + On MSVC6 bitwise OR promotes to int, causing the warning. + +commit ca09754471acba9a22fe8fc09170e5660d1d5c5d +Author: Michael Plante +Date: Fri Dec 23 16:50:21 2011 -0600 + + Windows: guid_to_string() is only discarded when macro-usbi_dbg used + + * usbi_dbg encloses all references to guid_to_string + * MinGW/cygwin warn about an unused function, so the #if + squelches this warning + * MSVC6 uses a variadic function form of usbi_dbg instead + of a macro, so the compiler still "sees" guid_to_string + and it therefore needs to always be defined for MSVC6, + even if it's only a stub. + * So we define it if usbi_dbg is used OR if MSVC6 is used. + + Signed-off-by: Michael Plante + +commit 8e15adcb0089882d10269ab77d35e193770ab90e +Author: Pete Batard +Date: Tue Nov 15 01:11:12 2011 +0000 + + Windows: Fix undefined datatype 'LONG_PTR' in MSVC6 + + * issue reported by Elmi + + Signed-off-by: Michael Plante + +commit 17ad642cae618cc09c5516612fa3880d4b6b8635 +Author: Pete Batard +Date: Sun Nov 13 23:10:15 2011 +0000 + + Windows: Fix for MSVC6 preprocessor not accepting blank parameters + + * unlike later iterations of Visual Studio, MSVC6 does not accept + blank parameters on macro calls [eg. CALL(a, ,b)] + * blank params were used with the DLL_DECLARE and DLL_LOAD macros + * issue reported by Elmi + +commit c591a7cbf7dbc6fbb4368e65cf58a8cd02582aeb +Author: Michael Plante +Date: Tue Oct 26 11:39:38 2010 +0100 + + Windows: Switch MSVC6 .dsp project files from MBCS to Unicode + + * MBCS (which is different from UTF-8) only makes sense if + supporting Windows 95/98, which we don't + * (try to match Pete's vcproj changes in MSVC6) + +commit 536e424fd7d057fc3f20f9939f9de4572e51c815 +Author: Michael Plante +Date: Tue Dec 13 21:39:40 2011 -0500 + + Windows: Add missing MSVC6 lsusb.dsp project file + + Signed-off-by: Michael Plante + +commit c56828857eb7ba6fb4f7701693dbb3fe4e75d5f6 +Author: Martin Pieuchot +Date: Mon Jan 30 09:59:30 2012 +0100 + + OpenBSD backend + +commit d2285744c7fa4007bb411be354268209d350b0f2 +Author: Xiaofan Chen +Date: Fri Jan 13 18:07:34 2012 +0100 + + configure.ac: Darwin: Move -lobjc from LIBS to PC_LIBS_PRIVATE + + Since commit 40327cd134718475f6cec8935b856d4fdff2099c it is neccessary + to explicitly include -lobjc not only when linking libusb itself, but + also for programs linking statically against libusb. References #63. + + See also http://marc.info/?m=132505900202378 + +commit 93b0e09d53ed1d177631af9182378492481a790a +Author: Xiaofan Chen +Date: Fri Jan 13 13:04:00 2012 +0100 + + examples: Link only with ../libusb/libusb-1.0.la and not with -lusb-1.0 + + Previous _LDFLAGS included both the freshly built libusb in ../libusb + and -lusb-1.0, where libtool would usually resolve the latter to an + already-installed libusb library in the system. The extra reference + to a second libusb library resulted in failure to build examples on + Mac OS X in some cases, and is plain wrong. + + See also the thread at http://marc.info/?m=132637593623667 + +commit cdc5df8f1b206a7c19bc221e8a9a97d5d98deb85 +Author: Peter Stuge +Date: Thu Jan 12 10:34:55 2012 +0100 + + libusb/Makefile.am: Avoid recursive variables in .rc silent-rule + + Not every make supports recursive variable expansion so some automake + versions complain about non-POSIX variable names ever since commit + 70bec4a9f8ec28d36c731011fa24d37c74ad3523 which added support for + silent-rules in our rule to compile the Windows .rc file. + + This commit removes the recursive variables and instead uses the + simple and generic GEN message and associated variable. + +commit a8e2e7cab278fbfcba91909eaf762cf66da9eda5 +Author: Ludovic Rousseau +Date: Sat Sep 24 18:27:54 2011 +0200 + + Core: Fix #122 warning: no previous prototype for ‘usbi_log_v’ + + Declare the usbi_log_v() function before using it. + +commit e88ecb1e65604c222f82da586bb9e9066d66fbba +Author: Sean McBride +Date: Fri Oct 14 14:40:29 2011 -0400 + + Darwin: Set a name for the background thread on Mac OS X 10.6 and later + + The call to pthread_setname_np() makes it easy to identify the + background thread in the Xcode debugger and in crash reports. + +commit 60bad550dcb31a315a667a6614c52f712c82f45f +Author: Peter Stuge +Date: Thu Sep 22 21:42:35 2011 +0200 + + libusb/Makefile.am: Add libusb-1.0.rc dependency on version.h + +commit 70bec4a9f8ec28d36c731011fa24d37c74ad3523 +Author: Peter Stuge +Date: Thu Sep 22 21:38:29 2011 +0200 + + libusb/Makefile.am: Make the libusb-1.0.rc rule support silent-rules + +commit fa9b682a638e54a4556ef6bd343ef56d6300a520 +Author: Peter Stuge +Date: Thu Sep 22 21:17:37 2011 +0200 + + configure.ac: Enable libtool support for Windows Resource language + +commit 58c73ddca310f757fc7ca75197bf3d7ca58ce29a +Author: Sean McBride +Date: Mon Sep 19 12:52:44 2011 -0400 + + descriptor.c: Use size_t for minor 64 bit compliance improvement + + Fixes #121. + +commit 27ec326a9f1bff4481702b35f39897c65a5db586 +Author: Sean McBride +Date: Mon Sep 19 12:42:33 2011 -0400 + + Darwin: Fix warnings about mismatched signed/unsigned compare + + References #121. + +commit 59cc79f2c8e5da41fe2c761bf1e1d9cd18ddac81 +Author: Sean McBride +Date: Mon Sep 19 12:38:20 2011 -0400 + + Fix unused variable warnings when without timerfd and/or when on Darwin + + References #121. + +commit 1cc5b4a9fb984e83681ae5c797fa6b22bc20f809 +Author: Ludovic Rousseau +Date: Fri Sep 16 18:07:56 2011 +0200 + + Correctly handle LIBUSB_TRANSFER_OVERFLOW in libusb_control_transfer() + + sync.c: In function `libusb_control_transfer': + sync.c:122: warning: enumeration value `LIBUSB_TRANSFER_OVERFLOW' not + handled in switch + + Fixes #120. + +commit c55f581f43885f8576d8e2ebf4d46cd7ff3c1030 +Author: Pete Batard +Date: Mon Sep 19 16:01:37 2011 +0100 + + Windows: do not set altsetting 0 as part of libusb_release_interface() + + * pointed out by Travis Robinson and Xiaofan Chen + * similar to a change advised by Alan Stern for the Linux kernel: + http://marc.info/?m=122790204410765 + +commit efd3fae8f95ef7797ecd4b5731b198f100007d6a +Author: Pete Batard +Date: Mon Sep 19 15:45:35 2011 +0100 + + Windows: fix communication with hubs + + * issue reported by René Haunstrup in http://marc.info/?m=130503019227814 + +commit a8d1eb7963e5811e16e8fb7e157cf3a00d888347 +Author: Pete Batard +Date: Mon Sep 19 15:41:39 2011 +0100 + + Windows: add USB 3.0 controller support + + * Windows 8, NEC/Renesas, TI, Fresco Logic, Etron, VIA, ASMedia + (some of which untested!) + * includes workaround for NEC/Renesas USB 3.0 root hubs + +commit 48a19497bdd14325738ac9197d8cf4ebe1daa2d4 +Author: Pete Batard +Date: Mon Sep 19 15:28:03 2011 +0100 + + Windows: add static keywords and drop duplicated or unneeded code + +commit af407286ba2fd346755297e56e365d84b98090d5 +Author: Pete Batard +Date: Mon Sep 19 13:59:46 2011 +0100 + + Windows: fix 'windows_error_str' defined but not used when not logging + +commit abc3143ba1989a48f62246c2afb0eb4c3c5f7917 +Author: Peter Stuge +Date: Thu Sep 22 10:19:17 2011 +0200 + + libusbi.h: Silence unused context variable warnings when not logging + +commit 69b71c896a153a307360cf21be67b3b6e1e09a2d +Author: Pete Batard +Date: Mon Sep 19 13:06:22 2011 +0100 + + Windows: copy DLL file regardless of ddk_build.cmd dll argument case + +commit fdbac8971212bda3a42feeeaeb92fd8e49c7e904 +Author: Pete Batard +Date: Sun Sep 18 20:06:45 2011 +0100 + + Windows: Add uint32_t typedef for old MSC so that DDK can build lsusb + +commit c471d55e909d84012f065715703dad454d1fa421 +Author: Vitali Lovich +Date: Fri Sep 16 08:53:25 2011 -0600 + + Darwin: fix port leak in darwin_clock_gettime() + +commit 477f3917f8c123e36993f9c0ba8156ca0f16ccfa +Author: Vitali Lovich +Date: Fri Sep 16 08:50:40 2011 -0600 + + Darwin: remove unnecessary run loop invalidation during libusb_exit() + +commit f52094f37ccaff8137f5ce39867d2dba9b0f6bf9 +Author: Vitali Lovich +Date: Fri Sep 16 08:49:54 2011 -0600 + + Darwin: fix port leak during libusb_exit() + +commit 8a2f7b5c0520e6099f2c624cd0994c60867c1628 +Author: Vitali Lovich +Date: Fri Sep 16 08:48:28 2011 -0600 + + Darwin: fix potential leak on libusb_claim_interface() error + +commit b1ee2ef8d0b67dcc51c15742cb2decb386cffd9b +Author: Nathan Hjelm +Date: Fri Sep 16 08:41:01 2011 -0600 + + Darwin: Fix #117 transfer size 64/32 bit issue for transfer callbacks + + The transfer size is now always truncated to 32 bits. + +commit c407a2d97b6f8715d3452257a0adac40a20178e6 +Author: Peter Stuge +Date: Thu Sep 15 17:04:43 2011 +0200 + + Remove username from SF FRS rsync upload command + +commit cbc2d7b2de58cf5fb02d9e5a39be0870527f8632 +Author: Peter Stuge +Date: Thu Sep 15 16:48:35 2011 +0200 + + Support release candidate versions in configure.ac and libusb-1.0.rc + +commit 384a528ed7adde935681313dacc5cd79e4be9ea1 +Author: Peter Stuge +Date: Thu Sep 15 16:32:47 2011 +0200 + + Tidy .gitignore a little + + There's no xusb, we need a glob pattern for matching .exe files, and + fpusb tarballs aren't very common in the libusb source dir. + +commit 9ad3643391a7fc6ce97aa77ffaf97d244fd9e613 +Author: Hans de Goede +Date: Wed Sep 14 10:53:48 2011 +0200 + + Docs: Clarify that libusb_handle_events_timeout() tv param can't be NULL + + The example code and API doc for libusb_handle_events_timeout() could be + interpreted as it being OK to pass a NULL pointer for the tv argument (I + interpreted it like that when I first started coding for libusb). + + This patch changes the docs to make it clear that one must always supply + a tv struct to libusb_handle_events_timeout. + + Signed-off-by: Hans de Goede + +commit e1c06fb070c1328a3b78c7da8b9e779d466edd97 +Author: Peter Stuge +Date: Wed Sep 14 08:23:43 2011 +0200 + + Makefile.am: Do not remove ChangeLog on make distclean, fixes #116 + + [pbatard: Remove it on make maintainer-clean instead] + +commit 0c5bf03eb829e51dcf19562fc4f745937235ea51 +Author: Vitali Lovich +Date: Wed Sep 14 07:02:06 2011 +0200 + + Darwin: Reduce race likelihood between cancellation and device disconnect + + References #88. The race condition still remains, but this change + makes it less likely to trigger. + +commit 3e6e257f55156c4600f3116a0befba8cee62872a +Author: Peter Stuge +Date: Wed Sep 14 04:00:33 2011 +0200 + + Document that libusb_get_device_list() can return any libusb_error code + + Fixes #87. + +commit 737ba04ea40f19564b445fbb489907529e75edc9 +Author: Pete Batard +Date: Thu Jun 16 10:49:13 2011 +0100 + + Linux: Fix #81 URB double free race condition on device disconnect + + A submitted transfer that has just been failed by the kernel could be + picked up by an event handler to be cleaned up, where freeing of URB + memory would race with the submit function doing it's own cleanup and + freeing as a result of the submit failing. + + libusb_submit_transfer() always holds itransfer->lock, so the race can + be avoided by taking that lock also in the cleanup path and checking + that the URB memory has not already been freed before freeing it there. + + As http://libusb.org/ticket/81#comment:14 notes there is still another + possible, but unlikely, race condition between libusb_submit_transfer() + and an event handling thread. That will require more work to solve. + + [stuge: Add check in cleanup path that URBs have not already been freed] + +commit 1b0f758a334d78d3832d17d694ac0c931da36050 +Author: Peter Stuge +Date: Wed Sep 14 03:00:14 2011 +0200 + + Add libusb_error_name() API function + + Until we have i18ned error messages we can at least offer easy + translation from numeric error code to the error code's name. + + [hansg: switch() on enum to get a compiler warning if a case is missing] + [hansg: Better return value when called with an unknown error code] + [hansg: Fix DEFAULT_VISIBILITY in definition to compile on all platforms] + +commit e16805130a04b2642891e86b8f479e6343ca17da +Author: Peter Stuge +Date: Wed Sep 14 02:30:18 2011 +0200 + + Add libusb_has_capability() API function + + Since it is currently not planned to change the filename of the libusb + library between libusb-1.0 versions at least on Windows systems it's + important to have a capability API. + + Currently there exists only one capability; LIBUSB_CAP_HAS_CAPABILITY, + which tests support for the libusb_has_capability() API. + +commit 2dc2fa2a56408e515d25359323b4ea2f1bbec14a +Author: Sebastian Pipping +Date: Tue Sep 13 20:38:26 2011 +0200 + + Fix typos in introductory documentation + +commit 0a828082aeedc6d19b6de4e3b10cc9762352fa7f +Author: Pekka Nikander +Date: Tue Sep 13 18:57:43 2011 +0200 + + Linux: Add libusb_open() debug and error messages with the device path + + Fixes #109. + +commit 6583372125d73543fe0db9fdc59850b9c6aa50d9 +Author: Pekka Nikander +Date: Tue Sep 13 18:52:36 2011 +0200 + + Add debug message with libusb_open() error code + + References #109. + +commit f797ecb3b4e653594f8ebc0c9d9e2ca579062779 +Author: Hans de Goede +Date: Mon Sep 12 18:11:20 2011 +0200 + + Document libusb_handle_events_completed() and _timeout_completed() + + Signed-off-by: Hans de Goede + [stuge: Note that the old racy functions should be avoided by new code] + +commit 6696512aade99bb15d6792af90ae329af270eba6 +Author: Graeme Gill +Date: Sat Sep 10 15:47:05 2011 +0200 + + Fix #56 race condition causing delayed completion of sync transfers + + The sync API had a race where it would check a condition to know if it + needed to call a libusb_handle_events() function. However, the check + was done outside of the lock that is held while the condition is set, + so another thread could completely serve whatever was needed to make + the condition true between it being checked and the event handler being + called. This situation would be detected after a libusb-internal timeout + of 60 seconds, after which the transfer would be completed without + error, but with significant delay. + + Original patch at http://marc.info/?l=libusb-devel&m=127252114815709 + + Changes by Hans de Goede: + - Renamed the "race-proof" functions from libusb_handle_events*_check() + to libusb_handle_events*_completed() + - Drop r = 0 setting in libusb_handle_events_timeout_completed() + (to make both completed checking cases identical flow wise) + + Signed-off-by: Hans de Goede + [stuge: Simplify libusb_handle_events_timeout() change with a goto] + [pbatard: Fix _handle_events_timeout() and _completed() definitions] + +commit cfee5446cdb2974c1e90c7c379a365c495975aef +Author: Nathan Hjelm +Date: Fri Aug 26 23:06:40 2011 -0600 + + Darwin: Use a condition to signal async thread ready in libusb_init() + +commit d1bd234f7e1b1ff4168b8f605e2038e87a0e361f +Author: Nathan Hjelm +Date: Thu Jul 21 22:34:12 2011 -0600 + + Fix #64 use of reserved identifiers throughout libusb + +commit a97762a8a121de1ad3deb9e861088b69bb6a155b +Author: Nathan Hjelm +Date: Thu Jul 21 22:31:09 2011 -0600 + + Darwin: fix libusb_get_device_list() and libusb_claim_interface() leaks + +commit 8723df191fcedc6161732fd06d12df392c6dea3f +Author: Nathan Hjelm +Date: Thu Jul 21 22:28:47 2011 -0600 + + Darwin: use kIOMasterPortDefault instead of creating a master port + +commit 0eb7e43759003610d1afe6148aa6ff4f5859ccb0 +Author: Peter Stuge +Date: Wed Jul 27 03:15:03 2011 +0200 + + Allow devices with zero configurations to be discovered + + At least in Linux, wireless USB devices have zero configurations until + they have been authorized. This device state can be set for any USB + device using: + + echo 0 > /sys/bus/usb/devices/?-?/authorized + + An unauthorized device would previously make usbi_sanitize_device() + return LIBUSB_ERROR_IO, although there really was no I/O error. + + Reported-by: Carl-Daniel Hailfinger + +commit 5010c3e80423d13acee6eeb4af974e8a9bcdd006 +Author: Peter Stuge +Date: Wed Jul 27 06:17:48 2011 +0200 + + Linux: Continue enumeration even if one device returns an error + +commit 2bf8848fb5c85ace0f445c0820a0c173cf76bf43 +Author: Hans de Goede +Date: Fri Jun 17 10:19:00 2011 +0200 + + Linux: Handle single- and two-digit kernel versions like 3.0 and 4 + + The code has been tested with various version strings. + + [stuge: Remove bogus string length check and optimize for newer kernels] + +commit 0288bf24f91eca9f433ebad91a7eb6c0e3e29133 +Author: Pete Batard +Date: Thu Mar 3 18:35:35 2011 +0000 + + Windows: Provide libusb_get_device_speed() data + + * use (currently superspeed unaware) USB_NODE_CONNECTION_INFORMATION_EX + + Fixes #45. + + [stuge: Explicitly convert OS device speeds to libusb device speeds] + [pbatard: Add breaks overlooked when adding explicit conversion] + +commit 382b7deaadd7e2f1d08c9e921e460bb3abf130b2 +Author: Trygve Laugstøl +Date: Tue Jul 19 23:20:40 2011 +0200 + + Darwin: Provide libusb_get_device_speed() data + + References #45. + +commit 44d6319f57e7e2c77347da228ed032e62716b438 +Author: Hans de Goede +Date: Thu Feb 17 15:06:40 2011 +0100 + + Linux: Provide libusb_get_device_speed() data from sysfs + + References #45. + + Signed-off-by: Hans de Goede + +commit c8c40bcbd22abca922ff31c4ed6a75fd7af78b59 +Author: Hans de Goede +Date: Thu Feb 17 13:17:55 2011 +0100 + + Add new API function libusb_get_device_speed() + + Reworked version of my earlier patch, largely modelled after (if not + copy and pasted from) Trygve Laugstøl's similar + commit 5a6541e0d80fb1f21e2b960bc2337a612f9d74fb in + git://git.libusb.org/libusb-trygvis.git + http://git.libusb.org/libusb-trygvis.git + http://git.libusb.org/?p=libusb-trygvis.git;a=commitdiff;h=5a6541e0d + + This patch does not add any OS specific code. The supporting code in + each backend follows in separate patches. References #45. + + Signed-off-By: Hans de Goede + +commit 0db8cba7f2c372f0127c7df9724e5a35e93f2069 +Author: Nathan Hjelm +Date: Sun Mar 20 00:25:44 2011 -0600 + + Darwin: Improve device enumeration performance + + The device location is saved, and later used whenever iterating over + devices. Fixes #111 and #112. + + [stuge: Formatting fixes and split out libusb_get_device_speed() change] + [stuge: Combine with patch that uses the saved device location] + +commit 511ec4301deb516691e39e3df5b90fe28cb2bb0f +Author: Hans de Goede +Date: Thu Feb 17 12:49:36 2011 +0100 + + Linux: Use __read_sysfs_attr() to get busnum and devaddr + + Remove code duplication. + + Signed-off-by: Hans de Goede + +commit e05bbc59ca7b896e2b825bde59bf883ac8c09f5c +Author: Hans de Goede +Date: Thu Feb 17 12:45:10 2011 +0100 + + Linux: Add __read_sysfs_attr() helper function + + On Linux we often need to read (postive) integers from sysfs. This patch + adds a helper function for this. This is a preparation patch for adding + a libusb_get_device_speed() function to libusb. + + Signed-off-by: Hans de Goede + +commit 20e26dda0f86dafa3436b152e090b5f3410c8ce4 +Author: Hans de Goede +Date: Tue Feb 8 16:37:18 2011 +0100 + + Linux: Stop kernel from re-attaching in-kernel driver after reset + + When an interface is bound to the usbfs driver (iow claimed), the + kernel will unbind it, and then after the reset do a device_attach + on the interface, which will bind the default in kernel driver to + the interface. + + So if an app has detached the in kernel driver, and claimed the + interface and then does a libusb_reset_device. Things end up with + the interface no longer being bound to the usbfs driver (so no longer + claimed) and instead it is bound to the in kernel driver (iow the in + kernel driver is re-attached). + + We can stop this from happening by releasing all claimed interfaces + before the reset, as the kernel will not do the device attach after + reset, if no driver was bound to the interface before the reset. + + Signed-off-by: Hans de Goede + +commit 4e294dc9848aab86b31d2fff228cf97e7eadf913 +Author: Hans de Goede +Date: Thu Feb 17 12:35:46 2011 +0100 + + Core: Use USB_MAXINTERFACES rather then sizeof(claimed_interfaces) + + claimed_interfaces is a long and thus its size differs on 32 + versus 64 bits, this patch uses USB_MAXINTERFACES instead of + sizeof(claimed_interfaces) on interface number range checks + for consistent behavior independent of the arch. + + Signed-off-by: Hans de Goede + +commit a68f956dd4c29d6ed799f04f07a3346317843999 +Author: Hans de Goede +Date: Wed Feb 9 12:40:35 2011 +0100 + + Linux: Fix warnings seen when compiling with gcc-4.6 + + Compiling with gcc-4.6 results in the following warnings: + os/linux_usbfs.c: In function 'op_get_configuration': + os/linux_usbfs.c:1144:6: warning: variable 'r' set but not used ... + os/linux_usbfs.c: In function 'op_handle_events': + os/linux_usbfs.c:2091:40: warning: 'status' may be used uninitialized ... + os/linux_usbfs.c:2044:6: note: 'status' was declared here + dpfp.c: In function 'save_to_file': + dpfp.c:228:9: warning: variable 'ignore' set but not used ... + dpfp_threaded.c: In function 'save_to_file': + dpfp_threaded.c:257:9: warning: variable 'ignore' set but not used ... + + This patch fixes these. (The second comes from handle_control_completion() + which gcc seems to inline into op_handle_events().) + + Signed-off-by: Hans de Goede + [stuge: Add fixes for dpfp examples and update source references] + +commit 209b5ccd827039b933b730e3f29abd0d72d3c6c6 +Author: Vitali Lovich +Date: Tue Jun 14 08:51:57 2011 +0200 + + Darwin: Fix #108 crash when a device is unplugged + +commit d3543e9140536a9751811b44f8496489be1e6bb7 +Author: Peter Stuge +Date: Mon Jun 13 22:58:23 2011 +0200 + + libusb.h: Add missing LIBUSB_CLASS_ codes currently defined by usb.org + + LIBUSB_CLASS_PHYSICAL + LIBUSB_CLASS_SMART_CARD + LIBUSB_CLASS_CONTENT_SECURITY + LIBUSB_CLASS_VIDEO + LIBUSB_CLASS_PERSONAL_HEALTHCARE + LIBUSB_CLASS_DIAGNOSTIC_DEVICE + + Per http://www.usb.org/developers/defined_class + +commit 08bc7ffb6a3b65afc6795cd048a890ee8da7d954 +Author: Peter Stuge +Date: Mon Jun 13 22:53:40 2011 +0200 + + libusb.h: Add LIBUSB_CLASS_IMAGE in addition to LIBUSB_CLASS_PTP + + The old LIBUSB_CLASS_PTP name is kept for compatibility. Fixes #106. + +commit 3d7938d85a33cd98553c0c898a8dd0490826b077 +Author: Peter Stuge +Date: Mon Jun 13 22:52:48 2011 +0200 + + libusb.h: Fix LIBUSB_CLASS_PRINTER description typo + + References #106. + +commit 5d0526af1a922afab02cdbdf4bb7078702759571 +Author: Sean McBride +Date: Fri Feb 11 11:28:04 2011 -0500 + + Darwin: Fix #100 warning cast to pointer from integer of different size + +commit bb8854ff5680136e29b57505300f131c2646f258 +Author: Sean McBride +Date: Mon Jun 13 22:26:43 2011 +0200 + + configure.ac: Fix #97 clang warning about -fgnu89-inline + + Remove the test that sets the flag since GNU89 inline semantics are not + required by libusb. + + [stuge: Also remove reference to the test result] + +commit cb3c2e488f298b78027c9d5fc0bec0e5ba27d761 +Author: Pete Batard +Date: Wed Jun 15 01:38:58 2011 +0200 + + Windows: Make cancel_io() in poll_windows.c static + + References #97. + +commit 6635dbb4acb5ee556a020e431b15c954edfcbd29 +Author: Peter Stuge +Date: Mon Jun 13 22:21:02 2011 +0200 + + Windows: Make upperize() in windows_usb.h static + + References #97. + +commit 9479ce9dae3d0dbe2ce693bd02ccceb018a75fe9 +Author: Vitali Lovich +Date: Wed Mar 16 17:33:57 2011 -0700 + + descriptor.c: Fix buffer read overflow caught by valgrind + + In parse_interface() an unexpected descriptor would be parsed without + validating the descriptor's length. It is possible for size to be 0 at + this point, which means that the parsing would read past the end of the + source buffer. Fix #83 by checking the length of the remaining buffer + before parsing. + +commit c775c2f43037cd235b65410583179195e25f9c4a +Author: Vitali Lovich +Date: Wed Mar 16 19:51:40 2011 -0700 + + Clean up in-flight transfers and device handle when closing a device + + Any in-flight transfers should properly invalidate their references + to device handles that are being closed. Additionally, they should be + removed from the transfer-in-flight list. This is done with the events + lock held to protect against another thread processing the same transfer. + The events lock is initialized as a recursive mutex, because the device + close code might itself be called while an event is being handled. + Fixes #82. + + [stuge: Trivial rework to reduce indenting] + +commit 74282582cc879f091ad1d847411337bc3fa78a2b +Author: Vitali Lovich +Date: Wed Mar 16 19:43:30 2011 -0700 + + Add recursive mutexes to threading abstraction + + This is necessary for the device close path which needs to attain the + events lock, but which might itself be called while handling an event. + The events lock is necessary to properly clean up transfers which might + still be pointing to the device. References #82. + + [stuge: Move usbi_mutex_init_recursive() into threads_posix.c] + [stuge: Must also #define _XOPEN_SOURCE 500 to be able to build] + [pbatard: Un-inline usbi_mutex_init_recursive() to make Cygwin happy] + +commit 8f1bc0659136faf312dabe8fe67380a798299d33 +Author: Vitali Lovich +Date: Wed Mar 16 19:48:35 2011 -0700 + + Add USBI_TRANSFER_CANCELLING and _DEVICE_DISAPPEARED status flags + + The flags are used to indicate if a cancellation has started, and if + a cancellation has failed because the device is no longer available. + References #82. + +commit 87ba8a9ead4fd9e81ae3c5a894f698779de1f2c2 +Author: Vitali Lovich +Date: Wed Mar 16 19:50:04 2011 -0700 + + Linux: Detect and report that device has gone away while discarding URBs + + Return LIBUSB_ERROR_NO_DEVICE if the device is no longer available + (ENODEV) to discard the urbs. References #82. + +commit 2c85c363cddd72b9ab425f05e2ee03e0b1df24f1 +Author: Peter Stuge +Date: Mon Jun 6 02:46:46 2011 +0200 + + libusbi.h: Add comma after last value in enum usbi_transfer_flags + +commit 5d7be3e1337f2444097504931ac0f2f0997b2b05 +Author: Peter Stuge +Date: Sun Jun 5 23:28:07 2011 +0200 + + threads_posix.h: Whitespace fix + +commit 18db4813e844fc6929680afcc9b793abcb06876a +Author: Peter Stuge +Date: Sun Jun 5 23:21:08 2011 +0200 + + libusb/Makefile.am: Correct threading files in libusb_1_0_la_SOURCES + +commit 5f30c81f66e8dd61f8eae16de548697708f9bd18 +Author: Alan Ott +Date: Thu Jul 21 16:37:48 2011 +0200 + + Linux: Fix #70 race condition in sysfs_get_device_list() + + Change the way libusb chooses between using sysfs and usbfs for information + about the attached devies. Using the old method, a race condition could + occur if a device was unplugged just before (or during) the call to + libusb_get_device_list(), corrupting the internal sysfs_can_relate_devices + and sysfs_has_descriptors variables and preventing libusb_get_device_list() + from working in future calls. + + The old method was based on the assumption that if certain sysfs files + (eg: busnum) could not be opened, that indicated an inadequacy of sysfs + (ie: the running kernel's sysfs version did not contain those files), + when in reality those files couldn't be opened because the device had + been unplugged. + + The new method checks the adequacy of sysfs during libusb_init() + (op_init()) and if a sysfs file cannot be opened, it is now assumed that + it is because the device has been unplugged, not because sysfs is + inadequate. + + Signed-off-by: Alan Ott + [stuge: Include closedir() bugfix posted in ticket by Arne Laansoo] + [stuge: Remove dead code in sysfs_scan_device() found by Hans de Goede] + +commit 40327cd134718475f6cec8935b856d4fdff2099c +Author: Sean McBride +Date: Thu Feb 10 17:11:29 2011 -0500 + + Darwin: Fix #63 error when apps use Objective-C garbage collection + +commit 3ba2fae24886fec89410e5f2295f65363edcc2df +Author: Sean McBride +Date: Fri Feb 5 11:50:34 2010 -0500 + + Darwin: Fix #28 clang analyzer warning about unbalanced retain/release + +commit b67120f047f7eafa15c88c66fa61cef40805ec1f +Author: Sean McBride +Date: Fri Feb 5 11:50:34 2010 -0500 + + io.c: Fix clang analyzer warning about unused variable + + References #28. + +commit 51af85d03a098d7d99ea544e8e9535b5476bab33 +Author: Peter Stuge +Date: Tue May 10 10:44:18 2011 +0200 + + .gitignore: Add m4 subdirectory created by libtool + +commit c569e5b3b314538f45d0b3b6f14ce3dbdfee1be9 +Author: Ludovic Rousseau +Date: Mon Nov 15 14:45:50 2010 +0100 + + Linux: Do not include useless pthread.h + + The code does not use threads so no need to #include + Fixes #74. + +commit 82af9f9d440ef49015652c699157cf62020f097a +Author: Pete Batard +Date: Tue Mar 8 17:41:05 2011 +0000 + + Windows: minor code improvements + + * mostly warnings from VS2010's Intellisense + +commit 7e636dbe06001b9ac68e452a2fdc05e33fbb4e3a +Author: Pete Batard +Date: Tue Mar 8 17:40:39 2011 +0000 + + Windows: prevent set_configuration request from being sent using WinUSB + + * multiple WinUSB set configuration requests can stall a device and + WinUSB does not support setting of alt configuration in the first place + * issue reported and investigated by Xiaofan Chen + +commit 578c50c99646e5ebbcfbea653524a519b843ebcd +Author: Graeme Gill +Date: Tue Mar 8 17:39:16 2011 +0000 + + Windows: fixed default WinUSB timeout and ineffective policy settings + + * default WinUSB timeout was 5 seconds, which may be to small. + PIPE_TRANSFER_TIMEOUT policy is now set to infinite for all EPs. + * other WinUSB policy settings were called before the endpoints + had been set. This is now fixed. + +commit 25fa63ea1cfe02e784cb62d3b869fd15e62b5b6e +Author: Pete Batard +Date: Tue Mar 8 17:37:40 2011 +0000 + + Windows: Don't leak pipe fds + + use _open() and _close() rather than _open_osfhandle() and CloseHandle() + + * use of CloseHandle() prevented the pipe fds from being + relinquished on libusb_exit() + * leaked fds could lead to the OS running out of new fds + and LIBUSB_ERROR_NO_MEM being returned as a result + * using _open() avoids _open_osfhandle() redef for cygwin + * issue reported by Stephano Antonelli + +commit 3ccd9bddec316ee4b867959fd7f616eb4d410997 +Author: Peter Stuge +Date: Tue May 10 10:05:29 2011 +0200 + + Windows: enumeration overhaul + + * uses multiple passes in a single call + * uses a hash table, in anticipation for hotplug + * adds a (dummy) HUB interface for harmonization + * adds calloc on device struct creation in core + (to detect and avoid unnecessary double initialization) + +commit bb108cbe39802785d10fe025b74ca5ee19734151 +Author: Pete Batard +Date: Tue May 10 00:56:18 2011 +0100 + + Windows: MS project files part 4 - MSVC6 project files + + Fixes #57 and #1. + +commit 78896ae99b9c2d5672fc93c5bad0f5e8e75c53ea +Author: Pete Batard +Date: Tue May 10 00:53:09 2011 +0100 + + Windows: MS project files part 3 - VS2005 project files + + References #57. + +commit 9e5f4277e379a82f5d32e81db1bd0ffaa6637596 +Author: Pete Batard +Date: Tue May 10 00:38:49 2011 +0100 + + Windows: MS project files part 2 - WDK project files + + References #57. + +commit c1e75431418cdfc10ec963d823fce479cdae6840 +Author: Pete Batard +Date: Tue May 10 00:38:12 2011 +0100 + + Windows: MS project files part 1 - support files & preliminaries + + * adds the MSVC support files used by MSVC6, VS2005 and WDK + * also adds missing defines required by MS compilers in libusb.h + * also anticipatory sets .gitattributes for CRLF handling + * also adds manually maintained .def file for import lib generation + + References #57. + +commit 85a14f43e0ce27cd47f84fdaeacbaa81cebdb886 +Author: Peter Stuge +Date: Mon May 9 08:12:24 2011 +0200 + + Move library version number from configure.ac to libusb/version.h + + This is neccessary to support native MS builds. The Windows resource + file libusb/libusb-1.0.rc must include the release version, which was + previously only available after configure had run and had substituted + the numbers into a generated libusb/libusb-1.0.rc file. + + The version atoms are now stored as CPP style #defines in libusb/version.h + so that the .rc no longer needs to be generated but can simply include the + header file and access the version information directly. + + The m4 macro LU_DEFINE_VERSION_ATOM() was added to configure.ac to get + version atoms from libusb/version.h for use in AC_INIT(). The macro + handles C and C++ style comments in version.h, but can easily be made + to fail by obscuring the file. Please don't do that. + + Tested with MinGW using autoconf, and manual compile of libusb-1.0.rc + using RC.EXE Version 5.2.3690.0 from Visual C++ 2005 Express Edition. + +commit 3481f52b014110f6c291e5a15e79ba774dcdfacf +Author: Peter Stuge +Date: Tue May 10 08:36:32 2011 +0200 + + Windows: Debug builds create the same .dll file name as non-debug + + Thanks to Pete for pointing this out! + +commit 9da8cf5c9ed9bd381a77d8170fc0556edbcce4dc +Author: Pete Batard +Date: Tue Mar 8 17:18:48 2011 +0000 + + Windows: explicit use of ANSI or WideChar calls + + * This is in anticipation of adding MSVC project files + that use Unicode rather than MBCS + +commit ae675c1f49dc00b695fce7296903f60998cc28ed +Author: Pete Batard +Date: Tue Mar 8 17:16:23 2011 +0000 + + Windows: Remove SetupAPI, AdvAPI32 and OLE32 link-time dependencies + + * this ensures that libusb dependent applications only need + to explicitly link against libusb on Windows + + The run-time dependency on Cfgmgr32.dll, OLE32.dll and SetupAPI.dll remains. + +commit 356e312511e4892977636da52ec497ad2c716032 +Author: Pete Batard +Date: Tue Mar 8 17:12:33 2011 +0000 + + Add .gitattributes to avoid Windows line ending issues with autocrlf + +commit 61c120f025f3dee04eeb88159d7c0403a8bf91fe +Author: Peter Stuge +Date: Sun Feb 27 09:37:54 2011 +0100 + + Windows: Touch up FileDescription and ProductName resource strings + +commit 99b4ddcd893834a4be8b5884037b650e57ba0ba2 +Author: Peter Stuge +Date: Sun Feb 27 07:20:40 2011 +0100 + + Windows: Remove emulated direct device access via HID API + + Either use a library such as HIDAPI to communicate with HID class + devices, or replace the kernel driver for the device with one that + offers support for the complete libusb API. + +commit 4be84ab49c838d534d3a1b8a64ffa89774984ee7 +Author: Peter Stuge +Date: Sun Feb 27 06:59:15 2011 +0100 + + Revert libusb_strerror() until we have i18n and l10n + +commit 0e177f22fcc69d9aab6fb410e85f3413f478c94c +Author: Pete Batard +Date: Wed Jan 19 14:00:12 2011 +0000 + + dpfp_threaded: return instead of pthread_exit() to avoid Cygwin warning + +commit e65878f21b0a0bb96debcb292dc03ce3c4ebb701 +Author: Pete Batard +Date: Wed Jan 19 13:52:08 2011 +0000 + + Windows: Rename various variables named "index" to avoid shadow warnings + +commit 019bf73bb2677dc7720bc8280527316adcbaa506 +Author: Pete Batard +Date: Tue Oct 5 12:50:53 2010 +0100 + + Windows: Fix logic in enumeration of driver name and port number + +commit 24494ed5db27737fc607fc35dda722521c9fe4d4 +Author: Pete Batard +Date: Tue Oct 5 12:50:13 2010 +0100 + + Windows: Allow claiming any interface in composite device using WinUSB + + Issue reported by Benjamin Dobell, see #48. The call to + WinUsb_QueryInterfaceSettings() is removed since it doesn't work + on any other interface but the first (a WinUSB limitation). + + This allows the use of WinUSB.sys in lieu of the usbccgp.sys + "USB Generic Parent" default driver for composite devices. + +commit 9c8e6545f2fbb171f81a9451eaf2d09e1fbc13b3 +Author: Pete Batard +Date: Tue Oct 5 12:47:15 2010 +0100 + + Windows: Allow arbitrary bConfigurationValue in config descriptors + + Unlike bInterfaceNumber, bConfigurationValue does not have to be + either sequential or contiguous. The bConfigurationValue is now + included in debug output. Fixes #48 reported by Benjamin Dobell. + +commit dcd002974e511879320233fd5b0600e06bdc5620 +Author: Thomas Röfer +Date: Fri Nov 19 22:03:11 2010 +0100 + + Darwin: Schedule isochronous transfers further in the future + + This is required to make OpenKinect transfer data at 30 fps. This + change was originally made by Theo Watson, and Thomas improved on it. + The commit came via OpenKinect into libusb thanks to Kyle Machulis and + Hector Martin. Fixes #66. + +commit e83fad33dbaf9f37811da6d4cd9d3be554817944 +Author: Thomas Röfer +Date: Fri Nov 19 22:03:11 2010 +0100 + + Darwin: Fix #65 memory leak in submit_iso_transfer() + + This was also independently fixed by Hoi-Ho Chan, but Thomas caught + an additional problem with his fix. + + This commit came via OpenKinect into libusb thanks to Kyle Machulis + and Hector Martin. + +commit 1a2d21fe42ad5a157651c787e2f500fc162c325b +Author: Peter Stuge +Date: Sat Feb 26 04:21:05 2011 +0100 + + configure.ac: Refactor Windows backend settings into one occurence + + The Windows backend is used both with MinGW and Cygwin, and since most + settings are identical they can be set in one place. + +commit 717f47621d18de16b87e237f3740299f43e4ca1c +Author: Peter Stuge +Date: Mon Nov 15 19:58:51 2010 +0100 + + configure.ac: Rename AM_LDFLAGS to LTLDFLAGS and actually use them + + The new variable name tries to clarify that libtool is being used. + Linker flags must thus always be specified with -Wl. + + Factor out the libtool flag -no-undefined from host specific cases. + The flag is required to build a Windows DLL, but is correct also for + the other supported systems. + + Also, start actually using LTLDFLAGS in libusb/Makefile.am, so that + libtool will see the options set by configure. + +commit 3cbe5736469c1c52049752c137ae11387e9b079d +Author: Peter Stuge +Date: Sun Nov 21 23:38:46 2010 +0100 + + configure.ac: Clean up PC_LIBS_PRIVATE and AM_LDFLAGS + + Move linker options for when linking the library itself from + PC_LIBS_PRIVATE into AM_LDFLAGS. PC_LIBS_PRIVATE should only + contain flags needed to link applications statically against libusb. + Fixes #72. + +commit ef39d1510580b9fcbacf13443fa7a4e553a9a88e +Author: Peter Stuge +Date: Fri Feb 25 02:33:29 2011 +0100 + + configure.ac: Call AC_CONFIG_FILES() for each output file + + This avoids a problem with Windows line endings. + +commit 6e52ea067711e6e7e1b2882757fb61b11b6f8feb +Author: Peter Stuge +Date: Sun Nov 21 23:37:27 2010 +0100 + + configure.ac: Whitespace changes and trivial reordering + +commit 44b85dabc3f4efe0918a598f981675aa3765cc26 +Author: Peter Stuge +Date: Sun Nov 21 23:10:35 2010 +0100 + + configure.ac: Quote AC_COMPILE_IFELSE() input + +commit 19d5882c398e49a453ff78494db23b7f4d13c37c +Author: Peter Stuge +Date: Sun Nov 21 23:09:02 2010 +0100 + + configure.ac: Define booleans to 1 when set, instead of an empty string + + This makes the generated config.h look a lot nicer. + +commit c24649d796c8b5c97af79a41856422def2e593bc +Author: Peter Stuge +Date: Sat Oct 30 22:28:59 2010 +0200 + + configure.ac: Clean up redundancy and fix LIBS on Linux + + LIBS, AM_LDFLAGS, OS_ conditionals and THREADS_POSIX had a bit of + redundancy throughout the file, and on Linux LIBS ended up missing + the -pthread flag. + +commit 0bd4a4dd89ff64b99ab55bfc0c5782502c10c676 +Author: Peter Stuge +Date: Sat Feb 26 04:08:38 2011 +0100 + + configure.ac: Touch up Darwin and Cygwin OS messages + +commit 16cf11a1213272afd616598fa3aba0941e66ec3c +Author: Peter Stuge +Date: Sat Oct 30 22:13:05 2010 +0200 + + configure.ac: Do not use -pthread on Darwin + + It's not needed because Darwin has POSIX Threads in libc. Fixes #96. + +commit a120747d561929682cd0276ea4c13fb22fad8554 +Author: Peter Stuge +Date: Sat Oct 30 22:07:37 2010 +0200 + + configure.ac: Check for poll.h, and for nfds_t on Darwin + + On Linux, assume nfds_t is always available. + + On Darwin, fall back to unsigned int when poll() exists but there + is no nfds_t, such as on Mac OS X before 10.4. + + On Windows (both MinGW and Cygwin), always use unsigned int instead + of nfds_t, and don't check for poll.h because we use our own poll() + implementation. + +commit 21d03d12f92c0d9bd7990861ca0ebf5009f82799 +Author: Nathan Hjelm +Date: Tue Oct 5 20:08:08 2010 -0600 + + Darwin: Add support for control requests on endpoints other than 0 + + Signed-off-by: Nathan Hjelm + +commit 9bfacd760b40f1137a7835198c6028cbdaddeb18 +Author: Nathan Hjelm +Date: Tue Oct 5 23:11:50 2010 -0600 + + Darwin: Add more error checking for libusb_open() + + Now also check the CreateDeviceAsyncEventSource() return code for errors. + + Signed-off-by: Nathan Hjelm + +commit 478cd4a30728595fd742aa192d8149ee4216d4bc +Author: Peter Stuge +Date: Wed Nov 3 21:46:53 2010 +0100 + + Core: libusb_get_next_timeout() must consider all flying transfers + + If transfer->flags indicated that a transfer had a timeout, but no + timeout was actually set, then libusb_get_next_timeout() would look + no further for a timeout, ignoring any transfers later in the list + which had a timeout set. + + Since libusb has an internal 60 second timeout this bug could not + cause complete lockup, but it could cause a 60 second timeout even + when a transfer was submitted with a shorter timeout. + +commit 7802e4a3e38bcefccf96ae510ec2c6b7a959b8b5 +Author: Ludovic Rousseau +Date: Mon Nov 15 14:55:51 2010 +0100 + + Linux: Correctly catch read() errors for sysfs config descriptors + + read(2) returns ssize_t (signed) and not size_t (unsigned) or int. + + Silence "warning: comparison of unsigned expression < 0 is always false" + and fix #75. + +commit 4c7f3c8c3012bddba058afd2abdda792944fcda1 +Author: Peter Stuge +Date: Sun Jan 23 04:01:25 2011 +0100 + + Linux: Refactor cancellation into one function for all transfer types + +commit 011f1f297bc134188fab9960da1b1b9f0bd541aa +Author: Peter Stuge +Date: Sun Oct 17 08:19:56 2010 +0200 + + Linux: Refactor discarding of URBs into a function and return all errors + + The Linux backend did not always return errors according to the + libusb_cancel_transfer() documentation. + +commit 26246df19cb4d88954a5aa9ed5f6b859e451df85 +Author: Peter Stuge +Date: Sun Jan 23 04:01:01 2011 +0100 + + Linux: Set private number of URBs also for control transfers + +commit 295c9d12e25bc2dbdd8b42bd67a1f7120f0631a1 +Author: Alan Stern +Date: Sun Oct 17 06:57:06 2010 +0200 + + Linux: cancel URBs in reverse order + + In a multi-URB transfer, URBs should be cancelled in reverse order of + submission. This prevents races that might otherwise occur (after URB N + is cancelled, data may be transferred for URB N+1 before it too can be + cancelled). Fixes #8. + +commit 07df377a5df25e9c1811b554dc00eb8c40e5b995 +Author: Alan Stern +Date: Sun Oct 17 04:17:32 2010 +0200 + + Linux: report correct value for urb->actual_length + + Transferred bytes are returned correctly by the kernel for every URB, + even when an error occurs. Hence they should always be included in + the transfer statistics. The same is true for isochronous packet + length and status. + + [stuge: set itransfer->transferred so data is stored at correct offset] + +commit b26db49208c7a6ef0a99645142af21ce80c57c22 +Author: Alan Stern +Date: Fri Oct 22 11:13:34 2010 +0200 + + Linux: improve reporting of URB error status codes + + Fix the way overflow errors are handled (they can occur in any + transaction, not just the last one in a transfer) and add tests + for other commonly-occuring error statuses. + +commit efc29733ad31f81883a7ac51a6cc6cda9ad4feb9 +Author: Alan Stern +Date: Tue Oct 5 11:08:40 2010 -0400 + + Linux: improve detection of BULK_CONTINUATION kernel support + + Clarify the comments describing the BULK_CONTINATION flag, and improve + the subroutine that checks whether the flag is supported by making it + "future-proof", i.e., by working properly with kernel version numbers + higher than 2.6. + +commit bd267cf92269e0c4cd8eef795b91eefb2c63452e +Author: Peter Stuge +Date: Mon Nov 22 05:14:00 2010 +0100 + + README: Update webpage URL and add Peter's email address + +commit 845b715675703c5f1bc907f6302ece416c9f112c +Author: Peter Stuge +Date: Wed Aug 4 07:30:22 2010 +0200 + + libusb is not just for Linux! + +commit 67d9ef7b6877e17f2deec81cd41dc0948f6bed4b +Author: Nathan Hjelm +Date: Tue Oct 5 19:48:39 2010 -0600 + + Remove USBI_OS_HANDLES_TIMEOUT and fix int/isoc timeouts on Darwin + + Backends set USBI_TRANSFER_OS_HANDLES_TIMEOUT for transfers instead. + Darwin only handles timeouts for bulk and control transfers, so the + backend now sets that flag accordingly, making libusb core handle + timeouts for interrupt and isochronous transfers. Fixes #31. + + Signed-off-by: Nathan Hjelm + + [stuge: rework libusb_get_next_timeout() and enum usbi_transfer_flags] + [stuge: fix typo; set USBI_TRANSFER_TIMED_OUT flag correctly] + +commit 370922dfbe0964c0b8a0c1974bb1d7b85ac10607 +Author: Peter Stuge +Date: Sun Nov 14 03:14:00 2010 +0100 + + Silence "warning: suggest braces around empty body in an 'if' statement" + +commit 0f85015bdf87f3bca0d86ed87c9b976176640922 +Author: Konrad Rzepecki +Date: Sat Nov 13 14:09:22 2010 +0100 + + Disallow libusb_get_string_descriptor_ascii() with index 0 + + String descriptor 0 is the list of supported language IDs in the device, + which can't have an ASCII representation. Calling the function with + index 0 is thus not really useful. Fixes #43. + +commit 3b41c31d3fa2c1f93649cc5fc0f59acbf3efd5a1 +Author: Ludovic Rousseau +Date: Fri Mar 19 15:35:14 2010 +0100 + + Use const for the usbi_parse_descriptor() format string + + Constant strings should be "const char *" instead of "char *". Silence + "discards qualifiers from pointer target type" warnings. Fixes #61. + +commit 7f2e9f0776386997d2b4c4c47598ab88e3caeb7a +Author: Hector Martin +Date: Wed Aug 25 03:21:57 2010 +0200 + + Linux: Fix usbfs/sysfs config descriptor handling on big-endian + + usbfs endian-swaps, sysfs doesn't, not the other way around. Fixes #51; + descriptor endian parsing is backwards using sysfs on big-endian hosts. + usbfs is untested. + + Signed-off-by: Hector Martin + + [stuge: checked against Documentation/usb/proc_usb_info.txt] + +commit 2aa8984e59cf0f492e7fbebb8924f54f6160cc5e +Author: Ludovic Rousseau +Date: Tue Aug 17 20:53:04 2010 +0200 + + examples: #include without directory name + + The libusb-1.0 directory name belongs in the compile command, e.g. + via pkg-config --cflags. Fixes #58. + +commit 7da756e09fd97efad2b35b5cee0e2b2550aac2cb +Author: Ludovic Rousseau +Date: Thu Jun 24 10:14:24 2010 +0200 + + Add missing argument to libusb_wait_for_event() documentation, fix #55 + + In the libusb_wait_for_event() sample code in the section "Letting other + threads do the work for you" the call to libusb_wait_for_event() was not + updated by commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90, which added + the libusb_context *ctx parameter to the function, so the sample code + was broken until now. + +commit 678c242705b29f9cb6cc421b5625a6485ae58047 +Author: Peter Stuge +Date: Sat Oct 16 14:22:30 2010 +0200 + + examples: Silence warnings about return value of fwrite() + +commit 9cd9059bf9baac69a9d6c909f4c1e000592fa260 +Author: Peter Stuge +Date: Sat Oct 16 11:47:14 2010 +0200 + + Linux: Don't free() URBs prematurely on hardware error; fix #54 + + When an URB in a multi-URB transfer had an error, handle_bulk_completion() + would free all URBs and segfault once the next one completed, instead of + cancelling the remaining URBs and cleaning up as usual. + + This is basically the patch from the ticket, plus some restructuring + for increased readability of the function. + + Many thanks to Brian Shirley and National Instruments for finding and + fixing this! + +commit 116d34f608b02f4e14668450b158acf5db726f95 +Author: Pete Batard +Date: Tue Oct 5 12:43:41 2010 +0100 + + Windows: add support for filter drivers + + * precedence is driver > upper filter > lower filter, and defined + in struct driver_lookup lookup from set_device_paths() + +commit eb833fcd837e3aac2e497438b14c8612254c28ce +Author: Pete Batard +Date: Tue Oct 5 12:36:49 2010 +0100 + + Windows: fix errcode shadow warning, and string and DLL_DECLARE fixes + + * use FormatMessageA, and overall improvement of windows_error_str() + * use safe_strlen() always + * better typing/init default + * more explicit debug message for devices with no driver + +commit 1feadb5f78e1d2cdfd2aaf0011e041c2848bae37 +Author: Pete Batard +Date: Tue Oct 5 12:29:32 2010 +0100 + + Windows: use IOCTLs for HID input, output and feature reports + + * fixes feature reports not providing actual read size + (reported by Axel Rohde http://marc.info/?m=127033070021994) + * removes the USE_HIDD_FOR_REPORTS macro + * IOCTL usage inspired from HIDAPI by Alan Ott + +commit d7c25451f4075d2a12eb5cbc91ff3de8c0292da0 +Author: Daniel Drake +Date: Mon Oct 4 20:03:58 2010 +0100 + + Fix libtool version setting + + This was being set too early to take effect. + +commit a6fb54e2eef4e393bd06829bc3bdc746ea9d41a6 +Author: Mike Frysinger +Date: Mon Oct 4 20:01:07 2010 +0100 + + Populate the pkg-config Libs.private field + +commit a9b4065f048e750b7317f6434406fd528b69bf33 +Author: Mike Frysinger +Date: Fri Aug 20 00:09:46 2010 -0400 + + Linux: fix build failure when CLOCK_MONOTONIC does not exist + + This is not available on all platforms. + +commit d192c5bd32736fde0080d756de6221287af34891 +Author: Daniel Drake +Date: Mon Oct 4 18:45:18 2010 +0100 + + Update libtool version info + + With input from various people on the mailing list, update the libtool + versioning info and start to update this on every release. + + The next libusb release will not need a change here. All following ones + will. + +commit e65f69a7ef3de357c867ddaac9598efe407078b6 +Author: Pete Batard +Date: Thu Aug 5 16:40:09 2010 +0100 + + Updated documentation for unsupported Darwin/Windows calls + +commit c8bab4e19413d70c515a2eaf747a75b7f66fdc0b +Author: Pete Batard +Date: Sun Sep 19 14:24:25 2010 +0100 + + Windows: Make libusb_pollfd() return error + + Windows does not have numerical file descriptors but does have the + concept of event sources. Exposing these event sources will require + some careful thought and design, to be completed later. + +commit bd623f70d99fad8b975f8d4ee62ea4b1abf1272f +Author: Daniel Drake +Date: Sun Sep 19 14:21:01 2010 +0100 + + MinGW: Use --add-stdcall-alias linker option + + Naming of symbols inside the library is inconsistent on Windows: + http://wyw.dcweb.cn/stdcall.htm + + Use this linker option to add aliases which add compatibility with + the "MSVC DLL" platform when a DEF file is used. It also better matches + the appearance of the Windows API itself. + +commit 29f9f9e3af3340df6a955881a93caf9d2a6d08d6 +Author: Pete Batard +Date: Fri Aug 13 11:59:49 2010 +0100 + + Introduced calling convention (for Windows) + + Under Windows, a variety of compilers and configurations are available, + meaning that the manner of parameter passing (e.g. registers vs stack) + can vary. + + Match the Windows API calling convention and document this appropriately. + This calling convention will be used regardless of the configuration of + the user's development platform. + + The only user-level complication is that all functions used as libusb + callbacks must use the same calling convention as libusb. The + LIBUSB_CALL macro is provided to make this easy. + + Signed-off-by: Michael Plante + Signed-off-by: Pete Batard + [dsd: slight change of strategy, add documentation] + +commit be523f1fe7c136c3fca06ae9c96aff44a22482ba +Author: Pete Batard +Date: Fri Aug 6 21:56:04 2010 -0600 + + Windows: fix string copy in sanitize_path + + The NULL byte was not being copied. + +commit 7fd36af9f749ce8bf96f89cefd519a9f46825573 +Author: Pete Batard +Date: Fri Jul 30 00:30:31 2010 +0100 + + Windows: DuplicateHandle failure is not a warning + + This is because WinUSB handles are not duplicable, and generate a + lot of these warnings. + +commit 33cd2f68b4d500e852e354e5acae3d9a96a8ec26 +Author: Pete Batard +Date: Fri Jul 30 00:23:05 2010 +0100 + + removed trailing whitespaces + +commit e47849afe9381c864683220eac9ce7bcf43f7883 +Author: Pete Batard +Date: Wed Aug 4 18:18:32 2010 -0600 + + Windows: Mark interfaces as unused when releasing + + Without this important cleanup, the autoclaim code could attempt to + reuse an unclaimed interface as if it were already claimed. + +commit b30ca141a0bdce26e7cfdd91d346e49051532ee7 +Author: Pete Batard +Date: Wed Aug 4 18:15:59 2010 -0600 + + Windows: fix device path string duplication + +commit e8d7a89503d5655c4b04da718c6971e25ff48162 +Author: Nathan Hjelm +Date: Mon Aug 2 21:27:38 2010 -0600 + + Darwin: Cache device configuration value + + Cache device configuration value to bring the Darwin backend more in + line with the libusb spec. To handle buggy devices GetConfiguration is + not called unless the device has more than one configuration. + +commit fe5d1d2050f715ffa8cbd35a378ac969a1a01584 +Author: Xiaofan Chen +Date: Fri Jul 30 15:56:43 2010 +0100 + + Fix inconsistencies between prototypes and definitions + + This removes some warnings on cygwin regarding a name clash against + the standard library "index" function. + +commit 3b538c43e11b805a37d93b6283d270d5d5f0d1f5 +Author: Hoi-Ho Chan +Date: Tue Jul 27 21:04:17 2010 -0600 + + Darwin: handle kIOReturnUnderrun + + This return code indicates that the device returned a data packet + less than the max packet size. In libusb backend terms, this is + a successful transfer. + +commit 9a4249f8a104b98a15a7e3ba7ecae9a385ed9027 +Author: Pete Batard +Date: Sat Jul 10 17:51:13 2010 -0600 + + Add Windows support + + Via Cygwin/MinGW, libusb now has windows support. + Thanks to contributors: Michael Plante, Orin Eman, Peter Stuge, + Stephan Meyer, Xiaofan Chen. + +commit d38dd5e3d2a872f7064eea084ddea8c33811dd7d +Author: Hoi-Ho Chan +Date: Sat Jul 24 13:48:00 2010 -0600 + + Darwin: write iso transfer details into correct packets + +commit fbff5b4b665ff2ebc948162617cf7f4f5d2fabeb +Author: Nathan Hjelm +Date: Sat Jul 24 13:42:57 2010 -0600 + + Darwin: fix interface object leak + +commit dffc09835d6860ae9b6a62c39af5be346188cb05 +Author: Nathan Hjelm +Date: Sat Jul 24 13:41:03 2010 -0600 + + Darwin: clean up some debug messages + +commit 946d1abbca397b8e88a1b0b4df176dcc5e3b7348 +Author: Nathan Hjelm +Date: Sat Jul 24 13:39:16 2010 -0600 + + Darwin: Don't open devices during scan unless we have to unsuspend + +commit 3b6d9ac82e2599cad7817d21e909a42275ddc4c4 +Author: Peter Stuge +Date: Fri Jun 25 08:08:13 2010 +0200 + + Linux: Handle early complete of multi-URB transfer + +commit a516fcb99376686d2d0028e5ac69950c57a55b9e +Author: Daniel Drake +Date: Wed Jul 21 17:49:21 2010 -0600 + + Only compile dpfp examples when sigaction is available + + It's not available on MinGW. + +commit a1d831ef82e1700f4ebb9df6ca5cef74be757c08 +Author: Aurelien Jarno +Date: Tue May 25 09:32:19 2010 +0200 + + configure.ac: fix bashisms + +commit 7211aba6e290f9805e911959b2a43a4b3ec56d4f +Author: Daniel Drake +Date: Fri Jun 25 12:01:58 2010 -0500 + + Only include sys/time.h on appropriate platforms + + This header doesn't exist on windows. + For libusb, determine at configure-time if the header is available. + For libusb.h, use gcc predefined macros to only include the header + on platforms that need it. + +commit b33c3cb9651459de1f3d549677cbac67a017a295 +Author: Daniel Drake +Date: Tue Jun 22 18:45:38 2010 -0500 + + Linux: Fix log message commit + + Forgot to test this. + +commit 139648d5723190734a51c1c66ddf41c3e87adf10 +Author: Ludovic Rousseau +Date: Mon Jun 21 10:19:29 2010 +0200 + + Only initialize the default context when it is requested + +commit 22d61cd0891d8304dfc1a70579cf154fd8e6644a +Author: Daniel Drake +Date: Tue Jun 22 18:20:23 2010 -0500 + + Linux: fix log message that was being unconditionally sent to stderr (#44) + + This message was put in place to aid libusb-compat-0.1 users, who + may run into the change that libusb-0.1 allowed you to usb_open() a + device that you don't have write access to, but libusb-1.0 does not. + + As explained on the ticket this change is dangerous so it should go through + the usual logging mechanism. I also added a similar regular log message + to libusb-compat-0.1. + +commit 82065a2c5e9d5ad0b2bb28792d12462f2fa150f0 +Author: Ludovic Rousseau +Date: Thu Jun 10 18:41:27 2010 +0200 + + Fix 2 documentation typos + +commit 351c062aacdde0b0fa7972ee9b7c6b355dcee110 +Author: Ludovic Rousseau +Date: Wed Apr 21 16:49:33 2010 +0200 + + add AM_MAINTAINER_MODE + +commit a7c056c14867e1cc3ef83682f2706cdbdca7c4ce +Author: Pete Batard +Date: Thu Jun 10 17:00:25 2010 -0500 + + Factorize event handler interruption code + + This will be additionally used by the windows backend which modifies + the fd set frequently. + +commit fc0af8e3f76925ad09e0fbc6d233d500753ee375 +Author: Pete Batard +Date: Sat Jun 5 12:14:19 2010 -0500 + + Abstract low-level event handler operations + + The Windows backend uses something other than UNIX file descriptors + for event handling. Abstract out the operations to allow for this. + +commit 64383fb5b55a74b706967836e81cef61e57df86a +Author: Pete Batard +Date: Tue Jun 1 11:38:14 2010 +0100 + + fixes the possibility of using a broken timercmp on Windows + + Microsoft's implementation of timercmp does not work for >= or <=. + +commit f6d60a9a8fcf06629812da886e3a5de592624b61 +Author: Pete Batard +Date: Mon Feb 1 19:26:13 2010 +0000 + + Switched to standard int pointer type for windows 64-bit compat + + On 64-bit Windows a pointer is 64 bit, but long is still 32 bit for + backwards compatibility. + uintptr_t nicely hides this difference and also works on Linux. + + [dsd: add appropriate include] + +commit a2fa855ce3795e31905b255267874af0603168bc +Author: Michael Plante +Date: Tue Mar 9 16:39:46 2010 -0600 + + added doxygen, dpfp, msvc, and xusb stuff to gitignore + +commit 845d96a9c30b6f053208ed6b5b5d4ad1655e2026 +Author: Daniel Drake +Date: Mon May 31 19:56:34 2010 -0500 + + Add reference counting to default context + + Michael Plante pointed out that if 2 users call libusb_init(NULL) within + a process, we end up creating 2 default contexts, one of which is lost. + + Add reference counting so that the default context is reused and + destroyed only after the last user. + +commit 0e77f017fd3d1bdec4aced0429a380d3e434081b +Author: Daniel Drake +Date: Thu May 27 19:24:49 2010 -0400 + + Fix libusb_init() error handling + + 9996ccaed7 introduced a problem in that mutexes could be destroyed + in the error handling codepath before they had been created. + Pointed out by Michael Plante. + +commit b03de9d07bf9a6b0c4e6cba9ec06b5271a22e621 +Author: Michael Plante +Date: Mon May 24 11:57:10 2010 -0300 + + Modify log functions to compile with MSVC6 + + MSVC6 does not support variadics. + +commit aa77b02da65afb0332b9e6853dae9e4dcda00bfa +Author: Pete Batard +Date: Sun Feb 14 19:46:05 2010 -0600 + + Add type parameter to the list_for_each_entry() and _safe() macros + + typeof() is a GCC extension, not supported by target compilers such + as MSVC. + +commit b92b16f437079208c8dfb1dc2380893846a07ee9 +Author: Daniel Drake +Date: Wed May 19 17:37:29 2010 -0300 + + Fix a usbi_pollfd leak in error path + + I accidently missed this when applying Pete Batard's earlier patch. + Pointed out by Michael Plante. + +commit 8aceb5c99056aaed6e6f2db1b303817e37e9fe8c +Author: Pete Batard +Date: Sun Feb 14 19:47:30 2010 -0600 + + Rename all interface parameters to usb_interface or interface_number + + Remove the use of the ambiguous "interface" where possible without + breaking the API. + 'interface' is a preprocessor #define already associated with COM on Windows, + that can cause a conflict as soon as windows.h is included. + + There are a few more places where interface is still used, which should + be changed for libusb-2.0 + +commit d7031ee8e1c449af23b2674fe18d9fc652c9bd80 +Author: Pete Batard +Date: Mon May 17 19:30:27 2010 -0300 + + Stricter types and casts + +commit 9996ccaed740f8fcec4287a478ccaaa573f9865a +Author: Pete Batard +Date: Mon May 17 19:16:54 2010 -0300 + + Fixes to error handling and exit codepaths + + Various locks and things were being leaked/left open when handling + errors and during deinitialization. + + [dsd: small tweaks] + +commit 371ca4e440894bd1c845971418aa24c9d3919e63 +Author: Nathan Hjelm +Date: Thu May 13 19:38:05 2010 -0300 + + Darwin: Define IO_OBJECT_NULL if not already defined + + Needed on Mac OSX 10.3 + +commit 7ba92cff94bbba19284749c614c26141d3023f37 +Author: Hans Ulrich Niedermann +Date: Fri Jan 29 12:08:52 2010 +0100 + + libusb_cpu_to_le16: macro->static inline function + + The libusb_cpu_to_le16 macro was a ({ ... }) expression, which + generates the following compiler warning every time it is used, + (and that is several times for every #include ): + + libusb.h:880: warning: ISO C forbids braced-groups within expressions + + With this patch, #include stops generating compiler + warnings on gcc 4.4. + + As libusb.h heavily relies on the use of static inline functions + those can be relied on to work properly, and there should not be + any significant difference in the code the compiler generates. + +commit 3473ac6c6fab32202d02d87679ebdb24e7d2df98 +Author: Francesco +Date: Tue Mar 9 16:35:35 2010 -0600 + + Add libusb_strerror() to get short error message in English from enum + + [dsd: small tweaks] + +commit 5b69f3b7b0610d5f518954792ddc93332a41d292 +Author: Michael Plante +Date: Thu Feb 25 19:39:22 2010 -0600 + + Fix libusb_device::lock memory leak + +commit a636df4ca1b87ed3094a87828c022092a80ba613 +Author: Pete Batard +Date: Wed May 12 21:46:31 2010 -0300 + + Whitespace cleanup + +commit 23b5db8b3e353176dfa0635bfb6f0e2658f6e3de +Author: Peter Stuge +Date: Tue May 11 00:51:43 2010 +0100 + + Add internal abstraction for POSIX Threads + + This prepares for a Windows backend without dependency on pthreads-w32. + + pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*. + + A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are + introduced for statically initialized mutexes, since they may be + implemented using other types when pthreads mutexes aren't used. + + Move -pthread from libusb/Makefile.am to host-specific THREAD_CFLAGS in + configure.ac. This will enable optional use of -lpthread for cygwin. + + [dsd: minor tweaks, and roll in a change based on patches from Pete + Batard to only build dpfp_threaded example when we're using pthreads] + +commit a04cbb0095a78aeed3f65aaf06c46069d0ac184a +Author: Daniel Drake +Date: Tue May 4 19:01:59 2010 -0300 + + v1.0.8 release + +commit 53b47299531974fa8901b74a163f3c8ebae4eec9 +Author: Daniel Drake +Date: Thu Apr 22 18:12:51 2010 -0300 + + Linux: don't set SHORT_NOT_OK on bulk out URBs (#20 + + Setting this flag is illegal, and the behaviour we're looking for + is already in place for host-to-device transfers without this flag. + +commit 1519828b7ee1fce46d4c51fc097d52e01b8e0bb4 +Author: Daniel Drake +Date: Tue Apr 20 20:14:09 2010 -0300 + + Linux: Handle failure to read active configuration during enumeration + +commit 45168627cc15aee3875192f34286110dbbd27095 +Author: Nathan Hjelm +Date: Tue Apr 20 19:43:06 2010 -0300 + + Darwin: don't reuse cached descriptors during enumeration + + Descriptor reuse was causing scans to return invalid information when + the device at a location has changed. + +commit 3af329db6dcbfb96d24867c757f9e125e5b7b0e5 +Author: Daniel Drake +Date: Mon Apr 19 19:36:55 2010 -0300 + + v1.0.7 release + +commit ceb8cacd6d2a4189de0db2ee46d45217511c69be +Author: Daniel Drake +Date: Mon Apr 19 19:31:12 2010 -0300 + + Document that fd set contents are an internal implementation detail (#36) + +commit 9bea500b5747bdeba7c8251d45608558e71a1db5 +Author: Martin Koegler +Date: Mon Apr 19 19:22:46 2010 -0300 + + Linux: correct config descriptor endianness fix + + The seek_to_next_config codepath deals with both sysfs and usbfs; + make sure we only convert values in the usbfs path. + +commit 02df59a309e813c50b8230de99e69fb4e1814279 +Author: Martin Koegler +Date: Mon Apr 5 17:11:32 2010 +0200 + + Linux: Fix endianness handling of usbfs config descriptors (#27) + + driver/usb/core/devio.c function usbdev_read translate the follwing files + to CPU endianess: + + le16_to_cpus(&temp_desc.bcdUSB); + le16_to_cpus(&temp_desc.idVendor); + le16_to_cpus(&temp_desc.idProduct); + le16_to_cpus(&temp_desc.bcdDevice); + + All other data is passed without any change. + + libusb/os/linux_usbfs.c calls usbi_parse_descriptor with host_endian=1 + for config descriptors. According to the kernel code, they must be + processed with host_endian=0, as they are not translated by the kernel. + + Signed-off-by: Martin Koegler + +commit ec303b01a5d4e51c000a283853af65059fa62285 +Author: Nathan Hjelm +Date: Tue Mar 23 16:22:08 2010 -0600 + + Darwin: fix enumeration of devices with non-consecutive addresses (#23) + +commit cd809e2f7cee3874b7ae16b2c482a8b63a90e4a5 +Author: Bastien Nocera +Date: Mon Mar 8 10:50:51 2010 +0000 + + Add more interface classes + + As used in bluez. + +commit 1ce4aa67d849f5cad8a21072dc1c7b42158ce817 +Author: Nathan Hjelm +Date: Thu Mar 18 11:32:32 2010 -0600 + + Darwin: Cleanup async callback code, catch request timeouts + +commit 68af9f8d731f700267335941a8214d34ab518cc8 +Author: Nathan Hjelm +Date: Thu Mar 18 11:31:46 2010 -0600 + + Darwin: fix endianness of control setup packet + + IOUSBLib expects the control request to be in host byte order. + Swap the request into host byte order. + +commit cfce4d127184f4e4f334976151a0f80594bb5e22 +Author: Nathan Hjelm +Date: Mon Feb 15 14:10:08 2010 -0600 + + Darwin: fix memory leak in process_device + + Credit to Mike Colagrosso for finding this bug. + +commit 161893cfbefefe315f657677705abe090fc526f2 +Author: Nathan Hjelm +Date: Mon Feb 15 14:09:19 2010 -0600 + + Darwin: use logging functions + + Use usbi_warn, usbi_err, and usbi_info instead of _usbi_log. + +commit 2a72f38548208044dc3aa62681419d006c35732d +Author: Nathan Hjelm +Date: Mon Feb 15 14:07:44 2010 -0600 + + Darwin: support multiple calls to libusb_init + + Credit to Orin Eman for finding this bug. + +commit a4186794d87124503db2f5f51f51ce90bb95daa7 +Author: Daniel Drake +Date: Sun Nov 22 17:20:53 2009 +0000 + + v1.0.6 release + +commit 8392ff22136fccaf1e15d186157609b8dd127bc5 +Author: Ludovic Rousseau +Date: Sun Oct 25 10:06:41 2009 +0100 + + lsusb example: make print_devs() static + + lsusb.c:26: warning: no previous prototype for ‘print_devs’ + +commit 9cc6bfaa15239bb6db1c1570b9beb6df2f848951 +Author: Ludovic Rousseau +Date: Sun Oct 25 10:05:10 2009 +0100 + + Darwin: fix warning in darwin_error_str() + + os/darwin_usb.c:63: warning: return discards qualifiers from pointer + target type + +commit 4c706d2fb6b2c43b10d72ac5dff51cac4d939f1a +Author: Nathan Hjelm +Date: Sat Nov 21 17:06:43 2009 +0000 + + Darwin: allow devices to be opened multiple times + + Allows libusb applications to access multiple interfaces of the same + device in the same application. + + Also fixes a set alt interface bug. + +commit 0232fc559cdacb9561f982dd6d28feb4435b3e4e +Author: Daniel Drake +Date: Sat Nov 21 17:01:32 2009 +0000 + + Increase libusb_handle_events() timeout to 60 seconds + + The internal timing seems to be working, this will be a better test of + it before we make this timeout unlimited. + +commit 0bd7ef5d8697973a026c36c15d6276177b4ec4ea +Author: Daniel Drake +Date: Sat Nov 21 16:57:25 2009 +0000 + + Refine timerfd header check (#18) + + Require glibc-2.9 for the working timerfd support. + +commit 90d8fcab9018b8e6887a7e0592d1e5f692117234 +Author: Daniel Drake +Date: Sun Nov 15 12:17:13 2009 +0000 + + v1.0.5 release + +commit 11d591058e3f105b0e90c23bbf58b18de691e690 +Author: Daniel Drake +Date: Sat Nov 7 10:43:59 2009 +0000 + + Update documentation about early completion caveats + +commit f796c9528a71aa55326b6f0c9c7c5ec073d2bf92 +Author: Ludovic Rousseau +Date: Sun Oct 25 09:59:51 2009 +0100 + + Add libusb_get_max_iso_packet_size() to libusb.h + + core.c:777: warning: no previous prototype for 'libusb_get_max_iso_packet_size' + +commit 4783008b7e711de9cb31631e60dda995f44068de +Author: Daniel Drake +Date: Wed Oct 28 20:33:49 2009 +0545 + + Use timerfd for timeout handling + + Use a new file descriptor from the timerfd system calls to handle + timeouts. On supported systems, this means that there is less hassle + figuring out when the poll() timeout should be, since + libusb_get_next_timeout() will always return 0 and the timeout events will + be triggered as regular activity on the file descriptor set. + + Add API function libusb_pollfds_handle_timeouts() to detect whether + you're on a platform with the timing headache, and flesh out the + surrounding documentation. + +commit 9b120c2b3735566533c179aa8ca758fe45899a38 +Author: Daniel Drake +Date: Sat Nov 7 10:03:07 2009 +0000 + + Use AM_SILENT_RULES for building + +commit ef6ea6c3ae38e4524f10e16e8cb88177d39c4826 +Author: Daniel Drake +Date: Fri Nov 6 21:54:08 2009 +0000 + + v1.0.4 release + +commit 217f57617e0cff0d1bd6d726b243f04c6b179773 +Author: David Moore +Date: Fri Nov 6 21:37:25 2009 +0000 + + Linux: Add support for the new URB_BULK_CONTINUATION flag + + Add support for the new USBDEVFS_URB_BULK_CONTINUATION flag to libusb. + + This flag, which is expected to be available in usbfs starting with + kernel 2.6.32, allows the kernel to cancel multiple URBs upon receipt + of a short packet. This capability allows libusb to preserve data + integrity of large bulk transfers that are split into multiple URBs. + Without this support, these URBs must be canceled in userspace upon + receipt of a short packet, a race condition against future transfers + which might partially fill these canceled URBs. + + This patch automatically detects whether a supported kernel is present + and enables the use of the flag when possible. + + [dsd: tweaks to supported kernel detection, and some inline + documentation of this mechanism] + +commit 69830057547396f893f0d7b3125a05d016313b10 +Author: Daniel Drake +Date: Wed Oct 28 15:13:22 2009 +0545 + + Transfer locking + + At least on Linux, there were some possible races that could occur if + a transfer is cancelled from one thread while another thread is handling + an event for that transfer, or for if a transfer completes while it is + still being submitted from another thread, etc. + + On the global level, transfers could be submitted and cancelled at the + same time. + + Fix those issues with transfer-level locks. + +commit 98f1b30d24359cb3185051b8df9ebb663cc10369 +Author: Daniel Drake +Date: Mon Sep 14 08:01:24 2009 +0100 + + Clarify that timeout 0 means unlimited timeout + +commit 858684f0dd25921e09565034a88709dbf6f6c61b +Author: Daniel Drake +Date: Fri Sep 11 22:09:12 2009 +0100 + + Linux: more flexibility with monotonic clock + + Some users have reported that CLOCK_MONOTONIC does not work on their + systems - I suspect it is available on x86 but perhaps not some + of the more uncommon architectures. We should fall back on + CLOCK_REALTIME in these cases. + + Also, CLOCK_MONOTONIC_RAW seems even more monotonic, so we should use + that if it is available. + + We now test different clock IDs during initialization to find the + best one that works. + +commit fe0d8dce1ed704915d501e7da700440c78144211 +Author: Nathan Hjelm +Date: Fri Sep 11 18:00:29 2009 +0100 + + Darwin: handle overflows + +commit f46716f42040986203fa6e873bfdabe1be2900ec +Author: Daniel Drake +Date: Thu Aug 27 21:14:54 2009 +0545 + + v1.0.3 release + +commit 5b489b8b2a5aba7b8b804e5af6d2628735548238 +Author: Toby Peterson +Date: Sun Aug 23 10:04:59 2009 +0545 + + Darwin: 64-bit type fixes + +commit ad8ae04d0b52009af0b1180e005f7554d2bbb26c +Author: Nathan Hjelm +Date: Sun Aug 23 10:02:55 2009 +0545 + + Darwin: fix crash when reading descriptors after close + + Fix a crash which occurs if the user does the following sequence on a + device: open, close, get_configuration_descriptor. + +commit 45ae2aecf5512dcff059b2a416534e81c6a00c88 +Author: Daniel Drake +Date: Sat Aug 1 13:55:15 2009 +0545 + + move bug info to bug tracker + + Protection needed: http://www.libusb.org/ticket/4 + Losing data: fixed in previous commit + +commit 126129e174062c2a27423817a459e5113f777789 +Author: Daniel Drake +Date: Thu Jul 9 22:09:04 2009 +0100 + + Linux: try harder not to lose any data + + We would previously lose any data that was present on a cancelled URB. + Work harder to make sure this doesn't happen. + +commit 0334ee642b47dfe1ca9db64b22e7702ea14b3f09 +Author: Daniel Drake +Date: Sun Jun 28 19:49:10 2009 +0100 + + Add libusb_get_max_iso_packet_size() + + As pointed out by Dennis Muhlestein, libusb_get_max_packet_size() + doesn't really do what the documentation might suggest because it + does not consider the number of transaction opportunities per + microframe. + + Add a new function to do what is useful for isochronous I/O. + +commit 615f18e64e96ae4ecc8e43d0de00933059a5209a +Author: Daniel Drake +Date: Sat Jun 20 22:33:21 2009 +0100 + + Linux: fix sending of zero length bulk packets + + Note that there are is a kernel bug preventing this from working + properly at the moment, even after this fix. + +commit 86f79fbf61c2018bdf009c7ebf92b38f3a16fd0c +Author: Nathan Hjelm +Date: Fri Jun 19 22:18:44 2009 +0100 + + Darwin: Don't cancel transfers on timeout + + ...because the OS does this for us. + +commit d4bd9ed4de19a9c766f7a23eea8c852cdd61c18f +Author: Daniel Drake +Date: Sun Jun 14 19:23:21 2009 +0100 + + Don't terminate enums with commas + + g++ -pedantic doesn't like this + Reported by Eberhard Mattes + +commit 8be256082eb9bd8e243d89529f742926bb29a21b +Author: Daniel Drake +Date: Sat Jun 13 17:19:07 2009 +0100 + + v1.0.2 release + +commit 060e006e663fd59c281be29b71eb197e02b210e8 +Author: Daniel Drake +Date: Wed Jun 10 21:42:05 2009 +0100 + + Linux: fix config descriptor parsing on big-endian systems + + Multi-byte fields in the configuration descriptors that come back from + usbfs are always in bus endian format. + + Thanks to Joe Jezak for help investigating and fixing this. + +commit c4a905022f684da9a4a853eb9232a81a53df2652 +Author: Nathan Hjelm +Date: Sun Jun 7 22:29:35 2009 +0100 + + Darwin: improve handling of disconnected devices + +commit 6b69f54451762ef590b9c938ab000c07cf9099a3 +Author: Nathan Hjelm +Date: Sun Jun 7 22:26:37 2009 +0100 + + Darwin: fix parsing of config descriptors + + This was a confusion between configuration numbers and zero-based + configuration indexes. + +commit 2b3a9ffa776b383cb2dbc3c55e490e32e4c3c22b +Author: Daniel Drake +Date: Sun Jun 7 22:19:53 2009 +0100 + + Eliminate -Wsign-compare compiler warnings + + This was due to an API inconsistency which can be safely worked around. + Hopefully we'll remember to fix the API next time we come to break + things. + +commit cad5cb55c37137e94e35c74fdabfe42a5cbd229b +Author: David Moore +Date: Wed May 27 23:15:54 2009 -0700 + + Make synchronous transfer APIs robust against signal interruption + + libusb_control_transfer and libusb_bulk_transfer are designed to be + synchronous such that control is not returned until the transfer + definitively succeeds or fails. That assumption is violated if a signal + interrupts these functions because there is no way for the application + to continue waiting for the transfer without resubmitting it. This + patch changes these synchronous APIs so they do not abort in the case of + a signal interruption. + + Signed-off-by: David Moore + +commit b501795985a23109f176d296e7b544b4c6354528 +Author: Alex Vatchenko +Date: Thu May 28 15:58:50 2009 -0400 + + pre-gcc-3.4 compatibility + + The -fvisibility and -Wno-pointer-sign options are not available on + old GCC versions. + +commit 00bb2805e994887f0a754a825c3ce03d22393386 +Author: Daniel Drake +Date: Tue May 26 15:53:26 2009 -0400 + + Fix memory leak in config descriptor parsing + + Pointed out by Martin Koegler. + +commit 068ff5b8a83fec0a9a91c80535a25b89a9ae64e8 +Author: Daniel Drake +Date: Tue May 12 19:20:51 2009 -0400 + + Update AUTHORS + +commit aa24c04e4043e39674b59ff0d302b2365cd0078f +Author: Daniel Drake +Date: Tue May 12 19:03:37 2009 -0400 + + v1.0.1 release + +commit 44767677447fae4267131f99c591b14117486cac +Author: Daniel Drake +Date: Tue May 12 19:01:44 2009 -0400 + + Add BUGS file + + Probably missed a couple of outstanding issues + +commit e0365a6f22e0e7f330ac931df031cf6f17f453d1 +Author: Nathan Hjelm +Date: Sun Mar 22 21:13:29 2009 -0400 + + Darwin: get_config_descriptor bugfixes + +commit 5fd0e8478240fece646a58a3c6114001a73be99f +Author: Daniel Drake +Date: Wed Feb 25 12:33:33 2009 -0300 + + Fix compilation of Darwin backend + + My fault. Reported by ihryamzik@gmail.com + +commit b49f6bf5c910d0fd694ecf165d7927673707bff9 +Author: Nathan Hjelm +Date: Mon Feb 16 21:39:29 2009 -0300 + + Darwin backend + +commit d859158581e9a3250f36cdeeb8ea67cda04053bd +Author: Nathan Hjelm +Date: Mon Feb 16 21:30:49 2009 -0300 + + Make endianness macros endian-independent + + Implementation suggested by David Moore. Needed for proper universal + code support on Darwin. + +commit 9196f58bdc8b9e967261df39865215faa5d39cfa +Author: Nathan Hjelm +Date: Mon Feb 16 21:25:18 2009 -0300 + + Abstract clock reading into OS layer + + This will differ on Linux and Darwin, at least. + + [dsd: minor style tweaks] + +commit e91207860cac09b3afaafc4c14221b78d585c59a +Author: Daniel Drake +Date: Mon Feb 16 21:20:28 2009 -0300 + + Fix endianness in device descriptors + + Pointed out by Nathan Hjelm. + +commit ccf6d3d2f6acf9b9a1cb5e1f1b03f382ae509b17 +Author: Nathan Hjelm +Date: Mon Feb 16 21:13:52 2009 -0300 + + Only link with librt on Linux + + [dsd: tweak configure.ac change] + +commit 894539931e4b4bd85708fe98b956049243cd6fb0 +Author: Hans Ulrich Niedermann +Date: Mon Jan 26 00:31:48 2009 +0100 + + API docs: describe libusb_transfer_cb_fn type + + Add some text describing the libusb_transfer_cb_fn function type + with the semantics I have gathered from reading other parts of + the API docs, referring to the proper section for more details. + + [dsd: tweaked the description slightly] + +commit abe34a2656f8f9f21e53603796c536585e6233ef +Author: Hans Ulrich Niedermann +Date: Sun Jan 25 18:21:59 2009 +0100 + + Make empty array in struct compatible with C99 + + If the compiler is known to be running in C99 mode, + use "flexible array members" ("foo[]"). + + If the compiler is running in any other mode, continue + using the non-standard but widely common "foo[0]" syntax. + +commit 620075c7400764d9bb539b5c02065c45c2e8251e +Author: Hans Ulrich Niedermann +Date: Sun Jan 25 18:20:45 2009 +0100 + + Avoid signedness errors in API docs example code + +commit c754ae294cfe96ec4738d6641137c9e6c56330c7 +Author: Daniel Drake +Date: Sat Jan 17 00:25:40 2009 +0000 + + Decrement poll() result when internal pipe has been handled + + When we receive data on the internal control pipe, we need to correctly + decrement the number of ready file descriptors before passing on the + remaining work to the OS implementation. + +commit b9ca960f2ba271d2b1a58e22b7c70464d69f6c8a +Author: David Moore +Date: Sun Jan 11 21:46:17 2009 -0800 + + Prevent transfer from being submitted twice or improperly canceled + + This ensures that tpriv->urbs and tpriv->iso_urbs are always set to NULL + whenever a transfer is not submitted. In this way, submit_*_transfer() + and cancel_*_transfer() can error check to ensure that the transfer is + in the correct state to be either submitted or canceled, preventing + potential memory leaks or double frees. + + Signed-off-by: David Moore + +commit d2a8ec2da8abcd8f4648ed118da16191011982dd +Author: David Moore +Date: Wed Jan 7 22:31:09 2009 -0800 + + Linux: Fix race condition in cancel_bulk_transfer() + + This fixes a race condition in cancel_bulk_transfer(). In the old + version, awaiting_reap and awaiting_discard are incremented in + cancel_bulk_transfer() and decremented in handle_bulk_completion(). + However, since these events may take place in two different threads, + these variables may reach zero before all URBs have been canceled, + triggered spurious callbacks and duplicate frees. + + This changes the logic to use a single variable "num_retired" to replace + both awaiting_reap and awaiting_discard. num_retired is incremented + only in handle_bulk_completion() and thus there is no race. The handler + will know that all URBs have been canceled when num_retired becomes + equal to num_urbs. + + This change also simplifies a great deal of the logic in both functions + and is a net reduction in the amount of code. + + Note that some variables such as "reap_action" probably need to still be + protected by a mutex, and this patch does not address that issue. + + Signed-off-by: David Moore + +commit 34b9eebe35d8167d43cffb6ad6175f6b2251b572 +Author: Daniel Drake +Date: Sat Dec 13 20:06:49 2008 +0000 + + v1.0.0 release + + It's here! + +commit b1d636dde418dc8fe6a8f037dea0d800e57c6b94 +Author: Mikhail Gusarov +Date: Wed Dec 10 15:24:05 2008 +0600 + + EOL-whitespace fixes + + Signed-off-by: Mikhail Gusarov + +commit 4a9ac382ba5149ae5b3d0962d6a840b5e0dc13aa +Author: Daniel Drake +Date: Tue Dec 9 21:43:37 2008 +0000 + + Linux: fix reading of active configuration + + Shannon Chuang pointed out that we only read 1 byte into an + uninitialized integer, and then return the whole thing. + +commit 81a7310d92461ba7b1d98aeff7c4c007fab07120 +Author: Daniel Drake +Date: Tue Dec 9 21:39:11 2008 +0000 + + Fix double free in descriptor parsing error path + + Pointed out by Shannon Chuang. + +commit 9b4b53453db56ba9c1d707a645bbe6c7a02a3c81 +Author: Daniel Drake +Date: Fri Nov 21 13:28:32 2008 +0000 + + Improvements to multi-threaded I/O system + + Documentation brushed up, and I realised that another function is + needed for tight event handling loops -- they must be able to check + if an open/close operation is trying to interrupt it. + +commit 0e5b0fcb77a90b8bd95ad23669da472af31ef069 +Author: Daniel Drake +Date: Fri Nov 21 11:00:47 2008 +0000 + + SourceForge website upload system changed + +commit a133875e6e2f52eff53ac03f505d59cbdd33e178 +Author: Daniel Drake +Date: Fri Nov 21 10:54:57 2008 +0000 + + v0.9.4 release + +commit c32aa662769b676ff3247778664fccc71fc427ec +Author: Daniel Drake +Date: Thu Nov 20 15:31:10 2008 +0000 + + Pause event handling while opening and closing devices + + Ludovic Rousseau found that crashes often occur if you close a device + while another thread is doing event handling. + + Fix this by adding an internal control pipe, which the close routines + use to interrupt the event handler and obtain the event handling lock, + ensuring that no other thread is handling events while the device is + closed. After the close completes, it signals all the event handlers + to start up again using the usual mechanism. + + Also modified libusb_open() to do a similar thing, so that event + handlers are interrupted in order to realise that a new poll fd has + appeared. + +commit 1d7cf3d0fa8698eae25097cbda1870be90ff6f5e +Author: Bastien Nocera +Date: Thu Oct 30 14:35:23 2008 +0000 + + Add libusb_attach_kernel_driver() + + Add support for re-attaching a driver to a device under Linux. + + [dsd: fixed handling of return value, and added LIBUSB_ERROR_BUSY case] + +commit 914a4e70657c86b5094770aa2d898c978b1cdf41 +Author: Daniel Drake +Date: Sun Nov 2 21:45:54 2008 +0000 + + Linux: handle low-level transfer errors + + Handle more URB error status codes, thanks to Lou and Alan Stern. + +commit d25b566b3b8febafdda4211de724b4727dd4b7e0 +Author: Aurelien Jarno +Date: Thu Sep 4 13:50:49 2008 +0200 + + Support for out-of-tree building + + Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building + for the documentation part. This patch fixes that by using a + doxygen.cfg.in file, which contains @top_srcdir@ to refer to the + location of the libusb source code. + +commit 8674c67ef78e1cf89db1fa584a4304f7c5ddcc5f +Author: Daniel Drake +Date: Sun Nov 2 15:00:39 2008 +0000 + + Document the logging style + + Suggested by Lou. + +commit 94936cbcfe3f02eb65c8b91e29896604316259d8 +Author: Daniel Drake +Date: Wed Aug 27 22:44:24 2008 -0500 + + Async I/O documentation touchups + +commit 2f8f1b1a900f5b9828e5e2ff93c2b26a44fd9de2 +Author: Daniel Drake +Date: Wed Aug 27 21:23:10 2008 -0500 + + Doc: fix typo in events lock section + +commit 046e681e4ac6b697e40458ee0f5baf3cd8763bb0 +Author: Daniel Drake +Date: Sat Aug 23 01:00:21 2008 -0500 + + v0.9.3 release + +commit fec6eaa4eecdf7e0b8299157a5dabef94417f193 +Author: Daniel Drake +Date: Sat Aug 23 00:57:44 2008 -0500 + + Reset internal transfer flags on submit + + This fixes a problem pointed out by Lou, where resubmitting a transfer + that previously timed out never timed out again, as if the timeout had + been set to 0. + +commit 81627bd38900ec9701ab69c141aa51a9abea1f60 +Author: Daniel Drake +Date: Sun Aug 10 17:09:48 2008 -0500 + + Add libusb_get_configuration prototype + + Pointed out by Lou + +commit 1631eaefcc7cdf7047c6b9225618a9aa1b3d87d1 +Author: Daniel Drake +Date: Sat Jul 19 17:51:28 2008 -0500 + + v0.9.2 release + +commit 0d9c40d7f3eee15ada624b5caab2cfb912144fdc +Author: Daniel Drake +Date: Wed Jul 16 09:22:12 2008 -0500 + + Linux: fix sysfs directory handling + + The length of the directory name varies, e.g. when you have nested hubs. + Use dynamic allocation to be able to deal with any length of name. + +commit 66c9847ad54b126ccafd4877292454ab57d0c115 +Author: David Engraf +Date: Wed Jul 16 09:16:38 2008 -0500 + + Linux: correct usage of MAX_PATH + + Thanks to clarification from Artem Egorkine, MAX_PATH already includes + space for the trailing NULL. + +commit 6494f07a6d1b73ce786ae581c4ff691e39e61d19 +Author: Daniel Drake +Date: Tue Jul 8 21:15:54 2008 -0500 + + Linux: fix bulk/iso transfer double-cancellation + + Reset counters to 0 so that it's possible to cancel a transfer twice + without breaking things. Not sure that I want to support this properly, + but this makes it work at least. + +commit 9140f5b414e37a3714cde9c6d6c87c963338a83a +Author: Daniel Drake +Date: Sat Jun 28 21:28:44 2008 -0500 + + v0.9.1 release + +commit 83a029062c1d2bfb584d7a6ee94915583d37464c +Author: Daniel Drake +Date: Sat Jun 28 21:24:49 2008 -0500 + + Add missing GET_CONTEXT() + +commit fbad9a5426f0369394c88987355a8fb06a741ca1 +Author: Daniel Drake +Date: Sat Jun 28 21:18:41 2008 -0500 + + Linux: Compatibility with new sysfs descriptors file + + As of 2.6.26, the descriptors file now includes all descriptors, not + just the active one. + +commit 819e65f880ca43526036e56c65c415042c91f58f +Author: Daniel Drake +Date: Thu Jun 26 22:47:05 2008 -0500 + + Allow user data pointer to be passed through pollfd notification API + +commit 1df713d622ab4f0b03aad72d903ac7beb8fb3b90 +Author: Daniel Drake +Date: Tue Jun 24 23:01:51 2008 -0500 + + Introduce contexts to the API + + Suggested by David Zeuthen. This allows multiple libraries in the same + process to independently use libusb without interfering. + +commit 9818151c60a85aea6af24cb0996a92c3726c9864 +Author: Daniel Drake +Date: Tue Jun 24 21:31:13 2008 -0500 + + Revert "Temporary workaround for event handling serialization issue" + + This reverts commit 2d3a1111caff40ebb87983c861ff548cdc9e5946. + This was based on the assumption that dying threads would automatically + release mutexes, which is not the case. + +commit d5f82893fab3f1c13b1af4ba17aac72479bad7d5 +Author: Daniel Drake +Date: Fri Jun 20 23:04:53 2008 -0500 + + Overflow handling + +commit 546dee211eefbdd280fd1fc9dee84a9b52105078 +Author: Artem Egorkine +Date: Tue Jun 17 18:27:38 2008 -0500 + + a fix for SIGSEGV in handle_bulk_completion() + + We cannot dereference tpriv after calling + usbi_handle_transfer_cancellation() because that function may invoke + the user-supplied callback which may free the transfer. + +commit 947ba8056456a5215724fb502e3e09d50016f699 +Author: Daniel Drake +Date: Mon Jun 16 22:50:50 2008 -0500 + + Refine configuration selection again + + At Alan Stern's suggestion, just offer the bare "set configuration" and + "get configuration" functionality, and let applications worry about the + specific race conditions and unusual situations. + +commit e7a7a49d0331ee0e14145f6e7ec39763b36314ac +Author: Daniel Drake +Date: Sun Jun 15 15:29:38 2008 -0500 + + docs update + + Add a THANKS file, make copyright notices easily accessible, update TODO + +commit 217534e4b396081e038ee5f94c813d1668963673 +Author: Daniel Drake +Date: Sun Jun 15 15:23:29 2008 -0500 + + round up poll timeout + + Pointed out by Richard Röjfors, otherwise we end up busy-looping with + a poll() timeout of 0. + +commit 5ad79b324bc5e11a75a585398a1e81c26f05e758 +Author: Felipe Balbi +Date: Sun Jun 8 12:34:48 2008 +0300 + + fix doc about libusb_open() + + libusb_open() returns int instead of libusb_device_handle. + + Signed-off-by: Felipe Balbi + [dsd: small correction] + +commit 2d3a1111caff40ebb87983c861ff548cdc9e5946 +Author: Daniel Drake +Date: Thu May 29 17:26:26 2008 +0100 + + Temporary workaround for event handling serialization issue + + Ludovic Rousseau pointed out that libusb_unlock_events() is not called + when a thread gets terminated with a signal, meaning that event waiters + will not be woken up in this case. + + Add a temporary hack to libusb_event_handler_active() so that at least + the other threads will realise on the next iteration of their event + handling loop. + + The real fix will likely involve reworking most of this. + +commit 514bb8790cfe8b93ccfff82bc17081b1030acce0 +Author: Daniel Drake +Date: Thu May 29 12:35:01 2008 +0100 + + Refine libusb_set_configuration() semantics + + Applications will generally want to set a configuration before claiming + interfaces. The problem is that the interface may already be set, and + someone else may have claimed an interface (meaning that all calls to + set_configuration will fail, even if it's for the same configuration). + + There are now 2 options: + 1. Use the new libusb_get_configuration() to determine active + configuration before calling libusb_set_configuration() + 2. Or just call libusb_set_configuration() as usual, which will do + nothing if that configuration is already active. + +commit d1292f8e7300051239a7ed2769d221dc7a6f9fca +Author: Daniel Drake +Date: Sun May 25 23:42:42 2008 +0100 + + v0.9.0 release + + First libusb-1.0 beta release + +commit 4cd249388e4ed2ca03f1263984ab67df5030bb65 +Author: Daniel Drake +Date: Sun May 25 22:59:09 2008 +0100 + + Take lock before raising event waiters condition + + This avoids a race between the user checking for active event handler + and then blocking on the condition variable + +commit 7c525480ab3c4db9205bfe30bb0d2bef9096c444 +Author: Daniel Drake +Date: Fri May 23 15:57:07 2008 +0100 + + Implement serialization of event handlers + + Now offers a mechanism to wait for events while another thread is + doing the event handling. Complicates things for MT async apps, but + then again it's a bit of a tricky combination to start with. + +commit ff0660a415ecfd0879600eaad1c5899b6d93a30a +Author: Daniel Drake +Date: Sat May 24 21:28:31 2008 +0100 + + allow LIBUSB_DEBUG env var to control message verbosity at runtime + + Based on ideas from Ludovic Rousseau + +commit 4d788967e3f8d75eaf3a1ac1ee8e2e8bed0601c1 +Author: Daniel Drake +Date: Fri May 23 15:58:11 2008 +0100 + + don't print messages by default + + Add libusb_set_debug() API to set message verbosity. + + Ludovic Rousseau pointed out that applications may close stdout/stderr + descriptors, which might then be reused. + +commit bef33bb9eba0da04ee7488d9cd5e6ab12bc61c0c +Author: Daniel Drake +Date: Mon May 19 15:43:27 2008 +0100 + + Fix memory leak in libusb_control_transfer + + Pointed out by David Engraf: we weren't freeing the transfer buffer + +commit a345bacb6f07ebb2122402041a9e8092d4a20a4d +Author: David Engraf +Date: Mon May 19 15:16:32 2008 +0100 + + Linux: fix handling of ioctl failure + + The return value of some ioctl commands in linux_usbfs.c are not + handeled correct. The ioctl function returns != 0 and errno is set with + the error code. + +commit e44396a458ecea9e5edd9a7577e617571c76860d +Author: David Engraf +Date: Mon May 19 15:13:38 2008 +0100 + + critical memory leak in handle_events + + This patch closes a critical memory leak in handle_events. The fds + variable is malloced but never freed. When I'm calling + handle_events with a timeout of 0, my system runs out of memory after a + few seconds. + +commit eb25630f52bc9848b444e439632c899977d887b0 +Author: Daniel Drake +Date: Fri May 16 23:50:20 2008 +0100 + + More informative libusb_open() return code + + Hopefully one of the last API tweaks... + +commit 2b2e9c40b195261b09ac52ebdb93eef25c79de90 +Author: Daniel Drake +Date: Fri May 16 22:37:56 2008 +0100 + + Fix endianness with descriptor handling + + Alan Stern pointed out that usbfs gives host-endian data, but sysfs gives + bus-endian. + +commit 1298c51f516a7bf04ca9add1b7db14417cdc66f3 +Author: Daniel Drake +Date: Mon May 12 18:46:37 2008 +0100 + + Backend documentation for porting efforts + + Hopefully comprehensive enough for people to get started. + +commit ade26afc42c34ceb1c45afcadd2ea5e8240eaca4 +Author: Daniel Drake +Date: Mon May 12 15:43:30 2008 +0100 + + Linux: fix caching of guessed configuration + + Reported and tested by Xiaofan Chen + +commit e25d590a9198995b4f0b6afeb41ecae318715e7e +Author: Rob Walker +Date: Sun May 11 21:14:18 2008 +0100 + + Linux: fix bulk transfer early completion + + We were forgetting about the remaining urbs when a non-final urb + completed early. + + [dsd: some touchups and a warning message for a corner case that we don't handle] + +commit fec7c84163e25b8f811632828334d75da82bcb16 +Author: Daniel Drake +Date: Sun May 11 20:31:58 2008 +0100 + + Handle hot-unplugging + + This involved moving from select() to poll() because there is no way to + distinguish usbfs's POLLERR condition with select(). + +commit aeb905fa5d78cdbba80a680aa7a2bb7338f27f65 +Author: Daniel Drake +Date: Sun May 11 16:04:35 2008 +0100 + + Documentation work + +commit ba5d9a45c06311204f51faef41d1ee215bb5b823 +Author: Daniel Drake +Date: Sun May 11 15:36:24 2008 +0100 + + Endianness of control setup packets + + Document behaviour where host-endian and bus-endian (little) should be + used respectively. + + Also remove packed attribute from libusb_control_setup as all fields + are naturally aligned. + +commit 7bedc3b2683f35ee1dd39a2ebe0ec05be0019f38 +Author: Daniel Drake +Date: Sun May 11 15:11:59 2008 +0100 + + Document that releasing interface causes SET_INTERFACE control request + +commit f2ede9876cd4f5cfa7751b975670fa449187fe3d +Author: Daniel Drake +Date: Sat May 10 21:45:42 2008 +0100 + + Support unconfigured devices + +commit 8ebb4ccdfaf5f095a1c38787d909d280ea64405c +Author: Daniel Drake +Date: Sat May 10 20:56:44 2008 +0100 + + Linux: fix caching of active configuration for non-sysfs + +commit c3844f7aeb2176636ce6e6ef697659fdb0b30048 +Author: Daniel Drake +Date: Sat May 10 14:42:43 2008 +0100 + + Fetch configurations by index (not value) + + Otherwise there is no way to know which values to look for. + +commit d77052c0d630e33737c38d601fd633155f6b2229 +Author: Daniel Drake +Date: Sat May 10 00:12:53 2008 +0100 + + Linux: comprehensive sysfs vs usbfs access + + Be more flexible when certain parts of sysfs are not available. + +commit 74bc842bac1a32a26323da6c3e8af2f66e1b5cfa +Author: Daniel Drake +Date: Fri May 9 19:38:13 2008 +0100 + + Linux: no need to store usbfs node path + + This can be computed from bus number and device address + +commit fe4adcc99e30115204ab832ad3e0170c9aca7629 +Author: Daniel Drake +Date: Fri May 9 14:34:31 2008 +0100 + + Rework configuration handling + + libusb no longer caches descriptors in libusb_device but backends are + intended to be able to provide copies from memory. In the common linux + case we can use sysfs. + +commit 5741bfe01a2481b8c3830c80edc3637bf62a7e16 +Author: Daniel Drake +Date: Fri May 9 14:36:14 2008 +0100 + + libusb_get_device_list() can return negative error code + +commit 45413101b78298e9332b22a34bc6bc159000ad8a +Author: Daniel Drake +Date: Thu May 8 23:09:21 2008 +0100 + + Linux: fix clear_halt implementation + + The ioctl expects an integer. + Bug found with the assistance of Soumen Mondal + +commit 10d4e427cc171dfd6ad7f43a33ce3cfebcd7aa04 +Author: Daniel Drake +Date: Thu May 8 23:04:52 2008 +0100 + + Documentation work + + Partially based on some libusb-devel discussions + +commit ded0a249322571a075e3ed3528021864247dfa55 +Author: Daniel Drake +Date: Mon May 5 22:57:48 2008 +0100 + + Linux: enumerate devices and descriptors from sysfs + + Suggested by Alan Stern. This avoids waking up any suspended USB devices. + sysfs is not available on all systems, so the usbfs mechanism is still + in place as a fallback. + +commit 885c2a5de69d6b7d8902bb55d6d83680a5a1a6e5 +Author: Daniel Drake +Date: Mon May 5 21:34:31 2008 +0100 + + documentation touchups + +commit 59c205d542b43d79fe28622dbe8f03a3a3300b6f +Author: Daniel Drake +Date: Mon May 5 21:17:03 2008 +0100 + + more error code sanitization + +commit 88055d4b5913102a90ff666f75fd922c74860dc5 +Author: Daniel Drake +Date: Mon May 5 20:57:43 2008 +0100 + + Isochronous transfer helper functions + +commit a95c943ed301dcd20e92b0b3b255568899a4c42e +Author: Daniel Drake +Date: Mon May 5 17:54:33 2008 +0100 + + free open devices on exit + +commit b27fff633843824744df7d334cb89ece329cafa6 +Author: Daniel Drake +Date: Mon May 5 17:47:49 2008 +0100 + + move descriptor parsing into main library + + OS modules now provide functionality for fetching device/config + descriptors + +commit a304eca71f22c6df7d70a901483b30f1b8e93378 +Author: Daniel Drake +Date: Mon May 5 16:22:33 2008 +0100 + + Detect endpoint halts and unsupported control requests + +commit 7da521954ba661d3f537440c31a84b66e974d56b +Author: Daniel Drake +Date: Mon May 5 01:00:31 2008 +0100 + + Linux: fix logical URB allocation + + We were allocating the wrong number of URBs for transfers of size + multiples of 16k. + +commit 470b1bc42bf53373ce678fc76bab9160a54d6881 +Author: Daniel Drake +Date: Sun May 4 16:51:23 2008 +0100 + + add functionality for querying and detaching kernel driver + +commit 17ecfb0ecc833596c43755c80d461cddb9b3b0d7 +Author: Daniel Drake +Date: Sun May 4 16:20:46 2008 +0100 + + Descriptor reading functionality + +commit bdce367d1bd8691465844b2411c85215498f517d +Author: Daniel Drake +Date: Sun May 4 14:22:16 2008 +0100 + + sanitized error returns from synchronous I/O functions + +commit bfe74e9cd9c17a40fff042ea0647326f51cfecae +Author: Daniel Drake +Date: Sun May 4 14:10:19 2008 +0100 + + implement libusb_reset_device() + +commit c01f744ce07bbeccbe353e956479f0cc5a811a6f +Author: Daniel Drake +Date: Sun May 4 13:46:41 2008 +0100 + + Add functionality to clear endpoint halt conditions + +commit 5878daa85e3364bb3885190425d4f9deaa2d8c36 +Author: Daniel Drake +Date: Sun May 4 00:51:59 2008 +0100 + + Fix libusb_get_device_list return value + + It was documented to return the list length, but was returning 0. + +commit a74106a9b48b88bae0e099be34a18d653a8f1238 +Author: Daniel Drake +Date: Sat May 3 16:50:58 2008 +0100 + + Well-defined error codes for some operations + + Also renamed set_interface_altsetting to set_interface_alt_setting for + better consistency + +commit 0f463fe671455670efcf4a93e526b2a9082b0afe +Author: Daniel Drake +Date: Sat May 3 16:24:11 2008 +0100 + + Add libusb_set_configuration() + +commit e65608994f795f97e4d6adac20329ca08709db2d +Author: Daniel Drake +Date: Sat May 3 15:40:23 2008 +0100 + + rename LIBUSB_ERROR_NOMEM to LIBUSB_ERROR_NO_MEM + improves consistency + +commit 5384bbf300779e7936eac9ebd33ee38f5b533f8e +Author: Daniel Drake +Date: Sat May 3 14:34:54 2008 +0100 + + Linux: better EACCES handling + +commit 1936eeeba3f933a078df1005cc7c1533a8ec2bac +Author: Daniel Drake +Date: Sat May 3 14:26:56 2008 +0100 + + Rename reference counting API + + This improves consistency with the naming style of other functions + +commit e2f822b4f17342f614ab2455179a80975fca6cb0 +Author: Daniel Drake +Date: Sat May 3 14:24:40 2008 +0100 + + Linux: use read-only access to enumerate devices and descriptors + + Write access is not needed until later. + Also fix handling of open() error code. + +commit 81204eed3d0a7744b89b68bd90d567b68d191a91 +Author: Daniel Drake +Date: Fri May 2 17:45:23 2008 +0100 + + document pollfd notifiers + +commit e20f8281fb7da32587f81b5eea5818af1eab0fe0 +Author: Daniel Drake +Date: Fri May 2 17:33:52 2008 +0100 + + Allow multiple interfaces to be claimed + +commit 66685ff25d81a1f1a2a3dbda882d407638d00672 +Author: Daniel Drake +Date: Fri May 2 16:55:36 2008 +0100 + + Documentation improvements + +commit 55bce39cbe0c9746a428b66751d1afe551d86381 +Author: Daniel Drake +Date: Fri May 2 12:55:34 2008 +0100 + + detect short descriptor reads + +commit f3f17846dcced6b2dc40f899ed6a2aba151c264b +Author: Daniel Drake +Date: Fri May 2 12:32:46 2008 +0100 + + remove "references" and "referenced by" listings in documentation + +commit fbb017dd9a26ce449578482b95157b3c850fa446 +Author: Daniel Drake +Date: Fri May 2 12:32:08 2008 +0100 + + Use typedef ptr types in parameters and return types + + This is passed through to the docs + +commit 3675e978fb7a1042f8601931255658bcd14a2298 +Author: Daniel Drake +Date: Fri May 2 12:28:31 2008 +0100 + + Expose bus number and device address + +commit 2012898ffc492317cb428d97077bf5ee0e98e1da +Author: Daniel Drake +Date: Tue Apr 29 15:26:46 2008 +0100 + + standardised error codes + +commit 0269c75ae3de7acb2dc555e45928750e35fdb320 +Author: Daniel Drake +Date: Tue Apr 29 13:34:26 2008 +0100 + + Fix descriptor handling memory leaks + +commit d3ab4e3bd4068cba41c1e12c4b175018dc3cb343 +Author: Daniel Drake +Date: Sun Apr 27 23:50:01 2008 +0100 + + Rename endpoint_type to transfer_type + + Matches the USB specs more closely + +commit 379e90e0fdcef6f4db1849fa0a7fd524407cf564 +Author: Daniel Drake +Date: Sun Apr 27 23:41:24 2008 +0100 + + Remove a FIXME comment + + it can't. + +commit 2ddf81420557d016bbcbf28dda0d8d1c64d16264 +Author: Daniel Drake +Date: Sun Apr 27 23:30:34 2008 +0100 + + Fix unlocked flying_transfers list access + +commit 7ac0a405b4c57db42e88cbcba5f135697f03b646 +Author: Daniel Drake +Date: Sun Apr 27 23:27:04 2008 +0100 + + Remove libusb_cancel_transfer_sync + + This wasn't a particularly nice API. Cancellation should be handled by + the completion handler. + +commit a5006fd7b9dae6f1db7969c8744086ba3a7c027b +Author: Daniel Drake +Date: Sun Apr 27 19:56:02 2008 +0100 + + remove extra timeout check + + If select() didn't timeout then don't check for more timeouts + +commit 3bdafaa359d9c65e1af360b5338e1f25528a8066 +Author: Daniel Drake +Date: Sun Apr 27 19:53:51 2008 +0100 + + Documentation touchups + + Detail that interrupt polling interval is fixed to endpoint bInterval, + and that data may be transferred even on a timeout condition. + +commit e12618c79d520955b1abf80a277e881d91907162 +Author: Daniel Drake +Date: Sat Apr 19 16:17:53 2008 +0100 + + add threaded example program + +commit 1fcdb0678b759569db7cd530457dbc0a5f86fb1d +Author: Daniel Drake +Date: Fri Apr 18 23:58:54 2008 +0100 + + libusb_device mutex protection + +commit 0efd2efa65d5513e5754d717d522b2c5c45332e2 +Author: Daniel Drake +Date: Fri Apr 18 23:42:40 2008 +0100 + + mutex protection for device and handle lists + +commit d2ff2b14a15e5099ff0214502944de30f141a39c +Author: Daniel Drake +Date: Fri Apr 18 20:00:31 2008 +0100 + + lock flying_transfers during transfer removal + +commit 2569980762cb66804da31e54bef243702da8dfe9 +Author: Daniel Drake +Date: Fri Apr 18 19:59:56 2008 +0100 + + pollfds mutex protection + +commit f5a33e08ec0da51ccb5e95a5adec50c5211a9bf5 +Author: Daniel Drake +Date: Thu Apr 17 18:24:54 2008 +0100 + + flying_transfers mutex protection + + This marks the beginnings of thread safety + +commit 85e1994123545125ce0653415d122f9790f8d041 +Author: Daniel Drake +Date: Thu Apr 17 17:44:28 2008 +0100 + + Linux: fix control transfer cancellation + +commit cf9b831f7bfd97ba88721c1d934aeda522f3692c +Author: Daniel Drake +Date: Mon Apr 14 20:03:27 2008 +0100 + + set correct endpoint type for isochronous transfers + + Pointed out by Felix Domke + +commit ad6e2b712c5b54af44424e58a2776686314e26b7 +Author: Daniel Drake +Date: Fri Apr 11 21:40:07 2008 +0100 + + Linux: fire multiple URBs at once for split transfers + + This results in a significant performance increase for bulk transfers + larger than 16kb, and fixes a bug where data would be spliced and mixed + between two simultaneously submitted transfers to the same endpoint. + + It also allows isochronous transfers larger than 16kb to be submitted. + + This commit also improves cancellation - the library now understands + what is going on. + +commit d9b2ce2894ed43d34de6850f2dac50ccabf1db55 +Author: Daniel Drake +Date: Tue Apr 1 23:28:32 2008 +0100 + + Constify some return data + + Make it clear that apps should not mess with these structures + +commit 8d809854e2b19c2b7c27ab05e5d76b34e2a5cead +Author: Daniel Drake +Date: Sun Mar 30 22:19:00 2008 +0100 + + Rename libusb_poll() to libusb_handle_events() + +commit 211f80c9f2a4a58cd2bbf5b7751f45089c8961e7 +Author: Daniel Drake +Date: Tue Mar 25 16:24:30 2008 +0000 + + Isochronous endpoint I/O + + Due to variable-sized structures, this involved changing allocation + mechanism. All transfers must now be allocated and freed through + libusb. + + A synchronous function is missing, and I could do with writing a few + more helper functions to simplify things. + +commit b1ade6fca668d8aa156d5b5bf3a933f116144dc2 +Author: Daniel Drake +Date: Sun Mar 23 21:17:32 2008 +0000 + + distcheck fix for docs + +commit 62077b7fa5b222e1bb9dea3467585aed69d596e2 +Author: Daniel Drake +Date: Sun Mar 23 21:13:14 2008 +0000 + + Support for changing altsetting + + Will probably be suject to later consideration w.r.t. claiming of endpoints + +commit 0499e9f418607b5786ac0c3e97bc46737a609ca3 +Author: Daniel Drake +Date: Thu Mar 20 21:10:01 2008 +0000 + + it's called bmRequestType + +commit 88884ae4bbe721dac117d5190303cb67852fa5d3 +Author: Daniel Drake +Date: Thu Mar 20 21:07:00 2008 +0000 + + Save transfer flags before invoking callback + + The callback may free the transfer, in which case we can't read the flags + after it has returned. + +commit ead09cde6895df0034a685516987ce253575e9a7 +Author: Daniel Drake +Date: Sat Mar 15 16:35:12 2008 +0000 + + API documentation + + Hopefully mostly complete. Some constants were renamed and move into + enums. + +commit 285724cc14ea5f993e2c4c92fe0aaf6c335bc139 +Author: Vasily Khoruzhick +Date: Sat Mar 15 13:50:53 2008 +0200 + + Fix get_device_list for realloc case + + get_device_list can modify pointer passed to it with realloc, but this + case wasn't handled and caused crash on my machine. Fixed + + Signed-off-by: Vasily Khoruzhick + +commit c0c9432d38b22784070dce3a7874c62c31786a27 +Author: Daniel Drake +Date: Thu Mar 13 12:36:56 2008 +0000 + + Beginnings of cross-platform abstraction + + This also includes a libusb_get_pollfds API change + +commit de4c5341d168697baa4c0901c406deb47e78aae7 +Author: Daniel Drake +Date: Mon Mar 10 18:38:15 2008 +0000 + + Add transfer flags + +commit aae05f688dc26a013166ab9436fd25018b49d76a +Author: Daniel Drake +Date: Mon Mar 10 11:32:15 2008 +0000 + + Simplify libusb_fill_control_transfer() + + Transfer length can be inferred from the setup packet. + +commit 7c5ea95297c2f3f6afc42f60c1bf1bef777bb1fb +Author: Daniel Drake +Date: Mon Mar 10 11:29:24 2008 +0000 + + get_device fixup + + Rename API away from "devh" and fix implementation to match header + +commit 9e89d1aa82cbe7e21672ee3e2e545238fffc5318 +Author: Daniel Drake +Date: Sun Mar 9 16:27:06 2008 +0000 + + Rename descriptor-getting functions + + Based on feedback from Tim Roberts + +commit 283ae96c3ccbcee1c3950fce18ae47093ae8200e +Author: Daniel Drake +Date: Sun Mar 9 16:15:02 2008 +0000 + + Simplify cancellation API + + No need to provide the device here. + +commit ebad1c79688ba603ad017ed0fe2f3c0dc8edd1ad +Author: Daniel Drake +Date: Sun Mar 9 16:12:08 2008 +0000 + + Rename libusb_dev_handle to libusb_device_handle + +commit 1ac0a7d88f282b6f293c456fac8edb143cbaca3d +Author: Daniel Drake +Date: Sun Mar 9 01:01:57 2008 +0000 + + Move synchronous I/O implementation to its own file + +commit 66348c90ea4570bf999ac301089e006d0cce1926 +Author: Daniel Drake +Date: Sun Mar 9 00:58:09 2008 +0000 + + Separate transfer allocation and submission + + Leads to some hefty API changes. Now we're much more similar to the + Linux kernel model. + + Problems with dealing with asynchronous control transfers are passed + on to the user, basically you must allocate a buffer, start with the + setup, and put the data after. This won't make much sense until + documented (soon...) + +commit d21ebe47ce578c93cd8969be1c933d503e32e5d4 +Author: Daniel Drake +Date: Sat Mar 8 12:48:35 2008 +0000 + + Rework URB API naming + + Now refer to everything as "transfers" as consistent with the USB spec + libusb_transfer is now a kind of transfer handle. To reduce confusion + with libusb_bulk_transfer and libusb_control_transfer, those have been + renamed to libusb_{control,bulk}_transfer_request. + +commit fd6fb3cc093ad47271353a0e468d16547f991382 +Author: Daniel Drake +Date: Sat Mar 8 11:53:33 2008 +0000 + + Add fallback on /proc/bus/usb + + /dev/bus/usb is a relatively new thing probably not present on every + system + +commit f3fdf447916289cd92b7190377681894e8ab611a +Author: Daniel Drake +Date: Sat Mar 8 00:10:16 2008 +0000 + + Persistent libusb_device storage + + Devices are now assigned a session ID (currently busnum:devaddr) which + is used to distinguish unique devices. + + Now multiple callers of libusb_get_device_list will get the same + libusb_device structure instances. + +commit 23f8fb8bafeeda93ce234cb40eb7219d2e36c19c +Author: Daniel Drake +Date: Thu Mar 6 23:43:57 2008 +0000 + + Add convenience function to find and open a device by USB VID+PID + + Lots of libusb apps I write are simple test apps not intended to be real + apps. Having a function available to quickly locate my device will be + handy in such situations. + +commit 9cfdb494fccac53a4277da7c8b6d15f1a72a4959 +Author: Daniel Drake +Date: Thu Mar 6 23:25:20 2008 +0000 + + Rework device discovery API + + libusb_find_devices and libusb_get_devices are no more + + libusb_get_device_list obtains a list of libusb_device structures for all + known devices in the system. + + Each libusb_device now has a reference count, defaulting to 1 on + instantiation. The reference count of 1 refers to the fact that it is + present in the list in this scenario. + + Opening a device adds a pointer to the libusb_device structure in the + handle, so that also adds a reference. Closing the device removes that + reference. + + The function to free the device list can optionally unref all the devices + inside. + + In future we will make the libusb_device instances all "global" so that if + the app calls get_device_list twice it actually gets the same libusb_device + structure references back. This way we can start to track disconnects, and + we can investigate adding a unique "session ID" to each libusb_device, an + identifier guaranteed to be unique to that device until reboot. + +commit 77cea822788e024c848c7f554915f771a2dc1e0f +Author: Daniel Drake +Date: Thu Mar 6 17:05:04 2008 +0000 + + Remove ctrl debug code + + This was unintentionally committed + +commit b873521a6f575628d535f89278bb67888004d0ca +Author: Daniel Drake +Date: Tue Feb 26 22:11:34 2008 +0000 + + Notifications for changes to the fd set + + Applications can now be notified when they should start and stop polling + new file descriptors. + +commit ca66e16a370c828d08a5bc3f9f203db145c81a4c +Author: Daniel Drake +Date: Fri Feb 1 12:20:20 2008 +0000 + + Fix header installation path + +commit e583100a4086c411093eef5c450880b965df6b1b +Author: Daniel Drake +Date: Wed Jan 30 13:24:54 2008 +0000 + + TODO update + +commit 637a8d7ff8a11a23588925d9d3003a609bda8075 +Author: Daniel Drake +Date: Wed Jan 30 13:19:10 2008 +0000 + + Remove timers and signalfd + + Instead of timers, add a mechanism for informing the parent app when the + next timeout is due to happen, so that it can call us at that time. + + As we no longer use signals, signalfd has also been removed. + +commit 8c56abe2e13ed4dd8c15737c21be7b6b1e5cf2ac +Author: Daniel Drake +Date: Sat Jan 26 18:16:56 2008 +0000 + + Poll usbfs descriptors directly + + We don't need to use signalfd for this functionality because we can poll + the file descriptors for write events. + +commit e3ce855acec33d37dd833bca5dad5e8c3773003a +Author: Daniel Drake +Date: Sat Jan 26 17:26:40 2008 +0000 + + Fix dpfp example compilation + +commit 1d41a5cda2fefe826877ee4445199af30aa188b7 +Author: Daniel Drake +Date: Sat Jan 26 17:22:53 2008 +0000 + + C++ header safety + + Pointed out by JF + +commit 37b7f9a112eb1441d352467f661205b8872d0553 +Author: Daniel Drake +Date: Sat Jan 26 14:03:43 2008 +0000 + + Only use -fgnu89-inline when supported + + J F pointed out that this option only works on gcc 4.3 and newer. + +commit e3a09ca0b9cb6f46d54a0130f678c6097240a2bd +Author: Daniel Drake +Date: Sat Jan 5 21:59:40 2008 +0000 + + Remove more fpusb remnants + +commit dcd5e0075fa84601d997d29bb60bc8370b97a375 +Author: Daniel Drake +Date: Fri Jan 4 01:19:07 2008 +0000 + + TODO update + + Start listing the things I want to discuss/reconsider before 1.0 API + is final. + +commit de53d972ed9c1f21f86ffd585560520e986f212c +Author: Daniel Drake +Date: Fri Jan 4 01:17:06 2008 +0000 + + Rename some _devh_ functions + + Decided against naming functions in this style based on advice from + Tim Roberts. Still not really sure about devh naming in general. + +commit 132d84bf8ae34bd0892b3d8207a53d87cc0a9cba +Author: Daniel Drake +Date: Fri Jan 4 01:13:25 2008 +0000 + + Use "transfer" instead of "msg" + + Based on a discussion with Tim Roberts. + +commit ea6af58a8643137eb01eeb7d2f65404e390feb1b +Author: Daniel Drake +Date: Fri Jan 4 00:57:00 2008 +0000 + + Plural of bus is busses + + SF #1633043 + +commit dbb3fd871e3972b4e670f3161e7cd2f58f357600 +Author: Daniel Drake +Date: Fri Jan 4 00:54:57 2008 +0000 + + API renaming: remove fpi and usb_ stuff + + fpi changed to usbi. + + We should not expose structures with prefix "usb_" in the public + namespace as it is quite likely there will be some conflict somewhere. + Instead, using "libusb_" should be safer. + +commit e9364d72151ae1de9cce4175f330fe1529f02511 +Author: Daniel Drake +Date: Fri Jan 4 00:40:49 2008 +0000 + + Rename to libusb-1.0 + + I've taken over the libusb project, and what was previously known as fpusb + will eventually be released as libusb-1.0. + +commit f4ed0b6a3e0a20555fdfc9e9b8be7e8a2c8ae192 +Author: Daniel Drake +Date: Sun Dec 30 22:09:50 2007 +0000 + + Compiler flags update + + Also fix some warnings + +commit d3d671efe27491baf1d2ceadbfeeb4e7428d6f9a +Author: Daniel Drake +Date: Sun Dec 30 22:05:17 2007 +0000 + + Fix signalfd structure size on x86 + + ptr is a 64-bit value + +commit dfac6756faad76071a92945e3e3a16b8a841a7ea +Author: Daniel Drake +Date: Wed Dec 12 23:32:54 2007 +0000 + + Don't pass ctrl_msg/bulk_msg structures through async paths + + These are easiest to construct on the stack, but in the async case it is + likely that the submitting function returns (hence stack is destroyed) + before URB completion. + +commit a8d2881eb7c273892acf2ff6e1f3f552631d1d11 +Author: Daniel Drake +Date: Mon Dec 3 23:29:22 2007 +0000 + + Add functionality to access device descriptors + +commit b5a7a411087b37a6bf56b4688a9e3290daaed153 +Author: Daniel Drake +Date: Mon Dec 3 22:27:21 2007 +0000 + + Rename fpusb_device_handle functions to devh + + Prevents confusion with functions that work on fpusb_dev structures. + +commit eacf4505a473df0f521d1b69d5b45448f0709e2d +Author: Daniel Drake +Date: Sun Dec 2 23:16:57 2007 +0000 + + Add API to access poll fd + + Almost forgot... :) + +commit 852bba4754ec57679c823f33e8feba6e4a564cbe +Author: Daniel Drake +Date: Wed Nov 28 13:48:45 2007 +0000 + + Initial commit + + Basic library structure which supports enumerating detected USB devices diff --git a/thirdparty/libusb/libusb-1.0.9/INSTALL b/thirdparty/libusb/libusb-1.0.9/INSTALL new file mode 100644 index 0000000..5458714 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/thirdparty/libusb/libusb-1.0.9/Makefile.am b/thirdparty/libusb/libusb-1.0.9/Makefile.am new file mode 100644 index 0000000..ce7b7e2 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/Makefile.am @@ -0,0 +1,28 @@ +AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip +ACLOCAL_AMFLAGS = -I m4 +DISTCLEANFILES = libusb-1.0.pc +MAINTAINERCLEANFILES = ChangeLog +EXTRA_DIST = TODO PORTING msvc +SUBDIRS = libusb doc + +if BUILD_EXAMPLES +SUBDIRS += examples +endif + +pkgconfigdir=$(libdir)/pkgconfig +pkgconfig_DATA=libusb-1.0.pc + +.PHONY: ChangeLog dist-up +ChangeLog: + git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog + +dist-hook: ChangeLog + +reldir = .release/$(distdir) +dist-up: dist + rm -rf $(reldir) + mkdir -p $(reldir) + cp $(distdir).tar.bz2 $(reldir) + rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/ + rm -rf $(reldir) + diff --git a/thirdparty/libusb/libusb-1.0.9/Makefile.in b/thirdparty/libusb/libusb-1.0.9/Makefile.in new file mode 100644 index 0000000..733b784 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/Makefile.in @@ -0,0 +1,807 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@BUILD_EXAMPLES_TRUE@am__append_1 = examples +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libusb-1.0.pc.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS THANKS TODO compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libusb/version.h \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libusb-1.0.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = libusb doc examples +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.bz2 +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip +ACLOCAL_AMFLAGS = -I m4 +DISTCLEANFILES = libusb-1.0.pc +MAINTAINERCLEANFILES = ChangeLog +EXTRA_DIST = TODO PORTING msvc +SUBDIRS = libusb doc $(am__append_1) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libusb-1.0.pc +reldir = .release/$(distdir) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libusb-1.0.pc: $(top_builddir)/config.status $(srcdir)/libusb-1.0.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-pkgconfigDATA + + +.PHONY: ChangeLog dist-up +ChangeLog: + git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog + +dist-hook: ChangeLog +dist-up: dist + rm -rf $(reldir) + mkdir -p $(reldir) + cp $(distdir).tar.bz2 $(reldir) + rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/ + rm -rf $(reldir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/libusb/libusb-1.0.9/NEWS b/thirdparty/libusb/libusb-1.0.9/NEWS new file mode 100644 index 0000000..f948700 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/NEWS @@ -0,0 +1,65 @@ +This file lists notable changes in each release. For the full history of all +changes, see ChangeLog. + +2012-04-20: 1.0.9 +* Numerous bug fixes and improvements +* Backend for Windows, for devices using the WinUSB.sys driver +* Backend for OpenBSD and NetBSD, for devices using the ugen driver +* Add libusb_get_device_speed() +* Add libusb_has_capability() +* Add libusb_error_name() +* Add libusb_get_version() + +2010-05-07: v1.0.8 +* Bug fixes + +2010-04-19: v1.0.7 +* Bug fixes and documentation tweaks +* Add more interface class definitions + +2009-11-22: v1.0.6 +* Bug fixes +* Increase libusb_handle_events() timeout to 60s for powersaving + +2009-11-15: v1.0.5 + * Use timerfd when available for timer management + * Small fixes/updates + +2009-11-06: v1.0.4 release + * Bug fixes including transfer locking to fix some potential threading races + * More flexibility with clock types on Linux + * Use new bulk continuation tracking in Linux 2.6.32 for improved handling + of short/failed transfers + +2009-08-27: v1.0.3 release + * Bug fixes + * Add libusb_get_max_iso_packet_size() + +2009-06-13: v1.0.2 release + * Bug fixes + +2009-05-12: v1.0.1 release + * Bug fixes + * Darwin backend + +2008-12-13: v1.0.0 release + * Bug fixes + +2008-11-21: v0.9.4 release + * Bug fixes + * Add libusb_attach_kernel_driver() + +2008-08-23: v0.9.3 release + * Bug fixes + +2008-07-19: v0.9.2 release + * Bug fixes + +2008-06-28: v0.9.1 release + * Bug fixes + * Introduce contexts to the API + * Compatibility with new Linux kernel features + +2008-05-25: v0.9.0 release + * First libusb-1.0 beta release + diff --git a/thirdparty/libusb/libusb-1.0.9/PORTING b/thirdparty/libusb/libusb-1.0.9/PORTING new file mode 100644 index 0000000..7070784 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/PORTING @@ -0,0 +1,95 @@ +PORTING LIBUSB TO OTHER PLATFORMS + +Introduction +============ + +This document is aimed at developers wishing to port libusb to unsupported +platforms. I believe the libusb API is OS-independent, so by supporting +multiple operating systems we pave the way for cross-platform USB device +drivers. + +Implementation-wise, the basic idea is that you provide an interface to +libusb's internal "backend" API, which performs the appropriate operations on +your target platform. + +In terms of USB I/O, your backend provides functionality to submit +asynchronous transfers (synchronous transfers are implemented in the higher +layers, based on the async interface). Your backend must also provide +functionality to cancel those transfers. + +Your backend must also provide an event handling function to "reap" ongoing +transfers and process their results. + +The backend must also provide standard functions for other USB operations, +e.g. setting configuration, obtaining descriptors, etc. + + +File descriptors for I/O polling +================================ + +For libusb to work, your event handling function obviously needs to be called +at various points in time. Your backend must provide a set of file descriptors +which libusb and its users can pass to poll() or select() to determine when +it is time to call the event handling function. + +On Linux, this is easy: the usbfs kernel interface exposes a file descriptor +which can be passed to poll(). If something similar is not true for your +platform, you can emulate this using an internal library thread to reap I/O as +necessary, and a pipe() with the main library to raise events. The file +descriptor of the pipe can then be provided to libusb as an event source. + + +Interface semantics and documentation +===================================== + +Documentation of the backend interface can be found in libusbi.h inside the +usbi_os_backend structure definition. + +Your implementations of these functions will need to call various internal +libusb functions, prefixed with "usbi_". Documentation for these functions +can be found in the .c files where they are implemented. + +You probably want to skim over *all* the documentation before starting your +implementation. For example, you probably need to allocate and store private +OS-specific data for device handles, but the documentation for the mechanism +for doing so is probably not the first thing you will see. + +The Linux backend acts as a good example - view it as a reference +implementation which you should try to match the behaviour of. + + +Getting started +=============== + +1. Modify configure.ac to detect your platform appropriately (see the OS_LINUX +stuff for an example). + +2. Implement your backend in the libusb/os/ directory, modifying +libusb/os/Makefile.am appropriately. + +3. Add preprocessor logic to the top of libusb/core.c to statically assign the +right usbi_backend for your platform. + +4. Produce and test your implementation. + +5. Send your implementation to libusb-devel mailing list. + + +Implementation difficulties? Questions? +======================================= + +If you encounter difficulties porting libusb to your platform, please raise +these issues on the libusb-devel mailing list. Where possible and sensible, I +am interested in solving problems preventing libusb from operating on other +platforms. + +The libusb-devel mailing list is also a good place to ask questions and +make suggestions about the internal API. Hopefully we can produce some +better documentation based on your questions and other input. + +You are encouraged to get involved in the process; if the library needs +some infrastructure additions/modifications to better support your platform, +you are encouraged to make such changes (in cleanly distinct patch +submissions). Even if you do not make such changes yourself, please do raise +the issues on the mailing list at the very minimum. + diff --git a/thirdparty/libusb/libusb-1.0.9/README b/thirdparty/libusb/libusb-1.0.9/README new file mode 100644 index 0000000..08ae169 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/README @@ -0,0 +1,22 @@ +libusb +====== + +libusb is a library for USB device access from Linux, Mac OS X, +OpenBSD, NetBSD, and Windows userspace. +It is written in C and licensed under the LGPL-2.1 (see COPYING). + +libusb is abstracted internally in such a way that it can hopefully +be ported to other operating systems. See the PORTING file for some +information, if you fancy a challenge. :) + +libusb homepage: +http://libusb.org/ + +Developers will wish to consult the API documentation: +http://libusb.sourceforge.net/api-1.0/ + +Use the mailing list for questions, comments, etc: +http://libusb.org/wiki/MailingList + +- Peter Stuge +(use the mailing list rather than mailing developers directly) diff --git a/thirdparty/libusb/libusb-1.0.9/THANKS b/thirdparty/libusb/libusb-1.0.9/THANKS new file mode 100644 index 0000000..d926126 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/THANKS @@ -0,0 +1,8 @@ +Development contributors are listed in the AUTHORS file. Other community +members who have made significant contributions in other areas are listed +in this file: + +Alan Stern +Ludovic Rousseau +Tim Roberts +Xiaofan Chen diff --git a/thirdparty/libusb/libusb-1.0.9/TODO b/thirdparty/libusb/libusb-1.0.9/TODO new file mode 100644 index 0000000..6c162a3 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/TODO @@ -0,0 +1,9 @@ +for 1.1 or future +================== +optional timerfd support (runtime detection) +notifications of hotplugged/unplugged devices +offer API to create/destroy handle_events thread +isochronous sync I/O? +exposing of parent-child device relationships +"usb primer" introduction docs +more examples diff --git a/thirdparty/libusb/libusb-1.0.9/aclocal.m4 b/thirdparty/libusb/libusb-1.0.9/aclocal.m4 new file mode 100644 index 0000000..2f30c41 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/aclocal.m4 @@ -0,0 +1,9111 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -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 + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3175 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.10]) +m4_define([LT_PACKAGE_REVISION], [1.3175]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.10' +macro_revision='1.3175' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/thirdparty/libusb/libusb-1.0.9/compile b/thirdparty/libusb/libusb-1.0.9/compile new file mode 100644 index 0000000..c0096a7 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/libusb/libusb-1.0.9/config.guess b/thirdparty/libusb/libusb-1.0.9/config.guess new file mode 100644 index 0000000..e1f34b5 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/config.guess @@ -0,0 +1,1523 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. + +timestamp='2010-09-24' + +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# 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 + +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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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' HUP INT TERM + +# 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" HUP INT PIPE TERM ; +: ${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/*) + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #ifdef __UCLIBC__ + # ifdef __UCLIBC_CONFIG_VERSION__ + LIBC=uclibc __UCLIBC_CONFIG_VERSION__ + # else + LIBC=uclibc + # endif + #else + # ifdef __dietlibc__ + LIBC=dietlibc + # else + LIBC=gnu + # endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +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 tupples: *-*-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=`(/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 ;; + *) 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*|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 + # 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}" + 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'` + exit ;; + 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 /* 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 + + 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/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + 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 + #include + + 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 + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + 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 ;; + 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 ;; + 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 + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo frv-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; } + ;; + or32:Linux:*:*) + echo or32-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 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + 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}-tilera-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo x86_64-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' /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 + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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 ;; + 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 + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + 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 + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + 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 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < 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/thirdparty/libusb/libusb-1.0.9/config.h.in b/thirdparty/libusb/libusb-1.0.9/config.h.in new file mode 100644 index 0000000..412bd6c --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/config.h.in @@ -0,0 +1,116 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Default visibility */ +#undef DEFAULT_VISIBILITY + +/* Debug message logging */ +#undef ENABLE_DEBUG_LOGGING + +/* Message logging */ +#undef ENABLE_LOGGING + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if the system has the type `struct timespec'. */ +#undef HAVE_STRUCT_TIMESPEC + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Darwin backend */ +#undef OS_DARWIN + +/* Linux backend */ +#undef OS_LINUX + +/* OpenBSD backend */ +#undef OS_OPENBSD + +/* Windows backend */ +#undef OS_WINDOWS + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* type of second poll() argument */ +#undef POLL_NFDS_TYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Use POSIX Threads */ +#undef THREADS_POSIX + +/* timerfd headers available */ +#undef USBI_TIMERFD_AVAILABLE + +/* Version number of package */ +#undef VERSION + +/* Use GNU extensions */ +#undef _GNU_SOURCE + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif diff --git a/thirdparty/libusb/libusb-1.0.9/config.sub b/thirdparty/libusb/libusb-1.0.9/config.sub new file mode 100644 index 0000000..216604d --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/config.sub @@ -0,0 +1,1757 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# Free Software Foundation, Inc. + +timestamp='2010-09-11' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# 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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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*) + 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 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx | dvp \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | 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 \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | 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 | strongarm \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-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-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | 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-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | 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-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | 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-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | 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) + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + 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 + ;; + 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 + ;; + mingw32) + basic_machine=i386-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 + ;; + mipsEE* | ee | ps2) + basic_machine=mips64r5900el-scei + case $os in + -linux*) + ;; + *) + os=-elf + ;; + esac + ;; + iop) + basic_machine=mipsel-scei + os=-irx + ;; + dvp) + basic_machine=dvp-scei + os=-elf + ;; + 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 + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + 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) basic_machine=powerpc-unknown + ;; + ppc-*) 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) + 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 + ;; + 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 + ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; + tile*) + basic_machine=tile-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 + ;; + 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* \ + | -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* \ + | -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* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # 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 + ;; + -kaos*) + os=-kaos + ;; + -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 + ;; + 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + 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/thirdparty/libusb/libusb-1.0.9/configure b/thirdparty/libusb/libusb-1.0.9/configure new file mode 100644 index 0000000..e35bb32 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/configure @@ -0,0 +1,14148 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for libusb 1.0.9. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: libusb-devel@lists.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libusb' +PACKAGE_TARNAME='libusb' +PACKAGE_VERSION='1.0.9' +PACKAGE_STRING='libusb 1.0.9' +PACKAGE_BUGREPORT='libusb-devel@lists.sourceforge.net' +PACKAGE_URL='http://www.libusb.org/' + +ac_unique_file="libusb/core.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +LTLDFLAGS +AM_CFLAGS +VISIBILITY_CFLAGS +HAVE_SIGACTION_FALSE +HAVE_SIGACTION_TRUE +BUILD_EXAMPLES_FALSE +BUILD_EXAMPLES_TRUE +THREADS_POSIX_FALSE +THREADS_POSIX_TRUE +OS_WINDOWS_FALSE +OS_WINDOWS_TRUE +OS_OPENBSD_FALSE +OS_OPENBSD_TRUE +OS_DARWIN_FALSE +OS_DARWIN_TRUE +OS_LINUX_FALSE +OS_LINUX_TRUE +PC_LIBS_PRIVATE +THREAD_CFLAGS +OS_WINDOWS +OS_OPENBSD +OS_DARWIN +OS_LINUX +RC +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_silent_rules +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +enable_timerfd +enable_log +enable_debug_log +enable_examples_build +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_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 + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libusb 1.0.9 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libusb] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +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 libusb 1.0.9:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0') + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-timerfd use timerfd for timing (default auto) + --disable-log disable all logging + --enable-debug-log enable debug logging (default n) + --enable-examples-build build example applications (default n) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + 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 . +libusb home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libusb configure 1.0.9 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------------- ## +## Report this to libusb-devel@lists.sourceforge.net ## +## ------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libusb $as_me 1.0.9, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Library versioning +# These numbers should be tweaked on every release. Read carefully: +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# http://sourceware.org/autobook/autobook/autobook_91.html +lt_current="1" +lt_revision="0" +lt_age="1" +LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libusb' + VERSION='1.0.9' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + +ac_config_headers="$ac_config_headers config.h" + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +AM_BACKSLASH='\' + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.10' +macro_revision='1.3175' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +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 + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#endif + +void fnord () { int i=42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +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 + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RC"; then + ac_cv_prog_RC="$RC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RC="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RC=$ac_cv_prog_RC +if test -n "$RC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 +$as_echo "$RC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RC"; then + ac_ct_RC=$RC + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RC"; then + ac_cv_prog_ac_ct_RC="$ac_ct_RC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RC="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RC=$ac_cv_prog_ac_ct_RC +if test -n "$ac_ct_RC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 +$as_echo "$ac_ct_RC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RC" = x; then + RC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RC=$ac_ct_RC + fi +else + RC="$ac_cv_prog_RC" +fi + + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +if test -n "$compiler"; then + : + + + +fi + +GCC=$lt_save_GCC +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 + +CC="$lt_save_CC" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* 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 +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$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 + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +$as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + +LTLDFLAGS="${LTLDFLAGS} -no-undefined" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking operating system" >&5 +$as_echo_n "checking operating system... " >&6; } +case $host in +*-linux*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5 +$as_echo "Linux" >&6; } + backend="linux" + ;; +*-darwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin/Mac OS X" >&5 +$as_echo "Darwin/Mac OS X" >&6; } + backend="darwin" + ;; +*-openbsd*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenBSD" >&5 +$as_echo "OpenBSD" >&6; } + backend="openbsd" + ;; +*-netbsd*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: NetBSD (using OpenBSD backend)" >&5 +$as_echo "NetBSD (using OpenBSD backend)" >&6; } + backend="openbsd" + ;; +*-mingw*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows" >&5 +$as_echo "Windows" >&6; } + backend="windows" + ;; +*-cygwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cygwin (using Windows backend)" >&5 +$as_echo "Cygwin (using Windows backend)" >&6; } + backend="windows" + threads="posix" + ;; +*) + as_fn_error $? "unsupported operating system" "$LINENO" 5 +esac +case $backend in +linux) + +$as_echo "#define OS_LINUX 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + PC_LIBS_PRIVATE="-lrt" +fi + + threads="posix" + THREAD_CFLAGS="-pthread" + PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" + for ac_header in poll.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POLL_H 1 +_ACEOF + +fi + +done + + +$as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h + + ;; +darwin) + +$as_echo "#define OS_DARWIN 1" >>confdefs.h + + + threads="posix" + PC_LIBS_PRIVATE="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" + LTLDFLAGS="${LTLDFLAGS} -Wl,-prebind" + for ac_header in poll.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POLL_H 1 +_ACEOF + +fi + +done + + ac_fn_c_check_type "$LINENO" "nfds_t" "ac_cv_type_nfds_t" "#include +" +if test "x$ac_cv_type_nfds_t" = xyes; then : + +$as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h + +else + +$as_echo "#define POLL_NFDS_TYPE unsigned int" >>confdefs.h + +fi + + ;; +openbsd) + +$as_echo "#define OS_OPENBSD 1" >>confdefs.h + + + threads="posix" + THREAD_CFLAGS="-pthread" + PC_LIBS_PRIVATE="-pthread" + for ac_header in poll.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POLL_H 1 +_ACEOF + +fi + +done + + +$as_echo "#define POLL_NFDS_TYPE nfds_t" >>confdefs.h + + ;; +windows) + +$as_echo "#define OS_WINDOWS 1" >>confdefs.h + + + PC_LIBS_PRIVATE="" + LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias" + +$as_echo "#define POLL_NFDS_TYPE unsigned int" >>confdefs.h + + ;; +esac + + +LIBS="${LIBS} ${PC_LIBS_PRIVATE}" + + if test "x$backend" = xlinux; then + OS_LINUX_TRUE= + OS_LINUX_FALSE='#' +else + OS_LINUX_TRUE='#' + OS_LINUX_FALSE= +fi + + if test "x$backend" = xdarwin; then + OS_DARWIN_TRUE= + OS_DARWIN_FALSE='#' +else + OS_DARWIN_TRUE='#' + OS_DARWIN_FALSE= +fi + + if test "x$backend" = xopenbsd; then + OS_OPENBSD_TRUE= + OS_OPENBSD_FALSE='#' +else + OS_OPENBSD_TRUE='#' + OS_OPENBSD_FALSE= +fi + + if test "x$backend" = xwindows; then + OS_WINDOWS_TRUE= + OS_WINDOWS_FALSE='#' +else + OS_WINDOWS_TRUE='#' + OS_WINDOWS_FALSE= +fi + + if test "x$threads" = xposix; then + THREADS_POSIX_TRUE= + THREADS_POSIX_FALSE='#' +else + THREADS_POSIX_TRUE='#' + THREADS_POSIX_FALSE= +fi + +if test "$threads" = posix; then + +$as_echo "#define THREADS_POSIX 1" >>confdefs.h + +fi + +# timerfd +ac_fn_c_check_header_mongrel "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timerfd_h" = xyes; then : + timerfd_h=1 +else + timerfd_h=0 +fi + + +# Check whether --enable-timerfd was given. +if test "${enable_timerfd+set}" = set; then : + enableval=$enable_timerfd; use_timerfd=$enableval +else + use_timerfd='auto' +fi + + +if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then + as_fn_error $? "timerfd header not available; glibc 2.9+ required" "$LINENO" 5 +fi + +ac_fn_c_check_decl "$LINENO" "TFD_NONBLOCK" "ac_cv_have_decl_TFD_NONBLOCK" "#include +" +if test "x$ac_cv_have_decl_TFD_NONBLOCK" = xyes; then : + tfd_hdr_ok=yes +else + tfd_hdr_ok=no +fi + +if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then + as_fn_error $? "timerfd header not usable; glibc 2.9+ required" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use timerfd for timing" >&5 +$as_echo_n "checking whether to use timerfd for timing... " >&6; } +if test "x$use_timerfd" = "xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (disabled by user)" >&5 +$as_echo "no (disabled by user)" >&6; } +else + if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define USBI_TIMERFD_AVAILABLE 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (header not available)" >&5 +$as_echo "no (header not available)" >&6; } + fi +fi + +ac_fn_c_check_type "$LINENO" "struct timespec" "ac_cv_type_struct_timespec" "$ac_includes_default" +if test "x$ac_cv_type_struct_timespec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TIMESPEC 1 +_ACEOF + + +fi + + +# Message logging +# Check whether --enable-log was given. +if test "${enable_log+set}" = set; then : + enableval=$enable_log; log_enabled=$enableval +else + log_enabled='yes' +fi + +if test "x$log_enabled" != "xno"; then + +$as_echo "#define ENABLE_LOGGING 1" >>confdefs.h + +fi + +# Check whether --enable-debug-log was given. +if test "${enable_debug_log+set}" = set; then : + enableval=$enable_debug_log; debug_log_enabled=$enableval +else + debug_log_enabled='no' +fi + +if test "x$debug_log_enabled" != "xno"; then + +$as_echo "#define ENABLE_DEBUG_LOGGING 1" >>confdefs.h + +fi + +# Examples build +# Check whether --enable-examples-build was given. +if test "${enable_examples_build+set}" = set; then : + enableval=$enable_examples_build; build_examples=$enableval +else + build_examples='no' +fi + + if test "x$build_examples" != "xno"; then + BUILD_EXAMPLES_TRUE= + BUILD_EXAMPLES_FALSE='#' +else + BUILD_EXAMPLES_TRUE='#' + BUILD_EXAMPLES_FALSE= +fi + + +# check for -fvisibility=hidden compiler support (GCC >= 3.4) +saved_cflags="$CFLAGS" +# -Werror required for cygwin +CFLAGS="$CFLAGS -Werror -fvisibility=hidden" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + VISIBILITY_CFLAGS="-fvisibility=hidden" + +$as_echo "#define DEFAULT_VISIBILITY __attribute__((visibility(\"default\")))" >>confdefs.h + +else + VISIBILITY_CFLAGS="" + +$as_echo "#define DEFAULT_VISIBILITY /**/" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$saved_cflags" + +# check for -Wno-pointer-sign compiler support (GCC >= 4) +saved_cflags="$CFLAGS" +CFLAGS="$CFLAGS -Wno-pointer-sign" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + nopointersign_cflags="-Wno-pointer-sign" +else + nopointersign_cflags="" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$saved_cflags" + +# sigaction not available on MinGW +ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" +if test "x$ac_cv_func_sigaction" = xyes; then : + have_sigaction=yes +else + have_sigaction=no +fi + + if test "x$have_sigaction" = "xyes"; then + HAVE_SIGACTION_TRUE= + HAVE_SIGACTION_FALSE='#' +else + HAVE_SIGACTION_TRUE='#' + HAVE_SIGACTION_FALSE= +fi + + +# headers not available on all platforms but required on others +for ac_header in sys/time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 +_ACEOF + +fi + +done + +for ac_func in gettimeofday +do : + ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETTIMEOFDAY 1 +_ACEOF + +fi +done + + +AM_CFLAGS="-std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow" + + + + + +ac_config_files="$ac_config_files libusb-1.0.pc" + +ac_config_files="$ac_config_files Makefile" + +ac_config_files="$ac_config_files libusb/Makefile" + +ac_config_files="$ac_config_files examples/Makefile" + +ac_config_files="$ac_config_files doc/Makefile" + +ac_config_files="$ac_config_files doc/doxygen.cfg" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then + as_fn_error $? "conditional \"OS_LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_DARWIN_TRUE}" && test -z "${OS_DARWIN_FALSE}"; then + as_fn_error $? "conditional \"OS_DARWIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_OPENBSD_TRUE}" && test -z "${OS_OPENBSD_FALSE}"; then + as_fn_error $? "conditional \"OS_OPENBSD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_WINDOWS_TRUE}" && test -z "${OS_WINDOWS_FALSE}"; then + as_fn_error $? "conditional \"OS_WINDOWS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${THREADS_POSIX_TRUE}" && test -z "${THREADS_POSIX_FALSE}"; then + as_fn_error $? "conditional \"THREADS_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_EXAMPLES_TRUE}" && test -z "${BUILD_EXAMPLES_FALSE}"; then + as_fn_error $? "conditional \"BUILD_EXAMPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SIGACTION_TRUE}" && test -z "${HAVE_SIGACTION_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SIGACTION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libusb $as_me 1.0.9, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to . +libusb home page: ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libusb config.status 1.0.9 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +LD_RC='`$ECHO "$LD_RC" | $SED "$delay_single_quote_subst"`' +reload_flag_RC='`$ECHO "$reload_flag_RC" | $SED "$delay_single_quote_subst"`' +reload_cmds_RC='`$ECHO "$reload_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_RC='`$ECHO "$old_archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +compiler_RC='`$ECHO "$compiler_RC" | $SED "$delay_single_quote_subst"`' +GCC_RC='`$ECHO "$GCC_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_RC='`$ECHO "$lt_prog_compiler_no_builtin_flag_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_RC='`$ECHO "$lt_prog_compiler_wl_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_RC='`$ECHO "$lt_prog_compiler_pic_RC" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_RC='`$ECHO "$lt_prog_compiler_static_RC" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_RC='`$ECHO "$lt_cv_prog_compiler_c_o_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_RC='`$ECHO "$archive_cmds_need_lc_RC" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_RC='`$ECHO "$enable_shared_with_static_runtimes_RC" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_RC='`$ECHO "$export_dynamic_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_RC='`$ECHO "$whole_archive_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_RC='`$ECHO "$compiler_needs_object_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_RC='`$ECHO "$old_archive_from_new_cmds_RC" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_RC='`$ECHO "$old_archive_from_expsyms_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_cmds_RC='`$ECHO "$archive_cmds_RC" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_RC='`$ECHO "$archive_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_cmds_RC='`$ECHO "$module_cmds_RC" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_RC='`$ECHO "$module_expsym_cmds_RC" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_RC='`$ECHO "$with_gnu_ld_RC" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_RC='`$ECHO "$allow_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_RC='`$ECHO "$no_undefined_flag_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_RC='`$ECHO "$hardcode_libdir_flag_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_RC='`$ECHO "$hardcode_libdir_flag_spec_ld_RC" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_RC='`$ECHO "$hardcode_libdir_separator_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_RC='`$ECHO "$hardcode_direct_RC" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_RC='`$ECHO "$hardcode_direct_absolute_RC" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_RC='`$ECHO "$hardcode_minus_L_RC" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_RC='`$ECHO "$hardcode_shlibpath_var_RC" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_RC='`$ECHO "$hardcode_automatic_RC" | $SED "$delay_single_quote_subst"`' +inherit_rpath_RC='`$ECHO "$inherit_rpath_RC" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_RC='`$ECHO "$link_all_deplibs_RC" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path_RC='`$ECHO "$fix_srcfile_path_RC" | $SED "$delay_single_quote_subst"`' +always_export_symbols_RC='`$ECHO "$always_export_symbols_RC" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_RC='`$ECHO "$export_symbols_cmds_RC" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_RC='`$ECHO "$exclude_expsyms_RC" | $SED "$delay_single_quote_subst"`' +include_expsyms_RC='`$ECHO "$include_expsyms_RC" | $SED "$delay_single_quote_subst"`' +prelink_cmds_RC='`$ECHO "$prelink_cmds_RC" | $SED "$delay_single_quote_subst"`' +file_list_spec_RC='`$ECHO "$file_list_spec_RC" | $SED "$delay_single_quote_subst"`' +hardcode_action_RC='`$ECHO "$hardcode_action_RC" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +LD_RC \ +reload_flag_RC \ +compiler_RC \ +lt_prog_compiler_no_builtin_flag_RC \ +lt_prog_compiler_wl_RC \ +lt_prog_compiler_pic_RC \ +lt_prog_compiler_static_RC \ +lt_cv_prog_compiler_c_o_RC \ +export_dynamic_flag_spec_RC \ +whole_archive_flag_spec_RC \ +compiler_needs_object_RC \ +with_gnu_ld_RC \ +allow_undefined_flag_RC \ +no_undefined_flag_RC \ +hardcode_libdir_flag_spec_RC \ +hardcode_libdir_flag_spec_ld_RC \ +hardcode_libdir_separator_RC \ +fix_srcfile_path_RC \ +exclude_expsyms_RC \ +include_expsyms_RC \ +file_list_spec_RC; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_RC \ +old_archive_cmds_RC \ +old_archive_from_new_cmds_RC \ +old_archive_from_expsyms_cmds_RC \ +archive_cmds_RC \ +archive_expsym_cmds_RC \ +module_cmds_RC \ +module_expsym_cmds_RC \ +export_symbols_cmds_RC \ +prelink_cmds_RC; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "libusb-1.0.pc") CONFIG_FILES="$CONFIG_FILES libusb-1.0.pc" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libusb/Makefile") CONFIG_FILES="$CONFIG_FILES libusb/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES doc/doxygen.cfg" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="RC " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: RC + +# The linker used to build libraries. +LD=$lt_LD_RC + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_RC +reload_cmds=$lt_reload_cmds_RC + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_RC + +# A language specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU compiler? +with_gcc=$GCC_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_RC + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_RC + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_RC + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_RC + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_RC + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_RC + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_RC + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_RC + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# ### END LIBTOOL TAG CONFIG: RC +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/thirdparty/libusb/libusb-1.0.9/configure.ac b/thirdparty/libusb/libusb-1.0.9/configure.ac new file mode 100644 index 0000000..f9e648e --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/configure.ac @@ -0,0 +1,222 @@ +dnl These m4 macros are whitespace sensitive and break if moved around much. +m4_define([LU_VERSION_H], m4_include([libusb/version.h])) +m4_define([LU_DEFINE_VERSION_ATOM], + [m4_define([$1], m4_bregexp(LU_VERSION_H, + [^#define\s*$1\s*\([0-9]*\).*], [\1]))]) +m4_define([LU_DEFINE_VERSION_RC_ATOM], + [m4_define([$1], m4_bregexp(LU_VERSION_H, + [^#define\s*$1\s*"\(-rc[0-9]*\)".*], [\1]))]) +dnl The m4_bregexp() returns (only) the numbers following the #define named +dnl in the first macro parameter. m4_define() then defines the name for use +dnl in AC_INIT(). + +LU_DEFINE_VERSION_ATOM([LIBUSB_MAJOR]) +LU_DEFINE_VERSION_ATOM([LIBUSB_MINOR]) +LU_DEFINE_VERSION_ATOM([LIBUSB_MICRO]) +LU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC]) + +AC_INIT([libusb], LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/]) + +# Library versioning +# These numbers should be tweaked on every release. Read carefully: +# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +# http://sourceware.org/autobook/autobook/autobook_91.html +lt_current="1" +lt_revision="0" +lt_age="1" +LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" + +AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE + +AC_CONFIG_SRCDIR([libusb/core.c]) +AC_CONFIG_MACRO_DIR([m4]) +AM_CONFIG_HEADER([config.h]) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +AC_PREREQ([2.50]) +AC_PROG_CC +AC_PROG_LIBTOOL +LT_LANG([Windows Resource]) +AC_C_INLINE +AM_PROG_CC_C_O +AC_DEFINE([_GNU_SOURCE], 1, [Use GNU extensions]) + +LTLDFLAGS="${LTLDFLAGS} -no-undefined" + +AC_MSG_CHECKING([operating system]) +case $host in +*-linux*) + AC_MSG_RESULT([Linux]) + backend="linux" + ;; +*-darwin*) + AC_MSG_RESULT([Darwin/Mac OS X]) + backend="darwin" + ;; +*-openbsd*) + AC_MSG_RESULT([OpenBSD]) + backend="openbsd" + ;; +*-netbsd*) + AC_MSG_RESULT([NetBSD (using OpenBSD backend)]) + backend="openbsd" + ;; +*-mingw*) + AC_MSG_RESULT([Windows]) + backend="windows" + ;; +*-cygwin*) + AC_MSG_RESULT([Cygwin (using Windows backend)]) + backend="windows" + threads="posix" + ;; +*) + AC_MSG_ERROR([unsupported operating system]) +esac +case $backend in +linux) + AC_DEFINE(OS_LINUX, 1, [Linux backend]) + AC_SUBST(OS_LINUX) + AC_CHECK_LIB(rt, clock_gettime, PC_LIBS_PRIVATE="-lrt") + threads="posix" + THREAD_CFLAGS="-pthread" + PC_LIBS_PRIVATE="${PC_LIBS_PRIVATE} -pthread" + AC_CHECK_HEADERS([poll.h]) + AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) + ;; +darwin) + AC_DEFINE(OS_DARWIN, 1, [Darwin backend]) + AC_SUBST(OS_DARWIN) + threads="posix" + PC_LIBS_PRIVATE="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation" + LTLDFLAGS="${LTLDFLAGS} -Wl,-prebind" + AC_CHECK_HEADERS([poll.h]) + AC_CHECK_TYPE([nfds_t], + [AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])], + [AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])], + [#include ]) + ;; +openbsd) + AC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend]) + AC_SUBST(OS_OPENBSD) + threads="posix" + THREAD_CFLAGS="-pthread" + PC_LIBS_PRIVATE="-pthread" + AC_CHECK_HEADERS([poll.h]) + AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument]) + ;; +windows) + AC_DEFINE(OS_WINDOWS, 1, [Windows backend]) + AC_SUBST(OS_WINDOWS) + PC_LIBS_PRIVATE="" + LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias" + AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument]) + ;; +esac +AC_SUBST(THREAD_CFLAGS) +AC_SUBST(PC_LIBS_PRIVATE) +LIBS="${LIBS} ${PC_LIBS_PRIVATE}" + +AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux) +AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin) +AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd) +AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows) +AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix) +if test "$threads" = posix; then + AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads]) +fi + +# timerfd +AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0]) +AC_ARG_ENABLE([timerfd], + [AS_HELP_STRING([--enable-timerfd], + [use timerfd for timing (default auto)])], + [use_timerfd=$enableval], [use_timerfd='auto']) + +if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then + AC_MSG_ERROR([timerfd header not available; glibc 2.9+ required]) +fi + +AC_CHECK_DECL([TFD_NONBLOCK], [tfd_hdr_ok=yes], [tfd_hdr_ok=no], [#include ]) +if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then + AC_MSG_ERROR([timerfd header not usable; glibc 2.9+ required]) +fi + +AC_MSG_CHECKING([whether to use timerfd for timing]) +if test "x$use_timerfd" = "xno"; then + AC_MSG_RESULT([no (disabled by user)]) +else + if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE(USBI_TIMERFD_AVAILABLE, 1, [timerfd headers available]) + else + AC_MSG_RESULT([no (header not available)]) + fi +fi + +AC_CHECK_TYPES(struct timespec) + +# Message logging +AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])], + [log_enabled=$enableval], + [log_enabled='yes']) +if test "x$log_enabled" != "xno"; then + AC_DEFINE([ENABLE_LOGGING], 1, [Message logging]) +fi + +AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log], + [enable debug logging (default n)])], + [debug_log_enabled=$enableval], + [debug_log_enabled='no']) +if test "x$debug_log_enabled" != "xno"; then + AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging]) +fi + +# Examples build +AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build], + [build example applications (default n)])], + [build_examples=$enableval], + [build_examples='no']) +AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) + +# check for -fvisibility=hidden compiler support (GCC >= 3.4) +saved_cflags="$CFLAGS" +# -Werror required for cygwin +CFLAGS="$CFLAGS -Werror -fvisibility=hidden" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [VISIBILITY_CFLAGS="-fvisibility=hidden" + AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility("default")))], [Default visibility]) ], + [ VISIBILITY_CFLAGS="" + AC_DEFINE([DEFAULT_VISIBILITY], [], [Default visibility]) ], + ]) +CFLAGS="$saved_cflags" + +# check for -Wno-pointer-sign compiler support (GCC >= 4) +saved_cflags="$CFLAGS" +CFLAGS="$CFLAGS -Wno-pointer-sign" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="") +CFLAGS="$saved_cflags" + +# sigaction not available on MinGW +AC_CHECK_FUNC([sigaction], [have_sigaction=yes], [have_sigaction=no]) +AM_CONDITIONAL([HAVE_SIGACTION], [test "x$have_sigaction" = "xyes"]) + +# headers not available on all platforms but required on others +AC_CHECK_HEADERS([sys/time.h]) +AC_CHECK_FUNCS(gettimeofday) + +AM_CFLAGS="-std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow" + +AC_SUBST(VISIBILITY_CFLAGS) +AC_SUBST(AM_CFLAGS) +AC_SUBST(LTLDFLAGS) + +AC_CONFIG_FILES([libusb-1.0.pc]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([libusb/Makefile]) +AC_CONFIG_FILES([examples/Makefile]) +AC_CONFIG_FILES([doc/Makefile]) +AC_CONFIG_FILES([doc/doxygen.cfg]) +AC_OUTPUT diff --git a/thirdparty/libusb/libusb-1.0.9/depcomp b/thirdparty/libusb/libusb-1.0.9/depcomp new file mode 100644 index 0000000..df8eea7 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . + +# 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. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/libusb/libusb-1.0.9/doc/Makefile.am b/thirdparty/libusb/libusb-1.0.9/doc/Makefile.am new file mode 100644 index 0000000..931a7c0 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/doc/Makefile.am @@ -0,0 +1,10 @@ +EXTRA_DIST = doxygen.cfg.in + +docs: doxygen.cfg + doxygen $^ + +docs-upload: docs + ln -s html api-1.0 + rsync -av api-1.0/ web.sourceforge.net:htdocs/api-1.0/ + rm -f api-1.0 + diff --git a/thirdparty/libusb/libusb-1.0.9/doc/Makefile.in b/thirdparty/libusb/libusb-1.0.9/doc/Makefile.in new file mode 100644 index 0000000..4c4a39c --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/doc/Makefile.in @@ -0,0 +1,377 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/doxygen.cfg.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libusb/version.h \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = doxygen.cfg +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = doxygen.cfg.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +docs: doxygen.cfg + doxygen $^ + +docs-upload: docs + ln -s html api-1.0 + rsync -av api-1.0/ web.sourceforge.net:htdocs/api-1.0/ + rm -f api-1.0 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/libusb/libusb-1.0.9/doc/doxygen.cfg.in b/thirdparty/libusb/libusb-1.0.9/doc/doxygen.cfg.in new file mode 100644 index 0000000..128e1de --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/doc/doxygen.cfg.in @@ -0,0 +1,1294 @@ +# Doxyfile 1.5.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libusb + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be extracted +# and appear in the documentation as a namespace called 'anonymous_namespace{file}', +# where file will be replaced with the base name of the file that contains the anonymous +# namespace. By default anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @top_srcdir@/libusb + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = @top_srcdir@/libusb/libusbi.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH +# then you must also enable this option. If you don't then doxygen will produce +# a warning and turn it on anyway + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = API_EXPORTED= LIBUSB_CALL= DEFAULT_VISIBILITY= + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the number +# of direct children of the root node in a graph is already larger than +# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/thirdparty/libusb/libusb-1.0.9/examples/Makefile.am b/thirdparty/libusb/libusb-1.0.9/examples/Makefile.am new file mode 100644 index 0000000..c7630d2 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/examples/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = -I$(top_srcdir)/libusb +noinst_PROGRAMS = listdevs + +listdevs_SOURCES = listdevs.c +listdevs_LDADD = ../libusb/libusb-1.0.la + +if HAVE_SIGACTION +dpfp_SOURCES = dpfp.c +dpfp_LDADD = ../libusb/libusb-1.0.la +noinst_PROGRAMS += dpfp +endif + +if THREADS_POSIX +if HAVE_SIGACTION +dpfp_threaded_SOURCES = dpfp_threaded.c +dpfp_threaded_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) +dpfp_threaded_LDADD = ../libusb/libusb-1.0.la +noinst_PROGRAMS += dpfp_threaded +endif +endif + diff --git a/thirdparty/libusb/libusb-1.0.9/examples/Makefile.in b/thirdparty/libusb/libusb-1.0.9/examples/Makefile.in new file mode 100644 index 0000000..b9bf469 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/examples/Makefile.in @@ -0,0 +1,542 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = listdevs$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) +@HAVE_SIGACTION_TRUE@am__append_1 = dpfp +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am__append_2 = dpfp_threaded +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libusb/version.h \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@HAVE_SIGACTION_TRUE@am__EXEEXT_1 = dpfp$(EXEEXT) +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am__EXEEXT_2 = dpfp_threaded$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am__dpfp_SOURCES_DIST = dpfp.c +@HAVE_SIGACTION_TRUE@am_dpfp_OBJECTS = dpfp.$(OBJEXT) +dpfp_OBJECTS = $(am_dpfp_OBJECTS) +@HAVE_SIGACTION_TRUE@dpfp_DEPENDENCIES = ../libusb/libusb-1.0.la +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__dpfp_threaded_SOURCES_DIST = dpfp_threaded.c +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@am_dpfp_threaded_OBJECTS = dpfp_threaded-dpfp_threaded.$(OBJEXT) +dpfp_threaded_OBJECTS = $(am_dpfp_threaded_OBJECTS) +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_DEPENDENCIES = ../libusb/libusb-1.0.la +dpfp_threaded_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dpfp_threaded_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_listdevs_OBJECTS = listdevs.$(OBJEXT) +listdevs_OBJECTS = $(am_listdevs_OBJECTS) +listdevs_DEPENDENCIES = ../libusb/libusb-1.0.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(dpfp_SOURCES) $(dpfp_threaded_SOURCES) $(listdevs_SOURCES) +DIST_SOURCES = $(am__dpfp_SOURCES_DIST) \ + $(am__dpfp_threaded_SOURCES_DIST) $(listdevs_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/libusb +listdevs_SOURCES = listdevs.c +listdevs_LDADD = ../libusb/libusb-1.0.la +@HAVE_SIGACTION_TRUE@dpfp_SOURCES = dpfp.c +@HAVE_SIGACTION_TRUE@dpfp_LDADD = ../libusb/libusb-1.0.la +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_SOURCES = dpfp_threaded.c +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS) +@HAVE_SIGACTION_TRUE@@THREADS_POSIX_TRUE@dpfp_threaded_LDADD = ../libusb/libusb-1.0.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +dpfp$(EXEEXT): $(dpfp_OBJECTS) $(dpfp_DEPENDENCIES) + @rm -f dpfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dpfp_OBJECTS) $(dpfp_LDADD) $(LIBS) +dpfp_threaded$(EXEEXT): $(dpfp_threaded_OBJECTS) $(dpfp_threaded_DEPENDENCIES) + @rm -f dpfp_threaded$(EXEEXT) + $(AM_V_CCLD)$(dpfp_threaded_LINK) $(dpfp_threaded_OBJECTS) $(dpfp_threaded_LDADD) $(LIBS) +listdevs$(EXEEXT): $(listdevs_OBJECTS) $(listdevs_DEPENDENCIES) + @rm -f listdevs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(listdevs_OBJECTS) $(listdevs_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpfp_threaded-dpfp_threaded.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listdevs.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +dpfp_threaded-dpfp_threaded.o: dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.o -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '$(srcdir)/'`dpfp_threaded.c + +dpfp_threaded-dpfp_threaded.obj: dpfp_threaded.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -MT dpfp_threaded-dpfp_threaded.obj -MD -MP -MF $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dpfp_threaded-dpfp_threaded.Tpo $(DEPDIR)/dpfp_threaded-dpfp_threaded.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dpfp_threaded.c' object='dpfp_threaded-dpfp_threaded.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dpfp_threaded_CFLAGS) $(CFLAGS) -c -o dpfp_threaded-dpfp_threaded.obj `if test -f 'dpfp_threaded.c'; then $(CYGPATH_W) 'dpfp_threaded.c'; else $(CYGPATH_W) '$(srcdir)/dpfp_threaded.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/libusb/libusb-1.0.9/examples/dpfp.c b/thirdparty/libusb/libusb-1.0.9/examples/dpfp.c new file mode 100644 index 0000000..ecd5a92 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/examples/dpfp.c @@ -0,0 +1,507 @@ +/* + * libusb example program to manipulate U.are.U 4000B fingerprint scanner. + * Copyright (C) 2007 Daniel Drake + * + * Basic image capture program only, does not consider the powerup quirks or + * the fact that image encryption may be enabled. Not expected to work + * flawlessly all of the time. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include + +#define EP_INTR (1 | LIBUSB_ENDPOINT_IN) +#define EP_DATA (2 | LIBUSB_ENDPOINT_IN) +#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN) +#define CTRL_OUT (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT) +#define USB_RQ 0x04 +#define INTR_LENGTH 64 + +enum { + MODE_INIT = 0x00, + MODE_AWAIT_FINGER_ON = 0x10, + MODE_AWAIT_FINGER_OFF = 0x12, + MODE_CAPTURE = 0x20, + MODE_SHUT_UP = 0x30, + MODE_READY = 0x80, +}; + +static int next_state(void); + +enum { + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1, + STATE_AWAIT_IRQ_FINGER_DETECTED, + STATE_AWAIT_MODE_CHANGE_CAPTURE, + STATE_AWAIT_IMAGE, + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF, + STATE_AWAIT_IRQ_FINGER_REMOVED, +}; + +static int state = 0; +static struct libusb_device_handle *devh = NULL; +static unsigned char imgbuf[0x1b340]; +static unsigned char irqbuf[INTR_LENGTH]; +static struct libusb_transfer *img_transfer = NULL; +static struct libusb_transfer *irq_transfer = NULL; +static int img_idx = 0; +static int do_exit = 0; + +static int find_dpfp_device(void) +{ + devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a); + return devh ? 0 : -EIO; +} + +static int print_f0_data(void) +{ + unsigned char data[0x10]; + int r; + unsigned int i; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data, + sizeof(data), 0); + if (r < 0) { + fprintf(stderr, "F0 error %d\n", r); + return r; + } + if ((unsigned int) r < sizeof(data)) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("F0 data:"); + for (i = 0; i < sizeof(data); i++) + printf("%02x ", data[i]); + printf("\n"); + return 0; +} + +static int get_hwstat(unsigned char *status) +{ + int r; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0); + if (r < 0) { + fprintf(stderr, "read hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("hwstat reads %02x\n", *status); + return 0; +} + +static int set_hwstat(unsigned char data) +{ + int r; + + printf("set hwstat to %02x\n", data); + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static int set_mode(unsigned char data) +{ + int r; + printf("set mode %02x\n", data); + + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set mode error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "mode change transfer not completed!\n"); + do_exit = 2; + } + + printf("async cb_mode_changed length=%d actual_length=%d\n", + transfer->length, transfer->actual_length); + if (next_state() < 0) + do_exit = 2; +} + +static int set_mode_async(unsigned char data) +{ + unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); + struct libusb_transfer *transfer; + + if (!buf) + return -ENOMEM; + + transfer = libusb_alloc_transfer(0); + if (!transfer) { + free(buf); + return -ENOMEM; + } + + printf("async set mode %02x\n", data); + libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1); + buf[LIBUSB_CONTROL_SETUP_SIZE] = data; + libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL, + 1000); + + transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK + | LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER; + return libusb_submit_transfer(transfer); +} + +static int do_sync_intr(unsigned char *data) +{ + int r; + int transferred; + + r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH, + &transferred, 1000); + if (r < 0) { + fprintf(stderr, "intr error %d\n", r); + return r; + } + if (transferred < INTR_LENGTH) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("recv interrupt %04x\n", *((uint16_t *) data)); + return 0; +} + +static int sync_intr(unsigned char type) +{ + int r; + unsigned char data[INTR_LENGTH]; + + while (1) { + r = do_sync_intr(data); + if (r < 0) + return r; + if (data[0] == type) + return 0; + } +} + +static int save_to_file(unsigned char *data) +{ + FILE *fd; + char filename[64]; + + snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++); + fd = fopen(filename, "w"); + if (!fd) + return -1; + + fputs("P5 384 289 255 ", fd); + (void) fwrite(data + 64, 1, 384*289, fd); + fclose(fd); + printf("saved image to %s\n", filename); + return 0; +} + +static int next_state(void) +{ + int r = 0; + printf("old state: %d\n", state); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_REMOVED: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON; + r = set_mode_async(MODE_AWAIT_FINGER_ON); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON: + state = STATE_AWAIT_IRQ_FINGER_DETECTED; + break; + case STATE_AWAIT_IRQ_FINGER_DETECTED: + state = STATE_AWAIT_MODE_CHANGE_CAPTURE; + r = set_mode_async(MODE_CAPTURE); + break; + case STATE_AWAIT_MODE_CHANGE_CAPTURE: + state = STATE_AWAIT_IMAGE; + break; + case STATE_AWAIT_IMAGE: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF; + r = set_mode_async(MODE_AWAIT_FINGER_OFF); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF: + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + break; + default: + printf("unrecognised state %d\n", state); + } + if (r < 0) { + fprintf(stderr, "error detected changing state\n"); + return r; + } + + printf("new state: %d\n", state); + return 0; +} + +static void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer) +{ + unsigned char irqtype = transfer->buffer[0]; + + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "irq transfer status %d?\n", transfer->status); + do_exit = 2; + libusb_free_transfer(transfer); + irq_transfer = NULL; + return; + } + + printf("IRQ callback %02x\n", irqtype); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_DETECTED: + if (irqtype == 0x01) { + if (next_state() < 0) { + do_exit = 2; + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + case STATE_AWAIT_IRQ_FINGER_REMOVED: + if (irqtype == 0x02) { + if (next_state() < 0) { + do_exit = 2; + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + } + if (libusb_submit_transfer(irq_transfer) < 0) + do_exit = 2; +} + +static void LIBUSB_CALL cb_img(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "img transfer status %d?\n", transfer->status); + do_exit = 2; + libusb_free_transfer(transfer); + img_transfer = NULL; + return; + } + + printf("Image callback\n"); + save_to_file(imgbuf); + if (next_state() < 0) { + do_exit = 2; + return; + } + if (libusb_submit_transfer(img_transfer) < 0) + do_exit = 2; +} + +static int init_capture(void) +{ + int r; + + r = libusb_submit_transfer(irq_transfer); + if (r < 0) + return r; + + r = libusb_submit_transfer(img_transfer); + if (r < 0) { + libusb_cancel_transfer(irq_transfer); + while (irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + return r; + } + + /* start state machine */ + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + return next_state(); +} + +static int do_init(void) +{ + unsigned char status; + int r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + if (!(status & 0x80)) { + r = set_hwstat(status | 0x80); + if (r < 0) + return r; + r = get_hwstat(&status); + if (r < 0) + return r; + } + + status &= ~0x80; + r = set_hwstat(status); + if (r < 0) + return r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + r = sync_intr(0x56); + if (r < 0) + return r; + + return 0; +} + +static int alloc_transfers(void) +{ + img_transfer = libusb_alloc_transfer(0); + if (!img_transfer) + return -ENOMEM; + + irq_transfer = libusb_alloc_transfer(0); + if (!irq_transfer) + return -ENOMEM; + + libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf, + sizeof(imgbuf), cb_img, NULL, 0); + libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf, + sizeof(irqbuf), cb_irq, NULL, 0); + + return 0; +} + +static void sighandler(int signum) +{ + do_exit = 1; +} + +int main(void) +{ + struct sigaction sigact; + int r = 1; + + r = libusb_init(NULL); + if (r < 0) { + fprintf(stderr, "failed to initialise libusb\n"); + exit(1); + } + + r = find_dpfp_device(); + if (r < 0) { + fprintf(stderr, "Could not find/open device\n"); + goto out; + } + + r = libusb_claim_interface(devh, 0); + if (r < 0) { + fprintf(stderr, "usb_claim_interface error %d\n", r); + goto out; + } + printf("claimed interface\n"); + + r = print_f0_data(); + if (r < 0) + goto out_release; + + r = do_init(); + if (r < 0) + goto out_deinit; + + /* async from here onwards */ + + r = alloc_transfers(); + if (r < 0) + goto out_deinit; + + r = init_capture(); + if (r < 0) + goto out_deinit; + + sigact.sa_handler = sighandler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigaction(SIGINT, &sigact, NULL); + sigaction(SIGTERM, &sigact, NULL); + sigaction(SIGQUIT, &sigact, NULL); + + while (!do_exit) { + r = libusb_handle_events(NULL); + if (r < 0) + goto out_deinit; + } + + printf("shutting down...\n"); + + if (irq_transfer) { + r = libusb_cancel_transfer(irq_transfer); + if (r < 0) + goto out_deinit; + } + + if (img_transfer) { + r = libusb_cancel_transfer(img_transfer); + if (r < 0) + goto out_deinit; + } + + while (irq_transfer || img_transfer) + if (libusb_handle_events(NULL) < 0) + break; + + if (do_exit == 1) + r = 0; + else + r = 1; + +out_deinit: + libusb_free_transfer(img_transfer); + libusb_free_transfer(irq_transfer); + set_mode(0); + set_hwstat(0x80); +out_release: + libusb_release_interface(devh, 0); +out: + libusb_close(devh); + libusb_exit(NULL); + return r >= 0 ? r : -r; +} + diff --git a/thirdparty/libusb/libusb-1.0.9/examples/dpfp_threaded.c b/thirdparty/libusb/libusb-1.0.9/examples/dpfp_threaded.c new file mode 100644 index 0000000..93de9d7 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/examples/dpfp_threaded.c @@ -0,0 +1,545 @@ +/* + * libusb example program to manipulate U.are.U 4000B fingerprint scanner. + * Copyright (C) 2007 Daniel Drake + * + * Basic image capture program only, does not consider the powerup quirks or + * the fact that image encryption may be enabled. Not expected to work + * flawlessly all of the time. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include + +#include + +#define EP_INTR (1 | LIBUSB_ENDPOINT_IN) +#define EP_DATA (2 | LIBUSB_ENDPOINT_IN) +#define CTRL_IN (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN) +#define CTRL_OUT (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT) +#define USB_RQ 0x04 +#define INTR_LENGTH 64 + +enum { + MODE_INIT = 0x00, + MODE_AWAIT_FINGER_ON = 0x10, + MODE_AWAIT_FINGER_OFF = 0x12, + MODE_CAPTURE = 0x20, + MODE_SHUT_UP = 0x30, + MODE_READY = 0x80, +}; + +static int next_state(void); + +enum { + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1, + STATE_AWAIT_IRQ_FINGER_DETECTED, + STATE_AWAIT_MODE_CHANGE_CAPTURE, + STATE_AWAIT_IMAGE, + STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF, + STATE_AWAIT_IRQ_FINGER_REMOVED, +}; + +static int state = 0; +static struct libusb_device_handle *devh = NULL; +static unsigned char imgbuf[0x1b340]; +static unsigned char irqbuf[INTR_LENGTH]; +static struct libusb_transfer *img_transfer = NULL; +static struct libusb_transfer *irq_transfer = NULL; +static int img_idx = 0; +static int do_exit = 0; + +static pthread_t poll_thread; +static pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER; +static pthread_mutex_t exit_cond_lock = PTHREAD_MUTEX_INITIALIZER; + +static void request_exit(int code) +{ + do_exit = code; + pthread_cond_signal(&exit_cond); +} + +static void *poll_thread_main(void *arg) +{ + int r = 0; + printf("poll thread running\n"); + + while (!do_exit) { + struct timeval tv = { 1, 0 }; + r = libusb_handle_events_timeout(NULL, &tv); + if (r < 0) { + request_exit(2); + break; + } + } + + printf("poll thread shutting down\n"); + return NULL; +} + +static int find_dpfp_device(void) +{ + devh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a); + return devh ? 0 : -EIO; +} + +static int print_f0_data(void) +{ + unsigned char data[0x10]; + int r; + unsigned int i; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data, + sizeof(data), 0); + if (r < 0) { + fprintf(stderr, "F0 error %d\n", r); + return r; + } + if ((unsigned int) r < sizeof(data)) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("F0 data:"); + for (i = 0; i < sizeof(data); i++) + printf("%02x ", data[i]); + printf("\n"); + return 0; +} + +static int get_hwstat(unsigned char *status) +{ + int r; + + r = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0); + if (r < 0) { + fprintf(stderr, "read hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("hwstat reads %02x\n", *status); + return 0; +} + +static int set_hwstat(unsigned char data) +{ + int r; + + printf("set hwstat to %02x\n", data); + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set hwstat error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static int set_mode(unsigned char data) +{ + int r; + printf("set mode %02x\n", data); + + r = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0); + if (r < 0) { + fprintf(stderr, "set mode error %d\n", r); + return r; + } + if ((unsigned int) r < 1) { + fprintf(stderr, "short write (%d)", r); + return -1; + } + + return 0; +} + +static void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "mode change transfer not completed!\n"); + request_exit(2); + } + + printf("async cb_mode_changed length=%d actual_length=%d\n", + transfer->length, transfer->actual_length); + if (next_state() < 0) + request_exit(2); +} + +static int set_mode_async(unsigned char data) +{ + unsigned char *buf = malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); + struct libusb_transfer *transfer; + + if (!buf) + return -ENOMEM; + + transfer = libusb_alloc_transfer(0); + if (!transfer) { + free(buf); + return -ENOMEM; + } + + printf("async set mode %02x\n", data); + libusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1); + buf[LIBUSB_CONTROL_SETUP_SIZE] = data; + libusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL, + 1000); + + transfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK + | LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER; + return libusb_submit_transfer(transfer); +} + +static int do_sync_intr(unsigned char *data) +{ + int r; + int transferred; + + r = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH, + &transferred, 1000); + if (r < 0) { + fprintf(stderr, "intr error %d\n", r); + return r; + } + if (transferred < INTR_LENGTH) { + fprintf(stderr, "short read (%d)\n", r); + return -1; + } + + printf("recv interrupt %04x\n", *((uint16_t *) data)); + return 0; +} + +static int sync_intr(unsigned char type) +{ + int r; + unsigned char data[INTR_LENGTH]; + + while (1) { + r = do_sync_intr(data); + if (r < 0) + return r; + if (data[0] == type) + return 0; + } +} + +static int save_to_file(unsigned char *data) +{ + FILE *fd; + char filename[64]; + + snprintf(filename, sizeof(filename), "finger%d.pgm", img_idx++); + fd = fopen(filename, "w"); + if (!fd) + return -1; + + fputs("P5 384 289 255 ", fd); + (void) fwrite(data + 64, 1, 384*289, fd); + fclose(fd); + printf("saved image to %s\n", filename); + return 0; +} + +static int next_state(void) +{ + int r = 0; + printf("old state: %d\n", state); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_REMOVED: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON; + r = set_mode_async(MODE_AWAIT_FINGER_ON); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON: + state = STATE_AWAIT_IRQ_FINGER_DETECTED; + break; + case STATE_AWAIT_IRQ_FINGER_DETECTED: + state = STATE_AWAIT_MODE_CHANGE_CAPTURE; + r = set_mode_async(MODE_CAPTURE); + break; + case STATE_AWAIT_MODE_CHANGE_CAPTURE: + state = STATE_AWAIT_IMAGE; + break; + case STATE_AWAIT_IMAGE: + state = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF; + r = set_mode_async(MODE_AWAIT_FINGER_OFF); + break; + case STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF: + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + break; + default: + printf("unrecognised state %d\n", state); + } + if (r < 0) { + fprintf(stderr, "error detected changing state\n"); + return r; + } + + printf("new state: %d\n", state); + return 0; +} + +static void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer) +{ + unsigned char irqtype = transfer->buffer[0]; + + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "irq transfer status %d?\n", transfer->status); + irq_transfer = NULL; + request_exit(2); + return; + } + + printf("IRQ callback %02x\n", irqtype); + switch (state) { + case STATE_AWAIT_IRQ_FINGER_DETECTED: + if (irqtype == 0x01) { + if (next_state() < 0) { + request_exit(2); + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + case STATE_AWAIT_IRQ_FINGER_REMOVED: + if (irqtype == 0x02) { + if (next_state() < 0) { + request_exit(2); + return; + } + } else { + printf("finger-on-sensor detected in wrong state!\n"); + } + break; + } + if (libusb_submit_transfer(irq_transfer) < 0) + request_exit(2); +} + +static void LIBUSB_CALL cb_img(struct libusb_transfer *transfer) +{ + if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { + fprintf(stderr, "img transfer status %d?\n", transfer->status); + img_transfer = NULL; + request_exit(2); + return; + } + + printf("Image callback\n"); + save_to_file(imgbuf); + if (next_state() < 0) { + request_exit(2); + return; + } + if (libusb_submit_transfer(img_transfer) < 0) + request_exit(2); +} + +static int init_capture(void) +{ + int r; + + r = libusb_submit_transfer(irq_transfer); + if (r < 0) + return r; + + r = libusb_submit_transfer(img_transfer); + if (r < 0) { + libusb_cancel_transfer(irq_transfer); + while (irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + return r; + } + + /* start state machine */ + state = STATE_AWAIT_IRQ_FINGER_REMOVED; + return next_state(); +} + +static int do_init(void) +{ + unsigned char status; + int r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + if (!(status & 0x80)) { + r = set_hwstat(status | 0x80); + if (r < 0) + return r; + r = get_hwstat(&status); + if (r < 0) + return r; + } + + status &= ~0x80; + r = set_hwstat(status); + if (r < 0) + return r; + + r = get_hwstat(&status); + if (r < 0) + return r; + + r = sync_intr(0x56); + if (r < 0) + return r; + + return 0; +} + +static int alloc_transfers(void) +{ + img_transfer = libusb_alloc_transfer(0); + if (!img_transfer) + return -ENOMEM; + + irq_transfer = libusb_alloc_transfer(0); + if (!irq_transfer) + return -ENOMEM; + + libusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf, + sizeof(imgbuf), cb_img, NULL, 0); + libusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf, + sizeof(irqbuf), cb_irq, NULL, 0); + + return 0; +} + +static void sighandler(int signum) +{ + request_exit(1); +} + +int main(void) +{ + struct sigaction sigact; + int r = 1; + + r = libusb_init(NULL); + if (r < 0) { + fprintf(stderr, "failed to initialise libusb\n"); + exit(1); + } + + r = find_dpfp_device(); + if (r < 0) { + fprintf(stderr, "Could not find/open device\n"); + goto out; + } + + r = libusb_claim_interface(devh, 0); + if (r < 0) { + fprintf(stderr, "usb_claim_interface error %d %s\n", r, strerror(-r)); + goto out; + } + printf("claimed interface\n"); + + r = print_f0_data(); + if (r < 0) + goto out_release; + + r = do_init(); + if (r < 0) + goto out_deinit; + + /* async from here onwards */ + + sigact.sa_handler = sighandler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = 0; + sigaction(SIGINT, &sigact, NULL); + sigaction(SIGTERM, &sigact, NULL); + sigaction(SIGQUIT, &sigact, NULL); + + r = pthread_create(&poll_thread, NULL, poll_thread_main, NULL); + if (r) + goto out_deinit; + + r = alloc_transfers(); + if (r < 0) { + request_exit(1); + pthread_join(poll_thread, NULL); + goto out_deinit; + } + + r = init_capture(); + if (r < 0) { + request_exit(1); + pthread_join(poll_thread, NULL); + goto out_deinit; + } + + while (!do_exit) { + pthread_mutex_lock(&exit_cond_lock); + pthread_cond_wait(&exit_cond, &exit_cond_lock); + pthread_mutex_unlock(&exit_cond_lock); + } + + printf("shutting down...\n"); + pthread_join(poll_thread, NULL); + + r = libusb_cancel_transfer(irq_transfer); + if (r < 0) { + request_exit(1); + goto out_deinit; + } + + r = libusb_cancel_transfer(img_transfer); + if (r < 0) { + request_exit(1); + goto out_deinit; + } + + while (img_transfer || irq_transfer) + if (libusb_handle_events(NULL) < 0) + break; + + if (do_exit == 1) + r = 0; + else + r = 1; + +out_deinit: + libusb_free_transfer(img_transfer); + libusb_free_transfer(irq_transfer); + set_mode(0); + set_hwstat(0x80); +out_release: + libusb_release_interface(devh, 0); +out: + libusb_close(devh); + libusb_exit(NULL); + return r >= 0 ? r : -r; +} + diff --git a/thirdparty/libusb/libusb-1.0.9/examples/listdevs.c b/thirdparty/libusb/libusb-1.0.9/examples/listdevs.c new file mode 100644 index 0000000..6ab8917 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/examples/listdevs.c @@ -0,0 +1,64 @@ +/* + * libusb example program to list devices on the bus + * Copyright (C) 2007 Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include + +static void print_devs(libusb_device **devs) +{ + libusb_device *dev; + int i = 0; + + while ((dev = devs[i++]) != NULL) { + struct libusb_device_descriptor desc; + int r = libusb_get_device_descriptor(dev, &desc); + if (r < 0) { + fprintf(stderr, "failed to get device descriptor"); + return; + } + + printf("%04x:%04x (bus %d, device %d)\n", + desc.idVendor, desc.idProduct, + libusb_get_bus_number(dev), libusb_get_device_address(dev)); + } +} + +int main(void) +{ + libusb_device **devs; + int r; + ssize_t cnt; + + r = libusb_init(NULL); + if (r < 0) + return r; + + cnt = libusb_get_device_list(NULL, &devs); + if (cnt < 0) + return (int) cnt; + + print_devs(devs); + libusb_free_device_list(devs, 1); + + libusb_exit(NULL); + return 0; +} + diff --git a/thirdparty/libusb/libusb-1.0.9/install-sh b/thirdparty/libusb/libusb-1.0.9/install-sh new file mode 100644 index 0000000..6781b98 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/libusb/libusb-1.0.9/libusb-1.0.pc.in b/thirdparty/libusb/libusb-1.0.9/libusb-1.0.pc.in new file mode 100644 index 0000000..f26babc --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb-1.0.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libusb-1.0 +Description: C API for USB device access from Linux, Mac OS X, OpenBSD, NetBSD and Windows userspace +Version: @VERSION@ +Libs: -L${libdir} -lusb-1.0 +Libs.private: @PC_LIBS_PRIVATE@ +Cflags: -I${includedir}/libusb-1.0 + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.am b/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.am new file mode 100644 index 0000000..3316ebc --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.am @@ -0,0 +1,49 @@ +lib_LTLIBRARIES = libusb-1.0.la + +LINUX_USBFS_SRC = os/linux_usbfs.c +DARWIN_USB_SRC = os/darwin_usb.c +OPENBSD_USB_SRC = os/openbsd_usb.c +WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ + libusb-1.0.def + +EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ + $(WINDOWS_USB_SRC) os/threads_posix.c os/threads_windows.c + +if OS_LINUX +OS_SRC = $(LINUX_USBFS_SRC) +endif + +if OS_DARWIN +OS_SRC = $(DARWIN_USB_SRC) +AM_CFLAGS_EXT = -no-cpp-precomp +endif + +if OS_OPENBSD +OS_SRC = $(OPENBSD_USB_SRC) +endif + +if OS_WINDOWS +OS_SRC = $(WINDOWS_USB_SRC) + +.rc.lo: + $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@ + +libusb-1.0.rc: version.h +endif + +if THREADS_POSIX +THREADS_SRC = os/threads_posix.h os/threads_posix.c +else +THREADS_SRC = os/threads_windows.h os/threads_windows.c +endif + +libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) $(THREAD_CFLAGS) \ + -DLIBUSB_DESCRIBE=\"`git --git-dir "$(top_srcdir)/.git" describe --tags 2>/dev/null`\" +libusb_1_0_la_LDFLAGS = $(LTLDFLAGS) +libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC) \ + os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h \ + $(THREADS_SRC) \ + os/poll_posix.h os/poll_windows.h + +hdrdir = $(includedir)/libusb-1.0 +hdr_HEADERS = libusb.h diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.in b/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.in new file mode 100644 index 0000000..193adae --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/Makefile.in @@ -0,0 +1,718 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = libusb +DIST_COMMON = $(hdr_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libusb/version.h \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libusb_1_0_la_LIBADD = +am__libusb_1_0_la_SOURCES_DIST = libusbi.h core.c descriptor.c io.c \ + sync.c os/darwin_usb.c os/linux_usbfs.c os/openbsd_usb.c \ + os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ + libusb-1.0.def os/linux_usbfs.h os/darwin_usb.h \ + os/windows_usb.h os/threads_windows.h os/threads_windows.c \ + os/threads_posix.h os/threads_posix.c os/poll_posix.h \ + os/poll_windows.h +am__objects_1 = libusb_1_0_la-darwin_usb.lo +am__objects_2 = libusb_1_0_la-linux_usbfs.lo +am__objects_3 = libusb_1_0_la-openbsd_usb.lo +am__objects_4 = libusb_1_0_la-poll_windows.lo \ + libusb_1_0_la-windows_usb.lo libusb-1.0.lo +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_FALSE@@OS_WINDOWS_TRUE@am__objects_5 = $(am__objects_4) +@OS_DARWIN_FALSE@@OS_LINUX_FALSE@@OS_OPENBSD_TRUE@am__objects_5 = $(am__objects_3) +@OS_DARWIN_FALSE@@OS_LINUX_TRUE@am__objects_5 = $(am__objects_2) +@OS_DARWIN_TRUE@am__objects_5 = $(am__objects_1) +@THREADS_POSIX_FALSE@am__objects_6 = libusb_1_0_la-threads_windows.lo +@THREADS_POSIX_TRUE@am__objects_6 = libusb_1_0_la-threads_posix.lo +am_libusb_1_0_la_OBJECTS = libusb_1_0_la-core.lo \ + libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo \ + libusb_1_0_la-sync.lo $(am__objects_5) $(am__objects_6) +libusb_1_0_la_OBJECTS = $(am_libusb_1_0_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libusb_1_0_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libusb_1_0_la_CFLAGS) \ + $(CFLAGS) $(libusb_1_0_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libusb_1_0_la_SOURCES) +DIST_SOURCES = $(am__libusb_1_0_la_SOURCES_DIST) +HEADERS = $(hdr_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLDFLAGS = @LTLDFLAGS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OS_DARWIN = @OS_DARWIN@ +OS_LINUX = @OS_LINUX@ +OS_OPENBSD = @OS_OPENBSD@ +OS_WINDOWS = @OS_WINDOWS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PC_LIBS_PRIVATE = @PC_LIBS_PRIVATE@ +RANLIB = @RANLIB@ +RC = @RC@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +THREAD_CFLAGS = @THREAD_CFLAGS@ +VERSION = @VERSION@ +VISIBILITY_CFLAGS = @VISIBILITY_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = libusb-1.0.la +LINUX_USBFS_SRC = os/linux_usbfs.c +DARWIN_USB_SRC = os/darwin_usb.c +OPENBSD_USB_SRC = os/openbsd_usb.c +WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc \ + libusb-1.0.def + +EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \ + $(WINDOWS_USB_SRC) os/threads_posix.c os/threads_windows.c + +@OS_DARWIN_TRUE@OS_SRC = $(DARWIN_USB_SRC) +@OS_LINUX_TRUE@OS_SRC = $(LINUX_USBFS_SRC) +@OS_OPENBSD_TRUE@OS_SRC = $(OPENBSD_USB_SRC) +@OS_WINDOWS_TRUE@OS_SRC = $(WINDOWS_USB_SRC) +@OS_DARWIN_TRUE@AM_CFLAGS_EXT = -no-cpp-precomp +@THREADS_POSIX_FALSE@THREADS_SRC = os/threads_windows.h os/threads_windows.c +@THREADS_POSIX_TRUE@THREADS_SRC = os/threads_posix.h os/threads_posix.c +libusb_1_0_la_CFLAGS = $(VISIBILITY_CFLAGS) $(AM_CFLAGS) $(THREAD_CFLAGS) \ + -DLIBUSB_DESCRIBE=\"`git --git-dir "$(top_srcdir)/.git" describe --tags 2>/dev/null`\" + +libusb_1_0_la_LDFLAGS = $(LTLDFLAGS) +libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c sync.c $(OS_SRC) \ + os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h \ + $(THREADS_SRC) \ + os/poll_posix.h os/poll_windows.h + +hdrdir = $(includedir)/libusb-1.0 +hdr_HEADERS = libusb.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj .rc +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libusb/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libusb/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libusb-1.0.la: $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_DEPENDENCIES) + $(AM_V_CCLD)$(libusb_1_0_la_LINK) -rpath $(libdir) $(libusb_1_0_la_OBJECTS) $(libusb_1_0_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-core.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-darwin_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-descriptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-poll_windows.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-sync.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-threads_windows.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusb_1_0_la-windows_usb.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libusb_1_0_la-core.lo: core.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-core.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-core.Tpo -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-core.Tpo $(DEPDIR)/libusb_1_0_la-core.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='core.c' object='libusb_1_0_la-core.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '$(srcdir)/'`core.c + +libusb_1_0_la-descriptor.lo: descriptor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-descriptor.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-descriptor.Tpo -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-descriptor.Tpo $(DEPDIR)/libusb_1_0_la-descriptor.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='descriptor.c' object='libusb_1_0_la-descriptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '$(srcdir)/'`descriptor.c + +libusb_1_0_la-io.lo: io.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-io.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-io.Tpo -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-io.Tpo $(DEPDIR)/libusb_1_0_la-io.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='io.c' object='libusb_1_0_la-io.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c + +libusb_1_0_la-sync.lo: sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-sync.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-sync.Tpo -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-sync.Tpo $(DEPDIR)/libusb_1_0_la-sync.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sync.c' object='libusb_1_0_la-sync.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c + +libusb_1_0_la-darwin_usb.lo: os/darwin_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-darwin_usb.Tpo $(DEPDIR)/libusb_1_0_la-darwin_usb.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/darwin_usb.c' object='libusb_1_0_la-darwin_usb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '$(srcdir)/'`os/darwin_usb.c + +libusb_1_0_la-linux_usbfs.lo: os/linux_usbfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-linux_usbfs.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-linux_usbfs.Tpo $(DEPDIR)/libusb_1_0_la-linux_usbfs.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/linux_usbfs.c' object='libusb_1_0_la-linux_usbfs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-linux_usbfs.lo `test -f 'os/linux_usbfs.c' || echo '$(srcdir)/'`os/linux_usbfs.c + +libusb_1_0_la-openbsd_usb.lo: os/openbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-openbsd_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-openbsd_usb.Tpo $(DEPDIR)/libusb_1_0_la-openbsd_usb.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/openbsd_usb.c' object='libusb_1_0_la-openbsd_usb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-openbsd_usb.lo `test -f 'os/openbsd_usb.c' || echo '$(srcdir)/'`os/openbsd_usb.c + +libusb_1_0_la-poll_windows.lo: os/poll_windows.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-poll_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-poll_windows.Tpo $(DEPDIR)/libusb_1_0_la-poll_windows.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/poll_windows.c' object='libusb_1_0_la-poll_windows.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-poll_windows.lo `test -f 'os/poll_windows.c' || echo '$(srcdir)/'`os/poll_windows.c + +libusb_1_0_la-windows_usb.lo: os/windows_usb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-windows_usb.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-windows_usb.Tpo $(DEPDIR)/libusb_1_0_la-windows_usb.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/windows_usb.c' object='libusb_1_0_la-windows_usb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-windows_usb.lo `test -f 'os/windows_usb.c' || echo '$(srcdir)/'`os/windows_usb.c + +libusb_1_0_la-threads_windows.lo: os/threads_windows.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_windows.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_windows.Tpo $(DEPDIR)/libusb_1_0_la-threads_windows.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/threads_windows.c' object='libusb_1_0_la-threads_windows.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_windows.lo `test -f 'os/threads_windows.c' || echo '$(srcdir)/'`os/threads_windows.c + +libusb_1_0_la-threads_posix.lo: os/threads_posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libusb_1_0_la-threads_posix.Tpo $(DEPDIR)/libusb_1_0_la-threads_posix.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/threads_posix.c' object='libusb_1_0_la-threads_posix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libusb_1_0_la_CFLAGS) $(CFLAGS) -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '$(srcdir)/'`os/threads_posix.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-hdrHEADERS: $(hdr_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(hdrdir)" || $(MKDIR_P) "$(DESTDIR)$(hdrdir)" + @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(hdrdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(hdrdir)" || exit $$?; \ + done + +uninstall-hdrHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(hdr_HEADERS)'; test -n "$(hdrdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(hdrdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(hdrdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hdrdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-hdrHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-hdrHEADERS uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-hdrHEADERS \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-hdrHEADERS \ + uninstall-libLTLIBRARIES + + +@OS_WINDOWS_TRUE@.rc.lo: +@OS_WINDOWS_TRUE@ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@ + +@OS_WINDOWS_TRUE@libusb-1.0.rc: version.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/core.c b/thirdparty/libusb/libusb-1.0.9/libusb/core.c new file mode 100644 index 0000000..767dcbf --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/core.c @@ -0,0 +1,1875 @@ +/* + * Core functions for libusb + * Copyright (C) 2007-2008 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#include "libusbi.h" + +#if defined(OS_LINUX) +const struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend; +#elif defined(OS_DARWIN) +const struct usbi_os_backend * const usbi_backend = &darwin_backend; +#elif defined(OS_OPENBSD) +const struct usbi_os_backend * const usbi_backend = &openbsd_backend; +#elif defined(OS_WINDOWS) +const struct usbi_os_backend * const usbi_backend = &windows_backend; +#else +#error "Unsupported OS" +#endif + +const struct libusb_version libusb_version_internal = { + LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO, LIBUSB_RC, + LIBUSB_DESCRIBE +}; + +struct libusb_context *usbi_default_context = NULL; +static int default_context_refcnt = 0; +static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER; + +/** + * \mainpage libusb-1.0 API Reference + * + * \section intro Introduction + * + * libusb is an open source library that allows you to communicate with USB + * devices from userspace. For more info, see the + * libusb homepage. + * + * This documentation is aimed at application developers wishing to + * communicate with USB peripherals from their own software. After reviewing + * this documentation, feedback and questions can be sent to the + * libusb-devel mailing + * list. + * + * This documentation assumes knowledge of how to operate USB devices from + * a software standpoint (descriptors, configurations, interfaces, endpoints, + * control/bulk/interrupt/isochronous transfers, etc). Full information + * can be found in the USB 2.0 + * Specification which is available for free download. You can probably + * find less verbose introductions by searching the web. + * + * \section features Library features + * + * - All transfer types supported (control/bulk/interrupt/isochronous) + * - 2 transfer interfaces: + * -# Synchronous (simple) + * -# Asynchronous (more complicated, but more powerful) + * - Thread safe (although the asynchronous interface means that you + * usually won't need to thread) + * - Lightweight with lean API + * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer + * + * \section gettingstarted Getting Started + * + * To begin reading the API documentation, start with the Modules page which + * links to the different categories of libusb's functionality. + * + * One decision you will have to make is whether to use the synchronous + * or the asynchronous data transfer interface. The \ref io documentation + * provides some insight into this topic. + * + * Some example programs can be found in the libusb source distribution under + * the "examples" subdirectory. The libusb homepage includes a list of + * real-life project examples which use libusb. + * + * \section errorhandling Error handling + * + * libusb functions typically return 0 on success or a negative error code + * on failure. These negative error codes relate to LIBUSB_ERROR constants + * which are listed on the \ref misc "miscellaneous" documentation page. + * + * \section msglog Debug message logging + * + * libusb does not log any messages by default. Your application is therefore + * free to close stdout/stderr and those descriptors may be reused without + * worry. + * + * The libusb_set_debug() function can be used to enable stdout/stderr logging + * of certain messages. Under standard configuration, libusb doesn't really + * log much at all, so you are advised to use this function to enable all + * error/warning/informational messages. It will help you debug problems with + * your software. + * + * The logged messages are unstructured. There is no one-to-one correspondence + * between messages being logged and success or failure return codes from + * libusb functions. There is no format to the messages, so you should not + * try to capture or parse them. They are not and will not be localized. + * These messages are not suitable for being passed to your application user; + * instead, you should interpret the error codes returned from libusb functions + * and provide appropriate notification to the user. The messages are simply + * there to aid you as a programmer, and if you're confused because you're + * getting a strange error code from a libusb function, enabling message + * logging may give you a suitable explanation. + * + * The LIBUSB_DEBUG environment variable can be used to enable message logging + * at run-time. This environment variable should be set to a number, which is + * interpreted the same as the libusb_set_debug() parameter. When this + * environment variable is set, the message logging verbosity level is fixed + * and libusb_set_debug() effectively does nothing. + * + * libusb can be compiled without any logging functions, useful for embedded + * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment + * variable have no effects. + * + * libusb can also be compiled with verbose debugging messages. When the + * library is compiled in this way, all messages of all verbosities are always + * logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable have + * no effects. + * + * \section remarks Other remarks + * + * libusb does have imperfections. The \ref caveats "caveats" page attempts + * to document these. + */ + +/** + * \page caveats Caveats + * + * \section devresets Device resets + * + * The libusb_reset_device() function allows you to reset a device. If your + * program has to call such a function, it should obviously be aware that + * the reset will cause device state to change (e.g. register values may be + * reset). + * + * The problem is that any other program could reset the device your program + * is working with, at any time. libusb does not offer a mechanism to inform + * you when this has happened, so if someone else resets your device it will + * not be clear to your own program why the device state has changed. + * + * Ultimately, this is a limitation of writing drivers in userspace. + * Separation from the USB stack in the underlying kernel makes it difficult + * for the operating system to deliver such notifications to your program. + * The Linux kernel USB stack allows such reset notifications to be delivered + * to in-kernel USB drivers, but it is not clear how such notifications could + * be delivered to second-class drivers that live in userspace. + * + * \section blockonly Blocking-only functionality + * + * The functionality listed below is only available through synchronous, + * blocking functions. There are no asynchronous/non-blocking alternatives, + * and no clear ways of implementing these. + * + * - Configuration activation (libusb_set_configuration()) + * - Interface/alternate setting activation (libusb_set_interface_alt_setting()) + * - Releasing of interfaces (libusb_release_interface()) + * - Clearing of halt/stall condition (libusb_clear_halt()) + * - Device resets (libusb_reset_device()) + * + * \section nohotplug No hotplugging + * + * libusb-1.0 lacks functionality for providing notifications of when devices + * are added or removed. This functionality is planned to be implemented + * for libusb-1.1. + * + * That said, there is basic disconnection handling for open device handles: + * - If there are ongoing transfers, libusb's handle_events loop will detect + * disconnections and complete ongoing transfers with the + * LIBUSB_TRANSFER_NO_DEVICE status code. + * - Many functions such as libusb_set_configuration() return the special + * LIBUSB_ERROR_NO_DEVICE error code when the device has been disconnected. + * + * \section configsel Configuration selection and handling + * + * When libusb presents a device handle to an application, there is a chance + * that the corresponding device may be in unconfigured state. For devices + * with multiple configurations, there is also a chance that the configuration + * currently selected is not the one that the application wants to use. + * + * The obvious solution is to add a call to libusb_set_configuration() early + * on during your device initialization routines, but there are caveats to + * be aware of: + * -# If the device is already in the desired configuration, calling + * libusb_set_configuration() using the same configuration value will cause + * a lightweight device reset. This may not be desirable behaviour. + * -# libusb will be unable to change configuration if the device is in + * another configuration and other programs or drivers have claimed + * interfaces under that configuration. + * -# In the case where the desired configuration is already active, libusb + * may not even be able to perform a lightweight device reset. For example, + * take my USB keyboard with fingerprint reader: I'm interested in driving + * the fingerprint reader interface through libusb, but the kernel's + * USB-HID driver will almost always have claimed the keyboard interface. + * Because the kernel has claimed an interface, it is not even possible to + * perform the lightweight device reset, so libusb_set_configuration() will + * fail. (Luckily the device in question only has a single configuration.) + * + * One solution to some of the above problems is to consider the currently + * active configuration. If the configuration we want is already active, then + * we don't have to select any configuration: +\code +cfg = libusb_get_configuration(dev); +if (cfg != desired) + libusb_set_configuration(dev, desired); +\endcode + * + * This is probably suitable for most scenarios, but is inherently racy: + * another application or driver may change the selected configuration + * after the libusb_get_configuration() call. + * + * Even in cases where libusb_set_configuration() succeeds, consider that other + * applications or drivers may change configuration after your application + * calls libusb_set_configuration(). + * + * One possible way to lock your device into a specific configuration is as + * follows: + * -# Set the desired configuration (or use the logic above to realise that + * it is already in the desired configuration) + * -# Claim the interface that you wish to use + * -# Check that the currently active configuration is the one that you want + * to use. + * + * The above method works because once an interface is claimed, no application + * or driver is able to select another configuration. + * + * \section earlycomp Early transfer completion + * + * NOTE: This section is currently Linux-centric. I am not sure if any of these + * considerations apply to Darwin or other platforms. + * + * When a transfer completes early (i.e. when less data is received/sent in + * any one packet than the transfer buffer allows for) then libusb is designed + * to terminate the transfer immediately, not transferring or receiving any + * more data unless other transfers have been queued by the user. + * + * On legacy platforms, libusb is unable to do this in all situations. After + * the incomplete packet occurs, "surplus" data may be transferred. Prior to + * libusb v1.0.2, this information was lost (and for device-to-host transfers, + * the corresponding data was discarded). As of libusb v1.0.3, this information + * is kept (the data length of the transfer is updated) and, for device-to-host + * transfers, any surplus data was added to the buffer. Still, this is not + * a nice solution because it loses the information about the end of the short + * packet, and the user probably wanted that surplus data to arrive in the next + * logical transfer. + * + * A previous workaround was to only ever submit transfers of size 16kb or + * less. + * + * As of libusb v1.0.4 and Linux v2.6.32, this is fixed. A technical + * explanation of this issue follows. + * + * When you ask libusb to submit a bulk transfer larger than 16kb in size, + * libusb breaks it up into a number of smaller subtransfers. This is because + * the usbfs kernel interface only accepts transfers of up to 16kb in size. + * The subtransfers are submitted all at once so that the kernel can queue + * them at the hardware level, therefore maximizing bus throughput. + * + * On legacy platforms, this caused problems when transfers completed early. + * Upon this event, the kernel would terminate all further packets in that + * subtransfer (but not any following ones). libusb would note this event and + * immediately cancel any following subtransfers that had been queued, + * but often libusb was not fast enough, and the following subtransfers had + * started before libusb got around to cancelling them. + * + * Thanks to an API extension to usbfs, this is fixed with recent kernel and + * libusb releases. The solution was to allow libusb to communicate to the + * kernel where boundaries occur between logical libusb-level transfers. When + * a short transfer (or other error) occurs, the kernel will cancel all the + * subtransfers until the boundary without allowing those transfers to start. + * + * \section zlp Zero length packets + * + * - libusb is able to send a packet of zero length to an endpoint simply by + * submitting a transfer of zero length. On Linux, this did not work with + * libusb versions prior to 1.0.3 and kernel versions prior to 2.6.31. + * - The \ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET + * "LIBUSB_TRANSFER_ADD_ZERO_PACKET" flag is currently only supported on Linux. + */ + +/** + * \page contexts Contexts + * + * It is possible that libusb may be used simultaneously from two independent + * libraries linked into the same executable. For example, if your application + * has a plugin-like system which allows the user to dynamically load a range + * of modules into your program, it is feasible that two independently + * developed modules may both use libusb. + * + * libusb is written to allow for these multiple user scenarios. The two + * "instances" of libusb will not interfere: libusb_set_debug() calls + * from one user will not affect the same settings for other users, other + * users can continue using libusb after one of them calls libusb_exit(), etc. + * + * This is made possible through libusb's context concept. When you + * call libusb_init(), you are (optionally) given a context. You can then pass + * this context pointer back into future libusb functions. + * + * In order to keep things simple for more simplistic applications, it is + * legal to pass NULL to all functions requiring a context pointer (as long as + * you're sure no other code will attempt to use libusb from the same process). + * When you pass NULL, the default context will be used. The default context + * is created the first time a process calls libusb_init() when no other + * context is alive. Contexts are destroyed during libusb_exit(). + * + * The default context is reference-counted and can be shared. That means that + * if libusb_init(NULL) is called twice within the same process, the two + * users end up sharing the same context. The deinitialization and freeing of + * the default context will only happen when the last user calls libusb_exit(). + * In other words, the default context is created and initialized when its + * reference count goes from 0 to 1, and is deinitialized and destroyed when + * its reference count goes from 1 to 0. + * + * You may be wondering why only a subset of libusb functions require a + * context pointer in their function definition. Internally, libusb stores + * context pointers in other objects (e.g. libusb_device instances) and hence + * can infer the context from those objects. + */ + +/** + * @defgroup lib Library initialization/deinitialization + * This page details how to initialize and deinitialize libusb. Initialization + * must be performed before using any libusb functionality, and similarly you + * must not call any libusb functions after deinitialization. + */ + +/** + * @defgroup dev Device handling and enumeration + * The functionality documented below is designed to help with the following + * operations: + * - Enumerating the USB devices currently attached to the system + * - Choosing a device to operate from your software + * - Opening and closing the chosen device + * + * \section nutshell In a nutshell... + * + * The description below really makes things sound more complicated than they + * actually are. The following sequence of function calls will be suitable + * for almost all scenarios and does not require you to have such a deep + * understanding of the resource management issues: + * \code +// discover devices +libusb_device **list; +libusb_device *found = NULL; +ssize_t cnt = libusb_get_device_list(NULL, &list); +ssize_t i = 0; +int err = 0; +if (cnt < 0) + error(); + +for (i = 0; i < cnt; i++) { + libusb_device *device = list[i]; + if (is_interesting(device)) { + found = device; + break; + } +} + +if (found) { + libusb_device_handle *handle; + + err = libusb_open(found, &handle); + if (err) + error(); + // etc +} + +libusb_free_device_list(list, 1); +\endcode + * + * The two important points: + * - You asked libusb_free_device_list() to unreference the devices (2nd + * parameter) + * - You opened the device before freeing the list and unreferencing the + * devices + * + * If you ended up with a handle, you can now proceed to perform I/O on the + * device. + * + * \section devshandles Devices and device handles + * libusb has a concept of a USB device, represented by the + * \ref libusb_device opaque type. A device represents a USB device that + * is currently or was previously connected to the system. Using a reference + * to a device, you can determine certain information about the device (e.g. + * you can read the descriptor data). + * + * The libusb_get_device_list() function can be used to obtain a list of + * devices currently connected to the system. This is known as device + * discovery. + * + * Just because you have a reference to a device does not mean it is + * necessarily usable. The device may have been unplugged, you may not have + * permission to operate such device, or another program or driver may be + * using the device. + * + * When you've found a device that you'd like to operate, you must ask + * libusb to open the device using the libusb_open() function. Assuming + * success, libusb then returns you a device handle + * (a \ref libusb_device_handle pointer). All "real" I/O operations then + * operate on the handle rather than the original device pointer. + * + * \section devref Device discovery and reference counting + * + * Device discovery (i.e. calling libusb_get_device_list()) returns a + * freshly-allocated list of devices. The list itself must be freed when + * you are done with it. libusb also needs to know when it is OK to free + * the contents of the list - the devices themselves. + * + * To handle these issues, libusb provides you with two separate items: + * - A function to free the list itself + * - A reference counting system for the devices inside + * + * New devices presented by the libusb_get_device_list() function all have a + * reference count of 1. You can increase and decrease reference count using + * libusb_ref_device() and libusb_unref_device(). A device is destroyed when + * its reference count reaches 0. + * + * With the above information in mind, the process of opening a device can + * be viewed as follows: + * -# Discover devices using libusb_get_device_list(). + * -# Choose the device that you want to operate, and call libusb_open(). + * -# Unref all devices in the discovered device list. + * -# Free the discovered device list. + * + * The order is important - you must not unreference the device before + * attempting to open it, because unreferencing it may destroy the device. + * + * For convenience, the libusb_free_device_list() function includes a + * parameter to optionally unreference all the devices in the list before + * freeing the list itself. This combines steps 3 and 4 above. + * + * As an implementation detail, libusb_open() actually adds a reference to + * the device in question. This is because the device remains available + * through the handle via libusb_get_device(). The reference is deleted during + * libusb_close(). + */ + +/** @defgroup misc Miscellaneous */ + +/* we traverse usbfs without knowing how many devices we are going to find. + * so we create this discovered_devs model which is similar to a linked-list + * which grows when required. it can be freed once discovery has completed, + * eliminating the need for a list node in the libusb_device structure + * itself. */ +#define DISCOVERED_DEVICES_SIZE_STEP 8 + +static struct discovered_devs *discovered_devs_alloc(void) +{ + struct discovered_devs *ret = + malloc(sizeof(*ret) + (sizeof(void *) * DISCOVERED_DEVICES_SIZE_STEP)); + + if (ret) { + ret->len = 0; + ret->capacity = DISCOVERED_DEVICES_SIZE_STEP; + } + return ret; +} + +/* append a device to the discovered devices collection. may realloc itself, + * returning new discdevs. returns NULL on realloc failure. */ +struct discovered_devs *discovered_devs_append( + struct discovered_devs *discdevs, struct libusb_device *dev) +{ + size_t len = discdevs->len; + size_t capacity; + + /* if there is space, just append the device */ + if (len < discdevs->capacity) { + discdevs->devices[len] = libusb_ref_device(dev); + discdevs->len++; + return discdevs; + } + + /* exceeded capacity, need to grow */ + usbi_dbg("need to increase capacity"); + capacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP; + discdevs = realloc(discdevs, + sizeof(*discdevs) + (sizeof(void *) * capacity)); + if (discdevs) { + discdevs->capacity = capacity; + discdevs->devices[len] = libusb_ref_device(dev); + discdevs->len++; + } + + return discdevs; +} + +static void discovered_devs_free(struct discovered_devs *discdevs) +{ + size_t i; + + for (i = 0; i < discdevs->len; i++) + libusb_unref_device(discdevs->devices[i]); + + free(discdevs); +} + +/* Allocate a new device with a specific session ID. The returned device has + * a reference count of 1. */ +struct libusb_device *usbi_alloc_device(struct libusb_context *ctx, + unsigned long session_id) +{ + size_t priv_size = usbi_backend->device_priv_size; + struct libusb_device *dev = calloc(1, sizeof(*dev) + priv_size); + int r; + + if (!dev) + return NULL; + + r = usbi_mutex_init(&dev->lock, NULL); + if (r) { + free(dev); + return NULL; + } + + dev->ctx = ctx; + dev->refcnt = 1; + dev->session_data = session_id; + dev->speed = LIBUSB_SPEED_UNKNOWN; + memset(&dev->os_priv, 0, priv_size); + + usbi_mutex_lock(&ctx->usb_devs_lock); + list_add(&dev->list, &ctx->usb_devs); + usbi_mutex_unlock(&ctx->usb_devs_lock); + return dev; +} + +/* Perform some final sanity checks on a newly discovered device. If this + * function fails (negative return code), the device should not be added + * to the discovered device list. */ +int usbi_sanitize_device(struct libusb_device *dev) +{ + int r; + unsigned char raw_desc[DEVICE_DESC_LENGTH]; + uint8_t num_configurations; + int host_endian; + + r = usbi_backend->get_device_descriptor(dev, raw_desc, &host_endian); + if (r < 0) + return r; + + num_configurations = raw_desc[DEVICE_DESC_LENGTH - 1]; + if (num_configurations > USB_MAXCONFIG) { + usbi_err(DEVICE_CTX(dev), "too many configurations"); + return LIBUSB_ERROR_IO; + } else if (0 == num_configurations) + usbi_dbg("zero configurations, maybe an unauthorized device"); + + dev->num_configurations = num_configurations; + return 0; +} + +/* Examine libusb's internal list of known devices, looking for one with + * a specific session ID. Returns the matching device if it was found, and + * NULL otherwise. */ +struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx, + unsigned long session_id) +{ + struct libusb_device *dev; + struct libusb_device *ret = NULL; + + usbi_mutex_lock(&ctx->usb_devs_lock); + list_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) + if (dev->session_data == session_id) { + ret = dev; + break; + } + usbi_mutex_unlock(&ctx->usb_devs_lock); + + return ret; +} + +/** @ingroup dev + * Returns a list of USB devices currently attached to the system. This is + * your entry point into finding a USB device to operate. + * + * You are expected to unreference all the devices when you are done with + * them, and then free the list with libusb_free_device_list(). Note that + * libusb_free_device_list() can unref all the devices for you. Be careful + * not to unreference a device you are about to open until after you have + * opened it. + * + * This return value of this function indicates the number of devices in + * the resultant list. The list is actually one element larger, as it is + * NULL-terminated. + * + * \param ctx the context to operate on, or NULL for the default context + * \param list output location for a list of devices. Must be later freed with + * libusb_free_device_list(). + * \returns The number of devices in the outputted list, or any + * \ref libusb_error according to errors encountered by the backend. + */ +ssize_t API_EXPORTED libusb_get_device_list(libusb_context *ctx, + libusb_device ***list) +{ + struct discovered_devs *discdevs = discovered_devs_alloc(); + struct libusb_device **ret; + int r = 0; + ssize_t i, len; + USBI_GET_CONTEXT(ctx); + usbi_dbg(""); + + if (!discdevs) + return LIBUSB_ERROR_NO_MEM; + + r = usbi_backend->get_device_list(ctx, &discdevs); + if (r < 0) { + len = r; + goto out; + } + + /* convert discovered_devs into a list */ + len = discdevs->len; + ret = malloc(sizeof(void *) * (len + 1)); + if (!ret) { + len = LIBUSB_ERROR_NO_MEM; + goto out; + } + + ret[len] = NULL; + for (i = 0; i < len; i++) { + struct libusb_device *dev = discdevs->devices[i]; + ret[i] = libusb_ref_device(dev); + } + *list = ret; + +out: + discovered_devs_free(discdevs); + return len; +} + +/** \ingroup dev + * Frees a list of devices previously discovered using + * libusb_get_device_list(). If the unref_devices parameter is set, the + * reference count of each device in the list is decremented by 1. + * \param list the list to free + * \param unref_devices whether to unref the devices in the list + */ +void API_EXPORTED libusb_free_device_list(libusb_device **list, + int unref_devices) +{ + if (!list) + return; + + if (unref_devices) { + int i = 0; + struct libusb_device *dev; + + while ((dev = list[i++]) != NULL) + libusb_unref_device(dev); + } + free(list); +} + +/** \ingroup dev + * Get the number of the bus that a device is connected to. + * \param dev a device + * \returns the bus number + */ +uint8_t API_EXPORTED libusb_get_bus_number(libusb_device *dev) +{ + return dev->bus_number; +} + +/** \ingroup dev + * Get the address of the device on the bus it is connected to. + * \param dev a device + * \returns the device address + */ +uint8_t API_EXPORTED libusb_get_device_address(libusb_device *dev) +{ + return dev->device_address; +} + +/** \ingroup dev + * Get the negotiated connection speed for a device. + * \param dev a device + * \returns a \ref libusb_speed code, where LIBUSB_SPEED_UNKNOWN means that + * the OS doesn't know or doesn't support returning the negotiated speed. + */ +int API_EXPORTED libusb_get_device_speed(libusb_device *dev) +{ + return dev->speed; +} + +static const struct libusb_endpoint_descriptor *find_endpoint( + struct libusb_config_descriptor *config, unsigned char endpoint) +{ + int iface_idx; + for (iface_idx = 0; iface_idx < config->bNumInterfaces; iface_idx++) { + const struct libusb_interface *iface = &config->interface[iface_idx]; + int altsetting_idx; + + for (altsetting_idx = 0; altsetting_idx < iface->num_altsetting; + altsetting_idx++) { + const struct libusb_interface_descriptor *altsetting + = &iface->altsetting[altsetting_idx]; + int ep_idx; + + for (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) { + const struct libusb_endpoint_descriptor *ep = + &altsetting->endpoint[ep_idx]; + if (ep->bEndpointAddress == endpoint) + return ep; + } + } + } + return NULL; +} + +/** \ingroup dev + * Convenience function to retrieve the wMaxPacketSize value for a particular + * endpoint in the active device configuration. + * + * This function was originally intended to be of assistance when setting up + * isochronous transfers, but a design mistake resulted in this function + * instead. It simply returns the wMaxPacketSize value without considering + * its contents. If you're dealing with isochronous transfers, you probably + * want libusb_get_max_iso_packet_size() instead. + * + * \param dev a device + * \param endpoint address of the endpoint in question + * \returns the wMaxPacketSize value + * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist + * \returns LIBUSB_ERROR_OTHER on other failure + */ +int API_EXPORTED libusb_get_max_packet_size(libusb_device *dev, + unsigned char endpoint) +{ + struct libusb_config_descriptor *config; + const struct libusb_endpoint_descriptor *ep; + int r; + + r = libusb_get_active_config_descriptor(dev, &config); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), + "could not retrieve active config descriptor"); + return LIBUSB_ERROR_OTHER; + } + + ep = find_endpoint(config, endpoint); + if (!ep) + return LIBUSB_ERROR_NOT_FOUND; + + r = ep->wMaxPacketSize; + libusb_free_config_descriptor(config); + return r; +} + +/** \ingroup dev + * Calculate the maximum packet size which a specific endpoint is capable is + * sending or receiving in the duration of 1 microframe + * + * Only the active configution is examined. The calculation is based on the + * wMaxPacketSize field in the endpoint descriptor as described in section + * 9.6.6 in the USB 2.0 specifications. + * + * If acting on an isochronous or interrupt endpoint, this function will + * multiply the value found in bits 0:10 by the number of transactions per + * microframe (determined by bits 11:12). Otherwise, this function just + * returns the numeric value found in bits 0:10. + * + * This function is useful for setting up isochronous transfers, for example + * you might pass the return value from this function to + * libusb_set_iso_packet_lengths() in order to set the length field of every + * isochronous packet in a transfer. + * + * Since v1.0.3. + * + * \param dev a device + * \param endpoint address of the endpoint in question + * \returns the maximum packet size which can be sent/received on this endpoint + * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist + * \returns LIBUSB_ERROR_OTHER on other failure + */ +int API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev, + unsigned char endpoint) +{ + struct libusb_config_descriptor *config; + const struct libusb_endpoint_descriptor *ep; + enum libusb_transfer_type ep_type; + uint16_t val; + int r; + + r = libusb_get_active_config_descriptor(dev, &config); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), + "could not retrieve active config descriptor"); + return LIBUSB_ERROR_OTHER; + } + + ep = find_endpoint(config, endpoint); + if (!ep) + return LIBUSB_ERROR_NOT_FOUND; + + val = ep->wMaxPacketSize; + ep_type = ep->bmAttributes & 0x3; + libusb_free_config_descriptor(config); + + r = val & 0x07ff; + if (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS + || ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT) + r *= (1 + ((val >> 11) & 3)); + return r; +} + +/** \ingroup dev + * Increment the reference count of a device. + * \param dev the device to reference + * \returns the same device + */ +DEFAULT_VISIBILITY +libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev) +{ + usbi_mutex_lock(&dev->lock); + dev->refcnt++; + usbi_mutex_unlock(&dev->lock); + return dev; +} + +/** \ingroup dev + * Decrement the reference count of a device. If the decrement operation + * causes the reference count to reach zero, the device shall be destroyed. + * \param dev the device to unreference + */ +void API_EXPORTED libusb_unref_device(libusb_device *dev) +{ + int refcnt; + + if (!dev) + return; + + usbi_mutex_lock(&dev->lock); + refcnt = --dev->refcnt; + usbi_mutex_unlock(&dev->lock); + + if (refcnt == 0) { + usbi_dbg("destroy device %d.%d", dev->bus_number, dev->device_address); + + if (usbi_backend->destroy_device) + usbi_backend->destroy_device(dev); + + usbi_mutex_lock(&dev->ctx->usb_devs_lock); + list_del(&dev->list); + usbi_mutex_unlock(&dev->ctx->usb_devs_lock); + + usbi_mutex_destroy(&dev->lock); + free(dev); + } +} + +/* + * Interrupt the iteration of the event handling thread, so that it picks + * up the new fd. + */ +void usbi_fd_notification(struct libusb_context *ctx) +{ + unsigned char dummy = 1; + ssize_t r; + + if (ctx == NULL) + return; + + /* record that we are messing with poll fds */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify++; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + + /* write some data on control pipe to interrupt event handlers */ + r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(ctx, "internal signalling write failed"); + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify--; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + return; + } + + /* take event handling lock */ + libusb_lock_events(ctx); + + /* read the dummy data */ + r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); + if (r <= 0) + usbi_warn(ctx, "internal signalling read failed"); + + /* we're done with modifying poll fds */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify--; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + + /* Release event handling lock and wake up event waiters */ + libusb_unlock_events(ctx); +} + +/** \ingroup dev + * Open a device and obtain a device handle. A handle allows you to perform + * I/O on the device in question. + * + * Internally, this function adds a reference to the device and makes it + * available to you through libusb_get_device(). This reference is removed + * during libusb_close(). + * + * This is a non-blocking function; no requests are sent over the bus. + * + * \param dev the device to open + * \param handle output location for the returned device handle pointer. Only + * populated when the return code is 0. + * \returns 0 on success + * \returns LIBUSB_ERROR_NO_MEM on memory allocation failure + * \returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_open(libusb_device *dev, + libusb_device_handle **handle) +{ + struct libusb_context *ctx = DEVICE_CTX(dev); + struct libusb_device_handle *_handle; + size_t priv_size = usbi_backend->device_handle_priv_size; + int r; + usbi_dbg("open %d.%d", dev->bus_number, dev->device_address); + + _handle = malloc(sizeof(*_handle) + priv_size); + if (!_handle) + return LIBUSB_ERROR_NO_MEM; + + r = usbi_mutex_init(&_handle->lock, NULL); + if (r) { + free(_handle); + return LIBUSB_ERROR_OTHER; + } + + _handle->dev = libusb_ref_device(dev); + _handle->claimed_interfaces = 0; + memset(&_handle->os_priv, 0, priv_size); + + r = usbi_backend->open(_handle); + if (r < 0) { + usbi_dbg("open %d.%d returns %d", dev->bus_number, dev->device_address, r); + libusb_unref_device(dev); + usbi_mutex_destroy(&_handle->lock); + free(_handle); + return r; + } + + usbi_mutex_lock(&ctx->open_devs_lock); + list_add(&_handle->list, &ctx->open_devs); + usbi_mutex_unlock(&ctx->open_devs_lock); + *handle = _handle; + + /* At this point, we want to interrupt any existing event handlers so + * that they realise the addition of the new device's poll fd. One + * example when this is desirable is if the user is running a separate + * dedicated libusb events handling thread, which is running with a long + * or infinite timeout. We want to interrupt that iteration of the loop, + * so that it picks up the new fd, and then continues. */ + usbi_fd_notification(ctx); + + return 0; +} + +/** \ingroup dev + * Convenience function for finding a device with a particular + * idVendor/idProduct combination. This function is intended + * for those scenarios where you are using libusb to knock up a quick test + * application - it allows you to avoid calling libusb_get_device_list() and + * worrying about traversing/freeing the list. + * + * This function has limitations and is hence not intended for use in real + * applications: if multiple devices have the same IDs it will only + * give you the first one, etc. + * + * \param ctx the context to operate on, or NULL for the default context + * \param vendor_id the idVendor value to search for + * \param product_id the idProduct value to search for + * \returns a handle for the first found device, or NULL on error or if the + * device could not be found. */ +DEFAULT_VISIBILITY +libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( + libusb_context *ctx, uint16_t vendor_id, uint16_t product_id) +{ + struct libusb_device **devs; + struct libusb_device *found = NULL; + struct libusb_device *dev; + struct libusb_device_handle *handle = NULL; + size_t i = 0; + int r; + + if (libusb_get_device_list(ctx, &devs) < 0) + return NULL; + + while ((dev = devs[i++]) != NULL) { + struct libusb_device_descriptor desc; + r = libusb_get_device_descriptor(dev, &desc); + if (r < 0) + goto out; + if (desc.idVendor == vendor_id && desc.idProduct == product_id) { + found = dev; + break; + } + } + + if (found) { + r = libusb_open(found, &handle); + if (r < 0) + handle = NULL; + } + +out: + libusb_free_device_list(devs, 1); + return handle; +} + +static void do_close(struct libusb_context *ctx, + struct libusb_device_handle *dev_handle) +{ + struct usbi_transfer *itransfer; + struct usbi_transfer *tmp; + + libusb_lock_events(ctx); + + /* remove any transfers in flight that are for this device */ + usbi_mutex_lock(&ctx->flying_transfers_lock); + + /* safe iteration because transfers may be being deleted */ + list_for_each_entry_safe(itransfer, tmp, &ctx->flying_transfers, list, struct usbi_transfer) { + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + if (transfer->dev_handle != dev_handle) + continue; + + if (!(itransfer->flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) { + usbi_err(ctx, "Device handle closed while transfer was still being processed, but the device is still connected as far as we know"); + + if (itransfer->flags & USBI_TRANSFER_CANCELLING) + usbi_warn(ctx, "A cancellation for an in-flight transfer hasn't completed but closing the device handle"); + else + usbi_err(ctx, "A cancellation hasn't even been scheduled on the transfer for which the device is closing"); + } + + /* remove from the list of in-flight transfers and make sure + * we don't accidentally use the device handle in the future + * (or that such accesses will be easily caught and identified as a crash) + */ + usbi_mutex_lock(&itransfer->lock); + list_del(&itransfer->list); + transfer->dev_handle = NULL; + usbi_mutex_unlock(&itransfer->lock); + + /* it is up to the user to free up the actual transfer struct. this is + * just making sure that we don't attempt to process the transfer after + * the device handle is invalid + */ + usbi_dbg("Removed transfer %p from the in-flight list because device handle %p closed", + transfer, dev_handle); + } + usbi_mutex_unlock(&ctx->flying_transfers_lock); + + libusb_unlock_events(ctx); + + usbi_mutex_lock(&ctx->open_devs_lock); + list_del(&dev_handle->list); + usbi_mutex_unlock(&ctx->open_devs_lock); + + usbi_backend->close(dev_handle); + libusb_unref_device(dev_handle->dev); + usbi_mutex_destroy(&dev_handle->lock); + free(dev_handle); +} + +/** \ingroup dev + * Close a device handle. Should be called on all open handles before your + * application exits. + * + * Internally, this function destroys the reference that was added by + * libusb_open() on the given device. + * + * This is a non-blocking function; no requests are sent over the bus. + * + * \param dev_handle the handle to close + */ +void API_EXPORTED libusb_close(libusb_device_handle *dev_handle) +{ + struct libusb_context *ctx; + unsigned char dummy = 1; + ssize_t r; + + if (!dev_handle) + return; + usbi_dbg(""); + + ctx = HANDLE_CTX(dev_handle); + + /* Similarly to libusb_open(), we want to interrupt all event handlers + * at this point. More importantly, we want to perform the actual close of + * the device while holding the event handling lock (preventing any other + * thread from doing event handling) because we will be removing a file + * descriptor from the polling loop. */ + + /* record that we are messing with poll fds */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify++; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + + /* write some data on control pipe to interrupt event handlers */ + r = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); + if (r <= 0) { + usbi_warn(ctx, "internal signalling write failed, closing anyway"); + do_close(ctx, dev_handle); + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify--; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + return; + } + + /* take event handling lock */ + libusb_lock_events(ctx); + + /* read the dummy data */ + r = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy)); + if (r <= 0) + usbi_warn(ctx, "internal signalling read failed, closing anyway"); + + /* Close the device */ + do_close(ctx, dev_handle); + + /* we're done with modifying poll fds */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + ctx->pollfd_modify--; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + + /* Release event handling lock and wake up event waiters */ + libusb_unlock_events(ctx); +} + +/** \ingroup dev + * Get the underlying device for a handle. This function does not modify + * the reference count of the returned device, so do not feel compelled to + * unreference it when you are done. + * \param dev_handle a device handle + * \returns the underlying device + */ +DEFAULT_VISIBILITY +libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle) +{ + return dev_handle->dev; +} + +/** \ingroup dev + * Determine the bConfigurationValue of the currently active configuration. + * + * You could formulate your own control request to obtain this information, + * but this function has the advantage that it may be able to retrieve the + * information from operating system caches (no I/O involved). + * + * If the OS does not cache this information, then this function will block + * while a control transfer is submitted to retrieve the information. + * + * This function will return a value of 0 in the config output + * parameter if the device is in unconfigured state. + * + * \param dev a device handle + * \param config output location for the bConfigurationValue of the active + * configuration (only valid for return code 0) + * \returns 0 on success + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_get_configuration(libusb_device_handle *dev, + int *config) +{ + int r = LIBUSB_ERROR_NOT_SUPPORTED; + + usbi_dbg(""); + if (usbi_backend->get_configuration) + r = usbi_backend->get_configuration(dev, config); + + if (r == LIBUSB_ERROR_NOT_SUPPORTED) { + uint8_t tmp = 0; + usbi_dbg("falling back to control message"); + r = libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000); + if (r == 0) { + usbi_err(HANDLE_CTX(dev), "zero bytes returned in ctrl transfer?"); + r = LIBUSB_ERROR_IO; + } else if (r == 1) { + r = 0; + *config = tmp; + } else { + usbi_dbg("control failed, error %d", r); + } + } + + if (r == 0) + usbi_dbg("active config %d", *config); + + return r; +} + +/** \ingroup dev + * Set the active configuration for a device. + * + * The operating system may or may not have already set an active + * configuration on the device. It is up to your application to ensure the + * correct configuration is selected before you attempt to claim interfaces + * and perform other operations. + * + * If you call this function on a device already configured with the selected + * configuration, then this function will act as a lightweight device reset: + * it will issue a SET_CONFIGURATION request using the current configuration, + * causing most USB-related device state to be reset (altsetting reset to zero, + * endpoint halts cleared, toggles reset). + * + * You cannot change/reset configuration if your application has claimed + * interfaces - you should free them with libusb_release_interface() first. + * You cannot change/reset configuration if other applications or drivers have + * claimed interfaces. + * + * A configuration value of -1 will put the device in unconfigured state. + * The USB specifications state that a configuration value of 0 does this, + * however buggy devices exist which actually have a configuration 0. + * + * You should always use this function rather than formulating your own + * SET_CONFIGURATION control request. This is because the underlying operating + * system needs to know when such changes happen. + * + * This is a blocking function. + * + * \param dev a device handle + * \param configuration the bConfigurationValue of the configuration you + * wish to activate, or -1 if you wish to put the device in unconfigured state + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist + * \returns LIBUSB_ERROR_BUSY if interfaces are currently claimed + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_set_configuration(libusb_device_handle *dev, + int configuration) +{ + usbi_dbg("configuration %d", configuration); + return usbi_backend->set_configuration(dev, configuration); +} + +/** \ingroup dev + * Claim an interface on a given device handle. You must claim the interface + * you wish to use before you can perform I/O on any of its endpoints. + * + * It is legal to attempt to claim an already-claimed interface, in which + * case libusb just returns 0 without doing anything. + * + * Claiming of interfaces is a purely logical operation; it does not cause + * any requests to be sent over the bus. Interface claiming is used to + * instruct the underlying operating system that your application wishes + * to take ownership of the interface. + * + * This is a non-blocking function. + * + * \param dev a device handle + * \param interface_number the bInterfaceNumber of the interface you + * wish to claim + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist + * \returns LIBUSB_ERROR_BUSY if another program or driver has claimed the + * interface + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns a LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_claim_interface(libusb_device_handle *dev, + int interface_number) +{ + int r = 0; + + usbi_dbg("interface %d", interface_number); + if (interface_number >= USB_MAXINTERFACES) + return LIBUSB_ERROR_INVALID_PARAM; + + usbi_mutex_lock(&dev->lock); + if (dev->claimed_interfaces & (1 << interface_number)) + goto out; + + r = usbi_backend->claim_interface(dev, interface_number); + if (r == 0) + dev->claimed_interfaces |= 1 << interface_number; + +out: + usbi_mutex_unlock(&dev->lock); + return r; +} + +/** \ingroup dev + * Release an interface previously claimed with libusb_claim_interface(). You + * should release all claimed interfaces before closing a device handle. + * + * This is a blocking function. A SET_INTERFACE control request will be sent + * to the device, resetting interface state to the first alternate setting. + * + * \param dev a device handle + * \param interface_number the bInterfaceNumber of the + * previously-claimed interface + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_release_interface(libusb_device_handle *dev, + int interface_number) +{ + int r; + + usbi_dbg("interface %d", interface_number); + if (interface_number >= USB_MAXINTERFACES) + return LIBUSB_ERROR_INVALID_PARAM; + + usbi_mutex_lock(&dev->lock); + if (!(dev->claimed_interfaces & (1 << interface_number))) { + r = LIBUSB_ERROR_NOT_FOUND; + goto out; + } + + r = usbi_backend->release_interface(dev, interface_number); + if (r == 0) + dev->claimed_interfaces &= ~(1 << interface_number); + +out: + usbi_mutex_unlock(&dev->lock); + return r; +} + +/** \ingroup dev + * Activate an alternate setting for an interface. The interface must have + * been previously claimed with libusb_claim_interface(). + * + * You should always use this function rather than formulating your own + * SET_INTERFACE control request. This is because the underlying operating + * system needs to know when such changes happen. + * + * This is a blocking function. + * + * \param dev a device handle + * \param interface_number the bInterfaceNumber of the + * previously-claimed interface + * \param alternate_setting the bAlternateSetting of the alternate + * setting to activate + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the + * requested alternate setting does not exist + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev, + int interface_number, int alternate_setting) +{ + usbi_dbg("interface %d altsetting %d", + interface_number, alternate_setting); + if (interface_number >= USB_MAXINTERFACES) + return LIBUSB_ERROR_INVALID_PARAM; + + usbi_mutex_lock(&dev->lock); + if (!(dev->claimed_interfaces & (1 << interface_number))) { + usbi_mutex_unlock(&dev->lock); + return LIBUSB_ERROR_NOT_FOUND; + } + usbi_mutex_unlock(&dev->lock); + + return usbi_backend->set_interface_altsetting(dev, interface_number, + alternate_setting); +} + +/** \ingroup dev + * Clear the halt/stall condition for an endpoint. Endpoints with halt status + * are unable to receive or transmit data until the halt condition is stalled. + * + * You should cancel all pending transfers before attempting to clear the halt + * condition. + * + * This is a blocking function. + * + * \param dev a device handle + * \param endpoint the endpoint to clear halt status + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_clear_halt(libusb_device_handle *dev, + unsigned char endpoint) +{ + usbi_dbg("endpoint %x", endpoint); + return usbi_backend->clear_halt(dev, endpoint); +} + +/** \ingroup dev + * Perform a USB port reset to reinitialize a device. The system will attempt + * to restore the previous configuration and alternate settings after the + * reset has completed. + * + * If the reset fails, the descriptors change, or the previous state cannot be + * restored, the device will appear to be disconnected and reconnected. This + * means that the device handle is no longer valid (you should close it) and + * rediscover the device. A return code of LIBUSB_ERROR_NOT_FOUND indicates + * when this is the case. + * + * This is a blocking function which usually incurs a noticeable delay. + * + * \param dev a handle of the device to reset + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the + * device has been disconnected + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_reset_device(libusb_device_handle *dev) +{ + usbi_dbg(""); + return usbi_backend->reset_device(dev); +} + +/** \ingroup dev + * Determine if a kernel driver is active on an interface. If a kernel driver + * is active, you cannot claim the interface, and libusb will be unable to + * perform I/O. + * + * This functionality is not available on Windows. + * + * \param dev a device handle + * \param interface_number the interface to check + * \returns 0 if no kernel driver is active + * \returns 1 if a kernel driver is active + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality + * is not available + * \returns another LIBUSB_ERROR code on other failure + * \see libusb_detach_kernel_driver() + */ +int API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev, + int interface_number) +{ + usbi_dbg("interface %d", interface_number); + if (usbi_backend->kernel_driver_active) + return usbi_backend->kernel_driver_active(dev, interface_number); + else + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +/** \ingroup dev + * Detach a kernel driver from an interface. If successful, you will then be + * able to claim the interface and perform I/O. + * + * This functionality is not available on Darwin or Windows. + * + * \param dev a device handle + * \param interface_number the interface to detach the driver from + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active + * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality + * is not available + * \returns another LIBUSB_ERROR code on other failure + * \see libusb_kernel_driver_active() + */ +int API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev, + int interface_number) +{ + usbi_dbg("interface %d", interface_number); + if (usbi_backend->detach_kernel_driver) + return usbi_backend->detach_kernel_driver(dev, interface_number); + else + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +/** \ingroup dev + * Re-attach an interface's kernel driver, which was previously detached + * using libusb_detach_kernel_driver(). This call is only effective on + * Linux and returns LIBUSB_ERROR_NOT_SUPPORTED on all other platforms. + * + * This functionality is not available on Darwin or Windows. + * + * \param dev a device handle + * \param interface_number the interface to attach the driver from + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active + * \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality + * is not available + * \returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the + * interface is claimed by a program or driver + * \returns another LIBUSB_ERROR code on other failure + * \see libusb_kernel_driver_active() + */ +int API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev, + int interface_number) +{ + usbi_dbg("interface %d", interface_number); + if (usbi_backend->attach_kernel_driver) + return usbi_backend->attach_kernel_driver(dev, interface_number); + else + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +/** \ingroup lib + * Set message verbosity. + * - Level 0: no messages ever printed by the library (default) + * - Level 1: error messages are printed to stderr + * - Level 2: warning and error messages are printed to stderr + * - Level 3: informational messages are printed to stdout, warning and error + * messages are printed to stderr + * + * The default level is 0, which means no messages are ever printed. If you + * choose to increase the message verbosity level, ensure that your + * application does not close the stdout/stderr file descriptors. + * + * You are advised to set level 3. libusb is conservative with its message + * logging and most of the time, will only log messages that explain error + * conditions and other oddities. This will help you debug your software. + * + * If the LIBUSB_DEBUG environment variable was set when libusb was + * initialized, this function does nothing: the message verbosity is fixed + * to the value in the environment variable. + * + * If libusb was compiled without any message logging, this function does + * nothing: you'll never get any messages. + * + * If libusb was compiled with verbose debug message logging, this function + * does nothing: you'll always get messages from all levels. + * + * \param ctx the context to operate on, or NULL for the default context + * \param level debug level to set + */ +void API_EXPORTED libusb_set_debug(libusb_context *ctx, int level) +{ + USBI_GET_CONTEXT(ctx); + if (!ctx->debug_fixed) + ctx->debug = level; +} + +/** \ingroup lib + * Initialize libusb. This function must be called before calling any other + * libusb function. + * + * If you do not provide an output location for a context pointer, a default + * context will be created. If there was already a default context, it will + * be reused (and nothing will be initialized/reinitialized). + * + * \param context Optional output location for context pointer. + * Only valid on return code 0. + * \returns 0 on success, or a LIBUSB_ERROR code on failure + * \see contexts + */ +int API_EXPORTED libusb_init(libusb_context **context) +{ + char *dbg = getenv("LIBUSB_DEBUG"); + struct libusb_context *ctx; + int r = 0; + + usbi_mutex_static_lock(&default_context_lock); + if (!context && usbi_default_context) { + usbi_dbg("reusing default context"); + default_context_refcnt++; + usbi_mutex_static_unlock(&default_context_lock); + return 0; + } + + ctx = malloc(sizeof(*ctx)); + if (!ctx) { + r = LIBUSB_ERROR_NO_MEM; + goto err_unlock; + } + memset(ctx, 0, sizeof(*ctx)); + + if (dbg) { + ctx->debug = atoi(dbg); + if (ctx->debug) + ctx->debug_fixed = 1; + } + + usbi_dbg("libusb-%d.%d.%d%s%s%s", + libusb_version_internal.major, + libusb_version_internal.minor, + libusb_version_internal.micro, + libusb_version_internal.rc, + libusb_version_internal.describe[0] ? " git:" : "", + libusb_version_internal.describe); + + if (usbi_backend->init) { + r = usbi_backend->init(ctx); + if (r) + goto err_free_ctx; + } + + usbi_mutex_init(&ctx->usb_devs_lock, NULL); + usbi_mutex_init(&ctx->open_devs_lock, NULL); + list_init(&ctx->usb_devs); + list_init(&ctx->open_devs); + + r = usbi_io_init(ctx); + if (r < 0) { + if (usbi_backend->exit) + usbi_backend->exit(); + goto err_destroy_mutex; + } + + if (context) { + *context = ctx; + } else if (!usbi_default_context) { + usbi_dbg("created default context"); + usbi_default_context = ctx; + default_context_refcnt++; + } + usbi_mutex_static_unlock(&default_context_lock); + + return 0; + +err_destroy_mutex: + usbi_mutex_destroy(&ctx->open_devs_lock); + usbi_mutex_destroy(&ctx->usb_devs_lock); +err_free_ctx: + free(ctx); +err_unlock: + usbi_mutex_static_unlock(&default_context_lock); + return r; +} + +/** \ingroup lib + * Deinitialize libusb. Should be called after closing all open devices and + * before your application terminates. + * \param ctx the context to deinitialize, or NULL for the default context + */ +void API_EXPORTED libusb_exit(struct libusb_context *ctx) +{ + usbi_dbg(""); + USBI_GET_CONTEXT(ctx); + + /* if working with default context, only actually do the deinitialization + * if we're the last user */ + if (ctx == usbi_default_context) { + usbi_mutex_static_lock(&default_context_lock); + if (--default_context_refcnt > 0) { + usbi_dbg("not destroying default context"); + usbi_mutex_static_unlock(&default_context_lock); + return; + } + usbi_dbg("destroying default context"); + usbi_default_context = NULL; + usbi_mutex_static_unlock(&default_context_lock); + } + + /* a little sanity check. doesn't bother with open_devs locking because + * unless there is an application bug, nobody will be accessing this. */ + if (!list_empty(&ctx->open_devs)) + usbi_warn(ctx, "application left some devices open"); + + usbi_io_exit(ctx); + if (usbi_backend->exit) + usbi_backend->exit(); + + usbi_mutex_destroy(&ctx->open_devs_lock); + usbi_mutex_destroy(&ctx->usb_devs_lock); + free(ctx); +} + +/** \ingroup misc + * Check at runtime if the loaded library has a given capability. + * + * \param capability the \ref libusb_capability to check for + * \returns 1 if the running library has the capability, 0 otherwise + */ +int API_EXPORTED libusb_has_capability(uint32_t capability) +{ + enum libusb_capability cap = capability; + switch (cap) { + case LIBUSB_CAP_HAS_CAPABILITY: + return 1; + } + return 0; +} + +/* this is defined in libusbi.h if needed */ +#ifdef LIBUSB_GETTIMEOFDAY_WIN32 +/* + * gettimeofday + * Implementation according to: + * The Open Group Base Specifications Issue 6 + * IEEE Std 1003.1, 2004 Edition + */ + +/* + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Contributed by: + * Danny Smith + */ + +/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */ +#define _W32_FT_OFFSET (116444736000000000) + +int usbi_gettimeofday(struct timeval *tp, void *tzp) + { + union { + unsigned __int64 ns100; /*time since 1 Jan 1601 in 100ns units */ + FILETIME ft; + } _now; + + if(tp) + { + GetSystemTimeAsFileTime (&_now.ft); + tp->tv_usec=(long)((_now.ns100 / 10) % 1000000 ); + tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000); + } + /* Always return 0 as per Open Group Base Specifications Issue 6. + Do not set errno on error. */ + return 0; +} +#endif + +void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, va_list args) +{ + FILE *stream = stdout; + const char *prefix; + struct timeval now; + static struct timeval first = { 0, 0 }; + +#ifndef ENABLE_DEBUG_LOGGING + USBI_GET_CONTEXT(ctx); + if (!ctx->debug) + return; + if (level == LOG_LEVEL_WARNING && ctx->debug < 2) + return; + if (level == LOG_LEVEL_INFO && ctx->debug < 3) + return; +#endif + + usbi_gettimeofday(&now, NULL); + if (!first.tv_sec) { + first.tv_sec = now.tv_sec; + first.tv_usec = now.tv_usec; + } + if (now.tv_usec < first.tv_usec) { + now.tv_sec--; + now.tv_usec += 1000000; + } + now.tv_sec -= first.tv_sec; + now.tv_usec -= first.tv_usec; + + switch (level) { + case LOG_LEVEL_INFO: + prefix = "info"; + break; + case LOG_LEVEL_WARNING: + stream = stderr; + prefix = "warning"; + break; + case LOG_LEVEL_ERROR: + stream = stderr; + prefix = "error"; + break; + case LOG_LEVEL_DEBUG: + stream = stderr; + prefix = "debug"; + break; + default: + stream = stderr; + prefix = "unknown"; + break; + } + + fprintf(stream, "libusb: %d.%06d %s [%s] ", + (int)now.tv_sec, (int)now.tv_usec, prefix, function); + + vfprintf(stream, format, args); + + fprintf(stream, "\n"); +} + +void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, ...) +{ + va_list args; + + va_start (args, format); + usbi_log_v(ctx, level, function, format, args); + va_end (args); +} + +/** \ingroup misc + * Returns a constant NULL-terminated string with the ASCII name of a libusb + * error code. The caller must not free() the returned string. + * + * \param error_code The \ref libusb_error code to return the name of. + * \returns The error name, or the string **UNKNOWN** if the value of + * error_code is not a known error code. + */ +DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code) +{ + enum libusb_error error = error_code; + switch (error) { + case LIBUSB_SUCCESS: + return "LIBUSB_SUCCESS"; + case LIBUSB_ERROR_IO: + return "LIBUSB_ERROR_IO"; + case LIBUSB_ERROR_INVALID_PARAM: + return "LIBUSB_ERROR_INVALID_PARAM"; + case LIBUSB_ERROR_ACCESS: + return "LIBUSB_ERROR_ACCESS"; + case LIBUSB_ERROR_NO_DEVICE: + return "LIBUSB_ERROR_NO_DEVICE"; + case LIBUSB_ERROR_NOT_FOUND: + return "LIBUSB_ERROR_NOT_FOUND"; + case LIBUSB_ERROR_BUSY: + return "LIBUSB_ERROR_BUSY"; + case LIBUSB_ERROR_TIMEOUT: + return "LIBUSB_ERROR_TIMEOUT"; + case LIBUSB_ERROR_OVERFLOW: + return "LIBUSB_ERROR_OVERFLOW"; + case LIBUSB_ERROR_PIPE: + return "LIBUSB_ERROR_PIPE"; + case LIBUSB_ERROR_INTERRUPTED: + return "LIBUSB_ERROR_INTERRUPTED"; + case LIBUSB_ERROR_NO_MEM: + return "LIBUSB_ERROR_NO_MEM"; + case LIBUSB_ERROR_NOT_SUPPORTED: + return "LIBUSB_ERROR_NOT_SUPPORTED"; + case LIBUSB_ERROR_OTHER: + return "LIBUSB_ERROR_OTHER"; + } + return "**UNKNOWN**"; +} + +/** \ingroup misc + * Returns a pointer to const struct libusb_version with the version + * (major, minor, micro, rc, and nano) of the running library. + */ +DEFAULT_VISIBILITY +const struct libusb_version * LIBUSB_CALL libusb_get_version(void) +{ + return &libusb_version_internal; +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/descriptor.c b/thirdparty/libusb/libusb-1.0.9/libusb/descriptor.c new file mode 100644 index 0000000..e358e9e --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/descriptor.c @@ -0,0 +1,730 @@ +/* + * USB descriptor handling functions for libusb + * Copyright (C) 2007 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include "libusbi.h" + +#define DESC_HEADER_LENGTH 2 +#define DEVICE_DESC_LENGTH 18 +#define CONFIG_DESC_LENGTH 9 +#define INTERFACE_DESC_LENGTH 9 +#define ENDPOINT_DESC_LENGTH 7 +#define ENDPOINT_AUDIO_DESC_LENGTH 9 + +/** @defgroup desc USB descriptors + * This page details how to examine the various standard USB descriptors + * for detected devices + */ + +/* set host_endian if the w values are already in host endian format, + * as opposed to bus endian. */ +int usbi_parse_descriptor(unsigned char *source, const char *descriptor, + void *dest, int host_endian) +{ + unsigned char *sp = source, *dp = dest; + uint16_t w; + const char *cp; + + for (cp = descriptor; *cp; cp++) { + switch (*cp) { + case 'b': /* 8-bit byte */ + *dp++ = *sp++; + break; + case 'w': /* 16-bit word, convert from little endian to CPU */ + dp += ((uintptr_t)dp & 1); /* Align to word boundary */ + + if (host_endian) { + memcpy(dp, sp, 2); + } else { + w = (sp[1] << 8) | sp[0]; + *((uint16_t *)dp) = w; + } + sp += 2; + dp += 2; + break; + } + } + + return (int) (sp - source); +} + +static void clear_endpoint(struct libusb_endpoint_descriptor *endpoint) +{ + if (endpoint->extra) + free((unsigned char *) endpoint->extra); +} + +static int parse_endpoint(struct libusb_context *ctx, + struct libusb_endpoint_descriptor *endpoint, unsigned char *buffer, + int size, int host_endian) +{ + struct usb_descriptor_header header; + unsigned char *extra; + unsigned char *begin; + int parsed = 0; + int len; + + usbi_parse_descriptor(buffer, "bb", &header, 0); + + /* Everything should be fine being passed into here, but we sanity */ + /* check JIC */ + if (header.bLength > size) { + usbi_err(ctx, "ran out of descriptors parsing"); + return -1; + } + + if (header.bDescriptorType != LIBUSB_DT_ENDPOINT) { + usbi_err(ctx, "unexpected descriptor %x (expected %x)", + header.bDescriptorType, LIBUSB_DT_ENDPOINT); + return parsed; + } + + if (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH) + usbi_parse_descriptor(buffer, "bbbbwbbb", endpoint, host_endian); + else if (header.bLength >= ENDPOINT_DESC_LENGTH) + usbi_parse_descriptor(buffer, "bbbbwb", endpoint, host_endian); + + buffer += header.bLength; + size -= header.bLength; + parsed += header.bLength; + + /* Skip over the rest of the Class Specific or Vendor Specific */ + /* descriptors */ + begin = buffer; + while (size >= DESC_HEADER_LENGTH) { + usbi_parse_descriptor(buffer, "bb", &header, 0); + + if (header.bLength < 2) { + usbi_err(ctx, "invalid descriptor length %d", header.bLength); + return -1; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) || + (header.bDescriptorType == LIBUSB_DT_INTERFACE) || + (header.bDescriptorType == LIBUSB_DT_CONFIG) || + (header.bDescriptorType == LIBUSB_DT_DEVICE)) + break; + + usbi_dbg("skipping descriptor %x", header.bDescriptorType); + buffer += header.bLength; + size -= header.bLength; + parsed += header.bLength; + } + + /* Copy any unknown descriptors into a storage area for drivers */ + /* to later parse */ + len = (int)(buffer - begin); + if (!len) { + endpoint->extra = NULL; + endpoint->extra_length = 0; + return parsed; + } + + extra = malloc(len); + endpoint->extra = extra; + if (!extra) { + endpoint->extra_length = 0; + return LIBUSB_ERROR_NO_MEM; + } + + memcpy(extra, begin, len); + endpoint->extra_length = len; + + return parsed; +} + +static void clear_interface(struct libusb_interface *usb_interface) +{ + int i; + int j; + + if (usb_interface->altsetting) { + for (i = 0; i < usb_interface->num_altsetting; i++) { + struct libusb_interface_descriptor *ifp = + (struct libusb_interface_descriptor *) + usb_interface->altsetting + i; + if (ifp->extra) + free((void *) ifp->extra); + if (ifp->endpoint) { + for (j = 0; j < ifp->bNumEndpoints; j++) + clear_endpoint((struct libusb_endpoint_descriptor *) + ifp->endpoint + j); + free((void *) ifp->endpoint); + } + } + free((void *) usb_interface->altsetting); + usb_interface->altsetting = NULL; + } + +} + +static int parse_interface(libusb_context *ctx, + struct libusb_interface *usb_interface, unsigned char *buffer, int size, + int host_endian) +{ + int i; + int len; + int r; + int parsed = 0; + size_t tmp; + struct usb_descriptor_header header; + struct libusb_interface_descriptor *ifp; + unsigned char *begin; + + usb_interface->num_altsetting = 0; + + while (size >= INTERFACE_DESC_LENGTH) { + struct libusb_interface_descriptor *altsetting = + (struct libusb_interface_descriptor *) usb_interface->altsetting; + altsetting = realloc(altsetting, + sizeof(struct libusb_interface_descriptor) * + (usb_interface->num_altsetting + 1)); + if (!altsetting) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + usb_interface->altsetting = altsetting; + + ifp = altsetting + usb_interface->num_altsetting; + usb_interface->num_altsetting++; + usbi_parse_descriptor(buffer, "bbbbbbbbb", ifp, 0); + ifp->extra = NULL; + ifp->extra_length = 0; + ifp->endpoint = NULL; + + /* Skip over the interface */ + buffer += ifp->bLength; + parsed += ifp->bLength; + size -= ifp->bLength; + + begin = buffer; + + /* Skip over any interface, class or vendor descriptors */ + while (size >= DESC_HEADER_LENGTH) { + usbi_parse_descriptor(buffer, "bb", &header, 0); + if (header.bLength < 2) { + usbi_err(ctx, "invalid descriptor of length %d", + header.bLength); + r = LIBUSB_ERROR_IO; + goto err; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == LIBUSB_DT_INTERFACE) || + (header.bDescriptorType == LIBUSB_DT_ENDPOINT) || + (header.bDescriptorType == LIBUSB_DT_CONFIG) || + (header.bDescriptorType == LIBUSB_DT_DEVICE)) + break; + + buffer += header.bLength; + parsed += header.bLength; + size -= header.bLength; + } + + /* Copy any unknown descriptors into a storage area for */ + /* drivers to later parse */ + len = (int)(buffer - begin); + if (len) { + ifp->extra = malloc(len); + if (!ifp->extra) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + memcpy((unsigned char *) ifp->extra, begin, len); + ifp->extra_length = len; + } + + /* Did we hit an unexpected descriptor? */ + if (size >= DESC_HEADER_LENGTH) { + usbi_parse_descriptor(buffer, "bb", &header, 0); + if ((header.bDescriptorType == LIBUSB_DT_CONFIG) || + (header.bDescriptorType == LIBUSB_DT_DEVICE)) { + return parsed; + } + } + + if (ifp->bNumEndpoints > USB_MAXENDPOINTS) { + usbi_err(ctx, "too many endpoints (%d)", ifp->bNumEndpoints); + r = LIBUSB_ERROR_IO; + goto err; + } + + if (ifp->bNumEndpoints > 0) { + struct libusb_endpoint_descriptor *endpoint; + tmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor); + endpoint = malloc(tmp); + ifp->endpoint = endpoint; + if (!endpoint) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + + memset(endpoint, 0, tmp); + for (i = 0; i < ifp->bNumEndpoints; i++) { + usbi_parse_descriptor(buffer, "bb", &header, 0); + + if (header.bLength > size) { + usbi_err(ctx, "ran out of descriptors parsing"); + r = LIBUSB_ERROR_IO; + goto err; + } + + r = parse_endpoint(ctx, endpoint + i, buffer, size, + host_endian); + if (r < 0) + goto err; + + buffer += r; + parsed += r; + size -= r; + } + } + + /* We check to see if it's an alternate to this one */ + ifp = (struct libusb_interface_descriptor *) buffer; + if (size < LIBUSB_DT_INTERFACE_SIZE || + ifp->bDescriptorType != LIBUSB_DT_INTERFACE || + !ifp->bAlternateSetting) + return parsed; + } + + return parsed; +err: + clear_interface(usb_interface); + return r; +} + +static void clear_configuration(struct libusb_config_descriptor *config) +{ + if (config->interface) { + int i; + for (i = 0; i < config->bNumInterfaces; i++) + clear_interface((struct libusb_interface *) + config->interface + i); + free((void *) config->interface); + } + if (config->extra) + free((void *) config->extra); +} + +static int parse_configuration(struct libusb_context *ctx, + struct libusb_config_descriptor *config, unsigned char *buffer, + int host_endian) +{ + int i; + int r; + int size; + size_t tmp; + struct usb_descriptor_header header; + struct libusb_interface *usb_interface; + + usbi_parse_descriptor(buffer, "bbwbbbbb", config, host_endian); + size = config->wTotalLength; + + if (config->bNumInterfaces > USB_MAXINTERFACES) { + usbi_err(ctx, "too many interfaces (%d)", config->bNumInterfaces); + return LIBUSB_ERROR_IO; + } + + tmp = config->bNumInterfaces * sizeof(struct libusb_interface); + usb_interface = malloc(tmp); + config->interface = usb_interface; + if (!config->interface) + return LIBUSB_ERROR_NO_MEM; + + memset(usb_interface, 0, tmp); + buffer += config->bLength; + size -= config->bLength; + + config->extra = NULL; + config->extra_length = 0; + + for (i = 0; i < config->bNumInterfaces; i++) { + int len; + unsigned char *begin; + + /* Skip over the rest of the Class Specific or Vendor */ + /* Specific descriptors */ + begin = buffer; + while (size >= DESC_HEADER_LENGTH) { + usbi_parse_descriptor(buffer, "bb", &header, 0); + + if ((header.bLength > size) || + (header.bLength < DESC_HEADER_LENGTH)) { + usbi_err(ctx, "invalid descriptor length of %d", + header.bLength); + r = LIBUSB_ERROR_IO; + goto err; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) || + (header.bDescriptorType == LIBUSB_DT_INTERFACE) || + (header.bDescriptorType == LIBUSB_DT_CONFIG) || + (header.bDescriptorType == LIBUSB_DT_DEVICE)) + break; + + usbi_dbg("skipping descriptor 0x%x\n", header.bDescriptorType); + buffer += header.bLength; + size -= header.bLength; + } + + /* Copy any unknown descriptors into a storage area for */ + /* drivers to later parse */ + len = (int)(buffer - begin); + if (len) { + /* FIXME: We should realloc and append here */ + if (!config->extra_length) { + config->extra = malloc(len); + if (!config->extra) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + + memcpy((unsigned char *) config->extra, begin, len); + config->extra_length = len; + } + } + + r = parse_interface(ctx, usb_interface + i, buffer, size, host_endian); + if (r < 0) + goto err; + + buffer += r; + size -= r; + } + + return size; + +err: + clear_configuration(config); + return r; +} + +/** \ingroup desc + * Get the USB device descriptor for a given device. + * + * This is a non-blocking function; the device descriptor is cached in memory. + * + * \param dev the device + * \param desc output location for the descriptor data + * \returns 0 on success or a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_get_device_descriptor(libusb_device *dev, + struct libusb_device_descriptor *desc) +{ + unsigned char raw_desc[DEVICE_DESC_LENGTH]; + int host_endian = 0; + int r; + + usbi_dbg(""); + r = usbi_backend->get_device_descriptor(dev, raw_desc, &host_endian); + if (r < 0) + return r; + + memcpy((unsigned char *) desc, raw_desc, sizeof(raw_desc)); + if (!host_endian) { + desc->bcdUSB = libusb_le16_to_cpu(desc->bcdUSB); + desc->idVendor = libusb_le16_to_cpu(desc->idVendor); + desc->idProduct = libusb_le16_to_cpu(desc->idProduct); + desc->bcdDevice = libusb_le16_to_cpu(desc->bcdDevice); + } + return 0; +} + +/** \ingroup desc + * Get the USB configuration descriptor for the currently active configuration. + * This is a non-blocking function which does not involve any requests being + * sent to the device. + * + * \param dev a device + * \param config output location for the USB configuration descriptor. Only + * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() + * after use. + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state + * \returns another LIBUSB_ERROR code on error + * \see libusb_get_config_descriptor + */ +int API_EXPORTED libusb_get_active_config_descriptor(libusb_device *dev, + struct libusb_config_descriptor **config) +{ + struct libusb_config_descriptor *_config = malloc(sizeof(*_config)); + unsigned char tmp[8]; + unsigned char *buf = NULL; + int host_endian = 0; + int r; + + usbi_dbg(""); + if (!_config) + return LIBUSB_ERROR_NO_MEM; + + r = usbi_backend->get_active_config_descriptor(dev, tmp, sizeof(tmp), + &host_endian); + if (r < 0) + goto err; + + usbi_parse_descriptor(tmp, "bbw", _config, host_endian); + buf = malloc(_config->wTotalLength); + if (!buf) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + + r = usbi_backend->get_active_config_descriptor(dev, buf, + _config->wTotalLength, &host_endian); + if (r < 0) + goto err; + + r = parse_configuration(dev->ctx, _config, buf, host_endian); + if (r < 0) { + usbi_err(dev->ctx, "parse_configuration failed with error %d", r); + goto err; + } else if (r > 0) { + usbi_warn(dev->ctx, "descriptor data still left"); + } + + free(buf); + *config = _config; + return 0; + +err: + free(_config); + if (buf) + free(buf); + return r; +} + +/** \ingroup desc + * Get a USB configuration descriptor based on its index. + * This is a non-blocking function which does not involve any requests being + * sent to the device. + * + * \param dev a device + * \param config_index the index of the configuration you wish to retrieve + * \param config output location for the USB configuration descriptor. Only + * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() + * after use. + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist + * \returns another LIBUSB_ERROR code on error + * \see libusb_get_active_config_descriptor() + * \see libusb_get_config_descriptor_by_value() + */ +int API_EXPORTED libusb_get_config_descriptor(libusb_device *dev, + uint8_t config_index, struct libusb_config_descriptor **config) +{ + struct libusb_config_descriptor *_config; + unsigned char tmp[8]; + unsigned char *buf = NULL; + int host_endian = 0; + int r; + + usbi_dbg("index %d", config_index); + if (config_index >= dev->num_configurations) + return LIBUSB_ERROR_NOT_FOUND; + + _config = malloc(sizeof(*_config)); + if (!_config) + return LIBUSB_ERROR_NO_MEM; + + r = usbi_backend->get_config_descriptor(dev, config_index, tmp, + sizeof(tmp), &host_endian); + if (r < 0) + goto err; + + usbi_parse_descriptor(tmp, "bbw", _config, host_endian); + buf = malloc(_config->wTotalLength); + if (!buf) { + r = LIBUSB_ERROR_NO_MEM; + goto err; + } + + host_endian = 0; + r = usbi_backend->get_config_descriptor(dev, config_index, buf, + _config->wTotalLength, &host_endian); + if (r < 0) + goto err; + + r = parse_configuration(dev->ctx, _config, buf, host_endian); + if (r < 0) { + usbi_err(dev->ctx, "parse_configuration failed with error %d", r); + goto err; + } else if (r > 0) { + usbi_warn(dev->ctx, "descriptor data still left"); + } + + free(buf); + *config = _config; + return 0; + +err: + free(_config); + if (buf) + free(buf); + return r; +} + +/* iterate through all configurations, returning the index of the configuration + * matching a specific bConfigurationValue in the idx output parameter, or -1 + * if the config was not found. + * returns 0 or a LIBUSB_ERROR code + */ +int usbi_get_config_index_by_value(struct libusb_device *dev, + uint8_t bConfigurationValue, int *idx) +{ + uint8_t i; + + usbi_dbg("value %d", bConfigurationValue); + for (i = 0; i < dev->num_configurations; i++) { + unsigned char tmp[6]; + int host_endian; + int r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp), + &host_endian); + if (r < 0) + return r; + if (tmp[5] == bConfigurationValue) { + *idx = i; + return 0; + } + } + + *idx = -1; + return 0; +} + +/** \ingroup desc + * Get a USB configuration descriptor with a specific bConfigurationValue. + * This is a non-blocking function which does not involve any requests being + * sent to the device. + * + * \param dev a device + * \param bConfigurationValue the bConfigurationValue of the configuration you + * wish to retrieve + * \param config output location for the USB configuration descriptor. Only + * valid if 0 was returned. Must be freed with libusb_free_config_descriptor() + * after use. + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist + * \returns another LIBUSB_ERROR code on error + * \see libusb_get_active_config_descriptor() + * \see libusb_get_config_descriptor() + */ +int API_EXPORTED libusb_get_config_descriptor_by_value(libusb_device *dev, + uint8_t bConfigurationValue, struct libusb_config_descriptor **config) +{ + int idx; + int r = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx); + if (r < 0) + return r; + else if (idx == -1) + return LIBUSB_ERROR_NOT_FOUND; + else + return libusb_get_config_descriptor(dev, (uint8_t) idx, config); +} + +/** \ingroup desc + * Free a configuration descriptor obtained from + * libusb_get_active_config_descriptor() or libusb_get_config_descriptor(). + * It is safe to call this function with a NULL config parameter, in which + * case the function simply returns. + * + * \param config the configuration descriptor to free + */ +void API_EXPORTED libusb_free_config_descriptor( + struct libusb_config_descriptor *config) +{ + if (!config) + return; + + clear_configuration(config); + free(config); +} + +/** \ingroup desc + * Retrieve a string descriptor in C style ASCII. + * + * Wrapper around libusb_get_string_descriptor(). Uses the first language + * supported by the device. + * + * \param dev a device handle + * \param desc_index the index of the descriptor to retrieve + * \param data output buffer for ASCII string descriptor + * \param length size of data buffer + * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev, + uint8_t desc_index, unsigned char *data, int length) +{ + unsigned char tbuf[255]; /* Some devices choke on size > 255 */ + int r, si, di; + uint16_t langid; + + /* Asking for the zero'th index is special - it returns a string + * descriptor that contains all the language IDs supported by the + * device. Typically there aren't many - often only one. Language + * IDs are 16 bit numbers, and they start at the third byte in the + * descriptor. There's also no point in trying to read descriptor 0 + * with this function. See USB 2.0 specification section 9.6.7 for + * more information. + */ + + if (desc_index == 0) + return LIBUSB_ERROR_INVALID_PARAM; + + r = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf)); + if (r < 0) + return r; + + if (r < 4) + return LIBUSB_ERROR_IO; + + langid = tbuf[2] | (tbuf[3] << 8); + + r = libusb_get_string_descriptor(dev, desc_index, langid, tbuf, + sizeof(tbuf)); + if (r < 0) + return r; + + if (tbuf[1] != LIBUSB_DT_STRING) + return LIBUSB_ERROR_IO; + + if (tbuf[0] > r) + return LIBUSB_ERROR_IO; + + for (di = 0, si = 2; si < tbuf[0]; si += 2) { + if (di >= (length - 1)) + break; + + if (tbuf[si + 1]) /* high byte */ + data[di++] = '?'; + else + data[di++] = tbuf[si]; + } + + data[di] = 0; + return di; +} + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/io.c b/thirdparty/libusb/libusb-1.0.9/libusb/io.c new file mode 100644 index 0000000..e9bd312 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/io.c @@ -0,0 +1,2454 @@ +/* + * I/O functions for libusb + * Copyright (C) 2007-2009 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef USBI_TIMERFD_AVAILABLE +#include +#endif + +#include "libusbi.h" + +/** + * \page io Synchronous and asynchronous device I/O + * + * \section intro Introduction + * + * If you're using libusb in your application, you're probably wanting to + * perform I/O with devices - you want to perform USB data transfers. + * + * libusb offers two separate interfaces for device I/O. This page aims to + * introduce the two in order to help you decide which one is more suitable + * for your application. You can also choose to use both interfaces in your + * application by considering each transfer on a case-by-case basis. + * + * Once you have read through the following discussion, you should consult the + * detailed API documentation pages for the details: + * - \ref syncio + * - \ref asyncio + * + * \section theory Transfers at a logical level + * + * At a logical level, USB transfers typically happen in two parts. For + * example, when reading data from a endpoint: + * -# A request for data is sent to the device + * -# Some time later, the incoming data is received by the host + * + * or when writing data to an endpoint: + * + * -# The data is sent to the device + * -# Some time later, the host receives acknowledgement from the device that + * the data has been transferred. + * + * There may be an indefinite delay between the two steps. Consider a + * fictional USB input device with a button that the user can press. In order + * to determine when the button is pressed, you would likely submit a request + * to read data on a bulk or interrupt endpoint and wait for data to arrive. + * Data will arrive when the button is pressed by the user, which is + * potentially hours later. + * + * libusb offers both a synchronous and an asynchronous interface to performing + * USB transfers. The main difference is that the synchronous interface + * combines both steps indicated above into a single function call, whereas + * the asynchronous interface separates them. + * + * \section sync The synchronous interface + * + * The synchronous I/O interface allows you to perform a USB transfer with + * a single function call. When the function call returns, the transfer has + * completed and you can parse the results. + * + * If you have used the libusb-0.1 before, this I/O style will seem familar to + * you. libusb-0.1 only offered a synchronous interface. + * + * In our input device example, to read button presses you might write code + * in the following style: +\code +unsigned char data[4]; +int actual_length; +int r = libusb_bulk_transfer(handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0); +if (r == 0 && actual_length == sizeof(data)) { + // results of the transaction can now be found in the data buffer + // parse them here and report button press +} else { + error(); +} +\endcode + * + * The main advantage of this model is simplicity: you did everything with + * a single simple function call. + * + * However, this interface has its limitations. Your application will sleep + * inside libusb_bulk_transfer() until the transaction has completed. If it + * takes the user 3 hours to press the button, your application will be + * sleeping for that long. Execution will be tied up inside the library - + * the entire thread will be useless for that duration. + * + * Another issue is that by tieing up the thread with that single transaction + * there is no possibility of performing I/O with multiple endpoints and/or + * multiple devices simultaneously, unless you resort to creating one thread + * per transaction. + * + * Additionally, there is no opportunity to cancel the transfer after the + * request has been submitted. + * + * For details on how to use the synchronous API, see the + * \ref syncio "synchronous I/O API documentation" pages. + * + * \section async The asynchronous interface + * + * Asynchronous I/O is the most significant new feature in libusb-1.0. + * Although it is a more complex interface, it solves all the issues detailed + * above. + * + * Instead of providing which functions that block until the I/O has complete, + * libusb's asynchronous interface presents non-blocking functions which + * begin a transfer and then return immediately. Your application passes a + * callback function pointer to this non-blocking function, which libusb will + * call with the results of the transaction when it has completed. + * + * Transfers which have been submitted through the non-blocking functions + * can be cancelled with a separate function call. + * + * The non-blocking nature of this interface allows you to be simultaneously + * performing I/O to multiple endpoints on multiple devices, without having + * to use threads. + * + * This added flexibility does come with some complications though: + * - In the interest of being a lightweight library, libusb does not create + * threads and can only operate when your application is calling into it. Your + * application must call into libusb from it's main loop when events are ready + * to be handled, or you must use some other scheme to allow libusb to + * undertake whatever work needs to be done. + * - libusb also needs to be called into at certain fixed points in time in + * order to accurately handle transfer timeouts. + * - Memory handling becomes more complex. You cannot use stack memory unless + * the function with that stack is guaranteed not to return until the transfer + * callback has finished executing. + * - You generally lose some linearity from your code flow because submitting + * the transfer request is done in a separate function from where the transfer + * results are handled. This becomes particularly obvious when you want to + * submit a second transfer based on the results of an earlier transfer. + * + * Internally, libusb's synchronous interface is expressed in terms of function + * calls to the asynchronous interface. + * + * For details on how to use the asynchronous API, see the + * \ref asyncio "asynchronous I/O API" documentation pages. + */ + + +/** + * \page packetoverflow Packets and overflows + * + * \section packets Packet abstraction + * + * The USB specifications describe how data is transmitted in packets, with + * constraints on packet size defined by endpoint descriptors. The host must + * not send data payloads larger than the endpoint's maximum packet size. + * + * libusb and the underlying OS abstract out the packet concept, allowing you + * to request transfers of any size. Internally, the request will be divided + * up into correctly-sized packets. You do not have to be concerned with + * packet sizes, but there is one exception when considering overflows. + * + * \section overflow Bulk/interrupt transfer overflows + * + * When requesting data on a bulk endpoint, libusb requires you to supply a + * buffer and the maximum number of bytes of data that libusb can put in that + * buffer. However, the size of the buffer is not communicated to the device - + * the device is just asked to send any amount of data. + * + * There is no problem if the device sends an amount of data that is less than + * or equal to the buffer size. libusb reports this condition to you through + * the \ref libusb_transfer::actual_length "libusb_transfer.actual_length" + * field. + * + * Problems may occur if the device attempts to send more data than can fit in + * the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but + * other behaviour is largely undefined: actual_length may or may not be + * accurate, the chunk of data that can fit in the buffer (before overflow) + * may or may not have been transferred. + * + * Overflows are nasty, but can be avoided. Even though you were told to + * ignore packets above, think about the lower level details: each transfer is + * split into packets (typically small, with a maximum size of 512 bytes). + * Overflows can only happen if the final packet in an incoming data transfer + * is smaller than the actual packet that the device wants to transfer. + * Therefore, you will never see an overflow if your transfer buffer size is a + * multiple of the endpoint's packet size: the final packet will either + * fill up completely or will be only partially filled. + */ + +/** + * @defgroup asyncio Asynchronous device I/O + * + * This page details libusb's asynchronous (non-blocking) API for USB device + * I/O. This interface is very powerful but is also quite complex - you will + * need to read this page carefully to understand the necessary considerations + * and issues surrounding use of this interface. Simplistic applications + * may wish to consider the \ref syncio "synchronous I/O API" instead. + * + * The asynchronous interface is built around the idea of separating transfer + * submission and handling of transfer completion (the synchronous model + * combines both of these into one). There may be a long delay between + * submission and completion, however the asynchronous submission function + * is non-blocking so will return control to your application during that + * potentially long delay. + * + * \section asyncabstraction Transfer abstraction + * + * For the asynchronous I/O, libusb implements the concept of a generic + * transfer entity for all types of I/O (control, bulk, interrupt, + * isochronous). The generic transfer object must be treated slightly + * differently depending on which type of I/O you are performing with it. + * + * This is represented by the public libusb_transfer structure type. + * + * \section asynctrf Asynchronous transfers + * + * We can view asynchronous I/O as a 5 step process: + * -# Allocation: allocate a libusb_transfer + * -# Filling: populate the libusb_transfer instance with information + * about the transfer you wish to perform + * -# Submission: ask libusb to submit the transfer + * -# Completion handling: examine transfer results in the + * libusb_transfer structure + * -# Deallocation: clean up resources + * + * + * \subsection asyncalloc Allocation + * + * This step involves allocating memory for a USB transfer. This is the + * generic transfer object mentioned above. At this stage, the transfer + * is "blank" with no details about what type of I/O it will be used for. + * + * Allocation is done with the libusb_alloc_transfer() function. You must use + * this function rather than allocating your own transfers. + * + * \subsection asyncfill Filling + * + * This step is where you take a previously allocated transfer and fill it + * with information to determine the message type and direction, data buffer, + * callback function, etc. + * + * You can either fill the required fields yourself or you can use the + * helper functions: libusb_fill_control_transfer(), libusb_fill_bulk_transfer() + * and libusb_fill_interrupt_transfer(). + * + * \subsection asyncsubmit Submission + * + * When you have allocated a transfer and filled it, you can submit it using + * libusb_submit_transfer(). This function returns immediately but can be + * regarded as firing off the I/O request in the background. + * + * \subsection asynccomplete Completion handling + * + * After a transfer has been submitted, one of four things can happen to it: + * + * - The transfer completes (i.e. some data was transferred) + * - The transfer has a timeout and the timeout expires before all data is + * transferred + * - The transfer fails due to an error + * - The transfer is cancelled + * + * Each of these will cause the user-specified transfer callback function to + * be invoked. It is up to the callback function to determine which of the + * above actually happened and to act accordingly. + * + * The user-specified callback is passed a pointer to the libusb_transfer + * structure which was used to setup and submit the transfer. At completion + * time, libusb has populated this structure with results of the transfer: + * success or failure reason, number of bytes of data transferred, etc. See + * the libusb_transfer structure documentation for more information. + * + * \subsection Deallocation + * + * When a transfer has completed (i.e. the callback function has been invoked), + * you are advised to free the transfer (unless you wish to resubmit it, see + * below). Transfers are deallocated with libusb_free_transfer(). + * + * It is undefined behaviour to free a transfer which has not completed. + * + * \section asyncresubmit Resubmission + * + * You may be wondering why allocation, filling, and submission are all + * separated above where they could reasonably be combined into a single + * operation. + * + * The reason for separation is to allow you to resubmit transfers without + * having to allocate new ones every time. This is especially useful for + * common situations dealing with interrupt endpoints - you allocate one + * transfer, fill and submit it, and when it returns with results you just + * resubmit it for the next interrupt. + * + * \section asynccancel Cancellation + * + * Another advantage of using the asynchronous interface is that you have + * the ability to cancel transfers which have not yet completed. This is + * done by calling the libusb_cancel_transfer() function. + * + * libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the + * cancellation actually completes, the transfer's callback function will + * be invoked, and the callback function should check the transfer status to + * determine that it was cancelled. + * + * Freeing the transfer after it has been cancelled but before cancellation + * has completed will result in undefined behaviour. + * + * When a transfer is cancelled, some of the data may have been transferred. + * libusb will communicate this to you in the transfer callback. Do not assume + * that no data was transferred. + * + * \section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints + * + * If your device does not have predictable transfer sizes (or it misbehaves), + * your application may submit a request for data on an IN endpoint which is + * smaller than the data that the device wishes to send. In some circumstances + * this will cause an overflow, which is a nasty condition to deal with. See + * the \ref packetoverflow page for discussion. + * + * \section asyncctrl Considerations for control transfers + * + * The libusb_transfer structure is generic and hence does not + * include specific fields for the control-specific setup packet structure. + * + * In order to perform a control transfer, you must place the 8-byte setup + * packet at the start of the data buffer. To simplify this, you could + * cast the buffer pointer to type struct libusb_control_setup, or you can + * use the helper function libusb_fill_control_setup(). + * + * The wLength field placed in the setup packet must be the length you would + * expect to be sent in the setup packet: the length of the payload that + * follows (or the expected maximum number of bytes to receive). However, + * the length field of the libusb_transfer object must be the length of + * the data buffer - i.e. it should be wLength plus the size of + * the setup packet (LIBUSB_CONTROL_SETUP_SIZE). + * + * If you use the helper functions, this is simplified for you: + * -# Allocate a buffer of size LIBUSB_CONTROL_SETUP_SIZE plus the size of the + * data you are sending/requesting. + * -# Call libusb_fill_control_setup() on the data buffer, using the transfer + * request size as the wLength value (i.e. do not include the extra space you + * allocated for the control setup). + * -# If this is a host-to-device transfer, place the data to be transferred + * in the data buffer, starting at offset LIBUSB_CONTROL_SETUP_SIZE. + * -# Call libusb_fill_control_transfer() to associate the data buffer with + * the transfer (and to set the remaining details such as callback and timeout). + * - Note that there is no parameter to set the length field of the transfer. + * The length is automatically inferred from the wLength field of the setup + * packet. + * -# Submit the transfer. + * + * The multi-byte control setup fields (wValue, wIndex and wLength) must + * be given in little-endian byte order (the endianness of the USB bus). + * Endianness conversion is transparently handled by + * libusb_fill_control_setup() which is documented to accept host-endian + * values. + * + * Further considerations are needed when handling transfer completion in + * your callback function: + * - As you might expect, the setup packet will still be sitting at the start + * of the data buffer. + * - If this was a device-to-host transfer, the received data will be sitting + * at offset LIBUSB_CONTROL_SETUP_SIZE into the buffer. + * - The actual_length field of the transfer structure is relative to the + * wLength of the setup packet, rather than the size of the data buffer. So, + * if your wLength was 4, your transfer's length was 12, then you + * should expect an actual_length of 4 to indicate that the data was + * transferred in entirity. + * + * To simplify parsing of setup packets and obtaining the data from the + * correct offset, you may wish to use the libusb_control_transfer_get_data() + * and libusb_control_transfer_get_setup() functions within your transfer + * callback. + * + * Even though control endpoints do not halt, a completed control transfer + * may have a LIBUSB_TRANSFER_STALL status code. This indicates the control + * request was not supported. + * + * \section asyncintr Considerations for interrupt transfers + * + * All interrupt transfers are performed using the polling interval presented + * by the bInterval value of the endpoint descriptor. + * + * \section asynciso Considerations for isochronous transfers + * + * Isochronous transfers are more complicated than transfers to + * non-isochronous endpoints. + * + * To perform I/O to an isochronous endpoint, allocate the transfer by calling + * libusb_alloc_transfer() with an appropriate number of isochronous packets. + * + * During filling, set \ref libusb_transfer::type "type" to + * \ref libusb_transfer_type::LIBUSB_TRANSFER_TYPE_ISOCHRONOUS + * "LIBUSB_TRANSFER_TYPE_ISOCHRONOUS", and set + * \ref libusb_transfer::num_iso_packets "num_iso_packets" to a value less than + * or equal to the number of packets you requested during allocation. + * libusb_alloc_transfer() does not set either of these fields for you, given + * that you might not even use the transfer on an isochronous endpoint. + * + * Next, populate the length field for the first num_iso_packets entries in + * the \ref libusb_transfer::iso_packet_desc "iso_packet_desc" array. Section + * 5.6.3 of the USB2 specifications describe how the maximum isochronous + * packet length is determined by the wMaxPacketSize field in the endpoint + * descriptor. + * Two functions can help you here: + * + * - libusb_get_max_iso_packet_size() is an easy way to determine the max + * packet size for an isochronous endpoint. Note that the maximum packet + * size is actually the maximum number of bytes that can be transmitted in + * a single microframe, therefore this function multiplies the maximum number + * of bytes per transaction by the number of transaction opportunities per + * microframe. + * - libusb_set_iso_packet_lengths() assigns the same length to all packets + * within a transfer, which is usually what you want. + * + * For outgoing transfers, you'll obviously fill the buffer and populate the + * packet descriptors in hope that all the data gets transferred. For incoming + * transfers, you must ensure the buffer has sufficient capacity for + * the situation where all packets transfer the full amount of requested data. + * + * Completion handling requires some extra consideration. The + * \ref libusb_transfer::actual_length "actual_length" field of the transfer + * is meaningless and should not be examined; instead you must refer to the + * \ref libusb_iso_packet_descriptor::actual_length "actual_length" field of + * each individual packet. + * + * The \ref libusb_transfer::status "status" field of the transfer is also a + * little misleading: + * - If the packets were submitted and the isochronous data microframes + * completed normally, status will have value + * \ref libusb_transfer_status::LIBUSB_TRANSFER_COMPLETED + * "LIBUSB_TRANSFER_COMPLETED". Note that bus errors and software-incurred + * delays are not counted as transfer errors; the transfer.status field may + * indicate COMPLETED even if some or all of the packets failed. Refer to + * the \ref libusb_iso_packet_descriptor::status "status" field of each + * individual packet to determine packet failures. + * - The status field will have value + * \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR + * "LIBUSB_TRANSFER_ERROR" only when serious errors were encountered. + * - Other transfer status codes occur with normal behaviour. + * + * The data for each packet will be found at an offset into the buffer that + * can be calculated as if each prior packet completed in full. The + * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple() + * functions may help you here. + * + * \section asyncmem Memory caveats + * + * In most circumstances, it is not safe to use stack memory for transfer + * buffers. This is because the function that fired off the asynchronous + * transfer may return before libusb has finished using the buffer, and when + * the function returns it's stack gets destroyed. This is true for both + * host-to-device and device-to-host transfers. + * + * The only case in which it is safe to use stack memory is where you can + * guarantee that the function owning the stack space for the buffer does not + * return until after the transfer's callback function has completed. In every + * other case, you need to use heap memory instead. + * + * \section asyncflags Fine control + * + * Through using this asynchronous interface, you may find yourself repeating + * a few simple operations many times. You can apply a bitwise OR of certain + * flags to a transfer to simplify certain things: + * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_SHORT_NOT_OK + * "LIBUSB_TRANSFER_SHORT_NOT_OK" results in transfers which transferred + * less than the requested amount of data being marked with status + * \ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR "LIBUSB_TRANSFER_ERROR" + * (they would normally be regarded as COMPLETED) + * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER + * "LIBUSB_TRANSFER_FREE_BUFFER" allows you to ask libusb to free the transfer + * buffer when freeing the transfer. + * - \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER + * "LIBUSB_TRANSFER_FREE_TRANSFER" causes libusb to automatically free the + * transfer after the transfer callback returns. + * + * \section asyncevent Event handling + * + * In accordance of the aim of being a lightweight library, libusb does not + * create threads internally. This means that libusb code does not execute + * at any time other than when your application is calling a libusb function. + * However, an asynchronous model requires that libusb perform work at various + * points in time - namely processing the results of previously-submitted + * transfers and invoking the user-supplied callback function. + * + * This gives rise to the libusb_handle_events() function which your + * application must call into when libusb has work do to. This gives libusb + * the opportunity to reap pending transfers, invoke callbacks, etc. + * + * The first issue to discuss here is how your application can figure out + * when libusb has work to do. In fact, there are two naive options which + * do not actually require your application to know this: + * -# Periodically call libusb_handle_events() in non-blocking mode at fixed + * short intervals from your main loop + * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated + * thread. + * + * The first option is plainly not very nice, and will cause unnecessary + * CPU wakeups leading to increased power usage and decreased battery life. + * The second option is not very nice either, but may be the nicest option + * available to you if the "proper" approach can not be applied to your + * application (read on...). + * + * The recommended option is to integrate libusb with your application main + * event loop. libusb exposes a set of file descriptors which allow you to do + * this. Your main loop is probably already calling poll() or select() or a + * variant on a set of file descriptors for other event sources (e.g. keyboard + * button presses, mouse movements, network sockets, etc). You then add + * libusb's file descriptors to your poll()/select() calls, and when activity + * is detected on such descriptors you know it is time to call + * libusb_handle_events(). + * + * There is one final event handling complication. libusb supports + * asynchronous transfers which time out after a specified time period, and + * this requires that libusb is called into at or after the timeout so that + * the timeout can be handled. So, in addition to considering libusb's file + * descriptors in your main event loop, you must also consider that libusb + * sometimes needs to be called into at fixed points in time even when there + * is no file descriptor activity. + * + * For the details on retrieving the set of file descriptors and determining + * the next timeout, see the \ref poll "polling and timing" API documentation. + */ + +/** + * @defgroup poll Polling and timing + * + * This page documents libusb's functions for polling events and timing. + * These functions are only necessary for users of the + * \ref asyncio "asynchronous API". If you are only using the simpler + * \ref syncio "synchronous API" then you do not need to ever call these + * functions. + * + * The justification for the functionality described here has already been + * discussed in the \ref asyncevent "event handling" section of the + * asynchronous API documentation. In summary, libusb does not create internal + * threads for event processing and hence relies on your application calling + * into libusb at certain points in time so that pending events can be handled. + * In order to know precisely when libusb needs to be called into, libusb + * offers you a set of pollable file descriptors and information about when + * the next timeout expires. + * + * If you are using the asynchronous I/O API, you must take one of the two + * following options, otherwise your I/O will not complete. + * + * \section pollsimple The simple option + * + * If your application revolves solely around libusb and does not need to + * handle other event sources, you can have a program structure as follows: +\code +// initialize libusb +// find and open device +// maybe fire off some initial async I/O + +while (user_has_not_requested_exit) + libusb_handle_events(ctx); + +// clean up and exit +\endcode + * + * With such a simple main loop, you do not have to worry about managing + * sets of file descriptors or handling timeouts. libusb_handle_events() will + * handle those details internally. + * + * \section pollmain The more advanced option + * + * \note This functionality is currently only available on Unix-like platforms. + * On Windows, libusb_get_pollfds() simply returns NULL. Exposing event sources + * on Windows will require some further thought and design. + * + * In more advanced applications, you will already have a main loop which + * is monitoring other event sources: network sockets, X11 events, mouse + * movements, etc. Through exposing a set of file descriptors, libusb is + * designed to cleanly integrate into such main loops. + * + * In addition to polling file descriptors for the other event sources, you + * take a set of file descriptors from libusb and monitor those too. When you + * detect activity on libusb's file descriptors, you call + * libusb_handle_events_timeout() in non-blocking mode. + * + * What's more, libusb may also need to handle events at specific moments in + * time. No file descriptor activity is generated at these times, so your + * own application needs to be continually aware of when the next one of these + * moments occurs (through calling libusb_get_next_timeout()), and then it + * needs to call libusb_handle_events_timeout() in non-blocking mode when + * these moments occur. This means that you need to adjust your + * poll()/select() timeout accordingly. + * + * libusb provides you with a set of file descriptors to poll and expects you + * to poll all of them, treating them as a single entity. The meaning of each + * file descriptor in the set is an internal implementation detail, + * platform-dependent and may vary from release to release. Don't try and + * interpret the meaning of the file descriptors, just do as libusb indicates, + * polling all of them at once. + * + * In pseudo-code, you want something that looks like: +\code +// initialise libusb + +libusb_get_pollfds(ctx) +while (user has not requested application exit) { + libusb_get_next_timeout(ctx); + poll(on libusb file descriptors plus any other event sources of interest, + using a timeout no larger than the value libusb just suggested) + if (poll() indicated activity on libusb file descriptors) + libusb_handle_events_timeout(ctx, &zero_tv); + if (time has elapsed to or beyond the libusb timeout) + libusb_handle_events_timeout(ctx, &zero_tv); + // handle events from other sources here +} + +// clean up and exit +\endcode + * + * \subsection polltime Notes on time-based events + * + * The above complication with having to track time and call into libusb at + * specific moments is a bit of a headache. For maximum compatibility, you do + * need to write your main loop as above, but you may decide that you can + * restrict the supported platforms of your application and get away with + * a more simplistic scheme. + * + * These time-based event complications are \b not required on the following + * platforms: + * - Darwin + * - Linux, provided that the following version requirements are satisfied: + * - Linux v2.6.27 or newer, compiled with timerfd support + * - glibc v2.9 or newer + * - libusb v1.0.5 or newer + * + * Under these configurations, libusb_get_next_timeout() will \em always return + * 0, so your main loop can be simplified to: +\code +// initialise libusb + +libusb_get_pollfds(ctx) +while (user has not requested application exit) { + poll(on libusb file descriptors plus any other event sources of interest, + using any timeout that you like) + if (poll() indicated activity on libusb file descriptors) + libusb_handle_events_timeout(ctx, &zero_tv); + // handle events from other sources here +} + +// clean up and exit +\endcode + * + * Do remember that if you simplify your main loop to the above, you will + * lose compatibility with some platforms (including legacy Linux platforms, + * and any future platforms supported by libusb which may have time-based + * event requirements). The resultant problems will likely appear as + * strange bugs in your application. + * + * You can use the libusb_pollfds_handle_timeouts() function to do a runtime + * check to see if it is safe to ignore the time-based event complications. + * If your application has taken the shortcut of ignoring libusb's next timeout + * in your main loop, then you are advised to check the return value of + * libusb_pollfds_handle_timeouts() during application startup, and to abort + * if the platform does suffer from these timing complications. + * + * \subsection fdsetchange Changes in the file descriptor set + * + * The set of file descriptors that libusb uses as event sources may change + * during the life of your application. Rather than having to repeatedly + * call libusb_get_pollfds(), you can set up notification functions for when + * the file descriptor set changes using libusb_set_pollfd_notifiers(). + * + * \subsection mtissues Multi-threaded considerations + * + * Unfortunately, the situation is complicated further when multiple threads + * come into play. If two threads are monitoring the same file descriptors, + * the fact that only one thread will be woken up when an event occurs causes + * some headaches. + * + * The events lock, event waiters lock, and libusb_handle_events_locked() + * entities are added to solve these problems. You do not need to be concerned + * with these entities otherwise. + * + * See the extra documentation: \ref mtasync + */ + +/** \page mtasync Multi-threaded applications and asynchronous I/O + * + * libusb is a thread-safe library, but extra considerations must be applied + * to applications which interact with libusb from multiple threads. + * + * The underlying issue that must be addressed is that all libusb I/O + * revolves around monitoring file descriptors through the poll()/select() + * system calls. This is directly exposed at the + * \ref asyncio "asynchronous interface" but it is important to note that the + * \ref syncio "synchronous interface" is implemented on top of the + * asynchonrous interface, therefore the same considerations apply. + * + * The issue is that if two or more threads are concurrently calling poll() + * or select() on libusb's file descriptors then only one of those threads + * will be woken up when an event arrives. The others will be completely + * oblivious that anything has happened. + * + * Consider the following pseudo-code, which submits an asynchronous transfer + * then waits for its completion. This style is one way you could implement a + * synchronous interface on top of the asynchronous interface (and libusb + * does something similar, albeit more advanced due to the complications + * explained on this page). + * +\code +void cb(struct libusb_transfer *transfer) +{ + int *completed = transfer->user_data; + *completed = 1; +} + +void myfunc() { + struct libusb_transfer *transfer; + unsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE]; + int completed = 0; + + transfer = libusb_alloc_transfer(0); + libusb_fill_control_setup(buffer, + LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, 0x04, 0x01, 0, 0); + libusb_fill_control_transfer(transfer, dev, buffer, cb, &completed, 1000); + libusb_submit_transfer(transfer); + + while (!completed) { + poll(libusb file descriptors, 120*1000); + if (poll indicates activity) + libusb_handle_events_timeout(ctx, &zero_tv); + } + printf("completed!"); + // other code here +} +\endcode + * + * Here we are serializing completion of an asynchronous event + * against a condition - the condition being completion of a specific transfer. + * The poll() loop has a long timeout to minimize CPU usage during situations + * when nothing is happening (it could reasonably be unlimited). + * + * If this is the only thread that is polling libusb's file descriptors, there + * is no problem: there is no danger that another thread will swallow up the + * event that we are interested in. On the other hand, if there is another + * thread polling the same descriptors, there is a chance that it will receive + * the event that we were interested in. In this situation, myfunc() + * will only realise that the transfer has completed on the next iteration of + * the loop, up to 120 seconds later. Clearly a two-minute delay is + * undesirable, and don't even think about using short timeouts to circumvent + * this issue! + * + * The solution here is to ensure that no two threads are ever polling the + * file descriptors at the same time. A naive implementation of this would + * impact the capabilities of the library, so libusb offers the scheme + * documented below to ensure no loss of functionality. + * + * Before we go any further, it is worth mentioning that all libusb-wrapped + * event handling procedures fully adhere to the scheme documented below. + * This includes libusb_handle_events() and its variants, and all the + * synchronous I/O functions - libusb hides this headache from you. + * + * \section Using libusb_handle_events() from multiple threads + * + * Even when only using libusb_handle_events() and synchronous I/O functions, + * you can still have a race condition. You might be tempted to solve the + * above with libusb_handle_events() like so: + * +\code + libusb_submit_transfer(transfer); + + while (!completed) { + libusb_handle_events(ctx); + } + printf("completed!"); +\endcode + * + * This however has a race between the checking of completed and + * libusb_handle_events() acquiring the events lock, so another thread + * could have completed the transfer, resulting in this thread hanging + * until either a timeout or another event occurs. See also commit + * 6696512aade99bb15d6792af90ae329af270eba6 which fixes this in the + * synchronous API implementation of libusb. + * + * Fixing this race requires checking the variable completed only after + * taking the event lock, which defeats the concept of just calling + * libusb_handle_events() without worrying about locking. This is why + * libusb-1.0.9 introduces the new libusb_handle_events_timeout_completed() + * and libusb_handle_events_completed() functions, which handles doing the + * completion check for you after they have acquired the lock: + * +\code + libusb_submit_transfer(transfer); + + while (!completed) { + libusb_handle_events_completed(ctx, &completed); + } + printf("completed!"); +\endcode + * + * This nicely fixes the race in our example. Note that if all you want to + * do is submit a single transfer and wait for its completion, then using + * one of the synchronous I/O functions is much easier. + * + * \section eventlock The events lock + * + * The problem is when we consider the fact that libusb exposes file + * descriptors to allow for you to integrate asynchronous USB I/O into + * existing main loops, effectively allowing you to do some work behind + * libusb's back. If you do take libusb's file descriptors and pass them to + * poll()/select() yourself, you need to be aware of the associated issues. + * + * The first concept to be introduced is the events lock. The events lock + * is used to serialize threads that want to handle events, such that only + * one thread is handling events at any one time. + * + * You must take the events lock before polling libusb file descriptors, + * using libusb_lock_events(). You must release the lock as soon as you have + * aborted your poll()/select() loop, using libusb_unlock_events(). + * + * \section threadwait Letting other threads do the work for you + * + * Although the events lock is a critical part of the solution, it is not + * enough on it's own. You might wonder if the following is sufficient... +\code + libusb_lock_events(ctx); + while (!completed) { + poll(libusb file descriptors, 120*1000); + if (poll indicates activity) + libusb_handle_events_timeout(ctx, &zero_tv); + } + libusb_unlock_events(ctx); +\endcode + * ...and the answer is that it is not. This is because the transfer in the + * code shown above may take a long time (say 30 seconds) to complete, and + * the lock is not released until the transfer is completed. + * + * Another thread with similar code that wants to do event handling may be + * working with a transfer that completes after a few milliseconds. Despite + * having such a quick completion time, the other thread cannot check that + * status of its transfer until the code above has finished (30 seconds later) + * due to contention on the lock. + * + * To solve this, libusb offers you a mechanism to determine when another + * thread is handling events. It also offers a mechanism to block your thread + * until the event handling thread has completed an event (and this mechanism + * does not involve polling of file descriptors). + * + * After determining that another thread is currently handling events, you + * obtain the event waiters lock using libusb_lock_event_waiters(). + * You then re-check that some other thread is still handling events, and if + * so, you call libusb_wait_for_event(). + * + * libusb_wait_for_event() puts your application to sleep until an event + * occurs, or until a thread releases the events lock. When either of these + * things happen, your thread is woken up, and should re-check the condition + * it was waiting on. It should also re-check that another thread is handling + * events, and if not, it should start handling events itself. + * + * This looks like the following, as pseudo-code: +\code +retry: +if (libusb_try_lock_events(ctx) == 0) { + // we obtained the event lock: do our own event handling + while (!completed) { + if (!libusb_event_handling_ok(ctx)) { + libusb_unlock_events(ctx); + goto retry; + } + poll(libusb file descriptors, 120*1000); + if (poll indicates activity) + libusb_handle_events_locked(ctx, 0); + } + libusb_unlock_events(ctx); +} else { + // another thread is doing event handling. wait for it to signal us that + // an event has completed + libusb_lock_event_waiters(ctx); + + while (!completed) { + // now that we have the event waiters lock, double check that another + // thread is still handling events for us. (it may have ceased handling + // events in the time it took us to reach this point) + if (!libusb_event_handler_active(ctx)) { + // whoever was handling events is no longer doing so, try again + libusb_unlock_event_waiters(ctx); + goto retry; + } + + libusb_wait_for_event(ctx, NULL); + } + libusb_unlock_event_waiters(ctx); +} +printf("completed!\n"); +\endcode + * + * A naive look at the above code may suggest that this can only support + * one event waiter (hence a total of 2 competing threads, the other doing + * event handling), because the event waiter seems to have taken the event + * waiters lock while waiting for an event. However, the system does support + * multiple event waiters, because libusb_wait_for_event() actually drops + * the lock while waiting, and reaquires it before continuing. + * + * We have now implemented code which can dynamically handle situations where + * nobody is handling events (so we should do it ourselves), and it can also + * handle situations where another thread is doing event handling (so we can + * piggyback onto them). It is also equipped to handle a combination of + * the two, for example, another thread is doing event handling, but for + * whatever reason it stops doing so before our condition is met, so we take + * over the event handling. + * + * Four functions were introduced in the above pseudo-code. Their importance + * should be apparent from the code shown above. + * -# libusb_try_lock_events() is a non-blocking function which attempts + * to acquire the events lock but returns a failure code if it is contended. + * -# libusb_event_handling_ok() checks that libusb is still happy for your + * thread to be performing event handling. Sometimes, libusb needs to + * interrupt the event handler, and this is how you can check if you have + * been interrupted. If this function returns 0, the correct behaviour is + * for you to give up the event handling lock, and then to repeat the cycle. + * The following libusb_try_lock_events() will fail, so you will become an + * events waiter. For more information on this, read \ref fullstory below. + * -# libusb_handle_events_locked() is a variant of + * libusb_handle_events_timeout() that you can call while holding the + * events lock. libusb_handle_events_timeout() itself implements similar + * logic to the above, so be sure not to call it when you are + * "working behind libusb's back", as is the case here. + * -# libusb_event_handler_active() determines if someone is currently + * holding the events lock + * + * You might be wondering why there is no function to wake up all threads + * blocked on libusb_wait_for_event(). This is because libusb can do this + * internally: it will wake up all such threads when someone calls + * libusb_unlock_events() or when a transfer completes (at the point after its + * callback has returned). + * + * \subsection fullstory The full story + * + * The above explanation should be enough to get you going, but if you're + * really thinking through the issues then you may be left with some more + * questions regarding libusb's internals. If you're curious, read on, and if + * not, skip to the next section to avoid confusing yourself! + * + * The immediate question that may spring to mind is: what if one thread + * modifies the set of file descriptors that need to be polled while another + * thread is doing event handling? + * + * There are 2 situations in which this may happen. + * -# libusb_open() will add another file descriptor to the poll set, + * therefore it is desirable to interrupt the event handler so that it + * restarts, picking up the new descriptor. + * -# libusb_close() will remove a file descriptor from the poll set. There + * are all kinds of race conditions that could arise here, so it is + * important that nobody is doing event handling at this time. + * + * libusb handles these issues internally, so application developers do not + * have to stop their event handlers while opening/closing devices. Here's how + * it works, focusing on the libusb_close() situation first: + * + * -# During initialization, libusb opens an internal pipe, and it adds the read + * end of this pipe to the set of file descriptors to be polled. + * -# During libusb_close(), libusb writes some dummy data on this control pipe. + * This immediately interrupts the event handler. libusb also records + * internally that it is trying to interrupt event handlers for this + * high-priority event. + * -# At this point, some of the functions described above start behaving + * differently: + * - libusb_event_handling_ok() starts returning 1, indicating that it is NOT + * OK for event handling to continue. + * - libusb_try_lock_events() starts returning 1, indicating that another + * thread holds the event handling lock, even if the lock is uncontended. + * - libusb_event_handler_active() starts returning 1, indicating that + * another thread is doing event handling, even if that is not true. + * -# The above changes in behaviour result in the event handler stopping and + * giving up the events lock very quickly, giving the high-priority + * libusb_close() operation a "free ride" to acquire the events lock. All + * threads that are competing to do event handling become event waiters. + * -# With the events lock held inside libusb_close(), libusb can safely remove + * a file descriptor from the poll set, in the safety of knowledge that + * nobody is polling those descriptors or trying to access the poll set. + * -# After obtaining the events lock, the close operation completes very + * quickly (usually a matter of milliseconds) and then immediately releases + * the events lock. + * -# At the same time, the behaviour of libusb_event_handling_ok() and friends + * reverts to the original, documented behaviour. + * -# The release of the events lock causes the threads that are waiting for + * events to be woken up and to start competing to become event handlers + * again. One of them will succeed; it will then re-obtain the list of poll + * descriptors, and USB I/O will then continue as normal. + * + * libusb_open() is similar, and is actually a more simplistic case. Upon a + * call to libusb_open(): + * + * -# The device is opened and a file descriptor is added to the poll set. + * -# libusb sends some dummy data on the control pipe, and records that it + * is trying to modify the poll descriptor set. + * -# The event handler is interrupted, and the same behaviour change as for + * libusb_close() takes effect, causing all event handling threads to become + * event waiters. + * -# The libusb_open() implementation takes its free ride to the events lock. + * -# Happy that it has successfully paused the events handler, libusb_open() + * releases the events lock. + * -# The event waiter threads are all woken up and compete to become event + * handlers again. The one that succeeds will obtain the list of poll + * descriptors again, which will include the addition of the new device. + * + * \subsection concl Closing remarks + * + * The above may seem a little complicated, but hopefully I have made it clear + * why such complications are necessary. Also, do not forget that this only + * applies to applications that take libusb's file descriptors and integrate + * them into their own polling loops. + * + * You may decide that it is OK for your multi-threaded application to ignore + * some of the rules and locks detailed above, because you don't think that + * two threads can ever be polling the descriptors at the same time. If that + * is the case, then that's good news for you because you don't have to worry. + * But be careful here; remember that the synchronous I/O functions do event + * handling internally. If you have one thread doing event handling in a loop + * (without implementing the rules and locking semantics documented above) + * and another trying to send a synchronous USB transfer, you will end up with + * two threads monitoring the same descriptors, and the above-described + * undesirable behaviour occuring. The solution is for your polling thread to + * play by the rules; the synchronous I/O functions do so, and this will result + * in them getting along in perfect harmony. + * + * If you do have a dedicated thread doing event handling, it is perfectly + * legal for it to take the event handling lock for long periods of time. Any + * synchronous I/O functions you call from other threads will transparently + * fall back to the "event waiters" mechanism detailed above. The only + * consideration that your event handling thread must apply is the one related + * to libusb_event_handling_ok(): you must call this before every poll(), and + * give up the events lock if instructed. + */ + +int usbi_io_init(struct libusb_context *ctx) +{ + int r; + + usbi_mutex_init(&ctx->flying_transfers_lock, NULL); + usbi_mutex_init(&ctx->pollfds_lock, NULL); + usbi_mutex_init(&ctx->pollfd_modify_lock, NULL); + usbi_mutex_init_recursive(&ctx->events_lock, NULL); + usbi_mutex_init(&ctx->event_waiters_lock, NULL); + usbi_cond_init(&ctx->event_waiters_cond, NULL); + list_init(&ctx->flying_transfers); + list_init(&ctx->pollfds); + + /* FIXME should use an eventfd on kernels that support it */ + r = usbi_pipe(ctx->ctrl_pipe); + if (r < 0) { + r = LIBUSB_ERROR_OTHER; + goto err; + } + + r = usbi_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN); + if (r < 0) + goto err_close_pipe; + +#ifdef USBI_TIMERFD_AVAILABLE + ctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(), + TFD_NONBLOCK); + if (ctx->timerfd >= 0) { + usbi_dbg("using timerfd for timeouts"); + r = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN); + if (r < 0) { + usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]); + close(ctx->timerfd); + goto err_close_pipe; + } + } else { + usbi_dbg("timerfd not available (code %d error %d)", ctx->timerfd, errno); + ctx->timerfd = -1; + } +#endif + + return 0; + +err_close_pipe: + usbi_close(ctx->ctrl_pipe[0]); + usbi_close(ctx->ctrl_pipe[1]); +err: + usbi_mutex_destroy(&ctx->flying_transfers_lock); + usbi_mutex_destroy(&ctx->pollfds_lock); + usbi_mutex_destroy(&ctx->pollfd_modify_lock); + usbi_mutex_destroy(&ctx->events_lock); + usbi_mutex_destroy(&ctx->event_waiters_lock); + usbi_cond_destroy(&ctx->event_waiters_cond); + return r; +} + +void usbi_io_exit(struct libusb_context *ctx) +{ + usbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]); + usbi_close(ctx->ctrl_pipe[0]); + usbi_close(ctx->ctrl_pipe[1]); +#ifdef USBI_TIMERFD_AVAILABLE + if (usbi_using_timerfd(ctx)) { + usbi_remove_pollfd(ctx, ctx->timerfd); + close(ctx->timerfd); + } +#endif + usbi_mutex_destroy(&ctx->flying_transfers_lock); + usbi_mutex_destroy(&ctx->pollfds_lock); + usbi_mutex_destroy(&ctx->pollfd_modify_lock); + usbi_mutex_destroy(&ctx->events_lock); + usbi_mutex_destroy(&ctx->event_waiters_lock); + usbi_cond_destroy(&ctx->event_waiters_cond); +} + +static int calculate_timeout(struct usbi_transfer *transfer) +{ + int r; + struct timespec current_time; + unsigned int timeout = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout; + + if (!timeout) + return 0; + + r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, ¤t_time); + if (r < 0) { + usbi_err(ITRANSFER_CTX(transfer), + "failed to read monotonic clock, errno=%d", errno); + return r; + } + + current_time.tv_sec += timeout / 1000; + current_time.tv_nsec += (timeout % 1000) * 1000000; + + if (current_time.tv_nsec > 1000000000) { + current_time.tv_nsec -= 1000000000; + current_time.tv_sec++; + } + + TIMESPEC_TO_TIMEVAL(&transfer->timeout, ¤t_time); + return 0; +} + +/* add a transfer to the (timeout-sorted) active transfers list. + * returns 1 if the transfer has a timeout and it is the timeout next to + * expire */ +static int add_to_flying_list(struct usbi_transfer *transfer) +{ + struct usbi_transfer *cur; + struct timeval *timeout = &transfer->timeout; + struct libusb_context *ctx = ITRANSFER_CTX(transfer); + int r = 0; + int first = 1; + + usbi_mutex_lock(&ctx->flying_transfers_lock); + + /* if we have no other flying transfers, start the list with this one */ + if (list_empty(&ctx->flying_transfers)) { + list_add(&transfer->list, &ctx->flying_transfers); + if (timerisset(timeout)) + r = 1; + goto out; + } + + /* if we have infinite timeout, append to end of list */ + if (!timerisset(timeout)) { + list_add_tail(&transfer->list, &ctx->flying_transfers); + goto out; + } + + /* otherwise, find appropriate place in list */ + list_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) { + /* find first timeout that occurs after the transfer in question */ + struct timeval *cur_tv = &cur->timeout; + + if (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) || + (cur_tv->tv_sec == timeout->tv_sec && + cur_tv->tv_usec > timeout->tv_usec)) { + list_add_tail(&transfer->list, &cur->list); + r = first; + goto out; + } + first = 0; + } + + /* otherwise we need to be inserted at the end */ + list_add_tail(&transfer->list, &ctx->flying_transfers); +out: + usbi_mutex_unlock(&ctx->flying_transfers_lock); + return r; +} + +/** \ingroup asyncio + * Allocate a libusb transfer with a specified number of isochronous packet + * descriptors. The returned transfer is pre-initialized for you. When the new + * transfer is no longer needed, it should be freed with + * libusb_free_transfer(). + * + * Transfers intended for non-isochronous endpoints (e.g. control, bulk, + * interrupt) should specify an iso_packets count of zero. + * + * For transfers intended for isochronous endpoints, specify an appropriate + * number of packet descriptors to be allocated as part of the transfer. + * The returned transfer is not specially initialized for isochronous I/O; + * you are still required to set the + * \ref libusb_transfer::num_iso_packets "num_iso_packets" and + * \ref libusb_transfer::type "type" fields accordingly. + * + * It is safe to allocate a transfer with some isochronous packets and then + * use it on a non-isochronous endpoint. If you do this, ensure that at time + * of submission, num_iso_packets is 0 and that type is set appropriately. + * + * \param iso_packets number of isochronous packet descriptors to allocate + * \returns a newly allocated transfer, or NULL on error + */ +DEFAULT_VISIBILITY +struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer( + int iso_packets) +{ + size_t os_alloc_size = usbi_backend->transfer_priv_size + + (usbi_backend->add_iso_packet_size * iso_packets); + size_t alloc_size = sizeof(struct usbi_transfer) + + sizeof(struct libusb_transfer) + + (sizeof(struct libusb_iso_packet_descriptor) * iso_packets) + + os_alloc_size; + struct usbi_transfer *itransfer = malloc(alloc_size); + if (!itransfer) + return NULL; + + memset(itransfer, 0, alloc_size); + itransfer->num_iso_packets = iso_packets; + usbi_mutex_init(&itransfer->lock, NULL); + return USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); +} + +/** \ingroup asyncio + * Free a transfer structure. This should be called for all transfers + * allocated with libusb_alloc_transfer(). + * + * If the \ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER + * "LIBUSB_TRANSFER_FREE_BUFFER" flag is set and the transfer buffer is + * non-NULL, this function will also free the transfer buffer using the + * standard system memory allocator (e.g. free()). + * + * It is legal to call this function with a NULL transfer. In this case, + * the function will simply return safely. + * + * It is not legal to free an active transfer (one which has been submitted + * and has not yet completed). + * + * \param transfer the transfer to free + */ +void API_EXPORTED libusb_free_transfer(struct libusb_transfer *transfer) +{ + struct usbi_transfer *itransfer; + if (!transfer) + return; + + if (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer) + free(transfer->buffer); + + itransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); + usbi_mutex_destroy(&itransfer->lock); + free(itransfer); +} + +/** \ingroup asyncio + * Submit a transfer. This function will fire off the USB transfer and then + * return immediately. + * + * \param transfer the transfer to submit + * \returns 0 on success + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns LIBUSB_ERROR_BUSY if the transfer has already been submitted. + * \returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported + * by the operating system. + * \returns another LIBUSB_ERROR code on other failure + */ +int API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) +{ + struct libusb_context *ctx = TRANSFER_CTX(transfer); + struct usbi_transfer *itransfer = + LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); + int r; + int first; + + usbi_mutex_lock(&itransfer->lock); + itransfer->transferred = 0; + itransfer->flags = 0; + r = calculate_timeout(itransfer); + if (r < 0) { + r = LIBUSB_ERROR_OTHER; + goto out; + } + + first = add_to_flying_list(itransfer); + r = usbi_backend->submit_transfer(itransfer); + if (r) { + usbi_mutex_lock(&ctx->flying_transfers_lock); + list_del(&itransfer->list); + usbi_mutex_unlock(&ctx->flying_transfers_lock); + } +#ifdef USBI_TIMERFD_AVAILABLE + else if (first && usbi_using_timerfd(ctx)) { + /* if this transfer has the lowest timeout of all active transfers, + * rearm the timerfd with this transfer's timeout */ + const struct itimerspec it = { {0, 0}, + { itransfer->timeout.tv_sec, itransfer->timeout.tv_usec * 1000 } }; + usbi_dbg("arm timerfd for timeout in %dms (first in line)", transfer->timeout); + r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL); + if (r < 0) + r = LIBUSB_ERROR_OTHER; + } +#else + (void)first; +#endif + +out: + usbi_mutex_unlock(&itransfer->lock); + return r; +} + +/** \ingroup asyncio + * Asynchronously cancel a previously submitted transfer. + * This function returns immediately, but this does not indicate cancellation + * is complete. Your callback function will be invoked at some later time + * with a transfer status of + * \ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED + * "LIBUSB_TRANSFER_CANCELLED." + * + * \param transfer the transfer to cancel + * \returns 0 on success + * \returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or + * cancelled. + * \returns a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer) +{ + struct usbi_transfer *itransfer = + LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer); + int r; + + usbi_dbg(""); + usbi_mutex_lock(&itransfer->lock); + r = usbi_backend->cancel_transfer(itransfer); + if (r < 0) { + if (r != LIBUSB_ERROR_NOT_FOUND) + usbi_err(TRANSFER_CTX(transfer), + "cancel transfer failed error %d", r); + else + usbi_dbg("cancel transfer failed error %d", r); + + if (r == LIBUSB_ERROR_NO_DEVICE) + itransfer->flags |= USBI_TRANSFER_DEVICE_DISAPPEARED; + } + + itransfer->flags |= USBI_TRANSFER_CANCELLING; + + usbi_mutex_unlock(&itransfer->lock); + return r; +} + +#ifdef USBI_TIMERFD_AVAILABLE +static int disarm_timerfd(struct libusb_context *ctx) +{ + const struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } }; + int r; + + usbi_dbg(""); + r = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL); + if (r < 0) + return LIBUSB_ERROR_OTHER; + else + return 0; +} + +/* iterates through the flying transfers, and rearms the timerfd based on the + * next upcoming timeout. + * must be called with flying_list locked. + * returns 0 if there was no timeout to arm, 1 if the next timeout was armed, + * or a LIBUSB_ERROR code on failure. + */ +static int arm_timerfd_for_next_timeout(struct libusb_context *ctx) +{ + struct usbi_transfer *transfer; + + list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { + struct timeval *cur_tv = &transfer->timeout; + + /* if we've reached transfers of infinite timeout, then we have no + * arming to do */ + if (!timerisset(cur_tv)) + return 0; + + /* act on first transfer that is not already cancelled */ + if (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) { + int r; + const struct itimerspec it = { {0, 0}, + { cur_tv->tv_sec, cur_tv->tv_usec * 1000 } }; + usbi_dbg("next timeout originally %dms", USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout); + r = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL); + if (r < 0) + return LIBUSB_ERROR_OTHER; + return 1; + } + } + + return 0; +} +#else +static int disarm_timerfd(struct libusb_context *ctx) +{ + (void)ctx; + return 0; +} +static int arm_timerfd_for_next_timeout(struct libusb_context *ctx) +{ + (void)ctx; + return 0; +} +#endif + +/* Handle completion of a transfer (completion might be an error condition). + * This will invoke the user-supplied callback function, which may end up + * freeing the transfer. Therefore you cannot use the transfer structure + * after calling this function, and you should free all backend-specific + * data before calling it. + * Do not call this function with the usbi_transfer lock held. User-specified + * callback functions may attempt to directly resubmit the transfer, which + * will attempt to take the lock. */ +int usbi_handle_transfer_completion(struct usbi_transfer *itransfer, + enum libusb_transfer_status status) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = TRANSFER_CTX(transfer); + uint8_t flags; + int r = 0; + + /* FIXME: could be more intelligent with the timerfd here. we don't need + * to disarm the timerfd if there was no timer running, and we only need + * to rearm the timerfd if the transfer that expired was the one with + * the shortest timeout. */ + + usbi_mutex_lock(&ctx->flying_transfers_lock); + list_del(&itransfer->list); + if (usbi_using_timerfd(ctx)) + r = arm_timerfd_for_next_timeout(ctx); + usbi_mutex_unlock(&ctx->flying_transfers_lock); + + if (usbi_using_timerfd(ctx)) { + if (r < 0) + return r; + r = disarm_timerfd(ctx); + if (r < 0) + return r; + } + + if (status == LIBUSB_TRANSFER_COMPLETED + && transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) { + int rqlen = transfer->length; + if (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL) + rqlen -= LIBUSB_CONTROL_SETUP_SIZE; + if (rqlen != itransfer->transferred) { + usbi_dbg("interpreting short transfer as error"); + status = LIBUSB_TRANSFER_ERROR; + } + } + + flags = transfer->flags; + transfer->status = status; + transfer->actual_length = itransfer->transferred; + usbi_dbg("transfer %p has callback %p", transfer, transfer->callback); + if (transfer->callback) + transfer->callback(transfer); + /* transfer might have been freed by the above call, do not use from + * this point. */ + if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) + libusb_free_transfer(transfer); + usbi_mutex_lock(&ctx->event_waiters_lock); + usbi_cond_broadcast(&ctx->event_waiters_cond); + usbi_mutex_unlock(&ctx->event_waiters_lock); + return 0; +} + +/* Similar to usbi_handle_transfer_completion() but exclusively for transfers + * that were asynchronously cancelled. The same concerns w.r.t. freeing of + * transfers exist here. + * Do not call this function with the usbi_transfer lock held. User-specified + * callback functions may attempt to directly resubmit the transfer, which + * will attempt to take the lock. */ +int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer) +{ + /* if the URB was cancelled due to timeout, report timeout to the user */ + if (transfer->flags & USBI_TRANSFER_TIMED_OUT) { + usbi_dbg("detected timeout cancellation"); + return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT); + } + + /* otherwise its a normal async cancel */ + return usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED); +} + +/** \ingroup poll + * Attempt to acquire the event handling lock. This lock is used to ensure that + * only one thread is monitoring libusb event sources at any one time. + * + * You only need to use this lock if you are developing an application + * which calls poll() or select() on libusb's file descriptors directly. + * If you stick to libusb's event handling loop functions (e.g. + * libusb_handle_events()) then you do not need to be concerned with this + * locking. + * + * While holding this lock, you are trusted to actually be handling events. + * If you are no longer handling events, you must call libusb_unlock_events() + * as soon as possible. + * + * \param ctx the context to operate on, or NULL for the default context + * \returns 0 if the lock was obtained successfully + * \returns 1 if the lock was not obtained (i.e. another thread holds the lock) + * \see \ref mtasync + */ +int API_EXPORTED libusb_try_lock_events(libusb_context *ctx) +{ + int r; + USBI_GET_CONTEXT(ctx); + + /* is someone else waiting to modify poll fds? if so, don't let this thread + * start event handling */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + r = ctx->pollfd_modify; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + if (r) { + usbi_dbg("someone else is modifying poll fds"); + return 1; + } + + r = usbi_mutex_trylock(&ctx->events_lock); + if (r) + return 1; + + ctx->event_handler_active = 1; + return 0; +} + +/** \ingroup poll + * Acquire the event handling lock, blocking until successful acquisition if + * it is contended. This lock is used to ensure that only one thread is + * monitoring libusb event sources at any one time. + * + * You only need to use this lock if you are developing an application + * which calls poll() or select() on libusb's file descriptors directly. + * If you stick to libusb's event handling loop functions (e.g. + * libusb_handle_events()) then you do not need to be concerned with this + * locking. + * + * While holding this lock, you are trusted to actually be handling events. + * If you are no longer handling events, you must call libusb_unlock_events() + * as soon as possible. + * + * \param ctx the context to operate on, or NULL for the default context + * \see \ref mtasync + */ +void API_EXPORTED libusb_lock_events(libusb_context *ctx) +{ + USBI_GET_CONTEXT(ctx); + usbi_mutex_lock(&ctx->events_lock); + ctx->event_handler_active = 1; +} + +/** \ingroup poll + * Release the lock previously acquired with libusb_try_lock_events() or + * libusb_lock_events(). Releasing this lock will wake up any threads blocked + * on libusb_wait_for_event(). + * + * \param ctx the context to operate on, or NULL for the default context + * \see \ref mtasync + */ +void API_EXPORTED libusb_unlock_events(libusb_context *ctx) +{ + USBI_GET_CONTEXT(ctx); + ctx->event_handler_active = 0; + usbi_mutex_unlock(&ctx->events_lock); + + /* FIXME: perhaps we should be a bit more efficient by not broadcasting + * the availability of the events lock when we are modifying pollfds + * (check ctx->pollfd_modify)? */ + usbi_mutex_lock(&ctx->event_waiters_lock); + usbi_cond_broadcast(&ctx->event_waiters_cond); + usbi_mutex_unlock(&ctx->event_waiters_lock); +} + +/** \ingroup poll + * Determine if it is still OK for this thread to be doing event handling. + * + * Sometimes, libusb needs to temporarily pause all event handlers, and this + * is the function you should use before polling file descriptors to see if + * this is the case. + * + * If this function instructs your thread to give up the events lock, you + * should just continue the usual logic that is documented in \ref mtasync. + * On the next iteration, your thread will fail to obtain the events lock, + * and will hence become an event waiter. + * + * This function should be called while the events lock is held: you don't + * need to worry about the results of this function if your thread is not + * the current event handler. + * + * \param ctx the context to operate on, or NULL for the default context + * \returns 1 if event handling can start or continue + * \returns 0 if this thread must give up the events lock + * \see \ref fullstory "Multi-threaded I/O: the full story" + */ +int API_EXPORTED libusb_event_handling_ok(libusb_context *ctx) +{ + int r; + USBI_GET_CONTEXT(ctx); + + /* is someone else waiting to modify poll fds? if so, don't let this thread + * continue event handling */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + r = ctx->pollfd_modify; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + if (r) { + usbi_dbg("someone else is modifying poll fds"); + return 0; + } + + return 1; +} + + +/** \ingroup poll + * Determine if an active thread is handling events (i.e. if anyone is holding + * the event handling lock). + * + * \param ctx the context to operate on, or NULL for the default context + * \returns 1 if a thread is handling events + * \returns 0 if there are no threads currently handling events + * \see \ref mtasync + */ +int API_EXPORTED libusb_event_handler_active(libusb_context *ctx) +{ + int r; + USBI_GET_CONTEXT(ctx); + + /* is someone else waiting to modify poll fds? if so, don't let this thread + * start event handling -- indicate that event handling is happening */ + usbi_mutex_lock(&ctx->pollfd_modify_lock); + r = ctx->pollfd_modify; + usbi_mutex_unlock(&ctx->pollfd_modify_lock); + if (r) { + usbi_dbg("someone else is modifying poll fds"); + return 1; + } + + return ctx->event_handler_active; +} + +/** \ingroup poll + * Acquire the event waiters lock. This lock is designed to be obtained under + * the situation where you want to be aware when events are completed, but + * some other thread is event handling so calling libusb_handle_events() is not + * allowed. + * + * You then obtain this lock, re-check that another thread is still handling + * events, then call libusb_wait_for_event(). + * + * You only need to use this lock if you are developing an application + * which calls poll() or select() on libusb's file descriptors directly, + * and may potentially be handling events from 2 threads simultaenously. + * If you stick to libusb's event handling loop functions (e.g. + * libusb_handle_events()) then you do not need to be concerned with this + * locking. + * + * \param ctx the context to operate on, or NULL for the default context + * \see \ref mtasync + */ +void API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx) +{ + USBI_GET_CONTEXT(ctx); + usbi_mutex_lock(&ctx->event_waiters_lock); +} + +/** \ingroup poll + * Release the event waiters lock. + * \param ctx the context to operate on, or NULL for the default context + * \see \ref mtasync + */ +void API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx) +{ + USBI_GET_CONTEXT(ctx); + usbi_mutex_unlock(&ctx->event_waiters_lock); +} + +/** \ingroup poll + * Wait for another thread to signal completion of an event. Must be called + * with the event waiters lock held, see libusb_lock_event_waiters(). + * + * This function will block until any of the following conditions are met: + * -# The timeout expires + * -# A transfer completes + * -# A thread releases the event handling lock through libusb_unlock_events() + * + * Condition 1 is obvious. Condition 2 unblocks your thread after + * the callback for the transfer has completed. Condition 3 is important + * because it means that the thread that was previously handling events is no + * longer doing so, so if any events are to complete, another thread needs to + * step up and start event handling. + * + * This function releases the event waiters lock before putting your thread + * to sleep, and reacquires the lock as it is being woken up. + * + * \param ctx the context to operate on, or NULL for the default context + * \param tv maximum timeout for this blocking function. A NULL value + * indicates unlimited timeout. + * \returns 0 after a transfer completes or another thread stops event handling + * \returns 1 if the timeout expired + * \see \ref mtasync + */ +int API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) +{ + struct timespec timeout; + int r; + + USBI_GET_CONTEXT(ctx); + if (tv == NULL) { + usbi_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock); + return 0; + } + + r = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout); + if (r < 0) { + usbi_err(ctx, "failed to read realtime clock, error %d", errno); + return LIBUSB_ERROR_OTHER; + } + + timeout.tv_sec += tv->tv_sec; + timeout.tv_nsec += tv->tv_usec * 1000; + if (timeout.tv_nsec > 1000000000) { + timeout.tv_nsec -= 1000000000; + timeout.tv_sec++; + } + + r = usbi_cond_timedwait(&ctx->event_waiters_cond, + &ctx->event_waiters_lock, &timeout); + return (r == ETIMEDOUT); +} + +static void handle_timeout(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + int r; + + itransfer->flags |= USBI_TRANSFER_TIMED_OUT; + r = libusb_cancel_transfer(transfer); + if (r < 0) + usbi_warn(TRANSFER_CTX(transfer), + "async cancel failed %d errno=%d", r, errno); +} + +static int handle_timeouts_locked(struct libusb_context *ctx) +{ + int r; + struct timespec systime_ts; + struct timeval systime; + struct usbi_transfer *transfer; + + if (list_empty(&ctx->flying_transfers)) + return 0; + + /* get current time */ + r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &systime_ts); + if (r < 0) + return r; + + TIMESPEC_TO_TIMEVAL(&systime, &systime_ts); + + /* iterate through flying transfers list, finding all transfers that + * have expired timeouts */ + list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { + struct timeval *cur_tv = &transfer->timeout; + + /* if we've reached transfers of infinite timeout, we're all done */ + if (!timerisset(cur_tv)) + return 0; + + /* ignore timeouts we've already handled */ + if (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT)) + continue; + + /* if transfer has non-expired timeout, nothing more to do */ + if ((cur_tv->tv_sec > systime.tv_sec) || + (cur_tv->tv_sec == systime.tv_sec && + cur_tv->tv_usec > systime.tv_usec)) + return 0; + + /* otherwise, we've got an expired timeout to handle */ + handle_timeout(transfer); + } + return 0; +} + +static int handle_timeouts(struct libusb_context *ctx) +{ + int r; + USBI_GET_CONTEXT(ctx); + usbi_mutex_lock(&ctx->flying_transfers_lock); + r = handle_timeouts_locked(ctx); + usbi_mutex_unlock(&ctx->flying_transfers_lock); + return r; +} + +#ifdef USBI_TIMERFD_AVAILABLE +static int handle_timerfd_trigger(struct libusb_context *ctx) +{ + int r; + + r = disarm_timerfd(ctx); + if (r < 0) + return r; + + usbi_mutex_lock(&ctx->flying_transfers_lock); + + /* process the timeout that just happened */ + r = handle_timeouts_locked(ctx); + if (r < 0) + goto out; + + /* arm for next timeout*/ + r = arm_timerfd_for_next_timeout(ctx); + +out: + usbi_mutex_unlock(&ctx->flying_transfers_lock); + return r; +} +#endif + +/* do the actual event handling. assumes that no other thread is concurrently + * doing the same thing. */ +static int handle_events(struct libusb_context *ctx, struct timeval *tv) +{ + int r; + struct usbi_pollfd *ipollfd; + POLL_NFDS_TYPE nfds = 0; + struct pollfd *fds; + int i = -1; + int timeout_ms; + + usbi_mutex_lock(&ctx->pollfds_lock); + list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) + nfds++; + + /* TODO: malloc when number of fd's changes, not on every poll */ + fds = malloc(sizeof(*fds) * nfds); + if (!fds) { + usbi_mutex_unlock(&ctx->pollfds_lock); + return LIBUSB_ERROR_NO_MEM; + } + + list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) { + struct libusb_pollfd *pollfd = &ipollfd->pollfd; + int fd = pollfd->fd; + i++; + fds[i].fd = fd; + fds[i].events = pollfd->events; + fds[i].revents = 0; + } + usbi_mutex_unlock(&ctx->pollfds_lock); + + timeout_ms = (tv->tv_sec * 1000) + (tv->tv_usec / 1000); + + /* round up to next millisecond */ + if (tv->tv_usec % 1000) + timeout_ms++; + + usbi_dbg("poll() %d fds with timeout in %dms", nfds, timeout_ms); + r = usbi_poll(fds, nfds, timeout_ms); + usbi_dbg("poll() returned %d", r); + if (r == 0) { + free(fds); + return handle_timeouts(ctx); + } else if (r == -1 && errno == EINTR) { + free(fds); + return LIBUSB_ERROR_INTERRUPTED; + } else if (r < 0) { + free(fds); + usbi_err(ctx, "poll failed %d err=%d\n", r, errno); + return LIBUSB_ERROR_IO; + } + + /* fd[0] is always the ctrl pipe */ + if (fds[0].revents) { + /* another thread wanted to interrupt event handling, and it succeeded! + * handle any other events that cropped up at the same time, and + * simply return */ + usbi_dbg("caught a fish on the control pipe"); + + if (r == 1) { + r = 0; + goto handled; + } else { + /* prevent OS backend from trying to handle events on ctrl pipe */ + fds[0].revents = 0; + r--; + } + } + +#ifdef USBI_TIMERFD_AVAILABLE + /* on timerfd configurations, fds[1] is the timerfd */ + if (usbi_using_timerfd(ctx) && fds[1].revents) { + /* timerfd indicates that a timeout has expired */ + int ret; + usbi_dbg("timerfd triggered"); + + ret = handle_timerfd_trigger(ctx); + if (ret < 0) { + /* return error code */ + r = ret; + goto handled; + } else if (r == 1) { + /* no more active file descriptors, nothing more to do */ + r = 0; + goto handled; + } else { + /* more events pending... + * prevent OS backend from trying to handle events on timerfd */ + fds[1].revents = 0; + r--; + } + } +#endif + + r = usbi_backend->handle_events(ctx, fds, nfds, r); + if (r) + usbi_err(ctx, "backend handle_events failed with error %d", r); + +handled: + free(fds); + return r; +} + +/* returns the smallest of: + * 1. timeout of next URB + * 2. user-supplied timeout + * returns 1 if there is an already-expired timeout, otherwise returns 0 + * and populates out + */ +static int get_next_timeout(libusb_context *ctx, struct timeval *tv, + struct timeval *out) +{ + struct timeval timeout; + int r = libusb_get_next_timeout(ctx, &timeout); + if (r) { + /* timeout already expired? */ + if (!timerisset(&timeout)) + return 1; + + /* choose the smallest of next URB timeout or user specified timeout */ + if (timercmp(&timeout, tv, <)) + *out = timeout; + else + *out = *tv; + } else { + *out = *tv; + } + return 0; +} + +/** \ingroup poll + * Handle any pending events. + * + * libusb determines "pending events" by checking if any timeouts have expired + * and by checking the set of file descriptors for activity. + * + * If a zero timeval is passed, this function will handle any already-pending + * events and then immediately return in non-blocking style. + * + * If a non-zero timeval is passed and no events are currently pending, this + * function will block waiting for events to handle up until the specified + * timeout. If an event arrives or a signal is raised, this function will + * return early. + * + * If the parameter completed is not NULL then after obtaining the event + * handling lock this function will return immediately if the integer + * pointed to is not 0. This allows for race free waiting for the completion + * of a specific transfer. + * + * \param ctx the context to operate on, or NULL for the default context + * \param tv the maximum time to block waiting for events, or an all zero + * timeval struct for non-blocking mode + * \param completed pointer to completion integer to check, or NULL + * \returns 0 on success, or a LIBUSB_ERROR code on failure + * \see \ref mtasync + */ +int API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx, + struct timeval *tv, int *completed) +{ + int r; + struct timeval poll_timeout; + + USBI_GET_CONTEXT(ctx); + r = get_next_timeout(ctx, tv, &poll_timeout); + if (r) { + /* timeout already expired */ + return handle_timeouts(ctx); + } + +retry: + if (libusb_try_lock_events(ctx) == 0) { + if (completed == NULL || !*completed) { + /* we obtained the event lock: do our own event handling */ + usbi_dbg("doing our own event handling"); + r = handle_events(ctx, &poll_timeout); + } + libusb_unlock_events(ctx); + return r; + } + + /* another thread is doing event handling. wait for thread events that + * notify event completion. */ + libusb_lock_event_waiters(ctx); + + if (completed && *completed) + goto already_done; + + if (!libusb_event_handler_active(ctx)) { + /* we hit a race: whoever was event handling earlier finished in the + * time it took us to reach this point. try the cycle again. */ + libusb_unlock_event_waiters(ctx); + usbi_dbg("event handler was active but went away, retrying"); + goto retry; + } + + usbi_dbg("another thread is doing event handling"); + r = libusb_wait_for_event(ctx, &poll_timeout); + +already_done: + libusb_unlock_event_waiters(ctx); + + if (r < 0) + return r; + else if (r == 1) + return handle_timeouts(ctx); + else + return 0; +} + +/** \ingroup poll + * Handle any pending events + * + * Like libusb_handle_events_timeout_completed(), but without the completed + * parameter, calling this function is equivalent to calling + * libusb_handle_events_timeout_completed() with a NULL completed parameter. + * + * This function is kept primarily for backwards compatibility. + * All new code should call libusb_handle_events_completed() or + * libusb_handle_events_timeout_completed() to avoid race conditions. + * + * \param ctx the context to operate on, or NULL for the default context + * \param tv the maximum time to block waiting for events, or an all zero + * timeval struct for non-blocking mode + * \returns 0 on success, or a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_handle_events_timeout(libusb_context *ctx, + struct timeval *tv) +{ + return libusb_handle_events_timeout_completed(ctx, tv, NULL); +} + +/** \ingroup poll + * Handle any pending events in blocking mode. There is currently a timeout + * hardcoded at 60 seconds but we plan to make it unlimited in future. For + * finer control over whether this function is blocking or non-blocking, or + * for control over the timeout, use libusb_handle_events_timeout_completed() + * instead. + * + * This function is kept primarily for backwards compatibility. + * All new code should call libusb_handle_events_completed() or + * libusb_handle_events_timeout_completed() to avoid race conditions. + * + * \param ctx the context to operate on, or NULL for the default context + * \returns 0 on success, or a LIBUSB_ERROR code on failure + */ +int API_EXPORTED libusb_handle_events(libusb_context *ctx) +{ + struct timeval tv; + tv.tv_sec = 60; + tv.tv_usec = 0; + return libusb_handle_events_timeout_completed(ctx, &tv, NULL); +} + +/** \ingroup poll + * Handle any pending events in blocking mode. + * + * Like libusb_handle_events(), with the addition of a completed parameter + * to allow for race free waiting for the completion of a specific transfer. + * + * See libusb_handle_events_timeout_completed() for details on the completed + * parameter. + * + * \param ctx the context to operate on, or NULL for the default context + * \param completed pointer to completion integer to check, or NULL + * \returns 0 on success, or a LIBUSB_ERROR code on failure + * \see \ref mtasync + */ +int API_EXPORTED libusb_handle_events_completed(libusb_context *ctx, + int *completed) +{ + struct timeval tv; + tv.tv_sec = 60; + tv.tv_usec = 0; + return libusb_handle_events_timeout_completed(ctx, &tv, completed); +} + +/** \ingroup poll + * Handle any pending events by polling file descriptors, without checking if + * any other threads are already doing so. Must be called with the event lock + * held, see libusb_lock_events(). + * + * This function is designed to be called under the situation where you have + * taken the event lock and are calling poll()/select() directly on libusb's + * file descriptors (as opposed to using libusb_handle_events() or similar). + * You detect events on libusb's descriptors, so you then call this function + * with a zero timeout value (while still holding the event lock). + * + * \param ctx the context to operate on, or NULL for the default context + * \param tv the maximum time to block waiting for events, or zero for + * non-blocking mode + * \returns 0 on success, or a LIBUSB_ERROR code on failure + * \see \ref mtasync + */ +int API_EXPORTED libusb_handle_events_locked(libusb_context *ctx, + struct timeval *tv) +{ + int r; + struct timeval poll_timeout; + + USBI_GET_CONTEXT(ctx); + r = get_next_timeout(ctx, tv, &poll_timeout); + if (r) { + /* timeout already expired */ + return handle_timeouts(ctx); + } + + return handle_events(ctx, &poll_timeout); +} + +/** \ingroup poll + * Determines whether your application must apply special timing considerations + * when monitoring libusb's file descriptors. + * + * This function is only useful for applications which retrieve and poll + * libusb's file descriptors in their own main loop (\ref pollmain). + * + * Ordinarily, libusb's event handler needs to be called into at specific + * moments in time (in addition to times when there is activity on the file + * descriptor set). The usual approach is to use libusb_get_next_timeout() + * to learn about when the next timeout occurs, and to adjust your + * poll()/select() timeout accordingly so that you can make a call into the + * library at that time. + * + * Some platforms supported by libusb do not come with this baggage - any + * events relevant to timing will be represented by activity on the file + * descriptor set, and libusb_get_next_timeout() will always return 0. + * This function allows you to detect whether you are running on such a + * platform. + * + * Since v1.0.5. + * + * \param ctx the context to operate on, or NULL for the default context + * \returns 0 if you must call into libusb at times determined by + * libusb_get_next_timeout(), or 1 if all timeout events are handled internally + * or through regular activity on the file descriptors. + * \see \ref pollmain "Polling libusb file descriptors for event handling" + */ +int API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) +{ +#if defined(USBI_TIMERFD_AVAILABLE) + USBI_GET_CONTEXT(ctx); + return usbi_using_timerfd(ctx); +#else + (void)ctx; + return 0; +#endif +} + +/** \ingroup poll + * Determine the next internal timeout that libusb needs to handle. You only + * need to use this function if you are calling poll() or select() or similar + * on libusb's file descriptors yourself - you do not need to use it if you + * are calling libusb_handle_events() or a variant directly. + * + * You should call this function in your main loop in order to determine how + * long to wait for select() or poll() to return results. libusb needs to be + * called into at this timeout, so you should use it as an upper bound on + * your select() or poll() call. + * + * When the timeout has expired, call into libusb_handle_events_timeout() + * (perhaps in non-blocking mode) so that libusb can handle the timeout. + * + * This function may return 1 (success) and an all-zero timeval. If this is + * the case, it indicates that libusb has a timeout that has already expired + * so you should call libusb_handle_events_timeout() or similar immediately. + * A return code of 0 indicates that there are no pending timeouts. + * + * On some platforms, this function will always returns 0 (no pending + * timeouts). See \ref polltime. + * + * \param ctx the context to operate on, or NULL for the default context + * \param tv output location for a relative time against the current + * clock in which libusb must be called into in order to process timeout events + * \returns 0 if there are no pending timeouts, 1 if a timeout was returned, + * or LIBUSB_ERROR_OTHER on failure + */ +int API_EXPORTED libusb_get_next_timeout(libusb_context *ctx, + struct timeval *tv) +{ + struct usbi_transfer *transfer; + struct timespec cur_ts; + struct timeval cur_tv; + struct timeval *next_timeout; + int r; + int found = 0; + + USBI_GET_CONTEXT(ctx); + if (usbi_using_timerfd(ctx)) + return 0; + + usbi_mutex_lock(&ctx->flying_transfers_lock); + if (list_empty(&ctx->flying_transfers)) { + usbi_mutex_unlock(&ctx->flying_transfers_lock); + usbi_dbg("no URBs, no timeout!"); + return 0; + } + + /* find next transfer which hasn't already been processed as timed out */ + list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { + if (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT)) + continue; + + /* no timeout for this transfer? */ + if (!timerisset(&transfer->timeout)) + continue; + + found = 1; + break; + } + usbi_mutex_unlock(&ctx->flying_transfers_lock); + + if (!found) { + usbi_dbg("no URB with timeout or all handled by OS; no timeout!"); + return 0; + } + + next_timeout = &transfer->timeout; + + r = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts); + if (r < 0) { + usbi_err(ctx, "failed to read monotonic clock, errno=%d", errno); + return LIBUSB_ERROR_OTHER; + } + TIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts); + + if (!timercmp(&cur_tv, next_timeout, <)) { + usbi_dbg("first timeout already expired"); + timerclear(tv); + } else { + timersub(next_timeout, &cur_tv, tv); + usbi_dbg("next timeout in %d.%06ds", tv->tv_sec, tv->tv_usec); + } + + return 1; +} + +/** \ingroup poll + * Register notification functions for file descriptor additions/removals. + * These functions will be invoked for every new or removed file descriptor + * that libusb uses as an event source. + * + * To remove notifiers, pass NULL values for the function pointers. + * + * Note that file descriptors may have been added even before you register + * these notifiers (e.g. at libusb_init() time). + * + * Additionally, note that the removal notifier may be called during + * libusb_exit() (e.g. when it is closing file descriptors that were opened + * and added to the poll set at libusb_init() time). If you don't want this, + * remove the notifiers immediately before calling libusb_exit(). + * + * \param ctx the context to operate on, or NULL for the default context + * \param added_cb pointer to function for addition notifications + * \param removed_cb pointer to function for removal notifications + * \param user_data User data to be passed back to callbacks (useful for + * passing context information) + */ +void API_EXPORTED libusb_set_pollfd_notifiers(libusb_context *ctx, + libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, + void *user_data) +{ + USBI_GET_CONTEXT(ctx); + ctx->fd_added_cb = added_cb; + ctx->fd_removed_cb = removed_cb; + ctx->fd_cb_user_data = user_data; +} + +/* Add a file descriptor to the list of file descriptors to be monitored. + * events should be specified as a bitmask of events passed to poll(), e.g. + * POLLIN and/or POLLOUT. */ +int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events) +{ + struct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd)); + if (!ipollfd) + return LIBUSB_ERROR_NO_MEM; + + usbi_dbg("add fd %d events %d", fd, events); + ipollfd->pollfd.fd = fd; + ipollfd->pollfd.events = events; + usbi_mutex_lock(&ctx->pollfds_lock); + list_add_tail(&ipollfd->list, &ctx->pollfds); + usbi_mutex_unlock(&ctx->pollfds_lock); + + if (ctx->fd_added_cb) + ctx->fd_added_cb(fd, events, ctx->fd_cb_user_data); + return 0; +} + +/* Remove a file descriptor from the list of file descriptors to be polled. */ +void usbi_remove_pollfd(struct libusb_context *ctx, int fd) +{ + struct usbi_pollfd *ipollfd; + int found = 0; + + usbi_dbg("remove fd %d", fd); + usbi_mutex_lock(&ctx->pollfds_lock); + list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) + if (ipollfd->pollfd.fd == fd) { + found = 1; + break; + } + + if (!found) { + usbi_dbg("couldn't find fd %d to remove", fd); + usbi_mutex_unlock(&ctx->pollfds_lock); + return; + } + + list_del(&ipollfd->list); + usbi_mutex_unlock(&ctx->pollfds_lock); + free(ipollfd); + if (ctx->fd_removed_cb) + ctx->fd_removed_cb(fd, ctx->fd_cb_user_data); +} + +/** \ingroup poll + * Retrieve a list of file descriptors that should be polled by your main loop + * as libusb event sources. + * + * The returned list is NULL-terminated and should be freed with free() when + * done. The actual list contents must not be touched. + * + * As file descriptors are a Unix-specific concept, this function is not + * available on Windows and will always return NULL. + * + * \param ctx the context to operate on, or NULL for the default context + * \returns a NULL-terminated list of libusb_pollfd structures + * \returns NULL on error + * \returns NULL on platforms where the functionality is not available + */ +DEFAULT_VISIBILITY +const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( + libusb_context *ctx) +{ +#ifndef OS_WINDOWS + struct libusb_pollfd **ret = NULL; + struct usbi_pollfd *ipollfd; + size_t i = 0; + size_t cnt = 0; + USBI_GET_CONTEXT(ctx); + + usbi_mutex_lock(&ctx->pollfds_lock); + list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) + cnt++; + + ret = calloc(cnt + 1, sizeof(struct libusb_pollfd *)); + if (!ret) + goto out; + + list_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) + ret[i++] = (struct libusb_pollfd *) ipollfd; + ret[cnt] = NULL; + +out: + usbi_mutex_unlock(&ctx->pollfds_lock); + return (const struct libusb_pollfd **) ret; +#else + usbi_err(ctx, "external polling of libusb's internal descriptors "\ + "is not yet supported on Windows platforms"); + return NULL; +#endif +} + +/* Backends call this from handle_events to report disconnection of a device. + * The transfers get cancelled appropriately. + */ +void usbi_handle_disconnect(struct libusb_device_handle *handle) +{ + struct usbi_transfer *cur; + struct usbi_transfer *to_cancel; + + usbi_dbg("device %d.%d", + handle->dev->bus_number, handle->dev->device_address); + + /* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE + * status code. + * + * this is a bit tricky because: + * 1. we can't do transfer completion while holding flying_transfers_lock + * 2. the transfers list can change underneath us - if we were to build a + * list of transfers to complete (while holding look), the situation + * might be different by the time we come to free them + * + * so we resort to a loop-based approach as below + * FIXME: is this still potentially racy? + */ + + while (1) { + usbi_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock); + to_cancel = NULL; + list_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list, struct usbi_transfer) + if (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) { + to_cancel = cur; + break; + } + usbi_mutex_unlock(&HANDLE_CTX(handle)->flying_transfers_lock); + + if (!to_cancel) + break; + + usbi_backend->clear_transfer_priv(to_cancel); + usbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE); + } + +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.def b/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.def new file mode 100644 index 0000000..1d6a5d2 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.def @@ -0,0 +1,120 @@ +LIBRARY +EXPORTS + libusb_alloc_transfer + libusb_alloc_transfer@4 = libusb_alloc_transfer + libusb_attach_kernel_driver + libusb_attach_kernel_driver@8 = libusb_attach_kernel_driver + libusb_bulk_transfer + libusb_bulk_transfer@24 = libusb_bulk_transfer + libusb_cancel_transfer + libusb_cancel_transfer@4 = libusb_cancel_transfer + libusb_claim_interface + libusb_claim_interface@8 = libusb_claim_interface + libusb_clear_halt + libusb_clear_halt@8 = libusb_clear_halt + libusb_close + libusb_close@4 = libusb_close + libusb_control_transfer + libusb_control_transfer@32 = libusb_control_transfer + libusb_detach_kernel_driver + libusb_detach_kernel_driver@8 = libusb_detach_kernel_driver + libusb_error_name + libusb_error_name@4 = libusb_error_name + libusb_event_handler_active + libusb_event_handler_active@4 = libusb_event_handler_active + libusb_event_handling_ok + libusb_event_handling_ok@4 = libusb_event_handling_ok + libusb_exit + libusb_exit@4 = libusb_exit + libusb_free_config_descriptor + libusb_free_config_descriptor@4 = libusb_free_config_descriptor + libusb_free_device_list + libusb_free_device_list@8 = libusb_free_device_list + libusb_free_transfer + libusb_free_transfer@4 = libusb_free_transfer + libusb_get_active_config_descriptor + libusb_get_active_config_descriptor@8 = libusb_get_active_config_descriptor + libusb_get_bus_number + libusb_get_bus_number@4 = libusb_get_bus_number + libusb_get_config_descriptor + libusb_get_config_descriptor@12 = libusb_get_config_descriptor + libusb_get_config_descriptor_by_value + libusb_get_config_descriptor_by_value@12 = libusb_get_config_descriptor_by_value + libusb_get_configuration + libusb_get_configuration@8 = libusb_get_configuration + libusb_get_device + libusb_get_device@4 = libusb_get_device + libusb_get_device_address + libusb_get_device_address@4 = libusb_get_device_address + libusb_get_device_descriptor + libusb_get_device_descriptor@8 = libusb_get_device_descriptor + libusb_get_device_list + libusb_get_device_list@8 = libusb_get_device_list + libusb_get_device_speed + libusb_get_device_speed@4 = libusb_get_device_speed + libusb_get_max_iso_packet_size + libusb_get_max_iso_packet_size@8 = libusb_get_max_iso_packet_size + libusb_get_max_packet_size + libusb_get_max_packet_size@8 = libusb_get_max_packet_size + libusb_get_next_timeout + libusb_get_next_timeout@8 = libusb_get_next_timeout + libusb_get_pollfds + libusb_get_pollfds@4 = libusb_get_pollfds + libusb_get_string_descriptor_ascii + libusb_get_string_descriptor_ascii@16 = libusb_get_string_descriptor_ascii + libusb_get_version + libusb_get_version@0 = libusb_get_version + libusb_handle_events + libusb_handle_events@4 = libusb_handle_events + libusb_handle_events_completed + libusb_handle_events_completed@8 = libusb_handle_events_completed + libusb_handle_events_locked + libusb_handle_events_locked@8 = libusb_handle_events_locked + libusb_handle_events_timeout + libusb_handle_events_timeout@8 = libusb_handle_events_timeout + libusb_handle_events_timeout_completed + libusb_handle_events_timeout_completed@12 = libusb_handle_events_timeout_completed + libusb_has_capability + libusb_has_capability@4 = libusb_has_capability + libusb_init + libusb_init@4 = libusb_init + libusb_interrupt_transfer + libusb_interrupt_transfer@24 = libusb_interrupt_transfer + libusb_kernel_driver_active + libusb_kernel_driver_active@8 = libusb_kernel_driver_active + libusb_lock_event_waiters + libusb_lock_event_waiters@4 = libusb_lock_event_waiters + libusb_lock_events + libusb_lock_events@4 = libusb_lock_events + libusb_open + libusb_open@8 = libusb_open + libusb_open_device_with_vid_pid + libusb_open_device_with_vid_pid@12 = libusb_open_device_with_vid_pid + libusb_pollfds_handle_timeouts + libusb_pollfds_handle_timeouts@4 = libusb_pollfds_handle_timeouts + libusb_ref_device + libusb_ref_device@4 = libusb_ref_device + libusb_release_interface + libusb_release_interface@8 = libusb_release_interface + libusb_reset_device + libusb_reset_device@4 = libusb_reset_device + libusb_set_configuration + libusb_set_configuration@8 = libusb_set_configuration + libusb_set_debug + libusb_set_debug@8 = libusb_set_debug + libusb_set_interface_alt_setting + libusb_set_interface_alt_setting@12 = libusb_set_interface_alt_setting + libusb_set_pollfd_notifiers + libusb_set_pollfd_notifiers@16 = libusb_set_pollfd_notifiers + libusb_submit_transfer + libusb_submit_transfer@4 = libusb_submit_transfer + libusb_try_lock_events + libusb_try_lock_events@4 = libusb_try_lock_events + libusb_unlock_event_waiters + libusb_unlock_event_waiters@4 = libusb_unlock_event_waiters + libusb_unlock_events + libusb_unlock_events@4 = libusb_unlock_events + libusb_unref_device + libusb_unref_device@4 = libusb_unref_device + libusb_wait_for_event + libusb_wait_for_event@8 = libusb_wait_for_event diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.rc b/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.rc new file mode 100644 index 0000000..a59a430 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/libusb-1.0.rc @@ -0,0 +1,56 @@ +/* + * For Windows: input this file to the Resoure Compiler to produce a binary + * .res file. This is then embedded in the resultant library (like any other + * compilation object). + * The information can then be queried using standard APIs and can also be + * viewed with utilities such as Windows Explorer. + */ +#include "winresrc.h" + +#include "version.h" +#ifndef LIBUSB_VERSIONSTRING +#define LU_STR(s) #s +#define LU_XSTR(s) LU_STR(s) +#if LIBUSB_NANO > 0 +#define LIBUSB_VERSIONSTRING LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." LU_XSTR(LIBUSB_MICRO) "." LU_XSTR(LIBUSB_NANO) LIBUSB_RC "\0" +#else +#define LIBUSB_VERSIONSTRING LU_XSTR(LIBUSB_MAJOR) "." LU_XSTR(LIBUSB_MINOR) "." LU_XSTR(LIBUSB_MICRO) LIBUSB_RC "\0" +#endif +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO + PRODUCTVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "libusb.org\0" + VALUE "FileDescription", "C library for writing portable USB drivers in userspace\0" + VALUE "FileVersion", LIBUSB_VERSIONSTRING + VALUE "InternalName", "libusb\0" + VALUE "LegalCopyright", "See individual source files, GNU LGPL v2.1 or later.\0" + VALUE "LegalTrademarks", "http://www.gnu.org/licenses/lgpl-2.1.html\0" + VALUE "OriginalFilename", "libusb-1.0.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "libusb-1.0\0" + VALUE "ProductVersion", LIBUSB_VERSIONSTRING + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/libusb.h b/thirdparty/libusb/libusb-1.0.9/libusb/libusb.h new file mode 100644 index 0000000..58b406f --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/libusb.h @@ -0,0 +1,1443 @@ +/* + * Public libusb header file + * Copyright (C) 2007-2008 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSB_H +#define LIBUSB_H + +#ifdef _MSC_VER +/* on MS environments, the inline keyword is available in C++ only */ +#define inline __inline +/* ssize_t is also not available (copy/paste from MinGW) */ +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 + typedef __int64 ssize_t; +#else + typedef int ssize_t; +#endif /* _WIN64 */ +#endif /* _SSIZE_T_DEFINED */ +#endif /* _MSC_VER */ + +/* stdint.h is also not usually available on MS */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +#else +#include +#endif + +#include +#include +#include + +#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) +#include +#endif + +/* 'interface' might be defined as a macro on Windows, so we need to + * undefine it so as not to break the current libusb API, because + * libusb_config_descriptor has an 'interface' member + * As this can be problematic if you include windows.h after libusb.h + * in your sources, we force windows.h to be included first. */ +#if defined(_WIN32) || defined(__CYGWIN__) +#include +#if defined(interface) +#undef interface +#endif +#endif + +/** \def LIBUSB_CALL + * \ingroup misc + * libusb's Windows calling convention. + * + * Under Windows, the selection of available compilers and configurations + * means that, unlike other platforms, there is not one true calling + * convention (calling convention: the manner in which parameters are + * passed to funcions in the generated assembly code). + * + * Matching the Windows API itself, libusb uses the WINAPI convention (which + * translates to the stdcall convention) and guarantees that the + * library is compiled in this way. The public header file also includes + * appropriate annotations so that your own software will use the right + * convention, even if another convention is being used by default within + * your codebase. + * + * The one consideration that you must apply in your software is to mark + * all functions which you use as libusb callbacks with this LIBUSB_CALL + * annotation, so that they too get compiled for the correct calling + * convention. + * + * On non-Windows operating systems, this macro is defined as nothing. This + * means that you can apply it to your code without worrying about + * cross-platform compatibility. + */ +/* LIBUSB_CALL must be defined on both definition and declaration of libusb + * functions. You'd think that declaration would be enough, but cygwin will + * complain about conflicting types unless both are marked this way. + * The placement of this macro is important too; it must appear after the + * return type, before the function name. See internal documentation for + * API_EXPORTED. + */ +#if defined(_WIN32) || defined(__CYGWIN__) +#define LIBUSB_CALL WINAPI +#else +#define LIBUSB_CALL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** \def libusb_cpu_to_le16 + * \ingroup misc + * Convert a 16-bit value from host-endian to little-endian format. On + * little endian systems, this function does nothing. On big endian systems, + * the bytes are swapped. + * \param x the host-endian value to convert + * \returns the value in little-endian byte order + */ +static inline uint16_t libusb_cpu_to_le16(const uint16_t x) +{ + union { + uint8_t b8[2]; + uint16_t b16; + } _tmp; + _tmp.b8[1] = x >> 8; + _tmp.b8[0] = x & 0xff; + return _tmp.b16; +} + +/** \def libusb_le16_to_cpu + * \ingroup misc + * Convert a 16-bit value from little-endian to host-endian format. On + * little endian systems, this function does nothing. On big endian systems, + * the bytes are swapped. + * \param x the little-endian value to convert + * \returns the value in host-endian byte order + */ +#define libusb_le16_to_cpu libusb_cpu_to_le16 + +/* standard USB stuff */ + +/** \ingroup desc + * Device and/or Interface Class codes */ +enum libusb_class_code { + /** In the context of a \ref libusb_device_descriptor "device descriptor", + * this bDeviceClass value indicates that each interface specifies its + * own class information and all interfaces operate independently. + */ + LIBUSB_CLASS_PER_INTERFACE = 0, + + /** Audio class */ + LIBUSB_CLASS_AUDIO = 1, + + /** Communications class */ + LIBUSB_CLASS_COMM = 2, + + /** Human Interface Device class */ + LIBUSB_CLASS_HID = 3, + + /** Physical */ + LIBUSB_CLASS_PHYSICAL = 5, + + /** Printer class */ + LIBUSB_CLASS_PRINTER = 7, + + /** Image class */ + LIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */ + LIBUSB_CLASS_IMAGE = 6, + + /** Mass storage class */ + LIBUSB_CLASS_MASS_STORAGE = 8, + + /** Hub class */ + LIBUSB_CLASS_HUB = 9, + + /** Data class */ + LIBUSB_CLASS_DATA = 10, + + /** Smart Card */ + LIBUSB_CLASS_SMART_CARD = 0x0b, + + /** Content Security */ + LIBUSB_CLASS_CONTENT_SECURITY = 0x0d, + + /** Video */ + LIBUSB_CLASS_VIDEO = 0x0e, + + /** Personal Healthcare */ + LIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f, + + /** Diagnostic Device */ + LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc, + + /** Wireless class */ + LIBUSB_CLASS_WIRELESS = 0xe0, + + /** Application class */ + LIBUSB_CLASS_APPLICATION = 0xfe, + + /** Class is vendor-specific */ + LIBUSB_CLASS_VENDOR_SPEC = 0xff +}; + +/** \ingroup desc + * Descriptor types as defined by the USB specification. */ +enum libusb_descriptor_type { + /** Device descriptor. See libusb_device_descriptor. */ + LIBUSB_DT_DEVICE = 0x01, + + /** Configuration descriptor. See libusb_config_descriptor. */ + LIBUSB_DT_CONFIG = 0x02, + + /** String descriptor */ + LIBUSB_DT_STRING = 0x03, + + /** Interface descriptor. See libusb_interface_descriptor. */ + LIBUSB_DT_INTERFACE = 0x04, + + /** Endpoint descriptor. See libusb_endpoint_descriptor. */ + LIBUSB_DT_ENDPOINT = 0x05, + + /** HID descriptor */ + LIBUSB_DT_HID = 0x21, + + /** HID report descriptor */ + LIBUSB_DT_REPORT = 0x22, + + /** Physical descriptor */ + LIBUSB_DT_PHYSICAL = 0x23, + + /** Hub descriptor */ + LIBUSB_DT_HUB = 0x29, +}; + +/* Descriptor sizes per descriptor type */ +#define LIBUSB_DT_DEVICE_SIZE 18 +#define LIBUSB_DT_CONFIG_SIZE 9 +#define LIBUSB_DT_INTERFACE_SIZE 9 +#define LIBUSB_DT_ENDPOINT_SIZE 7 +#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define LIBUSB_DT_HUB_NONVAR_SIZE 7 + +#define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define LIBUSB_ENDPOINT_DIR_MASK 0x80 + +/** \ingroup desc + * Endpoint direction. Values for bit 7 of the + * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme. + */ +enum libusb_endpoint_direction { + /** In: device-to-host */ + LIBUSB_ENDPOINT_IN = 0x80, + + /** Out: host-to-device */ + LIBUSB_ENDPOINT_OUT = 0x00 +}; + +#define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */ + +/** \ingroup desc + * Endpoint transfer type. Values for bits 0:1 of the + * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field. + */ +enum libusb_transfer_type { + /** Control endpoint */ + LIBUSB_TRANSFER_TYPE_CONTROL = 0, + + /** Isochronous endpoint */ + LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1, + + /** Bulk endpoint */ + LIBUSB_TRANSFER_TYPE_BULK = 2, + + /** Interrupt endpoint */ + LIBUSB_TRANSFER_TYPE_INTERRUPT = 3 +}; + +/** \ingroup misc + * Standard requests, as defined in table 9-3 of the USB2 specifications */ +enum libusb_standard_request { + /** Request status of the specific recipient */ + LIBUSB_REQUEST_GET_STATUS = 0x00, + + /** Clear or disable a specific feature */ + LIBUSB_REQUEST_CLEAR_FEATURE = 0x01, + + /* 0x02 is reserved */ + + /** Set or enable a specific feature */ + LIBUSB_REQUEST_SET_FEATURE = 0x03, + + /* 0x04 is reserved */ + + /** Set device address for all future accesses */ + LIBUSB_REQUEST_SET_ADDRESS = 0x05, + + /** Get the specified descriptor */ + LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06, + + /** Used to update existing descriptors or add new descriptors */ + LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07, + + /** Get the current device configuration value */ + LIBUSB_REQUEST_GET_CONFIGURATION = 0x08, + + /** Set device configuration */ + LIBUSB_REQUEST_SET_CONFIGURATION = 0x09, + + /** Return the selected alternate setting for the specified interface */ + LIBUSB_REQUEST_GET_INTERFACE = 0x0A, + + /** Select an alternate interface for the specified interface */ + LIBUSB_REQUEST_SET_INTERFACE = 0x0B, + + /** Set then report an endpoint's synchronization frame */ + LIBUSB_REQUEST_SYNCH_FRAME = 0x0C, +}; + +/** \ingroup misc + * Request type bits of the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control + * transfers. */ +enum libusb_request_type { + /** Standard */ + LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5), + + /** Class */ + LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5), + + /** Vendor */ + LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5), + + /** Reserved */ + LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5) +}; + +/** \ingroup misc + * Recipient bits of the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control + * transfers. Values 4 through 31 are reserved. */ +enum libusb_request_recipient { + /** Device */ + LIBUSB_RECIPIENT_DEVICE = 0x00, + + /** Interface */ + LIBUSB_RECIPIENT_INTERFACE = 0x01, + + /** Endpoint */ + LIBUSB_RECIPIENT_ENDPOINT = 0x02, + + /** Other */ + LIBUSB_RECIPIENT_OTHER = 0x03, +}; + +#define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C + +/** \ingroup desc + * Synchronization type for isochronous endpoints. Values for bits 2:3 of the + * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in + * libusb_endpoint_descriptor. + */ +enum libusb_iso_sync_type { + /** No synchronization */ + LIBUSB_ISO_SYNC_TYPE_NONE = 0, + + /** Asynchronous */ + LIBUSB_ISO_SYNC_TYPE_ASYNC = 1, + + /** Adaptive */ + LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2, + + /** Synchronous */ + LIBUSB_ISO_SYNC_TYPE_SYNC = 3 +}; + +#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30 + +/** \ingroup desc + * Usage type for isochronous endpoints. Values for bits 4:5 of the + * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in + * libusb_endpoint_descriptor. + */ +enum libusb_iso_usage_type { + /** Data endpoint */ + LIBUSB_ISO_USAGE_TYPE_DATA = 0, + + /** Feedback endpoint */ + LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1, + + /** Implicit feedback Data endpoint */ + LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2, +}; + +/** \ingroup desc + * A structure representing the standard USB device descriptor. This + * descriptor is documented in section 9.6.1 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_device_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this + * context. */ + uint8_t bDescriptorType; + + /** USB specification release number in binary-coded decimal. A value of + * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */ + uint16_t bcdUSB; + + /** USB-IF class code for the device. See \ref libusb_class_code. */ + uint8_t bDeviceClass; + + /** USB-IF subclass code for the device, qualified by the bDeviceClass + * value */ + uint8_t bDeviceSubClass; + + /** USB-IF protocol code for the device, qualified by the bDeviceClass and + * bDeviceSubClass values */ + uint8_t bDeviceProtocol; + + /** Maximum packet size for endpoint 0 */ + uint8_t bMaxPacketSize0; + + /** USB-IF vendor ID */ + uint16_t idVendor; + + /** USB-IF product ID */ + uint16_t idProduct; + + /** Device release number in binary-coded decimal */ + uint16_t bcdDevice; + + /** Index of string descriptor describing manufacturer */ + uint8_t iManufacturer; + + /** Index of string descriptor describing product */ + uint8_t iProduct; + + /** Index of string descriptor containing device serial number */ + uint8_t iSerialNumber; + + /** Number of possible configurations */ + uint8_t bNumConfigurations; +}; + +/** \ingroup desc + * A structure representing the standard USB endpoint descriptor. This + * descriptor is documented in section 9.6.3 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_endpoint_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in + * this context. */ + uint8_t bDescriptorType; + + /** The address of the endpoint described by this descriptor. Bits 0:3 are + * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction, + * see \ref libusb_endpoint_direction. + */ + uint8_t bEndpointAddress; + + /** Attributes which apply to the endpoint when it is configured using + * the bConfigurationValue. Bits 0:1 determine the transfer type and + * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for + * isochronous endpoints and correspond to \ref libusb_iso_sync_type. + * Bits 4:5 are also only used for isochronous endpoints and correspond to + * \ref libusb_iso_usage_type. Bits 6:7 are reserved. + */ + uint8_t bmAttributes; + + /** Maximum packet size this endpoint is capable of sending/receiving. */ + uint16_t wMaxPacketSize; + + /** Interval for polling endpoint for data transfers. */ + uint8_t bInterval; + + /** For audio devices only: the rate at which synchronization feedback + * is provided. */ + uint8_t bRefresh; + + /** For audio devices only: the address if the synch endpoint */ + uint8_t bSynchAddress; + + /** Extra descriptors. If libusb encounters unknown endpoint descriptors, + * it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup desc + * A structure representing the standard USB interface descriptor. This + * descriptor is documented in section 9.6.5 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_interface_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE + * in this context. */ + uint8_t bDescriptorType; + + /** Number of this interface */ + uint8_t bInterfaceNumber; + + /** Value used to select this alternate setting for this interface */ + uint8_t bAlternateSetting; + + /** Number of endpoints used by this interface (excluding the control + * endpoint). */ + uint8_t bNumEndpoints; + + /** USB-IF class code for this interface. See \ref libusb_class_code. */ + uint8_t bInterfaceClass; + + /** USB-IF subclass code for this interface, qualified by the + * bInterfaceClass value */ + uint8_t bInterfaceSubClass; + + /** USB-IF protocol code for this interface, qualified by the + * bInterfaceClass and bInterfaceSubClass values */ + uint8_t bInterfaceProtocol; + + /** Index of string descriptor describing this interface */ + uint8_t iInterface; + + /** Array of endpoint descriptors. This length of this array is determined + * by the bNumEndpoints field. */ + const struct libusb_endpoint_descriptor *endpoint; + + /** Extra descriptors. If libusb encounters unknown interface descriptors, + * it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup desc + * A collection of alternate settings for a particular USB interface. + */ +struct libusb_interface { + /** Array of interface descriptors. The length of this array is determined + * by the num_altsetting field. */ + const struct libusb_interface_descriptor *altsetting; + + /** The number of alternate settings that belong to this interface */ + int num_altsetting; +}; + +/** \ingroup desc + * A structure representing the standard USB configuration descriptor. This + * descriptor is documented in section 9.6.3 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_config_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG + * in this context. */ + uint8_t bDescriptorType; + + /** Total length of data returned for this configuration */ + uint16_t wTotalLength; + + /** Number of interfaces supported by this configuration */ + uint8_t bNumInterfaces; + + /** Identifier value for this configuration */ + uint8_t bConfigurationValue; + + /** Index of string descriptor describing this configuration */ + uint8_t iConfiguration; + + /** Configuration characteristics */ + uint8_t bmAttributes; + + /** Maximum power consumption of the USB device from this bus in this + * configuration when the device is fully opreation. Expressed in units + * of 2 mA. */ + uint8_t MaxPower; + + /** Array of interfaces supported by this configuration. The length of + * this array is determined by the bNumInterfaces field. */ + const struct libusb_interface *interface; + + /** Extra descriptors. If libusb encounters unknown configuration + * descriptors, it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup asyncio + * Setup packet for control transfers. */ +struct libusb_control_setup { + /** Request type. Bits 0:4 determine recipient, see + * \ref libusb_request_recipient. Bits 5:6 determine type, see + * \ref libusb_request_type. Bit 7 determines data transfer direction, see + * \ref libusb_endpoint_direction. + */ + uint8_t bmRequestType; + + /** Request. If the type bits of bmRequestType are equal to + * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD + * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to + * \ref libusb_standard_request. For other cases, use of this field is + * application-specific. */ + uint8_t bRequest; + + /** Value. Varies according to request */ + uint16_t wValue; + + /** Index. Varies according to request, typically used to pass an index + * or offset */ + uint16_t wIndex; + + /** Number of bytes to transfer */ + uint16_t wLength; +}; + +#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup)) + +/* libusb */ + +struct libusb_context; +struct libusb_device; +struct libusb_device_handle; + +/** \ingroup lib + * Structure representing the libusb version. + */ +struct libusb_version { + /** Library major version. */ + const uint16_t major; + + /** Library minor version. */ + const uint16_t minor; + + /** Library micro version. */ + const uint16_t micro; + + /** Library nano version. This field is only nonzero on Windows. */ + const uint16_t nano; + + /** Library release candidate suffix string, e.g. "-rc4". */ + const char *rc; + + /** Output of `git describe --tags` at library build time. */ + const char *describe; +}; + +/** \ingroup lib + * Structure representing a libusb session. The concept of individual libusb + * sessions allows for your program to use two libraries (or dynamically + * load two modules) which both independently use libusb. This will prevent + * interference between the individual libusb users - for example + * libusb_set_debug() will not affect the other user of the library, and + * libusb_exit() will not destroy resources that the other user is still + * using. + * + * Sessions are created by libusb_init() and destroyed through libusb_exit(). + * If your application is guaranteed to only ever include a single libusb + * user (i.e. you), you do not have to worry about contexts: pass NULL in + * every function call where a context is required. The default context + * will be used. + * + * For more information, see \ref contexts. + */ +typedef struct libusb_context libusb_context; + +/** \ingroup dev + * Structure representing a USB device detected on the system. This is an + * opaque type for which you are only ever provided with a pointer, usually + * originating from libusb_get_device_list(). + * + * Certain operations can be performed on a device, but in order to do any + * I/O you will have to first obtain a device handle using libusb_open(). + * + * Devices are reference counted with libusb_device_ref() and + * libusb_device_unref(), and are freed when the reference count reaches 0. + * New devices presented by libusb_get_device_list() have a reference count of + * 1, and libusb_free_device_list() can optionally decrease the reference count + * on all devices in the list. libusb_open() adds another reference which is + * later destroyed by libusb_close(). + */ +typedef struct libusb_device libusb_device; + + +/** \ingroup dev + * Structure representing a handle on a USB device. This is an opaque type for + * which you are only ever provided with a pointer, usually originating from + * libusb_open(). + * + * A device handle is used to perform I/O and other operations. When finished + * with a device handle, you should call libusb_close(). + */ +typedef struct libusb_device_handle libusb_device_handle; + +/** \ingroup dev + * Speed codes. Indicates the speed at which the device is operating. + */ +enum libusb_speed { + /** The OS doesn't report or know the device speed. */ + LIBUSB_SPEED_UNKNOWN = 0, + + /** The device is operating at low speed (1.5MBit/s). */ + LIBUSB_SPEED_LOW = 1, + + /** The device is operating at full speed (12MBit/s). */ + LIBUSB_SPEED_FULL = 2, + + /** The device is operating at high speed (480MBit/s). */ + LIBUSB_SPEED_HIGH = 3, + + /** The device is operating at super speed (5000MBit/s). */ + LIBUSB_SPEED_SUPER = 4, +}; + +/** \ingroup misc + * Error codes. Most libusb functions return 0 on success or one of these + * codes on failure. + * You can call \ref libusb_error_name() to retrieve a string representation + * of an error code. + */ +enum libusb_error { + /** Success (no error) */ + LIBUSB_SUCCESS = 0, + + /** Input/output error */ + LIBUSB_ERROR_IO = -1, + + /** Invalid parameter */ + LIBUSB_ERROR_INVALID_PARAM = -2, + + /** Access denied (insufficient permissions) */ + LIBUSB_ERROR_ACCESS = -3, + + /** No such device (it may have been disconnected) */ + LIBUSB_ERROR_NO_DEVICE = -4, + + /** Entity not found */ + LIBUSB_ERROR_NOT_FOUND = -5, + + /** Resource busy */ + LIBUSB_ERROR_BUSY = -6, + + /** Operation timed out */ + LIBUSB_ERROR_TIMEOUT = -7, + + /** Overflow */ + LIBUSB_ERROR_OVERFLOW = -8, + + /** Pipe error */ + LIBUSB_ERROR_PIPE = -9, + + /** System call interrupted (perhaps due to signal) */ + LIBUSB_ERROR_INTERRUPTED = -10, + + /** Insufficient memory */ + LIBUSB_ERROR_NO_MEM = -11, + + /** Operation not supported or unimplemented on this platform */ + LIBUSB_ERROR_NOT_SUPPORTED = -12, + + /* NB! Remember to update libusb_error_name() + when adding new error codes here. */ + + /** Other error */ + LIBUSB_ERROR_OTHER = -99, +}; + +/** \ingroup asyncio + * Transfer status codes */ +enum libusb_transfer_status { + /** Transfer completed without error. Note that this does not indicate + * that the entire amount of requested data was transferred. */ + LIBUSB_TRANSFER_COMPLETED, + + /** Transfer failed */ + LIBUSB_TRANSFER_ERROR, + + /** Transfer timed out */ + LIBUSB_TRANSFER_TIMED_OUT, + + /** Transfer was cancelled */ + LIBUSB_TRANSFER_CANCELLED, + + /** For bulk/interrupt endpoints: halt condition detected (endpoint + * stalled). For control endpoints: control request not supported. */ + LIBUSB_TRANSFER_STALL, + + /** Device was disconnected */ + LIBUSB_TRANSFER_NO_DEVICE, + + /** Device sent more data than requested */ + LIBUSB_TRANSFER_OVERFLOW, +}; + +/** \ingroup asyncio + * libusb_transfer.flags values */ +enum libusb_transfer_flags { + /** Report short frames as errors */ + LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0, + + /** Automatically free() transfer buffer during libusb_free_transfer() */ + LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, + + /** Automatically call libusb_free_transfer() after callback returns. + * If this flag is set, it is illegal to call libusb_free_transfer() + * from your transfer callback, as this will result in a double-free + * when this flag is acted upon. */ + LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2, + + /** Terminate transfers that are a multiple of the endpoint's + * wMaxPacketSize with an extra zero length packet. This is useful + * when a device protocol mandates that each logical request is + * terminated by an incomplete packet (i.e. the logical requests are + * not separated by other means). + * + * This flag only affects host-to-device transfers to bulk and interrupt + * endpoints. In other situations, it is ignored. + * + * This flag only affects transfers with a length that is a multiple of + * the endpoint's wMaxPacketSize. On transfers of other lengths, this + * flag has no effect. Therefore, if you are working with a device that + * needs a ZLP whenever the end of the logical request falls on a packet + * boundary, then it is sensible to set this flag on every + * transfer (you do not have to worry about only setting it on transfers + * that end on the boundary). + * + * This flag is currently only supported on Linux. + * On other systems, libusb_submit_transfer() will return + * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set. + * + * Available since libusb-1.0.9. + */ + LIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3, +}; + +/** \ingroup asyncio + * Isochronous packet descriptor. */ +struct libusb_iso_packet_descriptor { + /** Length of data to request in this packet */ + unsigned int length; + + /** Amount of data that was actually transferred */ + unsigned int actual_length; + + /** Status code for this packet */ + enum libusb_transfer_status status; +}; + +struct libusb_transfer; + +/** \ingroup asyncio + * Asynchronous transfer callback function type. When submitting asynchronous + * transfers, you pass a pointer to a callback function of this type via the + * \ref libusb_transfer::callback "callback" member of the libusb_transfer + * structure. libusb will call this function later, when the transfer has + * completed or failed. See \ref asyncio for more information. + * \param transfer The libusb_transfer struct the callback function is being + * notified about. + */ +typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer); + +/** \ingroup asyncio + * The generic USB transfer structure. The user populates this structure and + * then submits it in order to request a transfer. After the transfer has + * completed, the library populates the transfer with the results and passes + * it back to the user. + */ +struct libusb_transfer { + /** Handle of the device that this transfer will be submitted to */ + libusb_device_handle *dev_handle; + + /** A bitwise OR combination of \ref libusb_transfer_flags. */ + uint8_t flags; + + /** Address of the endpoint where this transfer will be sent. */ + unsigned char endpoint; + + /** Type of the endpoint from \ref libusb_transfer_type */ + unsigned char type; + + /** Timeout for this transfer in millseconds. A value of 0 indicates no + * timeout. */ + unsigned int timeout; + + /** The status of the transfer. Read-only, and only for use within + * transfer callback function. + * + * If this is an isochronous transfer, this field may read COMPLETED even + * if there were errors in the frames. Use the + * \ref libusb_iso_packet_descriptor::status "status" field in each packet + * to determine if errors occurred. */ + enum libusb_transfer_status status; + + /** Length of the data buffer */ + int length; + + /** Actual length of data that was transferred. Read-only, and only for + * use within transfer callback function. Not valid for isochronous + * endpoint transfers. */ + int actual_length; + + /** Callback function. This will be invoked when the transfer completes, + * fails, or is cancelled. */ + libusb_transfer_cb_fn callback; + + /** User context data to pass to the callback function. */ + void *user_data; + + /** Data buffer */ + unsigned char *buffer; + + /** Number of isochronous packets. Only used for I/O with isochronous + * endpoints. */ + int num_iso_packets; + + /** Isochronous packet descriptors, for isochronous transfers only. */ + struct libusb_iso_packet_descriptor iso_packet_desc +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + [] /* valid C99 code */ +#else + [0] /* non-standard, but usually working code */ +#endif + ; +}; + +/** \ingroup misc + * Capabilities supported by this instance of libusb. Test if the loaded + * library supports a given capability by calling + * \ref libusb_has_capability(). + */ +enum libusb_capability { + /** The libusb_has_capability() API is available. */ + LIBUSB_CAP_HAS_CAPABILITY = 0, +}; + +int LIBUSB_CALL libusb_init(libusb_context **ctx); +void LIBUSB_CALL libusb_exit(libusb_context *ctx); +void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); +const struct libusb_version * LIBUSB_CALL libusb_get_version(void); +int LIBUSB_CALL libusb_has_capability(uint32_t capability); +const char * LIBUSB_CALL libusb_error_name(int errcode); + +ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, + libusb_device ***list); +void LIBUSB_CALL libusb_free_device_list(libusb_device **list, + int unref_devices); +libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev); +void LIBUSB_CALL libusb_unref_device(libusb_device *dev); + +int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev, + int *config); +int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev, + struct libusb_device_descriptor *desc); +int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev, + struct libusb_config_descriptor **config); +int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev, + uint8_t config_index, struct libusb_config_descriptor **config); +int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev, + uint8_t bConfigurationValue, struct libusb_config_descriptor **config); +void LIBUSB_CALL libusb_free_config_descriptor( + struct libusb_config_descriptor *config); +uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); +uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); +int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev); +int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, + unsigned char endpoint); +int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev, + unsigned char endpoint); + +int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle); +void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle); +libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle); + +int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev, + int configuration); +int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev, + int interface_number); + +libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( + libusb_context *ctx, uint16_t vendor_id, uint16_t product_id); + +int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev, + int interface_number, int alternate_setting); +int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev, + unsigned char endpoint); +int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); + +int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev, + int interface_number); + +/* async I/O */ + +/** \ingroup asyncio + * Get the data section of a control transfer. This convenience function is here + * to remind you that the data does not start until 8 bytes into the actual + * buffer, as the setup packet comes first. + * + * Calling this function only makes sense from a transfer callback function, + * or situations where you have already allocated a suitably sized buffer at + * transfer->buffer. + * + * \param transfer a transfer + * \returns pointer to the first byte of the data section + */ +static inline unsigned char *libusb_control_transfer_get_data( + struct libusb_transfer *transfer) +{ + return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; +} + +/** \ingroup asyncio + * Get the control setup packet of a control transfer. This convenience + * function is here to remind you that the control setup occupies the first + * 8 bytes of the transfer data buffer. + * + * Calling this function only makes sense from a transfer callback function, + * or situations where you have already allocated a suitably sized buffer at + * transfer->buffer. + * + * \param transfer a transfer + * \returns a casted pointer to the start of the transfer data buffer + */ +static inline struct libusb_control_setup *libusb_control_transfer_get_setup( + struct libusb_transfer *transfer) +{ + return (struct libusb_control_setup *) transfer->buffer; +} + +/** \ingroup asyncio + * Helper function to populate the setup packet (first 8 bytes of the data + * buffer) for a control transfer. The wIndex, wValue and wLength values should + * be given in host-endian byte order. + * + * \param buffer buffer to output the setup packet into + * \param bmRequestType see the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field of + * \ref libusb_control_setup + * \param bRequest see the + * \ref libusb_control_setup::bRequest "bRequest" field of + * \ref libusb_control_setup + * \param wValue see the + * \ref libusb_control_setup::wValue "wValue" field of + * \ref libusb_control_setup + * \param wIndex see the + * \ref libusb_control_setup::wIndex "wIndex" field of + * \ref libusb_control_setup + * \param wLength see the + * \ref libusb_control_setup::wLength "wLength" field of + * \ref libusb_control_setup + */ +static inline void libusb_fill_control_setup(unsigned char *buffer, + uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + uint16_t wLength) +{ + struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + setup->bmRequestType = bmRequestType; + setup->bRequest = bRequest; + setup->wValue = libusb_cpu_to_le16(wValue); + setup->wIndex = libusb_cpu_to_le16(wIndex); + setup->wLength = libusb_cpu_to_le16(wLength); +} + +struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets); +int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer); +int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); +void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for a control transfer. + * + * If you pass a transfer buffer to this function, the first 8 bytes will + * be interpreted as a control setup packet, and the wLength field will be + * used to automatically populate the \ref libusb_transfer::length "length" + * field of the transfer. Therefore the recommended approach is: + * -# Allocate a suitably sized data buffer (including space for control setup) + * -# Call libusb_fill_control_setup() + * -# If this is a host-to-device transfer with a data stage, put the data + * in place after the setup packet + * -# Call this function + * -# Call libusb_submit_transfer() + * + * It is also legal to pass a NULL buffer to this function, in which case this + * function will not attempt to populate the length field. Remember that you + * must then populate the buffer and length fields later. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param buffer data buffer. If provided, this function will interpret the + * first 8 bytes as a setup packet and infer the transfer length from that. + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_control_transfer( + struct libusb_transfer *transfer, libusb_device_handle *dev_handle, + unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, + unsigned int timeout) +{ + struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + transfer->dev_handle = dev_handle; + transfer->endpoint = 0; + transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; + transfer->timeout = timeout; + transfer->buffer = buffer; + if (setup) + transfer->length = LIBUSB_CONTROL_SETUP_SIZE + + libusb_le16_to_cpu(setup->wLength); + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for a bulk transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, + libusb_device_handle *dev_handle, unsigned char endpoint, + unsigned char *buffer, int length, libusb_transfer_cb_fn callback, + void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_BULK; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for an interrupt transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_interrupt_transfer( + struct libusb_transfer *transfer, libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *buffer, int length, + libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for an isochronous transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param num_iso_packets the number of isochronous packets + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer, + libusb_device_handle *dev_handle, unsigned char endpoint, + unsigned char *buffer, int length, int num_iso_packets, + libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->num_iso_packets = num_iso_packets; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Convenience function to set the length of all packets in an isochronous + * transfer, based on the num_iso_packets field in the transfer structure. + * + * \param transfer a transfer + * \param length the length to set in each isochronous packet descriptor + * \see libusb_get_max_packet_size() + */ +static inline void libusb_set_iso_packet_lengths( + struct libusb_transfer *transfer, unsigned int length) +{ + int i; + for (i = 0; i < transfer->num_iso_packets; i++) + transfer->iso_packet_desc[i].length = length; +} + +/** \ingroup asyncio + * Convenience function to locate the position of an isochronous packet + * within the buffer of an isochronous transfer. + * + * This is a thorough function which loops through all preceding packets, + * accumulating their lengths to find the position of the specified packet. + * Typically you will assign equal lengths to each packet in the transfer, + * and hence the above method is sub-optimal. You may wish to use + * libusb_get_iso_packet_buffer_simple() instead. + * + * \param transfer a transfer + * \param packet the packet to return the address of + * \returns the base address of the packet buffer inside the transfer buffer, + * or NULL if the packet does not exist. + * \see libusb_get_iso_packet_buffer_simple() + */ +static inline unsigned char *libusb_get_iso_packet_buffer( + struct libusb_transfer *transfer, unsigned int packet) +{ + int i; + size_t offset = 0; + int _packet; + + /* oops..slight bug in the API. packet is an unsigned int, but we use + * signed integers almost everywhere else. range-check and convert to + * signed to avoid compiler warnings. FIXME for libusb-2. */ + if (packet > INT_MAX) + return NULL; + _packet = packet; + + if (_packet >= transfer->num_iso_packets) + return NULL; + + for (i = 0; i < _packet; i++) + offset += transfer->iso_packet_desc[i].length; + + return transfer->buffer + offset; +} + +/** \ingroup asyncio + * Convenience function to locate the position of an isochronous packet + * within the buffer of an isochronous transfer, for transfers where each + * packet is of identical size. + * + * This function relies on the assumption that every packet within the transfer + * is of identical size to the first packet. Calculating the location of + * the packet buffer is then just a simple calculation: + * buffer + (packet_size * packet) + * + * Do not use this function on transfers other than those that have identical + * packet lengths for each packet. + * + * \param transfer a transfer + * \param packet the packet to return the address of + * \returns the base address of the packet buffer inside the transfer buffer, + * or NULL if the packet does not exist. + * \see libusb_get_iso_packet_buffer() + */ +static inline unsigned char *libusb_get_iso_packet_buffer_simple( + struct libusb_transfer *transfer, unsigned int packet) +{ + int _packet; + + /* oops..slight bug in the API. packet is an unsigned int, but we use + * signed integers almost everywhere else. range-check and convert to + * signed to avoid compiler warnings. FIXME for libusb-2. */ + if (packet > INT_MAX) + return NULL; + _packet = packet; + + if (_packet >= transfer->num_iso_packets) + return NULL; + + return transfer->buffer + (transfer->iso_packet_desc[0].length * _packet); +} + +/* sync I/O */ + +int LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle, + uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + unsigned char *data, uint16_t wLength, unsigned int timeout); + +int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *data, int length, + int *actual_length, unsigned int timeout); + +int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *data, int length, + int *actual_length, unsigned int timeout); + +/** \ingroup desc + * Retrieve a descriptor from the default control pipe. + * This is a convenience function which formulates the appropriate control + * message to retrieve the descriptor. + * + * \param dev a device handle + * \param desc_type the descriptor type, see \ref libusb_descriptor_type + * \param desc_index the index of the descriptor to retrieve + * \param data output buffer for descriptor + * \param length size of data buffer + * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure + */ +static inline int libusb_get_descriptor(libusb_device_handle *dev, + uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length) +{ + return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, + (uint16_t) length, 1000); +} + +/** \ingroup desc + * Retrieve a descriptor from a device. + * This is a convenience function which formulates the appropriate control + * message to retrieve the descriptor. The string returned is Unicode, as + * detailed in the USB specifications. + * + * \param dev a device handle + * \param desc_index the index of the descriptor to retrieve + * \param langid the language ID for the string descriptor + * \param data output buffer for descriptor + * \param length size of data buffer + * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure + * \see libusb_get_string_descriptor_ascii() + */ +static inline int libusb_get_string_descriptor(libusb_device_handle *dev, + uint8_t desc_index, uint16_t langid, unsigned char *data, int length) +{ + return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index), + langid, data, (uint16_t) length, 1000); +} + +int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev, + uint8_t desc_index, unsigned char *data, int length); + +/* polling and timeouts */ + +int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx); +void LIBUSB_CALL libusb_lock_events(libusb_context *ctx); +void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx); +int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx); +int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx); +void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx); +void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx); +int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv); + +int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx, + struct timeval *tv); +int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx, + struct timeval *tv, int *completed); +int LIBUSB_CALL libusb_handle_events(libusb_context *ctx); +int LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed); +int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx, + struct timeval *tv); +int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx); +int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx, + struct timeval *tv); + +/** \ingroup poll + * File descriptor for polling + */ +struct libusb_pollfd { + /** Numeric file descriptor */ + int fd; + + /** Event flags to poll for from . POLLIN indicates that you + * should monitor this file descriptor for becoming ready to read from, + * and POLLOUT indicates that you should monitor this file descriptor for + * nonblocking write readiness. */ + short events; +}; + +/** \ingroup poll + * Callback function, invoked when a new file descriptor should be added + * to the set of file descriptors monitored for events. + * \param fd the new file descriptor + * \param events events to monitor for, see \ref libusb_pollfd for a + * description + * \param user_data User data pointer specified in + * libusb_set_pollfd_notifiers() call + * \see libusb_set_pollfd_notifiers() + */ +typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events, + void *user_data); + +/** \ingroup poll + * Callback function, invoked when a file descriptor should be removed from + * the set of file descriptors being monitored for events. After returning + * from this callback, do not use that file descriptor again. + * \param fd the file descriptor to stop monitoring + * \param user_data User data pointer specified in + * libusb_set_pollfd_notifiers() call + * \see libusb_set_pollfd_notifiers() + */ +typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data); + +const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( + libusb_context *ctx); +void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, + libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, + void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/libusbi.h b/thirdparty/libusb/libusb-1.0.9/libusb/libusbi.h new file mode 100644 index 0000000..976be0d --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/libusbi.h @@ -0,0 +1,935 @@ +/* + * Internal header for libusb + * Copyright (C) 2007-2009 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSBI_H +#define LIBUSBI_H + +#include + +#include +#include +#include +#include +#ifdef HAVE_POLL_H +#include +#endif + +#include +#include + +/* Inside the libusb code, mark all public functions as follows: + * return_type API_EXPORTED function_name(params) { ... } + * But if the function returns a pointer, mark it as follows: + * DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... } + * In the libusb public header, mark all declarations as: + * return_type LIBUSB_CALL function_name(params); + */ +#define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY + +#define DEVICE_DESC_LENGTH 18 + +#define USB_MAXENDPOINTS 32 +#define USB_MAXINTERFACES 32 +#define USB_MAXCONFIG 8 + +struct list_head { + struct list_head *prev, *next; +}; + +/* Get an entry from the list + * ptr - the address of this list_head element in "type" + * type - the data type that contains "member" + * member - the list_head element in "type" + */ +#define list_entry(ptr, type, member) \ + ((type *)((uintptr_t)(ptr) - (uintptr_t)(&((type *)0L)->member))) + +/* Get each entry from a list + * pos - A structure pointer has a "member" element + * head - list head + * member - the list_head element in "pos" + * type - the type of the first parameter + */ +#define list_for_each_entry(pos, head, member, type) \ + for (pos = list_entry((head)->next, type, member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, type, member)) + +#define list_for_each_entry_safe(pos, n, head, member, type) \ + for (pos = list_entry((head)->next, type, member), \ + n = list_entry(pos->member.next, type, member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, type, member)) + +#define list_empty(entry) ((entry)->next == (entry)) + +static inline void list_init(struct list_head *entry) +{ + entry->prev = entry->next = entry; +} + +static inline void list_add(struct list_head *entry, struct list_head *head) +{ + entry->next = head->next; + entry->prev = head; + + head->next->prev = entry; + head->next = entry; +} + +static inline void list_add_tail(struct list_head *entry, + struct list_head *head) +{ + entry->next = head; + entry->prev = head->prev; + + head->prev->next = entry; + head->prev = entry; +} + +static inline void list_del(struct list_head *entry) +{ + entry->next->prev = entry->prev; + entry->prev->next = entry->next; +} + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *mptr = (ptr); \ + (type *)( (char *)mptr - offsetof(type,member) );}) + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0) + +enum usbi_log_level { + LOG_LEVEL_DEBUG, + LOG_LEVEL_INFO, + LOG_LEVEL_WARNING, + LOG_LEVEL_ERROR, +}; + +void usbi_log(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, ...); + +void usbi_log_v(struct libusb_context *ctx, enum usbi_log_level level, + const char *function, const char *format, va_list args); + +#if !defined(_MSC_VER) || _MSC_VER >= 1400 + +#ifdef ENABLE_LOGGING +#define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__) +#else +#define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0) +#endif + +#ifdef ENABLE_DEBUG_LOGGING +#define usbi_dbg(...) _usbi_log(NULL, LOG_LEVEL_DEBUG, __VA_ARGS__) +#else +#define usbi_dbg(...) do {} while(0) +#endif + +#define usbi_info(ctx, ...) _usbi_log(ctx, LOG_LEVEL_INFO, __VA_ARGS__) +#define usbi_warn(ctx, ...) _usbi_log(ctx, LOG_LEVEL_WARNING, __VA_ARGS__) +#define usbi_err(ctx, ...) _usbi_log(ctx, LOG_LEVEL_ERROR, __VA_ARGS__) + +#else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ + +/* Old MS compilers don't support variadic macros. The code is simple, so we + * repeat it for each loglevel. Note that the debug case is special. + * + * Support for variadic macros was introduced in Visual C++ 2005. + * http://msdn.microsoft.com/en-us/library/ms177415%28v=VS.80%29.aspx + */ + +static inline void usbi_info(struct libusb_context *ctx, const char *fmt, ...) +{ +#ifdef ENABLE_LOGGING + va_list args; + va_start(args, fmt); + usbi_log_v(ctx, LOG_LEVEL_INFO, "", fmt, args); + va_end(args); +#else + (void)ctx; +#endif +} + +static inline void usbi_warn(struct libusb_context *ctx, const char *fmt, ...) +{ +#ifdef ENABLE_LOGGING + va_list args; + va_start(args, fmt); + usbi_log_v(ctx, LOG_LEVEL_WARNING, "", fmt, args); + va_end(args); +#else + (void)ctx; +#endif +} + +static inline void usbi_err(struct libusb_context *ctx, const char *fmt, ...) +{ +#ifdef ENABLE_LOGGING + va_list args; + va_start(args, fmt); + usbi_log_v(ctx, LOG_LEVEL_ERROR, "", fmt, args); + va_end(args); +#else + (void)ctx; +#endif +} + +static inline void usbi_dbg(const char *fmt, ...) +{ +#ifdef ENABLE_DEBUG_LOGGING + va_list args; + va_start(args, fmt); + usbi_log_v(NULL, LOG_LEVEL_DEBUG, "", fmt, args); + va_end(args); +#else + (void)fmt; +#endif +} + +#endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */ + +#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context +#define DEVICE_CTX(dev) ((dev)->ctx) +#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev)) +#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle)) +#define ITRANSFER_CTX(transfer) \ + (TRANSFER_CTX(USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer))) + +#define IS_EPIN(ep) (0 != ((ep) & LIBUSB_ENDPOINT_IN)) +#define IS_EPOUT(ep) (!IS_EPIN(ep)) +#define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN)) +#define IS_XFEROUT(xfer) (!IS_XFERIN(xfer)) + +/* Internal abstractions for thread synchronization and poll */ +#if defined(THREADS_POSIX) +#include +#elif defined(OS_WINDOWS) +#include +#endif + +#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) +#include +#include +#elif defined(OS_WINDOWS) +#include +#endif + +#if defined(OS_WINDOWS) && !defined(__GCC__) +#undef HAVE_GETTIMEOFDAY +int usbi_gettimeofday(struct timeval *tp, void *tzp); +#define LIBUSB_GETTIMEOFDAY_WIN32 +#define HAVE_USBI_GETTIMEOFDAY +#else +#ifdef HAVE_GETTIMEOFDAY +#define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz)) +#define HAVE_USBI_GETTIMEOFDAY +#endif +#endif + +extern struct libusb_context *usbi_default_context; + +struct libusb_context { + int debug; + int debug_fixed; + + /* internal control pipe, used for interrupting event handling when + * something needs to modify poll fds. */ + int ctrl_pipe[2]; + + struct list_head usb_devs; + usbi_mutex_t usb_devs_lock; + + /* A list of open handles. Backends are free to traverse this if required. + */ + struct list_head open_devs; + usbi_mutex_t open_devs_lock; + + /* this is a list of in-flight transfer handles, sorted by timeout + * expiration. URBs to timeout the soonest are placed at the beginning of + * the list, URBs that will time out later are placed after, and urbs with + * infinite timeout are always placed at the very end. */ + struct list_head flying_transfers; + usbi_mutex_t flying_transfers_lock; + + /* list of poll fds */ + struct list_head pollfds; + usbi_mutex_t pollfds_lock; + + /* a counter that is set when we want to interrupt event handling, in order + * to modify the poll fd set. and a lock to protect it. */ + unsigned int pollfd_modify; + usbi_mutex_t pollfd_modify_lock; + + /* user callbacks for pollfd changes */ + libusb_pollfd_added_cb fd_added_cb; + libusb_pollfd_removed_cb fd_removed_cb; + void *fd_cb_user_data; + + /* ensures that only one thread is handling events at any one time */ + usbi_mutex_t events_lock; + + /* used to see if there is an active thread doing event handling */ + int event_handler_active; + + /* used to wait for event completion in threads other than the one that is + * event handling */ + usbi_mutex_t event_waiters_lock; + usbi_cond_t event_waiters_cond; + +#ifdef USBI_TIMERFD_AVAILABLE + /* used for timeout handling, if supported by OS. + * this timerfd is maintained to trigger on the next pending timeout */ + int timerfd; +#endif +}; + +#ifdef USBI_TIMERFD_AVAILABLE +#define usbi_using_timerfd(ctx) ((ctx)->timerfd >= 0) +#else +#define usbi_using_timerfd(ctx) (0) +#endif + +struct libusb_device { + /* lock protects refcnt, everything else is finalized at initialization + * time */ + usbi_mutex_t lock; + int refcnt; + + struct libusb_context *ctx; + + uint8_t bus_number; + uint8_t device_address; + uint8_t num_configurations; + enum libusb_speed speed; + + struct list_head list; + unsigned long session_data; + unsigned char os_priv[0]; +}; + +struct libusb_device_handle { + /* lock protects claimed_interfaces */ + usbi_mutex_t lock; + unsigned long claimed_interfaces; + + struct list_head list; + struct libusb_device *dev; + unsigned char os_priv[0]; +}; + +enum { + USBI_CLOCK_MONOTONIC, + USBI_CLOCK_REALTIME +}; + +/* in-memory transfer layout: + * + * 1. struct usbi_transfer + * 2. struct libusb_transfer (which includes iso packets) [variable size] + * 3. os private data [variable size] + * + * from a libusb_transfer, you can get the usbi_transfer by rewinding the + * appropriate number of bytes. + * the usbi_transfer includes the number of allocated packets, so you can + * determine the size of the transfer and hence the start and length of the + * OS-private data. + */ + +struct usbi_transfer { + int num_iso_packets; + struct list_head list; + struct timeval timeout; + int transferred; + uint8_t flags; + + /* this lock is held during libusb_submit_transfer() and + * libusb_cancel_transfer() (allowing the OS backend to prevent duplicate + * cancellation, submission-during-cancellation, etc). the OS backend + * should also take this lock in the handle_events path, to prevent the user + * cancelling the transfer from another thread while you are processing + * its completion (presumably there would be races within your OS backend + * if this were possible). */ + usbi_mutex_t lock; +}; + +enum usbi_transfer_flags { + /* The transfer has timed out */ + USBI_TRANSFER_TIMED_OUT = 1 << 0, + + /* Set by backend submit_transfer() if the OS handles timeout */ + USBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 1, + + /* Cancellation was requested via libusb_cancel_transfer() */ + USBI_TRANSFER_CANCELLING = 1 << 2, + + /* Operation on the transfer failed because the device disappeared */ + USBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 3, +}; + +#define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \ + ((struct libusb_transfer *)(((unsigned char *)(transfer)) \ + + sizeof(struct usbi_transfer))) +#define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \ + ((struct usbi_transfer *)(((unsigned char *)(transfer)) \ + - sizeof(struct usbi_transfer))) + +static inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer) +{ + return ((unsigned char *)transfer) + sizeof(struct usbi_transfer) + + sizeof(struct libusb_transfer) + + (transfer->num_iso_packets + * sizeof(struct libusb_iso_packet_descriptor)); +} + +/* bus structures */ + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header { + uint8_t bLength; + uint8_t bDescriptorType; +}; + +/* shared data and functions */ + +int usbi_io_init(struct libusb_context *ctx); +void usbi_io_exit(struct libusb_context *ctx); + +struct libusb_device *usbi_alloc_device(struct libusb_context *ctx, + unsigned long session_id); +struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx, + unsigned long session_id); +int usbi_sanitize_device(struct libusb_device *dev); +void usbi_handle_disconnect(struct libusb_device_handle *handle); + +int usbi_handle_transfer_completion(struct usbi_transfer *itransfer, + enum libusb_transfer_status status); +int usbi_handle_transfer_cancellation(struct usbi_transfer *transfer); + +int usbi_parse_descriptor(unsigned char *source, const char *descriptor, + void *dest, int host_endian); +int usbi_get_config_index_by_value(struct libusb_device *dev, + uint8_t bConfigurationValue, int *idx); + +/* polling */ + +struct usbi_pollfd { + /* must come first */ + struct libusb_pollfd pollfd; + + struct list_head list; +}; + +int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events); +void usbi_remove_pollfd(struct libusb_context *ctx, int fd); +void usbi_fd_notification(struct libusb_context *ctx); + +/* device discovery */ + +/* we traverse usbfs without knowing how many devices we are going to find. + * so we create this discovered_devs model which is similar to a linked-list + * which grows when required. it can be freed once discovery has completed, + * eliminating the need for a list node in the libusb_device structure + * itself. */ +struct discovered_devs { + size_t len; + size_t capacity; + struct libusb_device *devices[0]; +}; + +struct discovered_devs *discovered_devs_append( + struct discovered_devs *discdevs, struct libusb_device *dev); + +/* OS abstraction */ + +/* This is the interface that OS backends need to implement. + * All fields are mandatory, except ones explicitly noted as optional. */ +struct usbi_os_backend { + /* A human-readable name for your backend, e.g. "Linux usbfs" */ + const char *name; + + /* Perform initialization of your backend. You might use this function + * to determine specific capabilities of the system, allocate required + * data structures for later, etc. + * + * This function is called when a libusb user initializes the library + * prior to use. + * + * Return 0 on success, or a LIBUSB_ERROR code on failure. + */ + int (*init)(struct libusb_context *ctx); + + /* Deinitialization. Optional. This function should destroy anything + * that was set up by init. + * + * This function is called when the user deinitializes the library. + */ + void (*exit)(void); + + /* Enumerate all the USB devices on the system, returning them in a list + * of discovered devices. + * + * Your implementation should enumerate all devices on the system, + * regardless of whether they have been seen before or not. + * + * When you have found a device, compute a session ID for it. The session + * ID should uniquely represent that particular device for that particular + * connection session since boot (i.e. if you disconnect and reconnect a + * device immediately after, it should be assigned a different session ID). + * If your OS cannot provide a unique session ID as described above, + * presenting a session ID of (bus_number << 8 | device_address) should + * be sufficient. Bus numbers and device addresses wrap and get reused, + * but that is an unlikely case. + * + * After computing a session ID for a device, call + * usbi_get_device_by_session_id(). This function checks if libusb already + * knows about the device, and if so, it provides you with a libusb_device + * structure for it. + * + * If usbi_get_device_by_session_id() returns NULL, it is time to allocate + * a new device structure for the device. Call usbi_alloc_device() to + * obtain a new libusb_device structure with reference count 1. Populate + * the bus_number and device_address attributes of the new device, and + * perform any other internal backend initialization you need to do. At + * this point, you should be ready to provide device descriptors and so + * on through the get_*_descriptor functions. Finally, call + * usbi_sanitize_device() to perform some final sanity checks on the + * device. Assuming all of the above succeeded, we can now continue. + * If any of the above failed, remember to unreference the device that + * was returned by usbi_alloc_device(). + * + * At this stage we have a populated libusb_device structure (either one + * that was found earlier, or one that we have just allocated and + * populated). This can now be added to the discovered devices list + * using discovered_devs_append(). Note that discovered_devs_append() + * may reallocate the list, returning a new location for it, and also + * note that reallocation can fail. Your backend should handle these + * error conditions appropriately. + * + * This function should not generate any bus I/O and should not block. + * If I/O is required (e.g. reading the active configuration value), it is + * OK to ignore these suggestions :) + * + * This function is executed when the user wishes to retrieve a list + * of USB devices connected to the system. + * + * Return 0 on success, or a LIBUSB_ERROR code on failure. + */ + int (*get_device_list)(struct libusb_context *ctx, + struct discovered_devs **discdevs); + + /* Open a device for I/O and other USB operations. The device handle + * is preallocated for you, you can retrieve the device in question + * through handle->dev. + * + * Your backend should allocate any internal resources required for I/O + * and other operations so that those operations can happen (hopefully) + * without hiccup. This is also a good place to inform libusb that it + * should monitor certain file descriptors related to this device - + * see the usbi_add_pollfd() function. + * + * This function should not generate any bus I/O and should not block. + * + * This function is called when the user attempts to obtain a device + * handle for a device. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_ACCESS if the user has insufficient permissions + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since + * discovery + * - another LIBUSB_ERROR code on other failure + * + * Do not worry about freeing the handle on failed open, the upper layers + * do this for you. + */ + int (*open)(struct libusb_device_handle *handle); + + /* Close a device such that the handle cannot be used again. Your backend + * should destroy any resources that were allocated in the open path. + * This may also be a good place to call usbi_remove_pollfd() to inform + * libusb of any file descriptors associated with this device that should + * no longer be monitored. + * + * This function is called when the user closes a device handle. + */ + void (*close)(struct libusb_device_handle *handle); + + /* Retrieve the device descriptor from a device. + * + * The descriptor should be retrieved from memory, NOT via bus I/O to the + * device. This means that you may have to cache it in a private structure + * during get_device_list enumeration. Alternatively, you may be able + * to retrieve it from a kernel interface (some Linux setups can do this) + * still without generating bus I/O. + * + * This function is expected to write DEVICE_DESC_LENGTH (18) bytes into + * buffer, which is guaranteed to be big enough. + * + * This function is called when sanity-checking a device before adding + * it to the list of discovered devices, and also when the user requests + * to read the device descriptor. + * + * This function is expected to return the descriptor in bus-endian format + * (LE). If it returns the multi-byte values in host-endian format, + * set the host_endian output parameter to "1". + * + * Return 0 on success or a LIBUSB_ERROR code on failure. + */ + int (*get_device_descriptor)(struct libusb_device *device, + unsigned char *buffer, int *host_endian); + + /* Get the ACTIVE configuration descriptor for a device. + * + * The descriptor should be retrieved from memory, NOT via bus I/O to the + * device. This means that you may have to cache it in a private structure + * during get_device_list enumeration. You may also have to keep track + * of which configuration is active when the user changes it. + * + * This function is expected to write len bytes of data into buffer, which + * is guaranteed to be big enough. If you can only do a partial write, + * return an error code. + * + * This function is expected to return the descriptor in bus-endian format + * (LE). If it returns the multi-byte values in host-endian format, + * set the host_endian output parameter to "1". + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state + * - another LIBUSB_ERROR code on other failure + */ + int (*get_active_config_descriptor)(struct libusb_device *device, + unsigned char *buffer, size_t len, int *host_endian); + + /* Get a specific configuration descriptor for a device. + * + * The descriptor should be retrieved from memory, NOT via bus I/O to the + * device. This means that you may have to cache it in a private structure + * during get_device_list enumeration. + * + * The requested descriptor is expressed as a zero-based index (i.e. 0 + * indicates that we are requesting the first descriptor). The index does + * not (necessarily) equal the bConfigurationValue of the configuration + * being requested. + * + * This function is expected to write len bytes of data into buffer, which + * is guaranteed to be big enough. If you can only do a partial write, + * return an error code. + * + * This function is expected to return the descriptor in bus-endian format + * (LE). If it returns the multi-byte values in host-endian format, + * set the host_endian output parameter to "1". + * + * Return 0 on success or a LIBUSB_ERROR code on failure. + */ + int (*get_config_descriptor)(struct libusb_device *device, + uint8_t config_index, unsigned char *buffer, size_t len, + int *host_endian); + + /* Get the bConfigurationValue for the active configuration for a device. + * Optional. This should only be implemented if you can retrieve it from + * cache (don't generate I/O). + * + * If you cannot retrieve this from cache, either do not implement this + * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause + * libusb to retrieve the information through a standard control transfer. + * + * This function must be non-blocking. + * Return: + * - 0 on success + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - LIBUSB_ERROR_NOT_SUPPORTED if the value cannot be retrieved without + * blocking + * - another LIBUSB_ERROR code on other failure. + */ + int (*get_configuration)(struct libusb_device_handle *handle, int *config); + + /* Set the active configuration for a device. + * + * A configuration value of -1 should put the device in unconfigured state. + * + * This function can block. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if the configuration does not exist + * - LIBUSB_ERROR_BUSY if interfaces are currently claimed (and hence + * configuration cannot be changed) + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure. + */ + int (*set_configuration)(struct libusb_device_handle *handle, int config); + + /* Claim an interface. When claimed, the application can then perform + * I/O to an interface's endpoints. + * + * This function should not generate any bus I/O and should not block. + * Interface claiming is a logical operation that simply ensures that + * no other drivers/applications are using the interface, and after + * claiming, no other drivers/applicatiosn can use the interface because + * we now "own" it. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if the interface does not exist + * - LIBUSB_ERROR_BUSY if the interface is in use by another driver/app + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*claim_interface)(struct libusb_device_handle *handle, int interface_number); + + /* Release a previously claimed interface. + * + * This function should also generate a SET_INTERFACE control request, + * resetting the alternate setting of that interface to 0. It's OK for + * this function to block as a result. + * + * You will only ever be asked to release an interface which was + * successfully claimed earlier. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*release_interface)(struct libusb_device_handle *handle, int interface_number); + + /* Set the alternate setting for an interface. + * + * You will only ever be asked to set the alternate setting for an + * interface which was successfully claimed earlier. + * + * It's OK for this function to block. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if the alternate setting does not exist + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*set_interface_altsetting)(struct libusb_device_handle *handle, + int interface_number, int altsetting); + + /* Clear a halt/stall condition on an endpoint. + * + * It's OK for this function to block. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*clear_halt)(struct libusb_device_handle *handle, + unsigned char endpoint); + + /* Perform a USB port reset to reinitialize a device. + * + * If possible, the handle should still be usable after the reset + * completes, assuming that the device descriptors did not change during + * reset and all previous interface state can be restored. + * + * If something changes, or you cannot easily locate/verify the resetted + * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application + * to close the old handle and re-enumerate the device. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the device + * has been disconnected since it was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*reset_device)(struct libusb_device_handle *handle); + + /* Determine if a kernel driver is active on an interface. Optional. + * + * The presence of a kernel driver on an interface indicates that any + * calls to claim_interface would fail with the LIBUSB_ERROR_BUSY code. + * + * Return: + * - 0 if no driver is active + * - 1 if a driver is active + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*kernel_driver_active)(struct libusb_device_handle *handle, + int interface_number); + + /* Detach a kernel driver from an interface. Optional. + * + * After detaching a kernel driver, the interface should be available + * for claim. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active + * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - another LIBUSB_ERROR code on other failure + */ + int (*detach_kernel_driver)(struct libusb_device_handle *handle, + int interface_number); + + /* Attach a kernel driver to an interface. Optional. + * + * Reattach a kernel driver to the device. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active + * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it + * was opened + * - LIBUSB_ERROR_BUSY if a program or driver has claimed the interface, + * preventing reattachment + * - another LIBUSB_ERROR code on other failure + */ + int (*attach_kernel_driver)(struct libusb_device_handle *handle, + int interface_number); + + /* Destroy a device. Optional. + * + * This function is called when the last reference to a device is + * destroyed. It should free any resources allocated in the get_device_list + * path. + */ + void (*destroy_device)(struct libusb_device *dev); + + /* Submit a transfer. Your implementation should take the transfer, + * morph it into whatever form your platform requires, and submit it + * asynchronously. + * + * This function must not block. + * + * Return: + * - 0 on success + * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * - another LIBUSB_ERROR code on other failure + */ + int (*submit_transfer)(struct usbi_transfer *itransfer); + + /* Cancel a previously submitted transfer. + * + * This function must not block. The transfer cancellation must complete + * later, resulting in a call to usbi_handle_transfer_cancellation() + * from the context of handle_events. + */ + int (*cancel_transfer)(struct usbi_transfer *itransfer); + + /* Clear a transfer as if it has completed or cancelled, but do not + * report any completion/cancellation to the library. You should free + * all private data from the transfer as if you were just about to report + * completion or cancellation. + * + * This function might seem a bit out of place. It is used when libusb + * detects a disconnected device - it calls this function for all pending + * transfers before reporting completion (with the disconnect code) to + * the user. Maybe we can improve upon this internal interface in future. + */ + void (*clear_transfer_priv)(struct usbi_transfer *itransfer); + + /* Handle any pending events. This involves monitoring any active + * transfers and processing their completion or cancellation. + * + * The function is passed an array of pollfd structures (size nfds) + * as a result of the poll() system call. The num_ready parameter + * indicates the number of file descriptors that have reported events + * (i.e. the poll() return value). This should be enough information + * for you to determine which actions need to be taken on the currently + * active transfers. + * + * For any cancelled transfers, call usbi_handle_transfer_cancellation(). + * For completed transfers, call usbi_handle_transfer_completion(). + * For control/bulk/interrupt transfers, populate the "transferred" + * element of the appropriate usbi_transfer structure before calling the + * above functions. For isochronous transfers, populate the status and + * transferred fields of the iso packet descriptors of the transfer. + * + * This function should also be able to detect disconnection of the + * device, reporting that situation with usbi_handle_disconnect(). + * + * When processing an event related to a transfer, you probably want to + * take usbi_transfer.lock to prevent races. See the documentation for + * the usbi_transfer structure. + * + * Return 0 on success, or a LIBUSB_ERROR code on failure. + */ + int (*handle_events)(struct libusb_context *ctx, + struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready); + + /* Get time from specified clock. At least two clocks must be implemented + by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC. + + Description of clocks: + USBI_CLOCK_REALTIME : clock returns time since system epoch. + USBI_CLOCK_MONOTONIC: clock returns time since unspecified start + time (usually boot). + */ + int (*clock_gettime)(int clkid, struct timespec *tp); + +#ifdef USBI_TIMERFD_AVAILABLE + /* clock ID of the clock that should be used for timerfd */ + clockid_t (*get_timerfd_clockid)(void); +#endif + + /* Number of bytes to reserve for per-device private backend data. + * This private data area is accessible through the "os_priv" field of + * struct libusb_device. */ + size_t device_priv_size; + + /* Number of bytes to reserve for per-handle private backend data. + * This private data area is accessible through the "os_priv" field of + * struct libusb_device. */ + size_t device_handle_priv_size; + + /* Number of bytes to reserve for per-transfer private backend data. + * This private data area is accessible by calling + * usbi_transfer_get_os_priv() on the appropriate usbi_transfer instance. + */ + size_t transfer_priv_size; + + /* Mumber of additional bytes for os_priv for each iso packet. + * Can your backend use this? */ + /* FIXME: linux can't use this any more. if other OS's cannot either, + * then remove this */ + size_t add_iso_packet_size; +}; + +extern const struct usbi_os_backend * const usbi_backend; + +extern const struct usbi_os_backend linux_usbfs_backend; +extern const struct usbi_os_backend darwin_backend; +extern const struct usbi_os_backend openbsd_backend; +extern const struct usbi_os_backend windows_backend; + +#endif + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.c new file mode 100644 index 0000000..8834d0f --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.c @@ -0,0 +1,1750 @@ +/* + * darwin backend for libusb 1.0 + * Copyright (C) 2008-2011 Nathan Hjelm + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + #include +#endif + +#include +#include +#include + +#include "darwin_usb.h" + +/* async event thread */ +static pthread_mutex_t libusb_darwin_at_mutex; +static pthread_cond_t libusb_darwin_at_cond; + +static clock_serv_t clock_realtime; +static clock_serv_t clock_monotonic; + +static CFRunLoopRef libusb_darwin_acfl = NULL; /* async cf loop */ +static volatile int32_t initCount = 0; + +/* async event thread */ +static pthread_t libusb_darwin_at; + +static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian); +static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface); +static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface); +static int darwin_reset_device(struct libusb_device_handle *dev_handle); +static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0); + +static const char *darwin_error_str (int result) { + switch (result) { + case kIOReturnSuccess: + return "no error"; + case kIOReturnNotOpen: + return "device not opened for exclusive access"; + case kIOReturnNoDevice: + return "no connection to an IOService"; + case kIOUSBNoAsyncPortErr: + return "no async port has been opened for interface"; + case kIOReturnExclusiveAccess: + return "another process has device opened for exclusive access"; + case kIOUSBPipeStalled: + return "pipe is stalled"; + case kIOReturnError: + return "could not establish a connection to the Darwin kernel"; + case kIOUSBTransactionTimeout: + return "transaction timed out"; + case kIOReturnBadArgument: + return "invalid argument"; + case kIOReturnAborted: + return "transaction aborted"; + case kIOReturnNotResponding: + return "device not responding"; + case kIOReturnOverrun: + return "data overrun"; + case kIOReturnCannotWire: + return "physical memory can not be wired down"; + default: + return "unknown error"; + } +} + +static int darwin_to_libusb (int result) { + switch (result) { + case kIOReturnUnderrun: + case kIOReturnSuccess: + return LIBUSB_SUCCESS; + case kIOReturnNotOpen: + case kIOReturnNoDevice: + return LIBUSB_ERROR_NO_DEVICE; + case kIOReturnExclusiveAccess: + return LIBUSB_ERROR_ACCESS; + case kIOUSBPipeStalled: + return LIBUSB_ERROR_PIPE; + case kIOReturnBadArgument: + return LIBUSB_ERROR_INVALID_PARAM; + case kIOUSBTransactionTimeout: + return LIBUSB_ERROR_TIMEOUT; + case kIOReturnNotResponding: + case kIOReturnAborted: + case kIOReturnError: + case kIOUSBNoAsyncPortErr: + default: + return LIBUSB_ERROR_OTHER; + } +} + + +static int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + + /* current interface */ + struct darwin_interface *cInterface; + + int8_t i, iface; + + usbi_info (HANDLE_CTX(dev_handle), "converting ep address 0x%02x to pipeRef and interface", ep); + + for (iface = 0 ; iface < USB_MAXINTERFACES ; iface++) { + cInterface = &priv->interfaces[iface]; + + if (dev_handle->claimed_interfaces & (1 << iface)) { + for (i = 0 ; i < cInterface->num_endpoints ; i++) { + if (cInterface->endpoint_addrs[i] == ep) { + *pipep = i + 1; + *ifcp = iface; + usbi_info (HANDLE_CTX(dev_handle), "pipe %d on interface %d matches", *pipep, *ifcp); + return 0; + } + } + } + } + + /* No pipe found with the correct endpoint address */ + usbi_warn (HANDLE_CTX(dev_handle), "no pipeRef found with endpoint address 0x%02x.", ep); + + return -1; +} + +static int usb_setup_device_iterator (io_iterator_t *deviceIterator, long location) { + CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOUSBDeviceClassName); + + if (!matchingDict) + return kIOReturnError; + + if (location) { + CFMutableDictionaryRef propertyMatchDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + + if (propertyMatchDict) { + CFTypeRef locationCF = CFNumberCreate (NULL, kCFNumberLongType, &location); + + CFDictionarySetValue (propertyMatchDict, CFSTR(kUSBDevicePropertyLocationID), locationCF); + /* release our reference to the CFNumber (CFDictionarySetValue retains it) */ + CFRelease (locationCF); + + CFDictionarySetValue (matchingDict, CFSTR(kIOPropertyMatchKey), propertyMatchDict); + /* release out reference to the CFMutableDictionaryRef (CFDictionarySetValue retains it) */ + CFRelease (propertyMatchDict); + } + /* else we can still proceed as long as the caller accounts for the possibility of other devices in the iterator */ + } + + return IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, deviceIterator); +} + +static usb_device_t **usb_get_next_device (io_iterator_t deviceIterator, UInt32 *locationp) { + io_cf_plugin_ref_t *plugInInterface = NULL; + usb_device_t **device; + io_service_t usbDevice; + long result; + SInt32 score; + + if (!IOIteratorIsValid (deviceIterator)) + return NULL; + + + while ((usbDevice = IOIteratorNext(deviceIterator))) { + result = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, &plugInInterface, + &score); + + /* we are done with the usb_device_t */ + (void)IOObjectRelease(usbDevice); + if (kIOReturnSuccess == result && plugInInterface) + break; + + usbi_dbg ("libusb/darwin.c usb_get_next_device: could not set up plugin for service: %s\n", darwin_error_str (result)); + } + + if (!usbDevice) + return NULL; + + (void)(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID), + (LPVOID)&device); + + (*plugInInterface)->Stop(plugInInterface); + IODestroyPlugInInterface (plugInInterface); + + /* get the location from the device */ + if (locationp) + (*(device))->GetLocationID(device, locationp); + + return device; +} + +static kern_return_t darwin_get_device (uint32_t dev_location, usb_device_t ***darwin_device) { + kern_return_t kresult; + UInt32 location; + io_iterator_t deviceIterator; + + kresult = usb_setup_device_iterator (&deviceIterator, dev_location); + if (kresult) + return kresult; + + /* This port of libusb uses locations to keep track of devices. */ + while ((*darwin_device = usb_get_next_device (deviceIterator, &location)) != NULL) { + if (location == dev_location) + break; + + (**darwin_device)->Release(*darwin_device); + } + + IOObjectRelease (deviceIterator); + + if (!(*darwin_device)) + return kIOReturnNoDevice; + + return kIOReturnSuccess; +} + + + +static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { + struct libusb_context *ctx = (struct libusb_context *)ptr; + struct libusb_device_handle *handle; + struct darwin_device_priv *dpriv; + struct darwin_device_handle_priv *priv; + + io_service_t device; + long location; + bool locationValid; + CFTypeRef locationCF; + UInt32 message; + + usbi_info (ctx, "a device has been detached"); + + while ((device = IOIteratorNext (rem_devices)) != 0) { + /* get the location from the i/o registry */ + locationCF = IORegistryEntryCreateCFProperty (device, CFSTR(kUSBDevicePropertyLocationID), kCFAllocatorDefault, 0); + + IOObjectRelease (device); + + if (!locationCF) + continue; + + locationValid = CFGetTypeID(locationCF) == CFNumberGetTypeID() && + CFNumberGetValue(locationCF, kCFNumberLongType, &location); + + CFRelease (locationCF); + + if (!locationValid) + continue; + + usbi_mutex_lock(&ctx->open_devs_lock); + list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { + dpriv = (struct darwin_device_priv *)handle->dev->os_priv; + + /* the device may have been opened several times. write to each handle's event descriptor */ + if (dpriv->location == location && handle->os_priv) { + priv = (struct darwin_device_handle_priv *)handle->os_priv; + + message = MESSAGE_DEVICE_GONE; + write (priv->fds[1], &message, sizeof (message)); + } + } + + usbi_mutex_unlock(&ctx->open_devs_lock); + } +} + +static void darwin_clear_iterator (io_iterator_t iter) { + io_service_t device; + + while ((device = IOIteratorNext (iter)) != 0) + IOObjectRelease (device); +} + +static void *event_thread_main (void *arg0) { + IOReturn kresult; + struct libusb_context *ctx = (struct libusb_context *)arg0; + CFRunLoopRef runloop; + + /* Set this thread's name, so it can be seen in the debugger + and crash reports. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + pthread_setname_np ("org.libusb.device-detach"); +#endif + + /* Tell the Objective-C garbage collector about this thread. + This is required because, unlike NSThreads, pthreads are + not automatically registered. Although we don't use + Objective-C, we use CoreFoundation, which does. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + objc_registerThreadWithCollector(); +#endif + + /* hotplug (device removal) source */ + CFRunLoopSourceRef libusb_notification_cfsource; + io_notification_port_t libusb_notification_port; + io_iterator_t libusb_rem_device_iterator; + + usbi_info (ctx, "creating hotplug event source"); + + runloop = CFRunLoopGetCurrent (); + CFRetain (runloop); + + /* add the notification port to the run loop */ + libusb_notification_port = IONotificationPortCreate (kIOMasterPortDefault); + libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port); + CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode); + + /* create notifications for removed devices */ + kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification, + IOServiceMatching(kIOUSBDeviceClassName), + (IOServiceMatchingCallback)darwin_devices_detached, + (void *)ctx, &libusb_rem_device_iterator); + + if (kresult != kIOReturnSuccess) { + usbi_err (ctx, "could not add hotplug event source: %s", darwin_error_str (kresult)); + + pthread_exit (NULL); + } + + /* arm notifiers */ + darwin_clear_iterator (libusb_rem_device_iterator); + + usbi_info (ctx, "thread ready to receive events"); + + /* signal the main thread that the async runloop has been created. */ + pthread_mutex_lock (&libusb_darwin_at_mutex); + libusb_darwin_acfl = runloop; + pthread_cond_signal (&libusb_darwin_at_cond); + pthread_mutex_unlock (&libusb_darwin_at_mutex); + + /* run the runloop */ + CFRunLoopRun(); + + usbi_info (ctx, "thread exiting"); + + /* delete notification port */ + IONotificationPortDestroy (libusb_notification_port); + IOObjectRelease (libusb_rem_device_iterator); + + CFRelease (runloop); + + libusb_darwin_acfl = NULL; + + pthread_exit (NULL); +} + +static int darwin_init(struct libusb_context *ctx) { + host_name_port_t host_self; + + if (OSAtomicIncrement32Barrier(&initCount) == 1) { + /* create the clocks that will be used */ + + host_self = mach_host_self(); + host_get_clock_service(host_self, CALENDAR_CLOCK, &clock_realtime); + host_get_clock_service(host_self, SYSTEM_CLOCK, &clock_monotonic); + mach_port_deallocate(mach_task_self(), host_self); + + pthread_mutex_init (&libusb_darwin_at_mutex, NULL); + pthread_cond_init (&libusb_darwin_at_cond, NULL); + + pthread_create (&libusb_darwin_at, NULL, event_thread_main, (void *)ctx); + + pthread_mutex_lock (&libusb_darwin_at_mutex); + while (!libusb_darwin_acfl) + pthread_cond_wait (&libusb_darwin_at_cond, &libusb_darwin_at_mutex); + pthread_mutex_unlock (&libusb_darwin_at_mutex); + } + + return 0; +} + +static void darwin_exit (void) { + if (OSAtomicDecrement32Barrier(&initCount) == 0) { + mach_port_deallocate(mach_task_self(), clock_realtime); + mach_port_deallocate(mach_task_self(), clock_monotonic); + + /* stop the async runloop and wait for the thread to terminate. */ + CFRunLoopStop (libusb_darwin_acfl); + pthread_join (libusb_darwin_at, NULL); + } +} + +static int darwin_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian) { + struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv; + + /* return cached copy */ + memmove (buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH); + + *host_endian = 0; + + return 0; +} + +static int get_configuration_index (struct libusb_device *dev, int config_value) { + struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv; + UInt8 i, numConfig; + IOUSBConfigurationDescriptorPtr desc; + IOReturn kresult; + + /* is there a simpler way to determine the index? */ + kresult = (*(priv->device))->GetNumberOfConfigurations (priv->device, &numConfig); + if (kresult != kIOReturnSuccess) + return darwin_to_libusb (kresult); + + for (i = 0 ; i < numConfig ; i++) { + (*(priv->device))->GetConfigurationDescriptorPtr (priv->device, i, &desc); + + if (desc->bConfigurationValue == config_value) + return i; + } + + /* configuration not found */ + return LIBUSB_ERROR_OTHER; +} + +static int darwin_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) { + struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv; + int config_index; + + if (0 == priv->active_config) + return LIBUSB_ERROR_INVALID_PARAM; + + config_index = get_configuration_index (dev, priv->active_config); + if (config_index < 0) + return config_index; + + return darwin_get_config_descriptor (dev, config_index, buffer, len, host_endian); +} + +static int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) { + struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv; + IOUSBConfigurationDescriptorPtr desc; + IOReturn kresult; + usb_device_t **device = NULL; + + if (!priv) + return LIBUSB_ERROR_OTHER; + + if (!priv->device) { + kresult = darwin_get_device (priv->location, &device); + if (kresult || !device) { + usbi_err (DEVICE_CTX (dev), "could not find device: %s", darwin_error_str (kresult)); + + return darwin_to_libusb (kresult); + } + + /* don't have to open the device to get a config descriptor */ + } else + device = priv->device; + + kresult = (*device)->GetConfigurationDescriptorPtr (device, config_index, &desc); + if (kresult == kIOReturnSuccess) { + /* copy descriptor */ + if (libusb_le16_to_cpu(desc->wTotalLength) < len) + len = libusb_le16_to_cpu(desc->wTotalLength); + + memmove (buffer, desc, len); + + /* GetConfigurationDescriptorPtr returns the descriptor in USB bus order */ + *host_endian = 0; + } + + if (!priv->device) + (*device)->Release (device); + + return darwin_to_libusb (kresult); +} + +/* check whether the os has configured the device */ +static int darwin_check_configuration (struct libusb_context *ctx, struct libusb_device *dev, usb_device_t **darwin_device) { + struct darwin_device_priv *priv = (struct darwin_device_priv *)dev->os_priv; + + IOUSBConfigurationDescriptorPtr configDesc; + IOUSBFindInterfaceRequest request; + kern_return_t kresult; + io_iterator_t interface_iterator; + io_service_t firstInterface; + + if (priv->dev_descriptor.bNumConfigurations < 1) { + usbi_err (ctx, "device has no configurations"); + return LIBUSB_ERROR_OTHER; /* no configurations at this speed so we can't use it */ + } + + /* find the first configuration */ + kresult = (*darwin_device)->GetConfigurationDescriptorPtr (darwin_device, 0, &configDesc); + priv->first_config = (kIOReturnSuccess == kresult) ? configDesc->bConfigurationValue : 1; + + /* check if the device is already configured. there is probably a better way than iterating over the + to accomplish this (the trick is we need to avoid a call to GetConfigurations since buggy devices + might lock up on the device request) */ + + /* Setup the Interface Request */ + request.bInterfaceClass = kIOUSBFindInterfaceDontCare; + request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare; + request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare; + request.bAlternateSetting = kIOUSBFindInterfaceDontCare; + + kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator); + if (kresult) + return darwin_to_libusb (kresult); + + /* iterate once */ + firstInterface = IOIteratorNext(interface_iterator); + + /* done with the interface iterator */ + IOObjectRelease(interface_iterator); + + if (firstInterface) { + IOObjectRelease (firstInterface); + + /* device is configured */ + if (priv->dev_descriptor.bNumConfigurations == 1) + /* to avoid problems with some devices get the configurations value from the configuration descriptor */ + priv->active_config = priv->first_config; + else + /* devices with more than one configuration should work with GetConfiguration */ + (*darwin_device)->GetConfiguration (darwin_device, &priv->active_config); + } else + /* not configured */ + priv->active_config = 0; + + usbi_info (ctx, "active config: %u, first config: %u", priv->active_config, priv->first_config); + + return 0; +} + +static int darwin_cache_device_descriptor (struct libusb_context *ctx, struct libusb_device *dev, usb_device_t **device) { + struct darwin_device_priv *priv; + int retries = 5, delay = 30000; + int unsuspended = 0, try_unsuspend = 1, try_reconfigure = 1; + int is_open = 0; + int ret = 0, ret2; + IOUSBDevRequest req; + UInt8 bDeviceClass; + UInt16 idProduct, idVendor; + + (*device)->GetDeviceClass (device, &bDeviceClass); + (*device)->GetDeviceProduct (device, &idProduct); + (*device)->GetDeviceVendor (device, &idVendor); + + priv = (struct darwin_device_priv *)dev->os_priv; + + /* try to open the device (we can usually continue even if this fails) */ + is_open = ((*device)->USBDeviceOpenSeize(device) == kIOReturnSuccess); + + /**** retrieve device descriptor ****/ + do { + /* Set up request for device descriptor */ + memset (&(priv->dev_descriptor), 0, sizeof(IOUSBDeviceDescriptor)); + req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice); + req.bRequest = kUSBRqGetDescriptor; + req.wValue = kUSBDeviceDesc << 8; + req.wIndex = 0; + req.wLength = sizeof(priv->dev_descriptor); + req.pData = &(priv->dev_descriptor); + + /* according to Apple's documentation the device must be open for DeviceRequest but we may not be able to open some + * devices and Apple's USB Prober doesn't bother to open the device before issuing a descriptor request. Still, + * to follow the spec as closely as possible, try opening the device */ + + ret = (*(device))->DeviceRequest (device, &req); + + if (kIOReturnOverrun == ret && kUSBDeviceDesc == priv->dev_descriptor.bDescriptorType) + /* received an overrun error but we still received a device descriptor */ + ret = kIOReturnSuccess; + + if (kIOReturnSuccess == ret && (0 == priv->dev_descriptor.bNumConfigurations || + 0 == priv->dev_descriptor.bcdUSB)) { + /* work around for incorrectly configured devices */ + if (try_reconfigure && is_open) { + usbi_dbg("descriptor appears to be invalid. resetting configuration before trying again..."); + + /* set the first configuration */ + (*device)->SetConfiguration(device, 1); + + /* don't try to reconfigure again */ + try_reconfigure = 0; + } + + ret = kIOUSBPipeStalled; + } + + if (kIOReturnSuccess != ret && is_open && try_unsuspend) { + /* device may be suspended. unsuspend it and try again */ +#if DeviceVersion >= 320 + UInt32 info; + + /* IOUSBFamily 320+ provides a way to detect device suspension but earlier versions do not */ + (void)(*device)->GetUSBDeviceInformation (device, &info); + + try_unsuspend = info & (1 << kUSBInformationDeviceIsSuspendedBit); +#endif + + if (try_unsuspend) { + /* resume the device */ + ret2 = (*device)->USBDeviceSuspend (device, 0); + if (kIOReturnSuccess != ret2) { + /* prevent log spew from poorly behaving devices. this indicates the + os actually had trouble communicating with the device */ + usbi_dbg("could not retrieve device descriptor. failed to unsuspend: %s",darwin_error_str(ret2)); + } else + unsuspended = 1; + + try_unsuspend = 0; + } + } + + if (kIOReturnSuccess != ret) { + usbi_dbg("kernel responded with code: 0x%08x. sleeping for %d ms before trying again", ret, delay/1000); + /* sleep for a little while before trying again */ + usleep (delay); + } + } while (kIOReturnSuccess != ret && retries--); + + if (unsuspended) + /* resuspend the device */ + (void)(*device)->USBDeviceSuspend (device, 1); + + if (is_open) + (void) (*device)->USBDeviceClose (device); + + if (ret != kIOReturnSuccess) { + /* a debug message was already printed out for this error */ + if (LIBUSB_CLASS_HUB == bDeviceClass) + usbi_dbg ("could not retrieve device descriptor %.4x:%.4x: %s. skipping device", idVendor, idProduct, darwin_error_str (ret)); + else + usbi_warn (ctx, "could not retrieve device descriptor %.4x:%.4x: %s. skipping device", idVendor, idProduct, darwin_error_str (ret)); + + return -1; + } + + usbi_dbg ("device descriptor:"); + usbi_dbg (" bDescriptorType: 0x%02x", priv->dev_descriptor.bDescriptorType); + usbi_dbg (" bcdUSB: 0x%04x", priv->dev_descriptor.bcdUSB); + usbi_dbg (" bDeviceClass: 0x%02x", priv->dev_descriptor.bDeviceClass); + usbi_dbg (" bDeviceSubClass: 0x%02x", priv->dev_descriptor.bDeviceSubClass); + usbi_dbg (" bDeviceProtocol: 0x%02x", priv->dev_descriptor.bDeviceProtocol); + usbi_dbg (" bMaxPacketSize0: 0x%02x", priv->dev_descriptor.bMaxPacketSize0); + usbi_dbg (" idVendor: 0x%04x", priv->dev_descriptor.idVendor); + usbi_dbg (" idProduct: 0x%04x", priv->dev_descriptor.idProduct); + usbi_dbg (" bcdDevice: 0x%04x", priv->dev_descriptor.bcdDevice); + usbi_dbg (" iManufacturer: 0x%02x", priv->dev_descriptor.iManufacturer); + usbi_dbg (" iProduct: 0x%02x", priv->dev_descriptor.iProduct); + usbi_dbg (" iSerialNumber: 0x%02x", priv->dev_descriptor.iSerialNumber); + usbi_dbg (" bNumConfigurations: 0x%02x", priv->dev_descriptor.bNumConfigurations); + + /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */ + if (libusb_le16_to_cpu (priv->dev_descriptor.idProduct) != idProduct) { + /* not a valid device */ + usbi_warn (ctx, "idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device", + idProduct, libusb_le16_to_cpu (priv->dev_descriptor.idProduct)); + return -1; + } + + return 0; +} + +static int process_new_device (struct libusb_context *ctx, usb_device_t **device, UInt32 locationID, struct discovered_devs **_discdevs) { + struct darwin_device_priv *priv; + struct libusb_device *dev; + struct discovered_devs *discdevs; + UInt16 address; + UInt8 devSpeed; + int ret = 0, need_unref = 0; + + do { + dev = usbi_get_device_by_session_id(ctx, locationID); + if (!dev) { + usbi_info (ctx, "allocating new device for location 0x%08x", locationID); + dev = usbi_alloc_device(ctx, locationID); + need_unref = 1; + } else + usbi_info (ctx, "using existing device for location 0x%08x", locationID); + + if (!dev) { + ret = LIBUSB_ERROR_NO_MEM; + break; + } + + priv = (struct darwin_device_priv *)dev->os_priv; + + (*device)->GetDeviceAddress (device, (USBDeviceAddress *)&address); + + ret = darwin_cache_device_descriptor (ctx, dev, device); + if (ret < 0) + break; + + /* check current active configuration (and cache the first configuration value-- which may be used by claim_interface) */ + ret = darwin_check_configuration (ctx, dev, device); + if (ret < 0) + break; + + dev->bus_number = locationID >> 24; + dev->device_address = address; + + (*device)->GetDeviceSpeed (device, &devSpeed); + + switch (devSpeed) { + case kUSBDeviceSpeedLow: dev->speed = LIBUSB_SPEED_LOW; break; + case kUSBDeviceSpeedFull: dev->speed = LIBUSB_SPEED_FULL; break; + case kUSBDeviceSpeedHigh: dev->speed = LIBUSB_SPEED_HIGH; break; + default: + usbi_warn (ctx, "Got unknown device speed %d", devSpeed); + } + + /* save our location, we'll need this later */ + priv->location = locationID; + snprintf(priv->sys_path, 20, "%03i-%04x-%04x-%02x-%02x", address, priv->dev_descriptor.idVendor, priv->dev_descriptor.idProduct, + priv->dev_descriptor.bDeviceClass, priv->dev_descriptor.bDeviceSubClass); + + ret = usbi_sanitize_device (dev); + if (ret < 0) + break; + + /* append the device to the list of discovered devices */ + discdevs = discovered_devs_append(*_discdevs, dev); + if (!discdevs) { + ret = LIBUSB_ERROR_NO_MEM; + break; + } + + *_discdevs = discdevs; + + usbi_info (ctx, "found device with address %d at %s", dev->device_address, priv->sys_path); + } while (0); + + if (need_unref) + libusb_unref_device(dev); + + return ret; +} + +static int darwin_get_device_list(struct libusb_context *ctx, struct discovered_devs **_discdevs) { + io_iterator_t deviceIterator; + usb_device_t **device; + kern_return_t kresult; + UInt32 location; + + kresult = usb_setup_device_iterator (&deviceIterator, 0); + if (kresult != kIOReturnSuccess) + return darwin_to_libusb (kresult); + + while ((device = usb_get_next_device (deviceIterator, &location)) != NULL) { + (void) process_new_device (ctx, device, location, _discdevs); + + (*(device))->Release(device); + } + + IOObjectRelease(deviceIterator); + + return 0; +} + +static int darwin_open (struct libusb_device_handle *dev_handle) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + usb_device_t **darwin_device; + IOReturn kresult; + + if (0 == dpriv->open_count) { + kresult = darwin_get_device (dpriv->location, &darwin_device); + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "could not find device: %s", darwin_error_str (kresult)); + return darwin_to_libusb (kresult); + } + + dpriv->device = darwin_device; + + /* try to open the device */ + kresult = (*(dpriv->device))->USBDeviceOpenSeize (dpriv->device); + + if (kresult != kIOReturnSuccess) { + usbi_err (HANDLE_CTX (dev_handle), "USBDeviceOpen: %s", darwin_error_str(kresult)); + + switch (kresult) { + case kIOReturnExclusiveAccess: + /* it is possible to perform some actions on a device that is not open so do not return an error */ + priv->is_open = 0; + + break; + default: + (*(dpriv->device))->Release (dpriv->device); + dpriv->device = NULL; + return darwin_to_libusb (kresult); + } + } else { + /* create async event source */ + kresult = (*(dpriv->device))->CreateDeviceAsyncEventSource (dpriv->device, &priv->cfSource); + if (kresult != kIOReturnSuccess) { + usbi_err (HANDLE_CTX (dev_handle), "CreateDeviceAsyncEventSource: %s", darwin_error_str(kresult)); + + (*(dpriv->device))->USBDeviceClose (dpriv->device); + (*(dpriv->device))->Release (dpriv->device); + + dpriv->device = NULL; + return darwin_to_libusb (kresult); + } + + priv->is_open = 1; + + CFRetain (libusb_darwin_acfl); + + /* add the cfSource to the aync run loop */ + CFRunLoopAddSource(libusb_darwin_acfl, priv->cfSource, kCFRunLoopCommonModes); + } + } + + /* device opened successfully */ + dpriv->open_count++; + + /* create a file descriptor for notifications */ + pipe (priv->fds); + + /* set the pipe to be non-blocking */ + fcntl (priv->fds[1], F_SETFD, O_NONBLOCK); + + usbi_add_pollfd(HANDLE_CTX(dev_handle), priv->fds[0], POLLIN); + + usbi_info (HANDLE_CTX (dev_handle), "device open for access"); + + return 0; +} + +static void darwin_close (struct libusb_device_handle *dev_handle) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + IOReturn kresult; + int i; + + if (dpriv->open_count == 0) { + /* something is probably very wrong if this is the case */ + usbi_err (HANDLE_CTX (dev_handle), "Close called on a device that was not open!\n"); + return; + } + + dpriv->open_count--; + + /* make sure all interfaces are released */ + for (i = 0 ; i < USB_MAXINTERFACES ; i++) + if (dev_handle->claimed_interfaces & (1 << i)) + libusb_release_interface (dev_handle, i); + + if (0 == dpriv->open_count) { + if (priv->is_open) { + /* delete the device's async event source */ + if (priv->cfSource) { + CFRunLoopRemoveSource (libusb_darwin_acfl, priv->cfSource, kCFRunLoopDefaultMode); + CFRelease (priv->cfSource); + } + + /* close the device */ + kresult = (*(dpriv->device))->USBDeviceClose(dpriv->device); + if (kresult) { + /* Log the fact that we had a problem closing the file, however failing a + * close isn't really an error, so return success anyway */ + usbi_err (HANDLE_CTX (dev_handle), "USBDeviceClose: %s", darwin_error_str(kresult)); + } + } + + kresult = (*(dpriv->device))->Release(dpriv->device); + if (kresult) { + /* Log the fact that we had a problem closing the file, however failing a + * close isn't really an error, so return success anyway */ + usbi_err (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult)); + } + + dpriv->device = NULL; + } + + /* file descriptors are maintained per-instance */ + usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]); + close (priv->fds[1]); + close (priv->fds[0]); + + priv->fds[0] = priv->fds[1] = -1; +} + +static int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) { + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + + *config = (int) dpriv->active_config; + + return 0; +} + +static int darwin_set_configuration(struct libusb_device_handle *dev_handle, int config) { + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + IOReturn kresult; + int i; + + /* Setting configuration will invalidate the interface, so we need + to reclaim it. First, dispose of existing interfaces, if any. */ + for (i = 0 ; i < USB_MAXINTERFACES ; i++) + if (dev_handle->claimed_interfaces & (1 << i)) + darwin_release_interface (dev_handle, i); + + kresult = (*(dpriv->device))->SetConfiguration (dpriv->device, config); + if (kresult != kIOReturnSuccess) + return darwin_to_libusb (kresult); + + /* Reclaim any interfaces. */ + for (i = 0 ; i < USB_MAXINTERFACES ; i++) + if (dev_handle->claimed_interfaces & (1 << i)) + darwin_claim_interface (dev_handle, i); + + dpriv->active_config = config; + + return 0; +} + +static int darwin_get_interface (usb_device_t **darwin_device, uint8_t ifc, io_service_t *usbInterfacep) { + IOUSBFindInterfaceRequest request; + uint8_t current_interface; + kern_return_t kresult; + io_iterator_t interface_iterator; + + *usbInterfacep = IO_OBJECT_NULL; + + /* Setup the Interface Request */ + request.bInterfaceClass = kIOUSBFindInterfaceDontCare; + request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare; + request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare; + request.bAlternateSetting = kIOUSBFindInterfaceDontCare; + + kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator); + if (kresult) + return kresult; + + for ( current_interface = 0 ; current_interface <= ifc ; current_interface++ ) { + *usbInterfacep = IOIteratorNext(interface_iterator); + if (current_interface != ifc) + (void) IOObjectRelease (*usbInterfacep); + } + + /* done with the interface iterator */ + IOObjectRelease(interface_iterator); + + return 0; +} + +static int get_endpoints (struct libusb_device_handle *dev_handle, int iface) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + + /* current interface */ + struct darwin_interface *cInterface = &priv->interfaces[iface]; + + kern_return_t kresult; + + u_int8_t numep, direction, number; + u_int8_t dont_care1, dont_care3; + u_int16_t dont_care2; + int i; + + usbi_info (HANDLE_CTX (dev_handle), "building table of endpoints."); + + /* retrieve the total number of endpoints on this interface */ + kresult = (*(cInterface->interface))->GetNumEndpoints(cInterface->interface, &numep); + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "can't get number of endpoints for interface: %s", darwin_error_str(kresult)); + return darwin_to_libusb (kresult); + } + + /* iterate through pipe references */ + for (i = 1 ; i <= numep ; i++) { + kresult = (*(cInterface->interface))->GetPipeProperties(cInterface->interface, i, &direction, &number, &dont_care1, + &dont_care2, &dont_care3); + + if (kresult != kIOReturnSuccess) { + usbi_err (HANDLE_CTX (dev_handle), "error getting pipe information for pipe %d: %s", i, darwin_error_str(kresult)); + + return darwin_to_libusb (kresult); + } + + usbi_info (HANDLE_CTX (dev_handle), "interface: %i pipe %i: dir: %i number: %i", iface, i, direction, number); + + cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK)); + } + + cInterface->num_endpoints = numep; + + return 0; +} + +static int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface) { + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + io_service_t usbInterface = IO_OBJECT_NULL; + IOReturn kresult; + IOCFPlugInInterface **plugInInterface = NULL; + SInt32 score; + + /* current interface */ + struct darwin_interface *cInterface = &priv->interfaces[iface]; + + kresult = darwin_get_interface (dpriv->device, iface, &usbInterface); + if (kresult != kIOReturnSuccess) + return darwin_to_libusb (kresult); + + /* make sure we have an interface */ + if (!usbInterface && dpriv->first_config != 0) { + usbi_info (HANDLE_CTX (dev_handle), "no interface found; setting configuration: %d", dpriv->first_config); + + /* set the configuration */ + kresult = darwin_set_configuration (dev_handle, dpriv->first_config); + if (kresult != LIBUSB_SUCCESS) { + usbi_err (HANDLE_CTX (dev_handle), "could not set configuration"); + return kresult; + } + + kresult = darwin_get_interface (dpriv->device, iface, &usbInterface); + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult)); + return darwin_to_libusb (kresult); + } + } + + if (!usbInterface) { + usbi_err (HANDLE_CTX (dev_handle), "interface not found"); + return LIBUSB_ERROR_NOT_FOUND; + } + + /* get an interface to the device's interface */ + kresult = IOCreatePlugInInterfaceForService (usbInterface, kIOUSBInterfaceUserClientTypeID, + kIOCFPlugInInterfaceID, &plugInInterface, &score); + + /* ignore release error */ + (void)IOObjectRelease (usbInterface); + + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "IOCreatePlugInInterfaceForService: %s", darwin_error_str(kresult)); + return darwin_to_libusb (kresult); + } + + if (!plugInInterface) { + usbi_err (HANDLE_CTX (dev_handle), "plugin interface not found"); + return LIBUSB_ERROR_NOT_FOUND; + } + + /* Do the actual claim */ + kresult = (*plugInInterface)->QueryInterface(plugInInterface, + CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), + (LPVOID)&cInterface->interface); + /* We no longer need the intermediate plug-in */ + IODestroyPlugInInterface (plugInInterface); + if (kresult || !cInterface->interface) { + usbi_err (HANDLE_CTX (dev_handle), "QueryInterface: %s", darwin_error_str(kresult)); + return darwin_to_libusb (kresult); + } + + /* claim the interface */ + kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface); + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceOpen: %s", darwin_error_str(kresult)); + return darwin_to_libusb (kresult); + } + + /* update list of endpoints */ + kresult = get_endpoints (dev_handle, iface); + if (kresult) { + /* this should not happen */ + darwin_release_interface (dev_handle, iface); + usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table"); + return kresult; + } + + cInterface->cfSource = NULL; + + /* create async event source */ + kresult = (*(cInterface->interface))->CreateInterfaceAsyncEventSource (cInterface->interface, &cInterface->cfSource); + if (kresult != kIOReturnSuccess) { + usbi_err (HANDLE_CTX (dev_handle), "could not create async event source"); + + /* can't continue without an async event source */ + (void)darwin_release_interface (dev_handle, iface); + + return darwin_to_libusb (kresult); + } + + /* add the cfSource to the async thread's run loop */ + CFRunLoopAddSource(libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode); + + usbi_info (HANDLE_CTX (dev_handle), "interface opened"); + + return 0; +} + +static int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + IOReturn kresult; + + /* current interface */ + struct darwin_interface *cInterface = &priv->interfaces[iface]; + + /* Check to see if an interface is open */ + if (!cInterface->interface) + return LIBUSB_SUCCESS; + + /* clean up endpoint data */ + cInterface->num_endpoints = 0; + + /* delete the interface's async event source */ + if (cInterface->cfSource) { + CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode); + CFRelease (cInterface->cfSource); + } + + kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface); + if (kresult) + usbi_err (HANDLE_CTX (dev_handle), "USBInterfaceClose: %s", darwin_error_str(kresult)); + + kresult = (*(cInterface->interface))->Release(cInterface->interface); + if (kresult != kIOReturnSuccess) + usbi_err (HANDLE_CTX (dev_handle), "Release: %s", darwin_error_str(kresult)); + + cInterface->interface = IO_OBJECT_NULL; + + return darwin_to_libusb (kresult); +} + +static int darwin_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + IOReturn kresult; + + /* current interface */ + struct darwin_interface *cInterface = &priv->interfaces[iface]; + + if (!cInterface->interface) + return LIBUSB_ERROR_NO_DEVICE; + + kresult = (*(cInterface->interface))->SetAlternateInterface (cInterface->interface, altsetting); + if (kresult != kIOReturnSuccess) + darwin_reset_device (dev_handle); + + /* update list of endpoints */ + kresult = get_endpoints (dev_handle, iface); + if (kresult) { + /* this should not happen */ + darwin_release_interface (dev_handle, iface); + usbi_err (HANDLE_CTX (dev_handle), "could not build endpoint table"); + return kresult; + } + + return darwin_to_libusb (kresult); +} + +static int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) { + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv; + + /* current interface */ + struct darwin_interface *cInterface; + uint8_t pipeRef, iface; + IOReturn kresult; + + /* determine the interface/endpoint to use */ + if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) { + usbi_err (HANDLE_CTX (dev_handle), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + cInterface = &priv->interfaces[iface]; + +#if (InterfaceVersion < 190) + kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef); +#else + /* newer versions of darwin support clearing additional bits on the device's endpoint */ + kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); +#endif + if (kresult) + usbi_err (HANDLE_CTX (dev_handle), "ClearPipeStall: %s", darwin_error_str (kresult)); + + return darwin_to_libusb (kresult); +} + +static int darwin_reset_device(struct libusb_device_handle *dev_handle) { + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + IOReturn kresult; + + kresult = (*(dpriv->device))->ResetDevice (dpriv->device); + if (kresult) + usbi_err (HANDLE_CTX (dev_handle), "ResetDevice: %s", darwin_error_str (kresult)); + + return darwin_to_libusb (kresult); +} + +static int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, int interface) { + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)dev_handle->dev->os_priv; + io_service_t usbInterface; + CFTypeRef driver; + IOReturn kresult; + + kresult = darwin_get_interface (dpriv->device, interface, &usbInterface); + if (kresult) { + usbi_err (HANDLE_CTX (dev_handle), "darwin_get_interface: %s", darwin_error_str(kresult)); + + return darwin_to_libusb (kresult); + } + + driver = IORegistryEntryCreateCFProperty (usbInterface, kIOBundleIdentifierKey, kCFAllocatorDefault, 0); + IOObjectRelease (usbInterface); + + if (driver) { + CFRelease (driver); + + return 1; + } + + /* no driver */ + return 0; +} + +/* attaching/detaching kernel drivers is not currently supported (maybe in the future?) */ +static int darwin_attach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) { + (void)dev_handle; + (void)interface; + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +static int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) { + (void)dev_handle; + (void)interface; + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +static void darwin_destroy_device(struct libusb_device *dev) { + (void)dev; +} + +static int submit_bulk_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; + + IOReturn ret; + uint8_t transferType; + /* None of the values below are used in libusb for bulk transfers */ + uint8_t direction, number, interval, pipeRef, iface; + uint16_t maxPacketSize; + + struct darwin_interface *cInterface; + + if (IS_XFEROUT(transfer) && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) + return LIBUSB_ERROR_NOT_SUPPORTED; + + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + cInterface = &priv->interfaces[iface]; + + (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number, + &transferType, &maxPacketSize, &interval); + + /* submit the request */ + /* timeouts are unavailable on interrupt endpoints */ + if (transferType == kUSBInterrupt) { + if (IS_XFERIN(transfer)) + ret = (*(cInterface->interface))->ReadPipeAsync(cInterface->interface, pipeRef, transfer->buffer, + transfer->length, darwin_async_io_callback, itransfer); + else + ret = (*(cInterface->interface))->WritePipeAsync(cInterface->interface, pipeRef, transfer->buffer, + transfer->length, darwin_async_io_callback, itransfer); + } else { + itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; + + if (IS_XFERIN(transfer)) + ret = (*(cInterface->interface))->ReadPipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer, + transfer->length, transfer->timeout, transfer->timeout, + darwin_async_io_callback, (void *)itransfer); + else + ret = (*(cInterface->interface))->WritePipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer, + transfer->length, transfer->timeout, transfer->timeout, + darwin_async_io_callback, (void *)itransfer); + } + + if (ret) + usbi_err (TRANSFER_CTX (transfer), "bulk transfer failed (dir = %s): %s (code = 0x%08x)", IS_XFERIN(transfer) ? "In" : "Out", + darwin_error_str(ret), ret); + + return darwin_to_libusb (ret); +} + +static int submit_iso_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; + + IOReturn kresult; + uint8_t pipeRef, iface; + UInt64 frame; + AbsoluteTime atTime; + int i; + + struct darwin_interface *cInterface; + + /* construct an array of IOUSBIsocFrames, reuse the old one if possible */ + if (tpriv->isoc_framelist && tpriv->num_iso_packets != transfer->num_iso_packets) { + free(tpriv->isoc_framelist); + tpriv->isoc_framelist = NULL; + } + + if (!tpriv->isoc_framelist) { + tpriv->num_iso_packets = transfer->num_iso_packets; + tpriv->isoc_framelist = (IOUSBIsocFrame*) calloc (transfer->num_iso_packets, sizeof(IOUSBIsocFrame)); + if (!tpriv->isoc_framelist) + return LIBUSB_ERROR_NO_MEM; + } + + /* copy the frame list from the libusb descriptor (the structures differ only is member order) */ + for (i = 0 ; i < transfer->num_iso_packets ; i++) + tpriv->isoc_framelist[i].frReqCount = transfer->iso_packet_desc[i].length; + + /* determine the interface/endpoint to use */ + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + cInterface = &priv->interfaces[iface]; + + /* Last but not least we need the bus frame number */ + kresult = (*(cInterface->interface))->GetBusFrameNumber(cInterface->interface, &frame, &atTime); + if (kresult) { + usbi_err (TRANSFER_CTX (transfer), "failed to get bus frame number: %d", kresult); + free(tpriv->isoc_framelist); + tpriv->isoc_framelist = NULL; + + return darwin_to_libusb (kresult); + } + + /* schedule for a frame a little in the future */ + frame += 4; + + if (cInterface->frames[transfer->endpoint] && frame < cInterface->frames[transfer->endpoint]) + frame = cInterface->frames[transfer->endpoint]; + + /* submit the request */ + if (IS_XFERIN(transfer)) + kresult = (*(cInterface->interface))->ReadIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame, + transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback, + itransfer); + else + kresult = (*(cInterface->interface))->WriteIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame, + transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback, + itransfer); + + cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets / 8; + + if (kresult != kIOReturnSuccess) { + usbi_err (TRANSFER_CTX (transfer), "isochronous transfer failed (dir: %s): %s", IS_XFERIN(transfer) ? "In" : "Out", + darwin_error_str(kresult)); + free (tpriv->isoc_framelist); + tpriv->isoc_framelist = NULL; + } + + return darwin_to_libusb (kresult); +} + +static int submit_control_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer; + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv; + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; + struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + + IOReturn kresult; + + bzero(&tpriv->req, sizeof(tpriv->req)); + + /* IOUSBDeviceInterface expects the request in cpu endianess */ + tpriv->req.bmRequestType = setup->bmRequestType; + tpriv->req.bRequest = setup->bRequest; + /* these values should be in bus order from libusb_fill_control_setup */ + tpriv->req.wValue = OSSwapLittleToHostInt16 (setup->wValue); + tpriv->req.wIndex = OSSwapLittleToHostInt16 (setup->wIndex); + tpriv->req.wLength = OSSwapLittleToHostInt16 (setup->wLength); + /* data is stored after the libusb control block */ + tpriv->req.pData = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; + tpriv->req.completionTimeout = transfer->timeout; + tpriv->req.noDataTimeout = transfer->timeout; + + itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT; + + /* all transfers in libusb-1.0 are async */ + + if (transfer->endpoint) { + struct darwin_interface *cInterface; + uint8_t pipeRef, iface; + + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + cInterface = &priv->interfaces[iface]; + + kresult = (*(cInterface->interface))->ControlRequestAsyncTO (cInterface->interface, pipeRef, &(tpriv->req), darwin_async_io_callback, itransfer); + } else + /* control request on endpoint 0 */ + kresult = (*(dpriv->device))->DeviceRequestAsyncTO(dpriv->device, &(tpriv->req), darwin_async_io_callback, itransfer); + + if (kresult != kIOReturnSuccess) + usbi_err (TRANSFER_CTX (transfer), "control request failed: %s", darwin_error_str(kresult)); + + return darwin_to_libusb (kresult); +} + +static int darwin_submit_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + return submit_control_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + return submit_bulk_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return submit_iso_transfer(itransfer); + default: + usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +static int cancel_control_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv; + IOReturn kresult; + + usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions control pipe"); + + if (!dpriv->device) + return LIBUSB_ERROR_NO_DEVICE; + + kresult = (*(dpriv->device))->USBDeviceAbortPipeZero (dpriv->device); + + return darwin_to_libusb (kresult); +} + +static int darwin_abort_transfers (struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_device_priv *dpriv = (struct darwin_device_priv *)transfer->dev_handle->dev->os_priv; + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; + struct darwin_interface *cInterface; + uint8_t pipeRef, iface; + IOReturn kresult; + + if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) { + usbi_err (TRANSFER_CTX (transfer), "endpoint not found on any open interface"); + + return LIBUSB_ERROR_NOT_FOUND; + } + + cInterface = &priv->interfaces[iface]; + + if (!dpriv->device) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_info (ITRANSFER_CTX (itransfer), "WARNING: aborting all transactions on interface %d pipe %d", iface, pipeRef); + + /* abort transactions */ + (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef); + + usbi_info (ITRANSFER_CTX (itransfer), "calling clear pipe stall to clear the data toggle bit"); + + /* clear the data toggle bit */ +#if (InterfaceVersion < 190) + kresult = (*(cInterface->interface))->ClearPipeStall(cInterface->interface, pipeRef); +#else + /* newer versions of darwin support clearing additional bits on the device's endpoint */ + kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef); +#endif + + return darwin_to_libusb (kresult); +} + +static int darwin_cancel_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + return cancel_control_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return darwin_abort_transfers (itransfer); + default: + usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +static void darwin_clear_transfer_priv (struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + + if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS && tpriv->isoc_framelist) { + free (tpriv->isoc_framelist); + tpriv->isoc_framelist = NULL; + } +} + +static void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) { + struct usbi_transfer *itransfer = (struct usbi_transfer *)refcon; + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv; + UInt32 message, size; + + usbi_info (ITRANSFER_CTX (itransfer), "an async io operation has completed"); + + size = (UInt32) (uintptr_t) arg0; + + /* send a completion message to the device's file descriptor */ + message = MESSAGE_ASYNC_IO_COMPLETE; + write (priv->fds[1], &message, sizeof (message)); + write (priv->fds[1], &itransfer, sizeof (itransfer)); + write (priv->fds[1], &result, sizeof (IOReturn)); + write (priv->fds[1], &size, sizeof (size)); +} + +static int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) { + if (itransfer->flags & USBI_TRANSFER_TIMED_OUT) + result = kIOUSBTransactionTimeout; + + switch (result) { + case kIOReturnUnderrun: + case kIOReturnSuccess: + return LIBUSB_TRANSFER_COMPLETED; + case kIOReturnAborted: + return LIBUSB_TRANSFER_CANCELLED; + case kIOUSBPipeStalled: + usbi_warn (ITRANSFER_CTX (itransfer), "transfer error: pipe is stalled"); + return LIBUSB_TRANSFER_STALL; + case kIOReturnOverrun: + usbi_err (ITRANSFER_CTX (itransfer), "transfer error: data overrun"); + return LIBUSB_TRANSFER_OVERFLOW; + case kIOUSBTransactionTimeout: + usbi_err (ITRANSFER_CTX (itransfer), "transfer error: timed out"); + itransfer->flags |= USBI_TRANSFER_TIMED_OUT; + return LIBUSB_TRANSFER_TIMED_OUT; + default: + usbi_err (ITRANSFER_CTX (itransfer), "transfer error: %s (value = 0x%08x)", darwin_error_str (result), result); + return LIBUSB_TRANSFER_ERROR; + } +} + +static void darwin_handle_callback (struct usbi_transfer *itransfer, kern_return_t result, UInt32 io_size) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + int isIsoc = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type; + int isBulk = LIBUSB_TRANSFER_TYPE_BULK == transfer->type; + int isControl = LIBUSB_TRANSFER_TYPE_CONTROL == transfer->type; + int isInterrupt = LIBUSB_TRANSFER_TYPE_INTERRUPT == transfer->type; + int i; + + if (!isIsoc && !isBulk && !isControl && !isInterrupt) { + usbi_err (TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); + return; + } + + usbi_info (ITRANSFER_CTX (itransfer), "handling %s completion with kernel status %d", + isControl ? "control" : isBulk ? "bulk" : isIsoc ? "isoc" : "interrupt", result); + + if (kIOReturnSuccess == result || kIOReturnUnderrun == result) { + if (isIsoc && tpriv->isoc_framelist) { + /* copy isochronous results back */ + + for (i = 0; i < transfer->num_iso_packets ; i++) { + struct libusb_iso_packet_descriptor *lib_desc = &transfer->iso_packet_desc[i]; + lib_desc->status = darwin_to_libusb (tpriv->isoc_framelist[i].frStatus); + lib_desc->actual_length = tpriv->isoc_framelist[i].frActCount; + } + } else if (!isIsoc) + itransfer->transferred += io_size; + } + + /* it is ok to handle cancelled transfers without calling usbi_handle_transfer_cancellation (we catch timeout transfers) */ + usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, result)); +} + +static int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) { + struct usbi_transfer *itransfer; + UInt32 io_size; + IOReturn kresult; + POLL_NFDS_TYPE i = 0; + ssize_t ret; + UInt32 message; + + usbi_mutex_lock(&ctx->open_devs_lock); + for (i = 0; i < nfds && num_ready > 0; i++) { + struct pollfd *pollfd = &fds[i]; + struct libusb_device_handle *handle; + struct darwin_device_handle_priv *hpriv = NULL; + + usbi_info (ctx, "checking fd %i with revents = %x", fds[i], pollfd->revents); + + if (!pollfd->revents) + continue; + + num_ready--; + list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { + hpriv = (struct darwin_device_handle_priv *)handle->os_priv; + if (hpriv->fds[0] == pollfd->fd) + break; + } + + if (!(pollfd->revents & POLLERR)) { + ret = read (hpriv->fds[0], &message, sizeof (message)); + if (ret < (ssize_t)sizeof (message)) + continue; + } else + /* could not poll the device-- response is to delete the device (this seems a little heavy-handed) */ + message = MESSAGE_DEVICE_GONE; + + switch (message) { + case MESSAGE_DEVICE_GONE: + /* remove the device's async port from the runloop */ + if (hpriv->cfSource) { + if (libusb_darwin_acfl) + CFRunLoopRemoveSource (libusb_darwin_acfl, hpriv->cfSource, kCFRunLoopDefaultMode); + CFRelease (hpriv->cfSource); + hpriv->cfSource = NULL; + } + + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fds[0]); + usbi_handle_disconnect(handle); + + /* done with this device */ + continue; + case MESSAGE_ASYNC_IO_COMPLETE: + read (hpriv->fds[0], &itransfer, sizeof (itransfer)); + read (hpriv->fds[0], &kresult, sizeof (IOReturn)); + read (hpriv->fds[0], &io_size, sizeof (UInt32)); + + darwin_handle_callback (itransfer, kresult, io_size); + break; + default: + usbi_err (ctx, "unknown message received from device pipe"); + } + } + + usbi_mutex_unlock(&ctx->open_devs_lock); + + return 0; +} + +static int darwin_clock_gettime(int clk_id, struct timespec *tp) { + mach_timespec_t sys_time; + clock_serv_t clock_ref; + + switch (clk_id) { + case USBI_CLOCK_REALTIME: + /* CLOCK_REALTIME represents time since the epoch */ + clock_ref = clock_realtime; + break; + case USBI_CLOCK_MONOTONIC: + /* use system boot time as reference for the monotonic clock */ + clock_ref = clock_monotonic; + break; + default: + return LIBUSB_ERROR_INVALID_PARAM; + } + + clock_get_time (clock_ref, &sys_time); + + tp->tv_sec = sys_time.tv_sec; + tp->tv_nsec = sys_time.tv_nsec; + + return 0; +} + +const struct usbi_os_backend darwin_backend = { + .name = "Darwin", + .init = darwin_init, + .exit = darwin_exit, + .get_device_list = darwin_get_device_list, + .get_device_descriptor = darwin_get_device_descriptor, + .get_active_config_descriptor = darwin_get_active_config_descriptor, + .get_config_descriptor = darwin_get_config_descriptor, + + .open = darwin_open, + .close = darwin_close, + .get_configuration = darwin_get_configuration, + .set_configuration = darwin_set_configuration, + .claim_interface = darwin_claim_interface, + .release_interface = darwin_release_interface, + + .set_interface_altsetting = darwin_set_interface_altsetting, + .clear_halt = darwin_clear_halt, + .reset_device = darwin_reset_device, + + .kernel_driver_active = darwin_kernel_driver_active, + .detach_kernel_driver = darwin_detach_kernel_driver, + .attach_kernel_driver = darwin_attach_kernel_driver, + + .destroy_device = darwin_destroy_device, + + .submit_transfer = darwin_submit_transfer, + .cancel_transfer = darwin_cancel_transfer, + .clear_transfer_priv = darwin_clear_transfer_priv, + + .handle_events = op_handle_events, + + .clock_gettime = darwin_clock_gettime, + + .device_priv_size = sizeof(struct darwin_device_priv), + .device_handle_priv_size = sizeof(struct darwin_device_handle_priv), + .transfer_priv_size = sizeof(struct darwin_transfer_priv), + .add_iso_packet_size = 0, +}; + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.h new file mode 100644 index 0000000..59d0a69 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/darwin_usb.h @@ -0,0 +1,169 @@ +/* + * darwin backend for libusb 1.0 + * Copyright (C) 2008-2009 Nathan Hjelm + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if !defined(LIBUSB_DARWIN_H) +#define LIBUSB_DARWIN_H + +#include "libusbi.h" + +#include +#include +#include +#include + +/* IOUSBInterfaceInferface */ +#if defined (kIOUSBInterfaceInterfaceID300) + +#define usb_interface_t IOUSBInterfaceInterface300 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300 +#define InterfaceVersion 300 + +#elif defined (kIOUSBInterfaceInterfaceID245) + +#define usb_interface_t IOUSBInterfaceInterface245 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245 +#define InterfaceVersion 245 + +#elif defined (kIOUSBInterfaceInterfaceID220) + +#define usb_interface_t IOUSBInterfaceInterface220 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220 +#define InterfaceVersion 220 + +#elif defined (kIOUSBInterfaceInterfaceID197) + +#define usb_interface_t IOUSBInterfaceInterface197 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID197 +#define InterfaceVersion 197 + +#elif defined (kIOUSBInterfaceInterfaceID190) + +#define usb_interface_t IOUSBInterfaceInterface190 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID190 +#define InterfaceVersion 190 + +#elif defined (kIOUSBInterfaceInterfaceID182) + +#define usb_interface_t IOUSBInterfaceInterface182 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID182 +#define InterfaceVersion 182 + +#else + +#error "IOUSBFamily is too old. Please upgrade your OS" + +#endif + +/* IOUSBDeviceInterface */ +#if defined (kIOUSBDeviceInterfaceID320) + +#define usb_device_t IOUSBDeviceInterface320 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID320 +#define DeviceVersion 320 + +#elif defined (kIOUSBDeviceInterfaceID300) + +#define usb_device_t IOUSBDeviceInterface300 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID300 +#define DeviceVersion 300 + +#elif defined (kIOUSBDeviceInterfaceID245) + +#define usb_device_t IOUSBDeviceInterface245 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID245 +#define DeviceVersion 245 + +#elif defined (kIOUSBDeviceInterfaceID197) + +#define usb_device_t IOUSBDeviceInterface197 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID197 +#define DeviceVersion 197 + +#elif defined (kIOUSBDeviceInterfaceID187) + +#define usb_device_t IOUSBDeviceInterface187 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID187 +#define DeviceVersion 187 + +#elif defined (kIOUSBDeviceInterfaceID182) + +#define usb_device_t IOUSBDeviceInterface182 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID182 +#define DeviceVersion 182 + +#else + +#error "IOUSBFamily is too old. Please upgrade your OS" + +#endif + +#if !defined(IO_OBJECT_NULL) +#define IO_OBJECT_NULL ((io_object_t) 0) +#endif + +typedef IOCFPlugInInterface *io_cf_plugin_ref_t; +typedef IONotificationPortRef io_notification_port_t; + +/* private structures */ +struct darwin_device_priv { + IOUSBDeviceDescriptor dev_descriptor; + UInt32 location; + char sys_path[21]; + usb_device_t **device; + int open_count; + UInt8 first_config, active_config; +}; + +struct darwin_device_handle_priv { + int is_open; + CFRunLoopSourceRef cfSource; + int fds[2]; + + struct darwin_interface { + usb_interface_t **interface; + uint8_t num_endpoints; + CFRunLoopSourceRef cfSource; + uint64_t frames[256]; + uint8_t endpoint_addrs[USB_MAXENDPOINTS]; + } interfaces[USB_MAXINTERFACES]; +}; + +struct darwin_transfer_priv { + /* Isoc */ + IOUSBIsocFrame *isoc_framelist; + size_t num_iso_packets; + + /* Control */ +#if !defined (LIBUSB_NO_TIMEOUT_DEVICE) + IOUSBDevRequestTO req; +#else + IOUSBDevRequest req; +#endif + + /* Bulk */ +}; + +enum { + MESSAGE_DEVICE_GONE, + MESSAGE_ASYNC_IO_COMPLETE +}; + + + +#endif diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.c new file mode 100644 index 0000000..02d182d --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.c @@ -0,0 +1,2438 @@ +/* + * Linux usbfs backend for libusb + * Copyright (C) 2007-2009 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libusb.h" +#include "libusbi.h" +#include "linux_usbfs.h" + +/* sysfs vs usbfs: + * opening a usbfs node causes the device to be resumed, so we attempt to + * avoid this during enumeration. + * + * sysfs allows us to read the kernel's in-memory copies of device descriptors + * and so forth, avoiding the need to open the device: + * - The binary "descriptors" file was added in 2.6.23. + * - The "busnum" file was added in 2.6.22 + * - The "devnum" file has been present since pre-2.6.18 + * - the "bConfigurationValue" file has been present since pre-2.6.18 + * + * If we have bConfigurationValue, busnum, and devnum, then we can determine + * the active configuration without having to open the usbfs node in RDWR mode. + * We assume this is the case if we see the busnum file (indicates 2.6.22+). + * The busnum file is important as that is the only way we can relate sysfs + * devices to usbfs nodes. + * + * If we also have descriptors, we can obtain the device descriptor and active + * configuration without touching usbfs at all. + * + * The descriptors file originally only contained the active configuration + * descriptor alongside the device descriptor, but all configurations are + * included as of Linux 2.6.26. + */ + +/* endianness for multi-byte fields: + * + * Descriptors exposed by usbfs have the multi-byte fields in the device + * descriptor as host endian. Multi-byte fields in the other descriptors are + * bus-endian. The kernel documentation says otherwise, but it is wrong. + */ + +static const char *usbfs_path = NULL; + +/* use usbdev*.* device names in /dev instead of the usbfs bus directories */ +static int usbdev_names = 0; + +/* Linux 2.6.32 adds support for a bulk continuation URB flag. this basically + * allows us to mark URBs as being part of a specific logical transfer when + * we submit them to the kernel. then, on any error except a cancellation, all + * URBs within that transfer will be cancelled and no more URBs will be + * accepted for the transfer, meaning that no more data can creep in. + * + * The BULK_CONTINUATION flag must be set on all URBs within a bulk transfer + * (in either direction) except the first. + * For IN transfers, we must also set SHORT_NOT_OK on all URBs except the + * last; it means that the kernel should treat a short reply as an error. + * For OUT transfers, SHORT_NOT_OK must not be set. it isn't needed (OUT + * transfers can't be short unless there's already some sort of error), and + * setting this flag is disallowed (a kernel with USB debugging enabled will + * reject such URBs). + */ +static int supports_flag_bulk_continuation = -1; + +/* Linux 2.6.31 fixes support for the zero length packet URB flag. This + * allows us to mark URBs that should be followed by a zero length data + * packet, which can be required by device- or class-specific protocols. + */ +static int supports_flag_zero_packet = -1; + +/* clock ID for monotonic clock, as not all clock sources are available on all + * systems. appropriate choice made at initialization time. */ +static clockid_t monotonic_clkid = -1; + +/* do we have a busnum to relate devices? this also implies that we can read + * the active configuration through bConfigurationValue */ +static int sysfs_can_relate_devices = 0; + +/* do we have a descriptors file? */ +static int sysfs_has_descriptors = 0; + +struct linux_device_priv { + char *sysfs_dir; + unsigned char *dev_descriptor; + unsigned char *config_descriptor; +}; + +struct linux_device_handle_priv { + int fd; +}; + +enum reap_action { + NORMAL = 0, + /* submission failed after the first URB, so await cancellation/completion + * of all the others */ + SUBMIT_FAILED, + + /* cancelled by user or timeout */ + CANCELLED, + + /* completed multi-URB transfer in non-final URB */ + COMPLETED_EARLY, + + /* one or more urbs encountered a low-level error */ + ERROR, +}; + +struct linux_transfer_priv { + union { + struct usbfs_urb *urbs; + struct usbfs_urb **iso_urbs; + }; + + enum reap_action reap_action; + int num_urbs; + unsigned int num_retired; + enum libusb_transfer_status reap_status; + + /* next iso packet in user-supplied transfer to be populated */ + int iso_packet_offset; +}; + +static void _get_usbfs_path(struct libusb_device *dev, char *path) +{ + if (usbdev_names) + snprintf(path, PATH_MAX, "%s/usbdev%d.%d", + usbfs_path, dev->bus_number, dev->device_address); + else + snprintf(path, PATH_MAX, "%s/%03d/%03d", + usbfs_path, dev->bus_number, dev->device_address); +} + +static struct linux_device_priv *_device_priv(struct libusb_device *dev) +{ + return (struct linux_device_priv *) dev->os_priv; +} + +static struct linux_device_handle_priv *_device_handle_priv( + struct libusb_device_handle *handle) +{ + return (struct linux_device_handle_priv *) handle->os_priv; +} + +/* check dirent for a /dev/usbdev%d.%d name + * optionally return bus/device on success */ +static int _is_usbdev_entry(struct dirent *entry, int *bus_p, int *dev_p) +{ + int busnum, devnum; + + if (sscanf(entry->d_name, "usbdev%d.%d", &busnum, &devnum) != 2) + return 0; + + usbi_dbg("found: %s", entry->d_name); + if (bus_p != NULL) + *bus_p = busnum; + if (dev_p != NULL) + *dev_p = devnum; + return 1; +} + +static int check_usb_vfs(const char *dirname) +{ + DIR *dir; + struct dirent *entry; + int found = 0; + + dir = opendir(dirname); + if (!dir) + return 0; + + while ((entry = readdir(dir)) != NULL) { + if (entry->d_name[0] == '.') + continue; + + /* We assume if we find any files that it must be the right place */ + found = 1; + break; + } + + closedir(dir); + return found; +} + +static const char *find_usbfs_path(void) +{ + const char *path = "/dev/bus/usb"; + const char *ret = NULL; + + if (check_usb_vfs(path)) { + ret = path; + } else { + path = "/proc/bus/usb"; + if (check_usb_vfs(path)) + ret = path; + } + + /* look for /dev/usbdev*.* if the normal places fail */ + if (ret == NULL) { + struct dirent *entry; + DIR *dir; + + path = "/dev"; + dir = opendir(path); + if (dir != NULL) { + while ((entry = readdir(dir)) != NULL) { + if (_is_usbdev_entry(entry, NULL, NULL)) { + /* found one; that's enough */ + ret = path; + usbdev_names = 1; + break; + } + } + closedir(dir); + } + } + + if (ret != NULL) + usbi_dbg("found usbfs at %s", ret); + + return ret; +} + +/* the monotonic clock is not usable on all systems (e.g. embedded ones often + * seem to lack it). fall back to REALTIME if we have to. */ +static clockid_t find_monotonic_clock(void) +{ +#ifdef CLOCK_MONOTONIC + struct timespec ts; + int r; + + /* Linux 2.6.28 adds CLOCK_MONOTONIC_RAW but we don't use it + * because it's not available through timerfd */ + r = clock_gettime(CLOCK_MONOTONIC, &ts); + if (r == 0) + return CLOCK_MONOTONIC; + usbi_dbg("monotonic clock doesn't work, errno %d", errno); +#endif + + return CLOCK_REALTIME; +} + +static int kernel_version_ge(int major, int minor, int sublevel) +{ + struct utsname uts; + int atoms, kmajor, kminor, ksublevel; + + if (uname(&uts) < 0) + return -1; + atoms = sscanf(uts.release, "%d.%d.%d", &kmajor, &kminor, &ksublevel); + if (atoms < 1) + return -1; + + if (kmajor > major) + return 1; + if (kmajor < major) + return 0; + + /* kmajor == major */ + if (atoms < 2) + return 0 == minor && 0 == sublevel; + if (kminor > minor) + return 1; + if (kminor < minor) + return 0; + + /* kminor == minor */ + if (atoms < 3) + return 0 == sublevel; + + return ksublevel >= sublevel; +} + +/* Return 1 if filename exists inside dirname in sysfs. + SYSFS_DEVICE_PATH is assumed to be the beginning of the path. */ +static int sysfs_has_file(const char *dirname, const char *filename) +{ + struct stat statbuf; + char path[PATH_MAX]; + int r; + + snprintf(path, PATH_MAX, "%s/%s/%s", SYSFS_DEVICE_PATH, dirname, filename); + r = stat(path, &statbuf); + if (r == 0 && S_ISREG(statbuf.st_mode)) + return 1; + + return 0; +} + +static int op_init(struct libusb_context *ctx) +{ + struct stat statbuf; + int r; + + usbfs_path = find_usbfs_path(); + if (!usbfs_path) { + usbi_err(ctx, "could not find usbfs"); + return LIBUSB_ERROR_OTHER; + } + + if (monotonic_clkid == -1) + monotonic_clkid = find_monotonic_clock(); + + if (supports_flag_bulk_continuation == -1) { + /* bulk continuation URB flag available from Linux 2.6.32 */ + supports_flag_bulk_continuation = kernel_version_ge(2,6,32); + if (supports_flag_bulk_continuation == -1) { + usbi_err(ctx, "error checking for bulk continuation support"); + return LIBUSB_ERROR_OTHER; + } + } + + if (supports_flag_bulk_continuation) + usbi_dbg("bulk continuation flag supported"); + + if (-1 == supports_flag_zero_packet) { + /* zero length packet URB flag fixed since Linux 2.6.31 */ + supports_flag_zero_packet = kernel_version_ge(2,6,31); + if (-1 == supports_flag_zero_packet) { + usbi_err(ctx, "error checking for zero length packet support"); + return LIBUSB_ERROR_OTHER; + } + } + + if (supports_flag_zero_packet) + usbi_dbg("zero length packet flag supported"); + + r = stat(SYSFS_DEVICE_PATH, &statbuf); + if (r == 0 && S_ISDIR(statbuf.st_mode)) { + DIR *devices = opendir(SYSFS_DEVICE_PATH); + struct dirent *entry; + + usbi_dbg("found usb devices in sysfs"); + + if (!devices) { + usbi_err(ctx, "opendir devices failed errno=%d", errno); + return LIBUSB_ERROR_IO; + } + + /* Make sure sysfs supports all the required files. If it + * does not, then usbfs will be used instead. Determine + * this by looping through the directories in + * SYSFS_DEVICE_PATH. With the assumption that there will + * always be subdirectories of the name usbN (usb1, usb2, + * etc) representing the root hubs, check the usbN + * subdirectories to see if they have all the needed files. + * This algorithm uses the usbN subdirectories (root hubs) + * because a device disconnection will cause a race + * condition regarding which files are available, sometimes + * causing an incorrect result. The root hubs are used + * because it is assumed that they will always be present. + * See the "sysfs vs usbfs" comment at the top of this file + * for more details. */ + while ((entry = readdir(devices))) { + int has_busnum=0, has_devnum=0, has_descriptors=0; + int has_configuration_value=0; + + /* Only check the usbN directories. */ + if (strncmp(entry->d_name, "usb", 3) != 0) + continue; + + /* Check for the files libusb needs from sysfs. */ + has_busnum = sysfs_has_file(entry->d_name, "busnum"); + has_devnum = sysfs_has_file(entry->d_name, "devnum"); + has_descriptors = sysfs_has_file(entry->d_name, "descriptors"); + has_configuration_value = sysfs_has_file(entry->d_name, "bConfigurationValue"); + + if (has_busnum && has_devnum && has_configuration_value) + sysfs_can_relate_devices = 1; + if (has_descriptors) + sysfs_has_descriptors = 1; + + /* Only need to check until we've found ONE device which + has all the attributes. */ + if (sysfs_has_descriptors && sysfs_can_relate_devices) + break; + } + closedir(devices); + + /* Only use sysfs descriptors if the rest of + sysfs will work for libusb. */ + if (!sysfs_can_relate_devices) + sysfs_has_descriptors = 0; + } else { + usbi_dbg("sysfs usb info not available"); + sysfs_has_descriptors = 0; + sysfs_can_relate_devices = 0; + } + + return 0; +} + +static int usbfs_get_device_descriptor(struct libusb_device *dev, + unsigned char *buffer) +{ + struct linux_device_priv *priv = _device_priv(dev); + + /* return cached copy */ + memcpy(buffer, priv->dev_descriptor, DEVICE_DESC_LENGTH); + return 0; +} + +static int _open_sysfs_attr(struct libusb_device *dev, const char *attr) +{ + struct linux_device_priv *priv = _device_priv(dev); + char filename[PATH_MAX]; + int fd; + + snprintf(filename, PATH_MAX, "%s/%s/%s", + SYSFS_DEVICE_PATH, priv->sysfs_dir, attr); + fd = open(filename, O_RDONLY); + if (fd < 0) { + usbi_err(DEVICE_CTX(dev), + "open %s failed ret=%d errno=%d", filename, fd, errno); + return LIBUSB_ERROR_IO; + } + + return fd; +} + +/* Note only suitable for attributes which always read >= 0, < 0 is error */ +static int __read_sysfs_attr(struct libusb_context *ctx, + const char *devname, const char *attr) +{ + char filename[PATH_MAX]; + FILE *f; + int r, value; + + snprintf(filename, PATH_MAX, "%s/%s/%s", SYSFS_DEVICE_PATH, + devname, attr); + f = fopen(filename, "r"); + if (f == NULL) { + if (errno == ENOENT) { + /* File doesn't exist. Assume the device has been + disconnected (see trac ticket #70). */ + return LIBUSB_ERROR_NO_DEVICE; + } + usbi_err(ctx, "open %s failed errno=%d", filename, errno); + return LIBUSB_ERROR_IO; + } + + r = fscanf(f, "%d", &value); + fclose(f); + if (r != 1) { + usbi_err(ctx, "fscanf %s returned %d, errno=%d", attr, r, errno); + return LIBUSB_ERROR_NO_DEVICE; /* For unplug race (trac #70) */ + } + if (value < 0) { + usbi_err(ctx, "%s contains a negative value", filename); + return LIBUSB_ERROR_IO; + } + + return value; +} + +static int sysfs_get_device_descriptor(struct libusb_device *dev, + unsigned char *buffer) +{ + int fd; + ssize_t r; + + /* sysfs provides access to an in-memory copy of the device descriptor, + * so we use that rather than keeping our own copy */ + + fd = _open_sysfs_attr(dev, "descriptors"); + if (fd < 0) + return fd; + + r = read(fd, buffer, DEVICE_DESC_LENGTH);; + close(fd); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", fd, errno); + return LIBUSB_ERROR_IO; + } else if (r < DEVICE_DESC_LENGTH) { + usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, DEVICE_DESC_LENGTH); + return LIBUSB_ERROR_IO; + } + + return 0; +} + +static int op_get_device_descriptor(struct libusb_device *dev, + unsigned char *buffer, int *host_endian) +{ + if (sysfs_has_descriptors) { + return sysfs_get_device_descriptor(dev, buffer); + } else { + *host_endian = 1; + return usbfs_get_device_descriptor(dev, buffer); + } +} + +static int usbfs_get_active_config_descriptor(struct libusb_device *dev, + unsigned char *buffer, size_t len) +{ + struct linux_device_priv *priv = _device_priv(dev); + if (!priv->config_descriptor) + return LIBUSB_ERROR_NOT_FOUND; /* device is unconfigured */ + + /* retrieve cached copy */ + memcpy(buffer, priv->config_descriptor, len); + return 0; +} + +/* read the bConfigurationValue for a device */ +static int sysfs_get_active_config(struct libusb_device *dev, int *config) +{ + char *endptr; + char tmp[4] = {0, 0, 0, 0}; + long num; + int fd; + ssize_t r; + + fd = _open_sysfs_attr(dev, "bConfigurationValue"); + if (fd < 0) + return fd; + + r = read(fd, tmp, sizeof(tmp)); + close(fd); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), + "read bConfigurationValue failed ret=%d errno=%d", r, errno); + return LIBUSB_ERROR_IO; + } else if (r == 0) { + usbi_dbg("device unconfigured"); + *config = -1; + return 0; + } + + if (tmp[sizeof(tmp) - 1] != 0) { + usbi_err(DEVICE_CTX(dev), "not null-terminated?"); + return LIBUSB_ERROR_IO; + } else if (tmp[0] == 0) { + usbi_err(DEVICE_CTX(dev), "no configuration value?"); + return LIBUSB_ERROR_IO; + } + + num = strtol(tmp, &endptr, 10); + if (endptr == tmp) { + usbi_err(DEVICE_CTX(dev), "error converting '%s' to integer", tmp); + return LIBUSB_ERROR_IO; + } + + *config = (int) num; + return 0; +} + +/* takes a usbfs/descriptors fd seeked to the start of a configuration, and + * seeks to the next one. */ +static int seek_to_next_config(struct libusb_context *ctx, int fd, + int host_endian) +{ + struct libusb_config_descriptor config; + unsigned char tmp[6]; + off_t off; + ssize_t r; + + /* read first 6 bytes of descriptor */ + r = read(fd, tmp, sizeof(tmp)); + if (r < 0) { + usbi_err(ctx, "read failed ret=%d errno=%d", r, errno); + return LIBUSB_ERROR_IO; + } else if (r < sizeof(tmp)) { + usbi_err(ctx, "short descriptor read %d/%d", r, sizeof(tmp)); + return LIBUSB_ERROR_IO; + } + + /* seek forward to end of config */ + usbi_parse_descriptor(tmp, "bbwbb", &config, host_endian); + off = lseek(fd, config.wTotalLength - sizeof(tmp), SEEK_CUR); + if (off < 0) { + usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno); + return LIBUSB_ERROR_IO; + } + + return 0; +} + +static int sysfs_get_active_config_descriptor(struct libusb_device *dev, + unsigned char *buffer, size_t len) +{ + int fd; + ssize_t r; + off_t off; + int to_copy; + int config; + unsigned char tmp[6]; + + r = sysfs_get_active_config(dev, &config); + if (r < 0) + return r; + if (config == -1) + return LIBUSB_ERROR_NOT_FOUND; + + usbi_dbg("active configuration %d", config); + + /* sysfs provides access to an in-memory copy of the device descriptor, + * so we use that rather than keeping our own copy */ + + fd = _open_sysfs_attr(dev, "descriptors"); + if (fd < 0) + return fd; + + /* device might have been unconfigured since we read bConfigurationValue, + * so first check that there is any config descriptor data at all... */ + off = lseek(fd, 0, SEEK_END); + if (off < 1) { + usbi_err(DEVICE_CTX(dev), "end seek failed, ret=%d errno=%d", + off, errno); + close(fd); + return LIBUSB_ERROR_IO; + } else if (off == DEVICE_DESC_LENGTH) { + close(fd); + return LIBUSB_ERROR_NOT_FOUND; + } + + off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET); + if (off < 0) { + usbi_err(DEVICE_CTX(dev), "seek failed, ret=%d errno=%d", off, errno); + close(fd); + return LIBUSB_ERROR_IO; + } + + /* unbounded loop: we expect the descriptor to be present under all + * circumstances */ + while (1) { + r = read(fd, tmp, sizeof(tmp)); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", + fd, errno); + return LIBUSB_ERROR_IO; + } else if (r < sizeof(tmp)) { + usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, sizeof(tmp)); + return LIBUSB_ERROR_IO; + } + + /* check bConfigurationValue */ + if (tmp[5] == config) + break; + + /* try the next descriptor */ + off = lseek(fd, 0 - sizeof(tmp), SEEK_CUR); + if (off < 0) + return LIBUSB_ERROR_IO; + + r = seek_to_next_config(DEVICE_CTX(dev), fd, 0); + if (r < 0) + return r; + } + + to_copy = (len < sizeof(tmp)) ? len : sizeof(tmp); + memcpy(buffer, tmp, to_copy); + if (len > sizeof(tmp)) { + r = read(fd, buffer + sizeof(tmp), len - sizeof(tmp)); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), "read failed, ret=%d errno=%d", + fd, errno); + r = LIBUSB_ERROR_IO; + } else if (r == 0) { + usbi_dbg("device is unconfigured"); + r = LIBUSB_ERROR_NOT_FOUND; + } else if (r < len - sizeof(tmp)) { + usbi_err(DEVICE_CTX(dev), "short read %d/%d", r, len); + r = LIBUSB_ERROR_IO; + } + } else { + r = 0; + } + + close(fd); + return r; +} + +static int op_get_active_config_descriptor(struct libusb_device *dev, + unsigned char *buffer, size_t len, int *host_endian) +{ + if (sysfs_has_descriptors) { + return sysfs_get_active_config_descriptor(dev, buffer, len); + } else { + return usbfs_get_active_config_descriptor(dev, buffer, len); + } +} + +/* takes a usbfs fd, attempts to find the requested config and copy a certain + * amount of it into an output buffer. */ +static int get_config_descriptor(struct libusb_context *ctx, int fd, + uint8_t config_index, unsigned char *buffer, size_t len) +{ + off_t off; + ssize_t r; + + off = lseek(fd, DEVICE_DESC_LENGTH, SEEK_SET); + if (off < 0) { + usbi_err(ctx, "seek failed ret=%d errno=%d", off, errno); + return LIBUSB_ERROR_IO; + } + + /* might need to skip some configuration descriptors to reach the + * requested configuration */ + while (config_index > 0) { + r = seek_to_next_config(ctx, fd, 1); + if (r < 0) + return r; + config_index--; + } + + /* read the rest of the descriptor */ + r = read(fd, buffer, len); + if (r < 0) { + usbi_err(ctx, "read failed ret=%d errno=%d", r, errno); + return LIBUSB_ERROR_IO; + } else if (r < len) { + usbi_err(ctx, "short output read %d/%d", r, len); + return LIBUSB_ERROR_IO; + } + + return 0; +} + +static int op_get_config_descriptor(struct libusb_device *dev, + uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) +{ + char filename[PATH_MAX]; + int fd; + int r; + + /* always read from usbfs: sysfs only has the active descriptor + * this will involve waking the device up, but oh well! */ + + /* FIXME: the above is no longer true, new kernels have all descriptors + * in the descriptors file. but its kinda hard to detect if the kernel + * is sufficiently new. */ + + _get_usbfs_path(dev, filename); + fd = open(filename, O_RDONLY); + if (fd < 0) { + usbi_err(DEVICE_CTX(dev), + "open '%s' failed, ret=%d errno=%d", filename, fd, errno); + return LIBUSB_ERROR_IO; + } + + r = get_config_descriptor(DEVICE_CTX(dev), fd, config_index, buffer, len); + close(fd); + return r; +} + +/* cache the active config descriptor in memory. a value of -1 means that + * we aren't sure which one is active, so just assume the first one. + * only for usbfs. */ +static int cache_active_config(struct libusb_device *dev, int fd, + int active_config) +{ + struct linux_device_priv *priv = _device_priv(dev); + struct libusb_config_descriptor config; + unsigned char tmp[8]; + unsigned char *buf; + int idx; + int r; + + if (active_config == -1) { + idx = 0; + } else { + r = usbi_get_config_index_by_value(dev, active_config, &idx); + if (r < 0) + return r; + if (idx == -1) + return LIBUSB_ERROR_NOT_FOUND; + } + + r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, tmp, sizeof(tmp)); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), "first read error %d", r); + return r; + } + + usbi_parse_descriptor(tmp, "bbw", &config, 0); + buf = malloc(config.wTotalLength); + if (!buf) + return LIBUSB_ERROR_NO_MEM; + + r = get_config_descriptor(DEVICE_CTX(dev), fd, idx, buf, + config.wTotalLength); + if (r < 0) { + free(buf); + return r; + } + + if (priv->config_descriptor) + free(priv->config_descriptor); + priv->config_descriptor = buf; + return 0; +} + +/* send a control message to retrieve active configuration */ +static int usbfs_get_active_config(struct libusb_device *dev, int fd) +{ + unsigned char active_config = 0; + int r; + + struct usbfs_ctrltransfer ctrl = { + .bmRequestType = LIBUSB_ENDPOINT_IN, + .bRequest = LIBUSB_REQUEST_GET_CONFIGURATION, + .wValue = 0, + .wIndex = 0, + .wLength = 1, + .timeout = 1000, + .data = &active_config + }; + + r = ioctl(fd, IOCTL_USBFS_CONTROL, &ctrl); + if (r < 0) { + if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + /* we hit this error path frequently with buggy devices :( */ + usbi_warn(DEVICE_CTX(dev), + "get_configuration failed ret=%d errno=%d", r, errno); + return LIBUSB_ERROR_IO; + } + + return active_config; +} + +static int initialize_device(struct libusb_device *dev, uint8_t busnum, + uint8_t devaddr, const char *sysfs_dir) +{ + struct linux_device_priv *priv = _device_priv(dev); + unsigned char *dev_buf; + char path[PATH_MAX]; + int fd, speed; + int active_config = 0; + int device_configured = 1; + ssize_t r; + + dev->bus_number = busnum; + dev->device_address = devaddr; + + if (sysfs_dir) { + priv->sysfs_dir = malloc(strlen(sysfs_dir) + 1); + if (!priv->sysfs_dir) + return LIBUSB_ERROR_NO_MEM; + strcpy(priv->sysfs_dir, sysfs_dir); + + /* Note speed can contain 1.5, in this case __read_sysfs_attr + will stop parsing at the '.' and return 1 */ + speed = __read_sysfs_attr(DEVICE_CTX(dev), sysfs_dir, "speed"); + if (speed >= 0) { + switch (speed) { + case 1: dev->speed = LIBUSB_SPEED_LOW; break; + case 12: dev->speed = LIBUSB_SPEED_FULL; break; + case 480: dev->speed = LIBUSB_SPEED_HIGH; break; + case 5000: dev->speed = LIBUSB_SPEED_SUPER; break; + default: + usbi_warn(DEVICE_CTX(dev), "Unknown device speed: %d Mbps", speed); + } + } + } + + if (sysfs_has_descriptors) + return 0; + + /* cache device descriptor in memory so that we can retrieve it later + * without waking the device up (op_get_device_descriptor) */ + + priv->dev_descriptor = NULL; + priv->config_descriptor = NULL; + + if (sysfs_can_relate_devices) { + int tmp = sysfs_get_active_config(dev, &active_config); + if (tmp < 0) + return tmp; + if (active_config == -1) + device_configured = 0; + } + + _get_usbfs_path(dev, path); + fd = open(path, O_RDWR); + if (fd < 0 && errno == EACCES) { + fd = open(path, O_RDONLY); + /* if we only have read-only access to the device, we cannot + * send a control message to determine the active config. just + * assume the first one is active. */ + active_config = -1; + } + + if (fd < 0) { + usbi_err(DEVICE_CTX(dev), "open failed, ret=%d errno=%d", fd, errno); + return LIBUSB_ERROR_IO; + } + + if (!sysfs_can_relate_devices) { + if (active_config == -1) { + /* if we only have read-only access to the device, we cannot + * send a control message to determine the active config. just + * assume the first one is active. */ + usbi_warn(DEVICE_CTX(dev), "access to %s is read-only; cannot " + "determine active configuration descriptor", path); + } else { + active_config = usbfs_get_active_config(dev, fd); + if (active_config == LIBUSB_ERROR_IO) { + /* buggy devices sometimes fail to report their active config. + * assume unconfigured and continue the probing */ + usbi_warn(DEVICE_CTX(dev), "couldn't query active " + "configuration, assumung unconfigured"); + device_configured = 0; + } else if (active_config < 0) { + close(fd); + return active_config; + } else if (active_config == 0) { + /* some buggy devices have a configuration 0, but we're + * reaching into the corner of a corner case here, so let's + * not support buggy devices in these circumstances. + * stick to the specs: a configuration value of 0 means + * unconfigured. */ + usbi_dbg("active cfg 0? assuming unconfigured device"); + device_configured = 0; + } + } + } + + dev_buf = malloc(DEVICE_DESC_LENGTH); + if (!dev_buf) { + close(fd); + return LIBUSB_ERROR_NO_MEM; + } + + r = read(fd, dev_buf, DEVICE_DESC_LENGTH); + if (r < 0) { + usbi_err(DEVICE_CTX(dev), + "read descriptor failed ret=%d errno=%d", fd, errno); + free(dev_buf); + close(fd); + return LIBUSB_ERROR_IO; + } else if (r < DEVICE_DESC_LENGTH) { + usbi_err(DEVICE_CTX(dev), "short descriptor read (%d)", r); + free(dev_buf); + close(fd); + return LIBUSB_ERROR_IO; + } + + /* bit of a hack: set num_configurations now because cache_active_config() + * calls usbi_get_config_index_by_value() which uses it */ + dev->num_configurations = dev_buf[DEVICE_DESC_LENGTH - 1]; + + if (device_configured) { + r = cache_active_config(dev, fd, active_config); + if (r < 0) { + close(fd); + free(dev_buf); + return r; + } + } + + close(fd); + priv->dev_descriptor = dev_buf; + return 0; +} + +static int enumerate_device(struct libusb_context *ctx, + struct discovered_devs **_discdevs, uint8_t busnum, uint8_t devaddr, + const char *sysfs_dir) +{ + struct discovered_devs *discdevs; + unsigned long session_id; + int need_unref = 0; + struct libusb_device *dev; + int r = 0; + + /* FIXME: session ID is not guaranteed unique as addresses can wrap and + * will be reused. instead we should add a simple sysfs attribute with + * a session ID. */ + session_id = busnum << 8 | devaddr; + usbi_dbg("busnum %d devaddr %d session_id %ld", busnum, devaddr, + session_id); + + dev = usbi_get_device_by_session_id(ctx, session_id); + if (dev) { + usbi_dbg("using existing device for %d/%d (session %ld)", + busnum, devaddr, session_id); + } else { + usbi_dbg("allocating new device for %d/%d (session %ld)", + busnum, devaddr, session_id); + dev = usbi_alloc_device(ctx, session_id); + if (!dev) + return LIBUSB_ERROR_NO_MEM; + need_unref = 1; + r = initialize_device(dev, busnum, devaddr, sysfs_dir); + if (r < 0) + goto out; + r = usbi_sanitize_device(dev); + if (r < 0) + goto out; + } + + discdevs = discovered_devs_append(*_discdevs, dev); + if (!discdevs) + r = LIBUSB_ERROR_NO_MEM; + else + *_discdevs = discdevs; + +out: + if (need_unref) + libusb_unref_device(dev); + return r; +} + +/* open a bus directory and adds all discovered devices to discdevs. on + * failure (non-zero return) the pre-existing discdevs should be destroyed + * (and devices freed). on success, the new discdevs pointer should be used + * as it may have been moved. */ +static int usbfs_scan_busdir(struct libusb_context *ctx, + struct discovered_devs **_discdevs, uint8_t busnum) +{ + DIR *dir; + char dirpath[PATH_MAX]; + struct dirent *entry; + struct discovered_devs *discdevs = *_discdevs; + int r = LIBUSB_ERROR_IO; + + snprintf(dirpath, PATH_MAX, "%s/%03d", usbfs_path, busnum); + usbi_dbg("%s", dirpath); + dir = opendir(dirpath); + if (!dir) { + usbi_err(ctx, "opendir '%s' failed, errno=%d", dirpath, errno); + /* FIXME: should handle valid race conditions like hub unplugged + * during directory iteration - this is not an error */ + return r; + } + + while ((entry = readdir(dir))) { + int devaddr; + + if (entry->d_name[0] == '.') + continue; + + devaddr = atoi(entry->d_name); + if (devaddr == 0) { + usbi_dbg("unknown dir entry %s", entry->d_name); + continue; + } + + if (enumerate_device(ctx, &discdevs, busnum, (uint8_t) devaddr, NULL)) { + usbi_dbg("failed to enumerate dir entry %s", entry->d_name); + continue; + } + + r = 0; + } + + if (!r) + *_discdevs = discdevs; + closedir(dir); + return r; +} + +static int usbfs_get_device_list(struct libusb_context *ctx, + struct discovered_devs **_discdevs) +{ + struct dirent *entry; + DIR *buses = opendir(usbfs_path); + struct discovered_devs *discdevs = *_discdevs; + int r = 0; + + if (!buses) { + usbi_err(ctx, "opendir buses failed errno=%d", errno); + return LIBUSB_ERROR_IO; + } + + while ((entry = readdir(buses))) { + struct discovered_devs *discdevs_new = discdevs; + int busnum; + + if (entry->d_name[0] == '.') + continue; + + if (usbdev_names) { + int devaddr; + if (!_is_usbdev_entry(entry, &busnum, &devaddr)) + continue; + + r = enumerate_device(ctx, &discdevs_new, busnum, + (uint8_t) devaddr, NULL); + if (r < 0) { + usbi_dbg("failed to enumerate dir entry %s", entry->d_name); + continue; + } + } else { + busnum = atoi(entry->d_name); + if (busnum == 0) { + usbi_dbg("unknown dir entry %s", entry->d_name); + continue; + } + + r = usbfs_scan_busdir(ctx, &discdevs_new, busnum); + if (r < 0) + goto out; + } + discdevs = discdevs_new; + } + +out: + closedir(buses); + *_discdevs = discdevs; + return r; + +} + +static int sysfs_scan_device(struct libusb_context *ctx, + struct discovered_devs **_discdevs, const char *devname) +{ + int busnum; + int devaddr; + + usbi_dbg("scan %s", devname); + + busnum = __read_sysfs_attr(ctx, devname, "busnum"); + if (busnum < 0) + return busnum; + + devaddr = __read_sysfs_attr(ctx, devname, "devnum"); + if (devaddr < 0) + return devaddr; + + usbi_dbg("bus=%d dev=%d", busnum, devaddr); + if (busnum > 255 || devaddr > 255) + return LIBUSB_ERROR_INVALID_PARAM; + + return enumerate_device(ctx, _discdevs, busnum & 0xff, devaddr & 0xff, + devname); +} + +static int sysfs_get_device_list(struct libusb_context *ctx, + struct discovered_devs **_discdevs) +{ + struct discovered_devs *discdevs = *_discdevs; + DIR *devices = opendir(SYSFS_DEVICE_PATH); + struct dirent *entry; + int r = LIBUSB_ERROR_IO; + + if (!devices) { + usbi_err(ctx, "opendir devices failed errno=%d", errno); + return r; + } + + while ((entry = readdir(devices))) { + struct discovered_devs *discdevs_new = discdevs; + + if ((!isdigit(entry->d_name[0]) && strncmp(entry->d_name, "usb", 3)) + || strchr(entry->d_name, ':')) + continue; + + if (sysfs_scan_device(ctx, &discdevs_new, entry->d_name)) { + usbi_dbg("failed to enumerate dir entry %s", entry->d_name); + continue; + } + + r = 0; + discdevs = discdevs_new; + } + + if (!r) + *_discdevs = discdevs; + closedir(devices); + return r; +} + +static int op_get_device_list(struct libusb_context *ctx, + struct discovered_devs **_discdevs) +{ + /* we can retrieve device list and descriptors from sysfs or usbfs. + * sysfs is preferable, because if we use usbfs we end up resuming + * any autosuspended USB devices. however, sysfs is not available + * everywhere, so we need a usbfs fallback too. + * + * as described in the "sysfs vs usbfs" comment at the top of this + * file, sometimes we have sysfs but not enough information to + * relate sysfs devices to usbfs nodes. op_init() determines the + * adequacy of sysfs and sets sysfs_can_relate_devices. + */ + if (sysfs_can_relate_devices != 0) + return sysfs_get_device_list(ctx, _discdevs); + else + return usbfs_get_device_list(ctx, _discdevs); +} + +static int op_open(struct libusb_device_handle *handle) +{ + struct linux_device_handle_priv *hpriv = _device_handle_priv(handle); + char filename[PATH_MAX]; + + _get_usbfs_path(handle->dev, filename); + usbi_dbg("opening %s", filename); + hpriv->fd = open(filename, O_RDWR); + if (hpriv->fd < 0) { + if (errno == EACCES) { + usbi_err(HANDLE_CTX(handle), "libusb couldn't open USB device %s: " + "Permission denied.", filename); + usbi_err(HANDLE_CTX(handle), + "libusb requires write access to USB device nodes."); + return LIBUSB_ERROR_ACCESS; + } else if (errno == ENOENT) { + usbi_err(HANDLE_CTX(handle), "libusb couldn't open USB device %s: " + "No such file or directory.", filename); + return LIBUSB_ERROR_NO_DEVICE; + } else { + usbi_err(HANDLE_CTX(handle), + "open failed, code %d errno %d", hpriv->fd, errno); + return LIBUSB_ERROR_IO; + } + } + + return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT); +} + +static void op_close(struct libusb_device_handle *dev_handle) +{ + int fd = _device_handle_priv(dev_handle)->fd; + usbi_remove_pollfd(HANDLE_CTX(dev_handle), fd); + close(fd); +} + +static int op_get_configuration(struct libusb_device_handle *handle, + int *config) +{ + int r; + if (sysfs_can_relate_devices != 1) + return LIBUSB_ERROR_NOT_SUPPORTED; + + r = sysfs_get_active_config(handle->dev, config); + if (r < 0) + return r; + + if (*config == -1) { + usbi_err(HANDLE_CTX(handle), "device unconfigured"); + *config = 0; + } + + return 0; +} + +static int op_set_configuration(struct libusb_device_handle *handle, int config) +{ + struct linux_device_priv *priv = _device_priv(handle->dev); + int fd = _device_handle_priv(handle)->fd; + int r = ioctl(fd, IOCTL_USBFS_SETCONFIG, &config); + if (r) { + if (errno == EINVAL) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == EBUSY) + return LIBUSB_ERROR_BUSY; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), "failed, error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + + if (!sysfs_has_descriptors) { + /* update our cached active config descriptor */ + if (config == -1) { + if (priv->config_descriptor) { + free(priv->config_descriptor); + priv->config_descriptor = NULL; + } + } else { + r = cache_active_config(handle->dev, fd, config); + if (r < 0) + usbi_warn(HANDLE_CTX(handle), + "failed to update cached config descriptor, error %d", r); + } + } + + return 0; +} + +static int op_claim_interface(struct libusb_device_handle *handle, int iface) +{ + int fd = _device_handle_priv(handle)->fd; + int r = ioctl(fd, IOCTL_USBFS_CLAIMINTF, &iface); + if (r) { + if (errno == ENOENT) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == EBUSY) + return LIBUSB_ERROR_BUSY; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "claim interface failed, error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + return 0; +} + +static int op_release_interface(struct libusb_device_handle *handle, int iface) +{ + int fd = _device_handle_priv(handle)->fd; + int r = ioctl(fd, IOCTL_USBFS_RELEASEINTF, &iface); + if (r) { + if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "release interface failed, error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + return 0; +} + +static int op_set_interface(struct libusb_device_handle *handle, int iface, + int altsetting) +{ + int fd = _device_handle_priv(handle)->fd; + struct usbfs_setinterface setintf; + int r; + + setintf.interface = iface; + setintf.altsetting = altsetting; + r = ioctl(fd, IOCTL_USBFS_SETINTF, &setintf); + if (r) { + if (errno == EINVAL) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "setintf failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + + return 0; +} + +static int op_clear_halt(struct libusb_device_handle *handle, + unsigned char endpoint) +{ + int fd = _device_handle_priv(handle)->fd; + unsigned int _endpoint = endpoint; + int r = ioctl(fd, IOCTL_USBFS_CLEAR_HALT, &_endpoint); + if (r) { + if (errno == ENOENT) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "clear_halt failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + + return 0; +} + +static int op_reset_device(struct libusb_device_handle *handle) +{ + int fd = _device_handle_priv(handle)->fd; + int i, r, ret = 0; + + /* Doing a device reset will cause the usbfs driver to get unbound + from any interfaces it is bound to. By voluntarily unbinding + the usbfs driver ourself, we stop the kernel from rebinding + the interface after reset (which would end up with the interface + getting bound to the in kernel driver if any). */ + for (i = 0; i < USB_MAXINTERFACES; i++) { + if (handle->claimed_interfaces & (1L << i)) { + op_release_interface(handle, i); + } + } + + usbi_mutex_lock(&handle->lock); + r = ioctl(fd, IOCTL_USBFS_RESET, NULL); + if (r) { + if (errno == ENODEV) { + ret = LIBUSB_ERROR_NOT_FOUND; + goto out; + } + + usbi_err(HANDLE_CTX(handle), + "reset failed error %d errno %d", r, errno); + ret = LIBUSB_ERROR_OTHER; + goto out; + } + + /* And re-claim any interfaces which were claimed before the reset */ + for (i = 0; i < USB_MAXINTERFACES; i++) { + if (handle->claimed_interfaces & (1L << i)) { + r = op_claim_interface(handle, i); + if (r) { + usbi_warn(HANDLE_CTX(handle), + "failed to re-claim interface %d after reset", i); + handle->claimed_interfaces &= ~(1L << i); + } + } + } +out: + usbi_mutex_unlock(&handle->lock); + return ret; +} + +static int op_kernel_driver_active(struct libusb_device_handle *handle, + int interface) +{ + int fd = _device_handle_priv(handle)->fd; + struct usbfs_getdriver getdrv; + int r; + + getdrv.interface = interface; + r = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv); + if (r) { + if (errno == ENODATA) + return 0; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "get driver failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + + return 1; +} + +static int op_detach_kernel_driver(struct libusb_device_handle *handle, + int interface) +{ + int fd = _device_handle_priv(handle)->fd; + struct usbfs_ioctl command; + int r; + + command.ifno = interface; + command.ioctl_code = IOCTL_USBFS_DISCONNECT; + command.data = NULL; + + r = ioctl(fd, IOCTL_USBFS_IOCTL, &command); + if (r) { + if (errno == ENODATA) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == EINVAL) + return LIBUSB_ERROR_INVALID_PARAM; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), + "detach failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } + + return 0; +} + +static int op_attach_kernel_driver(struct libusb_device_handle *handle, + int interface) +{ + int fd = _device_handle_priv(handle)->fd; + struct usbfs_ioctl command; + int r; + + command.ifno = interface; + command.ioctl_code = IOCTL_USBFS_CONNECT; + command.data = NULL; + + r = ioctl(fd, IOCTL_USBFS_IOCTL, &command); + if (r < 0) { + if (errno == ENODATA) + return LIBUSB_ERROR_NOT_FOUND; + else if (errno == EINVAL) + return LIBUSB_ERROR_INVALID_PARAM; + else if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + else if (errno == EBUSY) + return LIBUSB_ERROR_BUSY; + + usbi_err(HANDLE_CTX(handle), + "attach failed error %d errno %d", r, errno); + return LIBUSB_ERROR_OTHER; + } else if (r == 0) { + return LIBUSB_ERROR_NOT_FOUND; + } + + return 0; +} + +static void op_destroy_device(struct libusb_device *dev) +{ + struct linux_device_priv *priv = _device_priv(dev); + if (!sysfs_has_descriptors) { + if (priv->dev_descriptor) + free(priv->dev_descriptor); + if (priv->config_descriptor) + free(priv->config_descriptor); + } + if (priv->sysfs_dir) + free(priv->sysfs_dir); +} + +/* URBs are discarded in reverse order of submission to avoid races. */ +static int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plus_one) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_transfer_priv *tpriv = + usbi_transfer_get_os_priv(itransfer); + struct linux_device_handle_priv *dpriv = + _device_handle_priv(transfer->dev_handle); + int i, ret = 0; + struct usbfs_urb *urb; + + for (i = last_plus_one - 1; i >= first; i--) { + if (LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type) + urb = tpriv->iso_urbs[i]; + else + urb = &tpriv->urbs[i]; + + if (0 == ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, urb)) + continue; + + if (EINVAL == errno) { + usbi_dbg("URB not found --> assuming ready to be reaped"); + if (i == (last_plus_one - 1)) + ret = LIBUSB_ERROR_NOT_FOUND; + } else if (ENODEV == errno) { + usbi_dbg("Device not found for URB --> assuming ready to be reaped"); + ret = LIBUSB_ERROR_NO_DEVICE; + } else { + usbi_warn(TRANSFER_CTX(transfer), + "unrecognised discard errno %d", errno); + ret = LIBUSB_ERROR_OTHER; + } + } + return ret; +} + +static void free_iso_urbs(struct linux_transfer_priv *tpriv) +{ + int i; + for (i = 0; i < tpriv->num_urbs; i++) { + struct usbfs_urb *urb = tpriv->iso_urbs[i]; + if (!urb) + break; + free(urb); + } + + free(tpriv->iso_urbs); + tpriv->iso_urbs = NULL; +} + +static int submit_bulk_transfer(struct usbi_transfer *itransfer, + unsigned char urb_type) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct linux_device_handle_priv *dpriv = + _device_handle_priv(transfer->dev_handle); + struct usbfs_urb *urbs; + int is_out = (transfer->endpoint & LIBUSB_ENDPOINT_DIR_MASK) + == LIBUSB_ENDPOINT_OUT; + int r; + int i; + size_t alloc_size; + + if (tpriv->urbs) + return LIBUSB_ERROR_BUSY; + + if (is_out && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET && + !supports_flag_zero_packet) + return LIBUSB_ERROR_NOT_SUPPORTED; + + /* usbfs places a 16kb limit on bulk URBs. we divide up larger requests + * into smaller units to meet such restriction, then fire off all the + * units at once. it would be simpler if we just fired one unit at a time, + * but there is a big performance gain through doing it this way. */ + int num_urbs = transfer->length / MAX_BULK_BUFFER_LENGTH; + int last_urb_partial = 0; + + if (transfer->length == 0) { + num_urbs = 1; + } else if ((transfer->length % MAX_BULK_BUFFER_LENGTH) > 0) { + last_urb_partial = 1; + num_urbs++; + } + usbi_dbg("need %d urbs for new transfer with length %d", num_urbs, + transfer->length); + alloc_size = num_urbs * sizeof(struct usbfs_urb); + urbs = malloc(alloc_size); + if (!urbs) + return LIBUSB_ERROR_NO_MEM; + memset(urbs, 0, alloc_size); + tpriv->urbs = urbs; + tpriv->num_urbs = num_urbs; + tpriv->num_retired = 0; + tpriv->reap_action = NORMAL; + tpriv->reap_status = LIBUSB_TRANSFER_COMPLETED; + + for (i = 0; i < num_urbs; i++) { + struct usbfs_urb *urb = &urbs[i]; + urb->usercontext = itransfer; + urb->type = urb_type; + urb->endpoint = transfer->endpoint; + urb->buffer = transfer->buffer + (i * MAX_BULK_BUFFER_LENGTH); + if (supports_flag_bulk_continuation && !is_out) + urb->flags = USBFS_URB_SHORT_NOT_OK; + if (i == num_urbs - 1 && last_urb_partial) + urb->buffer_length = transfer->length % MAX_BULK_BUFFER_LENGTH; + else if (transfer->length == 0) + urb->buffer_length = 0; + else + urb->buffer_length = MAX_BULK_BUFFER_LENGTH; + + if (i > 0 && supports_flag_bulk_continuation) + urb->flags |= USBFS_URB_BULK_CONTINUATION; + + /* we have already checked that the flag is supported */ + if (is_out && i == num_urbs - 1 && + transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) + urb->flags |= USBFS_URB_ZERO_PACKET; + + r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb); + if (r < 0) { + if (errno == ENODEV) { + r = LIBUSB_ERROR_NO_DEVICE; + } else { + usbi_err(TRANSFER_CTX(transfer), + "submiturb failed error %d errno=%d", r, errno); + r = LIBUSB_ERROR_IO; + } + + /* if the first URB submission fails, we can simply free up and + * return failure immediately. */ + if (i == 0) { + usbi_dbg("first URB failed, easy peasy"); + free(urbs); + tpriv->urbs = NULL; + return r; + } + + /* if it's not the first URB that failed, the situation is a bit + * tricky. we may need to discard all previous URBs. there are + * complications: + * - discarding is asynchronous - discarded urbs will be reaped + * later. the user must not have freed the transfer when the + * discarded URBs are reaped, otherwise libusb will be using + * freed memory. + * - the earlier URBs may have completed successfully and we do + * not want to throw away any data. + * - this URB failing may be no error; EREMOTEIO means that + * this transfer simply didn't need all the URBs we submitted + * so, we report that the transfer was submitted successfully and + * in case of error we discard all previous URBs. later when + * the final reap completes we can report error to the user, + * or success if an earlier URB was completed successfully. + */ + tpriv->reap_action = EREMOTEIO == errno ? COMPLETED_EARLY : SUBMIT_FAILED; + + /* The URBs we haven't submitted yet we count as already + * retired. */ + tpriv->num_retired += num_urbs - i; + + /* If we completed short then don't try to discard. */ + if (COMPLETED_EARLY == tpriv->reap_action) + return 0; + + discard_urbs(itransfer, 0, i); + + usbi_dbg("reporting successful submission but waiting for %d " + "discards before reporting error", i); + return 0; + } + } + + return 0; +} + +static int submit_iso_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct linux_device_handle_priv *dpriv = + _device_handle_priv(transfer->dev_handle); + struct usbfs_urb **urbs; + size_t alloc_size; + int num_packets = transfer->num_iso_packets; + int i; + int this_urb_len = 0; + int num_urbs = 1; + int packet_offset = 0; + unsigned int packet_len; + unsigned char *urb_buffer = transfer->buffer; + + if (tpriv->iso_urbs) + return LIBUSB_ERROR_BUSY; + + /* usbfs places a 32kb limit on iso URBs. we divide up larger requests + * into smaller units to meet such restriction, then fire off all the + * units at once. it would be simpler if we just fired one unit at a time, + * but there is a big performance gain through doing it this way. */ + + /* calculate how many URBs we need */ + for (i = 0; i < num_packets; i++) { + int space_remaining = MAX_ISO_BUFFER_LENGTH - this_urb_len; + packet_len = transfer->iso_packet_desc[i].length; + + if (packet_len > space_remaining) { + num_urbs++; + this_urb_len = packet_len; + } else { + this_urb_len += packet_len; + } + } + usbi_dbg("need %d 32k URBs for transfer", num_urbs); + + alloc_size = num_urbs * sizeof(*urbs); + urbs = malloc(alloc_size); + if (!urbs) + return LIBUSB_ERROR_NO_MEM; + memset(urbs, 0, alloc_size); + + tpriv->iso_urbs = urbs; + tpriv->num_urbs = num_urbs; + tpriv->num_retired = 0; + tpriv->reap_action = NORMAL; + tpriv->iso_packet_offset = 0; + + /* allocate + initialize each URB with the correct number of packets */ + for (i = 0; i < num_urbs; i++) { + struct usbfs_urb *urb; + int space_remaining_in_urb = MAX_ISO_BUFFER_LENGTH; + int urb_packet_offset = 0; + unsigned char *urb_buffer_orig = urb_buffer; + int j; + int k; + + /* swallow up all the packets we can fit into this URB */ + while (packet_offset < transfer->num_iso_packets) { + packet_len = transfer->iso_packet_desc[packet_offset].length; + if (packet_len <= space_remaining_in_urb) { + /* throw it in */ + urb_packet_offset++; + packet_offset++; + space_remaining_in_urb -= packet_len; + urb_buffer += packet_len; + } else { + /* it can't fit, save it for the next URB */ + break; + } + } + + alloc_size = sizeof(*urb) + + (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc)); + urb = malloc(alloc_size); + if (!urb) { + free_iso_urbs(tpriv); + return LIBUSB_ERROR_NO_MEM; + } + memset(urb, 0, alloc_size); + urbs[i] = urb; + + /* populate packet lengths */ + for (j = 0, k = packet_offset - urb_packet_offset; + k < packet_offset; k++, j++) { + packet_len = transfer->iso_packet_desc[k].length; + urb->iso_frame_desc[j].length = packet_len; + } + + urb->usercontext = itransfer; + urb->type = USBFS_URB_TYPE_ISO; + /* FIXME: interface for non-ASAP data? */ + urb->flags = USBFS_URB_ISO_ASAP; + urb->endpoint = transfer->endpoint; + urb->number_of_packets = urb_packet_offset; + urb->buffer = urb_buffer_orig; + } + + /* submit URBs */ + for (i = 0; i < num_urbs; i++) { + int r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]); + if (r < 0) { + if (errno == ENODEV) { + r = LIBUSB_ERROR_NO_DEVICE; + } else { + usbi_err(TRANSFER_CTX(transfer), + "submiturb failed error %d errno=%d", r, errno); + r = LIBUSB_ERROR_IO; + } + + /* if the first URB submission fails, we can simply free up and + * return failure immediately. */ + if (i == 0) { + usbi_dbg("first URB failed, easy peasy"); + free_iso_urbs(tpriv); + return r; + } + + /* if it's not the first URB that failed, the situation is a bit + * tricky. we must discard all previous URBs. there are + * complications: + * - discarding is asynchronous - discarded urbs will be reaped + * later. the user must not have freed the transfer when the + * discarded URBs are reaped, otherwise libusb will be using + * freed memory. + * - the earlier URBs may have completed successfully and we do + * not want to throw away any data. + * so, in this case we discard all the previous URBs BUT we report + * that the transfer was submitted successfully. then later when + * the final discard completes we can report error to the user. + */ + tpriv->reap_action = SUBMIT_FAILED; + + /* The URBs we haven't submitted yet we count as already + * retired. */ + tpriv->num_retired = num_urbs - i; + discard_urbs(itransfer, 0, i); + + usbi_dbg("reporting successful submission but waiting for %d " + "discards before reporting error", i); + return 0; + } + } + + return 0; +} + +static int submit_control_transfer(struct usbi_transfer *itransfer) +{ + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_device_handle_priv *dpriv = + _device_handle_priv(transfer->dev_handle); + struct usbfs_urb *urb; + int r; + + if (tpriv->urbs) + return LIBUSB_ERROR_BUSY; + + if (transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH) + return LIBUSB_ERROR_INVALID_PARAM; + + urb = malloc(sizeof(struct usbfs_urb)); + if (!urb) + return LIBUSB_ERROR_NO_MEM; + memset(urb, 0, sizeof(struct usbfs_urb)); + tpriv->urbs = urb; + tpriv->num_urbs = 1; + tpriv->reap_action = NORMAL; + + urb->usercontext = itransfer; + urb->type = USBFS_URB_TYPE_CONTROL; + urb->endpoint = transfer->endpoint; + urb->buffer = transfer->buffer; + urb->buffer_length = transfer->length; + + r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb); + if (r < 0) { + free(urb); + tpriv->urbs = NULL; + if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(TRANSFER_CTX(transfer), + "submiturb failed error %d errno=%d", r, errno); + return LIBUSB_ERROR_IO; + } + return 0; +} + +static int op_submit_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + return submit_control_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK: + return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK); + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + return submit_bulk_transfer(itransfer, USBFS_URB_TYPE_INTERRUPT); + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return submit_iso_transfer(itransfer); + default: + usbi_err(TRANSFER_CTX(transfer), + "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +static int op_cancel_transfer(struct usbi_transfer *itransfer) +{ + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_BULK: + if (tpriv->reap_action == ERROR) + break; + /* else, fall through */ + case LIBUSB_TRANSFER_TYPE_CONTROL: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + tpriv->reap_action = CANCELLED; + break; + default: + usbi_err(TRANSFER_CTX(transfer), + "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } + + if (!tpriv->urbs) + return LIBUSB_ERROR_NOT_FOUND; + + return discard_urbs(itransfer, 0, tpriv->num_urbs); +} + +static void op_clear_transfer_priv(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + + /* urbs can be freed also in submit_transfer so lock mutex first */ + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + usbi_mutex_lock(&itransfer->lock); + if (tpriv->urbs) + free(tpriv->urbs); + tpriv->urbs = NULL; + usbi_mutex_unlock(&itransfer->lock); + break; + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + usbi_mutex_lock(&itransfer->lock); + if (tpriv->iso_urbs) + free_iso_urbs(tpriv); + usbi_mutex_unlock(&itransfer->lock); + break; + default: + usbi_err(TRANSFER_CTX(transfer), + "unknown endpoint type %d", transfer->type); + } +} + +static int handle_bulk_completion(struct usbi_transfer *itransfer, + struct usbfs_urb *urb) +{ + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + int urb_idx = urb - tpriv->urbs; + + usbi_mutex_lock(&itransfer->lock); + usbi_dbg("handling completion status %d of bulk urb %d/%d", urb->status, + urb_idx + 1, tpriv->num_urbs); + + tpriv->num_retired++; + + if (tpriv->reap_action != NORMAL) { + /* cancelled, submit_fail, or completed early */ + usbi_dbg("abnormal reap: urb status %d", urb->status); + + /* even though we're in the process of cancelling, it's possible that + * we may receive some data in these URBs that we don't want to lose. + * examples: + * 1. while the kernel is cancelling all the packets that make up an + * URB, a few of them might complete. so we get back a successful + * cancellation *and* some data. + * 2. we receive a short URB which marks the early completion condition, + * so we start cancelling the remaining URBs. however, we're too + * slow and another URB completes (or at least completes partially). + * (this can't happen since we always use BULK_CONTINUATION.) + * + * When this happens, our objectives are not to lose any "surplus" data, + * and also to stick it at the end of the previously-received data + * (closing any holes), so that libusb reports the total amount of + * transferred data and presents it in a contiguous chunk. + */ + if (urb->actual_length > 0) { + unsigned char *target = transfer->buffer + itransfer->transferred; + usbi_dbg("received %d bytes of surplus data", urb->actual_length); + if (urb->buffer != target) { + usbi_dbg("moving surplus data from offset %d to offset %d", + (unsigned char *) urb->buffer - transfer->buffer, + target - transfer->buffer); + memmove(target, urb->buffer, urb->actual_length); + } + itransfer->transferred += urb->actual_length; + } + + if (tpriv->num_retired == tpriv->num_urbs) { + usbi_dbg("abnormal reap: last URB handled, reporting"); + if (tpriv->reap_action != COMPLETED_EARLY && + tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED) + tpriv->reap_status = LIBUSB_TRANSFER_ERROR; + goto completed; + } + goto out_unlock; + } + + itransfer->transferred += urb->actual_length; + + /* Many of these errors can occur on *any* urb of a multi-urb + * transfer. When they do, we tear down the rest of the transfer. + */ + switch (urb->status) { + case 0: + break; + case -EREMOTEIO: /* short transfer */ + break; + case -ENOENT: /* cancelled */ + case -ECONNRESET: + break; + case -ENODEV: + case -ESHUTDOWN: + usbi_dbg("device removed"); + tpriv->reap_status = LIBUSB_TRANSFER_NO_DEVICE; + goto cancel_remaining; + case -EPIPE: + usbi_dbg("detected endpoint stall"); + if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED) + tpriv->reap_status = LIBUSB_TRANSFER_STALL; + goto cancel_remaining; + case -EOVERFLOW: + /* overflow can only ever occur in the last urb */ + usbi_dbg("overflow, actual_length=%d", urb->actual_length); + if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED) + tpriv->reap_status = LIBUSB_TRANSFER_OVERFLOW; + goto completed; + case -ETIME: + case -EPROTO: + case -EILSEQ: + case -ECOMM: + case -ENOSR: + usbi_dbg("low level error %d", urb->status); + tpriv->reap_action = ERROR; + goto cancel_remaining; + default: + usbi_warn(ITRANSFER_CTX(itransfer), + "unrecognised urb status %d", urb->status); + tpriv->reap_action = ERROR; + goto cancel_remaining; + } + + /* if we're the last urb or we got less data than requested then we're + * done */ + if (urb_idx == tpriv->num_urbs - 1) { + usbi_dbg("last URB in transfer --> complete!"); + goto completed; + } else if (urb->actual_length < urb->buffer_length) { + usbi_dbg("short transfer %d/%d --> complete!", + urb->actual_length, urb->buffer_length); + if (tpriv->reap_action == NORMAL) + tpriv->reap_action = COMPLETED_EARLY; + } else + goto out_unlock; + +cancel_remaining: + if (ERROR == tpriv->reap_action && LIBUSB_TRANSFER_COMPLETED == tpriv->reap_status) + tpriv->reap_status = LIBUSB_TRANSFER_ERROR; + + if (tpriv->num_retired == tpriv->num_urbs) /* nothing to cancel */ + goto completed; + + /* cancel remaining urbs and wait for their completion before + * reporting results */ + discard_urbs(itransfer, urb_idx + 1, tpriv->num_urbs); + +out_unlock: + usbi_mutex_unlock(&itransfer->lock); + return 0; + +completed: + free(tpriv->urbs); + tpriv->urbs = NULL; + usbi_mutex_unlock(&itransfer->lock); + return CANCELLED == tpriv->reap_action ? + usbi_handle_transfer_cancellation(itransfer) : + usbi_handle_transfer_completion(itransfer, tpriv->reap_status); +} + +static int handle_iso_completion(struct usbi_transfer *itransfer, + struct usbfs_urb *urb) +{ + struct libusb_transfer *transfer = + USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + int num_urbs = tpriv->num_urbs; + int urb_idx = 0; + int i; + enum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED; + + usbi_mutex_lock(&itransfer->lock); + for (i = 0; i < num_urbs; i++) { + if (urb == tpriv->iso_urbs[i]) { + urb_idx = i + 1; + break; + } + } + if (urb_idx == 0) { + usbi_err(TRANSFER_CTX(transfer), "could not locate urb!"); + usbi_mutex_unlock(&itransfer->lock); + return LIBUSB_ERROR_NOT_FOUND; + } + + usbi_dbg("handling completion status %d of iso urb %d/%d", urb->status, + urb_idx, num_urbs); + + /* copy isochronous results back in */ + + for (i = 0; i < urb->number_of_packets; i++) { + struct usbfs_iso_packet_desc *urb_desc = &urb->iso_frame_desc[i]; + struct libusb_iso_packet_descriptor *lib_desc = + &transfer->iso_packet_desc[tpriv->iso_packet_offset++]; + lib_desc->status = LIBUSB_TRANSFER_COMPLETED; + switch (urb_desc->status) { + case 0: + break; + case -ENOENT: /* cancelled */ + case -ECONNRESET: + break; + case -ENODEV: + case -ESHUTDOWN: + usbi_dbg("device removed"); + lib_desc->status = LIBUSB_TRANSFER_NO_DEVICE; + break; + case -EPIPE: + usbi_dbg("detected endpoint stall"); + lib_desc->status = LIBUSB_TRANSFER_STALL; + break; + case -EOVERFLOW: + usbi_dbg("overflow error"); + lib_desc->status = LIBUSB_TRANSFER_OVERFLOW; + break; + case -ETIME: + case -EPROTO: + case -EILSEQ: + case -ECOMM: + case -ENOSR: + case -EXDEV: + usbi_dbg("low-level USB error %d", urb_desc->status); + lib_desc->status = LIBUSB_TRANSFER_ERROR; + break; + default: + usbi_warn(TRANSFER_CTX(transfer), + "unrecognised urb status %d", urb_desc->status); + lib_desc->status = LIBUSB_TRANSFER_ERROR; + break; + } + lib_desc->actual_length = urb_desc->actual_length; + } + + tpriv->num_retired++; + + if (tpriv->reap_action != NORMAL) { /* cancelled or submit_fail */ + usbi_dbg("CANCEL: urb status %d", urb->status); + + if (tpriv->num_retired == num_urbs) { + usbi_dbg("CANCEL: last URB handled, reporting"); + free_iso_urbs(tpriv); + if (tpriv->reap_action == CANCELLED) { + usbi_mutex_unlock(&itransfer->lock); + return usbi_handle_transfer_cancellation(itransfer); + } else { + usbi_mutex_unlock(&itransfer->lock); + return usbi_handle_transfer_completion(itransfer, + LIBUSB_TRANSFER_ERROR); + } + } + goto out; + } + + switch (urb->status) { + case 0: + break; + case -ENOENT: /* cancelled */ + case -ECONNRESET: + break; + case -ESHUTDOWN: + usbi_dbg("device removed"); + status = LIBUSB_TRANSFER_NO_DEVICE; + break; + default: + usbi_warn(TRANSFER_CTX(transfer), + "unrecognised urb status %d", urb->status); + status = LIBUSB_TRANSFER_ERROR; + break; + } + + /* if we're the last urb then we're done */ + if (urb_idx == num_urbs) { + usbi_dbg("last URB in transfer --> complete!"); + free_iso_urbs(tpriv); + usbi_mutex_unlock(&itransfer->lock); + return usbi_handle_transfer_completion(itransfer, status); + } + +out: + usbi_mutex_unlock(&itransfer->lock); + return 0; +} + +static int handle_control_completion(struct usbi_transfer *itransfer, + struct usbfs_urb *urb) +{ + struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer); + int status; + + usbi_mutex_lock(&itransfer->lock); + usbi_dbg("handling completion status %d", urb->status); + + itransfer->transferred += urb->actual_length; + + if (tpriv->reap_action == CANCELLED) { + if (urb->status != 0 && urb->status != -ENOENT) + usbi_warn(ITRANSFER_CTX(itransfer), + "cancel: unrecognised urb status %d", urb->status); + free(tpriv->urbs); + tpriv->urbs = NULL; + usbi_mutex_unlock(&itransfer->lock); + return usbi_handle_transfer_cancellation(itransfer); + } + + switch (urb->status) { + case 0: + status = LIBUSB_TRANSFER_COMPLETED; + break; + case -ENOENT: /* cancelled */ + status = LIBUSB_TRANSFER_CANCELLED; + break; + case -ENODEV: + case -ESHUTDOWN: + usbi_dbg("device removed"); + status = LIBUSB_TRANSFER_NO_DEVICE; + break; + case -EPIPE: + usbi_dbg("unsupported control request"); + status = LIBUSB_TRANSFER_STALL; + break; + case -EOVERFLOW: + usbi_dbg("control overflow error"); + status = LIBUSB_TRANSFER_OVERFLOW; + break; + case -ETIME: + case -EPROTO: + case -EILSEQ: + case -ECOMM: + case -ENOSR: + usbi_dbg("low-level bus error occurred"); + status = LIBUSB_TRANSFER_ERROR; + break; + default: + usbi_warn(ITRANSFER_CTX(itransfer), + "unrecognised urb status %d", urb->status); + status = LIBUSB_TRANSFER_ERROR; + break; + } + + free(tpriv->urbs); + tpriv->urbs = NULL; + usbi_mutex_unlock(&itransfer->lock); + return usbi_handle_transfer_completion(itransfer, status); +} + +static int reap_for_handle(struct libusb_device_handle *handle) +{ + struct linux_device_handle_priv *hpriv = _device_handle_priv(handle); + int r; + struct usbfs_urb *urb; + struct usbi_transfer *itransfer; + struct libusb_transfer *transfer; + + r = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb); + if (r == -1 && errno == EAGAIN) + return 1; + if (r < 0) { + if (errno == ENODEV) + return LIBUSB_ERROR_NO_DEVICE; + + usbi_err(HANDLE_CTX(handle), "reap failed error %d errno=%d", + r, errno); + return LIBUSB_ERROR_IO; + } + + itransfer = urb->usercontext; + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + usbi_dbg("urb type=%d status=%d transferred=%d", urb->type, urb->status, + urb->actual_length); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return handle_iso_completion(itransfer, urb); + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + return handle_bulk_completion(itransfer, urb); + case LIBUSB_TRANSFER_TYPE_CONTROL: + return handle_control_completion(itransfer, urb); + default: + usbi_err(HANDLE_CTX(handle), "unrecognised endpoint type %x", + transfer->type); + return LIBUSB_ERROR_OTHER; + } +} + +static int op_handle_events(struct libusb_context *ctx, + struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) +{ + int r; + int i = 0; + + usbi_mutex_lock(&ctx->open_devs_lock); + for (i = 0; i < nfds && num_ready > 0; i++) { + struct pollfd *pollfd = &fds[i]; + struct libusb_device_handle *handle; + struct linux_device_handle_priv *hpriv = NULL; + + if (!pollfd->revents) + continue; + + num_ready--; + list_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) { + hpriv = _device_handle_priv(handle); + if (hpriv->fd == pollfd->fd) + break; + } + + if (pollfd->revents & POLLERR) { + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd); + usbi_handle_disconnect(handle); + continue; + } + + r = reap_for_handle(handle); + if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE) + continue; + else if (r < 0) + goto out; + } + + r = 0; +out: + usbi_mutex_unlock(&ctx->open_devs_lock); + return r; +} + +static int op_clock_gettime(int clk_id, struct timespec *tp) +{ + switch (clk_id) { + case USBI_CLOCK_MONOTONIC: + return clock_gettime(monotonic_clkid, tp); + case USBI_CLOCK_REALTIME: + return clock_gettime(CLOCK_REALTIME, tp); + default: + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +#ifdef USBI_TIMERFD_AVAILABLE +static clockid_t op_get_timerfd_clockid(void) +{ + return monotonic_clkid; + +} +#endif + +const struct usbi_os_backend linux_usbfs_backend = { + .name = "Linux usbfs", + .init = op_init, + .exit = NULL, + .get_device_list = op_get_device_list, + .get_device_descriptor = op_get_device_descriptor, + .get_active_config_descriptor = op_get_active_config_descriptor, + .get_config_descriptor = op_get_config_descriptor, + + .open = op_open, + .close = op_close, + .get_configuration = op_get_configuration, + .set_configuration = op_set_configuration, + .claim_interface = op_claim_interface, + .release_interface = op_release_interface, + + .set_interface_altsetting = op_set_interface, + .clear_halt = op_clear_halt, + .reset_device = op_reset_device, + + .kernel_driver_active = op_kernel_driver_active, + .detach_kernel_driver = op_detach_kernel_driver, + .attach_kernel_driver = op_attach_kernel_driver, + + .destroy_device = op_destroy_device, + + .submit_transfer = op_submit_transfer, + .cancel_transfer = op_cancel_transfer, + .clear_transfer_priv = op_clear_transfer_priv, + + .handle_events = op_handle_events, + + .clock_gettime = op_clock_gettime, + +#ifdef USBI_TIMERFD_AVAILABLE + .get_timerfd_clockid = op_get_timerfd_clockid, +#endif + + .device_priv_size = sizeof(struct linux_device_priv), + .device_handle_priv_size = sizeof(struct linux_device_handle_priv), + .transfer_priv_size = sizeof(struct linux_transfer_priv), + .add_iso_packet_size = 0, +}; + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.h new file mode 100644 index 0000000..487acb5 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/linux_usbfs.h @@ -0,0 +1,139 @@ +/* + * usbfs header structures + * Copyright (C) 2007 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSB_USBFS_H +#define LIBUSB_USBFS_H + +#define SYSFS_DEVICE_PATH "/sys/bus/usb/devices" + +struct usbfs_ctrltransfer { + /* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */ + uint8_t bmRequestType; + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; + + uint32_t timeout; /* in milliseconds */ + + /* pointer to data */ + void *data; +}; + +struct usbfs_bulktransfer { + /* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */ + unsigned int ep; + unsigned int len; + unsigned int timeout; /* in milliseconds */ + + /* pointer to data */ + void *data; +}; + +struct usbfs_setinterface { + /* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */ + unsigned int interface; + unsigned int altsetting; +}; + +#define USBFS_MAXDRIVERNAME 255 + +struct usbfs_getdriver { + unsigned int interface; + char driver[USBFS_MAXDRIVERNAME + 1]; +}; + +#define USBFS_URB_SHORT_NOT_OK 0x01 +#define USBFS_URB_ISO_ASAP 0x02 +#define USBFS_URB_BULK_CONTINUATION 0x04 +#define USBFS_URB_QUEUE_BULK 0x10 +#define USBFS_URB_ZERO_PACKET 0x40 + +enum usbfs_urb_type { + USBFS_URB_TYPE_ISO = 0, + USBFS_URB_TYPE_INTERRUPT = 1, + USBFS_URB_TYPE_CONTROL = 2, + USBFS_URB_TYPE_BULK = 3, +}; + +struct usbfs_iso_packet_desc { + unsigned int length; + unsigned int actual_length; + unsigned int status; +}; + +#define MAX_ISO_BUFFER_LENGTH 32768 +#define MAX_BULK_BUFFER_LENGTH 16384 +#define MAX_CTRL_BUFFER_LENGTH 4096 + +struct usbfs_urb { + unsigned char type; + unsigned char endpoint; + int status; + unsigned int flags; + void *buffer; + int buffer_length; + int actual_length; + int start_frame; + int number_of_packets; + int error_count; + unsigned int signr; + void *usercontext; + struct usbfs_iso_packet_desc iso_frame_desc[0]; +}; + +struct usbfs_connectinfo { + unsigned int devnum; + unsigned char slow; +}; + +struct usbfs_ioctl { + int ifno; /* interface 0..N ; negative numbers reserved */ + int ioctl_code; /* MUST encode size + direction of data so the + * macros in give correct values */ + void *data; /* param buffer (in, or out) */ +}; + +struct usbfs_hub_portinfo { + unsigned char numports; + unsigned char port[127]; /* port to device num mapping */ +}; + +#define IOCTL_USBFS_CONTROL _IOWR('U', 0, struct usbfs_ctrltransfer) +#define IOCTL_USBFS_BULK _IOWR('U', 2, struct usbfs_bulktransfer) +#define IOCTL_USBFS_RESETEP _IOR('U', 3, unsigned int) +#define IOCTL_USBFS_SETINTF _IOR('U', 4, struct usbfs_setinterface) +#define IOCTL_USBFS_SETCONFIG _IOR('U', 5, unsigned int) +#define IOCTL_USBFS_GETDRIVER _IOW('U', 8, struct usbfs_getdriver) +#define IOCTL_USBFS_SUBMITURB _IOR('U', 10, struct usbfs_urb) +#define IOCTL_USBFS_DISCARDURB _IO('U', 11) +#define IOCTL_USBFS_REAPURB _IOW('U', 12, void *) +#define IOCTL_USBFS_REAPURBNDELAY _IOW('U', 13, void *) +#define IOCTL_USBFS_CLAIMINTF _IOR('U', 15, unsigned int) +#define IOCTL_USBFS_RELEASEINTF _IOR('U', 16, unsigned int) +#define IOCTL_USBFS_CONNECTINFO _IOW('U', 17, struct usbfs_connectinfo) +#define IOCTL_USBFS_IOCTL _IOWR('U', 18, struct usbfs_ioctl) +#define IOCTL_USBFS_HUB_PORTINFO _IOR('U', 19, struct usbfs_hub_portinfo) +#define IOCTL_USBFS_RESET _IO('U', 20) +#define IOCTL_USBFS_CLEAR_HALT _IOR('U', 21, unsigned int) +#define IOCTL_USBFS_DISCONNECT _IO('U', 22) +#define IOCTL_USBFS_CONNECT _IO('U', 23) + +#endif diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/openbsd_usb.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/openbsd_usb.c new file mode 100644 index 0000000..e31941b --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/openbsd_usb.c @@ -0,0 +1,727 @@ +/* + * Copyright (c) 2011 Martin Pieuchot + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "libusb.h" +#include "libusbi.h" + +struct device_priv { + char devnode[16]; + int fd; + + unsigned char *cdesc; /* active config descriptor */ + usb_device_descriptor_t ddesc; /* usb device descriptor */ +}; + +struct handle_priv { + int pipe[2]; /* for event notification */ + int endpoints[USB_MAX_ENDPOINTS]; +}; + +/* + * Backend functions + */ +static int obsd_get_device_list(struct libusb_context *, + struct discovered_devs **); +static int obsd_open(struct libusb_device_handle *); +static void obsd_close(struct libusb_device_handle *); + +static int obsd_get_device_descriptor(struct libusb_device *, unsigned char *, + int *); +static int obsd_get_active_config_descriptor(struct libusb_device *, + unsigned char *, size_t, int *); +static int obsd_get_config_descriptor(struct libusb_device *, uint8_t, + unsigned char *, size_t, int *); + +static int obsd_get_configuration(struct libusb_device_handle *, int *); +static int obsd_set_configuration(struct libusb_device_handle *, int); + +static int obsd_claim_interface(struct libusb_device_handle *, int); +static int obsd_release_interface(struct libusb_device_handle *, int); + +static int obsd_set_interface_altsetting(struct libusb_device_handle *, int, + int); +static int obsd_clear_halt(struct libusb_device_handle *, unsigned char); +static int obsd_reset_device(struct libusb_device_handle *); +static void obsd_destroy_device(struct libusb_device *); + +static int obsd_submit_transfer(struct usbi_transfer *); +static int obsd_cancel_transfer(struct usbi_transfer *); +static void obsd_clear_transfer_priv(struct usbi_transfer *); +static int obsd_handle_events(struct libusb_context *ctx, struct pollfd *, + nfds_t, int); +static int obsd_clock_gettime(int, struct timespec *); + +/* + * Private functions + */ +static int _errno_to_libusb(int); +static int _cache_active_config_descriptor(struct libusb_device *, int); +static int _sync_control_transfer(struct usbi_transfer *); +static int _sync_gen_transfer(struct usbi_transfer *); +static int _access_endpoint(struct libusb_transfer *); + +const struct usbi_os_backend openbsd_backend = { + "Synchronous OpenBSD backend", + NULL, /* init() */ + NULL, /* exit() */ + obsd_get_device_list, + obsd_open, + obsd_close, + + obsd_get_device_descriptor, + obsd_get_active_config_descriptor, + obsd_get_config_descriptor, + + obsd_get_configuration, + obsd_set_configuration, + + obsd_claim_interface, + obsd_release_interface, + + obsd_set_interface_altsetting, + obsd_clear_halt, + obsd_reset_device, + + NULL, /* kernel_driver_active() */ + NULL, /* detach_kernel_driver() */ + NULL, /* attach_kernel_driver() */ + + obsd_destroy_device, + + obsd_submit_transfer, + obsd_cancel_transfer, + obsd_clear_transfer_priv, + + obsd_handle_events, + + obsd_clock_gettime, + sizeof(struct device_priv), + sizeof(struct handle_priv), + 0, /* transfer_priv_size */ + 0, /* add_iso_packet_size */ +}; + +int +obsd_get_device_list(struct libusb_context * ctx, + struct discovered_devs **discdevs) +{ + struct libusb_device *dev; + struct device_priv *dpriv; + struct usb_device_info di; + unsigned long session_id; + char devnode[16]; + int fd, err, i; + + usbi_dbg(""); + + /* Only ugen(4) is supported */ + for (i = 0; i < USB_MAX_DEVICES; i++) { + /* Control endpoint is always .00 */ + snprintf(devnode, sizeof(devnode), "/dev/ugen%d.00", i); + + if ((fd = open(devnode, O_RDONLY)) < 0) { + if (errno != ENOENT && errno != ENXIO) + usbi_err(ctx, "could not open %s", devnode); + continue; + } + + if (ioctl(fd, USB_GET_DEVICEINFO, &di) < 0) + continue; + + session_id = (di.udi_bus << 8 | di.udi_addr); + dev = usbi_get_device_by_session_id(ctx, session_id); + + if (dev == NULL) { + dev = usbi_alloc_device(ctx, session_id); + if (dev == NULL) + return (LIBUSB_ERROR_NO_MEM); + + dev->bus_number = di.udi_bus; + dev->device_address = di.udi_addr; + dev->speed = di.udi_speed; + + dpriv = (struct device_priv *)dev->os_priv; + strlcpy(dpriv->devnode, devnode, sizeof(devnode)); + dpriv->fd = -1; + + if (ioctl(fd, USB_GET_DEVICE_DESC, &dpriv->ddesc) < 0) { + err = errno; + goto error; + } + + dpriv->cdesc = NULL; + if (_cache_active_config_descriptor(dev, fd)) { + err = errno; + goto error; + } + + if ((err = usbi_sanitize_device(dev))) + goto error; + } + close(fd); + + if (discovered_devs_append(*discdevs, dev) == NULL) + return (LIBUSB_ERROR_NO_MEM); + } + + return (LIBUSB_SUCCESS); + +error: + close(fd); + libusb_unref_device(dev); + return _errno_to_libusb(err); +} + +int +obsd_open(struct libusb_device_handle *handle) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + dpriv->fd = open(dpriv->devnode, O_RDWR); + if (dpriv->fd < 0) { + dpriv->fd = open(dpriv->devnode, O_RDONLY); + if (dpriv->fd < 0) + return _errno_to_libusb(errno); + } + + usbi_dbg("open %s: fd %d", dpriv->devnode, dpriv->fd); + + if (pipe(hpriv->pipe) < 0) + return _errno_to_libusb(errno); + + return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN); +} + +void +obsd_close(struct libusb_device_handle *handle) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + usbi_dbg("close: fd %d", dpriv->fd); + + close(dpriv->fd); + dpriv->fd = -1; + + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); + + close(hpriv->pipe[0]); + close(hpriv->pipe[1]); +} + +int +obsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf, + int *host_endian) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + + usbi_dbg(""); + + memcpy(buf, &dpriv->ddesc, DEVICE_DESC_LENGTH); + + *host_endian = 0; + + return (LIBUSB_SUCCESS); +} + +int +obsd_get_active_config_descriptor(struct libusb_device *dev, + unsigned char *buf, size_t len, int *host_endian) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + usb_config_descriptor_t *ucd; + + ucd = (usb_config_descriptor_t *) dpriv->cdesc; + len = MIN(len, UGETW(ucd->wTotalLength)); + + usbi_dbg("len %d", len); + + memcpy(buf, dpriv->cdesc, len); + + *host_endian = 0; + + return (LIBUSB_SUCCESS); +} + +int +obsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx, + unsigned char *buf, size_t len, int *host_endian) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + struct usb_full_desc ufd; + int fd, err; + + usbi_dbg("index %d, len %d", idx, len); + + /* A config descriptor may be requested before opening the device */ + if (dpriv->fd >= 0) { + fd = dpriv->fd; + } else { + fd = open(dpriv->devnode, O_RDONLY); + if (fd < 0) + return _errno_to_libusb(errno); + } + + ufd.ufd_config_index = idx; + ufd.ufd_size = len; + ufd.ufd_data = buf; + + if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) { + err = errno; + if (dpriv->fd < 0) + close(fd); + return _errno_to_libusb(err); + } + + if (dpriv->fd < 0) + close(fd); + + *host_endian = 0; + + return (LIBUSB_SUCCESS); +} + +int +obsd_get_configuration(struct libusb_device_handle *handle, int *config) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + usbi_dbg(""); + + if (ioctl(dpriv->fd, USB_GET_CONFIG, config) < 0) + return _errno_to_libusb(errno); + + usbi_dbg("configuration %d", *config); + + return (LIBUSB_SUCCESS); +} + +int +obsd_set_configuration(struct libusb_device_handle *handle, int config) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + + usbi_dbg("configuration %d", config); + + if (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0) + return _errno_to_libusb(errno); + + return _cache_active_config_descriptor(handle->dev, dpriv->fd); +} + +int +obsd_claim_interface(struct libusb_device_handle *handle, int iface) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + int i; + + for (i = 0; i < USB_MAX_ENDPOINTS; i++) + hpriv->endpoints[i] = -1; + + return (LIBUSB_SUCCESS); +} + +int +obsd_release_interface(struct libusb_device_handle *handle, int iface) +{ + struct handle_priv *hpriv = (struct handle_priv *)handle->os_priv; + int i; + + for (i = 0; i < USB_MAX_ENDPOINTS; i++) + if (hpriv->endpoints[i] >= 0) + close(hpriv->endpoints[i]); + + return (LIBUSB_SUCCESS); +} + +int +obsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface, + int altsetting) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + struct usb_alt_interface intf; + + usbi_dbg("iface %d, setting %d", iface, altsetting); + + memset(&intf, 0, sizeof(intf)); + + intf.uai_interface_index = iface; + intf.uai_alt_no = altsetting; + + if (ioctl(dpriv->fd, USB_SET_ALTINTERFACE, &intf) < 0) + return _errno_to_libusb(errno); + + return (LIBUSB_SUCCESS); +} + +int +obsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint) +{ + struct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv; + struct usb_ctl_request req; + + usbi_dbg(""); + + req.ucr_request.bmRequestType = UT_WRITE_ENDPOINT; + req.ucr_request.bRequest = UR_CLEAR_FEATURE; + USETW(req.ucr_request.wValue, UF_ENDPOINT_HALT); + USETW(req.ucr_request.wIndex, endpoint); + USETW(req.ucr_request.wLength, 0); + + if (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0) + return _errno_to_libusb(errno); + + return (LIBUSB_SUCCESS); +} + +int +obsd_reset_device(struct libusb_device_handle *handle) +{ + usbi_dbg(""); + + return (LIBUSB_ERROR_NOT_SUPPORTED); +} + +void +obsd_destroy_device(struct libusb_device *dev) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + + usbi_dbg(""); + + free(dpriv->cdesc); +} + +int +obsd_submit_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + struct handle_priv *hpriv; + int err = 0; + + usbi_dbg(""); + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + hpriv = (struct handle_priv *)transfer->dev_handle->os_priv; + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + err = _sync_control_transfer(itransfer); + break; + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + if (IS_XFEROUT(transfer)) { + /* Isochronous write is not supported */ + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; + } + err = _sync_gen_transfer(itransfer); + break; + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + if (IS_XFEROUT(transfer) && + transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) { + err = LIBUSB_ERROR_NOT_SUPPORTED; + break; + } + err = _sync_gen_transfer(itransfer); + break; + } + + if (err) + return (err); + + if (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0) + return _errno_to_libusb(errno); + + return (LIBUSB_SUCCESS); +} + +int +obsd_cancel_transfer(struct usbi_transfer *itransfer) +{ + usbi_dbg(""); + + return (LIBUSB_ERROR_NOT_SUPPORTED); +} + +void +obsd_clear_transfer_priv(struct usbi_transfer *itransfer) +{ + usbi_dbg(""); + + /* Nothing to do */ +} + +int +obsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds, + int num_ready) +{ + struct libusb_device_handle *handle; + struct handle_priv *hpriv = NULL; + struct usbi_transfer *itransfer; + struct pollfd *pollfd; + int i, err = 0; + + usbi_dbg(""); + + pthread_mutex_lock(&ctx->open_devs_lock); + for (i = 0; i < nfds && num_ready > 0; i++) { + pollfd = &fds[i]; + + if (!pollfd->revents) + continue; + + hpriv = NULL; + num_ready--; + list_for_each_entry(handle, &ctx->open_devs, list, + struct libusb_device_handle) { + hpriv = (struct handle_priv *)handle->os_priv; + + if (hpriv->pipe[0] == pollfd->fd) + break; + + hpriv = NULL; + } + + if (NULL == hpriv) { + usbi_dbg("fd %d is not an event pipe!", pollfd->fd); + err = ENOENT; + break; + } + + if (pollfd->revents & POLLERR) { + usbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]); + usbi_handle_disconnect(handle); + continue; + } + + if (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) { + err = errno; + break; + } + + if ((err = usbi_handle_transfer_completion(itransfer, + LIBUSB_TRANSFER_COMPLETED))) + break; + } + pthread_mutex_unlock(&ctx->open_devs_lock); + + if (err) + return _errno_to_libusb(err); + + return (LIBUSB_SUCCESS); +} + +int +obsd_clock_gettime(int clkid, struct timespec *tp) +{ + usbi_dbg("clock %d", clkid); + + if (clkid == USBI_CLOCK_REALTIME) + return clock_gettime(CLOCK_REALTIME, tp); + + if (clkid == USBI_CLOCK_MONOTONIC) + return clock_gettime(CLOCK_MONOTONIC, tp); + + return (LIBUSB_ERROR_INVALID_PARAM); +} + +int +_errno_to_libusb(int err) +{ + switch (err) { + case EIO: + return (LIBUSB_ERROR_IO); + case EACCES: + return (LIBUSB_ERROR_ACCESS); + case ENOENT: + return (LIBUSB_ERROR_NO_DEVICE); + case ENOMEM: + return (LIBUSB_ERROR_NO_MEM); + } + + usbi_dbg("error: %s", strerror(err)); + + return (LIBUSB_ERROR_OTHER); +} + +int +_cache_active_config_descriptor(struct libusb_device *dev, int fd) +{ + struct device_priv *dpriv = (struct device_priv *)dev->os_priv; + struct usb_config_desc ucd; + struct usb_full_desc ufd; + unsigned char* buf; + int len; + + usbi_dbg("fd %d", fd); + + ucd.ucd_config_index = USB_CURRENT_CONFIG_INDEX; + + if ((ioctl(fd, USB_GET_CONFIG_DESC, &ucd)) < 0) + return _errno_to_libusb(errno); + + usbi_dbg("active bLength %d", ucd.ucd_desc.bLength); + + len = UGETW(ucd.ucd_desc.wTotalLength); + buf = malloc(len); + if (buf == NULL) + return (LIBUSB_ERROR_NO_MEM); + + ufd.ufd_config_index = ucd.ucd_config_index; + ufd.ufd_size = len; + ufd.ufd_data = buf; + + usbi_dbg("index %d, len %d", ufd.ufd_config_index, len); + + if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) { + free(buf); + return _errno_to_libusb(errno); + } + + if (dpriv->cdesc) + free(dpriv->cdesc); + dpriv->cdesc = buf; + + return (0); +} + +int +_sync_control_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + struct libusb_control_setup *setup; + struct device_priv *dpriv; + struct usb_ctl_request req; + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; + setup = (struct libusb_control_setup *)transfer->buffer; + + usbi_dbg("type %d request %d value %d index %d length %d timeout %d", + setup->bmRequestType, setup->bRequest, + libusb_le16_to_cpu(setup->wValue), + libusb_le16_to_cpu(setup->wIndex), + libusb_le16_to_cpu(setup->wLength), transfer->timeout); + + req.ucr_request.bmRequestType = setup->bmRequestType; + req.ucr_request.bRequest = setup->bRequest; + /* Don't use USETW, libusb already deals with the endianness */ + (*(uint16_t *)req.ucr_request.wValue) = setup->wValue; + (*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex; + (*(uint16_t *)req.ucr_request.wLength) = setup->wLength; + req.ucr_data = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; + + if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0) + req.ucr_flags = USBD_SHORT_XFER_OK; + + if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) + return _errno_to_libusb(errno); + + if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0) + return _errno_to_libusb(errno); + + itransfer->transferred = req.ucr_actlen; + + usbi_dbg("transferred %d", itransfer->transferred); + + return (0); +} + +int +_access_endpoint(struct libusb_transfer *transfer) +{ + struct handle_priv *hpriv; + struct device_priv *dpriv; + char *s, devnode[16]; + int fd, endpt; + mode_t mode; + + hpriv = (struct handle_priv *)transfer->dev_handle->os_priv; + dpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv; + + endpt = UE_GET_ADDR(transfer->endpoint); + mode = IS_XFERIN(transfer) ? O_RDONLY : O_WRONLY; + + usbi_dbg("endpoint %d mode %d", endpt, mode); + + if (hpriv->endpoints[endpt] < 0) { + /* Pick the right node given the control one */ + strlcpy(devnode, dpriv->devnode, sizeof(devnode)); + s = strchr(devnode, '.'); + snprintf(s, 4, ".%02d", endpt); + + /* We may need to read/write to the same endpoint later. */ + if (((fd = open(devnode, O_RDWR)) < 0) && (errno == ENXIO)) + if ((fd = open(devnode, mode)) < 0) + return (-1); + + hpriv->endpoints[endpt] = fd; + } + + return (hpriv->endpoints[endpt]); +} + +int +_sync_gen_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer; + int fd, nr = 1; + + transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + /* + * Bulk, Interrupt or Isochronous transfer depends on the + * endpoint and thus the node to open. + */ + if ((fd = _access_endpoint(transfer)) < 0) + return _errno_to_libusb(errno); + + if ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0) + return _errno_to_libusb(errno); + + if (IS_XFERIN(transfer)) { + if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0) + if ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0) + return _errno_to_libusb(errno); + + nr = read(fd, transfer->buffer, transfer->length); + } else { + nr = write(fd, transfer->buffer, transfer->length); + } + + if (nr < 0) + return _errno_to_libusb(errno); + + itransfer->transferred = nr; + + return (0); +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_posix.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_posix.h new file mode 100644 index 0000000..0e5e7f5 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_posix.h @@ -0,0 +1,10 @@ +#ifndef LIBUSB_POLL_POSIX_H +#define LIBUSB_POLL_POSIX_H + +#define usbi_write write +#define usbi_read read +#define usbi_close close +#define usbi_pipe pipe +#define usbi_poll poll + +#endif /* LIBUSB_POLL_POSIX_H */ diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.c new file mode 100644 index 0000000..7f4d9c4 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.c @@ -0,0 +1,745 @@ +/* + * poll_windows: poll compatibility wrapper for Windows + * Copyright (C) 2009-2010 Pete Batard + * With contributions from Michael Plante, Orin Eman et al. + * Parts of poll implementation from libusb-win32, by Stephan Meyer et al. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* + * poll() and pipe() Windows compatibility layer for libusb 1.0 + * + * The way this layer works is by using OVERLAPPED with async I/O transfers, as + * OVERLAPPED have an associated event which is flagged for I/O completion. + * + * For USB pollable async I/O, you would typically: + * - obtain a Windows HANDLE to a file or device that has been opened in + * OVERLAPPED mode + * - call usbi_create_fd with this handle to obtain a custom fd. + * Note that if you need simultaneous R/W access, you need to call create_fd + * twice, once in _O_RDONLY and once in _O_WRONLY mode to obtain 2 separate + * pollable fds + * - leave the core functions call the poll routine and flag POLLIN/POLLOUT + * + * The pipe pollable synchronous I/O works using the overlapped event associated + * with a fake pipe. The read/write functions are only meant to be used in that + * context. + */ +#include +#include +#include +#include +#include + +#include + +// Uncomment to debug the polling layer +//#define DEBUG_POLL_WINDOWS +#if defined(DEBUG_POLL_WINDOWS) +#define poll_dbg usbi_dbg +#else +// MSVC++ < 2005 cannot use a variadic argument and non MSVC +// compilers produce warnings if parenthesis are omitted. +#if defined(_MSC_VER) && _MSC_VER < 1400 +#define poll_dbg +#else +#define poll_dbg(...) +#endif +#endif + +#if defined(_PREFAST_) +#pragma warning(disable:28719) +#endif + +#if defined(__CYGWIN__) +// cygwin produces a warning unless these prototypes are defined +extern int _open(char* name, int flags); +extern int _close(int fd); +extern int _snprintf(char *buffer, size_t count, const char *format, ...); +#define NUL_DEVICE "/dev/null" +#else +#define NUL_DEVICE "NUL" +#endif + +#define CHECK_INIT_POLLING do {if(!is_polling_set) init_polling();} while(0) + +// public fd data +const struct winfd INVALID_WINFD = {-1, INVALID_HANDLE_VALUE, NULL, RW_NONE}; +struct winfd poll_fd[MAX_FDS]; +// internal fd data +struct { + CRITICAL_SECTION mutex; // lock for fds + // Additional variables for XP CancelIoEx partial emulation + HANDLE original_handle; + DWORD thread_id; +} _poll_fd[MAX_FDS]; + +// globals +BOOLEAN is_polling_set = FALSE; +LONG pipe_number = 0; +static volatile LONG compat_spinlock = 0; + +// CancelIoEx, available on Vista and later only, provides the ability to cancel +// a single transfer (OVERLAPPED) when used. As it may not be part of any of the +// platform headers, we hook into the Kernel32 system DLL directly to seek it. +static BOOL (__stdcall *pCancelIoEx)(HANDLE, LPOVERLAPPED) = NULL; +#define CancelIoEx_Available (pCancelIoEx != NULL) +static __inline BOOL cancel_io(int _index) +{ + if ((_index < 0) || (_index >= MAX_FDS)) { + return FALSE; + } + + if ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE) + || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) { + return TRUE; + } + if (CancelIoEx_Available) { + return (*pCancelIoEx)(poll_fd[_index].handle, poll_fd[_index].overlapped); + } + if (_poll_fd[_index].thread_id == GetCurrentThreadId()) { + return CancelIo(poll_fd[_index].handle); + } + usbi_warn(NULL, "Unable to cancel I/O that was started from another thread"); + return FALSE; +} + +// Init +void init_polling(void) +{ + int i; + + while (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) { + SleepEx(0, TRUE); + } + if (!is_polling_set) { + pCancelIoEx = (BOOL (__stdcall *)(HANDLE,LPOVERLAPPED)) + GetProcAddress(GetModuleHandleA("KERNEL32"), "CancelIoEx"); + usbi_dbg("Will use CancelIo%s for I/O cancellation", + CancelIoEx_Available?"Ex":""); + for (i=0; ihEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if(overlapped->hEvent == NULL) { + free (overlapped); + return NULL; + } + return overlapped; +} + +void free_overlapped(OVERLAPPED *overlapped) +{ + if (overlapped == NULL) + return; + + if ( (overlapped->hEvent != 0) + && (overlapped->hEvent != INVALID_HANDLE_VALUE) ) { + CloseHandle(overlapped->hEvent); + } + free(overlapped); +} + +void reset_overlapped(OVERLAPPED *overlapped) +{ + HANDLE event_handle; + if (overlapped == NULL) + return; + + event_handle = overlapped->hEvent; + if (event_handle != NULL) { + ResetEvent(event_handle); + } + memset(overlapped, 0, sizeof(OVERLAPPED)); + overlapped->hEvent = event_handle; +} + +void exit_polling(void) +{ + int i; + + while (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) { + SleepEx(0, TRUE); + } + if (is_polling_set) { + is_polling_set = FALSE; + + for (i=0; i 0) && (poll_fd[i].handle != INVALID_HANDLE_VALUE) && (poll_fd[i].handle != 0) + && (GetFileType(poll_fd[i].handle) == FILE_TYPE_UNKNOWN) ) { + _close(poll_fd[i].fd); + } + free_overlapped(poll_fd[i].overlapped); + if (!CancelIoEx_Available) { + // Close duplicate handle + if (_poll_fd[i].original_handle != INVALID_HANDLE_VALUE) { + CloseHandle(poll_fd[i].handle); + } + } + poll_fd[i] = INVALID_WINFD; + LeaveCriticalSection(&_poll_fd[i].mutex); + DeleteCriticalSection(&_poll_fd[i].mutex); + } + } + compat_spinlock = 0; +} + +/* + * Create a fake pipe. + * As libusb only uses pipes for signaling, all we need from a pipe is an + * event. To that extent, we create a single wfd and overlapped as a means + * to access that event. + */ +int usbi_pipe(int filedes[2]) +{ + int i; + OVERLAPPED* overlapped; + + CHECK_INIT_POLLING; + + overlapped = (OVERLAPPED*) calloc(1, sizeof(OVERLAPPED)); + if (overlapped == NULL) { + return -1; + } + // The overlapped must have status pending for signaling to work in poll + overlapped->Internal = STATUS_PENDING; + overlapped->InternalHigh = 0; + + // Read end of the "pipe" + filedes[0] = _open(NUL_DEVICE, _O_WRONLY); + if (filedes[0] < 0) { + usbi_err(NULL, "could not create pipe: errno %d", errno); + goto out1; + } + // We can use the same handle for both ends + filedes[1] = filedes[0]; + poll_dbg("pipe filedes = %d", filedes[0]); + + // Note: manual reset must be true (second param) as the reset occurs in read + overlapped->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if(!overlapped->hEvent) { + goto out2; + } + + for (i=0; i= 0) { + LeaveCriticalSection(&_poll_fd[i].mutex); + continue; + } + + poll_fd[i].fd = filedes[0]; + poll_fd[i].handle = DUMMY_HANDLE; + poll_fd[i].overlapped = overlapped; + // There's no polling on the write end, so we just use READ for our needs + poll_fd[i].rw = RW_READ; + _poll_fd[i].original_handle = INVALID_HANDLE_VALUE; + LeaveCriticalSection(&_poll_fd[i].mutex); + return 0; + } + } + + CloseHandle(overlapped->hEvent); +out2: + _close(filedes[0]); +out1: + free(overlapped); + return -1; +} + +/* + * Create both an fd and an OVERLAPPED from an open Windows handle, so that + * it can be used with our polling function + * The handle MUST support overlapped transfers (usually requires CreateFile + * with FILE_FLAG_OVERLAPPED) + * Return a pollable file descriptor struct, or INVALID_WINFD on error + * + * Note that the fd returned by this function is a per-transfer fd, rather + * than a per-session fd and cannot be used for anything else but our + * custom functions (the fd itself points to the NUL: device) + * if you plan to do R/W on the same handle, you MUST create 2 fds: one for + * read and one for write. Using a single R/W fd is unsupported and will + * produce unexpected results + */ +struct winfd usbi_create_fd(HANDLE handle, int access_mode) +{ + int i, fd; + struct winfd wfd = INVALID_WINFD; + OVERLAPPED* overlapped = NULL; + + CHECK_INIT_POLLING; + + if ((handle == 0) || (handle == INVALID_HANDLE_VALUE)) { + return INVALID_WINFD; + } + + if ((access_mode != _O_RDONLY) && (access_mode != _O_WRONLY)) { + usbi_warn(NULL, "only one of _O_RDONLY or _O_WRONLY are supported.\n" + "If you want to poll for R/W simultaneously, create multiple fds from the same handle."); + return INVALID_WINFD; + } + if (access_mode == _O_RDONLY) { + wfd.rw = RW_READ; + } else { + wfd.rw = RW_WRITE; + } + + // Ensure that we get a non system conflicting unique fd, using + // the same fd attribution system as the pipe ends + fd = _open(NUL_DEVICE, _O_WRONLY); + if (fd < 0) { + return INVALID_WINFD; + } + + overlapped = create_overlapped(); + if(overlapped == NULL) { + _close(fd); + return INVALID_WINFD; + } + + for (i=0; i= 0) { + LeaveCriticalSection(&_poll_fd[i].mutex); + continue; + } + wfd.fd = fd; + // Attempt to emulate some of the CancelIoEx behaviour on platforms + // that don't have it + if (!CancelIoEx_Available) { + _poll_fd[i].thread_id = GetCurrentThreadId(); + if (!DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(), + &wfd.handle, 0, TRUE, DUPLICATE_SAME_ACCESS)) { + usbi_dbg("could not duplicate handle for CancelIo - using original one"); + wfd.handle = handle; + // Make sure we won't close the original handle on fd deletion then + _poll_fd[i].original_handle = INVALID_HANDLE_VALUE; + } else { + _poll_fd[i].original_handle = handle; + } + } else { + wfd.handle = handle; + } + wfd.overlapped = overlapped; + memcpy(&poll_fd[i], &wfd, sizeof(struct winfd)); + LeaveCriticalSection(&_poll_fd[i].mutex); + return wfd; + } + } + free_overlapped(overlapped); + _close(fd); + return INVALID_WINFD; +} + +void _free_index(int _index) +{ + // Cancel any async IO (Don't care about the validity of our handles for this) + cancel_io(_index); + // close fake handle for devices + if ( (poll_fd[_index].handle != INVALID_HANDLE_VALUE) && (poll_fd[_index].handle != 0) + && (GetFileType(poll_fd[_index].handle) == FILE_TYPE_UNKNOWN) ) { + _close(poll_fd[_index].fd); + } + // close the duplicate handle (if we have an actual duplicate) + if (!CancelIoEx_Available) { + if (_poll_fd[_index].original_handle != INVALID_HANDLE_VALUE) { + CloseHandle(poll_fd[_index].handle); + } + _poll_fd[_index].original_handle = INVALID_HANDLE_VALUE; + _poll_fd[_index].thread_id = 0; + } + free_overlapped(poll_fd[_index].overlapped); + poll_fd[_index] = INVALID_WINFD; +} + +/* + * Release a pollable file descriptor. + * + * Note that the associated Windows handle is not closed by this call + */ +void usbi_free_fd(int fd) +{ + int _index; + + CHECK_INIT_POLLING; + + _index = _fd_to_index_and_lock(fd); + if (_index < 0) { + return; + } + _free_index(_index); + LeaveCriticalSection(&_poll_fd[_index].mutex); +} + +/* + * The functions below perform various conversions between fd, handle and OVERLAPPED + */ +struct winfd fd_to_winfd(int fd) +{ + int i; + struct winfd wfd; + + CHECK_INIT_POLLING; + + if (fd <= 0) + return INVALID_WINFD; + + for (i=0; i= 0) { + LeaveCriticalSection(&_poll_fd[_index].mutex); + } + usbi_warn(NULL, "invalid fd"); + triggered = -1; + goto poll_exit; + } + + // IN or OUT must match our fd direction + if ((fds[i].events & POLLIN) && (poll_fd[_index].rw != RW_READ)) { + fds[i].revents |= POLLNVAL | POLLERR; + errno = EBADF; + usbi_warn(NULL, "attempted POLLIN on fd without READ access"); + LeaveCriticalSection(&_poll_fd[_index].mutex); + triggered = -1; + goto poll_exit; + } + + if ((fds[i].events & POLLOUT) && (poll_fd[_index].rw != RW_WRITE)) { + fds[i].revents |= POLLNVAL | POLLERR; + errno = EBADF; + usbi_warn(NULL, "attempted POLLOUT on fd without WRITE access"); + LeaveCriticalSection(&_poll_fd[_index].mutex); + triggered = -1; + goto poll_exit; + } + + // The following macro only works if overlapped I/O was reported pending + if ( (HasOverlappedIoCompleted(poll_fd[_index].overlapped)) + || (HasOverlappedIoCompletedSync(poll_fd[_index].overlapped)) ) { + poll_dbg(" completed"); + // checks above should ensure this works: + fds[i].revents = fds[i].events; + triggered++; + } else { + handles_to_wait_on[nb_handles_to_wait_on] = poll_fd[_index].overlapped->hEvent; + handle_to_index[nb_handles_to_wait_on] = i; + nb_handles_to_wait_on++; + } + LeaveCriticalSection(&_poll_fd[_index].mutex); + } + + // If nothing was triggered, wait on all fds that require it + if ((timeout != 0) && (triggered == 0) && (nb_handles_to_wait_on != 0)) { + if (timeout < 0) { + poll_dbg("starting infinite wait for %d handles...", (int)nb_handles_to_wait_on); + } else { + poll_dbg("starting %d ms wait for %d handles...", timeout, (int)nb_handles_to_wait_on); + } + ret = WaitForMultipleObjects(nb_handles_to_wait_on, handles_to_wait_on, + FALSE, (timeout<0)?INFINITE:(DWORD)timeout); + object_index = ret-WAIT_OBJECT_0; + if ((object_index >= 0) && ((DWORD)object_index < nb_handles_to_wait_on)) { + poll_dbg(" completed after wait"); + i = handle_to_index[object_index]; + _index = _fd_to_index_and_lock(fds[i].fd); + fds[i].revents = fds[i].events; + triggered++; + if (_index >= 0) { + LeaveCriticalSection(&_poll_fd[_index].mutex); + } + } else if (ret == WAIT_TIMEOUT) { + poll_dbg(" timed out"); + triggered = 0; // 0 = timeout + } else { + errno = EIO; + triggered = -1; // error + } + } + +poll_exit: + if (handles_to_wait_on != NULL) { + free(handles_to_wait_on); + } + if (handle_to_index != NULL) { + free(handle_to_index); + } + return triggered; +} + +/* + * close a fake pipe fd + */ +int usbi_close(int fd) +{ + int _index; + int r = -1; + + CHECK_INIT_POLLING; + + _index = _fd_to_index_and_lock(fd); + + if (_index < 0) { + errno = EBADF; + } else { + if (poll_fd[_index].overlapped != NULL) { + // Must be a different event for each end of the pipe + CloseHandle(poll_fd[_index].overlapped->hEvent); + free(poll_fd[_index].overlapped); + } + r = _close(poll_fd[_index].fd); + if (r != 0) { + errno = EIO; + } + poll_fd[_index] = INVALID_WINFD; + LeaveCriticalSection(&_poll_fd[_index].mutex); + } + return r; +} + +/* + * synchronous write for fake "pipe" signaling + */ +ssize_t usbi_write(int fd, const void *buf, size_t count) +{ + int _index; + + CHECK_INIT_POLLING; + + if (count != sizeof(unsigned char)) { + usbi_err(NULL, "this function should only used for signaling"); + return -1; + } + + _index = _fd_to_index_and_lock(fd); + + if ( (_index < 0) || (poll_fd[_index].overlapped == NULL) ) { + errno = EBADF; + if (_index >= 0) { + LeaveCriticalSection(&_poll_fd[_index].mutex); + } + return -1; + } + + poll_dbg("set pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId()); + SetEvent(poll_fd[_index].overlapped->hEvent); + poll_fd[_index].overlapped->Internal = STATUS_WAIT_0; + // If two threads write on the pipe at the same time, we need to + // process two separate reads => use the overlapped as a counter + poll_fd[_index].overlapped->InternalHigh++; + + LeaveCriticalSection(&_poll_fd[_index].mutex); + return sizeof(unsigned char); +} + +/* + * synchronous read for fake "pipe" signaling + */ +ssize_t usbi_read(int fd, void *buf, size_t count) +{ + int _index; + ssize_t r = -1; + + CHECK_INIT_POLLING; + + if (count != sizeof(unsigned char)) { + usbi_err(NULL, "this function should only used for signaling"); + return -1; + } + + _index = _fd_to_index_and_lock(fd); + + if (_index < 0) { + errno = EBADF; + return -1; + } + + if (WaitForSingleObject(poll_fd[_index].overlapped->hEvent, INFINITE) != WAIT_OBJECT_0) { + usbi_warn(NULL, "waiting for event failed: %d", (int)GetLastError()); + errno = EIO; + goto out; + } + + poll_dbg("clr pipe event (fd = %d, thread = %08X)", _index, GetCurrentThreadId()); + poll_fd[_index].overlapped->InternalHigh--; + // Don't reset unless we don't have any more events to process + if (poll_fd[_index].overlapped->InternalHigh <= 0) { + ResetEvent(poll_fd[_index].overlapped->hEvent); + poll_fd[_index].overlapped->Internal = STATUS_PENDING; + } + + r = sizeof(unsigned char); + +out: + LeaveCriticalSection(&_poll_fd[_index].mutex); + return r; +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.h new file mode 100644 index 0000000..6e5bf2b --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/poll_windows.h @@ -0,0 +1,115 @@ +/* + * Windows compat: POSIX compatibility wrapper + * Copyright (C) 2009-2010 Pete Batard + * With contributions from Michael Plante, Orin Eman et al. + * Parts of poll implementation from libusb-win32, by Stephan Meyer et al. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ +#pragma once + +#if defined(_MSC_VER) +// disable /W4 MSVC warnings that are benign +#pragma warning(disable:4127) // conditional expression is constant +#endif + +// Handle synchronous completion through the overlapped structure +#if !defined(STATUS_REPARSE) // reuse the REPARSE status code +#define STATUS_REPARSE ((LONG)0x00000104L) +#endif +#define STATUS_COMPLETED_SYNCHRONOUSLY STATUS_REPARSE +#define HasOverlappedIoCompletedSync(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) == STATUS_COMPLETED_SYNCHRONOUSLY) + +#define DUMMY_HANDLE ((HANDLE)(LONG_PTR)-2) + +enum windows_version { + WINDOWS_UNSUPPORTED, + WINDOWS_XP, + WINDOWS_2003, // also includes XP 64 + WINDOWS_VISTA_AND_LATER, +}; +extern enum windows_version windows_version; + +#define MAX_FDS 256 + +#define POLLIN 0x0001 /* There is data to read */ +#define POLLPRI 0x0002 /* There is urgent data to read */ +#define POLLOUT 0x0004 /* Writing now will not block */ +#define POLLERR 0x0008 /* Error condition */ +#define POLLHUP 0x0010 /* Hung up */ +#define POLLNVAL 0x0020 /* Invalid request: fd not open */ + +struct pollfd { + int fd; /* file descriptor */ + short events; /* requested events */ + short revents; /* returned events */ +}; + +// access modes +enum rw_type { + RW_NONE, + RW_READ, + RW_WRITE, +}; + +// fd struct that can be used for polling on Windows +struct winfd { + int fd; // what's exposed to libusb core + HANDLE handle; // what we need to attach overlapped to the I/O op, so we can poll it + OVERLAPPED* overlapped; // what will report our I/O status + enum rw_type rw; // I/O transfer direction: read *XOR* write (NOT BOTH) +}; +extern const struct winfd INVALID_WINFD; + +int usbi_pipe(int pipefd[2]); +int usbi_poll(struct pollfd *fds, unsigned int nfds, int timeout); +ssize_t usbi_write(int fd, const void *buf, size_t count); +ssize_t usbi_read(int fd, void *buf, size_t count); +int usbi_close(int fd); + +void init_polling(void); +void exit_polling(void); +struct winfd usbi_create_fd(HANDLE handle, int access_mode); +void usbi_free_fd(int fd); +struct winfd fd_to_winfd(int fd); +struct winfd handle_to_winfd(HANDLE handle); +struct winfd overlapped_to_winfd(OVERLAPPED* overlapped); + +/* + * Timeval operations + */ +#if defined(DDKBUILD) +#include // defines timeval functions on DDK +#endif + +#if !defined(TIMESPEC_TO_TIMEVAL) +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (long)(ts)->tv_sec; \ + (tv)->tv_usec = (long)(ts)->tv_nsec / 1000; \ +} +#endif +#if !defined(timersub) +#define timersub(a, b, result) \ +do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ +} while (0) +#endif + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.c new file mode 100644 index 0000000..60c57cf --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.c @@ -0,0 +1,55 @@ +/* + * libusb synchronization using POSIX Threads + * + * Copyright (C) 2011 Vitali Lovich + * Copyright (C) 2011 Peter Stuge + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef _XOPEN_SOURCE +# if _XOPEN_SOURCE < 500 +# undef _XOPEN_SOURCE +# define _XOPEN_SOURCE 500 +# endif +#else +#define _XOPEN_SOURCE 500 +#endif /* _XOPEN_SOURCE */ + +#include "threads_posix.h" + +int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr) +{ + int err; + pthread_mutexattr_t stack_attr; + if (!attr) { + attr = &stack_attr; + err = pthread_mutexattr_init(&stack_attr); + if (err != 0) + return err; + } + + err = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE); + if (err != 0) + goto finish; + + err = pthread_mutex_init(mutex, attr); + +finish: + if (attr == &stack_attr) + pthread_mutexattr_destroy(&stack_attr); + + return err; +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.h new file mode 100644 index 0000000..9752208 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_posix.h @@ -0,0 +1,48 @@ +/* + * libusb synchronization using POSIX Threads + * + * Copyright (C) 2010 Peter Stuge + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSB_THREADS_POSIX_H +#define LIBUSB_THREADS_POSIX_H + +#include + +#define usbi_mutex_static_t pthread_mutex_t +#define USBI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#define usbi_mutex_static_lock pthread_mutex_lock +#define usbi_mutex_static_unlock pthread_mutex_unlock + +#define usbi_mutex_t pthread_mutex_t +#define usbi_mutex_init pthread_mutex_init +#define usbi_mutex_lock pthread_mutex_lock +#define usbi_mutex_unlock pthread_mutex_unlock +#define usbi_mutex_trylock pthread_mutex_trylock +#define usbi_mutex_destroy pthread_mutex_destroy + +#define usbi_cond_t pthread_cond_t +#define usbi_cond_init pthread_cond_init +#define usbi_cond_wait pthread_cond_wait +#define usbi_cond_timedwait pthread_cond_timedwait +#define usbi_cond_broadcast pthread_cond_broadcast +#define usbi_cond_destroy pthread_cond_destroy +#define usbi_cond_signal pthread_cond_signal + +extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr); + +#endif /* LIBUSB_THREADS_POSIX_H */ diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.c new file mode 100644 index 0000000..1394bb0 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.c @@ -0,0 +1,207 @@ +/* + * libusb synchronization on Microsoft Windows + * + * Copyright (C) 2010 Michael Plante + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include "libusbi.h" + + +int usbi_mutex_init(usbi_mutex_t *mutex, + const usbi_mutexattr_t *attr) { + if(! mutex) return ((errno=EINVAL)); + *mutex = CreateMutex(NULL, FALSE, NULL); + if(!*mutex) return ((errno=ENOMEM)); + return 0; +} +int usbi_mutex_destroy(usbi_mutex_t *mutex) { + // It is not clear if CloseHandle failure is due to failure to unlock. + // If so, this should be errno=EBUSY. + if(!mutex || !CloseHandle(*mutex)) return ((errno=EINVAL)); + *mutex = NULL; + return 0; +} +int usbi_mutex_trylock(usbi_mutex_t *mutex) { + DWORD result; + if(!mutex) return ((errno=EINVAL)); + result = WaitForSingleObject(*mutex, 0); + if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) + return 0; // acquired (ToDo: check that abandoned is ok) + if(result == WAIT_TIMEOUT) + return ((errno=EBUSY)); + return ((errno=EINVAL)); // don't know how this would happen + // so don't know proper errno +} +int usbi_mutex_lock(usbi_mutex_t *mutex) { + DWORD result; + if(!mutex) return ((errno=EINVAL)); + result = WaitForSingleObject(*mutex, INFINITE); + if(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED) + return 0; // acquired (ToDo: check that abandoned is ok) + return ((errno=EINVAL)); // don't know how this would happen + // so don't know proper errno +} +int usbi_mutex_unlock(usbi_mutex_t *mutex) { + if(!mutex) return ((errno=EINVAL)); + if(!ReleaseMutex(*mutex)) return ((errno=EPERM )); + return 0; +} + +int usbi_mutex_static_lock(usbi_mutex_static_t *mutex) { + if(!mutex) return ((errno=EINVAL)); + while (InterlockedExchange((LONG *)mutex, 1) == 1) { + SleepEx(0, TRUE); + } + return 0; +} +int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) { + if(!mutex) return ((errno=EINVAL)); + *mutex = 0; + return 0; +} + + + +int usbi_cond_init(usbi_cond_t *cond, + const usbi_condattr_t *attr) { + if(!cond) return ((errno=EINVAL)); + list_init(&cond->waiters ); + list_init(&cond->not_waiting); + return 0; +} +int usbi_cond_destroy(usbi_cond_t *cond) { + // This assumes no one is using this anymore. The check MAY NOT BE safe. + struct usbi_cond_perthread *pos, *prev_pos = NULL; + if(!cond) return ((errno=EINVAL)); + if(!list_empty(&cond->waiters)) return ((errno=EBUSY )); // (!see above!) + list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) { + free(prev_pos); + list_del(&pos->list); + prev_pos = pos; + } + free(prev_pos); + + return 0; +} + +int usbi_cond_broadcast(usbi_cond_t *cond) { + // Assumes mutex is locked; this is not in keeping with POSIX spec, but + // libusb does this anyway, so we simplify by not adding more sync + // primitives to the CV definition! + int fail = 0; + struct usbi_cond_perthread *pos; + if(!cond) return ((errno=EINVAL)); + list_for_each_entry(pos, &cond->waiters, list, struct usbi_cond_perthread) { + if(!SetEvent(pos->event)) + fail = 1; + } + // The wait function will remove its respective item from the list. + return fail ? ((errno=EINVAL)) : 0; +} +int usbi_cond_signal(usbi_cond_t *cond) { + // Assumes mutex is locked; this is not in keeping with POSIX spec, but + // libusb does this anyway, so we simplify by not adding more sync + // primitives to the CV definition! + struct usbi_cond_perthread *pos; + if(!cond) return ((errno=EINVAL)); + if(list_empty(&cond->waiters)) return 0; // no one to wakeup. + pos = list_entry(&cond->waiters.next, struct usbi_cond_perthread, list); + // The wait function will remove its respective item from the list. + return SetEvent(pos->event) ? 0 : ((errno=EINVAL)); +} +static int __inline usbi_cond_intwait(usbi_cond_t *cond, + usbi_mutex_t *mutex, + DWORD timeout_ms) { + struct usbi_cond_perthread *pos; + int found = 0, r; + DWORD r2,tid = GetCurrentThreadId(); + if(!cond || !mutex) return ((errno=EINVAL)); + list_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) { + if(tid == pos->tid) { + found = 1; + break; + } + } + if(!found) { + pos = (struct usbi_cond_perthread*) calloc(1, sizeof(struct usbi_cond_perthread)); + if(!pos) return ((errno=ENOMEM)); // This errno is not POSIX-allowed. + pos->tid = tid; + pos->event = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset. + if(!pos->event) { + free(pos); + return ((errno=ENOMEM)); + } + list_add(&pos->list, &cond->not_waiting); + } + + list_del(&pos->list); // remove from not_waiting list. + list_add(&pos->list, &cond->waiters); + + r = usbi_mutex_unlock(mutex); + if(r) return r; + r2 = WaitForSingleObject(pos->event, timeout_ms); + r = usbi_mutex_lock(mutex); + if(r) return r; + + list_del(&pos->list); + list_add(&pos->list, &cond->not_waiting); + + if(r2 == WAIT_TIMEOUT) return ((errno=ETIMEDOUT)); + + return 0; +} +// N.B.: usbi_cond_*wait() can also return ENOMEM, even though pthread_cond_*wait cannot! +int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex) { + return usbi_cond_intwait(cond, mutex, INFINITE); +} +int usbi_cond_timedwait(usbi_cond_t *cond, + usbi_mutex_t *mutex, + const struct timespec *abstime) { + FILETIME filetime; + ULARGE_INTEGER rtime; + struct timeval targ_time, cur_time, delta_time; + struct timespec cur_time_ns; + DWORD millis; + extern const uint64_t epoch_time; + + GetSystemTimeAsFileTime(&filetime); + rtime.LowPart = filetime.dwLowDateTime; + rtime.HighPart = filetime.dwHighDateTime; + rtime.QuadPart -= epoch_time; + cur_time_ns.tv_sec = (long)(rtime.QuadPart / 10000000); + cur_time_ns.tv_nsec = (long)((rtime.QuadPart % 10000000)*100); + TIMESPEC_TO_TIMEVAL(&cur_time, &cur_time_ns); + + TIMESPEC_TO_TIMEVAL(&targ_time, abstime); + timersub(&targ_time, &cur_time, &delta_time); + if(delta_time.tv_sec < 0) // abstime already passed? + millis = 0; + else { + millis = delta_time.tv_usec/1000; + millis += delta_time.tv_sec *1000; + if (delta_time.tv_usec % 1000) // round up to next millisecond + millis++; + } + + return usbi_cond_intwait(cond, mutex, millis); +} + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.h new file mode 100644 index 0000000..7bb144a --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/threads_windows.h @@ -0,0 +1,86 @@ +/* + * libusb synchronization on Microsoft Windows + * + * Copyright (C) 2010 Michael Plante + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LIBUSB_THREADS_WINDOWS_H +#define LIBUSB_THREADS_WINDOWS_H + +#define usbi_mutex_static_t volatile LONG +#define USBI_MUTEX_INITIALIZER 0 + +#define usbi_mutex_t HANDLE + +struct usbi_cond_perthread { + struct list_head list; + DWORD tid; + HANDLE event; +}; +struct usbi_cond_t_ { + // Every time a thread touches the CV, it winds up in one of these lists. + // It stays there until the CV is destroyed, even if the thread + // terminates. + struct list_head waiters; + struct list_head not_waiting; +}; +typedef struct usbi_cond_t_ usbi_cond_t; + +// We *were* getting timespec from pthread.h: +#if (!defined(HAVE_STRUCT_TIMESPEC) && !defined(_TIMESPEC_DEFINED)) +#define HAVE_STRUCT_TIMESPEC 1 +#define _TIMESPEC_DEFINED 1 +struct timespec { + long tv_sec; + long tv_nsec; +}; +#endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */ + +// We *were* getting ETIMEDOUT from pthread.h: +#ifndef ETIMEDOUT +# define ETIMEDOUT 10060 /* This is the value in winsock.h. */ +#endif + +#define usbi_mutexattr_t void +#define usbi_condattr_t void + +// all Windows mutexes are recursive +#define usbi_mutex_init_recursive(mutex, attr) usbi_mutex_init((mutex), (attr)) + +int usbi_mutex_static_lock(usbi_mutex_static_t *mutex); +int usbi_mutex_static_unlock(usbi_mutex_static_t *mutex); + + +int usbi_mutex_init(usbi_mutex_t *mutex, + const usbi_mutexattr_t *attr); +int usbi_mutex_lock(usbi_mutex_t *mutex); +int usbi_mutex_unlock(usbi_mutex_t *mutex); +int usbi_mutex_trylock(usbi_mutex_t *mutex); +int usbi_mutex_destroy(usbi_mutex_t *mutex); + +int usbi_cond_init(usbi_cond_t *cond, + const usbi_condattr_t *attr); +int usbi_cond_destroy(usbi_cond_t *cond); +int usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex); +int usbi_cond_timedwait(usbi_cond_t *cond, + usbi_mutex_t *mutex, + const struct timespec *abstime); +int usbi_cond_broadcast(usbi_cond_t *cond); +int usbi_cond_signal(usbi_cond_t *cond); + +#endif /* LIBUSB_THREADS_WINDOWS_H */ + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.c b/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.c new file mode 100644 index 0000000..0739c19 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.c @@ -0,0 +1,2996 @@ +/* + * windows backend for libusb 1.0 + * Copyright (c) 2009-2010 Pete Batard + * With contributions from Michael Plante, Orin Eman et al. + * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer + * Hash table functions adapted from glibc, by Ulrich Drepper et al. + * Major code testing contribution by Xiaofan Chen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "poll_windows.h" +#include "windows_usb.h" + +// The following prevents "banned API" errors when using the MS's WDK OACR/Prefast +#if defined(_PREFAST_) +#pragma warning(disable:28719) +#endif + +// The 2 macros below are used in conjunction with safe loops. +#define LOOP_CHECK(fcall) { r=fcall; if (r != LIBUSB_SUCCESS) continue; } +#define LOOP_BREAK(err) { r=err; continue; } + +extern void usbi_fd_notification(struct libusb_context *ctx); + +// Helper prototypes +static int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian); +static int windows_clock_gettime(int clk_id, struct timespec *tp); +unsigned __stdcall windows_clock_gettime_threaded(void* param); +// WinUSB API prototypes +static int winusb_init(struct libusb_context *ctx); +static int winusb_exit(void); +static int winusb_open(struct libusb_device_handle *dev_handle); +static void winusb_close(struct libusb_device_handle *dev_handle); +static int winusb_configure_endpoints(struct libusb_device_handle *dev_handle, int iface); +static int winusb_claim_interface(struct libusb_device_handle *dev_handle, int iface); +static int winusb_release_interface(struct libusb_device_handle *dev_handle, int iface); +static int winusb_submit_control_transfer(struct usbi_transfer *itransfer); +static int winusb_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting); +static int winusb_submit_bulk_transfer(struct usbi_transfer *itransfer); +static int winusb_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint); +static int winusb_abort_transfers(struct usbi_transfer *itransfer); +static int winusb_abort_control(struct usbi_transfer *itransfer); +static int winusb_reset_device(struct libusb_device_handle *dev_handle); +static int winusb_copy_transfer_data(struct usbi_transfer *itransfer, uint32_t io_size); +// Composite API prototypes +static int composite_init(struct libusb_context *ctx); +static int composite_exit(void); +static int composite_open(struct libusb_device_handle *dev_handle); +static void composite_close(struct libusb_device_handle *dev_handle); +static int composite_claim_interface(struct libusb_device_handle *dev_handle, int iface); +static int composite_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting); +static int composite_release_interface(struct libusb_device_handle *dev_handle, int iface); +static int composite_submit_control_transfer(struct usbi_transfer *itransfer); +static int composite_submit_bulk_transfer(struct usbi_transfer *itransfer); +static int composite_submit_iso_transfer(struct usbi_transfer *itransfer); +static int composite_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint); +static int composite_abort_transfers(struct usbi_transfer *itransfer); +static int composite_abort_control(struct usbi_transfer *itransfer); +static int composite_reset_device(struct libusb_device_handle *dev_handle); +static int composite_copy_transfer_data(struct usbi_transfer *itransfer, uint32_t io_size); + + +// Global variables +uint64_t hires_frequency, hires_ticks_to_ps; +const uint64_t epoch_time = UINT64_C(116444736000000000); // 1970.01.01 00:00:000 in MS Filetime +enum windows_version windows_version = WINDOWS_UNSUPPORTED; +// Concurrency +static int concurrent_usage = -1; +usbi_mutex_t autoclaim_lock; +// Timer thread +// NB: index 0 is for monotonic and 1 is for the thread exit event +HANDLE timer_thread = NULL; +HANDLE timer_mutex = NULL; +struct timespec timer_tp; +volatile LONG request_count[2] = {0, 1}; // last one must be > 0 +HANDLE timer_request[2] = { NULL, NULL }; +HANDLE timer_response = NULL; +// API globals +bool api_winusb_available = false; +#define CHECK_WINUSB_AVAILABLE do { if (!api_winusb_available) return LIBUSB_ERROR_ACCESS; } while (0) + +static inline BOOLEAN guid_eq(const GUID *guid1, const GUID *guid2) { + if ((guid1 != NULL) && (guid2 != NULL)) { + return (memcmp(guid1, guid2, sizeof(GUID)) == 0); + } + return false; +} + +#if defined(ENABLE_DEBUG_LOGGING) || (defined(_MSC_VER) && _MSC_VER < 1400) +static char* guid_to_string(const GUID* guid) +{ + static char guid_string[MAX_GUID_STRING_LENGTH]; + + if (guid == NULL) return NULL; + sprintf(guid_string, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + (unsigned int)guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); + return guid_string; +} +#endif + +/* + * Converts a windows error to human readable string + * uses retval as errorcode, or, if 0, use GetLastError() + */ +static char *windows_error_str(uint32_t retval) +{ +static char err_string[ERR_BUFFER_SIZE]; + + DWORD size; + size_t i; + uint32_t error_code, format_error; + + error_code = retval?retval:GetLastError(); + + safe_sprintf(err_string, ERR_BUFFER_SIZE, "[%d] ", error_code); + + size = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[safe_strlen(err_string)], + ERR_BUFFER_SIZE - (DWORD)safe_strlen(err_string), NULL); + if (size == 0) { + format_error = GetLastError(); + if (format_error) + safe_sprintf(err_string, ERR_BUFFER_SIZE, + "Windows error code %u (FormatMessage error code %u)", error_code, format_error); + else + safe_sprintf(err_string, ERR_BUFFER_SIZE, "Unknown error code %u", error_code); + } else { + // Remove CR/LF terminators + for (i=safe_strlen(err_string)-1; ((err_string[i]==0x0A) || (err_string[i]==0x0D)); i--) { + err_string[i] = 0; + } + } + return err_string; +} + +/* + * Sanitize Microsoft's paths: convert to uppercase, add prefix and fix backslashes. + * Return an allocated sanitized string or NULL on error. + */ +static char* sanitize_path(const char* path) +{ + const char root_prefix[] = "\\\\.\\"; + size_t j, size, root_size; + char* ret_path = NULL; + size_t add_root = 0; + + if (path == NULL) + return NULL; + + size = safe_strlen(path)+1; + root_size = sizeof(root_prefix)-1; + + // Microsoft indiscriminatly uses '\\?\', '\\.\', '##?#" or "##.#" for root prefixes. + if (!((size > 3) && (((path[0] == '\\') && (path[1] == '\\') && (path[3] == '\\')) || + ((path[0] == '#') && (path[1] == '#') && (path[3] == '#'))))) { + add_root = root_size; + size += add_root; + } + + if ((ret_path = (char*)calloc(size, 1)) == NULL) + return NULL; + + safe_strcpy(&ret_path[add_root], size-add_root, path); + + // Ensure consistancy with root prefix + for (j=0; jcbSize = sizeof(SP_DEVINFO_DATA); + if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { + if (GetLastError() != ERROR_NO_MORE_ITEMS) { + usbi_err(ctx, "Could not obtain device info data for index %u: %s", + _index, windows_error_str(0)); + } + pSetupDiDestroyDeviceInfoList(*dev_info); + *dev_info = INVALID_HANDLE_VALUE; + return false; + } + return true; +} + +/* + * enumerate interfaces for a specific GUID + * + * Parameters: + * dev_info: a pointer to a dev_info list + * dev_info_data: a pointer to an SP_DEVINFO_DATA to be filled (or NULL if not needed) + * guid: the GUID for which to retrieve interface details + * index: zero based index of the interface in the device info list + * + * Note: it is the responsibility of the caller to free the DEVICE_INTERFACE_DETAIL_DATA + * structure returned and call this function repeatedly using the same guid (with an + * incremented index starting at zero) until all interfaces have been returned. + */ +static SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context *ctx, + HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const GUID* guid, unsigned _index) +{ + SP_DEVICE_INTERFACE_DATA dev_interface_data; + SP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL; + DWORD size; + + if (_index <= 0) { + *dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE); + } + + if (dev_info_data != NULL) { + dev_info_data->cbSize = sizeof(SP_DEVINFO_DATA); + if (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) { + if (GetLastError() != ERROR_NO_MORE_ITEMS) { + usbi_err(ctx, "Could not obtain device info data for index %u: %s", + _index, windows_error_str(0)); + } + pSetupDiDestroyDeviceInfoList(*dev_info); + *dev_info = INVALID_HANDLE_VALUE; + return NULL; + } + } + + dev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + if (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) { + if (GetLastError() != ERROR_NO_MORE_ITEMS) { + usbi_err(ctx, "Could not obtain interface data for index %u: %s", + _index, windows_error_str(0)); + } + pSetupDiDestroyDeviceInfoList(*dev_info); + *dev_info = INVALID_HANDLE_VALUE; + return NULL; + } + + // Read interface data (dummy + actual) to access the device path + if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) { + // The dummy call should fail with ERROR_INSUFFICIENT_BUFFER + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + usbi_err(ctx, "could not access interface data (dummy) for index %u: %s", + _index, windows_error_str(0)); + goto err_exit; + } + } else { + usbi_err(ctx, "program assertion failed - http://msdn.microsoft.com/en-us/library/ms792901.aspx is wrong."); + goto err_exit; + } + + if ((dev_interface_details = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) calloc(size, 1)) == NULL) { + usbi_err(ctx, "could not allocate interface data for index %u.", _index); + goto err_exit; + } + + dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A); + if (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, + dev_interface_details, size, &size, NULL)) { + usbi_err(ctx, "could not access interface data (actual) for index %u: %s", + _index, windows_error_str(0)); + } + + return dev_interface_details; + +err_exit: + pSetupDiDestroyDeviceInfoList(*dev_info); + *dev_info = INVALID_HANDLE_VALUE; + return NULL; +} + +/* Hash table functions - modified From glibc 2.3.2: + [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986 + [Knuth] The Art of Computer Programming, part 3 (6.4) */ +typedef struct htab_entry { + unsigned long used; + char* str; +} htab_entry; +htab_entry* htab_table = NULL; +usbi_mutex_t htab_write_mutex = NULL; +unsigned long htab_size, htab_filled; + +/* For the used double hash method the table size has to be a prime. To + correct the user given table size we need a prime test. This trivial + algorithm is adequate because the code is called only during init and + the number is likely to be small */ +static int isprime(unsigned long number) +{ + // no even number will be passed + unsigned int divider = 3; + + while((divider * divider < number) && (number % divider != 0)) + divider += 2; + + return (number % divider != 0); +} + +/* Before using the hash table we must allocate memory for it. + We allocate one element more as the found prime number says. + This is done for more effective indexing as explained in the + comment for the hash function. */ +static int htab_create(struct libusb_context *ctx, unsigned long nel) +{ + if (htab_table != NULL) { + usbi_err(ctx, "hash table already allocated"); + } + + // Create a mutex + usbi_mutex_init(&htab_write_mutex, NULL); + + // Change nel to the first prime number not smaller as nel. + nel |= 1; + while(!isprime(nel)) + nel += 2; + + htab_size = nel; + usbi_dbg("using %d entries hash table", nel); + htab_filled = 0; + + // allocate memory and zero out. + htab_table = (htab_entry*)calloc(htab_size + 1, sizeof(htab_entry)); + if (htab_table == NULL) { + usbi_err(ctx, "could not allocate space for hash table"); + return 0; + } + + return 1; +} + +/* After using the hash table it has to be destroyed. */ +static void htab_destroy(void) +{ + size_t i; + if (htab_table == NULL) { + return; + } + + for (i=0; i New entry + + // If the table is full return an error + if (htab_filled >= htab_size) { + usbi_err(NULL, "hash table is full (%d entries)", htab_size); + return 0; + } + + // Concurrent threads might be storing the same entry at the same time + // (eg. "simultaneous" enums from different threads) => use a mutex + usbi_mutex_lock(&htab_write_mutex); + // Just free any previously allocated string (which should be the same as + // new one). The possibility of concurrent threads storing a collision + // string (same hash, different string) at the same time is extremely low + safe_free(htab_table[idx].str); + htab_table[idx].used = hval; + htab_table[idx].str = (char*) calloc(1, safe_strlen(str)+1); + if (htab_table[idx].str == NULL) { + usbi_err(NULL, "could not duplicate string for hash table"); + usbi_mutex_unlock(&htab_write_mutex); + return 0; + } + memcpy(htab_table[idx].str, str, safe_strlen(str)+1); + ++htab_filled; + usbi_mutex_unlock(&htab_write_mutex); + + return idx; +} + +/* + * Returns the session ID of a device's nth level ancestor + * If there's no device at the nth level, return 0 + */ +static unsigned long get_ancestor_session_id(DWORD devinst, unsigned level) +{ + DWORD parent_devinst; + unsigned long session_id = 0; + char* sanitized_path = NULL; + char path[MAX_PATH_LENGTH]; + unsigned i; + + if (level < 1) return 0; + for (i = 0; idev); + struct libusb_config_descriptor *conf_desc; + const struct libusb_interface_descriptor *if_desc; + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + + r = libusb_get_config_descriptor(dev_handle->dev, 0, &conf_desc); + if (r != LIBUSB_SUCCESS) { + usbi_warn(ctx, "could not read config descriptor: error %d", r); + return r; + } + + if_desc = &conf_desc->interface[iface].altsetting[altsetting]; + safe_free(priv->usb_interface[iface].endpoint); + + if (if_desc->bNumEndpoints == 0) { + usbi_dbg("no endpoints found for interface %d", iface); + return LIBUSB_SUCCESS; + } + + priv->usb_interface[iface].endpoint = (uint8_t*) calloc(1, if_desc->bNumEndpoints); + if (priv->usb_interface[iface].endpoint == NULL) { + return LIBUSB_ERROR_NO_MEM; + } + + priv->usb_interface[iface].nb_endpoints = if_desc->bNumEndpoints; + for (i=0; ibNumEndpoints; i++) { + priv->usb_interface[iface].endpoint[i] = if_desc->endpoint[i].bEndpointAddress; + usbi_dbg("(re)assigned endpoint %02X to interface %d", priv->usb_interface[iface].endpoint[i], iface); + } + libusb_free_config_descriptor(conf_desc); + + // Extra init is required for WinUSB endpoints + if (priv->apib->id == USB_API_WINUSB) { + return winusb_configure_endpoints(dev_handle, iface); + } + + return LIBUSB_SUCCESS; +} + +// Lookup for a match in the list of API driver names +static bool is_api_driver(char* driver, uint8_t api) +{ + uint8_t i; + const char sep_str[2] = {LIST_SEPARATOR, 0}; + char *tok, *tmp_str; + size_t len = safe_strlen(driver); + + if (len == 0) return false; + tmp_str = (char*) calloc(1, len+1); + if (tmp_str == NULL) return false; + memcpy(tmp_str, driver, len+1); + tok = strtok(tmp_str, sep_str); + while (tok != NULL) { + for (i=0; idev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv( + transfer->dev_handle); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int current_interface = *interface_number; + int r = LIBUSB_SUCCESS; + + usbi_mutex_lock(&autoclaim_lock); + if (current_interface < 0) // No serviceable interface was found + { + for (current_interface=0; current_interfaceusb_interface[current_interface].apib->id == api_type) + && (libusb_claim_interface(transfer->dev_handle, current_interface) == LIBUSB_SUCCESS) ) { + usbi_dbg("auto-claimed interface %d for control request", current_interface); + if (handle_priv->autoclaim_count[current_interface] != 0) { + usbi_warn(ctx, "program assertion failed - autoclaim_count was nonzero"); + } + handle_priv->autoclaim_count[current_interface]++; + break; + } + } + if (current_interface == USB_MAXINTERFACES) { + usbi_err(ctx, "could not auto-claim any interface"); + r = LIBUSB_ERROR_NOT_FOUND; + } + } else { + // If we have a valid interface that was autoclaimed, we must increment + // its autoclaim count so that we can prevent an early release. + if (handle_priv->autoclaim_count[current_interface] != 0) { + handle_priv->autoclaim_count[current_interface]++; + } + } + usbi_mutex_unlock(&autoclaim_lock); + + *interface_number = current_interface; + return r; + +} + +static void auto_release(struct usbi_transfer *itransfer) +{ + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + libusb_device_handle *dev_handle = transfer->dev_handle; + struct windows_device_handle_priv* handle_priv = _device_handle_priv(dev_handle); + int r; + + usbi_mutex_lock(&autoclaim_lock); + if (handle_priv->autoclaim_count[transfer_priv->interface_number] > 0) { + handle_priv->autoclaim_count[transfer_priv->interface_number]--; + if (handle_priv->autoclaim_count[transfer_priv->interface_number] == 0) { + r = libusb_release_interface(dev_handle, transfer_priv->interface_number); + if (r == LIBUSB_SUCCESS) { + usbi_dbg("auto-released interface %d", transfer_priv->interface_number); + } else { + usbi_dbg("failed to auto-release interface %d (%s)", + transfer_priv->interface_number, libusb_error_name((enum libusb_error)r)); + } + } + } + usbi_mutex_unlock(&autoclaim_lock); +} + +/* + * init: libusb backend init function + * + * This function enumerates the HCDs (Host Controller Drivers) and populates our private HCD list + * In our implementation, we equate Windows' "HCD" to LibUSB's "bus". Note that bus is zero indexed. + * HCDs are not expected to change after init (might not hold true for hot pluggable USB PCI card?) + */ +static int windows_init(struct libusb_context *ctx) +{ + int i, r = LIBUSB_ERROR_OTHER; + OSVERSIONINFO os_version; + HANDLE semaphore; + char sem_name[11+1+8]; // strlen(libusb_init)+'\0'+(32-bit hex PID) + + sprintf(sem_name, "libusb_init%08X", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF); + semaphore = CreateSemaphoreA(NULL, 1, 1, sem_name); + if (semaphore == NULL) { + usbi_err(ctx, "could not create semaphore: %s", windows_error_str(0)); + return LIBUSB_ERROR_NO_MEM; + } + + // A successful wait brings our semaphore count to 0 (unsignaled) + // => any concurent wait stalls until the semaphore's release + if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) { + usbi_err(ctx, "failure to access semaphore: %s", windows_error_str(0)); + CloseHandle(semaphore); + return LIBUSB_ERROR_NO_MEM; + } + + // NB: concurrent usage supposes that init calls are equally balanced with + // exit calls. If init is called more than exit, we will not exit properly + if ( ++concurrent_usage == 0 ) { // First init? + // Detect OS version + memset(&os_version, 0, sizeof(OSVERSIONINFO)); + os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + windows_version = WINDOWS_UNSUPPORTED; + if ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) { + if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) { + windows_version = WINDOWS_XP; + } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) { + windows_version = WINDOWS_2003; // also includes XP 64 + } else if (os_version.dwMajorVersion >= 6) { + windows_version = WINDOWS_VISTA_AND_LATER; + } + } + if (windows_version == WINDOWS_UNSUPPORTED) { + usbi_err(ctx, "This version of Windows is NOT supported"); + r = LIBUSB_ERROR_NOT_SUPPORTED; + goto init_exit; + } + + // We need a lock for proper auto-release + usbi_mutex_init(&autoclaim_lock, NULL); + + // Initialize pollable file descriptors + init_polling(); + + // Load DLL imports + if (init_dlls() != LIBUSB_SUCCESS) { + usbi_err(ctx, "could not resolve DLL functions"); + return LIBUSB_ERROR_NOT_FOUND; + } + + // Initialize the low level APIs (we don't care about errors at this stage) + for (i=0; inum_configurations = 1; + priv->dev_descriptor.bLength = sizeof(USB_DEVICE_DESCRIPTOR); + priv->dev_descriptor.bDescriptorType = USB_DEVICE_DESCRIPTOR_TYPE; + priv->dev_descriptor.bNumConfigurations = 1; + priv->active_config = 1; + + if (priv->parent_dev == NULL) { + usbi_err(ctx, "program assertion failed - HCD hub has no parent"); + return LIBUSB_ERROR_NO_DEVICE; + } + parent_priv = _device_priv(priv->parent_dev); + if (sscanf(parent_priv->path, "\\\\.\\PCI#VEN_%04x&DEV_%04x%*s", &vid, &pid) == 2) { + priv->dev_descriptor.idVendor = (uint16_t)vid; + priv->dev_descriptor.idProduct = (uint16_t)pid; + } else { + usbi_warn(ctx, "could not infer VID/PID of HCD hub from '%s'", parent_priv->path); + priv->dev_descriptor.idVendor = 0x1d6b; // Linux Foundation root hub + priv->dev_descriptor.idProduct = 1; + } + return LIBUSB_SUCCESS; +} + +/* + * fetch and cache all the config descriptors through I/O + */ +static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle, char* device_id) +{ + DWORD size, ret_size; + struct libusb_context *ctx = DEVICE_CTX(dev); + struct windows_device_priv *priv = _device_priv(dev); + int r; + uint8_t i; + + USB_CONFIGURATION_DESCRIPTOR_SHORT cd_buf_short; // dummy request + PUSB_DESCRIPTOR_REQUEST cd_buf_actual = NULL; // actual request + PUSB_CONFIGURATION_DESCRIPTOR cd_data = NULL; + + if (dev->num_configurations == 0) + return LIBUSB_ERROR_INVALID_PARAM; + + priv->config_descriptor = (unsigned char**) calloc(dev->num_configurations, sizeof(PUSB_CONFIGURATION_DESCRIPTOR)); + if (priv->config_descriptor == NULL) + return LIBUSB_ERROR_NO_MEM; + for (i=0; inum_configurations; i++) + priv->config_descriptor[i] = NULL; + + for (i=0, r=LIBUSB_SUCCESS; ; i++) + { + // safe loop: release all dynamic resources + safe_free(cd_buf_actual); + + // safe loop: end of loop condition + if ((i >= dev->num_configurations) || (r != LIBUSB_SUCCESS)) + break; + + size = sizeof(USB_CONFIGURATION_DESCRIPTOR_SHORT); + memset(&cd_buf_short, 0, size); + + cd_buf_short.req.ConnectionIndex = (ULONG)priv->port; + cd_buf_short.req.SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN; + cd_buf_short.req.SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR; + cd_buf_short.req.SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i; + cd_buf_short.req.SetupPacket.wIndex = i; + cd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST)); + + // Dummy call to get the required data size + if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size, + &cd_buf_short, size, &ret_size, NULL)) { + usbi_err(ctx, "could not access configuration descriptor (dummy) for '%s': %s", device_id, windows_error_str(0)); + LOOP_BREAK(LIBUSB_ERROR_IO); + } + + if ((ret_size != size) || (cd_buf_short.data.wTotalLength < sizeof(USB_CONFIGURATION_DESCRIPTOR))) { + usbi_err(ctx, "unexpected configuration descriptor size (dummy) for '%s'.", device_id); + LOOP_BREAK(LIBUSB_ERROR_IO); + } + + size = sizeof(USB_DESCRIPTOR_REQUEST) + cd_buf_short.data.wTotalLength; + if ((cd_buf_actual = (PUSB_DESCRIPTOR_REQUEST) calloc(1, size)) == NULL) { + usbi_err(ctx, "could not allocate configuration descriptor buffer for '%s'.", device_id); + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); + } + memset(cd_buf_actual, 0, size); + + // Actual call + cd_buf_actual->ConnectionIndex = (ULONG)priv->port; + cd_buf_actual->SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN; + cd_buf_actual->SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR; + cd_buf_actual->SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i; + cd_buf_actual->SetupPacket.wIndex = i; + cd_buf_actual->SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST)); + + if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, cd_buf_actual, size, + cd_buf_actual, size, &ret_size, NULL)) { + usbi_err(ctx, "could not access configuration descriptor (actual) for '%s': %s", device_id, windows_error_str(0)); + LOOP_BREAK(LIBUSB_ERROR_IO); + } + + cd_data = (PUSB_CONFIGURATION_DESCRIPTOR)((UCHAR*)cd_buf_actual+sizeof(USB_DESCRIPTOR_REQUEST)); + + if ((size != ret_size) || (cd_data->wTotalLength != cd_buf_short.data.wTotalLength)) { + usbi_err(ctx, "unexpected configuration descriptor size (actual) for '%s'.", device_id); + LOOP_BREAK(LIBUSB_ERROR_IO); + } + + if (cd_data->bDescriptorType != USB_CONFIGURATION_DESCRIPTOR_TYPE) { + usbi_err(ctx, "not a configuration descriptor for '%s'", device_id); + LOOP_BREAK(LIBUSB_ERROR_IO); + } + + usbi_dbg("cached config descriptor %d (bConfigurationValue=%d, %d bytes)", + i, cd_data->bConfigurationValue, cd_data->wTotalLength); + + // Cache the descriptor + priv->config_descriptor[i] = (unsigned char*) calloc(1, cd_data->wTotalLength); + if (priv->config_descriptor[i] == NULL) + return LIBUSB_ERROR_NO_MEM; + memcpy(priv->config_descriptor[i], cd_data, cd_data->wTotalLength); + } + return LIBUSB_SUCCESS; +} + +/* + * Populate a libusb device structure + */ +static int init_device(struct libusb_device* dev, struct libusb_device* parent_dev, + uint8_t port_number, char* device_id, DWORD devinst) +{ + HANDLE handle; + DWORD size; + USB_NODE_CONNECTION_INFORMATION_EX conn_info; + struct windows_device_priv *priv, *parent_priv; + struct libusb_context *ctx = DEVICE_CTX(dev); + struct libusb_device* tmp_dev; + unsigned i; + + if ((dev == NULL) || (parent_dev == NULL)) { + return LIBUSB_ERROR_NOT_FOUND; + } + priv = _device_priv(dev); + parent_priv = _device_priv(parent_dev); + if (parent_priv->apib->id != USB_API_HUB) { + usbi_warn(ctx, "parent for device '%s' is not a hub", device_id); + return LIBUSB_ERROR_NOT_FOUND; + } + + // It is possible for the parent hub not to have been initialized yet + // If that's the case, lookup the ancestors to set the bus number + if (parent_dev->bus_number == 0) { + for (i=2; ; i++) { + tmp_dev = usbi_get_device_by_session_id(ctx, get_ancestor_session_id(devinst, i)); + if (tmp_dev == NULL) break; + if (tmp_dev->bus_number != 0) { + usbi_dbg("got bus number from ancestor #%d", i); + parent_dev->bus_number = tmp_dev->bus_number; + break; + } + } + } + if (parent_dev->bus_number == 0) { + usbi_err(ctx, "program assertion failed: unable to find ancestor bus number for '%s'", device_id); + return LIBUSB_ERROR_NOT_FOUND; + } + dev->bus_number = parent_dev->bus_number; + priv->port = port_number; + priv->depth = parent_priv->depth + 1; + priv->parent_dev = parent_dev; + + // If the device address is already set, we can stop here + if (dev->device_address != 0) { + return LIBUSB_SUCCESS; + } + memset(&conn_info, 0, sizeof(conn_info)); + if (priv->depth != 0) { // Not a HCD hub + handle = CreateFileA(parent_priv->path, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + if (handle == INVALID_HANDLE_VALUE) { + usbi_warn(ctx, "could not open hub %s: %s", parent_priv->path, windows_error_str(0)); + return LIBUSB_ERROR_ACCESS; + } + size = sizeof(conn_info); + conn_info.ConnectionIndex = (ULONG)port_number; + if (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &conn_info, size, + &conn_info, size, &size, NULL)) { + usbi_warn(ctx, "could not get node connection information for device '%s': %s", + device_id, windows_error_str(0)); + safe_closehandle(handle); + return LIBUSB_ERROR_NO_DEVICE; + } + if (conn_info.ConnectionStatus == NoDeviceConnected) { + usbi_err(ctx, "device '%s' is no longer connected!", device_id); + safe_closehandle(handle); + return LIBUSB_ERROR_NO_DEVICE; + } + memcpy(&priv->dev_descriptor, &(conn_info.DeviceDescriptor), sizeof(USB_DEVICE_DESCRIPTOR)); + dev->num_configurations = priv->dev_descriptor.bNumConfigurations; + priv->active_config = conn_info.CurrentConfigurationValue; + usbi_dbg("found %d configurations (active conf: %d)", dev->num_configurations, priv->active_config); + // If we can't read the config descriptors, just set the number of confs to zero + if (cache_config_descriptors(dev, handle, device_id) != LIBUSB_SUCCESS) { + dev->num_configurations = 0; + priv->dev_descriptor.bNumConfigurations = 0; + } + safe_closehandle(handle); + + if (conn_info.DeviceAddress > UINT8_MAX) { + usbi_err(ctx, "program assertion failed: device address overflow"); + } + dev->device_address = (uint8_t)conn_info.DeviceAddress; + switch (conn_info.Speed) { + case 0: dev->speed = LIBUSB_SPEED_LOW; break; + case 1: dev->speed = LIBUSB_SPEED_FULL; break; + case 2: dev->speed = LIBUSB_SPEED_HIGH; break; + case 3: dev->speed = LIBUSB_SPEED_SUPER; break; + default: + usbi_warn(ctx, "Got unknown device speed %d", conn_info.Speed); + break; + } + } else { + dev->device_address = UINT8_MAX; // Hubs from HCD have a devaddr of 255 + force_hcd_device_descriptor(dev); + } + + usbi_dbg("(bus: %d, addr: %d, depth: %d, port: %d): '%s'", + dev->bus_number, dev->device_address, priv->depth, priv->port, device_id); + + return LIBUSB_SUCCESS; +} + +// Returns the api type, or 0 if not found/unsupported +static uint8_t get_api_type(struct libusb_context *ctx, + HDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data) +{ + // Precedence for filter drivers vs driver is in the order of this array + struct driver_lookup lookup[3] = { + {"\0\0", SPDRP_SERVICE, "driver"}, + {"\0\0", SPDRP_UPPERFILTERS, "upper filter driver"}, + {"\0\0", SPDRP_LOWERFILTERS, "lower filter driver"} + }; + DWORD size, reg_type; + unsigned k, l; + uint8_t api; + + // Check the service & filter names to know the API we should use + for (k=0; k<3; k++) { + if (pSetupDiGetDeviceRegistryPropertyA(*dev_info, dev_info_data, lookup[k].reg_prop, + ®_type, (BYTE*)lookup[k].list, MAX_KEY_LENGTH, &size)) { + // Turn the REG_SZ SPDRP_SERVICE into REG_MULTI_SZ + if (lookup[k].reg_prop == SPDRP_SERVICE) { + // our buffers are MAX_KEY_LENGTH+1 so we can overflow if needed + lookup[k].list[safe_strlen(lookup[k].list)+1] = 0; + } + // MULTI_SZ is a pain to work with. Turn it into something much more manageable + // NB: none of the driver names we check against contain LIST_SEPARATOR, + // (currently ';'), so even if an unsuported one does, it's not an issue + for (l=0; (lookup[k].list[l] != 0) || (lookup[k].list[l+1] != 0); l++) { + if (lookup[k].list[l] == 0) { + lookup[k].list[l] = LIST_SEPARATOR; + } + } + upperize(lookup[k].list); + usbi_dbg("%s(s): %s", lookup[k].designation, lookup[k].list); + } else { + if (GetLastError() != ERROR_INVALID_DATA) { + usbi_dbg("could not access %s: %s", lookup[k].designation, windows_error_str(0)); + } + lookup[k].list[0] = 0; + } + } + + for (api=1; api= 3) continue; + return api; + } + return 0; +} + +static int set_composite_interface(struct libusb_context* ctx, struct libusb_device* dev, + char* dev_interface_path, char* device_id, uint8_t api) +{ + unsigned i; + struct windows_device_priv *priv = _device_priv(dev); + int interface_number; + + if (priv->apib->id != USB_API_COMPOSITE) { + usbi_err(ctx, "program assertion failed: '%s' is not composite", device_id); + return LIBUSB_ERROR_NO_DEVICE; + } + + // Because MI_## are not necessarily in sequential order (some composite + // devices will have only MI_00 & MI_03 for instance), we retrieve the actual + // interface number from the path's MI value + interface_number = 0; + for (i=0; device_id[i] != 0; ) { + if ( (device_id[i++] == 'M') && (device_id[i++] == 'I') + && (device_id[i++] == '_') ) { + interface_number = (device_id[i++] - '0')*10; + interface_number += device_id[i] - '0'; + break; + } + } + + if (device_id[i] == 0) { + usbi_warn(ctx, "failure to read interface number for %s. Using default value %d", + device_id, interface_number); + } + + if (priv->usb_interface[interface_number].path != NULL) { + usbi_warn(ctx, "interface[%d] already set - ignoring: %s", interface_number, device_id); + return LIBUSB_ERROR_ACCESS; + } + + usbi_dbg("interface[%d] = %s", interface_number, dev_interface_path); + priv->usb_interface[interface_number].path = dev_interface_path; + priv->usb_interface[interface_number].apib = &usb_api_backend[api]; + priv->composite_api_flags |= 1<DevicePath); + if (dev_interface_path == NULL) { + usbi_warn(ctx, "could not sanitize device interface path for '%s'", dev_interface_details->DevicePath); + continue; + } + } + } else { + // Workaround for a Nec/Renesas USB 3.0 driver bug where root hubs are + // being listed under the "NUSB3" PnP Symbolic Name rather than "USB" + while ( (class_index < 2) && + (!(b = get_devinfo_data(ctx, &dev_info, &dev_info_data, usb_class[class_index], i))) ) { + class_index++; + i = 0; + } + if (!b) break; + } + + // Read the Device ID path. This is what we'll use as UID + // Note that if the device is plugged in a different port or hub, the Device ID changes + if (CM_Get_Device_IDA(dev_info_data.DevInst, path, sizeof(path), 0) != CR_SUCCESS) { + usbi_warn(ctx, "could not read the device id path for devinst %X, skipping", + dev_info_data.DevInst); + continue; + } + dev_id_path = sanitize_path(path); + if (dev_id_path == NULL) { + usbi_warn(ctx, "could not sanitize device id path for devinst %X, skipping", + dev_info_data.DevInst); + continue; + } +#ifdef ENUM_DEBUG + usbi_dbg("PRO: %s", dev_id_path); +#endif + + // The SPDRP_ADDRESS for USB devices is the device port number on the hub + port_nr = 0; + if ((pass >= HUB_PASS) && (pass <= GEN_PASS)) { + if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS, + ®_type, (BYTE*)&port_nr, 4, &size)) + || (size != 4) ) { + usbi_warn(ctx, "could not retrieve port number for device '%s', skipping: %s", + dev_id_path, windows_error_str(0)); + continue; + } + } + + // Set API to use or get additional data from generic pass + api = USB_API_UNSUPPORTED; + switch (pass) { + case HCD_PASS: + break; + case GEN_PASS: + // We use the GEN pass to detect driverless devices... + size = sizeof(strbuf); + if (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER, + ®_type, (BYTE*)strbuf, size, &size)) { + usbi_info(ctx, "The following device has no driver: '%s'", dev_id_path); + usbi_info(ctx, "libusb will not be able to access it."); + } + // ...and to add the additional device interface GUIDs + key = pSetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ); + if (key != INVALID_HANDLE_VALUE) { + size = sizeof(guid_string_w); + s = pRegQueryValueExW(key, L"DeviceInterfaceGUIDs", NULL, ®_type, + (BYTE*)guid_string_w, &size); + pRegCloseKey(key); + if (s == ERROR_SUCCESS) { + if (nb_guids >= MAX_ENUM_GUIDS) { + // If this assert is ever reported, grow a GUID table dynamically + usbi_err(ctx, "program assertion failed: too many GUIDs"); + LOOP_BREAK(LIBUSB_ERROR_OVERFLOW); + } + if_guid = (GUID*) calloc(1, sizeof(GUID)); + pCLSIDFromString(guid_string_w, if_guid); + guid[nb_guids++] = if_guid; + usbi_dbg("extra GUID: %s", guid_to_string(if_guid)); + } + } + break; + default: + // Get the API type (after checking that the driver installation is OK) + if ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_INSTALL_STATE, + ®_type, (BYTE*)&install_state, 4, &size)) + || (size != 4) ){ + usbi_warn(ctx, "could not detect installation state of driver for '%s': %s", + dev_id_path, windows_error_str(0)); + } else if (install_state != 0) { + usbi_warn(ctx, "driver for device '%s' is reporting an issue (code: %d) - skipping", + dev_id_path, install_state); + continue; + } + api = get_api_type(ctx, &dev_info, &dev_info_data); + break; + } + + // Find parent device (for the passes that need it) + switch (pass) { + case HCD_PASS: + case DEV_PASS: + case HUB_PASS: + break; + default: + // Go through the ancestors until we see a face we recognize + parent_dev = NULL; + for (ancestor = 1; parent_dev == NULL; ancestor++) { + session_id = get_ancestor_session_id(dev_info_data.DevInst, ancestor); + if (session_id == 0) { + break; + } + parent_dev = usbi_get_device_by_session_id(ctx, session_id); + } + if (parent_dev == NULL) { + usbi_dbg("unlisted ancestor for '%s' (newly connected, etc.) - ignoring", dev_id_path); + continue; + } + parent_priv = _device_priv(parent_dev); + // virtual USB devices are also listed during GEN - don't process these yet + if ( (pass == GEN_PASS) && (parent_priv->apib->id != USB_API_HUB) ) { + continue; + } + break; + } + + // Create new or match existing device, using the (hashed) device_id as session id + if (pass <= DEV_PASS) { // For subsequent passes, we'll lookup the parent + // These are the passes that create "new" devices + session_id = htab_hash(dev_id_path); + dev = usbi_get_device_by_session_id(ctx, session_id); + if (dev == NULL) { + if (pass == DEV_PASS) { + // This can occur if the OS only reports a newly plugged device after we started enum + usbi_warn(ctx, "'%s' was only detected in late pass (newly connected device?)" + " - ignoring", dev_id_path); + continue; + } + usbi_dbg("allocating new device for session [%X]", session_id); + if ((dev = usbi_alloc_device(ctx, session_id)) == NULL) { + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); + } + windows_device_priv_init(dev); + // Keep track of devices that need unref + unref_list[unref_cur++] = dev; + if (unref_cur >= unref_size) { + unref_size += 64; + unref_list = realloc(unref_list, unref_size*sizeof(libusb_device*)); + if (unref_list == NULL) { + usbi_err(ctx, "could not realloc list for unref - aborting."); + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); + } + } + } else { + usbi_dbg("found existing device for session [%X] (%d.%d)", + session_id, dev->bus_number, dev->device_address); + } + priv = _device_priv(dev); + } + + // Setup device + switch (pass) { + case HCD_PASS: + dev->bus_number = (uint8_t)(i + 1); // bus 0 is reserved for disconnected + dev->device_address = 0; + dev->num_configurations = 0; + priv->apib = &usb_api_backend[USB_API_HUB]; + priv->depth = UINT8_MAX; // Overflow to 0 for HCD Hubs + priv->path = dev_interface_path; dev_interface_path = NULL; + break; + case HUB_PASS: + case DEV_PASS: + // If the device has already been setup, don't do it again + if (priv->path != NULL) + break; + // Take care of API initialization + priv->path = dev_interface_path; dev_interface_path = NULL; + priv->apib = &usb_api_backend[api]; + switch(api) { + case USB_API_COMPOSITE: + case USB_API_HUB: + break; + default: + // For other devices, the first interface is the same as the device + priv->usb_interface[0].path = (char*) calloc(safe_strlen(priv->path)+1, 1); + if (priv->usb_interface[0].path != NULL) { + safe_strcpy(priv->usb_interface[0].path, safe_strlen(priv->path)+1, priv->path); + } else { + usbi_warn(ctx, "could not duplicate interface path '%s'", priv->path); + } + // The following is needed if we want API calls to work for both simple + // and composite devices. + for(j=0; jusb_interface[j].apib = &usb_api_backend[api]; + } + break; + } + break; + case GEN_PASS: + r = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path, dev_info_data.DevInst); + if (r == LIBUSB_SUCCESS) { + // Append device to the list of discovered devices + discdevs = discovered_devs_append(*_discdevs, dev); + if (!discdevs) { + LOOP_BREAK(LIBUSB_ERROR_NO_MEM); + } + *_discdevs = discdevs; + } else if (r == LIBUSB_ERROR_NO_DEVICE) { + // This can occur if the device was disconnected but Windows hasn't + // refreshed its enumeration yet - in that case, we ignore the device + r = LIBUSB_SUCCESS; + } + break; + default: // later passes + if (parent_priv->apib->id == USB_API_COMPOSITE) { + usbi_dbg("setting composite interface for [%lX]:", parent_dev->session_data); + switch (set_composite_interface(ctx, parent_dev, dev_interface_path, dev_id_path, api)) { + case LIBUSB_SUCCESS: + dev_interface_path = NULL; + break; + case LIBUSB_ERROR_ACCESS: + // interface has already been set => make sure dev_interface_path is freed then + break; + default: + LOOP_BREAK(r); + break; + } + } + break; + } + } + } + + // Free any additional GUIDs + for (pass = DEV_PASS+1; pass < nb_guids; pass++) { + safe_free(guid[pass]); + } + + // Unref newly allocated devs + for (i=0; i any concurent wait stalls until the semaphore release + if (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) { + CloseHandle(semaphore); + return; + } + + // Only works if exits and inits are balanced exactly + if (--concurrent_usage < 0) { // Last exit + for (i=0; idev_descriptor), DEVICE_DESC_LENGTH); + *host_endian = 0; + + return LIBUSB_SUCCESS; +} + +static int windows_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) +{ + struct windows_device_priv *priv = _device_priv(dev); + PUSB_CONFIGURATION_DESCRIPTOR config_header; + size_t size; + + // config index is zero based + if (config_index >= dev->num_configurations) + return LIBUSB_ERROR_INVALID_PARAM; + + if ((priv->config_descriptor == NULL) || (priv->config_descriptor[config_index] == NULL)) + return LIBUSB_ERROR_NOT_FOUND; + + config_header = (PUSB_CONFIGURATION_DESCRIPTOR)priv->config_descriptor[config_index]; + + size = min(config_header->wTotalLength, len); + memcpy(buffer, priv->config_descriptor[config_index], size); + + return LIBUSB_SUCCESS; +} + +/* + * return the cached copy of the active config descriptor + */ +static int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) +{ + struct windows_device_priv *priv = _device_priv(dev); + + if (priv->active_config == 0) + return LIBUSB_ERROR_NOT_FOUND; + + // config index is zero based + return windows_get_config_descriptor(dev, (uint8_t)(priv->active_config-1), buffer, len, host_endian); +} + +static int windows_open(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + + if (priv->apib == NULL) { + usbi_err(ctx, "program assertion failed - device is not initialized"); + return LIBUSB_ERROR_NO_DEVICE; + } + + return priv->apib->open(dev_handle); +} + +static void windows_close(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + + priv->apib->close(dev_handle); +} + +static int windows_get_configuration(struct libusb_device_handle *dev_handle, int *config) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + + if (priv->active_config == 0) { + *config = 0; + return LIBUSB_ERROR_NOT_FOUND; + } + + *config = priv->active_config; + return LIBUSB_SUCCESS; +} + +/* + * from http://msdn.microsoft.com/en-us/library/ms793522.aspx: "The port driver + * does not currently expose a service that allows higher-level drivers to set + * the configuration." + */ +static int windows_set_configuration(struct libusb_device_handle *dev_handle, int config) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + int r = LIBUSB_SUCCESS; + + if (config >= USB_MAXCONFIG) + return LIBUSB_ERROR_INVALID_PARAM; + + r = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_OUT | + LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE, + LIBUSB_REQUEST_SET_CONFIGURATION, (uint16_t)config, + 0, NULL, 0, 1000); + + if (r == LIBUSB_SUCCESS) { + priv->active_config = (uint8_t)config; + } + return r; +} + +static int windows_claim_interface(struct libusb_device_handle *dev_handle, int iface) +{ + int r = LIBUSB_SUCCESS; + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + + if (iface >= USB_MAXINTERFACES) + return LIBUSB_ERROR_INVALID_PARAM; + + safe_free(priv->usb_interface[iface].endpoint); + priv->usb_interface[iface].nb_endpoints= 0; + + r = priv->apib->claim_interface(dev_handle, iface); + + if (r == LIBUSB_SUCCESS) { + r = windows_assign_endpoints(dev_handle, iface, 0); + } + + return r; +} + +static int windows_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) +{ + int r = LIBUSB_SUCCESS; + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + + safe_free(priv->usb_interface[iface].endpoint); + priv->usb_interface[iface].nb_endpoints= 0; + + r = priv->apib->set_interface_altsetting(dev_handle, iface, altsetting); + + if (r == LIBUSB_SUCCESS) { + r = windows_assign_endpoints(dev_handle, iface, altsetting); + } + + return r; +} + +static int windows_release_interface(struct libusb_device_handle *dev_handle, int iface) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + + return priv->apib->release_interface(dev_handle, iface); +} + +static int windows_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + return priv->apib->clear_halt(dev_handle, endpoint); +} + +static int windows_reset_device(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + return priv->apib->reset_device(dev_handle); +} + +// The 3 functions below are unlikely to ever get supported on Windows +static int windows_kernel_driver_active(struct libusb_device_handle *dev_handle, int iface) +{ + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +static int windows_attach_kernel_driver(struct libusb_device_handle *dev_handle, int iface) +{ + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +static int windows_detach_kernel_driver(struct libusb_device_handle *dev_handle, int iface) +{ + return LIBUSB_ERROR_NOT_SUPPORTED; +} + +static void windows_destroy_device(struct libusb_device *dev) +{ + windows_device_priv_release(dev); +} + +static void windows_clear_transfer_priv(struct usbi_transfer *itransfer) +{ + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + + usbi_free_fd(transfer_priv->pollable_fd.fd); + // When auto claim is in use, attempt to release the auto-claimed interface + auto_release(itransfer); +} + +static int submit_bulk_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int r; + + r = priv->apib->submit_bulk_transfer(itransfer); + if (r != LIBUSB_SUCCESS) { + return r; + } + + usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, + (short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT)); + + return LIBUSB_SUCCESS; +} + +static int submit_iso_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int r; + + r = priv->apib->submit_iso_transfer(itransfer); + if (r != LIBUSB_SUCCESS) { + return r; + } + + usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, + (short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT)); + + return LIBUSB_SUCCESS; +} + +static int submit_control_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int r; + + r = priv->apib->submit_control_transfer(itransfer); + if (r != LIBUSB_SUCCESS) { + return r; + } + + usbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, POLLIN); + + return LIBUSB_SUCCESS; + +} + +static int windows_submit_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + return submit_control_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + if (IS_XFEROUT(transfer) && + transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) + return LIBUSB_ERROR_NOT_SUPPORTED; + return submit_bulk_transfer(itransfer); + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return submit_iso_transfer(itransfer); + default: + usbi_err(TRANSFER_CTX(transfer), "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +static int windows_abort_control(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + + return priv->apib->abort_control(itransfer); +} + +static int windows_abort_transfers(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + + return priv->apib->abort_transfers(itransfer); +} + +static int windows_cancel_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + return windows_abort_control(itransfer); + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + return windows_abort_transfers(itransfer); + default: + usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type); + return LIBUSB_ERROR_INVALID_PARAM; + } +} + +static void windows_transfer_callback(struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int status; + + usbi_dbg("handling I/O completion with errcode %d", io_result); + + switch(io_result) { + case NO_ERROR: + status = priv->apib->copy_transfer_data(itransfer, io_size); + break; + case ERROR_GEN_FAILURE: + usbi_dbg("detected endpoint stall"); + status = LIBUSB_TRANSFER_STALL; + break; + case ERROR_SEM_TIMEOUT: + usbi_dbg("detected semaphore timeout"); + status = LIBUSB_TRANSFER_TIMED_OUT; + break; + case ERROR_OPERATION_ABORTED: + if (itransfer->flags & USBI_TRANSFER_TIMED_OUT) { + usbi_dbg("detected timeout"); + status = LIBUSB_TRANSFER_TIMED_OUT; + } else { + usbi_dbg("detected operation aborted"); + status = LIBUSB_TRANSFER_CANCELLED; + } + break; + default: + usbi_err(ITRANSFER_CTX(itransfer), "detected I/O error: %s", windows_error_str(0)); + status = LIBUSB_TRANSFER_ERROR; + break; + } + windows_clear_transfer_priv(itransfer); // Cancel polling + usbi_handle_transfer_completion(itransfer, (enum libusb_transfer_status)status); +} + +static void windows_handle_callback (struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + + switch (transfer->type) { + case LIBUSB_TRANSFER_TYPE_CONTROL: + case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_INTERRUPT: + case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + windows_transfer_callback (itransfer, io_result, io_size); + break; + default: + usbi_err(ITRANSFER_CTX(itransfer), "unknown endpoint type %d", transfer->type); + } +} + +static int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) +{ + struct windows_transfer_priv* transfer_priv = NULL; + POLL_NFDS_TYPE i = 0; + bool found = false; + struct usbi_transfer *transfer; + DWORD io_size, io_result; + + usbi_mutex_lock(&ctx->open_devs_lock); + for (i = 0; i < nfds && num_ready > 0; i++) { + + usbi_dbg("checking fd %d with revents = %04x", fds[i].fd, fds[i].revents); + + if (!fds[i].revents) { + continue; + } + + num_ready--; + + // Because a Windows OVERLAPPED is used for poll emulation, + // a pollable fd is created and stored with each transfer + usbi_mutex_lock(&ctx->flying_transfers_lock); + list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { + transfer_priv = usbi_transfer_get_os_priv(transfer); + if (transfer_priv->pollable_fd.fd == fds[i].fd) { + found = true; + break; + } + } + usbi_mutex_unlock(&ctx->flying_transfers_lock); + + if (found) { + // Handle async requests that completed synchronously first + if (HasOverlappedIoCompletedSync(transfer_priv->pollable_fd.overlapped)) { + io_result = NO_ERROR; + io_size = (DWORD)transfer_priv->pollable_fd.overlapped->InternalHigh; + // Regular async overlapped + } else if (GetOverlappedResult(transfer_priv->pollable_fd.handle, + transfer_priv->pollable_fd.overlapped, &io_size, false)) { + io_result = NO_ERROR; + } else { + io_result = GetLastError(); + } + usbi_remove_pollfd(ctx, transfer_priv->pollable_fd.fd); + // let handle_callback free the event using the transfer wfd + // If you don't use the transfer wfd, you run a risk of trying to free a + // newly allocated wfd that took the place of the one from the transfer. + windows_handle_callback(transfer, io_result, io_size); + } else { + usbi_err(ctx, "could not find a matching transfer for fd %x", fds[i]); + return LIBUSB_ERROR_NOT_FOUND; + } + } + + usbi_mutex_unlock(&ctx->open_devs_lock); + return LIBUSB_SUCCESS; +} + +/* + * Monotonic and real time functions + */ +unsigned __stdcall windows_clock_gettime_threaded(void* param) +{ + LARGE_INTEGER hires_counter, li_frequency; + LONG nb_responses; + int timer_index; + + // Init - find out if we have access to a monotonic (hires) timer + if (!QueryPerformanceFrequency(&li_frequency)) { + usbi_dbg("no hires timer available on this platform"); + hires_frequency = 0; + hires_ticks_to_ps = UINT64_C(0); + } else { + hires_frequency = li_frequency.QuadPart; + // The hires frequency can go as high as 4 GHz, so we'll use a conversion + // to picoseconds to compute the tv_nsecs part in clock_gettime + hires_ticks_to_ps = UINT64_C(1000000000000) / hires_frequency; + usbi_dbg("hires timer available (Frequency: %"PRIu64" Hz)", hires_frequency); + } + + // Main loop - wait for requests + while (1) { + timer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0; + if ( (timer_index != 0) && (timer_index != 1) ) { + usbi_dbg("failure to wait on requests: %s", windows_error_str(0)); + continue; + } + if (request_count[timer_index] == 0) { + // Request already handled + ResetEvent(timer_request[timer_index]); + // There's still a possiblity that a thread sends a request between the + // time we test request_count[] == 0 and we reset the event, in which case + // the request would be ignored. The simple solution to that is to test + // request_count again and process requests if non zero. + if (request_count[timer_index] == 0) + continue; + } + switch (timer_index) { + case 0: + WaitForSingleObject(timer_mutex, INFINITE); + // Requests to this thread are for hires always + if (QueryPerformanceCounter(&hires_counter) != 0) { + timer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency); + timer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps); + } else { + // Fallback to real-time if we can't get monotonic value + // Note that real-time clock does not wait on the mutex or this thread. + windows_clock_gettime(USBI_CLOCK_REALTIME, &timer_tp); + } + ReleaseMutex(timer_mutex); + + nb_responses = InterlockedExchange((LONG*)&request_count[0], 0); + if ( (nb_responses) + && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) { + usbi_dbg("unable to release timer semaphore %d: %s", windows_error_str(0)); + } + continue; + case 1: // time to quit + usbi_dbg("timer thread quitting"); + return 0; + } + } + usbi_dbg("ERROR: broken timer thread"); + return 1; +} + +static int windows_clock_gettime(int clk_id, struct timespec *tp) +{ + FILETIME filetime; + ULARGE_INTEGER rtime; + DWORD r; + switch(clk_id) { + case USBI_CLOCK_MONOTONIC: + if (hires_frequency != 0) { + while (1) { + InterlockedIncrement((LONG*)&request_count[0]); + SetEvent(timer_request[0]); + r = WaitForSingleObject(timer_response, TIMER_REQUEST_RETRY_MS); + switch(r) { + case WAIT_OBJECT_0: + WaitForSingleObject(timer_mutex, INFINITE); + *tp = timer_tp; + ReleaseMutex(timer_mutex); + return LIBUSB_SUCCESS; + case WAIT_TIMEOUT: + usbi_dbg("could not obtain a timer value within reasonable timeframe - too much load?"); + break; // Retry until successful + default: + usbi_dbg("WaitForSingleObject failed: %s", windows_error_str(0)); + return LIBUSB_ERROR_OTHER; + } + } + } + // Fall through and return real-time if monotonic was not detected @ timer init + case USBI_CLOCK_REALTIME: + // We follow http://msdn.microsoft.com/en-us/library/ms724928%28VS.85%29.aspx + // with a predef epoch_time to have an epoch that starts at 1970.01.01 00:00 + // Note however that our resolution is bounded by the Windows system time + // functions and is at best of the order of 1 ms (or, usually, worse) + GetSystemTimeAsFileTime(&filetime); + rtime.LowPart = filetime.dwLowDateTime; + rtime.HighPart = filetime.dwHighDateTime; + rtime.QuadPart -= epoch_time; + tp->tv_sec = (long)(rtime.QuadPart / 10000000); + tp->tv_nsec = (long)((rtime.QuadPart % 10000000)*100); + return LIBUSB_SUCCESS; + default: + return LIBUSB_ERROR_INVALID_PARAM; + } +} + + +// NB: MSVC6 does not support named initializers. +const struct usbi_os_backend windows_backend = { + "Windows", + windows_init, + windows_exit, + + windows_get_device_list, + windows_open, + windows_close, + + windows_get_device_descriptor, + windows_get_active_config_descriptor, + windows_get_config_descriptor, + + windows_get_configuration, + windows_set_configuration, + windows_claim_interface, + windows_release_interface, + + windows_set_interface_altsetting, + windows_clear_halt, + windows_reset_device, + + windows_kernel_driver_active, + windows_detach_kernel_driver, + windows_attach_kernel_driver, + + windows_destroy_device, + + windows_submit_transfer, + windows_cancel_transfer, + windows_clear_transfer_priv, + + windows_handle_events, + + windows_clock_gettime, +#if defined(USBI_TIMERFD_AVAILABLE) + NULL, +#endif + sizeof(struct windows_device_priv), + sizeof(struct windows_device_handle_priv), + sizeof(struct windows_transfer_priv), + 0, +}; + + +/* + * USB API backends + */ +static int unsupported_init(struct libusb_context *ctx) { + return LIBUSB_SUCCESS; +} +static int unsupported_exit(void) { + return LIBUSB_SUCCESS; +} +static int unsupported_open(struct libusb_device_handle *dev_handle) { + PRINT_UNSUPPORTED_API(open); +} +static void unsupported_close(struct libusb_device_handle *dev_handle) { + usbi_dbg("unsupported API call for 'close'"); +} +static int unsupported_claim_interface(struct libusb_device_handle *dev_handle, int iface) { + PRINT_UNSUPPORTED_API(claim_interface); +} +static int unsupported_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) { + PRINT_UNSUPPORTED_API(set_interface_altsetting); +} +static int unsupported_release_interface(struct libusb_device_handle *dev_handle, int iface) { + PRINT_UNSUPPORTED_API(release_interface); +} +static int unsupported_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) { + PRINT_UNSUPPORTED_API(clear_halt); +} +static int unsupported_reset_device(struct libusb_device_handle *dev_handle) { + PRINT_UNSUPPORTED_API(reset_device); +} +static int unsupported_submit_bulk_transfer(struct usbi_transfer *itransfer) { + PRINT_UNSUPPORTED_API(submit_bulk_transfer); +} +static int unsupported_submit_iso_transfer(struct usbi_transfer *itransfer) { + PRINT_UNSUPPORTED_API(submit_iso_transfer); +} +static int unsupported_submit_control_transfer(struct usbi_transfer *itransfer) { + PRINT_UNSUPPORTED_API(submit_control_transfer); +} +static int unsupported_abort_control(struct usbi_transfer *itransfer) { + PRINT_UNSUPPORTED_API(abort_control); +} +static int unsupported_abort_transfers(struct usbi_transfer *itransfer) { + PRINT_UNSUPPORTED_API(abort_transfers); +} +static int unsupported_copy_transfer_data(struct usbi_transfer *itransfer, uint32_t io_size) { + PRINT_UNSUPPORTED_API(copy_transfer_data); +} + +// These names must be uppercase +const char* hub_driver_names[] = {"USBHUB", "USBHUB3", "NUSB3HUB", "FLXHCIH", "TIHUB3", "ETRONHUB3", "VIAHUB3", "ASMTHUB3"}; +const char* composite_driver_names[] = {"USBCCGP"}; +const char* winusb_driver_names[] = {"WINUSB"}; +const struct windows_usb_api_backend usb_api_backend[USB_API_MAX] = { + { + USB_API_UNSUPPORTED, + "Unsupported API", + &CLASS_GUID_UNSUPPORTED, + NULL, + 0, + unsupported_init, + unsupported_exit, + unsupported_open, + unsupported_close, + unsupported_claim_interface, + unsupported_set_interface_altsetting, + unsupported_release_interface, + unsupported_clear_halt, + unsupported_reset_device, + unsupported_submit_bulk_transfer, + unsupported_submit_iso_transfer, + unsupported_submit_control_transfer, + unsupported_abort_control, + unsupported_abort_transfers, + unsupported_copy_transfer_data, + }, { + USB_API_HUB, + "HUB API", + &CLASS_GUID_UNSUPPORTED, + hub_driver_names, + sizeof(hub_driver_names)/sizeof(hub_driver_names[0]), + unsupported_init, + unsupported_exit, + unsupported_open, + unsupported_close, + unsupported_claim_interface, + unsupported_set_interface_altsetting, + unsupported_release_interface, + unsupported_clear_halt, + unsupported_reset_device, + unsupported_submit_bulk_transfer, + unsupported_submit_iso_transfer, + unsupported_submit_control_transfer, + unsupported_abort_control, + unsupported_abort_transfers, + unsupported_copy_transfer_data, + }, { + USB_API_COMPOSITE, + "Composite API", + &CLASS_GUID_COMPOSITE, + composite_driver_names, + sizeof(composite_driver_names)/sizeof(composite_driver_names[0]), + composite_init, + composite_exit, + composite_open, + composite_close, + composite_claim_interface, + composite_set_interface_altsetting, + composite_release_interface, + composite_clear_halt, + composite_reset_device, + composite_submit_bulk_transfer, + composite_submit_iso_transfer, + composite_submit_control_transfer, + composite_abort_control, + composite_abort_transfers, + composite_copy_transfer_data, + }, { + USB_API_WINUSB, + "WinUSB API", + &CLASS_GUID_LIBUSB_WINUSB, + winusb_driver_names, + sizeof(winusb_driver_names)/sizeof(winusb_driver_names[0]), + winusb_init, + winusb_exit, + winusb_open, + winusb_close, + winusb_claim_interface, + winusb_set_interface_altsetting, + winusb_release_interface, + winusb_clear_halt, + winusb_reset_device, + winusb_submit_bulk_transfer, + unsupported_submit_iso_transfer, + winusb_submit_control_transfer, + winusb_abort_control, + winusb_abort_transfers, + winusb_copy_transfer_data, + }, +}; + + +/* + * WinUSB API functions + */ +static int winusb_init(struct libusb_context *ctx) +{ + DLL_LOAD(winusb.dll, WinUsb_Initialize, TRUE); + DLL_LOAD(winusb.dll, WinUsb_Free, TRUE); + DLL_LOAD(winusb.dll, WinUsb_GetAssociatedInterface, TRUE); + DLL_LOAD(winusb.dll, WinUsb_GetDescriptor, TRUE); + DLL_LOAD(winusb.dll, WinUsb_QueryInterfaceSettings, TRUE); + DLL_LOAD(winusb.dll, WinUsb_QueryDeviceInformation, TRUE); + DLL_LOAD(winusb.dll, WinUsb_SetCurrentAlternateSetting, TRUE); + DLL_LOAD(winusb.dll, WinUsb_GetCurrentAlternateSetting, TRUE); + DLL_LOAD(winusb.dll, WinUsb_QueryPipe, TRUE); + DLL_LOAD(winusb.dll, WinUsb_SetPipePolicy, TRUE); + DLL_LOAD(winusb.dll, WinUsb_GetPipePolicy, TRUE); + DLL_LOAD(winusb.dll, WinUsb_ReadPipe, TRUE); + DLL_LOAD(winusb.dll, WinUsb_WritePipe, TRUE); + DLL_LOAD(winusb.dll, WinUsb_ControlTransfer, TRUE); + DLL_LOAD(winusb.dll, WinUsb_ResetPipe, TRUE); + DLL_LOAD(winusb.dll, WinUsb_AbortPipe, TRUE); + DLL_LOAD(winusb.dll, WinUsb_FlushPipe, TRUE); + + api_winusb_available = true; + return LIBUSB_SUCCESS; +} + +static int winusb_exit(void) +{ + return LIBUSB_SUCCESS; +} + +// NB: open and close must ensure that they only handle interface of +// the right API type, as these functions can be called wholesale from +// composite_open(), with interfaces belonging to different APIs +static int winusb_open(struct libusb_device_handle *dev_handle) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + + HANDLE file_handle; + int i; + + CHECK_WINUSB_AVAILABLE; + + // WinUSB requires a seperate handle for each interface + for (i = 0; i < USB_MAXINTERFACES; i++) { + if ( (priv->usb_interface[i].path != NULL) + && (priv->usb_interface[i].apib->id == USB_API_WINUSB) ) { + file_handle = CreateFileA(priv->usb_interface[i].path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); + if (file_handle == INVALID_HANDLE_VALUE) { + usbi_err(ctx, "could not open device %s (interface %d): %s", priv->usb_interface[i].path, i, windows_error_str(0)); + switch(GetLastError()) { + case ERROR_FILE_NOT_FOUND: // The device was disconnected + return LIBUSB_ERROR_NO_DEVICE; + case ERROR_ACCESS_DENIED: + return LIBUSB_ERROR_ACCESS; + default: + return LIBUSB_ERROR_IO; + } + } + handle_priv->interface_handle[i].dev_handle = file_handle; + } + } + + return LIBUSB_SUCCESS; +} + +static void winusb_close(struct libusb_device_handle *dev_handle) +{ + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + HANDLE file_handle; + int i; + + if (!api_winusb_available) + return; + + for (i = 0; i < USB_MAXINTERFACES; i++) { + if (priv->usb_interface[i].apib->id == USB_API_WINUSB) { + file_handle = handle_priv->interface_handle[i].dev_handle; + if ( (file_handle != 0) && (file_handle != INVALID_HANDLE_VALUE)) { + CloseHandle(file_handle); + } + } + } +} + +static int winusb_configure_endpoints(struct libusb_device_handle *dev_handle, int iface) +{ + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + HANDLE winusb_handle = handle_priv->interface_handle[iface].api_handle; + UCHAR policy; + ULONG timeout = 0; + uint8_t endpoint_address; + int i; + + CHECK_WINUSB_AVAILABLE; + + // With handle and enpoints set (in parent), we can setup the default pipe properties + // see http://download.microsoft.com/download/D/1/D/D1DD7745-426B-4CC3-A269-ABBBE427C0EF/DVC-T705_DDC08.pptx + for (i=-1; iusb_interface[iface].nb_endpoints; i++) { + endpoint_address =(i==-1)?0:priv->usb_interface[iface].endpoint[i]; + if (!WinUsb_SetPipePolicy(winusb_handle, endpoint_address, + PIPE_TRANSFER_TIMEOUT, sizeof(ULONG), &timeout)) { + usbi_dbg("failed to set PIPE_TRANSFER_TIMEOUT for control endpoint %02X", endpoint_address); + } + if (i == -1) continue; // Other policies don't apply to control endpoint + policy = false; + if (!WinUsb_SetPipePolicy(winusb_handle, endpoint_address, + SHORT_PACKET_TERMINATE, sizeof(UCHAR), &policy)) { + usbi_dbg("failed to disable SHORT_PACKET_TERMINATE for endpoint %02X", endpoint_address); + } + if (!WinUsb_SetPipePolicy(winusb_handle, endpoint_address, + IGNORE_SHORT_PACKETS, sizeof(UCHAR), &policy)) { + usbi_dbg("failed to disable IGNORE_SHORT_PACKETS for endpoint %02X", endpoint_address); + } + if (!WinUsb_SetPipePolicy(winusb_handle, endpoint_address, + ALLOW_PARTIAL_READS, sizeof(UCHAR), &policy)) { + usbi_dbg("failed to disable ALLOW_PARTIAL_READS for endpoint %02X", endpoint_address); + } + policy = true; + if (!WinUsb_SetPipePolicy(winusb_handle, endpoint_address, + AUTO_CLEAR_STALL, sizeof(UCHAR), &policy)) { + usbi_dbg("failed to enable AUTO_CLEAR_STALL for endpoint %02X", endpoint_address); + } + } + + return LIBUSB_SUCCESS; +} + +static int winusb_claim_interface(struct libusb_device_handle *dev_handle, int iface) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE); + HANDLE file_handle, winusb_handle; + + CHECK_WINUSB_AVAILABLE; + + // If the device is composite, but using the default Windows composite parent driver (usbccgp) + // or if it's the first WinUSB interface, we get a handle through WinUsb_Initialize(). + if ((is_using_usbccgp) || (iface == 0)) { + // composite device (independent interfaces) or interface 0 + file_handle = handle_priv->interface_handle[iface].dev_handle; + if ((file_handle == 0) || (file_handle == INVALID_HANDLE_VALUE)) { + return LIBUSB_ERROR_NOT_FOUND; + } + + if (!WinUsb_Initialize(file_handle, &winusb_handle)) { + usbi_err(ctx, "could not access interface %d: %s", iface, windows_error_str(0)); + handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE; + + switch(GetLastError()) { + case ERROR_BAD_COMMAND: // The device was disconnected + return LIBUSB_ERROR_NO_DEVICE; + default: + usbi_err(ctx, "could not claim interface %d: %s", iface, windows_error_str(0)); + return LIBUSB_ERROR_ACCESS; + } + } + handle_priv->interface_handle[iface].api_handle = winusb_handle; + } else { + // For all other interfaces, use WinUsb_GetAssociatedInterface() + winusb_handle = handle_priv->interface_handle[0].api_handle; + // It is a requirement for multiple interface devices using WinUSB that you + // must first claim the first interface before you claim any other + if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) { + file_handle = handle_priv->interface_handle[0].dev_handle; + if (WinUsb_Initialize(file_handle, &winusb_handle)) { + handle_priv->interface_handle[0].api_handle = winusb_handle; + usbi_warn(ctx, "auto-claimed interface 0 (required to claim %d with WinUSB)", iface); + } else { + usbi_warn(ctx, "failed to auto-claim interface 0 (required to claim %d with WinUSB)", iface); + return LIBUSB_ERROR_ACCESS; + } + } + if (!WinUsb_GetAssociatedInterface(winusb_handle, (UCHAR)(iface-1), + &handle_priv->interface_handle[iface].api_handle)) { + handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE; + switch(GetLastError()) { + case ERROR_NO_MORE_ITEMS: // invalid iface + return LIBUSB_ERROR_NOT_FOUND; + case ERROR_BAD_COMMAND: // The device was disconnected + return LIBUSB_ERROR_NO_DEVICE; + case ERROR_ALREADY_EXISTS: // already claimed + return LIBUSB_ERROR_BUSY; + default: + usbi_err(ctx, "could not claim interface %d: %s", iface, windows_error_str(0)); + return LIBUSB_ERROR_ACCESS; + } + } + } + usbi_dbg("claimed interface %d", iface); + handle_priv->active_interface = iface; + + return LIBUSB_SUCCESS; +} + +static int winusb_release_interface(struct libusb_device_handle *dev_handle, int iface) +{ + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + HANDLE winusb_handle; + + CHECK_WINUSB_AVAILABLE; + + winusb_handle = handle_priv->interface_handle[iface].api_handle; + if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) { + return LIBUSB_ERROR_NOT_FOUND; + } + + WinUsb_Free(winusb_handle); + handle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE; + + return LIBUSB_SUCCESS; +} + +/* + * Return the first valid interface (of the same API type), for control transfers + */ +static int winusb_get_valid_interface(struct libusb_device_handle *dev_handle) +{ + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + int i; + + for (i=0; iinterface_handle[i].dev_handle != 0) + && (handle_priv->interface_handle[i].dev_handle != INVALID_HANDLE_VALUE) + && (handle_priv->interface_handle[i].api_handle != 0) + && (handle_priv->interface_handle[i].api_handle != INVALID_HANDLE_VALUE) ) { + return i; + } + } + return -1; +} + +/* + * Lookup interface by endpoint address. -1 if not found + */ +static int interface_by_endpoint(struct windows_device_priv *priv, + struct windows_device_handle_priv *handle_priv, uint8_t endpoint_address) +{ + int i, j; + for (i=0; iinterface_handle[i].api_handle == INVALID_HANDLE_VALUE) + continue; + if (handle_priv->interface_handle[i].api_handle == 0) + continue; + if (priv->usb_interface[i].endpoint == NULL) + continue; + for (j=0; jusb_interface[i].nb_endpoints; j++) { + if (priv->usb_interface[i].endpoint[j] == endpoint_address) { + return i; + } + } + } + return -1; +} + +static int winusb_submit_control_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct windows_device_handle_priv *handle_priv = _device_handle_priv( + transfer->dev_handle); + WINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer; + ULONG size; + HANDLE winusb_handle; + int current_interface; + struct winfd wfd; + + CHECK_WINUSB_AVAILABLE; + + transfer_priv->pollable_fd = INVALID_WINFD; + size = transfer->length - LIBUSB_CONTROL_SETUP_SIZE; + + if (size > MAX_CTRL_BUFFER_LENGTH) + return LIBUSB_ERROR_INVALID_PARAM; + + current_interface = winusb_get_valid_interface(transfer->dev_handle); + if (current_interface < 0) { + if (auto_claim(transfer, ¤t_interface, USB_API_WINUSB) != LIBUSB_SUCCESS) { + return LIBUSB_ERROR_NOT_FOUND; + } + } + + usbi_dbg("will use interface %d", current_interface); + winusb_handle = handle_priv->interface_handle[current_interface].api_handle; + + wfd = usbi_create_fd(winusb_handle, _O_RDONLY); + // Always use the handle returned from usbi_create_fd (wfd.handle) + if (wfd.fd < 0) { + return LIBUSB_ERROR_NO_MEM; + } + + // Sending of set configuration control requests from WinUSB creates issues + if ( ((setup->request_type & (0x03 << 5)) == LIBUSB_REQUEST_TYPE_STANDARD) + && (setup->request == LIBUSB_REQUEST_SET_CONFIGURATION) ) { + if (setup->value != priv->active_config) { + usbi_warn(ctx, "cannot set configuration other than the default one"); + usbi_free_fd(wfd.fd); + return LIBUSB_ERROR_INVALID_PARAM; + } + wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY; + wfd.overlapped->InternalHigh = 0; + } else { + if (!WinUsb_ControlTransfer(wfd.handle, *setup, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, size, NULL, wfd.overlapped)) { + if(GetLastError() != ERROR_IO_PENDING) { + usbi_err(ctx, "WinUsb_ControlTransfer failed: %s", windows_error_str(0)); + usbi_free_fd(wfd.fd); + return LIBUSB_ERROR_IO; + } + } else { + wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY; + wfd.overlapped->InternalHigh = (DWORD)size; + } + } + + // Use priv_transfer to store data needed for async polling + transfer_priv->pollable_fd = wfd; + transfer_priv->interface_number = (uint8_t)current_interface; + + return LIBUSB_SUCCESS; +} + +static int winusb_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + HANDLE winusb_handle; + + CHECK_WINUSB_AVAILABLE; + + if (altsetting > 255) { + return LIBUSB_ERROR_INVALID_PARAM; + } + + winusb_handle = handle_priv->interface_handle[iface].api_handle; + if ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) { + usbi_err(ctx, "interface must be claimed first"); + return LIBUSB_ERROR_NOT_FOUND; + } + + if (!WinUsb_SetCurrentAlternateSetting(winusb_handle, (UCHAR)altsetting)) { + usbi_err(ctx, "WinUsb_SetCurrentAlternateSetting failed: %s", windows_error_str(0)); + return LIBUSB_ERROR_IO; + } + + return LIBUSB_SUCCESS; +} + +static int winusb_submit_bulk_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + HANDLE winusb_handle; + bool ret; + int current_interface; + struct winfd wfd; + + CHECK_WINUSB_AVAILABLE; + + transfer_priv->pollable_fd = INVALID_WINFD; + + current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint); + if (current_interface < 0) { + usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer"); + return LIBUSB_ERROR_NOT_FOUND; + } + + usbi_dbg("matched endpoint %02X with interface %d", transfer->endpoint, current_interface); + + winusb_handle = handle_priv->interface_handle[current_interface].api_handle; + + wfd = usbi_create_fd(winusb_handle, IS_XFERIN(transfer) ? _O_RDONLY : _O_WRONLY); + // Always use the handle returned from usbi_create_fd (wfd.handle) + if (wfd.fd < 0) { + return LIBUSB_ERROR_NO_MEM; + } + + if (IS_XFERIN(transfer)) { + usbi_dbg("reading %d bytes", transfer->length); + ret = WinUsb_ReadPipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped); + } else { + usbi_dbg("writing %d bytes", transfer->length); + ret = WinUsb_WritePipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped); + } + if (!ret) { + if(GetLastError() != ERROR_IO_PENDING) { + usbi_err(ctx, "WinUsb_Pipe Transfer failed: %s", windows_error_str(0)); + usbi_free_fd(wfd.fd); + return LIBUSB_ERROR_IO; + } + } else { + wfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY; + wfd.overlapped->InternalHigh = (DWORD)transfer->length; + } + + transfer_priv->pollable_fd = wfd; + transfer_priv->interface_number = (uint8_t)current_interface; + + return LIBUSB_SUCCESS; +} + +static int winusb_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + HANDLE winusb_handle; + int current_interface; + + CHECK_WINUSB_AVAILABLE; + + current_interface = interface_by_endpoint(priv, handle_priv, endpoint); + if (current_interface < 0) { + usbi_err(ctx, "unable to match endpoint to an open interface - cannot clear"); + return LIBUSB_ERROR_NOT_FOUND; + } + + usbi_dbg("matched endpoint %02X with interface %d", endpoint, current_interface); + winusb_handle = handle_priv->interface_handle[current_interface].api_handle; + + if (!WinUsb_ResetPipe(winusb_handle, endpoint)) { + usbi_err(ctx, "WinUsb_ResetPipe failed: %s", windows_error_str(0)); + return LIBUSB_ERROR_NO_DEVICE; + } + + return LIBUSB_SUCCESS; +} + +/* + * from http://www.winvistatips.com/winusb-bugchecks-t335323.html (confirmed + * through testing as well): + * "You can not call WinUsb_AbortPipe on control pipe. You can possibly cancel + * the control transfer using CancelIo" + */ +static int winusb_abort_control(struct usbi_transfer *itransfer) +{ + // Cancelling of the I/O is done in the parent + return LIBUSB_SUCCESS; +} + +static int winusb_abort_transfers(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle); + struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer); + HANDLE winusb_handle; + int current_interface; + + CHECK_WINUSB_AVAILABLE; + + current_interface = transfer_priv->interface_number; + if ((current_interface < 0) || (current_interface >= USB_MAXINTERFACES)) { + usbi_err(ctx, "program assertion failed: invalid interface_number"); + return LIBUSB_ERROR_NOT_FOUND; + } + usbi_dbg("will use interface %d", current_interface); + + winusb_handle = handle_priv->interface_handle[current_interface].api_handle; + + if (!WinUsb_AbortPipe(winusb_handle, transfer->endpoint)) { + usbi_err(ctx, "WinUsb_AbortPipe failed: %s", windows_error_str(0)); + return LIBUSB_ERROR_NO_DEVICE; + } + + return LIBUSB_SUCCESS; +} + +/* + * from the "How to Use WinUSB to Communicate with a USB Device" Microsoft white paper + * (http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx): + * "WinUSB does not support host-initiated reset port and cycle port operations" and + * IOCTL_INTERNAL_USB_CYCLE_PORT is only available in kernel mode and the + * IOCTL_USB_HUB_CYCLE_PORT ioctl was removed from Vista => the best we can do is + * cycle the pipes (and even then, the control pipe can not be reset using WinUSB) + */ +// TODO (post hotplug): see if we can force eject the device and redetect it (reuse hotplug?) +static int winusb_reset_device(struct libusb_device_handle *dev_handle) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + struct winfd wfd; + HANDLE winusb_handle; + int i, j; + + CHECK_WINUSB_AVAILABLE; + + // Reset any available pipe (except control) + for (i=0; iinterface_handle[i].api_handle; + for (wfd = handle_to_winfd(winusb_handle); wfd.fd > 0;) + { + // Cancel any pollable I/O + usbi_remove_pollfd(ctx, wfd.fd); + usbi_free_fd(wfd.fd); + wfd = handle_to_winfd(winusb_handle); + } + + if ( (winusb_handle != 0) && (winusb_handle != INVALID_HANDLE_VALUE)) { + for (j=0; jusb_interface[i].nb_endpoints; j++) { + usbi_dbg("resetting ep %02X", priv->usb_interface[i].endpoint[j]); + if (!WinUsb_AbortPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) { + usbi_err(ctx, "WinUsb_AbortPipe (pipe address %02X) failed: %s", + priv->usb_interface[i].endpoint[j], windows_error_str(0)); + } + // FlushPipe seems to fail on OUT pipes + if (IS_EPIN(priv->usb_interface[i].endpoint[j]) + && (!WinUsb_FlushPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) ) { + usbi_err(ctx, "WinUsb_FlushPipe (pipe address %02X) failed: %s", + priv->usb_interface[i].endpoint[j], windows_error_str(0)); + } + if (!WinUsb_ResetPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) { + usbi_err(ctx, "WinUsb_ResetPipe (pipe address %02X) failed: %s", + priv->usb_interface[i].endpoint[j], windows_error_str(0)); + } + } + } + } + + return LIBUSB_SUCCESS; +} + +static int winusb_copy_transfer_data(struct usbi_transfer *itransfer, uint32_t io_size) +{ + itransfer->transferred += io_size; + return LIBUSB_TRANSFER_COMPLETED; +} + + +/* + * Composite API functions + */ +static int composite_init(struct libusb_context *ctx) +{ + return LIBUSB_SUCCESS; +} + +static int composite_exit(void) +{ + return LIBUSB_SUCCESS; +} + +static int composite_open(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + unsigned api; + int r; + uint8_t flag = 1<composite_api_flags & flag) { + r = usb_api_backend[api].open(dev_handle); + if (r != LIBUSB_SUCCESS) { + return r; + } + } + flag <<= 1; + } + return LIBUSB_SUCCESS; +} + +static void composite_close(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + unsigned api; + uint8_t flag = 1<composite_api_flags & flag) { + usb_api_backend[api].close(dev_handle); + } + flag <<= 1; + } +} + +static int composite_claim_interface(struct libusb_device_handle *dev_handle, int iface) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + return priv->usb_interface[iface].apib->claim_interface(dev_handle, iface); +} + +static int composite_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + return priv->usb_interface[iface].apib->set_interface_altsetting(dev_handle, iface, altsetting); +} + +static int composite_release_interface(struct libusb_device_handle *dev_handle, int iface) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + return priv->usb_interface[iface].apib->release_interface(dev_handle, iface); +} + +static int composite_submit_control_transfer(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int i; + + for (i=0; iusb_interface[i].path != NULL) { + usbi_dbg("using interface %d", i); + return priv->usb_interface[i].apib->submit_control_transfer(itransfer); + } + } + + usbi_err(ctx, "no libusb supported interfaces to complete request"); + return LIBUSB_ERROR_NOT_FOUND; +} + +static int composite_submit_bulk_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int current_interface; + + current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint); + if (current_interface < 0) { + usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer"); + return LIBUSB_ERROR_NOT_FOUND; + } + + return priv->usb_interface[current_interface].apib->submit_bulk_transfer(itransfer); +} + +static int composite_submit_iso_transfer(struct usbi_transfer *itransfer) { + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + int current_interface; + + current_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint); + if (current_interface < 0) { + usbi_err(ctx, "unable to match endpoint to an open interface - cancelling transfer"); + return LIBUSB_ERROR_NOT_FOUND; + } + + return priv->usb_interface[current_interface].apib->submit_iso_transfer(itransfer); +} + +static int composite_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) +{ + struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev); + struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle); + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + int current_interface; + + current_interface = interface_by_endpoint(priv, handle_priv, endpoint); + if (current_interface < 0) { + usbi_err(ctx, "unable to match endpoint to an open interface - cannot clear"); + return LIBUSB_ERROR_NOT_FOUND; + } + + return priv->usb_interface[current_interface].apib->clear_halt(dev_handle, endpoint); +} + +static int composite_abort_control(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + + return priv->usb_interface[transfer_priv->interface_number].apib->abort_control(itransfer); +} + +static int composite_abort_transfers(struct usbi_transfer *itransfer) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + + return priv->usb_interface[transfer_priv->interface_number].apib->abort_transfers(itransfer); +} + +static int composite_reset_device(struct libusb_device_handle *dev_handle) +{ + struct windows_device_priv *priv = _device_priv(dev_handle->dev); + unsigned api; + int r; + uint8_t flag = 1<composite_api_flags & flag) { + r = usb_api_backend[api].reset_device(dev_handle); + if (r != LIBUSB_SUCCESS) { + return r; + } + } + flag <<= 1; + } + return LIBUSB_SUCCESS; +} + +static int composite_copy_transfer_data(struct usbi_transfer *itransfer, uint32_t io_size) +{ + struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer); + struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer); + struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev); + + return priv->usb_interface[transfer_priv->interface_number].apib->copy_transfer_data(itransfer, io_size); +} diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.h b/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.h new file mode 100644 index 0000000..ddbd680 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/os/windows_usb.h @@ -0,0 +1,608 @@ +/* + * Windows backend for libusb 1.0 + * Copyright (C) 2009-2010 Pete Batard + * With contributions from Michael Plante, Orin Eman et al. + * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer + * Major code testing contribution by Xiaofan Chen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#if defined(_MSC_VER) +// disable /W4 MSVC warnings that are benign +#pragma warning(disable:4127) // conditional expression is constant +#pragma warning(disable:4100) // unreferenced formal parameter +#pragma warning(disable:4214) // bit field types other than int +#pragma warning(disable:4201) // nameless struct/union +#endif + +// Windows API default is uppercase - ugh! +#if !defined(bool) +#define bool BOOL +#endif +#if !defined(true) +#define true TRUE +#endif +#if !defined(false) +#define false FALSE +#endif + +// Missing from MSVC6 setupapi.h +#if !defined(SPDRP_ADDRESS) +#define SPDRP_ADDRESS 28 +#endif +#if !defined(SPDRP_INSTALL_STATE) +#define SPDRP_INSTALL_STATE 34 +#endif + +#if defined(__CYGWIN__ ) +// cygwin produces a warning unless these prototypes are defined +extern int _snprintf(char *buffer, size_t count, const char *format, ...); +extern char *_strdup(const char *strSource); +// _beginthreadex is MSVCRT => unavailable for cygwin. Fallback to using CreateThread +#define _beginthreadex(a, b, c, d, e, f) CreateThread(a, b, (LPTHREAD_START_ROUTINE)c, d, e, f) +#endif +#define safe_free(p) do {if (p != NULL) {free((void*)p); p = NULL;}} while(0) +#define safe_closehandle(h) do {if (h != INVALID_HANDLE_VALUE) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0) +#define safe_min(a, b) min((size_t)(a), (size_t)(b)) +#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \ + ((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0) +#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1) +#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1)) +#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1) +#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2)) +#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2), count) +#define safe_strlen(str) ((str==NULL)?0:strlen(str)) +#define safe_sprintf _snprintf +#define safe_unref_device(dev) do {if (dev != NULL) {libusb_unref_device(dev); dev = NULL;}} while(0) +#define wchar_to_utf8_ms(wstr, str, strlen) WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, strlen, NULL, NULL) +static inline void upperize(char* str) { + size_t i; + if (str == NULL) return; + for (i=0; ios_priv; +} + +static inline void windows_device_priv_init(libusb_device* dev) { + struct windows_device_priv* p = _device_priv(dev); + int i; + p->depth = 0; + p->port = 0; + p->parent_dev = NULL; + p->path = NULL; + p->apib = &usb_api_backend[USB_API_UNSUPPORTED]; + p->composite_api_flags = 0; + p->active_config = 0; + p->config_descriptor = NULL; + memset(&(p->dev_descriptor), 0, sizeof(USB_DEVICE_DESCRIPTOR)); + for (i=0; iusb_interface[i].path = NULL; + p->usb_interface[i].apib = &usb_api_backend[USB_API_UNSUPPORTED]; + p->usb_interface[i].nb_endpoints = 0; + p->usb_interface[i].endpoint = NULL; + } +} + +static inline void windows_device_priv_release(libusb_device* dev) { + struct windows_device_priv* p = _device_priv(dev); + int i; + safe_free(p->path); + if ((dev->num_configurations > 0) && (p->config_descriptor != NULL)) { + for (i=0; i < dev->num_configurations; i++) + safe_free(p->config_descriptor[i]); + } + safe_free(p->config_descriptor); + for (i=0; iusb_interface[i].path); + safe_free(p->usb_interface[i].endpoint); + } +} + +struct interface_handle_t { + HANDLE dev_handle; // WinUSB needs an extra handle for the file + HANDLE api_handle; // used by the API to communicate with the device +}; + +struct windows_device_handle_priv { + int active_interface; + struct interface_handle_t interface_handle[USB_MAXINTERFACES]; + int autoclaim_count[USB_MAXINTERFACES]; // For auto-release +}; + +static inline struct windows_device_handle_priv *_device_handle_priv( + struct libusb_device_handle *handle) +{ + return (struct windows_device_handle_priv *) handle->os_priv; +} + +// used for async polling functions +struct windows_transfer_priv { + struct winfd pollable_fd; + uint8_t interface_number; +}; + +// used to match a device driver (including filter drivers) against a supported API +struct driver_lookup { + char list[MAX_KEY_LENGTH+1];// REG_MULTI_SZ list of services (driver) names + const DWORD reg_prop; // SPDRP registry key to use to retreive list + const char* designation; // internal designation (for debug output) +}; + +/* + * API macros - from libusb-win32 1.x + */ +#define DLL_DECLARE_PREFIXNAME(api, ret, prefixname, name, args) \ + typedef ret (api * __dll_##name##_t)args; \ + static __dll_##name##_t prefixname = NULL + +#define DLL_LOAD_PREFIXNAME(dll, prefixname, name, ret_on_failure) \ + do { \ + HMODULE h = GetModuleHandleA(#dll); \ + if (!h) \ + h = LoadLibraryA(#dll); \ + if (!h) { \ + if (ret_on_failure) { return LIBUSB_ERROR_NOT_FOUND; }\ + else { break; } \ + } \ + prefixname = (__dll_##name##_t)GetProcAddress(h, #name); \ + if (prefixname) break; \ + prefixname = (__dll_##name##_t)GetProcAddress(h, #name "A"); \ + if (prefixname) break; \ + prefixname = (__dll_##name##_t)GetProcAddress(h, #name "W"); \ + if (prefixname) break; \ + if(ret_on_failure) \ + return LIBUSB_ERROR_NOT_FOUND; \ + } while(0) + +#define DLL_DECLARE(api, ret, name, args) DLL_DECLARE_PREFIXNAME(api, ret, name, name, args) +#define DLL_LOAD(dll, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, name, name, ret_on_failure) +#define DLL_DECLARE_PREFIXED(api, ret, prefix, name, args) DLL_DECLARE_PREFIXNAME(api, ret, prefix##name, name, args) +#define DLL_LOAD_PREFIXED(dll, prefix, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, prefix##name, name, ret_on_failure) + +/* OLE32 dependency */ +DLL_DECLARE_PREFIXED(WINAPI, HRESULT, p, CLSIDFromString, (LPCOLESTR, LPCLSID)); + +/* SetupAPI dependencies */ +DLL_DECLARE_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (const GUID*, PCSTR, HWND, DWORD)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInterfaces, (HDEVINFO, PSP_DEVINFO_DATA, + const GUID*, DWORD, PSP_DEVICE_INTERFACE_DATA)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInterfaceDetailA, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, + PSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiDestroyDeviceInfoList, (HDEVINFO)); +DLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDevRegKey, (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM)); +DLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceRegistryPropertyA, (HDEVINFO, + PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD)); +DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegQueryValueExW, (HKEY, LPCWSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD)); +DLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegCloseKey, (HKEY)); + +/* + * Windows DDK API definitions. Most of it copied from MinGW's includes + */ +typedef DWORD DEVNODE, DEVINST; +typedef DEVNODE *PDEVNODE, *PDEVINST; +typedef DWORD RETURN_TYPE; +typedef RETURN_TYPE CONFIGRET; + +#define CR_SUCCESS 0x00000000 +#define CR_NO_SUCH_DEVNODE 0x0000000D + +#define USB_DEVICE_DESCRIPTOR_TYPE LIBUSB_DT_DEVICE +#define USB_CONFIGURATION_DESCRIPTOR_TYPE LIBUSB_DT_CONFIG +#define USB_STRING_DESCRIPTOR_TYPE LIBUSB_DT_STRING +#define USB_INTERFACE_DESCRIPTOR_TYPE LIBUSB_DT_INTERFACE +#define USB_ENDPOINT_DESCRIPTOR_TYPE LIBUSB_DT_ENDPOINT + +#define USB_REQUEST_GET_STATUS LIBUSB_REQUEST_GET_STATUS +#define USB_REQUEST_CLEAR_FEATURE LIBUSB_REQUEST_CLEAR_FEATURE +#define USB_REQUEST_SET_FEATURE LIBUSB_REQUEST_SET_FEATURE +#define USB_REQUEST_SET_ADDRESS LIBUSB_REQUEST_SET_ADDRESS +#define USB_REQUEST_GET_DESCRIPTOR LIBUSB_REQUEST_GET_DESCRIPTOR +#define USB_REQUEST_SET_DESCRIPTOR LIBUSB_REQUEST_SET_DESCRIPTOR +#define USB_REQUEST_GET_CONFIGURATION LIBUSB_REQUEST_GET_CONFIGURATION +#define USB_REQUEST_SET_CONFIGURATION LIBUSB_REQUEST_SET_CONFIGURATION +#define USB_REQUEST_GET_INTERFACE LIBUSB_REQUEST_GET_INTERFACE +#define USB_REQUEST_SET_INTERFACE LIBUSB_REQUEST_SET_INTERFACE +#define USB_REQUEST_SYNC_FRAME LIBUSB_REQUEST_SYNCH_FRAME + +#define USB_GET_NODE_INFORMATION 258 +#define USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION 260 +#define USB_GET_NODE_CONNECTION_NAME 261 +#define USB_GET_HUB_CAPABILITIES 271 +#if !defined(USB_GET_NODE_CONNECTION_INFORMATION_EX) +#define USB_GET_NODE_CONNECTION_INFORMATION_EX 274 +#endif +#if !defined(USB_GET_HUB_CAPABILITIES_EX) +#define USB_GET_HUB_CAPABILITIES_EX 276 +#endif + +#ifndef METHOD_BUFFERED +#define METHOD_BUFFERED 0 +#endif +#ifndef FILE_ANY_ACCESS +#define FILE_ANY_ACCESS 0x00000000 +#endif +#ifndef FILE_DEVICE_UNKNOWN +#define FILE_DEVICE_UNKNOWN 0x00000022 +#endif +#ifndef FILE_DEVICE_USB +#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN +#endif + +#ifndef CTL_CODE +#define CTL_CODE(DeviceType, Function, Method, Access)( \ + ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) +#endif + +typedef enum USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth, + DeviceHubNestedTooDeeply, + DeviceInLegacyHub +} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; + +typedef enum USB_HUB_NODE { + UsbHub, + UsbMIParent +} USB_HUB_NODE; + +/* Cfgmgr32.dll interface */ +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, PCHAR, ULONG, ULONG)); + +#define IOCTL_USB_GET_HUB_CAPABILITIES_EX \ + CTL_CODE( FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_HUB_CAPABILITIES \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_ROOT_HUB_NAME \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_INFORMATION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +// Most of the structures below need to be packed +#pragma pack(push, 1) + +typedef struct USB_INTERFACE_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bInterfaceNumber; + UCHAR bAlternateSetting; + UCHAR bNumEndpoints; + UCHAR bInterfaceClass; + UCHAR bInterfaceSubClass; + UCHAR bInterfaceProtocol; + UCHAR iInterface; +} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR; + +typedef struct USB_CONFIGURATION_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumInterfaces; + UCHAR bConfigurationValue; + UCHAR iConfiguration; + UCHAR bmAttributes; + UCHAR MaxPower; +} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR; + +typedef struct USB_CONFIGURATION_DESCRIPTOR_SHORT { + struct { + ULONG ConnectionIndex; + struct { + UCHAR bmRequest; + UCHAR bRequest; + USHORT wValue; + USHORT wIndex; + USHORT wLength; + } SetupPacket; + } req; + USB_CONFIGURATION_DESCRIPTOR data; +} USB_CONFIGURATION_DESCRIPTOR_SHORT; + +typedef struct USB_ENDPOINT_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bEndpointAddress; + UCHAR bmAttributes; + USHORT wMaxPacketSize; + UCHAR bInterval; +} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR; + +typedef struct USB_DESCRIPTOR_REQUEST { + ULONG ConnectionIndex; + struct { + UCHAR bmRequest; + UCHAR bRequest; + USHORT wValue; + USHORT wIndex; + USHORT wLength; + } SetupPacket; +// UCHAR Data[0]; +} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; + +typedef struct USB_HUB_DESCRIPTOR { + UCHAR bDescriptorLength; + UCHAR bDescriptorType; + UCHAR bNumberOfPorts; + USHORT wHubCharacteristics; + UCHAR bPowerOnToPowerGood; + UCHAR bHubControlCurrent; + UCHAR bRemoveAndPowerMask[64]; +} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR; + +typedef struct USB_ROOT_HUB_NAME { + ULONG ActualLength; + WCHAR RootHubName[1]; +} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; + +typedef struct USB_ROOT_HUB_NAME_FIXED { + ULONG ActualLength; + WCHAR RootHubName[MAX_PATH_LENGTH]; +} USB_ROOT_HUB_NAME_FIXED; + +typedef struct USB_NODE_CONNECTION_NAME { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR NodeName[1]; +} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; + +typedef struct USB_NODE_CONNECTION_NAME_FIXED { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR NodeName[MAX_PATH_LENGTH]; +} USB_NODE_CONNECTION_NAME_FIXED; + +typedef struct USB_HUB_NAME_FIXED { + union { + USB_ROOT_HUB_NAME_FIXED root; + USB_NODE_CONNECTION_NAME_FIXED node; + } u; +} USB_HUB_NAME_FIXED; + +typedef struct USB_HUB_INFORMATION { + USB_HUB_DESCRIPTOR HubDescriptor; + BOOLEAN HubIsBusPowered; +} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; + +typedef struct USB_MI_PARENT_INFORMATION { + ULONG NumberOfInterfaces; +} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; + +typedef struct USB_NODE_INFORMATION { + USB_HUB_NODE NodeType; + union { + USB_HUB_INFORMATION HubInformation; + USB_MI_PARENT_INFORMATION MiParentInformation; + } u; +} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; + +typedef struct USB_PIPE_INFO { + USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + ULONG ScheduleOffset; +} USB_PIPE_INFO, *PUSB_PIPE_INFO; + +typedef struct USB_NODE_CONNECTION_INFORMATION_EX { + ULONG ConnectionIndex; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR CurrentConfigurationValue; + UCHAR Speed; + BOOLEAN DeviceIsHub; + USHORT DeviceAddress; + ULONG NumberOfOpenPipes; + USB_CONNECTION_STATUS ConnectionStatus; +// USB_PIPE_INFO PipeList[0]; +} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX; + +typedef struct USB_HUB_CAP_FLAGS { + ULONG HubIsHighSpeedCapable:1; + ULONG HubIsHighSpeed:1; + ULONG HubIsMultiTtCapable:1; + ULONG HubIsMultiTt:1; + ULONG HubIsRoot:1; + ULONG HubIsArmedWakeOnConnect:1; + ULONG ReservedMBZ:26; +} USB_HUB_CAP_FLAGS, *PUSB_HUB_CAP_FLAGS; + +typedef struct USB_HUB_CAPABILITIES { + ULONG HubIs2xCapable : 1; +} USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES; + +typedef struct USB_HUB_CAPABILITIES_EX { + USB_HUB_CAP_FLAGS CapabilityFlags; +} USB_HUB_CAPABILITIES_EX, *PUSB_HUB_CAPABILITIES_EX; + +#pragma pack(pop) + +/* winusb.dll interface */ + +#define SHORT_PACKET_TERMINATE 0x01 +#define AUTO_CLEAR_STALL 0x02 +#define PIPE_TRANSFER_TIMEOUT 0x03 +#define IGNORE_SHORT_PACKETS 0x04 +#define ALLOW_PARTIAL_READS 0x05 +#define AUTO_FLUSH 0x06 +#define RAW_IO 0x07 +#define MAXIMUM_TRANSFER_SIZE 0x08 +#define AUTO_SUSPEND 0x81 +#define SUSPEND_DELAY 0x83 +#define DEVICE_SPEED 0x01 +#define LowSpeed 0x01 +#define FullSpeed 0x02 +#define HighSpeed 0x03 + +typedef enum USBD_PIPE_TYPE { + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt +} USBD_PIPE_TYPE; + +typedef struct { + USBD_PIPE_TYPE PipeType; + UCHAR PipeId; + USHORT MaximumPacketSize; + UCHAR Interval; +} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION; + +#pragma pack(1) +typedef struct { + UCHAR request_type; + UCHAR request; + USHORT value; + USHORT index; + USHORT length; +} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET; +#pragma pack() + +typedef void *WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE; + +DLL_DECLARE(WINAPI, BOOL, WinUsb_Initialize, (HANDLE, PWINUSB_INTERFACE_HANDLE)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_Free, (WINUSB_INTERFACE_HANDLE)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_GetAssociatedInterface, (WINUSB_INTERFACE_HANDLE, UCHAR, PWINUSB_INTERFACE_HANDLE)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_GetDescriptor, (WINUSB_INTERFACE_HANDLE, UCHAR, UCHAR, USHORT, PUCHAR, ULONG, PULONG)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_QueryInterfaceSettings, (WINUSB_INTERFACE_HANDLE, UCHAR, PUSB_INTERFACE_DESCRIPTOR)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_QueryDeviceInformation, (WINUSB_INTERFACE_HANDLE, ULONG, PULONG, PVOID)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_SetCurrentAlternateSetting, (WINUSB_INTERFACE_HANDLE, UCHAR)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_GetCurrentAlternateSetting, (WINUSB_INTERFACE_HANDLE, PUCHAR)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_QueryPipe, (WINUSB_INTERFACE_HANDLE, UCHAR, UCHAR, PWINUSB_PIPE_INFORMATION)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_SetPipePolicy, (WINUSB_INTERFACE_HANDLE, UCHAR, ULONG, ULONG, PVOID)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_GetPipePolicy, (WINUSB_INTERFACE_HANDLE, UCHAR, ULONG, PULONG, PVOID)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_ReadPipe, (WINUSB_INTERFACE_HANDLE, UCHAR, PUCHAR, ULONG, PULONG, LPOVERLAPPED)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_WritePipe, (WINUSB_INTERFACE_HANDLE, UCHAR, PUCHAR, ULONG, PULONG, LPOVERLAPPED)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_ControlTransfer, (WINUSB_INTERFACE_HANDLE, WINUSB_SETUP_PACKET, PUCHAR, ULONG, PULONG, LPOVERLAPPED)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_ResetPipe, (WINUSB_INTERFACE_HANDLE, UCHAR)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_AbortPipe, (WINUSB_INTERFACE_HANDLE, UCHAR)); +DLL_DECLARE(WINAPI, BOOL, WinUsb_FlushPipe, (WINUSB_INTERFACE_HANDLE, UCHAR)); diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/sync.c b/thirdparty/libusb/libusb-1.0.9/libusb/sync.c new file mode 100644 index 0000000..8eed47b --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/sync.c @@ -0,0 +1,314 @@ +/* + * Synchronous I/O functions for libusb + * Copyright (C) 2007-2008 Daniel Drake + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include "libusbi.h" + +/** + * @defgroup syncio Synchronous device I/O + * + * This page documents libusb's synchronous (blocking) API for USB device I/O. + * This interface is easy to use but has some limitations. More advanced users + * may wish to consider using the \ref asyncio "asynchronous I/O API" instead. + */ + +static void LIBUSB_CALL ctrl_transfer_cb(struct libusb_transfer *transfer) +{ + int *completed = transfer->user_data; + *completed = 1; + usbi_dbg("actual_length=%d", transfer->actual_length); + /* caller interprets result and frees transfer */ +} + +/** \ingroup syncio + * Perform a USB control transfer. + * + * The direction of the transfer is inferred from the bmRequestType field of + * the setup packet. + * + * The wValue, wIndex and wLength fields values should be given in host-endian + * byte order. + * + * \param dev_handle a handle for the device to communicate with + * \param bmRequestType the request type field for the setup packet + * \param bRequest the request field for the setup packet + * \param wValue the value field for the setup packet + * \param wIndex the index field for the setup packet + * \param data a suitably-sized data buffer for either input or output + * (depending on direction bits within bmRequestType) + * \param wLength the length field for the setup packet. The data buffer should + * be at least this size. + * \param timeout timeout (in millseconds) that this function should wait + * before giving up due to no response being received. For an unlimited + * timeout, use value 0. + * \returns on success, the number of bytes actually transferred + * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out + * \returns LIBUSB_ERROR_PIPE if the control request was not supported by the + * device + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failures + */ +int API_EXPORTED libusb_control_transfer(libusb_device_handle *dev_handle, + uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + unsigned char *data, uint16_t wLength, unsigned int timeout) +{ + struct libusb_transfer *transfer = libusb_alloc_transfer(0); + unsigned char *buffer; + int completed = 0; + int r; + + if (!transfer) + return LIBUSB_ERROR_NO_MEM; + + buffer = malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength); + if (!buffer) { + libusb_free_transfer(transfer); + return LIBUSB_ERROR_NO_MEM; + } + + libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex, + wLength); + if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT) + memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength); + + libusb_fill_control_transfer(transfer, dev_handle, buffer, + ctrl_transfer_cb, &completed, timeout); + transfer->flags = LIBUSB_TRANSFER_FREE_BUFFER; + r = libusb_submit_transfer(transfer); + if (r < 0) { + libusb_free_transfer(transfer); + return r; + } + + while (!completed) { + r = libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed); + if (r < 0) { + if (r == LIBUSB_ERROR_INTERRUPTED) + continue; + libusb_cancel_transfer(transfer); + while (!completed) + if (libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed) < 0) + break; + libusb_free_transfer(transfer); + return r; + } + } + + if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN) + memcpy(data, libusb_control_transfer_get_data(transfer), + transfer->actual_length); + + switch (transfer->status) { + case LIBUSB_TRANSFER_COMPLETED: + r = transfer->actual_length; + break; + case LIBUSB_TRANSFER_TIMED_OUT: + r = LIBUSB_ERROR_TIMEOUT; + break; + case LIBUSB_TRANSFER_STALL: + r = LIBUSB_ERROR_PIPE; + break; + case LIBUSB_TRANSFER_NO_DEVICE: + r = LIBUSB_ERROR_NO_DEVICE; + break; + case LIBUSB_TRANSFER_OVERFLOW: + r = LIBUSB_ERROR_OVERFLOW; + break; + default: + usbi_warn(HANDLE_CTX(dev_handle), + "unrecognised status code %d", transfer->status); + r = LIBUSB_ERROR_OTHER; + } + + libusb_free_transfer(transfer); + return r; +} + +static void LIBUSB_CALL bulk_transfer_cb(struct libusb_transfer *transfer) +{ + int *completed = transfer->user_data; + *completed = 1; + usbi_dbg("actual_length=%d", transfer->actual_length); + /* caller interprets results and frees transfer */ +} + +static int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *buffer, int length, + int *transferred, unsigned int timeout, unsigned char type) +{ + struct libusb_transfer *transfer = libusb_alloc_transfer(0); + int completed = 0; + int r; + + if (!transfer) + return LIBUSB_ERROR_NO_MEM; + + libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, + bulk_transfer_cb, &completed, timeout); + transfer->type = type; + + r = libusb_submit_transfer(transfer); + if (r < 0) { + libusb_free_transfer(transfer); + return r; + } + + while (!completed) { + r = libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed); + if (r < 0) { + if (r == LIBUSB_ERROR_INTERRUPTED) + continue; + libusb_cancel_transfer(transfer); + while (!completed) + if (libusb_handle_events_completed(HANDLE_CTX(dev_handle), &completed) < 0) + break; + libusb_free_transfer(transfer); + return r; + } + } + + *transferred = transfer->actual_length; + switch (transfer->status) { + case LIBUSB_TRANSFER_COMPLETED: + r = 0; + break; + case LIBUSB_TRANSFER_TIMED_OUT: + r = LIBUSB_ERROR_TIMEOUT; + break; + case LIBUSB_TRANSFER_STALL: + r = LIBUSB_ERROR_PIPE; + break; + case LIBUSB_TRANSFER_OVERFLOW: + r = LIBUSB_ERROR_OVERFLOW; + break; + case LIBUSB_TRANSFER_NO_DEVICE: + r = LIBUSB_ERROR_NO_DEVICE; + break; + default: + usbi_warn(HANDLE_CTX(dev_handle), + "unrecognised status code %d", transfer->status); + r = LIBUSB_ERROR_OTHER; + } + + libusb_free_transfer(transfer); + return r; +} + +/** \ingroup syncio + * Perform a USB bulk transfer. The direction of the transfer is inferred from + * the direction bits of the endpoint address. + * + * For bulk reads, the length field indicates the maximum length of + * data you are expecting to receive. If less data arrives than expected, + * this function will return that data, so be sure to check the + * transferred output parameter. + * + * You should also check the transferred parameter for bulk writes. + * Not all of the data may have been written. + * + * Also check transferred when dealing with a timeout error code. + * libusb may have to split your transfer into a number of chunks to satisfy + * underlying O/S requirements, meaning that the timeout may expire after + * the first few chunks have completed. libusb is careful not to lose any data + * that may have been transferred; do not assume that timeout conditions + * indicate a complete lack of I/O. + * + * \param dev_handle a handle for the device to communicate with + * \param endpoint the address of a valid endpoint to communicate with + * \param data a suitably-sized data buffer for either input or output + * (depending on endpoint) + * \param length for bulk writes, the number of bytes from data to be sent. for + * bulk reads, the maximum number of bytes to receive into the data buffer. + * \param transferred output location for the number of bytes actually + * transferred. + * \param timeout timeout (in millseconds) that this function should wait + * before giving up due to no response being received. For an unlimited + * timeout, use value 0. + * + * \returns 0 on success (and populates transferred) + * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates + * transferred) + * \returns LIBUSB_ERROR_PIPE if the endpoint halted + * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see + * \ref packetoverflow + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other failures + */ +int API_EXPORTED libusb_bulk_transfer(struct libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *data, int length, int *transferred, + unsigned int timeout) +{ + return do_sync_bulk_transfer(dev_handle, endpoint, data, length, + transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK); +} + +/** \ingroup syncio + * Perform a USB interrupt transfer. The direction of the transfer is inferred + * from the direction bits of the endpoint address. + * + * For interrupt reads, the length field indicates the maximum length + * of data you are expecting to receive. If less data arrives than expected, + * this function will return that data, so be sure to check the + * transferred output parameter. + * + * You should also check the transferred parameter for interrupt + * writes. Not all of the data may have been written. + * + * Also check transferred when dealing with a timeout error code. + * libusb may have to split your transfer into a number of chunks to satisfy + * underlying O/S requirements, meaning that the timeout may expire after + * the first few chunks have completed. libusb is careful not to lose any data + * that may have been transferred; do not assume that timeout conditions + * indicate a complete lack of I/O. + * + * The default endpoint bInterval value is used as the polling interval. + * + * \param dev_handle a handle for the device to communicate with + * \param endpoint the address of a valid endpoint to communicate with + * \param data a suitably-sized data buffer for either input or output + * (depending on endpoint) + * \param length for bulk writes, the number of bytes from data to be sent. for + * bulk reads, the maximum number of bytes to receive into the data buffer. + * \param transferred output location for the number of bytes actually + * transferred. + * \param timeout timeout (in millseconds) that this function should wait + * before giving up due to no response being received. For an unlimited + * timeout, use value 0. + * + * \returns 0 on success (and populates transferred) + * \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out + * \returns LIBUSB_ERROR_PIPE if the endpoint halted + * \returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see + * \ref packetoverflow + * \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected + * \returns another LIBUSB_ERROR code on other error + */ +int API_EXPORTED libusb_interrupt_transfer( + struct libusb_device_handle *dev_handle, unsigned char endpoint, + unsigned char *data, int length, int *transferred, unsigned int timeout) +{ + return do_sync_bulk_transfer(dev_handle, endpoint, data, length, + transferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT); +} + diff --git a/thirdparty/libusb/libusb-1.0.9/libusb/version.h b/thirdparty/libusb/libusb-1.0.9/libusb/version.h new file mode 100644 index 0000000..62446da --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/libusb/version.h @@ -0,0 +1,18 @@ +/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */ +#ifndef LIBUSB_MAJOR +#define LIBUSB_MAJOR 1 +#endif +#ifndef LIBUSB_MINOR +#define LIBUSB_MINOR 0 +#endif +#ifndef LIBUSB_MICRO +#define LIBUSB_MICRO 9 +#endif +/* LIBUSB_NANO may be used for Windows internal versioning. 0 means unused. */ +#ifndef LIBUSB_NANO +#define LIBUSB_NANO 0 +#endif +/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */ +#ifndef LIBUSB_RC +#define LIBUSB_RC "" +#endif diff --git a/thirdparty/libusb/libusb-1.0.9/ltmain.sh b/thirdparty/libusb/libusb-1.0.9/ltmain.sh new file mode 100644 index 0000000..04eaea4 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/ltmain.sh @@ -0,0 +1,8745 @@ +# Generated from ltmain.m4sh. + +# libtool (GNU libtool) 2.2.10 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 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. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.10 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.10 +TIMESTAMP="" +package_revision=1.3175 + +# 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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="grep -E"} +: ${FGREP="grep -F"} +: ${GREP="grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} + +# Generated shell functions inserted here. + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1." + exit_cmd=exit +} + +exit_cmd=: + + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +# $mode is unset +nonopt= +execute_dlfiles= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +opt_dry_run=false +opt_duplicate_deps=false +opt_silent=false +opt_debug=: + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --help-all) opt_help=': help-all' ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + echo >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + echo >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# 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+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result= + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result"; then + func_error "Could not determine the host path(s) corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_append func_to_host_pathlist_result ";" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + echo ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/thirdparty/libusb/libusb-1.0.9/missing b/thirdparty/libusb/libusb-1.0.9/missing new file mode 100644 index 0000000..28055d2 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# 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, see . + +# 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/config.h b/thirdparty/libusb/libusb-1.0.9/msvc/config.h new file mode 100644 index 0000000..43aa1f7 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/config.h @@ -0,0 +1,24 @@ +/* config.h. Manual config for MSVC. */ + +#ifndef _MSC_VER +#warn "msvc/config.h shouldn't be included for your development environment." +#error "Please make sure the msvc/ directory is removed from your build path." +#endif + +/* Default visibility */ +#define DEFAULT_VISIBILITY /**/ + +/* Debug message logging */ +//#define ENABLE_DEBUG_LOGGING 1 + +/* Message logging */ +#define ENABLE_LOGGING 1 + +/* Windows backend */ +#define OS_WINDOWS 1 + +/* type of second poll() argument */ +#define POLL_NFDS_TYPE unsigned int + +/* no way to run git describe from MSVC? */ +#define LIBUSB_DESCRIBE "" diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/ddk_build.cmd b/thirdparty/libusb/libusb-1.0.9/msvc/ddk_build.cmd new file mode 100644 index 0000000..ed9b8a8 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/ddk_build.cmd @@ -0,0 +1,106 @@ +@rem default builds static library. +@rem you can pass the following arguments (case insensitive): +@rem - "DLL" to build a DLL instead of a static library +@rem - "/MT" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT) +@echo off + +if Test%BUILD_ALT_DIR%==Test goto usage + +rem process commandline parameters +set TARGET=LIBRARY +set STATIC_LIBC= +set version=1.0 + +if "%1" == "" goto no_more_args +rem /I for case insensitive +if /I Test%1==TestDLL set TARGET=DYNLINK +if /I Test%1==Test/MT set STATIC_LIBC=1 +:no_more_args + +cd ..\libusb\os +echo TARGETTYPE=%TARGET% > target +copy target+..\..\msvc\libusb_sources sources >NUL 2>&1 +del target +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +cd ..\.. + +set cpudir=i386 +set destType=Win32 +if %_BUILDARCH%==x86 goto isI386 +set cpudir=amd64 +set destType=x64 +:isI386 + +set srcPath=libusb\os\obj%BUILD_ALT_DIR%\%cpudir% + +set dstPath=%destType%\Debug +if %DDKBUILDENV%==chk goto isDebug +set dstPath=%destType%\Release +:isDebug + +if exist %destType% goto md2 +mkdir %destType% +:md2 +if exist %dstPath% goto md3 +mkdir %dstPath% +:md3 +if exist %dstPath%\dll goto md4 +mkdir %dstPath%\dll +:md4 +if exist %dstPath%\lib goto md5 +md %dstPath%\lib +:md5 +if exist %dstPath%\examples goto md6 +md %dstPath%\examples +:md6 +@echo on + +@if /I NOT Test%1==TestDLL goto copylib +copy %srcPath%\libusb-%version%.dll %dstPath%\dll +copy %srcPath%\libusb-%version%.pdb %dstPath%\dll +:copylib +copy %srcPath%\libusb-%version%.lib %dstPath%\lib + +@echo off + +if exist examples\listdevs_ddkbuild goto md7 +md examples\listdevs_ddkbuild +:md7 + +cd examples\listdevs_ddkbuild +copy ..\..\msvc\listdevs_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto buildlistdevserror +cd ..\.. + +set srcPath=examples\listdevs_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir% +@echo on + +copy %srcPath%\listdevs.exe %dstPath%\examples +copy %srcPath%\listdevs.pdb %dstPath%\examples + +cd msvc +goto done + + +:builderror +cd ..\..\msvc +echo Build failed +goto done + +:buildlistdevserror +cd ..\..\msvc +echo listdevs build failed +goto done + +:usage +echo ddk_build must be run in a WDK build environment +pause +goto done + +:done diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/inttypes.h b/thirdparty/libusb/libusb-1.0.9/msvc/inttypes.h new file mode 100644 index 0000000..289bb50 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/inttypes.h @@ -0,0 +1,295 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was original part of the w64 mingw-runtime package. + */ + +/* + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +/* 7.8 Format conversion of integer types */ + +#ifndef _INTTYPES_H_ +#define _INTTYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + +/* 7.8.1 Macros for format specifiers + * + * MS runtime does not yet understand C9x standard "ll" + * length specifier. It appears to treat "ll" as "l". + * The non-standard I64 length specifier causes warning in GCC, + * but understood by MS runtime functions. + */ + +/* fprintf macros for signed types */ +#define PRId8 "d" +#define PRId16 "d" +#define PRId32 "d" +#define PRId64 "I64d" + +#define PRIdLEAST8 "d" +#define PRIdLEAST16 "d" +#define PRIdLEAST32 "d" +#define PRIdLEAST64 "I64d" + +#define PRIdFAST8 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "I64d" + +#define PRIdMAX "I64d" + +#define PRIi8 "i" +#define PRIi16 "i" +#define PRIi32 "i" +#define PRIi64 "I64i" + +#define PRIiLEAST8 "i" +#define PRIiLEAST16 "i" +#define PRIiLEAST32 "i" +#define PRIiLEAST64 "I64i" + +#define PRIiFAST8 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "I64i" + +#define PRIiMAX "I64i" + +#define PRIo8 "o" +#define PRIo16 "o" +#define PRIo32 "o" +#define PRIo64 "I64o" + +#define PRIoLEAST8 "o" +#define PRIoLEAST16 "o" +#define PRIoLEAST32 "o" +#define PRIoLEAST64 "I64o" + +#define PRIoFAST8 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "I64o" + +#define PRIoMAX "I64o" + +/* fprintf macros for unsigned types */ +#define PRIu8 "u" +#define PRIu16 "u" +#define PRIu32 "u" +#define PRIu64 "I64u" + + +#define PRIuLEAST8 "u" +#define PRIuLEAST16 "u" +#define PRIuLEAST32 "u" +#define PRIuLEAST64 "I64u" + +#define PRIuFAST8 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "I64u" + +#define PRIuMAX "I64u" + +#define PRIx8 "x" +#define PRIx16 "x" +#define PRIx32 "x" +#define PRIx64 "I64x" + +#define PRIxLEAST8 "x" +#define PRIxLEAST16 "x" +#define PRIxLEAST32 "x" +#define PRIxLEAST64 "I64x" + +#define PRIxFAST8 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "I64x" + +#define PRIxMAX "I64x" + +#define PRIX8 "X" +#define PRIX16 "X" +#define PRIX32 "X" +#define PRIX64 "I64X" + +#define PRIXLEAST8 "X" +#define PRIXLEAST16 "X" +#define PRIXLEAST32 "X" +#define PRIXLEAST64 "I64X" + +#define PRIXFAST8 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "I64X" + +#define PRIXMAX "I64X" + +/* + * fscanf macros for signed int types + * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t + * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have + * no length identifiers + */ + +#define SCNd16 "hd" +#define SCNd32 "d" +#define SCNd64 "I64d" + +#define SCNdLEAST16 "hd" +#define SCNdLEAST32 "d" +#define SCNdLEAST64 "I64d" + +#define SCNdFAST16 "hd" +#define SCNdFAST32 "d" +#define SCNdFAST64 "I64d" + +#define SCNdMAX "I64d" + +#define SCNi16 "hi" +#define SCNi32 "i" +#define SCNi64 "I64i" + +#define SCNiLEAST16 "hi" +#define SCNiLEAST32 "i" +#define SCNiLEAST64 "I64i" + +#define SCNiFAST16 "hi" +#define SCNiFAST32 "i" +#define SCNiFAST64 "I64i" + +#define SCNiMAX "I64i" + +#define SCNo16 "ho" +#define SCNo32 "o" +#define SCNo64 "I64o" + +#define SCNoLEAST16 "ho" +#define SCNoLEAST32 "o" +#define SCNoLEAST64 "I64o" + +#define SCNoFAST16 "ho" +#define SCNoFAST32 "o" +#define SCNoFAST64 "I64o" + +#define SCNoMAX "I64o" + +#define SCNx16 "hx" +#define SCNx32 "x" +#define SCNx64 "I64x" + +#define SCNxLEAST16 "hx" +#define SCNxLEAST32 "x" +#define SCNxLEAST64 "I64x" + +#define SCNxFAST16 "hx" +#define SCNxFAST32 "x" +#define SCNxFAST64 "I64x" + +#define SCNxMAX "I64x" + +/* fscanf macros for unsigned int types */ + +#define SCNu16 "hu" +#define SCNu32 "u" +#define SCNu64 "I64u" + +#define SCNuLEAST16 "hu" +#define SCNuLEAST32 "u" +#define SCNuLEAST64 "I64u" + +#define SCNuFAST16 "hu" +#define SCNuFAST32 "u" +#define SCNuFAST64 "I64u" + +#define SCNuMAX "I64u" + +#ifdef _WIN64 +#define PRIdPTR "I64d" +#define PRIiPTR "I64i" +#define PRIoPTR "I64o" +#define PRIuPTR "I64u" +#define PRIxPTR "I64x" +#define PRIXPTR "I64X" +#define SCNdPTR "I64d" +#define SCNiPTR "I64i" +#define SCNoPTR "I64o" +#define SCNxPTR "I64x" +#define SCNuPTR "I64u" +#else +#define PRIdPTR "d" +#define PRIiPTR "i" +#define PRIoPTR "o" +#define PRIuPTR "u" +#define PRIxPTR "x" +#define PRIXPTR "X" +#define SCNdPTR "d" +#define SCNiPTR "i" +#define SCNoPTR "o" +#define SCNxPTR "x" + #define SCNuPTR "u" +#endif + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* + * no length modifier for char types prior to C9x + * MS runtime scanf appears to treat "hh" as "h" + */ + +/* signed char */ +#define SCNd8 "hhd" +#define SCNdLEAST8 "hhd" +#define SCNdFAST8 "hhd" + +#define SCNi8 "hhi" +#define SCNiLEAST8 "hhi" +#define SCNiFAST8 "hhi" + +#define SCNo8 "hho" +#define SCNoLEAST8 "hho" +#define SCNoFAST8 "hho" + +#define SCNx8 "hhx" +#define SCNxLEAST8 "hhx" +#define SCNxFAST8 "hhx" + +/* unsigned char */ +#define SCNu8 "hhu" +#define SCNuLEAST8 "hhu" +#define SCNuFAST8 "hhu" +#endif /* __STDC_VERSION__ >= 199901 */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ndef _INTTYPES_H */ diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb.dsw b/thirdparty/libusb/libusb-1.0.9/msvc/libusb.dsw new file mode 100644 index 0000000..fbe3015 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb.dsw @@ -0,0 +1,56 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libusb_dll"=".\libusb_dll.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libusb_static"=".\libusb_static.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "listdevs"=".\listdevs.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libusb_static + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.dsp b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.dsp new file mode 100644 index 0000000..bad8d15 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.dsp @@ -0,0 +1,190 @@ +# Microsoft Developer Studio Project File - Name="libusb_dll" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=libusb_dll - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libusb_dll.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libusb_dll.mak" CFG="libusb_dll - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libusb_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libusb_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libusb_dll - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/dll" +# PROP Intermediate_Dir "../Win32/Release/dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LIBUSB_DLL_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_USRDLL" /FR /FD /EHsc /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Win32/Release/dll/libusb-1.0.dll" + +!ELSEIF "$(CFG)" == "libusb_dll - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/dll" +# PROP Intermediate_Dir "../Win32/Debug/dll" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LIBUSB_DLL_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_USRDLL" /FR /FD /EHsc /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Win32/Debug/dll/libusb-1.0.dll" +# SUBTRACT LINK32 /pdb:none /incremental:no + +!ENDIF + +# Begin Target + +# Name "libusb_dll - Win32 Release" +# Name "libusb_dll - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\libusb\core.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\descriptor.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\io.c +# End Source File +# Begin Source File + +SOURCE="..\libusb\libusb-1.0.rc" +# End Source File +# Begin Source File + +SOURCE="..\libusb\libusb-1.0.def" +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\sync.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusbi.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcproj b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcproj new file mode 100644 index 0000000..0672695 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcproj @@ -0,0 +1,421 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj new file mode 100644 index 0000000..8a6ac80 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj @@ -0,0 +1,166 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (dll) + {349EE8FA-7D25-4909-AAF5-FF3FADE72187} + libusbdll + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\ + $(SolutionDir)..\$(Platform)\$(Configuration)\dll\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + true + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + + + $(OutDir)libusb-1.0.dll + ..\libusb\libusb-1.0.def + libusb-1.0.rc;%(EmbedManagedResourceFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj.filters b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj.filters new file mode 100644 index 0000000..38a26a4 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_dll.vcxproj.filters @@ -0,0 +1,69 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {d81e81ca-b13e-4a15-b54b-b12b41361e6b} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_sources b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_sources new file mode 100644 index 0000000..8e8e65c --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_sources @@ -0,0 +1,36 @@ +#TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build +TARGETNAME=libusb-1.0 +DLLDEF=..\libusb-1.0.def + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +INCLUDES=..;..\..\msvc;$(DDK_INC_PATH) +C_DEFINES= $(C_DEFINES) $(LIBUSB_DEFINES) /DDDKBUILD + +# http://jpassing.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/ +# prevents the following error when using the 64 bit static lib with Visual Studio 2010: +# "fatal error C1001: An internal error has occurred in the compiler. +# (compiler file 'f:\dd\vctools\compiler\utc\src\p2\p2symtab.c', line 1823)" +# and the following with Visual Studio 2010: +# "fatal error C1047: The object or library file 'libusb-1.0.lib' was created with +# an older compiler than other objects; rebuild old objects and libraries" +USER_C_FLAGS=/GL- + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib + +SOURCES=..\core.c \ + ..\descriptor.c \ + ..\io.c \ + ..\sync.c \ + threads_windows.c \ + poll_windows.c \ + windows_usb.c \ + ..\libusb-1.0.rc diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.dsp b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.dsp new file mode 100644 index 0000000..b636691 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.dsp @@ -0,0 +1,170 @@ +# Microsoft Developer Studio Project File - Name="libusb_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libusb_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libusb_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libusb_static.mak" CFG="libusb_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libusb_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libusb_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libusb_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/lib" +# PROP Intermediate_Dir "../Win32/Release/lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "../libusb" /D "WIN32" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../Win32/Release/lib/libusb-1.0.lib" + +!ELSEIF "$(CFG)" == "libusb_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/lib" +# PROP Intermediate_Dir "../Win32/Debug/lib" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "../libusb" /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /D "_LIB" /FR /FD /GZ /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"../Win32/Debug/lib/libusb-1.0.lib" + +!ENDIF + +# Begin Target + +# Name "libusb_static - Win32 Release" +# Name "libusb_static - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\libusb\core.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\descriptor.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\io.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.c +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\sync.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.c +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\config.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\darwin_usb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusb.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\libusbi.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\linux_usbfs.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\poll_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_posix.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\threads_windows.h +# End Source File +# Begin Source File + +SOURCE=..\libusb\os\windows_usb.h +# End Source File +# End Group +# End Target +# End Project diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcproj b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcproj new file mode 100644 index 0000000..e9ba31d --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcproj @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj new file mode 100644 index 0000000..c24d68d --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj @@ -0,0 +1,150 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb-1.0 (static) + {349EE8F9-7D25-4909-AAF5-FF3FADE72187} + libusb + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\ + $(SolutionDir)..\$(Platform)\$(Configuration)\lib\libusb-1.0\ + libusb-1.0 + libusb-1.0 + libusb-1.0 + libusb-1.0 + + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + Disabled + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + $(OutDir)libusb-1.0.lib + + + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + $(OutDir)libusb-1.0.lib + + + + + X64 + + + .;..\libusb;%(AdditionalIncludeDirectories) + _WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + $(OutDir)libusb-1.0.lib + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj.filters b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj.filters new file mode 100644 index 0000000..e9750e1 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_static.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2005.sln b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2005.sln new file mode 100644 index 0000000..4c29bbf --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2005.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static.vcproj", "{5AB6B770-1925-48D5-ABC2-930F3259C020}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll.vcproj", "{8224C054-5968-4238-832C-167155E7ECC3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs.vcproj", "{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.Build.0 = Debug|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.ActiveCfg = Debug|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.Build.0 = Debug|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.ActiveCfg = Release|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.Build.0 = Release|Win32 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.ActiveCfg = Release|x64 + {5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.Build.0 = Release|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.ActiveCfg = Debug|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.Build.0 = Debug|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.ActiveCfg = Debug|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.Build.0 = Debug|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.ActiveCfg = Release|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.Build.0 = Release|Win32 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.ActiveCfg = Release|x64 + {8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.Build.0 = Release|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.ActiveCfg = Debug|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.Build.0 = Debug|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.ActiveCfg = Debug|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.Build.0 = Debug|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.ActiveCfg = Release|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.Build.0 = Release|Win32 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.ActiveCfg = Release|x64 + {98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2010.sln b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2010.sln new file mode 100644 index 0000000..c0e0234 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/libusb_vs2010.sln @@ -0,0 +1,49 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (static)", "libusb_static.vcxproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0 (dll)", "libusb_dll.vcxproj", "{349EE8FA-7D25-4909-AAF5-FF3FADE72187}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "listdevs", "listdevs.vcxproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32 + {349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64 + {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.dsp b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.dsp new file mode 100644 index 0000000..93a93e4 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.dsp @@ -0,0 +1,103 @@ +# Microsoft Developer Studio Project File - Name="listdevs" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=listdevs - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "listdevs.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "listdevs.mak" CFG="listdevs - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "listdevs - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "listdevs - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "listdevs - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../Win32/Release/examples" +# PROP Intermediate_Dir "../Win32/Release/examples/listdevs" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../libusb" /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /EHsc /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "listdevs - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../Win32/Debug/examples" +# PROP Intermediate_Dir "../Win32/Debug/examples/listdevs" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../libusb" /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /U "_MBCS" /FR /FD /GZ /EHsc /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo /n "../Win32/Debug/dll/core.sbr" "../Win32/Debug/dll/descriptor.sbr" "../Win32/Debug/dll/io.sbr" "../Win32/Debug/dll/sync.sbr" "../Win32/Debug/dll/poll_windows.sbr" "../Win32/Debug/dll/threads_windows.sbr" "../Win32/Debug/dll/windows_usb.sbr" +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "listdevs - Win32 Release" +# Name "listdevs - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\examples\listdevs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcproj b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcproj new file mode 100644 index 0000000..88cef7f --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj new file mode 100644 index 0000000..e1b4fa4 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj @@ -0,0 +1,165 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + listdevs + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87} + examples + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\ + $(SolutionDir)..\$(Platform)\$(Configuration)\examples\$(ProjectName)\ + + + + $(IntDir)$(ProjectName).htm + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + Disabled + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDebug + Level3 + ProgramDatabase + + + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + $(IntDir)$(ProjectName).htm + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + X64 + + + ..\libusb;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + + + %(AdditionalLibraryDirectories) + $(TargetDir)$(ProjectName).pdb + Console + MachineX64 + + + + + + + + {349ee8f9-7d25-4909-aaf5-ff3fade72187} + false + + + + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj.filters b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj.filters new file mode 100644 index 0000000..0aed055 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + + + Source Files + + + diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/listdevs_sources b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs_sources new file mode 100644 index 0000000..97a5723 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/listdevs_sources @@ -0,0 +1,19 @@ +TARGETNAME=listdevs +TARGETTYPE=PROGRAM +386_STDCALL=0 + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +!IFDEF STATIC_LIBC +USE_LIBCMT=1 +!ELSE +USE_MSVCRT=1 +!ENDIF + +UMTYPE=console +INCLUDES=..\..\libusb;$(DDK_INC_PATH) +UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib +SOURCES=..\listdevs.c diff --git a/thirdparty/libusb/libusb-1.0.9/msvc/stdint.h b/thirdparty/libusb/libusb-1.0.9/msvc/stdint.h new file mode 100644 index 0000000..00988d9 --- /dev/null +++ b/thirdparty/libusb/libusb-1.0.9/msvc/stdint.h @@ -0,0 +1,256 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was originally part of the w64 mingw-runtime package. + */ + +/* ISO C9x 7.18 Integer types + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +#ifndef _STDINT_H +#define _STDINT_H + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifndef __intptr_t_defined +#define __intptr_t_defined +#undef intptr_t +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif /* _WIN64 */ +#endif /* __intptr_t_defined */ +#endif /* _INTPTR_T_DEFINED */ + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifndef __uintptr_t_defined +#define __uintptr_t_defined +#undef uintptr_t +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif /* _WIN64 */ +#endif /* __uintptr_t_defined */ +#endif /* _UINTPTR_T_DEFINED */ + +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T_ +#undef ptrdiff_t +#ifdef _WIN64 + typedef __int64 ptrdiff_t; +#else + typedef int ptrdiff_t; +#endif /* _WIN64 */ +#endif /* _PTRDIFF_T_ */ +#endif /* _PTRDIFF_T_DEFINED */ + +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED +#ifndef __cplusplus + typedef unsigned short wchar_t; +#endif /* C++ */ +#endif /* _WCHAR_T_DEFINED */ + +#ifndef _WCTYPE_T_DEFINED +#define _WCTYPE_T_DEFINED +#ifndef _WINT_T +#define _WINT_T + typedef unsigned short wint_t; + typedef unsigned short wctype_t; +#endif /* _WINT_T */ +#endif /* _WCTYPE_T_DEFINED */ + +/* 7.18.1.1 Exact-width integer types */ +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef __int64 int_least64_t; +typedef unsigned __int64 uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef __int8 int_fast8_t; +typedef unsigned __int8 uint_fast8_t; +typedef __int16 int_fast16_t; +typedef unsigned __int16 uint_fast16_t; +typedef __int32 int_fast32_t; +typedef unsigned __int32 uint_fast32_t; +typedef __int64 int_fast64_t; +typedef unsigned __int64 uint_fast64_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 0xffffffffU /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#ifdef _WIN64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif +#endif + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0U +#define WCHAR_MAX 0xffffU +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0U +#define WINT_MAX 0xffffU + + +/* 7.18.4 Macros for integer constants */ + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." + + The trick used here is from Clive D W Feather. +*/ + +#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) +#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) +#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ +#define INT64_C(val) val##i64 + +#define UINT8_C(val) (val) +#define UINT16_C(val) (val) +#define UINT32_C(val) (val##i32) +#define UINT64_C(val) val##ui64 + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) val##i64 +#define UINTMAX_C(val) val##ui64 + +#endif diff --git a/thirdparty/lzo/.gitignore b/thirdparty/lzo/.gitignore new file mode 100644 index 0000000..703adde --- /dev/null +++ b/thirdparty/lzo/.gitignore @@ -0,0 +1 @@ +lzo-* diff --git a/thirdparty/lzo/2.03/AUTHORS b/thirdparty/lzo/2.03/AUTHORS new file mode 100644 index 0000000..d53d32c --- /dev/null +++ b/thirdparty/lzo/2.03/AUTHORS @@ -0,0 +1,3 @@ +Authors of the LZO data compression library: + +Markus F.X.J. Oberhumer. Invented, designed and implemented LZO. diff --git a/thirdparty/lzo/2.03/B/00README.TXT b/thirdparty/lzo/2.03/B/00README.TXT new file mode 100644 index 0000000..9d099db --- /dev/null +++ b/thirdparty/lzo/2.03/B/00README.TXT @@ -0,0 +1,54 @@ +Simple make drivers for DOS, Windows, OS/2 and other systems +============================================================ + +This directory contains a bunch of simple build scripts - I've tried +to make them as foolproof as possible. + +To build LZO for your system type `b\OS\COMPILER' in the base directory, +e.g. `b\win32\vc.bat' will build the Win32 Visual C/C++ version. + +After building do a basic test by running `lzotest.exe -mlzo COPYING'. +util\check.sh is an example of a more thorough test driver. + +Please send me your additional/improved versions. + + +Overview: +--------- + +b\dos32\bc_pp.bat Borland C/C++ (1) +b\dos32\dj2.bat djgpp v2 + gcc (1) +b\dos32\dm.bat Digital Mars C/C++ (1) +b\dos32\emx.bat emx + gcc (1) +b\dos32\sc.bat Symantec C/C++ (1) +b\dos32\wc.bat Watcom C/C++ (1) + +b\os2\emx.bat emx + gcc (1) +b\os2\wc.bat Watcom C/C++ (1) + +b\win32\bc.bat Borland C/C++ (1) +b\win32\cygwin.bat Cygwin + gcc (1) +b\win32\dm.bat Digital Mars C/C++ (1) +b\win32\ic.bat Intel C/C++ (1) +b\win32\mingw.bat MinGW + gcc (1) +b\win32\mwerks.bat Metrowerks CodeWarrior C/C++ (1) +b\win32\pellesc.bat Pelles C (1) +b\win32\pgi.bat Portland Group PGI C/C++ (1) +b\win32\rsxnt.bat rsxnt + gcc (1) +b\win32\sc.bat Symantec C/C++ (1) +b\win32\vc.bat Visual C/C++ (1) +b\win32\vc_dll.bat Visual C/C++ (DLL version) (1) +b\win32\wc.bat Watcom C/C++ (1) + +b\win64\ic.bat Intel C/C++ (Itanium) +b\win64\ic_dll.bat Intel C/C++ (Itanium) (DLL version) +b\win64\vc.bat Visual C/C++ (AMD64 or Itanium) +b\win64\vc_dll.bat Visual C/C++ (AMD64 or Itanium) (DLL version) + +Finally, there are also a number of build scripts for obsolete systems +like dos16 and win16. + + +Notes: + (1) includes support for i386 assembler versions + diff --git a/thirdparty/lzo/2.03/B/clean.bat b/thirdparty/lzo/2.03/B/clean.bat new file mode 100644 index 0000000..453e947 --- /dev/null +++ b/thirdparty/lzo/2.03/B/clean.bat @@ -0,0 +1,4 @@ +@del /q *.def *.err *.exp *.map *.o *.obj *.res *.tds > nul 2> nul +@del /q liblzo2.a lzo2.a lzo2.dll lzo2.lib > nul 2> nul +@del /q a.exe a.out dict.exe lzopack.exe precomp.exe precomp2.exe simple.exe > nul 2> nul +@del /q lzotest.exe testmini.exe > nul 2> nul diff --git a/thirdparty/lzo/2.03/B/done.bat b/thirdparty/lzo/2.03/B/done.bat new file mode 100644 index 0000000..0ae243d --- /dev/null +++ b/thirdparty/lzo/2.03/B/done.bat @@ -0,0 +1,2 @@ +@echo // +@echo // Building LZO was successful. All done. diff --git a/thirdparty/lzo/2.03/B/dos16/bc.bat b/thirdparty/lzo/2.03/B/dos16/bc.bat new file mode 100644 index 0000000..1dbcd1b --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/bc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Borland C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc -ml -f- +set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -f -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -f -ls -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/bc.rsp b/thirdparty/lzo/2.03/B/dos16/bc.rsp new file mode 100644 index 0000000..39b28f9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/bc.rsp @@ -0,0 +1,67 @@ ++lzo1.obj & ++lzo1_99.obj & ++lzo1a.obj & ++lzo1a_99.obj & ++lzo1b_1.obj & ++lzo1b_2.obj & ++lzo1b_3.obj & ++lzo1b_4.obj & ++lzo1b_5.obj & ++lzo1b_6.obj & ++lzo1b_7.obj & ++lzo1b_8.obj & ++lzo1b_9.obj & ++lzo1b_99.obj & ++lzo1b_9x.obj & ++lzo1b_cc.obj & ++lzo1b_d1.obj & ++lzo1b_d2.obj & ++lzo1b_rr.obj & ++lzo1b_xx.obj & ++lzo1c_1.obj & ++lzo1c_2.obj & ++lzo1c_3.obj & ++lzo1c_4.obj & ++lzo1c_5.obj & ++lzo1c_6.obj & ++lzo1c_7.obj & ++lzo1c_8.obj & ++lzo1c_9.obj & ++lzo1c_99.obj & ++lzo1c_9x.obj & ++lzo1c_cc.obj & ++lzo1c_d1.obj & ++lzo1c_d2.obj & ++lzo1c_rr.obj & ++lzo1c_xx.obj & ++lzo1f_1.obj & ++lzo1f_9x.obj & ++lzo1f_d1.obj & ++lzo1f_d2.obj & ++lzo1x_1.obj & ++lzo1x_1k.obj & ++lzo1x_1l.obj & ++lzo1x_1o.obj & ++lzo1x_9x.obj & ++lzo1x_d1.obj & ++lzo1x_d2.obj & ++lzo1x_d3.obj & ++lzo1x_o.obj & ++lzo1y_1.obj & ++lzo1y_9x.obj & ++lzo1y_d1.obj & ++lzo1y_d2.obj & ++lzo1y_d3.obj & ++lzo1y_o.obj & ++lzo1z_9x.obj & ++lzo1z_d1.obj & ++lzo1z_d2.obj & ++lzo1z_d3.obj & ++lzo2a_9x.obj & ++lzo2a_d1.obj & ++lzo2a_d2.obj & ++lzo_crc.obj & ++lzo_init.obj & ++lzo_ptr.obj & ++lzo_str.obj & ++lzo_util.obj diff --git a/thirdparty/lzo/2.03/B/dos16/bc_286.bat b/thirdparty/lzo/2.03/B/dos16/bc_286.bat new file mode 100644 index 0000000..f0482aa --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/bc_286.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Borland C/C++ + Pharlap 286DOS-Extender +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc286 -ml -2 +set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/bc_pp.bat b/thirdparty/lzo/2.03/B/dos16/bc_pp.bat new file mode 100644 index 0000000..cbb4e4a --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/bc_pp.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI16) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc -ml -2 -WX +set CF=-O1 -d -w -w-sig %CFI% -Iinclude\lzo +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples -DWITH_TIMER examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iminilzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/dm.bat b/thirdparty/lzo/2.03/B/dos16/dm.bat new file mode 100644 index 0000000..5d61d7c --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/dm.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Digital Mars C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=dmc -ml +set CF=-o -w- %CFI% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/mc.bat b/thirdparty/lzo/2.03/B/dos16/mc.bat new file mode 100644 index 0000000..2c82762 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/mc.bat @@ -0,0 +1,52 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Microsoft C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -AL +set CF=-O -Gf -W3 %CFI% +set LF=/map + +@REM %CC% %CF% -c src\*.c +for %%f in (src\*.c) do %CC% %CF% -c %%f +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +link %LF% dict.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +link %LF% lzopack.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +link %LF% precomp.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +link %LF% precomp2.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +link %LF% simple.obj,,,%BLIB%; +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +link %LF% lzotest.obj,,,%BLIB%; +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/mc_qc.bat b/thirdparty/lzo/2.03/B/dos16/mc_qc.bat new file mode 100644 index 0000000..90f7763 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/mc_qc.bat @@ -0,0 +1,52 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Microsoft C/C++ (QuickC) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -qc -AL +set CF=-O -Gf -W3 %CFI% +set LF=/map + +@REM %CC% %CF% -c src\*.c +for %%f in (src\*.c) do %CC% %CF% -c %%f +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +link %LF% dict.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +link %LF% lzopack.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +link %LF% precomp.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +link %LF% precomp2.obj,,,%BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +link %LF% simple.obj,,,%BLIB%; +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +link %LF% lzotest.obj,,,%BLIB%; +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/qc.bat b/thirdparty/lzo/2.03/B/dos16/qc.bat new file mode 100644 index 0000000..3f79048 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/qc.bat @@ -0,0 +1,40 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Microsoft QuickC +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=qcl -nologo -AL +set CF=-O -Gf -W3 %CFI% +set LF=%BLIB% -Fm + +@REM %CC% %CF% -c src\*.c +for %%f in (src\*.c) do %CC% %CF% -c %%f +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/sc.bat b/thirdparty/lzo/2.03/B/dos16/sc.bat new file mode 100644 index 0000000..69b347a --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/sc.bat @@ -0,0 +1,53 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Symantec C/C++ +@echo // +@echo // NOTE: LZO breaks the optimizer, so we disable optimizations +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=sc -ml +set CF=-w- %CFI% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/tc.bat b/thirdparty/lzo/2.03/B/dos16/tc.bat new file mode 100644 index 0000000..6c3eee9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/tc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Turbo C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=tcc -ml -f- +set CF=-O -G -w -w-rch -w-sig %CFI% -Iinclude\lzo +set LF=%BLIB% + +%CC% %CF% -Isrc -c src\*.c +@if errorlevel 1 goto error +tlib %BLIB% @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -f -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -f -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/vc.bat b/thirdparty/lzo/2.03/B/dos16/vc.bat new file mode 100644 index 0000000..d809645 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/vc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Microsoft Visual C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -AL +set CF=-O -Gf -Gs -Gy -W3 %CFI% +set LF=%BLIB% -Fm + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/vc_qc.bat b/thirdparty/lzo/2.03/B/dos16/vc_qc.bat new file mode 100644 index 0000000..2a582a6 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/vc_qc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Microsoft Visual C/C++ (QuickC) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -qc -AL +set CF=-O -Gf -Gy -W3 %CFI% +set LF=%BLIB% -Fm + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/wc.bat b/thirdparty/lzo/2.03/B/dos16/wc.bat new file mode 100644 index 0000000..6b4224f --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/wc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 16-bit +@echo // Watcom C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl -zq -ml -bt#dos -l#dos +set CF=-ox %CFI% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos16/wc.rsp b/thirdparty/lzo/2.03/B/dos16/wc.rsp new file mode 100644 index 0000000..f36b8cb --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos16/wc.rsp @@ -0,0 +1,67 @@ ++'lzo1.obj' ++'lzo1_99.obj' ++'lzo1a.obj' ++'lzo1a_99.obj' ++'lzo1b_1.obj' ++'lzo1b_2.obj' ++'lzo1b_3.obj' ++'lzo1b_4.obj' ++'lzo1b_5.obj' ++'lzo1b_6.obj' ++'lzo1b_7.obj' ++'lzo1b_8.obj' ++'lzo1b_9.obj' ++'lzo1b_99.obj' ++'lzo1b_9x.obj' ++'lzo1b_cc.obj' ++'lzo1b_d1.obj' ++'lzo1b_d2.obj' ++'lzo1b_rr.obj' ++'lzo1b_xx.obj' ++'lzo1c_1.obj' ++'lzo1c_2.obj' ++'lzo1c_3.obj' ++'lzo1c_4.obj' ++'lzo1c_5.obj' ++'lzo1c_6.obj' ++'lzo1c_7.obj' ++'lzo1c_8.obj' ++'lzo1c_9.obj' ++'lzo1c_99.obj' ++'lzo1c_9x.obj' ++'lzo1c_cc.obj' ++'lzo1c_d1.obj' ++'lzo1c_d2.obj' ++'lzo1c_rr.obj' ++'lzo1c_xx.obj' ++'lzo1f_1.obj' ++'lzo1f_9x.obj' ++'lzo1f_d1.obj' ++'lzo1f_d2.obj' ++'lzo1x_1.obj' ++'lzo1x_1k.obj' ++'lzo1x_1l.obj' ++'lzo1x_1o.obj' ++'lzo1x_9x.obj' ++'lzo1x_d1.obj' ++'lzo1x_d2.obj' ++'lzo1x_d3.obj' ++'lzo1x_o.obj' ++'lzo1y_1.obj' ++'lzo1y_9x.obj' ++'lzo1y_d1.obj' ++'lzo1y_d2.obj' ++'lzo1y_d3.obj' ++'lzo1y_o.obj' ++'lzo1z_9x.obj' ++'lzo1z_d1.obj' ++'lzo1z_d2.obj' ++'lzo1z_d3.obj' ++'lzo2a_9x.obj' ++'lzo2a_d1.obj' ++'lzo2a_d2.obj' ++'lzo_crc.obj' ++'lzo_init.obj' ++'lzo_ptr.obj' ++'lzo_str.obj' ++'lzo_util.obj' diff --git a/thirdparty/lzo/2.03/B/dos32/bc_pp.bat b/thirdparty/lzo/2.03/B/dos32/bc_pp.bat new file mode 100644 index 0000000..4250b21 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/bc_pp.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Borland C/C++ + Borland PowerPack 1.0 (DPMI32) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc32 -WX +set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM% +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -ls -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/dj2.bat b/thirdparty/lzo/2.03/B/dos32/dj2.bat new file mode 100644 index 0000000..7f2cdd1 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/dj2.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // djgpp2 + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=lib%BNAME%.a +set CC=gcc +set CF=@b/dos32/dj2.opt %CFI% %CFASM% +set LF=%BLIB% -s + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% @b/win32/cygwin.rsp +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -s -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/dj2.opt b/thirdparty/lzo/2.03/B/dos32/dj2.opt new file mode 100644 index 0000000..ce87d33 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/dj2.opt @@ -0,0 +1,7 @@ +-O2 +-fomit-frame-pointer +-Wall +-Wcast-align +-Wcast-qual +-Wwrite-strings +-Wno-uninitialized diff --git a/thirdparty/lzo/2.03/B/dos32/dm.bat b/thirdparty/lzo/2.03/B/dos32/dm.bat new file mode 100644 index 0000000..eb89106 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/dm.bat @@ -0,0 +1,43 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Digital Mars C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=dmc -mx +set CF=-o -w- %CFI% %CFASM% +set LF=%BLIB% x32.lib + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +set LF=x32.lib +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/emx.bat b/thirdparty/lzo/2.03/B/dos32/emx.bat new file mode 100644 index 0000000..ef6ada9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/emx.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // emx + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=%BNAME%.a +set CC=gcc +set CF=@b/dos32/dj2.opt %CFI% %CFASM% +set LF=%BLIB% -s + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% @b/win32/cygwin.rsp +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/highc.bat b/thirdparty/lzo/2.03/B/dos32/highc.bat new file mode 100644 index 0000000..99b1aa9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/highc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // MetaWare High C/C++ (using Pharlap DOS extender) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=hc386 +set CF=-O3 -w4 %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -w1 -c src\*.c +@if errorlevel 1 goto error +386lib %BLIB% -nobanner @b\dos32\highc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/highc.rsp b/thirdparty/lzo/2.03/B/dos32/highc.rsp new file mode 100644 index 0000000..bb79c62 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/highc.rsp @@ -0,0 +1,79 @@ +-create lzo1.obj +-create lzo1_99.obj +-create lzo1a.obj +-create lzo1a_99.obj +-create lzo1b_1.obj +-create lzo1b_2.obj +-create lzo1b_3.obj +-create lzo1b_4.obj +-create lzo1b_5.obj +-create lzo1b_6.obj +-create lzo1b_7.obj +-create lzo1b_8.obj +-create lzo1b_9.obj +-create lzo1b_99.obj +-create lzo1b_9x.obj +-create lzo1b_cc.obj +-create lzo1b_d1.obj +-create lzo1b_d2.obj +-create lzo1b_rr.obj +-create lzo1b_xx.obj +-create lzo1c_1.obj +-create lzo1c_2.obj +-create lzo1c_3.obj +-create lzo1c_4.obj +-create lzo1c_5.obj +-create lzo1c_6.obj +-create lzo1c_7.obj +-create lzo1c_8.obj +-create lzo1c_9.obj +-create lzo1c_99.obj +-create lzo1c_9x.obj +-create lzo1c_cc.obj +-create lzo1c_d1.obj +-create lzo1c_d2.obj +-create lzo1c_rr.obj +-create lzo1c_xx.obj +-create lzo1f_1.obj +-create lzo1f_9x.obj +-create lzo1f_d1.obj +-create lzo1f_d2.obj +-create lzo1x_1.obj +-create lzo1x_1k.obj +-create lzo1x_1l.obj +-create lzo1x_1o.obj +-create lzo1x_9x.obj +-create lzo1x_d1.obj +-create lzo1x_d2.obj +-create lzo1x_d3.obj +-create lzo1x_o.obj +-create lzo1y_1.obj +-create lzo1y_9x.obj +-create lzo1y_d1.obj +-create lzo1y_d2.obj +-create lzo1y_d3.obj +-create lzo1y_o.obj +-create lzo1z_9x.obj +-create lzo1z_d1.obj +-create lzo1z_d2.obj +-create lzo1z_d3.obj +-create lzo2a_9x.obj +-create lzo2a_d1.obj +-create lzo2a_d2.obj +-create lzo_crc.obj +-create lzo_init.obj +-create lzo_ptr.obj +-create lzo_str.obj +-create lzo_util.obj +-create asm\i386\obj\omf32\lzo1c_s1.obj +-create asm\i386\obj\omf32\lzo1c_s2.obj +-create asm\i386\obj\omf32\lzo1f_f1.obj +-create asm\i386\obj\omf32\lzo1f_f2.obj +-create asm\i386\obj\omf32\lzo1x_f1.obj +-create asm\i386\obj\omf32\lzo1x_f2.obj +-create asm\i386\obj\omf32\lzo1x_s1.obj +-create asm\i386\obj\omf32\lzo1x_s2.obj +-create asm\i386\obj\omf32\lzo1y_f1.obj +-create asm\i386\obj\omf32\lzo1y_f2.obj +-create asm\i386\obj\omf32\lzo1y_s1.obj +-create asm\i386\obj\omf32\lzo1y_s2.obj diff --git a/thirdparty/lzo/2.03/B/dos32/ndp.bat b/thirdparty/lzo/2.03/B/dos32/ndp.bat new file mode 100644 index 0000000..0e33a4b --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/ndp.bat @@ -0,0 +1,40 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Microway NDP C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=mx486 +set CF=-ansi -on %CFI% +set LF=%BLIB% -bind -map + +@REM %CC% %CF% -Isrc -c src\*.c +for %%f in (src\*.c) do %CC% %CF% -Isrc -c %%f +@if errorlevel 1 goto error +ndplib %BLIB% @b\dos32\ndp.rsp +@if errorlevel 1 goto error + +%CC% %CF% -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Dconst= -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/ndp.rsp b/thirdparty/lzo/2.03/B/dos32/ndp.rsp new file mode 100644 index 0000000..24c1d43 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/ndp.rsp @@ -0,0 +1,67 @@ +-add lzo1.obj +-add lzo1_99.obj +-add lzo1a.obj +-add lzo1a_99.obj +-add lzo1b_1.obj +-add lzo1b_2.obj +-add lzo1b_3.obj +-add lzo1b_4.obj +-add lzo1b_5.obj +-add lzo1b_6.obj +-add lzo1b_7.obj +-add lzo1b_8.obj +-add lzo1b_9.obj +-add lzo1b_99.obj +-add lzo1b_9x.obj +-add lzo1b_cc.obj +-add lzo1b_d1.obj +-add lzo1b_d2.obj +-add lzo1b_rr.obj +-add lzo1b_xx.obj +-add lzo1c_1.obj +-add lzo1c_2.obj +-add lzo1c_3.obj +-add lzo1c_4.obj +-add lzo1c_5.obj +-add lzo1c_6.obj +-add lzo1c_7.obj +-add lzo1c_8.obj +-add lzo1c_9.obj +-add lzo1c_99.obj +-add lzo1c_9x.obj +-add lzo1c_cc.obj +-add lzo1c_d1.obj +-add lzo1c_d2.obj +-add lzo1c_rr.obj +-add lzo1c_xx.obj +-add lzo1f_1.obj +-add lzo1f_9x.obj +-add lzo1f_d1.obj +-add lzo1f_d2.obj +-add lzo1x_1.obj +-add lzo1x_1k.obj +-add lzo1x_1l.obj +-add lzo1x_1o.obj +-add lzo1x_9x.obj +-add lzo1x_d1.obj +-add lzo1x_d2.obj +-add lzo1x_d3.obj +-add lzo1x_o.obj +-add lzo1y_1.obj +-add lzo1y_9x.obj +-add lzo1y_d1.obj +-add lzo1y_d2.obj +-add lzo1y_d3.obj +-add lzo1y_o.obj +-add lzo1z_9x.obj +-add lzo1z_d1.obj +-add lzo1z_d2.obj +-add lzo1z_d3.obj +-add lzo2a_9x.obj +-add lzo2a_d1.obj +-add lzo2a_d2.obj +-add lzo_crc.obj +-add lzo_init.obj +-add lzo_ptr.obj +-add lzo_str.obj +-add lzo_util.obj diff --git a/thirdparty/lzo/2.03/B/dos32/sc.bat b/thirdparty/lzo/2.03/B/dos32/sc.bat new file mode 100644 index 0000000..5392dcf --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/sc.bat @@ -0,0 +1,51 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Symantec C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=sc -mx +set CF=-o -w- %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/wc.bat b/thirdparty/lzo/2.03/B/dos32/wc.bat new file mode 100644 index 0000000..5054270 --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/wc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Watcom C/C++ (using DOS/4G extender) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl386 -zq -mf -5r -bt#dos -l#dos4g +set CF=-ox -zc %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\win32\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/dos32/zc.bat b/thirdparty/lzo/2.03/B/dos32/zc.bat new file mode 100644 index 0000000..b350e5e --- /dev/null +++ b/thirdparty/lzo/2.03/B/dos32/zc.bat @@ -0,0 +1,51 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // DOS 32-bit +@echo // Zortech C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=ztc -b -v0 -mx +set CF=-o -w- -r %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +zorlib %BLIB% @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/generic/Makefile b/thirdparty/lzo/2.03/B/generic/Makefile new file mode 100644 index 0000000..88caf3a --- /dev/null +++ b/thirdparty/lzo/2.03/B/generic/Makefile @@ -0,0 +1,91 @@ +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# +# this is modelled after build.sh; needs GNU make 3.80 or better + +SHELL = /bin/sh + +## +## setup flags +## + +##top_srcdir ?= ../.. +top_srcdir ?= $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))../.. +AR ?= ar +CC ?= cc +CFLAGS ?= -O + +CFI = -I$(top_srcdir)/include -I$(top_srcdir) +BNAME = lzo2 +BLIB = lib$(BNAME).a + +CF = $(CPPFLAGS) $(CFI) $(CFLAGS) +LF = $(LDFLAGS) $(LZO_EXTRA_LDFLAGS) +LL = $(BLIB) $(LIBS) $(LZO_EXTRA_LIBS) + + +## +## setup files +## + +__map = $(foreach __map_v,$(2),$(call $(1),$(__map_v))) +__object_filename = $(addsuffix .o,$(basename $(notdir $(1)))) + +BLIB_SOURCES := $(wildcard $(top_srcdir)/src/*.c) +BLIB_SOURCES += $(LZO_EXTRA_SOURCES) +BLIB_OBJECTS := $(call __map,__object_filename,$(BLIB_SOURCES)) +PROGRAMS = dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out + + +## +## rules +## + +all.targets ?= $(BLIB) $(PROGRAMS) testmini.out +all: $(all.targets) + +clean: + rm -f *.d *.o $(BLIB) $(PROGRAMS) testmini.out + +$(BLIB): $(BLIB_OBJECTS) $(LZO_EXTRA_OBJECTS) + rm -f $@ + $(AR) rcs $@ $^ + +# dynamically construct object rules +define BLIB_OBJECT_template + $(call __object_filename,$(1)) : $(1) ; $$(CC) $$(CF) $$(LZO_EXTRA_CPPFLAGS) $$(LZO_EXTRA_CFLAGS) -c $$< +endef +$(foreach s,$(BLIB_SOURCES),$(eval $(call BLIB_OBJECT_template,$(s)))) + +dict.out: $(top_srcdir)/examples/dict.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) +lzopack.out: $(top_srcdir)/examples/lzopack.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) +precomp.out: $(top_srcdir)/examples/precomp.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) +precomp2.out: $(top_srcdir)/examples/precomp2.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) +simple.out: $(top_srcdir)/examples/simple.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) +lzotest.out: $(top_srcdir)/lzotest/lzotest.c + $(CC) $(CF) $(LF) -o $@ $< $(LL) + +testmini.out: $(top_srcdir)/minilzo/testmini.c $(top_srcdir)/minilzo/minilzo.c + $(CC) $(CF) $(LF) -I$(top_srcdir)/include/lzo -o $@ $^ $(LIBS) + + +# dependencies +$(PROGRAMS): $(BLIB) +# object dependencies are generated via -MMD +-include *.d + + +# debug +show_vars: + @echo "BLIB_SOURCES = $(BLIB_SOURCES)" + @echo "BLIB_OBJECTS = $(BLIB_OBJECTS)" + @echo "PROGRAMS = $(PROGRAMS)" + @echo "LZO_EXTRA_SOURCES = $(LZO_EXTRA_SOURCES)" + @echo "LZO_EXTRA_OBJECTS = $(LZO_EXTRA_OBJECTS)" + +.PHONY: all clean show_vars + diff --git a/thirdparty/lzo/2.03/B/generic/clean.sh b/thirdparty/lzo/2.03/B/generic/clean.sh new file mode 100644 index 0000000..0a946cc --- /dev/null +++ b/thirdparty/lzo/2.03/B/generic/clean.sh @@ -0,0 +1,7 @@ +#! /bin/sh +# vi:ts=4:et +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer + +rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out + +true diff --git a/thirdparty/lzo/2.03/B/os2/emx.bat b/thirdparty/lzo/2.03/B/os2/emx.bat new file mode 100644 index 0000000..86ebf1d --- /dev/null +++ b/thirdparty/lzo/2.03/B/os2/emx.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // OS/2 32-bit +@echo // emx + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=%BNAME%.a +set CC=gcc +set CF=@b/dos32/dj2.opt %CFI% %CFASM% +set LF=%BLIB% -s + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% @b/win32/cygwin.rsp +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/os2/wc.bat b/thirdparty/lzo/2.03/B/os2/wc.bat new file mode 100644 index 0000000..bb89948 --- /dev/null +++ b/thirdparty/lzo/2.03/B/os2/wc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // OS/2 32-bit +@echo // Watcom C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl386 -zq -mf -5r -bt#os2 -l#os2v2 +set CF=-ox -zc %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\win32\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/os2/zc.bat b/thirdparty/lzo/2.03/B/os2/zc.bat new file mode 100644 index 0000000..0262abb --- /dev/null +++ b/thirdparty/lzo/2.03/B/os2/zc.bat @@ -0,0 +1,51 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // OS/2 32-bit +@echo // Zortech C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=ztc -b -v0 -mf +set CF=-o -w- -r %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +zorlib %BLIB% @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/os2_16/mc.bat b/thirdparty/lzo/2.03/B/os2_16/mc.bat new file mode 100644 index 0000000..04f3cd9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/os2_16/mc.bat @@ -0,0 +1,43 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // OS/2 16-bit +@echo // Microsoft C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -AL -G2 +set CF=-D__OS2__ -O -Gf -Gs -W3 %CFI% +set LF=%BLIB% -Lp -Fm /link /stack:8096 + +@REM %CC% %CF% -c src\*.c +for %%f in (src\*.c) do %CC% %CF% -c %%f +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/os2_16/wc.bat b/thirdparty/lzo/2.03/B/os2_16/wc.bat new file mode 100644 index 0000000..b58dc27 --- /dev/null +++ b/thirdparty/lzo/2.03/B/os2_16/wc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // OS/2 16-bit +@echo // Watcom C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl -zq -ml -2 -bt#os2 -l#os2 +set CF=-ox %CFI% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/prepare.bat b/thirdparty/lzo/2.03/B/prepare.bat new file mode 100644 index 0000000..b68aa5b --- /dev/null +++ b/thirdparty/lzo/2.03/B/prepare.bat @@ -0,0 +1,10 @@ +@call b\unset.bat +@call b\clean.bat + +@set CFI=-Iinclude -I. +@set CFASM=-DLZO_USE_ASM +@set BNAME=lzo2 +@set BLIB=lzo2.lib +@set BDLL=lzo2.dll + +@echo Compiling, please be patient... diff --git a/thirdparty/lzo/2.03/B/src.rsp b/thirdparty/lzo/2.03/B/src.rsp new file mode 100644 index 0000000..26fd011 --- /dev/null +++ b/thirdparty/lzo/2.03/B/src.rsp @@ -0,0 +1,67 @@ +src/lzo1.c +src/lzo1_99.c +src/lzo1a.c +src/lzo1a_99.c +src/lzo1b_1.c +src/lzo1b_2.c +src/lzo1b_3.c +src/lzo1b_4.c +src/lzo1b_5.c +src/lzo1b_6.c +src/lzo1b_7.c +src/lzo1b_8.c +src/lzo1b_9.c +src/lzo1b_99.c +src/lzo1b_9x.c +src/lzo1b_cc.c +src/lzo1b_d1.c +src/lzo1b_d2.c +src/lzo1b_rr.c +src/lzo1b_xx.c +src/lzo1c_1.c +src/lzo1c_2.c +src/lzo1c_3.c +src/lzo1c_4.c +src/lzo1c_5.c +src/lzo1c_6.c +src/lzo1c_7.c +src/lzo1c_8.c +src/lzo1c_9.c +src/lzo1c_99.c +src/lzo1c_9x.c +src/lzo1c_cc.c +src/lzo1c_d1.c +src/lzo1c_d2.c +src/lzo1c_rr.c +src/lzo1c_xx.c +src/lzo1f_1.c +src/lzo1f_9x.c +src/lzo1f_d1.c +src/lzo1f_d2.c +src/lzo1x_1.c +src/lzo1x_1k.c +src/lzo1x_1l.c +src/lzo1x_1o.c +src/lzo1x_9x.c +src/lzo1x_d1.c +src/lzo1x_d2.c +src/lzo1x_d3.c +src/lzo1x_o.c +src/lzo1y_1.c +src/lzo1y_9x.c +src/lzo1y_d1.c +src/lzo1y_d2.c +src/lzo1y_d3.c +src/lzo1y_o.c +src/lzo1z_9x.c +src/lzo1z_d1.c +src/lzo1z_d2.c +src/lzo1z_d3.c +src/lzo2a_9x.c +src/lzo2a_d1.c +src/lzo2a_d2.c +src/lzo_crc.c +src/lzo_init.c +src/lzo_ptr.c +src/lzo_str.c +src/lzo_util.c diff --git a/thirdparty/lzo/2.03/B/unset.bat b/thirdparty/lzo/2.03/B/unset.bat new file mode 100644 index 0000000..98f1378 --- /dev/null +++ b/thirdparty/lzo/2.03/B/unset.bat @@ -0,0 +1,10 @@ +@set CC= +@set CF= +@set CFI= +@set CFX= +@set CFASM= +@set LF= +@set BNAME= +@set BLIB= +@set BDLL= +@set BECHO= diff --git a/thirdparty/lzo/2.03/B/win16/bc.bat b/thirdparty/lzo/2.03/B/win16/bc.bat new file mode 100644 index 0000000..cb623b9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/bc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Borland C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc -ml -2 -tW -h +set CF=-O1 -d -w -w-rch -w-sig %CFI% -Iinclude\lzo +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win16/dm.bat b/thirdparty/lzo/2.03/B/win16/dm.bat new file mode 100644 index 0000000..d241197 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/dm.bat @@ -0,0 +1,43 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Digital Mars C/C++ (using WINIO) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=dmc -ml -2 -W +set CF=-o -w- %CFI% +set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096 + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +set LF=libw.lib commdlg.lib lwindos.lib /L/map/stack:8096 +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win16/mc.bat b/thirdparty/lzo/2.03/B/win16/mc.bat new file mode 100644 index 0000000..be38da7 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/mc.bat @@ -0,0 +1,56 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Microsoft C/C++ (using QuickWin) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -AL -G2 -Mq +set CF=-O -Gf -W3 %CFI% +set LF=/seg:256 /stack:8096 /nod:llibce /map + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +link %LF% dict.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +link %LF% lzopack.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +link %LF% precomp.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +link %LF% precomp2.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +link %LF% simple.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +link %LF% lzotest.obj,,,llibcewq.lib libw.lib %BLIB%; +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error +link %LF% testmini.obj minilzo.obj,,,llibcewq.lib libw.lib; +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win16/sc.bat b/thirdparty/lzo/2.03/B/win16/sc.bat new file mode 100644 index 0000000..b82530b --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/sc.bat @@ -0,0 +1,53 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Symantec C/C++ (using WINIO) +@echo // +@echo // NOTE: LZO breaks the optimizer, so we disable optimizations +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=sc -ml -2 -W +set CF=-w- %CFI% +set LF=%BLIB% libw.lib commdlg.lib lwindos.lib /L/map/stack:8096 + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\dos16\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win16/vc.bat b/thirdparty/lzo/2.03/B/win16/vc.bat new file mode 100644 index 0000000..8a6d534 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/vc.bat @@ -0,0 +1,43 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Microsoft Visual C/C++ (using QuickWin) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -AL -G2 -Mq +set CF=-O -Gf -Gs -Gy -W3 %CFI% +set LF=%BLIB% -Fm /link /seg:256 + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib /nologo %BLIB% @b\dos16\bc.rsp; +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +set LF=-Fm /link /seg:256 +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win16/wc.bat b/thirdparty/lzo/2.03/B/win16/wc.bat new file mode 100644 index 0000000..6f09e1e --- /dev/null +++ b/thirdparty/lzo/2.03/B/win16/wc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 16-bit +@echo // Watcom C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl -zq -ml -2 -bw -bt#windows -l#windows +set CF=-ox %CFI% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\dos16\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/bc.bat b/thirdparty/lzo/2.03/B/win32/bc.bat new file mode 100644 index 0000000..7b0a6c5 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/bc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Borland C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=bcc32 +set CF=-O2 -w -w-aus %CFI% -Iinclude\lzo %CFASM% +set LF=%BLIB% + +%CC% %CF% -Isrc -c @b\src.rsp +@if errorlevel 1 goto error +tlib %BLIB% @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -ls -Iexamples examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -ls -Iexamples examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Ilzotest lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -ls -Iminilzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/bc.rsp b/thirdparty/lzo/2.03/B/win32/bc.rsp new file mode 100644 index 0000000..a9fb1aa --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/bc.rsp @@ -0,0 +1,79 @@ ++lzo1.obj & ++lzo1_99.obj & ++lzo1a.obj & ++lzo1a_99.obj & ++lzo1b_1.obj & ++lzo1b_2.obj & ++lzo1b_3.obj & ++lzo1b_4.obj & ++lzo1b_5.obj & ++lzo1b_6.obj & ++lzo1b_7.obj & ++lzo1b_8.obj & ++lzo1b_9.obj & ++lzo1b_99.obj & ++lzo1b_9x.obj & ++lzo1b_cc.obj & ++lzo1b_d1.obj & ++lzo1b_d2.obj & ++lzo1b_rr.obj & ++lzo1b_xx.obj & ++lzo1c_1.obj & ++lzo1c_2.obj & ++lzo1c_3.obj & ++lzo1c_4.obj & ++lzo1c_5.obj & ++lzo1c_6.obj & ++lzo1c_7.obj & ++lzo1c_8.obj & ++lzo1c_9.obj & ++lzo1c_99.obj & ++lzo1c_9x.obj & ++lzo1c_cc.obj & ++lzo1c_d1.obj & ++lzo1c_d2.obj & ++lzo1c_rr.obj & ++lzo1c_xx.obj & ++lzo1f_1.obj & ++lzo1f_9x.obj & ++lzo1f_d1.obj & ++lzo1f_d2.obj & ++lzo1x_1.obj & ++lzo1x_1k.obj & ++lzo1x_1l.obj & ++lzo1x_1o.obj & ++lzo1x_9x.obj & ++lzo1x_d1.obj & ++lzo1x_d2.obj & ++lzo1x_d3.obj & ++lzo1x_o.obj & ++lzo1y_1.obj & ++lzo1y_9x.obj & ++lzo1y_d1.obj & ++lzo1y_d2.obj & ++lzo1y_d3.obj & ++lzo1y_o.obj & ++lzo1z_9x.obj & ++lzo1z_d1.obj & ++lzo1z_d2.obj & ++lzo1z_d3.obj & ++lzo2a_9x.obj & ++lzo2a_d1.obj & ++lzo2a_d2.obj & ++lzo_crc.obj & ++lzo_init.obj & ++lzo_ptr.obj & ++lzo_str.obj & ++lzo_util.obj & ++asm\i386\obj\omf32\lzo1c_s1.obj & ++asm\i386\obj\omf32\lzo1c_s2.obj & ++asm\i386\obj\omf32\lzo1f_f1.obj & ++asm\i386\obj\omf32\lzo1f_f2.obj & ++asm\i386\obj\omf32\lzo1x_f1.obj & ++asm\i386\obj\omf32\lzo1x_f2.obj & ++asm\i386\obj\omf32\lzo1x_s1.obj & ++asm\i386\obj\omf32\lzo1x_s2.obj & ++asm\i386\obj\omf32\lzo1y_f1.obj & ++asm\i386\obj\omf32\lzo1y_f2.obj & ++asm\i386\obj\omf32\lzo1y_s1.obj & ++asm\i386\obj\omf32\lzo1y_s2.obj diff --git a/thirdparty/lzo/2.03/B/win32/cygwin.bat b/thirdparty/lzo/2.03/B/win32/cygwin.bat new file mode 100644 index 0000000..704402b --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/cygwin.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // cygwin + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=lib%BNAME%.a +set CC=gcc +set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM% +set LF=%BLIB% -lwinmm -s + +%CC% %CF% -Wno-uninitialized -c src/*.c +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% @b/win32/cygwin.rsp +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -Wno-uninitialized -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/cygwin.rsp b/thirdparty/lzo/2.03/B/win32/cygwin.rsp new file mode 100644 index 0000000..9b3e6ea --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/cygwin.rsp @@ -0,0 +1,79 @@ +lzo1.o +lzo1_99.o +lzo1a.o +lzo1a_99.o +lzo1b_1.o +lzo1b_2.o +lzo1b_3.o +lzo1b_4.o +lzo1b_5.o +lzo1b_6.o +lzo1b_7.o +lzo1b_8.o +lzo1b_9.o +lzo1b_99.o +lzo1b_9x.o +lzo1b_cc.o +lzo1b_d1.o +lzo1b_d2.o +lzo1b_rr.o +lzo1b_xx.o +lzo1c_1.o +lzo1c_2.o +lzo1c_3.o +lzo1c_4.o +lzo1c_5.o +lzo1c_6.o +lzo1c_7.o +lzo1c_8.o +lzo1c_9.o +lzo1c_99.o +lzo1c_9x.o +lzo1c_cc.o +lzo1c_d1.o +lzo1c_d2.o +lzo1c_rr.o +lzo1c_xx.o +lzo1f_1.o +lzo1f_9x.o +lzo1f_d1.o +lzo1f_d2.o +lzo1x_1.o +lzo1x_1k.o +lzo1x_1l.o +lzo1x_1o.o +lzo1x_9x.o +lzo1x_d1.o +lzo1x_d2.o +lzo1x_d3.o +lzo1x_o.o +lzo1y_1.o +lzo1y_9x.o +lzo1y_d1.o +lzo1y_d2.o +lzo1y_d3.o +lzo1y_o.o +lzo1z_9x.o +lzo1z_d1.o +lzo1z_d2.o +lzo1z_d3.o +lzo2a_9x.o +lzo2a_d1.o +lzo2a_d2.o +lzo_crc.o +lzo_init.o +lzo_ptr.o +lzo_str.o +lzo_util.o +lzo1c_s1.o +lzo1c_s2.o +lzo1f_f1.o +lzo1f_f2.o +lzo1x_f1.o +lzo1x_f2.o +lzo1x_s1.o +lzo1x_s2.o +lzo1y_f1.o +lzo1y_f2.o +lzo1y_s1.o +lzo1y_s2.o diff --git a/thirdparty/lzo/2.03/B/win32/dm.bat b/thirdparty/lzo/2.03/B/win32/dm.bat new file mode 100644 index 0000000..61dbda3 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/dm.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Digital Mars C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=dmc -mn +set CF=-o -w- %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/ic.bat b/thirdparty/lzo/2.03/B/win32/ic.bat new file mode 100644 index 0000000..7696539 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/ic.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Intel C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=icl -nologo -MD +set CF=-O2 -GF -W3 %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +link -lib -nologo -out:%BLIB% @b\win32\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/lccwin32.bat b/thirdparty/lzo/2.03/B/win32/lccwin32.bat new file mode 100644 index 0000000..a9e2ca8 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/lccwin32.bat @@ -0,0 +1,59 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // lcc-win32 +@echo // +@echo // NOTE: some lcc-win32 versions are buggy, so we disable optimizations +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=lcc +set CF=-O -A %CFI% -Iinclude\lzo %CFASM% +set CF=-A %CFI% -Iinclude\lzo %CFASM% +set LF=%BLIB% winmm.lib + +for %%f in (src\*.c) do %CC% %CF% -c %%f +@if errorlevel 1 goto error +lcclib /out:%BLIB% @b\win32\vc.rsp +@if errorlevel 1 goto error + +%CC% -c %CF% examples\dict.c +@if errorlevel 1 goto error +lc dict.obj %LF% +@if errorlevel 1 goto error +%CC% -c %CF% examples\lzopack.c +@if errorlevel 1 goto error +lc lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% -c %CF% examples\precomp.c +@if errorlevel 1 goto error +lc precomp.obj %LF% +@if errorlevel 1 goto error +%CC% -c %CF% examples\precomp2.c +@if errorlevel 1 goto error +lc precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% -c %CF% examples\simple.c +@if errorlevel 1 goto error +lc simple.obj %LF% +@if errorlevel 1 goto error + +%CC% -c %CF% lzotest\lzotest.c +@if errorlevel 1 goto error +lc lzotest.obj %LF% +@if errorlevel 1 goto error + +%CC% -c %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error +lc testmini.obj minilzo.obj +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/mingw.bat b/thirdparty/lzo/2.03/B/win32/mingw.bat new file mode 100644 index 0000000..3252173 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/mingw.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // MinGW + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=lib%BNAME%.a +set CC=gcc +set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM% +set LF=%BLIB% -lwinmm -s + +%CC% %CF% -Wno-uninitialized -c src/*.c +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% *.o +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -Wno-uninitialized -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/mwerks.bat b/thirdparty/lzo/2.03/B/win32/mwerks.bat new file mode 100644 index 0000000..5d13280 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/mwerks.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Metrowerks CodeWarrior C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=mwcc -gccinc +set CF=-opt full %CFI% %CFASM% +set LF=%BLIB% -lwinmm.lib + +%CC% -w on %CF% -w nounusedexpr -c @b\src.rsp +@if errorlevel 1 goto error +mwld -library -o %BLIB% @b\win32\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/pellesc.bat b/thirdparty/lzo/2.03/B/win32/pellesc.bat new file mode 100644 index 0000000..32569b7 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/pellesc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Pelles C +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cc -Ze -Go +set CF=-O2 -W2 %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +polib -out:%BLIB% @b\win32\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/pgi.bat b/thirdparty/lzo/2.03/B/win32/pgi.bat new file mode 100644 index 0000000..fd587f4 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/pgi.bat @@ -0,0 +1,43 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Portland Group PGI C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=lib%BNAME%.a +set CC=pgcc +set CF=-fast %CFI% %CFASM% +set LF=%BLIB% -lwinmm + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +ar rcs %BLIB% *.o asm/i386/obj/win32/*.obj +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/pw32.bat b/thirdparty/lzo/2.03/B/win32/pw32.bat new file mode 100644 index 0000000..042abde --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/pw32.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // PW32 + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=lib%BNAME%.a +set CC=gcc +set CF=-O2 -fomit-frame-pointer -Wall %CFI% %CFASM% +set LF=%BLIB% -lwinmm -s + +%CC% %CF% -Wno-uninitialized -c src/*.c +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% *.o +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -Wno-uninitialized -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/rsxnt.bat b/thirdparty/lzo/2.03/B/win32/rsxnt.bat new file mode 100644 index 0000000..dfac19f --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/rsxnt.bat @@ -0,0 +1,45 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // rsxnt + gcc +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set BLIB=%BNAME%.a +set CC=gcc -Zwin32 -Zsys -mprobe +set CF=@b/dos32/dj2.opt %CFI% %CFASM% +set LF=%BLIB% -s + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -x assembler-with-cpp -c asm/i386/src_gas/*.S +@if errorlevel 1 goto error +ar rcs %BLIB% @b/win32/cygwin.rsp +@if errorlevel 1 goto error + +%CC% %CF% -o dict.exe examples/dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o lzopack.exe examples/lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp.exe examples/precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o precomp2.exe examples/precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% -o simple.exe examples/simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -o lzotest.exe lzotest/lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude/lzo -o testmini.exe minilzo/testmini.c minilzo/minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/sc.bat b/thirdparty/lzo/2.03/B/win32/sc.bat new file mode 100644 index 0000000..0df7e49 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/sc.bat @@ -0,0 +1,56 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Symantec C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=sc -mn +set CF=-o -w- %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +lib %BLIB% /b /c /n /noi @b\win32\bc.rsp +@if errorlevel 1 goto error + +%CC% %CF% -c examples\dict.c +@if errorlevel 1 goto error +%CC% dict.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\lzopack.c +@if errorlevel 1 goto error +%CC% lzopack.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp.c +@if errorlevel 1 goto error +%CC% precomp.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\precomp2.c +@if errorlevel 1 goto error +%CC% precomp2.obj %LF% +@if errorlevel 1 goto error +%CC% %CF% -c examples\simple.c +@if errorlevel 1 goto error +%CC% simple.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -c lzotest\lzotest.c +@if errorlevel 1 goto error +%CC% lzotest.obj %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo -c minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error +%CC% testmini.obj minilzo.obj +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/vc.bat b/thirdparty/lzo/2.03/B/win32/vc.bat new file mode 100644 index 0000000..7b48969 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/vc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Microsoft Visual C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -MD +set CF=-O2 -GF -W3 %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +link -lib -nologo -out:%BLIB% @b\win32\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/vc.rsp b/thirdparty/lzo/2.03/B/win32/vc.rsp new file mode 100644 index 0000000..c3213a3 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/vc.rsp @@ -0,0 +1,79 @@ +.\lzo1.obj +.\lzo1_99.obj +.\lzo1a.obj +.\lzo1a_99.obj +.\lzo1b_1.obj +.\lzo1b_2.obj +.\lzo1b_3.obj +.\lzo1b_4.obj +.\lzo1b_5.obj +.\lzo1b_6.obj +.\lzo1b_7.obj +.\lzo1b_8.obj +.\lzo1b_9.obj +.\lzo1b_99.obj +.\lzo1b_9x.obj +.\lzo1b_cc.obj +.\lzo1b_d1.obj +.\lzo1b_d2.obj +.\lzo1b_rr.obj +.\lzo1b_xx.obj +.\lzo1c_1.obj +.\lzo1c_2.obj +.\lzo1c_3.obj +.\lzo1c_4.obj +.\lzo1c_5.obj +.\lzo1c_6.obj +.\lzo1c_7.obj +.\lzo1c_8.obj +.\lzo1c_9.obj +.\lzo1c_99.obj +.\lzo1c_9x.obj +.\lzo1c_cc.obj +.\lzo1c_d1.obj +.\lzo1c_d2.obj +.\lzo1c_rr.obj +.\lzo1c_xx.obj +.\lzo1f_1.obj +.\lzo1f_9x.obj +.\lzo1f_d1.obj +.\lzo1f_d2.obj +.\lzo1x_1.obj +.\lzo1x_1k.obj +.\lzo1x_1l.obj +.\lzo1x_1o.obj +.\lzo1x_9x.obj +.\lzo1x_d1.obj +.\lzo1x_d2.obj +.\lzo1x_d3.obj +.\lzo1x_o.obj +.\lzo1y_1.obj +.\lzo1y_9x.obj +.\lzo1y_d1.obj +.\lzo1y_d2.obj +.\lzo1y_d3.obj +.\lzo1y_o.obj +.\lzo1z_9x.obj +.\lzo1z_d1.obj +.\lzo1z_d2.obj +.\lzo1z_d3.obj +.\lzo2a_9x.obj +.\lzo2a_d1.obj +.\lzo2a_d2.obj +.\lzo_crc.obj +.\lzo_init.obj +.\lzo_ptr.obj +.\lzo_str.obj +.\lzo_util.obj +.\asm\i386\obj\win32\lzo1c_s1.obj +.\asm\i386\obj\win32\lzo1c_s2.obj +.\asm\i386\obj\win32\lzo1f_f1.obj +.\asm\i386\obj\win32\lzo1f_f2.obj +.\asm\i386\obj\win32\lzo1x_f1.obj +.\asm\i386\obj\win32\lzo1x_f2.obj +.\asm\i386\obj\win32\lzo1x_s1.obj +.\asm\i386\obj\win32\lzo1x_s2.obj +.\asm\i386\obj\win32\lzo1y_f1.obj +.\asm\i386\obj\win32\lzo1y_f2.obj +.\asm\i386\obj\win32\lzo1y_s1.obj +.\asm\i386\obj\win32\lzo1y_s2.obj diff --git a/thirdparty/lzo/2.03/B/win32/vc_dll.bat b/thirdparty/lzo/2.03/B/win32/vc_dll.bat new file mode 100644 index 0000000..0bb6509 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/vc_dll.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Microsoft Visual C/C++ (DLL) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -MD +set CF=-O2 -GF -W3 %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -LD -Fe%BDLL% @b\win32\vc.rsp /link /map /def:b\win32\vc_dll.def +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/vc_dll.def b/thirdparty/lzo/2.03/B/win32/vc_dll.def new file mode 100644 index 0000000..848cb99 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/vc_dll.def @@ -0,0 +1,13 @@ +EXPORTS + _lzo1c_decompress_asm=lzo1c_decompress_asm + _lzo1c_decompress_asm_safe=lzo1c_decompress_asm_safe + _lzo1f_decompress_asm_fast=lzo1f_decompress_asm_fast + _lzo1f_decompress_asm_fast_safe=lzo1f_decompress_asm_fast_safe + _lzo1x_decompress_asm=lzo1x_decompress_asm + _lzo1x_decompress_asm_fast=lzo1x_decompress_asm_fast + _lzo1x_decompress_asm_fast_safe=lzo1x_decompress_asm_fast_safe + _lzo1x_decompress_asm_safe=lzo1x_decompress_asm_safe + _lzo1y_decompress_asm=lzo1y_decompress_asm + _lzo1y_decompress_asm_fast=lzo1y_decompress_asm_fast + _lzo1y_decompress_asm_fast_safe=lzo1y_decompress_asm_fast_safe + _lzo1y_decompress_asm_safe=lzo1y_decompress_asm_safe diff --git a/thirdparty/lzo/2.03/B/win32/wc.bat b/thirdparty/lzo/2.03/B/win32/wc.bat new file mode 100644 index 0000000..e4b19ca --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/wc.bat @@ -0,0 +1,39 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 32-bit +@echo // Watcom C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=wcl386 -zq -mf -5r -bt#nt -l#nt +set CF=-ox -zc %CFI% %CFASM% +set LF=%BLIB% + +%CC% %CF% -c src\*.c +@if errorlevel 1 goto error +wlib -q -b -n -t %BLIB% @b\win32\wc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win32/wc.rsp b/thirdparty/lzo/2.03/B/win32/wc.rsp new file mode 100644 index 0000000..c1d39d7 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win32/wc.rsp @@ -0,0 +1,79 @@ ++'lzo1.obj' ++'lzo1_99.obj' ++'lzo1a.obj' ++'lzo1a_99.obj' ++'lzo1b_1.obj' ++'lzo1b_2.obj' ++'lzo1b_3.obj' ++'lzo1b_4.obj' ++'lzo1b_5.obj' ++'lzo1b_6.obj' ++'lzo1b_7.obj' ++'lzo1b_8.obj' ++'lzo1b_9.obj' ++'lzo1b_99.obj' ++'lzo1b_9x.obj' ++'lzo1b_cc.obj' ++'lzo1b_d1.obj' ++'lzo1b_d2.obj' ++'lzo1b_rr.obj' ++'lzo1b_xx.obj' ++'lzo1c_1.obj' ++'lzo1c_2.obj' ++'lzo1c_3.obj' ++'lzo1c_4.obj' ++'lzo1c_5.obj' ++'lzo1c_6.obj' ++'lzo1c_7.obj' ++'lzo1c_8.obj' ++'lzo1c_9.obj' ++'lzo1c_99.obj' ++'lzo1c_9x.obj' ++'lzo1c_cc.obj' ++'lzo1c_d1.obj' ++'lzo1c_d2.obj' ++'lzo1c_rr.obj' ++'lzo1c_xx.obj' ++'lzo1f_1.obj' ++'lzo1f_9x.obj' ++'lzo1f_d1.obj' ++'lzo1f_d2.obj' ++'lzo1x_1.obj' ++'lzo1x_1k.obj' ++'lzo1x_1l.obj' ++'lzo1x_1o.obj' ++'lzo1x_9x.obj' ++'lzo1x_d1.obj' ++'lzo1x_d2.obj' ++'lzo1x_d3.obj' ++'lzo1x_o.obj' ++'lzo1y_1.obj' ++'lzo1y_9x.obj' ++'lzo1y_d1.obj' ++'lzo1y_d2.obj' ++'lzo1y_d3.obj' ++'lzo1y_o.obj' ++'lzo1z_9x.obj' ++'lzo1z_d1.obj' ++'lzo1z_d2.obj' ++'lzo1z_d3.obj' ++'lzo2a_9x.obj' ++'lzo2a_d1.obj' ++'lzo2a_d2.obj' ++'lzo_crc.obj' ++'lzo_init.obj' ++'lzo_ptr.obj' ++'lzo_str.obj' ++'lzo_util.obj' ++'asm\i386\obj\omf32\lzo1c_s1.obj' ++'asm\i386\obj\omf32\lzo1c_s2.obj' ++'asm\i386\obj\omf32\lzo1f_f1.obj' ++'asm\i386\obj\omf32\lzo1f_f2.obj' ++'asm\i386\obj\omf32\lzo1x_f1.obj' ++'asm\i386\obj\omf32\lzo1x_f2.obj' ++'asm\i386\obj\omf32\lzo1x_s1.obj' ++'asm\i386\obj\omf32\lzo1x_s2.obj' ++'asm\i386\obj\omf32\lzo1y_f1.obj' ++'asm\i386\obj\omf32\lzo1y_f2.obj' ++'asm\i386\obj\omf32\lzo1y_s1.obj' ++'asm\i386\obj\omf32\lzo1y_s2.obj' diff --git a/thirdparty/lzo/2.03/B/win64/ic.bat b/thirdparty/lzo/2.03/B/win64/ic.bat new file mode 100644 index 0000000..792436a --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/ic.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 64-bit (Itanium) +@echo // Intel C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=icl -nologo -MD +set CF=-O2 -GF -W3 %CFI% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +link -lib -nologo -out:%BLIB% @b\win64\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win64/ic_dll.bat b/thirdparty/lzo/2.03/B/win64/ic_dll.bat new file mode 100644 index 0000000..4ce64bf --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/ic_dll.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 64-bit (Itanium) +@echo // Intel C/C++ (DLL) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=icl -nologo -MD +set CF=-O2 -GF -W3 %CFI% +set LF=%BLIB% + +%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win64/vc.bat b/thirdparty/lzo/2.03/B/win64/vc.bat new file mode 100644 index 0000000..797d411 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/vc.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 64-bit (AMD64 or Itanium) +@echo // Microsoft Visual C/C++ +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -MD +set CF=-O2 -GF -W3 -Wp64 %CFI% +set LF=%BLIB% + +%CC% %CF% -c @b\src.rsp +@if errorlevel 1 goto error +link -lib -nologo -out:%BLIB% @b\win64\vc.rsp +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win64/vc.rsp b/thirdparty/lzo/2.03/B/win64/vc.rsp new file mode 100644 index 0000000..da684c9 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/vc.rsp @@ -0,0 +1,67 @@ +.\lzo1.obj +.\lzo1_99.obj +.\lzo1a.obj +.\lzo1a_99.obj +.\lzo1b_1.obj +.\lzo1b_2.obj +.\lzo1b_3.obj +.\lzo1b_4.obj +.\lzo1b_5.obj +.\lzo1b_6.obj +.\lzo1b_7.obj +.\lzo1b_8.obj +.\lzo1b_9.obj +.\lzo1b_99.obj +.\lzo1b_9x.obj +.\lzo1b_cc.obj +.\lzo1b_d1.obj +.\lzo1b_d2.obj +.\lzo1b_rr.obj +.\lzo1b_xx.obj +.\lzo1c_1.obj +.\lzo1c_2.obj +.\lzo1c_3.obj +.\lzo1c_4.obj +.\lzo1c_5.obj +.\lzo1c_6.obj +.\lzo1c_7.obj +.\lzo1c_8.obj +.\lzo1c_9.obj +.\lzo1c_99.obj +.\lzo1c_9x.obj +.\lzo1c_cc.obj +.\lzo1c_d1.obj +.\lzo1c_d2.obj +.\lzo1c_rr.obj +.\lzo1c_xx.obj +.\lzo1f_1.obj +.\lzo1f_9x.obj +.\lzo1f_d1.obj +.\lzo1f_d2.obj +.\lzo1x_1.obj +.\lzo1x_1k.obj +.\lzo1x_1l.obj +.\lzo1x_1o.obj +.\lzo1x_9x.obj +.\lzo1x_d1.obj +.\lzo1x_d2.obj +.\lzo1x_d3.obj +.\lzo1x_o.obj +.\lzo1y_1.obj +.\lzo1y_9x.obj +.\lzo1y_d1.obj +.\lzo1y_d2.obj +.\lzo1y_d3.obj +.\lzo1y_o.obj +.\lzo1z_9x.obj +.\lzo1z_d1.obj +.\lzo1z_d2.obj +.\lzo1z_d3.obj +.\lzo2a_9x.obj +.\lzo2a_d1.obj +.\lzo2a_d2.obj +.\lzo_crc.obj +.\lzo_init.obj +.\lzo_ptr.obj +.\lzo_str.obj +.\lzo_util.obj diff --git a/thirdparty/lzo/2.03/B/win64/vc_dll.bat b/thirdparty/lzo/2.03/B/win64/vc_dll.bat new file mode 100644 index 0000000..b33f5fa --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/vc_dll.bat @@ -0,0 +1,42 @@ +@echo // Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +@echo // +@echo // Windows 64-bit (AMD64 or Itanium) +@echo // Microsoft Visual C/C++ (DLL) +@echo // +@call b\prepare.bat +@if "%BECHO%"=="n" echo off + + +set CC=cl -nologo -MD +set CF=-O2 -GF -W3 -Wp64 %CFI% +set LF=%BLIB% + +%CC% %CF% -D__LZO_EXPORT1#__declspec(dllexport) -c @b\src.rsp +@if errorlevel 1 goto error +%CC% -LD -Fe%BDLL% @b\win64\vc.rsp /link /map /def:b\win64\vc_dll.def +@if errorlevel 1 goto error + +%CC% %CF% examples\dict.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\lzopack.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\precomp2.c %LF% +@if errorlevel 1 goto error +%CC% %CF% examples\simple.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% lzotest\lzotest.c %LF% +@if errorlevel 1 goto error + +%CC% %CF% -Iinclude\lzo minilzo\testmini.c minilzo\minilzo.c +@if errorlevel 1 goto error + + +@call b\done.bat +@goto end +:error +@echo ERROR during build! +:end +@call b\unset.bat diff --git a/thirdparty/lzo/2.03/B/win64/vc_dll.def b/thirdparty/lzo/2.03/B/win64/vc_dll.def new file mode 100644 index 0000000..a1012e6 --- /dev/null +++ b/thirdparty/lzo/2.03/B/win64/vc_dll.def @@ -0,0 +1 @@ +LIBRARY lzo2 diff --git a/thirdparty/lzo/2.03/BUGS b/thirdparty/lzo/2.03/BUGS new file mode 100644 index 0000000..e1aa2a7 --- /dev/null +++ b/thirdparty/lzo/2.03/BUGS @@ -0,0 +1,21 @@ +============================================================================ +LZO -- a real-time data compression library +============================================================================ + +LZO is free of any known bugs. + +Nevertheless LZO has been reported to break the optimizer of some +compilers including gcc 2.7.2 (AIX, IRIX) and Watcom C 9.5. + +So if `lzotest' reports data decompression errors you should recompile +everything without optimizations and see if that fixes the problem. +I'd like to hear about optimizer problems and possible workarounds. + + +Known compiler problems: +------------------------ + some versions of gcc use `-O2 -fno-strength-reduce' + some versions of gcc use `-O2 -fno-schedule-insns -fno-schedule-insns2' + Watcom C 9.5 compile with `-oneax' instead of `-oneatx' + + diff --git a/thirdparty/lzo/2.03/COPYING b/thirdparty/lzo/2.03/COPYING new file mode 100644 index 0000000..5ee49f4 --- /dev/null +++ b/thirdparty/lzo/2.03/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/thirdparty/lzo/2.03/ChangeLog b/thirdparty/lzo/2.03/ChangeLog new file mode 100644 index 0000000..755db71 --- /dev/null +++ b/thirdparty/lzo/2.03/ChangeLog @@ -0,0 +1,3 @@ +Sorry, no detailed ChangeLog available yet. + +Please see the file NEWS for a list of user visible changes. diff --git a/thirdparty/lzo/2.03/INSTALL b/thirdparty/lzo/2.03/INSTALL new file mode 100644 index 0000000..886ee50 --- /dev/null +++ b/thirdparty/lzo/2.03/INSTALL @@ -0,0 +1,265 @@ +Introduction +============ + + This installation guide is for POSIX (Autoconf) systems. + For Win32, Win64, DOS and OS/2 please read the file B/00README.TXT. + + Quick start + ----------- + ./configure + make + make check + make test (run a full test) + make install (when logged in as root) + + Exotic machines + --------------- + Instead of using Autoconf you may want to adapt the simple build + script in B/generic/build.sh. + + Shared libraries + ---------------- + LZO uses Libtool so that shared libraries are supported on many + systems. If want to build shared libraries type you have to type + `./configure --enable-shared' - building shared libraries is not + enabled by default. + + Assembler versions + ------------------ + On Intel i386 systems, the assembler versions of the decompressors are + built and used by default. You can use `./configure --disable-asm' if + for some reason they cause compilation problems on your system. + + + +[ The standard Autoconf installation instructions follow below. ] + + + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/thirdparty/lzo/2.03/LZO_lib/lzo2.lib b/thirdparty/lzo/2.03/LZO_lib/lzo2.lib new file mode 100644 index 0000000..caf95cc Binary files /dev/null and b/thirdparty/lzo/2.03/LZO_lib/lzo2.lib differ diff --git a/thirdparty/lzo/2.03/LZO_lib/lzo2_64.lib b/thirdparty/lzo/2.03/LZO_lib/lzo2_64.lib new file mode 100644 index 0000000..383ec9c Binary files /dev/null and b/thirdparty/lzo/2.03/LZO_lib/lzo2_64.lib differ diff --git a/thirdparty/lzo/2.03/Makefile.am b/thirdparty/lzo/2.03/Makefile.am new file mode 100644 index 0000000..7799509 --- /dev/null +++ b/thirdparty/lzo/2.03/Makefile.am @@ -0,0 +1,52 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +AUTOMAKE_OPTIONS = 1.9.6 gnu + +SUBDIRS = include src lzotest examples tests minilzo + +EXTRA_DIST = BUGS + + +# /*********************************************************************** +# // automake targets +# ************************************************************************/ + +dist-hook: + -rm -rf "./$(distdir)/autoconf/" + cp -pR $(srcdir)/B/ $(srcdir)/asm/ $(srcdir)/autoconf/ $(srcdir)/doc/ $(srcdir)/util/ "$(distdir)/" + -rm -f `find "./$(distdir)/" -type l -print` + -rm -f ./$(distdir)/util/*.dat + +check-local: all-am + ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING + @echo + @echo "All checks passed." + @echo + + +# /*********************************************************************** +# // special targets +# ************************************************************************/ + +basic-test: all + ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING + ./tests/align + ./tests/chksum + ./examples/simple + ./minilzo/testmini + +test: all + ./lzotest/lzotest -mavail -n10 -q $(top_srcdir)/COPYING + $(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir) + ./tests/align + ./tests/chksum + ./examples/simple + ./minilzo/testmini + @echo + @echo "All tests passed. Now you are ready to install LZO." + @echo + +@MAINT@-include $(top_srcdir)/Makefile.maint diff --git a/thirdparty/lzo/2.03/Makefile.in b/thirdparty/lzo/2.03/Makefile.in new file mode 100644 index 0000000..53e5ac7 --- /dev/null +++ b/thirdparty/lzo/2.03/Makefile.in @@ -0,0 +1,679 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.hin \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + THANKS autoconf/compile autoconf/config.guess \ + autoconf/config.rpath autoconf/config.sub autoconf/depcomp \ + autoconf/install-sh autoconf/ltmain.sh autoconf/mdate-sh \ + autoconf/missing autoconf/mkinstalldirs autoconf/py-compile \ + autoconf/ylwrap +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +AUTOMAKE_OPTIONS = 1.9.6 gnu +SUBDIRS = include src lzotest examples tests minilzo +EXTRA_DIST = BUGS +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.hin: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/autoconf + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am check-local clean clean-generic clean-libtool \ + clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-libtool \ + distclean-recursive distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am + + +# /*********************************************************************** +# // automake targets +# ************************************************************************/ + +dist-hook: + -rm -rf "./$(distdir)/autoconf/" + cp -pR $(srcdir)/B/ $(srcdir)/asm/ $(srcdir)/autoconf/ $(srcdir)/doc/ $(srcdir)/util/ "$(distdir)/" + -rm -f `find "./$(distdir)/" -type l -print` + -rm -f ./$(distdir)/util/*.dat + +check-local: all-am + ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING + @echo + @echo "All checks passed." + @echo + +# /*********************************************************************** +# // special targets +# ************************************************************************/ + +basic-test: all + ./lzotest/lzotest -mlzo -n2 -q $(top_srcdir)/COPYING + ./tests/align + ./tests/chksum + ./examples/simple + ./minilzo/testmini + +test: all + ./lzotest/lzotest -mavail -n10 -q $(top_srcdir)/COPYING + $(SHELL) -e $(top_srcdir)/util/check.sh $(top_srcdir) + ./tests/align + ./tests/chksum + ./examples/simple + ./minilzo/testmini + @echo + @echo "All tests passed. Now you are ready to install LZO." + @echo + +@MAINT@-include $(top_srcdir)/Makefile.maint +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/NEWS b/thirdparty/lzo/2.03/NEWS new file mode 100644 index 0000000..404aa6b --- /dev/null +++ b/thirdparty/lzo/2.03/NEWS @@ -0,0 +1,249 @@ +============================================================================ +User visible changes for LZO -- a real-time data compression library +============================================================================ + +Changes in 2.03 (30 Apr 2008) + * Updated the ELF assembler sources to mark the stack as non-executable. + * Fixed a HP-UX 11 build issue with Itanium in ILP32 mode. + * Updated the configure system. + +Changes in 2.02 (17 Oct 2005) + * Updated the build and Autoconf scripts to fix some reported + compilation problems. + +Changes in 2.01 (27 Jun 2005) + * Changed the configure system to install the LZO library under the + name "liblzo2" so that parallel installation with LZO v1 is possible. + * Improved auto-configuration in miniLZO for some embedded targets like + Blackfin and H8/300 processors. + +Changes in 2.00 (30 May 2005) + + [Library interface changes] + * The 'lzo_uint' typedef has been changed to match 'size_t', which means + it now is 64 bits on most 64-bit architectures. 32-bit machines + are not affected by this change. + * The formula for maximum expansion of incompressible data has changed. + See doc/LZO.FAQ. This is needed for some upcoming speed improvements, + and also for compatibility with our commercial LZO Professional product. + * The progress indicator callback interface has been revamped. + * All public header files now get installed into a "lzo" subdirectory, so + your applications should use #include . + * A number of (internal) macros have been renamed. See LZO_CFG_COMPAT + in if your code depends on these. + + [Speed] + * Small overall speedup by exploiting features like branch prediction + hints and explicit inline control present in modern C/C++ compilers. + * Significant speedup for 64-bit architectures like AMD64. + + [Portability] + * LZO now fully supports the LLP64 programming model. + * LZO now fully supports the ILP64 and SILP64 programming models which + are used on some supercomputing architectures. + * Full Win64 support for AMD64 (aka x64) and IA64 (Itanium). + * Full 16-bit support for ancient DOS 286 protected mode, OS/2 1.x + and Windows 3.x. + * The LZO library now compiles and works on completely freestanding or + embedded systems as long as you have and header + files. See the B/generic/build_freestanding.sh build script. + + [Misc] + * The i386 assembler versions of the decompressors are now automatically + built and installed. See also asm/i386/00README.TXT. + * Added include file that provides prototypes for all + assembler functions. + * Under MacOS X, the configure script now will use the `-no-cpp-precomp' + compiler option in order to work around bugs in some versions of + Apple's native "smart" preprocessor. + * Worked around a preprocessor bug that is present in all compilers which + are based on the lcc compiler kit. + * Added simple B/generic/build.sh build script family. + * Added lots of new build scripts for various DOS/Windows compilers. + + [Upgrade instructions from LZO v1 to LZO v2] + * On 64-bit architectures, revisit all uses of lzo_uint. + * Adapt for the maximum expansion change of incompressible data. + * If you use the progress callback then adapt for the new interface. + * Use #include or adjust your include path. + * Check your code for use of deprecated macros. Add a + #define LZO_CFG_COMPAT if necessary. + * Other than that LZO v2 should be fully source-compatible with LZO v1. + Of course, the compressed data is fully compatible as well. + * Re-compile and re-link your application. + * Enjoy the improvements! + +---------------------------------------------------------------------------- + +Changes in 1.08 (12 Jul 2002) + * Much better support for cross compiling. + * Straighten out ANSI-conforming compiler checks. + * Avoid harmless compiler warnings reported by -Wcast-align. + * Fixed some sign extension problems on rather exotic machines where + sizeof(size_t) < sizeof(ptrdiff_t) and sizeof(lzo_uint) == sizeof(size_t) + * Updated the configure system to use the latest Autoconf, Automake + and Libtool versions. + +Changes in 1.07 (18 Oct 2000) + * Default to `--disable-shared' (I'm getting tired of Libtool's + shared library build problems, this time AIX was the culprit). + * Avoid some harmless compiler warnings. + +Changes in 1.06 (29 Nov 1999) + * Updated the configure system to use Autoconf 2.13, Automake 1.4 and + Libtool 1.3.3. This should hopefully fix the shared-library build + problems that were reported on some machines. + * Enhanced example programs a little bit. + +Changes in 1.05 (14 Apr 1998) + * Just a one-line change in the configure script to workaround + a HPUX and IRIX build problem. + +Changes in 1.04 (15 Mar 1998) + * Worked around a bug in the cpp preprocessor under HPUX 10.20. + * Adapted for Automake 1.2f and Libtool 1.1. + +Changes in 1.03 (18 Jan 1998) + * minor compression ratio improvement + * extended example program to show how to do overlapping compression + * assembler changes, added support for the nasm assembler + * better support for cross compiling + * some cleanups + +Changes in 1.02 (07 Dec 1997) + * improved LZO1X-999 and LZO1Y-999 compression ratio a little bit again + * introduced compression levels for LZO1X-999 and LZO1Y-999 + * added support for preset dictionaries + * implemented LZO1X-1(12): needs 16 kB for compression + * new algorithm LZO1Z: this is another variant of LZO1X + * added example program: how to use preset dictionaries + * added example program: how to do in-place decompression + * added a little file-packer example program + * LZO now works cleanly under checkergcc + * strict 16-bit memory model is working (but not officially supported) + * shared libraries are supported on many platforms + * adapted for Automake 1.2d and Libtool 1.0h + +Changes in 1.01 (10 Aug 1997) + * improved LZO1X-999 and LZO1Y-999 compression ratio a little bit + * i386+gcc: significant speedup of the C version of the LZO1, LZO1A, + LZO1B and LZO1C decompressors + * added example programs that show how to generate pre-compressed data + * added Makefiles for DOS, Windows and OS/2 targets + +Changes in 1.00 (13 Jul 1997) + * added miniLZO - can be easily included in your project + * improved documentation, added LZO.FAQ + * added build scripts for many systems where Autoconf is not available: + Windows 3.1 (LIB+DLL), Windows 95/NT (LIB+DLL), DOS (16+32 bit), OS/2 + * adapted for Automake 1.2 and Libtool 1.0 + +Changes in 0.90 (27 Jun 1997): never released + * LZO now uses GNU Automake 1.0 - lots of configuration changes + * added LZO1X-1(11): this version needs only 8 kB for compression + * implemented LZO1Y-1 + * added i386 assembler decompressors for MASM/TASM/WASM + * the name of some assembler functions changed + * the numeric value of some error codes changed + * portability fixes + +Changes in 0.29 (04 May 1997) + * Linux ELF shared library support + * workaround for gcc 2.7.2 optimizer bug under AIX + * added lzo_crc32() checksum + +Changes in 0.28 (22 Feb 1997) + * new algorithm LZO1Y: LZO1Y-999 and LZO1Y decompressor + * added lzo1x_optimize() and lzo1y_optimize() + * minor speedup in assembler decompressors (i386+gcc) + * ltest.c rewritten + +Changes in 0.27 (19 Jan 1997) + * fixed a bug in LZO1B-999 and LZO1C-999 that could produce + invalid compressed data in very rare cases + +Changes in 0.26 (18 Jan 1997): never released + * implemented LZO1B-999 + * renamed LZO1D to LZO2A (also updated all docs) + * some cleanups + +Changes in 0.25 (28 Dec 1996): never released + * some portability fixes (LZO now works on my old Atari ST :-) + * adapted for Autoconf 2.12 + +Changes in 0.24 (30 Nov 1996): never released + * improved performance of LZO1X assembler decompressor on a Pentium (i386+gcc) + +Changes in 0.23 (23 Nov 1996) + * added LZO1C, LZO1F and LZO1X decompressors in assembler (i386+gcc) + * added corresponding LZO_PUBLIC to all LZO_EXTERN functions + * added support for Microsoft C 7.0 (16-bit DOS) + * introduced lzo_uint32. This could prove useful for a strict 16-bit + version that doesn't use `huge' pointers. + * all algorithms use incremental hashing now + * some cleanups and portability fixes + +Changes in 0.22 (19 Sep 1996) + * LZO1X: minor decompressor speedup, added some checks in safe decompressor + * Autoconf: added detection of gcc strength-reduction bug + * Makefile changes + +Changes in 0.21 (08 Sep 1996) + * LZO now uses GNU Autoconf 2.10 - lots of configuration changes + * a few cosmetical changes + +Changes in 0.20 (11 Aug 1996) + * new algorithm LZO1X: LZO1X-1, LZO1X-999 and LZO1X decompressor + * significantly speeded up LZO1B, LZO1C and LZO1F decompressors + on CPUs which allow unaligned memory access (e.g. Intel i386) + * greatly speeded up LZO2A-999 compressor at the cost of some memory + * some cleanups, portability fixes and minor speedups + +Changes in 0.16 (22 Jul 1996) + * speeded up LZO1F decompressor a little bit + * improved LZO1F-999 compression ratio + +Changes in 0.15 (10 Jul 1996) + * new algorithm LZO1F: LZO1F-1, LZO1F-999 and LZO1F decompressor + * improved LZO2A-999 compression ratio + * removed LZO1E as it is dominated by LZO1F + +Changes in 0.14 (06 Jul 1996): never released + * experimental algorithms: LZO1E and LZO1F + * added LZO_EXTERN to all prototypes. Useful when building a DLL. + * improved LZO1C-999 and LZO2A-999 compression ratio a little bit + * fixed progress indicator callback (it was called only once) + +Changes in 0.13 (20 Jun 1996) + * some speed improvements in LZO1C-999 and LZO2A-999 + +Changes in 0.12 (18 Jun 1996): never released + * added LZO1C-999, a slow but nearly optimal compressor + intended for generating pre-compressed data + * added tests for lookbehind-overrun in all safe decompressors + * source tree completely rearranged, some filenames changed + * extensions changed: a .ch file is a C source code that is included + for reasons of code sharing + * new algorithm LZO2A: LZO2A-999 and LZO2A decompressor. There is + no fast compressor yet. + * some cleanups + +Changes in 0.11 (29 May 1996) + * source tree rearranged + * LZO now compiles fine as a C++ library (interface still has C linkage) + * improved overall compression ratio a little bit + * LZO1B-99/LZO1C-99 now search for longer matches + * incremental hash is working, it's a little bit faster + * Makefile changed + * added lzo_uint and lzo_sizeof in some places + * split LZO1B compressor into even more include-files + +Changes in 0.10 (20 May 1996): first public release of the LZO library + * includes LZO1, LZO1A, LZO1B and LZO1C algorithms + (compression levels 1-9 and 99) + +14 Mar 1996: + * public release of the LZO1A algorithm + +04 Mar 1996: + * public release of the LZO1 algorithm diff --git a/thirdparty/lzo/2.03/README b/thirdparty/lzo/2.03/README new file mode 100644 index 0000000..9d1d331 --- /dev/null +++ b/thirdparty/lzo/2.03/README @@ -0,0 +1,32 @@ +============================================================================ +LZO -- a real-time data compression library +============================================================================ + +Please read the file doc/LZO.TXT for an introduction to LZO. +See the file doc/LZO.FAQ for various tidbits of information. + +See the file NEWS for a list of major changes in the current release. + +See the file INSTALL for compilation and installation instructions. + +For a quick start how to use LZO look at examples/lzopack.c. + + +Directory overview: +------------------- + autoconf Autoconf configuration files (UNIX specific) + B various support files for DOS, Windows, OS/2, ... + doc documentation + examples example programs + include public header files + minilzo a lightweight subset for easy inclusion in your project + src library source + tests more or less exotic test programs + util some utility scripts + + +Have fun, +Markus + +http://www.oberhumer.com/opensource/lzo/ + diff --git a/thirdparty/lzo/2.03/THANKS b/thirdparty/lzo/2.03/THANKS new file mode 100644 index 0000000..cf09bdf --- /dev/null +++ b/thirdparty/lzo/2.03/THANKS @@ -0,0 +1,14 @@ +I want to thank the following people for giving feedback, doing +beta-testing or helping me some other way: + +Charles W. Sandmann +Frank Donahoe +Holger Berger +Jean-loup Gailly +Laszlo Molnar +Mark Adler +Paul D. Eccles +Rodolphe Ortalo +William Magro +Wolfgang Lugmayr +Natascha diff --git a/thirdparty/lzo/2.03/aclocal.m4 b/thirdparty/lzo/2.03/aclocal.m4 new file mode 100644 index 0000000..f44fe26 --- /dev/null +++ b/thirdparty/lzo/2.03/aclocal.m4 @@ -0,0 +1,7637 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# /*********************************************************************** +# // standard ACC macros +# ************************************************************************/ + +AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [ +AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])]) +])# + +AC_DEFUN([mfx_ACC_CHECK_HEADERS], [ +AC_HEADER_TIME +AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h]) +])# + +AC_DEFUN([mfx_ACC_CHECK_FUNCS], [ +AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf) +])# + + +AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [ +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) + +AC_CHECK_SIZEOF(long long) +AC_CHECK_SIZEOF(__int16) +AC_CHECK_SIZEOF(__int32) +AC_CHECK_SIZEOF(__int64) + +AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(size_t) +AC_CHECK_SIZEOF(ptrdiff_t) +])# + + +# /*********************************************************************** +# // Check for ACC_conformance +# ************************************************************************/ + +AC_DEFUN([mfx_ACC_ACCCHK], [ +mfx_tmp=$1 +mfx_save_CPPFLAGS=$CPPFLAGS +dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS" + +AC_MSG_CHECKING([whether your compiler passes the ACC conformance test]) + +AC_LANG_CONFTEST([AC_LANG_PROGRAM( +[[#define ACC_CONFIG_NO_HEADER 1 +#include "acc/acc.h" +#include "acc/acc_incd.h" +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr) +#include "acc/acc_chk.ch" +#undef ACCCHK_ASSERT +static void test_acc_compile_time_assert(void) { +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr) +#include "acc/acc_chk.ch" +#undef ACCCHK_ASSERT +} +#undef NDEBUG +#include +static int test_acc_run_time_assert(int r) { +#define ACCCHK_ASSERT(expr) assert(expr); +#include "acc/acc_chk.ch" +#undef ACCCHK_ASSERT +return r; +} +]], [[ +test_acc_compile_time_assert(); +if (test_acc_run_time_assert(1) != 1) return 1; +]] +)]) + +mfx_tmp=FAILED +_AC_COMPILE_IFELSE([], [mfx_tmp=yes]) +rm -f conftest.$ac_ext conftest.$ac_objext + +CPPFLAGS=$mfx_save_CPPFLAGS + +AC_MSG_RESULT([$mfx_tmp]) +case x$mfx_tmp in + xpassed | xyes) ;; + *) + AC_MSG_NOTICE([]) + AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ]) + AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending]) + AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.]) + AC_MSG_NOTICE([Thanks for your support.]) + AC_MSG_NOTICE([]) + AC_MSG_ERROR([ACC conformance test failed. Stop.]) +dnl AS_EXIT + ;; +esac +])# mfx_ACC_ACCCHK + + +# /*********************************************************************** +# // Check for ACC_conformance +# ************************************************************************/ + +AC_DEFUN([mfx_MINIACC_ACCCHK], [ +mfx_tmp=$1 +mfx_save_CPPFLAGS=$CPPFLAGS +dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS" + +AC_MSG_CHECKING([whether your compiler passes the ACC conformance test]) + +AC_LANG_CONFTEST([AC_LANG_PROGRAM( +[[#define ACC_CONFIG_NO_HEADER 1 +#define ACC_WANT_ACC_INCD_H 1 +#include $2 + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr) +#include $2 + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr) +static void test_acc_compile_time_assert(void) { +#include $2 +} + +#undef NDEBUG +#include +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) assert(expr); +static int test_acc_run_time_assert(int r) { +#include $2 +return r; +} +]], [[ +test_acc_compile_time_assert(); +if (test_acc_run_time_assert(1) != 1) return 1; +]] +)]) + +mfx_tmp=FAILED +_AC_COMPILE_IFELSE([], [mfx_tmp=yes]) +rm -f conftest.$ac_ext conftest.$ac_objext + +CPPFLAGS=$mfx_save_CPPFLAGS + +AC_MSG_RESULT([$mfx_tmp]) +case x$mfx_tmp in + xpassed | xyes) ;; + *) + AC_MSG_NOTICE([]) + AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ]) + AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending]) + AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.]) + AC_MSG_NOTICE([Thanks for your support.]) + AC_MSG_NOTICE([]) + AC_MSG_ERROR([ACC conformance test failed. Stop.]) +dnl AS_EXIT + ;; +esac +])# mfx_MINIACC_ACCCHK + + + +# serial 1 + +AC_DEFUN([mfx_PROG_CPPFLAGS], [ +AC_MSG_CHECKING([whether the C preprocessor needs special flags]) + +AC_LANG_CONFTEST([AC_LANG_PROGRAM( +[[#include +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul) +# include "your C preprocessor is broken 1" +#elif (0xffffu == 0xfffffffful) +# include "your C preprocessor is broken 2" +#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX) +# include "your C preprocessor is broken 3" +#endif +]], [[ ]] +)]) + +mfx_save_CPPFLAGS=$CPPFLAGS +mfx_tmp=ERROR +for mfx_arg in "" -no-cpp-precomp +do + CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS" + _AC_COMPILE_IFELSE([], +[mfx_tmp=$mfx_arg +break]) +done +CPPFLAGS=$mfx_save_CPPFLAGS +rm -f conftest.$ac_ext conftest.$ac_objext +case x$mfx_tmp in + x) + AC_MSG_RESULT([none needed]) ;; + xERROR) + AC_MSG_RESULT([ERROR]) + AC_MSG_ERROR([your C preprocessor is broken - for details see config.log]) + ;; + *) + AC_MSG_RESULT([$mfx_tmp]) + CPPFLAGS="$mfx_tmp $CPPFLAGS" + ;; +esac +])# mfx_PROG_CPPFLAGS + + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [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]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + + +# serial 3 + +AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [ +AC_CACHE_CHECK([whether limits.h is sane], +mfx_cv_header_sane_limits_h, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul) +# if defined(__APPLE__) && defined(__GNUC__) +# error "your preprocessor is broken - use compiler option -no-cpp-precomp" +# else +# include "your preprocessor is broken" +# endif +#endif +#define MFX_0xffff 0xffff +#define MFX_0xffffffffL 4294967295ul +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# include "error CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) +# include "error UCHAR_MAX 1" +#endif +#if !defined(USHRT_MAX) +# include "error USHRT_MAX 1" +#endif +#if !defined(UINT_MAX) +# include "error UINT_MAX 1" +#endif +#if !defined(ULONG_MAX) +# include "error ULONG_MAX 1" +#endif +#if !defined(SHRT_MAX) +# include "error SHRT_MAX 1" +#endif +#if !defined(INT_MAX) +# include "error INT_MAX 1" +#endif +#if !defined(LONG_MAX) +# include "error LONG_MAX 1" +#endif +#if (UCHAR_MAX < 1) +# include "error UCHAR_MAX 2" +#endif +#if (USHRT_MAX < 1) +# include "error USHRT_MAX 2" +#endif +#if (UINT_MAX < 1) +# include "error UINT_MAX 2" +#endif +#if (ULONG_MAX < 1) +# include "error ULONG_MAX 2" +#endif +#if (UCHAR_MAX < 0xff) +# include "error UCHAR_MAX 3" +#endif +#if (USHRT_MAX < MFX_0xffff) +# include "error USHRT_MAX 3" +#endif +#if (UINT_MAX < MFX_0xffff) +# include "error UINT_MAX 3" +#endif +#if (ULONG_MAX < MFX_0xffffffffL) +# include "error ULONG_MAX 3" +#endif +#if (USHRT_MAX > UINT_MAX) +# include "error USHRT_MAX vs UINT_MAX" +#endif +#if (UINT_MAX > ULONG_MAX) +# include "error UINT_MAX vs ULONG_MAX" +#endif +]], [[ +#if (USHRT_MAX == MFX_0xffff) +{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; } +#elif (USHRT_MAX >= MFX_0xffff) +{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; } +#endif +#if (UINT_MAX == MFX_0xffff) +{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; } +#elif (UINT_MAX >= MFX_0xffff) +{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; } +#endif +#if (ULONG_MAX == MFX_0xffff) +{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; } +#elif (ULONG_MAX >= MFX_0xffff) +{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; } +#endif +#if !defined(_CRAY1) /* CRAY PVP systems */ +#if (USHRT_MAX == MFX_0xffffffffL) +{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; } +#elif (USHRT_MAX >= MFX_0xffffffffL) +{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; } +#endif +#endif /* _CRAY1 */ +#if (UINT_MAX == MFX_0xffffffffL) +{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; } +#elif (UINT_MAX >= MFX_0xffffffffL) +{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; } +#endif +#if (ULONG_MAX == MFX_0xffffffffL) +{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; } +#elif (ULONG_MAX >= MFX_0xffffffffL) +{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; } +#endif +]])], +[mfx_cv_header_sane_limits_h=yes], +[mfx_cv_header_sane_limits_h=no])]) +]) + +# /*********************************************************************** +# // standard +# ************************************************************************/ + +AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [ +AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])]) +])# + + +# /*********************************************************************** +# // +# ************************************************************************/ + +dnl more types which are not yet covered by ACC + +AC_DEFUN([mfx_CHECK_SIZEOF], [ +AC_CHECK_SIZEOF(__int32) +AC_CHECK_SIZEOF(intmax_t) +AC_CHECK_SIZEOF(uintmax_t) +AC_CHECK_SIZEOF(intptr_t) +AC_CHECK_SIZEOF(uintptr_t) + +AC_CHECK_SIZEOF(float) +AC_CHECK_SIZEOF(double) +AC_CHECK_SIZEOF(long double) + +AC_CHECK_SIZEOF(dev_t) +AC_CHECK_SIZEOF(fpos_t) +AC_CHECK_SIZEOF(mode_t) +AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(ssize_t) +AC_CHECK_SIZEOF(time_t) +])# + + + +AC_DEFUN([mfx_CHECK_LIB_WINMM], [ +if test "X$GCC" = Xyes; then +case $host_os in +cygwin* | mingw* | pw32*) + test "X$LIBS" != "X" && LIBS="$LIBS " + LIBS="${LIBS}-lwinmm" ;; +*) + ;; +esac +fi +])# + + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/thirdparty/lzo/2.03/asm/i386/00README.TXT b/thirdparty/lzo/2.03/asm/i386/00README.TXT new file mode 100644 index 0000000..0d3dcf9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/00README.TXT @@ -0,0 +1,45 @@ + +Directory overview: +=================== + +As writing portable assembler sources supporting different operating +systems, compilers and assemblers has proven to be extremely painful, +the assembler sources have been converted into a more portable `db' +format. Use these whenever possible. + + src_gas sources converted for portable gcc/gas syntax + src_masm sources converted for portable masm/tasm/wasm syntax + src_nasm sources converted for portable nasm syntax + + src assembler sources (you need the OpenSource nasm assembler) + + obj pre-assembled object files + +Also look `src_XXX/all/asm_all.asm' which contains all assembler +functions conveniently arranged into a single file. + + +Notes: +====== + +- The assembler sources are designed for a flat 32-bit memory model + running in protected mode - they should work with all i386 + 32-bit compilers around. + +- All functions expect a `cdecl' (C stack based) calling convention. + The function return value will be placed into `eax'. + All other registers are preserved. + +- Prototypes for the assembler functions can be found in . + +- For reasons of speed all fast assembler decompressors (having `_fast' + in their name) can access (write to) up to 3 bytes past the end of + the decompressed (output) block. Data past the end of the compressed + (input) block is never accessed (read from). + [ technical note: because data is transferred in 32-bit units ] + +- Finally you should test if the assembler versions are actually faster + than the C version on your machine - some compilers can do a very good + optimization job, and they also can optimize the code for a specific + processor type. + diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s1.o new file mode 100644 index 0000000..51b4bdf Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s2.o new file mode 100644 index 0000000..cdf1038 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1c_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f1.o new file mode 100644 index 0000000..6473b9f Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f2.o new file mode 100644 index 0000000..ac5b963 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1f_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f1.o new file mode 100644 index 0000000..f87ef01 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f2.o new file mode 100644 index 0000000..df39b94 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s1.o new file mode 100644 index 0000000..91072f6 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s2.o new file mode 100644 index 0000000..db3f1be Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1x_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f1.o new file mode 100644 index 0000000..c9560d0 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f2.o new file mode 100644 index 0000000..015e70c Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s1.o new file mode 100644 index 0000000..9cb06d2 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s2.o new file mode 100644 index 0000000..4aa10ff Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/coff32/lzo1y_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s1.o new file mode 100644 index 0000000..e13ce33 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s2.o new file mode 100644 index 0000000..e435745 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1c_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f1.o new file mode 100644 index 0000000..d63bd62 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f2.o new file mode 100644 index 0000000..3a70b2b Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1f_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f1.o new file mode 100644 index 0000000..a3c8de0 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f2.o new file mode 100644 index 0000000..29ce79a Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s1.o new file mode 100644 index 0000000..d10769a Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s2.o new file mode 100644 index 0000000..f9ef19f Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1x_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f1.o new file mode 100644 index 0000000..7b8e00a Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f2.o new file mode 100644 index 0000000..6cb60ee Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_f2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s1.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s1.o new file mode 100644 index 0000000..bed5c56 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s1.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s2.o b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s2.o new file mode 100644 index 0000000..09c0dbf Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/elf32/lzo1y_s2.o differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s1.obj new file mode 100644 index 0000000..57bc1d7 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s2.obj new file mode 100644 index 0000000..7711898 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1c_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f1.obj new file mode 100644 index 0000000..2b08c97 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f2.obj new file mode 100644 index 0000000..7d11798 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1f_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f1.obj new file mode 100644 index 0000000..5720ecb Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f2.obj new file mode 100644 index 0000000..b3f6364 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s1.obj new file mode 100644 index 0000000..68d6c15 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s2.obj new file mode 100644 index 0000000..8af7727 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1x_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f1.obj new file mode 100644 index 0000000..d5102cd Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f2.obj new file mode 100644 index 0000000..0dde89a Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s1.obj new file mode 100644 index 0000000..29859c2 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s2.obj new file mode 100644 index 0000000..85f6b81 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/omf32/lzo1y_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s1.obj new file mode 100644 index 0000000..e075b53 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s2.obj new file mode 100644 index 0000000..2545798 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1c_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f1.obj new file mode 100644 index 0000000..41b0cf9 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f2.obj new file mode 100644 index 0000000..3ea9d36 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1f_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f1.obj new file mode 100644 index 0000000..8760ca7 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f2.obj new file mode 100644 index 0000000..ecd4b5f Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s1.obj new file mode 100644 index 0000000..9939d44 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s2.obj new file mode 100644 index 0000000..6cde95e Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1x_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f1.obj new file mode 100644 index 0000000..343f6cf Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f2.obj new file mode 100644 index 0000000..fb71bb0 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_f2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s1.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s1.obj new file mode 100644 index 0000000..a7639f7 Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s1.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s2.obj b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s2.obj new file mode 100644 index 0000000..2b444fd Binary files /dev/null and b/thirdparty/lzo/2.03/asm/i386/obj/win32/lzo1y_s2.obj differ diff --git a/thirdparty/lzo/2.03/asm/i386/src/enter.ash b/thirdparty/lzo/2.03/asm/i386/src/enter.ash new file mode 100644 index 0000000..49c455d --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/enter.ash @@ -0,0 +1,89 @@ +/* enter.ash -- LZO assembler stuff + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + + pushl %ebp + pushl %edi + pushl %esi + pushl %ebx + pushl %ecx + pushl %edx + subl $12,%esp + + cld + + movl INP,%esi + movl OUTP,%edi +#if defined(N_3_EBP) + movl $3,%ebp +#endif +#if defined(N_255_EBP) + movl $255,%ebp +#endif + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT) +#if defined(INIT_OVERRUN) + INIT_OVERRUN +# undef INIT_OVERRUN +#endif + leal -3(%esi),%eax /* 3 == length of EOF code */ + addl INS,%eax + movl %eax,INEND +#endif + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT) +#if defined(INIT_OVERRUN) + INIT_OVERRUN +# undef INIT_OVERRUN +#endif + movl %edi,%eax + movl OUTS,%edx + addl (%edx),%eax + movl %eax,OUTEND +#endif + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/leave.ash b/thirdparty/lzo/2.03/asm/i386/src/leave.ash new file mode 100644 index 0000000..9550b46 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/leave.ash @@ -0,0 +1,114 @@ +/* leave.ash -- LZO assembler stuff + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +/* check uncompressed size */ +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT) + cmpl OUTEND,%edi + ja .L_output_overrun +#endif + +/* check compressed size */ + movl INP,%edx + addl INS,%edx + cmpl %edx,%esi /* check compressed size */ + ja .L_input_overrun + jb .L_input_not_consumed + +.L_leave: + subl OUTP,%edi /* write back the uncompressed size */ + movl OUTS,%edx + movl %edi,(%edx) + + negl %eax + addl $12,%esp + popl %edx + popl %ecx + popl %ebx + popl %esi + popl %edi + popl %ebp +#if 1 + ret +#else + jmp .L_end +#endif + + +.L_error: + movl $1,%eax /* LZO_E_ERROR */ + jmp .L_leave + +.L_input_not_consumed: + movl $8,%eax /* LZO_E_INPUT_NOT_CONSUMED */ + jmp .L_leave + +.L_input_overrun: + movl $4,%eax /* LZO_E_INPUT_OVERRUN */ + jmp .L_leave + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT) +.L_output_overrun: + movl $5,%eax /* LZO_E_OUTPUT_OVERRUN */ + jmp .L_leave +#endif + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND) +.L_lookbehind_overrun: + movl $6,%eax /* LZO_E_LOOKBEHIND_OVERRUN */ + jmp .L_leave +#endif + +#if defined(LZO_DEBUG) +.L_assert_fail: + movl $99,%eax + jmp .L_leave +#endif + +.L_end: + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1c_d.ash b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_d.ash new file mode 100644 index 0000000..9969c86 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_d.ash @@ -0,0 +1,184 @@ +/* lzo1c_d.ash -- assembler implementation of the LZO1C decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + + ALIGN3 +.L1: + xorl %eax,%eax + movb (%esi),%al + incl %esi + cmpb $32,%al + jnb .LMATCH + + orb %al,%al + jz .L12 + movl %eax,%ecx +.LIT: + TEST_OP((%edi,%ecx),%ebx) + TEST_IP((%esi,%ecx),%ebx) + rep + movsb +.LM1: + movb (%esi),%al + incl %esi + + cmpb $32,%al + jb .LM2 +.LMATCH: + cmpb $64,%al + jb .LN3 + + movl %eax,%ecx + andb $31,%al + leal -1(%edi),%edx + shrl $5,%ecx + subl %eax,%edx + movb (%esi),%al + incl %esi + + shll $5,%eax + subl %eax,%edx + incl %ecx + xchgl %esi,%edx + TEST_LOOKBEHIND(%esi) + TEST_OP((%edi,%ecx),%ebx) + rep + movsb + movl %edx,%esi + jmp .L1 + + ALIGN3 +.L12: + LODSB + leal 32(%eax),%ecx + cmpb $248,%al + jb .LIT + + movl $280,%ecx + subb $248,%al + jz .L11 + xchgl %eax,%ecx + xorb %al,%al + shll %cl,%eax + xchgl %eax,%ecx +.L11: + TEST_OP((%edi,%ecx),%ebx) + TEST_IP((%esi,%ecx),%ebx) + rep + movsb + jmp .L1 + + ALIGN3 +.LM2: + leal -1(%edi),%edx + subl %eax,%edx + LODSB + shll $5,%eax + subl %eax,%edx + xchgl %esi,%edx + TEST_LOOKBEHIND(%esi) + TEST_OP(4(%edi),%ebx) + movsb + movsb + movsb + movl %edx,%esi + movsb + xorl %eax,%eax + jmp .LM1 +.LN3: + andb $31,%al + movl %eax,%ecx + jnz .LN6 + movb $31,%cl +.LN4: + LODSB + orb %al,%al + jnz .LN5 + addl N_255,%ecx + jmp .LN4 + + ALIGN3 +.LN5: + addl %eax,%ecx +.LN6: + movb (%esi),%al + incl %esi + + movl %eax,%ebx + andb $63,%al + movl %edi,%edx + subl %eax,%edx + + movb (%esi),%al + incl %esi + + shll $6,%eax + subl %eax,%edx + cmpl %edi,%edx + jz .LEOF + + xchgl %edx,%esi + leal 3(%ecx),%ecx + TEST_LOOKBEHIND(%esi) + TEST_OP((%edi,%ecx),%eax) + rep + movsb + + movl %edx,%esi + xorl %eax,%eax + shrl $6,%ebx + movl %ebx,%ecx + jnz .LIT + jmp .L1 + +.LEOF: +/**** xorl %eax,%eax eax=0 from above */ + + cmpl $1,%ecx /* ecx must be 1 */ + setnz %al + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s1.S new file mode 100644 index 0000000..59a7441 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s1.S @@ -0,0 +1,61 @@ +/* lzo1c_s1.S -- LZO1C decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1c_decompress_asm) + +#include "enter.ash" +#include "lzo1c_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1c_decompress_asm) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s2.S new file mode 100644 index 0000000..e74d3f9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1c_s2.S @@ -0,0 +1,65 @@ +/* lzo1c_s2.S -- LZO1C decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1c_decompress_asm_safe) + +#include "enter.ash" +#include "lzo1c_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1c_decompress_asm_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1f_d.ash b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_d.ash new file mode 100644 index 0000000..aa9279e --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_d.ash @@ -0,0 +1,176 @@ +/* lzo1f_d.ash -- assembler implementation of the LZO1F decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + + ALIGN3 +.L0: + xorl %eax,%eax + movb (%esi),%al + incl %esi + cmpb $31,%al + ja .LM2 + + orb %al,%al + movl %eax,%ecx + jnz .L2 +1: + LODSB + orb %al,%al + jnz 2f + addl N_255,%ecx + jmp 1b +2: + lea 31(%eax,%ecx),%ecx +.L2: + TEST_OP((%edi,%ecx),%ebx) + TEST_IP((%esi,%ecx),%ebx) + movb %cl,%al + shrl $2,%ecx + rep + movsl + andb $3,%al + jz 1f + movl (%esi),%ebx + addl %eax,%esi + movl %ebx,(%edi) + addl %eax,%edi +1: + movb (%esi),%al + incl %esi +.LM1: + cmpb $31,%al + jbe .LM21 + +.LM2: + cmpb $223,%al + ja .LM3 + + movl %eax,%ecx + shrl $2,%eax + lea -1(%edi),%edx + andb $7,%al + shrl $5,%ecx + movl %eax,%ebx + + movb (%esi),%al + leal (%ebx,%eax,8),%eax + incl %esi +.LM5: + subl %eax,%edx + addl $2,%ecx + xchgl %edx,%esi + TEST_LOOKBEHIND(%esi) + TEST_OP((%edi,%ecx),%ebx) + cmpl $6,%ecx + jb 1f + cmpl $4,%eax + jb 1f + movb %cl,%al + shrl $2,%ecx + rep + movsl + andb $3,%al + movb %al,%cl +1: + rep + movsb + movl %edx,%esi +.LN1: + movb -2(%esi),%cl + andl $3,%ecx + jz .L0 + movl (%esi),%eax + addl %ecx,%esi + movl %eax,(%edi) + addl %ecx,%edi + xorl %eax,%eax + movb (%esi),%al + incl %esi + jmp .LM1 +.LM21: + TEST_OP(3(%edi),%edx) + shrl $2,%eax + leal -0x801(%edi),%edx + movl %eax,%ecx + movb (%esi),%al + incl %esi + leal (%ecx,%eax,8),%eax + subl %eax,%edx + TEST_LOOKBEHIND(%edx) + movl (%edx),%eax + movl %eax,(%edi) + addl $3,%edi + jmp .LN1 +1: + LODSB + orb %al,%al + jnz 2f + addl N_255,%ecx + jmp 1b +2: + lea 31(%eax,%ecx),%ecx + jmp .LM4 + + ALIGN3 +.LM3: + andb $31,%al + movl %eax,%ecx + jz 1b +.LM4: + movl %edi,%edx + movw (%esi),%ax + addl $2,%esi + shrl $2,%eax + jnz .LM5 + +.LEOF: +/**** xorl %eax,%eax eax=0 from above */ + + cmpl $1,%ecx /* ecx must be 1 */ + setnz %al + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f1.S new file mode 100644 index 0000000..7a4c2f9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f1.S @@ -0,0 +1,61 @@ +/* lzo1f_f1.S -- fast LZO1F decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1f_decompress_asm_fast) + +#include "enter.ash" +#include "lzo1f_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1f_decompress_asm_fast) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f2.S new file mode 100644 index 0000000..876769e --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1f_f2.S @@ -0,0 +1,65 @@ +/* lzo1f_f2.S -- fast LZO1F decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1f_decompress_asm_fast_safe) + +#include "enter.ash" +#include "lzo1f_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1f_decompress_asm_fast_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1x_d.ash b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_d.ash new file mode 100644 index 0000000..aa13835 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_d.ash @@ -0,0 +1,401 @@ +/* lzo1x_d.ash -- assembler implementation of the LZO1X decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#if !defined(LZO1X) && !defined(LZO1Y) +# define LZO1X +#endif + +#if defined(LZO_FAST) +# define NN 3 +#else +# define NN 0 +#endif + + +/*********************************************************************** +// init +************************************************************************/ + + xorl %eax,%eax + xorl %ebx,%ebx /* high bits 9-32 stay 0 */ + lodsb + cmpb $17,%al + jbe .L01 + subb $17-NN,%al +#if defined(LZO_FAST) + jmp .LFLR +#else + cmpb $4,%al + jae .LFLR +#if 1 + TEST_OP((%edi,%eax),%edx) + TEST_IP((%esi,%eax),%edx) + movl %eax,%ecx + jmp .LFLR2 +#else + jmp .LFLR3 +#endif +#endif + + +/*********************************************************************** +// literal run +************************************************************************/ + +0: addl N_255,%eax + TEST_IP(18(%esi,%eax),%edx) /* minimum */ +1: movb (%esi),%bl + incl %esi + orb %bl,%bl + jz 0b + leal 18+NN(%eax,%ebx),%eax + jmp 3f + + + ALIGN3 +.L00: +#ifdef LZO_DEBUG + andl $0xffffff00,%eax ; jnz .L_assert_fail + andl $0xffffff00,%ebx ; jnz .L_assert_fail + xorl %eax,%eax ; xorl %ebx,%ebx + xorl %ecx,%ecx ; xorl %edx,%edx +#endif + TEST_IP_R(%esi) + LODSB +.L01: + cmpb $16,%al + jae .LMATCH + +/* a literal run */ + orb %al,%al + jz 1b + addl $3+NN,%eax +3: +.LFLR: + TEST_OP(-NN(%edi,%eax),%edx) + TEST_IP(-NN(%esi,%eax),%edx) +#if defined(LZO_FAST) + movl %eax,%ecx + NOTL_3(%eax) + shrl $2,%ecx + andl N_3,%eax + COPYL(%esi,%edi,%edx) + subl %eax,%esi + subl %eax,%edi +#else + movl %eax,%ecx + shrl $2,%eax + andl N_3,%ecx + COPYL_C(%esi,%edi,%edx,%eax) +.LFLR2: + rep + movsb +#endif + +#ifdef LZO_DEBUG + andl $0xffffff00,%eax ; jnz .L_assert_fail + andl $0xffffff00,%ebx ; jnz .L_assert_fail + xorl %eax,%eax ; xorl %ebx,%ebx + xorl %ecx,%ecx ; xorl %edx,%edx +#endif + LODSB + cmpb $16,%al + jae .LMATCH + + +/*********************************************************************** +// R1 +************************************************************************/ + + TEST_OP(3(%edi),%edx) + shrl $2,%eax + movb (%esi),%bl +#if defined(LZO1X) + leal -0x801(%edi),%edx +#elif defined(LZO1Y) + leal -0x401(%edi),%edx +#endif + leal (%eax,%ebx,4),%eax + incl %esi + subl %eax,%edx + TEST_LOOKBEHIND(%edx) +#if defined(LZO_FAST) + movl (%edx),%ecx + movl %ecx,(%edi) +#else + movb (%edx),%al + movb %al,(%edi) + movb 1(%edx),%al + movb %al,1(%edi) + movb 2(%edx),%al + movb %al,2(%edi) +#endif + addl N_3,%edi + jmp .LMDONE + + +/*********************************************************************** +// M2 +************************************************************************/ + + ALIGN3 +.LMATCH: + cmpb $64,%al + jb .LM3MATCH + +/* a M2 match */ + movl %eax,%ecx + shrl $2,%eax + leal -1(%edi),%edx +#if defined(LZO1X) + andl $7,%eax + movb (%esi),%bl + shrl $5,%ecx + leal (%eax,%ebx,8),%eax +#elif defined(LZO1Y) + andl N_3,%eax + movb (%esi),%bl + shrl $4,%ecx + leal (%eax,%ebx,4),%eax +#endif + incl %esi + subl %eax,%edx + +#if defined(LZO_FAST) +#if defined(LZO1X) + addl $1+3,%ecx +#elif defined(LZO1Y) + addl $2,%ecx +#endif +#else +#if defined(LZO1X) + incl %ecx +#elif defined(LZO1Y) + decl %ecx +#endif +#endif + + cmpl N_3,%eax + jae .LCOPYLONG + jmp .LCOPYBYTE + + +/*********************************************************************** +// M3 +************************************************************************/ + +0: addl N_255,%eax + TEST_IP(3(%esi),%edx) /* minimum */ +1: movb (%esi),%bl + incl %esi + orb %bl,%bl + jz 0b + leal 33+NN(%eax,%ebx),%ecx + xorl %eax,%eax + jmp 3f + + + ALIGN3 +.LM3MATCH: + cmpb $32,%al + jb .LM4MATCH + +/* a M3 match */ + andl $31,%eax + jz 1b + lea 2+NN(%eax),%ecx +3: +#ifdef LZO_DEBUG + andl $0xffff0000,%eax ; jnz .L_assert_fail +#endif + movw (%esi),%ax + leal -1(%edi),%edx + shrl $2,%eax + addl $2,%esi + subl %eax,%edx + + cmpl N_3,%eax + jb .LCOPYBYTE + + +/*********************************************************************** +// copy match +************************************************************************/ + + ALIGN1 +.LCOPYLONG: /* copy match using longwords */ + TEST_LOOKBEHIND(%edx) +#if defined(LZO_FAST) + leal -3(%edi,%ecx),%eax + shrl $2,%ecx + TEST_OP_R(%eax) + COPYL(%edx,%edi,%ebx) + movl %eax,%edi + xorl %ebx,%ebx +#else + TEST_OP((%edi,%ecx),%eax) + movl %ecx,%ebx + shrl $2,%ebx + jz 2f + COPYL_C(%edx,%edi,%eax,%ebx) + andl N_3,%ecx + jz 1f +2: COPYB_C(%edx,%edi,%al,%ecx) +1: +#endif + +.LMDONE: + movb -2(%esi),%al + andl N_3,%eax + jz .L00 +.LFLR3: + TEST_OP((%edi,%eax),%edx) + TEST_IP((%esi,%eax),%edx) +#if defined(LZO_FAST) + movl (%esi),%edx + addl %eax,%esi + movl %edx,(%edi) + addl %eax,%edi +#else + COPYB_C(%esi,%edi,%cl,%eax) +#endif + +#ifdef LZO_DEBUG + andl $0xffffff00,%eax ; jnz .L_assert_fail + andl $0xffffff00,%ebx ; jnz .L_assert_fail + xorl %eax,%eax ; xorl %ebx,%ebx + xorl %ecx,%ecx ; xorl %edx,%edx +#endif + LODSB + jmp .LMATCH + + + ALIGN3 +.LCOPYBYTE: /* copy match using bytes */ + TEST_LOOKBEHIND(%edx) + TEST_OP(-NN(%edi,%ecx),%eax) + xchgl %edx,%esi +#if defined(LZO_FAST) + subl N_3,%ecx +#endif + rep + movsb + movl %edx,%esi + jmp .LMDONE + + +/*********************************************************************** +// M4 +************************************************************************/ + +0: addl N_255,%ecx + TEST_IP(3(%esi),%edx) /* minimum */ +1: movb (%esi),%bl + incl %esi + orb %bl,%bl + jz 0b + leal 9+NN(%ebx,%ecx),%ecx + jmp 3f + + + ALIGN3 +.LM4MATCH: + cmpb $16,%al + jb .LM1MATCH + +/* a M4 match */ + movl %eax,%ecx + andl $8,%eax + shll $13,%eax /* save in bit 16 */ + andl $7,%ecx + jz 1b + addl $2+NN,%ecx +3: +#ifdef LZO_DEBUG + movl %eax,%edx ; andl $0xfffe0000,%edx ; jnz .L_assert_fail +#endif + movw (%esi),%ax + addl $2,%esi + leal -0x4000(%edi),%edx + shrl $2,%eax + jz .LEOF + subl %eax,%edx + jmp .LCOPYLONG + + +/*********************************************************************** +// M1 +************************************************************************/ + + ALIGN3 +.LM1MATCH: +/* a M1 match */ + TEST_OP(2(%edi),%edx) + shrl $2,%eax + movb (%esi),%bl + leal -1(%edi),%edx + leal (%eax,%ebx,4),%eax + incl %esi + subl %eax,%edx + TEST_LOOKBEHIND(%edx) + + movb (%edx),%al /* we must use this because edx can be edi-1 */ + movb %al,(%edi) + movb 1(%edx),%bl + movb %bl,1(%edi) + addl $2,%edi + jmp .LMDONE + + +/*********************************************************************** +// +************************************************************************/ + +.LEOF: +/**** xorl %eax,%eax eax=0 from above */ + + cmpl $3+NN,%ecx /* ecx must be 3/6 */ + setnz %al + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f1.S new file mode 100644 index 0000000..8cb07f2 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f1.S @@ -0,0 +1,63 @@ +/* lzo1x_f1.S -- fast LZO1X decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_FAST + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1x_decompress_asm_fast) + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1x_decompress_asm_fast) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f2.S new file mode 100644 index 0000000..e8b2b59 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_f2.S @@ -0,0 +1,67 @@ +/* lzo1x_f2.S -- fast LZO1X decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_FAST + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1x_decompress_asm_fast_safe) + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1x_decompress_asm_fast_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s1.S new file mode 100644 index 0000000..6cb90ec --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s1.S @@ -0,0 +1,61 @@ +/* lzo1x_s1.S -- LZO1X decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1x_decompress_asm) + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1x_decompress_asm) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s2.S new file mode 100644 index 0000000..e4e98ea --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1x_s2.S @@ -0,0 +1,65 @@ +/* lzo1x_s2.S -- LZO1X decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1x_decompress_asm_safe) + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1x_decompress_asm_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f1.S new file mode 100644 index 0000000..7d9db26 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f1.S @@ -0,0 +1,65 @@ +/* lzo1y_f1.S -- fast LZO1Y decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_FAST + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1y_decompress_asm_fast) + +#define LZO1Y + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1y_decompress_asm_fast) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f2.S new file mode 100644 index 0000000..09aa3af --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_f2.S @@ -0,0 +1,69 @@ +/* lzo1y_f2.S -- fast LZO1Y decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_FAST + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1y_decompress_asm_fast_safe) + +#define LZO1Y + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1y_decompress_asm_fast_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s1.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s1.S new file mode 100644 index 0000000..97b568e --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s1.S @@ -0,0 +1,63 @@ +/* lzo1y_s1.S -- LZO1Y decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1y_decompress_asm) + +#define LZO1Y + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1y_decompress_asm) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s2.S b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s2.S new file mode 100644 index 0000000..808107f --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo1y_s2.S @@ -0,0 +1,67 @@ +/* lzo1y_s2.S -- LZO1Y decompression in assembler (i386 + gcc) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_TEST_DECOMPRESS_OVERRUN_INPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT +#define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND + +#include "lzo_asm.h" + + .text + + LZO_PUBLIC(lzo1y_decompress_asm_safe) + +#define LZO1Y + +#include "enter.ash" +#include "lzo1x_d.ash" +#include "leave.ash" + + LZO_PUBLIC_END(lzo1y_decompress_asm_safe) + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src/lzo_asm.h b/thirdparty/lzo/2.03/asm/i386/src/lzo_asm.h new file mode 100644 index 0000000..55fdf6d --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src/lzo_asm.h @@ -0,0 +1,287 @@ +/* lzo_asm.h -- LZO assembler stuff + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +#if !defined(__i386__) +# error +#endif + +#if !defined(IN_CONFIGURE) +#if defined(LZO_HAVE_CONFIG_H) +# include +#else + /* manual configuration - see defaults below */ +# if defined(__ELF__) +# define MFX_ASM_HAVE_TYPE +# define MFX_ASM_NAME_NO_UNDERSCORES +# elif defined(__linux__) /* Linux a.out */ +# define MFX_ASM_ALIGN_PTWO +# elif defined(__DJGPP__) +# define MFX_ASM_ALIGN_PTWO +# elif defined(__GO32__) /* djgpp v1 */ +# define MFX_ASM_CANNOT_USE_EBP +# elif defined(__EMX__) +# define MFX_ASM_ALIGN_PTWO +# define MFX_ASM_CANNOT_USE_EBP +# endif +#endif +#endif + +#if 1 && defined(__ELF__) +.section .note.GNU-stack,"",@progbits +#endif +#if 0 && defined(__ELF__) +#undef i386 +.arch i386 +.code32 +#endif + + +/*********************************************************************** +// name always uses underscores +// [ OLD: name (default: with underscores) ] +************************************************************************/ + +#if !defined(LZO_ASM_NAME) +# define LZO_ASM_NAME(n) _ ## n +#if 0 +# if defined(MFX_ASM_NAME_NO_UNDERSCORES) +# define LZO_ASM_NAME(n) n +# else +# define LZO_ASM_NAME(n) _ ## n +# endif +#endif +#endif + + +/*********************************************************************** +// .type (default: do not use) +************************************************************************/ + +#if !defined(LZO_PUBLIC) +#if defined(__LZO_DB__) +# define LZO_PUBLIC(func) \ + .p2align 4 ; .byte 0,0,0,0,0,0,0 ; .ascii "LZO_START" +# define LZO_PUBLIC_END(func) \ + .p2align 4,0x90 ; .ascii "LZO_END" +#elif defined(MFX_ASM_HAVE_TYPE) +# define LZO_PUBLIC(func) \ + ALIGN3 ; .type LZO_ASM_NAME(func),@function ; \ + .globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func): +# define LZO_PUBLIC_END(func) \ + .size LZO_ASM_NAME(func),.-LZO_ASM_NAME(func) +#else +# define LZO_PUBLIC(func) \ + ALIGN3 ; .globl LZO_ASM_NAME(func) ; LZO_ASM_NAME(func): +# define LZO_PUBLIC_END(func) +#endif +#endif + + +/*********************************************************************** +// .align (default: bytes) +************************************************************************/ + +#if !defined(MFX_ASM_ALIGN_BYTES) && !defined(MFX_ASM_ALIGN_PTWO) +# define MFX_ASM_ALIGN_BYTES +#endif + +#if !defined(LZO_ASM_ALIGN) +# if defined(MFX_ASM_ALIGN_PTWO) +# define LZO_ASM_ALIGN(x) .align x +# else +# define LZO_ASM_ALIGN(x) .align (1 << (x)) +# endif +#endif + +#define ALIGN1 LZO_ASM_ALIGN(1) +#define ALIGN2 LZO_ASM_ALIGN(2) +#define ALIGN3 LZO_ASM_ALIGN(3) + + +/*********************************************************************** +// ebp usage (default: can use) +************************************************************************/ + +#if !defined(MFX_ASM_CANNOT_USE_EBP) +# if 1 && !defined(N_3_EBP) && !defined(N_255_EBP) +# define N_3_EBP +# endif +# if 0 && !defined(N_3_EBP) && !defined(N_255_EBP) +# define N_255_EBP +# endif +#endif + +#if defined(N_3_EBP) && defined(N_255_EBP) +# error +#endif +#if defined(MFX_ASM_CANNOT_USE_EBP) +# if defined(N_3_EBP) || defined(N_255_EBP) +# error +# endif +#endif + +#if !defined(N_3) +# if defined(N_3_EBP) +# define N_3 %ebp +# else +# define N_3 $3 +# endif +#endif + +#if !defined(N_255) +# if defined(N_255_EBP) +# define N_255 %ebp +# define NOTL_3(r) xorl %ebp,r +# else +# define N_255 $255 +# endif +#endif + +#if !defined(NOTL_3) +# define NOTL_3(r) xorl N_3,r +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#ifndef INP +#define INP 4+36(%esp) +#define INS 8+36(%esp) +#define OUTP 12+36(%esp) +#define OUTS 16+36(%esp) +#endif + +#define INEND 4(%esp) +#define OUTEND (%esp) + + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT) +# define TEST_IP_R(r) cmpl r,INEND ; jb .L_input_overrun +# define TEST_IP(addr,r) leal addr,r ; TEST_IP_R(r) +#else +# define TEST_IP_R(r) +# define TEST_IP(addr,r) +#endif + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT) +# define TEST_OP_R(r) cmpl r,OUTEND ; jb .L_output_overrun +# define TEST_OP(addr,r) leal addr,r ; TEST_OP_R(r) +#else +# define TEST_OP_R(r) +# define TEST_OP(addr,r) +#endif + +#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND) +# define TEST_LOOKBEHIND(r) cmpl OUTP,r ; jb .L_lookbehind_overrun +#else +# define TEST_LOOKBEHIND(r) +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define LODSB movb (%esi),%al ; incl %esi + +#define MOVSB(r1,r2,x) movb (r1),x ; incl r1 ; movb x,(r2) ; incl r2 +#define MOVSW(r1,r2,x) movb (r1),x ; movb x,(r2) ; \ + movb 1(r1),x ; addl $2,r1 ; \ + movb x,1(r2) ; addl $2,r2 +#define MOVSL(r1,r2,x) movl (r1),x ; addl $4,r1 ; movl x,(r2) ; addl $4,r2 + +#if defined(LZO_DEBUG) +#define COPYB_C(r1,r2,x,rc) \ + cmpl $0,rc ; jz .L_assert_fail; \ + 9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b +#define COPYL_C(r1,r2,x,rc) \ + cmpl $0,rc ; jz .L_assert_fail; \ + 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b +#else +#define COPYB_C(r1,r2,x,rc) \ + 9: MOVSB(r1,r2,x) ; decl rc ; jnz 9b +#define COPYL_C(r1,r2,x,rc) \ + 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b +#endif + +#define COPYB(r1,r2,x) COPYB_C(r1,r2,x,%ecx) +#define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx) + + +/*********************************************************************** +// not used +************************************************************************/ + +#if 0 + +#if 0 +#define REP_MOVSB(x) rep ; movsb +#define REP_MOVSL(x) shrl $2,%ecx ; rep ; movsl +#elif 1 +#define REP_MOVSB(x) COPYB(%esi,%edi,x) +#define REP_MOVSL(x) shrl $2,%ecx ; COPYL(%esi,%edi,x) +#else +#define REP_MOVSB(x) rep ; movsb +#define REP_MOVSL(x) jmp 9f ; 8: movsb ; decl %ecx ; \ + 9: testl $3,%edi ; jnz 8b ; \ + movl %ecx,x ; shrl $2,%ecx ; andl $3,x ; \ + rep ; movsl ; movl x,%ecx ; rep ; movsb +#endif + +#if 1 +#define NEGL(x) negl x +#else +#define NEGL(x) xorl $-1,x ; incl x +#endif + +#endif + + + +/* +vi:ts=4 +*/ + diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/all/asm_all.S b/thirdparty/lzo/2.03/asm/i386/src_gas/all/asm_all.S new file mode 100644 index 0000000..d8dd80d --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/all/asm_all.S @@ -0,0 +1,565 @@ +/* asm_all.S -- + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#ifndef F +# define F(name) name +#endif +#ifndef global +# define global(x) .globl x +#endif +#ifndef typef +# ifdef __ELF__ +# define typef(x) .type x,@function +# else +# define typef(x) +# endif +#endif +#ifndef size +# ifdef __ELF__ +# define size(x,s) .size x,s +# else +# define size(x,s) +# endif +#endif +#ifndef db +# define db .byte +#endif +#ifdef __ELF__ +.section .note.GNU-stack,"",@progbits +#endif +.text + +typef(_lzo1c_decompress_asm) +typef(F(lzo1c_decompress_asm)) +global(_lzo1c_decompress_asm) +global(F(lzo1c_decompress_asm)) +_lzo1c_decompress_asm: +F(lzo1c_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 +size(_lzo1c_decompress_asm,.-_lzo1c_decompress_asm) +size(F(lzo1c_decompress_asm),.-F(lzo1c_decompress_asm)) + +typef(_lzo1c_decompress_asm_safe) +typef(F(lzo1c_decompress_asm_safe)) +global(_lzo1c_decompress_asm_safe) +global(F(lzo1c_decompress_asm_safe)) +_lzo1c_decompress_asm_safe: +F(lzo1c_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 +size(_lzo1c_decompress_asm_safe,.-_lzo1c_decompress_asm_safe) +size(F(lzo1c_decompress_asm_safe),.-F(lzo1c_decompress_asm_safe)) + +typef(_lzo1f_decompress_asm_fast) +typef(F(lzo1f_decompress_asm_fast)) +global(_lzo1f_decompress_asm_fast) +global(F(lzo1f_decompress_asm_fast)) +_lzo1f_decompress_asm_fast: +F(lzo1f_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 +size(_lzo1f_decompress_asm_fast,.-_lzo1f_decompress_asm_fast) +size(F(lzo1f_decompress_asm_fast),.-F(lzo1f_decompress_asm_fast)) + +typef(_lzo1f_decompress_asm_fast_safe) +typef(F(lzo1f_decompress_asm_fast_safe)) +global(_lzo1f_decompress_asm_fast_safe) +global(F(lzo1f_decompress_asm_fast_safe)) +_lzo1f_decompress_asm_fast_safe: +F(lzo1f_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 +size(_lzo1f_decompress_asm_fast_safe,.-_lzo1f_decompress_asm_fast_safe) +size(F(lzo1f_decompress_asm_fast_safe),.-F(lzo1f_decompress_asm_fast_safe)) + +typef(_lzo1x_decompress_asm_fast) +typef(F(lzo1x_decompress_asm_fast)) +global(_lzo1x_decompress_asm_fast) +global(F(lzo1x_decompress_asm_fast)) +_lzo1x_decompress_asm_fast: +F(lzo1x_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +size(_lzo1x_decompress_asm_fast,.-_lzo1x_decompress_asm_fast) +size(F(lzo1x_decompress_asm_fast),.-F(lzo1x_decompress_asm_fast)) + +typef(_lzo1x_decompress_asm_fast_safe) +typef(F(lzo1x_decompress_asm_fast_safe)) +global(_lzo1x_decompress_asm_fast_safe) +global(F(lzo1x_decompress_asm_fast_safe)) +_lzo1x_decompress_asm_fast_safe: +F(lzo1x_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +size(_lzo1x_decompress_asm_fast_safe,.-_lzo1x_decompress_asm_fast_safe) +size(F(lzo1x_decompress_asm_fast_safe),.-F(lzo1x_decompress_asm_fast_safe)) + +typef(_lzo1x_decompress_asm) +typef(F(lzo1x_decompress_asm)) +global(_lzo1x_decompress_asm) +global(F(lzo1x_decompress_asm)) +_lzo1x_decompress_asm: +F(lzo1x_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +size(_lzo1x_decompress_asm,.-_lzo1x_decompress_asm) +size(F(lzo1x_decompress_asm),.-F(lzo1x_decompress_asm)) + +typef(_lzo1x_decompress_asm_safe) +typef(F(lzo1x_decompress_asm_safe)) +global(_lzo1x_decompress_asm_safe) +global(F(lzo1x_decompress_asm_safe)) +_lzo1x_decompress_asm_safe: +F(lzo1x_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +size(_lzo1x_decompress_asm_safe,.-_lzo1x_decompress_asm_safe) +size(F(lzo1x_decompress_asm_safe),.-F(lzo1x_decompress_asm_safe)) + +typef(_lzo1y_decompress_asm_fast) +typef(F(lzo1y_decompress_asm_fast)) +global(_lzo1y_decompress_asm_fast) +global(F(lzo1y_decompress_asm_fast)) +_lzo1y_decompress_asm_fast: +F(lzo1y_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +size(_lzo1y_decompress_asm_fast,.-_lzo1y_decompress_asm_fast) +size(F(lzo1y_decompress_asm_fast),.-F(lzo1y_decompress_asm_fast)) + +typef(_lzo1y_decompress_asm_fast_safe) +typef(F(lzo1y_decompress_asm_fast_safe)) +global(_lzo1y_decompress_asm_fast_safe) +global(F(lzo1y_decompress_asm_fast_safe)) +_lzo1y_decompress_asm_fast_safe: +F(lzo1y_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +size(_lzo1y_decompress_asm_fast_safe,.-_lzo1y_decompress_asm_fast_safe) +size(F(lzo1y_decompress_asm_fast_safe),.-F(lzo1y_decompress_asm_fast_safe)) + +typef(_lzo1y_decompress_asm) +typef(F(lzo1y_decompress_asm)) +global(_lzo1y_decompress_asm) +global(F(lzo1y_decompress_asm)) +_lzo1y_decompress_asm: +F(lzo1y_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +size(_lzo1y_decompress_asm,.-_lzo1y_decompress_asm) +size(F(lzo1y_decompress_asm),.-F(lzo1y_decompress_asm)) + +typef(_lzo1y_decompress_asm_safe) +typef(F(lzo1y_decompress_asm_safe)) +global(_lzo1y_decompress_asm_safe) +global(F(lzo1y_decompress_asm_safe)) +_lzo1y_decompress_asm_safe: +F(lzo1y_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +size(_lzo1y_decompress_asm_safe,.-_lzo1y_decompress_asm_safe) +size(F(lzo1y_decompress_asm_safe),.-F(lzo1y_decompress_asm_safe)) + diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/asminit.def b/thirdparty/lzo/2.03/asm/i386/src_gas/asminit.def new file mode 100644 index 0000000..942b7b3 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/asminit.def @@ -0,0 +1,67 @@ +/* asminit.def -- + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +#ifndef F +# define F(name) name +#endif +#ifndef global +# define global(x) .globl x +#endif +#ifndef typef +# ifdef __ELF__ +# define typef(x) .type x,@function +# else +# define typef(x) +# endif +#endif +#ifndef size +# ifdef __ELF__ +# define size(x,s) .size x,s +# else +# define size(x,s) +# endif +#endif +#ifndef db +# define db .byte +#endif + +#ifdef __ELF__ +.section .note.GNU-stack,"",@progbits +#endif +.text diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s1.S new file mode 100644 index 0000000..3db16c1 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s1.S @@ -0,0 +1,68 @@ +/* lzo1c_s1.S -- lzo1c_decompress_asm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1c_decompress_asm) +typef(F(lzo1c_decompress_asm)) +global(_lzo1c_decompress_asm) +global(F(lzo1c_decompress_asm)) +_lzo1c_decompress_asm: +F(lzo1c_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 +size(_lzo1c_decompress_asm,.-_lzo1c_decompress_asm) +size(F(lzo1c_decompress_asm),.-F(lzo1c_decompress_asm)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s2.S new file mode 100644 index 0000000..91213b9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1c_s2.S @@ -0,0 +1,79 @@ +/* lzo1c_s2.S -- lzo1c_decompress_asm_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1c_decompress_asm_safe) +typef(F(lzo1c_decompress_asm_safe)) +global(_lzo1c_decompress_asm_safe) +global(F(lzo1c_decompress_asm_safe)) +_lzo1c_decompress_asm_safe: +F(lzo1c_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 +size(_lzo1c_decompress_asm_safe,.-_lzo1c_decompress_asm_safe) +size(F(lzo1c_decompress_asm_safe),.-F(lzo1c_decompress_asm_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f1.S new file mode 100644 index 0000000..0020839 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f1.S @@ -0,0 +1,70 @@ +/* lzo1f_f1.S -- lzo1f_decompress_asm_fast + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1f_decompress_asm_fast) +typef(F(lzo1f_decompress_asm_fast)) +global(_lzo1f_decompress_asm_fast) +global(F(lzo1f_decompress_asm_fast)) +_lzo1f_decompress_asm_fast: +F(lzo1f_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 +size(_lzo1f_decompress_asm_fast,.-_lzo1f_decompress_asm_fast) +size(F(lzo1f_decompress_asm_fast),.-F(lzo1f_decompress_asm_fast)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f2.S new file mode 100644 index 0000000..0c72104 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1f_f2.S @@ -0,0 +1,77 @@ +/* lzo1f_f2.S -- lzo1f_decompress_asm_fast_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1f_decompress_asm_fast_safe) +typef(F(lzo1f_decompress_asm_fast_safe)) +global(_lzo1f_decompress_asm_fast_safe) +global(F(lzo1f_decompress_asm_fast_safe)) +_lzo1f_decompress_asm_fast_safe: +F(lzo1f_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 +size(_lzo1f_decompress_asm_fast_safe,.-_lzo1f_decompress_asm_fast_safe) +size(F(lzo1f_decompress_asm_fast_safe),.-F(lzo1f_decompress_asm_fast_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f1.S new file mode 100644 index 0000000..4137f89 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f1.S @@ -0,0 +1,78 @@ +/* lzo1x_f1.S -- lzo1x_decompress_asm_fast + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1x_decompress_asm_fast) +typef(F(lzo1x_decompress_asm_fast)) +global(_lzo1x_decompress_asm_fast) +global(F(lzo1x_decompress_asm_fast)) +_lzo1x_decompress_asm_fast: +F(lzo1x_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +size(_lzo1x_decompress_asm_fast,.-_lzo1x_decompress_asm_fast) +size(F(lzo1x_decompress_asm_fast),.-F(lzo1x_decompress_asm_fast)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f2.S new file mode 100644 index 0000000..eb3a744 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_f2.S @@ -0,0 +1,93 @@ +/* lzo1x_f2.S -- lzo1x_decompress_asm_fast_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1x_decompress_asm_fast_safe) +typef(F(lzo1x_decompress_asm_fast_safe)) +global(_lzo1x_decompress_asm_fast_safe) +global(F(lzo1x_decompress_asm_fast_safe)) +_lzo1x_decompress_asm_fast_safe: +F(lzo1x_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +size(_lzo1x_decompress_asm_fast_safe,.-_lzo1x_decompress_asm_fast_safe) +size(F(lzo1x_decompress_asm_fast_safe),.-F(lzo1x_decompress_asm_fast_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s1.S new file mode 100644 index 0000000..28095c6 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s1.S @@ -0,0 +1,80 @@ +/* lzo1x_s1.S -- lzo1x_decompress_asm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1x_decompress_asm) +typef(F(lzo1x_decompress_asm)) +global(_lzo1x_decompress_asm) +global(F(lzo1x_decompress_asm)) +_lzo1x_decompress_asm: +F(lzo1x_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +size(_lzo1x_decompress_asm,.-_lzo1x_decompress_asm) +size(F(lzo1x_decompress_asm),.-F(lzo1x_decompress_asm)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s2.S new file mode 100644 index 0000000..33e1525 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1x_s2.S @@ -0,0 +1,96 @@ +/* lzo1x_s2.S -- lzo1x_decompress_asm_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1x_decompress_asm_safe) +typef(F(lzo1x_decompress_asm_safe)) +global(_lzo1x_decompress_asm_safe) +global(F(lzo1x_decompress_asm_safe)) +_lzo1x_decompress_asm_safe: +F(lzo1x_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +size(_lzo1x_decompress_asm_safe,.-_lzo1x_decompress_asm_safe) +size(F(lzo1x_decompress_asm_safe),.-F(lzo1x_decompress_asm_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f1.S new file mode 100644 index 0000000..28b4826 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f1.S @@ -0,0 +1,78 @@ +/* lzo1y_f1.S -- lzo1y_decompress_asm_fast + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1y_decompress_asm_fast) +typef(F(lzo1y_decompress_asm_fast)) +global(_lzo1y_decompress_asm_fast) +global(F(lzo1y_decompress_asm_fast)) +_lzo1y_decompress_asm_fast: +F(lzo1y_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +size(_lzo1y_decompress_asm_fast,.-_lzo1y_decompress_asm_fast) +size(F(lzo1y_decompress_asm_fast),.-F(lzo1y_decompress_asm_fast)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f2.S new file mode 100644 index 0000000..d95b2c3 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_f2.S @@ -0,0 +1,93 @@ +/* lzo1y_f2.S -- lzo1y_decompress_asm_fast_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1y_decompress_asm_fast_safe) +typef(F(lzo1y_decompress_asm_fast_safe)) +global(_lzo1y_decompress_asm_fast_safe) +global(F(lzo1y_decompress_asm_fast_safe)) +_lzo1y_decompress_asm_fast_safe: +F(lzo1y_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +size(_lzo1y_decompress_asm_fast_safe,.-_lzo1y_decompress_asm_fast_safe) +size(F(lzo1y_decompress_asm_fast_safe),.-F(lzo1y_decompress_asm_fast_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s1.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s1.S new file mode 100644 index 0000000..6552801 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s1.S @@ -0,0 +1,80 @@ +/* lzo1y_s1.S -- lzo1y_decompress_asm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1y_decompress_asm) +typef(F(lzo1y_decompress_asm)) +global(_lzo1y_decompress_asm) +global(F(lzo1y_decompress_asm)) +_lzo1y_decompress_asm: +F(lzo1y_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +size(_lzo1y_decompress_asm,.-_lzo1y_decompress_asm) +size(F(lzo1y_decompress_asm),.-F(lzo1y_decompress_asm)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s2.S b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s2.S new file mode 100644 index 0000000..6682c49 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_gas/lzo1y_s2.S @@ -0,0 +1,96 @@ +/* lzo1y_s2.S -- lzo1y_decompress_asm_safe + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ +*/ + +/***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +#include "asminit.def" +typef(_lzo1y_decompress_asm_safe) +typef(F(lzo1y_decompress_asm_safe)) +global(_lzo1y_decompress_asm_safe) +global(F(lzo1y_decompress_asm_safe)) +_lzo1y_decompress_asm_safe: +F(lzo1y_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +size(_lzo1y_decompress_asm_safe,.-_lzo1y_decompress_asm_safe) +size(F(lzo1y_decompress_asm_safe),.-F(lzo1y_decompress_asm_safe)) diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/all/asm_all.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/all/asm_all.asm new file mode 100644 index 0000000..e45522c --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/all/asm_all.asm @@ -0,0 +1,477 @@ +; asm_all.asm -- +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +.386p +.model flat +.code +ifdef __MASM__ +option casemap:none +endif +ifdef __TASM__ +endif +ifdef __WASM__ +endif + +public _lzo1c_decompress_asm +_lzo1c_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 + +public _lzo1c_decompress_asm_safe +_lzo1c_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 + +public _lzo1f_decompress_asm_fast +_lzo1f_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 + +public _lzo1f_decompress_asm_fast_safe +_lzo1f_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 + +public _lzo1x_decompress_asm_fast +_lzo1x_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 + +public _lzo1x_decompress_asm_fast_safe +_lzo1x_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 + +public _lzo1x_decompress_asm +_lzo1x_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 + +public _lzo1x_decompress_asm_safe +_lzo1x_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 + +public _lzo1y_decompress_asm_fast +_lzo1y_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 + +public _lzo1y_decompress_asm_fast_safe +_lzo1y_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 + +public _lzo1y_decompress_asm +_lzo1y_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 + +public _lzo1y_decompress_asm_safe +_lzo1y_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 + +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/asminit.def b/thirdparty/lzo/2.03/asm/i386/src_masm/asminit.def new file mode 100644 index 0000000..9cfb7a9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/asminit.def @@ -0,0 +1,50 @@ +; asminit.def -- +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +.386p +.model flat +.code + +ifdef __MASM__ +option casemap:none +endif +ifdef __TASM__ +endif +ifdef __WASM__ +endif diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s1.asm new file mode 100644 index 0000000..88e816a --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s1.asm @@ -0,0 +1,63 @@ +; lzo1c_s1.asm -- lzo1c_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1c_decompress_asm +_lzo1c_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s2.asm new file mode 100644 index 0000000..9ecc073 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1c_s2.asm @@ -0,0 +1,74 @@ +; lzo1c_s2.asm -- lzo1c_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1c_decompress_asm_safe +_lzo1c_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f1.asm new file mode 100644 index 0000000..eba922e --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f1.asm @@ -0,0 +1,65 @@ +; lzo1f_f1.asm -- lzo1f_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1f_decompress_asm_fast +_lzo1f_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f2.asm new file mode 100644 index 0000000..f9e7d10 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1f_f2.asm @@ -0,0 +1,72 @@ +; lzo1f_f2.asm -- lzo1f_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1f_decompress_asm_fast_safe +_lzo1f_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f1.asm new file mode 100644 index 0000000..29ce326 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f1.asm @@ -0,0 +1,73 @@ +; lzo1x_f1.asm -- lzo1x_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1x_decompress_asm_fast +_lzo1x_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f2.asm new file mode 100644 index 0000000..1c9e920 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_f2.asm @@ -0,0 +1,88 @@ +; lzo1x_f2.asm -- lzo1x_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1x_decompress_asm_fast_safe +_lzo1x_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s1.asm new file mode 100644 index 0000000..b1060fe --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s1.asm @@ -0,0 +1,75 @@ +; lzo1x_s1.asm -- lzo1x_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1x_decompress_asm +_lzo1x_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s2.asm new file mode 100644 index 0000000..68f074e --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1x_s2.asm @@ -0,0 +1,91 @@ +; lzo1x_s2.asm -- lzo1x_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1x_decompress_asm_safe +_lzo1x_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f1.asm new file mode 100644 index 0000000..278d745 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f1.asm @@ -0,0 +1,73 @@ +; lzo1y_f1.asm -- lzo1y_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1y_decompress_asm_fast +_lzo1y_decompress_asm_fast: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f2.asm new file mode 100644 index 0000000..5e75a38 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_f2.asm @@ -0,0 +1,88 @@ +; lzo1y_f2.asm -- lzo1y_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1y_decompress_asm_fast_safe +_lzo1y_decompress_asm_fast_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s1.asm new file mode 100644 index 0000000..87c46a6 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s1.asm @@ -0,0 +1,75 @@ +; lzo1y_s1.asm -- lzo1y_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1y_decompress_asm +_lzo1y_decompress_asm: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s2.asm new file mode 100644 index 0000000..5998967 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_masm/lzo1y_s2.asm @@ -0,0 +1,91 @@ +; lzo1y_s2.asm -- lzo1y_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +include asminit.def +public _lzo1y_decompress_asm_safe +_lzo1y_decompress_asm_safe: +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 +end diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/all/asm_all.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/all/asm_all.asm new file mode 100644 index 0000000..e37965a --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/all/asm_all.asm @@ -0,0 +1,505 @@ +; asm_all.asm -- +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%define F(name) name +%ifidni __OUTPUT_FORMAT__,elf +%define globalf(x) global x:function +%else +%define globalf(x) global x +%endif +bits 32 +%ifidni __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidni __OUTPUT_FORMAT__,obj +segment _TEXT class=CODE public use32 flat align=16 +%else +section .text +%endif + +globalf(_lzo1c_decompress_asm) +globalf(F(lzo1c_decompress_asm)) +_lzo1c_decompress_asm: +F(lzo1c_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 + +globalf(_lzo1c_decompress_asm_safe) +globalf(F(lzo1c_decompress_asm_safe)) +_lzo1c_decompress_asm_safe: +F(lzo1c_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 + +globalf(_lzo1f_decompress_asm_fast) +globalf(F(lzo1f_decompress_asm_fast)) +_lzo1f_decompress_asm_fast: +F(lzo1f_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 + +globalf(_lzo1f_decompress_asm_fast_safe) +globalf(F(lzo1f_decompress_asm_fast_safe)) +_lzo1f_decompress_asm_fast_safe: +F(lzo1f_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 + +globalf(_lzo1x_decompress_asm_fast) +globalf(F(lzo1x_decompress_asm_fast)) +_lzo1x_decompress_asm_fast: +F(lzo1x_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 + +globalf(_lzo1x_decompress_asm_fast_safe) +globalf(F(lzo1x_decompress_asm_fast_safe)) +_lzo1x_decompress_asm_fast_safe: +F(lzo1x_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 + +globalf(_lzo1x_decompress_asm) +globalf(F(lzo1x_decompress_asm)) +_lzo1x_decompress_asm: +F(lzo1x_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 + +globalf(_lzo1x_decompress_asm_safe) +globalf(F(lzo1x_decompress_asm_safe)) +_lzo1x_decompress_asm_safe: +F(lzo1x_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 + +globalf(_lzo1y_decompress_asm_fast) +globalf(F(lzo1y_decompress_asm_fast)) +_lzo1y_decompress_asm_fast: +F(lzo1y_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 + +globalf(_lzo1y_decompress_asm_fast_safe) +globalf(F(lzo1y_decompress_asm_fast_safe)) +_lzo1y_decompress_asm_fast_safe: +F(lzo1y_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 + +globalf(_lzo1y_decompress_asm) +globalf(F(lzo1y_decompress_asm)) +_lzo1y_decompress_asm: +F(lzo1y_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 + +globalf(_lzo1y_decompress_asm_safe) +globalf(F(lzo1y_decompress_asm_safe)) +_lzo1y_decompress_asm_safe: +F(lzo1y_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 + diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/asminit.def b/thirdparty/lzo/2.03/asm/i386/src_nasm/asminit.def new file mode 100644 index 0000000..6942a81 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/asminit.def @@ -0,0 +1,55 @@ +; asminit.def -- +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +%define F(name) name +%ifidni __OUTPUT_FORMAT__,elf +%define globalf(x) global x:function +%else +%define globalf(x) global x +%endif + +bits 32 +%ifidni __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidni __OUTPUT_FORMAT__,obj +segment _TEXT class=CODE public use32 flat align=16 +%else +section .text +%endif diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s1.asm new file mode 100644 index 0000000..b693a59 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s1.asm @@ -0,0 +1,64 @@ +; lzo1c_s1.asm -- lzo1c_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1c_decompress_asm) +globalf(F(lzo1c_decompress_asm)) +_lzo1c_decompress_asm: +F(lzo1c_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,32,115 +db 15,8,192,116,51,137,193,243,164,138,6,70,60,32,114,72 +db 60,64,114,93,137,193,36,31,141,87,255,193,233,5,41,194 +db 138,6,70,193,224,5,41,194,65,135,242,243,164,137,214,235 +db 199,141,180,38,0,0,0,0,138,6,70,141,72,32,60,248 +db 114,197,185,24,1,0,0,44,248,116,6,145,48,192,211,224 +db 145,243,164,235,163,141,118,0,141,87,255,41,194,138,6,70 +db 193,224,5,41,194,135,242,164,164,164,137,214,164,49,192,235 +db 152,36,31,137,193,117,19,177,31,138,6,70,8,192,117,8 +db 129,193,255,0,0,0,235,241,1,193,138,6,70,137,195,36 +db 63,137,250,41,194,138,6,70,193,224,6,41,194,57,250,116 +db 27,135,214,141,73,3,243,164,137,214,49,192,193,235,6,137 +db 217,15,133,80,255,255,255,233,60,255,255,255,131,249,1,15 +db 149,192,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,144,141,116,38,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s2.asm new file mode 100644 index 0000000..addc8ae --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1c_s2.asm @@ -0,0 +1,75 @@ +; lzo1c_s2.asm -- lzo1c_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1c_decompress_asm_safe) +globalf(F(lzo1c_decompress_asm_safe)) +_lzo1c_decompress_asm_safe: +F(lzo1c_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,32,115,40,8,192,116,99,137,193,141 +db 28,15,57,28,36,15,130,107,1,0,0,141,28,14,57,92 +db 36,4,15,130,87,1,0,0,243,164,138,6,70,60,32,114 +db 127,60,64,15,130,169,0,0,0,137,193,36,31,141,87,255 +db 193,233,5,41,194,138,6,70,193,224,5,41,194,65,135,242 +db 59,116,36,48,15,130,51,1,0,0,141,28,15,57,28,36 +db 15,130,32,1,0,0,243,164,137,214,235,148,141,116,38,0 +db 138,6,70,141,72,32,60,248,114,149,185,24,1,0,0,44 +db 248,116,6,145,48,192,211,224,145,141,28,15,57,28,36,15 +db 130,241,0,0,0,141,28,14,57,92,36,4,15,130,221,0 +db 0,0,243,164,233,87,255,255,255,141,180,38,0,0,0,0 +db 141,87,255,41,194,138,6,70,193,224,5,41,194,135,242,59 +db 116,36,48,15,130,196,0,0,0,141,95,4,57,28,36,15 +db 130,177,0,0,0,164,164,164,137,214,164,49,192,233,72,255 +db 255,255,36,31,137,193,117,26,177,31,138,6,70,8,192,117 +db 15,129,193,255,0,0,0,235,241,141,180,38,0,0,0,0 +db 1,193,138,6,70,137,195,36,63,137,250,41,194,138,6,70 +db 193,224,6,41,194,57,250,116,41,135,214,141,73,3,59,116 +db 36,48,114,105,141,4,15,57,4,36,114,90,243,164,137,214 +db 49,192,193,235,6,137,217,15,133,210,254,255,255,233,190,254 +db 255,255,131,249,1,15,149,192,59,60,36,119,57,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,184,5,0,0,0,235,206,184,6,0 +db 0,0,235,199,141,182,0,0,0,0,141,191,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f1.asm new file mode 100644 index 0000000..51b4d96 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f1.asm @@ -0,0 +1,66 @@ +; lzo1f_f1.asm -- lzo1f_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1f_decompress_asm_fast) +globalf(F(lzo1f_decompress_asm_fast)) +_lzo1f_decompress_asm_fast: +F(lzo1f_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,144,49,192,138,6,70,60,31,119 +db 51,8,192,137,193,117,19,138,6,70,8,192,117,8,129,193 +db 255,0,0,0,235,241,141,76,8,31,136,200,193,233,2,243 +db 165,36,3,116,8,139,30,1,198,137,31,1,199,138,6,70 +db 60,31,118,88,60,223,15,135,132,0,0,0,137,193,193,232 +db 2,141,87,255,36,7,193,233,5,137,195,138,6,141,4,195 +db 70,41,194,131,193,2,135,214,131,249,6,114,16,131,248,4 +db 114,11,136,200,193,233,2,243,165,36,3,136,193,243,164,137 +db 214,138,78,254,131,225,3,15,132,123,255,255,255,139,6,1 +db 206,137,7,1,207,49,192,138,6,70,235,164,193,232,2,141 +db 151,255,247,255,255,137,193,138,6,70,141,4,193,41,194,139 +db 2,137,7,131,199,3,235,201,138,6,70,8,192,117,8,129 +db 193,255,0,0,0,235,241,141,76,8,31,235,9,141,118,0 +db 36,31,137,193,116,226,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,122,255,255,255,131,249,1,15,149,192,139,84,36 +db 40,3,84,36,44,57,214,119,38,114,29,43,124,36,48,139 +db 84,36,52,137,58,247,216,131,196,12,90,89,91,94,95,93 +db 195,184,1,0,0,0,235,227,184,8,0,0,0,235,220,184 +db 4,0,0,0,235,213,141,118,0,141,188,39,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f2.asm new file mode 100644 index 0000000..e0de429 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1f_f2.asm @@ -0,0 +1,73 @@ +; lzo1f_f2.asm -- lzo1f_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1f_decompress_asm_fast_safe) +globalf(F(lzo1f_decompress_asm_fast_safe)) +_lzo1f_decompress_asm_fast_safe: +F(lzo1f_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,141,118,0 +db 49,192,138,6,70,60,31,119,76,8,192,137,193,117,19,138 +db 6,70,8,192,117,8,129,193,255,0,0,0,235,241,141,76 +db 8,31,141,28,15,57,28,36,15,130,61,1,0,0,141,28 +db 14,57,92,36,4,15,130,41,1,0,0,136,200,193,233,2 +db 243,165,36,3,116,8,139,30,1,198,137,31,1,199,138,6 +db 70,60,31,118,110,60,223,15,135,179,0,0,0,137,193,193 +db 232,2,141,87,255,36,7,193,233,5,137,195,138,6,141,4 +db 195,70,41,194,131,193,2,135,214,59,116,36,48,15,130,239 +db 0,0,0,141,28,15,57,28,36,15,130,220,0,0,0,131 +db 249,6,114,16,131,248,4,114,11,136,200,193,233,2,243,165 +db 36,3,136,193,243,164,137,214,138,78,254,131,225,3,15,132 +db 76,255,255,255,139,6,1,206,137,7,1,207,49,192,138,6 +db 70,235,142,141,87,3,57,20,36,15,130,156,0,0,0,193 +db 232,2,141,151,255,247,255,255,137,193,138,6,70,141,4,193 +db 41,194,59,84,36,48,15,130,134,0,0,0,139,2,137,7 +db 131,199,3,235,179,138,6,70,8,192,117,8,129,193,255,0 +db 0,0,235,241,141,76,8,31,235,12,141,182,0,0,0,0 +db 36,31,137,193,116,223,137,250,102,139,6,131,198,2,193,232 +db 2,15,133,75,255,255,255,131,249,1,15,149,192,59,60,36 +db 119,57,139,84,36,40,3,84,36,44,57,214,119,38,114,29 +db 43,124,36,48,139,84,36,52,137,58,247,216,131,196,12,90 +db 89,91,94,95,93,195,184,1,0,0,0,235,227,184,8,0 +db 0,0,235,220,184,4,0,0,0,235,213,184,5,0,0,0 +db 235,206,184,6,0,0,0,235,199,141,180,38,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f1.asm new file mode 100644 index 0000000..23a18fe --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f1.asm @@ -0,0 +1,74 @@ +; lzo1x_f1.asm -- lzo1x_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1x_decompress_asm_fast) +globalf(F(lzo1x_decompress_asm_fast)) +_lzo1x_decompress_asm_fast: +F(lzo1x_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,247 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,131,193,4,57,232,115 +db 53,235,109,5,255,0,0,0,138,30,70,8,219,116,244,141 +db 76,24,36,49,192,235,13,144,60,32,114,116,131,224,31,116 +db 231,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f2.asm new file mode 100644 index 0000000..e41de81 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_f2.asm @@ -0,0 +1,89 @@ +; lzo1x_f2.asm -- lzo1x_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1x_decompress_asm_fast_safe) +globalf(F(lzo1x_decompress_asm_fast_safe)) +_lzo1x_decompress_asm_fast_safe: +F(lzo1x_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,247,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,131,224,7,138,30,193,233,5,141,4,216,70 +db 41,194,131,193,4,57,232,115,73,233,170,0,0,0,5,255 +db 0,0,0,141,86,3,57,84,36,4,15,130,123,1,0,0 +db 138,30,70,8,219,116,231,141,76,24,36,49,192,235,17,144 +db 60,32,15,130,200,0,0,0,131,224,31,116,227,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s1.asm new file mode 100644 index 0000000..f41f7f9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s1.asm @@ -0,0 +1,76 @@ +; lzo1x_s1.asm -- lzo1x_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1x_decompress_asm) +globalf(F(lzo1x_decompress_asm)) +_lzo1x_decompress_asm: +F(lzo1x_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,247,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,55,235 +db 119,5,255,0,0,0,138,30,70,8,219,116,244,141,76,24 +db 33,49,192,235,15,141,118,0,60,32,114,124,131,224,31,116 +db 229,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s2.asm new file mode 100644 index 0000000..7b3acc4 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1x_s2.asm @@ -0,0 +1,92 @@ +; lzo1x_s2.asm -- lzo1x_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1x_decompress_asm_safe) +globalf(F(lzo1x_decompress_asm_safe)) +_lzo1x_decompress_asm_safe: +F(lzo1x_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,247,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,131,224,7,138 +db 30,193,233,5,141,4,216,70,41,194,65,57,232,115,75,233 +db 180,0,0,0,5,255,0,0,0,141,86,3,57,84,36,4 +db 15,130,125,1,0,0,138,30,70,8,219,116,231,141,76,24 +db 33,49,192,235,19,141,118,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,225,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f1.asm new file mode 100644 index 0000000..c423de3 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f1.asm @@ -0,0 +1,74 @@ +; lzo1y_f1.asm -- lzo1y_decompress_asm_fast +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1y_decompress_asm_fast) +globalf(F(lzo1y_decompress_asm_fast)) +_lzo1y_decompress_asm_fast: +F(lzo1y_decompress_asm_fast): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,27 +db 44,14,235,34,5,255,0,0,0,138,30,70,8,219,116,244 +db 141,68,24,21,235,16,137,246,138,6,70,60,16,115,65,8 +db 192,116,230,131,192,6,137,193,49,232,193,233,2,33,232,139 +db 22,131,198,4,137,23,131,199,4,73,117,243,41,198,41,199 +db 138,6,70,60,16,115,25,193,232,2,138,30,141,151,255,251 +db 255,255,141,4,152,70,41,194,139,10,137,15,1,239,235,110 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,131,193,2,57,232,115,54 +db 235,110,5,255,0,0,0,138,30,70,8,219,116,244,141,76 +db 24,36,49,192,235,14,137,246,60,32,114,116,131,224,31,116 +db 230,141,72,5,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,58,141,68,15,253,193,233,2,139,26,131 +db 194,4,137,31,131,199,4,73,117,243,137,199,49,219,138,70 +db 254,33,232,15,132,63,255,255,255,139,22,1,198,137,23,1 +db 199,138,6,70,233,119,255,255,255,141,180,38,0,0,0,0 +db 135,214,41,233,243,164,137,214,235,212,129,193,255,0,0,0 +db 138,30,70,8,219,116,243,141,76,11,12,235,23,141,118,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 223,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,43,41,194,233,122,255,255,255,141,116,38,0 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,138,2 +db 136,7,138,90,1,136,95,1,131,199,2,233,110,255,255,255 +db 131,249,6,15,149,192,139,84,36,40,3,84,36,44,57,214 +db 119,38,114,29,43,124,36,48,139,84,36,52,137,58,247,216 +db 131,196,12,90,89,91,94,95,93,195,184,1,0,0,0,235 +db 227,184,8,0,0,0,235,220,184,4,0,0,0,235,213,144 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f2.asm new file mode 100644 index 0000000..3864444 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_f2.asm @@ -0,0 +1,89 @@ +; lzo1y_f2.asm -- lzo1y_decompress_asm_fast_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1y_decompress_asm_fast_safe) +globalf(F(lzo1y_decompress_asm_fast_safe)) +_lzo1y_decompress_asm_fast_safe: +F(lzo1y_decompress_asm_fast_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,55,44,14,235,62,5,255,0,0,0,141 +db 84,6,18,57,84,36,4,15,130,78,2,0,0,138,30,70 +db 8,219,116,230,141,68,24,21,235,30,141,182,0,0,0,0 +db 57,116,36,4,15,130,49,2,0,0,138,6,70,60,16,115 +db 119,8,192,116,216,131,192,6,141,84,7,253,57,20,36,15 +db 130,29,2,0,0,141,84,6,253,57,84,36,4,15,130,8 +db 2,0,0,137,193,49,232,193,233,2,33,232,139,22,131,198 +db 4,137,23,131,199,4,73,117,243,41,198,41,199,138,6,70 +db 60,16,115,52,141,87,3,57,20,36,15,130,226,1,0,0 +db 193,232,2,138,30,141,151,255,251,255,255,141,4,152,70,41 +db 194,59,84,36,48,15,130,206,1,0,0,139,10,137,15,1 +db 239,233,151,0,0,0,137,246,60,64,114,68,137,193,193,232 +db 2,141,87,255,33,232,138,30,193,233,4,141,4,152,70,41 +db 194,131,193,2,57,232,115,74,233,171,0,0,0,5,255,0 +db 0,0,141,86,3,57,84,36,4,15,130,124,1,0,0,138 +db 30,70,8,219,116,231,141,76,24,36,49,192,235,18,137,246 +db 60,32,15,130,200,0,0,0,131,224,31,116,226,141,72,5 +db 102,139,6,141,87,255,193,232,2,131,198,2,41,194,57,232 +db 114,102,59,84,36,48,15,130,77,1,0,0,141,68,15,253 +db 193,233,2,57,4,36,15,130,54,1,0,0,139,26,131,194 +db 4,137,31,131,199,4,73,117,243,137,199,49,219,138,70,254 +db 33,232,15,132,216,254,255,255,141,20,7,57,20,36,15,130 +db 14,1,0,0,141,20,6,57,84,36,4,15,130,250,0,0 +db 0,139,22,1,198,137,23,1,199,138,6,70,233,55,255,255 +db 255,141,180,38,0,0,0,0,59,84,36,48,15,130,231,0 +db 0,0,141,68,15,253,57,4,36,15,130,211,0,0,0,135 +db 214,41,233,243,164,137,214,235,164,129,193,255,0,0,0,141 +db 86,3,57,84,36,4,15,130,175,0,0,0,138,30,70,8 +db 219,116,230,141,76,11,12,235,27,141,180,38,0,0,0,0 +db 60,16,114,44,137,193,131,224,8,193,224,13,131,225,7,116 +db 219,131,193,5,102,139,6,131,198,2,141,151,0,192,255,255 +db 193,232,2,116,57,41,194,233,38,255,255,255,141,116,38,0 +db 141,87,2,57,20,36,114,106,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,59,84,36,48,114,93,138,2,136,7 +db 138,90,1,136,95,1,131,199,2,233,31,255,255,255,131,249 +db 6,15,149,192,59,60,36,119,57,139,84,36,40,3,84,36 +db 44,57,214,119,38,114,29,43,124,36,48,139,84,36,52,137 +db 58,247,216,131,196,12,90,89,91,94,95,93,195,184,1,0 +db 0,0,235,227,184,8,0,0,0,235,220,184,4,0,0,0 +db 235,213,184,5,0,0,0,235,206,184,6,0,0,0,235,199 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s1.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s1.asm new file mode 100644 index 0000000..902f5a9 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s1.asm @@ -0,0 +1,76 @@ +; lzo1y_s1.asm -- lzo1y_decompress_asm +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1y_decompress_asm) +globalf(F(lzo1y_decompress_asm)) +_lzo1y_decompress_asm: +F(lzo1y_decompress_asm): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,49,192,49,219,172,60,17,118,35 +db 44,17,60,4,115,40,137,193,235,56,5,255,0,0,0,138 +db 30,70,8,219,116,244,141,68,24,18,235,18,141,116,38,0 +db 138,6,70,60,16,115,73,8,192,116,228,131,192,3,137,193 +db 193,232,2,33,233,139,22,131,198,4,137,23,131,199,4,72 +db 117,243,243,164,138,6,70,60,16,115,37,193,232,2,138,30 +db 141,151,255,251,255,255,141,4,152,70,41,194,138,2,136,7 +db 138,66,1,136,71,1,138,66,2,136,71,2,1,239,235,119 +db 60,64,114,52,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,56,235,120 +db 5,255,0,0,0,138,30,70,8,219,116,244,141,76,24,33 +db 49,192,235,16,141,116,38,0,60,32,114,124,131,224,31,116 +db 228,141,72,2,102,139,6,141,87,255,193,232,2,131,198,2 +db 41,194,57,232,114,66,137,203,193,235,2,116,17,139,2,131 +db 194,4,137,7,131,199,4,75,117,243,33,233,116,9,138,2 +db 66,136,7,71,73,117,247,138,70,254,33,232,15,132,46,255 +db 255,255,138,14,70,136,15,71,72,117,247,138,6,70,233,109 +db 255,255,255,144,141,116,38,0,135,214,243,164,137,214,235,215 +db 129,193,255,0,0,0,138,30,70,8,219,116,243,141,76,11 +db 9,235,25,144,141,116,38,0,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,221,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,43,41,194,233 +db 114,255,255,255,141,116,38,0,193,232,2,138,30,141,87,255 +db 141,4,152,70,41,194,138,2,136,7,138,90,1,136,95,1 +db 131,199,2,233,111,255,255,255,131,249,3,15,149,192,139,84 +db 36,40,3,84,36,44,57,214,119,38,114,29,43,124,36,48 +db 139,84,36,52,137,58,247,216,131,196,12,90,89,91,94,95 +db 93,195,184,1,0,0,0,235,227,184,8,0,0,0,235,220 +db 184,4,0,0,0,235,213,137,246,141,188,39,0,0,0,0 diff --git a/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s2.asm b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s2.asm new file mode 100644 index 0000000..72224e8 --- /dev/null +++ b/thirdparty/lzo/2.03/asm/i386/src_nasm/lzo1y_s2.asm @@ -0,0 +1,92 @@ +; lzo1y_s2.asm -- lzo1y_decompress_asm_safe +; +; This file is part of the LZO real-time data compression library. +; +; Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer +; Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer +; All Rights Reserved. +; +; The LZO library is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License as +; published by the Free Software Foundation; either version 2 of +; the License, or (at your option) any later version. +; +; The LZO library 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 the LZO library; see the file COPYING. +; If not, write to the Free Software Foundation, Inc., +; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +; +; Markus F.X.J. Oberhumer +; +; http://www.oberhumer.com/opensource/lzo/ +; + +; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ + +%include "asminit.def" +globalf(_lzo1y_decompress_asm_safe) +globalf(F(lzo1y_decompress_asm_safe)) +_lzo1y_decompress_asm_safe: +F(lzo1y_decompress_asm_safe): +db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 +db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 +db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 +db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 +db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 +db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 +db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 +db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 +db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 +db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 +db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 +db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 +db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 +db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 +db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 +db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 +db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 +db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 +db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 +db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 +db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 +db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 +db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 +db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 +db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 +db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 +db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 +db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 +db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 +db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 +db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 +db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 +db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 +db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 +db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 +db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 +db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 +db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 +db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 +db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 +db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 +db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 +db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 +db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 +db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 +db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 diff --git a/thirdparty/lzo/2.03/autoconf/compile b/thirdparty/lzo/2.03/autoconf/compile new file mode 100644 index 0000000..35af809 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/compile @@ -0,0 +1,141 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/config.guess b/thirdparty/lzo/2.03/autoconf/config.guess new file mode 100644 index 0000000..c7607c7 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/config.guess @@ -0,0 +1,1526 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-04-14' + +# 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 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +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 ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 + +# 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 tupples: *-*-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=`(/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 ;; + *) 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*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + 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 + # 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}" + 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'` + exit ;; + 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 ;; + 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:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-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 /* 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 + + 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:*:[456]) + 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/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + 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 + #include + + 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 __LP64__ >/dev/null + 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 + 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:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + 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 ;; + 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-gnu`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/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + 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-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + 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 ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) + 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' /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 i386. + echo i386-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; } ;; + 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.0*:*) + 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 + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # 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 ;; + 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 + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + 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 ;; + 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 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < 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/thirdparty/lzo/2.03/autoconf/config.rpath b/thirdparty/lzo/2.03/autoconf/config.rpath new file mode 100644 index 0000000..35f959b --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/config.rpath @@ -0,0 +1,666 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2008 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# 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. + +# 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 ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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) + os= + basic_machine=$1 + ;; + -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*) + 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 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | 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 \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | 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 | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-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-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | 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-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | 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-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | 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-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-*) + ;; + # 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 + ;; + 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 + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + 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) + 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'm not sure what "Sysv32" means. Should this be sysv3.2? + 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 + ;; + 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 + ;; + mingw32) + basic_machine=i386-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 + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + 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 + ;; + 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) basic_machine=powerpc-unknown + ;; + ppc-*) 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) + 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 + ;; + 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 + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-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 + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-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[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. + -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* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -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* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -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*) + # 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 + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -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 + ;; + # 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 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + 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 + ;; + -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/thirdparty/lzo/2.03/autoconf/depcomp b/thirdparty/lzo/2.03/autoconf/depcomp new file mode 100644 index 0000000..0f2bf43 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/depcomp @@ -0,0 +1,587 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2007-03-29.01 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/install-sh b/thirdparty/lzo/2.03/autoconf/install-sh new file mode 100644 index 0000000..a5897de --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/ltmain.sh b/thirdparty/lzo/2.03/autoconf/ltmain.sh new file mode 100644 index 0000000..bf25a58 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/ltmain.sh @@ -0,0 +1,6863 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + fi + ;; + * ) + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/thirdparty/lzo/2.03/autoconf/mdate-sh b/thirdparty/lzo/2.03/autoconf/mdate-sh new file mode 100644 index 0000000..757a5dc --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/mdate-sh @@ -0,0 +1,204 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2007-03-30.02 + +# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software +# Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No file. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification time of FILE. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume `unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A `ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named `Jan', or `Feb', etc. However, it's unlikely that `/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/missing b/thirdparty/lzo/2.03/autoconf/missing new file mode 100644 index 0000000..68e3a41 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/missing @@ -0,0 +1,365 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/mkinstalldirs b/thirdparty/lzo/2.03/autoconf/mkinstalldirs new file mode 100644 index 0000000..ef7e16f --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/mkinstalldirs @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/py-compile b/thirdparty/lzo/2.03/autoconf/py-compile new file mode 100644 index 0000000..865cda8 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/py-compile @@ -0,0 +1,144 @@ +#!/bin/sh +# py-compile - Compile a Python program + +scriptversion=2005-05-14.22 + +# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +if [ -z "$PYTHON" ]; then + PYTHON=python +fi + +basedir= +destdir= +files= +while test $# -ne 0; do + case "$1" in + --basedir) + basedir=$2 + if test -z "$basedir"; then + echo "$0: Missing argument to --basedir." 1>&2 + exit 1 + fi + shift + ;; + --destdir) + destdir=$2 + if test -z "$destdir"; then + echo "$0: Missing argument to --destdir." 1>&2 + exit 1 + fi + shift + ;; + -h|--h*) + cat <<\EOF +Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." + +Byte compile some python scripts FILES. Use --destdir to specify any +leading directory path to the FILES that you don't want to include in the +byte compiled file. Specify --basedir for any additional path information you +do want to be shown in the byte compiled file. + +Example: + py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "py-compile $scriptversion" + exit $? + ;; + *) + files="$files $1" + ;; + esac + shift +done + +if test -z "$files"; then + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 +fi + +# if basedir was given, then it should be prepended to filenames before +# byte compilation. +if [ -z "$basedir" ]; then + pathtrans="path = file" +else + pathtrans="path = os.path.join('$basedir', file)" +fi + +# if destdir was given, then it needs to be prepended to the filename to +# byte compile but not go into the compiled file. +if [ -z "$destdir" ]; then + filetrans="filepath = path" +else + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" +fi + +$PYTHON -c " +import sys, os, string, py_compile + +files = '''$files''' + +print 'Byte-compiling python modules...' +for file in string.split(files): + $pathtrans + $filetrans + if not os.path.exists(filepath) or not (len(filepath) >= 3 + and filepath[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + py_compile.compile(filepath, filepath + 'c', path) +print" || exit $? + +# this will fail for python < 1.5, but that doesn't matter ... +$PYTHON -O -c " +import sys, os, string, py_compile + +files = '''$files''' +print 'Byte-compiling python modules (optimized versions) ...' +for file in string.split(files): + $pathtrans + $filetrans + if not os.path.exists(filepath) or not (len(filepath) >= 3 + and filepath[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + py_compile.compile(filepath, filepath + 'o', path) +print" 2>/dev/null || : + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/autoconf/shtool b/thirdparty/lzo/2.03/autoconf/shtool new file mode 100644 index 0000000..aa354a0 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/shtool @@ -0,0 +1,3990 @@ +#!/bin/sh +## +## GNU shtool -- The GNU Portable Shell Tool +## Copyright (c) 1994-2006 Ralf S. Engelschall +## +## See http://www.gnu.org/software/shtool/ for more information. +## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. +## +## Version: 2.0.6 (19-Apr-2006) +## Contents: all available modules +## + +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +## USA, or contact Ralf S. Engelschall . +## +## NOTICE: Given that you include this file verbatim into your own +## source tree, you are justified in saying that it remains separate +## from your package, and that this way you are simply just using GNU +## shtool. So, in this situation, there is no requirement that your +## package itself is licensed under the GNU General Public License in +## order to take advantage of GNU shtool. +## + +## +## Usage: shtool [] [ [] []] +## +## Available commands: +## echo Print string with optional construct expansion +## mdate Pretty-print modification time of a file or dir +## table Pretty-print a field-separated list as a table +## prop Display progress with a running propeller +## move Move files with simultaneous substitution +## install Install a program, script or datafile +## mkdir Make one or more directories +## mkln Make link with calculation of relative paths +## mkshadow Make a shadow tree through symbolic links +## fixperm Fix file permissions inside a source tree +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations +## platform Platform Identification Utility +## arx Extended archive command +## slo Separate linker options by library class +## scpp Sharing C Pre-Processor +## version Maintain a version information file +## path Deal with program paths +## + +# maximum Bourne-Shell compatibility +if [ ".$ZSH_VERSION" != . ] && (emulate sh) >/dev/null 2>&1; then + # reconfigure zsh(1) + emulate sh + NULLCMD=: + alias -g '${1+"$@"}'='"$@"' +elif [ ".$BASH_VERSION" != . ] && (set -o posix) >/dev/null 2>&1; then + # reconfigure bash(1) + set -o posix +fi + +# maximum independence of NLS nuisances +for 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 $var=C; export $var) 2>&1`"); then + eval $var=C; export $var + else + unset $var + fi +done + +# initial command line handling +if [ $# -eq 0 ]; then + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 + exit 1 +fi +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.6 (19-Apr-2006)" + echo 'Copyright (c) 1994-2006 Ralf S. Engelschall ' + echo 'Report bugs to ' + echo '' + echo 'Usage: shtool [] [ [] []]' + echo '' + echo 'Available global :' + echo ' -v, --version display shtool version information' + echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' + echo '' + echo 'Available [] []:' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' + echo '' + exit 0 +fi +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.6 (19-Apr-2006)" + exit 0 +fi +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -oshtool all + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|rotate|tarball|subst|platform|arx|slo|scpp|version|path ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac +arg_spec="" +opt_spec="" +gen_tmpfile=no + +## +## DISPATCH INTO SCRIPT PROLOG +## + +case $tool in + echo ) + str_tool="echo" + str_usage="[-n|--newline] [-e|--expand] [ ...]" + arg_spec="0+" + opt_spec="n.e." + opt_alias="n:newline,e:expand" + opt_n=no + opt_e=no + ;; + mdate ) + str_tool="mdate" + str_usage="[-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits] [-f|--field-sep ] [-o|--order ] " + arg_spec="1=" + opt_spec="n.z.s.d.f:o:" + opt_alias="n:newline,z:zero,s:shorten,d:digits,f:field-sep,o:order" + opt_n=no + opt_z=no + opt_s=no + opt_d=no + opt_f=" " + opt_o="dmy" + ;; + table ) + str_tool="table" + str_usage="[-F|--field-sep ] [-w|--width ] [-c|--columns ] [-s|--strip ] ..." + arg_spec="1+" + opt_spec="F:w:c:s:" + opt_alias="F:field-sep,w:width,c:columns,s:strip" + opt_F=":" + opt_w=15 + opt_c=3 + opt_s=79 + ;; + prop ) + str_tool="prop" + str_usage="[-p|--prefix ]" + arg_spec="0=" + opt_spec="p:" + opt_alias="p:prefix" + opt_p="" + ;; + move ) + str_tool="move" + str_usage="[-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve] " + arg_spec="2=" + opt_spec="v.t.e.p." + opt_alias="v:verbose,t:trace,e:expand,p:preserve" + opt_v=no + opt_t=no + opt_e=no + opt_p=no + ;; + install ) + str_tool="install" + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " + arg_spec="1+" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" + ;; + mkdir ) + str_tool="mkdir" + str_usage="[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode ] [-o|--owner ] [-g|--group ] [ ...]" + arg_spec="1+" + opt_spec="t.f.p.m:o:g:" + opt_alias="t:trace,f:force,p:parents,m:mode,o:owner,g:group" + opt_t=no + opt_f=no + opt_p=no + opt_m="" + opt_o="" + opt_g="" + ;; + mkln ) + str_tool="mkln" + str_usage="[-t|--trace] [-f|--force] [-s|--symbolic] [ ...] " + arg_spec="2+" + opt_spec="t.f.s." + opt_alias="t:trace,f:force,s:symbolic" + opt_t=no + opt_f=no + opt_s=no + ;; + mkshadow ) + str_tool="mkshadow" + str_usage="[-v|--verbose] [-t|--trace] [-a|--all] " + arg_spec="2=" + opt_spec="v.t.a." + opt_alias="v:verbose,t:trace,a:all" + opt_v=no + opt_t=no + opt_a=no + ;; + fixperm ) + str_tool="fixperm" + str_usage="[-v|--verbose] [-t|--trace] [ ...]" + arg_spec="1+" + opt_spec="v.t." + opt_alias="v:verbose,t:trace" + opt_v=no + opt_t=no + ;; + rotate ) + str_tool="rotate" + str_usage="[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files ] [-s|--size ] [-c|--copy] [-r|--remove] [-a|--archive-dir ] [-z|--compress [:]] [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode ] [-o|--owner ] [-g|--group ] [-M|--migrate ] [-P|--prolog ] [-E|--epilog ] [...]" + arg_spec="1+" + opt_spec="v.t.f.n:s:c.r.a:z:b.d.p:o:g:m:M:P:E:" + opt_alias="v:verbose,t:trace,f:force,n:num-files,s:size,c:copy,r:remove,a:archive-dir,z:compress,b:background,d:delay,p:pad,o:owner,g:group,m:mode,M:migrate,P:prolog,E:epilog" + opt_v=no + opt_t=no + opt_f=no + opt_n=10 + opt_s="" + opt_c=no + opt_r=no + opt_a="" + opt_z="" + opt_b=no + opt_d=no + opt_p=1 + opt_o="" + opt_g="" + opt_m="" + opt_M="" + opt_P="" + opt_E="" + ;; + tarball ) + str_tool="tarball" + str_usage="[-t|--trace] [-v|--verbose] [-o|--output ] [-c|--compress ] [-d|--directory ] [-u|--user ] [-g|--group ] [-e|--exclude ] [ ...]" + gen_tmpfile=yes + arg_spec="1+" + opt_spec="t.v.o:c:d:u:g:e:" + opt_alias="t:trace,v:verbose,o:output,c:compress,d:directory,u:user,g:group,e:exclude" + opt_t=no + opt_v=no + opt_o="" + opt_c="" + opt_d="" + opt_u="" + opt_g="" + opt_e="CVS,\\.cvsignore,\\.svn,\\.[oa]\$" + ;; + subst ) + str_tool="subst" + str_usage="[-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ] [-e|--exec ] [-f|--file ] [] [...]" + gen_tmpfile=yes + arg_spec="0+" + opt_spec="v.t.n.w.q.s.i.b:e+f:" + opt_alias="v:verbose,t:trace,n:nop,w:warning,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file" + opt_v=no + opt_t=no + opt_n=no + opt_w=no + opt_q=no + opt_s=no + opt_i=no + opt_b="" + opt_e="" + opt_f="" + ;; + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no + ;; + arx ) + str_tool="arx" + str_usage="[-t|--trace] [-C|--command ] [ ...]" + arg_spec="2+" + opt_spec="t.C:" + opt_alias="t:trace,C:command" + opt_t=no + opt_C="ar" + ;; + slo ) + str_tool="slo" + str_usage="[-p|--prefix ] -- -L -l [-L -l ...]" + arg_spec="1+" + opt_spec="p:" + opt_alias="p:prefix" + opt_p="SLO_" + ;; + scpp ) + str_tool="scpp" + str_usage="[-v|--verbose] [-p|--preserve] [-f|--filter ] [-o|--output ] [-t|--template ] [-M|--mark ] [-D|--define ] [-C|--class ] [ ...]" + gen_tmpfile=yes + arg_spec="1+" + opt_spec="v.p.f+o:t:M:D:C:" + opt_alias="v:verbose,p:preserve,f:filter,o:output,t:template,M:mark,D:define,C:class" + opt_v=no + opt_p=no + opt_f="" + opt_o="lib.h" + opt_t="lib.h.in" + opt_M="%%MARK%%" + opt_D="cpp" + opt_C="intern" + ;; + version ) + str_tool="version" + str_usage="[-l|--language ] [-n|--name ] [-p|--prefix ] [-s|--set ] [-e|--edit] [-i|--increase ] [-d|--display ] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" + opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display" + opt_l="txt" + opt_n="unknown" + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" + ;; + path ) + str_tool="path" + str_usage="[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path ] [ ...]" + gen_tmpfile=yes + arg_spec="1+" + opt_spec="s.r.d.b.m.p:" + opt_alias="s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path" + opt_s=no + opt_r=no + opt_d=no + opt_b=no + opt_m=no + opt_p="$PATH" + ;; + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; + * ) + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 + ;; +esac + +## +## COMMON UTILITY CODE +## + +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + +# determine name of tool +if [ ".$tool" != . ]; then + # used inside shtool script + toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" + msgprefix="shtool:$tool" +else + # used as standalone script + toolcmd="$0" + toolcmdhelp="sh $0" + msgprefix="$str_tool" +fi + +# parse argument specification string +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` + +# parse option specification string +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` + +# interate over argument line +opt_PREV='' +while [ $# -gt 0 ]; do + # special option stops processing + if [ ".$1" = ".--" ]; then + shift + break + fi + + # determine option and argument + opt_ARG_OK=no + if [ ".$opt_PREV" != . ]; then + # merge previous seen option with argument + opt_OPT="$opt_PREV" + opt_ARG="$1" + opt_ARG_OK=yes + opt_PREV='' + else + # split argument into option and argument + case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; + -[a-zA-Z0-9]*) + eval `echo "x$1" |\ + sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ + -e 's/";\(.*\)$/"; opt_ARG="\1"/'` + ;; + -[a-zA-Z0-9]) + opt_OPT=`echo "x$1" | cut -c3-` + opt_ARG='' + ;; + *) + break + ;; + esac + fi + + # eat up option + shift + + # determine whether option needs an argument + eval "opt_MODE=\$opt_MODE_${opt_OPT}" + if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then + if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then + opt_PREV="$opt_OPT" + continue + fi + fi + + # process option + case $opt_MODE in + '.' ) + # boolean option + eval "opt_${opt_OPT}=yes" + ;; + ':' ) + # option with argument (multiple occurances override) + eval "opt_${opt_OPT}=\"\$opt_ARG\"" + ;; + '+' ) + # option with argument (multiple occurances append) + eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\"" + ;; + * ) + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 + exit 1 + ;; + esac +done +if [ ".$opt_PREV" != . ]; then + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 + exit 1 +fi + +# process help option +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" + exit 0 +fi + +# complain about incorrect number of arguments +case $arg_MODE in + '=' ) + if [ $# -ne $arg_NUMS ]; then + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + exit 1 + fi + ;; + '+' ) + if [ $# -lt $arg_NUMS ]; then + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + exit 1 + fi + ;; +esac + +# establish a temporary file on request +if [ ".$gen_tmpfile" = .yes ]; then + # create (explicitly) secure temporary directory + if [ ".$TMPDIR" != . ]; then + tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" + else + tmpdir="/tmp" + fi + tmpdir="$tmpdir/.shtool.$$" + ( umask 077 + rm -rf "$tmpdir" >/dev/null 2>&1 || true + mkdir "$tmpdir" >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 + exit 1 + fi + ) + + # create (implicitly) secure temporary file + tmpfile="$tmpdir/shtool.tmp" + touch "$tmpfile" +fi + +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -rf "$tmpdir" >/dev/null 2>&1 || true + fi + exit $rc +} + +## +## DISPATCH INTO SCRIPT BODY +## + +case $tool in + +echo ) + ## + ## echo -- Print string with optional construct expansion + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + text="$*" + + # check for broken escape sequence expansion + seo='' + bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" != .3 ]; then + bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" = .3 ]; then + seo='-E' + fi + fi + + # check for existing -n option (to suppress newline) + minusn='' + bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` + if [ ".$bytes" = .3 ]; then + minusn='-n' + fi + + # determine terminal bold sequence + term_bold='' + term_norm='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then + case $TERM in + # for the most important terminal types we directly know the sequences + xterm|xterm*|vt220|vt220*) + term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` + term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` + ;; + vt100|vt100*|cygwin) + term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` + term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` + ;; + # for all others, we try to use a possibly existing `tput' or `tcout' utility + * ) + paths=`echo $PATH | sed -e 's/:/ /g'` + for tool in tput tcout; do + for dir in $paths; do + if [ -r "$dir/$tool" ]; then + for seq in bold md smso; do # 'smso' is last + bold="`$dir/$tool $seq 2>/dev/null`" + if [ ".$bold" != . ]; then + term_bold="$bold" + break + fi + done + if [ ".$term_bold" != . ]; then + for seq in sgr0 me rmso init reset; do # 'reset' is last + norm="`$dir/$tool $seq 2>/dev/null`" + if [ ".$norm" != . ]; then + term_norm="$norm" + break + fi + done + fi + break + fi + done + if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then + break; + fi + done + ;; + esac + if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then + echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 + term_bold='' + term_norm='' + fi + fi + + # determine user name + username='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then + username="`(id -un) 2>/dev/null`" + if [ ".$username" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then + username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` + fi + if [ ".$username" = . ]; then + username="$LOGNAME" + if [ ".$username" = . ]; then + username="$USER" + if [ ".$username" = . ]; then + username="`(whoami) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$username" = . ]; then + username="`(who am i) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$username" = . ]; then + username='unknown' + fi + fi + fi + fi + fi + fi + fi + + # determine user id + userid='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then + userid="`(id -u) 2>/dev/null`" + if [ ".$userid" = . ]; then + userid="`(id -u ${username}) 2>/dev/null`" + if [ ".$userid" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then + userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'` + fi + if [ ".$userid" = . ]; then + userid=`(getent passwd ${username}) 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid=`(ypcat passwd) 2>/dev/null | + grep "^${username}:" | \ + sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$userid" = . ]; then + userid='?' + fi + fi + fi + fi + fi + fi + fi + + # determine (primary) group id + groupid='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then + groupid="`(id -g ${username}) 2>/dev/null`" + if [ ".$groupid" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then + groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'` + fi + if [ ".$groupid" = . ]; then + groupid=`(getent passwd ${username}) 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \ + sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'` + if [ ".$groupid" = . ]; then + groupid='?' + fi + fi + fi + fi + fi + fi + + # determine (primary) group name + groupname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then + groupname="`(id -gn ${username}) 2>/dev/null`" + if [ ".$groupname" = . ]; then + str="`(id) 2>/dev/null`" + if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then + groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'` + fi + if [ ".$groupname" = . ]; then + groupname=`(getent group) 2>/dev/null | \ + grep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname=`(ypcat group) 2>/dev/null | \ + grep "^[^:]*:[^:]*:${groupid}:" | \ + sed -e 's/:.*$//'` + if [ ".$groupname" = . ]; then + groupname='?' + fi + fi + fi + fi + fi + fi + + # determine host and domain name + hostname='' + domainname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then + hostname="`(uname -n) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$hostname" = . ]; then + hostname="`(hostname) 2>/dev/null |\ + awk '{ printf("%s", $1); }'`" + if [ ".$hostname" = . ]; then + hostname='unknown' + fi + fi + case $hostname in + *.* ) + domainname=".`echo $hostname | cut -d. -f2-`" + hostname="`echo $hostname | cut -d. -f1`" + ;; + esac + fi + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then + if [ ".$domainname" = . ]; then + if [ -f /etc/resolv.conf ]; then + domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\ + sed -e 's/.*domain//' \ + -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ + -e 's/^\.//' -e 's/^/./' |\ + awk '{ printf("%s", $1); }'`" + if [ ".$domainname" = . ]; then + domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\ + sed -e 's/.*search//' \ + -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ + -e 's/ .*//' -e 's/ .*//' \ + -e 's/^\.//' -e 's/^/./' |\ + awk '{ printf("%s", $1); }'`" + fi + fi + fi + fi + + # determine current time + time_day='' + time_month='' + time_year='' + time_monthname='' + if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then + time_day=`date '+%d'` + time_month=`date '+%m'` + time_year=`date '+%Y' 2>/dev/null` + if [ ".$time_year" = . ]; then + time_year=`date '+%y'` + case $time_year in + [5-9][0-9]) time_year="19$time_year" ;; + [0-4][0-9]) time_year="20$time_year" ;; + esac + fi + case $time_month in + 1|01) time_monthname='Jan' ;; + 2|02) time_monthname='Feb' ;; + 3|03) time_monthname='Mar' ;; + 4|04) time_monthname='Apr' ;; + 5|05) time_monthname='May' ;; + 6|06) time_monthname='Jun' ;; + 7|07) time_monthname='Jul' ;; + 8|08) time_monthname='Aug' ;; + 9|09) time_monthname='Sep' ;; + 10) time_monthname='Oct' ;; + 11) time_monthname='Nov' ;; + 12) time_monthname='Dec' ;; + esac + fi + + # expand special ``%x'' constructs + if [ ".$opt_e" = .yes ]; then + text=`echo $seo "$text" |\ + sed -e "s/%B/${term_bold}/g" \ + -e "s/%b/${term_norm}/g" \ + -e "s/%u/${username}/g" \ + -e "s/%U/${userid}/g" \ + -e "s/%g/${groupname}/g" \ + -e "s/%G/${groupid}/g" \ + -e "s/%h/${hostname}/g" \ + -e "s/%d/${domainname}/g" \ + -e "s/%D/${time_day}/g" \ + -e "s/%M/${time_month}/g" \ + -e "s/%Y/${time_year}/g" \ + -e "s/%m/${time_monthname}/g" 2>/dev/null` + fi + + # create output + if [ .$opt_n = .no ]; then + echo $seo "$text" + else + # the harder part: echo -n is best, because + # awk may complain about some \xx sequences. + if [ ".$minusn" != . ]; then + echo $seo $minusn "$text" + else + echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + fi + fi + + shtool_exit 0 + ;; + +mdate ) + ## + ## mdate -- Pretty-print modification time of a file or dir + ## Copyright (c) 1995-1997 Free Software Foundation, Inc. + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + fod="$1" + case "$opt_o" in + [dmy][dmy][dmy] ) + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 + shtool_exit 1 + ;; + esac + if [ ! -r "$fod" ]; then + echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 + shtool_exit 1 + fi + + # GNU ls changes its time format in response to the TIME_STYLE + # variable. Since we cannot assume "unset" works, revert this + # variable to its documented default. + if [ ".$TIME_STYLE" != . ]; then + TIME_STYLE=posix-long-iso + export TIME_STYLE + fi + + # get the extended ls output of the file or directory. + if /bin/ls -L /dev/null >/dev/null 2>&1; then + set - x`/bin/ls -L -l -d $fod` + else + set - x`/bin/ls -l -d $fod` + fi + + # The month is at least the fourth argument + # (3 shifts here, the next inside the loop). + shift; shift; shift + + # Find the month. Next argument is day, followed by the year or time. + month="" + while [ ".$month" = . ]; do + shift + case $1 in + Jan) month=January; nummonth=1 ;; + Feb) month=February; nummonth=2 ;; + Mar) month=March; nummonth=3 ;; + Apr) month=April; nummonth=4 ;; + May) month=May; nummonth=5 ;; + Jun) month=June; nummonth=6 ;; + Jul) month=July; nummonth=7 ;; + Aug) month=August; nummonth=8 ;; + Sep) month=September; nummonth=9 ;; + Oct) month=October; nummonth=10 ;; + Nov) month=November; nummonth=11 ;; + Dec) month=December; nummonth=12 ;; + esac + done + day="$2" + year="$3" + + # We finally have to deal with the problem that the "ls" output + # gives either the time of the day or the year. + case $year in + *:*) + this_year=`date '+%Y' 2>/dev/null` + if [ ".$this_year" = . ]; then + this_year=`date '+%y'` + case $this_year in + [5-9][0-9]) this_year="19$this_year" ;; + [0-4][0-9]) this_year="20$this_year" ;; + esac + fi + # for the following months of the last year the time notation + # is usually also used for files modified in the last year. + this_month=`date '+%m'` + if (expr $nummonth \> $this_month) >/dev/null; then + this_year=`expr $this_year - 1` + fi + year="$this_year" + ;; + esac + + # Optionally fill day and month with leeding zeros + if [ ".$opt_z" = .yes ]; then + case $day in + [0-9][0-9] ) ;; + [0-9] ) day="0$day" ;; + esac + case $nummonth in + [0-9][0-9] ) ;; + [0-9] ) nummonth="0$nummonth" ;; + esac + fi + + # Optionally use digits for month + if [ ".$opt_d" = .yes ]; then + month="$nummonth" + fi + + # Optionally shorten the month name to three characters + if [ ".$opt_s" = .yes ]; then + month=`echo $month | cut -c1-3` + fi + + # Output the resulting date string + echo dummy | awk '{ + for (i = 0; i < 3; i++) { + now = substr(order, 1, 1); + order = substr(order, 2); + if (now == "d") + out = day; + else if (now == "m") + out = month; + else if (now == "y") + out = year; + if (i < 2) + printf("%s%s", out, field); + else + printf("%s", out); + } + if (newline != "yes") + printf("\n"); + }' "day=$day" "month=$month" "year=$year" \ + "field=$opt_f" "order=$opt_o" "newline=$opt_n" + + shtool_exit 0 + ;; + +table ) + ## + ## table -- Pretty-print a field-separated list as a table + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + if [ $opt_c -gt 4 ]; then + echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 + shtool_exit 1 + fi + case "x$opt_F" in + x? ) ;; + * ) echo "$msgprefix:Error: Invalid separator (one char allowed only)" 1>&2; shtool_exit 1 ;; + esac + + # split the list into a table + list=` + IFS="$opt_F" + for entry in $*; do + if [ ".$entry" != . ]; then + echo "$entry" + fi + done |\ + awk " + BEGIN { list = \"\"; n = 0; } + { + list = list \\$1; + n = n + 1; + if (n < $opt_c) { + list = list \":\"; + } + if (n == $opt_c) { + list = list \"\\n\"; + n = 0; + } + } + END { print list; } + " + ` + + # format table cells and make sure table + # doesn't exceed maximum width + OIFS="$IFS" + IFS=' +' + for entry in $list; do + case $opt_c in + 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; + 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; + 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; + 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; + esac + done |\ + awk "{ + if (length(\$0) > $opt_s) { + printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); + } else { + print \$0; + } + }" + IFS="$OIFS" + + shtool_exit 0 + ;; + +prop ) + ## + ## prop -- Display progress with a running propeller + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + perl='' + for dir in `echo $PATH | sed -e 's/:/ /g'` .; do + if [ -f "$dir/perl" ]; then + perl="$dir/perl" + break + fi + done + if [ ".$perl" != . ]; then + # Perl is preferred because writing to STDERR in + # Perl really writes immediately as one would expect + $perl -e ' + @p = ("|","/","-","\\"); + $i = 0; + while () { + printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); + $i = 0 if ($i > 3); + } + printf(STDERR "\r%s \n", $ARGV[0]); + ' "$opt_p" + else + # But if Perl doesn't exists we use Awk even + # some Awk's buffer even the /dev/stderr writing :-( + awk ' + BEGIN { + split("|#/#-#\\", p, "#"); + i = 1; + } + { + printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; + if (i > 4) { i = 1; } + } + END { + printf("\r%s \n", prefix) > "/dev/stderr"; + } + ' "prefix=$opt_p" + fi + + shtool_exit 0 + ;; + +move ) + ## + ## move -- Move files with simultaneous substitution + ## Copyright (c) 1999-2006 Ralf S. Engelschall + ## + + src="$1" + dst="$2" + + # consistency checks + if [ ".$src" = . ] || [ ".$dst" = . ]; then + echo "$msgprefix:Error: Invalid arguments" 1>&2 + shtool_exit 1 + fi + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Error: Source and destination files are the same" 1>&2 + shtool_exit 1 + fi + expsrc="$src" + if [ ".$opt_e" = .yes ]; then + expsrc="`echo $expsrc`" + fi + if [ ".$opt_e" = .yes ]; then + if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then + echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 + shtool_exit 1 + fi + if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then + echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 + shtool_exit 1 + fi + if [ ".$expsrc" = ".$src" ]; then + echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 + shtool_exit 1 + fi + else + if [ ! -r "$src" ]; then + echo "$msgprefix:Error: Source not found: $src" 1>&2 + shtool_exit 1 + fi + fi + + # determine substitution patterns + if [ ".$opt_e" = .yes ]; then + srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` + dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` + fi + + # iterate over source(s) + for onesrc in $expsrc; do + if [ .$opt_e = .yes ]; then + onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` + else + onedst="$dst" + fi + errorstatus=0 + if [ ".$opt_v" = .yes ]; then + echo "$onesrc -> $onedst" + fi + if [ ".$opt_p" = .yes ]; then + if [ -r $onedst ]; then + if cmp -s $onesrc $onedst; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $onesrc" 1>&2 + fi + rm -f $onesrc || errorstatus=$? + else + if [ ".$opt_t" = .yes ]; then + echo "mv -f $onesrc $onedst" 1>&2 + fi + mv -f $onesrc $onedst || errorstatus=$? + fi + else + if [ ".$opt_t" = .yes ]; then + echo "mv -f $onesrc $onedst" 1>&2 + fi + mv -f $onesrc $onedst || errorstatus=$? + fi + else + if [ ".$opt_t" = .yes ]; then + echo "mv -f $onesrc $onedst" 1>&2 + fi + mv -f $onesrc $onedst || errorstatus=$? + fi + if [ $errorstatus -ne 0 ]; then + break; + fi + done + + shtool_exit $errorstatus + ;; + +install ) + ## + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2006 Ralf S. Engelschall + ## + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" + fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" + fi + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" + fi + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" + fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 + fi + + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dstpath="$1" + + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 + fi + + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 + fi + + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" + fi + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue + fi + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue + fi + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity + if [ ".$opt_v" = .yes ]; then + echo "$src -> $dst" 1>&2 + fi + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 + fi + cp $src $dsttmp || shtool_exit $? + else + if [ ".$opt_t" = .yes ]; then + echo "mv $src $dsttmp" 1>&2 + fi + mv $src $dsttmp || shtool_exit $? + fi + + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old + fi + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? + fi + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 + fi + chown $opt_o $dsttmp || shtool_exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? + fi + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? + fi + + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi + fi + fi + + # finally, install the file to the real destination + if [ $quick = yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dsttmp" 1>&2 + fi + rm -f $dsttmp + else + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst + fi + done + + shtool_exit 0 + ;; + +mkdir ) + ## + ## mkdir -- Make one or more directories + ## Copyright (c) 1996-2006 Ralf S. Engelschall + ## + + errstatus=0 + for p in ${1+"$@"}; do + # if the directory already exists... + if [ -d "$p" ]; then + if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then + echo "$msgprefix:Error: directory already exists: $p" 1>&2 + errstatus=1 + break + else + continue + fi + fi + # if the directory has to be created... + if [ ".$opt_p" = .no ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $p" 1>&2 + fi + mkdir $p || errstatus=$? + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $p" 1>&2 + fi + chown $opt_o $p || errstatus=$? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $p" 1>&2 + fi + chgrp $opt_g $p || errstatus=$? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $p" 1>&2 + fi + chmod $opt_m $p || errstatus=$? + fi + else + # the smart situation + set fnord `echo ":$p" |\ + sed -e 's/^:\//%/' \ + -e 's/^://' \ + -e 's/\// /g' \ + -e 's/^%/\//'` + shift + pathcomp='' + for d in ${1+"$@"}; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp="./$pathcomp" ;; + esac + if [ ! -d "$pathcomp" ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $pathcomp" 1>&2 + fi + mkdir $pathcomp || errstatus=$? + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $pathcomp" 1>&2 + fi + chown $opt_o $pathcomp || errstatus=$? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $pathcomp" 1>&2 + fi + chgrp $opt_g $pathcomp || errstatus=$? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $pathcomp" 1>&2 + fi + chmod $opt_m $pathcomp || errstatus=$? + fi + fi + pathcomp="$pathcomp/" + done + fi + done + + shtool_exit $errstatus + ;; + +mkln ) + ## + ## mkln -- Make link with calculation of relative paths + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + # determine source(s) and destination + args=$? + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" + shift + done + dst="$1" + if [ ! -d $dst ]; then + if [ $args -gt 2 ]; then + echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 + shtool_exit 1 + fi + fi + + # determine link options + lnopt="" + if [ ".$opt_f" = .yes ]; then + lnopt="$lnopt -f" + fi + if [ ".$opt_s" = .yes ]; then + lnopt="$lnopt -s" + fi + + # iterate over sources + for src in $srcs; do + # determine if one of the paths is an absolute path, + # because then we _have_ to use an absolute symlink + oneisabs=0 + srcisabs=0 + dstisabs=0 + case $src in + /* ) oneisabs=1; srcisabs=1 ;; + esac + case $dst in + /* ) oneisabs=1; dstisabs=1 ;; + esac + + # split source and destination into dir and base name + if [ -d $src ]; then + srcdir=`echo $src | sed -e 's;/*$;;'` + srcbase="" + else + srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` + srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` + fi + if [ -d $dst ]; then + dstdir=`echo $dst | sed -e 's;/*$;;'` + dstbase="" + else + dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` + dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` + fi + + # consistency check + if [ ".$dstdir" != . ]; then + if [ ! -d $dstdir ]; then + echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 + shtool_exit 1 + fi + fi + + # make sure the source is reachable from the destination + if [ $dstisabs = 1 ]; then + if [ $srcisabs = 0 ]; then + if [ ".$srcdir" = . ]; then + srcdir="`pwd | sed -e 's;/*$;;'`" + srcisabs=1 + oneisabs=1 + elif [ -d $srcdir ]; then + srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" + srcisabs=1 + oneisabs=1 + fi + fi + fi + + # split away a common prefix + prefix="" + if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then + prefix="$srcdir/" + srcdir="" + dstdir="" + else + while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do + presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` + predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` + if [ ".$presrc" != ".$predst" ]; then + break + fi + prefix="$prefix$presrc/" + srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` + dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` + done + fi + + # destination prefix is just the common prefix + dstpre="$prefix" + + # determine source prefix which is the reverse directory + # step-up corresponding to the destination directory + srcpre="" + + isroot=0 + if [ ".$prefix" = . ] || [ ".$prefix" = ./ ]; then + isroot=1 + fi + if [ $oneisabs = 0 ] || [ $isroot = 0 ]; then + pl="$dstdir/" + OIFS="$IFS"; IFS='/' + for pe in $pl; do + [ ".$pe" = . ] && continue + [ ".$pe" = .. ] && continue + srcpre="../$srcpre" + done + IFS="$OIFS" + else + if [ $srcisabs = 1 ]; then + srcpre="$prefix" + fi + fi + + # determine destination symlink name + if [ ".$dstbase" = . ]; then + if [ ".$srcbase" != . ]; then + dstbase="$srcbase" + else + dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` + fi + fi + + # now finalize source and destination directory paths + srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` + dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` + + # run the final link command + if [ ".$opt_t" = .yes ]; then + echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" + fi + eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase + done + + shtool_exit 0 + ;; + +mkshadow ) + ## + ## mkshadow -- Make a shadow tree through symbolic links + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + # source and destination directory + src=`echo "$1" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` + dst=`echo "$2" | sed -e 's:/$::' -e 's:^\./\(.\):\1:'` + + # check whether source exists + if [ ! -d $src ]; then + echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 + shtool_exit 1 + fi + + # determine if one of the paths is an absolute path, + # because then we have to use an absolute symlink + oneisabs=0 + case $src in + /* ) oneisabs=1 ;; + esac + case $dst in + /* ) oneisabs=1 ;; + esac + + # determine reverse directory for destination directory + dstrevdir='' + if [ $oneisabs = 0 ]; then + # derive reverse path from forward path + pwd=`pwd` + OIFS="$IFS"; IFS='/' + for pe in $dst; do + if [ "x$pe" = "x.." ]; then + OIFS2="$IFS"; IFS="$DIFS" + eval `echo "$pwd" |\ + sed -e 's:\([^/]*\)$:; dir="\1":' \ + -e 's:^\(.*\)/[^/]*;:pwd="\1";:'\ + -e 's:^;:pwd="";:'` + dstrevdir="$dir/$dstrevdir" + IFS="$OIFS2" + else + dstrevdir="../$dstrevdir" + fi + done + IFS="$OIFS" + else + src="`cd $src; pwd`"; + fi + + # create directory tree at destination + if [ ! -d $dst ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $dst" 1>&2 + fi + mkdir $dst + fi + if [ ".$opt_a" = .yes ]; then + DIRS=`cd $src; find . -type d -print |\ + sed -e '/^\.$/d' -e 's:^\./::'` + else + DIRS=`cd $src; find . -type d -print |\ + sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` + fi + for dir in $DIRS; do + if [ ".$opt_t" = .yes ]; then + echo "mkdir $dst/$dir" 1>&2 + fi + mkdir $dst/$dir + done + + # fill directory tree with symlinks to files + if [ ".$opt_a" = .yes ]; then + FILES="`cd $src; find . -depth -print |\ + sed -e 's/^\.\///'`" + else + FILES="`cd $src; find . -depth -print |\ + sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ + -e '/\.cvsignore$/d' -e '/\/CVS/d' \ + -e '/\/\.#/d' -e '/\.orig$/d' \ + -e 's/^\.\///'`" + fi + for file in $FILES; do + # don't use `-type f' above for find because of symlinks + if [ -d "$src/$file" ]; then + continue + fi + basename=`echo $file | sed -e 's:^.*/::'` + dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` + from=`echo "$src/$file" | sed -e 's/^\.\///'` + to="$dst/$dir$basename" + if [ $oneisabs = 0 ]; then + if [ ".$dir" != . ]; then + subdir=`echo $dir | sed -e 's:/$::'` + # derive reverse path from forward path + revdir='' + OIFS="$IFS"; IFS='/' + for pe in $subdir; do + revdir="../$revdir" + done + IFS="$OIFS" + # finalize from + from="$revdir$from" + fi + from="$dstrevdir$from" + fi + if [ ".$opt_v" = .yes ]; then + echo " $to" 1>&2 + fi + if [ ".$opt_t" = .yes ]; then + echo "ln -s $from $to" 1>&2 + fi + ln -s $from $to + done + + shtool_exit 0 + ;; + +fixperm ) + ## + ## fixperm -- Fix file permissions inside a source tree + ## Copyright (c) 1996-2006 Ralf S. Engelschall + ## + + paths="$*" + + # check whether the test command supports the -x option + if [ -x /bin/sh ] 2>/dev/null; then + minusx="-x" + else + minusx="-r" + fi + + # iterate over paths + for p in $paths; do + for file in `find $p -depth -print`; do + if [ -f $file ]; then + if [ $minusx $file ]; then + if [ ".$opt_v" = .yes ]; then + echo "-rwxr-xr-x $file" 2>&1 + fi + if [ ".$opt_t" = .yes ]; then + echo "chmod 755 $file" 2>&1 + fi + chmod 755 $file + else + if [ ".$opt_v" = .yes ]; then + echo "-rw-r--r-- $file" 2>&1 + fi + if [ ".$opt_t" = .yes ]; then + echo "chmod 644 $file" 2>&1 + fi + chmod 644 $file + fi + continue + fi + if [ -d $file ]; then + if [ ".$opt_v" = .yes ]; then + echo "drwxr-xr-x $file" 2>&1 + fi + if [ ".$opt_t" = .yes ]; then + echo "chmod 755 $file" 2>&1 + fi + chmod 755 $file + continue + fi + if [ ".$opt_v" = .yes ]; then + echo "?????????? $file" 2>&1 + fi + done + done + + shtool_exit 0 + ;; + +rotate ) + ## + ## rotate -- Logfile rotation + ## Copyright (c) 2001-2006 Ralf S. Engelschall + ## + + # make sure we have at least one file to rotate + if [ ".$opt_n" = .0 ]; then + echo "$msgprefix:Error: invalid argument \`$opt_n' to option -n." 1>&2 + shtool_exit 1 + fi + + # canonicalize -s option argument + if [ ".$opt_s" != . ]; then + if [ ".`expr $opt_s : '[0-9]*$'`" != .0 ]; then + : + elif [ ".`expr $opt_s : '[0-9]*[Kk]$'`" != .0 ]; then + opt_s=`expr $opt_s : '\([0-9]*\)[Kk]$'` + opt_s=`expr $opt_s \* 1024` + elif [ ".`expr $opt_s : '[0-9]*[Mm]$'`" != .0 ]; then + opt_s=`expr $opt_s : '\([0-9]*\)[Mm]$'` + opt_s=`expr $opt_s \* 1048576` # 1024*1024 + elif [ ".`expr $opt_s : '[0-9]*[Gg]$'`" != .0 ]; then + opt_s=`expr $opt_s : '\([0-9]*\)[Gg]$'` + opt_s=`expr $opt_s \* 1073741824` # 1024*1024*1024 + else + echo "$msgprefix:Error: invalid argument \`$opt_s' to option -s." 1>&2 + shtool_exit 1 + fi + fi + + # option -d/-z consistency + if [ ".$opt_d" = .yes ] && [ ".$opt_z" = . ]; then + echo "$msgprefix:Error: option -d requires option -z." 1>&2 + shtool_exit 1 + fi + + # make sure target directory exists + if [ ".$opt_a" != . ]; then + if [ ! -d $opt_a ]; then + if [ ".$opt_f" = .no ]; then + echo "$msgprefix:Error: archive directory \`$opt_a' does not exist." 1>&2 + shtool_exit 1 + fi + mkdir $opt_a || shtool_exit $? + chmod 755 $opt_a + fi + if [ ! -w $opt_a ]; then + echo "$msgprefix:Error: archive directory \`$opt_a' not writable." 1>&2 + shtool_exit 1 + fi + fi + + # determine compression approach + if [ ".$opt_z" != . ]; then + comp_lvl="$opt_z" + comp_prg="" + case $comp_lvl in + *:* ) eval `echo $comp_lvl |\ + sed -e 's%^\(.*\):\(.*\)$%comp_prg="\1"; comp_lvl="\2"%'` ;; + esac + + # compression level consistency + case $comp_lvl in + [0-9] ) + ;; + * ) echo "$msgprefix:Error: invalid compression level \`$comp_lvl'" 1>&2 + shtool_exit 1 + ;; + esac + + # determine a suitable compression tool + if [ ".$comp_prg" = . ]; then + # check whether the test command supports the -x option + if [ -x /bin/sh ] 2>/dev/null; then + minusx="-x" + else + minusx="-r" + fi + # search for tools in $PATH + paths="`echo $PATH |\ + sed -e 's%/*:%:%g' -e 's%/*$%%' \ + -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ + -e 's/:/ /g'`" + for prg in bzip2 gzip compress; do + for path in $paths; do + if [ $minusx "$path/$prg" ] && [ ! -d "$path/$prg" ]; then + comp_prg="$prg" + break + fi + done + if [ ".$comp_prg" != . ]; then + break + fi + done + if [ ".$comp_prg" = . ]; then + echo "$msgprefix:Error: no suitable compression tool found in \$PATH" 1>&2 + shtool_exit 1 + fi + fi + + # determine standard compression extension + # and make sure it is a known tool + case $comp_prg in + */bzip2 | bzip2 ) comp_ext="bz2" comp_lvl="-$comp_lvl" ;; + */gzip | gzip ) comp_ext="gz" comp_lvl="-$comp_lvl" ;; + */compress | compress ) comp_ext="Z"; comp_lvl="" ;; + * ) echo "$msgprefix:Error: tool \`$comp_prg' is not a known compression tool" 1>&2 + shtool_exit 1 + ;; + esac + comp_suf=".$comp_ext" + fi + + # iterate over all given logfile arguments + for file in $*; do + # make sure the logfile exists + if [ ! -f $file ]; then + if [ ".$opt_f" = .yes ]; then + continue + fi + echo "$msgprefix:Error: logfile \`$file' not found" 1>&2 + shtool_exit 1 + fi + + # determine log directory (where original logfile is placed) + ldir="." + case $file in + */* ) eval `echo $file | sed -e 's%^\(.*\)/\([^/]*\)$%ldir="\1"; file="\2";%'` ;; + esac + + # determine archive directory (where rotated logfiles are placed) + adir="$ldir" + if [ ".$opt_a" != . ]; then + case "$opt_a" in + /* | ./* ) adir="$opt_a" ;; + * ) adir="$ldir/$opt_a" ;; + esac + fi + + # optionally take logfile size into account + if [ ".$opt_s" != . ]; then + # determine size of logfile + set -- `env -i /bin/ls -l "$ldir/$file" | sed -e "s;$ldir/$file;;" |\ + sed -e 's; -> .*$;;' -e 's;[ ][ ]*; ;g'` + n=`expr $# - 3` + eval "size=\`echo \${$n}\`" + + # skip logfile if size is still too small + if [ $size -lt $opt_s ]; then + if [ ".$opt_v" = .yes ]; then + echo "$ldir/$file: still too small in size -- skipping" + fi + continue + fi + fi + + # verbosity + if [ ".$opt_v" = .yes ]; then + echo "rotating $ldir/$file" + fi + + # execute prolog + if [ ".$opt_P" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "$opt_P" + fi + eval $opt_P + [ $? -ne 0 ] && shtool_exit $? + fi + + # kick away out-rotated logfile + n=`expr $opt_n - 1` + n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n` + if [ -f "${adir}/${file}.${n}${comp_suf}" ]; then + # optionally migrate away the out-rotated logfile + if [ ".$opt_M" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "$opt_M ${adir}/${file}.${n}${comp_suf}" + fi + eval "$opt_M ${adir}/${file}.${n}${comp_suf}" + [ $? -ne 0 ] && shtool_exit $? + fi + # finally get rid of the out-rotated logfile + if [ ".$opt_t" = .yes ]; then + echo "rm -f ${adir}/${file}.${n}${comp_suf}" + fi + rm -f ${adir}/${file}.${n}${comp_suf} || shtool_exit $? + fi + + # rotate already archived logfiles + while [ $n -gt 0 ]; do + m=$n + n=`expr $n - 1` + n=`echo dummy | awk "{ printf(\"%0${opt_p}d\", n); }" n=$n` + if [ $n -eq 0 ] && [ ".$opt_d" = .yes ]; then + # special case: first rotation file under delayed compression situation + if [ ! -f "${adir}/${file}.${n}" ]; then + continue + fi + + # compress file (delayed) + if [ ".$opt_b" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "mv ${adir}/${file}.${n} ${adir}/${file}.${m}" + fi + mv ${adir}/${file}.${n} ${adir}/${file}.${m} || shtool_exit $? + if [ ".$opt_t" = .yes ]; then + echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${m} >${adir}/${file}.${m}${comp_suf}; rm -f ${adir}/${file}.${m}) &" + fi + ( ${comp_prg} ${comp_lvl} \ + <${adir}/${file}.${m} \ + >${adir}/${file}.${m}${comp_suf} || shtool_exit $? + rm -f ${adir}/${file}.${m} || shtool_exit $? + ) /dev/null 2>&1 & + else + if [ ".$opt_t" = .yes ]; then + echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${m}${comp_suf}" + fi + ${comp_prg} ${comp_lvl} \ + <${adir}/${file}.${n} \ + >${adir}/${file}.${m}${comp_suf} || shtool_exit $? + if [ ".$opt_t" = .yes ]; then + echo "rm -f ${adir}/${file}.${n}" + fi + rm -f ${adir}/${file}.${n} || shtool_exit $? + fi + + # fix file attributes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o ${adir}/${file}.${m}${comp_suf}" + fi + chown $opt_o ${adir}/${file}.${m}${comp_suf} || shtool_exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g ${adir}/${file}.${m}${comp_suf}" + fi + chgrp $opt_g ${adir}/${file}.${m}${comp_suf} || shtool_exit $? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m ${adir}/${file}.${m}${comp_suf}" + fi + chmod $opt_m ${adir}/${file}.${m}${comp_suf} || shtool_exit $? + fi + else + # standard case: second and following rotation file + if [ ! -f "${adir}/${file}.${n}${comp_suf}" ]; then + continue + fi + if [ ".$opt_t" = .yes ]; then + echo "mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf}" + fi + mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf} || shtool_exit $? + fi + done + + # move away current logfile + if [ ".$opt_c" = .yes ]; then + # approach: copy[+truncate] + if [ ".$opt_t" = .yes ]; then + echo "cp -p ${ldir}/${file} ${adir}/${file}.${n}" + fi + cp -p ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $? + if [ ".$opt_r" = .no ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp /dev/null ${ldir}/${file}" + fi + cp /dev/null ${ldir}/${file} || shtool_exit $? + fi + else + # approach: move[+touch] + if [ ".$opt_t" = .yes ]; then + echo "mv ${ldir}/${file} ${adir}/${file}.${n}" + fi + mv ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $? + if [ ".$opt_r" = .no ]; then + if [ ".$opt_t" = .yes ]; then + echo "touch ${ldir}/${file}" + fi + touch ${ldir}/${file} || shtool_exit $? + # fix file attributes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o ${ldir}/${file}" + fi + chown $opt_o ${ldir}/${file} || shtool_exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g ${ldir}/${file}" + fi + chgrp $opt_g ${ldir}/${file} || shtool_exit $? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m ${ldir}/${file}" + fi + chmod $opt_m ${ldir}/${file} || shtool_exit $? + fi + fi + fi + + # regular compression step + if [ ".$opt_z" != . ] && [ ".$opt_d" = .no ]; then + # compress file + if [ ".$opt_b" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "(${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}; rm -f ${adir}/${file}.${n}) &" + fi + ( ${comp_prg} ${comp_lvl} \ + <${adir}/${file}.${n} \ + >${adir}/${file}.${n}${comp_suf} || shtool_exit $? + rm -f ${adir}/${file}.${n} || shtool_exit $? + ) /dev/null 2>&1 & + else + if [ ".$opt_t" = .yes ]; then + echo "${comp_prg} ${comp_lvl} <${adir}/${file}.${n} >${adir}/${file}.${n}${comp_suf}" + fi + ${comp_prg} ${comp_lvl} \ + <${adir}/${file}.${n} \ + >${adir}/${file}.${n}${comp_suf} || shtool_exit $? + if [ ".$opt_t" = .yes ]; then + echo "rm -f ${opt_a}${file}.${n}" + fi + rm -f ${adir}/${file}.${n} || shtool_exit $? + fi + + # fix file attributes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o ${adir}/${file}.${n}${comp_suf}" + fi + chown $opt_o ${adir}/${file}.${n}${comp_suf} || shtool_exit $? + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g ${adir}/${file}.${n}${comp_suf}" + fi + chgrp $opt_g ${adir}/${file}.${n}${comp_suf} || shtool_exit $? + fi + if [ ".$opt_m" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m ${adir}/${file}.${n}${comp_suf}" + fi + chmod $opt_m ${adir}/${file}.${n}${comp_suf} || shtool_exit $? + fi + fi + + # execute epilog + if [ ".$opt_E" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "$opt_E" + fi + eval $opt_E + [ $? -ne 0 ] && shtool_exit $? + fi + done + + shtool_exit 0 + ;; + +tarball ) + ## + ## tarball -- Roll distribution tarballs + ## Copyright (c) 1999-2006 Ralf S. Engelschall + ## + + srcs="$*" + + # check whether the test command supports the -x option + if [ -x /bin/sh ] 2>/dev/null; then + minusx="-x" + else + minusx="-r" + fi + + # find the tools + paths="`echo $PATH |\ + sed -e 's%/*:%:%g' -e 's%/*$%%' \ + -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ + -e 's/:/ /g'`" + for spec in find:gfind,find tar:gtar,tar tardy:tardy,tarcust; do + prg=`echo $spec | sed -e 's/:.*$//'` + tools=`echo $spec | sed -e 's/^.*://'` + eval "prg_${prg}=''" + # iterate over tools + for tool in `echo $tools | sed -e 's/,/ /g'`; do + # iterate over paths + for path in $paths; do + if [ $minusx "$path/$tool" ] && [ ! -d "$path/$tool" ]; then + eval "prg_${prg}=\"$path/$tool\"" + break + fi + done + eval "val=\$prg_${prg}" + if [ ".$val" != . ]; then + break + fi + done + done + + # expand source paths + exclude='' + for pat in `echo $opt_e | sed 's/,/ /g'`; do + exclude="$exclude | grep -v '$pat'" + done + if [ ".$opt_t" = .yes ]; then + echo "cp /dev/null $tmpfile.lst" 1>&2 + fi + cp /dev/null $tmpfile.lst + for src in $srcs; do + if [ -d $src ]; then + if [ ".$opt_t" = .yes ]; then + echo "(cd $src && $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude >>$tmpfile.lst" 1>&2 + fi + (cd $src && $prg_find . -type f -depth -print) |\ + sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude >>$tmpfile.lst + else + if [ ".$opt_t" = .yes ]; then + echo "echo $src >>$tmpfile.lst" 1>&2 + fi + echo $src >>$tmpfile.lst + fi + done + sort <$tmpfile.lst >$tmpfile.lst.n + mv $tmpfile.lst.n $tmpfile.lst + if [ ".$opt_v" = .yes ]; then + cat $tmpfile.lst | sed -e 's/^/ /' 1>&2 + fi + + # determine tarball file and directory name + if [ ".$opt_o" != . ]; then + tarfile="$opt_o" + if [ ".$opt_d" != . ]; then + tarname="$opt_d" + else + tarname=`echo $tarfile | sed -e 's/\.tar.*$//' -e 's;.*/\([^/]*\)$;\1;'` + fi + else + if [ ".$opt_d" != . ]; then + tarname="$opt_d" + elif [ -d "$from" ]; then + tarname=`echo $from | sed -e 's;.*/\([^/]*\)$;\1;'` + else + tarname="out" + fi + tarfile="$tarname.tar" + fi + + # roll the tarball + compress='' + if [ ".$opt_c" != . ]; then + compress="| $opt_c" + fi + if [ ".$prg_tardy" != . ]; then + # the elegant hackers way + tardy_opt="--prefix=$tarname" + tardy_opt="$tardy_opt --user_number=0 --group_number=0" # security! + if [ ".$opt_u" != . ]; then + tardy_opt="$tardy_opt --user_name=$opt_u" + fi + if [ ".$opt_g" != . ]; then + tardy_opt="$tardy_opt --group_name=$opt_g" + fi + if [ ".$opt_t" = .yes ]; then + echo "cat $tmpfile.lst | xargs $prg_tar cf - | $prg_tardy $tardy_opt | cat $compress >$tmpfile.out" 1>&2 + fi + cat $tmpfile.lst |\ + xargs $prg_tar cf - |\ + $prg_tardy $tardy_opt |\ + eval cat $compress >$tmpfile.out + if [ ".$opt_t" = .yes ]; then + echo "cp $tmpfile.out $tarfile" 1>&2 + fi + cp $tmpfile.out $tarfile + else + # the portable standard way + if [ ".$opt_t" = .yes ]; then + echo "mkdir $tmpdir/$tarname" 1>&2 + fi + mkdir $tmpdir/$tarname || shtool_exit 1 + if [ ".$opt_t" = .yes ]; then + echo "cat $tmpfile.lst | xargs $prg_tar cf - | (cd $tmpdir/$tarname && $prg_tar xf -)" 1>&2 + fi + cat $tmpfile.lst |\ + xargs $prg_tar cf - |\ + (cd $tmpdir/$tarname && $prg_tar xf -) + if [ ".$opt_u" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1" 2>&1 + fi + chown -R $opt_u $tmpdir/$tarname >/dev/null 2>&1 ||\ + echo "$msgprefix:Warning: cannot set user name \`$opt_u' (would require root privileges)" + fi + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1" 2>&1 + fi + chgrp -R $opt_g $tmpdir/$tarname >/dev/null 2>&1 ||\ + echo "$msgprefix:Warning: cannot set group name \`$opt_g' (would require root privileges)" + fi + if [ ".$opt_t" = .yes ]; then + echo "(cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress >$tmpfile.out" 1>&2 + fi + (cd $tmpdir && $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) |\ + eval cat $compress >$tmpfile.out + if [ ".$opt_t" = .yes ]; then + echo "cp $tmpfile.out $tarfile" 1>&2 + fi + cp $tmpfile.out $tarfile + if [ ".$opt_t" = .yes ]; then + echo "rm -rf $tmpdir/$tarname" 1>&2 + fi + rm -rf $tmpdir/$tarname + fi + + # cleanup + if [ ".$opt_t" = .yes ]; then + echo "rm -f $tmpfile.lst $tmpfile.out" 1>&2 + fi + rm -f $tmpfile.lst $tmpfile.out + + shtool_exit 0 + ;; + +subst ) + ## + ## subst -- Apply sed(1) substitution operations + ## Copyright (c) 2001-2006 Ralf S. Engelschall + ## + + # remember optional list of file(s) + files="$*" + files_num="$#" + + # parameter consistency check + if [ $# -eq 0 ] && [ ".$opt_b" != . ]; then + echo "$msgprefix:Error: option -b cannot be applied to stdin" 1>&2 + shtool_exit 1 + fi + if [ $# -eq 0 ] && [ ".$opt_s" = .yes ]; then + echo "$msgprefix:Error: option -s cannot be applied to stdin" 1>&2 + shtool_exit 1 + fi + + # build underlying sed(1) command + sedcmd='sed' + if [ ".$opt_e" != . ]; then + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sedcmd="$sedcmd -e '$e'" + done + elif [ ".$opt_f" != . ]; then + if [ ! -f $opt_f ]; then + echo "$msgprefix:Error: command file \`$opt_f' not found or not a regular file" 1>&2 + shtool_exit 1 + fi + sedcmd="$sedcmd -f '$opt_f'" + else + echo "$msgprefix:Error: either -e option(s) or -f option required" 1>&2 + shtool_exit 1 + fi + + # determine extension for original file + orig=".orig" + if [ ".$opt_b" != . ]; then + orig="$opt_b" + fi + + # apply sed(1) operation(s) + if [ ".$files" != . ]; then + # apply operation(s) to files + substdone=no + for file in $files; do + test ".$file" = . && continue + if [ ! -f $file ]; then + echo "$msgprefix:Warning: file \`$file' not found or not a regular file" 1>&2 + continue + fi + + # handle interactive mode + if [ ".$opt_i" = .yes ]; then + eval "$sedcmd <$file >$file.new" + skip=no + if cmp $file $file.new >/dev/null 2>&1; then + rm -f $file.new + skip=yes + else + (diff -U1 $file $file.new >$tmpfile) 2>/dev/null + if [ ".`cat $tmpfile`" = . ]; then + (diff -C1 $file $file.new >$tmpfile) 2>/dev/null + if [ ".`cat $tmpfile`" = . ]; then + echo "$msgprefix:Warning: unable to show difference for file \`$file'" 1>&2 + cp /dev/null $tmpfile + fi + fi + rm -f $file.new + cat $tmpfile + echo dummy | awk '{ printf("%s", TEXT); }' TEXT=">>> Apply [Y/n]: " + read input + if [ ".$input" != .Y ] &&\ + [ ".$input" != .y ] &&\ + [ ".$input" != . ]; then + skip=yes + fi + fi + if [ ".$skip" = .yes ]; then + if [ ".$opt_v" = .yes ]; then + echo "file \`$file' -- skipped" 1>&2 + fi + continue + fi + fi + + # apply sed(1) operation(s) + if [ ".$opt_v" = .yes ]; then + echo "patching \`$file'" 1>&2 + fi + if [ ".$opt_t" = .yes ]; then + echo "\$ cp -p $file $file$orig" + echo "\$ chmod u+w $file" + echo "\$ $sedcmd <$file$orig >$file" + fi + if [ ".$opt_n" = .no ]; then + cp -p $file $file$orig + chmod u+w $file >/dev/null 2>&1 || true + eval "$sedcmd <$file$orig >$file" + fi + + # optionally fix timestamp + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "\$ touch -r $file$orig $file" + fi + if [ ".$opt_n" = .no ]; then + touch -r $file$orig $file + fi + fi + + # optionally check whether any content change actually occurred + if [ ".$opt_q" = .no ]; then + if cmp $file$orig $file >/dev/null 2>&1; then + if [ ".$opt_w" = .yes ]; then + echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2 + fi + else + substdone=yes + fi + fi + + # optionally remove preserved original file + if [ ".$opt_b" = . ]; then + if [ ".$opt_t" = .yes ]; then + echo "\$ rm -f $file$orig" + fi + if [ ".$opt_n" = .no ]; then + rm -f $file$orig + fi + fi + done + if [ ".$opt_q" = .no ] && [ ".$opt_w" = .no ]; then + if [ ".$substdone" = .no ]; then + if [ ".$files_num" = .1 ]; then + echo "$msgprefix:Warning: substitution resulted in no content change on file \"$file\"" 1>&2 + else + echo "$msgprefix:Warning: substitution resulted in no content change on any file" 1>&2 + fi + fi + fi + else + # apply operation(s) to stdin/stdout + if [ ".$opt_v" = .yes ]; then + echo "patching " 1>&2 + fi + if [ ".$opt_t" = .yes ]; then + echo "\$ $sedcmd" + fi + if [ ".$opt_n" = .no ]; then + eval "$sedcmd" + fi + fi + + shtool_exit 0 + ;; + +platform ) + ## + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2006 Ralf S. Engelschall + ## + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 + exit 1 + ;; + esac + fi + + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' + + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT="${AP}" + if [ ".${AT}" = ".iX86" ]; then + case "`(/sbin/sysctl -n hw.model) 2>&1`" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + esac + fi + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac + ;; + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac + ;; + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" + ;; + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` + fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | env -i sort | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + ubuntu ) n="Ubuntu[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="SuSE[ Linux]" ;; + mandrake*|mandriva ) n="Mandriva[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" + ;; + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) + AT="iX86" + case "`(/bin/isainfo -k) 2>&1`" in + amd64 ) AT="AMD64" ;; + esac + ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4[uv] ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac + ;; + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" + ;; + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" + ;; + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" + ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + 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 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; + esac + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; + esac + ;; + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" + ;; + + # IBM AIX + *:AIX:* ) + cpu_arch=rs6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=powerpc + fi + elif [ -d /QOpenSys ]; then + # IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment) + cpu_arch=powerpc + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` + else + os_level="`uname -v`.`uname -r`" + fi + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + ST="[IBM ]${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac + ;; + + # Apple MacOS X Darwin + *:Darwin:* ) + AT=`uname -p` + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + AC="${AP}" + case "${AC}" in + i?86 ) AC="iX86" ;; + esac + ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" + SP="${ST}" + SC="4.4BSD/Mach3" + ;; + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" + ;; + + esac + + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;��;g" \ + -e "s;/;%%;g" \ + -e "s;��;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" + ;; + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;��;g" \ + -e "s;/;%%;g" \ + -e "s;��;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" + ;; + esac + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;��;g" \ + -e "s;/;%%;g" \ + -e "s;��;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; + esac + done + + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` + fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" + else + echo "$output" + fi + + shtool_exit 0 + ;; + +arx ) + ## + ## arx -- Extended archive command + ## Copyright (c) 1999-2006 Ralf S. Engelschall + ## + + ar_prg="$opt_C" + ar_cmd="$1"; shift + archive="$1"; shift + files="$*" + + # walk through the file list and expand archives members + ar_tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` + nfiles='' + if [ ".$files" != . ]; then + for file in $files; do + if [ ! -f $file ]; then + echo "$msgprefix:Error: input file not found: $file" 1>&2 + shtool_exit 1 + fi + case $file in + *.a ) + if [ ! -d $ar_tmpdir ]; then + if [ ".$opt_t" = .yes ]; then + echo "mkdir $ar_tmpdir" 1>&2 + fi + mkdir $ar_tmpdir + fi + case $ar_tmpdir in + .arx ) + from="../$file" + ;; + * ) + dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` + base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` + from="`cd $dir; pwd`/$base" + ;; + esac + if [ ".$opt_t" = .yes ]; then + echo "(cd $ar_tmpdir && $ar_prg x $from)" 1>&2 + fi + (cd $ar_tmpdir && eval $ar_prg x $from) + if [ $? -ne 0 ]; then + echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 + shtool_exit 1 + fi + for member in - `eval $ar_prg t $file | sed -e '/_\.SYMDEF/d'`; do + [ ".$member" = .- ] && continue + nfiles="$nfiles $ar_tmpdir/$member" + done + ;; + * ) + nfiles="$nfiles $file" + ;; + esac + done + fi + + # run the final archive command + if [ ".$opt_t" = .yes ]; then + echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 + fi + eval $ar_prg $ar_cmd $archive $nfiles + if [ $? -ne 0 ]; then + echo "$msgprefix:Error: archive command failed" 1>&2 + shtool_exit $? + fi + + # cleanup and die gracefully + if [ -d $ar_tmpdir ]; then + if [ ".$opt_t" = .yes ]; then + echo "rm -rf $ar_tmpdir" 1>&2 + fi + rm -rf $ar_tmpdir + fi + + shtool_exit 0 + ;; + +slo ) + ## + ## slo -- Separate linker options by library class + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + DIFS="$IFS" + + # parse out -L and -l options from command line + DIRS='' + LIBS='' + ARGV='' + optprev='' + for opt + do + # concatenate with previous option if exists + if [ ".$optprev" != . ]; then + opt="${optprev}${opt}"; + optprev='' + fi + # remember options for arg if used stand-alone + if [ ".$opt" = ".-L" ] || [ ".$opt" = ".-l" ]; then + optprev="$opt" + continue; + fi + # split argument into option plus option argument + arg="`echo $opt | cut -c3-`" + opt="`echo $opt | cut -c1-2`" + # store into containers + case $opt in + -L) DIRS="$DIRS:$arg" ;; + -l) LIBS="$LIBS:$arg" ;; + *) ARGV="$ARGV $opt" ;; + esac + done + + # set linker default directories + DIRS_DEFAULT='/lib:/usr/lib' + if [ ".$LD_LIBRARY_PATH" != . ]; then + DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" + fi + + # sort options by class + DIRS_OBJ='' + LIBS_OBJ='' + DIRS_PIC='' + LIBS_PIC='' + DIRS_DSO='' + LIBS_DSO='' + + # for each library... + OIFS="$IFS"; IFS=':' + for lib in $LIBS; do + [ ".$lib" = . ] && continue + + found='no' + found_indefdir='no' + found_type='' + found_dir='' + + # for each directory... + OIFS2="$IFS"; IFS=":$DIFS" + for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do + [ ".$dir" = . ] && continue + [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes + [ ! -d $dir ] && continue + + # search the file + OIFS3="$IFS"; IFS="$DIFS" + for file in '' `cd $dir && env -i /bin/ls lib${lib}.* 2>/dev/null`; do + [ ".$file" = . ] && continue + case $file in + *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) + found=yes; + found_type=DSO; + break + ;; + *.lo|*.la ) + found=yes; + found_type=PIC + ;; + *.a ) + if [ ".$found_type" = . ]; then + found=yes + found_type=OBJ + fi + ;; + esac + done + IFS="$OIFS3" + if [ ".$found" = .yes ]; then + found_dir="$dir" + break + fi + done + IFS="$OIFS2" + + if [ ".$found" = .yes ]; then + if [ ".$found_indefdir" != .yes ]; then + eval "dirlist=\"\${DIRS_${found_type}}:\"" + case "$dirlist" in + *:$found_dir:* ) ;; + * ) eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" ;; + esac + eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" + else + eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" + fi + else + LIBS_OBJ="$LIBS_OBJ:$lib" + #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" + #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 + #echo "slo:Warning: $dirlist" 1>&1 + fi + done + IFS="$OIFS" + + # also pass-through unused dirs even if it's useless + OIFS="$IFS"; IFS=':' + for dir in $DIRS; do + dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" + case "$dirlist" in + *:$dir:* ) ;; + * ) DIRS_OBJ="$DIRS_OBJ:$dir" ;; + esac + done + IFS="$OIFS" + + # reassemble the options but separated by type + for type in OBJ PIC DSO; do + OIFS="$IFS"; IFS=':' + eval "libs=\"\$LIBS_${type}\"" + opts='' + for lib in $libs; do + [ ".$lib" = . ] && continue + opts="$opts -l$lib" + done + eval "LIBS_${type}=\"$opts\"" + + eval "dirs=\"\$DIRS_${type}\"" + opts='' + for dir in $dirs; do + [ ".$dir" = . ] && continue + opts="$opts -L$dir" + done + eval "DIRS_${type}=\"$opts\"" + IFS="$OIFS" + done + + # give back results + for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do + eval "val=\"\$${var}\"" + val="`echo $val | sed -e 's/^ *//'`" + echo "${opt_p}${var}=\"${val}\"" + done + + shtool_exit 0 + ;; + +scpp ) + ## + ## scpp -- Sharing C Pre-Processor + ## Copyright (c) 1999-2006 Ralf S. Engelschall + ## + + srcs="$*" + output="${opt_o}.n" + + # find a reasonable Awk + awk='' + paths=`echo $PATH |\ + sed -e 's%/*:%:%g' -e 's%/$%%' \ + -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ + -e 's/:/ /g'` + for name in gawk nawk awk; do + for path in $paths; do + if [ -r "$path/$name" ]; then + awk="$path/$name" + break + fi + done + if [ ".$awk" != . ]; then + break + fi + done + if [ ".$awk" = . ]; then + echo "$msgprefix:Error: cannot find a reasonable Awk" 1>&2 + shtool_exit 1 + fi + + # parse source file(s) + if [ ".$opt_v" = .yes ]; then + echo "Parsing:" | $awk '{ printf("%s", $0); }' 1>&2 + fi + for src in $srcs; do + if [ ".$opt_v" = .yes ]; then + echo $src | $awk '{ printf(" %s", $0); }' 1>&2 + fi + if [ ".$opt_f" != . ]; then + inputcmd="sed" + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_f; IFS="$OIFS" + for e + do + inputcmd="$inputcmd -e '$e'" + done + inputcmd="$inputcmd '$src'" + else + inputcmd="cat '$src'" + fi + eval $inputcmd |\ + $awk ' + BEGIN { + ln = 0; + fln = 0; + level = 0; + mode = ""; + store = ""; + } + { + ln++; + } + /^#if.*/ { + level++; + } + /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { + if ($2 == define) { + mode = "D"; + printf("D:#line %d \"%s\"\n", ln, src); + next; + } + } + /^#endif.*/ { + level--; + if (mode == "D" && level == 0) { + mode = ""; + next; + } + } + /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ { + if ($1 == class) { + printf("V:#line %d \"%s\"\n", ln, src); + printf("V:%s\n", $0); + printf("J:%s\n", $0); + next; + } + } + /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { + if ($1 == class) { + printf("V:#line %d \"%s\"\n", ln, src); + printf("V:%s\n", $0); + printf("J:%s\n", $0); + next; + } + } + /^[a-zA-Z_][a-zA-Z0-9_]*/ { + if ($1 == class) { + fln = ln; + store = $0; + mode = "F"; + next; + } + } + /^\{ *$/ { + if (mode == "F") { + printf("F:#line %d \"%s\"\n", fln, src); + printf("F:%s;\n", store); + printf("I:%s;\n", store); + store = ""; + mode = ""; + next; + } + } + { + if (mode == "D") + printf("D:%s\n", $0); + else if (mode == "F") + store = store " " $0; + } + ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile + done + if [ ".$opt_v" = .yes ]; then + echo "" 1>&2 + fi + + # start generating output header + echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output + echo "#line 1 \"$opt_t\"" >>$output + sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ + sed -e "/^${opt_M} *\$/d" >>$output + + # merge in the define blocks + grep '^D:' $tmpfile | sed -e 's/^D://' >>$output + + # generate standard prolog + echo "#line 1 \"_ON_THE_FLY_\"" >>$output + echo "" >>$output + echo "/* make sure the scpp source extensions are skipped */" >>$output + echo "#define $opt_D 0" >>$output + echo "#define $opt_C /**/" >>$output + + # generate namespace hiding for variables + echo "" >>$output + echo "/* move intern variables to hidden namespace */" >>$output + grep '^J:' $tmpfile | sed >>$output \ + -e 's/^J://' \ + -e 's/ */ /g' \ + -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ + -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ + -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ + -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' + + # generate namespace hiding for functions + echo "" >>$output + echo "/* move intern functions to hidden namespace */" >>$output + grep '^I:' $tmpfile | sed >>$output \ + -e 's/^I://' \ + -e 's/\([ (]\) */\1/g' \ + -e 's/ *\([),]\)/\1/g' \ + -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' + + # generate prototypes for variables + echo "" >>$output + echo "/* prototypes for intern variables */" >>$output + grep '^V:' $tmpfile | sed >>$output \ + -e 's/^V://' \ + -e 's/ */ /g' \ + -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ + -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ + -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ + -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ + -e 's/ ;/;/g' \ + -e "s/^$opt_C /extern /" + + # generate prototypes for functions + echo "" >>$output + echo "/* prototypes for intern functions */" >>$output + grep '^F:' $tmpfile | sed >>$output \ + -e 's/^F://' \ + -e 's/\([ (]\) */\1/g' \ + -e 's/ *\([),]\)/\1/g' \ + -e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \ + -e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \ + -e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \ + -e 's/\([ (]\) */\1/g' \ + -e 's/ *\([),]\)/\1/g' \ + -e "s/^$opt_C /extern /" + + # finish generating output header + n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ + wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` + echo "#line $n \"$opt_t\"" >>$output + sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ + sed -e "/^${opt_M} *\$/d" >>$output + + # create final output file + if [ -f $opt_o ]; then + if [ ".$opt_p" = .yes ]; then + grep -v '^#line' $opt_o >$tmpfile.o + grep -v '^#line' $output >$tmpfile.n + out_old="$tmpfile.o" + out_new="$tmpfile.n" + else + out_old="$opt_o" + out_new="$output" + fi + if cmp -s $out_old $out_new; then + : + else + cp $output $opt_o + fi + else + cp $output $opt_o + fi + rm -f $output + rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 + + shtool_exit 0 + ;; + +version ) + ## + ## version -- Maintain a version information file + ## Copyright (c) 1994-2006 Ralf S. Engelschall + ## + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + shtool_exit 1 + fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + elif [ -r $file ]; then + # determine triple from given file + eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc + fi + + # determine new version in batch + if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + shtool_exit 1 + ;; + esac + tim=calc + fi + + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + fi + + # determine hexadecimal and libtool value of version + case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=15; levnum=255 ;; # snapshots are special + esac + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` + + # determine date + if [ ".$tim" = .calc ]; then + day=`date '+%d'` + month=`date '+%m'` + year=`date '+%Y' 2>/dev/null` + if [ ".$time_year" = . ]; then + year=`date '+%y'` + case $year in + [5-9][0-9]) year="19$year" ;; + [0-4][0-9]) year="20$year" ;; + esac + fi + case $month in + 1|01) month='Jan' ;; + 2|02) month='Feb' ;; + 3|03) month='Mar' ;; + 4|04) month='Apr' ;; + 5|05) month='May' ;; + 6|06) month='Jun' ;; + 7|07) month='Jul' ;; + 8|08) month='Aug' ;; + 9|09) month='Sep' ;; + 10) month='Oct' ;; + 11) month='Nov' ;; + 12) month='Dec' ;; + esac + tim="${day}-${month}-${year}" + fi + + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in + short ) + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" + ;; + libtool ) + echo "${ltv}" + ;; + hex ) + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + shtool_exit 1 + ;; + esac + else + # update the version file + + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" + + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`util_upper "$file" | tr './%+' '____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`util_upper "$prefix"` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + m4 ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "m4_define([v_hex], [${vHex}])" + echo >>$file "m4_define([v_short], [${vShort}])" + echo >>$file "m4_define([v_long], [${vLong}])" + echo >>$file "m4_define([v_tex], [${vTeX}])" + echo >>$file "m4_define([v_gnu], [${vGNU}])" + echo >>$file "m4_define([v_web], [${vWeb}])" + echo >>$file "m4_define([v_sccs], [${vSCCS}])" + echo >>$file "m4_define([v_rcs], [${vRCS}])" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "our \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + shtool_exit 1 + ;; + esac + fi + + shtool_exit 0 + ;; + +path ) + ## + ## path -- Deal with program paths + ## Copyright (c) 1998-2006 Ralf S. Engelschall + ## + + namelist="$*" + + # check whether the test command supports the -x option + if [ -x /bin/sh ] 2>/dev/null; then + minusx="-x" + else + minusx="-r" + fi + + # split path string + paths="`echo $opt_p |\ + sed -e 's/^:/.:/' \ + -e 's/::/:.:/g' \ + -e 's/:$/:./' \ + -e 's/:/ /g'`" + + # SPECIAL REQUEST + # translate forward to reverse path + if [ ".$opt_r" = .yes ]; then + if [ "x$namelist" = "x." ]; then + rp='.' + else + rp='' + for pe in `IFS="$IFS/"; echo $namelist`; do + rp="../$rp" + done + fi + echo $rp | sed -e 's:/$::' + shtool_exit 0 + fi + + # SPECIAL REQUEST + # strip out directory or base name + if [ ".$opt_d" = .yes ]; then + echo "$namelist" |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' + shtool_exit 0 + fi + if [ ".$opt_b" = .yes ]; then + echo "$namelist" |\ + sed -e 's;.*/\([^/]*\)$;\1;' + shtool_exit 0 + fi + + # MAGIC SITUATION + # Perl Interpreter (perl) + if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then + rm -f $tmpfile >/dev/null 2>&1 + touch $tmpfile + found=0 + pc=99 + for dir in $paths; do + dir=`echo $dir | sed -e 's;/*$;;'` + nc=99 + for name in perl perl5 miniperl; do + if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then + perl="$dir/$name" + pv=`$perl -e 'printf("%.3f", $]);'` + echo "$pv:$pc:$nc:$perl" >>$tmpfile + found=1 + fi + nc=`expr $nc - 1` + done + pc=`expr $pc - 1` + done + if [ $found = 1 ]; then + perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`" + rm -f $tmpfile >/dev/null 2>&1 + echo "$perl" + shtool_exit 0 + fi + rm -f $tmpfile >/dev/null 2>&1 + shtool_exit 1 + fi + + # MAGIC SITUATION + # C pre-processor (cpp) + if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then + echo >$tmpfile.c "#include " + echo >>$tmpfile.c "Syntax Error" + # 1. try the standard cc -E approach + cpp="${CC-cc} -E" + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # 2. try the cc -E approach and GCC's -traditional-ccp option + cpp="${CC-cc} -E -traditional-cpp" + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # 3. try a standalone cpp command in path and lib dirs + for path in $paths /lib /usr/lib /usr/local/lib; do + path=`echo $path | sed -e 's;/*$;;'` + if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then + cpp="$path/cpp" + break + fi + done + if [ ".$cpp" != . ]; then + (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out + my_error=`grep -v '^ *+' $tmpfile.out` + if [ ".$my_error" != . ]; then + # ok, we gave up... + cpp='' + fi + fi + fi + fi + rm -f $tmpfile >/dev/null 2>&1 + rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1 + if [ ".$cpp" != . ]; then + echo "$cpp" + shtool_exit 0 + fi + shtool_exit 1 + fi + + # STANDARD SITUATION + # iterate over names + for name in $namelist; do + # iterate over paths + for path in $paths; do + path=`echo $path | sed -e 's;/*$;;'` + if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then + if [ ".$opt_s" != .yes ]; then + echo "$path/$name" + fi + shtool_exit 0 + fi + done + done + + shtool_exit 1 + ;; + +esac + +shtool_exit 0 + diff --git a/thirdparty/lzo/2.03/autoconf/ylwrap b/thirdparty/lzo/2.03/autoconf/ylwrap new file mode 100644 index 0000000..bb58968 --- /dev/null +++ b/thirdparty/lzo/2.03/autoconf/ylwrap @@ -0,0 +1,221 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2007-11-22.22 + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, +# 2007 Free Software Foundation, Inc. +# +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception 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 file is maintained in Automake, please report +# bugs to or send patches to +# . + +case "$1" in + '') + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; +esac + + +# The input. +input="$1" +shift +case "$input" in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input="`pwd`/$input" + ;; +esac + +pairlist= +while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift +done + +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; +esac + +# FIXME: add hostname here for parallel makes that run commands on +# other machines. But that might take us over the 14-char limit. +dirname=ylwrap$$ +trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +mkdir $dirname || exit 1 + +cd $dirname + +case $# in + 0) "$prog" "$input" ;; + *) "$prog" "$@" "$input" ;; +esac +ret=$? + +if test $ret -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" + else + if test $from = "y.tab.h"; then + from="y_tab.h" + fi + fi + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # We do not want to overwrite a header file if it hasn't + # changed. This avoid useless recompilations. However the + # parser itself (the first file) should always be updated, + # because it is the destination of the .y.c rule in the + # Makefile. Divert the output of all other files to a temporary + # file so we can compare them to existing versions. + if test $first = no; then + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" + fi + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + FROM=`echo "$from" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + TARGET=`echo "$2" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ + -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + + # Check whether header files must be updated. + if test $first = no; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else + echo updating "$2" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + ret=1 + fi + fi + shift + shift + first=no + done +else + ret=$? +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/thirdparty/lzo/2.03/config.hin b/thirdparty/lzo/2.03/config.hin new file mode 100644 index 0000000..3b9c8a4 --- /dev/null +++ b/thirdparty/lzo/2.03/config.hin @@ -0,0 +1,364 @@ +/* config.hin. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `access' function. */ +#undef HAVE_ACCESS + +/* Define to 1 if you have the `alloca' function. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the `atexit' function. */ +#undef HAVE_ATEXIT + +/* Define to 1 if you have the `atoi' function. */ +#undef HAVE_ATOI + +/* Define to 1 if you have the `atol' function. */ +#undef HAVE_ATOL + +/* Define to 1 if you have the `chmod' function. */ +#undef HAVE_CHMOD + +/* Define to 1 if you have the `chown' function. */ +#undef HAVE_CHOWN + +/* Define to 1 if you have the `clock_getcpuclockid' function. */ +#undef HAVE_CLOCK_GETCPUCLOCKID + +/* Define to 1 if you have the `clock_getres' function. */ +#undef HAVE_CLOCK_GETRES + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the `ctime' function. */ +#undef HAVE_CTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the `difftime' function. */ +#undef HAVE_DIFFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `fstat' function. */ +#undef HAVE_FSTAT + +/* Define to 1 if you have the `getenv' function. */ +#undef HAVE_GETENV + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getrusage' function. */ +#undef HAVE_GETRUSAGE + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `gmtime' function. */ +#undef HAVE_GMTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isatty' function. */ +#undef HAVE_ISATTY + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `localtime' function. */ +#undef HAVE_LOCALTIME + +/* Define to 1 if you have the `longjmp' function. */ +#undef HAVE_LONGJMP + +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memcmp' function. */ +#undef HAVE_MEMCMP + +/* Define to 1 if you have the `memcpy' function. */ +#undef HAVE_MEMCPY + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have the `mktime' function. */ +#undef HAVE_MKTIME + +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `mprotect' function. */ +#undef HAVE_MPROTECT + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the `qsort' function. */ +#undef HAVE_QSORT + +/* Define to 1 if you have the `raise' function. */ +#undef HAVE_RAISE + +/* Define to 1 if you have the `rmdir' function. */ +#undef HAVE_RMDIR + +/* Define to 1 if you have the `setjmp' function. */ +#undef HAVE_SETJMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SETJMP_H + +/* Define to 1 if you have the `signal' function. */ +#undef HAVE_SIGNAL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the `stricmp' function. */ +#undef HAVE_STRICMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strnicmp' function. */ +#undef HAVE_STRNICMP + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `time' function. */ +#undef HAVE_TIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the `umask' function. */ +#undef HAVE_UMASK + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if your machine is big endian. */ +#undef LZO_ABI_BIG_ENDIAN + +/* Define to 1 if your machine is little endian. */ +#undef LZO_ABI_LITTLE_ENDIAN + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* The size of a `dev_t', as computed by sizeof. */ +#undef SIZEOF_DEV_T + +/* The size of a `double', as computed by sizeof. */ +#undef SIZEOF_DOUBLE + +/* The size of a `float', as computed by sizeof. */ +#undef SIZEOF_FLOAT + +/* The size of a `fpos_t', as computed by sizeof. */ +#undef SIZEOF_FPOS_T + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of a `intmax_t', as computed by sizeof. */ +#undef SIZEOF_INTMAX_T + +/* The size of a `intptr_t', as computed by sizeof. */ +#undef SIZEOF_INTPTR_T + +/* The size of a `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of a `long double', as computed by sizeof. */ +#undef SIZEOF_LONG_DOUBLE + +/* The size of a `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of a `mode_t', as computed by sizeof. */ +#undef SIZEOF_MODE_T + +/* The size of a `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* The size of a `ptrdiff_t', as computed by sizeof. */ +#undef SIZEOF_PTRDIFF_T + +/* The size of a `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of a `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of a `ssize_t', as computed by sizeof. */ +#undef SIZEOF_SSIZE_T + +/* The size of a `time_t', as computed by sizeof. */ +#undef SIZEOF_TIME_T + +/* The size of a `uintmax_t', as computed by sizeof. */ +#undef SIZEOF_UINTMAX_T + +/* The size of a `uintptr_t', as computed by sizeof. */ +#undef SIZEOF_UINTPTR_T + +/* The size of a `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* The size of a `__int16', as computed by sizeof. */ +#undef SIZEOF___INT16 + +/* The size of a `__int32', as computed by sizeof. */ +#undef SIZEOF___INT32 + +/* The size of a `__int64', as computed by sizeof. */ +#undef SIZEOF___INT64 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `long' if does not define. */ +#undef off_t + +/* Define to `long' if does not define. */ +#undef ptrdiff_t + +/* Define to `unsigned' if does not define. */ +#undef size_t diff --git a/thirdparty/lzo/2.03/configure b/thirdparty/lzo/2.03/configure new file mode 100644 index 0000000..b77c3ad --- /dev/null +++ b/thirdparty/lzo/2.03/configure @@ -0,0 +1,31807 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for lzo 2.03. +# +# Report bugs to . +# +# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer. +# All Rights Reserved. +# This configure script may be copied, distributed and modified under the +# terms of the GNU General Public License; see COPYING for more details. +# +# 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 + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +# 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='lzo' +PACKAGE_TARNAME='lzo' +PACKAGE_VERSION='2.03' +PACKAGE_STRING='lzo 2.03' +PACKAGE_BUGREPORT='markus@oberhumer.com' + +ac_unique_file="src/lzo_init.c" +ac_default_prefix=/usr/local +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#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 target target_cpu target_vendor target_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LZO_USE_ASM_TRUE LZO_USE_ASM_FALSE LZO_ASM_VPATH LZO_CPPFLAGS LZO_EXTRA_CPPFLAGS LZO_CFLAGS LZO_EXTRA_CFLAGS configure_CPPFLAGS configure_CFLAGS 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 +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP +ac_env_F77_set=${F77+set} +ac_env_F77_value=$F77 +ac_cv_env_F77_set=${F77+set} +ac_cv_env_F77_value=$F77 +ac_env_FFLAGS_set=${FFLAGS+set} +ac_env_FFLAGS_value=$FFLAGS +ac_cv_env_FFLAGS_set=${FFLAGS+set} +ac_cv_env_FFLAGS_value=$FFLAGS + +# +# 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 lzo 2.03 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 + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of lzo 2.03:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-largefile omit support for large files + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-static[=PKGS] + build static libraries [default=yes] + --enable-shared[=PKGS] + build shared libraries [default=no] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-asm disable assembly versions + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] + include additional configurations [automatic] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +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 . +_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 +lzo configure 2.03 +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. + +Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer. +All Rights Reserved. +This configure script may be copied, distributed and modified under the +terms of the GNU General Public License; see COPYING for more details. +_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 lzo $as_me 2.03, 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ echo "$as_me:$LINENO: Configuring LZO $PACKAGE_VERSION" >&5 +echo "$as_me: Configuring LZO $PACKAGE_VERSION" >&6;} + +ac_aux_dir= +for ac_dir in autoconf $srcdir/autoconf; 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 autoconf $srcdir/autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&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/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +if test -z "$ac_abs_top_srcdir"; then + ac_builddir=. + +if test . != .; then + ac_dir_suffix=/`echo . | 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=.;; +*) + case . in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir=.;; + *) ac_abs_builddir=`pwd`/.;; + 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 + +fi +if test -r .Conf.settings1; then + . ./.Conf.settings1 +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &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 +#include +#include +#include +/* 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 +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 + +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 to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 +_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 to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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 +_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 whether the C preprocessor needs special flags" >&5 +echo $ECHO_N "checking whether the C preprocessor needs special flags... $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 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul) +# include "your C preprocessor is broken 1" +#elif (0xffffu == 0xfffffffful) +# include "your C preprocessor is broken 2" +#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX) +# include "your C preprocessor is broken 3" +#endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF + +mfx_save_CPPFLAGS=$CPPFLAGS +mfx_tmp=ERROR +for mfx_arg in "" -no-cpp-precomp +do + CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS" + 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 + mfx_tmp=$mfx_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 +CPPFLAGS=$mfx_save_CPPFLAGS +rm -f conftest.$ac_ext conftest.$ac_objext +case x$mfx_tmp in + x) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + xERROR) + echo "$as_me:$LINENO: result: ERROR" >&5 +echo "${ECHO_T}ERROR" >&6 + { { echo "$as_me:$LINENO: error: your C preprocessor is broken - for details see config.log" >&5 +echo "$as_me: error: your C preprocessor is broken - for details see config.log" >&2;} + { (exit 1); exit 1; }; } + ;; + *) + echo "$as_me:$LINENO: result: $mfx_tmp" >&5 +echo "${ECHO_T}$mfx_tmp" >&6 + CPPFLAGS="$mfx_tmp $CPPFLAGS" + ;; +esac + + +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 + + +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#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 + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#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_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + 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 + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +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 +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 () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_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 + ac_cv_c_bigendian=no +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_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define LZO_ABI_BIG_ENDIAN 1 +_ACEOF + ;; + no) + +cat >>confdefs.h <<\_ACEOF +#define LZO_ABI_LITTLE_ENDIAN 1 +_ACEOF + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + + +# Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" + +fi; +if test "$enable_largefile" != no; then + + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +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 + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext + CC="$CC -n32" + 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_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_file_offset_bits=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +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 + 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +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_sys_file_offset_bits=64; 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 + break +done +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF + +fi +rm -f conftest* + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_large_files=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +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 + 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +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_sys_large_files=1; 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 + break +done +fi +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF + +fi +rm -f conftest* +fi + + +am__api_version="1.9" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='lzo' + VERSION='2.03' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +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_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + 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_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + ac_config_headers="$ac_config_headers config.h:config.hin" + + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi; + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=no +fi; + + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi; + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 + +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 + + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 +NM="$lt_cv_path_NM" + +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4831 "configure"' > conftest.$ac_ext + 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 + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 + + 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 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 + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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 + +fi +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + + +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 +#include +#include +#include + +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 + +_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 + +_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 +#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 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 markus@oberhumer.com ## +## ----------------------------------- ## +_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 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +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_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# 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 &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_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_cxx_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_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +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 +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_cxx_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_cxx_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 + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +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 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_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 +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_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_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_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 +_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_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_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 \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + 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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # 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_F77="$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 +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran +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_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_F77" && break +done + + F77=$ac_ct_F77 +fi + + +# Provide some information about the compiler. +echo "$as_me:6188:" \ + "checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_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_f77_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_f77_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_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_f77_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_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_f77_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +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 + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + 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); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 +else + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 +fi + +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="ar" + 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_AR" && ac_cv_prog_ac_ct_AR="false" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +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 + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +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_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + 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_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + +fi; +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi; +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +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 + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7249: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7253: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7517: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7521: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7621: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7625: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + 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 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 9088 "configure"' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + ;; + *) + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + 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 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 +if test "${ac_cv_func_shl_load+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 shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* 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 shl_load (); +/* 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_shl_load) || defined (__stub___shl_load) +choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shl_load; + ; + 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_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shl_load=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $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 shl_load (); +int +main () +{ +shl_load (); + ; + 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_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=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_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 +if test "${ac_cv_func_dlopen+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 dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* 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 (); +/* 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_dlopen) || defined (__stub___dlopen) +choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != 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_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_dlopen=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + 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 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $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_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svld_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_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $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 dld_link (); +int +main () +{ +dld_link (); + ; + 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_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_dld_link=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_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + 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); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + 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); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which library types will actually be built +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags or --without-tags was given. +if test "${with_tags+set}" = set; then + withval="$with_tags" + tagnames="$withval" +fi; + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + 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 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_cxx_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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 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_cxx_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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12416: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12420: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12520: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12524: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6 +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 13056 "configure"' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6 + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 + +echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14111: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14115: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14215: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14219: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_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_f77_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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_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_f77_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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6 +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 15662 "configure"' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6 + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16437: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16441: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16705: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16709: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16809: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16813: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + 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 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + 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 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; 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_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6 +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + 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); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 + ;; + esac + fi + ;; +esac + +echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 18276 "configure"' > conftest.$ac_ext + 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 + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6 + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + + +# /*********************************************************************** +# // Checks for assembler +# ************************************************************************/ + +# Check whether --enable-asm or --disable-asm was given. +if test "${enable_asm+set}" = set; then + enableval="$enable_asm" + +fi; + +asm_arch= +asm_dir= +asm_msg_amd64=no +asm_msg_i386=no + +case $host_cpu in + amd64 | x86_64) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64" ;; + i?86) asm_arch="i386"; asm_dir="asm/i386/src_gas" ;; + *) enable_asm=no ;; +esac +LZO_ASM_VPATH= + +echo "$as_me:$LINENO: checking whether to build assembly versions" >&5 +echo $ECHO_N "checking whether to build assembly versions... $ECHO_C" >&6 +if test "X$enable_asm" != Xno; then +mfx_compile_S='${CC-cc} -c conftest.S 1>&5' +cat > conftest.S <&5 + (eval $mfx_compile_S) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if { 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 + enable_asm=yes + eval asm_msg_$asm_arch="'yes [$asm_dir]'" + LZO_ASM_VPATH=":$ac_abs_top_srcdir/$asm_dir" + fi +fi +if test "X$enable_asm" = Xno; then + echo "configure: failed program was:" >&5 + cat conftest.S >&5 +fi +rm -rf conftest* +fi +echo "$as_me:$LINENO: result: $enable_asm" >&5 +echo "${ECHO_T}$enable_asm" >&6 + + + +if test "X$enable_asm" != Xno; then + LZO_USE_ASM_TRUE= + LZO_USE_ASM_FALSE='#' +else + LZO_USE_ASM_TRUE='#' + LZO_USE_ASM_FALSE= +fi + + + + +# /*********************************************************************** +# // Checks for header files +# ************************************************************************/ + + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+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 +#include +#include + +int +main () +{ +if ((struct tm *) 0) +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_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.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 markus@oberhumer.com ## +## ----------------------------------- ## +_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 + + +if test "X$ac_cv_header_limits_h" != Xyes; then + { { echo "$as_me:$LINENO: error: header not found" >&5 +echo "$as_me: error: header not found" >&2;} + { (exit 1); exit 1; }; } +fi + +echo "$as_me:$LINENO: checking whether limits.h is sane" >&5 +echo $ECHO_N "checking whether limits.h is sane... $ECHO_C" >&6 +if test "${mfx_cv_header_sane_limits_h+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 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul) +# if defined(__APPLE__) && defined(__GNUC__) +# error "your preprocessor is broken - use compiler option -no-cpp-precomp" +# else +# include "your preprocessor is broken" +# endif +#endif +#define MFX_0xffff 0xffff +#define MFX_0xffffffffL 4294967295ul +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# include "error CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) +# include "error UCHAR_MAX 1" +#endif +#if !defined(USHRT_MAX) +# include "error USHRT_MAX 1" +#endif +#if !defined(UINT_MAX) +# include "error UINT_MAX 1" +#endif +#if !defined(ULONG_MAX) +# include "error ULONG_MAX 1" +#endif +#if !defined(SHRT_MAX) +# include "error SHRT_MAX 1" +#endif +#if !defined(INT_MAX) +# include "error INT_MAX 1" +#endif +#if !defined(LONG_MAX) +# include "error LONG_MAX 1" +#endif +#if (UCHAR_MAX < 1) +# include "error UCHAR_MAX 2" +#endif +#if (USHRT_MAX < 1) +# include "error USHRT_MAX 2" +#endif +#if (UINT_MAX < 1) +# include "error UINT_MAX 2" +#endif +#if (ULONG_MAX < 1) +# include "error ULONG_MAX 2" +#endif +#if (UCHAR_MAX < 0xff) +# include "error UCHAR_MAX 3" +#endif +#if (USHRT_MAX < MFX_0xffff) +# include "error USHRT_MAX 3" +#endif +#if (UINT_MAX < MFX_0xffff) +# include "error UINT_MAX 3" +#endif +#if (ULONG_MAX < MFX_0xffffffffL) +# include "error ULONG_MAX 3" +#endif +#if (USHRT_MAX > UINT_MAX) +# include "error USHRT_MAX vs UINT_MAX" +#endif +#if (UINT_MAX > ULONG_MAX) +# include "error UINT_MAX vs ULONG_MAX" +#endif + +int +main () +{ + +#if (USHRT_MAX == MFX_0xffff) +{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; } +#elif (USHRT_MAX >= MFX_0xffff) +{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; } +#endif +#if (UINT_MAX == MFX_0xffff) +{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; } +#elif (UINT_MAX >= MFX_0xffff) +{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; } +#endif +#if (ULONG_MAX == MFX_0xffff) +{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; } +#elif (ULONG_MAX >= MFX_0xffff) +{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; } +#endif +#if !defined(_CRAY1) /* CRAY PVP systems */ +#if (USHRT_MAX == MFX_0xffffffffL) +{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; } +#elif (USHRT_MAX >= MFX_0xffffffffL) +{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; } +#endif +#endif /* _CRAY1 */ +#if (UINT_MAX == MFX_0xffffffffL) +{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; } +#elif (UINT_MAX >= MFX_0xffffffffL) +{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; } +#endif +#if (ULONG_MAX == MFX_0xffffffffL) +{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; } +#elif (ULONG_MAX >= MFX_0xffffffffL) +{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; } +#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 + mfx_cv_header_sane_limits_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +mfx_cv_header_sane_limits_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $mfx_cv_header_sane_limits_h" >&5 +echo "${ECHO_T}$mfx_cv_header_sane_limits_h" >&6 + +if test "X$mfx_cv_header_sane_limits_h" != Xyes; then + { { echo "$as_me:$LINENO: error: your header is broken - for details see config.log" >&5 +echo "$as_me: error: your header is broken - for details see config.log" >&2;} + { (exit 1); exit 1; }; } +fi + + +# /*********************************************************************** +# // Checks for typedefs and structures +# ************************************************************************/ + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_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. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_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_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_off_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 +if test "${ac_cv_type_ptrdiff_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. */ +$ac_includes_default +int +main () +{ +if ((ptrdiff_t *) 0) + return 0; +if (sizeof (ptrdiff_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_ptrdiff_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ptrdiff_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 +if test $ac_cv_type_ptrdiff_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define ptrdiff_t long +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_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. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_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_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+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 +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +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_type_signal=void +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_signal=int +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + + +echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+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 +int +main () +{ +if ((short *) 0) + return 0; +if (sizeof (short)) + 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_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_short=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+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 +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + 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_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_int=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+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 +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + 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_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_long=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+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 +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + 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_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + +echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (long long)); } +unsigned long ulongval () { return (long) (sizeof (long long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_long_long=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +echo "$as_me:$LINENO: checking for __int16" >&5 +echo $ECHO_N "checking for __int16... $ECHO_C" >&6 +if test "${ac_cv_type___int16+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 +int +main () +{ +if ((__int16 *) 0) + return 0; +if (sizeof (__int16)) + 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___int16=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int16=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int16" >&5 +echo "${ECHO_T}$ac_cv_type___int16" >&6 + +echo "$as_me:$LINENO: checking size of __int16" >&5 +echo $ECHO_N "checking size of __int16... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int16+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int16" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int16))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int16))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int16))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int16))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int16))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int16=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int16), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int16), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (__int16)); } +unsigned long ulongval () { return (long) (sizeof (__int16)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int16))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int16)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int16)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof___int16=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int16), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int16), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int16=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int16" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int16" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT16 $ac_cv_sizeof___int16 +_ACEOF + + +echo "$as_me:$LINENO: checking for __int32" >&5 +echo $ECHO_N "checking for __int32... $ECHO_C" >&6 +if test "${ac_cv_type___int32+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 +int +main () +{ +if ((__int32 *) 0) + return 0; +if (sizeof (__int32)) + 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___int32=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int32=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int32" >&5 +echo "${ECHO_T}$ac_cv_type___int32" >&6 + +echo "$as_me:$LINENO: checking size of __int32" >&5 +echo $ECHO_N "checking size of __int32... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int32" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int32=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (__int32)); } +unsigned long ulongval () { return (long) (sizeof (__int32)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int32))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int32)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int32)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof___int32=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int32=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int32" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int32" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT32 $ac_cv_sizeof___int32 +_ACEOF + + +echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +if test "${ac_cv_type___int64+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 +int +main () +{ +if ((__int64 *) 0) + return 0; +if (sizeof (__int64)) + 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___int64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6 + +echo "$as_me:$LINENO: checking size of __int64" >&5 +echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int64" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int64=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (__int64)); } +unsigned long ulongval () { return (long) (sizeof (__int64)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int64))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int64)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof___int64=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int64), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int64=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + + +echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 +if test "${ac_cv_type_void_p+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 +int +main () +{ +if ((void * *) 0) + return 0; +if (sizeof (void *)) + 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_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_void_p=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 + +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +if test "${ac_cv_sizeof_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (void *))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_void_p=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (void *), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_void_p=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_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. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_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_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 + +echo "$as_me:$LINENO: checking size of size_t" >&5 +echo $ECHO_N "checking size of size_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_size_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_size_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (size_t)); } +unsigned long ulongval () { return (long) (sizeof (size_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (size_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (size_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (size_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_size_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (size_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_size_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 +if test "${ac_cv_type_ptrdiff_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. */ +$ac_includes_default +int +main () +{ +if ((ptrdiff_t *) 0) + return 0; +if (sizeof (ptrdiff_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_ptrdiff_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ptrdiff_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 + +echo "$as_me:$LINENO: checking size of ptrdiff_t" >&5 +echo $ECHO_N "checking size of ptrdiff_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_ptrdiff_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_ptrdiff_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_ptrdiff_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ptrdiff_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ptrdiff_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (ptrdiff_t)); } +unsigned long ulongval () { return (long) (sizeof (ptrdiff_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (ptrdiff_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (ptrdiff_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (ptrdiff_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_ptrdiff_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ptrdiff_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ptrdiff_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_ptrdiff_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_ptrdiff_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_ptrdiff_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t +_ACEOF + + + + +echo "$as_me:$LINENO: checking for __int32" >&5 +echo $ECHO_N "checking for __int32... $ECHO_C" >&6 +if test "${ac_cv_type___int32+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 +int +main () +{ +if ((__int32 *) 0) + return 0; +if (sizeof (__int32)) + 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___int32=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___int32=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___int32" >&5 +echo "${ECHO_T}$ac_cv_type___int32" >&6 + +echo "$as_me:$LINENO: checking size of __int32" >&5 +echo $ECHO_N "checking size of __int32... $ECHO_C" >&6 +if test "${ac_cv_sizeof___int32+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type___int32" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (__int32))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof___int32=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (__int32)); } +unsigned long ulongval () { return (long) (sizeof (__int32)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (__int32))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (__int32)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (__int32)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof___int32=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (__int32), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof___int32=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof___int32" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int32" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT32 $ac_cv_sizeof___int32 +_ACEOF + + +echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_intmax_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. */ +$ac_includes_default +int +main () +{ +if ((intmax_t *) 0) + return 0; +if (sizeof (intmax_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_intmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intmax_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_intmax_t" >&6 + +echo "$as_me:$LINENO: checking size of intmax_t" >&5 +echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_intmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_intmax_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_intmax_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intmax_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (intmax_t)); } +unsigned long ulongval () { return (long) (sizeof (intmax_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (intmax_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (intmax_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (intmax_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_intmax_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intmax_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_intmax_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t +_ACEOF + + +echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintmax_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. */ +$ac_includes_default +int +main () +{ +if ((uintmax_t *) 0) + return 0; +if (sizeof (uintmax_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_uintmax_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintmax_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6 + +echo "$as_me:$LINENO: checking size of uintmax_t" >&5 +echo $ECHO_N "checking size of uintmax_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uintmax_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_uintmax_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintmax_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintmax_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintmax_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintmax_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintmax_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uintmax_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintmax_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uintmax_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (uintmax_t)); } +unsigned long ulongval () { return (long) (sizeof (uintmax_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uintmax_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uintmax_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uintmax_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_uintmax_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uintmax_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uintmax_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uintmax_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uintmax_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINTMAX_T $ac_cv_sizeof_uintmax_t +_ACEOF + + +echo "$as_me:$LINENO: checking for intptr_t" >&5 +echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_intptr_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. */ +$ac_includes_default +int +main () +{ +if ((intptr_t *) 0) + return 0; +if (sizeof (intptr_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_intptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_intptr_t" >&6 + +echo "$as_me:$LINENO: checking size of intptr_t" >&5 +echo $ECHO_N "checking size of intptr_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_intptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_intptr_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intptr_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intptr_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intptr_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intptr_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (intptr_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_intptr_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (intptr_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intptr_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (intptr_t)); } +unsigned long ulongval () { return (long) (sizeof (intptr_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (intptr_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (intptr_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (intptr_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_intptr_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (intptr_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (intptr_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_intptr_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_intptr_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_intptr_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INTPTR_T $ac_cv_sizeof_intptr_t +_ACEOF + + +echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_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. */ +$ac_includes_default +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_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_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 + +echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_uintptr_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintptr_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintptr_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintptr_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintptr_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (uintptr_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_uintptr_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uintptr_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (uintptr_t)); } +unsigned long ulongval () { return (long) (sizeof (uintptr_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (uintptr_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (uintptr_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (uintptr_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_uintptr_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (uintptr_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_uintptr_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t +_ACEOF + + + +echo "$as_me:$LINENO: checking for float" >&5 +echo $ECHO_N "checking for float... $ECHO_C" >&6 +if test "${ac_cv_type_float+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 +int +main () +{ +if ((float *) 0) + return 0; +if (sizeof (float)) + 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_float=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_float=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 +echo "${ECHO_T}$ac_cv_type_float" >&6 + +echo "$as_me:$LINENO: checking size of float" >&5 +echo $ECHO_N "checking size of float... $ECHO_C" >&6 +if test "${ac_cv_sizeof_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_float" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (float))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (float))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (float))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (float))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (float))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_float=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (float), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (float), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (float)); } +unsigned long ulongval () { return (long) (sizeof (float)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (float))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (float)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (float)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_float=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (float), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (float), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_float=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +echo "${ECHO_T}$ac_cv_sizeof_float" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + + +echo "$as_me:$LINENO: checking for double" >&5 +echo $ECHO_N "checking for double... $ECHO_C" >&6 +if test "${ac_cv_type_double+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 +int +main () +{ +if ((double *) 0) + return 0; +if (sizeof (double)) + 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_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_double=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 +echo "${ECHO_T}$ac_cv_type_double" >&6 + +echo "$as_me:$LINENO: checking size of double" >&5 +echo $ECHO_N "checking size of double... $ECHO_C" >&6 +if test "${ac_cv_sizeof_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_double" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (double))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (double))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (double))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (double))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_double=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (double), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (double)); } +unsigned long ulongval () { return (long) (sizeof (double)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (double))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (double)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (double)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_double=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (double), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (double), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_double=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_double" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + +echo "$as_me:$LINENO: checking for long double" >&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6 +if test "${ac_cv_type_long_double+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 +int +main () +{ +if ((long double *) 0) + return 0; +if (sizeof (long double)) + 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_long_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_double=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 +echo "${ECHO_T}$ac_cv_type_long_double" >&6 + +echo "$as_me:$LINENO: checking size of long double" >&5 +echo $ECHO_N "checking size of long double... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_double" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long double))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long double))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long double))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_double=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long double), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (long double)); } +unsigned long ulongval () { return (long) (sizeof (long double)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long double))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long double)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long double)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_long_double=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long double), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long double), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_double=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +_ACEOF + + + +echo "$as_me:$LINENO: checking for dev_t" >&5 +echo $ECHO_N "checking for dev_t... $ECHO_C" >&6 +if test "${ac_cv_type_dev_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. */ +$ac_includes_default +int +main () +{ +if ((dev_t *) 0) + return 0; +if (sizeof (dev_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_dev_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_dev_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_dev_t" >&5 +echo "${ECHO_T}$ac_cv_type_dev_t" >&6 + +echo "$as_me:$LINENO: checking size of dev_t" >&5 +echo $ECHO_N "checking size of dev_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_dev_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_dev_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (dev_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (dev_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (dev_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (dev_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (dev_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_dev_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (dev_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (dev_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (dev_t)); } +unsigned long ulongval () { return (long) (sizeof (dev_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (dev_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (dev_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (dev_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_dev_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (dev_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (dev_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_dev_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_dev_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_dev_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t +_ACEOF + + +echo "$as_me:$LINENO: checking for fpos_t" >&5 +echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6 +if test "${ac_cv_type_fpos_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. */ +$ac_includes_default +int +main () +{ +if ((fpos_t *) 0) + return 0; +if (sizeof (fpos_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_fpos_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_fpos_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 +echo "${ECHO_T}$ac_cv_type_fpos_t" >&6 + +echo "$as_me:$LINENO: checking size of fpos_t" >&5 +echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_fpos_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_fpos_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (fpos_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (fpos_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (fpos_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (fpos_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (fpos_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_fpos_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (fpos_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (fpos_t)); } +unsigned long ulongval () { return (long) (sizeof (fpos_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (fpos_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (fpos_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (fpos_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_fpos_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (fpos_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_fpos_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t +_ACEOF + + +echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 +if test "${ac_cv_type_mode_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. */ +$ac_includes_default +int +main () +{ +if ((mode_t *) 0) + return 0; +if (sizeof (mode_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_mode_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_mode_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6 + +echo "$as_me:$LINENO: checking size of mode_t" >&5 +echo $ECHO_N "checking size of mode_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_mode_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_mode_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (mode_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (mode_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (mode_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (mode_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (mode_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_mode_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (mode_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (mode_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (mode_t)); } +unsigned long ulongval () { return (long) (sizeof (mode_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (mode_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (mode_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (mode_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_mode_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (mode_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (mode_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_mode_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_mode_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_mode_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_MODE_T $ac_cv_sizeof_mode_t +_ACEOF + + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_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. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_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_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_off_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 + +echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_off_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (off_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_off_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (off_t)); } +unsigned long ulongval () { return (long) (sizeof (off_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (off_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (off_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (off_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_off_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_off_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 +if test "${ac_cv_type_ssize_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. */ +$ac_includes_default +int +main () +{ +if ((ssize_t *) 0) + return 0; +if (sizeof (ssize_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_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_ssize_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 + +echo "$as_me:$LINENO: checking size of ssize_t" >&5 +echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_ssize_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_ssize_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_ssize_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ssize_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (ssize_t)); } +unsigned long ulongval () { return (long) (sizeof (ssize_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (ssize_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (ssize_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (ssize_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_ssize_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (ssize_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_ssize_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t +_ACEOF + + +echo "$as_me:$LINENO: checking for time_t" >&5 +echo $ECHO_N "checking for time_t... $ECHO_C" >&6 +if test "${ac_cv_type_time_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. */ +$ac_includes_default +int +main () +{ +if ((time_t *) 0) + return 0; +if (sizeof (time_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_time_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_time_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5 +echo "${ECHO_T}$ac_cv_type_time_t" >&6 + +echo "$as_me:$LINENO: checking size of time_t" >&5 +echo $ECHO_N "checking size of time_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_time_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_time_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= 0)]; +test_array [0] = 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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (time_t))) < 0)]; +test_array [0] = 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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (time_t))) >= $ac_mid)]; +test_array [0] = 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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (time_t))) <= $ac_mid)]; +test_array [0] = 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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_time_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (time_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +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 +long longval () { return (long) (sizeof (time_t)); } +unsigned long ulongval () { return (long) (sizeof (time_t)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (time_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (time_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (time_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 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 + ac_cv_sizeof_time_t=`cat conftest.val` +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 ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (time_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_time_t=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_TIME_T $ac_cv_sizeof_time_t +_ACEOF + + + + + +# /*********************************************************************** +# // Checks for library functions +# ************************************************************************/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_func in access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf +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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 + + + +if test "X$GCC" = Xyes; then +case $host_os in +cygwin* | mingw* | pw32*) + test "X$LIBS" != "X" && LIBS="$LIBS " + LIBS="${LIBS}-lwinmm" ;; +*) + ;; +esac +fi + + + +# /*********************************************************************** +# // Write output files +# ************************************************************************/ + + +mfx_tmp="-I$srcdir" +mfx_save_CPPFLAGS=$CPPFLAGS +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS" + +echo "$as_me:$LINENO: checking whether your compiler passes the ACC conformance test" >&5 +echo $ECHO_N "checking whether your compiler passes the ACC conformance test... $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. */ +#define ACC_CONFIG_NO_HEADER 1 +#define ACC_WANT_ACC_INCD_H 1 +#include "src/miniacc.h" + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr) +#include "src/miniacc.h" + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr) +static void test_acc_compile_time_assert(void) { +#include "src/miniacc.h" +} + +#undef NDEBUG +#include +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) assert(expr); +static int test_acc_run_time_assert(int r) { +#include "src/miniacc.h" +return r; +} + +int +main () +{ + +test_acc_compile_time_assert(); +if (test_acc_run_time_assert(1) != 1) return 1; + + + ; + return 0; +} +_ACEOF + +mfx_tmp=FAILED +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 + mfx_tmp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +rm -f conftest.$ac_ext conftest.$ac_objext + +CPPFLAGS=$mfx_save_CPPFLAGS + +echo "$as_me:$LINENO: result: $mfx_tmp" >&5 +echo "${ECHO_T}$mfx_tmp" >&6 +case x$mfx_tmp in + xpassed | xyes) ;; + *) + { echo "$as_me:$LINENO: " >&5 +echo "$as_me: " >&6;} + { echo "$as_me:$LINENO: Your compiler failed the ACC conformance test - for details see " >&5 +echo "$as_me: Your compiler failed the ACC conformance test - for details see " >&6;} + { echo "$as_me:$LINENO: \`config.log'. Please check that log file and consider sending" >&5 +echo "$as_me: \`config.log'. Please check that log file and consider sending" >&6;} + { echo "$as_me:$LINENO: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&5 +echo "$as_me: a patch or bug-report to <${PACKAGE_BUGREPORT}>." >&6;} + { echo "$as_me:$LINENO: Thanks for your support." >&5 +echo "$as_me: Thanks for your support." >&6;} + { echo "$as_me:$LINENO: " >&5 +echo "$as_me: " >&6;} + { { echo "$as_me:$LINENO: error: ACC conformance test failed. Stop." >&5 +echo "$as_me: error: ACC conformance test failed. Stop." >&2;} + { (exit 1); exit 1; }; } + ;; +esac + + +if test -r .Conf.settings2; then + . ./.Conf.settings2 +fi + +test "X$CPPFLAGS" != "X" && CPPFLAGS="$CPPFLAGS " +CPPFLAGS="${CPPFLAGS}-DLZO_HAVE_CONFIG_H" +if test "X$enable_asm" != Xno; then + CPPFLAGS="$CPPFLAGS -DLZO_USE_ASM" +fi + + + + + +configure_CPPFLAGS=$CPPFLAGS +configure_CFLAGS=$CFLAGS + + + + ac_config_files="$ac_config_files Makefile examples/Makefile include/Makefile include/lzo/Makefile lzotest/Makefile minilzo/Makefile src/Makefile tests/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 + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${LZO_USE_ASM_TRUE}" && test -z "${LZO_USE_ASM_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"LZO_USE_ASM\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"LZO_USE_ASM\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${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 lzo $as_me 2.03, 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 + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +lzo config.status 2.03 +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 +INSTALL="$INSTALL" +_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 +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_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" ;; + "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/lzo/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/lzo/Makefile" ;; + "lzotest/Makefile" ) CONFIG_FILES="$CONFIG_FILES lzotest/Makefile" ;; + "minilzo/Makefile" ) CONFIG_FILES="$CONFIG_FILES minilzo/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; + *) { { 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 + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason 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,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;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,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@EGREP@,$EGREP,;t t +s,@LN_S@,$LN_S,;t t +s,@ECHO@,$ECHO,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@F77@,$F77,;t t +s,@FFLAGS@,$FFLAGS,;t t +s,@ac_ct_F77@,$ac_ct_F77,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@LZO_USE_ASM_TRUE@,$LZO_USE_ASM_TRUE,;t t +s,@LZO_USE_ASM_FALSE@,$LZO_USE_ASM_FALSE,;t t +s,@LZO_ASM_VPATH@,$LZO_ASM_VPATH,;t t +s,@LZO_CPPFLAGS@,$LZO_CPPFLAGS,;t t +s,@LZO_EXTRA_CPPFLAGS@,$LZO_EXTRA_CPPFLAGS,;t t +s,@LZO_CFLAGS@,$LZO_CFLAGS,;t t +s,@LZO_EXTRA_CFLAGS@,$LZO_EXTRA_CFLAGS,;t t +s,@configure_CPPFLAGS@,$configure_CPPFLAGS,;t t +s,@configure_CFLAGS@,$configure_CFLAGS,;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 + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + # 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; } + + 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 +_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 +s,@INSTALL@,$ac_INSTALL,;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 <>$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 <>$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 +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(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'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + 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 + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$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 $dirpart/$fdir + else + as_dir=$dirpart/$fdir + 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 $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +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 + + + +## enable AMD64 assembly code : ${asm_msg_amd64} +cat < + http://www.oberhumer.com/opensource/lzo/ + + +Type \`make' to build LZO. Type \`make install' to install LZO. +After installing LZO, please read the accompanied documentation. + +EOF + +# vi:ts=4:et diff --git a/thirdparty/lzo/2.03/configure.ac b/thirdparty/lzo/2.03/configure.ac new file mode 100644 index 0000000..07c2502 --- /dev/null +++ b/thirdparty/lzo/2.03/configure.ac @@ -0,0 +1,222 @@ +# +# configure.ac -- autoconf configuration for the LZO library +# +# This file is part of the LZO data compression library. +# +# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +# All Rights Reserved. +# +# The LZO library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# The LZO library 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 the LZO library; see the file COPYING. +# If not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Markus F.X.J. Oberhumer +# +# http://www.oberhumer.com/opensource/lzo/ +# + + +# /*********************************************************************** +# // Init +# ************************************************************************/ + +AC_COPYRIGHT([Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer. +All Rights Reserved. +This configure script may be copied, distributed and modified under the +terms of the GNU General Public License; see COPYING for more details.]) + +AC_PREREQ(2.59) +AC_INIT([lzo],[2.03],[markus@oberhumer.com]) +AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION]) +AC_CONFIG_SRCDIR(src/lzo_init.c) +AC_CONFIG_AUX_DIR(autoconf) +AC_PREFIX_DEFAULT(/usr/local) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET +AM_MAINTAINER_MODE + +if test -z "$ac_abs_top_srcdir"; then + _AC_SRCPATHS(.) +fi +if test -r .Conf.settings1; then + . ./.Conf.settings1 +fi + +AC_PROG_CC +AC_PROG_CPP +mfx_PROG_CPPFLAGS +AC_C_CONST +mfx_LZO_CHECK_ENDIAN +AC_SYS_LARGEFILE + +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS([config.h:config.hin]) + +AC_ENABLE_STATIC +AC_DISABLE_SHARED +AC_PROG_LIBTOOL + + +# /*********************************************************************** +# // Checks for assembler +# ************************************************************************/ + +AC_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable assembly versions)) + +asm_arch= +asm_dir= +asm_msg_amd64=no +asm_msg_i386=no + +case $host_cpu in + amd64 | x86_64) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64" ;; + i?86) asm_arch="i386"; asm_dir="asm/i386/src_gas" ;; + *) enable_asm=no ;; +esac +LZO_ASM_VPATH= + +AC_MSG_CHECKING([whether to build assembly versions]) +if test "X$enable_asm" != Xno; then +mfx_compile_S='${CC-cc} -c conftest.S 1>&AS_MESSAGE_LOG_FD' +cat > conftest.S <&AS_MESSAGE_LOG_FD + cat conftest.S >&AS_MESSAGE_LOG_FD +fi +rm -rf conftest* +fi +AC_MSG_RESULT([$enable_asm]) + +AM_CONDITIONAL(LZO_USE_ASM, [test "X$enable_asm" != Xno]) +AC_SUBST(LZO_ASM_VPATH) + + +# /*********************************************************************** +# // Checks for header files +# ************************************************************************/ + +mfx_ACC_CHECK_HEADERS +dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h]) +if test "X$ac_cv_header_limits_h" != Xyes; then + AC_MSG_ERROR([ header not found]) +fi +mfx_CHECK_HEADER_SANE_LIMITS_H +if test "X$mfx_cv_header_sane_limits_h" != Xyes; then + AC_MSG_ERROR([your header is broken - for details see config.log]) +fi + + +# /*********************************************************************** +# // Checks for typedefs and structures +# ************************************************************************/ + +AC_TYPE_OFF_T +AC_CHECK_TYPE(ptrdiff_t,long) +AC_TYPE_SIZE_T +AC_TYPE_SIGNAL + +mfx_ACC_CHECK_SIZEOF +mfx_CHECK_SIZEOF + + +# /*********************************************************************** +# // Checks for library functions +# ************************************************************************/ + +mfx_ACC_CHECK_FUNCS +mfx_CHECK_LIB_WINMM + + +# /*********************************************************************** +# // Write output files +# ************************************************************************/ + +mfx_MINIACC_ACCCHK(["-I$srcdir"],["src/miniacc.h"]) + +if test -r .Conf.settings2; then + . ./.Conf.settings2 +fi + +test "X$CPPFLAGS" != "X" && CPPFLAGS="$CPPFLAGS " +CPPFLAGS="${CPPFLAGS}-DLZO_HAVE_CONFIG_H" +if test "X$enable_asm" != Xno; then + CPPFLAGS="$CPPFLAGS -DLZO_USE_ASM" +fi +AC_SUBST(LZO_CPPFLAGS) +AC_SUBST(LZO_EXTRA_CPPFLAGS) +AC_SUBST(LZO_CFLAGS) +AC_SUBST(LZO_EXTRA_CFLAGS) + +configure_CPPFLAGS=$CPPFLAGS +configure_CFLAGS=$CFLAGS +AC_SUBST(configure_CPPFLAGS) +AC_SUBST(configure_CFLAGS) + +AC_CONFIG_FILES([Makefile examples/Makefile include/Makefile include/lzo/Makefile lzotest/Makefile minilzo/Makefile src/Makefile tests/Makefile]) +AC_OUTPUT + + +## enable AMD64 assembly code : ${asm_msg_amd64} +cat < + http://www.oberhumer.com/opensource/lzo/ + + +Type \`make' to build LZO. Type \`make install' to install LZO. +After installing LZO, please read the accompanied documentation. + +EOF + +# vi:ts=4:et diff --git a/thirdparty/lzo/2.03/dict.exe b/thirdparty/lzo/2.03/dict.exe new file mode 100644 index 0000000..cb6278c Binary files /dev/null and b/thirdparty/lzo/2.03/dict.exe differ diff --git a/thirdparty/lzo/2.03/dict.exe.manifest b/thirdparty/lzo/2.03/dict.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/dict.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/dict.obj b/thirdparty/lzo/2.03/dict.obj new file mode 100644 index 0000000..ef44146 Binary files /dev/null and b/thirdparty/lzo/2.03/dict.obj differ diff --git a/thirdparty/lzo/2.03/doc/LZO.FAQ b/thirdparty/lzo/2.03/doc/LZO.FAQ new file mode 100644 index 0000000..604c98f --- /dev/null +++ b/thirdparty/lzo/2.03/doc/LZO.FAQ @@ -0,0 +1,213 @@ +============================================================================ +LZO Frequently Asked Questions +============================================================================ + + +I hate reading docs - just tell me how to add compression to my program +======================================================================= + +This is for the impatient: take a look at examples/simple.c and +examples/lzopack.c and see how easy this is. + +But you will come back to read the documentation later, won't you ? + + +Can you explain the naming conventions of the algorithms ? +========================================================== + +Let's take a look at LZO1X: + + The algorithm name is LZO1X. + The algorithm category is LZO1. + Various compression levels are implemented. + + LZO1X-999 + !---------- algorithm category + !--------- algorithm type + !!!----- compression level (1-9, 99, 999) + + LZO1X-1(11) + !---------- algorithm category + !--------- algorithm type + !------- compression level (1-9, 99, 999) + !!---- memory level (memory requirements for compression) + +All compression/memory levels generate the same compressed data format, +so e.g. the LZO1X decompressor handles all LZO1X-* compression levels +(for more information about the decompressors see below). + +Category LZO1 algorithms: compressed data format is strictly byte aligned +Category LZO2 algorithms: uses bit-shifting, slower decompression + + +Why are there so many algorithms ? +================================== + +Because of historical reasons - I want to support unlimited +backward compatibility. + +Don't get misled by the size of the library - using one algorithm +increases the size of your application by only a few kB. + +If you just want to add a little bit of data compression to your +application you may be looking for miniLZO. +See minilzo/README.LZO for more information. + + +Which algorithm should I use ? +============================== + +LZO1X seems to be best choice in many cases, so: +- when going for speed use LZO1X-1 +- when generating pre-compressed data use LZO1X-999 +- if you have little memory available for compression use LZO1X-1(11) + or LZO1X-1(12) + +Of course, your mileage may vary, and you are encouraged to run your +own experiments. Try LZO1Y and LZO1F next. + + +What's the difference between the decompressors per algorithm ? +=============================================================== + +Once again let's use LZO1X for explanation: + +- lzo1x_decompress + The `standard' decompressor. Pretty fast - use this whenever possible. + + This decompressor expects valid compressed data. + If the compressed data gets corrupted somehow (e.g. transmission + via an erroneous channel, disk errors, ...) it will probably crash + your application because absolutely no additional checks are done. + +- lzo1x_decompress_safe + The `safe' decompressor. Somewhat slower. + + This decompressor will catch all compressed data violations and + return an error code in this case - it will never crash. + +- lzo1x_decompress_asm + Same as lzo1x_decompress - written in assembler. + +- lzo1x_decompress_asm_safe + Same as lzo1x_decompress_safe - written in assembler. + +- lzo1x_decompress_asm_fast + Similar to lzo1x_decompress_asm - but even faster. + + For reasons of speed this decompressor can write up to 3 bytes + past the end of the decompressed (output) block. + [ technical note: because data is transferred in 32-bit units ] + + Use this when you are decompressing from one memory block to + another memory block - just provide output space for 3 extra bytes. + You shouldn't use it if e.g. you are directly decompressing to video + memory (because the extra bytes will be show up on the screen). + +- lzo1x_decompress_asm_fast_safe + This is the safe version of lzo1x_decompress_asm_fast. + + +Notes: +------ +- When using a safe decompressor you must pass the number of + bytes available in `dst' via the parameter `dst_len'. + +- If you want to be sure that your data is not corrupted you must + use a checksum - just using the safe decompressor is not enough, + because many data errors will not result in a compressed data violation. + +- Assembler versions are only available for the i386 family yet. + Please see also asm/i386/00README.TXT + +- You should test if the assembler versions are actually faster + than the C version on your machine - some compilers can do a very + good optimization job and they also can optimize the code + for a specific processor. + + +What is this optimization thing ? +================================= + +The compressors use a heuristic approach - they sometimes code +information that doesn't improve compression ratio. + +Optimization removes this superfluos information in order to +increase decompression speed. + +Optimization works similar to decompression except that the +compressed data is modified as well. The length of the compressed +data block will not change - only the compressed data-bytes will +get rearranged a little bit. + +Don't expect too much, though - my tests have shown that the +optimization step improves decompression speed by about 1-3%. + + +I need even more decompression speed... +======================================= + +Many RISC processors (like MIPS) can transfer 32-bit words much +faster than bytes - this can significantly speed up decompression. +So after verifying that everything works fine you can try if activating +the LZO_ALIGNED_OK_4 macro improves LZO1X and LZO1Y decompression +performance. Change the file config.h accordingly and recompile everything. + +On a i386 architecture you should evaluate the assembler versions. + + +How can I reduce memory requirements when (de)compressing ? +=========================================================== + +If you cleverly arrange your data, you can do an overlapping (in-place) +decompression which means that you can decompress to the *same* +block where the compressed data resides. This effectively removes +the space requirements for holding the compressed data block. + +This technique is essential e.g. for usage in an executable packer. + +You can also partly overlay the buffers when doing compression. + +See examples/overlap.c for a working example. + + +Can you give a cookbook for using pre-compressed data ? +======================================================= + +Let's assume you use LZO1X-999. + +1) pre-compression step + - call lzo_init() + - call lzo1x_999_compress() + - call lzo1x_optimize() + - compute an adler32 checksum of the *compressed* data + - store the compressed data and the checksum in a file + - if you are paranoid you should verify decompression now + +2) decompression step within your application + - call lzo_init() + - load your compressed data and the checksum + - optionally verify the checksum of the compressed data + (so that you can use the standard decompressor) + - decompress + +See examples/precomp.c and examples/precomp2.c for a working example. + + +How much can my data expand during compression ? +================================================ + +LZO will expand incompressible data by a little amount. +I still haven't computed the exact values, but I suggest using +these formulas for a worst-case expansion calculation: + + Algorithm LZO1, LZO1A, LZO1B, LZO1C, LZO1F, LZO1X, LZO1Y, LZO1Z: + ---------------------------------------------------------------- + output_block_size = input_block_size + (input_block_size / 16) + 64 + 3 + + [This is about 106% for a large block size.] + + Algorithm LZO2A: + ---------------- + output_block_size = input_block_size + (input_block_size / 8) + 128 + 3 + diff --git a/thirdparty/lzo/2.03/doc/LZO.TXT b/thirdparty/lzo/2.03/doc/LZO.TXT new file mode 100644 index 0000000..addf430 --- /dev/null +++ b/thirdparty/lzo/2.03/doc/LZO.TXT @@ -0,0 +1,291 @@ + + ============================================================================ + LZO -- a real-time data compression library + ============================================================================ + + Author : Markus Franz Xaver Johannes Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + Version : 2.03 + Date : 30 Apr 2008 + + + Abstract + -------- + LZO is a portable lossless data compression library written in ANSI C. + It offers pretty fast compression and very fast decompression. + Decompression requires no memory. + + In addition there are slower compression levels achieving a quite + competitive compression ratio while still decompressing at + this very high speed. + + The LZO algorithms and implementations are copyrighted OpenSource + distributed under the GNU General Public License. + + + Introduction + ------------ + LZO is a data compression library which is suitable for data + de-/compression in real-time. This means it favours speed + over compression ratio. + + The acronym LZO is standing for Lempel-Ziv-Oberhumer. + + LZO is written in ANSI C. Both the source code and the compressed + data format are designed to be portable across platforms. + + LZO implements a number of algorithms with the following features: + + - Decompression is simple and *very* fast. + - Requires no memory for decompression. + - Compression is pretty fast. + - Requires 64 kB of memory for compression. + - Allows you to dial up extra compression at a speed cost in the + compressor. The speed of the decompressor is not reduced. + - Includes compression levels for generating pre-compressed + data which achieve a quite competitive compression ratio. + - There is also a compression level which needs only 8 kB for compression. + - Algorithm is thread safe. + - Algorithm is lossless. + + LZO supports overlapping compression and in-place decompression. + + + Design criteria + --------------- + LZO was designed with speed in mind. Decompressor speed has been + favoured over compressor speed. Real-time decompression should be + possible for virtually any application. The implementation of the + LZO1X decompressor in optimized i386 assembler code runs about at + the third of the speed of a memcpy() - and even faster for many files. + + In fact I first wrote the decompressor of each algorithm thereby + defining the compressed data format, verified it with manually + created test data and at last added the compressor. + + + Performance + ----------- + To keep you interested, here is an overview of the average results + when compressing the Calgary Corpus test suite with a blocksize + of 256 kB, originally done on an ancient Intel Pentium 133. + + The naming convention of the various algorithms goes LZOxx-N, where N is + the compression level. Range 1-9 indicates the fast standard levels using + 64 kB memory for compression. Level 99 offers better compression at the + cost of more memory (256 kB), and is still reasonably fast. + Level 999 achieves nearly optimal compression - but it is slow + and uses much memory, and is mainly intended for generating + pre-compressed data. + + The C version of LZO1X-1 is about 4-5 times faster than the fastest + zlib compression level, and it also outperforms other algorithms + like LZRW1-A and LZV in both compression ratio and compression speed + and decompression speed. + + +------------------------------------------------------------------------+ + | Algorithm Length CxB ComLen %Remn Bits Com K/s Dec K/s | + | --------- ------ --- ------ ----- ---- ------- ------- | + | | + | memcpy() 224401 1 224401 100.0 8.00 60956.83 59124.58 | + | | + | LZO1-1 224401 1 117362 53.1 4.25 4665.24 13341.98 | + | LZO1-99 224401 1 101560 46.7 3.73 1373.29 13823.40 | + | | + | LZO1A-1 224401 1 115174 51.7 4.14 4937.83 14410.35 | + | LZO1A-99 224401 1 99958 45.5 3.64 1362.72 14734.17 | + | | + | LZO1B-1 224401 1 109590 49.6 3.97 4565.53 15438.34 | + | LZO1B-2 224401 1 106235 48.4 3.88 4297.33 15492.79 | + | LZO1B-3 224401 1 104395 47.8 3.83 4018.21 15373.52 | + | LZO1B-4 224401 1 104828 47.4 3.79 3024.48 15100.11 | + | LZO1B-5 224401 1 102724 46.7 3.73 2827.82 15427.62 | + | LZO1B-6 224401 1 101210 46.0 3.68 2615.96 15325.68 | + | LZO1B-7 224401 1 101388 46.0 3.68 2430.89 15361.47 | + | LZO1B-8 224401 1 99453 45.2 3.62 2183.87 15402.77 | + | LZO1B-9 224401 1 99118 45.0 3.60 1677.06 15069.60 | + | LZO1B-99 224401 1 95399 43.6 3.48 1286.87 15656.11 | + | LZO1B-999 224401 1 83934 39.1 3.13 232.40 16445.05 | + | | + | LZO1C-1 224401 1 111735 50.4 4.03 4883.08 15570.91 | + | LZO1C-2 224401 1 108652 49.3 3.94 4424.24 15733.14 | + | LZO1C-3 224401 1 106810 48.7 3.89 4127.65 15645.69 | + | LZO1C-4 224401 1 105717 47.7 3.82 3007.92 15346.44 | + | LZO1C-5 224401 1 103605 47.0 3.76 2829.15 15153.88 | + | LZO1C-6 224401 1 102585 46.5 3.72 2631.37 15257.58 | + | LZO1C-7 224401 1 101937 46.2 3.70 2378.57 15492.49 | + | LZO1C-8 224401 1 100779 45.6 3.65 2171.93 15386.07 | + | LZO1C-9 224401 1 100255 45.4 3.63 1691.44 15194.68 | + | LZO1C-99 224401 1 97252 44.1 3.53 1462.88 15341.37 | + | LZO1C-999 224401 1 87740 40.2 3.21 306.44 16411.94 | + | | + | LZO1F-1 224401 1 113412 50.8 4.07 4755.97 16074.12 | + | LZO1F-999 224401 1 89599 40.3 3.23 280.68 16553.90 | + | | + | LZO1X-1(11) 224401 1 118810 52.6 4.21 4544.42 15879.04 | + | LZO1X-1(12) 224401 1 113675 50.6 4.05 4411.15 15721.59 | + | LZO1X-1 224401 1 109323 49.4 3.95 4991.76 15584.89 | + | LZO1X-1(15) 224401 1 108500 49.1 3.93 5077.50 15744.56 | + | LZO1X-999 224401 1 82854 38.0 3.04 135.77 16548.48 | + | | + | LZO1Y-1 224401 1 110820 49.8 3.98 4952.52 15638.82 | + | LZO1Y-999 224401 1 83614 38.2 3.05 135.07 16385.40 | + | | + | LZO1Z-999 224401 1 83034 38.0 3.04 133.31 10553.74 | + | | + | LZO2A-999 224401 1 87880 40.0 3.20 301.21 8115.75 | + +------------------------------------------------------------------------+ + + Notes: + - CxB is the number of blocks + - K/s is the speed measured in 1000 uncompressed bytes per second + - the assembler decompressors are even faster + + + Short documentation + ------------------- + LZO is a block compression algorithm - it compresses and decompresses + a block of data. Block size must be the same for compression + and decompression. + + LZO compresses a block of data into matches (a sliding dictionary) + and runs of non-matching literals. LZO takes care about long matches + and long literal runs so that it produces good results on highly + redundant data and deals acceptably with non-compressible data. + + When dealing with uncompressible data, LZO expands the input + block by a maximum of 16 bytes per 1024 bytes input. + + I have verified LZO using such tools as valgrind and other memory checkers. + And in addition to compressing gigabytes of files when tuning some parameters + I have also consulted various `lint' programs to spot potential portability + problems. LZO is free of any known bugs. + + + The algorithms + -------------- + There are too many algorithms implemented. But I want to support + unlimited backward compatibility, so I will not reduce the LZO + distribution in the future. + + As the many object files are mostly independent of each other, the + size overhead for an executable statically linked with the LZO library + is usually pretty low (just a few kB) because the linker will only add + the modules that you are actually using. + + I first published LZO1 and LZO1A in the Internet newsgroups + comp.compression and comp.compression.research in March 1996. + They are mainly included for compatibility reasons. The LZO2A + decompressor is too slow, and there is no fast compressor anyway. + + My experiments have shown that LZO1B is good with a large blocksize + or with very redundant data, LZO1F is good with a small blocksize or + with binary data and that LZO1X is often the best choice of all. + LZO1Y and LZO1Z are almost identical to LZO1X - they can achieve a + better compression ratio on some files. + Beware, your mileage may vary. + + + Usage of the library + -------------------- + Despite of its size, the basic usage of LZO is really very simple. + + Let's assume you want to compress some data with LZO1X-1: + A) compression + * include + call lzo_init() + compress your data with lzo1x_1_compress() + * link your application with the LZO library + B) decompression + * include + call lzo_init() + decompress your data with lzo1x_decompress() + * link your application with the LZO library + + The program examples/simple.c shows a fully working example. + See also LZO.FAQ for more information. + + + Building LZO + ------------ + As LZO uses Autoconf+Automake+Libtool the building process under + UNIX systems should be very unproblematic. Shared libraries are + supported on many architectures as well. + For detailed instructions see the file INSTALL. + + Please note that due to the design of the ELF executable format + the performance of a shared library on i386 systems (e.g. Linux) + is a little bit slower, so you may want to link your applications + with the static version (liblzo2.a) anyway. + + For building under DOS, Win16, Win32, OS/2 and other systems + take a look at the file B/00readme.txt. + + In case of troubles (like decompression data errors) try recompiling + everything without optimizations - LZO may break the optimizer + of your compiler. See the file BUGS. + + LZO is written in ANSI C. In particular this means: + - your compiler must understand prototypes + - your compiler must understand prototypes in function pointers + - your compiler must correctly promote integrals ("value-preserving") + - your preprocessor must implement #elif, #error and stringizing + - you must have a conforming and correct header + - you must have , and other ANSI C headers + - you should have size_t and ptrdiff_t + + + Portability + ----------- + I have built and tested LZO successfully on a variety of platforms + including DOS (16 + 32 bit), Windows 3.x (16-bit), Win32, Win64, + Linux, *BSD, HP-UX and many more. + + LZO is also reported to work under AIX, ConvexOS, IRIX, MacOS, PalmOS (Pilot), + PSX (Sony Playstation), Solaris, SunOS, TOS (Atari ST) and VxWorks. + Furthermore it is said that its performance on a Cray is superior + to all other machines... + + And I think it would be much fun to translate the decompressors + to Z-80 or 6502 assembly. + + + The future + ---------- + Here is what I'm planning for the next months. No promises, though... + + - interfaces to .NET and Mono + - interfaces to Perl, Java, Python, Delphi, Visual Basic, ... + - improve documentation and API reference + + + Some comments about the source code + ----------------------------------- + Be warned: the main source code in the `src' directory is a + real pain to understand as I've experimented with hundreds of slightly + different versions. It contains many #if and some gotos, and + is *completely optimized for speed* and not for readability. + Code sharing of the different algorithms is implemented by stressing + the preprocessor - this can be really confusing. Lots of marcos and + assertions don't make things better. + + Nevertheless LZO compiles very quietly on a variety of + compilers with the highest warning levels turned on, even + in C++ mode. + + + Copyright + --------- + LZO is Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer + + LZO is distributed under the terms of the GNU General Public License (GPL). + See the file COPYING. + + Special licenses for commercial and other applications which + are not willing to accept the GNU General Public License + are available by contacting the author. + + + diff --git a/thirdparty/lzo/2.03/doc/LZOAPI.TXT b/thirdparty/lzo/2.03/doc/LZOAPI.TXT new file mode 100644 index 0000000..8d28584 --- /dev/null +++ b/thirdparty/lzo/2.03/doc/LZOAPI.TXT @@ -0,0 +1,285 @@ + +============================================================================ +LZO -- a real-time data compression library LIBRARY REFERENCE +============================================================================ + + +[ please read LZO.FAQ first ] + + +Table of Contents +================= + +1 Introduction to the LZO Library Reference +1.1 Preliminary notes +1.2 Headers +2 General +2.1 The memory model +2.2 Public integral types +2.3 Public pointer types +2.4 Public function types +3 Function reference +3.1 Initialization +3.2 Compression +3.3 Decompression +3.4 Optimization +3.5 String functions +3.6 Checksum functions +3.7 Version functions +4 Variable reference + + + +1 Introduction to the LZO Library Reference +============================================= + + +1.1 Preliminary notes +--------------------- + +- `C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C + programming language + + +1.2 Headers +----------- + +This section briefly describes the headers. + + + + Contains definitions for the basic integral and pointer types, + provides wrappers for the library calling conventions, defines + error codes and contains prototypes for the generic functions. + This file is automatically included by all LZO headers. + + + + + + + + + + + + These files provide definitions and prototypes for the + actual (de-)compression functions. + + + +2 General +========= + + +2.1 The memory model +-------------------- + +The documentation indicates that LZO requires 32-bit integers. It's +not the integer size that really matters, though, but the memory +model. If your memory model allows to access pointers at 32-bit +offsets, then there is no problem at all - LZO works fine on my +old Atari ST, which has 16 bit integers and a flat 32-bit memory model. +Using 'huge' 32-bit pointers under 16-bit DOS is a workaround for this. + +While LZO also works with a strict 16-bit memory model, I don't officially +support this because this limits the maximum block size to 64 kB - and this +makes the library incompatible with other platforms, i.e. you cannot +decompress larger blocks compressed on those platforms. + + +2.2 Public integral types +------------------------- + +lzo_uint + + used as size_t, must be 32 bits or more for compatibility reasons + +lzo_uint32 + + *must* be 32 bits or more + +lzo_bool + + can store the values 0 ("false") and 1 ("true") + +lzo_byte + + unsigned char (memory model specific) + + +2.3 Public pointer types +------------------------ + +All pointer types are memory model specific. + +lzo_voidp + + pointer to void + +lzo_bytep + + pointer to unsigned char + +lzo_bytepp + + array of pointers to unsigned char + + +2.4 Public function types +------------------------- + +lzo_compress_t + +lzo_decompress_t + +lzo_optimize_t + +lzo_callback_t + + + +3 Function reference +==================== + + +3.1 Initialization +------------------ + +int lzo_init ( void ); + + This function initializes the LZO library. It must be the first LZO + function you call, and you cannot use any of the other LZO library + functions if the call fails. + + Return value: + Returns LZO_E_OK on success, error code otherwise. + + Note: + This function is actually implemented using a macro. + + +3.2 Compression +--------------- + +All compressors compress the memory block at `src' with the uncompressed +length `src_len' to the address given by `dst'. +The length of the compressed blocked will be returned in the variable +pointed by `dst_len'. + +The two blocks may overlap under certain conditions (see examples/overlap.c), +thereby allowing "in-place" compression. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#include + +int lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + Algorithm: LZO1X + Compression level: LZO1X-1 + Memory requirements: LZO1X_1_MEM_COMPRESS (64 kB on 32-bit machines) + + This compressor is pretty fast. + + Return value: + Always returns LZO_E_OK (this function can never fail). + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#include + +int lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + Algorithm: LZO1X + Compression level: LZO1X-999 + Memory requirements: LZO1X_999_MEM_COMPRESS (448 kB on 32-bit machines) + + This compressor is quite slow but achieves a good compression + ratio. It is mainly intended for generating pre-compressed data. + + Return value: + Always returns LZO_E_OK (this function can never fail). + + +[ ... lots of other compressors which all follow the same principle ... ] + + + +3.3 Decompression +----------------- + +All decompressors decompress the memory block at `src' with the compressed +length `src_len' to the address given by `dst'. +The length of the decompressed block will be returned in the variable +pointed by `dst_len' - on error the number of bytes that have +been decompressed so far will be returned. + +The safe decompressors expect that the number of bytes available in +the `dst' block is passed via the variable pointed by `dst_len'. + +The two blocks may overlap under certain conditions (see examples/overlap.c), +thereby allowing "in-place" decompression. + + +Description of return values: + + LZO_E_OK + Success. + + LZO_E_INPUT_NOT_CONSUMED + The end of the compressed block has been detected before all + bytes in the compressed block have been used. + This may actually not be an error (if `src_len' is too large). + + LZO_E_INPUT_OVERRUN + The decompressor requested more bytes from the compressed + block than available. + Your data is corrupted (or `src_len' is too small). + + LZO_E_OUTPUT_OVERRUN + The decompressor requested to write more bytes to the uncompressed + block than available. + Either your data is corrupted, or you should increase the number of + available bytes passed in the variable pointed by `dst_len'. + + LZO_E_LOOKBEHIND_OVERRUN + Your data is corrupted. + + LZO_E_EOF_NOT_FOUND + No EOF code was found in the compressed block. + Your data is corrupted (or `src_len' is too small). + + LZO_E_ERROR + Any other error (data corrupted). + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#include + +int lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + Algorithm: LZO1X + Memory requirements: 0 + + +[ ... lots of other decompressors which all follow the same principle ... ] + + + +4 Variable reference +==================== + +The variables are listed alphabetically. + +[ no public variables yet ] + + + +--------------------------- END OF LZOAPI.TXT ------------------------------ + diff --git a/thirdparty/lzo/2.03/doc/LZOTEST.TXT b/thirdparty/lzo/2.03/doc/LZOTEST.TXT new file mode 100644 index 0000000..c5ec505 --- /dev/null +++ b/thirdparty/lzo/2.03/doc/LZOTEST.TXT @@ -0,0 +1,75 @@ +The test driver `lzotest' has grown into a fairly powerful program +of it's own. Here is a short description of the various options. + +[ to be written - this is only a very first draft ] + + +Usage: +====== + +lzotest [option..] file... + + +Basic options: +============== + + -m# compression method + -b# set input block size (default 262144, max 1310720) + -n# number of compression/decompression runs + -c# number of compression runs + -d# number of decompression runs + -S use safe decompressor (if available) + -A use assembler decompressor (if available) + -F use fast assembler decompressor (if available) + -O optimize compressed data (if available) + -s DIR process Calgary Corpus test suite in directory `DIR' + -@ read list of files to compress from stdin + -q be quiet + -L display software license + + +More about `-m': +================ + +Use `-m' to list all available methods. + +You can select methods by number: +-m71 + +You can select methods by name: +-mlzo1x-1 +-mlzo1x-999 +-mlzo1x-1(11) + +You can select some predefined method groups: +-mall +-mlzo +-mm1 +-mm99 +-mm999 +-m1x999 +-m1y999 + +You can specify multiple methods/groups separated by ',': +-m1,2,3,4 +-m1,2,3,4,lzo1x-1,m99,81 + +And finally you can use multiple `-m' options: +-m962,972 -mm99,982,m1 + + +Other options: +============== + +--max-data-length=LEN + +--dict=FILENAME +--max-dict-length=LEN + +--dump=FILENAME + +--adler32 +--crc32 +--execution-time +--totals + diff --git a/thirdparty/lzo/2.03/examples/Makefile.am b/thirdparty/lzo/2.03/examples/Makefile.am new file mode 100644 index 0000000..2c5b527 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/Makefile.am @@ -0,0 +1,21 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) + +noinst_PROGRAMS = dict lzopack overlap precomp precomp2 simple + +dict_SOURCES = dict.c +lzopack_SOURCES = lzopack.c +overlap_SOURCES = overlap.c +precomp_SOURCES = precomp.c +precomp2_SOURCES = precomp2.c +simple_SOURCES = simple.c + +LDADD = ../src/liblzo2.la +DEPENDENCIES = ../src/liblzo2.la + +EXTRA_DIST = portab.h portab_a.h + diff --git a/thirdparty/lzo/2.03/examples/Makefile.in b/thirdparty/lzo/2.03/examples/Makefile.in new file mode 100644 index 0000000..4199078 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/Makefile.in @@ -0,0 +1,491 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = dict$(EXEEXT) lzopack$(EXEEXT) overlap$(EXEEXT) \ + precomp$(EXEEXT) precomp2$(EXEEXT) simple$(EXEEXT) +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_dict_OBJECTS = dict.$(OBJEXT) +dict_OBJECTS = $(am_dict_OBJECTS) +dict_LDADD = $(LDADD) +dict_DEPENDENCIES = ../src/liblzo2.la +am_lzopack_OBJECTS = lzopack.$(OBJEXT) +lzopack_OBJECTS = $(am_lzopack_OBJECTS) +lzopack_LDADD = $(LDADD) +lzopack_DEPENDENCIES = ../src/liblzo2.la +am_overlap_OBJECTS = overlap.$(OBJEXT) +overlap_OBJECTS = $(am_overlap_OBJECTS) +overlap_LDADD = $(LDADD) +overlap_DEPENDENCIES = ../src/liblzo2.la +am_precomp_OBJECTS = precomp.$(OBJEXT) +precomp_OBJECTS = $(am_precomp_OBJECTS) +precomp_LDADD = $(LDADD) +precomp_DEPENDENCIES = ../src/liblzo2.la +am_precomp2_OBJECTS = precomp2.$(OBJEXT) +precomp2_OBJECTS = $(am_precomp2_OBJECTS) +precomp2_LDADD = $(LDADD) +precomp2_DEPENDENCIES = ../src/liblzo2.la +am_simple_OBJECTS = simple.$(OBJEXT) +simple_OBJECTS = $(am_simple_OBJECTS) +simple_LDADD = $(LDADD) +simple_DEPENDENCIES = ../src/liblzo2.la +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(dict_SOURCES) $(lzopack_SOURCES) $(overlap_SOURCES) \ + $(precomp_SOURCES) $(precomp2_SOURCES) $(simple_SOURCES) +DIST_SOURCES = $(dict_SOURCES) $(lzopack_SOURCES) $(overlap_SOURCES) \ + $(precomp_SOURCES) $(precomp2_SOURCES) $(simple_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) +dict_SOURCES = dict.c +lzopack_SOURCES = lzopack.c +overlap_SOURCES = overlap.c +precomp_SOURCES = precomp.c +precomp2_SOURCES = precomp2.c +simple_SOURCES = simple.c +LDADD = ../src/liblzo2.la +DEPENDENCIES = ../src/liblzo2.la +EXTRA_DIST = portab.h portab_a.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +dict$(EXEEXT): $(dict_OBJECTS) $(dict_DEPENDENCIES) + @rm -f dict$(EXEEXT) + $(LINK) $(dict_LDFLAGS) $(dict_OBJECTS) $(dict_LDADD) $(LIBS) +lzopack$(EXEEXT): $(lzopack_OBJECTS) $(lzopack_DEPENDENCIES) + @rm -f lzopack$(EXEEXT) + $(LINK) $(lzopack_LDFLAGS) $(lzopack_OBJECTS) $(lzopack_LDADD) $(LIBS) +overlap$(EXEEXT): $(overlap_OBJECTS) $(overlap_DEPENDENCIES) + @rm -f overlap$(EXEEXT) + $(LINK) $(overlap_LDFLAGS) $(overlap_OBJECTS) $(overlap_LDADD) $(LIBS) +precomp$(EXEEXT): $(precomp_OBJECTS) $(precomp_DEPENDENCIES) + @rm -f precomp$(EXEEXT) + $(LINK) $(precomp_LDFLAGS) $(precomp_OBJECTS) $(precomp_LDADD) $(LIBS) +precomp2$(EXEEXT): $(precomp2_OBJECTS) $(precomp2_DEPENDENCIES) + @rm -f precomp2$(EXEEXT) + $(LINK) $(precomp2_LDFLAGS) $(precomp2_OBJECTS) $(precomp2_LDADD) $(LIBS) +simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES) + @rm -f simple$(EXEEXT) + $(LINK) $(simple_LDFLAGS) $(simple_OBJECTS) $(simple_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzopack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overlap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/precomp2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/examples/dict.c b/thirdparty/lzo/2.03/examples/dict.c new file mode 100644 index 0000000..eec7675 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/dict.c @@ -0,0 +1,278 @@ +/* dict.c -- example program: how to use preset dictionaries + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// This program shows how to use preset dictionaries. +// +// Please study LZO.FAQ and simple.c first. +**************************************************************************/ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#include "examples/portab.h" + + +static const char *progname = NULL; + +#define DICT_LEN 0xbfff +static lzo_bytep dict; +static lzo_uint dict_len = 0; +static lzo_uint32 dict_adler32; + + +/************************************************************************* +// +**************************************************************************/ + +static lzo_uint total_n = 0; +static lzo_uint total_c_len = 0; +static lzo_uint total_d_len = 0; + +static void print_file ( const char *name, lzo_uint d_len, lzo_uint c_len ) +{ + double perc; + + perc = (d_len > 0) ? c_len * 100.0 / d_len : 0; + printf(" | %-30s %9ld -> %9ld %7.2f%% |\n", + name, (long) d_len, (long) c_len, perc); + + total_n++; + total_c_len += c_len; + total_d_len += d_len; +} + + +/************************************************************************* +// +**************************************************************************/ + +int do_file ( const char *in_name, int level ) +{ + int r; + lzo_bytep in; + lzo_bytep out; + lzo_bytep newb; + lzo_bytep wrkmem; + lzo_uint in_len; + lzo_uint out_len; + lzo_uint new_len; + long l; + FILE *f; + +/* + * Step 1: open the input file + */ + f = fopen(in_name,"rb"); + if (f == 0) + { + printf("%s: cannot open file %s\n", progname, in_name); + return 0; /* no error */ + } + fseek(f,0,SEEK_END); + l = ftell(f); + fseek(f,0,SEEK_SET); + if (l <= 0) + { + printf("%s: %s: empty file -- skipping\n", progname, in_name); + fclose(f); + return 0; + } + in_len = (lzo_uint) l; + +/* + * Step 2: allocate compression buffers and read the file + */ + in = (lzo_bytep) lzo_malloc(in_len); + out = (lzo_bytep) lzo_malloc(in_len + in_len / 16 + 64 + 3); + newb = (lzo_bytep) lzo_malloc(in_len); + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_999_MEM_COMPRESS); + if (in == NULL || out == NULL || newb == NULL || wrkmem == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + in_len = (lzo_uint) lzo_fread(f,in,in_len); + fclose(f); + +/* + * Step 3: compress from `in' to `out' with LZO1X-999 + */ + r = lzo1x_999_compress_level(in,in_len,out,&out_len,wrkmem, + dict, dict_len, 0, level); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + return 1; + } + + print_file(in_name,in_len,out_len); + +/* + * Step 4: decompress again, now going from `out' to `newb' + */ + new_len = in_len; + r = lzo1x_decompress_dict_safe(out,out_len,newb,&new_len,NULL,dict,dict_len); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - decompression failed: %d\n", r); + return 1; + } + +/* + * Step 5: verify decompression + */ + if (new_len != in_len || lzo_memcmp(in,newb,in_len) != 0) + { + /* this should NEVER happen */ + printf("internal error - decompression data error\n"); + return 1; + } + + /* free buffers in reverse order to help malloc() */ + lzo_free(wrkmem); + lzo_free(newb); + lzo_free(out); + lzo_free(in); + return 0; +} + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int i = 1; + int r; + const char *dict_name; + FILE *f; + time_t t_total; + int level = 7; + + lzo_wildargv(&argc, &argv); + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + + progname = argv[0]; + + if (i < argc && argv[i][0] == '-' && isdigit(argv[i][1])) + level = atoi(&argv[i++][1]); + + if (i + 1 >= argc || level < 1 || level > 9) + { + printf("usage: %s [-level] [ dictionary-file | -n ] file...\n", progname); + exit(1); + } + printf("Compression level is LZO1X-999/%d\n", level); + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + +/* + * Step 2: prepare the dictionary + */ + dict = (lzo_bytep) lzo_malloc(DICT_LEN); + if (dict == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + dict_name = argv[i++]; + if (strcmp(dict_name,"-n") == 0) + { + dict_name = "empty"; + dict_len = 0; + } + else + { + f = fopen(dict_name,"rb"); + if (!f) + { + printf("%s: cannot open dictionary file %s\n", progname, dict_name); + exit(1); + } + dict_len = (lzo_uint) lzo_fread(f,dict,DICT_LEN); + fclose(f); + } + + dict_adler32 = lzo_adler32(0,NULL,0); + dict_adler32 = lzo_adler32(dict_adler32,dict,dict_len); + printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n", + dict_name, (long) dict_len, (long) dict_adler32); + +/* + * Step 3: process files + */ + t_total = time(NULL); + for (r = 0; r == 0 && i < argc; i++) + r = do_file(argv[i], level); + t_total = time(NULL) - t_total; + + lzo_free(dict); + + if (total_n > 1) + print_file("***TOTALS***",total_d_len,total_c_len); + + printf("Dictionary compression test %s, execution time %lu seconds.\n", + r == 0 ? "passed" : "FAILED", (unsigned long) t_total); + return r; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/lzopack.c b/thirdparty/lzo/2.03/examples/lzopack.c new file mode 100644 index 0000000..6a3d848 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/lzopack.c @@ -0,0 +1,642 @@ +/* lzopack.c -- LZO example program: a simple file packer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// NOTE: this is an example program, so do not use to backup your data. +// +// This program lacks things like sophisticated file handling but is +// pretty complete regarding compression - it should provide a good +// starting point for adaption for your applications. +// +// Please study LZO.FAQ and simple.c first. +**************************************************************************/ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#include "examples/portab.h" + + +static const char *progname = NULL; + +static unsigned long total_in = 0; +static unsigned long total_out = 0; +static lzo_bool opt_debug = 0; + +/* magic file header for lzopack-compressed files */ +static const unsigned char magic[7] = + { 0x00, 0xe9, 0x4c, 0x5a, 0x4f, 0xff, 0x1a }; + + +/************************************************************************* +// file IO +**************************************************************************/ + +lzo_uint xread(FILE *fp, lzo_voidp buf, lzo_uint len, lzo_bool allow_eof) +{ + lzo_uint l; + + l = (lzo_uint) lzo_fread(fp, buf, len); + if (l > len) + { + fprintf(stderr, "\nsomething's wrong with your C library !!!\n"); + exit(1); + } + if (l != len && !allow_eof) + { + fprintf(stderr, "\nread error - premature end of file\n"); + exit(1); + } + total_in += (unsigned long) l; + return l; +} + +lzo_uint xwrite(FILE *fp, const lzo_voidp buf, lzo_uint len) +{ + if (fp != NULL && lzo_fwrite(fp, buf, len) != len) + { + fprintf(stderr, "\nwrite error (disk full ?)\n"); + exit(1); + } + total_out += (unsigned long) len; + return len; +} + + +int xgetc(FILE *fp) +{ + unsigned char c; + xread(fp, (lzo_voidp) &c, 1, 0); + return c; +} + +void xputc(FILE *fp, int c) +{ + unsigned char cc = (unsigned char) (c & 0xff); + xwrite(fp, (const lzo_voidp) &cc, 1); +} + +/* read and write portable 32-bit integers */ + +lzo_uint32 xread32(FILE *fp) +{ + unsigned char b[4]; + lzo_uint32 v; + + xread(fp, b, 4, 0); + v = (lzo_uint32) b[3] << 0; + v |= (lzo_uint32) b[2] << 8; + v |= (lzo_uint32) b[1] << 16; + v |= (lzo_uint32) b[0] << 24; + return v; +} + +void xwrite32(FILE *fp, lzo_xint v) +{ + unsigned char b[4]; + + b[3] = (unsigned char) ((v >> 0) & 0xff); + b[2] = (unsigned char) ((v >> 8) & 0xff); + b[1] = (unsigned char) ((v >> 16) & 0xff); + b[0] = (unsigned char) ((v >> 24) & 0xff); + xwrite(fp, b, 4); +} + + +/************************************************************************* +// compress +// +// possible improvement: we could use overlapping compression to +// save some memory - see overlap.c. This would require some minor +// changes in the decompression code as well, because if a block +// turns out to be incompressible we would still have to store it in its +// "compressed" (i.e. then slightly enlarged) form because the original +// (uncompressed) data would have been lost during the overlapping +// compression. +**************************************************************************/ + +int do_compress(FILE *fi, FILE *fo, int level, lzo_uint block_size) +{ + int r = 0; + lzo_bytep in = NULL; + lzo_bytep out = NULL; + lzo_bytep wrkmem = NULL; + lzo_uint in_len; + lzo_uint out_len; + lzo_uint32 wrk_len = 0; + lzo_uint32 flags = 1; /* do compute a checksum */ + int method = 1; /* compression method: LZO1X */ + lzo_uint32 checksum; + + total_in = total_out = 0; + +/* + * Step 1: write magic header, flags & block size, init checksum + */ + xwrite(fo, magic, sizeof(magic)); + xwrite32(fo, flags); + xputc(fo, method); /* compression method */ + xputc(fo, level); /* compression level */ + xwrite32(fo, block_size); + checksum = lzo_adler32(0, NULL, 0); + +/* + * Step 2: allocate compression buffers and work-memory + */ + in = (lzo_bytep) lzo_malloc(block_size); + out = (lzo_bytep) lzo_malloc(block_size + block_size / 16 + 64 + 3); + if (level == 9) + wrk_len = LZO1X_999_MEM_COMPRESS; + else + wrk_len = LZO1X_1_MEM_COMPRESS; + wrkmem = (lzo_bytep) lzo_malloc(wrk_len); + if (in == NULL || out == NULL || wrkmem == NULL) + { + printf("%s: out of memory\n", progname); + r = 1; + goto err; + } + +/* + * Step 3: process blocks + */ + for (;;) + { + /* read block */ + in_len = xread(fi, in, block_size, 1); + if (in_len <= 0) + break; + + /* update checksum */ + if (flags & 1) + checksum = lzo_adler32(checksum, in, in_len); + + /* clear wrkmem (not needed, only for debug/benchmark purposes) */ + if (opt_debug) + lzo_memset(wrkmem, 0xff, wrk_len); + + /* compress block */ + if (level == 9) + r = lzo1x_999_compress(in, in_len, out, &out_len, wrkmem); + else + r = lzo1x_1_compress(in, in_len, out, &out_len, wrkmem); + if (r != LZO_E_OK || out_len > in_len + in_len / 16 + 64 + 3) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + r = 2; + goto err; + } + + /* write uncompressed block size */ + xwrite32(fo, in_len); + + if (out_len < in_len) + { + /* write compressed block */ + xwrite32(fo, out_len); + xwrite(fo, out, out_len); + } + else + { + /* not compressible - write uncompressed block */ + xwrite32(fo, in_len); + xwrite(fo, in, in_len); + } + } + + /* write EOF marker */ + xwrite32(fo, 0); + + /* write checksum */ + if (flags & 1) + xwrite32(fo, checksum); + + r = 0; +err: + lzo_free(wrkmem); + lzo_free(out); + lzo_free(in); + return r; +} + + +/************************************************************************* +// decompress / test +// +// We are using overlapping (in-place) decompression to save some +// memory - see overlap.c. +**************************************************************************/ + +int do_decompress(FILE *fi, FILE *fo) +{ + int r = 0; + lzo_bytep buf = NULL; + lzo_uint buf_len; + unsigned char m [ sizeof(magic) ]; + lzo_uint32 flags; + int method; + int level; + lzo_uint block_size; + lzo_uint32 checksum; + + total_in = total_out = 0; + +/* + * Step 1: check magic header, read flags & block size, init checksum + */ + if (xread(fi, m, sizeof(magic),1) != sizeof(magic) || + memcmp(m, magic, sizeof(magic)) != 0) + { + printf("%s: header error - this file is not compressed by lzopack\n", progname); + r = 1; + goto err; + } + flags = xread32(fi); + method = xgetc(fi); + level = xgetc(fi); + if (method != 1) + { + printf("%s: header error - invalid method %d (level %d)\n", + progname, method, level); + r = 2; + goto err; + } + block_size = xread32(fi); + if (block_size < 1024 || block_size > 8*1024*1024L) + { + printf("%s: header error - invalid block size %ld\n", + progname, (long) block_size); + r = 3; + goto err; + } + checksum = lzo_adler32(0,NULL,0); + +/* + * Step 2: allocate buffer for in-place decompression + */ + buf_len = block_size + block_size / 16 + 64 + 3; + buf = (lzo_bytep) lzo_malloc(buf_len); + if (buf == NULL) + { + printf("%s: out of memory\n", progname); + r = 4; + goto err; + } + +/* + * Step 3: process blocks + */ + for (;;) + { + lzo_bytep in; + lzo_bytep out; + lzo_uint in_len; + lzo_uint out_len; + + /* read uncompressed size */ + out_len = xread32(fi); + + /* exit if last block (EOF marker) */ + if (out_len == 0) + break; + + /* read compressed size */ + in_len = xread32(fi); + + /* sanity check of the size values */ + if (in_len > block_size || out_len > block_size || + in_len == 0 || in_len > out_len) + { + printf("%s: block size error - data corrupted\n", progname); + r = 5; + goto err; + } + + /* place compressed block at the top of the buffer */ + in = buf + buf_len - in_len; + out = buf; + + /* read compressed block data */ + xread(fi, in, in_len, 0); + + if (in_len < out_len) + { + /* decompress - use safe decompressor as data might be corrupted + * during a file transfer */ + lzo_uint new_len = out_len; + + r = lzo1x_decompress_safe(in, in_len, out, &new_len, NULL); + if (r != LZO_E_OK || new_len != out_len) + { + printf("%s: compressed data violation\n", progname); + r = 6; + goto err; + } + /* write decompressed block */ + xwrite(fo, out, out_len); + /* update checksum */ + if (flags & 1) + checksum = lzo_adler32(checksum, out, out_len); + } + else + { + /* write original (incompressible) block */ + xwrite(fo, in, in_len); + /* update checksum */ + if (flags & 1) + checksum = lzo_adler32(checksum, in, in_len); + } + } + + /* read and verify checksum */ + if (flags & 1) + { + lzo_uint32 c = xread32(fi); + if (c != checksum) + { + printf("%s: checksum error - data corrupted\n", progname); + r = 7; + goto err; + } + } + + r = 0; +err: + lzo_free(buf); + return r; +} + + +/************************************************************************* +// +**************************************************************************/ + +static void usage(void) +{ + printf("usage: %s [-9] input-file output-file (compress)\n", progname); + printf("usage: %s -d input-file output-file (decompress)\n", progname); + printf("usage: %s -t input-file... (test)\n", progname); + exit(1); +} + + +/* open input file */ +static FILE *xopen_fi(const char *name) +{ + FILE *fp; + + fp = fopen(name, "rb"); + if (fp == NULL) + { + printf("%s: cannot open input file %s\n", progname, name); + exit(1); + } +#if defined(HAVE_STAT) && defined(S_ISREG) + { + struct stat st; + int is_regular = 1; + if (stat(name, &st) != 0 || !S_ISREG(st.st_mode)) + is_regular = 0; + if (!is_regular) + { + printf("%s: %s is not a regular file\n", progname, name); + fclose(fp); fp = NULL; + exit(1); + } + } +#endif + return fp; +} + + +/* open output file */ +static FILE *xopen_fo(const char *name) +{ + FILE *fp; + +#if 0 + /* this is an example program, so make sure we don't overwrite a file */ + fp = fopen(name, "rb"); + if (fp != NULL) + { + printf("%s: file %s already exists -- not overwritten\n", progname, name); + fclose(fp); fp = NULL; + exit(1); + } +#endif + fp = fopen(name, "wb"); + if (fp == NULL) + { + printf("%s: cannot open output file %s\n", progname, name); + exit(1); + } + return fp; +} + + +/* close file */ +static void xclose(FILE *fp) +{ + if (fp) + { + int err; + err = ferror(fp); + if (fclose(fp) != 0) + err = 1; + if (err) + { + printf("%s: error while closing file\n", progname); + exit(1); + } + } +} + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int i = 1; + int r = 0; + FILE *fi = NULL; + FILE *fo = NULL; + const char *in_name = NULL; + const char *out_name = NULL; + lzo_bool opt_decompress = 0; + lzo_bool opt_test = 0; + int opt_level = 1; + lzo_uint opt_block_size; + const char *s; + + lzo_wildargv(&argc, &argv); + + progname = argv[0]; + for (s = progname; *s; s++) + if ((*s == '/' || *s == '\\') && s[1]) + progname = s + 1; + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + +#if 0 + printf( +"*** DISCLAIMER ***\n" +" This is an example program, do not use to backup your data !\n" +" Get LZOP if you're interested into a full-featured packer.\n" +" See http://www.oberhumer.com/opensource/lzop/\n" +"\n"); +#endif + + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + + +/* + * Step 2: setup memory + */ + opt_block_size = 256 * 1024L; + +#if defined(ACC_MM_AHSHIFT) + /* reduce memory requirements for ancient 16-bit DOS 640kB real-mode */ + if (ACC_MM_AHSHIFT != 3) + opt_block_size = 16 * 1024L; +#endif + + +/* + * Step 3: get options + */ + + while (i < argc && argv[i][0] == '-') + { + if (strcmp(argv[i],"-d") == 0) + opt_decompress = 1; + else if (strcmp(argv[i],"-t") == 0) + opt_test = 1; + else if (strcmp(argv[i],"-9") == 0) + opt_level = 9; + else if (argv[i][1] == 'b' && argv[i][2]) + { + long b = atol(&argv[i][2]); + if (b >= 1024L && b <= 8*1024*1024L) + opt_block_size = (lzo_uint) b; + else + { + printf("%s: invalid block_size in option `%s'.\n", progname, argv[i]); + usage(); + } + } + else if (strcmp(argv[i],"--debug") == 0) + opt_debug += 1; + else + usage(); + i++; + } + if (opt_test && i >= argc) + usage(); + if (!opt_test && i + 2 != argc) + usage(); + + +/* + * Step 4: process file(s) + */ + + if (opt_test) + { + while (i < argc && r == 0) + { + in_name = argv[i++]; + fi = xopen_fi(in_name); + r = do_decompress(fi, NULL); + if (r == 0) + printf("%s: %s tested ok (%lu -> %lu bytes)\n", + progname, in_name, total_in, total_out); + xclose(fi); fi = NULL; + } + } + else if (opt_decompress) + { + in_name = argv[i++]; + out_name = argv[i++]; + fi = xopen_fi(in_name); + fo = xopen_fo(out_name); + r = do_decompress(fi, fo); + if (r == 0) + printf("%s: decompressed %lu into %lu bytes\n", + progname, total_in, total_out); + } + else /* compress */ + { + in_name = argv[i++]; + out_name = argv[i++]; + fi = xopen_fi(in_name); + fo = xopen_fo(out_name); + r = do_compress(fi, fo, opt_level, opt_block_size); + if (r == 0) + printf("%s: compressed %lu into %lu bytes\n", + progname, total_in, total_out); + } + + xclose(fi); fi = NULL; + xclose(fo); fo = NULL; + return r; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/overlap.c b/thirdparty/lzo/2.03/examples/overlap.c new file mode 100644 index 0000000..7eeb52f --- /dev/null +++ b/thirdparty/lzo/2.03/examples/overlap.c @@ -0,0 +1,337 @@ +/* overlap.c -- example program: overlapping (de)compression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// This program shows how to do overlapping compression and +// in-place decompression. +// +// Please study LZO.FAQ and simple.c first. +**************************************************************************/ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#include "examples/portab.h" + + +/* Overhead (in bytes) for the in-place decompression buffer. + * Most files need only 16 ! + * (try `overlap -16 file' or even `overlap -8 file') + * + * Worst case (for files that are compressible by only a few bytes) + * is 'in_len / 16 + 64 + 3'. See step 5a) below. + * + * For overlapping compression '0xbfff + in_len / 16 + 64 + 3' bytes + * will be needed. See step 4a) below. + */ + +static lzo_uint opt_overhead = 0; /* assume worst case */ + + +#if 0 && defined(LZO_USE_ASM) + /* just for testing */ +# include +# define lzo1x_decompress lzo1x_decompress_asm_fast +#endif + + +/************************************************************************* +// +**************************************************************************/ + +static const char *progname = NULL; + +static unsigned long total_files = 0; +static unsigned long total_in = 0; + + +static lzo_bytep xmalloc(lzo_uint len) +{ + lzo_bytep p; + + p = (lzo_bytep) lzo_malloc(len > 0 ? len : 1); + if (p == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + return p; +} + + +/************************************************************************* +// +**************************************************************************/ + +int do_file ( const char *in_name ) +{ + int r; + FILE *f = NULL; + long l; + + lzo_bytep wrkmem = NULL; + + lzo_bytep in = NULL; + lzo_uint in_len; /* uncompressed length */ + + lzo_bytep out = NULL; + lzo_uint out_len; /* compressed length */ + + lzo_bytep overlap = NULL; + lzo_uint overhead; + lzo_uint offset; + + lzo_uint new_len = 0; + +/* + * Step 1: open the input file + */ + f = fopen(in_name,"rb"); + if (f == NULL) + { + printf("%s: %s: cannot open file\n", progname, in_name); + goto next_file; + } + fseek(f,0,SEEK_END); + l = ftell(f); + fseek(f,0,SEEK_SET); + if (l <= 0) + { + printf("%s: %s: empty file -- skipping\n", progname, in_name); + goto next_file; + } + in_len = (lzo_uint) l; + +/* + * Step 2: allocate compression buffers and read the file + */ + in = xmalloc(in_len); + out = xmalloc(in_len + in_len / 16 + 64 + 3); + wrkmem = xmalloc(LZO1X_1_MEM_COMPRESS); + in_len = (lzo_uint) lzo_fread(f,in,in_len); + fclose(f); f = NULL; + printf("%s: %s: read %ld bytes\n", progname, in_name, (long) in_len); + + total_files++; + total_in += (unsigned long) in_len; + +/* + * Step 3: compress from `in' to `out' with LZO1X-1 + */ + r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem); + if (r != LZO_E_OK || out_len > in_len + in_len / 16 + 64 + 3) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + exit(1); + } + printf("%-26s %8lu -> %8lu\n", "LZO1X-1:", (long) in_len, (long) out_len); + + +/***** Step 4: overlapping compression *****/ + +/* + * Step 4a: allocate the `overlap' buffer for overlapping compression + */ + overhead = in_len > 0xbfff ? 0xbfff : in_len; + overhead += in_len / 16 + 64 + 3; + overlap = xmalloc(in_len + overhead); + +/* + * Step 4b: prepare data in `overlap' buffer. + * copy uncompressed data at the top of the overlap buffer + */ + /*** offset = in_len + overhead - in_len; ***/ + offset = overhead; + lzo_memcpy(overlap + offset, in, in_len); + +/* + * Step 4c: do an in-place compression within the `overlap' buffer + */ + r = lzo1x_1_compress(overlap+offset,in_len,overlap,&new_len,wrkmem); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("overlapping compression failed: %d\n", r); + exit(1); + } + +/* + * Step 4d: verify overlapping compression + */ + if (new_len != out_len || lzo_memcmp(out,overlap,out_len) != 0) + { + /* As compression is non-deterministic there can be a difference + * in the representation of the compressed data (but this usually + * happens very seldom). So we have to verify the overlapping + * compression by doing a temporary decompression. + */ + lzo_uint l = in_len; + lzo_bytep tmp = xmalloc(l); + r = lzo1x_decompress_safe(overlap,new_len,tmp,&l,NULL); + if (r != LZO_E_OK || l != in_len || lzo_memcmp(in,tmp,l) != 0) + { + /* this should NEVER happen */ + printf("overlapping compression data error\n"); + exit(1); + } + lzo_free(tmp); + } + + printf("overlapping compression: %8lu -> %8lu overhead: %7ld\n", + (long) in_len, (long) new_len, (long) overhead); + lzo_free(overlap); overlap = NULL; + + +/***** Step 5: overlapping decompression *****/ + +/* + * Step 5a: allocate the `overlap' buffer for in-place decompression + */ + if (opt_overhead == 0 || out_len >= in_len) + overhead = in_len / 16 + 64 + 3; + else + overhead = opt_overhead; + overlap = xmalloc(in_len + overhead); + +/* + * Step 5b: prepare data in `overlap' buffer. + * copy compressed data at the top of the overlap buffer + */ + offset = in_len + overhead - out_len; + lzo_memcpy(overlap + offset, out, out_len); + +/* + * Step 5c: do an in-place decompression within the `overlap' buffer + */ + new_len = in_len; + r = lzo1x_decompress(overlap+offset,out_len,overlap,&new_len,NULL); + if (r != LZO_E_OK) + { + /* this may happen if overhead is too small */ + printf("overlapping decompression failed: %d - increase `opt_overhead'\n", r); + exit(1); + } + +/* + * Step 5d: verify decompression + */ + if (new_len != in_len || lzo_memcmp(in,overlap,in_len) != 0) + { + /* this may happen if overhead is too small */ + printf("overlapping decompression data error - increase `opt_overhead'\n"); + exit(1); + } + printf("overlapping decompression: %8lu -> %8lu overhead: %7ld\n", + (long) out_len, (long) new_len, (long) overhead); + lzo_free(overlap); overlap = NULL; + + +next_file: + lzo_free(overlap); + lzo_free(wrkmem); + lzo_free(out); + lzo_free(in); + if (f) fclose(f); + + return 0; +} + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int r; + int i = 1; + + lzo_wildargv(&argc, &argv); + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + + progname = argv[0]; + if (i < argc && argv[i][0] == '-') + opt_overhead = atoi(&argv[i++][1]); +#if 1 + if (opt_overhead != 0 && opt_overhead < 8) + { + printf("%s: invalid overhead value %ld\n", progname, (long)opt_overhead); + exit(1); + } +#endif + if (i >= argc) + { + printf("usage: %s [-overhead_in_bytes] file..\n", progname); + exit(1); + } + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + +/* + * Step 2: process files + */ + for (r = 0; r == 0 && i < argc; i++) + r = do_file(argv[i]); + + printf("\nDone. Successfully processed %lu bytes in %lu files.\n", + total_in, total_files); + return r; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/portab.h b/thirdparty/lzo/2.03/examples/portab.h new file mode 100644 index 0000000..1405b44 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/portab.h @@ -0,0 +1,162 @@ +/* portab.h -- portability layer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo/lzoconf.h" + +#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1200)) + /* avoid `-W4' warnings in system header files */ +# pragma warning(disable: 4201 4214 4514) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) + /* avoid `-Wall' warnings in system header files */ +# pragma warning(disable: 4163 4255 4820) + /* avoid warnings about inlining */ +# pragma warning(disable: 4710 4711) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1400)) + /* avoid warnings when using "deprecated" POSIX functions */ +# pragma warning(disable: 4996) +#endif +#if (LZO_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(disable:2002) +#endif + + +/************************************************************************* +// +**************************************************************************/ + +#if defined(__LZO_MMODEL_HUGE) || !(defined(LZO_LIBC_ISOC90) || defined(LZO_LIBC_ISOC99)) + +#include "examples/portab_a.h" + +#else + +/* INFO: + * The "portab_a.h" version above uses the ACC library to add + * support for ancient systems (like 16-bit DOS) and to provide + * some gimmicks like Windows high-resolution timers. + * Still, on any halfway modern machine you can also use the + * following pure ANSI-C code instead. + */ + +#include +#include +#include +#include +#include +#include +#if defined(CLK_TCK) && !defined(CLOCKS_PER_SEC) +# define CLOCKS_PER_SEC CLK_TCK +#endif + +#if defined(WANT_LZO_MALLOC) +# define lzo_malloc(a) (malloc(a)) +# define lzo_free(a) (free(a)) +#endif +#if defined(WANT_LZO_FREAD) +# define lzo_fread(f,b,s) (fread(b,1,s,f)) +# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f)) +#endif +#if defined(WANT_LZO_UCLOCK) +# define lzo_uclock_handle_t int +# define lzo_uclock_t double +# define lzo_uclock_open(a) ((void)(a)) +# define lzo_uclock_close(a) ((void)(a)) +# define lzo_uclock_read(a,b) *(b) = (clock() / (double)(CLOCKS_PER_SEC)) +# define lzo_uclock_get_elapsed(a,b,c) (*(c) - *(b)) +#endif +#if defined(WANT_LZO_WILDARGV) +# define lzo_wildargv(a,b) ((void)0) +#endif + +#endif + + +/************************************************************************* +// misc +**************************************************************************/ + +/* turn on assertions */ +#undef NDEBUG +#include + +/* just in case */ +#undef xmalloc +#undef xfree +#undef xread +#undef xwrite +#undef xputc +#undef xgetc +#undef xread32 +#undef xwrite32 + + +#if defined(WANT_LZO_UCLOCK) + +/* High quality benchmarking. + * + * Flush the CPU cache to get more accurate benchmark values. + * This needs custom kernel patches. As a result - in combination with + * the perfctr Linux kernel patches - accurate high-quality benchmarking + * is possible. + * + * All other methods (rdtsc, QueryPerformanceCounter, gettimeofday, ...) + * are completely unreliable for our purposes, and the only other + * option is to boot into a legacy single-task operating system + * like plain MSDOS and to directly reprogram the hardware clock. + * [The djgpp2 port of the gcc compiler has support functions for this.] + * + * Also, for embedded systems it's best to benchmark by using a + * CPU emulator/simulator software that can exactly count all + * virtual clock ticks. + */ + +#if !defined(lzo_uclock_flush_cpu_cache) +# define lzo_uclock_flush_cpu_cache(h,flags) ((void)(h)) +#endif + +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/portab_a.h b/thirdparty/lzo/2.03/examples/portab_a.h new file mode 100644 index 0000000..a58ba99 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/portab_a.h @@ -0,0 +1,128 @@ +/* portab_a.h -- advanced portability layer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// use the ACC library for the hard work +**************************************************************************/ + +#if defined(LZO_HAVE_CONFIG_H) +# define ACC_CONFIG_NO_HEADER 1 +#endif + +#define ACC_WANT_ACC_INCD_H 1 +#define ACC_WANT_ACC_INCE_H 1 +#if defined(__LZO_MMODEL_HUGE) || defined(WANT_LZO_UCLOCK) || defined(WANT_LZO_WILDARGV) +# define ACC_WANT_ACC_INCI_H 1 +# define ACC_WANT_ACC_LIB_H 1 +#endif +#include "src/miniacc.h" + +#if defined(WANT_LZO_MALLOC) +# if defined(__LZO_MMODEL_HUGE) +# define ACC_WANT_ACCLIB_HALLOC 1 +# else +# define acc_halloc(a) (malloc(a)) +# define acc_hfree(a) (free(a)) +# endif +#endif +#if defined(WANT_LZO_FREAD) +# if defined(__LZO_MMODEL_HUGE) +# define ACC_WANT_ACCLIB_HFREAD 1 +# else +# define acc_hfread(f,b,s) (fread(b,1,s,f)) +# define acc_hfwrite(f,b,s) (fwrite(b,1,s,f)) +# endif +#endif +#if defined(WANT_LZO_UCLOCK) +# define ACC_WANT_ACCLIB_PCLOCK 1 +# if 0 && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# define __ACCLIB_PCLOCK_USE_RDTSC 1 +# define ACC_WANT_ACCLIB_RDTSC 1 +# endif +#endif +#if defined(WANT_LZO_WILDARGV) +# define ACC_WANT_ACCLIB_WILDARGV 1 +#endif +#if defined(__ACCLIB_PCLOCK_USE_PERFCTR) +# include "src/fullacc.h" +# define lzo_uclock_flush_cpu_cache(h,flags) acc_pclock_flush_cpu_cache(h,flags) +#else +# include "src/miniacc.h" +#endif + +#if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED) +# define ACC_WANT_ACCLIB_HMEMCPY 1 +# include "src/miniacc.h" +#endif + + +/************************************************************************* +// finally pull into the LZO namespace +**************************************************************************/ + +#undef lzo_malloc +#undef lzo_free +#undef lzo_fread +#undef lzo_fwrite +#if defined(WANT_LZO_MALLOC) +# define lzo_malloc(a) acc_halloc(a) +# define lzo_free(a) acc_hfree(a) +#endif +#if defined(WANT_LZO_FREAD) +# define lzo_fread(f,b,s) acc_hfread(f,b,s) +# define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s) +#endif +#if defined(WANT_LZO_UCLOCK) +# define lzo_uclock_handle_t acc_pclock_handle_t +# define lzo_uclock_t acc_pclock_t +# define lzo_uclock_open(a) acc_pclock_open_default(a) +# define lzo_uclock_close(a) acc_pclock_close(a) +# define lzo_uclock_read(a,b) acc_pclock_read(a,b) +# define lzo_uclock_get_elapsed(a,b,c) acc_pclock_get_elapsed(a,b,c) +#endif +#if defined(WANT_LZO_WILDARGV) +# define lzo_wildargv(a,b) acc_wildargv(a,b) +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/precomp.c b/thirdparty/lzo/2.03/examples/precomp.c new file mode 100644 index 0000000..10f4e7f --- /dev/null +++ b/thirdparty/lzo/2.03/examples/precomp.c @@ -0,0 +1,345 @@ +/* precomp.c -- example program: how to generate pre-compressed data + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// This program shows how to generate pre-compressed data. +// +// Please study LZO.FAQ and simple.c first. +// +// We will be trying both LZO1X-999 and LZO1Y-999 and choose +// the algorithm that achieves the best compression ratio. +**************************************************************************/ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" +#include "lzo/lzo1y.h" + +#define USE_LZO1X 1 +#define USE_LZO1Y 1 + +#define PARANOID 1 + + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#include "examples/portab.h" + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int r; + + lzo_bytep in; + lzo_uint in_len; + + lzo_bytep out; + lzo_uint out_bufsize; + lzo_uint out_len = 0; + + lzo_bytep wrkmem; + lzo_uint wrk_len; + + lzo_uint best_len; + int best_compress = -1; + + lzo_uint orig_len; + lzo_uint32 uncompressed_checksum; + lzo_uint32 compressed_checksum; + + FILE *f; + const char *progname = NULL; + const char *in_name = NULL; + const char *out_name = NULL; + long l; + + + lzo_wildargv(&argc, &argv); + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + + progname = argv[0]; + if (argc < 2 || argc > 3) + { + printf("usage: %s file [output-file]\n", progname); + exit(1); + } + in_name = argv[1]; + if (argc > 2) out_name = argv[2]; + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + +/* + * Step 2: allocate the work-memory + */ + wrk_len = 1; +#ifdef USE_LZO1X + if (wrk_len < LZO1X_999_MEM_COMPRESS) + wrk_len = LZO1X_999_MEM_COMPRESS; +#endif +#ifdef USE_LZO1Y + if (wrk_len < LZO1Y_999_MEM_COMPRESS) + wrk_len = LZO1Y_999_MEM_COMPRESS; +#endif + wrkmem = (lzo_bytep) lzo_malloc(wrk_len); + if (wrkmem == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + +/* + * Step 3: open the input file + */ + f = fopen(in_name,"rb"); + if (f == NULL) + { + printf("%s: cannot open file %s\n", progname, in_name); + exit(1); + } + fseek(f,0,SEEK_END); + l = ftell(f); + fseek(f,0,SEEK_SET); + if (l <= 0) + { + printf("%s: %s: empty file\n", progname, in_name); + fclose(f); + exit(1); + } + in_len = (lzo_uint) l; + out_bufsize = in_len + in_len / 16 + 64 + 3; + best_len = in_len; + +/* + * Step 4: allocate compression buffers and read the file + */ + in = (lzo_bytep) lzo_malloc(in_len); + out = (lzo_bytep) lzo_malloc(out_bufsize); + if (in == NULL || out == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + in_len = (lzo_uint) lzo_fread(f,in,in_len); + printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len); + fclose(f); + +/* + * Step 5: compute a checksum of the uncompressed data + */ + uncompressed_checksum = lzo_adler32(0,NULL,0); + uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len); + +/* + * Step 6a: compress from `in' to `out' with LZO1X-999 + */ +#ifdef USE_LZO1X + out_len = out_bufsize; + r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + exit(1); + } + printf("LZO1X-999: %8lu -> %8lu\n", (unsigned long) in_len, (unsigned long) out_len); + if (out_len < best_len) + { + best_len = out_len; + best_compress = 1; /* LZO1X-999 */ + } +#endif /* USE_LZO1X */ + +/* + * Step 6b: compress from `in' to `out' with LZO1Y-999 + */ +#ifdef USE_LZO1Y + out_len = out_bufsize; + r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + exit(1); + } + printf("LZO1Y-999: %8lu -> %8lu\n", (unsigned long) in_len, (unsigned long) out_len); + if (out_len < best_len) + { + best_len = out_len; + best_compress = 2; /* LZO1Y-999 */ + } +#endif /* USE_LZO1Y */ + +/* + * Step 7: check if compressible + */ + if (best_len >= in_len) + { + printf("This file contains incompressible data.\n"); + return 0; + } + +/* + * Step 8: compress data again using the best compressor found + */ + out_len = out_bufsize; + if (best_compress == 1) + r = lzo1x_999_compress(in,in_len,out,&out_len,wrkmem); + else if (best_compress == 2) + r = lzo1y_999_compress(in,in_len,out,&out_len,wrkmem); + else + r = -100; + assert(r == LZO_E_OK); + assert(out_len == best_len); + +/* + * Step 9: optimize compressed data (compressed data is in `out' buffer) + */ +#if 1 + /* Optimization does not require any data in the buffer that will + * hold the uncompressed data. To prove this, we clear the buffer. + */ + lzo_memset(in,0,in_len); +#endif + + orig_len = in_len; + r = -100; +#ifdef USE_LZO1X + if (best_compress == 1) + r = lzo1x_optimize(out,out_len,in,&orig_len,NULL); +#endif +#ifdef USE_LZO1Y + if (best_compress == 2) + r = lzo1y_optimize(out,out_len,in,&orig_len,NULL); +#endif + if (r != LZO_E_OK || orig_len != in_len) + { + /* this should NEVER happen */ + printf("internal error - optimization failed: %d\n", r); + exit(1); + } + +/* + * Step 10: compute a checksum of the compressed data + */ + compressed_checksum = lzo_adler32(0,NULL,0); + compressed_checksum = lzo_adler32(compressed_checksum,out,out_len); + +/* + * Step 11: write compressed data to a file + */ + printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n", + progname, in_name, (long) in_len, (long) out_len, + (long) uncompressed_checksum, (long) compressed_checksum); + + if (out_name && out_name[0]) + { + printf("%s: writing to file %s\n", progname, out_name); + f = fopen(out_name,"wb"); + if (f == NULL) + { + printf("%s: cannot open output file %s\n", progname, out_name); + exit(1); + } + if (lzo_fwrite(f,out,out_len) != out_len || fclose(f) != 0) + { + printf("%s: write error !!\n", progname); + exit(1); + } + } + +/* + * Step 12: verify decompression + */ +#ifdef PARANOID + lzo_memset(in,0,in_len); /* paranoia - clear output buffer */ + orig_len = in_len; + r = -100; +#ifdef USE_LZO1X + if (best_compress == 1) + r = lzo1x_decompress_safe(out,out_len,in,&orig_len,NULL); +#endif +#ifdef USE_LZO1Y + if (best_compress == 2) + r = lzo1y_decompress_safe(out,out_len,in,&orig_len,NULL); +#endif + if (r != LZO_E_OK || orig_len != in_len) + { + /* this should NEVER happen */ + printf("internal error - decompression failed: %d\n", r); + exit(1); + } + if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len)) + { + /* this should NEVER happen */ + printf("internal error - decompression data error\n"); + exit(1); + } + /* Now you could also verify decompression under similar conditions as in + * your application, e.g. overlapping assembler decompression etc. + */ +#endif + + lzo_free(in); + lzo_free(out); + lzo_free(wrkmem); + + return 0; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/precomp2.c b/thirdparty/lzo/2.03/examples/precomp2.c new file mode 100644 index 0000000..44b066a --- /dev/null +++ b/thirdparty/lzo/2.03/examples/precomp2.c @@ -0,0 +1,397 @@ +/* precomp2.c -- example program: how to generate pre-compressed data + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// This program shows how to generate pre-compressed data. +// +// Please study precomp.c first. +// +// We will be trying LZO1X-999 and LZO1Y-999, and we will be trying +// various parameters using the internal interface to squeeze out +// a little bit of extra compression. +// +// NOTE: this program can be quite slow for highly redundant files +**************************************************************************/ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" +#include "lzo/lzo1y.h" + +LZO_EXTERN(int) +lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int try_lazy, + lzo_uint good_length, + lzo_uint max_lazy, + lzo_uint nice_length, + lzo_uint max_chain, + lzo_uint32 flags ); + +LZO_EXTERN(int) +lzo1y_999_compress_internal ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int try_lazy, + lzo_uint good_length, + lzo_uint max_lazy, + lzo_uint nice_length, + lzo_uint max_chain, + lzo_uint32 flags ); + +#define USE_LZO1X 1 +#define USE_LZO1Y 1 + +#define PARANOID 1 + + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#include "examples/portab.h" + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int r; + int lazy; + const int max_try_lazy = 5; + const lzo_uint big = 65536L; /* can result in very slow compression */ + const lzo_uint32 flags = 0x1; + + lzo_bytep in; + lzo_uint in_len; + + lzo_bytep out; + lzo_uint out_bufsize; + lzo_uint out_len = 0; + + lzo_bytep wrkmem; + lzo_uint wrk_len; + + lzo_uint best_len; + int best_compress = -1; + int best_lazy = -1; + + lzo_uint orig_len; + lzo_uint32 uncompressed_checksum; + lzo_uint32 compressed_checksum; + + FILE *f; + const char *progname = NULL; + const char *in_name = NULL; + const char *out_name = NULL; + long l; + + + lzo_wildargv(&argc, &argv); + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + + progname = argv[0]; + if (argc < 2 || argc > 3) + { + printf("usage: %s file [output-file]\n", progname); + exit(1); + } + in_name = argv[1]; + if (argc > 2) out_name = argv[2]; + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + +/* + * Step 2: allocate the work-memory + */ + wrk_len = 1; +#ifdef USE_LZO1X + if (wrk_len < LZO1X_999_MEM_COMPRESS) + wrk_len = LZO1X_999_MEM_COMPRESS; +#endif +#ifdef USE_LZO1Y + if (wrk_len < LZO1Y_999_MEM_COMPRESS) + wrk_len = LZO1Y_999_MEM_COMPRESS; +#endif + wrkmem = (lzo_bytep) lzo_malloc(wrk_len); + if (wrkmem == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + +/* + * Step 3: open the input file + */ + f = fopen(in_name,"rb"); + if (f == NULL) + { + printf("%s: cannot open file %s\n", progname, in_name); + exit(1); + } + fseek(f,0,SEEK_END); + l = ftell(f); + fseek(f,0,SEEK_SET); + if (l <= 0) + { + printf("%s: %s: empty file\n", progname, in_name); + fclose(f); + exit(1); + } + in_len = (lzo_uint) l; + out_bufsize = in_len + in_len / 16 + 64 + 3; + best_len = in_len; + +/* + * Step 4: allocate compression buffers and read the file + */ + in = (lzo_bytep) lzo_malloc(in_len); + out = (lzo_bytep) lzo_malloc(out_bufsize); + if (in == NULL || out == NULL) + { + printf("%s: out of memory\n", progname); + exit(1); + } + in_len = (lzo_uint) lzo_fread(f,in,in_len); + printf("%s: loaded file %s: %ld bytes\n", progname, in_name, (long) in_len); + fclose(f); + +/* + * Step 5: compute a checksum of the uncompressed data + */ + uncompressed_checksum = lzo_adler32(0,NULL,0); + uncompressed_checksum = lzo_adler32(uncompressed_checksum,in,in_len); + +/* + * Step 6a: compress from `in' to `out' with LZO1X-999 + */ +#ifdef USE_LZO1X + for (lazy = 0; lazy <= max_try_lazy; lazy++) + { + out_len = out_bufsize; + r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem, + NULL, 0, 0, + lazy, big, big, big, big, flags); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + exit(1); + } + printf("LZO1X-999: lazy =%2d: %8lu -> %8lu\n", + lazy, (unsigned long) in_len, (unsigned long) out_len); + if (out_len < best_len) + { + best_len = out_len; + best_lazy = lazy; + best_compress = 1; /* LZO1X-999 */ + } + } +#endif /* USE_LZO1X */ + +/* + * Step 6b: compress from `in' to `out' with LZO1Y-999 + */ +#ifdef USE_LZO1Y + for (lazy = 0; lazy <= max_try_lazy; lazy++) + { + out_len = out_bufsize; + r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem, + NULL, 0, 0, + lazy, big, big, big, big, flags); + if (r != LZO_E_OK) + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + exit(1); + } + printf("LZO1Y-999: lazy =%2d: %8lu -> %8lu\n", + lazy, (unsigned long) in_len, (unsigned long) out_len); + if (out_len < best_len) + { + best_len = out_len; + best_lazy = lazy; + best_compress = 2; /* LZO1Y-999 */ + } + } +#endif /* USE_LZO1Y */ + +/* + * Step 7: check if compressible + */ + if (best_len >= in_len) + { + printf("This file contains incompressible data.\n"); + return 0; + } + +/* + * Step 8: compress data again using the best compressor found + */ + out_len = out_bufsize; + if (best_compress == 1) + r = lzo1x_999_compress_internal(in,in_len,out,&out_len,wrkmem, + NULL, 0, 0, + best_lazy, big, big, big, big, flags); + else if (best_compress == 2) + r = lzo1y_999_compress_internal(in,in_len,out,&out_len,wrkmem, + NULL, 0, 0, + best_lazy, big, big, big, big, flags); + else + r = -100; + assert(r == LZO_E_OK); + assert(out_len == best_len); + +/* + * Step 9: optimize compressed data (compressed data is in `out' buffer) + */ +#if 1 + /* Optimization does not require any data in the buffer that will + * hold the uncompressed data. To prove this, we clear the buffer. + */ + lzo_memset(in,0,in_len); +#endif + + orig_len = in_len; + r = -100; +#ifdef USE_LZO1X + if (best_compress == 1) + r = lzo1x_optimize(out,out_len,in,&orig_len,NULL); +#endif +#ifdef USE_LZO1Y + if (best_compress == 2) + r = lzo1y_optimize(out,out_len,in,&orig_len,NULL); +#endif + if (r != LZO_E_OK || orig_len != in_len) + { + /* this should NEVER happen */ + printf("internal error - optimization failed: %d\n", r); + exit(1); + } + +/* + * Step 10: compute a checksum of the compressed data + */ + compressed_checksum = lzo_adler32(0,NULL,0); + compressed_checksum = lzo_adler32(compressed_checksum,out,out_len); + +/* + * Step 11: write compressed data to a file + */ + printf("%s: %s: %ld -> %ld, checksum 0x%08lx 0x%08lx\n", + progname, in_name, (long) in_len, (long) out_len, + (long) uncompressed_checksum, (long) compressed_checksum); + + if (out_name && out_name[0]) + { + printf("%s: writing to file %s\n", progname, out_name); + f = fopen(out_name,"wb"); + if (f == NULL) + { + printf("%s: cannot open output file %s\n", progname, out_name); + exit(1); + } + if (lzo_fwrite(f,out,out_len) != out_len || fclose(f) != 0) + { + printf("%s: write error !!\n", progname); + exit(1); + } + } + +/* + * Step 12: verify decompression + */ +#ifdef PARANOID + lzo_memset(in,0,in_len); /* paranoia - clear output buffer */ + orig_len = in_len; + r = -100; +#ifdef USE_LZO1X + if (best_compress == 1) + r = lzo1x_decompress_safe(out,out_len,in,&orig_len,NULL); +#endif +#ifdef USE_LZO1Y + if (best_compress == 2) + r = lzo1y_decompress_safe(out,out_len,in,&orig_len,NULL); +#endif + if (r != LZO_E_OK || orig_len != in_len) + { + /* this should NEVER happen */ + printf("internal error - decompression failed: %d\n", r); + exit(1); + } + if (uncompressed_checksum != lzo_adler32(lzo_adler32(0,NULL,0),in,in_len)) + { + /* this should NEVER happen */ + printf("internal error - decompression data error\n"); + exit(1); + } + /* Now you could also verify decompression under similar conditions as in + * your application, e.g. overlapping assembler decompression etc. + */ +#endif + + lzo_free(in); + lzo_free(out); + lzo_free(wrkmem); + + return 0; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/examples/simple.c b/thirdparty/lzo/2.03/examples/simple.c new file mode 100644 index 0000000..15611c9 --- /dev/null +++ b/thirdparty/lzo/2.03/examples/simple.c @@ -0,0 +1,168 @@ +/* simple.c -- the annotated simple example program for the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// This program shows the basic usage of the LZO library. +// We will compress a block of data and decompress again. +// +// See also LZO.FAQ +**************************************************************************/ + +/* We will be using the LZO1X-1 algorithm, so we have + * to include + */ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" + + +/* We want to compress the data block at `in' with length `IN_LEN' to + * the block at `out'. Because the input block may be incompressible, + * we must provide a little more output space in case that compression + * is not possible. + */ + +#ifndef IN_LEN +#define IN_LEN (128*1024L) +#endif +#define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3) + + +/************************************************************************* +// +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int r; + lzo_bytep in; + lzo_bytep out; + lzo_bytep wrkmem; + lzo_uint in_len; + lzo_uint out_len; + lzo_uint new_len; + + if (argc < 0 && argv == NULL) /* avoid warning about unused args */ + return 0; + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + return 4; + } + +/* + * Step 2: allocate blocks and the work-memory + */ + in = (lzo_bytep) lzo_malloc(IN_LEN); + out = (lzo_bytep) lzo_malloc(OUT_LEN); + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS); + if (in == NULL || out == NULL || wrkmem == NULL) + { + printf("out of memory\n"); + return 3; + } + +/* + * Step 3: prepare the input block that will get compressed. + * We just fill it with zeros in this example program, + * but you would use your real-world data here. + */ + in_len = IN_LEN; + lzo_memset(in,0,in_len); + +/* + * Step 4: compress from `in' to `out' with LZO1X-1 + */ + r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem); + if (r == LZO_E_OK) + printf("compressed %lu bytes into %lu bytes\n", + (unsigned long) in_len, (unsigned long) out_len); + else + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + return 2; + } + /* check for an incompressible block */ + if (out_len >= in_len) + { + printf("This block contains incompressible data.\n"); + return 0; + } + +/* + * Step 5: decompress again, now going from `out' to `in' + */ + new_len = in_len; + r = lzo1x_decompress(out,out_len,in,&new_len,NULL); + if (r == LZO_E_OK && new_len == in_len) + printf("decompressed %lu bytes back into %lu bytes\n", + (unsigned long) out_len, (unsigned long) in_len); + else + { + /* this should NEVER happen */ + printf("internal error - decompression failed: %d\n", r); + return 1; + } + + lzo_free(wrkmem); + lzo_free(out); + lzo_free(in); + printf("Simple compression test passed.\n"); + return 0; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/include/Makefile.am b/thirdparty/lzo/2.03/include/Makefile.am new file mode 100644 index 0000000..5ad18f4 --- /dev/null +++ b/thirdparty/lzo/2.03/include/Makefile.am @@ -0,0 +1,6 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +SUBDIRS = lzo diff --git a/thirdparty/lzo/2.03/include/Makefile.in b/thirdparty/lzo/2.03/include/Makefile.in new file mode 100644 index 0000000..c5cb4e7 --- /dev/null +++ b/thirdparty/lzo/2.03/include/Makefile.in @@ -0,0 +1,487 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +SUBDIRS = lzo +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/include/lzo/Makefile.am b/thirdparty/lzo/2.03/include/lzo/Makefile.am new file mode 100644 index 0000000..39537bb --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/Makefile.am @@ -0,0 +1,10 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +pkginclude_HEADERS = \ + lzoconf.h lzodefs.h lzoutil.h lzo_asm.h \ + lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \ + lzo2a.h + diff --git a/thirdparty/lzo/2.03/include/lzo/Makefile.in b/thirdparty/lzo/2.03/include/lzo/Makefile.in new file mode 100644 index 0000000..8bd26ce --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/Makefile.in @@ -0,0 +1,412 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = include/lzo +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +pkginclude_HEADERS = \ + lzoconf.h lzodefs.h lzoutil.h lzo_asm.h \ + lzo1.h lzo1a.h lzo1b.h lzo1c.h lzo1f.h lzo1x.h lzo1y.h lzo1z.h \ + lzo2a.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/lzo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/lzo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-pkgincludeHEADERS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-pkgincludeHEADERS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1.h b/thirdparty/lzo/2.03/include/lzo/lzo1.h new file mode 100644 index 0000000..480053a --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1.h @@ -0,0 +1,96 @@ +/* lzo1.h -- public interface of the LZO1 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1_H_INCLUDED +#define __LZO1_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t)) +#define LZO1_MEM_DECOMPRESS (0) + + +LZO_EXTERN(int) +lzo1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +LZO_EXTERN(int) +lzo1_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1_99_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1a.h b/thirdparty/lzo/2.03/include/lzo/lzo1a.h new file mode 100644 index 0000000..a24eeca --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1a.h @@ -0,0 +1,96 @@ +/* lzo1a.h -- public interface of the LZO1A compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1A_H_INCLUDED +#define __LZO1A_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1A_MEM_COMPRESS ((lzo_uint32) (8192L * lzo_sizeof_dict_t)) +#define LZO1A_MEM_DECOMPRESS (0) + + +LZO_EXTERN(int) +lzo1a_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +LZO_EXTERN(int) +lzo1a_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1A_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1a_99_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1b.h b/thirdparty/lzo/2.03/include/lzo/lzo1b.h new file mode 100644 index 0000000..48dea08 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1b.h @@ -0,0 +1,160 @@ +/* lzo1b.h -- public interface of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1B_H_INCLUDED +#define __LZO1B_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1B_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1B_MEM_DECOMPRESS (0) + + +/* compression levels */ +#define LZO1B_BEST_SPEED 1 +#define LZO1B_BEST_COMPRESSION 9 +#define LZO1B_DEFAULT_COMPRESSION (-1) /* fastest by default */ + + +LZO_EXTERN(int) +lzo1b_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + int compression_level ); + +/* decompression */ +LZO_EXTERN(int) +lzo1b_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1b_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1b_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_2_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_3_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_4_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_5_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_6_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_7_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_8_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1b_9_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1B_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1b_99_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +#define LZO1B_999_MEM_COMPRESS ((lzo_uint32) (3 * 65536L * sizeof(lzo_xint))) + +LZO_EXTERN(int) +lzo1b_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1c.h b/thirdparty/lzo/2.03/include/lzo/lzo1c.h new file mode 100644 index 0000000..c0a865e --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1c.h @@ -0,0 +1,160 @@ +/* lzo1c.h -- public interface of the LZO1C compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1C_H_INCLUDED +#define __LZO1C_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1C_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1C_MEM_DECOMPRESS (0) + + +/* compression levels */ +#define LZO1C_BEST_SPEED 1 +#define LZO1C_BEST_COMPRESSION 9 +#define LZO1C_DEFAULT_COMPRESSION (-1) /* fastest by default */ + + +LZO_EXTERN(int) +lzo1c_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + int compression_level ); + +/* decompression */ +LZO_EXTERN(int) +lzo1c_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1c_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1c_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_2_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_3_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_4_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_5_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_6_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_7_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_8_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +LZO_EXTERN(int) +lzo1c_9_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1C_99_MEM_COMPRESS ((lzo_uint32) (65536L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1c_99_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +#define LZO1C_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo1c_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1f.h b/thirdparty/lzo/2.03/include/lzo/lzo1f.h new file mode 100644 index 0000000..f5bd232 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1f.h @@ -0,0 +1,108 @@ +/* lzo1f.h -- public interface of the LZO1F compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1F_H_INCLUDED +#define __LZO1F_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1F_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1F_MEM_DECOMPRESS (0) + + +/* decompression */ +LZO_EXTERN(int) +lzo1f_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1f_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1f_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1F_999_MEM_COMPRESS ((lzo_uint32) (5 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo1f_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1x.h b/thirdparty/lzo/2.03/include/lzo/lzo1x.h new file mode 100644 index 0000000..5b7cad7 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1x.h @@ -0,0 +1,177 @@ +/* lzo1x.h -- public interface of the LZO1X compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1X_H_INCLUDED +#define __LZO1X_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS +#define LZO1X_MEM_DECOMPRESS (0) +#define LZO1X_MEM_OPTIMIZE (0) + + +/* decompression */ +LZO_EXTERN(int) +lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// special compressor versions +************************************************************************/ + +/* this version needs only 8 kB work memory */ +#define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32) (2048L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/* this version needs 16 kB work memory */ +#define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32) (4096L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/* use this version if you need a little more compression speed */ +#define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32) (32768L * lzo_sizeof_dict_t)) + +LZO_EXTERN(int) +lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1X_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1x_999_compress_dict ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +LZO_EXTERN(int) +lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int compression_level ); + +LZO_EXTERN(int) +lzo1x_decompress_dict_safe ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */, + const lzo_bytep dict, lzo_uint dict_len ); + + +/*********************************************************************** +// optimize a compressed data block +************************************************************************/ + +LZO_EXTERN(int) +lzo1x_optimize ( lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */ ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1y.h b/thirdparty/lzo/2.03/include/lzo/lzo1y.h new file mode 100644 index 0000000..7a7f117 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1y.h @@ -0,0 +1,145 @@ +/* lzo1y.h -- public interface of the LZO1Y compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1Y_H_INCLUDED +#define __LZO1Y_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1Y_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1Y_MEM_DECOMPRESS (0) +#define LZO1Y_MEM_OPTIMIZE (0) + + +/* decompression */ +LZO_EXTERN(int) +lzo1y_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1y_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1y_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1Y_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo1y_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1y_999_compress_dict ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +LZO_EXTERN(int) +lzo1y_999_compress_level ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int compression_level ); + +LZO_EXTERN(int) +lzo1y_decompress_dict_safe ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */, + const lzo_bytep dict, lzo_uint dict_len ); + + +/*********************************************************************** +// optimize a compressed data block +************************************************************************/ + +LZO_EXTERN(int) +lzo1y_optimize ( lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */ ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo1z.h b/thirdparty/lzo/2.03/include/lzo/lzo1z.h new file mode 100644 index 0000000..d341c0c --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo1z.h @@ -0,0 +1,150 @@ +/* lzo1z.h -- public interface of the LZO1Z compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO1Z_H_INCLUDED +#define __LZO1Z_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1Z_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1Z_MEM_DECOMPRESS (0) +#define LZO1Z_MEM_OPTIMIZE (0) + + +/* decompression */ +LZO_EXTERN(int) +lzo1z_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1z_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// +************************************************************************/ + +#if 0 +/* not yet implemented */ +LZO_EXTERN(int) +lzo1z_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); +#endif + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO1Z_999_MEM_COMPRESS ((lzo_uint32) (14 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo1z_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(int) +lzo1z_999_compress_dict ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +LZO_EXTERN(int) +lzo1z_999_compress_level ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int compression_level ); + +LZO_EXTERN(int) +lzo1z_decompress_dict_safe ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */, + const lzo_bytep dict, lzo_uint dict_len ); + + +/*********************************************************************** +// optimize a compressed data block +************************************************************************/ + +#if 0 +/* not yet implemented */ +LZO_EXTERN(int) +lzo1z_optimize ( lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */ ); +#endif + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo2a.h b/thirdparty/lzo/2.03/include/lzo/lzo2a.h new file mode 100644 index 0000000..c566241 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo2a.h @@ -0,0 +1,92 @@ +/* lzo2a.h -- public interface of the LZO2A compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO2A_H_INCLUDED +#define __LZO2A_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO2A_MEM_DECOMPRESS (0) + +/* decompression */ +LZO_EXTERN(int) +lzo2a_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo2a_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +/*********************************************************************** +// better compression ratio at the cost of more memory and time +************************************************************************/ + +#define LZO2A_999_MEM_COMPRESS ((lzo_uint32) (8 * 16384L * sizeof(short))) + +LZO_EXTERN(int) +lzo2a_999_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzo_asm.h b/thirdparty/lzo/2.03/include/lzo/lzo_asm.h new file mode 100644 index 0000000..23563a6 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzo_asm.h @@ -0,0 +1,139 @@ +/* lzo_asm.h -- assembler prototypes for the LZO data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZO_ASM_H_INCLUDED +#define __LZO_ASM_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// assembly decompressors +************************************************************************/ + +LZO_EXTERN(int) lzo1c_decompress_asm + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1c_decompress_asm_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); + +LZO_EXTERN(int) lzo1f_decompress_asm_fast + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1f_decompress_asm_fast_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); + +LZO_EXTERN(int) lzo1x_decompress_asm + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1x_decompress_asm_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1x_decompress_asm_fast + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1x_decompress_asm_fast_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); + +LZO_EXTERN(int) lzo1y_decompress_asm + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1y_decompress_asm_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1y_decompress_asm_fast + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); +LZO_EXTERN(int) lzo1y_decompress_asm_fast_safe + (const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem); + + +/*********************************************************************** +// checksum and misc functions +************************************************************************/ + +#if 0 + +LZO_EXTERN(lzo_uint32) +lzo_crc32_asm(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len, + const lzo_uint32p _crc_table); + +LZO_EXTERN(lzo_uint32) +lzo_crc32_asm_small(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len); + +LZO_EXTERN(int) +lzo_cpuid_asm(lzo_uint32p /* lzo_uint32 info[16] */ ); + +LZO_EXTERN(lzo_uint32) +lzo_rdtsc_asm(lzo_uint32p /* lzo_uint32 ticks[2] */ ); + +#endif + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzoconf.h b/thirdparty/lzo/2.03/include/lzo/lzoconf.h new file mode 100644 index 0000000..cc437f1 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzoconf.h @@ -0,0 +1,417 @@ +/* lzoconf.h -- configuration for the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZOCONF_H_INCLUDED +#define __LZOCONF_H_INCLUDED + +#define LZO_VERSION 0x2030 +#define LZO_VERSION_STRING "2.03" +#define LZO_VERSION_DATE "Apr 30 2008" + +/* internal Autoconf configuration file - only used when building LZO */ +#if defined(LZO_HAVE_CONFIG_H) +# include +#endif +#include +#include + + +/*********************************************************************** +// LZO requires a conforming +************************************************************************/ + +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# error "invalid CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) +# error "check your compiler installation" +#endif +#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) +# error "your limits.h macros are broken" +#endif + +/* get OS and architecture defines */ +#ifndef __LZODEFS_H_INCLUDED +#include "lzodefs.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// some core defines +************************************************************************/ + +#if !defined(LZO_UINT32_C) +# if (UINT_MAX < LZO_0xffffffffL) +# define LZO_UINT32_C(c) c ## UL +# else +# define LZO_UINT32_C(c) ((c) + 0U) +# endif +#endif + +/* memory checkers */ +#if !defined(__LZO_CHECKER) +# if defined(__BOUNDS_CHECKING_ON) +# define __LZO_CHECKER 1 +# elif defined(__CHECKER__) +# define __LZO_CHECKER 1 +# elif defined(__INSURE__) +# define __LZO_CHECKER 1 +# elif defined(__PURIFY__) +# define __LZO_CHECKER 1 +# endif +#endif + + +/*********************************************************************** +// integral and pointer types +************************************************************************/ + +/* lzo_uint should match size_t */ +#if !defined(LZO_UINT_MAX) +# if defined(LZO_ABI_LLP64) /* WIN64 */ +# if defined(LZO_OS_WIN64) + typedef unsigned __int64 lzo_uint; + typedef __int64 lzo_int; +# else + typedef unsigned long long lzo_uint; + typedef long long lzo_int; +# endif +# define LZO_UINT_MAX 0xffffffffffffffffull +# define LZO_INT_MAX 9223372036854775807LL +# define LZO_INT_MIN (-1LL - LZO_INT_MAX) +# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */ + typedef unsigned int lzo_uint; + typedef int lzo_int; +# define LZO_UINT_MAX UINT_MAX +# define LZO_INT_MAX INT_MAX +# define LZO_INT_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint; + typedef long lzo_int; +# define LZO_UINT_MAX ULONG_MAX +# define LZO_INT_MAX LONG_MAX +# define LZO_INT_MIN LONG_MIN +# else +# error "lzo_uint" +# endif +#endif + +/* Integral types with 32 bits or more. */ +#if !defined(LZO_UINT32_MAX) +# if (UINT_MAX >= LZO_0xffffffffL) + typedef unsigned int lzo_uint32; + typedef int lzo_int32; +# define LZO_UINT32_MAX UINT_MAX +# define LZO_INT32_MAX INT_MAX +# define LZO_INT32_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint32; + typedef long lzo_int32; +# define LZO_UINT32_MAX ULONG_MAX +# define LZO_INT32_MAX LONG_MAX +# define LZO_INT32_MIN LONG_MIN +# else +# error "lzo_uint32" +# endif +#endif + +/* The larger type of lzo_uint and lzo_uint32. */ +#if (LZO_UINT_MAX >= LZO_UINT32_MAX) +# define lzo_xint lzo_uint +#else +# define lzo_xint lzo_uint32 +#endif + +/* Memory model that allows to access memory at offsets of lzo_uint. */ +#if !defined(__LZO_MMODEL) +# if (LZO_UINT_MAX <= UINT_MAX) +# define __LZO_MMODEL +# elif defined(LZO_HAVE_MM_HUGE_PTR) +# define __LZO_MMODEL_HUGE 1 +# define __LZO_MMODEL __huge +# else +# define __LZO_MMODEL +# endif +#endif + +/* no typedef here because of const-pointer issues */ +#define lzo_bytep unsigned char __LZO_MMODEL * +#define lzo_charp char __LZO_MMODEL * +#define lzo_voidp void __LZO_MMODEL * +#define lzo_shortp short __LZO_MMODEL * +#define lzo_ushortp unsigned short __LZO_MMODEL * +#define lzo_uint32p lzo_uint32 __LZO_MMODEL * +#define lzo_int32p lzo_int32 __LZO_MMODEL * +#define lzo_uintp lzo_uint __LZO_MMODEL * +#define lzo_intp lzo_int __LZO_MMODEL * +#define lzo_xintp lzo_xint __LZO_MMODEL * +#define lzo_voidpp lzo_voidp __LZO_MMODEL * +#define lzo_bytepp lzo_bytep __LZO_MMODEL * +/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */ +#define lzo_byte unsigned char __LZO_MMODEL + +typedef int lzo_bool; + + +/*********************************************************************** +// function types +************************************************************************/ + +/* name mangling */ +#if !defined(__LZO_EXTERN_C) +# ifdef __cplusplus +# define __LZO_EXTERN_C extern "C" +# else +# define __LZO_EXTERN_C extern +# endif +#endif + +/* calling convention */ +#if !defined(__LZO_CDECL) +# define __LZO_CDECL __lzo_cdecl +#endif + +/* DLL export information */ +#if !defined(__LZO_EXPORT1) +# define __LZO_EXPORT1 +#endif +#if !defined(__LZO_EXPORT2) +# define __LZO_EXPORT2 +#endif + +/* __cdecl calling convention for public C and assembly functions */ +#if !defined(LZO_PUBLIC) +# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL +#endif +#if !defined(LZO_EXTERN) +# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype) +#endif +#if !defined(LZO_PRIVATE) +# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL +#endif + +/* function types */ +typedef int +(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +typedef int +(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + + +/* Callback interface. Currently only the progress indicator ("nprogress") + * is used, but this may change in a future release. */ + +struct lzo_callback_t; +typedef struct lzo_callback_t lzo_callback_t; +#define lzo_callback_p lzo_callback_t __LZO_MMODEL * + +/* malloc & free function types */ +typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t) + (lzo_callback_p self, lzo_uint items, lzo_uint size); +typedef void (__LZO_CDECL *lzo_free_func_t) + (lzo_callback_p self, lzo_voidp ptr); + +/* a progress indicator callback function */ +typedef void (__LZO_CDECL *lzo_progress_func_t) + (lzo_callback_p, lzo_uint, lzo_uint, int); + +struct lzo_callback_t +{ + /* custom allocators (set to 0 to disable) */ + lzo_alloc_func_t nalloc; /* [not used right now] */ + lzo_free_func_t nfree; /* [not used right now] */ + + /* a progress indicator callback function (set to 0 to disable) */ + lzo_progress_func_t nprogress; + + /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress + * callbacks points back to this struct, so you are free to store + * some extra info in the following variables. */ + lzo_voidp user1; + lzo_xint user2; + lzo_xint user3; +}; + + +/*********************************************************************** +// error codes and prototypes +************************************************************************/ + +/* Error codes for the compression/decompression functions. Negative + * values are errors, positive values will be used for special but + * normal events. + */ +#define LZO_E_OK 0 +#define LZO_E_ERROR (-1) +#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */ +#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */ +#define LZO_E_INPUT_OVERRUN (-4) +#define LZO_E_OUTPUT_OVERRUN (-5) +#define LZO_E_LOOKBEHIND_OVERRUN (-6) +#define LZO_E_EOF_NOT_FOUND (-7) +#define LZO_E_INPUT_NOT_CONSUMED (-8) +#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ + + +#ifndef lzo_sizeof_dict_t +# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep)) +#endif + +/* lzo_init() should be the first function you call. + * Check the return code ! + * + * lzo_init() is a macro to allow checking that the library and the + * compiler's view of various types are consistent. + */ +#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ + (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\ + (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ + (int)sizeof(lzo_callback_t)) +LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); + +/* version functions (useful for shared libraries) */ +LZO_EXTERN(unsigned) lzo_version(void); +LZO_EXTERN(const char *) lzo_version_string(void); +LZO_EXTERN(const char *) lzo_version_date(void); +LZO_EXTERN(const lzo_charp) _lzo_version_string(void); +LZO_EXTERN(const lzo_charp) _lzo_version_date(void); + +/* string functions */ +LZO_EXTERN(int) +lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memset(lzo_voidp _s, int _c, lzo_uint _len); + +/* checksum functions */ +LZO_EXTERN(lzo_uint32) +lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len); +LZO_EXTERN(lzo_uint32) +lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len); +LZO_EXTERN(const lzo_uint32p) +lzo_get_crc32_table(void); + +/* misc. */ +LZO_EXTERN(int) _lzo_config_check(void); +typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u; +typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u; +typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t; + +/* align a char pointer on a boundary that is a multiple of `size' */ +LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size); +#define LZO_PTR_ALIGN_UP(_ptr,_size) \ + ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size))) + + +/*********************************************************************** +// deprecated macros - only for backward compatibility with LZO v1.xx +************************************************************************/ + +#if defined(LZO_CFG_COMPAT) + +#define __LZOCONF_H 1 + +#if defined(LZO_ARCH_I086) +# define __LZO_i386 1 +#elif defined(LZO_ARCH_I386) +# define __LZO_i386 1 +#endif + +#if defined(LZO_OS_DOS16) +# define __LZO_DOS 1 +# define __LZO_DOS16 1 +#elif defined(LZO_OS_DOS32) +# define __LZO_DOS 1 +#elif defined(LZO_OS_WIN16) +# define __LZO_WIN 1 +# define __LZO_WIN16 1 +#elif defined(LZO_OS_WIN32) +# define __LZO_WIN 1 +#endif + +#define __LZO_CMODEL +#define __LZO_DMODEL +#define __LZO_ENTRY __LZO_CDECL +#define LZO_EXTERN_CDECL LZO_EXTERN +#define LZO_ALIGN LZO_PTR_ALIGN_UP + +#define lzo_compress_asm_t lzo_compress_t +#define lzo_decompress_asm_t lzo_decompress_t + +#endif /* LZO_CFG_COMPAT */ + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzodefs.h b/thirdparty/lzo/2.03/include/lzo/lzodefs.h new file mode 100644 index 0000000..1805637 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzodefs.h @@ -0,0 +1,1807 @@ +/* lzodefs.h -- architecture, OS and compiler specific defines + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined(__IBMCPP__) && !defined(__IBMC__) +# define __IBMC__ __IBMCPP__ +#endif +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +# define __INTEL_COMPILER __ICL +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if defined(__INTEL_COMPILER) && defined(__linux__) +# pragma warning(disable: 193) +#endif +#if defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif 0 && defined(__C251__) +# pragma warning disable = 322 +#endif +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if (_MSC_VER >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if 0 +#define LZO_0xffffL 0xfffful +#define LZO_0xffffffffL 0xfffffffful +#else +#define LZO_0xffffL 65535ul +#define LZO_0xffffffffL 4294967295ul +#endif +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +#else +# define LZO_EXTERN_C extern +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if defined(LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif defined(LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif (defined(__mips__) && defined(__psp__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) || defined(__MACOS__) +# define LZO_OS_POSIX_MACOSX 1 +# define LZO_INFO_OS_POSIX "macosx" +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +#elif defined(__INTEL_COMPILER) +# define LZO_CC_INTELC 1 +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN64) +# define LZO_CC_SYNTAX_MSC 1 +# else +# define LZO_CC_SYNTAX_GNUC 1 +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# else +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# endif +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) +# define LZO_CC_IBMC 1 +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(_MSC_VER) +# define LZO_CC_MSC 1 +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#elif defined(__MWERKS__) +# define LZO_CC_MWERKS 1 +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if (__ZTC__ == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if defined(LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_ARCH_IA16 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#endif +#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM) +# error "this should not happen" +#endif +#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086) +# error "this should not happen" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "this should not happen" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "this should not happen" +# elif (LZO_CC_ZORTECHC) +# else +# error "this should not happen" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#endif +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#endif +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#endif +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#endif +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#endif +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#endif +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && defined(LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if (LZO_ARCH_I086) +# define __LZO_WORDSIZE 2 +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "LZO_MM" +# endif +#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +# define __LZO_WORDSIZE 1 +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 4 +# else +# define __LZO_WORDSIZE 2 +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_M16C) +# define __LZO_WORDSIZE 2 +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define __LZO_WORDSIZE LZO_SIZEOF_LONG +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_ARCH_SPU) +# if 0 +# define __LZO_WORDSIZE 16 +# endif +# define LZO_SIZEOF_VOID_P 4 +#else +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_WORDSIZE) +# if defined(__LZO_WORDSIZE) +# define LZO_WORDSIZE __LZO_WORDSIZE +# else +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +# endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#else +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "LZO_MM" +# endif +#else +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_M68K || LZO_ARCH_S390) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN) +# error "this should not happen" +#endif +#if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif defined(LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif defined(LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if !defined(__LZO_LIBC_OVERRIDE) +#if defined(LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif defined(LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif defined(LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif defined(LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif defined(LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uclibc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#else +# define __lzo_gnuc_extension__ +#endif +#endif +#if !defined(__lzo_ua_volatile) +# define __lzo_ua_volatile volatile +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#endif +#endif +#if defined(__lzo_alignof) +# define __lzo_HAVE_alignof 1 +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# define __lzo_HAVE_constructor 1 +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# define __lzo_HAVE_destructor 1 +#endif +#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor) +# error "this should not happen" +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define __lzo_inline inline +#endif +#endif +#if defined(__lzo_inline) +# define __lzo_HAVE_inline 1 +#else +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#endif +#endif +#if defined(__lzo_forceinline) +# define __lzo_HAVE_forceinline 1 +#else +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#endif +#endif +#if defined(__lzo_noinline) +# define __lzo_HAVE_noinline 1 +#else +# define __lzo_noinline +#endif +#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline) +# error "this should not happen" +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#endif +#endif +#if defined(__lzo_noreturn) +# define __lzo_HAVE_noreturn 1 +#else +# define __lzo_noreturn +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# define __lzo_HAVE_nothrow 1 +#else +# define __lzo_nothrow +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#endif +#endif +#if defined(__lzo_restrict) +# define __lzo_HAVE_restrict 1 +#else +# define __lzo_restrict +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# define __lzo_HAVE_likely 1 +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# define __lzo_HAVE_unlikely 1 +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# elif (LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if (0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +# endif +#endif +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !defined(LZO_CFG_NO_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# define LZO_OPT_UNALIGNED64 1 +#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) +#elif (LZO_ARCH_ARM) +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_CRIS) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_I386) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_S390) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# if (LZO_SIZEOF_SIZE_T == 8) +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#if !defined(LZO_CFG_NO_INLINE_ASM) +#if defined(LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if !defined(LZO_CFG_NO_UNALIGNED) +#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(LZO_CFG_NO_INLINE_ASM) +#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +#elif (LZO_CC_INTELC) +# define __LZO_ASM_CLOBBER "memory" +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +#endif +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER + +#endif /* already included */ + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/include/lzo/lzoutil.h b/thirdparty/lzo/2.03/include/lzo/lzoutil.h new file mode 100644 index 0000000..c808984 --- /dev/null +++ b/thirdparty/lzo/2.03/include/lzo/lzoutil.h @@ -0,0 +1,73 @@ +/* lzoutil.h -- utilitiy functions for use by applications [DEPRECATED] + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZOUTIL_H_INCLUDED +#define __LZOUTIL_H_INCLUDED + +#ifndef __LZOCONF_H_INCLUDED +#include "lzoconf.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// LZO-v1 deprecated macros (which were used in the old example programs) +// DO NOT USE +************************************************************************/ + +#define lzo_alloc(a,b) (malloc((a)*(b))) +#define lzo_malloc(a) (malloc(a)) +#define lzo_free(a) (free(a)) + +#define lzo_fread(f,b,s) (fread(b,1,s,f)) +#define lzo_fwrite(f,b,s) (fwrite(b,1,s,f)) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/lzo1.obj b/thirdparty/lzo/2.03/lzo1.obj new file mode 100644 index 0000000..64ddab4 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1_99.obj b/thirdparty/lzo/2.03/lzo1_99.obj new file mode 100644 index 0000000..add44a9 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1_99.obj differ diff --git a/thirdparty/lzo/2.03/lzo1a.obj b/thirdparty/lzo/2.03/lzo1a.obj new file mode 100644 index 0000000..2549426 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1a.obj differ diff --git a/thirdparty/lzo/2.03/lzo1a_99.obj b/thirdparty/lzo/2.03/lzo1a_99.obj new file mode 100644 index 0000000..9724a7c Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1a_99.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_1.obj b/thirdparty/lzo/2.03/lzo1b_1.obj new file mode 100644 index 0000000..c36d1d3 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_2.obj b/thirdparty/lzo/2.03/lzo1b_2.obj new file mode 100644 index 0000000..3363742 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_3.obj b/thirdparty/lzo/2.03/lzo1b_3.obj new file mode 100644 index 0000000..bb58ab3 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_3.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_4.obj b/thirdparty/lzo/2.03/lzo1b_4.obj new file mode 100644 index 0000000..cb58dd0 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_4.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_5.obj b/thirdparty/lzo/2.03/lzo1b_5.obj new file mode 100644 index 0000000..3848320 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_5.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_6.obj b/thirdparty/lzo/2.03/lzo1b_6.obj new file mode 100644 index 0000000..ef254da Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_6.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_7.obj b/thirdparty/lzo/2.03/lzo1b_7.obj new file mode 100644 index 0000000..1a26255 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_7.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_8.obj b/thirdparty/lzo/2.03/lzo1b_8.obj new file mode 100644 index 0000000..fb6711b Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_8.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_9.obj b/thirdparty/lzo/2.03/lzo1b_9.obj new file mode 100644 index 0000000..6686fef Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_9.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_99.obj b/thirdparty/lzo/2.03/lzo1b_99.obj new file mode 100644 index 0000000..d8845d7 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_99.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_9x.obj b/thirdparty/lzo/2.03/lzo1b_9x.obj new file mode 100644 index 0000000..09d7efc Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_cc.obj b/thirdparty/lzo/2.03/lzo1b_cc.obj new file mode 100644 index 0000000..beb8145 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_cc.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_d1.obj b/thirdparty/lzo/2.03/lzo1b_d1.obj new file mode 100644 index 0000000..83cc4d4 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_d2.obj b/thirdparty/lzo/2.03/lzo1b_d2.obj new file mode 100644 index 0000000..770d614 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_rr.obj b/thirdparty/lzo/2.03/lzo1b_rr.obj new file mode 100644 index 0000000..19dfa62 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_rr.obj differ diff --git a/thirdparty/lzo/2.03/lzo1b_xx.obj b/thirdparty/lzo/2.03/lzo1b_xx.obj new file mode 100644 index 0000000..5eafd16 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1b_xx.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_1.obj b/thirdparty/lzo/2.03/lzo1c_1.obj new file mode 100644 index 0000000..2b0a217 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_2.obj b/thirdparty/lzo/2.03/lzo1c_2.obj new file mode 100644 index 0000000..fa45688 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_3.obj b/thirdparty/lzo/2.03/lzo1c_3.obj new file mode 100644 index 0000000..53617fc Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_3.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_4.obj b/thirdparty/lzo/2.03/lzo1c_4.obj new file mode 100644 index 0000000..c691486 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_4.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_5.obj b/thirdparty/lzo/2.03/lzo1c_5.obj new file mode 100644 index 0000000..b799226 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_5.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_6.obj b/thirdparty/lzo/2.03/lzo1c_6.obj new file mode 100644 index 0000000..4c6ed5e Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_6.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_7.obj b/thirdparty/lzo/2.03/lzo1c_7.obj new file mode 100644 index 0000000..0e2dc48 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_7.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_8.obj b/thirdparty/lzo/2.03/lzo1c_8.obj new file mode 100644 index 0000000..df79f4b Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_8.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_9.obj b/thirdparty/lzo/2.03/lzo1c_9.obj new file mode 100644 index 0000000..bd2b3e2 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_9.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_99.obj b/thirdparty/lzo/2.03/lzo1c_99.obj new file mode 100644 index 0000000..2fd9a78 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_99.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_9x.obj b/thirdparty/lzo/2.03/lzo1c_9x.obj new file mode 100644 index 0000000..e50acc0 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_cc.obj b/thirdparty/lzo/2.03/lzo1c_cc.obj new file mode 100644 index 0000000..a5433ee Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_cc.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_d1.obj b/thirdparty/lzo/2.03/lzo1c_d1.obj new file mode 100644 index 0000000..ec478e1 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_d2.obj b/thirdparty/lzo/2.03/lzo1c_d2.obj new file mode 100644 index 0000000..8eab8bb Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_rr.obj b/thirdparty/lzo/2.03/lzo1c_rr.obj new file mode 100644 index 0000000..5aefe80 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_rr.obj differ diff --git a/thirdparty/lzo/2.03/lzo1c_xx.obj b/thirdparty/lzo/2.03/lzo1c_xx.obj new file mode 100644 index 0000000..9bdcc40 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1c_xx.obj differ diff --git a/thirdparty/lzo/2.03/lzo1f_1.obj b/thirdparty/lzo/2.03/lzo1f_1.obj new file mode 100644 index 0000000..08ac0b1 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1f_1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1f_9x.obj b/thirdparty/lzo/2.03/lzo1f_9x.obj new file mode 100644 index 0000000..6120da4 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1f_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1f_d1.obj b/thirdparty/lzo/2.03/lzo1f_d1.obj new file mode 100644 index 0000000..ca18652 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1f_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1f_d2.obj b/thirdparty/lzo/2.03/lzo1f_d2.obj new file mode 100644 index 0000000..5db25b7 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1f_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_1.obj b/thirdparty/lzo/2.03/lzo1x_1.obj new file mode 100644 index 0000000..c327046 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_1k.obj b/thirdparty/lzo/2.03/lzo1x_1k.obj new file mode 100644 index 0000000..1a5c284 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_1k.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_1l.obj b/thirdparty/lzo/2.03/lzo1x_1l.obj new file mode 100644 index 0000000..8c0d588 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_1l.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_1o.obj b/thirdparty/lzo/2.03/lzo1x_1o.obj new file mode 100644 index 0000000..21e8cc4 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_1o.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_9x.obj b/thirdparty/lzo/2.03/lzo1x_9x.obj new file mode 100644 index 0000000..d7b173a Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_d1.obj b/thirdparty/lzo/2.03/lzo1x_d1.obj new file mode 100644 index 0000000..67a43b2 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_d2.obj b/thirdparty/lzo/2.03/lzo1x_d2.obj new file mode 100644 index 0000000..f836944 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_d3.obj b/thirdparty/lzo/2.03/lzo1x_d3.obj new file mode 100644 index 0000000..629e322 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_d3.obj differ diff --git a/thirdparty/lzo/2.03/lzo1x_o.obj b/thirdparty/lzo/2.03/lzo1x_o.obj new file mode 100644 index 0000000..06b8fd9 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1x_o.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_1.obj b/thirdparty/lzo/2.03/lzo1y_1.obj new file mode 100644 index 0000000..704af0d Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_9x.obj b/thirdparty/lzo/2.03/lzo1y_9x.obj new file mode 100644 index 0000000..bced3de Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_d1.obj b/thirdparty/lzo/2.03/lzo1y_d1.obj new file mode 100644 index 0000000..5da640d Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_d2.obj b/thirdparty/lzo/2.03/lzo1y_d2.obj new file mode 100644 index 0000000..8d12213 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_d3.obj b/thirdparty/lzo/2.03/lzo1y_d3.obj new file mode 100644 index 0000000..faca879 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_d3.obj differ diff --git a/thirdparty/lzo/2.03/lzo1y_o.obj b/thirdparty/lzo/2.03/lzo1y_o.obj new file mode 100644 index 0000000..e4f3f4f Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1y_o.obj differ diff --git a/thirdparty/lzo/2.03/lzo1z_9x.obj b/thirdparty/lzo/2.03/lzo1z_9x.obj new file mode 100644 index 0000000..35c6aaf Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1z_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo1z_d1.obj b/thirdparty/lzo/2.03/lzo1z_d1.obj new file mode 100644 index 0000000..8c2cee2 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1z_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo1z_d2.obj b/thirdparty/lzo/2.03/lzo1z_d2.obj new file mode 100644 index 0000000..557c066 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1z_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo1z_d3.obj b/thirdparty/lzo/2.03/lzo1z_d3.obj new file mode 100644 index 0000000..1c79221 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo1z_d3.obj differ diff --git a/thirdparty/lzo/2.03/lzo2.dll b/thirdparty/lzo/2.03/lzo2.dll new file mode 100644 index 0000000..eefedbd Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2.dll differ diff --git a/thirdparty/lzo/2.03/lzo2.dll.manifest b/thirdparty/lzo/2.03/lzo2.dll.manifest new file mode 100644 index 0000000..7256947 --- /dev/null +++ b/thirdparty/lzo/2.03/lzo2.dll.manifest @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/thirdparty/lzo/2.03/lzo2.exp b/thirdparty/lzo/2.03/lzo2.exp new file mode 100644 index 0000000..71e4013 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2.exp differ diff --git a/thirdparty/lzo/2.03/lzo2.lib b/thirdparty/lzo/2.03/lzo2.lib new file mode 100644 index 0000000..383ec9c Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2.lib differ diff --git a/thirdparty/lzo/2.03/lzo2.map b/thirdparty/lzo/2.03/lzo2.map new file mode 100644 index 0000000..46ab399 --- /dev/null +++ b/thirdparty/lzo/2.03/lzo2.map @@ -0,0 +1,383 @@ + lzo2 + + Timestamp is 4d6e51c6 (Wed Mar 02 15:18:46 2011) + + Preferred load address is 10000000 + + Start Length Name Class + 0001:00000000 00013a54H .text CODE + 0002:00000000 00000090H .idata$5 DATA + 0002:00000090 00000004H .CRT$XCA DATA + 0002:00000094 00000004H .CRT$XCZ DATA + 0002:00000098 00000004H .CRT$XIA DATA + 0002:0000009c 00000004H .CRT$XIAA DATA + 0002:000000a0 00000004H .CRT$XIZ DATA + 0002:000000a8 00000748H .rdata DATA + 0002:000007f0 00000004H .rtc$IAA DATA + 0002:000007f4 00000004H .rtc$IZZ DATA + 0002:000007f8 00000004H .rtc$TAA DATA + 0002:000007fc 00000004H .rtc$TZZ DATA + 0002:00000800 00000064H .xdata$x DATA + 0002:00000864 00000028H .idata$2 DATA + 0002:0000088c 00000014H .idata$3 DATA + 0002:000008a0 00000090H .idata$4 DATA + 0002:00000930 00000288H .idata$6 DATA + 0002:00000bc0 00000c6cH .edata DATA + 0003:00000000 00000010H .data DATA + 0003:00000010 00000350H .bss DATA + + Address Publics by Value Rva+Base Lib:Object + + 0000:00000000 ___safe_se_handler_count 00000000 + 0000:00000000 ___safe_se_handler_table 00000000 + 0000:00000000 ___ImageBase 10000000 + 0001:00000000 _lzo1a_info 10001000 f lzo1a.obj + 0001:00000000 _lzo1_info 10001000 f lzo1.obj + 0001:00000030 _lzo1_decompress 10001030 f lzo1.obj + 0001:00000490 _lzo1_compress 10001490 f lzo1.obj + 0001:00000900 _lzo1_99_compress 10001900 f lzo1_99.obj + 0001:00000970 _lzo1a_decompress 10001970 f lzo1a.obj + 0001:00000e60 _lzo1a_compress 10001e60 f lzo1a.obj + 0001:000012c0 _lzo1a_99_compress 100022c0 f lzo1a_99.obj + 0001:00001640 _lzo1b_1_compress 10002640 f lzo1b_1.obj + 0001:00001a10 _lzo1b_2_compress 10002a10 f lzo1b_2.obj + 0001:00001e30 _lzo1b_3_compress 10002e30 f lzo1b_3.obj + 0001:00002260 _lzo1b_4_compress 10003260 f lzo1b_4.obj + 0001:00002700 _lzo1b_5_compress 10003700 f lzo1b_5.obj + 0001:00002be0 _lzo1b_6_compress 10003be0 f lzo1b_6.obj + 0001:00003090 _lzo1b_7_compress 10004090 f lzo1b_7.obj + 0001:00003640 _lzo1b_8_compress 10004640 f lzo1b_8.obj + 0001:00003a80 _lzo1b_9_compress 10004a80 f lzo1b_9.obj + 0001:00003eb0 _lzo1b_99_compress 10004eb0 f lzo1b_99.obj + 0001:000044e0 _lzo1b_999_compress_callback 100054e0 f lzo1b_9x.obj + 0001:00004940 _lzo1b_999_compress 10005940 f lzo1b_9x.obj + 0001:00004970 __lzo1c_do_compress 10005970 f lzo1c_cc.obj + 0001:00004970 __lzo1b_do_compress 10005970 f lzo1b_cc.obj + 0001:000049f0 _lzo1b_decompress 100059f0 f lzo1b_d1.obj + 0001:00004bd0 _lzo1b_decompress_safe 10005bd0 f lzo1b_d2.obj + 0001:00004f20 __lzo1b_store_run 10005f20 f lzo1b_rr.obj + 0001:00004f20 __lzo1c_store_run 10005f20 f lzo1c_rr.obj + 0001:00005030 _lzo1b_compress 10006030 f lzo1b_xx.obj + 0001:000053b0 _lzo1c_1_compress 100063b0 f lzo1c_1.obj + 0001:00005760 _lzo1c_2_compress 10006760 f lzo1c_2.obj + 0001:00005bb0 _lzo1c_3_compress 10006bb0 f lzo1c_3.obj + 0001:00005ff0 _lzo1c_4_compress 10006ff0 f lzo1c_4.obj + 0001:00006420 _lzo1c_5_compress 10007420 f lzo1c_5.obj + 0001:00006930 _lzo1c_6_compress 10007930 f lzo1c_6.obj + 0001:00006da0 _lzo1c_7_compress 10007da0 f lzo1c_7.obj + 0001:00007390 _lzo1c_8_compress 10008390 f lzo1c_8.obj + 0001:000077f0 _lzo1c_9_compress 100087f0 f lzo1c_9.obj + 0001:00007c50 _lzo1c_99_compress 10008c50 f lzo1c_99.obj + 0001:00007df0 _lzo1c_999_compress_callback 10008df0 f lzo1c_9x.obj + 0001:000082b0 _lzo1c_999_compress 100092b0 f lzo1c_9x.obj + 0001:000082e0 _lzo1c_decompress 100092e0 f lzo1c_d1.obj + 0001:000084f0 _lzo1c_decompress_safe 100094f0 f lzo1c_d2.obj + 0001:00008860 _lzo1c_compress 10009860 f lzo1c_xx.obj + 0001:00008c50 _lzo1f_1_compress 10009c50 f lzo1f_1.obj + 0001:000092c0 _lzo1f_999_compress_callback 1000a2c0 f lzo1f_9x.obj + 0001:000096d0 _lzo1f_999_compress 1000a6d0 f lzo1f_9x.obj + 0001:00009700 _lzo1f_decompress 1000a700 f lzo1f_d1.obj + 0001:000098b0 _lzo1f_decompress_safe 1000a8b0 f lzo1f_d2.obj + 0001:00009ef0 _lzo1x_1_compress 1000aef0 f lzo1x_1.obj + 0001:0000a310 _lzo1x_1_11_compress 1000b310 f lzo1x_1k.obj + 0001:0000a720 _lzo1x_1_12_compress 1000b720 f lzo1x_1l.obj + 0001:0000ab50 _lzo1x_1_15_compress 1000bb50 f lzo1x_1o.obj + 0001:0000b0c0 _lzo1x_999_compress_internal 1000c0c0 f lzo1x_9x.obj + 0001:0000b660 _lzo1x_999_compress_level 1000c660 f lzo1x_9x.obj + 0001:0000b6e0 _lzo1x_999_compress_dict 1000c6e0 f lzo1x_9x.obj + 0001:0000b710 _lzo1x_999_compress 1000c710 f lzo1x_9x.obj + 0001:0000b740 _lzo1x_decompress 1000c740 f lzo1x_d1.obj + 0001:0000b9b0 _lzo1x_decompress_safe 1000c9b0 f lzo1x_d2.obj + 0001:0000bdd0 _lzo1x_decompress_dict_safe 1000cdd0 f lzo1x_d3.obj + 0001:0000c2e0 _lzo1x_optimize 1000d2e0 f lzo1x_o.obj + 0001:0000cbd0 _lzo1y_1_compress 1000dbd0 f lzo1y_1.obj + 0001:0000d390 _lzo1y_999_compress_internal 1000e390 f lzo1y_9x.obj + 0001:0000d930 _lzo1y_999_compress_level 1000e930 f lzo1y_9x.obj + 0001:0000d9b0 _lzo1y_999_compress_dict 1000e9b0 f lzo1y_9x.obj + 0001:0000d9e0 _lzo1y_999_compress 1000e9e0 f lzo1y_9x.obj + 0001:0000da10 _lzo1y_decompress 1000ea10 f lzo1y_d1.obj + 0001:0000dc80 _lzo1y_decompress_safe 1000ec80 f lzo1y_d2.obj + 0001:0000e0a0 _lzo1y_decompress_dict_safe 1000f0a0 f lzo1y_d3.obj + 0001:0000e590 _lzo1y_optimize 1000f590 f lzo1y_o.obj + 0001:0000f280 _lzo1z_999_compress_internal 10010280 f lzo1z_9x.obj + 0001:0000f840 _lzo1z_999_compress_level 10010840 f lzo1z_9x.obj + 0001:0000f8c0 _lzo1z_999_compress_dict 100108c0 f lzo1z_9x.obj + 0001:0000f8f0 _lzo1z_999_compress 100108f0 f lzo1z_9x.obj + 0001:0000f920 _lzo1z_decompress 10010920 f lzo1z_d1.obj + 0001:0000fbb0 _lzo1z_decompress_safe 10010bb0 f lzo1z_d2.obj + 0001:00010000 _lzo1z_decompress_dict_safe 10011000 f lzo1z_d3.obj + 0001:00010b10 _lzo2a_999_compress_callback 10011b10 f lzo2a_9x.obj + 0001:000110c0 _lzo2a_999_compress 100120c0 f lzo2a_9x.obj + 0001:000110f0 _lzo2a_decompress 100120f0 f lzo2a_d1.obj + 0001:00011210 _lzo2a_decompress_safe 10012210 f lzo2a_d2.obj + 0001:00011440 _lzo_get_crc32_table 10012440 f lzo_crc.obj + 0001:00011450 _lzo_crc32 10012450 f lzo_crc.obj + 0001:00011610 __lzo_config_check 10012610 f lzo_init.obj + 0001:00011670 ___lzo_init_v2 10012670 f lzo_init.obj + 0001:00011710 ___lzo_ptr_linear 10012710 f lzo_ptr.obj + 0001:00011720 ___lzo_align_gap 10012720 f lzo_ptr.obj + 0001:00011740 _lzo_memcmp 10012740 f lzo_str.obj + 0001:000117c0 _lzo_memcpy 100127c0 f lzo_str.obj + 0001:000117d0 _lzo_memmove 100127d0 f lzo_str.obj + 0001:000117e0 _lzo_memset 100127e0 f lzo_str.obj + 0001:000117f0 _lzo_copyright 100127f0 f lzo_util.obj + 0001:00011800 _lzo_version 10012800 f lzo_util.obj + 0001:00011810 _lzo_version_string 10012810 f lzo_util.obj + 0001:00011810 __lzo_version_string 10012810 f lzo_util.obj + 0001:00011820 _lzo_version_date 10012820 f lzo_util.obj + 0001:00011820 __lzo_version_date 10012820 f lzo_util.obj + 0001:00011830 _lzo_adler32 10012830 f lzo_util.obj + 0001:00011960 _lzo1c_decompress_asm 10012960 lzo1c_s1.obj + 0001:00011960 lzo1c_decompress_asm 10012960 lzo1c_s1.obj + 0001:00011a80 lzo1c_decompress_asm_safe 10012a80 lzo1c_s2.obj + 0001:00011a80 _lzo1c_decompress_asm_safe 10012a80 lzo1c_s2.obj + 0001:00011c50 lzo1f_decompress_asm_fast 10012c50 lzo1f_f1.obj + 0001:00011c50 _lzo1f_decompress_asm_fast 10012c50 lzo1f_f1.obj + 0001:00011d90 _lzo1f_decompress_asm_fast_safe 10012d90 lzo1f_f2.obj + 0001:00011d90 lzo1f_decompress_asm_fast_safe 10012d90 lzo1f_f2.obj + 0001:00011f40 lzo1x_decompress_asm_fast 10012f40 lzo1x_f1.obj + 0001:00011f40 _lzo1x_decompress_asm_fast 10012f40 lzo1x_f1.obj + 0001:00012100 lzo1x_decompress_asm_fast_safe 10013100 lzo1x_f2.obj + 0001:00012100 _lzo1x_decompress_asm_fast_safe 10013100 lzo1x_f2.obj + 0001:000123b0 lzo1x_decompress_asm 100133b0 lzo1x_s1.obj + 0001:000123b0 _lzo1x_decompress_asm 100133b0 lzo1x_s1.obj + 0001:00012590 lzo1x_decompress_asm_safe 10013590 lzo1x_s2.obj + 0001:00012590 _lzo1x_decompress_asm_safe 10013590 lzo1x_s2.obj + 0001:00012870 _lzo1y_decompress_asm_fast 10013870 lzo1y_f1.obj + 0001:00012870 lzo1y_decompress_asm_fast 10013870 lzo1y_f1.obj + 0001:00012a30 _lzo1y_decompress_asm_fast_safe 10013a30 lzo1y_f2.obj + 0001:00012a30 lzo1y_decompress_asm_fast_safe 10013a30 lzo1y_f2.obj + 0001:00012ce0 _lzo1y_decompress_asm 10013ce0 lzo1y_s1.obj + 0001:00012ce0 lzo1y_decompress_asm 10013ce0 lzo1y_s1.obj + 0001:00012ec0 lzo1y_decompress_asm_safe 10013ec0 lzo1y_s2.obj + 0001:00012ec0 _lzo1y_decompress_asm_safe 10013ec0 lzo1y_s2.obj + 0001:000131a0 _memcpy 100141a0 f MSVCRT:MSVCR90.dll + 0001:000131a6 _memset 100141a6 f MSVCRT:MSVCR90.dll + 0001:000131ac @__security_check_cookie@4 100141ac f MSVCRT:secchk.obj + 0001:0001320a __CRT_INIT@12 1001420a f MSVCRT:crtdll.obj + 0001:00013546 __DllMainCRTStartup@12 10014546 f MSVCRT:crtdll.obj + 0001:00013569 ___report_gsfailure 10014569 f MSVCRT:gs_report.obj + 0001:0001366f ___clean_type_info_names 1001466f f MSVCRT:tncleanup.obj + 0001:0001367b __onexit 1001467b f MSVCRT:atonexit.obj + 0001:00013720 _atexit 10014720 f MSVCRT:atonexit.obj + 0001:00013737 __RTC_Initialize 10014737 f MSVCRT:_initsect_.obj + 0001:0001375d __RTC_Terminate 1001475d f MSVCRT:_initsect_.obj + 0001:00013790 __ValidateImageBase 10014790 f MSVCRT:pesect.obj + 0001:000137d0 __FindPESection 100147d0 f MSVCRT:pesect.obj + 0001:00013820 __IsNonwritableInCurrentImage 10014820 f MSVCRT:pesect.obj + 0001:000138de __initterm 100148de f MSVCRT:MSVCR90.dll + 0001:000138e4 __initterm_e 100148e4 f MSVCRT:MSVCR90.dll + 0001:000138ea __amsg_exit 100148ea f MSVCRT:MSVCR90.dll + 0001:000138f0 ___CppXcptFilter 100148f0 f MSVCRT:MSVCR90.dll + 0001:000138f6 _DllMain@12 100148f6 f MSVCRT:dllmain.obj + 0001:0001391c __SEH_prolog4 1001491c f MSVCRT:sehprolg4.obj + 0001:00013961 __SEH_epilog4 10014961 f MSVCRT:sehprolg4.obj + 0001:00013975 __except_handler4 10014975 f MSVCRT:chandler4gs.obj + 0001:0001399a ___security_init_cookie 1001499a f MSVCRT:gs_support.obj + 0001:00013a30 __crt_debugger_hook 10014a30 f MSVCRT:MSVCR90.dll + 0001:00013a36 ___clean_type_info_names_internal 10014a36 f MSVCRT:MSVCR90.dll + 0001:00013a3c __unlock 10014a3c f MSVCRT:MSVCR90.dll + 0001:00013a42 ___dllonexit 10014a42 f MSVCRT:MSVCR90.dll + 0001:00013a48 __lock 10014a48 f MSVCRT:MSVCR90.dll + 0001:00013a4e __except_handler4_common 10014a4e f MSVCRT:MSVCR90.dll + 0002:00000000 __imp__GetCurrentProcessId@0 10015000 kernel32:KERNEL32.dll + 0002:00000004 __imp__GetCurrentThreadId@0 10015004 kernel32:KERNEL32.dll + 0002:00000008 __imp__GetTickCount@0 10015008 kernel32:KERNEL32.dll + 0002:0000000c __imp__QueryPerformanceCounter@4 1001500c kernel32:KERNEL32.dll + 0002:00000010 __imp__DisableThreadLibraryCalls@4 10015010 kernel32:KERNEL32.dll + 0002:00000014 __imp__IsDebuggerPresent@0 10015014 kernel32:KERNEL32.dll + 0002:00000018 __imp__SetUnhandledExceptionFilter@4 10015018 kernel32:KERNEL32.dll + 0002:0000001c __imp__UnhandledExceptionFilter@4 1001501c kernel32:KERNEL32.dll + 0002:00000020 __imp__GetCurrentProcess@0 10015020 kernel32:KERNEL32.dll + 0002:00000024 __imp__TerminateProcess@8 10015024 kernel32:KERNEL32.dll + 0002:00000028 __imp__InterlockedCompareExchange@12 10015028 kernel32:KERNEL32.dll + 0002:0000002c __imp__Sleep@4 1001502c kernel32:KERNEL32.dll + 0002:00000030 __imp__InterlockedExchange@8 10015030 kernel32:KERNEL32.dll + 0002:00000034 __imp__GetSystemTimeAsFileTime@4 10015034 kernel32:KERNEL32.dll + 0002:00000038 \177KERNEL32_NULL_THUNK_DATA 10015038 kernel32:KERNEL32.dll + 0002:0000003c __imp____clean_type_info_names_internal 1001503c MSVCRT:MSVCR90.dll + 0002:00000040 __imp___unlock 10015040 MSVCRT:MSVCR90.dll + 0002:00000044 __imp___crt_debugger_hook 10015044 MSVCRT:MSVCR90.dll + 0002:00000048 __imp___lock 10015048 MSVCRT:MSVCR90.dll + 0002:0000004c __imp___onexit 1001504c MSVCRT:MSVCR90.dll + 0002:00000050 __imp___except_handler4_common 10015050 MSVCRT:MSVCR90.dll + 0002:00000054 __imp____CppXcptFilter 10015054 MSVCRT:MSVCR90.dll + 0002:00000058 __imp___adjust_fdiv 10015058 MSVCRT:MSVCR90.dll + 0002:0000005c __imp___amsg_exit 1001505c MSVCRT:MSVCR90.dll + 0002:00000060 __imp___initterm_e 10015060 MSVCRT:MSVCR90.dll + 0002:00000064 __imp___initterm 10015064 MSVCRT:MSVCR90.dll + 0002:00000068 __imp___decode_pointer 10015068 MSVCRT:MSVCR90.dll + 0002:0000006c __imp___encoded_null 1001506c MSVCRT:MSVCR90.dll + 0002:00000070 __imp__free 10015070 MSVCRT:MSVCR90.dll + 0002:00000074 __imp___malloc_crt 10015074 MSVCRT:MSVCR90.dll + 0002:00000078 __imp___encode_pointer 10015078 MSVCRT:MSVCR90.dll + 0002:0000007c __imp__memmove 1001507c MSVCRT:MSVCR90.dll + 0002:00000080 __imp__memset 10015080 MSVCRT:MSVCR90.dll + 0002:00000084 __imp____dllonexit 10015084 MSVCRT:MSVCR90.dll + 0002:00000088 __imp__memcpy 10015088 MSVCRT:MSVCR90.dll + 0002:0000008c \177MSVCR90_NULL_THUNK_DATA 1001508c MSVCRT:MSVCR90.dll + 0002:00000090 ___xc_a 10015090 MSVCRT:cinitexe.obj + 0002:00000094 ___xc_z 10015094 MSVCRT:cinitexe.obj + 0002:00000098 ___xi_a 10015098 MSVCRT:cinitexe.obj + 0002:000000a0 ___xi_z 100150a0 MSVCRT:cinitexe.obj + 0002:000000a8 __lzo1b_1_compress_func 100150a8 lzo1b_1.obj + 0002:000000ac __lzo1b_2_compress_func 100150ac lzo1b_2.obj + 0002:000000b0 __lzo1b_3_compress_func 100150b0 lzo1b_3.obj + 0002:000000b4 __lzo1b_4_compress_func 100150b4 lzo1b_4.obj + 0002:000000b8 __lzo1b_5_compress_func 100150b8 lzo1b_5.obj + 0002:000000bc __lzo1b_6_compress_func 100150bc lzo1b_6.obj + 0002:000000c0 __lzo1b_7_compress_func 100150c0 lzo1b_7.obj + 0002:000000c4 __lzo1b_8_compress_func 100150c4 lzo1b_8.obj + 0002:000000c8 __lzo1b_9_compress_func 100150c8 lzo1b_9.obj + 0002:000000cc __lzo1b_99_compress_func 100150cc lzo1b_99.obj + 0002:000000f4 __lzo1c_1_compress_func 100150f4 lzo1c_1.obj + 0002:000000f8 __lzo1c_2_compress_func 100150f8 lzo1c_2.obj + 0002:000000fc __lzo1c_3_compress_func 100150fc lzo1c_3.obj + 0002:00000100 __lzo1c_4_compress_func 10015100 lzo1c_4.obj + 0002:00000104 __lzo1c_5_compress_func 10015104 lzo1c_5.obj + 0002:00000108 __lzo1c_6_compress_func 10015108 lzo1c_6.obj + 0002:0000010c __lzo1c_7_compress_func 1001510c lzo1c_7.obj + 0002:00000110 __lzo1c_8_compress_func 10015110 lzo1c_8.obj + 0002:00000114 __lzo1c_9_compress_func 10015114 lzo1c_9.obj + 0002:00000118 __lzo1c_99_compress_func 10015118 lzo1c_99.obj + 0002:000007c8 ___lzo_copyright 100157c8 lzo_util.obj + 0002:000007d0 ??_C@_04HCNBLLKJ@2?403?$AA@ 100157d0 lzo_util.obj + 0002:000007d8 ??_C@_0M@BNDAPJCM@Apr?530?52008?$AA@ 100157d8 lzo_util.obj + 0002:000007e4 __pRawDllMain 100157e4 MSVCRT:crtdll.obj + 0002:000007e4 __pDefaultRawDllMain 100157e4 MSVCRT:crtdll.obj + 0002:000007f0 ___rtc_iaa 100157f0 MSVCRT:_initsect_.obj + 0002:000007f4 ___rtc_izz 100157f4 MSVCRT:_initsect_.obj + 0002:000007f8 ___rtc_taa 100157f8 MSVCRT:_initsect_.obj + 0002:000007fc ___rtc_tzz 100157fc MSVCRT:_initsect_.obj + 0002:00000864 __IMPORT_DESCRIPTOR_MSVCR90 10015864 MSVCRT:MSVCR90.dll + 0002:00000878 __IMPORT_DESCRIPTOR_KERNEL32 10015878 kernel32:KERNEL32.dll + 0002:0000088c __NULL_IMPORT_DESCRIPTOR 1001588c MSVCRT:MSVCR90.dll + 0003:00000000 ___security_cookie 10017000 MSVCRT:gs_cookie.obj + 0003:00000004 ___security_cookie_complement 10017004 MSVCRT:gs_cookie.obj + 0003:00000008 ___native_dllmain_reason 10017008 MSVCRT:natstart.obj + 0003:0000000c ___native_vcclrit_reason 1001700c MSVCRT:natstart.obj + 0003:00000010 ___lzo_init_done 10017010 lzo_init.obj + 0003:0000033c __forceCRTManifestRTM 1001733c MSVCRT:crtmanifestrtm.obj + 0003:00000340 ?__type_info_root_node@@3U__type_info_node@@A 10017340 MSVCRT:tncleanup.obj + 0003:00000348 __adjust_fdiv 10017348 + 0003:0000034c ___native_startup_state 1001734c + 0003:00000350 ___native_startup_lock 10017350 + 0003:00000354 ___onexitend 10017354 + 0003:00000358 ___onexitbegin 10017358 + 0003:0000035c ___dyn_tls_init_callback 1001735c + + entry point at 0001:00013546 + + Static symbols + + 0001:00000130 _store_run 10001130 f lzo1.obj + 0001:00000250 _do_compress 10001250 f lzo1.obj + 0001:000004f0 _do_compress 100014f0 f lzo1_99.obj + 0001:00000ad0 _store_run 10001ad0 f lzo1a.obj + 0001:00000be0 _do_compress 10001be0 f lzo1a.obj + 0001:00000ec0 _do_compress 10001ec0 f lzo1a_99.obj + 0001:00001330 _do_compress 10002330 f lzo1b_1.obj + 0001:00001670 _do_compress 10002670 f lzo1b_2.obj + 0001:00001a40 _do_compress 10002a40 f lzo1b_3.obj + 0001:00001e60 _do_compress 10002e60 f lzo1b_4.obj + 0001:00002290 _do_compress 10003290 f lzo1b_5.obj + 0001:00002730 _do_compress 10003730 f lzo1b_6.obj + 0001:00002c10 _do_compress 10003c10 f lzo1b_7.obj + 0001:000030c0 _do_compress 100040c0 f lzo1b_8.obj + 0001:00003670 _do_compress 10004670 f lzo1b_9.obj + 0001:00003ab0 _do_compress 10004ab0 f lzo1b_99.obj + 0001:00003ee0 _swd_insertdict 10004ee0 f lzo1b_9x.obj + 0001:00003f60 _swd_init 10004f60 f lzo1b_9x.obj + 0001:00004080 _swd_getbyte 10005080 f lzo1b_9x.obj + 0001:00004080 _swd_getbyte 10005080 f lzo1b_9x.obj + 0001:00004080 _swd_getbyte 10005080 f lzo1b_9x.obj + 0001:00004080 _swd_getbyte 10005080 f lzo1b_9x.obj + 0001:00004100 _swd_accept 10005100 f lzo1b_9x.obj + 0001:000041c0 _swd_search 100051c0 f lzo1b_9x.obj + 0001:00004270 _swd_findbest 10005270 f lzo1b_9x.obj + 0001:000043a0 _find_match 100053a0 f lzo1b_9x.obj + 0001:00004430 _code_match 10005430 f lzo1b_9x.obj + 0001:00005070 _do_compress 10006070 f lzo1c_1.obj + 0001:000053e0 _do_compress 100063e0 f lzo1c_2.obj + 0001:00005790 _do_compress 10006790 f lzo1c_3.obj + 0001:00005be0 _do_compress 10006be0 f lzo1c_4.obj + 0001:00006020 _do_compress 10007020 f lzo1c_5.obj + 0001:00006450 _do_compress 10007450 f lzo1c_6.obj + 0001:00006960 _do_compress 10007960 f lzo1c_7.obj + 0001:00006dd0 _do_compress 10007dd0 f lzo1c_8.obj + 0001:000073c0 _do_compress 100083c0 f lzo1c_9.obj + 0001:00007820 _do_compress 10008820 f lzo1c_99.obj + 0001:00007c80 _swd_insertdict 10008c80 f lzo1c_9x.obj + 0001:00007c80 _swd_insertdict 10008c80 f lzo1c_9x.obj + 0001:00007d30 _code_match 10008d30 f lzo1c_9x.obj + 0001:000088a0 _do_compress 100098a0 f lzo1f_1.obj + 0001:00008cd0 _swd_init 10009cd0 f lzo1f_9x.obj + 0001:00008cd0 _swd_init 10009cd0 f lzo1f_9x.obj + 0001:00008df0 _swd_accept 10009df0 f lzo1f_9x.obj + 0001:00008df0 _swd_accept 10009df0 f lzo1f_9x.obj + 0001:00008ec0 _swd_search 10009ec0 f lzo1f_9x.obj + 0001:00008ec0 _swd_search 10009ec0 f lzo1f_9x.obj + 0001:00008f80 _swd_findbest 10009f80 f lzo1f_9x.obj + 0001:00008f80 _swd_findbest 10009f80 f lzo1f_9x.obj + 0001:000090c0 _find_match 1000a0c0 f lzo1f_9x.obj + 0001:000090c0 _find_match 1000a0c0 f lzo1f_9x.obj + 0001:00009150 _code_match 1000a150 f lzo1f_9x.obj + 0001:00009230 _STORE_RUN 1000a230 f lzo1f_9x.obj + 0001:00009bb0 _do_compress 1000abb0 f lzo1x_1.obj + 0001:00009fe0 _do_compress 1000afe0 f lzo1x_1k.obj + 0001:0000a400 _do_compress 1000b400 f lzo1x_1l.obj + 0001:0000a810 _do_compress 1000b810 f lzo1x_1o.obj + 0001:0000ac40 _swd_insertdict 1000bc40 f lzo1x_9x.obj + 0001:0000ac40 _swd_insertdict 1000bc40 f lzo1x_9x.obj + 0001:0000ac40 _swd_insertdict 1000bc40 f lzo1x_9x.obj + 0001:0000ad20 _find_match 1000bd20 f lzo1x_9x.obj + 0001:0000ad20 _find_match 1000bd20 f lzo1x_9x.obj + 0001:0000ad20 _find_match 1000bd20 f lzo1x_9x.obj + 0001:0000add0 _code_match 1000bdd0 f lzo1x_9x.obj + 0001:0000afa0 _len_of_coded_match 1000bfa0 f lzo1x_9x.obj + 0001:0000b030 _better_match 1000c030 f lzo1x_9x.obj + 0001:0000c2b0 _copy3 1000d2b0 f lzo1x_o.obj + 0001:0000c2b0 _copy3 1000d2b0 f lzo1x_o.obj + 0001:0000c880 _do_compress 1000d880 f lzo1y_1.obj + 0001:0000ccc0 _swd_remove_node 1000dcc0 f lzo1y_9x.obj + 0001:0000ccc0 _swd_remove_node 1000dcc0 f lzo1y_9x.obj + 0001:0000ccc0 _swd_remove_node 1000dcc0 f lzo1y_9x.obj + 0001:0000cd40 _swd_accept 1000dd40 f lzo1y_9x.obj + 0001:0000cd40 _swd_accept 1000dd40 f lzo1y_9x.obj + 0001:0000cd40 _swd_accept 1000dd40 f lzo1y_9x.obj + 0001:0000ce00 _swd_search2 1000de00 f lzo1y_9x.obj + 0001:0000ce00 _swd_search2 1000de00 f lzo1y_9x.obj + 0001:0000ce00 _swd_search2 1000de00 f lzo1y_9x.obj + 0001:0000ce50 _swd_findbest 1000de50 f lzo1y_9x.obj + 0001:0000ce50 _swd_findbest 1000de50 f lzo1y_9x.obj + 0001:0000ce50 _swd_findbest 1000de50 f lzo1y_9x.obj + 0001:0000cff0 _code_match 1000dff0 f lzo1y_9x.obj + 0001:0000d1c0 _STORE_RUN 1000e1c0 f lzo1y_9x.obj + 0001:0000d1c0 _STORE_RUN 1000e1c0 f lzo1y_9x.obj + 0001:0000d270 _len_of_coded_match 1000e270 f lzo1y_9x.obj + 0001:0000d300 _better_match 1000e300 f lzo1y_9x.obj + 0001:0000eb30 _swd_initdict 1000fb30 f lzo1z_9x.obj + 0001:0000eb30 _swd_initdict 1000fb30 f lzo1z_9x.obj + 0001:0000eb30 _swd_initdict 1000fb30 f lzo1z_9x.obj + 0001:0000eb90 _swd_init 1000fb90 f lzo1z_9x.obj + 0001:0000eb90 _swd_init 1000fb90 f lzo1z_9x.obj + 0001:0000eb90 _swd_init 1000fb90 f lzo1z_9x.obj + 0001:0000ece0 _swd_getbyte 1000fce0 f lzo1z_9x.obj + 0001:0000ece0 _swd_getbyte 1000fce0 f lzo1z_9x.obj + 0001:0000ece0 _swd_getbyte 1000fce0 f lzo1z_9x.obj + 0001:0000ed90 _swd_search 1000fd90 f lzo1z_9x.obj + 0001:0000ed90 _swd_search 1000fd90 f lzo1z_9x.obj + 0001:0000ed90 _swd_search 1000fd90 f lzo1z_9x.obj + 0001:0000ee80 _code_match 1000fe80 f lzo1z_9x.obj + 0001:0000f080 _STORE_RUN 10010080 f lzo1z_9x.obj + 0001:0000f130 _len_of_coded_match 10010130 f lzo1z_9x.obj + 0001:0000f1c0 _better_match 100101c0 f lzo1z_9x.obj + 0001:00010510 _swd_insertdict 10011510 f lzo2a_9x.obj + 0001:000105d0 _swd_init 100115d0 f lzo2a_9x.obj + 0001:00010710 _swd_remove_node 10011710 f lzo2a_9x.obj + 0001:00010780 _swd_accept 10011780 f lzo2a_9x.obj + 0001:00010880 _swd_search 10011880 f lzo2a_9x.obj + 0001:00010940 _swd_findbest 10011940 f lzo2a_9x.obj + 0001:00010a70 _find_match 10011a70 f lzo2a_9x.obj + 0001:000131bb _pre_c_init 100141bb f MSVCRT:crtdll.obj + 0001:00013430 ___DllMainCRTStartup 10014430 f MSVCRT:crtdll.obj diff --git a/thirdparty/lzo/2.03/lzo2a_9x.obj b/thirdparty/lzo/2.03/lzo2a_9x.obj new file mode 100644 index 0000000..41b1942 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2a_9x.obj differ diff --git a/thirdparty/lzo/2.03/lzo2a_d1.obj b/thirdparty/lzo/2.03/lzo2a_d1.obj new file mode 100644 index 0000000..c41d0d1 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2a_d1.obj differ diff --git a/thirdparty/lzo/2.03/lzo2a_d2.obj b/thirdparty/lzo/2.03/lzo2a_d2.obj new file mode 100644 index 0000000..4e5fbcc Binary files /dev/null and b/thirdparty/lzo/2.03/lzo2a_d2.obj differ diff --git a/thirdparty/lzo/2.03/lzo_crc.obj b/thirdparty/lzo/2.03/lzo_crc.obj new file mode 100644 index 0000000..74c2250 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo_crc.obj differ diff --git a/thirdparty/lzo/2.03/lzo_init.obj b/thirdparty/lzo/2.03/lzo_init.obj new file mode 100644 index 0000000..7cc1da9 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo_init.obj differ diff --git a/thirdparty/lzo/2.03/lzo_ptr.obj b/thirdparty/lzo/2.03/lzo_ptr.obj new file mode 100644 index 0000000..57b1c50 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo_ptr.obj differ diff --git a/thirdparty/lzo/2.03/lzo_str.obj b/thirdparty/lzo/2.03/lzo_str.obj new file mode 100644 index 0000000..7397388 Binary files /dev/null and b/thirdparty/lzo/2.03/lzo_str.obj differ diff --git a/thirdparty/lzo/2.03/lzo_util.obj b/thirdparty/lzo/2.03/lzo_util.obj new file mode 100644 index 0000000..63e9fdb Binary files /dev/null and b/thirdparty/lzo/2.03/lzo_util.obj differ diff --git a/thirdparty/lzo/2.03/lzopack.exe b/thirdparty/lzo/2.03/lzopack.exe new file mode 100644 index 0000000..11c2027 Binary files /dev/null and b/thirdparty/lzo/2.03/lzopack.exe differ diff --git a/thirdparty/lzo/2.03/lzopack.exe.manifest b/thirdparty/lzo/2.03/lzopack.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/lzopack.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/lzopack.obj b/thirdparty/lzo/2.03/lzopack.obj new file mode 100644 index 0000000..ba4e8f2 Binary files /dev/null and b/thirdparty/lzo/2.03/lzopack.obj differ diff --git a/thirdparty/lzo/2.03/lzotest.exe b/thirdparty/lzo/2.03/lzotest.exe new file mode 100644 index 0000000..3fed836 Binary files /dev/null and b/thirdparty/lzo/2.03/lzotest.exe differ diff --git a/thirdparty/lzo/2.03/lzotest.exe.manifest b/thirdparty/lzo/2.03/lzotest.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/lzotest.obj b/thirdparty/lzo/2.03/lzotest.obj new file mode 100644 index 0000000..4b4e8ee Binary files /dev/null and b/thirdparty/lzo/2.03/lzotest.obj differ diff --git a/thirdparty/lzo/2.03/lzotest/Makefile.am b/thirdparty/lzo/2.03/lzotest/Makefile.am new file mode 100644 index 0000000..842ccfb --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/Makefile.am @@ -0,0 +1,15 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) + +noinst_PROGRAMS = lzotest + +lzotest_SOURCES = lzotest.c +lzotest_LDADD = ../src/liblzo2.la +lzotest_DEPENDENCIES = ../src/liblzo2.la + +EXTRA_DIST = asm.h db.h wrap.h wrapmisc.h mygetopt.ch mygetopt.h + diff --git a/thirdparty/lzo/2.03/lzotest/Makefile.in b/thirdparty/lzo/2.03/lzotest/Makefile.in new file mode 100644 index 0000000..d2df902 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/Makefile.in @@ -0,0 +1,441 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = lzotest$(EXEEXT) +subdir = lzotest +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_lzotest_OBJECTS = lzotest.$(OBJEXT) +lzotest_OBJECTS = $(am_lzotest_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(lzotest_SOURCES) +DIST_SOURCES = $(lzotest_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) +lzotest_SOURCES = lzotest.c +lzotest_LDADD = ../src/liblzo2.la +lzotest_DEPENDENCIES = ../src/liblzo2.la +EXTRA_DIST = asm.h db.h wrap.h wrapmisc.h mygetopt.ch mygetopt.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lzotest/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lzotest/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +lzotest$(EXEEXT): $(lzotest_OBJECTS) $(lzotest_DEPENDENCIES) + @rm -f lzotest$(EXEEXT) + $(LINK) $(lzotest_LDFLAGS) $(lzotest_OBJECTS) $(lzotest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzotest.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/lzotest/asm.h b/thirdparty/lzo/2.03/lzotest/asm.h new file mode 100644 index 0000000..e61f1fc --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/asm.h @@ -0,0 +1,82 @@ +/* asm.h -- library assembler function prototypes + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// +**************************************************************************/ + +#if defined(LZO_USE_ASM) +# include "lzo/lzo_asm.h" +#else +# define lzo1c_decompress_asm 0 +# define lzo1c_decompress_asm_safe 0 +# define lzo1f_decompress_asm_fast 0 +# define lzo1f_decompress_asm_fast_safe 0 +# define lzo1x_decompress_asm 0 +# define lzo1x_decompress_asm_safe 0 +# define lzo1x_decompress_asm_fast 0 +# define lzo1x_decompress_asm_fast_safe 0 +# define lzo1y_decompress_asm 0 +# define lzo1y_decompress_asm_safe 0 +# define lzo1y_decompress_asm_fast 0 +# define lzo1y_decompress_asm_fast_safe 0 +#endif + + +/************************************************************************* +// these are not yet implemented +**************************************************************************/ + +#define lzo1b_decompress_asm 0 +#define lzo1b_decompress_asm_safe 0 +#define lzo1b_decompress_asm_fast 0 +#define lzo1b_decompress_asm_fast_safe 0 + +#define lzo1c_decompress_asm_fast 0 +#define lzo1c_decompress_asm_fast_safe 0 + +#define lzo1f_decompress_asm 0 +#define lzo1f_decompress_asm_safe 0 + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/lzotest/db.h b/thirdparty/lzo/2.03/lzotest/db.h new file mode 100644 index 0000000..1e6152d --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/db.h @@ -0,0 +1,497 @@ +/* db.h -- compression database + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +/************************************************************************* +// +**************************************************************************/ + +#if defined(HAVE_LZO1_H) +{ "LZO1-1", M_LZO1, LZO1_MEM_COMPRESS, LZO1_MEM_DECOMPRESS, + lzo1_compress, 0, + lzo1_decompress, 0, + 0, 0, + 0, 0, + 0, 0 }, +{ "LZO1-99", M_LZO1_99, LZO1_99_MEM_COMPRESS, LZO1_MEM_DECOMPRESS, + lzo1_99_compress, 0, + lzo1_decompress, 0, + 0, 0, + 0, 0, + 0, 0 }, +#endif + +#if defined(HAVE_LZO1A_H) +{ "LZO1A-1", M_LZO1A, LZO1A_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS, + lzo1a_compress, 0, + lzo1a_decompress, 0, + 0, 0, + 0, 0, + 0, 0 }, +{ "LZO1A-99", M_LZO1A_99, LZO1A_99_MEM_COMPRESS, LZO1A_MEM_DECOMPRESS, + lzo1a_99_compress, 0, + lzo1a_decompress, 0, + 0, 0, + 0, 0, + 0, 0 }, +#endif + +#if defined(HAVE_LZO1B_H) +{ "LZO1B-1", M_LZO1B_1, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_1_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-2", M_LZO1B_2, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_2_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-3", M_LZO1B_3, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_3_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-4", M_LZO1B_4, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_4_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-5", M_LZO1B_5, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_5_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-6", M_LZO1B_6, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_6_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-7", M_LZO1B_7, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_7_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-8", M_LZO1B_8, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_8_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-9", M_LZO1B_9, LZO1B_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_9_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-99", M_LZO1B_99, LZO1B_99_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_99_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1B-999", M_LZO1B_999, LZO1B_999_MEM_COMPRESS, LZO1B_MEM_DECOMPRESS, + lzo1b_999_compress, 0, + lzo1b_decompress, lzo1b_decompress_safe, + lzo1b_decompress_asm, lzo1b_decompress_asm_safe, + lzo1b_decompress_asm_fast, lzo1b_decompress_asm_fast_safe, + 0, 0 }, +#endif + +#if defined(HAVE_LZO1C_H) +{ "LZO1C-1", M_LZO1C_1, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_1_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-2", M_LZO1C_2, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_2_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-3", M_LZO1C_3, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_3_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-4", M_LZO1C_4, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_4_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-5", M_LZO1C_5, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_5_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-6", M_LZO1C_6, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_6_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-7", M_LZO1C_7, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_7_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-8", M_LZO1C_8, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_8_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-9", M_LZO1C_9, LZO1C_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_9_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-99", M_LZO1C_99, LZO1C_99_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_99_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1C-999", M_LZO1C_999, LZO1C_999_MEM_COMPRESS, LZO1C_MEM_DECOMPRESS, + lzo1c_999_compress, 0, + lzo1c_decompress, lzo1c_decompress_safe, + lzo1c_decompress_asm, lzo1c_decompress_asm_safe, + lzo1c_decompress_asm_fast, lzo1c_decompress_asm_fast_safe, + 0, 0 }, +#endif + +#if defined(HAVE_LZO1F_H) +{ "LZO1F-1", M_LZO1F_1, LZO1F_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS, + lzo1f_1_compress, 0, + lzo1f_decompress, lzo1f_decompress_safe, + lzo1f_decompress_asm, lzo1f_decompress_asm_safe, + lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1F-999", M_LZO1F_999, LZO1F_999_MEM_COMPRESS, LZO1F_MEM_DECOMPRESS, + lzo1f_999_compress, 0, + lzo1f_decompress, lzo1f_decompress_safe, + lzo1f_decompress_asm, lzo1f_decompress_asm_safe, + lzo1f_decompress_asm_fast, lzo1f_decompress_asm_fast_safe, + 0, 0 }, +#endif + +#if defined(HAVE_LZO1X_H) +{ "LZO1X-1", M_LZO1X_1, LZO1X_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_1_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, 0 }, +#if 0 +{ "LZO1XT-1", M_LZO1XT_1, LZO1XT_1_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1xt_1_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, 0 }, +#endif +{ "LZO1X-1(11)", M_LZO1X_1_11, LZO1X_1_11_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_1_11_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1X-1(12)", M_LZO1X_1_12, LZO1X_1_12_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_1_12_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1X-1(15)", M_LZO1X_1_15, LZO1X_1_15_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_1_15_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, 0 }, +{ "LZO1X-999", M_LZO1X_999, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + lzo1x_999_compress_dict, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/1", 9721, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_1_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/2", 9722, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_2_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/3", 9723, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_3_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/4", 9724, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_4_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/5", 9725, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_5_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/6", 9726, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_6_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/7", 9727, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_7_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/8", 9728, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_8_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +{ "LZO1X-999/9", 9729, LZO1X_999_MEM_COMPRESS, LZO1X_MEM_DECOMPRESS, + lzo1x_999_9_compress, lzo1x_optimize, + lzo1x_decompress, lzo1x_decompress_safe, + lzo1x_decompress_asm, lzo1x_decompress_asm_safe, + lzo1x_decompress_asm_fast, lzo1x_decompress_asm_fast_safe, + 0, lzo1x_decompress_dict_safe }, +#endif + +#if defined(HAVE_LZO1Y_H) +{ "LZO1Y-1", M_LZO1Y_1, LZO1Y_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_1_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999", M_LZO1Y_999, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + lzo1y_999_compress_dict, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/1", 9821, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_1_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/2", 9822, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_2_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/3", 9823, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_3_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/4", 9824, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_4_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/5", 9825, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_5_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/6", 9826, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_6_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/7", 9827, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_7_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/8", 9828, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_8_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +{ "LZO1Y-999/9", 9829, LZO1Y_999_MEM_COMPRESS, LZO1Y_MEM_DECOMPRESS, + lzo1y_999_9_compress, lzo1y_optimize, + lzo1y_decompress, lzo1y_decompress_safe, + lzo1y_decompress_asm, lzo1y_decompress_asm_safe, + lzo1y_decompress_asm_fast, lzo1y_decompress_asm_fast_safe, + 0, lzo1y_decompress_dict_safe }, +#endif + +#if defined(HAVE_LZO1Z_H) +{ "LZO1Z-999", M_LZO1Z_999, LZO1Z_999_MEM_COMPRESS, LZO1Z_MEM_DECOMPRESS, + lzo1z_999_compress, 0, + lzo1z_decompress, lzo1z_decompress_safe, + 0, 0, + 0, 0, + lzo1z_999_compress_dict, lzo1z_decompress_dict_safe }, +#endif + +#if defined(HAVE_LZO2A_H) +{ "LZO2A-999", M_LZO2A_999, LZO2A_999_MEM_COMPRESS, LZO2A_MEM_DECOMPRESS, + lzo2a_999_compress, 0, + lzo2a_decompress, lzo2a_decompress_safe, + 0, 0, + 0, 0, + 0, 0 }, +#endif + +#if defined(ALG_ZLIB) +{ "zlib-8/1", M_ZLIB_8_1, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_1_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/2", M_ZLIB_8_2, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_2_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/3", M_ZLIB_8_3, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_3_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/4", M_ZLIB_8_4, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_4_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/5", M_ZLIB_8_5, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_5_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/6", M_ZLIB_8_6, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_6_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/7", M_ZLIB_8_7, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_7_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/8", M_ZLIB_8_8, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_8_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "zlib-8/9", M_ZLIB_8_9, ZLIB_MEM_COMPRESS, ZLIB_MEM_DECOMPRESS, + zlib_8_9_compress, 0, + zlib_decompress, 0, 0, 0, 0, 0, 0, 0 }, +#endif + +#if defined(ALG_BZIP2) +{ "bzip2/1", M_BZIP2_1, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_1_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/2", M_BZIP2_2, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_2_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/3", M_BZIP2_3, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_3_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/4", M_BZIP2_4, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_4_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/5", M_BZIP2_5, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_5_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/6", M_BZIP2_6, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_6_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/7", M_BZIP2_7, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_7_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/8", M_BZIP2_8, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_8_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +{ "bzip2/9", M_BZIP2_9, BZIP2_MEM_COMPRESS, BZIP2_MEM_DECOMPRESS, + bzip2_9_compress, 0, + bzip2_decompress, 0, 0, 0, 0, 0, 0, 0 }, +#endif + + + +{ "memcpy()", M_MEMCPY, 0, 0, memcpy_x_compress, 0, + memcpy_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +{ "memset()", M_MEMSET, 0, 0, memset_x_compress, 0, + memset_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +{ "adler32()", M_ADLER32, 0, 0, adler32_x_compress, 0, + adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +{ "crc32()", M_CRC32, 0, 0, crc32_x_compress, 0, + crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +#if defined(ALG_ZLIB) +{ "z_adler32()", M_Z_ADLER32, 0, 0, zlib_adler32_x_compress, 0, + zlib_adler32_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +{ "z_crc32()", M_Z_CRC32, 0, 0, zlib_crc32_x_compress, 0, + zlib_crc32_x_compress, 0, 0, 0, 0, 0, 0, 0 }, +#endif + +#if defined(__LZO_PROFESSIONAL__) +# include "lzopro/t_db.ch" +#endif + + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/lzotest/lzotest.c b/thirdparty/lzo/2.03/lzotest/lzotest.c new file mode 100644 index 0000000..13f6e08 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/lzotest.c @@ -0,0 +1,2091 @@ +/* lzotest.c -- very comprehensive test driver for the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo/lzoconf.h" + + +/************************************************************************* +// util +**************************************************************************/ + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#define WANT_LZO_FREAD 1 +#define WANT_LZO_WILDARGV 1 +#define WANT_LZO_UCLOCK 1 +#include "examples/portab.h" + +#if defined(HAVE_STRNICMP) && !defined(HAVE_STRNCASECMP) +# define strncasecmp(a,b,c) strnicmp(a,b,c) +# define HAVE_STRNCASECMP 1 +#endif + +#if 0 +# define is_digit(x) (isdigit((unsigned char)(x))) +# define is_space(x) (isspace((unsigned char)(x))) +#else +# define is_digit(x) ((unsigned)(x) - '0' <= 9) +# define is_space(x) ((x)==' ' || (x)=='\t' || (x)=='\r' || (x)=='\n') +#endif + +#include "mygetopt.h" +#include "mygetopt.ch" + + +/************************************************************************* +// compression include section +**************************************************************************/ + +#define HAVE_LZO1_H 1 +#define HAVE_LZO1A_H 1 +#define HAVE_LZO1B_H 1 +#define HAVE_LZO1C_H 1 +#define HAVE_LZO1F_H 1 +#define HAVE_LZO1X_H 1 +#define HAVE_LZO1Y_H 1 +#define HAVE_LZO1Z_H 1 +#define HAVE_LZO2A_H 1 + +#if defined(NO_ZLIB_H) || (SIZEOF_INT < 4) +#undef HAVE_ZLIB_H +#endif +#if defined(NO_BZLIB_H) || (SIZEOF_INT != 4) +#undef HAVE_BZLIB_H +#endif + +#if 0 && defined(LZO_OS_DOS16) +/* don't make this test program too big */ +#undef HAVE_LZO1_H +#undef HAVE_LZO1A_H +#undef HAVE_LZO1C_H +#undef HAVE_LZO1Z_H +#undef HAVE_LZO2A_H +#undef HAVE_LZO2B_H +#undef HAVE_ZLIB_H +#endif + + +/* LZO algorithms */ +#if defined(HAVE_LZO1_H) +# include "lzo/lzo1.h" +#endif +#if defined(HAVE_LZO1A_H) +# include "lzo/lzo1a.h" +#endif +#if defined(HAVE_LZO1B_H) +# include "lzo/lzo1b.h" +#endif +#if defined(HAVE_LZO1C_H) +# include "lzo/lzo1c.h" +#endif +#if defined(HAVE_LZO1F_H) +# include "lzo/lzo1f.h" +#endif +#if defined(HAVE_LZO1X_H) +# include "lzo/lzo1x.h" +#endif +#if defined(HAVE_LZO1Y_H) +# include "lzo/lzo1y.h" +#endif +#if defined(HAVE_LZO1Z_H) +# include "lzo/lzo1z.h" +#endif +#if defined(HAVE_LZO2A_H) +# include "lzo/lzo2a.h" +#endif +#if defined(HAVE_LZO2B_H) +# include "lzo/lzo2b.h" +#endif + +/* other compressors */ +#if defined(__LZO_PROFESSIONAL__) +# include "lzopro/t_config.ch" +#endif +#if defined(HAVE_ZLIB_H) +# include +# define ALG_ZLIB +#endif +#if defined(HAVE_BZLIB_H) +# include +# define ALG_BZIP2 +#endif + + +/************************************************************************* +// enumerate all methods +**************************************************************************/ + +enum { +/* compression algorithms */ + M_LZO1B_1 = 1, + M_LZO1B_2, M_LZO1B_3, M_LZO1B_4, M_LZO1B_5, + M_LZO1B_6, M_LZO1B_7, M_LZO1B_8, M_LZO1B_9, + + M_LZO1C_1 = 11, + M_LZO1C_2, M_LZO1C_3, M_LZO1C_4, M_LZO1C_5, + M_LZO1C_6, M_LZO1C_7, M_LZO1C_8, M_LZO1C_9, + + M_LZO1 = 21, + M_LZO1A = 31, + + M_LZO1B_99 = 901, + M_LZO1B_999 = 902, + M_LZO1C_99 = 911, + M_LZO1C_999 = 912, + M_LZO1_99 = 921, + M_LZO1A_99 = 931, + + M_LZO1F_1 = 61, + M_LZO1F_999 = 962, + M_LZO1X_1 = 71, + M_LZO1X_1_11 = 111, + M_LZO1X_1_12 = 112, + M_LZO1X_1_15 = 115, + M_LZO1X_999 = 972, + M_LZO1Y_1 = 81, + M_LZO1Y_999 = 982, + M_LZO1Z_999 = 992, + + M_LZO2A_999 = 942, + M_LZO2B_999 = 952, + + M_LAST_LZO_COMPRESSOR = 998, + +/* other compressors */ +#if defined(ALG_ZLIB) + M_ZLIB_8_1 = 1101, + M_ZLIB_8_2, M_ZLIB_8_3, M_ZLIB_8_4, M_ZLIB_8_5, + M_ZLIB_8_6, M_ZLIB_8_7, M_ZLIB_8_8, M_ZLIB_8_9, +#endif +#if defined(ALG_BZIP2) + M_BZIP2_1 = 1201, + M_BZIP2_2, M_BZIP2_3, M_BZIP2_4, M_BZIP2_5, + M_BZIP2_6, M_BZIP2_7, M_BZIP2_8, M_BZIP2_9, +#endif + +/* dummy compressor - for benchmarking */ + M_MEMCPY = 999, + + M_LAST_COMPRESSOR = 4999, + +/* dummy algorithms - for benchmarking */ + M_MEMSET = 5001, + +/* checksum algorithms - for benchmarking */ + M_ADLER32 = 6001, + M_CRC32 = 6002, +#if defined(ALG_ZLIB) + M_Z_ADLER32 = 6011, + M_Z_CRC32 = 6012, +#endif + + M_UNUSED +}; + + +/************************************************************************* +// command line options +**************************************************************************/ + +struct corpus_entry_t; + +int opt_verbose = 2; + +long opt_c_loops = 0; +long opt_d_loops = 0; +const struct corpus_entry_t *opt_corpus = NULL; +const char *opt_corpus_path = NULL; +const char *opt_dump_compressed_data = NULL; + +lzo_bool opt_use_safe_decompressor = 0; +lzo_bool opt_use_asm_decompressor = 0; +lzo_bool opt_use_asm_fast_decompressor = 0; +lzo_bool opt_optimize_compressed_data = 0; + +int opt_dict = 0; +lzo_uint opt_max_dict_len = LZO_UINT_MAX; +const char *opt_dictionary_file = NULL; + +lzo_bool opt_read_from_stdin = 0; + +/* set these to 1 to measure the speed impact of a checksum */ +lzo_bool opt_compute_adler32 = 0; +lzo_bool opt_compute_crc32 = 0; +static lzo_uint32 adler_in, adler_out; +static lzo_uint32 crc_in, crc_out; + +lzo_bool opt_execution_time = 0; +int opt_uclock = -1; +lzo_bool opt_clear_wrkmem = 0; + +static const lzo_bool opt_try_to_compress_0_bytes = 1; + + +/************************************************************************* +// misc globals +**************************************************************************/ + +static const char *progname = ""; +static lzo_uclock_handle_t uch; + +/* for statistics and benchmark */ +int opt_totals = 0; +static unsigned long total_n = 0; +static unsigned long total_c_len = 0; +static unsigned long total_d_len = 0; +static unsigned long total_blocks = 0; +static double total_perc = 0.0; +static const char *total_method_name = NULL; +static unsigned total_method_names = 0; +/* Note: the average value of a rate (e.g. compression speed) is defined + * by the Harmonic Mean (and _not_ by the Arithmethic Mean ) */ +static unsigned long total_c_mbs_n = 0; +static unsigned long total_d_mbs_n = 0; +static double total_c_mbs_harmonic = 0.0; +static double total_d_mbs_harmonic = 0.0; +static double total_c_mbs_sum = 0.0; +static double total_d_mbs_sum = 0.0; + + +#if defined(HAVE_LZO1X_H) +int default_method = M_LZO1X_1; +#elif defined(HAVE_LZO1B_H) +int default_method = M_LZO1B_1; +#elif defined(HAVE_LZO1C_H) +int default_method = M_LZO1C_1; +#elif defined(HAVE_LZO1F_H) +int default_method = M_LZO1F_1; +#elif defined(HAVE_LZO1Y_H) +int default_method = M_LZO1Y_1; +#else +int default_method = M_MEMCPY; +#endif + + +static const int benchmark_methods[] = { + M_LZO1B_1, M_LZO1B_9, + M_LZO1C_1, M_LZO1C_9, + M_LZO1F_1, + M_LZO1X_1, + 0 +}; + +static const int x1_methods[] = { + M_LZO1, M_LZO1A, M_LZO1B_1, M_LZO1C_1, M_LZO1F_1, M_LZO1X_1, M_LZO1Y_1, + 0 +}; + +static const int x99_methods[] = { + M_LZO1_99, M_LZO1A_99, M_LZO1B_99, M_LZO1C_99, + 0 +}; + +static const int x999_methods[] = { + M_LZO1B_999, M_LZO1C_999, M_LZO1F_999, M_LZO1X_999, M_LZO1Y_999, + M_LZO1Z_999, + M_LZO2A_999, + 0 +}; + + +/* exit codes of this test program */ +#define EXIT_OK 0 +#define EXIT_USAGE 1 +#define EXIT_FILE 2 +#define EXIT_MEM 3 +#define EXIT_ADLER 4 +#define EXIT_LZO_ERROR 5 +#define EXIT_LZO_INIT 6 +#define EXIT_INTERNAL 7 + + +/************************************************************************* +// memory setup +**************************************************************************/ + +static lzo_uint opt_block_size; +static lzo_uint opt_max_data_len; + +typedef struct { + lzo_bytep ptr; + lzo_uint len; + lzo_uint32 adler; + lzo_uint32 crc; + lzo_bytep alloc_ptr; + lzo_uint alloc_len; + lzo_uint saved_len; +} mblock_t; + +static mblock_t file_data; +static mblock_t block1; +static mblock_t block2; +static mblock_t wrkmem; +static mblock_t dict; + + +static void mb_alloc_extra(mblock_t *mb, lzo_uint len, lzo_uint extra_bottom, lzo_uint extra_top) +{ + mb->alloc_ptr = mb->ptr = NULL; + mb->alloc_len = mb->len = 0; + + mb->alloc_len = extra_bottom + len + extra_top; + if (mb->alloc_len == 0) mb->alloc_len = 1; + mb->alloc_ptr = (lzo_bytep) lzo_malloc(mb->alloc_len); + + if (mb->alloc_ptr == NULL) { + fprintf(stderr, "%s: out of memory (wanted %lu bytes)\n", progname, (unsigned long)mb->alloc_len); + exit(EXIT_MEM); + } + + mb->ptr = mb->alloc_ptr + extra_bottom; + mb->len = mb->saved_len = len; + mb->adler = 1; + mb->crc = 0; +} + + +static void mb_alloc(mblock_t *mb, lzo_uint len) +{ + mb_alloc_extra(mb, len, 0, 0); +} + + +static void mb_free(mblock_t *mb) +{ + if (!mb) return; + if (mb->alloc_ptr) lzo_free(mb->alloc_ptr); + mb->alloc_ptr = mb->ptr = NULL; + mb->alloc_len = mb->len = 0; +} + + +static lzo_uint get_max_compression_expansion(int m, lzo_uint bl) +{ + if (m == M_MEMCPY || m >= M_LAST_COMPRESSOR) + return 0; + if (m == M_LZO2A_999 || m == M_LZO2B_999) + return bl / 8 + 256; + if (m > 0 && m < M_LAST_LZO_COMPRESSOR) + return bl / 16 + 64 + 3; + return bl / 8 + 256; +} + +static lzo_uint get_max_decompression_overrun(int m, lzo_uint bl) +{ + LZO_UNUSED(m); + LZO_UNUSED(bl); + /* may overwrite 3 bytes past the end of the decompressed block */ + if (opt_use_asm_fast_decompressor) + return (lzo_uint) sizeof(lzo_voidp) - 1; + return 0; +} + + +/************************************************************************* +// dictionary support +**************************************************************************/ + +static void dict_alloc(lzo_uint max_dict_len) +{ + lzo_uint l = 0xbfff; /* MAX_DICT_LEN */ + if (max_dict_len > 0 && l > max_dict_len) + l = max_dict_len; + mb_alloc(&dict, l); +} + + +/* this default dictionary does not provide good contexts... */ +static void dict_set_default(void) +{ + lzo_uint d = 0; + unsigned i, j; + + dict.len = 16 * 256; + if (dict.len > dict.alloc_len) + dict.len = dict.alloc_len; + + lzo_memset(dict.ptr, 0, dict.len); + + for (i = 0; i < 256; i++) + for (j = 0; j < 16; j++) { + if (d >= dict.len) + goto done; + dict.ptr[d++] = (unsigned char) i; + } + +done: + dict.adler = lzo_adler32(1, dict.ptr, dict.len); +} + + +static void dict_load(const char *file_name) +{ + FILE *fp; + + dict.len = 0; + fp = fopen(file_name,"rb"); + if (fp) + { + dict.len = (lzo_uint) lzo_fread(fp, dict.ptr, dict.alloc_len); + fclose(fp); + dict.adler = lzo_adler32(1, dict.ptr, dict.len); + } +} + + +/************************************************************************* +// compression database +**************************************************************************/ + +typedef struct +{ + const char * name; + int id; + lzo_uint32 mem_compress; + lzo_uint32 mem_decompress; + lzo_compress_t compress; + lzo_optimize_t optimize; + lzo_decompress_t decompress; + lzo_decompress_t decompress_safe; + lzo_decompress_t decompress_asm; + lzo_decompress_t decompress_asm_safe; + lzo_decompress_t decompress_asm_fast; + lzo_decompress_t decompress_asm_fast_safe; + lzo_compress_dict_t compress_dict; + lzo_decompress_dict_t decompress_dict_safe; +} +compress_t; + +#include "asm.h" + +#include "wrap.h" +#define M_PRIVATE LZO_PRIVATE +#define m_uint lzo_uint +#define m_uint32 lzo_uint32 +#define m_voidp lzo_voidp +#define m_bytep lzo_bytep +#define m_uintp lzo_uintp +#include "wrapmisc.h" + +static const compress_t compress_database[] = { +#include "db.h" +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/db.ch" +#endif + + +/************************************************************************* +// method info +**************************************************************************/ + +static +lzo_decompress_t get_decomp_info ( const compress_t *c, const char **nn ) +{ + lzo_decompress_t d = 0; + const char *n = NULL; + + /* safe has priority over asm/fast */ + if (!d && opt_use_safe_decompressor && opt_use_asm_fast_decompressor) + { + d = c->decompress_asm_fast_safe; + n = " [fs]"; + } + if (!d && opt_use_safe_decompressor && opt_use_asm_decompressor) + { + d = c->decompress_asm_safe; + n = " [as]"; + } + if (!d && opt_use_safe_decompressor) + { + d = c->decompress_safe; + n = " [s]"; + } + if (!d && opt_use_asm_fast_decompressor) + { + d = c->decompress_asm_fast; + n = " [f]"; + } + if (!d && opt_use_asm_decompressor) + { + d = c->decompress_asm; + n = " [a]"; + } + if (!d) + { + d = c->decompress; + n = ""; + } + if (!d) + n = "(null)"; + + if (opt_dict && c->decompress_dict_safe) + n = ""; + + if (nn) + *nn = n; + return d; +} + + +static +const compress_t *find_method_by_id ( int method ) +{ + const compress_t *db; + size_t size = sizeof(compress_database) / sizeof(*(compress_database)); + size_t i; + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/find_id.ch" +#endif + + db = compress_database; + for (i = 0; i < size && db->name != NULL; i++, db++) + { + if (method == db->id) + return db; + } + return NULL; +} + + +static +const compress_t *find_method_by_name ( const char *name ) +{ + const compress_t *db; + size_t size = sizeof(compress_database) / sizeof(*(compress_database)); + size_t i; + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/find_name.ch" +#endif + + db = compress_database; + for (i = 0; i < size && db->name != NULL; i++, db++) + { + size_t n = strlen(db->name); + +#if defined(HAVE_STRNCASECMP) + if (strncasecmp(name,db->name,n) == 0 && (!name[n] || name[n] == ',')) + return db; +#else + if (strncmp(name,db->name,n) == 0 && (!name[n] || name[n] == ',')) + return db; +#endif + } + return NULL; +} + + +static +lzo_bool is_compressor ( const compress_t *c ) +{ + return (c->id <= M_LAST_COMPRESSOR || c->id >= 9721); +} + + +/************************************************************************* +// check that memory gets accessed within bounds +**************************************************************************/ + +void memchecker_init ( mblock_t *mb, lzo_xint l, unsigned char random_byte ) +{ + lzo_uint i; + lzo_uint len = (lzo_uint) l; + lzo_bytep p; + + assert(len <= mb->len); + + /* bottom */ + p = mb->ptr; + for (i = 0; i < 16 && p > mb->alloc_ptr; i++) + *--p = random_byte++; + /* top */ + p = mb->ptr + len; + for (i = 0; i < 16 && p < mb->alloc_ptr + mb->alloc_len; i++) + *p++ = random_byte++; +#if 0 || defined(LZO_DEBUG) + /* fill in garbage */ + p = mb->ptr; + random_byte |= 1; + for (i = 0; i < len; i++, random_byte += 2) + *p++ = random_byte; +#endif +} + + +int memchecker_check ( mblock_t *mb, lzo_xint l, unsigned char random_byte ) +{ + lzo_uint i; + lzo_uint len = (lzo_uint) l; + lzo_bytep p; + + assert(len <= mb->len); + + /* bottom */ + p = mb->ptr; + for (i = 0; i < 16 && p > mb->alloc_ptr; i++) + if (*--p != random_byte++) + return -1; + /* top */ + p = mb->ptr + len; + for (i = 0; i < 16 && p < mb->alloc_ptr + mb->alloc_len; i++) + if (*p++ != random_byte++) + return -1; + return 0; +} + + +/************************************************************************* +// compress a block +**************************************************************************/ + +static +int call_compressor ( const compress_t *c, + const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len ) +{ + int r = -100; + + if (c && c->compress && wrkmem.len >= c->mem_compress) + { + unsigned char random_byte = (unsigned char) src_len; + memchecker_init(&wrkmem, c->mem_compress, random_byte); + if (opt_clear_wrkmem) + lzo_memset(wrkmem.ptr, 0, c->mem_compress); + + if (opt_dict && c->compress_dict) + r = c->compress_dict(src,src_len,dst,dst_len,wrkmem.ptr,dict.ptr,dict.len); + else + r = c->compress(src,src_len,dst,dst_len,wrkmem.ptr); + + if (memchecker_check(&wrkmem, c->mem_compress, random_byte) != 0) + printf("WARNING: wrkmem overwrite error (compress) !!!\n"); + } + + if (r == 0 && opt_compute_adler32) + { + lzo_uint32 adler; + adler = lzo_adler32(0, NULL, 0); + adler = lzo_adler32(adler, src, src_len); + adler_in = adler; + } + if (r == 0 && opt_compute_crc32) + { + lzo_uint32 crc; + crc = lzo_crc32(0, NULL, 0); + crc = lzo_crc32(crc, src, src_len); + crc_in = crc; + } + + return r; +} + + +/************************************************************************* +// decompress a block +**************************************************************************/ + +static +int call_decompressor ( const compress_t *c, lzo_decompress_t d, + const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len ) +{ + int r = -100; + + if (c && d && wrkmem.len >= c->mem_decompress) + { + unsigned char random_byte = (unsigned char) src_len; + memchecker_init(&wrkmem, c->mem_decompress, random_byte); + if (opt_clear_wrkmem) + lzo_memset(wrkmem.ptr, 0, c->mem_decompress); + + if (opt_dict && c->decompress_dict_safe) + r = c->decompress_dict_safe(src,src_len,dst,dst_len,wrkmem.ptr,dict.ptr,dict.len); + else + r = d(src,src_len,dst,dst_len,wrkmem.ptr); + + if (memchecker_check(&wrkmem, c->mem_decompress, random_byte) != 0) + printf("WARNING: wrkmem overwrite error (decompress) !!!\n"); + } + + if (r == 0 && opt_compute_adler32) + adler_out = lzo_adler32(1, dst, *dst_len); + if (r == 0 && opt_compute_crc32) + crc_out = lzo_crc32(0, dst, *dst_len); + + return r; +} + + +/************************************************************************* +// optimize a block +**************************************************************************/ + +static +int call_optimizer ( const compress_t *c, + lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len ) +{ + if (c && c->optimize && wrkmem.len >= c->mem_decompress) + return c->optimize(src,src_len,dst,dst_len,wrkmem.ptr); + return 0; +} + + +/*********************************************************************** +// read a file +************************************************************************/ + +static int load_file(const char *file_name, lzo_uint max_len) +{ + FILE *fp; + long ll = -1; + lzo_uint l; + int r; + mblock_t *mb = &file_data; + + mb_free(mb); + + fp = fopen(file_name,"rb"); + if (fp == NULL) + { + fprintf(stderr,"%s: ",file_name); + perror("fopen"); + fflush(stderr); + return EXIT_FILE; + } + r = fseek(fp,(long)max_len,SEEK_SET); + if (r != 0) + r = fseek(fp,0,SEEK_END); + if (r == 0) + { + ll = ftell(fp); + r = fseek(fp,0,SEEK_SET); + } + if (r != 0 || ll < 0) + { + fprintf(stderr,"%s: ",file_name); + perror("fseek"); + fflush(stderr); + return EXIT_FILE; + } + + l = (lzo_uint) ll; + if (max_len > 0 && l > max_len) + l = max_len; + mb_alloc(mb, l); + mb->len = (lzo_uint) lzo_fread(fp, mb->ptr, mb->len); + if (fclose(fp) != 0) + { + mb_free(mb); + fprintf(stderr,"%s: ",file_name); + perror("fclose"); + fflush(stderr); + return EXIT_FILE; + } + + return EXIT_OK; +} + + +/*********************************************************************** +// print some compression statistics +************************************************************************/ + +static double t_div(double a, double b) +{ + return b > 0.00001 ? a / b : 0; +} + +static double set_perc_d(double perc, char *s) +{ + if (perc <= 0) { + strcpy(s, "0.0"); + return 0; + } + if (perc <= 100 - 1.0 / 16) { + sprintf(s, "%4.1f", perc); + } + else { + long p = (long) (perc + 0.5); + if (p < 100) + strcpy(s, "???"); + else if (p >= 9999) + strcpy(s, "9999"); + else + sprintf(s, "%ld", p); + } + return perc; +} + +static double set_perc(unsigned long c_len, unsigned long d_len, char *s) +{ + double perc = 0.0; + if (d_len > 0) + perc = c_len * 100.0 / d_len; + return set_perc_d(perc, s); +} + + +static +void print_stats ( const char *method_name, const char *file_name, + long t_loops, long c_loops, long d_loops, + double t_secs, double c_secs, double d_secs, + unsigned long c_len, unsigned long d_len, + unsigned long blocks ) +{ + unsigned long x_len = d_len; + unsigned long t_bytes, c_bytes, d_bytes; + double c_mbs, d_mbs, t_mbs; + double perc; + char perc_str[4+1]; + + perc = set_perc(c_len, d_len, perc_str); + + c_bytes = x_len * c_loops * t_loops; + d_bytes = x_len * d_loops * t_loops; + t_bytes = c_bytes + d_bytes; + + if (opt_uclock == 0) + c_secs = d_secs = t_secs = 0.0; + + /* speed in uncompressed megabytes per second (1 megabyte = 1.000.000 bytes) */ + c_mbs = (c_secs > 0.001) ? (c_bytes / c_secs) / 1000000.0 : 0; + d_mbs = (d_secs > 0.001) ? (d_bytes / d_secs) / 1000000.0 : 0; + t_mbs = (t_secs > 0.001) ? (t_bytes / t_secs) / 1000000.0 : 0; + + total_n++; + total_c_len += c_len; + total_d_len += d_len; + total_blocks += blocks; + total_perc += perc; + if (c_mbs > 0) { + total_c_mbs_n += 1; + total_c_mbs_harmonic += 1.0 / c_mbs; + total_c_mbs_sum += c_mbs; + } + if (d_mbs > 0) { + total_d_mbs_n += 1; + total_d_mbs_harmonic += 1.0 / d_mbs; + total_d_mbs_sum += d_mbs; + } + + if (opt_verbose >= 2) + { + printf(" compressed into %lu bytes, %s%% (%s%.3f bits/byte)\n", + c_len, perc_str, "", perc * 0.08); + +#if 0 + printf("%-15s %5ld: ","overall", t_loops); + printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n", + t_bytes, t_secs, t_mbs); +#else + LZO_UNUSED(t_mbs); +#endif + printf("%-15s %5ld: ","compress", c_loops); + printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n", + c_bytes, c_secs, c_mbs); + printf("%-15s %5ld: ","decompress", d_loops); + printf("%10lu bytes, %8.2f secs, %8.3f MB/sec\n", + d_bytes, d_secs, d_mbs); + printf("\n"); + } + + /* create a line for util/table.pl */ + if (opt_verbose >= 1) + { + /* get basename */ + const char *n, *nn, *b; + for (nn = n = b = file_name; *nn; nn++) + if (*nn == '/' || *nn == '\\' || *nn == ':') + b = nn + 1; + else + n = b; + + printf("%-13s| %-14s %8lu %4lu %9lu %4s %s%8.3f %8.3f |\n", + method_name, n, d_len, blocks, c_len, perc_str, "", c_mbs, d_mbs); + } + + if (opt_verbose >= 2) + printf("\n"); +} + + +static +void print_totals ( void ) +{ + char perc_str[4+1]; + + if ((opt_verbose >= 1 && total_n > 1) || (opt_totals >= 2)) + { + unsigned long n = total_n > 0 ? total_n : 1; + const char *t1 = "-------"; + const char *t2 = total_method_names == 1 ? total_method_name : ""; +#if 1 && defined(__ACCLIB_PCLOCK_CH_INCLUDED) + char uclock_mode[32+1]; + sprintf(uclock_mode, "[clock=%d]", uch.mode); + t1 = uclock_mode; + if (opt_uclock == 0) t1 = t2; +#endif + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/print_totals.ch" +#endif + +#if 1 + set_perc_d(total_perc / n, perc_str); + printf("%-13s %-12s %10lu %4.1f %9lu %4s %8.3f %8.3f\n", + t1, "***AVG***", + total_d_len / n, total_blocks * 1.0 / n, total_c_len / n, perc_str, + t_div(total_c_mbs_n, total_c_mbs_harmonic), + t_div(total_d_mbs_n, total_d_mbs_harmonic)); +#endif + set_perc(total_c_len, total_d_len, perc_str); + printf("%-13s %-12s %10lu %4lu %9lu %4s %s%8.3f %8.3f\n", + t2, "***TOTALS***", + total_d_len, total_blocks, total_c_len, perc_str, "", + t_div(total_c_mbs_n, total_c_mbs_harmonic), + t_div(total_d_mbs_n, total_d_mbs_harmonic)); + } +} + + +/************************************************************************* +// compress and decompress a file +**************************************************************************/ + +static +int process_file ( const compress_t *c, lzo_decompress_t decompress, + const char *method_name, + const char *file_name, + long t_loops, long c_loops, long d_loops ) +{ + long t_i; + unsigned long blocks = 0; + unsigned long compressed_len = 0; + double t_time = 0, c_time = 0, d_time = 0; + lzo_uclock_t t_start, t_stop, x_start, x_stop; + FILE *fp_dump = NULL; + + if (opt_dump_compressed_data) + fp_dump = fopen(opt_dump_compressed_data,"wb"); + +/* process the file */ + + lzo_uclock_flush_cpu_cache(&uch, 0); + lzo_uclock_read(&uch, &t_start); + for (t_i = 0; t_i < t_loops; t_i++) + { + lzo_uint len, c_len, c_len_max, d_len = 0; + const lzo_bytep d = file_data.ptr; + + len = file_data.len; + c_len = 0; + blocks = 0; + + /* process blocks */ + if (len > 0 || opt_try_to_compress_0_bytes) do + { + lzo_uint bl; + long c_i; + int r; + unsigned char random_byte = (unsigned char) file_data.len; +#if 1 && defined(CLOCKS_PER_SEC) + random_byte ^= (unsigned char) clock(); +#endif + blocks++; + + bl = len > opt_block_size ? opt_block_size : len; + /* update lengths for memchecker_xxx() */ + block1.len = bl + get_max_compression_expansion(c->id, bl); + block2.len = bl + get_max_decompression_overrun(c->id, bl); +#if defined(__LZO_CHECKER) + /* malloc a block of the exact size to detect any overrun */ + assert(block1.alloc_ptr == NULL); + assert(block2.alloc_ptr == NULL); + mb_alloc(&block1, block1.len); + mb_alloc(&block2, block2.len); +#endif + assert(block1.len <= block1.saved_len); + assert(block2.len <= block2.saved_len); + + memchecker_init(&block1, block1.len, random_byte); + memchecker_init(&block2, block2.len, random_byte); + + /* compress the block */ + c_len = c_len_max = 0; + lzo_uclock_flush_cpu_cache(&uch, 0); + lzo_uclock_read(&uch, &x_start); + for (r = 0, c_i = 0; r == 0 && c_i < c_loops; c_i++) + { + c_len = block1.len; + r = call_compressor(c, d, bl, block1.ptr, &c_len); + if (r == 0 && c_len > c_len_max) + c_len_max = c_len; + if (r == 0 && c_len > block1.len) + goto compress_overrun; + } + lzo_uclock_read(&uch, &x_stop); + c_time += lzo_uclock_get_elapsed(&uch, &x_start, &x_stop); + if (r != 0) + { + printf(" compression failed in block %ld (%d) (%lu %lu)\n", + blocks, r, (long)c_len, (long)bl); + return EXIT_LZO_ERROR; + } + if (memchecker_check(&block1, block1.len, random_byte) != 0) + { +compress_overrun: + printf(" compression overwrite error in block %lu " + "(%lu %lu %lu %lu)\n", + blocks, (long)c_len, (long)d_len, (long)bl, (long)block1.len); + return EXIT_LZO_ERROR; + } + + /* optimize the compressed block */ + if (c_len < bl && opt_optimize_compressed_data) + { + d_len = bl; + r = call_optimizer(c, block1.ptr, c_len, block2.ptr, &d_len); + if (r != 0 || d_len != bl) + { + printf(" optimization failed in block %lu (%d) " + "(%lu %lu %lu)\n", blocks, r, + (long)c_len, (long)d_len, (long)bl); + return EXIT_LZO_ERROR; + } + if (memchecker_check(&block1, block1.len, random_byte) != 0 || + memchecker_check(&block2, block2.len, random_byte) != 0) + { + printf(" optimize overwrite error in block %lu " + "(%lu %lu %lu %lu)\n", + blocks, (long)c_len, (long)d_len, (long)bl, (long)block1.len); + return EXIT_LZO_ERROR; + } + } + + /* dump compressed data to disk */ + if (fp_dump) + { + (void) lzo_fwrite(fp_dump, block1.ptr, c_len); + fflush(fp_dump); + } + + /* decompress the block and verify */ + lzo_uclock_flush_cpu_cache(&uch, 0); + lzo_uclock_read(&uch, &x_start); + for (r = 0, c_i = 0; r == 0 && c_i < d_loops; c_i++) + { + d_len = bl; + r = call_decompressor(c, decompress, block1.ptr, c_len, block2.ptr, &d_len); + if (d_len != bl) + break; + } + lzo_uclock_read(&uch, &x_stop); + d_time += lzo_uclock_get_elapsed(&uch, &x_start, &x_stop); + if (r != 0) + { + printf(" decompression failed in block %lu (%d) " + "(%lu %lu %lu)\n", blocks, r, + (long)c_len, (long)d_len, (long)bl); + return EXIT_LZO_ERROR; + } + if (d_len != bl) + { + printf(" decompression size error in block %lu (%lu %lu %lu)\n", + blocks, (long)c_len, (long)d_len, (long)bl); + return EXIT_LZO_ERROR; + } + if (is_compressor(c)) + { + if (lzo_memcmp(d, block2.ptr, bl) != 0) + { + lzo_uint x = 0; + while (x < bl && block2.ptr[x] == d[x]) + x++; + printf(" decompression data error in block %lu at offset " + "%lu (%lu %lu)\n", blocks, (long)x, + (long)c_len, (long)d_len); + if (opt_compute_adler32) + printf(" checksum: 0x%08lx 0x%08lx\n", + (long)adler_in, (long)adler_out); +#if 0 + printf("Orig: "); + r = (x >= 10) ? -10 : 0 - (int) x; + for (j = r; j <= 10 && x + j < bl; j++) + printf(" %02x", (int)d[x+j]); + printf("\nDecomp:"); + for (j = r; j <= 10 && x + j < bl; j++) + printf(" %02x", (int)block2.ptr[x+j]); + printf("\n"); +#endif + return EXIT_LZO_ERROR; + } + if ((opt_compute_adler32 && adler_in != adler_out) || + (opt_compute_crc32 && crc_in != crc_out)) + { + printf(" checksum error in block %lu (%lu %lu)\n", + blocks, (long)c_len, (long)d_len); + printf(" adler32: 0x%08lx 0x%08lx\n", + (long)adler_in, (long)adler_out); + printf(" crc32: 0x%08lx 0x%08lx\n", + (long)crc_in, (long)crc_out); + return EXIT_LZO_ERROR; + } + } + + if (memchecker_check(&block2, block2.len, random_byte) != 0) + { + printf(" decompression overwrite error in block %lu " + "(%lu %lu %lu %lu)\n", + blocks, (long)c_len, (long)d_len, (long)bl, (long)block2.len); + return EXIT_LZO_ERROR; + } + +#if defined(__LZO_CHECKER) + /* free in reverse order of allocations */ + mb_free(&block2); + mb_free(&block1); +#endif + + d += bl; + len -= bl; + compressed_len += (unsigned long) c_len_max; + } + while (len > 0); + } + lzo_uclock_read(&uch, &t_stop); + t_time += lzo_uclock_get_elapsed(&uch, &t_start, &t_stop); + + if (fp_dump) + fclose(fp_dump); + opt_dump_compressed_data = NULL; /* only dump the first file */ + + print_stats(method_name, file_name, + t_loops, c_loops, d_loops, + t_time, c_time, d_time, + compressed_len, (unsigned long) file_data.len, blocks); + if (total_method_name != c->name) { + total_method_name = c->name; + total_method_names += 1; + } + + return EXIT_OK; +} + + + +static +int do_file ( int method, const char *file_name, + long c_loops, long d_loops, + lzo_uint32p p_adler, lzo_uint32p p_crc ) +{ + int r; + const compress_t *c; + lzo_decompress_t decompress; + lzo_uint32 adler, crc; + char method_name[256+1]; + const char *n; + const long t_loops = 1; + + adler_in = adler_out = 0; + crc_in = crc_out = 0; + if (p_adler) + *p_adler = 0; + if (p_crc) + *p_crc = 0; + + c = find_method_by_id(method); + if (c == NULL || c->name == NULL || c->compress == NULL) + return EXIT_INTERNAL; + decompress = get_decomp_info(c,&n); + if (!decompress || n == NULL || wrkmem.len < c->mem_decompress) + return EXIT_INTERNAL; + strcpy(method_name,c->name); + strcat(method_name,n); + + if (c_loops < 1) c_loops = 1; + if (d_loops < 1) d_loops = 1; + + fflush(stdout); fflush(stderr); + + /* read the whole file */ + r = load_file(file_name, opt_max_data_len); + if (r != 0) + return r; + + /* compute some checksums */ + adler = lzo_adler32(0, NULL, 0); + adler = lzo_adler32(adler, file_data.ptr, file_data.len); + if (p_adler) + *p_adler = adler; + crc = lzo_crc32(0, NULL, 0); + crc = lzo_crc32(crc, file_data.ptr, file_data.len); + if (p_crc) + *p_crc = crc; + + if (opt_verbose >= 2) + { + printf("File %s: %lu bytes (0x%08lx, 0x%08lx)\n", + file_name, (long) file_data.len, (long) adler, (long) crc); + printf(" compressing %lu bytes (%ld/%ld/%ld loops, %lu block-size)\n", + (long) file_data.len, t_loops, c_loops, d_loops, (long) opt_block_size); + printf(" %s\n", method_name); + } + + r = process_file(c, decompress, method_name, file_name, + t_loops, c_loops, d_loops); + + return r; +} + + +/************************************************************************* +// Calgary Corpus and Silesia Corpus test suite driver +**************************************************************************/ + +struct corpus_entry_t +{ + const char *name; + long loops; + lzo_uint32 adler; + lzo_uint32 crc; +}; + +static const struct corpus_entry_t calgary_corpus[] = +{ + { "bib", 8, 0x4bd09e98L, 0xb856ebe8L }, + { "book1", 1, 0xd4d3613eL, 0x24e19972L }, + { "book2", 1, 0x6fe14cc3L, 0xba0f3f26L }, + { "geo", 6, 0xf3cc5be0L, 0x4d3a6ed0L }, + { "news", 2, 0x2ed405b8L, 0xcafac853L }, + { "obj1", 35, 0x3887dd2cL, 0xc7b0cd26L }, + { "obj2", 4, 0xf89407c4L, 0x3ae33007L }, + { "paper1", 17, 0xfe65ce62L, 0x2b6baca0L }, + { "paper2", 11, 0x1238b7c2L, 0xf76cba72L }, + { "pic", 4, 0xf61a5702L, 0x4b17e59cL }, + { "progc", 25, 0x4c00ba45L, 0x6fb16094L }, + { "progl", 20, 0x4cba738eL, 0xddbf6baaL }, + { "progp", 28, 0x7495b92bL, 0x493a1809L }, + { "trans", 15, 0x52a2cec8L, 0xcdec06a6L }, + { NULL, 0, 0x00000000L, 0x00000000L } +}; + +static const struct corpus_entry_t silesia_corpus[] = +{ + { "dickens", 1, 0x170f606fL, 0xaf3a6b76L }, + { "mozilla", 1, 0x1188dd4eL, 0x7fb0ab7dL }, + { "mr", 1, 0xaea14b97L, 0xa341883fL }, + { "nci", 1, 0x0af16f1fL, 0x60ff63d3L }, + { "ooffice", 1, 0x83c8f689L, 0xa023e1faL }, + { "osdb", 1, 0xb825b790L, 0xa0ca388cL }, + { "reymont", 1, 0xce5c82caL, 0x50d35f03L }, + { "samba", 1, 0x19dbb9f5L, 0x2beac5f3L }, + { "sao", 1, 0x7edfc4a9L, 0xfda125bfL }, + { "webster", 1, 0xf2962fc6L, 0x01f5a2e9L }, + { "xml", 1, 0xeccd03d6L, 0xff8f3051L }, + { "x-ray", 1, 0xc95435a0L, 0xc86a35c6L }, + { NULL, 0, 0x00000000L, 0x00000000L } +}; + + +static +int do_corpus ( const struct corpus_entry_t *corpus, int method, const char *path, + long c_loops, long d_loops ) +{ + size_t i, n; + char name[256]; + + if (path == NULL || strlen(path) >= sizeof(name) - 12) + return EXIT_USAGE; + + strcpy(name,path); + n = strlen(name); + if (n > 0 && name[n-1] != '/' && name[n-1] != '\\' && name[n-1] != ':') + { + strcat(name,"/"); + n++; + } + + for (i = 0; corpus[i].name != NULL; i++) + { + lzo_uint32 adler, crc; + long c = c_loops * corpus[i].loops; + long d = d_loops * corpus[i].loops; + int r; + + strcpy(name+n,corpus[i].name); + r = do_file(method, name, c, d, &adler, &crc); + if (r != 0) + return r; + if (adler != corpus[i].adler) + { + printf(" invalid test suite\n"); + return EXIT_ADLER; + } + if (corpus[i].crc && crc != corpus[i].crc) + { + printf(" internal checksum error !! (0x%08lx 0x%08lx)\n", + (long) crc, (long) corpus[i].crc); + return EXIT_INTERNAL; + } + } + return EXIT_OK; +} + + +/************************************************************************* +// usage +**************************************************************************/ + +static +void usage ( const char *name, int exit_code, lzo_bool show_methods ) +{ + FILE *f; + int i; + + f = stdout; + + fflush(stdout); fflush(stderr); + + fprintf(f,"Usage: %s [option..] file...\n", name); + fprintf(f,"\n"); + fprintf(f,"Options:\n"); + fprintf(f," -m# compression method\n"); + fprintf(f," -b# set input block size (default %ld, max %ld)\n", + (long) opt_block_size, (long) opt_max_data_len); + fprintf(f," -n# number of compression/decompression runs\n"); + fprintf(f," -c# number of compression runs\n"); + fprintf(f," -d# number of decompression runs\n"); + fprintf(f," -S use safe decompressor (if available)\n"); + fprintf(f," -A use assembler decompressor (if available)\n"); + fprintf(f," -F use fast assembler decompressor (if available)\n"); + fprintf(f," -O optimize compressed data (if available)\n"); + fprintf(f," -s DIR process Calgary Corpus test suite in directory `DIR'\n"); + fprintf(f," -@ read list of files to compress from stdin\n"); + fprintf(f," -q be quiet\n"); + fprintf(f," -Q be very quiet\n"); + fprintf(f," -v be verbose\n"); + fprintf(f," -L display software license\n"); + + if (show_methods) + { +#if defined(__ACCLIB_PCLOCK_CH_INCLUDED) + lzo_uclock_t t_dummy; + lzo_uclock_read(&uch, &t_dummy); + (void) lzo_uclock_get_elapsed(&uch, &t_dummy, &t_dummy); + fprintf(f,"\nAll timings are recorded using uclock mode %d %s.\n", uch.mode, uch.name); +#endif + fprintf(f,"\n\n"); + fprintf(f,"The following compression methods are available:\n"); + fprintf(f,"\n"); + fprintf(f," usage name memory available extras\n"); + fprintf(f," ----- ---- ------ ----------------\n"); + + for (i = 0; i <= M_LAST_COMPRESSOR; i++) + { + const compress_t *c; + c = find_method_by_id(i); + if (c) + { + char n[16]; + static const char * const s[3] = {" ", ", ", ""}; + int j = 0; + unsigned long m = c->mem_compress; + + sprintf(n,"-m%d",i); + fprintf(f," %-6s %-13s",n,c->name); +#if 1 + fprintf(f,"%9ld", m); +#else + m = (m + 1023) / 1024; + fprintf(f,"%6ld kB", m); +#endif + + if (c->decompress_safe) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "safe"); + if (c->decompress_asm) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "asm"); + if (c->decompress_asm_safe) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "asm+safe"); + if (c->decompress_asm_fast) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "fastasm"); + if (c->decompress_asm_fast_safe) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "fastasm+safe"); + if (c->optimize) + fprintf(f, "%s%s", j++ == 0 ? s[0] : s[1], "optimize"); + if (j > 0) + fprintf(f, s[2]); + fprintf(f,"\n"); + } + } + } + else + { + fprintf(f,"\n"); + fprintf(f,"Type '%s -m' to list all available methods.\n", name); + } + + fflush(f); + if (exit_code < 0) + exit_code = EXIT_USAGE; + exit(exit_code); +} + + +static +void license(void) +{ + FILE *f; + + f = stdout; + + fflush(stdout); fflush(stderr); + +#if defined(__LZO_PROFESSIONAL__) +# include "lzopro/license.ch" +#else +fprintf(f, +" The LZO library is free software; you can redistribute it and/or\n" +" modify it under the terms of the GNU General Public License as\n" +" published by the Free Software Foundation; either version 2 of\n" +" the License, or (at your option) any later version.\n" +"\n" +" The LZO library is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" + ); +fprintf(f, +"\n" +" You should have received a copy of the GNU General Public License\n" +" along with the LZO library; see the file COPYING.\n" +" If not, write to the Free Software Foundation, Inc.,\n" +" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n" +"\n" +" Markus F.X.J. Oberhumer\n" +" \n" +" http://www.oberhumer.com/opensource/lzo/\n" +"\n" + ); +#endif + + fflush(f); + exit(EXIT_OK); +} + + +/************************************************************************* +// parse method option '-m' +**************************************************************************/ + +static int methods[256+1]; +static int methods_n = 0; + +static void add_method(int m) +{ + int i; + + if (m > 0) + { + if (!find_method_by_id(m)) { + fprintf(stdout,"%s: invalid method %d\n",progname,m); + exit(EXIT_USAGE); + } + + for (i = 0; i < methods_n; i++) + if (methods[i] == m) + return; + + if (methods_n >= 256) + { + fprintf(stderr,"%s: too many methods\n",progname); + exit(EXIT_USAGE); + } + + methods[methods_n++] = m; + methods[methods_n] = 0; + } +} + + +static void add_methods(const int *ml) +{ + while (*ml != 0) + add_method(*ml++); +} + + +static void add_all_methods(int first, int last) +{ + int m; + + for (m = first; m <= last; m++) + if (find_method_by_id(m) != NULL) + add_method(m); +} + + +static int m_strcmp(const char *a, const char *b) +{ + size_t n; + + if (a[0] == 0 || b[0] == 0) + return 1; + n = strlen(b); + if (strncmp(a,b,n) == 0 && (a[n] == 0 || a[n] == ',')) + return 0; + return 1; +} + + +static lzo_bool m_strisdigit(const char *s) +{ + for (;;) + { + if (!is_digit(*s)) + return 0; + s++; + if (*s == 0 || *s == ',') + return 1; + } +} + + +static void parse_methods(const char *p) +{ + const compress_t *c; + + for (;;) + { + if (p == NULL || p[0] == 0) + usage(progname,-1,1); + else if ((c = find_method_by_name(p)) != NULL) + add_method(c->id); + else if (m_strcmp(p,"all") == 0 || m_strcmp(p,"avail") == 0) + add_all_methods(1,M_LAST_COMPRESSOR); + else if (m_strcmp(p,"ALL") == 0) + { + add_all_methods(1,M_LAST_COMPRESSOR); + add_all_methods(9721,9729); + add_all_methods(9781,9789); + } + else if (m_strcmp(p,"lzo") == 0) + add_all_methods(1,M_MEMCPY); + else if (m_strcmp(p,"bench") == 0) + add_methods(benchmark_methods); + else if (m_strcmp(p,"m1") == 0) + add_methods(x1_methods); + else if (m_strcmp(p,"m99") == 0) + add_methods(x99_methods); + else if (m_strcmp(p,"m999") == 0) + add_methods(x999_methods); + else if (m_strcmp(p,"1x999") == 0) + add_all_methods(9721,9729); + else if (m_strcmp(p,"1y999") == 0) + add_all_methods(9821,9829); +#if defined(ALG_ZLIB) + else if (m_strcmp(p,"zlib") == 0) + add_all_methods(M_ZLIB_8_1,M_ZLIB_8_9); +#endif +#if defined(ALG_BZIP2) + else if (m_strcmp(p,"bzip2") == 0) + add_all_methods(M_BZIP2_1,M_BZIP2_9); +#endif +#if defined(__LZO_PROFESSIONAL__) +# include "lzopro/t_opt_m.ch" +#endif + else if (m_strisdigit(p)) + add_method(atoi(p)); + else + { + printf("%s: invalid method '%s'\n\n",progname,p); + exit(EXIT_USAGE); + } + + while (*p && *p != ',') + p++; + while (*p == ',') + p++; + if (*p == 0) + return; + } +} + + +/************************************************************************* +// options +**************************************************************************/ + +enum { + OPT_LONGOPT_ONLY = 512, + OPT_ADLER32, + OPT_CALGARY_CORPUS, + OPT_CLEAR_WRKMEM, + OPT_CRC32, + OPT_DICT, + OPT_DUMP, + OPT_EXECUTION_TIME, + OPT_MAX_DATA_LEN, + OPT_MAX_DICT_LEN, + OPT_SILESIA_CORPUS, + OPT_UCLOCK, +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/o_enum.ch" +#endif + OPT_UNUSED +}; + +static const struct mfx_option longopts[] = +{ + /* { name has_arg *flag val } */ + {"help", 0, 0, 'h'+256}, /* give help */ + {"license", 0, 0, 'L'}, /* display software license */ + {"quiet", 0, 0, 'q'}, /* quiet mode */ + {"verbose", 0, 0, 'v'}, /* verbose mode */ + {"version", 0, 0, 'V'+256}, /* display version number */ + + {"adler32", 0, 0, OPT_ADLER32}, + {"calgary-corpus", 1, 0, OPT_CALGARY_CORPUS}, + {"clear-wrkmem", 0, 0, OPT_CLEAR_WRKMEM}, + {"clock", 1, 0, OPT_UCLOCK}, + {"corpus", 1, 0, OPT_CALGARY_CORPUS}, + {"crc32", 0, 0, OPT_CRC32}, + {"dict", 1, 0, OPT_DICT}, + {"dump-compressed", 1, 0, OPT_DUMP}, + {"execution-time", 0, 0, OPT_EXECUTION_TIME}, + {"max-data-length", 1, 0, OPT_MAX_DATA_LEN}, + {"max-dict-length", 1, 0, OPT_MAX_DICT_LEN}, + {"silesia-corpus", 1, 0, OPT_SILESIA_CORPUS}, + {"uclock", 1, 0, OPT_UCLOCK}, + {"methods", 1, 0, 'm'}, + {"totals", 0, 0, 'T'}, +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/o_longopts.ch" +#endif + + { 0, 0, 0, 0 } +}; + + +static int do_option(int optc) +{ + switch (optc) + { + case 'A': + opt_use_asm_decompressor = 1; + break; + case 'b': + opt_block_size = 0; /* set to opt_max_data_len later */ + if (mfx_optarg) + { + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_block_size = atol(mfx_optarg); + } + break; + case 'c': + case 'C': + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_c_loops = atol(mfx_optarg); + break; + case 'd': + case 'D': + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_d_loops = atol(mfx_optarg); + break; + case 'F': + opt_use_asm_fast_decompressor = 1; + break; + case 'h': + case 'H': + case '?': + case 'h'+256: + usage(progname,EXIT_OK,0); + break; + case 'L': + license(); + break; + case 'm': + parse_methods(mfx_optarg); + break; + case 'n': + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_c_loops = opt_d_loops = atol(mfx_optarg); + break; + case 'O': + opt_optimize_compressed_data = 1; + break; + case 'q': + opt_verbose -= 1; + break; + case 'Q': + opt_verbose = 0; + break; + case 's': + case OPT_CALGARY_CORPUS: + if (!mfx_optarg || !mfx_optarg[0]) + return optc; + opt_corpus_path = mfx_optarg; + opt_corpus = calgary_corpus; + break; + case OPT_SILESIA_CORPUS: + if (!mfx_optarg || !mfx_optarg[0]) + return optc; + opt_corpus_path = mfx_optarg; + opt_corpus = silesia_corpus; + break; + case 'S': + opt_use_safe_decompressor = 1; + break; + case 'T': + opt_totals += 1; + break; + case 'v': + opt_verbose += 1; + break; + case 'V': + case 'V'+256: + exit(EXIT_OK); + break; + case '@': + opt_read_from_stdin = 1; + break; + + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + /* this is a dirty hack... */ + parse_methods(nextchar-1); + if (nextchar[0]) + { + nextchar = NULL; + mfx_optind++; + } + break; + + case OPT_ADLER32: + opt_compute_adler32 = 1; + break; + case OPT_CLEAR_WRKMEM: + opt_clear_wrkmem = 1; + break; + case OPT_CRC32: + opt_compute_crc32 = 1; + break; + case OPT_DICT: + opt_dict = 1; + opt_dictionary_file = mfx_optarg; + break; + case OPT_EXECUTION_TIME: + opt_execution_time = 1; + break; + case OPT_DUMP: + opt_dump_compressed_data = mfx_optarg; + break; + case OPT_MAX_DATA_LEN: + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_max_data_len = atol(mfx_optarg); + break; + case OPT_MAX_DICT_LEN: + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_max_dict_len = atol(mfx_optarg); + break; + case OPT_UCLOCK: + if (!mfx_optarg || !is_digit(mfx_optarg[0])) + return optc; + opt_uclock = atoi(mfx_optarg); +#if defined(__ACCLIB_PCLOCK_CH_INCLUDED) + if (opt_uclock > 0) + uch.mode = opt_uclock; +#endif + break; + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/o_do_option.ch" +#endif + + case '\0': + return -1; + case ':': + return -2; + default: + fprintf(stderr,"%s: internal error in getopt (%d)\n",progname,optc); + return -3; + } + return 0; +} + + +static int get_options(int argc, char **argv) +{ + int optc; + + mfx_optind = 0; + mfx_opterr = 1; + while ((optc = mfx_getopt_long (argc, argv, + "Ab::c:C:d:D:FhHLm::n:OqQs:STvV@123456789" +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/o_shortopts.ch" +#endif + , longopts, (int *)0)) >= 0) + { + if (do_option(optc) != 0) + exit(EXIT_USAGE); + } + + return mfx_optind; +} + + +/************************************************************************* +// main +**************************************************************************/ + +int __lzo_cdecl_main main(int argc, char *argv[]) +{ + int r = EXIT_OK; + int i, ii; + int m; + time_t t_total; + const char *s; + + lzo_wildargv(&argc, &argv); + lzo_uclock_open(&uch); + + progname = argv[0]; + for (s = progname; *s; s++) + if ((*s == '/' || *s == '\\') && s[1]) + progname = s + 1; + +#if defined(__LZO_PROFESSIONAL__) + printf("\nLZO Professional real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); +#elif defined(LZOTEST_USE_DYNLOAD) +# include "dynload/init.ch" +#else + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); +#endif + + +/* + * Step 1: initialize the LZO library + */ + + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + exit(1); + } + + +/* + * Step 2: setup default options + */ + + opt_max_data_len = 64 * 1024L * 1024L; + opt_block_size = 256 * 1024L; + +#if defined(LZO_ARCH_I086) && defined(ACC_MM_AHSHIFT) +# if 1 && defined(LZO_ARCH_I086PM) && defined(BLX286) + opt_max_data_len = 32 * 1024L * 1024L; +# else + opt_max_data_len = 14 * 1024L * 1024L; +# endif + /* reduce memory requirements for ancient 16-bit DOS 640kB real-mode */ + if (ACC_MM_AHSHIFT != 3) { + opt_max_data_len = 16 * 1024L; + } +#elif defined(LZO_OS_TOS) + /* reduce memory requirements for 14 MB machines */ + opt_max_data_len = 8 * 1024L * 1024L; +#endif + + + +/* + * Step 3: parse options + */ + + if (argc < 2) + usage(progname,-1,0); + i = get_options(argc,argv); + + if (methods_n == 0) + add_method(default_method); + if (methods_n > 1 && opt_read_from_stdin) + { + printf("%s: cannot use multiple methods and '-@'\n", progname); + exit(EXIT_USAGE); + } + + if (opt_block_size == 0) + opt_block_size = opt_max_data_len; + if (opt_block_size > opt_max_data_len) + opt_block_size = opt_max_data_len; + + if (opt_c_loops < 1) + opt_c_loops = 1; + if (opt_d_loops < 1) + opt_d_loops = 1; + + +/* + * Step 4: start work + */ + + wrkmem.len = 0; + for (ii = 0; ii < methods_n; ii++) { + const compress_t *c = find_method_by_id(methods[ii]); + assert(c != NULL); + if (c->mem_compress > wrkmem.len) + wrkmem.len = c->mem_compress; + if (c->mem_decompress > wrkmem.len) + wrkmem.len = c->mem_decompress; + } + + mb_alloc(&wrkmem, wrkmem.len); + +#if !defined(__LZO_CHECKER) + mb_alloc_extra(&block1, opt_block_size + get_max_compression_expansion(-1, opt_block_size), 16, 16); + mb_alloc_extra(&block2, opt_block_size + get_max_decompression_overrun(-1, opt_block_size), 16, 16); +#endif + + if (opt_dict) + { + opt_optimize_compressed_data = 0; + dict_alloc(opt_max_dict_len); + if (opt_dictionary_file) + { + dict_load(opt_dictionary_file); + if (dict.len > 0) + printf("Using dictionary '%s', %ld bytes, ID 0x%08lx.\n", + opt_dictionary_file, + (long) dict.len, (long) dict.adler); + } + if (dict.len == 0) + { + dict_set_default(); + printf("Using default dictionary, %ld bytes, ID 0x%08lx.\n", + (long) dict.len, (long) dict.adler); + } + } + + t_total = time(NULL); + ii = i; + for (m = 0; m < methods_n && r == EXIT_OK; m++) + { + int method = methods[m]; + + i = ii; + if (i >= argc && opt_corpus_path == NULL && !opt_read_from_stdin) + usage(progname,-1,0); + if (m == 0 && opt_verbose >= 1) + printf("%lu block-size\n\n", (long) opt_block_size); + + assert(find_method_by_id(method) != NULL); + + if (opt_corpus_path != NULL) + r = do_corpus(opt_corpus, method, opt_corpus_path, + opt_c_loops, opt_d_loops); + else + { + for ( ; i < argc && r == EXIT_OK; i++) + { + r = do_file(method,argv[i],opt_c_loops,opt_d_loops,NULL,NULL); + if (r == EXIT_FILE) /* ignore file errors */ + r = EXIT_OK; + } + if (opt_read_from_stdin) + { + char buf[512], *p; + + while (r == EXIT_OK && fgets(buf,sizeof(buf)-1,stdin) != NULL) + { + buf[sizeof(buf)-1] = 0; + p = buf + strlen(buf); + while (p > buf && is_space(p[-1])) + *--p = 0; + p = buf; + while (*p && is_space(*p)) + p++; + if (*p) + r = do_file(method,p,opt_c_loops,opt_d_loops,NULL,NULL); + if (r == EXIT_FILE) /* ignore file errors */ + r = EXIT_OK; + } + opt_read_from_stdin = 0; + } + } + } + +#if defined(LZOTEST_USE_DYNLOAD) +# include "dynload/exit.ch" +#endif + t_total = time(NULL) - t_total; + + if (opt_totals) + print_totals(); + if (opt_execution_time || (methods_n > 1 && opt_verbose >= 1)) + printf("\n%s: execution time: %lu seconds\n", progname, (long) t_total); + if (r != EXIT_OK) + printf("\n%s: exit code: %d\n", progname, r); + + lzo_uclock_close(&uch); + return r; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/lzotest/mygetopt.ch b/thirdparty/lzo/2.03/lzotest/mygetopt.ch new file mode 100644 index 0000000..af4d282 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/mygetopt.ch @@ -0,0 +1,698 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#ifndef EOF +#include +#include +#endif + + +#undef PROGNAME +#define PROGNAME(x) (x) + + +/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a + long-named option. Because this is not POSIX.2 compliant, it is + being phased out. */ +/* #define GETOPT_COMPAT */ +#undef GETOPT_COMPAT + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "mygetopt.h" +#define option mfx_option +#define optarg mfx_optarg +#define optind mfx_optind +#define opterr mfx_opterr +#define optopt mfx_optopt +#undef BAD_OPTION + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = NULL; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +#define BAD_OPTION '\0' +int optopt = BAD_OPTION; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. + + To perform the swap, we first reverse the order of all elements. So + all options now come before all non options, but they are in the + wrong order. So we put back the options and non options in original + order by reversing them again. For example: + original input: a b c -x -y + reverse all: -y -x c b a + reverse options: -x -y c b a + reverse non options: -x -y a b c +*/ + + +static void exchange (char **argv) +{ + char *temp; char **first, **last; + + /* Reverse all the elements [first_nonopt, optind) */ + first = &argv[first_nonopt]; + last = &argv[optind-1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } + /* Put back the options in order */ + first = &argv[first_nonopt]; + first_nonopt += (optind - last_nonopt); + last = &argv[first_nonopt - 1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } + + /* Put back the non options in order */ + first = &argv[first_nonopt]; + last_nonopt = optind; + last = &argv[last_nonopt-1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return BAD_OPTION after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return BAD_OPTION. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +static int _getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only) +{ + static char empty_string[1]; + int option_index; + + if (longind != NULL) + *longind = -1; + + optarg = 0; + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (optind == 0) + { + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } +#if 0 + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; +#endif + else + ordering = PERMUTE; + } + + if (nextchar == NULL || *nextchar == '\0') + { + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange (argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Now skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + optind++; + last_nonopt = optind; + } + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange (argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + if (longopts != NULL + && ((argv[optind][0] == '-' + && (argv[optind][1] == '-' || long_only)) +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + )) + { + const struct option *p; + char *s = nextchar; + int exact = 0; + int ambig = 0; + const struct option *pfound = NULL; + int indfound = 0; + int needexact = 0; + + /* allow `--option#value' because you cannout assign a '=' + to an environment variable under DOS command.com */ + while (*s && *s != '=' && * s != '#') + s++; + + /* Test all options for either exact match or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; + p++, option_index++) + if (!strncmp (p->name, nextchar, (unsigned) (s - nextchar))) + { + if (p->has_arg & 0x10) + needexact = 1; + if ((unsigned) (s - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second nonexact match found. */ + ambig = 1; + } + + /* don't allow nonexact longoptions */ + if (needexact && !exact) + { + if (opterr) + fprintf (stderr, "%s: unrecognized option `%s'\n", + PROGNAME(argv[0]), argv[optind]); + nextchar += strlen (nextchar); + optind++; + return BAD_OPTION; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + PROGNAME(argv[0]), argv[optind]); + nextchar += strlen (nextchar); + optind++; + return BAD_OPTION; + } + + if (pfound != NULL) + { + int have_arg = (s[0] != '\0'); + if (have_arg && (pfound->has_arg & 0xf)) + have_arg = (s[1] != '\0'); + option_index = indfound; + optind++; + if (have_arg) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg & 0xf) + optarg = s + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + PROGNAME(argv[0]), pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + PROGNAME(argv[0]), argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return BAD_OPTION; + } + } + else if ((pfound->has_arg & 0xf) == 1) + { +#if 0 + if (optind < argc) +#else + if (optind < argc && (pfound->has_arg & 0x20) == 0) +#endif + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `--%s%s' requires an argument\n", + PROGNAME(argv[0]), pfound->name, + (pfound->has_arg & 0x20) ? "=" : ""); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : BAD_OPTION; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + || strchr (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + PROGNAME(argv[0]), nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + PROGNAME(argv[0]), argv[optind][0], nextchar); + } + nextchar = empty_string; + optind++; + return BAD_OPTION; + } + (void) &ambig; /* UNUSED */ + } + + /* Look at and handle the next option-character. */ + + { + char c = *nextchar++; + const char *temp = strchr (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { +#if 0 + if (c < 040 || c >= 0177) + fprintf (stderr, "%s: unrecognized option, character code 0%o\n", + PROGNAME(argv[0]), c); + else + fprintf (stderr, "%s: unrecognized option `-%c'\n", PROGNAME(argv[0]), c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", PROGNAME(argv[0]), c); +#endif + } + optopt = c; + return BAD_OPTION; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = 0; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { +#if 0 + fprintf (stderr, "%s: option `-%c' requires an argument\n", + PROGNAME(argv[0]), c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + PROGNAME(argv[0]), c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = BAD_OPTION; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int mfx_getopt(int argc, char **argv, const char *optstring) +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +int mfx_getopt_long(int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case BAD_OPTION: + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ + + +/* +vi:ts=4:et:nowrap +*/ + diff --git a/thirdparty/lzo/2.03/lzotest/mygetopt.h b/thirdparty/lzo/2.03/lzotest/mygetopt.h new file mode 100644 index 0000000..a0de9af --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/mygetopt.h @@ -0,0 +1,102 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef __MFX_GETOPT_H +#define __MFX_GETOPT_H 1 + +#ifdef __cplusplus +/* extern "C" { */ +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *mfx_optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int mfx_optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int mfx_opterr; + +/* Set to an option character which was unrecognized. */ + +extern int mfx_optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct mfx_option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define mfx_no_argument 0 +#define mfx_required_argument 1 +#define mfx_optional_argument 2 +#define mfx_exact_argument 0x10 /* no abbrev. */ + +int mfx_getopt(int argc, char **argv, const char *shortopts); +int mfx_getopt_long(int argc, char **argv, const char *shortopts, + const struct mfx_option *longopts, int *longind); + +#ifdef __cplusplus +/* } */ +#endif + +#endif /* __MFX_GETOPT_H */ diff --git a/thirdparty/lzo/2.03/lzotest/wrap.h b/thirdparty/lzo/2.03/lzotest/wrap.h new file mode 100644 index 0000000..e883605 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/wrap.h @@ -0,0 +1,284 @@ +/* wrap.h -- wrapper functions + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// compression levels of LZO1X-999 and LZO1Y-999 +**************************************************************************/ + +#if defined(HAVE_LZO1X_H) + +LZO_PRIVATE(int) +lzo1x_999_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 1); +} + +LZO_PRIVATE(int) +lzo1x_999_2_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 2); +} + +LZO_PRIVATE(int) +lzo1x_999_3_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 3); +} + +LZO_PRIVATE(int) +lzo1x_999_4_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 4); +} + +LZO_PRIVATE(int) +lzo1x_999_5_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 5); +} + +LZO_PRIVATE(int) +lzo1x_999_6_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 6); +} + +LZO_PRIVATE(int) +lzo1x_999_7_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 7); +} + +LZO_PRIVATE(int) +lzo1x_999_8_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 8); +} + +LZO_PRIVATE(int) +lzo1x_999_9_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 9); +} + +#endif + + +#if defined(HAVE_LZO1Y_H) + +LZO_PRIVATE(int) +lzo1y_999_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 1); +} + +LZO_PRIVATE(int) +lzo1y_999_2_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 2); +} + +LZO_PRIVATE(int) +lzo1y_999_3_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 3); +} + +LZO_PRIVATE(int) +lzo1y_999_4_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 4); +} + +LZO_PRIVATE(int) +lzo1y_999_5_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 5); +} + +LZO_PRIVATE(int) +lzo1y_999_6_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 6); +} + +LZO_PRIVATE(int) +lzo1y_999_7_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 7); +} + +LZO_PRIVATE(int) +lzo1y_999_8_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 8); +} + +LZO_PRIVATE(int) +lzo1y_999_9_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + return lzo1y_999_compress_level(src, src_len, dst, dst_len, wrkmem, + dict.ptr, dict.len, 0, 9); +} + +#endif + + +/************************************************************************* +// other wrappers (pseudo compressors) +**************************************************************************/ + +LZO_PRIVATE(int) +memcpy_x_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + lzo_memcpy(dst,src,src_len); + *dst_len = src_len; + if (wrkmem) wrkmem = 0; /* avoid warning */ + return 0; +} + + +LZO_PRIVATE(int) +memset_x_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + lzo_memset(dst,0,src_len); + *dst_len = src_len; + if (src) src = 0; /* avoid warning */ + if (wrkmem) wrkmem = 0; /* avoid warning */ + return 0; +} + + +LZO_PRIVATE(int) +adler32_x_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + lzo_uint32 adler; + adler = lzo_adler32(0, NULL, 0); + adler = lzo_adler32(adler, dst, src_len); + *dst_len = src_len; + if (src) src = 0; /* avoid warning */ + if (wrkmem) wrkmem = 0; /* avoid warning */ + return 0; +} + + +LZO_PRIVATE(int) +crc32_x_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ) +{ + lzo_uint32 crc; + crc = lzo_crc32(0, NULL, 0); + crc = lzo_crc32(crc, dst, src_len); + *dst_len = src_len; + if (src) src = 0; /* avoid warning */ + if (wrkmem) wrkmem = 0; /* avoid warning */ + return 0; +} + + +#if defined(__LZO_PROFESSIONAL__) +# include "lzopro/t_wrap.ch" +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/lzotest/wrapmisc.h b/thirdparty/lzo/2.03/lzotest/wrapmisc.h new file mode 100644 index 0000000..3fad078 --- /dev/null +++ b/thirdparty/lzo/2.03/lzotest/wrapmisc.h @@ -0,0 +1,288 @@ +/* wrapmisc.h -- misc wrapper functions for the test driver + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// compression levels of zlib +**************************************************************************/ + +#if defined(ALG_ZLIB) + +#define ZLIB_MEM_COMPRESS 0 +#define ZLIB_MEM_DECOMPRESS 0 + +static +int zlib_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem, + int method, int level ) +{ + int err; + uLong destLen; + + assert(method == Z_DEFLATED); + destLen = *dst_len; + err = compress2(dst, &destLen, src, src_len, level); + *dst_len = destLen; + LZO_UNUSED(method); + LZO_UNUSED(wrkmem); + return err; +} + + +M_PRIVATE(int) +zlib_decompress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ + int err; + uLong destLen; + + destLen = *dst_len; + err = uncompress(dst, &destLen, src, src_len); + *dst_len = destLen; + LZO_UNUSED(wrkmem); + return err; +} + + +M_PRIVATE(int) +zlib_8_1_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,1); } + +M_PRIVATE(int) +zlib_8_2_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,2); } + +M_PRIVATE(int) +zlib_8_3_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,3); } + +M_PRIVATE(int) +zlib_8_4_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,4); } + +M_PRIVATE(int) +zlib_8_5_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,5); } + +M_PRIVATE(int) +zlib_8_6_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,6); } + +M_PRIVATE(int) +zlib_8_7_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,7); } + +M_PRIVATE(int) +zlib_8_8_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,8); } + +M_PRIVATE(int) +zlib_8_9_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return zlib_compress(src,src_len,dst,dst_len,wrkmem,Z_DEFLATED,9); } + + +#endif /* ALG_ZLIB */ + + +/************************************************************************* +// compression levels of bzip2 +**************************************************************************/ + +#if defined(ALG_BZIP2) + +#define BZIP2_MEM_COMPRESS 0 +#define BZIP2_MEM_DECOMPRESS 0 + +static +int bzip2_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem, + int level ) +{ + int err; + unsigned destLen; + union { const m_bytep csrc; char* src; } u; + + u.csrc = src; /* UNCONST */ + destLen = *dst_len; + err = BZ2_bzBuffToBuffCompress((char*)dst, &destLen, u.src, src_len, level, 0, 0); + *dst_len = destLen; + LZO_UNUSED(wrkmem); + return err; +} + + +M_PRIVATE(int) +bzip2_decompress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ + int err; + unsigned destLen; + union { const m_bytep csrc; char* src; } u; + + u.csrc = src; /* UNCONST */ + destLen = *dst_len; + err = BZ2_bzBuffToBuffDecompress((char*)dst, &destLen, u.src, src_len, 0, 0); + *dst_len = destLen; + LZO_UNUSED(wrkmem); + return err; +} + + +M_PRIVATE(int) +bzip2_1_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,1); } + +M_PRIVATE(int) +bzip2_2_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,2); } + +M_PRIVATE(int) +bzip2_3_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,3); } + +M_PRIVATE(int) +bzip2_4_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,4); } + +M_PRIVATE(int) +bzip2_5_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,5); } + +M_PRIVATE(int) +bzip2_6_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,6); } + +M_PRIVATE(int) +bzip2_7_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,7); } + +M_PRIVATE(int) +bzip2_8_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,8); } + +M_PRIVATE(int) +bzip2_9_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ return bzip2_compress(src,src_len,dst,dst_len,wrkmem,9); } + + +#endif /* ALG_BZIP2 */ + + +/************************************************************************* +// other wrappers (for benchmarking the checksum algorithms) +**************************************************************************/ + +#if defined(ALG_ZLIB) + +M_PRIVATE(int) +zlib_adler32_x_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ + uLong adler; + adler = adler32(1L, src, src_len); + *dst_len = src_len; + LZO_UNUSED(adler); + LZO_UNUSED(dst); + LZO_UNUSED(wrkmem); + return 0; +} + + +M_PRIVATE(int) +zlib_crc32_x_compress ( const m_bytep src, m_uint src_len, + m_bytep dst, m_uintp dst_len, + m_voidp wrkmem ) +{ + uLong crc; + crc = crc32(0L, src, src_len); + *dst_len = src_len; + LZO_UNUSED(crc); + LZO_UNUSED(dst); + LZO_UNUSED(wrkmem); + return 0; +} + +#endif /* ALG_ZLIB */ + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/minilzo.obj b/thirdparty/lzo/2.03/minilzo.obj new file mode 100644 index 0000000..dfaa41f Binary files /dev/null and b/thirdparty/lzo/2.03/minilzo.obj differ diff --git a/thirdparty/lzo/2.03/minilzo/Makefile.am b/thirdparty/lzo/2.03/minilzo/Makefile.am new file mode 100644 index 0000000..4b3693c --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/Makefile.am @@ -0,0 +1,14 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +AM_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H +INCLUDES = -I$(top_srcdir)/include/lzo -I$(top_srcdir)/include + +noinst_PROGRAMS = testmini + +testmini_SOURCES = testmini.c minilzo.c + +EXTRA_DIST = README.LZO Makefile.minilzo minilzo.h + diff --git a/thirdparty/lzo/2.03/minilzo/Makefile.in b/thirdparty/lzo/2.03/minilzo/Makefile.in new file mode 100644 index 0000000..c12dc8b --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/Makefile.in @@ -0,0 +1,442 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = testmini$(EXEEXT) +subdir = minilzo +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_testmini_OBJECTS = testmini.$(OBJEXT) minilzo.$(OBJEXT) +testmini_OBJECTS = $(am_testmini_OBJECTS) +testmini_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(testmini_SOURCES) +DIST_SOURCES = $(testmini_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +AM_CPPFLAGS = -DMINILZO_HAVE_CONFIG_H +INCLUDES = -I$(top_srcdir)/include/lzo -I$(top_srcdir)/include +testmini_SOURCES = testmini.c minilzo.c +EXTRA_DIST = README.LZO Makefile.minilzo minilzo.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu minilzo/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu minilzo/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +testmini$(EXEEXT): $(testmini_OBJECTS) $(testmini_DEPENDENCIES) + @rm -f testmini$(EXEEXT) + $(LINK) $(testmini_LDFLAGS) $(testmini_OBJECTS) $(testmini_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minilzo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmini.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/minilzo/Makefile.minilzo b/thirdparty/lzo/2.03/minilzo/Makefile.minilzo new file mode 100644 index 0000000..a6ee373 --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/Makefile.minilzo @@ -0,0 +1,113 @@ +# +# a very simple Makefile for miniLZO +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +PROGRAM = testmini +SOURCES = testmini.c minilzo.c + +default: + @echo "Please choose one of the following targets:" + @echo " gcc: gcc" + @echo " unix: hpux hpux9" + @echo " win32: win32-bc win32-cygwin win32-dm win32-lccwin32" + @echo " win32-intelc win32-mingw win32-vc win32-watcomc" + @echo " dos16: dos16-bc dos16-mc dos16-wc" + @echo " dos32: dos32-djgpp2 dos32-wc" + + +# Make sure that minilzo.h, lzoconf.h and lzodefs.h are in the +# current dircectory. Otherwise you may want to adjust CPPFLAGS. +##CPPFLAGS = -I../include/lzo -I. + +GCC_CFLAGS = -s -Wall -O2 -fomit-frame-pointer + + +# +# gcc (generic) +# + +gcc: + gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM) $(SOURCES) + +cc: + cc $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + + +# +# UNIX +# + +hpux: + cc -Ae $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + +hpux9: + cc -Aa -D_HPUX_SOURCE $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + + +# +# Windows (32-bit) +# + +win32-borlandc win32-bc: + bcc32 -O2 -d -w -w-aus $(CPPFLAGS) $(SOURCES) + +win32-cygwin32 win32-cygwin: + gcc -mcygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +win32-digitalmars win32-dm: + dmc -mn -o -w- $(CPPFLAGS) $(SOURCES) + +win32-intelc win32-ic: + icl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) + +win32-lccwin32: + @echo "NOTE: need lcc 2002-07-25 or newer, older versions have bugs" + lc -A -unused -O $(CPPFLAGS) $(SOURCES) + +win32-mingw32 win32-mingw: + gcc -mno-cygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +win32-visualc win32-vc: + cl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) + +win32-watcomc win32-wc: + wcl386 -bt=nt -zq -mf -5r -zc -w5 -oneatx $(CPPFLAGS) $(SOURCES) + + +# +# DOS (16-bit) +# + +dos16-borlandc dos16-bc: + bcc -ml -w -d -O -4 $(CPPFLAGS) $(SOURCES) + +dos16-microsoftc dos16-msc dos16-mc: + cl -nologo -f- -AL -O -G2 -W3 $(CPPFLAGS) $(SOURCES) + +dos16-watcomc dos16-wc: + wcl -zq -ml -bt=dos -l=dos -ox -w5 $(CPPFLAGS) $(SOURCES) + + +# +# DOS (32-bit) +# + +dos32-djgpp2 dos32-dj2: + gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +dos32-watcomc dos32-wc: + wcl386 -zq -mf -bt=dos -l=dos4g -5r -ox -zc $(CPPFLAGS) $(SOURCES) + + +# +# other targets +# + +clean: + rm -f $(PROGRAM) $(PROGRAM).exe $(PROGRAM).map $(PROGRAM).tds + rm -f *.err *.o *.obj + +.PHONY: default clean + diff --git a/thirdparty/lzo/2.03/minilzo/README.LZO b/thirdparty/lzo/2.03/minilzo/README.LZO new file mode 100644 index 0000000..3700f28 --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/README.LZO @@ -0,0 +1,123 @@ + + ============================================================================ + miniLZO -- mini subset of the LZO real-time data compression library + ============================================================================ + + Author : Markus Franz Xaver Johannes Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + Version : 2.03 + Date : 30 Apr 2008 + + I've created miniLZO for projects where it is inconvenient to + include (or require) the full LZO source code just because you + want to add a little bit of data compression to your application. + + miniLZO implements the LZO1X-1 compressor and both the standard and + safe LZO1X decompressor. Apart from fast compression it also useful + for situations where you want to use pre-compressed data files (which + must have been compressed with LZO1X-999). + + miniLZO consists of one C source file and three header files: + minilzo.c + minilzo.h, lzoconf.h, lzodefs.h + + To use miniLZO just copy these files into your source directory, add + minilzo.c to your Makefile and #include minilzo.h from your program. + Note: you also must distribute this file (`README.LZO') with your project. + + minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and + the sources are about 30 kB when packed with zip - so there's no more + excuse that your application doesn't support data compression :-) + + For more information, documentation, example programs and other support + files (like Makefiles and build scripts) please download the full LZO + package from + http://www.oberhumer.com/opensource/lzo/ + + Have fun, + Markus + + + P.S. minilzo.c is generated automatically from the LZO sources and + therefore functionality is completely identical + + + Appendix A: building miniLZO + ---------------------------- + miniLZO is written such a way that it should compile and run + out-of-the-box on most machines. + + If you are running on a very unusual architecture and lzo_init() fails then + you should first recompile with `-DLZO_DEBUG' to see what causes the failure. + The most probable case is something like `sizeof(char *) != sizeof(long)'. + After identifying the problem you can compile by adding some defines + like `-DSIZEOF_CHAR_P=8' to your Makefile. + + The best solution is (of course) using Autoconf - if your project uses + Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler + flags when compiling minilzo.c. See the LZO distribution for an example + how to set up configure.in. + + + Appendix B: list of public functions available in miniLZO + --------------------------------------------------------- + Library initialization + lzo_init() + + Compression + lzo1x_1_compress() + + Decompression + lzo1x_decompress() + lzo1x_decompress_safe() + + Checksum functions + lzo_adler32() + + Version functions + lzo_version() + lzo_version_string() + lzo_version_date() + + Portable (but slow) string functions + lzo_memcmp() + lzo_memcpy() + lzo_memmove() + lzo_memset() + + + Appendix C: suggested macros for `configure.in' when using Autoconf + ------------------------------------------------------------------- + Checks for typedefs and structures + AC_CHECK_TYPE(ptrdiff_t,long) + AC_TYPE_SIZE_T + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(long long) + AC_CHECK_SIZEOF(__int64) + AC_CHECK_SIZEOF(void *) + AC_CHECK_SIZEOF(size_t) + AC_CHECK_SIZEOF(ptrdiff_t) + + Checks for compiler characteristics + AC_C_CONST + + Checks for library functions + AC_CHECK_FUNCS(memcmp memcpy memmove memset) + + + Appendix D: Copyright + --------------------- + LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer + + LZO and miniLZO are distributed under the terms of the GNU General + Public License (GPL). See the file COPYING. + + Special licenses for commercial and other applications which + are not willing to accept the GNU General Public License + are available by contacting the author. + + diff --git a/thirdparty/lzo/2.03/minilzo/minilzo.c b/thirdparty/lzo/2.03/minilzo/minilzo.c new file mode 100644 index 0000000..6a62b31 --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/minilzo.c @@ -0,0 +1,4112 @@ +/* minilzo.c -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + +#define __LZO_IN_MINILZO +#define LZO_BUILD + +#if defined(LZO_CFG_FREESTANDING) +# undef MINILZO_HAVE_CONFIG_H +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# include +#endif +#include +#include +#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS) + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined(__IBMCPP__) && !defined(__IBMC__) +# define __IBMC__ __IBMCPP__ +#endif +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +# define __INTEL_COMPILER __ICL +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if defined(__INTEL_COMPILER) && defined(__linux__) +# pragma warning(disable: 193) +#endif +#if defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif 0 && defined(__C251__) +# pragma warning disable = 322 +#endif +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if (_MSC_VER >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if 0 +#define LZO_0xffffL 0xfffful +#define LZO_0xffffffffL 0xfffffffful +#else +#define LZO_0xffffL 65535ul +#define LZO_0xffffffffL 4294967295ul +#endif +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +#else +# define LZO_EXTERN_C extern +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if defined(LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif defined(LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif (defined(__mips__) && defined(__psp__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) || defined(__MACOS__) +# define LZO_OS_POSIX_MACOSX 1 +# define LZO_INFO_OS_POSIX "macosx" +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +#elif defined(__INTEL_COMPILER) +# define LZO_CC_INTELC 1 +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN64) +# define LZO_CC_SYNTAX_MSC 1 +# else +# define LZO_CC_SYNTAX_GNUC 1 +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# else +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# endif +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) +# define LZO_CC_IBMC 1 +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(_MSC_VER) +# define LZO_CC_MSC 1 +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#elif defined(__MWERKS__) +# define LZO_CC_MWERKS 1 +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if (__ZTC__ == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if defined(LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_ARCH_IA16 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#endif +#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM) +# error "this should not happen" +#endif +#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086) +# error "this should not happen" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "this should not happen" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "this should not happen" +# elif (LZO_CC_ZORTECHC) +# else +# error "this should not happen" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#endif +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#endif +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#endif +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#endif +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#endif +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#endif +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && defined(LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if (LZO_ARCH_I086) +# define __LZO_WORDSIZE 2 +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "LZO_MM" +# endif +#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +# define __LZO_WORDSIZE 1 +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 4 +# else +# define __LZO_WORDSIZE 2 +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_M16C) +# define __LZO_WORDSIZE 2 +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define __LZO_WORDSIZE LZO_SIZEOF_LONG +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_ARCH_SPU) +# if 0 +# define __LZO_WORDSIZE 16 +# endif +# define LZO_SIZEOF_VOID_P 4 +#else +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_WORDSIZE) +# if defined(__LZO_WORDSIZE) +# define LZO_WORDSIZE __LZO_WORDSIZE +# else +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +# endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#else +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "LZO_MM" +# endif +#else +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_M68K || LZO_ARCH_S390) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN) +# error "this should not happen" +#endif +#if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif defined(LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif defined(LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if !defined(__LZO_LIBC_OVERRIDE) +#if defined(LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif defined(LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif defined(LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif defined(LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif defined(LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uclibc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#else +# define __lzo_gnuc_extension__ +#endif +#endif +#if !defined(__lzo_ua_volatile) +# define __lzo_ua_volatile volatile +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#endif +#endif +#if defined(__lzo_alignof) +# define __lzo_HAVE_alignof 1 +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# define __lzo_HAVE_constructor 1 +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# define __lzo_HAVE_destructor 1 +#endif +#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor) +# error "this should not happen" +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define __lzo_inline inline +#endif +#endif +#if defined(__lzo_inline) +# define __lzo_HAVE_inline 1 +#else +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#endif +#endif +#if defined(__lzo_forceinline) +# define __lzo_HAVE_forceinline 1 +#else +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#endif +#endif +#if defined(__lzo_noinline) +# define __lzo_HAVE_noinline 1 +#else +# define __lzo_noinline +#endif +#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline) +# error "this should not happen" +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#endif +#endif +#if defined(__lzo_noreturn) +# define __lzo_HAVE_noreturn 1 +#else +# define __lzo_noreturn +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# define __lzo_HAVE_nothrow 1 +#else +# define __lzo_nothrow +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#endif +#endif +#if defined(__lzo_restrict) +# define __lzo_HAVE_restrict 1 +#else +# define __lzo_restrict +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# define __lzo_HAVE_likely 1 +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# define __lzo_HAVE_unlikely 1 +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# elif (LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if (0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +# endif +#endif +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !defined(LZO_CFG_NO_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# define LZO_OPT_UNALIGNED64 1 +#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) +#elif (LZO_ARCH_ARM) +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_CRIS) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_I386) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_S390) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# if (LZO_SIZEOF_SIZE_T == 8) +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#if !defined(LZO_CFG_NO_INLINE_ASM) +#if defined(LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if !defined(LZO_CFG_NO_UNALIGNED) +#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(LZO_CFG_NO_INLINE_ASM) +#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +#elif (LZO_CC_INTELC) +# define __LZO_ASM_CLOBBER "memory" +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +#endif +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER + +#endif + +#endif + +#undef LZO_HAVE_CONFIG_H +#include "minilzo.h" + +#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2030) +# error "version mismatch in miniLZO source files" +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# define LZO_HAVE_CONFIG_H +#endif + +#ifndef __LZO_CONF_H +#define __LZO_CONF_H + +#if !defined(__LZO_IN_MINILZO) +#if defined(LZO_CFG_FREESTANDING) +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +# define ACC_LIBC_FREESTANDING 1 +# define ACC_OS_FREESTANDING 1 +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# define ACC_CFG_NO_UNALIGNED 1 +#endif +#if defined(LZO_ARCH_GENERIC) +# define ACC_ARCH_GENERIC 1 +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# define ACC_ABI_NEUTRAL_ENDIAN 1 +#endif +#if defined(LZO_HAVE_CONFIG_H) +# define ACC_CONFIG_NO_HEADER 1 +#endif +#if defined(LZO_CFG_EXTRA_CONFIG_HEADER) +# include LZO_CFG_EXTRA_CONFIG_HEADER +#endif +#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED) +# error "include this file first" +#endif +#include "lzo/lzoconf.h" +#endif + +#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED) +# error "version mismatch" +#endif + +#if (LZO_CC_BORLANDC && LZO_ARCH_I086) +# pragma option -h +#endif + +#if (LZO_CC_MSC && (_MSC_VER >= 1000)) +# pragma warning(disable: 4127 4701) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) +# pragma warning(disable: 4820) +# pragma warning(disable: 4514 4710 4711) +#endif + +#if (LZO_CC_SUNPROC) +# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED) +# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP) +#endif + +#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR) +# error "this should not happen - check defines for __huge" +#endif + +#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING) +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define ACC_WANT_ACC_INCD_H 1 +# define ACC_WANT_ACC_INCE_H 1 +# define ACC_WANT_ACC_INCI_H 1 +#elif 1 +# include +#else +# define ACC_WANT_ACC_INCD_H 1 +#endif + +#if (LZO_ARCH_I086) +# define ACC_MM_AHSHIFT LZO_MM_AHSHIFT +# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0]) +# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1]) +# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o))) +#endif + +#if !defined(lzo_uintptr_t) +# if defined(__LZO_MMODEL_HUGE) +# define lzo_uintptr_t unsigned long +# elif 1 && defined(LZO_OS_OS400) && (LZO_SIZEOF_VOID_P == 16) +# define __LZO_UINTPTR_T_IS_POINTER 1 + typedef char* lzo_uintptr_t; +# define lzo_uintptr_t lzo_uintptr_t +# elif (LZO_SIZEOF_SIZE_T == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t size_t +# elif (LZO_SIZEOF_LONG == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned long +# elif (LZO_SIZEOF_INT == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned int +# elif (LZO_SIZEOF_LONG_LONG == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned long long +# else +# define lzo_uintptr_t size_t +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + +#if 1 && !defined(LZO_CFG_FREESTANDING) +#if 1 && !defined(HAVE_STRING_H) +#define HAVE_STRING_H 1 +#endif +#if 1 && !defined(HAVE_MEMCMP) +#define HAVE_MEMCMP 1 +#endif +#if 1 && !defined(HAVE_MEMCPY) +#define HAVE_MEMCPY 1 +#endif +#if 1 && !defined(HAVE_MEMMOVE) +#define HAVE_MEMMOVE 1 +#endif +#if 1 && !defined(HAVE_MEMSET) +#define HAVE_MEMSET 1 +#endif +#endif + +#if 1 && defined(HAVE_STRING_H) +#include +#endif + +#if defined(LZO_CFG_FREESTANDING) +# undef HAVE_MEMCMP +# undef HAVE_MEMCPY +# undef HAVE_MEMMOVE +# undef HAVE_MEMSET +#endif + +#if !defined(HAVE_MEMCMP) +# undef memcmp +# define memcmp(a,b,c) lzo_memcmp(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcmp(a,b,c) memcmp(a,b,c) +#endif +#if !defined(HAVE_MEMCPY) +# undef memcpy +# define memcpy(a,b,c) lzo_memcpy(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcpy(a,b,c) memcpy(a,b,c) +#endif +#if !defined(HAVE_MEMMOVE) +# undef memmove +# define memmove(a,b,c) lzo_memmove(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memmove(a,b,c) memmove(a,b,c) +#endif +#if !defined(HAVE_MEMSET) +# undef memset +# define memset(a,b,c) lzo_memset(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memset(a,b,c) memset(a,b,c) +#endif + +#undef NDEBUG +#if defined(LZO_CFG_FREESTANDING) +# undef LZO_DEBUG +# define NDEBUG 1 +# undef assert +# define assert(e) ((void)0) +#else +# if !defined(LZO_DEBUG) +# define NDEBUG 1 +# endif +# include +#endif + +#if 0 && defined(__BOUNDS_CHECKING_ON) +# include +#else +# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt +# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) +#endif + +#if !defined(__lzo_inline) +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +# define __lzo_noinline +#endif + +#if 1 +# define LZO_BYTE(x) ((unsigned char) (x)) +#else +# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) +#endif + +#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) +#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) +#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) +#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) + +#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) + +#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) + +#define LZO_SIZE(bits) (1u << (bits)) +#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) + +#define LZO_LSIZE(bits) (1ul << (bits)) +#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1) + +#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) +#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) + +#if !defined(DMUL) +#if 0 + +# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b))) +#else +# define DMUL(a,b) ((lzo_xint) ((a) * (b))) +#endif +#endif + +#if 1 && !defined(LZO_CFG_NO_UNALIGNED) +#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if (LZO_SIZEOF_SHORT == 2) +# define LZO_UNALIGNED_OK_2 +# endif +# if (LZO_SIZEOF_INT == 4) +# define LZO_UNALIGNED_OK_4 +# endif +#endif +#endif + +#if defined(LZO_UNALIGNED_OK_2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2) +#endif +#if defined(LZO_UNALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#elif defined(LZO_ALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#endif + +#define MEMCPY8_DS(dest,src,len) \ + lzo_memcpy(dest,src,len); dest += len; src += len + +#define BZERO8_PTR(s,l,n) \ + lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n)) + +#define MEMCPY_DS(dest,src,len) \ + do *dest++ = *src++; while (--len > 0) + +__LZO_EXTERN_C int __lzo_init_done; +__LZO_EXTERN_C const char __lzo_copyright[]; +LZO_EXTERN(const lzo_bytep) lzo_copyright(void); + +#ifndef __LZO_PTR_H +#define __LZO_PTR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(lzo_uintptr_t) +# if defined(__LZO_MMODEL_HUGE) +# define lzo_uintptr_t unsigned long +# else +# define lzo_uintptr_t acc_uintptr_t +# ifdef __ACC_INTPTR_T_IS_POINTER +# define __LZO_UINTPTR_T_IS_POINTER 1 +# endif +# endif +#endif + +#if (LZO_ARCH_I086) +#define PTR(a) ((lzo_bytep) (a)) +#define PTR_ALIGNED_4(a) ((ACC_PTR_FP_OFF(a) & 3) == 0) +#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0) +#elif (LZO_MM_PVP) +#define PTR(a) ((lzo_bytep) (a)) +#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0) +#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0) +#else +#define PTR(a) ((lzo_uintptr_t) (a)) +#define PTR_LINEAR(a) PTR(a) +#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0) +#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0) +#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0) +#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0) +#endif + +#define PTR_LT(a,b) (PTR(a) < PTR(b)) +#define PTR_GE(a,b) (PTR(a) >= PTR(b)) +#define PTR_DIFF(a,b) (PTR(a) - PTR(b)) +#define pd(a,b) ((lzo_uint) ((a)-(b))) + +LZO_EXTERN(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr); + +typedef union +{ + char a_char; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long a_long; + unsigned long a_ulong; + lzo_int a_lzo_int; + lzo_uint a_lzo_uint; + lzo_int32 a_lzo_int32; + lzo_uint32 a_lzo_uint32; + ptrdiff_t a_ptrdiff_t; + lzo_uintptr_t a_lzo_uintptr_t; + lzo_voidp a_lzo_voidp; + void * a_void_p; + lzo_bytep a_lzo_bytep; + lzo_bytepp a_lzo_bytepp; + lzo_uintp a_lzo_uintp; + lzo_uint * a_lzo_uint_p; + lzo_uint32p a_lzo_uint32p; + lzo_uint32 * a_lzo_uint32_p; + unsigned char * a_uchar_p; + char * a_char_p; +} +lzo_full_align_t; + +#ifdef __cplusplus +} +#endif + +#endif + +#define LZO_DETERMINISTIC + +#define LZO_DICT_USE_PTR +#if 0 && (LZO_ARCH_I086) +# undef LZO_DICT_USE_PTR +#endif + +#if defined(LZO_DICT_USE_PTR) +# define lzo_dict_t const lzo_bytep +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#else +# define lzo_dict_t lzo_uint +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#endif + +#endif + +#if !defined(MINILZO_CFG_SKIP_LZO_PTR) + +LZO_PUBLIC(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr) +{ + lzo_uintptr_t p; + +#if (LZO_ARCH_I086) + p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr)); +#elif (LZO_MM_PVP) + p = (lzo_uintptr_t) (ptr); + p = (p << 3) | (p >> 61); +#else + p = (lzo_uintptr_t) PTR_LINEAR(ptr); +#endif + + return p; +} + +LZO_PUBLIC(unsigned) +__lzo_align_gap(const lzo_voidp ptr, lzo_uint size) +{ +#if defined(__LZO_UINTPTR_T_IS_POINTER) + size_t n = (size_t) ptr; + n = (((n + size - 1) / size) * size) - n; +#else + lzo_uintptr_t p, n; + p = __lzo_ptr_linear(ptr); + n = (((p + size - 1) / size) * size) - p; +#endif + + assert(size > 0); + assert((long)n >= 0); + assert(n <= size); + return (unsigned)n; +} + +#endif + +/* If you use the LZO library in a product, I would appreciate that you + * keep this copyright string in the executable of your product. + */ + +const char __lzo_copyright[] = +#if !defined(__LZO_IN_MINLZO) + LZO_VERSION_STRING; +#else + "\r\n\n" + "LZO data compression library.\n" + "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer\n" + "\n" + "http://www.oberhumer.com $\n\n" + "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n" + "$Built: " __DATE__ " " __TIME__ " $\n" + "$Info: " LZO_INFO_STRING " $\n"; +#endif + +LZO_PUBLIC(const lzo_bytep) +lzo_copyright(void) +{ +#if (LZO_OS_DOS16 && LZO_CC_TURBOC) + return (lzo_voidp) __lzo_copyright; +#else + return (const lzo_bytep) __lzo_copyright; +#endif +} + +LZO_PUBLIC(unsigned) +lzo_version(void) +{ + return LZO_VERSION; +} + +LZO_PUBLIC(const char *) +lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const char *) +lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +#define LZO_BASE 65521u +#define LZO_NMAX 5552 + +#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1 +#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1); +#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2); +#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4); +#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8); + +LZO_PUBLIC(lzo_uint32) +lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len) +{ + lzo_uint32 s1 = adler & 0xffff; + lzo_uint32 s2 = (adler >> 16) & 0xffff; + unsigned k; + + if (buf == NULL) + return 1; + + while (len > 0) + { + k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX; + len -= k; + if (k >= 16) do + { + LZO_DO16(buf,0); + buf += 16; + k -= 16; + } while (k >= 16); + if (k != 0) do + { + s1 += *buf++; + s2 += s1; + } while (--k > 0); + s1 %= LZO_BASE; + s2 %= LZO_BASE; + } + return (s2 << 16) | s1; +} + +#undef LZO_DO1 +#undef LZO_DO2 +#undef LZO_DO4 +#undef LZO_DO8 +#undef LZO_DO16 + +#if !defined(MINILZO_CFG_SKIP_LZO_STRING) +#undef lzo_memcmp +#undef lzo_memcpy +#undef lzo_memmove +#undef lzo_memset +#if !defined(__LZO_MMODEL_HUGE) +# undef LZO_HAVE_MM_HUGE_PTR +#endif +#define lzo_hsize_t lzo_uint +#define lzo_hvoid_p lzo_voidp +#define lzo_hbyte_p lzo_bytep +#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f +#define lzo_hmemcmp lzo_memcmp +#define lzo_hmemcpy lzo_memcpy +#define lzo_hmemmove lzo_memmove +#define lzo_hmemset lzo_memset +#define __LZOLIB_HMEMCPY_CH_INCLUDED 1 +#if !defined(LZOLIB_PUBLIC) +# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f) +#endif +LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP) + const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2; + if __lzo_likely(len > 0) do + { + int d = *p1 - *p2; + if (d != 0) + return d; + p1++; p2++; + } while __lzo_likely(--len > 0); + return 0; +#else + return memcmp(s1, s2, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY) + lzo_hbyte_p p1 = (lzo_hbyte_p) dest; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + return dest; +#else + return memcpy(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE) + lzo_hbyte_p p1 = (lzo_hbyte_p) dest; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + if (p1 < p2) + { + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + } + else + { + p1 += len; + p2 += len; + do + *--p1 = *--p2; + while __lzo_likely(--len > 0); + } + return dest; +#else + return memmove(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET) + lzo_hbyte_p p = (lzo_hbyte_p) s; + if __lzo_likely(len > 0) do + *p++ = (unsigned char) c; + while __lzo_likely(--len > 0); + return s; +#else + return memset(s, c, len); +#endif +} +#undef LZOLIB_PUBLIC +#endif + +#if !defined(__LZO_IN_MINILZO) + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32) + ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) + ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4) + +#if !defined(__LZO_UINTPTR_T_IS_POINTER) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) +#endif + ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32)) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint)) + ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint)) + +#endif +#undef ACCCHK_ASSERT + +LZO_PUBLIC(int) +_lzo_config_check(void) +{ + lzo_bool r = 1; + union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u; + lzo_uintptr_t p; + +#if !defined(LZO_CFG_NO_CONFIG_CHECK) +#if defined(LZO_ABI_BIG_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_ABI_LITTLE_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[0] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_UNALIGNED_OK_2) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_ushortp) (p+1)) == 0); +#endif +#if defined(LZO_UNALIGNED_OK_4) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_uint32p) (p+1)) == 0); +#endif +#endif + + LZO_UNUSED(u); LZO_UNUSED(p); + return r == 1 ? LZO_E_OK : LZO_E_ERROR; +} + +int __lzo_init_done = 0; + +LZO_PUBLIC(int) +__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5, + int s6, int s7, int s8, int s9) +{ + int r; + +#if defined(__LZO_IN_MINILZO) +#elif (LZO_CC_MSC && ((_MSC_VER) < 700)) +#else +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr) +#endif +#undef ACCCHK_ASSERT + + __lzo_init_done = 1; + + if (v == 0) + return LZO_E_ERROR; + + r = (s1 == -1 || s1 == (int) sizeof(short)) && + (s2 == -1 || s2 == (int) sizeof(int)) && + (s3 == -1 || s3 == (int) sizeof(long)) && + (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) && + (s5 == -1 || s5 == (int) sizeof(lzo_uint)) && + (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) && + (s7 == -1 || s7 == (int) sizeof(char *)) && + (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) && + (s9 == -1 || s9 == (int) sizeof(lzo_callback_t)); + if (!r) + return LZO_E_ERROR; + + r = _lzo_config_check(); + if (r != LZO_E_OK) + return r; + + return r; +} + +#if !defined(__LZO_IN_MINILZO) + +#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) + +#if 0 +BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, + WORD wHeapSize, LPSTR lpszCmdLine ) +#else +int __far __pascal LibMain ( int a, short b, short c, long d ) +#endif +{ + LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); + return 1; +} + +#endif + +#endif + +#define do_compress _lzo1x_1_do_compress + +#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS) + +#define LZO_NEED_DICT_H +#define D_BITS 14 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) + +#ifndef __LZO_CONFIG1X_H +#define __LZO_CONFIG1X_H + +#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) +# define LZO1X +#endif + +#if !defined(__LZO_IN_MINILZO) +#include "lzo/lzo1x.h" +#endif + +#define LZO_EOF_CODE +#undef LZO_DETERMINISTIC + +#define M1_MAX_OFFSET 0x0400 +#ifndef M2_MAX_OFFSET +#define M2_MAX_OFFSET 0x0800 +#endif +#define M3_MAX_OFFSET 0x4000 +#define M4_MAX_OFFSET 0xbfff + +#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET) + +#define M1_MIN_LEN 2 +#define M1_MAX_LEN 2 +#define M2_MIN_LEN 3 +#ifndef M2_MAX_LEN +#define M2_MAX_LEN 8 +#endif +#define M3_MIN_LEN 3 +#define M3_MAX_LEN 33 +#define M4_MIN_LEN 3 +#define M4_MAX_LEN 9 + +#define M1_MARKER 0 +#define M2_MARKER 64 +#define M3_MARKER 32 +#define M4_MARKER 16 + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif + +#if defined(LZO_NEED_DICT_H) + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B +#endif +#define DL_MIN_LEN M2_MIN_LEN + +#ifndef __LZO_DICT_H +#define __LZO_DICT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(D_BITS) && defined(DBITS) +# define D_BITS DBITS +#endif +#if !defined(D_BITS) +# error "D_BITS is not defined" +#endif +#if (D_BITS < 16) +# define D_SIZE LZO_SIZE(D_BITS) +# define D_MASK LZO_MASK(D_BITS) +#else +# define D_SIZE LZO_USIZE(D_BITS) +# define D_MASK LZO_UMASK(D_BITS) +#endif +#define D_HIGH ((D_MASK >> 1) + 1) + +#if !defined(DD_BITS) +# define DD_BITS 0 +#endif +#define DD_SIZE LZO_SIZE(DD_BITS) +#define DD_MASK LZO_MASK(DD_BITS) + +#if !defined(DL_BITS) +# define DL_BITS (D_BITS - DD_BITS) +#endif +#if (DL_BITS < 16) +# define DL_SIZE LZO_SIZE(DL_BITS) +# define DL_MASK LZO_MASK(DL_BITS) +#else +# define DL_SIZE LZO_USIZE(DL_BITS) +# define DL_MASK LZO_UMASK(DL_BITS) +#endif + +#if (D_BITS != DL_BITS + DD_BITS) +# error "D_BITS does not match" +#endif +#if (D_BITS < 8 || D_BITS > 18) +# error "invalid D_BITS" +#endif +#if (DL_BITS < 8 || DL_BITS > 20) +# error "invalid DL_BITS" +#endif +#if (DD_BITS < 0 || DD_BITS > 6) +# error "invalid DD_BITS" +#endif + +#if !defined(DL_MIN_LEN) +# define DL_MIN_LEN 3 +#endif +#if !defined(DL_SHIFT) +# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN) +#endif + +#define LZO_HASH_GZIP 1 +#define LZO_HASH_GZIP_INCREMENTAL 2 +#define LZO_HASH_LZO_INCREMENTAL_A 3 +#define LZO_HASH_LZO_INCREMENTAL_B 4 + +#if !defined(LZO_HASH) +# error "choose a hashing strategy" +#endif + +#undef DM +#undef DX + +#if (DL_MIN_LEN == 3) +# define _DV2_A(p,shift1,shift2) \ + (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2]) +# define _DV2_B(p,shift1,shift2) \ + (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0]) +# define _DV3_B(p,shift1,shift2,shift3) \ + ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0]) +#elif (DL_MIN_LEN == 2) +# define _DV2_A(p,shift1,shift2) \ + (( (lzo_xint)(p[0]) << shift1) ^ p[1]) +# define _DV2_B(p,shift1,shift2) \ + (( (lzo_xint)(p[1]) << shift1) ^ p[2]) +#else +# error "invalid DL_MIN_LEN" +#endif +#define _DV_A(p,shift) _DV2_A(p,shift,shift) +#define _DV_B(p,shift) _DV2_B(p,shift,shift) +#define DA2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0]) +#define DS2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0]) +#define DX2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) +#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0]) +#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0]) +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) +#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s))) +#define DM(v) DMS(v,0) + +#if (LZO_HASH == LZO_HASH_GZIP) +# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT)) + +#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT) +# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2]) +# define _DINDEX(dv,p) (dv) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2]) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_B((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5))) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#else +# error "choose a hashing strategy" +#endif + +#ifndef DINDEX +#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS) +#endif +#if !defined(DINDEX1) && defined(D_INDEX1) +#define DINDEX1 D_INDEX1 +#endif +#if !defined(DINDEX2) && defined(D_INDEX2) +#define DINDEX2 D_INDEX2 +#endif + +#if !defined(__LZO_HASH_INCREMENTAL) +# define DVAL_FIRST(dv,p) ((void) 0) +# define DVAL_NEXT(dv,p) ((void) 0) +# define DVAL_LOOKAHEAD 0 +#endif + +#if !defined(DVAL_ASSERT) +#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG) +static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p) +{ + lzo_xint df; + DVAL_FIRST(df,(p)); + assert(DINDEX(dv,p) == DINDEX(df,p)); +} +#else +# define DVAL_ASSERT(dv,p) ((void) 0) +#endif +#endif + +#if defined(LZO_DICT_USE_PTR) +# define DENTRY(p,in) (p) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex] +#else +# define DENTRY(p,in) ((lzo_uint) ((p)-(in))) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex] +#endif + +#if (DD_BITS == 0) + +# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in) +# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in) +# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in) + +#else + +# define UPDATE_D(dict,drun,dv,p,in) \ + dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_I(dict,drun,index,p,in) \ + dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_P(ptr,drun,p,in) \ + (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK + +#endif + +#if defined(LZO_DICT_USE_PTR) + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (BOUNDS_CHECKING_OFF_IN_EXPR(( \ + m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \ + PTR_LT(m_pos,in) || \ + (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \ + m_off > max_offset ))) + +#else + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_off == 0 || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (pd(ip, in) <= m_off || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#endif + +#if defined(LZO_DETERMINISTIC) +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET +#else +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +#endif + +#endif + +#define DO_COMPRESS lzo1x_1_compress + +static __lzo_noinline lzo_uint +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + op = out; + ip = in; + ii = ip; + + ip += 4; + for (;;) + { + register const lzo_bytep m_pos; + lzo_uint m_off; + lzo_uint m_len; + lzo_uint dindex; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + +try_match: +#if 1 && defined(LZO_UNALIGNED_OK_2) + if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip) +#else + if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) +#endif + { + } + else + { + if __lzo_likely(m_pos[2] == ip[2]) + { +#if 0 + if (m_off <= M2_MAX_OFFSET) + goto match; + if (lit <= 3) + goto match; + if (lit == 3) + { + assert(op - 2 > out); op[-2] |= LZO_BYTE(3); + *op++ = *ii++; *op++ = *ii++; *op++ = *ii++; + goto code_match; + } + if (m_pos[3] == ip[3]) +#endif + goto match; + } + else + { +#if 0 +#if 0 + if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3) +#else + if (m_off <= M1_MAX_OFFSET && lit == 3) +#endif + { + register lzo_uint t; + + t = lit; + assert(op - 2 > out); op[-2] |= LZO_BYTE(t); + do *op++ = *ii++; while (--t > 0); + assert(ii == ip); + m_off -= 1; + *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); + ip += 2; + goto match_done; + } +#endif + } + } + +literal: + UPDATE_I(dict,0,dindex,ip,in); + ++ip; + if __lzo_unlikely(ip >= ip_end) + break; + continue; + +match: + UPDATE_I(dict,0,dindex,ip,in); + if (pd(ip,ii) > 0) + { + register lzo_uint t = pd(ip,ii); + + if (t <= 3) + { + assert(op - 2 > out); + op[-2] |= LZO_BYTE(t); + } + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + register lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + assert(ii == ip); + ip += 3; + if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ || + m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++ +#ifdef LZO1Y + || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++ + || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++ +#endif + ) + { + --ip; + m_len = pd(ip, ii); + assert(m_len >= 3); assert(m_len <= M2_MAX_LEN); + + if (m_off <= M2_MAX_OFFSET) + { + m_off -= 1; +#if defined(LZO1X) + *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); +#elif defined(LZO1Y) + *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + } + else if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + goto m3_m4_offset; + } + else +#if defined(LZO1X) + { + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + goto m3_m4_offset; + } +#elif defined(LZO1Y) + goto m4_match; +#endif + } + else + { + { + const lzo_bytep end = in_end; + const lzo_bytep m = m_pos + M2_MAX_LEN + 1; + while (ip < end && *m == *ip) + m++, ip++; + m_len = pd(ip, ii); + } + assert(m_len > M2_MAX_LEN); + + if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + if (m_len <= 33) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= 33; + *op++ = M3_MARKER | 0; + goto m3_m4_len; + } + } + else + { +#if defined(LZO1Y) +m4_match: +#endif + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + if (m_len <= M4_MAX_LEN) + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + else + { + m_len -= M4_MAX_LEN; + *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11)); +m3_m4_len: + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + } + +m3_m4_offset: + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + +#if 0 +match_done: +#endif + ii = ip; + if __lzo_unlikely(ip >= ip_end) + break; + } + + *out_len = pd(op, out); + return pd(in_end,ii); +} + +LZO_PUBLIC(int) +DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op = out; + lzo_uint t; + + if __lzo_unlikely(in_len <= M2_MAX_LEN + 5) + t = in_len; + else + { + t = do_compress(in,in_len,op,out_len,wrkmem); + op += *out_len; + } + + if (t > 0) + { + const lzo_bytep ii = in + in_len - t; + + if (op == out && t <= 238) + *op++ = LZO_BYTE(17 + t); + else if (t <= 3) + op[-2] |= LZO_BYTE(t); + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + *op++ = M4_MARKER | 1; + *op++ = 0; + *op++ = 0; + + *out_len = pd(op, out); + return LZO_E_OK; +} + +#endif + +#undef do_compress +#undef DO_COMPRESS +#undef LZO_HASH + +#undef LZO_TEST_OVERRUN +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP +#else +# define TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP +#else +# define NEED_IP(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP +#else +# define NEED_OP(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP +#endif + +#undef __COPY4 +#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src) + +#undef COPY4 +#if defined(LZO_UNALIGNED_OK_4) +# define COPY4(dst,src) __COPY4(dst,src) +#elif defined(LZO_ALIGNED_OK_4) +# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src)) +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + register const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !defined(LZO_UNALIGNED_OK_4) + } + else +#endif +#endif +#if !defined(LZO_UNALIGNED_OK_4) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + do { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 7 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } while (TEST_IP && TEST_OP); + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +#define LZO_TEST_OVERRUN +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress_safe + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP +#else +# define TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP +#else +# define NEED_IP(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP +#else +# define NEED_OP(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP +#endif + +#undef __COPY4 +#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src) + +#undef COPY4 +#if defined(LZO_UNALIGNED_OK_4) +# define COPY4(dst,src) __COPY4(dst,src) +#elif defined(LZO_ALIGNED_OK_4) +# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src)) +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + register const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !defined(LZO_UNALIGNED_OK_4) + } + else +#endif +#endif +#if !defined(LZO_UNALIGNED_OK_4) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + do { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 7 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } while (TEST_IP && TEST_OP); + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +/***** End of minilzo.c *****/ + diff --git a/thirdparty/lzo/2.03/minilzo/minilzo.h b/thirdparty/lzo/2.03/minilzo/minilzo.h new file mode 100644 index 0000000..0aff50e --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/minilzo.h @@ -0,0 +1,106 @@ +/* minilzo.h -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __MINILZO_H +#define __MINILZO_H + +#define MINILZO_VERSION 0x2030 + +#ifdef __LZOCONF_H +# error "you cannot use both LZO and miniLZO" +#endif + +#undef LZO_HAVE_CONFIG_H +#include "lzoconf.h" + +#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) +# error "version mismatch in header files" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS +#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1X_MEM_DECOMPRESS (0) + + +/* compression */ +LZO_EXTERN(int) +lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +/* decompression */ +LZO_EXTERN(int) +lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + diff --git a/thirdparty/lzo/2.03/minilzo/testmini.c b/thirdparty/lzo/2.03/minilzo/testmini.c new file mode 100644 index 0000000..022edaf --- /dev/null +++ b/thirdparty/lzo/2.03/minilzo/testmini.c @@ -0,0 +1,168 @@ +/* testmini.c -- very simple test program for the miniLZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include +#include + + +/************************************************************************* +// This program shows the basic usage of the LZO library. +// We will compress a block of data and decompress again. +// +// For more information, documentation, example programs and other support +// files (like Makefiles and build scripts) please download the full LZO +// package from +// http://www.oberhumer.com/opensource/lzo/ +**************************************************************************/ + +/* First let's include "minizo.h". */ + +#include "minilzo.h" + + +/* We want to compress the data block at `in' with length `IN_LEN' to + * the block at `out'. Because the input block may be incompressible, + * we must provide a little more output space in case that compression + * is not possible. + */ + +#if defined(__LZO_STRICT_16BIT) +#define IN_LEN (8*1024u) +#elif defined(LZO_ARCH_I086) && !defined(LZO_HAVE_MM_HUGE_ARRAY) +#define IN_LEN (60*1024u) +#else +#define IN_LEN (128*1024ul) +#endif +#define OUT_LEN (IN_LEN + IN_LEN / 16 + 64 + 3) + +static unsigned char __LZO_MMODEL in [ IN_LEN ]; +static unsigned char __LZO_MMODEL out [ OUT_LEN ]; + + +/* Work-memory needed for compression. Allocate memory in units + * of `lzo_align_t' (instead of `char') to make sure it is properly aligned. + */ + +#define HEAP_ALLOC(var,size) \ + lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ] + +static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS); + + +/************************************************************************* +// +**************************************************************************/ + +int main(int argc, char *argv[]) +{ + int r; + lzo_uint in_len; + lzo_uint out_len; + lzo_uint new_len; + + if (argc < 0 && argv == NULL) /* avoid warning about unused args */ + return 0; + + printf("\nLZO real-time data compression library (v%s, %s).\n", + lzo_version_string(), lzo_version_date()); + printf("Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer\nAll Rights Reserved.\n\n"); + + +/* + * Step 1: initialize the LZO library + */ + if (lzo_init() != LZO_E_OK) + { + printf("internal error - lzo_init() failed !!!\n"); + printf("(this usually indicates a compiler bug - try recompiling\nwithout optimizations, and enable `-DLZO_DEBUG' for diagnostics)\n"); + return 3; + } + +/* + * Step 2: prepare the input block that will get compressed. + * We just fill it with zeros in this example program, + * but you would use your real-world data here. + */ + in_len = IN_LEN; + lzo_memset(in,0,in_len); + +/* + * Step 3: compress from `in' to `out' with LZO1X-1 + */ + r = lzo1x_1_compress(in,in_len,out,&out_len,wrkmem); + if (r == LZO_E_OK) + printf("compressed %lu bytes into %lu bytes\n", + (unsigned long) in_len, (unsigned long) out_len); + else + { + /* this should NEVER happen */ + printf("internal error - compression failed: %d\n", r); + return 2; + } + /* check for an incompressible block */ + if (out_len >= in_len) + { + printf("This block contains incompressible data.\n"); + return 0; + } + +/* + * Step 4: decompress again, now going from `out' to `in' + */ + new_len = in_len; + r = lzo1x_decompress(out,out_len,in,&new_len,NULL); + if (r == LZO_E_OK && new_len == in_len) + printf("decompressed %lu bytes back into %lu bytes\n", + (unsigned long) out_len, (unsigned long) in_len); + else + { + /* this should NEVER happen */ + printf("internal error - decompression failed: %d\n", r); + return 1; + } + + printf("\nminiLZO simple compression test passed.\n"); + return 0; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/precomp.exe b/thirdparty/lzo/2.03/precomp.exe new file mode 100644 index 0000000..8b654d0 Binary files /dev/null and b/thirdparty/lzo/2.03/precomp.exe differ diff --git a/thirdparty/lzo/2.03/precomp.exe.manifest b/thirdparty/lzo/2.03/precomp.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/precomp.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/precomp.obj b/thirdparty/lzo/2.03/precomp.obj new file mode 100644 index 0000000..0ff10e9 Binary files /dev/null and b/thirdparty/lzo/2.03/precomp.obj differ diff --git a/thirdparty/lzo/2.03/precomp2.exe b/thirdparty/lzo/2.03/precomp2.exe new file mode 100644 index 0000000..25d6dd8 Binary files /dev/null and b/thirdparty/lzo/2.03/precomp2.exe differ diff --git a/thirdparty/lzo/2.03/precomp2.exe.manifest b/thirdparty/lzo/2.03/precomp2.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/precomp2.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/precomp2.obj b/thirdparty/lzo/2.03/precomp2.obj new file mode 100644 index 0000000..521655c Binary files /dev/null and b/thirdparty/lzo/2.03/precomp2.obj differ diff --git a/thirdparty/lzo/2.03/simple.exe b/thirdparty/lzo/2.03/simple.exe new file mode 100644 index 0000000..1d2f4d8 Binary files /dev/null and b/thirdparty/lzo/2.03/simple.exe differ diff --git a/thirdparty/lzo/2.03/simple.exe.manifest b/thirdparty/lzo/2.03/simple.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/simple.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/simple.obj b/thirdparty/lzo/2.03/simple.obj new file mode 100644 index 0000000..2899dc4 Binary files /dev/null and b/thirdparty/lzo/2.03/simple.obj differ diff --git a/thirdparty/lzo/2.03/src/Makefile.am b/thirdparty/lzo/2.03/src/Makefile.am new file mode 100644 index 0000000..e5f6ca0 --- /dev/null +++ b/thirdparty/lzo/2.03/src/Makefile.am @@ -0,0 +1,68 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +VPATH = @srcdir@@LZO_ASM_VPATH@ +SUFFIXES = .S + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) +CPPFLAGS = $(LZO_CPPFLAGS) $(configure_CPPFLAGS) $(LZO_EXTRA_CPPFLAGS) +CFLAGS = $(LZO_CFLAGS) $(configure_CFLAGS) $(LZO_EXTRA_CFLAGS) + +lib_LTLIBRARIES = liblzo2.la + +liblzo2_la_LDFLAGS = -version-info 2:0:0 + +liblzo2_la_SOURCES = \ + lzo_crc.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \ + lzo1.c lzo1_99.c \ + lzo1a.c lzo1a_99.c \ + lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \ + lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \ + lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \ + lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \ + lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \ + lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \ + lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \ + lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \ + lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \ + lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \ + lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \ + lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c + +EXTRA_DIST = \ + lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \ + lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \ + lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \ + lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch \ + lzo_dll.ch lzo_mchw.ch lzo_swd.ch \ + compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \ + config1f.h config1x.h config1y.h config1z.h config2a.h \ + lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \ + lzo_ptr.h stats1a.h stats1b.h stats1c.h miniacc.h + +liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS) +liblzo2_la_DEPENDENCIES = $(liblzo2_la_LIBADD) + + +# /*********************************************************************** +# // assembler support +# ************************************************************************/ + +if LZO_USE_ASM + +LZO_ASM_OBJECTS = \ + lzo1c_s1.lo lzo1c_s2.lo \ + lzo1f_f1.lo lzo1f_f2.lo \ + lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \ + lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo + +.S.o: + $(CC) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(CC) -c $< + +endif + diff --git a/thirdparty/lzo/2.03/src/Makefile.in b/thirdparty/lzo/2.03/src/Makefile.in new file mode 100644 index 0000000..90cf4e2 --- /dev/null +++ b/thirdparty/lzo/2.03/src/Makefile.in @@ -0,0 +1,600 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +@LZO_USE_ASM_TRUE@am__DEPENDENCIES_1 = lzo1c_s1.lo lzo1c_s2.lo \ +@LZO_USE_ASM_TRUE@ lzo1f_f1.lo lzo1f_f2.lo lzo1x_f1.lo \ +@LZO_USE_ASM_TRUE@ lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \ +@LZO_USE_ASM_TRUE@ lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo \ +@LZO_USE_ASM_TRUE@ lzo1y_s2.lo +am_liblzo2_la_OBJECTS = lzo_crc.lo lzo_init.lo lzo_ptr.lo lzo_str.lo \ + lzo_util.lo lzo1.lo lzo1_99.lo lzo1a.lo lzo1a_99.lo lzo1b_1.lo \ + lzo1b_2.lo lzo1b_3.lo lzo1b_4.lo lzo1b_5.lo lzo1b_6.lo \ + lzo1b_7.lo lzo1b_8.lo lzo1b_9.lo lzo1b_99.lo lzo1b_9x.lo \ + lzo1b_cc.lo lzo1b_d1.lo lzo1b_d2.lo lzo1b_rr.lo lzo1b_xx.lo \ + lzo1c_1.lo lzo1c_2.lo lzo1c_3.lo lzo1c_4.lo lzo1c_5.lo \ + lzo1c_6.lo lzo1c_7.lo lzo1c_8.lo lzo1c_9.lo lzo1c_99.lo \ + lzo1c_9x.lo lzo1c_cc.lo lzo1c_d1.lo lzo1c_d2.lo lzo1c_rr.lo \ + lzo1c_xx.lo lzo1f_1.lo lzo1f_9x.lo lzo1f_d1.lo lzo1f_d2.lo \ + lzo1x_1.lo lzo1x_9x.lo lzo1x_d1.lo lzo1x_d2.lo lzo1x_d3.lo \ + lzo1x_o.lo lzo1x_1k.lo lzo1x_1l.lo lzo1x_1o.lo lzo1y_1.lo \ + lzo1y_9x.lo lzo1y_d1.lo lzo1y_d2.lo lzo1y_d3.lo lzo1y_o.lo \ + lzo1z_9x.lo lzo1z_d1.lo lzo1z_d2.lo lzo1z_d3.lo lzo2a_9x.lo \ + lzo2a_d1.lo lzo2a_d2.lo +liblzo2_la_OBJECTS = $(am_liblzo2_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(liblzo2_la_SOURCES) +DIST_SOURCES = $(liblzo2_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +VPATH = @srcdir@@LZO_ASM_VPATH@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = $(LZO_CFLAGS) $(configure_CFLAGS) $(LZO_EXTRA_CFLAGS) +CPP = @CPP@ +CPPFLAGS = $(LZO_CPPFLAGS) $(configure_CPPFLAGS) $(LZO_EXTRA_CPPFLAGS) +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +SUFFIXES = .S +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) +lib_LTLIBRARIES = liblzo2.la +liblzo2_la_LDFLAGS = -version-info 2:0:0 +liblzo2_la_SOURCES = \ + lzo_crc.c lzo_init.c lzo_ptr.c lzo_str.c lzo_util.c \ + lzo1.c lzo1_99.c \ + lzo1a.c lzo1a_99.c \ + lzo1b_1.c lzo1b_2.c lzo1b_3.c lzo1b_4.c lzo1b_5.c lzo1b_6.c \ + lzo1b_7.c lzo1b_8.c lzo1b_9.c lzo1b_99.c lzo1b_9x.c \ + lzo1b_cc.c lzo1b_d1.c lzo1b_d2.c lzo1b_rr.c lzo1b_xx.c \ + lzo1c_1.c lzo1c_2.c lzo1c_3.c lzo1c_4.c lzo1c_5.c lzo1c_6.c \ + lzo1c_7.c lzo1c_8.c lzo1c_9.c lzo1c_99.c lzo1c_9x.c \ + lzo1c_cc.c lzo1c_d1.c lzo1c_d2.c lzo1c_rr.c lzo1c_xx.c \ + lzo1f_1.c lzo1f_9x.c lzo1f_d1.c lzo1f_d2.c \ + lzo1x_1.c lzo1x_9x.c lzo1x_d1.c lzo1x_d2.c lzo1x_d3.c \ + lzo1x_o.c lzo1x_1k.c lzo1x_1l.c lzo1x_1o.c \ + lzo1y_1.c lzo1y_9x.c lzo1y_d1.c lzo1y_d2.c lzo1y_d3.c lzo1y_o.c \ + lzo1z_9x.c lzo1z_d1.c lzo1z_d2.c lzo1z_d3.c \ + lzo2a_9x.c lzo2a_d1.c lzo2a_d2.c + +EXTRA_DIST = \ + lzo1_cm.ch lzo1_d.ch lzo1a_cm.ch lzo1a_cr.ch lzo1b_c.ch \ + lzo1b_cm.ch lzo1b_cr.ch lzo1b_d.ch lzo1b_r.ch \ + lzo1b_sm.ch lzo1b_tm.ch lzo1f_d.ch lzo1x_c.ch \ + lzo1x_d.ch lzo1x_oo.ch lzo2a_d.ch \ + lzo_dll.ch lzo_mchw.ch lzo_swd.ch \ + compr1b.h compr1c.h config1.h config1a.h config1b.h config1c.h \ + config1f.h config1x.h config1y.h config1z.h config2a.h \ + lzo1a_de.h lzo1b_cc.h lzo1b_de.h lzo1c_cc.h lzo_conf.h lzo_dict.h \ + lzo_ptr.h stats1a.h stats1b.h stats1c.h miniacc.h + +liblzo2_la_LIBADD = $(LZO_ASM_OBJECTS) +liblzo2_la_DEPENDENCIES = $(liblzo2_la_LIBADD) + +# /*********************************************************************** +# // assembler support +# ************************************************************************/ +@LZO_USE_ASM_TRUE@LZO_ASM_OBJECTS = \ +@LZO_USE_ASM_TRUE@ lzo1c_s1.lo lzo1c_s2.lo \ +@LZO_USE_ASM_TRUE@ lzo1f_f1.lo lzo1f_f2.lo \ +@LZO_USE_ASM_TRUE@ lzo1x_f1.lo lzo1x_f2.lo lzo1x_s1.lo lzo1x_s2.lo \ +@LZO_USE_ASM_TRUE@ lzo1y_f1.lo lzo1y_f2.lo lzo1y_s1.lo lzo1y_s2.lo + +all: all-am + +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblzo2.la: $(liblzo2_la_OBJECTS) $(liblzo2_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(liblzo2_la_LDFLAGS) $(liblzo2_la_OBJECTS) $(liblzo2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1_99.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1a_99.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_5.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_6.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_7.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_99.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_cc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_rr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1b_xx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_5.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_6.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_7.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_99.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_cc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_rr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1c_xx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1f_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1k.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1l.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_1o.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_d3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1x_o.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_d3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1y_o.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo1z_d3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_9x.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo2a_d2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_crc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_init.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_ptr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_str.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzo_util.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLTLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLTLIBRARIES + + +@LZO_USE_ASM_TRUE@.S.o: +@LZO_USE_ASM_TRUE@ $(CC) -c $< + +@LZO_USE_ASM_TRUE@.S.lo: +@LZO_USE_ASM_TRUE@ $(LIBTOOL) --mode=compile $(CC) -c $< +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/src/compr1b.h b/thirdparty/lzo/2.03/src/compr1b.h new file mode 100644 index 0000000..be0d200 --- /dev/null +++ b/thirdparty/lzo/2.03/src/compr1b.h @@ -0,0 +1,81 @@ +/* compr1b.h -- + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#include "config1b.h" + + +#if !defined(COMPRESS_ID) +#define COMPRESS_ID LZO_CPP_ECONCAT2(DD_BITS,CLEVEL) +#endif + + +#include "lzo1b_c.ch" + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_COMPRESS \ + LZO_CPP_ECONCAT3(lzo1b_,COMPRESS_ID,_compress) + +#define LZO_COMPRESS_FUNC \ + LZO_CPP_ECONCAT3(_lzo1b_,COMPRESS_ID,_compress_func) + + + +/*********************************************************************** +// +************************************************************************/ + +const lzo_compress_t LZO_COMPRESS_FUNC = do_compress; + +LZO_PUBLIC(int) +LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return _lzo1b_do_compress(in,in_len,out,out_len,wrkmem,do_compress); +} + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/compr1c.h b/thirdparty/lzo/2.03/src/compr1c.h new file mode 100644 index 0000000..8b29f9a --- /dev/null +++ b/thirdparty/lzo/2.03/src/compr1c.h @@ -0,0 +1,81 @@ +/* compr1c.h -- + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#include "config1c.h" + + +#if !defined(COMPRESS_ID) +#define COMPRESS_ID LZO_CPP_ECONCAT2(DD_BITS,CLEVEL) +#endif + + +#include "lzo1b_c.ch" + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_COMPRESS \ + LZO_CPP_ECONCAT3(lzo1c_,COMPRESS_ID,_compress) + +#define LZO_COMPRESS_FUNC \ + LZO_CPP_ECONCAT3(_lzo1c_,COMPRESS_ID,_compress_func) + + + +/*********************************************************************** +// +************************************************************************/ + +const lzo_compress_t LZO_COMPRESS_FUNC = do_compress; + +LZO_PUBLIC(int) +LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return _lzo1c_do_compress(in,in_len,out,out_len,wrkmem,do_compress); +} + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/config1.h b/thirdparty/lzo/2.03/src/config1.h new file mode 100644 index 0000000..b223150 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1.h @@ -0,0 +1,61 @@ +/* config1.h -- configuration for the LZO1 algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + +#ifndef __LZO_CONFIG1_H +#define __LZO_CONFIG1_H + +#include "lzo_conf.h" +#include "lzo/lzo1.h" + +#define LZO_NO_R1 +#include "config1a.h" + +#endif /* already included */ + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1a.h b/thirdparty/lzo/2.03/src/config1a.h new file mode 100644 index 0000000..4f9be44 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1a.h @@ -0,0 +1,196 @@ +/* config1a.h -- configuration for the LZO1A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1A_H +#define __LZO_CONFIG1A_H + +#include "lzo_conf.h" +#include "lzo/lzo1a.h" + +#undef LZO_COLLECT_STATS /* no support for stats here */ + + +/*********************************************************************** +// algorithm configuration +************************************************************************/ + +/* run bits (4 - 5) - the compressor and the decompressor + * must use the same value. */ +#if !defined(RBITS) +# define RBITS 5 +#endif + +/* dictionary depth (0 - 6) - this only affects the compressor. + * 0 is fastest, 6 is best compression ratio */ +#if !defined(DDBITS) +# define DDBITS 0 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* check configuration */ +#if (RBITS < 4 || RBITS > 5) +# error "invalid RBITS" +#endif +#if (DDBITS < 0 || DDBITS > 6) +# error "invalid DDBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// internal configuration +************************************************************************/ + +/* add a special code so that the decompressor can detect the + * end of the compressed data block (overhead is 3 bytes per block) */ +#undef LZO_EOF_CODE + + +/*********************************************************************** +// algorithm internal configuration +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif + +/* config */ +#define R_BITS RBITS +#define DD_BITS DDBITS +#ifndef D_BITS +#define D_BITS 16 +#endif + + +/*********************************************************************** +// optimization and debugging +************************************************************************/ + +/* Collect statistics */ +#if 0 && !defined(LZO_COLLECT_STATS) +# define LZO_COLLECT_STATS +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define M3O_BITS M2O_BITS +#define M3L_BITS CHAR_BIT +#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 1) +#define _MAX_OFFSET _M2_MAX_OFFSET +#define LZO_NO_M3 + +#include "lzo1b_de.h" +#include "stats1b.h" + +#include "lzo1b_cc.h" + + +/*********************************************************************** +// check for total LZO1/LZO1A compatibility +************************************************************************/ + +#undef M2_MARKER +#define M2_MARKER (1 << M2O_BITS) + +#if (R_BITS != 5) +# error +#endif +#if (M2O_BITS != 5) +# error +#endif +#if (M3O_BITS != 5) +# error +#endif +#if (M2_MIN_LEN != 3) +# error +#endif +#if (M2_MAX_LEN != 8) +# error +#endif +#if (M3_MIN_LEN != 9) +# error +#endif +#if (M3_MAX_LEN != 264) +# error +#endif +#if (_M2_MAX_OFFSET != (1u << 13)) +# error +#endif +#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET) +# error +#endif +#if (_M2_MAX_OFFSET != _MAX_OFFSET) +# error +#endif +#if (R0MIN != 32) +# error +#endif +#if (R0MAX != 287) +# error +#endif +#if (R0FAST != 280) +# error +#endif + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1b.h b/thirdparty/lzo/2.03/src/config1b.h new file mode 100644 index 0000000..f471f4f --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1b.h @@ -0,0 +1,140 @@ +/* config1b.h -- configuration for the LZO1B algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1B_H +#define __LZO_CONFIG1B_H + +#include "lzo_conf.h" +#include "lzo/lzo1b.h" + + +/*********************************************************************** +// algorithm configuration +************************************************************************/ + +/* run bits (4 - 5) - the compressor and the decompressor + * must use the same value. */ +#if !defined(RBITS) +# define RBITS 5 +#endif + +/* dictionary depth (0 - 6) - this only affects the compressor. + * 0 is fastest, 6 is best compression ratio */ +#if !defined(DDBITS) +# define DDBITS 0 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* check configuration */ +#if (RBITS < 4 || RBITS > 5) +# error "invalid RBITS" +#endif +#if (DDBITS < 0 || DDBITS > 6) +# error "invalid DDBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// internal configuration +************************************************************************/ + +/* add a special code so that the decompressor can detect the + * end of the compressed data block (overhead is 3 bytes per block) */ +#define LZO_EOF_CODE + + +/*********************************************************************** +// algorithm internal configuration +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif + +/* config */ +#define R_BITS RBITS +#define DD_BITS DDBITS +#ifndef D_BITS +#define D_BITS 14 +#endif + + +/*********************************************************************** +// optimization and debugging +************************************************************************/ + +/* Collect statistics */ +#if 0 && !defined(LZO_COLLECT_STATS) +# define LZO_COLLECT_STATS +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo1b_de.h" +#include "stats1b.h" + +#include "lzo1b_cc.h" + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1c.h b/thirdparty/lzo/2.03/src/config1c.h new file mode 100644 index 0000000..e8d566f --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1c.h @@ -0,0 +1,145 @@ +/* config1c.h -- configuration for the LZO1C algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1C_H +#define __LZO_CONFIG1C_H + +#include "lzo_conf.h" +#include "lzo/lzo1c.h" + + +/*********************************************************************** +// algorithm configuration +************************************************************************/ + +/* run bits (4 - 5) - the compressor and the decompressor + * must use the same value. */ +#if !defined(RBITS) +# define RBITS 5 +#endif + +/* dictionary depth (0 - 6) - this only affects the compressor. + * 0 is fastest, 6 is best compression ratio */ +#if !defined(DDBITS) +# define DDBITS 0 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* check configuration */ +#if (RBITS < 4 || RBITS > 5) +# error "invalid RBITS" +#endif +#if (DDBITS < 0 || DDBITS > 6) +# error "invalid DDBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// internal configuration +************************************************************************/ + +/* add a special code so that the decompressor can detect the + * end of the compressed data block (overhead is 3 bytes per block) */ +#define LZO_EOF_CODE + + +/*********************************************************************** +// algorithm internal configuration +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif + +/* config */ +#define R_BITS RBITS +#define DD_BITS DDBITS +#ifndef D_BITS +#define D_BITS 14 +#endif + + +/*********************************************************************** +// optimization and debugging +************************************************************************/ + +/* Collect statistics */ +#if 0 && !defined(LZO_COLLECT_STATS) +# define LZO_COLLECT_STATS +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* good parameters when using a blocksize of 8kB */ +#define M3O_BITS 6 +#undef LZO_DETERMINISTIC + + +#include "lzo1b_de.h" +#include "stats1c.h" + +#include "lzo1c_cc.h" + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1f.h b/thirdparty/lzo/2.03/src/config1f.h new file mode 100644 index 0000000..cb4d4c1 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1f.h @@ -0,0 +1,97 @@ +/* config1f.h -- configuration for the LZO1F algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1F_H +#define __LZO_CONFIG1F_H + +#include "lzo_conf.h" +#include "lzo/lzo1f.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_EOF_CODE +#undef LZO_DETERMINISTIC + +#define M2_MAX_OFFSET 0x0800 +#define M3_MAX_OFFSET 0x3fff + +#define M2_MIN_LEN 3 +#define M2_MAX_LEN 8 +#define M3_MIN_LEN 3 +#define M3_MAX_LEN 33 + +#define M3_MARKER 224 + + +/*********************************************************************** +// +************************************************************************/ + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif + +#if defined(LZO_NEED_DICT_H) + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif +#define DL_MIN_LEN M2_MIN_LEN +#include "lzo_dict.h" + +#endif + + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1x.h b/thirdparty/lzo/2.03/src/config1x.h new file mode 100644 index 0000000..e123bf3 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1x.h @@ -0,0 +1,118 @@ +/* config1x.h -- configuration for the LZO1X algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1X_H +#define __LZO_CONFIG1X_H + +#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) +# define LZO1X +#endif + +#include "lzo_conf.h" +#if !defined(__LZO_IN_MINILZO) +#include "lzo/lzo1x.h" +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_EOF_CODE +#undef LZO_DETERMINISTIC + +#define M1_MAX_OFFSET 0x0400 +#ifndef M2_MAX_OFFSET +#define M2_MAX_OFFSET 0x0800 +#endif +#define M3_MAX_OFFSET 0x4000 +#define M4_MAX_OFFSET 0xbfff + +#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET) + +#define M1_MIN_LEN 2 +#define M1_MAX_LEN 2 +#define M2_MIN_LEN 3 +#ifndef M2_MAX_LEN +#define M2_MAX_LEN 8 +#endif +#define M3_MIN_LEN 3 +#define M3_MAX_LEN 33 +#define M4_MIN_LEN 3 +#define M4_MAX_LEN 9 + +#define M1_MARKER 0 +#define M2_MARKER 64 +#define M3_MARKER 32 +#define M4_MARKER 16 + + +/*********************************************************************** +// +************************************************************************/ + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif + +#if defined(LZO_NEED_DICT_H) + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B +#endif +#define DL_MIN_LEN M2_MIN_LEN +#include "lzo_dict.h" + +#endif + + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1y.h b/thirdparty/lzo/2.03/src/config1y.h new file mode 100644 index 0000000..84d546a --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1y.h @@ -0,0 +1,66 @@ +/* config1y.h -- configuration for the LZO1Y algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1Y_H +#define __LZO_CONFIG1Y_H + +#if !defined(LZO1Y) +# define LZO1Y +#endif + +#include "lzo_conf.h" +#include "lzo/lzo1y.h" + +#define M2_MAX_LEN 14 +#define M2_MAX_OFFSET 0x0400 +#include "config1x.h" + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config1z.h b/thirdparty/lzo/2.03/src/config1z.h new file mode 100644 index 0000000..5762af3 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config1z.h @@ -0,0 +1,65 @@ +/* config1z.h -- configuration for the LZO1Z algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG1Z_H +#define __LZO_CONFIG1Z_H + +#if !defined(LZO1Z) +# define LZO1Z +#endif + +#include "lzo_conf.h" +#include "lzo/lzo1z.h" + +#define M2_MAX_OFFSET 0x0700 +#include "config1x.h" + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/config2a.h b/thirdparty/lzo/2.03/src/config2a.h new file mode 100644 index 0000000..ba38ca5 --- /dev/null +++ b/thirdparty/lzo/2.03/src/config2a.h @@ -0,0 +1,155 @@ +/* config2a.h -- configuration for the LZO2A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONFIG2A_H +#define __LZO_CONFIG2A_H + +#include "lzo_conf.h" +#include "lzo/lzo2a.h" + + +/*********************************************************************** +// algorithm configuration +************************************************************************/ + +/* dictionary depth (0 - 6) - this only affects the compressor. + * 0 is fastest, 6 is best compression ratio */ +#if !defined(DDBITS) +# define DDBITS 0 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* check configuration */ +#if (DDBITS < 0 || DDBITS > 6) +# error "invalid DDBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// internal configuration +************************************************************************/ + +#if 1 +#define N 8191 /* size of ring buffer */ +#else +#define N 16383 /* size of ring buffer */ +#endif + +#define M1_MIN_LEN 2 +#define M1_MAX_LEN 5 +#define M2_MIN_LEN 3 +#define M3_MIN_LEN 3 + + +/* add a special code so that the decompressor can detect the + * end of the compressed data block (overhead is 3 bytes per block) */ +#define LZO_EOF_CODE + +#undef LZO_DETERMINISTIC + + +/*********************************************************************** +// algorithm internal configuration +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif + +/* config */ +#define DD_BITS DDBITS +#ifndef D_BITS +#define D_BITS 14 +#endif + + + +/*********************************************************************** +// optimization and debugging +************************************************************************/ + +/* Collect statistics */ +#if 0 && !defined(LZO_COLLECT_STATS) +# define LZO_COLLECT_STATS +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* get bits */ +#define _NEEDBITS \ + { _NEEDBYTE; b |= ((lzo_uint32) _NEXTBYTE) << k; k += 8; assert(k <= 32); } +#define NEEDBITS(j) { assert((j) < 8); if (k < (j)) _NEEDBITS } + +/* set bits */ +#define SETBITS(j,x) { b |= (x) << k; k += (j); assert(k <= 32); } + +/* access bits */ +#define MASKBITS(j) (b & ((((lzo_uint32)1 << (j)) - 1))) + +/* drop bits */ +#define DUMPBITS(j) { assert(k >= j); b >>= (j); k -= (j); } + + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1.c b/thirdparty/lzo/2.03/src/lzo1.c new file mode 100644 index 0000000..de23164 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1.c @@ -0,0 +1,635 @@ +/* lzo1.c -- implementation of the LZO1 algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" +#include "lzo/lzo1.h" + + +/*********************************************************************** +// The next two defines can be changed to customize LZO1. +// The default version is LZO1-5/1. +************************************************************************/ + +/* run bits (3 - 5) - the compressor and the decompressor + * must use the same value. */ +#if !defined(RBITS) +# define RBITS 5 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* check configuration */ +#if (RBITS < 3 || RBITS > 5) +# error "invalid RBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// You should not have to change anything below this line. +************************************************************************/ + +/* + Format of the marker byte + + + 76543210 + -------- + 00000000 a long run (a 'R0' run) - there are short and long R0 runs + 000rrrrr a short run with len r + mmmooooo a short match (len = 2+m, o = offset low bits) + 111ooooo a long match (o = offset low bits) +*/ + + +#define RSIZE (1 << RBITS) +#define RMASK (RSIZE - 1) + +#define OBITS RBITS /* offset and run-length use same bits */ +#define OSIZE (1 << OBITS) +#define OMASK (OSIZE - 1) + +#define MBITS (8 - OBITS) +#define MSIZE (1 << MBITS) +#define MMASK (MSIZE - 1) + + +/* sanity checks */ +#if (OBITS < 3 || OBITS > 5) +# error "invalid OBITS" +#endif +#if (MBITS < 3 || MBITS > 5) +# error "invalid MBITS" +#endif + + +/*********************************************************************** +// some macros to improve readability +************************************************************************/ + +/* Minimum len of a match */ +#define MIN_MATCH 3 +#define THRESHOLD (MIN_MATCH - 1) + +/* Minimum len of match coded in 2 bytes */ +#define MIN_MATCH_SHORT MIN_MATCH + +/* Maximum len of match coded in 2 bytes */ +#define MAX_MATCH_SHORT (THRESHOLD + (MSIZE - 2)) +/* MSIZE - 2: 0 is used to indicate runs, + * MSIZE-1 is used to indicate a long match */ + +/* Minimum len of match coded in 3 bytes */ +#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1) + +/* Maximum len of match coded in 3 bytes */ +#define MAX_MATCH_LONG (MIN_MATCH_LONG + 255) + +/* Maximum offset of a match */ +#define MAX_OFFSET (1 << (8 + OBITS)) + + +/* + +RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST +======+=============================================================== + 3 | 5 3 2 32 32 33 288 2048 263 256 + 4 | 4 3 2 16 16 17 272 4096 271 264 + 5 | 3 3 2 8 8 9 264 8192 287 280 + + */ + + +/*********************************************************************** +// internal configuration +// all of these affect compression only +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,5,5)) >> 5) +#define D_INDEX2(d,p) d = d ^ D_MASK + +#define DBITS (8 + RBITS) +#include "lzo_dict.h" +#define DVAL_LEN DVAL_LOOKAHEAD + + +/*********************************************************************** +// get algorithm info, return memory required for compression +************************************************************************/ + +LZO_EXTERN(lzo_uint) lzo1_info ( int *rbits, int *clevel ); + +LZO_PUBLIC(lzo_uint) +lzo1_info ( int *rbits, int *clevel ) +{ + if (rbits) + *rbits = RBITS; + if (clevel) + *clevel = CLEVEL; + return D_SIZE * lzo_sizeof(lzo_bytep); +} + + +/*********************************************************************** +// decode a R0 literal run (a long run) +************************************************************************/ + +#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */ +#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */ +#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */ + +#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0) +# error "something went wrong" +#endif + +/* 7 special codes from R0FAST+1 .. R0MAX + * these codes mean long R0 runs with lengths + * 512, 1024, 2048, 4096, 8192, 16384, 32768 */ + + +/*********************************************************************** +// LZO1 decompress a block of data. +// +// Could be easily translated into assembly code. +************************************************************************/ + +LZO_PUBLIC(int) +lzo1_decompress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op; + const lzo_bytep ip; + const lzo_bytep const ip_end = in + in_len; + lzo_uint t; + + LZO_UNUSED(wrkmem); + + op = out; + ip = in; + while (ip < ip_end) + { + t = *ip++; /* get marker */ + + if (t < R0MIN) /* a literal run */ + { + if (t == 0) /* a R0 literal run */ + { + t = *ip++; + if (t >= R0FAST - R0MIN) /* a long R0 run */ + { + t -= R0FAST - R0MIN; + if (t == 0) + t = R0FAST; + else + { +#if 0 + t = 256u << ((unsigned) t); +#else + /* help the optimizer */ + lzo_uint tt = 256; + do tt <<= 1; while (--t > 0); + t = tt; +#endif + } + MEMCPY8_DS(op,ip,t); + continue; + } + t += R0MIN; + } + MEMCPY_DS(op,ip,t); + } + else /* a match */ + { + lzo_uint tt; + /* get match offset */ + const lzo_bytep m_pos = op - 1; + m_pos -= (lzo_uint)(t & OMASK) | (((lzo_uint) *ip++) << OBITS); + + /* get match len */ + if (t >= ((MSIZE - 1) << OBITS)) /* all m-bits set */ + tt = (MIN_MATCH_LONG - THRESHOLD) + *ip++; /* a long match */ + else + tt = t >> OBITS; /* a short match */ + + assert(m_pos >= out); + assert(m_pos < op); + /* a half unrolled loop */ + *op++ = *m_pos++; + *op++ = *m_pos++; + MEMCPY_DS(op,m_pos,tt); + } + } + + *out_len = pd(op, out); + + /* the next line is the only check in the decompressor ! */ + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); +} + + +/*********************************************************************** +// code a literal run +************************************************************************/ + +static +#if LZO_ARCH_AVR +__lzo_noinline +#endif +lzo_bytep +store_run(lzo_bytep op, const lzo_bytep ii, lzo_uint r_len) +{ + assert(r_len > 0); + + /* code a long R0 run */ + if (r_len >= 512) + { + unsigned r_bits = 7; /* 256 << 7 == 32768 */ + do { + while (r_len >= (256u << r_bits)) + { + r_len -= (256u << r_bits); + *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits); + MEMCPY8_DS(op, ii, (256u << r_bits)); + } + } while (--r_bits > 0); + } + while (r_len >= R0FAST) + { + r_len -= R0FAST; + *op++ = 0; *op++ = R0FAST - R0MIN; + MEMCPY8_DS(op, ii, R0FAST); + } + + if (r_len >= R0MIN) + { + /* code a short R0 run */ + *op++ = 0; *op++ = LZO_BYTE(r_len - R0MIN); + MEMCPY_DS(op, ii, r_len); + } + else if (r_len > 0) + { + /* code a 'normal' run */ + *op++ = LZO_BYTE(r_len); + MEMCPY_DS(op, ii, r_len); + } + + assert(r_len == 0); + return op; +} + + + +/*********************************************************************** +// LZO1 compress a block of data. +// +// Could be translated into assembly code without too much effort. +// +// I apologize for the spaghetti code, but it really helps the optimizer. +************************************************************************/ + +static int +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + const lzo_bytep ip; +#if defined(__LZO_HASH_INCREMENTAL) + lzo_xint dv; +#endif + lzo_bytep op; + const lzo_bytep m_pos; + const lzo_bytep const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG; + const lzo_bytep const in_end = in+in_len - DVAL_LEN; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + +#if !defined(NDEBUG) + const lzo_bytep m_pos_sav; +#endif + + op = out; + ip = in; + ii = ip; /* point to start of literal run */ + if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1) + goto the_end; + + /* init dictionary */ +#if defined(LZO_DETERMINISTIC) + BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE); +#endif + + DVAL_FIRST(dv,ip); + UPDATE_D(dict,0,dv,ip,in); + ip++; + DVAL_NEXT(dv,ip); + + do { + lzo_uint m_off; + lzo_uint dindex; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET)) + goto literal; + if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) + goto match; + DINDEX2(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS(m_pos,m_off,in,ip,MAX_OFFSET)) + goto literal; + if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) + goto match; + goto literal; + + +literal: + UPDATE_I(dict,0,dindex,ip,in); + if (++ip >= ip_end) + break; + continue; + +match: + UPDATE_I(dict,0,dindex,ip,in); +#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR) + m_pos_sav = m_pos; +#endif + m_pos += 3; + { + /* we have found a match (of at least length 3) */ +#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR) + assert((m_pos_sav = ip - m_off) == (m_pos - 3)); +#endif + /* 1) store the current literal run */ + if (pd(ip,ii) > 0) + { + lzo_uint t = pd(ip,ii); +#if 1 + /* OPTIMIZED: inline the copying of a short run */ + if (t < R0MIN) + { + *op++ = LZO_BYTE(t); + MEMCPY_DS(op, ii, t); + } + else +#endif + op = store_run(op,ii,t); + } + + /* 2a) compute match len */ + ii = ip; /* point to start of current match */ + + /* we already matched MIN_MATCH bytes, + * m_pos also already advanced MIN_MATCH bytes */ + ip += MIN_MATCH; + assert(m_pos < ip); + + /* try to match another MIN_MATCH_LONG - MIN_MATCH bytes + * to see if we get a long match */ + +#define PS *m_pos++ != *ip++ + +#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */ + if (PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */ + if (PS || PS || PS || PS || PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */ + if (PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */ + if (PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS) +#else +# error "MBITS not yet implemented" +#endif + { + lzo_uint m_len; + + /* 2b) code a short match */ + assert(pd(ip,m_pos) == m_off); + --ip; /* ran one too far, point back to non-match */ + m_len = pd(ip, ii); + assert(m_len >= MIN_MATCH_SHORT); + assert(m_len <= MAX_MATCH_SHORT); + assert(m_off > 0); + assert(m_off <= MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + --m_off; + /* code short match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) | + (m_off & OMASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> OBITS); + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ + +#define SI /* nothing */ +#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in); +#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip)); + +#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + ++ii; + do { + DVAL_NEXT(dv,ii); + UPDATE_D(dict,0,dv,ii,in); + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + + } + else + { + /* we've found a long match - see how far we can still go */ + const lzo_bytep end; + lzo_uint m_len; + + assert(ip <= in_end); + assert(ii == ip - MIN_MATCH_LONG); + + if (pd(in_end,ip) <= (MAX_MATCH_LONG - MIN_MATCH_LONG)) + end = in_end; + else + { + end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG); + assert(end < in_end); + } + + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + assert(ip <= in_end); + + /* 2b) code the long match */ + m_len = pd(ip, ii); + assert(m_len >= MIN_MATCH_LONG); + assert(m_len <= MAX_MATCH_LONG); + assert(m_off > 0); + assert(m_off <= MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + assert(pd(ip,m_pos) == m_off); + --m_off; + /* code long match flag + low offset bits */ + *op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> OBITS); + /* code match len */ + *op++ = LZO_BYTE(m_len - MIN_MATCH_LONG); + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ +#if (CLEVEL == 9) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + /* This is not recommended because it is slow. */ + ++ii; + do { + DVAL_NEXT(dv,ii); + UPDATE_D(dict,0,dv,ii,in); + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 8) + SI DI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 7) + SI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 6) + SI DI DI DI DI DI DI XI +#elif (CLEVEL >= 5) + SI DI DI DI DI XI +#elif (CLEVEL >= 4) + SI DI DI DI XI +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + /* ii now points to the start of next literal run */ + assert(ii == ip); + } + } while (ip < ip_end); + + + +the_end: + assert(ip <= in_end); + + +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + /* return -1 if op == out to indicate that we + * couldn't compress and didn't copy anything. + */ + if (op == out) + { + *out_len = 0; + return LZO_E_NOT_COMPRESSIBLE; + } +#endif + + + /* store the final literal run */ + if (pd(in_end+DVAL_LEN,ii) > 0) + op = store_run(op,ii,pd(in_end+DVAL_LEN,ii)); + + *out_len = pd(op, out); + return 0; /* compression went ok */ +} + + +/*********************************************************************** +// compress public entry point. +************************************************************************/ + +LZO_PUBLIC(int) +lzo1_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + int r = LZO_E_OK; + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + *out_len = 0; + else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(store_run(out,in,in_len), out); +#endif + } + else + r = do_compress(in,in_len,out,out_len,wrkmem); + + return r; +} + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1_99.c b/thirdparty/lzo/2.03/src/lzo1_99.c new file mode 100644 index 0000000..c1952d8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1_99.c @@ -0,0 +1,130 @@ +/* lzo1_99.c -- implementation of the LZO1-99 algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +#define COMPRESS_ID 99 + +#define DDBITS 3 +#define CLEVEL 9 + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_NEED_DICT_H +#include "config1.h" + + +/*********************************************************************** +// compression internal entry point. +************************************************************************/ + +static int +_lzo1_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ) +{ + int r; + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + { + *out_len = 0; + r = LZO_E_OK; + } + else if (in_len <= MIN_LOOKAHEAD + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + *out_len = 0; + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(STORE_RUN(out,in,in_len), out); + r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR; +#endif + } + else + r = func(in,in_len,out,out_len,wrkmem); + + return r; +} + + +/*********************************************************************** +// +************************************************************************/ + +#if !defined(COMPRESS_ID) +#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL) +#endif + + +#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1_cm.ch" +#include "lzo1b_c.ch" + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_COMPRESS \ + LZO_CPP_ECONCAT3(lzo1_,COMPRESS_ID,_compress) + +#define LZO_COMPRESS_FUNC \ + LZO_CPP_ECONCAT3(_lzo1_,COMPRESS_ID,_compress_func) + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return _lzo1_do_compress(in,in_len,out,out_len,wrkmem,do_compress); +} + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1_cm.ch b/thirdparty/lzo/2.03/src/lzo1_cm.ch new file mode 100644 index 0000000..f0116f4 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1_cm.ch @@ -0,0 +1,52 @@ +/* lzo1_cm.ch -- implementation of the LZO1 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#include "lzo1a_cm.ch" + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1_d.ch b/thirdparty/lzo/2.03/src/lzo1_d.ch new file mode 100644 index 0000000..c1dad39 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1_d.ch @@ -0,0 +1,155 @@ +/* lzo1_d.ch -- common decompression stuff + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND +# endif +#endif + + +/*********************************************************************** +// Overrun detection is internally handled by these macros: +// +// TEST_IP test input overrun at loop begin +// NEED_IP test input overrun at every input byte +// +// TEST_OP test output overrun at loop begin +// NEED_OP test output overrun at every output byte +// +// TEST_LB test match postion +// +// The fastest decompressor results when testing for no overruns +// and using LZO_EOF_CODE. +************************************************************************/ + +#undef TEST_IP +#undef TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP /* don't need both of the tests here */ +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) + /* if we have no EOF code, we have to test for the end of the input */ +# define TEST_IP (ip < ip_end) +#endif + + +#if defined(TEST_IP) +# define HAVE_TEST_IP +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP +#else +# define TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP +#else +# define NEED_IP(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP +#else +# define NEED_OP(x) ((void) 0) +#endif + + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP +#endif + + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1a.c b/thirdparty/lzo/2.03/src/lzo1a.c new file mode 100644 index 0000000..c571359 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1a.c @@ -0,0 +1,657 @@ +/* lzo1a.c -- implementation of the LZO1A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" +#include "lzo/lzo1a.h" + + +/*********************************************************************** +// The next two defines can be changed to customize LZO1A. +// The default version is LZO1A-5/1. +************************************************************************/ + +/* run bits (3 - 5) - the compressor and the decompressor + * must use the same value. */ +#if !defined(RBITS) +# define RBITS 5 +#endif + +/* compression level (1 - 9) - this only affects the compressor. + * 1 is fastest, 9 is best compression ratio + */ +#if !defined(CLEVEL) +# define CLEVEL 1 /* fastest by default */ +#endif + + +/* Collect statistics */ +#if 0 && !defined(LZO_COLLECT_STATS) +# define LZO_COLLECT_STATS +#endif + + +/*********************************************************************** +// You should not have to change anything below this line. +************************************************************************/ + +/* check configuration */ +#if (RBITS < 3 || RBITS > 5) +# error "invalid RBITS" +#endif +#if (CLEVEL < 1 || CLEVEL > 9) +# error "invalid CLEVEL" +#endif + + +/*********************************************************************** +// internal configuration +// all of these affect compression only +************************************************************************/ + +/* choose the hashing strategy */ +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,5,5)) >> 5) +#define D_INDEX2(d,p) d = d ^ D_MASK + +#include "lzo1a_de.h" +#include "stats1a.h" + + +/* check other constants */ +#if (LBITS < 5 || LBITS > 8) +# error "invalid LBITS" +#endif + + +#if defined(LZO_COLLECT_STATS) + static lzo1a_stats_t lzo_statistics; + lzo1a_stats_t *lzo1a_stats = &lzo_statistics; +# define lzo_stats lzo1a_stats +#endif + + +/*********************************************************************** +// get algorithm info, return memory required for compression +************************************************************************/ + +LZO_EXTERN(lzo_uint) lzo1a_info ( int *rbits, int *clevel ); + +LZO_PUBLIC(lzo_uint) +lzo1a_info ( int *rbits, int *clevel ) +{ + if (rbits) + *rbits = RBITS; + if (clevel) + *clevel = CLEVEL; + return D_SIZE * lzo_sizeof(lzo_bytep); +} + + +/*********************************************************************** +// LZO1A decompress a block of data. +// +// Could be easily translated into assembly code. +************************************************************************/ + +LZO_PUBLIC(int) +lzo1a_decompress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; + register const lzo_bytep m_pos; + const lzo_bytep const ip_end = in + in_len; + + LZO_UNUSED(wrkmem); + + op = out; + ip = in; + while (ip < ip_end) + { + t = *ip++; /* get marker */ + LZO_STATS(lzo_stats->marker[t]++); + + if (t == 0) /* a R0 literal run */ + { + t = *ip++; + if (t >= R0FAST - R0MIN) /* a long R0 run */ + { + t -= R0FAST - R0MIN; + if (t == 0) + t = R0FAST; + else + { +#if 0 + t = 256u << ((unsigned) t); +#else + /* help the optimizer */ + lzo_uint tt = 256; + do tt <<= 1; while (--t > 0); + t = tt; +#endif + } + MEMCPY8_DS(op,ip,t); + continue; + } + t += R0MIN; + goto literal; + } + else if (t < R0MIN) /* a short literal run */ + { +literal: + MEMCPY_DS(op,ip,t); + + /* after a literal a match must follow */ + while (ip < ip_end) + { + t = *ip++; /* get R1 marker */ + if (t >= R0MIN) + goto match; + + /* R1 match - a context sensitive 3 byte match + 1 byte literal */ + assert((t & OMASK) == t); + m_pos = op - MIN_OFFSET; + m_pos -= t | (((lzo_uint) *ip++) << OBITS); + assert(m_pos >= out); assert(m_pos < op); + *op++ = *m_pos++; + *op++ = *m_pos++; + *op++ = *m_pos++; + *op++ = *ip++; + } + } + else /* a match */ + { +match: + /* get match offset */ + m_pos = op - MIN_OFFSET; + m_pos -= (t & OMASK) | (((lzo_uint) *ip++) << OBITS); + assert(m_pos >= out); assert(m_pos < op); + + /* get match len */ + if (t < ((MSIZE - 1) << OBITS)) /* a short match */ + { + t >>= OBITS; + *op++ = *m_pos++; + *op++ = *m_pos++; + MEMCPY_DS(op,m_pos,t); + } + else /* a long match */ + { +#if (LBITS < 8) + t = (MIN_MATCH_LONG - THRESHOLD) + ((lzo_uint)(*ip++) & LMASK); +#else + t = (MIN_MATCH_LONG - THRESHOLD) + (lzo_uint)(*ip++); +#endif + *op++ = *m_pos++; + *op++ = *m_pos++; + MEMCPY_DS(op,m_pos,t); +#if (LBITS < 8) + /* a very short literal following a long match */ + t = ip[-1] >> LBITS; + if (t) do + *op++ = *ip++; + while (--t); +#endif + } + } + } + + *out_len = pd(op, out); + + /* the next line is the only check in the decompressor */ + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); +} + + + +/*********************************************************************** +// LZO1A compress a block of data. +// +// I apologize for the spaghetti code, but it really helps the optimizer. +************************************************************************/ + +#include "lzo1a_cr.ch" + +static int +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; +#if defined(__LZO_HASH_INCREMENTAL) + lzo_xint dv; +#endif + const lzo_bytep m_pos; + lzo_bytep op; + const lzo_bytep const ip_end = in+in_len - DVAL_LEN - MIN_MATCH_LONG; + const lzo_bytep const in_end = in+in_len - DVAL_LEN; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + const lzo_bytep r1 = ip_end; /* pointer for R1 match (none yet) */ +#if (LBITS < 8) + const lzo_bytep im = ip_end; /* pointer to last match start */ +#endif + +#if !defined(NDEBUG) + const lzo_bytep m_pos_sav; +#endif + + op = out; + ip = in; + ii = ip; /* point to start of current literal run */ + + /* init dictionary */ +#if defined(LZO_DETERMINISTIC) + BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE); +#endif + + DVAL_FIRST(dv,ip); UPDATE_D(dict,0,dv,ip,in); ip++; + DVAL_NEXT(dv,ip); + + do { + lzo_uint m_off; + lzo_uint dindex; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,MAX_OFFSET)) + goto literal; + if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) + goto match; + DINDEX2(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,MAX_OFFSET)) + goto literal; + if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) + goto match; + goto literal; + +literal: + UPDATE_I(dict,0,dindex,ip,in); + if (++ip >= ip_end) + break; + continue; + +match: + UPDATE_I(dict,0,dindex,ip,in); +#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR) + assert(m_pos == NULL || m_pos >= in); + m_pos_sav = m_pos; +#endif + m_pos += 3; + { + /* we have found a match (of at least length 3) */ + +#if !defined(NDEBUG) && !defined(LZO_DICT_USE_PTR) + assert((m_pos_sav = ip - m_off) == (m_pos - 3)); +#endif + + assert(m_pos >= in); + assert(ip < ip_end); + + /* 1) store the current literal run */ + if (pd(ip,ii) > 0) + { + lzo_uint t = pd(ip,ii); + + if (ip - r1 == MIN_MATCH + 1) + { + /* Code a context sensitive R1 match. + * This is tricky and somewhat difficult to explain: + * multiplex a literal run of length 1 into the previous + * short match of length MIN_MATCH. + * The key idea is: + * - after a short run a match MUST follow + * - therefore the value m = 000 in the mmmooooo marker is free + * - use 000ooooo to indicate a MIN_MATCH match (this + * is already coded) plus a 1 byte literal + */ + assert(t == 1); + /* modify marker byte */ + assert((op[-2] >> OBITS) == (MIN_MATCH - THRESHOLD)); + op[-2] &= OMASK; + assert((op[-2] >> OBITS) == 0); + /* copy 1 literal */ + *op++ = *ii; + LZO_STATS(lzo_stats->r1_matches++); + r1 = ip; /* set new R1 pointer */ + } + else if (t < R0MIN) + { + /* inline the copying of a short run */ +#if (LBITS < 8) + if (t < (1 << (8-LBITS)) && ii - im >= MIN_MATCH_LONG) + { + /* Code a very short literal run into the + * previous long match length byte. + */ + LZO_STATS(lzo_stats->lit_runs_after_long_match++); + LZO_STATS(lzo_stats->lit_run_after_long_match[t]++); + assert(ii - im <= MAX_MATCH_LONG); + assert((op[-1] >> LBITS) == 0); + op[-1] |= t << LBITS; + MEMCPY_DS(op, ii, t); + } + else +#endif + { + LZO_STATS(lzo_stats->lit_runs++); + LZO_STATS(lzo_stats->lit_run[t]++); + *op++ = LZO_BYTE(t); + MEMCPY_DS(op, ii, t); + r1 = ip; /* set new R1 pointer */ + } + } + else if (t < R0FAST) + { + /* inline the copying of a short R0 run */ + LZO_STATS(lzo_stats->r0short_runs++); + *op++ = 0; *op++ = LZO_BYTE(t - R0MIN); + MEMCPY_DS(op, ii, t); + r1 = ip; /* set new R1 pointer */ + } + else + op = store_run(op,ii,t); + } +#if (LBITS < 8) + im = ip; +#endif + + + /* 2) compute match len */ + ii = ip; /* point to start of current match */ + + /* we already matched MIN_MATCH bytes, + * m_pos also already advanced MIN_MATCH bytes */ + ip += MIN_MATCH; + assert(m_pos < ip); + + /* try to match another MIN_MATCH_LONG - MIN_MATCH bytes + * to see if we get a long match */ + +#define PS *m_pos++ != *ip++ + +#if (MIN_MATCH_LONG - MIN_MATCH == 2) /* MBITS == 2 */ + if (PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 6) /* MBITS == 3 */ + if (PS || PS || PS || PS || PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 14) /* MBITS == 4 */ + if (PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS) +#elif (MIN_MATCH_LONG - MIN_MATCH == 30) /* MBITS == 5 */ + if (PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS || PS || PS || + PS || PS || PS || PS || PS || PS) +#else +# error "MBITS not yet implemented" +#endif + { + /* we've found a short match */ + lzo_uint m_len; + + /* 2a) compute match parameters */ + assert(ip-m_pos == (int)m_off); + --ip; /* ran one too far, point back to non-match */ + m_len = pd(ip, ii); + assert(m_len >= MIN_MATCH_SHORT); + assert(m_len <= MAX_MATCH_SHORT); + assert(m_off >= MIN_OFFSET); + assert(m_off <= MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + m_off -= MIN_OFFSET; + + /* 2b) code a short match */ + /* code short match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - THRESHOLD) << OBITS) | + (m_off & OMASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> OBITS); + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->short_matches++; + lzo_stats->short_match[m_len]++; + if (m_off < OSIZE) + lzo_stats->short_match_offset_osize[m_len]++; + if (m_off < 256) + lzo_stats->short_match_offset_256[m_len]++; + if (m_off < 1024) + lzo_stats->short_match_offset_1024[m_len]++; +#endif + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ + +#define SI /* nothing */ +#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,0,dv,ii,in); +#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip)); + +#if (CLEVEL == 9) || (CLEVEL >= 7 && MBITS <= 4) || (CLEVEL >= 5 && MBITS <= 3) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + ++ii; + do { + DVAL_NEXT(dv,ii); + UPDATE_D(dict,0,dv,ii,in); + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + + } + else + { + /* we've found a long match - see how far we can still go */ + const lzo_bytep end; + lzo_uint m_len; + + assert(ip <= in_end); + assert(ii == ip - MIN_MATCH_LONG); + + if (pd(in_end,ip) <= (MAX_MATCH_LONG - MIN_MATCH_LONG)) + end = in_end; + else + { + end = ip + (MAX_MATCH_LONG - MIN_MATCH_LONG); + assert(end < in_end); + } + + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + assert(ip <= in_end); + + /* 2a) compute match parameters */ + m_len = pd(ip, ii); + assert(m_len >= MIN_MATCH_LONG); + assert(m_len <= MAX_MATCH_LONG); + assert(m_off >= MIN_OFFSET); + assert(m_off <= MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + assert(pd(ip,m_pos) == m_off); + m_off -= MIN_OFFSET; + + /* 2b) code the long match */ + /* code long match flag + low offset bits */ + *op++ = LZO_BYTE(((MSIZE - 1) << OBITS) | (m_off & OMASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> OBITS); + /* code match len */ + *op++ = LZO_BYTE(m_len - MIN_MATCH_LONG); + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->long_matches++; + lzo_stats->long_match[m_len]++; +#endif + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ +#if (CLEVEL == 9) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + /* This is not recommended because it is slow. */ + ++ii; + do { + DVAL_NEXT(dv,ii); + UPDATE_D(dict,0,dv,ii,in); + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 8) + SI DI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 7) + SI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 6) + SI DI DI DI DI DI DI XI +#elif (CLEVEL >= 5) + SI DI DI DI DI XI +#elif (CLEVEL >= 4) + SI DI DI DI XI +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + /* ii now points to the start of the next literal run */ + assert(ii == ip); + } + + } while (ip < ip_end); + + assert(ip <= in_end); + + +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + /* return -1 if op == out to indicate that we + * couldn't compress and didn't copy anything. + */ + if (op == out) + { + *out_len = 0; + return LZO_E_NOT_COMPRESSIBLE; + } +#endif + + /* store the final literal run */ + if (pd(in_end+DVAL_LEN,ii) > 0) + op = store_run(op,ii,pd(in_end+DVAL_LEN,ii)); + + *out_len = pd(op, out); + return 0; /* compression went ok */ +} + + +/*********************************************************************** +// LZO1A compress public entry point. +************************************************************************/ + +LZO_PUBLIC(int) +lzo1a_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + int r = LZO_E_OK; + + +#if defined(LZO_COLLECT_STATS) + lzo_memset(lzo_stats,0,sizeof(*lzo_stats)); + lzo_stats->rbits = RBITS; + lzo_stats->clevel = CLEVEL; + lzo_stats->dbits = DBITS; + lzo_stats->lbits = LBITS; + lzo_stats->min_match_short = MIN_MATCH_SHORT; + lzo_stats->max_match_short = MAX_MATCH_SHORT; + lzo_stats->min_match_long = MIN_MATCH_LONG; + lzo_stats->max_match_long = MAX_MATCH_LONG; + lzo_stats->min_offset = MIN_OFFSET; + lzo_stats->max_offset = MAX_OFFSET; + lzo_stats->r0min = R0MIN; + lzo_stats->r0fast = R0FAST; + lzo_stats->r0max = R0MAX; + lzo_stats->in_len = in_len; +#endif + + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + *out_len = 0; + else if (in_len <= MIN_MATCH_LONG + DVAL_LEN + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(store_run(out,in,in_len), out); +#endif + } + else + r = do_compress(in,in_len,out,out_len,wrkmem); + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->short_matches -= lzo_stats->r1_matches; + lzo_stats->short_match[MIN_MATCH] -= lzo_stats->r1_matches; + lzo_stats->out_len = *out_len; +#endif + + return r; +} + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1a_99.c b/thirdparty/lzo/2.03/src/lzo1a_99.c new file mode 100644 index 0000000..79bcf73 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1a_99.c @@ -0,0 +1,130 @@ +/* lzo1a_99.c -- implementation of the LZO1A-99 algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +#define COMPRESS_ID 99 + +#define DDBITS 3 +#define CLEVEL 9 + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_NEED_DICT_H +#include "config1a.h" + + +/*********************************************************************** +// compression internal entry point. +************************************************************************/ + +static int +_lzo1a_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ) +{ + int r; + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + { + *out_len = 0; + r = LZO_E_OK; + } + else if (in_len <= MIN_LOOKAHEAD + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + *out_len = 0; + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(STORE_RUN(out,in,in_len), out); + r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR; +#endif + } + else + r = func(in,in_len,out,out_len,wrkmem); + + return r; +} + + +/*********************************************************************** +// +************************************************************************/ + +#if !defined(COMPRESS_ID) +#define COMPRESS_ID _LZO_ECONCAT2(DD_BITS,CLEVEL) +#endif + + +#define LZO_CODE_MATCH_INCLUDE_FILE "lzo1a_cm.ch" +#include "lzo1b_c.ch" + + +/*********************************************************************** +// +************************************************************************/ + +#define LZO_COMPRESS \ + LZO_CPP_ECONCAT3(lzo1a_,COMPRESS_ID,_compress) + +#define LZO_COMPRESS_FUNC \ + LZO_CPP_ECONCAT3(_lzo1a_,COMPRESS_ID,_compress_func) + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +LZO_COMPRESS ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return _lzo1a_do_compress(in,in_len,out,out_len,wrkmem,do_compress); +} + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1a_cm.ch b/thirdparty/lzo/2.03/src/lzo1a_cm.ch new file mode 100644 index 0000000..de694f9 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1a_cm.ch @@ -0,0 +1,242 @@ +/* lzo1a_cm.ch -- implementation of the LZO1A compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + + +/*********************************************************************** +// code the match in LZO1 compatible format +************************************************************************/ + +#define THRESHOLD (M2_MIN_LEN - 1) +#define MSIZE LZO_SIZE(M2L_BITS) + + +/*********************************************************************** +// +************************************************************************/ + +#if (DD_BITS == 0) + + /* we already matched M2_MIN_LEN bytes, + * m_pos also already advanced M2_MIN_LEN bytes */ + ip += M2_MIN_LEN; + assert(m_pos < ip); + + /* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes + * to see if we get more than a M2 match */ +#define M2_OR_M3 (MATCH_M2) + +#else /* (DD_BITS == 0) */ + + /* we already matched m_len bytes */ + assert(m_len >= M2_MIN_LEN); + ip += m_len; + assert(ip <= in_end); + +#define M2_OR_M3 (m_len <= M2_MAX_LEN) + +#endif /* (DD_BITS == 0) */ + + + if (M2_OR_M3) + { + /* we've found a short match */ + assert(ip <= in_end); + + /* 2a) compute match parameters */ +#if (DD_BITS == 0) + assert(pd(ip,m_pos) == m_off); + --ip; /* ran one too far, point back to non-match */ + m_len = ip - ii; +#endif + assert(m_len >= M2_MIN_LEN); + assert(m_len <= M2_MAX_LEN); + + assert(m_off >= M2_MIN_OFFSET); + assert(m_off <= M2_MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + + /* 2b) code the match */ + m_off -= M2_MIN_OFFSET; + /* code short match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - THRESHOLD) << M2O_BITS) | + (m_off & M2O_MASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M2O_BITS); + + + if (ip >= ip_end) + { + ii = ip; + break; + } + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ + +#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + ++ii; + do { + DVAL_NEXT(dv,ii); +#if 0 + UPDATE_D(dict,drun,dv,ii,in); +#else + dict[ DINDEX(dv,ii) ] = DENTRY(ii,in); +#endif + MI + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + else + + { + /* we've found a long match - see how far we can still go */ + const lzo_bytep end; + + assert(ip <= in_end); + assert(ii == ip - (M2_MAX_LEN + 1)); + assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0); + +#if (DD_BITS > 0) + assert(m_len == (lzo_uint)(ip-ii)); + m_pos = ip - m_off; + assert(m_pos == m_pos_sav + m_len); +#endif + + if (pd(in_end,ip) <= (M3_MAX_LEN - M3_MIN_LEN)) + end = in_end; + else + { + end = ip + (M3_MAX_LEN - M3_MIN_LEN); + assert(end < in_end); + } + + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + assert(ip <= in_end); + + /* 2a) compute match parameters */ + m_len = pd(ip, ii); + assert(m_len >= M3_MIN_LEN); + assert(m_len <= M3_MAX_LEN); + + assert(m_off >= M3_MIN_OFFSET); + assert(m_off <= M3_MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + assert(pd(ip,m_pos) == m_off); + + /* 2b) code the match */ + m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET; + /* code long match flag + low offset bits */ + *op++ = LZO_BYTE(((MSIZE - 1) << M3O_BITS) | (m_off & M3O_MASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M3O_BITS); + /* code match len */ + *op++ = LZO_BYTE(m_len - M3_MIN_LEN); + + + if (ip >= ip_end) + { + ii = ip; + break; + } + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ +#if (CLEVEL == 9) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + /* This is not recommended because it can be slow. */ + ++ii; + do { + DVAL_NEXT(dv,ii); +#if 0 + UPDATE_D(dict,drun,dv,ii,in); +#else + dict[ DINDEX(dv,ii) ] = DENTRY(ii,in); +#endif + MI + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 8) + SI DI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 7) + SI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 6) + SI DI DI DI DI DI DI XI +#elif (CLEVEL >= 5) + SI DI DI DI DI XI +#elif (CLEVEL >= 4) + SI DI DI DI XI +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + /* ii now points to the start of the next literal run */ + assert(ii == ip); + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1a_cr.ch b/thirdparty/lzo/2.03/src/lzo1a_cr.ch new file mode 100644 index 0000000..62e1b27 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1a_cr.ch @@ -0,0 +1,128 @@ +/* lzo1a_cr.ch -- literal run handling for the the LZO1A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the LZO package and is subject + to change. + */ + + +#ifndef __LZO1A_CR_H +#define __LZO1A_CR_H + + +/*********************************************************************** +// code a literal run +************************************************************************/ + +static lzo_bytep +store_run(lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; + + op = oo; + ip = ii; + assert(r_len > 0); + + /* code a long R0 run */ + if (r_len >= 512) + { + unsigned r_bits = 6; /* 256 << 6 == 16384 */ + lzo_uint tt = 32768u; + + while (r_len >= (t = tt)) + { + r_len -= t; + *op++ = 0; *op++ = (R0MAX - R0MIN); + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0long_runs++); + } + tt >>= 1; + do { + if (r_len >= (t = tt)) + { + r_len -= t; + *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits); + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0long_runs++); + } + tt >>= 1; + } while (--r_bits > 0); + } + assert(r_len < 512); + + while (r_len >= (t = R0FAST)) + { + r_len -= t; + *op++ = 0; *op++ = (R0FAST - R0MIN); + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0fast_runs++); + } + + t = r_len; + if (t >= R0MIN) + { + /* code a short R0 run */ + *op++ = 0; *op++ = LZO_BYTE(t - R0MIN); + MEMCPY_DS(op, ip, t); + LZO_STATS(lzo_stats->r0short_runs++); + } + else if (t > 0) + { + /* code a short literal run */ + LZO_STATS(lzo_stats->lit_runs++); + LZO_STATS(lzo_stats->lit_run[t]++); + *op++ = LZO_BYTE(t); + MEMCPY_DS(op, ip, t); + } + + return op; +} + + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1a_de.h b/thirdparty/lzo/2.03/src/lzo1a_de.h new file mode 100644 index 0000000..97693b1 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1a_de.h @@ -0,0 +1,158 @@ +/* lzo1a_de.h -- definitions for the the LZO1A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the LZO package and is subject + to change. + */ + + +#ifndef __LZO_DEFS_H +#define __LZO_DEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* + Format of the marker byte + + + 76543210 + -------- + 00000000 a long literal run ('R0' run) - there are short and long R0 runs + 000rrrrr a short literal run with len r + mmmooooo a short match (len = 2+m, o = offset low bits) + 111ooooo a long match (o = offset low bits) +*/ + + +#define RSIZE (1 << RBITS) +#define RMASK (RSIZE - 1) + +#define MBITS (8 - OBITS) +#define MSIZE (1 << MBITS) +#define MMASK (MSIZE - 1) + +#define OBITS RBITS /* offset and run-length use same bits */ +#define OSIZE (1 << OBITS) +#define OMASK (OSIZE - 1) + + +/* additional bits for coding the length in a long match */ +#define LBITS 8 +#define LSIZE (1 << LBITS) +#define LMASK (LSIZE - 1) + + +/*********************************************************************** +// some macros to improve readability +************************************************************************/ + +/* Minimum len of a match */ +#define MIN_MATCH 3 +#define THRESHOLD (MIN_MATCH - 1) + +/* Min-/Maximum len of a match coded in 2 bytes */ +#define MIN_MATCH_SHORT (MIN_MATCH) +#define MAX_MATCH_SHORT (MIN_MATCH_SHORT + (MSIZE - 2) - 1) +/* why (MSIZE - 2) ? because 0 is used to mark runs, + * and MSIZE-1 is used to mark a long match */ + +/* Min-/Maximum len of a match coded in 3 bytes */ +#define MIN_MATCH_LONG (MAX_MATCH_SHORT + 1) +#define MAX_MATCH_LONG (MIN_MATCH_LONG + LSIZE - 1) + +/* Min-/Maximum offset of a match */ +#define MIN_OFFSET 1 +#define MAX_OFFSET (1 << (CHAR_BIT + OBITS)) + + +/* R0 literal run (a long run) */ + +#define R0MIN (RSIZE) /* Minimum len of R0 run of literals */ +#define R0MAX (R0MIN + 255) /* Maximum len of R0 run of literals */ +#define R0FAST (R0MAX & ~7) /* R0MAX aligned to 8 byte boundary */ + +#if (R0MAX - R0FAST != 7) || ((R0FAST & 7) != 0) +# error "something went wrong" +#endif + +/* 7 special codes from R0FAST+1 .. R0MAX + * these codes mean long R0 runs with lengths + * 512, 1024, 2048, 4096, 8192, 16384, 32768 */ + + +/* + +RBITS | MBITS MIN THR. MSIZE MAXS MINL MAXL MAXO R0MAX R0FAST +======+=============================================================== + 3 | 5 3 2 32 32 33 288 2048 263 256 + 4 | 4 3 2 16 16 17 272 4096 271 264 + 5 | 3 3 2 8 8 9 264 8192 287 280 + + */ + + +/*********************************************************************** +// +************************************************************************/ + +#define DBITS 13 +#include "lzo_dict.h" +#define DVAL_LEN DVAL_LOOKAHEAD + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_1.c b/thirdparty/lzo/2.03/src/lzo1b_1.c new file mode 100644 index 0000000..bb5afa8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_1.c @@ -0,0 +1,46 @@ +/* lzo1b_1.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 1 + +#define DDBITS 0 +#define CLEVEL 1 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_2.c b/thirdparty/lzo/2.03/src/lzo1b_2.c new file mode 100644 index 0000000..e77297b --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_2.c @@ -0,0 +1,46 @@ +/* lzo1b_2.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 2 + +#define DDBITS 0 +#define CLEVEL 2 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_3.c b/thirdparty/lzo/2.03/src/lzo1b_3.c new file mode 100644 index 0000000..4a212ff --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_3.c @@ -0,0 +1,46 @@ +/* lzo1b_3.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 3 + +#define DDBITS 0 +#define CLEVEL 3 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_4.c b/thirdparty/lzo/2.03/src/lzo1b_4.c new file mode 100644 index 0000000..bb559ce --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_4.c @@ -0,0 +1,46 @@ +/* lzo1b_4.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 4 + +#define DDBITS 1 +#define CLEVEL 2 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_5.c b/thirdparty/lzo/2.03/src/lzo1b_5.c new file mode 100644 index 0000000..c0d99b9 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_5.c @@ -0,0 +1,46 @@ +/* lzo1b_5.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 5 + +#define DDBITS 1 +#define CLEVEL 3 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_6.c b/thirdparty/lzo/2.03/src/lzo1b_6.c new file mode 100644 index 0000000..f1c52c5 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_6.c @@ -0,0 +1,46 @@ +/* lzo1b_6.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 6 + +#define DDBITS 1 +#define CLEVEL 5 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_7.c b/thirdparty/lzo/2.03/src/lzo1b_7.c new file mode 100644 index 0000000..0cf5a21 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_7.c @@ -0,0 +1,46 @@ +/* lzo1b_7.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 7 + +#define DDBITS 2 +#define CLEVEL 3 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_8.c b/thirdparty/lzo/2.03/src/lzo1b_8.c new file mode 100644 index 0000000..3426371 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_8.c @@ -0,0 +1,46 @@ +/* lzo1b_8.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 8 + +#define DDBITS 2 +#define CLEVEL 8 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_9.c b/thirdparty/lzo/2.03/src/lzo1b_9.c new file mode 100644 index 0000000..4050956 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_9.c @@ -0,0 +1,46 @@ +/* lzo1b_9.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 9 + +#define DDBITS 2 +#define CLEVEL 9 +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_99.c b/thirdparty/lzo/2.03/src/lzo1b_99.c new file mode 100644 index 0000000..df274a0 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_99.c @@ -0,0 +1,49 @@ +/* lzo1b_99.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 99 + +#define DDBITS 3 +#define CLEVEL 9 + +#define D_BITS 16 +#define MATCH_IP_END in_end +#include "compr1b.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1b_9x.c b/thirdparty/lzo/2.03/src/lzo1b_9x.c new file mode 100644 index 0000000..b80eca5 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_9x.c @@ -0,0 +1,365 @@ +/* lzo1b_9x.c -- implementation of the LZO1B-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1b.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define N 0xffffL /* size of ring buffer */ +#define THRESHOLD 2 /* lower limit for match length */ +#define F 2048 /* upper limit for match length */ + + +#define LZO1B +#define LZO_COMPRESS_T lzo1b_999_t +#define lzo_swd_t lzo1b_999_swd_t +#include "lzo_mchw.ch" + + + +/*********************************************************************** +// +************************************************************************/ + +static lzo_bytep +code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off ) +{ + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + { + assert(m_len >= M2_MIN_LEN); + assert(m_off >= M2_MIN_OFFSET); + + m_off -= M2_MIN_OFFSET; + /* code match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) | + (m_off & M2O_MASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M2O_BITS); + c->m2_m++; + } + else + { + assert(m_len >= M3_MIN_LEN); + assert(m_off <= M3_MAX_OFFSET); + + m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET; + /* code match len */ + if (m_len <= M3_MAX_LEN) + *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1))); + else + { + assert(m_len >= M4_MIN_LEN); + /* code M4 match len flag */ + *op++ = M4_MARKER; + /* code match len */ + m_len -= M4_MIN_LEN - 1; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + /* code low offset bits */ + *op++ = LZO_BYTE(m_off & M3O_MASK); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M3O_BITS); + + c->r1_m_len = 0; + c->m3_m++; + } + return op; +} + + +/*********************************************************************** +// this is a public function, but there is no prototype in a header file +************************************************************************/ + +LZO_EXTERN(int) +lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ); + +LZO_PUBLIC(int) +lzo1b_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ) +{ + lzo_bytep op; + const lzo_bytep ii; + lzo_uint lit; + lzo_uint m_len, m_off; + LZO_COMPRESS_T cc; + LZO_COMPRESS_T * const c = &cc; + lzo_swd_p const swd = (lzo_swd_p) wrkmem; + int r; + + /* sanity check */ + LZO_COMPILE_TIME_ASSERT(LZO1B_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) + + c->init = 0; + c->ip = c->in = in; + c->in_end = in + in_len; + c->cb = cb; + c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0; + + op = out; + ii = c->ip; /* point to start of literal run */ + lit = 0; + c->r1_m_len = 0; + + r = init_match(c,swd,NULL,0,0); + if (r != 0) + return r; + if (max_chain > 0) + swd->max_chain = max_chain; + + r = find_match(c,swd,0,0); + if (r != 0) + return r; + while (c->look > 0) + { + int lazy_match_min_gain = -1; + lzo_uint ahead = 0; + + m_len = c->m_len; + m_off = c->m_off; + +#if 0 + printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look, + m_len, m_off); +#endif + + assert(c->ip - c->look >= in); + if (lit == 0) + ii = c->ip - c->look; + assert(ii + lit == c->ip - c->look); + assert(swd->b_char == *(c->ip - c->look)); + + if ((m_len < M2_MIN_LEN) || + (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET)) + { + m_len = 0; + } + else + { + assert(c->ip - c->look - m_off >= in); + assert(c->ip - c->look - m_off + m_len < c->ip); + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); + + if (lit > 0) + { + /* we have a current literal run: do not try a lazy match, + if the literal could be coded into a r1 match */ + if (lit == 1 && c->r1_m_len == M2_MIN_LEN) + lazy_match_min_gain = -1; + else + lazy_match_min_gain = 1; + +#if (M2_MIN_LEN == 2) + if (m_len == 2) + { + /* don't code a match of len 2 if we have to + code a literal run. Code a literal instead. */ + m_len = 0; + } +#endif +#if (M2_MIN_LEN == M3_MIN_LEN) + if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET) + { + /* don't code a M3 match of len 3 if we have to + code a literal run. Code a literal instead. */ + m_len = 0; + } +#endif + } + else + { + /* no current literal run: only try a lazy match, + if the literal could be coded into a r1 match */ + if (c->r1_m_len == M2_MIN_LEN) + lazy_match_min_gain = 0; + else + lazy_match_min_gain = -1; + } + } + + + /* try a lazy match */ + if (m_len == 0) + lazy_match_min_gain = -1; + if (lazy_match_min_gain >= 0 && c->look > m_len) + { + assert(m_len > 0); + + r = find_match(c,swd,1,0); + assert(r == 0); + assert(c->look > 0); + + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET && + c->m_off > M2_MAX_OFFSET) + lazy_match_min_gain += 1; + + if (c->m_len >= m_len + lazy_match_min_gain) + { + c->lazy++; +#if !defined(NDEBUG) + m_len = c->m_len; + m_off = c->m_off; + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); +#endif + lit++; + assert(ii + lit == c->ip - c->look); + continue; + } + else + { + ahead = 1; + assert(ii + lit + 1 == c->ip - c->look); + } + assert(m_len > 0); + } + assert(ii + lit + ahead == c->ip - c->look); + + + if (m_len == 0) + { + /* a literal */ + lit++; + r = find_match(c,swd,1,0); + assert(r == 0); + } + else + { + /* 1 - store run */ + if (lit > 0) + { + /* code current literal run */ + if (lit == 1 && c->r1_m_len == M2_MIN_LEN) + { + /* Code a context sensitive R1 match. */ + assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS)); + op[-2] &= M2O_MASK; + assert((op[-2] >> M2O_BITS) == 0); + /* copy 1 literal */ + *op++ = *ii++; + assert(ii + ahead == c->ip - c->look); + c->r1_r++; + } + else + { + op = STORE_RUN(op,ii,lit); + } + if (lit < R0FAST) + c->r1_m_len = m_len; + else + c->r1_m_len = 0; + lit = 0; + } + else + c->r1_m_len = 0; + + /* 2 - code match */ + op = code_match(c,op,m_len,m_off); + r = find_match(c,swd,m_len,1+ahead); + assert(r == 0); + } + + c->codesize = pd(op, out); + } + + + /* store final run */ + if (lit > 0) + op = STORE_RUN(op,ii,lit); + +#if defined(LZO_EOF_CODE) + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; +#endif + + c->codesize = pd(op, out); + assert(c->textsize == in_len); + + *out_len = pd(op, out); + + if (c->cb && c->cb->nprogress) + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + +#if 0 + printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n", + (long) c->textsize, (long)in_len, (long) c->codesize, + c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy); +#endif + return LZO_E_OK; +} + + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1b_999_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return lzo1b_999_compress_callback(in,in_len,out,out_len,wrkmem, + (lzo_callback_p) 0, 0); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_c.ch b/thirdparty/lzo/2.03/src/lzo1b_c.ch new file mode 100644 index 0000000..67ef4ff --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_c.ch @@ -0,0 +1,270 @@ +/* lzo1b_c.ch -- implementation of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +/*********************************************************************** +// +************************************************************************/ + +#if !defined(LZO_HAVE_R1) && !defined(LZO_NO_R1) +# define LZO_HAVE_R1 +#endif + +#if !defined(LZO_HAVE_M3) && !defined(LZO_NO_M3) +# if (M3O_BITS < 8) +# define LZO_HAVE_M3 +# endif +#endif + + +#define MI +#define SI MI +#if (DD_BITS > 0) +#define DI ++ii; DVAL_NEXT(dv,ii); UPDATE_D(dict,drun,dv,ii,in); MI +#define XI assert(ii < ip); ii = ip; DVAL_FIRST(dv,(ip)); +#else +#define DI ++ii; DINDEX1(dindex,ii); UPDATE_I(dict,0,dindex,ii,in); MI +#define XI assert(ii < ip); ii = ip; +#endif + + +/*********************************************************************** +// compress a block of data. +// +// I really apologize for this spaghetti code. +************************************************************************/ + +LZO_PRIVATE(int) +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; +#if (DD_BITS > 0) +#if defined(__LZO_HASH_INCREMENTAL) + lzo_xint dv; +#endif + unsigned drun = 0; +#endif + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - MIN_LOOKAHEAD; + const lzo_bytep ii; +#if defined(LZO_HAVE_R1) + const lzo_bytep r1 = ip_end; /* pointer for R1 match (none yet) */ +#endif +#if defined(LZO_HAVE_M3) + lzo_bytep m3 = out + 1; /* pointer after last m3/m4 match */ +#endif + + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->r_bits = R_BITS; + lzo_stats->m3o_bits = M3O_BITS; + lzo_stats->dd_bits = DD_BITS; + lzo_stats->clevel = CLEVEL; + lzo_stats->d_bits = D_BITS; + lzo_stats->min_lookahead = MIN_LOOKAHEAD; + lzo_stats->max_lookbehind = MAX_LOOKBEHIND; + lzo_stats->compress_id = LZO_CPP_MACRO_EXPAND(COMPRESS_ID); +#endif + + /* init dictionary */ +#if defined(LZO_DETERMINISTIC) + BZERO8_PTR(wrkmem,sizeof(lzo_dict_t),D_SIZE); +#endif + + + op = out; + ip = in; + ii = ip; /* point to start of current literal run */ + + +#if (DD_BITS > 0) + DVAL_FIRST(dv,ip); + UPDATE_D(dict,drun,dv,ip,in); + ip++; + DVAL_NEXT(dv,ip); +#else + ip++; +#endif + + assert(ip < ip_end); + for (;;) + { + const lzo_bytep m_pos; +#if !defined(NDEBUG) + const lzo_bytep m_pos_sav = NULL; +#endif + lzo_uint m_off; +#if (DD_BITS == 0) + lzo_uint dindex; +#endif + lzo_uint m_len; + + +/*********************************************************************** +// search for a match +************************************************************************/ + +#if !defined(LZO_SEARCH_MATCH_INCLUDE_FILE) +# define LZO_SEARCH_MATCH_INCLUDE_FILE "lzo1b_sm.ch" +#endif + +#include LZO_SEARCH_MATCH_INCLUDE_FILE + + +#if !defined(LZO_TEST_MATCH_INCLUDE_FILE) +# define LZO_TEST_MATCH_INCLUDE_FILE "lzo1b_tm.ch" +#endif + +#include LZO_TEST_MATCH_INCLUDE_FILE + + + +/*********************************************************************** +// found a literal +************************************************************************/ + + + /* a literal */ +literal: +#if (DD_BITS == 0) + UPDATE_I(dict,0,dindex,ip,in); +#endif + if (++ip >= ip_end) + break; +#if (DD_BITS > 0) + DVAL_NEXT(dv,ip); +#endif + continue; + + + +/*********************************************************************** +// found a match +************************************************************************/ + +match: +#if (DD_BITS == 0) + UPDATE_I(dict,0,dindex,ip,in); +#endif + /* we have found a match of at least M2_MIN_LEN */ + + +#if !defined(LZO_CODE_RUN_INCLUDE_FILE) +# define LZO_CODE_RUN_INCLUDE_FILE "lzo1b_cr.ch" +#endif + +#include LZO_CODE_RUN_INCLUDE_FILE + + + /* ii now points to the start of the current match */ + assert(ii == ip); + + +/*********************************************************************** +// code the match +************************************************************************/ + +#if !defined(LZO_CODE_MATCH_INCLUDE_FILE) +# define LZO_CODE_MATCH_INCLUDE_FILE "lzo1b_cm.ch" +#endif + +#include LZO_CODE_MATCH_INCLUDE_FILE + + + /* ii now points to the start of the next literal run */ + assert(ii == ip); + + } + + +/*********************************************************************** +// end of block +************************************************************************/ + + assert(ip <= in_end); + +#if defined(LZO_COLLECT_STATS) + { + lzo_uint i; + const lzo_bytep p; + + for (i = 0; i < D_SIZE; i++) + { + p = dict[i]; + if (BOUNDS_CHECKING_OFF_IN_EXPR(p == NULL || p < in || p > in_end)) + lzo_stats->unused_dict_entries++; + } + lzo_stats->unused_dict_entries_percent = + 100.0 * lzo_stats->unused_dict_entries / D_SIZE; + } +#endif + + +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + /* return if op == out to indicate that we + * couldn't compress and didn't copy anything. + */ + if (op == out) + { + *out_len = 0; + return LZO_E_NOT_COMPRESSIBLE; + } +#endif + + /* store the final literal run */ + if (pd(in_end,ii) > 0) + { + lzo_uint t = pd(in_end,ii); + op = STORE_RUN(op,ii,t); + } + + *out_len = pd(op, out); + return LZO_E_OK; /* compression went ok */ +} + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1b_cc.c b/thirdparty/lzo/2.03/src/lzo1b_cc.c new file mode 100644 index 0000000..45b0f85 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_cc.c @@ -0,0 +1,167 @@ +/* lzo1b_cc.c -- LZO1B compression internal entry point + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#include "config1b.h" + + +/*********************************************************************** +// compression internal entry point. +************************************************************************/ + +int _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ) +{ + int r; +#if defined(LZO_TEST_COMPRESS_OVERRUN) + lzo_uint avail_out = *out_len; +#endif + + +#if defined(LZO_COLLECT_STATS) + _lzo1b_stats_init(lzo_stats); + lzo_stats->in_len = in_len; +#endif + + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + { + *out_len = 0; + r = LZO_E_OK; + } + else if (in_len <= MIN_LOOKAHEAD + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + *out_len = 0; + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(STORE_RUN(out,in,in_len), out); + r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR; +#endif + } + else + r = func(in,in_len,out,out_len,wrkmem); + + +#if defined(LZO_EOF_CODE) +#if defined(LZO_TEST_COMPRESS_OVERRUN) + if (r == LZO_E_OK && avail_out - *out_len < 3) + r = LZO_E_COMPRESS_OVERRUN; +#endif + if (r == LZO_E_OK) + { + lzo_bytep op = out + *out_len; + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; + *out_len += 3; + } +#endif + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->out_len = *out_len; + lzo_stats->match_bytes = + 1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches + + 3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches; + _lzo1b_stats_calc(lzo_stats); +#endif + + return r; +} + + +/*********************************************************************** +// note: this is not thread safe, but as it is used for finetuning only +// we don't care +************************************************************************/ + +#undef lzo_stats +/* lzo_stats_t is still defined */ + + +#if defined(LZO_COLLECT_STATS) + +static lzo_stats_t lzo_statistics; +lzo_stats_t * const lzo1b_stats = &lzo_statistics; + + +void _lzo1b_stats_init(lzo_stats_t *lzo_stats) +{ + lzo_memset(lzo_stats,0,sizeof(*lzo_stats)); +} + + +void _lzo1b_stats_calc(lzo_stats_t *lzo_stats) +{ + lzo_stats->matches = + lzo_stats->m1_matches + lzo_stats->m2_matches + + lzo_stats->m3_matches + lzo_stats->m4_matches; + + lzo_stats->literal_overhead = lzo_stats->lit_runs + + 2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs + + lzo_stats->r0long_runs); + lzo_stats->literal_bytes = lzo_stats->literals + + lzo_stats->literal_overhead; + +#if 0 + assert(lzo_stats->match_bytes + lzo_stats->literal_bytes == + lzo_stats->out_len); +#endif + + lzo_stats->m2_matches -= lzo_stats->r1_matches; + lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches; + + if (lzo_stats->literals > 0) + lzo_stats->literal_overhead_percent = + 100.0 * lzo_stats->literal_overhead / lzo_stats->literals; +} + + +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_cc.h b/thirdparty/lzo/2.03/src/lzo1b_cc.h new file mode 100644 index 0000000..a984dad --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_cc.h @@ -0,0 +1,93 @@ +/* lzo1b_cc.h -- definitions for the the LZO1B compression driver + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO1B_CC_H +#define __LZO1B_CC_H + + +/*********************************************************************** +// +************************************************************************/ + +extern const lzo_compress_t _lzo1b_1_compress_func; +extern const lzo_compress_t _lzo1b_2_compress_func; +extern const lzo_compress_t _lzo1b_3_compress_func; +extern const lzo_compress_t _lzo1b_4_compress_func; +extern const lzo_compress_t _lzo1b_5_compress_func; +extern const lzo_compress_t _lzo1b_6_compress_func; +extern const lzo_compress_t _lzo1b_7_compress_func; +extern const lzo_compress_t _lzo1b_8_compress_func; +extern const lzo_compress_t _lzo1b_9_compress_func; + +extern const lzo_compress_t _lzo1b_99_compress_func; + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(lzo_bytep ) +_lzo1b_store_run ( lzo_bytep const oo, const lzo_bytep const ii, + lzo_uint r_len); + +#define STORE_RUN _lzo1b_store_run + + +lzo_compress_t _lzo1b_get_compress_func(int clevel); + +int _lzo1b_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ); + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + + diff --git a/thirdparty/lzo/2.03/src/lzo1b_cm.ch b/thirdparty/lzo/2.03/src/lzo1b_cm.ch new file mode 100644 index 0000000..f47884b --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_cm.ch @@ -0,0 +1,294 @@ +/* lzo1b_cm.ch -- implementation of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + + +/*********************************************************************** +// code the match +************************************************************************/ + +#if (DD_BITS == 0) + + /* we already matched M2_MIN_LEN bytes, + * m_pos also already advanced M2_MIN_LEN bytes */ + ip += M2_MIN_LEN; + assert(m_pos < ip); + + /* try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes + * to see if we get more than a M2 match */ +#define M2_OR_M3 (MATCH_M2) + +#else /* (DD_BITS == 0) */ + + /* we already matched m_len bytes */ + assert(m_len >= M2_MIN_LEN); + ip += m_len; + assert(ip <= in_end); + +#define M2_OR_M3 (m_len <= M2_MAX_LEN) + +#endif /* (DD_BITS == 0) */ + + + + if (M2_OR_M3) + { + /* we've found a M2 or M3 match */ + assert(ip <= in_end); + + /* 2a) compute match parameters */ +#if (DD_BITS == 0) + assert(pd(ip,m_pos) == m_off); + --ip; /* ran one too far, point back to non-match */ + m_len = pd(ip, ii); +#endif + + /* 2a2) verify match parameters */ + assert(m_len >= M2_MIN_LEN); + assert(m_len <= M2_MAX_LEN); + assert(m_len <= M3_MAX_LEN); + + assert(m_off >= M2_MIN_OFFSET); + assert(m_off >= M3_MIN_OFFSET); + assert(m_off <= M3_MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + + /* 2b) code the match */ +#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET) + if (m_off <= M2_MAX_OFFSET) + { +#else + assert(m_off <= M2_MAX_OFFSET); +#endif + m_off -= M2_MIN_OFFSET; + /* code match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) | + (m_off & M2O_MASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M2O_BITS); + LZO_STATS(lzo_stats->m2_matches++); + LZO_STATS(lzo_stats->m2_match[m_len]++); +#if (_M2_MAX_OFFSET != _M3_MAX_OFFSET) + } + else + { +#if defined(LZO_HAVE_R1) +#if (M3_MIN_LEN == M2_MIN_LEN) + r1 = ip_end; /* invalidate R1 pointer */ +#endif +#endif + assert(m_len >= M3_MIN_LEN); + m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET; + /* code match len */ + *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1))); + /* code low offset bits */ + *op++ = LZO_BYTE(m_off & M3O_MASK); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M3O_BITS); + LZO_STATS(lzo_stats->m3_matches++); + LZO_STATS(lzo_stats->m3_match[m_len]++); +#if defined(LZO_HAVE_M3) + m3 = op; /* set M3 pointer */ +#endif + } +#endif /* (_M2_MAX_OFFSET != _M3_MAX_OFFSET) */ + + + if (ip >= ip_end) + { + ii = ip; + break; + } + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ + +#if (CLEVEL == 9) || (CLEVEL >= 7 && M2L_BITS <= 4) || (CLEVEL >= 5 && M2L_BITS <= 3) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + ++ii; + do { + DVAL_NEXT(dv,ii); +#if 0 + UPDATE_D(dict,drun,dv,ii,in); +#else + dict[ DINDEX(dv,ii) ] = DENTRY(ii,in); +#endif + MI + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + else + + { + /* we've found a M3 or M4 match - see how far we can still go */ + assert(ip <= in_end); + assert(lzo_memcmp(m_pos_sav,ii,(lzo_uint)(ip-ii)) == 0); + + /* 2a) compute match parameters */ +#if !defined(MATCH_IP_END) + assert(ii == ip - (M2_MAX_LEN + 1)); +#if (DD_BITS > 0) + assert(m_len == (lzo_uint)(ip-ii)); + m_pos = ip - m_off; + assert(m_pos == m_pos_sav + m_len); +#endif + { + const lzo_bytep end; + end = in_end; + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + assert(ip <= in_end); + m_len = pd(ip, ii); + } + assert(pd(ip,m_pos) == m_off); +#endif + + /* 2a2) verify match parameters */ + assert(m_len >= M3_MIN_LEN); + + assert(m_off >= M3_MIN_OFFSET); + assert(m_off >= M4_MIN_OFFSET); + assert(m_off <= M3_MAX_OFFSET); + assert(m_off <= M4_MAX_OFFSET); + assert(ii-m_off == m_pos_sav); + assert(lzo_memcmp(m_pos_sav,ii,m_len) == 0); + + /* 2b) code the match */ + if (m_len <= M3_MAX_LEN) + { + /* code match len */ + *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1))); + LZO_STATS(lzo_stats->m3_matches++); + LZO_STATS(lzo_stats->m3_match[m_len]++); + } + else + { + assert(m_len >= M4_MIN_LEN); + /* code M4 match len flag */ + *op++ = M4_MARKER; + /* code match len */ + m_len -= M4_MIN_LEN - 1; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + LZO_STATS(lzo_stats->m4_matches++); + } + + m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET; + /* code low offset bits */ + *op++ = LZO_BYTE(m_off & M3O_MASK); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M3O_BITS); + +#if defined(LZO_HAVE_M3) + m3 = op; /* set M3 pointer */ +#endif + + + if (ip >= ip_end) + { + ii = ip; + break; + } + + + /* 2c) Insert phrases (beginning with ii+1) into the dictionary. */ +#if (CLEVEL == 9) + /* Insert the whole match (ii+1)..(ip-1) into dictionary. */ + /* This is not recommended because it can be slow. */ + ++ii; + do { + DVAL_NEXT(dv,ii); +#if 0 + UPDATE_D(dict,drun,dv,ii,in); +#else + dict[ DINDEX(dv,ii) ] = DENTRY(ii,in); +#endif + MI + } while (++ii < ip); + DVAL_NEXT(dv,ii); + assert(ii == ip); + DVAL_ASSERT(dv,ip); +#elif (CLEVEL >= 8) + SI DI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 7) + SI DI DI DI DI DI DI DI XI +#elif (CLEVEL >= 6) + SI DI DI DI DI DI DI XI +#elif (CLEVEL >= 5) + SI DI DI DI DI XI +#elif (CLEVEL >= 4) + SI DI DI DI XI +#elif (CLEVEL >= 3) + SI DI DI XI +#elif (CLEVEL >= 2) + SI DI XI +#else + XI +#endif + } + + /* ii now points to the start of the next literal run */ + assert(ii == ip); + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1b_cr.ch b/thirdparty/lzo/2.03/src/lzo1b_cr.ch new file mode 100644 index 0000000..f98e0a5 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_cr.ch @@ -0,0 +1,126 @@ +/* lzo1b_cr.ch -- implementation of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + + +/*********************************************************************** +// store the current literal run +************************************************************************/ + + assert(ip < ip_end); + if (pd(ip,ii) > 0) + { + lzo_uint t = pd(ip,ii); + +#if defined(LZO_HAVE_R1) + if (ip == r1) + { + /* Code a context sensitive R1 match. */ + LZO_STATS(lzo_stats->literals += t); + LZO_STATS(lzo_stats->r1_matches++); + assert(t == 1); + /* modify marker byte */ + assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS)); + op[-2] &= M2O_MASK; + assert((op[-2] >> M2O_BITS) == 0); + /* copy 1 literal */ + *op++ = *ii++; + r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */ + } + else +#endif + if (t < R0MIN) + { + /* inline the copying of a short run */ + LZO_STATS(lzo_stats->literals += t); + LZO_STATS(lzo_stats->lit_runs++); + LZO_STATS(lzo_stats->lit_run[t]++); +#if defined(LZO_HAVE_M3) + if (t < LZO_SIZE(8-M3O_BITS) && op == m3) + { + /* Code a very short literal run into the low offset bits + * of the previous M3/M4 match. + */ + LZO_STATS(lzo_stats->lit_runs_after_m3_match++); + LZO_STATS(lzo_stats->lit_run_after_m3_match[t]++); + assert((m3[-2] >> M3O_BITS) == 0); + m3[-2] |= LZO_BYTE(t << M3O_BITS); + } + else +#endif + { + *op++ = LZO_BYTE(t); + } + MEMCPY_DS(op, ii, t); +#if defined(LZO_HAVE_R1) + r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */ +#endif + } + else if (t < R0FAST) + { + /* inline the copying of a short R0 run */ + LZO_STATS(lzo_stats->literals += t); + LZO_STATS(lzo_stats->r0short_runs++); + *op++ = 0; *op++ = LZO_BYTE(t - R0MIN); + MEMCPY_DS(op, ii, t); +#if defined(LZO_HAVE_R1) + r1 = ip + (M2_MIN_LEN + 1); /* set new R1 pointer */ +#endif + } + else + { + op = STORE_RUN(op,ii,t); + ii = ip; + } + } + + + /* ii now points to the start of the current match */ + assert(ii == ip); + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1b_d.ch b/thirdparty/lzo/2.03/src/lzo1b_d.ch new file mode 100644 index 0000000..e38fad5 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_d.ch @@ -0,0 +1,282 @@ +/* lzo1b_d.ch -- implementation of the LZO1B decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo1_d.ch" + + +/*********************************************************************** +// decompress a block of data. +************************************************************************/ + +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; + register const lzo_bytep m_pos; + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif + + LZO_UNUSED(wrkmem); + + op = out; + ip = in; + + while (TEST_IP && TEST_OP) + { + t = *ip++; /* get marker */ + + if (t < R0MIN) /* a literal run */ + { + if (t == 0) /* a R0 literal run */ + { + NEED_IP(1); + t = *ip++; + if (t >= R0FAST - R0MIN) /* a long R0 run */ + { + t -= R0FAST - R0MIN; + if (t == 0) + t = R0FAST; + else + { +#if 0 + t = 256u << ((unsigned) t); +#else + /* help the optimizer */ + lzo_uint tt = 256; + do tt <<= 1; while (--t > 0); + t = tt; +#endif + } + + NEED_IP(t); NEED_OP(t); +#if 1 && defined(LZO_UNALIGNED_OK_4) + do { + * (lzo_uint32p) (op+0) = * (const lzo_uint32p) (ip+0); + * (lzo_uint32p) (op+4) = * (const lzo_uint32p) (ip+4); + op += 8; ip += 8; + t -= 8; + } while (t > 0); +#else + MEMCPY8_DS(op,ip,t); +#endif + continue; + } + t += R0MIN; /* a short R0 run */ + } + + NEED_IP(t); NEED_OP(t); + /* copy literal run */ +#if 1 && defined(LZO_UNALIGNED_OK_4) + if (t >= 4) + { + do { + * (lzo_uint32p) op = * (const lzo_uint32p) ip; + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else +#endif + { +#if (M3O_BITS < 7) +literal1: +#endif + do *op++ = *ip++; while (--t > 0); + } + +#if (M3O_BITS == 7) +literal2: +#endif + + /* after a literal a match must follow */ + while (TEST_IP && TEST_OP) + { + t = *ip++; /* get R1 marker */ + if (t >= R0MIN) + goto match; + + NEED_IP(2); NEED_OP(M2_MIN_LEN + 1); + + /* R1 match - a M2_MIN_LEN match + 1 byte literal */ + assert((t & M2O_MASK) == t); + m_pos = op - M2_MIN_OFFSET; + m_pos -= t | (((lzo_uint) *ip++) << M2O_BITS); + assert(m_pos >= out); assert(m_pos < op); + TEST_LB(m_pos); + COPY_M2; + *op++ = *ip++; + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + break; +#endif + } + +match: + + if (t >= M2_MARKER) /* a M2 match */ + { + /* get match offset */ + NEED_IP(1); + m_pos = op - M2_MIN_OFFSET; + m_pos -= (t & M2O_MASK) | (((lzo_uint) *ip++) << M2O_BITS); + assert(m_pos >= out); assert(m_pos < op); + TEST_LB(m_pos); + + /* get match len */ + t = (t >> M2O_BITS) - 1; + NEED_OP(t + M2_MIN_LEN - 1); + COPY_M2X; + MEMCPY_DS(op,m_pos,t); + } + else /* a M3 or M4 match */ + { + /* get match len */ + t &= M3L_MASK; + if (t == 0) /* a M4 match */ + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += (M4_MIN_LEN - M3_MIN_LEN) + *ip++; + } + + /* get match offset */ + NEED_IP(2); + m_pos = op - (M3_MIN_OFFSET - M3_EOF_OFFSET); + m_pos -= *ip++ & M3O_MASK; + m_pos -= (lzo_uint)(*ip++) << M3O_BITS; +#if defined(LZO_EOF_CODE) + if (m_pos == op) + goto eof_found; +#endif + + /* copy match */ + assert(m_pos >= out); assert(m_pos < op); + TEST_LB(m_pos); NEED_OP(t + M3_MIN_LEN - 1); +#if defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (M3_MIN_LEN - 1) && (op - m_pos) >= 4) + { + * (lzo_uint32p) op = * (const lzo_uint32p) m_pos; + op += 4; m_pos += 4; t -= 4 - (M3_MIN_LEN - 1); + do { + * (lzo_uint32p) op = * (const lzo_uint32p) m_pos; + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { + COPY_M3X; + MEMCPY_DS(op,m_pos,t); + } + + +#if (M3O_BITS < 7) + t = ip[-2] >> M3O_BITS; + if (t) + { + NEED_IP(t); NEED_OP(t); + goto literal1; + } +#elif (M3O_BITS == 7) + /* optimized version */ + if (ip[-2] & (1 << M3O_BITS)) + { + NEED_IP(1); NEED_OP(1); + *op++ = *ip++; + goto literal2; + } +#endif + } + } + + +#if defined(LZO_EOF_CODE) +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + /* no EOF code was found */ + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); +#endif + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_d1.c b/thirdparty/lzo/2.03/src/lzo1b_d1.c new file mode 100644 index 0000000..1228ccc --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_d1.c @@ -0,0 +1,46 @@ +/* lzo1b_d1.c -- LZO1B decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1b.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1b_decompress + +#include "lzo1b_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1b_d2.c b/thirdparty/lzo/2.03/src/lzo1b_d2.c new file mode 100644 index 0000000..b39138d --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_d2.c @@ -0,0 +1,46 @@ +/* lzo1b_d2.c -- LZO1B decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1b.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1b_decompress_safe + +#include "lzo1b_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1b_de.h b/thirdparty/lzo/2.03/src/lzo1b_de.h new file mode 100644 index 0000000..badba73 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_de.h @@ -0,0 +1,344 @@ +/* lzo1b_de.h -- definitions for the the LZO1B/LZO1C algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_DEFS_H +#define __LZO_DEFS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* + Format of the marker byte + + 76543210 + -------- + 00000000 R0 - a long literal run ('R0' run) + 000rrrrr R - a short literal run with len r + 00100000 M4 - a very long match + 001mmmmm M3 - a long match (len = m+M3_MIN_LEN) + mmmooooo M2 - a short match (len = m+M2_MIN_LEN, o = offset low bits) + + M1 is not used ! +*/ + + +#ifndef R_BITS +#define R_BITS (5) +#endif + + +#ifndef M1L_BITS +#define M1L_BITS (0) +#endif +#ifndef M2L_BITS +#define M2L_BITS (CHAR_BIT - M2O_BITS) +#endif +#ifndef M3L_BITS +#define M3L_BITS (R_BITS) +#endif +#ifndef M4L_BITS +#define M4L_BITS (CHAR_BIT) +#endif + +#ifndef M1O_BITS +#define M1O_BITS (6) +#endif +#ifndef M2O_BITS +#define M2O_BITS (R_BITS) +#endif +#ifndef M3O_BITS +#define M3O_BITS (CHAR_BIT) +#endif +#ifndef M4O_BITS +#define M4O_BITS (M3O_BITS) /* must be the same */ +#endif + +#ifndef M1X_BITS +#define M1X_BITS (M1O_BITS) +#endif +#ifndef M2X_BITS +#define M2X_BITS (M2O_BITS + CHAR_BIT) +#endif +#ifndef M3X_BITS +#define M3X_BITS (M3O_BITS + CHAR_BIT) +#endif +#ifndef M4X_BITS +#define M4X_BITS M3X_BITS +#endif + + +#define __MIN_OFFSET(bits) 1 +#define __MAX_OFFSET(bits) LZO_LSIZE(bits) + +#define M1_MIN_OFFSET __MIN_OFFSET(M1X_BITS) +#define M2_MIN_OFFSET __MIN_OFFSET(M2X_BITS) +#define M3_MIN_OFFSET __MIN_OFFSET(M3X_BITS) +#define M4_MIN_OFFSET M3_MIN_OFFSET + +#if defined(LZO_EOF_CODE) && !defined(M3_EOF_OFFSET) +#define M3_EOF_OFFSET 1 +#else +#define M3_EOF_OFFSET 0 +#endif + +#ifndef _M1_MAX_OFFSET +#define _M1_MAX_OFFSET __MAX_OFFSET(M1X_BITS) +#endif +#ifndef _M2_MAX_OFFSET +#define _M2_MAX_OFFSET __MAX_OFFSET(M2X_BITS) +#endif +#ifndef _M3_MAX_OFFSET +#define _M3_MAX_OFFSET (__MAX_OFFSET(M3X_BITS) - M3_EOF_OFFSET) +#endif +#ifndef _M4_MAX_OFFSET +#define _M4_MAX_OFFSET _M3_MAX_OFFSET +#endif +#ifndef _MAX_OFFSET +#define _MAX_OFFSET _M4_MAX_OFFSET +#endif + +#if (M3_EOF_OFFSET > 0) && (_M2_MAX_OFFSET == _M3_MAX_OFFSET + M3_EOF_OFFSET) +# undef _M2_MAX_OFFSET +# define _M2_MAX_OFFSET _M3_MAX_OFFSET +#endif +#if (_M2_MAX_OFFSET > _M3_MAX_OFFSET) +# error +#endif + +#define M1_MAX_OFFSET ((lzo_uint) _M1_MAX_OFFSET) +#define M2_MAX_OFFSET ((lzo_uint) _M2_MAX_OFFSET) +#define M3_MAX_OFFSET ((lzo_uint) _M3_MAX_OFFSET) +#define M4_MAX_OFFSET ((lzo_uint) _M4_MAX_OFFSET) +#define MAX_OFFSET ((lzo_uint) _MAX_OFFSET) + + +#ifndef M1_MIN_LEN +#define M1_MIN_LEN (2) +#endif +#ifndef M2_MIN_LEN +#define M2_MIN_LEN (3) +#endif +#ifndef M3_MIN_LEN +#if (M3X_BITS == M2X_BITS) +#define M3_MIN_LEN (M2_MAX_LEN + 1) +#else +#define M3_MIN_LEN (4) +#endif +#endif +#ifndef M4_MIN_LEN +#define M4_MIN_LEN (M3_MAX_LEN + 1) +#endif + +#ifndef M1_MAX_LEN +#define M1_MAX_LEN (M1_MIN_LEN + LZO_SIZE(M1L_BITS) - 1) +#endif +#ifndef M2_MAX_LEN +#define M2_MAX_LEN (M2_MIN_LEN + LZO_SIZE(M2L_BITS) - 3) +#endif +#ifndef M3_MAX_LEN +#define M3_MAX_LEN (M3_MIN_LEN + LZO_SIZE(M3L_BITS) - 2) +#endif +#ifndef M4_MAX_LEN +#define M4_MAX_LEN (ULONG_MAX) +#endif + + +#define M1O_MASK LZO_MASK(M1O_BITS) +#define M1L_MASK LZO_MASK(M1L_BITS) +#define M2O_MASK LZO_MASK(M2O_BITS) +#define M2L_MASK LZO_MASK(M2L_BITS) +#define M3O_MASK LZO_MASK(M3O_BITS) +#define M3L_MASK LZO_MASK(M3L_BITS) +#define M4O_MASK LZO_MASK(M4O_BITS) +#define M4L_MASK LZO_MASK(M4L_BITS) + + +#define M1_MARKER (1 << M1O_BITS) +#define M2_MARKER (2 << M2O_BITS) +#define M3_MARKER (1 << M3L_BITS) +#define M4_MARKER M3_MARKER + + +/*********************************************************************** +// R0 literal run (a long run) +************************************************************************/ + +#ifndef R0MIN +#define R0MIN (LZO_SIZE(R_BITS)) /* Minimum len of R0 run of literals */ +#endif +#define R0MAX (R0MIN + 256 - 1) /* Maximum len of R0 run of literals */ + +#if (R0MAX - (R0MAX & ~7u) >= 7) +#define R0FAST (R0MAX & ~7u) /* R0MAX aligned to 8 byte boundary */ +#else +#define R0FAST (R0MAX & ~15u) /* R0MAX aligned to 8 byte boundary */ +#endif + +#if (R0MAX - R0FAST < 7) || ((R0FAST & 7) != 0) +# error "something went wrong" +#endif +#if (R0FAST * 2 < 512) +# error "R0FAST is not big enough" +#endif + +/* 7 special codes from R0FAST+1 .. R0MAX + * these codes mean long R0 runs with lengths + * 512, 1024, 2048, 4096, 8192, 16384, 32768 + */ + + + +/*********************************************************************** +// matching +************************************************************************/ + +#define PS *m_pos++ != *ip++ + + +/* We already matched M2_MIN_LEN bytes. + * Try to match another M2_MAX_LEN - M2_MIN_LEN bytes. */ + +#if (M2_MAX_LEN - M2_MIN_LEN == 4) +# define MATCH_M2X (PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 5) +# define MATCH_M2X (PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 6) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 7) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 13) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 14) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 16) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS || PS || PS || PS) +#elif (M2_MAX_LEN - M2_MIN_LEN == 29) +# define MATCH_M2X (PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS || PS || PS || PS || \ + PS || PS || PS || PS || PS) +#else +# error "MATCH_M2X not yet implemented" +#endif + + +/* We already matched M2_MIN_LEN bytes. + * Try to match another M2_MAX_LEN + 1 - M2_MIN_LEN bytes + * to see if we get more than a M2 match */ + +#define MATCH_M2 (MATCH_M2X || PS) + + +/*********************************************************************** +// copying +************************************************************************/ + +#define _CP *op++ = *m_pos++ + +#if (M2_MIN_LEN == 2) +# define COPY_M2X _CP +#elif (M2_MIN_LEN == 3) +# define COPY_M2X _CP; _CP +#elif (M2_MIN_LEN == 4) +# define COPY_M2X _CP; _CP; _CP +#else +# error "COPY_M2X not yet implemented" +#endif + +#if (M3_MIN_LEN == 3) +# define COPY_M3X _CP; _CP +#elif (M3_MIN_LEN == 4) +# define COPY_M3X _CP; _CP; _CP +#elif (M3_MIN_LEN == 9) +# define COPY_M3X _CP; _CP; _CP; _CP; _CP; _CP; _CP; _CP +#else +# error "COPY_M3X not yet implemented" +#endif + +#define COPY_M2 COPY_M2X; *op++ = *m_pos++ +#define COPY_M3 COPY_M3X; *op++ = *m_pos++ + + +/*********************************************************************** +// +************************************************************************/ + +#if defined(LZO_NEED_DICT_H) + +#define DL_MIN_LEN M2_MIN_LEN +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) +#include "lzo_dict.h" + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif +#ifndef MAX_LOOKBEHIND +#define MAX_LOOKBEHIND (MAX_OFFSET) +#endif + +#endif /* defined(LZO_NEED_DICT_H) */ + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_r.ch b/thirdparty/lzo/2.03/src/lzo1b_r.ch new file mode 100644 index 0000000..b350748 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_r.ch @@ -0,0 +1,117 @@ +/* lzo1b_r.ch -- literal run handling for the the LZO1B/LZO1C algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// store a literal run (internal) +************************************************************************/ + +LZO_PUBLIC(lzo_bytep ) +STORE_RUN ( lzo_bytep const oo, const lzo_bytep const ii, lzo_uint r_len) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; + + LZO_STATS(lzo_stats->literals += r_len); + + op = oo; + ip = ii; + assert(r_len > 0); + + /* code a long R0 run */ + if (r_len >= 512) + { + unsigned r_bits = 6; /* 256 << 6 == 16384 */ + lzo_uint tt = 32768u; + + while (r_len >= (t = tt)) + { + r_len -= t; + *op++ = 0; *op++ = (R0FAST - R0MIN) + 7; + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0long_runs++); + } + tt >>= 1; + do { + if (r_len >= (t = tt)) + { + r_len -= t; + *op++ = 0; *op++ = LZO_BYTE((R0FAST - R0MIN) + r_bits); + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0long_runs++); + } + tt >>= 1; + } while (--r_bits > 0); + } + assert(r_len < 512); + + while (r_len >= (t = R0FAST)) + { + r_len -= t; + *op++ = 0; *op++ = (R0FAST - R0MIN); + MEMCPY8_DS(op, ip, t); + LZO_STATS(lzo_stats->r0fast_runs++); + } + + t = r_len; + if (t >= R0MIN) + { + /* code a short R0 run */ + *op++ = 0; *op++ = LZO_BYTE(t - R0MIN); + MEMCPY_DS(op, ip, t); + LZO_STATS(lzo_stats->r0short_runs++); + } + else if (t > 0) + { + /* code a short literal run */ + LZO_STATS(lzo_stats->lit_runs++); + LZO_STATS(lzo_stats->lit_run[t]++); + *op++ = LZO_BYTE(t); + MEMCPY_DS(op, ip, t); + } + + return op; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1b_rr.c b/thirdparty/lzo/2.03/src/lzo1b_rr.c new file mode 100644 index 0000000..c4a3fc4 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_rr.c @@ -0,0 +1,43 @@ +/* lzo1b_rr.c -- literal run handling + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1b.h" + +#include "lzo1b_r.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1b_sm.ch b/thirdparty/lzo/2.03/src/lzo1b_sm.ch new file mode 100644 index 0000000..aa67f21 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_sm.ch @@ -0,0 +1,210 @@ +/* lzo1b_sm.ch -- implementation of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + + +/*********************************************************************** +// search for a match +************************************************************************/ + +#if (DD_BITS == 0) + + /* search ip in the dictionary */ + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + + +#else /* (DD_BITS == 0) */ + + + + /* search ip in the deepened dictionary */ + { + lzo_dict_p d = &dict [ DINDEX(dv,ip) ]; + const lzo_bytep ip_sav; + unsigned j = DD_SIZE; + lzo_uint x_len; + lzo_uint x_off; + + DVAL_ASSERT(dv,ip); + + ip_sav = ip; + m_len = 0; + do { +#if !defined(NDEBUG) + const lzo_bytep z_pos = NULL; +#endif +#if defined(LZO_DICT_USE_PTR) + m_pos = *d; + assert((z_pos = m_pos) == *d); +#if defined(LZO_DETERMINISTIC) + assert(m_pos == NULL || m_pos >= in); + assert(m_pos == NULL || m_pos < ip); +#endif +#else + x_off = *d; +#endif + assert(ip == ip_sav); + + if (LZO_CHECK_MPOS(m_pos,x_off,in,ip,MAX_OFFSET)) +#if (CLEVEL == 9) + *d = DENTRY(ip,in); +#else + ((void)(0)); +#endif + else if (m_pos[m_len] != ip[m_len]) + ((void)(0)); + else if (*m_pos++ == *ip++ && *m_pos++ == *ip++ && *m_pos++ == *ip++) + { +#if !defined(LZO_DICT_USE_PTR) + assert((z_pos = ip - 3 - x_off) == (m_pos - 3)); +#endif + /* a match */ + if (MATCH_M2) + { + x_len = pd((ip - 1), ip_sav); + if (x_len > m_len) + { + m_len = x_len; + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + } +#if (CLEVEL == 9) + /* try to find a closer match */ + else if (x_len == m_len && x_off < m_off) + { + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + } +#endif + } + else + { + assert((ip - ip_sav) == M2_MAX_LEN + 1); +#if (CLEVEL == 9) +#if defined(MATCH_IP_END) + { + const lzo_bytep end; + end = MATCH_IP_END; + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + assert(ip <= in_end); + x_len = pd(ip, ip_sav); + } + if (x_len > m_len) + { + m_len = x_len; + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + if (ip >= MATCH_IP_END) + { + ip = ip_sav; +#if 0 + /* not needed - we are at the end */ + d -= DD_SIZE - j; + assert(d == &dict [ DINDEX(dv,ip) ]); + UPDATE_P(d,drun,ip,in); +#endif + goto match; + } + } + else if (x_len == m_len && x_off < m_off) + { + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + } +#else + /* try to find a closer match */ + if (m_len < M2_MAX_LEN + 1 || x_off < m_off) + { + m_len = M2_MAX_LEN + 1; + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + } +#endif +#else + /* don't search for a longer/closer match */ + m_len = M2_MAX_LEN + 1; + m_off = x_off; + assert((m_pos_sav = z_pos) != NULL); + ip = ip_sav; + d -= DD_SIZE - j; + assert(d == &dict [ DINDEX(dv,ip) ]); + UPDATE_P(d,drun,ip,in); + goto match; +#endif + } + ip = ip_sav; + } + else + ip = ip_sav; + d++; + } while (--j > 0); + assert(ip == ip_sav); + + d -= DD_SIZE; + assert(d == &dict [ DINDEX(dv,ip) ]); + UPDATE_P(d,drun,ip,in); + } + +#endif /* (DD_BITS == 0) */ + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1b_tm.ch b/thirdparty/lzo/2.03/src/lzo1b_tm.ch new file mode 100644 index 0000000..6d929de --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_tm.ch @@ -0,0 +1,99 @@ +/* lzo1b_tm.ch -- implementation of the LZO1B compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + + +/*********************************************************************** +// test for a potential match +************************************************************************/ + + +#if (DD_BITS == 0) + +try_match: +#if !defined(NDEBUG) && defined(LZO_DICT_USE_PTR) +#if defined(LZO_DETERMINISTIC) + assert(m_pos == NULL || m_pos >= in); + assert(m_pos == NULL || m_pos < ip); +#endif + m_pos_sav = m_pos; +#endif + if (m_pos[0] == ip[0] && m_pos[1] == ip[1] && m_pos[2] == ip[2]) + { + m_pos += 3; + goto match; + } + + +#else /* (DD_BITS == 0) */ + + + /* test potential match */ + + if (m_len > M2_MIN_LEN) + goto match; + if (m_len == M2_MIN_LEN) + { +#if (_MAX_OFFSET == _M2_MAX_OFFSET) + goto match; +#else + if (m_off <= M2_MAX_OFFSET) + goto match; +#if 0 && (M3_MIN_LEN == M2_MIN_LEN) + if (ip == ii) + goto match; +#endif +#endif + } + goto literal; + + +#endif /* (DD_BITS == 0) */ + + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo1b_xx.c b/thirdparty/lzo/2.03/src/lzo1b_xx.c new file mode 100644 index 0000000..11cfe35 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1b_xx.c @@ -0,0 +1,98 @@ +/* lzo1b_xx.c -- LZO1B compression public entry point + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1b.h" + + +/*********************************************************************** +// +************************************************************************/ + +static const lzo_compress_t * const c_funcs [9] = +{ + &_lzo1b_1_compress_func, + &_lzo1b_2_compress_func, + &_lzo1b_3_compress_func, + &_lzo1b_4_compress_func, + &_lzo1b_5_compress_func, + &_lzo1b_6_compress_func, + &_lzo1b_7_compress_func, + &_lzo1b_8_compress_func, + &_lzo1b_9_compress_func +}; + + +lzo_compress_t _lzo1b_get_compress_func(int clevel) +{ + const lzo_compress_t *f; + + if (clevel < LZO1B_BEST_SPEED || clevel > LZO1B_BEST_COMPRESSION) + { + if (clevel == LZO1B_DEFAULT_COMPRESSION) + clevel = LZO1B_BEST_SPEED; + else + return 0; + } + f = c_funcs[clevel-1]; + assert(f && *f); + return *f; +} + + +LZO_PUBLIC(int) +lzo1b_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + int clevel ) +{ + lzo_compress_t f; + + f = _lzo1b_get_compress_func(clevel); + if (!f) + return LZO_E_ERROR; + return _lzo1b_do_compress(src,src_len,dst,dst_len,wrkmem,f); +} + + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1c_1.c b/thirdparty/lzo/2.03/src/lzo1c_1.c new file mode 100644 index 0000000..9435882 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_1.c @@ -0,0 +1,46 @@ +/* lzo1c_1.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 1 + +#define DDBITS 0 +#define CLEVEL 1 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_2.c b/thirdparty/lzo/2.03/src/lzo1c_2.c new file mode 100644 index 0000000..b2b52b2 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_2.c @@ -0,0 +1,46 @@ +/* lzo1c_2.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 2 + +#define DDBITS 0 +#define CLEVEL 2 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_3.c b/thirdparty/lzo/2.03/src/lzo1c_3.c new file mode 100644 index 0000000..5b1ea99 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_3.c @@ -0,0 +1,46 @@ +/* lzo1c_3.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 3 + +#define DDBITS 0 +#define CLEVEL 3 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_4.c b/thirdparty/lzo/2.03/src/lzo1c_4.c new file mode 100644 index 0000000..043c93d --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_4.c @@ -0,0 +1,46 @@ +/* lzo1c_4.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 4 + +#define DDBITS 1 +#define CLEVEL 2 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_5.c b/thirdparty/lzo/2.03/src/lzo1c_5.c new file mode 100644 index 0000000..e25968f --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_5.c @@ -0,0 +1,46 @@ +/* lzo1c_5.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 5 + +#define DDBITS 1 +#define CLEVEL 3 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_6.c b/thirdparty/lzo/2.03/src/lzo1c_6.c new file mode 100644 index 0000000..cc14297 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_6.c @@ -0,0 +1,46 @@ +/* lzo1c_6.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 6 + +#define DDBITS 1 +#define CLEVEL 5 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_7.c b/thirdparty/lzo/2.03/src/lzo1c_7.c new file mode 100644 index 0000000..e41ebdb --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_7.c @@ -0,0 +1,46 @@ +/* lzo1c_7.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 7 + +#define DDBITS 2 +#define CLEVEL 3 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_8.c b/thirdparty/lzo/2.03/src/lzo1c_8.c new file mode 100644 index 0000000..f7542e7 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_8.c @@ -0,0 +1,46 @@ +/* lzo1c_8.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 8 + +#define DDBITS 2 +#define CLEVEL 8 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_9.c b/thirdparty/lzo/2.03/src/lzo1c_9.c new file mode 100644 index 0000000..f84a01a --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_9.c @@ -0,0 +1,46 @@ +/* lzo1c_9.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 9 + +#define DDBITS 2 +#define CLEVEL 9 +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_99.c b/thirdparty/lzo/2.03/src/lzo1c_99.c new file mode 100644 index 0000000..cd60402 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_99.c @@ -0,0 +1,49 @@ +/* lzo1c_99.c -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define COMPRESS_ID 99 + +#define DDBITS 3 +#define CLEVEL 9 + +#define D_BITS 16 +#define MATCH_IP_END in_end +#include "compr1c.h" + diff --git a/thirdparty/lzo/2.03/src/lzo1c_9x.c b/thirdparty/lzo/2.03/src/lzo1c_9x.c new file mode 100644 index 0000000..d96c3e9 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_9x.c @@ -0,0 +1,379 @@ +/* lzo1c_9x.c -- implementation of the LZO1C-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1c.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define N 16383 /* size of ring buffer */ +#define THRESHOLD 2 /* lower limit for match length */ +#define F 2048 /* upper limit for match length */ + + +#define LZO1C +#define LZO_COMPRESS_T lzo1c_999_t +#define lzo_swd_t lzo1c_999_swd_t +#include "lzo_mchw.ch" + + + +/*********************************************************************** +// +************************************************************************/ + +static lzo_bytep +code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off ) +{ + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + { + assert(m_len >= M2_MIN_LEN); + assert(m_off >= M2_MIN_OFFSET); + + m_off -= M2_MIN_OFFSET; + /* code match len + low offset bits */ + *op++ = LZO_BYTE(((m_len - (M2_MIN_LEN - 2)) << M2O_BITS) | + (m_off & M2O_MASK)); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M2O_BITS); + c->m2_m++; + } + else + { + assert(m_len >= M3_MIN_LEN); + assert(m_off <= M3_MAX_OFFSET); + + m_off -= M3_MIN_OFFSET - M3_EOF_OFFSET; + /* code match len */ + if (m_len <= M3_MAX_LEN) + *op++ = LZO_BYTE(M3_MARKER | (m_len - (M3_MIN_LEN - 1))); + else + { + assert(m_len >= M4_MIN_LEN); + /* code M4 match len flag */ + *op++ = M4_MARKER; + /* code match len */ + m_len -= M4_MIN_LEN - 1; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + /* code low offset bits */ + *op++ = LZO_BYTE(m_off & M3O_MASK); + /* code high offset bits */ + *op++ = LZO_BYTE(m_off >> M3O_BITS); + + c->r1_m_len = 0; + c->m3 = op; + c->m3_m++; + } + return op; +} + + +/*********************************************************************** +// this is a public function, but there is no prototype in a header file +************************************************************************/ + +LZO_EXTERN(int) +lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ); + +LZO_PUBLIC(int) +lzo1c_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ) +{ + lzo_bytep op; + const lzo_bytep ii; + lzo_uint lit; + lzo_uint m_len, m_off; + LZO_COMPRESS_T cc; + LZO_COMPRESS_T * const c = &cc; + lzo_swd_p const swd = (lzo_swd_p) wrkmem; + int r; + + /* sanity check */ + LZO_COMPILE_TIME_ASSERT(LZO1C_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) + + c->init = 0; + c->ip = c->in = in; + c->in_end = in + in_len; + c->cb = cb; + c->r1_r = c->m3_r = c->m2_m = c->m3_m = 0; + + op = out; + ii = c->ip; /* point to start of literal run */ + lit = 0; + c->r1_m_len = 0; + c->m3 = out + 1; /* pointer after last m3/m4 match */ + + r = init_match(c,swd,NULL,0,0); + if (r != 0) + return r; + if (max_chain > 0) + swd->max_chain = max_chain; + + r = find_match(c,swd,0,0); + if (r != 0) + return r; + while (c->look > 0) + { + int lazy_match_min_gain = -1; + lzo_uint ahead = 0; + + m_len = c->m_len; + m_off = c->m_off; + +#if 0 + printf("%5ld: %5d len:%3d off:%5d\n", (c->ip-c->look)-in, c->look, + m_len, m_off); +#endif + + assert(c->ip - c->look >= in); + if (lit == 0) + ii = c->ip - c->look; + assert(ii + lit == c->ip - c->look); + assert(swd->b_char == *(c->ip - c->look)); + + if ((m_len < M2_MIN_LEN) || + (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET)) + { + m_len = 0; + } + else + { + assert(c->ip - c->look - m_off >= in); + assert(c->ip - c->look - m_off + m_len < c->ip); + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); + + if (lit > 0) + { + /* we have a current literal run: do not try a lazy match, + if the literal could be coded into a r1 or m3 match */ + if (lit == 1 && c->r1_m_len == M2_MIN_LEN) + lazy_match_min_gain = -1; + else if (lit == 3 && op == c->m3) + lazy_match_min_gain = -1; + else if (lit < 3 && op == c->m3) + lazy_match_min_gain = 0; + else + lazy_match_min_gain = 1; + +#if (M2_MIN_LEN == 2) + if (m_len == 2) + { + /* don't code a match of len 2 if we have to + code a literal run. Code a literal instead. */ + m_len = 0; + } +#endif +#if (M2_MIN_LEN == M3_MIN_LEN) + if (m_len == M2_MIN_LEN && m_off > M2_MAX_OFFSET) + { + /* don't code a M3 match of len 3 if we have to + code a literal run. Code a literal instead. */ + m_len = 0; + } +#endif + } + else + { + /* no current literal run: only try a lazy match, + if the literal could be coded into a r1 or m3 match */ + if (c->r1_m_len == M2_MIN_LEN || op == c->m3) + lazy_match_min_gain = 0; + else + lazy_match_min_gain = -1; + } + } + + + /* try a lazy match */ + if (m_len == 0) + lazy_match_min_gain = -1; + if (lazy_match_min_gain >= 0 && c->look > m_len) + { + assert(m_len > 0); + + r = find_match(c,swd,1,0); + assert(r == 0); + assert(c->look > 0); + + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET && + c->m_off > M2_MAX_OFFSET) + lazy_match_min_gain += 1; + + if (c->m_len >= m_len + lazy_match_min_gain) + { + c->lazy++; +#if !defined(NDEBUG) + m_len = c->m_len; + m_off = c->m_off; + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); +#endif + lit++; + assert(ii + lit == c->ip - c->look); + continue; + } + else + { + ahead = 1; + assert(ii + lit + 1 == c->ip - c->look); + } + assert(m_len > 0); + } + assert(ii + lit + ahead == c->ip - c->look); + + + if (m_len == 0) + { + /* a literal */ + lit++; + r = find_match(c,swd,1,0); + assert(r == 0); + } + else + { + /* 1 - store run */ + if (lit > 0) + { + /* code current literal run */ + if (lit == 1 && c->r1_m_len == M2_MIN_LEN) + { + /* Code a context sensitive R1 match. */ + assert((op[-2] >> M2O_BITS) == (M2_MARKER >> M2O_BITS)); + op[-2] &= M2O_MASK; + assert((op[-2] >> M2O_BITS) == 0); + /* copy 1 literal */ + *op++ = *ii++; + assert(ii + ahead == c->ip - c->look); + c->r1_r++; + } + else if (lit < 4 && op == c->m3) + { + assert((c->m3[-2] >> M3O_BITS) == 0); + c->m3[-2] |= LZO_BYTE(lit << M3O_BITS); + MEMCPY_DS(op, ii, lit); + assert(ii + ahead == c->ip - c->look); + c->m3_r++; + } + else + { + op = STORE_RUN(op,ii,lit); + } + if (lit < R0FAST) + c->r1_m_len = m_len; + else + c->r1_m_len = 0; + lit = 0; + } + else + c->r1_m_len = 0; + + /* 2 - code match */ + op = code_match(c,op,m_len,m_off); + r = find_match(c,swd,m_len,1+ahead); + assert(r == 0); + } + + c->codesize = pd(op, out); + } + + + /* store final run */ + if (lit > 0) + op = STORE_RUN(op,ii,lit); + +#if defined(LZO_EOF_CODE) + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; +#endif + + c->codesize = pd(op, out); + assert(c->textsize == in_len); + + *out_len = pd(op, out); + + if (c->cb && c->cb->nprogress) + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + +#if 0 + printf("%ld %ld -> %ld: %ld %ld %ld %ld %ld\n", + (long) c->textsize, (long)in_len, (long) c->codesize, + c->r1_r, c->m3_r, c->m2_m, c->m3_m, c->lazy); +#endif + return LZO_E_OK; +} + + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1c_999_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return lzo1c_999_compress_callback(in,in_len,out,out_len,wrkmem, + (lzo_callback_p) 0, 0); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1c_cc.c b/thirdparty/lzo/2.03/src/lzo1c_cc.c new file mode 100644 index 0000000..6e367df --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_cc.c @@ -0,0 +1,167 @@ +/* lzo1c_cc.c -- LZO1C compression internal entry point + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#include "config1c.h" + + +/*********************************************************************** +// compression internal entry point. +************************************************************************/ + +int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ) +{ + int r; +#if defined(LZO_TEST_COMPRESS_OVERRUN) + lzo_uint avail_out = *out_len; +#endif + + +#if defined(LZO_COLLECT_STATS) + _lzo1c_stats_init(lzo_stats); + lzo_stats->in_len = in_len; +#endif + + + /* don't try to compress a block that's too short */ + if (in_len <= 0) + { + *out_len = 0; + r = LZO_E_OK; + } + else if (in_len <= MIN_LOOKAHEAD + 1) + { +#if defined(LZO_RETURN_IF_NOT_COMPRESSIBLE) + *out_len = 0; + r = LZO_E_NOT_COMPRESSIBLE; +#else + *out_len = pd(STORE_RUN(out,in,in_len), out); + r = (*out_len > in_len) ? LZO_E_OK : LZO_E_ERROR; +#endif + } + else + r = func(in,in_len,out,out_len,wrkmem); + + +#if defined(LZO_EOF_CODE) +#if defined(LZO_TEST_COMPRESS_OVERRUN) + if (r == LZO_E_OK && avail_out - *out_len < 3) + r = LZO_E_COMPRESS_OVERRUN; +#endif + if (r == LZO_E_OK) + { + lzo_bytep op = out + *out_len; + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; + *out_len += 3; + } +#endif + + +#if defined(LZO_COLLECT_STATS) + lzo_stats->out_len = *out_len; + lzo_stats->match_bytes = + 1 * lzo_stats->m1_matches + 2 * lzo_stats->m2_matches + + 3 * lzo_stats->m3_matches + 4 * lzo_stats->m4_matches; + _lzo1c_stats_calc(lzo_stats); +#endif + + return r; +} + + +/*********************************************************************** +// note: this is not thread safe, but as it is used for finetuning only +// we don't care +************************************************************************/ + +#undef lzo_stats +/* lzo_stats_t is still defined */ + + +#if defined(LZO_COLLECT_STATS) + +static lzo_stats_t lzo_statistics; +lzo_stats_t * const lzo1c_stats = &lzo_statistics; + + +void _lzo1c_stats_init(lzo_stats_t *lzo_stats) +{ + lzo_memset(lzo_stats,0,sizeof(*lzo_stats)); +} + + +void _lzo1c_stats_calc(lzo_stats_t *lzo_stats) +{ + lzo_stats->matches = + lzo_stats->m1_matches + lzo_stats->m2_matches + + lzo_stats->m3_matches + lzo_stats->m4_matches; + + lzo_stats->literal_overhead = lzo_stats->lit_runs + + 2 * (lzo_stats->r0short_runs + lzo_stats->r0fast_runs + + lzo_stats->r0long_runs); + lzo_stats->literal_bytes = lzo_stats->literals + + lzo_stats->literal_overhead; + +#if 0 + assert(lzo_stats->match_bytes + lzo_stats->literal_bytes == + lzo_stats->out_len); +#endif + + lzo_stats->m2_matches -= lzo_stats->r1_matches; + lzo_stats->m2_match[M2_MIN_LEN] -= lzo_stats->r1_matches; + + if (lzo_stats->literals > 0) + lzo_stats->literal_overhead_percent = + 100.0 * lzo_stats->literal_overhead / lzo_stats->literals; +} + + +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1c_cc.h b/thirdparty/lzo/2.03/src/lzo1c_cc.h new file mode 100644 index 0000000..14c5904 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_cc.h @@ -0,0 +1,93 @@ +/* lzo1c_cc.h -- definitions for the the LZO1C compression driver + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO1C_CC_H +#define __LZO1C_CC_H + + +/*********************************************************************** +// +************************************************************************/ + +extern const lzo_compress_t _lzo1c_1_compress_func; +extern const lzo_compress_t _lzo1c_2_compress_func; +extern const lzo_compress_t _lzo1c_3_compress_func; +extern const lzo_compress_t _lzo1c_4_compress_func; +extern const lzo_compress_t _lzo1c_5_compress_func; +extern const lzo_compress_t _lzo1c_6_compress_func; +extern const lzo_compress_t _lzo1c_7_compress_func; +extern const lzo_compress_t _lzo1c_8_compress_func; +extern const lzo_compress_t _lzo1c_9_compress_func; + +extern const lzo_compress_t _lzo1c_99_compress_func; + + +/*********************************************************************** +// +************************************************************************/ + +LZO_EXTERN(lzo_bytep ) +_lzo1c_store_run ( lzo_bytep const oo, const lzo_bytep const ii, + lzo_uint r_len); + +#define STORE_RUN _lzo1c_store_run + + +lzo_compress_t _lzo1c_get_compress_func(int clevel); + +int _lzo1c_do_compress ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_compress_t func ); + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + + diff --git a/thirdparty/lzo/2.03/src/lzo1c_d1.c b/thirdparty/lzo/2.03/src/lzo1c_d1.c new file mode 100644 index 0000000..f27438c --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_d1.c @@ -0,0 +1,46 @@ +/* lzo1c_d1.c -- LZO1C decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1c.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1c_decompress + +#include "lzo1b_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1c_d2.c b/thirdparty/lzo/2.03/src/lzo1c_d2.c new file mode 100644 index 0000000..030fef8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_d2.c @@ -0,0 +1,46 @@ +/* lzo1c_d2.c -- LZO1C decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1c.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1c_decompress_safe + +#include "lzo1b_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1c_rr.c b/thirdparty/lzo/2.03/src/lzo1c_rr.c new file mode 100644 index 0000000..ec279f8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_rr.c @@ -0,0 +1,43 @@ +/* lzo1c_rr.c -- literal run handling + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1c.h" + +#include "lzo1b_r.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1c_xx.c b/thirdparty/lzo/2.03/src/lzo1c_xx.c new file mode 100644 index 0000000..f6a547f --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1c_xx.c @@ -0,0 +1,98 @@ +/* lzo1c_xx.c -- LZO1C compression public entry point + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1c.h" + + +/*********************************************************************** +// +************************************************************************/ + +static const lzo_compress_t * const c_funcs [9] = +{ + &_lzo1c_1_compress_func, + &_lzo1c_2_compress_func, + &_lzo1c_3_compress_func, + &_lzo1c_4_compress_func, + &_lzo1c_5_compress_func, + &_lzo1c_6_compress_func, + &_lzo1c_7_compress_func, + &_lzo1c_8_compress_func, + &_lzo1c_9_compress_func +}; + + +lzo_compress_t _lzo1c_get_compress_func(int clevel) +{ + const lzo_compress_t *f; + + if (clevel < LZO1C_BEST_SPEED || clevel > LZO1C_BEST_COMPRESSION) + { + if (clevel == LZO1C_DEFAULT_COMPRESSION) + clevel = LZO1C_BEST_SPEED; + else + return 0; + } + f = c_funcs[clevel-1]; + assert(f && *f); + return *f; +} + + +LZO_PUBLIC(int) +lzo1c_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + int clevel ) +{ + lzo_compress_t f; + + f = _lzo1c_get_compress_func(clevel); + if (!f) + return LZO_E_ERROR; + return _lzo1c_do_compress(src,src_len,dst,dst_len,wrkmem,f); +} + + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1f_1.c b/thirdparty/lzo/2.03/src/lzo1f_1.c new file mode 100644 index 0000000..27608ce --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1f_1.c @@ -0,0 +1,312 @@ +/* lzo1f_1.c -- implementation of the LZO1F-1 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" +#include "lzo/lzo1f.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define M2_MAX_OFFSET 0x0800 +#define M3_MAX_OFFSET 0x3fff +#define M3_MARKER 224 + + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_A +#endif +#define D_BITS 14 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) +#include "lzo_dict.h" + + +/*********************************************************************** +// compress a block of data. +************************************************************************/ + +static __lzo_noinline +int do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - 9; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + op = out; + ip = in; + ii = ip; + + ip++; + for (;;) + { + register const lzo_bytep m_pos; + lzo_uint m_off; + lzo_uint m_len; + lzo_uint dindex; + lzo_uint lit; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M3_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + + +try_match: +#if 0 && defined(LZO_UNALIGNED_OK_2) + if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip) +#else + if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) +#endif + { + } + else + { + if (m_pos[2] == ip[2]) + { + m_pos += 3; +#if 0 + if (m_off <= M2_MAX_OFFSET) + goto match; + if (lit <= 3) + goto match; + if (lit == 3) /* better compression, but slower */ + { + assert(op - 2 > out); op[-2] |= LZO_BYTE(3); + *op++ = *ii++; *op++ = *ii++; *op++ = *ii++; + goto code_match; + } + if (*m_pos == ip[3]) +#endif + goto match; + } + } + + + /* a literal */ +literal: + UPDATE_I(dict,0,dindex,ip,in); + if (++ip >= ip_end) + break; + continue; + + + /* a match */ +match: + UPDATE_I(dict,0,dindex,ip,in); + /* store current literal run */ + lit = pd(ip,ii); + if (lit > 0) + { + register lzo_uint t = lit; + + if (t < 4 && op > out) + op[-2] |= LZO_BYTE(t); + else if (t <= 31) + *op++ = LZO_BYTE(t); + else + { + register lzo_uint tt = t - 31; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + assert(ii == ip); + + + /* code the match */ + ip += 3; + if (*m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++ || + *m_pos++ != *ip++ || *m_pos++ != *ip++ || *m_pos++ != *ip++) + { + --ip; + m_len = pd(ip, ii); + assert(m_len >= 3); assert(m_len <= 8); + + if (m_off <= M2_MAX_OFFSET) + { + m_off -= 1; + *op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); + } + else if (m_len == 3 && m_off <= 2*M2_MAX_OFFSET && lit > 0) + { + m_off -= 1; + /* m_off -= M2_MAX_OFFSET; */ + *op++ = LZO_BYTE(((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); + } + else + { + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + } + else + { + { + const lzo_bytep end; + end = in_end; + while (ip < end && *m_pos == *ip) + m_pos++, ip++; + m_len = pd(ip, ii); + } + assert(m_len >= 3); + + if (m_len <= 33) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= 33; + *op++ = M3_MARKER | 0; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + + ii = ip; + if (ip >= ip_end) + break; + } + + + /* store final literal run */ + if (pd(in_end,ii) > 0) + { + register lzo_uint t = pd(in_end,ii); + + if (t < 4 && op > out) + op[-2] |= LZO_BYTE(t); + else if (t <= 31) + *op++ = LZO_BYTE(t); + else + { + register lzo_uint tt = t - 31; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + *out_len = pd(op, out); + return LZO_E_OK; +} + + +/*********************************************************************** +// public entry point +************************************************************************/ + +LZO_PUBLIC(int) +lzo1f_1_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op = out; + int r = LZO_E_OK; + + if (in_len <= 0) + *out_len = 0; + else if (in_len <= 10) + { + *op++ = LZO_BYTE(in_len); + do *op++ = *in++; while (--in_len > 0); + *out_len = pd(op, out); + } + else + r = do_compress(in,in_len,out,out_len,wrkmem); + + if (r == LZO_E_OK) + { + op = out + *out_len; + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; + *out_len += 3; + } + + return r; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1f_9x.c b/thirdparty/lzo/2.03/src/lzo1f_9x.c new file mode 100644 index 0000000..4240a77 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1f_9x.c @@ -0,0 +1,345 @@ +/* lzo1f_9x.c -- implementation of the LZO1F-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1f.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define N 16383 /* size of ring buffer */ +#define THRESHOLD 2 /* lower limit for match length */ +#define F 2048 /* upper limit for match length */ + + +#define LZO1F +#define LZO_COMPRESS_T lzo1f_999_t +#define lzo_swd_t lzo1f_999_swd_t +#include "lzo_mchw.ch" + + + +/*********************************************************************** +// +************************************************************************/ + +static lzo_bytep +code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off ) +{ + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + { + m_off -= 1; + *op++ = LZO_BYTE(((m_len - 2) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); + c->m2_m++; + } + else if (m_len == M2_MIN_LEN && m_off <= 2 * M2_MAX_OFFSET && + c->r1_lit > 0) + { + assert(m_off > M2_MAX_OFFSET); + m_off -= 1 + M2_MAX_OFFSET; + *op++ = LZO_BYTE(((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); + c->r1_r++; + } + else + { + if (m_len <= M3_MAX_LEN) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= M3_MAX_LEN; + *op++ = M3_MARKER | 0; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + c->m3_m++; + } + + return op; +} + + +static lzo_bytep +STORE_RUN ( lzo_bytep op, const lzo_bytep ii, lzo_uint t, lzo_bytep out ) +{ + if (t < 4 && op > out) + op[-2] |= LZO_BYTE(t); + else if (t <= 31) + *op++ = LZO_BYTE(t); + else + { + lzo_uint tt = t - 31; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + + return op; +} + + +/*********************************************************************** +// this is a public function, but there is no prototype in a header file +************************************************************************/ + +LZO_EXTERN(int) +lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ); + +LZO_PUBLIC(int) +lzo1f_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ) +{ + lzo_bytep op; + const lzo_bytep ii; + lzo_uint lit; + lzo_uint m_len, m_off; + LZO_COMPRESS_T cc; + LZO_COMPRESS_T * const c = &cc; + lzo_swd_p const swd = (lzo_swd_p) wrkmem; + int r; + + /* sanity check */ + LZO_COMPILE_TIME_ASSERT(LZO1F_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) + + c->init = 0; + c->ip = c->in = in; + c->in_end = in + in_len; + c->cb = cb; + c->r1_r = c->m2_m = c->m3_m = 0; + + op = out; + ii = c->ip; /* point to start of literal run */ + lit = 0; + c->r1_lit = c->r1_m_len = 0; + + r = init_match(c,swd,NULL,0,0); + if (r != 0) + return r; + if (max_chain > 0) + swd->max_chain = max_chain; + + r = find_match(c,swd,0,0); + if (r != 0) + return r; + while (c->look > 0) + { + int lazy_match_min_gain = -1; + lzo_uint ahead = 0; + + m_len = c->m_len; + m_off = c->m_off; + + assert(c->ip - c->look >= in); + if (lit == 0) + ii = c->ip - c->look; + assert(ii + lit == c->ip - c->look); + assert(swd->b_char == *(c->ip - c->look)); + + if ((m_len < M2_MIN_LEN) || + (m_len < M3_MIN_LEN && m_off > M2_MAX_OFFSET)) + { + m_len = 0; + } + else + { + assert(c->ip - c->look - m_off >= in); + assert(c->ip - c->look - m_off + m_len < c->ip); + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); + + if (lit < 3) + lazy_match_min_gain = 1; + else if (lit == 3) + lazy_match_min_gain = 3; + else if (lit == 31) + lazy_match_min_gain = 3; + else + lazy_match_min_gain = 1; + } + + /* try a lazy match */ + if (m_len > 0 && lazy_match_min_gain >= 0 && c->look > m_len) + { + r = find_match(c,swd,1,0); + assert(r == 0); + assert(c->look > 0); + + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET && + c->m_off > M2_MAX_OFFSET) + { + lazy_match_min_gain += 1; + } + else if (c->m_len <= M2_MAX_LEN && + c->m_off <= M2_MAX_OFFSET && + m_off > M2_MAX_OFFSET) + { + if (lazy_match_min_gain > 0) + lazy_match_min_gain -= 1; + } + else if (m_len == M2_MIN_LEN && c->m_len == M2_MIN_LEN && + c->m_off <= 2 * M2_MAX_OFFSET && + m_off > M2_MAX_OFFSET) + { + if (lazy_match_min_gain > 0) + lazy_match_min_gain -= 1; + } + + if (c->m_len >= m_len + lazy_match_min_gain) + { + c->lazy++; +#if !defined(NDEBUG) + m_len = c->m_len; + m_off = c->m_off; + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); +#endif + lit++; + assert(ii + lit == c->ip - c->look); + continue; + } + else + { + ahead = 1; + assert(ii + lit + 1 == c->ip - c->look); + } + assert(m_len > 0); + } + assert(ii + lit + ahead == c->ip - c->look); + + + if (m_len == 0) + { + /* a literal */ + lit++; + r = find_match(c,swd,1,0); + assert(r == 0); + } + else + { + /* 1 - store run */ + if (lit > 0) + { + op = STORE_RUN(op,ii,lit,out); + c->r1_m_len = m_len; + c->r1_lit = lit; + lit = 0; + } + else + c->r1_lit = c->r1_m_len = 0; + + /* 2 - code match */ + op = code_match(c,op,m_len,m_off); + r = find_match(c,swd,m_len,1+ahead); + assert(r == 0); + } + + c->codesize = pd(op, out); + } + + + /* store final run */ + if (lit > 0) + op = STORE_RUN(op,ii,lit,out); + +#if defined(LZO_EOF_CODE) + *op++ = M3_MARKER | 1; + *op++ = 0; + *op++ = 0; +#endif + + c->codesize = pd(op, out); + assert(c->textsize == in_len); + + *out_len = pd(op, out); + + if (c->cb && c->cb->nprogress) + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + +#if 0 + printf("%ld %ld -> %ld: %ld %ld %ld %ld\n", + (long) c->textsize, (long)in_len, (long) c->codesize, + c->r1_r, c->m2_m, c->m3_m, c->lazy); +#endif + return LZO_E_OK; +} + + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1f_999_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return lzo1f_999_compress_callback(in,in_len,out,out_len,wrkmem, + (lzo_callback_p) 0, 0); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1f_d.ch b/thirdparty/lzo/2.03/src/lzo1f_d.ch new file mode 100644 index 0000000..282ab35 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1f_d.ch @@ -0,0 +1,223 @@ +/* lzo1f_d.ch -- implementation of the LZO1F decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo1_d.ch" + + +/*********************************************************************** +// decompress a block of data. +************************************************************************/ + +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; + register const lzo_bytep m_pos; + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif + + LZO_UNUSED(wrkmem); + + *out_len = 0; + + op = out; + ip = in; + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t > 31) + goto match; + + /* a literal run */ + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } + /* copy literals */ + assert(t > 0); NEED_OP(t); NEED_IP(t+1); +#if defined(LZO_UNALIGNED_OK_4) + if (t >= 4) + { + do { + * (lzo_uint32p) op = * (const lzo_uint32p) ip; + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else +#endif + do *op++ = *ip++; while (--t > 0); + + t = *ip++; + + while (TEST_IP && TEST_OP) + { + /* handle matches */ + if (t < 32) + { + m_pos = op - 1 - 0x800; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++; + } + else + { +match: + if (t < M3_MARKER) + { + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t >>= 5; + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; + } + else + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } + NEED_IP(2); + m_pos = op; +#if defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; + ip += 2; +#else + m_pos -= *ip++ >> 2; + m_pos -= *ip++ << 6; +#endif + if (m_pos == op) + goto eof_found; + } + + /* copy match */ + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { + * (lzo_uint32p) op = * (const lzo_uint32p) m_pos; + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + * (lzo_uint32p) op = * (const lzo_uint32p) m_pos; + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + } + t = ip[-2] & 3; + if (t == 0) + break; + + /* copy literals */ + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + t = *ip++; + } + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + /* no EOF code was found */ + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1f_d1.c b/thirdparty/lzo/2.03/src/lzo1f_d1.c new file mode 100644 index 0000000..7f70bfd --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1f_d1.c @@ -0,0 +1,46 @@ +/* lzo1f_d1.c -- LZO1F decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1f.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1f_decompress + +#include "lzo1f_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1f_d2.c b/thirdparty/lzo/2.03/src/lzo1f_d2.c new file mode 100644 index 0000000..1e65dcf --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1f_d2.c @@ -0,0 +1,46 @@ +/* lzo1f_d2.c -- LZO1F decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1f.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1f_decompress_safe + +#include "lzo1f_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_1.c b/thirdparty/lzo/2.03/src/lzo1x_1.c new file mode 100644 index 0000000..ac4b85c --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_1.c @@ -0,0 +1,50 @@ +/* lzo1x_1.c -- LZO1X-1 compression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#define D_BITS 14 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) + +#include "config1x.h" + +#define DO_COMPRESS lzo1x_1_compress + +#include "lzo1x_c.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_1k.c b/thirdparty/lzo/2.03/src/lzo1x_1k.c new file mode 100644 index 0000000..e100ff1 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_1k.c @@ -0,0 +1,50 @@ +/* lzo1x_1k.c -- LZO1X-1(11) compression (needs only 8kB work memory) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#define D_BITS 11 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,3,5)) >> 5) +#define D_INDEX2(d,p) d = d ^ D_MASK + +#include "config1x.h" + +#define DO_COMPRESS lzo1x_1_11_compress + +#include "lzo1x_c.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_1l.c b/thirdparty/lzo/2.03/src/lzo1x_1l.c new file mode 100644 index 0000000..1571830 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_1l.c @@ -0,0 +1,50 @@ +/* lzo1x_1l.c -- LZO1X-1(12) compression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#define D_BITS 12 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX2(p,4,5)) >> 5) +#define D_INDEX2(d,p) d = d ^ D_MASK + +#include "config1x.h" + +#define DO_COMPRESS lzo1x_1_12_compress + +#include "lzo1x_c.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_1o.c b/thirdparty/lzo/2.03/src/lzo1x_1o.c new file mode 100644 index 0000000..979ca44 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_1o.c @@ -0,0 +1,50 @@ +/* lzo1x_1o.c -- LZO1X-1(15) compression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#define D_BITS 15 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) + +#include "config1x.h" + +#define DO_COMPRESS lzo1x_1_15_compress + +#include "lzo1x_c.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_9x.c b/thirdparty/lzo/2.03/src/lzo1x_9x.c new file mode 100644 index 0000000..b108bf8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_9x.c @@ -0,0 +1,881 @@ +/* lzo1x_9x.c -- implementation of the LZO1X-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) +# define LZO1X +#endif + +#if defined(LZO1X) +# include "config1x.h" +#elif defined(LZO1Y) +# include "config1y.h" +#elif defined(LZO1Z) +# include "config1z.h" +#else +# error +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define N M4_MAX_OFFSET /* size of ring buffer */ +#define THRESHOLD 1 /* lower limit for match length */ +#define F 2048 /* upper limit for match length */ + +#define SWD_BEST_OFF (LZO_MAX3( M2_MAX_LEN, M3_MAX_LEN, M4_MAX_LEN ) + 1) + +#if defined(LZO1X) +# define LZO_COMPRESS_T lzo1x_999_t +# define lzo_swd_t lzo1x_999_swd_t +#elif defined(LZO1Y) +# define LZO_COMPRESS_T lzo1y_999_t +# define lzo_swd_t lzo1y_999_swd_t +# define lzo1x_999_compress_internal lzo1y_999_compress_internal +# define lzo1x_999_compress_dict lzo1y_999_compress_dict +# define lzo1x_999_compress_level lzo1y_999_compress_level +# define lzo1x_999_compress lzo1y_999_compress +#elif defined(LZO1Z) +# define LZO_COMPRESS_T lzo1z_999_t +# define lzo_swd_t lzo1z_999_swd_t +# define lzo1x_999_compress_internal lzo1z_999_compress_internal +# define lzo1x_999_compress_dict lzo1z_999_compress_dict +# define lzo1x_999_compress_level lzo1z_999_compress_level +# define lzo1x_999_compress lzo1z_999_compress +#else +# error +#endif + +#if 0 +# define HEAD3(b,p) \ + ((((((lzo_xint)b[p]<<3)^b[p+1])<<3)^b[p+2]) & (SWD_HSIZE-1)) +#endif +#if 0 && defined(LZO_UNALIGNED_OK_4) && defined(LZO_ABI_LITTLE_ENDIAN) +# define HEAD3(b,p) \ + (((* (lzo_uint32p) &b[p]) ^ ((* (lzo_uint32p) &b[p])>>10)) & (SWD_HSIZE-1)) +#endif + +#include "lzo_mchw.ch" + + +/* this is a public functions, but there is no prototype in a header file */ +LZO_EXTERN(int) +lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int try_lazy, + lzo_uint good_length, + lzo_uint max_lazy, + lzo_uint nice_length, + lzo_uint max_chain, + lzo_uint32 flags ); + + +/*********************************************************************** +// +************************************************************************/ + +static lzo_bytep +code_match ( LZO_COMPRESS_T *c, lzo_bytep op, lzo_uint m_len, lzo_uint m_off ) +{ + lzo_uint x_len = m_len; + lzo_uint x_off = m_off; + + c->match_bytes += (unsigned long) m_len; + +#if 0 +/* + static lzo_uint last_m_len = 0, last_m_off = 0; + static lzo_uint prev_m_off[4]; + static int prev_m_off_ptr = 0; + int i; + + //if (m_len >= 3 && m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + if (m_len >= 3 && m_len <= M2_MAX_LEN) + { + //if (m_len == last_m_len && m_off == last_m_off) + //printf("last_m_len + last_m_off\n"); + //else + if (m_off == last_m_off) + printf("last_m_off\n"); + else + { + for (i = 0; i < 4; i++) + if (m_off == prev_m_off[i]) + printf("prev_m_off %d: %5ld\n",i,(long)m_off); + } + } + last_m_len = m_len; + last_m_off = prev_m_off[prev_m_off_ptr] = m_off; + prev_m_off_ptr = (prev_m_off_ptr + 1) & 3; +*/ +#endif + + assert(op > c->out); + if (m_len == 2) + { + assert(m_off <= M1_MAX_OFFSET); + assert(c->r1_lit > 0); assert(c->r1_lit < 4); + m_off -= 1; +#if defined(LZO1Z) + *op++ = LZO_BYTE(M1_MARKER | (m_off >> 6)); + *op++ = LZO_BYTE(m_off << 2); +#else + *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + c->m1a_m++; + } +#if defined(LZO1Z) + else if (m_len <= M2_MAX_LEN && (m_off <= M2_MAX_OFFSET || m_off == c->last_m_off)) +#else + else if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) +#endif + { + assert(m_len >= 3); +#if defined(LZO1X) + m_off -= 1; + *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); + assert(op[-2] >= M2_MARKER); +#elif defined(LZO1Y) + m_off -= 1; + *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); + assert(op[-2] >= M2_MARKER); +#elif defined(LZO1Z) + if (m_off == c->last_m_off) + *op++ = LZO_BYTE(((m_len - 1) << 5) | (0x700 >> 6)); + else + { + m_off -= 1; + *op++ = LZO_BYTE(((m_len - 1) << 5) | (m_off >> 6)); + *op++ = LZO_BYTE(m_off << 2); + } +#endif + c->m2_m++; + } + else if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && c->r1_lit >= 4) + { + assert(m_len == 3); + assert(m_off > M2_MAX_OFFSET); + m_off -= 1 + M2_MAX_OFFSET; +#if defined(LZO1Z) + *op++ = LZO_BYTE(M1_MARKER | (m_off >> 6)); + *op++ = LZO_BYTE(m_off << 2); +#else + *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + c->m1b_m++; + } + else if (m_off <= M3_MAX_OFFSET) + { + assert(m_len >= 3); + m_off -= 1; + if (m_len <= M3_MAX_LEN) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= M3_MAX_LEN; + *op++ = M3_MARKER | 0; + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } +#if defined(LZO1Z) + *op++ = LZO_BYTE(m_off >> 6); + *op++ = LZO_BYTE(m_off << 2); +#else + *op++ = LZO_BYTE(m_off << 2); + *op++ = LZO_BYTE(m_off >> 6); +#endif + c->m3_m++; + } + else + { + lzo_uint k; + + assert(m_len >= 3); + assert(m_off > 0x4000); assert(m_off <= 0xbfff); + m_off -= 0x4000; + k = (m_off & 0x4000) >> 11; + if (m_len <= M4_MAX_LEN) + *op++ = LZO_BYTE(M4_MARKER | k | (m_len - 2)); + else + { + m_len -= M4_MAX_LEN; + *op++ = LZO_BYTE(M4_MARKER | k | 0); + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } +#if defined(LZO1Z) + *op++ = LZO_BYTE(m_off >> 6); + *op++ = LZO_BYTE(m_off << 2); +#else + *op++ = LZO_BYTE(m_off << 2); + *op++ = LZO_BYTE(m_off >> 6); +#endif + c->m4_m++; + } + + c->last_m_len = x_len; + c->last_m_off = x_off; + return op; +} + + +static lzo_bytep +STORE_RUN ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii, lzo_uint t ) +{ + c->lit_bytes += (unsigned long) t; + + if (op == c->out && t <= 238) + { + *op++ = LZO_BYTE(17 + t); + } + else if (t <= 3) + { +#if defined(LZO1Z) + op[-1] |= LZO_BYTE(t); +#else + op[-2] |= LZO_BYTE(t); +#endif + c->lit1_r++; + } + else if (t <= 18) + { + *op++ = LZO_BYTE(t - 3); + c->lit2_r++; + } + else + { + lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + c->lit3_r++; + } + do *op++ = *ii++; while (--t > 0); + + return op; +} + + +static lzo_bytep +code_run ( LZO_COMPRESS_T *c, lzo_bytep op, const lzo_bytep ii, + lzo_uint lit, lzo_uint m_len ) +{ + if (lit > 0) + { + assert(m_len >= 2); + op = STORE_RUN(c,op,ii,lit); + c->r1_m_len = m_len; + c->r1_lit = lit; + } + else + { + assert(m_len >= 3); + c->r1_m_len = 0; + c->r1_lit = 0; + } + + return op; +} + + +/*********************************************************************** +// +************************************************************************/ + +static int +len_of_coded_match ( lzo_uint m_len, lzo_uint m_off, lzo_uint lit ) +{ + int n = 4; + + if (m_len < 2) + return -1; + if (m_len == 2) + return (m_off <= M1_MAX_OFFSET && lit > 0 && lit < 4) ? 2 : -1; + if (m_len <= M2_MAX_LEN && m_off <= M2_MAX_OFFSET) + return 2; + if (m_len == M2_MIN_LEN && m_off <= MX_MAX_OFFSET && lit >= 4) + return 2; + if (m_off <= M3_MAX_OFFSET) + { + if (m_len <= M3_MAX_LEN) + return 3; + m_len -= M3_MAX_LEN; + while (m_len > 255) + { + m_len -= 255; + n++; + } + return n; + } + if (m_off <= M4_MAX_OFFSET) + { + if (m_len <= M4_MAX_LEN) + return 3; + m_len -= M4_MAX_LEN; + while (m_len > 255) + { + m_len -= 255; + n++; + } + return n; + } + return -1; +} + + +static lzo_int +min_gain(lzo_uint ahead, lzo_uint lit1, lzo_uint lit2, int l1, int l2, int l3) +{ + lzo_int lazy_match_min_gain = 0; + + assert (ahead >= 1); + lazy_match_min_gain += ahead; + +#if 0 + if (l3 > 0) + lit2 -= ahead; +#endif + + if (lit1 <= 3) + lazy_match_min_gain += (lit2 <= 3) ? 0 : 2; + else if (lit1 <= 18) + lazy_match_min_gain += (lit2 <= 18) ? 0 : 1; + + lazy_match_min_gain += (l2 - l1) * 2; + if (l3 > 0) + lazy_match_min_gain -= (ahead - l3) * 2; + + if (lazy_match_min_gain < 0) + lazy_match_min_gain = 0; + +#if 0 + if (l1 == 2) + if (lazy_match_min_gain == 0) + lazy_match_min_gain = 1; +#endif + + return lazy_match_min_gain; +} + + +/*********************************************************************** +// +************************************************************************/ + +#if !defined(NDEBUG) +static +void assert_match( const lzo_swd_p swd, lzo_uint m_len, lzo_uint m_off ) +{ + const LZO_COMPRESS_T *c = swd->c; + lzo_uint d_off; + + assert(m_len >= 2); + if (m_off <= (lzo_uint) (c->bp - c->in)) + { + assert(c->bp - m_off + m_len < c->ip); + assert(lzo_memcmp(c->bp, c->bp - m_off, m_len) == 0); + } + else + { + assert(swd->dict != NULL); + d_off = m_off - (lzo_uint) (c->bp - c->in); + assert(d_off <= swd->dict_len); + if (m_len > d_off) + { + assert(lzo_memcmp(c->bp, swd->dict_end - d_off, d_off) == 0); + assert(c->in + m_len - d_off < c->ip); + assert(lzo_memcmp(c->bp + d_off, c->in, m_len - d_off) == 0); + } + else + { + assert(lzo_memcmp(c->bp, swd->dict_end - d_off, m_len) == 0); + } + } +} +#else +# define assert_match(a,b,c) ((void)0) +#endif + + +#if defined(SWD_BEST_OFF) + +static void +better_match ( const lzo_swd_p swd, lzo_uint *m_len, lzo_uint *m_off ) +{ +#if defined(LZO1Z) + const LZO_COMPRESS_T *c = swd->c; +#endif + + if (*m_len <= M2_MIN_LEN) + return; +#if defined(LZO1Z) + if (*m_off == c->last_m_off && *m_len <= M2_MAX_LEN) + return; +#if 1 + if (*m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 && + c->last_m_off && swd->best_off[*m_len-1] == c->last_m_off) + { + *m_len = *m_len - 1; + *m_off = swd->best_off[*m_len]; + return; + } +#endif +#endif + + if (*m_off <= M2_MAX_OFFSET) + return; + +#if 1 + /* M3/M4 -> M2 */ + if (*m_off > M2_MAX_OFFSET && + *m_len >= M2_MIN_LEN + 1 && *m_len <= M2_MAX_LEN + 1 && + swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M2_MAX_OFFSET) + { + *m_len = *m_len - 1; + *m_off = swd->best_off[*m_len]; + return; + } +#endif + +#if 1 + /* M4 -> M2 */ + if (*m_off > M3_MAX_OFFSET && + *m_len >= M4_MAX_LEN + 1 && *m_len <= M2_MAX_LEN + 2 && + swd->best_off[*m_len-2] && swd->best_off[*m_len-2] <= M2_MAX_OFFSET) + { + *m_len = *m_len - 2; + *m_off = swd->best_off[*m_len]; + return; + } +#endif + +#if 1 + /* M4 -> M3 */ + if (*m_off > M3_MAX_OFFSET && + *m_len >= M4_MAX_LEN + 1 && *m_len <= M3_MAX_LEN + 1 && + swd->best_off[*m_len-1] && swd->best_off[*m_len-1] <= M3_MAX_OFFSET) + { + *m_len = *m_len - 1; + *m_off = swd->best_off[*m_len]; + } +#endif +} + +#endif + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1x_999_compress_internal ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int try_lazy, + lzo_uint good_length, + lzo_uint max_lazy, + lzo_uint nice_length, + lzo_uint max_chain, + lzo_uint32 flags ) +{ + lzo_bytep op; + const lzo_bytep ii; + lzo_uint lit; + lzo_uint m_len, m_off; + LZO_COMPRESS_T cc; + LZO_COMPRESS_T * const c = &cc; + lzo_swd_p const swd = (lzo_swd_p) wrkmem; + int r; + + /* sanity check */ +#if defined(LZO1X) + LZO_COMPILE_TIME_ASSERT(LZO1X_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) +#elif defined(LZO1Y) + LZO_COMPILE_TIME_ASSERT(LZO1Y_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) +#elif defined(LZO1Z) + LZO_COMPILE_TIME_ASSERT(LZO1Z_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) +#else +# error +#endif + +/* setup parameter defaults */ + /* number of lazy match tries */ + if (try_lazy < 0) + try_lazy = 1; + /* reduce lazy match search if we already have a match with this length */ + if (good_length <= 0) + good_length = 32; + /* do not try a lazy match if we already have a match with this length */ + if (max_lazy <= 0) + max_lazy = 32; + /* stop searching for longer matches than this one */ + if (nice_length <= 0) + nice_length = 0; + /* don't search more positions than this */ + if (max_chain <= 0) + max_chain = SWD_MAX_CHAIN; + + c->init = 0; + c->ip = c->in = in; + c->in_end = in + in_len; + c->out = out; + c->cb = cb; + c->m1a_m = c->m1b_m = c->m2_m = c->m3_m = c->m4_m = 0; + c->lit1_r = c->lit2_r = c->lit3_r = 0; + + op = out; + ii = c->ip; /* point to start of literal run */ + lit = 0; + c->r1_lit = c->r1_m_len = 0; + + r = init_match(c,swd,dict,dict_len,flags); + if (r != 0) + return r; + if (max_chain > 0) + swd->max_chain = max_chain; + if (nice_length > 0) + swd->nice_length = nice_length; + + r = find_match(c,swd,0,0); + if (r != 0) + return r; + while (c->look > 0) + { + lzo_uint ahead; + lzo_uint max_ahead; + int l1, l2, l3; + + c->codesize = pd(op, out); + + m_len = c->m_len; + m_off = c->m_off; + + assert(c->bp == c->ip - c->look); + assert(c->bp >= in); + if (lit == 0) + ii = c->bp; + assert(ii + lit == c->bp); + assert(swd->b_char == *(c->bp)); + + if ( m_len < 2 || + (m_len == 2 && (m_off > M1_MAX_OFFSET || lit == 0 || lit >= 4)) || +#if 1 + /* Do not accept this match for compressed-data compatibility + * with LZO v1.01 and before + * [ might be a problem for decompress() and optimize() ] + */ + (m_len == 2 && op == out) || +#endif + (op == out && lit == 0)) + { + /* a literal */ + m_len = 0; + } + else if (m_len == M2_MIN_LEN) + { + /* compression ratio improves if we code a literal in some cases */ + if (m_off > MX_MAX_OFFSET && lit >= 4) + m_len = 0; + } + + if (m_len == 0) + { + /* a literal */ + lit++; + swd->max_chain = max_chain; + r = find_match(c,swd,1,0); + assert(r == 0); + continue; + } + + /* a match */ +#if defined(SWD_BEST_OFF) + if (swd->use_best_off) + better_match(swd,&m_len,&m_off); +#endif + assert_match(swd,m_len,m_off); + + + + /* shall we try a lazy match ? */ + ahead = 0; + if (try_lazy <= 0 || m_len >= max_lazy) + { + /* no */ + l1 = 0; + max_ahead = 0; + } + else + { + /* yes, try a lazy match */ + l1 = len_of_coded_match(m_len,m_off,lit); + assert(l1 > 0); +#if 1 + max_ahead = LZO_MIN((lzo_uint)try_lazy, (lzo_uint)l1 - 1); +#else + max_ahead = LZO_MIN3(try_lazy, l1, m_len - 1); +#endif + } + + + while (ahead < max_ahead && c->look > m_len) + { + lzo_int lazy_match_min_gain; + + if (m_len >= good_length) + swd->max_chain = max_chain >> 2; + else + swd->max_chain = max_chain; + r = find_match(c,swd,1,0); + ahead++; + + assert(r == 0); + assert(c->look > 0); + assert(ii + lit + ahead == c->bp); + +#if defined(LZO1Z) + if (m_off == c->last_m_off && c->m_off != c->last_m_off) + if (m_len >= M2_MIN_LEN && m_len <= M2_MAX_LEN) + c->m_len = 0; +#endif + if (c->m_len < m_len) + continue; +#if 1 + if (c->m_len == m_len && c->m_off >= m_off) + continue; +#endif +#if defined(SWD_BEST_OFF) + if (swd->use_best_off) + better_match(swd,&c->m_len,&c->m_off); +#endif + l2 = len_of_coded_match(c->m_len,c->m_off,lit+ahead); + if (l2 < 0) + continue; +#if 0 + if (c->m_len == m_len && l2 >= l1) + continue; +#endif + + +#if 1 + /* compressed-data compatibility [see above] */ + l3 = (op == out) ? -1 : len_of_coded_match(ahead,m_off,lit); +#else + l3 = len_of_coded_match(ahead,m_off,lit); +#endif + + lazy_match_min_gain = min_gain(ahead,lit,lit+ahead,l1,l2,l3); + if (c->m_len >= m_len + lazy_match_min_gain) + { + c->lazy++; + assert_match(swd,c->m_len,c->m_off); + + if (l3 > 0) + { + /* code previous run */ + op = code_run(c,op,ii,lit,ahead); + lit = 0; + /* code shortened match */ + op = code_match(c,op,ahead,m_off); + } + else + { + lit += ahead; + assert(ii + lit == c->bp); + } + goto lazy_match_done; + } + } + + + assert(ii + lit + ahead == c->bp); + + /* 1 - code run */ + op = code_run(c,op,ii,lit,m_len); + lit = 0; + + /* 2 - code match */ + op = code_match(c,op,m_len,m_off); + swd->max_chain = max_chain; + r = find_match(c,swd,m_len,1+ahead); + assert(r == 0); + +lazy_match_done: ; + } + + + /* store final run */ + if (lit > 0) + op = STORE_RUN(c,op,ii,lit); + +#if defined(LZO_EOF_CODE) + *op++ = M4_MARKER | 1; + *op++ = 0; + *op++ = 0; +#endif + + c->codesize = pd(op, out); + assert(c->textsize == in_len); + + *out_len = pd(op, out); + + if (c->cb && c->cb->nprogress) + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + +#if 0 + printf("%ld %ld -> %ld %ld: %ld %ld %ld %ld %ld %ld: %ld %ld %ld %ld\n", + (long) c->textsize, (long) in_len, (long) c->codesize, + c->match_bytes, c->m1a_m, c->m1b_m, c->m2_m, c->m3_m, c->m4_m, + c->lit_bytes, c->lit1_r, c->lit2_r, c->lit3_r, c->lazy); +#endif + assert(c->lit_bytes + c->match_bytes == in_len); + + return LZO_E_OK; +} + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1x_999_compress_level ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len, + lzo_callback_p cb, + int compression_level ) +{ + static const struct + { + int try_lazy; + lzo_uint good_length; + lzo_uint max_lazy; + lzo_uint nice_length; + lzo_uint max_chain; + lzo_uint32 flags; + } c[9] = { + { 0, 0, 0, 8, 4, 0 }, /* faster compression */ + { 0, 0, 0, 16, 8, 0 }, + { 0, 0, 0, 32, 16, 0 }, + + { 1, 4, 4, 16, 16, 0 }, + { 1, 8, 16, 32, 32, 0 }, + { 1, 8, 16, 128, 128, 0 }, + + { 2, 8, 32, 128, 256, 0 }, + { 2, 32, 128, F, 2048, 1 }, + { 2, F, F, F, 4096, 1 } /* max. compression */ + }; + + if (compression_level < 1 || compression_level > 9) + return LZO_E_ERROR; + + compression_level -= 1; + return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem, + dict, dict_len, cb, + c[compression_level].try_lazy, + c[compression_level].good_length, + c[compression_level].max_lazy, +#if 0 + c[compression_level].nice_length, +#else + 0, +#endif + c[compression_level].max_chain, + c[compression_level].flags); +} + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo1x_999_compress_dict ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ) +{ + return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem, + dict, dict_len, 0, 8); +} + +LZO_PUBLIC(int) +lzo1x_999_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return lzo1x_999_compress_level(in, in_len, out, out_len, wrkmem, + NULL, 0, (lzo_callback_p) 0, 8); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1x_c.ch b/thirdparty/lzo/2.03/src/lzo1x_c.ch new file mode 100644 index 0000000..08d615e --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_c.ch @@ -0,0 +1,351 @@ +/* lzo1x_c.ch -- implementation of the LZO1[XY]-1 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +/*********************************************************************** +// compress a block of data. +************************************************************************/ + +static __lzo_noinline lzo_uint +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + op = out; + ip = in; + ii = ip; + + ip += 4; + for (;;) + { + register const lzo_bytep m_pos; + lzo_uint m_off; + lzo_uint m_len; + lzo_uint dindex; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + + +try_match: +#if 1 && defined(LZO_UNALIGNED_OK_2) + if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip) +#else + if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) +#endif + { + } + else + { + if __lzo_likely(m_pos[2] == ip[2]) + { +#if 0 + if (m_off <= M2_MAX_OFFSET) + goto match; + if (lit <= 3) + goto match; + if (lit == 3) /* better compression, but slower */ + { + assert(op - 2 > out); op[-2] |= LZO_BYTE(3); + *op++ = *ii++; *op++ = *ii++; *op++ = *ii++; + goto code_match; + } + if (m_pos[3] == ip[3]) +#endif + goto match; + } + else + { + /* still need a better way for finding M1 matches */ +#if 0 + /* a M1 match */ +#if 0 + if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3) +#else + if (m_off <= M1_MAX_OFFSET && lit == 3) +#endif + { + register lzo_uint t; + + t = lit; + assert(op - 2 > out); op[-2] |= LZO_BYTE(t); + do *op++ = *ii++; while (--t > 0); + assert(ii == ip); + m_off -= 1; + *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); + ip += 2; + goto match_done; + } +#endif + } + } + + + /* a literal */ +literal: + UPDATE_I(dict,0,dindex,ip,in); + ++ip; + if __lzo_unlikely(ip >= ip_end) + break; + continue; + + + /* a match */ +match: + UPDATE_I(dict,0,dindex,ip,in); + /* store current literal run */ + if (pd(ip,ii) > 0) + { + register lzo_uint t = pd(ip,ii); + + if (t <= 3) + { + assert(op - 2 > out); + op[-2] |= LZO_BYTE(t); + } + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + register lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + /* code the match */ + assert(ii == ip); + ip += 3; + if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ || + m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++ +#ifdef LZO1Y + || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++ + || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++ +#endif + ) + { + --ip; + m_len = pd(ip, ii); + assert(m_len >= 3); assert(m_len <= M2_MAX_LEN); + + if (m_off <= M2_MAX_OFFSET) + { + m_off -= 1; +#if defined(LZO1X) + *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); +#elif defined(LZO1Y) + *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + } + else if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + goto m3_m4_offset; + } + else +#if defined(LZO1X) + { + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + goto m3_m4_offset; + } +#elif defined(LZO1Y) + goto m4_match; +#endif + } + else + { + { + const lzo_bytep end = in_end; + const lzo_bytep m = m_pos + M2_MAX_LEN + 1; + while (ip < end && *m == *ip) + m++, ip++; + m_len = pd(ip, ii); + } + assert(m_len > M2_MAX_LEN); + + if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + if (m_len <= 33) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= 33; + *op++ = M3_MARKER | 0; + goto m3_m4_len; + } + } + else + { +#if defined(LZO1Y) +m4_match: +#endif + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + if (m_len <= M4_MAX_LEN) + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + else + { + m_len -= M4_MAX_LEN; + *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11)); +m3_m4_len: + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + } + +m3_m4_offset: + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + +#if 0 +match_done: +#endif + ii = ip; + if __lzo_unlikely(ip >= ip_end) + break; + } + + *out_len = pd(op, out); + return pd(in_end,ii); +} + + +/*********************************************************************** +// public entry point +************************************************************************/ + +LZO_PUBLIC(int) +DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op = out; + lzo_uint t; + + if __lzo_unlikely(in_len <= M2_MAX_LEN + 5) + t = in_len; + else + { + t = do_compress(in,in_len,op,out_len,wrkmem); + op += *out_len; + } + + if (t > 0) + { + const lzo_bytep ii = in + in_len - t; + + if (op == out && t <= 238) + *op++ = LZO_BYTE(17 + t); + else if (t <= 3) + op[-2] |= LZO_BYTE(t); + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + *op++ = M4_MARKER | 1; + *op++ = 0; + *op++ = 0; + + *out_len = pd(op, out); + return LZO_E_OK; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1x_d.ch b/thirdparty/lzo/2.03/src/lzo1x_d.ch new file mode 100644 index 0000000..d068866 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_d.ch @@ -0,0 +1,466 @@ +/* lzo1x_d.ch -- implementation of the LZO1X decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo1_d.ch" + + +#undef __COPY4 +#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src) + +#undef COPY4 +#if defined(LZO_UNALIGNED_OK_4) +# define COPY4(dst,src) __COPY4(dst,src) +#elif defined(LZO_ALIGNED_OK_4) +# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src)) +#endif + + +/*********************************************************************** +// decompress a block of data. +************************************************************************/ + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + register const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif /* COPY_DICT */ + + *out_len = 0; + + op = out; + ip = in; + + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + /* a literal run */ + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 15 + *ip++; + } + /* copy literals */ + assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !defined(LZO_UNALIGNED_OK_4) + } + else +#endif +#endif +#if !defined(LZO_UNALIGNED_OK_4) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + + +first_literal_run: + + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else /* !COPY_DICT */ +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif /* COPY_DICT */ + goto match_done; + + + /* handle matches */ + do { +match: + if (t >= 64) /* a M2 match */ + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else /* !COPY_DICT */ +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif /* COPY_DICT */ + } + else if (t >= 32) /* a M3 match */ + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else /* !COPY_DICT */ +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif /* COPY_DICT */ + ip += 2; + } + else if (t >= 16) /* a M4 match */ + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else /* !COPY_DICT */ + m_pos = op; + m_pos -= (t & 8) << 11; +#endif /* COPY_DICT */ + t &= 7; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 7 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else /* !COPY_DICT */ +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif /* COPY_DICT */ + } + else /* a M1 match */ + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else /* !COPY_DICT */ +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif /* COPY_DICT */ + goto match_done; + } + + /* copy match */ +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else /* !COPY_DICT */ + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); /* both pointers are aligned */ +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif /* COPY_DICT */ + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + + /* copy literals */ +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } while (TEST_IP && TEST_OP); + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + /* no EOF code was found */ + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1x_d1.c b/thirdparty/lzo/2.03/src/lzo1x_d1.c new file mode 100644 index 0000000..5fbd9b2 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_d1.c @@ -0,0 +1,46 @@ +/* lzo1x_d1.c -- LZO1X decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1x.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1x_decompress + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_d2.c b/thirdparty/lzo/2.03/src/lzo1x_d2.c new file mode 100644 index 0000000..f6c84cb --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_d2.c @@ -0,0 +1,46 @@ +/* lzo1x_d2.c -- LZO1X decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1x.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1x_decompress_safe + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_d3.c b/thirdparty/lzo/2.03/src/lzo1x_d3.c new file mode 100644 index 0000000..ffaa680 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_d3.c @@ -0,0 +1,108 @@ +/* lzo1x_d3.c -- LZO1X decompression with preset dictionary + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1x.h" + +#define LZO_TEST_OVERRUN + + +#define SLOW_MEMCPY(a,b,l) { do *a++ = *b++; while (--l > 0); } +#define FAST_MEMCPY(a,b,l) { lzo_memcpy(a,b,l); a += l; } + +#if 1 && defined(FAST_MEMCPY) +# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \ + if (m_off >= (m_len)) \ + FAST_MEMCPY(op,m_pos,m_len) \ + else \ + SLOW_MEMCPY(op,m_pos,m_len) +#else +# define DICT_MEMMOVE(op,m_pos,m_len,m_off) \ + SLOW_MEMCPY(op,m_pos,m_len) +#endif + +#if !defined(FAST_MEMCPY) +# define FAST_MEMCPY SLOW_MEMCPY +#endif + + +#define COPY_DICT_DICT(m_len,m_off) \ + { \ + register const lzo_bytep m_pos; \ + m_off -= pd(op, out); assert(m_off > 0); \ + if (m_off > dict_len) goto lookbehind_overrun; \ + m_pos = dict_end - m_off; \ + if (m_len > m_off) \ + { \ + m_len -= m_off; \ + FAST_MEMCPY(op,m_pos,m_off) \ + m_pos = out; \ + SLOW_MEMCPY(op,m_pos,m_len) \ + } \ + else \ + FAST_MEMCPY(op,m_pos,m_len) \ + } + +#define COPY_DICT(m_len,m_off) \ + assert(m_len >= 2); assert(m_off > 0); assert(op > out); \ + if (m_off <= pd(op, out)) \ + { \ + register const lzo_bytep m_pos = op - m_off; \ + DICT_MEMMOVE(op,m_pos,m_len,m_off) \ + } \ + else \ + COPY_DICT_DICT(m_len,m_off) + + + + +LZO_PUBLIC(int) +lzo1x_decompress_dict_safe ( const lzo_bytep in, lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem /* NOT USED */, + const lzo_bytep dict, lzo_uint dict_len) + + +#include "lzo1x_d.ch" + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1x_o.c b/thirdparty/lzo/2.03/src/lzo1x_o.c new file mode 100644 index 0000000..89cd1bc --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_o.c @@ -0,0 +1,45 @@ +/* lzo1x_o.c -- LZO1X compressed data optimizer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1x.h" + +#define DO_OPTIMIZE lzo1x_optimize + +#include "lzo1x_oo.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1x_oo.ch b/thirdparty/lzo/2.03/src/lzo1x_oo.ch new file mode 100644 index 0000000..e978f39 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1x_oo.ch @@ -0,0 +1,366 @@ +/* lzo1x_oo.ch -- LZO1X compressed data optimizer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define TEST_IP (ip < ip_end) +#define TEST_OP (op <= op_end) + +#define NO_LIT LZO_UINT_MAX + + +/*********************************************************************** +// +************************************************************************/ + +static void copy2(lzo_bytep ip, const lzo_bytep m_pos, lzo_uint off) +{ + assert(off > 0); + ip[0] = m_pos[0]; + if (off == 1) + ip[1] = m_pos[0]; + else + ip[1] = m_pos[1]; +} + + +static void copy3(lzo_bytep ip, const lzo_bytep m_pos, lzo_uint off) +{ + assert(off > 0); + ip[0] = m_pos[0]; + if (off == 1) + { + ip[2] = ip[1] = m_pos[0]; + } + else if (off == 2) + { + ip[1] = m_pos[1]; + ip[2] = m_pos[0]; + } + else + { + ip[1] = m_pos[1]; + ip[2] = m_pos[2]; + } +} + + +/*********************************************************************** +// optimize a block of data. +************************************************************************/ + +LZO_PUBLIC(int) +DO_OPTIMIZE ( lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op; + lzo_bytep ip; + lzo_uint t; + lzo_bytep m_pos; + lzo_bytep const ip_end = in + in_len; + lzo_bytep const op_end = out + *out_len; + lzo_bytep litp = NULL; + lzo_uint lit = 0; + lzo_uint next_lit = NO_LIT; + lzo_uint nl; + unsigned long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0; + + LZO_UNUSED(wrkmem); + + *out_len = 0; + + op = out; + ip = in; + + assert(in_len >= 3); + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + goto first_literal_run; + } + assert(*ip < 16 || (*ip == 17 && in_len == 3)); + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + /* a literal run */ + litp = ip - 1; + if (t == 0) + { + t = 15; + while (*ip == 0) + t += 255, ip++; + t += *ip++; + } + lit = t + 3; + /* copy literals */ +copy_literal_run: + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; +first_literal_run: + do *op++ = *ip++; while (--t > 0); + + + t = *ip++; + + if (t >= 16) + goto match; +#if defined(LZO1X) + m_pos = op - 1 - 0x800; +#elif defined(LZO1Y) + m_pos = op - 1 - 0x400; +#endif + m_pos -= t >> 2; + m_pos -= *ip++ << 2; + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++; + lit = 0; + goto match_done; + + + /* handle matches */ + do { + if (t < 16) /* a M1 match */ + { + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; + + if (litp == NULL) + goto copy_m1; + + /* assert that there was a match just before */ + assert(lit >= 1 && lit <= 3); + assert(litp == ip - 2 - lit - 2); + assert((lzo_uint)(*litp & 3) == lit); + nl = ip[-2] & 3; + /* test if a match follows */ + if (nl == 0 && lit == 1 && ip[0] >= 16) + { + next_lit = nl; + /* adjust length of previous short run */ + lit += 2; + *litp = LZO_BYTE((*litp & ~3) | lit); + /* copy over the 2 literals that replace the match */ + copy2(ip-2,m_pos,pd(op,m_pos)); + o_m1_a++; + } + /* test if a literal run follows */ + else if (nl == 0 && ip[0] < 16 && ip[0] != 0 && + (lit + 2 + ip[0] < 16)) + { + t = *ip++; + /* remove short run */ + *litp &= ~3; + /* copy over the 2 literals that replace the match */ + copy2(ip-3+1,m_pos,pd(op,m_pos)); + /* move literals 1 byte ahead */ + litp += 2; + if (lit > 0) + lzo_memmove(litp+1,litp,lit); + /* insert new length of long literal run */ + lit += 2 + t + 3; assert(lit <= 18); + *litp = LZO_BYTE(lit - 3); + + o_m1_b++; + *op++ = *m_pos++; *op++ = *m_pos++; + goto copy_literal_run; + } +copy_m1: + *op++ = *m_pos++; *op++ = *m_pos++; + } + else + { +match: + if (t >= 64) /* a M2 match */ + { + m_pos = op - 1; +#if defined(LZO1X) + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#endif + if (litp == NULL) + goto copy_m; + + nl = ip[-2] & 3; + /* test if in beetween two long literal runs */ + if (t == 1 && lit > 3 && nl == 0 && + ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16)) + { + assert(*litp == lit - 3); + t = *ip++; + /* copy over the 3 literals that replace the match */ + copy3(ip-1-2,m_pos,pd(op,m_pos)); + /* set new length of previous literal run */ + lit += 3 + t + 3; assert(lit <= 18); + *litp = LZO_BYTE(lit - 3); + o_m2++; + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++; + goto copy_literal_run; + } + } + else + { + if (t >= 32) /* a M3 match */ + { + t &= 31; + if (t == 0) + { + t = 31; + while (*ip == 0) + t += 255, ip++; + t += *ip++; + } + m_pos = op - 1; + m_pos -= *ip++ >> 2; + m_pos -= *ip++ << 6; + } + else /* a M4 match */ + { + m_pos = op; + m_pos -= (t & 8) << 11; + t &= 7; + if (t == 0) + { + t = 7; + while (*ip == 0) + t += 255, ip++; + t += *ip++; + } + m_pos -= *ip++ >> 2; + m_pos -= *ip++ << 6; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; + } + if (litp == NULL) + goto copy_m; + + nl = ip[-2] & 3; + /* test if in beetween two matches */ + if (t == 1 && lit == 0 && nl == 0 && ip[0] >= 16) + { + assert(litp == ip - 3 - lit - 2); + assert((lzo_uint)(*litp & 3) == lit); + next_lit = nl; + /* make a previous short run */ + lit += 3; + *litp = LZO_BYTE((*litp & ~3) | lit); + /* copy over the 3 literals that replace the match */ + copy3(ip-3,m_pos,pd(op,m_pos)); + o_m3_a++; + } + /* test if a literal run follows */ + else if (t == 1 && lit <= 3 && nl == 0 && + ip[0] < 16 && ip[0] != 0 && (lit + 3 + ip[0] < 16)) + { + assert(litp == ip - 3 - lit - 2); + assert((lzo_uint)(*litp & 3) == lit); + t = *ip++; + /* remove short run */ + *litp &= ~3; + /* copy over the 3 literals that replace the match */ + copy3(ip-4+1,m_pos,pd(op,m_pos)); + /* move literals 1 byte ahead */ + litp += 2; + if (lit > 0) + lzo_memmove(litp+1,litp,lit); + /* insert new length of long literal run */ + lit += 3 + t + 3; assert(lit <= 18); + *litp = LZO_BYTE(lit - 3); + + o_m3_b++; + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos++; + goto copy_literal_run; + } + } +copy_m: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +match_done: + if (next_lit == NO_LIT) + { + t = ip[-2] & 3; + lit = t; + litp = ip - 2; + } + else + t = next_lit; + assert(t <= 3); + next_lit = NO_LIT; + if (t == 0) + break; + /* copy literals */ +match_next: + do *op++ = *ip++; while (--t > 0); + t = *ip++; + } while (TEST_IP && TEST_OP); + } + + /* no EOF code was found */ + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; + +eof_found: + assert(t == 1); +#if 0 + printf("optimize: %5lu %5lu %5lu %5lu %5lu\n", + o_m1_a, o_m1_b, o_m2, o_m3_a, o_m3_b); +#endif + LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2); + LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo1y_1.c b/thirdparty/lzo/2.03/src/lzo1y_1.c new file mode 100644 index 0000000..0c2b084 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_1.c @@ -0,0 +1,50 @@ +/* lzo1y_1.c -- LZO1Y-1 compression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO_NEED_DICT_H +#define D_BITS 14 +#define D_INDEX1(d,p) d = DX3(p,5,5,6); d += d >> 5; d = DM(d) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) + +#include "config1y.h" + +#define DO_COMPRESS lzo1y_1_compress + +#include "lzo1x_c.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1y_9x.c b/thirdparty/lzo/2.03/src/lzo1y_9x.c new file mode 100644 index 0000000..6275ccd --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_9x.c @@ -0,0 +1,42 @@ +/* lzo1y_9x.c -- implementation of the LZO1Y-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO1Y +#include "lzo1x_9x.c" diff --git a/thirdparty/lzo/2.03/src/lzo1y_d1.c b/thirdparty/lzo/2.03/src/lzo1y_d1.c new file mode 100644 index 0000000..b6c830d --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_d1.c @@ -0,0 +1,46 @@ +/* lzo1y_d1.c -- LZO1Y decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1y.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1y_decompress + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1y_d2.c b/thirdparty/lzo/2.03/src/lzo1y_d2.c new file mode 100644 index 0000000..5bc4b6d --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_d2.c @@ -0,0 +1,46 @@ +/* lzo1y_d2.c -- LZO1Y decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1y.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1y_decompress_safe + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1y_d3.c b/thirdparty/lzo/2.03/src/lzo1y_d3.c new file mode 100644 index 0000000..b6300c6 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_d3.c @@ -0,0 +1,45 @@ +/* lzo1y_d3.c -- LZO1Y decompression with preset dictionary + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1y.h" + +#define lzo1x_decompress_dict_safe lzo1y_decompress_dict_safe + +#include "lzo1x_d3.c" diff --git a/thirdparty/lzo/2.03/src/lzo1y_o.c b/thirdparty/lzo/2.03/src/lzo1y_o.c new file mode 100644 index 0000000..5f3b1e8 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1y_o.c @@ -0,0 +1,45 @@ +/* lzo1y_o.c -- LZO1Y compressed data optimizer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1y.h" + +#define DO_OPTIMIZE lzo1y_optimize + +#include "lzo1x_oo.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1z_9x.c b/thirdparty/lzo/2.03/src/lzo1z_9x.c new file mode 100644 index 0000000..289d5ec --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1z_9x.c @@ -0,0 +1,42 @@ +/* lzo1z_9x.c -- implementation of the LZO1Z-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#define LZO1Z +#include "lzo1x_9x.c" diff --git a/thirdparty/lzo/2.03/src/lzo1z_d1.c b/thirdparty/lzo/2.03/src/lzo1z_d1.c new file mode 100644 index 0000000..b505985 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1z_d1.c @@ -0,0 +1,46 @@ +/* lzo1z_d1.c -- LZO1Z decompression + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1z.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1z_decompress + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1z_d2.c b/thirdparty/lzo/2.03/src/lzo1z_d2.c new file mode 100644 index 0000000..5542024 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1z_d2.c @@ -0,0 +1,46 @@ +/* lzo1z_d2.c -- LZO1Z decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1z.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo1z_decompress_safe + +#include "lzo1x_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo1z_d3.c b/thirdparty/lzo/2.03/src/lzo1z_d3.c new file mode 100644 index 0000000..b244040 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo1z_d3.c @@ -0,0 +1,45 @@ +/* lzo1z_d3.c -- LZO1Z decompression with preset dictionary + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config1z.h" + +#define lzo1x_decompress_dict_safe lzo1z_decompress_dict_safe + +#include "lzo1x_d3.c" diff --git a/thirdparty/lzo/2.03/src/lzo2a_9x.c b/thirdparty/lzo/2.03/src/lzo2a_9x.c new file mode 100644 index 0000000..020e227 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo2a_9x.c @@ -0,0 +1,357 @@ +/* lzo2a_9x.c -- implementation of the LZO2A-999 compression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + + +#include "config2a.h" + + +/*********************************************************************** +// +************************************************************************/ + +#define THRESHOLD 1 /* lower limit for match length */ +#define F 2048 /* upper limit for match length */ + + +#define LZO2A +#define LZO_COMPRESS_T lzo2a_999_t +#define lzo_swd_t lzo2a_999_swd_t +#include "lzo_mchw.ch" + + +#if (LZO_CC_BORLANDC && LZO_MM_FLAT) +# if ((__BORLANDC__) >= 0x0450 && (__BORLANDC__) < 0x0460) + /* avoid internal compiler error */ +# pragma option -Od +# endif +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#define putbyte(x) *op++ = LZO_BYTE(x) + +#define putbits(j,x) \ + if (k == 0) bitp = op++; \ + SETBITS(j,x); \ + if (k >= 8) { *bitp = LZO_BYTE(MASKBITS(8)); DUMPBITS(8); \ + if (k > 0) bitp = op++; } + +#define putbit(x) putbits(1,x) + + +/*********************************************************************** +// this is a public function, but there is no prototype in a header file +************************************************************************/ + +LZO_EXTERN(int) +lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ); + +LZO_PUBLIC(int) +lzo2a_999_compress_callback ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem, + lzo_callback_p cb, + lzo_uint max_chain ) +{ + lzo_bytep op; + lzo_bytep bitp = 0; + lzo_uint m_len, m_off; + LZO_COMPRESS_T cc; + LZO_COMPRESS_T * const c = &cc; + lzo_swd_p const swd = (lzo_swd_p) wrkmem; + int r; + + lzo_uint32 b = 0; /* bit buffer */ + unsigned k = 0; /* bits in bit buffer */ + + /* sanity check */ + LZO_COMPILE_TIME_ASSERT(LZO2A_999_MEM_COMPRESS >= SIZEOF_LZO_SWD_T) + + c->init = 0; + c->ip = c->in = in; + c->in_end = in + in_len; + c->cb = cb; + c->m1 = c->m2 = c->m3 = c->m4 = 0; + + op = out; + + r = init_match(c,swd,NULL,0,0); + if (r != 0) + return r; + if (max_chain > 0) + swd->max_chain = max_chain; + + r = find_match(c,swd,0,0); + if (r != 0) + return r; + while (c->look > 0) + { + int lazy_match_min_gain = 0; + int extra1 = 0; + int extra2 = 0; + lzo_uint ahead = 0; + + LZO_UNUSED(extra1); + + m_len = c->m_len; + m_off = c->m_off; + +#if (N >= 8192) + if (m_off >= 8192) + { + if (m_len < M3_MIN_LEN) + m_len = 0; + else + lazy_match_min_gain = 1; + } + else +#endif + if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256) + { + lazy_match_min_gain = 2; + extra1 = 3; + extra2 = 2; + } + else if (m_len >= 10) + lazy_match_min_gain = 1; + else if (m_len >= 3) + { + lazy_match_min_gain = 1; + extra1 = 1; + } + else + m_len = 0; + + + /* try a lazy match */ + if (lazy_match_min_gain > 0 && c->look > m_len) + { + int lit = swd->b_char; + + r = find_match(c,swd,1,0); + assert(r == 0); + assert(c->look > 0); + +#if (N >= 8192) + if (m_off < 8192 && c->m_off >= 8192) + lazy_match_min_gain += extra1; + else +#endif + if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256) + { + if (!(c->m_len >= M1_MIN_LEN && + c->m_len <= M1_MAX_LEN && c->m_off <= 256)) + lazy_match_min_gain += extra2; + } + if (c->m_len >= M1_MIN_LEN && + c->m_len <= M1_MAX_LEN && c->m_off <= 256) + { + lazy_match_min_gain -= 1; + } + + if (lazy_match_min_gain < 1) + lazy_match_min_gain = 1; + + if (c->m_len >= m_len + lazy_match_min_gain) + { + c->lazy++; +#if !defined(NDEBUG) + m_len = c->m_len; + m_off = c->m_off; + assert(lzo_memcmp(c->ip - c->look, c->ip - c->look - m_off, + m_len) == 0); + assert(m_len >= 3 || (m_len >= 2 && m_off <= 256)); +#endif + /* code literal */ + putbit(0); + putbyte(lit); + c->lit_bytes++; + continue; + } + else + ahead = 1; + assert(m_len > 0); + } + + + if (m_len == 0) + { + /* a literal */ + putbit(0); + putbyte(swd->b_char); + c->lit_bytes++; + r = find_match(c,swd,1,0); + assert(r == 0); + } + else + { + assert(m_len >= M1_MIN_LEN); + assert(m_off > 0); + assert(m_off <= N); + + /* 2 - code match */ + if (m_len >= M1_MIN_LEN && m_len <= M1_MAX_LEN && m_off <= 256) + { + putbit(1); + putbit(0); + putbits(2,m_len - M1_MIN_LEN); + putbyte(m_off - 1); + c->m1++; + } +#if (N >= 8192) + else if (m_off >= 8192) + { + unsigned len = m_len; + assert(m_len >= M3_MIN_LEN); + putbit(1); + putbit(1); + putbyte(m_off & 31); + putbyte(m_off >> 5); + putbit(1); + len -= M3_MIN_LEN - 1; + while (len > 255) + { + len -= 255; + putbyte(0); + } + putbyte(len); + c->m4++; + } +#endif + else + { + assert(m_len >= 3); + + putbit(1); + putbit(1); + if (m_len <= 9) + { + putbyte(((m_len - 2) << 5) | (m_off & 31)); + putbyte(m_off >> 5); + c->m2++; + } + else + { + lzo_uint len = m_len; + putbyte(m_off & 31); + putbyte(m_off >> 5); +#if (N >= 8192) + putbit(0); +#endif + len -= 10 - 1; + while (len > 255) + { + len -= 255; + putbyte(0); + } + putbyte(len); + c->m3++; + } + } + r = find_match(c,swd,m_len,1+ahead); + assert(r == 0); + } + + c->codesize = pd(op, out); + } + +#if defined(LZO_EOF_CODE) + /* code EOF code */ + putbit(1); + putbit(1); + putbyte(1 << 5); + putbyte(0); +#endif + + /* flush remaining bits */ + assert(k < CHAR_BIT); + if (k > 0) + { + assert(b == MASKBITS(k)); + assert(op - bitp > 1); + *bitp = LZO_BYTE(MASKBITS(k)); + DUMPBITS(k); + assert(b == 0); + assert(k == 0); + } + + assert(c->textsize == in_len); + c->codesize = pd(op, out); + + *out_len = pd(op, out); + + if (c->cb && c->cb->nprogress) + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + +#if 0 + printf("%ld -> %ld: %ld %ld %ld %ld %ld %ld\n", + (long) c->textsize, (long) c->codesize, + c->lit_bytes, c->m1, c->m2, c->m3, c->m4, c->lazy); +#endif + return LZO_E_OK; +} + + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +lzo2a_999_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + return lzo2a_999_compress_callback(in,in_len,out,out_len,wrkmem, + (lzo_callback_p) 0, 0); +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo2a_d.ch b/thirdparty/lzo/2.03/src/lzo2a_d.ch new file mode 100644 index 0000000..5822ac0 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo2a_d.ch @@ -0,0 +1,188 @@ +/* lzo2a_d.ch -- implementation of the LZO2A decompression algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo1_d.ch" + + +/*********************************************************************** +// decompress a block of data. +************************************************************************/ + +#define _NEEDBYTE NEED_IP(1) +#define _NEXTBYTE (*ip++) + +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register lzo_bytep op; + register const lzo_bytep ip; + register const lzo_bytep m_pos; + + lzo_uint t; + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif + + lzo_uint32 b = 0; /* bit buffer */ + unsigned k = 0; /* bits in bit buffer */ + + LZO_UNUSED(wrkmem); + + op = out; + ip = in; + + while (TEST_IP && TEST_OP) + { + NEEDBITS(1); + if (MASKBITS(1) == 0) + { + DUMPBITS(1); + /* a literal */ + NEED_IP(1); NEED_OP(1); + *op++ = *ip++; + continue; + } + DUMPBITS(1); + + NEEDBITS(1); + if (MASKBITS(1) == 0) + { + DUMPBITS(1); + /* a M1 match */ + NEEDBITS(2); + t = M1_MIN_LEN + (lzo_uint) MASKBITS(2); + DUMPBITS(2); + NEED_IP(1); NEED_OP(t); + m_pos = op - 1 - *ip++; + assert(m_pos >= out); assert(m_pos < op); + TEST_LB(m_pos); + MEMCPY_DS(op,m_pos,t); + continue; + } + DUMPBITS(1); + + NEED_IP(2); + t = *ip++; + m_pos = op; + m_pos -= (t & 31) | (((lzo_uint) *ip++) << 5); + t >>= 5; + if (t == 0) + { +#if (N >= 8192) + NEEDBITS(1); + t = MASKBITS(1); + DUMPBITS(1); + if (t == 0) + t = 10 - 1; + else + { + /* a M3 match */ + m_pos -= 8192; /* t << 13 */ + t = M3_MIN_LEN - 1; + } +#else + t = 10 - 1; +#endif + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += *ip++; + } + else + { +#if defined(LZO_EOF_CODE) + if (m_pos == op) + goto eof_found; +#endif + t += 2; + } + assert(m_pos >= out); assert(m_pos < op); + TEST_LB(m_pos); + NEED_OP(t); + MEMCPY_DS(op,m_pos,t); + } + + +#if defined(LZO_EOF_CODE) +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + /* no EOF code was found */ + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); +#endif + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo2a_d1.c b/thirdparty/lzo/2.03/src/lzo2a_d1.c new file mode 100644 index 0000000..33fc9fe --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo2a_d1.c @@ -0,0 +1,46 @@ +/* lzo2a_d1.c -- LZO2A decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config2a.h" + +#undef LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo2a_decompress + +#include "lzo2a_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo2a_d2.c b/thirdparty/lzo/2.03/src/lzo2a_d2.c new file mode 100644 index 0000000..0be669f --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo2a_d2.c @@ -0,0 +1,46 @@ +/* lzo2a_d2.c -- LZO2A decompression with overrun testing + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "config2a.h" + +#define LZO_TEST_OVERRUN +#define DO_DECOMPRESS lzo2a_decompress_safe + +#include "lzo2a_d.ch" diff --git a/thirdparty/lzo/2.03/src/lzo_conf.h b/thirdparty/lzo/2.03/src/lzo_conf.h new file mode 100644 index 0000000..85e1080 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_conf.h @@ -0,0 +1,323 @@ +/* lzo_conf.h -- main internal configuration file for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_CONF_H +#define __LZO_CONF_H + +#if !defined(__LZO_IN_MINILZO) +#if defined(LZO_CFG_FREESTANDING) +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +# define ACC_LIBC_FREESTANDING 1 +# define ACC_OS_FREESTANDING 1 +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# define ACC_CFG_NO_UNALIGNED 1 +#endif +#if defined(LZO_ARCH_GENERIC) +# define ACC_ARCH_GENERIC 1 +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# define ACC_ABI_NEUTRAL_ENDIAN 1 +#endif +#if defined(LZO_HAVE_CONFIG_H) +# define ACC_CONFIG_NO_HEADER 1 +#endif +#if defined(LZO_CFG_EXTRA_CONFIG_HEADER) +# include LZO_CFG_EXTRA_CONFIG_HEADER +#endif +#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED) +# error "include this file first" +#endif +#include "lzo/lzoconf.h" +#endif + +#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED) +# error "version mismatch" +#endif + + +/*********************************************************************** +// pragmas +************************************************************************/ + +#if (LZO_CC_BORLANDC && LZO_ARCH_I086) +# pragma option -h /* enable fast huge pointers */ +#endif + +#if (LZO_CC_MSC && (_MSC_VER >= 1000)) +# pragma warning(disable: 4127 4701) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) + /* avoid `-Wall' warnings in system header files */ +# pragma warning(disable: 4820) + /* avoid warnings about inlining */ +# pragma warning(disable: 4514 4710 4711) +#endif + +#if (LZO_CC_SUNPROC) +# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED) +# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP) +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR) +# error "this should not happen - check defines for __huge" +#endif + +#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING) +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define ACC_WANT_ACC_INCD_H 1 +# define ACC_WANT_ACC_INCE_H 1 +# define ACC_WANT_ACC_INCI_H 1 +#elif 1 +# include +#else +# define ACC_WANT_ACC_INCD_H 1 +#endif +#include "miniacc.h" + + +#if defined(LZO_CFG_FREESTANDING) +# undef HAVE_MEMCMP +# undef HAVE_MEMCPY +# undef HAVE_MEMMOVE +# undef HAVE_MEMSET +#endif + +#if !defined(HAVE_MEMCMP) +# undef memcmp +# define memcmp(a,b,c) lzo_memcmp(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcmp(a,b,c) memcmp(a,b,c) +#endif +#if !defined(HAVE_MEMCPY) +# undef memcpy +# define memcpy(a,b,c) lzo_memcpy(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcpy(a,b,c) memcpy(a,b,c) +#endif +#if !defined(HAVE_MEMMOVE) +# undef memmove +# define memmove(a,b,c) lzo_memmove(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memmove(a,b,c) memmove(a,b,c) +#endif +#if !defined(HAVE_MEMSET) +# undef memset +# define memset(a,b,c) lzo_memset(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memset(a,b,c) memset(a,b,c) +#endif + + +#undef NDEBUG +#if defined(LZO_CFG_FREESTANDING) +# undef LZO_DEBUG +# define NDEBUG 1 +# undef assert +# define assert(e) ((void)0) +#else +# if !defined(LZO_DEBUG) +# define NDEBUG 1 +# endif +# include +#endif + +#if 0 && defined(__BOUNDS_CHECKING_ON) +# include +#else +# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt +# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) +#endif + +#if !defined(__lzo_inline) +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +# define __lzo_noinline +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#if 1 +# define LZO_BYTE(x) ((unsigned char) (x)) +#else +# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) +#endif + +#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) +#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) +#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) +#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) + +#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) + +#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) + +/* this always fits into 16 bits */ +#define LZO_SIZE(bits) (1u << (bits)) +#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) + +#define LZO_LSIZE(bits) (1ul << (bits)) +#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1) + +#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) +#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) + +#if !defined(DMUL) +#if 0 + /* 32*32 multiplies may be faster than 64*64 on some 64-bit machines, + * but then we need extra casts from unsigned<->size_t */ +# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b))) +#else +# define DMUL(a,b) ((lzo_xint) ((a) * (b))) +#endif +#endif + + +/*********************************************************************** +// compiler and architecture specific stuff +************************************************************************/ + +/* Some defines that indicate if memory can be accessed at unaligned + * memory addresses. You should also test that this is actually faster + * even if it is allowed by your system. + */ + +#if 1 && !defined(LZO_CFG_NO_UNALIGNED) +#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if (LZO_SIZEOF_SHORT == 2) +# define LZO_UNALIGNED_OK_2 +# endif +# if (LZO_SIZEOF_INT == 4) +# define LZO_UNALIGNED_OK_4 +# endif +#endif +#endif + +#if defined(LZO_UNALIGNED_OK_2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2) +#endif +#if defined(LZO_UNALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#elif defined(LZO_ALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#endif + + +/* Fast memcpy that copies multiples of 8 byte chunks. + * len is the number of bytes. + * note: all parameters must be lvalues, len >= 8 + * dest and src advance, len is undefined afterwards + */ + +#define MEMCPY8_DS(dest,src,len) \ + lzo_memcpy(dest,src,len); dest += len; src += len + +#define BZERO8_PTR(s,l,n) \ + lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n)) + +#define MEMCPY_DS(dest,src,len) \ + do *dest++ = *src++; while (--len > 0) + + +/*********************************************************************** +// some globals +************************************************************************/ + +__LZO_EXTERN_C int __lzo_init_done; +__LZO_EXTERN_C const char __lzo_copyright[]; +LZO_EXTERN(const lzo_bytep) lzo_copyright(void); + + +/*********************************************************************** +// +************************************************************************/ + +#include "lzo_ptr.h" + + +/* Generate compressed data in a deterministic way. + * This is fully portable, and compression can be faster as well. + * A reason NOT to be deterministic is when the block size is + * very small (e.g. 8kB) or the dictionary is big, because + * then the initialization of the dictionary becomes a relevant + * magnitude for compression speed. + */ +#define LZO_DETERMINISTIC + + +#define LZO_DICT_USE_PTR +#if 0 && (LZO_ARCH_I086) +# undef LZO_DICT_USE_PTR +#endif + +#if defined(LZO_DICT_USE_PTR) +# define lzo_dict_t const lzo_bytep +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#else +# define lzo_dict_t lzo_uint +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#endif + + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo_crc.c b/thirdparty/lzo/2.03/src/lzo_crc.c new file mode 100644 index 0000000..83941ab --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_crc.c @@ -0,0 +1,167 @@ +/* lzo_crc.c -- crc checksum for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" + + +/*********************************************************************** +// crc32 checksum +// adapted from free code by Mark Adler +// see http://www.zlib.org/ +************************************************************************/ + +static const lzo_uint32 lzo_crc32_table[256] = { + 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, + 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, + 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, + 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, + 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, + 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, + 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, + 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, + 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, + 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, + 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, + 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, + 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, + 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, + 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, + 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, + 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, + 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, + 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, + 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, + 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, + 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, + 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, + 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, + 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, + 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, + 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, + 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, + 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, + 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, + 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, + 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, + 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, + 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, + 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, + 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, + 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, + 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, + 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, + 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, + 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, + 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, + 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, + 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, + 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, + 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, + 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, + 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, + 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, + 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, + 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, + 0x2d02ef8dL +}; + + +LZO_PUBLIC(const lzo_uint32p) +lzo_get_crc32_table(void) +{ + return lzo_crc32_table; +} + + +#if 1 +#define LZO_DO1(buf,i) \ + crc = table[((int)crc ^ buf[i]) & 0xff] ^ (crc >> 8) +#else +#define LZO_DO1(buf,i) \ + crc = table[(unsigned char)((unsigned char)crc ^ buf[i])] ^ (crc >> 8) +#endif +#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1); +#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2); +#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4); +#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8); + + +LZO_PUBLIC(lzo_uint32) +lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len) +{ + lzo_uint32 crc; +#undef table +#if 1 +# define table lzo_crc32_table +#else + const lzo_uint32 * table = lzo_crc32_table; +#endif + + if (buf == NULL) + return 0; + + crc = (c & LZO_UINT32_C(0xffffffff)) ^ LZO_UINT32_C(0xffffffff); + if (len >= 16) do + { + LZO_DO16(buf,0); + buf += 16; + len -= 16; + } while (len >= 16); + if (len != 0) do + { + LZO_DO1(buf,0); + buf += 1; + len -= 1; + } while (len > 0); + + return crc ^ LZO_UINT32_C(0xffffffff); +#undef table +} + +#undef LZO_DO1 +#undef LZO_DO2 +#undef LZO_DO4 +#undef LZO_DO8 +#undef LZO_DO16 + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo_dict.h b/thirdparty/lzo/2.03/src/lzo_dict.h new file mode 100644 index 0000000..043a1e2 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_dict.h @@ -0,0 +1,316 @@ +/* lzo_dict.h -- dictionary definitions for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_DICT_H +#define __LZO_DICT_H + +#ifdef __cplusplus +extern "C" { +#endif + + + +/*********************************************************************** +// dictionary size +************************************************************************/ + +/* dictionary needed for compression */ +#if !defined(D_BITS) && defined(DBITS) +# define D_BITS DBITS +#endif +#if !defined(D_BITS) +# error "D_BITS is not defined" +#endif +#if (D_BITS < 16) +# define D_SIZE LZO_SIZE(D_BITS) +# define D_MASK LZO_MASK(D_BITS) +#else +# define D_SIZE LZO_USIZE(D_BITS) +# define D_MASK LZO_UMASK(D_BITS) +#endif +#define D_HIGH ((D_MASK >> 1) + 1) + + +/* dictionary depth */ +#if !defined(DD_BITS) +# define DD_BITS 0 +#endif +#define DD_SIZE LZO_SIZE(DD_BITS) +#define DD_MASK LZO_MASK(DD_BITS) + +/* dictionary length */ +#if !defined(DL_BITS) +# define DL_BITS (D_BITS - DD_BITS) +#endif +#if (DL_BITS < 16) +# define DL_SIZE LZO_SIZE(DL_BITS) +# define DL_MASK LZO_MASK(DL_BITS) +#else +# define DL_SIZE LZO_USIZE(DL_BITS) +# define DL_MASK LZO_UMASK(DL_BITS) +#endif + + +#if (D_BITS != DL_BITS + DD_BITS) +# error "D_BITS does not match" +#endif +#if (D_BITS < 8 || D_BITS > 18) +# error "invalid D_BITS" +#endif +#if (DL_BITS < 8 || DL_BITS > 20) +# error "invalid DL_BITS" +#endif +#if (DD_BITS < 0 || DD_BITS > 6) +# error "invalid DD_BITS" +#endif + + +#if !defined(DL_MIN_LEN) +# define DL_MIN_LEN 3 +#endif +#if !defined(DL_SHIFT) +# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN) +#endif + + + +/*********************************************************************** +// dictionary access +************************************************************************/ + +#define LZO_HASH_GZIP 1 +#define LZO_HASH_GZIP_INCREMENTAL 2 +#define LZO_HASH_LZO_INCREMENTAL_A 3 +#define LZO_HASH_LZO_INCREMENTAL_B 4 + +#if !defined(LZO_HASH) +# error "choose a hashing strategy" +#endif + +#undef DM +#undef DX + +#if (DL_MIN_LEN == 3) +# define _DV2_A(p,shift1,shift2) \ + (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2]) +# define _DV2_B(p,shift1,shift2) \ + (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0]) +# define _DV3_B(p,shift1,shift2,shift3) \ + ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0]) +#elif (DL_MIN_LEN == 2) +# define _DV2_A(p,shift1,shift2) \ + (( (lzo_xint)(p[0]) << shift1) ^ p[1]) +# define _DV2_B(p,shift1,shift2) \ + (( (lzo_xint)(p[1]) << shift1) ^ p[2]) +#else +# error "invalid DL_MIN_LEN" +#endif +#define _DV_A(p,shift) _DV2_A(p,shift,shift) +#define _DV_B(p,shift) _DV2_B(p,shift,shift) +#define DA2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0]) +#define DS2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0]) +#define DX2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) +#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0]) +#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0]) +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) +#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s))) +#define DM(v) DMS(v,0) + + +#if (LZO_HASH == LZO_HASH_GZIP) + /* hash function like in gzip/zlib (deflate) */ +# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT)) + +#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL) + /* incremental hash like in gzip/zlib (deflate) */ +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT) +# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2]) +# define _DINDEX(dv,p) (dv) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A) + /* incremental LZO hash version A */ +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2]) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B) + /* incremental LZO hash version B */ +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_B((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5))) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#else +# error "choose a hashing strategy" +#endif + + +#ifndef DINDEX +#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS) +#endif +#if !defined(DINDEX1) && defined(D_INDEX1) +#define DINDEX1 D_INDEX1 +#endif +#if !defined(DINDEX2) && defined(D_INDEX2) +#define DINDEX2 D_INDEX2 +#endif + + + +#if !defined(__LZO_HASH_INCREMENTAL) +# define DVAL_FIRST(dv,p) ((void) 0) +# define DVAL_NEXT(dv,p) ((void) 0) +# define DVAL_LOOKAHEAD 0 +#endif + + +#if !defined(DVAL_ASSERT) +#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG) +static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p) +{ + lzo_xint df; + DVAL_FIRST(df,(p)); + assert(DINDEX(dv,p) == DINDEX(df,p)); +} +#else +# define DVAL_ASSERT(dv,p) ((void) 0) +#endif +#endif + + + +/*********************************************************************** +// dictionary updating +************************************************************************/ + +#if defined(LZO_DICT_USE_PTR) +# define DENTRY(p,in) (p) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex] +#else +# define DENTRY(p,in) ((lzo_uint) ((p)-(in))) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex] +#endif + + +#if (DD_BITS == 0) + +# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in) +# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in) +# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in) + +#else + +# define UPDATE_D(dict,drun,dv,p,in) \ + dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_I(dict,drun,index,p,in) \ + dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_P(ptr,drun,p,in) \ + (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK + +#endif + + +/*********************************************************************** +// test for a match +************************************************************************/ + +#if defined(LZO_DICT_USE_PTR) + +/* m_pos is either NULL or a valid pointer */ +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset) + +/* m_pos may point anywhere... */ +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (BOUNDS_CHECKING_OFF_IN_EXPR(( \ + m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \ + PTR_LT(m_pos,in) || \ + (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \ + m_off > max_offset ))) + +#else + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_off == 0 || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (pd(ip, in) <= m_off || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#endif + + +#if defined(LZO_DETERMINISTIC) +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET +#else +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET +#endif + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo_dll.ch b/thirdparty/lzo/2.03/src/lzo_dll.ch new file mode 100644 index 0000000..346cb27 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_dll.ch @@ -0,0 +1,64 @@ +/* lzo_dll.ch -- DLL initialization of the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// Windows 16 bit + Watcom C + DLL +************************************************************************/ + +#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) + +/* don't pull in - we don't need it */ +#if 0 +BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, + WORD wHeapSize, LPSTR lpszCmdLine ) +#else +int __far __pascal LibMain ( int a, short b, short c, long d ) +#endif +{ + LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); + return 1; +} + +#endif + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo_init.c b/thirdparty/lzo/2.03/src/lzo_init.c new file mode 100644 index 0000000..6977891 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_init.c @@ -0,0 +1,176 @@ +/* lzo_init.c -- initialization of the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" + + +/*********************************************************************** +// Runtime check of the assumptions about the size of builtin types, +// memory model, byte order and other low-level constructs. +// +// We are really paranoid here - LZO should either fail +// at startup or not at all. +// +// Because of inlining much of these functions evaluates to nothing. +// +// And while many of the tests seem highly obvious and redundant they are +// here to catch compiler/optimizer bugs. Yes, these do exist. +************************************************************************/ + +#if !defined(__LZO_IN_MINILZO) + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#include "miniacc.h" + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32) + ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) + ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4) + +#if !defined(__LZO_UINTPTR_T_IS_POINTER) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) +#endif + ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32)) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint)) + ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint)) + +#endif +#undef ACCCHK_ASSERT + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(int) +_lzo_config_check(void) +{ + lzo_bool r = 1; + union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u; + lzo_uintptr_t p; + +#if !defined(LZO_CFG_NO_CONFIG_CHECK) +#if defined(LZO_ABI_BIG_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_ABI_LITTLE_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[0] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_UNALIGNED_OK_2) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_ushortp) (p+1)) == 0); +#endif +#if defined(LZO_UNALIGNED_OK_4) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_uint32p) (p+1)) == 0); +#endif +#endif + + LZO_UNUSED(u); LZO_UNUSED(p); + return r == 1 ? LZO_E_OK : LZO_E_ERROR; +} + + +/*********************************************************************** +// +************************************************************************/ + +int __lzo_init_done = 0; + +LZO_PUBLIC(int) +__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5, + int s6, int s7, int s8, int s9) +{ + int r; + +#if defined(__LZO_IN_MINILZO) +#elif (LZO_CC_MSC && ((_MSC_VER) < 700)) +#else +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr) +#include "miniacc.h" +#endif +#undef ACCCHK_ASSERT + + __lzo_init_done = 1; + + if (v == 0) + return LZO_E_ERROR; + + r = (s1 == -1 || s1 == (int) sizeof(short)) && + (s2 == -1 || s2 == (int) sizeof(int)) && + (s3 == -1 || s3 == (int) sizeof(long)) && + (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) && + (s5 == -1 || s5 == (int) sizeof(lzo_uint)) && + (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) && + (s7 == -1 || s7 == (int) sizeof(char *)) && + (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) && + (s9 == -1 || s9 == (int) sizeof(lzo_callback_t)); + if (!r) + return LZO_E_ERROR; + + r = _lzo_config_check(); + if (r != LZO_E_OK) + return r; + + return r; +} + + +#if !defined(__LZO_IN_MINILZO) +#include "lzo_dll.ch" +#endif + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo_mchw.ch b/thirdparty/lzo/2.03/src/lzo_mchw.ch new file mode 100644 index 0000000..a8c4fec --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_mchw.ch @@ -0,0 +1,242 @@ +/* lzo_mchw.ch -- matching functions using a window + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/*********************************************************************** +// +************************************************************************/ + +typedef struct +{ + int init; + + lzo_uint look; /* bytes in lookahead buffer */ + + lzo_uint m_len; + lzo_uint m_off; + + lzo_uint last_m_len; + lzo_uint last_m_off; + + const lzo_bytep bp; + const lzo_bytep ip; + const lzo_bytep in; + const lzo_bytep in_end; + lzo_bytep out; + + lzo_callback_p cb; + + lzo_uint textsize; /* text size counter */ + lzo_uint codesize; /* code size counter */ + lzo_uint printcount; /* counter for reporting progress every 1K bytes */ + + /* some stats */ + unsigned long lit_bytes; + unsigned long match_bytes; + unsigned long rep_bytes; + unsigned long lazy; + +#if defined(LZO1B) + lzo_uint r1_m_len; + + /* some stats */ + unsigned long r1_r, m3_r, m2_m, m3_m; +#endif + +#if defined(LZO1C) + lzo_uint r1_m_len; + lzo_bytep m3; + + /* some stats */ + unsigned long r1_r, m3_r, m2_m, m3_m; +#endif + +#if defined(LZO1F) + lzo_uint r1_lit; + lzo_uint r1_m_len; + + /* some stats */ + unsigned long r1_r, m2_m, m3_m; +#endif + +#if defined(LZO1X) || defined(LZO1Y) || defined(LZO1Z) + lzo_uint r1_lit; + lzo_uint r1_m_len; + + /* some stats */ + unsigned long m1a_m, m1b_m, m2_m, m3_m, m4_m; + unsigned long lit1_r, lit2_r, lit3_r; +#endif + +#if defined(LZO2A) + /* some stats */ + unsigned long m1, m2, m3, m4; +#endif +} +LZO_COMPRESS_T; + + +#if (LZO_CC_BORLANDC && LZO_ARCH_I086) && (__BORLANDC__ < 0x0450) + /* work around a Borland C 3.1 bug */ +# define getbyte(c) ((c).ip < (c).in_end ? (c).ip +=1, (c).ip[-1] : (-1)) +#elif defined(__TURBOC__) && defined(__TOS__) + /* work around a bug in Turbo C / Pure C (Atari ST) */ +# define getbyte(c) ((c).ip < (c).in_end ? (int)(unsigned) *((c).ip)++ : (-1)) +#else +# define getbyte(c) ((c).ip < (c).in_end ? *((c).ip)++ : (-1)) +#endif + +#include "lzo_swd.ch" + + +/*********************************************************************** +// +************************************************************************/ + +static int +init_match ( LZO_COMPRESS_T *c, lzo_swd_p s, + const lzo_bytep dict, lzo_uint dict_len, + lzo_uint32 flags ) +{ + int r; + + assert(!c->init); + c->init = 1; + + s->c = c; + + c->last_m_len = c->last_m_off = 0; + + c->textsize = c->codesize = c->printcount = 0; + c->lit_bytes = c->match_bytes = c->rep_bytes = 0; + c->lazy = 0; + + r = swd_init(s,dict,dict_len); + if (r != 0) + return r; + + s->use_best_off = (flags & 1) ? 1 : 0; + return r; +} + + +/*********************************************************************** +// +************************************************************************/ + +static int +find_match ( LZO_COMPRESS_T *c, lzo_swd_p s, + lzo_uint this_len, lzo_uint skip ) +{ + assert(c->init); + + if (skip > 0) + { + assert(this_len >= skip); + swd_accept(s, this_len - skip); + c->textsize += this_len - skip + 1; + } + else + { + assert(this_len <= 1); + c->textsize += this_len - skip; + } + + s->m_len = 1; + s->m_len = THRESHOLD; +#ifdef SWD_BEST_OFF + if (s->use_best_off) + lzo_memset(s->best_pos,0,sizeof(s->best_pos)); +#endif + swd_findbest(s); + c->m_len = s->m_len; + c->m_off = s->m_off; + + swd_getbyte(s); + + if (s->b_char < 0) + { + c->look = 0; + c->m_len = 0; + swd_exit(s); + } + else + { + c->look = s->look + 1; + } + c->bp = c->ip - c->look; + +#if 0 + /* brute force match search */ + if (c->m_len > THRESHOLD && c->m_len + 1 <= c->look) + { + const lzo_bytep ip = c->bp; + const lzo_bytep m = c->bp - c->m_off; + const lzo_bytep in = c->in; + + if (ip - in > N) + in = ip - N; + for (;;) + { + while (*in != *ip) + in++; + if (in == ip) + break; + if (in != m) + if (lzo_memcmp(in,ip,c->m_len+1) == 0) + printf("%p %p %p %5d\n",in,ip,m,c->m_len); + in++; + } + } +#endif + + if (c->cb && c->cb->nprogress && c->textsize > c->printcount) + { + (*c->cb->nprogress)(c->cb, c->textsize, c->codesize, 0); + c->printcount += 1024; + } + + return LZO_E_OK; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo_ptr.c b/thirdparty/lzo/2.03/src/lzo_ptr.c new file mode 100644 index 0000000..064bddf --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_ptr.c @@ -0,0 +1,92 @@ +/* lzo_ptr.c -- low-level pointer constructs + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr) +{ + lzo_uintptr_t p; + +#if (LZO_ARCH_I086) + p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr)); +#elif (LZO_MM_PVP) + p = (lzo_uintptr_t) (ptr); + p = (p << 3) | (p >> 61); +#else + p = (lzo_uintptr_t) PTR_LINEAR(ptr); +#endif + + return p; +} + + +/*********************************************************************** +// +************************************************************************/ + +LZO_PUBLIC(unsigned) +__lzo_align_gap(const lzo_voidp ptr, lzo_uint size) +{ +#if defined(__LZO_UINTPTR_T_IS_POINTER) + size_t n = (size_t) ptr; + n = (((n + size - 1) / size) * size) - n; +#else + lzo_uintptr_t p, n; + p = __lzo_ptr_linear(ptr); + n = (((p + size - 1) / size) * size) - p; +#endif + + assert(size > 0); + assert((long)n >= 0); + assert(n <= size); + return (unsigned)n; +} + + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo_ptr.h b/thirdparty/lzo/2.03/src/lzo_ptr.h new file mode 100644 index 0000000..e286a70 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_ptr.h @@ -0,0 +1,154 @@ +/* lzo_ptr.h -- low-level pointer constructs + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_PTR_H +#define __LZO_PTR_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// Integral types +************************************************************************/ + +#if !defined(lzo_uintptr_t) +# if defined(__LZO_MMODEL_HUGE) +# define lzo_uintptr_t unsigned long +# else +# define lzo_uintptr_t acc_uintptr_t +# ifdef __ACC_INTPTR_T_IS_POINTER +# define __LZO_UINTPTR_T_IS_POINTER 1 +# endif +# endif +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Always use the safe (=integral) version for pointer-comparisions. + * The compiler should optimize away the additional casts anyway. + * + * Note that this only works if the representation and ordering + * of the pointer and the integral is the same (at bit level). + * + * Most 16-bit compilers have their own view about pointers - + * fortunately they don't care about comparing pointers + * that are pointing to Nirvana. + */ + +#if (LZO_ARCH_I086) +#define PTR(a) ((lzo_bytep) (a)) +/* only need the low bits of the pointer -> offset is ok */ +#define PTR_ALIGNED_4(a) ((ACC_PTR_FP_OFF(a) & 3) == 0) +#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0) +#elif (LZO_MM_PVP) +#define PTR(a) ((lzo_bytep) (a)) +#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0) +#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0) +#else +#define PTR(a) ((lzo_uintptr_t) (a)) +#define PTR_LINEAR(a) PTR(a) +#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0) +#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0) +#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0) +#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0) +#endif + +#define PTR_LT(a,b) (PTR(a) < PTR(b)) +#define PTR_GE(a,b) (PTR(a) >= PTR(b)) +#define PTR_DIFF(a,b) (PTR(a) - PTR(b)) +#define pd(a,b) ((lzo_uint) ((a)-(b))) + + +LZO_EXTERN(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr); + + +typedef union +{ + char a_char; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long a_long; + unsigned long a_ulong; + lzo_int a_lzo_int; + lzo_uint a_lzo_uint; + lzo_int32 a_lzo_int32; + lzo_uint32 a_lzo_uint32; + ptrdiff_t a_ptrdiff_t; + lzo_uintptr_t a_lzo_uintptr_t; + lzo_voidp a_lzo_voidp; + void * a_void_p; + lzo_bytep a_lzo_bytep; + lzo_bytepp a_lzo_bytepp; + lzo_uintp a_lzo_uintp; + lzo_uint * a_lzo_uint_p; + lzo_uint32p a_lzo_uint32p; + lzo_uint32 * a_lzo_uint32_p; + unsigned char * a_uchar_p; + char * a_char_p; +} +lzo_full_align_t; + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo_str.c b/thirdparty/lzo/2.03/src/lzo_str.c new file mode 100644 index 0000000..bf08960 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_str.c @@ -0,0 +1,71 @@ +/* lzo_str.c -- string functions for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" + +#undef lzo_memcmp +#undef lzo_memcpy +#undef lzo_memmove +#undef lzo_memset + + +/*********************************************************************** +// slow but portable stuff, only used in assertions +************************************************************************/ + +#if !defined(__LZO_MMODEL_HUGE) +# undef ACC_HAVE_MM_HUGE_PTR +#endif +#define acc_hsize_t lzo_uint +#define acc_hvoid_p lzo_voidp +#define acc_hbyte_p lzo_bytep +#define ACCLIB_PUBLIC(r,f) LZO_PUBLIC(r) f +#define acc_hmemcmp lzo_memcmp +#define acc_hmemcpy lzo_memcpy +#define acc_hmemmove lzo_memmove +#define acc_hmemset lzo_memset +#define ACC_WANT_ACCLIB_HMEMCPY 1 +#include "miniacc.h" +#undef ACCLIB_PUBLIC + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/lzo_swd.ch b/thirdparty/lzo/2.03/src/lzo_swd.ch new file mode 100644 index 0000000..aa4b17c --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_swd.ch @@ -0,0 +1,707 @@ +/* lzo_swd.ch -- sliding window dictionary + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#if (LZO_UINT_MAX < LZO_0xffffffffL) +# error "LZO_UINT_MAX" +#endif + + +/*********************************************************************** +// +************************************************************************/ + +#ifndef SWD_N +# define SWD_N N +#endif +#ifndef SWD_F +# define SWD_F F +#endif +#ifndef SWD_THRESHOLD +# define SWD_THRESHOLD THRESHOLD +#endif + +/* unsigned type for dictionary access - don't waste memory here */ +#if (0UL + SWD_N + SWD_F + SWD_F < 0UL + USHRT_MAX) + typedef unsigned short swd_uint; +# define SWD_UINT_MAX USHRT_MAX +#elif (0UL + SWD_N + SWD_F + SWD_F < 0UL + UINT_MAX) + typedef unsigned swd_uint; +# define SWD_UINT_MAX UINT_MAX +#else + typedef lzo_uint swd_uint; +# define SWD_UINT_MAX LZO_UINT_MAX +#endif +#define swd_uintp swd_uint __LZO_MMODEL * +#define SWD_UINT(x) ((swd_uint)(x)) + + +#ifndef SWD_HSIZE +# define SWD_HSIZE 16384 +#endif +#ifndef SWD_MAX_CHAIN +# define SWD_MAX_CHAIN 2048 +#endif + +#if !defined(HEAD3) +#if 1 +# define HEAD3(b,p) \ + ((DMUL(0x9f5f,(((((lzo_xint)b[p]<<5)^b[p+1])<<5)^b[p+2]))>>5) & (SWD_HSIZE-1)) +#else +# define HEAD3(b,p) \ + ((DMUL(0x9f5f,(((((lzo_xint)b[p+2]<<5)^b[p+1])<<5)^b[p]))>>5) & (SWD_HSIZE-1)) +#endif +#endif + +#if (SWD_THRESHOLD == 1) && !defined(HEAD2) +# if 1 && defined(LZO_UNALIGNED_OK_2) +# define HEAD2(b,p) (* (lzo_ushortp) &(b[p])) +# else +# define HEAD2(b,p) (b[p] ^ ((unsigned)b[p+1]<<8)) +# endif +# define NIL2 SWD_UINT_MAX +#endif + + +typedef struct +{ +/* public - "built-in" */ + lzo_uint n; + lzo_uint f; + lzo_uint threshold; + +/* public - configuration */ + lzo_uint max_chain; + lzo_uint nice_length; + lzo_bool use_best_off; + lzo_uint lazy_insert; + +/* public - output */ + lzo_uint m_len; + lzo_uint m_off; + lzo_uint look; + int b_char; +#if defined(SWD_BEST_OFF) + lzo_uint best_off[ SWD_BEST_OFF ]; +#endif + +/* semi public */ + LZO_COMPRESS_T *c; + lzo_uint m_pos; +#if defined(SWD_BEST_OFF) + lzo_uint best_pos[ SWD_BEST_OFF ]; +#endif + +/* private */ + const lzo_bytep dict; + const lzo_bytep dict_end; + lzo_uint dict_len; + +/* private */ + lzo_uint ip; /* input pointer (lookahead) */ + lzo_uint bp; /* buffer pointer */ + lzo_uint rp; /* remove pointer */ + lzo_uint b_size; + + lzo_bytep b_wrap; + + lzo_uint node_count; + lzo_uint first_rp; + +#if defined(__LZO_MMODEL_HUGE) +# define A(type, n) ((((n) * sizeof(type)) + 3UL) &~ 3UL) + +# define O_b(s) (0L) +# define O_head3(s) (O_b(s) + A(char, 0UL + SWD_N + SWD_F + SWD_F)) +# define O_succ3(s) (O_head3(s) + A(swd_uint, 0UL + SWD_HSIZE)) +# define O_best3(s) (O_succ3(s) + A(swd_uint, 0UL + SWD_N + SWD_F)) +# define O_llen3(s) (O_best3(s) + A(swd_uint, 0UL + SWD_N + SWD_F)) +# ifdef HEAD2 +# define O_head2(s) (O_llen3(s) + A(swd_uint, 0UL + SWD_HSIZE)) +# define O_END(s) (O_head2(s) + A(swd_uint, 0UL + 65536L)) +# else +# define O_END(s) (O_llen3(s) + A(swd_uint, 0UL + SWD_HSIZE)) +# endif + +# define S_DEF(s,type,off) ((type) ((lzo_bytep)s + 0L + sizeof(*s) + off)) +# define s_b(s) S_DEF(s, lzo_bytep, O_b(s)) +# define s_head3(s) S_DEF(s, swd_uintp, O_head3(s)) +# define s_succ3(s) S_DEF(s, swd_uintp, O_succ3(s)) +# define s_best3(s) S_DEF(s, swd_uintp, O_best3(s)) +# define s_llen3(s) S_DEF(s, swd_uintp, O_llen3(s)) +# ifdef HEAD2 +# define s_head2(s) S_DEF(s, swd_uintp, O_head2(s)) +# endif + +#elif defined(__LZO_CHECKER) + /* malloc arrays of the exact size to detect any overrun */ + unsigned char *b; + swd_uint *head3; + swd_uint *succ3; + swd_uint *best3; + swd_uint *llen3; +# ifdef HEAD2 + swd_uint *head2; +# endif + +#else + unsigned char b [ SWD_N + SWD_F + SWD_F ]; + swd_uint head3 [ SWD_HSIZE ]; + swd_uint succ3 [ SWD_N + SWD_F ]; + swd_uint best3 [ SWD_N + SWD_F ]; + swd_uint llen3 [ SWD_HSIZE ]; +# ifdef HEAD2 + swd_uint head2 [ 65536L ]; +# endif +#endif +} +lzo_swd_t; +#define lzo_swd_p lzo_swd_t __LZO_MMODEL * + + +#if defined(__LZO_MMODEL_HUGE) +#define SIZEOF_LZO_SWD_T O_END(0) +#else +#define s_b(s) s->b +#define s_head3(s) s->head3 +#define s_succ3(s) s->succ3 +#define s_best3(s) s->best3 +#define s_llen3(s) s->llen3 +#ifdef HEAD2 +#define s_head2(s) s->head2 +#endif +#define SIZEOF_LZO_SWD_T (sizeof(lzo_swd_t)) +#endif + + +/* Access macro for head3. + * head3[key] may be uninitialized, but then its value will never be used. + */ +#if defined(__LZO_CHECKER) +# define s_get_head3(s,key) \ + ((s->llen3[key] == 0) ? SWD_UINT_MAX : s_head3(s)[key]) +#else +# define s_get_head3(s,key) s_head3(s)[key] +#endif + + +/*********************************************************************** +// +************************************************************************/ + +static +void swd_initdict(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len) +{ + s->dict = s->dict_end = NULL; + s->dict_len = 0; + + if (!dict || dict_len <= 0) + return; + if (dict_len > s->n) + { + dict += dict_len - s->n; + dict_len = s->n; + } + + s->dict = dict; + s->dict_len = dict_len; + s->dict_end = dict + dict_len; + lzo_memcpy(s_b(s),dict,dict_len); + s->ip = dict_len; +} + + +static +void swd_insertdict(lzo_swd_p s, lzo_uint node, lzo_uint len) +{ + lzo_uint key; + + s->node_count = s->n - len; + s->first_rp = node; + + while (len-- > 0) + { + key = HEAD3(s_b(s),node); + s_succ3(s)[node] = s_get_head3(s,key); + s_head3(s)[key] = SWD_UINT(node); + s_best3(s)[node] = SWD_UINT(s->f + 1); + s_llen3(s)[key]++; + assert(s_llen3(s)[key] <= SWD_N); + +#ifdef HEAD2 + key = HEAD2(s_b(s),node); + s_head2(s)[key] = SWD_UINT(node); +#endif + + node++; + } +} + + +/*********************************************************************** +// +************************************************************************/ + +static +int swd_init(lzo_swd_p s, const lzo_bytep dict, lzo_uint dict_len) +{ + lzo_uint i = 0; + int c = 0; + +#if defined(__LZO_CHECKER) + s->b = malloc(SWD_N + SWD_F + SWD_F); + s->head3 = malloc(sizeof(swd_uint) * SWD_HSIZE); + s->succ3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F)); + s->best3 = malloc(sizeof(swd_uint) * (SWD_N + SWD_F)); + s->llen3 = malloc(sizeof(swd_uint) * SWD_HSIZE); +#ifdef HEAD2 + s->head2 = malloc(sizeof(swd_uint) * 65536L); +#endif +#endif + + s->n = SWD_N; + s->f = SWD_F; + s->threshold = SWD_THRESHOLD; + + /* defaults */ + s->max_chain = SWD_MAX_CHAIN; + s->nice_length = SWD_F; + s->use_best_off = 0; + s->lazy_insert = 0; + + s->b_size = s->n + s->f; +#if 0 + if (2 * s->f >= s->n || s->b_size + s->f >= SWD_UINT_MAX) + return LZO_E_ERROR; +#else + LZO_COMPILE_TIME_ASSERT(!(0ul + 2 * SWD_F >= SWD_N)) + LZO_COMPILE_TIME_ASSERT(!(0ul + SWD_N + SWD_F + SWD_F >= SWD_UINT_MAX)) +#endif + s->b_wrap = s_b(s) + s->b_size; + s->node_count = s->n; + + lzo_memset(s_llen3(s), 0, sizeof(s_llen3(s)[0]) * (lzo_uint)SWD_HSIZE); +#ifdef HEAD2 +#if 1 + lzo_memset(s_head2(s), 0xff, sizeof(s_head2(s)[0]) * 65536L); + assert(s_head2(s)[0] == NIL2); +#else + for (i = 0; i < 65536L; i++) + s_head2(s)[i] = NIL2; +#endif +#endif + + s->ip = 0; + swd_initdict(s,dict,dict_len); + s->bp = s->ip; + s->first_rp = s->ip; + + assert(s->ip + s->f <= s->b_size); +#if 1 + s->look = (lzo_uint) (s->c->in_end - s->c->ip); + if (s->look > 0) + { + if (s->look > s->f) + s->look = s->f; + lzo_memcpy(&s_b(s)[s->ip],s->c->ip,s->look); + s->c->ip += s->look; + s->ip += s->look; + } +#else + s->look = 0; + while (s->look < s->f) + { + if ((c = getbyte(*(s->c))) < 0) + break; + s_b(s)[s->ip] = LZO_BYTE(c); + s->ip++; + s->look++; + } +#endif + if (s->ip == s->b_size) + s->ip = 0; + + if (s->look >= 2 && s->dict_len > 0) + swd_insertdict(s,0,s->dict_len); + + s->rp = s->first_rp; + if (s->rp >= s->node_count) + s->rp -= s->node_count; + else + s->rp += s->b_size - s->node_count; + +#if defined(__LZO_CHECKER) + /* initialize memory for the first few HEAD3 (if s->ip is not far + * enough ahead to do this job for us). The value doesn't matter. */ + if (s->look < 3) + lzo_memset(&s_b(s)[s->bp+s->look],0,3); +#endif + + LZO_UNUSED(i); + LZO_UNUSED(c); + return LZO_E_OK; +} + + +static +void swd_exit(lzo_swd_p s) +{ +#if defined(__LZO_CHECKER) + /* free in reverse order of allocations */ +#ifdef HEAD2 + free(s->head2); s->head2 = NULL; +#endif + free(s->llen3); s->llen3 = NULL; + free(s->best3); s->best3 = NULL; + free(s->succ3); s->succ3 = NULL; + free(s->head3); s->head3 = NULL; + free(s->b); s->b = NULL; +#else + LZO_UNUSED(s); +#endif +} + + +#define swd_pos2off(s,pos) \ + (s->bp > (pos) ? s->bp - (pos) : s->b_size - ((pos) - s->bp)) + + +/*********************************************************************** +// +************************************************************************/ + +static __lzo_inline +void swd_getbyte(lzo_swd_p s) +{ + int c; + + if ((c = getbyte(*(s->c))) < 0) + { + if (s->look > 0) + --s->look; +#if defined(__LZO_CHECKER) + /* initialize memory - value doesn't matter */ + s_b(s)[s->ip] = 0; + if (s->ip < s->f) + s->b_wrap[s->ip] = 0; +#endif + } + else + { + s_b(s)[s->ip] = LZO_BYTE(c); + if (s->ip < s->f) + s->b_wrap[s->ip] = LZO_BYTE(c); + } + if (++s->ip == s->b_size) + s->ip = 0; + if (++s->bp == s->b_size) + s->bp = 0; + if (++s->rp == s->b_size) + s->rp = 0; +} + + +/*********************************************************************** +// remove node from lists +************************************************************************/ + +static __lzo_inline +void swd_remove_node(lzo_swd_p s, lzo_uint node) +{ + if (s->node_count == 0) + { + lzo_uint key; + +#ifdef LZO_DEBUG + if (s->first_rp != LZO_UINT_MAX) + { + if (node != s->first_rp) + printf("Remove %5u: %5u %5u %5u %5u %6u %6u\n", + node, s->rp, s->ip, s->bp, s->first_rp, + s->ip - node, s->ip - s->bp); + assert(node == s->first_rp); + s->first_rp = LZO_UINT_MAX; + } +#endif + + key = HEAD3(s_b(s),node); + assert(s_llen3(s)[key] > 0); + --s_llen3(s)[key]; + +#ifdef HEAD2 + key = HEAD2(s_b(s),node); + assert(s_head2(s)[key] != NIL2); + if ((lzo_uint) s_head2(s)[key] == node) + s_head2(s)[key] = NIL2; +#endif + } + else + --s->node_count; +} + + +/*********************************************************************** +// +************************************************************************/ + +static +void swd_accept(lzo_swd_p s, lzo_uint n) +{ + assert(n <= s->look); + + while (n--) + { + lzo_uint key; + + swd_remove_node(s,s->rp); + + /* add bp into HEAD3 */ + key = HEAD3(s_b(s),s->bp); + s_succ3(s)[s->bp] = s_get_head3(s,key); + s_head3(s)[key] = SWD_UINT(s->bp); + s_best3(s)[s->bp] = SWD_UINT(s->f + 1); + s_llen3(s)[key]++; + assert(s_llen3(s)[key] <= SWD_N); + +#ifdef HEAD2 + /* add bp into HEAD2 */ + key = HEAD2(s_b(s),s->bp); + s_head2(s)[key] = SWD_UINT(s->bp); +#endif + + swd_getbyte(s); + } +} + + +/*********************************************************************** +// +************************************************************************/ + +static +void swd_search(lzo_swd_p s, lzo_uint node, lzo_uint cnt) +{ + const lzo_bytep p1; + const lzo_bytep p2; + const lzo_bytep px; + lzo_uint m_len = s->m_len; + const lzo_bytep b = s_b(s); + const lzo_bytep bp = s_b(s) + s->bp; + const lzo_bytep bx = s_b(s) + s->bp + s->look; + unsigned char scan_end1; + + assert(s->m_len > 0); + + scan_end1 = bp[m_len - 1]; + for ( ; cnt-- > 0; node = s_succ3(s)[node]) + { + p1 = bp; + p2 = b + node; + px = bx; + + assert(m_len < s->look); + + if ( +#if 1 + p2[m_len - 1] == scan_end1 && + p2[m_len] == p1[m_len] && +#endif + p2[0] == p1[0] && + p2[1] == p1[1]) + { + lzo_uint i; + assert(lzo_memcmp(bp,&b[node],3) == 0); + +#if 0 && defined(LZO_UNALIGNED_OK_4) + p1 += 3; p2 += 3; + while (p1 < px && * (const lzo_uint32p) p1 == * (const lzo_uint32p) p2) + p1 += 4, p2 += 4; + while (p1 < px && *p1 == *p2) + p1 += 1, p2 += 1; +#else + p1 += 2; p2 += 2; + do {} while (++p1 < px && *p1 == *++p2); +#endif + i = pd(p1, bp); + +#ifdef LZO_DEBUG + if (lzo_memcmp(bp,&b[node],i) != 0) + printf("%5ld %5ld %02x%02x %02x%02x\n", + (long)s->bp, (long) node, + bp[0], bp[1], b[node], b[node+1]); +#endif + assert(lzo_memcmp(bp,&b[node],i) == 0); + +#if defined(SWD_BEST_OFF) + if (i < SWD_BEST_OFF) + { + if (s->best_pos[i] == 0) + s->best_pos[i] = node + 1; + } +#endif + if (i > m_len) + { + s->m_len = m_len = i; + s->m_pos = node; + if (m_len == s->look) + return; + if (m_len >= s->nice_length) + return; + if (m_len > (lzo_uint) s_best3(s)[node]) + return; + scan_end1 = bp[m_len - 1]; + } + } + } +} + + +/*********************************************************************** +// +************************************************************************/ + +#ifdef HEAD2 + +static +lzo_bool swd_search2(lzo_swd_p s) +{ + lzo_uint key; + + assert(s->look >= 2); + assert(s->m_len > 0); + + key = s_head2(s)[ HEAD2(s_b(s),s->bp) ]; + if (key == NIL2) + return 0; +#ifdef LZO_DEBUG + if (lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) != 0) + printf("%5ld %5ld %02x%02x %02x%02x\n", (long)s->bp, (long)key, + s_b(s)[s->bp], s_b(s)[s->bp+1], s_b(s)[key], s_b(s)[key+1]); +#endif + assert(lzo_memcmp(&s_b(s)[s->bp],&s_b(s)[key],2) == 0); +#if defined(SWD_BEST_OFF) + if (s->best_pos[2] == 0) + s->best_pos[2] = key + 1; +#endif + + if (s->m_len < 2) + { + s->m_len = 2; + s->m_pos = key; + } + return 1; +} + +#endif + + +/*********************************************************************** +// +************************************************************************/ + +static +void swd_findbest(lzo_swd_p s) +{ + lzo_uint key; + lzo_uint cnt, node; + lzo_uint len; + + assert(s->m_len > 0); + + /* get current head, add bp into HEAD3 */ + key = HEAD3(s_b(s),s->bp); + node = s_succ3(s)[s->bp] = s_get_head3(s,key); + cnt = s_llen3(s)[key]++; + assert(s_llen3(s)[key] <= SWD_N + SWD_F); + if (cnt > s->max_chain && s->max_chain > 0) + cnt = s->max_chain; + s_head3(s)[key] = SWD_UINT(s->bp); + + s->b_char = s_b(s)[s->bp]; + len = s->m_len; + if (s->m_len >= s->look) + { + if (s->look == 0) + s->b_char = -1; + s->m_off = 0; + s_best3(s)[s->bp] = SWD_UINT(s->f + 1); + } + else + { +#ifdef HEAD2 + if (swd_search2(s)) +#endif + if (s->look >= 3) + swd_search(s,node,cnt); + if (s->m_len > len) + s->m_off = swd_pos2off(s,s->m_pos); + s_best3(s)[s->bp] = SWD_UINT(s->m_len); + +#if defined(SWD_BEST_OFF) + if (s->use_best_off) + { + int i; + for (i = 2; i < SWD_BEST_OFF; i++) + if (s->best_pos[i] > 0) + s->best_off[i] = swd_pos2off(s,s->best_pos[i]-1); + else + s->best_off[i] = 0; + } +#endif + } + + swd_remove_node(s,s->rp); + +#ifdef HEAD2 + /* add bp into HEAD2 */ + key = HEAD2(s_b(s),s->bp); + s_head2(s)[key] = SWD_UINT(s->bp); +#endif +} + + +#undef HEAD3 +#undef HEAD2 +#undef s_get_head3 + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/src/lzo_util.c b/thirdparty/lzo/2.03/src/lzo_util.c new file mode 100644 index 0000000..c3bfb40 --- /dev/null +++ b/thirdparty/lzo/2.03/src/lzo_util.c @@ -0,0 +1,165 @@ +/* lzo_util.c -- utilities for the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo_conf.h" + + +/*********************************************************************** +// +************************************************************************/ + +/* If you use the LZO library in a product, I would appreciate that you + * keep this copyright string in the executable of your product. +.*/ + +const char __lzo_copyright[] = +#if !defined(__LZO_IN_MINLZO) + /* save space as some people want a really small decompressor */ + LZO_VERSION_STRING; +#else + "\r\n\n" + "LZO data compression library.\n" + "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer\n" + "\n" + "http://www.oberhumer.com $\n\n" + "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n" + "$Built: " __DATE__ " " __TIME__ " $\n" + "$Info: " LZO_INFO_STRING " $\n"; +#endif + + +LZO_PUBLIC(const lzo_bytep) +lzo_copyright(void) +{ +#if (LZO_OS_DOS16 && LZO_CC_TURBOC) + return (lzo_voidp) __lzo_copyright; +#else + return (const lzo_bytep) __lzo_copyright; +#endif +} + +LZO_PUBLIC(unsigned) +lzo_version(void) +{ + return LZO_VERSION; +} + +LZO_PUBLIC(const char *) +lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const char *) +lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + + +/*********************************************************************** +// adler32 checksum +// adapted from free code by Mark Adler +// see http://www.zlib.org/ +************************************************************************/ + +#define LZO_BASE 65521u /* largest prime smaller than 65536 */ +#define LZO_NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1 +#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1); +#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2); +#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4); +#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8); + +LZO_PUBLIC(lzo_uint32) +lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len) +{ + lzo_uint32 s1 = adler & 0xffff; + lzo_uint32 s2 = (adler >> 16) & 0xffff; + unsigned k; + + if (buf == NULL) + return 1; + + while (len > 0) + { + k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX; + len -= k; + if (k >= 16) do + { + LZO_DO16(buf,0); + buf += 16; + k -= 16; + } while (k >= 16); + if (k != 0) do + { + s1 += *buf++; + s2 += s1; + } while (--k > 0); + s1 %= LZO_BASE; + s2 %= LZO_BASE; + } + return (s2 << 16) | s1; +} + +#undef LZO_DO1 +#undef LZO_DO2 +#undef LZO_DO4 +#undef LZO_DO8 +#undef LZO_DO16 + + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/miniacc.h b/thirdparty/lzo/2.03/src/miniacc.h new file mode 100644 index 0000000..315a20b --- /dev/null +++ b/thirdparty/lzo/2.03/src/miniacc.h @@ -0,0 +1,6553 @@ +/* ACC --- Automatic Compiler Configuration + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __ACC_H_INCLUDED +#define __ACC_H_INCLUDED 1 +#define ACC_VERSION 20080430L +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined(__IBMCPP__) && !defined(__IBMC__) +# define __IBMC__ __IBMCPP__ +#endif +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +# define __INTEL_COMPILER __ICL +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if defined(__INTEL_COMPILER) && defined(__linux__) +# pragma warning(disable: 193) +#endif +#if defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif 0 && defined(__C251__) +# pragma warning disable = 322 +#endif +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if (_MSC_VER >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#if defined(__POCC__) && defined(_WIN32) +# if (__POCC__ >= 400) +# pragma warn(disable: 2216) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if defined(ACC_CFG_NO_CONFIG_HEADER) +#elif defined(ACC_CFG_CONFIG_HEADER) +# include ACC_CFG_CONFIG_HEADER +#else +#endif +#if defined(ACC_CFG_NO_LIMITS_H) +#elif defined(ACC_LIBC_NAKED) || defined(ACC_BROKEN_LIMITS_H) +#ifndef __ACC_FALLBACK_LIMITS_H_INCLUDED +#define __ACC_FALLBACK_LIMITS_H_INCLUDED +#undef CHAR_BIT +#define CHAR_BIT 8 +#ifndef MB_LEN_MAX +#define MB_LEN_MAX 1 +#endif +#ifndef __SCHAR_MAX__ +#define __SCHAR_MAX__ 127 +#endif +#ifndef __SHRT_MAX__ +#define __SHRT_MAX__ 32767 +#endif +#ifndef __INT_MAX__ +#define __INT_MAX__ 2147483647 +#endif +#ifndef __LONG_MAX__ +#if defined(__alpha__) || defined(_LP64) || defined(__MIPS_PSX2__) +#define __LONG_MAX__ 9223372036854775807L +#else +#define __LONG_MAX__ 2147483647L +#endif +#endif +#undef SCHAR_MIN +#undef SCHAR_MAX +#undef UCHAR_MAX +#define SCHAR_MIN (-1 - SCHAR_MAX) +#define SCHAR_MAX (__SCHAR_MAX__) +#define UCHAR_MAX (SCHAR_MAX * 2 + 1) +#undef SHRT_MIN +#undef SHRT_MAX +#undef USHRT_MAX +#define SHRT_MIN (-1 - SHRT_MAX) +#define SHRT_MAX (__SHRT_MAX__) +#if ((__INT_MAX__) == (__SHRT_MAX__)) +#define USHRT_MAX (SHRT_MAX * 2U + 1U) +#else +#define USHRT_MAX (SHRT_MAX * 2 + 1) +#endif +#undef INT_MIN +#undef INT_MAX +#undef UINT_MAX +#define INT_MIN (-1 - INT_MAX) +#define INT_MAX (__INT_MAX__) +#define UINT_MAX (INT_MAX * 2U + 1U) +#undef LONG_MIN +#undef LONG_MAX +#undef ULONG_MAX +#define LONG_MIN (-1L - LONG_MAX) +#define LONG_MAX ((__LONG_MAX__) + 0L) +#define ULONG_MAX (LONG_MAX * 2UL + 1UL) +#undef CHAR_MIN +#undef CHAR_MAX +#if defined(__CHAR_UNSIGNED__) || defined(_CHAR_UNSIGNED) +#define CHAR_MIN 0 +#define CHAR_MAX UCHAR_MAX +#else +#define CHAR_MIN SCHAR_MIN +#define CHAR_MAX SCHAR_MAX +#endif +#endif +#else +# include +#endif +#if 0 +#define ACC_0xffffL 0xfffful +#define ACC_0xffffffffL 0xfffffffful +#else +#define ACC_0xffffL 65535ul +#define ACC_0xffffffffL 4294967295ul +#endif +#if (ACC_0xffffL == ACC_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if (UINT_MAX == ACC_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED +#endif +#if (UINT_MAX == ACC_0xffffL) +# undef __ACC_RENAME_A +# undef __ACC_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __ACC_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __ACC_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __ACC_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __ACC_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __ACC_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__ACC_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__ACC_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __ACC_RENAME_A +# undef __ACC_RENAME_B +#endif +#if (UINT_MAX == ACC_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define ACC_BROKEN_INTEGRAL_PROMOTION 1 +# define ACC_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 +# define ACC_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define ACC_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define ACC_BROKEN_CDECL_ALT_SYNTAX 1 +# define ACC_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define ACC_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define ACC_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define ACC_PP_STRINGIZE(x) #x +#define ACC_PP_MACRO_EXPAND(x) ACC_PP_STRINGIZE(x) +#define ACC_PP_CONCAT2(a,b) a ## b +#define ACC_PP_CONCAT3(a,b,c) a ## b ## c +#define ACC_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define ACC_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define ACC_PP_ECONCAT2(a,b) ACC_PP_CONCAT2(a,b) +#define ACC_PP_ECONCAT3(a,b,c) ACC_PP_CONCAT3(a,b,c) +#define ACC_PP_ECONCAT4(a,b,c,d) ACC_PP_CONCAT4(a,b,c,d) +#define ACC_PP_ECONCAT5(a,b,c,d,e) ACC_PP_CONCAT5(a,b,c,d,e) +#if 1 +#define ACC_CPP_STRINGIZE(x) #x +#define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x) +#define ACC_CPP_CONCAT2(a,b) a ## b +#define ACC_CPP_CONCAT3(a,b,c) a ## b ## c +#define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b) +#define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c) +#define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d) +#define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e) +#endif +#define __ACC_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define ACC_EXTERN_C extern "C" +#else +# define ACC_EXTERN_C extern +#endif +#if !defined(__ACC_OS_OVERRIDE) +#if defined(ACC_OS_FREESTANDING) +# define ACC_INFO_OS "freestanding" +#elif defined(ACC_OS_EMBEDDED) +# define ACC_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define ACC_OS_EMBEDDED 1 +# define ACC_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define ACC_OS_CYGWIN 1 +# define ACC_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define ACC_OS_EMX 1 +# define ACC_INFO_OS "emx" +#elif defined(__BEOS__) +# define ACC_OS_BEOS 1 +# define ACC_INFO_OS "beos" +#elif defined(__Lynx__) +# define ACC_OS_LYNXOS 1 +# define ACC_INFO_OS "lynxos" +#elif defined(__OS400__) +# define ACC_OS_OS400 1 +# define ACC_INFO_OS "os400" +#elif defined(__QNX__) +# define ACC_OS_QNX 1 +# define ACC_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define ACC_OS_DOS32 1 +# define ACC_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define ACC_OS_DOS16 1 +# define ACC_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define ACC_OS_DOS32 1 +# define ACC_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == ACC_0xffffL) +# define ACC_OS_OS216 1 +# define ACC_INFO_OS "os216" +# elif (UINT_MAX == ACC_0xffffffffL) +# define ACC_OS_OS2 1 +# define ACC_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define ACC_OS_WIN64 1 +# define ACC_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define ACC_OS_WIN32 1 +# define ACC_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define ACC_OS_WIN32 1 +# define ACC_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == ACC_0xffffL) +# define ACC_OS_WIN16 1 +# define ACC_INFO_OS "win16" +# elif (UINT_MAX == ACC_0xffffffffL) +# define ACC_OS_WIN32 1 +# define ACC_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == ACC_0xffffL) +# define ACC_OS_DOS16 1 +# define ACC_INFO_OS "dos16" +# elif (UINT_MAX == ACC_0xffffffffL) +# define ACC_OS_DOS32 1 +# define ACC_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == ACC_0xffffL) +# define ACC_OS_DOS16 1 +# define ACC_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define ACC_OS_WIN32 1 +# define ACC_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define ACC_OS_POSIX 1 +# define ACC_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define ACC_OS_PALMOS 1 +# define ACC_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define ACC_OS_TOS 1 +# define ACC_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define ACC_OS_MACCLASSIC 1 +# define ACC_INFO_OS "macclassic" +#elif defined(__VMS) +# define ACC_OS_VMS 1 +# define ACC_INFO_OS "vms" +#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define ACC_OS_CONSOLE 1 +# define ACC_OS_CONSOLE_PS2 1 +# define ACC_INFO_OS "console" +# define ACC_INFO_OS_CONSOLE "ps2" +#elif (defined(__mips__) && defined(__psp__)) +# define ACC_OS_CONSOLE 1 +# define ACC_OS_CONSOLE_PSP 1 +# define ACC_INFO_OS "console" +# define ACC_INFO_OS_CONSOLE "psp" +#else +# define ACC_OS_POSIX 1 +# define ACC_INFO_OS "posix" +#endif +#if (ACC_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define ACC_OS_POSIX_AIX 1 +# define ACC_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define ACC_OS_POSIX_FREEBSD 1 +# define ACC_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define ACC_OS_POSIX_HPUX 1 +# define ACC_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define ACC_OS_POSIX_INTERIX 1 +# define ACC_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define ACC_OS_POSIX_IRIX 1 +# define ACC_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define ACC_OS_POSIX_LINUX 1 +# define ACC_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) || defined(__MACOS__) +# define ACC_OS_POSIX_MACOSX 1 +# define ACC_INFO_OS_POSIX "macosx" +# elif defined(__minix__) || defined(__minix) +# define ACC_OS_POSIX_MINIX 1 +# define ACC_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define ACC_OS_POSIX_NETBSD 1 +# define ACC_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define ACC_OS_POSIX_OPENBSD 1 +# define ACC_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define ACC_OS_POSIX_OSF 1 +# define ACC_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define ACC_OS_POSIX_SOLARIS 1 +# define ACC_INFO_OS_POSIX "solaris" +# else +# define ACC_OS_POSIX_SUNOS 1 +# define ACC_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define ACC_OS_POSIX_ULTRIX 1 +# define ACC_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define ACC_OS_POSIX_UNICOS 1 +# define ACC_INFO_OS_POSIX "unicos" +# else +# define ACC_OS_POSIX_UNKNOWN 1 +# define ACC_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16) +# if (UINT_MAX != ACC_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != ACC_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32 || ACC_OS_WIN64) +# if (UINT_MAX != ACC_0xffffffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != ACC_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define ACC_CC_CILLY 1 +# define ACC_INFO_CC "Cilly" +# if defined(__CILLY__) +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CILLY__) +# else +# define ACC_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define ACC_CC_SDCC 1 +# define ACC_INFO_CC "sdcc" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define ACC_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) +# define ACC_INFO_CC "Pathscale C" +# define ACC_INFO_CCVER __PATHSCALE__ +#elif defined(__INTEL_COMPILER) +# define ACC_CC_INTELC 1 +# define ACC_INFO_CC "Intel C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN64) +# define ACC_CC_SYNTAX_MSC 1 +# else +# define ACC_CC_SYNTAX_GNUC 1 +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define ACC_CC_PELLESC 1 +# define ACC_INFO_CC "Pelles C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__POCC__) +#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# else +# define ACC_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# endif +# define ACC_INFO_CC "llvm-gcc" +# define ACC_INFO_CCVER __VERSION__ +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# elif defined(__GNUC_MINOR__) +# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# else +# define ACC_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define ACC_INFO_CC "gcc" +# define ACC_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define ACC_CC_ACK 1 +# define ACC_INFO_CC "Amsterdam Compiler Kit C" +# define ACC_INFO_CCVER "unknown" +#elif defined(__AZTEC_C__) +# define ACC_CC_AZTECC 1 +# define ACC_INFO_CC "Aztec C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__BORLANDC__) +# define ACC_CC_BORLANDC 1 +# define ACC_INFO_CC "Borland C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define ACC_CC_CRAYC 1 +# define ACC_INFO_CC "Cray C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define ACC_CC_DMC 1 +# define ACC_INFO_CC "Digital Mars C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define ACC_CC_DECC 1 +# define ACC_INFO_CC "DEC C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DECC) +#elif defined(__HIGHC__) +# define ACC_CC_HIGHC 1 +# define ACC_INFO_CC "MetaWare High C" +# define ACC_INFO_CCVER "unknown" +#elif defined(__IAR_SYSTEMS_ICC__) +# define ACC_CC_IARC 1 +# define ACC_INFO_CC "IAR C" +# if defined(__VER__) +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__VER__) +# else +# define ACC_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) +# define ACC_CC_IBMC 1 +# define ACC_INFO_CC "IBM C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__KEIL__) && defined(__C166__) +# define ACC_CC_KEILC 1 +# define ACC_INFO_CC "Keil C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define ACC_CC_LCCWIN32 1 +# define ACC_INFO_CC "lcc-win32" +# define ACC_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define ACC_CC_LCC 1 +# define ACC_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define ACC_INFO_CCVER "unknown" +# endif +#elif defined(_MSC_VER) +# define ACC_CC_MSC 1 +# define ACC_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER) "." ACC_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER) +# endif +#elif defined(__MWERKS__) +# define ACC_CC_MWERKS 1 +# define ACC_INFO_CC "Metrowerks C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define ACC_CC_NDPC 1 +# define ACC_INFO_CC "Microway NDP C" +# define ACC_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define ACC_CC_PACIFICC 1 +# define ACC_INFO_CC "Pacific C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define ACC_CC_PGI 1 +# define ACC_INFO_CC "Portland Group PGI C" +# define ACC_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define ACC_CC_PUREC 1 +# define ACC_INFO_CC "Pure C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define ACC_CC_SYMANTECC 1 +# define ACC_INFO_CC "Symantec C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define ACC_INFO_CC "SunPro C" +# if ((__SUNPRO_C)+0 > 0) +# define ACC_CC_SUNPROC __SUNPRO_C +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define ACC_CC_SUNPROC 1 +# define ACC_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define ACC_INFO_CC "SunPro C" +# if ((__SUNPRO_CC)+0 > 0) +# define ACC_CC_SUNPROC __SUNPRO_CC +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define ACC_CC_SUNPROC 1 +# define ACC_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define ACC_CC_TINYC 1 +# define ACC_INFO_CC "Tiny C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define ACC_CC_TOPSPEEDC 1 +# define ACC_INFO_CC "TopSpeed C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define ACC_CC_WATCOMC 1 +# define ACC_INFO_CC "Watcom C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define ACC_CC_TURBOC 1 +# define ACC_INFO_CC "Turbo C" +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define ACC_CC_ZORTECHC 1 +# define ACC_INFO_CC "Zortech C" +# if (__ZTC__ == 0x310) +# define ACC_INFO_CCVER "0x310" +# else +# define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__ZTC__) +# endif +#else +# define ACC_CC_UNKNOWN 1 +# define ACC_INFO_CC "unknown" +# define ACC_INFO_CCVER "unknown" +#endif +#if 0 && (ACC_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "ACC_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__ACC_ARCH_OVERRIDE) && !defined(ACC_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > ACC_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define ACC_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define ACC_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__ACC_ARCH_OVERRIDE) +#if defined(ACC_ARCH_GENERIC) +# define ACC_INFO_ARCH "generic" +#elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16) +# define ACC_ARCH_I086 1 +# define ACC_ARCH_IA16 1 +# define ACC_INFO_ARCH "i086" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define ACC_ARCH_ALPHA 1 +# define ACC_INFO_ARCH "alpha" +#elif (ACC_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define ACC_ARCH_ALPHA 1 +# define ACC_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define ACC_ARCH_AMD64 1 +# define ACC_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define ACC_ARCH_ARM 1 +# define ACC_ARCH_ARM_THUMB 1 +# define ACC_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define ACC_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) +# define ACC_ARCH_ARM_THUMB 1 +# define ACC_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) +# define ACC_INFO_ARCH "arm" +# else +# define ACC_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define ACC_ARCH_ARM 1 +# define ACC_INFO_ARCH "arm" +#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__) +# define ACC_ARCH_AVR 1 +# define ACC_INFO_ARCH "avr" +#elif defined(__bfin__) +# define ACC_ARCH_BLACKFIN 1 +# define ACC_INFO_ARCH "blackfin" +#elif (UINT_MAX == ACC_0xffffL) && defined(__C166__) +# define ACC_ARCH_C166 1 +# define ACC_INFO_ARCH "c166" +#elif defined(__cris__) +# define ACC_ARCH_CRIS 1 +# define ACC_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define ACC_ARCH_EZ80 1 +# define ACC_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define ACC_ARCH_H8300 1 +# define ACC_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define ACC_ARCH_HPPA 1 +# define ACC_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define ACC_ARCH_I386 1 +# define ACC_ARCH_IA32 1 +# define ACC_INFO_ARCH "i386" +#elif (ACC_CC_ZORTECHC && defined(__I86__)) +# define ACC_ARCH_I386 1 +# define ACC_ARCH_IA32 1 +# define ACC_INFO_ARCH "i386" +#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) && defined(_I386) +# define ACC_ARCH_I386 1 +# define ACC_ARCH_IA32 1 +# define ACC_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define ACC_ARCH_IA64 1 +# define ACC_INFO_ARCH "ia64" +#elif (UINT_MAX == ACC_0xffffL) && defined(__m32c__) +# define ACC_ARCH_M16C 1 +# define ACC_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define ACC_ARCH_M16C 1 +# define ACC_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define ACC_ARCH_M32R 1 +# define ACC_INFO_ARCH "m32r" +#elif (ACC_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define ACC_ARCH_M68K 1 +# define ACC_INFO_ARCH "m68k" +#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__) +# define ACC_ARCH_MCS251 1 +# define ACC_INFO_ARCH "mcs251" +#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__) +# define ACC_ARCH_MCS51 1 +# define ACC_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define ACC_ARCH_MCS51 1 +# define ACC_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define ACC_ARCH_MIPS 1 +# define ACC_INFO_ARCH "mips" +#elif (UINT_MAX == ACC_0xffffL) && defined(__MSP430__) +# define ACC_ARCH_MSP430 1 +# define ACC_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define ACC_ARCH_MSP430 1 +# define ACC_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define ACC_ARCH_POWERPC 1 +# define ACC_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define ACC_ARCH_S390 1 +# define ACC_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define ACC_ARCH_SH 1 +# define ACC_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define ACC_ARCH_SPARC 1 +# define ACC_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define ACC_ARCH_SPU 1 +# define ACC_INFO_ARCH "spu" +#elif (UINT_MAX == ACC_0xffffL) && defined(__z80) +# define ACC_ARCH_Z80 1 +# define ACC_INFO_ARCH "z80" +#elif (ACC_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define ACC_ARCH_CRAY_SV1 1 +# define ACC_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define ACC_ARCH_CRAY_T90 1 +# define ACC_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define ACC_ARCH_CRAY_YMP 1 +# define ACC_INFO_ARCH "cray_ymp" +# else +# define ACC_ARCH_CRAY_XMP 1 +# define ACC_INFO_ARCH "cray_xmp" +# endif +#else +# define ACC_ARCH_UNKNOWN 1 +# define ACC_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_DOS32 || ACC_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN32) +# error "FIXME - missing WIN32 define for CPU architecture" +#endif +#if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN64) +# error "FIXME - missing WIN64 define for CPU architecture" +#endif +#if (ACC_OS_OS216 || ACC_OS_WIN16) +# define ACC_ARCH_I086PM 1 +# define ACC_ARCH_IA16PM 1 +#elif 1 && (ACC_OS_DOS16 && defined(BLX286)) +# define ACC_ARCH_I086PM 1 +# define ACC_ARCH_IA16PM 1 +#elif 1 && (ACC_OS_DOS16 && defined(DOSX286)) +# define ACC_ARCH_I086PM 1 +# define ACC_ARCH_IA16PM 1 +#elif 1 && (ACC_OS_DOS16 && ACC_CC_BORLANDC && defined(__DPMI16__)) +# define ACC_ARCH_I086PM 1 +# define ACC_ARCH_IA16PM 1 +#endif +#if defined(ACC_ARCH_ARM_THUMB) && !defined(ACC_ARCH_ARM) +# error "this should not happen" +#endif +#if defined(ACC_ARCH_I086PM) && !defined(ACC_ARCH_I086) +# error "this should not happen" +#endif +#if (ACC_ARCH_I086) +# if (UINT_MAX != ACC_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != ACC_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (ACC_ARCH_I386) +# if (UINT_MAX != ACC_0xffffL) && defined(__i386_int16__) +# error "this should not happen" +# endif +# if (UINT_MAX != ACC_0xffffffffL) && !defined(__i386_int16__) +# error "this should not happen" +# endif +# if (ULONG_MAX != ACC_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if !defined(__ACC_MM_OVERRIDE) +#if (ACC_ARCH_I086) +#if (UINT_MAX != ACC_0xffffL) +# error "this should not happen" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define ACC_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define ACC_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define ACC_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define ACC_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define ACC_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define ACC_MM_LARGE 1 +#elif (ACC_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define ACC_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define ACC_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define ACC_MM_COMPACT 1 +# else +# define ACC_MM_SMALL 1 +# endif +#elif (ACC_CC_ZORTECHC && defined(__VCM__)) +# define ACC_MM_LARGE 1 +#else +# error "unknown memory model" +#endif +#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16) +#define ACC_HAVE_MM_HUGE_PTR 1 +#define ACC_HAVE_MM_HUGE_ARRAY 1 +#if (ACC_MM_TINY) +# undef ACC_HAVE_MM_HUGE_ARRAY +#endif +#if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC) +# undef ACC_HAVE_MM_HUGE_PTR +# undef ACC_HAVE_MM_HUGE_ARRAY +#elif (ACC_CC_DMC || ACC_CC_SYMANTECC) +# undef ACC_HAVE_MM_HUGE_ARRAY +#elif (ACC_CC_MSC && defined(_QC)) +# undef ACC_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef ACC_HAVE_MM_HUGE_PTR +# endif +#elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef ACC_HAVE_MM_HUGE_ARRAY +#endif +#if (ACC_ARCH_I086PM) && !defined(ACC_HAVE_MM_HUGE_PTR) +# if (ACC_OS_DOS16) +# error "this should not happen" +# elif (ACC_CC_ZORTECHC) +# else +# error "this should not happen" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16) +# define ACC_MM_AHSHIFT 12 +#elif (ACC_CC_WATCOMC) + extern unsigned char _HShift; +# define ACC_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement ACC_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (ACC_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define ACC_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define ACC_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define ACC_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define ACC_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define ACC_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define ACC_MM_XSMALL 1 +#else +# error "FIXME - C166 __MODEL__" +#endif +#elif (ACC_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define ACC_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define ACC_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define ACC_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define ACC_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define ACC_MM_XSMALL 1 +#else +# error "FIXME - MCS251 __MODEL__" +#endif +#elif (ACC_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define ACC_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define ACC_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define ACC_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define ACC_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define ACC_MM_XSMALL 1 +#else +# error "FIXME - MCS51 __MODEL__" +#endif +#elif (ACC_ARCH_CRAY_PVP) +# define ACC_MM_PVP 1 +#else +# define ACC_MM_FLAT 1 +#endif +#if (ACC_MM_COMPACT) +# define ACC_INFO_MM "compact" +#elif (ACC_MM_FLAT) +# define ACC_INFO_MM "flat" +#elif (ACC_MM_HUGE) +# define ACC_INFO_MM "huge" +#elif (ACC_MM_LARGE) +# define ACC_INFO_MM "large" +#elif (ACC_MM_MEDIUM) +# define ACC_INFO_MM "medium" +#elif (ACC_MM_PVP) +# define ACC_INFO_MM "pvp" +#elif (ACC_MM_SMALL) +# define ACC_INFO_MM "small" +#elif (ACC_MM_TINY) +# define ACC_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if defined(SIZEOF_SHORT) +# define ACC_SIZEOF_SHORT (SIZEOF_SHORT) +#endif +#if defined(SIZEOF_INT) +# define ACC_SIZEOF_INT (SIZEOF_INT) +#endif +#if defined(SIZEOF_LONG) +# define ACC_SIZEOF_LONG (SIZEOF_LONG) +#endif +#if defined(SIZEOF_LONG_LONG) +# define ACC_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#endif +#if defined(SIZEOF___INT16) +# define ACC_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#if defined(SIZEOF___INT32) +# define ACC_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#if defined(SIZEOF___INT64) +# define ACC_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#if defined(SIZEOF_VOID_P) +# define ACC_SIZEOF_VOID_P (SIZEOF_VOID_P) +#endif +#if defined(SIZEOF_SIZE_T) +# define ACC_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#endif +#if defined(SIZEOF_PTRDIFF_T) +# define ACC_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#endif +#define __ACC_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(ACC_SIZEOF_SHORT) +# if (ACC_ARCH_CRAY_PVP) +# define ACC_SIZEOF_SHORT 8 +# elif (USHRT_MAX == ACC_0xffffL) +# define ACC_SIZEOF_SHORT 2 +# elif (__ACC_LSR(USHRT_MAX,7) == 1) +# define ACC_SIZEOF_SHORT 1 +# elif (__ACC_LSR(USHRT_MAX,15) == 1) +# define ACC_SIZEOF_SHORT 2 +# elif (__ACC_LSR(USHRT_MAX,31) == 1) +# define ACC_SIZEOF_SHORT 4 +# elif (__ACC_LSR(USHRT_MAX,63) == 1) +# define ACC_SIZEOF_SHORT 8 +# elif (__ACC_LSR(USHRT_MAX,127) == 1) +# define ACC_SIZEOF_SHORT 16 +# else +# error "ACC_SIZEOF_SHORT" +# endif +#endif +#if !defined(ACC_SIZEOF_INT) +# if (ACC_ARCH_CRAY_PVP) +# define ACC_SIZEOF_INT 8 +# elif (UINT_MAX == ACC_0xffffL) +# define ACC_SIZEOF_INT 2 +# elif (UINT_MAX == ACC_0xffffffffL) +# define ACC_SIZEOF_INT 4 +# elif (__ACC_LSR(UINT_MAX,7) == 1) +# define ACC_SIZEOF_INT 1 +# elif (__ACC_LSR(UINT_MAX,15) == 1) +# define ACC_SIZEOF_INT 2 +# elif (__ACC_LSR(UINT_MAX,31) == 1) +# define ACC_SIZEOF_INT 4 +# elif (__ACC_LSR(UINT_MAX,63) == 1) +# define ACC_SIZEOF_INT 8 +# elif (__ACC_LSR(UINT_MAX,127) == 1) +# define ACC_SIZEOF_INT 16 +# else +# error "ACC_SIZEOF_INT" +# endif +#endif +#if !defined(ACC_SIZEOF_LONG) +# if (ULONG_MAX == ACC_0xffffffffL) +# define ACC_SIZEOF_LONG 4 +# elif (__ACC_LSR(ULONG_MAX,7) == 1) +# define ACC_SIZEOF_LONG 1 +# elif (__ACC_LSR(ULONG_MAX,15) == 1) +# define ACC_SIZEOF_LONG 2 +# elif (__ACC_LSR(ULONG_MAX,31) == 1) +# define ACC_SIZEOF_LONG 4 +# elif (__ACC_LSR(ULONG_MAX,63) == 1) +# define ACC_SIZEOF_LONG 8 +# elif (__ACC_LSR(ULONG_MAX,127) == 1) +# define ACC_SIZEOF_LONG 16 +# else +# error "ACC_SIZEOF_LONG" +# endif +#endif +#if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64) +#if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (ACC_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# define ACC_SIZEOF_LONG_LONG ACC_SIZEOF_LONG +# elif (__ACC_LSR(__LONG_LONG_MAX__,30) == 1) +# define ACC_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64) +#if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8) +#if (ACC_ARCH_I086 && ACC_CC_DMC) +#elif (ACC_CC_CILLY) && defined(__GNUC__) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define ACC_SIZEOF_LONG_LONG 8 +#elif ((ACC_OS_WIN32 || ACC_OS_WIN64 || defined(_WIN32)) && ACC_CC_MSC && (_MSC_VER >= 1400)) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_OS_WIN64 || defined(_WIN64)) +# define ACC_SIZEOF___INT64 8 +#elif (ACC_ARCH_I386 && (ACC_CC_DMC)) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_ARCH_I386 && (ACC_CC_SYMANTECC && (__SC__ >= 0x700))) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_ARCH_I386 && (ACC_CC_INTELC && defined(__linux__))) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_ARCH_I386 && (ACC_CC_MWERKS || ACC_CC_PELLESC || ACC_CC_PGI || ACC_CC_SUNPROC)) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_ARCH_I386 && (ACC_CC_INTELC || ACC_CC_MSC)) +# define ACC_SIZEOF___INT64 8 +#elif ((ACC_OS_WIN32 || defined(_WIN32)) && (ACC_CC_MSC)) +# define ACC_SIZEOF___INT64 8 +#elif (ACC_ARCH_I386 && (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define ACC_SIZEOF___INT64 8 +#elif (ACC_ARCH_I386 && (ACC_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define ACC_SIZEOF___INT64 8 +#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +# define ACC_SIZEOF___INT64 8 +#elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define ACC_SIZEOF_LONG_LONG 8 +#elif (ACC_CC_SDCC) && (ACC_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define ACC_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && defined(ACC_CC_GNUC) +# if (ACC_CC_GNUC < 0x020800ul) +# undef ACC_SIZEOF_LONG_LONG +# endif +#endif +#if defined(ACC_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +# undef ACC_SIZEOF_LONG_LONG +#endif +#if !defined(ACC_SIZEOF_VOID_P) +#if (ACC_ARCH_I086) +# define __ACC_WORDSIZE 2 +# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM) +# define ACC_SIZEOF_VOID_P 2 +# elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE) +# define ACC_SIZEOF_VOID_P 4 +# else +# error "ACC_MM" +# endif +#elif (ACC_ARCH_AVR || ACC_ARCH_Z80) +# define __ACC_WORDSIZE 1 +# define ACC_SIZEOF_VOID_P 2 +#elif (ACC_ARCH_C166 || ACC_ARCH_MCS51 || ACC_ARCH_MCS251 || ACC_ARCH_MSP430) +# define ACC_SIZEOF_VOID_P 2 +#elif (ACC_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define __ACC_WORDSIZE 4 +# define ACC_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define __ACC_WORDSIZE 4 +# define ACC_SIZEOF_VOID_P 4 +# else +# define __ACC_WORDSIZE 2 +# define ACC_SIZEOF_VOID_P 2 +# endif +# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x040000ul)) && (ACC_SIZEOF_INT == 4) +# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_INT +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_INT +# endif +#elif (ACC_ARCH_M16C) +# define __ACC_WORDSIZE 2 +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define ACC_SIZEOF_VOID_P 4 +# else +# define ACC_SIZEOF_VOID_P 2 +# endif +#elif (ACC_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define __ACC_WORDSIZE 8 +# define ACC_SIZEOF_VOID_P 4 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +# define __ACC_WORDSIZE 8 +# define ACC_SIZEOF_VOID_P 8 +#elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG +# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG +#elif (ACC_OS_OS400 || defined(__OS400__)) +# define __ACC_WORDSIZE ACC_SIZEOF_LONG +# define ACC_SIZEOF_VOID_P 16 +# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define ACC_SIZEOF_VOID_P 8 +# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG +#elif (ACC_ARCH_SPU) +# if 0 +# define __ACC_WORDSIZE 16 +# endif +# define ACC_SIZEOF_VOID_P 4 +#else +# define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG +#endif +#endif +#if !defined(ACC_WORDSIZE) +# if defined(__ACC_WORDSIZE) +# define ACC_WORDSIZE __ACC_WORDSIZE +# else +# define ACC_WORDSIZE ACC_SIZEOF_VOID_P +# endif +#endif +#if !defined(ACC_SIZEOF_SIZE_T) +#if (ACC_ARCH_I086 || ACC_ARCH_M16C) +# define ACC_SIZEOF_SIZE_T 2 +#else +# define ACC_SIZEOF_SIZE_T ACC_SIZEOF_VOID_P +#endif +#endif +#if !defined(ACC_SIZEOF_PTRDIFF_T) +#if (ACC_ARCH_I086) +# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM || ACC_MM_HUGE) +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_VOID_P +# elif (ACC_MM_COMPACT || ACC_MM_LARGE) +# if (ACC_CC_BORLANDC || ACC_CC_TURBOC) +# define ACC_SIZEOF_PTRDIFF_T 4 +# else +# define ACC_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "ACC_MM" +# endif +#else +# define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_SIZE_T +#endif +#endif +#if defined(ACC_ABI_NEUTRAL_ENDIAN) +# undef ACC_ABI_BIG_ENDIAN +# undef ACC_ABI_LITTLE_ENDIAN +#elif !defined(ACC_ABI_BIG_ENDIAN) && !defined(ACC_ABI_LITTLE_ENDIAN) +#if (ACC_ARCH_ALPHA) && (ACC_ARCH_CRAY_MPP) +# define ACC_ABI_BIG_ENDIAN 1 +#elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430) +# define ACC_ABI_LITTLE_ENDIAN 1 +#elif (ACC_ARCH_M68K || ACC_ARCH_S390) +# define ACC_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define ACC_ABI_LITTLE_ENDIAN 1 +# else +# define ACC_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define ACC_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define ACC_ABI_LITTLE_ENDIAN 1 +#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define ACC_ABI_BIG_ENDIAN 1 +#elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define ACC_ABI_LITTLE_ENDIAN 1 +#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define ACC_ABI_BIG_ENDIAN 1 +#elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define ACC_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if defined(ACC_ABI_BIG_ENDIAN) && defined(ACC_ABI_LITTLE_ENDIAN) +# error "this should not happen" +#endif +#if defined(ACC_ABI_BIG_ENDIAN) +# define ACC_INFO_ABI_ENDIAN "be" +#elif defined(ACC_ABI_LITTLE_ENDIAN) +# define ACC_INFO_ABI_ENDIAN "le" +#elif defined(ACC_ABI_NEUTRAL_ENDIAN) +# define ACC_INFO_ABI_ENDIAN "neutral" +#endif +#if (ACC_SIZEOF_INT == 1 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2) +# define ACC_ABI_I8LP16 1 +# define ACC_INFO_ABI_PM "i8lp16" +#elif (ACC_SIZEOF_INT == 2 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2) +# define ACC_ABI_ILP16 1 +# define ACC_INFO_ABI_PM "ilp16" +#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 4) +# define ACC_ABI_ILP32 1 +# define ACC_INFO_ABI_PM "ilp32" +#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 8 && ACC_SIZEOF_SIZE_T == 8) +# define ACC_ABI_LLP64 1 +# define ACC_INFO_ABI_PM "llp64" +#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8) +# define ACC_ABI_LP64 1 +# define ACC_INFO_ABI_PM "lp64" +#elif (ACC_SIZEOF_INT == 8 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8) +# define ACC_ABI_ILP64 1 +# define ACC_INFO_ABI_PM "ilp64" +#elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 4) +# define ACC_ABI_IP32L64 1 +# define ACC_INFO_ABI_PM "ip32l64" +#endif +#if !defined(__ACC_LIBC_OVERRIDE) +#if defined(ACC_LIBC_NAKED) +# define ACC_INFO_LIBC "naked" +#elif defined(ACC_LIBC_FREESTANDING) +# define ACC_INFO_LIBC "freestanding" +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +# define ACC_INFO_LIBC "mfreestanding" +#elif defined(ACC_LIBC_ISOC90) +# define ACC_INFO_LIBC "isoc90" +#elif defined(ACC_LIBC_ISOC99) +# define ACC_INFO_LIBC "isoc99" +#elif defined(__dietlibc__) +# define ACC_LIBC_DIETLIBC 1 +# define ACC_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define ACC_LIBC_NEWLIB 1 +# define ACC_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define ACC_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# else +# define ACC_LIBC_UCLIBC 0x00090bL +# endif +# define ACC_INFO_LIBC "uclibc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define ACC_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define ACC_INFO_LIBC "glibc" +#elif (ACC_CC_MWERKS) && defined(__MSL__) +# define ACC_LIBC_MSL __MSL__ +# define ACC_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define ACC_LIBC_ISOC90 1 +# define ACC_INFO_LIBC "isoc90" +#else +# define ACC_LIBC_DEFAULT 1 +# define ACC_INFO_LIBC "default" +#endif +#endif +#if !defined(__acc_gnuc_extension__) +#if (ACC_CC_GNUC >= 0x020800ul) +# define __acc_gnuc_extension__ __extension__ +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_gnuc_extension__ __extension__ +#else +# define __acc_gnuc_extension__ +#endif +#endif +#if !defined(__acc_ua_volatile) +# define __acc_ua_volatile volatile +#endif +#if !defined(__acc_alignof) +#if (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI) +# define __acc_alignof(e) __alignof__(e) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __acc_alignof(e) __alignof__(e) +#elif (ACC_CC_MSC && (_MSC_VER >= 1300)) +# define __acc_alignof(e) __alignof(e) +#endif +#endif +#if defined(__acc_alignof) +# define __acc_HAVE_alignof 1 +#endif +#if !defined(__acc_constructor) +#if (ACC_CC_GNUC >= 0x030400ul) +# define __acc_constructor __attribute__((__constructor__,__used__)) +#elif (ACC_CC_GNUC >= 0x020700ul) +# define __acc_constructor __attribute__((__constructor__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__acc_constructor) +# define __acc_HAVE_constructor 1 +#endif +#if !defined(__acc_destructor) +#if (ACC_CC_GNUC >= 0x030400ul) +# define __acc_destructor __attribute__((__destructor__,__used__)) +#elif (ACC_CC_GNUC >= 0x020700ul) +# define __acc_destructor __attribute__((__destructor__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__acc_destructor) +# define __acc_HAVE_destructor 1 +#endif +#if defined(__acc_HAVE_destructor) && !defined(__acc_HAVE_constructor) +# error "this should not happen" +#endif +#if !defined(__acc_inline) +#if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __acc_inline inline +#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __acc_inline __inline +#elif (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI) +# define __acc_inline __inline__ +#elif (ACC_CC_DMC) +# define __acc_inline __inline +#elif (ACC_CC_INTELC) +# define __acc_inline __inline +#elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __acc_inline __inline +#elif (ACC_CC_MSC && (_MSC_VER >= 900)) +# define __acc_inline __inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define __acc_inline inline +#endif +#endif +#if defined(__acc_inline) +# define __acc_HAVE_inline 1 +#else +# define __acc_inline +#endif +#if !defined(__acc_forceinline) +#if (ACC_CC_GNUC >= 0x030200ul) +# define __acc_forceinline __inline__ __attribute__((__always_inline__)) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) +# define __acc_forceinline __forceinline +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC) +# define __acc_forceinline __inline__ __attribute__((__always_inline__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_forceinline __inline__ __attribute__((__always_inline__)) +#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) +# define __acc_forceinline __forceinline +#endif +#endif +#if defined(__acc_forceinline) +# define __acc_HAVE_forceinline 1 +#else +# define __acc_forceinline +#endif +#if !defined(__acc_noinline) +#if 1 && (ACC_ARCH_I386) && (ACC_CC_GNUC >= 0x040000ul) && (ACC_CC_GNUC < 0x040003ul) +# define __acc_noinline __attribute__((__noinline__,__used__)) +#elif (ACC_CC_GNUC >= 0x030200ul) +# define __acc_noinline __attribute__((__noinline__)) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_MSC) +# define __acc_noinline __declspec(noinline) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC) +# define __acc_noinline __attribute__((__noinline__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_noinline __attribute__((__noinline__)) +#elif (ACC_CC_MSC && (_MSC_VER >= 1300)) +# define __acc_noinline __declspec(noinline) +#elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3200) && (ACC_OS_WIN32 || ACC_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __acc_noinline __declspec(noinline) +# endif +#endif +#endif +#if defined(__acc_noinline) +# define __acc_HAVE_noinline 1 +#else +# define __acc_noinline +#endif +#if (defined(__acc_HAVE_forceinline) || defined(__acc_HAVE_noinline)) && !defined(__acc_HAVE_inline) +# error "this should not happen" +#endif +#if !defined(__acc_noreturn) +#if (ACC_CC_GNUC >= 0x020700ul) +# define __acc_noreturn __attribute__((__noreturn__)) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) +# define __acc_noreturn __declspec(noreturn) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC) +# define __acc_noreturn __attribute__((__noreturn__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_noreturn __attribute__((__noreturn__)) +#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) +# define __acc_noreturn __declspec(noreturn) +#endif +#endif +#if defined(__acc_noreturn) +# define __acc_HAVE_noreturn 1 +#else +# define __acc_noreturn +#endif +#if !defined(__acc_nothrow) +#if (ACC_CC_GNUC >= 0x030300ul) +# define __acc_nothrow __attribute__((__nothrow__)) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) && defined(__cplusplus) +# define __acc_nothrow __declspec(nothrow) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC) +# define __acc_nothrow __attribute__((__nothrow__)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_nothrow __attribute__((__nothrow__)) +#elif (ACC_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __acc_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__acc_nothrow) +# define __acc_HAVE_nothrow 1 +#else +# define __acc_nothrow +#endif +#if !defined(__acc_restrict) +#if (ACC_CC_GNUC >= 0x030400ul) +# define __acc_restrict __restrict__ +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC) +# define __acc_restrict __restrict__ +#elif (ACC_CC_LLVM) +# define __acc_restrict __restrict__ +#elif (ACC_CC_MSC && (_MSC_VER >= 1400)) +# define __acc_restrict __restrict +#endif +#endif +#if defined(__acc_restrict) +# define __acc_HAVE_restrict 1 +#else +# define __acc_restrict +#endif +#if !defined(__acc_likely) && !defined(__acc_unlikely) +#if (ACC_CC_GNUC >= 0x030200ul) +# define __acc_likely(e) (__builtin_expect(!!(e),1)) +# define __acc_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __acc_likely(e) (__builtin_expect(!!(e),1)) +# define __acc_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __acc_likely(e) (__builtin_expect(!!(e),1)) +# define __acc_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__acc_likely) +# define __acc_HAVE_likely 1 +#else +# define __acc_likely(e) (e) +#endif +#if defined(__acc_unlikely) +# define __acc_HAVE_unlikely 1 +#else +# define __acc_unlikely(e) (e) +#endif +#if !defined(ACC_UNUSED) +# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define ACC_UNUSED(var) ((void) &var) +# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PELLESC || ACC_CC_TURBOC) +# define ACC_UNUSED(var) if (&var) ; else +# elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define ACC_UNUSED(var) ((void) var) +# elif (ACC_CC_MSC && (_MSC_VER < 900)) +# define ACC_UNUSED(var) if (&var) ; else +# elif (ACC_CC_KEILC) +# define ACC_UNUSED(var) {extern int __acc_unused[1-2*!(sizeof(var)>0)];} +# elif (ACC_CC_PACIFICC) +# define ACC_UNUSED(var) ((void) sizeof(var)) +# elif (ACC_CC_WATCOMC) && defined(__cplusplus) +# define ACC_UNUSED(var) ((void) var) +# else +# define ACC_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(ACC_UNUSED_FUNC) +# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define ACC_UNUSED_FUNC(func) ((void) func) +# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC) +# define ACC_UNUSED_FUNC(func) if (func) ; else +# elif (ACC_CC_LLVM) +# define ACC_UNUSED_FUNC(func) ((void) &func) +# elif (ACC_CC_MSC && (_MSC_VER < 900)) +# define ACC_UNUSED_FUNC(func) if (func) ; else +# elif (ACC_CC_MSC) +# define ACC_UNUSED_FUNC(func) ((void) &func) +# elif (ACC_CC_KEILC || ACC_CC_PELLESC) +# define ACC_UNUSED_FUNC(func) {extern int __acc_unused[1-2*!(sizeof((int)func)>0)];} +# else +# define ACC_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(ACC_UNUSED_LABEL) +# if (ACC_CC_WATCOMC) && defined(__cplusplus) +# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l +# elif (ACC_CC_INTELC || ACC_CC_WATCOMC) +# define ACC_UNUSED_LABEL(l) if (0) goto l +# else +# define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l +# endif +#endif +#if !defined(ACC_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (ACC_CC_GNUC) +# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER) +# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC) +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)]; +# elif (ACC_CC_DMC || ACC_CC_SYMANTECC) +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)]; +# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)]; +# else +# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)]; +# endif +#endif +#if !defined(ACC_COMPILE_TIME_ASSERT) +# if (ACC_CC_AZTECC) +# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];} +# elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) +# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (ACC_CC_MSC && (_MSC_VER < 900)) +# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];} +# endif +#endif +#if (ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) +# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC) +# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) +# define __acc_cdecl __cdecl +# define __acc_cdecl_atexit +# define __acc_cdecl_main __cdecl +# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC)) +# define __acc_cdecl_qsort __pascal +# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC)) +# define __acc_cdecl_qsort _stdcall +# else +# define __acc_cdecl_qsort __cdecl +# endif +# elif (ACC_CC_WATCOMC) +# define __acc_cdecl __cdecl +# else +# define __acc_cdecl __cdecl +# define __acc_cdecl_atexit __cdecl +# define __acc_cdecl_main __cdecl +# define __acc_cdecl_qsort __cdecl +# endif +# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC) +# elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC)) +# define __acc_cdecl_sighandler __pascal +# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC)) +# define __acc_cdecl_sighandler _stdcall +# elif (ACC_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __acc_cdecl_sighandler __clrcall +# elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __acc_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __acc_cdecl_sighandler _far _cdecl +# else +# define __acc_cdecl_sighandler _cdecl +# endif +# else +# define __acc_cdecl_sighandler __cdecl +# endif +#elif (ACC_ARCH_I386) && (ACC_CC_WATCOMC) +# define __acc_cdecl __cdecl +#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) +# define __acc_cdecl cdecl +#endif +#if !defined(__acc_cdecl) +# define __acc_cdecl +#endif +#if !defined(__acc_cdecl_atexit) +# define __acc_cdecl_atexit +#endif +#if !defined(__acc_cdecl_main) +# define __acc_cdecl_main +#endif +#if !defined(__acc_cdecl_qsort) +# define __acc_cdecl_qsort +#endif +#if !defined(__acc_cdecl_sighandler) +# define __acc_cdecl_sighandler +#endif +#if !defined(__acc_cdecl_va) +# define __acc_cdecl_va __acc_cdecl +#endif +#if !defined(ACC_CFG_NO_WINDOWS_H) +#if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64) +# if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) +# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul))) +# else +# define ACC_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#if (ACC_ARCH_ALPHA) +# define ACC_OPT_AVOID_UINT_INDEX 1 +# define ACC_OPT_AVOID_SHORT 1 +# define ACC_OPT_AVOID_USHORT 1 +#elif (ACC_ARCH_AMD64) +# define ACC_OPT_AVOID_INT_INDEX 1 +# define ACC_OPT_AVOID_UINT_INDEX 1 +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +# define ACC_OPT_UNALIGNED64 1 +#elif (ACC_ARCH_ARM && ACC_ARCH_ARM_THUMB) +#elif (ACC_ARCH_ARM) +# define ACC_OPT_AVOID_SHORT 1 +# define ACC_OPT_AVOID_USHORT 1 +#elif (ACC_ARCH_CRIS) +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +#elif (ACC_ARCH_I386) +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +#elif (ACC_ARCH_IA64) +# define ACC_OPT_AVOID_INT_INDEX 1 +# define ACC_OPT_AVOID_UINT_INDEX 1 +# define ACC_OPT_PREFER_POSTINC 1 +#elif (ACC_ARCH_M68K) +# define ACC_OPT_PREFER_POSTINC 1 +# define ACC_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +# endif +#elif (ACC_ARCH_MIPS) +# define ACC_OPT_AVOID_UINT_INDEX 1 +#elif (ACC_ARCH_POWERPC) +# define ACC_OPT_PREFER_PREINC 1 +# define ACC_OPT_PREFER_PREDEC 1 +# if defined(ACC_ABI_BIG_ENDIAN) +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +# endif +#elif (ACC_ARCH_S390) +# define ACC_OPT_UNALIGNED16 1 +# define ACC_OPT_UNALIGNED32 1 +# if (ACC_SIZEOF_SIZE_T == 8) +# define ACC_OPT_UNALIGNED64 1 +# endif +#elif (ACC_ARCH_SH) +# define ACC_OPT_PREFER_POSTINC 1 +# define ACC_OPT_PREFER_PREDEC 1 +#endif +#if !defined(ACC_CFG_NO_INLINE_ASM) +#if defined(ACC_CC_LLVM) +# define ACC_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if !defined(ACC_CFG_NO_UNALIGNED) +#if defined(ACC_ABI_NEUTRAL_ENDIAN) || defined(ACC_ARCH_GENERIC) +# define ACC_CFG_NO_UNALIGNED 1 +#endif +#endif +#if defined(ACC_CFG_NO_UNALIGNED) +# undef ACC_OPT_UNALIGNED16 +# undef ACC_OPT_UNALIGNED32 +# undef ACC_OPT_UNALIGNED64 +#endif +#if defined(ACC_CFG_NO_INLINE_ASM) +#elif (ACC_ARCH_I386 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)) +# define ACC_ASM_SYNTAX_MSC 1 +#elif (ACC_OS_WIN64 && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)) +#elif (ACC_ARCH_I386 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)) +# define ACC_ASM_SYNTAX_GNUC 1 +#elif (ACC_ARCH_AMD64 && (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)) +# define ACC_ASM_SYNTAX_GNUC 1 +#endif +#if (ACC_ASM_SYNTAX_GNUC) +#if (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul)) +# define __ACC_ASM_CLOBBER "ax" +#elif (ACC_CC_INTELC) +# define __ACC_ASM_CLOBBER "memory" +#else +# define __ACC_ASM_CLOBBER "cc", "memory" +#endif +#endif +#if defined(__ACC_INFOSTR_MM) +#elif (ACC_MM_FLAT) && (defined(__ACC_INFOSTR_PM) || defined(ACC_INFO_ABI_PM)) +# define __ACC_INFOSTR_MM "" +#elif defined(ACC_INFO_MM) +# define __ACC_INFOSTR_MM "." ACC_INFO_MM +#else +# define __ACC_INFOSTR_MM "" +#endif +#if defined(__ACC_INFOSTR_PM) +#elif defined(ACC_INFO_ABI_PM) +# define __ACC_INFOSTR_PM "." ACC_INFO_ABI_PM +#else +# define __ACC_INFOSTR_PM "" +#endif +#if defined(__ACC_INFOSTR_ENDIAN) +#elif defined(ACC_INFO_ABI_ENDIAN) +# define __ACC_INFOSTR_ENDIAN "." ACC_INFO_ABI_ENDIAN +#else +# define __ACC_INFOSTR_ENDIAN "" +#endif +#if defined(__ACC_INFOSTR_OSNAME) +#elif defined(ACC_INFO_OS_CONSOLE) +# define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_CONSOLE +#elif defined(ACC_INFO_OS_POSIX) +# define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_POSIX +#else +# define __ACC_INFOSTR_OSNAME ACC_INFO_OS +#endif +#if defined(__ACC_INFOSTR_LIBC) +#elif defined(ACC_INFO_LIBC) +# define __ACC_INFOSTR_LIBC "." ACC_INFO_LIBC +#else +# define __ACC_INFOSTR_LIBC "" +#endif +#if defined(__ACC_INFOSTR_CCVER) +#elif defined(ACC_INFO_CCVER) +# define __ACC_INFOSTR_CCVER " " ACC_INFO_CCVER +#else +# define __ACC_INFOSTR_CCVER "" +#endif +#define ACC_INFO_STRING \ + ACC_INFO_ARCH __ACC_INFOSTR_MM __ACC_INFOSTR_PM __ACC_INFOSTR_ENDIAN \ + " " __ACC_INFOSTR_OSNAME __ACC_INFOSTR_LIBC " " ACC_INFO_CC __ACC_INFOSTR_CCVER +#if defined(ACC_CFG_NO_CONFIG_HEADER) +#elif defined(ACC_CFG_CONFIG_HEADER) +#else +#if !defined(ACC_CFG_AUTO_NO_HEADERS) +#if defined(ACC_LIBC_NAKED) +#elif defined(ACC_LIBC_FREESTANDING) +# define HAVE_LIMITS_H 1 +# define HAVE_STDARG_H 1 +# define HAVE_STDDEF_H 1 +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +# define HAVE_LIMITS_H 1 +# define HAVE_SETJMP_H 1 +# define HAVE_STDARG_H 1 +# define HAVE_STDDEF_H 1 +# define HAVE_STDIO_H 1 +# define HAVE_STRING_H 1 +#else +#define STDC_HEADERS 1 +#define HAVE_ASSERT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_DIRENT_H 1 +#define HAVE_ERRNO_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SETJMP_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_TIME_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_UTIME_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#if (ACC_OS_POSIX) +# if (ACC_OS_POSIX_AIX) +# define HAVE_SYS_RESOURCE_H 1 +# elif (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD) +# define HAVE_STRINGS_H 1 +# undef HAVE_MALLOC_H +# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX) +# define HAVE_ALLOCA_H 1 +# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL) +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +# elif (ACC_OS_POSIX_SOLARIS || ACC_OS_POSIX_SUNOS) +# define HAVE_ALLOCA_H 1 +# endif +# if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC) +# define HAVE_STRINGS_H 1 +# define HAVE_SYS_MMAN_H 1 +# define HAVE_SYS_RESOURCE_H 1 +# define HAVE_SYS_WAIT_H 1 +# endif +# if (ACC_LIBC_NEWLIB) +# undef HAVE_STRINGS_H +# endif +#elif (ACC_OS_CYGWIN) +# define HAVE_IO_H 1 +#elif (ACC_OS_EMX) +# define HAVE_ALLOCA_H 1 +# define HAVE_IO_H 1 +#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) +# if !defined(__MINT__) +# undef HAVE_MALLOC_H +# endif +#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) +# undef HAVE_DIRENT_H +# undef HAVE_FCNTL_H +# undef HAVE_MALLOC_H +# undef HAVE_MEMORY_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_STAT_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +#endif +#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) +#define HAVE_CONIO_H 1 +#define HAVE_DIRECT_H 1 +#define HAVE_DOS_H 1 +#define HAVE_IO_H 1 +#define HAVE_SHARE_H 1 +#if (ACC_CC_AZTECC) +# undef HAVE_CONIO_H +# undef HAVE_DIRECT_H +# undef HAVE_DIRENT_H +# undef HAVE_MALLOC_H +# undef HAVE_SHARE_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_STAT_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +#elif (ACC_CC_BORLANDC) +# undef HAVE_UNISTD_H +# undef HAVE_SYS_TIME_H +# if (ACC_OS_WIN32 || ACC_OS_WIN64) +# undef HAVE_DIRENT_H +# endif +# if (__BORLANDC__ < 0x0400) +# undef HAVE_DIRENT_H +# undef HAVE_UTIME_H +# endif +#elif (ACC_CC_DMC) +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +# define HAVE_SYS_DIRENT_H 1 +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) +# define HAVE_ALLOCA_H 1 +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +#elif (ACC_CC_IBMC && ACC_OS_OS2) +# undef HAVE_DOS_H +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +# define HAVE_SYS_UTIME_H 1 +#elif (ACC_CC_INTELC || ACC_CC_MSC) +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +# define HAVE_SYS_UTIME_H 1 +#elif (ACC_CC_LCCWIN32) +# undef HAVE_DIRENT_H +# undef HAVE_DOS_H +# undef HAVE_UNISTD_H +# undef HAVE_SYS_TIME_H +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__) +# undef HAVE_UTIME_H +# define HAVE_SYS_UTIME_H 1 +#elif (ACC_OS_WIN32 && ACC_LIBC_MSL) +# define HAVE_ALLOCA_H 1 +# undef HAVE_DOS_H +# undef HAVE_SHARE_H +# undef HAVE_SYS_TIME_H +#elif (ACC_CC_NDPC) +# undef HAVE_DIRENT_H +# undef HAVE_DOS_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +#elif (ACC_CC_PACIFICC) +# undef HAVE_DIRECT_H +# undef HAVE_DIRENT_H +# undef HAVE_FCNTL_H +# undef HAVE_IO_H +# undef HAVE_MALLOC_H +# undef HAVE_MEMORY_H +# undef HAVE_SHARE_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_STAT_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +#elif (ACC_OS_WIN32 && ACC_CC_PELLESC) +# undef HAVE_DIRENT_H +# undef HAVE_DOS_H +# undef HAVE_MALLOC_H +# undef HAVE_SHARE_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +# if (__POCC__ < 280) +# else +# define HAVE_SYS_UTIME_H 1 +# endif +#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__) +# undef HAVE_UTIME_H +# define HAVE_SYS_UTIME_H 1 +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) +#elif (ACC_CC_SYMANTECC) +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +# if (__SC__ < 0x700) +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +# endif +#elif (ACC_CC_TOPSPEEDC) +# undef HAVE_DIRENT_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_STAT_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +#elif (ACC_CC_TURBOC) +# undef HAVE_UNISTD_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +# if (ACC_OS_WIN32 || ACC_OS_WIN64) +# undef HAVE_DIRENT_H +# endif +# if (__TURBOC__ < 0x0200) +# undef HAVE_SIGNAL_H +# endif +# if (__TURBOC__ < 0x0400) +# undef HAVE_DIRECT_H +# undef HAVE_DIRENT_H +# undef HAVE_MALLOC_H +# undef HAVE_MEMORY_H +# undef HAVE_UTIME_H +# endif +#elif (ACC_CC_WATCOMC) +# undef HAVE_DIRENT_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +# define HAVE_SYS_UTIME_H 1 +# if (__WATCOMC__ < 950) +# undef HAVE_UNISTD_H +# endif +#elif (ACC_CC_ZORTECHC) +# undef HAVE_DIRENT_H +# undef HAVE_MEMORY_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_TIME_H +#endif +#endif +#if (ACC_OS_CONSOLE) +# undef HAVE_DIRENT_H +#endif +#if (ACC_OS_EMBEDDED) +# undef HAVE_DIRENT_H +#endif +#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99) +# undef HAVE_DIRENT_H +# undef HAVE_FCNTL_H +# undef HAVE_MALLOC_H +# undef HAVE_UNISTD_H +# undef HAVE_UTIME_H +# undef HAVE_SYS_STAT_H +# undef HAVE_SYS_TIME_H +# undef HAVE_SYS_TYPES_H +#endif +#if (ACC_LIBC_GLIBC >= 0x020100ul) +# define HAVE_STDINT_H 1 +#elif (ACC_LIBC_DIETLIBC) +# undef HAVE_STDINT_H +#elif (ACC_LIBC_UCLIBC) +# define HAVE_STDINT_H 1 +#elif (ACC_CC_BORLANDC) && (__BORLANDC__ >= 0x560) +# undef HAVE_STDINT_H +#elif (ACC_CC_DMC) && (__DMC__ >= 0x825) +# define HAVE_STDINT_H 1 +#endif +#if (HAVE_SYS_TIME_H && HAVE_TIME_H) +# define TIME_WITH_SYS_TIME 1 +#endif +#endif +#endif +#if !defined(ACC_CFG_AUTO_NO_FUNCTIONS) +#if defined(ACC_LIBC_NAKED) +#elif defined(ACC_LIBC_FREESTANDING) +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +# define HAVE_LONGJMP 1 +# define HAVE_MEMCMP 1 +# define HAVE_MEMCPY 1 +# define HAVE_MEMMOVE 1 +# define HAVE_MEMSET 1 +# define HAVE_SETJMP 1 +#else +#define HAVE_ACCESS 1 +#define HAVE_ALLOCA 1 +#define HAVE_ATEXIT 1 +#define HAVE_ATOI 1 +#define HAVE_ATOL 1 +#define HAVE_CHMOD 1 +#define HAVE_CHOWN 1 +#define HAVE_CTIME 1 +#define HAVE_DIFFTIME 1 +#define HAVE_FILENO 1 +#define HAVE_FSTAT 1 +#define HAVE_GETENV 1 +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GMTIME 1 +#define HAVE_ISATTY 1 +#define HAVE_LOCALTIME 1 +#define HAVE_LONGJMP 1 +#define HAVE_LSTAT 1 +#define HAVE_MEMCMP 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMSET 1 +#define HAVE_MKDIR 1 +#define HAVE_MKTIME 1 +#define HAVE_QSORT 1 +#define HAVE_RAISE 1 +#define HAVE_RMDIR 1 +#define HAVE_SETJMP 1 +#define HAVE_SIGNAL 1 +#define HAVE_SNPRINTF 1 +#define HAVE_STAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRDUP 1 +#define HAVE_STRERROR 1 +#define HAVE_STRFTIME 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_TIME 1 +#define HAVE_UMASK 1 +#define HAVE_UTIME 1 +#define HAVE_VSNPRINTF 1 +#if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX || ACC_OS_VMS) +# define HAVE_STRCASECMP 1 +# define HAVE_STRNCASECMP 1 +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) +# define HAVE_STRCASECMP 1 +# define HAVE_STRNCASECMP 1 +#else +# define HAVE_STRICMP 1 +# define HAVE_STRNICMP 1 +#endif +#if (ACC_OS_POSIX) +# if (ACC_OS_POSIX_AIX) +# define HAVE_GETRUSAGE 1 +# elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL) +# undef HAVE_CHOWN +# undef HAVE_LSTAT +# elif (ACC_OS_POSIX_UNICOS) +# undef HAVE_ALLOCA +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# endif +# if (ACC_CC_TINYC) +# undef HAVE_ALLOCA +# endif +# if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC) +# define HAVE_GETRUSAGE 1 +# define HAVE_GETPAGESIZE 1 +# define HAVE_MMAP 1 +# define HAVE_MPROTECT 1 +# define HAVE_MUNMAP 1 +# endif +#elif (ACC_OS_CYGWIN) +# if (ACC_CC_GNUC < 0x025a00ul) +# undef HAVE_GETTIMEOFDAY +# undef HAVE_LSTAT +# endif +# if (ACC_CC_GNUC < 0x025f00ul) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# endif +#elif (ACC_OS_EMX) +# undef HAVE_CHOWN +# undef HAVE_LSTAT +#elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) +# if !defined(__MINT__) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# endif +#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) +# undef HAVE_ALLOCA +# undef HAVE_ACCESS +# undef HAVE_CHMOD +# undef HAVE_CHOWN +# undef HAVE_FSTAT +# undef HAVE_GETTIMEOFDAY +# undef HAVE_LSTAT +# undef HAVE_SNPRINTF +# undef HAVE_UMASK +# undef HAVE_UTIME +# undef HAVE_VSNPRINTF +#endif +#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) +#undef HAVE_CHOWN +#undef HAVE_GETTIMEOFDAY +#undef HAVE_LSTAT +#undef HAVE_UMASK +#if (ACC_CC_AZTECC) +# undef HAVE_ALLOCA +# undef HAVE_DIFFTIME +# undef HAVE_FSTAT +# undef HAVE_STRDUP +# undef HAVE_SNPRINTF +# undef HAVE_UTIME +# undef HAVE_VSNPRINTF +#elif (ACC_CC_BORLANDC) +# if (__BORLANDC__ < 0x0400) +# undef HAVE_ALLOCA +# undef HAVE_UTIME +# endif +# if ((__BORLANDC__ < 0x0410) && ACC_OS_WIN16) +# undef HAVE_ALLOCA +# endif +# if (__BORLANDC__ < 0x0550) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# endif +#elif (ACC_CC_DMC) +# if (ACC_OS_WIN16) +# undef HAVE_ALLOCA +# endif +# define snprintf _snprintf +# define vsnprintf _vsnprintf +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +#elif (ACC_CC_IBMC) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +#elif (ACC_CC_INTELC) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +#elif (ACC_CC_LCCWIN32) +# define utime _utime +#elif (ACC_CC_MSC) +# if (_MSC_VER < 600) +# undef HAVE_STRFTIME +# endif +# if (_MSC_VER < 700) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# elif (_MSC_VER < 1500) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# endif +# if ((_MSC_VER < 800) && ACC_OS_WIN16) +# undef HAVE_ALLOCA +# endif +# if (ACC_ARCH_I086) && defined(__cplusplus) +# undef HAVE_LONGJMP +# undef HAVE_SETJMP +# endif +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__) +# if (ACC_CC_GNUC < 0x025f00ul) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# else +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# endif +#elif (ACC_OS_WIN32 && ACC_LIBC_MSL) +# if (__MSL__ < 0x8000ul) +# undef HAVE_CHMOD +# endif +#elif (ACC_CC_NDPC) +# undef HAVE_ALLOCA +# undef HAVE_SNPRINTF +# undef HAVE_STRNICMP +# undef HAVE_UTIME +# undef HAVE_VSNPRINTF +# if defined(__cplusplus) +# undef HAVE_STAT +# endif +#elif (ACC_CC_PACIFICC) +# undef HAVE_ACCESS +# undef HAVE_ALLOCA +# undef HAVE_CHMOD +# undef HAVE_DIFFTIME +# undef HAVE_FSTAT +# undef HAVE_MKTIME +# undef HAVE_RAISE +# undef HAVE_SNPRINTF +# undef HAVE_STRFTIME +# undef HAVE_UTIME +# undef HAVE_VSNPRINTF +#elif (ACC_OS_WIN32 && ACC_CC_PELLESC) +# if (__POCC__ < 280) +# define alloca _alloca +# undef HAVE_UTIME +# endif +#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +#elif (ACC_CC_SYMANTECC) +# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)) +# undef HAVE_ALLOCA +# endif +# if (__SC__ < 0x600) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# else +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# endif +# if (__SC__ < 0x700) +# undef HAVE_DIFFTIME +# undef HAVE_UTIME +# endif +#elif (ACC_CC_TOPSPEEDC) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +#elif (ACC_CC_TURBOC) +# undef HAVE_ALLOCA +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# if (__TURBOC__ < 0x0200) +# undef HAVE_RAISE +# undef HAVE_SIGNAL +# endif +# if (__TURBOC__ < 0x0295) +# undef HAVE_MKTIME +# undef HAVE_STRFTIME +# endif +# if (__TURBOC__ < 0x0400) +# undef HAVE_UTIME +# endif +#elif (ACC_CC_WATCOMC) +# if (__WATCOMC__ < 1100) +# undef HAVE_SNPRINTF +# undef HAVE_VSNPRINTF +# elif (__WATCOMC__ < 1200) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# endif +#elif (ACC_CC_ZORTECHC) +# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)) +# undef HAVE_ALLOCA +# endif +# undef HAVE_DIFFTIME +# undef HAVE_SNPRINTF +# undef HAVE_UTIME +# undef HAVE_VSNPRINTF +#endif +#endif +#if (ACC_OS_CONSOLE) +# undef HAVE_ACCESS +# undef HAVE_CHMOD +# undef HAVE_CHOWN +# undef HAVE_GETTIMEOFDAY +# undef HAVE_LSTAT +# undef HAVE_TIME +# undef HAVE_UMASK +# undef HAVE_UTIME +#endif +#if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99) +# undef HAVE_ACCESS +# undef HAVE_CHMOD +# undef HAVE_CHOWN +# undef HAVE_FSTAT +# undef HAVE_GETTIMEOFDAY +# undef HAVE_LSTAT +# undef HAVE_STAT +# undef HAVE_UMASK +# undef HAVE_UTIME +# if 1 +# undef HAVE_ALLOCA +# undef HAVE_ISATTY +# undef HAVE_MKDIR +# undef HAVE_RMDIR +# undef HAVE_STRDUP +# undef HAVE_STRICMP +# undef HAVE_STRNICMP +# endif +#endif +#endif +#endif +#if !defined(ACC_CFG_AUTO_NO_SIZES) +#if !defined(SIZEOF_SHORT) && defined(ACC_SIZEOF_SHORT) +# define SIZEOF_SHORT ACC_SIZEOF_SHORT +#endif +#if !defined(SIZEOF_INT) && defined(ACC_SIZEOF_INT) +# define SIZEOF_INT ACC_SIZEOF_INT +#endif +#if !defined(SIZEOF_LONG) && defined(ACC_SIZEOF_LONG) +# define SIZEOF_LONG ACC_SIZEOF_LONG +#endif +#if !defined(SIZEOF_LONG_LONG) && defined(ACC_SIZEOF_LONG_LONG) +# define SIZEOF_LONG_LONG ACC_SIZEOF_LONG_LONG +#endif +#if !defined(SIZEOF___INT32) && defined(ACC_SIZEOF___INT32) +# define SIZEOF___INT32 ACC_SIZEOF___INT32 +#endif +#if !defined(SIZEOF___INT64) && defined(ACC_SIZEOF___INT64) +# define SIZEOF___INT64 ACC_SIZEOF___INT64 +#endif +#if !defined(SIZEOF_VOID_P) && defined(ACC_SIZEOF_VOID_P) +# define SIZEOF_VOID_P ACC_SIZEOF_VOID_P +#endif +#if !defined(SIZEOF_SIZE_T) && defined(ACC_SIZEOF_SIZE_T) +# define SIZEOF_SIZE_T ACC_SIZEOF_SIZE_T +#endif +#if !defined(SIZEOF_PTRDIFF_T) && defined(ACC_SIZEOF_PTRDIFF_T) +# define SIZEOF_PTRDIFF_T ACC_SIZEOF_PTRDIFF_T +#endif +#endif +#if defined(HAVE_SIGNAL) && !defined(RETSIGTYPE) +# define RETSIGTYPE void +#endif +#endif +#if defined(ACC_CFG_NO_ACC_TYPE_H) +#else +#if (ACC_SIZEOF_LONG_LONG+0 > 0) +__acc_gnuc_extension__ typedef long long acc_llong_t; +__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; +#endif +#if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0)) +# error "missing defines for sizes" +#endif +#if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0)) +# error "missing defines for sizes" +#endif +#if !defined(acc_int16e_t) +#if (ACC_SIZEOF_LONG == 2) +# define acc_int16e_t long +# define acc_uint16e_t unsigned long +#elif (ACC_SIZEOF_INT == 2) +# define acc_int16e_t int +# define acc_uint16e_t unsigned int +#elif (ACC_SIZEOF_SHORT == 2) +# define acc_int16e_t short int +# define acc_uint16e_t unsigned short int +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) + typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__))); + typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__))); +# define acc_int16e_t __acc_int16e_hi_t +# define acc_uint16e_t __acc_uint16e_hi_t +#elif (ACC_SIZEOF___INT16 == 2) +# define acc_int16e_t __int16 +# define acc_uint16e_t unsigned __int16 +#else +#endif +#endif +#if defined(acc_int16e_t) +# define ACC_SIZEOF_ACC_INT16E_T 2 +#endif +#if !defined(acc_int32e_t) +#if (ACC_SIZEOF_LONG == 4) +# define acc_int32e_t long int +# define acc_uint32e_t unsigned long int +#elif (ACC_SIZEOF_INT == 4) +# define acc_int32e_t int +# define acc_uint32e_t unsigned int +#elif (ACC_SIZEOF_SHORT == 4) +# define acc_int32e_t short int +# define acc_uint32e_t unsigned short int +#elif (ACC_SIZEOF_LONG_LONG == 4) +# define acc_int32e_t acc_llong_t +# define acc_uint32e_t acc_ullong_t +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) + typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__))); + typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__))); +# define acc_int32e_t __acc_int32e_si_t +# define acc_uint32e_t __acc_uint32e_si_t +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) + typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__))); + typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__))); +# define acc_int32e_t __acc_int32e_si_t +# define acc_uint32e_t __acc_uint32e_si_t +# define ACC_INT32_C(c) c##LL +# define ACC_UINT32_C(c) c##ULL +#elif (ACC_SIZEOF___INT32 == 4) +# define acc_int32e_t __int32 +# define acc_uint32e_t unsigned __int32 +#else +#endif +#endif +#if defined(acc_int32e_t) +# define ACC_SIZEOF_ACC_INT32E_T 4 +#endif +#if !defined(acc_int64e_t) +#if (ACC_SIZEOF___INT64 == 8) +# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_TYPE_PREFER___INT64) +# define ACC_CFG_TYPE_PREFER___INT64 1 +# endif +#endif +#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_int64e_t int +# define acc_uint64e_t unsigned int +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG == 8) +# define acc_int64e_t long int +# define acc_uint64e_t unsigned long int +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG +#elif (ACC_SIZEOF_LONG_LONG == 8) && !defined(ACC_CFG_TYPE_PREFER___INT64) +# define acc_int64e_t acc_llong_t +# define acc_uint64e_t acc_ullong_t +# if (ACC_CC_BORLANDC) +# define ACC_INT64_C(c) ((c) + 0ll) +# define ACC_UINT64_C(c) ((c) + 0ull) +# else +# define ACC_INT64_C(c) c##LL +# define ACC_UINT64_C(c) c##ULL +# endif +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG +#elif (ACC_SIZEOF___INT64 == 8) +# define acc_int64e_t __int64 +# define acc_uint64e_t unsigned __int64 +# if (ACC_CC_BORLANDC) +# define ACC_INT64_C(c) ((c) + 0i64) +# define ACC_UINT64_C(c) ((c) + 0ui64) +# else +# define ACC_INT64_C(c) c##i64 +# define ACC_UINT64_C(c) c##ui64 +# endif +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64 +#else +#endif +#endif +#if !defined(acc_int32l_t) +#if defined(acc_int32e_t) +# define acc_int32l_t acc_int32e_t +# define acc_uint32l_t acc_uint32e_t +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T +#elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_int32l_t int +# define acc_uint32l_t unsigned int +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG >= 4) +# define acc_int32l_t long int +# define acc_uint32l_t unsigned long int +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG +#else +# error "acc_int32l_t" +#endif +#endif +#if !defined(acc_int64l_t) +#if defined(acc_int64e_t) +# define acc_int64l_t acc_int64e_t +# define acc_uint64l_t acc_uint64e_t +# define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T +#else +#endif +#endif +#if !defined(acc_int32f_t) +#if (ACC_SIZEOF_SIZE_T >= 8) +# define acc_int32f_t acc_int64l_t +# define acc_uint32f_t acc_uint64l_t +# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T +#else +# define acc_int32f_t acc_int32l_t +# define acc_uint32f_t acc_uint32l_t +# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T +#endif +#endif +#if !defined(acc_intptr_t) +#if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16)) +# define __ACC_INTPTR_T_IS_POINTER 1 + typedef char* acc_intptr_t; + typedef char* acc_uintptr_t; +# define acc_intptr_t acc_intptr_t +# define acc_uintptr_t acc_uintptr_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P +#elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4)) + typedef __w64 int acc_intptr_t; + typedef __w64 unsigned int acc_uintptr_t; +# define acc_intptr_t acc_intptr_t +# define acc_uintptr_t acc_uintptr_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P) +# define acc_intptr_t short +# define acc_uintptr_t unsigned short +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT +#elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_intptr_t int +# define acc_uintptr_t unsigned int +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P) +# define acc_intptr_t long +# define acc_uintptr_t unsigned long +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG +#elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P) +# define acc_intptr_t acc_int64l_t +# define acc_uintptr_t acc_uint64l_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T +#else +# error "acc_intptr_t" +#endif +#endif +#if !defined(acc_word_t) +#if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0) +#if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER) +# define acc_word_t acc_uintptr_t +# define acc_sword_t acc_intptr_t +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T +#elif (ACC_WORDSIZE == ACC_SIZEOF_LONG) +# define acc_word_t unsigned long +# define acc_sword_t long +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG +#elif (ACC_WORDSIZE == ACC_SIZEOF_INT) +# define acc_word_t unsigned int +# define acc_sword_t int +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT +#elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT) +# define acc_word_t unsigned short +# define acc_sword_t short +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT +#elif (ACC_WORDSIZE == 1) +# define acc_word_t unsigned char +# define acc_sword_t signed char +# define ACC_SIZEOF_ACC_WORD_T 1 +#elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T) +# define acc_word_t acc_uint64l_t +# define acc_sword_t acc_int64l_t +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T +#elif (ACC_ARCH_SPU) && (ACC_CC_GNUC) +#if 0 + typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__))); + typedef int acc_sword_t __attribute__((__mode__(__V16QI__))); +# define acc_word_t acc_word_t +# define acc_sword_t acc_sword_t +# define ACC_SIZEOF_ACC_WORD_T 16 +#endif +#else +# error "acc_word_t" +#endif +#endif +#endif +#if !defined(ACC_INT16_C) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2) +# define ACC_INT16_C(c) ((c) + 0) +# define ACC_UINT16_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2) +# define ACC_INT16_C(c) ((c) + 0L) +# define ACC_UINT16_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 2) +# define ACC_INT16_C(c) c +# define ACC_UINT16_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 2) +# define ACC_INT16_C(c) c##L +# define ACC_UINT16_C(c) c##UL +# else +# error "ACC_INT16_C" +# endif +#endif +#if !defined(ACC_INT32_C) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4) +# define ACC_INT32_C(c) ((c) + 0) +# define ACC_UINT32_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4) +# define ACC_INT32_C(c) ((c) + 0L) +# define ACC_UINT32_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 4) +# define ACC_INT32_C(c) c +# define ACC_UINT32_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 4) +# define ACC_INT32_C(c) c##L +# define ACC_UINT32_C(c) c##UL +# elif (ACC_SIZEOF_LONG_LONG >= 4) +# define ACC_INT32_C(c) c##LL +# define ACC_UINT32_C(c) c##ULL +# else +# error "ACC_INT32_C" +# endif +#endif +#if !defined(ACC_INT64_C) && defined(acc_int64l_t) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8) +# define ACC_INT64_C(c) ((c) + 0) +# define ACC_UINT64_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8) +# define ACC_INT64_C(c) ((c) + 0L) +# define ACC_UINT64_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 8) +# define ACC_INT64_C(c) c +# define ACC_UINT64_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 8) +# define ACC_INT64_C(c) c##L +# define ACC_UINT64_C(c) c##UL +# else +# error "ACC_INT64_C" +# endif +#endif +#if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T) +# define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T +#endif +#if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T) +# define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T +#endif +#if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T) +# define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T +#endif +#if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T) +# define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T +#endif +#if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T) +# define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T +#endif +#if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T) +# define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T +#endif +#if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T) +# define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T +#endif +#if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T) +# define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T +#endif +#if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4) +# define acc_signo_t acc_int32e_t +#endif +#if !defined(acc_signo_t) +# define acc_signo_t int +#endif +#if defined(__cplusplus) +extern "C" { +#endif +#if (ACC_BROKEN_CDECL_ALT_SYNTAX) +typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t); +#elif defined(RETSIGTYPE) +typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); +#else +typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); +#endif +#if defined(__cplusplus) +} +#endif +# if defined(ACC_CFG_NO_ACC_UA_H) +# else +#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul)) +#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (ACC_CC_INTELC) && defined(_WIN32) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700)) +#elif (ACC_CC_LLVM) +#elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE) +#if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t) + typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t; +# define __acc_ua16_t __acc_ua16_t +#endif +#if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t) + typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t; +# define __acc_ua32_t __acc_ua32_t +#endif +#if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t) + typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t; +# define __acc_ua64_t __acc_ua64_t +#endif +#endif +#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t) +#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET16(p,v) (* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p) = (acc_uint16e_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p) +# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p) +# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v) +#endif +#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline) +#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC) +#if !defined(ACC_UA_GET_LE16) +extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp); +extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) { + __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp; + unsigned long v; + __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p)); + return v; +} +#define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p) +#endif +#if !defined(ACC_UA_SET_LE16) +extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v); +extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) { + __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp; + __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v)); +} +#define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v) +#endif +#endif +#endif +#if !defined(ACC_UA_COPY16) +# define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s)) +#endif +#endif +#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t) +#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET32(p,v) (* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p) = (acc_uint32e_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p) +# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p) +# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v) +#endif +#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline) +#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC) +#if !defined(ACC_UA_GET_LE32) +extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp); +extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) { + __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp; + unsigned long v; + __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p)); + return v; +} +#define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p) +#endif +#if !defined(ACC_UA_SET_LE32) +extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v); +extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) { + __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp; + __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v)); +} +#define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v) +#endif +#endif +#endif +#if !defined(ACC_UA_COPY32) +# define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s)) +#endif +#endif +#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t) +#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET64(p,v) (* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p) = (acc_uint64l_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p) +# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE64(p) ACC_UA_GET64(p) +# define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v) +#endif +#if !defined(ACC_UA_COPY64) +# define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s)) +#endif +#endif +# endif +#endif +#endif +#if defined(ACC_WANT_ACC_TYPE_H) +# undef ACC_WANT_ACC_TYPE_H +# if defined(ACC_CFG_NO_ACC_TYPE_H) +# error "ACC_WANT_ACC_TYPE_H with ACC_CFG_NO_ACC_TYPE_H" +# endif +#if (ACC_SIZEOF_LONG_LONG+0 > 0) +__acc_gnuc_extension__ typedef long long acc_llong_t; +__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t; +#endif +#if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0)) +# error "missing defines for sizes" +#endif +#if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0)) +# error "missing defines for sizes" +#endif +#if !defined(acc_int16e_t) +#if (ACC_SIZEOF_LONG == 2) +# define acc_int16e_t long +# define acc_uint16e_t unsigned long +#elif (ACC_SIZEOF_INT == 2) +# define acc_int16e_t int +# define acc_uint16e_t unsigned int +#elif (ACC_SIZEOF_SHORT == 2) +# define acc_int16e_t short int +# define acc_uint16e_t unsigned short int +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) + typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__))); + typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__))); +# define acc_int16e_t __acc_int16e_hi_t +# define acc_uint16e_t __acc_uint16e_hi_t +#elif (ACC_SIZEOF___INT16 == 2) +# define acc_int16e_t __int16 +# define acc_uint16e_t unsigned __int16 +#else +#endif +#endif +#if defined(acc_int16e_t) +# define ACC_SIZEOF_ACC_INT16E_T 2 +#endif +#if !defined(acc_int32e_t) +#if (ACC_SIZEOF_LONG == 4) +# define acc_int32e_t long int +# define acc_uint32e_t unsigned long int +#elif (ACC_SIZEOF_INT == 4) +# define acc_int32e_t int +# define acc_uint32e_t unsigned int +#elif (ACC_SIZEOF_SHORT == 4) +# define acc_int32e_t short int +# define acc_uint32e_t unsigned short int +#elif (ACC_SIZEOF_LONG_LONG == 4) +# define acc_int32e_t acc_llong_t +# define acc_uint32e_t acc_ullong_t +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) + typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__))); + typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__))); +# define acc_int32e_t __acc_int32e_si_t +# define acc_uint32e_t __acc_uint32e_si_t +#elif 1 && !defined(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) + typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__))); + typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__))); +# define acc_int32e_t __acc_int32e_si_t +# define acc_uint32e_t __acc_uint32e_si_t +# define ACC_INT32_C(c) c##LL +# define ACC_UINT32_C(c) c##ULL +#elif (ACC_SIZEOF___INT32 == 4) +# define acc_int32e_t __int32 +# define acc_uint32e_t unsigned __int32 +#else +#endif +#endif +#if defined(acc_int32e_t) +# define ACC_SIZEOF_ACC_INT32E_T 4 +#endif +#if !defined(acc_int64e_t) +#if (ACC_SIZEOF___INT64 == 8) +# if (ACC_CC_BORLANDC) && !defined(ACC_CFG_TYPE_PREFER___INT64) +# define ACC_CFG_TYPE_PREFER___INT64 1 +# endif +#endif +#if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_int64e_t int +# define acc_uint64e_t unsigned int +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG == 8) +# define acc_int64e_t long int +# define acc_uint64e_t unsigned long int +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG +#elif (ACC_SIZEOF_LONG_LONG == 8) && !defined(ACC_CFG_TYPE_PREFER___INT64) +# define acc_int64e_t acc_llong_t +# define acc_uint64e_t acc_ullong_t +# if (ACC_CC_BORLANDC) +# define ACC_INT64_C(c) ((c) + 0ll) +# define ACC_UINT64_C(c) ((c) + 0ull) +# else +# define ACC_INT64_C(c) c##LL +# define ACC_UINT64_C(c) c##ULL +# endif +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG +#elif (ACC_SIZEOF___INT64 == 8) +# define acc_int64e_t __int64 +# define acc_uint64e_t unsigned __int64 +# if (ACC_CC_BORLANDC) +# define ACC_INT64_C(c) ((c) + 0i64) +# define ACC_UINT64_C(c) ((c) + 0ui64) +# else +# define ACC_INT64_C(c) c##i64 +# define ACC_UINT64_C(c) c##ui64 +# endif +# define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64 +#else +#endif +#endif +#if !defined(acc_int32l_t) +#if defined(acc_int32e_t) +# define acc_int32l_t acc_int32e_t +# define acc_uint32l_t acc_uint32e_t +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T +#elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_int32l_t int +# define acc_uint32l_t unsigned int +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG >= 4) +# define acc_int32l_t long int +# define acc_uint32l_t unsigned long int +# define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG +#else +# error "acc_int32l_t" +#endif +#endif +#if !defined(acc_int64l_t) +#if defined(acc_int64e_t) +# define acc_int64l_t acc_int64e_t +# define acc_uint64l_t acc_uint64e_t +# define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T +#else +#endif +#endif +#if !defined(acc_int32f_t) +#if (ACC_SIZEOF_SIZE_T >= 8) +# define acc_int32f_t acc_int64l_t +# define acc_uint32f_t acc_uint64l_t +# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T +#else +# define acc_int32f_t acc_int32l_t +# define acc_uint32f_t acc_uint32l_t +# define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T +#endif +#endif +#if !defined(acc_intptr_t) +#if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16)) +# define __ACC_INTPTR_T_IS_POINTER 1 + typedef char* acc_intptr_t; + typedef char* acc_uintptr_t; +# define acc_intptr_t acc_intptr_t +# define acc_uintptr_t acc_uintptr_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P +#elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4)) + typedef __w64 int acc_intptr_t; + typedef __w64 unsigned int acc_uintptr_t; +# define acc_intptr_t acc_intptr_t +# define acc_uintptr_t acc_uintptr_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P) +# define acc_intptr_t short +# define acc_uintptr_t unsigned short +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT +#elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG) +# define acc_intptr_t int +# define acc_uintptr_t unsigned int +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT +#elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P) +# define acc_intptr_t long +# define acc_uintptr_t unsigned long +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG +#elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P) +# define acc_intptr_t acc_int64l_t +# define acc_uintptr_t acc_uint64l_t +# define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T +#else +# error "acc_intptr_t" +#endif +#endif +#if !defined(acc_word_t) +#if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0) +#if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER) +# define acc_word_t acc_uintptr_t +# define acc_sword_t acc_intptr_t +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T +#elif (ACC_WORDSIZE == ACC_SIZEOF_LONG) +# define acc_word_t unsigned long +# define acc_sword_t long +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG +#elif (ACC_WORDSIZE == ACC_SIZEOF_INT) +# define acc_word_t unsigned int +# define acc_sword_t int +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT +#elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT) +# define acc_word_t unsigned short +# define acc_sword_t short +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT +#elif (ACC_WORDSIZE == 1) +# define acc_word_t unsigned char +# define acc_sword_t signed char +# define ACC_SIZEOF_ACC_WORD_T 1 +#elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T) +# define acc_word_t acc_uint64l_t +# define acc_sword_t acc_int64l_t +# define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T +#elif (ACC_ARCH_SPU) && (ACC_CC_GNUC) +#if 0 + typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__))); + typedef int acc_sword_t __attribute__((__mode__(__V16QI__))); +# define acc_word_t acc_word_t +# define acc_sword_t acc_sword_t +# define ACC_SIZEOF_ACC_WORD_T 16 +#endif +#else +# error "acc_word_t" +#endif +#endif +#endif +#if !defined(ACC_INT16_C) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2) +# define ACC_INT16_C(c) ((c) + 0) +# define ACC_UINT16_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2) +# define ACC_INT16_C(c) ((c) + 0L) +# define ACC_UINT16_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 2) +# define ACC_INT16_C(c) c +# define ACC_UINT16_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 2) +# define ACC_INT16_C(c) c##L +# define ACC_UINT16_C(c) c##UL +# else +# error "ACC_INT16_C" +# endif +#endif +#if !defined(ACC_INT32_C) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4) +# define ACC_INT32_C(c) ((c) + 0) +# define ACC_UINT32_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4) +# define ACC_INT32_C(c) ((c) + 0L) +# define ACC_UINT32_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 4) +# define ACC_INT32_C(c) c +# define ACC_UINT32_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 4) +# define ACC_INT32_C(c) c##L +# define ACC_UINT32_C(c) c##UL +# elif (ACC_SIZEOF_LONG_LONG >= 4) +# define ACC_INT32_C(c) c##LL +# define ACC_UINT32_C(c) c##ULL +# else +# error "ACC_INT32_C" +# endif +#endif +#if !defined(ACC_INT64_C) && defined(acc_int64l_t) +# if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8) +# define ACC_INT64_C(c) ((c) + 0) +# define ACC_UINT64_C(c) ((c) + 0U) +# elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8) +# define ACC_INT64_C(c) ((c) + 0L) +# define ACC_UINT64_C(c) ((c) + 0UL) +# elif (ACC_SIZEOF_INT >= 8) +# define ACC_INT64_C(c) c +# define ACC_UINT64_C(c) c##U +# elif (ACC_SIZEOF_LONG >= 8) +# define ACC_INT64_C(c) c##L +# define ACC_UINT64_C(c) c##UL +# else +# error "ACC_INT64_C" +# endif +#endif +#if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T) +# define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T +#endif +#if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T) +# define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T +#endif +#if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T) +# define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T +#endif +#if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T) +# define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T +#endif +#if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T) +# define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T +#endif +#if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T) +# define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T +#endif +#if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T) +# define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T +#endif +#if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T) +# define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T +#endif +#if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4) +# define acc_signo_t acc_int32e_t +#endif +#if !defined(acc_signo_t) +# define acc_signo_t int +#endif +#if defined(__cplusplus) +extern "C" { +#endif +#if (ACC_BROKEN_CDECL_ALT_SYNTAX) +typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t); +#elif defined(RETSIGTYPE) +typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); +#else +typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t); +#endif +#if defined(__cplusplus) +} +#endif +# if !defined(ACC_CFG_NO_ACC_UA_H) +#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul)) +#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (ACC_CC_INTELC) && defined(_WIN32) +#elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700)) +#elif (ACC_CC_LLVM) +#elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE) +#if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t) + typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t; +# define __acc_ua16_t __acc_ua16_t +#endif +#if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t) + typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t; +# define __acc_ua32_t __acc_ua32_t +#endif +#if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t) + typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t; +# define __acc_ua64_t __acc_ua64_t +#endif +#endif +#if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t) +#define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET16(p,v) (* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p) = (acc_uint16e_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE16(p) ACC_UA_GET16(p) +# define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE16(p) ACC_UA_GET16(p) +# define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v) +#endif +#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline) +#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC) +#if !defined(ACC_UA_GET_LE16) +extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp); +extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) { + __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp; + unsigned long v; + __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p)); + return v; +} +#define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p) +#endif +#if !defined(ACC_UA_SET_LE16) +extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v); +extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) { + __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp; + __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v)); +} +#define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v) +#endif +#endif +#endif +#if !defined(ACC_UA_COPY16) +# define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s)) +#endif +#endif +#if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t) +#define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET32(p,v) (* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p) = (acc_uint32e_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE32(p) ACC_UA_GET32(p) +# define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE32(p) ACC_UA_GET32(p) +# define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v) +#endif +#if !defined(ACC_CFG_NO_INLINE_ASM) && defined(__acc_HAVE_forceinline) +#if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC) +#if !defined(ACC_UA_GET_LE32) +extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp); +extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) { + __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp; + unsigned long v; + __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p)); + return v; +} +#define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p) +#endif +#if !defined(ACC_UA_SET_LE32) +extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v); +extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) { + __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp; + __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v)); +} +#define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v) +#endif +#endif +#endif +#if !defined(ACC_UA_COPY32) +# define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s)) +#endif +#endif +#if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t) +#define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p)) +#define ACC_UA_SET64(p,v) (* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p) = (acc_uint64l_t) (v)) +#if (ACC_ABI_BIG_ENDIAN) +# define ACC_UA_GET_BE64(p) ACC_UA_GET64(p) +# define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v) +#elif (ACC_ABI_LITTLE_ENDIAN) +# define ACC_UA_GET_LE64(p) ACC_UA_GET64(p) +# define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v) +#endif +#if !defined(ACC_UA_COPY64) +# define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s)) +#endif +#endif +# endif +#endif +#if defined(ACC_WANT_ACC_INCD_H) +# undef ACC_WANT_ACC_INCD_H +#ifndef __ACC_INCD_H_INCLUDED +#define __ACC_INCD_H_INCLUDED 1 +#if defined(ACC_LIBC_NAKED) +#ifndef __ACC_FALLBACK_STDDEF_H_INCLUDED +#define __ACC_FALLBACK_STDDEF_H_INCLUDED +#if defined(__PTRDIFF_TYPE__) +typedef __PTRDIFF_TYPE__ acc_fallback_ptrdiff_t; +#elif defined(__MIPS_PSX2__) +typedef int acc_fallback_ptrdiff_t; +#else +typedef long acc_fallback_ptrdiff_t; +#endif +#if defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ acc_fallback_size_t; +#elif defined(__MIPS_PSX2__) +typedef unsigned int acc_fallback_size_t; +#else +typedef unsigned long acc_fallback_size_t; +#endif +#if !defined(ptrdiff_t) +typedef acc_fallback_ptrdiff_t ptrdiff_t; +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED 1 +#endif +#endif +#if !defined(size_t) +typedef acc_fallback_size_t size_t; +#ifndef _SIZE_T_DEFINED +#define _SIZE_T_DEFINED 1 +#endif +#endif +#if !defined(__cplusplus) && !defined(wchar_t) +typedef unsigned short wchar_t; +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED 1 +#endif +#endif +#ifndef NULL +#if defined(__cplusplus) && defined(__GNUC__) && (__GNUC__ >= 4) +#define NULL __null +#elif defined(__cplusplus) +#define NULL 0 +#else +#define NULL ((void*)0) +#endif +#endif +#ifndef offsetof +#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m))) +#endif +#endif +#elif defined(ACC_LIBC_FREESTANDING) +# if HAVE_STDDEF_H +# include +# endif +# if HAVE_STDINT_H +# include +# endif +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +# if HAVE_STDIO_H +# include +# endif +# if HAVE_STDDEF_H +# include +# endif +# if HAVE_STDINT_H +# include +# endif +#else +#include +#if defined(HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus) +# include +#endif +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif +#endif +#endif +#endif +#if defined(ACC_WANT_ACC_INCE_H) +# undef ACC_WANT_ACC_INCE_H +#ifndef __ACC_INCE_H_INCLUDED +#define __ACC_INCE_H_INCLUDED 1 +#if defined(ACC_LIBC_NAKED) +#elif defined(ACC_LIBC_FREESTANDING) +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +# if defined(HAVE_SETJMP_H) +# include +# endif +#else +#if defined(HAVE_STDARG_H) +# include +#endif +#if defined(HAVE_CTYPE_H) +# include +#endif +#if defined(HAVE_ERRNO_H) +# include +#endif +#if defined(HAVE_MALLOC_H) +# include +#endif +#if defined(HAVE_ALLOCA_H) +# include +#endif +#if defined(HAVE_FCNTL_H) +# include +#endif +#if defined(HAVE_DIRENT_H) +# include +#endif +#if defined(HAVE_SETJMP_H) +# include +#endif +#if defined(HAVE_SIGNAL_H) +# include +#endif +#if defined(TIME_WITH_SYS_TIME) +# include +# include +#elif defined(HAVE_TIME_H) +# include +#endif +#if defined(HAVE_UTIME_H) +# include +#elif defined(HAVE_SYS_UTIME_H) +# include +#endif +#if defined(HAVE_IO_H) +# include +#endif +#if defined(HAVE_DOS_H) +# include +#endif +#if defined(HAVE_DIRECT_H) +# include +#endif +#if defined(HAVE_SHARE_H) +# include +#endif +#if defined(ACC_CC_NDPC) +# include +#endif +#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__)) +# include +#endif +#endif +#endif +#endif +#if defined(ACC_WANT_ACC_INCI_H) +# undef ACC_WANT_ACC_INCI_H +#ifndef __ACC_INCI_H_INCLUDED +#define __ACC_INCI_H_INCLUDED 1 +#if defined(ACC_LIBC_NAKED) +#elif defined(ACC_LIBC_FREESTANDING) +#elif defined(ACC_LIBC_MOSTLY_FREESTANDING) +#else +#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) +# include +#elif (ACC_HAVE_WINDOWS_H) +# if 1 && !defined(WIN32_LEAN_AND_MEAN) +# define WIN32_LEAN_AND_MEAN 1 +# endif +# if 1 && !defined(_WIN32_WINNT) +# define _WIN32_WINNT 0x0400 +# endif +# include +# if (ACC_CC_BORLANDC || ACC_CC_TURBOC) +# include +# endif +#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16) +# if (ACC_CC_AZTECC) +# include +# include +# elif (ACC_CC_BORLANDC || ACC_CC_TURBOC) +# include +# include +# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +# include +# elif (ACC_CC_PACIFICC) +# include +# include +# include +# elif (ACC_CC_WATCOMC) +# include +# endif +#elif (ACC_OS_OS216) +# if (ACC_CC_WATCOMC) +# include +# endif +#endif +#if defined(HAVE_SYS_MMAN_H) +# include +#endif +#if defined(HAVE_SYS_RESOURCE_H) +# include +#endif +#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16) +# if defined(FP_OFF) +# define ACC_PTR_FP_OFF(x) FP_OFF(x) +# elif defined(_FP_OFF) +# define ACC_PTR_FP_OFF(x) _FP_OFF(x) +# else +# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0]) +# endif +# if defined(FP_SEG) +# define ACC_PTR_FP_SEG(x) FP_SEG(x) +# elif defined(_FP_SEG) +# define ACC_PTR_FP_SEG(x) _FP_SEG(x) +# else +# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1]) +# endif +# if defined(MK_FP) +# define ACC_PTR_MK_FP(s,o) MK_FP(s,o) +# elif defined(_MK_FP) +# define ACC_PTR_MK_FP(s,o) _MK_FP(s,o) +# else +# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o))) +# endif +# if 0 +# undef ACC_PTR_FP_OFF +# undef ACC_PTR_FP_SEG +# undef ACC_PTR_MK_FP +# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0]) +# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1]) +# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o))) +# endif +#endif +#endif +#endif +#endif +#if defined(ACC_WANT_ACC_LIB_H) +# undef ACC_WANT_ACC_LIB_H +#ifndef __ACC_LIB_H_INCLUDED +#define __ACC_LIB_H_INCLUDED 1 +#if !defined(__ACCLIB_FUNCNAME) +# define __ACCLIB_FUNCNAME(f) f +#endif +#if !defined(ACCLIB_EXTERN) +# define ACCLIB_EXTERN(r,f) extern r __ACCLIB_FUNCNAME(f) +#endif +#if !defined(ACCLIB_EXTERN_NOINLINE) +# if defined(__acc_noinline) +# define ACCLIB_EXTERN_NOINLINE(r,f) extern __acc_noinline r __ACCLIB_FUNCNAME(f) +# else +# define ACCLIB_EXTERN_NOINLINE(r,f) extern r __ACCLIB_FUNCNAME(f) +# endif +#endif +#if !defined(__ACCLIB_CONST_CAST_RETURN) +#if 1 && (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (acc_uintptr_t) (var); +#elif (ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __ACCLIB_CONST_CAST_RETURN(type,var) \ + { union { type a; const type b; } u; u.b = (var); return u.a; } +#else +# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (var); +#endif +#endif +#if (ACC_OS_WIN64) +# define acclib_handle_t acc_int64l_t +# define acclib_uhandle_t acc_uint64l_t +#elif (ACC_ARCH_I386 && ACC_CC_MSC && (_MSC_VER >= 1300)) + typedef __w64 long acclib_handle_t; + typedef __w64 unsigned long acclib_uhandle_t; +# define acclib_handle_t acclib_handle_t +# define acclib_uhandle_t acclib_uhandle_t +#else +# define acclib_handle_t long +# define acclib_uhandle_t unsigned long +#endif +#if 0 +ACCLIB_EXTERN(int, acc_ascii_digit) (int); +ACCLIB_EXTERN(int, acc_ascii_islower) (int); +ACCLIB_EXTERN(int, acc_ascii_isupper) (int); +ACCLIB_EXTERN(int, acc_ascii_tolower) (int); +ACCLIB_EXTERN(int, acc_ascii_toupper) (int); +ACCLIB_EXTERN(int, acc_ascii_utolower) (int); +ACCLIB_EXTERN(int, acc_ascii_utoupper) (int); +#endif +#define acc_ascii_isdigit(c) (((unsigned)(c) - 48) < 10) +#define acc_ascii_islower(c) (((unsigned)(c) - 97) < 26) +#define acc_ascii_isupper(c) (((unsigned)(c) - 65) < 26) +#define acc_ascii_tolower(c) ((int)(c) + (acc_ascii_isupper(c) << 5)) +#define acc_ascii_toupper(c) ((int)(c) - (acc_ascii_islower(c) << 5)) +#define acc_ascii_utolower(c) acc_ascii_tolower((unsigned char)(c)) +#define acc_ascii_utoupper(c) acc_ascii_toupper((unsigned char)(c)) +#ifndef acc_hsize_t +#if (ACC_HAVE_MM_HUGE_PTR) +# define acc_hsize_t unsigned long +# define acc_hvoid_p void __huge * +# define acc_hchar_p char __huge * +# define acc_hchar_pp char __huge * __huge * +# define acc_hbyte_p unsigned char __huge * +#else +# define acc_hsize_t size_t +# define acc_hvoid_p void * +# define acc_hchar_p char * +# define acc_hchar_pp char ** +# define acc_hbyte_p unsigned char * +#endif +#endif +ACCLIB_EXTERN(acc_hvoid_p, acc_halloc) (acc_hsize_t); +ACCLIB_EXTERN(void, acc_hfree) (acc_hvoid_p); +#if (ACC_OS_DOS16 || ACC_OS_OS216) +ACCLIB_EXTERN(void __far*, acc_dos_alloc) (unsigned long); +ACCLIB_EXTERN(int, acc_dos_free) (void __far*); +#endif +ACCLIB_EXTERN(int, acc_hmemcmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemset) (acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrlen) (const acc_hchar_p); +ACCLIB_EXTERN(int, acc_hstrcmp) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(int, acc_hstrncmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(int, acc_ascii_hstricmp) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(int, acc_ascii_hstrnicmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(int, acc_ascii_hmemicmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrstr) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrcpy) (acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrcat) (acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(int, acc_hstrscpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(int, acc_hstrscat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrccpy) (acc_hchar_p, const acc_hchar_p, int); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p, const acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrchr) (const acc_hchar_p, int); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p, int); +ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p, int); +ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p, int); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p, int, acc_hsize_t); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrspn) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrsep) (acc_hchar_pp, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp, const acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p); +ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p); +ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hsize_t, acc_hfread) (void *, acc_hvoid_p, acc_hsize_t); +ACCLIB_EXTERN(acc_hsize_t, acc_hfwrite) (void *, const acc_hvoid_p, acc_hsize_t); +#if (ACC_HAVE_MM_HUGE_PTR) +ACCLIB_EXTERN(long, acc_hread) (int, acc_hvoid_p, long); +ACCLIB_EXTERN(long, acc_hwrite) (int, const acc_hvoid_p, long); +#endif +ACCLIB_EXTERN(long, acc_safe_hread) (int, acc_hvoid_p, long); +ACCLIB_EXTERN(long, acc_safe_hwrite) (int, const acc_hvoid_p, long); +ACCLIB_EXTERN(unsigned, acc_ua_get_be16) (const acc_hvoid_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p); +ACCLIB_EXTERN(void, acc_ua_set_be16) (acc_hvoid_p, unsigned); +ACCLIB_EXTERN(void, acc_ua_set_be24) (acc_hvoid_p, acc_uint32l_t); +ACCLIB_EXTERN(void, acc_ua_set_be32) (acc_hvoid_p, acc_uint32l_t); +ACCLIB_EXTERN(unsigned, acc_ua_get_le16) (const acc_hvoid_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p); +ACCLIB_EXTERN(void, acc_ua_set_le16) (acc_hvoid_p, unsigned); +ACCLIB_EXTERN(void, acc_ua_set_le24) (acc_hvoid_p, acc_uint32l_t); +ACCLIB_EXTERN(void, acc_ua_set_le32) (acc_hvoid_p, acc_uint32l_t); +#if defined(acc_int64l_t) +ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p); +ACCLIB_EXTERN(void, acc_ua_set_be64) (acc_hvoid_p, acc_uint64l_t); +ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p); +ACCLIB_EXTERN(void, acc_ua_set_le64) (acc_hvoid_p, acc_uint64l_t); +#endif +ACCLIB_EXTERN_NOINLINE(short, acc_vget_short) (short, int); +ACCLIB_EXTERN_NOINLINE(int, acc_vget_int) (int, int); +ACCLIB_EXTERN_NOINLINE(long, acc_vget_long) (long, int); +#if defined(acc_int64l_t) +ACCLIB_EXTERN_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t, int); +#endif +ACCLIB_EXTERN_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t, int); +#if !defined(ACC_CFG_NO_FLOAT) +ACCLIB_EXTERN_NOINLINE(float, acc_vget_float) (float, int); +#endif +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_EXTERN_NOINLINE(double, acc_vget_double) (double, int); +#endif +ACCLIB_EXTERN_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p, int); +ACCLIB_EXTERN_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p, int); +#if !defined(ACC_FN_PATH_MAX) +#if (ACC_OS_DOS16 || ACC_OS_WIN16) +# define ACC_FN_PATH_MAX 143 +#elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN32 || ACC_OS_WIN64) +# define ACC_FN_PATH_MAX 259 +#elif (ACC_OS_TOS) +# define ACC_FN_PATH_MAX 259 +#endif +#endif +#if !defined(ACC_FN_PATH_MAX) +# define ACC_FN_PATH_MAX 1023 +#endif +#if !defined(ACC_FN_NAME_MAX) +#if (ACC_OS_DOS16 || ACC_OS_WIN16) +# define ACC_FN_NAME_MAX 12 +#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) +# define ACC_FN_NAME_MAX 12 +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +#elif (ACC_OS_DOS32) +# define ACC_FN_NAME_MAX 12 +#endif +#endif +#if !defined(ACC_FN_NAME_MAX) +# define ACC_FN_NAME_MAX ACC_FN_PATH_MAX +#endif +#define ACC_FNMATCH_NOESCAPE 1 +#define ACC_FNMATCH_PATHNAME 2 +#define ACC_FNMATCH_PATHSTAR 4 +#define ACC_FNMATCH_PERIOD 8 +#define ACC_FNMATCH_ASCII_CASEFOLD 16 +ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int); +#undef __ACCLIB_USE_OPENDIR +#if (HAVE_DIRENT_H || ACC_CC_WATCOMC) +# define __ACCLIB_USE_OPENDIR 1 +# if (ACC_OS_DOS32 && defined(__BORLANDC__)) +# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +# elif (ACC_OS_OS2 || ACC_OS_OS216) +# elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) +# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H)) +# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) +# undef __ACCLIB_USE_OPENDIR +# endif +#endif +typedef struct +{ +#if defined(__ACCLIB_USE_OPENDIR) + void* u_dirp; +# if (ACC_CC_WATCOMC) + unsigned short f_time; + unsigned short f_date; + unsigned long f_size; +# endif + char f_name[ACC_FN_NAME_MAX+1]; +#elif (ACC_OS_WIN32 || ACC_OS_WIN64) + acclib_handle_t u_handle; + unsigned f_attr; + unsigned f_size_low; + unsigned f_size_high; + char f_name[ACC_FN_NAME_MAX+1]; +#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_TOS || ACC_OS_WIN16) + char u_dta[21]; + unsigned char f_attr; + unsigned short f_time; + unsigned short f_date; + unsigned short f_size_low; + unsigned short f_size_high; + char f_name[ACC_FN_NAME_MAX+1]; + char u_dirp; +#else + void* u_dirp; + char f_name[ACC_FN_NAME_MAX+1]; +#endif +} acc_dir_t; +#ifndef acc_dir_p +#define acc_dir_p acc_dir_t * +#endif +ACCLIB_EXTERN(int, acc_opendir) (acc_dir_p, const char*); +ACCLIB_EXTERN(int, acc_readdir) (acc_dir_p); +ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p); +#if (ACC_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__)) +# define acc_alloca(x) __builtin_alloca((x)) +#elif (ACC_CC_GNUC) && (ACC_OS_CONSOLE_PS2) +# define acc_alloca(x) __builtin_alloca((x)) +#elif (ACC_CC_BORLANDC || ACC_CC_LCC) && defined(__linux__) +#elif (HAVE_ALLOCA) +# define acc_alloca(x) ((void *) (alloca((x)))) +#endif +#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +# define acc_stackavail() stackavail() +#elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0410)) +# define acc_stackavail() stackavail() +#elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0400)) +# if (ACC_OS_WIN16) && (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM) +# else +# define acc_stackavail() stackavail() +# endif +#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_DMC || ACC_CC_SYMANTECC)) +# define acc_stackavail() stackavail() +#elif ((ACC_ARCH_I086) && ACC_CC_MSC && (_MSC_VER >= 700)) +# define acc_stackavail() _stackavail() +#elif ((ACC_ARCH_I086) && ACC_CC_MSC) +# define acc_stackavail() stackavail() +#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && ACC_CC_TURBOC && (__TURBOC__ >= 0x0450)) +# define acc_stackavail() stackavail() +#elif (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ >= 0x0400)) + ACC_EXTERN_C size_t __cdecl stackavail(void); +# define acc_stackavail() stackavail() +#elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_WATCOMC)) +# define acc_stackavail() stackavail() +#elif (ACC_ARCH_I086 && ACC_CC_ZORTECHC) +# define acc_stackavail() _chkstack() +#endif +ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int); +ACCLIB_EXTERN(const char *, acc_getenv) (const char *); +ACCLIB_EXTERN(int, acc_isatty) (int); +ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned); +ACCLIB_EXTERN(int, acc_rmdir) (const char*); +ACCLIB_EXTERN(int, acc_response) (int*, char***); +ACCLIB_EXTERN(int, acc_set_binmode) (int, int); +#if defined(acc_int32e_t) +ACCLIB_EXTERN(acc_int32e_t, acc_muldiv32s) (acc_int32e_t, acc_int32e_t, acc_int32e_t); +ACCLIB_EXTERN(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t, acc_uint32e_t, acc_uint32e_t); +#endif +ACCLIB_EXTERN(void, acc_wildargv) (int*, char***); +ACCLIB_EXTERN_NOINLINE(void, acc_debug_break) (void); +ACCLIB_EXTERN_NOINLINE(void, acc_debug_nop) (void); +ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_query) (void); +ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_enable) (int); +ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_qemu) (void); +ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void); +#if !defined(acc_int64l_t) || defined(ACC_CFG_NO_DOUBLE) +# undef __ACCLIB_PCLOCK_USE_RDTSC +# undef __ACCLIB_PCLOCK_USE_PERFCTR +# undef __ACCLIB_UCLOCK_USE_RDTSC +# undef __ACCLIB_UCLOCK_USE_PERFCTR +#else +typedef struct { + void* h; + int mode; + double tsc_to_seconds; + unsigned cpu_type, cpu_features, cpu_khz, cpu_nrctrs; + const char* cpu_name; +} acc_perfctr_handle_t; +typedef struct { + acc_uint64l_t tsc; +#if (ACC_OS_POSIX_LINUX) + acc_uint64l_t pmc[18]; +#else + acc_uint64l_t pmc[1]; +#endif +} acc_perfctr_clock_t; +#ifndef acc_perfctr_handle_p +#define acc_perfctr_handle_p acc_perfctr_handle_t * +#endif +#ifndef acc_perfctr_clock_p +#define acc_perfctr_clock_p acc_perfctr_clock_t * +#endif +ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p); +ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p); +ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p); +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p); +ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t); +#endif +ACCLIB_EXTERN(int, acc_perfctr_flush_cpu_cache) (acc_perfctr_handle_p, unsigned); +#endif +#if defined(acc_int32e_t) +ACCLIB_EXTERN(int, acc_tsc_read) (acc_uint32e_t*); +#else +# undef __ACCLIB_PCLOCK_USE_RDTSC +# undef __ACCLIB_UCLOCK_USE_RDTSC +#endif +struct acc_pclock_handle_t; +struct acc_pclock_t; +typedef struct acc_pclock_handle_t acc_pclock_handle_t; +typedef struct acc_pclock_t acc_pclock_t; +#ifndef acc_pclock_handle_p +#define acc_pclock_handle_p acc_pclock_handle_t * +#endif +#ifndef acc_pclock_p +#define acc_pclock_p acc_pclock_t * +#endif +#define ACC_PCLOCK_REALTIME 0 +#define ACC_PCLOCK_MONOTONIC 1 +#define ACC_PCLOCK_PROCESS_CPUTIME_ID 2 +#define ACC_PCLOCK_THREAD_CPUTIME_ID 3 +#define ACC_PCLOCK_REALTIME_HR 4 +#define ACC_PCLOCK_MONOTONIC_HR 5 +struct acc_pclock_handle_t { + acclib_handle_t h; + int mode; + const char* name; + int (*gettime) (acc_pclock_handle_p, acc_pclock_p); +#if defined(acc_int64l_t) + acc_uint64l_t ticks_base; +#endif +#if defined(__ACCLIB_PCLOCK_USE_PERFCTR) + acc_perfctr_handle_t pch; +#endif +}; +struct acc_pclock_t { +#if defined(acc_int64l_t) + acc_int64l_t tv_sec; +#else + acc_int32l_t tv_sec_high; + acc_uint32l_t tv_sec_low; +#endif + acc_uint32l_t tv_nsec; +}; +ACCLIB_EXTERN(int, acc_pclock_open) (acc_pclock_handle_p, int); +ACCLIB_EXTERN(int, acc_pclock_open_default) (acc_pclock_handle_p); +ACCLIB_EXTERN(int, acc_pclock_close) (acc_pclock_handle_p); +ACCLIB_EXTERN(void, acc_pclock_read) (acc_pclock_handle_p, acc_pclock_p); +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_EXTERN(double, acc_pclock_get_elapsed) (acc_pclock_handle_p, const acc_pclock_p, const acc_pclock_p); +#endif +ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned); +#if !defined(acc_int64l_t) || defined(ACC_CFG_NO_DOUBLE) +# undef __ACCLIB_UCLOCK_USE_QPC +#elif (ACC_OS_CYGWIN || ACC_OS_EMX || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) +# define __ACCLIB_UCLOCK_USE_QPC 1 +#else +# undef __ACCLIB_UCLOCK_USE_QPC +#endif +typedef struct { + acclib_handle_t h; + int mode; + const char* name; +#if defined(__ACCLIB_UCLOCK_USE_PERFCTR) + acc_perfctr_handle_t pch; +#endif +#if defined(__ACCLIB_UCLOCK_USE_QPC) + double qpf; +#endif +} acc_uclock_handle_t; +typedef struct { + union { + acc_uint32l_t t32; +#if !(ACC_OS_DOS16 || ACC_OS_WIN16) +# if !defined(ACC_CFG_NO_DOUBLE) + double td; +# endif +# if defined(acc_int64l_t) + acc_int64l_t t64; +# endif +#endif + } ticks; +#if defined(__ACCLIB_UCLOCK_USE_RDTSC) + acc_uint64l_t tsc; +#endif +#if defined(__ACCLIB_UCLOCK_USE_PERFCTR) + acc_perfctr_clock_t pcc; +#endif +#if defined(__ACCLIB_UCLOCK_USE_QPC) + acc_int64l_t qpc; +#endif +} acc_uclock_t; +#ifndef acc_uclock_handle_p +#define acc_uclock_handle_p acc_uclock_handle_t * +#endif +#ifndef acc_uclock_p +#define acc_uclock_p acc_uclock_t * +#endif +ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p); +ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p); +ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p); +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p); +#endif +ACCLIB_EXTERN(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p, unsigned); +struct acc_getopt_t; +typedef struct acc_getopt_t acc_getopt_t; +#ifndef acc_getopt_p +#define acc_getopt_p acc_getopt_t * +#endif +struct acc_getopt_longopt_t; +typedef struct acc_getopt_longopt_t acc_getopt_longopt_t; +#ifndef acc_getopt_longopt_p +#define acc_getopt_longopt_p acc_getopt_longopt_t * +#endif +struct acc_getopt_longopt_t { + const char* name; + int has_arg; + int* flag; + int val; +}; +struct acc_getopt_t { + void *user; + char *optarg; + void (*opterr)(acc_getopt_p, const char*, void *); + int optind; + int optopt; + int errcount; + const char* progname; + int argc; char** argv; + int eof; int shortpos; + int pending_rotate_first, pending_rotate_middle; +}; +enum { ACC_GETOPT_NO_ARG, ACC_GETOPT_REQUIRED_ARG, ACC_GETOPT_OPTIONAL_ARG, ACC_GETOPT_EXACT_ARG = 0x10 }; +enum { ACC_GETOPT_PERMUTE, ACC_GETOPT_RETURN_IN_ORDER, ACC_GETOPT_REQUIRE_ORDER }; +ACCLIB_EXTERN(void, acc_getopt_init) (acc_getopt_p g, + int start_argc, int argc, char** argv); +ACCLIB_EXTERN(int, acc_getopt) (acc_getopt_p g, + const char* shortopts, + const acc_getopt_longopt_p longopts, + int* longind); +typedef struct { + acc_uint32l_t seed; +} acc_rand31_t; +#ifndef acc_rand31_p +#define acc_rand31_p acc_rand31_t * +#endif +ACCLIB_EXTERN(void, acc_srand31) (acc_rand31_p, acc_uint32l_t); +ACCLIB_EXTERN(acc_uint32l_t, acc_rand31) (acc_rand31_p); +#if defined(acc_int64l_t) +typedef struct { + acc_uint64l_t seed; +} acc_rand48_t; +#ifndef acc_rand48_p +#define acc_rand48_p acc_rand48_t * +#endif +ACCLIB_EXTERN(void, acc_srand48) (acc_rand48_p, acc_uint32l_t); +ACCLIB_EXTERN(acc_uint32l_t, acc_rand48) (acc_rand48_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p); +#endif +#if defined(acc_int64l_t) +typedef struct { + acc_uint64l_t seed; +} acc_rand64_t; +#ifndef acc_rand64_p +#define acc_rand64_p acc_rand64_t * +#endif +ACCLIB_EXTERN(void, acc_srand64) (acc_rand64_p, acc_uint64l_t); +ACCLIB_EXTERN(acc_uint32l_t, acc_rand64) (acc_rand64_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p); +#endif +typedef struct { + unsigned n; + acc_uint32l_t s[624]; +} acc_randmt_t; +#ifndef acc_randmt_p +#define acc_randmt_p acc_randmt_t * +#endif +ACCLIB_EXTERN(void, acc_srandmt) (acc_randmt_p, acc_uint32l_t); +ACCLIB_EXTERN(acc_uint32l_t, acc_randmt) (acc_randmt_p); +ACCLIB_EXTERN(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p); +#if defined(acc_int64l_t) +typedef struct { + unsigned n; + acc_uint64l_t s[312]; +} acc_randmt64_t; +#ifndef acc_randmt64_p +#define acc_randmt64_p acc_randmt64_t * +#endif +ACCLIB_EXTERN(void, acc_srandmt64) (acc_randmt64_p, acc_uint64l_t); +ACCLIB_EXTERN(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p); +#endif +#define ACC_SPAWN_P_WAIT 0 +#define ACC_SPAWN_P_NOWAIT 1 +ACCLIB_EXTERN(int, acc_spawnv) (int mode, const char* fn, const char* const * argv); +ACCLIB_EXTERN(int, acc_spawnvp) (int mode, const char* fn, const char* const * argv); +ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * argv, const char * const envp); +#endif +#endif +#if defined(ACC_WANT_ACC_CXX_H) +# undef ACC_WANT_ACC_CXX_H +#ifndef __ACC_CXX_H_INCLUDED +#define __ACC_CXX_H_INCLUDED 1 +#if defined(__cplusplus) +#if defined(ACC_CXX_NOTHROW) +#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) +#elif (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450)) +#elif (ACC_CC_HIGHC) +#elif (ACC_CC_MSC && (_MSC_VER < 1100)) +#elif (ACC_CC_NDPC) +#elif (ACC_CC_TURBOC) +#elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND)) +#elif (ACC_CC_ZORTECHC) +#else +# define ACC_CXX_NOTHROW throw() +#endif +#if !defined(ACC_CXX_NOTHROW) +# define ACC_CXX_NOTHROW +#endif +#if defined(__ACC_CXX_DO_NEW) +#elif (ACC_CC_NDPC || ACC_CC_PGI) +# define __ACC_CXX_DO_NEW { return 0; } +#elif ((ACC_CC_BORLANDC || ACC_CC_TURBOC) && ACC_ARCH_I086) +# define __ACC_CXX_DO_NEW { return 0; } +#else +# define __ACC_CXX_DO_NEW ; +#endif +#if defined(__ACC_CXX_DO_DELETE) +#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC) +# define __ACC_CXX_DO_DELETE { } +#else +# define __ACC_CXX_DO_DELETE ACC_CXX_NOTHROW { } +#endif +#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450)) +#elif (ACC_CC_MSC && ACC_MM_HUGE) +# define ACC_CXX_DISABLE_NEW_DELETE private: +#elif (ACC_CC_MSC && (_MSC_VER < 1100)) +#elif (ACC_CC_NDPC) +#elif (ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) +#elif (ACC_CC_TURBOC) +#elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100)) +#else +# define __ACC_CXX_HAVE_ARRAY_NEW 1 +#endif +#if (__ACC_CXX_HAVE_ARRAY_NEW) +# define __ACC_CXX_HAVE_PLACEMENT_NEW 1 +#endif +#if (__ACC_CXX_HAVE_PLACEMENT_NEW) +# if (ACC_CC_GNUC >= 0x030000ul) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# elif (ACC_CC_INTELC) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# elif (ACC_CC_MSC && (_MSC_VER >= 1200)) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# elif (ACC_CC_LLVM || ACC_CC_PATHSCALE) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# elif (ACC_CC_PGI) +# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1 +# endif +#endif +#if defined(ACC_CXX_DISABLE_NEW_DELETE) +#elif defined(new) || defined(delete) +# define ACC_CXX_DISABLE_NEW_DELETE private: +#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025b00ul)) +# define ACC_CXX_DISABLE_NEW_DELETE private: +#elif (ACC_CC_HIGHC) +# define ACC_CXX_DISABLE_NEW_DELETE private: +#elif !defined(__ACC_CXX_HAVE_ARRAY_NEW) +# define ACC_CXX_DISABLE_NEW_DELETE \ + protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \ + protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \ + private: +#else +# define ACC_CXX_DISABLE_NEW_DELETE \ + protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \ + static void operator delete[](void*) __ACC_CXX_DO_DELETE \ + private: static void* operator new(size_t) __ACC_CXX_DO_NEW \ + static void* operator new[](size_t) __ACC_CXX_DO_NEW +#endif +#if defined(ACC_CXX_TRIGGER_FUNCTION) +#else +# define ACC_CXX_TRIGGER_FUNCTION \ + protected: virtual const void* acc_cxx_trigger_function() const; \ + private: +#endif +#if defined(ACC_CXX_TRIGGER_FUNCTION_IMPL) +#else +# define ACC_CXX_TRIGGER_FUNCTION_IMPL(klass) \ + const void* klass::acc_cxx_trigger_function() const { return 0; } +#endif +#endif +#endif +#endif +#if defined(ACC_WANT_ACC_CHK_CH) +# undef ACC_WANT_ACC_CHK_CH +#if !defined(ACCCHK_ASSERT) +# define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr) +#endif +#if !defined(ACCCHK_ASSERT_SIGN_T) +# define ACCCHK_ASSERT_SIGN_T(type,relop) \ + ACCCHK_ASSERT( (type) (-1) relop (type) 0 ) \ + ACCCHK_ASSERT( (type) (~(type)0) relop (type) 0 ) \ + ACCCHK_ASSERT( (type) (~(type)0) == (type) (-1) ) +#endif +#if !defined(ACCCHK_ASSERT_IS_SIGNED_T) +# define ACCCHK_ASSERT_IS_SIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,<) +#endif +#if !defined(ACCCHK_ASSERT_IS_UNSIGNED_T) +# if (ACC_BROKEN_INTEGRAL_PROMOTION) +# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) \ + ACCCHK_ASSERT( (type) (-1) > (type) 0 ) +# else +# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,>) +# endif +#endif +#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550) && (__BORLANDC__ < 0x0560)) +# pragma option push -w-8055 +#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0550)) +# pragma option push -w-osh +#endif +#if (ACC_0xffffffffL - ACC_UINT32_C(4294967294) != 1) +# error "preprocessor error 1" +#endif +#if (ACC_0xffffffffL - ACC_UINT32_C(0xfffffffd) != 2) +# error "preprocessor error 2" +#endif +#define ACCCHK_VAL 1 +#define ACCCHK_TMP1 ACCCHK_VAL +#undef ACCCHK_VAL +#define ACCCHK_VAL 2 +#define ACCCHK_TMP2 ACCCHK_VAL +#if (ACCCHK_TMP1 != 2) +# error "preprocessor error 3a" +#endif +#if (ACCCHK_TMP2 != 2) +# error "preprocessor error 3b" +#endif +#undef ACCCHK_VAL +#if (ACCCHK_TMP2) +# error "preprocessor error 3c" +#endif +#if (ACCCHK_TMP2 + 0 != 0) +# error "preprocessor error 3d" +#endif +#undef ACCCHK_TMP1 +#undef ACCCHK_TMP2 +#if 0 || defined(ACCCHK_CFG_PEDANTIC) +# if (ACC_ARCH_MIPS) && defined(_MIPS_SZINT) + ACCCHK_ASSERT((_MIPS_SZINT) == 8 * sizeof(int)) +# endif +# if (ACC_ARCH_MIPS) && defined(_MIPS_SZLONG) + ACCCHK_ASSERT((_MIPS_SZLONG) == 8 * sizeof(long)) +# endif +# if (ACC_ARCH_MIPS) && defined(_MIPS_SZPTR) + ACCCHK_ASSERT((_MIPS_SZPTR) == 8 * sizeof(void *)) +# endif +#endif + ACCCHK_ASSERT(1 == 1) + ACCCHK_ASSERT(__ACC_MASK_GEN(1u,2) == 3) + ACCCHK_ASSERT(__ACC_MASK_GEN(1u,8) == 255) +#if (SIZEOF_INT >= 2) + ACCCHK_ASSERT(__ACC_MASK_GEN(1,15) == 32767) + ACCCHK_ASSERT(__ACC_MASK_GEN(1u,16) == 0xffffU) +#else + ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,16) == 0xffffUL) +#endif +#if (SIZEOF_INT >= 4) + ACCCHK_ASSERT(__ACC_MASK_GEN(1,31) == 2147483647) + ACCCHK_ASSERT(__ACC_MASK_GEN(1u,32) == 0xffffffffU) +#endif +#if (SIZEOF_LONG >= 4) + ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,32) == 0xffffffffUL) +#endif +#if (SIZEOF_LONG >= 8) + ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,64) == 0xffffffffffffffffUL) +#endif +#if !defined(ACC_BROKEN_INTEGRAL_PROMOTION) + ACCCHK_ASSERT(__ACC_MASK_GEN(1u,SIZEOF_INT*8) == ~0u) + ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul) +#endif +#if !defined(ACC_BROKEN_SIGNED_RIGHT_SHIFT) + ACCCHK_ASSERT(((-1) >> 7) == -1) +#endif + ACCCHK_ASSERT(((1) >> 7) == 0) + ACCCHK_ASSERT((~0l & ~0) == ~0l) + ACCCHK_ASSERT((~0l & ~0u) == ~0u) + ACCCHK_ASSERT((~0ul & ~0) == ~0ul) + ACCCHK_ASSERT((~0ul & ~0u) == ~0u) +#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150) +#elif (SIZEOF_INT == 2) + ACCCHK_ASSERT((~0l & ~0u) == 0xffffU) + ACCCHK_ASSERT((~0ul & ~0u) == 0xffffU) +#elif (SIZEOF_INT == 4) + ACCCHK_ASSERT((~0l & ~0u) == 0xffffffffU) + ACCCHK_ASSERT((~0ul & ~0u) == 0xffffffffU) +#endif + ACCCHK_ASSERT_IS_SIGNED_T(signed char) + ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned char) + ACCCHK_ASSERT(sizeof(signed char) == sizeof(char)) + ACCCHK_ASSERT(sizeof(unsigned char) == sizeof(char)) + ACCCHK_ASSERT(sizeof(char) == 1) +#if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L)) +#else + ACCCHK_ASSERT(sizeof(char) == sizeof((char)0)) +#endif +#if defined(__cplusplus) + ACCCHK_ASSERT(sizeof('\0') == sizeof(char)) +#else +# if (ACC_CC_DMC) +# else + ACCCHK_ASSERT(sizeof('\0') == sizeof(int)) +# endif +#endif +#if defined(__acc_alignof) + ACCCHK_ASSERT(__acc_alignof(char) == 1) + ACCCHK_ASSERT(__acc_alignof(signed char) == 1) + ACCCHK_ASSERT(__acc_alignof(unsigned char) == 1) +#if defined(acc_int16e_t) + ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) >= 1) + ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) <= 2) +#endif +#if defined(acc_int32e_t) + ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) >= 1) + ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) <= 4) +#endif +#endif + ACCCHK_ASSERT_IS_SIGNED_T(short) + ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short) + ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short)) +#if !defined(ACC_ABI_I8LP16) + ACCCHK_ASSERT(sizeof(short) >= 2) +#endif + ACCCHK_ASSERT(sizeof(short) >= sizeof(char)) +#if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L)) +#else + ACCCHK_ASSERT(sizeof(short) == sizeof((short)0)) +#endif +#if (SIZEOF_SHORT > 0) + ACCCHK_ASSERT(sizeof(short) == SIZEOF_SHORT) +#endif + ACCCHK_ASSERT_IS_SIGNED_T(int) + ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int) + ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int)) +#if !defined(ACC_ABI_I8LP16) + ACCCHK_ASSERT(sizeof(int) >= 2) +#endif + ACCCHK_ASSERT(sizeof(int) >= sizeof(short)) + ACCCHK_ASSERT(sizeof(int) == sizeof(0)) + ACCCHK_ASSERT(sizeof(int) == sizeof((int)0)) +#if (SIZEOF_INT > 0) + ACCCHK_ASSERT(sizeof(int) == SIZEOF_INT) +#endif + ACCCHK_ASSERT(sizeof(0) == sizeof(int)) + ACCCHK_ASSERT_IS_SIGNED_T(long) + ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long) + ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long)) +#if !defined(ACC_ABI_I8LP16) + ACCCHK_ASSERT(sizeof(long) >= 4) +#endif + ACCCHK_ASSERT(sizeof(long) >= sizeof(int)) + ACCCHK_ASSERT(sizeof(long) == sizeof(0L)) + ACCCHK_ASSERT(sizeof(long) == sizeof((long)0)) +#if (SIZEOF_LONG > 0) + ACCCHK_ASSERT(sizeof(long) == SIZEOF_LONG) +#endif + ACCCHK_ASSERT(sizeof(0L) == sizeof(long)) + ACCCHK_ASSERT_IS_UNSIGNED_T(size_t) + ACCCHK_ASSERT(sizeof(size_t) >= sizeof(int)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0))) +#if (SIZEOF_SIZE_T > 0) + ACCCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T) +#endif + ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t) + ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int)) + ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t)) +#if !defined(ACC_BROKEN_SIZEOF) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0)) +# if (ACC_HAVE_MM_HUGE_PTR) + ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0)) +# endif +#endif +#if (SIZEOF_PTRDIFF_T > 0) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T) +#endif + ACCCHK_ASSERT(sizeof(void*) >= sizeof(char*)) +#if (SIZEOF_VOID_P > 0) + ACCCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P) + ACCCHK_ASSERT(sizeof(char*) == SIZEOF_VOID_P) +#endif +#if (ACC_HAVE_MM_HUGE_PTR) + ACCCHK_ASSERT(4 == sizeof(void __huge*)) + ACCCHK_ASSERT(4 == sizeof(char __huge*)) +#endif +#if defined(ACC_ABI_I8LP16) + ACCCHK_ASSERT((((1u << 7) + 1) >> 7) == 1) + ACCCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1) +#else + ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1) + ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1) +#endif +#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150) +#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) +#else + ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0) +#endif + ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0) +#if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) +#else + ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0) +#endif + ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0) +#if defined(acc_int16e_t) + ACCCHK_ASSERT(sizeof(acc_int16e_t) == 2) + ACCCHK_ASSERT(sizeof(acc_int16e_t) == SIZEOF_ACC_INT16E_T) + ACCCHK_ASSERT(sizeof(acc_uint16e_t) == 2) + ACCCHK_ASSERT(sizeof(acc_int16e_t) == sizeof(acc_uint16e_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int16e_t) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint16e_t) +#if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150) +#else + ACCCHK_ASSERT(((acc_uint16e_t)(~(acc_uint16e_t)0ul) >> 15) == 1) +#endif + ACCCHK_ASSERT( (acc_int16e_t) (1 + ~(acc_int16e_t)0) == 0) +#if defined(ACCCHK_CFG_PEDANTIC) + ACCCHK_ASSERT( (acc_uint16e_t)(1 + ~(acc_uint16e_t)0) == 0) +#endif +#endif +#if defined(acc_int32e_t) + ACCCHK_ASSERT(sizeof(acc_int32e_t) == 4) + ACCCHK_ASSERT(sizeof(acc_int32e_t) == SIZEOF_ACC_INT32E_T) + ACCCHK_ASSERT(sizeof(acc_uint32e_t) == 4) + ACCCHK_ASSERT(sizeof(acc_int32e_t) == sizeof(acc_uint32e_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int32e_t) + ACCCHK_ASSERT(((( (acc_int32e_t)1 << 30) + 1) >> 30) == 1) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32e_t) + ACCCHK_ASSERT(((( (acc_uint32e_t)1 << 31) + 1) >> 31) == 1) + ACCCHK_ASSERT(((acc_uint32e_t)(~(acc_uint32e_t)0ul) >> 31) == 1) + ACCCHK_ASSERT( (acc_int32e_t) (1 + ~(acc_int32e_t)0) == 0) +#if defined(ACCCHK_CFG_PEDANTIC) + ACCCHK_ASSERT( (acc_uint32e_t)(1 + ~(acc_uint32e_t)0) == 0) +#endif +#endif +#if defined(acc_int32e_t) + ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(acc_int32e_t)) +#endif + ACCCHK_ASSERT(sizeof(acc_int32l_t) >= 4) + ACCCHK_ASSERT(sizeof(acc_int32l_t) == SIZEOF_ACC_INT32L_T) + ACCCHK_ASSERT(sizeof(acc_uint32l_t) >= 4) + ACCCHK_ASSERT(sizeof(acc_int32l_t) == sizeof(acc_uint32l_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int32l_t) + ACCCHK_ASSERT(((( (acc_int32l_t)1 << 30) + 1) >> 30) == 1) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32l_t) + ACCCHK_ASSERT(((( (acc_uint32l_t)1 << 31) + 1) >> 31) == 1) + ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(int)) +#if defined(acc_int32e_t) + ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32e_t)) +#endif + ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t)) + ACCCHK_ASSERT(sizeof(acc_int32f_t) >= 4) + ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t)) + ACCCHK_ASSERT(sizeof(acc_int32f_t) == SIZEOF_ACC_INT32F_T) + ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= 4) + ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= sizeof(acc_uint32l_t)) + ACCCHK_ASSERT(sizeof(acc_int32f_t) == sizeof(acc_uint32f_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int32f_t) + ACCCHK_ASSERT(((( (acc_int32f_t)1 << 30) + 1) >> 30) == 1) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32f_t) + ACCCHK_ASSERT(((( (acc_uint32f_t)1 << 31) + 1) >> 31) == 1) +#if defined(acc_int64e_t) + ACCCHK_ASSERT(sizeof(acc_int64e_t) == 8) + ACCCHK_ASSERT(sizeof(acc_int64e_t) == SIZEOF_ACC_INT64E_T) + ACCCHK_ASSERT(sizeof(acc_uint64e_t) == 8) + ACCCHK_ASSERT(sizeof(acc_int64e_t) == sizeof(acc_uint64e_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int64e_t) +#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530)) +#else + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64e_t) +#endif +#endif +#if defined(acc_int64l_t) +#if defined(acc_int64e_t) + ACCCHK_ASSERT(sizeof(acc_int64l_t) >= sizeof(acc_int64e_t)) +#endif + ACCCHK_ASSERT(sizeof(acc_int64l_t) >= 8) + ACCCHK_ASSERT(sizeof(acc_int64l_t) == SIZEOF_ACC_INT64L_T) + ACCCHK_ASSERT(sizeof(acc_uint64l_t) >= 8) + ACCCHK_ASSERT(sizeof(acc_int64l_t) == sizeof(acc_uint64l_t)) + ACCCHK_ASSERT_IS_SIGNED_T(acc_int64l_t) + ACCCHK_ASSERT(((( (acc_int64l_t)1 << 62) + 1) >> 62) == 1) + ACCCHK_ASSERT(((( ACC_INT64_C(1) << 62) + 1) >> 62) == 1) +#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530)) +#else + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64l_t) + ACCCHK_ASSERT(ACC_UINT64_C(18446744073709551615) > 0) +#endif + ACCCHK_ASSERT(((( (acc_uint64l_t)1 << 63) + 1) >> 63) == 1) + ACCCHK_ASSERT(((( ACC_UINT64_C(1) << 63) + 1) >> 63) == 1) +#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020600ul)) + ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > ACC_INT64_C(0)) +#else + ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > 0) +#endif + ACCCHK_ASSERT(ACC_INT64_C(-9223372036854775807) - 1 < 0) + ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483629) == 721) + ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483647) == 1) + ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483629) == 721) + ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483647) == 1) +#endif +#if !defined(__ACC_INTPTR_T_IS_POINTER) + ACCCHK_ASSERT_IS_SIGNED_T(acc_intptr_t) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uintptr_t) +#endif + ACCCHK_ASSERT(sizeof(acc_intptr_t) >= sizeof(void *)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == SIZEOF_ACC_INTPTR_T) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(acc_uintptr_t)) +#if defined(acc_word_t) + ACCCHK_ASSERT(ACC_WORDSIZE == SIZEOF_ACC_WORD_T) + ACCCHK_ASSERT_IS_UNSIGNED_T(acc_word_t) + ACCCHK_ASSERT_IS_SIGNED_T(acc_sword_t) + ACCCHK_ASSERT(sizeof(acc_word_t) == SIZEOF_ACC_WORD_T) + ACCCHK_ASSERT(sizeof(acc_word_t) == sizeof(acc_sword_t)) +#endif +#if defined(ACC_INT16_C) + ACCCHK_ASSERT(sizeof(ACC_INT16_C(0)) >= 2) + ACCCHK_ASSERT(sizeof(ACC_UINT16_C(0)) >= 2) + ACCCHK_ASSERT((ACC_UINT16_C(0xffff) >> 15) == 1) +#endif +#if defined(ACC_INT32_C) + ACCCHK_ASSERT(sizeof(ACC_INT32_C(0)) >= 4) + ACCCHK_ASSERT(sizeof(ACC_UINT32_C(0)) >= 4) + ACCCHK_ASSERT((ACC_UINT32_C(0xffffffff) >> 31) == 1) +#endif +#if defined(ACC_INT64_C) +#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0560)) +#else + ACCCHK_ASSERT(sizeof(ACC_INT64_C(0)) >= 8) + ACCCHK_ASSERT(sizeof(ACC_UINT64_C(0)) >= 8) +#endif + ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) >> 63) == 1) + ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0) == ACC_UINT64_C(0xffffffffffffffff)) + ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0l) == ACC_UINT64_C(0xffffffffffffffff)) +#if (SIZEOF_INT == 4) +# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul)) +# else + ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0u) == 0xffffffffu) +# endif +#endif +#if (SIZEOF_LONG == 4) +# if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul)) +# else + ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0ul) == 0xfffffffful) +# endif +#endif +#endif +#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM) + ACCCHK_ASSERT(sizeof(void*) == 2) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == 2) +#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE) + ACCCHK_ASSERT(sizeof(void*) == 4) +#endif +#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_COMPACT) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 2) +#elif (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 4) +#endif +#if (ACC_ABI_ILP32) + ACCCHK_ASSERT(sizeof(int) == 4) + ACCCHK_ASSERT(sizeof(long) == 4) + ACCCHK_ASSERT(sizeof(void*) == 4) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ABI_ILP64) + ACCCHK_ASSERT(sizeof(int) == 8) + ACCCHK_ASSERT(sizeof(long) == 8) + ACCCHK_ASSERT(sizeof(void*) == 8) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ABI_IP32L64) + ACCCHK_ASSERT(sizeof(int) == 4) + ACCCHK_ASSERT(sizeof(long) == 8) + ACCCHK_ASSERT(sizeof(void*) == 4) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ABI_LLP64) + ACCCHK_ASSERT(sizeof(int) == 4) + ACCCHK_ASSERT(sizeof(long) == 4) + ACCCHK_ASSERT(sizeof(void*) == 8) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ABI_LP32) + ACCCHK_ASSERT(sizeof(int) == 2) + ACCCHK_ASSERT(sizeof(long) == 4) + ACCCHK_ASSERT(sizeof(void*) == 4) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ABI_LP64) + ACCCHK_ASSERT(sizeof(int) == 4) + ACCCHK_ASSERT(sizeof(long) == 8) + ACCCHK_ASSERT(sizeof(void*) == 8) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*)) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_ARCH_I086) + ACCCHK_ASSERT(sizeof(size_t) == 2) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#elif (ACC_ARCH_I386 || ACC_ARCH_M68K) + ACCCHK_ASSERT(sizeof(size_t) == 4) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4) + ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *)) +#endif +#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32) + ACCCHK_ASSERT(sizeof(size_t) == 4) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 4) +#elif (ACC_OS_WIN64) + ACCCHK_ASSERT(sizeof(size_t) == 8) + ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8) + ACCCHK_ASSERT(sizeof(void (*)(void)) == 8) +#endif +#if (ACC_CC_NDPC) +#elif (SIZEOF_INT > 1) + ACCCHK_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255) +#endif +#if (ACC_CC_KEILC) +#elif (ACC_CC_NDPC) +#elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC) +#elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC) +#elif !defined(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1) + ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0) +#endif +#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560)) +# pragma option pop +#endif +#endif +#if defined(ACC_WANT_ACCLIB_UA) +# undef ACC_WANT_ACCLIB_UA +#define __ACCLIB_UA_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +ACCLIB_PUBLIC(unsigned, acc_ua_get_be16) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_BE16) + return ACC_UA_GET_BE16(p); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((unsigned)b[1]) | ((unsigned)b[0] << 8); +#endif +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p p) +{ + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint32l_t)b[2]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[0] << 16); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_BE32) + return ACC_UA_GET_BE32(p); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_be16) (acc_hvoid_p p, unsigned v) +{ +#if defined(ACC_UA_SET_BE16) + ACC_UA_SET_BE16(p, v); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + b[1] = (unsigned char) ((v >> 0) & 0xff); + b[0] = (unsigned char) ((v >> 8) & 0xff); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_be24) (acc_hvoid_p p, acc_uint32l_t v) +{ + acc_hbyte_p b = (acc_hbyte_p) p; + b[2] = (unsigned char) ((v >> 0) & 0xff); + b[1] = (unsigned char) ((v >> 8) & 0xff); + b[0] = (unsigned char) ((v >> 16) & 0xff); +} +ACCLIB_PUBLIC(void, acc_ua_set_be32) (acc_hvoid_p p, acc_uint32l_t v) +{ +#if defined(ACC_UA_SET_BE32) + ACC_UA_SET_BE32(p, v); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + b[3] = (unsigned char) ((v >> 0) & 0xff); + b[2] = (unsigned char) ((v >> 8) & 0xff); + b[1] = (unsigned char) ((v >> 16) & 0xff); + b[0] = (unsigned char) ((v >> 24) & 0xff); +#endif +} +ACCLIB_PUBLIC(unsigned, acc_ua_get_le16) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_LE16) + return ACC_UA_GET_LE16(p); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((unsigned)b[0]) | ((unsigned)b[1] << 8); +#endif +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p p) +{ + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_LE32) + return ACC_UA_GET_LE32(p); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_le16) (acc_hvoid_p p, unsigned v) +{ +#if defined(ACC_UA_SET_LE16) + ACC_UA_SET_LE16(p, v); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + b[0] = (unsigned char) ((v >> 0) & 0xff); + b[1] = (unsigned char) ((v >> 8) & 0xff); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_le24) (acc_hvoid_p p, acc_uint32l_t v) +{ + acc_hbyte_p b = (acc_hbyte_p) p; + b[0] = (unsigned char) ((v >> 0) & 0xff); + b[1] = (unsigned char) ((v >> 8) & 0xff); + b[2] = (unsigned char) ((v >> 16) & 0xff); +} +ACCLIB_PUBLIC(void, acc_ua_set_le32) (acc_hvoid_p p, acc_uint32l_t v) +{ +#if defined(ACC_UA_SET_LE32) + ACC_UA_SET_LE32(p, v); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + b[0] = (unsigned char) ((v >> 0) & 0xff); + b[1] = (unsigned char) ((v >> 8) & 0xff); + b[2] = (unsigned char) ((v >> 16) & 0xff); + b[3] = (unsigned char) ((v >> 24) & 0xff); +#endif +} +#if defined(acc_int64l_t) +ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_BE64) + return ACC_UA_GET_BE64(p); +#elif defined(ACC_UA_GET_BE32) + const acc_hbyte_p b = (const acc_hbyte_p) p; + acc_uint32e_t v0, v1; + v1 = ACC_UA_GET_BE32(b + 0); + v0 = ACC_UA_GET_BE32(b + 4); + return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32); +#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8) + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint64l_t)b[7]) | ((acc_uint64l_t)b[6] << 8) | ((acc_uint64l_t)b[5] << 16) | ((acc_uint64l_t)b[4] << 24) | ((acc_uint64l_t)b[3] << 32) | ((acc_uint64l_t)b[2] << 40) | ((acc_uint64l_t)b[1] << 48) | ((acc_uint64l_t)b[0] << 56); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + acc_uint32l_t v0, v1; + v1 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24); + b += 4; + v0 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24); + return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_be64) (acc_hvoid_p p, acc_uint64l_t v) +{ +#if defined(ACC_UA_SET_BE64) + ACC_UA_SET_BE64(p, v); +#elif defined(ACC_UA_SET_BE32) + acc_hbyte_p b = (acc_hbyte_p) p; + ACC_UA_SET_BE32(b + 4, (v >> 0)); + ACC_UA_SET_BE32(b + 0, (v >> 32)); +#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8) + acc_hbyte_p b = (acc_hbyte_p) p; + b[7] = (unsigned char) ((v >> 0) & 0xff); + b[6] = (unsigned char) ((v >> 8) & 0xff); + b[5] = (unsigned char) ((v >> 16) & 0xff); + b[4] = (unsigned char) ((v >> 24) & 0xff); + b[3] = (unsigned char) ((v >> 32) & 0xff); + b[2] = (unsigned char) ((v >> 40) & 0xff); + b[1] = (unsigned char) ((v >> 48) & 0xff); + b[0] = (unsigned char) ((v >> 56) & 0xff); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + acc_uint32l_t x; + x = (acc_uint32l_t) (v >> 0); + b[7] = (unsigned char) ((x >> 0) & 0xff); + b[6] = (unsigned char) ((x >> 8) & 0xff); + b[5] = (unsigned char) ((x >> 16) & 0xff); + b[4] = (unsigned char) ((x >> 24) & 0xff); + x = (acc_uint32l_t) (v >> 32); + b[3] = (unsigned char) ((x >> 0) & 0xff); + b[2] = (unsigned char) ((x >> 8) & 0xff); + b[1] = (unsigned char) ((x >> 16) & 0xff); + b[0] = (unsigned char) ((x >> 24) & 0xff); +#endif +} +#endif +#if defined(acc_int64l_t) +ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p p) +{ +#if defined(ACC_UA_GET_LE64) + return ACC_UA_GET_LE64(p); +#elif defined(ACC_UA_GET_LE32) + const acc_hbyte_p b = (const acc_hbyte_p) p; + acc_uint32e_t v0, v1; + v0 = ACC_UA_GET_LE32(b + 0); + v1 = ACC_UA_GET_LE32(b + 4); + return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32); +#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8) + const acc_hbyte_p b = (const acc_hbyte_p) p; + return ((acc_uint64l_t)b[0]) | ((acc_uint64l_t)b[1] << 8) | ((acc_uint64l_t)b[2] << 16) | ((acc_uint64l_t)b[3] << 24) | ((acc_uint64l_t)b[4] << 32) | ((acc_uint64l_t)b[5] << 40) | ((acc_uint64l_t)b[6] << 48) | ((acc_uint64l_t)b[7] << 56); +#else + const acc_hbyte_p b = (const acc_hbyte_p) p; + acc_uint32l_t v0, v1; + v0 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24); + b += 4; + v1 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24); + return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32); +#endif +} +ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v) +{ +#if defined(ACC_UA_SET_LE64) + ACC_UA_SET_LE64(p, v); +#elif defined(ACC_UA_SET_LE32) + acc_hbyte_p b = (acc_hbyte_p) p; + ACC_UA_SET_LE32(b + 0, (v >> 0)); + ACC_UA_SET_LE32(b + 4, (v >> 32)); +#elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8) + acc_hbyte_p b = (acc_hbyte_p) p; + b[0] = (unsigned char) ((v >> 0) & 0xff); + b[1] = (unsigned char) ((v >> 8) & 0xff); + b[2] = (unsigned char) ((v >> 16) & 0xff); + b[3] = (unsigned char) ((v >> 24) & 0xff); + b[4] = (unsigned char) ((v >> 32) & 0xff); + b[5] = (unsigned char) ((v >> 40) & 0xff); + b[6] = (unsigned char) ((v >> 48) & 0xff); + b[7] = (unsigned char) ((v >> 56) & 0xff); +#else + acc_hbyte_p b = (acc_hbyte_p) p; + acc_uint32l_t x; + x = (acc_uint32l_t) (v >> 0); + b[0] = (unsigned char) ((x >> 0) & 0xff); + b[1] = (unsigned char) ((x >> 8) & 0xff); + b[2] = (unsigned char) ((x >> 16) & 0xff); + b[3] = (unsigned char) ((x >> 24) & 0xff); + x = (acc_uint32l_t) (v >> 32); + b[4] = (unsigned char) ((x >> 0) & 0xff); + b[5] = (unsigned char) ((x >> 8) & 0xff); + b[6] = (unsigned char) ((x >> 16) & 0xff); + b[7] = (unsigned char) ((x >> 24) & 0xff); +#endif +} +#endif +#endif +#if defined(ACC_WANT_ACCLIB_VGET) +# undef ACC_WANT_ACCLIB_VGET +#define __ACCLIB_VGET_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if !defined(ACCLIB_PUBLIC_NOINLINE) +# if !defined(__acc_noinline) +# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f) +# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM) +# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f) +# else +# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f) +# endif +#endif +#if (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM) +extern void* volatile __acc_vget_ptr; +void* volatile __attribute__((__used__)) __acc_vget_ptr = (void *) 0; +#else +extern void* volatile __acc_vget_ptr; +void* volatile __acc_vget_ptr = (void *) 0; +#endif +#ifndef __ACCLIB_VGET_BODY +#define __ACCLIB_VGET_BODY(T) \ + if __acc_unlikely(__acc_vget_ptr) { \ + * (T *) __acc_vget_ptr = v; \ + * (int *) __acc_vget_ptr = expr; \ + v = * (T *) __acc_vget_ptr; \ + } \ + return v; +#endif +ACCLIB_PUBLIC_NOINLINE(short, acc_vget_short) (short v, int expr) +{ + __ACCLIB_VGET_BODY(short) +} +ACCLIB_PUBLIC_NOINLINE(int, acc_vget_int) (int v, int expr) +{ + __ACCLIB_VGET_BODY(int) +} +ACCLIB_PUBLIC_NOINLINE(long, acc_vget_long) (long v, int expr) +{ + __ACCLIB_VGET_BODY(long) +} +#if defined(acc_int64l_t) +ACCLIB_PUBLIC_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t v, int expr) +{ + __ACCLIB_VGET_BODY(acc_int64l_t) +} +#endif +ACCLIB_PUBLIC_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t v, int expr) +{ + __ACCLIB_VGET_BODY(acc_hsize_t) +} +#if !defined(ACC_CFG_NO_FLOAT) +ACCLIB_PUBLIC_NOINLINE(float, acc_vget_float) (float v, int expr) +{ + __ACCLIB_VGET_BODY(float) +} +#endif +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_PUBLIC_NOINLINE(double, acc_vget_double) (double v, int expr) +{ + __ACCLIB_VGET_BODY(double) +} +#endif +ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p v, int expr) +{ + __ACCLIB_VGET_BODY(acc_hvoid_p) +} +#if (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) && !defined(__cplusplus) +ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p vv, int expr) +{ + acc_hvoid_p v = (acc_hvoid_p) vv; + __ACCLIB_VGET_BODY(acc_hvoid_p) +} +#else +ACCLIB_PUBLIC_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p v, int expr) +{ + __ACCLIB_VGET_BODY(const acc_hvoid_p) +} +#endif +#endif +#if defined(ACC_WANT_ACCLIB_HMEMCPY) +# undef ACC_WANT_ACCLIB_HMEMCPY +#define __ACCLIB_HMEMCPY_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc_hsize_t len) +{ +#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP) + const acc_hbyte_p p1 = (const acc_hbyte_p) s1; + const acc_hbyte_p p2 = (const acc_hbyte_p) s2; + if __acc_likely(len > 0) do + { + int d = *p1 - *p2; + if (d != 0) + return d; + p1++; p2++; + } while __acc_likely(--len > 0); + return 0; +#else + return memcmp(s1, s2, len); +#endif +} +ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len) +{ +#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY) + acc_hbyte_p p1 = (acc_hbyte_p) dest; + const acc_hbyte_p p2 = (const acc_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + do + *p1++ = *p2++; + while __acc_likely(--len > 0); + return dest; +#else + return memcpy(dest, src, len); +#endif +} +ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len) +{ +#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE) + acc_hbyte_p p1 = (acc_hbyte_p) dest; + const acc_hbyte_p p2 = (const acc_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + if (p1 < p2) + { + do + *p1++ = *p2++; + while __acc_likely(--len > 0); + } + else + { + p1 += len; + p2 += len; + do + *--p1 = *--p2; + while __acc_likely(--len > 0); + } + return dest; +#else + return memmove(dest, src, len); +#endif +} +ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemset) (acc_hvoid_p s, int c, acc_hsize_t len) +{ +#if (ACC_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET) + acc_hbyte_p p = (acc_hbyte_p) s; + if __acc_likely(len > 0) do + *p++ = (unsigned char) c; + while __acc_likely(--len > 0); + return s; +#else + return memset(s, c, len); +#endif +} +#endif +#if defined(ACC_WANT_ACCLIB_RAND) +# undef ACC_WANT_ACCLIB_RAND +#define __ACCLIB_RAND_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +ACCLIB_PUBLIC(void, acc_srand31) (acc_rand31_p r, acc_uint32l_t seed) +{ + r->seed = seed & ACC_UINT32_C(0xffffffff); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_rand31) (acc_rand31_p r) +{ + r->seed = r->seed * ACC_UINT32_C(1103515245) + 12345; + r->seed &= ACC_UINT32_C(0x7fffffff); + return r->seed; +} +#if defined(acc_int64l_t) +ACCLIB_PUBLIC(void, acc_srand48) (acc_rand48_p r, acc_uint32l_t seed) +{ + r->seed = seed & ACC_UINT32_C(0xffffffff); + r->seed <<= 16; r->seed |= 0x330e; +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48) (acc_rand48_p r) +{ + r->seed = r->seed * ACC_UINT64_C(25214903917) + 11; + r->seed &= ACC_UINT64_C(0xffffffffffff); + return (acc_uint32l_t) (r->seed >> 17); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p r) +{ + r->seed = r->seed * ACC_UINT64_C(25214903917) + 11; + r->seed &= ACC_UINT64_C(0xffffffffffff); + return (acc_uint32l_t) (r->seed >> 16); +} +#endif +#if defined(acc_int64l_t) +ACCLIB_PUBLIC(void, acc_srand64) (acc_rand64_p r, acc_uint64l_t seed) +{ + r->seed = seed & ACC_UINT64_C(0xffffffffffffffff); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64) (acc_rand64_p r) +{ + r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1; +#if (ACC_SIZEOF_ACC_INT64L_T > 8) + r->seed &= ACC_UINT64_C(0xffffffffffffffff); +#endif + return (acc_uint32l_t) (r->seed >> 33); +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p r) +{ + r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1; +#if (ACC_SIZEOF_ACC_INT64L_T > 8) + r->seed &= ACC_UINT64_C(0xffffffffffffffff); +#endif + return (acc_uint32l_t) (r->seed >> 32); +} +#endif +ACCLIB_PUBLIC(void, acc_srandmt) (acc_randmt_p r, acc_uint32l_t seed) +{ + unsigned i = 0; + do { + r->s[i++] = (seed &= ACC_UINT32_C(0xffffffff)); + seed ^= seed >> 30; + seed = seed * ACC_UINT32_C(0x6c078965) + i; + } while (i != 624); + r->n = i; +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt) (acc_randmt_p r) +{ + return (__ACCLIB_FUNCNAME(acc_randmt_r32)(r)) >> 1; +} +ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r) +{ + acc_uint32l_t v; + if __acc_unlikely(r->n == 624) { + int i = 0, j; + r->n = 0; + do { + j = i - 623; if (j < 0) j += 624; + v = (r->s[i] & ACC_UINT32_C(0x80000000)) ^ (r->s[j] & ACC_UINT32_C(0x7fffffff)); + j = i - 227; if (j < 0) j += 624; + r->s[i] = r->s[j] ^ (v >> 1); + if (v & 1) r->s[i] ^= ACC_UINT32_C(0x9908b0df); + } while (++i != 624); + } + v = r->s[r->n++]; + v ^= v >> 11; v ^= (v & ACC_UINT32_C(0x013a58ad)) << 7; + v ^= (v & ACC_UINT32_C(0x0001df8c)) << 15; v ^= v >> 18; + return v; +} +#if defined(acc_int64l_t) +ACCLIB_PUBLIC(void, acc_srandmt64) (acc_randmt64_p r, acc_uint64l_t seed) +{ + unsigned i = 0; + do { + r->s[i++] = (seed &= ACC_UINT64_C(0xffffffffffffffff)); + seed ^= seed >> 62; + seed = seed * ACC_UINT64_C(0x5851f42d4c957f2d) + i; + } while (i != 312); + r->n = i; +} +#if 0 +ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt64) (acc_randmt64_p r) +{ + acc_uint64l_t v; + v = (__ACCLIB_FUNCNAME(acc_randmt64_r64)(r)) >> 33; + return (acc_uint32l_t) v; +} +#endif +ACCLIB_PUBLIC(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p r) +{ + acc_uint64l_t v; + if __acc_unlikely(r->n == 312) { + int i = 0, j; + r->n = 0; + do { + j = i - 311; if (j < 0) j += 312; + v = (r->s[i] & ACC_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & ACC_UINT64_C(0x7fffffff)); + j = i - 156; if (j < 0) j += 312; + r->s[i] = r->s[j] ^ (v >> 1); + if (v & 1) r->s[i] ^= ACC_UINT64_C(0xb5026f5aa96619e9); + } while (++i != 312); + } + v = r->s[r->n++]; + v ^= (v & ACC_UINT64_C(0xaaaaaaaaa0000000)) >> 29; + v ^= (v & ACC_UINT64_C(0x38eb3ffff6d3)) << 17; + v ^= (v & ACC_UINT64_C(0x7ffbf77)) << 37; + return v ^ (v >> 43); +} +#endif +#endif +#if defined(ACC_WANT_ACCLIB_RDTSC) +# undef ACC_WANT_ACCLIB_RDTSC +#define __ACCLIB_RDTSC_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if defined(acc_int32e_t) +#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(push) +# pragma warn(disable:2007) +#endif +#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) +#if (ACC_ARCH_AMD64 && ACC_CC_PATHSCALE) +# define __ACCLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "rax", "rdx" +#elif (ACC_ARCH_AMD64 && ACC_CC_INTELC) +# define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "rax", "rdx" +#elif (ACC_ARCH_AMD64) +# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "rax", "rdx" +#elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul)) +# define __ACCLIB_RDTSC_REGS : : "r" (t) : "ax", "dx" +#elif (ACC_ARCH_I386 && ACC_CC_INTELC) +# define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "eax", "edx" +#elif (ACC_ARCH_I386 && ACC_CC_PATHSCALE) +# define __ACCLIB_RDTSC_REGS : : "c" (t) : "memory", "eax", "edx" +#else +# define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx" +#endif +#endif +ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t) +{ +#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) + __asm__ __volatile__( + "clc \n" ".byte 0x0f,0x31\n" + "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n" + __ACCLIB_RDTSC_REGS + ); + return 0; +#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC) + ACC_UNUSED(t); + __asm { + mov ecx, t + clc +# if (ACC_CC_MSC && (_MSC_VER < 1200)) + _emit 0x0f + _emit 0x31 +# else + rdtsc +# endif + mov [ecx], eax + mov [ecx+4], edx + } + return 0; +#else + t[0] = t[1] = 0; return -1; +#endif +} +#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(pop) +#endif +#endif +#endif +#if defined(ACC_WANT_ACCLIB_DOSALLOC) +# undef ACC_WANT_ACCLIB_DOSALLOC +#define __ACCLIB_DOSALLOC_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if (ACC_OS_OS216) +ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short); +ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short); +#endif +#if (ACC_OS_DOS16 || ACC_OS_WIN16) +#if !defined(ACC_CC_AZTECC) +ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size) +{ + void __far* p = 0; + union REGS ri, ro; + if ((long)size <= 0) + return p; + size = (size + 15) >> 4; + if (size > 0xffffu) + return p; + ri.x.ax = 0x4800; + ri.x.bx = (unsigned short) size; + int86(0x21, &ri, &ro); + if ((ro.x.cflag & 1) == 0) + p = (void __far*) ACC_PTR_MK_FP(ro.x.ax, 0); + return p; +} +ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p) +{ + union REGS ri, ro; + struct SREGS rs; + if (!p) + return 0; + if (ACC_PTR_FP_OFF(p) != 0) + return -1; + segread(&rs); + ri.x.ax = 0x4900; + rs.es = ACC_PTR_FP_SEG(p); + int86x(0x21, &ri, &ro, &rs); + if (ro.x.cflag & 1) + return -1; + return 0; +} +#endif +#endif +#if (ACC_OS_OS216) +ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size) +{ + void __far* p = 0; + unsigned short sel = 0; + if ((long)size <= 0) + return p; + if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0) + p = (void __far*) ACC_PTR_MK_FP(sel, 0); + return p; +} +ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p) +{ + if (!p) + return 0; + if (ACC_PTR_FP_OFF(p) != 0) + return -1; + if (DosFreeSeg(ACC_PTR_FP_SEG(p)) != 0) + return -1; + return 0; +} +#endif +#endif +#if defined(ACC_WANT_ACCLIB_HALLOC) +# undef ACC_WANT_ACCLIB_HALLOC +#define __ACCLIB_HALLOC_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if (ACC_HAVE_MM_HUGE_PTR) +#if 1 && (ACC_OS_DOS16 && defined(BLX286)) +# define __ACCLIB_HALLOC_USE_DAH 1 +#elif 1 && (ACC_OS_DOS16 && defined(DOSX286)) +# define __ACCLIB_HALLOC_USE_DAH 1 +#elif 1 && (ACC_OS_OS216) +# define __ACCLIB_HALLOC_USE_DAH 1 +#elif 1 && (ACC_OS_WIN16) +# define __ACCLIB_HALLOC_USE_GA 1 +#elif 1 && (ACC_OS_DOS16) && (ACC_CC_BORLANDC) && defined(__DPMI16__) +# define __ACCLIB_HALLOC_USE_GA 1 +#endif +#endif +#if (__ACCLIB_HALLOC_USE_DAH) +#if 0 && (ACC_OS_OS216) +#include +#else +ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short); +ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short); +#endif +#endif +#if (__ACCLIB_HALLOC_USE_GA) +#if 0 +#define STRICT 1 +#include +#else +ACC_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long); +ACC_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*); +ACC_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned); +ACC_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*); +ACC_EXTERN_C int __far __pascal GlobalUnlock(const void __near*); +#endif +#endif +ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size) +{ + acc_hvoid_p p = 0; + if (!(size > 0)) + return p; +#if 0 && defined(__palmos__) + p = MemPtrNew(size); +#elif !defined(ACC_HAVE_MM_HUGE_PTR) + if (size < (size_t) -1) + p = malloc((size_t) size); +#else + if ((long)size <= 0) + return p; +{ +#if (__ACCLIB_HALLOC_USE_DAH) + unsigned short sel = 0; + if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0) + p = (acc_hvoid_p) ACC_PTR_MK_FP(sel, 0); +#elif (__ACCLIB_HALLOC_USE_GA) + const void __near* h = GlobalAlloc(2, size); + if (h) { + p = GlobalLock(h); + if (p && ACC_PTR_FP_OFF(p) != 0) { + GlobalUnlock(h); + p = 0; + } + if (!p) + GlobalFree(h); + } +#elif (ACC_CC_MSC && (_MSC_VER >= 700)) + p = _halloc(size, 1); +#elif (ACC_CC_MSC || ACC_CC_WATCOMC) + p = halloc(size, 1); +#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) + p = farmalloc(size); +#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC) + p = farmalloc(size); +#elif defined(ACC_CC_AZTECC) + p = lmalloc(size); +#else + if (size < (size_t) -1) + p = malloc((size_t) size); +#endif +} +#endif + return p; +} +ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p) +{ + if (!p) + return; +#if 0 && defined(__palmos__) + MemPtrFree(p); +#elif !defined(ACC_HAVE_MM_HUGE_PTR) + free(p); +#else +#if (__ACCLIB_HALLOC_USE_DAH) + if (ACC_PTR_FP_OFF(p) == 0) + DosFreeSeg((unsigned short) ACC_PTR_FP_SEG(p)); +#elif (__ACCLIB_HALLOC_USE_GA) + if (ACC_PTR_FP_OFF(p) == 0) { + const void __near* h = (const void __near*) (unsigned) GlobalHandle(ACC_PTR_FP_SEG(p)); + if (h) { + GlobalUnlock(h); + GlobalFree(h); + } + } +#elif (ACC_CC_MSC && (_MSC_VER >= 700)) + _hfree(p); +#elif (ACC_CC_MSC || ACC_CC_WATCOMC) + hfree(p); +#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC) + farfree((void __far*) p); +#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC) + farfree((void __far*) p); +#elif defined(ACC_CC_AZTECC) + lfree(p); +#else + free(p); +#endif +#endif +} +#endif +#if defined(ACC_WANT_ACCLIB_HFREAD) +# undef ACC_WANT_ACCLIB_HFREAD +#define __ACCLIB_HFREAD_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +ACCLIB_PUBLIC(acc_hsize_t, acc_hfread) (void* vfp, acc_hvoid_p buf, acc_hsize_t size) +{ + FILE* fp = (FILE *) vfp; +#if (ACC_HAVE_MM_HUGE_PTR) +#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM) +#define __ACCLIB_REQUIRE_HMEMCPY_CH 1 + unsigned char tmp[512]; + acc_hsize_t l = 0; + while (l < size) + { + size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l); + n = fread(tmp, 1, n, fp); + if (n == 0) + break; + __ACCLIB_FUNCNAME(acc_hmemcpy)((acc_hbyte_p)buf + l, tmp, (acc_hsize_t)n); + l += n; + } + return l; +#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE) + acc_hbyte_p b = (acc_hbyte_p) buf; + acc_hsize_t l = 0; + while (l < size) + { + size_t n; + n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n); + if ((acc_hsize_t) n > size - l) + n = (size_t) (size - l); + n = fread((void __far*)b, 1, n, fp); + if (n == 0) + break; + b += n; l += n; + } + return l; +#else +# error "unknown memory model" +#endif +#else + return fread(buf, 1, size, fp); +#endif +} +ACCLIB_PUBLIC(acc_hsize_t, acc_hfwrite) (void* vfp, const acc_hvoid_p buf, acc_hsize_t size) +{ + FILE* fp = (FILE *) vfp; +#if (ACC_HAVE_MM_HUGE_PTR) +#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM) +#define __ACCLIB_REQUIRE_HMEMCPY_CH 1 + unsigned char tmp[512]; + acc_hsize_t l = 0; + while (l < size) + { + size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l); + __ACCLIB_FUNCNAME(acc_hmemcpy)(tmp, (const acc_hbyte_p)buf + l, (acc_hsize_t)n); + n = fwrite(tmp, 1, n, fp); + if (n == 0) + break; + l += n; + } + return l; +#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE) + const acc_hbyte_p b = (const acc_hbyte_p) buf; + acc_hsize_t l = 0; + while (l < size) + { + size_t n; + n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n); + if ((acc_hsize_t) n > size - l) + n = (size_t) (size - l); + n = fwrite((void __far*)b, 1, n, fp); + if (n == 0) + break; + b += n; l += n; + } + return l; +#else +# error "unknown memory model" +#endif +#else + return fwrite(buf, 1, size, fp); +#endif +} +#endif +#if defined(ACC_WANT_ACCLIB_HSREAD) +# undef ACC_WANT_ACCLIB_HSREAD +#define __ACCLIB_HSREAD_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +ACCLIB_PUBLIC(long, acc_safe_hread) (int fd, acc_hvoid_p buf, long size) +{ + acc_hbyte_p b = (acc_hbyte_p) buf; + long l = 0; + int saved_errno; + saved_errno = errno; + while (l < size) + { + long n = size - l; +#if (ACC_HAVE_MM_HUGE_PTR) +# define __ACCLIB_REQUIRE_HREAD_CH 1 + errno = 0; n = acc_hread(fd, b, n); +#elif (ACC_OS_DOS32) && defined(__DJGPP__) + errno = 0; n = _read(fd, b, n); +#else + errno = 0; n = read(fd, b, n); +#endif + if (n == 0) + break; + if (n < 0) { +#if defined(EAGAIN) + if (errno == (EAGAIN)) continue; +#endif +#if defined(EINTR) + if (errno == (EINTR)) continue; +#endif + if (errno == 0) errno = 1; + return l; + } + b += n; l += n; + } + errno = saved_errno; + return l; +} +ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size) +{ + const acc_hbyte_p b = (const acc_hbyte_p) buf; + long l = 0; + int saved_errno; + saved_errno = errno; + while (l < size) + { + long n = size - l; +#if (ACC_HAVE_MM_HUGE_PTR) +# define __ACCLIB_REQUIRE_HREAD_CH 1 + errno = 0; n = acc_hwrite(fd, b, n); +#elif (ACC_OS_DOS32) && defined(__DJGPP__) + errno = 0; n = _write(fd, b, n); +#else + errno = 0; n = write(fd, b, n); +#endif + if (n == 0) + break; + if (n < 0) { +#if defined(EAGAIN) + if (errno == (EAGAIN)) continue; +#endif +#if defined(EINTR) + if (errno == (EINTR)) continue; +#endif + if (errno == 0) errno = 1; + return l; + } + b += n; l += n; + } + errno = saved_errno; + return l; +} +#endif +#if defined(ACC_WANT_ACCLIB_PCLOCK) +# undef ACC_WANT_ACCLIB_PCLOCK +#define __ACCLIB_PCLOCK_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if defined(HAVE_GETTIMEOFDAY) +#ifndef acc_pclock_read_gettimeofday +#define acc_pclock_read_gettimeofday acc_pclock_read_gettimeofday +#endif +static int acc_pclock_read_gettimeofday(acc_pclock_handle_p h, acc_pclock_p c) +{ + struct timeval tv; + if (gettimeofday(&tv, 0) != 0) + return -1; +#if defined(acc_int64l_t) + c->tv_sec = tv.tv_sec; +#else + c->tv_sec_high = 0; + c->tv_sec_low = tv.tv_sec; +#endif + c->tv_nsec = (acc_uint32l_t) (tv.tv_usec * 1000u); + ACC_UNUSED(h); return 0; +} +#endif +#if defined(CLOCKS_PER_SEC) +#ifndef acc_pclock_read_clock +#define acc_pclock_read_clock acc_pclock_read_clock +#endif +static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c) +{ + clock_t ticks; + double secs; +#if defined(acc_int64l_t) + acc_uint64l_t nsecs; + ticks = clock(); + secs = (double)ticks / (CLOCKS_PER_SEC); + nsecs = (acc_uint64l_t) (secs * 1000000000.0); + c->tv_sec = (acc_int64l_t) (nsecs / 1000000000ul); + c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul); +#else + ticks = clock(); + secs = (double)ticks / (CLOCKS_PER_SEC); + c->tv_sec_high = 0; + c->tv_sec_low = (acc_uint32l_t) (secs + 0.5); + c->tv_nsec = 0; +#endif + ACC_UNUSED(h); return 0; +} +#endif +#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC) +#ifndef acc_pclock_read_uclock +#define acc_pclock_read_uclock acc_pclock_read_uclock +#endif +static int acc_pclock_read_uclock(acc_pclock_handle_p h, acc_pclock_p c) +{ + acc_uint64l_t ticks; + double secs; + acc_uint64l_t nsecs; + ticks = uclock(); + secs = (double)ticks / (UCLOCKS_PER_SEC); + nsecs = (acc_uint64l_t) (secs * 1000000000.0); + c->tv_sec = nsecs / 1000000000ul; + c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul); + ACC_UNUSED(h); return 0; +} +#endif +#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t) +#ifndef acc_pclock_read_clock_gettime_p +#define acc_pclock_read_clock_gettime_p acc_pclock_read_clock_gettime_p +#endif +static int acc_pclock_read_clock_gettime_p(acc_pclock_handle_p h, acc_pclock_p c) +{ + struct timespec ts; + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0) + return -1; + c->tv_sec = ts.tv_sec; + c->tv_nsec = ts.tv_nsec; + ACC_UNUSED(h); return 0; +} +#endif +#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t) +#ifndef acc_pclock_read_getprocesstimes +#define acc_pclock_read_getprocesstimes acc_pclock_read_getprocesstimes +#endif +static int acc_pclock_read_getprocesstimes(acc_pclock_handle_p h, acc_pclock_p c) +{ + FILETIME ct, et, kt, ut; + acc_uint64l_t ticks; + if (GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut) == 0) + return -1; + ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime; + if __acc_unlikely(h->ticks_base == 0) + h->ticks_base = ticks; + else + ticks -= h->ticks_base; + c->tv_sec = (acc_int64l_t) (ticks / 10000000ul); + c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100u; + ACC_UNUSED(h); return 0; +} +#endif +#if defined(HAVE_GETRUSAGE) && defined(RUSAGE_SELF) +#ifndef acc_pclock_read_getrusage +#define acc_pclock_read_getrusage acc_pclock_read_getrusage +#endif +static int acc_pclock_read_getrusage(acc_pclock_handle_p h, acc_pclock_p c) +{ + struct rusage ru; + if (getrusage(RUSAGE_SELF, &ru) != 0) + return -1; +#if defined(acc_int64l_t) + c->tv_sec = ru.ru_utime.tv_sec; +#else + c->tv_sec_high = 0; + c->tv_sec_low = ru.ru_utime.tv_sec; +#endif + c->tv_nsec = (acc_uint32l_t) (ru.ru_utime.tv_usec * 1000u); + ACC_UNUSED(h); return 0; +} +#endif +#if (__ACCLIB_PCLOCK_USE_PERFCTR) +#ifndef acc_pclock_read_perfctr +#define acc_pclock_read_perfctr acc_pclock_read_perfctr +#endif +static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c) +{ + acc_perfctr_clock_t pcc; + double secs; + acc_uint64l_t nsecs; + acc_perfctr_read(&h->pch, &pcc); + if __acc_unlikely(h->ticks_base == 0) + h->ticks_base = pcc.tsc; + else + pcc.tsc -= h->ticks_base; + secs = pcc.tsc * h->pch.tsc_to_seconds; + nsecs = (acc_uint64l_t) (secs * 1000000000.0); + c->tv_sec = nsecs / 1000000000ul; + c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul); + ACC_UNUSED(h); return 0; +} +#endif +#if 0 && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t) +#ifndef acc_pclock_read_clock_gettime_t +#define acc_pclock_read_clock_gettime_t acc_pclock_read_clock_gettime_t +#endif +static int acc_pclock_read_clock_gettime_t(acc_pclock_handle_p h, acc_pclock_p c) +{ + struct timespec ts; + if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0) + return -1; + c->tv_sec = ts.tv_sec; + c->tv_nsec = ts.tv_nsec; + ACC_UNUSED(h); return 0; +} +#endif +#if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t) +#ifndef acc_pclock_read_getthreadtimes +#define acc_pclock_read_getthreadtimes acc_pclock_read_getthreadtimes +#endif +static int acc_pclock_read_getthreadtimes(acc_pclock_handle_p h, acc_pclock_p c) +{ + FILETIME ct, et, kt, ut; + acc_uint64l_t ticks; + if (GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut) == 0) + return -1; + ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime; + if __acc_unlikely(h->ticks_base == 0) + h->ticks_base = ticks; + else + ticks -= h->ticks_base; + c->tv_sec = (acc_int64l_t) (ticks / 10000000ul); + c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100; + ACC_UNUSED(h); return 0; +} +#endif +ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode) +{ + acc_pclock_t c; + int i; + h->h = (acclib_handle_t) 0; + h->mode = -1; + h->name = NULL; + h->gettime = 0; +#if defined(acc_int64l_t) + h->ticks_base = 0; +#endif + switch (mode) + { + case ACC_PCLOCK_REALTIME_HR: +# if defined(acc_pclock_read_gettimeofday) + h->gettime = acc_pclock_read_gettimeofday; + h->name = "gettimeofday"; +# endif + break; + case ACC_PCLOCK_REALTIME: +# if defined(acc_pclock_read_gettimeofday) + h->gettime = acc_pclock_read_gettimeofday; + h->name = "gettimeofday"; +# endif + break; + case ACC_PCLOCK_MONOTONIC_HR: +# if defined(acc_pclock_read_uclock) + h->gettime = acc_pclock_read_uclock; + h->name = "uclock"; +# endif + break; + case ACC_PCLOCK_MONOTONIC: +# if defined(acc_pclock_read_clock) + if (!h->gettime) { + h->gettime = acc_pclock_read_clock; + h->name = "clock"; + } +# endif + break; + case ACC_PCLOCK_PROCESS_CPUTIME_ID: +# if defined(acc_pclock_read_perfctr) + if (acc_perfctr_open(&h->pch) == 0) { + h->gettime = acc_pclock_read_perfctr; + h->name = "perfctr"; + break; + } +# endif +# if defined(acc_pclock_read_getprocesstimes) + if (!h->gettime && acc_pclock_read_getprocesstimes(h, &c) == 0) { + h->gettime = acc_pclock_read_getprocesstimes; + h->name = "GetProcessTimes"; + break; + } +# endif +# if defined(acc_pclock_read_clock_gettime_p) + if (!h->gettime && acc_pclock_read_clock_gettime_p(h, &c) == 0) { + h->gettime = acc_pclock_read_clock_gettime_p; + h->name = "CLOCK_PROCESS_CPUTIME_ID"; + break; + } +# endif +# if defined(acc_pclock_read_getrusage) + h->gettime = acc_pclock_read_getrusage; + h->name = "getrusage"; +# endif + break; + case ACC_PCLOCK_THREAD_CPUTIME_ID: +# if defined(acc_pclock_read_getthreadtimes) + if (!h->gettime && acc_pclock_read_getthreadtimes(h, &c) == 0) { + h->gettime = acc_pclock_read_getthreadtimes; + h->name = "GetThreadTimes"; + } +# endif +# if defined(acc_pclock_read_clock_gettime_t) + if (!h->gettime && acc_pclock_read_clock_gettime_t(h, &c) == 0) { + h->gettime = acc_pclock_read_clock_gettime_t; + h->name = "CLOCK_THREAD_CPUTIME_ID"; + break; + } +# endif + break; + } + if (!h->gettime) + return -1; + if (!h->h) + h->h = (acclib_handle_t) 1; + h->mode = mode; + if (!h->name) + h->name = "unknown"; + for (i = 0; i < 10; i++) { + acc_pclock_read(h, &c); + } + return 0; +} +ACCLIB_PUBLIC(int, acc_pclock_open_default) (acc_pclock_handle_p h) +{ + if (acc_pclock_open(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0) + return 0; + if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC_HR) == 0) + return 0; + if (acc_pclock_open(h, ACC_PCLOCK_REALTIME_HR) == 0) + return 0; + if (acc_pclock_open(h, ACC_PCLOCK_MONOTONIC) == 0) + return 0; + if (acc_pclock_open(h, ACC_PCLOCK_REALTIME) == 0) + return 0; + if (acc_pclock_open(h, ACC_PCLOCK_THREAD_CPUTIME_ID) == 0) + return 0; + return -1; +} +ACCLIB_PUBLIC(int, acc_pclock_close) (acc_pclock_handle_p h) +{ + h->h = (acclib_handle_t) 0; + h->mode = -1; + h->name = NULL; + h->gettime = 0; +#if (__ACCLIB_PCLOCK_USE_PERFCTR) + acc_perfctr_close(&h->pch); +#endif + return 0; +} +ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c) +{ + if (h->gettime) { + if (h->gettime(h, c) == 0) + return; + } +#if defined(acc_int64l_t) + c->tv_sec = 0; +#else + c->tv_sec_high = 0; + c->tv_sec_low = 0; +#endif + c->tv_nsec = 0; +} +#if !defined(ACC_CFG_NO_DOUBLE) +ACCLIB_PUBLIC(double, acc_pclock_get_elapsed) (acc_pclock_handle_p h, const acc_pclock_p start, const acc_pclock_p stop) +{ + double tstop, tstart; + if (!h->h) { + h->mode = -1; + return 0.0; + } +#if defined(acc_int64l_t) + tstop = stop->tv_sec + stop->tv_nsec / 1000000000.0; + tstart = start->tv_sec + start->tv_nsec / 1000000000.0; +#else + tstop = stop->tv_sec_low + stop->tv_nsec / 1000000000.0; + tstart = start->tv_sec_low + start->tv_nsec / 1000000000.0; +#endif + return tstop - tstart; +} +#endif +ACCLIB_PUBLIC(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p h, unsigned flags) +{ + if (h->h) { +#if (__ACCLIB_PCLOCK_USE_PERFCTR) + return acc_perfctr_flush_cpu_cache(&h->pch, flags); +#endif + } + ACC_UNUSED(h); ACC_UNUSED(flags); + return -1; +} +#if defined(__ACCLIB_PCLOCK_NEED_WARN_POP) +# if (ACC_CC_MSC && (_MSC_VER >= 1200)) +# pragma warning(pop) +# else +# error "__ACCLIB_PCLOCK_NEED_WARN_POP" +# endif +# undef __ACCLIB_PCLOCK_NEED_WARN_POP +#endif +#endif +#if defined(ACC_WANT_ACCLIB_UCLOCK) +# undef ACC_WANT_ACCLIB_UCLOCK +#define __ACCLIB_UCLOCK_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if (ACC_OS_DOS16 || ACC_OS_WIN16) +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) +#elif (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) +# if ((ACC_CC_DMC && (__DMC__ < 0x838)) || ACC_CC_LCCWIN32) +# define __ACCLIB_UCLOCK_USE_CLOCK 1 +# else +# define __ACCLIB_UCLOCK_USE_WINMM 1 +# if (ACC_CC_MSC && (_MSC_VER >= 1200)) +# pragma warning(push) +# define __ACCLIB_UCLOCK_NEED_WARN_POP 1 +# endif +# if (ACC_CC_MSC && (_MSC_VER >= 900)) +# pragma warning(disable: 4201) +# elif (ACC_CC_MWERKS) +# define LPUINT __ACC_MMSYSTEM_H_LPUINT +# endif +# if 1 +# include +# else +# if (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC) + ACC_EXTERN_C __declspec(dllimport) unsigned long __stdcall timeGetTime(void); +# else + ACC_EXTERN_C unsigned long __stdcall timeGetTime(void); +# endif +# endif +# if (ACC_CC_DMC) +# pragma DMC includelib "winmm.lib" +# elif (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC) +# pragma comment(lib, "winmm.lib") +# elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3000)) +# pragma comment(lib, "winmm.lib") +# elif (ACC_CC_SYMANTECC) +# pragma SC includelib "winmm.lib" +# elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1050)) +# pragma library("winmm.lib") +# endif +# endif +#elif (ACC_OS_CYGWIN || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN32 || ACC_OS_WIN64) +# define __ACCLIB_UCLOCK_USE_CLOCK 1 +#elif (ACC_OS_CONSOLE) && defined(CLOCKS_PER_SEC) +# define __ACCLIB_UCLOCK_USE_CLOCK 1 +#elif (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99) && defined(CLOCKS_PER_SEC) +# define __ACCLIB_UCLOCK_USE_CLOCK 1 +#endif +#if (__ACCLIB_UCLOCK_USE_CLOCK) && !defined(CLOCKS_PER_SEC) +# if defined(CLK_TCK) +# define CLOCKS_PER_SEC CLK_TCK +# else +# undef __ACCLIB_UCLOCK_USE_CLOCK +# endif +#endif +#if (__ACCLIB_UCLOCK_USE_GETRUSAGE) +# if !defined(RUSAGE_SELF) +# undef __ACCLIB_UCLOCK_USE_GETRUSAGE +# endif +#endif +ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h) +{ + int i; +#if (__ACCLIB_UCLOCK_USE_QPC) + LARGE_INTEGER li; +#endif + h->h = (acclib_handle_t) 1; + h->mode = 0; + h->name = NULL; +#if (__ACCLIB_UCLOCK_USE_PERFCTR) + h->pch.h = 0; + if (h->mode == 0 && acc_perfctr_open(&h->pch) == 0) + h->mode = 2; +#endif +#if (__ACCLIB_UCLOCK_USE_QPC) + h->qpf = 0.0; + if (h->mode == 0 && QueryPerformanceFrequency(&li) != 0) { + double d = (double) li.QuadPart; + if (d > 0.0 && QueryPerformanceCounter(&li) != 0) { + h->mode = 3; + h->qpf = d; + } + } +#endif + for (i = 0; i < 10; i++) { + acc_uclock_t c; + acc_uclock_read(h, &c); + } + return 0; +} +ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h) +{ + h->h = (acclib_handle_t) 0; + h->mode = -1; + h->name = NULL; +#if (__ACCLIB_UCLOCK_USE_PERFCTR) + acc_perfctr_close(&h->pch); +#endif + return 0; +} +ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c) +{ +#if (__ACCLIB_UCLOCK_USE_RDTSC) + acc_tsc_read((acc_uint32e_t*) (void*) &c->tsc); +#endif +#if (__ACCLIB_UCLOCK_USE_PERFCTR) + if (h->pch.h) { + acc_perfctr_read(&h->pch, &c->pcc); + if (h->mode > 0 && h->mode <= 2) + return; + } +#endif +#if (__ACCLIB_UCLOCK_USE_QPC) + if (h->qpf > 0.0) { + LARGE_INTEGER li; + if (QueryPerformanceCounter(&li) != 0) { + c->qpc = (acc_int64l_t) li.QuadPart; + if (h->mode > 0 && h->mode <= 3) + return; + } else { + h->mode = 0; h->qpf = 0.0; c->qpc = 0; + } + } +#endif + { +#if (ACC_OS_DOS16 || ACC_OS_WIN16) +# if (ACC_CC_AZTECC) + c->ticks.t32 = 0; +# else + union REGS ri, ro; + ri.x.ax = 0x2c00; int86(0x21, &ri, &ro); + c->ticks.t32 = ro.h.ch*60UL*60UL*100UL + ro.h.cl*60UL*100UL + ro.h.dh*100UL + ro.h.dl; +# endif +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) + c->ticks.t64 = uclock(); +#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t) + c->ticks.t64 = clock(); +#elif (__ACCLIB_UCLOCK_USE_CLOCK) + c->ticks.t32 = clock(); +#elif (__ACCLIB_UCLOCK_USE_WINMM) + c->ticks.t32 = timeGetTime(); +#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE) + struct rusage ru; + if (getrusage(RUSAGE_SELF, &ru) != 0) c->ticks.td = 0; + else c->ticks.td = ru.ru_utime.tv_sec + ru.ru_utime.tv_usec / 1000000.0; +#elif (HAVE_GETTIMEOFDAY) + struct timeval tv; + if (gettimeofday(&tv, 0) != 0) c->ticks.td = 0; + else c->ticks.td = tv.tv_sec + tv.tv_usec / 1000000.0; +#else + ACC_UNUSED(c); +#endif + } + ACC_UNUSED(h); +} +ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_uclock_p start, const acc_uclock_p stop) +{ + double d; + if (!h->h) { + h->mode = -1; + return 0.0; + } +#if (__ACCLIB_UCLOCK_USE_RDTSC) + if (h->mode == 1) { + if (!h->name) h->name = "rdtsc"; + d = (double) ((acc_int64l_t)stop->tsc - (acc_int64l_t)start->tsc); + return d / 1000000000.0; + } +#endif +#if (__ACCLIB_UCLOCK_USE_PERFCTR) + if (h->pch.h && h->mode == 2) { + if (!h->name) h->name = "perfctr"; + return acc_perfctr_get_elapsed(&h->pch, &start->pcc, &stop->pcc); + } +#endif +#if (__ACCLIB_UCLOCK_USE_QPC) + if (h->qpf > 0.0 && h->mode == 3) { + if (!h->name) h->name = "qpc"; + if (start->qpc == 0 || stop->qpc == 0) return 0.0; + return (double) (stop->qpc - start->qpc) / h->qpf; + } +#endif +#if (ACC_OS_DOS16 || ACC_OS_WIN16) + h->mode = 11; + if (!h->name) h->name = "uclock"; + d = (double) (stop->ticks.t32 - start->ticks.t32) / 100.0; + if (d < 0.0) d += 86400.0; +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) + h->mode = 12; + if (!h->name) h->name = "uclock"; + d = (double) (stop->ticks.t64 - start->ticks.t64) / (UCLOCKS_PER_SEC); +#elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t) + h->mode = 13; + if (!h->name) h->name = "clock"; + { + acc_int64l_t t; + t = stop->ticks.t64 - start->ticks.t64; + if (t < 0) + t += sizeof(clock_t) == 4 ? ACC_INT64_C(0x100000000) : ACC_INT64_C(0); + d = (double) t / (CLOCKS_PER_SEC); + } +#elif (__ACCLIB_UCLOCK_USE_CLOCK) + h->mode = 14; + if (!h->name) h->name = "clock"; + d = (double) (stop->ticks.t32 - start->ticks.t32) / (CLOCKS_PER_SEC); +#elif (__ACCLIB_UCLOCK_USE_WINMM) + h->mode = 15; + if (!h->name) h->name = "timeGetTime"; + d = (double) (stop->ticks.t32 - start->ticks.t32) / 1000.0; +#elif (__ACCLIB_UCLOCK_USE_GETRUSAGE) + h->mode = 16; + if (!h->name) h->name = "getrusage"; + d = stop->ticks.td - start->ticks.td; +#elif (HAVE_GETTIMEOFDAY) + h->mode = 17; + if (!h->name) h->name = "gettimeofday"; + d = stop->ticks.td - start->ticks.td; +#else + h->mode = 0; + d = 0.0; +#endif + return d; +} +ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned flags) +{ + if (h->h) { +#if (__ACCLIB_UCLOCK_USE_PERFCTR) + return acc_perfctr_flush_cpu_cache(&h->pch, flags); +#endif + } + ACC_UNUSED(h); ACC_UNUSED(flags); + return -1; +} +#if defined(__ACCLIB_UCLOCK_NEED_WARN_POP) +# if (ACC_CC_MSC && (_MSC_VER >= 1200)) +# pragma warning(pop) +# else +# error "__ACCLIB_UCLOCK_NEED_WARN_POP" +# endif +# undef __ACCLIB_UCLOCK_NEED_WARN_POP +#endif +#endif +#if defined(ACC_WANT_ACCLIB_MISC) +# undef ACC_WANT_ACCLIB_MISC +#define __ACCLIB_MISC_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if !defined(ACCLIB_PUBLIC_NOINLINE) +# if !defined(__acc_noinline) +# define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f) +# elif (ACC_CC_GNUC >= 0x030400ul) || (ACC_CC_LLVM) +# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f) +# else +# define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f) +# endif +#endif +#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(push) +# pragma warn(disable:2007) +#endif +ACCLIB_PUBLIC(const char *, acc_getenv) (const char *s) +{ +#if defined(HAVE_GETENV) + return getenv(s); +#else + ACC_UNUSED(s); return (const char *) 0; +#endif +} +ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd) +{ + if (fd < 0) + return -1; +#if (ACC_OS_CYGWIN) + return get_osfhandle(fd); +#elif (ACC_OS_EMX && defined(__RSXNT__)) + return -1; +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) + return -1; +#elif (ACC_OS_WIN32 || ACC_OS_WIN64) +# if (ACC_CC_PELLESC && (__POCC__ < 280)) + return -1; +# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1000)) + return -1; +# elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100)) + return _os_handle(fd); +# else + return _get_osfhandle(fd); +# endif +#else + return fd; +#endif +} +ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary) +{ +#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__) + FILE* fp; int old_binary; + if (fd == STDIN_FILENO) fp = stdin; + else if (fd == STDOUT_FILENO) fp = stdout; + else if (fd == STDERR_FILENO) fp = stderr; + else return -1; + old_binary = fp->__mode.__binary; + __set_binmode(fp, binary ? 1 : 0); + return old_binary ? 1 : 0; +#elif (ACC_ARCH_M68K && ACC_OS_TOS) + ACC_UNUSED(fd); ACC_UNUSED(binary); + return -1; +#elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC)) + ACC_UNUSED(fd); ACC_UNUSED(binary); + return -1; +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) + int r; unsigned old_flags = __djgpp_hwint_flags; + ACC_COMPILE_TIME_ASSERT(O_BINARY > 0) + ACC_COMPILE_TIME_ASSERT(O_TEXT > 0) + if (fd < 0) return -1; + r = setmode(fd, binary ? O_BINARY : O_TEXT); + if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u)) + __djgpp_set_ctrl_c(!(old_flags & 1)); + if (r == -1) return -1; + return (r & O_TEXT) ? 0 : 1; +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) + if (fd < 0) return -1; + ACC_UNUSED(binary); + return 1; +#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) + FILE* fp; int r; + if (fd == fileno(stdin)) fp = stdin; + else if (fd == fileno(stdout)) fp = stdout; + else if (fd == fileno(stderr)) fp = stderr; + else return -1; + r = _setmode(fp, binary ? _BINARY : _TEXT); + if (r == -1) return -1; + return (r & _BINARY) ? 1 : 0; +#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__) + ACC_UNUSED(fd); ACC_UNUSED(binary); + return -1; +#elif (ACC_OS_CYGWIN && (ACC_CC_GNUC < 0x025a00ul)) + ACC_UNUSED(fd); ACC_UNUSED(binary); + return -1; +#elif (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) + int r; +#if !defined(ACC_CC_ZORTECHC) + ACC_COMPILE_TIME_ASSERT(O_BINARY > 0) +#endif + ACC_COMPILE_TIME_ASSERT(O_TEXT > 0) + if (fd < 0) return -1; + r = setmode(fd, binary ? O_BINARY : O_TEXT); + if (r == -1) return -1; + return (r & O_TEXT) ? 0 : 1; +#else + if (fd < 0) return -1; + ACC_UNUSED(binary); + return 1; +#endif +} +ACCLIB_PUBLIC(int, acc_isatty) (int fd) +{ + if (fd < 0) + return 0; +#if (ACC_OS_DOS16 && !defined(ACC_CC_AZTECC)) + { + union REGS ri, ro; + ri.x.ax = 0x4400; ri.x.bx = fd; + int86(0x21, &ri, &ro); + if ((ro.x.cflag & 1) == 0) + if ((ro.x.ax & 0x83) != 0x83) + return 0; + } +#elif (ACC_OS_DOS32 && ACC_CC_WATCOMC) + { + union REGS ri, ro; + ri.w.ax = 0x4400; ri.w.bx = (unsigned short) fd; + int386(0x21, &ri, &ro); + if ((ro.w.cflag & 1) == 0) + if ((ro.w.ax & 0x83) != 0x83) + return 0; + } +#elif (ACC_HAVE_WINDOWS_H) + { + acclib_handle_t h = __ACCLIB_FUNCNAME(acc_get_osfhandle)(fd); + if ((HANDLE)h != INVALID_HANDLE_VALUE) + { + DWORD d = 0; + if (GetConsoleMode((HANDLE)h, &d) == 0) + return 0; + } + } +#endif +#if defined(HAVE_ISATTY) + return (isatty(fd)) ? 1 : 0; +#else + return 0; +#endif +} +ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode) +{ +#if !defined(HAVE_MKDIR) + ACC_UNUSED(name); ACC_UNUSED(mode); + return -1; +#elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC)) + ACC_UNUSED(mode); + return Dcreate(name); +#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) + return mkdir(name, mode); +#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__) + return mkdir(name, mode); +#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) + ACC_UNUSED(mode); +# if (ACC_CC_HIGHC || ACC_CC_PACIFICC) + return mkdir((char*) name); +# else + return mkdir(name); +# endif +#else + return mkdir(name, mode); +#endif +} +ACCLIB_PUBLIC(int, acc_rmdir) (const char* name) +{ +#if !defined(HAVE_RMDIR) + ACC_UNUSED(name); + return -1; +#elif ((ACC_OS_DOS16 || ACC_OS_DOS32) && (ACC_CC_HIGHC || ACC_CC_PACIFICC)) + return rmdir((char *) name); +#else + return rmdir(name); +#endif +} +#if defined(acc_int32e_t) +ACCLIB_PUBLIC(acc_int32e_t, acc_muldiv32s) (acc_int32e_t a, acc_int32e_t b, acc_int32e_t x) +{ + acc_int32e_t r = 0; + if __acc_likely(x != 0) + { +#if defined(acc_int64l_t) + r = (acc_int32e_t) (((acc_int64l_t) a * b) / x); +#else + ACC_UNUSED(a); ACC_UNUSED(b); +#endif + } + return r; +} +ACCLIB_PUBLIC(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t a, acc_uint32e_t b, acc_uint32e_t x) +{ + acc_uint32e_t r = 0; + if __acc_likely(x != 0) + { +#if defined(acc_int64l_t) + r = (acc_uint32e_t) (((acc_uint64l_t) a * b) / x); +#else + ACC_UNUSED(a); ACC_UNUSED(b); +#endif + } + return r; +} +#endif +#if 0 +ACCLIB_PUBLIC_NOINLINE(int, acc_syscall_clock_gettime) (int c) +{ +} +#endif +#if (ACC_OS_WIN16) +ACC_EXTERN_C void __far __pascal DebugBreak(void); +#endif +ACCLIB_PUBLIC_NOINLINE(void, acc_debug_break) (void) +{ +#if (ACC_OS_WIN16) + DebugBreak(); +#elif (ACC_ARCH_I086) +#elif (ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) + DebugBreak(); +#elif defined(ACC_CFG_NO_INLINE_ASM) && (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H) + DebugBreak(); +#elif (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) + __asm__ __volatile__("int $3\n" : : : __ACC_ASM_CLOBBER); +#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC) + __asm { int 3 } +#elif (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H) + DebugBreak(); +#else + * (volatile int *) 0x1 = -1; +#endif +} +ACCLIB_PUBLIC_NOINLINE(void, acc_debug_nop) (void) +{ +} +ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_query) (void) +{ +#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) + size_t r; + __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : : __ACC_ASM_CLOBBER); + return (int)(r >> 18) & 1; +#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC) + unsigned long r; + __asm { + pushf + pop eax + mov r,eax + } + return (int)(r >> 18) & 1; +#else + return -1; +#endif +} +ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_enable) (int v) +{ + int r; +#if (ACC_ARCH_AMD64) && (ACC_ASM_SYNTAX_GNUC) + if (v) { + __asm__ __volatile__("pushf\n orl $262144,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER); + } else { + __asm__ __volatile__("pushf\n andl $-262145,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER); + } + r = 0; +#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) + if (v) { + __asm__ __volatile__("pushf\n orl $262144,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER); + } else { + __asm__ __volatile__("pushf\n andl $-262145,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER); + } + r = 0; +#elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC) + if (v) { __asm { + pushf + or dword ptr [esp],262144 + popf + }} else { __asm { + pushf + and dword ptr [esp],-262145 + popf + }} + r = 0; +#else + r = -1; +#endif + ACC_UNUSED(v); return r; +} +ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_qemu) (void) +{ + unsigned r = 0; +#if (ACC_OS_POSIX_LINUX || ACC_OS_WIN32 || ACC_OS_WIN64) + const char* p; + p = acc_getenv("ACC_ENV_RUNNING_ON_QEMU"); + if (p) { + if (p[0] == 0) r = 0; + else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = p[0] - '0'; + else r = 1; + } +#endif + return r; +} +ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void) +{ +#if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC) + volatile unsigned long args[5] = { 0x1001, 0, 0, 0, 0 }; + unsigned long r = 0; + __asm__ __volatile__(".byte 0xc1,0xc0,0x1d,0xc1,0xc0,0x03,0xc1,0xc8,0x1b,0xc1,0xc8,0x05,0xc1,0xc0,0x0d,0xc1,0xc0,0x13\n" : "=d" (r) : "a" (&args[0]), "d" (r) : __ACC_ASM_CLOBBER); + return (unsigned) r; +#else + return 0; +#endif +} +#if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(pop) +#endif +#endif +#if defined(ACC_WANT_ACCLIB_WILDARGV) +# undef ACC_WANT_ACCLIB_WILDARGV +#define __ACCLIB_WILDARGV_CH_INCLUDED 1 +#if !defined(ACCLIB_PUBLIC) +# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f) +#endif +#if (ACC_OS_DOS16 || ACC_OS216 || ACC_OS_WIN16) +#if 0 && (ACC_CC_MSC) +ACC_EXTERN_C int __acc_cdecl __setargv(void); +ACC_EXTERN_C int __acc_cdecl _setargv(void); +ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); } +#endif +#endif +#if (ACC_OS_WIN32 || ACC_OS_WIN64) +#if (ACC_CC_INTELC || ACC_CC_MSC) +ACC_EXTERN_C int __acc_cdecl __setargv(void); +ACC_EXTERN_C int __acc_cdecl _setargv(void); +ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); } +#endif +#endif +#if (ACC_OS_EMX) +#define __ACCLIB_HAVE_ACC_WILDARGV 1 +ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv) +{ + if (argc && argv) { + _response(argc, argv); + _wildcard(argc, argv); + } +} +#endif +#if (ACC_OS_CONSOLE_PSP) && defined(__PSPSDK_DEBUG__) +#define __ACCLIB_HAVE_ACC_WILDARGV 1 +ACC_EXTERN_C int acc_psp_init_module(int*, char***, int); +ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv) +{ + acc_psp_init_module(argc, argv, -1); +} +#endif +#if !defined(__ACCLIB_HAVE_ACC_WILDARGV) +#define __ACCLIB_HAVE_ACC_WILDARGV 1 +ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv) +{ +#if 1 && (ACC_ARCH_I086PM) + if (ACC_MM_AHSHIFT != 3) { exit(1); } +#elif 1 && (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__) + __binmode(1); + if (isatty(1)) __set_binmode(stdout, 0); + if (isatty(2)) __set_binmode(stderr, 0); +#endif + ACC_UNUSED(argc); ACC_UNUSED(argv); +} +#endif +#endif + +/* vim:set ts=4 et: */ diff --git a/thirdparty/lzo/2.03/src/stats1a.h b/thirdparty/lzo/2.03/src/stats1a.h new file mode 100644 index 0000000..5116f80 --- /dev/null +++ b/thirdparty/lzo/2.03/src/stats1a.h @@ -0,0 +1,137 @@ +/* stats1a.h -- statistics for the the LZO1A algorithm + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the LZO package and is subject + to change. + */ + + +#ifndef __LZO_STATS1A_H +#define __LZO_STATS1A_H + +#ifdef __cplusplus +extern "C" { +#endif + + + +/*********************************************************************** +// collect statistical information when compressing +// used for finetuning, view with a debugger +************************************************************************/ + +#if defined(LZO_COLLECT_STATS) +# define LZO_STATS(expr) expr +#else +# define LZO_STATS(expr) ((void) 0) +#endif + + +/*********************************************************************** +// +************************************************************************/ + +typedef struct { + +/* configuration */ + unsigned rbits; + unsigned clevel; + +/* internal configuration */ + unsigned dbits; + unsigned lbits; + +/* constants */ + unsigned min_match_short; + unsigned max_match_short; + unsigned min_match_long; + unsigned max_match_long; + unsigned min_offset; + unsigned max_offset; + unsigned r0min; + unsigned r0fast; + unsigned r0max; + +/* counts */ + long short_matches; + long long_matches; + long r1_matches; + long lit_runs; + long lit_runs_after_long_match; + long r0short_runs; + long r0fast_runs; + long r0long_runs; + +/* */ + long lit_run[RSIZE]; + long lit_run_after_long_match[RSIZE]; + long short_match[MAX_MATCH_SHORT + 1]; + long long_match[MAX_MATCH_LONG + 1]; + long marker[256]; + +/* these could prove useful for further optimizations */ + long short_match_offset_osize[MAX_MATCH_SHORT + 1]; + long short_match_offset_256[MAX_MATCH_SHORT + 1]; + long short_match_offset_1024[MAX_MATCH_SHORT + 1]; + long matches_out_of_range; + long matches_out_of_range_2; + long matches_out_of_range_4; + long match_out_of_range[MAX_MATCH_SHORT + 1]; + +/* */ + long in_len; + long out_len; +} +lzo1a_stats_t; + +extern lzo1a_stats_t *lzo1a_stats; + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/stats1b.h b/thirdparty/lzo/2.03/src/stats1b.h new file mode 100644 index 0000000..b24f71e --- /dev/null +++ b/thirdparty/lzo/2.03/src/stats1b.h @@ -0,0 +1,142 @@ +/* stats1b.h -- statistics for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_STATS1B_H +#define __LZO_STATS1B_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// Collect statistical information when compressing. +// Useful for finetuning the compression algorithm. +// Examine the symbol 'lzo1b_stats' with a debugger. +************************************************************************/ + +#if defined(LZO_COLLECT_STATS) +# define LZO_STATS(expr) expr +#else +# define LZO_STATS(expr) ((void) 0) +#endif + + +#if defined(LZO_COLLECT_STATS) + +typedef struct +{ +/* algorithm configuration */ + unsigned r_bits; + unsigned m3o_bits; + unsigned dd_bits; + unsigned clevel; + +/* internal configuration */ + unsigned d_bits; + long min_lookahead; + long max_lookbehind; + const char *compress_id; + +/* counts */ + long lit_runs; + long r0short_runs; + long r0fast_runs; + long r0long_runs; + long m1_matches; + long m2_matches; + long m3_matches; + long m4_matches; + long r1_matches; + +/* */ + long lit_run[R0MIN]; + long m2_match[M2_MAX_LEN + 1]; + long m3_match[M3_MAX_LEN + 1]; +#if (M3O_BITS < 8) + long lit_runs_after_m3_match; + long lit_run_after_m3_match[LZO_SIZE(8-M3O_BITS)]; +#endif + +/* */ + long matches; + long match_bytes; + long literals; + long literal_overhead; + long literal_bytes; + double literal_overhead_percent; + +/* */ + long unused_dict_entries; + double unused_dict_entries_percent; + +/* */ + long in_len; + long out_len; +} +lzo1b_stats_t; + + +void _lzo1b_stats_init(lzo1b_stats_t *lzo_stats); +void _lzo1b_stats_calc(lzo1b_stats_t *lzo_stats); + +extern lzo1b_stats_t * const lzo1b_stats; + +#define lzo_stats_t lzo1b_stats_t +#define lzo_stats lzo1b_stats + +#endif + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/src/stats1c.h b/thirdparty/lzo/2.03/src/stats1c.h new file mode 100644 index 0000000..8d261e7 --- /dev/null +++ b/thirdparty/lzo/2.03/src/stats1c.h @@ -0,0 +1,61 @@ +/* stats1c.h -- statistics for the the LZO library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the library and is subject + to change. + */ + + +#ifndef __LZO_STATS1C_H +#define __LZO_STATS1C_H + +#define lzo1b_stats_t lzo1c_stats_t +#define lzo1b_stats lzo1c_stats +#define _lzo1b_stats_init _lzo1c_stats_init +#define _lzo1b_stats_calc _lzo1c_stats_calc + +#include "stats1b.h" + +#endif /* already included */ + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/testmini.exe b/thirdparty/lzo/2.03/testmini.exe new file mode 100644 index 0000000..0ce60ef Binary files /dev/null and b/thirdparty/lzo/2.03/testmini.exe differ diff --git a/thirdparty/lzo/2.03/testmini.exe.manifest b/thirdparty/lzo/2.03/testmini.exe.manifest new file mode 100644 index 0000000..fe71210 --- /dev/null +++ b/thirdparty/lzo/2.03/testmini.exe.manifest @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/thirdparty/lzo/2.03/testmini.obj b/thirdparty/lzo/2.03/testmini.obj new file mode 100644 index 0000000..e017df9 Binary files /dev/null and b/thirdparty/lzo/2.03/testmini.obj differ diff --git a/thirdparty/lzo/2.03/tests/Makefile.am b/thirdparty/lzo/2.03/tests/Makefile.am new file mode 100644 index 0000000..08246b3 --- /dev/null +++ b/thirdparty/lzo/2.03/tests/Makefile.am @@ -0,0 +1,17 @@ +## Process this file with automake to create Makefile.in +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) + +noinst_PROGRAMS = align chksum promote sizes + +align_SOURCES = align.c +chksum_SOURCES = chksum.c +promote_SOURCES = promote.c +sizes_SOURCES = sizes.c + +align_LDADD = ../src/liblzo2.la +chksum_LDADD = ../src/liblzo2.la + diff --git a/thirdparty/lzo/2.03/tests/Makefile.in b/thirdparty/lzo/2.03/tests/Makefile.in new file mode 100644 index 0000000..d86aa1f --- /dev/null +++ b/thirdparty/lzo/2.03/tests/Makefile.in @@ -0,0 +1,468 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = align$(EXEEXT) chksum$(EXEEXT) promote$(EXEEXT) \ + sizes$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_align_OBJECTS = align.$(OBJEXT) +align_OBJECTS = $(am_align_OBJECTS) +align_DEPENDENCIES = ../src/liblzo2.la +am_chksum_OBJECTS = chksum.$(OBJEXT) +chksum_OBJECTS = $(am_chksum_OBJECTS) +chksum_DEPENDENCIES = ../src/liblzo2.la +am_promote_OBJECTS = promote.$(OBJEXT) +promote_OBJECTS = $(am_promote_OBJECTS) +promote_LDADD = $(LDADD) +am_sizes_OBJECTS = sizes.$(OBJEXT) +sizes_OBJECTS = $(am_sizes_OBJECTS) +sizes_LDADD = $(LDADD) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(align_SOURCES) $(chksum_SOURCES) $(promote_SOURCES) \ + $(sizes_SOURCES) +DIST_SOURCES = $(align_SOURCES) $(chksum_SOURCES) $(promote_SOURCES) \ + $(sizes_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LZO_ASM_VPATH = @LZO_ASM_VPATH@ +LZO_CFLAGS = @LZO_CFLAGS@ +LZO_CPPFLAGS = @LZO_CPPFLAGS@ +LZO_EXTRA_CFLAGS = @LZO_EXTRA_CFLAGS@ +LZO_EXTRA_CPPFLAGS = @LZO_EXTRA_CPPFLAGS@ +LZO_USE_ASM_FALSE = @LZO_USE_ASM_FALSE@ +LZO_USE_ASM_TRUE = @LZO_USE_ASM_TRUE@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +configure_CFLAGS = @configure_CFLAGS@ +configure_CPPFLAGS = @configure_CPPFLAGS@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir) +align_SOURCES = align.c +chksum_SOURCES = chksum.c +promote_SOURCES = promote.c +sizes_SOURCES = sizes.c +align_LDADD = ../src/liblzo2.la +chksum_LDADD = ../src/liblzo2.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +align$(EXEEXT): $(align_OBJECTS) $(align_DEPENDENCIES) + @rm -f align$(EXEEXT) + $(LINK) $(align_LDFLAGS) $(align_OBJECTS) $(align_LDADD) $(LIBS) +chksum$(EXEEXT): $(chksum_OBJECTS) $(chksum_DEPENDENCIES) + @rm -f chksum$(EXEEXT) + $(LINK) $(chksum_LDFLAGS) $(chksum_OBJECTS) $(chksum_LDADD) $(LIBS) +promote$(EXEEXT): $(promote_OBJECTS) $(promote_DEPENDENCIES) + @rm -f promote$(EXEEXT) + $(LINK) $(promote_LDFLAGS) $(promote_OBJECTS) $(promote_LDADD) $(LIBS) +sizes$(EXEEXT): $(sizes_OBJECTS) $(sizes_DEPENDENCIES) + @rm -f sizes$(EXEEXT) + $(LINK) $(sizes_LDFLAGS) $(sizes_OBJECTS) $(sizes_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/align.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chksum.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/promote.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sizes.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/thirdparty/lzo/2.03/tests/align.c b/thirdparty/lzo/2.03/tests/align.c new file mode 100644 index 0000000..1b2c540 --- /dev/null +++ b/thirdparty/lzo/2.03/tests/align.c @@ -0,0 +1,205 @@ +/* align.c -- test alignment (important for 16-bit systems) + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#if 0 +#include "src/lzo_conf.h" +#include "src/lzo_ptr.h" +#endif +#include "lzo/lzoconf.h" + +/* utility layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" + + +int opt_verbose = 0; + + +/************************************************************************* +// +**************************************************************************/ + +long align_test(lzo_bytep block, lzo_uint len, lzo_uint step) +{ + lzo_bytep b1 = block; + lzo_bytep b2 = block; + lzo_bytep k1 = NULL; + lzo_bytep k2 = NULL; + lzo_bytep k; + lzo_bytep x; + lzo_uint offset = 0; + long i = 0; + + assert(step > 0); + assert(step <= 65536L); + assert((step & (step - 1)) == 0); + + for (offset = step; offset < len; offset += step) + { + k1 = LZO_PTR_ALIGN_UP(b1+1,step); + k2 = b2 + offset; + if (k1 != k2) + { + printf("error 1: i %ld step %ld offset %ld: " + "%p (%ld) %p (%ld)\n", + i, (long) step, (long) offset, + k1, (long) (k1 - block), + k2, (long) (k2 - block)); + return 0; + } + if (k1 - step != b1) + { + printf("error 2: i %ld step %ld offset %ld: " + "%p (%ld) %p (%ld)\n", + i, (long) step, (long) offset, + b1, (long) (b1 - block), + k1, (long) (k1 - block)); + return 0; + } + + assert(k1 > b1); + assert(k2 > b2); + assert((lzo_uint)(k2 - b2) == offset); + assert(k1 - offset == b2); +#if defined(PTR_ALIGNED_4) + if (step == 4) + { + assert(PTR_ALIGNED_4(k1)); + assert(PTR_ALIGNED_4(k2)); + assert(PTR_ALIGNED2_4(k1,k2)); + } +#endif +#if defined(PTR_ALIGNED_8) + if (step == 8) + { + assert(PTR_ALIGNED_8(k1)); + assert(PTR_ALIGNED_8(k2)); + assert(PTR_ALIGNED2_8(k1,k2)); + } +#endif +#if defined(PTR_LINEAR) + assert((PTR_LINEAR(k1) & (step-1)) == 0); + assert((PTR_LINEAR(k2) & (step-1)) == 0); +#endif + + for (k = b1 + 1; k <= k1; k++) + { + x = LZO_PTR_ALIGN_UP(k,step); + if (x != k1) + { + printf("error 3: base: %p %p %p i %ld step %ld offset %ld: " + "%p (%ld) %p (%ld) %p (%ld)\n", + block, b1, b2, + i, (long) step, (long) offset, + k1, (long) (k1 - block), + k, (long) (k - block), + x, (long) (x - block)); + return 0; + } + } + + b1 = k1; + i++; + } + + return i; +} + + +/************************************************************************* +// +**************************************************************************/ + +#define BLOCK_LEN (128*1024L) + +int main(int argc, char *argv[]) +{ + lzo_bytep buf; + lzo_uint step; + + if (argc >= 2 && strcmp(argv[1],"-v") == 0) + opt_verbose = 1; + + if (lzo_init() != LZO_E_OK) + { + printf("lzo_init() failed !!!\n"); + return 3; + } + buf = (lzo_bytep) lzo_malloc(2*BLOCK_LEN + 256); + if (buf == NULL) + { + printf("out of memory\n"); + return 2; + } + + printf("Align init: %p ( 0x%lx )\n", buf, (unsigned long) buf); + + for (step = 1; step <= 65536L; step *= 2) + { + lzo_bytep block = buf; + long n; + unsigned gap; + + gap = __lzo_align_gap(block,step); + block = LZO_PTR_ALIGN_UP(block,step); + if (opt_verbose >= 1) + printf("STEP %5ld: GAP: %5lu %p %p %5ld\n", + (long) step, (long) gap, buf, block, + (long) (block - buf)); + n = align_test(block,BLOCK_LEN,step); + if (n == 0) + return 1; + if ((n + 1) * step != BLOCK_LEN) + { + printf("error 4: %ld %ld\n",(long)step,n); + return 1; + } + } + + lzo_free(buf); + printf("Alignment test passed.\n"); + return 0; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/tests/chksum.c b/thirdparty/lzo/2.03/tests/chksum.c new file mode 100644 index 0000000..89b6df1 --- /dev/null +++ b/thirdparty/lzo/2.03/tests/chksum.c @@ -0,0 +1,104 @@ +/* chksum.c -- compute a checksum + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo/lzoconf.h" + +/* utility layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" + + +/************************************************************************* +// +**************************************************************************/ + +int main(int argc, char *argv[]) +{ + lzo_bytep block; + lzo_uint block_len; + lzo_uint32 adler, crc; + + if (argc < 0 && argv == NULL) /* avoid warning about unused args */ + return 0; + + if (lzo_init() != LZO_E_OK) + { + printf("lzo_init() failed !!!\n"); + return 4; + } + +/* prepare the block */ + block_len = 128 * 1024L; + block = (lzo_bytep) lzo_malloc(block_len); + if (block == NULL) + { + printf("out of memory\n"); + return 3; + } + lzo_memset(block, 0, block_len); + +/* adler32 checksum */ + adler = lzo_adler32(0, NULL, 0); + adler = lzo_adler32(adler, block, block_len); + if (adler != 0x001e0001UL) + { + printf("adler32 checksum error !!! (0x%08lx)\n", (long) adler); + return 2; + } + +/* crc32 checksum */ + crc = lzo_crc32(0, NULL, 0); + crc = lzo_crc32(crc, block, block_len); + if (crc != 0x7ee8cdcdUL) + { + printf("crc32 checksum error !!! (0x%08lx)\n", (long) crc); + return 1; + } + + lzo_free(block); + printf("Checksum test passed.\n"); + return 0; +} + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/tests/promote.c b/thirdparty/lzo/2.03/tests/promote.c new file mode 100644 index 0000000..185bcc6 --- /dev/null +++ b/thirdparty/lzo/2.03/tests/promote.c @@ -0,0 +1,70 @@ +/* promote.c -- test intergral promotion + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +#include + +int main(int argc, char *argv[]) +{ + unsigned char c; + int s; + + if (argc < 0 && argv == NULL) /* avoid warning about unused args */ + return 0; + + c = (unsigned char) (1 << (8 * sizeof(char) - 1)); + s = 8 * (int) (sizeof(int) - sizeof(char)); + + printf("Integral promotion: "); + if ((c << s) > 0) + { + printf("Classic C (unsigned-preserving)\n"); + printf("%d %d %uU\n", c, s, c << s); + return 1; + } + else + { + printf("ANSI C (value-preserving)\n"); + printf("%d %d %d\n", c, s, c << s); + return 0; + } +} + +/* +vi:ts=4:et +*/ diff --git a/thirdparty/lzo/2.03/tests/sizes.c b/thirdparty/lzo/2.03/tests/sizes.c new file mode 100644 index 0000000..fc04b2b --- /dev/null +++ b/thirdparty/lzo/2.03/tests/sizes.c @@ -0,0 +1,133 @@ +/* sizes.c -- print sizes of various types + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo/lzoconf.h" +#include + + +union _lzo_align1_t +{ + char a_char; +}; + +struct _lzo_align2_t +{ + char a_char; +}; + +struct _lzo_align3_t +{ + char a_char; + long a_long; +}; + +struct _lzo_align4_t +{ + char a_char; + char * a_char_p; +}; + +struct _lzo_align5_t +{ + char a_char1; + long a_long; + char a_char2; + char * a_char_p; +}; + +union _lzo_align6_t +{ + char a_char; + long a_long; + char * a_char_p; + lzo_bytep a_lzobytep; +}; + + +#define print_size(type) \ + sprintf(s,"sizeof(%s)",#type); \ + printf("%-30s %2d\n", s, (int)sizeof(type)); + +#define print_ssize(type,m) \ + sprintf(s,"sizeof(%s)",#type); \ + printf("%-30s %2d %20ld\n", s, (int)sizeof(type), (long)(m)); + +#define print_usize(type,m) \ + sprintf(s,"sizeof(%s)",#type); \ + printf("%-30s %2d %20lu\n", s, (int)sizeof(type), (unsigned long)(m)); + + +int main(int argc, char *argv[]) +{ + char s[80]; + + print_ssize(char,CHAR_MAX); + print_usize(unsigned char,UCHAR_MAX); + print_ssize(short,SHRT_MAX); + print_usize(unsigned short,USHRT_MAX); + print_ssize(int,INT_MAX); + print_usize(unsigned int,UINT_MAX); + print_ssize(long,LONG_MAX); + print_usize(unsigned long,ULONG_MAX); + printf("\n"); + print_size(char *); + print_size(void (*)(void)); + printf("\n"); + print_ssize(lzo_int,LZO_INT_MAX); + print_usize(lzo_uint,LZO_UINT_MAX); + print_usize(lzo_uint32,LZO_UINT32_MAX); + print_size(lzo_bytep); + printf("\n"); + print_size(union _lzo_align1_t); + print_size(struct _lzo_align2_t); + print_size(struct _lzo_align3_t); + print_size(struct _lzo_align4_t); + print_size(struct _lzo_align5_t); + print_size(union _lzo_align6_t); + + if (argc < 0 && argv == NULL) /* avoid warning about unused args */ + return 0; + return 0; +} + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/tools/compile.bat b/thirdparty/lzo/2.03/tools/compile.bat new file mode 100644 index 0000000..127f72a --- /dev/null +++ b/thirdparty/lzo/2.03/tools/compile.bat @@ -0,0 +1,2 @@ +cl -nologo -MD -O2 -GF -W3 -I..\include -I.. -DLZO_USE_ASM ..\lzo2.lib lzodecompress.c +cl -nologo -MD -O2 -GF -W3 -I..\include -I.. -DLZO_USE_ASM ..\lzo2.lib lzocompress.c diff --git a/thirdparty/lzo/2.03/tools/lzocompress.c b/thirdparty/lzo/2.03/tools/lzocompress.c new file mode 100644 index 0000000..7f6561b --- /dev/null +++ b/thirdparty/lzo/2.03/tools/lzocompress.c @@ -0,0 +1,81 @@ +/* + * usage : lzocompress.exe + * + * lzocompress reads bytes from stdin, compress them and write the result to stdout + * errors are logged to stderr + * return == 0 iff no errors + */ +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" +#include + + +#include + +int main(int argc, char *argv[]) +{ + lzo_uint src_len, dst_len, max_dst_len; + lzo_bytep src; + lzo_bytep dst; + lzo_bytep wrkmem; + int r; + + /* stdin/stdout must be binary streams */ + r = _setmode( _fileno( stdout ), _O_BINARY ); + r = _setmode( _fileno( stdin ), _O_BINARY ); + + if(argc != 2) + { + fprintf(stderr, "Usage : %s \n is the input buffer size in bytes\n", argv[0]); + return -1; + } + src_len = atoi(argv[1]); + if (lzo_init() != LZO_E_OK) + { + fprintf(stderr, "Couldn't initialize lzo\n"); + return -2; + } + + /* read input buffer */ + src = (lzo_bytep) lzo_malloc(src_len); + fread(src, 1, src_len, stdin); + + /* allocate the buffer to store the compressed data */ + max_dst_len = src_len + src_len/64 + 16 + 3; + dst = (lzo_bytep) lzo_malloc(max_dst_len); + + + /* allocate the working memory for lzo */ + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS); + + /* compress data */ + dst_len = 0; + r = lzo1x_1_compress(src, src_len, dst, &dst_len, wrkmem); + + if (r == LZO_E_OK) + { + /* write compressed data */ + fwrite(dst, 1, dst_len, stdout); + } + else + { + fprintf(stderr, "Compression failed : code = %d\n", r); + } + + /* free memory */ + lzo_free(wrkmem); + lzo_free(dst); + lzo_free(src); + + /* return final result */ + if (r == LZO_E_OK) + return 0; + else + return -3; +} + + diff --git a/thirdparty/lzo/2.03/tools/lzocompress.exe b/thirdparty/lzo/2.03/tools/lzocompress.exe new file mode 100644 index 0000000..2f4b406 Binary files /dev/null and b/thirdparty/lzo/2.03/tools/lzocompress.exe differ diff --git a/thirdparty/lzo/2.03/tools/lzocompress.obj b/thirdparty/lzo/2.03/tools/lzocompress.obj new file mode 100644 index 0000000..3e6181c Binary files /dev/null and b/thirdparty/lzo/2.03/tools/lzocompress.obj differ diff --git a/thirdparty/lzo/2.03/tools/lzodecompress.c b/thirdparty/lzo/2.03/tools/lzodecompress.c new file mode 100644 index 0000000..4f88ab9 --- /dev/null +++ b/thirdparty/lzo/2.03/tools/lzodecompress.c @@ -0,0 +1,82 @@ +/* + * usage : lzodecompress.exe + * + * lzodecompress reads bytes from stdin, decompress them and write the result to stdout + * the decompressed buffer must be bytes + * + * errors are logged to stderr + * return == 0 iff no errors + */ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" + + +#include +#include + +int main(int argc, char *argv[]) +{ + lzo_uint src_len, dst_len; + lzo_bytep src; + lzo_bytep dst; + lzo_bytep wrkmem; + int r; + + /* stdin/stdout must be binary streams */ + r = _setmode( _fileno( stdout ), _O_BINARY ); + r = _setmode( _fileno( stdin ), _O_BINARY ); + + if(argc != 3) + { + fprintf(stderr, "Usage : %s \n" + " is the decompressed buffer size in bytes\n" + " is the compressed buffer size in bytes\n", argv[0]); + return -1; + } + dst_len = atoi(argv[1]); + src_len = atoi(argv[2]); + if (lzo_init() != LZO_E_OK) + { + fprintf(stderr, "Couldn't initialize lzo\n"); + return -2; + } + + /* allocate and read input buffer */ + src = (lzo_bytep) lzo_malloc(src_len); + fread(src, 1, src_len, stdin); + + /* allocate the buffer for the decompressed data */ + dst = (lzo_bytep) lzo_malloc(dst_len); + + /* allocate the working memory for lzo */ + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS); + + /* decompress data (note: lzo1x_decompress_safe does not throw exception. It instead can return error codes) */ + r = lzo1x_decompress_safe(src, src_len, dst, &dst_len, wrkmem); + + if (r == LZO_E_OK) + { + /* write compressed data */ + fwrite(dst, 1, dst_len, stdout); + } + else + { + fprintf(stderr, "Compression failed : code = %d\n", r); + } + + /* free the memory */ + lzo_free(wrkmem); + lzo_free(dst); + lzo_free(src); + + /* return code */ + if (r == LZO_E_OK) + return 0; + else + return -3; +} diff --git a/thirdparty/lzo/2.03/tools/lzodecompress.exe b/thirdparty/lzo/2.03/tools/lzodecompress.exe new file mode 100644 index 0000000..a5dd8f8 Binary files /dev/null and b/thirdparty/lzo/2.03/tools/lzodecompress.exe differ diff --git a/thirdparty/lzo/2.03/tools/lzodecompress.obj b/thirdparty/lzo/2.03/tools/lzodecompress.obj new file mode 100644 index 0000000..302a6ca Binary files /dev/null and b/thirdparty/lzo/2.03/tools/lzodecompress.obj differ diff --git a/thirdparty/lzo/2.03/tools/portab.h b/thirdparty/lzo/2.03/tools/portab.h new file mode 100644 index 0000000..1405b44 --- /dev/null +++ b/thirdparty/lzo/2.03/tools/portab.h @@ -0,0 +1,162 @@ +/* portab.h -- portability layer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#include "lzo/lzoconf.h" + +#if (LZO_CC_MSC && (_MSC_VER >= 1000 && _MSC_VER < 1200)) + /* avoid `-W4' warnings in system header files */ +# pragma warning(disable: 4201 4214 4514) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) + /* avoid `-Wall' warnings in system header files */ +# pragma warning(disable: 4163 4255 4820) + /* avoid warnings about inlining */ +# pragma warning(disable: 4710 4711) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1400)) + /* avoid warnings when using "deprecated" POSIX functions */ +# pragma warning(disable: 4996) +#endif +#if (LZO_CC_PELLESC && (__POCC__ >= 290)) +# pragma warn(disable:2002) +#endif + + +/************************************************************************* +// +**************************************************************************/ + +#if defined(__LZO_MMODEL_HUGE) || !(defined(LZO_LIBC_ISOC90) || defined(LZO_LIBC_ISOC99)) + +#include "examples/portab_a.h" + +#else + +/* INFO: + * The "portab_a.h" version above uses the ACC library to add + * support for ancient systems (like 16-bit DOS) and to provide + * some gimmicks like Windows high-resolution timers. + * Still, on any halfway modern machine you can also use the + * following pure ANSI-C code instead. + */ + +#include +#include +#include +#include +#include +#include +#if defined(CLK_TCK) && !defined(CLOCKS_PER_SEC) +# define CLOCKS_PER_SEC CLK_TCK +#endif + +#if defined(WANT_LZO_MALLOC) +# define lzo_malloc(a) (malloc(a)) +# define lzo_free(a) (free(a)) +#endif +#if defined(WANT_LZO_FREAD) +# define lzo_fread(f,b,s) (fread(b,1,s,f)) +# define lzo_fwrite(f,b,s) (fwrite(b,1,s,f)) +#endif +#if defined(WANT_LZO_UCLOCK) +# define lzo_uclock_handle_t int +# define lzo_uclock_t double +# define lzo_uclock_open(a) ((void)(a)) +# define lzo_uclock_close(a) ((void)(a)) +# define lzo_uclock_read(a,b) *(b) = (clock() / (double)(CLOCKS_PER_SEC)) +# define lzo_uclock_get_elapsed(a,b,c) (*(c) - *(b)) +#endif +#if defined(WANT_LZO_WILDARGV) +# define lzo_wildargv(a,b) ((void)0) +#endif + +#endif + + +/************************************************************************* +// misc +**************************************************************************/ + +/* turn on assertions */ +#undef NDEBUG +#include + +/* just in case */ +#undef xmalloc +#undef xfree +#undef xread +#undef xwrite +#undef xputc +#undef xgetc +#undef xread32 +#undef xwrite32 + + +#if defined(WANT_LZO_UCLOCK) + +/* High quality benchmarking. + * + * Flush the CPU cache to get more accurate benchmark values. + * This needs custom kernel patches. As a result - in combination with + * the perfctr Linux kernel patches - accurate high-quality benchmarking + * is possible. + * + * All other methods (rdtsc, QueryPerformanceCounter, gettimeofday, ...) + * are completely unreliable for our purposes, and the only other + * option is to boot into a legacy single-task operating system + * like plain MSDOS and to directly reprogram the hardware clock. + * [The djgpp2 port of the gcc compiler has support functions for this.] + * + * Also, for embedded systems it's best to benchmark by using a + * CPU emulator/simulator software that can exactly count all + * virtual clock ticks. + */ + +#if !defined(lzo_uclock_flush_cpu_cache) +# define lzo_uclock_flush_cpu_cache(h,flags) ((void)(h)) +#endif + +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/tools/portab_a.h b/thirdparty/lzo/2.03/tools/portab_a.h new file mode 100644 index 0000000..a58ba99 --- /dev/null +++ b/thirdparty/lzo/2.03/tools/portab_a.h @@ -0,0 +1,128 @@ +/* portab_a.h -- advanced portability layer + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +/************************************************************************* +// use the ACC library for the hard work +**************************************************************************/ + +#if defined(LZO_HAVE_CONFIG_H) +# define ACC_CONFIG_NO_HEADER 1 +#endif + +#define ACC_WANT_ACC_INCD_H 1 +#define ACC_WANT_ACC_INCE_H 1 +#if defined(__LZO_MMODEL_HUGE) || defined(WANT_LZO_UCLOCK) || defined(WANT_LZO_WILDARGV) +# define ACC_WANT_ACC_INCI_H 1 +# define ACC_WANT_ACC_LIB_H 1 +#endif +#include "src/miniacc.h" + +#if defined(WANT_LZO_MALLOC) +# if defined(__LZO_MMODEL_HUGE) +# define ACC_WANT_ACCLIB_HALLOC 1 +# else +# define acc_halloc(a) (malloc(a)) +# define acc_hfree(a) (free(a)) +# endif +#endif +#if defined(WANT_LZO_FREAD) +# if defined(__LZO_MMODEL_HUGE) +# define ACC_WANT_ACCLIB_HFREAD 1 +# else +# define acc_hfread(f,b,s) (fread(b,1,s,f)) +# define acc_hfwrite(f,b,s) (fwrite(b,1,s,f)) +# endif +#endif +#if defined(WANT_LZO_UCLOCK) +# define ACC_WANT_ACCLIB_PCLOCK 1 +# if 0 && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# define __ACCLIB_PCLOCK_USE_RDTSC 1 +# define ACC_WANT_ACCLIB_RDTSC 1 +# endif +#endif +#if defined(WANT_LZO_WILDARGV) +# define ACC_WANT_ACCLIB_WILDARGV 1 +#endif +#if defined(__ACCLIB_PCLOCK_USE_PERFCTR) +# include "src/fullacc.h" +# define lzo_uclock_flush_cpu_cache(h,flags) acc_pclock_flush_cpu_cache(h,flags) +#else +# include "src/miniacc.h" +#endif + +#if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED) +# define ACC_WANT_ACCLIB_HMEMCPY 1 +# include "src/miniacc.h" +#endif + + +/************************************************************************* +// finally pull into the LZO namespace +**************************************************************************/ + +#undef lzo_malloc +#undef lzo_free +#undef lzo_fread +#undef lzo_fwrite +#if defined(WANT_LZO_MALLOC) +# define lzo_malloc(a) acc_halloc(a) +# define lzo_free(a) acc_hfree(a) +#endif +#if defined(WANT_LZO_FREAD) +# define lzo_fread(f,b,s) acc_hfread(f,b,s) +# define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s) +#endif +#if defined(WANT_LZO_UCLOCK) +# define lzo_uclock_handle_t acc_pclock_handle_t +# define lzo_uclock_t acc_pclock_t +# define lzo_uclock_open(a) acc_pclock_open_default(a) +# define lzo_uclock_close(a) acc_pclock_close(a) +# define lzo_uclock_read(a,b) acc_pclock_read(a,b) +# define lzo_uclock_get_elapsed(a,b,c) acc_pclock_get_elapsed(a,b,c) +#endif +#if defined(WANT_LZO_WILDARGV) +# define lzo_wildargv(a,b) acc_wildargv(a,b) +#endif + + +/* +vi:ts=4:et +*/ + diff --git a/thirdparty/lzo/2.03/util/check.sh b/thirdparty/lzo/2.03/util/check.sh new file mode 100644 index 0000000..c1c2a2d --- /dev/null +++ b/thirdparty/lzo/2.03/util/check.sh @@ -0,0 +1,43 @@ +#! /bin/sh +set -e + +# +# usage: util/check.sh [directory] +# +# This script runs lzotest with all algorithms on a complete directory tree. +# It is not suitable for accurate timings. +# +# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +# + +LZOTEST="lzotest" +test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest" +test -x ./lzotest.exe && LZOTEST="./lzotest.exe" +test -x ./lzotest.out && LZOTEST="./lzotest.out" + +dir="${*-.}" + +TMPFILE="/tmp/lzo_$$.tmp" +rm -f $TMPFILE +(find $dir/ -type f -print > $TMPFILE) || true + +## methods=`$LZOTEST -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'` +## methods="9721 9722 9723 9724 9725 9726 9727 9728 9729" +methods="21 31 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 61 71 81" +methods="$methods 111 112 115" +methods="$methods 921 931 901 911" +methods="$methods 902 912 942 962 972 982 992" +##methods="71 972" +##methods="1101 1102 1103 1104 1105 1106 1107" + +LFLAGS="-q -T -n2 -S" +LFLAGS="-q -T -n2" + +for i in $methods; do + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS +done + +rm -f $TMPFILE +echo "Done." +exit 0 + diff --git a/thirdparty/lzo/2.03/util/checkasm.sh b/thirdparty/lzo/2.03/util/checkasm.sh new file mode 100644 index 0000000..6e84f46 --- /dev/null +++ b/thirdparty/lzo/2.03/util/checkasm.sh @@ -0,0 +1,46 @@ +#! /bin/sh +set -e + +# +# usage: util/checkasm.sh [directory] +# +# This script runs lzotest with all assembler decompressors +# on a complete directory tree. +# It is not suitable for accurate timings. +# +# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +# + +LZOTEST="lzotest" +test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest" +test -x ./lzotest.exe && LZOTEST="./lzotest.exe" +test -x ./lzotest.out && LZOTEST="./lzotest.out" +LFLAGS="-q" + +dir="${*-.}" + +TMPFILE="/tmp/lzo_$$.tmp" +rm -f $TMPFILE +(find $dir/ -type f -print > $TMPFILE) || true + +for i in 11; do + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S +done + +for i in 61; do + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +done + +for i in 71 81; do + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F + cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +done + +rm -f $TMPFILE +echo "Done." +exit 0 + diff --git a/thirdparty/lzo/2.03/util/notime.pl b/thirdparty/lzo/2.03/util/notime.pl new file mode 100644 index 0000000..46eb459 --- /dev/null +++ b/thirdparty/lzo/2.03/util/notime.pl @@ -0,0 +1,26 @@ +#! /usr/bin/perl +## +## vi:ts=4 +## +##---------------------------------------------------------------------------## +## +## Author: +## Markus F.X.J. Oberhumer +## +## Description: +## Remove timing values from a table created by table.pl +## +## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +## +##---------------------------------------------------------------------------## + + +while (<>) { + if (substr($_,56) =~ /^\s+[\d\.]+\s+[\d\.]+\s+\|\s*\n$/) { + substr($_,56) = " 0.000 0.000 |\n"; + } + print; +} + +exit(0); + diff --git a/thirdparty/lzo/2.03/util/overlap.sh b/thirdparty/lzo/2.03/util/overlap.sh new file mode 100644 index 0000000..a90613d --- /dev/null +++ b/thirdparty/lzo/2.03/util/overlap.sh @@ -0,0 +1,27 @@ +#! /bin/sh +set -e + +# +# usage: util/overlap.sh [directory] +# +# This script runs the overlap example program on a complete directory tree. +# +# Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +# + +OVERLAP="overlap" +test -x ./examples/overlap && OVERLAP="./examples/overlap" +test -x ./overlap.exe && OVERLAP="./overlap.exe" + +dir="${*-.}" + +TMPFILE="/tmp/lzo_$$.tmp" +rm -f $TMPFILE +(find $dir/ -type f -print0 > $TMPFILE) || true + +cat $TMPFILE | xargs -0 -r $OVERLAP + +rm -f $TMPFILE +echo "Done." +exit 0 + diff --git a/thirdparty/lzo/2.03/util/shortf.pl b/thirdparty/lzo/2.03/util/shortf.pl new file mode 100644 index 0000000..0bee2e0 --- /dev/null +++ b/thirdparty/lzo/2.03/util/shortf.pl @@ -0,0 +1,31 @@ +#! /usr/bin/perl +## +## vi:ts=4 +## +##---------------------------------------------------------------------------## +## +## Author: +## Markus F.X.J. Oberhumer +## +## Description: +## Create short files for compression test +## +## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +## +##---------------------------------------------------------------------------## + +$c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +$c = "\x00\x01\x02"; +$c = "\x00"; + +$x = $c x 1024; + +for $i (0 .. 50) { + $name = sprintf("f%04d.dat",$i); + open(OUTFILE,">$name") || die "$0: cannot open '$name': $!"; + binmode(OUTFILE); + print OUTFILE substr($x,0,$i); + close(OUTFILE); +} + +exit(0); diff --git a/thirdparty/lzo/2.03/util/table.pl b/thirdparty/lzo/2.03/util/table.pl new file mode 100644 index 0000000..b4e1ac8 --- /dev/null +++ b/thirdparty/lzo/2.03/util/table.pl @@ -0,0 +1,360 @@ +#! /usr/bin/perl +## +## vi:ts=4:et +## +##---------------------------------------------------------------------------## +## +## Author: +## Markus F.X.J. Oberhumer +## +## Description: +## Convert the output of the LZO lzotest program into a nice table. +## +## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +## +##---------------------------------------------------------------------------## + +$PROG = $0; +require 'ctime.pl'; + +# +# get options +# + +while ($_ = $ARGV[ $[ ], /^-/) { + shift(@ARGV); + /^--$/ && ($opt_last = 1, last); + + /^--sort=name/ && ($opt_sort_summary_by_name++, next); + /^--sort=ratio/ && ($opt_sort_summary_by_ratio++, next); + /^-s/ && ($opt_summary_only++, next); + /^-t/ && ($opt_clear_time++, next); +} + + +$alg = ''; +$sep = "+" . ("-" x 76) . "+\n"; + +$block_size = -1; + +$n = 0; +@algs = (); +%average = (); +%total = (); + +$lzo_version_string = ''; +$lzo_version_date = ''; + + +# /*********************************************************************** +# // +# ************************************************************************/ + +while (<>) { + + if (/(^|\s)(\d+)\s+block\-size/i) { + if ($block_size < 0) { + $block_size = $2; + &intro($block_size); + } elsif ($block_size != $2) { + die "$PROG: block-size: $block_size != $2\n"; + } + next; + } + + if (/^\s*LZO\s.*library\s+\(v\s*([\w\.\s]+)\s*\,\s*([^\)]+)\)/) { + $lzo_version_string = $1; + $lzo_version_date = $2; + next; + } + + if (/^\s*(\S+(\s+\[\S+\])?)\s*(\|.*\|)\s*$/i) { + if ($1 ne $alg) { + &footer($1); + &header($1); + } + $line = $3; + &stats(*line); + print "$line\n" if (!$opt_summary_only); + } +} +&footer($1); + +&summary(); + +exit(0); + + +# /*********************************************************************** +# // +# ************************************************************************/ + +sub stats { + local (*l) = @_; + local ($x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8); + + if ($l !~ /^\|\s*(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d\.]+\s+)?([\d\.]+\s+)?([\d\.]+)\s+([\d\.]+)\s*\|/) { + die $_; + } + + $n++; + + $x1 = $1; $x2 = $2; $x3 = $3; $x4 = $4; + $x5 = ($x2 > 0) ? $x4 * 100.0 / $x2 : 0.0; + $x6 = ($x2 > 0) ? $x4 * 8.0 / $x2 : 0.0; + $x7 = $7; $x8 = $8; + + # convert from kB/s to MB/s (for old versions of lzotest) + if ($x7 =~ /\.\d\d$/) { $x7 = $x7 / 1000.0; } + if ($x8 =~ /\.\d\d$/) { $x8 = $x8 / 1000.0; } + + if ($opt_clear_time) { + $x7 = $x8 = 0.0; + } + + $s[0] += $x2; + $s[1] += $x3; + $s[2] += $x4; + $s[3] += $x5; + $s[4] += $x6; + if ($x7 > 0) { + $s[5] += 1.0 / $x7; $sn[5] += 1; + } + if ($x8 > 0) { + $s[6] += 1.0/ $x8; $sn[6] += 1; + } + + $x1 =~ s/\s+$//; + $l = sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |", + $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8); +} + + +# /*********************************************************************** +# // +# ************************************************************************/ + +sub header { + local ($t) = @_; + + $alg = $t; + + # reset stats + $n = 0; + @s = (0, 0, 0, 0.0, 0.0, 0.0, 0.0); + @sn = (0, 0, 0, 0, 0, 0, 0); + + return if $opt_summary_only; + + print "\n$alg\n\n"; + print $sep; +print < 0 ? $sn[5] / $s[5] : 0.0; + $shm6 = $s[6] > 0 ? $sn[6] / $s[6] : 0.0; + + push(@algs,$alg); + + $average{$alg} = + sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n", + "Average", $s[0]/$n, $s[1]/$n, $s[2]/$n, + $s[3]/$n, $s[4]/$n, + $shm5, $shm6); + + $total{$alg} = + sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n", + "Total", $s[0], $s[1], $s[2], + $s[2]/$s[0]*100, $s[2]/$s[0]*8, + $shm5, $shm6); + + return if $opt_summary_only; + + print $sep; + print $average{$alg}; + print $total{$alg}; + print $sep, "\n"; +} + + +# /*********************************************************************** +# // +# ************************************************************************/ + +$sort_mode = 0; + +sub cmp_by_ratio { + local ($aa, $bb); + + if ($sort_mode == 0) { + $aa = $average{$a}; + $bb = $average{$b}; + } elsif ($sort_mode == 1) { + $aa = $total{$a}; + $bb = $total{$b}; + } else { + die; + } + + ($aa =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die; + $aa = $1; + ($bb =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die; + $bb = $1; + + # $aa < $bb; + $aa cmp $bb; +} + + +# /*********************************************************************** +# // +# ************************************************************************/ + +sub summary { + local ($l); + local (@k); + + $sort_mode = 0; + if ($opt_sort_summary_by_name) { + @k = sort(@algs); + } elsif ($opt_sort_summary_by_ratio) { + @k = sort(cmp_by_ratio @algs); + } else { + @k = @algs; + } + + print "\n\n"; + print "Summary of average values\n\n"; + print $sep; +print < +## +## Description: +## Create uncompressible files for compression test +## +## Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer +## +##---------------------------------------------------------------------------## + +$x = ' ' x 65536; +$i = 0; +while ($i < 65536) { + substr($x,$i,1) = pack('C',rand(256)); + $i++; +} + +for $i (1,2,4,8,16,32,64) { + $name = sprintf("u%04d.dat",$i); + open(OUTFILE,">$name") || die "$0: cannot open '$name': $!"; + binmode(OUTFILE); + print OUTFILE substr($x,0,$i*1024); + close(OUTFILE); +} + +exit(0); diff --git a/thirdparty/lzo/driver/CMakeLists.txt b/thirdparty/lzo/driver/CMakeLists.txt new file mode 100644 index 0000000..731c2c2 --- /dev/null +++ b/thirdparty/lzo/driver/CMakeLists.txt @@ -0,0 +1,20 @@ +project(lzotools) + +if (WIN32) + # use pre-built 2.03 + get_filename_component(LZO_PATH ${SDKROOT}/lzo/2.03 ABSOLUTE) + link_directories(${LZO_PATH}/LZO_lib/) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(PREFIX _64) + endif (CMAKE_SIZEOF_VOID_P EQUAL 8) +else () + get_filename_component(LZO_PATH ${SDKROOT}/lzo/lzo-2.09 ABSOLUTE) + link_directories(${LZO_PATH}/src/.libs/) +endif () + +include_directories(${LZO_PATH} ${LZO_PATH}/include) +add_definitions(-DLZO_USE_ASM) +add_executable(lzocompress lzocompress.c) +target_link_libraries(lzocompress lzo2${PREFIX}) +add_executable(lzodecompress lzodecompress.c) +target_link_libraries(lzodecompress lzo2${PREFIX}) diff --git a/thirdparty/lzo/driver/lzocompress.c b/thirdparty/lzo/driver/lzocompress.c new file mode 100644 index 0000000..b7a76bd --- /dev/null +++ b/thirdparty/lzo/driver/lzocompress.c @@ -0,0 +1,83 @@ +/* + * usage : lzocompress.exe + * + * lzocompress reads bytes from stdin, compress them and write the result to stdout + * errors are logged to stderr + * return == 0 iff no errors + */ +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" +#include + + +#include + +int main(int argc, char *argv[]) +{ + lzo_uint src_len, dst_len, max_dst_len; + lzo_bytep src; + lzo_bytep dst; + lzo_bytep wrkmem; + int r; + +#if defined(_WIN32) + /* stdin/stdout must be binary streams */ + r = _setmode(_fileno(stdout), _O_BINARY); + r = _setmode(_fileno(stdin), _O_BINARY); +#endif + + if(argc != 2) + { + fprintf(stderr, "Usage : %s \n is the input buffer size in bytes\n", argv[0]); + return -1; + } + src_len = atoi(argv[1]); + if (lzo_init() != LZO_E_OK) + { + fprintf(stderr, "Couldn't initialize lzo\n"); + return -2; + } + + /* read input buffer */ + src = (lzo_bytep) lzo_malloc(src_len); + fread(src, 1, src_len, stdin); + + /* allocate the buffer to store the compressed data */ + max_dst_len = src_len + src_len/64 + 16 + 3; + dst = (lzo_bytep) lzo_malloc(max_dst_len); + + + /* allocate the working memory for lzo */ + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS); + + /* compress data */ + dst_len = 0; + r = lzo1x_1_compress(src, src_len, dst, &dst_len, wrkmem); + + if (r == LZO_E_OK) + { + /* write compressed data */ + fwrite(dst, 1, dst_len, stdout); + } + else + { + fprintf(stderr, "Compression failed : code = %d\n", r); + } + + /* free memory */ + lzo_free(wrkmem); + lzo_free(dst); + lzo_free(src); + + /* return final result */ + if (r == LZO_E_OK) + return 0; + else + return -3; +} + + diff --git a/thirdparty/lzo/driver/lzodecompress.c b/thirdparty/lzo/driver/lzodecompress.c new file mode 100644 index 0000000..2222d2b --- /dev/null +++ b/thirdparty/lzo/driver/lzodecompress.c @@ -0,0 +1,84 @@ +/* + * usage : lzodecompress.exe + * + * lzodecompress reads bytes from stdin, decompress them and write the result to stdout + * the decompressed buffer must be bytes + * + * errors are logged to stderr + * return == 0 iff no errors + */ + +#include "lzo/lzoconf.h" +#include "lzo/lzo1x.h" + +/* portability layer */ +#define WANT_LZO_MALLOC 1 +#include "examples/portab.h" + + +#include +#include + +int main(int argc, char *argv[]) +{ + lzo_uint src_len, dst_len; + lzo_bytep src; + lzo_bytep dst; + lzo_bytep wrkmem; + int r; + +#if defined(_WIN32) + /* stdin/stdout must be binary streams */ + r = _setmode(_fileno(stdout), _O_BINARY); + r = _setmode(_fileno(stdin), _O_BINARY); +#endif + + if(argc != 3) + { + fprintf(stderr, "Usage : %s \n" + " is the decompressed buffer size in bytes\n" + " is the compressed buffer size in bytes\n", argv[0]); + return -1; + } + dst_len = atoi(argv[1]); + src_len = atoi(argv[2]); + if (lzo_init() != LZO_E_OK) + { + fprintf(stderr, "Couldn't initialize lzo\n"); + return -2; + } + + /* allocate and read input buffer */ + src = (lzo_bytep) lzo_malloc(src_len); + fread(src, 1, src_len, stdin); + + /* allocate the buffer for the decompressed data */ + dst = (lzo_bytep) lzo_malloc(dst_len); + + /* allocate the working memory for lzo */ + wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS); + + /* decompress data (note: lzo1x_decompress_safe does not throw exception. It instead can return error codes) */ + r = lzo1x_decompress_safe(src, src_len, dst, &dst_len, wrkmem); + + if (r == LZO_E_OK) + { + /* write compressed data */ + fwrite(dst, 1, dst_len, stdout); + } + else + { + fprintf(stderr, "Compression failed : code = %d\n", r); + } + + /* free the memory */ + lzo_free(wrkmem); + lzo_free(dst); + lzo_free(src); + + /* return code */ + if (r == LZO_E_OK) + return 0; + else + return -3; +} diff --git a/thirdparty/quicktime/.gitignore b/thirdparty/quicktime/.gitignore new file mode 100644 index 0000000..89439fc --- /dev/null +++ b/thirdparty/quicktime/.gitignore @@ -0,0 +1 @@ +QT73SDK diff --git a/thirdparty/quicktime/copy_QT73SDK.txt b/thirdparty/quicktime/copy_QT73SDK.txt new file mode 100644 index 0000000..36c2c4e --- /dev/null +++ b/thirdparty/quicktime/copy_QT73SDK.txt @@ -0,0 +1 @@ +Copy QT73SDK to this directory. diff --git a/thirdparty/superlu/README.txt b/thirdparty/superlu/README.txt new file mode 100644 index 0000000..6c060ce --- /dev/null +++ b/thirdparty/superlu/README.txt @@ -0,0 +1,34 @@ + +To compile SuperLU: + + Use the Visual Studio project located in the /prj folder. + +IMPORTANT (THREAD-SAFETY): + + A slight modification had to be applied to the original sources of the used version (4.1). + + The edit concerns the presence of static variables, that make SuperLU *NOT* thread-safe. + There is a SuperLU version for parallel architectures (SMT), but it's obviously geared + toward internal thread management - which is not what we want. + + The only edit we've done, located in "dgstrf.c", fixes a crash when allocating resources + for LU factorization: + + In "void dgstrf (..)": + + > /*static*/ GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + + /* DANIELE: tolto static, nocivo x multithread */ + + > memset(&Glu, 0, sizeof(GlobalLU_t)); // static inizializzava tutto a 0 + + There are other sparse static variables, which we've not had the time to double-check. + Everything seems to work. + + In case it is necessary to further modify source files, remember fiy: + + * Files NOT starting with "d" - ie "double" - are not interesting; they are intended + for single float and complex numbers, we're only sticking to doubles. + + * We're mainly interested in LU factorization, meaning only dgstrf ramification should + be tracked. diff --git a/thirdparty/superlu/SuperLU_32.d.lib b/thirdparty/superlu/SuperLU_32.d.lib new file mode 100644 index 0000000..e5637a3 Binary files /dev/null and b/thirdparty/superlu/SuperLU_32.d.lib differ diff --git a/thirdparty/superlu/SuperLU_32.lib b/thirdparty/superlu/SuperLU_32.lib new file mode 100644 index 0000000..328b9c2 Binary files /dev/null and b/thirdparty/superlu/SuperLU_32.lib differ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/Makefile b/thirdparty/superlu/SuperLU_4.1/CBLAS/Makefile new file mode 100644 index 0000000..7435fe4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/Makefile @@ -0,0 +1,86 @@ +include ../make.inc +HEADER = ../SRC + +####################################################################### +# This is the makefile to create a library for C-BLAS. +# The files are organized as follows: +# +# SBLAS1 -- Single precision real BLAS routines +# CBLAS1 -- Single precision complex BLAS routines +# DBLAS1 -- Double precision real BLAS routines +# ZBLAS1 -- Double precision complex BLAS routines +# +# CB1AUX -- Real BLAS routines called by complex routines +# ZB1AUX -- D.P. real BLAS routines called by d.p. complex +# routines +# +# ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS +# +# SBLAS2 -- Single precision real BLAS2 routines +# CBLAS2 -- Single precision complex BLAS2 routines +# DBLAS2 -- Double precision real BLAS2 routines +# ZBLAS2 -- Double precision complex BLAS2 routines +# +# SBLAS3 -- Single precision real BLAS3 routines +# CBLAS3 -- Single precision complex BLAS3 routines +# DBLAS3 -- Double precision real BLAS3 routines +# ZBLAS3 -- Double precision complex BLAS3 routines +# +# The library can be set up to include routines for any combination +# of the four precisions. To create or add to the library, enter make +# followed by one or more of the precisions desired. Some examples: +# make single +# make single complex +# make single double complex complex16 +# Alternatively, the command +# make +# without any arguments creates a library of all four precisions. +# The library is called +# blas.a +# and is created at the next higher directory level. +# +# To remove the object files after the library is created, enter +# make clean +# +####################################################################### + +SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \ + srot.o sscal.o sswap.o +SBLAS2 = sgemv.o ssymv.o strsv.o sger.o ssyr2.o + +DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \ + drot.o dscal.o dswap.o +DBLAS2 = dgemv.o dsymv.o dtrsv.o dger.o dsyr2.o + +CBLAS1 = icamax.o scasum.o caxpy.o ccopy.o scnrm2.o \ + cscal.o cswap.o +CBLAS2 = cgemv.o chemv.o ctrsv.o cgerc.o cher2.o + +ZBLAS1 = izamax.o dzasum.o zaxpy.o zcopy.o dznrm2.o \ + zscal.o dcabs1.o zswap.o +ZBLAS2 = zgemv.o zhemv.o ztrsv.o zgerc.o zher2.o + + +all: single double complex complex16 + +single: $(SBLAS1) $(SBLAS2) $(SBLAS3) + $(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3) + $(RANLIB) $(BLASLIB) + +double: $(DBLAS1) $(DBLAS2) $(DBLAS3) + $(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3) + $(RANLIB) $(BLASLIB) + +complex: $(CBLAS1) $(CBLAS2) $(CBLAS3) + $(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(ALLBLAS) $(CBLAS2) $(CBLAS3) + $(RANLIB) $(BLASLIB) + +complex16: $(ZBLAS1) $(ZBLAS2) $(ZBLAS3) + $(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3) + $(RANLIB) $(BLASLIB) + +.c.o: + $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE) + +clean: + rm -f *.o ../lib/libblas.a diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/caxpy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/caxpy.c new file mode 100644 index 0000000..27d4bd5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/caxpy.c @@ -0,0 +1,90 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int caxpy_(integer *n, complex *ca, complex *cx, integer * + incx, complex *cy, integer *incy) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3, i__4; + real r__1, r__2; + complex q__1, q__2; + + /* Builtin functions */ + double r_imag(complex *); + + /* Local variables */ + static integer i, ix, iy; + + +/* constant times a vector plus a vector. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define CY(I) cy[(I)-1] +#define CX(I) cx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if ((r__1 = ca->r, dabs(r__1)) + (r__2 = r_imag(ca), dabs(r__2)) == 0.f) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + i__4 = ix; + q__2.r = ca->r * CX(ix).r - ca->i * CX(ix).i, q__2.i = ca->r * CX( + ix).i + ca->i * CX(ix).r; + q__1.r = CY(iy).r + q__2.r, q__1.i = CY(iy).i + q__2.i; + CY(iy).r = q__1.r, CY(iy).i = q__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + i__4 = i; + q__2.r = ca->r * CX(i).r - ca->i * CX(i).i, q__2.i = ca->r * CX( + i).i + ca->i * CX(i).r; + q__1.r = CY(i).r + q__2.r, q__1.i = CY(i).i + q__2.i; + CY(i).r = q__1.r, CY(i).i = q__1.i; +/* L30: */ + } + return 0; +} /* caxpy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ccopy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ccopy.c new file mode 100644 index 0000000..dbfd87b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ccopy.c @@ -0,0 +1,74 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int ccopy_(integer *n, complex *cx, integer *incx, complex * + cy, integer *incy) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + + /* Local variables */ + static integer i, ix, iy; + + +/* copies a vector, x, to a vector, y. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define CY(I) cy[(I)-1] +#define CX(I) cx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = ix; + CY(iy).r = CX(ix).r, CY(iy).i = CX(ix).i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + CY(i).r = CX(i).r, CY(i).i = CX(i).i; +/* L30: */ + } + return 0; +} /* ccopy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cdotc.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cdotc.c new file mode 100644 index 0000000..c7a153f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cdotc.c @@ -0,0 +1,87 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Complex */ VOID cdotc_(complex * ret_val, integer *n, complex *cx, integer + *incx, complex *cy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer i; + static complex ctemp; + static integer ix, iy; + + +/* forms the dot product of two vectors, conjugating the first + vector. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments */ + --cy; + --cx; + + /* Function Body */ + ctemp.r = 0.f, ctemp.i = 0.f; + ret_val->r = 0.f, ret_val->i = 0.f; + if (*n <= 0) { + return ; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + r_cnjg(&q__3, &cx[ix]); + i__2 = iy; + q__2.r = q__3.r * cy[iy].r - q__3.i * cy[iy].i, q__2.i = q__3.r * + cy[iy].i + q__3.i * cy[iy].r; + q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i; + ctemp.r = q__1.r, ctemp.i = q__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + r_cnjg(&q__3, &cx[i]); + i__2 = i; + q__2.r = q__3.r * cy[i].r - q__3.i * cy[i].i, q__2.i = q__3.r * + cy[i].i + q__3.i * cy[i].r; + q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i; + ctemp.r = q__1.r, ctemp.i = q__1.i; +/* L30: */ + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; +} /* cdotc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cgemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cgemv.c new file mode 100644 index 0000000..086228f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cgemv.c @@ -0,0 +1,399 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int cgemv_(char *trans, integer *m, integer *n, complex * + alpha, complex *a, integer *lda, complex *x, integer *incx, complex * + beta, complex *y, integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer info; + static complex temp; + static integer lenx, leny, i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical noconj; + + +/* Purpose + ======= + + CGEMV performs one of the matrix-vector operations + + y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, or + + y := alpha*conjg( A' )*x + beta*y, + + where alpha and beta are scalars, x and y are vectors and A is an + m by n matrix. + + Parameters + ========== + + TRANS - CHARACTER*1. + On entry, TRANS specifies the operation to be performed as + follows: + + TRANS = 'N' or 'n' y := alpha*A*x + beta*y. + + TRANS = 'T' or 't' y := alpha*A'*x + beta*y. + + TRANS = 'C' or 'c' y := alpha*conjg( A' )*x + beta*y. + + Unchanged on exit. + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + X - COMPLEX array of DIMENSION at least + ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. + Before entry, the incremented array X must contain the + vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX array of DIMENSION at least + ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. + Before entry with BETA non-zero, the incremented array Y + must contain the vector y. On exit, Y is overwritten by the + + updated vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(trans, "N") && ! lsame_(trans, "T") && ! + lsame_(trans, "C")) { + info = 1; + } else if (*m < 0) { + info = 2; + } else if (*n < 0) { + info = 3; + } else if (*lda < max(1,*m)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } else if (*incy == 0) { + info = 11; + } + if (info != 0) { + xerbla_("CGEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || alpha->r == 0.f && alpha->i == 0.f && (beta->r + == 1.f && beta->i == 0.f)) { + return 0; + } + + noconj = lsame_(trans, "T"); + +/* Set LENX and LENY, the lengths of the vectors x and y, and set + + up the start points in X and Y. */ + + if (lsame_(trans, "N")) { + lenx = *n; + leny = *m; + } else { + lenx = *m; + leny = *n; + } + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (lenx - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (leny - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. + + First form y := beta*y. */ + + if (beta->r != 1.f || beta->i != 0.f) { + if (*incy == 1) { + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = i; + Y(i).r = 0.f, Y(i).i = 0.f; +/* L10: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = i; + i__3 = i; + q__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + q__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = q__1.r, Y(i).i = q__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = iy; + Y(iy).r = 0.f, Y(iy).i = 0.f; + iy += *incy; +/* L30: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = iy; + i__3 = iy; + q__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + q__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0.f && alpha->i == 0.f) { + return 0; + } + if (lsame_(trans, "N")) { + +/* Form y := alpha*A*x + y. */ + + jx = kx; + if (*incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0.f || X(jx).i != 0.f) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + q__1.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + temp.r = q__1.r, temp.i = q__1.i; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j) + .r; + q__1.r = Y(i).r + q__2.r, q__1.i = Y(i).i + + q__2.i; + Y(i).r = q__1.r, Y(i).i = q__1.i; +/* L50: */ + } + } + jx += *incx; +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0.f || X(jx).i != 0.f) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + q__1.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + temp.r = q__1.r, temp.i = q__1.i; + iy = ky; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j) + .r; + q__1.r = Y(iy).r + q__2.r, q__1.i = Y(iy).i + + q__2.i; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + iy += *incy; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } else { + +/* Form y := alpha*A'*x + y or y := alpha*conjg( A' )*x + y. + */ + + jy = ky; + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp.r = 0.f, temp.i = 0.f; + if (noconj) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i; + q__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i) + .i, q__2.i = A(i,j).r * X(i).i + A(i,j) + .i * X(i).r; + q__1.r = temp.r + q__2.r, q__1.i = temp.i + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L90: */ + } + } else { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + r_cnjg(&q__3, &A(i,j)); + i__3 = i; + q__2.r = q__3.r * X(i).r - q__3.i * X(i).i, + q__2.i = q__3.r * X(i).i + q__3.i * X(i) + .r; + q__1.r = temp.r + q__2.r, q__1.i = temp.i + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L100: */ + } + } + i__2 = jy; + i__3 = jy; + q__2.r = alpha->r * temp.r - alpha->i * temp.i, q__2.i = + alpha->r * temp.i + alpha->i * temp.r; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jy += *incy; +/* L110: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp.r = 0.f, temp.i = 0.f; + ix = kx; + if (noconj) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = ix; + q__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix) + .i, q__2.i = A(i,j).r * X(ix).i + A(i,j) + .i * X(ix).r; + q__1.r = temp.r + q__2.r, q__1.i = temp.i + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix += *incx; +/* L120: */ + } + } else { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + r_cnjg(&q__3, &A(i,j)); + i__3 = ix; + q__2.r = q__3.r * X(ix).r - q__3.i * X(ix).i, + q__2.i = q__3.r * X(ix).i + q__3.i * X(ix) + .r; + q__1.r = temp.r + q__2.r, q__1.i = temp.i + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix += *incx; +/* L130: */ + } + } + i__2 = jy; + i__3 = jy; + q__2.r = alpha->r * temp.r - alpha->i * temp.i, q__2.i = + alpha->r * temp.i + alpha->i * temp.r; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jy += *incy; +/* L140: */ + } + } + } + + return 0; + +/* End of CGEMV . */ + +} /* cgemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cgerc.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cgerc.c new file mode 100644 index 0000000..6c317b2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cgerc.c @@ -0,0 +1,205 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int cgerc_(integer *m, integer *n, complex *alpha, complex * + x, integer *incx, complex *y, integer *incy, complex *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + complex q__1, q__2; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer info; + static complex temp; + static integer i, j, ix, jy, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + CGERC performs the rank 1 operation + + A := alpha*x*conjg( y' ) + A, + + where alpha is a scalar, x is an m element vector, y is an n element + + vector and A is an m by n matrix. + + Parameters + ========== + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - COMPLEX array of dimension at least + ( 1 + ( m - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the m + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - COMPLEX array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. On exit, A is + overwritten by the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (*m < 0) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*m)) { + info = 9; + } + if (info != 0) { + xerbla_("CGERC ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || alpha->r == 0.f && alpha->i == 0.f) { + return 0; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (*incy > 0) { + jy = 1; + } else { + jy = 1 - (*n - 1) * *incy; + } + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jy; + if (Y(jy).r != 0.f || Y(jy).i != 0.f) { + r_cnjg(&q__2, &Y(jy)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp.r = q__1.r, temp.i = q__1.i; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + q__2.r = X(i).r * temp.r - X(i).i * temp.i, q__2.i = + X(i).r * temp.i + X(i).i * temp.r; + q__1.r = A(i,j).r + q__2.r, q__1.i = A(i,j).i + q__2.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; +/* L10: */ + } + } + jy += *incy; +/* L20: */ + } + } else { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*m - 1) * *incx; + } + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jy; + if (Y(jy).r != 0.f || Y(jy).i != 0.f) { + r_cnjg(&q__2, &Y(jy)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp.r = q__1.r, temp.i = q__1.i; + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + q__2.r = X(ix).r * temp.r - X(ix).i * temp.i, q__2.i = + X(ix).r * temp.i + X(ix).i * temp.r; + q__1.r = A(i,j).r + q__2.r, q__1.i = A(i,j).i + q__2.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; + ix += *incx; +/* L30: */ + } + } + jy += *incy; +/* L40: */ + } + } + + return 0; + +/* End of CGERC . */ + +} /* cgerc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/chemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/chemv.c new file mode 100644 index 0000000..2299694 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/chemv.c @@ -0,0 +1,421 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int chemv_(char *uplo, integer *n, complex *alpha, complex * + a, integer *lda, complex *x, integer *incx, complex *beta, complex *y, + integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublereal d__1; + complex q__1, q__2, q__3, q__4; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer info; + static complex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + CHEMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n hermitian matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the hermitian matrix and the strictly + lower triangular part of A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the hermitian matrix and the strictly + upper triangular part of A is not referenced. + Note that the imaginary parts of the diagonal elements need + + not be set and are assumed to be zero. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("CHEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0.f && alpha->i == 0.f && (beta->r == 1.f && + beta->i == 0.f)) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (beta->r != 1.f || beta->i != 0.f) { + if (*incy == 1) { + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + Y(i).r = 0.f, Y(i).i = 0.f; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + q__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + q__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = q__1.r, Y(i).i = q__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + Y(iy).r = 0.f, Y(iy).i = 0.f; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + q__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + q__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0.f && alpha->i == 0.f) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + q__1.r = alpha->r * X(j).r - alpha->i * X(j).i, q__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(i).r + q__2.r, q__1.i = Y(i).i + q__2.i; + Y(i).r = q__1.r, Y(i).i = q__1.i; + r_cnjg(&q__3, &A(i,j)); + i__3 = i; + q__2.r = q__3.r * X(i).r - q__3.i * X(i).i, q__2.i = + q__3.r * X(i).i + q__3.i * X(i).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L50: */ + } + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + q__3.r = d__1 * temp1.r, q__3.i = d__1 * temp1.i; + q__2.r = Y(j).r + q__3.r, q__2.i = Y(j).i + q__3.i; + q__4.r = alpha->r * temp2.r - alpha->i * temp2.i, q__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, q__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(iy).r + q__2.r, q__1.i = Y(iy).i + q__2.i; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + r_cnjg(&q__3, &A(i,j)); + i__3 = ix; + q__2.r = q__3.r * X(ix).r - q__3.i * X(ix).i, q__2.i = + q__3.r * X(ix).i + q__3.i * X(ix).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; + ix += *incx; + iy += *incy; +/* L70: */ + } + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + q__3.r = d__1 * temp1.r, q__3.i = d__1 * temp1.i; + q__2.r = Y(jy).r + q__3.r, q__2.i = Y(jy).i + q__3.i; + q__4.r = alpha->r * temp2.r - alpha->i * temp2.i, q__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + q__1.r = alpha->r * X(j).r - alpha->i * X(j).i, q__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + q__2.r = d__1 * temp1.r, q__2.i = d__1 * temp1.i; + q__1.r = Y(j).r + q__2.r, q__1.i = Y(j).i + q__2.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(i).r + q__2.r, q__1.i = Y(i).i + q__2.i; + Y(i).r = q__1.r, Y(i).i = q__1.i; + r_cnjg(&q__3, &A(i,j)); + i__3 = i; + q__2.r = q__3.r * X(i).r - q__3.i * X(i).i, q__2.i = + q__3.r * X(i).i + q__3.i * X(i).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L90: */ + } + i__2 = j; + i__3 = j; + q__2.r = alpha->r * temp2.r - alpha->i * temp2.i, q__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = Y(j).r + q__2.r, q__1.i = Y(j).i + q__2.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, q__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + q__2.r = d__1 * temp1.r, q__2.i = d__1 * temp1.i; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(iy).r + q__2.r, q__1.i = Y(iy).i + q__2.i; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + r_cnjg(&q__3, &A(i,j)); + i__3 = ix; + q__2.r = q__3.r * X(ix).r - q__3.i * X(ix).i, q__2.i = + q__3.r * X(ix).i + q__3.i * X(ix).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L110: */ + } + i__2 = jy; + i__3 = jy; + q__2.r = alpha->r * temp2.r - alpha->i * temp2.i, q__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of CHEMV . */ + +} /* chemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cher2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cher2.c new file mode 100644 index 0000000..0b52d2e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cher2.c @@ -0,0 +1,436 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int cher2_(char *uplo, integer *n, complex *alpha, complex * + x, integer *incx, complex *y, integer *incy, complex *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + doublereal d__1; + complex q__1, q__2, q__3, q__4; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer info; + static complex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + CHER2 performs the hermitian rank 2 operation + + A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A, + + where alpha is a scalar, x and y are n element vectors and A is an n + + by n hermitian matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - COMPLEX array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the hermitian matrix and the strictly + lower triangular part of A is not referenced. On exit, the + upper triangular part of the array A is overwritten by the + upper triangular part of the updated matrix. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the hermitian matrix and the strictly + upper triangular part of A is not referenced. On exit, the + lower triangular part of the array A is overwritten by the + lower triangular part of the updated matrix. + Note that the imaginary parts of the diagonal elements need + + not be set, they are assumed to be zero, and on exit they + are set to zero. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*n)) { + info = 9; + } + if (info != 0) { + xerbla_("CHER2 ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0.f && alpha->i == 0.f) { + return 0; + } + +/* Set up the start points in X and Y if the increments are not both + + unity. */ + + if (*incx != 1 || *incy != 1) { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + jx = kx; + jy = ky; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. */ + + if (lsame_(uplo, "U")) { + +/* Form A when A is stored in the upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + i__3 = j; + if (X(j).r != 0.f || X(j).i != 0.f || (Y(j).r != 0.f + || Y(j).i != 0.f)) { + r_cnjg(&q__2, &Y(j)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp1.r = q__1.r, temp1.i = q__1.i; + i__2 = j; + q__2.r = alpha->r * X(j).r - alpha->i * X(j).i, + q__2.i = alpha->r * X(j).i + alpha->i * X(j) + .r; + r_cnjg(&q__1, &q__2); + temp2.r = q__1.r, temp2.i = q__1.i; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + q__3.r = X(i).r * temp1.r - X(i).i * temp1.i, + q__3.i = X(i).r * temp1.i + X(i).i * + temp1.r; + q__2.r = A(i,j).r + q__3.r, q__2.i = A(i,j).i + + q__3.i; + i__6 = i; + q__4.r = Y(i).r * temp2.r - Y(i).i * temp2.i, + q__4.i = Y(i).r * temp2.i + Y(i).i * + temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; +/* L10: */ + } + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = j; + q__2.r = X(j).r * temp1.r - X(j).i * temp1.i, + q__2.i = X(j).r * temp1.i + X(j).i * + temp1.r; + i__5 = j; + q__3.r = Y(j).r * temp2.r - Y(j).i * temp2.i, + q__3.i = Y(j).r * temp2.i + Y(j).i * + temp2.r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + d__1 = A(j,j).r + q__1.r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } +/* L20: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + i__3 = jy; + if (X(jx).r != 0.f || X(jx).i != 0.f || (Y(jy).r != 0.f + || Y(jy).i != 0.f)) { + r_cnjg(&q__2, &Y(jy)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp1.r = q__1.r, temp1.i = q__1.i; + i__2 = jx; + q__2.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + q__2.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + r_cnjg(&q__1, &q__2); + temp2.r = q__1.r, temp2.i = q__1.i; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + q__3.r = X(ix).r * temp1.r - X(ix).i * temp1.i, + q__3.i = X(ix).r * temp1.i + X(ix).i * + temp1.r; + q__2.r = A(i,j).r + q__3.r, q__2.i = A(i,j).i + + q__3.i; + i__6 = iy; + q__4.r = Y(iy).r * temp2.r - Y(iy).i * temp2.i, + q__4.i = Y(iy).r * temp2.i + Y(iy).i * + temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; + ix += *incx; + iy += *incy; +/* L30: */ + } + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = jx; + q__2.r = X(jx).r * temp1.r - X(jx).i * temp1.i, + q__2.i = X(jx).r * temp1.i + X(jx).i * + temp1.r; + i__5 = jy; + q__3.r = Y(jy).r * temp2.r - Y(jy).i * temp2.i, + q__3.i = Y(jy).r * temp2.i + Y(jy).i * + temp2.r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + d__1 = A(j,j).r + q__1.r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } + jx += *incx; + jy += *incy; +/* L40: */ + } + } + } else { + +/* Form A when A is stored in the lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + i__3 = j; + if (X(j).r != 0.f || X(j).i != 0.f || (Y(j).r != 0.f + || Y(j).i != 0.f)) { + r_cnjg(&q__2, &Y(j)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp1.r = q__1.r, temp1.i = q__1.i; + i__2 = j; + q__2.r = alpha->r * X(j).r - alpha->i * X(j).i, + q__2.i = alpha->r * X(j).i + alpha->i * X(j) + .r; + r_cnjg(&q__1, &q__2); + temp2.r = q__1.r, temp2.i = q__1.i; + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = j; + q__2.r = X(j).r * temp1.r - X(j).i * temp1.i, + q__2.i = X(j).r * temp1.i + X(j).i * + temp1.r; + i__5 = j; + q__3.r = Y(j).r * temp2.r - Y(j).i * temp2.i, + q__3.i = Y(j).r * temp2.i + Y(j).i * + temp2.r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + d__1 = A(j,j).r + q__1.r; + A(j,j).r = d__1, A(j,j).i = 0.f; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + q__3.r = X(i).r * temp1.r - X(i).i * temp1.i, + q__3.i = X(i).r * temp1.i + X(i).i * + temp1.r; + q__2.r = A(i,j).r + q__3.r, q__2.i = A(i,j).i + + q__3.i; + i__6 = i; + q__4.r = Y(i).r * temp2.r - Y(i).i * temp2.i, + q__4.i = Y(i).r * temp2.i + Y(i).i * + temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; +/* L50: */ + } + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + i__3 = jy; + if (X(jx).r != 0.f || X(jx).i != 0.f || (Y(jy).r != 0.f + || Y(jy).i != 0.f)) { + r_cnjg(&q__2, &Y(jy)); + q__1.r = alpha->r * q__2.r - alpha->i * q__2.i, q__1.i = + alpha->r * q__2.i + alpha->i * q__2.r; + temp1.r = q__1.r, temp1.i = q__1.i; + i__2 = jx; + q__2.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + q__2.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + r_cnjg(&q__1, &q__2); + temp2.r = q__1.r, temp2.i = q__1.i; + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = jx; + q__2.r = X(jx).r * temp1.r - X(jx).i * temp1.i, + q__2.i = X(jx).r * temp1.i + X(jx).i * + temp1.r; + i__5 = jy; + q__3.r = Y(jy).r * temp2.r - Y(jy).i * temp2.i, + q__3.i = Y(jy).r * temp2.i + Y(jy).i * + temp2.r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + d__1 = A(j,j).r + q__1.r; + A(j,j).r = d__1, A(j,j).i = 0.f; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + q__3.r = X(ix).r * temp1.r - X(ix).i * temp1.i, + q__3.i = X(ix).r * temp1.i + X(ix).i * + temp1.r; + q__2.r = A(i,j).r + q__3.r, q__2.i = A(i,j).i + + q__3.i; + i__6 = iy; + q__4.r = Y(iy).r * temp2.r - Y(iy).i * temp2.i, + q__4.i = Y(iy).r * temp2.i + Y(iy).i * + temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + A(i,j).r = q__1.r, A(i,j).i = q__1.i; +/* L70: */ + } + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.f; + } + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } + + return 0; + +/* End of CHER2 . */ + +} /* cher2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cscal.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cscal.c new file mode 100644 index 0000000..8cc5173 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cscal.c @@ -0,0 +1,70 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int cscal_(integer *n, complex *ca, complex *cx, integer * + incx) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3, i__4; + complex q__1; + + /* Local variables */ + static integer i, nincx; + + +/* scales a vector by a constant. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define CX(I) cx[(I)-1] + + + if (*n <= 0 || *incx <= 0) { + return 0; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + i__3 = i; + i__4 = i; + q__1.r = ca->r * CX(i).r - ca->i * CX(i).i, q__1.i = ca->r * CX( + i).i + ca->i * CX(i).r; + CX(i).r = q__1.r, CX(i).i = q__1.i; +/* L10: */ + } + return 0; + +/* code for increment equal to 1 */ + +L20: + i__2 = *n; + for (i = 1; i <= *n; ++i) { + i__1 = i; + i__3 = i; + q__1.r = ca->r * CX(i).r - ca->i * CX(i).i, q__1.i = ca->r * CX( + i).i + ca->i * CX(i).r; + CX(i).r = q__1.r, CX(i).i = q__1.i; +/* L30: */ + } + return 0; +} /* cscal_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/cswap.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/cswap.c new file mode 100644 index 0000000..a44b2d0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/cswap.c @@ -0,0 +1,81 @@ +#include "f2c.h" +/*#include "blaswrap.h"*/ + +/* Subroutine */ int cswap_(integer *n, complex *cx, integer *incx, complex * + cy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2, i__3; + + /* Local variables */ + integer i__, ix, iy; + complex ctemp; + +/* .. Scalar Arguments .. */ +/* .. */ +/* .. Array Arguments .. */ +/* .. */ + +/* Purpose */ +/* ======= */ + +/* interchanges two vectors. */ +/* jack dongarra, linpack, 3/11/78. */ +/* modified 12/3/93, array(1) declarations changed to array(*) */ + + +/* .. Local Scalars .. */ +/* .. */ + /* Parameter adjustments */ + --cy; + --cx; + + /* Function Body */ + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal */ +/* to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + i__2 = ix; + ctemp.r = cx[i__2].r, ctemp.i = cx[i__2].i; + i__2 = ix; + i__3 = iy; + cx[i__2].r = cy[i__3].r, cx[i__2].i = cy[i__3].i; + i__2 = iy; + cy[i__2].r = ctemp.r, cy[i__2].i = ctemp.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ +L20: + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + i__2 = i__; + ctemp.r = cx[i__2].r, ctemp.i = cx[i__2].i; + i__2 = i__; + i__3 = i__; + cx[i__2].r = cy[i__3].r, cx[i__2].i = cy[i__3].i; + i__2 = i__; + cy[i__2].r = ctemp.r, cy[i__2].i = ctemp.i; +/* L30: */ + } + return 0; +} /* cswap_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ctrsv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ctrsv.c new file mode 100644 index 0000000..9280ec9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ctrsv.c @@ -0,0 +1,509 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int ctrsv_(char *uplo, char *trans, char *diag, integer *n, + complex *a, integer *lda, complex *x, integer *incx) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void c_div(complex *, complex *, complex *), r_cnjg(complex *, complex *); + + /* Local variables */ + static integer info; + static complex temp; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, jx, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical noconj, nounit; + + +/* Purpose + ======= + + CTRSV solves one of the systems of equations + + A*x = b, or A'*x = b, or conjg( A' )*x = b, + + where b and x are n element vectors and A is an n by n unit, or + non-unit, upper or lower triangular matrix. + + No test for singularity or near-singularity is included in this + routine. Such tests must be performed before calling this routine. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the matrix is an upper or + lower triangular matrix as follows: + + UPLO = 'U' or 'u' A is an upper triangular matrix. + + UPLO = 'L' or 'l' A is a lower triangular matrix. + + Unchanged on exit. + + TRANS - CHARACTER*1. + On entry, TRANS specifies the equations to be solved as + follows: + + TRANS = 'N' or 'n' A*x = b. + + TRANS = 'T' or 't' A'*x = b. + + TRANS = 'C' or 'c' conjg( A' )*x = b. + + Unchanged on exit. + + DIAG - CHARACTER*1. + On entry, DIAG specifies whether or not A is unit + triangular as follows: + + DIAG = 'U' or 'u' A is assumed to be unit triangular. + + DIAG = 'N' or 'n' A is not assumed to be unit + triangular. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + A - COMPLEX array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular matrix and the strictly lower triangular part of + + A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular matrix and the strictly upper triangular part of + + A is not referenced. + Note that when DIAG = 'U' or 'u', the diagonal elements of + + A are not referenced either, but are assumed to be unity. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - COMPLEX array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element right-hand side vector b. On exit, X is overwritten + + with the solution vector x. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (! lsame_(trans, "N") && ! lsame_(trans, "T") && + ! lsame_(trans, "C")) { + info = 2; + } else if (! lsame_(diag, "U") && ! lsame_(diag, "N")) { + info = 3; + } else if (*n < 0) { + info = 4; + } else if (*lda < max(1,*n)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } + if (info != 0) { + xerbla_("CTRSV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0) { + return 0; + } + + noconj = lsame_(trans, "T"); + nounit = lsame_(diag, "N"); + +/* Set up the start point in X if the increment is not unity. This + will be ( N - 1 )*INCX too small for descending loops. */ + + if (*incx <= 0) { + kx = 1 - (*n - 1) * *incx; + } else if (*incx != 1) { + kx = 1; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (lsame_(trans, "N")) { + +/* Form x := inv( A )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + i__1 = j; + if (X(j).r != 0.f || X(j).i != 0.f) { + if (nounit) { + i__1 = j; + c_div(&q__1, &X(j), &A(j,j)); + X(j).r = q__1.r, X(j).i = q__1.i; + } + i__1 = j; + temp.r = X(j).r, temp.i = X(j).i; + for (i = j - 1; i >= 1; --i) { + i__1 = i; + i__2 = i; + i__3 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + q__1.r = X(i).r - q__2.r, q__1.i = X(i).i - + q__2.i; + X(i).r = q__1.r, X(i).i = q__1.i; +/* L10: */ + } + } +/* L20: */ + } + } else { + jx = kx + (*n - 1) * *incx; + for (j = *n; j >= 1; --j) { + i__1 = jx; + if (X(jx).r != 0.f || X(jx).i != 0.f) { + if (nounit) { + i__1 = jx; + c_div(&q__1, &X(jx), &A(j,j)); + X(jx).r = q__1.r, X(jx).i = q__1.i; + } + i__1 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + ix = jx; + for (i = j - 1; i >= 1; --i) { + ix -= *incx; + i__1 = ix; + i__2 = ix; + i__3 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + q__1.r = X(ix).r - q__2.r, q__1.i = X(ix).i - + q__2.i; + X(ix).r = q__1.r, X(ix).i = q__1.i; +/* L30: */ + } + } + jx -= *incx; +/* L40: */ + } + } + } else { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + if (X(j).r != 0.f || X(j).i != 0.f) { + if (nounit) { + i__2 = j; + c_div(&q__1, &X(j), &A(j,j)); + X(j).r = q__1.r, X(j).i = q__1.i; + } + i__2 = j; + temp.r = X(j).r, temp.i = X(j).i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + q__1.r = X(i).r - q__2.r, q__1.i = X(i).i - + q__2.i; + X(i).r = q__1.r, X(i).i = q__1.i; +/* L50: */ + } + } +/* L60: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0.f || X(jx).i != 0.f) { + if (nounit) { + i__2 = jx; + c_div(&q__1, &X(jx), &A(j,j)); + X(jx).r = q__1.r, X(jx).i = q__1.i; + } + i__2 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + ix = jx; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + i__3 = ix; + i__4 = ix; + i__5 = i + j * a_dim1; + q__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + q__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + q__1.r = X(ix).r - q__2.r, q__1.i = X(ix).i - + q__2.i; + X(ix).r = q__1.r, X(ix).i = q__1.i; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } + } else { + +/* Form x := inv( A' )*x or x := inv( conjg( A' ) )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + temp.r = X(j).r, temp.i = X(j).i; + if (noconj) { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i; + q__2.r = A(i,j).r * X(i).r - A(i,j).i * X( + i).i, q__2.i = A(i,j).r * X(i).i + + A(i,j).i * X(i).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L90: */ + } + if (nounit) { + c_div(&q__1, &temp, &A(j,j)); + temp.r = q__1.r, temp.i = q__1.i; + } + } else { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + r_cnjg(&q__3, &A(i,j)); + i__3 = i; + q__2.r = q__3.r * X(i).r - q__3.i * X(i).i, + q__2.i = q__3.r * X(i).i + q__3.i * X( + i).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L100: */ + } + if (nounit) { + r_cnjg(&q__2, &A(j,j)); + c_div(&q__1, &temp, &q__2); + temp.r = q__1.r, temp.i = q__1.i; + } + } + i__2 = j; + X(j).r = temp.r, X(j).i = temp.i; +/* L110: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + ix = kx; + i__2 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + if (noconj) { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = ix; + q__2.r = A(i,j).r * X(ix).r - A(i,j).i * X( + ix).i, q__2.i = A(i,j).r * X(ix).i + + A(i,j).i * X(ix).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix += *incx; +/* L120: */ + } + if (nounit) { + c_div(&q__1, &temp, &A(j,j)); + temp.r = q__1.r, temp.i = q__1.i; + } + } else { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + r_cnjg(&q__3, &A(i,j)); + i__3 = ix; + q__2.r = q__3.r * X(ix).r - q__3.i * X(ix).i, + q__2.i = q__3.r * X(ix).i + q__3.i * X( + ix).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix += *incx; +/* L130: */ + } + if (nounit) { + r_cnjg(&q__2, &A(j,j)); + c_div(&q__1, &temp, &q__2); + temp.r = q__1.r, temp.i = q__1.i; + } + } + i__2 = jx; + X(jx).r = temp.r, X(jx).i = temp.i; + jx += *incx; +/* L140: */ + } + } + } else { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + i__1 = j; + temp.r = X(j).r, temp.i = X(j).i; + if (noconj) { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + i__2 = i + j * a_dim1; + i__3 = i; + q__2.r = A(i,j).r * X(i).r - A(i,j).i * X( + i).i, q__2.i = A(i,j).r * X(i).i + + A(i,j).i * X(i).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L150: */ + } + if (nounit) { + c_div(&q__1, &temp, &A(j,j)); + temp.r = q__1.r, temp.i = q__1.i; + } + } else { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + r_cnjg(&q__3, &A(i,j)); + i__2 = i; + q__2.r = q__3.r * X(i).r - q__3.i * X(i).i, + q__2.i = q__3.r * X(i).i + q__3.i * X( + i).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; +/* L160: */ + } + if (nounit) { + r_cnjg(&q__2, &A(j,j)); + c_div(&q__1, &temp, &q__2); + temp.r = q__1.r, temp.i = q__1.i; + } + } + i__1 = j; + X(j).r = temp.r, X(j).i = temp.i; +/* L170: */ + } + } else { + kx += (*n - 1) * *incx; + jx = kx; + for (j = *n; j >= 1; --j) { + ix = kx; + i__1 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + if (noconj) { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + i__2 = i + j * a_dim1; + i__3 = ix; + q__2.r = A(i,j).r * X(ix).r - A(i,j).i * X( + ix).i, q__2.i = A(i,j).r * X(ix).i + + A(i,j).i * X(ix).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix -= *incx; +/* L180: */ + } + if (nounit) { + c_div(&q__1, &temp, &A(j,j)); + temp.r = q__1.r, temp.i = q__1.i; + } + } else { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + r_cnjg(&q__3, &A(i,j)); + i__2 = ix; + q__2.r = q__3.r * X(ix).r - q__3.i * X(ix).i, + q__2.i = q__3.r * X(ix).i + q__3.i * X( + ix).r; + q__1.r = temp.r - q__2.r, q__1.i = temp.i - + q__2.i; + temp.r = q__1.r, temp.i = q__1.i; + ix -= *incx; +/* L190: */ + } + if (nounit) { + r_cnjg(&q__2, &A(j,j)); + c_div(&q__1, &temp, &q__2); + temp.r = q__1.r, temp.i = q__1.i; + } + } + i__1 = jx; + X(jx).r = temp.r, X(jx).i = temp.i; + jx -= *incx; +/* L200: */ + } + } + } + } + + return 0; + +/* End of CTRSV . */ + +} /* ctrsv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dasum.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dasum.c new file mode 100644 index 0000000..42d1c74 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dasum.c @@ -0,0 +1,88 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dasum_(integer *n, doublereal *dx, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + doublereal ret_val, d__1, d__2, d__3, d__4, d__5, d__6; + + /* Local variables */ + static integer i, m; + static doublereal dtemp; + static integer nincx, mp1; + + +/* takes the sum of the absolute values. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DX(I) dx[(I)-1] + + + ret_val = 0.; + dtemp = 0.; + if (*n <= 0 || *incx <= 0) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + dtemp += (d__1 = DX(i), abs(d__1)); +/* L10: */ + } + ret_val = dtemp; + return ret_val; + +/* code for increment equal to 1 + + + clean-up loop */ + +L20: + m = *n % 6; + if (m == 0) { + goto L40; + } + i__2 = m; + for (i = 1; i <= m; ++i) { + dtemp += (d__1 = DX(i), abs(d__1)); +/* L30: */ + } + if (*n < 6) { + goto L60; + } +L40: + mp1 = m + 1; + i__2 = *n; + for (i = mp1; i <= *n; i += 6) { + dtemp = dtemp + (d__1 = DX(i), abs(d__1)) + (d__2 = DX(i + 1), abs( + d__2)) + (d__3 = DX(i + 2), abs(d__3)) + (d__4 = DX(i + 3), + abs(d__4)) + (d__5 = DX(i + 4), abs(d__5)) + (d__6 = DX(i + 5) + , abs(d__6)); +/* L50: */ + } +L60: + ret_val = dtemp; + return ret_val; +} /* dasum_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/daxpy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/daxpy.c new file mode 100644 index 0000000..953ae62 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/daxpy.c @@ -0,0 +1,94 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int daxpy_(integer *n, doublereal *da, doublereal *dx, + integer *incx, doublereal *dy, integer *incy) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i, m, ix, iy, mp1; + + +/* constant times a vector plus a vector. + uses unrolled loops for increments equal to one. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DY(I) dy[(I)-1] +#define DX(I) dx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*da == 0.) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + DY(iy) += *da * DX(ix); + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 4; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + DY(i) += *da * DX(i); +/* L30: */ + } + if (*n < 4) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 4) { + DY(i) += *da * DX(i); + DY(i + 1) += *da * DX(i + 1); + DY(i + 2) += *da * DX(i + 2); + DY(i + 3) += *da * DX(i + 3); +/* L50: */ + } + return 0; +} /* daxpy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dcabs1.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dcabs1.c new file mode 100644 index 0000000..f4f9f77 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dcabs1.c @@ -0,0 +1,28 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dcabs1_(doublecomplex *z) +{ +/* >>Start of File<< + + System generated locals */ + doublereal ret_val; + static doublecomplex equiv_0[1]; + + /* Local variables */ +#define t ((doublereal *)equiv_0) +#define zz (equiv_0) + + zz->r = z->r, zz->i = z->i; + ret_val = abs(t[0]) + abs(t[1]); + return ret_val; +} /* dcabs1_ */ + +#undef zz +#undef t + + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dcopy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dcopy.c new file mode 100644 index 0000000..a428b8f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dcopy.c @@ -0,0 +1,94 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dcopy_(integer *n, doublereal *dx, integer *incx, + doublereal *dy, integer *incy) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i, m, ix, iy, mp1; + + +/* copies a vector, x, to a vector, y. + uses unrolled loops for increments equal to one. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DY(I) dy[(I)-1] +#define DX(I) dx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + DY(iy) = DX(ix); + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 7; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + DY(i) = DX(i); +/* L30: */ + } + if (*n < 7) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 7) { + DY(i) = DX(i); + DY(i + 1) = DX(i + 1); + DY(i + 2) = DX(i + 2); + DY(i + 3) = DX(i + 3); + DY(i + 4) = DX(i + 4); + DY(i + 5) = DX(i + 5); + DY(i + 6) = DX(i + 6); +/* L50: */ + } + return 0; +} /* dcopy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ddot.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ddot.c new file mode 100644 index 0000000..10ed2b6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ddot.c @@ -0,0 +1,97 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal ddot_(integer *n, doublereal *dx, integer *incx, doublereal *dy, + integer *incy) +{ + + + /* System generated locals */ + integer i__1; + doublereal ret_val; + + /* Local variables */ + static integer i, m; + static doublereal dtemp; + static integer ix, iy, mp1; + + +/* forms the dot product of two vectors. + uses unrolled loops for increments equal to one. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DY(I) dy[(I)-1] +#define DX(I) dx[(I)-1] + + + ret_val = 0.; + dtemp = 0.; + if (*n <= 0) { + return ret_val; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + dtemp += DX(ix) * DY(iy); + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val = dtemp; + return ret_val; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 5; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + dtemp += DX(i) * DY(i); +/* L30: */ + } + if (*n < 5) { + goto L60; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 5) { + dtemp = dtemp + DX(i) * DY(i) + DX(i + 1) * DY(i + 1) + DX(i + 2) * + DY(i + 2) + DX(i + 3) * DY(i + 3) + DX(i + 4) * DY(i + 4); +/* L50: */ + } +L60: + ret_val = dtemp; + return ret_val; +} /* ddot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dgemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dgemv.c new file mode 100644 index 0000000..e82bb65 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dgemv.c @@ -0,0 +1,299 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dgemv_(char *trans, integer *m, integer *n, doublereal * + alpha, doublereal *a, integer *lda, doublereal *x, integer *incx, + doublereal *beta, doublereal *y, integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static doublereal temp; + static integer lenx, leny, i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + DGEMV performs one of the matrix-vector operations + + y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, + + where alpha and beta are scalars, x and y are vectors and A is an + m by n matrix. + + Parameters + ========== + + TRANS - CHARACTER*1. + On entry, TRANS specifies the operation to be performed as + follows: + + TRANS = 'N' or 'n' y := alpha*A*x + beta*y. + + TRANS = 'T' or 't' y := alpha*A'*x + beta*y. + + TRANS = 'C' or 'c' y := alpha*A'*x + beta*y. + + Unchanged on exit. + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - DOUBLE PRECISION. + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + X - DOUBLE PRECISION array of DIMENSION at least + ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. + Before entry, the incremented array X must contain the + vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - DOUBLE PRECISION. + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - DOUBLE PRECISION array of DIMENSION at least + ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. + Before entry with BETA non-zero, the incremented array Y + must contain the vector y. On exit, Y is overwritten by the + + updated vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(trans, "N") && ! lsame_(trans, "T") && ! + lsame_(trans, "C")) { + info = 1; + } else if (*m < 0) { + info = 2; + } else if (*n < 0) { + info = 3; + } else if (*lda < max(1,*m)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } else if (*incy == 0) { + info = 11; + } + if (info != 0) { + xerbla_("DGEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || *alpha == 0. && *beta == 1.) { + return 0; + } + +/* Set LENX and LENY, the lengths of the vectors x and y, and set + + up the start points in X and Y. */ + + if (lsame_(trans, "N")) { + lenx = *n; + leny = *m; + } else { + lenx = *m; + leny = *n; + } + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (lenx - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (leny - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. + + First form y := beta*y. */ + + if (*beta != 1.) { + if (*incy == 1) { + if (*beta == 0.) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(i) = 0.; +/* L10: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(i) = *beta * Y(i); +/* L20: */ + } + } + } else { + iy = ky; + if (*beta == 0.) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(iy) = 0.; + iy += *incy; +/* L30: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(iy) = *beta * Y(iy); + iy += *incy; +/* L40: */ + } + } + } + } + if (*alpha == 0.) { + return 0; + } + if (lsame_(trans, "N")) { + +/* Form y := alpha*A*x + y. */ + + jx = kx; + if (*incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.) { + temp = *alpha * X(jx); + i__2 = *m; + for (i = 1; i <= *m; ++i) { + Y(i) += temp * A(i,j); +/* L50: */ + } + } + jx += *incx; +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.) { + temp = *alpha * X(jx); + iy = ky; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + Y(iy) += temp * A(i,j); + iy += *incy; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } else { + +/* Form y := alpha*A'*x + y. */ + + jy = ky; + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = 0.; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + temp += A(i,j) * X(i); +/* L90: */ + } + Y(jy) += *alpha * temp; + jy += *incy; +/* L100: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = 0.; + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + temp += A(i,j) * X(ix); + ix += *incx; +/* L110: */ + } + Y(jy) += *alpha * temp; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of DGEMV . */ + +} /* dgemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dger.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dger.c new file mode 100644 index 0000000..1e85eb0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dger.c @@ -0,0 +1,182 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dger_(integer *m, integer *n, doublereal *alpha, + doublereal *x, integer *incx, doublereal *y, integer *incy, + doublereal *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static doublereal temp; + static integer i, j, ix, jy, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + DGER performs the rank 1 operation + + A := alpha*x*y' + A, + + where alpha is a scalar, x is an m element vector, y is an n element + + vector and A is an m by n matrix. + + Parameters + ========== + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - DOUBLE PRECISION. + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - DOUBLE PRECISION array of dimension at least + ( 1 + ( m - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the m + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. On exit, A is + overwritten by the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (*m < 0) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*m)) { + info = 9; + } + if (info != 0) { + xerbla_("DGER ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || *alpha == 0.) { + return 0; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (*incy > 0) { + jy = 1; + } else { + jy = 1 - (*n - 1) * *incy; + } + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (Y(jy) != 0.) { + temp = *alpha * Y(jy); + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) += X(i) * temp; +/* L10: */ + } + } + jy += *incy; +/* L20: */ + } + } else { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*m - 1) * *incx; + } + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (Y(jy) != 0.) { + temp = *alpha * Y(jy); + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) += X(ix) * temp; + ix += *incx; +/* L30: */ + } + } + jy += *incy; +/* L40: */ + } + } + + return 0; + +/* End of DGER . */ + +} /* dger_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dnrm2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dnrm2.c new file mode 100644 index 0000000..602813b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dnrm2.c @@ -0,0 +1,83 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dnrm2_(integer *n, doublereal *x, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + doublereal ret_val, d__1; + + /* Builtin functions */ + double sqrt(doublereal); + + /* Local variables */ + static doublereal norm, scale, absxi; + static integer ix; + static doublereal ssq; + + +/* DNRM2 returns the euclidean norm of a vector via the function + name, so that + + DNRM2 := sqrt( x'*x ) + + + + -- This version written on 25-October-1982. + Modified on 14-October-1993 to inline the call to DLASSQ. + Sven Hammarling, Nag Ltd. + + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + + + if (*n < 1 || *incx < 1) { + norm = 0.; + } else if (*n == 1) { + norm = abs(X(1)); + } else { + scale = 0.; + ssq = 1.; +/* The following loop is equivalent to this call to the LAPACK + + auxiliary routine: + CALL DLASSQ( N, X, INCX, SCALE, SSQ ) */ + + i__1 = (*n - 1) * *incx + 1; + i__2 = *incx; + for (ix = 1; *incx < 0 ? ix >= (*n-1)**incx+1 : ix <= (*n-1)**incx+1; ix += *incx) { + if (X(ix) != 0.) { + absxi = (d__1 = X(ix), abs(d__1)); + if (scale < absxi) { +/* Computing 2nd power */ + d__1 = scale / absxi; + ssq = ssq * (d__1 * d__1) + 1.; + scale = absxi; + } else { +/* Computing 2nd power */ + d__1 = absxi / scale; + ssq += d__1 * d__1; + } + } +/* L10: */ + } + norm = scale * sqrt(ssq); + } + + ret_val = norm; + return ret_val; + +/* End of DNRM2. */ + +} /* dnrm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/drot.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/drot.c new file mode 100644 index 0000000..bc5264b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/drot.c @@ -0,0 +1,76 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int drot_(integer *n, doublereal *dx, integer *incx, + doublereal *dy, integer *incy, doublereal *c, doublereal *s) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i; + static doublereal dtemp; + static integer ix, iy; + + +/* applies a plane rotation. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DY(I) dy[(I)-1] +#define DX(I) dx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal + to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + dtemp = *c * DX(ix) + *s * DY(iy); + DY(iy) = *c * DY(iy) - *s * DX(ix); + DX(ix) = dtemp; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + dtemp = *c * DX(i) + *s * DY(i); + DY(i) = *c * DY(i) - *s * DX(i); + DX(i) = dtemp; +/* L30: */ + } + return 0; +} /* drot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dscal.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dscal.c new file mode 100644 index 0000000..2444740 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dscal.c @@ -0,0 +1,83 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dscal_(integer *n, doublereal *da, doublereal *dx, + integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + + /* Local variables */ + static integer i, m, nincx, mp1; + + +/* scales a vector by a constant. + uses unrolled loops for increment equal to one. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DX(I) dx[(I)-1] + + + if (*n <= 0 || *incx <= 0) { + return 0; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + DX(i) = *da * DX(i); +/* L10: */ + } + return 0; + +/* code for increment equal to 1 + + + clean-up loop */ + +L20: + m = *n % 5; + if (m == 0) { + goto L40; + } + i__2 = m; + for (i = 1; i <= m; ++i) { + DX(i) = *da * DX(i); +/* L30: */ + } + if (*n < 5) { + return 0; + } +L40: + mp1 = m + 1; + i__2 = *n; + for (i = mp1; i <= *n; i += 5) { + DX(i) = *da * DX(i); + DX(i + 1) = *da * DX(i + 1); + DX(i + 2) = *da * DX(i + 2); + DX(i + 3) = *da * DX(i + 3); + DX(i + 4) = *da * DX(i + 4); +/* L50: */ + } + return 0; +} /* dscal_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dswap.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dswap.c new file mode 100644 index 0000000..038dd99 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dswap.c @@ -0,0 +1,102 @@ +#include "f2c.h" +/*#include "blaswrap.h"*/ + +/* Subroutine */ int dswap_(integer *n, doublereal *dx, integer *incx, + doublereal *dy, integer *incy) +{ + /* System generated locals */ + integer i__1; + + /* Local variables */ + integer i__, m, ix, iy, mp1; + doublereal dtemp; + +/* .. Scalar Arguments .. */ +/* .. */ +/* .. Array Arguments .. */ +/* .. */ + +/* Purpose */ +/* ======= */ + +/* interchanges two vectors. */ +/* uses unrolled loops for increments equal one. */ +/* jack dongarra, linpack, 3/11/78. */ +/* modified 12/3/93, array(1) declarations changed to array(*) */ + + +/* .. Local Scalars .. */ +/* .. */ +/* .. Intrinsic Functions .. */ +/* .. */ + /* Parameter adjustments */ + --dy; + --dx; + + /* Function Body */ + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal */ +/* to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + dtemp = dx[ix]; + dx[ix] = dy[iy]; + dy[iy] = dtemp; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + + +/* clean-up loop */ + +L20: + m = *n % 3; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i__ = 1; i__ <= i__1; ++i__) { + dtemp = dx[i__]; + dx[i__] = dy[i__]; + dy[i__] = dtemp; +/* L30: */ + } + if (*n < 3) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i__ = mp1; i__ <= i__1; i__ += 3) { + dtemp = dx[i__]; + dx[i__] = dy[i__]; + dy[i__] = dtemp; + dtemp = dx[i__ + 1]; + dx[i__ + 1] = dy[i__ + 1]; + dy[i__ + 1] = dtemp; + dtemp = dx[i__ + 2]; + dx[i__ + 2] = dy[i__ + 2]; + dy[i__ + 2] = dtemp; +/* L50: */ + } + return 0; +} /* dswap_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dsymv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dsymv.c new file mode 100644 index 0000000..e7416b5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dsymv.c @@ -0,0 +1,300 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dsymv_(char *uplo, integer *n, doublereal *alpha, + doublereal *a, integer *lda, doublereal *x, integer *incx, doublereal + *beta, doublereal *y, integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static doublereal temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + DSYMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n symmetric matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - DOUBLE PRECISION. + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - DOUBLE PRECISION. + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("DSYMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || *alpha == 0. && *beta == 1.) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (*beta != 1.) { + if (*incy == 1) { + if (*beta == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(i) = 0.; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(i) = *beta * Y(i); +/* L20: */ + } + } + } else { + iy = ky; + if (*beta == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(iy) = 0.; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(iy) = *beta * Y(iy); + iy += *incy; +/* L40: */ + } + } + } + } + if (*alpha == 0.) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(j); + temp2 = 0.; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + Y(i) += temp1 * A(i,j); + temp2 += A(i,j) * X(i); +/* L50: */ + } + Y(j) = Y(j) + temp1 * A(j,j) + *alpha * temp2; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(jx); + temp2 = 0.; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + Y(iy) += temp1 * A(i,j); + temp2 += A(i,j) * X(ix); + ix += *incx; + iy += *incy; +/* L70: */ + } + Y(jy) = Y(jy) + temp1 * A(j,j) + *alpha * temp2; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(j); + temp2 = 0.; + Y(j) += temp1 * A(j,j); + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + Y(i) += temp1 * A(i,j); + temp2 += A(i,j) * X(i); +/* L90: */ + } + Y(j) += *alpha * temp2; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(jx); + temp2 = 0.; + Y(jy) += temp1 * A(j,j); + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + Y(iy) += temp1 * A(i,j); + temp2 += A(i,j) * X(ix); +/* L110: */ + } + Y(jy) += *alpha * temp2; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of DSYMV . */ + +} /* dsymv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dsyr2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dsyr2.c new file mode 100644 index 0000000..8e6fabe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dsyr2.c @@ -0,0 +1,264 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dsyr2_(char *uplo, integer *n, doublereal *alpha, + doublereal *x, integer *incx, doublereal *y, integer *incy, + doublereal *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static doublereal temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + DSYR2 performs the symmetric rank 2 operation + + A := alpha*x*y' + alpha*y*x' + A, + + where alpha is a scalar, x and y are n element vectors and A is an n + + by n symmetric matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - DOUBLE PRECISION. + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. On exit, the + upper triangular part of the array A is overwritten by the + upper triangular part of the updated matrix. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. On exit, the + lower triangular part of the array A is overwritten by the + lower triangular part of the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*n)) { + info = 9; + } + if (info != 0) { + xerbla_("DSYR2 ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || *alpha == 0.) { + return 0; + } + +/* Set up the start points in X and Y if the increments are not both + + unity. */ + + if (*incx != 1 || *incy != 1) { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + jx = kx; + jy = ky; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. */ + + if (lsame_(uplo, "U")) { + +/* Form A when A is stored in the upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0. || Y(j) != 0.) { + temp1 = *alpha * Y(j); + temp2 = *alpha * X(j); + i__2 = j; + for (i = 1; i <= j; ++i) { + A(i,j) = A(i,j) + X(i) * temp1 + + Y(i) * temp2; +/* L10: */ + } + } +/* L20: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0. || Y(jy) != 0.) { + temp1 = *alpha * Y(jy); + temp2 = *alpha * X(jx); + ix = kx; + iy = ky; + i__2 = j; + for (i = 1; i <= j; ++i) { + A(i,j) = A(i,j) + X(ix) * temp1 + + Y(iy) * temp2; + ix += *incx; + iy += *incy; +/* L30: */ + } + } + jx += *incx; + jy += *incy; +/* L40: */ + } + } + } else { + +/* Form A when A is stored in the lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0. || Y(j) != 0.) { + temp1 = *alpha * Y(j); + temp2 = *alpha * X(j); + i__2 = *n; + for (i = j; i <= *n; ++i) { + A(i,j) = A(i,j) + X(i) * temp1 + + Y(i) * temp2; +/* L50: */ + } + } +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0. || Y(jy) != 0.) { + temp1 = *alpha * Y(jy); + temp2 = *alpha * X(jx); + ix = jx; + iy = jy; + i__2 = *n; + for (i = j; i <= *n; ++i) { + A(i,j) = A(i,j) + X(ix) * temp1 + + Y(iy) * temp2; + ix += *incx; + iy += *incy; +/* L70: */ + } + } + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } + + return 0; + +/* End of DSYR2 . */ + +} /* dsyr2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dtrsv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dtrsv.c new file mode 100644 index 0000000..b0b8bb3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dtrsv.c @@ -0,0 +1,338 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dtrsv_(char *uplo, char *trans, char *diag, integer *n, + doublereal *a, integer *lda, doublereal *x, integer *incx) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static doublereal temp; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, jx, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical nounit; + + +/* Purpose + ======= + + DTRSV solves one of the systems of equations + + A*x = b, or A'*x = b, + + where b and x are n element vectors and A is an n by n unit, or + non-unit, upper or lower triangular matrix. + + No test for singularity or near-singularity is included in this + routine. Such tests must be performed before calling this routine. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the matrix is an upper or + lower triangular matrix as follows: + + UPLO = 'U' or 'u' A is an upper triangular matrix. + + UPLO = 'L' or 'l' A is a lower triangular matrix. + + Unchanged on exit. + + TRANS - CHARACTER*1. + On entry, TRANS specifies the equations to be solved as + follows: + + TRANS = 'N' or 'n' A*x = b. + + TRANS = 'T' or 't' A'*x = b. + + TRANS = 'C' or 'c' A'*x = b. + + Unchanged on exit. + + DIAG - CHARACTER*1. + On entry, DIAG specifies whether or not A is unit + triangular as follows: + + DIAG = 'U' or 'u' A is assumed to be unit triangular. + + DIAG = 'N' or 'n' A is not assumed to be unit + triangular. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular matrix and the strictly lower triangular part of + + A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular matrix and the strictly upper triangular part of + + A is not referenced. + Note that when DIAG = 'U' or 'u', the diagonal elements of + + A are not referenced either, but are assumed to be unity. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - DOUBLE PRECISION array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element right-hand side vector b. On exit, X is overwritten + + with the solution vector x. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (! lsame_(trans, "N") && ! lsame_(trans, "T") && + ! lsame_(trans, "C")) { + info = 2; + } else if (! lsame_(diag, "U") && ! lsame_(diag, "N")) { + info = 3; + } else if (*n < 0) { + info = 4; + } else if (*lda < max(1,*n)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } + if (info != 0) { + xerbla_("DTRSV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0) { + return 0; + } + + nounit = lsame_(diag, "N"); + +/* Set up the start point in X if the increment is not unity. This + will be ( N - 1 )*INCX too small for descending loops. */ + + if (*incx <= 0) { + kx = 1 - (*n - 1) * *incx; + } else if (*incx != 1) { + kx = 1; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (lsame_(trans, "N")) { + +/* Form x := inv( A )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + if (X(j) != 0.) { + if (nounit) { + X(j) /= A(j,j); + } + temp = X(j); + for (i = j - 1; i >= 1; --i) { + X(i) -= temp * A(i,j); +/* L10: */ + } + } +/* L20: */ + } + } else { + jx = kx + (*n - 1) * *incx; + for (j = *n; j >= 1; --j) { + if (X(jx) != 0.) { + if (nounit) { + X(jx) /= A(j,j); + } + temp = X(jx); + ix = jx; + for (i = j - 1; i >= 1; --i) { + ix -= *incx; + X(ix) -= temp * A(i,j); +/* L30: */ + } + } + jx -= *incx; +/* L40: */ + } + } + } else { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0.) { + if (nounit) { + X(j) /= A(j,j); + } + temp = X(j); + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + X(i) -= temp * A(i,j); +/* L50: */ + } + } +/* L60: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.) { + if (nounit) { + X(jx) /= A(j,j); + } + temp = X(jx); + ix = jx; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + X(ix) -= temp * A(i,j); +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } + } else { + +/* Form x := inv( A' )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = X(j); + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + temp -= A(i,j) * X(i); +/* L90: */ + } + if (nounit) { + temp /= A(j,j); + } + X(j) = temp; +/* L100: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = X(jx); + ix = kx; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + temp -= A(i,j) * X(ix); + ix += *incx; +/* L110: */ + } + if (nounit) { + temp /= A(j,j); + } + X(jx) = temp; + jx += *incx; +/* L120: */ + } + } + } else { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + temp = X(j); + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + temp -= A(i,j) * X(i); +/* L130: */ + } + if (nounit) { + temp /= A(j,j); + } + X(j) = temp; +/* L140: */ + } + } else { + kx += (*n - 1) * *incx; + jx = kx; + for (j = *n; j >= 1; --j) { + temp = X(jx); + ix = kx; + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + temp -= A(i,j) * X(ix); + ix -= *incx; +/* L150: */ + } + if (nounit) { + temp /= A(j,j); + } + X(jx) = temp; + jx -= *incx; +/* L160: */ + } + } + } + } + + return 0; + +/* End of DTRSV . */ + +} /* dtrsv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dzasum.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dzasum.c new file mode 100644 index 0000000..5605d1e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dzasum.c @@ -0,0 +1,68 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dzasum_(integer *n, doublecomplex *zx, integer *incx) +{ + + + /* System generated locals */ + integer i__1; + doublereal ret_val; + + /* Local variables */ + static integer i; + static doublereal stemp; + extern doublereal dcabs1_(doublecomplex *); + static integer ix; + + +/* takes the sum of the absolute values. + jack dongarra, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define ZX(I) zx[(I)-1] + + + ret_val = 0.; + stemp = 0.; + if (*n <= 0 || *incx <= 0) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + ix = 1; + i__1 = *n; + for (i = 1; i <= *n; ++i) { + stemp += dcabs1_(&ZX(ix)); + ix += *incx; +/* L10: */ + } + ret_val = stemp; + return ret_val; + +/* code for increment equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + stemp += dcabs1_(&ZX(i)); +/* L30: */ + } + ret_val = stemp; + return ret_val; +} /* dzasum_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/dznrm2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/dznrm2.c new file mode 100644 index 0000000..d0318b7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/dznrm2.c @@ -0,0 +1,96 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dznrm2_(integer *n, doublecomplex *x, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + doublereal ret_val, d__1; + + /* Builtin functions */ + double d_imag(doublecomplex *), sqrt(doublereal); + + /* Local variables */ + static doublereal temp, norm, scale; + static integer ix; + static doublereal ssq; + + +/* DZNRM2 returns the euclidean norm of a vector via the function + name, so that + + DZNRM2 := sqrt( conjg( x' )*x ) + + + + -- This version written on 25-October-1982. + Modified on 14-October-1993 to inline the call to ZLASSQ. + Sven Hammarling, Nag Ltd. + + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + + + if (*n < 1 || *incx < 1) { + norm = 0.; + } else { + scale = 0.; + ssq = 1.; +/* The following loop is equivalent to this call to the LAPACK + + auxiliary routine: + CALL ZLASSQ( N, X, INCX, SCALE, SSQ ) */ + + i__1 = (*n - 1) * *incx + 1; + i__2 = *incx; + for (ix = 1; *incx < 0 ? ix >= (*n-1)**incx+1 : ix <= (*n-1)**incx+1; ix += *incx) { + i__3 = ix; + if (X(ix).r != 0.) { + i__3 = ix; + temp = (d__1 = X(ix).r, abs(d__1)); + if (scale < temp) { +/* Computing 2nd power */ + d__1 = scale / temp; + ssq = ssq * (d__1 * d__1) + 1.; + scale = temp; + } else { +/* Computing 2nd power */ + d__1 = temp / scale; + ssq += d__1 * d__1; + } + } + if (d_imag(&X(ix)) != 0.) { + temp = (d__1 = d_imag(&X(ix)), abs(d__1)); + if (scale < temp) { +/* Computing 2nd power */ + d__1 = scale / temp; + ssq = ssq * (d__1 * d__1) + 1.; + scale = temp; + } else { +/* Computing 2nd power */ + d__1 = temp / scale; + ssq += d__1 * d__1; + } + } +/* L10: */ + } + norm = scale * sqrt(ssq); + } + + ret_val = norm; + return ret_val; + +/* End of DZNRM2. */ + +} /* dznrm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/f2c.h b/thirdparty/superlu/SuperLU_4.1/CBLAS/f2c.h new file mode 100644 index 0000000..3116864 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/f2c.h @@ -0,0 +1,48 @@ +/* f2c.h -- Standard Fortran to C header file */ + +/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + +#include "slu_Cnames.h" + +#ifndef F2C_INCLUDE +#define F2C_INCLUDE + +#if 0 +typedef long int integer; /* 64 on 64-bit machine */ +typedef long int logical; +#endif + +typedef int integer; +typedef int logical; + +typedef char *address; +typedef short int shortint; +typedef float real; +typedef double doublereal; +typedef struct { real r, i; } complex; +typedef struct { doublereal r, i; } doublecomplex; +typedef short int shortlogical; +typedef char logical1; +typedef char integer1; +/* typedef long long longint; */ /* system-dependent */ + +#define TRUE_ (1) +#define FALSE_ (0) + +/* Extern is for use with -E */ +#ifndef Extern +#define Extern extern +#endif + +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (doublereal)abs(x) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define dmin(a,b) (doublereal)min(a,b) +#define dmax(a,b) (doublereal)max(a,b) + +#define VOID void + +#endif diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/icamax.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/icamax.c new file mode 100644 index 0000000..9ff4786 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/icamax.c @@ -0,0 +1,72 @@ +#include "f2c.h" + +integer icamax_(integer *n, complex *cx, integer *incx) +{ + /* System generated locals */ + integer ret_val, i__1, i__2; + real r__1, r__2; + /* Builtin functions */ + double r_imag(complex *); + /* Local variables */ + static real smax; + static integer i, ix; +/* finds the index of element having max. absolute value. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + Parameter adjustments + Function Body */ +#define CX(I) cx[(I)-1] + ret_val = 0; + if (*n < 1 || *incx <= 0) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } +/* code for increment not equal to 1 */ + ix = 1; + smax = (r__1 = CX(1).r, dabs(r__1)) + (r__2 = r_imag(&CX(1)), dabs(r__2)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = ix; + if ((r__1 = CX(ix).r, dabs(r__1)) + (r__2 = r_imag(&CX(ix)), dabs( + r__2)) <= smax) { + goto L5; + } + ret_val = i; + i__2 = ix; + smax = (r__1 = CX(ix).r, dabs(r__1)) + (r__2 = r_imag(&CX(ix)), + dabs(r__2)); +L5: + ix += *incx; +/* L10: */ + } + return ret_val; +/* code for increment equal to 1 */ +L20: + smax = (r__1 = CX(1).r, dabs(r__1)) + (r__2 = r_imag(&CX(1)), dabs(r__2)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = i; + if ((r__1 = CX(i).r, dabs(r__1)) + (r__2 = r_imag(&CX(i)), dabs( + r__2)) <= smax) { + goto L30; + } + ret_val = i; + i__2 = i; + smax = (r__1 = CX(i).r, dabs(r__1)) + (r__2 = r_imag(&CX(i)), dabs( + r__2)); +L30: + ; + } + return ret_val; +} /* icamax_ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/idamax.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/idamax.c new file mode 100644 index 0000000..00ebc23 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/idamax.c @@ -0,0 +1,80 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +integer idamax_(integer *n, doublereal *dx, integer *incx) +{ + + + /* System generated locals */ + integer ret_val, i__1; + doublereal d__1; + + /* Local variables */ + static doublereal dmax__; + static integer i, ix; + + +/* finds the index of element having max. absolute value. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define DX(I) dx[(I)-1] + + + ret_val = 0; + if (*n < 1 || *incx <= 0) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + ix = 1; + dmax__ = abs(DX(1)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if ((d__1 = DX(ix), abs(d__1)) <= dmax__) { + goto L5; + } + ret_val = i; + dmax__ = (d__1 = DX(ix), abs(d__1)); +L5: + ix += *incx; +/* L10: */ + } + return ret_val; + +/* code for increment equal to 1 */ + +L20: + dmax__ = abs(DX(1)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if ((d__1 = DX(i), abs(d__1)) <= dmax__) { + goto L30; + } + ret_val = i; + dmax__ = (d__1 = DX(i), abs(d__1)); +L30: + ; + } + return ret_val; +} /* idamax_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/isamax.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/isamax.c new file mode 100644 index 0000000..b1ad475 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/isamax.c @@ -0,0 +1,80 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +integer isamax_(integer *n, real *sx, integer *incx) +{ + + + /* System generated locals */ + integer ret_val, i__1; + real r__1; + + /* Local variables */ + static real smax; + static integer i, ix; + + +/* finds the index of element having max. absolute value. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SX(I) sx[(I)-1] + + + ret_val = 0; + if (*n < 1 || *incx <= 0) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + ix = 1; + smax = dabs(SX(1)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if ((r__1 = SX(ix), dabs(r__1)) <= smax) { + goto L5; + } + ret_val = i; + smax = (r__1 = SX(ix), dabs(r__1)); +L5: + ix += *incx; +/* L10: */ + } + return ret_val; + +/* code for increment equal to 1 */ + +L20: + smax = dabs(SX(1)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if ((r__1 = SX(i), dabs(r__1)) <= smax) { + goto L30; + } + ret_val = i; + smax = (r__1 = SX(i), dabs(r__1)); +L30: + ; + } + return ret_val; +} /* isamax_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/izamax.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/izamax.c new file mode 100644 index 0000000..44959d0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/izamax.c @@ -0,0 +1,81 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +integer izamax_(integer *n, doublecomplex *zx, integer *incx) +{ + + + /* System generated locals */ + integer ret_val, i__1; + + /* Local variables */ + static doublereal smax; + static integer i; + extern doublereal dcabs1_(doublecomplex *); + static integer ix; + + +/* finds the index of element having max. absolute value. + jack dongarra, 1/15/85. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define ZX(I) zx[(I)-1] + + + ret_val = 0; + if (*n < 1 || *incx <= 0) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + ix = 1; + smax = dcabs1_(&ZX(1)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if (dcabs1_(&ZX(ix)) <= smax) { + goto L5; + } + ret_val = i; + smax = dcabs1_(&ZX(ix)); +L5: + ix += *incx; +/* L10: */ + } + return ret_val; + +/* code for increment equal to 1 */ + +L20: + smax = dcabs1_(&ZX(1)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + if (dcabs1_(&ZX(i)) <= smax) { + goto L30; + } + ret_val = i; + smax = dcabs1_(&ZX(i)); +L30: + ; + } + return ret_val; +} /* izamax_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sasum.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sasum.c new file mode 100644 index 0000000..29eafe4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sasum.c @@ -0,0 +1,89 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +real sasum_(integer *n, real *sx, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + real ret_val, r__1, r__2, r__3, r__4, r__5, r__6; + + /* Local variables */ + static integer i, m, nincx; + static real stemp; + static integer mp1; + + +/* takes the sum of the absolute values. + uses unrolled loops for increment equal to one. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SX(I) sx[(I)-1] + + + ret_val = 0.f; + stemp = 0.f; + if (*n <= 0 || *incx <= 0) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + stemp += (r__1 = SX(i), dabs(r__1)); +/* L10: */ + } + ret_val = stemp; + return ret_val; + +/* code for increment equal to 1 + + + clean-up loop */ + +L20: + m = *n % 6; + if (m == 0) { + goto L40; + } + i__2 = m; + for (i = 1; i <= m; ++i) { + stemp += (r__1 = SX(i), dabs(r__1)); +/* L30: */ + } + if (*n < 6) { + goto L60; + } +L40: + mp1 = m + 1; + i__2 = *n; + for (i = mp1; i <= *n; i += 6) { + stemp = stemp + (r__1 = SX(i), dabs(r__1)) + (r__2 = SX(i + 1), dabs( + r__2)) + (r__3 = SX(i + 2), dabs(r__3)) + (r__4 = SX(i + 3), + dabs(r__4)) + (r__5 = SX(i + 4), dabs(r__5)) + (r__6 = SX(i + + 5), dabs(r__6)); +/* L50: */ + } +L60: + ret_val = stemp; + return ret_val; +} /* sasum_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/saxpy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/saxpy.c new file mode 100644 index 0000000..06c26f3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/saxpy.c @@ -0,0 +1,94 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int saxpy_(integer *n, real *sa, real *sx, integer *incx, + real *sy, integer *incy) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i, m, ix, iy, mp1; + + +/* constant times a vector plus a vector. + uses unrolled loop for increments equal to one. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SY(I) sy[(I)-1] +#define SX(I) sx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*sa == 0.f) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + SY(iy) += *sa * SX(ix); + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 4; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + SY(i) += *sa * SX(i); +/* L30: */ + } + if (*n < 4) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 4) { + SY(i) += *sa * SX(i); + SY(i + 1) += *sa * SX(i + 1); + SY(i + 2) += *sa * SX(i + 2); + SY(i + 3) += *sa * SX(i + 3); +/* L50: */ + } + return 0; +} /* saxpy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/scasum.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/scasum.c new file mode 100644 index 0000000..5c3d351 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/scasum.c @@ -0,0 +1,74 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +real scasum_(integer *n, complex *cx, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + real ret_val, r__1, r__2; + + /* Builtin functions */ + double r_imag(complex *); + + /* Local variables */ + static integer i, nincx; + static real stemp; + + +/* takes the sum of the absolute values of a complex vector and + returns a single precision result. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define CX(I) cx[(I)-1] + + + ret_val = 0.f; + stemp = 0.f; + if (*n <= 0 || *incx <= 0) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + i__3 = i; + stemp = stemp + (r__1 = CX(i).r, dabs(r__1)) + (r__2 = r_imag(&CX( + i)), dabs(r__2)); +/* L10: */ + } + ret_val = stemp; + return ret_val; + +/* code for increment equal to 1 */ + +L20: + i__2 = *n; + for (i = 1; i <= *n; ++i) { + i__1 = i; + stemp = stemp + (r__1 = CX(i).r, dabs(r__1)) + (r__2 = r_imag(&CX( + i)), dabs(r__2)); +/* L30: */ + } + ret_val = stemp; + return ret_val; +} /* scasum_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/scnrm2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/scnrm2.c new file mode 100644 index 0000000..8325b3d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/scnrm2.c @@ -0,0 +1,96 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +real scnrm2_(integer *n, complex *x, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + real ret_val, r__1; + + /* Builtin functions */ + double r_imag(complex *), sqrt(doublereal); + + /* Local variables */ + static real temp, norm, scale; + static integer ix; + static real ssq; + + +/* SCNRM2 returns the euclidean norm of a vector via the function + name, so that + + SCNRM2 := sqrt( conjg( x' )*x ) + + + + -- This version written on 25-October-1982. + Modified on 14-October-1993 to inline the call to CLASSQ. + Sven Hammarling, Nag Ltd. + + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + + + if (*n < 1 || *incx < 1) { + norm = 0.f; + } else { + scale = 0.f; + ssq = 1.f; +/* The following loop is equivalent to this call to the LAPACK + + auxiliary routine: + CALL CLASSQ( N, X, INCX, SCALE, SSQ ) */ + + i__1 = (*n - 1) * *incx + 1; + i__2 = *incx; + for (ix = 1; *incx < 0 ? ix >= (*n-1)**incx+1 : ix <= (*n-1)**incx+1; ix += *incx) { + i__3 = ix; + if (X(ix).r != 0.f) { + i__3 = ix; + temp = (r__1 = X(ix).r, dabs(r__1)); + if (scale < temp) { +/* Computing 2nd power */ + r__1 = scale / temp; + ssq = ssq * (r__1 * r__1) + 1.f; + scale = temp; + } else { +/* Computing 2nd power */ + r__1 = temp / scale; + ssq += r__1 * r__1; + } + } + if (r_imag(&X(ix)) != 0.f) { + temp = (r__1 = r_imag(&X(ix)), dabs(r__1)); + if (scale < temp) { +/* Computing 2nd power */ + r__1 = scale / temp; + ssq = ssq * (r__1 * r__1) + 1.f; + scale = temp; + } else { +/* Computing 2nd power */ + r__1 = temp / scale; + ssq += r__1 * r__1; + } + } +/* L10: */ + } + norm = scale * sqrt(ssq); + } + + ret_val = norm; + return ret_val; + +/* End of SCNRM2. */ + +} /* scnrm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/scopy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/scopy.c new file mode 100644 index 0000000..4e7a238 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/scopy.c @@ -0,0 +1,94 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int scopy_(integer *n, real *sx, integer *incx, real *sy, + integer *incy) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i, m, ix, iy, mp1; + + +/* copies a vector, x, to a vector, y. + uses unrolled loops for increments equal to 1. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SY(I) sy[(I)-1] +#define SX(I) sx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + SY(iy) = SX(ix); + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 7; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + SY(i) = SX(i); +/* L30: */ + } + if (*n < 7) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 7) { + SY(i) = SX(i); + SY(i + 1) = SX(i + 1); + SY(i + 2) = SX(i + 2); + SY(i + 3) = SX(i + 3); + SY(i + 4) = SX(i + 4); + SY(i + 5) = SX(i + 5); + SY(i + 6) = SX(i + 6); +/* L50: */ + } + return 0; +} /* scopy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sdot.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sdot.c new file mode 100644 index 0000000..b553937 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sdot.c @@ -0,0 +1,96 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +real sdot_(integer *n, real *sx, integer *incx, real *sy, integer *incy) +{ + + + /* System generated locals */ + integer i__1; + real ret_val; + + /* Local variables */ + static integer i, m; + static real stemp; + static integer ix, iy, mp1; + + +/* forms the dot product of two vectors. + uses unrolled loops for increments equal to one. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SY(I) sy[(I)-1] +#define SX(I) sx[(I)-1] + + + stemp = 0.f; + ret_val = 0.f; + if (*n <= 0) { + return ret_val; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + stemp += SX(ix) * SY(iy); + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val = stemp; + return ret_val; + +/* code for both increments equal to 1 + + + clean-up loop */ + +L20: + m = *n % 5; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i = 1; i <= m; ++i) { + stemp += SX(i) * SY(i); +/* L30: */ + } + if (*n < 5) { + goto L60; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i = mp1; i <= *n; i += 5) { + stemp = stemp + SX(i) * SY(i) + SX(i + 1) * SY(i + 1) + SX(i + 2) * + SY(i + 2) + SX(i + 3) * SY(i + 3) + SX(i + 4) * SY(i + 4); +/* L50: */ + } +L60: + ret_val = stemp; + return ret_val; +} /* sdot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sgemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sgemv.c new file mode 100644 index 0000000..9910c18 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sgemv.c @@ -0,0 +1,299 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int sgemv_(char *trans, integer *m, integer *n, real *alpha, + real *a, integer *lda, real *x, integer *incx, real *beta, real *y, + integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static real temp; + static integer lenx, leny, i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + SGEMV performs one of the matrix-vector operations + + y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, + + where alpha and beta are scalars, x and y are vectors and A is an + m by n matrix. + + Parameters + ========== + + TRANS - CHARACTER*1. + On entry, TRANS specifies the operation to be performed as + follows: + + TRANS = 'N' or 'n' y := alpha*A*x + beta*y. + + TRANS = 'T' or 't' y := alpha*A'*x + beta*y. + + TRANS = 'C' or 'c' y := alpha*A'*x + beta*y. + + Unchanged on exit. + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - REAL . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - REAL array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + X - REAL array of DIMENSION at least + ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. + Before entry, the incremented array X must contain the + vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - REAL . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - REAL array of DIMENSION at least + ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. + Before entry with BETA non-zero, the incremented array Y + must contain the vector y. On exit, Y is overwritten by the + + updated vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(trans, "N") && ! lsame_(trans, "T") && ! + lsame_(trans, "C")) { + info = 1; + } else if (*m < 0) { + info = 2; + } else if (*n < 0) { + info = 3; + } else if (*lda < max(1,*m)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } else if (*incy == 0) { + info = 11; + } + if (info != 0) { + xerbla_("SGEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || *alpha == 0.f && *beta == 1.f) { + return 0; + } + +/* Set LENX and LENY, the lengths of the vectors x and y, and set + + up the start points in X and Y. */ + + if (lsame_(trans, "N")) { + lenx = *n; + leny = *m; + } else { + lenx = *m; + leny = *n; + } + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (lenx - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (leny - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. + + First form y := beta*y. */ + + if (*beta != 1.f) { + if (*incy == 1) { + if (*beta == 0.f) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(i) = 0.f; +/* L10: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(i) = *beta * Y(i); +/* L20: */ + } + } + } else { + iy = ky; + if (*beta == 0.f) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(iy) = 0.f; + iy += *incy; +/* L30: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + Y(iy) = *beta * Y(iy); + iy += *incy; +/* L40: */ + } + } + } + } + if (*alpha == 0.f) { + return 0; + } + if (lsame_(trans, "N")) { + +/* Form y := alpha*A*x + y. */ + + jx = kx; + if (*incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.f) { + temp = *alpha * X(jx); + i__2 = *m; + for (i = 1; i <= *m; ++i) { + Y(i) += temp * A(i,j); +/* L50: */ + } + } + jx += *incx; +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.f) { + temp = *alpha * X(jx); + iy = ky; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + Y(iy) += temp * A(i,j); + iy += *incy; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } else { + +/* Form y := alpha*A'*x + y. */ + + jy = ky; + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = 0.f; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + temp += A(i,j) * X(i); +/* L90: */ + } + Y(jy) += *alpha * temp; + jy += *incy; +/* L100: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = 0.f; + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + temp += A(i,j) * X(ix); + ix += *incx; +/* L110: */ + } + Y(jy) += *alpha * temp; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of SGEMV . */ + +} /* sgemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sger.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sger.c new file mode 100644 index 0000000..d73fd6c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sger.c @@ -0,0 +1,181 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int sger_(integer *m, integer *n, real *alpha, real *x, + integer *incx, real *y, integer *incy, real *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static real temp; + static integer i, j, ix, jy, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + SGER performs the rank 1 operation + + A := alpha*x*y' + A, + + where alpha is a scalar, x is an m element vector, y is an n element + + vector and A is an m by n matrix. + + Parameters + ========== + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - REAL . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - REAL array of dimension at least + ( 1 + ( m - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the m + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - REAL array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. On exit, A is + overwritten by the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (*m < 0) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*m)) { + info = 9; + } + if (info != 0) { + xerbla_("SGER ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || *alpha == 0.f) { + return 0; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (*incy > 0) { + jy = 1; + } else { + jy = 1 - (*n - 1) * *incy; + } + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (Y(jy) != 0.f) { + temp = *alpha * Y(jy); + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) += X(i) * temp; +/* L10: */ + } + } + jy += *incy; +/* L20: */ + } + } else { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*m - 1) * *incx; + } + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (Y(jy) != 0.f) { + temp = *alpha * Y(jy); + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) += X(ix) * temp; + ix += *incx; +/* L30: */ + } + } + jy += *incy; +/* L40: */ + } + } + + return 0; + +/* End of SGER . */ + +} /* sger_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/slu_Cnames.h b/thirdparty/superlu/SuperLU_4.1/CBLAS/slu_Cnames.h new file mode 100644 index 0000000..7bcd1bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/slu_Cnames.h @@ -0,0 +1,458 @@ +/*! @file slu_Cnames.h + * \brief Macros defining how C routines will be called + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 1, 1997
    + *
    + * These macros define how C routines will be called.  ADD_ assumes that
    + * they will be called by fortran, which expects C routines to have an
    + * underscore postfixed to the name (Suns, and the Intel expect this).
    + * NOCHANGE indicates that fortran will be calling, and that it expects
    + * the name called by fortran to be identical to that compiled by the C
    + * (RS6K's do this).  UPCASE says it expects C routines called by fortran
    + * to be in all upcase (CRAY wants this). 
    + * 
    + */ +#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */ +#define __SUPERLU_CNAMES + + +#define ADD_ 0 +#define ADD__ 1 +#define NOCHANGE 2 +#define UPCASE 3 +#define OLD_CRAY 4 +#define C_CALL 5 + +#ifdef UpCase +#define F77_CALL_C UPCASE +#endif + +#ifdef NoChange +#define F77_CALL_C NOCHANGE +#endif + +#ifdef Add_ +#define F77_CALL_C ADD_ +#endif + +#ifdef Add__ +#define F77_CALL_C ADD__ +#endif + +#ifdef _CRAY +#define F77_CALL_C OLD_CRAY +#endif + +/* Default */ +#ifndef F77_CALL_C +#define F77_CALL_C ADD_ +#endif + + +#if (F77_CALL_C == ADD_) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * No redefinition necessary to have following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm_(...) + * + * This is the default. + */ + +#endif + +#if (F77_CALL_C == ADD__) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm__(...) + */ +/* BLAS */ +#define sswap_ sswap__ +#define saxpy_ saxpy__ +#define sasum_ sasum__ +#define isamax_ isamax__ +#define scopy_ scopy__ +#define sscal_ sscal__ +#define sger_ sger__ +#define snrm2_ snrm2__ +#define ssymv_ ssymv__ +#define sdot_ sdot__ +#define saxpy_ saxpy__ +#define ssyr2_ ssyr2__ +#define srot_ srot__ +#define sgemv_ sgemv__ +#define strsv_ strsv__ +#define sgemm_ sgemm__ +#define strsm_ strsm__ + +#define dswap_ dswap__ +#define daxpy_ daxpy__ +#define dasum_ dasum__ +#define idamax_ idamax__ +#define dcopy_ dcopy__ +#define dscal_ dscal__ +#define dger_ dger__ +#define dnrm2_ dnrm2__ +#define dsymv_ dsymv__ +#define ddot_ ddot__ +#define dsyr2_ dsyr2__ +#define drot_ drot__ +#define dgemv_ dgemv__ +#define dtrsv_ dtrsv__ +#define dgemm_ dgemm__ +#define dtrsm_ dtrsm__ + +#define cswap_ cswap__ +#define caxpy_ caxpy__ +#define scasum_ scasum__ +#define icamax_ icamax__ +#define ccopy_ ccopy__ +#define cscal_ cscal__ +#define scnrm2_ scnrm2__ +#define caxpy_ caxpy__ +#define cgemv_ cgemv__ +#define ctrsv_ ctrsv__ +#define cgemm_ cgemm__ +#define ctrsm_ ctrsm__ +#define cgerc_ cgerc__ +#define chemv_ chemv__ +#define cher2_ cher2__ + +#define zswap_ zswap__ +#define zaxpy_ zaxpy__ +#define dzasum_ dzasum__ +#define izamax_ izamax__ +#define zcopy_ zcopy__ +#define zscal_ zscal__ +#define dznrm2_ dznrm2__ +#define zaxpy_ zaxpy__ +#define zgemv_ zgemv__ +#define ztrsv_ ztrsv__ +#define zgemm_ zgemm__ +#define ztrsm_ ztrsm__ +#define zgerc_ zgerc__ +#define zhemv_ zhemv__ +#define zher2_ zher2__ + +/* LAPACK */ +#define dlamch_ dlamch__ +#define slamch_ slamch__ +#define xerbla_ xerbla__ +#define lsame_ lsame__ +#define dlacon_ dlacon__ +#define slacon_ slacon__ +#define icmax1_ icmax1__ +#define scsum1_ scsum1__ +#define clacon_ clacon__ +#define dzsum1_ dzsum1__ +#define izmax1_ izmax1__ +#define zlacon_ zlacon__ + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv__ +#define c_fortran_sgssv_ c_fortran_sgssv__ +#define c_fortran_dgssv_ c_fortran_dgssv__ +#define c_fortran_cgssv_ c_fortran_cgssv__ +#define c_fortran_zgssv_ c_fortran_zgssv__ +#endif + +#if (F77_CALL_C == UPCASE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void DGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define saxpy_ SAXPY +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ DSWAP +#define daxpy_ DAXPY +#define dasum_ DASUM +#define idamax_ IDAMAX +#define dcopy_ DCOPY +#define dscal_ DSCAL +#define dger_ DGER +#define dnrm2_ DNRM2 +#define dsymv_ DSYMV +#define ddot_ DDOT +#define dsyr2_ DSYR2 +#define drot_ DROT +#define dgemv_ DGEMV +#define dtrsv_ DTRSV +#define dgemm_ DGEMM +#define dtrsm_ DTRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == OLD_CRAY) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void SGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ SSWAP +#define daxpy_ SAXPY +#define dasum_ SASUM +#define idamax_ ISAMAX +#define dcopy_ SCOPY +#define dscal_ SSCAL +#define dger_ SGER +#define dnrm2_ SNRM2 +#define dsymv_ SSYMV +#define ddot_ SDOT +#define dsyr2_ SSYR2 +#define drot_ SROT +#define dgemv_ SGEMV +#define dtrsv_ STRSV +#define dgemm_ SGEMM +#define dtrsm_ STRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define caxpy_ CAXPY +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == NOCHANGE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm(...) + */ +/* BLAS */ +#define sswap_ sswap +#define saxpy_ saxpy +#define sasum_ sasum +#define isamax_ isamax +#define scopy_ scopy +#define sscal_ sscal +#define sger_ sger +#define snrm2_ snrm2 +#define ssymv_ ssymv +#define sdot_ sdot +#define saxpy_ saxpy +#define ssyr2_ ssyr2 +#define srot_ srot +#define sgemv_ sgemv +#define strsv_ strsv +#define sgemm_ sgemm +#define strsm_ strsm + +#define dswap_ dswap +#define daxpy_ daxpy +#define dasum_ dasum +#define idamax_ idamax +#define dcopy_ dcopy +#define dscal_ dscal +#define dger_ dger +#define dnrm2_ dnrm2 +#define dsymv_ dsymv +#define ddot_ ddot +#define dsyr2_ dsyr2 +#define drot_ drot +#define dgemv_ dgemv +#define dtrsv_ dtrsv +#define dgemm_ dgemm +#define dtrsm_ dtrsm + +#define cswap_ cswap +#define caxpy_ caxpy +#define scasum_ scasum +#define icamax_ icamax +#define ccopy_ ccopy +#define cscal_ cscal +#define scnrm2_ scnrm2 +#define cgemv_ cgemv +#define ctrsv_ ctrsv +#define cgemm_ cgemm +#define ctrsm_ ctrsm +#define cgerc_ cgerc +#define chemv_ chemv +#define cher2_ cher2 + +#define zswap_ zswap +#define zaxpy_ zaxpy +#define dzasum_ dzasum +#define izamax_ izamax +#define zcopy_ zcopy +#define zscal_ zscal +#define dznrm2_ dznrm2 +#define zgemv_ zgemv +#define ztrsv_ ztrsv +#define zgemm_ zgemm +#define ztrsm_ ztrsm +#define zgerc_ zgerc +#define zhemv_ zhemv +#define zher2_ zher2 + +/* LAPACK */ +#define dlamch_ dlamch +#define slamch_ slamch +#define xerbla_ xerbla +#define lsame_ lsame +#define dlacon_ dlacon +#define slacon_ slacon +#define icmax1_ icmax1 +#define scsum1_ scsum1 +#define clacon_ clacon +#define dzsum1_ dzsum1 +#define izmax1_ izmax1 +#define zlacon_ zlacon + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv +#define c_fortran_sgssv_ c_fortran_sgssv +#define c_fortran_dgssv_ c_fortran_dgssv +#define c_fortran_cgssv_ c_fortran_cgssv +#define c_fortran_zgssv_ c_fortran_zgssv +#endif + + +#endif /* __SUPERLU_CNAMES */ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/snrm2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/snrm2.c new file mode 100644 index 0000000..99b4003 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/snrm2.c @@ -0,0 +1,83 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +real snrm2_(integer *n, real *x, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + real ret_val, r__1; + + /* Builtin functions */ + double sqrt(doublereal); + + /* Local variables */ + static real norm, scale, absxi; + static integer ix; + static real ssq; + + +/* SNRM2 returns the euclidean norm of a vector via the function + name, so that + + SNRM2 := sqrt( x'*x ) + + + + -- This version written on 25-October-1982. + Modified on 14-October-1993 to inline the call to SLASSQ. + Sven Hammarling, Nag Ltd. + + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + + + if (*n < 1 || *incx < 1) { + norm = 0.f; + } else if (*n == 1) { + norm = dabs(X(1)); + } else { + scale = 0.f; + ssq = 1.f; +/* The following loop is equivalent to this call to the LAPACK + + auxiliary routine: + CALL SLASSQ( N, X, INCX, SCALE, SSQ ) */ + + i__1 = (*n - 1) * *incx + 1; + i__2 = *incx; + for (ix = 1; *incx < 0 ? ix >= (*n-1)**incx+1 : ix <= (*n-1)**incx+1; ix += *incx) { + if (X(ix) != 0.f) { + absxi = (r__1 = X(ix), dabs(r__1)); + if (scale < absxi) { +/* Computing 2nd power */ + r__1 = scale / absxi; + ssq = ssq * (r__1 * r__1) + 1.f; + scale = absxi; + } else { +/* Computing 2nd power */ + r__1 = absxi / scale; + ssq += r__1 * r__1; + } + } +/* L10: */ + } + norm = scale * sqrt(ssq); + } + + ret_val = norm; + return ret_val; + +/* End of SNRM2. */ + +} /* snrm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/srot.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/srot.c new file mode 100644 index 0000000..bdbb234 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/srot.c @@ -0,0 +1,76 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int srot_(integer *n, real *sx, integer *incx, real *sy, + integer *incy, real *c, real *s) +{ + + + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer i; + static real stemp; + static integer ix, iy; + + +/* applies a plane rotation. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SY(I) sy[(I)-1] +#define SX(I) sx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal + to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + stemp = *c * SX(ix) + *s * SY(iy); + SY(iy) = *c * SY(iy) - *s * SX(ix); + SX(ix) = stemp; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + stemp = *c * SX(i) + *s * SY(i); + SY(i) = *c * SY(i) - *s * SX(i); + SX(i) = stemp; +/* L30: */ + } + return 0; +} /* srot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sscal.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sscal.c new file mode 100644 index 0000000..a21ad4e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sscal.c @@ -0,0 +1,82 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int sscal_(integer *n, real *sa, real *sx, integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2; + + /* Local variables */ + static integer i, m, nincx, mp1; + + +/* scales a vector by a constant. + uses unrolled loops for increment equal to 1. + jack dongarra, linpack, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define SX(I) sx[(I)-1] + + + if (*n <= 0 || *incx <= 0) { + return 0; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + SX(i) = *sa * SX(i); +/* L10: */ + } + return 0; + +/* code for increment equal to 1 + + + clean-up loop */ + +L20: + m = *n % 5; + if (m == 0) { + goto L40; + } + i__2 = m; + for (i = 1; i <= m; ++i) { + SX(i) = *sa * SX(i); +/* L30: */ + } + if (*n < 5) { + return 0; + } +L40: + mp1 = m + 1; + i__2 = *n; + for (i = mp1; i <= *n; i += 5) { + SX(i) = *sa * SX(i); + SX(i + 1) = *sa * SX(i + 1); + SX(i + 2) = *sa * SX(i + 2); + SX(i + 3) = *sa * SX(i + 3); + SX(i + 4) = *sa * SX(i + 4); +/* L50: */ + } + return 0; +} /* sscal_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/sswap.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/sswap.c new file mode 100644 index 0000000..e6463a3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/sswap.c @@ -0,0 +1,102 @@ +#include "f2c.h" +/*#include "blaswrap.h"*/ + +/* Subroutine */ int sswap_(integer *n, real *sx, integer *incx, real *sy, + integer *incy) +{ + /* System generated locals */ + integer i__1; + + /* Local variables */ + integer i__, m, ix, iy, mp1; + real stemp; + +/* .. Scalar Arguments .. */ +/* .. */ +/* .. Array Arguments .. */ +/* .. */ + +/* Purpose */ +/* ======= */ + +/* interchanges two vectors. */ +/* uses unrolled loops for increments equal to 1. */ +/* jack dongarra, linpack, 3/11/78. */ +/* modified 12/3/93, array(1) declarations changed to array(*) */ + + +/* .. Local Scalars .. */ +/* .. */ +/* .. Intrinsic Functions .. */ +/* .. */ + /* Parameter adjustments */ + --sy; + --sx; + + /* Function Body */ + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal */ +/* to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + stemp = sx[ix]; + sx[ix] = sy[iy]; + sy[iy] = stemp; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + + +/* clean-up loop */ + +L20: + m = *n % 3; + if (m == 0) { + goto L40; + } + i__1 = m; + for (i__ = 1; i__ <= i__1; ++i__) { + stemp = sx[i__]; + sx[i__] = sy[i__]; + sy[i__] = stemp; +/* L30: */ + } + if (*n < 3) { + return 0; + } +L40: + mp1 = m + 1; + i__1 = *n; + for (i__ = mp1; i__ <= i__1; i__ += 3) { + stemp = sx[i__]; + sx[i__] = sy[i__]; + sy[i__] = stemp; + stemp = sx[i__ + 1]; + sx[i__ + 1] = sy[i__ + 1]; + sy[i__ + 1] = stemp; + stemp = sx[i__ + 2]; + sx[i__ + 2] = sy[i__ + 2]; + sy[i__ + 2] = stemp; +/* L50: */ + } + return 0; +} /* sswap_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ssymv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ssymv.c new file mode 100644 index 0000000..1f7418b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ssymv.c @@ -0,0 +1,300 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int ssymv_(char *uplo, integer *n, real *alpha, real *a, + integer *lda, real *x, integer *incx, real *beta, real *y, integer * + incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static real temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + SSYMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n symmetric matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - REAL . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - REAL array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - REAL . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("SSYMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || *alpha == 0.f && *beta == 1.f) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (*beta != 1.f) { + if (*incy == 1) { + if (*beta == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(i) = 0.f; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(i) = *beta * Y(i); +/* L20: */ + } + } + } else { + iy = ky; + if (*beta == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(iy) = 0.f; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + Y(iy) = *beta * Y(iy); + iy += *incy; +/* L40: */ + } + } + } + } + if (*alpha == 0.f) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(j); + temp2 = 0.f; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + Y(i) += temp1 * A(i,j); + temp2 += A(i,j) * X(i); +/* L50: */ + } + Y(j) = Y(j) + temp1 * A(j,j) + *alpha * temp2; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(jx); + temp2 = 0.f; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + Y(iy) += temp1 * A(i,j); + temp2 += A(i,j) * X(ix); + ix += *incx; + iy += *incy; +/* L70: */ + } + Y(jy) = Y(jy) + temp1 * A(j,j) + *alpha * temp2; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(j); + temp2 = 0.f; + Y(j) += temp1 * A(j,j); + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + Y(i) += temp1 * A(i,j); + temp2 += A(i,j) * X(i); +/* L90: */ + } + Y(j) += *alpha * temp2; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp1 = *alpha * X(jx); + temp2 = 0.f; + Y(jy) += temp1 * A(j,j); + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + Y(iy) += temp1 * A(i,j); + temp2 += A(i,j) * X(ix); +/* L110: */ + } + Y(jy) += *alpha * temp2; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of SSYMV . */ + +} /* ssymv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ssyr2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ssyr2.c new file mode 100644 index 0000000..be43dfa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ssyr2.c @@ -0,0 +1,263 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int ssyr2_(char *uplo, integer *n, real *alpha, real *x, + integer *incx, real *y, integer *incy, real *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static real temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + SSYR2 performs the symmetric rank 2 operation + + A := alpha*x*y' + alpha*y*x' + A, + + where alpha is a scalar, x and y are n element vectors and A is an n + + by n symmetric matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - REAL . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - REAL array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. On exit, the + upper triangular part of the array A is overwritten by the + upper triangular part of the updated matrix. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. On exit, the + lower triangular part of the array A is overwritten by the + lower triangular part of the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*n)) { + info = 9; + } + if (info != 0) { + xerbla_("SSYR2 ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || *alpha == 0.f) { + return 0; + } + +/* Set up the start points in X and Y if the increments are not both + + unity. */ + + if (*incx != 1 || *incy != 1) { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + jx = kx; + jy = ky; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. */ + + if (lsame_(uplo, "U")) { + +/* Form A when A is stored in the upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0.f || Y(j) != 0.f) { + temp1 = *alpha * Y(j); + temp2 = *alpha * X(j); + i__2 = j; + for (i = 1; i <= j; ++i) { + A(i,j) = A(i,j) + X(i) * temp1 + + Y(i) * temp2; +/* L10: */ + } + } +/* L20: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.f || Y(jy) != 0.f) { + temp1 = *alpha * Y(jy); + temp2 = *alpha * X(jx); + ix = kx; + iy = ky; + i__2 = j; + for (i = 1; i <= j; ++i) { + A(i,j) = A(i,j) + X(ix) * temp1 + + Y(iy) * temp2; + ix += *incx; + iy += *incy; +/* L30: */ + } + } + jx += *incx; + jy += *incy; +/* L40: */ + } + } + } else { + +/* Form A when A is stored in the lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0.f || Y(j) != 0.f) { + temp1 = *alpha * Y(j); + temp2 = *alpha * X(j); + i__2 = *n; + for (i = j; i <= *n; ++i) { + A(i,j) = A(i,j) + X(i) * temp1 + + Y(i) * temp2; +/* L50: */ + } + } +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.f || Y(jy) != 0.f) { + temp1 = *alpha * Y(jy); + temp2 = *alpha * X(jx); + ix = jx; + iy = jy; + i__2 = *n; + for (i = j; i <= *n; ++i) { + A(i,j) = A(i,j) + X(ix) * temp1 + + Y(iy) * temp2; + ix += *incx; + iy += *incy; +/* L70: */ + } + } + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } + + return 0; + +/* End of SSYR2 . */ + +} /* ssyr2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/strsv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/strsv.c new file mode 100644 index 0000000..39da363 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/strsv.c @@ -0,0 +1,338 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int strsv_(char *uplo, char *trans, char *diag, integer *n, + real *a, integer *lda, real *x, integer *incx) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + + /* Local variables */ + static integer info; + static real temp; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, jx, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical nounit; + + +/* Purpose + ======= + + STRSV solves one of the systems of equations + + A*x = b, or A'*x = b, + + where b and x are n element vectors and A is an n by n unit, or + non-unit, upper or lower triangular matrix. + + No test for singularity or near-singularity is included in this + routine. Such tests must be performed before calling this routine. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the matrix is an upper or + lower triangular matrix as follows: + + UPLO = 'U' or 'u' A is an upper triangular matrix. + + UPLO = 'L' or 'l' A is a lower triangular matrix. + + Unchanged on exit. + + TRANS - CHARACTER*1. + On entry, TRANS specifies the equations to be solved as + follows: + + TRANS = 'N' or 'n' A*x = b. + + TRANS = 'T' or 't' A'*x = b. + + TRANS = 'C' or 'c' A'*x = b. + + Unchanged on exit. + + DIAG - CHARACTER*1. + On entry, DIAG specifies whether or not A is unit + triangular as follows: + + DIAG = 'U' or 'u' A is assumed to be unit triangular. + + DIAG = 'N' or 'n' A is not assumed to be unit + triangular. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + A - REAL array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular matrix and the strictly lower triangular part of + + A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular matrix and the strictly upper triangular part of + + A is not referenced. + Note that when DIAG = 'U' or 'u', the diagonal elements of + + A are not referenced either, but are assumed to be unity. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - REAL array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element right-hand side vector b. On exit, X is overwritten + + with the solution vector x. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (! lsame_(trans, "N") && ! lsame_(trans, "T") && + ! lsame_(trans, "C")) { + info = 2; + } else if (! lsame_(diag, "U") && ! lsame_(diag, "N")) { + info = 3; + } else if (*n < 0) { + info = 4; + } else if (*lda < max(1,*n)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } + if (info != 0) { + xerbla_("STRSV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0) { + return 0; + } + + nounit = lsame_(diag, "N"); + +/* Set up the start point in X if the increment is not unity. This + will be ( N - 1 )*INCX too small for descending loops. */ + + if (*incx <= 0) { + kx = 1 - (*n - 1) * *incx; + } else if (*incx != 1) { + kx = 1; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (lsame_(trans, "N")) { + +/* Form x := inv( A )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + if (X(j) != 0.f) { + if (nounit) { + X(j) /= A(j,j); + } + temp = X(j); + for (i = j - 1; i >= 1; --i) { + X(i) -= temp * A(i,j); +/* L10: */ + } + } +/* L20: */ + } + } else { + jx = kx + (*n - 1) * *incx; + for (j = *n; j >= 1; --j) { + if (X(jx) != 0.f) { + if (nounit) { + X(jx) /= A(j,j); + } + temp = X(jx); + ix = jx; + for (i = j - 1; i >= 1; --i) { + ix -= *incx; + X(ix) -= temp * A(i,j); +/* L30: */ + } + } + jx -= *incx; +/* L40: */ + } + } + } else { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(j) != 0.f) { + if (nounit) { + X(j) /= A(j,j); + } + temp = X(j); + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + X(i) -= temp * A(i,j); +/* L50: */ + } + } +/* L60: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + if (X(jx) != 0.f) { + if (nounit) { + X(jx) /= A(j,j); + } + temp = X(jx); + ix = jx; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + X(ix) -= temp * A(i,j); +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } + } else { + +/* Form x := inv( A' )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = X(j); + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + temp -= A(i,j) * X(i); +/* L90: */ + } + if (nounit) { + temp /= A(j,j); + } + X(j) = temp; +/* L100: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp = X(jx); + ix = kx; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + temp -= A(i,j) * X(ix); + ix += *incx; +/* L110: */ + } + if (nounit) { + temp /= A(j,j); + } + X(jx) = temp; + jx += *incx; +/* L120: */ + } + } + } else { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + temp = X(j); + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + temp -= A(i,j) * X(i); +/* L130: */ + } + if (nounit) { + temp /= A(j,j); + } + X(j) = temp; +/* L140: */ + } + } else { + kx += (*n - 1) * *incx; + jx = kx; + for (j = *n; j >= 1; --j) { + temp = X(jx); + ix = kx; + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + temp -= A(i,j) * X(ix); + ix -= *incx; +/* L150: */ + } + if (nounit) { + temp /= A(j,j); + } + X(jx) = temp; + jx -= *incx; +/* L160: */ + } + } + } + } + + return 0; + +/* End of STRSV . */ + +} /* strsv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/superlu_f2c.h b/thirdparty/superlu/SuperLU_4.1/CBLAS/superlu_f2c.h new file mode 100644 index 0000000..caa33e1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/superlu_f2c.h @@ -0,0 +1,48 @@ +/* f2c.h -- Standard Fortran to C header file */ + +/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + +#include "Cnames.h" + +#ifndef F2C_INCLUDE +#define F2C_INCLUDE + +#if 0 +typedef long int integer; /* 64 on 64-bit machine */ +typedef long int logical; +#endif + +typedef int integer; +typedef int logical; + +typedef char *address; +typedef short int shortint; +typedef float real; +typedef double doublereal; +typedef struct { real r, i; } complex; +typedef struct { doublereal r, i; } doublecomplex; +typedef short int shortlogical; +typedef char logical1; +typedef char integer1; +/* typedef long long longint; */ /* system-dependent */ + +#define TRUE_ (1) +#define FALSE_ (0) + +/* Extern is for use with -E */ +#ifndef Extern +#define Extern extern +#endif + +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (doublereal)abs(x) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define dmin(a,b) (doublereal)min(a,b) +#define dmax(a,b) (doublereal)max(a,b) + +#define VOID void + +#endif diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zaxpy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zaxpy.c new file mode 100644 index 0000000..37d4f32 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zaxpy.c @@ -0,0 +1,87 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zaxpy_(integer *n, doublecomplex *za, doublecomplex *zx, + integer *incx, doublecomplex *zy, integer *incy) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3, i__4; + doublecomplex z__1, z__2; + + /* Local variables */ + static integer i; + extern doublereal dcabs1_(doublecomplex *); + static integer ix, iy; + + +/* constant times a vector plus a vector. + jack dongarra, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + Parameter adjustments + Function Body */ +#define ZY(I) zy[(I)-1] +#define ZX(I) zx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (dcabs1_(za) == 0.) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + i__4 = ix; + z__2.r = za->r * ZX(ix).r - za->i * ZX(ix).i, z__2.i = za->r * ZX( + ix).i + za->i * ZX(ix).r; + z__1.r = ZY(iy).r + z__2.r, z__1.i = ZY(iy).i + z__2.i; + ZY(iy).r = z__1.r, ZY(iy).i = z__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + i__4 = i; + z__2.r = za->r * ZX(i).r - za->i * ZX(i).i, z__2.i = za->r * ZX( + i).i + za->i * ZX(i).r; + z__1.r = ZY(i).r + z__2.r, z__1.i = ZY(i).i + z__2.i; + ZY(i).r = z__1.r, ZY(i).i = z__1.i; +/* L30: */ + } + return 0; +} /* zaxpy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zcopy.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zcopy.c new file mode 100644 index 0000000..4cec89c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zcopy.c @@ -0,0 +1,74 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zcopy_(integer *n, doublecomplex *zx, integer *incx, + doublecomplex *zy, integer *incy) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + + /* Local variables */ + static integer i, ix, iy; + + +/* copies a vector, x, to a vector, y. + jack dongarra, linpack, 4/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define ZY(I) zy[(I)-1] +#define ZX(I) zx[(I)-1] + + + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = ix; + ZY(iy).r = ZX(ix).r, ZY(iy).i = ZX(ix).i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + ZY(i).r = ZX(i).r, ZY(i).i = ZX(i).i; +/* L30: */ + } + return 0; +} /* zcopy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zdotc.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zdotc.c new file mode 100644 index 0000000..63ba4fb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zdotc.c @@ -0,0 +1,85 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Double Complex */ VOID zdotc_(doublecomplex * ret_val, integer *n, + doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer i; + static doublecomplex ztemp; + static integer ix, iy; + + +/* forms the dot product of a vector. + jack dongarra, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + Parameter adjustments */ + --zy; + --zx; + + /* Function Body */ + ztemp.r = 0., ztemp.i = 0.; + ret_val->r = 0., ret_val->i = 0.; + if (*n <= 0) { + return ; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + d_cnjg(&z__3, &zx[ix]); + i__2 = iy; + z__2.r = z__3.r * zy[iy].r - z__3.i * zy[iy].i, z__2.i = z__3.r * + zy[iy].i + z__3.i * zy[iy].r; + z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i; + ztemp.r = z__1.r, ztemp.i = z__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val->r = ztemp.r, ret_val->i = ztemp.i; + return ; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + d_cnjg(&z__3, &zx[i]); + i__2 = i; + z__2.r = z__3.r * zy[i].r - z__3.i * zy[i].i, z__2.i = z__3.r * + zy[i].i + z__3.i * zy[i].r; + z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i; + ztemp.r = z__1.r, ztemp.i = z__1.i; +/* L30: */ + } + ret_val->r = ztemp.r, ret_val->i = ztemp.i; + return ; +} /* zdotc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zgemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zgemv.c new file mode 100644 index 0000000..18e12bf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zgemv.c @@ -0,0 +1,400 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zgemv_(char *trans, integer *m, integer *n, + doublecomplex *alpha, doublecomplex *a, integer *lda, doublecomplex * + x, integer *incx, doublecomplex *beta, doublecomplex *y, integer * + incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer info; + static doublecomplex temp; + static integer lenx, leny, i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical noconj; + + +/* Purpose + ======= + + ZGEMV performs one of the matrix-vector operations + + y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, or + + y := alpha*conjg( A' )*x + beta*y, + + where alpha and beta are scalars, x and y are vectors and A is an + m by n matrix. + + Parameters + ========== + + TRANS - CHARACTER*1. + On entry, TRANS specifies the operation to be performed as + follows: + + TRANS = 'N' or 'n' y := alpha*A*x + beta*y. + + TRANS = 'T' or 't' y := alpha*A'*x + beta*y. + + TRANS = 'C' or 'c' y := alpha*conjg( A' )*x + beta*y. + + Unchanged on exit. + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX*16 . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX*16 array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + X - COMPLEX*16 array of DIMENSION at least + ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. + Before entry, the incremented array X must contain the + vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX*16 . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX*16 array of DIMENSION at least + ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' + and at least + ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. + Before entry with BETA non-zero, the incremented array Y + must contain the vector y. On exit, Y is overwritten by the + + updated vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(trans, "N") && ! lsame_(trans, "T") && ! + lsame_(trans, "C")) { + info = 1; + } else if (*m < 0) { + info = 2; + } else if (*n < 0) { + info = 3; + } else if (*lda < max(1,*m)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } else if (*incy == 0) { + info = 11; + } + if (info != 0) { + xerbla_("ZGEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || alpha->r == 0. && alpha->i == 0. && (beta->r == + 1. && beta->i == 0.)) { + return 0; + } + + noconj = lsame_(trans, "T"); + +/* Set LENX and LENY, the lengths of the vectors x and y, and set + + up the start points in X and Y. */ + + if (lsame_(trans, "N")) { + lenx = *n; + leny = *m; + } else { + lenx = *m; + leny = *n; + } + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (lenx - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (leny - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. + + First form y := beta*y. */ + + if (beta->r != 1. || beta->i != 0.) { + if (*incy == 1) { + if (beta->r == 0. && beta->i == 0.) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = i; + Y(i).r = 0., Y(i).i = 0.; +/* L10: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = i; + i__3 = i; + z__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + z__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = z__1.r, Y(i).i = z__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0. && beta->i == 0.) { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = iy; + Y(iy).r = 0., Y(iy).i = 0.; + iy += *incy; +/* L30: */ + } + } else { + i__1 = leny; + for (i = 1; i <= leny; ++i) { + i__2 = iy; + i__3 = iy; + z__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + z__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0. && alpha->i == 0.) { + return 0; + } + if (lsame_(trans, "N")) { + +/* Form y := alpha*A*x + y. */ + + jx = kx; + if (*incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0. || X(jx).i != 0.) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + z__1.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + temp.r = z__1.r, temp.i = z__1.i; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j) + .r; + z__1.r = Y(i).r + z__2.r, z__1.i = Y(i).i + + z__2.i; + Y(i).r = z__1.r, Y(i).i = z__1.i; +/* L50: */ + } + } + jx += *incx; +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0. || X(jx).i != 0.) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + z__1.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + temp.r = z__1.r, temp.i = z__1.i; + iy = ky; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j) + .r; + z__1.r = Y(iy).r + z__2.r, z__1.i = Y(iy).i + + z__2.i; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + iy += *incy; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } else { + +/* Form y := alpha*A'*x + y or y := alpha*conjg( A' )*x + y. + */ + + jy = ky; + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp.r = 0., temp.i = 0.; + if (noconj) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i; + z__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i) + .i, z__2.i = A(i,j).r * X(i).i + A(i,j) + .i * X(i).r; + z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L90: */ + } + } else { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + d_cnjg(&z__3, &A(i,j)); + i__3 = i; + z__2.r = z__3.r * X(i).r - z__3.i * X(i).i, + z__2.i = z__3.r * X(i).i + z__3.i * X(i) + .r; + z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L100: */ + } + } + i__2 = jy; + i__3 = jy; + z__2.r = alpha->r * temp.r - alpha->i * temp.i, z__2.i = + alpha->r * temp.i + alpha->i * temp.r; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jy += *incy; +/* L110: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + temp.r = 0., temp.i = 0.; + ix = kx; + if (noconj) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = ix; + z__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix) + .i, z__2.i = A(i,j).r * X(ix).i + A(i,j) + .i * X(ix).r; + z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix += *incx; +/* L120: */ + } + } else { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + d_cnjg(&z__3, &A(i,j)); + i__3 = ix; + z__2.r = z__3.r * X(ix).r - z__3.i * X(ix).i, + z__2.i = z__3.r * X(ix).i + z__3.i * X(ix) + .r; + z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix += *incx; +/* L130: */ + } + } + i__2 = jy; + i__3 = jy; + z__2.r = alpha->r * temp.r - alpha->i * temp.i, z__2.i = + alpha->r * temp.i + alpha->i * temp.r; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jy += *incy; +/* L140: */ + } + } + } + + return 0; + +/* End of ZGEMV . */ + +} /* zgemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zgerc.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zgerc.c new file mode 100644 index 0000000..2fcd218 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zgerc.c @@ -0,0 +1,206 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zgerc_(integer *m, integer *n, doublecomplex *alpha, + doublecomplex *x, integer *incx, doublecomplex *y, integer *incy, + doublecomplex *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublecomplex z__1, z__2; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer info; + static doublecomplex temp; + static integer i, j, ix, jy, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + ZGERC performs the rank 1 operation + + A := alpha*x*conjg( y' ) + A, + + where alpha is a scalar, x is an m element vector, y is an n element + + vector and A is an m by n matrix. + + Parameters + ========== + + M - INTEGER. + On entry, M specifies the number of rows of the matrix A. + M must be at least zero. + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the number of columns of the matrix A. + + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX*16 . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - COMPLEX*16 array of dimension at least + ( 1 + ( m - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the m + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - COMPLEX*16 array of DIMENSION ( LDA, n ). + Before entry, the leading m by n part of the array A must + contain the matrix of coefficients. On exit, A is + overwritten by the updated matrix. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, m ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (*m < 0) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*m)) { + info = 9; + } + if (info != 0) { + xerbla_("ZGERC ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*m == 0 || *n == 0 || alpha->r == 0. && alpha->i == 0.) { + return 0; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (*incy > 0) { + jy = 1; + } else { + jy = 1 - (*n - 1) * *incy; + } + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jy; + if (Y(jy).r != 0. || Y(jy).i != 0.) { + d_cnjg(&z__2, &Y(jy)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp.r = z__1.r, temp.i = z__1.i; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + z__2.r = X(i).r * temp.r - X(i).i * temp.i, z__2.i = + X(i).r * temp.i + X(i).i * temp.r; + z__1.r = A(i,j).r + z__2.r, z__1.i = A(i,j).i + z__2.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; +/* L10: */ + } + } + jy += *incy; +/* L20: */ + } + } else { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*m - 1) * *incx; + } + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jy; + if (Y(jy).r != 0. || Y(jy).i != 0.) { + d_cnjg(&z__2, &Y(jy)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp.r = z__1.r, temp.i = z__1.i; + ix = kx; + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + z__2.r = X(ix).r * temp.r - X(ix).i * temp.i, z__2.i = + X(ix).r * temp.i + X(ix).i * temp.r; + z__1.r = A(i,j).r + z__2.r, z__1.i = A(i,j).i + z__2.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; + ix += *incx; +/* L30: */ + } + } + jy += *incy; +/* L40: */ + } + } + + return 0; + +/* End of ZGERC . */ + +} /* zgerc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zhemv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zhemv.c new file mode 100644 index 0000000..848f9db --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zhemv.c @@ -0,0 +1,421 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zhemv_(char *uplo, integer *n, doublecomplex *alpha, + doublecomplex *a, integer *lda, doublecomplex *x, integer *incx, + doublecomplex *beta, doublecomplex *y, integer *incy) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublereal d__1; + doublecomplex z__1, z__2, z__3, z__4; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer info; + static doublecomplex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + ZHEMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n hermitian matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX*16 . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX*16 array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the hermitian matrix and the strictly + lower triangular part of A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the hermitian matrix and the strictly + upper triangular part of A is not referenced. + Note that the imaginary parts of the diagonal elements need + + not be set and are assumed to be zero. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX*16 . + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("ZHEMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0. && alpha->i == 0. && (beta->r == 1. && + beta->i == 0.)) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (beta->r != 1. || beta->i != 0.) { + if (*incy == 1) { + if (beta->r == 0. && beta->i == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + Y(i).r = 0., Y(i).i = 0.; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + z__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + z__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = z__1.r, Y(i).i = z__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0. && beta->i == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + Y(iy).r = 0., Y(iy).i = 0.; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + z__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + z__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0. && alpha->i == 0.) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + z__1.r = alpha->r * X(j).r - alpha->i * X(j).i, z__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(i).r + z__2.r, z__1.i = Y(i).i + z__2.i; + Y(i).r = z__1.r, Y(i).i = z__1.i; + d_cnjg(&z__3, &A(i,j)); + i__3 = i; + z__2.r = z__3.r * X(i).r - z__3.i * X(i).i, z__2.i = + z__3.r * X(i).i + z__3.i * X(i).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L50: */ + } + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + z__3.r = d__1 * temp1.r, z__3.i = d__1 * temp1.i; + z__2.r = Y(j).r + z__3.r, z__2.i = Y(j).i + z__3.i; + z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, z__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(iy).r + z__2.r, z__1.i = Y(iy).i + z__2.i; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + d_cnjg(&z__3, &A(i,j)); + i__3 = ix; + z__2.r = z__3.r * X(ix).r - z__3.i * X(ix).i, z__2.i = + z__3.r * X(ix).i + z__3.i * X(ix).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; + ix += *incx; + iy += *incy; +/* L70: */ + } + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + z__3.r = d__1 * temp1.r, z__3.i = d__1 * temp1.i; + z__2.r = Y(jy).r + z__3.r, z__2.i = Y(jy).i + z__3.i; + z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + z__1.r = alpha->r * X(j).r - alpha->i * X(j).i, z__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + z__2.r = d__1 * temp1.r, z__2.i = d__1 * temp1.i; + z__1.r = Y(j).r + z__2.r, z__1.i = Y(j).i + z__2.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(i).r + z__2.r, z__1.i = Y(i).i + z__2.i; + Y(i).r = z__1.r, Y(i).i = z__1.i; + d_cnjg(&z__3, &A(i,j)); + i__3 = i; + z__2.r = z__3.r * X(i).r - z__3.i * X(i).i, z__2.i = + z__3.r * X(i).i + z__3.i * X(i).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L90: */ + } + i__2 = j; + i__3 = j; + z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = Y(j).r + z__2.r, z__1.i = Y(j).i + z__2.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, z__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + d__1 = A(j,j).r; + z__2.r = d__1 * temp1.r, z__2.i = d__1 * temp1.i; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(iy).r + z__2.r, z__1.i = Y(iy).i + z__2.i; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + d_cnjg(&z__3, &A(i,j)); + i__3 = ix; + z__2.r = z__3.r * X(ix).r - z__3.i * X(ix).i, z__2.i = + z__3.r * X(ix).i + z__3.i * X(ix).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L110: */ + } + i__2 = jy; + i__3 = jy; + z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of ZHEMV . */ + +} /* zhemv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zher2.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zher2.c new file mode 100644 index 0000000..ab1ceb7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zher2.c @@ -0,0 +1,437 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zher2_(char *uplo, integer *n, doublecomplex *alpha, + doublecomplex *x, integer *incx, doublecomplex *y, integer *incy, + doublecomplex *a, integer *lda) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + doublereal d__1; + doublecomplex z__1, z__2, z__3, z__4; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer info; + static doublecomplex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +/* Purpose + ======= + + ZHER2 performs the hermitian rank 2 operation + + A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A, + + where alpha is a scalar, x and y are n element vectors and A is an n + + by n hermitian matrix. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX*16 . + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + X - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element vector x. + Unchanged on exit. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + Y - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. + Unchanged on exit. + + INCY - INTEGER. + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + A - COMPLEX*16 array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the hermitian matrix and the strictly + lower triangular part of A is not referenced. On exit, the + upper triangular part of the array A is overwritten by the + upper triangular part of the updated matrix. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the hermitian matrix and the strictly + upper triangular part of A is not referenced. On exit, the + lower triangular part of the array A is overwritten by the + lower triangular part of the updated matrix. + Note that the imaginary parts of the diagonal elements need + + not be set, they are assumed to be zero, and on exit they + are set to zero. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*incx == 0) { + info = 5; + } else if (*incy == 0) { + info = 7; + } else if (*lda < max(1,*n)) { + info = 9; + } + if (info != 0) { + xerbla_("ZHER2 ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0. && alpha->i == 0.) { + return 0; + } + +/* Set up the start points in X and Y if the increments are not both + + unity. */ + + if (*incx != 1 || *incy != 1) { + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + jx = kx; + jy = ky; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. */ + + if (lsame_(uplo, "U")) { + +/* Form A when A is stored in the upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + i__3 = j; + if (X(j).r != 0. || X(j).i != 0. || (Y(j).r != 0. || + Y(j).i != 0.)) { + d_cnjg(&z__2, &Y(j)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp1.r = z__1.r, temp1.i = z__1.i; + i__2 = j; + z__2.r = alpha->r * X(j).r - alpha->i * X(j).i, + z__2.i = alpha->r * X(j).i + alpha->i * X(j) + .r; + d_cnjg(&z__1, &z__2); + temp2.r = z__1.r, temp2.i = z__1.i; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + z__3.r = X(i).r * temp1.r - X(i).i * temp1.i, + z__3.i = X(i).r * temp1.i + X(i).i * + temp1.r; + z__2.r = A(i,j).r + z__3.r, z__2.i = A(i,j).i + + z__3.i; + i__6 = i; + z__4.r = Y(i).r * temp2.r - Y(i).i * temp2.i, + z__4.i = Y(i).r * temp2.i + Y(i).i * + temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; +/* L10: */ + } + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = j; + z__2.r = X(j).r * temp1.r - X(j).i * temp1.i, + z__2.i = X(j).r * temp1.i + X(j).i * + temp1.r; + i__5 = j; + z__3.r = Y(j).r * temp2.r - Y(j).i * temp2.i, + z__3.i = Y(j).r * temp2.i + Y(j).i * + temp2.r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + d__1 = A(j,j).r + z__1.r; + A(j,j).r = d__1, A(j,j).i = 0.; + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.; + } +/* L20: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + i__3 = jy; + if (X(jx).r != 0. || X(jx).i != 0. || (Y(jy).r != 0. || + Y(jy).i != 0.)) { + d_cnjg(&z__2, &Y(jy)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp1.r = z__1.r, temp1.i = z__1.i; + i__2 = jx; + z__2.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + z__2.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + d_cnjg(&z__1, &z__2); + temp2.r = z__1.r, temp2.i = z__1.i; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + z__3.r = X(ix).r * temp1.r - X(ix).i * temp1.i, + z__3.i = X(ix).r * temp1.i + X(ix).i * + temp1.r; + z__2.r = A(i,j).r + z__3.r, z__2.i = A(i,j).i + + z__3.i; + i__6 = iy; + z__4.r = Y(iy).r * temp2.r - Y(iy).i * temp2.i, + z__4.i = Y(iy).r * temp2.i + Y(iy).i * + temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; + ix += *incx; + iy += *incy; +/* L30: */ + } + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = jx; + z__2.r = X(jx).r * temp1.r - X(jx).i * temp1.i, + z__2.i = X(jx).r * temp1.i + X(jx).i * + temp1.r; + i__5 = jy; + z__3.r = Y(jy).r * temp2.r - Y(jy).i * temp2.i, + z__3.i = Y(jy).r * temp2.i + Y(jy).i * + temp2.r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + d__1 = A(j,j).r + z__1.r; + A(j,j).r = d__1, A(j,j).i = 0.; + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.; + } + jx += *incx; + jy += *incy; +/* L40: */ + } + } + } else { + +/* Form A when A is stored in the lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + i__3 = j; + if (X(j).r != 0. || X(j).i != 0. || (Y(j).r != 0. || + Y(j).i != 0.)) { + d_cnjg(&z__2, &Y(j)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp1.r = z__1.r, temp1.i = z__1.i; + i__2 = j; + z__2.r = alpha->r * X(j).r - alpha->i * X(j).i, + z__2.i = alpha->r * X(j).i + alpha->i * X(j) + .r; + d_cnjg(&z__1, &z__2); + temp2.r = z__1.r, temp2.i = z__1.i; + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = j; + z__2.r = X(j).r * temp1.r - X(j).i * temp1.i, + z__2.i = X(j).r * temp1.i + X(j).i * + temp1.r; + i__5 = j; + z__3.r = Y(j).r * temp2.r - Y(j).i * temp2.i, + z__3.i = Y(j).r * temp2.i + Y(j).i * + temp2.r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + d__1 = A(j,j).r + z__1.r; + A(j,j).r = d__1, A(j,j).i = 0.; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = i; + z__3.r = X(i).r * temp1.r - X(i).i * temp1.i, + z__3.i = X(i).r * temp1.i + X(i).i * + temp1.r; + z__2.r = A(i,j).r + z__3.r, z__2.i = A(i,j).i + + z__3.i; + i__6 = i; + z__4.r = Y(i).r * temp2.r - Y(i).i * temp2.i, + z__4.i = Y(i).r * temp2.i + Y(i).i * + temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; +/* L50: */ + } + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.; + } +/* L60: */ + } + } else { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + i__3 = jy; + if (X(jx).r != 0. || X(jx).i != 0. || (Y(jy).r != 0. || + Y(jy).i != 0.)) { + d_cnjg(&z__2, &Y(jy)); + z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i = + alpha->r * z__2.i + alpha->i * z__2.r; + temp1.r = z__1.r, temp1.i = z__1.i; + i__2 = jx; + z__2.r = alpha->r * X(jx).r - alpha->i * X(jx).i, + z__2.i = alpha->r * X(jx).i + alpha->i * X(jx) + .r; + d_cnjg(&z__1, &z__2); + temp2.r = z__1.r, temp2.i = z__1.i; + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + i__4 = jx; + z__2.r = X(jx).r * temp1.r - X(jx).i * temp1.i, + z__2.i = X(jx).r * temp1.i + X(jx).i * + temp1.r; + i__5 = jy; + z__3.r = Y(jy).r * temp2.r - Y(jy).i * temp2.i, + z__3.i = Y(jy).r * temp2.i + Y(jy).i * + temp2.r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + d__1 = A(j,j).r + z__1.r; + A(j,j).r = d__1, A(j,j).i = 0.; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = i + j * a_dim1; + i__4 = i + j * a_dim1; + i__5 = ix; + z__3.r = X(ix).r * temp1.r - X(ix).i * temp1.i, + z__3.i = X(ix).r * temp1.i + X(ix).i * + temp1.r; + z__2.r = A(i,j).r + z__3.r, z__2.i = A(i,j).i + + z__3.i; + i__6 = iy; + z__4.r = Y(iy).r * temp2.r - Y(iy).i * temp2.i, + z__4.i = Y(iy).r * temp2.i + Y(iy).i * + temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + A(i,j).r = z__1.r, A(i,j).i = z__1.i; +/* L70: */ + } + } else { + i__2 = j + j * a_dim1; + i__3 = j + j * a_dim1; + d__1 = A(j,j).r; + A(j,j).r = d__1, A(j,j).i = 0.; + } + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } + + return 0; + +/* End of ZHER2 . */ + +} /* zher2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zscal.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zscal.c new file mode 100644 index 0000000..b3d88bb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zscal.c @@ -0,0 +1,70 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int zscal_(integer *n, doublecomplex *za, doublecomplex *zx, + integer *incx) +{ + + + /* System generated locals */ + integer i__1, i__2, i__3; + doublecomplex z__1; + + /* Local variables */ + static integer i, ix; + + +/* scales a vector by a constant. + jack dongarra, 3/11/78. + modified 3/93 to return if incx .le. 0. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments + Function Body */ +#define ZX(I) zx[(I)-1] + + + if (*n <= 0 || *incx <= 0) { + return 0; + } + if (*incx == 1) { + goto L20; + } + +/* code for increment not equal to 1 */ + + ix = 1; + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = ix; + i__3 = ix; + z__1.r = za->r * ZX(ix).r - za->i * ZX(ix).i, z__1.i = za->r * ZX( + ix).i + za->i * ZX(ix).r; + ZX(ix).r = z__1.r, ZX(ix).i = z__1.i; + ix += *incx; +/* L10: */ + } + return 0; + +/* code for increment equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + z__1.r = za->r * ZX(i).r - za->i * ZX(i).i, z__1.i = za->r * ZX( + i).i + za->i * ZX(i).r; + ZX(i).r = z__1.r, ZX(i).i = z__1.i; +/* L30: */ + } + return 0; +} /* zscal_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/zswap.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/zswap.c new file mode 100644 index 0000000..ff17cd2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/zswap.c @@ -0,0 +1,81 @@ +#include "f2c.h" +/*#include "blaswrap.h"*/ + +/* Subroutine */ int zswap_(integer *n, doublecomplex *zx, integer *incx, + doublecomplex *zy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2, i__3; + + /* Local variables */ + integer i__, ix, iy; + doublecomplex ztemp; + +/* .. Scalar Arguments .. */ +/* .. */ +/* .. Array Arguments .. */ +/* .. */ + +/* Purpose */ +/* ======= */ + +/* interchanges two vectors. */ +/* jack dongarra, 3/11/78. */ +/* modified 12/3/93, array(1) declarations changed to array(*) */ + + +/* .. Local Scalars .. */ +/* .. */ + /* Parameter adjustments */ + --zy; + --zx; + + /* Function Body */ + if (*n <= 0) { + return 0; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments not equal */ +/* to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + i__2 = ix; + ztemp.r = zx[i__2].r, ztemp.i = zx[i__2].i; + i__2 = ix; + i__3 = iy; + zx[i__2].r = zy[i__3].r, zx[i__2].i = zy[i__3].i; + i__2 = iy; + zy[i__2].r = ztemp.r, zy[i__2].i = ztemp.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + return 0; + +/* code for both increments equal to 1 */ +L20: + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + i__2 = i__; + ztemp.r = zx[i__2].r, ztemp.i = zx[i__2].i; + i__2 = i__; + i__3 = i__; + zx[i__2].r = zy[i__3].r, zx[i__2].i = zy[i__3].i; + i__2 = i__; + zy[i__2].r = ztemp.r, zy[i__2].i = ztemp.i; +/* L30: */ + } + return 0; +} /* zswap_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/CBLAS/ztrsv.c b/thirdparty/superlu/SuperLU_4.1/CBLAS/ztrsv.c new file mode 100644 index 0000000..97b9d41 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/CBLAS/ztrsv.c @@ -0,0 +1,510 @@ + +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int ztrsv_(char *uplo, char *trans, char *diag, integer *n, + doublecomplex *a, integer *lda, doublecomplex *x, integer *incx) +{ + + + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg( + doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer info; + static doublecomplex temp; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, jx, kx; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical noconj, nounit; + + +/* Purpose + ======= + + ZTRSV solves one of the systems of equations + + A*x = b, or A'*x = b, or conjg( A' )*x = b, + + where b and x are n element vectors and A is an n by n unit, or + non-unit, upper or lower triangular matrix. + + No test for singularity or near-singularity is included in this + routine. Such tests must be performed before calling this routine. + + Parameters + ========== + + UPLO - CHARACTER*1. + On entry, UPLO specifies whether the matrix is an upper or + lower triangular matrix as follows: + + UPLO = 'U' or 'u' A is an upper triangular matrix. + + UPLO = 'L' or 'l' A is a lower triangular matrix. + + Unchanged on exit. + + TRANS - CHARACTER*1. + On entry, TRANS specifies the equations to be solved as + follows: + + TRANS = 'N' or 'n' A*x = b. + + TRANS = 'T' or 't' A'*x = b. + + TRANS = 'C' or 'c' conjg( A' )*x = b. + + Unchanged on exit. + + DIAG - CHARACTER*1. + On entry, DIAG specifies whether or not A is unit + triangular as follows: + + DIAG = 'U' or 'u' A is assumed to be unit triangular. + + DIAG = 'N' or 'n' A is not assumed to be unit + triangular. + + Unchanged on exit. + + N - INTEGER. + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + A - COMPLEX*16 array of DIMENSION ( LDA, n ). + Before entry with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular matrix and the strictly lower triangular part of + + A is not referenced. + Before entry with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular matrix and the strictly upper triangular part of + + A is not referenced. + Note that when DIAG = 'U' or 'u', the diagonal elements of + + A are not referenced either, but are assumed to be unity. + Unchanged on exit. + + LDA - INTEGER. + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, n ). + Unchanged on exit. + + X - COMPLEX*16 array of dimension at least + ( 1 + ( n - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the n + element right-hand side vector b. On exit, X is overwritten + + with the solution vector x. + + INCX - INTEGER. + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + + Level 2 Blas routine. + + -- Written on 22-October-1986. + Jack Dongarra, Argonne National Lab. + Jeremy Du Croz, Nag Central Office. + Sven Hammarling, Nag Central Office. + Richard Hanson, Sandia National Labs. + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ +#define X(I) x[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (! lsame_(trans, "N") && ! lsame_(trans, "T") && + ! lsame_(trans, "C")) { + info = 2; + } else if (! lsame_(diag, "U") && ! lsame_(diag, "N")) { + info = 3; + } else if (*n < 0) { + info = 4; + } else if (*lda < max(1,*n)) { + info = 6; + } else if (*incx == 0) { + info = 8; + } + if (info != 0) { + xerbla_("ZTRSV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0) { + return 0; + } + + noconj = lsame_(trans, "T"); + nounit = lsame_(diag, "N"); + +/* Set up the start point in X if the increment is not unity. This + will be ( N - 1 )*INCX too small for descending loops. */ + + if (*incx <= 0) { + kx = 1 - (*n - 1) * *incx; + } else if (*incx != 1) { + kx = 1; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + + if (lsame_(trans, "N")) { + +/* Form x := inv( A )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + i__1 = j; + if (X(j).r != 0. || X(j).i != 0.) { + if (nounit) { + i__1 = j; + z_div(&z__1, &X(j), &A(j,j)); + X(j).r = z__1.r, X(j).i = z__1.i; + } + i__1 = j; + temp.r = X(j).r, temp.i = X(j).i; + for (i = j - 1; i >= 1; --i) { + i__1 = i; + i__2 = i; + i__3 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + z__1.r = X(i).r - z__2.r, z__1.i = X(i).i - + z__2.i; + X(i).r = z__1.r, X(i).i = z__1.i; +/* L10: */ + } + } +/* L20: */ + } + } else { + jx = kx + (*n - 1) * *incx; + for (j = *n; j >= 1; --j) { + i__1 = jx; + if (X(jx).r != 0. || X(jx).i != 0.) { + if (nounit) { + i__1 = jx; + z_div(&z__1, &X(jx), &A(j,j)); + X(jx).r = z__1.r, X(jx).i = z__1.i; + } + i__1 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + ix = jx; + for (i = j - 1; i >= 1; --i) { + ix -= *incx; + i__1 = ix; + i__2 = ix; + i__3 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + z__1.r = X(ix).r - z__2.r, z__1.i = X(ix).i - + z__2.i; + X(ix).r = z__1.r, X(ix).i = z__1.i; +/* L30: */ + } + } + jx -= *incx; +/* L40: */ + } + } + } else { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + if (X(j).r != 0. || X(j).i != 0.) { + if (nounit) { + i__2 = j; + z_div(&z__1, &X(j), &A(j,j)); + X(j).r = z__1.r, X(j).i = z__1.i; + } + i__2 = j; + temp.r = X(j).r, temp.i = X(j).i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + z__1.r = X(i).r - z__2.r, z__1.i = X(i).i - + z__2.i; + X(i).r = z__1.r, X(i).i = z__1.i; +/* L50: */ + } + } +/* L60: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + if (X(jx).r != 0. || X(jx).i != 0.) { + if (nounit) { + i__2 = jx; + z_div(&z__1, &X(jx), &A(j,j)); + X(jx).r = z__1.r, X(jx).i = z__1.i; + } + i__2 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + ix = jx; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + i__3 = ix; + i__4 = ix; + i__5 = i + j * a_dim1; + z__2.r = temp.r * A(i,j).r - temp.i * A(i,j).i, + z__2.i = temp.r * A(i,j).i + temp.i * A(i,j).r; + z__1.r = X(ix).r - z__2.r, z__1.i = X(ix).i - + z__2.i; + X(ix).r = z__1.r, X(ix).i = z__1.i; +/* L70: */ + } + } + jx += *incx; +/* L80: */ + } + } + } + } else { + +/* Form x := inv( A' )*x or x := inv( conjg( A' ) )*x. */ + + if (lsame_(uplo, "U")) { + if (*incx == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + temp.r = X(j).r, temp.i = X(j).i; + if (noconj) { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = i; + z__2.r = A(i,j).r * X(i).r - A(i,j).i * X( + i).i, z__2.i = A(i,j).r * X(i).i + + A(i,j).i * X(i).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L90: */ + } + if (nounit) { + z_div(&z__1, &temp, &A(j,j)); + temp.r = z__1.r, temp.i = z__1.i; + } + } else { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + d_cnjg(&z__3, &A(i,j)); + i__3 = i; + z__2.r = z__3.r * X(i).r - z__3.i * X(i).i, + z__2.i = z__3.r * X(i).i + z__3.i * X( + i).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L100: */ + } + if (nounit) { + d_cnjg(&z__2, &A(j,j)); + z_div(&z__1, &temp, &z__2); + temp.r = z__1.r, temp.i = z__1.i; + } + } + i__2 = j; + X(j).r = temp.r, X(j).i = temp.i; +/* L110: */ + } + } else { + jx = kx; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + ix = kx; + i__2 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + if (noconj) { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i + j * a_dim1; + i__4 = ix; + z__2.r = A(i,j).r * X(ix).r - A(i,j).i * X( + ix).i, z__2.i = A(i,j).r * X(ix).i + + A(i,j).i * X(ix).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix += *incx; +/* L120: */ + } + if (nounit) { + z_div(&z__1, &temp, &A(j,j)); + temp.r = z__1.r, temp.i = z__1.i; + } + } else { + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + d_cnjg(&z__3, &A(i,j)); + i__3 = ix; + z__2.r = z__3.r * X(ix).r - z__3.i * X(ix).i, + z__2.i = z__3.r * X(ix).i + z__3.i * X( + ix).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix += *incx; +/* L130: */ + } + if (nounit) { + d_cnjg(&z__2, &A(j,j)); + z_div(&z__1, &temp, &z__2); + temp.r = z__1.r, temp.i = z__1.i; + } + } + i__2 = jx; + X(jx).r = temp.r, X(jx).i = temp.i; + jx += *incx; +/* L140: */ + } + } + } else { + if (*incx == 1) { + for (j = *n; j >= 1; --j) { + i__1 = j; + temp.r = X(j).r, temp.i = X(j).i; + if (noconj) { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + i__2 = i + j * a_dim1; + i__3 = i; + z__2.r = A(i,j).r * X(i).r - A(i,j).i * X( + i).i, z__2.i = A(i,j).r * X(i).i + + A(i,j).i * X(i).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L150: */ + } + if (nounit) { + z_div(&z__1, &temp, &A(j,j)); + temp.r = z__1.r, temp.i = z__1.i; + } + } else { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + d_cnjg(&z__3, &A(i,j)); + i__2 = i; + z__2.r = z__3.r * X(i).r - z__3.i * X(i).i, + z__2.i = z__3.r * X(i).i + z__3.i * X( + i).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; +/* L160: */ + } + if (nounit) { + d_cnjg(&z__2, &A(j,j)); + z_div(&z__1, &temp, &z__2); + temp.r = z__1.r, temp.i = z__1.i; + } + } + i__1 = j; + X(j).r = temp.r, X(j).i = temp.i; +/* L170: */ + } + } else { + kx += (*n - 1) * *incx; + jx = kx; + for (j = *n; j >= 1; --j) { + ix = kx; + i__1 = jx; + temp.r = X(jx).r, temp.i = X(jx).i; + if (noconj) { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + i__2 = i + j * a_dim1; + i__3 = ix; + z__2.r = A(i,j).r * X(ix).r - A(i,j).i * X( + ix).i, z__2.i = A(i,j).r * X(ix).i + + A(i,j).i * X(ix).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix -= *incx; +/* L180: */ + } + if (nounit) { + z_div(&z__1, &temp, &A(j,j)); + temp.r = z__1.r, temp.i = z__1.i; + } + } else { + i__1 = j + 1; + for (i = *n; i >= j+1; --i) { + d_cnjg(&z__3, &A(i,j)); + i__2 = ix; + z__2.r = z__3.r * X(ix).r - z__3.i * X(ix).i, + z__2.i = z__3.r * X(ix).i + z__3.i * X( + ix).r; + z__1.r = temp.r - z__2.r, z__1.i = temp.i - + z__2.i; + temp.r = z__1.r, temp.i = z__1.i; + ix -= *incx; +/* L190: */ + } + if (nounit) { + d_cnjg(&z__2, &A(j,j)); + z_div(&z__1, &temp, &z__2); + temp.r = z__1.r, temp.i = z__1.i; + } + } + i__1 = jx; + X(jx).r = temp.r, X(jx).i = temp.i; + jx -= *incx; +/* L200: */ + } + } + } + } + + return 0; + +/* End of ZTRSV . */ + +} /* ztrsv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2dreadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2dreadtriple_8c.html new file mode 100644 index 0000000..341b809 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2dreadtriple_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: EXAMPLE/dreadtriple.c File Reference + + + + + +
    +

    EXAMPLE/dreadtriple.c File Reference

    #include <stdio.h>
    +#include "slu_ddefs.h"
    +#include "slu_util.h"
    + + + + + + + +

    Functions

    void dreadtriple (int *m, int *n, int *nonz, double **nzval, int **rowind, int **colptr)
    void dreadrhs (int m, double *b)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void dreadrhs (int  m,
    double *  b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadtriple (int *  m,
    int *  n,
    int *  nonz,
    double **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2sp__ienv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2sp__ienv_8c.html new file mode 100644 index 0000000..035e676 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2sp__ienv_8c.html @@ -0,0 +1,81 @@ + + +SuperLU: EXAMPLE/sp_ienv.c File Reference + + + + + +
    +

    EXAMPLE/sp_ienv.c File Reference

    #include "slu_Cnames.h"
    + + + + + +

    Functions

    int sp_ienv (int ispec)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + +
    int sp_ienv (int  ispec  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        sp_ienv() is inquired to choose machine-dependent parameters for the
    +    local environment. See ISPEC for a description of the parameters.

    +

        This version provides a set of parameters which should give good,   
    +    but not optimal, performance on many of the currently available   
    +    computers.  Users are encouraged to modify this subroutine to set   
    +    the tuning parameters for their particular machine using the option   
    +    and problem size information in the arguments.

    +

        Arguments   
    +    =========

    +

        ISPEC   (input) int
    +            Specifies the parameter to be returned as the value of SP_IENV.   
    +            = 1: the panel size w; a panel consists of w consecutive
    +	         columns of matrix A in the process of Gaussian elimination.
    +		 The best value depends on machine's cache characters.
    +            = 2: the relaxation parameter relax; if the number of
    +	         nodes (columns) in a subtree of the elimination tree is less
    +		 than relax, this subtree is considered as one supernode,
    +		 regardless of their row structures.
    +            = 3: the maximum size for a supernode in complete LU;
    +	    = 4: the minimum row dimension for 2-D blocking to be used;
    +	    = 5: the minimum column dimension for 2-D blocking to be used;
    +	    = 6: the estimated fills factor for L and U, compared with A;
    +	    = 7: the maximum size for a supernode in ILU.

    +

       (SP_IENV) (output) int
    +            >= 0: the value of the parameter specified by ISPEC   
    +            < 0:  if SP_IENV = -k, the k-th argument had an illegal value.

    +

        ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2zreadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2zreadtriple_8c.html new file mode 100644 index 0000000..76c253f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/EXAMPLE_2zreadtriple_8c.html @@ -0,0 +1,87 @@ + + +SuperLU: EXAMPLE/zreadtriple.c File Reference + + + + + +
    +

    EXAMPLE/zreadtriple.c File Reference

    #include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    +#include "slu_util.h"
    + + + + + +

    Functions

    void zreadtriple (int *m, int *n, int *nonz, doublecomplex **nzval, int **rowind, int **colptr)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadtriple (int *  m,
    int *  n,
    int *  nonz,
    doublecomplex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2dreadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2dreadtriple_8c.html new file mode 100644 index 0000000..58f9938 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2dreadtriple_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: SRC/dreadtriple.c File Reference + + + + + +
    +

    SRC/dreadtriple.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + +

    Functions

    void dreadtriple (int *m, int *n, int *nonz, double **nzval, int **rowind, int **colptr)
    void dreadrhs (int m, double *b)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void dreadrhs (int  m,
    double *  b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadtriple (int *  m,
    int *  n,
    int *  nonz,
    double **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2sp__ienv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2sp__ienv_8c.html new file mode 100644 index 0000000..4f05a09 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2sp__ienv_8c.html @@ -0,0 +1,81 @@ + + +SuperLU: SRC/sp_ienv.c File Reference + + + + + +
    +

    SRC/sp_ienv.c File Reference

    #include "slu_Cnames.h"
    + + + + + +

    Functions

    int sp_ienv (int ispec)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + +
    int sp_ienv (int  ispec  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        sp_ienv() is inquired to choose machine-dependent parameters for the
    +    local environment. See ISPEC for a description of the parameters.

    +

        This version provides a set of parameters which should give good,   
    +    but not optimal, performance on many of the currently available   
    +    computers.  Users are encouraged to modify this subroutine to set   
    +    the tuning parameters for their particular machine using the option   
    +    and problem size information in the arguments.

    +

        Arguments   
    +    =========

    +

        ISPEC   (input) int
    +            Specifies the parameter to be returned as the value of SP_IENV.   
    +            = 1: the panel size w; a panel consists of w consecutive
    +	         columns of matrix A in the process of Gaussian elimination.
    +		 The best value depends on machine's cache characters.
    +            = 2: the relaxation parameter relax; if the number of
    +	         nodes (columns) in a subtree of the elimination tree is less
    +		 than relax, this subtree is considered as one supernode,
    +		 regardless of their row structures.
    +            = 3: the maximum size for a supernode in complete LU;
    +	    = 4: the minimum row dimension for 2-D blocking to be used;
    +	    = 5: the minimum column dimension for 2-D blocking to be used;
    +	    = 6: the estimated fills factor for L and U, compared with A;
    +	    = 7: the maximum size for a supernode in ILU.

    +

       (SP_IENV) (output) int
    +            >= 0: the value of the parameter specified by ISPEC   
    +            < 0:  if SP_IENV = -k, the k-th argument had an illegal value.

    +

        ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2zreadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2zreadtriple_8c.html new file mode 100644 index 0000000..ab3ccd9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/SRC_2zreadtriple_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: SRC/zreadtriple.c File Reference + + + + + +
    +

    SRC/zreadtriple.c File Reference

    #include "slu_zdefs.h"
    + + + + + + + +

    Functions

    void zreadtriple (int *m, int *n, int *nonz, doublecomplex **nzval, int **rowind, int **colptr)
    void zreadrhs (int m, doublecomplex *b)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void zreadrhs (int  m,
    doublecomplex b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadtriple (int *  m,
    int *  n,
    int *  nonz,
    doublecomplex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/annotated.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/annotated.html new file mode 100644 index 0000000..bf10e64 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/annotated.html @@ -0,0 +1,49 @@ + + +SuperLU: Data Structures + + + + + +
    +

    Data Structures

    Here are the data structures with brief descriptions: + + + + + + + + + + + + + + + + + + +
    Colamd_Col_struct
    Colamd_Row_struct
    complex
    DNformat
    doublecomplex
    e_nodeHeaders for 4 types of dynamatically managed memory
    GlobalLU_t
    LU_stack_t
    mem_usage_t
    NCformat
    NCPformat
    NRformat
    NRformat_loc
    SCformat
    SCPformat
    superlu_options_t
    SuperLUStat_t
    SuperMatrix
    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__bmod_8c.html new file mode 100644 index 0000000..fb26e29 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__bmod_8c.html @@ -0,0 +1,272 @@ + + +SuperLU: SRC/ccolumn_bmod.c File Reference + + + + + +
    +

    SRC/ccolumn_bmod.c File Reference

    performs numeric block updates More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + +

    Functions

    void cusolve (int, int, complex *, complex *)
     Solves a dense upper triangular system.
    void clsolve (int, int, complex *, complex *)
     Solves a dense UNIT lower triangular system.
    void cmatvec (int, int, int, complex *, complex *, complex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int ccolumn_bmod (const int jcol, const int nseg, complex *dense, complex *tempv, int *segrep, int *repfnz, int fpanelc, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

      Permission is hereby granted to use or copy this program for any
    +  purpose, provided the above notices are retained on all copies.
    +  Permission to modify the code and to distribute modified code is
    +  granted, provided the above notices are retained, and a notice that
    +  the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccolumn_bmod (const int  jcol,
    const int  nseg,
    complex dense,
    complex tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void clsolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec (int  ldm,
    int  nrow,
    int  ncol,
    complex M,
    complex vec,
    complex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cusolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__dfs_8c.html new file mode 100644 index 0000000..ee0cc72 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccolumn__dfs_8c.html @@ -0,0 +1,182 @@ + + +SuperLU: SRC/ccolumn_dfs.c File Reference + + + + + +
    +

    SRC/ccolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + +

    Defines

    #define T2_SUPER
     What type of supernodes we want.

    Functions

    int ccolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define T2_SUPER
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ccopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccopy__to__ucol_8c.html new file mode 100644 index 0000000..6fe8ba8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ccopy__to__ucol_8c.html @@ -0,0 +1,106 @@ + + +SuperLU: SRC/ccopy_to_ucol.c File Reference + + + + + +
    +

    SRC/ccopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int ccopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, complex *dense, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    complex dense,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cdiagonal_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cdiagonal_8c.html new file mode 100644 index 0000000..754665a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cdiagonal_8c.html @@ -0,0 +1,98 @@ + + +SuperLU: SRC/cdiagonal.c File Reference + + + + + +
    +

    SRC/cdiagonal.c File Reference

    Auxiliary routines to work with diagonal elements. More... +

    +#include "slu_cdefs.h"
    + + + + + + + +

    Functions

    int cfill_diag (int n, NCformat *Astore)
    int cdominate (int n, NCformat *Astore)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int cdominate (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int cfill_diag (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cfgmr_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cfgmr_8c.html new file mode 100644 index 0000000..7856724 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cfgmr_8c.html @@ -0,0 +1,216 @@ + + +SuperLU: EXAMPLE/cfgmr.c File Reference + + + + + +
    +

    EXAMPLE/cfgmr.c File Reference

    flexible GMRES from ITSOL developed by Yousef Saad. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + + + + +

    Defines

    #define epsmac   1.0e-16

    Functions

    void cdotc_ (complex *, int *, complex[], int *, complex[], int *)
    float scnrm2_ (int *, complex[], int *)
    int cfgmr (int n, void(*cmatvec)(complex, complex[], complex, complex[]), void(*cpsolve)(int, complex[], complex[]), complex *rhs, complex *sol, double tol, int im, int *itmax, FILE *fits)
    +


    Detailed Description

    +

    Define Documentation

    + +
    +
    + + + + +
    #define epsmac   1.0e-16
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cdotc_ (complex,
    int * ,
    complex [],
    int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cfgmr (int  n,
    void(*)(complex, complex[], complex, complex[])  cmatvec,
    void(*)(int, complex[], complex[])  cpsolve,
    complex rhs,
    complex sol,
    double  tol,
    int  im,
    int *  itmax,
    FILE *  fits 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float scnrm2_ (int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgscon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgscon_8c.html new file mode 100644 index 0000000..06d2b8c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgscon_8c.html @@ -0,0 +1,135 @@ + + +SuperLU: SRC/cgscon.c File Reference + + + + + +
    +

    SRC/cgscon.c File Reference

    Estimates reciprocal of the condition number of a general matrix. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cgscon (char *norm, SuperMatrix *L, SuperMatrix *U, float anorm, float *rcond, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routines CGECON.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    float  anorm,
    float *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by CGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            cgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            cgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

        ANORM   (input) float
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) float*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsequ_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsequ_8c.html new file mode 100644 index 0000000..e471907 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsequ_8c.html @@ -0,0 +1,145 @@ + + +SuperLU: SRC/cgsequ.c File Reference + + + + + +
    +

    SRC/cgsequ.c File Reference

    Computes row and column scalings. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + + +

    Functions

    void cgsequ (SuperMatrix *A, float *r, float *c, float *rowcnd, float *colcnd, float *amax, int *info)
     Driver related.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine CGEEQU
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsequ (SuperMatrix A,
    float *  r,
    float *  c,
    float *  rowcnd,
    float *  colcnd,
    float *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       CGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_C; Mtype = SLU_GE.

    +

       R       (output) float*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) float*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) float*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) float*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) float*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsisx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsisx_8c.html new file mode 100644 index 0000000..2661d93 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsisx_8c.html @@ -0,0 +1,496 @@ + + +SuperLU: SRC/cgsisx.c File Reference + + + + + +
    +

    SRC/cgsisx.c File Reference

    Computes an approximate solutions of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cgsisx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, float *R, float *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from cgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_C, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, cgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) float*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) float*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsitrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsitrf_8c.html new file mode 100644 index 0000000..e1c7473 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsitrf_8c.html @@ -0,0 +1,241 @@ + + +SuperLU: SRC/cgsitrf.c File Reference + + + + + +
    +

    SRC/cgsitrf.c File Reference

    #include "slu_cdefs.h"
    + + + + + +

    Functions

    void cgsitrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_C, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsrfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsrfs_8c.html new file mode 100644 index 0000000..e728800 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgsrfs_8c.html @@ -0,0 +1,249 @@ + + +SuperLU: SRC/cgsrfs.c File Reference + + + + + +
    +

    SRC/cgsrfs.c File Reference

    Improves computed solution to a system of inear equations. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + + + + +

    Defines

    #define ITMAX   5

    Functions

    void cgsrfs (trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, char *equed, float *R, float *C, SuperMatrix *B, SuperMatrix *X, float *ferr, float *berr, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routine CGERFS
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define ITMAX   5
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix B,
    SuperMatrix X,
    float *  ferr,
    float *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           cgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by cgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) float*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) float*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssv_8c.html new file mode 100644 index 0000000..eaa4295 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssv_8c.html @@ -0,0 +1,202 @@ + + +SuperLU: SRC/cgssv.c File Reference + + + + + +
    +

    SRC/cgssv.c File Reference

    Solves the system of linear equations A*X=B. More... +

    +#include "slu_cdefs.h"
    + + + + + + +

    Functions

    void cgssv (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, SuperLUStat_t *stat, int *info)
     Driver routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from CGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_C; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssvx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssvx_8c.html new file mode 100644 index 0000000..4011d32 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgssvx_8c.html @@ -0,0 +1,450 @@ + + +SuperLU: SRC/cgssvx.c File Reference + + + + + +
    +

    SRC/cgssvx.c File Reference

    Solves the system of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cgssvx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, float *R, float *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond, float *ferr, float *berr, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    float *  ferr,
    float *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from cgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) float*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) float*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) float*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) float*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrf_8c.html new file mode 100644 index 0000000..0e85da8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrf_8c.html @@ -0,0 +1,261 @@ + + +SuperLU: SRC/cgstrf.c File Reference + + + + + +
    +

    SRC/cgstrf.c File Reference

    Computes an LU factorization of a general sparse matrix. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cgstrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_C, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see cpanel_dfs.c; marker2 is used for inner-factorization,
    +            see ccolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during cpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_cdefs.h.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrs_8c.html new file mode 100644 index 0000000..143751f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cgstrs_8c.html @@ -0,0 +1,332 @@ + + +SuperLU: SRC/cgstrs.c File Reference + + + + + +
    +

    SRC/cgstrs.c File Reference

    Solves a system using LU factorization. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    void cusolve (int, int, complex *, complex *)
     Solves a dense upper triangular system.
    void clsolve (int, int, complex *, complex *)
     Solves a dense UNIT lower triangular system.
    void cmatvec (int, int, int, complex *, complex *, complex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void cgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, SuperMatrix *B, SuperLUStat_t *stat, int *info)
    void cprint_soln (int n, int nrhs, complex *soln)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + CGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         cgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         cgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void clsolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec (int  ldm,
    int  nrow,
    int  ncol,
    complex M,
    complex vec,
    complex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cprint_soln (int  n,
    int  nrhs,
    complex soln 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cusolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/citersol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/citersol_8c.html new file mode 100644 index 0000000..c4f20f1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/citersol_8c.html @@ -0,0 +1,244 @@ + + +SuperLU: EXAMPLE/citersol.c File Reference + + + + + +
    +

    EXAMPLE/citersol.c File Reference

    #include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void cmatvec_mult (complex alpha, complex x[], complex beta, complex y[])
    void cpsolve (int n, complex x[], complex y[])
    int main (int argc, char *argv[])

    Variables

    int * GLOBAL_PERM_C
    int * GLOBAL_PERM_R
    SuperMatrixGLOBAL_A
    SuperMatrixGLOBAL_L
    SuperMatrixGLOBAL_U
    SuperLUStat_tGLOBAL_STAT
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec_mult (complex  alpha,
    complex  x[],
    complex  beta,
    complex  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpsolve (int  n,
    complex  x[],
    complex  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    SuperMatrix* GLOBAL_A
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_L
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GLOBAL_PERM_C
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int * GLOBAL_PERM_R
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_U
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clacon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clacon_8c.html new file mode 100644 index 0000000..7e3aa64 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clacon_8c.html @@ -0,0 +1,122 @@ + + +SuperLU: SRC/clacon.c File Reference + + + + + +
    +

    SRC/clacon.c File Reference

    Estimates the 1-norm. More... +

    +#include <math.h>
    +#include "slu_Cnames.h"
    +#include "slu_scomplex.h"
    + + + + + +

    Functions

    int clacon_ (int *n, complex *v, complex *x, float *est, int *kase)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int clacon_ (int *  n,
    complex v,
    complex x,
    float *  est,
    int *  kase 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CLACON estimates the 1-norm of a square matrix A.   
    +   Reverse communication is used for evaluating matrix-vector products.

    +

       Arguments   
    +   =========

    +

       N      (input) INT
    +          The order of the matrix.  N >= 1.

    +

       V      (workspace) COMPLEX PRECISION array, dimension (N)   
    +          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    +          (W is not returned).

    +

       X      (input/output) COMPLEX PRECISION array, dimension (N)   
    +          On an intermediate return, X should be overwritten by   
    +                A * X,   if KASE=1,   
    +                A' * X,  if KASE=2,
    +          where A' is the conjugate transpose of A,
    +         and CLACON must be re-called with all the other parameters   
    +          unchanged.

    +

       EST    (output) FLOAT PRECISION   
    +          An estimate (a lower bound) for norm(A).

    +

       KASE   (input/output) INT
    +          On the initial call to CLACON, KASE should be 0.   
    +          On an intermediate return, KASE will be 1 or 2, indicating   
    +          whether X should be overwritten by A * X  or A' * X.   
    +          On the final return from CLACON, KASE will again be 0.

    +

       Further Details   
    +   ======= =======

    +

       Contributed by Nick Higham, University of Manchester.   
    +   Originally named CONEST, dated March 16, 1988.

    +

       Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    +   a real or complex matrix, with applications to condition estimation", 
    +   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    +   ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clangs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clangs_8c.html new file mode 100644 index 0000000..9ec9acc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clangs_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/clangs.c File Reference + + + + + +
    +

    SRC/clangs.c File Reference

    Returns the value of the one norm. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    float clangs (char *norm, SuperMatrix *A)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from lapack routine CLANGE 
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    float clangs (char *  norm,
    SuperMatrix A 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       CLANGS returns the value of the one norm, or the Frobenius norm, or 
    +   the infinity norm, or the element of largest absolute value of a 
    +   real matrix A.

    +

       Description   
    +   ===========

    +

       CLANGE returns the value

    +

          CLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    +               (   
    +               ( norm1(A),         NORM = '1', 'O' or 'o'   
    +               (   
    +               ( normI(A),         NORM = 'I' or 'i'   
    +               (   
    +               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'

    +

       where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    +   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    +   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    +   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.

    +

       Arguments   
    +   =========

    +

       NORM    (input) CHARACTER*1   
    +           Specifies the value to be returned in CLANGE as described above.   
    +   A       (input) SuperMatrix*
    +           The M by N sparse matrix A.

    +

      =====================================================================
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/claqgs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/claqgs_8c.html new file mode 100644 index 0000000..6579560 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/claqgs_8c.html @@ -0,0 +1,160 @@ + + +SuperLU: SRC/claqgs.c File Reference + + + + + +
    +

    SRC/claqgs.c File Reference

    Equlibrates a general sprase matrix. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + + + + +

    Defines

    #define THRESH   (0.1)

    Functions

    void claqgs (SuperMatrix *A, float *r, float *c, float rowcnd, float colcnd, float amax, char *equed)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine CLAQGE
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define THRESH   (0.1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void claqgs (SuperMatrix A,
    float *  r,
    float *  c,
    float  rowcnd,
    float  colcnd,
    float  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_C; Mtype = GE.

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) float
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) float
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) float
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cldperm_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cldperm_8c.html new file mode 100644 index 0000000..ebad7cb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cldperm_8c.html @@ -0,0 +1,283 @@ + + +SuperLU: SRC/cldperm.c File Reference + + + + + +
    +

    SRC/cldperm.c File Reference

    Finds a row permutation so that the matrix has large entries on the diagonal. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + +

    Functions

    int_t mc64id_ (int_t *)
    int_t mc64ad_ (int_t *, int_t *, int_t *, int_t[], int_t[], double[], int_t *, int_t[], int_t *, int_t[], int_t *, double[], int_t[], int_t[])
    int cldperm (int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], complex nzval[], int_t *perm, float u[], float v[])
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cldperm (int_t  job,
    int_t  n,
    int_t  nnz,
    int_t  colptr[],
    int_t  adjncy[],
    complex  nzval[],
    int_t perm,
    float  u[],
    float  v[] 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       CLDPERM finds a row permutation so that the matrix has large
    +   entries on the diagonal.

    +

     Arguments
    + =========

    +

     job    (input) int
    +        Control the action. Possible values for JOB are:
    +        = 1 : Compute a row permutation of the matrix so that the
    +              permuted matrix has as many entries on its diagonal as
    +              possible. The values on the diagonal are of arbitrary size.
    +              HSL subroutine MC21A/AD is used for this.
    +        = 2 : Compute a row permutation of the matrix so that the smallest 
    +              value on the diagonal of the permuted matrix is maximized.
    +        = 3 : Compute a row permutation of the matrix so that the smallest
    +              value on the diagonal of the permuted matrix is maximized.
    +              The algorithm differs from the one used for JOB = 2 and may
    +              have quite a different performance.
    +        = 4 : Compute a row permutation of the matrix so that the sum
    +              of the diagonal entries of the permuted matrix is maximized.
    +        = 5 : Compute a row permutation of the matrix so that the product
    +              of the diagonal entries of the permuted matrix is maximized
    +              and vectors to scale the matrix so that the nonzero diagonal 
    +              entries of the permuted matrix are one in absolute value and 
    +              all the off-diagonal entries are less than or equal to one in 
    +              absolute value.
    +        Restriction: 1 <= JOB <= 5.

    +

     n      (input) int
    +        The order of the matrix.

    +

     nnz    (input) int
    +        The number of nonzeros in the matrix.

    +

     adjncy (input) int*, of size nnz
    +        The adjacency structure of the matrix, which contains the row
    +        indices of the nonzeros.

    +

     colptr (input) int*, of size n+1
    +        The pointers to the beginning of each column in ADJNCY.

    +

     nzval  (input) complex*, of size nnz
    +        The nonzero values of the matrix. nzval[k] is the value of
    +        the entry corresponding to adjncy[k].
    +        It is not used if job = 1.

    +

     perm   (output) int*, of size n
    +        The permutation vector. perm[i] = j means row i in the
    +        original matrix is in row j of the permuted matrix.

    +

     u      (output) double*, of size n
    +        If job = 5, the natural logarithms of the row scaling factors.

    +

     v      (output) double*, of size n
    +        If job = 5, the natural logarithms of the column scaling factors. 
    +        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ad_ (int_t,
    int_t,
    int_t,
    int_t [],
    int_t [],
    double [],
    int_t,
    int_t [],
    int_t,
    int_t [],
    int_t,
    double [],
    int_t [],
    int_t [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int_t mc64id_ (int_t  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol1_8c.html new file mode 100644 index 0000000..b1916b4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol1_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/clinsol1.c File Reference + + + + + +
    +

    EXAMPLE/clinsol1.c File Reference

    #include "slu_cdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol_8c.html new file mode 100644 index 0000000..3434559 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsol_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/clinsol.c File Reference + + + + + +
    +

    EXAMPLE/clinsol.c File Reference

    #include "slu_cdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx1_8c.html new file mode 100644 index 0000000..5e23f4e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx1_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/clinsolx1.c File Reference + + + + + +
    +

    EXAMPLE/clinsolx1.c File Reference

    #include "slu_cdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, float *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    float *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx2_8c.html new file mode 100644 index 0000000..d961523 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx2_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/clinsolx2.c File Reference + + + + + +
    +

    EXAMPLE/clinsolx2.c File Reference

    #include "slu_cdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx_8c.html new file mode 100644 index 0000000..ee2c874 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/clinsolx_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/clinsolx.c File Reference + + + + + +
    +

    EXAMPLE/clinsolx.c File Reference

    #include "slu_cdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, float *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    float *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cmemory_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cmemory_8c.html new file mode 100644 index 0000000..bd48cfe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cmemory_8c.html @@ -0,0 +1,976 @@ + + +SuperLU: SRC/cmemory.c File Reference + + + + + +
    +

    SRC/cmemory.c File Reference

    Memory details. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define StackFull(x)   ( x + Glu->stack.used >= Glu->stack.size )
    #define NotDoubleAlign(addr)   ( (long int)addr & 7 )
    #define DoubleAlign(addr)   ( ((long int)addr + 7) & ~7L )
    #define TempSpace(m, w)
    #define Reduce(alpha)   ((alpha + 1) / 2)

    Functions

    void * cexpand (int *prev_len,MemType type,int len_to_copy,int keep_prev,GlobalLU_t *Glu)
     Expand the existing storage to accommodate more fill-ins.
    int cLUWorkInit (int m, int n, int panel_size, int **iworkptr, complex **dworkptr, GlobalLU_t *Glu)
     Allocate known working storage. Returns 0 if success, otherwise returns the number of bytes allocated so far when failure occurred.
    void copy_mem_complex (int, void *, void *)
    void cStackCompress (GlobalLU_t *Glu)
     Compress the work[] array to remove fragmentation.
    void cSetupSpace (void *work, int lwork, GlobalLU_t *Glu)
     Setup the memory model to be used for factorization.
    void * cuser_malloc (int, int, GlobalLU_t *)
    void cuser_free (int, int, GlobalLU_t *)
    void copy_mem_int (int, void *, void *)
    void user_bcopy (char *, char *, int)
    int cQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int ilu_cQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int cLUMemInit (fact_t fact, void *work, int lwork, int m, int n, int annz, int panel_size, float fill_ratio, SuperMatrix *L, SuperMatrix *U, GlobalLU_t *Glu, int **iwork, complex **dwork)
     Allocate storage for the data structures common to all factor routines.
    void cSetRWork (int m, int panel_size, complex *dworkptr, complex **dense, complex **tempv)
     Set up pointers for real working arrays.
    void cLUWorkFree (int *iwork, complex *dwork, GlobalLU_t *Glu)
     Free the working storage used by factor routines.
    int cLUMemXpand (int jcol, int next, MemType mem_type, int *maxlen, GlobalLU_t *Glu)
     Expand the data structures for L and U during the factorization.
    void callocateA (int n, int nnz, complex **a, int **asub, int **xa)
     Allocate storage for original matrix A.
    complexcomplexMalloc (int n)
    complexcomplexCalloc (int n)
    int cmemory_usage (const int nzlmax, const int nzumax, const int nzlumax, const int n)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define DoubleAlign (addr   )    ( ((long int)addr + 7) & ~7L )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define NotDoubleAlign (addr   )    ( (long int)addr & 7 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define Reduce (alpha   )    ((alpha + 1) / 2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define StackFull (  )    ( x + Glu->stack.used >= Glu->stack.size )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define TempSpace (m,
     ) 
    +
    +
    + +

    +Value:

    ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
    +                              (w + 1) * m * sizeof(complex) )
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void callocateA (int  n,
    int  nnz,
    complex **  a,
    int **  asub,
    int **  xa 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void * cexpand (int *  prev_len,
    MemType  type,
    int  len_to_copy,
    int  keep_prev,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    float  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    complex **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cLUWorkFree (int *  iwork,
    complex dwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cLUWorkInit (int  m,
    int  n,
    int  panel_size,
    int **  iworkptr,
    complex **  dworkptr,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cmemory_usage (const int  nzlmax,
    const int  nzumax,
    const int  nzlumax,
    const int  n 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex* complexCalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex* complexMalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_complex (int  howmany,
    void *  old,
    void *  new 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_int (int ,
    void * ,
    void *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int cQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cSetRWork (int  m,
    int  panel_size,
    complex dworkptr,
    complex **  dense,
    complex **  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cSetupSpace (void *  work,
    int  lwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +lwork = 0: use system malloc; lwork > 0: use user-supplied work[] space. +

    +

    + +

    +
    + + + + + + + + + +
    void cStackCompress (GlobalLU_t Glu  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cuser_free (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void * cuser_malloc (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_bcopy (char * ,
    char * ,
    int  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cmyblas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cmyblas2_8c.html new file mode 100644 index 0000000..1ecbd0d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cmyblas2_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/cmyblas2.c File Reference + + + + + +
    +

    SRC/cmyblas2.c File Reference

    Level 2 Blas operations. More... +

    +#include "slu_scomplex.h"
    + + + + + + + + + + + + +

    Functions

    void clsolve (int ldm, int ncol, complex *M, complex *rhs)
     Solves a dense UNIT lower triangular system.
    void cusolve (int ldm, int ncol, complex *M, complex *rhs)
     Solves a dense upper triangular system.
    void cmatvec (int ldm, int nrow, int ncol, complex *M, complex *vec, complex *Mxvec)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 
    Purpose: Level 2 BLAS operations: solves and matvec, written in C. Note: This is only used when the system lacks an efficient BLAS library.

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void clsolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec (int  ldm,
    int  nrow,
    int  ncol,
    complex M,
    complex vec,
    complex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cusolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8c.html new file mode 100644 index 0000000..a01bbc9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8c.html @@ -0,0 +1,1681 @@ + + +SuperLU: SRC/colamd.c File Reference + + + + + +
    +

    SRC/colamd.c File Reference

    A sparse matrix column ordering algorithm. More... +

    +#include "colamd.h"
    +#include <limits.h>
    +#include <stdio.h>
    +#include <assert.h>
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define PUBLIC
    #define PRIVATE   static
    #define MAX(a, b)   (((a) > (b)) ? (a) : (b))
    #define MIN(a, b)   (((a) < (b)) ? (a) : (b))
    #define ONES_COMPLEMENT(r)   (-(r)-1)
    #define TRUE   (1)
    #define FALSE   (0)
    #define EMPTY   (-1)
    #define ALIVE   (0)
    #define DEAD   (-1)
    #define DEAD_PRINCIPAL   (-1)
    #define DEAD_NON_PRINCIPAL   (-2)
    #define ROW_IS_DEAD(r)   ROW_IS_MARKED_DEAD (Row[r].shared2.mark)
    #define ROW_IS_MARKED_DEAD(row_mark)   (row_mark < ALIVE)
    #define ROW_IS_ALIVE(r)   (Row [r].shared2.mark >= ALIVE)
    #define COL_IS_DEAD(c)   (Col [c].start < ALIVE)
    #define COL_IS_ALIVE(c)   (Col [c].start >= ALIVE)
    #define COL_IS_DEAD_PRINCIPAL(c)   (Col [c].start == DEAD_PRINCIPAL)
    #define KILL_ROW(r)   { Row [r].shared2.mark = DEAD ; }
    #define KILL_PRINCIPAL_COL(c)   { Col [c].start = DEAD_PRINCIPAL ; }
    #define KILL_NON_PRINCIPAL_COL(c)   { Col [c].start = DEAD_NON_PRINCIPAL ; }
    #define PRINTF   printf
    #define INDEX(i)   (i)
    #define DEBUG0(params)   ;
    #define DEBUG1(params)   ;
    #define DEBUG2(params)   ;
    #define DEBUG3(params)   ;
    #define DEBUG4(params)   ;
    #define ASSERT(expression)   ((void) 0)

    Functions

    PRIVATE int init_rows_cols (int n_row, int n_col, Colamd_Row Row[], Colamd_Col Col[], int A[], int p[], int stats[COLAMD_STATS])
    PRIVATE void init_scoring (int n_row, int n_col, Colamd_Row Row[], Colamd_Col Col[], int A[], int head[], double knobs[COLAMD_KNOBS], int *p_n_row2, int *p_n_col2, int *p_max_deg)
    PRIVATE int find_ordering (int n_row, int n_col, int Alen, Colamd_Row Row[], Colamd_Col Col[], int A[], int head[], int n_col2, int max_deg, int pfree)
    PRIVATE void order_children (int n_col, Colamd_Col Col[], int p[])
    PRIVATE void detect_super_cols (Colamd_Col Col[], int A[], int head[], int row_start, int row_length)
    PRIVATE int garbage_collection (int n_row, int n_col, Colamd_Row Row[], Colamd_Col Col[], int A[], int *pfree)
    PRIVATE int clear_mark (int n_row, Colamd_Row Row[])
    PRIVATE void print_report (char *method, int stats[COLAMD_STATS])
    PUBLIC int colamd_recommended (int nnz, int n_row, int n_col)
    PUBLIC void colamd_set_defaults (double knobs[COLAMD_KNOBS])
    PUBLIC int symamd (int n, int A[], int p[], int perm[], double knobs[COLAMD_KNOBS], int stats[COLAMD_STATS], void *(*allocate)(size_t, size_t), void(*release)(void *))
    PUBLIC int colamd (int n_row, int n_col, int Alen, int A[], int p[], double knobs[COLAMD_KNOBS], int stats[COLAMD_STATS])
    PUBLIC void colamd_report (int stats[COLAMD_STATS])
    PUBLIC void symamd_report (int stats[COLAMD_STATS])
    +


    Detailed Description

    +
    +    ========================================================================== 
    +    === colamd/symamd - a sparse matrix column ordering algorithm ============ 
    +    ==========================================================================

    +

        colamd:  an approximate minimum degree column ordering algorithm,
    +    	for LU factorization of symmetric or unsymmetric matrices,
    +	QR factorization, least squares, interior point methods for
    +	linear programming problems, and other related problems.

    +

        symamd:  an approximate minimum degree ordering algorithm for Cholesky
    +    	factorization of symmetric matrices.

    +

        Purpose:

    +

    	Colamd computes a permutation Q such that the Cholesky factorization of
    +	(AQ)'(AQ) has less fill-in and requires fewer floating point operations
    +	than A'A.  This also provides a good ordering for sparse partial
    +	pivoting methods, P(AQ) = LU, where Q is computed prior to numerical
    +	factorization, and P is computed during numerical factorization via
    +	conventional partial pivoting with row interchanges.  Colamd is the
    +	column ordering method used in SuperLU, part of the ScaLAPACK library.
    +	It is also available as built-in function in MATLAB Version 6,
    +	available from MathWorks, Inc. (http://www.mathworks.com).  This
    +	routine can be used in place of colmmd in MATLAB.

    +

        	Symamd computes a permutation P of a symmetric matrix A such that the
    +	Cholesky factorization of PAP' has less fill-in and requires fewer
    +	floating point operations than A.  Symamd constructs a matrix M such
    +	that M'M has the same nonzero pattern of A, and then orders the columns
    +	of M using colmmd.  The column ordering of M is then returned as the
    +	row and column ordering P of A.

    +

        Authors:

    +

    	The authors of the code itself are Stefan I. Larimore and Timothy A.
    +	Davis (davis@cise.ufl.edu), University of Florida.  The algorithm was
    +	developed in collaboration with John Gilbert, Xerox PARC, and Esmond
    +	Ng, Oak Ridge National Laboratory.

    +

        Date:

    +

    	September 8, 2003.  Version 2.3.

    +

        Acknowledgements:

    +

    	This work was supported by the National Science Foundation, under
    +	grants DMS-9504974 and DMS-9803599.

    +

        Copyright and License:

    +

    	Copyright (c) 1998-2003 by the University of Florida.
    +	All Rights Reserved.

    +

    	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    +	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

    	Permission is hereby granted to use, copy, modify, and/or distribute
    +	this program, provided that the Copyright, this License, and the
    +	Availability of the original version is retained on all copies and made
    +	accessible to the end-user of any code or package that includes COLAMD
    +	or any modified version of COLAMD.

    +

        Availability:

    +

    	The colamd/symamd library is available at

    +

    	    http://www.cise.ufl.edu/research/sparse/colamd/

    +

    	This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.c
    +	file.  It requires the colamd.h file.  It is required by the colamdmex.c
    +	and symamdmex.c files, for the MATLAB interface to colamd and symamd.

    +

        See the ChangeLog file for changes since Version 1.0.

    +

        ========================================================================== 
    +    === Description of user-callable routines ================================ 
    +    ==========================================================================

    +

        ----------------------------------------------------------------------------
    +    colamd_recommended:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    int colamd_recommended (int nnz, int n_row, int n_col) ;

    +

    	    or as a C macro

    +

    	    include "colamd.h"
    +	    Alen = COLAMD_RECOMMENDED (int nnz, int n_row, int n_col) ;

    +

    	Purpose:

    +

    	    Returns recommended value of Alen for use by colamd.  Returns -1
    +	    if any input argument is negative.  The use of this routine
    +	    or macro is optional.  Note that the macro uses its arguments
    +	    more than once, so be careful for side effects, if you pass
    +	    expressions as arguments to COLAMD_RECOMMENDED.  Not needed for
    +	    symamd, which dynamically allocates its own memory.

    +

    	Arguments (all input arguments):

    +

    	    int nnz ;		Number of nonzeros in the matrix A.  This must
    +				be the same value as p [n_col] in the call to
    +				colamd - otherwise you will get a wrong value
    +				of the recommended memory to use.

    +

    	    int n_row ;		Number of rows in the matrix A.

    +

    	    int n_col ;		Number of columns in the matrix A.

    +

        ----------------------------------------------------------------------------
    +    colamd_set_defaults:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    colamd_set_defaults (double knobs [COLAMD_KNOBS]) ;

    +

    	Purpose:

    +

    	    Sets the default parameters.  The use of this routine is optional.

    +

    	Arguments:

    +

    	    double knobs [COLAMD_KNOBS] ;	Output only.

    +

    		Colamd: rows with more than (knobs [COLAMD_DENSE_ROW] * n_col)
    +		entries are removed prior to ordering.  Columns with more than
    +		(knobs [COLAMD_DENSE_COL] * n_row) entries are removed prior to
    +		ordering, and placed last in the output column ordering.

    +

    		Symamd: uses only knobs [COLAMD_DENSE_ROW], which is knobs [0].
    +		Rows and columns with more than (knobs [COLAMD_DENSE_ROW] * n)
    +		entries are removed prior to ordering, and placed last in the
    +		output ordering.

    +

    		COLAMD_DENSE_ROW and COLAMD_DENSE_COL are defined as 0 and 1,
    +		respectively, in colamd.h.  Default values of these two knobs
    +		are both 0.5.  Currently, only knobs [0] and knobs [1] are
    +		used, but future versions may use more knobs.  If so, they will
    +		be properly set to their defaults by the future version of
    +		colamd_set_defaults, so that the code that calls colamd will
    +		not need to change, assuming that you either use
    +		colamd_set_defaults, or pass a (double *) NULL pointer as the
    +		knobs array to colamd or symamd.

    +

        ----------------------------------------------------------------------------
    +    colamd:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    int colamd (int n_row, int n_col, int Alen, int *A, int *p,
    +	    	double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS]) ;

    +

    	Purpose:

    +

    	    Computes a column ordering (Q) of A such that P(AQ)=LU or
    +	    (AQ)'AQ=LL' have less fill-in and require fewer floating point
    +	    operations than factorizing the unpermuted matrix A or A'A,
    +	    respectively.

    +

    	Returns:

    +

    	    TRUE (1) if successful, FALSE (0) otherwise.

    +

    	Arguments:

    +

    	    int n_row ;		Input argument.

    +

    		Number of rows in the matrix A.
    +		Restriction:  n_row >= 0.
    +		Colamd returns FALSE if n_row is negative.

    +

    	    int n_col ;		Input argument.

    +

    		Number of columns in the matrix A.
    +		Restriction:  n_col >= 0.
    +		Colamd returns FALSE if n_col is negative.

    +

    	    int Alen ;		Input argument.

    +

    		Restriction (see note):
    +		Alen >= 2*nnz + 6*(n_col+1) + 4*(n_row+1) + n_col
    +		Colamd returns FALSE if these conditions are not met.

    +

    		Note:  this restriction makes an modest assumption regarding
    +		the size of the two typedef's structures in colamd.h.
    +		We do, however, guarantee that

    +

    			Alen >= colamd_recommended (nnz, n_row, n_col)

    +

    		or equivalently as a C preprocessor macro:

    +

    			Alen >= COLAMD_RECOMMENDED (nnz, n_row, n_col)

    +

    		will be sufficient.

    +

    	    int A [Alen] ;	Input argument, undefined on output.

    +

    		A is an integer array of size Alen.  Alen must be at least as
    +		large as the bare minimum value given above, but this is very
    +		low, and can result in excessive run time.  For best
    +		performance, we recommend that Alen be greater than or equal to
    +		colamd_recommended (nnz, n_row, n_col), which adds
    +		nnz/5 to the bare minimum value given above.

    +

    		On input, the row indices of the entries in column c of the
    +		matrix are held in A [(p [c]) ... (p [c+1]-1)].  The row indices
    +		in a given column c need not be in ascending order, and
    +		duplicate row indices may be be present.  However, colamd will
    +		work a little faster if both of these conditions are met
    +		(Colamd puts the matrix into this format, if it finds that the
    +		the conditions are not met).

    +

    		The matrix is 0-based.  That is, rows are in the range 0 to
    +		n_row-1, and columns are in the range 0 to n_col-1.  Colamd
    +		returns FALSE if any row index is out of range.

    +

    		The contents of A are modified during ordering, and are
    +		undefined on output.

    +

    	    int p [n_col+1] ;	Both input and output argument.

    +

    		p is an integer array of size n_col+1.  On input, it holds the
    +		"pointers" for the column form of the matrix A.  Column c of
    +		the matrix A is held in A [(p [c]) ... (p [c+1]-1)].  The first
    +		entry, p [0], must be zero, and p [c] <= p [c+1] must hold
    +		for all c in the range 0 to n_col-1.  The value p [n_col] is
    +		thus the total number of entries in the pattern of the matrix A.
    +		Colamd returns FALSE if these conditions are not met.

    +

    		On output, if colamd returns TRUE, the array p holds the column
    +		permutation (Q, for P(AQ)=LU or (AQ)'(AQ)=LL'), where p [0] is
    +		the first column index in the new ordering, and p [n_col-1] is
    +		the last.  That is, p [k] = j means that column j of A is the
    +		kth pivot column, in AQ, where k is in the range 0 to n_col-1
    +		(p [0] = j means that column j of A is the first column in AQ).

    +

    		If colamd returns FALSE, then no permutation is returned, and
    +		p is undefined on output.

    +

    	    double knobs [COLAMD_KNOBS] ;	Input argument.

    +

    		See colamd_set_defaults for a description.

    +

    	    int stats [COLAMD_STATS] ;		Output argument.

    +

    		Statistics on the ordering, and error status.
    +		See colamd.h for related definitions.
    +		Colamd returns FALSE if stats is not present.

    +

    		stats [0]:  number of dense or empty rows ignored.

    +

    		stats [1]:  number of dense or empty columns ignored (and
    +				ordered last in the output permutation p)
    +				Note that a row can become "empty" if it
    +				contains only "dense" and/or "empty" columns,
    +				and similarly a column can become "empty" if it
    +				only contains "dense" and/or "empty" rows.

    +

    		stats [2]:  number of garbage collections performed.
    +				This can be excessively high if Alen is close
    +				to the minimum required value.

    +

    		stats [3]:  status code.  < 0 is an error code.
    +			    > 1 is a warning or notice.

    +

    			0	OK.  Each column of the input matrix contained
    +				row indices in increasing order, with no
    +				duplicates.

    +

    			1	OK, but columns of input matrix were jumbled
    +				(unsorted columns or duplicate entries).  Colamd
    +				had to do some extra work to sort the matrix
    +				first and remove duplicate entries, but it
    +				still was able to return a valid permutation
    +				(return value of colamd was TRUE).

    +

    					stats [4]: highest numbered column that
    +						is unsorted or has duplicate
    +						entries.
    +					stats [5]: last seen duplicate or
    +						unsorted row index.
    +					stats [6]: number of duplicate or
    +						unsorted row indices.

    +

    			-1	A is a null pointer

    +

    			-2	p is a null pointer

    +

    			-3 	n_row is negative

    +

    					stats [4]: n_row

    +

    			-4	n_col is negative

    +

    					stats [4]: n_col

    +

    			-5	number of nonzeros in matrix is negative

    +

    					stats [4]: number of nonzeros, p [n_col]

    +

    			-6	p [0] is nonzero

    +

    					stats [4]: p [0]

    +

    			-7	A is too small

    +

    					stats [4]: required size
    +					stats [5]: actual size (Alen)

    +

    			-8	a column has a negative number of entries

    +

    					stats [4]: column with < 0 entries
    +					stats [5]: number of entries in col

    +

    			-9	a row index is out of bounds

    +

    					stats [4]: column with bad row index
    +					stats [5]: bad row index
    +					stats [6]: n_row, # of rows of matrx

    +

    			-10	(unused; see symamd.c)

    +

    			-999	(unused; see symamd.c)

    +

    		Future versions may return more statistics in the stats array.

    +

    	Example:

    +

    	    See http://www.cise.ufl.edu/research/sparse/colamd/example.c
    +	    for a complete example.

    +

    	    To order the columns of a 5-by-4 matrix with 11 nonzero entries in
    +	    the following nonzero pattern

    +

    	    	x 0 x 0
    +		x 0 x x
    +		0 x x 0
    +		0 0 x x
    +		x x 0 0

    +

    	    with default knobs and no output statistics, do the following:

    +

    		include "colamd.h"
    +		define ALEN COLAMD_RECOMMENDED (11, 5, 4)
    +		int A [ALEN] = {1, 2, 5, 3, 5, 1, 2, 3, 4, 2, 4} ;
    +		int p [ ] = {0, 3, 5, 9, 11} ;
    +		int stats [COLAMD_STATS] ;
    +		colamd (5, 4, ALEN, A, p, (double *) NULL, stats) ;

    +

    	    The permutation is returned in the array p, and A is destroyed.

    +

        ----------------------------------------------------------------------------
    +    symamd:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    int symamd (int n, int *A, int *p, int *perm,
    +	    	double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS],
    +		void (*allocate) (size_t, size_t), void (*release) (void *)) ;

    +

    	Purpose:

    +

        	    The symamd routine computes an ordering P of a symmetric sparse
    +	    matrix A such that the Cholesky factorization PAP' = LL' remains
    +	    sparse.  It is based on a column ordering of a matrix M constructed
    +	    so that the nonzero pattern of M'M is the same as A.  The matrix A
    +	    is assumed to be symmetric; only the strictly lower triangular part
    +	    is accessed.  You must pass your selected memory allocator (usually
    +	    calloc/free or mxCalloc/mxFree) to symamd, for it to allocate
    +	    memory for the temporary matrix M.

    +

    	Returns:

    +

    	    TRUE (1) if successful, FALSE (0) otherwise.

    +

    	Arguments:

    +

    	    int n ;		Input argument.

    +

    	    	Number of rows and columns in the symmetrix matrix A.
    +		Restriction:  n >= 0.
    +		Symamd returns FALSE if n is negative.

    +

    	    int A [nnz] ;	Input argument.

    +

    	    	A is an integer array of size nnz, where nnz = p [n].

    +

    		The row indices of the entries in column c of the matrix are
    +		held in A [(p [c]) ... (p [c+1]-1)].  The row indices in a
    +		given column c need not be in ascending order, and duplicate
    +		row indices may be present.  However, symamd will run faster
    +		if the columns are in sorted order with no duplicate entries.

    +

    		The matrix is 0-based.  That is, rows are in the range 0 to
    +		n-1, and columns are in the range 0 to n-1.  Symamd
    +		returns FALSE if any row index is out of range.

    +

    		The contents of A are not modified.

    +

    	    int p [n+1] ;   	Input argument.

    +

    		p is an integer array of size n+1.  On input, it holds the
    +		"pointers" for the column form of the matrix A.  Column c of
    +		the matrix A is held in A [(p [c]) ... (p [c+1]-1)].  The first
    +		entry, p [0], must be zero, and p [c] <= p [c+1] must hold
    +		for all c in the range 0 to n-1.  The value p [n] is
    +		thus the total number of entries in the pattern of the matrix A.
    +		Symamd returns FALSE if these conditions are not met.

    +

    		The contents of p are not modified.

    +

    	    int perm [n+1] ;   	Output argument.

    +

    		On output, if symamd returns TRUE, the array perm holds the
    +		permutation P, where perm [0] is the first index in the new
    +		ordering, and perm [n-1] is the last.  That is, perm [k] = j
    +		means that row and column j of A is the kth column in PAP',
    +		where k is in the range 0 to n-1 (perm [0] = j means
    +		that row and column j of A are the first row and column in
    +		PAP').  The array is used as a workspace during the ordering,
    +		which is why it must be of length n+1, not just n.

    +

    	    double knobs [COLAMD_KNOBS] ;	Input argument.

    +

    		See colamd_set_defaults for a description.

    +

    	    int stats [COLAMD_STATS] ;		Output argument.

    +

    		Statistics on the ordering, and error status.
    +		See colamd.h for related definitions.
    +		Symamd returns FALSE if stats is not present.

    +

    		stats [0]:  number of dense or empty row and columns ignored
    +				(and ordered last in the output permutation 
    +				perm).  Note that a row/column can become
    +				"empty" if it contains only "dense" and/or
    +				"empty" columns/rows.

    +

    		stats [1]:  (same as stats [0])

    +

    		stats [2]:  number of garbage collections performed.

    +

    		stats [3]:  status code.  < 0 is an error code.
    +			    > 1 is a warning or notice.

    +

    			0	OK.  Each column of the input matrix contained
    +				row indices in increasing order, with no
    +				duplicates.

    +

    			1	OK, but columns of input matrix were jumbled
    +				(unsorted columns or duplicate entries).  Symamd
    +				had to do some extra work to sort the matrix
    +				first and remove duplicate entries, but it
    +				still was able to return a valid permutation
    +				(return value of symamd was TRUE).

    +

    					stats [4]: highest numbered column that
    +						is unsorted or has duplicate
    +						entries.
    +					stats [5]: last seen duplicate or
    +						unsorted row index.
    +					stats [6]: number of duplicate or
    +						unsorted row indices.

    +

    			-1	A is a null pointer

    +

    			-2	p is a null pointer

    +

    			-3	(unused, see colamd.c)

    +

    			-4 	n is negative

    +

    					stats [4]: n

    +

    			-5	number of nonzeros in matrix is negative

    +

    					stats [4]: # of nonzeros (p [n]).

    +

    			-6	p [0] is nonzero

    +

    					stats [4]: p [0]

    +

    			-7	(unused)

    +

    			-8	a column has a negative number of entries

    +

    					stats [4]: column with < 0 entries
    +					stats [5]: number of entries in col

    +

    			-9	a row index is out of bounds

    +

    					stats [4]: column with bad row index
    +					stats [5]: bad row index
    +					stats [6]: n_row, # of rows of matrx

    +

    			-10	out of memory (unable to allocate temporary
    +				workspace for M or count arrays using the
    +				"allocate" routine passed into symamd).

    +

    			-999	internal error.  colamd failed to order the
    +				matrix M, when it should have succeeded.  This
    +				indicates a bug.  If this (and *only* this)
    +				error code occurs, please contact the authors.
    +				Don't contact the authors if you get any other
    +				error code.

    +

    		Future versions may return more statistics in the stats array.

    +

    	    void * (*allocate) (size_t, size_t)

    +

    	    	A pointer to a function providing memory allocation.  The
    +		allocated memory must be returned initialized to zero.  For a
    +		C application, this argument should normally be a pointer to
    +		calloc.  For a MATLAB mexFunction, the routine mxCalloc is
    +		passed instead.

    +

    	    void (*release) (size_t, size_t)

    +

    	    	A pointer to a function that frees memory allocated by the
    +		memory allocation routine above.  For a C application, this
    +		argument should normally be a pointer to free.  For a MATLAB
    +		mexFunction, the routine mxFree is passed instead.

    +

        ----------------------------------------------------------------------------
    +    colamd_report:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    colamd_report (int stats [COLAMD_STATS]) ;

    +

    	Purpose:

    +

    	    Prints the error status and statistics recorded in the stats
    +	    array on the standard error output (for a standard C routine)
    +	    or on the MATLAB output (for a mexFunction).

    +

    	Arguments:

    +

    	    int stats [COLAMD_STATS] ;	Input only.  Statistics from colamd.

    +

        ----------------------------------------------------------------------------
    +    symamd_report:
    +    ----------------------------------------------------------------------------

    +

    	C syntax:

    +

    	    include "colamd.h"
    +	    symamd_report (int stats [COLAMD_STATS]) ;

    +

    	Purpose:

    +

    	    Prints the error status and statistics recorded in the stats
    +	    array on the standard error output (for a standard C routine)
    +	    or on the MATLAB output (for a mexFunction).

    +

    	Arguments:

    +

    	    int stats [COLAMD_STATS] ;	Input only.  Statistics from symamd.

    +

     

    Define Documentation

    + +
    +
    + + + + +
    #define ALIVE   (0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define ASSERT (expression   )    ((void) 0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define COL_IS_ALIVE (  )    (Col [c].start >= ALIVE)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define COL_IS_DEAD (  )    (Col [c].start < ALIVE)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define COL_IS_DEAD_PRINCIPAL (  )    (Col [c].start == DEAD_PRINCIPAL)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DEAD   (-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DEAD_NON_PRINCIPAL   (-2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DEAD_PRINCIPAL   (-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define DEBUG0 (params   )    ;
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define DEBUG1 (params   )    ;
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define DEBUG2 (params   )    ;
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define DEBUG3 (params   )    ;
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define DEBUG4 (params   )    ;
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define EMPTY   (-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define FALSE   (0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define INDEX (  )    (i)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define KILL_NON_PRINCIPAL_COL (  )    { Col [c].start = DEAD_NON_PRINCIPAL ; }
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define KILL_PRINCIPAL_COL (  )    { Col [c].start = DEAD_PRINCIPAL ; }
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define KILL_ROW (  )    { Row [r].shared2.mark = DEAD ; }
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define MAX (a,
     )    (((a) > (b)) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define MIN (a,
     )    (((a) < (b)) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define ONES_COMPLEMENT (  )    (-(r)-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define PRINTF   printf
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define PRIVATE   static
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define PUBLIC
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define ROW_IS_ALIVE (  )    (Row [r].shared2.mark >= ALIVE)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define ROW_IS_DEAD (  )    ROW_IS_MARKED_DEAD (Row[r].shared2.mark)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define ROW_IS_MARKED_DEAD (row_mark   )    (row_mark < ALIVE)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define TRUE   (1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    PRIVATE int clear_mark (int  n_row,
    Colamd_Row  Row[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PUBLIC int colamd (int  n_row,
    int  n_col,
    int  Alen,
    int  A[],
    int  p[],
    double  knobs[COLAMD_KNOBS],
    int  stats[COLAMD_STATS] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    PUBLIC int colamd_recommended (int  nnz,
    int  n_row,
    int  n_col 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    PUBLIC void colamd_report (int  stats[COLAMD_STATS]  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    PUBLIC void colamd_set_defaults (double  knobs[COLAMD_KNOBS]  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE void detect_super_cols (Colamd_Col  Col[],
    int  A[],
    int  head[],
    int  row_start,
    int  row_length 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE int find_ordering (int  n_row,
    int  n_col,
    int  Alen,
    Colamd_Row  Row[],
    Colamd_Col  Col[],
    int  A[],
    int  head[],
    int  n_col2,
    int  max_deg,
    int  pfree 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE int garbage_collection (int  n_row,
    int  n_col,
    Colamd_Row  Row[],
    Colamd_Col  Col[],
    int  A[],
    int *  pfree 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE int init_rows_cols (int  n_row,
    int  n_col,
    Colamd_Row  Row[],
    Colamd_Col  Col[],
    int  A[],
    int  p[],
    int  stats[COLAMD_STATS] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE void init_scoring (int  n_row,
    int  n_col,
    Colamd_Row  Row[],
    Colamd_Col  Col[],
    int  A[],
    int  head[],
    double  knobs[COLAMD_KNOBS],
    int *  p_n_row2,
    int *  p_n_col2,
    int *  p_max_deg 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    PRIVATE void order_children (int  n_col,
    Colamd_Col  Col[],
    int  p[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    PRIVATE void print_report (char *  method,
    int  stats[COLAMD_STATS] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PUBLIC int symamd (int  n,
    int  A[],
    int  p[],
    int  perm[],
    double  knobs[COLAMD_KNOBS],
    int  stats[COLAMD_STATS],
    void *(*)(size_t, size_t)  allocate,
    void(*)(void *)  release 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    PUBLIC void symamd_report (int  stats[COLAMD_STATS]  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h-source.html new file mode 100644 index 0000000..29f493d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h-source.html @@ -0,0 +1,217 @@ + + +SuperLU: SRC/colamd.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h.html new file mode 100644 index 0000000..ad226c4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/colamd_8h.html @@ -0,0 +1,794 @@ + + +SuperLU: SRC/colamd.h File Reference + + + + + +
    +

    SRC/colamd.h File Reference

    Colamd prototypes and definitions. More... +

    +#include <stdlib.h>
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  Colamd_Col_struct
    struct  Colamd_Row_struct

    Defines

    #define COLAMD_KNOBS   20
    #define COLAMD_STATS   20
    #define COLAMD_DENSE_ROW   0
    #define COLAMD_DENSE_COL   1
    #define COLAMD_DEFRAG_COUNT   2
    #define COLAMD_STATUS   3
    #define COLAMD_INFO1   4
    #define COLAMD_INFO2   5
    #define COLAMD_INFO3   6
    #define COLAMD_OK   (0)
    #define COLAMD_OK_BUT_JUMBLED   (1)
    #define COLAMD_ERROR_A_not_present   (-1)
    #define COLAMD_ERROR_p_not_present   (-2)
    #define COLAMD_ERROR_nrow_negative   (-3)
    #define COLAMD_ERROR_ncol_negative   (-4)
    #define COLAMD_ERROR_nnz_negative   (-5)
    #define COLAMD_ERROR_p0_nonzero   (-6)
    #define COLAMD_ERROR_A_too_small   (-7)
    #define COLAMD_ERROR_col_length_negative   (-8)
    #define COLAMD_ERROR_row_index_out_of_bounds   (-9)
    #define COLAMD_ERROR_out_of_memory   (-10)
    #define COLAMD_ERROR_internal_error   (-999)
    #define COLAMD_C(n_col)   ((int) (((n_col) + 1) * sizeof (Colamd_Col) / sizeof (int)))
    #define COLAMD_R(n_row)   ((int) (((n_row) + 1) * sizeof (Colamd_Row) / sizeof (int)))
    #define COLAMD_RECOMMENDED(nnz, n_row, n_col)

    Typedefs

    typedef struct Colamd_Col_struct Colamd_Col
    typedef struct Colamd_Row_struct Colamd_Row

    Functions

    int colamd_recommended (int nnz, int n_row, int n_col)
    void colamd_set_defaults (double knobs[COLAMD_KNOBS])
    int colamd (int n_row, int n_col, int Alen, int A[], int p[], double knobs[COLAMD_KNOBS], int stats[COLAMD_STATS])
    int symamd (int n, int A[], int p[], int perm[], double knobs[COLAMD_KNOBS], int stats[COLAMD_STATS], void *(*allocate)(size_t, size_t), void(*release)(void *))
    void colamd_report (int stats[COLAMD_STATS])
    void symamd_report (int stats[COLAMD_STATS])
    +


    Detailed Description

    +
     
    +    ==========================================================================
    +    === colamd/symamd prototypes and definitions =============================
    +    ==========================================================================

    +

        You must include this file (colamd.h) in any routine that uses colamd,
    +    symamd, or the related macros and definitions.

    +

        Authors:

    +

    	The authors of the code itself are Stefan I. Larimore and Timothy A.
    +	Davis (davis@cise.ufl.edu), University of Florida.  The algorithm was
    +	developed in collaboration with John Gilbert, Xerox PARC, and Esmond
    +	Ng, Oak Ridge National Laboratory.

    +

        Date:

    +

    	September 8, 2003.  Version 2.3.

    +

        Acknowledgements:

    +

    	This work was supported by the National Science Foundation, under
    +	grants DMS-9504974 and DMS-9803599.

    +

        Notice:

    +

    	Copyright (c) 1998-2003 by the University of Florida.
    +	All Rights Reserved.

    +

    	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    +	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

    	Permission is hereby granted to use, copy, modify, and/or distribute
    +	this program, provided that the Copyright, this License, and the
    +	Availability of the original version is retained on all copies and made
    +	accessible to the end-user of any code or package that includes COLAMD
    +	or any modified version of COLAMD.

    +

        Availability:

    +

    	The colamd/symamd library is available at

    +

    	    http://www.cise.ufl.edu/research/sparse/colamd/

    +

    	This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.h
    +	file.  It is required by the colamd.c, colamdmex.c, and symamdmex.c
    +	files, and by any C code that calls the routines whose prototypes are
    +	listed below, or that uses the colamd/symamd definitions listed below.
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define COLAMD_C (n_col   )    ((int) (((n_col) + 1) * sizeof (Colamd_Col) / sizeof (int)))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_DEFRAG_COUNT   2
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_DENSE_COL   1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_DENSE_ROW   0
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_A_not_present   (-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_A_too_small   (-7)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_col_length_negative   (-8)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_internal_error   (-999)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_ncol_negative   (-4)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_nnz_negative   (-5)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_nrow_negative   (-3)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_out_of_memory   (-10)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_p0_nonzero   (-6)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_p_not_present   (-2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_ERROR_row_index_out_of_bounds   (-9)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_INFO1   4
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_INFO2   5
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_INFO3   6
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_KNOBS   20
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_OK   (0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_OK_BUT_JUMBLED   (1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define COLAMD_R (n_row   )    ((int) (((n_row) + 1) * sizeof (Colamd_Row) / sizeof (int)))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define COLAMD_RECOMMENDED (nnz,
    n_row,
    n_col   ) 
    +
    +
    + +

    +Value:

    (                                                                             \
    +((nnz) < 0 || (n_row) < 0 || (n_col) < 0)                                     \
    +?                                                                             \
    +    (-1)                                                                      \
    +:                                                                             \
    +    (2 * (nnz) + COLAMD_C (n_col) + COLAMD_R (n_row) + (n_col) + ((nnz) / 5)) \
    +)
    +
    +
    +

    + +

    +
    + + + + +
    #define COLAMD_STATS   20
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define COLAMD_STATUS   3
    +
    +
    + +

    + +

    +

    +


    Typedef Documentation

    + +
    +
    + + + + +
    typedef struct Colamd_Col_struct Colamd_Col
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    typedef struct Colamd_Row_struct Colamd_Row
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int colamd (int  n_row,
    int  n_col,
    int  Alen,
    int  A[],
    int  p[],
    double  knobs[COLAMD_KNOBS],
    int  stats[COLAMD_STATS] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int colamd_recommended (int  nnz,
    int  n_row,
    int  n_col 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void colamd_report (int  stats[COLAMD_STATS]  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void colamd_set_defaults (double  knobs[COLAMD_KNOBS]  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int symamd (int  n,
    int  A[],
    int  p[],
    int  perm[],
    double  knobs[COLAMD_KNOBS],
    int  stats[COLAMD_STATS],
    void *(*)(size_t, size_t)  allocate,
    void(*)(void *)  release 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void symamd_report (int  stats[COLAMD_STATS]  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__bmod_8c.html new file mode 100644 index 0000000..d26efcd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__bmod_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/cpanel_bmod.c File Reference + + + + + +
    +

    SRC/cpanel_bmod.c File Reference

    Performs numeric block updates. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + +

    Functions

    void clsolve (int, int, complex *, complex *)
     Solves a dense UNIT lower triangular system.
    void cmatvec (int, int, int, complex *, complex *, complex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void ccheck_tempv ()
    void cpanel_bmod (const int m, const int w, const int jcol, const int nseg, complex *dense, complex *tempv, int *segrep, int *repfnz, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + +
    void ccheck_tempv (  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void clsolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec (int  ldm,
    int  nrow,
    int  ncol,
    complex M,
    complex vec,
    complex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    complex dense,
    complex tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__dfs_8c.html new file mode 100644 index 0000000..fe18808 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpanel__dfs_8c.html @@ -0,0 +1,175 @@ + + +SuperLU: SRC/cpanel_dfs.c File Reference + + + + + +
    +

    SRC/cpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, complex *dense, int *panel_lsub, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    complex dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotL_8c.html new file mode 100644 index 0000000..e1a3d77 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotL_8c.html @@ -0,0 +1,136 @@ + + +SuperLU: SRC/cpivotL.c File Reference + + + + + +
    +

    SRC/cpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int cpivotL (const int jcol, const double u, int *usepr, int *perm_r, int *iperm_r, int *iperm_c, int *pivrow, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotgrowth_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotgrowth_8c.html new file mode 100644 index 0000000..a9bd977 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpivotgrowth_8c.html @@ -0,0 +1,109 @@ + + +SuperLU: SRC/cpivotgrowth.c File Reference + + + + + +
    +

    SRC/cpivotgrowth.c File Reference

    Computes the reciprocal pivot growth factor. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    float cPivotGrowth (int ncols, SuperMatrix *A, int *perm_c, SuperMatrix *L, SuperMatrix *U)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float cPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_C; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_C; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_C; Mtype = TRU.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cpruneL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpruneL_8c.html new file mode 100644 index 0000000..897fa53 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cpruneL_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/cpruneL.c File Reference + + + + + +
    +

    SRC/cpruneL.c File Reference

    Prunes the L-structure. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void cpruneL (const int jcol, const int *perm_r, const int pivrow, const int nseg, const int *segrep, const int *repfnz, int *xprune, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + *

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/creadhb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadhb_8c.html new file mode 100644 index 0000000..cd991e5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadhb_8c.html @@ -0,0 +1,345 @@ + + +SuperLU: SRC/creadhb.c File Reference + + + + + +
    +

    SRC/creadhb.c File Reference

    Read a matrix stored in Harwell-Boeing format. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    int cDumpLine (FILE *fp)
     Eat up the rest of the current line.
    int cParseIntFormat (char *buf, int *num, int *size)
    int cParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    int cReadValues (FILE *fp, int n, complex *destination, int perline, int persize)
     Read complex numbers as pairs of (real, imaginary).
    void creadhb (int *nrow, int *ncol, int *nonz, complex **nzval, int **rowind, int **colptr)
     Auxiliary routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Purpose
    + =======

    +

     Read a COMPLEX PRECISION matrix stored in Harwell-Boeing format 
    + as described below.

    +

     Line 1 (A72,A8) 
    +  	Col. 1 - 72   Title (TITLE) 
    +	Col. 73 - 80  Key (KEY)

    +

     Line 2 (5I14) 
    + 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    +	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    +                    (including starting guesses and solution vectors 
    +		       if present) 
    +           	      (zero indicates no right-hand side data is present)

    +

     Line 3 (A3, 11X, 4I14) 
    +   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    +	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    +	              (equal to number of entries for assembled matrices) 
    + 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    +	              (zero in the case of assembled matrices) 
    + Line 4 (2A16, 2A20) 
    + 	Col. 1 - 16   Format for pointers (PTRFMT) 
    +	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    +	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

    +

     Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    +    	Col. 1 	      Right-hand side type: 
    +	         	  F for full storage or M for same format as matrix 
    +    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    +    	Col. 3        X if an exact solution vector(s) is supplied. 
    +	Col. 15 - 28  Number of right-hand sides (NRHS) 
    +	Col. 29 - 42  Number of row indices (NRHSIX) 
    +          	      (ignored in case of unassembled matrices)

    +

     The three character type field on line 3 describes the matrix type. 
    + The following table lists the permitted values for each of the three 
    + characters. As an example of the type field, RSA denotes that the matrix 
    + is real, symmetric, and assembled.

    +

     First Character: 
    +	R Real matrix 
    +	C Complex matrix 
    +	P Pattern only (no numerical values supplied)

    +

     Second Character: 
    +	S Symmetric 
    +	U Unsymmetric 
    +	H Hermitian 
    +	Z Skew symmetric 
    +	R Rectangular

    +

     Third Character: 
    +	A Assembled 
    +	E Elemental matrices (unassembled)

    +

     

    Function Documentation

    + +
    +
    + + + + + + + + + +
    int cDumpLine (FILE *  fp  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int cParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int cParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadhb (int *  nrow,
    int *  ncol,
    int *  nonz,
    complex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cReadValues (FILE *  fp,
    int  n,
    complex destination,
    int  perline,
    int  persize 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/creadrb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadrb_8c.html new file mode 100644 index 0000000..0e9017b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadrb_8c.html @@ -0,0 +1,302 @@ + + +SuperLU: SRC/creadrb.c File Reference + + + + + +
    +

    SRC/creadrb.c File Reference

    Read a matrix stored in Rutherford-Boeing format. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + +

    Functions

    static int cDumpLine (FILE *fp)
     Eat up the rest of the current line.
    static int cParseIntFormat (char *buf, int *num, int *size)
    static int cParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    static int cReadValues (FILE *fp, int n, complex *destination, int perline, int persize)
     Read complex numbers as pairs of (real, imaginary).
    void creadrb (int *nrow, int *ncol, int *nonz, complex **nzval, int **rowind, int **colptr)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    +Purpose =======

    +Read a COMPLEX PRECISION matrix stored in Rutherford-Boeing format as described below.

    +Line 1 (A72, A8) Col. 1 - 72 Title (TITLE) Col. 73 - 80 Matrix name / identifier (MTRXID)

    +Line 2 (I14, 3(1X, I13)) Col. 1 - 14 Total number of lines excluding header (TOTCRD) Col. 16 - 28 Number of lines for pointers (PTRCRD) Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) Col. 44 - 56 Number of lines for numerical values (VALCRD)

    +Line 3 (A3, 11X, 4(1X, I13)) Col. 1 - 3 Matrix type (see below) (MXTYPE) Col. 15 - 28 Compressed Column: Number of rows (NROW) Elemental: Largest integer used to index variable (MVAR) Col. 30 - 42 Compressed Column: Number of columns (NCOL) Elemental: Number of element matrices (NELT) Col. 44 - 56 Compressed Column: Number of entries (NNZERO) Elemental: Number of variable indeces (NVARIX) Col. 58 - 70 Compressed Column: Unused, explicitly zero Elemental: Number of elemental matrix entries (NELTVL)

    +Line 4 (2A16, A20) Col. 1 - 16 Fortran format for pointers (PTRFMT) Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) Col. 33 - 52 Fortran format for numerical values of coefficient matrix (VALFMT) (blank in the case of matrix patterns)

    +The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.

    +First Character: R Real matrix C Complex matrix I integer matrix P Pattern only (no numerical values supplied) Q Pattern only (numerical values supplied in associated auxiliary value file)

    +Second Character: S Symmetric U Unsymmetric H Hermitian Z Skew symmetric R Rectangular

    +Third Character: A Compressed column form E Elemental form

    +

    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + +
    static int cDumpLine (FILE *  fp  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int cParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int cParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadrb (int *  nrow,
    int *  ncol,
    int *  nonz,
    complex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int cReadValues (FILE *  fp,
    int  n,
    complex destination,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/creadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadtriple_8c.html new file mode 100644 index 0000000..59fc07f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/creadtriple_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: SRC/creadtriple.c File Reference + + + + + +
    +

    SRC/creadtriple.c File Reference

    #include "slu_cdefs.h"
    + + + + + + + +

    Functions

    void creadtriple (int *m, int *n, int *nonz, complex **nzval, int **rowind, int **colptr)
    void creadrhs (int m, complex *b)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void creadrhs (int  m,
    complex b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadtriple (int *  m,
    int *  n,
    int *  nonz,
    complex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__bmod_8c.html new file mode 100644 index 0000000..02490f0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__bmod_8c.html @@ -0,0 +1,107 @@ + + +SuperLU: SRC/csnode_bmod.c File Reference + + + + + +
    +

    SRC/csnode_bmod.c File Reference

    Performs numeric block updates within the relaxed snode. More... +

    +#include "slu_cdefs.h"
    + + + + + + +

    Functions

    int csnode_bmod (const int jcol, const int jsupno, const int fsupc, complex *dense, complex *tempv, GlobalLU_t *Glu, SuperLUStat_t *stat)
     Performs numeric block updates within the relaxed snode.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int csnode_bmod (const int  jcol,
    const int  jsupno,
    const int  fsupc,
    complex dense,
    complex tempv,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__dfs_8c.html new file mode 100644 index 0000000..dd01e60 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/csnode__dfs_8c.html @@ -0,0 +1,123 @@ + + +SuperLU: SRC/csnode_dfs.c File Reference + + + + + +
    +

    SRC/csnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int csnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *xprune, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int csnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    csnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas2_8c.html new file mode 100644 index 0000000..1f9f409 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas2_8c.html @@ -0,0 +1,401 @@ + + +SuperLU: SRC/csp_blas2.c File Reference + + + + + +
    +

    SRC/csp_blas2.c File Reference

    Sparse BLAS 2, using some dense BLAS 2 operations. More... +

    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    void cusolve (int, int, complex *, complex *)
     Solves a dense upper triangular system.
    void clsolve (int, int, complex *, complex *)
     Solves a dense UNIT lower triangular system.
    void cmatvec (int, int, int, complex *, complex *, complex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int sp_ctrsv (char *uplo, char *trans, char *diag, SuperMatrix *L, SuperMatrix *U, complex *x, SuperLUStat_t *stat, int *info)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_cgemv (char *trans, complex alpha, SuperMatrix *A, complex *x, int incx, complex beta, complex *y, int incy)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void clsolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cmatvec (int  ldm,
    int  nrow,
    int  ncol,
    complex M,
    complex vec,
    complex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cusolve (int  ldm,
    int  ncol,
    complex M,
    complex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_cgemv (char *  trans,
    complex  alpha,
    SuperMatrix A,
    complex x,
    int  incx,
    complex  beta,
    complex y,
    int  incy 
    )
    +
    +
    + +

    +

      
    +   Purpose   
    +   =======

    +

       sp_cgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) complex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Before entry, the leading m by n part of the array A must   
    +            contain the matrix of coefficients.

    +

       X      - (input) complex*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +           and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) complex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) complex*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

        ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_ctrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    complex x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_ctrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A^H*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_C, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_C, Mtype = TRU.

    +

       x       - (input/output) complex*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas3_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas3_8c.html new file mode 100644 index 0000000..4546edd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/csp__blas3_8c.html @@ -0,0 +1,199 @@ + + +SuperLU: SRC/csp_blas3.c File Reference + + + + + +
    +

    SRC/csp_blas3.c File Reference

    Sparse BLAS3, using some dense BLAS3 operations. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int sp_cgemm (char *transa, char *transb, int m, int n, int k, complex alpha, SuperMatrix *A, complex *b, int ldb, complex beta, complex *c, int ldc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_cgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    complex  alpha,
    SuperMatrix A,
    complex b,
    int  ldb,
    complex  beta,
    complex c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_c performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) complex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_C; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) complex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/cutil_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/cutil_8c.html new file mode 100644 index 0000000..7b21cce --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/cutil_8c.html @@ -0,0 +1,994 @@ + + +SuperLU: SRC/cutil.c File Reference + + + + + +
    +

    SRC/cutil.c File Reference

    Matrix utility functions. More... +

    +#include <math.h>
    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void cCreate_CompCol_Matrix (SuperMatrix *A, int m, int n, int nnz, complex *nzval, int *rowind, int *colptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
     Supernodal LU factor related.
    void cCreate_CompRow_Matrix (SuperMatrix *A, int m, int n, int nnz, complex *nzval, int *colind, int *rowptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void cCopy_CompCol_Matrix (SuperMatrix *A, SuperMatrix *B)
     Copy matrix A into matrix B.
    void cCreate_Dense_Matrix (SuperMatrix *X, int m, int n, complex *x, int ldx, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void cCopy_Dense_Matrix (int M, int N, complex *X, int ldx, complex *Y, int ldy)
    void cCreate_SuperNode_Matrix (SuperMatrix *L, int m, int n, int nnz, complex *nzval, int *nzval_colptr, int *rowind, int *rowind_colptr, int *col_to_sup, int *sup_to_col, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void cCompRow_to_CompCol (int m, int n, int nnz, complex *a, int *colind, int *rowptr, complex **at, int **rowind, int **colptr)
     Convert a row compressed storage into a column compressed storage.
    void cPrint_CompCol_Matrix (char *what, SuperMatrix *A)
     Routines for debugging.
    void cPrint_SuperNode_Matrix (char *what, SuperMatrix *A)
    void cPrint_Dense_Matrix (char *what, SuperMatrix *A)
    void cprint_lu_col (char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu)
     Diagnostic print of column "jcol" in the U/L factor.
    void ccheck_tempv (int n, complex *tempv)
     Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod".
    void cGenXtrue (int n, int nrhs, complex *x, int ldx)
    void cFillRHS (trans_t trans, int nrhs, complex *x, int ldx, SuperMatrix *A, SuperMatrix *B)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void cfill (complex *a, int alen, complex dval)
     Fills a complex precision array with a given value.
    void cinf_norm_error (int nrhs, SuperMatrix *X, complex *xtrue)
     Check the inf-norm of the error vector.
    void cPrintPerf (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, float rpg, float rcond, float *ferr, float *berr, char *equed, SuperLUStat_t *stat)
     Print performance of the code.
     print_complex_vec (char *what, int n, complex *vec)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void ccheck_tempv (int  n,
    complex tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCompRow_to_CompCol (int  m,
    int  n,
    int  nnz,
    complex a,
    int *  colind,
    int *  rowptr,
    complex **  at,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cCopy_CompCol_Matrix (SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCopy_Dense_Matrix (int  M,
    int  N,
    complex X,
    int  ldx,
    complex Y,
    int  ldy 
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_CompCol_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    complex nzval,
    int *  rowind,
    int *  colptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_CompRow_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    complex nzval,
    int *  colind,
    int *  rowptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_Dense_Matrix (SuperMatrix X,
    int  m,
    int  n,
    complex x,
    int  ldx,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_SuperNode_Matrix (SuperMatrix L,
    int  m,
    int  n,
    int  nnz,
    complex nzval,
    int *  nzval_colptr,
    int *  rowind,
    int *  rowind_colptr,
    int *  col_to_sup,
    int *  sup_to_col,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cfill (complex a,
    int  alen,
    complex  dval 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cFillRHS (trans_t  trans,
    int  nrhs,
    complex x,
    int  ldx,
    SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cGenXtrue (int  n,
    int  nrhs,
    complex x,
    int  ldx 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cinf_norm_error (int  nrhs,
    SuperMatrix X,
    complex xtrue 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_CompCol_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_Dense_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cprint_lu_col (char *  msg,
    int  jcol,
    int  pivrow,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_SuperNode_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cPrintPerf (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage,
    float  rpg,
    float  rcond,
    float *  ferr,
    float *  berr,
    char *  equed,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    print_complex_vec (char *  what,
    int  n,
    complex vec 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dGetDiagU_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dGetDiagU_8c.html new file mode 100644 index 0000000..e9a2d8b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dGetDiagU_8c.html @@ -0,0 +1,83 @@ + + +SuperLU: SRC/dGetDiagU.c File Reference + + + + + +
    +

    SRC/dGetDiagU.c File Reference

    Extracts main diagonal of matrix. More... +

    +#include <slu_ddefs.h>
    + + + + + +

    Functions

    void dGetDiagU (SuperMatrix *L, double *diagU)
    +


    Detailed Description

    +
     
    + -- Auxiliary routine in SuperLU (version 2.0) --
    + Lawrence Berkeley National Lab, Univ. of California Berkeley.
    + Xiaoye S. Li
    + September 11, 2003

    +

      Purpose
    + =======

    +

     GetDiagU extracts the main diagonal of matrix U of the LU factorization.

    +

     Arguments
    + =========

    +

     L      (input) SuperMatrix*
    +        The factor L from the factorization Pr*A*Pc=L*U as computed by
    +        dgstrf(). Use compressed row subscripts storage for supernodes,
    +        i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     diagU  (output) double*, dimension (n)
    +        The main diagonal of matrix U.

    +

     Note
    + ====
    + The diagonal blocks of the L and U matrices are stored in the L
    + data structures.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void dGetDiagU (SuperMatrix L,
    double *  diagU 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Wed Jul 1 10:15:07 2009 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__bmod_8c.html new file mode 100644 index 0000000..39bf513 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__bmod_8c.html @@ -0,0 +1,272 @@ + + +SuperLU: SRC/dcolumn_bmod.c File Reference + + + + + +
    +

    SRC/dcolumn_bmod.c File Reference

    performs numeric block updates More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + +

    Functions

    void dusolve (int, int, double *, double *)
     Solves a dense upper triangular system.
    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int dcolumn_bmod (const int jcol, const int nseg, double *dense, double *tempv, int *segrep, int *repfnz, int fpanelc, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

      Permission is hereby granted to use or copy this program for any
    +  purpose, provided the above notices are retained on all copies.
    +  Permission to modify the code and to distribute modified code is
    +  granted, provided the above notices are retained, and a notice that
    +  the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcolumn_bmod (const int  jcol,
    const int  nseg,
    double *  dense,
    double *  tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__dfs_8c.html new file mode 100644 index 0000000..afefb39 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcolumn__dfs_8c.html @@ -0,0 +1,182 @@ + + +SuperLU: SRC/dcolumn_dfs.c File Reference + + + + + +
    +

    SRC/dcolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + +

    Defines

    #define T2_SUPER
     What type of supernodes we want.

    Functions

    int dcolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define T2_SUPER
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dcomplex_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcomplex_8c.html new file mode 100644 index 0000000..702e6a4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcomplex_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/dcomplex.c File Reference + + + + + +
    +

    SRC/dcomplex.c File Reference

    Common arithmetic for complex type. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include <stdio.h>
    +#include "slu_dcomplex.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void z_div (doublecomplex *c, doublecomplex *a, doublecomplex *b)
     Complex Division c = a/b.
    double z_abs (doublecomplex *z)
     Returns sqrt(z.r^2 + z.i^2).
    double z_abs1 (doublecomplex *z)
     Approximates the abs. Returns abs(z.r) + abs(z.i).
    void z_exp (doublecomplex *r, doublecomplex *z)
     Return the exponentiation.
    void d_cnjg (doublecomplex *r, doublecomplex *z)
     Return the complex conjugate.
    double d_imag (doublecomplex *z)
     Return the imaginary part.
    doublecomplex z_sgn (doublecomplex *z)
     SIGN functions for complex number. Returns z/abs(z).
    doublecomplex z_sqrt (doublecomplex *z)
     Square-root of a complex number.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     This file defines common arithmetic operations for complex type.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void d_cnjg (doublecomplex r,
    doublecomplex z 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double d_imag (doublecomplex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double z_abs (doublecomplex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double z_abs1 (doublecomplex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void z_div (doublecomplex c,
    doublecomplex a,
    doublecomplex b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void z_exp (doublecomplex r,
    doublecomplex z 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex z_sgn (doublecomplex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex z_sqrt (doublecomplex z  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dcopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcopy__to__ucol_8c.html new file mode 100644 index 0000000..4b8b021 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dcopy__to__ucol_8c.html @@ -0,0 +1,106 @@ + + +SuperLU: SRC/dcopy_to_ucol.c File Reference + + + + + +
    +

    SRC/dcopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int dcopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, double *dense, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    double *  dense,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ddiagonal_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ddiagonal_8c.html new file mode 100644 index 0000000..182fa93 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ddiagonal_8c.html @@ -0,0 +1,98 @@ + + +SuperLU: SRC/ddiagonal.c File Reference + + + + + +
    +

    SRC/ddiagonal.c File Reference

    Auxiliary routines to work with diagonal elements. More... +

    +#include "slu_ddefs.h"
    + + + + + + + +

    Functions

    int dfill_diag (int n, NCformat *Astore)
    int ddominate (int n, NCformat *Astore)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int ddominate (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int dfill_diag (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dfgmr_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dfgmr_8c.html new file mode 100644 index 0000000..d23ee6e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dfgmr_8c.html @@ -0,0 +1,210 @@ + + +SuperLU: EXAMPLE/dfgmr.c File Reference + + + + + +
    +

    EXAMPLE/dfgmr.c File Reference

    flexible GMRES from ITSOL developed by Yousef Saad. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + +

    Defines

    #define epsmac   1.0e-16

    Functions

    double ddot_ (int *, double[], int *, double[], int *)
    double dnrm2_ (int *, double[], int *)
    int dfgmr (int n, void(*dmatvec)(double, double[], double, double[]), void(*dpsolve)(int, double[], double[]), double *rhs, double *sol, double tol, int im, int *itmax, FILE *fits)
    +


    Detailed Description

    +

    Define Documentation

    + +
    +
    + + + + +
    #define epsmac   1.0e-16
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double ddot_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dfgmr (int  n,
    void(*)(double, double[], double, double[])  dmatvec,
    void(*)(int, double[], double[])  dpsolve,
    double *  rhs,
    double *  sol,
    double  tol,
    int  im,
    int *  itmax,
    FILE *  fits 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgscon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgscon_8c.html new file mode 100644 index 0000000..50aec60 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgscon_8c.html @@ -0,0 +1,135 @@ + + +SuperLU: SRC/dgscon.c File Reference + + + + + +
    +

    SRC/dgscon.c File Reference

    Estimates reciprocal of the condition number of a general matrix. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dgscon (char *norm, SuperMatrix *L, SuperMatrix *U, double anorm, double *rcond, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routines DGECON.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    double  anorm,
    double *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by DGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            dgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

        ANORM   (input) double
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) double*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsequ_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsequ_8c.html new file mode 100644 index 0000000..0b052c5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsequ_8c.html @@ -0,0 +1,145 @@ + + +SuperLU: SRC/dgsequ.c File Reference + + + + + +
    +

    SRC/dgsequ.c File Reference

    Computes row and column scalings. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + +

    Functions

    void dgsequ (SuperMatrix *A, double *r, double *c, double *rowcnd, double *colcnd, double *amax, int *info)
     Driver related.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine DGEEQU
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsequ (SuperMatrix A,
    double *  r,
    double *  c,
    double *  rowcnd,
    double *  colcnd,
    double *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       DGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE.

    +

       R       (output) double*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) double*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) double*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) double*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) double*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsisx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsisx_8c.html new file mode 100644 index 0000000..8fced43 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsisx_8c.html @@ -0,0 +1,496 @@ + + +SuperLU: SRC/dgsisx.c File Reference + + + + + +
    +

    SRC/dgsisx.c File Reference

    Computes an approximate solutions of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dgsisx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, double *R, double *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, double *rcond, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from dgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, dgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) double*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) double*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsitrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsitrf_8c.html new file mode 100644 index 0000000..6a9b8a8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsitrf_8c.html @@ -0,0 +1,241 @@ + + +SuperLU: SRC/dgsitrf.c File Reference + + + + + +
    +

    SRC/dgsitrf.c File Reference

    #include "slu_ddefs.h"
    + + + + + +

    Functions

    void dgsitrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_D, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsrfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsrfs_8c.html new file mode 100644 index 0000000..d00f762 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgsrfs_8c.html @@ -0,0 +1,249 @@ + + +SuperLU: SRC/dgsrfs.c File Reference + + + + + +
    +

    SRC/dgsrfs.c File Reference

    Improves computed solution to a system of inear equations. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + + + +

    Defines

    #define ITMAX   5

    Functions

    void dgsrfs (trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, char *equed, double *R, double *C, SuperMatrix *B, SuperMatrix *X, double *ferr, double *berr, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routine DGERFS
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define ITMAX   5
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix B,
    SuperMatrix X,
    double *  ferr,
    double *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           dgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by dgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) double*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) double*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssv_8c.html new file mode 100644 index 0000000..37ea68b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssv_8c.html @@ -0,0 +1,202 @@ + + +SuperLU: SRC/dgssv.c File Reference + + + + + +
    +

    SRC/dgssv.c File Reference

    Solves the system of linear equations A*X=B. More... +

    +#include "slu_ddefs.h"
    + + + + + + +

    Functions

    void dgssv (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, SuperLUStat_t *stat, int *info)
     Driver routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from DGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_D; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssvx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssvx_8c.html new file mode 100644 index 0000000..7d3ec43 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgssvx_8c.html @@ -0,0 +1,450 @@ + + +SuperLU: SRC/dgssvx.c File Reference + + + + + +
    +

    SRC/dgssvx.c File Reference

    Solves the system of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dgssvx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, double *R, double *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, double *rcond, double *ferr, double *berr, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    double *  ferr,
    double *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from dgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) double*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) double*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) double*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) double*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrf_8c.html new file mode 100644 index 0000000..07f9ce6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrf_8c.html @@ -0,0 +1,261 @@ + + +SuperLU: SRC/dgstrf.c File Reference + + + + + +
    +

    SRC/dgstrf.c File Reference

    Computes an LU factorization of a general sparse matrix. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dgstrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_D, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see dpanel_dfs.c; marker2 is used for inner-factorization,
    +            see dcolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during dpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_ddefs.h.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsL_8c.html new file mode 100644 index 0000000..55c1d98 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsL_8c.html @@ -0,0 +1,307 @@ + + +SuperLU: SRC/dgstrsL.c File Reference + + + + + +
    +

    SRC/dgstrsL.c File Reference

    Performs the L-solve using the LU factorization computed by DGSTRF. More... +

    +#include "slu_ddefs.h"
    +#include "slu_util.h"
    + + + + + + + + + + + + + + + + +

    Functions

    void dusolve (int, int, double *, double *)
     Solves a dense upper triangular system.
    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void dgstrsL (char *trans, SuperMatrix *L, int *perm_r, SuperMatrix *B, int *info)
    void dprint_soln (int n, int nrhs, double *soln)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + September 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrsL (char *  trans,
    SuperMatrix L,
    int *  perm_r,
    SuperMatrix B,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     dgstrsL only performs the L-solve using the LU factorization computed
    + by DGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) char*
    +          Specifies the form of the system of equations:
    +          = 'N':  A * X = B  (No transpose)
    +          = 'T':  A'* X = B  (Transpose)
    +          = 'C':  A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dprint_soln (int  n,
    int  nrhs,
    double *  soln 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Wed Jul 1 10:15:07 2009 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsU_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsU_8c.html new file mode 100644 index 0000000..51a1e03 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrsU_8c.html @@ -0,0 +1,294 @@ + + +SuperLU: SRC/dgstrsU.c File Reference + + + + + +
    +

    SRC/dgstrsU.c File Reference

    Performs the U-solve using the LU factorization computed by DGSTRF. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + +

    Functions

    void dusolve (int, int, double *, double *)
     Solves a dense upper triangular system.
    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void dgstrsU (trans_t trans, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, SuperMatrix *B, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrsU (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     dgstrsU only performs the U-solve using the LU factorization computed
    + by DGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Wed Jul 1 10:15:07 2009 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrs_8c.html new file mode 100644 index 0000000..f02f71b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dgstrs_8c.html @@ -0,0 +1,332 @@ + + +SuperLU: SRC/dgstrs.c File Reference + + + + + +
    +

    SRC/dgstrs.c File Reference

    Solves a system using LU factorization. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    void dusolve (int, int, double *, double *)
     Solves a dense upper triangular system.
    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void dgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, SuperMatrix *B, SuperLUStat_t *stat, int *info)
    void dprint_soln (int n, int nrhs, double *soln)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + DGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dprint_soln (int  n,
    int  nrhs,
    double *  soln 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ditersol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ditersol_8c.html new file mode 100644 index 0000000..64aedb0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ditersol_8c.html @@ -0,0 +1,244 @@ + + +SuperLU: EXAMPLE/ditersol.c File Reference + + + + + +
    +

    EXAMPLE/ditersol.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void dmatvec_mult (double alpha, double x[], double beta, double y[])
    void dpsolve (int n, double x[], double y[])
    int main (int argc, char *argv[])

    Variables

    int * GLOBAL_PERM_C
    int * GLOBAL_PERM_R
    SuperMatrixGLOBAL_A
    SuperMatrixGLOBAL_L
    SuperMatrixGLOBAL_U
    SuperLUStat_tGLOBAL_STAT
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec_mult (double  alpha,
    double  x[],
    double  beta,
    double  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpsolve (int  n,
    double  x[],
    double  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    SuperMatrix* GLOBAL_A
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_L
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GLOBAL_PERM_C
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int * GLOBAL_PERM_R
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_U
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlacon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlacon_8c.html new file mode 100644 index 0000000..8244759 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlacon_8c.html @@ -0,0 +1,176 @@ + + +SuperLU: SRC/dlacon.c File Reference + + + + + +
    +

    SRC/dlacon.c File Reference

    Estimates the 1-norm. More... +

    +#include <math.h>
    +#include "slu_Cnames.h"
    + + + + + + + + + + +

    Defines

    #define d_sign(a, b)   (b >= 0 ? fabs(a) : -fabs(a))
    #define i_dnnt(a)   ( a>=0 ? floor(a+.5) : -floor(.5-a) )

    Functions

    int dlacon_ (int *n, double *v, double *x, int *isgn, double *est, int *kase)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + + + + +
    #define d_sign (a,
     )    (b >= 0 ? fabs(a) : -fabs(a))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define i_dnnt (  )    ( a>=0 ? floor(a+.5) : -floor(.5-a) )
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dlacon_ (int *  n,
    double *  v,
    double *  x,
    int *  isgn,
    double *  est,
    int *  kase 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DLACON estimates the 1-norm of a square matrix A.   
    +   Reverse communication is used for evaluating matrix-vector products.

    +

       Arguments   
    +   =========

    +

       N      (input) INT
    +          The order of the matrix.  N >= 1.

    +

       V      (workspace) DOUBLE PRECISION array, dimension (N)   
    +          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    +          (W is not returned).

    +

       X      (input/output) DOUBLE PRECISION array, dimension (N)   
    +          On an intermediate return, X should be overwritten by   
    +                A * X,   if KASE=1,   
    +                A' * X,  if KASE=2,
    +         and DLACON must be re-called with all the other parameters   
    +          unchanged.

    +

       ISGN   (workspace) INT array, dimension (N)

    +

       EST    (output) DOUBLE PRECISION   
    +          An estimate (a lower bound) for norm(A).

    +

       KASE   (input/output) INT
    +          On the initial call to DLACON, KASE should be 0.   
    +          On an intermediate return, KASE will be 1 or 2, indicating   
    +          whether X should be overwritten by A * X  or A' * X.   
    +          On the final return from DLACON, KASE will again be 0.

    +

       Further Details   
    +   ======= =======

    +

       Contributed by Nick Higham, University of Manchester.   
    +   Originally named CONEST, dated March 16, 1988.

    +

       Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    +   a real or complex matrix, with applications to condition estimation", 
    +   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    +   ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlamch_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlamch_8c.html new file mode 100644 index 0000000..9ebfb72 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlamch_8c.html @@ -0,0 +1,584 @@ + + +SuperLU: SRC/dlamch.c File Reference + + + + + +
    +

    SRC/dlamch.c File Reference

    Determines double precision machine parameters. More... +

    +#include <stdio.h>
    +#include "slu_Cnames.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define TRUE_   (1)
    #define FALSE_   (0)
    #define abs(x)   ((x) >= 0 ? (x) : -(x))
    #define min(a, b)   ((a) <= (b) ? (a) : (b))
    #define max(a, b)   ((a) >= (b) ? (a) : (b))

    Functions

    double dlamch_ (char *cmach)
    int dlamc1_ (int *beta, int *t, int *rnd, int *ieee1)
    int dlamc2_ (int *beta, int *t, int *rnd, double *eps, int *emin, double *rmin, int *emax, double *rmax)
    double dlamc3_ (double *a, double *b)
    int dlamc4_ (int *emin, double *start, int *base)
    int dlamc5_ (int *beta, int *p, int *emin, int *ieee, int *emax, double *rmax)
    double pow_di (double *ap, int *bp)
    +


    Detailed Description

    +
    +       -- LAPACK auxiliary routine (version 2.0) --   
    +       Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +       Courant Institute, Argonne National Lab, and Rice University   
    +       October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define abs (  )    ((x) >= 0 ? (x) : -(x))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define FALSE_   (0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define max (a,
     )    ((a) >= (b) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define min (a,
     )    ((a) <= (b) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define TRUE_   (1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dlamc1_ (int *  beta,
    int *  t,
    int *  rnd,
    int *  ieee1 
    )
    +
    +
    + +

    +

    + Purpose   
    +    =======

    +

        DLAMC1 determines the machine parameters given by BETA, T, RND, and   
    +    IEEE1.

    +

        Arguments   
    +    =========

    +

        BETA    (output) INT   
    +            The base of the machine.

    +

        T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.

    +

        RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not

    +

                be a reliable guide to the way in which the machine performs

    +

                its arithmetic.

    +

        IEEE1   (output) INT   
    +            Specifies whether rounding appears to be done in the IEEE   
    +            'round to nearest' style.

    +

        Further Details   
    +    ===============

    +

        The routine is based on the routine  ENVRON  by Malcolm and   
    +    incorporates suggestions by Gentleman and Marovich. See

    +

           Malcolm M. A. (1972) Algorithms to reveal properties of   
    +          floating-point arithmetic. Comms. of the ACM, 15, 949-951.

    +

           Gentleman W. M. and Marovich S. B. (1974) More on algorithms   
    +          that reveal properties of floating point arithmetic units.   
    +          Comms. of the ACM, 17, 276-277.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dlamc2_ (int *  beta,
    int *  t,
    int *  rnd,
    double *  eps,
    int *  emin,
    double *  rmin,
    int *  emax,
    double *  rmax 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMC2 determines the machine parameters specified in its argument   
    +    list.

    +

        Arguments   
    +    =========

    +

        BETA    (output) INT   
    +            The base of the machine.

    +

        T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.

    +

        RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not

    +

                be a reliable guide to the way in which the machine performs

    +

                its arithmetic.

    +

        EPS     (output) DOUBLE PRECISION   
    +            The smallest positive number such that

    +

                   fl( 1.0 - EPS ) .LT. 1.0,

    +

                where fl denotes the computed value.

    +

        EMIN    (output) INT   
    +            The minimum exponent before (gradual) underflow occurs.

    +

        RMIN    (output) DOUBLE PRECISION   
    +            The smallest normalized number for the machine, given by   
    +            BASE**( EMIN - 1 ), where  BASE  is the floating point value

    +

                of BETA.

    +

        EMAX    (output) INT   
    +            The maximum exponent before overflow occurs.

    +

        RMAX    (output) DOUBLE PRECISION   
    +            The largest positive number for the machine, given by   
    +            BASE**EMAX * ( 1 - EPS ), where  BASE  is the floating point

    +

                value of BETA.

    +

        Further Details   
    +    ===============

    +

        The computation of  EPS  is based on a routine PARANOIA by   
    +    W. Kahan of the University of California at Berkeley.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    double dlamc3_ (double *  a,
    double *  b 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMC3  is intended to force  A  and  B  to be stored prior to doing

    +

        the addition of  A  and  B ,  for use in situations where optimizers

    +

        might hold one of these in a register.

    +

        Arguments   
    +    =========

    +

        A, B    (input) DOUBLE PRECISION   
    +            The values A and B.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dlamc4_ (int *  emin,
    double *  start,
    int *  base 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMC4 is a service routine for DLAMC2.

    +

        Arguments   
    +    =========

    +

        EMIN    (output) EMIN   
    +            The minimum exponent before (gradual) underflow, computed by

    +

                setting A = START and dividing by BASE until the previous A   
    +            can not be recovered.

    +

        START   (input) DOUBLE PRECISION   
    +            The starting point for determining EMIN.

    +

        BASE    (input) INT   
    +            The base of the machine.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dlamc5_ (int *  beta,
    int *  p,
    int *  emin,
    int *  ieee,
    int *  emax,
    double *  rmax 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMC5 attempts to compute RMAX, the largest machine floating-point   
    +    number, without overflow.  It assumes that EMAX + abs(EMIN) sum   
    +    approximately to a power of 2.  It will fail on machines where this   
    +    assumption does not hold, for example, the Cyber 205 (EMIN = -28625,

    +

        EMAX = 28718).  It will also fail if the value supplied for EMIN is   
    +    too large (i.e. too close to zero), probably with overflow.

    +

        Arguments   
    +    =========

    +

        BETA    (input) INT   
    +            The base of floating-point arithmetic.

    +

        P       (input) INT   
    +            The number of base BETA digits in the mantissa of a   
    +            floating-point value.

    +

        EMIN    (input) INT   
    +            The minimum exponent before (gradual) underflow.

    +

        IEEE    (input) INT   
    +            A int flag specifying whether or not the arithmetic   
    +            system is thought to comply with the IEEE standard.

    +

        EMAX    (output) INT   
    +            The largest exponent before overflow

    +

        RMAX    (output) DOUBLE PRECISION   
    +            The largest machine floating-point number.

    +

       =====================================================================

    +

           First compute LEXP and UEXP, two powers of 2 that bound   
    +       abs(EMIN). We then assume that EMAX + abs(EMIN) will sum   
    +       approximately to the bound that is closest to abs(EMIN).   
    +       (EMAX is the exponent of the required number RMAX).
    +
    +
    +

    + +

    +
    + + + + + + + + + +
    double dlamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMCH determines double precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by DLAMCH:   
    +            = 'E' or 'e',   DLAMCH := eps   
    +            = 'S' or 's ,   DLAMCH := sfmin   
    +            = 'B' or 'b',   DLAMCH := base   
    +            = 'P' or 'p',   DLAMCH := eps*base   
    +            = 'N' or 'n',   DLAMCH := t   
    +            = 'R' or 'r',   DLAMCH := rnd   
    +            = 'M' or 'm',   DLAMCH := emin   
    +            = 'U' or 'u',   DLAMCH := rmin   
    +            = 'L' or 'l',   DLAMCH := emax   
    +            = 'O' or 'o',   DLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    double pow_di (double *  ap,
    int *  bp 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlangs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlangs_8c.html new file mode 100644 index 0000000..15a5339 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlangs_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/dlangs.c File Reference + + + + + +
    +

    SRC/dlangs.c File Reference

    Returns the value of the one norm. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    double dlangs (char *norm, SuperMatrix *A)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from lapack routine DLANGE 
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    double dlangs (char *  norm,
    SuperMatrix A 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       DLANGS returns the value of the one norm, or the Frobenius norm, or 
    +   the infinity norm, or the element of largest absolute value of a 
    +   real matrix A.

    +

       Description   
    +   ===========

    +

       DLANGE returns the value

    +

          DLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    +               (   
    +               ( norm1(A),         NORM = '1', 'O' or 'o'   
    +               (   
    +               ( normI(A),         NORM = 'I' or 'i'   
    +               (   
    +               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'

    +

       where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    +   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    +   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    +   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.

    +

       Arguments   
    +   =========

    +

       NORM    (input) CHARACTER*1   
    +           Specifies the value to be returned in DLANGE as described above.   
    +   A       (input) SuperMatrix*
    +           The M by N sparse matrix A.

    +

      =====================================================================
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlaqgs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlaqgs_8c.html new file mode 100644 index 0000000..07e67c6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlaqgs_8c.html @@ -0,0 +1,160 @@ + + +SuperLU: SRC/dlaqgs.c File Reference + + + + + +
    +

    SRC/dlaqgs.c File Reference

    Equlibrates a general sprase matrix. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + + + +

    Defines

    #define THRESH   (0.1)

    Functions

    void dlaqgs (SuperMatrix *A, double *r, double *c, double rowcnd, double colcnd, double amax, char *equed)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine DLAQGE
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define THRESH   (0.1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlaqgs (SuperMatrix A,
    double *  r,
    double *  c,
    double  rowcnd,
    double  colcnd,
    double  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_D; Mtype = GE.

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) double
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) double
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) double
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dldperm_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dldperm_8c.html new file mode 100644 index 0000000..40b590b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dldperm_8c.html @@ -0,0 +1,283 @@ + + +SuperLU: SRC/dldperm.c File Reference + + + + + +
    +

    SRC/dldperm.c File Reference

    Finds a row permutation so that the matrix has large entries on the diagonal. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + +

    Functions

    int_t mc64id_ (int_t *)
    int_t mc64ad_ (int_t *, int_t *, int_t *, int_t[], int_t[], double[], int_t *, int_t[], int_t *, int_t[], int_t *, double[], int_t[], int_t[])
    int dldperm (int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], double nzval[], int_t *perm, double u[], double v[])
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dldperm (int_t  job,
    int_t  n,
    int_t  nnz,
    int_t  colptr[],
    int_t  adjncy[],
    double  nzval[],
    int_t perm,
    double  u[],
    double  v[] 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       DLDPERM finds a row permutation so that the matrix has large
    +   entries on the diagonal.

    +

     Arguments
    + =========

    +

     job    (input) int
    +        Control the action. Possible values for JOB are:
    +        = 1 : Compute a row permutation of the matrix so that the
    +              permuted matrix has as many entries on its diagonal as
    +              possible. The values on the diagonal are of arbitrary size.
    +              HSL subroutine MC21A/AD is used for this.
    +        = 2 : Compute a row permutation of the matrix so that the smallest 
    +              value on the diagonal of the permuted matrix is maximized.
    +        = 3 : Compute a row permutation of the matrix so that the smallest
    +              value on the diagonal of the permuted matrix is maximized.
    +              The algorithm differs from the one used for JOB = 2 and may
    +              have quite a different performance.
    +        = 4 : Compute a row permutation of the matrix so that the sum
    +              of the diagonal entries of the permuted matrix is maximized.
    +        = 5 : Compute a row permutation of the matrix so that the product
    +              of the diagonal entries of the permuted matrix is maximized
    +              and vectors to scale the matrix so that the nonzero diagonal 
    +              entries of the permuted matrix are one in absolute value and 
    +              all the off-diagonal entries are less than or equal to one in 
    +              absolute value.
    +        Restriction: 1 <= JOB <= 5.

    +

     n      (input) int
    +        The order of the matrix.

    +

     nnz    (input) int
    +        The number of nonzeros in the matrix.

    +

     adjncy (input) int*, of size nnz
    +        The adjacency structure of the matrix, which contains the row
    +        indices of the nonzeros.

    +

     colptr (input) int*, of size n+1
    +        The pointers to the beginning of each column in ADJNCY.

    +

     nzval  (input) double*, of size nnz
    +        The nonzero values of the matrix. nzval[k] is the value of
    +        the entry corresponding to adjncy[k].
    +        It is not used if job = 1.

    +

     perm   (output) int*, of size n
    +        The permutation vector. perm[i] = j means row i in the
    +        original matrix is in row j of the permuted matrix.

    +

     u      (output) double*, of size n
    +        If job = 5, the natural logarithms of the row scaling factors.

    +

     v      (output) double*, of size n
    +        If job = 5, the natural logarithms of the column scaling factors. 
    +        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ad_ (int_t,
    int_t,
    int_t,
    int_t [],
    int_t [],
    double [],
    int_t,
    int_t [],
    int_t,
    int_t [],
    int_t,
    double [],
    int_t [],
    int_t [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int_t mc64id_ (int_t  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol1_8c.html new file mode 100644 index 0000000..b250939 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol1_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/dlinsol1.c File Reference + + + + + +
    +

    EXAMPLE/dlinsol1.c File Reference

    #include "slu_ddefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol_8c.html new file mode 100644 index 0000000..2bf17c1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsol_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/dlinsol.c File Reference + + + + + +
    +

    EXAMPLE/dlinsol.c File Reference

    #include "slu_ddefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx1_8c.html new file mode 100644 index 0000000..102cd1f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx1_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/dlinsolx1.c File Reference + + + + + +
    +

    EXAMPLE/dlinsolx1.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx2_8c.html new file mode 100644 index 0000000..4107cf5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx2_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/dlinsolx2.c File Reference + + + + + +
    +

    EXAMPLE/dlinsolx2.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx_8c.html new file mode 100644 index 0000000..56ab728 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dlinsolx_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/dlinsolx.c File Reference + + + + + +
    +

    EXAMPLE/dlinsolx.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dmemory_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dmemory_8c.html new file mode 100644 index 0000000..b1e9c69 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dmemory_8c.html @@ -0,0 +1,976 @@ + + +SuperLU: SRC/dmemory.c File Reference + + + + + +
    +

    SRC/dmemory.c File Reference

    Memory details. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define StackFull(x)   ( x + Glu->stack.used >= Glu->stack.size )
    #define NotDoubleAlign(addr)   ( (long int)addr & 7 )
    #define DoubleAlign(addr)   ( ((long int)addr + 7) & ~7L )
    #define TempSpace(m, w)
    #define Reduce(alpha)   ((alpha + 1) / 2)

    Functions

    void * dexpand (int *prev_len,MemType type,int len_to_copy,int keep_prev,GlobalLU_t *Glu)
     Expand the existing storage to accommodate more fill-ins.
    int dLUWorkInit (int m, int n, int panel_size, int **iworkptr, double **dworkptr, GlobalLU_t *Glu)
     Allocate known working storage. Returns 0 if success, otherwise returns the number of bytes allocated so far when failure occurred.
    void copy_mem_double (int, void *, void *)
    void dStackCompress (GlobalLU_t *Glu)
     Compress the work[] array to remove fragmentation.
    void dSetupSpace (void *work, int lwork, GlobalLU_t *Glu)
     Setup the memory model to be used for factorization.
    void * duser_malloc (int, int, GlobalLU_t *)
    void duser_free (int, int, GlobalLU_t *)
    void copy_mem_int (int, void *, void *)
    void user_bcopy (char *, char *, int)
    int dQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int ilu_dQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int dLUMemInit (fact_t fact, void *work, int lwork, int m, int n, int annz, int panel_size, double fill_ratio, SuperMatrix *L, SuperMatrix *U, GlobalLU_t *Glu, int **iwork, double **dwork)
     Allocate storage for the data structures common to all factor routines.
    void dSetRWork (int m, int panel_size, double *dworkptr, double **dense, double **tempv)
     Set up pointers for real working arrays.
    void dLUWorkFree (int *iwork, double *dwork, GlobalLU_t *Glu)
     Free the working storage used by factor routines.
    int dLUMemXpand (int jcol, int next, MemType mem_type, int *maxlen, GlobalLU_t *Glu)
     Expand the data structures for L and U during the factorization.
    void dallocateA (int n, int nnz, double **a, int **asub, int **xa)
     Allocate storage for original matrix A.
    double * doubleMalloc (int n)
    double * doubleCalloc (int n)
    int dmemory_usage (const int nzlmax, const int nzumax, const int nzlumax, const int n)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define DoubleAlign (addr   )    ( ((long int)addr + 7) & ~7L )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define NotDoubleAlign (addr   )    ( (long int)addr & 7 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define Reduce (alpha   )    ((alpha + 1) / 2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define StackFull (  )    ( x + Glu->stack.used >= Glu->stack.size )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define TempSpace (m,
     ) 
    +
    +
    + +

    +Value:

    ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
    +                              (w + 1) * m * sizeof(double) )
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_double (int  howmany,
    void *  old,
    void *  new 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_int (int ,
    void * ,
    void *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dallocateA (int  n,
    int  nnz,
    double **  a,
    int **  asub,
    int **  xa 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void * dexpand (int *  prev_len,
    MemType  type,
    int  len_to_copy,
    int  keep_prev,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    double  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    double **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dLUWorkFree (int *  iwork,
    double *  dwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dLUWorkInit (int  m,
    int  n,
    int  panel_size,
    int **  iworkptr,
    double **  dworkptr,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dmemory_usage (const int  nzlmax,
    const int  nzumax,
    const int  nzlumax,
    const int  n 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double* doubleCalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double* doubleMalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dSetRWork (int  m,
    int  panel_size,
    double *  dworkptr,
    double **  dense,
    double **  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dSetupSpace (void *  work,
    int  lwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +lwork = 0: use system malloc; lwork > 0: use user-supplied work[] space. +

    +

    + +

    +
    + + + + + + + + + +
    void dStackCompress (GlobalLU_t Glu  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void duser_free (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void * duser_malloc (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_bcopy (char * ,
    char * ,
    int  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dmyblas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dmyblas2_8c.html new file mode 100644 index 0000000..74f9547 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dmyblas2_8c.html @@ -0,0 +1,180 @@ + + +SuperLU: SRC/dmyblas2.c File Reference + + + + + +
    +

    SRC/dmyblas2.c File Reference

    Level 2 Blas operations. More... +

    + + + + + + + + + + + + +

    Functions

    void dlsolve (int ldm, int ncol, double *M, double *rhs)
     Solves a dense UNIT lower triangular system.
    void dusolve (int ldm, int ncol, double *M, double *rhs)
     Solves a dense upper triangular system.
    void dmatvec (int ldm, int nrow, int ncol, double *M, double *vec, double *Mxvec)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 
    Purpose: Level 2 BLAS operations: solves and matvec, written in C. Note: This is only used when the system lacks an efficient BLAS library.

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.css b/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.css new file mode 100644 index 0000000..74c22a2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.css @@ -0,0 +1,433 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { + font-weight: bold +} +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navpath { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { + text-decoration: none; + background-color: #6666cc; + color: #ffffff +} +A.el { + text-decoration: none; + font-weight: bold +} +A.elRef { + font-weight: bold +} +A.code:link { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.code:visited { + text-decoration: none; + font-weight: normal; + color: #0000FF +} +A.codeRef:link { + font-weight: normal; + color: #0000FF +} +A.codeRef:visited { + font-weight: normal; + color: #0000FF +} +A:hover { + text-decoration: none; + background-color: #f2f2ff +} +DL.el { + margin-left: -1cm +} +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { + margin-left: 16px; + font-style: italic; + font-size: 90% +} +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { + text-align: center; +} +IMG.formulaDsp { +} +IMG.formulaInl { + vertical-align: middle; +} +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +SPAN.vhdldigit { color: #ff00ff } +SPAN.vhdlchar { color: #000000 } +SPAN.vhdlkeyword { color: #700070 } +SPAN.vhdllogic { color: #ff0000 } + +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { + color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { + font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { + background: #e8eef2; + font-weight: bold; +} +HR { + height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { + font-size: 9pt; + font-weight: bold; +} +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} +.directory > h3 { + margin-top: 0; +} +.directory p { + margin: 0px; + white-space: nowrap; +} +.directory div { + display: none; + margin: 0px; +} +.directory img { + vertical-align: -30%; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.png b/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.png new file mode 100644 index 0000000..f0a274b Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/DOC/html/doxygen.png differ diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__bmod_8c.html new file mode 100644 index 0000000..4414103 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__bmod_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/dpanel_bmod.c File Reference + + + + + +
    +

    SRC/dpanel_bmod.c File Reference

    Performs numeric block updates. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + +

    Functions

    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void dcheck_tempv ()
    void dpanel_bmod (const int m, const int w, const int jcol, const int nseg, double *dense, double *tempv, int *segrep, int *repfnz, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + +
    void dcheck_tempv (  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    double *  dense,
    double *  tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__dfs_8c.html new file mode 100644 index 0000000..564c66a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpanel__dfs_8c.html @@ -0,0 +1,175 @@ + + +SuperLU: SRC/dpanel_dfs.c File Reference + + + + + +
    +

    SRC/dpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, double *dense, int *panel_lsub, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    double *  dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotL_8c.html new file mode 100644 index 0000000..b668646 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotL_8c.html @@ -0,0 +1,136 @@ + + +SuperLU: SRC/dpivotL.c File Reference + + + + + +
    +

    SRC/dpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int dpivotL (const int jcol, const double u, int *usepr, int *perm_r, int *iperm_r, int *iperm_c, int *pivrow, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotgrowth_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotgrowth_8c.html new file mode 100644 index 0000000..0a02c6b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpivotgrowth_8c.html @@ -0,0 +1,109 @@ + + +SuperLU: SRC/dpivotgrowth.c File Reference + + + + + +
    +

    SRC/dpivotgrowth.c File Reference

    Computes the reciprocal pivot growth factor. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    double dPivotGrowth (int ncols, SuperMatrix *A, int *perm_c, SuperMatrix *L, SuperMatrix *U)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double dPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_D; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_D; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_D; Mtype = TRU.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dpruneL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpruneL_8c.html new file mode 100644 index 0000000..021a40d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dpruneL_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/dpruneL.c File Reference + + + + + +
    +

    SRC/dpruneL.c File Reference

    Prunes the L-structure. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void dpruneL (const int jcol, const int *perm_r, const int pivrow, const int nseg, const int *segrep, const int *repfnz, int *xprune, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + *

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadhb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadhb_8c.html new file mode 100644 index 0000000..6d6d938 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadhb_8c.html @@ -0,0 +1,344 @@ + + +SuperLU: SRC/dreadhb.c File Reference + + + + + +
    +

    SRC/dreadhb.c File Reference

    Read a matrix stored in Harwell-Boeing format. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + +

    Functions

    int dDumpLine (FILE *fp)
     Eat up the rest of the current line.
    int dParseIntFormat (char *buf, int *num, int *size)
    int dParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    int dReadValues (FILE *fp, int n, double *destination, int perline, int persize)
    void dreadhb (int *nrow, int *ncol, int *nonz, double **nzval, int **rowind, int **colptr)
     Auxiliary routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Purpose
    + =======

    +

     Read a DOUBLE PRECISION matrix stored in Harwell-Boeing format 
    + as described below.

    +

     Line 1 (A72,A8) 
    +  	Col. 1 - 72   Title (TITLE) 
    +	Col. 73 - 80  Key (KEY)

    +

     Line 2 (5I14) 
    + 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    +	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    +                    (including starting guesses and solution vectors 
    +		       if present) 
    +           	      (zero indicates no right-hand side data is present)

    +

     Line 3 (A3, 11X, 4I14) 
    +   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    +	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    +	              (equal to number of entries for assembled matrices) 
    + 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    +	              (zero in the case of assembled matrices) 
    + Line 4 (2A16, 2A20) 
    + 	Col. 1 - 16   Format for pointers (PTRFMT) 
    +	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    +	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

    +

     Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    +    	Col. 1 	      Right-hand side type: 
    +	         	  F for full storage or M for same format as matrix 
    +    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    +    	Col. 3        X if an exact solution vector(s) is supplied. 
    +	Col. 15 - 28  Number of right-hand sides (NRHS) 
    +	Col. 29 - 42  Number of row indices (NRHSIX) 
    +          	      (ignored in case of unassembled matrices)

    +

     The three character type field on line 3 describes the matrix type. 
    + The following table lists the permitted values for each of the three 
    + characters. As an example of the type field, RSA denotes that the matrix 
    + is real, symmetric, and assembled.

    +

     First Character: 
    +	R Real matrix 
    +	C Complex matrix 
    +	P Pattern only (no numerical values supplied)

    +

     Second Character: 
    +	S Symmetric 
    +	U Unsymmetric 
    +	H Hermitian 
    +	Z Skew symmetric 
    +	R Rectangular

    +

     Third Character: 
    +	A Assembled 
    +	E Elemental matrices (unassembled)

    +

     

    Function Documentation

    + +
    +
    + + + + + + + + + +
    int dDumpLine (FILE *  fp  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadhb (int *  nrow,
    int *  ncol,
    int *  nonz,
    double **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dReadValues (FILE *  fp,
    int  n,
    double *  destination,
    int  perline,
    int  persize 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadrb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadrb_8c.html new file mode 100644 index 0000000..6981be1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dreadrb_8c.html @@ -0,0 +1,301 @@ + + +SuperLU: SRC/dreadrb.c File Reference + + + + + +
    +

    SRC/dreadrb.c File Reference

    Read a matrix stored in Rutherford-Boeing format. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    static int dDumpLine (FILE *fp)
     Eat up the rest of the current line.
    static int dParseIntFormat (char *buf, int *num, int *size)
    static int dParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    static int dReadValues (FILE *fp, int n, double *destination, int perline, int persize)
    void dreadrb (int *nrow, int *ncol, int *nonz, double **nzval, int **rowind, int **colptr)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    +Purpose =======

    +Read a DOUBLE PRECISION matrix stored in Rutherford-Boeing format as described below.

    +Line 1 (A72, A8) Col. 1 - 72 Title (TITLE) Col. 73 - 80 Matrix name / identifier (MTRXID)

    +Line 2 (I14, 3(1X, I13)) Col. 1 - 14 Total number of lines excluding header (TOTCRD) Col. 16 - 28 Number of lines for pointers (PTRCRD) Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) Col. 44 - 56 Number of lines for numerical values (VALCRD)

    +Line 3 (A3, 11X, 4(1X, I13)) Col. 1 - 3 Matrix type (see below) (MXTYPE) Col. 15 - 28 Compressed Column: Number of rows (NROW) Elemental: Largest integer used to index variable (MVAR) Col. 30 - 42 Compressed Column: Number of columns (NCOL) Elemental: Number of element matrices (NELT) Col. 44 - 56 Compressed Column: Number of entries (NNZERO) Elemental: Number of variable indeces (NVARIX) Col. 58 - 70 Compressed Column: Unused, explicitly zero Elemental: Number of elemental matrix entries (NELTVL)

    +Line 4 (2A16, A20) Col. 1 - 16 Fortran format for pointers (PTRFMT) Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) Col. 33 - 52 Fortran format for numerical values of coefficient matrix (VALFMT) (blank in the case of matrix patterns)

    +The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.

    +First Character: R Real matrix C Complex matrix I integer matrix P Pattern only (no numerical values supplied) Q Pattern only (numerical values supplied in associated auxiliary value file)

    +Second Character: S Symmetric U Unsymmetric H Hermitian Z Skew symmetric R Rectangular

    +Third Character: A Compressed column form E Elemental form

    +

    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + +
    static int dDumpLine (FILE *  fp  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int dParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int dParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadrb (int *  nrow,
    int *  ncol,
    int *  nonz,
    double **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int dReadValues (FILE *  fp,
    int  n,
    double *  destination,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__bmod_8c.html new file mode 100644 index 0000000..0570613 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__bmod_8c.html @@ -0,0 +1,107 @@ + + +SuperLU: SRC/dsnode_bmod.c File Reference + + + + + +
    +

    SRC/dsnode_bmod.c File Reference

    Performs numeric block updates within the relaxed snode. More... +

    +#include "slu_ddefs.h"
    + + + + + + +

    Functions

    int dsnode_bmod (const int jcol, const int jsupno, const int fsupc, double *dense, double *tempv, GlobalLU_t *Glu, SuperLUStat_t *stat)
     Performs numeric block updates within the relaxed snode.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dsnode_bmod (const int  jcol,
    const int  jsupno,
    const int  fsupc,
    double *  dense,
    double *  tempv,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__dfs_8c.html new file mode 100644 index 0000000..a8a6f26 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsnode__dfs_8c.html @@ -0,0 +1,123 @@ + + +SuperLU: SRC/dsnode_dfs.c File Reference + + + + + +
    +

    SRC/dsnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int dsnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *xprune, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    dsnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas2_8c.html new file mode 100644 index 0000000..74fb794 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas2_8c.html @@ -0,0 +1,403 @@ + + +SuperLU: SRC/dsp_blas2.c File Reference + + + + + +
    +

    SRC/dsp_blas2.c File Reference

    Sparse BLAS 2, using some dense BLAS 2 operations. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    void dusolve (int, int, double *, double *)
     Solves a dense upper triangular system.
    void dlsolve (int, int, double *, double *)
     Solves a dense UNIT lower triangular system.
    void dmatvec (int, int, int, double *, double *, double *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int sp_dtrsv (char *uplo, char *trans, char *diag, SuperMatrix *L, SuperMatrix *U, double *x, SuperLUStat_t *stat, int *info)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_dgemv (char *trans, double alpha, SuperMatrix *A, double *x, int incx, double beta, double *y, int incy)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlsolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dmatvec (int  ldm,
    int  nrow,
    int  ncol,
    double *  M,
    double *  vec,
    double *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dusolve (int  ldm,
    int  ncol,
    double *  M,
    double *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dgemv (char *  trans,
    double  alpha,
    SuperMatrix A,
    double *  x,
    int  incx,
    double  beta,
    double *  y,
    int  incy 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       sp_dgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) double
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       X      - (input) double*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) double
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) double*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

       ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dtrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    double *  x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_dtrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A'*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_D, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_D, Mtype = TRU.

    +

       x       - (input/output) double*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas3_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas3_8c.html new file mode 100644 index 0000000..ebb94a9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dsp__blas3_8c.html @@ -0,0 +1,199 @@ + + +SuperLU: SRC/dsp_blas3.c File Reference + + + + + +
    +

    SRC/dsp_blas3.c File Reference

    Sparse BLAS3, using some dense BLAS3 operations. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int sp_dgemm (char *transa, char *transb, int m, int n, int k, double alpha, SuperMatrix *A, double *b, int ldb, double beta, double *c, int ldc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    double  alpha,
    SuperMatrix A,
    double *  b,
    int  ldb,
    double  beta,
    double *  c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_d performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) double
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) double
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - DOUBLE PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dutil_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dutil_8c.html new file mode 100644 index 0000000..2aa86ba --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dutil_8c.html @@ -0,0 +1,994 @@ + + +SuperLU: SRC/dutil.c File Reference + + + + + +
    +

    SRC/dutil.c File Reference

    Matrix utility functions. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void dCreate_CompCol_Matrix (SuperMatrix *A, int m, int n, int nnz, double *nzval, int *rowind, int *colptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
     Supernodal LU factor related.
    void dCreate_CompRow_Matrix (SuperMatrix *A, int m, int n, int nnz, double *nzval, int *colind, int *rowptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void dCopy_CompCol_Matrix (SuperMatrix *A, SuperMatrix *B)
     Copy matrix A into matrix B.
    void dCreate_Dense_Matrix (SuperMatrix *X, int m, int n, double *x, int ldx, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void dCopy_Dense_Matrix (int M, int N, double *X, int ldx, double *Y, int ldy)
    void dCreate_SuperNode_Matrix (SuperMatrix *L, int m, int n, int nnz, double *nzval, int *nzval_colptr, int *rowind, int *rowind_colptr, int *col_to_sup, int *sup_to_col, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void dCompRow_to_CompCol (int m, int n, int nnz, double *a, int *colind, int *rowptr, double **at, int **rowind, int **colptr)
     Convert a row compressed storage into a column compressed storage.
    void dPrint_CompCol_Matrix (char *what, SuperMatrix *A)
     Routines for debugging.
    void dPrint_SuperNode_Matrix (char *what, SuperMatrix *A)
    void dPrint_Dense_Matrix (char *what, SuperMatrix *A)
    void dprint_lu_col (char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu)
     Diagnostic print of column "jcol" in the U/L factor.
    void dcheck_tempv (int n, double *tempv)
     Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod".
    void dGenXtrue (int n, int nrhs, double *x, int ldx)
    void dFillRHS (trans_t trans, int nrhs, double *x, int ldx, SuperMatrix *A, SuperMatrix *B)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void dfill (double *a, int alen, double dval)
     Fills a double precision array with a given value.
    void dinf_norm_error (int nrhs, SuperMatrix *X, double *xtrue)
     Check the inf-norm of the error vector.
    void dPrintPerf (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, double rpg, double rcond, double *ferr, double *berr, char *equed, SuperLUStat_t *stat)
     Print performance of the code.
     print_double_vec (char *what, int n, double *vec)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void dcheck_tempv (int  n,
    double *  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCompRow_to_CompCol (int  m,
    int  n,
    int  nnz,
    double *  a,
    int *  colind,
    int *  rowptr,
    double **  at,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dCopy_CompCol_Matrix (SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCopy_Dense_Matrix (int  M,
    int  N,
    double *  X,
    int  ldx,
    double *  Y,
    int  ldy 
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_CompCol_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    double *  nzval,
    int *  rowind,
    int *  colptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_CompRow_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    double *  nzval,
    int *  colind,
    int *  rowptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_Dense_Matrix (SuperMatrix X,
    int  m,
    int  n,
    double *  x,
    int  ldx,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_SuperNode_Matrix (SuperMatrix L,
    int  m,
    int  n,
    int  nnz,
    double *  nzval,
    int *  nzval_colptr,
    int *  rowind,
    int *  rowind_colptr,
    int *  col_to_sup,
    int *  sup_to_col,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dfill (double *  a,
    int  alen,
    double  dval 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dFillRHS (trans_t  trans,
    int  nrhs,
    double *  x,
    int  ldx,
    SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dGenXtrue (int  n,
    int  nrhs,
    double *  x,
    int  ldx 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dinf_norm_error (int  nrhs,
    SuperMatrix X,
    double *  xtrue 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_CompCol_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_Dense_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dprint_lu_col (char *  msg,
    int  jcol,
    int  pivrow,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_SuperNode_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dPrintPerf (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage,
    double  rpg,
    double  rcond,
    double *  ferr,
    double *  berr,
    char *  equed,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    print_double_vec (char *  what,
    int  n,
    double *  vec 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/dzsum1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/dzsum1_8c.html new file mode 100644 index 0000000..ecfe0c9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/dzsum1_8c.html @@ -0,0 +1,116 @@ + + +SuperLU: SRC/dzsum1.c File Reference + + + + + +
    +

    SRC/dzsum1.c File Reference

    Takes sum of the absolute values of a complex vector and returns a double precision result. More... +

    +#include "slu_dcomplex.h"
    +#include "slu_Cnames.h"
    + + + + + + + + +

    Defines

    #define CX(I)   cx[(I)-1]

    Functions

    double dzsum1_ (int *n, doublecomplex *cx, int *incx)
    +


    Detailed Description

    +
    +     -- LAPACK auxiliary routine (version 2.0) --   
    +     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +     Courant Institute, Argonne National Lab, and Rice University   
    +     October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define CX (  )    cx[(I)-1]
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dzsum1_ (int *  n,
    doublecomplex cx,
    int *  incx 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DZSUM1 takes the sum of the absolute values of a complex   
    +    vector and returns a double precision result.

    +

        Based on DZASUM from the Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.

    +

        Contributed by Nick Higham for use with ZLACON.

    +

        Arguments   
    +    =========

    +

        N       (input) INT   
    +            The number of elements in the vector CX.

    +

        CX      (input) COMPLEX*16 array, dimension (N)   
    +            The vector whose elements will be summed.

    +

        INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX > 0.

    +

        ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/fgmr_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/fgmr_8c.html new file mode 100644 index 0000000..244fd5b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/fgmr_8c.html @@ -0,0 +1,315 @@ + + +SuperLU: EXAMPLE/fgmr.c File Reference + + + + + +
    +

    EXAMPLE/fgmr.c File Reference

    #include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + +

    Defines

    #define epsmac   1.0e-16

    Functions

    double ddot_ (int *, double[], int *, double[], int *)
    double dnrm2_ (int *, double[], int *)
    void daxpy_ (int *, double *, double[], int *, double[], int *)
    double dcopy_ (int *, double[], int *, double[], int *)
    int fgmr (int n, void(*matvec)(double, double[], double, double[]), void(*psolve)(int, double[], double[]), double *rhs, double *sol, double tol, int im, int *itmax, FILE *fits)
    +

    Define Documentation

    + +
    +
    + + + + +
    #define epsmac   1.0e-16
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void daxpy_ (int * ,
    double * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double dcopy_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double ddot_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int fgmr (int  n,
    void(*)(double, double[], double, double[])  matvec,
    void(*)(int, double[], double[])  psolve,
    double *  rhs,
    double *  sol,
    double  tol,
    int  im,
    int *  itmax,
    FILE *  fits 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/files.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/files.html new file mode 100644 index 0000000..982b0e7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/files.html @@ -0,0 +1,255 @@ + + +SuperLU: File Index + + + + + +
    +

    File List

    Here is a list of all files with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    EXAMPLE/cfgmr.cFlexible GMRES from ITSOL developed by Yousef Saad
    EXAMPLE/citersol.c
    EXAMPLE/clinsol.c
    EXAMPLE/clinsol1.c
    EXAMPLE/clinsolx.c
    EXAMPLE/clinsolx1.c
    EXAMPLE/clinsolx2.c
    EXAMPLE/dfgmr.cFlexible GMRES from ITSOL developed by Yousef Saad
    EXAMPLE/ditersol.c
    EXAMPLE/dlinsol.c
    EXAMPLE/dlinsol1.c
    EXAMPLE/dlinsolx.c
    EXAMPLE/dlinsolx1.c
    EXAMPLE/dlinsolx2.c
    EXAMPLE/dreadtriple.c
    EXAMPLE/fgmr.c
    EXAMPLE/sfgmr.cFlexible GMRES from ITSOL developed by Yousef Saad
    EXAMPLE/sitersol.c
    EXAMPLE/slinsol.c
    EXAMPLE/slinsol1.c
    EXAMPLE/slinsolx.c
    EXAMPLE/slinsolx1.c
    EXAMPLE/slinsolx2.c
    EXAMPLE/sp_ienv.c
    EXAMPLE/superlu.cSmall 5x5 example
    EXAMPLE/zfgmr.cFlexible GMRES from ITSOL developed by Yousef Saad
    EXAMPLE/zitersol.c
    EXAMPLE/zlinsol.c
    EXAMPLE/zlinsol1.c
    EXAMPLE/zlinsolx.c
    EXAMPLE/zlinsolx1.c
    EXAMPLE/zlinsolx2.c
    EXAMPLE/zreadtriple.c
    SRC/ccolumn_bmod.cPerforms numeric block updates
    SRC/ccolumn_dfs.cPerforms a symbolic factorization
    SRC/ccopy_to_ucol.cCopy a computed column of U to the compressed data structure
    SRC/cdiagonal.cAuxiliary routines to work with diagonal elements
    SRC/cgscon.cEstimates reciprocal of the condition number of a general matrix
    SRC/cgsequ.cComputes row and column scalings
    SRC/cgsisx.cComputes an approximate solutions of linear equations A*X=B or A'*X=B
    SRC/cgsitrf.c
    SRC/cgsrfs.cImproves computed solution to a system of inear equations
    SRC/cgssv.cSolves the system of linear equations A*X=B
    SRC/cgssvx.cSolves the system of linear equations A*X=B or A'*X=B
    SRC/cgstrf.cComputes an LU factorization of a general sparse matrix
    SRC/cgstrs.cSolves a system using LU factorization
    SRC/clacon.cEstimates the 1-norm
    SRC/clangs.cReturns the value of the one norm
    SRC/claqgs.cEqulibrates a general sprase matrix
    SRC/cldperm.cFinds a row permutation so that the matrix has large entries on the diagonal
    SRC/cmemory.cMemory details
    SRC/cmyblas2.cLevel 2 Blas operations
    SRC/colamd.cA sparse matrix column ordering algorithm
    SRC/colamd.h [code]Colamd prototypes and definitions
    SRC/cpanel_bmod.cPerforms numeric block updates
    SRC/cpanel_dfs.cPeforms a symbolic factorization on a panel of symbols
    SRC/cpivotgrowth.cComputes the reciprocal pivot growth factor
    SRC/cpivotL.cPerforms numerical pivoting
    SRC/cpruneL.cPrunes the L-structure
    SRC/creadhb.cRead a matrix stored in Harwell-Boeing format
    SRC/creadrb.cRead a matrix stored in Rutherford-Boeing format
    SRC/creadtriple.c
    SRC/csnode_bmod.cPerforms numeric block updates within the relaxed snode
    SRC/csnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/csp_blas2.cSparse BLAS 2, using some dense BLAS 2 operations
    SRC/csp_blas3.cSparse BLAS3, using some dense BLAS3 operations
    SRC/cutil.cMatrix utility functions
    SRC/dcolumn_bmod.cPerforms numeric block updates
    SRC/dcolumn_dfs.cPerforms a symbolic factorization
    SRC/dcomplex.cCommon arithmetic for complex type
    SRC/dcopy_to_ucol.cCopy a computed column of U to the compressed data structure
    SRC/ddiagonal.cAuxiliary routines to work with diagonal elements
    SRC/dgscon.cEstimates reciprocal of the condition number of a general matrix
    SRC/dgsequ.cComputes row and column scalings
    SRC/dgsisx.cComputes an approximate solutions of linear equations A*X=B or A'*X=B
    SRC/dgsitrf.c
    SRC/dgsrfs.cImproves computed solution to a system of inear equations
    SRC/dgssv.cSolves the system of linear equations A*X=B
    SRC/dgssvx.cSolves the system of linear equations A*X=B or A'*X=B
    SRC/dgstrf.cComputes an LU factorization of a general sparse matrix
    SRC/dgstrs.cSolves a system using LU factorization
    SRC/dlacon.cEstimates the 1-norm
    SRC/dlamch.cDetermines double precision machine parameters
    SRC/dlangs.cReturns the value of the one norm
    SRC/dlaqgs.cEqulibrates a general sprase matrix
    SRC/dldperm.cFinds a row permutation so that the matrix has large entries on the diagonal
    SRC/dmemory.cMemory details
    SRC/dmyblas2.cLevel 2 Blas operations
    SRC/dpanel_bmod.cPerforms numeric block updates
    SRC/dpanel_dfs.cPeforms a symbolic factorization on a panel of symbols
    SRC/dpivotgrowth.cComputes the reciprocal pivot growth factor
    SRC/dpivotL.cPerforms numerical pivoting
    SRC/dpruneL.cPrunes the L-structure
    SRC/dreadhb.cRead a matrix stored in Harwell-Boeing format
    SRC/dreadrb.cRead a matrix stored in Rutherford-Boeing format
    SRC/dreadtriple.c
    SRC/dsnode_bmod.cPerforms numeric block updates within the relaxed snode
    SRC/dsnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/dsp_blas2.cSparse BLAS 2, using some dense BLAS 2 operations
    SRC/dsp_blas3.cSparse BLAS3, using some dense BLAS3 operations
    SRC/dutil.cMatrix utility functions
    SRC/dzsum1.cTakes sum of the absolute values of a complex vector and returns a double precision result
    SRC/get_perm_c.cMatrix permutation operations
    SRC/heap_relax_snode.cIdentify the initial relaxed supernodes
    SRC/html_mainpage.h [code]
    SRC/icmax1.cFinds the index of the element whose real part has maximum absolute value
    SRC/ilu_ccolumn_dfs.cPerforms a symbolic factorization
    SRC/ilu_ccopy_to_ucol.cCopy a computed column of U to the compressed data structure and drop some small entries
    SRC/ilu_cdrop_row.cDrop small rows from L
    SRC/ilu_cpanel_dfs.cPeforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column
    SRC/ilu_cpivotL.cPerforms numerical pivoting
    SRC/ilu_csnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/ilu_dcolumn_dfs.cPerforms a symbolic factorization
    SRC/ilu_dcopy_to_ucol.cCopy a computed column of U to the compressed data structure and drop some small entries
    SRC/ilu_ddrop_row.cDrop small rows from L
    SRC/ilu_dpanel_dfs.cPeforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column
    SRC/ilu_dpivotL.cPerforms numerical pivoting
    SRC/ilu_dsnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/ilu_heap_relax_snode.cIdentify the initial relaxed supernodes
    SRC/ilu_relax_snode.cIdentify initial relaxed supernodes
    SRC/ilu_scolumn_dfs.cPerforms a symbolic factorization
    SRC/ilu_scopy_to_ucol.cCopy a computed column of U to the compressed data structure and drop some small entries
    SRC/ilu_sdrop_row.cDrop small rows from L
    SRC/ilu_spanel_dfs.cPeforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column
    SRC/ilu_spivotL.cPerforms numerical pivoting
    SRC/ilu_ssnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/ilu_zcolumn_dfs.cPerforms a symbolic factorization
    SRC/ilu_zcopy_to_ucol.cCopy a computed column of U to the compressed data structure and drop some small entries
    SRC/ilu_zdrop_row.cDrop small rows from L
    SRC/ilu_zpanel_dfs.cPeforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column
    SRC/ilu_zpivotL.cPerforms numerical pivoting
    SRC/ilu_zsnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/izmax1.cFinds the index of the element whose real part has maximum absolute value
    SRC/lsame.cCheck if CA is the same letter as CB regardless of case
    SRC/mark_relax.cRecord the rows pivoted by the relaxed supernodes
    SRC/mc21.f
    SRC/mc64ad.c
    SRC/memory.cPrecision-independent memory-related routines
    SRC/mmd.c
    SRC/qselect.cQuickselect: returns the k-th (zero-based) largest value in A[]
    SRC/relax_snode.cIdentify initial relaxed supernodes
    SRC/scolumn_bmod.cPerforms numeric block updates
    SRC/scolumn_dfs.cPerforms a symbolic factorization
    SRC/scomplex.cCommon arithmetic for complex type
    SRC/scopy_to_ucol.cCopy a computed column of U to the compressed data structure
    SRC/scsum1.cTakes sum of the absolute values of a complex vector and returns a single precision result
    SRC/sdiagonal.cAuxiliary routines to work with diagonal elements
    SRC/sgscon.cEstimates reciprocal of the condition number of a general matrix
    SRC/sgsequ.cComputes row and column scalings
    SRC/sgsisx.cComputes an approximate solutions of linear equations A*X=B or A'*X=B
    SRC/sgsitrf.c
    SRC/sgsrfs.cImproves computed solution to a system of inear equations
    SRC/sgssv.cSolves the system of linear equations A*X=B
    SRC/sgssvx.cSolves the system of linear equations A*X=B or A'*X=B
    SRC/sgstrf.cComputes an LU factorization of a general sparse matrix
    SRC/sgstrs.cSolves a system using LU factorization
    SRC/slacon.cEstimates the 1-norm
    SRC/slamch.cDetermines single precision machine parameters and other service routines
    SRC/slangs.cReturns the value of the one norm
    SRC/slaqgs.cEqulibrates a general sprase matrix
    SRC/sldperm.cFinds a row permutation so that the matrix has large entries on the diagonal
    SRC/slu_cdefs.h [code]Header file for real operations
    SRC/slu_Cnames.h [code]Macros defining how C routines will be called
    SRC/slu_dcomplex.h [code]Header file for complex operations
    SRC/slu_ddefs.h [code]Header file for real operations
    SRC/slu_scomplex.h [code]Header file for complex operations
    SRC/slu_sdefs.h [code]Header file for real operations
    SRC/slu_util.h [code]Utility header file
    SRC/slu_zdefs.h [code]Header file for real operations
    SRC/smemory.cMemory details
    SRC/smyblas2.cLevel 2 Blas operations
    SRC/sp_coletree.cTree layout and computation routines
    SRC/sp_ienv.c
    SRC/sp_preorder.cPermute and performs functions on columns of orginal matrix
    SRC/spanel_bmod.cPerforms numeric block updates
    SRC/spanel_dfs.cPeforms a symbolic factorization on a panel of symbols
    SRC/spivotgrowth.cComputes the reciprocal pivot growth factor
    SRC/spivotL.cPerforms numerical pivoting
    SRC/spruneL.cPrunes the L-structure
    SRC/sreadhb.cRead a matrix stored in Harwell-Boeing format
    SRC/sreadrb.cRead a matrix stored in Rutherford-Boeing format
    SRC/sreadtriple.c
    SRC/ssnode_bmod.cPerforms numeric block updates within the relaxed snode
    SRC/ssnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/ssp_blas2.cSparse BLAS 2, using some dense BLAS 2 operations
    SRC/ssp_blas3.cSparse BLAS3, using some dense BLAS3 operations
    SRC/superlu_enum_consts.h [code]Enum constants header file
    SRC/superlu_timer.cReturns the time used
    SRC/supermatrix.h [code]Defines matrix types
    SRC/sutil.cMatrix utility functions
    SRC/util.cUtility functions
    SRC/xerbla.c
    SRC/zcolumn_bmod.cPerforms numeric block updates
    SRC/zcolumn_dfs.cPerforms a symbolic factorization
    SRC/zcopy_to_ucol.cCopy a computed column of U to the compressed data structure
    SRC/zdiagonal.cAuxiliary routines to work with diagonal elements
    SRC/zgscon.cEstimates reciprocal of the condition number of a general matrix
    SRC/zgsequ.cComputes row and column scalings
    SRC/zgsisx.cComputes an approximate solutions of linear equations A*X=B or A'*X=B
    SRC/zgsitrf.c
    SRC/zgsrfs.cImproves computed solution to a system of inear equations
    SRC/zgssv.cSolves the system of linear equations A*X=B
    SRC/zgssvx.cSolves the system of linear equations A*X=B or A'*X=B
    SRC/zgstrf.cComputes an LU factorization of a general sparse matrix
    SRC/zgstrs.cSolves a system using LU factorization
    SRC/zlacon.cEstimates the 1-norm
    SRC/zlangs.cReturns the value of the one norm
    SRC/zlaqgs.cEqulibrates a general sprase matrix
    SRC/zldperm.cFinds a row permutation so that the matrix has large entries on the diagonal
    SRC/zmemory.cMemory details
    SRC/zmyblas2.cLevel 2 Blas operations
    SRC/zpanel_bmod.cPerforms numeric block updates
    SRC/zpanel_dfs.cPeforms a symbolic factorization on a panel of symbols
    SRC/zpivotgrowth.cComputes the reciprocal pivot growth factor
    SRC/zpivotL.cPerforms numerical pivoting
    SRC/zpruneL.cPrunes the L-structure
    SRC/zreadhb.cRead a matrix stored in Harwell-Boeing format
    SRC/zreadrb.cRead a matrix stored in Rutherford-Boeing format
    SRC/zreadtriple.c
    SRC/zsnode_bmod.cPerforms numeric block updates within the relaxed snode
    SRC/zsnode_dfs.cDetermines the union of row structures of columns within the relaxed node
    SRC/zsp_blas2.cSparse BLAS 2, using some dense BLAS 2 operations
    SRC/zsp_blas3.cSparse BLAS3, using some dense BLAS3 operations
    SRC/zutil.cMatrix utility functions
    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/functions.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/functions.html new file mode 100644 index 0000000..bbf9e4f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/functions.html @@ -0,0 +1,324 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all struct and union fields with links to the structures/unions they belong to: +

    +

    - a -

    +

    - c -

    +

    - d -

    +

    - e -

    +

    - f -

    +

    - h -

    +

    - i -

    +

    - l -

    +

    - m -

    +

    - n -

    +

    - o -

    +

    - p -

    +

    - r -

    +

    - s -

    +

    - t -

    +

    - u -

    +

    - x -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/functions_vars.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/functions_vars.html new file mode 100644 index 0000000..a47eba1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/functions_vars.html @@ -0,0 +1,324 @@ + + +SuperLU: Data Fields - Variables + + + + + +
    +  +

    +

    - a -

    +

    - c -

    +

    - d -

    +

    - e -

    +

    - f -

    +

    - h -

    +

    - i -

    +

    - l -

    +

    - m -

    +

    - n -

    +

    - o -

    +

    - p -

    +

    - r -

    +

    - s -

    +

    - t -

    +

    - u -

    +

    - x -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/get__perm__c_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/get__perm__c_8c.html new file mode 100644 index 0000000..df921a1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/get__perm__c_8c.html @@ -0,0 +1,395 @@ + + +SuperLU: SRC/get_perm_c.c File Reference + + + + + +
    +

    SRC/get_perm_c.c File Reference

    Matrix permutation operations. More... +

    +#include "slu_ddefs.h"
    +#include "colamd.h"
    + + + + + + + + + + + + + +

    Functions

    int genmmd_ (int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *)
    void get_colamd (const int m, const int n, const int nnz, int *colptr, int *rowind, int *perm_c)
    void getata (const int m, const int n, const int nz, int *colptr, int *rowind, int *atanz, int **ata_colptr, int **ata_rowind)
    void at_plus_a (const int n, const int nz, int *colptr, int *rowind, int *bnz, int **b_colptr, int **b_rowind)
    void get_perm_c (int ispec, SuperMatrix *A, int *perm_c)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void at_plus_a (const int  n,
    const int  nz,
    int *  colptr,
    int *  rowind,
    int *  bnz,
    int **  b_colptr,
    int **  b_rowind 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Form the structure of A'+A. A is an n-by-n matrix in column oriented
    + format represented by (colptr, rowind). The output A'+A is in column
    + oriented format (symmetrically, also row oriented), represented by
    + (b_colptr, b_rowind).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int genmmd_ (int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void get_colamd (const int  m,
    const int  n,
    const int  nnz,
    int *  colptr,
    int *  rowind,
    int *  perm_c 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void get_perm_c (int  ispec,
    SuperMatrix A,
    int *  perm_c 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     GET_PERM_C obtains a permutation matrix Pc, by applying the multiple
    + minimum degree ordering code by Joseph Liu to matrix A'*A or A+A'.
    + or using approximate minimum degree column ordering by Davis et. al.
    + The LU factorization of A*Pc tends to have less fill than the LU 
    + factorization of A.

    +

     Arguments
    + =========

    +

     ispec   (input) int
    +         Specifies the type of column ordering to reduce fill:
    +         = 1: minimum degree on the structure of A^T * A
    +         = 2: minimum degree on the structure of A^T + A
    +         = 3: approximate minimum degree for unsymmetric matrices
    +         If ispec == 0, the natural ordering (i.e., Pc = I) is returned.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A 
    +         can be: Stype = NC; Dtype = _D; Mtype = GE. In the future,
    +         more general A can be handled.

    +

     perm_c  (output) int*
    +	   Column permutation vector of size A->ncol, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void getata (const int  m,
    const int  n,
    const int  nz,
    int *  colptr,
    int *  rowind,
    int *  atanz,
    int **  ata_colptr,
    int **  ata_rowind 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Form the structure of A'*A. A is an m-by-n matrix in column oriented
    + format represented by (colptr, rowind). The output A'*A is in column
    + oriented format (symmetrically, also row oriented), represented by
    + (ata_colptr, ata_rowind).

    +

     This routine is modified from GETATA routine by Tim Davis.
    + The complexity of this algorithm is: SUM_{i=1,m} r(i)^2,
    + i.e., the sum of the square of the row counts.

    +

     Questions
    + =========
    +     o  Do I need to withhold the *dense* rows?
    +     o  How do I know the number of nonzeros in A'*A?
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals.html new file mode 100644 index 0000000..933c57a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals.html @@ -0,0 +1,78 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - _ -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x61.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x61.html new file mode 100644 index 0000000..516749e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x61.html @@ -0,0 +1,94 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - a -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x62.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x62.html new file mode 100644 index 0000000..825d1df --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x62.html @@ -0,0 +1,75 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - b -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x63.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x63.html new file mode 100644 index 0000000..3e2b508 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x63.html @@ -0,0 +1,455 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - c -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x64.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x64.html new file mode 100644 index 0000000..8cea2c3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x64.html @@ -0,0 +1,418 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - d -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x65.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x65.html new file mode 100644 index 0000000..9bbd9a6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x65.html @@ -0,0 +1,92 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - e -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x66.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x66.html new file mode 100644 index 0000000..0670046 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x66.html @@ -0,0 +1,117 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - f -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x67.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x67.html new file mode 100644 index 0000000..8d365f7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x67.html @@ -0,0 +1,119 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - g -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x68.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x68.html new file mode 100644 index 0000000..468958c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x68.html @@ -0,0 +1,78 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - h -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x69.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x69.html new file mode 100644 index 0000000..12ed3f2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x69.html @@ -0,0 +1,218 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - i -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6b.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6b.html new file mode 100644 index 0000000..7dc656e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6b.html @@ -0,0 +1,79 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - k -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6c.html new file mode 100644 index 0000000..9d2ed10 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6c.html @@ -0,0 +1,102 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - l -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6d.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6d.html new file mode 100644 index 0000000..a1ea542 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6d.html @@ -0,0 +1,176 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - m -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6e.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6e.html new file mode 100644 index 0000000..229358b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6e.html @@ -0,0 +1,108 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - n -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6f.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6f.html new file mode 100644 index 0000000..55a902b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x6f.html @@ -0,0 +1,81 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - o -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x70.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x70.html new file mode 100644 index 0000000..636b5a3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x70.html @@ -0,0 +1,132 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - p -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x72.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x72.html new file mode 100644 index 0000000..6765440 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x72.html @@ -0,0 +1,117 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - r -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x73.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x73.html new file mode 100644 index 0000000..46b1f91 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x73.html @@ -0,0 +1,499 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - s -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x74.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x74.html new file mode 100644 index 0000000..e89efaa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x74.html @@ -0,0 +1,107 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - t -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x75.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x75.html new file mode 100644 index 0000000..a3e3a4b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x75.html @@ -0,0 +1,99 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - u -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x78.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x78.html new file mode 100644 index 0000000..32e7b05 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x78.html @@ -0,0 +1,76 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - x -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x79.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x79.html new file mode 100644 index 0000000..e2c8066 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x79.html @@ -0,0 +1,77 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - y -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x7a.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x7a.html new file mode 100644 index 0000000..4628bf8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_0x7a.html @@ -0,0 +1,321 @@ + + +SuperLU: Data Fields + + + + + +
    +Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: +

    +

    - z -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_defs.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_defs.html new file mode 100644 index 0000000..29dd966 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_defs.html @@ -0,0 +1,395 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - a -

    +

    - c -

    +

    - d -

    +

    - e -

    +

    - f -

    +

    - g -

    +

    - i -

    +

    - k -

    +

    - l -

    +

    - m -

    +

    - n -

    +

    - o -

    +

    - p -

    +

    - r -

    +

    - s -

    +

    - t -

    +

    - u -

    +

    - z -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_enum.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_enum.html new file mode 100644 index 0000000..54a60a8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_enum.html @@ -0,0 +1,76 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_eval.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_eval.html new file mode 100644 index 0000000..afc14c1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_eval.html @@ -0,0 +1,273 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - b -

    +

    - c -

    +

    - d -

    +

    - e -

    +

    - f -

    +

    - g -

    +

    - h -

    +

    - i -

    +

    - l -

    +

    - m -

    +

    - n -

    +

    - o -

    +

    - p -

    +

    - r -

    +

    - s -

    +

    - t -

    +

    - u -

    +

    - y -

    +

    - z -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func.html new file mode 100644 index 0000000..b6f97ef --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func.html @@ -0,0 +1,75 @@ + + +SuperLU: Data Fields + + + + + + +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x61.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x61.html new file mode 100644 index 0000000..671b87c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x61.html @@ -0,0 +1,72 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - a -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x63.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x63.html new file mode 100644 index 0000000..48878e9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x63.html @@ -0,0 +1,353 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - c -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x64.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x64.html new file mode 100644 index 0000000..52ac70a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x64.html @@ -0,0 +1,365 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - d -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x65.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x65.html new file mode 100644 index 0000000..952be32 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x65.html @@ -0,0 +1,72 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - e -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x66.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x66.html new file mode 100644 index 0000000..3d23289 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x66.html @@ -0,0 +1,92 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - f -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x67.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x67.html new file mode 100644 index 0000000..13558d9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x67.html @@ -0,0 +1,82 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - g -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x68.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x68.html new file mode 100644 index 0000000..7b841bb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x68.html @@ -0,0 +1,73 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - h -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x69.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x69.html new file mode 100644 index 0000000..85ad3e1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x69.html @@ -0,0 +1,196 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - i -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6c.html new file mode 100644 index 0000000..b602a41 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6c.html @@ -0,0 +1,79 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - l -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6d.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6d.html new file mode 100644 index 0000000..693d7d9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6d.html @@ -0,0 +1,141 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - m -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6e.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6e.html new file mode 100644 index 0000000..1d5ff1a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6e.html @@ -0,0 +1,72 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - n -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6f.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6f.html new file mode 100644 index 0000000..a554856 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x6f.html @@ -0,0 +1,72 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - o -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x70.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x70.html new file mode 100644 index 0000000..ccf332d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x70.html @@ -0,0 +1,119 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - p -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x72.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x72.html new file mode 100644 index 0000000..a0303fa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x72.html @@ -0,0 +1,91 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - r -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x73.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x73.html new file mode 100644 index 0000000..605581f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x73.html @@ -0,0 +1,407 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - s -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x74.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x74.html new file mode 100644 index 0000000..38c1ef4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x74.html @@ -0,0 +1,73 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - t -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x75.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x75.html new file mode 100644 index 0000000..31bf708 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x75.html @@ -0,0 +1,76 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - u -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x78.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x78.html new file mode 100644 index 0000000..7f91a35 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x78.html @@ -0,0 +1,73 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - x -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x7a.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x7a.html new file mode 100644 index 0000000..904a9aa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_func_0x7a.html @@ -0,0 +1,304 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - z -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_type.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_type.html new file mode 100644 index 0000000..98f4e17 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_type.html @@ -0,0 +1,61 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_vars.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_vars.html new file mode 100644 index 0000000..baeafb1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/globals_vars.html @@ -0,0 +1,101 @@ + + +SuperLU: Data Fields + + + + + +
    +  +

    +

    - a -

    +

    - c -

    +

    - g -

    +

    - m -

    +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/heap__relax__snode_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/heap__relax__snode_8c.html new file mode 100644 index 0000000..f06ceec --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/heap__relax__snode_8c.html @@ -0,0 +1,99 @@ + + +SuperLU: SRC/heap_relax_snode.c File Reference + + + + + +
    +

    SRC/heap_relax_snode.c File Reference

    Identify the initial relaxed supernodes. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void heap_relax_snode (const int n, int *et, const int relax_columns, int *descendants, int *relax_end)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void heap_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    +    the matrix has been reordered according to the postorder of the etree.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h-source.html new file mode 100644 index 0000000..6d9f765 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h-source.html @@ -0,0 +1,22 @@ + + +SuperLU: SRC/html_mainpage.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h.html new file mode 100644 index 0000000..6baf914 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/html__mainpage_8h.html @@ -0,0 +1,28 @@ + + +SuperLU: SRC/html_mainpage.h File Reference + + + + + +
    +

    SRC/html_mainpage.h File Reference

    +

    +Go to the source code of this file. + +
    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/icmax1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/icmax1_8c.html new file mode 100644 index 0000000..292612e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/icmax1_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/icmax1.c File Reference + + + + + +
    +

    SRC/icmax1.c File Reference

    Finds the index of the element whose real part has maximum absolute value. More... +

    +#include <math.h>
    +#include "slu_scomplex.h"
    +#include "slu_Cnames.h"
    + + + + + + + + +

    Defines

    #define CX(I)   cx[(I)-1]

    Functions

    int icmax1_ (int *n, complex *cx, int *incx)
    +


    Detailed Description

    +
    +     -- LAPACK auxiliary routine (version 2.0) --   
    +     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +     Courant Institute, Argonne National Lab, and Rice University   
    +     October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define CX (  )    cx[(I)-1]
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int icmax1_ (int *  n,
    complex cx,
    int *  incx 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        ICMAX1 finds the index of the element whose real part has maximum   
    +    absolute value.

    +

        Based on ICAMAX from Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.

    +

        Contributed by Nick Higham for use with CLACON.

    +

        Arguments   
    +    =========

    +

        N       (input) INT   
    +            The number of elements in the vector CX.

    +

        CX      (input) COMPLEX array, dimension (N)   
    +            The vector whose elements will be summed.

    +

        INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX >= 1.

    +

       ===================================================================== 
    +  
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccolumn__dfs_8c.html new file mode 100644 index 0000000..d4e645a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccolumn__dfs_8c.html @@ -0,0 +1,147 @@ + + +SuperLU: SRC/ilu_ccolumn_dfs.c File Reference + + + + + +
    +

    SRC/ilu_ccolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int ilu_ccolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ccolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccopy__to__ucol_8c.html new file mode 100644 index 0000000..72c5295 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ccopy__to__ucol_8c.html @@ -0,0 +1,188 @@ + + +SuperLU: SRC/ilu_ccopy_to_ucol.c File Reference + + + + + +
    +

    SRC/ilu_ccopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure and drop some small entries. More... +

    +#include "slu_cdefs.h"
    + + + + + + + +

    Functions

    void ccopy_ (int *, complex[], int *, complex[], int *)
    int ilu_ccopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, complex *dense, int drop_rule, milu_t milu, double drop_tol, int quota, complex *sum, int *nnzUj, GlobalLU_t *Glu, float *work)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ccopy_ (int * ,
    complex [],
    int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ccopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    complex dense,
    int  drop_rule,
    milu_t  milu,
    double  drop_tol,
    int  quota,
    complex sum,
    int *  nnzUj,
    GlobalLU_t Glu,
    float *  work 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cdrop__row_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cdrop__row_8c.html new file mode 100644 index 0000000..b10aecd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cdrop__row_8c.html @@ -0,0 +1,479 @@ + + +SuperLU: SRC/ilu_cdrop_row.c File Reference + + + + + +
    +

    SRC/ilu_cdrop_row.c File Reference

    Drop small rows from L. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void cswap_ (int *, complex[], int *, complex[], int *)
    void caxpy_ (int *, complex *, complex[], int *, complex[], int *)
    void ccopy_ (int *, complex[], int *, complex[], int *)
    float scasum_ (int *, complex *, int *)
    float scnrm2_ (int *, complex *, int *)
    double dnrm2_ (int *, double[], int *)
    int icamax_ (int *, complex[], int *)
    static int _compare_ (const void *a, const void *b)
    int ilu_cdrop_row (superlu_options_t *options, int first, int last, double drop_tol, int quota, int *nnzLj, double *fill_tol, GlobalLU_t *Glu, float swork[], float swork2[], int lastc)

    Variables

    static float * A
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    static int _compare_ (const void *  a,
    const void *  b 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void caxpy_ (int * ,
    complex,
    complex [],
    int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ccopy_ (int * ,
    complex [],
    int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cswap_ (int * ,
    complex [],
    int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int icamax_ (int * ,
    complex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cdrop_row (superlu_options_t options,
    int  first,
    int  last,
    double  drop_tol,
    int  quota,
    int *  nnzLj,
    double *  fill_tol,
    GlobalLU_t Glu,
    float  swork[],
    float  swork2[],
    int  lastc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_cdrop_row() - Drop some small rows from the previous 
    +    supernode (L-part only).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float scasum_ (int * ,
    complex,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float scnrm2_ (int * ,
    complex,
    int *  
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    float* A [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpanel__dfs_8c.html new file mode 100644 index 0000000..e4f028d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpanel__dfs_8c.html @@ -0,0 +1,166 @@ + + +SuperLU: SRC/ilu_cpanel_dfs.c File Reference + + + + + +
    +

    SRC/ilu_cpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    void ilu_cpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, complex *dense, float *amax, int *panel_lsub, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_cpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    complex dense,
    float *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpivotL_8c.html new file mode 100644 index 0000000..1901ae7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__cpivotL_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/ilu_cpivotL.c File Reference + + + + + +
    +

    SRC/ilu_cpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_cdefs.h"
    + + + + + + + + +

    Defines

    #define SGN(x)   ((x)>=0?1:-1)

    Functions

    int ilu_cpivotL (const int jcol, const double u, int *usepr, int *perm_r, int diagind, int *swap, int *iswap, int *marker, int *pivrow, double fill_tol, milu_t milu, complex drop_sum, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define SGN (  )    ((x)>=0?1:-1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    complex  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__csnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__csnode__dfs_8c.html new file mode 100644 index 0000000..d32adec --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__csnode__dfs_8c.html @@ -0,0 +1,108 @@ + + +SuperLU: SRC/ilu_csnode_dfs.c File Reference + + + + + +
    +

    SRC/ilu_csnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_cdefs.h"
    + + + + + +

    Functions

    int ilu_csnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_csnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_csnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcolumn__dfs_8c.html new file mode 100644 index 0000000..f311c76 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcolumn__dfs_8c.html @@ -0,0 +1,147 @@ + + +SuperLU: SRC/ilu_dcolumn_dfs.c File Reference + + + + + +
    +

    SRC/ilu_dcolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int ilu_dcolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcopy__to__ucol_8c.html new file mode 100644 index 0000000..4f3bd10 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dcopy__to__ucol_8c.html @@ -0,0 +1,188 @@ + + +SuperLU: SRC/ilu_dcopy_to_ucol.c File Reference + + + + + +
    +

    SRC/ilu_dcopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure and drop some small entries. More... +

    +#include "slu_ddefs.h"
    + + + + + + + +

    Functions

    void dcopy_ (int *, double[], int *, double[], int *)
    int ilu_dcopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, double *dense, int drop_rule, milu_t milu, double drop_tol, int quota, double *sum, int *nnzUj, GlobalLU_t *Glu, double *work)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dcopy_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dcopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    double *  dense,
    int  drop_rule,
    milu_t  milu,
    double  drop_tol,
    int  quota,
    double *  sum,
    int *  nnzUj,
    GlobalLU_t Glu,
    double *  work 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ddrop__row_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ddrop__row_8c.html new file mode 100644 index 0000000..0437544 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ddrop__row_8c.html @@ -0,0 +1,479 @@ + + +SuperLU: SRC/ilu_ddrop_row.c File Reference + + + + + +
    +

    SRC/ilu_ddrop_row.c File Reference

    Drop small rows from L. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void dswap_ (int *, double[], int *, double[], int *)
    void daxpy_ (int *, double *, double[], int *, double[], int *)
    void dcopy_ (int *, double[], int *, double[], int *)
    double dasum_ (int *, double *, int *)
    double dnrm2_ (int *, double *, int *)
    double dnrm2_ (int *, double[], int *)
    int idamax_ (int *, double[], int *)
    static int _compare_ (const void *a, const void *b)
    int ilu_ddrop_row (superlu_options_t *options, int first, int last, double drop_tol, int quota, int *nnzLj, double *fill_tol, GlobalLU_t *Glu, double dwork[], double dwork2[], int lastc)

    Variables

    static double * A
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    static int _compare_ (const void *  a,
    const void *  b 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dasum_ (int * ,
    double * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void daxpy_ (int * ,
    double * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dcopy_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dswap_ (int * ,
    double [],
    int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int idamax_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ddrop_row (superlu_options_t options,
    int  first,
    int  last,
    double  drop_tol,
    int  quota,
    int *  nnzLj,
    double *  fill_tol,
    GlobalLU_t Glu,
    double  dwork[],
    double  dwork2[],
    int  lastc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_ddrop_row() - Drop some small rows from the previous 
    +    supernode (L-part only).
    + 
    +
    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    double* A [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpanel__dfs_8c.html new file mode 100644 index 0000000..70029c3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpanel__dfs_8c.html @@ -0,0 +1,166 @@ + + +SuperLU: SRC/ilu_dpanel_dfs.c File Reference + + + + + +
    +

    SRC/ilu_dpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void ilu_dpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, double *dense, double *amax, int *panel_lsub, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_dpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    double *  dense,
    double *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpivotL_8c.html new file mode 100644 index 0000000..3936f73 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dpivotL_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/ilu_dpivotL.c File Reference + + + + + +
    +

    SRC/ilu_dpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + +

    Defines

    #define SGN(x)   ((x)>=0?1:-1)

    Functions

    int ilu_dpivotL (const int jcol, const double u, int *usepr, int *perm_r, int diagind, int *swap, int *iswap, int *marker, int *pivrow, double fill_tol, milu_t milu, double drop_sum, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define SGN (  )    ((x)>=0?1:-1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    double  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dsnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dsnode__dfs_8c.html new file mode 100644 index 0000000..b5da861 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__dsnode__dfs_8c.html @@ -0,0 +1,108 @@ + + +SuperLU: SRC/ilu_dsnode_dfs.c File Reference + + + + + +
    +

    SRC/ilu_dsnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int ilu_dsnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_dsnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__heap__relax__snode_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__heap__relax__snode_8c.html new file mode 100644 index 0000000..e7931fe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__heap__relax__snode_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/ilu_heap_relax_snode.c File Reference + + + + + +
    +

    SRC/ilu_heap_relax_snode.c File Reference

    Identify the initial relaxed supernodes. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void ilu_heap_relax_snode (const int n, int *et, const int relax_columns, int *descendants, int *relax_end, int *relax_fsupc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 1, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_heap_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end,
    int *  relax_fsupc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_heap_relax_snode() - Identify the initial relaxed supernodes,
    +    assuming that the matrix has been reordered according to the postorder
    +    of the etree.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__relax__snode_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__relax__snode_8c.html new file mode 100644 index 0000000..4be0993 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__relax__snode_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/ilu_relax_snode.c File Reference + + + + + +
    +

    SRC/ilu_relax_snode.c File Reference

    Identify initial relaxed supernodes. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void ilu_relax_snode (const int n, int *et, const int relax_columns, int *descendants, int *relax_end, int *relax_fsupc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 1, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end,
    int *  relax_fsupc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_relax_snode() - Identify the initial relaxed supernodes, assuming
    +    that the matrix has been reordered according to the postorder of the
    +    etree.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scolumn__dfs_8c.html new file mode 100644 index 0000000..c707064 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scolumn__dfs_8c.html @@ -0,0 +1,147 @@ + + +SuperLU: SRC/ilu_scolumn_dfs.c File Reference + + + + + +
    +

    SRC/ilu_scolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int ilu_scolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_scolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scopy__to__ucol_8c.html new file mode 100644 index 0000000..0f16d04 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__scopy__to__ucol_8c.html @@ -0,0 +1,188 @@ + + +SuperLU: SRC/ilu_scopy_to_ucol.c File Reference + + + + + +
    +

    SRC/ilu_scopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure and drop some small entries. More... +

    +#include "slu_sdefs.h"
    + + + + + + + +

    Functions

    void scopy_ (int *, float[], int *, float[], int *)
    int ilu_scopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, float *dense, int drop_rule, milu_t milu, double drop_tol, int quota, float *sum, int *nnzUj, GlobalLU_t *Glu, float *work)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_scopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    float *  dense,
    int  drop_rule,
    milu_t  milu,
    double  drop_tol,
    int  quota,
    float *  sum,
    int *  nnzUj,
    GlobalLU_t Glu,
    float *  work 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void scopy_ (int * ,
    float [],
    int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__sdrop__row_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__sdrop__row_8c.html new file mode 100644 index 0000000..90aa8b9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__sdrop__row_8c.html @@ -0,0 +1,479 @@ + + +SuperLU: SRC/ilu_sdrop_row.c File Reference + + + + + +
    +

    SRC/ilu_sdrop_row.c File Reference

    Drop small rows from L. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void sswap_ (int *, float[], int *, float[], int *)
    void saxpy_ (int *, float *, float[], int *, float[], int *)
    void scopy_ (int *, float[], int *, float[], int *)
    float sasum_ (int *, float *, int *)
    float snrm2_ (int *, float *, int *)
    double dnrm2_ (int *, double[], int *)
    int isamax_ (int *, float[], int *)
    static int _compare_ (const void *a, const void *b)
    int ilu_sdrop_row (superlu_options_t *options, int first, int last, double drop_tol, int quota, int *nnzLj, double *fill_tol, GlobalLU_t *Glu, float swork[], float swork2[], int lastc)

    Variables

    static float * A
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    static int _compare_ (const void *  a,
    const void *  b 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_sdrop_row (superlu_options_t options,
    int  first,
    int  last,
    double  drop_tol,
    int  quota,
    int *  nnzLj,
    double *  fill_tol,
    GlobalLU_t Glu,
    float  swork[],
    float  swork2[],
    int  lastc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_sdrop_row() - Drop some small rows from the previous 
    +    supernode (L-part only).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int isamax_ (int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float sasum_ (int * ,
    float * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void saxpy_ (int * ,
    float * ,
    float [],
    int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void scopy_ (int * ,
    float [],
    int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float snrm2_ (int * ,
    float * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sswap_ (int * ,
    float [],
    int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    float* A [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spanel__dfs_8c.html new file mode 100644 index 0000000..a339d7b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spanel__dfs_8c.html @@ -0,0 +1,166 @@ + + +SuperLU: SRC/ilu_spanel_dfs.c File Reference + + + + + +
    +

    SRC/ilu_spanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void ilu_spanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, float *dense, float *amax, int *panel_lsub, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_spanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    float *  dense,
    float *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spivotL_8c.html new file mode 100644 index 0000000..18ca7a5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__spivotL_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/ilu_spivotL.c File Reference + + + + + +
    +

    SRC/ilu_spivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + + + + +

    Defines

    #define SGN(x)   ((x)>=0?1:-1)

    Functions

    int ilu_spivotL (const int jcol, const double u, int *usepr, int *perm_r, int diagind, int *swap, int *iswap, int *marker, int *pivrow, double fill_tol, milu_t milu, float drop_sum, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define SGN (  )    ((x)>=0?1:-1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_spivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    float  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ssnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ssnode__dfs_8c.html new file mode 100644 index 0000000..585888b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__ssnode__dfs_8c.html @@ -0,0 +1,108 @@ + + +SuperLU: SRC/ilu_ssnode_dfs.c File Reference + + + + + +
    +

    SRC/ilu_ssnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int ilu_ssnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ssnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_ssnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcolumn__dfs_8c.html new file mode 100644 index 0000000..5bd7585 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcolumn__dfs_8c.html @@ -0,0 +1,147 @@ + + +SuperLU: SRC/ilu_zcolumn_dfs.c File Reference + + + + + +
    +

    SRC/ilu_zcolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int ilu_zcolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcopy__to__ucol_8c.html new file mode 100644 index 0000000..a191b95 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zcopy__to__ucol_8c.html @@ -0,0 +1,188 @@ + + +SuperLU: SRC/ilu_zcopy_to_ucol.c File Reference + + + + + +
    +

    SRC/ilu_zcopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure and drop some small entries. More... +

    +#include "slu_zdefs.h"
    + + + + + + + +

    Functions

    void zcopy_ (int *, doublecomplex[], int *, doublecomplex[], int *)
    int ilu_zcopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, doublecomplex *dense, int drop_rule, milu_t milu, double drop_tol, int quota, doublecomplex *sum, int *nnzUj, GlobalLU_t *Glu, double *work)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zcopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    doublecomplex dense,
    int  drop_rule,
    milu_t  milu,
    double  drop_tol,
    int  quota,
    doublecomplex sum,
    int *  nnzUj,
    GlobalLU_t Glu,
    double *  work 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zcopy_ (int * ,
    doublecomplex [],
    int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zdrop__row_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zdrop__row_8c.html new file mode 100644 index 0000000..6e5e00a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zdrop__row_8c.html @@ -0,0 +1,479 @@ + + +SuperLU: SRC/ilu_zdrop_row.c File Reference + + + + + +
    +

    SRC/ilu_zdrop_row.c File Reference

    Drop small rows from L. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void zswap_ (int *, doublecomplex[], int *, doublecomplex[], int *)
    void zaxpy_ (int *, doublecomplex *, doublecomplex[], int *, doublecomplex[], int *)
    void zcopy_ (int *, doublecomplex[], int *, doublecomplex[], int *)
    double dzasum_ (int *, doublecomplex *, int *)
    double dznrm2_ (int *, doublecomplex *, int *)
    double dnrm2_ (int *, double[], int *)
    int izamax_ (int *, doublecomplex[], int *)
    static int _compare_ (const void *a, const void *b)
    int ilu_zdrop_row (superlu_options_t *options, int first, int last, double drop_tol, int quota, int *nnzLj, double *fill_tol, GlobalLU_t *Glu, double dwork[], double dwork2[], int lastc)

    Variables

    static double * A
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    static int _compare_ (const void *  a,
    const void *  b 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dnrm2_ (int * ,
    double [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dzasum_ (int * ,
    doublecomplex,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dznrm2_ (int * ,
    doublecomplex,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zdrop_row (superlu_options_t options,
    int  first,
    int  last,
    double  drop_tol,
    int  quota,
    int *  nnzLj,
    double *  fill_tol,
    GlobalLU_t Glu,
    double  dwork[],
    double  dwork2[],
    int  lastc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_zdrop_row() - Drop some small rows from the previous 
    +    supernode (L-part only).
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int izamax_ (int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zaxpy_ (int * ,
    doublecomplex,
    doublecomplex [],
    int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zcopy_ (int * ,
    doublecomplex [],
    int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zswap_ (int * ,
    doublecomplex [],
    int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    double* A [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpanel__dfs_8c.html new file mode 100644 index 0000000..6e57386 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpanel__dfs_8c.html @@ -0,0 +1,166 @@ + + +SuperLU: SRC/ilu_zpanel_dfs.c File Reference + + + + + +
    +

    SRC/ilu_zpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols and record the entries with maximum absolute value in each column. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void ilu_zpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, doublecomplex *dense, double *amax, int *panel_lsub, int *segrep, int *repfnz, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_zpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    doublecomplex dense,
    double *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpivotL_8c.html new file mode 100644 index 0000000..ae9c38d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zpivotL_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/ilu_zpivotL.c File Reference + + + + + +
    +

    SRC/ilu_zpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + + + + +

    Defines

    #define SGN(x)   ((x)>=0?1:-1)

    Functions

    int ilu_zpivotL (const int jcol, const double u, int *usepr, int *perm_r, int diagind, int *swap, int *iswap, int *marker, int *pivrow, double fill_tol, milu_t milu, doublecomplex drop_sum, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define SGN (  )    ((x)>=0?1:-1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    doublecomplex  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zsnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zsnode__dfs_8c.html new file mode 100644 index 0000000..85f13fd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ilu__zsnode__dfs_8c.html @@ -0,0 +1,108 @@ + + +SuperLU: SRC/ilu_zsnode_dfs.c File Reference + + + + + +
    +

    SRC/ilu_zsnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int ilu_zsnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_zsnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/index.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/index.html new file mode 100644 index 0000000..fef70f3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/index.html @@ -0,0 +1,26 @@ + + +SuperLU: SuperLU Documentation + + + + + +
    +

    SuperLU Documentation

    +

    +

    4.1

    SuperLU is a general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations on high performance machines. The library is written in C and is callable from either C or Fortran. The library routines perform an LU decomposition with partial pivoting and triangular system solves through forward and back substitution. The library also provides threshold-based ILU factorization preconditioners.

    +The factorization routines can handle non-square matrices but the triangular solves are performed only for square matrices. The matrix columns may be preordered (before factorization) either through library or user supplied routines. This preordering for sparsity is completely separate from the factorization. Working precision iterative refinement subroutines are provided for improved backward stability. Routines are also provided to equilibrate the system, estimate the condition number, calculate the relative backward error, and estimate error bounds for the refined solutions.

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/izmax1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/izmax1_8c.html new file mode 100644 index 0000000..4fced9e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/izmax1_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/izmax1.c File Reference + + + + + +
    +

    SRC/izmax1.c File Reference

    Finds the index of the element whose real part has maximum absolute value. More... +

    +#include <math.h>
    +#include "slu_dcomplex.h"
    +#include "slu_Cnames.h"
    + + + + + + + + +

    Defines

    #define CX(I)   cx[(I)-1]

    Functions

    int izmax1_ (int *n, doublecomplex *cx, int *incx)
    +


    Detailed Description

    +
    +     -- LAPACK auxiliary routine (version 2.0) --   
    +     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +     Courant Institute, Argonne National Lab, and Rice University   
    +     October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define CX (  )    cx[(I)-1]
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int izmax1_ (int *  n,
    doublecomplex cx,
    int *  incx 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        IZMAX1 finds the index of the element whose real part has maximum   
    +    absolute value.

    +

        Based on IZAMAX from Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.

    +

        Contributed by Nick Higham for use with ZLACON.

    +

        Arguments   
    +    =========

    +

        N       (input) INT   
    +            The number of elements in the vector CX.

    +

        CX      (input) COMPLEX*16 array, dimension (N)   
    +            The vector whose elements will be summed.

    +

        INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX >= 1.

    +

       ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/lsame_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/lsame_8c.html new file mode 100644 index 0000000..530f111 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/lsame_8c.html @@ -0,0 +1,78 @@ + + +SuperLU: SRC/lsame.c File Reference + + + + + +
    +

    SRC/lsame.c File Reference

    Check if CA is the same letter as CB regardless of case. More... +

    +#include "slu_Cnames.h"
    + + + + + +

    Functions

    int lsame_ (char *ca, char *cb)
    +


    Detailed Description

    +
    + -- LAPACK auxiliary routine (version 2.0) --   
    +      Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +      Courant Institute, Argonne National Lab, and Rice University   
    +      September 30, 1994   
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int lsame_ (char *  ca,
    char *  cb 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        LSAME returns .TRUE. if CA is the same letter as CB regardless of case.

    +

        Arguments   
    +    =========

    +

        CA      (input) CHARACTER*1   
    +    CB      (input) CHARACTER*1   
    +            CA and CB specify the single characters to be compared.

    +

       ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/mark__relax_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/mark__relax_8c.html new file mode 100644 index 0000000..ce63099 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/mark__relax_8c.html @@ -0,0 +1,103 @@ + + +SuperLU: SRC/mark_relax.c File Reference + + + + + +
    +

    SRC/mark_relax.c File Reference

    Record the rows pivoted by the relaxed supernodes. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    int mark_relax (int n, int *relax_end, int *relax_fsupc, int *xa_begin, int *xa_end, int *asub, int *marker)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 1, 2009
    + <
    Precondition:
    > +
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mark_relax (int  n,
    int *  relax_end,
    int *  relax_fsupc,
    int *  xa_begin,
    int *  xa_end,
    int *  asub,
    int *  marker 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    mark_relax() - record the rows used by the relaxed supernodes.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/mc21_8f.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc21_8f.html new file mode 100644 index 0000000..181a743 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc21_8f.html @@ -0,0 +1,26 @@ + + +SuperLU: SRC/mc21.f File Reference + + + + + +
    +

    SRC/mc21.f File Reference

    + +
    +
    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8c.html new file mode 100644 index 0000000..560b5f1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8c.html @@ -0,0 +1,932 @@ + + +SuperLU: SRC/mc64ad.c File Reference + + + + + +
    +

    SRC/mc64ad.c File Reference

    #include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define abs(a)   ((a) > 0) ? (a) : -(a)
    #define min(a, b)   ((a) < (b)) ? (a) : (b)

    Functions

    int_t mc64id_ (int_t *icntl)
    int_t mc64ad_ (int_t *job, int_t *n, int_t *ne, int_t *ip, int_t *irn, double *a, int_t *num, int_t *cperm, int_t *liw, int_t *iw, int_t *ldw, double *dw, int_t *icntl, int_t *info)
    int_t mc64bd_ (int_t *n, int_t *ne, int_t *ip, int_t *irn, double *a, int_t *iperm, int_t *num, int_t *jperm, int_t *pr, int_t *q, int_t *l, double *d__)
    int_t mc64dd_ (int_t *i__, int_t *n, int_t *q, double *d__, int_t *l, int_t *iway)
    int_t mc64ed_ (int_t *qlen, int_t *n, int_t *q, double *d__, int_t *l, int_t *iway)
    int_t mc64fd_ (int_t *pos0, int_t *qlen, int_t *n, int_t *q, double *d__, int_t *l, int_t *iway)
    int_t mc64rd_ (int_t *n, int_t *ne, int_t *ip, int_t *irn, double *a)
    int_t mc64sd_ (int_t *n, int_t *ne, int_t *ip, int_t *irn, double *a, int_t *iperm, int_t *numx, int_t *w, int_t *len, int_t *lenl, int_t *lenh, int_t *fc, int_t *iw, int_t *iw4)
    int_t mc64qd_ (int_t *ip, int_t *lenl, int_t *lenh, int_t *w, int_t *wlen, double *a, int_t *nval, double *val)
    int mc64ud_ (int_t *id, int_t *mod, int_t *n, int_t *irn, int_t *lirn, int_t *ip, int_t *lenc, int_t *fc, int_t *iperm, int_t *num, int_t *numx, int_t *pr, int_t *arp, int_t *cv, int_t *out)
    int_t mc64wd_ (int_t *n, int_t *ne, int_t *ip, int_t *irn, double *a, int_t *iperm, int_t *num, int_t *jperm, int_t *out, int_t *pr, int_t *q, int_t *l, double *u, double *d__)

    Variables

    static int_t c__1 = 1
    static int_t c__2 = 2
    +

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define abs (  )    ((a) > 0) ? (a) : -(a)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define min (a,
     )    ((a) < (b)) ? (a) : (b)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ad_ (int_t job,
    int_t n,
    int_t ne,
    int_t ip,
    int_t irn,
    double *  a,
    int_t num,
    int_t cperm,
    int_t liw,
    int_t iw,
    int_t ldw,
    double *  dw,
    int_t icntl,
    int_t info 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64bd_ (int_t n,
    int_t ne,
    int_t ip,
    int_t irn,
    double *  a,
    int_t iperm,
    int_t num,
    int_t jperm,
    int_t pr,
    int_t q,
    int_t l,
    double *  d__ 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64dd_ (int_t i__,
    int_t n,
    int_t q,
    double *  d__,
    int_t l,
    int_t iway 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ed_ (int_t qlen,
    int_t n,
    int_t q,
    double *  d__,
    int_t l,
    int_t iway 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64fd_ (int_t pos0,
    int_t qlen,
    int_t n,
    int_t q,
    double *  d__,
    int_t l,
    int_t iway 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int_t mc64id_ (int_t icntl  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64qd_ (int_t ip,
    int_t lenl,
    int_t lenh,
    int_t w,
    int_t wlen,
    double *  a,
    int_t nval,
    double *  val 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64rd_ (int_t n,
    int_t ne,
    int_t ip,
    int_t irn,
    double *  a 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64sd_ (int_t n,
    int_t ne,
    int_t ip,
    int_t irn,
    double *  a,
    int_t iperm,
    int_t numx,
    int_t w,
    int_t len,
    int_t lenl,
    int_t lenh,
    int_t fc,
    int_t iw,
    int_t iw4 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mc64ud_ (int_t id,
    int_t mod,
    int_t n,
    int_t irn,
    int_t lirn,
    int_t ip,
    int_t lenc,
    int_t fc,
    int_t iperm,
    int_t num,
    int_t numx,
    int_t pr,
    int_t arp,
    int_t cv,
    int_t out 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64wd_ (int_t n,
    int_t ne,
    int_t ip,
    int_t irn,
    double *  a,
    int_t iperm,
    int_t num,
    int_t jperm,
    int_t out,
    int_t pr,
    int_t q,
    int_t l,
    double *  u,
    double *  d__ 
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    int_t c__1 = 1 [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t c__2 = 2 [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8f.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8f.html new file mode 100644 index 0000000..7b3c879 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/mc64ad_8f.html @@ -0,0 +1,26 @@ + + +SuperLU: SRC/mc64ad.f File Reference + + + + + +
    +

    SRC/mc64ad.f File Reference

    + +
    +
    +
    Generated on Wed Jul 1 10:15:07 2009 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/memory_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/memory_8c.html new file mode 100644 index 0000000..9226d93 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/memory_8c.html @@ -0,0 +1,285 @@ + + +SuperLU: SRC/memory.c File Reference + + + + + +
    +

    SRC/memory.c File Reference

    Precision-independent memory-related routines. More... +

    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    void * superlu_malloc (size_t size)
    void superlu_free (void *addr)
    void SetIWork (int m, int n, int panel_size, int *iworkptr, int **segrep, int **parent, int **xplore, int **repfnz, int **panel_lsub, int **xprune, int **marker)
     Set up pointers for integer working arrays.
    void copy_mem_int (int howmany, void *old, void *new)
    void user_bcopy (char *src, char *dest, int bytes)
    int * intMalloc (int n)
    int * intCalloc (int n)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_int (int  howmany,
    void *  old,
    void *  new 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int* intCalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int* intMalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void SetIWork (int  m,
    int  n,
    int  panel_size,
    int *  iworkptr,
    int **  segrep,
    int **  parent,
    int **  xplore,
    int **  repfnz,
    int **  panel_lsub,
    int **  xprune,
    int **  marker 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void superlu_free (void *  addr  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void* superlu_malloc (size_t  size  ) 
    +
    +
    + +

    +Precision-independent memory-related routines. (Shared by [sdcz]memory.c) +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_bcopy (char *  src,
    char *  dest,
    int  bytes 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/mmd_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/mmd_8c.html new file mode 100644 index 0000000..a6fe01a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/mmd_8c.html @@ -0,0 +1,442 @@ + + +SuperLU: SRC/mmd.c File Reference + + + + + +
    +

    SRC/mmd.c File Reference

    + + + + + + + + + + + + + + + +

    Typedefs

    typedef int shortint

    Functions

    int genmmd_ (int *neqns, int *xadj, shortint *adjncy, shortint *invp, shortint *perm, int *delta, shortint *dhead, shortint *qsize, shortint *llist, shortint *marker, int *maxint, int *nofsub)
    int mmdint_ (int *neqns, int *xadj, shortint *adjncy, shortint *dhead, shortint *dforw, shortint *dbakw, shortint *qsize, shortint *llist, shortint *marker)
    int mmdelm_ (int *mdnode, int *xadj, shortint *adjncy, shortint *dhead, shortint *dforw, shortint *dbakw, shortint *qsize, shortint *llist, shortint *marker, int *maxint, int *tag)
    int mmdupd_ (int *ehead, int *neqns, int *xadj, shortint *adjncy, int *delta, int *mdeg, shortint *dhead, shortint *dforw, shortint *dbakw, shortint *qsize, shortint *llist, shortint *marker, int *maxint, int *tag)
    int mmdnum_ (int *neqns, shortint *perm, shortint *invp, shortint *qsize)
    +

    Typedef Documentation

    + +
    +
    + + + + +
    typedef int shortint
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int genmmd_ (int *  neqns,
    int *  xadj,
    shortint adjncy,
    shortint invp,
    shortint perm,
    int *  delta,
    shortint dhead,
    shortint qsize,
    shortint llist,
    shortint marker,
    int *  maxint,
    int *  nofsub 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mmdelm_ (int *  mdnode,
    int *  xadj,
    shortint adjncy,
    shortint dhead,
    shortint dforw,
    shortint dbakw,
    shortint qsize,
    shortint llist,
    shortint marker,
    int *  maxint,
    int *  tag 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mmdint_ (int *  neqns,
    int *  xadj,
    shortint adjncy,
    shortint dhead,
    shortint dforw,
    shortint dbakw,
    shortint qsize,
    shortint llist,
    shortint marker 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mmdnum_ (int *  neqns,
    shortint perm,
    shortint invp,
    shortint qsize 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mmdupd_ (int *  ehead,
    int *  neqns,
    int *  xadj,
    shortint adjncy,
    int *  delta,
    int *  mdeg,
    shortint dhead,
    shortint dforw,
    shortint dbakw,
    shortint qsize,
    shortint llist,
    shortint marker,
    int *  maxint,
    int *  tag 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/qselect_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/qselect_8c.html new file mode 100644 index 0000000..3665975 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/qselect_8c.html @@ -0,0 +1,110 @@ + + +SuperLU: SRC/qselect.c File Reference + + + + + +
    +

    SRC/qselect.c File Reference

    Quickselect: returns the k-th (zero-based) largest value in A[]. More... +

    +#include "slu_ddefs.h"
    + + + + + + + +

    Functions

    double dqselect (int n, double A[], int k)
    float sqselect (int n, float A[], int k)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dqselect (int  n,
    double  A[],
    int  k 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float sqselect (int  n,
    float  A[],
    int  k 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/relax__snode_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/relax__snode_8c.html new file mode 100644 index 0000000..c459706 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/relax__snode_8c.html @@ -0,0 +1,99 @@ + + +SuperLU: SRC/relax_snode.c File Reference + + + + + +
    +

    SRC/relax_snode.c File Reference

    Identify initial relaxed supernodes. More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

    void relax_snode (const int n, int *et, const int relax_columns, int *descendants, int *relax_end)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    +    the matrix has been reordered according to the postorder of the etree.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__bmod_8c.html new file mode 100644 index 0000000..8f2345f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__bmod_8c.html @@ -0,0 +1,272 @@ + + +SuperLU: SRC/scolumn_bmod.c File Reference + + + + + +
    +

    SRC/scolumn_bmod.c File Reference

    performs numeric block updates More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + +

    Functions

    void susolve (int, int, float *, float *)
     Solves a dense upper triangular system.
    void slsolve (int, int, float *, float *)
     Solves a dense UNIT lower triangular system.
    void smatvec (int, int, int, float *, float *, float *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int scolumn_bmod (const int jcol, const int nseg, float *dense, float *tempv, int *segrep, int *repfnz, int fpanelc, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

      Permission is hereby granted to use or copy this program for any
    +  purpose, provided the above notices are retained on all copies.
    +  Permission to modify the code and to distribute modified code is
    +  granted, provided the above notices are retained, and a notice that
    +  the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scolumn_bmod (const int  jcol,
    const int  nseg,
    float *  dense,
    float *  tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slsolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec (int  ldm,
    int  nrow,
    int  ncol,
    float *  M,
    float *  vec,
    float *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void susolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__dfs_8c.html new file mode 100644 index 0000000..ff98d62 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/scolumn__dfs_8c.html @@ -0,0 +1,182 @@ + + +SuperLU: SRC/scolumn_dfs.c File Reference + + + + + +
    +

    SRC/scolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + +

    Defines

    #define T2_SUPER
     What type of supernodes we want.

    Functions

    int scolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define T2_SUPER
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/scomplex_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/scomplex_8c.html new file mode 100644 index 0000000..9a90d4d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/scomplex_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/scomplex.c File Reference + + + + + +
    +

    SRC/scomplex.c File Reference

    Common arithmetic for complex type. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include <stdio.h>
    +#include "slu_scomplex.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void c_div (complex *c, complex *a, complex *b)
     Complex Division c = a/b.
    double c_abs (complex *z)
     Returns sqrt(z.r^2 + z.i^2).
    double c_abs1 (complex *z)
     Approximates the abs. Returns abs(z.r) + abs(z.i).
    void c_exp (complex *r, complex *z)
     Return the exponentiation.
    void r_cnjg (complex *r, complex *z)
     Return the complex conjugate.
    double r_imag (complex *z)
     Return the imaginary part.
    complex c_sgn (complex *z)
     SIGN functions for complex number. Returns z/abs(z).
    complex c_sqrt (complex *z)
     Square-root of a complex number.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     This file defines common arithmetic operations for complex type.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + +
    double c_abs (complex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double c_abs1 (complex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void c_div (complex c,
    complex a,
    complex b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void c_exp (complex r,
    complex z 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex c_sgn (complex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex c_sqrt (complex z  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void r_cnjg (complex r,
    complex z 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double r_imag (complex z  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/scopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/scopy__to__ucol_8c.html new file mode 100644 index 0000000..06f4232 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/scopy__to__ucol_8c.html @@ -0,0 +1,106 @@ + + +SuperLU: SRC/scopy_to_ucol.c File Reference + + + + + +
    +

    SRC/scopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int scopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, float *dense, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    float *  dense,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/scsum1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/scsum1_8c.html new file mode 100644 index 0000000..0177ba7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/scsum1_8c.html @@ -0,0 +1,116 @@ + + +SuperLU: SRC/scsum1.c File Reference + + + + + +
    +

    SRC/scsum1.c File Reference

    Takes sum of the absolute values of a complex vector and returns a single precision result. More... +

    +#include "slu_scomplex.h"
    +#include "slu_Cnames.h"
    + + + + + + + + +

    Defines

    #define CX(I)   cx[(I)-1]

    Functions

    double scsum1_ (int *n, complex *cx, int *incx)
    +


    Detailed Description

    +
    +     -- LAPACK auxiliary routine (version 2.0) --   
    +     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +     Courant Institute, Argonne National Lab, and Rice University   
    +     October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define CX (  )    cx[(I)-1]
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double scsum1_ (int *  n,
    complex cx,
    int *  incx 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        SCSUM1 takes the sum of the absolute values of a complex   
    +    vector and returns a single precision result.

    +

        Based on SCASUM from the Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.

    +

        Contributed by Nick Higham for use with CLACON.

    +

        Arguments   
    +    =========

    +

        N       (input) INT
    +            The number of elements in the vector CX.

    +

        CX      (input) COMPLEX array, dimension (N)   
    +            The vector whose elements will be summed.

    +

        INCX    (input) INT
    +            The spacing between successive values of CX.  INCX > 0.

    +

        ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sdiagonal_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sdiagonal_8c.html new file mode 100644 index 0000000..e0ce3e9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sdiagonal_8c.html @@ -0,0 +1,98 @@ + + +SuperLU: SRC/sdiagonal.c File Reference + + + + + +
    +

    SRC/sdiagonal.c File Reference

    Auxiliary routines to work with diagonal elements. More... +

    +#include "slu_sdefs.h"
    + + + + + + + +

    Functions

    int sfill_diag (int n, NCformat *Astore)
    int sdominate (int n, NCformat *Astore)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int sdominate (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int sfill_diag (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sfgmr_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sfgmr_8c.html new file mode 100644 index 0000000..0803ed2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sfgmr_8c.html @@ -0,0 +1,210 @@ + + +SuperLU: EXAMPLE/sfgmr.c File Reference + + + + + +
    +

    EXAMPLE/sfgmr.c File Reference

    flexible GMRES from ITSOL developed by Yousef Saad. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + + + + +

    Defines

    #define epsmac   1.0e-16

    Functions

    float sdot_ (int *, float[], int *, float[], int *)
    float snrm2_ (int *, float[], int *)
    int sfgmr (int n, void(*smatvec)(float, float[], float, float[]), void(*spsolve)(int, float[], float[]), float *rhs, float *sol, double tol, int im, int *itmax, FILE *fits)
    +


    Detailed Description

    +

    Define Documentation

    + +
    +
    + + + + +
    #define epsmac   1.0e-16
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float sdot_ (int * ,
    float [],
    int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sfgmr (int  n,
    void(*)(float, float[], float, float[])  smatvec,
    void(*)(int, float[], float[])  spsolve,
    float *  rhs,
    float *  sol,
    double  tol,
    int  im,
    int *  itmax,
    FILE *  fits 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float snrm2_ (int * ,
    float [],
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgscon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgscon_8c.html new file mode 100644 index 0000000..7ae6c6b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgscon_8c.html @@ -0,0 +1,135 @@ + + +SuperLU: SRC/sgscon.c File Reference + + + + + +
    +

    SRC/sgscon.c File Reference

    Estimates reciprocal of the condition number of a general matrix. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void sgscon (char *norm, SuperMatrix *L, SuperMatrix *U, float anorm, float *rcond, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routines SGECON.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    float  anorm,
    float *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by SGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            sgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            sgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

        ANORM   (input) float
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) float*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsequ_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsequ_8c.html new file mode 100644 index 0000000..af23c30 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsequ_8c.html @@ -0,0 +1,145 @@ + + +SuperLU: SRC/sgsequ.c File Reference + + + + + +
    +

    SRC/sgsequ.c File Reference

    Computes row and column scalings. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + + +

    Functions

    void sgsequ (SuperMatrix *A, float *r, float *c, float *rowcnd, float *colcnd, float *amax, int *info)
     Driver related.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine SGEEQU
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsequ (SuperMatrix A,
    float *  r,
    float *  c,
    float *  rowcnd,
    float *  colcnd,
    float *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       SGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_S; Mtype = SLU_GE.

    +

       R       (output) float*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) float*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) float*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) float*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) float*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsisx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsisx_8c.html new file mode 100644 index 0000000..3000a72 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsisx_8c.html @@ -0,0 +1,496 @@ + + +SuperLU: SRC/sgsisx.c File Reference + + + + + +
    +

    SRC/sgsisx.c File Reference

    Computes an approximate solutions of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void sgsisx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, float *R, float *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from sgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_S, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, sgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) float*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) float*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsitrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsitrf_8c.html new file mode 100644 index 0000000..ab20552 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsitrf_8c.html @@ -0,0 +1,241 @@ + + +SuperLU: SRC/sgsitrf.c File Reference + + + + + +
    +

    SRC/sgsitrf.c File Reference

    #include "slu_sdefs.h"
    + + + + + +

    Functions

    void sgsitrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_S, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsrfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsrfs_8c.html new file mode 100644 index 0000000..507b2cb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgsrfs_8c.html @@ -0,0 +1,249 @@ + + +SuperLU: SRC/sgsrfs.c File Reference + + + + + +
    +

    SRC/sgsrfs.c File Reference

    Improves computed solution to a system of inear equations. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + + + + +

    Defines

    #define ITMAX   5

    Functions

    void sgsrfs (trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, char *equed, float *R, float *C, SuperMatrix *B, SuperMatrix *X, float *ferr, float *berr, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routine SGERFS
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define ITMAX   5
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix B,
    SuperMatrix X,
    float *  ferr,
    float *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           sgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by sgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) float*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) float*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssv_8c.html new file mode 100644 index 0000000..ef12c35 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssv_8c.html @@ -0,0 +1,202 @@ + + +SuperLU: SRC/sgssv.c File Reference + + + + + +
    +

    SRC/sgssv.c File Reference

    Solves the system of linear equations A*X=B. More... +

    +#include "slu_sdefs.h"
    + + + + + + +

    Functions

    void sgssv (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, SuperLUStat_t *stat, int *info)
     Driver routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from SGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_S; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssvx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssvx_8c.html new file mode 100644 index 0000000..80f8b64 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgssvx_8c.html @@ -0,0 +1,450 @@ + + +SuperLU: SRC/sgssvx.c File Reference + + + + + +
    +

    SRC/sgssvx.c File Reference

    Solves the system of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void sgssvx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, float *R, float *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, float *rcond, float *ferr, float *berr, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    float *  ferr,
    float *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from sgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) float*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) float*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) float*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) float*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrf_8c.html new file mode 100644 index 0000000..574bdca --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrf_8c.html @@ -0,0 +1,261 @@ + + +SuperLU: SRC/sgstrf.c File Reference + + + + + +
    +

    SRC/sgstrf.c File Reference

    Computes an LU factorization of a general sparse matrix. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void sgstrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_S, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see spanel_dfs.c; marker2 is used for inner-factorization,
    +            see scolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during spanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_sdefs.h.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrs_8c.html new file mode 100644 index 0000000..c8e0938 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sgstrs_8c.html @@ -0,0 +1,332 @@ + + +SuperLU: SRC/sgstrs.c File Reference + + + + + +
    +

    SRC/sgstrs.c File Reference

    Solves a system using LU factorization. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    void susolve (int, int, float *, float *)
     Solves a dense upper triangular system.
    void slsolve (int, int, float *, float *)
     Solves a dense UNIT lower triangular system.
    void smatvec (int, int, int, float *, float *, float *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void sgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, SuperMatrix *B, SuperLUStat_t *stat, int *info)
    void sprint_soln (int n, int nrhs, float *soln)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + SGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         sgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         sgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slsolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec (int  ldm,
    int  nrow,
    int  ncol,
    float *  M,
    float *  vec,
    float *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sprint_soln (int  n,
    int  nrhs,
    float *  soln 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void susolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sitersol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sitersol_8c.html new file mode 100644 index 0000000..84ec430 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sitersol_8c.html @@ -0,0 +1,244 @@ + + +SuperLU: EXAMPLE/sitersol.c File Reference + + + + + +
    +

    EXAMPLE/sitersol.c File Reference

    #include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void smatvec_mult (float alpha, float x[], float beta, float y[])
    void spsolve (int n, float x[], float y[])
    int main (int argc, char *argv[])

    Variables

    int * GLOBAL_PERM_C
    int * GLOBAL_PERM_R
    SuperMatrixGLOBAL_A
    SuperMatrixGLOBAL_L
    SuperMatrixGLOBAL_U
    SuperLUStat_tGLOBAL_STAT
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec_mult (float  alpha,
    float  x[],
    float  beta,
    float  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void spsolve (int  n,
    float  x[],
    float  y[] 
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    SuperMatrix* GLOBAL_A
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_L
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GLOBAL_PERM_C
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int * GLOBAL_PERM_R
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_U
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slacon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slacon_8c.html new file mode 100644 index 0000000..06a6437 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slacon_8c.html @@ -0,0 +1,176 @@ + + +SuperLU: SRC/slacon.c File Reference + + + + + +
    +

    SRC/slacon.c File Reference

    Estimates the 1-norm. More... +

    +#include <math.h>
    +#include "slu_Cnames.h"
    + + + + + + + + + + +

    Defines

    #define d_sign(a, b)   (b >= 0 ? fabs(a) : -fabs(a))
    #define i_dnnt(a)   ( a>=0 ? floor(a+.5) : -floor(.5-a) )

    Functions

    int slacon_ (int *n, float *v, float *x, int *isgn, float *est, int *kase)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + + + + +
    #define d_sign (a,
     )    (b >= 0 ? fabs(a) : -fabs(a))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define i_dnnt (  )    ( a>=0 ? floor(a+.5) : -floor(.5-a) )
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int slacon_ (int *  n,
    float *  v,
    float *  x,
    int *  isgn,
    float *  est,
    int *  kase 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SLACON estimates the 1-norm of a square matrix A.   
    +   Reverse communication is used for evaluating matrix-vector products.

    +

       Arguments   
    +   =========

    +

       N      (input) INT
    +          The order of the matrix.  N >= 1.

    +

       V      (workspace) FLOAT PRECISION array, dimension (N)   
    +          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    +          (W is not returned).

    +

       X      (input/output) FLOAT PRECISION array, dimension (N)   
    +          On an intermediate return, X should be overwritten by   
    +                A * X,   if KASE=1,   
    +                A' * X,  if KASE=2,
    +         and SLACON must be re-called with all the other parameters   
    +          unchanged.

    +

       ISGN   (workspace) INT array, dimension (N)

    +

       EST    (output) FLOAT PRECISION   
    +          An estimate (a lower bound) for norm(A).

    +

       KASE   (input/output) INT
    +          On the initial call to SLACON, KASE should be 0.   
    +          On an intermediate return, KASE will be 1 or 2, indicating   
    +          whether X should be overwritten by A * X  or A' * X.   
    +          On the final return from SLACON, KASE will again be 0.

    +

       Further Details   
    +   ======= =======

    +

       Contributed by Nick Higham, University of Manchester.   
    +   Originally named CONEST, dated March 16, 1988.

    +

       Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    +   a real or complex matrix, with applications to condition estimation", 
    +   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    +   ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slamch_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slamch_8c.html new file mode 100644 index 0000000..11227d2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slamch_8c.html @@ -0,0 +1,606 @@ + + +SuperLU: SRC/slamch.c File Reference + + + + + +
    +

    SRC/slamch.c File Reference

    Determines single precision machine parameters and other service routines. More... +

    +#include <stdio.h>
    +#include "slu_Cnames.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define TRUE_   (1)
    #define FALSE_   (0)
    #define min(a, b)   ((a) <= (b) ? (a) : (b))
    #define max(a, b)   ((a) >= (b) ? (a) : (b))
    #define abs(x)   ((x) >= 0 ? (x) : -(x))
    #define dabs(x)   (double)abs(x)

    Functions

    float slamch_ (char *cmach)
    int slamc1_ (int *beta, int *t, int *rnd, int *ieee1)
    int slamc2_ (int *beta, int *t, int *rnd, float *eps, int *emin, float *rmin, int *emax, float *rmax)
    double slamc3_ (float *a, float *b)
    int slamc4_ (int *emin, float *start, int *base)
    int slamc5_ (int *beta, int *p, int *emin, int *ieee, int *emax, float *rmax)
    double pow_ri (float *ap, int *bp)
    +


    Detailed Description

    +
    +   -- LAPACK auxiliary routine (version 2.0) --   
    +      Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    +      Courant Institute, Argonne National Lab, and Rice University   
    +      October 31, 1992   
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define abs (  )    ((x) >= 0 ? (x) : -(x))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define dabs (  )    (double)abs(x)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define FALSE_   (0)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define max (a,
     )    ((a) >= (b) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define min (a,
     )    ((a) <= (b) ? (a) : (b))
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define TRUE_   (1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    double pow_ri (float *  ap,
    int *  bp 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int slamc1_ (int *  beta,
    int *  t,
    int *  rnd,
    int *  ieee1 
    )
    +
    +
    + +

    +

    + Purpose   
    +    =======

    +

        SLAMC1 determines the machine parameters given by BETA, T, RND, and   
    +    IEEE1.

    +

        Arguments   
    +    =========

    +

        BETA    (output) INT   
    +            The base of the machine.

    +

        T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.

    +

        RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not

    +

                be a reliable guide to the way in which the machine performs

    +

                its arithmetic.

    +

        IEEE1   (output) INT   
    +            Specifies whether rounding appears to be done in the IEEE   
    +            'round to nearest' style.

    +

        Further Details   
    +    ===============

    +

        The routine is based on the routine  ENVRON  by Malcolm and   
    +    incorporates suggestions by Gentleman and Marovich. See

    +

           Malcolm M. A. (1972) Algorithms to reveal properties of   
    +          floating-point arithmetic. Comms. of the ACM, 15, 949-951.

    +

           Gentleman W. M. and Marovich S. B. (1974) More on algorithms   
    +          that reveal properties of floating point arithmetic units.   
    +          Comms. of the ACM, 17, 276-277.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int slamc2_ (int *  beta,
    int *  t,
    int *  rnd,
    float *  eps,
    int *  emin,
    float *  rmin,
    int *  emax,
    float *  rmax 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        SLAMC2 determines the machine parameters specified in its argument   
    +    list.

    +

        Arguments   
    +    =========

    +

        BETA    (output) INT   
    +            The base of the machine.

    +

        T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.

    +

        RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not

    +

                be a reliable guide to the way in which the machine performs

    +

                its arithmetic.

    +

        EPS     (output) FLOAT   
    +            The smallest positive number such that

    +

                   fl( 1.0 - EPS ) .LT. 1.0,

    +

                where fl denotes the computed value.

    +

        EMIN    (output) INT   
    +            The minimum exponent before (gradual) underflow occurs.

    +

        RMIN    (output) FLOAT   
    +            The smallest normalized number for the machine, given by   
    +            BASE**( EMIN - 1 ), where  BASE  is the floating point value

    +

                of BETA.

    +

        EMAX    (output) INT   
    +            The maximum exponent before overflow occurs.

    +

        RMAX    (output) FLOAT   
    +            The largest positive number for the machine, given by   
    +            BASE**EMAX * ( 1 - EPS ), where  BASE  is the floating point

    +

                value of BETA.

    +

        Further Details   
    +    ===============

    +

        The computation of  EPS  is based on a routine PARANOIA by   
    +    W. Kahan of the University of California at Berkeley.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    double slamc3_ (float *  a,
    float *  b 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        SLAMC3  is intended to force  A  and  B  to be stored prior to doing

    +

        the addition of  A  and  B ,  for use in situations where optimizers

    +

        might hold one of these in a register.

    +

        Arguments   
    +    =========

    +

        A, B    (input) FLOAT   
    +            The values A and B.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int slamc4_ (int *  emin,
    float *  start,
    int *  base 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        SLAMC4 is a service routine for SLAMC2.

    +

        Arguments   
    +    =========

    +

        EMIN    (output) EMIN   
    +            The minimum exponent before (gradual) underflow, computed by

    +

                setting A = START and dividing by BASE until the previous A   
    +            can not be recovered.

    +

        START   (input) FLOAT   
    +            The starting point for determining EMIN.

    +

        BASE    (input) INT   
    +            The base of the machine.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int slamc5_ (int *  beta,
    int *  p,
    int *  emin,
    int *  ieee,
    int *  emax,
    float *  rmax 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        SLAMC5 attempts to compute RMAX, the largest machine floating-point   
    +    number, without overflow.  It assumes that EMAX + abs(EMIN) sum   
    +    approximately to a power of 2.  It will fail on machines where this   
    +    assumption does not hold, for example, the Cyber 205 (EMIN = -28625,

    +

        EMAX = 28718).  It will also fail if the value supplied for EMIN is   
    +    too large (i.e. too close to zero), probably with overflow.

    +

        Arguments   
    +    =========

    +

        BETA    (input) INT   
    +            The base of floating-point arithmetic.

    +

        P       (input) INT   
    +            The number of base BETA digits in the mantissa of a   
    +            floating-point value.

    +

        EMIN    (input) INT   
    +            The minimum exponent before (gradual) underflow.

    +

        IEEE    (input) INT   
    +            A logical flag specifying whether or not the arithmetic   
    +            system is thought to comply with the IEEE standard.

    +

        EMAX    (output) INT   
    +            The largest exponent before overflow

    +

        RMAX    (output) FLOAT   
    +            The largest machine floating-point number.

    +

       =====================================================================

    +

           First compute LEXP and UEXP, two powers of 2 that bound   
    +       abs(EMIN). We then assume that EMAX + abs(EMIN) will sum   
    +       approximately to the bound that is closest to abs(EMIN).   
    +       (EMAX is the exponent of the required number RMAX). 
    +
    +
    +

    + +

    +
    + + + + + + + + + +
    float slamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    + Purpose   
    +    =======

    +

        SLAMCH determines single precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by SLAMCH:   
    +            = 'E' or 'e',   SLAMCH := eps   
    +            = 'S' or 's ,   SLAMCH := sfmin   
    +            = 'B' or 'b',   SLAMCH := base   
    +            = 'P' or 'p',   SLAMCH := eps*base   
    +            = 'N' or 'n',   SLAMCH := t   
    +            = 'R' or 'r',   SLAMCH := rnd   
    +            = 'M' or 'm',   SLAMCH := emin   
    +            = 'U' or 'u',   SLAMCH := rmin   
    +            = 'L' or 'l',   SLAMCH := emax   
    +            = 'O' or 'o',   SLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slangs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slangs_8c.html new file mode 100644 index 0000000..466384a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slangs_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/slangs.c File Reference + + + + + +
    +

    SRC/slangs.c File Reference

    Returns the value of the one norm. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    float slangs (char *norm, SuperMatrix *A)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from lapack routine SLANGE 
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    float slangs (char *  norm,
    SuperMatrix A 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       SLANGS returns the value of the one norm, or the Frobenius norm, or 
    +   the infinity norm, or the element of largest absolute value of a 
    +   real matrix A.

    +

       Description   
    +   ===========

    +

       SLANGE returns the value

    +

          SLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    +               (   
    +               ( norm1(A),         NORM = '1', 'O' or 'o'   
    +               (   
    +               ( normI(A),         NORM = 'I' or 'i'   
    +               (   
    +               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'

    +

       where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    +   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    +   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    +   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.

    +

       Arguments   
    +   =========

    +

       NORM    (input) CHARACTER*1   
    +           Specifies the value to be returned in SLANGE as described above.   
    +   A       (input) SuperMatrix*
    +           The M by N sparse matrix A.

    +

      =====================================================================
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slaqgs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slaqgs_8c.html new file mode 100644 index 0000000..2eba2b5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slaqgs_8c.html @@ -0,0 +1,160 @@ + + +SuperLU: SRC/slaqgs.c File Reference + + + + + +
    +

    SRC/slaqgs.c File Reference

    Equlibrates a general sprase matrix. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + + + + +

    Defines

    #define THRESH   (0.1)

    Functions

    void slaqgs (SuperMatrix *A, float *r, float *c, float rowcnd, float colcnd, float amax, char *equed)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine SLAQGE
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define THRESH   (0.1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slaqgs (SuperMatrix A,
    float *  r,
    float *  c,
    float  rowcnd,
    float  colcnd,
    float  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_S; Mtype = GE.

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) float
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) float
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) float
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sldperm_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sldperm_8c.html new file mode 100644 index 0000000..9a5f84a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sldperm_8c.html @@ -0,0 +1,283 @@ + + +SuperLU: SRC/sldperm.c File Reference + + + + + +
    +

    SRC/sldperm.c File Reference

    Finds a row permutation so that the matrix has large entries on the diagonal. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + +

    Functions

    int_t mc64id_ (int_t *)
    int_t mc64ad_ (int_t *, int_t *, int_t *, int_t[], int_t[], double[], int_t *, int_t[], int_t *, int_t[], int_t *, double[], int_t[], int_t[])
    int sldperm (int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], float nzval[], int_t *perm, float u[], float v[])
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ad_ (int_t,
    int_t,
    int_t,
    int_t [],
    int_t [],
    double [],
    int_t,
    int_t [],
    int_t,
    int_t [],
    int_t,
    double [],
    int_t [],
    int_t [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int_t mc64id_ (int_t  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sldperm (int_t  job,
    int_t  n,
    int_t  nnz,
    int_t  colptr[],
    int_t  adjncy[],
    float  nzval[],
    int_t perm,
    float  u[],
    float  v[] 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       SLDPERM finds a row permutation so that the matrix has large
    +   entries on the diagonal.

    +

     Arguments
    + =========

    +

     job    (input) int
    +        Control the action. Possible values for JOB are:
    +        = 1 : Compute a row permutation of the matrix so that the
    +              permuted matrix has as many entries on its diagonal as
    +              possible. The values on the diagonal are of arbitrary size.
    +              HSL subroutine MC21A/AD is used for this.
    +        = 2 : Compute a row permutation of the matrix so that the smallest 
    +              value on the diagonal of the permuted matrix is maximized.
    +        = 3 : Compute a row permutation of the matrix so that the smallest
    +              value on the diagonal of the permuted matrix is maximized.
    +              The algorithm differs from the one used for JOB = 2 and may
    +              have quite a different performance.
    +        = 4 : Compute a row permutation of the matrix so that the sum
    +              of the diagonal entries of the permuted matrix is maximized.
    +        = 5 : Compute a row permutation of the matrix so that the product
    +              of the diagonal entries of the permuted matrix is maximized
    +              and vectors to scale the matrix so that the nonzero diagonal 
    +              entries of the permuted matrix are one in absolute value and 
    +              all the off-diagonal entries are less than or equal to one in 
    +              absolute value.
    +        Restriction: 1 <= JOB <= 5.

    +

     n      (input) int
    +        The order of the matrix.

    +

     nnz    (input) int
    +        The number of nonzeros in the matrix.

    +

     adjncy (input) int*, of size nnz
    +        The adjacency structure of the matrix, which contains the row
    +        indices of the nonzeros.

    +

     colptr (input) int*, of size n+1
    +        The pointers to the beginning of each column in ADJNCY.

    +

     nzval  (input) float*, of size nnz
    +        The nonzero values of the matrix. nzval[k] is the value of
    +        the entry corresponding to adjncy[k].
    +        It is not used if job = 1.

    +

     perm   (output) int*, of size n
    +        The permutation vector. perm[i] = j means row i in the
    +        original matrix is in row j of the permuted matrix.

    +

     u      (output) double*, of size n
    +        If job = 5, the natural logarithms of the row scaling factors.

    +

     v      (output) double*, of size n
    +        If job = 5, the natural logarithms of the column scaling factors. 
    +        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol1_8c.html new file mode 100644 index 0000000..fd6b057 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol1_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/slinsol1.c File Reference + + + + + +
    +

    EXAMPLE/slinsol1.c File Reference

    #include "slu_sdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol_8c.html new file mode 100644 index 0000000..c118b64 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsol_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/slinsol.c File Reference + + + + + +
    +

    EXAMPLE/slinsol.c File Reference

    #include "slu_sdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx1_8c.html new file mode 100644 index 0000000..8b85a1e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx1_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/slinsolx1.c File Reference + + + + + +
    +

    EXAMPLE/slinsolx1.c File Reference

    #include "slu_sdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, float *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    float *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx2_8c.html new file mode 100644 index 0000000..e9f0764 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx2_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/slinsolx2.c File Reference + + + + + +
    +

    EXAMPLE/slinsolx2.c File Reference

    #include "slu_sdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx_8c.html new file mode 100644 index 0000000..f709cd8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slinsolx_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/slinsolx.c File Reference + + + + + +
    +

    EXAMPLE/slinsolx.c File Reference

    #include "slu_sdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, float *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    float *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h-source.html new file mode 100644 index 0000000..4d9fba2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h-source.html @@ -0,0 +1,462 @@ + + +SuperLU: SRC/slu_Cnames.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h.html new file mode 100644 index 0000000..565ae50 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__Cnames_8h.html @@ -0,0 +1,164 @@ + + +SuperLU: SRC/slu_Cnames.h File Reference + + + + + +
    +

    SRC/slu_Cnames.h File Reference

    Macros defining how C routines will be called. More... +

    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + +

    Defines

    #define ADD_   0
    #define ADD__   1
    #define NOCHANGE   2
    #define UPCASE   3
    #define OLD_CRAY   4
    #define C_CALL   5
    #define F77_CALL_C   ADD_
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 1, 1997

    +

     These macros define how C routines will be called.  ADD_ assumes that
    + they will be called by fortran, which expects C routines to have an
    + underscore postfixed to the name (Suns, and the Intel expect this).
    + NOCHANGE indicates that fortran will be calling, and that it expects
    + the name called by fortran to be identical to that compiled by the C
    + (RS6K's do this).  UPCASE says it expects C routines called by fortran
    + to be in all upcase (CRAY wants this). 
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define ADD_   0
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define ADD__   1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define C_CALL   5
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define F77_CALL_C   ADD_
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define NOCHANGE   2
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define OLD_CRAY   4
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define UPCASE   3
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h-source.html new file mode 100644 index 0000000..7b0f16d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h-source.html @@ -0,0 +1,237 @@ + + +SuperLU: SRC/slu_cdefs.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h.html new file mode 100644 index 0000000..b879ba8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__cdefs_8h.html @@ -0,0 +1,6072 @@ + + +SuperLU: SRC/slu_cdefs.h File Reference + + + + + +
    +

    SRC/slu_cdefs.h File Reference

    Header file for real operations. More... +

    +#include <math.h>
    +#include <limits.h>
    +#include "slu_Cnames.h"
    +#include "supermatrix.h"
    +#include "slu_util.h"
    +#include "slu_scomplex.h"
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  GlobalLU_t

    Typedefs

    typedef int int_t

    Functions

    void cgssv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
     Driver routines.
    void cgssvx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
    void cgsisv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    void cgsisx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
    void cCreate_CompCol_Matrix (SuperMatrix *, int, int, int, complex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
     Supernodal LU factor related.
    void cCreate_CompRow_Matrix (SuperMatrix *, int, int, int, complex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void cCopy_CompCol_Matrix (SuperMatrix *, SuperMatrix *)
     Copy matrix A into matrix B.
    void cCreate_Dense_Matrix (SuperMatrix *, int, int, complex *, int, Stype_t, Dtype_t, Mtype_t)
    void cCreate_SuperNode_Matrix (SuperMatrix *, int, int, int, complex *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void cCopy_Dense_Matrix (int, int, complex *, int, complex *, int)
    void countnz (const int, int *, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L.
    void ilu_countnz (const int, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U.
    void fixupL (const int, const int *, GlobalLU_t *)
     Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts.
    void callocateA (int, int, complex **, int **, int **)
     Allocate storage for original matrix A.
    void cgstrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int csnode_dfs (const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
    int csnode_bmod (const int, const int, const int, complex *, complex *, GlobalLU_t *, SuperLUStat_t *)
     Performs numeric block updates within the relaxed snode.
    void cpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, complex *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    void cpanel_bmod (const int, const int, const int, const int, complex *, complex *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    int ccolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ccolumn_bmod (const int, const int, complex *, complex *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
    int ccopy_to_ucol (int, int, int *, int *, int *, complex *, GlobalLU_t *)
    int cpivotL (const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    void cpruneL (const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
    void creadmt (int *, int *, int *, complex **, int **, int **)
    void cGenXtrue (int, int, complex *, int)
    void cFillRHS (trans_t, int, complex *, int, SuperMatrix *, SuperMatrix *)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
    void cgsitrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int cldperm (int, int, int, int[], int[], complex[], int[], float[], float[])
    int ilu_csnode_dfs (const int, const int, const int *, const int *, const int *, int *, GlobalLU_t *)
    void ilu_cpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, complex *, float *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_ccolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_ccopy_to_ucol (int, int, int *, int *, int *, complex *, int, milu_t, double, int, complex *, int *, GlobalLU_t *, float *)
    int ilu_cpivotL (const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, complex, GlobalLU_t *, SuperLUStat_t *)
    int ilu_cdrop_row (superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, float *, float *, int)
    void cgsequ (SuperMatrix *, float *, float *, float *, float *, float *, int *)
     Driver related.
    void claqgs (SuperMatrix *, float *, float *, float, float, float, char *)
    void cgscon (char *, SuperMatrix *, SuperMatrix *, float, float *, SuperLUStat_t *, int *)
    float cPivotGrowth (int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
    void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
    int sp_ctrsv (char *, char *, char *, SuperMatrix *, SuperMatrix *, complex *, SuperLUStat_t *, int *)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_cgemv (char *, complex, SuperMatrix *, complex *, int, complex, complex *, int)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
    int sp_cgemm (char *, char *, int, int, int, complex, SuperMatrix *, complex *, int, complex, complex *, int)
    float slamch_ (char *)
    int cLUMemInit (fact_t, void *, int, int, int, int, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, complex **)
     Memory-related.
    void cSetRWork (int, int, complex *, complex **, complex **)
     Set up pointers for real working arrays.
    void cLUWorkFree (int *, complex *, GlobalLU_t *)
     Free the working storage used by factor routines.
    int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *)
     Expand the data structures for L and U during the factorization.
    complexcomplexMalloc (int)
    complexcomplexCalloc (int)
    float * floatMalloc (int)
    float * floatCalloc (int)
    int cmemory_usage (const int, const int, const int, const int)
    int cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    int ilu_cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    void creadhb (int *, int *, int *, complex **, int **, int **)
     Auxiliary routines.
    void creadrb (int *, int *, int *, complex **, int **, int **)
    void creadtriple (int *, int *, int *, complex **, int **, int **)
    void cCompRow_to_CompCol (int, int, int, complex *, int *, int *, complex **, int **, int **)
     Convert a row compressed storage into a column compressed storage.
    void cfill (complex *, int, complex)
     Fills a complex precision array with a given value.
    void cinf_norm_error (int, SuperMatrix *, complex *)
     Check the inf-norm of the error vector.
    void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, complex, complex, complex *, complex *, char *)
    float sqselect (int, float *, int)
    void cPrint_CompCol_Matrix (char *, SuperMatrix *)
     Routines for debugging.
    void cPrint_SuperNode_Matrix (char *, SuperMatrix *)
    void cPrint_Dense_Matrix (char *, SuperMatrix *)
    void cprint_lu_col (char *, int, int, int *, GlobalLU_t *)
     Diagnostic print of column "jcol" in the U/L factor.
    int print_double_vec (char *, int, double *)
    void check_tempv (int, complex *)
    +


    Detailed Description

    +
     
    + -- SuperLU routine (version 4.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November, 2010

    +

     Global data structures used in LU factorization -

    +

       nsuper: supernodes = nsuper + 1, numbered [0, nsuper].
    +   (xsup,supno): supno[i] is the supernode no to which i belongs;
    +	xsup(s) points to the beginning of the s-th supernode.
    +	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    +	        xsup 0 1 2 4 7 12
    +	Note: dfs will be performed on supernode rep. relative to the new 
    +	      row pivoting ordering

    +

       (xlsub,lsub): lsub[*] contains the compressed subscript of
    +	rectangular supernodes; xlsub[j] points to the starting
    +	location of the j-th column in lsub[*]. Note that xlsub 
    +	is indexed by column.
    +	Storage: original row subscripts

    +

          During the course of sparse LU factorization, we also use
    +	(xlsub,lsub) for the purpose of symmetric pruning. For each
    +	supernode {s,s+1,...,t=s+r} with first column s and last
    +	column t, the subscript set
    +		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    +	is the structure of column s (i.e. structure of this supernode).
    +	It is used for the storage of numerical values.
    +	Furthermore,
    +		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    +	is the structure of the last column t of this supernode.
    +	It is for the purpose of symmetric pruning. Therefore, the
    +	structural subscripts can be rearranged without making physical
    +	interchanges among the numerical values.

    +

    	However, if the supernode has only one column, then we
    +	only keep one set of subscripts. For any subscript interchange
    +	performed, similar interchange must be done on the numerical
    +	values.

    +

    	The last column structures (for pruning) will be removed
    +	after the numercial LU factorization phase.

    +

       (xlusup,lusup): lusup[*] contains the numerical values of the
    +	rectangular supernodes; xlusup[j] points to the starting
    +	location of the j-th column in storage vector lusup[*]
    +	Note: xlusup is indexed by column.
    +	Each rectangular supernode is stored by column-major
    +	scheme, consistent with Fortran 2-dim array storage.

    +

       (xusub,ucol,usub): ucol[*] stores the numerical values of
    +	U-columns outside the rectangular supernodes. The row
    +	subscript of nonzero ucol[k] is stored in usub[k].
    +	xusub[i] points to the starting location of column i in ucol.
    +	Storage: new row subscripts; that is subscripts of PA.
    + 

    Typedef Documentation

    + +
    +
    + + + + +
    typedef int int_t
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void callocateA (int ,
    int ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccolumn_bmod (const int  jcol,
    const int  nseg,
    complex dense,
    complex tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCompRow_to_CompCol (int ,
    int ,
    int ,
    complex,
    int * ,
    int * ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cCopy_CompCol_Matrix (SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCopy_Dense_Matrix (int ,
    int ,
    complex,
    int ,
    complex,
    int  
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ccopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    complex,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_CompCol_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    complex,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_CompRow_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    complex,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_Dense_Matrix (SuperMatrix,
    int ,
    int ,
    complex,
    int ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cCreate_SuperNode_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    complex,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cfill (complex,
    int ,
    complex  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cFillRHS (trans_t ,
    int ,
    complex,
    int ,
    SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cGenXtrue (int ,
    int ,
    complex,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    float  anorm,
    float *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by CGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            cgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            cgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

        ANORM   (input) float
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) float*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsequ (SuperMatrix A,
    float *  r,
    float *  c,
    float *  rowcnd,
    float *  colcnd,
    float *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       CGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_C; Mtype = SLU_GE.

    +

       R       (output) float*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) float*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) float*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) float*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) float*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsisv (superlu_options_t,
    SuperMatrix,
    int * ,
    int * ,
    SuperMatrix,
    SuperMatrix,
    SuperMatrix,
    SuperLUStat_t,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from cgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_C, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, cgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) float*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) float*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_C, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix B,
    SuperMatrix X,
    float *  ferr,
    float *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           cgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by cgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) float*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) float*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from CGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_C; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    float *  ferr,
    float *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from cgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) float*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) float*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) float*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) float*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_C, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see cpanel_dfs.c; marker2 is used for inner-factorization,
    +            see ccolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during cpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_cdefs.h.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     CGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + CGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         cgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         cgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void check_tempv (int ,
    complex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cinf_norm_error (int ,
    SuperMatrix,
    complex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void claqgs (SuperMatrix A,
    float *  r,
    float *  c,
    float  rowcnd,
    float  colcnd,
    float  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       CLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_C; Mtype = GE.

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) float
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) float
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) float
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cldperm (int ,
    int ,
    int ,
    int [],
    int [],
    complex [],
    int [],
    float [],
    float [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    float  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    complex **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void cLUWorkFree (int * ,
    complex,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cmemory_usage (const   int,
    const   int,
    const   int,
    const   int 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex* complexCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex* complexMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void countnz (const   int,
    int * ,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    complex dense,
    complex tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    complex dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float cPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_C; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_C; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_C; Mtype = TRU.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int cpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_CompCol_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_Dense_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cprint_lu_col (char * ,
    int ,
    int ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void cPrint_SuperNode_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int cQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadhb (int * ,
    int * ,
    int * ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadmt (int * ,
    int * ,
    int * ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadrb (int * ,
    int * ,
    int * ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void creadtriple (int * ,
    int * ,
    int * ,
    complex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void cSetRWork (int ,
    int ,
    complex,
    complex ** ,
    complex **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int csnode_bmod (const   int,
    const   int,
    const   int,
    complex,
    complex,
    GlobalLU_t,
    SuperLUStat_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int csnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    csnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void fixupL (const   int,
    const int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ccolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ccopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    complex,
    int ,
    milu_t ,
    double ,
    int ,
    complex,
    int * ,
    GlobalLU_t,
    float *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cdrop_row (superlu_options_t,
    int ,
    int ,
    double ,
    int ,
    int * ,
    double * ,
    GlobalLU_t,
    float * ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_countnz (const   int,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_cpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    complex dense,
    float *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    complex  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_cQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_csnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_csnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_double_vec (char * ,
    int ,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintPerf (SuperMatrix,
    SuperMatrix,
    mem_usage_t,
    complex ,
    complex ,
    complex,
    complex,
    char *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float slamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    + Purpose   
    +    =======

    +

        SLAMCH determines single precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by SLAMCH:   
    +            = 'E' or 'e',   SLAMCH := eps   
    +            = 'S' or 's ,   SLAMCH := sfmin   
    +            = 'B' or 'b',   SLAMCH := base   
    +            = 'P' or 'p',   SLAMCH := eps*base   
    +            = 'N' or 'n',   SLAMCH := t   
    +            = 'R' or 'r',   SLAMCH := rnd   
    +            = 'M' or 'm',   SLAMCH := emin   
    +            = 'U' or 'u',   SLAMCH := rmin   
    +            = 'L' or 'l',   SLAMCH := emax   
    +            = 'O' or 'o',   SLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_cgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    complex  alpha,
    SuperMatrix A,
    complex b,
    int  ldb,
    complex  beta,
    complex c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_c performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) complex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_C; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) complex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_cgemv (char *  trans,
    complex  alpha,
    SuperMatrix A,
    complex x,
    int  incx,
    complex  beta,
    complex y,
    int  incy 
    )
    +
    +
    + +

    +

      
    +   Purpose   
    +   =======

    +

       sp_cgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) complex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Before entry, the leading m by n part of the array A must   
    +            contain the matrix of coefficients.

    +

       X      - (input) complex*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +           and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) complex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) complex*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

        ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_ctrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    complex x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_ctrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A^H*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_C, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_C, Mtype = TRU.

    +

       x       - (input/output) complex*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float sqselect (int ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h-source.html new file mode 100644 index 0000000..9c19cfe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h-source.html @@ -0,0 +1,82 @@ + + +SuperLU: SRC/slu_dcomplex.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h.html new file mode 100644 index 0000000..3184523 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__dcomplex_8h.html @@ -0,0 +1,446 @@ + + +SuperLU: SRC/slu_dcomplex.h File Reference + + + + + +
    +

    SRC/slu_dcomplex.h File Reference

    Header file for complex operations. More... +

    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  doublecomplex

    Defines

    #define z_add(c, a, b)
     Complex Addition c = a + b.
    #define z_sub(c, a, b)
     Complex Subtraction c = a - b.
    #define zd_mult(c, a, b)
     Complex-Double Multiplication.
    #define zz_mult(c, a, b)
     Complex-Complex Multiplication.
    #define zz_conj(a, b)
    #define z_eq(a, b)   ( (a)->r == (b)->r && (a)->i == (b)->i )
     Complex equality testing.

    Functions

    void z_div (doublecomplex *, doublecomplex *, doublecomplex *)
     Complex Division c = a/b.
    double z_abs (doublecomplex *)
     Returns sqrt(z.r^2 + z.i^2).
    double z_abs1 (doublecomplex *)
     Approximates the abs. Returns abs(z.r) + abs(z.i).
    void z_exp (doublecomplex *, doublecomplex *)
     Return the exponentiation.
    void d_cnjg (doublecomplex *r, doublecomplex *z)
     Return the complex conjugate.
    double d_imag (doublecomplex *)
     Return the imaginary part.
    doublecomplex z_sgn (doublecomplex *)
     SIGN functions for complex number. Returns z/abs(z).
    doublecomplex z_sqrt (doublecomplex *)
     Square-root of a complex number.
    +


    Detailed Description

    +
     
    +  -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Contains definitions for various complex operations.
    + This header file is to be included in source files z*.c
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + + + + + + + +
    #define z_add (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r + (b)->r; \
    +                         (c)->i = (a)->i + (b)->i; }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + +
    #define z_eq (a,
     )    ( (a)->r == (b)->r && (a)->i == (b)->i )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define z_sub (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r - (b)->r; \
    +                         (c)->i = (a)->i - (b)->i; }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define zd_mult (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r * (b); \
    +                           (c)->i = (a)->i * (b); }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + +
    #define zz_conj (a,
     ) 
    +
    +
    + +

    +Value:

    { \
    +        (a)->r = (b)->r; \
    +        (a)->i = -((b)->i); \
    +    }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define zz_mult (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { \
    +        double cr, ci; \
    +        cr = (a)->r * (b)->r - (a)->i * (b)->i; \
    +        ci = (a)->i * (b)->r + (a)->r * (b)->i; \
    +        (c)->r = cr; \
    +        (c)->i = ci; \
    +    }
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void d_cnjg (doublecomplex r,
    doublecomplex z 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double d_imag (doublecomplex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double z_abs (doublecomplex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double z_abs1 (doublecomplex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void z_div (doublecomplex,
    doublecomplex,
    doublecomplex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void z_exp (doublecomplex,
    doublecomplex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex z_sgn (doublecomplex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex z_sqrt (doublecomplex  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h-source.html new file mode 100644 index 0000000..babc426 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h-source.html @@ -0,0 +1,234 @@ + + +SuperLU: SRC/slu_ddefs.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h.html new file mode 100644 index 0000000..7d8b4b3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__ddefs_8h.html @@ -0,0 +1,6029 @@ + + +SuperLU: SRC/slu_ddefs.h File Reference + + + + + +
    +

    SRC/slu_ddefs.h File Reference

    Header file for real operations. More... +

    +#include <math.h>
    +#include <limits.h>
    +#include "slu_Cnames.h"
    +#include "supermatrix.h"
    +#include "slu_util.h"
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  GlobalLU_t

    Typedefs

    typedef int int_t

    Functions

    void dgssv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
     Driver routines.
    void dgssvx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, double *, double *, double *, double *, mem_usage_t *, SuperLUStat_t *, int *)
    void dgsisv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    void dgsisx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, double *, double *, mem_usage_t *, SuperLUStat_t *, int *)
    void dCreate_CompCol_Matrix (SuperMatrix *, int, int, int, double *, int *, int *, Stype_t, Dtype_t, Mtype_t)
     Supernodal LU factor related.
    void dCreate_CompRow_Matrix (SuperMatrix *, int, int, int, double *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void dCopy_CompCol_Matrix (SuperMatrix *, SuperMatrix *)
     Copy matrix A into matrix B.
    void dCreate_Dense_Matrix (SuperMatrix *, int, int, double *, int, Stype_t, Dtype_t, Mtype_t)
    void dCreate_SuperNode_Matrix (SuperMatrix *, int, int, int, double *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void dCopy_Dense_Matrix (int, int, double *, int, double *, int)
    void countnz (const int, int *, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L.
    void ilu_countnz (const int, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U.
    void fixupL (const int, const int *, GlobalLU_t *)
     Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts.
    void dallocateA (int, int, double **, int **, int **)
     Allocate storage for original matrix A.
    void dgstrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int dsnode_dfs (const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
    int dsnode_bmod (const int, const int, const int, double *, double *, GlobalLU_t *, SuperLUStat_t *)
     Performs numeric block updates within the relaxed snode.
    void dpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, double *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    void dpanel_bmod (const int, const int, const int, const int, double *, double *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    int dcolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int dcolumn_bmod (const int, const int, double *, double *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
    int dcopy_to_ucol (int, int, int *, int *, int *, double *, GlobalLU_t *)
    int dpivotL (const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    void dpruneL (const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
    void dreadmt (int *, int *, int *, double **, int **, int **)
    void dGenXtrue (int, int, double *, int)
    void dFillRHS (trans_t, int, double *, int, SuperMatrix *, SuperMatrix *)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void dgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
    void dgsitrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int dldperm (int, int, int, int[], int[], double[], int[], double[], double[])
    int ilu_dsnode_dfs (const int, const int, const int *, const int *, const int *, int *, GlobalLU_t *)
    void ilu_dpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, double *, double *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_dcolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_dcopy_to_ucol (int, int, int *, int *, int *, double *, int, milu_t, double, int, double *, int *, GlobalLU_t *, double *)
    int ilu_dpivotL (const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, double, GlobalLU_t *, SuperLUStat_t *)
    int ilu_ddrop_row (superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, double *, double *, int)
    void dgsequ (SuperMatrix *, double *, double *, double *, double *, double *, int *)
     Driver related.
    void dlaqgs (SuperMatrix *, double *, double *, double, double, double, char *)
    void dgscon (char *, SuperMatrix *, SuperMatrix *, double, double *, SuperLUStat_t *, int *)
    double dPivotGrowth (int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
    void dgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, double *, double *, SuperLUStat_t *, int *)
    int sp_dtrsv (char *, char *, char *, SuperMatrix *, SuperMatrix *, double *, SuperLUStat_t *, int *)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_dgemv (char *, double, SuperMatrix *, double *, int, double, double *, int)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,.
    int sp_dgemm (char *, char *, int, int, int, double, SuperMatrix *, double *, int, double, double *, int)
    double dlamch_ (char *)
    int dLUMemInit (fact_t, void *, int, int, int, int, int, double, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, double **)
     Memory-related.
    void dSetRWork (int, int, double *, double **, double **)
     Set up pointers for real working arrays.
    void dLUWorkFree (int *, double *, GlobalLU_t *)
     Free the working storage used by factor routines.
    int dLUMemXpand (int, int, MemType, int *, GlobalLU_t *)
     Expand the data structures for L and U during the factorization.
    double * doubleMalloc (int)
    double * doubleCalloc (int)
    int dmemory_usage (const int, const int, const int, const int)
    int dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    int ilu_dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    void dreadhb (int *, int *, int *, double **, int **, int **)
     Auxiliary routines.
    void dreadrb (int *, int *, int *, double **, int **, int **)
    void dreadtriple (int *, int *, int *, double **, int **, int **)
    void dCompRow_to_CompCol (int, int, int, double *, int *, int *, double **, int **, int **)
     Convert a row compressed storage into a column compressed storage.
    void dfill (double *, int, double)
     Fills a double precision array with a given value.
    void dinf_norm_error (int, SuperMatrix *, double *)
     Check the inf-norm of the error vector.
    void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, double, double, double *, double *, char *)
    double dqselect (int, double *, int)
    void dPrint_CompCol_Matrix (char *, SuperMatrix *)
     Routines for debugging.
    void dPrint_SuperNode_Matrix (char *, SuperMatrix *)
    void dPrint_Dense_Matrix (char *, SuperMatrix *)
    void dprint_lu_col (char *, int, int, int *, GlobalLU_t *)
     Diagnostic print of column "jcol" in the U/L factor.
    int print_double_vec (char *, int, double *)
    void check_tempv (int, double *)
    +


    Detailed Description

    +
     
    + -- SuperLU routine (version 4.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November, 2010

    +

     Global data structures used in LU factorization -

    +

       nsuper: supernodes = nsuper + 1, numbered [0, nsuper].
    +   (xsup,supno): supno[i] is the supernode no to which i belongs;
    +	xsup(s) points to the beginning of the s-th supernode.
    +	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    +	        xsup 0 1 2 4 7 12
    +	Note: dfs will be performed on supernode rep. relative to the new 
    +	      row pivoting ordering

    +

       (xlsub,lsub): lsub[*] contains the compressed subscript of
    +	rectangular supernodes; xlsub[j] points to the starting
    +	location of the j-th column in lsub[*]. Note that xlsub 
    +	is indexed by column.
    +	Storage: original row subscripts

    +

          During the course of sparse LU factorization, we also use
    +	(xlsub,lsub) for the purpose of symmetric pruning. For each
    +	supernode {s,s+1,...,t=s+r} with first column s and last
    +	column t, the subscript set
    +		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    +	is the structure of column s (i.e. structure of this supernode).
    +	It is used for the storage of numerical values.
    +	Furthermore,
    +		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    +	is the structure of the last column t of this supernode.
    +	It is for the purpose of symmetric pruning. Therefore, the
    +	structural subscripts can be rearranged without making physical
    +	interchanges among the numerical values.

    +

    	However, if the supernode has only one column, then we
    +	only keep one set of subscripts. For any subscript interchange
    +	performed, similar interchange must be done on the numerical
    +	values.

    +

    	The last column structures (for pruning) will be removed
    +	after the numercial LU factorization phase.

    +

       (xlusup,lusup): lusup[*] contains the numerical values of the
    +	rectangular supernodes; xlusup[j] points to the starting
    +	location of the j-th column in storage vector lusup[*]
    +	Note: xlusup is indexed by column.
    +	Each rectangular supernode is stored by column-major
    +	scheme, consistent with Fortran 2-dim array storage.

    +

       (xusub,ucol,usub): ucol[*] stores the numerical values of
    +	U-columns outside the rectangular supernodes. The row
    +	subscript of nonzero ucol[k] is stored in usub[k].
    +	xusub[i] points to the starting location of column i in ucol.
    +	Storage: new row subscripts; that is subscripts of PA.
    + 

    Typedef Documentation

    + +
    +
    + + + + +
    typedef int int_t
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void check_tempv (int ,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void countnz (const   int,
    int * ,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dallocateA (int ,
    int ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcolumn_bmod (const int  jcol,
    const int  nseg,
    double *  dense,
    double *  tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCompRow_to_CompCol (int ,
    int ,
    int ,
    double * ,
    int * ,
    int * ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dCopy_CompCol_Matrix (SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCopy_Dense_Matrix (int ,
    int ,
    double * ,
    int ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dcopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    double * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_CompCol_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    double * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_CompRow_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    double * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_Dense_Matrix (SuperMatrix,
    int ,
    int ,
    double * ,
    int ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dCreate_SuperNode_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    double * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dfill (double * ,
    int ,
    double  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dFillRHS (trans_t ,
    int ,
    double * ,
    int ,
    SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dGenXtrue (int ,
    int ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    double  anorm,
    double *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by DGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            dgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

        ANORM   (input) double
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) double*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsequ (SuperMatrix A,
    double *  r,
    double *  c,
    double *  rowcnd,
    double *  colcnd,
    double *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       DGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE.

    +

       R       (output) double*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) double*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) double*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) double*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) double*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsisv (superlu_options_t,
    SuperMatrix,
    int * ,
    int * ,
    SuperMatrix,
    SuperMatrix,
    SuperMatrix,
    SuperLUStat_t,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from dgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, dgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) double*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) double*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_D, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix B,
    SuperMatrix X,
    double *  ferr,
    double *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           dgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by dgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) double*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) double*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from DGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_D; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    double *  ferr,
    double *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from dgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) double*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) double*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) double*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) double*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_D, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see dpanel_dfs.c; marker2 is used for inner-factorization,
    +            see dcolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during dpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_ddefs.h.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     DGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + DGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         dgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dinf_norm_error (int ,
    SuperMatrix,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double dlamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMCH determines double precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by DLAMCH:   
    +            = 'E' or 'e',   DLAMCH := eps   
    +            = 'S' or 's ,   DLAMCH := sfmin   
    +            = 'B' or 'b',   DLAMCH := base   
    +            = 'P' or 'p',   DLAMCH := eps*base   
    +            = 'N' or 'n',   DLAMCH := t   
    +            = 'R' or 'r',   DLAMCH := rnd   
    +            = 'M' or 'm',   DLAMCH := emin   
    +            = 'U' or 'u',   DLAMCH := rmin   
    +            = 'L' or 'l',   DLAMCH := emax   
    +            = 'O' or 'o',   DLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dlaqgs (SuperMatrix A,
    double *  r,
    double *  c,
    double  rowcnd,
    double  colcnd,
    double  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       DLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_D; Mtype = GE.

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) double
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) double
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) double
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dldperm (int ,
    int ,
    int ,
    int [],
    int [],
    double [],
    int [],
    double [],
    double [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    double  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    double **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void dLUWorkFree (int * ,
    double * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dmemory_usage (const   int,
    const   int,
    const   int,
    const   int 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double* doubleCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double* doubleMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    double *  dense,
    double *  tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    double *  dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double dPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_D; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_D; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_D; Mtype = TRU.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_CompCol_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_Dense_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dprint_lu_col (char * ,
    int ,
    int ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void dPrint_SuperNode_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dqselect (int ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int dQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadhb (int * ,
    int * ,
    int * ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadmt (int * ,
    int * ,
    int * ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadrb (int * ,
    int * ,
    int * ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dreadtriple (int * ,
    int * ,
    int * ,
    double ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void dSetRWork (int ,
    int ,
    double * ,
    double ** ,
    double **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dsnode_bmod (const   int,
    const   int,
    const   int,
    double * ,
    double * ,
    GlobalLU_t,
    SuperLUStat_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int dsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    dsnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void fixupL (const   int,
    const int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_countnz (const   int,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dcopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    double * ,
    int ,
    milu_t ,
    double ,
    int ,
    double * ,
    int * ,
    GlobalLU_t,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ddrop_row (superlu_options_t,
    int ,
    int ,
    double ,
    int ,
    int * ,
    double * ,
    GlobalLU_t,
    double * ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_dpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    double *  dense,
    double *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    double  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_dsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_dsnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_double_vec (char * ,
    int ,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintPerf (SuperMatrix,
    SuperMatrix,
    mem_usage_t,
    double ,
    double ,
    double * ,
    double * ,
    char *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    double  alpha,
    SuperMatrix A,
    double *  b,
    int  ldb,
    double  beta,
    double *  c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_d performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) double
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) double
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - DOUBLE PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dgemv (char *  trans,
    double  alpha,
    SuperMatrix A,
    double *  x,
    int  incx,
    double  beta,
    double *  y,
    int  incy 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       sp_dgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) double
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       X      - (input) double*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) double
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) double*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

       ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_dtrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    double *  x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_dtrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A'*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_D, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_D, Mtype = TRU.

    +

       x       - (input/output) double*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h-source.html new file mode 100644 index 0000000..f9ee508 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h-source.html @@ -0,0 +1,82 @@ + + +SuperLU: SRC/slu_scomplex.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h.html new file mode 100644 index 0000000..a0b3c6e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__scomplex_8h.html @@ -0,0 +1,446 @@ + + +SuperLU: SRC/slu_scomplex.h File Reference + + + + + +
    +

    SRC/slu_scomplex.h File Reference

    Header file for complex operations. More... +

    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  complex

    Defines

    #define c_add(c, a, b)
     Complex Addition c = a + b.
    #define c_sub(c, a, b)
     Complex Subtraction c = a - b.
    #define cs_mult(c, a, b)
     Complex-Double Multiplication.
    #define cc_mult(c, a, b)
     Complex-Complex Multiplication.
    #define cc_conj(a, b)
    #define c_eq(a, b)   ( (a)->r == (b)->r && (a)->i == (b)->i )
     Complex equality testing.

    Functions

    void c_div (complex *, complex *, complex *)
     Complex Division c = a/b.
    double c_abs (complex *)
     Returns sqrt(z.r^2 + z.i^2).
    double c_abs1 (complex *)
     Approximates the abs. Returns abs(z.r) + abs(z.i).
    void c_exp (complex *, complex *)
     Return the exponentiation.
    void r_cnjg (complex *, complex *)
     Return the complex conjugate.
    double r_imag (complex *)
     Return the imaginary part.
    complex c_sgn (complex *)
     SIGN functions for complex number. Returns z/abs(z).
    complex c_sqrt (complex *)
     Square-root of a complex number.
    +


    Detailed Description

    +
     
    +  -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Contains definitions for various complex operations.
    + This header file is to be included in source files c*.c
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + + + + + + + +
    #define c_add (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r + (b)->r; \
    +                         (c)->i = (a)->i + (b)->i; }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + +
    #define c_eq (a,
     )    ( (a)->r == (b)->r && (a)->i == (b)->i )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define c_sub (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r - (b)->r; \
    +                         (c)->i = (a)->i - (b)->i; }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + +
    #define cc_conj (a,
     ) 
    +
    +
    + +

    +Value:

    { \
    +        (a)->r = (b)->r; \
    +        (a)->i = -((b)->i); \
    +    }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define cc_mult (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { \
    +        float cr, ci; \
    +        cr = (a)->r * (b)->r - (a)->i * (b)->i; \
    +        ci = (a)->i * (b)->r + (a)->r * (b)->i; \
    +        (c)->r = cr; \
    +        (c)->i = ci; \
    +    }
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + +
    #define cs_mult (c,
    a,
     ) 
    +
    +
    + +

    +Value:

    { (c)->r = (a)->r * (b); \
    +                           (c)->i = (a)->i * (b); }
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + +
    double c_abs (complex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double c_abs1 (complex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void c_div (complex,
    complex,
    complex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void c_exp (complex,
    complex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex c_sgn (complex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    complex c_sqrt (complex  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void r_cnjg (complex,
    complex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double r_imag (complex  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h-source.html new file mode 100644 index 0000000..5286852 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h-source.html @@ -0,0 +1,234 @@ + + +SuperLU: SRC/slu_sdefs.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h.html new file mode 100644 index 0000000..c961ea3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__sdefs_8h.html @@ -0,0 +1,6029 @@ + + +SuperLU: SRC/slu_sdefs.h File Reference + + + + + +
    +

    SRC/slu_sdefs.h File Reference

    Header file for real operations. More... +

    +#include <math.h>
    +#include <limits.h>
    +#include "slu_Cnames.h"
    +#include "supermatrix.h"
    +#include "slu_util.h"
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  GlobalLU_t

    Typedefs

    typedef int int_t

    Functions

    void sgssv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
     Driver routines.
    void sgssvx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
    void sgsisv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    void sgsisx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, mem_usage_t *, SuperLUStat_t *, int *)
    void sCreate_CompCol_Matrix (SuperMatrix *, int, int, int, float *, int *, int *, Stype_t, Dtype_t, Mtype_t)
     Supernodal LU factor related.
    void sCreate_CompRow_Matrix (SuperMatrix *, int, int, int, float *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void sCopy_CompCol_Matrix (SuperMatrix *, SuperMatrix *)
     Copy matrix A into matrix B.
    void sCreate_Dense_Matrix (SuperMatrix *, int, int, float *, int, Stype_t, Dtype_t, Mtype_t)
    void sCreate_SuperNode_Matrix (SuperMatrix *, int, int, int, float *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void sCopy_Dense_Matrix (int, int, float *, int, float *, int)
    void countnz (const int, int *, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L.
    void ilu_countnz (const int, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U.
    void fixupL (const int, const int *, GlobalLU_t *)
     Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts.
    void sallocateA (int, int, float **, int **, int **)
     Allocate storage for original matrix A.
    void sgstrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int ssnode_dfs (const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
    int ssnode_bmod (const int, const int, const int, float *, float *, GlobalLU_t *, SuperLUStat_t *)
     Performs numeric block updates within the relaxed snode.
    void spanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, float *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    void spanel_bmod (const int, const int, const int, const int, float *, float *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    int scolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int scolumn_bmod (const int, const int, float *, float *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
    int scopy_to_ucol (int, int, int *, int *, int *, float *, GlobalLU_t *)
    int spivotL (const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    void spruneL (const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
    void sreadmt (int *, int *, int *, float **, int **, int **)
    void sGenXtrue (int, int, float *, int)
    void sFillRHS (trans_t, int, float *, int, SuperMatrix *, SuperMatrix *)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
    void sgsitrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int sldperm (int, int, int, int[], int[], float[], int[], float[], float[])
    int ilu_ssnode_dfs (const int, const int, const int *, const int *, const int *, int *, GlobalLU_t *)
    void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, float *, float *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_scolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_scopy_to_ucol (int, int, int *, int *, int *, float *, int, milu_t, double, int, float *, int *, GlobalLU_t *, float *)
    int ilu_spivotL (const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, float, GlobalLU_t *, SuperLUStat_t *)
    int ilu_sdrop_row (superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, float *, float *, int)
    void sgsequ (SuperMatrix *, float *, float *, float *, float *, float *, int *)
     Driver related.
    void slaqgs (SuperMatrix *, float *, float *, float, float, float, char *)
    void sgscon (char *, SuperMatrix *, SuperMatrix *, float, float *, SuperLUStat_t *, int *)
    float sPivotGrowth (int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
    void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, SuperLUStat_t *, int *)
    int sp_strsv (char *, char *, char *, SuperMatrix *, SuperMatrix *, float *, SuperLUStat_t *, int *)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_sgemv (char *, float, SuperMatrix *, float *, int, float, float *, int)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,.
    int sp_sgemm (char *, char *, int, int, int, float, SuperMatrix *, float *, int, float, float *, int)
    float slamch_ (char *)
    int sLUMemInit (fact_t, void *, int, int, int, int, int, float, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, float **)
     Memory-related.
    void sSetRWork (int, int, float *, float **, float **)
     Set up pointers for real working arrays.
    void sLUWorkFree (int *, float *, GlobalLU_t *)
     Free the working storage used by factor routines.
    int sLUMemXpand (int, int, MemType, int *, GlobalLU_t *)
     Expand the data structures for L and U during the factorization.
    float * floatMalloc (int)
    float * floatCalloc (int)
    int smemory_usage (const int, const int, const int, const int)
    int sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    int ilu_sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    void sreadhb (int *, int *, int *, float **, int **, int **)
     Auxiliary routines.
    void sreadrb (int *, int *, int *, float **, int **, int **)
    void sreadtriple (int *, int *, int *, float **, int **, int **)
    void sCompRow_to_CompCol (int, int, int, float *, int *, int *, float **, int **, int **)
     Convert a row compressed storage into a column compressed storage.
    void sfill (float *, int, float)
     Fills a float precision array with a given value.
    void sinf_norm_error (int, SuperMatrix *, float *)
     Check the inf-norm of the error vector.
    void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, float, float, float *, float *, char *)
    float sqselect (int, float *, int)
    void sPrint_CompCol_Matrix (char *, SuperMatrix *)
     Routines for debugging.
    void sPrint_SuperNode_Matrix (char *, SuperMatrix *)
    void sPrint_Dense_Matrix (char *, SuperMatrix *)
    void sprint_lu_col (char *, int, int, int *, GlobalLU_t *)
     Diagnostic print of column "jcol" in the U/L factor.
    int print_double_vec (char *, int, double *)
    void check_tempv (int, float *)
    +


    Detailed Description

    +
     
    + -- SuperLU routine (version 4.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November, 2010

    +

     Global data structures used in LU factorization -

    +

       nsuper: supernodes = nsuper + 1, numbered [0, nsuper].
    +   (xsup,supno): supno[i] is the supernode no to which i belongs;
    +	xsup(s) points to the beginning of the s-th supernode.
    +	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    +	        xsup 0 1 2 4 7 12
    +	Note: dfs will be performed on supernode rep. relative to the new 
    +	      row pivoting ordering

    +

       (xlsub,lsub): lsub[*] contains the compressed subscript of
    +	rectangular supernodes; xlsub[j] points to the starting
    +	location of the j-th column in lsub[*]. Note that xlsub 
    +	is indexed by column.
    +	Storage: original row subscripts

    +

          During the course of sparse LU factorization, we also use
    +	(xlsub,lsub) for the purpose of symmetric pruning. For each
    +	supernode {s,s+1,...,t=s+r} with first column s and last
    +	column t, the subscript set
    +		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    +	is the structure of column s (i.e. structure of this supernode).
    +	It is used for the storage of numerical values.
    +	Furthermore,
    +		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    +	is the structure of the last column t of this supernode.
    +	It is for the purpose of symmetric pruning. Therefore, the
    +	structural subscripts can be rearranged without making physical
    +	interchanges among the numerical values.

    +

    	However, if the supernode has only one column, then we
    +	only keep one set of subscripts. For any subscript interchange
    +	performed, similar interchange must be done on the numerical
    +	values.

    +

    	The last column structures (for pruning) will be removed
    +	after the numercial LU factorization phase.

    +

       (xlusup,lusup): lusup[*] contains the numerical values of the
    +	rectangular supernodes; xlusup[j] points to the starting
    +	location of the j-th column in storage vector lusup[*]
    +	Note: xlusup is indexed by column.
    +	Each rectangular supernode is stored by column-major
    +	scheme, consistent with Fortran 2-dim array storage.

    +

       (xusub,ucol,usub): ucol[*] stores the numerical values of
    +	U-columns outside the rectangular supernodes. The row
    +	subscript of nonzero ucol[k] is stored in usub[k].
    +	xusub[i] points to the starting location of column i in ucol.
    +	Storage: new row subscripts; that is subscripts of PA.
    + 

    Typedef Documentation

    + +
    +
    + + + + +
    typedef int int_t
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void check_tempv (int ,
    float *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void countnz (const   int,
    int * ,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void fixupL (const   int,
    const int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_countnz (const   int,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_scolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_scopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    float * ,
    int ,
    milu_t ,
    double ,
    int ,
    float * ,
    int * ,
    GlobalLU_t,
    float *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_sdrop_row (superlu_options_t,
    int ,
    int ,
    double ,
    int ,
    int * ,
    double * ,
    GlobalLU_t,
    float * ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_spanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    float *  dense,
    float *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_spivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    float  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_sQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_ssnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_ssnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_double_vec (char * ,
    int ,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintPerf (SuperMatrix,
    SuperMatrix,
    mem_usage_t,
    float ,
    float ,
    float * ,
    float * ,
    char *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sallocateA (int ,
    int ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scolumn_bmod (const int  jcol,
    const int  nseg,
    float *  dense,
    float *  tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCompRow_to_CompCol (int ,
    int ,
    int ,
    float * ,
    int * ,
    int * ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sCopy_CompCol_Matrix (SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCopy_Dense_Matrix (int ,
    int ,
    float * ,
    int ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int scopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    float * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_CompCol_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    float * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_CompRow_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    float * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_Dense_Matrix (SuperMatrix,
    int ,
    int ,
    float * ,
    int ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_SuperNode_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    float * ,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sfill (float * ,
    int ,
    float  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sFillRHS (trans_t ,
    int ,
    float * ,
    int ,
    SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sGenXtrue (int ,
    int ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    float  anorm,
    float *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by SGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            sgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            sgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

        ANORM   (input) float
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) float*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsequ (SuperMatrix A,
    float *  r,
    float *  c,
    float *  rowcnd,
    float *  colcnd,
    float *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       SGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_S; Mtype = SLU_GE.

    +

       R       (output) float*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) float*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) float*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) float*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) float*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsisv (superlu_options_t,
    SuperMatrix,
    int * ,
    int * ,
    SuperMatrix,
    SuperMatrix,
    SuperMatrix,
    SuperLUStat_t,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from sgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_S, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, sgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) float*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) float*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_S, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix B,
    SuperMatrix X,
    float *  ferr,
    float *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           sgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by sgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) float*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) float*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from SGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_S; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    float *  R,
    float *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    float *  recip_pivot_growth,
    float *  rcond,
    float *  ferr,
    float *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from sgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) float*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) float*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) float*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) float*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) float*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) float*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_S, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see spanel_dfs.c; marker2 is used for inner-factorization,
    +            see scolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during spanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_sdefs.h.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     SGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + SGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         sgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         sgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sinf_norm_error (int ,
    SuperMatrix,
    float *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float slamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    + Purpose   
    +    =======

    +

        SLAMCH determines single precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by SLAMCH:   
    +            = 'E' or 'e',   SLAMCH := eps   
    +            = 'S' or 's ,   SLAMCH := sfmin   
    +            = 'B' or 'b',   SLAMCH := base   
    +            = 'P' or 'p',   SLAMCH := eps*base   
    +            = 'N' or 'n',   SLAMCH := t   
    +            = 'R' or 'r',   SLAMCH := rnd   
    +            = 'M' or 'm',   SLAMCH := emin   
    +            = 'U' or 'u',   SLAMCH := rmin   
    +            = 'L' or 'l',   SLAMCH := emax   
    +            = 'O' or 'o',   SLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slaqgs (SuperMatrix A,
    float *  r,
    float *  c,
    float  rowcnd,
    float  colcnd,
    float  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       SLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_S; Mtype = GE.

    +

       R       (input) float*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) float*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) float
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) float
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) float
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sldperm (int ,
    int ,
    int ,
    int [],
    int [],
    float [],
    int [],
    float [],
    float [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    float  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    float **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sLUWorkFree (int * ,
    float * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int smemory_usage (const   int,
    const   int,
    const   int,
    const   int 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_sgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    float  alpha,
    SuperMatrix A,
    float *  b,
    int  ldb,
    float  beta,
    float *  c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_s performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) float
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - FLOAT PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) float
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - FLOAT PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_sgemv (char *  trans,
    float  alpha,
    SuperMatrix A,
    float *  x,
    int  incx,
    float  beta,
    float *  y,
    int  incy 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       sp_sgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) float
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       X      - (input) float*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) float
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) float*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

       ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_strsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    float *  x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_strsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A'*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_S, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_S, Mtype = TRU.

    +

       x       - (input/output) float*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    float *  dense,
    float *  tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    float *  dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float sPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_S; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_S; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_S; Mtype = TRU.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int spivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_CompCol_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_Dense_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sprint_lu_col (char * ,
    int ,
    int ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_SuperNode_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float sqselect (int ,
    float * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int sQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadhb (int * ,
    int * ,
    int * ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadmt (int * ,
    int * ,
    int * ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadrb (int * ,
    int * ,
    int * ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadtriple (int * ,
    int * ,
    int * ,
    float ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sSetRWork (int ,
    int ,
    float * ,
    float ** ,
    float **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ssnode_bmod (const   int,
    const   int,
    const   int,
    float * ,
    float * ,
    GlobalLU_t,
    SuperLUStat_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ssnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ssnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h-source.html new file mode 100644 index 0000000..efd037d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h-source.html @@ -0,0 +1,373 @@ + + +SuperLU: SRC/slu_util.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h.html new file mode 100644 index 0000000..cb0b21c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__util_8h.html @@ -0,0 +1,2296 @@ + + +SuperLU: SRC/slu_util.h File Reference + + + + + +
    +

    SRC/slu_util.h File Reference

    Utility header file. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include <string.h>
    +#include <assert.h>
    +#include "superlu_enum_consts.h"
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  superlu_options_t
    struct  e_node
     Headers for 4 types of dynamatically managed memory. More...
    struct  LU_stack_t
    struct  SuperLUStat_t
    struct  mem_usage_t

    Defines

    #define FIRSTCOL_OF_SNODE(i)   (xsup[i])
    #define NO_MARKER   3
    #define NUM_TEMPV(m, w, t, b)   ( SUPERLU_MAX(m, (t + b)*w) )
    #define USER_ABORT(msg)   superlu_abort_and_exit(msg)
    #define ABORT(err_msg)
    #define USER_MALLOC(size)   superlu_malloc(size)
    #define SUPERLU_MALLOC(size)   USER_MALLOC(size)
    #define USER_FREE(addr)   superlu_free(addr)
    #define SUPERLU_FREE(addr)   USER_FREE(addr)
    #define CHECK_MALLOC(where)
    #define SUPERLU_MAX(x, y)   ( (x) > (y) ? (x) : (y) )
    #define SUPERLU_MIN(x, y)   ( (x) < (y) ? (x) : (y) )
    #define L_SUB_START(col)   ( Lstore->rowind_colptr[col] )
    #define L_SUB(ptr)   ( Lstore->rowind[ptr] )
    #define L_NZ_START(col)   ( Lstore->nzval_colptr[col] )
    #define L_FST_SUPC(superno)   ( Lstore->sup_to_col[superno] )
    #define U_NZ_START(col)   ( Ustore->colptr[col] )
    #define U_SUB(ptr)   ( Ustore->rowind[ptr] )
    #define EMPTY   (-1)
    #define FALSE   0
    #define TRUE   1
    #define NO_MEMTYPE   4
    #define GluIntArray(n)   (5 * (n) + 5)
    #define NODROP   ( 0x0000 )
    #define DROP_BASIC   ( 0x0001 )
    #define DROP_PROWS   ( 0x0002 )
    #define DROP_COLUMN   ( 0x0004 )
    #define DROP_AREA   ( 0x0008 )
    #define DROP_SECONDARY   ( 0x000E )
    #define DROP_DYNAMIC   ( 0x0010 )
    #define DROP_INTERP   ( 0x0100 )
    #define MILU_ALPHA   (1.0e-2)

    Typedefs

    typedef float flops_t
    typedef unsigned char Logical
    typedef struct e_node ExpHeader

    Functions

    void Destroy_SuperMatrix_Store (SuperMatrix *)
     Deallocate the structure pointing to the actual storage of the matrix.
    void Destroy_CompCol_Matrix (SuperMatrix *)
    void Destroy_CompRow_Matrix (SuperMatrix *)
    void Destroy_SuperNode_Matrix (SuperMatrix *)
    void Destroy_CompCol_Permuted (SuperMatrix *)
     A is of type Stype==NCP.
    void Destroy_Dense_Matrix (SuperMatrix *)
     A is of type Stype==DN.
    void get_perm_c (int, SuperMatrix *, int *)
    void set_default_options (superlu_options_t *options)
     Set the default values for the options argument.
    void ilu_set_default_options (superlu_options_t *options)
     Set the default values for the options argument for ILU.
    void sp_preorder (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *)
    void superlu_abort_and_exit (char *)
     Global statistics variale.
    void * superlu_malloc (size_t)
    int * intMalloc (int)
    int * intCalloc (int)
    void superlu_free (void *)
    void SetIWork (int, int, int, int *, int **, int **, int **, int **, int **, int **, int **)
     Set up pointers for integer working arrays.
    int sp_coletree (int *, int *, int *, int, int, int *)
    void relax_snode (const int, int *, const int, int *, int *)
    void heap_relax_snode (const int, int *, const int, int *, int *)
    int mark_relax (int, int *, int *, int *, int *, int *, int *)
    void ilu_relax_snode (const int, int *, const int, int *, int *, int *)
    void ilu_heap_relax_snode (const int, int *, const int, int *, int *, int *)
    void resetrep_col (const int, const int *, int *)
     Reset repfnz[] for the current column.
    int spcoletree (int *, int *, int *, int, int, int *)
    int * TreePostorder (int, int *)
    double SuperLU_timer_ ()
     Timer function.
    int sp_ienv (int)
    int lsame_ (char *, char *)
    int xerbla_ (char *, int *)
    void ifill (int *, int, int)
     Fills an integer array with a given value.
    void snode_profile (int, int *)
    void super_stats (int, int *)
    void check_repfnz (int, int, int, int *)
     Check whether repfnz[] == EMPTY after reset.
    void PrintSumm (char *, int, int, int)
     Print a summary of the testing results.
    void StatInit (SuperLUStat_t *)
    void StatPrint (SuperLUStat_t *)
    void StatFree (SuperLUStat_t *)
    void print_panel_seg (int, int, int, int, int *, int *)
     Diagnostic print of segment info after panel_dfs().
    int print_int_vec (char *, int, int *)
    int slu_PrintInt10 (char *, int, int *)
    +


    Detailed Description

    +-- SuperLU routine (version 4.1) -- Univ. of California Berkeley, Xerox Palo Alto Research Center, and Lawrence Berkeley National Lab. November, 2010

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define ABORT (err_msg   ) 
    +
    +
    + +

    +Value:

    { char msg[256];\
    +   sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\
    +   USER_ABORT(msg); }
    +
    +
    +

    + +

    +
    + + + + + + + + + +
    #define CHECK_MALLOC (where   ) 
    +
    +
    + +

    +Value:

    {                 \
    +    extern int superlu_malloc_total;        \
    +    printf("%s: malloc_total %d Bytes\n",     \
    +           where, superlu_malloc_total); \
    +}
    +
    +
    +

    + +

    +
    + + + + +
    #define DROP_AREA   ( 0x0008 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_BASIC   ( 0x0001 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_COLUMN   ( 0x0004 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_DYNAMIC   ( 0x0010 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_INTERP   ( 0x0100 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_PROWS   ( 0x0002 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define DROP_SECONDARY   ( 0x000E )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define EMPTY   (-1)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define FALSE   0
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define FIRSTCOL_OF_SNODE (  )    (xsup[i])
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define GluIntArray (  )    (5 * (n) + 5)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define L_FST_SUPC (superno   )    ( Lstore->sup_to_col[superno] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define L_NZ_START (col   )    ( Lstore->nzval_colptr[col] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define L_SUB (ptr   )    ( Lstore->rowind[ptr] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define L_SUB_START (col   )    ( Lstore->rowind_colptr[col] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define MILU_ALPHA   (1.0e-2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define NO_MARKER   3
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define NO_MEMTYPE   4
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define NODROP   ( 0x0000 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    #define NUM_TEMPV (m,
    w,
    t,
     )    ( SUPERLU_MAX(m, (t + b)*w) )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define SUPERLU_FREE (addr   )    USER_FREE(addr)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define SUPERLU_MALLOC (size   )    USER_MALLOC(size)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define SUPERLU_MAX (x,
     )    ( (x) > (y) ? (x) : (y) )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define SUPERLU_MIN (x,
     )    ( (x) < (y) ? (x) : (y) )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    #define TRUE   1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define U_NZ_START (col   )    ( Ustore->colptr[col] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define U_SUB (ptr   )    ( Ustore->rowind[ptr] )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define USER_ABORT (msg   )    superlu_abort_and_exit(msg)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define USER_FREE (addr   )    superlu_free(addr)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define USER_MALLOC (size   )    superlu_malloc(size)
    +
    +
    + +

    + +

    +

    +


    Typedef Documentation

    + +
    +
    + + + + +
    typedef struct e_node ExpHeader
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    typedef float flops_t
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    typedef unsigned char Logical
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void check_repfnz (int ,
    int ,
    int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompCol_Matrix (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompCol_Permuted (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompRow_Matrix (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_Dense_Matrix (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_SuperMatrix_Store (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_SuperNode_Matrix (SuperMatrix  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void get_perm_c (int  ispec,
    SuperMatrix A,
    int *  perm_c 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     GET_PERM_C obtains a permutation matrix Pc, by applying the multiple
    + minimum degree ordering code by Joseph Liu to matrix A'*A or A+A'.
    + or using approximate minimum degree column ordering by Davis et. al.
    + The LU factorization of A*Pc tends to have less fill than the LU 
    + factorization of A.

    +

     Arguments
    + =========

    +

     ispec   (input) int
    +         Specifies the type of column ordering to reduce fill:
    +         = 1: minimum degree on the structure of A^T * A
    +         = 2: minimum degree on the structure of A^T + A
    +         = 3: approximate minimum degree for unsymmetric matrices
    +         If ispec == 0, the natural ordering (i.e., Pc = I) is returned.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A 
    +         can be: Stype = NC; Dtype = _D; Mtype = GE. In the future,
    +         more general A can be handled.

    +

     perm_c  (output) int*
    +	   Column permutation vector of size A->ncol, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void heap_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    +    the matrix has been reordered according to the postorder of the etree.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void ifill (int * ,
    int ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_heap_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end,
    int *  relax_fsupc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_heap_relax_snode() - Identify the initial relaxed supernodes,
    +    assuming that the matrix has been reordered according to the postorder
    +    of the etree.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end,
    int *  relax_fsupc 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_relax_snode() - Identify the initial relaxed supernodes, assuming
    +    that the matrix has been reordered according to the postorder of the
    +    etree.
    + 
    +
    +

    + +

    +
    + + + + + + + + + +
    void ilu_set_default_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int* intCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int* intMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int lsame_ (char *  ca,
    char *  cb 
    )
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        LSAME returns .TRUE. if CA is the same letter as CB regardless of case.

    +

        Arguments   
    +    =========

    +

        CA      (input) CHARACTER*1   
    +    CB      (input) CHARACTER*1   
    +            CA and CB specify the single characters to be compared.

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int mark_relax (int  n,
    int *  relax_end,
    int *  relax_fsupc,
    int *  xa_begin,
    int *  xa_end,
    int *  asub,
    int *  marker 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    mark_relax() - record the rows used by the relaxed supernodes.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_int_vec (char * ,
    int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void print_panel_seg (int ,
    int ,
    int ,
    int ,
    int * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintSumm (char * ,
    int ,
    int ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void relax_snode (const int  n,
    int *  et,
    const int  relax_columns,
    int *  descendants,
    int *  relax_end 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    +    the matrix has been reordered according to the postorder of the etree.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void resetrep_col (const   int,
    const int * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void set_default_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void SetIWork (int ,
    int ,
    int ,
    int * ,
    int ** ,
    int ** ,
    int ** ,
    int ** ,
    int ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int slu_PrintInt10 (char * ,
    int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void snode_profile (int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_coletree (int * ,
    int * ,
    int * ,
    int ,
    int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int sp_ienv (int  ispec  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        sp_ienv() is inquired to choose machine-dependent parameters for the
    +    local environment. See ISPEC for a description of the parameters.

    +

        This version provides a set of parameters which should give good,   
    +    but not optimal, performance on many of the currently available   
    +    computers.  Users are encouraged to modify this subroutine to set   
    +    the tuning parameters for their particular machine using the option   
    +    and problem size information in the arguments.

    +

        Arguments   
    +    =========

    +

        ISPEC   (input) int
    +            Specifies the parameter to be returned as the value of SP_IENV.   
    +            = 1: the panel size w; a panel consists of w consecutive
    +	         columns of matrix A in the process of Gaussian elimination.
    +		 The best value depends on machine's cache characters.
    +            = 2: the relaxation parameter relax; if the number of
    +	         nodes (columns) in a subtree of the elimination tree is less
    +		 than relax, this subtree is considered as one supernode,
    +		 regardless of their row structures.
    +            = 3: the maximum size for a supernode in complete LU;
    +	    = 4: the minimum row dimension for 2-D blocking to be used;
    +	    = 5: the minimum column dimension for 2-D blocking to be used;
    +	    = 6: the estimated fills factor for L and U, compared with A;
    +	    = 7: the maximum size for a supernode in ILU.

    +

       (SP_IENV) (output) int
    +            >= 0: the value of the parameter specified by ISPEC   
    +            < 0:  if SP_IENV = -k, the k-th argument had an illegal value.

    +

        ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sp_preorder (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  etree,
    SuperMatrix AC 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     sp_preorder() permutes the columns of the original matrix. It performs
    + the following steps:

    +

        1. Apply column permutation perm_c[] to A's column pointers to form AC;

    +

        2. If options->Fact = DOFACT, then
    +       (1) Compute column elimination tree etree[] of AC'AC;
    +       (2) Post order etree[] to get a postordered elimination tree etree[],
    +           and a postorder permutation post[];
    +       (3) Apply post[] permutation to columns of AC;
    +       (4) Overwrite perm_c[] with the product perm_c * post.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         Specifies whether or not the elimination tree will be re-used.
    +         If options->Fact == DOFACT, this means first time factor A, 
    +         etree is computed, postered, and output.
    +         Otherwise, re-factor A, etree is input, unchanged on exit.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = NC or SLU_NCP; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +	   Column permutation vector of size A->ncol, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.
    +         If options->Fact == DOFACT, perm_c is both input and output.
    +         On output, it is changed according to a postorder of etree.
    +         Otherwise, perm_c is input.

    +

     etree   (input/output) int*
    +         Elimination tree of Pc'*A'*A*Pc, dimension A->ncol.
    +         If options->Fact == DOFACT, etree is an output argument,
    +         otherwise it is an input argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     AC      (output) SuperMatrix*
    +         The resulting matrix after applied the column permutation
    +         perm_c[] to matrix A. The type of AC can be:
    +         Stype = SLU_NCP; Dtype = A->Dtype; Mtype = SLU_GE.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int spcoletree (int * ,
    int * ,
    int * ,
    int ,
    int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatFree (SuperLUStat_t  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatInit (SuperLUStat_t  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatPrint (SuperLUStat_t  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void super_stats (int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void superlu_abort_and_exit (char *   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void superlu_free (void *   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void* superlu_malloc (size_t  size  ) 
    +
    +
    + +

    +Precision-independent memory-related routines. (Shared by [sdcz]memory.c) +

    +

    + +

    +
    + + + + + + + + +
    double SuperLU_timer_ (  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int* TreePostorder (int ,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int xerbla_ (char * ,
    int *  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h-source.html new file mode 100644 index 0000000..f5fa790 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h-source.html @@ -0,0 +1,237 @@ + + +SuperLU: SRC/slu_zdefs.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h.html new file mode 100644 index 0000000..3190304 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/slu__zdefs_8h.html @@ -0,0 +1,6072 @@ + + +SuperLU: SRC/slu_zdefs.h File Reference + + + + + +
    +

    SRC/slu_zdefs.h File Reference

    Header file for real operations. More... +

    +#include <math.h>
    +#include <limits.h>
    +#include "slu_Cnames.h"
    +#include "supermatrix.h"
    +#include "slu_util.h"
    +#include "slu_dcomplex.h"
    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  GlobalLU_t

    Typedefs

    typedef int int_t

    Functions

    void zgssv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
     Driver routines.
    void zgssvx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, double *, double *, double *, double *, mem_usage_t *, SuperLUStat_t *, int *)
    void zgsisv (superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    void zgsisx (superlu_options_t *, SuperMatrix *, int *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, double *, double *, mem_usage_t *, SuperLUStat_t *, int *)
    void zCreate_CompCol_Matrix (SuperMatrix *, int, int, int, doublecomplex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
     Supernodal LU factor related.
    void zCreate_CompRow_Matrix (SuperMatrix *, int, int, int, doublecomplex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void zCopy_CompCol_Matrix (SuperMatrix *, SuperMatrix *)
     Copy matrix A into matrix B.
    void zCreate_Dense_Matrix (SuperMatrix *, int, int, doublecomplex *, int, Stype_t, Dtype_t, Mtype_t)
    void zCreate_SuperNode_Matrix (SuperMatrix *, int, int, int, doublecomplex *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
    void zCopy_Dense_Matrix (int, int, doublecomplex *, int, doublecomplex *, int)
    void countnz (const int, int *, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L.
    void ilu_countnz (const int, int *, int *, GlobalLU_t *)
     Count the total number of nonzeros in factors L and U.
    void fixupL (const int, const int *, GlobalLU_t *)
     Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts.
    void zallocateA (int, int, doublecomplex **, int **, int **)
     Allocate storage for original matrix A.
    void zgstrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int zsnode_dfs (const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
    int zsnode_bmod (const int, const int, const int, doublecomplex *, doublecomplex *, GlobalLU_t *, SuperLUStat_t *)
     Performs numeric block updates within the relaxed snode.
    void zpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, doublecomplex *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    void zpanel_bmod (const int, const int, const int, const int, doublecomplex *, doublecomplex *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    int zcolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int zcolumn_bmod (const int, const int, doublecomplex *, doublecomplex *, int *, int *, int, GlobalLU_t *, SuperLUStat_t *)
    int zcopy_to_ucol (int, int, int *, int *, int *, doublecomplex *, GlobalLU_t *)
    int zpivotL (const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *, SuperLUStat_t *)
    void zpruneL (const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
    void zreadmt (int *, int *, int *, doublecomplex **, int **, int **)
    void zGenXtrue (int, int, doublecomplex *, int)
    void zFillRHS (trans_t, int, doublecomplex *, int, SuperMatrix *, SuperMatrix *)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void zgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, SuperLUStat_t *, int *)
    void zgsitrf (superlu_options_t *, SuperMatrix *, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *)
    int zldperm (int, int, int, int[], int[], doublecomplex[], int[], double[], double[])
    int ilu_zsnode_dfs (const int, const int, const int *, const int *, const int *, int *, GlobalLU_t *)
    void ilu_zpanel_dfs (const int, const int, const int, SuperMatrix *, int *, int *, doublecomplex *, double *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_zcolumn_dfs (const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
    int ilu_zcopy_to_ucol (int, int, int *, int *, int *, doublecomplex *, int, milu_t, double, int, doublecomplex *, int *, GlobalLU_t *, double *)
    int ilu_zpivotL (const int, const double, int *, int *, int, int *, int *, int *, int *, double, milu_t, doublecomplex, GlobalLU_t *, SuperLUStat_t *)
    int ilu_zdrop_row (superlu_options_t *, int, int, double, int, int *, double *, GlobalLU_t *, double *, double *, int)
    void zgsequ (SuperMatrix *, double *, double *, double *, double *, double *, int *)
     Driver related.
    void zlaqgs (SuperMatrix *, double *, double *, double, double, double, char *)
    void zgscon (char *, SuperMatrix *, SuperMatrix *, double, double *, SuperLUStat_t *, int *)
    double zPivotGrowth (int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
    void zgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, double *, double *, SuperLUStat_t *, int *)
    int sp_ztrsv (char *, char *, char *, SuperMatrix *, SuperMatrix *, doublecomplex *, SuperLUStat_t *, int *)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_zgemv (char *, doublecomplex, SuperMatrix *, doublecomplex *, int, doublecomplex, doublecomplex *, int)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
    int sp_zgemm (char *, char *, int, int, int, doublecomplex, SuperMatrix *, doublecomplex *, int, doublecomplex, doublecomplex *, int)
    double dlamch_ (char *)
    int zLUMemInit (fact_t, void *, int, int, int, int, int, double, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, doublecomplex **)
     Memory-related.
    void zSetRWork (int, int, doublecomplex *, doublecomplex **, doublecomplex **)
     Set up pointers for real working arrays.
    void zLUWorkFree (int *, doublecomplex *, GlobalLU_t *)
     Free the working storage used by factor routines.
    int zLUMemXpand (int, int, MemType, int *, GlobalLU_t *)
     Expand the data structures for L and U during the factorization.
    doublecomplexdoublecomplexMalloc (int)
    doublecomplexdoublecomplexCalloc (int)
    double * doubleMalloc (int)
    double * doubleCalloc (int)
    int zmemory_usage (const int, const int, const int, const int)
    int zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    int ilu_zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *)
    void zreadhb (int *, int *, int *, doublecomplex **, int **, int **)
     Auxiliary routines.
    void zreadrb (int *, int *, int *, doublecomplex **, int **, int **)
    void zreadtriple (int *, int *, int *, doublecomplex **, int **, int **)
    void zCompRow_to_CompCol (int, int, int, doublecomplex *, int *, int *, doublecomplex **, int **, int **)
     Convert a row compressed storage into a column compressed storage.
    void zfill (doublecomplex *, int, doublecomplex)
     Fills a doublecomplex precision array with a given value.
    void zinf_norm_error (int, SuperMatrix *, doublecomplex *)
     Check the inf-norm of the error vector.
    void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, doublecomplex, doublecomplex, doublecomplex *, doublecomplex *, char *)
    double dqselect (int, double *, int)
    void zPrint_CompCol_Matrix (char *, SuperMatrix *)
     Routines for debugging.
    void zPrint_SuperNode_Matrix (char *, SuperMatrix *)
    void zPrint_Dense_Matrix (char *, SuperMatrix *)
    void zprint_lu_col (char *, int, int, int *, GlobalLU_t *)
     Diagnostic print of column "jcol" in the U/L factor.
    int print_double_vec (char *, int, double *)
    void check_tempv (int, doublecomplex *)
    +


    Detailed Description

    +
     
    + -- SuperLU routine (version 4.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November, 2010

    +

     Global data structures used in LU factorization -

    +

       nsuper: supernodes = nsuper + 1, numbered [0, nsuper].
    +   (xsup,supno): supno[i] is the supernode no to which i belongs;
    +	xsup(s) points to the beginning of the s-th supernode.
    +	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    +	        xsup 0 1 2 4 7 12
    +	Note: dfs will be performed on supernode rep. relative to the new 
    +	      row pivoting ordering

    +

       (xlsub,lsub): lsub[*] contains the compressed subscript of
    +	rectangular supernodes; xlsub[j] points to the starting
    +	location of the j-th column in lsub[*]. Note that xlsub 
    +	is indexed by column.
    +	Storage: original row subscripts

    +

          During the course of sparse LU factorization, we also use
    +	(xlsub,lsub) for the purpose of symmetric pruning. For each
    +	supernode {s,s+1,...,t=s+r} with first column s and last
    +	column t, the subscript set
    +		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    +	is the structure of column s (i.e. structure of this supernode).
    +	It is used for the storage of numerical values.
    +	Furthermore,
    +		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    +	is the structure of the last column t of this supernode.
    +	It is for the purpose of symmetric pruning. Therefore, the
    +	structural subscripts can be rearranged without making physical
    +	interchanges among the numerical values.

    +

    	However, if the supernode has only one column, then we
    +	only keep one set of subscripts. For any subscript interchange
    +	performed, similar interchange must be done on the numerical
    +	values.

    +

    	The last column structures (for pruning) will be removed
    +	after the numercial LU factorization phase.

    +

       (xlusup,lusup): lusup[*] contains the numerical values of the
    +	rectangular supernodes; xlusup[j] points to the starting
    +	location of the j-th column in storage vector lusup[*]
    +	Note: xlusup is indexed by column.
    +	Each rectangular supernode is stored by column-major
    +	scheme, consistent with Fortran 2-dim array storage.

    +

       (xusub,ucol,usub): ucol[*] stores the numerical values of
    +	U-columns outside the rectangular supernodes. The row
    +	subscript of nonzero ucol[k] is stored in usub[k].
    +	xusub[i] points to the starting location of column i in ucol.
    +	Storage: new row subscripts; that is subscripts of PA.
    + 

    Typedef Documentation

    + +
    +
    + + + + +
    typedef int int_t
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void check_tempv (int ,
    doublecomplex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void countnz (const   int,
    int * ,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double dlamch_ (char *  cmach  ) 
    +
    +
    + +

    +

    +    Purpose   
    +    =======

    +

        DLAMCH determines double precision machine parameters.

    +

        Arguments   
    +    =========

    +

        CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by DLAMCH:   
    +            = 'E' or 'e',   DLAMCH := eps   
    +            = 'S' or 's ,   DLAMCH := sfmin   
    +            = 'B' or 'b',   DLAMCH := base   
    +            = 'P' or 'p',   DLAMCH := eps*base   
    +            = 'N' or 'n',   DLAMCH := t   
    +            = 'R' or 'r',   DLAMCH := rnd   
    +            = 'M' or 'm',   DLAMCH := emin   
    +            = 'U' or 'u',   DLAMCH := rmin   
    +            = 'L' or 'l',   DLAMCH := emax   
    +            = 'O' or 'o',   DLAMCH := rmax

    +

                where

    +

                eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)

    +

       ===================================================================== 
    +
    +
    +

    + +

    +
    + + + + + + + + + +
    double* doubleCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex* doublecomplexCalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex* doublecomplexMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    double* doubleMalloc (int   ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dqselect (int ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void fixupL (const   int,
    const int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_countnz (const   int,
    int * ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ILU_ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zcopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    doublecomplex,
    int ,
    milu_t ,
    double ,
    int ,
    doublecomplex,
    int * ,
    GlobalLU_t,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zdrop_row (superlu_options_t,
    int ,
    int ,
    double ,
    int ,
    int * ,
    double * ,
    GlobalLU_t,
    double * ,
    double * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_zpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    doublecomplex dense,
    double *  amax,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel.
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int  diagind,
    int *  swap,
    int *  iswap,
    int *  marker,
    int *  pivrow,
    double  fill_tol,
    milu_t  milu,
    doublecomplex  drop_sum,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +	     pivot row = k;
    +	 ELSE IF abs(A_jj) >= thresh THEN
    +	     pivot row = j;
    +	 ELSE
    +	     pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0	  success;
    +		   i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ilu_zsnode_dfs() - Determine the union of the row structures of those
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_double_vec (char * ,
    int ,
    double *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintPerf (SuperMatrix,
    SuperMatrix,
    mem_usage_t,
    doublecomplex ,
    doublecomplex ,
    doublecomplex,
    doublecomplex,
    char *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_zgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    doublecomplex  alpha,
    SuperMatrix A,
    doublecomplex b,
    int  ldb,
    doublecomplex  beta,
    doublecomplex c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_z performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) doublecomplex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_Z; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) doublecomplex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_zgemv (char *  trans,
    doublecomplex  alpha,
    SuperMatrix A,
    doublecomplex x,
    int  incx,
    doublecomplex  beta,
    doublecomplex y,
    int  incy 
    )
    +
    +
    + +

    +

      
    +   Purpose   
    +   =======

    +

       sp_zgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) doublecomplex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Before entry, the leading m by n part of the array A must   
    +            contain the matrix of coefficients.

    +

       X      - (input) doublecomplex*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +           and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) doublecomplex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) doublecomplex*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

        ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_ztrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    doublecomplex x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_ztrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A^H*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_Z, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_Z, Mtype = TRU.

    +

       x       - (input/output) doublecomplex*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zallocateA (int ,
    int ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcolumn_bmod (const int  jcol,
    const int  nseg,
    doublecomplex dense,
    doublecomplex tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCompRow_to_CompCol (int ,
    int ,
    int ,
    doublecomplex,
    int * ,
    int * ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zCopy_CompCol_Matrix (SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCopy_Dense_Matrix (int ,
    int ,
    doublecomplex,
    int ,
    doublecomplex,
    int  
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcopy_to_ucol (int ,
    int ,
    int * ,
    int * ,
    int * ,
    doublecomplex,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_CompCol_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    doublecomplex,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_CompRow_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    doublecomplex,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_Dense_Matrix (SuperMatrix,
    int ,
    int ,
    doublecomplex,
    int ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_SuperNode_Matrix (SuperMatrix,
    int ,
    int ,
    int ,
    doublecomplex,
    int * ,
    int * ,
    int * ,
    int * ,
    int * ,
    Stype_t ,
    Dtype_t ,
    Mtype_t  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zfill (doublecomplex,
    int ,
    doublecomplex  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zFillRHS (trans_t ,
    int ,
    doublecomplex,
    int ,
    SuperMatrix,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zGenXtrue (int ,
    int ,
    doublecomplex,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    double  anorm,
    double *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by ZGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            zgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            zgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

        ANORM   (input) double
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) double*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsequ (SuperMatrix A,
    double *  r,
    double *  c,
    double *  rowcnd,
    double *  colcnd,
    double *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       ZGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_Z; Mtype = SLU_GE.

    +

       R       (output) double*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) double*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) double*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) double*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) double*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsisv (superlu_options_t,
    SuperMatrix,
    int * ,
    int * ,
    SuperMatrix,
    SuperMatrix,
    SuperMatrix,
    SuperLUStat_t,
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from zgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, zgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) double*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) double*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix B,
    SuperMatrix X,
    double *  ferr,
    double *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           zgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by zgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) double*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) double*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from ZGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_Z; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    double *  ferr,
    double *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from zgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) double*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) double*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) double*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) double*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see zpanel_dfs.c; marker2 is used for inner-factorization,
    +            see zcolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during zpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_zdefs.h.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + ZGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         zgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         zgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zinf_norm_error (int ,
    SuperMatrix,
    doublecomplex 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlaqgs (SuperMatrix A,
    double *  r,
    double *  c,
    double  rowcnd,
    double  colcnd,
    double  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_Z; Mtype = GE.

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) double
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) double
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) double
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zldperm (int ,
    int ,
    int ,
    int [],
    int [],
    doublecomplex [],
    int [],
    double [],
    double [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    double  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    doublecomplex **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zLUWorkFree (int * ,
    doublecomplex,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zmemory_usage (const   int,
    const   int,
    const   int,
    const   int 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    doublecomplex dense,
    doublecomplex tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    doublecomplex dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double zPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_Z; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_Z; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_Z; Mtype = TRU.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_CompCol_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_Dense_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zprint_lu_col (char * ,
    int ,
    int ,
    int * ,
    GlobalLU_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_SuperNode_Matrix (char * ,
    SuperMatrix 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int zQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadhb (int * ,
    int * ,
    int * ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadmt (int * ,
    int * ,
    int * ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadrb (int * ,
    int * ,
    int * ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadtriple (int * ,
    int * ,
    int * ,
    doublecomplex ** ,
    int ** ,
    int **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zSetRWork (int ,
    int ,
    doublecomplex,
    doublecomplex ** ,
    doublecomplex **  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zsnode_bmod (const   int,
    const   int,
    const   int,
    doublecomplex,
    doublecomplex,
    GlobalLU_t,
    SuperLUStat_t 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    zsnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/smemory_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/smemory_8c.html new file mode 100644 index 0000000..27902a9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/smemory_8c.html @@ -0,0 +1,976 @@ + + +SuperLU: SRC/smemory.c File Reference + + + + + +
    +

    SRC/smemory.c File Reference

    Memory details. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define StackFull(x)   ( x + Glu->stack.used >= Glu->stack.size )
    #define NotDoubleAlign(addr)   ( (long int)addr & 7 )
    #define DoubleAlign(addr)   ( ((long int)addr + 7) & ~7L )
    #define TempSpace(m, w)
    #define Reduce(alpha)   ((alpha + 1) / 2)

    Functions

    void * sexpand (int *prev_len,MemType type,int len_to_copy,int keep_prev,GlobalLU_t *Glu)
     Expand the existing storage to accommodate more fill-ins.
    int sLUWorkInit (int m, int n, int panel_size, int **iworkptr, float **dworkptr, GlobalLU_t *Glu)
     Allocate known working storage. Returns 0 if success, otherwise returns the number of bytes allocated so far when failure occurred.
    void copy_mem_float (int, void *, void *)
    void sStackCompress (GlobalLU_t *Glu)
     Compress the work[] array to remove fragmentation.
    void sSetupSpace (void *work, int lwork, GlobalLU_t *Glu)
     Setup the memory model to be used for factorization.
    void * suser_malloc (int, int, GlobalLU_t *)
    void suser_free (int, int, GlobalLU_t *)
    void copy_mem_int (int, void *, void *)
    void user_bcopy (char *, char *, int)
    int sQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int ilu_sQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int sLUMemInit (fact_t fact, void *work, int lwork, int m, int n, int annz, int panel_size, float fill_ratio, SuperMatrix *L, SuperMatrix *U, GlobalLU_t *Glu, int **iwork, float **dwork)
     Allocate storage for the data structures common to all factor routines.
    void sSetRWork (int m, int panel_size, float *dworkptr, float **dense, float **tempv)
     Set up pointers for real working arrays.
    void sLUWorkFree (int *iwork, float *dwork, GlobalLU_t *Glu)
     Free the working storage used by factor routines.
    int sLUMemXpand (int jcol, int next, MemType mem_type, int *maxlen, GlobalLU_t *Glu)
     Expand the data structures for L and U during the factorization.
    void sallocateA (int n, int nnz, float **a, int **asub, int **xa)
     Allocate storage for original matrix A.
    float * floatMalloc (int n)
    float * floatCalloc (int n)
    int smemory_usage (const int nzlmax, const int nzumax, const int nzlumax, const int n)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define DoubleAlign (addr   )    ( ((long int)addr + 7) & ~7L )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define NotDoubleAlign (addr   )    ( (long int)addr & 7 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define Reduce (alpha   )    ((alpha + 1) / 2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define StackFull (  )    ( x + Glu->stack.used >= Glu->stack.size )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define TempSpace (m,
     ) 
    +
    +
    + +

    +Value:

    ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
    +                              (w + 1) * m * sizeof(float) )
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_float (int  howmany,
    void *  old,
    void *  new 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_int (int ,
    void * ,
    void *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatCalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    float* floatMalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_sQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sallocateA (int  n,
    int  nnz,
    float **  a,
    int **  asub,
    int **  xa 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void * sexpand (int *  prev_len,
    MemType  type,
    int  len_to_copy,
    int  keep_prev,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    float  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    float **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sLUWorkFree (int *  iwork,
    float *  dwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sLUWorkInit (int  m,
    int  n,
    int  panel_size,
    int **  iworkptr,
    float **  dworkptr,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int smemory_usage (const int  nzlmax,
    const int  nzumax,
    const int  nzlumax,
    const int  n 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int sQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sSetRWork (int  m,
    int  panel_size,
    float *  dworkptr,
    float **  dense,
    float **  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sSetupSpace (void *  work,
    int  lwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +lwork = 0: use system malloc; lwork > 0: use user-supplied work[] space. +

    +

    + +

    +
    + + + + + + + + + +
    void sStackCompress (GlobalLU_t Glu  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void suser_free (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void * suser_malloc (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_bcopy (char * ,
    char * ,
    int  
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/smyblas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/smyblas2_8c.html new file mode 100644 index 0000000..e6809d3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/smyblas2_8c.html @@ -0,0 +1,180 @@ + + +SuperLU: SRC/smyblas2.c File Reference + + + + + +
    +

    SRC/smyblas2.c File Reference

    Level 2 Blas operations. More... +

    + + + + + + + + + + + + +

    Functions

    void slsolve (int ldm, int ncol, float *M, float *rhs)
     Solves a dense UNIT lower triangular system.
    void susolve (int ldm, int ncol, float *M, float *rhs)
     Solves a dense upper triangular system.
    void smatvec (int ldm, int nrow, int ncol, float *M, float *vec, float *Mxvec)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 
    Purpose: Level 2 BLAS operations: solves and matvec, written in C. Note: This is only used when the system lacks an efficient BLAS library.

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slsolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec (int  ldm,
    int  nrow,
    int  ncol,
    float *  M,
    float *  vec,
    float *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void susolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__coletree_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__coletree_8c.html new file mode 100644 index 0000000..f8a97fa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__coletree_8c.html @@ -0,0 +1,460 @@ + + +SuperLU: SRC/sp_coletree.c File Reference + + + + + +
    +

    SRC/sp_coletree.c File Reference

    Tree layout and computation routines. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    static int * mxCallocInt (int n)
    static void initialize_disjoint_sets (int n, int **pp)
    static int make_set (int i, int *pp)
    static int link (int s, int t, int *pp)
    static int find (int i, int *pp)
    static void finalize_disjoint_sets (int *pp)
    int sp_coletree (int *acolst, int *acolend, int *arow, int nr, int nc, int *parent)
    static void etdfs (int v, int first_kid[], int next_kid[], int post[], int *postnum)
    static void nr_etdfs (int n, int *parent, int *first_kid, int *next_kid, int *post, int postnum)
    int * TreePostorder (int n, int *parent)
    int sp_symetree (int *acolst, int *acolend, int *arow, int n, int *parent)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static void etdfs (int  v,
    int  first_kid[],
    int  next_kid[],
    int  post[],
    int *  postnum 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    static void finalize_disjoint_sets (int *  pp  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    static int find (int  i,
    int *  pp 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    static void initialize_disjoint_sets (int  n,
    int **  pp 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int link (int  s,
    int  t,
    int *  pp 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    static int make_set (int  i,
    int *  pp 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    static int* mxCallocInt (int  n  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static void nr_etdfs (int  n,
    int *  parent,
    int *  first_kid,
    int *  next_kid,
    int *  post,
    int  postnum 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_coletree (int *  acolst,
    int *  acolend,
    int *  arow,
    int  nr,
    int  nc,
    int *  parent 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_symetree (int *  acolst,
    int *  acolend,
    int *  arow,
    int  n,
    int *  parent 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int* TreePostorder (int  n,
    int *  parent 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__preorder_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__preorder_8c.html new file mode 100644 index 0000000..b97d1c9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sp__preorder_8c.html @@ -0,0 +1,159 @@ + + +SuperLU: SRC/sp_preorder.c File Reference + + + + + +
    +

    SRC/sp_preorder.c File Reference

    Permute and performs functions on columns of orginal matrix. More... +

    +#include "slu_ddefs.h"
    + + + + + + + +

    Functions

    void sp_preorder (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *etree, SuperMatrix *AC)
    int check_perm (char *what, int n, int *perm)
    +


    Detailed Description

    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int check_perm (char *  what,
    int  n,
    int *  perm 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sp_preorder (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  etree,
    SuperMatrix AC 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     sp_preorder() permutes the columns of the original matrix. It performs
    + the following steps:

    +

        1. Apply column permutation perm_c[] to A's column pointers to form AC;

    +

        2. If options->Fact = DOFACT, then
    +       (1) Compute column elimination tree etree[] of AC'AC;
    +       (2) Post order etree[] to get a postordered elimination tree etree[],
    +           and a postorder permutation post[];
    +       (3) Apply post[] permutation to columns of AC;
    +       (4) Overwrite perm_c[] with the product perm_c * post.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         Specifies whether or not the elimination tree will be re-used.
    +         If options->Fact == DOFACT, this means first time factor A, 
    +         etree is computed, postered, and output.
    +         Otherwise, re-factor A, etree is input, unchanged on exit.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = NC or SLU_NCP; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +	   Column permutation vector of size A->ncol, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.
    +         If options->Fact == DOFACT, perm_c is both input and output.
    +         On output, it is changed according to a postorder of etree.
    +         Otherwise, perm_c is input.

    +

     etree   (input/output) int*
    +         Elimination tree of Pc'*A'*A*Pc, dimension A->ncol.
    +         If options->Fact == DOFACT, etree is an output argument,
    +         otherwise it is an input argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     AC      (output) SuperMatrix*
    +         The resulting matrix after applied the column permutation
    +         perm_c[] to matrix A. The type of AC can be:
    +         Stype = SLU_NCP; Dtype = A->Dtype; Mtype = SLU_GE.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__bmod_8c.html new file mode 100644 index 0000000..29f2c41 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__bmod_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/spanel_bmod.c File Reference + + + + + +
    +

    SRC/spanel_bmod.c File Reference

    Performs numeric block updates. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + +

    Functions

    void slsolve (int, int, float *, float *)
     Solves a dense UNIT lower triangular system.
    void smatvec (int, int, int, float *, float *, float *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void scheck_tempv ()
    void spanel_bmod (const int m, const int w, const int jcol, const int nseg, float *dense, float *tempv, int *segrep, int *repfnz, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + +
    void scheck_tempv (  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slsolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec (int  ldm,
    int  nrow,
    int  ncol,
    float *  M,
    float *  vec,
    float *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    float *  dense,
    float *  tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__dfs_8c.html new file mode 100644 index 0000000..bc46399 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/spanel__dfs_8c.html @@ -0,0 +1,175 @@ + + +SuperLU: SRC/spanel_dfs.c File Reference + + + + + +
    +

    SRC/spanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void spanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, float *dense, int *panel_lsub, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    float *  dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotL_8c.html new file mode 100644 index 0000000..a816b4c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotL_8c.html @@ -0,0 +1,136 @@ + + +SuperLU: SRC/spivotL.c File Reference + + + + + +
    +

    SRC/spivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int spivotL (const int jcol, const double u, int *usepr, int *perm_r, int *iperm_r, int *iperm_c, int *pivrow, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int spivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotgrowth_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotgrowth_8c.html new file mode 100644 index 0000000..7eede46 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/spivotgrowth_8c.html @@ -0,0 +1,109 @@ + + +SuperLU: SRC/spivotgrowth.c File Reference + + + + + +
    +

    SRC/spivotgrowth.c File Reference

    Computes the reciprocal pivot growth factor. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    float sPivotGrowth (int ncols, SuperMatrix *A, int *perm_c, SuperMatrix *L, SuperMatrix *U)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float sPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_S; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_S; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_S; Mtype = TRU.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/spruneL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/spruneL_8c.html new file mode 100644 index 0000000..e964e11 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/spruneL_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/spruneL.c File Reference + + + + + +
    +

    SRC/spruneL.c File Reference

    Prunes the L-structure. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    void spruneL (const int jcol, const int *perm_r, const int pivrow, const int nseg, const int *segrep, const int *repfnz, int *xprune, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + *

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void spruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadhb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadhb_8c.html new file mode 100644 index 0000000..dd3a415 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadhb_8c.html @@ -0,0 +1,344 @@ + + +SuperLU: SRC/sreadhb.c File Reference + + + + + +
    +

    SRC/sreadhb.c File Reference

    Read a matrix stored in Harwell-Boeing format. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + +

    Functions

    int sDumpLine (FILE *fp)
     Eat up the rest of the current line.
    int sParseIntFormat (char *buf, int *num, int *size)
    int sParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    int sReadValues (FILE *fp, int n, float *destination, int perline, int persize)
    void sreadhb (int *nrow, int *ncol, int *nonz, float **nzval, int **rowind, int **colptr)
     Auxiliary routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Purpose
    + =======

    +

     Read a FLOAT PRECISION matrix stored in Harwell-Boeing format 
    + as described below.

    +

     Line 1 (A72,A8) 
    +  	Col. 1 - 72   Title (TITLE) 
    +	Col. 73 - 80  Key (KEY)

    +

     Line 2 (5I14) 
    + 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    +	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    +                    (including starting guesses and solution vectors 
    +		       if present) 
    +           	      (zero indicates no right-hand side data is present)

    +

     Line 3 (A3, 11X, 4I14) 
    +   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    +	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    +	              (equal to number of entries for assembled matrices) 
    + 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    +	              (zero in the case of assembled matrices) 
    + Line 4 (2A16, 2A20) 
    + 	Col. 1 - 16   Format for pointers (PTRFMT) 
    +	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    +	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

    +

     Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    +    	Col. 1 	      Right-hand side type: 
    +	         	  F for full storage or M for same format as matrix 
    +    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    +    	Col. 3        X if an exact solution vector(s) is supplied. 
    +	Col. 15 - 28  Number of right-hand sides (NRHS) 
    +	Col. 29 - 42  Number of row indices (NRHSIX) 
    +          	      (ignored in case of unassembled matrices)

    +

     The three character type field on line 3 describes the matrix type. 
    + The following table lists the permitted values for each of the three 
    + characters. As an example of the type field, RSA denotes that the matrix 
    + is real, symmetric, and assembled.

    +

     First Character: 
    +	R Real matrix 
    +	C Complex matrix 
    +	P Pattern only (no numerical values supplied)

    +

     Second Character: 
    +	S Symmetric 
    +	U Unsymmetric 
    +	H Hermitian 
    +	Z Skew symmetric 
    +	R Rectangular

    +

     Third Character: 
    +	A Assembled 
    +	E Elemental matrices (unassembled)

    +

     

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int sDumpLine (FILE *  fp  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int sParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int sParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadhb (int *  nrow,
    int *  ncol,
    int *  nonz,
    float **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sReadValues (FILE *  fp,
    int  n,
    float *  destination,
    int  perline,
    int  persize 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadrb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadrb_8c.html new file mode 100644 index 0000000..e6f9e9a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadrb_8c.html @@ -0,0 +1,301 @@ + + +SuperLU: SRC/sreadrb.c File Reference + + + + + +
    +

    SRC/sreadrb.c File Reference

    Read a matrix stored in Rutherford-Boeing format. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    static int sDumpLine (FILE *fp)
     Eat up the rest of the current line.
    static int sParseIntFormat (char *buf, int *num, int *size)
    static int sParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    static int sReadValues (FILE *fp, int n, float *destination, int perline, int persize)
    void sreadrb (int *nrow, int *ncol, int *nonz, float **nzval, int **rowind, int **colptr)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    +Purpose =======

    +Read a FLOAT PRECISION matrix stored in Rutherford-Boeing format as described below.

    +Line 1 (A72, A8) Col. 1 - 72 Title (TITLE) Col. 73 - 80 Matrix name / identifier (MTRXID)

    +Line 2 (I14, 3(1X, I13)) Col. 1 - 14 Total number of lines excluding header (TOTCRD) Col. 16 - 28 Number of lines for pointers (PTRCRD) Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) Col. 44 - 56 Number of lines for numerical values (VALCRD)

    +Line 3 (A3, 11X, 4(1X, I13)) Col. 1 - 3 Matrix type (see below) (MXTYPE) Col. 15 - 28 Compressed Column: Number of rows (NROW) Elemental: Largest integer used to index variable (MVAR) Col. 30 - 42 Compressed Column: Number of columns (NCOL) Elemental: Number of element matrices (NELT) Col. 44 - 56 Compressed Column: Number of entries (NNZERO) Elemental: Number of variable indeces (NVARIX) Col. 58 - 70 Compressed Column: Unused, explicitly zero Elemental: Number of elemental matrix entries (NELTVL)

    +Line 4 (2A16, A20) Col. 1 - 16 Fortran format for pointers (PTRFMT) Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) Col. 33 - 52 Fortran format for numerical values of coefficient matrix (VALFMT) (blank in the case of matrix patterns)

    +The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.

    +First Character: R Real matrix C Complex matrix I integer matrix P Pattern only (no numerical values supplied) Q Pattern only (numerical values supplied in associated auxiliary value file)

    +Second Character: S Symmetric U Unsymmetric H Hermitian Z Skew symmetric R Rectangular

    +Third Character: A Compressed column form E Elemental form

    +

    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    static int sDumpLine (FILE *  fp  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int sParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int sParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadrb (int *  nrow,
    int *  ncol,
    int *  nonz,
    float **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int sReadValues (FILE *  fp,
    int  n,
    float *  destination,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadtriple_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadtriple_8c.html new file mode 100644 index 0000000..7236256 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sreadtriple_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: SRC/sreadtriple.c File Reference + + + + + +
    +

    SRC/sreadtriple.c File Reference

    #include "slu_sdefs.h"
    + + + + + + + +

    Functions

    void sreadtriple (int *m, int *n, int *nonz, float **nzval, int **rowind, int **colptr)
    void sreadrhs (int m, float *b)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    void sreadrhs (int  m,
    float *  b 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sreadtriple (int *  m,
    int *  n,
    int *  nonz,
    float **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__bmod_8c.html new file mode 100644 index 0000000..d8a2f9f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__bmod_8c.html @@ -0,0 +1,107 @@ + + +SuperLU: SRC/ssnode_bmod.c File Reference + + + + + +
    +

    SRC/ssnode_bmod.c File Reference

    Performs numeric block updates within the relaxed snode. More... +

    +#include "slu_sdefs.h"
    + + + + + + +

    Functions

    int ssnode_bmod (const int jcol, const int jsupno, const int fsupc, float *dense, float *tempv, GlobalLU_t *Glu, SuperLUStat_t *stat)
     Performs numeric block updates within the relaxed snode.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ssnode_bmod (const int  jcol,
    const int  jsupno,
    const int  fsupc,
    float *  dense,
    float *  tempv,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__dfs_8c.html new file mode 100644 index 0000000..54f7dda --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssnode__dfs_8c.html @@ -0,0 +1,123 @@ + + +SuperLU: SRC/ssnode_dfs.c File Reference + + + + + +
    +

    SRC/ssnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int ssnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *xprune, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int ssnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    ssnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas2_8c.html new file mode 100644 index 0000000..02c1b73 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas2_8c.html @@ -0,0 +1,403 @@ + + +SuperLU: SRC/ssp_blas2.c File Reference + + + + + +
    +

    SRC/ssp_blas2.c File Reference

    Sparse BLAS 2, using some dense BLAS 2 operations. More... +

    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    void susolve (int, int, float *, float *)
     Solves a dense upper triangular system.
    void slsolve (int, int, float *, float *)
     Solves a dense UNIT lower triangular system.
    void smatvec (int, int, int, float *, float *, float *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int sp_strsv (char *uplo, char *trans, char *diag, SuperMatrix *L, SuperMatrix *U, float *x, SuperLUStat_t *stat, int *info)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_sgemv (char *trans, float alpha, SuperMatrix *A, float *x, int incx, float beta, float *y, int incy)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void slsolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void smatvec (int  ldm,
    int  nrow,
    int  ncol,
    float *  M,
    float *  vec,
    float *  Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_sgemv (char *  trans,
    float  alpha,
    SuperMatrix A,
    float *  x,
    int  incx,
    float  beta,
    float *  y,
    int  incy 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       sp_sgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) float
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       X      - (input) float*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) float
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) float*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

       ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_strsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    float *  x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_strsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A'*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_S, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_S, Mtype = TRU.

    +

       x       - (input/output) float*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void susolve (int  ldm,
    int  ncol,
    float *  M,
    float *  rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas3_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas3_8c.html new file mode 100644 index 0000000..bbc884c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/ssp__blas3_8c.html @@ -0,0 +1,199 @@ + + +SuperLU: SRC/ssp_blas3.c File Reference + + + + + +
    +

    SRC/ssp_blas3.c File Reference

    Sparse BLAS3, using some dense BLAS3 operations. More... +

    +#include "slu_sdefs.h"
    + + + + + +

    Functions

    int sp_sgemm (char *transa, char *transb, int m, int n, int k, float alpha, SuperMatrix *A, float *b, int ldb, float beta, float *c, int ldc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_sgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    float  alpha,
    SuperMatrix A,
    float *  b,
    int  ldb,
    float  beta,
    float *  c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_s performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) float
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - FLOAT PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) float
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - FLOAT PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Col__struct.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Col__struct.html new file mode 100644 index 0000000..97b88ae --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Col__struct.html @@ -0,0 +1,301 @@ + + +SuperLU: Colamd_Col_struct Struct Reference + + + + + +
    +

    Colamd_Col_struct Struct Reference

    #include <colamd.h> +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Fields

    int start
    int length
    union {
       int   thickness
       int   parent
    shared1
    union {
       int   score
       int   order
    shared2
    union {
       int   headhash
       int   hash
       int   prev
    shared3
    union {
       int   degree_next
       int   hash_next
    shared4
    +


    Field Documentation

    + +
    +
    + + + + +
    int Colamd_Col_struct::start
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::length
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::parent
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Col_struct::shared1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::score
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::order
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Col_struct::shared2
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::hash
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Col_struct::prev
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Col_struct::shared3
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Col_struct::shared4
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Row__struct.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Row__struct.html new file mode 100644 index 0000000..9803855 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structColamd__Row__struct.html @@ -0,0 +1,178 @@ + + +SuperLU: Colamd_Row_struct Struct Reference + + + + + +
    +

    Colamd_Row_struct Struct Reference

    #include <colamd.h> +

    + + + + + + + + + + + + + + + + + + + + + + + +

    Data Fields

    int start
    int length
    union {
       int   degree
       int   p
    shared1
    union {
       int   mark
       int   first_column
    shared2
    +


    Field Documentation

    + +
    +
    + + + + +
    int Colamd_Row_struct::start
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Row_struct::length
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Row_struct::degree
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Row_struct::p
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Row_struct::shared1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int Colamd_Row_struct::mark
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    union { ... } Colamd_Row_struct::shared2
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structDNformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structDNformat.html new file mode 100644 index 0000000..5d3f2e0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structDNformat.html @@ -0,0 +1,72 @@ + + +SuperLU: DNformat Struct Reference + + + + + +
    +

    DNformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + +

    Data Fields

    int_t lda
    void * nzval
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t DNformat::lda
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* DNformat::nzval
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structGlobalLU__t.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structGlobalLU__t.html new file mode 100644 index 0000000..3dfd833 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structGlobalLU__t.html @@ -0,0 +1,837 @@ + + +SuperLU: GlobalLU_t Struct Reference + + + + + +
    +

    GlobalLU_t Struct Reference

    #include <slu_cdefs.h> +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Fields

    int * xsup
    int * supno
    int * lsub
    int * xlsub
    complexlusup
    int * xlusup
    complexucol
    int * usub
    int * xusub
    int nzlmax
    int nzumax
    int nzlumax
    int n
    LU_space_t MemModel
    int num_expansions
    ExpHeaderexpanders
    LU_stack_t stack
    int * xsup
    int * supno
    int * lsub
    int * xlsub
    double * lusup
    int * xlusup
    double * ucol
    int * usub
    int * xusub
    ExpHeaderexpanders
    int * xsup
    int * supno
    int * lsub
    int * xlsub
    float * lusup
    int * xlusup
    float * ucol
    int * usub
    int * xusub
    ExpHeaderexpanders
    int * xsup
    int * supno
    int * lsub
    int * xlsub
    doublecomplexlusup
    int * xlusup
    doublecomplexucol
    int * usub
    int * xusub
    ExpHeaderexpanders
    +


    Field Documentation

    + +
    +
    + + + + +
    int* GlobalLU_t::xsup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::supno
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::lsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlsub
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlusup
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::usub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xusub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int GlobalLU_t::nzlmax
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int GlobalLU_t::nzumax
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int GlobalLU_t::nzlumax
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int GlobalLU_t::n
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xsup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::supno
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::lsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    double* GlobalLU_t::lusup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlusup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    double* GlobalLU_t::ucol
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::usub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xusub
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xsup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::supno
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::lsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    float* GlobalLU_t::lusup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlusup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    float* GlobalLU_t::ucol
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::usub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xusub
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xsup
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::supno
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::lsub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlsub
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xlusup
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::usub
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GlobalLU_t::xusub
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following files: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structLU__stack__t.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structLU__stack__t.html new file mode 100644 index 0000000..cc25a5b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structLU__stack__t.html @@ -0,0 +1,123 @@ + + +SuperLU: LU_stack_t Struct Reference + + + + + +
    +

    LU_stack_t Struct Reference

    #include <slu_util.h> +

    + + + + + + + + + + + + + +

    Data Fields

    int size
    int used
    int top1
    int top2
    void * array
    +


    Field Documentation

    + +
    +
    + + + + +
    int LU_stack_t::size
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int LU_stack_t::used
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int LU_stack_t::top1
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int LU_stack_t::top2
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* LU_stack_t::array
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCPformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCPformat.html new file mode 100644 index 0000000..e3b756e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCPformat.html @@ -0,0 +1,123 @@ + + +SuperLU: NCPformat Struct Reference + + + + + +
    +

    NCPformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + + + +

    Data Fields

    int_t nnz
    void * nzval
    int_trowind
    int_tcolbeg
    int_tcolend
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t NCPformat::nnz
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* NCPformat::nzval
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NCPformat::rowind
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NCPformat::colbeg
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NCPformat::colend
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCformat.html new file mode 100644 index 0000000..63e11df --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNCformat.html @@ -0,0 +1,106 @@ + + +SuperLU: NCformat Struct Reference + + + + + +
    +

    NCformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + +

    Data Fields

    int_t nnz
    void * nzval
    int_trowind
    int_tcolptr
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t NCformat::nnz
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* NCformat::nzval
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NCformat::rowind
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NCformat::colptr
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat.html new file mode 100644 index 0000000..50feabe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat.html @@ -0,0 +1,106 @@ + + +SuperLU: NRformat Struct Reference + + + + + +
    +

    NRformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + +

    Data Fields

    int_t nnz
    void * nzval
    int_tcolind
    int_trowptr
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t NRformat::nnz
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* NRformat::nzval
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NRformat::colind
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* NRformat::rowptr
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat__loc.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat__loc.html new file mode 100644 index 0000000..1335add --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structNRformat__loc.html @@ -0,0 +1,140 @@ + + +SuperLU: NRformat_loc Struct Reference + + + + + +
    +

    NRformat_loc Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + + + + + +

    Data Fields

    int_t nnz_loc
    int_t m_loc
    int_t fst_row
    void * nzval
    int_trowptr
    int_tcolind
    +


    Field Documentation

    + +
    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* NRformat_loc::nzval
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCPformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCPformat.html new file mode 100644 index 0000000..7a3014d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCPformat.html @@ -0,0 +1,225 @@ + + +SuperLU: SCPformat Struct Reference + + + + + +
    +

    SCPformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Fields

    int_t nnz
    int_t nsuper
    void * nzval
    int_tnzval_colbeg
    int_tnzval_colend
    int_trowind
    int_trowind_colbeg
    int_trowind_colend
    int_tcol_to_sup
    int_tsup_to_colbeg
    int_tsup_to_colend
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t SCPformat::nnz
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* SCPformat::nzval
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* SCPformat::rowind
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCformat.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCformat.html new file mode 100644 index 0000000..7aa6b76 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSCformat.html @@ -0,0 +1,174 @@ + + +SuperLU: SCformat Struct Reference + + + + + +
    +

    SCformat Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + + + + + + + + + +

    Data Fields

    int_t nnz
    int_t nsuper
    void * nzval
    int_tnzval_colptr
    int_trowind
    int_trowind_colptr
    int_tcol_to_sup
    int_tsup_to_col
    +


    Field Documentation

    + +
    +
    + + + + +
    int_t SCformat::nnz
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t SCformat::nsuper
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* SCformat::nzval
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int_t* SCformat::rowind
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperLUStat__t.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperLUStat__t.html new file mode 100644 index 0000000..5d5ef69 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperLUStat__t.html @@ -0,0 +1,140 @@ + + +SuperLU: SuperLUStat_t Struct Reference + + + + + +
    +

    SuperLUStat_t Struct Reference

    #include <slu_util.h> +

    + + + + + + + + + + + + + + + +

    Data Fields

    int * panel_histo
    double * utime
    flops_tops
    int TinyPivots
    int RefineSteps
    int expansions
    +


    Field Documentation

    + +
    +
    + + + + +
    int* SuperLUStat_t::panel_histo
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    double* SuperLUStat_t::utime
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int SuperLUStat_t::TinyPivots
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    int SuperLUStat_t::expansions
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperMatrix.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperMatrix.html new file mode 100644 index 0000000..07f3c16 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structSuperMatrix.html @@ -0,0 +1,140 @@ + + +SuperLU: SuperMatrix Struct Reference + + + + + +
    +

    SuperMatrix Struct Reference

    #include <supermatrix.h> +

    + + + + + + + + + + + + + + + +

    Data Fields

    Stype_t Stype
    Dtype_t Dtype
    Mtype_t Mtype
    int_t nrow
    int_t ncol
    void * Store
    +


    Field Documentation

    + +
    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* SuperMatrix::Store
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structcomplex.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structcomplex.html new file mode 100644 index 0000000..ebb27b4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structcomplex.html @@ -0,0 +1,72 @@ + + +SuperLU: complex Struct Reference + + + + + +
    +

    complex Struct Reference

    #include <slu_scomplex.h> +

    + + + + + + + +

    Data Fields

    float r
    float i
    +


    Field Documentation

    + +
    +
    + + + + +
    float complex::r
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    float complex::i
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structdoublecomplex.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structdoublecomplex.html new file mode 100644 index 0000000..7d5104c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structdoublecomplex.html @@ -0,0 +1,72 @@ + + +SuperLU: doublecomplex Struct Reference + + + + + +
    +

    doublecomplex Struct Reference

    #include <slu_dcomplex.h> +

    + + + + + + + +

    Data Fields

    double r
    double i
    +


    Field Documentation

    + +
    +
    + + + + +
    double doublecomplex::r
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    double doublecomplex::i
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structe__node.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structe__node.html new file mode 100644 index 0000000..cf3cc4d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structe__node.html @@ -0,0 +1,75 @@ + + +SuperLU: e_node Struct Reference + + + + + +
    +

    e_node Struct Reference

    Headers for 4 types of dynamatically managed memory. + +

    +#include <slu_util.h> +

    + + + + + + + +

    Data Fields

    int size
    void * mem
    +


    Field Documentation

    + +
    +
    + + + + +
    int e_node::size
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    void* e_node::mem
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structmem__usage__t.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structmem__usage__t.html new file mode 100644 index 0000000..f149160 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structmem__usage__t.html @@ -0,0 +1,72 @@ + + +SuperLU: mem_usage_t Struct Reference + + + + + +
    +

    mem_usage_t Struct Reference

    #include <slu_util.h> +

    + + + + + + + +

    Data Fields

    float for_lu
    float total_needed
    +


    Field Documentation

    + +
    +
    + + + + +
    float mem_usage_t::for_lu
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    float mem_usage_t::total_needed
    +
    +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/structsuperlu__options__t.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/structsuperlu__options__t.html new file mode 100644 index 0000000..bb61fc7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/structsuperlu__options__t.html @@ -0,0 +1,412 @@ + + +SuperLU: superlu_options_t Struct Reference + + + + + +
    +

    superlu_options_t Struct Reference

    #include <slu_util.h> +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Fields

    fact_t Fact
    yes_no_t Equil
    colperm_t ColPerm
    trans_t Trans
    IterRefine_t IterRefine
    double DiagPivotThresh
    yes_no_t SymmetricMode
    yes_no_t PivotGrowth
    yes_no_t ConditionNumber
    rowperm_t RowPerm
    int ILU_DropRule
    double ILU_DropTol
    double ILU_FillFactor
    norm_t ILU_Norm
    double ILU_FillTol
    milu_t ILU_MILU
    double ILU_MILU_Dim
    yes_no_t ParSymbFact
    yes_no_t ReplaceTinyPivot
    yes_no_t SolveInitialized
    yes_no_t RefineInitialized
    yes_no_t PrintStat
    +


    Field Documentation

    + +
    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    double superlu_options_t::ILU_DropTol
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    double superlu_options_t::ILU_FillTol
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    + +

    + +

    + +

    + +
    + +

    + +

    +

    +


    The documentation for this struct was generated from the following file: +
    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu_8c.html new file mode 100644 index 0000000..5103124 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu_8c.html @@ -0,0 +1,68 @@ + + +SuperLU: EXAMPLE/superlu.c File Reference + + + + + +
    +

    EXAMPLE/superlu.c File Reference

    a small 5x5 example More... +

    +#include "slu_ddefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +


    Detailed Description

    +
    + * -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h-source.html new file mode 100644 index 0000000..8c7a7e9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h-source.html @@ -0,0 +1,85 @@ + + +SuperLU: SRC/superlu_enum_consts.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h.html new file mode 100644 index 0000000..2360dbc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__enum__consts_8h.html @@ -0,0 +1,507 @@ + + +SuperLU: SRC/superlu_enum_consts.h File Reference + + + + + +
    +

    SRC/superlu_enum_consts.h File Reference

    enum constants header file More... +

    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Enumerations

    enum  yes_no_t { NO, +YES + }
    enum  fact_t { DOFACT, +SamePattern, +SamePattern_SameRowPerm, +FACTORED + }
    enum  rowperm_t { NOROWPERM, +LargeDiag, +MY_PERMR + }
    enum  colperm_t {
    +  NATURAL, +MMD_ATA, +MMD_AT_PLUS_A, +COLAMD, +
    +  METIS_AT_PLUS_A, +PARMETIS, +ZOLTAN, +MY_PERMC +
    + }
    enum  trans_t { NOTRANS, +TRANS, +CONJ + }
    enum  DiagScale_t { NOEQUIL, +ROW, +COL, +BOTH + }
    enum  IterRefine_t { NOREFINE, +SINGLE = 1, +DOUBLE, +EXTRA + }
    enum  MemType {
    +  LUSUP, +UCOL, +LSUB, +USUB, +
    +  LLVL, +ULVL +
    + }
    enum  stack_end_t { HEAD, +TAIL + }
    enum  LU_space_t { SYSTEM, +USER + }
    enum  norm_t { ONE_NORM, +TWO_NORM, +INF_NORM + }
    enum  milu_t { SILU, +SMILU_1, +SMILU_2, +SMILU_3 + }
    enum  PhaseType {
    +  COLPERM, +ROWPERM, +RELAX, +ETREE, +
    +  EQUIL, +SYMBFAC, +DIST, +FACT, +
    +  COMM, +SOL_COMM, +RCOND, +SOLVE, +
    +  REFINE, +FLOAT, +TRSV, +GEMV, +
    +  FERR, +NPHASES +
    + }
    +


    Detailed Description

    +-- SuperLU routine (version 4.1) -- Lawrence Berkeley National Lab, Univ. of California Berkeley, October 1, 2010

    Enumeration Type Documentation

    + +
    +
    + + + + +
    enum colperm_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + + + + + +
    NATURAL  +
    MMD_ATA  +
    MMD_AT_PLUS_A  +
    COLAMD  +
    METIS_AT_PLUS_A  +
    PARMETIS  +
    ZOLTAN  +
    MY_PERMC  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum DiagScale_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + +
    NOEQUIL  +
    ROW  +
    COL  +
    BOTH  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum fact_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + +
    DOFACT  +
    SamePattern  +
    SamePattern_SameRowPerm  +
    FACTORED  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum IterRefine_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + +
    NOREFINE  +
    SINGLE  +
    DOUBLE  +
    EXTRA  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum LU_space_t
    +
    +
    + +

    +

    Enumerator:
    + + + +
    SYSTEM  +
    USER  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum MemType
    +
    +
    + +

    +

    Enumerator:
    + + + + + + + +
    LUSUP  +
    UCOL  +
    LSUB  +
    USUB  +
    LLVL  +
    ULVL  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum milu_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + +
    SILU  +
    SMILU_1  +
    SMILU_2  +
    SMILU_3  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum norm_t
    +
    +
    + +

    +

    Enumerator:
    + + + + +
    ONE_NORM  +
    TWO_NORM  +
    INF_NORM  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum PhaseType
    +
    +
    + +

    +

    Enumerator:
    + + + + + + + + + + + + + + + + + + + +
    COLPERM  +
    ROWPERM  +
    RELAX  +
    ETREE  +
    EQUIL  +
    SYMBFAC  +
    DIST  +
    FACT  +
    COMM  +
    SOL_COMM  +
    RCOND  +
    SOLVE  +
    REFINE  +
    FLOAT  +
    TRSV  +
    GEMV  +
    FERR  +
    NPHASES  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum rowperm_t
    +
    +
    + +

    +

    Enumerator:
    + + + + +
    NOROWPERM  +
    LargeDiag  +
    MY_PERMR  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum stack_end_t
    +
    +
    + +

    +

    Enumerator:
    + + + +
    HEAD  +
    TAIL  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum trans_t
    +
    +
    + +

    +

    Enumerator:
    + + + + +
    NOTRANS  +
    TRANS  +
    CONJ  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum yes_no_t
    +
    +
    + +

    +

    Enumerator:
    + + + +
    NO  +
    YES  +
    +
    + +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__timer_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__timer_8c.html new file mode 100644 index 0000000..c018765 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/superlu__timer_8c.html @@ -0,0 +1,82 @@ + + +SuperLU: SRC/superlu_timer.c File Reference + + + + + +
    +

    SRC/superlu_timer.c File Reference

    Returns the time used. More... +

    +#include <sys/types.h>
    +#include <sys/times.h>
    +#include <time.h>
    +#include <sys/time.h>
    + + + + + + + + + +

    Defines

    #define CLK_TCK   60

    Functions

    double SuperLU_timer_ ()
     Timer function.
    +


    Detailed Description

    +
    + Purpose
    + =======

    +

     Returns the time in seconds used by the process.

    +

     Note: the timer function call is machine dependent. Use conditional
    +       compilation to choose the appropriate function.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define CLK_TCK   60
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + +
    double SuperLU_timer_ (  ) 
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h-source.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h-source.html new file mode 100644 index 0000000..92acf1d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h-source.html @@ -0,0 +1,199 @@ + + +SuperLU: SRC/supermatrix.h Source File + + + + + +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h.html new file mode 100644 index 0000000..eff8a30 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/supermatrix_8h.html @@ -0,0 +1,183 @@ + + +SuperLU: SRC/supermatrix.h File Reference + + + + + +
    +

    SRC/supermatrix.h File Reference

    Defines matrix types. More... +

    + +

    +Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Structures

    struct  SuperMatrix
    struct  NCformat
    struct  NRformat
    struct  SCformat
    struct  SCPformat
    struct  NCPformat
    struct  DNformat
    struct  NRformat_loc

    Enumerations

    enum  Stype_t {
    +  SLU_NC, +SLU_NCP, +SLU_NR, +SLU_SC, +
    +  SLU_SCP, +SLU_SR, +SLU_DN, +SLU_NR_loc +
    + }
    enum  Dtype_t { SLU_S, +SLU_D, +SLU_C, +SLU_Z + }
    enum  Mtype_t {
    +  SLU_GE, +SLU_TRLU, +SLU_TRUU, +SLU_TRL, +
    +  SLU_TRU, +SLU_SYL, +SLU_SYU, +SLU_HEL, +
    +  SLU_HEU +
    + }
    +


    Detailed Description

    +

    Enumeration Type Documentation

    + +
    +
    + + + + +
    enum Dtype_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + +
    SLU_S  +
    SLU_D  +
    SLU_C  +
    SLU_Z  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum Mtype_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + + + + + + +
    SLU_GE  +
    SLU_TRLU  +
    SLU_TRUU  +
    SLU_TRL  +
    SLU_TRU  +
    SLU_SYL  +
    SLU_SYU  +
    SLU_HEL  +
    SLU_HEU  +
    +
    + +
    +

    + +

    +
    + + + + +
    enum Stype_t
    +
    +
    + +

    +

    Enumerator:
    + + + + + + + + + +
    SLU_NC  +
    SLU_NCP  +
    SLU_NR  +
    SLU_SC  +
    SLU_SCP  +
    SLU_SR  +
    SLU_DN  +
    SLU_NR_loc  +
    +
    + +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/sutil_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/sutil_8c.html new file mode 100644 index 0000000..d7abd6d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/sutil_8c.html @@ -0,0 +1,994 @@ + + +SuperLU: SRC/sutil.c File Reference + + + + + +
    +

    SRC/sutil.c File Reference

    Matrix utility functions. More... +

    +#include <math.h>
    +#include "slu_sdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void sCreate_CompCol_Matrix (SuperMatrix *A, int m, int n, int nnz, float *nzval, int *rowind, int *colptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
     Supernodal LU factor related.
    void sCreate_CompRow_Matrix (SuperMatrix *A, int m, int n, int nnz, float *nzval, int *colind, int *rowptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void sCopy_CompCol_Matrix (SuperMatrix *A, SuperMatrix *B)
     Copy matrix A into matrix B.
    void sCreate_Dense_Matrix (SuperMatrix *X, int m, int n, float *x, int ldx, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void sCopy_Dense_Matrix (int M, int N, float *X, int ldx, float *Y, int ldy)
    void sCreate_SuperNode_Matrix (SuperMatrix *L, int m, int n, int nnz, float *nzval, int *nzval_colptr, int *rowind, int *rowind_colptr, int *col_to_sup, int *sup_to_col, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void sCompRow_to_CompCol (int m, int n, int nnz, float *a, int *colind, int *rowptr, float **at, int **rowind, int **colptr)
     Convert a row compressed storage into a column compressed storage.
    void sPrint_CompCol_Matrix (char *what, SuperMatrix *A)
     Routines for debugging.
    void sPrint_SuperNode_Matrix (char *what, SuperMatrix *A)
    void sPrint_Dense_Matrix (char *what, SuperMatrix *A)
    void sprint_lu_col (char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu)
     Diagnostic print of column "jcol" in the U/L factor.
    void scheck_tempv (int n, float *tempv)
     Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod".
    void sGenXtrue (int n, int nrhs, float *x, int ldx)
    void sFillRHS (trans_t trans, int nrhs, float *x, int ldx, SuperMatrix *A, SuperMatrix *B)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void sfill (float *a, int alen, float dval)
     Fills a float precision array with a given value.
    void sinf_norm_error (int nrhs, SuperMatrix *X, float *xtrue)
     Check the inf-norm of the error vector.
    void sPrintPerf (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, float rpg, float rcond, float *ferr, float *berr, char *equed, SuperLUStat_t *stat)
     Print performance of the code.
     print_float_vec (char *what, int n, float *vec)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    print_float_vec (char *  what,
    int  n,
    float *  vec 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void scheck_tempv (int  n,
    float *  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCompRow_to_CompCol (int  m,
    int  n,
    int  nnz,
    float *  a,
    int *  colind,
    int *  rowptr,
    float **  at,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sCopy_CompCol_Matrix (SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCopy_Dense_Matrix (int  M,
    int  N,
    float *  X,
    int  ldx,
    float *  Y,
    int  ldy 
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_CompCol_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    float *  nzval,
    int *  rowind,
    int *  colptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_CompRow_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    float *  nzval,
    int *  colind,
    int *  rowptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_Dense_Matrix (SuperMatrix X,
    int  m,
    int  n,
    float *  x,
    int  ldx,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sCreate_SuperNode_Matrix (SuperMatrix L,
    int  m,
    int  n,
    int  nnz,
    float *  nzval,
    int *  nzval_colptr,
    int *  rowind,
    int *  rowind_colptr,
    int *  col_to_sup,
    int *  sup_to_col,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sfill (float *  a,
    int  alen,
    float  dval 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sFillRHS (trans_t  trans,
    int  nrhs,
    float *  x,
    int  ldx,
    SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sGenXtrue (int  n,
    int  nrhs,
    float *  x,
    int  ldx 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void sinf_norm_error (int  nrhs,
    SuperMatrix X,
    float *  xtrue 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_CompCol_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_Dense_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sprint_lu_col (char *  msg,
    int  jcol,
    int  pivrow,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void sPrint_SuperNode_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void sPrintPerf (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage,
    float  rpg,
    float  rcond,
    float *  ferr,
    float *  berr,
    char *  equed,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_b.gif b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_b.gif new file mode 100644 index 0000000..0d62348 Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_b.gif differ diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_l.gif b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_l.gif new file mode 100644 index 0000000..9b1e633 Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_l.gif differ diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_r.gif b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_r.gif new file mode 100644 index 0000000..ce9dd9f Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/DOC/html/tab_r.gif differ diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/tabs.css b/thirdparty/superlu/SuperLU_4.1/DOC/html/tabs.css new file mode 100644 index 0000000..95f00a9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/util_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/util_8c.html new file mode 100644 index 0000000..55dba0f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/util_8c.html @@ -0,0 +1,970 @@ + + +SuperLU: SRC/util.c File Reference + + + + + +
    +

    SRC/util.c File Reference

    Utility functions. More... +

    +#include <math.h>
    +#include "slu_ddefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define NBUCKS   10
     Get the statistics of the supernodes.

    Functions

    void superlu_abort_and_exit (char *msg)
     Global statistics variale.
    void set_default_options (superlu_options_t *options)
     Set the default values for the options argument.
    void ilu_set_default_options (superlu_options_t *options)
     Set the default values for the options argument for ILU.
    void print_options (superlu_options_t *options)
     Print the options setting.
    void print_ilu_options (superlu_options_t *options)
     Print the options setting.
    void Destroy_SuperMatrix_Store (SuperMatrix *A)
     Deallocate the structure pointing to the actual storage of the matrix.
    void Destroy_CompCol_Matrix (SuperMatrix *A)
    void Destroy_CompRow_Matrix (SuperMatrix *A)
    void Destroy_SuperNode_Matrix (SuperMatrix *A)
    void Destroy_CompCol_Permuted (SuperMatrix *A)
     A is of type Stype==NCP.
    void Destroy_Dense_Matrix (SuperMatrix *A)
     A is of type Stype==DN.
    void resetrep_col (const int nseg, const int *segrep, int *repfnz)
     Reset repfnz[] for the current column.
    void countnz (const int n, int *xprune, int *nnzL, int *nnzU, GlobalLU_t *Glu)
     Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L.
    void ilu_countnz (const int n, int *nnzL, int *nnzU, GlobalLU_t *Glu)
     Count the total number of nonzeros in factors L and U.
    void fixupL (const int n, const int *perm_r, GlobalLU_t *Glu)
     Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts.
    void print_panel_seg (int n, int w, int jcol, int nseg, int *segrep, int *repfnz)
     Diagnostic print of segment info after panel_dfs().
    void StatInit (SuperLUStat_t *stat)
    void StatPrint (SuperLUStat_t *stat)
    void StatFree (SuperLUStat_t *stat)
    flops_t LUFactFlops (SuperLUStat_t *stat)
    flops_t LUSolveFlops (SuperLUStat_t *stat)
    void ifill (int *a, int alen, int ival)
     Fills an integer array with a given value.
    void super_stats (int nsuper, int *xsup)
    float SpaSize (int n, int np, float sum_npw)
    float DenseSize (int n, float sum_nw)
    void check_repfnz (int n, int w, int jcol, int *repfnz)
     Check whether repfnz[] == EMPTY after reset.
    void PrintSumm (char *type, int nfail, int nrun, int nerrs)
     Print a summary of the testing results.
    int print_int_vec (char *what, int n, int *vec)
    int slu_PrintInt10 (char *name, int len, int *x)

    Variables

    static int max_sup_size
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November, 2010

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define NBUCKS   10
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void check_repfnz (int  n,
    int  w,
    int  jcol,
    int *  repfnz 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void countnz (const int  n,
    int *  xprune,
    int *  nnzL,
    int *  nnzU,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    float DenseSize (int  n,
    float  sum_nw 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompCol_Matrix (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompCol_Permuted (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_CompRow_Matrix (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_Dense_Matrix (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_SuperMatrix_Store (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void Destroy_SuperNode_Matrix (SuperMatrix A  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void fixupL (const int  n,
    const int *  perm_r,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void ifill (int *  a,
    int  alen,
    int  ival 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void ilu_countnz (const int  n,
    int *  nnzL,
    int *  nnzU,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void ilu_set_default_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    flops_t LUFactFlops (SuperLUStat_t stat  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    flops_t LUSolveFlops (SuperLUStat_t stat  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void print_ilu_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int print_int_vec (char *  what,
    int  n,
    int *  vec 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void print_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void print_panel_seg (int  n,
    int  w,
    int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void PrintSumm (char *  type,
    int  nfail,
    int  nrun,
    int  nerrs 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void resetrep_col (const int  nseg,
    const int *  segrep,
    int *  repfnz 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void set_default_options (superlu_options_t options  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int slu_PrintInt10 (char *  name,
    int  len,
    int *  x 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    float SpaSize (int  n,
    int  np,
    float  sum_npw 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatFree (SuperLUStat_t stat  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatInit (SuperLUStat_t stat  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void StatPrint (SuperLUStat_t stat  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void super_stats (int  nsuper,
    int *  xsup 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    void superlu_abort_and_exit (char *  msg  ) 
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    int max_sup_size [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/xerbla_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/xerbla_8c.html new file mode 100644 index 0000000..581924c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/xerbla_8c.html @@ -0,0 +1,61 @@ + + +SuperLU: SRC/xerbla.c File Reference + + + + + +
    +

    SRC/xerbla.c File Reference

    #include <stdio.h>
    +#include "slu_Cnames.h"
    + + + + + +

    Functions

    int xerbla_ (char *srname, int *info)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int xerbla_ (char *  srname,
    int *  info 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__bmod_8c.html new file mode 100644 index 0000000..963d568 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__bmod_8c.html @@ -0,0 +1,272 @@ + + +SuperLU: SRC/zcolumn_bmod.c File Reference + + + + + +
    +

    SRC/zcolumn_bmod.c File Reference

    performs numeric block updates More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + +

    Functions

    void zusolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense upper triangular system.
    void zlsolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense UNIT lower triangular system.
    void zmatvec (int, int, int, doublecomplex *, doublecomplex *, doublecomplex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int zcolumn_bmod (const int jcol, const int nseg, doublecomplex *dense, doublecomplex *tempv, int *segrep, int *repfnz, int fpanelc, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

      Permission is hereby granted to use or copy this program for any
    +  purpose, provided the above notices are retained on all copies.
    +  Permission to modify the code and to distribute modified code is
    +  granted, provided the above notices are retained, and a notice that
    +  the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcolumn_bmod (const int  jcol,
    const int  nseg,
    doublecomplex dense,
    doublecomplex tempv,
    int *  segrep,
    int *  repfnz,
    int  fpanelc,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose:
    + ========
    + Performs numeric block updates (sup-col) in topological order.
    + It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + Special processing on the supernodal portion of L[*,j]
    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlsolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec (int  ldm,
    int  nrow,
    int  ncol,
    doublecomplex M,
    doublecomplex vec,
    doublecomplex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zusolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__dfs_8c.html new file mode 100644 index 0000000..b073c2a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcolumn__dfs_8c.html @@ -0,0 +1,182 @@ + + +SuperLU: SRC/zcolumn_dfs.c File Reference + + + + + +
    +

    SRC/zcolumn_dfs.c File Reference

    Performs a symbolic factorization. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + +

    Defines

    #define T2_SUPER
     What type of supernodes we want.

    Functions

    int zcolumn_dfs (const int m, const int jcol, int *perm_r, int *nseg, int *lsub_col, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define T2_SUPER
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcolumn_dfs (const int  m,
    const int  jcol,
    int *  perm_r,
    int *  nseg,
    int *  lsub_col,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    +   decide the supernode boundary.

    +

       This routine does not use numeric values, but only use the RHS 
    +   row indices to start the dfs.

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives. The routine returns a list of such supernodal 
    +   representatives in topological order of the dfs that generates them.
    +   The location of the first nonzero in each such supernodal segment
    +   (supernodal entry location) is also returned.

    +

     Local parameters
    + ================
    +   nseg: no of segments in current U[*,j]
    +   jsuper: jsuper=EMPTY if column j does not belong to the same
    +	supernode as j-1. Otherwise, jsuper=nsuper.

    +

       marker2: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure

    +

     Return value
    + ============
    +     0  success;
    +   > 0  number of bytes allocated when run out of space.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zcopy__to__ucol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcopy__to__ucol_8c.html new file mode 100644 index 0000000..03d6a19 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zcopy__to__ucol_8c.html @@ -0,0 +1,106 @@ + + +SuperLU: SRC/zcopy_to_ucol.c File Reference + + + + + +
    +

    SRC/zcopy_to_ucol.c File Reference

    Copy a computed column of U to the compressed data structure. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int zcopy_to_ucol (int jcol, int nseg, int *segrep, int *repfnz, int *perm_r, doublecomplex *dense, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zcopy_to_ucol (int  jcol,
    int  nseg,
    int *  segrep,
    int *  repfnz,
    int *  perm_r,
    doublecomplex dense,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zdiagonal_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zdiagonal_8c.html new file mode 100644 index 0000000..d1b3e01 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zdiagonal_8c.html @@ -0,0 +1,98 @@ + + +SuperLU: SRC/zdiagonal.c File Reference + + + + + +
    +

    SRC/zdiagonal.c File Reference

    Auxiliary routines to work with diagonal elements. More... +

    +#include "slu_zdefs.h"
    + + + + + + + +

    Functions

    int zfill_diag (int n, NCformat *Astore)
    int zdominate (int n, NCformat *Astore)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int zdominate (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    int zfill_diag (int  n,
    NCformat Astore 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zfgmr_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zfgmr_8c.html new file mode 100644 index 0000000..83b2700 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zfgmr_8c.html @@ -0,0 +1,216 @@ + + +SuperLU: EXAMPLE/zfgmr.c File Reference + + + + + +
    +

    EXAMPLE/zfgmr.c File Reference

    flexible GMRES from ITSOL developed by Yousef Saad. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + + + + +

    Defines

    #define epsmac   1.0e-16

    Functions

    void zdotc_ (doublecomplex *, int *, doublecomplex[], int *, doublecomplex[], int *)
    double dznrm2_ (int *, doublecomplex[], int *)
    int zfgmr (int n, void(*zmatvec)(doublecomplex, doublecomplex[], doublecomplex, doublecomplex[]), void(*zpsolve)(int, doublecomplex[], doublecomplex[]), doublecomplex *rhs, doublecomplex *sol, double tol, int im, int *itmax, FILE *fits)
    +


    Detailed Description

    +

    Define Documentation

    + +
    +
    + + + + +
    #define epsmac   1.0e-16
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    double dznrm2_ (int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zdotc_ (doublecomplex,
    int * ,
    doublecomplex [],
    int * ,
    doublecomplex [],
    int *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zfgmr (int  n,
    void(*)(doublecomplex, doublecomplex[], doublecomplex, doublecomplex[])  zmatvec,
    void(*)(int, doublecomplex[], doublecomplex[])  zpsolve,
    doublecomplex rhs,
    doublecomplex sol,
    double  tol,
    int  im,
    int *  itmax,
    FILE *  fits 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgscon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgscon_8c.html new file mode 100644 index 0000000..51d480a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgscon_8c.html @@ -0,0 +1,135 @@ + + +SuperLU: SRC/zgscon.c File Reference + + + + + +
    +

    SRC/zgscon.c File Reference

    Estimates reciprocal of the condition number of a general matrix. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zgscon (char *norm, SuperMatrix *L, SuperMatrix *U, double anorm, double *rcond, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routines ZGECON.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgscon (char *  norm,
    SuperMatrix L,
    SuperMatrix U,
    double  anorm,
    double *  rcond,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZGSCON estimates the reciprocal of the condition number of a general 
    +   real matrix A, in either the 1-norm or the infinity-norm, using   
    +   the LU factorization computed by ZGETRF.   *

    +

       An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    +   condition number is computed as   
    +      RCOND = 1 / ( norm(A) * norm(inv(A)) ).

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

        NORM    (input) char*
    +            Specifies whether the 1-norm condition number or the   
    +            infinity-norm condition number is required:   
    +            = '1' or 'O':  1-norm;   
    +            = 'I':         Infinity-norm.

    +

        L       (input) SuperMatrix*
    +            The factor L from the factorization Pr*A*Pc=L*U as computed by
    +            zgstrf(). Use compressed row subscripts storage for supernodes,
    +            i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

        U       (input) SuperMatrix*
    +            The factor U from the factorization Pr*A*Pc=L*U as computed by
    +            zgstrf(). Use column-wise storage scheme, i.e., U has types:
    +            Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

        ANORM   (input) double
    +            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    +            If NORM = 'I', the infinity-norm of the original matrix A.

    +

        RCOND   (output) double*
    +           The reciprocal of the condition number of the matrix A,   
    +           computed as RCOND = 1/(norm(A) * norm(inv(A))).

    +

        INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsequ_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsequ_8c.html new file mode 100644 index 0000000..9a9520a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsequ_8c.html @@ -0,0 +1,145 @@ + + +SuperLU: SRC/zgsequ.c File Reference + + + + + +
    +

    SRC/zgsequ.c File Reference

    Computes row and column scalings. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + + +

    Functions

    void zgsequ (SuperMatrix *A, double *r, double *c, double *rowcnd, double *colcnd, double *amax, int *info)
     Driver related.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine ZGEEQU
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsequ (SuperMatrix A,
    double *  r,
    double *  c,
    double *  rowcnd,
    double *  colcnd,
    double *  amax,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       ZGSEQU computes row and column scalings intended to equilibrate an   
    +   M-by-N sparse matrix A and reduce its condition number. R returns the row
    +   scale factors and C the column scale factors, chosen to try to make   
    +   the largest element in each row and column of the matrix B with   
    +   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

    +

       R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    +   number and BIGNUM = largest safe number.  Use of these scaling   
    +   factors is not guaranteed to reduce the condition number of A but   
    +   works well in practice.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input) SuperMatrix*
    +           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    +           factors are to be computed. The type of A can be:
    +           Stype = SLU_NC; Dtype = SLU_Z; Mtype = SLU_GE.

    +

       R       (output) double*, size A->nrow
    +           If INFO = 0 or INFO > M, R contains the row scale factors   
    +           for A.

    +

       C       (output) double*, size A->ncol
    +           If INFO = 0,  C contains the column scale factors for A.

    +

       ROWCND  (output) double*
    +           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    +           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    +           AMAX is neither too large nor too small, it is not worth   
    +           scaling by R.

    +

       COLCND  (output) double*
    +           If INFO = 0, COLCND contains the ratio of the smallest   
    +           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    +           worth scaling by C.

    +

       AMAX    (output) double*
    +           Absolute value of largest matrix element.  If AMAX is very   
    +           close to overflow or very close to underflow, the matrix   
    +           should be scaled.

    +

       INFO    (output) int*
    +           = 0:  successful exit   
    +           < 0:  if INFO = -i, the i-th argument had an illegal value   
    +           > 0:  if INFO = i,  and i is   
    +                 <= A->nrow:  the i-th row of A is exactly zero   
    +                 >  A->ncol:  the (i-M)-th column of A is exactly zero

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsisx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsisx_8c.html new file mode 100644 index 0000000..e64dd7f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsisx_8c.html @@ -0,0 +1,496 @@ + + +SuperLU: SRC/zgsisx.c File Reference + + + + + +
    +

    SRC/zgsisx.c File Reference

    Computes an approximate solutions of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zgsisx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, double *R, double *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, double *rcond, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.1) --
    + Lawrence Berkeley National Laboratory.
    + November, 2010
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsisx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSISX computes an approximate solutions of linear equations
    + A*X=B or A'*X=B, using the ILU factorization from zgsitrf().
    + An estimation of the condition number is provided. 
    + The routine performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

    	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A is
    +	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +	     = TRANS or CONJ).

    +

    	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +	     matrix that usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the matrix A (after equilibration if options->Equil = YES)
    +	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

    	1.4. Compute the reciprocal pivot growth factor.

    +

    	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    +	     and info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	1.6. The system of equations is solved for X using the factored form
    +	     of A.

    +

    	1.7. options->IterRefine is not used

    +

    	1.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

    	1.9. options for ILU only
    +	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    +		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    +		entries of modulus 1 on the diagonal and off-diagonal entries
    +		of modulus at most 1. If MC64 fails, dgsequ() is used to
    +		equilibrate the system.
    +              ( Default: LargeDiag )
    +	     2) options->ILU_DropTol = tau is the threshold for dropping.
    +		For L, it is used directly (for the whole row in a supernode);
    +		For U, ||A(:,i)||_oo * tau is used as the threshold
    +	        for the	i-th column.
    +		If a secondary dropping rule is required, tau will
    +	        also be used to compute the second threshold.
    +              ( Default: 1e-4 )
    +	     3) options->ILU_FillFactor = gamma, used as the initial guess
    +		of memory growth.
    +		If a secondary dropping rule is required, it will also
    +              be used as an upper bound of the memory.
    +              ( Default: 10 )
    +	     4) options->ILU_DropRule specifies the dropping rule.
    +		Option	      Meaning
    +		======	      ===========
    +		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    +		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    +		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    +			      p = gamma * nnz(A(:,j)).
    +		DROP_AREA:    Variation of ILUTP, for j-th column, use
    +			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    +		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    +			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    +				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    +			      Otherwise
    +				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    +			      tau_U(j) uses the similar rule.
    +			      NOTE: the thresholds used by L and U are separate.
    +		DROP_INTERP:  Compute the second dropping threshold by
    +			      interpolation instead of sorting (default).
    +			      In this case, the actual fill ratio is not
    +			      guaranteed smaller than gamma.
    +		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    +		( Default: DROP_BASIC | DROP_AREA )
    +	     5) options->ILU_Norm is the criterion of measuring the magnitude
    +		of a row in a supernode of L. ( Default is INF_NORM )
    +		options->ILU_Norm	RowSize(x[1:n])
    +		=================	===============
    +		ONE_NORM		||x||_1 / n
    +		TWO_NORM		||x||_2 / sqrt(n)
    +		INF_NORM		max{|x[i]|}
    +	     6) options->ILU_MILU specifies the type of MILU's variation.
    +		= SILU: do not perform Modified ILU;
    +		= SMILU_1 (not recommended):
    +		    U(i,i) := U(i,i) + sum(dropped entries);
    +		= SMILU_2:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    +		= SMILU_3:
    +		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    +		NOTE: Even SMILU_1 does not preserve the column sum because of
    +		late dropping.
    +              ( Default: SILU )
    +	     7) options->ILU_FillTol is used as the perturbation when
    +		encountering zero pivots. If some U(i,i) = 0, so that U is
    +		exactly singular, then
    +		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    +              ( Default: 1e-2 )

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +	to the transpose of A:

    +

    	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    +	     factors are computed to equilibrate the system:
    +	     options->Trans = NOTRANS:
    +		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +	     options->Trans = TRANS:
    +		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +	     options->Trans = CONJ:
    +		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +	     Whether or not the system will be equilibrated depends on the
    +	     scaling of the matrix A, but if equilibration is used, A' is
    +	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    +	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

    	2.2. Permute columns of transpose(A) (rows of A),
    +	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    +	     usually preserves sparsity.
    +	     For more details of this step, see sp_preorder.c.

    +

    	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +	     factor the transpose(A) (after equilibration if
    +	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +	     permutation Pr determined by partial pivoting.

    +

    	2.4. Compute the reciprocal pivot growth factor.

    +

    	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +	     routine fills a small number on the diagonal entry, that is
    +		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    +	     And info will be increased by 1. The factored form of A is used
    +	     to estimate the condition number of the preconditioner. If the
    +	     reciprocal of the condition number is less than machine precision,
    +	     info = A->ncol+1 is returned as a warning, but the routine still
    +	     goes on to solve for X.

    +

    	2.6. The system of equations is solved for X using the factored form
    +	     of transpose(A).

    +

    	2.7. If options->IterRefine is not used.

    +

    	2.8. If equilibration was used, the matrix X is premultiplied by
    +	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    +	     (if options->Trans = TRANS or CONJ) so that it solves the
    +	     original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the LU decomposition will be performed and how the
    +	   system will be solved.

    +

     A	   (input/output) SuperMatrix*
    +	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +	   of the linear equations is A->nrow. Currently, the type of A can be:
    +	   Stype = SLU_NC or SLU_NR, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   In the future, more general A may be handled.

    +

    	   On entry, If options->Fact = FACTORED and equed is not 'N',
    +	   then A must have been equilibrated by the scaling factors in
    +	   R and/or C.
    +	   On exit, A is not modified
    +         if options->Equil = NO, or
    +         if options->Equil = YES but equed = 'N' on exit, or
    +         if options->RowPerm = NO.

    +

    	   Otherwise, if options->Equil = YES and equed is not 'N',
    +	   A is scaled as follows:
    +	   If A->Stype = SLU_NC:
    +	     equed = 'R':  A := diag(R) * A
    +	     equed = 'C':  A := A * diag(C)
    +	     equed = 'B':  A := diag(R) * A * diag(C).
    +	   If A->Stype = SLU_NR:
    +	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix to an I-matrix, that is A is modified as follows:
    +            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    +            off-diagonal entries of modulus at most 1. P is a permutation
    +            obtained from MC64.
    +            If MC64 fails, zgsequ() is used to equilibrate the system,
    +            and A is scaled as above, there is no permutation involved.

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +	   which defines the permutation matrix Pc; perm_c[i] = j means
    +	   column i of A is in position j in A*Pc.
    +	   On exit, perm_c may be overwritten by the product of the input
    +	   perm_c and a permutation that postorders the elimination tree
    +	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +	   is already in postorder.

    +

    	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +	   which describes permutation of columns of transpose(A) 
    +	   (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +	   which defines the permutation matrix Pr, and is determined
    +	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    +	   position j in Pr*A.

    +

    	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +	   determines permutation of rows of transpose(A)
    +	   (columns of A) as described above.

    +

    	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	   will try to use the input perm_r, unless a certain threshold
    +	   criterion is violated. In that case, perm_r is overwritten by a
    +	   new permutation determined by partial pivoting or diagonal
    +	   threshold pivoting.
    +	   Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +	   Elimination tree of Pc'*A'*A*Pc.
    +	   If options->Fact != FACTORED and options->Fact != DOFACT,
    +	   etree is an input argument, otherwise it is an output argument.
    +	   Note: etree is a vector of parent pointers for a forest whose
    +	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +	   Specifies the form of equilibration that was done.
    +	   = 'N': No equilibration.
    +	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +	   = 'B': Both row and column equilibration, i.e., A was replaced 
    +		  by diag(R)*A*diag(C).
    +	   If options->Fact = FACTORED, equed is an input argument,
    +	   otherwise it is an output argument.

    +

     R	   (input/output) double*, dimension (A->nrow)
    +	   The row scale factors for A or transpose(A).
    +	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +	   If equed = 'N' or 'C', R is not accessed.
    +	   If options->Fact = FACTORED, R is an input argument,
    +	       otherwise, R is output.
    +	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +	       of R must be positive.

    +

     C	   (input/output) double*, dimension (A->ncol)
    +	   The column scale factors for A or transpose(A).
    +	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +	   If equed = 'N' or 'R', C is not accessed.
    +	   If options->Fact = FACTORED, C is an input argument,
    +	       otherwise, C is output.
    +	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +	       of C must be positive.

    +

     L	   (output) SuperMatrix*
    +	   The factor L from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses compressed row subscripts storage for supernodes, i.e.,
    +	   L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U	   (output) SuperMatrix*
    +	   The factor U from the factorization
    +	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    +	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    +	   Uses column-wise storage scheme, i.e., U has types:
    +	   Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +	   User supplied workspace, should be large enough
    +	   to hold data structures for factors L and U.
    +	   On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 mem_usage->total_needed; no other side effects.

    +

    	   See argument 'mem_usage' for memory usage statistics.

    +

     B	   (input/output) SuperMatrix*
    +	   B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   On entry, the right hand side matrix.
    +	   If B->ncol = 0, only LU decomposition is performed, the triangular
    +			   solve is skipped.
    +	   On exit,
    +	      if equed = 'N', B is not modified; otherwise
    +	      if A->Stype = SLU_NC:
    +		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    +		    B is overwritten by diag(R)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +		    B is overwritten by diag(C)*B;
    +	      if A->Stype = SLU_NR:
    +		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    +		    B is overwritten by diag(C)*B;
    +		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +		    B is overwritten by diag(R)*B.

    +

             If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    +            the matrix A to an I-matrix. Then, in addition to the scaling
    +            above, B is further permuted by P*B if options->Trans = NOTRANS,
    +            where P is obtained from MC64.

    +

     X	   (output) SuperMatrix*
    +	   X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    +	   to the original system of equations. Note that A and B are modified
    +	   on exit if equed is not 'N', and the solution to the equilibrated
    +	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    +	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +	   and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +	   The infinity norm is used. If recip_pivot_growth is much less
    +	   than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +	   The estimate of the reciprocal condition number of the matrix A
    +	   after equilibration (if done). If rcond is less than the machine
    +	   precision (in particular, if rcond = 0), the matrix is singular
    +	   to working precision. This condition is indicated by a return
    +	   code of info > 0.

    +

     mem_usage (output) mem_usage_t*
    +	   Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +	  Record the statistics on runtime and floating-point operation count.
    +	  See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    +	   > 0: if info = i, and i is
    +		<= A->ncol: number of zero pivots. They are replaced by small
    +		      entries due to options->ILU_FillTol.
    +		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    +		      precision, meaning that the matrix is singular to
    +		      working precision. Nevertheless, the solution and
    +		      error bounds are computed because there are a number
    +		      of situations where the computed solution can be more
    +		      accurate than the value of RCOND would suggest.
    +		> A->ncol+1: number of bytes allocated when memory allocation
    +		      failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsitrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsitrf_8c.html new file mode 100644 index 0000000..a17cee6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsitrf_8c.html @@ -0,0 +1,241 @@ + + +SuperLU: SRC/zgsitrf.c File Reference + + + + + +
    +

    SRC/zgsitrf.c File Reference

    #include "slu_zdefs.h"
    + + + + + +

    Functions

    void zgsitrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsitrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSITRF computes an ILU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +	   The structure defines the input parameters to control
    +	   how the ILU decomposition will be performed.

    +

     A	    (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +	    (A->nrow, A->ncol). The type of A can be:
    +	    Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.

    +

     relax    (input) int
    +	    To control degree of relaxing supernodes. If the number
    +	    of nodes (columns) in a subtree of the elimination tree is less
    +	    than relax, this subtree is considered as one supernode,
    +	    regardless of the row structures of those columns.

    +

     panel_size (input) int
    +	    A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +	    Elimination tree of A'*A.
    +	    Note: etree is a vector of parent pointers for a forest whose
    +	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +	    On input, the columns of A should be permuted so that the
    +	    etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +	    User-supplied work space and space for the output data structures.
    +	    Not referenced if lwork = 0;

    +

     lwork   (input) int
    +	   Specifies the size of work array in bytes.
    +	   = 0:  allocate space internally by system malloc;
    +	   > 0:  use user-supplied work array of length lwork in bytes,
    +		 returns error if space runs out.
    +	   = -1: the routine guesses the amount of space needed without
    +		 performing the factorization, and returns it in
    +		 *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the
    +	    permutation matrix Pc; perm_c[i] = j means column i of A is
    +	    in position j in A*Pc.
    +	    When searching for diagonal, perm_c[*] is applied to the
    +	    row subscripts of A, so that diagonal threshold pivoting
    +	    can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +	    Row permutation vector which defines the permutation matrix Pr,
    +	    perm_r[i] = j means row i of A is in position j in Pr*A.
    +	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +	       will try to use the input perm_r, unless a certain threshold
    +	       criterion is violated. In that case, perm_r is overwritten by
    +	       a new permutation determined by partial pivoting or diagonal
    +	       threshold pivoting.
    +	    Otherwise, perm_r is output argument;

    +

     L	    (output) SuperMatrix*
    +	    The factor L from the factorization Pr*A=L*U; use compressed row
    +	    subscripts storage for supernodes, i.e., L has type:
    +	    Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U	    (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +	    storage scheme, i.e., U has types: Stype = SLU_NC,
    +	    Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +	    Record the statistics on runtime and floating-point operation count.
    +	    See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +	    = 0: successful exit
    +	    < 0: if info = -i, the i-th argument had an illegal value
    +	    > 0: if info = i, and i is
    +	       <= A->ncol: number of zero pivots. They are replaced by small
    +		  entries according to options->ILU_FillTol.
    +	       > A->ncol: number of bytes allocated when memory allocation
    +		  failure occurred, plus A->ncol. If lwork = -1, it is
    +		  the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays:
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 4 of them:
    +	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    +	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    +	      marker_relax(has its own space) is used for relaxed supernodes.

    +

       parent[0:m-1]: parent vector used during dfs
    +	Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the
    +	last column of a supernode.
    +	The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    +	supernodal representative r, repfnz[r] is the location of the first
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    +	the panel diagonal. These are filled in during dpanel_dfs(), and are
    +	used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +		   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    +	It is also used by the dropping routine ilu_ddrop_row().
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsrfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsrfs_8c.html new file mode 100644 index 0000000..889992e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgsrfs_8c.html @@ -0,0 +1,249 @@ + + +SuperLU: SRC/zgsrfs.c File Reference + + + + + +
    +

    SRC/zgsrfs.c File Reference

    Improves computed solution to a system of inear equations. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + + + + +

    Defines

    #define ITMAX   5

    Functions

    void zgsrfs (trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, char *equed, double *R, double *C, SuperMatrix *B, SuperMatrix *X, double *ferr, double *berr, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Modified from lapack routine ZGERFS
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define ITMAX   5
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgsrfs (trans_t  trans,
    SuperMatrix A,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix B,
    SuperMatrix X,
    double *  ferr,
    double *  berr,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZGSRFS improves the computed solution to a system of linear   
    +   equations and provides error bounds and backward error estimates for 
    +   the solution.

    +

       If equilibration was performed, the system becomes:
    +           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

       A       (input) SuperMatrix*
    +           The original matrix A in the system, or the scaled A if
    +           equilibration was done. The type of A can be:
    +           Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_GE.

    +

       L       (input) SuperMatrix*
    +	     The factor L from the factorization Pr*A*Pc=L*U. Use
    +           compressed row subscripts storage for supernodes, 
    +           i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

       U       (input) SuperMatrix*
    +           The factor U from the factorization Pr*A*Pc=L*U as computed by
    +           zgstrf(). Use column-wise storage scheme, 
    +           i.e., U has types: Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

       perm_c  (input) int*, dimension (A->ncol)
    +	     Column permutation vector, which defines the 
    +           permutation matrix Pc; perm_c[i] = j means column i of A is 
    +           in position j in A*Pc.

    +

       perm_r  (input) int*, dimension (A->nrow)
    +           Row permutation vector, which defines the permutation matrix Pr;
    +           perm_r[i] = j means row i of A is in position j in Pr*A.

    +

       equed   (input) Specifies the form of equilibration that was done.
    +           = 'N': No equilibration.
    +           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +           = 'C': Column equilibration, i.e., A was postmultiplied by
    +                  diag(C).
    +           = 'B': Both row and column equilibration, i.e., A was replaced 
    +                  by diag(R)*A*diag(C).

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.
    +           If equed = 'R' or 'B', A is premultiplied by diag(R).
    +           If equed = 'N' or 'C', R is not accessed.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.
    +           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    +           If equed = 'N' or 'R', C is not accessed.

    +

       B       (input) SuperMatrix*
    +           B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +           The right hand side matrix B.
    +           if equed = 'R' or 'B', B is premultiplied by diag(R).

    +

       X       (input/output) SuperMatrix*
    +           X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +           On entry, the solution matrix X, as computed by zgstrs().
    +           On exit, the improved solution matrix X.
    +           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    +               in order to obtain the solution to the original system.

    +

       FERR    (output) double*, dimension (B->ncol)   
    +           The estimated forward error bound for each solution vector   
    +           X(j) (the j-th column of the solution matrix X).   
    +           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +           is an estimated upper bound for the magnitude of the largest 
    +           element in (X(j) - XTRUE) divided by the magnitude of the   
    +           largest element in X(j).  The estimate is as reliable as   
    +           the estimate for RCOND, and is almost always a slight   
    +           overestimate of the true error.

    +

       BERR    (output) double*, dimension (B->ncol)   
    +           The componentwise relative backward error of each solution   
    +           vector X(j) (i.e., the smallest relative change in   
    +           any element of A or B that makes X(j) an exact solution).

    +

       stat     (output) SuperLUStat_t*
    +            Record the statistics on runtime and floating-point operation count.
    +            See util.h for the definition of 'SuperLUStat_t'.

    +

       info    (output) int*   
    +           = 0:  successful exit   
    +            < 0:  if INFO = -i, the i-th argument had an illegal value

    +

        Internal Parameters   
    +    ===================

    +

        ITMAX is the maximum number of steps of iterative refinement.

    +

     
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssv_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssv_8c.html new file mode 100644 index 0000000..d7d9042 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssv_8c.html @@ -0,0 +1,202 @@ + + +SuperLU: SRC/zgssv.c File Reference + + + + + +
    +

    SRC/zgssv.c File Reference

    Solves the system of linear equations A*X=B. More... +

    +#include "slu_zdefs.h"
    + + + + + + +

    Functions

    void zgssv (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, SuperLUStat_t *stat, int *info)
     Driver routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgssv (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSSV solves the system of linear equations A*X=B, using the
    + LU factorization from ZGSTRF. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. Permute the columns of A, forming A*Pc, where Pc
    +           is a permutation matrix. For more details of this step, 
    +           see sp_preorder.c.

    +

          1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    +           by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          1.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    +      above algorithm to the transpose of A:

    +

          2.1. Permute columns of transpose(A) (rows of A),
    +           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    +           For more details of this step, see sp_preorder.c.

    +

          2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    +           determined by Gaussian elimination with partial pivoting.
    +           L is unit lower triangular with offdiagonal entries
    +           bounded by 1 in magnitude, and U is upper triangular.

    +

          2.3. Solve the system of equations A*X=B using the factored
    +           form of A.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR; Dtype = SLU_Z; Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

     perm_c  (input/output) int*
    +         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    +         which defines the permutation matrix Pc; perm_c[i] = j means 
    +         column i of A is in position j in A*Pc.
    +         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

             If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    +            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    +            On exit, perm_c may be overwritten by the product of the input
    +            perm_c and a permutation that postorders the elimination tree
    +            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +            is already in postorder.
    +         Otherwise, it is an output argument.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined 
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.
    +         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->RowPerm = MY_PERMR or
    +            options->Fact = SamePattern_SameRowPerm, perm_r is an
    +            input argument.
    +         otherwise it is an output argument.

    +

     L       (output) SuperMatrix*
    +         The factor L from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization 
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +	   = 0: successful exit
    +         > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                so the solution could not be computed.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssvx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssvx_8c.html new file mode 100644 index 0000000..7fb4f42 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgssvx_8c.html @@ -0,0 +1,450 @@ + + +SuperLU: SRC/zgssvx.c File Reference + + + + + +
    +

    SRC/zgssvx.c File Reference

    Solves the system of linear equations A*X=B or A'*X=B. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zgssvx (superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, int *etree, char *equed, double *R, double *C, SuperMatrix *L, SuperMatrix *U, void *work, int lwork, SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, double *rcond, double *ferr, double *berr, mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgssvx (superlu_options_t options,
    SuperMatrix A,
    int *  perm_c,
    int *  perm_r,
    int *  etree,
    char *  equed,
    double *  R,
    double *  C,
    SuperMatrix L,
    SuperMatrix U,
    void *  work,
    int  lwork,
    SuperMatrix B,
    SuperMatrix X,
    double *  recip_pivot_growth,
    double *  rcond,
    double *  ferr,
    double *  berr,
    mem_usage_t mem_usage,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + the LU factorization from zgstrf(). Error bounds on the solution and
    + a condition estimate are also provided. It performs the following steps:

    +

       1. If A is stored column-wise (A->Stype = SLU_NC):

    +

          1.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A is
    +           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    +           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    +           = TRANS or CONJ).

    +

          1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    +           matrix that usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          1.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the matrix A (after equilibration if options->Equil = YES)
    +           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.

    +

          1.4. Compute the reciprocal pivot growth factor.

    +

          1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form of 
    +           A is used to estimate the condition number of the matrix A. If
    +           the reciprocal of the condition number is less than machine
    +           precision, info = A->ncol+1 is returned as a warning, but the
    +           routine still goes on to solve for X and computes error bounds
    +           as described below.

    +

          1.6. The system of equations is solved for X using the factored form
    +           of A.

    +

          1.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          1.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R)
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    +      to the transpose of A:

    +

          2.1. If options->Equil = YES, scaling factors are computed to
    +           equilibrate the system:
    +           options->Trans = NOTRANS:
    +               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    +           options->Trans = TRANS:
    +               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    +           options->Trans = CONJ:
    +               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    +           Whether or not the system will be equilibrated depends on the
    +           scaling of the matrix A, but if equilibration is used, A' is
    +           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    +           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').

    +

          2.2. Permute columns of transpose(A) (rows of A), 
    +           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    +           usually preserves sparsity.
    +           For more details of this step, see sp_preorder.c.

    +

          2.3. If options->Fact != FACTORED, the LU decomposition is used to
    +           factor the transpose(A) (after equilibration if 
    +           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    +           permutation Pr determined by partial pivoting.

    +

          2.4. Compute the reciprocal pivot growth factor.

    +

          2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    +           routine returns with info = i. Otherwise, the factored form 
    +           of transpose(A) is used to estimate the condition number of the
    +           matrix A. If the reciprocal of the condition number
    +           is less than machine precision, info = A->nrow+1 is returned as
    +           a warning, but the routine still goes on to solve for X and
    +           computes error bounds as described below.

    +

          2.6. The system of equations is solved for X using the factored form
    +           of transpose(A).

    +

          2.7. If options->IterRefine != NOREFINE, iterative refinement is
    +           applied to improve the computed solution matrix and calculate
    +           error bounds and backward error estimates for it.

    +

          2.8. If equilibration was used, the matrix X is premultiplied by
    +           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    +           (if options->Trans = TRANS or CONJ) so that it solves the
    +           original system before equilibration.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed and how the
    +         system will be solved.

    +

     A       (input/output) SuperMatrix*
    +         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    +         of the linear equations is A->nrow. Currently, the type of A can be:
    +         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    +         In the future, more general A may be handled.

    +

             On entry, If options->Fact = FACTORED and equed is not 'N', 
    +         then A must have been equilibrated by the scaling factors in
    +         R and/or C.  
    +         On exit, A is not modified if options->Equil = NO, or if 
    +         options->Equil = YES but equed = 'N' on exit.
    +         Otherwise, if options->Equil = YES and equed is not 'N',
    +         A is scaled as follows:
    +         If A->Stype = SLU_NC:
    +           equed = 'R':  A := diag(R) * A
    +           equed = 'C':  A := A * diag(C)
    +           equed = 'B':  A := diag(R) * A * diag(C).
    +         If A->Stype = SLU_NR:
    +           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    +           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    +           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).

    +

     perm_c  (input/output) int*
    +	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    +         which defines the permutation matrix Pc; perm_c[i] = j means
    +         column i of A is in position j in A*Pc.
    +         On exit, perm_c may be overwritten by the product of the input
    +         perm_c and a permutation that postorders the elimination tree
    +         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    +         is already in postorder.

    +

             If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    +         which describes permutation of columns of transpose(A) 
    +         (rows of A) as described above.

    +

     perm_r  (input/output) int*
    +         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    +         which defines the permutation matrix Pr, and is determined
    +         by partial pivoting.  perm_r[i] = j means row i of A is in 
    +         position j in Pr*A.

    +

             If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    +         determines permutation of rows of transpose(A)
    +         (columns of A) as described above.

    +

             If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +         will try to use the input perm_r, unless a certain threshold
    +         criterion is violated. In that case, perm_r is overwritten by a
    +         new permutation determined by partial pivoting or diagonal
    +         threshold pivoting.
    +         Otherwise, perm_r is output argument.

    +

     etree   (input/output) int*,  dimension (A->ncol)
    +         Elimination tree of Pc'*A'*A*Pc.
    +         If options->Fact != FACTORED and options->Fact != DOFACT,
    +         etree is an input argument, otherwise it is an output argument.
    +         Note: etree is a vector of parent pointers for a forest whose
    +         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.

    +

     equed   (input/output) char*
    +         Specifies the form of equilibration that was done.
    +         = 'N': No equilibration.
    +         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    +         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    +         = 'B': Both row and column equilibration, i.e., A was replaced 
    +                by diag(R)*A*diag(C).
    +         If options->Fact = FACTORED, equed is an input argument,
    +         otherwise it is an output argument.

    +

     R       (input/output) double*, dimension (A->nrow)
    +         The row scale factors for A or transpose(A).
    +         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    +         If equed = 'N' or 'C', R is not accessed.
    +         If options->Fact = FACTORED, R is an input argument,
    +             otherwise, R is output.
    +         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    +             of R must be positive.

    +

     C       (input/output) double*, dimension (A->ncol)
    +         The column scale factors for A or transpose(A).
    +         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    +             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    +         If equed = 'N' or 'R', C is not accessed.
    +         If options->Fact = FACTORED, C is an input argument,
    +             otherwise, C is output.
    +         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    +             of C must be positive.

    +

     L       (output) SuperMatrix*
    +	   The factor L from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses compressed row subscripts storage for supernodes, i.e.,
    +         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (output) SuperMatrix*
    +	   The factor U from the factorization
    +             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    +             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    +         Uses column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     work    (workspace/output) void*, size (lwork) (in bytes)
    +         User supplied workspace, should be large enough
    +         to hold data structures for factors L and U.
    +         On exit, if fact is not 'F', L and U point to this array.

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               mem_usage->total_needed; no other side effects.

    +

             See argument 'mem_usage' for memory usage statistics.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         If B->ncol = 0, only LU decomposition is performed, the triangular
    +                         solve is skipped.
    +         On exit,
    +            if equed = 'N', B is not modified; otherwise
    +            if A->Stype = SLU_NC:
    +               if options->Trans = NOTRANS and equed = 'R' or 'B',
    +                  B is overwritten by diag(R)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    +                  B is overwritten by diag(C)*B;
    +            if A->Stype = SLU_NR:
    +               if options->Trans = NOTRANS and equed = 'C' or 'B',
    +                  B is overwritten by diag(C)*B;
    +               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    +                  B is overwritten by diag(R)*B.

    +

     X       (output) SuperMatrix*
    +         X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE. 
    +         If info = 0 or info = A->ncol+1, X contains the solution matrix
    +         to the original system of equations. Note that A and B are modified
    +         on exit if equed is not 'N', and the solution to the equilibrated
    +         system is inv(diag(C))*X if options->Trans = NOTRANS and
    +         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    +         and equed = 'R' or 'B'.

    +

     recip_pivot_growth (output) double*
    +         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    +         The infinity norm is used. If recip_pivot_growth is much less
    +         than 1, the stability of the LU factorization could be poor.

    +

     rcond   (output) double*
    +         The estimate of the reciprocal condition number of the matrix A
    +         after equilibration (if done). If rcond is less than the machine
    +         precision (in particular, if rcond = 0), the matrix is singular
    +         to working precision. This condition is indicated by a return
    +         code of info > 0.

    +

     FERR    (output) double*, dimension (B->ncol)   
    +         The estimated forward error bound for each solution vector   
    +         X(j) (the j-th column of the solution matrix X).   
    +         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    +         is an estimated upper bound for the magnitude of the largest 
    +         element in (X(j) - XTRUE) divided by the magnitude of the   
    +         largest element in X(j).  The estimate is as reliable as   
    +         the estimate for RCOND, and is almost always a slight   
    +         overestimate of the true error.
    +         If options->IterRefine = NOREFINE, ferr = 1.0.

    +

     BERR    (output) double*, dimension (B->ncol)
    +         The componentwise relative backward error of each solution   
    +         vector X(j) (i.e., the smallest relative change in   
    +         any element of A or B that makes X(j) an exact solution).
    +         If options->IterRefine = NOREFINE, berr = 1.0.

    +

     mem_usage (output) mem_usage_t*
    +         Record the memory usage statistics, consisting of following fields:
      +
    • for_lu (float) + The amount of space used in bytes for L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization.
    • expansions (int) + The number of memory expansions during the LU factorization.
    +

    +

     stat   (output) SuperLUStat_t*
    +        Record the statistics on runtime and floating-point operation count.
    +        See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    +         = 0: successful exit   
    +         < 0: if info = -i, the i-th argument had an illegal value   
    +         > 0: if info = i, and i is   
    +              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    +                    been completed, but the factor U is exactly   
    +                    singular, so the solution and error bounds   
    +                    could not be computed.   
    +              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    +                    precision, meaning that the matrix is singular to
    +                    working precision. Nevertheless, the solution and
    +                    error bounds are computed because there are a number
    +                    of situations where the computed solution can be more
    +                    accurate than the value of RCOND would suggest.   
    +              > A->ncol+1: number of bytes allocated when memory allocation
    +                    failure occurred, plus A->ncol.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrf_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrf_8c.html new file mode 100644 index 0000000..943162d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrf_8c.html @@ -0,0 +1,261 @@ + + +SuperLU: SRC/zgstrf.c File Reference + + + + + +
    +

    SRC/zgstrf.c File Reference

    Computes an LU factorization of a general sparse matrix. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zgstrf (superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, int *etree, void *work, int lwork, int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgstrf (superlu_options_t options,
    SuperMatrix A,
    int  relax,
    int  panel_size,
    int *  etree,
    void *  work,
    int  lwork,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix L,
    SuperMatrix U,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSTRF computes an LU factorization of a general sparse m-by-n
    + matrix A using partial pivoting with row interchanges.
    + The factorization has the form
    +     Pr * A = L * U
    + where Pr is a row permutation matrix, L is lower triangular with unit
    + diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + triangular (upper trapezoidal if A->nrow < A->ncol).

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     options (input) superlu_options_t*
    +         The structure defines the input parameters to control
    +         how the LU decomposition will be performed.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.

    +

     relax    (input) int
    +          To control degree of relaxing supernodes. If the number
    +          of nodes (columns) in a subtree of the elimination tree is less
    +          than relax, this subtree is considered as one supernode,
    +          regardless of the row structures of those columns.

    +

     panel_size (input) int
    +          A panel consists of at most panel_size consecutive columns.

    +

     etree    (input) int*, dimension (A->ncol)
    +          Elimination tree of A'*A.
    +          Note: etree is a vector of parent pointers for a forest whose
    +          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    +          On input, the columns of A should be permuted so that the
    +          etree is in a certain postorder.

    +

     work     (input/output) void*, size (lwork) (in bytes)
    +          User-supplied work space and space for the output data structures.
    +          Not referenced if lwork = 0;

    +

     lwork   (input) int
    +         Specifies the size of work array in bytes.
    +         = 0:  allocate space internally by system malloc;
    +         > 0:  use user-supplied work array of length lwork in bytes,
    +               returns error if space runs out.
    +         = -1: the routine guesses the amount of space needed without
    +               performing the factorization, and returns it in
    +               *info; no other side effects.

    +

     perm_c   (input) int*, dimension (A->ncol)
    +	    Column permutation vector, which defines the 
    +          permutation matrix Pc; perm_c[i] = j means column i of A is 
    +          in position j in A*Pc.
    +          When searching for diagonal, perm_c[*] is applied to the
    +          row subscripts of A, so that diagonal threshold pivoting
    +          can find the diagonal of A, rather than that of A*Pc.

    +

     perm_r   (input/output) int*, dimension (A->nrow)
    +          Row permutation vector which defines the permutation matrix Pr,
    +          perm_r[i] = j means row i of A is in position j in Pr*A.
    +          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    +             will try to use the input perm_r, unless a certain threshold
    +             criterion is violated. In that case, perm_r is overwritten by
    +             a new permutation determined by partial pivoting or diagonal
    +             threshold pivoting.
    +          Otherwise, perm_r is output argument;

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = SLU_NC, 
    +          Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See slu_util.h for the definition of 'SuperLUStat_t'.

    +

     info     (output) int*
    +          = 0: successful exit
    +          < 0: if info = -i, the i-th argument had an illegal value
    +          > 0: if info = i, and i is
    +             <= A->ncol: U(i,i) is exactly zero. The factorization has
    +                been completed, but the factor U is exactly singular,
    +                and division by zero will occur if it is used to solve a
    +                system of equations.
    +             > A->ncol: number of bytes allocated when memory allocation
    +                failure occurred, plus A->ncol. If lwork = -1, it is
    +                the estimated amount of space needed, plus A->ncol.

    +

     ======================================================================

    +

     Local Working Arrays: 
    + ======================
    +   m = number of rows in the matrix
    +   n = number of columns in the matrix

    +

       xprune[0:n-1]: xprune[*] points to locations in subscript 
    +	vector lsub[*]. For column i, xprune[i] denotes the point where 
    +	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    +	to be traversed for symbolic factorization.

    +

       marker[0:3*m-1]: marker[i] = j means that node i has been 
    +	reached when working on column j.
    +	Storage: relative to original row subscripts
    +	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    +	      see zpanel_dfs.c; marker2 is used for inner-factorization,
    +            see zcolumn_dfs.c.

    +

       parent[0:m-1]: parent vector used during dfs
    +      Storage: relative to new row subscripts

    +

       xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    +	unexplored neighbor of i in lsub[*]

    +

       segrep[0:nseg-1]: contains the list of supernodal representatives
    +	in topological order of the dfs. A supernode representative is the 
    +	last column of a supernode.
    +      The maximum size of segrep[] is n.

    +

       repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    +	supernodal representative r, repfnz[r] is the location of the first 
    +	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    +	indicates the supernode r has been explored.
    +	NOTE: There are W of them, each used for one column of a panel.

    +

       panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    +      the panel diagonal. These are filled in during zpanel_dfs(), and are
    +      used later in the inner LU factorization within the panel.
    +	panel_lsub[]/dense[] pair forms the SPA data structure.
    +	NOTE: There are W of them.

    +

       dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    +	    	   NOTE: there are W of them.

    +

       tempv[0:*]: real temporary used for dense numeric kernels;
    +	The size of this array is defined by NUM_TEMPV() in slu_zdefs.h.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrs_8c.html new file mode 100644 index 0000000..a77fc1d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zgstrs_8c.html @@ -0,0 +1,332 @@ + + +SuperLU: SRC/zgstrs.c File Reference + + + + + +
    +

    SRC/zgstrs.c File Reference

    Solves a system using LU factorization. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + +

    Functions

    void zusolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense upper triangular system.
    void zlsolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense UNIT lower triangular system.
    void zmatvec (int, int, int, doublecomplex *, doublecomplex *, doublecomplex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void zgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, int *perm_c, int *perm_r, SuperMatrix *B, SuperLUStat_t *stat, int *info)
    void zprint_soln (int n, int nrhs, doublecomplex *soln)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zgstrs (trans_t  trans,
    SuperMatrix L,
    SuperMatrix U,
    int *  perm_c,
    int *  perm_r,
    SuperMatrix B,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     ZGSTRS solves a system of linear equations A*X=B or A'*X=B
    + with A sparse and B dense, using the LU factorization computed by
    + ZGSTRF.

    +

     See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

     Arguments
    + =========

    +

     trans   (input) trans_t
    +          Specifies the form of the system of equations:
    +          = NOTRANS: A * X = B  (No transpose)
    +          = TRANS:   A'* X = B  (Transpose)
    +          = CONJ:    A**H * X = B  (Conjugate transpose)

    +

     L       (input) SuperMatrix*
    +         The factor L from the factorization Pr*A*Pc=L*U as computed by
    +         zgstrf(). Use compressed row subscripts storage for supernodes,
    +         i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.

    +

     U       (input) SuperMatrix*
    +         The factor U from the factorization Pr*A*Pc=L*U as computed by
    +         zgstrf(). Use column-wise storage scheme, i.e., U has types:
    +         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.

    +

     perm_c  (input) int*, dimension (L->ncol)
    +	   Column permutation vector, which defines the 
    +         permutation matrix Pc; perm_c[i] = j means column i of A is 
    +         in position j in A*Pc.

    +

     perm_r  (input) int*, dimension (L->nrow)
    +         Row permutation vector, which defines the permutation matrix Pr; 
    +         perm_r[i] = j means row i of A is in position j in Pr*A.

    +

     B       (input/output) SuperMatrix*
    +         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    +         On entry, the right hand side matrix.
    +         On exit, the solution matrix if info = 0;

    +

     stat     (output) SuperLUStat_t*
    +          Record the statistics on runtime and floating-point operation count.
    +          See util.h for the definition of 'SuperLUStat_t'.

    +

     info    (output) int*
    + 	   = 0: successful exit
    +	   < 0: if info = -i, the i-th argument had an illegal value
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlsolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec (int  ldm,
    int  nrow,
    int  ncol,
    doublecomplex M,
    doublecomplex vec,
    doublecomplex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zprint_soln (int  n,
    int  nrhs,
    doublecomplex soln 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zusolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zitersol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zitersol_8c.html new file mode 100644 index 0000000..2a70561 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zitersol_8c.html @@ -0,0 +1,244 @@ + + +SuperLU: EXAMPLE/zitersol.c File Reference + + + + + +
    +

    EXAMPLE/zitersol.c File Reference

    #include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void zmatvec_mult (doublecomplex alpha, doublecomplex x[], doublecomplex beta, doublecomplex y[])
    void zpsolve (int n, doublecomplex x[], doublecomplex y[])
    int main (int argc, char *argv[])

    Variables

    int * GLOBAL_PERM_C
    int * GLOBAL_PERM_R
    SuperMatrixGLOBAL_A
    SuperMatrixGLOBAL_L
    SuperMatrixGLOBAL_U
    SuperLUStat_tGLOBAL_STAT
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    int main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec_mult (doublecomplex  alpha,
    doublecomplex  x[],
    doublecomplex  beta,
    doublecomplex  y[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpsolve (int  n,
    doublecomplex  x[],
    doublecomplex  y[] 
    )
    +
    +
    + +

    + +

    +

    +


    Variable Documentation

    + +
    +
    + + + + +
    SuperMatrix* GLOBAL_A
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_L
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int* GLOBAL_PERM_C
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + +
    int * GLOBAL_PERM_R
    +
    +
    + +

    + +

    +

    + +

    + +
    + +

    + +

    +

    + +

    +
    + + + + +
    SuperMatrix * GLOBAL_U
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlacon_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlacon_8c.html new file mode 100644 index 0000000..18faad9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlacon_8c.html @@ -0,0 +1,122 @@ + + +SuperLU: SRC/zlacon.c File Reference + + + + + +
    +

    SRC/zlacon.c File Reference

    Estimates the 1-norm. More... +

    +#include <math.h>
    +#include "slu_Cnames.h"
    +#include "slu_dcomplex.h"
    + + + + + +

    Functions

    int zlacon_ (int *n, doublecomplex *v, doublecomplex *x, double *est, int *kase)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zlacon_ (int *  n,
    doublecomplex v,
    doublecomplex x,
    double *  est,
    int *  kase 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZLACON estimates the 1-norm of a square matrix A.   
    +   Reverse communication is used for evaluating matrix-vector products.

    +

       Arguments   
    +   =========

    +

       N      (input) INT
    +          The order of the matrix.  N >= 1.

    +

       V      (workspace) DOUBLE COMPLEX PRECISION array, dimension (N)   
    +          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    +          (W is not returned).

    +

       X      (input/output) DOUBLE COMPLEX PRECISION array, dimension (N)   
    +          On an intermediate return, X should be overwritten by   
    +                A * X,   if KASE=1,   
    +                A' * X,  if KASE=2,
    +          where A' is the conjugate transpose of A,
    +         and ZLACON must be re-called with all the other parameters   
    +          unchanged.

    +

       EST    (output) DOUBLE PRECISION   
    +          An estimate (a lower bound) for norm(A).

    +

       KASE   (input/output) INT
    +          On the initial call to ZLACON, KASE should be 0.   
    +          On an intermediate return, KASE will be 1 or 2, indicating   
    +          whether X should be overwritten by A * X  or A' * X.   
    +          On the final return from ZLACON, KASE will again be 0.

    +

       Further Details   
    +   ======= =======

    +

       Contributed by Nick Higham, University of Manchester.   
    +   Originally named CONEST, dated March 16, 1988.

    +

       Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    +   a real or complex matrix, with applications to condition estimation", 
    +   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    +   ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlangs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlangs_8c.html new file mode 100644 index 0000000..ba0147b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlangs_8c.html @@ -0,0 +1,97 @@ + + +SuperLU: SRC/zlangs.c File Reference + + + + + +
    +

    SRC/zlangs.c File Reference

    Returns the value of the one norm. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    double zlangs (char *norm, SuperMatrix *A)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from lapack routine ZLANGE 
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    double zlangs (char *  norm,
    SuperMatrix A 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       ZLANGS returns the value of the one norm, or the Frobenius norm, or 
    +   the infinity norm, or the element of largest absolute value of a 
    +   real matrix A.

    +

       Description   
    +   ===========

    +

       ZLANGE returns the value

    +

          ZLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    +               (   
    +               ( norm1(A),         NORM = '1', 'O' or 'o'   
    +               (   
    +               ( normI(A),         NORM = 'I' or 'i'   
    +               (   
    +               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'

    +

       where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    +   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    +   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    +   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.

    +

       Arguments   
    +   =========

    +

       NORM    (input) CHARACTER*1   
    +           Specifies the value to be returned in ZLANGE as described above.   
    +   A       (input) SuperMatrix*
    +           The M by N sparse matrix A.

    +

      =====================================================================
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlaqgs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlaqgs_8c.html new file mode 100644 index 0000000..b7d4999 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlaqgs_8c.html @@ -0,0 +1,160 @@ + + +SuperLU: SRC/zlaqgs.c File Reference + + + + + +
    +

    SRC/zlaqgs.c File Reference

    Equlibrates a general sprase matrix. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + + + + +

    Defines

    #define THRESH   (0.1)

    Functions

    void zlaqgs (SuperMatrix *A, double *r, double *c, double rowcnd, double colcnd, double amax, char *equed)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Modified from LAPACK routine ZLAQGE
    + 

    Define Documentation

    + +
    +
    + + + + +
    #define THRESH   (0.1)
    +
    +
    + +

    + +

    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlaqgs (SuperMatrix A,
    double *  r,
    double *  c,
    double  rowcnd,
    double  colcnd,
    double  amax,
    char *  equed 
    )
    +
    +
    + +

    +

    +   Purpose   
    +   =======

    +

       ZLAQGS equilibrates a general sparse M by N matrix A using the row and   
    +   scaling factors in the vectors R and C.

    +

       See supermatrix.h for the definition of 'SuperMatrix' structure.

    +

       Arguments   
    +   =========

    +

       A       (input/output) SuperMatrix*
    +           On exit, the equilibrated matrix.  See EQUED for the form of 
    +           the equilibrated matrix. The type of A can be:
    +	    Stype = NC; Dtype = SLU_Z; Mtype = GE.

    +

       R       (input) double*, dimension (A->nrow)
    +           The row scale factors for A.

    +

       C       (input) double*, dimension (A->ncol)
    +           The column scale factors for A.

    +

       ROWCND  (input) double
    +           Ratio of the smallest R(i) to the largest R(i).

    +

       COLCND  (input) double
    +           Ratio of the smallest C(i) to the largest C(i).

    +

       AMAX    (input) double
    +           Absolute value of largest matrix entry.

    +

       EQUED   (output) char*
    +           Specifies the form of equilibration that was done.   
    +           = 'N':  No equilibration   
    +           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    +                   diag(R).   
    +           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    +                   by diag(C).   
    +           = 'B':  Both row and column equilibration, i.e., A has been
    +                   replaced by diag(R) * A * diag(C).

    +

       Internal Parameters   
    +   ===================

    +

       THRESH is a threshold value used to decide if row or column scaling   
    +   should be done based on the ratio of the row or column scaling   
    +   factors.  If ROWCND < THRESH, row scaling is done, and if   
    +   COLCND < THRESH, column scaling is done.

    +

       LARGE and SMALL are threshold values used to decide if row scaling   
    +   should be done based on the absolute size of the largest matrix   
    +   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.

    +

       ===================================================================== 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zldperm_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zldperm_8c.html new file mode 100644 index 0000000..cef0a84 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zldperm_8c.html @@ -0,0 +1,283 @@ + + +SuperLU: SRC/zldperm.c File Reference + + + + + +
    +

    SRC/zldperm.c File Reference

    Finds a row permutation so that the matrix has large entries on the diagonal. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + +

    Functions

    int_t mc64id_ (int_t *)
    int_t mc64ad_ (int_t *, int_t *, int_t *, int_t[], int_t[], double[], int_t *, int_t[], int_t *, int_t[], int_t *, double[], int_t[], int_t[])
    int zldperm (int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], doublecomplex nzval[], int_t *perm, double u[], double v[])
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int_t mc64ad_ (int_t,
    int_t,
    int_t,
    int_t [],
    int_t [],
    double [],
    int_t,
    int_t [],
    int_t,
    int_t [],
    int_t,
    double [],
    int_t [],
    int_t [] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int_t mc64id_ (int_t  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zldperm (int_t  job,
    int_t  n,
    int_t  nnz,
    int_t  colptr[],
    int_t  adjncy[],
    doublecomplex  nzval[],
    int_t perm,
    double  u[],
    double  v[] 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       ZLDPERM finds a row permutation so that the matrix has large
    +   entries on the diagonal.

    +

     Arguments
    + =========

    +

     job    (input) int
    +        Control the action. Possible values for JOB are:
    +        = 1 : Compute a row permutation of the matrix so that the
    +              permuted matrix has as many entries on its diagonal as
    +              possible. The values on the diagonal are of arbitrary size.
    +              HSL subroutine MC21A/AD is used for this.
    +        = 2 : Compute a row permutation of the matrix so that the smallest 
    +              value on the diagonal of the permuted matrix is maximized.
    +        = 3 : Compute a row permutation of the matrix so that the smallest
    +              value on the diagonal of the permuted matrix is maximized.
    +              The algorithm differs from the one used for JOB = 2 and may
    +              have quite a different performance.
    +        = 4 : Compute a row permutation of the matrix so that the sum
    +              of the diagonal entries of the permuted matrix is maximized.
    +        = 5 : Compute a row permutation of the matrix so that the product
    +              of the diagonal entries of the permuted matrix is maximized
    +              and vectors to scale the matrix so that the nonzero diagonal 
    +              entries of the permuted matrix are one in absolute value and 
    +              all the off-diagonal entries are less than or equal to one in 
    +              absolute value.
    +        Restriction: 1 <= JOB <= 5.

    +

     n      (input) int
    +        The order of the matrix.

    +

     nnz    (input) int
    +        The number of nonzeros in the matrix.

    +

     adjncy (input) int*, of size nnz
    +        The adjacency structure of the matrix, which contains the row
    +        indices of the nonzeros.

    +

     colptr (input) int*, of size n+1
    +        The pointers to the beginning of each column in ADJNCY.

    +

     nzval  (input) doublecomplex*, of size nnz
    +        The nonzero values of the matrix. nzval[k] is the value of
    +        the entry corresponding to adjncy[k].
    +        It is not used if job = 1.

    +

     perm   (output) int*, of size n
    +        The permutation vector. perm[i] = j means row i in the
    +        original matrix is in row j of the permuted matrix.

    +

     u      (output) double*, of size n
    +        If job = 5, the natural logarithms of the row scaling factors.

    +

     v      (output) double*, of size n
    +        If job = 5, the natural logarithms of the column scaling factors. 
    +        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol1_8c.html new file mode 100644 index 0000000..0d201bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol1_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/zlinsol1.c File Reference + + + + + +
    +

    EXAMPLE/zlinsol1.c File Reference

    #include "slu_zdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol_8c.html new file mode 100644 index 0000000..3510a6e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsol_8c.html @@ -0,0 +1,60 @@ + + +SuperLU: EXAMPLE/zlinsol.c File Reference + + + + + +
    +

    EXAMPLE/zlinsol.c File Reference

    #include "slu_zdefs.h"
    + + + + + +

    Functions

     main (int argc, char *argv[])
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx1_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx1_8c.html new file mode 100644 index 0000000..20935b3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx1_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/zlinsolx1.c File Reference + + + + + +
    +

    EXAMPLE/zlinsolx1.c File Reference

    #include "slu_zdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx2_8c.html new file mode 100644 index 0000000..20c297f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx2_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/zlinsolx2.c File Reference + + + + + +
    +

    EXAMPLE/zlinsolx2.c File Reference

    #include "slu_zdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx_8c.html new file mode 100644 index 0000000..8c0d126 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zlinsolx_8c.html @@ -0,0 +1,115 @@ + + +SuperLU: EXAMPLE/zlinsolx.c File Reference + + + + + +
    +

    EXAMPLE/zlinsolx.c File Reference

    #include "slu_zdefs.h"
    + + + + + + + +

    Functions

     main (int argc, char *argv[])
    void parse_command_line (int argc, char *argv[], int *lwork, double *u, yes_no_t *equil, trans_t *trans)
    +

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    main (int  argc,
    char *  argv[] 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void parse_command_line (int  argc,
    char *  argv[],
    int *  lwork,
    double *  u,
    yes_no_t equil,
    trans_t trans 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:47 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zmemory_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zmemory_8c.html new file mode 100644 index 0000000..7875488 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zmemory_8c.html @@ -0,0 +1,976 @@ + + +SuperLU: SRC/zmemory.c File Reference + + + + + +
    +

    SRC/zmemory.c File Reference

    Memory details. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Defines

    #define StackFull(x)   ( x + Glu->stack.used >= Glu->stack.size )
    #define NotDoubleAlign(addr)   ( (long int)addr & 7 )
    #define DoubleAlign(addr)   ( ((long int)addr + 7) & ~7L )
    #define TempSpace(m, w)
    #define Reduce(alpha)   ((alpha + 1) / 2)

    Functions

    void * zexpand (int *prev_len,MemType type,int len_to_copy,int keep_prev,GlobalLU_t *Glu)
     Expand the existing storage to accommodate more fill-ins.
    int zLUWorkInit (int m, int n, int panel_size, int **iworkptr, doublecomplex **dworkptr, GlobalLU_t *Glu)
     Allocate known working storage. Returns 0 if success, otherwise returns the number of bytes allocated so far when failure occurred.
    void copy_mem_doublecomplex (int, void *, void *)
    void zStackCompress (GlobalLU_t *Glu)
     Compress the work[] array to remove fragmentation.
    void zSetupSpace (void *work, int lwork, GlobalLU_t *Glu)
     Setup the memory model to be used for factorization.
    void * zuser_malloc (int, int, GlobalLU_t *)
    void zuser_free (int, int, GlobalLU_t *)
    void copy_mem_int (int, void *, void *)
    void user_bcopy (char *, char *, int)
    int zQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int ilu_zQuerySpace (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage)
    int zLUMemInit (fact_t fact, void *work, int lwork, int m, int n, int annz, int panel_size, double fill_ratio, SuperMatrix *L, SuperMatrix *U, GlobalLU_t *Glu, int **iwork, doublecomplex **dwork)
     Allocate storage for the data structures common to all factor routines.
    void zSetRWork (int m, int panel_size, doublecomplex *dworkptr, doublecomplex **dense, doublecomplex **tempv)
     Set up pointers for real working arrays.
    void zLUWorkFree (int *iwork, doublecomplex *dwork, GlobalLU_t *Glu)
     Free the working storage used by factor routines.
    int zLUMemXpand (int jcol, int next, MemType mem_type, int *maxlen, GlobalLU_t *Glu)
     Expand the data structures for L and U during the factorization.
    void zallocateA (int n, int nnz, doublecomplex **a, int **asub, int **xa)
     Allocate storage for original matrix A.
    doublecomplexdoublecomplexMalloc (int n)
    doublecomplexdoublecomplexCalloc (int n)
    int zmemory_usage (const int nzlmax, const int nzumax, const int nzlumax, const int n)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Define Documentation

    + +
    +
    + + + + + + + + + +
    #define DoubleAlign (addr   )    ( ((long int)addr + 7) & ~7L )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define NotDoubleAlign (addr   )    ( (long int)addr & 7 )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define Reduce (alpha   )    ((alpha + 1) / 2)
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    #define StackFull (  )    ( x + Glu->stack.used >= Glu->stack.size )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + +
    #define TempSpace (m,
     ) 
    +
    +
    + +

    +Value:

    ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \
    +                              (w + 1) * m * sizeof(doublecomplex) )
    +
    +
    +

    +


    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_doublecomplex (int  howmany,
    void *  old,
    void *  new 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void copy_mem_int (int ,
    void * ,
    void *  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex* doublecomplexCalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    doublecomplex* doublecomplexMalloc (int  n  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int ilu_zQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void user_bcopy (char * ,
    char * ,
    int  
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zallocateA (int  n,
    int  nnz,
    doublecomplex **  a,
    int **  asub,
    int **  xa 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void * zexpand (int *  prev_len,
    MemType  type,
    int  len_to_copy,
    int  keep_prev,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zLUMemInit (fact_t  fact,
    void *  work,
    int  lwork,
    int  m,
    int  n,
    int  annz,
    int  panel_size,
    double  fill_ratio,
    SuperMatrix L,
    SuperMatrix U,
    GlobalLU_t Glu,
    int **  iwork,
    doublecomplex **  dwork 
    )
    +
    +
    + +

    +Memory-related.

    +

    + For those unpredictable size, estimate as fill_ratio * nnz(A).
    + Return value:
    +     If lwork = -1, return the estimated amount of space required, plus n;
    +     otherwise, return the amount of space actually allocated when
    +     memory allocation failure occurred.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zLUMemXpand (int  jcol,
    int  next,
    MemType  mem_type,
    int *  maxlen,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Return value:   0 - successful return
    +               > 0 - number of bytes allocated when run out of space
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zLUWorkFree (int *  iwork,
    doublecomplex dwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zLUWorkInit (int  m,
    int  n,
    int  panel_size,
    int **  iworkptr,
    doublecomplex **  dworkptr,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zmemory_usage (const int  nzlmax,
    const int  nzumax,
    const int  nzlumax,
    const int  n 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int zQuerySpace (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage 
    )
    +
    +
    + +

    +

    + mem_usage consists of the following fields:
      +
    • for_lu (float) + The amount of space used in bytes for the L data structures.
    • total_needed (float) + The amount of space needed in bytes to perform factorization. + +
    +
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zSetRWork (int  m,
    int  panel_size,
    doublecomplex dworkptr,
    doublecomplex **  dense,
    doublecomplex **  tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zSetupSpace (void *  work,
    int  lwork,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +lwork = 0: use system malloc; lwork > 0: use user-supplied work[] space. +

    +

    + +

    +
    + + + + + + + + + +
    void zStackCompress (GlobalLU_t Glu  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zuser_free (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void * zuser_malloc (int  bytes,
    int  which_end,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zmyblas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zmyblas2_8c.html new file mode 100644 index 0000000..4309169 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zmyblas2_8c.html @@ -0,0 +1,181 @@ + + +SuperLU: SRC/zmyblas2.c File Reference + + + + + +
    +

    SRC/zmyblas2.c File Reference

    Level 2 Blas operations. More... +

    +#include "slu_dcomplex.h"
    + + + + + + + + + + + + +

    Functions

    void zlsolve (int ldm, int ncol, doublecomplex *M, doublecomplex *rhs)
     Solves a dense UNIT lower triangular system.
    void zusolve (int ldm, int ncol, doublecomplex *M, doublecomplex *rhs)
     Solves a dense upper triangular system.
    void zmatvec (int ldm, int nrow, int ncol, doublecomplex *M, doublecomplex *vec, doublecomplex *Mxvec)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 
    Purpose: Level 2 BLAS operations: solves and matvec, written in C. Note: This is only used when the system lacks an efficient BLAS library.

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlsolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec (int  ldm,
    int  nrow,
    int  ncol,
    doublecomplex M,
    doublecomplex vec,
    doublecomplex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zusolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__bmod_8c.html new file mode 100644 index 0000000..c4a4d2b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__bmod_8c.html @@ -0,0 +1,258 @@ + + +SuperLU: SRC/zpanel_bmod.c File Reference + + + + + +
    +

    SRC/zpanel_bmod.c File Reference

    Performs numeric block updates. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + +

    Functions

    void zlsolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense UNIT lower triangular system.
    void zmatvec (int, int, int, doublecomplex *, doublecomplex *, doublecomplex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    void zcheck_tempv ()
    void zpanel_bmod (const int m, const int w, const int jcol, const int nseg, doublecomplex *dense, doublecomplex *tempv, int *segrep, int *repfnz, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + +
    void zcheck_tempv (  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlsolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec (int  ldm,
    int  nrow,
    int  ncol,
    doublecomplex M,
    doublecomplex vec,
    doublecomplex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpanel_bmod (const int  m,
    const int  w,
    const int  jcol,
    const int  nseg,
    doublecomplex dense,
    doublecomplex tempv,
    int *  segrep,
    int *  repfnz,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

        Performs numeric block updates (sup-panel) in topological order.
    +    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    +    Special processing on the supernodal portion of L[*,j]

    +

        Before entering this routine, the original nonzeros in the panel 
    +    were already copied into the spa[m,w].

    +

        Updated/Output parameters-
    +    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    +    collectively in the m-by-w vector dense[*]. 
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__dfs_8c.html new file mode 100644 index 0000000..a6ff7bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpanel__dfs_8c.html @@ -0,0 +1,175 @@ + + +SuperLU: SRC/zpanel_dfs.c File Reference + + + + + +
    +

    SRC/zpanel_dfs.c File Reference

    Peforms a symbolic factorization on a panel of symbols. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zpanel_dfs (const int m, const int w, const int jcol, SuperMatrix *A, int *perm_r, int *nseg, doublecomplex *dense, int *panel_lsub, int *segrep, int *repfnz, int *xprune, int *marker, int *parent, int *xplore, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpanel_dfs (const int  m,
    const int  w,
    const int  jcol,
    SuperMatrix A,
    int *  perm_r,
    int *  nseg,
    doublecomplex dense,
    int *  panel_lsub,
    int *  segrep,
    int *  repfnz,
    int *  xprune,
    int *  marker,
    int *  parent,
    int *  xplore,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

       Performs a symbolic factorization on a panel of columns [jcol, jcol+w).

    +

       A supernode representative is the last column of a supernode.
    +   The nonzeros in U[*,j] are segments that end at supernodal
    +   representatives.

    +

       The routine returns one list of the supernodal representatives
    +   in topological order of the dfs that generates them. This list is
    +   a superset of the topological order of each individual column within
    +   the panel. 
    +   The location of the first nonzero in each supernodal segment
    +   (supernodal entry location) is also returned. Each column has a 
    +   separate list for this purpose.

    +

       Two marker arrays are used for dfs:
    +     marker[i] == jj, if i was visited during dfs of current column jj;
    +     marker1[i] >= jcol, if i was visited by earlier columns in this panel;

    +

       marker: A-row --> A-row/col (0/1)
    +   repfnz: SuperA-col --> PA-row
    +   parent: SuperA-col --> SuperA-col
    +   xplore: SuperA-col --> index to L-structure
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotL_8c.html new file mode 100644 index 0000000..997cbc1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotL_8c.html @@ -0,0 +1,136 @@ + + +SuperLU: SRC/zpivotL.c File Reference + + + + + +
    +

    SRC/zpivotL.c File Reference

    Performs numerical pivoting. More... +

    +#include <math.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int zpivotL (const int jcol, const double u, int *usepr, int *perm_r, int *iperm_r, int *iperm_c, int *pivrow, GlobalLU_t *Glu, SuperLUStat_t *stat)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zpivotL (const int  jcol,
    const double  u,
    int *  usepr,
    int *  perm_r,
    int *  iperm_r,
    int *  iperm_c,
    int *  pivrow,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Performs the numerical pivoting on the current column of L,
    +   and the CDIV operation.

    +

       Pivot policy:
    +   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    +   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    +           pivot row = k;
    +       ELSE IF abs(A_jj) >= thresh THEN
    +           pivot row = j;
    +       ELSE
    +           pivot row = m;

    +

       Note: If you absolutely want to use a given pivot order, then set u=0.0.

    +

       Return value: 0      success;
    +                 i > 0  U(i,i) is exactly zero.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotgrowth_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotgrowth_8c.html new file mode 100644 index 0000000..e114fed --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpivotgrowth_8c.html @@ -0,0 +1,109 @@ + + +SuperLU: SRC/zpivotgrowth.c File Reference + + + + + +
    +

    SRC/zpivotgrowth.c File Reference

    Computes the reciprocal pivot growth factor. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    double zPivotGrowth (int ncols, SuperMatrix *A, int *perm_c, SuperMatrix *L, SuperMatrix *U)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    double zPivotGrowth (int  ncols,
    SuperMatrix A,
    int *  perm_c,
    SuperMatrix L,
    SuperMatrix U 
    )
    +
    +
    + +

    +

    + Purpose
    + =======

    +

     Compute the reciprocal pivot growth factor of the leading ncols columns
    + of the matrix, using the formula:
    +     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )

    +

     Arguments
    + =========

    +

     ncols    (input) int
    +          The number of columns of matrices A, L and U.

    +

     A        (input) SuperMatrix*
    +	    Original matrix A, permuted by columns, of dimension
    +          (A->nrow, A->ncol). The type of A can be:
    +          Stype = NC; Dtype = SLU_Z; Mtype = GE.

    +

     L        (output) SuperMatrix*
    +          The factor L from the factorization Pr*A=L*U; use compressed row 
    +          subscripts storage for supernodes, i.e., L has type: 
    +          Stype = SC; Dtype = SLU_Z; Mtype = TRLU.

    +

     U        (output) SuperMatrix*
    +	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    +          storage scheme, i.e., U has types: Stype = NC;
    +          Dtype = SLU_Z; Mtype = TRU.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zpruneL_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpruneL_8c.html new file mode 100644 index 0000000..081876c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zpruneL_8c.html @@ -0,0 +1,117 @@ + + +SuperLU: SRC/zpruneL.c File Reference + + + + + +
    +

    SRC/zpruneL.c File Reference

    Prunes the L-structure. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    void zpruneL (const int jcol, const int *perm_r, const int pivrow, const int nseg, const int *segrep, const int *repfnz, int *xprune, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + *

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zpruneL (const int  jcol,
    const int *  perm_r,
    const int  pivrow,
    const int  nseg,
    const int *  segrep,
    const int *  repfnz,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +   Prunes the L-structure of supernodes whose L-structure
    +   contains the current pivot row "pivrow"
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadhb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadhb_8c.html new file mode 100644 index 0000000..4e0084e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadhb_8c.html @@ -0,0 +1,345 @@ + + +SuperLU: SRC/zreadhb.c File Reference + + + + + +
    +

    SRC/zreadhb.c File Reference

    Read a matrix stored in Harwell-Boeing format. More... +

    +#include <stdio.h>
    +#include <stdlib.h>
    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    int zDumpLine (FILE *fp)
     Eat up the rest of the current line.
    int zParseIntFormat (char *buf, int *num, int *size)
    int zParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    int zReadValues (FILE *fp, int n, doublecomplex *destination, int perline, int persize)
     Read complex numbers as pairs of (real, imaginary).
    void zreadhb (int *nrow, int *ncol, int *nonz, doublecomplex **nzval, int **rowind, int **colptr)
     Auxiliary routines.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Purpose
    + =======

    +

     Read a DOUBLE COMPLEX PRECISION matrix stored in Harwell-Boeing format 
    + as described below.

    +

     Line 1 (A72,A8) 
    +  	Col. 1 - 72   Title (TITLE) 
    +	Col. 73 - 80  Key (KEY)

    +

     Line 2 (5I14) 
    + 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    +	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    +                    (including starting guesses and solution vectors 
    +		       if present) 
    +           	      (zero indicates no right-hand side data is present)

    +

     Line 3 (A3, 11X, 4I14) 
    +   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    +	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    +	              (equal to number of entries for assembled matrices) 
    + 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    +	              (zero in the case of assembled matrices) 
    + Line 4 (2A16, 2A20) 
    + 	Col. 1 - 16   Format for pointers (PTRFMT) 
    +	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    +	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

    +

     Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    +    	Col. 1 	      Right-hand side type: 
    +	         	  F for full storage or M for same format as matrix 
    +    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    +    	Col. 3        X if an exact solution vector(s) is supplied. 
    +	Col. 15 - 28  Number of right-hand sides (NRHS) 
    +	Col. 29 - 42  Number of row indices (NRHSIX) 
    +          	      (ignored in case of unassembled matrices)

    +

     The three character type field on line 3 describes the matrix type. 
    + The following table lists the permitted values for each of the three 
    + characters. As an example of the type field, RSA denotes that the matrix 
    + is real, symmetric, and assembled.

    +

     First Character: 
    +	R Real matrix 
    +	C Complex matrix 
    +	P Pattern only (no numerical values supplied)

    +

     Second Character: 
    +	S Symmetric 
    +	U Unsymmetric 
    +	H Hermitian 
    +	Z Skew symmetric 
    +	R Rectangular

    +

     Third Character: 
    +	A Assembled 
    +	E Elemental matrices (unassembled)

    +

     

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    int zDumpLine (FILE *  fp  ) 
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int zParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    int zParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadhb (int *  nrow,
    int *  ncol,
    int *  nonz,
    doublecomplex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zReadValues (FILE *  fp,
    int  n,
    doublecomplex destination,
    int  perline,
    int  persize 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadrb_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadrb_8c.html new file mode 100644 index 0000000..5bbad88 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zreadrb_8c.html @@ -0,0 +1,302 @@ + + +SuperLU: SRC/zreadrb.c File Reference + + + + + +
    +

    SRC/zreadrb.c File Reference

    Read a matrix stored in Rutherford-Boeing format. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + +

    Functions

    static int zDumpLine (FILE *fp)
     Eat up the rest of the current line.
    static int zParseIntFormat (char *buf, int *num, int *size)
    static int zParseFloatFormat (char *buf, int *num, int *size)
    static int ReadVector (FILE *fp, int n, int *where, int perline, int persize)
    static int zReadValues (FILE *fp, int n, doublecomplex *destination, int perline, int persize)
     Read complex numbers as pairs of (real, imaginary).
    void zreadrb (int *nrow, int *ncol, int *nonz, doublecomplex **nzval, int **rowind, int **colptr)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    +Purpose =======

    +Read a DOUBLE COMPLEX PRECISION matrix stored in Rutherford-Boeing format as described below.

    +Line 1 (A72, A8) Col. 1 - 72 Title (TITLE) Col. 73 - 80 Matrix name / identifier (MTRXID)

    +Line 2 (I14, 3(1X, I13)) Col. 1 - 14 Total number of lines excluding header (TOTCRD) Col. 16 - 28 Number of lines for pointers (PTRCRD) Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) Col. 44 - 56 Number of lines for numerical values (VALCRD)

    +Line 3 (A3, 11X, 4(1X, I13)) Col. 1 - 3 Matrix type (see below) (MXTYPE) Col. 15 - 28 Compressed Column: Number of rows (NROW) Elemental: Largest integer used to index variable (MVAR) Col. 30 - 42 Compressed Column: Number of columns (NCOL) Elemental: Number of element matrices (NELT) Col. 44 - 56 Compressed Column: Number of entries (NNZERO) Elemental: Number of variable indeces (NVARIX) Col. 58 - 70 Compressed Column: Unused, explicitly zero Elemental: Number of elemental matrix entries (NELTVL)

    +Line 4 (2A16, A20) Col. 1 - 16 Fortran format for pointers (PTRFMT) Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) Col. 33 - 52 Fortran format for numerical values of coefficient matrix (VALFMT) (blank in the case of matrix patterns)

    +The three character type field on line 3 describes the matrix type. The following table lists the permitted values for each of the three characters. As an example of the type field, RSA denotes that the matrix is real, symmetric, and assembled.

    +First Character: R Real matrix C Complex matrix I integer matrix P Pattern only (no numerical values supplied) Q Pattern only (numerical values supplied in associated auxiliary value file)

    +Second Character: S Symmetric U Unsymmetric H Hermitian Z Skew symmetric R Rectangular

    +Third Character: A Compressed column form E Elemental form

    +

    + -- SuperLU routine (version 4.0) --
    + Lawrence Berkeley National Laboratory.
    + June 30, 2009
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int ReadVector (FILE *  fp,
    int  n,
    int *  where,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + +
    static int zDumpLine (FILE *  fp  )  [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int zParseFloatFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    static int zParseIntFormat (char *  buf,
    int *  num,
    int *  size 
    ) [static]
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zreadrb (int *  nrow,
    int *  ncol,
    int *  nonz,
    doublecomplex **  nzval,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    static int zReadValues (FILE *  fp,
    int  n,
    doublecomplex destination,
    int  perline,
    int  persize 
    ) [static]
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__bmod_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__bmod_8c.html new file mode 100644 index 0000000..a63a7bf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__bmod_8c.html @@ -0,0 +1,107 @@ + + +SuperLU: SRC/zsnode_bmod.c File Reference + + + + + +
    +

    SRC/zsnode_bmod.c File Reference

    Performs numeric block updates within the relaxed snode. More... +

    +#include "slu_zdefs.h"
    + + + + + + +

    Functions

    int zsnode_bmod (const int jcol, const int jsupno, const int fsupc, doublecomplex *dense, doublecomplex *tempv, GlobalLU_t *Glu, SuperLUStat_t *stat)
     Performs numeric block updates within the relaxed snode.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zsnode_bmod (const int  jcol,
    const int  jsupno,
    const int  fsupc,
    doublecomplex dense,
    doublecomplex tempv,
    GlobalLU_t Glu,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__dfs_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__dfs_8c.html new file mode 100644 index 0000000..825278d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsnode__dfs_8c.html @@ -0,0 +1,123 @@ + + +SuperLU: SRC/zsnode_dfs.c File Reference + + + + + +
    +

    SRC/zsnode_dfs.c File Reference

    Determines the union of row structures of columns within the relaxed node. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int zsnode_dfs (const int jcol, const int kcol, const int *asub, const int *xa_begin, const int *xa_end, int *xprune, int *marker, GlobalLU_t *Glu)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int zsnode_dfs (const int  jcol,
    const int  kcol,
    const int *  asub,
    const int *  xa_begin,
    const int *  xa_end,
    int *  xprune,
    int *  marker,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    +

    + Purpose
    + =======
    +    zsnode_dfs() - Determine the union of the row structures of those 
    +    columns within the relaxed snode.
    +    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    +    the portion outside the rectangular supernode must be zero.

    +

     Return value
    + ============
    +     0   success;
    +    >0   number of bytes allocated when run out of memory.
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas2_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas2_8c.html new file mode 100644 index 0000000..787e0f0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas2_8c.html @@ -0,0 +1,401 @@ + + +SuperLU: SRC/zsp_blas2.c File Reference + + + + + +
    +

    SRC/zsp_blas2.c File Reference

    Sparse BLAS 2, using some dense BLAS 2 operations. More... +

    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + +

    Functions

    void zusolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense upper triangular system.
    void zlsolve (int, int, doublecomplex *, doublecomplex *)
     Solves a dense UNIT lower triangular system.
    void zmatvec (int, int, int, doublecomplex *, doublecomplex *, doublecomplex *)
     Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec.
    int sp_ztrsv (char *uplo, char *trans, char *diag, SuperMatrix *L, SuperMatrix *U, doublecomplex *x, SuperLUStat_t *stat, int *info)
     Solves one of the systems of equations A*x = b, or A'*x = b.
    int sp_zgemv (char *trans, doublecomplex alpha, SuperMatrix *A, doublecomplex *x, int incx, doublecomplex beta, doublecomplex *y, int incy)
     Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + October 15, 2003
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_zgemv (char *  trans,
    doublecomplex  alpha,
    SuperMatrix A,
    doublecomplex x,
    int  incx,
    doublecomplex  beta,
    doublecomplex y,
    int  incy 
    )
    +
    +
    + +

    +

      
    +   Purpose   
    +   =======

    +

       sp_zgemv()  performs one of the matrix-vector operations   
    +      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    +   where alpha and beta are scalars, x and y are vectors and A is a
    +   sparse A->nrow by A->ncol matrix.

    +

       Parameters   
    +   ==========

    +

       TRANS  - (input) char*
    +            On entry, TRANS specifies the operation to be performed as   
    +            follows:   
    +               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    +               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    +               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.

    +

       ALPHA  - (input) doublecomplex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Before entry, the leading m by n part of the array A must   
    +            contain the matrix of coefficients.

    +

       X      - (input) doublecomplex*, array of DIMENSION at least   
    +            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    +           and at least   
    +            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    +            Before entry, the incremented array X must contain the   
    +            vector x.

    +

       INCX   - (input) int
    +            On entry, INCX specifies the increment for the elements of   
    +            X. INCX must not be zero.

    +

       BETA   - (input) doublecomplex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then Y need not be set on input.

    +

       Y      - (output) doublecomplex*,  array of DIMENSION at least   
    +            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    +            and at least   
    +            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    +            Before entry with BETA non-zero, the incremented array Y   
    +            must contain the vector y. On exit, Y is overwritten by the 
    +            updated vector y.

    +

       INCY   - (input) int
    +            On entry, INCY specifies the increment for the elements of   
    +            Y. INCY must not be zero.

    +

        ==== Sparse Level 2 Blas routine.   
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_ztrsv (char *  uplo,
    char *  trans,
    char *  diag,
    SuperMatrix L,
    SuperMatrix U,
    doublecomplex x,
    SuperLUStat_t stat,
    int *  info 
    )
    +
    +
    + +

    +

    +   Purpose
    +   =======

    +

       sp_ztrsv() solves one of the systems of equations   
    +       A*x = b,   or   A'*x = b,
    +   where b and x are n element vectors and A is a sparse unit , or   
    +   non-unit, upper or lower triangular matrix.   
    +   No test for singularity or near-singularity is included in this   
    +   routine. Such tests must be performed before calling this routine.

    +

       Parameters   
    +   ==========

    +

       uplo   - (input) char*
    +            On entry, uplo specifies whether the matrix is an upper or   
    +             lower triangular matrix as follows:   
    +                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    +                uplo = 'L' or 'l'   A is a lower triangular matrix.

    +

       trans  - (input) char*
    +             On entry, trans specifies the equations to be solved as   
    +             follows:   
    +                trans = 'N' or 'n'   A*x = b.   
    +                trans = 'T' or 't'   A'*x = b.
    +                trans = 'C' or 'c'   A^H*x = b.

    +

       diag   - (input) char*
    +             On entry, diag specifies whether or not A is unit   
    +             triangular as follows:   
    +                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    +                diag = 'N' or 'n'   A is not assumed to be unit   
    +                                    triangular.

    +

       L       - (input) SuperMatrix*
    +	       The factor L from the factorization Pr*A*Pc=L*U. Use
    +             compressed row subscripts storage for supernodes,
    +             i.e., L has types: Stype = SC, Dtype = SLU_Z, Mtype = TRLU.

    +

       U       - (input) SuperMatrix*
    +	        The factor U from the factorization Pr*A*Pc=L*U.
    +	        U has types: Stype = NC, Dtype = SLU_Z, Mtype = TRU.

    +

       x       - (input/output) doublecomplex*
    +             Before entry, the incremented array X must contain the n   
    +             element right-hand side vector b. On exit, X is overwritten 
    +             with the solution vector x.

    +

       info    - (output) int*
    +             If *info = -i, the i-th argument had an illegal value.
    + 
    +
    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zlsolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The unit lower triangular matrix is stored in a 2D array M(1:nrow,1:ncol). The solution will be returned in the rhs vector. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zmatvec (int  ldm,
    int  nrow,
    int  ncol,
    doublecomplex M,
    doublecomplex vec,
    doublecomplex Mxvec 
    )
    +
    +
    + +

    +The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zusolve (int  ldm,
    int  ncol,
    doublecomplex M,
    doublecomplex rhs 
    )
    +
    +
    + +

    +The upper triangular matrix is stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned in the rhs vector. +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas3_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas3_8c.html new file mode 100644 index 0000000..232e552 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zsp__blas3_8c.html @@ -0,0 +1,199 @@ + + +SuperLU: SRC/zsp_blas3.c File Reference + + + + + +
    +

    SRC/zsp_blas3.c File Reference

    Sparse BLAS3, using some dense BLAS3 operations. More... +

    +#include "slu_zdefs.h"
    + + + + + +

    Functions

    int sp_zgemm (char *transa, char *transb, int m, int n, int k, doublecomplex alpha, SuperMatrix *A, doublecomplex *b, int ldb, doublecomplex beta, doublecomplex *c, int ldc)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 2.0) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + November 15, 1997
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int sp_zgemm (char *  transa,
    char *  transb,
    int  m,
    int  n,
    int  k,
    doublecomplex  alpha,
    SuperMatrix A,
    doublecomplex b,
    int  ldb,
    doublecomplex  beta,
    doublecomplex c,
    int  ldc 
    )
    +
    +
    + +

    +

    + Purpose   
    +   =======

    +

       sp_z performs one of the matrix-matrix operations

    +

          C := alpha*op( A )*op( B ) + beta*C,

    +

       where  op( X ) is one of

    +

          op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),

    +

       alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    +   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix.

    +

       Parameters   
    +   ==========

    +

       TRANSA - (input) char*
    +            On entry, TRANSA specifies the form of op( A ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSA = 'N' or 'n',  op( A ) = A.   
    +               TRANSA = 'T' or 't',  op( A ) = A'.   
    +               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    +            Unchanged on exit.

    +

       TRANSB - (input) char*
    +            On entry, TRANSB specifies the form of op( B ) to be used in 
    +            the matrix multiplication as follows:   
    +               TRANSB = 'N' or 'n',  op( B ) = B.   
    +               TRANSB = 'T' or 't',  op( B ) = B'.   
    +               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    +            Unchanged on exit.

    +

       M      - (input) int   
    +            On entry,  M  specifies  the number of rows of the matrix 
    +	     op( A ) and of the matrix C.  M must be at least zero. 
    +	     Unchanged on exit.

    +

       N      - (input) int
    +            On entry,  N specifies the number of columns of the matrix 
    +	     op( B ) and the number of columns of the matrix C. N must be 
    +	     at least zero.
    +	     Unchanged on exit.

    +

       K      - (input) int
    +            On entry, K specifies the number of columns of the matrix 
    +	     op( A ) and the number of rows of the matrix op( B ). K must 
    +	     be at least  zero.   
    +           Unchanged on exit.

    +

       ALPHA  - (input) doublecomplex
    +            On entry, ALPHA specifies the scalar alpha.

    +

       A      - (input) SuperMatrix*
    +            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    +            Currently, the type of A can be:
    +                Stype = NC or NCP; Dtype = SLU_Z; Mtype = GE. 
    +            In the future, more general A can be handled.

    +

       B      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    +            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    +            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    +            part of the array B must contain the matrix B, otherwise 
    +            the leading n by k part of the array B must contain the 
    +            matrix B.   
    +            Unchanged on exit.

    +

       LDB    - (input) int
    +            On entry, LDB specifies the first dimension of B as declared 
    +            in the calling (sub) program. LDB must be at least max( 1, n ).  
    +            Unchanged on exit.

    +

       BETA   - (input) doublecomplex
    +            On entry, BETA specifies the scalar beta. When BETA is   
    +            supplied as zero then C need not be set on input.

    +

       C      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    +            Before entry, the leading m by n part of the array C must 
    +            contain the matrix C,  except when beta is zero, in which 
    +            case C need not be set on entry.   
    +            On exit, the array C is overwritten by the m by n matrix 
    +	     ( alpha*op( A )*B + beta*C ).

    +

       LDC    - (input) int
    +            On entry, LDC specifies the first dimension of C as declared 
    +            in the calling (sub)program. LDC must be at least max(1,m).   
    +            Unchanged on exit.

    +

       ==== Sparse Level 3 Blas routine.   
    + 
    +
    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/html/zutil_8c.html b/thirdparty/superlu/SuperLU_4.1/DOC/html/zutil_8c.html new file mode 100644 index 0000000..a8471a2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DOC/html/zutil_8c.html @@ -0,0 +1,994 @@ + + +SuperLU: SRC/zutil.c File Reference + + + + + +
    +

    SRC/zutil.c File Reference

    Matrix utility functions. More... +

    +#include <math.h>
    +#include "slu_zdefs.h"
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Functions

    void zCreate_CompCol_Matrix (SuperMatrix *A, int m, int n, int nnz, doublecomplex *nzval, int *rowind, int *colptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
     Supernodal LU factor related.
    void zCreate_CompRow_Matrix (SuperMatrix *A, int m, int n, int nnz, doublecomplex *nzval, int *colind, int *rowptr, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void zCopy_CompCol_Matrix (SuperMatrix *A, SuperMatrix *B)
     Copy matrix A into matrix B.
    void zCreate_Dense_Matrix (SuperMatrix *X, int m, int n, doublecomplex *x, int ldx, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void zCopy_Dense_Matrix (int M, int N, doublecomplex *X, int ldx, doublecomplex *Y, int ldy)
    void zCreate_SuperNode_Matrix (SuperMatrix *L, int m, int n, int nnz, doublecomplex *nzval, int *nzval_colptr, int *rowind, int *rowind_colptr, int *col_to_sup, int *sup_to_col, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
    void zCompRow_to_CompCol (int m, int n, int nnz, doublecomplex *a, int *colind, int *rowptr, doublecomplex **at, int **rowind, int **colptr)
     Convert a row compressed storage into a column compressed storage.
    void zPrint_CompCol_Matrix (char *what, SuperMatrix *A)
     Routines for debugging.
    void zPrint_SuperNode_Matrix (char *what, SuperMatrix *A)
    void zPrint_Dense_Matrix (char *what, SuperMatrix *A)
    void zprint_lu_col (char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu)
     Diagnostic print of column "jcol" in the U/L factor.
    void zcheck_tempv (int n, doublecomplex *tempv)
     Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod".
    void zGenXtrue (int n, int nrhs, doublecomplex *x, int ldx)
    void zFillRHS (trans_t trans, int nrhs, doublecomplex *x, int ldx, SuperMatrix *A, SuperMatrix *B)
     Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's.
    void zfill (doublecomplex *a, int alen, doublecomplex dval)
     Fills a doublecomplex precision array with a given value.
    void zinf_norm_error (int nrhs, SuperMatrix *X, doublecomplex *xtrue)
     Check the inf-norm of the error vector.
    void zPrintPerf (SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, double rpg, double rcond, double *ferr, double *berr, char *equed, SuperLUStat_t *stat)
     Print performance of the code.
     print_doublecomplex_vec (char *what, int n, doublecomplex *vec)
    +


    Detailed Description

    +
    + -- SuperLU routine (version 3.1) --
    + Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + and Lawrence Berkeley National Lab.
    + August 1, 2008

    +

     Copyright (c) 1994 by Xerox Corporation.  All rights reserved.

    +

     THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.

    +

     Permission is hereby granted to use or copy this program for any
    + purpose, provided the above notices are retained on all copies.
    + Permission to modify the code and to distribute modified code is
    + granted, provided the above notices are retained, and a notice that
    + the code was modified is included with the above copyright notice.
    + 

    Function Documentation

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    print_doublecomplex_vec (char *  what,
    int  n,
    doublecomplex vec 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zcheck_tempv (int  n,
    doublecomplex tempv 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCompRow_to_CompCol (int  m,
    int  n,
    int  nnz,
    doublecomplex a,
    int *  colind,
    int *  rowptr,
    doublecomplex **  at,
    int **  rowind,
    int **  colptr 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zCopy_CompCol_Matrix (SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCopy_Dense_Matrix (int  M,
    int  N,
    doublecomplex X,
    int  ldx,
    doublecomplex Y,
    int  ldy 
    )
    +
    +
    + +

    + +

    +Copies a two-dimensional matrix X to another matrix Y. +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_CompCol_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    doublecomplex nzval,
    int *  rowind,
    int *  colptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_CompRow_Matrix (SuperMatrix A,
    int  m,
    int  n,
    int  nnz,
    doublecomplex nzval,
    int *  colind,
    int *  rowptr,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_Dense_Matrix (SuperMatrix X,
    int  m,
    int  n,
    doublecomplex x,
    int  ldx,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zCreate_SuperNode_Matrix (SuperMatrix L,
    int  m,
    int  n,
    int  nnz,
    doublecomplex nzval,
    int *  nzval_colptr,
    int *  rowind,
    int *  rowind_colptr,
    int *  col_to_sup,
    int *  sup_to_col,
    Stype_t  stype,
    Dtype_t  dtype,
    Mtype_t  mtype 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zfill (doublecomplex a,
    int  alen,
    doublecomplex  dval 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zFillRHS (trans_t  trans,
    int  nrhs,
    doublecomplex x,
    int  ldx,
    SuperMatrix A,
    SuperMatrix B 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zGenXtrue (int  n,
    int  nrhs,
    doublecomplex x,
    int  ldx 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void zinf_norm_error (int  nrhs,
    SuperMatrix X,
    doublecomplex xtrue 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_CompCol_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_Dense_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zprint_lu_col (char *  msg,
    int  jcol,
    int  pivrow,
    int *  xprune,
    GlobalLU_t Glu 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    void zPrint_SuperNode_Matrix (char *  what,
    SuperMatrix A 
    )
    +
    +
    + +

    + +

    +

    + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void zPrintPerf (SuperMatrix L,
    SuperMatrix U,
    mem_usage_t mem_usage,
    double  rpg,
    double  rcond,
    double *  ferr,
    double *  berr,
    char *  equed,
    SuperLUStat_t stat 
    )
    +
    +
    + +

    + +

    +

    +

    +
    Generated on Mon Nov 22 10:23:48 2010 for SuperLU by  + +doxygen 1.5.5
    + + diff --git a/thirdparty/superlu/SuperLU_4.1/DOC/ug.pdf b/thirdparty/superlu/SuperLU_4.1/DOC/ug.pdf new file mode 100644 index 0000000..087635d Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/DOC/ug.pdf differ diff --git a/thirdparty/superlu/SuperLU_4.1/DoxyConfig b/thirdparty/superlu/SuperLU_4.1/DoxyConfig new file mode 100644 index 0000000..e8d6a2a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/DoxyConfig @@ -0,0 +1,1357 @@ +# Doxyfile 1.5.5 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = SuperLU + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 4.1 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = DOC + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = No + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YEs + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = SRC/ \ + EXAMPLE/ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is enabled by default, which results in a transparent +# background. Warning: Depending on the platform used, enabling this option +# may lead to badly anti-aliased labels on the edges of a graph (i.e. they +# become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/Makefile b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/Makefile new file mode 100644 index 0000000..bfa0b79 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/Makefile @@ -0,0 +1,160 @@ +include ../make.inc + +####################################################################### +# This makefile creates the example programs for the linear equation +# routines in SuperLU. The files are grouped as follows: +# +# SLINEXM -- Single precision real example routines +# DLINEXM -- Double precision real example routines +# CLINEXM -- Double precision complex example routines +# ZLINEXM -- Double precision complex example routines +# +# Example programs can be generated for all or some of the four different +# precisions. Enter make followed by one or more of the data types +# desired. Some examples: +# make single +# make single double +# Alternatively, the command +# make +# without any arguments creates all four example programs. +# The executable files are called +# slinsol slinsolx +# dlinsol dlinsolx +# clinsol clinsolx +# zlinsol zlinsolx +# +# To remove the object files after the executable files have been +# created, enter +# make clean +# On some systems, you can force the source files to be recompiled by +# entering (for example) +# make single FRC=FRC +# +####################################################################### + +HEADER = ../SRC + +SLINEXM = slinsol.o +SLINEXM1 = slinsol1.o +SLINXEXM = slinsolx.o +SLINXEXM1 = slinsolx1.o +SLINXEXM2 = slinsolx2.o +SITSOL = sitersol.o sfgmr.o + +DLINEXM = dlinsol.o +DLINEXM1 = dlinsol1.o +DLINXEXM = dlinsolx.o +DLINXEXM1 = dlinsolx1.o +DLINXEXM2 = dlinsolx2.o +SUPERLUEXM = superlu.o sp_ienv.o +DITSOL = ditersol.o dfgmr.o + +CLINEXM = clinsol.o +CLINEXM1 = clinsol1.o +CLINXEXM = clinsolx.o +CLINXEXM1 = clinsolx1.o +CLINXEXM2 = clinsolx2.o +CITSOL = citersol.o cfgmr.o + +ZLINEXM = zlinsol.o +ZLINEXM1 = zlinsol1.o +ZLINXEXM = zlinsolx.o +ZLINXEXM1 = zlinsolx1.o +ZLINXEXM2 = zlinsolx2.o +ZITSOL = zitersol.o zfgmr.o + + +all: single double complex complex16 + +single: slinsol slinsol1 slinsolx slinsolx1 slinsolx2 sitersol +double: dlinsol dlinsol1 dlinsolx dlinsolx1 dlinsolx2 superlu ditersol +complex: clinsol clinsol1 clinsolx clinsolx1 clinsolx2 citersol +complex16: zlinsol zlinsol1 zlinsolx zlinsolx1 zlinsolx2 zitersol + +slinsol: $(SLINEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SLINEXM) $(LIBS) -lm -o $@ + +slinsol1: $(SLINEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SLINEXM1) $(LIBS) -lm -o $@ + +slinsolx: $(SLINXEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SLINXEXM) $(LIBS) -lm -o $@ + +slinsolx1: $(SLINXEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SLINXEXM1) $(LIBS) -lm -o $@ + +slinsolx2: $(SLINXEXM2) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SLINXEXM2) $(LIBS) -lm -o $@ + +sitersol: $(SITSOL) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SITSOL) $(LIBS) -lm -o $@ + +dlinsol: $(DLINEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DLINEXM) $(LIBS) -lm -o $@ + +dlinsol1: $(DLINEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DLINEXM1) $(LIBS) -lm -o $@ + +dlinsolx: $(DLINXEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DLINXEXM) $(LIBS) -lm -o $@ + +dlinsolx1: $(DLINXEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DLINXEXM1) $(LIBS) -lm -o $@ + +dlinsolx2: $(DLINXEXM2) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DLINXEXM2) $(LIBS) -lm -o $@ + +superlu: $(SUPERLUEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(SUPERLUEXM) $(LIBS) -lm -o $@ + +ditersol: $(DITSOL) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(DITSOL) $(LIBS) -lm -o $@ + +clinsol: $(CLINEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CLINEXM) $(LIBS) -lm -o $@ + +clinsol1: $(CLINEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CLINEXM1) $(LIBS) -lm -o $@ + +clinsolx: $(CLINXEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CLINXEXM) $(LIBS) -lm -o $@ + +clinsolx1: $(CLINXEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CLINXEXM1) $(LIBS) -lm -o $@ + +clinsolx2: $(CLINXEXM2) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CLINXEXM2) $(LIBS) -lm -o $@ + +citersol: $(CITSOL) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(CITSOL) $(LIBS) -lm -o $@ + +zlinsol: $(ZLINEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZLINEXM) $(LIBS) -lm -o $@ + +zlinsol1: $(ZLINEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZLINEXM1) $(LIBS) -lm -o $@ + +zlinsolx: $(ZLINXEXM) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZLINXEXM) $(LIBS) -lm -o $@ + +zlinsolx1: $(ZLINXEXM1) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZLINXEXM1) $(LIBS) -lm -o $@ + +zlinsolx2: $(ZLINXEXM2) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZLINXEXM2) $(LIBS) -lm -o $@ + +zitersol: $(ZITSOL) $(SUPERLULIB) + $(LOADER) $(LOADOPTS) $(ZITSOL) $(LIBS) -lm -o $@ + +.c.o: + $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE) + +.f.o: + $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE) + +clean: + rm -f *.o *linsol *linsol1 *linsolx *linsolx1 *linsolx2 \ + superlu *itersol + + + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/README b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/README new file mode 100644 index 0000000..c16d541 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/README @@ -0,0 +1,42 @@ + SuperLU EXAMPLES + +This directory contains sample programs to illustrate how to use +various functions provded in SuperLU. You can modify these +examples to suit your applications. + +Here are the descriptions of the double precision examples: + dlinsol : use simple driver DGSSV to solve a linear system one time. + dlinsol1: use simple driver DGSSV in the symmetric mode. + dlinsolx: use DGSSVX with the full (default) options to solve a + linear system. + dlinsolx1: use DGSSVX to factorize A first, then solve the system later. + dlinsolx2: use DGSSVX to solve systems repeatedly with the same sparsity + pattern of matrix A. + superlu : the small 5x5 sample program in Section 2 of the Users' Guide. + + ditersol: use GMRES with ILU preconditioner to solver a linear system. + (The ILU is computed by the routine SRC/dgsitrf.c) + + +To compile all the examples, type: + % make + +To run the small 5x5 sample program in Section 1 of the Users' Guide, type: + % superlu + +To run the real version examples, type: + % dlinsol < g10 (or, % slinsol < g10) + % dlinsolx -h < g10 (or, % slinsolx < g10) + % dlinsolx1 < g10 (or, % slinsolx1 < g10) + % dlinsolx2 < g10 (or, % slinsolx2 < g10) + +To run the complex version examples, type: + % zlinsol < cmat (or, % clinsol < cmat) + % zlinsolx < cmat (or, % clinsolx < cmat) + % zlinsolx1 < cmat (or, % clinsolx1 < cmat) + % zlinsolx2 < cmat (or, % clinsolx2 < cmat) + +To run the ILU preconditioner example, type: + % ditersol -h < g10 + % zitersol -h < cmat + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cfgmr.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cfgmr.c new file mode 100644 index 0000000..95ffe3a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cfgmr.c @@ -0,0 +1,334 @@ + +/*! @file cfgmr.c + * \brief flexible GMRES from ITSOL developed by Yousef Saad. + */ + +/* ITSOL COPYRIGHT + +Copyright (C) 2006, the University of Minnesota + +ITSOL 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 [version 2 of the License, or any later version] +For details, see + +http://www.gnu.org/copyleft/gpl.html + +A copy of the GNU licencing agreement is attached to the ITSOL package +in the file GNU. For additional information contact the Free Software +Foundation Inc., 65 Mass Ave, Cambridge, MA 02139, USA. + +DISCLAIMER +---------- + +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. + +For information on ITSOL contact saad@cs.umn.edu +*/ + +#include "slu_cdefs.h" + +#define epsmac 1.0e-16 + +extern void cdotc_(complex *, int *, complex [], int *, complex [], int *); +extern float scnrm2_(int *, complex [], int *); + + +int cfgmr(int n, + void (*cmatvec) (complex, complex[], complex, complex[]), + void (*cpsolve) (int, complex[], complex[]), + complex *rhs, complex *sol, double tol, int im, int *itmax, FILE * fits) +{ +/*---------------------------------------------------------------------- +| *** Preconditioned FGMRES *** ++----------------------------------------------------------------------- +| This is a simple version of the ARMS preconditioned FGMRES algorithm. ++----------------------------------------------------------------------- +| Y. S. Dec. 2000. -- Apr. 2008 ++----------------------------------------------------------------------- +| on entry: +|---------- +| +| rhs = real vector of length n containing the right hand side. +| sol = real vector of length n containing an initial guess to the +| solution on input. +| tol = tolerance for stopping iteration +| im = Krylov subspace dimension +| (itmax) = max number of iterations allowed. +| fits = NULL: no output +| != NULL: file handle to output " resid vs time and its" +| +| on return: +|---------- +| fgmr int = 0 --> successful return. +| int = 1 --> convergence not achieved in itmax iterations. +| sol = contains an approximate solution (upon successful return). +| itmax = has changed. It now contains the number of steps required +| to converge -- ++----------------------------------------------------------------------- +| internal work arrays: +|---------- +| vv = work array of length [im+1][n] (used to store the Arnoldi +| basis) +| hh = work array of length [im][im+1] (Householder matrix) +| z = work array of length [im][n] to store preconditioned vectors ++----------------------------------------------------------------------- +| subroutines called : +| matvec - matrix-vector multiplication operation +| psolve - (right) preconditionning operation +| psolve can be a NULL pointer (GMRES without preconditioner) ++---------------------------------------------------------------------*/ + + int maxits = *itmax; + int i, i1, ii, j, k, k1, its, retval, i_1 = 1, i_2 = 2; + float beta, eps1 = 0.0, t, t0, gam; + complex **hh, *c, *s, *rs; + complex **vv, **z, tt; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + complex tt1, tt2; + + its = 0; + vv = (complex **)SUPERLU_MALLOC((im + 1) * sizeof(complex *)); + for (i = 0; i <= im; i++) vv[i] = complexMalloc(n); + z = (complex **)SUPERLU_MALLOC(im * sizeof(complex *)); + hh = (complex **)SUPERLU_MALLOC(im * sizeof(complex *)); + for (i = 0; i < im; i++) + { + hh[i] = complexMalloc(i + 2); + z[i] = complexMalloc(n); + } + c = complexMalloc(im); + s = complexMalloc(im); + rs = complexMalloc(im + 1); + + /*---- outer loop starts here ----*/ + do + { + /*---- compute initial residual vector ----*/ + cmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + c_sub(&vv[0][j], &rhs[j], &vv[0][j]); /* vv[0]= initial residual */ + beta = scnrm2_(&n, vv[0], &i_1); + + /*---- print info if fits != null ----*/ + if (fits != NULL && its == 0) + fprintf(fits, "%8d %10.2e\n", its, beta); + /*if ( beta <= tol * dnrm2_(&n, rhs, &i_1) )*/ + if ( !(beta > tol * scnrm2_(&n, rhs, &i_1)) ) + break; + t = 1.0 / beta; + + /*---- normalize: vv[0] = vv[0] / beta ----*/ + for (j = 0; j < n; j++) + cs_mult(&vv[0][j], &vv[0][j], t); + if (its == 0) + eps1 = tol * beta; + + /*---- initialize 1-st term of rhs of hessenberg system ----*/ + rs[0].r = beta; + rs[0].i = 0.0; + for (i = 0; i < im; i++) + { + its++; + i1 = i + 1; + + /*------------------------------------------------------------ + | (Right) Preconditioning Operation z_{j} = M^{-1} v_{j} + +-----------------------------------------------------------*/ + if (cpsolve) + cpsolve(n, z[i], vv[i]); + else + ccopy_(&n, vv[i], &i_1, z[i], &i_1); + + /*---- matvec operation w = A z_{j} = A M^{-1} v_{j} ----*/ + cmatvec(one, z[i], zero, vv[i1]); + + /*------------------------------------------------------------ + | modified gram - schmidt... + | h_{i,j} = (w,v_{i}) + | w = w - h_{i,j} v_{i} + +------------------------------------------------------------*/ + t0 = scnrm2_(&n, vv[i1], &i_1); + for (j = 0; j <= i; j++) + { + complex negt; +#if 0 + cdotc_(&tt, &n, vv[j], &i_1, vv[i1], &i_1); +#else + tt = zero; + for (k = 0; k < n; ++k) { + cc_conj(&tt1, &vv[j][k]); + cc_mult(&tt2, &tt1, &vv[i1][k]); + c_add(&tt, &tt, &tt2); + } +#endif + hh[i][j] = tt; + negt.r = -tt.r; + negt.i = -tt.i; + caxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + + /*---- h_{j+1,j} = ||w||_{2} ----*/ + t = scnrm2_(&n, vv[i1], &i_1); + while (t < 0.5 * t0) + { + t0 = t; + for (j = 0; j <= i; j++) + { + complex negt; +#if 0 + cdotc_(&tt, &n, vv[j], &i_1, vv[i1], &i_1); +#else + tt = zero; + for (k = 0; k < n; ++k) { + cc_conj(&tt1, &vv[j][k]); + cc_mult(&tt2, &tt1, &vv[i1][k]); + c_add(&tt, &tt, &tt2); + } +#endif + c_add(&hh[i][j], &hh[i][j], &tt); + negt.r = -tt.r; + negt.i = -tt.i; + caxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + t = scnrm2_(&n, vv[i1], &i_1); + } + + hh[i][i1].r = t; + hh[i][i1].i = 0.0; + + if (t != 0.0) + { + /*---- v_{j+1} = w / h_{j+1,j} ----*/ + t = 1.0 / t; + for (k = 0; k < n; k++) + cs_mult(&vv[i1][k], &vv[i1][k], t); + } + /*--------------------------------------------------- + | done with modified gram schimdt and arnoldi step + | now update factorization of hh + +--------------------------------------------------*/ + + /*-------------------------------------------------------- + | perform previous transformations on i-th column of h + +-------------------------------------------------------*/ + for (k = 1; k <= i; k++) + { + k1 = k - 1; + tt = hh[i][k1]; + cc_mult(&tt1, &c[k1], &tt); + cc_mult(&tt2, &s[k1], &hh[i][k]); + c_add(&hh[i][k1], &tt1, &tt2); + + cc_mult(&tt1, &s[k1], &tt); + cc_mult(&tt2, &c[k1], &hh[i][k]); + c_sub(&hh[i][k], &tt2, &tt1); + } + + gam = scnrm2_(&i_2, &hh[i][i], &i_1); + + /*--------------------------------------------------- + | if gamma is zero then any small value will do + | affect only residual estimate + +--------------------------------------------------*/ + /* if (gam == 0.0) gam = epsmac; */ + + /*---- get next plane rotation ---*/ + if (gam == 0.0) + { + c[i] = one; + s[i] = zero; + } + else + { + gam = 1.0 / gam; + cs_mult(&c[i], &hh[i][i], gam); + cs_mult(&s[i], &hh[i][i1], gam); + } + + cc_mult(&rs[i1], &s[i], &rs[i]); + rs[i1].r = -rs[i1].r; rs[i1].i = -rs[i1].i; + cc_mult(&rs[i], &c[i], &rs[i]); + + /*---------------------------------------------------- + | determine residual norm and test for convergence + +---------------------------------------------------*/ + cc_mult(&tt1, &c[i], &hh[i][i]); + cc_mult(&tt2, &s[i], &hh[i][i1]); + c_add(&hh[i][i], &tt1, &tt2); + beta = c_abs1(&rs[i1]); + if (fits != NULL) + fprintf(fits, "%8d %10.2e\n", its, beta); + if (beta <= eps1 || its >= maxits) + break; + } + + if (i == im) i--; + + /*---- now compute solution. 1st, solve upper triangular system ----*/ + c_div(&rs[i], &rs[i], &hh[i][i]); + + for (ii = 1; ii <= i; ii++) + { + k = i - ii; + k1 = k + 1; + tt = rs[k]; + for (j = k1; j <= i; j++) { + cc_mult(&tt1, &hh[j][k], &rs[j]); + c_sub(&tt, &tt, &tt1); + } + c_div(&rs[k], &tt, &hh[k][k]); + } + + /*---- linear combination of v[i]'s to get sol. ----*/ + for (j = 0; j <= i; j++) + { + tt = rs[j]; + for (k = 0; k < n; k++) { + cc_mult(&tt1, &tt, &z[j][k]); + c_add(&sol[k], &sol[k], &tt1); + } + } + + /* calculate the residual and output */ + cmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + c_sub(&vv[0][j], &rhs[j], &vv[0][j]);/* vv[0]= initial residual */ + + /*---- print info if fits != null ----*/ + beta = scnrm2_(&n, vv[0], &i_1); + + /*---- restart outer loop if needed ----*/ + /*if (beta >= eps1 / tol)*/ + if ( !(beta < eps1 / tol) ) + { + its = maxits + 10; + break; + } + if (beta <= eps1) + break; + } while(its < maxits); + + retval = (its >= maxits); + for (i = 0; i <= im; i++) + SUPERLU_FREE(vv[i]); + SUPERLU_FREE(vv); + for (i = 0; i < im; i++) + { + SUPERLU_FREE(hh[i]); + SUPERLU_FREE(z[i]); + } + SUPERLU_FREE(hh); + SUPERLU_FREE(z); + SUPERLU_FREE(c); + SUPERLU_FREE(s); + SUPERLU_FREE(rs); + + *itmax = its; + + return retval; +} /*----end of fgmr ----*/ diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cg20.cua b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cg20.cua new file mode 100644 index 0000000..ea07dba --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cg20.cua @@ -0,0 +1,918 @@ +complex g20, symm. permuted by SYMMMD sym + 914 26 120 768 0 +CUA 400 400 1920 0 +(16I5) (16I5) (5E15.8) (5E15.8) + 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 + 81 86 91 96 101 106 111 116 121 126 131 136 141 146 151 156 + 161 166 171 176 181 186 191 196 201 206 210 214 218 223 228 231 + 235 239 243 248 253 257 262 266 271 276 281 286 291 295 300 304 + 309 313 318 323 328 332 337 342 347 352 357 362 367 372 377 382 + 387 392 397 402 407 412 417 422 427 432 437 442 447 452 457 462 + 467 472 477 482 487 492 497 501 505 510 514 519 524 529 534 539 + 544 549 554 559 564 568 572 576 580 583 588 593 597 601 606 610 + 614 619 624 629 634 639 644 649 654 659 664 669 674 678 682 686 + 691 696 701 706 710 714 718 723 728 732 737 742 747 752 757 762 + 767 772 777 781 786 791 796 800 805 810 815 820 825 830 835 839 + 844 849 854 859 864 869 874 879 884 889 894 899 904 909 914 919 + 923 928 932 937 941 946 951 956 961 966 971 976 981 986 991 996 + 1001 1006 1011 1015 1020 1024 1029 1033 1038 1043 1048 1053 1058 1063 1068 1073 + 1078 1083 1088 1093 1098 1103 1108 1113 1117 1122 1126 1130 1133 1138 1142 1147 + 1152 1156 1161 1165 1170 1174 1179 1183 1188 1193 1198 1203 1208 1212 1217 1221 + 1226 1230 1235 1240 1245 1249 1254 1259 1264 1269 1274 1279 1284 1288 1293 1298 + 1303 1308 1313 1317 1322 1327 1332 1337 1342 1347 1352 1357 1362 1367 1372 1377 + 1382 1387 1392 1397 1402 1407 1412 1417 1422 1427 1432 1437 1442 1446 1451 1455 + 1459 1464 1468 1472 1477 1482 1487 1492 1497 1501 1506 1510 1515 1519 1522 1526 + 1530 1535 1539 1544 1549 1554 1559 1563 1568 1573 1578 1583 1587 1592 1596 1601 + 1605 1610 1615 1620 1625 1630 1635 1640 1645 1650 1655 1660 1665 1670 1674 1679 + 1684 1689 1694 1699 1704 1709 1714 1719 1724 1729 1734 1738 1743 1748 1753 1758 + 1763 1768 1773 1778 1783 1788 1792 1797 1802 1807 1811 1816 1821 1826 1831 1836 + 1841 1846 1851 1856 1861 1866 1871 1876 1881 1886 1891 1896 1901 1906 1911 1916 + 1921 + 1 9 32 391 395 2 9 392 395 400 3 8 389 393 394 4 + 8 9 392 394 5 7 8 381 389 6 7 8 9 32 5 6 + 7 33 382 3 4 5 6 8 1 2 4 6 9 10 31 396 + 398 399 11 18 29 30 31 12 18 31 397 399 13 17 386 387 + 388 14 17 18 30 387 15 17 383 388 390 16 17 18 390 397 + 13 14 15 16 17 11 12 14 16 18 19 28 33 380 382 20 + 22 28 29 33 21 22 29 31 398 20 21 22 32 391 23 27 + 379 384 385 24 27 28 379 380 25 27 30 385 387 26 27 28 + 29 30 23 24 25 26 27 19 20 24 26 28 11 20 21 26 + 29 11 14 25 26 30 10 11 12 21 31 1 6 22 32 33 + 7 19 20 32 33 34 74 92 370 372 35 40 70 174 176 36 + 40 91 174 177 37 39 40 70 71 38 39 40 90 91 37 38 + 39 74 92 35 36 37 38 40 41 56 70 71 73 42 44 55 + 56 43 44 175 176 42 43 44 45 44 45 56 70 176 46 54 + 55 56 73 47 49 53 48 49 54 55 47 48 49 52 50 51 + 53 69 50 51 52 68 72 49 51 52 53 54 47 50 52 53 + 46 48 52 54 72 42 46 48 55 41 42 45 46 56 57 59 + 67 68 72 58 59 67 74 372 57 58 59 71 73 60 66 67 + 372 373 61 62 65 69 61 62 66 67 68 63 64 65 374 63 + 64 66 371 373 61 63 65 66 60 62 64 65 66 57 58 60 + 62 67 51 57 62 68 69 50 61 68 69 35 37 41 45 70 + 37 41 59 71 74 51 54 57 72 73 41 46 59 72 73 34 + 39 58 71 74 75 89 369 381 389 76 78 92 370 375 77 78 + 89 369 375 76 77 78 88 90 79 87 91 177 178 80 87 88 + 90 91 81 86 87 173 178 82 86 173 379 380 83 85 86 87 + 88 84 85 86 380 382 83 84 85 89 381 81 82 83 84 86 + 79 80 81 83 87 78 80 83 88 89 75 77 85 88 89 38 + 78 80 90 92 36 38 79 80 91 34 39 76 90 92 93 172 + 385 386 387 94 98 168 169 170 95 98 169 172 386 96 98 109 + 170 171 97 98 109 386 388 94 95 96 97 98 99 108 377 383 + 390 100 108 376 377 378 101 107 109 167 171 102 107 109 383 388 + 103 106 107 167 104 106 108 378 105 106 107 108 383 103 104 105 + 106 101 102 103 105 107 99 100 104 105 108 96 97 101 102 109 + 110 166 173 379 384 111 132 138 162 164 112 132 138 168 169 113 + 131 132 163 164 114 130 131 132 168 115 129 130 168 170 116 123 + 128 129 130 117 121 123 128 118 120 131 163 119 120 121 123 118 + 119 120 122 117 119 121 120 122 123 130 131 116 117 119 122 123 + 124 127 128 129 125 127 167 171 126 127 129 170 171 124 125 126 + 127 116 117 124 128 115 116 124 126 129 114 115 116 122 130 113 + 114 118 122 131 111 112 113 114 132 133 137 138 162 165 134 137 + 165 166 384 135 137 138 169 172 136 137 172 384 385 133 134 135 + 136 137 111 112 133 135 138 139 145 174 175 176 140 145 161 174 + 177 141 143 145 175 142 143 153 160 141 142 143 144 143 144 145 + 160 161 139 140 141 144 145 146 152 153 159 160 147 152 159 162 + 165 148 150 152 153 149 150 163 164 148 149 150 151 150 151 152 + 162 164 146 147 148 151 152 142 146 148 153 154 158 159 160 161 + 155 158 161 177 178 156 158 159 165 166 157 158 166 173 178 154 + 155 156 157 158 146 147 154 156 159 142 144 146 154 160 140 144 + 154 155 161 111 133 147 151 162 113 118 149 163 111 113 149 151 + 164 133 134 147 156 165 110 134 156 157 166 101 103 125 167 94 + 112 114 115 168 94 95 112 135 169 94 96 115 126 170 96 101 + 125 126 171 93 95 135 136 172 81 82 110 157 173 35 36 139 + 140 174 43 139 141 175 35 43 45 139 176 36 79 140 155 177 + 79 81 155 157 178 179 183 201 369 375 180 183 200 201 274 181 + 183 369 389 393 182 183 272 274 393 179 180 181 182 183 184 188 + 370 372 373 185 188 199 371 373 186 188 201 370 375 187 188 199 + 200 201 184 185 186 187 188 189 198 200 274 277 190 198 273 276 + 277 191 197 198 199 200 192 193 196 374 192 193 197 199 371 194 + 195 196 275 194 195 197 198 276 192 194 196 197 191 193 195 196 + 197 189 190 191 195 198 185 187 191 193 199 180 187 189 191 200 + 179 180 186 187 201 202 271 272 393 394 203 207 272 274 277 204 + 207 218 273 277 205 207 267 271 272 206 207 218 266 267 203 204 + 205 206 207 208 217 218 266 268 209 217 265 268 270 210 216 217 + 218 273 211 212 215 275 211 212 216 273 276 213 214 215 269 213 + 214 216 217 270 211 213 215 216 210 212 214 215 216 208 209 210 + 214 217 204 206 208 210 218 219 223 271 392 394 220 223 229 267 + 271 221 223 365 392 400 222 223 229 365 366 219 220 221 222 223 + 224 228 229 266 267 225 228 263 266 268 226 228 229 264 366 227 + 228 262 263 264 224 225 226 227 228 220 222 224 226 229 230 249 + 263 265 268 231 239 248 249 265 232 233 238 269 232 233 239 265 + 270 234 236 237 238 235 236 237 247 234 235 236 234 235 237 239 + 248 232 234 238 239 231 233 237 238 239 240 246 249 262 263 241 + 242 245 247 241 242 246 248 249 243 244 245 261 243 244 246 260 + 262 241 243 245 246 240 242 244 245 246 235 241 247 248 231 237 + 242 247 248 230 231 240 242 249 250 259 264 364 366 251 259 260 + 262 264 252 258 259 364 367 253 254 257 261 253 254 258 259 260 + 255 256 257 363 255 256 258 367 368 253 255 257 258 252 254 256 + 257 258 250 251 252 254 259 244 251 254 260 261 243 253 260 261 + 227 240 244 251 262 225 227 230 240 263 226 227 250 251 264 209 + 230 231 233 265 206 208 224 225 266 205 206 220 224 267 208 209 + 225 230 268 213 232 269 270 209 214 233 269 270 202 205 219 220 + 271 182 202 203 205 272 190 204 210 212 273 180 182 189 203 274 + 194 211 275 276 190 195 212 275 276 189 190 203 204 277 278 283 + 289 395 400 279 283 289 361 362 280 282 283 391 395 281 282 283 + 359 361 280 281 282 396 398 278 279 280 281 283 284 288 289 365 + 400 285 288 364 365 366 286 288 289 360 362 287 288 360 364 367 + 284 285 286 287 288 278 279 284 286 289 290 292 298 396 399 291 + 292 298 355 357 290 291 292 358 359 293 297 377 390 397 294 297 + 298 397 399 295 297 356 376 377 296 297 298 355 356 293 294 295 + 296 297 290 291 294 296 298 299 328 351 355 357 300 308 328 355 + 356 301 307 326 327 302 307 308 326 328 303 306 376 378 304 306 + 307 308 305 306 308 356 376 303 304 305 306 301 302 304 307 300 + 302 304 305 308 309 311 326 328 351 310 311 324 326 327 309 310 + 311 325 353 312 323 325 352 353 313 314 322 350 313 314 323 352 + 354 315 316 320 322 315 316 321 323 325 317 319 324 327 318 319 + 320 317 318 319 321 315 318 320 321 316 319 320 321 324 313 315 + 322 323 312 314 316 322 323 310 317 321 324 325 311 312 316 324 + 325 301 302 309 310 326 301 310 317 327 299 300 302 309 328 329 + 338 349 360 362 330 338 360 367 368 331 337 338 348 349 332 333 + 336 363 332 333 337 338 368 334 335 336 350 334 335 337 348 354 + 332 334 336 337 331 333 335 336 337 329 330 331 333 338 339 347 + 358 359 361 340 347 349 361 362 341 346 347 348 349 342 346 348 + 352 354 343 345 346 347 358 344 345 346 352 353 343 344 345 351 + 357 341 342 343 344 346 339 340 341 343 347 331 335 341 342 348 + 329 331 340 341 349 313 334 350 354 299 309 345 351 353 312 314 + 342 344 352 311 312 344 351 353 314 335 342 350 354 291 296 299 + 300 355 295 296 300 305 356 291 299 345 357 358 292 339 343 357 + 358 281 292 339 359 396 286 287 329 330 360 279 281 339 340 361 + 279 286 329 340 362 255 332 363 368 250 252 285 287 364 221 222 + 284 285 365 222 226 250 285 366 252 256 287 330 367 256 330 333 + 363 368 75 77 179 181 369 34 76 184 186 370 64 185 193 371 + 374 34 58 60 184 372 60 64 184 185 373 63 192 371 374 76 + 77 179 186 375 100 295 303 305 376 99 100 293 295 377 100 104 + 303 378 23 24 82 110 379 19 24 82 84 380 5 75 85 381 + 382 7 19 84 381 382 15 99 102 105 383 23 110 134 136 384 + 23 25 93 136 385 13 93 95 97 386 13 14 25 93 387 13 + 15 97 102 388 3 5 75 181 389 15 16 99 293 390 1 22 + 280 391 398 2 4 219 221 392 3 181 182 202 393 3 4 202 + 219 394 1 2 278 280 395 10 282 290 359 396 12 16 293 294 + 397 10 21 282 391 398 10 12 290 294 399 2 221 278 284 400 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 + 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00 4.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 +-1.00000000E+00 1.00000000E+00-1.00000000E+00 1.00000000E+00-1.00000000E+00 + 1.00000000E+00-1.00000000E+00 1.00000000E+00 4.00000000E+00 1.00000000E+00 diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/citersol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/citersol.c new file mode 100644 index 0000000..04321dc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/citersol.c @@ -0,0 +1,317 @@ + +#include "slu_cdefs.h" +/* + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Laboratory + * November, 2010 + */ + +int *GLOBAL_PERM_C, *GLOBAL_PERM_R; +SuperMatrix *GLOBAL_A, *GLOBAL_L, *GLOBAL_U; +SuperLUStat_t *GLOBAL_STAT; + +void cmatvec_mult(complex alpha, complex x[], complex beta, complex y[]) +{ + SuperMatrix *A = GLOBAL_A; + + sp_cgemv("N", alpha, A, x, 1, beta, y, 1); +} + +void cpsolve(int n, complex x[], complex y[]) +{ + extern void ccopy_(int *, complex [], int *, complex [], int *); + + int i_1 = 1; + SuperMatrix *L = GLOBAL_L, *U = GLOBAL_U; + SuperLUStat_t *stat = GLOBAL_STAT; + int *perm_c = GLOBAL_PERM_C, *perm_r = GLOBAL_PERM_R; + int info; + static DNformat X; + static SuperMatrix XX = {SLU_DN, SLU_C, SLU_GE, 1, 1, &X}; + + ccopy_(&n, y, &i_1, x, &i_1); + XX.nrow = n; + X.lda = n; + X.nzval = x; + cgstrs(NOTRANS, L, U, perm_c, perm_r, &XX, stat, &info); +} + +int main(int argc, char *argv[]) +{ + void cmatvec_mult(complex alpha, complex x[], complex beta, complex y[]); + void cpsolve(int n, complex x[], complex y[]); + extern int cfgmr( int n, + void (*matvec_mult)(complex, complex [], complex, complex []), + void (*psolve)(int n, complex [], complex[]), + complex *rhs, complex *sol, double tol, int restrt, int *itmax, + FILE *fits); + extern int cfill_diag(int n, NCformat *Astore); + + char equed[1] = {'B'}; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + complex *a; + int *asub, *xa; + int *etree; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int nrhs, ldx, lwork, info, m, n, nnz; + complex *rhsb, *rhsx, *xact; + complex *work = NULL; + float *R, *C; + float u, rpg, rcond; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + complex none = {-1.0, 0.0}; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + + int restrt, iter, maxit, i; + double resid; + complex *x, *b; + +#ifdef DEBUG + extern int num_drop_L, num_drop_U; +#endif + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 0.1; /* u=1.0 for complete factorization */ + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 0.1; //different from complete LU + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + options.RowPerm = LargeDiag; + options.ILU_DropTol = 1e-4; + options.ILU_FillTol = 1e-2; + options.ILU_FillFactor = 10.0; + options.ILU_DropRule = DROP_BASIC | DROP_AREA; + options.ILU_Norm = INF_NORM; + options.ILU_MILU = SILU; + */ + ilu_set_default_options(&options); + + /* Modify the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) ABORT("Malloc fails for work[]."); + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + if (argc < 2) + { + printf("Usage:\n%s [OPTION] < [INPUT] > [OUTPUT]\nOPTION:\n" + "-h -hb:\n\t[INPUT] is a Harwell-Boeing format matrix.\n" + "-r -rb:\n\t[INPUT] is a Rutherford-Boeing format matrix.\n" + "-t -triplet:\n\t[INPUT] is a triplet format matrix.\n", + argv[0]); + return 0; + } + else + { + switch (argv[1][1]) + { + case 'H': + case 'h': + printf("Input a Harwell-Boeing format matrix:\n"); + creadhb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'R': + case 'r': + printf("Input a Rutherford-Boeing format matrix:\n"); + creadrb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'T': + case 't': + printf("Input a triplet format matrix:\n"); + creadtriple(&m, &n, &nnz, &a, &asub, &xa); + break; + default: + printf("Unrecognized format.\n"); + return 0; + } + } + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + cfill_diag(n, Astore); + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + fflush(stdout); + + if ( !(rhsb = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + + info = 0; +#ifdef DEBUG + num_drop_L = 0; + num_drop_U = 0; +#endif + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Compute the incomplete factorization and compute the condition number + and pivot growth using dgsisx. */ + cgsisx(&options, &A, perm_c, perm_r, etree, equed, R, C, &L, &U, work, + lwork, &B, &X, &rpg, &rcond, &mem_usage, &stat, &info); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("cgsisx(): info %d\n", info); + if (info > 0 || rcond < 1e-8 || rpg > 1e8) + printf("WARNING: This preconditioner might be unstable.\n"); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + printf("n(A) = %d, nnz(A) = %d\n", n, Astore->nnz); + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("Fill ratio: nnz(F)/nnz(A) = %.3f\n", + ((double)(Lstore->nnz) + (double)(Ustore->nnz) - (double)n) + / (double)Astore->nnz); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + /* Set the global variables. */ + GLOBAL_A = &A; + GLOBAL_L = &L; + GLOBAL_U = &U; + GLOBAL_STAT = &stat; + GLOBAL_PERM_C = perm_c; + GLOBAL_PERM_R = perm_r; + + /* Set the variables used by GMRES. */ + restrt = SUPERLU_MIN(n / 3 + 1, 50); + maxit = 1000; + iter = maxit; + resid = 1e-8; + if (!(b = complexMalloc(m))) ABORT("Malloc fails for b[]."); + if (!(x = complexMalloc(n))) ABORT("Malloc fails for x[]."); + + if (info <= n + 1) + { + int i_1 = 1; + double maxferr = 0.0, nrmA, nrmB, res, t; + complex temp; + extern float scnrm2_(int *, complex [], int *); + extern void caxpy_(int *, complex *, complex [], int *, complex [], int *); + + /* Call GMRES. */ + for (i = 0; i < n; i++) b[i] = rhsb[i]; + for (i = 0; i < n; i++) x[i] = zero; + + t = SuperLU_timer_(); + + cfgmr(n, cmatvec_mult, cpsolve, b, x, resid, restrt, &iter, stdout); + + t = SuperLU_timer_() - t; + + /* Output the result. */ + nrmA = scnrm2_(&(Astore->nnz), (complex *)((DNformat *)A.Store)->nzval, + &i_1); + nrmB = scnrm2_(&m, b, &i_1); + sp_cgemv("N", none, &A, x, 1, one, b, 1); + res = scnrm2_(&m, b, &i_1); + resid = res / nrmB; + printf("||A||_F = %.1e, ||B||_2 = %.1e, ||B-A*X||_2 = %.1e, " + "relres = %.1e\n", nrmA, nrmB, res, resid); + + if (iter >= maxit) + { + if (resid >= 1.0) iter = -180; + else if (resid > 1e-8) iter = -111; + } + printf("iteration: %d\nresidual: %.1e\nGMRES time: %.2f seconds.\n", + iter, resid, t); + + /* Scale the solution back if equilibration was performed. */ + if (*equed == 'C' || *equed == 'B') + for (i = 0; i < n; i++) cs_mult(&x[i], &x[i], C[i]); + + for (i = 0; i < m; i++) { + c_sub(&temp, &x[i], &xact[i]); + maxferr = SUPERLU_MAX(maxferr, c_abs1(&temp)); + } + printf("||X-X_true||_oo = %.1e\n", maxferr); + } +#ifdef DEBUG + printf("%d entries in L and %d entries in U dropped.\n", + num_drop_L, num_drop_U); +#endif + fflush(stdout); + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork >= 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + SUPERLU_FREE(b); + SUPERLU_FREE(x); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol.c new file mode 100644 index 0000000..b0e9938 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol.c @@ -0,0 +1,115 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_cdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + complex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + complex *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Read the matrix in Harwell-Boeing format. */ + creadhb(&m, &n, &nnz, &a, &asub, &xa); + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + cgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + cinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + cQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("cgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + cQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol1.c new file mode 100644 index 0000000..b2807df --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsol1.c @@ -0,0 +1,120 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_cdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + complex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + complex *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Now we modify the default options to use the symmetric mode. */ + options.SymmetricMode = YES; + options.ColPerm = MMD_AT_PLUS_A; + options.DiagPivotThresh = 0.001; + + /* Read the matrix in Harwell-Boeing format. */ + creadhb(&m, &n, &nnz, &a, &asub, &xa); + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + cgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + cinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + cQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("cgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + cQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx.c new file mode 100644 index 0000000..8a49cca --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx.c @@ -0,0 +1,212 @@ + +/* + * -- SuperLU routine (version 3.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * August 1, 2008 + * + */ +#include "slu_cdefs.h" + +main(int argc, char *argv[]) +{ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + complex *a; + int *asub, *xa; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + complex *rhsb, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + /* Add more functionalities that the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + options.IterRefine = SINGLE; /* Perform single-precision refinement */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("CLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + creadhb(&m, &n, &nnz, &a, &asub, &xa); + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Solve the system and compute the condition number + and error bounds using dgssvx. */ + + cgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("cgssvx(): info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + if ( options.IterRefine != NOREFINE ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + + +/* + * Parse command line inputs. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + float *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx1.c new file mode 100644 index 0000000..0f9340c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx1.c @@ -0,0 +1,241 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_cdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program CLINSOLX1. + * + * This example illustrates how to use CGSSVX to solve systems with the same + * A but different right-hand side. + * In this case, we factorize A only once in the first call to DGSSVX, + * and reuse the following data structures in the subsequent call to CGSSVX: + * perm_c, perm_r, R, C, L, U. + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + complex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + complex *rhsb, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default values for options argument: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("CLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + creadhb(&m, &n, &nnz, &a, &asub, &xa); + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ONLY PERFORM THE LU DECOMPOSITION */ + B.ncol = 0; /* Indicate not to solve the system */ + cgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("LU factorization: cgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + /* ------------------------------------------------------------ + NOW WE SOLVE THE LINEAR SYSTEM USING THE FACTORED FORM OF A. + ------------------------------------------------------------*/ + options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ + B.ncol = nrhs; /* Set the number of right-hand side */ + + /* Initialize the statistics variables. */ + StatInit(&stat); + + cgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("Triangular solve: cgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) X.Store)->nzval; + + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + float *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx2.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx2.c new file mode 100644 index 0000000..26afae8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/clinsolx2.c @@ -0,0 +1,277 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_cdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program CLINSOLX2. + * + * This example illustrates how to use CGSSVX to solve systems repeatedly + * with the same sparsity pattern of matrix A. + * In this case, the column permutation vector perm_c is computed once. + * The following data structures will be reused in the subsequent call to + * CGSSVX: perm_c, etree + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, A1, L, U; + SuperMatrix B, B1, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + complex *a, *a1; + int *asub, *xa, *asub1, *xa1; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, j, m, n, nnz; + complex *rhsb, *rhsb1, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + creadhb(&m, &n, &nnz, &a, &asub, &xa); + if ( !(a1 = complexMalloc(nnz)) ) ABORT("Malloc fails for a1[]."); + if ( !(asub1 = intMalloc(nnz)) ) ABORT("Malloc fails for asub1[]."); + if ( !(xa1 = intMalloc(n+1)) ) ABORT("Malloc fails for xa1[]."); + for (i = 0; i < nnz; ++i) { + a1[i] = a[i]; + asub1[i] = asub[i]; + } + for (i = 0; i < n+1; ++i) xa1[i] = xa[i]; + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsb1 = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb1[]."); + if ( !(rhsx = complexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + cCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + ldx = n; + cGenXtrue(n, nrhs, xact, ldx); + cFillRHS(trans, nrhs, xact, ldx, &A, &B); + for (j = 0; j < nrhs; ++j) + for (i = 0; i < m; ++i) rhsb1[i+j*m] = rhsb[i+j*m]; + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ------------------------------------------------------------ + WE SOLVE THE LINEAR SYSTEM FOR THE FIRST TIME: AX = B + ------------------------------------------------------------*/ + cgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("First system: cgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + Destroy_CompCol_Matrix(&A); + Destroy_Dense_Matrix(&B); + if ( lwork >= 0 ) { /* Deallocate storage associated with L and U. */ + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + /* ------------------------------------------------------------ + NOW WE SOLVE ANOTHER LINEAR SYSTEM: A1*X = B1 + ONLY THE SPARSITY PATTERN OF A1 IS THE SAME AS THAT OF A. + ------------------------------------------------------------*/ + options.Fact = SamePattern; + StatInit(&stat); /* Initialize the statistics variables. */ + + cCreate_CompCol_Matrix(&A1, m, n, nnz, a1, asub1, xa1, + SLU_NC, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&B1, m, nrhs, rhsb1, m, SLU_DN, SLU_C, SLU_GE); + + cgssvx(&options, &A1, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B1, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("\nSecond system: cgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + complex *sol = (complex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A1); + Destroy_Dense_Matrix(&B1); + Destroy_Dense_Matrix(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cmat b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cmat new file mode 100644 index 0000000..cad51d0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/cmat @@ -0,0 +1,10968 @@ +Complex key + 10964 99 1753 9112 0 +CUA 1280 1280 22778 0 +(13I6) (13I6) (5E15.8) (5E15.8) + 1 2 3 4 5 6 7 8 9 10 11 12 13 + 14 15 19 23 29 35 41 47 53 59 65 71 77 + 83 89 95 101 107 113 119 125 131 137 143 149 155 + 161 167 173 179 185 191 197 203 209 215 221 227 233 + 239 243 247 253 259 265 271 277 283 289 295 301 307 + 313 319 325 331 337 343 349 355 361 367 373 379 385 + 391 397 403 409 415 421 427 433 439 445 451 457 463 + 469 475 481 487 491 495 501 507 513 519 525 531 537 + 543 549 555 561 567 573 579 585 591 597 603 609 615 + 621 627 633 639 645 651 657 663 669 675 681 687 693 + 699 705 711 715 719 725 731 737 743 749 755 761 767 + 773 779 785 791 797 803 809 815 821 827 833 839 845 + 851 857 863 869 875 881 887 893 899 905 911 917 923 + 929 935 941 947 953 959 965 971 977 983 989 999 1009 + 1015 1021 1031 1041 1047 1053 1063 1073 1079 1085 1095 1105 1111 + 1117 1127 1137 1143 1149 1159 1169 1175 1181 1191 1201 1207 1217 + 1223 1229 1239 1245 1255 1265 1271 1281 1291 1297 1303 1313 1319 + 1325 1335 1341 1351 1361 1367 1377 1387 1393 1399 1409 1415 1421 + 1431 1437 1447 1457 1463 1473 1483 1489 1495 1505 1511 1517 1527 + 1533 1543 1553 1559 1565 1571 1577 1583 1593 1599 1609 1615 1621 + 1631 1641 1647 1653 1663 1673 1679 1685 1695 1705 1711 1717 1727 + 1737 1743 1749 1759 1769 1775 1781 1791 1801 1807 1817 1823 1829 + 1839 1845 1855 1865 1871 1881 1891 1897 1903 1913 1919 1925 1935 + 1941 1951 1961 1967 1977 1987 1993 1999 2009 2015 2021 2031 2037 + 2047 2057 2063 2073 2083 2089 2095 2105 2111 2117 2127 2133 2143 + 2153 2159 2169 2179 2189 2199 2205 2211 2217 2223 2229 2235 2241 + 2251 2261 2267 2273 2283 2293 2299 2305 2315 2325 2331 2337 2347 + 2357 2363 2369 2379 2389 2395 2401 2411 2421 2427 2433 2443 2453 + 2459 2469 2475 2481 2491 2497 2507 2517 2523 2533 2543 2549 2555 + 2565 2571 2577 2587 2593 2603 2613 2619 2629 2639 2645 2651 2661 + 2667 2673 2683 2689 2699 2709 2715 2725 2735 2741 2747 2757 2763 + 2769 2779 2785 2795 2805 2811 2817 2823 2829 2835 2845 2851 2861 + 2867 2873 2883 2893 2899 2905 2915 2925 2931 2937 2947 2957 2963 + 2969 2979 2989 2995 3001 3011 3021 3027 3033 3043 3053 3059 3069 + 3075 3081 3091 3097 3107 3117 3123 3133 3143 3149 3155 3165 3171 + 3177 3187 3193 3203 3213 3219 3229 3239 3245 3251 3261 3267 3273 + 3283 3289 3299 3309 3315 3325 3335 3341 3347 3357 3363 3369 3379 + 3385 3395 3405 3411 3421 3431 3441 3451 3457 3463 3475 3487 3499 + 3511 3523 3535 3549 3569 3589 3609 3629 3649 3669 3683 3697 3719 + 3741 3763 3785 3807 3829 3843 3857 3879 3901 3923 3945 3967 3989 + 4003 4017 4039 4061 4083 4105 4127 4149 4163 4177 4199 4221 4243 + 4265 4287 4309 4323 4337 4359 4381 4403 4425 4447 4469 4483 4497 + 4519 4541 4563 4585 4607 4629 4643 4657 4679 4701 4723 4745 4767 + 4789 4803 4817 4839 4861 4883 4905 4927 4949 4963 4977 4999 5021 + 5043 5065 5087 5109 5123 5137 5159 5181 5203 5225 5247 5269 5283 + 5297 5319 5341 5363 5385 5407 5429 5443 5465 5487 5509 5531 5553 + 5575 5589 5603 5625 5639 5653 5675 5697 5719 5741 5763 5777 5799 + 5821 5843 5865 5887 5909 5923 5945 5967 5989 6011 6033 6055 6069 + 6083 6105 6119 6133 6155 6177 6199 6221 6243 6257 6279 6301 6323 + 6345 6367 6389 6403 6417 6431 6445 6459 6473 6487 6501 6515 6537 + 6551 6573 6587 6609 6631 6653 6675 6689 6711 6733 6755 6777 6799 + 6821 6835 6849 6871 6893 6915 6937 6959 6981 6995 7009 7031 7053 + 7075 7097 7119 7141 7155 7169 7191 7213 7235 7257 7279 7301 7315 + 7329 7351 7373 7395 7417 7439 7461 7475 7489 7511 7533 7555 7577 + 7599 7621 7635 7649 7671 7693 7715 7737 7759 7781 7795 7809 7831 + 7853 7875 7897 7919 7941 7955 7969 7991 8013 8035 8057 8079 8101 + 8115 8129 8151 8173 8195 8217 8239 8261 8275 8289 8311 8333 8355 + 8377 8399 8421 8435 8457 8479 8501 8523 8545 8567 8581 8595 8617 + 8631 8645 8667 8689 8711 8733 8755 8769 8791 8813 8835 8857 8879 + 8901 8915 8937 8959 8981 9003 9025 9047 9061 9075 9097 9111 9125 + 9147 9169 9191 9213 9235 9249 9271 9293 9315 9337 9359 9381 9395 + 9417 9439 9461 9483 9505 9527 9549 9571 9593 9615 9637 9659 9673 + 9687 9705 9723 9741 9759 9777 9795 9813 9831 9849 9867 9887 9917 + 9947 9977 10007 10037 10067 10097 10127 10147 10167 10187 10207 10239 10271 + 10303 10335 10367 10399 10431 10463 10483 10503 10523 10543 10575 10607 10639 + 10671 10703 10735 10767 10799 10819 10839 10859 10879 10911 10943 10975 11007 + 11039 11071 11103 11135 11155 11175 11195 11215 11247 11279 11311 11343 11375 + 11407 11439 11471 11491 11511 11531 11551 11583 11615 11647 11679 11711 11743 + 11775 11807 11827 11847 11867 11887 11919 11951 11983 12015 12047 12079 12111 + 12143 12163 12183 12203 12223 12255 12287 12319 12351 12383 12415 12447 12479 + 12499 12519 12539 12559 12591 12623 12655 12687 12719 12751 12783 12815 12835 + 12855 12875 12895 12927 12959 12991 13023 13055 13087 13119 13151 13171 13191 + 13211 13231 13263 13295 13327 13359 13391 13423 13455 13487 13507 13527 13547 + 13567 13587 13607 13627 13659 13691 13723 13755 13787 13819 13851 13883 13903 + 13923 13943 13975 14007 14039 14071 14103 14135 14167 14199 14219 14239 14259 + 14291 14323 14355 14387 14419 14451 14483 14515 14535 14555 14575 14607 14639 + 14671 14703 14735 14767 14799 14831 14851 14871 14891 14923 14955 14987 15019 + 15051 15083 15115 15147 15167 15187 15207 15227 15247 15267 15287 15307 15327 + 15359 15391 15423 15455 15487 15519 15551 15583 15615 15647 15679 15711 15743 + 15775 15807 15839 15859 15879 15899 15919 15939 15959 15979 15999 16019 16039 + 16059 16079 16099 16119 16139 16171 16203 16235 16267 16299 16319 16351 16371 + 16403 16423 16455 16475 16495 16527 16559 16591 16623 16655 16687 16719 16751 + 16771 16791 16811 16831 16863 16895 16927 16959 16991 17023 17055 17087 17107 + 17127 17147 17167 17199 17231 17263 17295 17327 17359 17391 17423 17443 17463 + 17483 17503 17535 17567 17599 17631 17663 17695 17727 17759 17779 17799 17819 + 17839 17871 17903 17935 17967 17999 18031 18063 18095 18115 18135 18155 18175 + 18207 18239 18271 18303 18335 18367 18399 18431 18451 18471 18491 18511 18543 + 18575 18607 18639 18671 18703 18735 18767 18787 18807 18827 18847 18879 18911 + 18943 18975 19007 19039 19071 19103 19123 19143 19163 19183 19215 19247 19279 + 19311 19343 19375 19407 19439 19459 19479 19499 19519 19551 19583 19615 19647 + 19679 19711 19743 19775 19795 19815 19835 19855 19887 19919 19951 19983 20015 + 20047 20079 20111 20131 20151 20171 20191 20223 20255 20287 20319 20351 20383 + 20415 20447 20467 20487 20507 20527 20559 20591 20623 20655 20687 20719 20751 + 20783 20803 20823 20843 20863 20895 20927 20959 20991 21023 21055 21087 21119 + 21139 21159 21179 21211 21243 21275 21307 21339 21371 21403 21435 21455 21475 + 21495 21515 21547 21567 21587 21607 21627 21659 21691 21723 21755 21787 21819 + 21851 21871 21903 21935 21967 21999 22031 22063 22095 22127 22147 22167 22187 + 22219 22251 22283 22315 22347 22379 22411 22443 22475 22507 22539 22571 22603 + 22635 22667 22699 22719 22739 22759 22779 + 1 3 5 7 9 11 13 15 17 19 21 23 25 + 27 29 30 61 62 29 30 61 62 29 30 61 62 + 93 94 29 30 61 62 93 94 61 62 93 94 125 + 126 61 62 93 94 125 126 93 94 125 126 157 158 + 93 94 125 126 157 158 125 126 157 158 189 190 125 + 126 157 158 189 190 157 158 189 190 221 222 157 158 + 189 190 221 222 189 190 221 222 253 254 189 190 221 + 222 253 254 221 222 253 254 285 286 221 222 253 254 + 285 286 253 254 285 286 317 318 253 254 285 286 317 + 318 285 286 317 318 349 350 285 286 317 318 349 350 + 317 318 349 350 381 382 317 318 349 350 381 382 349 + 350 381 382 413 414 349 350 381 382 413 414 381 382 + 413 414 445 446 381 382 413 414 445 446 413 414 445 + 446 477 478 413 414 445 446 477 478 445 446 477 478 + 509 510 445 446 477 478 509 510 477 478 509 510 541 + 542 477 478 509 510 541 542 509 510 541 542 573 574 + 509 510 541 542 573 574 541 542 573 574 605 606 541 + 542 573 574 605 606 573 574 605 606 637 638 573 574 + 605 606 637 638 1245 1246 1277 1278 1245 1246 1277 1278 1213 + 1214 1245 1246 1277 1278 1213 1214 1245 1246 1277 1278 1181 1182 + 1213 1214 1245 1246 1181 1182 1213 1214 1245 1246 1149 1150 1181 + 1182 1213 1214 1149 1150 1181 1182 1213 1214 1117 1118 1149 1150 + 1181 1182 1117 1118 1149 1150 1181 1182 1085 1086 1117 1118 1149 + 1150 1085 1086 1117 1118 1149 1150 1053 1054 1085 1086 1117 1118 + 1053 1054 1085 1086 1117 1118 1021 1022 1053 1054 1085 1086 1021 + 1022 1053 1054 1085 1086 989 990 1021 1022 1053 1054 989 990 + 1021 1022 1053 1054 957 958 989 990 1021 1022 957 958 989 + 990 1021 1022 925 926 957 958 989 990 925 926 957 958 + 989 990 893 894 925 926 957 958 893 894 925 926 957 + 958 861 862 893 894 925 926 861 862 893 894 925 926 + 829 830 861 862 893 894 829 830 861 862 893 894 797 + 798 829 830 861 862 797 798 829 830 861 862 765 766 + 797 798 829 830 765 766 797 798 829 830 733 734 765 + 766 797 798 733 734 765 766 797 798 701 702 733 734 + 765 766 701 702 733 734 765 766 669 670 701 702 733 + 734 669 670 701 702 733 734 637 638 669 670 701 702 + 605 606 637 638 669 670 605 606 637 638 669 670 637 + 638 669 670 701 702 31 32 63 64 31 32 63 64 + 31 32 63 64 95 96 31 32 63 64 95 96 63 + 64 95 96 127 128 63 64 95 96 127 128 95 96 + 127 128 159 160 95 96 127 128 159 160 127 128 159 + 160 191 192 127 128 159 160 191 192 159 160 191 192 + 223 224 159 160 191 192 223 224 191 192 223 224 255 + 256 191 192 223 224 255 256 223 224 255 256 287 288 + 223 224 255 256 287 288 255 256 287 288 319 320 255 + 256 287 288 319 320 287 288 319 320 351 352 287 288 + 319 320 351 352 319 320 351 352 383 384 319 320 351 + 352 383 384 351 352 383 384 415 416 351 352 383 384 + 415 416 383 384 415 416 447 448 383 384 415 416 447 + 448 415 416 447 448 479 480 415 416 447 448 479 480 + 447 448 479 480 511 512 447 448 479 480 511 512 479 + 480 511 512 543 544 479 480 511 512 543 544 511 512 + 543 544 575 576 511 512 543 544 575 576 543 544 575 + 576 607 608 543 544 575 576 607 608 575 576 607 608 + 639 640 575 576 607 608 639 640 1247 1248 1279 1280 1247 + 1248 1279 1280 1215 1216 1247 1248 1279 1280 1215 1216 1247 1248 + 1279 1280 1183 1184 1215 1216 1247 1248 1183 1184 1215 1216 1247 + 1248 1151 1152 1183 1184 1215 1216 1151 1152 1183 1184 1215 1216 + 1119 1120 1151 1152 1183 1184 1119 1120 1151 1152 1183 1184 1087 + 1088 1119 1120 1151 1152 1087 1088 1119 1120 1151 1152 1055 1056 + 1087 1088 1119 1120 1055 1056 1087 1088 1119 1120 1023 1024 1055 + 1056 1087 1088 1023 1024 1055 1056 1087 1088 991 992 1023 1024 + 1055 1056 991 992 1023 1024 1055 1056 959 960 991 992 1023 + 1024 959 960 991 992 1023 1024 927 928 959 960 991 992 + 927 928 959 960 991 992 895 896 927 928 959 960 895 + 896 927 928 959 960 863 864 895 896 927 928 863 864 + 895 896 927 928 831 832 863 864 895 896 831 832 863 + 864 895 896 799 800 831 832 863 864 799 800 831 832 + 863 864 767 768 799 800 831 832 767 768 799 800 831 + 832 735 736 767 768 799 800 735 736 767 768 799 800 + 703 704 735 736 767 768 703 704 735 736 767 768 671 + 672 703 704 735 736 671 672 703 704 735 736 639 640 + 671 672 703 704 607 608 639 640 671 672 607 608 639 + 640 671 672 639 640 671 672 703 704 2 4 33 34 + 35 36 2 4 33 34 35 36 2 4 33 34 35 + 36 2 4 33 34 35 36 34 36 65 66 67 68 + 2 4 33 34 35 36 65 66 67 68 2 4 33 + 34 35 36 65 66 67 68 34 36 65 66 67 68 + 66 68 97 98 99 100 34 36 65 66 67 68 97 + 98 99 100 34 36 65 66 67 68 97 98 99 100 + 66 68 97 98 99 100 98 100 129 130 131 132 66 + 68 97 98 99 100 129 130 131 132 66 68 97 98 + 99 100 129 130 131 132 98 100 129 130 131 132 130 + 132 161 162 163 164 98 100 129 130 131 132 161 162 + 163 164 98 100 129 130 131 132 161 162 163 164 130 + 132 161 162 163 164 162 164 193 194 195 196 130 132 + 161 162 163 164 193 194 195 196 130 132 161 162 163 + 164 193 194 195 196 162 164 193 194 195 196 194 196 + 225 226 227 228 162 164 193 194 195 196 225 226 227 + 228 162 164 193 194 195 196 225 226 227 228 194 196 + 225 226 227 228 226 228 257 258 259 260 194 196 225 + 226 227 228 257 258 259 260 194 196 225 226 227 228 + 257 258 259 260 226 228 257 258 259 260 226 228 257 + 258 259 260 289 290 291 292 258 260 289 290 291 292 + 258 260 289 290 291 292 226 228 257 258 259 260 289 + 290 291 292 290 292 321 322 323 324 258 260 289 290 + 291 292 321 322 323 324 258 260 289 290 291 292 321 + 322 323 324 290 292 321 322 323 324 290 292 321 322 + 323 324 353 354 355 356 290 292 321 322 323 324 353 + 354 355 356 322 324 353 354 355 356 322 324 353 354 + 355 356 322 324 353 354 355 356 385 386 387 388 354 + 356 385 386 387 388 354 356 385 386 387 388 322 324 + 353 354 355 356 385 386 387 388 386 388 417 418 419 + 420 354 356 385 386 387 388 417 418 419 420 354 356 + 385 386 387 388 417 418 419 420 386 388 417 418 419 + 420 386 388 417 418 419 420 449 450 451 452 386 388 + 417 418 419 420 449 450 451 452 418 420 449 450 451 + 452 418 420 449 450 451 452 418 420 449 450 451 452 + 481 482 483 484 450 452 481 482 483 484 450 452 481 + 482 483 484 418 420 449 450 451 452 481 482 483 484 + 482 484 513 514 515 516 450 452 481 482 483 484 513 + 514 515 516 450 452 481 482 483 484 513 514 515 516 + 482 484 513 514 515 516 482 484 513 514 515 516 545 + 546 547 548 482 484 513 514 515 516 545 546 547 548 + 514 516 545 546 547 548 514 516 545 546 547 548 514 + 516 545 546 547 548 577 578 579 580 546 548 577 578 + 579 580 546 548 577 578 579 580 514 516 545 546 547 + 548 577 578 579 580 578 580 609 610 611 612 546 548 + 577 578 579 580 609 610 611 612 546 548 577 578 579 + 580 609 610 611 612 578 580 609 610 611 612 1218 1220 + 1249 1250 1251 1252 1218 1220 1249 1250 1251 1252 1218 1220 1249 + 1250 1251 1252 1218 1220 1249 1250 1251 1252 1186 1188 1217 1218 + 1219 1220 1249 1250 1251 1252 1186 1188 1217 1218 1219 1220 1186 + 1188 1217 1218 1219 1220 1249 1250 1251 1252 1186 1188 1217 1218 + 1219 1220 1154 1156 1185 1186 1187 1188 1154 1156 1185 1186 1187 + 1188 1217 1218 1219 1220 1154 1156 1185 1186 1187 1188 1217 1218 + 1219 1220 1154 1156 1185 1186 1187 1188 1122 1124 1153 1154 1155 + 1156 1122 1124 1153 1154 1155 1156 1185 1186 1187 1188 1122 1124 + 1153 1154 1155 1156 1185 1186 1187 1188 1122 1124 1153 1154 1155 + 1156 1090 1092 1121 1122 1123 1124 1090 1092 1121 1122 1123 1124 + 1153 1154 1155 1156 1090 1092 1121 1122 1123 1124 1153 1154 1155 + 1156 1090 1092 1121 1122 1123 1124 1058 1060 1089 1090 1091 1092 + 1058 1060 1089 1090 1091 1092 1121 1122 1123 1124 1058 1060 1089 + 1090 1091 1092 1121 1122 1123 1124 1058 1060 1089 1090 1091 1092 + 1026 1028 1057 1058 1059 1060 1026 1028 1057 1058 1059 1060 1089 + 1090 1091 1092 1026 1028 1057 1058 1059 1060 1089 1090 1091 1092 + 1026 1028 1057 1058 1059 1060 994 996 1025 1026 1027 1028 994 + 996 1025 1026 1027 1028 1057 1058 1059 1060 994 996 1025 1026 + 1027 1028 1057 1058 1059 1060 994 996 1025 1026 1027 1028 962 + 964 993 994 995 996 1025 1026 1027 1028 962 964 993 994 + 995 996 962 964 993 994 995 996 962 964 993 994 995 + 996 1025 1026 1027 1028 930 932 961 962 963 964 930 932 + 961 962 963 964 993 994 995 996 930 932 961 962 963 + 964 993 994 995 996 930 932 961 962 963 964 898 900 + 929 930 931 932 961 962 963 964 898 900 929 930 931 + 932 961 962 963 964 898 900 929 930 931 932 898 900 + 929 930 931 932 866 868 897 898 899 900 929 930 931 + 932 866 868 897 898 899 900 866 868 897 898 899 900 + 866 868 897 898 899 900 929 930 931 932 834 836 865 + 866 867 868 834 836 865 866 867 868 897 898 899 900 + 834 836 865 866 867 868 897 898 899 900 834 836 865 + 866 867 868 802 804 833 834 835 836 865 866 867 868 + 802 804 833 834 835 836 865 866 867 868 802 804 833 + 834 835 836 802 804 833 834 835 836 770 772 801 802 + 803 804 833 834 835 836 770 772 801 802 803 804 770 + 772 801 802 803 804 770 772 801 802 803 804 833 834 + 835 836 738 740 769 770 771 772 738 740 769 770 771 + 772 801 802 803 804 738 740 769 770 771 772 801 802 + 803 804 738 740 769 770 771 772 706 708 737 738 739 + 740 769 770 771 772 706 708 737 738 739 740 769 770 + 771 772 706 708 737 738 739 740 706 708 737 738 739 + 740 674 676 705 706 707 708 737 738 739 740 674 676 + 705 706 707 708 674 676 705 706 707 708 674 676 705 + 706 707 708 737 738 739 740 642 644 673 674 675 676 + 642 644 673 674 675 676 705 706 707 708 642 644 673 + 674 675 676 705 706 707 708 642 644 673 674 675 676 + 578 580 609 610 611 612 641 642 643 644 578 580 609 + 610 611 612 641 642 643 644 610 612 641 642 643 644 + 673 674 675 676 610 612 641 642 643 644 673 674 675 + 676 610 612 641 642 643 644 610 612 641 642 643 644 + 18 20 49 50 51 52 18 20 49 50 51 52 18 + 20 49 50 51 52 18 20 49 50 51 52 50 52 + 81 82 83 84 18 20 49 50 51 52 81 82 83 + 84 18 20 49 50 51 52 81 82 83 84 50 52 + 81 82 83 84 82 84 113 114 115 116 50 52 81 + 82 83 84 113 114 115 116 50 52 81 82 83 84 + 113 114 115 116 82 84 113 114 115 116 114 116 145 + 146 147 148 82 84 113 114 115 116 145 146 147 148 + 82 84 113 114 115 116 145 146 147 148 114 116 145 + 146 147 148 146 148 177 178 179 180 114 116 145 146 + 147 148 177 178 179 180 114 116 145 146 147 148 177 + 178 179 180 146 148 177 178 179 180 178 180 209 210 + 211 212 146 148 177 178 179 180 209 210 211 212 146 + 148 177 178 179 180 209 210 211 212 178 180 209 210 + 211 212 210 212 241 242 243 244 178 180 209 210 211 + 212 241 242 243 244 178 180 209 210 211 212 241 242 + 243 244 210 212 241 242 243 244 242 244 273 274 275 + 276 210 212 241 242 243 244 273 274 275 276 210 212 + 241 242 243 244 273 274 275 276 242 244 273 274 275 + 276 242 244 273 274 275 276 305 306 307 308 274 276 + 305 306 307 308 274 276 305 306 307 308 242 244 273 + 274 275 276 305 306 307 308 306 308 337 338 339 340 + 274 276 305 306 307 308 337 338 339 340 274 276 305 + 306 307 308 337 338 339 340 306 308 337 338 339 340 + 306 308 337 338 339 340 369 370 371 372 306 308 337 + 338 339 340 369 370 371 372 338 340 369 370 371 372 + 338 340 369 370 371 372 338 340 369 370 371 372 401 + 402 403 404 370 372 401 402 403 404 370 372 401 402 + 403 404 338 340 369 370 371 372 401 402 403 404 402 + 404 433 434 435 436 370 372 401 402 403 404 433 434 + 435 436 370 372 401 402 403 404 433 434 435 436 402 + 404 433 434 435 436 402 404 433 434 435 436 465 466 + 467 468 402 404 433 434 435 436 465 466 467 468 434 + 436 465 466 467 468 434 436 465 466 467 468 434 436 + 465 466 467 468 497 498 499 500 466 468 497 498 499 + 500 466 468 497 498 499 500 434 436 465 466 467 468 + 497 498 499 500 498 500 529 530 531 532 466 468 497 + 498 499 500 529 530 531 532 466 468 497 498 499 500 + 529 530 531 532 498 500 529 530 531 532 498 500 529 + 530 531 532 561 562 563 564 498 500 529 530 531 532 + 561 562 563 564 530 532 561 562 563 564 530 532 561 + 562 563 564 530 532 561 562 563 564 593 594 595 596 + 562 564 593 594 595 596 562 564 593 594 595 596 530 + 532 561 562 563 564 593 594 595 596 594 596 625 626 + 627 628 562 564 593 594 595 596 625 626 627 628 562 + 564 593 594 595 596 625 626 627 628 594 596 625 626 + 627 628 1234 1236 1265 1266 1267 1268 1234 1236 1265 1266 1267 + 1268 1234 1236 1265 1266 1267 1268 1234 1236 1265 1266 1267 1268 + 1202 1204 1233 1234 1235 1236 1265 1266 1267 1268 1202 1204 1233 + 1234 1235 1236 1202 1204 1233 1234 1235 1236 1265 1266 1267 1268 + 1202 1204 1233 1234 1235 1236 1170 1172 1201 1202 1203 1204 1170 + 1172 1201 1202 1203 1204 1233 1234 1235 1236 1170 1172 1201 1202 + 1203 1204 1233 1234 1235 1236 1170 1172 1201 1202 1203 1204 1138 + 1140 1169 1170 1171 1172 1138 1140 1169 1170 1171 1172 1201 1202 + 1203 1204 1138 1140 1169 1170 1171 1172 1201 1202 1203 1204 1138 + 1140 1169 1170 1171 1172 1106 1108 1137 1138 1139 1140 1106 1108 + 1137 1138 1139 1140 1169 1170 1171 1172 1106 1108 1137 1138 1139 + 1140 1169 1170 1171 1172 1106 1108 1137 1138 1139 1140 1074 1076 + 1105 1106 1107 1108 1074 1076 1105 1106 1107 1108 1137 1138 1139 + 1140 1074 1076 1105 1106 1107 1108 1137 1138 1139 1140 1074 1076 + 1105 1106 1107 1108 1042 1044 1073 1074 1075 1076 1042 1044 1073 + 1074 1075 1076 1105 1106 1107 1108 1042 1044 1073 1074 1075 1076 + 1105 1106 1107 1108 1042 1044 1073 1074 1075 1076 1010 1012 1041 + 1042 1043 1044 1010 1012 1041 1042 1043 1044 1073 1074 1075 1076 + 1010 1012 1041 1042 1043 1044 1073 1074 1075 1076 1010 1012 1041 + 1042 1043 1044 978 980 1009 1010 1011 1012 1041 1042 1043 1044 + 978 980 1009 1010 1011 1012 978 980 1009 1010 1011 1012 978 + 980 1009 1010 1011 1012 1041 1042 1043 1044 946 948 977 978 + 979 980 946 948 977 978 979 980 1009 1010 1011 1012 946 + 948 977 978 979 980 1009 1010 1011 1012 946 948 977 978 + 979 980 914 916 945 946 947 948 977 978 979 980 914 + 916 945 946 947 948 977 978 979 980 914 916 945 946 + 947 948 914 916 945 946 947 948 882 884 913 914 915 + 916 945 946 947 948 882 884 913 914 915 916 882 884 + 913 914 915 916 882 884 913 914 915 916 945 946 947 + 948 850 852 881 882 883 884 850 852 881 882 883 884 + 913 914 915 916 850 852 881 882 883 884 913 914 915 + 916 850 852 881 882 883 884 818 820 849 850 851 852 + 881 882 883 884 818 820 849 850 851 852 881 882 883 + 884 818 820 849 850 851 852 818 820 849 850 851 852 + 786 788 817 818 819 820 849 850 851 852 786 788 817 + 818 819 820 786 788 817 818 819 820 786 788 817 818 + 819 820 849 850 851 852 754 756 785 786 787 788 754 + 756 785 786 787 788 817 818 819 820 754 756 785 786 + 787 788 817 818 819 820 754 756 785 786 787 788 722 + 724 753 754 755 756 785 786 787 788 722 724 753 754 + 755 756 785 786 787 788 722 724 753 754 755 756 722 + 724 753 754 755 756 690 692 721 722 723 724 753 754 + 755 756 690 692 721 722 723 724 690 692 721 722 723 + 724 690 692 721 722 723 724 753 754 755 756 658 660 + 689 690 691 692 658 660 689 690 691 692 721 722 723 + 724 658 660 689 690 691 692 721 722 723 724 658 660 + 689 690 691 692 594 596 625 626 627 628 657 658 659 + 660 594 596 625 626 627 628 657 658 659 660 626 628 + 657 658 659 660 689 690 691 692 626 628 657 658 659 + 660 689 690 691 692 626 628 657 658 659 660 626 628 + 657 658 659 660 22 24 26 28 53 54 55 56 57 + 58 59 60 22 24 26 28 53 54 55 56 57 58 + 59 60 22 24 26 28 53 54 55 56 57 58 59 + 60 22 24 26 28 53 54 55 56 57 58 59 60 + 22 24 26 28 53 54 55 56 57 58 59 60 22 + 24 26 28 53 54 55 56 57 58 59 60 54 56 + 57 58 59 60 85 86 87 88 89 90 91 92 22 + 24 26 28 53 54 55 56 57 58 59 60 85 86 + 87 88 89 90 91 92 22 24 26 28 53 54 55 + 56 57 58 59 60 85 86 87 88 89 90 91 92 + 22 24 26 28 53 54 55 56 57 58 59 60 85 + 86 87 88 89 90 91 92 22 24 26 28 53 54 + 55 56 57 58 59 60 85 86 87 88 89 90 91 + 92 22 24 26 28 53 54 55 56 57 58 59 60 + 85 86 87 88 89 90 91 92 22 24 26 28 53 + 54 55 56 57 58 59 60 85 86 87 88 89 90 + 91 92 54 56 57 58 59 60 85 86 87 88 89 + 90 91 92 86 88 89 90 91 92 117 118 119 120 + 121 122 123 124 54 56 57 58 59 60 85 86 87 + 88 89 90 91 92 117 118 119 120 121 122 123 124 + 54 56 57 58 59 60 85 86 87 88 89 90 91 + 92 117 118 119 120 121 122 123 124 54 56 57 58 + 59 60 85 86 87 88 89 90 91 92 117 118 119 + 120 121 122 123 124 54 56 57 58 59 60 85 86 + 87 88 89 90 91 92 117 118 119 120 121 122 123 + 124 54 56 57 58 59 60 85 86 87 88 89 90 + 91 92 117 118 119 120 121 122 123 124 54 56 57 + 58 59 60 85 86 87 88 89 90 91 92 117 118 + 119 120 121 122 123 124 86 88 89 90 91 92 117 + 118 119 120 121 122 123 124 118 120 121 122 123 124 + 149 150 151 152 153 154 155 156 86 88 89 90 91 + 92 117 118 119 120 121 122 123 124 149 150 151 152 + 153 154 155 156 86 88 89 90 91 92 117 118 119 + 120 121 122 123 124 149 150 151 152 153 154 155 156 + 86 88 89 90 91 92 117 118 119 120 121 122 123 + 124 149 150 151 152 153 154 155 156 86 88 89 90 + 91 92 117 118 119 120 121 122 123 124 149 150 151 + 152 153 154 155 156 86 88 89 90 91 92 117 118 + 119 120 121 122 123 124 149 150 151 152 153 154 155 + 156 86 88 89 90 91 92 117 118 119 120 121 122 + 123 124 149 150 151 152 153 154 155 156 118 120 121 + 122 123 124 149 150 151 152 153 154 155 156 150 152 + 153 154 155 156 181 182 183 184 185 186 187 188 118 + 120 121 122 123 124 149 150 151 152 153 154 155 156 + 181 182 183 184 185 186 187 188 118 120 121 122 123 + 124 149 150 151 152 153 154 155 156 181 182 183 184 + 185 186 187 188 118 120 121 122 123 124 149 150 151 + 152 153 154 155 156 181 182 183 184 185 186 187 188 + 118 120 121 122 123 124 149 150 151 152 153 154 155 + 156 181 182 183 184 185 186 187 188 118 120 121 122 + 123 124 149 150 151 152 153 154 155 156 181 182 183 + 184 185 186 187 188 118 120 121 122 123 124 149 150 + 151 152 153 154 155 156 181 182 183 184 185 186 187 + 188 150 152 153 154 155 156 181 182 183 184 185 186 + 187 188 182 184 185 186 187 188 213 214 215 216 217 + 218 219 220 150 152 153 154 155 156 181 182 183 184 + 185 186 187 188 213 214 215 216 217 218 219 220 150 + 152 153 154 155 156 181 182 183 184 185 186 187 188 + 213 214 215 216 217 218 219 220 150 152 153 154 155 + 156 181 182 183 184 185 186 187 188 213 214 215 216 + 217 218 219 220 150 152 153 154 155 156 181 182 183 + 184 185 186 187 188 213 214 215 216 217 218 219 220 + 150 152 153 154 155 156 181 182 183 184 185 186 187 + 188 213 214 215 216 217 218 219 220 150 152 153 154 + 155 156 181 182 183 184 185 186 187 188 213 214 215 + 216 217 218 219 220 182 184 185 186 187 188 213 214 + 215 216 217 218 219 220 214 216 217 218 219 220 245 + 246 247 248 249 250 251 252 182 184 185 186 187 188 + 213 214 215 216 217 218 219 220 245 246 247 248 249 + 250 251 252 182 184 185 186 187 188 213 214 215 216 + 217 218 219 220 245 246 247 248 249 250 251 252 182 + 184 185 186 187 188 213 214 215 216 217 218 219 220 + 245 246 247 248 249 250 251 252 182 184 185 186 187 + 188 213 214 215 216 217 218 219 220 245 246 247 248 + 249 250 251 252 182 184 185 186 187 188 213 214 215 + 216 217 218 219 220 245 246 247 248 249 250 251 252 + 182 184 185 186 187 188 213 214 215 216 217 218 219 + 220 245 246 247 248 249 250 251 252 214 216 217 218 + 219 220 245 246 247 248 249 250 251 252 246 248 249 + 250 251 252 277 278 279 280 281 282 283 284 214 216 + 217 218 219 220 245 246 247 248 249 250 251 252 277 + 278 279 280 281 282 283 284 214 216 217 218 219 220 + 245 246 247 248 249 250 251 252 277 278 279 280 281 + 282 283 284 214 216 217 218 219 220 245 246 247 248 + 249 250 251 252 277 278 279 280 281 282 283 284 214 + 216 217 218 219 220 245 246 247 248 249 250 251 252 + 277 278 279 280 281 282 283 284 214 216 217 218 219 + 220 245 246 247 248 249 250 251 252 277 278 279 280 + 281 282 283 284 214 216 217 218 219 220 245 246 247 + 248 249 250 251 252 277 278 279 280 281 282 283 284 + 246 248 249 250 251 252 277 278 279 280 281 282 283 + 284 278 280 281 282 283 284 309 310 311 312 313 314 + 315 316 246 248 249 250 251 252 277 278 279 280 281 + 282 283 284 309 310 311 312 313 314 315 316 246 248 + 249 250 251 252 277 278 279 280 281 282 283 284 309 + 310 311 312 313 314 315 316 246 248 249 250 251 252 + 277 278 279 280 281 282 283 284 309 310 311 312 313 + 314 315 316 246 248 249 250 251 252 277 278 279 280 + 281 282 283 284 309 310 311 312 313 314 315 316 246 + 248 249 250 251 252 277 278 279 280 281 282 283 284 + 309 310 311 312 313 314 315 316 246 248 249 250 251 + 252 277 278 279 280 281 282 283 284 309 310 311 312 + 313 314 315 316 278 280 281 282 283 284 309 310 311 + 312 313 314 315 316 310 312 313 314 315 316 341 342 + 343 344 345 346 347 348 278 280 281 282 283 284 309 + 310 311 312 313 314 315 316 341 342 343 344 345 346 + 347 348 278 280 281 282 283 284 309 310 311 312 313 + 314 315 316 341 342 343 344 345 346 347 348 278 280 + 281 282 283 284 309 310 311 312 313 314 315 316 341 + 342 343 344 345 346 347 348 278 280 281 282 283 284 + 309 310 311 312 313 314 315 316 341 342 343 344 345 + 346 347 348 278 280 281 282 283 284 309 310 311 312 + 313 314 315 316 341 342 343 344 345 346 347 348 278 + 280 281 282 283 284 309 310 311 312 313 314 315 316 + 341 342 343 344 345 346 347 348 310 312 313 314 315 + 316 341 342 343 344 345 346 347 348 342 344 345 346 + 347 348 373 374 375 376 377 378 379 380 310 312 313 + 314 315 316 341 342 343 344 345 346 347 348 373 374 + 375 376 377 378 379 380 310 312 313 314 315 316 341 + 342 343 344 345 346 347 348 373 374 375 376 377 378 + 379 380 310 312 313 314 315 316 341 342 343 344 345 + 346 347 348 373 374 375 376 377 378 379 380 310 312 + 313 314 315 316 341 342 343 344 345 346 347 348 373 + 374 375 376 377 378 379 380 310 312 313 314 315 316 + 341 342 343 344 345 346 347 348 373 374 375 376 377 + 378 379 380 310 312 313 314 315 316 341 342 343 344 + 345 346 347 348 373 374 375 376 377 378 379 380 342 + 344 345 346 347 348 373 374 375 376 377 378 379 380 + 374 376 377 378 379 380 405 406 407 408 409 410 411 + 412 342 344 345 346 347 348 373 374 375 376 377 378 + 379 380 405 406 407 408 409 410 411 412 342 344 345 + 346 347 348 373 374 375 376 377 378 379 380 405 406 + 407 408 409 410 411 412 342 344 345 346 347 348 373 + 374 375 376 377 378 379 380 405 406 407 408 409 410 + 411 412 342 344 345 346 347 348 373 374 375 376 377 + 378 379 380 405 406 407 408 409 410 411 412 342 344 + 345 346 347 348 373 374 375 376 377 378 379 380 405 + 406 407 408 409 410 411 412 342 344 345 346 347 348 + 373 374 375 376 377 378 379 380 405 406 407 408 409 + 410 411 412 374 376 377 378 379 380 405 406 407 408 + 409 410 411 412 406 408 409 410 411 412 437 438 439 + 440 441 442 443 444 374 376 377 378 379 380 405 406 + 407 408 409 410 411 412 437 438 439 440 441 442 443 + 444 374 376 377 378 379 380 405 406 407 408 409 410 + 411 412 437 438 439 440 441 442 443 444 374 376 377 + 378 379 380 405 406 407 408 409 410 411 412 437 438 + 439 440 441 442 443 444 374 376 377 378 379 380 405 + 406 407 408 409 410 411 412 437 438 439 440 441 442 + 443 444 374 376 377 378 379 380 405 406 407 408 409 + 410 411 412 437 438 439 440 441 442 443 444 374 376 + 377 378 379 380 405 406 407 408 409 410 411 412 437 + 438 439 440 441 442 443 444 406 408 409 410 411 412 + 437 438 439 440 441 442 443 444 406 408 409 410 411 + 412 437 438 439 440 441 442 443 444 469 470 471 472 + 473 474 475 476 406 408 409 410 411 412 437 438 439 + 440 441 442 443 444 469 470 471 472 473 474 475 476 + 406 408 409 410 411 412 437 438 439 440 441 442 443 + 444 469 470 471 472 473 474 475 476 406 408 409 410 + 411 412 437 438 439 440 441 442 443 444 469 470 471 + 472 473 474 475 476 406 408 409 410 411 412 437 438 + 439 440 441 442 443 444 469 470 471 472 473 474 475 + 476 406 408 409 410 411 412 437 438 439 440 441 442 + 443 444 469 470 471 472 473 474 475 476 438 440 441 + 442 443 444 469 470 471 472 473 474 475 476 438 440 + 441 442 443 444 469 470 471 472 473 474 475 476 438 + 440 441 442 443 444 469 470 471 472 473 474 475 476 + 501 502 503 504 505 506 507 508 470 472 473 474 475 + 476 501 502 503 504 505 506 507 508 470 472 473 474 + 475 476 501 502 503 504 505 506 507 508 438 440 441 + 442 443 444 469 470 471 472 473 474 475 476 501 502 + 503 504 505 506 507 508 438 440 441 442 443 444 469 + 470 471 472 473 474 475 476 501 502 503 504 505 506 + 507 508 438 440 441 442 443 444 469 470 471 472 473 + 474 475 476 501 502 503 504 505 506 507 508 438 440 + 441 442 443 444 469 470 471 472 473 474 475 476 501 + 502 503 504 505 506 507 508 438 440 441 442 443 444 + 469 470 471 472 473 474 475 476 501 502 503 504 505 + 506 507 508 502 504 505 506 507 508 533 534 535 536 + 537 538 539 540 470 472 473 474 475 476 501 502 503 + 504 505 506 507 508 533 534 535 536 537 538 539 540 + 470 472 473 474 475 476 501 502 503 504 505 506 507 + 508 533 534 535 536 537 538 539 540 470 472 473 474 + 475 476 501 502 503 504 505 506 507 508 533 534 535 + 536 537 538 539 540 470 472 473 474 475 476 501 502 + 503 504 505 506 507 508 533 534 535 536 537 538 539 + 540 470 472 473 474 475 476 501 502 503 504 505 506 + 507 508 533 534 535 536 537 538 539 540 470 472 473 + 474 475 476 501 502 503 504 505 506 507 508 533 534 + 535 536 537 538 539 540 502 504 505 506 507 508 533 + 534 535 536 537 538 539 540 502 504 505 506 507 508 + 533 534 535 536 537 538 539 540 565 566 567 568 569 + 570 571 572 502 504 505 506 507 508 533 534 535 536 + 537 538 539 540 565 566 567 568 569 570 571 572 502 + 504 505 506 507 508 533 534 535 536 537 538 539 540 + 565 566 567 568 569 570 571 572 502 504 505 506 507 + 508 533 534 535 536 537 538 539 540 565 566 567 568 + 569 570 571 572 502 504 505 506 507 508 533 534 535 + 536 537 538 539 540 565 566 567 568 569 570 571 572 + 502 504 505 506 507 508 533 534 535 536 537 538 539 + 540 565 566 567 568 569 570 571 572 534 536 537 538 + 539 540 565 566 567 568 569 570 571 572 534 536 537 + 538 539 540 565 566 567 568 569 570 571 572 534 536 + 537 538 539 540 565 566 567 568 569 570 571 572 597 + 598 599 600 601 602 603 604 566 568 569 570 571 572 + 597 598 599 600 601 602 603 604 566 568 569 570 571 + 572 597 598 599 600 601 602 603 604 534 536 537 538 + 539 540 565 566 567 568 569 570 571 572 597 598 599 + 600 601 602 603 604 534 536 537 538 539 540 565 566 + 567 568 569 570 571 572 597 598 599 600 601 602 603 + 604 534 536 537 538 539 540 565 566 567 568 569 570 + 571 572 597 598 599 600 601 602 603 604 534 536 537 + 538 539 540 565 566 567 568 569 570 571 572 597 598 + 599 600 601 602 603 604 534 536 537 538 539 540 565 + 566 567 568 569 570 571 572 597 598 599 600 601 602 + 603 604 598 600 601 602 603 604 629 630 631 632 633 + 634 635 636 566 568 569 570 571 572 597 598 599 600 + 601 602 603 604 629 630 631 632 633 634 635 636 566 + 568 569 570 571 572 597 598 599 600 601 602 603 604 + 629 630 631 632 633 634 635 636 566 568 569 570 571 + 572 597 598 599 600 601 602 603 604 629 630 631 632 + 633 634 635 636 566 568 569 570 571 572 597 598 599 + 600 601 602 603 604 629 630 631 632 633 634 635 636 + 566 568 569 570 571 572 597 598 599 600 601 602 603 + 604 629 630 631 632 633 634 635 636 566 568 569 570 + 571 572 597 598 599 600 601 602 603 604 629 630 631 + 632 633 634 635 636 598 600 601 602 603 604 629 630 + 631 632 633 634 635 636 1238 1240 1241 1242 1243 1244 1269 + 1270 1271 1272 1273 1274 1275 1276 1238 1240 1241 1242 1243 1244 + 1269 1270 1271 1272 1273 1274 1275 1276 1238 1240 1241 1242 1243 + 1244 1269 1270 1271 1272 1273 1274 1275 1276 1238 1240 1241 1242 + 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 1238 1240 1241 + 1242 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 1238 1240 + 1241 1242 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 1238 + 1240 1241 1242 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 + 1238 1240 1241 1242 1243 1244 1269 1270 1271 1272 1273 1274 1275 + 1276 1206 1208 1209 1210 1211 1212 1237 1238 1239 1240 1241 1242 + 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 1206 1208 1209 + 1210 1211 1212 1237 1238 1239 1240 1241 1242 1243 1244 1206 1208 + 1209 1210 1211 1212 1237 1238 1239 1240 1241 1242 1243 1244 1269 + 1270 1271 1272 1273 1274 1275 1276 1206 1208 1209 1210 1211 1212 + 1237 1238 1239 1240 1241 1242 1243 1244 1206 1208 1209 1210 1211 + 1212 1237 1238 1239 1240 1241 1242 1243 1244 1269 1270 1271 1272 + 1273 1274 1275 1276 1206 1208 1209 1210 1211 1212 1237 1238 1239 + 1240 1241 1242 1243 1244 1269 1270 1271 1272 1273 1274 1275 1276 + 1206 1208 1209 1210 1211 1212 1237 1238 1239 1240 1241 1242 1243 + 1244 1269 1270 1271 1272 1273 1274 1275 1276 1206 1208 1209 1210 + 1211 1212 1237 1238 1239 1240 1241 1242 1243 1244 1269 1270 1271 + 1272 1273 1274 1275 1276 1174 1176 1177 1178 1179 1180 1205 1206 + 1207 1208 1209 1210 1211 1212 1174 1176 1177 1178 1179 1180 1205 + 1206 1207 1208 1209 1210 1211 1212 1237 1238 1239 1240 1241 1242 + 1243 1244 1174 1176 1177 1178 1179 1180 1205 1206 1207 1208 1209 + 1210 1211 1212 1237 1238 1239 1240 1241 1242 1243 1244 1174 1176 + 1177 1178 1179 1180 1205 1206 1207 1208 1209 1210 1211 1212 1237 + 1238 1239 1240 1241 1242 1243 1244 1174 1176 1177 1178 1179 1180 + 1205 1206 1207 1208 1209 1210 1211 1212 1237 1238 1239 1240 1241 + 1242 1243 1244 1174 1176 1177 1178 1179 1180 1205 1206 1207 1208 + 1209 1210 1211 1212 1237 1238 1239 1240 1241 1242 1243 1244 1174 + 1176 1177 1178 1179 1180 1205 1206 1207 1208 1209 1210 1211 1212 + 1237 1238 1239 1240 1241 1242 1243 1244 1174 1176 1177 1178 1179 + 1180 1205 1206 1207 1208 1209 1210 1211 1212 1142 1144 1145 1146 + 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 1142 1144 1145 + 1146 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 1205 1206 + 1207 1208 1209 1210 1211 1212 1142 1144 1145 1146 1147 1148 1173 + 1174 1175 1176 1177 1178 1179 1180 1205 1206 1207 1208 1209 1210 + 1211 1212 1142 1144 1145 1146 1147 1148 1173 1174 1175 1176 1177 + 1178 1179 1180 1205 1206 1207 1208 1209 1210 1211 1212 1142 1144 + 1145 1146 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 1205 + 1206 1207 1208 1209 1210 1211 1212 1142 1144 1145 1146 1147 1148 + 1173 1174 1175 1176 1177 1178 1179 1180 1205 1206 1207 1208 1209 + 1210 1211 1212 1142 1144 1145 1146 1147 1148 1173 1174 1175 1176 + 1177 1178 1179 1180 1205 1206 1207 1208 1209 1210 1211 1212 1142 + 1144 1145 1146 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 + 1110 1112 1113 1114 1115 1116 1141 1142 1143 1144 1145 1146 1147 + 1148 1110 1112 1113 1114 1115 1116 1141 1142 1143 1144 1145 1146 + 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 1110 1112 1113 + 1114 1115 1116 1141 1142 1143 1144 1145 1146 1147 1148 1173 1174 + 1175 1176 1177 1178 1179 1180 1110 1112 1113 1114 1115 1116 1141 + 1142 1143 1144 1145 1146 1147 1148 1173 1174 1175 1176 1177 1178 + 1179 1180 1110 1112 1113 1114 1115 1116 1141 1142 1143 1144 1145 + 1146 1147 1148 1173 1174 1175 1176 1177 1178 1179 1180 1110 1112 + 1113 1114 1115 1116 1141 1142 1143 1144 1145 1146 1147 1148 1173 + 1174 1175 1176 1177 1178 1179 1180 1110 1112 1113 1114 1115 1116 + 1141 1142 1143 1144 1145 1146 1147 1148 1173 1174 1175 1176 1177 + 1178 1179 1180 1110 1112 1113 1114 1115 1116 1141 1142 1143 1144 + 1145 1146 1147 1148 1078 1080 1081 1082 1083 1084 1109 1110 1111 + 1112 1113 1114 1115 1116 1078 1080 1081 1082 1083 1084 1109 1110 + 1111 1112 1113 1114 1115 1116 1141 1142 1143 1144 1145 1146 1147 + 1148 1078 1080 1081 1082 1083 1084 1109 1110 1111 1112 1113 1114 + 1115 1116 1141 1142 1143 1144 1145 1146 1147 1148 1078 1080 1081 + 1082 1083 1084 1109 1110 1111 1112 1113 1114 1115 1116 1141 1142 + 1143 1144 1145 1146 1147 1148 1078 1080 1081 1082 1083 1084 1109 + 1110 1111 1112 1113 1114 1115 1116 1141 1142 1143 1144 1145 1146 + 1147 1148 1078 1080 1081 1082 1083 1084 1109 1110 1111 1112 1113 + 1114 1115 1116 1141 1142 1143 1144 1145 1146 1147 1148 1078 1080 + 1081 1082 1083 1084 1109 1110 1111 1112 1113 1114 1115 1116 1141 + 1142 1143 1144 1145 1146 1147 1148 1078 1080 1081 1082 1083 1084 + 1109 1110 1111 1112 1113 1114 1115 1116 1046 1048 1049 1050 1051 + 1052 1077 1078 1079 1080 1081 1082 1083 1084 1046 1048 1049 1050 + 1051 1052 1077 1078 1079 1080 1081 1082 1083 1084 1109 1110 1111 + 1112 1113 1114 1115 1116 1046 1048 1049 1050 1051 1052 1077 1078 + 1079 1080 1081 1082 1083 1084 1109 1110 1111 1112 1113 1114 1115 + 1116 1046 1048 1049 1050 1051 1052 1077 1078 1079 1080 1081 1082 + 1083 1084 1109 1110 1111 1112 1113 1114 1115 1116 1046 1048 1049 + 1050 1051 1052 1077 1078 1079 1080 1081 1082 1083 1084 1109 1110 + 1111 1112 1113 1114 1115 1116 1046 1048 1049 1050 1051 1052 1077 + 1078 1079 1080 1081 1082 1083 1084 1109 1110 1111 1112 1113 1114 + 1115 1116 1046 1048 1049 1050 1051 1052 1077 1078 1079 1080 1081 + 1082 1083 1084 1109 1110 1111 1112 1113 1114 1115 1116 1046 1048 + 1049 1050 1051 1052 1077 1078 1079 1080 1081 1082 1083 1084 1014 + 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 1050 1051 1052 + 1014 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 1050 1051 + 1052 1077 1078 1079 1080 1081 1082 1083 1084 1014 1016 1017 1018 + 1019 1020 1045 1046 1047 1048 1049 1050 1051 1052 1077 1078 1079 + 1080 1081 1082 1083 1084 1014 1016 1017 1018 1019 1020 1045 1046 + 1047 1048 1049 1050 1051 1052 1077 1078 1079 1080 1081 1082 1083 + 1084 1014 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 1050 + 1051 1052 1077 1078 1079 1080 1081 1082 1083 1084 1014 1016 1017 + 1018 1019 1020 1045 1046 1047 1048 1049 1050 1051 1052 1077 1078 + 1079 1080 1081 1082 1083 1084 1014 1016 1017 1018 1019 1020 1045 + 1046 1047 1048 1049 1050 1051 1052 1077 1078 1079 1080 1081 1082 + 1083 1084 1014 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 + 1050 1051 1052 982 984 985 986 987 988 1013 1014 1015 1016 + 1017 1018 1019 1020 982 984 985 986 987 988 1013 1014 1015 + 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 1050 1051 1052 + 982 984 985 986 987 988 1013 1014 1015 1016 1017 1018 1019 + 1020 1045 1046 1047 1048 1049 1050 1051 1052 982 984 985 986 + 987 988 1013 1014 1015 1016 1017 1018 1019 1020 1045 1046 1047 + 1048 1049 1050 1051 1052 982 984 985 986 987 988 1013 1014 + 1015 1016 1017 1018 1019 1020 1045 1046 1047 1048 1049 1050 1051 + 1052 982 984 985 986 987 988 1013 1014 1015 1016 1017 1018 + 1019 1020 1045 1046 1047 1048 1049 1050 1051 1052 982 984 985 + 986 987 988 1013 1014 1015 1016 1017 1018 1019 1020 1045 1046 + 1047 1048 1049 1050 1051 1052 982 984 985 986 987 988 1013 + 1014 1015 1016 1017 1018 1019 1020 950 952 953 954 955 956 + 981 982 983 984 985 986 987 988 950 952 953 954 955 + 956 981 982 983 984 985 986 987 988 1013 1014 1015 1016 + 1017 1018 1019 1020 950 952 953 954 955 956 981 982 983 + 984 985 986 987 988 1013 1014 1015 1016 1017 1018 1019 1020 + 950 952 953 954 955 956 981 982 983 984 985 986 987 + 988 1013 1014 1015 1016 1017 1018 1019 1020 950 952 953 954 + 955 956 981 982 983 984 985 986 987 988 1013 1014 1015 + 1016 1017 1018 1019 1020 950 952 953 954 955 956 981 982 + 983 984 985 986 987 988 1013 1014 1015 1016 1017 1018 1019 + 1020 950 952 953 954 955 956 981 982 983 984 985 986 + 987 988 1013 1014 1015 1016 1017 1018 1019 1020 950 952 953 + 954 955 956 981 982 983 984 985 986 987 988 918 920 + 921 922 923 924 949 950 951 952 953 954 955 956 918 + 920 921 922 923 924 949 950 951 952 953 954 955 956 + 981 982 983 984 985 986 987 988 918 920 921 922 923 + 924 949 950 951 952 953 954 955 956 981 982 983 984 + 985 986 987 988 918 920 921 922 923 924 949 950 951 + 952 953 954 955 956 981 982 983 984 985 986 987 988 + 918 920 921 922 923 924 949 950 951 952 953 954 955 + 956 981 982 983 984 985 986 987 988 918 920 921 922 + 923 924 949 950 951 952 953 954 955 956 981 982 983 + 984 985 986 987 988 918 920 921 922 923 924 949 950 + 951 952 953 954 955 956 981 982 983 984 985 986 987 + 988 918 920 921 922 923 924 949 950 951 952 953 954 + 955 956 886 888 889 890 891 892 917 918 919 920 921 + 922 923 924 886 888 889 890 891 892 917 918 919 920 + 921 922 923 924 949 950 951 952 953 954 955 956 886 + 888 889 890 891 892 917 918 919 920 921 922 923 924 + 949 950 951 952 953 954 955 956 886 888 889 890 891 + 892 917 918 919 920 921 922 923 924 949 950 951 952 + 953 954 955 956 886 888 889 890 891 892 917 918 919 + 920 921 922 923 924 949 950 951 952 953 954 955 956 + 886 888 889 890 891 892 917 918 919 920 921 922 923 + 924 949 950 951 952 953 954 955 956 886 888 889 890 + 891 892 917 918 919 920 921 922 923 924 949 950 951 + 952 953 954 955 956 886 888 889 890 891 892 917 918 + 919 920 921 922 923 924 854 856 857 858 859 860 885 + 886 887 888 889 890 891 892 854 856 857 858 859 860 + 885 886 887 888 889 890 891 892 917 918 919 920 921 + 922 923 924 854 856 857 858 859 860 885 886 887 888 + 889 890 891 892 917 918 919 920 921 922 923 924 854 + 856 857 858 859 860 885 886 887 888 889 890 891 892 + 917 918 919 920 921 922 923 924 854 856 857 858 859 + 860 885 886 887 888 889 890 891 892 917 918 919 920 + 921 922 923 924 854 856 857 858 859 860 885 886 887 + 888 889 890 891 892 917 918 919 920 921 922 923 924 + 854 856 857 858 859 860 885 886 887 888 889 890 891 + 892 917 918 919 920 921 922 923 924 854 856 857 858 + 859 860 885 886 887 888 889 890 891 892 822 824 825 + 826 827 828 853 854 855 856 857 858 859 860 885 886 + 887 888 889 890 891 892 822 824 825 826 827 828 853 + 854 855 856 857 858 859 860 885 886 887 888 889 890 + 891 892 822 824 825 826 827 828 853 854 855 856 857 + 858 859 860 885 886 887 888 889 890 891 892 822 824 + 825 826 827 828 853 854 855 856 857 858 859 860 885 + 886 887 888 889 890 891 892 822 824 825 826 827 828 + 853 854 855 856 857 858 859 860 885 886 887 888 889 + 890 891 892 822 824 825 826 827 828 853 854 855 856 + 857 858 859 860 885 886 887 888 889 890 891 892 822 + 824 825 826 827 828 853 854 855 856 857 858 859 860 + 822 824 825 826 827 828 853 854 855 856 857 858 859 + 860 790 792 793 794 795 796 821 822 823 824 825 826 + 827 828 853 854 855 856 857 858 859 860 790 792 793 + 794 795 796 821 822 823 824 825 826 827 828 790 792 + 793 794 795 796 821 822 823 824 825 826 827 828 790 + 792 793 794 795 796 821 822 823 824 825 826 827 828 + 853 854 855 856 857 858 859 860 790 792 793 794 795 + 796 821 822 823 824 825 826 827 828 853 854 855 856 + 857 858 859 860 790 792 793 794 795 796 821 822 823 + 824 825 826 827 828 853 854 855 856 857 858 859 860 + 790 792 793 794 795 796 821 822 823 824 825 826 827 + 828 853 854 855 856 857 858 859 860 790 792 793 794 + 795 796 821 822 823 824 825 826 827 828 853 854 855 + 856 857 858 859 860 758 760 761 762 763 764 789 790 + 791 792 793 794 795 796 758 760 761 762 763 764 789 + 790 791 792 793 794 795 796 821 822 823 824 825 826 + 827 828 758 760 761 762 763 764 789 790 791 792 793 + 794 795 796 821 822 823 824 825 826 827 828 758 760 + 761 762 763 764 789 790 791 792 793 794 795 796 821 + 822 823 824 825 826 827 828 758 760 761 762 763 764 + 789 790 791 792 793 794 795 796 821 822 823 824 825 + 826 827 828 758 760 761 762 763 764 789 790 791 792 + 793 794 795 796 821 822 823 824 825 826 827 828 758 + 760 761 762 763 764 789 790 791 792 793 794 795 796 + 821 822 823 824 825 826 827 828 758 760 761 762 763 + 764 789 790 791 792 793 794 795 796 726 728 729 730 + 731 732 757 758 759 760 761 762 763 764 789 790 791 + 792 793 794 795 796 726 728 729 730 731 732 757 758 + 759 760 761 762 763 764 789 790 791 792 793 794 795 + 796 726 728 729 730 731 732 757 758 759 760 761 762 + 763 764 789 790 791 792 793 794 795 796 726 728 729 + 730 731 732 757 758 759 760 761 762 763 764 789 790 + 791 792 793 794 795 796 726 728 729 730 731 732 757 + 758 759 760 761 762 763 764 789 790 791 792 793 794 + 795 796 726 728 729 730 731 732 757 758 759 760 761 + 762 763 764 789 790 791 792 793 794 795 796 726 728 + 729 730 731 732 757 758 759 760 761 762 763 764 726 + 728 729 730 731 732 757 758 759 760 761 762 763 764 + 694 696 697 698 699 700 725 726 727 728 729 730 731 + 732 757 758 759 760 761 762 763 764 694 696 697 698 + 699 700 725 726 727 728 729 730 731 732 694 696 697 + 698 699 700 725 726 727 728 729 730 731 732 694 696 + 697 698 699 700 725 726 727 728 729 730 731 732 757 + 758 759 760 761 762 763 764 694 696 697 698 699 700 + 725 726 727 728 729 730 731 732 757 758 759 760 761 + 762 763 764 694 696 697 698 699 700 725 726 727 728 + 729 730 731 732 757 758 759 760 761 762 763 764 694 + 696 697 698 699 700 725 726 727 728 729 730 731 732 + 757 758 759 760 761 762 763 764 694 696 697 698 699 + 700 725 726 727 728 729 730 731 732 757 758 759 760 + 761 762 763 764 662 664 665 666 667 668 693 694 695 + 696 697 698 699 700 662 664 665 666 667 668 693 694 + 695 696 697 698 699 700 725 726 727 728 729 730 731 + 732 662 664 665 666 667 668 693 694 695 696 697 698 + 699 700 725 726 727 728 729 730 731 732 662 664 665 + 666 667 668 693 694 695 696 697 698 699 700 725 726 + 727 728 729 730 731 732 662 664 665 666 667 668 693 + 694 695 696 697 698 699 700 725 726 727 728 729 730 + 731 732 662 664 665 666 667 668 693 694 695 696 697 + 698 699 700 725 726 727 728 729 730 731 732 662 664 + 665 666 667 668 693 694 695 696 697 698 699 700 725 + 726 727 728 729 730 731 732 662 664 665 666 667 668 + 693 694 695 696 697 698 699 700 598 600 601 602 603 + 604 629 630 631 632 633 634 635 636 661 662 663 664 + 665 666 667 668 598 600 601 602 603 604 629 630 631 + 632 633 634 635 636 661 662 663 664 665 666 667 668 + 598 600 601 602 603 604 629 630 631 632 633 634 635 + 636 661 662 663 664 665 666 667 668 598 600 601 602 + 603 604 629 630 631 632 633 634 635 636 661 662 663 + 664 665 666 667 668 598 600 601 602 603 604 629 630 + 631 632 633 634 635 636 661 662 663 664 665 666 667 + 668 598 600 601 602 603 604 629 630 631 632 633 634 + 635 636 661 662 663 664 665 666 667 668 630 632 633 + 634 635 636 661 662 663 664 665 666 667 668 693 694 + 695 696 697 698 699 700 630 632 633 634 635 636 661 + 662 663 664 665 666 667 668 693 694 695 696 697 698 + 699 700 630 632 633 634 635 636 661 662 663 664 665 + 666 667 668 693 694 695 696 697 698 699 700 630 632 + 633 634 635 636 661 662 663 664 665 666 667 668 693 + 694 695 696 697 698 699 700 630 632 633 634 635 636 + 661 662 663 664 665 666 667 668 693 694 695 696 697 + 698 699 700 630 632 633 634 635 636 661 662 663 664 + 665 666 667 668 693 694 695 696 697 698 699 700 630 + 632 633 634 635 636 661 662 663 664 665 666 667 668 + 630 632 633 634 635 636 661 662 663 664 665 666 667 + 668 6 8 10 12 14 16 37 38 39 40 41 42 + 43 44 45 46 47 48 6 8 10 12 14 16 37 + 38 39 40 41 42 43 44 45 46 47 48 6 8 + 10 12 14 16 37 38 39 40 41 42 43 44 45 + 46 47 48 6 8 10 12 14 16 37 38 39 40 + 41 42 43 44 45 46 47 48 6 8 10 12 14 + 16 37 38 39 40 41 42 43 44 45 46 47 48 + 6 8 10 12 14 16 37 38 39 40 41 42 43 + 44 45 46 47 48 6 8 10 12 14 16 37 38 + 39 40 41 42 43 44 45 46 47 48 6 8 10 + 12 14 16 37 38 39 40 41 42 43 44 45 46 + 47 48 6 8 10 12 14 16 37 38 39 40 41 + 42 43 44 45 46 47 48 6 8 10 12 14 16 + 37 38 39 40 41 42 43 44 45 46 47 48 37 + 38 39 40 42 44 46 48 69 70 71 72 73 74 + 75 76 77 78 79 80 6 8 10 12 14 16 37 + 38 39 40 41 42 43 44 45 46 47 48 69 70 + 71 72 73 74 75 76 77 78 79 80 6 8 10 + 12 14 16 37 38 39 40 41 42 43 44 45 46 + 47 48 69 70 71 72 73 74 75 76 77 78 79 + 80 6 8 10 12 14 16 37 38 39 40 41 42 + 43 44 45 46 47 48 69 70 71 72 73 74 75 + 76 77 78 79 80 6 8 10 12 14 16 37 38 + 39 40 41 42 43 44 45 46 47 48 69 70 71 + 72 73 74 75 76 77 78 79 80 6 8 10 12 + 14 16 37 38 39 40 41 42 43 44 45 46 47 + 48 69 70 71 72 73 74 75 76 77 78 79 80 + 6 8 10 12 14 16 37 38 39 40 41 42 43 + 44 45 46 47 48 69 70 71 72 73 74 75 76 + 77 78 79 80 6 8 10 12 14 16 37 38 39 + 40 41 42 43 44 45 46 47 48 69 70 71 72 + 73 74 75 76 77 78 79 80 6 8 10 12 14 + 16 37 38 39 40 41 42 43 44 45 46 47 48 + 69 70 71 72 73 74 75 76 77 78 79 80 37 + 38 39 40 42 44 46 48 69 70 71 72 73 74 + 75 76 77 78 79 80 37 38 39 40 42 44 46 + 48 69 70 71 72 73 74 75 76 77 78 79 80 + 37 38 39 40 42 44 46 48 69 70 71 72 73 + 74 75 76 77 78 79 80 69 70 71 72 74 76 + 78 80 101 102 103 104 105 106 107 108 109 110 111 + 112 37 38 39 40 42 44 46 48 69 70 71 72 + 73 74 75 76 77 78 79 80 101 102 103 104 105 + 106 107 108 109 110 111 112 37 38 39 40 42 44 + 46 48 69 70 71 72 73 74 75 76 77 78 79 + 80 101 102 103 104 105 106 107 108 109 110 111 112 + 37 38 39 40 42 44 46 48 69 70 71 72 73 + 74 75 76 77 78 79 80 101 102 103 104 105 106 + 107 108 109 110 111 112 37 38 39 40 42 44 46 + 48 69 70 71 72 73 74 75 76 77 78 79 80 + 101 102 103 104 105 106 107 108 109 110 111 112 37 + 38 39 40 42 44 46 48 69 70 71 72 73 74 + 75 76 77 78 79 80 101 102 103 104 105 106 107 + 108 109 110 111 112 37 38 39 40 42 44 46 48 + 69 70 71 72 73 74 75 76 77 78 79 80 101 + 102 103 104 105 106 107 108 109 110 111 112 37 38 + 39 40 42 44 46 48 69 70 71 72 73 74 75 + 76 77 78 79 80 101 102 103 104 105 106 107 108 + 109 110 111 112 37 38 39 40 42 44 46 48 69 + 70 71 72 73 74 75 76 77 78 79 80 101 102 + 103 104 105 106 107 108 109 110 111 112 69 70 71 + 72 74 76 78 80 101 102 103 104 105 106 107 108 + 109 110 111 112 69 70 71 72 74 76 78 80 101 + 102 103 104 105 106 107 108 109 110 111 112 69 70 + 71 72 74 76 78 80 101 102 103 104 105 106 107 + 108 109 110 111 112 101 102 103 104 106 108 110 112 + 133 134 135 136 137 138 139 140 141 142 143 144 69 + 70 71 72 74 76 78 80 101 102 103 104 105 106 + 107 108 109 110 111 112 133 134 135 136 137 138 139 + 140 141 142 143 144 69 70 71 72 74 76 78 80 + 101 102 103 104 105 106 107 108 109 110 111 112 133 + 134 135 136 137 138 139 140 141 142 143 144 69 70 + 71 72 74 76 78 80 101 102 103 104 105 106 107 + 108 109 110 111 112 133 134 135 136 137 138 139 140 + 141 142 143 144 69 70 71 72 74 76 78 80 101 + 102 103 104 105 106 107 108 109 110 111 112 133 134 + 135 136 137 138 139 140 141 142 143 144 69 70 71 + 72 74 76 78 80 101 102 103 104 105 106 107 108 + 109 110 111 112 133 134 135 136 137 138 139 140 141 + 142 143 144 69 70 71 72 74 76 78 80 101 102 + 103 104 105 106 107 108 109 110 111 112 133 134 135 + 136 137 138 139 140 141 142 143 144 69 70 71 72 + 74 76 78 80 101 102 103 104 105 106 107 108 109 + 110 111 112 133 134 135 136 137 138 139 140 141 142 + 143 144 69 70 71 72 74 76 78 80 101 102 103 + 104 105 106 107 108 109 110 111 112 133 134 135 136 + 137 138 139 140 141 142 143 144 101 102 103 104 106 + 108 110 112 133 134 135 136 137 138 139 140 141 142 + 143 144 101 102 103 104 106 108 110 112 133 134 135 + 136 137 138 139 140 141 142 143 144 101 102 103 104 + 106 108 110 112 133 134 135 136 137 138 139 140 141 + 142 143 144 133 134 135 136 138 140 142 144 165 166 + 167 168 169 170 171 172 173 174 175 176 101 102 103 + 104 106 108 110 112 133 134 135 136 137 138 139 140 + 141 142 143 144 165 166 167 168 169 170 171 172 173 + 174 175 176 101 102 103 104 106 108 110 112 133 134 + 135 136 137 138 139 140 141 142 143 144 165 166 167 + 168 169 170 171 172 173 174 175 176 101 102 103 104 + 106 108 110 112 133 134 135 136 137 138 139 140 141 + 142 143 144 165 166 167 168 169 170 171 172 173 174 + 175 176 101 102 103 104 106 108 110 112 133 134 135 + 136 137 138 139 140 141 142 143 144 165 166 167 168 + 169 170 171 172 173 174 175 176 101 102 103 104 106 + 108 110 112 133 134 135 136 137 138 139 140 141 142 + 143 144 165 166 167 168 169 170 171 172 173 174 175 + 176 101 102 103 104 106 108 110 112 133 134 135 136 + 137 138 139 140 141 142 143 144 165 166 167 168 169 + 170 171 172 173 174 175 176 101 102 103 104 106 108 + 110 112 133 134 135 136 137 138 139 140 141 142 143 + 144 165 166 167 168 169 170 171 172 173 174 175 176 + 101 102 103 104 106 108 110 112 133 134 135 136 137 + 138 139 140 141 142 143 144 165 166 167 168 169 170 + 171 172 173 174 175 176 133 134 135 136 138 140 142 + 144 165 166 167 168 169 170 171 172 173 174 175 176 + 133 134 135 136 138 140 142 144 165 166 167 168 169 + 170 171 172 173 174 175 176 133 134 135 136 138 140 + 142 144 165 166 167 168 169 170 171 172 173 174 175 + 176 165 166 167 168 170 172 174 176 197 198 199 200 + 201 202 203 204 205 206 207 208 133 134 135 136 138 + 140 142 144 165 166 167 168 169 170 171 172 173 174 + 175 176 197 198 199 200 201 202 203 204 205 206 207 + 208 133 134 135 136 138 140 142 144 165 166 167 168 + 169 170 171 172 173 174 175 176 197 198 199 200 201 + 202 203 204 205 206 207 208 133 134 135 136 138 140 + 142 144 165 166 167 168 169 170 171 172 173 174 175 + 176 197 198 199 200 201 202 203 204 205 206 207 208 + 133 134 135 136 138 140 142 144 165 166 167 168 169 + 170 171 172 173 174 175 176 197 198 199 200 201 202 + 203 204 205 206 207 208 133 134 135 136 138 140 142 + 144 165 166 167 168 169 170 171 172 173 174 175 176 + 197 198 199 200 201 202 203 204 205 206 207 208 133 + 134 135 136 138 140 142 144 165 166 167 168 169 170 + 171 172 173 174 175 176 197 198 199 200 201 202 203 + 204 205 206 207 208 133 134 135 136 138 140 142 144 + 165 166 167 168 169 170 171 172 173 174 175 176 197 + 198 199 200 201 202 203 204 205 206 207 208 133 134 + 135 136 138 140 142 144 165 166 167 168 169 170 171 + 172 173 174 175 176 197 198 199 200 201 202 203 204 + 205 206 207 208 165 166 167 168 170 172 174 176 197 + 198 199 200 201 202 203 204 205 206 207 208 165 166 + 167 168 170 172 174 176 197 198 199 200 201 202 203 + 204 205 206 207 208 165 166 167 168 170 172 174 176 + 197 198 199 200 201 202 203 204 205 206 207 208 197 + 198 199 200 202 204 206 208 229 230 231 232 233 234 + 235 236 237 238 239 240 165 166 167 168 170 172 174 + 176 197 198 199 200 201 202 203 204 205 206 207 208 + 229 230 231 232 233 234 235 236 237 238 239 240 165 + 166 167 168 170 172 174 176 197 198 199 200 201 202 + 203 204 205 206 207 208 229 230 231 232 233 234 235 + 236 237 238 239 240 165 166 167 168 170 172 174 176 + 197 198 199 200 201 202 203 204 205 206 207 208 229 + 230 231 232 233 234 235 236 237 238 239 240 165 166 + 167 168 170 172 174 176 197 198 199 200 201 202 203 + 204 205 206 207 208 229 230 231 232 233 234 235 236 + 237 238 239 240 165 166 167 168 170 172 174 176 197 + 198 199 200 201 202 203 204 205 206 207 208 229 230 + 231 232 233 234 235 236 237 238 239 240 165 166 167 + 168 170 172 174 176 197 198 199 200 201 202 203 204 + 205 206 207 208 229 230 231 232 233 234 235 236 237 + 238 239 240 165 166 167 168 170 172 174 176 197 198 + 199 200 201 202 203 204 205 206 207 208 229 230 231 + 232 233 234 235 236 237 238 239 240 165 166 167 168 + 170 172 174 176 197 198 199 200 201 202 203 204 205 + 206 207 208 229 230 231 232 233 234 235 236 237 238 + 239 240 197 198 199 200 202 204 206 208 229 230 231 + 232 233 234 235 236 237 238 239 240 197 198 199 200 + 202 204 206 208 229 230 231 232 233 234 235 236 237 + 238 239 240 197 198 199 200 202 204 206 208 229 230 + 231 232 233 234 235 236 237 238 239 240 229 230 231 + 232 234 236 238 240 261 262 263 264 265 266 267 268 + 269 270 271 272 197 198 199 200 202 204 206 208 229 + 230 231 232 233 234 235 236 237 238 239 240 261 262 + 263 264 265 266 267 268 269 270 271 272 197 198 199 + 200 202 204 206 208 229 230 231 232 233 234 235 236 + 237 238 239 240 261 262 263 264 265 266 267 268 269 + 270 271 272 197 198 199 200 202 204 206 208 229 230 + 231 232 233 234 235 236 237 238 239 240 261 262 263 + 264 265 266 267 268 269 270 271 272 197 198 199 200 + 202 204 206 208 229 230 231 232 233 234 235 236 237 + 238 239 240 261 262 263 264 265 266 267 268 269 270 + 271 272 197 198 199 200 202 204 206 208 229 230 231 + 232 233 234 235 236 237 238 239 240 261 262 263 264 + 265 266 267 268 269 270 271 272 197 198 199 200 202 + 204 206 208 229 230 231 232 233 234 235 236 237 238 + 239 240 261 262 263 264 265 266 267 268 269 270 271 + 272 197 198 199 200 202 204 206 208 229 230 231 232 + 233 234 235 236 237 238 239 240 261 262 263 264 265 + 266 267 268 269 270 271 272 197 198 199 200 202 204 + 206 208 229 230 231 232 233 234 235 236 237 238 239 + 240 261 262 263 264 265 266 267 268 269 270 271 272 + 229 230 231 232 234 236 238 240 261 262 263 264 265 + 266 267 268 269 270 271 272 229 230 231 232 234 236 + 238 240 261 262 263 264 265 266 267 268 269 270 271 + 272 229 230 231 232 234 236 238 240 261 262 263 264 + 265 266 267 268 269 270 271 272 261 262 263 264 266 + 268 270 272 293 294 295 296 297 298 299 300 301 302 + 303 304 229 230 231 232 234 236 238 240 261 262 263 + 264 265 266 267 268 269 270 271 272 293 294 295 296 + 297 298 299 300 301 302 303 304 229 230 231 232 234 + 236 238 240 261 262 263 264 265 266 267 268 269 270 + 271 272 293 294 295 296 297 298 299 300 301 302 303 + 304 229 230 231 232 234 236 238 240 261 262 263 264 + 265 266 267 268 269 270 271 272 293 294 295 296 297 + 298 299 300 301 302 303 304 229 230 231 232 234 236 + 238 240 261 262 263 264 265 266 267 268 269 270 271 + 272 293 294 295 296 297 298 299 300 301 302 303 304 + 229 230 231 232 234 236 238 240 261 262 263 264 265 + 266 267 268 269 270 271 272 293 294 295 296 297 298 + 299 300 301 302 303 304 229 230 231 232 234 236 238 + 240 261 262 263 264 265 266 267 268 269 270 271 272 + 293 294 295 296 297 298 299 300 301 302 303 304 229 + 230 231 232 234 236 238 240 261 262 263 264 265 266 + 267 268 269 270 271 272 293 294 295 296 297 298 299 + 300 301 302 303 304 229 230 231 232 234 236 238 240 + 261 262 263 264 265 266 267 268 269 270 271 272 293 + 294 295 296 297 298 299 300 301 302 303 304 261 262 + 263 264 266 268 270 272 293 294 295 296 297 298 299 + 300 301 302 303 304 261 262 263 264 266 268 270 272 + 293 294 295 296 297 298 299 300 301 302 303 304 261 + 262 263 264 266 268 270 272 293 294 295 296 297 298 + 299 300 301 302 303 304 293 294 295 296 298 300 302 + 304 325 326 327 328 329 330 331 332 333 334 335 336 + 261 262 263 264 266 268 270 272 293 294 295 296 297 + 298 299 300 301 302 303 304 325 326 327 328 329 330 + 331 332 333 334 335 336 261 262 263 264 266 268 270 + 272 293 294 295 296 297 298 299 300 301 302 303 304 + 325 326 327 328 329 330 331 332 333 334 335 336 261 + 262 263 264 266 268 270 272 293 294 295 296 297 298 + 299 300 301 302 303 304 325 326 327 328 329 330 331 + 332 333 334 335 336 261 262 263 264 266 268 270 272 + 293 294 295 296 297 298 299 300 301 302 303 304 325 + 326 327 328 329 330 331 332 333 334 335 336 261 262 + 263 264 266 268 270 272 293 294 295 296 297 298 299 + 300 301 302 303 304 325 326 327 328 329 330 331 332 + 333 334 335 336 261 262 263 264 266 268 270 272 293 + 294 295 296 297 298 299 300 301 302 303 304 325 326 + 327 328 329 330 331 332 333 334 335 336 261 262 263 + 264 266 268 270 272 293 294 295 296 297 298 299 300 + 301 302 303 304 325 326 327 328 329 330 331 332 333 + 334 335 336 261 262 263 264 266 268 270 272 293 294 + 295 296 297 298 299 300 301 302 303 304 325 326 327 + 328 329 330 331 332 333 334 335 336 293 294 295 296 + 298 300 302 304 325 326 327 328 329 330 331 332 333 + 334 335 336 293 294 295 296 298 300 302 304 325 326 + 327 328 329 330 331 332 333 334 335 336 293 294 295 + 296 298 300 302 304 325 326 327 328 329 330 331 332 + 333 334 335 336 325 326 327 328 330 332 334 336 357 + 358 359 360 361 362 363 364 365 366 367 368 293 294 + 295 296 298 300 302 304 325 326 327 328 329 330 331 + 332 333 334 335 336 357 358 359 360 361 362 363 364 + 365 366 367 368 293 294 295 296 298 300 302 304 325 + 326 327 328 329 330 331 332 333 334 335 336 357 358 + 359 360 361 362 363 364 365 366 367 368 293 294 295 + 296 298 300 302 304 325 326 327 328 329 330 331 332 + 333 334 335 336 357 358 359 360 361 362 363 364 365 + 366 367 368 293 294 295 296 298 300 302 304 325 326 + 327 328 329 330 331 332 333 334 335 336 357 358 359 + 360 361 362 363 364 365 366 367 368 293 294 295 296 + 298 300 302 304 325 326 327 328 329 330 331 332 333 + 334 335 336 357 358 359 360 361 362 363 364 365 366 + 367 368 293 294 295 296 298 300 302 304 325 326 327 + 328 329 330 331 332 333 334 335 336 357 358 359 360 + 361 362 363 364 365 366 367 368 293 294 295 296 298 + 300 302 304 325 326 327 328 329 330 331 332 333 334 + 335 336 357 358 359 360 361 362 363 364 365 366 367 + 368 293 294 295 296 298 300 302 304 325 326 327 328 + 329 330 331 332 333 334 335 336 357 358 359 360 361 + 362 363 364 365 366 367 368 325 326 327 328 330 332 + 334 336 357 358 359 360 361 362 363 364 365 366 367 + 368 325 326 327 328 330 332 334 336 357 358 359 360 + 361 362 363 364 365 366 367 368 325 326 327 328 330 + 332 334 336 357 358 359 360 361 362 363 364 365 366 + 367 368 357 358 359 360 362 364 366 368 389 390 391 + 392 393 394 395 396 397 398 399 400 325 326 327 328 + 330 332 334 336 357 358 359 360 361 362 363 364 365 + 366 367 368 389 390 391 392 393 394 395 396 397 398 + 399 400 325 326 327 328 330 332 334 336 357 358 359 + 360 361 362 363 364 365 366 367 368 389 390 391 392 + 393 394 395 396 397 398 399 400 325 326 327 328 330 + 332 334 336 357 358 359 360 361 362 363 364 365 366 + 367 368 389 390 391 392 393 394 395 396 397 398 399 + 400 325 326 327 328 330 332 334 336 357 358 359 360 + 361 362 363 364 365 366 367 368 389 390 391 392 393 + 394 395 396 397 398 399 400 325 326 327 328 330 332 + 334 336 357 358 359 360 361 362 363 364 365 366 367 + 368 389 390 391 392 393 394 395 396 397 398 399 400 + 325 326 327 328 330 332 334 336 357 358 359 360 361 + 362 363 364 365 366 367 368 389 390 391 392 393 394 + 395 396 397 398 399 400 325 326 327 328 330 332 334 + 336 357 358 359 360 361 362 363 364 365 366 367 368 + 389 390 391 392 393 394 395 396 397 398 399 400 325 + 326 327 328 330 332 334 336 357 358 359 360 361 362 + 363 364 365 366 367 368 389 390 391 392 393 394 395 + 396 397 398 399 400 357 358 359 360 362 364 366 368 + 389 390 391 392 393 394 395 396 397 398 399 400 357 + 358 359 360 362 364 366 368 389 390 391 392 393 394 + 395 396 397 398 399 400 357 358 359 360 362 364 366 + 368 389 390 391 392 393 394 395 396 397 398 399 400 + 485 486 487 488 490 492 494 496 517 518 519 520 521 + 522 523 524 525 526 527 528 453 454 455 456 458 460 + 462 464 485 486 487 488 489 490 491 492 493 494 495 + 496 421 422 423 424 426 428 430 432 453 454 455 456 + 457 458 459 460 461 462 463 464 389 390 391 392 394 + 396 398 400 421 422 423 424 425 426 427 428 429 430 + 431 432 357 358 359 360 362 364 366 368 389 390 391 + 392 393 394 395 396 397 398 399 400 421 422 423 424 + 425 426 427 428 429 430 431 432 357 358 359 360 362 + 364 366 368 389 390 391 392 393 394 395 396 397 398 + 399 400 421 422 423 424 425 426 427 428 429 430 431 + 432 357 358 359 360 362 364 366 368 389 390 391 392 + 393 394 395 396 397 398 399 400 421 422 423 424 425 + 426 427 428 429 430 431 432 357 358 359 360 362 364 + 366 368 389 390 391 392 393 394 395 396 397 398 399 + 400 421 422 423 424 425 426 427 428 429 430 431 432 + 357 358 359 360 362 364 366 368 389 390 391 392 393 + 394 395 396 397 398 399 400 421 422 423 424 425 426 + 427 428 429 430 431 432 357 358 359 360 362 364 366 + 368 389 390 391 392 393 394 395 396 397 398 399 400 + 421 422 423 424 425 426 427 428 429 430 431 432 357 + 358 359 360 362 364 366 368 389 390 391 392 393 394 + 395 396 397 398 399 400 421 422 423 424 425 426 427 + 428 429 430 431 432 357 358 359 360 362 364 366 368 + 389 390 391 392 393 394 395 396 397 398 399 400 421 + 422 423 424 425 426 427 428 429 430 431 432 389 390 + 391 392 394 396 398 400 421 422 423 424 425 426 427 + 428 429 430 431 432 389 390 391 392 394 396 398 400 + 421 422 423 424 425 426 427 428 429 430 431 432 389 + 390 391 392 394 396 398 400 421 422 423 424 425 426 + 427 428 429 430 431 432 389 390 391 392 394 396 398 + 400 421 422 423 424 425 426 427 428 429 430 431 432 + 453 454 455 456 457 458 459 460 461 462 463 464 389 + 390 391 392 394 396 398 400 421 422 423 424 425 426 + 427 428 429 430 431 432 453 454 455 456 457 458 459 + 460 461 462 463 464 389 390 391 392 394 396 398 400 + 421 422 423 424 425 426 427 428 429 430 431 432 453 + 454 455 456 457 458 459 460 461 462 463 464 389 390 + 391 392 394 396 398 400 421 422 423 424 425 426 427 + 428 429 430 431 432 453 454 455 456 457 458 459 460 + 461 462 463 464 389 390 391 392 394 396 398 400 421 + 422 423 424 425 426 427 428 429 430 431 432 453 454 + 455 456 457 458 459 460 461 462 463 464 389 390 391 + 392 394 396 398 400 421 422 423 424 425 426 427 428 + 429 430 431 432 453 454 455 456 457 458 459 460 461 + 462 463 464 389 390 391 392 394 396 398 400 421 422 + 423 424 425 426 427 428 429 430 431 432 453 454 455 + 456 457 458 459 460 461 462 463 464 389 390 391 392 + 394 396 398 400 421 422 423 424 425 426 427 428 429 + 430 431 432 453 454 455 456 457 458 459 460 461 462 + 463 464 421 422 423 424 426 428 430 432 453 454 455 + 456 457 458 459 460 461 462 463 464 421 422 423 424 + 426 428 430 432 453 454 455 456 457 458 459 460 461 + 462 463 464 421 422 423 424 426 428 430 432 453 454 + 455 456 457 458 459 460 461 462 463 464 421 422 423 + 424 426 428 430 432 453 454 455 456 457 458 459 460 + 461 462 463 464 485 486 487 488 489 490 491 492 493 + 494 495 496 421 422 423 424 426 428 430 432 453 454 + 455 456 457 458 459 460 461 462 463 464 485 486 487 + 488 489 490 491 492 493 494 495 496 421 422 423 424 + 426 428 430 432 453 454 455 456 457 458 459 460 461 + 462 463 464 485 486 487 488 489 490 491 492 493 494 + 495 496 421 422 423 424 426 428 430 432 453 454 455 + 456 457 458 459 460 461 462 463 464 485 486 487 488 + 489 490 491 492 493 494 495 496 421 422 423 424 426 + 428 430 432 453 454 455 456 457 458 459 460 461 462 + 463 464 485 486 487 488 489 490 491 492 493 494 495 + 496 421 422 423 424 426 428 430 432 453 454 455 456 + 457 458 459 460 461 462 463 464 485 486 487 488 489 + 490 491 492 493 494 495 496 421 422 423 424 426 428 + 430 432 453 454 455 456 457 458 459 460 461 462 463 + 464 485 486 487 488 489 490 491 492 493 494 495 496 + 421 422 423 424 426 428 430 432 453 454 455 456 457 + 458 459 460 461 462 463 464 485 486 487 488 489 490 + 491 492 493 494 495 496 453 454 455 456 458 460 462 + 464 485 486 487 488 489 490 491 492 493 494 495 496 + 453 454 455 456 458 460 462 464 485 486 487 488 489 + 490 491 492 493 494 495 496 453 454 455 456 458 460 + 462 464 485 486 487 488 489 490 491 492 493 494 495 + 496 453 454 455 456 458 460 462 464 485 486 487 488 + 489 490 491 492 493 494 495 496 517 518 519 520 521 + 522 523 524 525 526 527 528 453 454 455 456 458 460 + 462 464 485 486 487 488 489 490 491 492 493 494 495 + 496 517 518 519 520 521 522 523 524 525 526 527 528 + 453 454 455 456 458 460 462 464 485 486 487 488 489 + 490 491 492 493 494 495 496 517 518 519 520 521 522 + 523 524 525 526 527 528 453 454 455 456 458 460 462 + 464 485 486 487 488 489 490 491 492 493 494 495 496 + 517 518 519 520 521 522 523 524 525 526 527 528 453 + 454 455 456 458 460 462 464 485 486 487 488 489 490 + 491 492 493 494 495 496 517 518 519 520 521 522 523 + 524 525 526 527 528 453 454 455 456 458 460 462 464 + 485 486 487 488 489 490 491 492 493 494 495 496 517 + 518 519 520 521 522 523 524 525 526 527 528 453 454 + 455 456 458 460 462 464 485 486 487 488 489 490 491 + 492 493 494 495 496 517 518 519 520 521 522 523 524 + 525 526 527 528 453 454 455 456 458 460 462 464 485 + 486 487 488 489 490 491 492 493 494 495 496 517 518 + 519 520 521 522 523 524 525 526 527 528 485 486 487 + 488 490 492 494 496 517 518 519 520 521 522 523 524 + 525 526 527 528 485 486 487 488 490 492 494 496 517 + 518 519 520 521 522 523 524 525 526 527 528 485 486 + 487 488 490 492 494 496 517 518 519 520 521 522 523 + 524 525 526 527 528 485 486 487 488 490 492 494 496 + 517 518 519 520 521 522 523 524 525 526 527 528 549 + 550 551 552 553 554 555 556 557 558 559 560 485 486 + 487 488 490 492 494 496 517 518 519 520 521 522 523 + 524 525 526 527 528 549 550 551 552 553 554 555 556 + 557 558 559 560 485 486 487 488 490 492 494 496 517 + 518 519 520 521 522 523 524 525 526 527 528 549 550 + 551 552 553 554 555 556 557 558 559 560 485 486 487 + 488 490 492 494 496 517 518 519 520 521 522 523 524 + 525 526 527 528 549 550 551 552 553 554 555 556 557 + 558 559 560 485 486 487 488 490 492 494 496 517 518 + 519 520 521 522 523 524 525 526 527 528 549 550 551 + 552 553 554 555 556 557 558 559 560 485 486 487 488 + 490 492 494 496 517 518 519 520 521 522 523 524 525 + 526 527 528 549 550 551 552 553 554 555 556 557 558 + 559 560 485 486 487 488 490 492 494 496 517 518 519 + 520 521 522 523 524 525 526 527 528 549 550 551 552 + 553 554 555 556 557 558 559 560 485 486 487 488 490 + 492 494 496 517 518 519 520 521 522 523 524 525 526 + 527 528 549 550 551 552 553 554 555 556 557 558 559 + 560 517 518 519 520 522 524 526 528 549 550 551 552 + 553 554 555 556 557 558 559 560 517 518 519 520 522 + 524 526 528 549 550 551 552 553 554 555 556 557 558 + 559 560 517 518 519 520 522 524 526 528 549 550 551 + 552 553 554 555 556 557 558 559 560 517 518 519 520 + 522 524 526 528 549 550 551 552 553 554 555 556 557 + 558 559 560 581 582 583 584 586 588 590 592 613 614 + 615 616 617 618 619 620 621 622 623 624 549 550 551 + 552 554 556 558 560 581 582 583 584 585 586 587 588 + 589 590 591 592 549 550 551 552 554 556 558 560 581 + 582 583 584 585 586 587 588 589 590 591 592 549 550 + 551 552 554 556 558 560 581 582 583 584 585 586 587 + 588 589 590 591 592 549 550 551 552 554 556 558 560 + 581 582 583 584 585 586 587 588 589 590 591 592 517 + 518 519 520 522 524 526 528 549 550 551 552 553 554 + 555 556 557 558 559 560 581 582 583 584 585 586 587 + 588 589 590 591 592 517 518 519 520 522 524 526 528 + 549 550 551 552 553 554 555 556 557 558 559 560 581 + 582 583 584 585 586 587 588 589 590 591 592 517 518 + 519 520 522 524 526 528 549 550 551 552 553 554 555 + 556 557 558 559 560 581 582 583 584 585 586 587 588 + 589 590 591 592 517 518 519 520 522 524 526 528 549 + 550 551 552 553 554 555 556 557 558 559 560 581 582 + 583 584 585 586 587 588 589 590 591 592 517 518 519 + 520 522 524 526 528 549 550 551 552 553 554 555 556 + 557 558 559 560 581 582 583 584 585 586 587 588 589 + 590 591 592 517 518 519 520 522 524 526 528 549 550 + 551 552 553 554 555 556 557 558 559 560 581 582 583 + 584 585 586 587 588 589 590 591 592 517 518 519 520 + 522 524 526 528 549 550 551 552 553 554 555 556 557 + 558 559 560 581 582 583 584 585 586 587 588 589 590 + 591 592 517 518 519 520 522 524 526 528 549 550 551 + 552 553 554 555 556 557 558 559 560 581 582 583 584 + 585 586 587 588 589 590 591 592 549 550 551 552 554 + 556 558 560 581 582 583 584 585 586 587 588 589 590 + 591 592 613 614 615 616 617 618 619 620 621 622 623 + 624 549 550 551 552 554 556 558 560 581 582 583 584 + 585 586 587 588 589 590 591 592 613 614 615 616 617 + 618 619 620 621 622 623 624 549 550 551 552 554 556 + 558 560 581 582 583 584 585 586 587 588 589 590 591 + 592 613 614 615 616 617 618 619 620 621 622 623 624 + 549 550 551 552 554 556 558 560 581 582 583 584 585 + 586 587 588 589 590 591 592 613 614 615 616 617 618 + 619 620 621 622 623 624 549 550 551 552 554 556 558 + 560 581 582 583 584 585 586 587 588 589 590 591 592 + 613 614 615 616 617 618 619 620 621 622 623 624 549 + 550 551 552 554 556 558 560 581 582 583 584 585 586 + 587 588 589 590 591 592 613 614 615 616 617 618 619 + 620 621 622 623 624 549 550 551 552 554 556 558 560 + 581 582 583 584 585 586 587 588 589 590 591 592 613 + 614 615 616 617 618 619 620 621 622 623 624 549 550 + 551 552 554 556 558 560 581 582 583 584 585 586 587 + 588 589 590 591 592 613 614 615 616 617 618 619 620 + 621 622 623 624 581 582 583 584 586 588 590 592 613 + 614 615 616 617 618 619 620 621 622 623 624 581 582 + 583 584 586 588 590 592 613 614 615 616 617 618 619 + 620 621 622 623 624 581 582 583 584 586 588 590 592 + 613 614 615 616 617 618 619 620 621 622 623 624 1221 + 1222 1223 1224 1226 1228 1230 1232 1253 1254 1255 1256 1257 1258 + 1259 1260 1261 1262 1263 1264 1221 1222 1223 1224 1226 1228 1230 + 1232 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 + 1221 1222 1223 1224 1226 1228 1230 1232 1253 1254 1255 1256 1257 + 1258 1259 1260 1261 1262 1263 1264 1221 1222 1223 1224 1226 1228 + 1230 1232 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 + 1264 1221 1222 1223 1224 1226 1228 1230 1232 1253 1254 1255 1256 + 1257 1258 1259 1260 1261 1262 1263 1264 1221 1222 1223 1224 1226 + 1228 1230 1232 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 + 1263 1264 1221 1222 1223 1224 1226 1228 1230 1232 1253 1254 1255 + 1256 1257 1258 1259 1260 1261 1262 1263 1264 1221 1222 1223 1224 + 1226 1228 1230 1232 1253 1254 1255 1256 1257 1258 1259 1260 1261 + 1262 1263 1264 1221 1222 1223 1224 1226 1228 1230 1232 1253 1254 + 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1221 1222 1223 + 1224 1226 1228 1230 1232 1253 1254 1255 1256 1257 1258 1259 1260 + 1261 1262 1263 1264 1221 1222 1223 1224 1226 1228 1230 1232 1253 + 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1221 1222 + 1223 1224 1226 1228 1230 1232 1253 1254 1255 1256 1257 1258 1259 + 1260 1261 1262 1263 1264 1189 1190 1191 1192 1194 1196 1198 1200 + 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 + 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 + 1191 1192 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 + 1228 1229 1230 1231 1232 1253 1254 1255 1256 1257 1258 1259 1260 + 1261 1262 1263 1264 1189 1190 1191 1192 1194 1196 1198 1200 1221 + 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 1254 + 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 1191 + 1192 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 1228 + 1229 1230 1231 1232 1253 1254 1255 1256 1257 1258 1259 1260 1261 + 1262 1263 1264 1189 1190 1191 1192 1194 1196 1198 1200 1221 1222 + 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 1254 1255 + 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 1191 1192 + 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 + 1230 1231 1232 1189 1190 1191 1192 1194 1196 1198 1200 1221 1222 + 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 1254 1255 + 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 1191 1192 + 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 + 1230 1231 1232 1189 1190 1191 1192 1194 1196 1198 1200 1221 1222 + 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 1254 1255 + 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 1191 1192 + 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 + 1230 1231 1232 1189 1190 1191 1192 1194 1196 1198 1200 1221 1222 + 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1253 1254 1255 + 1256 1257 1258 1259 1260 1261 1262 1263 1264 1189 1190 1191 1192 + 1194 1196 1198 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 + 1230 1231 1232 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 + 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1157 1158 1159 + 1160 1162 1164 1166 1168 1189 1190 1191 1192 1193 1194 1195 1196 + 1197 1198 1199 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 + 1230 1231 1232 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 + 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1221 1222 1223 + 1224 1225 1226 1227 1228 1229 1230 1231 1232 1157 1158 1159 1160 + 1162 1164 1166 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 + 1198 1199 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 + 1231 1232 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 1191 + 1192 1193 1194 1195 1196 1197 1198 1199 1200 1221 1222 1223 1224 + 1225 1226 1227 1228 1229 1230 1231 1232 1157 1158 1159 1160 1162 + 1164 1166 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 + 1199 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 + 1232 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 1191 1192 + 1193 1194 1195 1196 1197 1198 1199 1200 1221 1222 1223 1224 1225 + 1226 1227 1228 1229 1230 1231 1232 1157 1158 1159 1160 1162 1164 + 1166 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 + 1200 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 + 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 1191 1192 1193 + 1194 1195 1196 1197 1198 1199 1200 1221 1222 1223 1224 1225 1226 + 1227 1228 1229 1230 1231 1232 1157 1158 1159 1160 1162 1164 1166 + 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 + 1157 1158 1159 1160 1162 1164 1166 1168 1189 1190 1191 1192 1193 + 1194 1195 1196 1197 1198 1199 1200 1157 1158 1159 1160 1162 1164 + 1166 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 + 1200 1125 1126 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 + 1161 1162 1163 1164 1165 1166 1167 1168 1125 1126 1127 1128 1130 + 1132 1134 1136 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 + 1167 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 + 1200 1125 1126 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 + 1161 1162 1163 1164 1165 1166 1167 1168 1189 1190 1191 1192 1193 + 1194 1195 1196 1197 1198 1199 1200 1125 1126 1127 1128 1130 1132 + 1134 1136 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 + 1168 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 + 1125 1126 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 1161 + 1162 1163 1164 1165 1166 1167 1168 1189 1190 1191 1192 1193 1194 + 1195 1196 1197 1198 1199 1200 1125 1126 1127 1128 1130 1132 1134 + 1136 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 + 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1125 + 1126 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 1161 1162 + 1163 1164 1165 1166 1167 1168 1189 1190 1191 1192 1193 1194 1195 + 1196 1197 1198 1199 1200 1125 1126 1127 1128 1130 1132 1134 1136 + 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1189 + 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1125 1126 + 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 1161 1162 1163 + 1164 1165 1166 1167 1168 1189 1190 1191 1192 1193 1194 1195 1196 + 1197 1198 1199 1200 1125 1126 1127 1128 1130 1132 1134 1136 1157 + 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1125 1126 + 1127 1128 1130 1132 1134 1136 1157 1158 1159 1160 1161 1162 1163 + 1164 1165 1166 1167 1168 1125 1126 1127 1128 1130 1132 1134 1136 + 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1093 + 1094 1095 1096 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 + 1131 1132 1133 1134 1135 1136 1093 1094 1095 1096 1098 1100 1102 + 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 + 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1093 + 1094 1095 1096 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 + 1131 1132 1133 1134 1135 1136 1157 1158 1159 1160 1161 1162 1163 + 1164 1165 1166 1167 1168 1093 1094 1095 1096 1098 1100 1102 1104 + 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1157 + 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1093 1094 + 1095 1096 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 1131 + 1132 1133 1134 1135 1136 1157 1158 1159 1160 1161 1162 1163 1164 + 1165 1166 1167 1168 1093 1094 1095 1096 1098 1100 1102 1104 1125 + 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1157 1158 + 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1093 1094 1095 + 1096 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 1131 1132 + 1133 1134 1135 1136 1157 1158 1159 1160 1161 1162 1163 1164 1165 + 1166 1167 1168 1093 1094 1095 1096 1098 1100 1102 1104 1125 1126 + 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1157 1158 1159 + 1160 1161 1162 1163 1164 1165 1166 1167 1168 1093 1094 1095 1096 + 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 + 1134 1135 1136 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 + 1167 1168 1093 1094 1095 1096 1098 1100 1102 1104 1125 1126 1127 + 1128 1129 1130 1131 1132 1133 1134 1135 1136 1093 1094 1095 1096 + 1098 1100 1102 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 + 1134 1135 1136 1093 1094 1095 1096 1098 1100 1102 1104 1125 1126 + 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1061 1062 1063 + 1064 1066 1068 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 + 1101 1102 1103 1104 1061 1062 1063 1064 1066 1068 1070 1072 1093 + 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1125 1126 + 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1061 1062 1063 + 1064 1066 1068 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 + 1101 1102 1103 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 + 1134 1135 1136 1061 1062 1063 1064 1066 1068 1070 1072 1093 1094 + 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1125 1126 1127 + 1128 1129 1130 1131 1132 1133 1134 1135 1136 1061 1062 1063 1064 + 1066 1068 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 + 1102 1103 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 + 1135 1136 1061 1062 1063 1064 1066 1068 1070 1072 1093 1094 1095 + 1096 1097 1098 1099 1100 1101 1102 1103 1104 1125 1126 1127 1128 + 1129 1130 1131 1132 1133 1134 1135 1136 1061 1062 1063 1064 1066 + 1068 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 + 1103 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 + 1136 1061 1062 1063 1064 1066 1068 1070 1072 1093 1094 1095 1096 + 1097 1098 1099 1100 1101 1102 1103 1104 1125 1126 1127 1128 1129 + 1130 1131 1132 1133 1134 1135 1136 1061 1062 1063 1064 1066 1068 + 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 + 1104 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 + 1061 1062 1063 1064 1066 1068 1070 1072 1093 1094 1095 1096 1097 + 1098 1099 1100 1101 1102 1103 1104 1061 1062 1063 1064 1066 1068 + 1070 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 + 1104 1061 1062 1063 1064 1066 1068 1070 1072 1093 1094 1095 1096 + 1097 1098 1099 1100 1101 1102 1103 1104 1029 1030 1031 1032 1034 + 1036 1038 1040 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 + 1071 1072 1029 1030 1031 1032 1034 1036 1038 1040 1061 1062 1063 + 1064 1065 1066 1067 1068 1069 1070 1071 1072 1093 1094 1095 1096 + 1097 1098 1099 1100 1101 1102 1103 1104 1029 1030 1031 1032 1034 + 1036 1038 1040 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 + 1071 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 + 1104 1029 1030 1031 1032 1034 1036 1038 1040 1061 1062 1063 1064 + 1065 1066 1067 1068 1069 1070 1071 1072 1093 1094 1095 1096 1097 + 1098 1099 1100 1101 1102 1103 1104 1029 1030 1031 1032 1034 1036 + 1038 1040 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 + 1072 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 + 1029 1030 1031 1032 1034 1036 1038 1040 1061 1062 1063 1064 1065 + 1066 1067 1068 1069 1070 1071 1072 1093 1094 1095 1096 1097 1098 + 1099 1100 1101 1102 1103 1104 1029 1030 1031 1032 1034 1036 1038 + 1040 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 + 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1029 + 1030 1031 1032 1034 1036 1038 1040 1061 1062 1063 1064 1065 1066 + 1067 1068 1069 1070 1071 1072 1093 1094 1095 1096 1097 1098 1099 + 1100 1101 1102 1103 1104 1029 1030 1031 1032 1034 1036 1038 1040 + 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1093 + 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1029 1030 + 1031 1032 1034 1036 1038 1040 1061 1062 1063 1064 1065 1066 1067 + 1068 1069 1070 1071 1072 1029 1030 1031 1032 1034 1036 1038 1040 + 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1029 + 1030 1031 1032 1034 1036 1038 1040 1061 1062 1063 1064 1065 1066 + 1067 1068 1069 1070 1071 1072 997 998 999 1000 1002 1004 1006 + 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 + 997 998 999 1000 1002 1004 1006 1008 1029 1030 1031 1032 1033 + 1034 1035 1036 1037 1038 1039 1040 1061 1062 1063 1064 1065 1066 + 1067 1068 1069 1070 1071 1072 997 998 999 1000 1002 1004 1006 + 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 + 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 997 + 998 999 1000 1002 1004 1006 1008 1029 1030 1031 1032 1033 1034 + 1035 1036 1037 1038 1039 1040 1061 1062 1063 1064 1065 1066 1067 + 1068 1069 1070 1071 1072 997 998 999 1000 1002 1004 1006 1008 + 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1061 + 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 997 998 + 999 1000 1002 1004 1006 1008 1029 1030 1031 1032 1033 1034 1035 + 1036 1037 1038 1039 1040 1061 1062 1063 1064 1065 1066 1067 1068 + 1069 1070 1071 1072 997 998 999 1000 1002 1004 1006 1008 1029 + 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1061 1062 + 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 997 998 999 + 1000 1002 1004 1006 1008 1029 1030 1031 1032 1033 1034 1035 1036 + 1037 1038 1039 1040 1061 1062 1063 1064 1065 1066 1067 1068 1069 + 1070 1071 1072 997 998 999 1000 1002 1004 1006 1008 1029 1030 + 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1061 1062 1063 + 1064 1065 1066 1067 1068 1069 1070 1071 1072 997 998 999 1000 + 1002 1004 1006 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 + 1038 1039 1040 997 998 999 1000 1002 1004 1006 1008 1029 1030 + 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 997 998 999 + 1000 1002 1004 1006 1008 1029 1030 1031 1032 1033 1034 1035 1036 + 1037 1038 1039 1040 965 966 967 968 970 972 974 976 997 + 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 965 966 + 967 968 970 972 974 976 997 998 999 1000 1001 1002 1003 + 1004 1005 1006 1007 1008 1029 1030 1031 1032 1033 1034 1035 1036 + 1037 1038 1039 1040 965 966 967 968 970 972 974 976 997 + 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1029 1030 + 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 965 966 967 + 968 970 972 974 976 997 998 999 1000 1001 1002 1003 1004 + 1005 1006 1007 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 + 1038 1039 1040 965 966 967 968 970 972 974 976 997 998 + 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1029 1030 1031 + 1032 1033 1034 1035 1036 1037 1038 1039 1040 965 966 967 968 + 970 972 974 976 997 998 999 1000 1001 1002 1003 1004 1005 + 1006 1007 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 + 1039 1040 965 966 967 968 970 972 974 976 997 998 999 + 1000 1001 1002 1003 1004 1005 1006 1007 1008 1029 1030 1031 1032 + 1033 1034 1035 1036 1037 1038 1039 1040 965 966 967 968 970 + 972 974 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 + 1007 1008 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 + 1040 965 966 967 968 970 972 974 976 997 998 999 1000 + 1001 1002 1003 1004 1005 1006 1007 1008 1029 1030 1031 1032 1033 + 1034 1035 1036 1037 1038 1039 1040 965 966 967 968 970 972 + 974 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 + 1008 965 966 967 968 970 972 974 976 997 998 999 1000 + 1001 1002 1003 1004 1005 1006 1007 1008 965 966 967 968 970 + 972 974 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 + 1007 1008 933 934 935 936 938 940 942 944 965 966 967 + 968 969 970 971 972 973 974 975 976 933 934 935 936 + 938 940 942 944 965 966 967 968 969 970 971 972 973 + 974 975 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 + 1007 1008 933 934 935 936 938 940 942 944 965 966 967 + 968 969 970 971 972 973 974 975 976 997 998 999 1000 + 1001 1002 1003 1004 1005 1006 1007 1008 933 934 935 936 938 + 940 942 944 965 966 967 968 969 970 971 972 973 974 + 975 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 + 1008 933 934 935 936 938 940 942 944 965 966 967 968 + 969 970 971 972 973 974 975 976 997 998 999 1000 1001 + 1002 1003 1004 1005 1006 1007 1008 933 934 935 936 938 940 + 942 944 965 966 967 968 969 970 971 972 973 974 975 + 976 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 + 933 934 935 936 938 940 942 944 965 966 967 968 969 + 970 971 972 973 974 975 976 997 998 999 1000 1001 1002 + 1003 1004 1005 1006 1007 1008 933 934 935 936 938 940 942 + 944 965 966 967 968 969 970 971 972 973 974 975 976 + 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 933 + 934 935 936 938 940 942 944 965 966 967 968 969 970 + 971 972 973 974 975 976 997 998 999 1000 1001 1002 1003 + 1004 1005 1006 1007 1008 933 934 935 936 938 940 942 944 + 965 966 967 968 969 970 971 972 973 974 975 976 933 + 934 935 936 938 940 942 944 965 966 967 968 969 970 + 971 972 973 974 975 976 933 934 935 936 938 940 942 + 944 965 966 967 968 969 970 971 972 973 974 975 976 + 901 902 903 904 906 908 910 912 933 934 935 936 937 + 938 939 940 941 942 943 944 901 902 903 904 906 908 + 910 912 933 934 935 936 937 938 939 940 941 942 943 + 944 965 966 967 968 969 970 971 972 973 974 975 976 + 901 902 903 904 906 908 910 912 933 934 935 936 937 + 938 939 940 941 942 943 944 965 966 967 968 969 970 + 971 972 973 974 975 976 901 902 903 904 906 908 910 + 912 933 934 935 936 937 938 939 940 941 942 943 944 + 965 966 967 968 969 970 971 972 973 974 975 976 901 + 902 903 904 906 908 910 912 933 934 935 936 937 938 + 939 940 941 942 943 944 965 966 967 968 969 970 971 + 972 973 974 975 976 901 902 903 904 906 908 910 912 + 933 934 935 936 937 938 939 940 941 942 943 944 965 + 966 967 968 969 970 971 972 973 974 975 976 901 902 + 903 904 906 908 910 912 933 934 935 936 937 938 939 + 940 941 942 943 944 965 966 967 968 969 970 971 972 + 973 974 975 976 901 902 903 904 906 908 910 912 933 + 934 935 936 937 938 939 940 941 942 943 944 965 966 + 967 968 969 970 971 972 973 974 975 976 901 902 903 + 904 906 908 910 912 933 934 935 936 937 938 939 940 + 941 942 943 944 965 966 967 968 969 970 971 972 973 + 974 975 976 901 902 903 904 906 908 910 912 933 934 + 935 936 937 938 939 940 941 942 943 944 901 902 903 + 904 906 908 910 912 933 934 935 936 937 938 939 940 + 941 942 943 944 901 902 903 904 906 908 910 912 933 + 934 935 936 937 938 939 940 941 942 943 944 869 870 + 871 872 874 876 878 880 901 902 903 904 905 906 907 + 908 909 910 911 912 869 870 871 872 874 876 878 880 + 901 902 903 904 905 906 907 908 909 910 911 912 933 + 934 935 936 937 938 939 940 941 942 943 944 869 870 + 871 872 874 876 878 880 901 902 903 904 905 906 907 + 908 909 910 911 912 933 934 935 936 937 938 939 940 + 941 942 943 944 869 870 871 872 874 876 878 880 901 + 902 903 904 905 906 907 908 909 910 911 912 933 934 + 935 936 937 938 939 940 941 942 943 944 869 870 871 + 872 874 876 878 880 901 902 903 904 905 906 907 908 + 909 910 911 912 933 934 935 936 937 938 939 940 941 + 942 943 944 869 870 871 872 874 876 878 880 901 902 + 903 904 905 906 907 908 909 910 911 912 933 934 935 + 936 937 938 939 940 941 942 943 944 869 870 871 872 + 874 876 878 880 901 902 903 904 905 906 907 908 909 + 910 911 912 933 934 935 936 937 938 939 940 941 942 + 943 944 869 870 871 872 874 876 878 880 901 902 903 + 904 905 906 907 908 909 910 911 912 933 934 935 936 + 937 938 939 940 941 942 943 944 869 870 871 872 874 + 876 878 880 901 902 903 904 905 906 907 908 909 910 + 911 912 933 934 935 936 937 938 939 940 941 942 943 + 944 869 870 871 872 874 876 878 880 901 902 903 904 + 905 906 907 908 909 910 911 912 869 870 871 872 874 + 876 878 880 901 902 903 904 905 906 907 908 909 910 + 911 912 869 870 871 872 874 876 878 880 901 902 903 + 904 905 906 907 908 909 910 911 912 837 838 839 840 + 842 844 846 848 869 870 871 872 873 874 875 876 877 + 878 879 880 837 838 839 840 842 844 846 848 869 870 + 871 872 873 874 875 876 877 878 879 880 901 902 903 + 904 905 906 907 908 909 910 911 912 837 838 839 840 + 842 844 846 848 869 870 871 872 873 874 875 876 877 + 878 879 880 901 902 903 904 905 906 907 908 909 910 + 911 912 837 838 839 840 842 844 846 848 869 870 871 + 872 873 874 875 876 877 878 879 880 901 902 903 904 + 905 906 907 908 909 910 911 912 837 838 839 840 842 + 844 846 848 869 870 871 872 873 874 875 876 877 878 + 879 880 901 902 903 904 905 906 907 908 909 910 911 + 912 837 838 839 840 842 844 846 848 869 870 871 872 + 873 874 875 876 877 878 879 880 901 902 903 904 905 + 906 907 908 909 910 911 912 837 838 839 840 842 844 + 846 848 869 870 871 872 873 874 875 876 877 878 879 + 880 901 902 903 904 905 906 907 908 909 910 911 912 + 837 838 839 840 842 844 846 848 869 870 871 872 873 + 874 875 876 877 878 879 880 901 902 903 904 905 906 + 907 908 909 910 911 912 837 838 839 840 842 844 846 + 848 869 870 871 872 873 874 875 876 877 878 879 880 + 901 902 903 904 905 906 907 908 909 910 911 912 837 + 838 839 840 842 844 846 848 869 870 871 872 873 874 + 875 876 877 878 879 880 837 838 839 840 842 844 846 + 848 869 870 871 872 873 874 875 876 877 878 879 880 + 837 838 839 840 842 844 846 848 869 870 871 872 873 + 874 875 876 877 878 879 880 805 806 807 808 810 812 + 814 816 837 838 839 840 841 842 843 844 845 846 847 + 848 805 806 807 808 810 812 814 816 837 838 839 840 + 841 842 843 844 845 846 847 848 869 870 871 872 873 + 874 875 876 877 878 879 880 805 806 807 808 810 812 + 814 816 837 838 839 840 841 842 843 844 845 846 847 + 848 869 870 871 872 873 874 875 876 877 878 879 880 + 805 806 807 808 810 812 814 816 837 838 839 840 841 + 842 843 844 845 846 847 848 869 870 871 872 873 874 + 875 876 877 878 879 880 805 806 807 808 810 812 814 + 816 837 838 839 840 841 842 843 844 845 846 847 848 + 869 870 871 872 873 874 875 876 877 878 879 880 805 + 806 807 808 810 812 814 816 837 838 839 840 841 842 + 843 844 845 846 847 848 869 870 871 872 873 874 875 + 876 877 878 879 880 805 806 807 808 810 812 814 816 + 837 838 839 840 841 842 843 844 845 846 847 848 869 + 870 871 872 873 874 875 876 877 878 879 880 805 806 + 807 808 810 812 814 816 837 838 839 840 841 842 843 + 844 845 846 847 848 869 870 871 872 873 874 875 876 + 877 878 879 880 805 806 807 808 810 812 814 816 837 + 838 839 840 841 842 843 844 845 846 847 848 869 870 + 871 872 873 874 875 876 877 878 879 880 805 806 807 + 808 810 812 814 816 837 838 839 840 841 842 843 844 + 845 846 847 848 805 806 807 808 810 812 814 816 837 + 838 839 840 841 842 843 844 845 846 847 848 805 806 + 807 808 810 812 814 816 837 838 839 840 841 842 843 + 844 845 846 847 848 773 774 775 776 778 780 782 784 + 805 806 807 808 809 810 811 812 813 814 815 816 773 + 774 775 776 778 780 782 784 805 806 807 808 809 810 + 811 812 813 814 815 816 837 838 839 840 841 842 843 + 844 845 846 847 848 773 774 775 776 778 780 782 784 + 805 806 807 808 809 810 811 812 813 814 815 816 837 + 838 839 840 841 842 843 844 845 846 847 848 773 774 + 775 776 778 780 782 784 805 806 807 808 809 810 811 + 812 813 814 815 816 837 838 839 840 841 842 843 844 + 845 846 847 848 773 774 775 776 778 780 782 784 805 + 806 807 808 809 810 811 812 813 814 815 816 837 838 + 839 840 841 842 843 844 845 846 847 848 773 774 775 + 776 778 780 782 784 805 806 807 808 809 810 811 812 + 813 814 815 816 837 838 839 840 841 842 843 844 845 + 846 847 848 773 774 775 776 778 780 782 784 805 806 + 807 808 809 810 811 812 813 814 815 816 837 838 839 + 840 841 842 843 844 845 846 847 848 773 774 775 776 + 778 780 782 784 805 806 807 808 809 810 811 812 813 + 814 815 816 837 838 839 840 841 842 843 844 845 846 + 847 848 773 774 775 776 778 780 782 784 805 806 807 + 808 809 810 811 812 813 814 815 816 837 838 839 840 + 841 842 843 844 845 846 847 848 773 774 775 776 778 + 780 782 784 805 806 807 808 809 810 811 812 813 814 + 815 816 773 774 775 776 778 780 782 784 805 806 807 + 808 809 810 811 812 813 814 815 816 773 774 775 776 + 778 780 782 784 805 806 807 808 809 810 811 812 813 + 814 815 816 741 742 743 744 746 748 750 752 773 774 + 775 776 777 778 779 780 781 782 783 784 741 742 743 + 744 746 748 750 752 773 774 775 776 777 778 779 780 + 781 782 783 784 805 806 807 808 809 810 811 812 813 + 814 815 816 741 742 743 744 746 748 750 752 773 774 + 775 776 777 778 779 780 781 782 783 784 805 806 807 + 808 809 810 811 812 813 814 815 816 741 742 743 744 + 746 748 750 752 773 774 775 776 777 778 779 780 781 + 782 783 784 805 806 807 808 809 810 811 812 813 814 + 815 816 741 742 743 744 746 748 750 752 773 774 775 + 776 777 778 779 780 781 782 783 784 805 806 807 808 + 809 810 811 812 813 814 815 816 741 742 743 744 746 + 748 750 752 773 774 775 776 777 778 779 780 781 782 + 783 784 805 806 807 808 809 810 811 812 813 814 815 + 816 741 742 743 744 746 748 750 752 773 774 775 776 + 777 778 779 780 781 782 783 784 805 806 807 808 809 + 810 811 812 813 814 815 816 741 742 743 744 746 748 + 750 752 773 774 775 776 777 778 779 780 781 782 783 + 784 805 806 807 808 809 810 811 812 813 814 815 816 + 741 742 743 744 746 748 750 752 773 774 775 776 777 + 778 779 780 781 782 783 784 805 806 807 808 809 810 + 811 812 813 814 815 816 741 742 743 744 746 748 750 + 752 773 774 775 776 777 778 779 780 781 782 783 784 + 741 742 743 744 746 748 750 752 773 774 775 776 777 + 778 779 780 781 782 783 784 741 742 743 744 746 748 + 750 752 773 774 775 776 777 778 779 780 781 782 783 + 784 709 710 711 712 714 716 718 720 741 742 743 744 + 745 746 747 748 749 750 751 752 773 774 775 776 777 + 778 779 780 781 782 783 784 709 710 711 712 714 716 + 718 720 741 742 743 744 745 746 747 748 749 750 751 + 752 773 774 775 776 777 778 779 780 781 782 783 784 + 709 710 711 712 714 716 718 720 741 742 743 744 745 + 746 747 748 749 750 751 752 773 774 775 776 777 778 + 779 780 781 782 783 784 709 710 711 712 714 716 718 + 720 741 742 743 744 745 746 747 748 749 750 751 752 + 773 774 775 776 777 778 779 780 781 782 783 784 709 + 710 711 712 714 716 718 720 741 742 743 744 745 746 + 747 748 749 750 751 752 773 774 775 776 777 778 779 + 780 781 782 783 784 709 710 711 712 714 716 718 720 + 741 742 743 744 745 746 747 748 749 750 751 752 773 + 774 775 776 777 778 779 780 781 782 783 784 709 710 + 711 712 714 716 718 720 741 742 743 744 745 746 747 + 748 749 750 751 752 773 774 775 776 777 778 779 780 + 781 782 783 784 709 710 711 712 714 716 718 720 741 + 742 743 744 745 746 747 748 749 750 751 752 773 774 + 775 776 777 778 779 780 781 782 783 784 709 710 711 + 712 714 716 718 720 741 742 743 744 745 746 747 748 + 749 750 751 752 709 710 711 712 714 716 718 720 741 + 742 743 744 745 746 747 748 749 750 751 752 709 710 + 711 712 714 716 718 720 741 742 743 744 745 746 747 + 748 749 750 751 752 709 710 711 712 714 716 718 720 + 741 742 743 744 745 746 747 748 749 750 751 752 677 + 678 679 680 682 684 686 688 709 710 711 712 713 714 + 715 716 717 718 719 720 741 742 743 744 745 746 747 + 748 749 750 751 752 677 678 679 680 682 684 686 688 + 709 710 711 712 713 714 715 716 717 718 719 720 677 + 678 679 680 682 684 686 688 709 710 711 712 713 714 + 715 716 717 718 719 720 677 678 679 680 682 684 686 + 688 709 710 711 712 713 714 715 716 717 718 719 720 + 677 678 679 680 682 684 686 688 709 710 711 712 713 + 714 715 716 717 718 719 720 677 678 679 680 682 684 + 686 688 709 710 711 712 713 714 715 716 717 718 719 + 720 741 742 743 744 745 746 747 748 749 750 751 752 + 677 678 679 680 682 684 686 688 709 710 711 712 713 + 714 715 716 717 718 719 720 741 742 743 744 745 746 + 747 748 749 750 751 752 677 678 679 680 682 684 686 + 688 709 710 711 712 713 714 715 716 717 718 719 720 + 741 742 743 744 745 746 747 748 749 750 751 752 677 + 678 679 680 682 684 686 688 709 710 711 712 713 714 + 715 716 717 718 719 720 741 742 743 744 745 746 747 + 748 749 750 751 752 677 678 679 680 682 684 686 688 + 709 710 711 712 713 714 715 716 717 718 719 720 741 + 742 743 744 745 746 747 748 749 750 751 752 677 678 + 679 680 682 684 686 688 709 710 711 712 713 714 715 + 716 717 718 719 720 741 742 743 744 745 746 747 748 + 749 750 751 752 677 678 679 680 682 684 686 688 709 + 710 711 712 713 714 715 716 717 718 719 720 741 742 + 743 744 745 746 747 748 749 750 751 752 645 646 647 + 648 650 652 654 656 677 678 679 680 681 682 683 684 + 685 686 687 688 645 646 647 648 650 652 654 656 677 + 678 679 680 681 682 683 684 685 686 687 688 709 710 + 711 712 713 714 715 716 717 718 719 720 645 646 647 + 648 650 652 654 656 677 678 679 680 681 682 683 684 + 685 686 687 688 709 710 711 712 713 714 715 716 717 + 718 719 720 645 646 647 648 650 652 654 656 677 678 + 679 680 681 682 683 684 685 686 687 688 709 710 711 + 712 713 714 715 716 717 718 719 720 645 646 647 648 + 650 652 654 656 677 678 679 680 681 682 683 684 685 + 686 687 688 709 710 711 712 713 714 715 716 717 718 + 719 720 645 646 647 648 650 652 654 656 677 678 679 + 680 681 682 683 684 685 686 687 688 709 710 711 712 + 713 714 715 716 717 718 719 720 645 646 647 648 650 + 652 654 656 677 678 679 680 681 682 683 684 685 686 + 687 688 709 710 711 712 713 714 715 716 717 718 719 + 720 645 646 647 648 650 652 654 656 677 678 679 680 + 681 682 683 684 685 686 687 688 709 710 711 712 713 + 714 715 716 717 718 719 720 645 646 647 648 650 652 + 654 656 677 678 679 680 681 682 683 684 685 686 687 + 688 709 710 711 712 713 714 715 716 717 718 719 720 + 645 646 647 648 650 652 654 656 677 678 679 680 681 + 682 683 684 685 686 687 688 645 646 647 648 650 652 + 654 656 677 678 679 680 681 682 683 684 685 686 687 + 688 645 646 647 648 650 652 654 656 677 678 679 680 + 681 682 683 684 685 686 687 688 581 582 583 584 586 + 588 590 592 613 614 615 616 617 618 619 620 621 622 + 623 624 645 646 647 648 649 650 651 652 653 654 655 + 656 581 582 583 584 586 588 590 592 613 614 615 616 + 617 618 619 620 621 622 623 624 645 646 647 648 649 + 650 651 652 653 654 655 656 581 582 583 584 586 588 + 590 592 613 614 615 616 617 618 619 620 621 622 623 + 624 645 646 647 648 649 650 651 652 653 654 655 656 + 581 582 583 584 586 588 590 592 613 614 615 616 617 + 618 619 620 621 622 623 624 645 646 647 648 649 650 + 651 652 653 654 655 656 581 582 583 584 586 588 590 + 592 613 614 615 616 617 618 619 620 621 622 623 624 + 645 646 647 648 649 650 651 652 653 654 655 656 581 + 582 583 584 586 588 590 592 613 614 615 616 617 618 + 619 620 621 622 623 624 645 646 647 648 649 650 651 + 652 653 654 655 656 581 582 583 584 586 588 590 592 + 613 614 615 616 617 618 619 620 621 622 623 624 645 + 646 647 648 649 650 651 652 653 654 655 656 581 582 + 583 584 586 588 590 592 613 614 615 616 617 618 619 + 620 621 622 623 624 645 646 647 648 649 650 651 652 + 653 654 655 656 613 614 615 616 618 620 622 624 645 + 646 647 648 649 650 651 652 653 654 655 656 677 678 + 679 680 681 682 683 684 685 686 687 688 613 614 615 + 616 618 620 622 624 645 646 647 648 649 650 651 652 + 653 654 655 656 677 678 679 680 681 682 683 684 685 + 686 687 688 613 614 615 616 618 620 622 624 645 646 + 647 648 649 650 651 652 653 654 655 656 677 678 679 + 680 681 682 683 684 685 686 687 688 613 614 615 616 + 618 620 622 624 645 646 647 648 649 650 651 652 653 + 654 655 656 677 678 679 680 681 682 683 684 685 686 + 687 688 613 614 615 616 618 620 622 624 645 646 647 + 648 649 650 651 652 653 654 655 656 677 678 679 680 + 681 682 683 684 685 686 687 688 613 614 615 616 618 + 620 622 624 645 646 647 648 649 650 651 652 653 654 + 655 656 677 678 679 680 681 682 683 684 685 686 687 + 688 613 614 615 616 618 620 622 624 645 646 647 648 + 649 650 651 652 653 654 655 656 677 678 679 680 681 + 682 683 684 685 686 687 688 613 614 615 616 618 620 + 622 624 645 646 647 648 649 650 651 652 653 654 655 + 656 677 678 679 680 681 682 683 684 685 686 687 688 + 613 614 615 616 618 620 622 624 645 646 647 648 649 + 650 651 652 653 654 655 656 613 614 615 616 618 620 + 622 624 645 646 647 648 649 650 651 652 653 654 655 + 656 613 614 615 616 618 620 622 624 645 646 647 648 + 649 650 651 652 653 654 655 656 613 614 615 616 618 + 620 622 624 645 646 647 648 649 650 651 652 653 654 + 655 656 + 2.00000000E+00 0.00000000E+00 2.00000000E+00 0.00000000E+00 2.00000000E+00 + 0.00000000E+00 2.00000000E+00 0.00000000E+00 2.00000000E+00 0.00000000E+00 + 2.00000000E+00 0.00000000E+00 2.00000000E+00 0.00000000E+00 2.00000000E+00 + 0.00000000E+00 2.00000000E+00 0.00000000E+00 2.00000000E+00 0.00000000E+00 + 2.00000000E+00 0.00000000E+00 2.00000000E+00 0.00000000E+00 2.00000000E+00 + 0.00000000E+00 2.00000000E+00 0.00000000E+00 8.75942750E-06 0.00000000E+00 + 4.42350460E-08 0.00000000E+00 6.56981094E-06 0.00000000E+00-3.79165823E-08 + 0.00000000E+00 4.42350460E-08 0.00000000E+00 2.46180794E-10 0.00000000E+00 + 4.42365575E-08 0.00000000E+00-2.46186068E-10 0.00000000E+00-3.79165823E-08 + 0.00000000E+00-2.46186068E-10 0.00000000E+00 8.85162345E-08 0.00000000E+00 + 1.31325328E-09 0.00000000E+00 1.26437061E-07 0.00000000E+00-7.38818378E-10 + 0.00000000E+00 6.56981094E-06 0.00000000E+00 4.42365575E-08 0.00000000E+00 + 7.59294901E-05 0.00000000E+00 8.85162345E-08 0.00000000E+00 1.97164994E-05 + 0.00000000E+00-1.20109968E-07 0.00000000E+00 1.97164994E-05 0.00000000E+00 + 1.26437061E-07 0.00000000E+00 1.51945060E-04 0.00000000E+00 8.86702205E-08 + 0.00000000E+00 3.28860902E-05 0.00000000E+00-2.02442283E-07 0.00000000E+00 +-1.20109968E-07 0.00000000E+00-7.38818378E-10 0.00000000E+00 8.86702205E-08 + 0.00000000E+00 2.62798441E-09 0.00000000E+00 2.08784061E-07 0.00000000E+00 +-1.23230320E-09 0.00000000E+00 3.28860902E-05 0.00000000E+00 2.08784061E-07 + 0.00000000E+00 2.28136664E-04 0.00000000E+00 8.89239278E-08 0.00000000E+00 + 4.60935066E-05 0.00000000E+00-2.85007067E-07 0.00000000E+00-2.02442283E-07 + 0.00000000E+00-1.23230320E-09 0.00000000E+00 8.89239278E-08 0.00000000E+00 + 3.94574029E-09 0.00000000E+00 2.91370606E-07 0.00000000E+00-1.72719953E-09 + 0.00000000E+00 4.60935066E-05 0.00000000E+00 2.91370606E-07 0.00000000E+00 + 3.04590319E-04 0.00000000E+00 8.92807049E-08 0.00000000E+00 5.93540390E-05 + 0.00000000E+00-3.67899663E-07 0.00000000E+00-2.85007067E-07 0.00000000E+00 +-1.72719953E-09 0.00000000E+00 8.92807049E-08 0.00000000E+00 5.26801771E-09 + 0.00000000E+00 3.74292548E-07 0.00000000E+00-2.22408031E-09 0.00000000E+00 + 5.93540390E-05 0.00000000E+00 3.74292548E-07 0.00000000E+00 3.81396330E-04 + 0.00000000E+00 8.97431430E-08 0.00000000E+00 7.26833869E-05 0.00000000E+00 +-4.51218253E-07 0.00000000E+00-3.67899663E-07 0.00000000E+00-2.22408031E-09 + 0.00000000E+00 8.97431430E-08 0.00000000E+00 6.59637223E-09 0.00000000E+00 + 4.57648013E-07 0.00000000E+00-2.72353380E-09 0.00000000E+00 7.26833869E-05 + 0.00000000E+00 4.57648013E-07 0.00000000E+00 4.58645576E-04 0.00000000E+00 + 9.03126171E-08 0.00000000E+00 8.60974364E-05 0.00000000E+00-5.35062060E-07 + 0.00000000E+00-4.51218253E-07 0.00000000E+00-2.72353380E-09 0.00000000E+00 + 9.03126171E-08 0.00000000E+00 7.93237847E-09 0.00000000E+00 5.41536420E-07 + 0.00000000E+00-3.22615523E-09 0.00000000E+00 8.60974364E-05 0.00000000E+00 + 5.41536420E-07 0.00000000E+00 5.36430732E-04 0.00000000E+00 9.09908348E-08 + 0.00000000E+00 9.96123693E-05 0.00000000E+00-6.19532152E-07 0.00000000E+00 +-5.35062060E-07 0.00000000E+00-3.22615523E-09 0.00000000E+00 9.09908348E-08 + 0.00000000E+00 9.27763861E-09 0.00000000E+00 6.26059028E-07 0.00000000E+00 +-3.73255084E-09 0.00000000E+00 9.96123693E-05 0.00000000E+00 6.26059028E-07 + 0.00000000E+00 6.14847001E-04 0.00000000E+00 9.17823250E-08 0.00000000E+00 + 1.13244965E-04 0.00000000E+00-7.04733340E-07 0.00000000E+00-6.19532152E-07 + 0.00000000E+00-3.73255084E-09 0.00000000E+00 9.17823250E-08 0.00000000E+00 + 1.06337992E-08 0.00000000E+00 7.11320841E-07 0.00000000E+00-4.24334937E-09 + 0.00000000E+00 1.13244965E-04 0.00000000E+00 7.11320841E-07 0.00000000E+00 + 6.93991813E-04 0.00000000E+00 9.26876732E-08 0.00000000E+00 1.27012198E-04 + 0.00000000E+00-7.90771604E-07 0.00000000E+00-7.04733340E-07 0.00000000E+00 +-4.24334937E-09 0.00000000E+00 9.26876732E-08 0.00000000E+00 1.20025454E-08 + 0.00000000E+00 7.97428108E-07 0.00000000E+00-4.75918668E-09 0.00000000E+00 + 1.27012198E-04 0.00000000E+00 7.97428108E-07 0.00000000E+00 7.73965837E-04 + 0.00000000E+00 9.37138501E-08 0.00000000E+00 1.40931959E-04 0.00000000E+00 +-8.77758640E-07 0.00000000E+00-7.90771604E-07 0.00000000E+00-4.75918668E-09 + 0.00000000E+00 9.37138501E-08 0.00000000E+00 1.33856185E-08 0.00000000E+00 + 8.84492832E-07 0.00000000E+00-5.28073311E-09 0.00000000E+00 1.40931959E-04 + 0.00000000E+00 8.84492832E-07 0.00000000E+00 8.54873478E-04 0.00000000E+00 + 9.48625731E-08 0.00000000E+00 1.55022496E-04 0.00000000E+00-9.65808378E-07 + 0.00000000E+00-8.77758640E-07 0.00000000E+00-5.28073311E-09 0.00000000E+00 + 9.48625731E-08 0.00000000E+00 1.47848237E-08 0.00000000E+00 9.72629243E-07 + 0.00000000E+00-5.80867227E-09 0.00000000E+00 1.55022496E-04 0.00000000E+00 + 9.72629243E-07 0.00000000E+00 9.36822740E-04 0.00000000E+00 9.61406592E-08 + 0.00000000E+00 1.69303005E-04 0.00000000E+00-1.05504060E-06 0.00000000E+00 +-9.65808378E-07 0.00000000E+00-5.80867227E-09 0.00000000E+00 9.61406592E-08 + 0.00000000E+00 1.62020298E-08 0.00000000E+00 1.06195757E-06 0.00000000E+00 +-6.34372335E-09 0.00000000E+00 1.69303005E-04 0.00000000E+00 1.06195757E-06 + 0.00000000E+00 1.01992683E-03 0.00000000E+00 9.75530157E-08 0.00000000E+00 + 1.83793438E-04 0.00000000E+00-1.14557987E-06 0.00000000E+00-1.05504060E-06 + 0.00000000E+00-6.34372335E-09 0.00000000E+00 9.75530157E-08 0.00000000E+00 + 1.76391933E-08 0.00000000E+00 1.15260272E-06 0.00000000E+00-6.88663377E-09 + 0.00000000E+00 1.83793438E-04 0.00000000E+00 1.15260272E-06 0.00000000E+00 + 1.10430351E-03 0.00000000E+00 9.91060520E-08 0.00000000E+00 1.98514700E-04 + 0.00000000E+00-1.23755658E-06 0.00000000E+00-1.14557987E-06 0.00000000E+00 +-6.88663377E-09 0.00000000E+00 9.91060520E-08 0.00000000E+00 1.90983523E-08 + 0.00000000E+00 1.24469566E-06 0.00000000E+00-7.43818669E-09 0.00000000E+00 + 1.98514700E-04 0.00000000E+00 1.24469566E-06 0.00000000E+00 1.19007687E-03 + 0.00000000E+00 1.00807231E-07 0.00000000E+00 2.13488794E-04 0.00000000E+00 +-1.33110805E-06 0.00000000E+00-1.23755658E-06 0.00000000E+00-7.43818669E-09 + 0.00000000E+00 1.00807231E-07 0.00000000E+00 2.05816515E-08 0.00000000E+00 + 1.33837418E-06 0.00000000E+00-7.99920639E-09 0.00000000E+00 2.13488794E-04 + 0.00000000E+00 1.33837418E-06 0.00000000E+00 1.27737718E-03 0.00000000E+00 + 1.02664521E-07 0.00000000E+00 2.28738915E-04 0.00000000E+00-1.42637894E-06 + 0.00000000E+00-1.33110805E-06 0.00000000E+00-7.99920639E-09 0.00000000E+00 + 1.02664521E-07 0.00000000E+00 2.20913454E-08 0.00000000E+00 1.43378361E-06 + 0.00000000E+00-8.57056173E-09 0.00000000E+00 2.28738915E-04 0.00000000E+00 + 1.43378361E-06 0.00000000E+00 1.36634235E-03 0.00000000E+00 1.04686480E-07 + 0.00000000E+00 2.44289530E-04 0.00000000E+00-1.52352193E-06 0.00000000E+00 +-1.42637894E-06 0.00000000E+00-8.57056173E-09 0.00000000E+00 1.04686480E-07 + 0.00000000E+00 2.36298168E-08 0.00000000E+00 1.53107720E-06 0.00000000E+00 +-9.15316936E-09 0.00000000E+00 2.44289530E-04 0.00000000E+00 1.53107720E-06 + 0.00000000E+00 1.45711769E-03 0.00000000E+00 1.06883448E-07 0.00000000E+00 + 2.60166638E-04 0.00000000E+00-1.62269909E-06 0.00000000E+00-1.52352193E-06 + 0.00000000E+00-9.15316936E-09 0.00000000E+00 1.06883448E-07 0.00000000E+00 + 2.51995815E-08 0.00000000E+00 1.63041791E-06 0.00000000E+00-9.74800311E-09 + 0.00000000E+00 5.25986919E-04 0.00000000E+00 2.48000500E-06 0.00000000E+00 + 1.53411731E-03 0.00000000E+00-4.21835721E-06 0.00000000E+00-2.47322832E-06 + 0.00000000E+00-1.11781679E-08 0.00000000E+00-4.21835721E-06 0.00000000E+00 + 1.49705588E-08 0.00000000E+00-2.38685945E-06 0.00000000E+00-1.07877440E-08 + 0.00000000E+00 9.31961136E-08 0.00000000E+00 2.92854760E-08 0.00000000E+00 + 2.48000500E-06 0.00000000E+00-1.11781679E-08 0.00000000E+00 5.07616093E-04 + 0.00000000E+00 2.39337383E-06 0.00000000E+00 2.98553404E-03 0.00000000E+00 + 9.31961136E-08 0.00000000E+00 5.25986919E-04 0.00000000E+00-2.47322832E-06 + 0.00000000E+00 6.46857518E-04 0.00000000E+00 4.05120307E-06 0.00000000E+00 + 3.34490810E-03 0.00000000E+00-2.88314555E-06 0.00000000E+00 5.07616093E-04 + 0.00000000E+00-2.38685945E-06 0.00000000E+00-4.03665185E-06 0.00000000E+00 +-2.42340321E-08 0.00000000E+00-2.88314555E-06 0.00000000E+00 4.68213371E-08 + 0.00000000E+00 2.39337383E-06 0.00000000E+00-1.07877440E-08 0.00000000E+00 + 6.17333390E-04 0.00000000E+00 3.86628975E-06 0.00000000E+00 3.65124957E-03 + 0.00000000E+00 1.98736593E-07 0.00000000E+00 6.46857518E-04 0.00000000E+00 +-4.03665185E-06 0.00000000E+00-3.85243896E-06 0.00000000E+00-2.31280701E-08 + 0.00000000E+00 1.98736593E-07 0.00000000E+00 6.31409811E-08 0.00000000E+00 + 4.05120307E-06 0.00000000E+00-2.42340321E-08 0.00000000E+00 5.89216910E-04 + 0.00000000E+00 3.69020238E-06 0.00000000E+00 3.48479812E-03 0.00000000E+00 + 1.89244595E-07 0.00000000E+00 6.17333390E-04 0.00000000E+00-3.85243896E-06 + 0.00000000E+00-3.67699874E-06 0.00000000E+00-2.20748365E-08 0.00000000E+00 + 1.89244595E-07 0.00000000E+00 6.02627017E-08 0.00000000E+00 3.86628975E-06 + 0.00000000E+00-2.31280701E-08 0.00000000E+00 5.62384798E-04 0.00000000E+00 + 3.52217151E-06 0.00000000E+00 3.32612634E-03 0.00000000E+00 1.80606167E-07 + 0.00000000E+00 5.89216910E-04 0.00000000E+00-3.67699874E-06 0.00000000E+00 +-3.50955873E-06 0.00000000E+00-2.10697072E-08 0.00000000E+00 1.80606167E-07 + 0.00000000E+00 5.75188985E-08 0.00000000E+00 3.69020238E-06 0.00000000E+00 +-2.20748365E-08 0.00000000E+00 5.36730100E-04 0.00000000E+00 3.36152493E-06 + 0.00000000E+00 3.17455768E-03 0.00000000E+00 1.72681764E-07 0.00000000E+00 + 5.62384798E-04 0.00000000E+00-3.50955873E-06 0.00000000E+00-3.34945414E-06 + 0.00000000E+00-2.01086777E-08 0.00000000E+00 1.72681764E-07 0.00000000E+00 + 5.48979462E-08 0.00000000E+00 3.52217151E-06 0.00000000E+00-2.10697072E-08 + 0.00000000E+00 5.12155628E-04 0.00000000E+00 3.20765279E-06 0.00000000E+00 + 3.02950525E-03 0.00000000E+00 1.65412563E-07 0.00000000E+00 5.36730100E-04 + 0.00000000E+00-3.34945414E-06 0.00000000E+00-3.19607976E-06 0.00000000E+00 +-1.91881074E-08 0.00000000E+00 1.65412563E-07 0.00000000E+00 5.23896820E-08 + 0.00000000E+00 3.36152493E-06 0.00000000E+00-2.01086777E-08 0.00000000E+00 + 4.88573983E-04 0.00000000E+00 3.06000664E-06 0.00000000E+00 2.89043658E-03 + 0.00000000E+00 1.58731235E-07 0.00000000E+00 5.12155628E-04 0.00000000E+00 +-3.19607976E-06 0.00000000E+00-3.04889136E-06 0.00000000E+00-1.83047226E-08 + 0.00000000E+00 1.58731235E-07 0.00000000E+00 4.99848936E-08 0.00000000E+00 + 3.20765279E-06 0.00000000E+00-1.91881074E-08 0.00000000E+00 4.65906066E-04 + 0.00000000E+00 2.91809008E-06 0.00000000E+00 2.75687088E-03 0.00000000E+00 + 1.52582271E-07 0.00000000E+00 4.88573983E-04 0.00000000E+00-3.04889136E-06 + 0.00000000E+00-2.90739645E-06 0.00000000E+00-1.74555605E-08 0.00000000E+00 + 1.52582271E-07 0.00000000E+00 4.76752684E-08 0.00000000E+00 3.06000664E-06 + 0.00000000E+00-1.83047226E-08 0.00000000E+00 4.44080279E-04 0.00000000E+00 + 2.78145392E-06 0.00000000E+00 2.62837373E-03 0.00000000E+00 1.46915036E-07 + 0.00000000E+00 4.65906066E-04 0.00000000E+00-2.90739645E-06 0.00000000E+00 +-2.77114908E-06 0.00000000E+00-1.66379394E-08 0.00000000E+00 1.46915036E-07 + 0.00000000E+00 4.54532890E-08 0.00000000E+00 2.91809008E-06 0.00000000E+00 +-1.74555605E-08 0.00000000E+00 4.23031340E-04 0.00000000E+00 2.64968863E-06 + 0.00000000E+00 2.50455006E-03 0.00000000E+00 1.41687169E-07 0.00000000E+00 + 4.44080279E-04 0.00000000E+00-2.77114908E-06 0.00000000E+00-2.63974262E-06 + 0.00000000E+00-1.58494138E-08 0.00000000E+00 1.41687169E-07 0.00000000E+00 + 4.33121231E-08 0.00000000E+00 2.78145392E-06 0.00000000E+00-1.66379394E-08 + 0.00000000E+00 4.02699720E-04 0.00000000E+00 2.52242079E-06 0.00000000E+00 + 2.38503969E-03 0.00000000E+00 1.36859869E-07 0.00000000E+00 4.23031340E-04 + 0.00000000E+00-2.63974262E-06 0.00000000E+00-2.51280625E-06 0.00000000E+00 +-1.50877542E-08 0.00000000E+00 1.36859869E-07 0.00000000E+00 4.12455409E-08 + 0.00000000E+00 2.64968863E-06 0.00000000E+00-1.58494138E-08 0.00000000E+00 + 3.83030945E-04 0.00000000E+00 2.39930873E-06 0.00000000E+00 2.26951365E-03 + 0.00000000E+00 1.32399218E-07 0.00000000E+00 4.02699720E-04 0.00000000E+00 +-2.51280625E-06 0.00000000E+00-2.39000060E-06 0.00000000E+00-1.43509199E-08 + 0.00000000E+00 1.32399218E-07 0.00000000E+00 3.92478526E-08 0.00000000E+00 + 2.52242079E-06 0.00000000E+00-1.50877542E-08 0.00000000E+00 3.63975113E-04 + 0.00000000E+00 2.28003948E-06 0.00000000E+00 2.15767072E-03 0.00000000E+00 + 1.28274305E-07 0.00000000E+00 3.83030945E-04 0.00000000E+00-2.39000060E-06 + 0.00000000E+00-2.27101475E-06 0.00000000E+00-1.36370418E-08 0.00000000E+00 + 1.28274305E-07 0.00000000E+00 3.73138482E-08 0.00000000E+00 2.39930873E-06 + 0.00000000E+00-1.43509199E-08 0.00000000E+00 3.45486210E-04 0.00000000E+00 + 2.16432452E-06 0.00000000E+00 2.04923414E-03 0.00000000E+00 1.24459165E-07 + 0.00000000E+00 3.63975113E-04 0.00000000E+00-2.27101475E-06 0.00000000E+00 +-2.15556195E-06 0.00000000E+00-1.29443962E-08 0.00000000E+00 1.24459165E-07 + 0.00000000E+00 3.54387407E-08 0.00000000E+00 2.28003948E-06 0.00000000E+00 +-1.36370418E-08 0.00000000E+00 3.27521854E-04 0.00000000E+00 2.05189807E-06 + 0.00000000E+00 1.94394868E-03 0.00000000E+00 1.20929194E-07 0.00000000E+00 + 3.45486210E-04 0.00000000E+00-2.15556195E-06 0.00000000E+00-2.04337809E-06 + 0.00000000E+00-1.22713958E-08 0.00000000E+00 1.20929194E-07 0.00000000E+00 + 3.36181166E-08 0.00000000E+00 2.16432452E-06 0.00000000E+00-1.29443962E-08 + 0.00000000E+00 3.10042837E-04 0.00000000E+00 1.94251433E-06 0.00000000E+00 + 1.84157892E-03 0.00000000E+00 1.17663128E-07 0.00000000E+00 3.27521854E-04 + 0.00000000E+00-2.04337809E-06 0.00000000E+00-1.93421879E-06 0.00000000E+00 +-1.16165717E-08 0.00000000E+00 1.17663128E-07 0.00000000E+00 3.18479038E-08 + 0.00000000E+00 2.05189807E-06 0.00000000E+00-1.22713958E-08 0.00000000E+00 + 2.93012800E-04 0.00000000E+00 1.83594536E-06 0.00000000E+00 1.74190672E-03 + 0.00000000E+00 1.14641757E-07 0.00000000E+00 3.10042837E-04 0.00000000E+00 +-1.93421879E-06 0.00000000E+00-1.82785741E-06 0.00000000E+00-1.09785621E-08 + 0.00000000E+00 1.14641757E-07 0.00000000E+00 3.01243298E-08 0.00000000E+00 + 1.94251433E-06 0.00000000E+00-1.16165717E-08 0.00000000E+00 2.76397912E-04 + 0.00000000E+00 1.73197911E-06 0.00000000E+00 1.64472947E-03 0.00000000E+00 + 1.11848087E-07 0.00000000E+00 2.93012800E-04 0.00000000E+00-1.82785741E-06 + 0.00000000E+00 2.60166638E-04 0.00000000E+00 1.63041791E-06 0.00000000E+00 + 1.54985850E-03 0.00000000E+00 1.09266675E-07 0.00000000E+00 2.76397912E-04 + 0.00000000E+00-1.72408305E-06 0.00000000E+00-1.62269909E-06 0.00000000E+00 +-9.74800311E-09 0.00000000E+00 1.09266675E-07 0.00000000E+00 2.68033229E-08 + 0.00000000E+00 1.73197911E-06 0.00000000E+00-1.03560997E-08 0.00000000E+00 +-1.72408305E-06 0.00000000E+00-1.03560997E-08 0.00000000E+00 1.11848087E-07 + 0.00000000E+00 2.84438906E-08 0.00000000E+00 1.83594536E-06 0.00000000E+00 +-1.09785621E-08 0.00000000E+00 8.75942750E-06 0.00000000E+00 4.42350460E-08 + 0.00000000E+00 6.56981094E-06 0.00000000E+00-3.79165823E-08 0.00000000E+00 + 4.42350460E-08 0.00000000E+00 2.46180794E-10 0.00000000E+00 4.42365575E-08 + 0.00000000E+00-2.46186068E-10 0.00000000E+00-3.79165823E-08 0.00000000E+00 +-2.46186068E-10 0.00000000E+00 8.85162345E-08 0.00000000E+00 1.31325328E-09 + 0.00000000E+00 1.26437061E-07 0.00000000E+00-7.38818378E-10 0.00000000E+00 + 6.56981094E-06 0.00000000E+00 4.42365575E-08 0.00000000E+00 7.59294901E-05 + 0.00000000E+00 8.85162345E-08 0.00000000E+00 1.97164994E-05 0.00000000E+00 +-1.20109968E-07 0.00000000E+00 1.97164994E-05 0.00000000E+00 1.26437061E-07 + 0.00000000E+00 1.51945060E-04 0.00000000E+00 8.86702205E-08 0.00000000E+00 + 3.28860902E-05 0.00000000E+00-2.02442283E-07 0.00000000E+00-1.20109968E-07 + 0.00000000E+00-7.38818378E-10 0.00000000E+00 8.86702205E-08 0.00000000E+00 + 2.62798441E-09 0.00000000E+00 2.08784061E-07 0.00000000E+00-1.23230320E-09 + 0.00000000E+00 3.28860902E-05 0.00000000E+00 2.08784061E-07 0.00000000E+00 + 2.28136664E-04 0.00000000E+00 8.89239278E-08 0.00000000E+00 4.60935066E-05 + 0.00000000E+00-2.85007067E-07 0.00000000E+00-2.02442283E-07 0.00000000E+00 +-1.23230320E-09 0.00000000E+00 8.89239278E-08 0.00000000E+00 3.94574029E-09 + 0.00000000E+00 2.91370606E-07 0.00000000E+00-1.72719953E-09 0.00000000E+00 + 4.60935066E-05 0.00000000E+00 2.91370606E-07 0.00000000E+00 3.04590319E-04 + 0.00000000E+00 8.92807049E-08 0.00000000E+00 5.93540390E-05 0.00000000E+00 +-3.67899663E-07 0.00000000E+00-2.85007067E-07 0.00000000E+00-1.72719953E-09 + 0.00000000E+00 8.92807049E-08 0.00000000E+00 5.26801771E-09 0.00000000E+00 + 3.74292548E-07 0.00000000E+00-2.22408031E-09 0.00000000E+00 5.93540390E-05 + 0.00000000E+00 3.74292548E-07 0.00000000E+00 3.81396330E-04 0.00000000E+00 + 8.97431430E-08 0.00000000E+00 7.26833869E-05 0.00000000E+00-4.51218253E-07 + 0.00000000E+00-3.67899663E-07 0.00000000E+00-2.22408031E-09 0.00000000E+00 + 8.97431430E-08 0.00000000E+00 6.59637223E-09 0.00000000E+00 4.57648013E-07 + 0.00000000E+00-2.72353380E-09 0.00000000E+00 7.26833869E-05 0.00000000E+00 + 4.57648013E-07 0.00000000E+00 4.58645576E-04 0.00000000E+00 9.03126171E-08 + 0.00000000E+00 8.60974364E-05 0.00000000E+00-5.35062060E-07 0.00000000E+00 +-4.51218253E-07 0.00000000E+00-2.72353380E-09 0.00000000E+00 9.03126171E-08 + 0.00000000E+00 7.93237847E-09 0.00000000E+00 5.41536420E-07 0.00000000E+00 +-3.22615523E-09 0.00000000E+00 8.60974364E-05 0.00000000E+00 5.41536420E-07 + 0.00000000E+00 5.36430732E-04 0.00000000E+00 9.09908348E-08 0.00000000E+00 + 9.96123693E-05 0.00000000E+00-6.19532152E-07 0.00000000E+00-5.35062060E-07 + 0.00000000E+00-3.22615523E-09 0.00000000E+00 9.09908348E-08 0.00000000E+00 + 9.27763861E-09 0.00000000E+00 6.26059028E-07 0.00000000E+00-3.73255084E-09 + 0.00000000E+00 9.96123693E-05 0.00000000E+00 6.26059028E-07 0.00000000E+00 + 6.14847001E-04 0.00000000E+00 9.17823250E-08 0.00000000E+00 1.13244965E-04 + 0.00000000E+00-7.04733340E-07 0.00000000E+00-6.19532152E-07 0.00000000E+00 +-3.73255084E-09 0.00000000E+00 9.17823250E-08 0.00000000E+00 1.06337992E-08 + 0.00000000E+00 7.11320841E-07 0.00000000E+00-4.24334937E-09 0.00000000E+00 + 1.13244965E-04 0.00000000E+00 7.11320841E-07 0.00000000E+00 6.93991813E-04 + 0.00000000E+00 9.26876732E-08 0.00000000E+00 1.27012198E-04 0.00000000E+00 +-7.90771604E-07 0.00000000E+00-7.04733340E-07 0.00000000E+00-4.24334937E-09 + 0.00000000E+00 9.26876732E-08 0.00000000E+00 1.20025454E-08 0.00000000E+00 + 7.97428108E-07 0.00000000E+00-4.75918668E-09 0.00000000E+00 1.27012198E-04 + 0.00000000E+00 7.97428108E-07 0.00000000E+00 7.73965837E-04 0.00000000E+00 + 9.37138501E-08 0.00000000E+00 1.40931959E-04 0.00000000E+00-8.77758640E-07 + 0.00000000E+00-7.90771604E-07 0.00000000E+00-4.75918668E-09 0.00000000E+00 + 9.37138501E-08 0.00000000E+00 1.33856185E-08 0.00000000E+00 8.84492832E-07 + 0.00000000E+00-5.28073311E-09 0.00000000E+00 1.40931959E-04 0.00000000E+00 + 8.84492832E-07 0.00000000E+00 8.54873478E-04 0.00000000E+00 9.48625731E-08 + 0.00000000E+00 1.55022496E-04 0.00000000E+00-9.65808378E-07 0.00000000E+00 +-8.77758640E-07 0.00000000E+00-5.28073311E-09 0.00000000E+00 9.48625731E-08 + 0.00000000E+00 1.47848237E-08 0.00000000E+00 9.72629243E-07 0.00000000E+00 +-5.80867227E-09 0.00000000E+00 1.55022496E-04 0.00000000E+00 9.72629243E-07 + 0.00000000E+00 9.36822740E-04 0.00000000E+00 9.61406592E-08 0.00000000E+00 + 1.69303005E-04 0.00000000E+00-1.05504060E-06 0.00000000E+00-9.65808378E-07 + 0.00000000E+00-5.80867227E-09 0.00000000E+00 9.61406592E-08 0.00000000E+00 + 1.62020298E-08 0.00000000E+00 1.06195757E-06 0.00000000E+00-6.34372335E-09 + 0.00000000E+00 1.69303005E-04 0.00000000E+00 1.06195757E-06 0.00000000E+00 + 1.01992683E-03 0.00000000E+00 9.75530157E-08 0.00000000E+00 1.83793438E-04 + 0.00000000E+00-1.14557987E-06 0.00000000E+00-1.05504060E-06 0.00000000E+00 +-6.34372335E-09 0.00000000E+00 9.75530157E-08 0.00000000E+00 1.76391933E-08 + 0.00000000E+00 1.15260272E-06 0.00000000E+00-6.88663377E-09 0.00000000E+00 + 1.83793438E-04 0.00000000E+00 1.15260272E-06 0.00000000E+00 1.10430351E-03 + 0.00000000E+00 9.91060520E-08 0.00000000E+00 1.98514700E-04 0.00000000E+00 +-1.23755658E-06 0.00000000E+00-1.14557987E-06 0.00000000E+00-6.88663377E-09 + 0.00000000E+00 9.91060520E-08 0.00000000E+00 1.90983523E-08 0.00000000E+00 + 1.24469566E-06 0.00000000E+00-7.43818669E-09 0.00000000E+00 1.98514700E-04 + 0.00000000E+00 1.24469566E-06 0.00000000E+00 1.19007687E-03 0.00000000E+00 + 1.00807231E-07 0.00000000E+00 2.13488794E-04 0.00000000E+00-1.33110805E-06 + 0.00000000E+00-1.23755658E-06 0.00000000E+00-7.43818669E-09 0.00000000E+00 + 1.00807231E-07 0.00000000E+00 2.05816515E-08 0.00000000E+00 1.33837418E-06 + 0.00000000E+00-7.99920639E-09 0.00000000E+00 2.13488794E-04 0.00000000E+00 + 1.33837418E-06 0.00000000E+00 1.27737718E-03 0.00000000E+00 1.02664521E-07 + 0.00000000E+00 2.28738915E-04 0.00000000E+00-1.42637894E-06 0.00000000E+00 +-1.33110805E-06 0.00000000E+00-7.99920639E-09 0.00000000E+00 1.02664521E-07 + 0.00000000E+00 2.20913454E-08 0.00000000E+00 1.43378361E-06 0.00000000E+00 +-8.57056173E-09 0.00000000E+00 2.28738915E-04 0.00000000E+00 1.43378361E-06 + 0.00000000E+00 1.36634235E-03 0.00000000E+00 1.04686480E-07 0.00000000E+00 + 2.44289530E-04 0.00000000E+00-1.52352193E-06 0.00000000E+00-1.42637894E-06 + 0.00000000E+00-8.57056173E-09 0.00000000E+00 1.04686480E-07 0.00000000E+00 + 2.36298168E-08 0.00000000E+00 1.53107720E-06 0.00000000E+00-9.15316936E-09 + 0.00000000E+00 2.44289530E-04 0.00000000E+00 1.53107720E-06 0.00000000E+00 + 1.45711769E-03 0.00000000E+00 1.06883448E-07 0.00000000E+00 2.60166638E-04 + 0.00000000E+00-1.62269909E-06 0.00000000E+00-1.52352193E-06 0.00000000E+00 +-9.15316936E-09 0.00000000E+00 1.06883448E-07 0.00000000E+00 2.51995815E-08 + 0.00000000E+00 1.63041791E-06 0.00000000E+00-9.74800311E-09 0.00000000E+00 + 5.25986919E-04 0.00000000E+00 2.48000500E-06 0.00000000E+00 1.53411731E-03 + 0.00000000E+00-4.21835721E-06 0.00000000E+00-2.47322832E-06 0.00000000E+00 +-1.11781679E-08 0.00000000E+00-4.21835721E-06 0.00000000E+00 1.49705588E-08 + 0.00000000E+00-2.38685945E-06 0.00000000E+00-1.07877440E-08 0.00000000E+00 + 9.31961136E-08 0.00000000E+00 2.92854760E-08 0.00000000E+00 2.48000500E-06 + 0.00000000E+00-1.11781679E-08 0.00000000E+00 5.07616093E-04 0.00000000E+00 + 2.39337383E-06 0.00000000E+00 2.98553404E-03 0.00000000E+00 9.31961136E-08 + 0.00000000E+00 5.25986919E-04 0.00000000E+00-2.47322832E-06 0.00000000E+00 + 6.46857518E-04 0.00000000E+00 4.05120307E-06 0.00000000E+00 3.34490810E-03 + 0.00000000E+00-2.88314555E-06 0.00000000E+00 5.07616093E-04 0.00000000E+00 +-2.38685945E-06 0.00000000E+00-4.03665185E-06 0.00000000E+00-2.42340321E-08 + 0.00000000E+00-2.88314555E-06 0.00000000E+00 4.68213371E-08 0.00000000E+00 + 2.39337383E-06 0.00000000E+00-1.07877440E-08 0.00000000E+00 6.17333390E-04 + 0.00000000E+00 3.86628975E-06 0.00000000E+00 3.65124957E-03 0.00000000E+00 + 1.98736593E-07 0.00000000E+00 6.46857518E-04 0.00000000E+00-4.03665185E-06 + 0.00000000E+00-3.85243896E-06 0.00000000E+00-2.31280701E-08 0.00000000E+00 + 1.98736593E-07 0.00000000E+00 6.31409811E-08 0.00000000E+00 4.05120307E-06 + 0.00000000E+00-2.42340321E-08 0.00000000E+00 5.89216910E-04 0.00000000E+00 + 3.69020238E-06 0.00000000E+00 3.48479812E-03 0.00000000E+00 1.89244595E-07 + 0.00000000E+00 6.17333390E-04 0.00000000E+00-3.85243896E-06 0.00000000E+00 +-3.67699874E-06 0.00000000E+00-2.20748365E-08 0.00000000E+00 1.89244595E-07 + 0.00000000E+00 6.02627017E-08 0.00000000E+00 3.86628975E-06 0.00000000E+00 +-2.31280701E-08 0.00000000E+00 5.62384798E-04 0.00000000E+00 3.52217151E-06 + 0.00000000E+00 3.32612634E-03 0.00000000E+00 1.80606167E-07 0.00000000E+00 + 5.89216910E-04 0.00000000E+00-3.67699874E-06 0.00000000E+00-3.50955873E-06 + 0.00000000E+00-2.10697072E-08 0.00000000E+00 1.80606167E-07 0.00000000E+00 + 5.75188985E-08 0.00000000E+00 3.69020238E-06 0.00000000E+00-2.20748365E-08 + 0.00000000E+00 5.36730100E-04 0.00000000E+00 3.36152493E-06 0.00000000E+00 + 3.17455768E-03 0.00000000E+00 1.72681764E-07 0.00000000E+00 5.62384798E-04 + 0.00000000E+00-3.50955873E-06 0.00000000E+00-3.34945414E-06 0.00000000E+00 +-2.01086777E-08 0.00000000E+00 1.72681764E-07 0.00000000E+00 5.48979462E-08 + 0.00000000E+00 3.52217151E-06 0.00000000E+00-2.10697072E-08 0.00000000E+00 + 5.12155628E-04 0.00000000E+00 3.20765279E-06 0.00000000E+00 3.02950525E-03 + 0.00000000E+00 1.65412563E-07 0.00000000E+00 5.36730100E-04 0.00000000E+00 +-3.34945414E-06 0.00000000E+00-3.19607976E-06 0.00000000E+00-1.91881074E-08 + 0.00000000E+00 1.65412563E-07 0.00000000E+00 5.23896820E-08 0.00000000E+00 + 3.36152493E-06 0.00000000E+00-2.01086777E-08 0.00000000E+00 4.88573983E-04 + 0.00000000E+00 3.06000664E-06 0.00000000E+00 2.89043658E-03 0.00000000E+00 + 1.58731235E-07 0.00000000E+00 5.12155628E-04 0.00000000E+00-3.19607976E-06 + 0.00000000E+00-3.04889136E-06 0.00000000E+00-1.83047226E-08 0.00000000E+00 + 1.58731235E-07 0.00000000E+00 4.99848936E-08 0.00000000E+00 3.20765279E-06 + 0.00000000E+00-1.91881074E-08 0.00000000E+00 4.65906066E-04 0.00000000E+00 + 2.91809008E-06 0.00000000E+00 2.75687088E-03 0.00000000E+00 1.52582271E-07 + 0.00000000E+00 4.88573983E-04 0.00000000E+00-3.04889136E-06 0.00000000E+00 +-2.90739645E-06 0.00000000E+00-1.74555605E-08 0.00000000E+00 1.52582271E-07 + 0.00000000E+00 4.76752684E-08 0.00000000E+00 3.06000664E-06 0.00000000E+00 +-1.83047226E-08 0.00000000E+00 4.44080279E-04 0.00000000E+00 2.78145392E-06 + 0.00000000E+00 2.62837373E-03 0.00000000E+00 1.46915036E-07 0.00000000E+00 + 4.65906066E-04 0.00000000E+00-2.90739645E-06 0.00000000E+00-2.77114908E-06 + 0.00000000E+00-1.66379394E-08 0.00000000E+00 1.46915036E-07 0.00000000E+00 + 4.54532890E-08 0.00000000E+00 2.91809008E-06 0.00000000E+00-1.74555605E-08 + 0.00000000E+00 4.23031340E-04 0.00000000E+00 2.64968863E-06 0.00000000E+00 + 2.50455006E-03 0.00000000E+00 1.41687169E-07 0.00000000E+00 4.44080279E-04 + 0.00000000E+00-2.77114908E-06 0.00000000E+00-2.63974262E-06 0.00000000E+00 +-1.58494138E-08 0.00000000E+00 1.41687169E-07 0.00000000E+00 4.33121231E-08 + 0.00000000E+00 2.78145392E-06 0.00000000E+00-1.66379394E-08 0.00000000E+00 + 4.02699720E-04 0.00000000E+00 2.52242079E-06 0.00000000E+00 2.38503969E-03 + 0.00000000E+00 1.36859869E-07 0.00000000E+00 4.23031340E-04 0.00000000E+00 +-2.63974262E-06 0.00000000E+00-2.51280625E-06 0.00000000E+00-1.50877542E-08 + 0.00000000E+00 1.36859869E-07 0.00000000E+00 4.12455409E-08 0.00000000E+00 + 2.64968863E-06 0.00000000E+00-1.58494138E-08 0.00000000E+00 3.83030945E-04 + 0.00000000E+00 2.39930873E-06 0.00000000E+00 2.26951365E-03 0.00000000E+00 + 1.32399218E-07 0.00000000E+00 4.02699720E-04 0.00000000E+00-2.51280625E-06 + 0.00000000E+00-2.39000060E-06 0.00000000E+00-1.43509199E-08 0.00000000E+00 + 1.32399218E-07 0.00000000E+00 3.92478526E-08 0.00000000E+00 2.52242079E-06 + 0.00000000E+00-1.50877542E-08 0.00000000E+00 3.63975113E-04 0.00000000E+00 + 2.28003948E-06 0.00000000E+00 2.15767072E-03 0.00000000E+00 1.28274305E-07 + 0.00000000E+00 3.83030945E-04 0.00000000E+00-2.39000060E-06 0.00000000E+00 +-2.27101475E-06 0.00000000E+00-1.36370418E-08 0.00000000E+00 1.28274305E-07 + 0.00000000E+00 3.73138482E-08 0.00000000E+00 2.39930873E-06 0.00000000E+00 +-1.43509199E-08 0.00000000E+00 3.45486210E-04 0.00000000E+00 2.16432452E-06 + 0.00000000E+00 2.04923414E-03 0.00000000E+00 1.24459165E-07 0.00000000E+00 + 3.63975113E-04 0.00000000E+00-2.27101475E-06 0.00000000E+00-2.15556195E-06 + 0.00000000E+00-1.29443962E-08 0.00000000E+00 1.24459165E-07 0.00000000E+00 + 3.54387407E-08 0.00000000E+00 2.28003948E-06 0.00000000E+00-1.36370418E-08 + 0.00000000E+00 3.27521854E-04 0.00000000E+00 2.05189807E-06 0.00000000E+00 + 1.94394868E-03 0.00000000E+00 1.20929194E-07 0.00000000E+00 3.45486210E-04 + 0.00000000E+00-2.15556195E-06 0.00000000E+00-2.04337809E-06 0.00000000E+00 +-1.22713958E-08 0.00000000E+00 1.20929194E-07 0.00000000E+00 3.36181166E-08 + 0.00000000E+00 2.16432452E-06 0.00000000E+00-1.29443962E-08 0.00000000E+00 + 3.10042837E-04 0.00000000E+00 1.94251433E-06 0.00000000E+00 1.84157892E-03 + 0.00000000E+00 1.17663128E-07 0.00000000E+00 3.27521854E-04 0.00000000E+00 +-2.04337809E-06 0.00000000E+00-1.93421879E-06 0.00000000E+00-1.16165717E-08 + 0.00000000E+00 1.17663128E-07 0.00000000E+00 3.18479038E-08 0.00000000E+00 + 2.05189807E-06 0.00000000E+00-1.22713958E-08 0.00000000E+00 2.93012800E-04 + 0.00000000E+00 1.83594536E-06 0.00000000E+00 1.74190672E-03 0.00000000E+00 + 1.14641757E-07 0.00000000E+00 3.10042837E-04 0.00000000E+00-1.93421879E-06 + 0.00000000E+00-1.82785741E-06 0.00000000E+00-1.09785621E-08 0.00000000E+00 + 1.14641757E-07 0.00000000E+00 3.01243298E-08 0.00000000E+00 1.94251433E-06 + 0.00000000E+00-1.16165717E-08 0.00000000E+00 2.76397912E-04 0.00000000E+00 + 1.73197911E-06 0.00000000E+00 1.64472947E-03 0.00000000E+00 1.11848087E-07 + 0.00000000E+00 2.93012800E-04 0.00000000E+00-1.82785741E-06 0.00000000E+00 + 2.60166638E-04 0.00000000E+00 1.63041791E-06 0.00000000E+00 1.54985850E-03 + 0.00000000E+00 1.09266675E-07 0.00000000E+00 2.76397912E-04 0.00000000E+00 +-1.72408305E-06 0.00000000E+00-1.62269909E-06 0.00000000E+00-9.74800311E-09 + 0.00000000E+00 1.09266675E-07 0.00000000E+00 2.68033229E-08 0.00000000E+00 + 1.73197911E-06 0.00000000E+00-1.03560997E-08 0.00000000E+00-1.72408305E-06 + 0.00000000E+00-1.03560997E-08 0.00000000E+00 1.11848087E-07 0.00000000E+00 + 2.84438906E-08 0.00000000E+00 1.83594536E-06 0.00000000E+00-1.09785621E-08 + 0.00000000E+00 2.52505826E-01 0.00000000E+00 1.44380768E-04-1.11464849E-18 + 1.01002561E-01 0.00000000E+00-2.52507036E-02 0.00000000E+00 7.21908598E-05 +-6.04225745E-19-3.60938437E-05 2.08311261E-19 7.21908598E-05 6.04225745E-19 + 1.01002561E-01 0.00000000E+00 5.77496419E-04 3.33299100E-18 7.21845152E-05 + 2.29019301E-19 2.02007605E-01 0.00000000E+00 2.53673071E-07 0.00000000E+00 + 1.01002561E-01 0.00000000E+00 7.21908598E-05-6.04225745E-19 2.02007605E-01 + 0.00000000E+00 2.53673071E-07 0.00000000E+00 5.77496419E-04-3.33299100E-18 + 7.21845152E-05-2.29019301E-19 1.44380768E-04 1.11464849E-18 2.52505826E-01 + 0.00000000E+00 7.21908598E-05 6.04225745E-19-3.60938437E-05-2.08311261E-19 + 1.01002561E-01 0.00000000E+00-2.52507036E-02 0.00000000E+00 7.21848291E-05 + 1.92005693E-19 9.43971392E-03 0.00000000E+00 5.77535624E-04 8.14182850E-19 + 7.21999873E-05 5.51035468E-20 5.47526269E-02 0.00000000E+00 4.72042869E-03 + 0.00000000E+00-2.52507036E-02 0.00000000E+00-3.60938437E-05 2.08311261E-19 + 2.53673071E-07 0.00000000E+00 4.34227697E-02 0.00000000E+00 7.21845152E-05 +-2.29019301E-19 2.88746182E-04-9.30265833E-19 9.43971392E-03 0.00000000E+00 +-3.54003565E-03 0.00000000E+00 7.21848291E-05-1.92005693E-19-3.60962041E-05 + 6.17773099E-20-3.60938437E-05-2.08311261E-19-2.52507036E-02 0.00000000E+00 + 7.21845152E-05 2.29019301E-19 2.88746182E-04 9.30265833E-19 2.53673071E-07 + 0.00000000E+00 4.34227697E-02 0.00000000E+00 7.21848291E-05 1.92005693E-19 +-3.60962041E-05-6.17773099E-20 9.43971392E-03 0.00000000E+00-3.54003565E-03 + 0.00000000E+00 9.43971392E-03 0.00000000E+00 7.21848291E-05-1.92005693E-19 + 5.47526269E-02 0.00000000E+00 4.72042869E-03 0.00000000E+00 5.77535624E-04 +-8.14182850E-19 7.21999873E-05-5.51035468E-20 7.21998374E-05 1.10659477E-19 + 4.93416001E-03 0.00000000E+00 5.77693717E-04 1.64036732E-18 7.22242578E-05 + 2.79151031E-19 3.25146790E-02 0.00000000E+00 3.29011431E-03 0.00000000E+00 +-3.54003565E-03 0.00000000E+00-3.60962041E-05 6.17773099E-20 4.72042869E-03 + 0.00000000E+00 2.04000208E-02 0.00000000E+00 7.21999873E-05-5.51035468E-20 + 2.88802971E-04-4.37747071E-19 4.93416001E-03 0.00000000E+00-2.05606858E-03 + 0.00000000E+00 7.21998374E-05-1.10659477E-19-3.61060238E-05 9.74526269E-20 +-3.60962041E-05-6.17773099E-20-3.54003565E-03 0.00000000E+00 7.21999873E-05 + 5.51035468E-20 2.88802971E-04 4.37747071E-19 4.72042869E-03 0.00000000E+00 + 2.04000208E-02 0.00000000E+00 7.21998374E-05 1.10659477E-19-3.61060238E-05 +-9.74526269E-20 4.93416001E-03 0.00000000E+00-2.05606858E-03 0.00000000E+00 + 4.93416001E-03 0.00000000E+00 7.21998374E-05-1.10659477E-19 3.25146790E-02 + 0.00000000E+00 3.29011431E-03 0.00000000E+00 5.77693717E-04-1.64036732E-18 + 7.22242578E-05-2.79151031E-19 7.22240354E-05 2.52104109E-19 3.32839305E-03 + 0.00000000E+00 5.77925427E-04 1.71412575E-18 7.22580148E-05 1.81266360E-19 + 2.31644755E-02 0.00000000E+00 2.49697619E-03 0.00000000E+00-2.05606858E-03 + 0.00000000E+00-3.61060238E-05 9.74526269E-20 3.29011431E-03 0.00000000E+00 + 1.35268909E-02 0.00000000E+00 7.22242578E-05-2.79151031E-19 2.88900003E-04 +-9.77664255E-19 3.32839305E-03 0.00000000E+00-1.45634231E-03 0.00000000E+00 + 7.22240354E-05-2.52104109E-19-3.61205126E-05 1.08342617E-19-3.61060238E-05 +-9.74526269E-20-2.05606858E-03 0.00000000E+00 7.22242578E-05 2.79151031E-19 + 2.88900003E-04 9.77664255E-19 3.29011431E-03 0.00000000E+00 1.35268909E-02 + 0.00000000E+00 7.22240354E-05 2.52104109E-19-3.61205126E-05-1.08342617E-19 + 3.32839305E-03 0.00000000E+00-1.45634231E-03 0.00000000E+00 3.32839305E-03 + 0.00000000E+00 7.22240354E-05-2.52104109E-19 2.31644755E-02 0.00000000E+00 + 2.49697619E-03 0.00000000E+00 5.77925427E-04-1.71412575E-18 7.22580148E-05 +-1.81266360E-19 7.22577994E-05 1.92214225E-19 2.50870136E-03 0.00000000E+00 + 5.78234767E-04 1.55462165E-18 7.23015919E-05 1.93065849E-19 1.80014525E-02 + 0.00000000E+00 2.00766466E-03 0.00000000E+00-1.45634231E-03 0.00000000E+00 +-3.61205126E-05 1.08342617E-19 2.49697619E-03 0.00000000E+00 1.01293045E-02 + 0.00000000E+00 7.22580148E-05-1.81266360E-19 2.89035132E-04-7.72819711E-19 + 2.50870136E-03 0.00000000E+00-1.12909150E-03 0.00000000E+00 7.22577994E-05 +-1.92214225E-19-3.61398478E-05 9.63200184E-20-3.61205126E-05-1.08342617E-19 +-1.45634231E-03 0.00000000E+00 7.22580148E-05 1.81266360E-19 2.89035132E-04 + 7.72819711E-19 2.49697619E-03 0.00000000E+00 1.01293045E-02 0.00000000E+00 + 7.22577994E-05 1.92214225E-19-3.61398478E-05-9.63200184E-20 2.50870136E-03 + 0.00000000E+00-1.12909150E-03 0.00000000E+00 2.50870136E-03 0.00000000E+00 + 7.22577994E-05-1.92214225E-19 1.80014525E-02 0.00000000E+00 2.00766466E-03 + 0.00000000E+00 5.78234767E-04-1.55462165E-18 7.23015919E-05-1.93065849E-19 + 7.23013690E-05 1.80471453E-19 2.01239456E-03 0.00000000E+00 5.78622637E-04 + 1.49071301E-18 7.23549998E-05 2.01852945E-19 1.47254906E-02 0.00000000E+00 + 1.67771234E-03 0.00000000E+00-1.12909150E-03 0.00000000E+00-3.61398478E-05 + 9.63200184E-20 2.00766466E-03 0.00000000E+00 8.09952173E-03 0.00000000E+00 + 7.23015919E-05-1.93065849E-19 2.89209436E-04-7.54041549E-19 2.01239456E-03 + 0.00000000E+00-9.22526724E-04 0.00000000E+00 7.23013690E-05-1.80471453E-19 +-3.61640922E-05 9.55810994E-20-3.61398478E-05-9.63200184E-20-1.12909150E-03 + 0.00000000E+00 7.23015919E-05 1.93065849E-19 2.89209436E-04 7.54041549E-19 + 2.00766466E-03 0.00000000E+00 8.09952173E-03 0.00000000E+00 7.23013690E-05 + 1.80471453E-19-3.61640922E-05-9.55810994E-20 2.01239456E-03 0.00000000E+00 +-9.22526724E-04 0.00000000E+00 2.01239456E-03 0.00000000E+00 7.23013690E-05 +-1.80471453E-19 1.47254906E-02 0.00000000E+00 1.67771234E-03 0.00000000E+00 + 5.78622637E-04-1.49071301E-18 7.23549998E-05-2.01852945E-19 7.23547916E-05 + 2.15314754E-19 1.67997372E-03 0.00000000E+00 5.79089697E-04 2.01231867E-18 + 7.24183382E-05 2.83129479E-19 1.24615926E-02 0.00000000E+00 1.44070505E-03 + 0.00000000E+00-9.22526724E-04 0.00000000E+00-3.61640922E-05 9.55810994E-20 + 1.67771234E-03 0.00000000E+00 6.74944581E-03 0.00000000E+00 7.23549998E-05 +-2.01852945E-19 2.89423124E-04-8.51336740E-19 1.67997372E-03 0.00000000E+00 +-7.80169692E-04 0.00000000E+00 7.23547916E-05-2.15314754E-19-3.61932824E-05 + 1.24611058E-19-3.61640922E-05-9.55810994E-20-9.22526724E-04 0.00000000E+00 + 7.23549998E-05 2.01852945E-19 2.89423124E-04 8.51336740E-19 1.67771234E-03 + 0.00000000E+00 6.74944581E-03 0.00000000E+00 7.23547916E-05 2.15314754E-19 +-3.61932824E-05-1.24611058E-19 1.67997372E-03 0.00000000E+00-7.80169692E-04 + 0.00000000E+00 1.67997372E-03 0.00000000E+00 7.23547916E-05-2.15314754E-19 + 1.24615926E-02 0.00000000E+00 1.44070505E-03 0.00000000E+00 5.79089697E-04 +-2.01231867E-18 7.24183382E-05-2.83129479E-19 7.24181029E-05 2.71573524E-19 + 1.44191797E-03 0.00000000E+00 5.79636262E-04 2.49541719E-18 7.24916925E-05 + 3.56645168E-19 1.08035988E-02 0.00000000E+00 1.26241515E-03 0.00000000E+00 +-7.80169692E-04 0.00000000E+00-3.61932824E-05 1.24611058E-19 1.44070505E-03 + 0.00000000E+00 5.78659005E-03 0.00000000E+00 7.24183382E-05-2.83129479E-19 + 2.89676469E-04-1.11602926E-18 1.44191797E-03 0.00000000E+00-6.76083280E-04 + 0.00000000E+00 7.24181029E-05-2.71573524E-19-3.62274489E-05 1.57054673E-19 +-3.61932824E-05-1.24611058E-19-7.80169692E-04 0.00000000E+00 7.24183382E-05 + 2.83129479E-19 2.89676469E-04 1.11602926E-18 1.44070505E-03 0.00000000E+00 + 5.78659005E-03 0.00000000E+00 7.24181029E-05 2.71573524E-19-3.62274489E-05 +-1.57054673E-19 1.44191797E-03 0.00000000E+00-6.76083280E-04 0.00000000E+00 + 1.44191797E-03 0.00000000E+00 7.24181029E-05-2.71573524E-19 1.08035988E-02 + 0.00000000E+00 1.26241515E-03 0.00000000E+00 5.79636262E-04-2.49541719E-18 + 7.24916925E-05-3.56645168E-19-6.76083280E-04 0.00000000E+00-3.62274489E-05 + 1.57054673E-19 1.26241515E-03 0.00000000E+00 5.06532646E-03 0.00000000E+00 + 7.24916925E-05-3.56645168E-19 2.89969984E-04-1.40162493E-18 1.26312319E-03 + 0.00000000E+00-5.96661025E-04 0.00000000E+00 7.24914920E-05-3.91478435E-19 +-3.62666740E-05 1.51602465E-19 7.24914920E-05 3.91478435E-19 1.26312319E-03 + 0.00000000E+00 5.80263915E-04 2.54809016E-18 7.25752041E-05 2.14931424E-19 + 9.53715082E-03 0.00000000E+00 1.12352091E-03 0.00000000E+00 1.26312319E-03 + 0.00000000E+00 7.24914920E-05-3.91478435E-19 9.53715082E-03 0.00000000E+00 + 1.12352091E-03 0.00000000E+00 5.80263915E-04-2.54809016E-18 7.25752041E-05 +-2.14931424E-19-3.62274489E-05-1.57054673E-19-6.76083280E-04 0.00000000E+00 + 7.24916925E-05 3.56645168E-19 2.89969984E-04 1.40162493E-18 1.26241515E-03 + 0.00000000E+00 5.06532646E-03 0.00000000E+00 7.24914920E-05 3.91478435E-19 +-3.62666740E-05-1.51602465E-19 1.26312319E-03 0.00000000E+00-5.96661025E-04 + 0.00000000E+00 7.25749664E-05 1.57829273E-19 1.12396061E-03 0.00000000E+00 + 5.80972596E-04 9.27277926E-19 7.26689274E-05 1.08985416E-19 8.53835985E-03 + 0.00000000E+00 1.01231648E-03 0.00000000E+00-5.96661025E-04 0.00000000E+00 +-3.62666740E-05 1.51602465E-19 1.12352091E-03 0.00000000E+00 4.50494786E-03 + 0.00000000E+00 7.25752041E-05-2.14931424E-19 2.90304001E-04-7.91257512E-19 + 1.12396061E-03 0.00000000E+00-5.34069271E-04 0.00000000E+00 7.25749664E-05 +-1.57829273E-19-3.63109735E-05 6.67036722E-20-3.62666740E-05-1.51602465E-19 +-5.96661025E-04 0.00000000E+00 7.25752041E-05 2.14931424E-19 2.90304001E-04 + 7.91257512E-19 1.12352091E-03 0.00000000E+00 4.50494786E-03 0.00000000E+00 + 7.25749664E-05 1.57829273E-19-3.63109735E-05-6.67036722E-20 1.12396061E-03 + 0.00000000E+00-5.34069271E-04 0.00000000E+00 1.12396061E-03 0.00000000E+00 + 7.25749664E-05-1.57829273E-19 8.53835985E-03 0.00000000E+00 1.01231648E-03 + 0.00000000E+00 5.80972596E-04-9.27277926E-19 7.26689274E-05-1.08985416E-19 +-5.34069271E-04 0.00000000E+00-3.63109735E-05 6.67036722E-20 1.01231648E-03 + 0.00000000E+00 4.05710802E-03 0.00000000E+00 7.26689274E-05-1.08985416E-19 + 2.90679001E-04-5.58320476E-19 1.01260399E-03 0.00000000E+00-4.83478011E-04 + 0.00000000E+00 7.26687164E-05-1.44702286E-19-3.63604477E-05 9.51964654E-20 +-3.63109735E-05-6.67036722E-20-5.34069271E-04 0.00000000E+00 7.26689274E-05 + 1.08985416E-19 2.90679001E-04 5.58320476E-19 1.01231648E-03 0.00000000E+00 + 4.05710802E-03 0.00000000E+00 7.26687164E-05 1.44702286E-19-3.63604477E-05 +-9.51964654E-20 1.01260399E-03 0.00000000E+00-4.83478011E-04 0.00000000E+00 + 7.26687164E-05 1.44702286E-19 1.01260399E-03 0.00000000E+00 5.81764191E-04 + 1.56241573E-18 7.27730743E-05 2.36083575E-19 7.73065242E-03 0.00000000E+00 + 9.21308052E-04 0.00000000E+00 1.01260399E-03 0.00000000E+00 7.26687164E-05 +-1.44702286E-19 7.73065242E-03 0.00000000E+00 9.21308052E-04 0.00000000E+00 + 5.81764191E-04-1.56241573E-18 7.27730743E-05-2.36083575E-19-4.83478011E-04 + 0.00000000E+00-3.63604477E-05 9.51964654E-20 9.21308052E-04 0.00000000E+00 + 3.69107618E-03 0.00000000E+00 7.27730743E-05-2.36083575E-19 2.91095602E-04 +-8.89589313E-19 9.21503391E-04 0.00000000E+00-4.41745080E-04 0.00000000E+00 + 7.27728463E-05-2.32139380E-19-3.64151453E-05 1.06368428E-19 7.27728463E-05 + 2.32139380E-19 9.21503391E-04 0.00000000E+00 5.82639281E-04 1.70368713E-18 + 7.28877347E-05 1.93334334E-19 7.06411950E-03 0.00000000E+00 8.45476931E-04 + 0.00000000E+00 9.21503391E-04 0.00000000E+00 7.27728463E-05-2.32139380E-19 + 7.06411950E-03 0.00000000E+00 8.45476931E-04 0.00000000E+00 5.82639281E-04 +-1.70368713E-18 7.28877347E-05-1.93334334E-19-3.63604477E-05-9.51964654E-20 +-4.83478011E-04 0.00000000E+00 7.27730743E-05 2.36083575E-19 2.91095602E-04 + 8.89589313E-19 9.21308052E-04 0.00000000E+00 3.69107618E-03 0.00000000E+00 + 7.27728463E-05 2.32139380E-19-3.64151453E-05-1.06368428E-19 9.21503391E-04 + 0.00000000E+00-4.41745080E-04 0.00000000E+00 7.28875110E-05 1.84190981E-19 + 8.45614190E-04 0.00000000E+00 5.83599508E-04 2.03664784E-18 7.30131388E-05 + 3.28617652E-19 6.50485425E-03 0.00000000E+00 7.81339357E-04 0.00000000E+00 +-4.41745080E-04 0.00000000E+00-3.64151453E-05 1.06368428E-19 8.45476931E-04 + 0.00000000E+00 3.38637919E-03 0.00000000E+00 7.28877347E-05-1.93334334E-19 + 2.91554327E-04-8.19125309E-19 8.45614190E-04 0.00000000E+00-4.06738387E-04 + 0.00000000E+00 7.28875110E-05-1.84190981E-19-3.64751625E-05 1.28202158E-19 +-3.64151453E-05-1.06368428E-19-4.41745080E-04 0.00000000E+00 7.28877347E-05 + 1.93334334E-19 2.91554327E-04 8.19125309E-19 8.45476931E-04 0.00000000E+00 + 3.38637919E-03 0.00000000E+00 7.28875110E-05 1.84190981E-19-3.64751625E-05 +-1.28202158E-19 8.45614190E-04 0.00000000E+00-4.06738387E-04 0.00000000E+00 + 8.45614190E-04 0.00000000E+00 7.28875110E-05-1.84190981E-19 6.50485425E-03 + 0.00000000E+00 7.81339357E-04 0.00000000E+00 5.83599508E-04-2.03664784E-18 + 7.30131388E-05-3.28617652E-19-4.06738387E-04 0.00000000E+00-3.64751625E-05 + 1.28202158E-19 7.81339357E-04 0.00000000E+00 3.12885444E-03 0.00000000E+00 + 7.30131388E-05-3.28617652E-19 2.92055999E-04-1.24460224E-18 7.81438457E-04 + 0.00000000E+00-3.76959722E-04 0.00000000E+00 7.30129146E-05-3.46541010E-19 +-3.65405886E-05 1.32785705E-19-3.64751625E-05-1.28202158E-19-4.06738387E-04 + 0.00000000E+00 7.30131388E-05 3.28617652E-19 2.92055999E-04 1.24460224E-18 + 7.81339357E-04 0.00000000E+00 3.12885444E-03 0.00000000E+00 7.30129146E-05 + 3.46541010E-19-3.65405886E-05-1.32785705E-19 7.81438457E-04 0.00000000E+00 +-3.76959722E-04 0.00000000E+00 7.30129146E-05 3.46541010E-19 7.81438457E-04 + 0.00000000E+00 5.84646274E-04 2.18002859E-18 7.31494398E-05 1.84601809E-19 + 6.02900608E-03 0.00000000E+00 7.26400430E-04 0.00000000E+00 7.81438457E-04 + 0.00000000E+00 7.30129146E-05-3.46541010E-19 6.02900608E-03 0.00000000E+00 + 7.26400430E-04 0.00000000E+00 5.84646274E-04-2.18002859E-18 7.31494398E-05 +-1.84601809E-19-3.76959722E-04 0.00000000E+00-3.65405886E-05 1.32785705E-19 + 7.26400430E-04 0.00000000E+00 2.90838824E-03 0.00000000E+00 7.31494398E-05 +-1.84601809E-19 2.92601278E-04-7.63089717E-19 7.26473614E-04 0.00000000E+00 +-3.51325435E-04 0.00000000E+00 7.31492119E-05-1.63856052E-19-3.66115196E-05 + 9.06397343E-20 7.31492119E-05 1.63856052E-19 7.26473614E-04 0.00000000E+00 + 5.85781103E-04 1.39773764E-18 7.32968666E-05 1.98702885E-19 5.61931079E-03 + 0.00000000E+00 6.78828125E-04 0.00000000E+00 7.26473614E-04 0.00000000E+00 + 7.31492119E-05-1.63856052E-19 5.61931079E-03 0.00000000E+00 6.78828125E-04 + 0.00000000E+00 5.85781103E-04-1.39773764E-18 7.32968666E-05-1.98702885E-19 +-3.65405886E-05-1.32785705E-19-3.76959722E-04 0.00000000E+00 7.31494398E-05 + 1.84601809E-19 2.92601278E-04 7.63089717E-19 7.26400430E-04 0.00000000E+00 + 2.90838824E-03 0.00000000E+00 7.31492119E-05 1.63856052E-19-3.66115196E-05 +-9.06397343E-20 7.26473614E-04 0.00000000E+00-3.51325435E-04 0.00000000E+00 + 7.32966382E-05 2.06550202E-19 6.78883259E-04 0.00000000E+00 5.87005832E-04 + 1.72765771E-18 7.34556401E-05 2.26930845E-19 5.26296537E-03 0.00000000E+00 + 6.37246200E-04 0.00000000E+00-3.51325435E-04 0.00000000E+00-3.66115196E-05 + 9.06397343E-20 6.78828125E-04 0.00000000E+00 2.71756861E-03 0.00000000E+00 + 7.32968666E-05-1.98702885E-19 2.93191063E-04-8.08022071E-19 6.78883259E-04 + 0.00000000E+00-3.29032365E-04 0.00000000E+00 7.32966382E-05-2.06550202E-19 +-3.66880696E-05 1.08370262E-19-3.66115196E-05-9.06397343E-20-3.51325435E-04 + 0.00000000E+00 7.32968666E-05 1.98702885E-19 2.93191063E-04 8.08022071E-19 + 6.78828125E-04 0.00000000E+00 2.71756861E-03 0.00000000E+00 7.32966382E-05 + 2.06550202E-19-3.66880696E-05-1.08370262E-19 6.78883259E-04 0.00000000E+00 +-3.29032365E-04 0.00000000E+00 6.78883259E-04 0.00000000E+00 7.32966382E-05 +-2.06550202E-19 5.26296537E-03 0.00000000E+00 6.37246200E-04 0.00000000E+00 + 5.87005832E-04-1.72765771E-18 7.34556401E-05-2.26930845E-19-3.29032365E-04 + 0.00000000E+00-3.66880696E-05 1.08370262E-19 6.37246200E-04 0.00000000E+00 + 2.55083722E-03 0.00000000E+00 7.34556401E-05-2.26930845E-19 2.93826253E-04 +-9.39821608E-19 6.37288447E-04 0.00000000E+00-3.09472527E-04 0.00000000E+00 + 7.34554112E-05-2.36090296E-19-3.67703614E-05 1.34558776E-19-3.66880696E-05 +-1.08370262E-19-3.29032365E-04 0.00000000E+00 7.34556401E-05 2.26930845E-19 + 2.93826253E-04 9.39821608E-19 6.37246200E-04 0.00000000E+00 2.55083722E-03 + 0.00000000E+00 7.34554112E-05 2.36090296E-19-3.67703614E-05-1.34558776E-19 + 6.37288447E-04 0.00000000E+00-3.09472527E-04 0.00000000E+00 7.34554112E-05 + 2.36090296E-19 6.37288447E-04 0.00000000E+00 5.88322431E-04 2.19400249E-18 + 7.36260344E-05 3.02144806E-19 4.95027334E-03 0.00000000E+00 6.00601663E-04 + 0.00000000E+00 6.37288447E-04 0.00000000E+00 7.34554112E-05-2.36090296E-19 + 4.95027334E-03 0.00000000E+00 6.00601663E-04 0.00000000E+00 5.88322431E-04 +-2.19400249E-18 7.36260344E-05-3.02144806E-19-3.09472527E-04 0.00000000E+00 +-3.67703614E-05 1.34558776E-19 6.00601663E-04 0.00000000E+00 2.40394604E-03 + 0.00000000E+00 7.36260344E-05-3.02144806E-19 2.94507909E-04-1.11868878E-18 + 6.00634481E-04 0.00000000E+00-2.92177181E-04 0.00000000E+00 7.36258017E-05 +-2.99382734E-19-3.68585216E-05 1.05757241E-19 7.36258017E-05 2.99382734E-19 + 6.00634481E-04 0.00000000E+00 5.89732908E-04 1.73149361E-18 7.38082848E-05 + 1.23646230E-19 4.67375581E-03 0.00000000E+00 5.68074243E-04 0.00000000E+00 + 6.00634481E-04 0.00000000E+00 7.36258017E-05-2.99382734E-19 4.67375581E-03 + 0.00000000E+00 5.68074243E-04 0.00000000E+00 5.89732908E-04-1.73149361E-18 + 7.38082848E-05-1.23646230E-19-3.67703614E-05-1.34558776E-19-3.09472527E-04 + 0.00000000E+00 7.36260344E-05 3.02144806E-19 2.94507909E-04 1.11868878E-18 + 6.00601663E-04 0.00000000E+00 2.40394604E-03 0.00000000E+00 7.36258017E-05 + 2.99382734E-19-3.68585216E-05-1.05757241E-19 6.00634481E-04 0.00000000E+00 +-2.92177181E-04 0.00000000E+00 7.38080520E-05 1.00957605E-19 5.68100086E-04 + 0.00000000E+00 5.91239613E-04 3.46836424E-19 7.40027329E-05 8.82205679E-21 + 4.42755351E-03 0.00000000E+00 5.39016708E-04 0.00000000E+00-2.92177181E-04 + 0.00000000E+00-3.68585216E-05 1.05757241E-19 5.68074243E-04 0.00000000E+00 + 2.27359037E-03 0.00000000E+00 7.38082848E-05-1.23646230E-19 2.95237030E-04 +-4.79358099E-19 5.68100086E-04 0.00000000E+00-2.76779198E-04 0.00000000E+00 + 7.38080520E-05-1.00957605E-19-3.69526962E-05 2.74449154E-20-3.68585216E-05 +-1.05757241E-19-2.92177181E-04 0.00000000E+00 7.38082848E-05 1.23646230E-19 + 2.95237030E-04 4.79358099E-19 5.68074243E-04 0.00000000E+00 2.27359037E-03 + 0.00000000E+00 7.38080520E-05 1.00957605E-19-3.69526962E-05-2.74449154E-20 + 5.68100086E-04 0.00000000E+00-2.76779198E-04 0.00000000E+00 5.68100086E-04 + 0.00000000E+00 7.38080520E-05-1.00957605E-19 4.42755351E-03 0.00000000E+00 + 5.39016708E-04 0.00000000E+00 5.91239613E-04-3.46836424E-19 7.40027329E-05 +-8.82205679E-21 2.14691448E-04 0.00000000E+00 6.06593275E-05-2.11915552E-19 + 1.70326147E-03 0.00000000E+00 2.11129320E-04 0.00000000E+00 4.86530401E-04 +-1.45145463E-18 6.09723509E-05-1.44803072E-19-3.04079196E-05-8.91796561E-20 +-1.06455192E-04 0.00000000E+00 6.09723509E-05 1.44803072E-19 1.21865303E-04 + 3.01782260E-19 2.11129320E-04 0.00000000E+00 4.23151561E-04 0.00000000E+00 + 6.06593275E-05 2.11915552E-19 2.14691448E-04 0.00000000E+00 4.86530401E-04 + 1.45145463E-18 6.09723509E-05 1.44803072E-19 1.70326147E-03 0.00000000E+00 + 2.11129320E-04 0.00000000E+00-1.06455192E-04 0.00000000E+00-3.04079196E-05 + 8.91796561E-20 2.11129320E-04 0.00000000E+00 4.23151561E-04 0.00000000E+00 + 6.09723509E-05-1.44803072E-19 1.21865303E-04-3.01782260E-19-3.02528068E-05 +-1.02223430E-19-1.08272646E-04 0.00000000E+00 6.06574152E-05 2.10888680E-19 + 2.42636849E-04 8.17041259E-19 2.14684023E-04 0.00000000E+00 8.58808235E-04 + 0.00000000E+00 6.06593275E-05 2.11915552E-19-3.04079196E-05-8.91796561E-20 + 2.14691448E-04 0.00000000E+00-1.06455192E-04 0.00000000E+00 2.18406560E-04 + 0.00000000E+00 6.03538119E-05-1.98005039E-19 1.73230242E-03 0.00000000E+00 + 2.14684023E-04 0.00000000E+00 4.84038793E-04-1.65072057E-18 6.06574152E-05 +-2.10888680E-19-1.08272646E-04 0.00000000E+00-3.02528068E-05 1.02223430E-19 + 2.14684023E-04 0.00000000E+00 8.58808235E-04 0.00000000E+00 6.06574152E-05 +-2.10888680E-19 2.42636849E-04-8.17041259E-19 2.14691448E-04 0.00000000E+00 +-1.06455192E-04 0.00000000E+00 6.06593275E-05-2.11915552E-19-3.04079196E-05 + 8.91796561E-20 6.03538119E-05 1.98005039E-19 2.18406560E-04 0.00000000E+00 + 4.84038793E-04 1.65072057E-18 6.06574152E-05 2.10888680E-19 1.73230242E-03 + 0.00000000E+00 2.14684023E-04 0.00000000E+00 7.96272581E-05 2.59421630E-19 + 2.96926596E-04 0.00000000E+00 6.39039784E-04 2.00885375E-18 8.01341282E-05 + 2.50716854E-19 2.34749116E-03 0.00000000E+00 2.89975775E-04 0.00000000E+00 +-1.46725593E-04 0.00000000E+00-3.99403466E-05 1.27534621E-19 2.89975775E-04 + 0.00000000E+00 1.01760462E-03 0.00000000E+00 8.01341282E-05-2.50716854E-19 + 2.80927199E-04-9.08863458E-19 2.18406560E-04 0.00000000E+00-1.08272646E-04 + 0.00000000E+00 6.03538119E-05-1.98005039E-19-3.02528068E-05 1.02223430E-19 +-3.99403466E-05-1.27534621E-19-1.46725593E-04 0.00000000E+00 8.01341282E-05 + 2.50716854E-19 2.80927199E-04 9.08863458E-19 2.89975775E-04 0.00000000E+00 + 1.01760462E-03 0.00000000E+00 6.03538119E-05 1.98005039E-19-3.02528068E-05 +-1.02223430E-19 2.18406560E-04 0.00000000E+00-1.08272646E-04 0.00000000E+00 + 2.96926596E-04 0.00000000E+00 7.96272581E-05-2.59421630E-19 2.34749116E-03 + 0.00000000E+00 2.89975775E-04 0.00000000E+00 6.39039784E-04-2.00885375E-18 + 8.01341282E-05-2.50716854E-19 7.91435571E-05 2.54346782E-19 3.04320363E-04 + 0.00000000E+00 6.35075183E-04 2.13773822E-18 7.96270880E-05 2.73159155E-19 + 2.40484179E-03 0.00000000E+00 2.96924047E-04 0.00000000E+00-1.50311103E-04 + 0.00000000E+00-3.96926613E-05 1.31876484E-19 2.96924047E-04 0.00000000E+00 + 1.18786032E-03 0.00000000E+00 7.96270880E-05-2.73159155E-19 3.18517009E-04 +-1.05524314E-18 2.96926596E-04 0.00000000E+00-1.46725593E-04 0.00000000E+00 + 7.96272581E-05-2.59421630E-19-3.99403466E-05 1.27534621E-19-3.96926613E-05 +-1.31876484E-19-1.50311103E-04 0.00000000E+00 7.96270880E-05 2.73159155E-19 + 3.18517009E-04 1.05524314E-18 2.96924047E-04 0.00000000E+00 1.18786032E-03 + 0.00000000E+00 7.96272581E-05 2.59421630E-19-3.99403466E-05-1.27534621E-19 + 2.96926596E-04 0.00000000E+00-1.46725593E-04 0.00000000E+00 3.04320363E-04 + 0.00000000E+00 7.91435571E-05-2.54346782E-19 2.40484179E-03 0.00000000E+00 + 2.96924047E-04 0.00000000E+00 6.35075183E-04-2.13773822E-18 7.96270880E-05 +-2.73159155E-19 7.86844880E-05 2.51702607E-19 3.12206384E-04 0.00000000E+00 + 6.31307374E-04 1.94264770E-18 7.91439743E-05 2.42481483E-19 2.46596012E-03 + 0.00000000E+00 3.04319873E-04 0.00000000E+00-1.54131564E-04 0.00000000E+00 +-3.94571156E-05 1.23546023E-19 3.04319873E-04 0.00000000E+00 1.21745555E-03 + 0.00000000E+00 7.91439743E-05-2.42481483E-19 3.16583654E-04-1.00349649E-18 + 3.04320363E-04 0.00000000E+00-1.50311103E-04 0.00000000E+00 7.91435571E-05 +-2.54346782E-19-3.96926613E-05 1.31876484E-19-3.94571156E-05-1.23546023E-19 +-1.54131564E-04 0.00000000E+00 7.91439743E-05 2.42481483E-19 3.16583654E-04 + 1.00349649E-18 3.04319873E-04 0.00000000E+00 1.21745555E-03 0.00000000E+00 + 7.91435571E-05 2.54346782E-19-3.96926613E-05-1.31876484E-19 3.04320363E-04 + 0.00000000E+00-1.50311103E-04 0.00000000E+00 3.12206384E-04 0.00000000E+00 + 7.86844880E-05-2.51702607E-19 2.46596012E-03 0.00000000E+00 3.04319873E-04 + 0.00000000E+00 6.31307374E-04-1.94264770E-18 7.91439743E-05-2.42481483E-19 + 7.82476655E-05 3.58714096E-19 3.20621826E-04 0.00000000E+00 6.27723377E-04 + 2.48099194E-18 7.86847495E-05 2.57655201E-19 2.53114956E-03 0.00000000E+00 + 3.12205094E-04 0.00000000E+00-1.58206730E-04 0.00000000E+00-3.92331038E-05 + 1.54092324E-19 3.12205094E-04 0.00000000E+00 1.24901231E-03 0.00000000E+00 + 7.86847495E-05-2.57655201E-19 3.14746475E-04-1.05101002E-18 3.12206384E-04 + 0.00000000E+00-1.54131564E-04 0.00000000E+00 7.86844880E-05-2.51702607E-19 +-3.94571156E-05 1.23546023E-19-3.92331038E-05-1.54092324E-19-1.58206730E-04 + 0.00000000E+00 7.86847495E-05 2.57655201E-19 3.14746475E-04 1.05101002E-18 + 3.12205094E-04 0.00000000E+00 1.24901231E-03 0.00000000E+00 7.86844880E-05 + 2.51702607E-19-3.94571156E-05-1.23546023E-19 3.12206384E-04 0.00000000E+00 +-1.54131564E-04 0.00000000E+00 3.20621826E-04 0.00000000E+00 7.82476655E-05 +-3.58714096E-19 2.53114956E-03 0.00000000E+00 3.12205094E-04 0.00000000E+00 + 6.27723377E-04-2.48099194E-18 7.86847495E-05-2.57655201E-19 7.78322240E-05 + 2.08933904E-19 3.29614774E-04 0.00000000E+00 6.24314774E-04 2.38290838E-18 + 7.82479558E-05 3.70549476E-19 2.60076848E-03 0.00000000E+00 3.20620423E-04 + 0.00000000E+00-1.62558799E-04 0.00000000E+00-3.90200449E-05 1.44870845E-19 + 3.20620423E-04 0.00000000E+00 1.28269079E-03 0.00000000E+00 7.82479558E-05 +-3.70549476E-19 3.12998870E-04-1.36681858E-18 3.20621826E-04 0.00000000E+00 +-1.58206730E-04 0.00000000E+00 7.82476655E-05-3.58714096E-19-3.92331038E-05 + 1.54092324E-19-3.90200449E-05-1.44870845E-19-1.62558799E-04 0.00000000E+00 + 7.82479558E-05 3.70549476E-19 3.12998870E-04 1.36681858E-18 3.20620423E-04 + 0.00000000E+00 1.28269079E-03 0.00000000E+00 7.82476655E-05 3.58714096E-19 +-3.92331038E-05-1.54092324E-19 3.20621826E-04 0.00000000E+00-1.58206730E-04 + 0.00000000E+00 3.29614774E-04 0.00000000E+00 7.78322240E-05-2.08933904E-19 + 2.60076848E-03 0.00000000E+00 3.20620423E-04 0.00000000E+00 6.24314774E-04 +-2.38290838E-18 7.82479558E-05-3.70549476E-19 7.74370958E-05 1.12123942E-19 + 3.39238444E-04 0.00000000E+00 6.21072714E-04 1.02612150E-18 7.78325003E-05 + 1.76745171E-19 2.67521734E-03 0.00000000E+00 3.29613039E-04 0.00000000E+00 +-1.67212871E-04 0.00000000E+00-3.88173990E-05 7.22172781E-20 3.29613039E-04 + 0.00000000E+00 1.31868100E-03 0.00000000E+00 7.78325003E-05-1.76745171E-19 + 3.11336709E-04-8.06254492E-19 3.29614774E-04 0.00000000E+00-1.62558799E-04 + 0.00000000E+00 7.78322240E-05-2.08933904E-19-3.90200449E-05 1.44870845E-19 +-3.88173990E-05-7.22172781E-20-1.67212871E-04 0.00000000E+00 7.78325003E-05 + 1.76745171E-19 3.11336709E-04 8.06254492E-19 3.29613039E-04 0.00000000E+00 + 1.31868100E-03 0.00000000E+00 7.78322240E-05 2.08933904E-19-3.90200449E-05 +-1.44870845E-19 3.29614774E-04 0.00000000E+00-1.62558799E-04 0.00000000E+00 + 3.39238444E-04 0.00000000E+00 7.74370958E-05-1.12123942E-19 2.67521734E-03 + 0.00000000E+00 3.29613039E-04 0.00000000E+00 6.21072714E-04-1.02612150E-18 + 7.78325003E-05-1.76745171E-19-1.72197455E-04 0.00000000E+00-3.86246740E-05 + 1.55625796E-19 3.39236367E-04 0.00000000E+00 1.35719665E-03 0.00000000E+00 + 7.74373684E-05-1.51479002E-19 3.09755846E-04-6.56074923E-19 3.39238444E-04 + 0.00000000E+00-1.67212871E-04 0.00000000E+00 7.74370958E-05-1.12123942E-19 +-3.88173990E-05 7.22172781E-20 7.70613276E-05 4.71024180E-19 3.49553453E-04 + 0.00000000E+00 6.17989374E-04 2.60308139E-18 7.74373684E-05 1.51479002E-19 + 2.75495220E-03 0.00000000E+00 3.39236367E-04 0.00000000E+00 3.49553453E-04 + 0.00000000E+00 7.70613276E-05-4.71024180E-19 2.75495220E-03 0.00000000E+00 + 3.39236367E-04 0.00000000E+00 6.17989374E-04-2.60308139E-18 7.74373684E-05 +-1.51479002E-19-3.86246740E-05-1.55625796E-19-1.72197455E-04 0.00000000E+00 + 7.74373684E-05 1.51479002E-19 3.09755846E-04 6.56074923E-19 3.39236367E-04 + 0.00000000E+00 1.35719665E-03 0.00000000E+00 7.74370958E-05 1.12123942E-19 +-3.88173990E-05-7.22172781E-20 3.39238444E-04 0.00000000E+00-1.67212871E-04 + 0.00000000E+00 7.67040762E-05 5.80547583E-20 3.60629146E-04 0.00000000E+00 + 6.15057503E-04 1.89609337E-18 7.70615940E-05 4.33841430E-19 2.84049214E-03 + 0.00000000E+00 3.49550957E-04 0.00000000E+00-1.77545026E-04 0.00000000E+00 +-3.84414176E-05 1.22974047E-19 3.49550957E-04 0.00000000E+00 1.39848064E-03 + 0.00000000E+00 7.70615940E-05-4.33841430E-19 3.08252460E-04-1.57547897E-18 + 3.49553453E-04 0.00000000E+00-1.72197455E-04 0.00000000E+00 7.70613276E-05 +-4.71024180E-19-3.86246740E-05 1.55625796E-19-3.84414176E-05-1.22974047E-19 +-1.77545026E-04 0.00000000E+00 7.70615940E-05 4.33841430E-19 3.08252460E-04 + 1.57547897E-18 3.49550957E-04 0.00000000E+00 1.39848064E-03 0.00000000E+00 + 7.70613276E-05 4.71024180E-19-3.86246740E-05-1.55625796E-19 3.49553453E-04 + 0.00000000E+00-1.72197455E-04 0.00000000E+00 3.60629146E-04 0.00000000E+00 + 7.67040762E-05-5.80547583E-20 2.84049214E-03 0.00000000E+00 3.49550957E-04 + 0.00000000E+00 6.15057503E-04-1.89609337E-18 7.70615940E-05-4.33841430E-19 +-1.83292753E-04 0.00000000E+00-3.82672213E-05 1.27081310E-19 3.60626165E-04 + 0.00000000E+00 1.44281079E-03 0.00000000E+00 7.67043391E-05-8.48884992E-20 + 3.06823162E-04-5.29741474E-19 3.60629146E-04 0.00000000E+00-1.77545026E-04 + 0.00000000E+00 7.67040762E-05-5.80547583E-20-3.84414176E-05 1.22974047E-19 +-3.82672213E-05-1.27081310E-19-1.83292753E-04 0.00000000E+00 7.67043391E-05 + 8.48884992E-20 3.06823162E-04 5.29741474E-19 3.60626165E-04 0.00000000E+00 + 1.44281079E-03 0.00000000E+00 7.67040762E-05 5.80547583E-20-3.84414176E-05 +-1.22974047E-19 3.60629146E-04 0.00000000E+00-1.77545026E-04 0.00000000E+00 + 7.63645460E-05 4.23436741E-19 3.72544847E-04 0.00000000E+00 6.12270583E-04 + 2.03875790E-18 7.67043391E-05 8.48884992E-20 2.93243150E-03 0.00000000E+00 + 3.60626165E-04 0.00000000E+00 3.72544847E-04 0.00000000E+00 7.63645460E-05 +-4.23436741E-19 2.93243150E-03 0.00000000E+00 3.60626165E-04 0.00000000E+00 + 6.12270583E-04-2.03875790E-18 7.67043391E-05-8.48884992E-20-1.89483264E-04 + 0.00000000E+00-3.81017018E-05 1.74314816E-19 3.72541280E-04 0.00000000E+00 + 1.49050504E-03 0.00000000E+00 7.63648045E-05-4.26180520E-19 3.05464770E-04 +-1.52681598E-18 3.72544847E-04 0.00000000E+00-1.83292753E-04 0.00000000E+00 + 7.63645460E-05-4.23436741E-19-3.82672213E-05 1.27081310E-19 7.60420025E-05 + 2.71078746E-19 3.85391775E-04 0.00000000E+00 6.09622471E-04 2.88074516E-18 + 7.63648045E-05 4.26180520E-19 3.03145166E-03 0.00000000E+00 3.72541280E-04 + 0.00000000E+00 3.85391775E-04 0.00000000E+00 7.60420025E-05-2.71078746E-19 + 3.03145166E-03 0.00000000E+00 3.72541280E-04 0.00000000E+00 6.09622471E-04 +-2.88074516E-18 7.63648045E-05-4.26180520E-19-3.81017018E-05-1.74314816E-19 +-1.89483264E-04 0.00000000E+00 7.63648045E-05 4.26180520E-19 3.05464770E-04 + 1.52681598E-18 3.72541280E-04 0.00000000E+00 1.49050504E-03 0.00000000E+00 + 7.63645460E-05 4.23436741E-19-3.82672213E-05-1.27081310E-19 3.72544847E-04 + 0.00000000E+00-1.83292753E-04 0.00000000E+00 7.57357700E-05 1.27061470E-19 + 3.99275362E-04 0.00000000E+00 6.07107544E-04 1.36244647E-18 7.60422581E-05 + 2.39031309E-19 3.13833852E-03 0.00000000E+00 3.85387511E-04 0.00000000E+00 +-1.96165718E-04 0.00000000E+00-3.79445070E-05 9.15231948E-20 3.85387511E-04 + 0.00000000E+00 1.54192905E-03 0.00000000E+00 7.60422581E-05-2.39031309E-19 + 3.04174348E-04-1.03595016E-18 3.85391775E-04 0.00000000E+00-1.89483264E-04 + 0.00000000E+00 7.60420025E-05-2.71078746E-19-3.81017018E-05 1.74314816E-19 +-3.79445070E-05-9.15231948E-20-1.96165718E-04 0.00000000E+00 7.60422581E-05 + 2.39031309E-19 3.04174348E-04 1.03595016E-18 3.85387511E-04 0.00000000E+00 + 1.54192905E-03 0.00000000E+00 7.60420025E-05 2.71078746E-19-3.81017018E-05 +-1.74314816E-19 3.85391775E-04 0.00000000E+00-1.89483264E-04 0.00000000E+00 + 3.99275362E-04 0.00000000E+00 7.57357700E-05-1.27061470E-19 3.13833852E-03 + 0.00000000E+00 3.85387511E-04 0.00000000E+00 6.07107544E-04-1.36244647E-18 + 7.60422581E-05-2.39031309E-19-2.03397069E-04 0.00000000E+00-3.77953126E-05 + 9.16564431E-20 3.99270242E-04 0.00000000E+00 1.59750546E-03 0.00000000E+00 + 7.57360200E-05-1.66253623E-19 3.02949187E-04-6.38816820E-19 3.99275362E-04 + 0.00000000E+00-1.96165718E-04 0.00000000E+00 7.57357700E-05-1.27061470E-19 +-3.79445070E-05 9.15231948E-20-3.77953126E-05-9.16564431E-20-2.03397069E-04 + 0.00000000E+00 7.57360200E-05 1.66253623E-19 3.02949187E-04 6.38816820E-19 + 3.99270242E-04 0.00000000E+00 1.59750546E-03 0.00000000E+00 7.57357700E-05 + 1.27061470E-19-3.79445070E-05-9.15231948E-20 3.99275362E-04 0.00000000E+00 +-1.96165718E-04 0.00000000E+00 7.54452306E-05 2.00372150E-19 4.14318035E-04 + 0.00000000E+00 6.04720596E-04 1.54474102E-18 7.57360200E-05 1.66253623E-19 + 3.25400233E-03 0.00000000E+00 3.99270242E-04 0.00000000E+00 4.14318035E-04 + 0.00000000E+00 7.54452306E-05-2.00372150E-19 3.25400233E-03 0.00000000E+00 + 3.99270242E-04 0.00000000E+00 6.04720596E-04-1.54474102E-18 7.57360200E-05 +-1.66253623E-19-2.11243682E-04 0.00000000E+00-3.76538272E-05 6.20176414E-20 + 4.14311898E-04 0.00000000E+00 1.65772526E-03 0.00000000E+00 7.54454813E-05 +-1.65756107E-19 3.01786829E-04-6.89024582E-19 4.14318035E-04 0.00000000E+00 +-2.03397069E-04 0.00000000E+00 7.54452306E-05-2.00372150E-19-3.77953126E-05 + 9.16564431E-20 7.51698276E-05 8.23144585E-20 4.30662828E-04 0.00000000E+00 + 6.02456994E-04 9.23474648E-19 7.54454813E-05 1.65756107E-19 3.37950392E-03 + 0.00000000E+00 4.14311898E-04 0.00000000E+00 4.30662828E-04 0.00000000E+00 + 7.51698276E-05-8.23144585E-20 3.37950392E-03 0.00000000E+00 4.14311898E-04 + 0.00000000E+00 6.02456994E-04-9.23474648E-19 7.54454813E-05-1.65756107E-19 +-3.76538272E-05-6.20176414E-20-2.11243682E-04 0.00000000E+00 7.54454813E-05 + 1.65756107E-19 3.01786829E-04 6.89024582E-19 4.14311898E-04 0.00000000E+00 + 1.65772526E-03 0.00000000E+00 7.54452306E-05 2.00372150E-19-3.77953126E-05 +-9.16564431E-20 4.14318035E-04 0.00000000E+00-2.03397069E-04 0.00000000E+00 + 7.49090109E-05 2.82564308E-19 4.48477606E-04 0.00000000E+00 6.00312236E-04 + 1.43597767E-18 7.51700730E-05 8.76795328E-20 3.51608496E-03 0.00000000E+00 + 4.30655417E-04 0.00000000E+00-2.19783256E-04 0.00000000E+00-3.75197710E-05 + 9.25609601E-20 4.30655417E-04 0.00000000E+00 1.72316193E-03 0.00000000E+00 + 7.51700730E-05-8.76795328E-20 3.00685012E-04-4.41861034E-19 4.30662828E-04 + 0.00000000E+00-2.11243682E-04 0.00000000E+00 7.51698276E-05-8.23144585E-20 +-3.76538272E-05 6.20176414E-20-3.75197710E-05-9.25609601E-20-2.19783256E-04 + 0.00000000E+00 7.51700730E-05 8.76795328E-20 3.00685012E-04 4.41861034E-19 + 4.30655417E-04 0.00000000E+00 1.72316193E-03 0.00000000E+00 7.51698276E-05 + 8.23144585E-20-3.76538272E-05-6.20176414E-20 4.30662828E-04 0.00000000E+00 +-2.11243682E-04 0.00000000E+00 4.48477606E-04 0.00000000E+00 7.49090109E-05 +-2.82564308E-19 3.51608496E-03 0.00000000E+00 4.30655417E-04 0.00000000E+00 + 6.00312236E-04-1.43597767E-18 7.51700730E-05-8.76795328E-20-2.29107412E-04 + 0.00000000E+00-3.73928893E-05 1.33711675E-19 4.48468635E-04 0.00000000E+00 + 1.79448896E-03 0.00000000E+00 7.49092552E-05-3.36018317E-19 2.99641571E-04 +-1.11531980E-18 4.48477606E-04 0.00000000E+00-2.19783256E-04 0.00000000E+00 + 7.49090109E-05-2.82564308E-19-3.75197710E-05 9.25609601E-20-3.73928893E-05 +-1.33711675E-19-2.29107412E-04 0.00000000E+00 7.49092552E-05 3.36018317E-19 + 2.99641571E-04 1.11531980E-18 4.48468635E-04 0.00000000E+00 1.79448896E-03 + 0.00000000E+00 7.49090109E-05 2.82564308E-19-3.75197710E-05-9.25609601E-20 + 4.48477606E-04 0.00000000E+00-2.19783256E-04 0.00000000E+00 7.46623019E-05 + 1.98828385E-19 4.67961014E-04 0.00000000E+00 5.98282265E-04 2.32506205E-18 + 7.49092552E-05 3.36018317E-19 3.66520960E-03 0.00000000E+00 4.48468635E-04 + 0.00000000E+00 4.67961014E-04 0.00000000E+00 7.46623019E-05-1.98828385E-19 + 3.66520960E-03 0.00000000E+00 4.48468635E-04 0.00000000E+00 5.98282265E-04 +-2.32506205E-18 7.49092552E-05-3.36018317E-19-2.39324912E-04 0.00000000E+00 +-3.72729483E-05 6.73834721E-20 4.67950087E-04 0.00000000E+00 1.87250329E-03 + 0.00000000E+00 7.46625429E-05-1.02779359E-19 2.98654568E-04-6.77568961E-19 + 4.67961014E-04 0.00000000E+00-2.29107412E-04 0.00000000E+00 7.46623019E-05 +-1.98828385E-19-3.73928893E-05 1.33711675E-19 7.44292501E-05 1.66754529E-19 + 4.89349560E-04 0.00000000E+00 5.96363329E-04 8.45589705E-19 7.46625429E-05 + 1.02779359E-19 3.82861564E-03 0.00000000E+00 4.67950087E-04 0.00000000E+00 + 4.89349560E-04 0.00000000E+00 7.44292501E-05-1.66754529E-19 3.82861564E-03 + 0.00000000E+00 4.67950087E-04 0.00000000E+00 5.96363329E-04-8.45589705E-19 + 7.46625429E-05-1.02779359E-19-3.72729483E-05-6.73834721E-20-2.39324912E-04 + 0.00000000E+00 7.46625429E-05 1.02779359E-19 2.98654568E-04 6.77568961E-19 + 4.67950087E-04 0.00000000E+00 1.87250329E-03 0.00000000E+00 7.46623019E-05 + 1.98828385E-19-3.73928893E-05-1.33711675E-19 4.67961014E-04 0.00000000E+00 +-2.29107412E-04 0.00000000E+00 7.42094428E-05 2.85146593E-19 5.12927099E-04 + 0.00000000E+00 5.94552003E-04 2.36379438E-18 7.44294899E-05 2.58606043E-19 + 4.00838103E-03 0.00000000E+00 4.89336176E-04 0.00000000E+00-2.50565819E-04 + 0.00000000E+00-3.71597332E-05 1.35938159E-19 4.89336176E-04 0.00000000E+00 + 1.95815412E-03 0.00000000E+00 7.44294899E-05-2.58606043E-19 2.97722210E-04 +-8.36905908E-19 4.89349560E-04 0.00000000E+00-2.39324912E-04 0.00000000E+00 + 7.44292501E-05-1.66754529E-19-3.72729483E-05 6.73834721E-20-3.71597332E-05 +-1.35938159E-19-2.50565819E-04 0.00000000E+00 7.44294899E-05 2.58606043E-19 + 2.97722210E-04 8.36905908E-19 4.89336176E-04 0.00000000E+00 1.95815412E-03 + 0.00000000E+00 7.44292501E-05 1.66754529E-19-3.72729483E-05-6.73834721E-20 + 4.89349560E-04 0.00000000E+00-2.39324912E-04 0.00000000E+00 5.12927099E-04 + 0.00000000E+00 7.42094428E-05-2.85146593E-19 4.00838103E-03 0.00000000E+00 + 4.89336176E-04 0.00000000E+00 5.94552003E-04-2.36379438E-18 7.44294899E-05 +-2.58606043E-19-2.76779198E-04 0.00000000E+00-3.69526962E-05 2.74449154E-20 + 5.39016708E-04 0.00000000E+00 2.15716390E-03 0.00000000E+00 7.40027329E-05 +-8.82205679E-21 2.96014925E-04-1.70626753E-19 5.39037271E-04 0.00000000E+00 +-2.62986962E-04 0.00000000E+00 7.40024971E-05-2.08657907E-20-3.70530442E-05 + 6.54360816E-20-3.69526962E-05-2.74449154E-20-2.76779198E-04 0.00000000E+00 + 7.40027329E-05 8.82205679E-21 2.96014925E-04 1.70626753E-19 5.39016708E-04 + 0.00000000E+00 2.15716390E-03 0.00000000E+00 7.40024971E-05 2.08657907E-20 +-3.70530442E-05-6.54360816E-20 5.39037271E-04 0.00000000E+00-2.62986962E-04 + 0.00000000E+00-2.62986962E-04 0.00000000E+00-3.70530442E-05 6.54360816E-20 + 5.12910576E-04 0.00000000E+00 2.05258097E-03 0.00000000E+00 7.42096798E-05 +-2.40878536E-19 2.96842840E-04-9.63050978E-19 5.12927099E-04 0.00000000E+00 +-2.50565819E-04 0.00000000E+00 7.42094428E-05-2.85146593E-19-3.71597332E-05 + 1.35938159E-19-3.70530442E-05-6.54360816E-20-2.62986962E-04 0.00000000E+00 + 7.42096798E-05 2.40878536E-19 2.96842840E-04 9.63050978E-19 5.12910576E-04 + 0.00000000E+00 2.05258097E-03 0.00000000E+00 7.42094428E-05 2.85146593E-19 +-3.71597332E-05-1.35938159E-19 5.12927099E-04 0.00000000E+00-2.50565819E-04 + 0.00000000E+00 7.40024971E-05 2.08657907E-20 5.39037271E-04 0.00000000E+00 + 5.92845084E-04 1.00559325E-18 7.42096798E-05 2.40878536E-19 4.20701092E-03 + 0.00000000E+00 5.12910576E-04 0.00000000E+00 5.39037271E-04 0.00000000E+00 + 7.40024971E-05-2.08657907E-20 4.20701092E-03 0.00000000E+00 5.12910576E-04 + 0.00000000E+00 5.92845084E-04-1.00559325E-18 7.42096798E-05-2.40878536E-19 + 2.52505826E-01 0.00000000E+00 1.44380768E-04-1.11464849E-18 1.01002561E-01 + 0.00000000E+00-2.52507036E-02 0.00000000E+00 7.21908598E-05-6.04225745E-19 +-3.60938437E-05 2.08311261E-19 7.21908598E-05 6.04225745E-19 1.01002561E-01 + 0.00000000E+00 5.77496419E-04 3.33299100E-18 7.21845152E-05 2.29019301E-19 + 2.02007605E-01 0.00000000E+00 2.53673071E-07 0.00000000E+00 1.01002561E-01 + 0.00000000E+00 7.21908598E-05-6.04225745E-19 2.02007605E-01 0.00000000E+00 + 2.53673071E-07 0.00000000E+00 5.77496419E-04-3.33299100E-18 7.21845152E-05 +-2.29019301E-19 1.44380768E-04 1.11464849E-18 2.52505826E-01 0.00000000E+00 + 7.21908598E-05 6.04225745E-19-3.60938437E-05-2.08311261E-19 1.01002561E-01 + 0.00000000E+00-2.52507036E-02 0.00000000E+00 7.21848291E-05 1.92005693E-19 + 9.43971392E-03 0.00000000E+00 5.77535624E-04 8.14182850E-19 7.21999873E-05 + 5.51035468E-20 5.47526269E-02 0.00000000E+00 4.72042869E-03 0.00000000E+00 +-2.52507036E-02 0.00000000E+00-3.60938437E-05 2.08311261E-19 2.53673071E-07 + 0.00000000E+00 4.34227697E-02 0.00000000E+00 7.21845152E-05-2.29019301E-19 + 2.88746182E-04-9.30265833E-19 9.43971392E-03 0.00000000E+00-3.54003565E-03 + 0.00000000E+00 7.21848291E-05-1.92005693E-19-3.60962041E-05 6.17773099E-20 +-3.60938437E-05-2.08311261E-19-2.52507036E-02 0.00000000E+00 7.21845152E-05 + 2.29019301E-19 2.88746182E-04 9.30265833E-19 2.53673071E-07 0.00000000E+00 + 4.34227697E-02 0.00000000E+00 7.21848291E-05 1.92005693E-19-3.60962041E-05 +-6.17773099E-20 9.43971392E-03 0.00000000E+00-3.54003565E-03 0.00000000E+00 + 9.43971392E-03 0.00000000E+00 7.21848291E-05-1.92005693E-19 5.47526269E-02 + 0.00000000E+00 4.72042869E-03 0.00000000E+00 5.77535624E-04-8.14182850E-19 + 7.21999873E-05-5.51035468E-20 7.21998374E-05 1.10659477E-19 4.93416001E-03 + 0.00000000E+00 5.77693717E-04 1.64036732E-18 7.22242578E-05 2.79151031E-19 + 3.25146790E-02 0.00000000E+00 3.29011431E-03 0.00000000E+00-3.54003565E-03 + 0.00000000E+00-3.60962041E-05 6.17773099E-20 4.72042869E-03 0.00000000E+00 + 2.04000208E-02 0.00000000E+00 7.21999873E-05-5.51035468E-20 2.88802971E-04 +-4.37747071E-19 4.93416001E-03 0.00000000E+00-2.05606858E-03 0.00000000E+00 + 7.21998374E-05-1.10659477E-19-3.61060238E-05 9.74526269E-20-3.60962041E-05 +-6.17773099E-20-3.54003565E-03 0.00000000E+00 7.21999873E-05 5.51035468E-20 + 2.88802971E-04 4.37747071E-19 4.72042869E-03 0.00000000E+00 2.04000208E-02 + 0.00000000E+00 7.21998374E-05 1.10659477E-19-3.61060238E-05-9.74526269E-20 + 4.93416001E-03 0.00000000E+00-2.05606858E-03 0.00000000E+00 4.93416001E-03 + 0.00000000E+00 7.21998374E-05-1.10659477E-19 3.25146790E-02 0.00000000E+00 + 3.29011431E-03 0.00000000E+00 5.77693717E-04-1.64036732E-18 7.22242578E-05 +-2.79151031E-19 7.22240354E-05 2.52104109E-19 3.32839305E-03 0.00000000E+00 + 5.77925427E-04 1.71412575E-18 7.22580148E-05 1.81266360E-19 2.31644755E-02 + 0.00000000E+00 2.49697619E-03 0.00000000E+00-2.05606858E-03 0.00000000E+00 +-3.61060238E-05 9.74526269E-20 3.29011431E-03 0.00000000E+00 1.35268909E-02 + 0.00000000E+00 7.22242578E-05-2.79151031E-19 2.88900003E-04-9.77664255E-19 + 3.32839305E-03 0.00000000E+00-1.45634231E-03 0.00000000E+00 7.22240354E-05 +-2.52104109E-19-3.61205126E-05 1.08342617E-19-3.61060238E-05-9.74526269E-20 +-2.05606858E-03 0.00000000E+00 7.22242578E-05 2.79151031E-19 2.88900003E-04 + 9.77664255E-19 3.29011431E-03 0.00000000E+00 1.35268909E-02 0.00000000E+00 + 7.22240354E-05 2.52104109E-19-3.61205126E-05-1.08342617E-19 3.32839305E-03 + 0.00000000E+00-1.45634231E-03 0.00000000E+00 3.32839305E-03 0.00000000E+00 + 7.22240354E-05-2.52104109E-19 2.31644755E-02 0.00000000E+00 2.49697619E-03 + 0.00000000E+00 5.77925427E-04-1.71412575E-18 7.22580148E-05-1.81266360E-19 + 7.22577994E-05 1.92214225E-19 2.50870136E-03 0.00000000E+00 5.78234767E-04 + 1.55462165E-18 7.23015919E-05 1.93065849E-19 1.80014525E-02 0.00000000E+00 + 2.00766466E-03 0.00000000E+00-1.45634231E-03 0.00000000E+00-3.61205126E-05 + 1.08342617E-19 2.49697619E-03 0.00000000E+00 1.01293045E-02 0.00000000E+00 + 7.22580148E-05-1.81266360E-19 2.89035132E-04-7.72819711E-19 2.50870136E-03 + 0.00000000E+00-1.12909150E-03 0.00000000E+00 7.22577994E-05-1.92214225E-19 +-3.61398478E-05 9.63200184E-20-3.61205126E-05-1.08342617E-19-1.45634231E-03 + 0.00000000E+00 7.22580148E-05 1.81266360E-19 2.89035132E-04 7.72819711E-19 + 2.49697619E-03 0.00000000E+00 1.01293045E-02 0.00000000E+00 7.22577994E-05 + 1.92214225E-19-3.61398478E-05-9.63200184E-20 2.50870136E-03 0.00000000E+00 +-1.12909150E-03 0.00000000E+00 2.50870136E-03 0.00000000E+00 7.22577994E-05 +-1.92214225E-19 1.80014525E-02 0.00000000E+00 2.00766466E-03 0.00000000E+00 + 5.78234767E-04-1.55462165E-18 7.23015919E-05-1.93065849E-19 7.23013690E-05 + 1.80471453E-19 2.01239456E-03 0.00000000E+00 5.78622637E-04 1.49071301E-18 + 7.23549998E-05 2.01852945E-19 1.47254906E-02 0.00000000E+00 1.67771234E-03 + 0.00000000E+00-1.12909150E-03 0.00000000E+00-3.61398478E-05 9.63200184E-20 + 2.00766466E-03 0.00000000E+00 8.09952173E-03 0.00000000E+00 7.23015919E-05 +-1.93065849E-19 2.89209436E-04-7.54041549E-19 2.01239456E-03 0.00000000E+00 +-9.22526724E-04 0.00000000E+00 7.23013690E-05-1.80471453E-19-3.61640922E-05 + 9.55810994E-20-3.61398478E-05-9.63200184E-20-1.12909150E-03 0.00000000E+00 + 7.23015919E-05 1.93065849E-19 2.89209436E-04 7.54041549E-19 2.00766466E-03 + 0.00000000E+00 8.09952173E-03 0.00000000E+00 7.23013690E-05 1.80471453E-19 +-3.61640922E-05-9.55810994E-20 2.01239456E-03 0.00000000E+00-9.22526724E-04 + 0.00000000E+00 2.01239456E-03 0.00000000E+00 7.23013690E-05-1.80471453E-19 + 1.47254906E-02 0.00000000E+00 1.67771234E-03 0.00000000E+00 5.78622637E-04 +-1.49071301E-18 7.23549998E-05-2.01852945E-19 7.23547916E-05 2.15314754E-19 + 1.67997372E-03 0.00000000E+00 5.79089697E-04 2.01231867E-18 7.24183382E-05 + 2.83129479E-19 1.24615926E-02 0.00000000E+00 1.44070505E-03 0.00000000E+00 +-9.22526724E-04 0.00000000E+00-3.61640922E-05 9.55810994E-20 1.67771234E-03 + 0.00000000E+00 6.74944581E-03 0.00000000E+00 7.23549998E-05-2.01852945E-19 + 2.89423124E-04-8.51336740E-19 1.67997372E-03 0.00000000E+00-7.80169692E-04 + 0.00000000E+00 7.23547916E-05-2.15314754E-19-3.61932824E-05 1.24611058E-19 +-3.61640922E-05-9.55810994E-20-9.22526724E-04 0.00000000E+00 7.23549998E-05 + 2.01852945E-19 2.89423124E-04 8.51336740E-19 1.67771234E-03 0.00000000E+00 + 6.74944581E-03 0.00000000E+00 7.23547916E-05 2.15314754E-19-3.61932824E-05 +-1.24611058E-19 1.67997372E-03 0.00000000E+00-7.80169692E-04 0.00000000E+00 + 1.67997372E-03 0.00000000E+00 7.23547916E-05-2.15314754E-19 1.24615926E-02 + 0.00000000E+00 1.44070505E-03 0.00000000E+00 5.79089697E-04-2.01231867E-18 + 7.24183382E-05-2.83129479E-19 7.24181029E-05 2.71573524E-19 1.44191797E-03 + 0.00000000E+00 5.79636262E-04 2.49541719E-18 7.24916925E-05 3.56645168E-19 + 1.08035988E-02 0.00000000E+00 1.26241515E-03 0.00000000E+00-7.80169692E-04 + 0.00000000E+00-3.61932824E-05 1.24611058E-19 1.44070505E-03 0.00000000E+00 + 5.78659005E-03 0.00000000E+00 7.24183382E-05-2.83129479E-19 2.89676469E-04 +-1.11602926E-18 1.44191797E-03 0.00000000E+00-6.76083280E-04 0.00000000E+00 + 7.24181029E-05-2.71573524E-19-3.62274489E-05 1.57054673E-19-3.61932824E-05 +-1.24611058E-19-7.80169692E-04 0.00000000E+00 7.24183382E-05 2.83129479E-19 + 2.89676469E-04 1.11602926E-18 1.44070505E-03 0.00000000E+00 5.78659005E-03 + 0.00000000E+00 7.24181029E-05 2.71573524E-19-3.62274489E-05-1.57054673E-19 + 1.44191797E-03 0.00000000E+00-6.76083280E-04 0.00000000E+00 1.44191797E-03 + 0.00000000E+00 7.24181029E-05-2.71573524E-19 1.08035988E-02 0.00000000E+00 + 1.26241515E-03 0.00000000E+00 5.79636262E-04-2.49541719E-18 7.24916925E-05 +-3.56645168E-19-6.76083280E-04 0.00000000E+00-3.62274489E-05 1.57054673E-19 + 1.26241515E-03 0.00000000E+00 5.06532646E-03 0.00000000E+00 7.24916925E-05 +-3.56645168E-19 2.89969984E-04-1.40162493E-18 1.26312319E-03 0.00000000E+00 +-5.96661025E-04 0.00000000E+00 7.24914920E-05-3.91478435E-19-3.62666740E-05 + 1.51602465E-19 7.24914920E-05 3.91478435E-19 1.26312319E-03 0.00000000E+00 + 5.80263915E-04 2.54809016E-18 7.25752041E-05 2.14931424E-19 9.53715082E-03 + 0.00000000E+00 1.12352091E-03 0.00000000E+00 1.26312319E-03 0.00000000E+00 + 7.24914920E-05-3.91478435E-19 9.53715082E-03 0.00000000E+00 1.12352091E-03 + 0.00000000E+00 5.80263915E-04-2.54809016E-18 7.25752041E-05-2.14931424E-19 +-3.62274489E-05-1.57054673E-19-6.76083280E-04 0.00000000E+00 7.24916925E-05 + 3.56645168E-19 2.89969984E-04 1.40162493E-18 1.26241515E-03 0.00000000E+00 + 5.06532646E-03 0.00000000E+00 7.24914920E-05 3.91478435E-19-3.62666740E-05 +-1.51602465E-19 1.26312319E-03 0.00000000E+00-5.96661025E-04 0.00000000E+00 + 7.25749664E-05 1.57829273E-19 1.12396061E-03 0.00000000E+00 5.80972596E-04 + 9.27277926E-19 7.26689274E-05 1.08985416E-19 8.53835985E-03 0.00000000E+00 + 1.01231648E-03 0.00000000E+00-5.96661025E-04 0.00000000E+00-3.62666740E-05 + 1.51602465E-19 1.12352091E-03 0.00000000E+00 4.50494786E-03 0.00000000E+00 + 7.25752041E-05-2.14931424E-19 2.90304001E-04-7.91257512E-19 1.12396061E-03 + 0.00000000E+00-5.34069271E-04 0.00000000E+00 7.25749664E-05-1.57829273E-19 +-3.63109735E-05 6.67036722E-20-3.62666740E-05-1.51602465E-19-5.96661025E-04 + 0.00000000E+00 7.25752041E-05 2.14931424E-19 2.90304001E-04 7.91257512E-19 + 1.12352091E-03 0.00000000E+00 4.50494786E-03 0.00000000E+00 7.25749664E-05 + 1.57829273E-19-3.63109735E-05-6.67036722E-20 1.12396061E-03 0.00000000E+00 +-5.34069271E-04 0.00000000E+00 1.12396061E-03 0.00000000E+00 7.25749664E-05 +-1.57829273E-19 8.53835985E-03 0.00000000E+00 1.01231648E-03 0.00000000E+00 + 5.80972596E-04-9.27277926E-19 7.26689274E-05-1.08985416E-19-5.34069271E-04 + 0.00000000E+00-3.63109735E-05 6.67036722E-20 1.01231648E-03 0.00000000E+00 + 4.05710802E-03 0.00000000E+00 7.26689274E-05-1.08985416E-19 2.90679001E-04 +-5.58320476E-19 1.01260399E-03 0.00000000E+00-4.83478011E-04 0.00000000E+00 + 7.26687164E-05-1.44702286E-19-3.63604477E-05 9.51964654E-20-3.63109735E-05 +-6.67036722E-20-5.34069271E-04 0.00000000E+00 7.26689274E-05 1.08985416E-19 + 2.90679001E-04 5.58320476E-19 1.01231648E-03 0.00000000E+00 4.05710802E-03 + 0.00000000E+00 7.26687164E-05 1.44702286E-19-3.63604477E-05-9.51964654E-20 + 1.01260399E-03 0.00000000E+00-4.83478011E-04 0.00000000E+00 7.26687164E-05 + 1.44702286E-19 1.01260399E-03 0.00000000E+00 5.81764191E-04 1.56241573E-18 + 7.27730743E-05 2.36083575E-19 7.73065242E-03 0.00000000E+00 9.21308052E-04 + 0.00000000E+00 1.01260399E-03 0.00000000E+00 7.26687164E-05-1.44702286E-19 + 7.73065242E-03 0.00000000E+00 9.21308052E-04 0.00000000E+00 5.81764191E-04 +-1.56241573E-18 7.27730743E-05-2.36083575E-19-4.83478011E-04 0.00000000E+00 +-3.63604477E-05 9.51964654E-20 9.21308052E-04 0.00000000E+00 3.69107618E-03 + 0.00000000E+00 7.27730743E-05-2.36083575E-19 2.91095602E-04-8.89589313E-19 + 9.21503391E-04 0.00000000E+00-4.41745080E-04 0.00000000E+00 7.27728463E-05 +-2.32139380E-19-3.64151453E-05 1.06368428E-19 7.27728463E-05 2.32139380E-19 + 9.21503391E-04 0.00000000E+00 5.82639281E-04 1.70368713E-18 7.28877347E-05 + 1.93334334E-19 7.06411950E-03 0.00000000E+00 8.45476931E-04 0.00000000E+00 + 9.21503391E-04 0.00000000E+00 7.27728463E-05-2.32139380E-19 7.06411950E-03 + 0.00000000E+00 8.45476931E-04 0.00000000E+00 5.82639281E-04-1.70368713E-18 + 7.28877347E-05-1.93334334E-19-3.63604477E-05-9.51964654E-20-4.83478011E-04 + 0.00000000E+00 7.27730743E-05 2.36083575E-19 2.91095602E-04 8.89589313E-19 + 9.21308052E-04 0.00000000E+00 3.69107618E-03 0.00000000E+00 7.27728463E-05 + 2.32139380E-19-3.64151453E-05-1.06368428E-19 9.21503391E-04 0.00000000E+00 +-4.41745080E-04 0.00000000E+00 7.28875110E-05 1.84190981E-19 8.45614190E-04 + 0.00000000E+00 5.83599508E-04 2.03664784E-18 7.30131388E-05 3.28617652E-19 + 6.50485425E-03 0.00000000E+00 7.81339357E-04 0.00000000E+00-4.41745080E-04 + 0.00000000E+00-3.64151453E-05 1.06368428E-19 8.45476931E-04 0.00000000E+00 + 3.38637919E-03 0.00000000E+00 7.28877347E-05-1.93334334E-19 2.91554327E-04 +-8.19125309E-19 8.45614190E-04 0.00000000E+00-4.06738387E-04 0.00000000E+00 + 7.28875110E-05-1.84190981E-19-3.64751625E-05 1.28202158E-19-3.64151453E-05 +-1.06368428E-19-4.41745080E-04 0.00000000E+00 7.28877347E-05 1.93334334E-19 + 2.91554327E-04 8.19125309E-19 8.45476931E-04 0.00000000E+00 3.38637919E-03 + 0.00000000E+00 7.28875110E-05 1.84190981E-19-3.64751625E-05-1.28202158E-19 + 8.45614190E-04 0.00000000E+00-4.06738387E-04 0.00000000E+00 8.45614190E-04 + 0.00000000E+00 7.28875110E-05-1.84190981E-19 6.50485425E-03 0.00000000E+00 + 7.81339357E-04 0.00000000E+00 5.83599508E-04-2.03664784E-18 7.30131388E-05 +-3.28617652E-19-4.06738387E-04 0.00000000E+00-3.64751625E-05 1.28202158E-19 + 7.81339357E-04 0.00000000E+00 3.12885444E-03 0.00000000E+00 7.30131388E-05 +-3.28617652E-19 2.92055999E-04-1.24460224E-18 7.81438457E-04 0.00000000E+00 +-3.76959722E-04 0.00000000E+00 7.30129146E-05-3.46541010E-19-3.65405886E-05 + 1.32785705E-19-3.64751625E-05-1.28202158E-19-4.06738387E-04 0.00000000E+00 + 7.30131388E-05 3.28617652E-19 2.92055999E-04 1.24460224E-18 7.81339357E-04 + 0.00000000E+00 3.12885444E-03 0.00000000E+00 7.30129146E-05 3.46541010E-19 +-3.65405886E-05-1.32785705E-19 7.81438457E-04 0.00000000E+00-3.76959722E-04 + 0.00000000E+00 7.30129146E-05 3.46541010E-19 7.81438457E-04 0.00000000E+00 + 5.84646274E-04 2.18002859E-18 7.31494398E-05 1.84601809E-19 6.02900608E-03 + 0.00000000E+00 7.26400430E-04 0.00000000E+00 7.81438457E-04 0.00000000E+00 + 7.30129146E-05-3.46541010E-19 6.02900608E-03 0.00000000E+00 7.26400430E-04 + 0.00000000E+00 5.84646274E-04-2.18002859E-18 7.31494398E-05-1.84601809E-19 +-3.76959722E-04 0.00000000E+00-3.65405886E-05 1.32785705E-19 7.26400430E-04 + 0.00000000E+00 2.90838824E-03 0.00000000E+00 7.31494398E-05-1.84601809E-19 + 2.92601278E-04-7.63089717E-19 7.26473614E-04 0.00000000E+00-3.51325435E-04 + 0.00000000E+00 7.31492119E-05-1.63856052E-19-3.66115196E-05 9.06397343E-20 + 7.31492119E-05 1.63856052E-19 7.26473614E-04 0.00000000E+00 5.85781103E-04 + 1.39773764E-18 7.32968666E-05 1.98702885E-19 5.61931079E-03 0.00000000E+00 + 6.78828125E-04 0.00000000E+00 7.26473614E-04 0.00000000E+00 7.31492119E-05 +-1.63856052E-19 5.61931079E-03 0.00000000E+00 6.78828125E-04 0.00000000E+00 + 5.85781103E-04-1.39773764E-18 7.32968666E-05-1.98702885E-19-3.65405886E-05 +-1.32785705E-19-3.76959722E-04 0.00000000E+00 7.31494398E-05 1.84601809E-19 + 2.92601278E-04 7.63089717E-19 7.26400430E-04 0.00000000E+00 2.90838824E-03 + 0.00000000E+00 7.31492119E-05 1.63856052E-19-3.66115196E-05-9.06397343E-20 + 7.26473614E-04 0.00000000E+00-3.51325435E-04 0.00000000E+00 7.32966382E-05 + 2.06550202E-19 6.78883259E-04 0.00000000E+00 5.87005832E-04 1.72765771E-18 + 7.34556401E-05 2.26930845E-19 5.26296537E-03 0.00000000E+00 6.37246200E-04 + 0.00000000E+00-3.51325435E-04 0.00000000E+00-3.66115196E-05 9.06397343E-20 + 6.78828125E-04 0.00000000E+00 2.71756861E-03 0.00000000E+00 7.32968666E-05 +-1.98702885E-19 2.93191063E-04-8.08022071E-19 6.78883259E-04 0.00000000E+00 +-3.29032365E-04 0.00000000E+00 7.32966382E-05-2.06550202E-19-3.66880696E-05 + 1.08370262E-19-3.66115196E-05-9.06397343E-20-3.51325435E-04 0.00000000E+00 + 7.32968666E-05 1.98702885E-19 2.93191063E-04 8.08022071E-19 6.78828125E-04 + 0.00000000E+00 2.71756861E-03 0.00000000E+00 7.32966382E-05 2.06550202E-19 +-3.66880696E-05-1.08370262E-19 6.78883259E-04 0.00000000E+00-3.29032365E-04 + 0.00000000E+00 6.78883259E-04 0.00000000E+00 7.32966382E-05-2.06550202E-19 + 5.26296537E-03 0.00000000E+00 6.37246200E-04 0.00000000E+00 5.87005832E-04 +-1.72765771E-18 7.34556401E-05-2.26930845E-19-3.29032365E-04 0.00000000E+00 +-3.66880696E-05 1.08370262E-19 6.37246200E-04 0.00000000E+00 2.55083722E-03 + 0.00000000E+00 7.34556401E-05-2.26930845E-19 2.93826253E-04-9.39821608E-19 + 6.37288447E-04 0.00000000E+00-3.09472527E-04 0.00000000E+00 7.34554112E-05 +-2.36090296E-19-3.67703614E-05 1.34558776E-19-3.66880696E-05-1.08370262E-19 +-3.29032365E-04 0.00000000E+00 7.34556401E-05 2.26930845E-19 2.93826253E-04 + 9.39821608E-19 6.37246200E-04 0.00000000E+00 2.55083722E-03 0.00000000E+00 + 7.34554112E-05 2.36090296E-19-3.67703614E-05-1.34558776E-19 6.37288447E-04 + 0.00000000E+00-3.09472527E-04 0.00000000E+00 7.34554112E-05 2.36090296E-19 + 6.37288447E-04 0.00000000E+00 5.88322431E-04 2.19400249E-18 7.36260344E-05 + 3.02144806E-19 4.95027334E-03 0.00000000E+00 6.00601663E-04 0.00000000E+00 + 6.37288447E-04 0.00000000E+00 7.34554112E-05-2.36090296E-19 4.95027334E-03 + 0.00000000E+00 6.00601663E-04 0.00000000E+00 5.88322431E-04-2.19400249E-18 + 7.36260344E-05-3.02144806E-19-3.09472527E-04 0.00000000E+00-3.67703614E-05 + 1.34558776E-19 6.00601663E-04 0.00000000E+00 2.40394604E-03 0.00000000E+00 + 7.36260344E-05-3.02144806E-19 2.94507909E-04-1.11868878E-18 6.00634481E-04 + 0.00000000E+00-2.92177181E-04 0.00000000E+00 7.36258017E-05-2.99382734E-19 +-3.68585216E-05 1.05757241E-19 7.36258017E-05 2.99382734E-19 6.00634481E-04 + 0.00000000E+00 5.89732908E-04 1.73149361E-18 7.38082848E-05 1.23646230E-19 + 4.67375581E-03 0.00000000E+00 5.68074243E-04 0.00000000E+00 6.00634481E-04 + 0.00000000E+00 7.36258017E-05-2.99382734E-19 4.67375581E-03 0.00000000E+00 + 5.68074243E-04 0.00000000E+00 5.89732908E-04-1.73149361E-18 7.38082848E-05 +-1.23646230E-19-3.67703614E-05-1.34558776E-19-3.09472527E-04 0.00000000E+00 + 7.36260344E-05 3.02144806E-19 2.94507909E-04 1.11868878E-18 6.00601663E-04 + 0.00000000E+00 2.40394604E-03 0.00000000E+00 7.36258017E-05 2.99382734E-19 +-3.68585216E-05-1.05757241E-19 6.00634481E-04 0.00000000E+00-2.92177181E-04 + 0.00000000E+00 7.38080520E-05 1.00957605E-19 5.68100086E-04 0.00000000E+00 + 5.91239613E-04 3.46836424E-19 7.40027329E-05 8.82205679E-21 4.42755351E-03 + 0.00000000E+00 5.39016708E-04 0.00000000E+00-2.92177181E-04 0.00000000E+00 +-3.68585216E-05 1.05757241E-19 5.68074243E-04 0.00000000E+00 2.27359037E-03 + 0.00000000E+00 7.38082848E-05-1.23646230E-19 2.95237030E-04-4.79358099E-19 + 5.68100086E-04 0.00000000E+00-2.76779198E-04 0.00000000E+00 7.38080520E-05 +-1.00957605E-19-3.69526962E-05 2.74449154E-20-3.68585216E-05-1.05757241E-19 +-2.92177181E-04 0.00000000E+00 7.38082848E-05 1.23646230E-19 2.95237030E-04 + 4.79358099E-19 5.68074243E-04 0.00000000E+00 2.27359037E-03 0.00000000E+00 + 7.38080520E-05 1.00957605E-19-3.69526962E-05-2.74449154E-20 5.68100086E-04 + 0.00000000E+00-2.76779198E-04 0.00000000E+00 5.68100086E-04 0.00000000E+00 + 7.38080520E-05-1.00957605E-19 4.42755351E-03 0.00000000E+00 5.39016708E-04 + 0.00000000E+00 5.91239613E-04-3.46836424E-19 7.40027329E-05-8.82205679E-21 + 2.14691448E-04 0.00000000E+00 6.06593275E-05-2.11915552E-19 1.70326147E-03 + 0.00000000E+00 2.11129320E-04 0.00000000E+00 4.86530401E-04-1.45145463E-18 + 6.09723509E-05-1.44803072E-19-3.04079196E-05-8.91796561E-20-1.06455192E-04 + 0.00000000E+00 6.09723509E-05 1.44803072E-19 1.21865303E-04 3.01782260E-19 + 2.11129320E-04 0.00000000E+00 4.23151561E-04 0.00000000E+00 6.06593275E-05 + 2.11915552E-19 2.14691448E-04 0.00000000E+00 4.86530401E-04 1.45145463E-18 + 6.09723509E-05 1.44803072E-19 1.70326147E-03 0.00000000E+00 2.11129320E-04 + 0.00000000E+00-1.06455192E-04 0.00000000E+00-3.04079196E-05 8.91796561E-20 + 2.11129320E-04 0.00000000E+00 4.23151561E-04 0.00000000E+00 6.09723509E-05 +-1.44803072E-19 1.21865303E-04-3.01782260E-19-3.02528068E-05-1.02223430E-19 +-1.08272646E-04 0.00000000E+00 6.06574152E-05 2.10888680E-19 2.42636849E-04 + 8.17041259E-19 2.14684023E-04 0.00000000E+00 8.58808235E-04 0.00000000E+00 + 6.06593275E-05 2.11915552E-19-3.04079196E-05-8.91796561E-20 2.14691448E-04 + 0.00000000E+00-1.06455192E-04 0.00000000E+00 2.18406560E-04 0.00000000E+00 + 6.03538119E-05-1.98005039E-19 1.73230242E-03 0.00000000E+00 2.14684023E-04 + 0.00000000E+00 4.84038793E-04-1.65072057E-18 6.06574152E-05-2.10888680E-19 +-1.08272646E-04 0.00000000E+00-3.02528068E-05 1.02223430E-19 2.14684023E-04 + 0.00000000E+00 8.58808235E-04 0.00000000E+00 6.06574152E-05-2.10888680E-19 + 2.42636849E-04-8.17041259E-19 2.14691448E-04 0.00000000E+00-1.06455192E-04 + 0.00000000E+00 6.06593275E-05-2.11915552E-19-3.04079196E-05 8.91796561E-20 + 6.03538119E-05 1.98005039E-19 2.18406560E-04 0.00000000E+00 4.84038793E-04 + 1.65072057E-18 6.06574152E-05 2.10888680E-19 1.73230242E-03 0.00000000E+00 + 2.14684023E-04 0.00000000E+00 7.96272581E-05 2.59421630E-19 2.96926596E-04 + 0.00000000E+00 6.39039784E-04 2.00885375E-18 8.01341282E-05 2.50716854E-19 + 2.34749116E-03 0.00000000E+00 2.89975775E-04 0.00000000E+00-1.46725593E-04 + 0.00000000E+00-3.99403466E-05 1.27534621E-19 2.89975775E-04 0.00000000E+00 + 1.01760462E-03 0.00000000E+00 8.01341282E-05-2.50716854E-19 2.80927199E-04 +-9.08863458E-19 2.18406560E-04 0.00000000E+00-1.08272646E-04 0.00000000E+00 + 6.03538119E-05-1.98005039E-19-3.02528068E-05 1.02223430E-19-3.99403466E-05 +-1.27534621E-19-1.46725593E-04 0.00000000E+00 8.01341282E-05 2.50716854E-19 + 2.80927199E-04 9.08863458E-19 2.89975775E-04 0.00000000E+00 1.01760462E-03 + 0.00000000E+00 6.03538119E-05 1.98005039E-19-3.02528068E-05-1.02223430E-19 + 2.18406560E-04 0.00000000E+00-1.08272646E-04 0.00000000E+00 2.96926596E-04 + 0.00000000E+00 7.96272581E-05-2.59421630E-19 2.34749116E-03 0.00000000E+00 + 2.89975775E-04 0.00000000E+00 6.39039784E-04-2.00885375E-18 8.01341282E-05 +-2.50716854E-19 7.91435571E-05 2.54346782E-19 3.04320363E-04 0.00000000E+00 + 6.35075183E-04 2.13773822E-18 7.96270880E-05 2.73159155E-19 2.40484179E-03 + 0.00000000E+00 2.96924047E-04 0.00000000E+00-1.50311103E-04 0.00000000E+00 +-3.96926613E-05 1.31876484E-19 2.96924047E-04 0.00000000E+00 1.18786032E-03 + 0.00000000E+00 7.96270880E-05-2.73159155E-19 3.18517009E-04-1.05524314E-18 + 2.96926596E-04 0.00000000E+00-1.46725593E-04 0.00000000E+00 7.96272581E-05 +-2.59421630E-19-3.99403466E-05 1.27534621E-19-3.96926613E-05-1.31876484E-19 +-1.50311103E-04 0.00000000E+00 7.96270880E-05 2.73159155E-19 3.18517009E-04 + 1.05524314E-18 2.96924047E-04 0.00000000E+00 1.18786032E-03 0.00000000E+00 + 7.96272581E-05 2.59421630E-19-3.99403466E-05-1.27534621E-19 2.96926596E-04 + 0.00000000E+00-1.46725593E-04 0.00000000E+00 3.04320363E-04 0.00000000E+00 + 7.91435571E-05-2.54346782E-19 2.40484179E-03 0.00000000E+00 2.96924047E-04 + 0.00000000E+00 6.35075183E-04-2.13773822E-18 7.96270880E-05-2.73159155E-19 + 7.86844880E-05 2.51702607E-19 3.12206384E-04 0.00000000E+00 6.31307374E-04 + 1.94264770E-18 7.91439743E-05 2.42481483E-19 2.46596012E-03 0.00000000E+00 + 3.04319873E-04 0.00000000E+00-1.54131564E-04 0.00000000E+00-3.94571156E-05 + 1.23546023E-19 3.04319873E-04 0.00000000E+00 1.21745555E-03 0.00000000E+00 + 7.91439743E-05-2.42481483E-19 3.16583654E-04-1.00349649E-18 3.04320363E-04 + 0.00000000E+00-1.50311103E-04 0.00000000E+00 7.91435571E-05-2.54346782E-19 +-3.96926613E-05 1.31876484E-19-3.94571156E-05-1.23546023E-19-1.54131564E-04 + 0.00000000E+00 7.91439743E-05 2.42481483E-19 3.16583654E-04 1.00349649E-18 + 3.04319873E-04 0.00000000E+00 1.21745555E-03 0.00000000E+00 7.91435571E-05 + 2.54346782E-19-3.96926613E-05-1.31876484E-19 3.04320363E-04 0.00000000E+00 +-1.50311103E-04 0.00000000E+00 3.12206384E-04 0.00000000E+00 7.86844880E-05 +-2.51702607E-19 2.46596012E-03 0.00000000E+00 3.04319873E-04 0.00000000E+00 + 6.31307374E-04-1.94264770E-18 7.91439743E-05-2.42481483E-19 7.82476655E-05 + 3.58714096E-19 3.20621826E-04 0.00000000E+00 6.27723377E-04 2.48099194E-18 + 7.86847495E-05 2.57655201E-19 2.53114956E-03 0.00000000E+00 3.12205094E-04 + 0.00000000E+00-1.58206730E-04 0.00000000E+00-3.92331038E-05 1.54092324E-19 + 3.12205094E-04 0.00000000E+00 1.24901231E-03 0.00000000E+00 7.86847495E-05 +-2.57655201E-19 3.14746475E-04-1.05101002E-18 3.12206384E-04 0.00000000E+00 +-1.54131564E-04 0.00000000E+00 7.86844880E-05-2.51702607E-19-3.94571156E-05 + 1.23546023E-19-3.92331038E-05-1.54092324E-19-1.58206730E-04 0.00000000E+00 + 7.86847495E-05 2.57655201E-19 3.14746475E-04 1.05101002E-18 3.12205094E-04 + 0.00000000E+00 1.24901231E-03 0.00000000E+00 7.86844880E-05 2.51702607E-19 +-3.94571156E-05-1.23546023E-19 3.12206384E-04 0.00000000E+00-1.54131564E-04 + 0.00000000E+00 3.20621826E-04 0.00000000E+00 7.82476655E-05-3.58714096E-19 + 2.53114956E-03 0.00000000E+00 3.12205094E-04 0.00000000E+00 6.27723377E-04 +-2.48099194E-18 7.86847495E-05-2.57655201E-19 7.78322240E-05 2.08933904E-19 + 3.29614774E-04 0.00000000E+00 6.24314774E-04 2.38290838E-18 7.82479558E-05 + 3.70549476E-19 2.60076848E-03 0.00000000E+00 3.20620423E-04 0.00000000E+00 +-1.62558799E-04 0.00000000E+00-3.90200449E-05 1.44870845E-19 3.20620423E-04 + 0.00000000E+00 1.28269079E-03 0.00000000E+00 7.82479558E-05-3.70549476E-19 + 3.12998870E-04-1.36681858E-18 3.20621826E-04 0.00000000E+00-1.58206730E-04 + 0.00000000E+00 7.82476655E-05-3.58714096E-19-3.92331038E-05 1.54092324E-19 +-3.90200449E-05-1.44870845E-19-1.62558799E-04 0.00000000E+00 7.82479558E-05 + 3.70549476E-19 3.12998870E-04 1.36681858E-18 3.20620423E-04 0.00000000E+00 + 1.28269079E-03 0.00000000E+00 7.82476655E-05 3.58714096E-19-3.92331038E-05 +-1.54092324E-19 3.20621826E-04 0.00000000E+00-1.58206730E-04 0.00000000E+00 + 3.29614774E-04 0.00000000E+00 7.78322240E-05-2.08933904E-19 2.60076848E-03 + 0.00000000E+00 3.20620423E-04 0.00000000E+00 6.24314774E-04-2.38290838E-18 + 7.82479558E-05-3.70549476E-19 7.74370958E-05 1.12123942E-19 3.39238444E-04 + 0.00000000E+00 6.21072714E-04 1.02612150E-18 7.78325003E-05 1.76745171E-19 + 2.67521734E-03 0.00000000E+00 3.29613039E-04 0.00000000E+00-1.67212871E-04 + 0.00000000E+00-3.88173990E-05 7.22172781E-20 3.29613039E-04 0.00000000E+00 + 1.31868100E-03 0.00000000E+00 7.78325003E-05-1.76745171E-19 3.11336709E-04 +-8.06254492E-19 3.29614774E-04 0.00000000E+00-1.62558799E-04 0.00000000E+00 + 7.78322240E-05-2.08933904E-19-3.90200449E-05 1.44870845E-19-3.88173990E-05 +-7.22172781E-20-1.67212871E-04 0.00000000E+00 7.78325003E-05 1.76745171E-19 + 3.11336709E-04 8.06254492E-19 3.29613039E-04 0.00000000E+00 1.31868100E-03 + 0.00000000E+00 7.78322240E-05 2.08933904E-19-3.90200449E-05-1.44870845E-19 + 3.29614774E-04 0.00000000E+00-1.62558799E-04 0.00000000E+00 3.39238444E-04 + 0.00000000E+00 7.74370958E-05-1.12123942E-19 2.67521734E-03 0.00000000E+00 + 3.29613039E-04 0.00000000E+00 6.21072714E-04-1.02612150E-18 7.78325003E-05 +-1.76745171E-19-1.72197455E-04 0.00000000E+00-3.86246740E-05 1.55625796E-19 + 3.39236367E-04 0.00000000E+00 1.35719665E-03 0.00000000E+00 7.74373684E-05 +-1.51479002E-19 3.09755846E-04-6.56074923E-19 3.39238444E-04 0.00000000E+00 +-1.67212871E-04 0.00000000E+00 7.74370958E-05-1.12123942E-19-3.88173990E-05 + 7.22172781E-20 7.70613276E-05 4.71024180E-19 3.49553453E-04 0.00000000E+00 + 6.17989374E-04 2.60308139E-18 7.74373684E-05 1.51479002E-19 2.75495220E-03 + 0.00000000E+00 3.39236367E-04 0.00000000E+00 3.49553453E-04 0.00000000E+00 + 7.70613276E-05-4.71024180E-19 2.75495220E-03 0.00000000E+00 3.39236367E-04 + 0.00000000E+00 6.17989374E-04-2.60308139E-18 7.74373684E-05-1.51479002E-19 +-3.86246740E-05-1.55625796E-19-1.72197455E-04 0.00000000E+00 7.74373684E-05 + 1.51479002E-19 3.09755846E-04 6.56074923E-19 3.39236367E-04 0.00000000E+00 + 1.35719665E-03 0.00000000E+00 7.74370958E-05 1.12123942E-19-3.88173990E-05 +-7.22172781E-20 3.39238444E-04 0.00000000E+00-1.67212871E-04 0.00000000E+00 + 7.67040762E-05 5.80547583E-20 3.60629146E-04 0.00000000E+00 6.15057503E-04 + 1.89609337E-18 7.70615940E-05 4.33841430E-19 2.84049214E-03 0.00000000E+00 + 3.49550957E-04 0.00000000E+00-1.77545026E-04 0.00000000E+00-3.84414176E-05 + 1.22974047E-19 3.49550957E-04 0.00000000E+00 1.39848064E-03 0.00000000E+00 + 7.70615940E-05-4.33841430E-19 3.08252460E-04-1.57547897E-18 3.49553453E-04 + 0.00000000E+00-1.72197455E-04 0.00000000E+00 7.70613276E-05-4.71024180E-19 +-3.86246740E-05 1.55625796E-19-3.84414176E-05-1.22974047E-19-1.77545026E-04 + 0.00000000E+00 7.70615940E-05 4.33841430E-19 3.08252460E-04 1.57547897E-18 + 3.49550957E-04 0.00000000E+00 1.39848064E-03 0.00000000E+00 7.70613276E-05 + 4.71024180E-19-3.86246740E-05-1.55625796E-19 3.49553453E-04 0.00000000E+00 +-1.72197455E-04 0.00000000E+00 3.60629146E-04 0.00000000E+00 7.67040762E-05 +-5.80547583E-20 2.84049214E-03 0.00000000E+00 3.49550957E-04 0.00000000E+00 + 6.15057503E-04-1.89609337E-18 7.70615940E-05-4.33841430E-19-1.83292753E-04 + 0.00000000E+00-3.82672213E-05 1.27081310E-19 3.60626165E-04 0.00000000E+00 + 1.44281079E-03 0.00000000E+00 7.67043391E-05-8.48884992E-20 3.06823162E-04 +-5.29741474E-19 3.60629146E-04 0.00000000E+00-1.77545026E-04 0.00000000E+00 + 7.67040762E-05-5.80547583E-20-3.84414176E-05 1.22974047E-19-3.82672213E-05 +-1.27081310E-19-1.83292753E-04 0.00000000E+00 7.67043391E-05 8.48884992E-20 + 3.06823162E-04 5.29741474E-19 3.60626165E-04 0.00000000E+00 1.44281079E-03 + 0.00000000E+00 7.67040762E-05 5.80547583E-20-3.84414176E-05-1.22974047E-19 + 3.60629146E-04 0.00000000E+00-1.77545026E-04 0.00000000E+00 7.63645460E-05 + 4.23436741E-19 3.72544847E-04 0.00000000E+00 6.12270583E-04 2.03875790E-18 + 7.67043391E-05 8.48884992E-20 2.93243150E-03 0.00000000E+00 3.60626165E-04 + 0.00000000E+00 3.72544847E-04 0.00000000E+00 7.63645460E-05-4.23436741E-19 + 2.93243150E-03 0.00000000E+00 3.60626165E-04 0.00000000E+00 6.12270583E-04 +-2.03875790E-18 7.67043391E-05-8.48884992E-20-1.89483264E-04 0.00000000E+00 +-3.81017018E-05 1.74314816E-19 3.72541280E-04 0.00000000E+00 1.49050504E-03 + 0.00000000E+00 7.63648045E-05-4.26180520E-19 3.05464770E-04-1.52681598E-18 + 3.72544847E-04 0.00000000E+00-1.83292753E-04 0.00000000E+00 7.63645460E-05 +-4.23436741E-19-3.82672213E-05 1.27081310E-19 7.60420025E-05 2.71078746E-19 + 3.85391775E-04 0.00000000E+00 6.09622471E-04 2.88074516E-18 7.63648045E-05 + 4.26180520E-19 3.03145166E-03 0.00000000E+00 3.72541280E-04 0.00000000E+00 + 3.85391775E-04 0.00000000E+00 7.60420025E-05-2.71078746E-19 3.03145166E-03 + 0.00000000E+00 3.72541280E-04 0.00000000E+00 6.09622471E-04-2.88074516E-18 + 7.63648045E-05-4.26180520E-19-3.81017018E-05-1.74314816E-19-1.89483264E-04 + 0.00000000E+00 7.63648045E-05 4.26180520E-19 3.05464770E-04 1.52681598E-18 + 3.72541280E-04 0.00000000E+00 1.49050504E-03 0.00000000E+00 7.63645460E-05 + 4.23436741E-19-3.82672213E-05-1.27081310E-19 3.72544847E-04 0.00000000E+00 +-1.83292753E-04 0.00000000E+00 7.57357700E-05 1.27061470E-19 3.99275362E-04 + 0.00000000E+00 6.07107544E-04 1.36244647E-18 7.60422581E-05 2.39031309E-19 + 3.13833852E-03 0.00000000E+00 3.85387511E-04 0.00000000E+00-1.96165718E-04 + 0.00000000E+00-3.79445070E-05 9.15231948E-20 3.85387511E-04 0.00000000E+00 + 1.54192905E-03 0.00000000E+00 7.60422581E-05-2.39031309E-19 3.04174348E-04 +-1.03595016E-18 3.85391775E-04 0.00000000E+00-1.89483264E-04 0.00000000E+00 + 7.60420025E-05-2.71078746E-19-3.81017018E-05 1.74314816E-19-3.79445070E-05 +-9.15231948E-20-1.96165718E-04 0.00000000E+00 7.60422581E-05 2.39031309E-19 + 3.04174348E-04 1.03595016E-18 3.85387511E-04 0.00000000E+00 1.54192905E-03 + 0.00000000E+00 7.60420025E-05 2.71078746E-19-3.81017018E-05-1.74314816E-19 + 3.85391775E-04 0.00000000E+00-1.89483264E-04 0.00000000E+00 3.99275362E-04 + 0.00000000E+00 7.57357700E-05-1.27061470E-19 3.13833852E-03 0.00000000E+00 + 3.85387511E-04 0.00000000E+00 6.07107544E-04-1.36244647E-18 7.60422581E-05 +-2.39031309E-19-2.03397069E-04 0.00000000E+00-3.77953126E-05 9.16564431E-20 + 3.99270242E-04 0.00000000E+00 1.59750546E-03 0.00000000E+00 7.57360200E-05 +-1.66253623E-19 3.02949187E-04-6.38816820E-19 3.99275362E-04 0.00000000E+00 +-1.96165718E-04 0.00000000E+00 7.57357700E-05-1.27061470E-19-3.79445070E-05 + 9.15231948E-20-3.77953126E-05-9.16564431E-20-2.03397069E-04 0.00000000E+00 + 7.57360200E-05 1.66253623E-19 3.02949187E-04 6.38816820E-19 3.99270242E-04 + 0.00000000E+00 1.59750546E-03 0.00000000E+00 7.57357700E-05 1.27061470E-19 +-3.79445070E-05-9.15231948E-20 3.99275362E-04 0.00000000E+00-1.96165718E-04 + 0.00000000E+00 7.54452306E-05 2.00372150E-19 4.14318035E-04 0.00000000E+00 + 6.04720596E-04 1.54474102E-18 7.57360200E-05 1.66253623E-19 3.25400233E-03 + 0.00000000E+00 3.99270242E-04 0.00000000E+00 4.14318035E-04 0.00000000E+00 + 7.54452306E-05-2.00372150E-19 3.25400233E-03 0.00000000E+00 3.99270242E-04 + 0.00000000E+00 6.04720596E-04-1.54474102E-18 7.57360200E-05-1.66253623E-19 +-2.11243682E-04 0.00000000E+00-3.76538272E-05 6.20176414E-20 4.14311898E-04 + 0.00000000E+00 1.65772526E-03 0.00000000E+00 7.54454813E-05-1.65756107E-19 + 3.01786829E-04-6.89024582E-19 4.14318035E-04 0.00000000E+00-2.03397069E-04 + 0.00000000E+00 7.54452306E-05-2.00372150E-19-3.77953126E-05 9.16564431E-20 + 7.51698276E-05 8.23144585E-20 4.30662828E-04 0.00000000E+00 6.02456994E-04 + 9.23474648E-19 7.54454813E-05 1.65756107E-19 3.37950392E-03 0.00000000E+00 + 4.14311898E-04 0.00000000E+00 4.30662828E-04 0.00000000E+00 7.51698276E-05 +-8.23144585E-20 3.37950392E-03 0.00000000E+00 4.14311898E-04 0.00000000E+00 + 6.02456994E-04-9.23474648E-19 7.54454813E-05-1.65756107E-19-3.76538272E-05 +-6.20176414E-20-2.11243682E-04 0.00000000E+00 7.54454813E-05 1.65756107E-19 + 3.01786829E-04 6.89024582E-19 4.14311898E-04 0.00000000E+00 1.65772526E-03 + 0.00000000E+00 7.54452306E-05 2.00372150E-19-3.77953126E-05-9.16564431E-20 + 4.14318035E-04 0.00000000E+00-2.03397069E-04 0.00000000E+00 7.49090109E-05 + 2.82564308E-19 4.48477606E-04 0.00000000E+00 6.00312236E-04 1.43597767E-18 + 7.51700730E-05 8.76795328E-20 3.51608496E-03 0.00000000E+00 4.30655417E-04 + 0.00000000E+00-2.19783256E-04 0.00000000E+00-3.75197710E-05 9.25609601E-20 + 4.30655417E-04 0.00000000E+00 1.72316193E-03 0.00000000E+00 7.51700730E-05 +-8.76795328E-20 3.00685012E-04-4.41861034E-19 4.30662828E-04 0.00000000E+00 +-2.11243682E-04 0.00000000E+00 7.51698276E-05-8.23144585E-20-3.76538272E-05 + 6.20176414E-20-3.75197710E-05-9.25609601E-20-2.19783256E-04 0.00000000E+00 + 7.51700730E-05 8.76795328E-20 3.00685012E-04 4.41861034E-19 4.30655417E-04 + 0.00000000E+00 1.72316193E-03 0.00000000E+00 7.51698276E-05 8.23144585E-20 +-3.76538272E-05-6.20176414E-20 4.30662828E-04 0.00000000E+00-2.11243682E-04 + 0.00000000E+00 4.48477606E-04 0.00000000E+00 7.49090109E-05-2.82564308E-19 + 3.51608496E-03 0.00000000E+00 4.30655417E-04 0.00000000E+00 6.00312236E-04 +-1.43597767E-18 7.51700730E-05-8.76795328E-20-2.29107412E-04 0.00000000E+00 +-3.73928893E-05 1.33711675E-19 4.48468635E-04 0.00000000E+00 1.79448896E-03 + 0.00000000E+00 7.49092552E-05-3.36018317E-19 2.99641571E-04-1.11531980E-18 + 4.48477606E-04 0.00000000E+00-2.19783256E-04 0.00000000E+00 7.49090109E-05 +-2.82564308E-19-3.75197710E-05 9.25609601E-20-3.73928893E-05-1.33711675E-19 +-2.29107412E-04 0.00000000E+00 7.49092552E-05 3.36018317E-19 2.99641571E-04 + 1.11531980E-18 4.48468635E-04 0.00000000E+00 1.79448896E-03 0.00000000E+00 + 7.49090109E-05 2.82564308E-19-3.75197710E-05-9.25609601E-20 4.48477606E-04 + 0.00000000E+00-2.19783256E-04 0.00000000E+00 7.46623019E-05 1.98828385E-19 + 4.67961014E-04 0.00000000E+00 5.98282265E-04 2.32506205E-18 7.49092552E-05 + 3.36018317E-19 3.66520960E-03 0.00000000E+00 4.48468635E-04 0.00000000E+00 + 4.67961014E-04 0.00000000E+00 7.46623019E-05-1.98828385E-19 3.66520960E-03 + 0.00000000E+00 4.48468635E-04 0.00000000E+00 5.98282265E-04-2.32506205E-18 + 7.49092552E-05-3.36018317E-19-2.39324912E-04 0.00000000E+00-3.72729483E-05 + 6.73834721E-20 4.67950087E-04 0.00000000E+00 1.87250329E-03 0.00000000E+00 + 7.46625429E-05-1.02779359E-19 2.98654568E-04-6.77568961E-19 4.67961014E-04 + 0.00000000E+00-2.29107412E-04 0.00000000E+00 7.46623019E-05-1.98828385E-19 +-3.73928893E-05 1.33711675E-19 7.44292501E-05 1.66754529E-19 4.89349560E-04 + 0.00000000E+00 5.96363329E-04 8.45589705E-19 7.46625429E-05 1.02779359E-19 + 3.82861564E-03 0.00000000E+00 4.67950087E-04 0.00000000E+00 4.89349560E-04 + 0.00000000E+00 7.44292501E-05-1.66754529E-19 3.82861564E-03 0.00000000E+00 + 4.67950087E-04 0.00000000E+00 5.96363329E-04-8.45589705E-19 7.46625429E-05 +-1.02779359E-19-3.72729483E-05-6.73834721E-20-2.39324912E-04 0.00000000E+00 + 7.46625429E-05 1.02779359E-19 2.98654568E-04 6.77568961E-19 4.67950087E-04 + 0.00000000E+00 1.87250329E-03 0.00000000E+00 7.46623019E-05 1.98828385E-19 +-3.73928893E-05-1.33711675E-19 4.67961014E-04 0.00000000E+00-2.29107412E-04 + 0.00000000E+00 7.42094428E-05 2.85146593E-19 5.12927099E-04 0.00000000E+00 + 5.94552003E-04 2.36379438E-18 7.44294899E-05 2.58606043E-19 4.00838103E-03 + 0.00000000E+00 4.89336176E-04 0.00000000E+00-2.50565819E-04 0.00000000E+00 +-3.71597332E-05 1.35938159E-19 4.89336176E-04 0.00000000E+00 1.95815412E-03 + 0.00000000E+00 7.44294899E-05-2.58606043E-19 2.97722210E-04-8.36905908E-19 + 4.89349560E-04 0.00000000E+00-2.39324912E-04 0.00000000E+00 7.44292501E-05 +-1.66754529E-19-3.72729483E-05 6.73834721E-20-3.71597332E-05-1.35938159E-19 +-2.50565819E-04 0.00000000E+00 7.44294899E-05 2.58606043E-19 2.97722210E-04 + 8.36905908E-19 4.89336176E-04 0.00000000E+00 1.95815412E-03 0.00000000E+00 + 7.44292501E-05 1.66754529E-19-3.72729483E-05-6.73834721E-20 4.89349560E-04 + 0.00000000E+00-2.39324912E-04 0.00000000E+00 5.12927099E-04 0.00000000E+00 + 7.42094428E-05-2.85146593E-19 4.00838103E-03 0.00000000E+00 4.89336176E-04 + 0.00000000E+00 5.94552003E-04-2.36379438E-18 7.44294899E-05-2.58606043E-19 +-2.76779198E-04 0.00000000E+00-3.69526962E-05 2.74449154E-20 5.39016708E-04 + 0.00000000E+00 2.15716390E-03 0.00000000E+00 7.40027329E-05-8.82205679E-21 + 2.96014925E-04-1.70626753E-19 5.39037271E-04 0.00000000E+00-2.62986962E-04 + 0.00000000E+00 7.40024971E-05-2.08657907E-20-3.70530442E-05 6.54360816E-20 +-3.69526962E-05-2.74449154E-20-2.76779198E-04 0.00000000E+00 7.40027329E-05 + 8.82205679E-21 2.96014925E-04 1.70626753E-19 5.39016708E-04 0.00000000E+00 + 2.15716390E-03 0.00000000E+00 7.40024971E-05 2.08657907E-20-3.70530442E-05 +-6.54360816E-20 5.39037271E-04 0.00000000E+00-2.62986962E-04 0.00000000E+00 +-2.62986962E-04 0.00000000E+00-3.70530442E-05 6.54360816E-20 5.12910576E-04 + 0.00000000E+00 2.05258097E-03 0.00000000E+00 7.42096798E-05-2.40878536E-19 + 2.96842840E-04-9.63050978E-19 5.12927099E-04 0.00000000E+00-2.50565819E-04 + 0.00000000E+00 7.42094428E-05-2.85146593E-19-3.71597332E-05 1.35938159E-19 +-3.70530442E-05-6.54360816E-20-2.62986962E-04 0.00000000E+00 7.42096798E-05 + 2.40878536E-19 2.96842840E-04 9.63050978E-19 5.12910576E-04 0.00000000E+00 + 2.05258097E-03 0.00000000E+00 7.42094428E-05 2.85146593E-19-3.71597332E-05 +-1.35938159E-19 5.12927099E-04 0.00000000E+00-2.50565819E-04 0.00000000E+00 + 7.40024971E-05 2.08657907E-20 5.39037271E-04 0.00000000E+00 5.92845084E-04 + 1.00559325E-18 7.42096798E-05 2.40878536E-19 4.20701092E-03 0.00000000E+00 + 5.12910576E-04 0.00000000E+00 5.39037271E-04 0.00000000E+00 7.40024971E-05 +-2.08657907E-20 4.20701092E-03 0.00000000E+00 5.12910576E-04 0.00000000E+00 + 5.92845084E-04-1.00559325E-18 7.42096798E-05-2.40878536E-19 2.25394106E-05 + 0.00000000E+00-2.67589582E-06-4.89750120E-21 0.00000000E+00-1.37940565E-11 + 4.11689936E-08-1.31006298E-10 3.18864756E-08 0.00000000E+00-2.24899751E-05 + 0.00000000E+00-1.73927334E-06-2.10582022E-21 6.70278439E-08 1.73870336E-21 + 0.00000000E+00 5.77058951E-10 0.00000000E+00-1.49100624E-13-1.39177137E-05 + 1.92615125E-09 4.00360879E-08 1.01227467E-11-1.73927334E-06 2.10582022E-21 + 3.18864756E-08 0.00000000E+00-4.84969212E-07-4.38176119E-10 0.00000000E+00 +-5.65788654E-11-1.07277955E-06 2.78187155E-20 1.47116196E-06 4.84899322E-21 + 3.59826817E-04 0.00000000E+00 8.99280138E-05 0.00000000E+00-1.36530480E-04 +-7.36320070E-08 6.45113563E-07 3.97685132E-10 0.00000000E+00-1.10452945E-08 + 0.00000000E+00 5.71752679E-11 3.18864756E-08 0.00000000E+00-1.73927334E-06 +-2.10582022E-21 0.00000000E+00-5.65788654E-11 4.84969212E-07-4.38176119E-10 + 3.59826817E-04 0.00000000E+00 8.99280138E-05 0.00000000E+00-1.07277955E-06 +-2.78187155E-20 1.47116196E-06-4.84899322E-21 0.00000000E+00-1.10452945E-08 + 0.00000000E+00 5.71752679E-11 1.36530480E-04-7.36320070E-08-6.45113563E-07 + 3.97685132E-10 4.11689936E-08 1.31006298E-10 0.00000000E+00 1.37940565E-11 +-1.15557012E-07-7.81475425E-22 4.49393384E-05 0.00000000E+00 4.84969212E-07 + 4.38176119E-10 4.00360879E-08-1.01227467E-11 0.00000000E+00 5.65788654E-11 + 0.00000000E+00 1.49100624E-13-1.44067264E-05-8.14286976E-20 8.63877587E-08 + 5.10993374E-22 3.46175643E-03 0.00000000E+00-2.24751703E-05 0.00000000E+00 + 0.00000000E+00 1.37940565E-11-4.11689936E-08 1.31006298E-10 4.49393384E-05 + 0.00000000E+00-1.15557012E-07 7.81475425E-22 0.00000000E+00 5.65788654E-11 + 0.00000000E+00 1.49100624E-13-4.84969212E-07 4.38176119E-10-4.00360879E-08 +-1.01227467E-11 3.46175643E-03 0.00000000E+00-2.24751703E-05 0.00000000E+00 +-1.44067264E-05 8.14286976E-20 8.63877587E-08-5.10993374E-22-2.67589582E-06 + 4.89750120E-21 2.25394106E-05 0.00000000E+00-4.11689936E-08-1.31006298E-10 + 0.00000000E+00-1.37940565E-11-1.73927334E-06 2.10582022E-21 6.70278439E-08 +-1.73870336E-21 3.18864756E-08 0.00000000E+00-2.24899751E-05 0.00000000E+00 + 1.39177137E-05 1.92615125E-09-4.00360879E-08 1.01227467E-11 0.00000000E+00 + 5.77058951E-10 0.00000000E+00-1.49100624E-13 1.30904404E-06 3.02914454E-21 + 8.99321598E-05 0.00000000E+00-2.96877452E-04-4.28416442E-08-1.60613057E-06 +-2.13146761E-10 0.00000000E+00-1.12549393E-08 0.00000000E+00-5.84557828E-11 + 2.67330275E-05 7.35272761E-20 5.56528379E-06 1.74938089E-20 1.07918818E-03 + 0.00000000E+00 1.79864261E-04 0.00000000E+00-3.52400914E-04-3.55563601E-08 + 1.76635315E-06 1.92123858E-10 0.00000000E+00-1.12390890E-08 0.00000000E+00 + 5.84037915E-11-2.24899751E-05 0.00000000E+00 6.70278439E-08 1.73870336E-21 + 0.00000000E+00-1.49100624E-13 4.00360879E-08 1.01227467E-11 8.99280138E-05 + 0.00000000E+00 3.59732256E-04 0.00000000E+00 1.47116196E-06-4.84899322E-21 + 5.94746735E-06-2.00955888E-20 0.00000000E+00-1.23457263E-08 0.00000000E+00 +-8.04509373E-14 2.38364603E-04-6.17741630E-08 8.00779516E-08 1.53780889E-11 + 8.99321598E-05 0.00000000E+00-6.74491053E-05 0.00000000E+00 1.30904404E-06 +-3.02914454E-21-1.71858196E-06 5.13073835E-21 0.00000000E+00 5.59473200E-10 + 0.00000000E+00 1.29978248E-14-2.47149660E-05 8.84389392E-10 4.00556460E-08 + 5.25572555E-12 6.70278439E-08-1.73870336E-21-2.24899751E-05 0.00000000E+00 +-4.00360879E-08 1.01227467E-11 0.00000000E+00-1.49100624E-13 1.47116196E-06 + 4.84899322E-21 5.94746735E-06 2.00955888E-20 8.99280138E-05 0.00000000E+00 + 3.59732256E-04 0.00000000E+00-2.38364603E-04-6.17741630E-08-8.00779516E-08 + 1.53780889E-11 0.00000000E+00-1.23457263E-08 0.00000000E+00-8.04509373E-14 + 1.30904404E-06 3.02914454E-21-1.71858196E-06-5.13073835E-21 8.99321598E-05 + 0.00000000E+00-6.74491053E-05 0.00000000E+00 2.47149660E-05 8.84389392E-10 +-4.00556460E-08 5.25572555E-12 0.00000000E+00 5.59473200E-10 0.00000000E+00 + 1.29978248E-14 0.00000000E+00-5.77058951E-10 1.39177137E-05-1.92615125E-09 + 3.46175643E-03 0.00000000E+00-1.44067264E-05 8.14286976E-20 0.00000000E+00 + 1.10452945E-08 0.00000000E+00 1.23457263E-08-1.36530480E-04 7.36320070E-08 +-2.38364603E-04 6.17741630E-08 1.64791001E+00 0.00000000E+00-2.23105181E-03 + 0.00000000E+00-1.32736728E-02 3.53051191E-17 5.94060576E-08-9.25859891E-20 + 0.00000000E+00 1.12549393E-08 0.00000000E+00-5.64436733E-10-2.96877452E-04 + 4.28416442E-08 7.74947050E-06-3.11044660E-09 1.74331755E-01 0.00000000E+00 +-1.11767146E-03 0.00000000E+00-2.29416912E-03 1.06347697E-18 1.43448783E-05 +-7.24079001E-21 0.00000000E+00 1.49100624E-13-4.00360879E-08-1.01227467E-11 +-2.24751703E-05 0.00000000E+00 8.63877587E-08-5.10993374E-22 0.00000000E+00 +-5.71752679E-11 0.00000000E+00 8.04509373E-14 6.45113563E-07-3.97685132E-10 +-8.00779516E-08-1.53780889E-11-2.23105181E-03 0.00000000E+00 3.19448666E-05 + 0.00000000E+00 5.94060576E-08-9.25859891E-20-2.29647159E-07 6.57272771E-22 + 0.00000000E+00 5.84557828E-11 0.00000000E+00-1.29978248E-14-1.60613057E-06 + 2.13146761E-10-4.00556460E-08-5.25572555E-12 1.06108141E-03 0.00000000E+00 +-6.52091892E-06 0.00000000E+00-1.43428033E-05 5.81959875E-21 8.59673429E-08 +-3.75330692E-23-1.39177137E-05-1.92615125E-09 0.00000000E+00-5.77058951E-10 +-1.44067264E-05-8.14286976E-20 3.46175643E-03 0.00000000E+00 1.36530480E-04 + 7.36320070E-08 2.38364603E-04 6.17741630E-08 0.00000000E+00 1.10452945E-08 + 0.00000000E+00 1.23457263E-08-1.32736728E-02-3.53051191E-17 5.94060576E-08 + 9.25859891E-20 1.64791001E+00 0.00000000E+00-2.23105181E-03 0.00000000E+00 + 2.96877452E-04 4.28416442E-08-7.74947050E-06-3.11044660E-09 0.00000000E+00 + 1.12549393E-08 0.00000000E+00-5.64436733E-10-2.29416912E-03-1.06347697E-18 + 1.43448783E-05 7.24079001E-21 1.74331755E-01 0.00000000E+00-1.11767146E-03 + 0.00000000E+00 4.00360879E-08-1.01227467E-11 0.00000000E+00 1.49100624E-13 + 8.63877587E-08 5.10993374E-22-2.24751703E-05 0.00000000E+00-6.45113563E-07 +-3.97685132E-10 8.00779516E-08-1.53780889E-11 0.00000000E+00-5.71752679E-11 + 0.00000000E+00 8.04509373E-14 5.94060576E-08 9.25859891E-20-2.29647159E-07 +-6.57272771E-22-2.23105181E-03 0.00000000E+00 3.19448666E-05 0.00000000E+00 + 1.60613057E-06 2.13146761E-10 4.00556460E-08-5.25572555E-12 0.00000000E+00 + 5.84557828E-11 0.00000000E+00-1.29978248E-14-1.43428033E-05-5.81959875E-21 + 8.59673429E-08 3.75330692E-23 1.06108141E-03 0.00000000E+00-6.52091892E-06 + 0.00000000E+00 8.99321598E-05 0.00000000E+00 1.30904404E-06-3.02914454E-21 + 0.00000000E+00-1.12549393E-08 0.00000000E+00-5.84557828E-11 2.96877452E-04 +-4.28416442E-08 1.60613057E-06-2.13146761E-10 1.07918818E-03 0.00000000E+00 + 1.79864261E-04 0.00000000E+00 2.67330275E-05-7.35272761E-20 5.56528379E-06 +-1.74938089E-20 0.00000000E+00-1.12390890E-08 0.00000000E+00 5.84037915E-11 + 3.52400914E-04-3.55563601E-08-1.76635315E-06 1.92123858E-10 5.56565485E-06 + 2.29650515E-20 1.79863913E-04 0.00000000E+00-5.12877382E-04-2.34839158E-08 +-2.72813795E-06-1.19277363E-10 0.00000000E+00-1.12045574E-08 0.00000000E+00 +-5.82021977E-11 7.26660368E-05 2.44747131E-19 1.28088842E-05 3.38942009E-20 + 1.79859350E-03 0.00000000E+00 2.69783831E-04 0.00000000E+00-5.68458816E-04 +-2.14969501E-08 2.88852736E-06 1.13653296E-10 0.00000000E+00-1.12099721E-08 + 0.00000000E+00 5.82194154E-11-6.74491053E-05 0.00000000E+00-1.71858196E-06 + 5.13073835E-21 0.00000000E+00 5.64436733E-10 0.00000000E+00 1.29978248E-14 +-7.74947050E-06 3.11044660E-09 4.00556460E-08 5.25572555E-12 1.79864261E-04 + 0.00000000E+00 7.19451870E-04 0.00000000E+00 5.56528379E-06-1.74938089E-20 + 2.33281703E-05-7.93754566E-20 0.00000000E+00-1.23308054E-08 0.00000000E+00 + 2.28271294E-14 4.75883551E-04-3.05923725E-08 8.01437247E-08 5.53767826E-12 + 1.79863913E-04 0.00000000E+00-1.12411936E-04 0.00000000E+00 5.56565485E-06 +-2.29650515E-20-4.59363476E-06 1.42148131E-20 0.00000000E+00 5.61285266E-10 + 0.00000000E+00-4.30441273E-15-3.55254014E-05 8.35669366E-10 4.00973523E-08 + 1.40601695E-12 4.00556460E-08-5.25572555E-12 0.00000000E+00-1.29978248E-14 + 1.43448783E-05 7.24079001E-21 8.59673429E-08 3.75330692E-23-1.11767146E-03 + 0.00000000E+00-6.52091892E-06 0.00000000E+00-1.76635315E-06-1.92123858E-10 + 8.01437247E-08-5.53767826E-12 0.00000000E+00-5.84037915E-11 0.00000000E+00 +-2.28271294E-14 2.87743409E-08-7.20469794E-20-2.29031915E-07-4.59228377E-22 +-4.54185892E-04 0.00000000E+00 1.34401670E-05 0.00000000E+00 2.72813795E-06 + 1.19277363E-10 4.00973523E-08-1.40601695E-12 0.00000000E+00 5.82021977E-11 + 0.00000000E+00 4.30441273E-15-1.43150613E-05-5.94791759E-20 8.58024019E-08 + 3.49521727E-22 6.38464092E-04 0.00000000E+00-3.88461866E-06 0.00000000E+00 +-2.47149660E-05-8.84389392E-10 0.00000000E+00-5.59473200E-10-2.29416912E-03 +-1.06347697E-18-1.43428033E-05-5.81959875E-21 1.74331755E-01 0.00000000E+00 + 1.06108141E-03 0.00000000E+00 3.52400914E-04 3.55563601E-08 4.75883551E-04 + 3.05923725E-08 0.00000000E+00 1.12390890E-08 0.00000000E+00 1.23308054E-08 +-1.32430655E-02-2.34874761E-17 2.87743409E-08-7.20469794E-20 7.60152437E-01 + 0.00000000E+00-4.54185892E-04 0.00000000E+00 5.12877382E-04 2.34839158E-08 +-1.85421922E-05-1.44068655E-09 0.00000000E+00 1.12045574E-08 0.00000000E+00 +-5.59600115E-10-2.28977138E-03-9.25994732E-18 1.43175806E-05 5.65726722E-20 + 1.03730500E-01 0.00000000E+00-6.58398978E-04 0.00000000E+00 0.00000000E+00 +-1.29978248E-14-4.00556460E-08-5.25572555E-12-1.11767146E-03 0.00000000E+00 +-6.52091892E-06 0.00000000E+00 1.43448783E-05-7.24079001E-21 8.59673429E-08 +-3.75330692E-23 0.00000000E+00-5.84037915E-11 0.00000000E+00-2.28271294E-14 + 1.76635315E-06-1.92123858E-10-8.01437247E-08-5.53767826E-12-4.54185892E-04 + 0.00000000E+00 1.34401670E-05 0.00000000E+00 2.87743409E-08 7.20469794E-20 +-2.29031915E-07 4.59228377E-22 0.00000000E+00 5.82021977E-11 0.00000000E+00 + 4.30441273E-15-2.72813795E-06 1.19277363E-10-4.00973523E-08-1.40601695E-12 + 6.38464092E-04 0.00000000E+00-3.88461866E-06 0.00000000E+00-1.43150613E-05 + 5.94791759E-20 8.58024019E-08-3.49521727E-22 0.00000000E+00-5.59473200E-10 + 2.47149660E-05-8.84389392E-10 1.74331755E-01 0.00000000E+00 1.06108141E-03 + 0.00000000E+00-2.29416912E-03 1.06347697E-18-1.43428033E-05 5.81959875E-21 + 0.00000000E+00 1.12390890E-08 0.00000000E+00 1.23308054E-08-3.52400914E-04 + 3.55563601E-08-4.75883551E-04 3.05923725E-08 7.60152437E-01 0.00000000E+00 +-4.54185892E-04 0.00000000E+00-1.32430655E-02 2.34874761E-17 2.87743409E-08 + 7.20469794E-20 0.00000000E+00 1.12045574E-08 0.00000000E+00-5.59600115E-10 +-5.12877382E-04 2.34839158E-08 1.85421922E-05-1.44068655E-09 1.03730500E-01 + 0.00000000E+00-6.58398978E-04 0.00000000E+00-2.28977138E-03 9.25994732E-18 + 1.43175806E-05-5.65726722E-20-1.71858196E-06-5.13073835E-21-6.74491053E-05 + 0.00000000E+00 7.74947050E-06 3.11044660E-09-4.00556460E-08 5.25572555E-12 + 0.00000000E+00 5.64436733E-10 0.00000000E+00 1.29978248E-14 5.56528379E-06 + 1.74938089E-20 2.33281703E-05 7.93754566E-20 1.79864261E-04 0.00000000E+00 + 7.19451870E-04 0.00000000E+00-4.75883551E-04-3.05923725E-08-8.01437247E-08 + 5.53767826E-12 0.00000000E+00-1.23308054E-08 0.00000000E+00 2.28271294E-14 + 5.56565485E-06 2.29650515E-20-4.59363476E-06-1.42148131E-20 1.79863913E-04 + 0.00000000E+00-1.12411936E-04 0.00000000E+00 3.55254014E-05 8.35669366E-10 +-4.00973523E-08 1.40601695E-12 0.00000000E+00 5.61285266E-10 0.00000000E+00 +-4.30441273E-15 1.79863913E-04 0.00000000E+00 5.56565485E-06-2.29650515E-20 + 0.00000000E+00-1.12045574E-08 0.00000000E+00-5.82021977E-11 5.12877382E-04 +-2.34839158E-08 2.72813795E-06-1.19277363E-10 1.79859350E-03 0.00000000E+00 + 2.69783831E-04 0.00000000E+00 7.26660368E-05-2.44747131E-19 1.28088842E-05 +-3.38942009E-20 0.00000000E+00-1.12099721E-08 0.00000000E+00 5.82194154E-11 + 5.68458816E-04-2.14969501E-08-2.88852736E-06 1.13653296E-10 1.28085178E-05 + 2.73625613E-20 2.69783796E-04 0.00000000E+00-7.29077597E-04-1.73982443E-08 +-3.85112643E-06-8.89642472E-11 0.00000000E+00-1.12192998E-08 0.00000000E+00 +-5.82738132E-11 1.42103194E-04 1.39044929E-19 2.29234356E-05 1.03804859E-20 + 2.51791576E-03 0.00000000E+00 3.59694243E-04 0.00000000E+00-7.84639382E-04 +-1.62527509E-08 4.01146490E-06 8.56509434E-11 0.00000000E+00-1.12169175E-08 + 0.00000000E+00 5.82667048E-11-1.12411936E-04 0.00000000E+00-4.59363476E-06 + 1.42148131E-20 0.00000000E+00 5.59600115E-10 0.00000000E+00-4.30441273E-15 +-1.85421922E-05 1.44068655E-09 4.00973523E-08 1.40601695E-12 2.69783831E-04 + 0.00000000E+00 1.07913188E-03 0.00000000E+00 1.28088842E-05-3.38942009E-20 + 5.22604536E-05-1.12664940E-19 0.00000000E+00-1.23399491E-08 0.00000000E+00 +-5.94873314E-15 7.13647459E-04-2.11857251E-08 8.02462213E-08 1.92320131E-12 + 2.69783796E-04 0.00000000E+00-1.57369510E-04 0.00000000E+00 1.28085178E-05 +-2.73625613E-20-8.93298836E-06 9.43576181E-21 0.00000000E+00 5.60491634E-10 + 0.00000000E+00 1.77710210E-15-4.63305669E-05 6.69554903E-10 4.00846181E-08 + 8.28325962E-13 4.00973523E-08-1.40601695E-12 0.00000000E+00 4.30441273E-15 + 1.43175806E-05 5.65726722E-20 8.58024019E-08 3.49521727E-22-6.58398978E-04 + 0.00000000E+00-3.88461866E-06 0.00000000E+00-2.88852736E-06-1.13653296E-10 + 8.02462213E-08-1.92320131E-12 0.00000000E+00-5.82194154E-11 0.00000000E+00 + 5.94873314E-15 4.63975999E-08 7.54135274E-20-2.28481579E-07-5.94446546E-22 +-1.95715777E-04 0.00000000E+00 8.76228911E-06 0.00000000E+00 3.85112643E-06 + 8.89642472E-11 4.00846181E-08-8.28325962E-13 0.00000000E+00 5.82738132E-11 + 0.00000000E+00-1.77710210E-15-1.42715375E-05-4.04650056E-21 8.55455758E-08 + 3.29828935E-23 4.58192075E-04 0.00000000E+00-2.77573680E-06 0.00000000E+00 +-3.55254014E-05-8.35669366E-10 0.00000000E+00-5.61285266E-10-2.28977138E-03 +-9.25994732E-18-1.43150613E-05-5.94791759E-20 1.03730500E-01 0.00000000E+00 + 6.38464092E-04 0.00000000E+00 5.68458816E-04 2.14969501E-08 7.13647459E-04 + 2.11857251E-08 0.00000000E+00 1.12099721E-08 0.00000000E+00 1.23399491E-08 +-1.32118254E-02-3.86618193E-17 4.63975999E-08 7.54135274E-20 5.01879160E-01 + 0.00000000E+00-1.95715777E-04 0.00000000E+00 7.29077597E-04 1.73982443E-08 +-2.93532413E-05-1.01971688E-09 0.00000000E+00 1.12192998E-08 0.00000000E+00 +-5.61224041E-10-2.28293252E-03-9.53435983E-19 1.42754972E-05 7.59402659E-21 + 7.40981060E-02 0.00000000E+00-4.68283605E-04 0.00000000E+00 0.00000000E+00 + 4.30441273E-15-4.00973523E-08-1.40601695E-12-6.58398978E-04 0.00000000E+00 +-3.88461866E-06 0.00000000E+00 1.43175806E-05-5.65726722E-20 8.58024019E-08 +-3.49521727E-22 0.00000000E+00-5.82194154E-11 0.00000000E+00 5.94873314E-15 + 2.88852736E-06-1.13653296E-10-8.02462213E-08-1.92320131E-12-1.95715777E-04 + 0.00000000E+00 8.76228911E-06 0.00000000E+00 4.63975999E-08-7.54135274E-20 +-2.28481579E-07 5.94446546E-22 0.00000000E+00 5.82738132E-11 0.00000000E+00 +-1.77710210E-15-3.85112643E-06 8.89642472E-11-4.00846181E-08-8.28325962E-13 + 4.58192075E-04 0.00000000E+00-2.77573680E-06 0.00000000E+00-1.42715375E-05 + 4.04650056E-21 8.55455758E-08-3.29828935E-23 0.00000000E+00-5.61285266E-10 + 3.55254014E-05-8.35669366E-10 1.03730500E-01 0.00000000E+00 6.38464092E-04 + 0.00000000E+00-2.28977138E-03 9.25994732E-18-1.43150613E-05 5.94791759E-20 + 0.00000000E+00 1.12099721E-08 0.00000000E+00 1.23399491E-08-5.68458816E-04 + 2.14969501E-08-7.13647459E-04 2.11857251E-08 5.01879160E-01 0.00000000E+00 +-1.95715777E-04 0.00000000E+00-1.32118254E-02 3.86618193E-17 4.63975999E-08 +-7.54135274E-20 0.00000000E+00 1.12192998E-08 0.00000000E+00-5.61224041E-10 +-7.29077597E-04 1.73982443E-08 2.93532413E-05-1.01971688E-09 7.40981060E-02 + 0.00000000E+00-4.68283605E-04 0.00000000E+00-2.28293252E-03 9.53435983E-19 + 1.42754972E-05-7.59402659E-21-4.59363476E-06-1.42148131E-20-1.12411936E-04 + 0.00000000E+00 1.85421922E-05 1.44068655E-09-4.00973523E-08 1.40601695E-12 + 0.00000000E+00 5.59600115E-10 0.00000000E+00-4.30441273E-15 1.28088842E-05 + 3.38942009E-20 5.22604536E-05 1.12664940E-19 2.69783831E-04 0.00000000E+00 + 1.07913188E-03 0.00000000E+00-7.13647459E-04-2.11857251E-08-8.02462213E-08 + 1.92320131E-12 0.00000000E+00-1.23399491E-08 0.00000000E+00-5.94873314E-15 + 1.28085178E-05 2.73625613E-20-8.93298836E-06-9.43576181E-21 2.69783796E-04 + 0.00000000E+00-1.57369510E-04 0.00000000E+00 4.63305669E-05 6.69554903E-10 +-4.00846181E-08 8.28325962E-13 0.00000000E+00 5.60491634E-10 0.00000000E+00 + 1.77710210E-15 2.69783796E-04 0.00000000E+00 1.28085178E-05-2.73625613E-20 + 0.00000000E+00-1.12192998E-08 0.00000000E+00-5.82738132E-11 7.29077597E-04 +-1.73982443E-08 3.85112643E-06-8.89642472E-11 2.51791576E-03 0.00000000E+00 + 3.59694243E-04 0.00000000E+00 1.42103194E-04-1.39044929E-19 2.29234356E-05 +-1.03804859E-20 0.00000000E+00-1.12169175E-08 0.00000000E+00 5.82667048E-11 + 7.84639382E-04-1.62527509E-08-4.01146490E-06 8.56509434E-11 2.29238722E-05 + 9.87779310E-21 3.59693602E-04 0.00000000E+00-9.44815294E-04-1.38354753E-08 +-4.97144205E-06-7.11176290E-11 0.00000000E+00-1.12096143E-08 0.00000000E+00 +-5.82271351E-11 2.34586808E-04 2.47024411E-19 3.59289123E-05 5.64661482E-20 + 3.23713832E-03 0.00000000E+00 4.49589946E-04 0.00000000E+00-1.00015628E-03 +-1.32291835E-08 5.13113463E-06 6.93769384E-11 0.00000000E+00-1.12148576E-08 + 0.00000000E+00 5.82418876E-11-1.57369510E-04 0.00000000E+00-8.93298836E-06 + 9.43576181E-21 0.00000000E+00 5.61224041E-10 0.00000000E+00 1.77710210E-15 +-2.93532413E-05 1.01971688E-09 4.00846181E-08 8.28325962E-13 3.59694243E-04 + 0.00000000E+00 1.43877075E-03 0.00000000E+00 2.29234356E-05-1.03804859E-20 + 9.27268509E-05-6.32930871E-20 0.00000000E+00-1.23322150E-08 0.00000000E+00 + 8.06359294E-15 9.51279658E-04-1.63560626E-08 7.99854936E-08 1.16169643E-12 + 3.59693602E-04 0.00000000E+00-2.02320887E-04 0.00000000E+00 2.29238722E-05 +-9.87779310E-21-1.47131961E-05 1.65859853E-20 0.00000000E+00 5.61556897E-10 + 0.00000000E+00-3.68814693E-15-5.70782032E-05 5.85692579E-10 3.99231467E-08 + 4.35172656E-13 4.00846181E-08-8.28325962E-13 0.00000000E+00-1.77710210E-15 + 1.42754972E-05 7.59402659E-21 8.55455758E-08 3.29828935E-23-4.68283605E-04 + 0.00000000E+00-2.77573680E-06 0.00000000E+00-4.01146490E-06-8.56509434E-11 + 7.99854936E-08-1.16169643E-12 0.00000000E+00-5.82667048E-11 0.00000000E+00 +-8.06359294E-15 6.25922200E-08-7.84850769E-20-2.27669122E-07-4.27734956E-22 +-1.08700169E-04 0.00000000E+00 6.53879903E-06 0.00000000E+00 4.97144205E-06 + 7.11176290E-11 3.99231467E-08-4.35172656E-13 0.00000000E+00 5.82271351E-11 + 0.00000000E+00 3.68814693E-15-1.42128733E-05-6.35609445E-20 8.51968569E-08 + 3.68100247E-22 3.58206885E-04 0.00000000E+00-2.16474619E-06 0.00000000E+00 +-4.63305669E-05-6.69554903E-10 0.00000000E+00-5.60491634E-10-2.28293252E-03 +-9.53435983E-19-1.42715375E-05-4.04650056E-21 7.40981060E-02 0.00000000E+00 + 4.58192075E-04 0.00000000E+00 7.84639382E-04 1.62527509E-08 9.51279658E-04 + 1.63560626E-08 0.00000000E+00 1.12169175E-08 0.00000000E+00 1.23322150E-08 +-1.31646922E-02-1.97281930E-17 6.25922200E-08-7.84850769E-20 3.76105923E-01 + 0.00000000E+00-1.08700169E-04 0.00000000E+00 9.44815294E-04 1.38354753E-08 +-4.01685043E-05-7.70777887E-10 0.00000000E+00 1.12096143E-08 0.00000000E+00 +-5.59962054E-10-2.27363948E-03-9.76309193E-18 1.42178734E-05 5.87539710E-20 + 5.77810279E-02 0.00000000E+00-3.64275454E-04 0.00000000E+00 0.00000000E+00 +-1.77710210E-15-4.00846181E-08-8.28325962E-13-4.68283605E-04 0.00000000E+00 +-2.77573680E-06 0.00000000E+00 1.42754972E-05-7.59402659E-21 8.55455758E-08 +-3.29828935E-23 0.00000000E+00-5.82667048E-11 0.00000000E+00-8.06359294E-15 + 4.01146490E-06-8.56509434E-11-7.99854936E-08-1.16169643E-12-1.08700169E-04 + 0.00000000E+00 6.53879903E-06 0.00000000E+00 6.25922200E-08 7.84850769E-20 +-2.27669122E-07 4.27734956E-22 0.00000000E+00 5.82271351E-11 0.00000000E+00 + 3.68814693E-15-4.97144205E-06 7.11176290E-11-3.99231467E-08-4.35172656E-13 + 3.58206885E-04 0.00000000E+00-2.16474619E-06 0.00000000E+00-1.42128733E-05 + 6.35609445E-20 8.51968569E-08-3.68100247E-22 0.00000000E+00-5.60491634E-10 + 4.63305669E-05-6.69554903E-10 7.40981060E-02 0.00000000E+00 4.58192075E-04 + 0.00000000E+00-2.28293252E-03 9.53435983E-19-1.42715375E-05 4.04650056E-21 + 0.00000000E+00 1.12169175E-08 0.00000000E+00 1.23322150E-08-7.84639382E-04 + 1.62527509E-08-9.51279658E-04 1.63560626E-08 3.76105923E-01 0.00000000E+00 +-1.08700169E-04 0.00000000E+00-1.31646922E-02 1.97281930E-17 6.25922200E-08 + 7.84850769E-20 0.00000000E+00 1.12096143E-08 0.00000000E+00-5.59962054E-10 +-9.44815294E-04 1.38354753E-08 4.01685043E-05-7.70777887E-10 5.77810279E-02 + 0.00000000E+00-3.64275454E-04 0.00000000E+00-2.27363948E-03 9.76309193E-18 + 1.42178734E-05-5.87539710E-20-8.93298836E-06-9.43576181E-21-1.57369510E-04 + 0.00000000E+00 2.93532413E-05 1.01971688E-09-4.00846181E-08 8.28325962E-13 + 0.00000000E+00 5.61224041E-10 0.00000000E+00 1.77710210E-15 2.29234356E-05 + 1.03804859E-20 9.27268509E-05 6.32930871E-20 3.59694243E-04 0.00000000E+00 + 1.43877075E-03 0.00000000E+00-9.51279658E-04-1.63560626E-08-7.99854936E-08 + 1.16169643E-12 0.00000000E+00-1.23322150E-08 0.00000000E+00 8.06359294E-15 + 2.29238722E-05 9.87779310E-21-1.47131961E-05-1.65859853E-20 3.59693602E-04 + 0.00000000E+00-2.02320887E-04 0.00000000E+00 5.70782032E-05 5.85692579E-10 +-3.99231467E-08 4.35172656E-13 0.00000000E+00 5.61556897E-10 0.00000000E+00 +-3.68814693E-15 3.59693602E-04 0.00000000E+00 2.29238722E-05-9.87779310E-21 + 0.00000000E+00-1.12096143E-08 0.00000000E+00-5.82271351E-11 9.44815294E-04 +-1.38354753E-08 4.97144205E-06-7.11176290E-11 3.23713832E-03 0.00000000E+00 + 4.49589946E-04 0.00000000E+00 2.34586808E-04-2.47024411E-19 3.59289123E-05 +-5.64661482E-20 0.00000000E+00-1.12148576E-08 0.00000000E+00 5.82418876E-11 + 1.00015628E-03-1.32291835E-08-5.13113463E-06 6.93769384E-11 3.59289115E-05 + 5.94731204E-20 4.49589088E-04 0.00000000E+00-1.15981939E-03-1.18047173E-08 +-6.08802784E-06-6.08490869E-11 0.00000000E+00-1.12333206E-08 0.00000000E+00 +-5.83340138E-11 3.50159574E-04 8.14902151E-19 5.18169310E-05 1.45366357E-19 + 3.95623235E-03 0.00000000E+00 5.39467669E-04 0.00000000E+00-1.21502239E-03 +-1.14356413E-08 6.24732475E-06 5.97827293E-11 0.00000000E+00-1.12082093E-08 + 0.00000000E+00 5.82634973E-11-2.02320887E-04 0.00000000E+00-1.47131961E-05 + 1.65859853E-20 0.00000000E+00 5.59962054E-10 0.00000000E+00-3.68814693E-15 +-4.01685043E-05 7.70777887E-10 3.99231467E-08 4.35172656E-13 4.49589946E-04 + 0.00000000E+00 1.79835190E-03 0.00000000E+00 3.59289123E-05-5.64661482E-20 + 1.44745330E-04-2.45879363E-19 0.00000000E+00-1.23554119E-08 0.00000000E+00 +-2.75330935E-14 1.18803225E-03-1.36932881E-08 7.97327741E-08 7.21038593E-13 + 4.49589088E-04 0.00000000E+00-2.47264189E-04 0.00000000E+00 3.59289115E-05 +-5.94731204E-20-2.19364606E-05 5.12098693E-20 0.00000000E+00 5.56593668E-10 + 0.00000000E+00 1.76291254E-14-6.78040978E-05 5.26195525E-10 3.98242299E-08 + 2.66589418E-13 3.99231467E-08-4.35172656E-13 0.00000000E+00 3.68814693E-15 + 1.42178734E-05 5.87539710E-20 8.51968569E-08 3.68100247E-22-3.64275454E-04 + 0.00000000E+00-2.16474619E-06 0.00000000E+00-5.13113463E-06-6.93769384E-11 + 7.97327741E-08-7.21038593E-13 0.00000000E+00-5.82418876E-11 0.00000000E+00 + 2.75330935E-14 7.83112096E-08 4.05489964E-20-2.26624779E-07-8.82760381E-22 +-6.89716507E-05 0.00000000E+00 5.23308808E-06 0.00000000E+00 6.08802784E-06 + 6.08490869E-11 3.98242299E-08-2.66589418E-13 0.00000000E+00 5.83340138E-11 + 0.00000000E+00-1.76291254E-14-1.41396712E-05-3.47038974E-20 8.47613096E-08 + 2.17106647E-22 2.94748908E-04 0.00000000E+00-1.77846133E-06 0.00000000E+00 +-5.70782032E-05-5.85692579E-10 0.00000000E+00-5.61556897E-10-2.27363948E-03 +-9.76309193E-18-1.42128733E-05-6.35609445E-20 5.77810279E-02 0.00000000E+00 + 3.58206885E-04 0.00000000E+00 1.00015628E-03 1.32291835E-08 1.18803225E-03 + 1.36932881E-08 0.00000000E+00 1.12148576E-08 0.00000000E+00 1.23554119E-08 +-1.31044475E-02-5.55521453E-17 7.83112096E-08 4.05489964E-20 3.01582648E-01 + 0.00000000E+00-6.89716507E-05 0.00000000E+00 1.15981939E-03 1.18047173E-08 +-5.09365019E-05-6.38994441E-10 0.00000000E+00 1.12333206E-08 0.00000000E+00 +-5.64229096E-10-2.26202967E-03-5.82661399E-18 1.41458160E-05 3.80291090E-20 + 4.74677487E-02 0.00000000E+00-2.98787710E-04 0.00000000E+00 0.00000000E+00 + 3.68814693E-15-3.99231467E-08-4.35172656E-13-3.64275454E-04 0.00000000E+00 +-2.16474619E-06 0.00000000E+00 1.42178734E-05-5.87539710E-20 8.51968569E-08 +-3.68100247E-22 0.00000000E+00-5.82418876E-11 0.00000000E+00 2.75330935E-14 + 5.13113463E-06-6.93769384E-11-7.97327741E-08-7.21038593E-13-6.89716507E-05 + 0.00000000E+00 5.23308808E-06 0.00000000E+00 7.83112096E-08-4.05489964E-20 +-2.26624779E-07 8.82760381E-22 0.00000000E+00 5.83340138E-11 0.00000000E+00 +-1.76291254E-14-6.08802784E-06 6.08490869E-11-3.98242299E-08-2.66589418E-13 + 2.94748908E-04 0.00000000E+00-1.77846133E-06 0.00000000E+00-1.41396712E-05 + 3.47038974E-20 8.47613096E-08-2.17106647E-22 0.00000000E+00-5.61556897E-10 + 5.70782032E-05-5.85692579E-10 5.77810279E-02 0.00000000E+00 3.58206885E-04 + 0.00000000E+00-2.27363948E-03 9.76309193E-18-1.42128733E-05 6.35609445E-20 + 0.00000000E+00 1.12148576E-08 0.00000000E+00 1.23554119E-08-1.00015628E-03 + 1.32291835E-08-1.18803225E-03 1.36932881E-08 3.01582648E-01 0.00000000E+00 +-6.89716507E-05 0.00000000E+00-1.31044475E-02 5.55521453E-17 7.83112096E-08 +-4.05489964E-20 0.00000000E+00 1.12333206E-08 0.00000000E+00-5.64229096E-10 +-1.15981939E-03 1.18047173E-08 5.09365019E-05-6.38994441E-10 4.74677487E-02 + 0.00000000E+00-2.98787710E-04 0.00000000E+00-2.26202967E-03 5.82661399E-18 + 1.41458160E-05-3.80291090E-20-1.47131961E-05-1.65859853E-20-2.02320887E-04 + 0.00000000E+00 4.01685043E-05 7.70777887E-10-3.99231467E-08 4.35172656E-13 + 0.00000000E+00 5.59962054E-10 0.00000000E+00-3.68814693E-15 3.59289123E-05 + 5.64661482E-20 1.44745330E-04 2.45879363E-19 4.49589946E-04 0.00000000E+00 + 1.79835190E-03 0.00000000E+00-1.18803225E-03-1.36932881E-08-7.97327741E-08 + 7.21038593E-13 0.00000000E+00-1.23554119E-08 0.00000000E+00-2.75330935E-14 + 3.59289115E-05 5.94731204E-20-2.19364606E-05-5.12098693E-20 4.49589088E-04 + 0.00000000E+00-2.47264189E-04 0.00000000E+00 6.78040978E-05 5.26195525E-10 +-3.98242299E-08 2.66589418E-13 0.00000000E+00 5.56593668E-10 0.00000000E+00 + 1.76291254E-14 4.49589088E-04 0.00000000E+00 3.59289115E-05-5.94731204E-20 + 0.00000000E+00-1.12333206E-08 0.00000000E+00-5.83340138E-11 1.15981939E-03 +-1.18047173E-08 6.08802784E-06-6.08490869E-11 3.95623235E-03 0.00000000E+00 + 5.39467669E-04 0.00000000E+00 3.50159574E-04-8.14902151E-19 5.18169310E-05 +-1.45366357E-19 0.00000000E+00-1.12082093E-08 0.00000000E+00 5.82634973E-11 + 1.21502239E-03-1.14356413E-08-6.24732475E-06 5.97827293E-11 5.18171855E-05 + 1.38518998E-19 5.39466318E-04 0.00000000E+00-1.37423943E-03-1.07303302E-08 +-7.20151326E-06-5.55260596E-11 0.00000000E+00-1.09977496E-08 0.00000000E+00 +-5.70231916E-11 4.88787193E-04 1.69393974E-18 7.05851338E-05 2.91841201E-19 + 4.67516665E-03 0.00000000E+00 6.29323843E-04 0.00000000E+00-1.42922544E-03 +-1.05590888E-08 7.36018397E-06 5.50352531E-11 0.00000000E+00-1.09138770E-08 + 0.00000000E+00 5.67788812E-11-2.47264189E-04 0.00000000E+00-2.19364606E-05 + 5.12098693E-20 0.00000000E+00 5.64229096E-10 0.00000000E+00 1.76291254E-14 +-5.09365019E-05 6.38994441E-10 3.98242299E-08 2.66589418E-13 5.39467669E-04 + 0.00000000E+00 2.15786065E-03 0.00000000E+00 5.18169310E-05-1.45366357E-19 + 2.08296867E-04-5.92292709E-19 0.00000000E+00-1.22350029E-08 0.00000000E+00 + 1.26358035E-13 1.42416705E-03-1.21222211E-08 7.95339982E-08 3.22912241E-13 + 5.39466318E-04 0.00000000E+00-2.92197540E-04 0.00000000E+00 5.18171855E-05 +-1.38518998E-19-3.06005798E-05 1.07590050E-19 0.00000000E+00 5.35149983E-10 + 0.00000000E+00 6.10776156E-14-7.84855684E-05 5.06472648E-10 3.96676761E-08 + 1.22701640E-13 3.98242299E-08-2.66589418E-13 0.00000000E+00-1.76291254E-14 + 1.41458160E-05 3.80291090E-20 8.47613096E-08 2.17106647E-22-2.98787710E-04 + 0.00000000E+00-1.77846133E-06 0.00000000E+00-6.24732475E-06-5.97827293E-11 + 7.95339982E-08-3.22912241E-13 0.00000000E+00-5.82634973E-11 0.00000000E+00 +-1.26358035E-13 9.39403809E-08-1.09797825E-20-2.25346559E-07-5.52379779E-22 +-4.75331521E-05 0.00000000E+00 4.37419872E-06 0.00000000E+00 7.20151326E-06 + 5.55260596E-11 3.96676761E-08-1.22701640E-13 0.00000000E+00 5.70231916E-11 + 0.00000000E+00-6.10776156E-14-1.40518696E-05-3.97817735E-20 8.42382641E-08 + 2.36371326E-22 2.50989215E-04 0.00000000E+00-1.51275971E-06 0.00000000E+00 +-6.78040978E-05-5.26195525E-10 0.00000000E+00-5.56593668E-10-2.26202967E-03 +-5.82661399E-18-1.41396712E-05-3.47038974E-20 4.74677487E-02 0.00000000E+00 + 2.94748908E-04 0.00000000E+00 1.21502239E-03 1.14356413E-08 1.42416705E-03 + 1.21222211E-08 0.00000000E+00 1.12082093E-08 0.00000000E+00 1.22350029E-08 +-1.30306099E-02-2.97077759E-17 9.39403809E-08-1.09797825E-20 2.52347067E-01 + 0.00000000E+00-4.75331521E-05 0.00000000E+00 1.37423943E-03 1.07303302E-08 +-6.16842667E-05-5.58732199E-10 0.00000000E+00 1.09977496E-08 0.00000000E+00 +-5.60821695E-10-2.24808402E-03-6.29091561E-18 1.40591529E-05 3.89486588E-20 + 4.03749001E-02 0.00000000E+00-2.53862408E-04 0.00000000E+00 0.00000000E+00 +-1.76291254E-14-3.98242299E-08-2.66589418E-13-2.98787710E-04 0.00000000E+00 +-1.77846133E-06 0.00000000E+00 1.41458160E-05-3.80291090E-20 8.47613096E-08 +-2.17106647E-22 0.00000000E+00-5.82634973E-11 0.00000000E+00-1.26358035E-13 + 6.24732475E-06-5.97827293E-11-7.95339982E-08-3.22912241E-13-4.75331521E-05 + 0.00000000E+00 4.37419872E-06 0.00000000E+00 9.39403809E-08 1.09797825E-20 +-2.25346559E-07 5.52379779E-22 0.00000000E+00 5.70231916E-11 0.00000000E+00 +-6.10776156E-14-7.20151326E-06 5.55260596E-11-3.96676761E-08-1.22701640E-13 + 2.50989215E-04 0.00000000E+00-1.51275971E-06 0.00000000E+00-1.40518696E-05 + 3.97817735E-20 8.42382641E-08-2.36371326E-22 0.00000000E+00-5.56593668E-10 + 6.78040978E-05-5.26195525E-10 4.74677487E-02 0.00000000E+00 2.94748908E-04 + 0.00000000E+00-2.26202967E-03 5.82661399E-18-1.41396712E-05 3.47038974E-20 + 0.00000000E+00 1.12082093E-08 0.00000000E+00 1.22350029E-08-1.21502239E-03 + 1.14356413E-08-1.42416705E-03 1.21222211E-08 2.52347067E-01 0.00000000E+00 +-4.75331521E-05 0.00000000E+00-1.30306099E-02 2.97077759E-17 9.39403809E-08 + 1.09797825E-20 0.00000000E+00 1.09977496E-08 0.00000000E+00-5.60821695E-10 +-1.37423943E-03 1.07303302E-08 6.16842667E-05-5.58732199E-10 4.03749001E-02 + 0.00000000E+00-2.53862408E-04 0.00000000E+00-2.24808402E-03 6.29091561E-18 + 1.40591529E-05-3.89486588E-20-2.19364606E-05-5.12098693E-20-2.47264189E-04 + 0.00000000E+00 5.09365019E-05 6.38994441E-10-3.98242299E-08 2.66589418E-13 + 0.00000000E+00 5.64229096E-10 0.00000000E+00 1.76291254E-14 5.18169310E-05 + 1.45366357E-19 2.08296867E-04 5.92292709E-19 5.39467669E-04 0.00000000E+00 + 2.15786065E-03 0.00000000E+00-1.42416705E-03-1.21222211E-08-7.95339982E-08 + 3.22912241E-13 0.00000000E+00-1.22350029E-08 0.00000000E+00 1.26358035E-13 + 5.18171855E-05 1.38518998E-19-3.06005798E-05-1.07590050E-19 5.39466318E-04 + 0.00000000E+00-2.92197540E-04 0.00000000E+00 7.84855684E-05 5.06472648E-10 +-3.96676761E-08 1.22701640E-13 0.00000000E+00 5.35149983E-10 0.00000000E+00 + 6.10776156E-14 5.39466318E-04 0.00000000E+00 5.18171855E-05-1.38518998E-19 + 0.00000000E+00-1.09977496E-08 0.00000000E+00-5.70231916E-11 1.37423943E-03 +-1.07303302E-08 7.20151326E-06-5.55260596E-11 4.67516665E-03 0.00000000E+00 + 6.29323843E-04 0.00000000E+00 4.88787193E-04-1.69393974E-18 7.05851338E-05 +-2.91841201E-19 0.00000000E+00-1.09138770E-08 0.00000000E+00 5.67788812E-11 + 1.42922544E-03-1.05590888E-08-7.36018397E-06 5.50352531E-11 7.05849759E-05 + 3.22722810E-19 6.29322294E-04 0.00000000E+00-1.58768672E-03-1.01239387E-08 +-8.30989046E-06-5.24283125E-11 0.00000000E+00-1.07387569E-08 0.00000000E+00 +-5.57250230E-11 6.50433448E-04 2.61101692E-18 9.22287781E-05 3.04254129E-19 + 5.39391548E-03 0.00000000E+00 7.19154735E-04 0.00000000E+00-1.64245854E-03 +-9.99364037E-09 8.46794212E-06 5.20523041E-11 0.00000000E+00-1.06954896E-08 + 0.00000000E+00 5.56005869E-11-2.92197540E-04 0.00000000E+00-3.06005798E-05 + 1.07590050E-19 0.00000000E+00 5.60821695E-10 0.00000000E+00 6.10776156E-14 +-6.16842667E-05 5.58732199E-10 3.96676761E-08 1.22701640E-13 6.29323843E-04 + 0.00000000E+00 2.51728352E-03 0.00000000E+00 7.05851338E-05-2.91841201E-19 + 2.83367407E-04-1.16713368E-18 0.00000000E+00-1.18942909E-08 0.00000000E+00 + 8.33477327E-14 1.65937482E-03-1.13628938E-08 7.91019805E-08 2.18546195E-13 + 6.29322294E-04 0.00000000E+00-3.37119257E-04 0.00000000E+00 7.05849759E-05 +-3.22722810E-19-4.07034385E-05 1.56744235E-19 0.00000000E+00 5.29378675E-10 + 0.00000000E+00 3.11090361E-14-8.91209231E-05 4.83277874E-10 3.95129141E-08 + 9.40020973E-14 3.96676761E-08-1.22701640E-13 0.00000000E+00-6.10776156E-14 + 1.40591529E-05 3.89486588E-20 8.42382641E-08 2.36371326E-22-2.53862408E-04 + 0.00000000E+00-1.51275971E-06 0.00000000E+00-7.36018397E-06-5.50352531E-11 + 7.91019805E-08-2.18546195E-13 0.00000000E+00-5.67788812E-11 0.00000000E+00 +-8.33477327E-14 1.10319765E-07 1.60677554E-20-2.23831083E-07-5.62827558E-22 +-3.46546145E-05 0.00000000E+00 3.76720226E-06 0.00000000E+00 8.30989046E-06 + 5.24283125E-11 3.95129141E-08-9.40020973E-14 0.00000000E+00 5.57250230E-11 + 0.00000000E+00-3.11090361E-14-1.39489516E-05-2.73577586E-20 8.36246298E-08 + 1.67163500E-22 2.19065940E-04 0.00000000E+00-1.31927361E-06 0.00000000E+00 +-7.84855684E-05-5.06472648E-10 0.00000000E+00-5.35149983E-10-2.24808402E-03 +-6.29091561E-18-1.40518696E-05-3.97817735E-20 4.03749001E-02 0.00000000E+00 + 2.50989215E-04 0.00000000E+00 1.42922544E-03 1.05590888E-08 1.65937482E-03 + 1.13628938E-08 0.00000000E+00 1.09138770E-08 0.00000000E+00 1.18942909E-08 +-1.29430620E-02-3.35708455E-17 1.10319765E-07 1.60677554E-20 2.17465647E-01 + 0.00000000E+00-3.46546145E-05 0.00000000E+00 1.58768672E-03 1.01239387E-08 +-7.23850777E-05-5.23091554E-10 0.00000000E+00 1.07387569E-08 0.00000000E+00 +-5.42591202E-10-2.23172135E-03-4.47014193E-18 1.39573812E-05 2.85040958E-20 + 3.52102764E-02 0.00000000E+00-2.21208399E-04 0.00000000E+00 0.00000000E+00 +-6.10776156E-14-3.96676761E-08-1.22701640E-13-2.53862408E-04 0.00000000E+00 +-1.51275971E-06 0.00000000E+00 1.40591529E-05-3.89486588E-20 8.42382641E-08 +-2.36371326E-22 0.00000000E+00-5.67788812E-11 0.00000000E+00-8.33477327E-14 + 7.36018397E-06-5.50352531E-11-7.91019805E-08-2.18546195E-13-3.46546145E-05 + 0.00000000E+00 3.76720226E-06 0.00000000E+00 1.10319765E-07-1.60677554E-20 +-2.23831083E-07 5.62827558E-22 0.00000000E+00 5.57250230E-11 0.00000000E+00 +-3.11090361E-14-8.30989046E-06 5.24283125E-11-3.95129141E-08-9.40020973E-14 + 2.19065940E-04 0.00000000E+00-1.31927361E-06 0.00000000E+00-1.39489516E-05 + 2.73577586E-20 8.36246298E-08-1.67163500E-22 0.00000000E+00-5.35149983E-10 + 7.84855684E-05-5.06472648E-10 4.03749001E-02 0.00000000E+00 2.50989215E-04 + 0.00000000E+00-2.24808402E-03 6.29091561E-18-1.40518696E-05 3.97817735E-20 + 0.00000000E+00 1.09138770E-08 0.00000000E+00 1.18942909E-08-1.42922544E-03 + 1.05590888E-08-1.65937482E-03 1.13628938E-08 2.17465647E-01 0.00000000E+00 +-3.46546145E-05 0.00000000E+00-1.29430620E-02 3.35708455E-17 1.10319765E-07 +-1.60677554E-20 0.00000000E+00 1.07387569E-08 0.00000000E+00-5.42591202E-10 +-1.58768672E-03 1.01239387E-08 7.23850777E-05-5.23091554E-10 3.52102764E-02 + 0.00000000E+00-2.21208399E-04 0.00000000E+00-2.23172135E-03 4.47014193E-18 + 1.39573812E-05-2.85040958E-20-3.06005798E-05-1.07590050E-19-2.92197540E-04 + 0.00000000E+00 6.16842667E-05 5.58732199E-10-3.96676761E-08 1.22701640E-13 + 0.00000000E+00 5.60821695E-10 0.00000000E+00 6.10776156E-14 7.05851338E-05 + 2.91841201E-19 2.83367407E-04 1.16713368E-18 6.29323843E-04 0.00000000E+00 + 2.51728352E-03 0.00000000E+00-1.65937482E-03-1.13628938E-08-7.91019805E-08 + 2.18546195E-13 0.00000000E+00-1.18942909E-08 0.00000000E+00 8.33477327E-14 + 7.05849759E-05 3.22722810E-19-4.07034385E-05-1.56744235E-19 6.29322294E-04 + 0.00000000E+00-3.37119257E-04 0.00000000E+00 8.91209231E-05 4.83277874E-10 +-3.95129141E-08 9.40020973E-14 0.00000000E+00 5.29378675E-10 0.00000000E+00 + 3.11090361E-14 6.29322294E-04 0.00000000E+00 7.05849759E-05-3.22722810E-19 + 0.00000000E+00-1.07387569E-08 0.00000000E+00-5.57250230E-11 1.58768672E-03 +-1.01239387E-08 8.30989046E-06-5.24283125E-11 5.39391548E-03 0.00000000E+00 + 7.19154735E-04 0.00000000E+00 6.50433448E-04-2.61101692E-18 9.22287781E-05 +-3.04254129E-19 0.00000000E+00-1.06954896E-08 0.00000000E+00 5.56005869E-11 + 1.64245854E-03-9.99364037E-09-8.46794212E-06 5.20523041E-11 9.22290010E-05 + 2.53488314E-19 7.19152638E-04 0.00000000E+00-1.80040865E-03-9.67532032E-09 +-9.41450778E-06-5.01420571E-11 0.00000000E+00-1.05994649E-08 0.00000000E+00 +-5.50250179E-11 8.35068003E-04 2.20286844E-18 1.16742730E-04 3.26361940E-19 + 6.11244832E-03 0.00000000E+00 8.08957464E-04 0.00000000E+00-1.85491828E-03 +-9.58106815E-09 9.57180160E-06 4.98702758E-11 0.00000000E+00-1.05760609E-08 + 0.00000000E+00 5.49575509E-11-3.37119257E-04 0.00000000E+00-4.07034385E-05 + 1.56744235E-19 0.00000000E+00 5.42591202E-10 0.00000000E+00 3.11090361E-14 +-7.23850777E-05 5.23091554E-10 3.95129141E-08 9.40020973E-14 7.19154735E-04 + 0.00000000E+00 2.87660506E-03 0.00000000E+00 9.22287781E-05-3.04254129E-19 + 3.69940628E-04-1.14839446E-18 0.00000000E+00-1.17055903E-08 0.00000000E+00 + 4.80909626E-14 1.89366622E-03-1.08056564E-08 7.89167855E-08 1.56684172E-13 + 7.19152638E-04 0.00000000E+00-3.82027525E-04 0.00000000E+00 9.22290010E-05 +-2.53488314E-19-5.22429328E-05 1.44962563E-19 0.00000000E+00 5.25920526E-10 + 0.00000000E+00 1.68667327E-14-9.97087932E-05 4.67158044E-10 3.93234551E-08 + 6.79453344E-14 3.95129141E-08-9.40020973E-14 0.00000000E+00-3.11090361E-14 + 1.39573812E-05 2.85040958E-20 8.36246298E-08 1.67163500E-22-2.21208399E-04 + 0.00000000E+00-1.31927361E-06 0.00000000E+00-8.46794212E-06-5.20523041E-11 + 7.89167855E-08-1.56684172E-13 0.00000000E+00-5.56005869E-11 0.00000000E+00 +-4.80909626E-14 1.26123730E-07-7.54976031E-21-2.22076958E-07-4.60580010E-22 +-2.63112791E-05 0.00000000E+00 3.31642837E-06 0.00000000E+00 9.41450778E-06 + 5.01420571E-11 3.93234551E-08-6.79453344E-14 0.00000000E+00 5.50250179E-11 + 0.00000000E+00-1.68667327E-14-1.38312398E-05-3.66250536E-20 8.29224330E-08 + 2.11806284E-22 1.94814101E-04 0.00000000E+00-1.17247910E-06 0.00000000E+00 +-8.91209231E-05-4.83277874E-10 0.00000000E+00-5.29378675E-10-2.23172135E-03 +-4.47014193E-18-1.39489516E-05-2.73577586E-20 3.52102764E-02 0.00000000E+00 + 2.19065940E-04 0.00000000E+00 1.64245854E-03 9.99364037E-09 1.89366622E-03 + 1.08056564E-08 0.00000000E+00 1.06954896E-08 0.00000000E+00 1.17055903E-08 +-1.28417244E-02-2.47487160E-17 1.26123730E-07-7.54976031E-21 1.91522291E-01 + 0.00000000E+00-2.63112791E-05 0.00000000E+00 1.80040865E-03 9.67532032E-09 +-8.30530777E-05-4.95953572E-10 0.00000000E+00 1.05994649E-08 0.00000000E+00 +-5.33070430E-10-2.21299418E-03-5.66376025E-18 1.38408410E-05 3.41536581E-20 + 3.12921828E-02 0.00000000E+00-1.96468447E-04 0.00000000E+00 0.00000000E+00 +-3.11090361E-14-3.95129141E-08-9.40020973E-14-2.21208399E-04 0.00000000E+00 +-1.31927361E-06 0.00000000E+00 1.39573812E-05-2.85040958E-20 8.36246298E-08 +-1.67163500E-22 0.00000000E+00-5.56005869E-11 0.00000000E+00-4.80909626E-14 + 8.46794212E-06-5.20523041E-11-7.89167855E-08-1.56684172E-13-2.63112791E-05 + 0.00000000E+00 3.31642837E-06 0.00000000E+00 1.26123730E-07 7.54976031E-21 +-2.22076958E-07 4.60580010E-22 0.00000000E+00 5.50250179E-11 0.00000000E+00 +-1.68667327E-14-9.41450778E-06 5.01420571E-11-3.93234551E-08-6.79453344E-14 + 1.94814101E-04 0.00000000E+00-1.17247910E-06 0.00000000E+00-1.38312398E-05 + 3.66250536E-20 8.29224330E-08-2.11806284E-22 0.00000000E+00-5.29378675E-10 + 8.91209231E-05-4.83277874E-10 3.52102764E-02 0.00000000E+00 2.19065940E-04 + 0.00000000E+00-2.23172135E-03 4.47014193E-18-1.39489516E-05 2.73577586E-20 + 0.00000000E+00 1.06954896E-08 0.00000000E+00 1.17055903E-08-1.64245854E-03 + 9.99364037E-09-1.89366622E-03 1.08056564E-08 1.91522291E-01 0.00000000E+00 +-2.63112791E-05 0.00000000E+00-1.28417244E-02 2.47487160E-17 1.26123730E-07 + 7.54976031E-21 0.00000000E+00 1.05994649E-08 0.00000000E+00-5.33070430E-10 +-1.80040865E-03 9.67532032E-09 8.30530777E-05-4.95953572E-10 3.12921828E-02 + 0.00000000E+00-1.96468447E-04 0.00000000E+00-2.21299418E-03 5.66376025E-18 + 1.38408410E-05-3.41536581E-20-4.07034385E-05-1.56744235E-19-3.37119257E-04 + 0.00000000E+00 7.23850777E-05 5.23091554E-10-3.95129141E-08 9.40020973E-14 + 0.00000000E+00 5.42591202E-10 0.00000000E+00 3.11090361E-14 9.22287781E-05 + 3.04254129E-19 3.69940628E-04 1.14839446E-18 7.19154735E-04 0.00000000E+00 + 2.87660506E-03 0.00000000E+00-1.89366622E-03-1.08056564E-08-7.89167855E-08 + 1.56684172E-13 0.00000000E+00-1.17055903E-08 0.00000000E+00 4.80909626E-14 + 9.22290010E-05 2.53488314E-19-5.22429328E-05-1.44962563E-19 7.19152638E-04 + 0.00000000E+00-3.82027525E-04 0.00000000E+00 9.97087932E-05 4.67158044E-10 +-3.93234551E-08 6.79453344E-14 0.00000000E+00 5.25920526E-10 0.00000000E+00 + 1.68667327E-14 7.19152638E-04 0.00000000E+00 9.22290010E-05-2.53488314E-19 + 0.00000000E+00-1.05994649E-08 0.00000000E+00-5.50250179E-11 1.80040865E-03 +-9.67532032E-09 9.41450778E-06-5.01420571E-11 6.11244832E-03 0.00000000E+00 + 8.08957464E-04 0.00000000E+00 8.35068003E-04-2.20286844E-18 1.16742730E-04 +-3.26361940E-19 0.00000000E+00-1.05760609E-08 0.00000000E+00 5.49575509E-11 + 1.85491828E-03-9.58106815E-09-9.57180160E-06 4.98702758E-11 1.16742327E-04 + 3.75170392E-19 8.08955306E-04 0.00000000E+00-2.01187888E-03-9.34333618E-09 +-1.05125011E-05-4.84448591E-11 0.00000000E+00-1.05335818E-08 0.00000000E+00 +-5.47020377E-11 1.04263597E-03 3.17149003E-18 1.44121250E-04 3.95152686E-19 + 6.83074175E-03 0.00000000E+00 8.98727729E-04 0.00000000E+00-2.06608612E-03 +-9.27193379E-09 1.06689231E-05 4.82389129E-11 0.00000000E+00-1.05261431E-08 + 0.00000000E+00 5.46806378E-11-3.82027525E-04 0.00000000E+00-5.22429328E-05 + 1.44962563E-19 0.00000000E+00 5.33070430E-10 0.00000000E+00 1.68667327E-14 +-8.30530777E-05 4.95953572E-10 3.93234551E-08 6.79453344E-14 8.08957464E-04 + 0.00000000E+00 3.23581412E-03 0.00000000E+00 1.16742730E-04-3.26361940E-19 + 4.67993491E-04-1.38390168E-18 0.00000000E+00-1.16048996E-08 0.00000000E+00 + 2.04908555E-14 2.12684011E-03-1.04007028E-08 7.83513749E-08 1.18272066E-13 + 8.08955306E-04 0.00000000E+00-4.26920759E-04 0.00000000E+00 1.16742327E-04 +-3.75170392E-19-6.52158945E-05 1.92580770E-19 0.00000000E+00 5.25427782E-10 + 0.00000000E+00 5.34997497E-15-1.10229596E-04 4.54585986E-10 3.91055027E-08 + 5.14865491E-14 3.93234551E-08-6.79453344E-14 0.00000000E+00-1.68667327E-14 + 1.38408410E-05 3.41536581E-20 8.29224330E-08 2.11806284E-22-1.96468447E-04 + 0.00000000E+00-1.17247910E-06 0.00000000E+00-9.57180160E-06-4.98702758E-11 + 7.83513749E-08-1.18272066E-13 0.00000000E+00-5.49575509E-11 0.00000000E+00 +-2.04908555E-14 1.42842101E-07-3.35904507E-20-2.20080999E-07-8.14042281E-22 +-2.06010052E-05 0.00000000E+00 2.96930051E-06 0.00000000E+00 1.05125011E-05 + 4.84448591E-11 3.91055027E-08-5.14865491E-14 0.00000000E+00 5.47020377E-11 + 0.00000000E+00-5.34997497E-15-1.36981196E-05-6.29501823E-20 8.21278255E-08 + 3.77233944E-22 1.75816339E-04 0.00000000E+00-1.05760423E-06 0.00000000E+00 +-9.97087932E-05-4.67158044E-10 0.00000000E+00-5.25920526E-10-2.21299418E-03 +-5.66376025E-18-1.38312398E-05-3.66250536E-20 3.12921828E-02 0.00000000E+00 + 1.94814101E-04 0.00000000E+00 1.85491828E-03 9.58106815E-09 2.12684011E-03 + 1.04007028E-08 0.00000000E+00 1.05760609E-08 0.00000000E+00 1.16048996E-08 +-1.27263759E-02-4.83475195E-17 1.42842101E-07-3.35904507E-20 1.71523888E-01 + 0.00000000E+00-2.06010052E-05 0.00000000E+00 2.01187888E-03 9.34333618E-09 +-9.36662523E-05-4.76401587E-10 0.00000000E+00 1.05335818E-08 0.00000000E+00 +-5.27699454E-10-2.19180136E-03-1.00473980E-17 1.37088762E-05 6.27630862E-20 + 2.82261773E-02 0.00000000E+00-1.77128442E-04 0.00000000E+00 0.00000000E+00 +-1.68667327E-14-3.93234551E-08-6.79453344E-14-1.96468447E-04 0.00000000E+00 +-1.17247910E-06 0.00000000E+00 1.38408410E-05-3.41536581E-20 8.29224330E-08 +-2.11806284E-22 0.00000000E+00-5.49575509E-11 0.00000000E+00-2.04908555E-14 + 9.57180160E-06-4.98702758E-11-7.83513749E-08-1.18272066E-13-2.06010052E-05 + 0.00000000E+00 2.96930051E-06 0.00000000E+00 1.42842101E-07 3.35904507E-20 +-2.20080999E-07 8.14042281E-22 0.00000000E+00 5.47020377E-11 0.00000000E+00 +-5.34997497E-15-1.05125011E-05 4.84448591E-11-3.91055027E-08-5.14865491E-14 + 1.75816339E-04 0.00000000E+00-1.05760423E-06 0.00000000E+00-1.36981196E-05 + 6.29501823E-20 8.21278255E-08-3.77233944E-22 0.00000000E+00-5.25920526E-10 + 9.97087932E-05-4.67158044E-10 3.12921828E-02 0.00000000E+00 1.94814101E-04 + 0.00000000E+00-2.21299418E-03 5.66376025E-18-1.38312398E-05 3.66250536E-20 + 0.00000000E+00 1.05760609E-08 0.00000000E+00 1.16048996E-08-1.85491828E-03 + 9.58106815E-09-2.12684011E-03 1.04007028E-08 1.71523888E-01 0.00000000E+00 +-2.06010052E-05 0.00000000E+00-1.27263759E-02 4.83475195E-17 1.42842101E-07 + 3.35904507E-20 0.00000000E+00 1.05335818E-08 0.00000000E+00-5.27699454E-10 +-2.01187888E-03 9.34333618E-09 9.36662523E-05-4.76401587E-10 2.82261773E-02 + 0.00000000E+00-1.77128442E-04 0.00000000E+00-2.19180136E-03 1.00473980E-17 + 1.37088762E-05-6.27630862E-20-5.22429328E-05-1.44962563E-19-3.82027525E-04 + 0.00000000E+00 8.30530777E-05 4.95953572E-10-3.93234551E-08 6.79453344E-14 + 0.00000000E+00 5.33070430E-10 0.00000000E+00 1.68667327E-14 1.16742730E-04 + 3.26361940E-19 4.67993491E-04 1.38390168E-18 8.08957464E-04 0.00000000E+00 + 3.23581412E-03 0.00000000E+00-2.12684011E-03-1.04007028E-08-7.83513749E-08 + 1.18272066E-13 0.00000000E+00-1.16048996E-08 0.00000000E+00 2.04908555E-14 + 1.16742327E-04 3.75170392E-19-6.52158945E-05-1.92580770E-19 8.08955306E-04 + 0.00000000E+00-4.26920759E-04 0.00000000E+00 1.10229596E-04 4.54585986E-10 +-3.91055027E-08 5.14865491E-14 0.00000000E+00 5.25427782E-10 0.00000000E+00 + 5.34997497E-15 8.08955306E-04 0.00000000E+00 1.16742327E-04-3.75170392E-19 + 0.00000000E+00-1.05335818E-08 0.00000000E+00-5.47020377E-11 2.01187888E-03 +-9.34333618E-09 1.05125011E-05-4.84448591E-11 6.83074175E-03 0.00000000E+00 + 8.98727729E-04 0.00000000E+00 1.04263597E-03-3.17149003E-18 1.44121250E-04 +-3.95152686E-19 0.00000000E+00-1.05261431E-08 0.00000000E+00 5.46806378E-11 + 2.06608612E-03-9.27193379E-09-1.06689231E-05 4.82389129E-11 1.44121311E-04 + 3.53718367E-19 8.98725002E-04 0.00000000E+00-2.22231051E-03-9.09217712E-09 +-1.16051590E-05-4.71608639E-11 0.00000000E+00-1.05215126E-08 0.00000000E+00 +-5.46524568E-11 1.27310104E-03 3.32315708E-18 1.74357754E-04 4.98168046E-19 + 7.54876006E-03 0.00000000E+00 9.88462489E-04 0.00000000E+00-2.27623001E-03 +-9.03798505E-09 1.17607515E-05 4.70045485E-11 0.00000000E+00-1.05251886E-08 + 0.00000000E+00 5.46631073E-11-4.26920759E-04 0.00000000E+00-6.52158945E-05 + 1.92580770E-19 0.00000000E+00 5.27699454E-10 0.00000000E+00 5.34997497E-15 +-9.36662523E-05 4.76401587E-10 3.91055027E-08 5.14865491E-14 8.98727729E-04 + 0.00000000E+00 3.59489310E-03 0.00000000E+00 1.44121250E-04-3.95152686E-19 + 5.77505733E-04-1.54245182E-18 0.00000000E+00-1.15724497E-08 0.00000000E+00 + 2.08563453E-15 2.35871550E-03-1.00944428E-08 7.80279764E-08 8.92185019E-14 + 8.98725002E-04 0.00000000E+00-4.71796873E-04 0.00000000E+00 1.44121311E-04 +-3.53718367E-19-7.96197663E-05 2.12971603E-19 0.00000000E+00 5.26783522E-10 + 0.00000000E+00-2.66262492E-15-1.20699194E-04 4.45056190E-10 3.88981382E-08 + 3.90788414E-14 3.91055027E-08-5.14865491E-14 0.00000000E+00-5.34997497E-15 + 1.37088762E-05 6.27630862E-20 8.21278255E-08 3.77233944E-22-1.77128442E-04 + 0.00000000E+00-1.05760423E-06 0.00000000E+00-1.06689231E-05-4.82389129E-11 + 7.80279764E-08-8.92185019E-14 0.00000000E+00-5.46806378E-11 0.00000000E+00 +-2.08563453E-15 1.58941907E-07 2.00601055E-20-2.17842403E-07-8.97741197E-22 +-1.65166094E-05 0.00000000E+00 2.69450317E-06 0.00000000E+00 1.16051590E-05 + 4.71608639E-11 3.88981382E-08-3.90788414E-14 0.00000000E+00 5.46524568E-11 + 0.00000000E+00 2.66262492E-15-1.35499186E-05-4.60997033E-20 8.12430114E-08 + 2.80743211E-22 1.60578300E-04 0.00000000E+00-9.65537362E-07 0.00000000E+00 +-1.10229596E-04-4.54585986E-10 0.00000000E+00-5.25427782E-10-2.19180136E-03 +-1.00473980E-17-1.36981196E-05-6.29501823E-20 2.82261773E-02 0.00000000E+00 + 1.75816339E-04 0.00000000E+00 2.06608612E-03 9.27193379E-09 2.35871550E-03 + 1.00944428E-08 0.00000000E+00 1.05261431E-08 0.00000000E+00 1.15724497E-08 +-1.25970372E-02-5.27023606E-17 1.58941907E-07 2.00601055E-20 1.55681424E-01 + 0.00000000E+00-1.65166094E-05 0.00000000E+00 2.22231051E-03 9.09217712E-09 +-1.04223746E-04-4.61613695E-10 0.00000000E+00 1.05215126E-08 0.00000000E+00 +-5.25659460E-10-2.16820004E-03-7.49665203E-18 1.35618804E-05 4.76243466E-20 + 2.57689837E-02 0.00000000E+00-1.61641114E-04 0.00000000E+00 0.00000000E+00 +-5.34997497E-15-3.91055027E-08-5.14865491E-14-1.77128442E-04 0.00000000E+00 +-1.05760423E-06 0.00000000E+00 1.37088762E-05-6.27630862E-20 8.21278255E-08 +-3.77233944E-22 0.00000000E+00-5.46806378E-11 0.00000000E+00-2.08563453E-15 + 1.06689231E-05-4.82389129E-11-7.80279764E-08-8.92185019E-14-1.65166094E-05 + 0.00000000E+00 2.69450317E-06 0.00000000E+00 1.58941907E-07-2.00601055E-20 +-2.17842403E-07 8.97741197E-22 0.00000000E+00 5.46524568E-11 0.00000000E+00 + 2.66262492E-15-1.16051590E-05 4.71608639E-11-3.88981382E-08-3.90788414E-14 + 1.60578300E-04 0.00000000E+00-9.65537362E-07 0.00000000E+00-1.35499186E-05 + 4.60997033E-20 8.12430114E-08-2.80743211E-22 0.00000000E+00-5.25427782E-10 + 1.10229596E-04-4.54585986E-10 2.82261773E-02 0.00000000E+00 1.75816339E-04 + 0.00000000E+00-2.19180136E-03 1.00473980E-17-1.36981196E-05 6.29501823E-20 + 0.00000000E+00 1.05261431E-08 0.00000000E+00 1.15724497E-08-2.06608612E-03 + 9.27193379E-09-2.35871550E-03 1.00944428E-08 1.55681424E-01 0.00000000E+00 +-1.65166094E-05 0.00000000E+00-1.25970372E-02 5.27023606E-17 1.58941907E-07 +-2.00601055E-20 0.00000000E+00 1.05215126E-08 0.00000000E+00-5.25659460E-10 +-2.22231051E-03 9.09217712E-09 1.04223746E-04-4.61613695E-10 2.57689837E-02 + 0.00000000E+00-1.61641114E-04 0.00000000E+00-2.16820004E-03 7.49665203E-18 + 1.35618804E-05-4.76243466E-20-6.52158945E-05-1.92580770E-19-4.26920759E-04 + 0.00000000E+00 9.36662523E-05 4.76401587E-10-3.91055027E-08 5.14865491E-14 + 0.00000000E+00 5.27699454E-10 0.00000000E+00 5.34997497E-15 1.44121250E-04 + 3.95152686E-19 5.77505733E-04 1.54245182E-18 8.98727729E-04 0.00000000E+00 + 3.59489310E-03 0.00000000E+00-2.35871550E-03-1.00944428E-08-7.80279764E-08 + 8.92185019E-14 0.00000000E+00-1.15724497E-08 0.00000000E+00 2.08563453E-15 + 1.44121311E-04 3.53718367E-19-7.96197663E-05-2.12971603E-19 8.98725002E-04 + 0.00000000E+00-4.71796873E-04 0.00000000E+00 1.20699194E-04 4.45056190E-10 +-3.88981382E-08 3.90788414E-14 0.00000000E+00 5.26783522E-10 0.00000000E+00 +-2.66262492E-15 8.98725002E-04 0.00000000E+00 1.44121311E-04-3.53718367E-19 + 0.00000000E+00-1.05215126E-08 0.00000000E+00-5.46524568E-11 2.22231051E-03 +-9.09217712E-09 1.16051590E-05-4.71608639E-11 7.54876006E-03 0.00000000E+00 + 9.88462489E-04 0.00000000E+00 1.27310104E-03-3.32315708E-18 1.74357754E-04 +-4.98168046E-19 0.00000000E+00-1.05251886E-08 0.00000000E+00 5.46631073E-11 + 2.27623001E-03-9.03798505E-09-1.17607515E-05 4.70045485E-11 1.74357292E-04 + 5.33289100E-19 9.88459711E-04 0.00000000E+00-2.43140207E-03-8.90087637E-09 +-1.26906830E-05-4.61823663E-11 0.00000000E+00-1.05486642E-08 0.00000000E+00 +-5.48034007E-11 1.52639589E-03 4.40285609E-18 2.07445141E-04 5.49795614E-19 + 8.26648274E-03 0.00000000E+00 1.07815807E-03 0.00000000E+00-2.48489748E-03 +-8.85948883E-09 1.28450467E-05 4.60629828E-11 0.00000000E+00-1.05607609E-08 + 0.00000000E+00 5.48383353E-11-4.71796873E-04 0.00000000E+00-7.96197663E-05 + 2.12971603E-19 0.00000000E+00 5.25659460E-10 0.00000000E+00-2.66262492E-15 +-1.04223746E-04 4.61613695E-10 3.88981382E-08 3.90788414E-14 9.88462489E-04 + 0.00000000E+00 3.95383050E-03 0.00000000E+00 1.74357754E-04-4.98168046E-19 + 6.98448486E-04-2.01771928E-18 0.00000000E+00-1.15877727E-08 0.00000000E+00 +-1.19214851E-14 2.58934381E-03-9.86204168E-09 7.74929629E-08 6.81815024E-14 + 9.88459711E-04 0.00000000E+00-5.16654445E-04 0.00000000E+00 1.74357292E-04 +-5.33289100E-19-9.54506083E-05 2.70771179E-19 0.00000000E+00 5.29624432E-10 + 0.00000000E+00-8.73363976E-15-1.31077976E-04 4.37748736E-10 3.85909170E-08 + 2.98458794E-14 3.88981382E-08-3.90788414E-14 0.00000000E+00 2.66262492E-15 + 1.35618804E-05 4.76243466E-20 8.12430114E-08 2.80743211E-22-1.61641114E-04 + 0.00000000E+00-9.65537362E-07 0.00000000E+00-1.17607515E-05-4.70045485E-11 + 7.74929629E-08-6.81815024E-14 0.00000000E+00-5.46631073E-11 0.00000000E+00 + 1.19214851E-14 1.76129163E-07 1.13672879E-20-2.15355953E-07-6.46635408E-22 +-1.34968321E-05 0.00000000E+00 2.47221609E-06 0.00000000E+00 1.26906830E-05 + 4.61823663E-11 3.85909170E-08-2.98458794E-14 0.00000000E+00 5.48034007E-11 + 0.00000000E+00 8.73363976E-15-1.33858377E-05-3.60725331E-20 8.02630135E-08 + 2.16769351E-22 1.48121630E-04 0.00000000E+00-8.90324199E-07 0.00000000E+00 +-1.20699194E-04-4.45056190E-10 0.00000000E+00-5.26783522E-10-2.16820004E-03 +-7.49665203E-18-1.35499186E-05-4.60997033E-20 2.57689837E-02 0.00000000E+00 + 1.60578300E-04 0.00000000E+00 2.27623001E-03 9.03798505E-09 2.58934381E-03 + 9.86204168E-09 0.00000000E+00 1.05251886E-08 0.00000000E+00 1.15877727E-08 +-1.24533302E-02-3.66379816E-17 1.76129163E-07 1.13672879E-20 1.42859835E-01 + 0.00000000E+00-1.34968321E-05 0.00000000E+00 2.43140207E-03 8.90087637E-09 +-1.14732200E-04-4.50394079E-10 0.00000000E+00 1.05486642E-08 0.00000000E+00 +-5.25927667E-10-2.14205882E-03-5.78556398E-18 1.33990042E-05 3.62699786E-20 + 2.37616465E-02 0.00000000E+00-1.48997355E-04 0.00000000E+00 0.00000000E+00 + 2.66262492E-15-3.88981382E-08-3.90788414E-14-1.61641114E-04 0.00000000E+00 +-9.65537362E-07 0.00000000E+00 1.35618804E-05-4.76243466E-20 8.12430114E-08 +-2.80743211E-22 0.00000000E+00-5.46631073E-11 0.00000000E+00 1.19214851E-14 + 1.17607515E-05-4.70045485E-11-7.74929629E-08-6.81815024E-14-1.34968321E-05 + 0.00000000E+00 2.47221609E-06 0.00000000E+00 1.76129163E-07-1.13672879E-20 +-2.15355953E-07 6.46635408E-22 0.00000000E+00 5.48034007E-11 0.00000000E+00 + 8.73363976E-15-1.26906830E-05 4.61823663E-11-3.85909170E-08-2.98458794E-14 + 1.48121630E-04 0.00000000E+00-8.90324199E-07 0.00000000E+00-1.33858377E-05 + 3.60725331E-20 8.02630135E-08-2.16769351E-22 0.00000000E+00-5.26783522E-10 + 1.20699194E-04-4.45056190E-10 2.57689837E-02 0.00000000E+00 1.60578300E-04 + 0.00000000E+00-2.16820004E-03 7.49665203E-18-1.35499186E-05 4.60997033E-20 + 0.00000000E+00 1.05251886E-08 0.00000000E+00 1.15877727E-08-2.27623001E-03 + 9.03798505E-09-2.58934381E-03 9.86204168E-09 1.42859835E-01 0.00000000E+00 +-1.34968321E-05 0.00000000E+00-1.24533302E-02 3.66379816E-17 1.76129163E-07 +-1.13672879E-20 0.00000000E+00 1.05486642E-08 0.00000000E+00-5.25927667E-10 +-2.43140207E-03 8.90087637E-09 1.14732200E-04-4.50394079E-10 2.37616465E-02 + 0.00000000E+00-1.48997355E-04 0.00000000E+00-2.14205882E-03 5.78556398E-18 + 1.33990042E-05-3.62699786E-20-7.96197663E-05-2.12971603E-19-4.71796873E-04 + 0.00000000E+00 1.04223746E-04 4.61613695E-10-3.88981382E-08 3.90788414E-14 + 0.00000000E+00 5.25659460E-10 0.00000000E+00-2.66262492E-15 1.74357754E-04 + 4.98168046E-19 6.98448486E-04 2.01771928E-18 9.88462489E-04 0.00000000E+00 + 3.95383050E-03 0.00000000E+00-2.58934381E-03-9.86204168E-09-7.74929629E-08 + 6.81815024E-14 0.00000000E+00-1.15877727E-08 0.00000000E+00-1.19214851E-14 + 1.74357292E-04 5.33289100E-19-9.54506083E-05-2.70771179E-19 9.88459711E-04 + 0.00000000E+00-5.16654445E-04 0.00000000E+00 1.31077976E-04 4.37748736E-10 +-3.85909170E-08 2.98458794E-14 0.00000000E+00 5.29624432E-10 0.00000000E+00 +-8.73363976E-15 9.88459711E-04 0.00000000E+00 1.74357292E-04-5.33289100E-19 + 0.00000000E+00-1.05486642E-08 0.00000000E+00-5.48034007E-11 2.43140207E-03 +-8.90087637E-09 1.26906830E-05-4.61823663E-11 8.26648274E-03 0.00000000E+00 + 1.07815807E-03 0.00000000E+00 1.52639589E-03-4.40285609E-18 2.07445141E-04 +-5.49795614E-19 0.00000000E+00-1.05607609E-08 0.00000000E+00 5.48383353E-11 + 2.48489748E-03-8.85948883E-09-1.28450467E-05 4.60629828E-11 2.07444959E-04 + 5.24763247E-19 1.07815489E-03 0.00000000E+00-2.63887208E-03-8.75492317E-09 +-1.37678163E-05-4.54359254E-11 0.00000000E+00-1.06054411E-08 0.00000000E+00 +-5.51058036E-11 1.80246920E-03 4.58484225E-18 2.43375017E-04 6.32968876E-19 + 8.98387553E-03 0.00000000E+00 1.16781088E-03 0.00000000E+00-2.69199655E-03 +-8.72342846E-09 1.39211144E-05 4.53450760E-11 0.00000000E+00-1.06239722E-08 + 0.00000000E+00 5.51592978E-11-5.16654445E-04 0.00000000E+00-9.54506083E-05 + 2.70771179E-19 0.00000000E+00 5.25927667E-10 0.00000000E+00-8.73363976E-15 +-1.14732200E-04 4.50394079E-10 3.85909170E-08 2.98458794E-14 1.07815807E-03 + 0.00000000E+00 4.31261082E-03 0.00000000E+00 2.07445141E-04-5.49795614E-19 + 8.30795284E-04-2.18054789E-18 0.00000000E+00-1.16392346E-08 0.00000000E+00 +-2.24186273E-14 2.81819565E-03-9.68458170E-09 7.68732925E-08 5.20124808E-14 + 1.07815489E-03 0.00000000E+00-5.61491442E-04 0.00000000E+00 2.07444959E-04 +-5.24763247E-19-1.12704994E-04 2.89433031E-19 0.00000000E+00 5.33598173E-10 + 0.00000000E+00-1.33735708E-14-1.41385926E-04 4.32195831E-10 3.83245204E-08 + 2.27123608E-14 3.85909170E-08-2.98458794E-14 0.00000000E+00 8.73363976E-15 + 1.33990042E-05 3.62699786E-20 8.02630135E-08 2.16769351E-22-1.48997355E-04 + 0.00000000E+00-8.90324199E-07 0.00000000E+00-1.28450467E-05-4.60629828E-11 + 7.68732925E-08-5.20124808E-14 0.00000000E+00-5.48383353E-11 0.00000000E+00 + 2.24186273E-14 1.93037599E-07 1.42475808E-20-2.12617232E-07-4.92732594E-22 +-1.11997836E-05 0.00000000E+00 2.28925203E-06 0.00000000E+00 1.37678163E-05 + 4.54359254E-11 3.83245204E-08-2.27123608E-14 0.00000000E+00 5.51058036E-11 + 0.00000000E+00 1.33735708E-14-1.32059932E-05-2.10928737E-20 7.91886548E-08 + 1.33139682E-22 1.37781809E-04 0.00000000E+00-8.27925013E-07 0.00000000E+00 +-1.31077976E-04-4.37748736E-10 0.00000000E+00-5.29624432E-10-2.14205882E-03 +-5.78556398E-18-1.33858377E-05-3.60725331E-20 2.37616465E-02 0.00000000E+00 + 1.48121630E-04 0.00000000E+00 2.48489748E-03 8.85948883E-09 2.81819565E-03 + 9.68458170E-09 0.00000000E+00 1.05607609E-08 0.00000000E+00 1.16392346E-08 +-1.22950604E-02-2.97808459E-17 1.93037599E-07 1.42475808E-20 1.32302292E-01 + 0.00000000E+00-1.11997836E-05 0.00000000E+00 2.63887208E-03 8.75492317E-09 +-1.25153396E-04-4.41818615E-10 0.00000000E+00 1.06054411E-08 0.00000000E+00 +-5.27935488E-10-2.11339860E-03-3.55127505E-18 1.32203969E-05 2.33206372E-20 + 2.20963261E-02 0.00000000E+00-1.38513321E-04 0.00000000E+00 0.00000000E+00 + 8.73363976E-15-3.85909170E-08-2.98458794E-14-1.48997355E-04 0.00000000E+00 +-8.90324199E-07 0.00000000E+00 1.33990042E-05-3.62699786E-20 8.02630135E-08 +-2.16769351E-22 0.00000000E+00-5.48383353E-11 0.00000000E+00 2.24186273E-14 + 1.28450467E-05-4.60629828E-11-7.68732925E-08-5.20124808E-14-1.11997836E-05 + 0.00000000E+00 2.28925203E-06 0.00000000E+00 1.93037599E-07-1.42475808E-20 +-2.12617232E-07 4.92732594E-22 0.00000000E+00 5.51058036E-11 0.00000000E+00 + 1.33735708E-14-1.37678163E-05 4.54359254E-11-3.83245204E-08-2.27123608E-14 + 1.37781809E-04 0.00000000E+00-8.27925013E-07 0.00000000E+00-1.32059932E-05 + 2.10928737E-20 7.91886548E-08-1.33139682E-22 0.00000000E+00-5.29624432E-10 + 1.31077976E-04-4.37748736E-10 2.37616465E-02 0.00000000E+00 1.48121630E-04 + 0.00000000E+00-2.14205882E-03 5.78556398E-18-1.33858377E-05 3.60725331E-20 + 0.00000000E+00 1.05607609E-08 0.00000000E+00 1.16392346E-08-2.48489748E-03 + 8.85948883E-09-2.81819565E-03 9.68458170E-09 1.32302292E-01 0.00000000E+00 +-1.11997836E-05 0.00000000E+00-1.22950604E-02 2.97808459E-17 1.93037599E-07 +-1.42475808E-20 0.00000000E+00 1.06054411E-08 0.00000000E+00-5.27935488E-10 +-2.63887208E-03 8.75492317E-09 1.25153396E-04-4.41818615E-10 2.20963261E-02 + 0.00000000E+00-1.38513321E-04 0.00000000E+00-2.11339860E-03 3.55127505E-18 + 1.32203969E-05-2.33206372E-20-9.54506083E-05-2.70771179E-19-5.16654445E-04 + 0.00000000E+00 1.14732200E-04 4.50394079E-10-3.85909170E-08 2.98458794E-14 + 0.00000000E+00 5.25927667E-10 0.00000000E+00-8.73363976E-15 2.07445141E-04 + 5.49795614E-19 8.30795284E-04 2.18054789E-18 1.07815807E-03 0.00000000E+00 + 4.31261082E-03 0.00000000E+00-2.81819565E-03-9.68458170E-09-7.68732925E-08 + 5.20124808E-14 0.00000000E+00-1.16392346E-08 0.00000000E+00-2.24186273E-14 + 2.07444959E-04 5.24763247E-19-1.12704994E-04-2.89433031E-19 1.07815489E-03 + 0.00000000E+00-5.61491442E-04 0.00000000E+00 1.41385926E-04 4.32195831E-10 +-3.83245204E-08 2.27123608E-14 0.00000000E+00 5.33598173E-10 0.00000000E+00 +-1.33735708E-14 1.07815489E-03 0.00000000E+00 2.07444959E-04-5.24763247E-19 + 0.00000000E+00-1.06054411E-08 0.00000000E+00-5.51058036E-11 2.63887208E-03 +-8.75492317E-09 1.37678163E-05-4.54359254E-11 8.98387553E-03 0.00000000E+00 + 1.16781088E-03 0.00000000E+00 1.80246920E-03-4.58484225E-18 2.43375017E-04 +-6.32968876E-19 0.00000000E+00-1.06239722E-08 0.00000000E+00 5.51592978E-11 + 2.69199655E-03-8.72342846E-09-1.39211144E-05 4.53450760E-11-5.61491442E-04 + 0.00000000E+00-1.12704994E-04 2.89433031E-19 0.00000000E+00 5.27935488E-10 + 0.00000000E+00-1.33735708E-14-1.25153396E-04 4.41818615E-10 3.83245204E-08 + 2.27123608E-14 1.16781088E-03 0.00000000E+00 4.67122038E-03 0.00000000E+00 + 2.43375017E-04-6.32968876E-19 9.74511282E-04-2.54444613E-18 0.00000000E+00 +-1.17182876E-08 0.00000000E+00-3.05899079E-14 3.04541913E-03-9.54955325E-09 + 7.63349838E-08 3.94445105E-14 1.16780757E-03 0.00000000E+00-6.06306212E-04 + 0.00000000E+00 2.43374580E-04-6.31921622E-19-1.31378292E-04 3.51002738E-19 + 0.00000000E+00 5.38469503E-10 0.00000000E+00-1.70042983E-14-1.51605077E-04 + 4.28032469E-10 3.80024474E-08 1.70995149E-14 3.83245204E-08-2.27123608E-14 + 0.00000000E+00 1.33735708E-14 1.32203969E-05 2.33206372E-20 7.91886548E-08 + 1.33139682E-22-1.38513321E-04 0.00000000E+00-8.27925013E-07 0.00000000E+00 +-1.39211144E-05-4.53450760E-11 7.63349838E-08-3.94445105E-14 0.00000000E+00 +-5.51592978E-11 0.00000000E+00 3.05899079E-14 2.10387203E-07 1.26251229E-20 +-2.09623588E-07-2.28855655E-22-9.41028879E-06 0.00000000E+00 2.13653128E-06 + 0.00000000E+00 1.48371365E-05 4.48698372E-11 3.80024474E-08-1.70995149E-14 + 0.00000000E+00 5.55253802E-11 0.00000000E+00 1.70042983E-14-1.30100634E-05 +-1.31984306E-20 7.80178745E-08 7.40888381E-23 1.29091637E-04 0.00000000E+00 +-7.75504011E-07 0.00000000E+00-1.41385926E-04-4.32195831E-10 0.00000000E+00 +-5.33598173E-10-2.11339860E-03-3.55127505E-18-1.32059932E-05-2.10928737E-20 + 2.20963261E-02 0.00000000E+00 1.37781809E-04 0.00000000E+00 2.69199655E-03 + 8.72342846E-09 3.04541913E-03 9.54955325E-09 0.00000000E+00 1.06239722E-08 + 0.00000000E+00 1.17182876E-08-1.21220171E-02-1.10124393E-17 2.10387203E-07 + 1.26251229E-20 1.23487430E-01 0.00000000E+00-9.41028879E-06 0.00000000E+00 + 2.84485003E-03 8.64418136E-09-1.35508610E-04-4.35277222E-10 0.00000000E+00 + 1.06851002E-08 0.00000000E+00-5.31268476E-10-2.08216485E-03-1.99250507E-18 + 1.30256966E-05 1.16577281E-20 2.06973251E-02 0.00000000E+00-1.29709718E-04 + 0.00000000E+00 0.00000000E+00 1.33735708E-14-3.83245204E-08-2.27123608E-14 +-1.38513321E-04 0.00000000E+00-8.27925013E-07 0.00000000E+00 1.32203969E-05 +-2.33206372E-20 7.91886548E-08-1.33139682E-22 0.00000000E+00-5.51592978E-11 + 0.00000000E+00 3.05899079E-14 1.39211144E-05-4.53450760E-11-7.63349838E-08 +-3.94445105E-14-9.41028879E-06 0.00000000E+00 2.13653128E-06 0.00000000E+00 + 2.10387203E-07-1.26251229E-20-2.09623588E-07 2.28855655E-22 0.00000000E+00 + 5.55253802E-11 0.00000000E+00 1.70042983E-14-1.48371365E-05 4.48698372E-11 +-3.80024474E-08-1.70995149E-14 1.29091637E-04 0.00000000E+00-7.75504011E-07 + 0.00000000E+00-1.30100634E-05 1.31984306E-20 7.80178745E-08-7.40888381E-23 + 0.00000000E+00-5.33598173E-10 1.41385926E-04-4.32195831E-10 2.20963261E-02 + 0.00000000E+00 1.37781809E-04 0.00000000E+00-2.11339860E-03 3.55127505E-18 +-1.32059932E-05 2.10928737E-20 0.00000000E+00 1.06239722E-08 0.00000000E+00 + 1.17182876E-08-2.69199655E-03 8.72342846E-09-3.04541913E-03 9.54955325E-09 + 1.23487430E-01 0.00000000E+00-9.41028879E-06 0.00000000E+00-1.21220171E-02 + 1.10124393E-17 2.10387203E-07-1.26251229E-20 0.00000000E+00 1.06851002E-08 + 0.00000000E+00-5.31268476E-10-2.84485003E-03 8.64418136E-09 1.35508610E-04 +-4.35277222E-10 2.06973251E-02 0.00000000E+00-1.29709718E-04 0.00000000E+00 +-2.08216485E-03 1.99250507E-18 1.30256966E-05-1.16577281E-20-1.12704994E-04 +-2.89433031E-19-5.61491442E-04 0.00000000E+00 1.25153396E-04 4.41818615E-10 +-3.83245204E-08 2.27123608E-14 0.00000000E+00 5.27935488E-10 0.00000000E+00 +-1.33735708E-14 2.43375017E-04 6.32968876E-19 9.74511282E-04 2.54444613E-18 + 1.16781088E-03 0.00000000E+00 4.67122038E-03 0.00000000E+00-3.04541913E-03 +-9.54955325E-09-7.63349838E-08 3.94445105E-14 0.00000000E+00-1.17182876E-08 + 0.00000000E+00-3.05899079E-14 2.43374580E-04 6.31921622E-19-1.31378292E-04 +-3.51002738E-19 1.16780757E-03 0.00000000E+00-6.06306212E-04 0.00000000E+00 + 1.51605077E-04 4.28032469E-10-3.80024474E-08 1.70995149E-14 0.00000000E+00 + 5.38469503E-10 0.00000000E+00-1.70042983E-14 2.43374580E-04 6.31921622E-19 + 1.16780757E-03 0.00000000E+00-2.84485003E-03-8.64418136E-09-1.48371365E-05 +-4.48698372E-11 0.00000000E+00-1.06851002E-08 0.00000000E+00-5.55253802E-11 + 2.10124433E-03 5.53047307E-18 2.82138588E-04 7.72089328E-19 9.70091323E-03 + 0.00000000E+00 1.25741728E-03 0.00000000E+00-2.89752942E-03-8.62046978E-09 + 1.49891463E-05 4.48014391E-11 0.00000000E+00-1.07086662E-08 0.00000000E+00 + 5.55933974E-11 1.16780757E-03 0.00000000E+00 2.43374580E-04-6.31921622E-19 + 0.00000000E+00-1.06851002E-08 0.00000000E+00-5.55253802E-11 2.84485003E-03 +-8.64418136E-09 1.48371365E-05-4.48698372E-11 9.70091323E-03 0.00000000E+00 + 1.25741728E-03 0.00000000E+00 2.10124433E-03-5.53047307E-18 2.82138588E-04 +-7.72089328E-19 0.00000000E+00-1.07086662E-08 0.00000000E+00 5.55933974E-11 + 2.89752942E-03-8.62046978E-09-1.49891463E-05 4.48014391E-11-6.06306212E-04 + 0.00000000E+00-1.31378292E-04 3.51002738E-19 0.00000000E+00 5.31268476E-10 + 0.00000000E+00-1.70042983E-14-1.35508610E-04 4.35277222E-10 3.80024474E-08 + 1.70995149E-14 1.25741728E-03 0.00000000E+00 5.02964385E-03 0.00000000E+00 + 2.82138588E-04-7.72089328E-19 1.12956210E-03-3.28844099E-18 0.00000000E+00 +-1.18189280E-08 0.00000000E+00-3.70281006E-14 3.27076562E-03-9.44788919E-09 + 7.56466487E-08 2.94407191E-14 1.25741363E-03 0.00000000E+00-6.51096662E-04 + 0.00000000E+00 2.82138175E-04-8.11303685E-19-1.51466120E-04 5.34741855E-19 + 0.00000000E+00 5.44058945E-10 0.00000000E+00-1.98911406E-14-1.61730357E-04 + 4.24993099E-10 3.76634793E-08 1.25978857E-14 2.82138175E-04 8.11303685E-19 + 1.25741363E-03 0.00000000E+00-3.04903069E-03-8.56134845E-09-1.58970706E-05 +-4.44468673E-11 0.00000000E+00-1.07827550E-08 0.00000000E+00-5.60371871E-11 + 2.42265246E-03 8.75789359E-18 3.23726305E-04 1.32766374E-18 1.04175612E-02 + 0.00000000E+00 1.34697302E-03 0.00000000E+00-3.10123950E-03-8.54387892E-09 + 1.60477245E-05 4.43964758E-11 0.00000000E+00-1.08103240E-08 0.00000000E+00 + 5.61167517E-11 1.25741363E-03 0.00000000E+00 2.82138175E-04-8.11303685E-19 + 0.00000000E+00-1.07827550E-08 0.00000000E+00-5.60371871E-11 3.04903069E-03 +-8.56134845E-09 1.58970706E-05-4.44468673E-11 1.04175612E-02 0.00000000E+00 + 1.34697302E-03 0.00000000E+00 2.42265246E-03-8.75789359E-18 3.23726305E-04 +-1.32766374E-18 0.00000000E+00-1.08103240E-08 0.00000000E+00 5.61167517E-11 + 3.10123950E-03-8.54387892E-09-1.60477245E-05 4.43964758E-11 3.80024474E-08 +-1.70995149E-14 0.00000000E+00 1.70042983E-14 1.30256966E-05 1.16577281E-20 + 7.80178745E-08 7.40888381E-23-1.29709718E-04 0.00000000E+00-7.75504011E-07 + 0.00000000E+00-1.49891463E-05-4.48014391E-11 7.56466487E-08-2.94407191E-14 + 0.00000000E+00-5.55933974E-11 0.00000000E+00 3.70281006E-14 2.28020220E-07 +-3.43926934E-20-2.06371427E-07-4.29616696E-22-7.98964483E-06 0.00000000E+00 + 2.00757411E-06 0.00000000E+00 1.58970706E-05 4.44468673E-11 3.76634793E-08 +-1.25978857E-14 0.00000000E+00 5.60371871E-11 0.00000000E+00 1.98911406E-14 +-1.27977089E-05-4.29202180E-20 7.67488761E-08 2.51698641E-22 1.21711757E-04 + 0.00000000E+00-7.31002786E-07 0.00000000E+00-1.51605077E-04-4.28032469E-10 + 0.00000000E+00-5.38469503E-10-2.08216485E-03-1.99250507E-18-1.30100634E-05 +-1.31984306E-20 2.06973251E-02 0.00000000E+00 1.29091637E-04 0.00000000E+00 + 2.89752942E-03 8.62046978E-09 3.27076562E-03 9.44788919E-09 0.00000000E+00 + 1.07086662E-08 0.00000000E+00 1.18189280E-08-1.19340750E-02-2.46532340E-17 + 2.28020220E-07-3.43926934E-20 1.16042443E-01 0.00000000E+00-7.98964483E-06 + 0.00000000E+00 3.04903069E-03 8.56134845E-09-1.45777630E-04-4.30330663E-10 + 0.00000000E+00 1.07827550E-08 0.00000000E+00-5.35634828E-10-2.04830933E-03 +-6.70620426E-18 1.28146407E-05 4.09783729E-20 1.95097008E-02 0.00000000E+00 +-1.22238909E-04 0.00000000E+00 0.00000000E+00 1.70042983E-14-3.80024474E-08 +-1.70995149E-14-1.29709718E-04 0.00000000E+00-7.75504011E-07 0.00000000E+00 + 1.30256966E-05-1.16577281E-20 7.80178745E-08-7.40888381E-23 0.00000000E+00 +-5.55933974E-11 0.00000000E+00 3.70281006E-14 1.49891463E-05-4.48014391E-11 +-7.56466487E-08-2.94407191E-14-7.98964483E-06 0.00000000E+00 2.00757411E-06 + 0.00000000E+00 2.28020220E-07 3.43926934E-20-2.06371427E-07 4.29616696E-22 + 0.00000000E+00 5.60371871E-11 0.00000000E+00 1.98911406E-14-1.58970706E-05 + 4.44468673E-11-3.76634793E-08-1.25978857E-14 1.21711757E-04 0.00000000E+00 +-7.31002786E-07 0.00000000E+00-1.27977089E-05 4.29202180E-20 7.67488761E-08 +-2.51698641E-22 0.00000000E+00-5.38469503E-10 1.51605077E-04-4.28032469E-10 + 2.06973251E-02 0.00000000E+00 1.29091637E-04 0.00000000E+00-2.08216485E-03 + 1.99250507E-18-1.30100634E-05 1.31984306E-20 0.00000000E+00 1.07086662E-08 + 0.00000000E+00 1.18189280E-08-2.89752942E-03 8.62046978E-09-3.27076562E-03 + 9.44788919E-09 1.16042443E-01 0.00000000E+00-7.98964483E-06 0.00000000E+00 +-1.19340750E-02 2.46532340E-17 2.28020220E-07 3.43926934E-20 0.00000000E+00 + 1.07827550E-08 0.00000000E+00-5.35634828E-10-3.04903069E-03 8.56134845E-09 + 1.45777630E-04-4.30330663E-10 1.95097008E-02 0.00000000E+00-1.22238909E-04 + 0.00000000E+00-2.04830933E-03 6.70620426E-18 1.28146407E-05-4.09783729E-20 +-1.31378292E-04-3.51002738E-19-6.06306212E-04 0.00000000E+00 1.35508610E-04 + 4.35277222E-10-3.80024474E-08 1.70995149E-14 0.00000000E+00 5.31268476E-10 + 0.00000000E+00-1.70042983E-14 2.82138588E-04 7.72089328E-19 1.12956210E-03 + 3.28844099E-18 1.25741728E-03 0.00000000E+00 5.02964385E-03 0.00000000E+00 +-3.27076562E-03-9.44788919E-09-7.56466487E-08 2.94407191E-14 0.00000000E+00 +-1.18189280E-08 0.00000000E+00-3.70281006E-14 2.82138175E-04 8.11303685E-19 +-1.51466120E-04-5.34741855E-19 1.25741363E-03 0.00000000E+00-6.51096662E-04 + 0.00000000E+00 1.61730357E-04 4.24993099E-10-3.76634793E-08 1.25978857E-14 + 0.00000000E+00 5.44058945E-10 0.00000000E+00-1.98911406E-14 3.23725834E-04 + 1.26781654E-18 1.34696922E-03 0.00000000E+00-3.25129741E-03-8.50102492E-09 +-1.69469912E-05-4.41394323E-11 0.00000000E+00-1.08947944E-08 0.00000000E+00 +-5.66227794E-11 2.76661534E-03 7.12396288E-18 3.68128609E-04 5.55190955E-19 + 1.11337972E-02 0.00000000E+00 1.43647611E-03 0.00000000E+00-3.30297491E-03 +-8.48864151E-09 1.70961088E-05 4.41037132E-11 0.00000000E+00-1.09255909E-08 + 0.00000000E+00 5.67116540E-11-6.51096662E-04 0.00000000E+00-1.51466120E-04 + 5.34741855E-19 0.00000000E+00 5.35634828E-10 0.00000000E+00-1.98911406E-14 +-1.45777630E-04 4.30330663E-10 3.76634793E-08 1.25978857E-14 1.34697302E-03 + 0.00000000E+00 5.38786570E-03 0.00000000E+00 3.23726305E-04-1.32766374E-18 + 1.29590944E-03-4.78018708E-18 0.00000000E+00-1.19367238E-08 0.00000000E+00 +-4.21896101E-14 3.49407780E-03-9.37297692E-09 7.49263645E-08 2.13507344E-14 + 1.34696922E-03 0.00000000E+00-6.95861334E-04 0.00000000E+00 3.23725834E-04 +-1.26781654E-18-1.72963611E-04 4.55751874E-19 0.00000000E+00 5.50230901E-10 + 0.00000000E+00-2.22186487E-14-1.71749043E-04 4.22875503E-10 3.72793919E-08 + 8.92976643E-15 3.76634793E-08-1.25978857E-14 0.00000000E+00 1.98911406E-14 + 1.28146407E-05 4.09783729E-20 7.67488761E-08 2.51698641E-22-1.22238909E-04 + 0.00000000E+00-7.31002786E-07 0.00000000E+00-1.60477245E-05-4.43964758E-11 + 7.49263645E-08-2.13507344E-14 0.00000000E+00-5.61167517E-11 0.00000000E+00 + 4.21896101E-14 2.46097715E-07 2.32231158E-21-2.02853091E-07-7.06928642E-22 +-6.84203184E-06 0.00000000E+00 1.89763750E-06 0.00000000E+00 1.69469912E-05 + 4.41394323E-11 3.72793919E-08-8.92976643E-15 0.00000000E+00 5.66227794E-11 + 0.00000000E+00 2.22186487E-14-1.25685853E-05-3.95345132E-20 7.53793275E-08 + 2.42638388E-22 1.15390673E-04 0.00000000E+00-6.92897588E-07 0.00000000E+00 +-1.61730357E-04-4.24993099E-10 0.00000000E+00-5.44058945E-10-2.04830933E-03 +-6.70620426E-18-1.27977089E-05-4.29202180E-20 1.95097008E-02 0.00000000E+00 + 1.21711757E-04 0.00000000E+00 3.10123950E-03 8.54387892E-09 3.49407780E-03 + 9.37297692E-09 0.00000000E+00 1.08103240E-08 0.00000000E+00 1.19367238E-08 +-1.17306786E-02-4.31229726E-17 2.46097715E-07 2.32231158E-21 1.09694486E-01 + 0.00000000E+00-6.84203184E-06 0.00000000E+00 3.25129741E-03 8.50102492E-09 +-1.55958714E-04-4.26659052E-10 0.00000000E+00 1.08947944E-08 0.00000000E+00 +-5.40820677E-10-2.01176991E-03-6.47188920E-18 1.25867966E-05 4.14052631E-20 + 1.84927822E-02 0.00000000E+00-1.15843841E-04 0.00000000E+00 0.00000000E+00 + 1.98911406E-14-3.76634793E-08-1.25978857E-14-1.22238909E-04 0.00000000E+00 +-7.31002786E-07 0.00000000E+00 1.28146407E-05-4.09783729E-20 7.67488761E-08 +-2.51698641E-22 0.00000000E+00-5.61167517E-11 0.00000000E+00 4.21896101E-14 + 1.60477245E-05-4.43964758E-11-7.49263645E-08-2.13507344E-14-6.84203184E-06 + 0.00000000E+00 1.89763750E-06 0.00000000E+00 2.46097715E-07-2.32231158E-21 +-2.02853091E-07 7.06928642E-22 0.00000000E+00 5.66227794E-11 0.00000000E+00 + 2.22186487E-14-1.69469912E-05 4.41394323E-11-3.72793919E-08-8.92976643E-15 + 1.15390673E-04 0.00000000E+00-6.92897588E-07 0.00000000E+00-1.25685853E-05 + 3.95345132E-20 7.53793275E-08-2.42638388E-22 0.00000000E+00-5.44058945E-10 + 1.61730357E-04-4.24993099E-10 1.95097008E-02 0.00000000E+00 1.21711757E-04 + 0.00000000E+00-2.04830933E-03 6.70620426E-18-1.27977089E-05 4.29202180E-20 + 0.00000000E+00 1.08103240E-08 0.00000000E+00 1.19367238E-08-3.10123950E-03 + 8.54387892E-09-3.49407780E-03 9.37297692E-09 1.09694486E-01 0.00000000E+00 +-6.84203184E-06 0.00000000E+00-1.17306786E-02 4.31229726E-17 2.46097715E-07 +-2.32231158E-21 0.00000000E+00 1.08947944E-08 0.00000000E+00-5.40820677E-10 +-3.25129741E-03 8.50102492E-09 1.55958714E-04-4.26659052E-10 1.84927822E-02 + 0.00000000E+00-1.15843841E-04 0.00000000E+00-2.01176991E-03 6.47188920E-18 + 1.25867966E-05-4.14052631E-20-1.51466120E-04-5.34741855E-19-6.51096662E-04 + 0.00000000E+00 1.45777630E-04 4.30330663E-10-3.76634793E-08 1.25978857E-14 + 0.00000000E+00 5.35634828E-10 0.00000000E+00-1.98911406E-14 3.23726305E-04 + 1.32766374E-18 1.29590944E-03 4.78018708E-18 1.34697302E-03 0.00000000E+00 + 5.38786570E-03 0.00000000E+00-3.49407780E-03-9.37297692E-09-7.49263645E-08 + 2.13507344E-14 0.00000000E+00-1.19367238E-08 0.00000000E+00-4.21896101E-14 + 3.23725834E-04 1.26781654E-18-1.72963611E-04-4.55751874E-19 1.34696922E-03 + 0.00000000E+00-6.95861334E-04 0.00000000E+00 1.71749043E-04 4.22875503E-10 +-3.72793919E-08 8.92976643E-15 0.00000000E+00 5.50230901E-10 0.00000000E+00 +-2.22186487E-14 1.34696922E-03 0.00000000E+00 3.23725834E-04-1.26781654E-18 + 0.00000000E+00-1.08947944E-08 0.00000000E+00-5.66227794E-11 3.25129741E-03 +-8.50102492E-09 1.69469912E-05-4.41394323E-11 1.11337972E-02 0.00000000E+00 + 1.43647611E-03 0.00000000E+00 2.76661534E-03-7.12396288E-18 3.68128609E-04 +-5.55190955E-19 0.00000000E+00-1.09255909E-08 0.00000000E+00 5.67116540E-11 + 3.30297491E-03-8.48864151E-09-1.70961088E-05 4.41037132E-11-6.95861334E-04 + 0.00000000E+00-1.72963611E-04 4.55751874E-19 0.00000000E+00 5.40820677E-10 + 0.00000000E+00-2.22186487E-14-1.55958714E-04 4.26659052E-10 3.72793919E-08 + 8.92976643E-15 1.43647611E-03 0.00000000E+00 5.74587562E-03 0.00000000E+00 + 3.68128609E-04-5.55190955E-19 1.47351440E-03-2.88704980E-18 0.00000000E+00 +-1.20683487E-08 0.00000000E+00-4.63769796E-14 3.71514080E-03-9.31985677E-09 + 7.41636163E-08 1.47074318E-14 1.43647205E-03 0.00000000E+00-7.40598244E-04 + 0.00000000E+00 3.68128129E-04-5.80810553E-19-1.95865443E-04 5.64275917E-19 + 0.00000000E+00 5.56880224E-10 0.00000000E+00-2.41170424E-14-1.81665586E-04 + 4.21524028E-10 3.68997951E-08 5.89839909E-15 3.72793919E-08-8.92976643E-15 + 0.00000000E+00 2.22186487E-14 1.25867966E-05 4.14052631E-20 7.53793275E-08 + 2.42638388E-22-1.15843841E-04 0.00000000E+00-6.92897588E-07 0.00000000E+00 +-1.70961088E-05-4.41037132E-11 7.41636163E-08-1.47074318E-14 0.00000000E+00 +-5.67116540E-11 0.00000000E+00 4.63769796E-14 2.64495715E-07 1.79145733E-20 +-1.99065335E-07-4.98100924E-22-5.90087459E-06 0.00000000E+00 1.80317145E-06 + 0.00000000E+00 1.79862208E-05 4.39267051E-11 3.68997951E-08-5.89839909E-15 + 0.00000000E+00 5.72681494E-11 0.00000000E+00 2.41170424E-14-1.23223407E-05 +-2.37876803E-20 7.39073918E-08 1.44172742E-22 1.09938252E-04 0.00000000E+00 +-6.60036696E-07 0.00000000E+00-1.71749043E-04-4.22875503E-10 0.00000000E+00 +-5.50230901E-10-2.01176991E-03-6.47188920E-18-1.25685853E-05-3.95345132E-20 + 1.84927822E-02 0.00000000E+00 1.15390673E-04 0.00000000E+00 3.30297491E-03 + 8.48864151E-09 3.71514080E-03 9.31985677E-09 0.00000000E+00 1.09255909E-08 + 0.00000000E+00 1.20683487E-08-1.15117617E-02-2.78217796E-17 2.64495715E-07 + 1.79145733E-20 1.04238974E-01 0.00000000E+00-5.90087459E-06 0.00000000E+00 + 3.45150634E-03 8.45913781E-09-1.66036261E-04-4.24023350E-10 0.00000000E+00 + 1.10184801E-08 0.00000000E+00-5.46665712E-10-1.97249744E-03-3.84820126E-18 + 1.23419019E-05 2.43289212E-20 1.76158288E-02 0.00000000E+00-1.10330270E-04 + 0.00000000E+00 0.00000000E+00 2.22186487E-14-3.72793919E-08-8.92976643E-15 +-1.15843841E-04 0.00000000E+00-6.92897588E-07 0.00000000E+00 1.25867966E-05 +-4.14052631E-20 7.53793275E-08-2.42638388E-22 0.00000000E+00-5.67116540E-11 + 0.00000000E+00 4.63769796E-14 1.70961088E-05-4.41037132E-11-7.41636163E-08 +-1.47074318E-14-5.90087459E-06 0.00000000E+00 1.80317145E-06 0.00000000E+00 + 2.64495715E-07-1.79145733E-20-1.99065335E-07 4.98100924E-22 0.00000000E+00 + 5.72681494E-11 0.00000000E+00 2.41170424E-14-1.79862208E-05 4.39267051E-11 +-3.68997951E-08-5.89839909E-15 1.09938252E-04 0.00000000E+00-6.60036696E-07 + 0.00000000E+00-1.23223407E-05 2.37876803E-20 7.39073918E-08-1.44172742E-22 + 0.00000000E+00-5.50230901E-10 1.71749043E-04-4.22875503E-10 1.84927822E-02 + 0.00000000E+00 1.15390673E-04 0.00000000E+00-2.01176991E-03 6.47188920E-18 +-1.25685853E-05 3.95345132E-20 0.00000000E+00 1.09255909E-08 0.00000000E+00 + 1.20683487E-08-3.30297491E-03 8.48864151E-09-3.71514080E-03 9.31985677E-09 + 1.04238974E-01 0.00000000E+00-5.90087459E-06 0.00000000E+00-1.15117617E-02 + 2.78217796E-17 2.64495715E-07-1.79145733E-20 0.00000000E+00 1.10184801E-08 + 0.00000000E+00-5.46665712E-10-3.45150634E-03 8.45913781E-09 1.66036261E-04 +-4.24023350E-10 1.76158288E-02 0.00000000E+00-1.10330270E-04 0.00000000E+00 +-1.97249744E-03 3.84820126E-18 1.23419019E-05-2.43289212E-20-1.72963611E-04 +-4.55751874E-19-6.95861334E-04 0.00000000E+00 1.55958714E-04 4.26659052E-10 +-3.72793919E-08 8.92976643E-15 0.00000000E+00 5.40820677E-10 0.00000000E+00 +-2.22186487E-14 3.68128609E-04 5.55190955E-19 1.47351440E-03 2.88704980E-18 + 1.43647611E-03 0.00000000E+00 5.74587562E-03 0.00000000E+00-3.71514080E-03 +-9.31985677E-09-7.41636163E-08 1.47074318E-14 0.00000000E+00-1.20683487E-08 + 0.00000000E+00-4.63769796E-14 3.68128129E-04 5.80810553E-19-1.95865443E-04 +-5.64275917E-19 1.43647205E-03 0.00000000E+00-7.40598244E-04 0.00000000E+00 + 1.81665586E-04 4.21524028E-10-3.68997951E-08 5.89839909E-15 0.00000000E+00 + 5.56880224E-10 0.00000000E+00-2.41170424E-14 3.68128129E-04 5.80810553E-19 + 1.43647205E-03 0.00000000E+00-3.45150634E-03-8.45913781E-09-1.79862208E-05 +-4.39267051E-11 0.00000000E+00-1.10184801E-08 0.00000000E+00-5.72681494E-11 + 3.13304813E-03 8.92048627E-18 4.15333644E-04 1.67629312E-18 1.18495888E-02 + 0.00000000E+00 1.52592093E-03 0.00000000E+00-3.50265672E-03-8.45095751E-09 + 1.81338199E-05 4.39031115E-11 0.00000000E+00-1.10519090E-08 0.00000000E+00 + 5.73646176E-11 1.43647205E-03 0.00000000E+00 3.68128129E-04-5.80810553E-19 + 0.00000000E+00-1.10184801E-08 0.00000000E+00-5.72681494E-11 3.45150634E-03 +-8.45913781E-09 1.79862208E-05-4.39267051E-11 1.18495888E-02 0.00000000E+00 + 1.52592093E-03 0.00000000E+00 3.13304813E-03-8.92048627E-18 4.15333644E-04 +-1.67629312E-18 0.00000000E+00-1.10519090E-08 0.00000000E+00 5.73646176E-11 + 3.50265672E-03-8.45095751E-09-1.81338199E-05 4.39031115E-11-7.40598244E-04 + 0.00000000E+00-1.95865443E-04 5.64275917E-19 0.00000000E+00 5.46665712E-10 + 0.00000000E+00-2.41170424E-14-1.66036261E-04 4.24023350E-10 3.68997951E-08 + 5.89839909E-15 1.52592093E-03 0.00000000E+00 6.10365349E-03 0.00000000E+00 + 4.15333644E-04-1.67629312E-18 1.66233002E-03-6.43442002E-18 0.00000000E+00 +-1.22112503E-08 0.00000000E+00-4.98096972E-14 3.93392151E-03-9.28474198E-09 + 7.33441126E-08 9.18088977E-15 1.52591665E-03 0.00000000E+00-7.85305380E-04 + 0.00000000E+00 4.15333043E-04-1.76402520E-18-2.20165578E-04 8.35961293E-19 + 0.00000000E+00 5.63923989E-10 0.00000000E+00-2.56797500E-14-1.91459882E-04 + 4.20816698E-10 3.64622149E-08 3.36201191E-15 4.15333043E-04 1.76402520E-18 + 1.52591665E-03 0.00000000E+00-3.64955124E-03-8.43255509E-09-1.90141172E-05 +-4.37926529E-11 0.00000000E+00-1.11516971E-08 0.00000000E+00-5.79624676E-11 + 3.52185359E-03 1.38755457E-17 4.65329269E-04 1.57981997E-18 1.25649040E-02 + 0.00000000E+00 1.61530488E-03 0.00000000E+00-3.70009598E-03-8.42789154E-09 + 1.91599660E-05 4.37792048E-11 0.00000000E+00-1.11872928E-08 0.00000000E+00 + 5.80651866E-11 1.52591665E-03 0.00000000E+00 4.15333043E-04-1.76402520E-18 + 0.00000000E+00-1.11516971E-08 0.00000000E+00-5.79624676E-11 3.64955124E-03 +-8.43255509E-09 1.90141172E-05-4.37926529E-11 1.25649040E-02 0.00000000E+00 + 1.61530488E-03 0.00000000E+00 3.52185359E-03-1.38755457E-17 4.65329269E-04 +-1.57981997E-18 0.00000000E+00-1.11872928E-08 0.00000000E+00 5.80651866E-11 + 3.70009598E-03-8.42789154E-09-1.91599660E-05 4.37792048E-11 3.68997951E-08 +-5.89839909E-15 0.00000000E+00 2.41170424E-14 1.23419019E-05 2.43289212E-20 + 7.39073918E-08 1.44172742E-22-1.10330270E-04 0.00000000E+00-6.60036696E-07 + 0.00000000E+00-1.81338199E-05-4.39031115E-11 7.33441126E-08-9.18088977E-15 + 0.00000000E+00-5.73646176E-11 0.00000000E+00 4.98096972E-14 2.83345973E-07 + 1.26415898E-20-1.95000192E-07-3.01744738E-22-5.11907894E-06 0.00000000E+00 + 1.72147256E-06 0.00000000E+00 1.90141172E-05 4.37926529E-11 3.64622149E-08 +-3.36201191E-15 0.00000000E+00 5.79624676E-11 0.00000000E+00 2.56797500E-14 +-1.20585864E-05-1.33545378E-20 7.23305194E-08 8.13119891E-23 1.05207588E-04 + 0.00000000E+00-6.31531561E-07 0.00000000E+00-1.81665586E-04-4.21524028E-10 + 0.00000000E+00-5.56880224E-10-1.97249744E-03-3.84820126E-18-1.23223407E-05 +-2.37876803E-20 1.76158288E-02 0.00000000E+00 1.09938252E-04 0.00000000E+00 + 3.50265672E-03 8.45095751E-09 3.93392151E-03 9.28474198E-09 0.00000000E+00 + 1.10519090E-08 0.00000000E+00 1.22112503E-08-1.12767511E-02-1.77022987E-17 + 2.83345973E-07 1.26415898E-20 9.95203325E-02 0.00000000E+00-5.11907894E-06 + 0.00000000E+00 3.64955124E-03 8.43255509E-09-1.76015660E-04-4.22241502E-10 + 0.00000000E+00 1.11516971E-08 0.00000000E+00-5.53047405E-10-1.93042383E-03 +-2.18145898E-18 1.20794945E-05 1.38789059E-20 1.68551253E-02 0.00000000E+00 +-1.05548562E-04 0.00000000E+00 0.00000000E+00 2.41170424E-14-3.68997951E-08 +-5.89839909E-15-1.10330270E-04 0.00000000E+00-6.60036696E-07 0.00000000E+00 + 1.23419019E-05-2.43289212E-20 7.39073918E-08-1.44172742E-22 0.00000000E+00 +-5.73646176E-11 0.00000000E+00 4.98096972E-14 1.81338199E-05-4.39031115E-11 +-7.33441126E-08-9.18088977E-15-5.11907894E-06 0.00000000E+00 1.72147256E-06 + 0.00000000E+00 2.83345973E-07-1.26415898E-20-1.95000192E-07 3.01744738E-22 + 0.00000000E+00 5.79624676E-11 0.00000000E+00 2.56797500E-14-1.90141172E-05 + 4.37926529E-11-3.64622149E-08-3.36201191E-15 1.05207588E-04 0.00000000E+00 +-6.31531561E-07 0.00000000E+00-1.20585864E-05 1.33545378E-20 7.23305194E-08 +-8.13119891E-23 0.00000000E+00-5.56880224E-10 1.81665586E-04-4.21524028E-10 + 1.76158288E-02 0.00000000E+00 1.09938252E-04 0.00000000E+00-1.97249744E-03 + 3.84820126E-18-1.23223407E-05 2.37876803E-20 0.00000000E+00 1.10519090E-08 + 0.00000000E+00 1.22112503E-08-3.50265672E-03 8.45095751E-09-3.93392151E-03 + 9.28474198E-09 9.95203325E-02 0.00000000E+00-5.11907894E-06 0.00000000E+00 +-1.12767511E-02 1.77022987E-17 2.83345973E-07-1.26415898E-20 0.00000000E+00 + 1.11516971E-08 0.00000000E+00-5.53047405E-10-3.64955124E-03 8.43255509E-09 + 1.76015660E-04-4.22241502E-10 1.68551253E-02 0.00000000E+00-1.05548562E-04 + 0.00000000E+00-1.93042383E-03 2.18145898E-18 1.20794945E-05-1.38789059E-20 +-1.95865443E-04-5.64275917E-19-7.40598244E-04 0.00000000E+00 1.66036261E-04 + 4.24023350E-10-3.68997951E-08 5.89839909E-15 0.00000000E+00 5.46665712E-10 + 0.00000000E+00-2.41170424E-14 4.15333644E-04 1.67629312E-18 1.66233002E-03 + 6.43442002E-18 1.52592093E-03 0.00000000E+00 6.10365349E-03 0.00000000E+00 +-3.93392151E-03-9.28474198E-09-7.33441126E-08 9.18088977E-15 0.00000000E+00 +-1.22112503E-08 0.00000000E+00-4.98096972E-14 4.15333043E-04 1.76402520E-18 +-2.20165578E-04-8.35961293E-19 1.52591665E-03 0.00000000E+00-7.85305380E-04 + 0.00000000E+00 1.91459882E-04 4.20816698E-10-3.64622149E-08 3.36201191E-15 + 0.00000000E+00 5.63923989E-10 0.00000000E+00-2.56797500E-14 4.65328646E-04 + 1.33246043E-18 1.61530033E-03 0.00000000E+00-3.84521018E-03-8.41883253E-09 +-2.00295875E-05-4.37247553E-11 0.00000000E+00-1.12927844E-08 0.00000000E+00 +-5.86972220E-11 3.93293580E-03 8.91777861E-18 5.18103266E-04 1.10082855E-18 + 1.32797144E-02 0.00000000E+00 1.70462352E-03 0.00000000E+00-3.89512752E-03 +-8.41714598E-09 2.01736269E-05 4.37198958E-11 0.00000000E+00-1.13301786E-08 + 0.00000000E+00 5.88051293E-11-7.85305380E-04 0.00000000E+00-2.20165578E-04 + 8.35961293E-19 0.00000000E+00 5.53047405E-10 0.00000000E+00-2.56797500E-14 +-1.76015660E-04 4.22241502E-10 3.64622149E-08 3.36201191E-15 1.61530488E-03 + 0.00000000E+00 6.46118722E-03 0.00000000E+00 4.65329269E-04-1.57981997E-18 + 1.86230810E-03-5.81810205E-18 0.00000000E+00-1.23634338E-08 0.00000000E+00 +-5.26484579E-14 4.15013013E-03-9.26469057E-09 7.24546433E-08 4.52753388E-15 + 1.61530033E-03 0.00000000E+00-8.29980962E-04 0.00000000E+00 4.65328646E-04 +-1.33246043E-18-2.45857978E-04 6.08322244E-19 0.00000000E+00 5.71296242E-10 + 0.00000000E+00-2.69768252E-14-2.01131067E-04 4.20657123E-10 3.60098416E-08 + 1.21486113E-15 3.64622149E-08-3.36201191E-15 0.00000000E+00 2.56797500E-14 + 1.20794945E-05 1.38789059E-20 7.23305194E-08 8.13119891E-23-1.05548562E-04 + 0.00000000E+00-6.31531561E-07 0.00000000E+00-1.91599660E-05-4.37792048E-11 + 7.24546433E-08-4.52753388E-15 0.00000000E+00-5.80651866E-11 0.00000000E+00 + 5.26484579E-14 3.02635863E-07-1.80826479E-20-1.90652855E-07-3.03340164E-22 +-4.46217208E-06 0.00000000E+00 1.65043337E-06 0.00000000E+00 2.00295875E-05 + 4.37247553E-11 3.60098416E-08-1.21486113E-15 0.00000000E+00 5.86972220E-11 + 0.00000000E+00 2.69768252E-14-1.17768914E-05-2.87671283E-20 7.06463208E-08 + 1.67578564E-22 1.01083591E-04 0.00000000E+00-6.06685783E-07 0.00000000E+00 +-1.91459882E-04-4.20816698E-10 0.00000000E+00-5.63923989E-10-1.93042383E-03 +-2.18145898E-18-1.20585864E-05-1.33545378E-20 1.68551253E-02 0.00000000E+00 + 1.05207588E-04 0.00000000E+00 3.70009598E-03 8.42789154E-09 4.15013013E-03 + 9.26469057E-09 0.00000000E+00 1.11872928E-08 0.00000000E+00 1.23634338E-08 +-1.10254615E-02-1.61178246E-17 3.02635863E-07-1.80826479E-20 9.54169155E-02 + 0.00000000E+00-4.46217208E-06 0.00000000E+00 3.84521018E-03 8.41883253E-09 +-1.85878524E-04-4.21172319E-10 0.00000000E+00 1.12927844E-08 0.00000000E+00 +-5.59870131E-10-1.88548525E-03-4.46330207E-18 1.17992074E-05 2.70774355E-20 + 1.61920851E-02 0.00000000E+00-1.01381395E-04 0.00000000E+00 0.00000000E+00 + 2.56797500E-14-3.64622149E-08-3.36201191E-15-1.05548562E-04 0.00000000E+00 +-6.31531561E-07 0.00000000E+00 1.20794945E-05-1.38789059E-20 7.23305194E-08 +-8.13119891E-23 0.00000000E+00-5.80651866E-11 0.00000000E+00 5.26484579E-14 + 1.91599660E-05-4.37792048E-11-7.24546433E-08-4.52753388E-15-4.46217208E-06 + 0.00000000E+00 1.65043337E-06 0.00000000E+00 3.02635863E-07 1.80826479E-20 +-1.90652855E-07 3.03340164E-22 0.00000000E+00 5.86972220E-11 0.00000000E+00 + 2.69768252E-14-2.00295875E-05 4.37247553E-11-3.60098416E-08-1.21486113E-15 + 1.01083591E-04 0.00000000E+00-6.06685783E-07 0.00000000E+00-1.17768914E-05 + 2.87671283E-20 7.06463208E-08-1.67578564E-22 0.00000000E+00-5.63923989E-10 + 1.91459882E-04-4.20816698E-10 1.68551253E-02 0.00000000E+00 1.05207588E-04 + 0.00000000E+00-1.93042383E-03 2.18145898E-18-1.20585864E-05 1.33545378E-20 + 0.00000000E+00 1.11872928E-08 0.00000000E+00 1.23634338E-08-3.70009598E-03 + 8.42789154E-09-4.15013013E-03 9.26469057E-09 9.54169155E-02 0.00000000E+00 +-4.46217208E-06 0.00000000E+00-1.10254615E-02 1.61178246E-17 3.02635863E-07 + 1.80826479E-20 0.00000000E+00 1.12927844E-08 0.00000000E+00-5.59870131E-10 +-3.84521018E-03 8.41883253E-09 1.85878524E-04-4.21172319E-10 1.61920851E-02 + 0.00000000E+00-1.01381395E-04 0.00000000E+00-1.88548525E-03 4.46330207E-18 + 1.17992074E-05-2.70774355E-20-2.20165578E-04-8.35961293E-19-7.85305380E-04 + 0.00000000E+00 1.76015660E-04 4.22241502E-10-3.64622149E-08 3.36201191E-15 + 0.00000000E+00 5.53047405E-10 0.00000000E+00-2.56797500E-14 4.65329269E-04 + 1.57981997E-18 1.86230810E-03 5.81810205E-18 1.61530488E-03 0.00000000E+00 + 6.46118722E-03 0.00000000E+00-4.15013013E-03-9.26469057E-09-7.24546433E-08 + 4.52753388E-15 0.00000000E+00-1.23634338E-08 0.00000000E+00-5.26484579E-14 + 4.65328646E-04 1.33246043E-18-2.45857978E-04-6.08322244E-19 1.61530033E-03 + 0.00000000E+00-8.29980962E-04 0.00000000E+00 2.01131067E-04 4.20657123E-10 +-3.60098416E-08 1.21486113E-15 0.00000000E+00 5.71296242E-10 0.00000000E+00 +-2.69768252E-14 1.61530033E-03 0.00000000E+00 4.65328646E-04-1.33246043E-18 + 0.00000000E+00-1.12927844E-08 0.00000000E+00-5.86972220E-11 3.84521018E-03 +-8.41883253E-09 2.00295875E-05-4.37247553E-11 1.32797144E-02 0.00000000E+00 + 1.70462352E-03 0.00000000E+00 3.93293580E-03-8.91777861E-18 5.18103266E-04 +-1.10082855E-18 0.00000000E+00-1.13301786E-08 0.00000000E+00 5.88051293E-11 + 3.89512752E-03-8.41714598E-09-2.01736269E-05 4.37198958E-11 2.53244666E-03 + 0.00000000E+00 1.50545947E-03-5.94667244E-18 0.00000000E+00-5.84038099E-09 + 0.00000000E+00-2.11816861E-11 5.21746461E-03-3.36586209E-09 2.04222387E-05 +-1.21835907E-11 2.04575987E-02 0.00000000E+00 2.58187679E-03 0.00000000E+00 + 1.22774934E-02-3.72822596E-17 1.56394277E-03-3.00650445E-18 0.00000000E+00 +-3.71809035E-09 0.00000000E+00 1.65705663E-11 5.23240712E-03-2.12750718E-09 +-2.04547256E-05 9.49294435E-12 8.12171887E-09-6.72661587E-13 0.00000000E+00 +-1.15277996E-12 9.33365335E-07 6.10268395E-21 4.15220418E-09 2.40507893E-23 +-4.28146000E-05 0.00000000E+00-1.93248788E-07 0.00000000E+00-2.04547256E-05 +-9.49294435E-12-5.12972217E-06-9.09743173E-13 0.00000000E+00-1.65705663E-11 + 0.00000000E+00-1.60945799E-12 1.44930552E-06 1.68956076E-21-5.27357790E-09 +-1.52774623E-23-7.24686450E-05 0.00000000E+00 2.57690883E-07 0.00000000E+00 +-2.63522233E-04 5.66630481E-11 0.00000000E+00 9.45310880E-11-1.95377825E-04 +-1.11875379E-18-9.06523131E-07-4.47018117E-21 9.09328764E-03 0.00000000E+00 + 4.28171506E-05 0.00000000E+00 5.23240712E-03 2.12750718E-09 2.88580788E-03 + 4.06561330E-10 0.00000000E+00 3.71809035E-09 0.00000000E+00 7.17366281E-10 +-5.06648427E-04 9.31171062E-19 1.44930552E-06 1.68956076E-21 2.62757109E-02 + 0.00000000E+00-7.24686450E-05 0.00000000E+00 0.00000000E+00-1.15277996E-12 +-8.12171887E-09-6.72661587E-13-4.28146000E-05 0.00000000E+00-1.93248788E-07 + 0.00000000E+00 9.33365335E-07-6.10268395E-21 4.15220418E-09-2.40507893E-23 + 0.00000000E+00-1.65705663E-11 0.00000000E+00-1.60945799E-12 2.04547256E-05 +-9.49294435E-12 5.12972217E-06-9.09743173E-13-7.24686450E-05 0.00000000E+00 + 2.57690883E-07 0.00000000E+00 1.44930552E-06-1.68956076E-21-5.27357790E-09 + 1.52774623E-23 0.00000000E+00 9.45310880E-11 2.63522233E-04 5.66630481E-11 + 9.09328764E-03 0.00000000E+00 4.28171506E-05 0.00000000E+00-1.95377825E-04 + 1.11875379E-18-9.06523131E-07 4.47018117E-21 0.00000000E+00 3.71809035E-09 + 0.00000000E+00 7.17366281E-10-5.23240712E-03 2.12750718E-09-2.88580788E-03 + 4.06561330E-10 2.62757109E-02 0.00000000E+00-7.24686450E-05 0.00000000E+00 +-5.06648427E-04-9.31171062E-19 1.44930552E-06-1.68956076E-21-7.67350560E-04 +-2.23829422E-18-1.27858086E-03 0.00000000E+00 2.58956100E-04 3.21710422E-10 +-8.12171887E-09 6.72661587E-13 0.00000000E+00 5.53922053E-10 0.00000000E+00 + 1.15277996E-12 1.56394277E-03 3.00650445E-18 3.11327565E-03 6.47297658E-18 + 2.58187679E-03 0.00000000E+00 5.15132050E-03 0.00000000E+00-2.88580788E-03 +-4.06561330E-10 5.12972217E-06 9.09743173E-13 0.00000000E+00-7.17366281E-10 + 0.00000000E+00 1.60945799E-12 1.50545947E-03 5.94667244E-18 2.53244666E-03 + 0.00000000E+00-5.21746461E-03-3.36586209E-09-2.04222387E-05-1.21835907E-11 + 0.00000000E+00-5.84038099E-09 0.00000000E+00-2.11816861E-11 1.22774934E-02 + 3.72822596E-17 1.56394277E-03 3.00650445E-18 2.04575987E-02 0.00000000E+00 + 2.58187679E-03 0.00000000E+00-5.23240712E-03-2.12750718E-09 2.04547256E-05 + 9.49294435E-12 0.00000000E+00-3.71809035E-09 0.00000000E+00 1.65705663E-11 +-1.27858086E-03 0.00000000E+00-7.67350560E-04 2.23829422E-18 0.00000000E+00 + 5.53922053E-10 0.00000000E+00 1.15277996E-12-2.58956100E-04 3.21710422E-10 + 8.12171887E-09 6.72661587E-13 2.58187679E-03 0.00000000E+00 5.15132050E-03 + 0.00000000E+00 1.56394277E-03-3.00650445E-18 3.11327565E-03-6.47297658E-18 + 0.00000000E+00-7.17366281E-10 0.00000000E+00 1.60945799E-12 2.88580788E-03 +-4.06561330E-10-5.12972217E-06 9.09743173E-13 8.57706455E-09-2.27572885E-13 + 0.00000000E+00-2.99442738E-13 1.27607912E-06 9.59471387E-21 5.70129362E-09 + 4.53083483E-23-4.27984831E-05 0.00000000E+00-1.93170824E-07 0.00000000E+00 +-2.02207834E-05-2.28084495E-11 1.68692553E-08-8.73750502E-13 0.00000000E+00 +-3.82282879E-11 0.00000000E+00-1.39576856E-12 3.69850681E-07 4.92049717E-21 +-1.31470150E-08-1.15147815E-22 1.83369704E-08 0.00000000E+00 5.15204913E-07 + 0.00000000E+00 2.04222387E-05 1.21835907E-11 8.12171887E-09-6.72661587E-13 + 0.00000000E+00 2.11816861E-11 0.00000000E+00-1.15277996E-12-9.06523131E-07 +-4.47018117E-21 4.15220418E-09 2.40507893E-23 4.28171506E-05 0.00000000E+00 +-1.93248788E-07 0.00000000E+00 2.48277020E-03 0.00000000E+00 1.44785021E-03 +-4.14698508E-18 0.00000000E+00-1.01708663E-08 0.00000000E+00-3.94260588E-11 + 5.15702535E-03-6.13982855E-09 2.01864751E-05-2.37187410E-11 2.00604744E-02 + 0.00000000E+00 2.53237051E-03 0.00000000E+00 1.18127277E-02-4.07588957E-17 + 1.50541651E-03-5.86428285E-18 0.00000000E+00-9.61212509E-09 0.00000000E+00 + 3.82282879E-11 5.17281393E-03-5.71750187E-09-2.02207834E-05 2.28084495E-11 +-1.25378518E-03 0.00000000E+00-7.38316681E-04 2.50281698E-18 0.00000000E+00 + 5.72840446E-10 0.00000000E+00 2.99442738E-13-2.55830745E-04 3.57153258E-10 + 8.57706455E-09 2.27572885E-13 2.53237051E-03 0.00000000E+00 1.01295735E-02 + 0.00000000E+00 1.50541651E-03-5.86428285E-18 6.02207935E-03-2.19587557E-17 + 0.00000000E+00-9.04020808E-09 0.00000000E+00 1.39576856E-12 5.71492723E-03 +-5.27756332E-09 1.68692553E-08 8.73750502E-13 2.53244666E-03 0.00000000E+00 +-1.27858086E-03 0.00000000E+00 1.50545947E-03-5.94667244E-18-7.67350560E-04 + 2.23829422E-18 0.00000000E+00-9.45310880E-11 0.00000000E+00 1.15277996E-12 +-2.63522233E-04-5.66630481E-11 8.12171887E-09 6.72661587E-13 1.44785021E-03 + 4.14698508E-18 2.48277020E-03 0.00000000E+00-5.15702535E-03-6.13982855E-09 +-2.01864751E-05-2.37187410E-11 0.00000000E+00-1.01708663E-08 0.00000000E+00 +-3.94260588E-11 1.18127277E-02 4.07588957E-17 1.50541651E-03 5.86428285E-18 + 2.00604744E-02 0.00000000E+00 2.53237051E-03 0.00000000E+00-5.17281393E-03 +-5.71750187E-09 2.02207834E-05 2.28084495E-11 0.00000000E+00-9.61212509E-09 + 0.00000000E+00 3.82282879E-11-7.38316681E-04-2.50281698E-18-1.25378518E-03 + 0.00000000E+00 2.55830745E-04 3.57153258E-10-8.57706455E-09 2.27572885E-13 + 0.00000000E+00 5.72840446E-10 0.00000000E+00 2.99442738E-13 1.50541651E-03 + 5.86428285E-18 6.02207935E-03 2.19587557E-17 2.53237051E-03 0.00000000E+00 + 1.01295735E-02 0.00000000E+00-5.71492723E-03-5.27756332E-09-1.68692553E-08 + 8.73750502E-13 0.00000000E+00-9.04020808E-09 0.00000000E+00 1.39576856E-12 + 1.50545947E-03 5.94667244E-18-7.67350560E-04-2.23829422E-18 2.53244666E-03 + 0.00000000E+00-1.27858086E-03 0.00000000E+00 2.63522233E-04-5.66630481E-11 +-8.12171887E-09 6.72661587E-13 0.00000000E+00-9.45310880E-11 0.00000000E+00 + 1.15277996E-12 0.00000000E+00-4.02534851E-10 2.60654961E-04-2.28300536E-10 + 9.08961599E-03 0.00000000E+00 4.27987004E-05 0.00000000E+00-2.68267062E-04 + 2.12296664E-18-1.25021777E-06 1.04234299E-20 0.00000000E+00 9.61212509E-09 + 0.00000000E+00 9.04020808E-09-5.17281393E-03 5.71750187E-09-5.71492723E-03 + 5.27756332E-09 5.25246164E-02 0.00000000E+00 1.83369704E-08 0.00000000E+00 +-1.34103359E-03 1.34302731E-17 3.69850681E-07-4.92049717E-21 0.00000000E+00 + 5.84038099E-09 0.00000000E+00-5.53922053E-10-5.21746461E-03 3.36586209E-09 + 2.58956100E-04-3.21710422E-10 9.09328764E-03 0.00000000E+00-4.28146000E-05 + 0.00000000E+00-1.95377825E-04 1.11875379E-18 9.33365335E-07-6.10268395E-21 + 0.00000000E+00-2.99442738E-13-8.57706455E-09-2.27572885E-13-4.27984831E-05 + 0.00000000E+00-1.93170824E-07 0.00000000E+00 1.27607912E-06-9.59471387E-21 + 5.70129362E-09-4.53083483E-23 0.00000000E+00-3.82282879E-11 0.00000000E+00 +-1.39576856E-12 2.02207834E-05-2.28084495E-11-1.68692553E-08-8.73750502E-13 + 1.83369704E-08 0.00000000E+00 5.15204913E-07 0.00000000E+00 3.69850681E-07 +-4.92049717E-21-1.31470150E-08 1.15147815E-22 0.00000000E+00 2.11816861E-11 + 0.00000000E+00-1.15277996E-12-2.04222387E-05 1.21835907E-11-8.12171887E-09 +-6.72661587E-13 4.28171506E-05 0.00000000E+00-1.93248788E-07 0.00000000E+00 +-9.06523131E-07 4.47018117E-21 4.15220418E-09-2.40507893E-23-2.60654961E-04 +-2.28300536E-10 0.00000000E+00-4.02534851E-10-2.68267062E-04-2.12296664E-18 +-1.25021777E-06-1.04234299E-20 9.08961599E-03 0.00000000E+00 4.27987004E-05 + 0.00000000E+00 5.17281393E-03 5.71750187E-09 5.71492723E-03 5.27756332E-09 + 0.00000000E+00 9.61212509E-09 0.00000000E+00 9.04020808E-09-1.34103359E-03 +-1.34302731E-17 3.69850681E-07 4.92049717E-21 5.25246164E-02 0.00000000E+00 + 1.83369704E-08 0.00000000E+00 5.21746461E-03 3.36586209E-09-2.58956100E-04 +-3.21710422E-10 0.00000000E+00 5.84038099E-09 0.00000000E+00-5.53922053E-10 +-1.95377825E-04-1.11875379E-18 9.33365335E-07 6.10268395E-21 9.09328764E-03 + 0.00000000E+00-4.28146000E-05 0.00000000E+00 1.82295904E-03 7.24889606E-18 + 3.20912514E-03 0.00000000E+00-6.74566114E-03-8.98432156E-09-3.50689559E-05 +-4.65722786E-11 0.00000000E+00-1.40648797E-08 0.00000000E+00-7.30226675E-11 + 1.49804424E-02 4.35358217E-17 1.92230985E-03 4.44104428E-18 2.60226235E-02 + 0.00000000E+00 3.29650467E-03 0.00000000E+00-6.77497508E-03-8.88962710E-09 + 3.51535396E-05 4.63057584E-11 0.00000000E+00-1.40560025E-08 0.00000000E+00 + 7.30041627E-11-1.62640745E-03 0.00000000E+00-9.36317224E-04 2.92248508E-18 + 0.00000000E+00 7.04775916E-10 0.00000000E+00 4.62620284E-15-3.33526689E-04 + 4.60358755E-10 2.11459169E-08 6.66300434E-14 3.29650467E-03 0.00000000E+00 + 1.15490978E-02 0.00000000E+00 1.92230985E-03-4.44104428E-18 6.73005358E-03 +-1.90863465E-17 0.00000000E+00-1.35133106E-08 0.00000000E+00 7.94337397E-12 + 6.56970556E-03-8.36124373E-09-3.80094314E-06 5.10401111E-12 2.48277020E-03 + 0.00000000E+00-1.25378518E-03 0.00000000E+00 1.44785021E-03-4.14698508E-18 +-7.38316681E-04 2.50281698E-18 0.00000000E+00 4.02534851E-10 0.00000000E+00 + 2.99442738E-13-2.60654961E-04 2.28300536E-10 8.57706455E-09 2.27572885E-13 + 2.11459169E-08-6.66300434E-14 0.00000000E+00-4.62620284E-15 2.92909728E-06 +-1.06210928E-20 1.73802205E-08-6.01002596E-23-7.54809124E-05 0.00000000E+00 +-4.52317855E-07 0.00000000E+00-3.51535396E-05-4.63057584E-11-3.80094314E-06 +-5.10401111E-12 0.00000000E+00-7.30041627E-11 0.00000000E+00-7.94337397E-12 + 2.43510657E-06-2.33054196E-20-3.02757466E-08 8.89397484E-24-5.52834532E-05 + 0.00000000E+00 8.60579746E-07 0.00000000E+00 2.01864751E-05 2.37187410E-11 + 8.57706455E-09-2.27572885E-13 0.00000000E+00 3.94260588E-11 0.00000000E+00 +-2.99442738E-13-1.25021777E-06-1.04234299E-20 5.70129362E-09 4.53083483E-23 + 4.27987004E-05 0.00000000E+00-1.93170824E-07 0.00000000E+00-3.42483761E-04 +-4.31553521E-10 0.00000000E+00-7.02200321E-10-4.63902310E-04 1.58583048E-18 +-2.87126149E-06 9.27770632E-21 1.20732961E-02 0.00000000E+00 7.54752441E-05 + 0.00000000E+00 6.77497508E-03 8.88962710E-09 6.56970556E-03 8.36124373E-09 + 0.00000000E+00 1.40560025E-08 0.00000000E+00 1.35133106E-08-2.07631619E-03 +-2.50050963E-18 2.43510657E-06-2.33054196E-20 6.11296785E-02 0.00000000E+00 +-5.52834532E-05 0.00000000E+00 5.15702535E-03 6.13982855E-09-2.55830745E-04 +-3.57153258E-10 0.00000000E+00 1.01708663E-08 0.00000000E+00-5.72840446E-10 +-2.68267062E-04-2.12296664E-18 1.27607912E-06 9.59471387E-21 9.08961599E-03 + 0.00000000E+00-4.27984831E-05 0.00000000E+00 0.00000000E+00-4.62620284E-15 +-2.11459169E-08-6.66300434E-14-7.54809124E-05 0.00000000E+00-4.52317855E-07 + 0.00000000E+00 2.92909728E-06 1.06210928E-20 1.73802205E-08 6.01002596E-23 + 0.00000000E+00-7.30041627E-11 0.00000000E+00-7.94337397E-12 3.51535396E-05 +-4.63057584E-11 3.80094314E-06-5.10401111E-12-5.52834532E-05 0.00000000E+00 + 8.60579746E-07 0.00000000E+00 2.43510657E-06 2.33054196E-20-3.02757466E-08 +-8.89397484E-24 0.00000000E+00 3.94260588E-11 0.00000000E+00-2.99442738E-13 +-2.01864751E-05 2.37187410E-11-8.57706455E-09-2.27572885E-13 4.27987004E-05 + 0.00000000E+00-1.93170824E-07 0.00000000E+00-1.25021777E-06 1.04234299E-20 + 5.70129362E-09-4.53083483E-23 0.00000000E+00-7.02200321E-10 3.42483761E-04 +-4.31553521E-10 1.20732961E-02 0.00000000E+00 7.54752441E-05 0.00000000E+00 +-4.63902310E-04-1.58583048E-18-2.87126149E-06-9.27770632E-21 0.00000000E+00 + 1.40560025E-08 0.00000000E+00 1.35133106E-08-6.77497508E-03 8.88962710E-09 +-6.56970556E-03 8.36124373E-09 6.11296785E-02 0.00000000E+00-5.52834532E-05 + 0.00000000E+00-2.07631619E-03 2.50050963E-18 2.43510657E-06 2.33054196E-20 + 0.00000000E+00 1.01708663E-08 0.00000000E+00-5.72840446E-10-5.15702535E-03 + 6.13982855E-09 2.55830745E-04-3.57153258E-10 9.08961599E-03 0.00000000E+00 +-4.27984831E-05 0.00000000E+00-2.68267062E-04 2.12296664E-18 1.27607912E-06 +-9.59471387E-21-9.36317224E-04-2.92248508E-18-1.62640745E-03 0.00000000E+00 + 3.33526689E-04 4.60358755E-10-2.11459169E-08 6.66300434E-14 0.00000000E+00 + 7.04775916E-10 0.00000000E+00 4.62620284E-15 1.92230985E-03 4.44104428E-18 + 6.73005358E-03 1.90863465E-17 3.29650467E-03 0.00000000E+00 1.15490978E-02 + 0.00000000E+00-6.56970556E-03-8.36124373E-09 3.80094314E-06 5.10401111E-12 + 0.00000000E+00-1.35133106E-08 0.00000000E+00 7.94337397E-12 1.44785021E-03 + 4.14698508E-18-7.38316681E-04-2.50281698E-18 2.48277020E-03 0.00000000E+00 +-1.25378518E-03 0.00000000E+00 2.60654961E-04 2.28300536E-10-8.57706455E-09 + 2.27572885E-13 0.00000000E+00 4.02534851E-10 0.00000000E+00 2.99442738E-13 + 3.20912514E-03 0.00000000E+00 1.82295904E-03-7.24889606E-18 0.00000000E+00 +-1.40648797E-08 0.00000000E+00-7.30226675E-11 6.74566114E-03-8.98432156E-09 + 3.50689559E-05-4.65722786E-11 2.60226235E-02 0.00000000E+00 3.29650467E-03 + 0.00000000E+00 1.49804424E-02-4.35358217E-17 1.92230985E-03-4.44104428E-18 + 0.00000000E+00-1.40560025E-08 0.00000000E+00 7.30041627E-11 6.77497508E-03 +-8.88962710E-09-3.51535396E-05 4.63057584E-11 1.72592117E-03 7.41636422E-18 + 3.12152539E-03 0.00000000E+00-6.62723914E-03-9.11358167E-09-3.44560273E-05 +-4.73355395E-11 0.00000000E+00-1.41557028E-08 0.00000000E+00-7.35481224E-11 + 1.41948084E-02 6.79646214E-17 1.82295272E-03 8.74718329E-18 2.53225911E-02 + 0.00000000E+00 3.20911636E-03 0.00000000E+00-6.65833347E-03-9.10886358E-09 + 3.45457478E-05 4.73232534E-11 0.00000000E+00-1.41645235E-08 0.00000000E+00 + 7.35761614E-11-1.58266044E-03 0.00000000E+00-8.87218472E-04 4.04088688E-18 + 0.00000000E+00 7.05911464E-10 0.00000000E+00-7.00976204E-15-3.27379601E-04 + 4.55944707E-10 2.24301381E-08 3.07153397E-15 3.20911636E-03 0.00000000E+00 + 1.28364068E-02 0.00000000E+00 1.82295272E-03-8.74718329E-18 7.29265151E-03 +-3.04968293E-17 0.00000000E+00-1.55335158E-08 0.00000000E+00 9.36762409E-14 + 7.37279920E-03-9.98062522E-09 4.36046621E-08 5.77403711E-14 3.20912514E-03 + 0.00000000E+00-1.62640745E-03 0.00000000E+00 1.82295904E-03-7.24889606E-18 +-9.36317224E-04 2.92248508E-18 0.00000000E+00 7.02200321E-10 0.00000000E+00 + 4.62620284E-15-3.42483761E-04 4.31553521E-10 2.11459169E-08 6.66300434E-14 + 2.24301381E-08-3.07153397E-15 0.00000000E+00 7.00976204E-15 3.66178309E-06 + 3.81270902E-22 2.17793253E-08-4.25009555E-24-7.56073105E-05 0.00000000E+00 +-4.53054228E-07 0.00000000E+00-3.45457478E-05-4.73232534E-11 4.36046621E-08 +-5.77403711E-14 0.00000000E+00-7.35761614E-11 0.00000000E+00-9.36762409E-14 + 7.90584215E-07 1.14685947E-20-5.22461391E-08 1.28798343E-22-1.32331142E-07 + 0.00000000E+00 1.20707212E-06 0.00000000E+00 3.50689559E-05 4.65722786E-11 + 2.11459169E-08-6.66300434E-14 0.00000000E+00 7.30226675E-11 0.00000000E+00 +-4.62620284E-15-2.87126149E-06 9.27770632E-21 1.73802205E-08-6.01002596E-23 + 7.54752441E-05 0.00000000E+00-4.52317855E-07 0.00000000E+00-3.36880670E-04 +-4.54528627E-10 0.00000000E+00-7.08656493E-10-5.81319633E-04 1.10333713E-19 +-3.60670389E-06 1.77277405E-21 1.20928805E-02 0.00000000E+00 7.55941605E-05 + 0.00000000E+00 6.65833347E-03 9.10886358E-09 7.37279920E-03 9.98062522E-09 + 0.00000000E+00 1.41645235E-08 0.00000000E+00 1.55335158E-08-3.02290583E-03 + 9.26259032E-18 7.90584215E-07 1.14685947E-20 6.98042457E-02 0.00000000E+00 +-1.32331142E-07 0.00000000E+00 6.74566114E-03 8.98432156E-09-3.33526689E-04 +-4.60358755E-10 0.00000000E+00 1.40648797E-08 0.00000000E+00-7.04775916E-10 +-4.63902310E-04 1.58583048E-18 2.92909728E-06-1.06210928E-20 1.20732961E-02 + 0.00000000E+00-7.54809124E-05 0.00000000E+00 0.00000000E+00 7.00976204E-15 +-2.24301381E-08-3.07153397E-15-7.56073105E-05 0.00000000E+00-4.53054228E-07 + 0.00000000E+00 3.66178309E-06-3.81270902E-22 2.17793253E-08 4.25009555E-24 + 0.00000000E+00-7.35761614E-11 0.00000000E+00-9.36762409E-14 3.45457478E-05 +-4.73232534E-11-4.36046621E-08-5.77403711E-14-1.32331142E-07 0.00000000E+00 + 1.20707212E-06 0.00000000E+00 7.90584215E-07-1.14685947E-20-5.22461391E-08 +-1.28798343E-22 0.00000000E+00 7.30226675E-11 0.00000000E+00-4.62620284E-15 +-3.50689559E-05 4.65722786E-11-2.11459169E-08-6.66300434E-14 7.54752441E-05 + 0.00000000E+00-4.52317855E-07 0.00000000E+00-2.87126149E-06-9.27770632E-21 + 1.73802205E-08 6.01002596E-23 0.00000000E+00-7.08656493E-10 3.36880670E-04 +-4.54528627E-10 1.20928805E-02 0.00000000E+00 7.55941605E-05 0.00000000E+00 +-5.81319633E-04-1.10333713E-19-3.60670389E-06-1.77277405E-21 0.00000000E+00 + 1.41645235E-08 0.00000000E+00 1.55335158E-08-6.65833347E-03 9.10886358E-09 +-7.37279920E-03 9.98062522E-09 6.98042457E-02 0.00000000E+00-1.32331142E-07 + 0.00000000E+00-3.02290583E-03-9.26259032E-18 7.90584215E-07-1.14685947E-20 + 0.00000000E+00 1.40648797E-08 0.00000000E+00-7.04775916E-10-6.74566114E-03 + 8.98432156E-09 3.33526689E-04-4.60358755E-10 1.20732961E-02 0.00000000E+00 +-7.54809124E-05 0.00000000E+00-4.63902310E-04-1.58583048E-18 2.92909728E-06 + 1.06210928E-20-8.87218472E-04-4.04088688E-18-1.58266044E-03 0.00000000E+00 + 3.27379601E-04 4.55944707E-10-2.24301381E-08 3.07153397E-15 0.00000000E+00 + 7.05911464E-10 0.00000000E+00-7.00976204E-15 1.82295272E-03 8.74718329E-18 + 7.29265151E-03 3.04968293E-17 3.20911636E-03 0.00000000E+00 1.28364068E-02 + 0.00000000E+00-7.37279920E-03-9.98062522E-09-4.36046621E-08 5.77403711E-14 + 0.00000000E+00-1.55335158E-08 0.00000000E+00 9.36762409E-14 1.82295904E-03 + 7.24889606E-18-9.36317224E-04-2.92248508E-18 3.20912514E-03 0.00000000E+00 +-1.62640745E-03 0.00000000E+00 3.42483761E-04 4.31553521E-10-2.11459169E-08 + 6.66300434E-14 0.00000000E+00 7.02200321E-10 0.00000000E+00 4.62620284E-15 + 3.12152539E-03 0.00000000E+00 1.72592117E-03-7.41636422E-18 0.00000000E+00 +-1.41557028E-08 0.00000000E+00-7.35481224E-11 6.62723914E-03-9.11358167E-09 + 3.44560273E-05-4.73355395E-11 2.53225911E-02 0.00000000E+00 3.20911636E-03 + 0.00000000E+00 1.41948084E-02-6.79646214E-17 1.82295272E-03-8.74718329E-18 + 0.00000000E+00-1.41645235E-08 0.00000000E+00 7.35761614E-11 6.65833347E-03 +-9.10886358E-09-3.45457478E-05 4.73232534E-11 1.63129399E-03 6.16819952E-18 + 3.03382383E-03 0.00000000E+00-6.50234390E-03-9.06290611E-09-3.38093335E-05 +-4.70878330E-11 0.00000000E+00-1.39822288E-08 0.00000000E+00-7.26695199E-11 + 1.34281969E-02 4.82505706E-17 1.72592680E-03 6.29999365E-18 2.46214920E-02 + 0.00000000E+00 3.12153859E-03 0.00000000E+00-6.53506718E-03-9.07848927E-09 + 3.39037536E-05 4.71327101E-11 0.00000000E+00-1.40275432E-08 0.00000000E+00 + 7.27996859E-11-1.53884060E-03 0.00000000E+00-8.39305197E-04 3.11704829E-18 + 0.00000000E+00 6.93435087E-10 0.00000000E+00-3.25415012E-14-3.20926922E-04 + 4.51168972E-10 2.36050327E-08-1.12192646E-14 3.12153859E-03 0.00000000E+00 + 1.24860839E-02 0.00000000E+00 1.72592680E-03-6.29999365E-18 6.90455279E-03 +-2.78429095E-17 0.00000000E+00-1.55110146E-08 0.00000000E+00-8.33230934E-14 + 7.23982023E-03-1.00117109E-08 4.59928977E-08-2.48205636E-14 3.12152539E-03 + 0.00000000E+00-1.58266044E-03 0.00000000E+00 1.72592117E-03-7.41636422E-18 +-8.87218472E-04 4.04088688E-18 0.00000000E+00 7.08656493E-10 0.00000000E+00 +-7.00976204E-15-3.36880670E-04 4.54528627E-10 2.24301381E-08 3.07153397E-15 + 2.36050327E-08 1.12192646E-14 0.00000000E+00 3.25415012E-14 4.35898862E-06 + 1.34944113E-20 2.59655309E-08 8.35548641E-23-7.58327448E-05 0.00000000E+00 +-4.54383193E-07 0.00000000E+00-3.39037536E-05-4.71327101E-11 4.59928977E-08 + 2.48205636E-14 0.00000000E+00-7.27996859E-11 0.00000000E+00 8.33230934E-14 + 7.52208460E-07 1.80345273E-20-6.36920809E-08-1.42995236E-22-2.38705506E-07 + 0.00000000E+00 1.20982229E-06 0.00000000E+00 3.44560273E-05 4.73355395E-11 + 2.24301381E-08-3.07153397E-15 0.00000000E+00 7.35481224E-11 0.00000000E+00 + 7.00976204E-15-3.60670389E-06 1.77277405E-21 2.17793253E-08-4.25009555E-24 + 7.55941605E-05 0.00000000E+00-4.53054228E-07 0.00000000E+00-3.30925711E-04 +-4.55928827E-10 0.00000000E+00-7.07269893E-10-6.93053799E-04-2.21819581E-18 +-4.30657316E-06-1.42868206E-20 1.21282828E-02 0.00000000E+00 7.58118165E-05 + 0.00000000E+00 6.53506718E-03 9.07848927E-09 7.23982023E-03 1.00117109E-08 + 0.00000000E+00 1.40275432E-08 0.00000000E+00 1.55110146E-08-3.68478165E-03 +-9.97911823E-18 7.52208460E-07 1.80345273E-20 6.99627293E-02 0.00000000E+00 +-2.38705506E-07 0.00000000E+00 6.62723914E-03 9.11358167E-09-3.27379601E-04 +-4.55944707E-10 0.00000000E+00 1.41557028E-08 0.00000000E+00-7.05911464E-10 +-5.81319633E-04 1.10333713E-19 3.66178309E-06 3.81270902E-22 1.20928805E-02 + 0.00000000E+00-7.56073105E-05 0.00000000E+00 0.00000000E+00 3.25415012E-14 +-2.36050327E-08 1.12192646E-14-7.58327448E-05 0.00000000E+00-4.54383193E-07 + 0.00000000E+00 4.35898862E-06-1.34944113E-20 2.59655309E-08-8.35548641E-23 + 0.00000000E+00-7.27996859E-11 0.00000000E+00 8.33230934E-14 3.39037536E-05 +-4.71327101E-11-4.59928977E-08 2.48205636E-14-2.38705506E-07 0.00000000E+00 + 1.20982229E-06 0.00000000E+00 7.52208460E-07-1.80345273E-20-6.36920809E-08 + 1.42995236E-22 0.00000000E+00 7.35481224E-11 0.00000000E+00 7.00976204E-15 +-3.44560273E-05 4.73355395E-11-2.24301381E-08-3.07153397E-15 7.55941605E-05 + 0.00000000E+00-4.53054228E-07 0.00000000E+00-3.60670389E-06-1.77277405E-21 + 2.17793253E-08 4.25009555E-24 0.00000000E+00-7.07269893E-10 3.30925711E-04 +-4.55928827E-10 1.21282828E-02 0.00000000E+00 7.58118165E-05 0.00000000E+00 +-6.93053799E-04 2.21819581E-18-4.30657316E-06 1.42868206E-20 0.00000000E+00 + 1.40275432E-08 0.00000000E+00 1.55110146E-08-6.53506718E-03 9.07848927E-09 +-7.23982023E-03 1.00117109E-08 6.99627293E-02 0.00000000E+00-2.38705506E-07 + 0.00000000E+00-3.68478165E-03 9.97911823E-18 7.52208460E-07-1.80345273E-20 + 0.00000000E+00 1.41557028E-08 0.00000000E+00-7.05911464E-10-6.62723914E-03 + 9.11358167E-09 3.27379601E-04-4.55944707E-10 1.20928805E-02 0.00000000E+00 +-7.56073105E-05 0.00000000E+00-5.81319633E-04-1.10333713E-19 3.66178309E-06 +-3.81270902E-22-8.39305197E-04-3.11704829E-18-1.53884060E-03 0.00000000E+00 + 3.20926922E-04 4.51168972E-10-2.36050327E-08-1.12192646E-14 0.00000000E+00 + 6.93435087E-10 0.00000000E+00-3.25415012E-14 1.72592680E-03 6.29999365E-18 + 6.90455279E-03 2.78429095E-17 3.12153859E-03 0.00000000E+00 1.24860839E-02 + 0.00000000E+00-7.23982023E-03-1.00117109E-08-4.59928977E-08-2.48205636E-14 + 0.00000000E+00-1.55110146E-08 0.00000000E+00-8.33230934E-14 1.72592117E-03 + 7.41636422E-18-8.87218472E-04-4.04088688E-18 3.12152539E-03 0.00000000E+00 +-1.58266044E-03 0.00000000E+00 3.36880670E-04 4.54528627E-10-2.24301381E-08 + 3.07153397E-15 0.00000000E+00 7.08656493E-10 0.00000000E+00-7.00976204E-15 + 3.03382383E-03 0.00000000E+00 1.63129399E-03-6.16819952E-18 0.00000000E+00 +-1.39822288E-08 0.00000000E+00-7.26695199E-11 6.50234390E-03-9.06290611E-09 + 3.38093335E-05-4.70878330E-11 2.46214920E-02 0.00000000E+00 3.12153859E-03 + 0.00000000E+00 1.34281969E-02-4.82505706E-17 1.72592680E-03-6.29999365E-18 + 0.00000000E+00-1.40275432E-08 0.00000000E+00 7.27996859E-11 6.53506718E-03 +-9.07848927E-09-3.39037536E-05 4.71327101E-11 1.53908661E-03 3.42184946E-18 + 2.94597858E-03 0.00000000E+00-6.37119951E-03-9.00212274E-09-3.31301257E-05 +-4.67737158E-11 0.00000000E+00-1.38178847E-08 0.00000000E+00-7.18181846E-11 + 1.26808358E-02 4.16644468E-17 1.63129677E-03 6.78898222E-18 2.39192793E-02 + 0.00000000E+00 3.03383191E-03 0.00000000E+00-6.40551228E-03-9.01845077E-09 + 3.32291354E-05 4.68208928E-11 0.00000000E+00-1.38619857E-08 0.00000000E+00 + 7.19456528E-11-1.49495262E-03 0.00000000E+00-7.92595845E-04 2.55270792E-18 + 0.00000000E+00 6.85218430E-10 0.00000000E+00-3.18670495E-14-3.14167032E-04 + 4.48008083E-10 2.47524450E-08-1.17942481E-14 3.03383191E-03 0.00000000E+00 + 1.21352620E-02 0.00000000E+00 1.63129677E-03-6.78898222E-18 6.52604676E-03 +-2.48104001E-17 0.00000000E+00-1.53145127E-08 0.00000000E+00-5.65026755E-14 + 7.09986164E-03-9.94512495E-09 4.83239656E-08-2.14972127E-14 3.03382383E-03 + 0.00000000E+00-1.53884060E-03 0.00000000E+00 1.63129399E-03-6.16819952E-18 +-8.39305197E-04 3.11704829E-18 0.00000000E+00 7.07269893E-10 0.00000000E+00 +-3.25415012E-14-3.30925711E-04 4.55928827E-10 2.36050327E-08-1.12192646E-14 + 2.47524450E-08 1.17942481E-14 0.00000000E+00 3.18670495E-14 5.02268388E-06 + 8.92090491E-21 2.99505119E-08 4.97089588E-23-7.61617838E-05 0.00000000E+00 +-4.56331991E-07 0.00000000E+00-3.32291354E-05-4.68208928E-11 4.83239656E-08 + 2.14972127E-14 0.00000000E+00-7.19456528E-11 0.00000000E+00 5.65026755E-14 + 7.16079430E-07-9.09801030E-21-7.45852280E-08-1.52447776E-22-3.50105169E-07 + 0.00000000E+00 1.21418842E-06 0.00000000E+00 3.38093335E-05 4.70878330E-11 + 2.36050327E-08 1.12192646E-14 0.00000000E+00 7.26695199E-11 0.00000000E+00 + 3.25415012E-14-4.30657316E-06-1.42868206E-20 2.59655309E-08 8.35548641E-23 + 7.58118165E-05 0.00000000E+00-4.54383193E-07 0.00000000E+00-3.24651558E-04 +-4.52998434E-10 0.00000000E+00-6.98697958E-10-7.99415342E-04-1.33864769E-18 +-4.97278595E-06-7.77123193E-21 1.21802290E-02 0.00000000E+00 7.61327258E-05 + 0.00000000E+00 6.40551228E-03 9.01845077E-09 7.09986164E-03 9.94512495E-09 + 0.00000000E+00 1.38619857E-08 0.00000000E+00 1.53145127E-08-4.31465781E-03 +-7.54190157E-18 7.16079430E-07-9.09801030E-21 7.02146484E-02 0.00000000E+00 +-3.50105169E-07 0.00000000E+00 6.50234390E-03 9.06290611E-09-3.20926922E-04 +-4.51168972E-10 0.00000000E+00 1.39822288E-08 0.00000000E+00-6.93435087E-10 +-6.93053799E-04-2.21819581E-18 4.35898862E-06 1.34944113E-20 1.21282828E-02 + 0.00000000E+00-7.58327448E-05 0.00000000E+00 0.00000000E+00 3.18670495E-14 +-2.47524450E-08 1.17942481E-14-7.61617838E-05 0.00000000E+00-4.56331991E-07 + 0.00000000E+00 5.02268388E-06-8.92090491E-21 2.99505119E-08-4.97089588E-23 + 0.00000000E+00-7.19456528E-11 0.00000000E+00 5.65026755E-14 3.32291354E-05 +-4.68208928E-11-4.83239656E-08 2.14972127E-14-3.50105169E-07 0.00000000E+00 + 1.21418842E-06 0.00000000E+00 7.16079430E-07 9.09801030E-21-7.45852280E-08 + 1.52447776E-22 0.00000000E+00 7.26695199E-11 0.00000000E+00 3.25415012E-14 +-3.38093335E-05 4.70878330E-11-2.36050327E-08 1.12192646E-14 7.58118165E-05 + 0.00000000E+00-4.54383193E-07 0.00000000E+00-4.30657316E-06 1.42868206E-20 + 2.59655309E-08-8.35548641E-23 0.00000000E+00-6.98697958E-10 3.24651558E-04 +-4.52998434E-10 1.21802290E-02 0.00000000E+00 7.61327258E-05 0.00000000E+00 +-7.99415342E-04 1.33864769E-18-4.97278595E-06 7.77123193E-21 0.00000000E+00 + 1.38619857E-08 0.00000000E+00 1.53145127E-08-6.40551228E-03 9.01845077E-09 +-7.09986164E-03 9.94512495E-09 7.02146484E-02 0.00000000E+00-3.50105169E-07 + 0.00000000E+00-4.31465781E-03 7.54190157E-18 7.16079430E-07 9.09801030E-21 + 0.00000000E+00 1.39822288E-08 0.00000000E+00-6.93435087E-10-6.50234390E-03 + 9.06290611E-09 3.20926922E-04-4.51168972E-10 1.21282828E-02 0.00000000E+00 +-7.58327448E-05 0.00000000E+00-6.93053799E-04 2.21819581E-18 4.35898862E-06 +-1.34944113E-20-7.92595845E-04-2.55270792E-18-1.49495262E-03 0.00000000E+00 + 3.14167032E-04 4.48008083E-10-2.47524450E-08-1.17942481E-14 0.00000000E+00 + 6.85218430E-10 0.00000000E+00-3.18670495E-14 1.63129677E-03 6.78898222E-18 + 6.52604676E-03 2.48104001E-17 3.03383191E-03 0.00000000E+00 1.21352620E-02 + 0.00000000E+00-7.09986164E-03-9.94512495E-09-4.83239656E-08-2.14972127E-14 + 0.00000000E+00-1.53145127E-08 0.00000000E+00-5.65026755E-14 1.63129399E-03 + 6.16819952E-18-8.39305197E-04-3.11704829E-18 3.03382383E-03 0.00000000E+00 +-1.53884060E-03 0.00000000E+00 3.30925711E-04 4.55928827E-10-2.36050327E-08 +-1.12192646E-14 0.00000000E+00 7.07269893E-10 0.00000000E+00-3.25415012E-14 + 2.94597858E-03 0.00000000E+00 1.53908661E-03-3.42184946E-18 0.00000000E+00 +-1.38178847E-08 0.00000000E+00-7.18181846E-11 6.37119951E-03-9.00212274E-09 + 3.31301257E-05-4.67737158E-11 2.39192793E-02 0.00000000E+00 3.03383191E-03 + 0.00000000E+00 1.26808358E-02-4.16644468E-17 1.63129677E-03-6.78898222E-18 + 0.00000000E+00-1.38619857E-08 0.00000000E+00 7.19456528E-11 6.40551228E-03 +-9.01845077E-09-3.32291354E-05 4.68208928E-11 1.44933666E-03 5.68013166E-18 + 2.85800537E-03 0.00000000E+00-6.23420865E-03-8.93708917E-09-3.24203814E-05 +-4.64361192E-11 0.00000000E+00-1.36405842E-08 0.00000000E+00-7.08981444E-11 + 1.19529990E-02 3.34799311E-17 1.53908965E-03 2.94385131E-18 2.32160061E-02 + 0.00000000E+00 2.94598711E-03 0.00000000E+00-6.26996722E-03-8.95373540E-09 + 3.25235591E-05 4.64841505E-11 0.00000000E+00-1.36860666E-08 0.00000000E+00 + 7.10293376E-11-1.45099812E-03 0.00000000E+00-7.47106578E-04 2.15599574E-18 + 0.00000000E+00 6.76222674E-10 0.00000000E+00-3.27983074E-14-3.07133445E-04 + 4.44730465E-10 2.57944293E-08-1.20078163E-14 2.94598711E-03 0.00000000E+00 + 1.17838856E-02 0.00000000E+00 1.53908965E-03-2.94385131E-18 6.15723009E-03 +-1.48108090E-17 0.00000000E+00-1.51274396E-08 0.00000000E+00-6.66750274E-14 + 6.95312870E-03-9.87578072E-09 5.05298214E-08-2.44013526E-14 2.94597858E-03 + 0.00000000E+00-1.49495262E-03 0.00000000E+00 1.53908661E-03-3.42184946E-18 +-7.92595845E-04 2.55270792E-18 0.00000000E+00 6.98697958E-10 0.00000000E+00 +-3.18670495E-14-3.24651558E-04 4.52998434E-10 2.47524450E-08-1.17942481E-14 + 2.57944293E-08 1.20078163E-14 0.00000000E+00 3.27983074E-14 5.65436039E-06 + 2.50465941E-20 3.37433385E-08 1.49288089E-22-7.66002865E-05 0.00000000E+00 +-4.58935065E-07 0.00000000E+00-3.25235591E-05-4.64841505E-11 5.05298214E-08 + 2.44013526E-14 0.00000000E+00-7.10293376E-11 0.00000000E+00 6.66750274E-14 + 6.81551076E-07 2.03409289E-20-8.49544419E-08-2.75458367E-22-4.67596085E-07 + 0.00000000E+00 1.22025061E-06 0.00000000E+00 3.31301257E-05 4.67737158E-11 + 2.47524450E-08 1.17942481E-14 0.00000000E+00 7.18181846E-11 0.00000000E+00 + 3.18670495E-14-4.97278595E-06-7.77123193E-21 2.99505119E-08 4.97089588E-23 + 7.61327258E-05 0.00000000E+00-4.56331991E-07 0.00000000E+00-3.18059662E-04 +-4.49816813E-10 0.00000000E+00-6.90119262E-10-9.00646732E-04-3.97306525E-18 +-5.60688079E-06-2.46752675E-20 1.22496388E-02 0.00000000E+00 7.65625281E-05 + 0.00000000E+00 6.26996722E-03 8.95373540E-09 6.95312870E-03 9.87578072E-09 + 0.00000000E+00 1.36860666E-08 0.00000000E+00 1.51274396E-08-4.91425057E-03 +-1.64588205E-17 6.81551076E-07 2.03409289E-20 7.05645206E-02 0.00000000E+00 +-4.67596085E-07 0.00000000E+00 6.37119951E-03 9.00212274E-09-3.14167032E-04 +-4.48008083E-10 0.00000000E+00 1.38178847E-08 0.00000000E+00-6.85218430E-10 +-7.99415342E-04-1.33864769E-18 5.02268388E-06 8.92090491E-21 1.21802290E-02 + 0.00000000E+00-7.61617838E-05 0.00000000E+00 0.00000000E+00 3.27983074E-14 +-2.57944293E-08 1.20078163E-14-7.66002865E-05 0.00000000E+00-4.58935065E-07 + 0.00000000E+00 5.65436039E-06-2.50465941E-20 3.37433385E-08-1.49288089E-22 + 0.00000000E+00-7.10293376E-11 0.00000000E+00 6.66750274E-14 3.25235591E-05 +-4.64841505E-11-5.05298214E-08 2.44013526E-14-4.67596085E-07 0.00000000E+00 + 1.22025061E-06 0.00000000E+00 6.81551076E-07-2.03409289E-20-8.49544419E-08 + 2.75458367E-22 0.00000000E+00 7.18181846E-11 0.00000000E+00 3.18670495E-14 +-3.31301257E-05 4.67737158E-11-2.47524450E-08 1.17942481E-14 7.61327258E-05 + 0.00000000E+00-4.56331991E-07 0.00000000E+00-4.97278595E-06 7.77123193E-21 + 2.99505119E-08-4.97089588E-23 0.00000000E+00-6.90119262E-10 3.18059662E-04 +-4.49816813E-10 1.22496388E-02 0.00000000E+00 7.65625281E-05 0.00000000E+00 +-9.00646732E-04 3.97306525E-18-5.60688079E-06 2.46752675E-20 0.00000000E+00 + 1.36860666E-08 0.00000000E+00 1.51274396E-08-6.26996722E-03 8.95373540E-09 +-6.95312870E-03 9.87578072E-09 7.05645206E-02 0.00000000E+00-4.67596085E-07 + 0.00000000E+00-4.91425057E-03 1.64588205E-17 6.81551076E-07-2.03409289E-20 + 0.00000000E+00 1.38178847E-08 0.00000000E+00-6.85218430E-10-6.37119951E-03 + 9.00212274E-09 3.14167032E-04-4.48008083E-10 1.21802290E-02 0.00000000E+00 +-7.61617838E-05 0.00000000E+00-7.99415342E-04 1.33864769E-18 5.02268388E-06 +-8.92090491E-21-7.47106578E-04-2.15599574E-18-1.45099812E-03 0.00000000E+00 + 3.07133445E-04 4.44730465E-10-2.57944293E-08-1.20078163E-14 0.00000000E+00 + 6.76222674E-10 0.00000000E+00-3.27983074E-14 1.53908965E-03 2.94385131E-18 + 6.15723009E-03 1.48108090E-17 2.94598711E-03 0.00000000E+00 1.17838856E-02 + 0.00000000E+00-6.95312870E-03-9.87578072E-09-5.05298214E-08-2.44013526E-14 + 0.00000000E+00-1.51274396E-08 0.00000000E+00-6.66750274E-14 1.53908661E-03 + 3.42184946E-18-7.92595845E-04-2.55270792E-18 2.94597858E-03 0.00000000E+00 +-1.49495262E-03 0.00000000E+00 3.24651558E-04 4.52998434E-10-2.47524450E-08 +-1.17942481E-14 0.00000000E+00 6.98697958E-10 0.00000000E+00-3.18670495E-14 + 2.85800537E-03 0.00000000E+00 1.44933666E-03-5.68013166E-18 0.00000000E+00 +-1.36405842E-08 0.00000000E+00-7.08981444E-11 6.23420865E-03-8.93708917E-09 + 3.24203814E-05-4.64361192E-11 2.32160061E-02 0.00000000E+00 2.94598711E-03 + 0.00000000E+00 1.19529990E-02-3.34799311E-17 1.53908965E-03-2.94385131E-18 + 0.00000000E+00-1.36860666E-08 0.00000000E+00 7.10293376E-11 6.26996722E-03 +-8.95373540E-09-3.25235591E-05 4.64841505E-11 1.36207245E-03 3.04008775E-18 + 2.76990525E-03 0.00000000E+00-6.09169854E-03-8.87374277E-09-3.16819438E-05 +-4.61065763E-11 0.00000000E+00-1.34638988E-08 0.00000000E+00-6.99809030E-11 + 1.12449333E-02 3.76020280E-17 1.44933953E-03 6.11107317E-18 2.25117111E-02 + 0.00000000E+00 2.85801370E-03 0.00000000E+00-6.12887334E-03-8.88981987E-09 + 3.17892105E-05 4.61529696E-11 0.00000000E+00-1.35094556E-08 0.00000000E+00 + 7.01123692E-11-1.40697974E-03 0.00000000E+00-7.02852994E-04 2.28779023E-18 + 0.00000000E+00 6.67372409E-10 0.00000000E+00-3.28665539E-14-2.99827075E-04 + 4.41636413E-10 2.68166749E-08-1.15983180E-14 2.85801370E-03 0.00000000E+00 + 1.14319930E-02 0.00000000E+00 1.44933953E-03-6.11107317E-18 5.79824020E-03 +-2.16372021E-17 0.00000000E+00-1.49325951E-08 0.00000000E+00-6.52765307E-14 + 6.80017701E-03-9.80461063E-09 5.25677114E-08-2.35606900E-14 2.85800537E-03 + 0.00000000E+00-1.45099812E-03 0.00000000E+00 1.44933666E-03-5.68013166E-18 +-7.47106578E-04 2.15599574E-18 0.00000000E+00 6.90119262E-10 0.00000000E+00 +-3.27983074E-14-3.18059662E-04 4.49816813E-10 2.57944293E-08-1.20078163E-14 + 2.68166749E-08 1.15983180E-14 0.00000000E+00 3.28665539E-14 6.25539432E-06 + 1.04679558E-20 3.73521979E-08 6.77853265E-23-7.71553849E-05 0.00000000E+00 +-4.62235445E-07 0.00000000E+00-3.17892105E-05-4.61529696E-11 5.25677114E-08 + 2.35606900E-14 0.00000000E+00-7.01123692E-11 0.00000000E+00 6.52765307E-14 + 6.48478920E-07-1.62302013E-20-9.48219322E-08-3.16523927E-22-5.92939934E-07 + 0.00000000E+00 1.22811606E-06 0.00000000E+00 3.24203814E-05 4.64361192E-11 + 2.57944293E-08 1.20078163E-14 0.00000000E+00 7.08981444E-11 0.00000000E+00 + 3.27983074E-14-5.60688079E-06-2.46752675E-20 3.37433385E-08 1.49288089E-22 + 7.65625281E-05 0.00000000E+00-4.58935065E-07 0.00000000E+00-3.11186075E-04 +-4.46548937E-10 0.00000000E+00-6.81292836E-10-9.96966728E-04-1.81676061E-18 +-6.21021561E-06-1.22191074E-20 1.23376595E-02 0.00000000E+00 7.71084415E-05 + 0.00000000E+00 6.12887334E-03 8.88981987E-09 6.80017701E-03 9.80461063E-09 + 0.00000000E+00 1.35094556E-08 0.00000000E+00 1.49325951E-08-5.48481058E-03 +-1.96428880E-17 6.48478920E-07-1.62302013E-20 7.10187395E-02 0.00000000E+00 +-5.92939934E-07 0.00000000E+00 6.23420865E-03 8.93708917E-09-3.07133445E-04 +-4.44730465E-10 0.00000000E+00 1.36405842E-08 0.00000000E+00-6.76222674E-10 +-9.00646732E-04-3.97306525E-18 5.65436039E-06 2.50465941E-20 1.22496388E-02 + 0.00000000E+00-7.66002865E-05 0.00000000E+00 0.00000000E+00 3.28665539E-14 +-2.68166749E-08 1.15983180E-14-7.71553849E-05 0.00000000E+00-4.62235445E-07 + 0.00000000E+00 6.25539432E-06-1.04679558E-20 3.73521979E-08-6.77853265E-23 + 0.00000000E+00-7.01123692E-11 0.00000000E+00 6.52765307E-14 3.17892105E-05 +-4.61529696E-11-5.25677114E-08 2.35606900E-14-5.92939934E-07 0.00000000E+00 + 1.22811606E-06 0.00000000E+00 6.48478920E-07 1.62302013E-20-9.48219322E-08 + 3.16523927E-22 0.00000000E+00 7.08981444E-11 0.00000000E+00 3.27983074E-14 +-3.24203814E-05 4.64361192E-11-2.57944293E-08 1.20078163E-14 7.65625281E-05 + 0.00000000E+00-4.58935065E-07 0.00000000E+00-5.60688079E-06 2.46752675E-20 + 3.37433385E-08-1.49288089E-22 0.00000000E+00-6.81292836E-10 3.11186075E-04 +-4.46548937E-10 1.23376595E-02 0.00000000E+00 7.71084415E-05 0.00000000E+00 +-9.96966728E-04 1.81676061E-18-6.21021561E-06 1.22191074E-20 0.00000000E+00 + 1.35094556E-08 0.00000000E+00 1.49325951E-08-6.12887334E-03 8.88981987E-09 +-6.80017701E-03 9.80461063E-09 7.10187395E-02 0.00000000E+00-5.92939934E-07 + 0.00000000E+00-5.48481058E-03 1.96428880E-17 6.48478920E-07 1.62302013E-20 + 0.00000000E+00 1.36405842E-08 0.00000000E+00-6.76222674E-10-6.23420865E-03 + 8.93708917E-09 3.07133445E-04-4.44730465E-10 1.22496388E-02 0.00000000E+00 +-7.66002865E-05 0.00000000E+00-9.00646732E-04 3.97306525E-18 5.65436039E-06 +-2.50465941E-20-7.02852994E-04-2.28779023E-18-1.40697974E-03 0.00000000E+00 + 2.99827075E-04 4.41636413E-10-2.68166749E-08-1.15983180E-14 0.00000000E+00 + 6.67372409E-10 0.00000000E+00-3.28665539E-14 1.44933953E-03 6.11107317E-18 + 5.79824020E-03 2.16372021E-17 2.85801370E-03 0.00000000E+00 1.14319930E-02 + 0.00000000E+00-6.80017701E-03-9.80461063E-09-5.25677114E-08-2.35606900E-14 + 0.00000000E+00-1.49325951E-08 0.00000000E+00-6.52765307E-14 1.44933666E-03 + 5.68013166E-18-7.47106578E-04-2.15599574E-18 2.85800537E-03 0.00000000E+00 +-1.45099812E-03 0.00000000E+00 3.18059662E-04 4.49816813E-10-2.57944293E-08 +-1.20078163E-14 0.00000000E+00 6.90119262E-10 0.00000000E+00-3.27983074E-14 + 2.76990525E-03 0.00000000E+00 1.36207245E-03-3.04008775E-18 0.00000000E+00 +-1.34638988E-08 0.00000000E+00-6.99809030E-11 6.09169854E-03-8.87374277E-09 + 3.16819438E-05-4.61065763E-11 2.25117111E-02 0.00000000E+00 2.85801370E-03 + 0.00000000E+00 1.12449333E-02-3.76020280E-17 1.44933953E-03-6.11107317E-18 + 0.00000000E+00-1.35094556E-08 0.00000000E+00 7.01123692E-11 6.12887334E-03 +-8.88981987E-09-3.17892105E-05 4.61529696E-11 1.27732442E-03 3.05731501E-18 + 2.68168461E-03 0.00000000E+00-5.94383606E-03-8.81301972E-09-3.09156127E-05 +-4.57904585E-11 0.00000000E+00-1.32869055E-08 0.00000000E+00-6.90616785E-11 + 1.05568748E-02 2.31423721E-17 1.36207505E-03 2.80774801E-18 2.18064239E-02 + 0.00000000E+00 2.76991309E-03 0.00000000E+00-5.98235557E-03-8.82835597E-09 + 3.10267592E-05 4.58347104E-11 0.00000000E+00-1.33323599E-08 0.00000000E+00 + 6.91928317E-11-1.36289942E-03 0.00000000E+00-6.59849867E-04 1.46626575E-18 + 0.00000000E+00 6.58538240E-10 0.00000000E+00-3.27883037E-14-2.92262604E-04 + 4.38695692E-10 2.77866368E-08-1.10629697E-14 2.76991309E-03 0.00000000E+00 + 1.10795939E-02 0.00000000E+00 1.36207505E-03-2.80774801E-18 5.44919369E-03 +-1.27738326E-17 0.00000000E+00-1.47378923E-08 0.00000000E+00-6.56496329E-14 + 6.64118516E-03-9.73590007E-09 5.45772996E-08-2.26249349E-14 2.76990525E-03 + 0.00000000E+00-1.40697974E-03 0.00000000E+00 1.36207245E-03-3.04008775E-18 +-7.02852994E-04 2.28779023E-18 0.00000000E+00 6.81292836E-10 0.00000000E+00 +-3.28665539E-14-3.11186075E-04 4.46548937E-10 2.68166749E-08-1.15983180E-14 + 2.77866368E-08 1.10629697E-14 0.00000000E+00 3.27883037E-14 6.82743009E-06 + 2.23292373E-20 4.07869254E-08 1.24638917E-22-7.78341907E-05 0.00000000E+00 +-4.66275246E-07 0.00000000E+00-3.10267592E-05-4.58347104E-11 5.45772996E-08 + 2.26249349E-14 0.00000000E+00-6.91928317E-11 0.00000000E+00 6.56496329E-14 + 6.17196715E-07 1.05720579E-20-1.04211851E-07-1.95429406E-22-7.25735013E-07 + 0.00000000E+00 1.23789513E-06 0.00000000E+00 3.16819438E-05 4.61065763E-11 + 2.68166749E-08 1.15983180E-14 0.00000000E+00 6.99809030E-11 0.00000000E+00 + 3.28665539E-14-6.21021561E-06-1.22191074E-20 3.73521979E-08 6.77853265E-23 + 7.71084415E-05 0.00000000E+00-4.62235445E-07 0.00000000E+00-3.04032476E-04 +-4.43381770E-10 0.00000000E+00-6.72427060E-10-1.08863769E-03-3.32907175E-18 +-6.78442686E-06-1.92869892E-20 1.24454158E-02 0.00000000E+00 7.77774171E-05 + 0.00000000E+00 5.98235557E-03 8.82835597E-09 6.64118516E-03 9.73590007E-09 + 0.00000000E+00 1.33323599E-08 0.00000000E+00 1.47378923E-08-6.02773961E-03 +-8.26850198E-18 6.17196715E-07 1.05720579E-20 7.15835232E-02 0.00000000E+00 +-7.25735013E-07 0.00000000E+00 6.09169854E-03 8.87374277E-09-2.99827075E-04 +-4.41636413E-10 0.00000000E+00 1.34638988E-08 0.00000000E+00-6.67372409E-10 +-9.96966728E-04-1.81676061E-18 6.25539432E-06 1.04679558E-20 1.23376595E-02 + 0.00000000E+00-7.71553849E-05 0.00000000E+00 0.00000000E+00 3.27883037E-14 +-2.77866368E-08 1.10629697E-14-7.78341907E-05 0.00000000E+00-4.66275246E-07 + 0.00000000E+00 6.82743009E-06-2.23292373E-20 4.07869254E-08-1.24638917E-22 + 0.00000000E+00-6.91928317E-11 0.00000000E+00 6.56496329E-14 3.10267592E-05 +-4.58347104E-11-5.45772996E-08 2.26249349E-14-7.25735013E-07 0.00000000E+00 + 1.23789513E-06 0.00000000E+00 6.17196715E-07-1.05720579E-20-1.04211851E-07 + 1.95429406E-22 0.00000000E+00 6.99809030E-11 0.00000000E+00 3.28665539E-14 +-3.16819438E-05 4.61065763E-11-2.68166749E-08 1.15983180E-14 7.71084415E-05 + 0.00000000E+00-4.62235445E-07 0.00000000E+00-6.21021561E-06 1.22191074E-20 + 3.73521979E-08-6.77853265E-23 0.00000000E+00-6.72427060E-10 3.04032476E-04 +-4.43381770E-10 1.24454158E-02 0.00000000E+00 7.77774171E-05 0.00000000E+00 +-1.08863769E-03 3.32907175E-18-6.78442686E-06 1.92869892E-20 0.00000000E+00 + 1.33323599E-08 0.00000000E+00 1.47378923E-08-5.98235557E-03 8.82835597E-09 +-6.64118516E-03 9.73590007E-09 7.15835232E-02 0.00000000E+00-7.25735013E-07 + 0.00000000E+00-6.02773961E-03 8.26850198E-18 6.17196715E-07-1.05720579E-20 + 0.00000000E+00 1.34638988E-08 0.00000000E+00-6.67372409E-10-6.09169854E-03 + 8.87374277E-09 2.99827075E-04-4.41636413E-10 1.23376595E-02 0.00000000E+00 +-7.71553849E-05 0.00000000E+00-9.96966728E-04 1.81676061E-18 6.25539432E-06 +-1.04679558E-20-6.59849867E-04-1.46626575E-18-1.36289942E-03 0.00000000E+00 + 2.92262604E-04 4.38695692E-10-2.77866368E-08-1.10629697E-14 0.00000000E+00 + 6.58538240E-10 0.00000000E+00-3.27883037E-14 1.36207505E-03 2.80774801E-18 + 5.44919369E-03 1.27738326E-17 2.76991309E-03 0.00000000E+00 1.10795939E-02 + 0.00000000E+00-6.64118516E-03-9.73590007E-09-5.45772996E-08-2.26249349E-14 + 0.00000000E+00-1.47378923E-08 0.00000000E+00-6.56496329E-14 1.36207245E-03 + 3.04008775E-18-7.02852994E-04-2.28779023E-18 2.76990525E-03 0.00000000E+00 +-1.40697974E-03 0.00000000E+00 3.11186075E-04 4.46548937E-10-2.68166749E-08 +-1.15983180E-14 0.00000000E+00 6.81292836E-10 0.00000000E+00-3.28665539E-14 + 2.68168461E-03 0.00000000E+00 1.27732442E-03-3.05731501E-18 0.00000000E+00 +-1.32869055E-08 0.00000000E+00-6.90616785E-11 5.94383606E-03-8.81301972E-09 + 3.09156127E-05-4.57904585E-11 2.18064239E-02 0.00000000E+00 2.76991309E-03 + 0.00000000E+00 1.05568748E-02-2.31423721E-17 1.36207505E-03-2.80774801E-18 + 0.00000000E+00-1.33323599E-08 0.00000000E+00 6.91928317E-11 5.98235557E-03 +-8.82835597E-09-3.10267592E-05 4.58347104E-11 1.19512061E-03 1.39689861E-18 + 2.59334972E-03 0.00000000E+00-5.79093911E-03-8.75533657E-09-3.01230336E-05 +-4.54900757E-11 0.00000000E+00-1.31105409E-08 0.00000000E+00-6.81457088E-11 + 9.88905961E-03 1.67633618E-17 1.27732697E-03 2.96168489E-18 2.11002006E-02 + 0.00000000E+00 2.68169239E-03 0.00000000E+00-5.83072227E-03-8.76987770E-09 + 3.02378273E-05 4.55320343E-11 0.00000000E+00-1.31558467E-08 0.00000000E+00 + 6.82764381E-11-1.31876053E-03 0.00000000E+00-6.18111893E-04 1.08964588E-18 + 0.00000000E+00 6.49738915E-10 0.00000000E+00-3.26823163E-14-2.84456802E-04 + 4.35913344E-10 2.86984316E-08-1.04896388E-14 2.68169239E-03 0.00000000E+00 + 1.07267133E-02 0.00000000E+00 1.27732697E-03-2.96168489E-18 5.11021141E-03 +-1.14705075E-17 0.00000000E+00-1.45434672E-08 0.00000000E+00-6.53693113E-14 + 6.47643601E-03-9.67032487E-09 5.64626436E-08-2.14950107E-14 2.68168461E-03 + 0.00000000E+00-1.36289942E-03 0.00000000E+00 1.27732442E-03-3.05731501E-18 +-6.59849867E-04 1.46626575E-18 0.00000000E+00 6.72427060E-10 0.00000000E+00 +-3.27883037E-14-3.04032476E-04 4.43381770E-10 2.77866368E-08-1.10629697E-14 + 2.86984316E-08 1.04896388E-14 0.00000000E+00 3.26823163E-14 7.37170432E-06 + 3.84375963E-20 4.40550936E-08 2.31667469E-22-7.86461491E-05 0.00000000E+00 +-4.71110662E-07 0.00000000E+00-3.02378273E-05-4.55320343E-11 5.64626436E-08 + 2.14950107E-14 0.00000000E+00-6.82764381E-11 0.00000000E+00 6.53693113E-14 + 5.87272147E-07 1.94493728E-20-1.13148204E-07-5.19989384E-22-8.68653192E-07 + 0.00000000E+00 1.24971923E-06 0.00000000E+00 3.09156127E-05 4.57904585E-11 + 2.77866368E-08 1.10629697E-14 0.00000000E+00 6.90616785E-11 0.00000000E+00 + 3.27883037E-14-6.78442686E-06-1.92869892E-20 4.07869254E-08 1.24638917E-22 + 7.77774171E-05 0.00000000E+00-4.66275246E-07 0.00000000E+00-2.96612801E-04 +-4.40356487E-10 0.00000000E+00-6.63582414E-10-1.17586187E-03-6.18093388E-18 +-7.33080602E-06-3.88557215E-20 1.25744071E-02 0.00000000E+00 7.85787590E-05 + 0.00000000E+00 5.83072227E-03 8.76987770E-09 6.47643601E-03 9.67032487E-09 + 0.00000000E+00 1.31558467E-08 0.00000000E+00 1.45434672E-08-6.54446452E-03 +-3.24184989E-17 5.87272147E-07 1.94493728E-20 7.22665010E-02 0.00000000E+00 +-8.68653192E-07 0.00000000E+00 5.94383606E-03 8.81301972E-09-2.92262604E-04 +-4.38695692E-10 0.00000000E+00 1.32869055E-08 0.00000000E+00-6.58538240E-10 +-1.08863769E-03-3.32907175E-18 6.82743009E-06 2.23292373E-20 1.24454158E-02 + 0.00000000E+00-7.78341907E-05 0.00000000E+00 0.00000000E+00 3.26823163E-14 +-2.86984316E-08 1.04896388E-14-7.86461491E-05 0.00000000E+00-4.71110662E-07 + 0.00000000E+00 7.37170432E-06-3.84375963E-20 4.40550936E-08-2.31667469E-22 + 0.00000000E+00-6.82764381E-11 0.00000000E+00 6.53693113E-14 3.02378273E-05 +-4.55320343E-11-5.64626436E-08 2.14950107E-14-8.68653192E-07 0.00000000E+00 + 1.24971923E-06 0.00000000E+00 5.87272147E-07-1.94493728E-20-1.13148204E-07 + 5.19989384E-22 0.00000000E+00 6.90616785E-11 0.00000000E+00 3.27883037E-14 +-3.09156127E-05 4.57904585E-11-2.77866368E-08 1.10629697E-14 7.77774171E-05 + 0.00000000E+00-4.66275246E-07 0.00000000E+00-6.78442686E-06 1.92869892E-20 + 4.07869254E-08-1.24638917E-22 0.00000000E+00-6.63582414E-10 2.96612801E-04 +-4.40356487E-10 1.25744071E-02 0.00000000E+00 7.85787590E-05 0.00000000E+00 +-1.17586187E-03 6.18093388E-18-7.33080602E-06 3.88557215E-20 0.00000000E+00 + 1.31558467E-08 0.00000000E+00 1.45434672E-08-5.83072227E-03 8.76987770E-09 +-6.47643601E-03 9.67032487E-09 7.22665010E-02 0.00000000E+00-8.68653192E-07 + 0.00000000E+00-6.54446452E-03 3.24184989E-17 5.87272147E-07-1.94493728E-20 + 0.00000000E+00 1.32869055E-08 0.00000000E+00-6.58538240E-10-5.94383606E-03 + 8.81301972E-09 2.92262604E-04-4.38695692E-10 1.24454158E-02 0.00000000E+00 +-7.78341907E-05 0.00000000E+00-1.08863769E-03 3.32907175E-18 6.82743009E-06 +-2.23292373E-20-6.18111893E-04-1.08964588E-18-1.31876053E-03 0.00000000E+00 + 2.84456802E-04 4.35913344E-10-2.86984316E-08-1.04896388E-14 0.00000000E+00 + 6.49738915E-10 0.00000000E+00-3.26823163E-14 1.27732697E-03 2.96168489E-18 + 5.11021141E-03 1.14705075E-17 2.68169239E-03 0.00000000E+00 1.07267133E-02 + 0.00000000E+00-6.47643601E-03-9.67032487E-09-5.64626436E-08-2.14950107E-14 + 0.00000000E+00-1.45434672E-08 0.00000000E+00-6.53693113E-14 1.27732442E-03 + 3.05731501E-18-6.59849867E-04-1.46626575E-18 2.68168461E-03 0.00000000E+00 +-1.36289942E-03 0.00000000E+00 3.04032476E-04 4.43381770E-10-2.77866368E-08 +-1.10629697E-14 0.00000000E+00 6.72427060E-10 0.00000000E+00-3.27883037E-14 + 2.59334972E-03 0.00000000E+00 1.19512061E-03-1.39689861E-18 0.00000000E+00 +-1.31105409E-08 0.00000000E+00-6.81457088E-11 5.79093911E-03-8.75533657E-09 + 3.01230336E-05-4.54900757E-11 2.11002006E-02 0.00000000E+00 2.68169239E-03 + 0.00000000E+00 9.88905961E-03-1.67633618E-17 1.27732697E-03-2.96168489E-18 + 0.00000000E+00-1.31558467E-08 0.00000000E+00 6.82764381E-11 5.83072227E-03 +-8.76987770E-09-3.02378273E-05 4.55320343E-11 1.11548686E-03 3.96637713E-18 + 2.50490315E-03 0.00000000E+00-5.63334961E-03-8.70087613E-09-2.93059884E-05 +-4.52063619E-11 0.00000000E+00-1.29349039E-08 0.00000000E+00-6.72334225E-11 + 9.24170138E-03 2.28171192E-17 1.19512299E-03 1.64733560E-18 2.03930721E-02 + 0.00000000E+00 2.59335717E-03 0.00000000E+00-5.67431196E-03-8.71456610E-09 + 2.94241833E-05 4.52458645E-11 0.00000000E+00-1.29799909E-08 0.00000000E+00 + 6.73635194E-11-1.27456508E-03 0.00000000E+00-5.77652463E-04 1.40342818E-18 + 0.00000000E+00 6.40985460E-10 0.00000000E+00-3.25242441E-14-2.76426913E-04 + 4.33299426E-10 2.95487065E-08-9.87566971E-15 2.59335717E-03 0.00000000E+00 + 1.03733741E-02 0.00000000E+00 1.19512299E-03-1.64733560E-18 4.78140513E-03 +-7.41271617E-18 0.00000000E+00-1.43497176E-08 0.00000000E+00-6.51236672E-14 + 6.30628644E-03-9.60815808E-09 5.82123872E-08-2.03132190E-14 2.59334972E-03 + 0.00000000E+00-1.31876053E-03 0.00000000E+00 1.19512061E-03-1.39689861E-18 +-6.18111893E-04 1.08964588E-18 0.00000000E+00 6.63582414E-10 0.00000000E+00 +-3.26823163E-14-2.96612801E-04 4.40356487E-10 2.86984316E-08-1.04896388E-14 + 2.95487065E-08 9.87566971E-15 0.00000000E+00 3.25242441E-14 7.88921304E-06 + 4.16923935E-20 4.71626151E-08 2.49651837E-22-7.96025705E-05 0.00000000E+00 +-4.76809066E-07 0.00000000E+00-2.94241833E-05-4.52458645E-11 5.82123872E-08 + 2.03132190E-14 0.00000000E+00-6.73635194E-11 0.00000000E+00 6.51236672E-14 + 5.58395968E-07 4.93133083E-21-1.21648058E-07-6.31739241E-22-1.02371274E-06 + 0.00000000E+00 1.26375306E-06 0.00000000E+00 3.01230336E-05 4.54900757E-11 + 2.86984316E-08 1.04896388E-14 0.00000000E+00 6.81457088E-11 0.00000000E+00 + 3.26823163E-14-7.33080602E-06-3.88557215E-20 4.40550936E-08 2.31667469E-22 + 7.85787590E-05 0.00000000E+00-4.71110662E-07 0.00000000E+00-2.88943188E-04 +-4.37482490E-10 0.00000000E+00-6.54762054E-10-1.25879730E-03-6.64815447E-18 +-7.85033210E-06-4.14921855E-20 1.27264309E-02 0.00000000E+00 7.95236358E-05 + 0.00000000E+00 5.67431196E-03 8.71456610E-09 6.30628644E-03 9.60815808E-09 + 0.00000000E+00 1.29799909E-08 0.00000000E+00 1.43497176E-08-7.03592853E-03 +-3.57263373E-17 5.58395968E-07 4.93133083E-21 7.30771816E-02 0.00000000E+00 +-1.02371274E-06 0.00000000E+00 5.79093911E-03 8.75533657E-09-2.84456802E-04 +-4.35913344E-10 0.00000000E+00 1.31105409E-08 0.00000000E+00-6.49738915E-10 +-1.17586187E-03-6.18093388E-18 7.37170432E-06 3.84375963E-20 1.25744071E-02 + 0.00000000E+00-7.86461491E-05 0.00000000E+00 0.00000000E+00 3.25242441E-14 +-2.95487065E-08 9.87566971E-15-7.96025705E-05 0.00000000E+00-4.76809066E-07 + 0.00000000E+00 7.88921304E-06-4.16923935E-20 4.71626151E-08-2.49651837E-22 + 0.00000000E+00-6.73635194E-11 0.00000000E+00 6.51236672E-14 2.94241833E-05 +-4.52458645E-11-5.82123872E-08 2.03132190E-14-1.02371274E-06 0.00000000E+00 + 1.26375306E-06 0.00000000E+00 5.58395968E-07-4.93133083E-21-1.21648058E-07 + 6.31739241E-22 0.00000000E+00 6.81457088E-11 0.00000000E+00 3.26823163E-14 +-3.01230336E-05 4.54900757E-11-2.86984316E-08 1.04896388E-14 7.85787590E-05 + 0.00000000E+00-4.71110662E-07 0.00000000E+00-7.33080602E-06 3.88557215E-20 + 4.40550936E-08-2.31667469E-22 0.00000000E+00-6.54762054E-10 2.88943188E-04 +-4.37482490E-10 1.27264309E-02 0.00000000E+00 7.95236358E-05 0.00000000E+00 +-1.25879730E-03 6.64815447E-18-7.85033210E-06 4.14921855E-20 0.00000000E+00 + 1.29799909E-08 0.00000000E+00 1.43497176E-08-5.67431196E-03 8.71456610E-09 +-6.30628644E-03 9.60815808E-09 7.30771816E-02 0.00000000E+00-1.02371274E-06 + 0.00000000E+00-7.03592853E-03 3.57263373E-17 5.58395968E-07-4.93133083E-21 + 0.00000000E+00 1.31105409E-08 0.00000000E+00-6.49738915E-10-5.79093911E-03 + 8.75533657E-09 2.84456802E-04-4.35913344E-10 1.25744071E-02 0.00000000E+00 +-7.86461491E-05 0.00000000E+00-1.17586187E-03 6.18093388E-18 7.37170432E-06 +-3.84375963E-20-5.77652463E-04-1.40342818E-18-1.27456508E-03 0.00000000E+00 + 2.76426913E-04 4.33299426E-10-2.95487065E-08-9.87566971E-15 0.00000000E+00 + 6.40985460E-10 0.00000000E+00-3.25242441E-14 1.19512299E-03 1.64733560E-18 + 4.78140513E-03 7.41271617E-18 2.59335717E-03 0.00000000E+00 1.03733741E-02 + 0.00000000E+00-6.30628644E-03-9.60815808E-09-5.82123872E-08-2.03132190E-14 + 0.00000000E+00-1.43497176E-08 0.00000000E+00-6.51236672E-14 1.19512061E-03 + 1.39689861E-18-6.18111893E-04-1.08964588E-18 2.59334972E-03 0.00000000E+00 +-1.31876053E-03 0.00000000E+00 2.96612801E-04 4.40356487E-10-2.86984316E-08 +-1.04896388E-14 0.00000000E+00 6.63582414E-10 0.00000000E+00-3.26823163E-14 + 2.50490315E-03 0.00000000E+00 1.11548686E-03-3.96637713E-18 0.00000000E+00 +-1.29349039E-08 0.00000000E+00-6.72334225E-11 5.63334961E-03-8.70087613E-09 + 2.93059884E-05-4.52063619E-11 2.03930721E-02 0.00000000E+00 2.59335717E-03 + 0.00000000E+00 9.24170138E-03-2.28171192E-17 1.19512299E-03-1.64733560E-18 + 0.00000000E+00-1.29799909E-08 0.00000000E+00 6.73635194E-11 5.67431196E-03 +-8.71456610E-09-2.94241833E-05 4.52458645E-11 1.03844794E-03 2.74371749E-18 + 2.41635056E-03 0.00000000E+00-5.47124959E-03-8.64988315E-09-2.84654675E-05 +-4.49405780E-11 0.00000000E+00-1.27602698E-08 0.00000000E+00-6.63262686E-11 + 8.61500364E-03 2.66218944E-17 1.11548915E-03 3.85561092E-18 1.96850731E-02 + 0.00000000E+00 2.50491035E-03 0.00000000E+00-5.51335675E-03-8.66265612E-09 + 2.85869674E-05 4.49774351E-11 0.00000000E+00-1.28050760E-08 0.00000000E+00 + 6.64555563E-11-1.23031523E-03 0.00000000E+00-5.38484275E-04 1.64983210E-18 + 0.00000000E+00 6.32290000E-10 0.00000000E+00-3.23219183E-14-2.68175973E-04 + 4.30867348E-10 3.03749630E-08-9.21427741E-15 2.50491035E-03 0.00000000E+00 + 1.00195893E-02 0.00000000E+00 1.11548915E-03-3.85561092E-18 4.46287880E-03 +-1.44481902E-17 0.00000000E+00-1.41568942E-08 0.00000000E+00-6.47642424E-14 + 6.13107750E-03-9.54963219E-09 5.98980597E-08-1.90411647E-14 2.50490315E-03 + 0.00000000E+00-1.27456508E-03 0.00000000E+00 1.11548686E-03-3.96637713E-18 +-5.77652463E-04 1.40342818E-18 0.00000000E+00 6.54762054E-10 0.00000000E+00 +-3.25242441E-14-2.88943188E-04 4.37482490E-10 2.95487065E-08-9.87566971E-15 + 3.03749630E-08 9.21427741E-15 0.00000000E+00 3.23219183E-14 8.38111041E-06 + 1.67129568E-20 5.01164202E-08 1.04250059E-22-8.07158229E-05 0.00000000E+00 +-4.83444372E-07 0.00000000E+00-2.85869674E-05-4.49774351E-11 5.98980597E-08 + 1.90411647E-14 0.00000000E+00-6.64555563E-11 0.00000000E+00 6.47642424E-14 + 5.30780368E-07-3.16951190E-20-1.29728807E-07-4.97648537E-22-1.19199185E-06 + 0.00000000E+00 1.28018598E-06 0.00000000E+00 2.93059884E-05 4.52063619E-11 + 2.95487065E-08 9.87566971E-15 0.00000000E+00 6.72334225E-11 0.00000000E+00 + 3.25242441E-14-7.85033210E-06-4.14921855E-20 4.71626151E-08 2.49651837E-22 + 7.95236358E-05 0.00000000E+00-4.76809066E-07 0.00000000E+00-2.81042075E-04 +-4.34770226E-10 0.00000000E+00-6.45980816E-10-1.33762888E-03-2.81435786E-18 +-8.34416290E-06-1.83542046E-20 1.29034602E-02 0.00000000E+00 8.06243489E-05 + 0.00000000E+00 5.51335675E-03 8.66265612E-09 6.13107750E-03 9.54963219E-09 + 0.00000000E+00 1.28050760E-08 0.00000000E+00 1.41568942E-08-7.50315214E-03 +-3.03371737E-17 5.30780368E-07-3.16951190E-20 7.40265694E-02 0.00000000E+00 +-1.19199185E-06 0.00000000E+00 5.63334961E-03 8.70087613E-09-2.76426913E-04 +-4.33299426E-10 0.00000000E+00 1.29349039E-08 0.00000000E+00-6.40985460E-10 +-1.25879730E-03-6.64815447E-18 7.88921304E-06 4.16923935E-20 1.27264309E-02 + 0.00000000E+00-7.96025705E-05 0.00000000E+00 0.00000000E+00 3.23219183E-14 +-3.03749630E-08 9.21427741E-15-8.07158229E-05 0.00000000E+00-4.83444372E-07 + 0.00000000E+00 8.38111041E-06-1.67129568E-20 5.01164202E-08-1.04250059E-22 + 0.00000000E+00-6.64555563E-11 0.00000000E+00 6.47642424E-14 2.85869674E-05 +-4.49774351E-11-5.98980597E-08 1.90411647E-14-1.19199185E-06 0.00000000E+00 + 1.28018598E-06 0.00000000E+00 5.30780368E-07 3.16951190E-20-1.29728807E-07 + 4.97648537E-22 0.00000000E+00 6.72334225E-11 0.00000000E+00 3.25242441E-14 +-2.93059884E-05 4.52063619E-11-2.95487065E-08 9.87566971E-15 7.95236358E-05 + 0.00000000E+00-4.76809066E-07 0.00000000E+00-7.85033210E-06 4.14921855E-20 + 4.71626151E-08-2.49651837E-22 0.00000000E+00-6.45980816E-10 2.81042075E-04 +-4.34770226E-10 1.29034602E-02 0.00000000E+00 8.06243489E-05 0.00000000E+00 +-1.33762888E-03 2.81435786E-18-8.34416290E-06 1.83542046E-20 0.00000000E+00 + 1.28050760E-08 0.00000000E+00 1.41568942E-08-5.51335675E-03 8.66265612E-09 +-6.13107750E-03 9.54963219E-09 7.40265694E-02 0.00000000E+00-1.19199185E-06 + 0.00000000E+00-7.50315214E-03 3.03371737E-17 5.30780368E-07 3.16951190E-20 + 0.00000000E+00 1.29349039E-08 0.00000000E+00-6.40985460E-10-5.63334961E-03 + 8.70087613E-09 2.76426913E-04-4.33299426E-10 1.27264309E-02 0.00000000E+00 +-7.96025705E-05 0.00000000E+00-1.25879730E-03 6.64815447E-18 7.88921304E-06 +-4.16923935E-20-5.38484275E-04-1.64983210E-18-1.23031523E-03 0.00000000E+00 + 2.68175973E-04 4.30867348E-10-3.03749630E-08-9.21427741E-15 0.00000000E+00 + 6.32290000E-10 0.00000000E+00-3.23219183E-14 1.11548915E-03 3.85561092E-18 + 4.46287880E-03 1.44481902E-17 2.50491035E-03 0.00000000E+00 1.00195893E-02 + 0.00000000E+00-6.13107750E-03-9.54963219E-09-5.98980597E-08-1.90411647E-14 + 0.00000000E+00-1.41568942E-08 0.00000000E+00-6.47642424E-14 1.11548686E-03 + 3.96637713E-18-5.77652463E-04-1.40342818E-18 2.50490315E-03 0.00000000E+00 +-1.27456508E-03 0.00000000E+00 2.88943188E-04 4.37482490E-10-2.95487065E-08 +-9.87566971E-15 0.00000000E+00 6.54762054E-10 0.00000000E+00-3.25242441E-14 + 2.41635056E-03 0.00000000E+00 1.03844794E-03-2.74371749E-18 0.00000000E+00 +-1.27602698E-08 0.00000000E+00-6.63262686E-11 5.47124959E-03-8.64988315E-09 + 2.84654675E-05-4.49405780E-11 1.96850731E-02 0.00000000E+00 2.50491035E-03 + 0.00000000E+00 8.61500364E-03-2.66218944E-17 1.11548915E-03-3.85561092E-18 + 0.00000000E+00-1.28050760E-08 0.00000000E+00 6.64555563E-11 5.51335675E-03 +-8.66265612E-09-2.85869674E-05 4.49774351E-11 9.64026674E-04 2.60236754E-18 + 2.32769606E-03 0.00000000E+00-5.30486915E-03-8.60264674E-09-2.76026374E-05 +-4.46942102E-11 0.00000000E+00-1.25869062E-08 0.00000000E+00-6.54256218E-11 + 8.00915517E-03 2.08450139E-17 1.03845000E-03 2.69087132E-18 1.89762427E-02 + 0.00000000E+00 2.41635754E-03 0.00000000E+00-5.34805454E-03-8.61442331E-09 + 2.77272478E-05 4.47281925E-11 0.00000000E+00-1.26313576E-08 0.00000000E+00 + 6.55538857E-11-1.18601340E-03 0.00000000E+00-5.00619168E-04 1.32330972E-18 + 0.00000000E+00 6.23667596E-10 0.00000000E+00-3.20659859E-14-2.59719415E-04 + 4.28633317E-10 3.11526041E-08-8.49557253E-15 2.41635754E-03 0.00000000E+00 + 9.66537993E-03 0.00000000E+00 1.03845000E-03-2.69087132E-18 4.15473090E-03 +-1.12329059E-17 0.00000000E+00-1.39652748E-08 0.00000000E+00-6.43088885E-14 + 5.95098212E-03-9.49503098E-09 6.14944277E-08-1.76643049E-14 2.41635056E-03 + 0.00000000E+00-1.23031523E-03 0.00000000E+00 1.03844794E-03-2.74371749E-18 +-5.38484275E-04 1.64983210E-18 0.00000000E+00 6.45980816E-10 0.00000000E+00 +-3.23219183E-14-2.81042075E-04 4.34770226E-10 3.03749630E-08-9.21427741E-15 + 3.11526041E-08 8.49557253E-15 0.00000000E+00 3.20659859E-14 8.84836065E-06 + 4.91079882E-20 5.29223146E-08 2.87945345E-22-8.20006067E-05 0.00000000E+00 +-4.91103965E-07 0.00000000E+00-2.77272478E-05-4.47281925E-11 6.14944277E-08 + 1.76643049E-14 0.00000000E+00-6.55538857E-11 0.00000000E+00 6.43088885E-14 + 5.04189481E-07 4.24739456E-20-1.37407529E-07-4.67883815E-22-1.37600480E-06 + 0.00000000E+00 1.29923084E-06 0.00000000E+00 2.84654675E-05 4.49405780E-11 + 3.03749630E-08 9.21427741E-15 0.00000000E+00 6.63262686E-11 0.00000000E+00 + 3.23219183E-14-8.34416290E-06-1.83542046E-20 5.01164202E-08 1.04250059E-22 + 8.06243489E-05 0.00000000E+00-4.83444372E-07 0.00000000E+00-2.72914959E-04 +-4.32231740E-10 0.00000000E+00-6.37249963E-10-1.41251182E-03-7.64186785E-18 +-8.81327365E-06-4.66109572E-20 1.31078266E-02 0.00000000E+00 8.18953569E-05 + 0.00000000E+00 5.34805454E-03 8.61442331E-09 5.95098212E-03 9.49503098E-09 + 0.00000000E+00 1.26313576E-08 0.00000000E+00 1.39652748E-08-7.94712825E-03 +-2.41655800E-17 5.04189481E-07 4.24739456E-20 7.51268615E-02 0.00000000E+00 +-1.37600480E-06 0.00000000E+00 5.47124959E-03 8.64988315E-09-2.68175973E-04 +-4.30867348E-10 0.00000000E+00 1.27602698E-08 0.00000000E+00-6.32290000E-10 +-1.33762888E-03-2.81435786E-18 8.38111041E-06 1.67129568E-20 1.29034602E-02 + 0.00000000E+00-8.07158229E-05 0.00000000E+00 0.00000000E+00 3.20659859E-14 +-3.11526041E-08 8.49557253E-15-8.20006067E-05 0.00000000E+00-4.91103965E-07 + 0.00000000E+00 8.84836065E-06-4.91079882E-20 5.29223146E-08-2.87945345E-22 + 0.00000000E+00-6.55538857E-11 0.00000000E+00 6.43088885E-14 2.77272478E-05 +-4.47281925E-11-6.14944277E-08 1.76643049E-14-1.37600480E-06 0.00000000E+00 + 1.29923084E-06 0.00000000E+00 5.04189481E-07-4.24739456E-20-1.37407529E-07 + 4.67883815E-22 0.00000000E+00 6.63262686E-11 0.00000000E+00 3.23219183E-14 +-2.84654675E-05 4.49405780E-11-3.03749630E-08 9.21427741E-15 8.06243489E-05 + 0.00000000E+00-4.83444372E-07 0.00000000E+00-8.34416290E-06 1.83542046E-20 + 5.01164202E-08-1.04250059E-22 0.00000000E+00-6.37249963E-10 2.72914959E-04 +-4.32231740E-10 1.31078266E-02 0.00000000E+00 8.18953569E-05 0.00000000E+00 +-1.41251182E-03 7.64186785E-18-8.81327365E-06 4.66109572E-20 0.00000000E+00 + 1.26313576E-08 0.00000000E+00 1.39652748E-08-5.34805454E-03 8.61442331E-09 +-5.95098212E-03 9.49503098E-09 7.51268615E-02 0.00000000E+00-1.37600480E-06 + 0.00000000E+00-7.94712825E-03 2.41655800E-17 5.04189481E-07-4.24739456E-20 + 0.00000000E+00 1.27602698E-08 0.00000000E+00-6.32290000E-10-5.47124959E-03 + 8.64988315E-09 2.68175973E-04-4.30867348E-10 1.29034602E-02 0.00000000E+00 +-8.07158229E-05 0.00000000E+00-1.33762888E-03 2.81435786E-18 8.38111041E-06 +-1.67129568E-20-5.00619168E-04-1.32330972E-18-1.18601340E-03 0.00000000E+00 + 2.59719415E-04 4.28633317E-10-3.11526041E-08-8.49557253E-15 0.00000000E+00 + 6.23667596E-10 0.00000000E+00-3.20659859E-14 1.03845000E-03 2.69087132E-18 + 4.15473090E-03 1.12329059E-17 2.41635754E-03 0.00000000E+00 9.66537993E-03 + 0.00000000E+00-5.95098212E-03-9.49503098E-09-6.14944277E-08-1.76643049E-14 + 0.00000000E+00-1.39652748E-08 0.00000000E+00-6.43088885E-14 1.03844794E-03 + 2.74371749E-18-5.38484275E-04-1.64983210E-18 2.41635056E-03 0.00000000E+00 +-1.23031523E-03 0.00000000E+00 2.81042075E-04 4.34770226E-10-3.03749630E-08 +-9.21427741E-15 0.00000000E+00 6.45980816E-10 0.00000000E+00-3.23219183E-14 + 2.32769606E-03 0.00000000E+00 9.64026674E-04-2.60236754E-18 0.00000000E+00 +-1.25869062E-08 0.00000000E+00-6.54256218E-11 5.30486915E-03-8.60264674E-09 + 2.76026374E-05-4.46942102E-11 1.89762427E-02 0.00000000E+00 2.41635754E-03 + 0.00000000E+00 8.00915517E-03-2.08450139E-17 1.03845000E-03-2.69087132E-18 + 0.00000000E+00-1.26313576E-08 0.00000000E+00 6.55538857E-11 5.34805454E-03 +-8.61442331E-09-2.77272478E-05 4.47281925E-11-1.14166164E-03 0.00000000E+00 +-4.64068653E-04 1.34638817E-18 0.00000000E+00 6.15134126E-10 0.00000000E+00 +-3.17522453E-14-2.51065172E-04 4.26616148E-10 3.18946474E-08-7.70969791E-15 + 2.32770277E-03 0.00000000E+00 9.31076291E-03 0.00000000E+00 9.64028625E-04 +-2.74068541E-18 3.85705378E-03-1.06809089E-17 0.00000000E+00-1.37751734E-08 + 0.00000000E+00-6.37432871E-14 5.76626625E-03-9.44469362E-09 6.30282266E-08 +-1.61644781E-14 2.32769606E-03 0.00000000E+00-1.18601340E-03 0.00000000E+00 + 9.64026674E-04-2.60236754E-18-5.00619168E-04 1.32330972E-18 0.00000000E+00 + 6.37249963E-10 0.00000000E+00-3.20659859E-14-2.72914959E-04 4.32231740E-10 + 3.11526041E-08-8.49557253E-15 3.18946474E-08 7.70969791E-15 0.00000000E+00 + 3.17522453E-14 9.29203452E-06 5.64696845E-21 5.55866977E-08 4.62362673E-23 +-8.34741005E-05 0.00000000E+00-4.99890238E-07 0.00000000E+00-2.68460972E-05 +-4.44998502E-11 6.30282266E-08 1.61644781E-14 0.00000000E+00-6.46600521E-11 + 0.00000000E+00 6.37432871E-14 4.78775999E-07-5.40337409E-20-1.44700252E-07 +-5.34512247E-22-1.57834559E-06 0.00000000E+00 1.32114146E-06 0.00000000E+00 + 2.76026374E-05 4.46942102E-11 3.11526041E-08 8.49557253E-15 0.00000000E+00 + 6.54256218E-11 0.00000000E+00 3.20659859E-14-8.81327365E-06-4.66109572E-20 + 5.29223146E-08 2.87945345E-22 8.18953569E-05 0.00000000E+00-4.91103965E-07 + 0.00000000E+00-2.64574906E-04-4.29881653E-10 0.00000000E+00-6.28583539E-10 +-1.48361675E-03-1.26828986E-18-9.25872775E-06-1.00796796E-20 1.33422631E-02 + 0.00000000E+00 8.33536544E-05 0.00000000E+00 5.17861683E-03 8.57019458E-09 + 5.76626625E-03 9.44469362E-09 0.00000000E+00 1.24591315E-08 0.00000000E+00 + 1.37751734E-08-8.36877132E-03-3.51097855E-17 4.78775999E-07-5.40337409E-20 + 7.63927802E-02 0.00000000E+00-1.57834559E-06 0.00000000E+00 5.30486915E-03 + 8.60264674E-09-2.59719415E-04-4.28633317E-10 0.00000000E+00 1.25869062E-08 + 0.00000000E+00-6.23667596E-10-1.41251182E-03-7.64186785E-18 8.84836065E-06 + 4.91079882E-20 1.31078266E-02 0.00000000E+00-8.20006067E-05 0.00000000E+00 + 0.00000000E+00 3.17522453E-14-3.18946474E-08 7.70969791E-15-8.34741005E-05 + 0.00000000E+00-4.99890238E-07 0.00000000E+00 9.29203452E-06-5.64696845E-21 + 5.55866977E-08-4.62362673E-23 0.00000000E+00-6.46600521E-11 0.00000000E+00 + 6.37432871E-14 2.68460972E-05-4.44998502E-11-6.30282266E-08 1.61644781E-14 +-1.57834559E-06 0.00000000E+00 1.32114146E-06 0.00000000E+00 4.78775999E-07 + 5.40337409E-20-1.44700252E-07 5.34512247E-22 0.00000000E+00 6.54256218E-11 + 0.00000000E+00 3.20659859E-14-2.76026374E-05 4.46942102E-11-3.11526041E-08 + 8.49557253E-15 8.18953569E-05 0.00000000E+00-4.91103965E-07 0.00000000E+00 +-8.81327365E-06 4.66109572E-20 5.29223146E-08-2.87945345E-22 0.00000000E+00 +-6.28583539E-10 2.64574906E-04-4.29881653E-10 1.33422631E-02 0.00000000E+00 + 8.33536544E-05 0.00000000E+00-1.48361675E-03 1.26828986E-18-9.25872775E-06 + 1.00796796E-20 0.00000000E+00 1.24591315E-08 0.00000000E+00 1.37751734E-08 +-5.17861683E-03 8.57019458E-09-5.76626625E-03 9.44469362E-09 7.63927802E-02 + 0.00000000E+00-1.57834559E-06 0.00000000E+00-8.36877132E-03 3.51097855E-17 + 4.78775999E-07 5.40337409E-20 0.00000000E+00 1.25869062E-08 0.00000000E+00 +-6.23667596E-10-5.30486915E-03 8.60264674E-09 2.59719415E-04-4.28633317E-10 + 1.31078266E-02 0.00000000E+00-8.20006067E-05 0.00000000E+00-1.41251182E-03 + 7.64186785E-18 8.84836065E-06-4.91079882E-20-4.64068653E-04-1.34638817E-18 +-1.14166164E-03 0.00000000E+00 2.51065172E-04 4.26616148E-10-3.18946474E-08 +-7.70969791E-15 0.00000000E+00 6.15134126E-10 0.00000000E+00-3.17522453E-14 + 9.64028625E-04 2.74068541E-18 3.85705378E-03 1.06809089E-17 2.32770277E-03 + 0.00000000E+00 9.31076291E-03 0.00000000E+00-5.76626625E-03-9.44469362E-09 +-6.30282266E-08-1.61644781E-14 0.00000000E+00-1.37751734E-08 0.00000000E+00 +-6.37432871E-14 9.64026674E-04 2.60236754E-18-5.00619168E-04-1.32330972E-18 + 2.32769606E-03 0.00000000E+00-1.18601340E-03 0.00000000E+00 2.72914959E-04 + 4.32231740E-10-3.11526041E-08-8.49557253E-15 0.00000000E+00 6.37249963E-10 + 0.00000000E+00-3.20659859E-14 8.92245988E-04 2.64486728E-18 2.23894378E-03 + 0.00000000E+00-5.13440324E-03-8.55950758E-09-2.67185186E-05-4.44690114E-11 + 0.00000000E+00-1.24151153E-08 0.00000000E+00-6.45330432E-11 7.42434076E-03 + 2.19332035E-17 9.64028625E-04 2.74068541E-18 1.82666133E-02 0.00000000E+00 + 2.32770277E-03 0.00000000E+00-5.17861683E-03-8.57019458E-09 2.68460972E-05 + 4.44998502E-11 0.00000000E+00-1.24591315E-08 0.00000000E+00 6.46600521E-11 + 2.23894378E-03 0.00000000E+00 8.92245988E-04-2.64486728E-18 0.00000000E+00 +-1.24151153E-08 0.00000000E+00-6.45330432E-11 5.13440324E-03-8.55950758E-09 + 2.67185186E-05-4.44690114E-11 1.82666133E-02 0.00000000E+00 2.32770277E-03 + 0.00000000E+00 7.42434076E-03-2.19332035E-17 9.64028625E-04-2.74068541E-18 + 0.00000000E+00-1.24591315E-08 0.00000000E+00 6.46600521E-11 5.17861683E-03 +-8.57019458E-09-2.68460972E-05 4.44998502E-11-1.09726207E-03 0.00000000E+00 +-4.28843512E-04 1.16940036E-18 0.00000000E+00 6.06708075E-10 0.00000000E+00 +-3.13723869E-14-2.42230261E-04 4.24838612E-10 3.25816368E-08-6.84323783E-15 + 2.23895021E-03 0.00000000E+00 8.95575477E-03 0.00000000E+00 8.92247759E-04 +-2.44011470E-18 3.56993802E-03-1.01306976E-17 0.00000000E+00-1.35869347E-08 + 0.00000000E+00-6.30531016E-14 5.57715865E-03-9.39901980E-09 6.44499972E-08 +-1.45165056E-14 2.23894378E-03 0.00000000E+00-1.14166164E-03 0.00000000E+00 + 8.92245988E-04-2.64486728E-18-4.64068653E-04 1.34638817E-18 0.00000000E+00 + 6.28583539E-10 0.00000000E+00-3.17522453E-14-2.64574906E-04 4.29881653E-10 + 3.18946474E-08-7.70969791E-15 8.23126291E-04 2.23748674E-18 2.15009806E-03 + 0.00000000E+00-4.96013274E-03-8.52087362E-09-2.58145508E-05-4.42670791E-11 + 0.00000000E+00-1.22452374E-08 0.00000000E+00-6.36502883E-11 6.86073275E-03 + 1.81848843E-17 8.92247759E-04 2.44011470E-18 1.75562188E-02 0.00000000E+00 + 2.23895021E-03 0.00000000E+00-5.00529878E-03-8.53035934E-09 2.59448774E-05 + 4.42944520E-11 0.00000000E+00-1.22887268E-08 0.00000000E+00 6.37757779E-11 + 2.15009806E-03 0.00000000E+00 8.23126291E-04-2.23748674E-18 0.00000000E+00 +-1.22452374E-08 0.00000000E+00-6.36502883E-11 4.96013274E-03-8.52087362E-09 + 2.58145508E-05-4.42670791E-11 1.75562188E-02 0.00000000E+00 2.23895021E-03 + 0.00000000E+00 6.86073275E-03-1.81848843E-17 8.92247759E-04-2.44011470E-18 + 0.00000000E+00-1.22887268E-08 0.00000000E+00 6.37757779E-11 5.00529878E-03 +-8.53035934E-09-2.59448774E-05 4.42944520E-11 3.25816368E-08 6.84323783E-15 + 0.00000000E+00 3.13723869E-14 9.71289579E-06 1.56589631E-20 5.81142382E-08 + 8.54113169E-23-8.51570274E-05 0.00000000E+00-5.09926482E-07 0.00000000E+00 +-2.59448774E-05-4.42944520E-11 6.44499972E-08 1.45165056E-14 0.00000000E+00 +-6.37757779E-11 0.00000000E+00 6.30531016E-14 4.54180716E-07 1.35644802E-20 +-1.51622241E-07-8.38077942E-23-1.80288328E-06 0.00000000E+00 1.34621721E-06 + 0.00000000E+00 2.67185186E-05 4.44690114E-11 3.18946474E-08 7.70969791E-15 + 0.00000000E+00 6.45330432E-11 0.00000000E+00 3.17522453E-14-9.25872775E-06 +-1.00796796E-20 5.55866977E-08 4.62362673E-23 8.33536544E-05 0.00000000E+00 +-4.99890238E-07 0.00000000E+00-2.56031009E-04-4.27737067E-10 0.00000000E+00 +-6.19996533E-10-1.55106850E-03-2.27307376E-18-9.68132126E-06-1.27882614E-20 + 1.36100596E-02 0.00000000E+00 8.50196577E-05 0.00000000E+00 5.00529878E-03 + 8.53035934E-09 5.57715865E-03 9.39901980E-09 0.00000000E+00 1.22887268E-08 + 0.00000000E+00 1.35869347E-08-8.76898833E-03-7.93120732E-19 4.54180716E-07 + 1.35644802E-20 7.78415606E-02 0.00000000E+00-1.80288328E-06 0.00000000E+00 + 5.13440324E-03 8.55950758E-09-2.51065172E-04-4.26616148E-10 0.00000000E+00 + 1.24151153E-08 0.00000000E+00-6.15134126E-10-1.48361675E-03-1.26828986E-18 + 9.29203452E-06 5.64696845E-21 1.33422631E-02 0.00000000E+00-8.34741005E-05 + 0.00000000E+00 0.00000000E+00 3.13723869E-14-3.25816368E-08 6.84323783E-15 +-8.51570274E-05 0.00000000E+00-5.09926482E-07 0.00000000E+00 9.71289579E-06 +-1.56589631E-20 5.81142382E-08-8.54113169E-23 0.00000000E+00-6.37757779E-11 + 0.00000000E+00 6.30531016E-14 2.59448774E-05-4.42944520E-11-6.44499972E-08 + 1.45165056E-14-1.80288328E-06 0.00000000E+00 1.34621721E-06 0.00000000E+00 + 4.54180716E-07-1.35644802E-20-1.51622241E-07 8.38077942E-23 0.00000000E+00 + 6.45330432E-11 0.00000000E+00 3.17522453E-14-2.67185186E-05 4.44690114E-11 +-3.18946474E-08 7.70969791E-15 8.33536544E-05 0.00000000E+00-4.99890238E-07 + 0.00000000E+00-9.25872775E-06 1.00796796E-20 5.55866977E-08-4.62362673E-23 + 0.00000000E+00-6.19996533E-10 2.56031009E-04-4.27737067E-10 1.36100596E-02 + 0.00000000E+00 8.50196577E-05 0.00000000E+00-1.55106850E-03 2.27307376E-18 +-9.68132126E-06 1.27882614E-20 0.00000000E+00 1.22887268E-08 0.00000000E+00 + 1.35869347E-08-5.00529878E-03 8.53035934E-09-5.57715865E-03 9.39901980E-09 + 7.78415606E-02 0.00000000E+00-1.80288328E-06 0.00000000E+00-8.76898833E-03 + 7.93120732E-19 4.54180716E-07-1.35644802E-20 0.00000000E+00 1.24151153E-08 + 0.00000000E+00-6.15134126E-10-5.13440324E-03 8.55950758E-09 2.51065172E-04 +-4.26616148E-10 1.33422631E-02 0.00000000E+00-8.34741005E-05 0.00000000E+00 +-1.48361675E-03 1.26828986E-18 9.29203452E-06-5.64696845E-21-4.28843512E-04 +-1.16940036E-18-1.09726207E-03 0.00000000E+00 2.42230261E-04 4.24838612E-10 +-3.25816368E-08-6.84323783E-15 0.00000000E+00 6.06708075E-10 0.00000000E+00 +-3.13723869E-14 8.92247759E-04 2.44011470E-18 3.56993802E-03 1.01306976E-17 + 2.23895021E-03 0.00000000E+00 8.95575477E-03 0.00000000E+00-5.57715865E-03 +-9.39901980E-09-6.44499972E-08-1.45165056E-14 0.00000000E+00-1.35869347E-08 + 0.00000000E+00-6.30531016E-14 8.92245988E-04 2.64486728E-18-4.64068653E-04 +-1.34638817E-18 2.23894378E-03 0.00000000E+00-1.14166164E-03 0.00000000E+00 + 2.64574906E-04 4.29881653E-10-3.18946474E-08-7.70969791E-15 0.00000000E+00 + 6.28583539E-10 0.00000000E+00-3.17522453E-14 7.56687796E-04 2.85531603E-18 + 2.06116398E-03 0.00000000E+00-4.78226796E-03-8.48722739E-09-2.48918625E-05 +-4.40908949E-11 0.00000000E+00-1.20776565E-08 0.00000000E+00-6.27793363E-11 + 6.31849298E-03 2.15351735E-17 8.23127777E-04 2.43766165E-18 1.68450968E-02 + 0.00000000E+00 2.15010416E-03 0.00000000E+00-4.82834366E-03-8.49537957E-09 + 2.50248143E-05 4.41144205E-11 0.00000000E+00-1.21205154E-08 0.00000000E+00 + 6.29030074E-11-1.05281704E-03 0.00000000E+00-3.94953893E-04 1.32324442E-18 + 0.00000000E+00 5.98410203E-10 0.00000000E+00-3.09177743E-14-2.33220986E-04 + 4.23327499E-10 3.32379449E-08-5.88139767E-15 2.15010416E-03 0.00000000E+00 + 8.60037310E-03 0.00000000E+00 8.23127777E-04-2.43766165E-18 3.29346594E-03 +-9.57792739E-18 0.00000000E+00-1.34009505E-08 0.00000000E+00-6.22236823E-14 + 5.38397031E-03-9.35848745E-09 6.57900283E-08-1.26943546E-14 2.15009806E-03 + 0.00000000E+00-1.09726207E-03 0.00000000E+00 8.23126291E-04-2.23748674E-18 +-4.28843512E-04 1.16940036E-18 0.00000000E+00 6.19996533E-10 0.00000000E+00 +-3.13723869E-14-2.56031009E-04 4.27737067E-10 3.25816368E-08-6.84323783E-15 + 3.32379449E-08 5.88139767E-15 0.00000000E+00 3.09177743E-14 1.01116728E-05 + 3.56149283E-20 6.05092510E-08 2.09854745E-22-8.70735147E-05 0.00000000E+00 +-5.21356531E-07 0.00000000E+00-2.50248143E-05-4.41144205E-11 6.57900283E-08 + 1.26943546E-14 0.00000000E+00-6.29030074E-11 0.00000000E+00 6.22236823E-14 + 4.30358850E-07 2.01354232E-20-1.58184868E-07-4.15474433E-22-2.05322726E-06 + 0.00000000E+00 1.37481494E-06 0.00000000E+00 2.58145508E-05 4.42670791E-11 + 3.25816368E-08 6.84323783E-15 0.00000000E+00 6.36502883E-11 0.00000000E+00 + 3.13723869E-14-9.68132126E-06-1.27882614E-20 5.81142382E-08 8.54113169E-23 + 8.50196577E-05 0.00000000E+00-5.09926482E-07 0.00000000E+00-2.47299688E-04 +-4.25818492E-10 0.00000000E+00-6.11506032E-10-1.61498236E-03-5.60447141E-18 +-1.00817666E-05-3.44489470E-20 1.39150548E-02 0.00000000E+00 8.69172405E-05 + 0.00000000E+00 4.82834366E-03 8.49537957E-09 5.38397031E-03 9.35848745E-09 + 0.00000000E+00 1.21205154E-08 0.00000000E+00 1.34009505E-08-9.14841052E-03 +-2.49957438E-17 4.30358850E-07 2.01354232E-20 7.94938701E-02 0.00000000E+00 +-2.05322726E-06 0.00000000E+00 4.96013274E-03 8.52087362E-09-2.42230261E-04 +-4.24838612E-10 0.00000000E+00 1.22452374E-08 0.00000000E+00-6.06708075E-10 +-1.55106850E-03-2.27307376E-18 9.71289579E-06 1.56589631E-20 1.36100596E-02 + 0.00000000E+00-8.51570274E-05 0.00000000E+00 0.00000000E+00 3.09177743E-14 +-3.32379449E-08 5.88139767E-15-8.70735147E-05 0.00000000E+00-5.21356531E-07 + 0.00000000E+00 1.01116728E-05-3.56149283E-20 6.05092510E-08-2.09854745E-22 + 0.00000000E+00-6.29030074E-11 0.00000000E+00 6.22236823E-14 2.50248143E-05 +-4.41144205E-11-6.57900283E-08 1.26943546E-14-2.05322726E-06 0.00000000E+00 + 1.37481494E-06 0.00000000E+00 4.30358850E-07-2.01354232E-20-1.58184868E-07 + 4.15474433E-22 0.00000000E+00 6.36502883E-11 0.00000000E+00 3.13723869E-14 +-2.58145508E-05 4.42670791E-11-3.25816368E-08 6.84323783E-15 8.50196577E-05 + 0.00000000E+00-5.09926482E-07 0.00000000E+00-9.68132126E-06 1.27882614E-20 + 5.81142382E-08-8.54113169E-23 0.00000000E+00-6.11506032E-10 2.47299688E-04 +-4.25818492E-10 1.39150548E-02 0.00000000E+00 8.69172405E-05 0.00000000E+00 +-1.61498236E-03 5.60447141E-18-1.00817666E-05 3.44489470E-20 0.00000000E+00 + 1.21205154E-08 0.00000000E+00 1.34009505E-08-4.82834366E-03 8.49537957E-09 +-5.38397031E-03 9.35848745E-09 7.94938701E-02 0.00000000E+00-2.05322726E-06 + 0.00000000E+00-9.14841052E-03 2.49957438E-17 4.30358850E-07-2.01354232E-20 + 0.00000000E+00 1.22452374E-08 0.00000000E+00-6.06708075E-10-4.96013274E-03 + 8.52087362E-09 2.42230261E-04-4.24838612E-10 1.36100596E-02 0.00000000E+00 +-8.51570274E-05 0.00000000E+00-1.55106850E-03 2.27307376E-18 9.71289579E-06 +-1.56589631E-20-3.94953893E-04-1.32324442E-18-1.05281704E-03 0.00000000E+00 + 2.33220986E-04 4.23327499E-10-3.32379449E-08-5.88139767E-15 0.00000000E+00 + 5.98410203E-10 0.00000000E+00-3.09177743E-14 8.23127777E-04 2.43766165E-18 + 3.29346594E-03 9.57792739E-18 2.15010416E-03 0.00000000E+00 8.60037310E-03 + 0.00000000E+00-5.38397031E-03-9.35848745E-09-6.57900283E-08-1.26943546E-14 + 0.00000000E+00-1.34009505E-08 0.00000000E+00-6.22236823E-14 8.23126291E-04 + 2.23748674E-18-4.28843512E-04-1.16940036E-18 2.15009806E-03 0.00000000E+00 +-1.09726207E-03 0.00000000E+00 2.56031009E-04 4.27737067E-10-3.25816368E-08 +-6.84323783E-15 0.00000000E+00 6.19996533E-10 0.00000000E+00-3.13723869E-14 + 2.06116398E-03 0.00000000E+00 7.56687796E-04-2.85531603E-18 0.00000000E+00 +-1.20776565E-08 0.00000000E+00-6.27793363E-11 4.78226796E-03-8.48722739E-09 + 2.48918625E-05-4.40908949E-11 1.68450968E-02 0.00000000E+00 2.15010416E-03 + 0.00000000E+00 6.31849298E-03-2.15351735E-17 8.23127777E-04-2.43766165E-18 + 0.00000000E+00-1.21205154E-08 0.00000000E+00 6.29030074E-11 4.82834366E-03 +-8.49537957E-09-2.50248143E-05 4.41144205E-11-1.00832880E-03 0.00000000E+00 +-3.62409648E-04 1.18332408E-18 0.00000000E+00 5.90264941E-10 0.00000000E+00 +-3.03760354E-14-2.24045631E-04 4.22115251E-10 3.38624739E-08-4.80468230E-15 + 2.06117003E-03 0.00000000E+00 8.24463786E-03 0.00000000E+00 7.56689263E-04 +-2.82315525E-18 3.02771855E-03-1.08735200E-17 0.00000000E+00-1.32176652E-08 + 0.00000000E+00-6.12326492E-14 5.18689021E-03-9.32366349E-09 6.70776005E-08 +-1.06626800E-14 2.06116398E-03 0.00000000E+00-1.05281704E-03 0.00000000E+00 + 7.56687796E-04-2.85531603E-18-3.94953893E-04 1.32324442E-18 0.00000000E+00 + 6.11506032E-10 0.00000000E+00-3.09177743E-14-2.47299688E-04 4.25818492E-10 + 3.32379449E-08-5.88139767E-15 3.38624739E-08 4.80468230E-15 0.00000000E+00 + 3.03760354E-14 1.04891953E-05 5.13806641E-20 6.27767326E-08 3.06420004E-22 +-8.92519229E-05 0.00000000E+00-5.34349172E-07 0.00000000E+00-2.40867169E-05 +-4.39626553E-11 6.70776005E-08 1.06626800E-14 0.00000000E+00-6.20439804E-11 + 0.00000000E+00 6.12326492E-14 4.07452874E-07 1.91757363E-20-1.64400838E-07 +-6.95299146E-22-2.33384847E-06 0.00000000E+00 1.40734976E-06 0.00000000E+00 + 2.48918625E-05 4.40908949E-11 3.32379449E-08 5.88139767E-15 0.00000000E+00 + 6.27793363E-11 0.00000000E+00 3.09177743E-14-1.00817666E-05-3.44489470E-20 + 6.05092510E-08 2.09854745E-22 8.69172405E-05 0.00000000E+00-5.21356531E-07 + 0.00000000E+00-2.38388806E-04-4.24150119E-10 0.00000000E+00-6.03131233E-10 +-1.67549157E-03-8.16900795E-18-1.04609005E-05-5.07989653E-20 1.42617534E-02 + 0.00000000E+00 8.90743704E-05 0.00000000E+00 4.64790805E-03 8.46580760E-09 + 5.18689021E-03 9.32366349E-09 0.00000000E+00 1.19549247E-08 0.00000000E+00 + 1.32176652E-08-9.50778521E-03-4.04829373E-17 4.07452874E-07 1.91757363E-20 + 8.13736377E-02 0.00000000E+00-2.33384847E-06 0.00000000E+00 4.78226796E-03 + 8.48722739E-09-2.33220986E-04-4.23327499E-10 0.00000000E+00 1.20776565E-08 + 0.00000000E+00-5.98410203E-10-1.61498236E-03-5.60447141E-18 1.01116728E-05 + 3.56149283E-20 1.39150548E-02 0.00000000E+00-8.70735147E-05 0.00000000E+00 + 0.00000000E+00 3.03760354E-14-3.38624739E-08 4.80468230E-15-8.92519229E-05 + 0.00000000E+00-5.34349172E-07 0.00000000E+00 1.04891953E-05-5.13806641E-20 + 6.27767326E-08-3.06420004E-22 0.00000000E+00-6.20439804E-11 0.00000000E+00 + 6.12326492E-14 2.40867169E-05-4.39626553E-11-6.70776005E-08 1.06626800E-14 +-2.33384847E-06 0.00000000E+00 1.40734976E-06 0.00000000E+00 4.07452874E-07 +-1.91757363E-20-1.64400838E-07 6.95299146E-22 0.00000000E+00 6.27793363E-11 + 0.00000000E+00 3.09177743E-14-2.48918625E-05 4.40908949E-11-3.32379449E-08 + 5.88139767E-15 8.69172405E-05 0.00000000E+00-5.21356531E-07 0.00000000E+00 +-1.00817666E-05 3.44489470E-20 6.05092510E-08-2.09854745E-22 0.00000000E+00 +-6.03131233E-10 2.38388806E-04-4.24150119E-10 1.42617534E-02 0.00000000E+00 + 8.90743704E-05 0.00000000E+00-1.67549157E-03 8.16900795E-18-1.04609005E-05 + 5.07989653E-20 0.00000000E+00 1.19549247E-08 0.00000000E+00 1.32176652E-08 +-4.64790805E-03 8.46580760E-09-5.18689021E-03 9.32366349E-09 8.13736377E-02 + 0.00000000E+00-2.33384847E-06 0.00000000E+00-9.50778521E-03 4.04829373E-17 + 4.07452874E-07-1.91757363E-20 0.00000000E+00 1.20776565E-08 0.00000000E+00 +-5.98410203E-10-4.78226796E-03 8.48722739E-09 2.33220986E-04-4.23327499E-10 + 1.39150548E-02 0.00000000E+00-8.70735147E-05 0.00000000E+00-1.61498236E-03 + 5.60447141E-18 1.01116728E-05-3.56149283E-20-3.62409648E-04-1.18332408E-18 +-1.00832880E-03 0.00000000E+00 2.24045631E-04 4.22115251E-10-3.38624739E-08 +-4.80468230E-15 0.00000000E+00 5.90264941E-10 0.00000000E+00-3.03760354E-14 + 7.56689263E-04 2.82315525E-18 3.02771855E-03 1.08735200E-17 2.06117003E-03 + 0.00000000E+00 8.24463786E-03 0.00000000E+00-5.18689021E-03-9.32366349E-09 +-6.70776005E-08-1.06626800E-14 0.00000000E+00-1.32176652E-08 0.00000000E+00 +-6.12326492E-14 7.56687796E-04 2.85531603E-18-3.94953893E-04-1.32324442E-18 + 2.06116398E-03 0.00000000E+00-1.05281704E-03 0.00000000E+00 2.47299688E-04 + 4.25818492E-10-3.32379449E-08-5.88139767E-15 0.00000000E+00 6.11506032E-10 + 0.00000000E+00-3.09177743E-14 6.92949330E-04 1.91014108E-18 1.97214516E-03 + 0.00000000E+00-4.60096680E-03-8.45914823E-09-2.39512670E-05-4.39434366E-11 + 0.00000000E+00-1.19128170E-08 0.00000000E+00-6.19224762E-11 5.79778032E-03 + 1.91904908E-17 7.56689263E-04 2.82315525E-18 1.61332845E-02 0.00000000E+00 + 2.06117003E-03 0.00000000E+00-4.64790805E-03-8.46580760E-09 2.40867169E-05 + 4.39626553E-11 0.00000000E+00-1.19549247E-08 0.00000000E+00 6.20439804E-11 + 1.97214516E-03 0.00000000E+00 6.92949330E-04-1.91014108E-18 0.00000000E+00 +-1.19128170E-08 0.00000000E+00-6.19224762E-11 4.60096680E-03-8.45914823E-09 + 2.39512670E-05-4.39434366E-11 1.61332845E-02 0.00000000E+00 2.06117003E-03 + 0.00000000E+00 5.79778032E-03-1.91904908E-17 7.56689263E-04-2.82315525E-18 + 0.00000000E+00-1.19549247E-08 0.00000000E+00 6.20439804E-11 4.64790805E-03 +-8.46580760E-09-2.40867169E-05 4.39626553E-11-9.63798883E-04 0.00000000E+00 +-3.31219573E-04 6.83613562E-19 0.00000000E+00 5.82300815E-10 0.00000000E+00 +-2.97325027E-14-2.14715689E-04 4.21240841E-10 3.44472673E-08-3.58982636E-15 + 1.97215066E-03 0.00000000E+00 7.88856283E-03 0.00000000E+00 6.92950459E-04 +-1.81572764E-18 2.77277016E-03-7.45569888E-18 0.00000000E+00-1.30375959E-08 + 0.00000000E+00-6.00539814E-14 4.98610870E-03-9.29522999E-09 6.82876256E-08 +-8.37966851E-15 1.97214516E-03 0.00000000E+00-1.00832880E-03 0.00000000E+00 + 6.92949330E-04-1.91014108E-18-3.62409648E-04 1.18332408E-18 0.00000000E+00 + 6.03131233E-10 0.00000000E+00-3.03760354E-14-2.38388806E-04 4.24150119E-10 + 3.38624739E-08-4.80468230E-15 6.31927834E-04 9.18726606E-19 1.88304487E-03 + 0.00000000E+00-4.41643418E-03-8.43733237E-09-2.29938196E-05-4.38282820E-11 + 0.00000000E+00-1.17512370E-08 0.00000000E+00-6.10823742E-11 5.29873401E-03 + 1.06263130E-17 6.92950459E-04 1.81572764E-18 1.54208042E-02 0.00000000E+00 + 1.97215066E-03 0.00000000E+00-4.46418613E-03-8.44230739E-09 2.31316087E-05 + 4.38426413E-11 0.00000000E+00-1.17924524E-08 0.00000000E+00 6.12013042E-11 + 1.88304487E-03 0.00000000E+00 6.31927834E-04-9.18726606E-19 0.00000000E+00 +-1.17512370E-08 0.00000000E+00-6.10823742E-11 4.41643418E-03-8.43733237E-09 + 2.29938196E-05-4.38282820E-11 1.54208042E-02 0.00000000E+00 1.97215066E-03 + 0.00000000E+00 5.29873401E-03-1.06263130E-17 6.92950459E-04-1.81572764E-18 + 0.00000000E+00-1.17924524E-08 0.00000000E+00 6.12013042E-11 4.46418613E-03 +-8.44230739E-09-2.31316087E-05 4.38426413E-11 3.44472673E-08 3.58982636E-15 + 0.00000000E+00 2.97325027E-14 1.08460741E-05 4.86152281E-20 6.49203760E-08 + 2.92339699E-22-9.17264639E-05 0.00000000E+00-5.49107993E-07 0.00000000E+00 +-2.31316087E-05-4.38426413E-11 6.82876256E-08 8.37966851E-15 0.00000000E+00 +-6.12013042E-11 0.00000000E+00 6.00539814E-14 3.85194724E-07-4.02078146E-21 +-1.70281800E-07-8.09470583E-22-2.65103916E-06 0.00000000E+00 1.44431708E-06 + 0.00000000E+00 2.39512670E-05 4.39434366E-11 3.38624739E-08 4.80468230E-15 + 0.00000000E+00 6.19224762E-11 0.00000000E+00 3.03760354E-14-1.04609005E-05 +-5.07989653E-20 6.27767326E-08 3.06420004E-22 8.90743704E-05 0.00000000E+00 +-5.34349172E-07 0.00000000E+00-2.29306570E-04-4.22761062E-10 0.00000000E+00 +-5.94894445E-10-1.73269490E-03-7.80388727E-18-1.08193461E-05-4.89580150E-20 + 1.46555885E-02 0.00000000E+00 9.15247750E-05 0.00000000E+00 4.46418613E-03 + 8.44230739E-09 4.98610870E-03 9.29522999E-09 0.00000000E+00 1.17924524E-08 + 0.00000000E+00 1.30375959E-08-9.84778933E-03-4.72643165E-17 3.85194724E-07 +-4.02078146E-21 8.35094611E-02 0.00000000E+00-2.65103916E-06 0.00000000E+00 + 4.60096680E-03 8.45914823E-09-2.24045631E-04-4.22115251E-10 0.00000000E+00 + 1.19128170E-08 0.00000000E+00-5.90264941E-10-1.67549157E-03-8.16900795E-18 + 1.04891953E-05 5.13806641E-20 1.42617534E-02 0.00000000E+00-8.92519229E-05 + 0.00000000E+00 0.00000000E+00 2.97325027E-14-3.44472673E-08 3.58982636E-15 +-9.17264639E-05 0.00000000E+00-5.49107993E-07 0.00000000E+00 1.08460741E-05 +-4.86152281E-20 6.49203760E-08-2.92339699E-22 0.00000000E+00-6.12013042E-11 + 0.00000000E+00 6.00539814E-14 2.31316087E-05-4.38426413E-11-6.82876256E-08 + 8.37966851E-15-2.65103916E-06 0.00000000E+00 1.44431708E-06 0.00000000E+00 + 3.85194724E-07 4.02078146E-21-1.70281800E-07 8.09470583E-22 0.00000000E+00 + 6.19224762E-11 0.00000000E+00 3.03760354E-14-2.39512670E-05 4.39434366E-11 +-3.38624739E-08 4.80468230E-15 8.90743704E-05 0.00000000E+00-5.34349172E-07 + 0.00000000E+00-1.04609005E-05 5.07989653E-20 6.27767326E-08-3.06420004E-22 + 0.00000000E+00-5.94894445E-10 2.29306570E-04-4.22761062E-10 1.46555885E-02 + 0.00000000E+00 9.15247750E-05 0.00000000E+00-1.73269490E-03 7.80388727E-18 +-1.08193461E-05 4.89580150E-20 0.00000000E+00 1.17924524E-08 0.00000000E+00 + 1.30375959E-08-4.46418613E-03 8.44230739E-09-4.98610870E-03 9.29522999E-09 + 8.35094611E-02 0.00000000E+00-2.65103916E-06 0.00000000E+00-9.84778933E-03 + 4.72643165E-17 3.85194724E-07 4.02078146E-21 0.00000000E+00 1.19128170E-08 + 0.00000000E+00-5.90264941E-10-4.60096680E-03 8.45914823E-09 2.24045631E-04 +-4.22115251E-10 1.42617534E-02 0.00000000E+00-8.92519229E-05 0.00000000E+00 +-1.67549157E-03 8.16900795E-18 1.04891953E-05-5.13806641E-20-3.31219573E-04 +-6.83613562E-19-9.63798883E-04 0.00000000E+00 2.14715689E-04 4.21240841E-10 +-3.44472673E-08-3.58982636E-15 0.00000000E+00 5.82300815E-10 0.00000000E+00 +-2.97325027E-14 6.92950459E-04 1.81572764E-18 2.77277016E-03 7.45569888E-18 + 1.97215066E-03 0.00000000E+00 7.88856283E-03 0.00000000E+00-4.98610870E-03 +-9.29522999E-09-6.82876256E-08-8.37966851E-15 0.00000000E+00-1.30375959E-08 + 0.00000000E+00-6.00539814E-14 6.92949330E-04 1.91014108E-18-3.62409648E-04 +-1.18332408E-18 1.97214516E-03 0.00000000E+00-1.00832880E-03 0.00000000E+00 + 2.38388806E-04 4.24150119E-10-3.38624739E-08-4.80468230E-15 0.00000000E+00 + 6.03131233E-10 0.00000000E+00-3.03760354E-14 5.73640413E-04 2.08163394E-18 + 1.79386818E-03 0.00000000E+00-4.22883581E-03-8.42262095E-09-2.20204079E-05 +-4.37497524E-11 0.00000000E+00-1.15935277E-08 0.00000000E+00-6.02621737E-11 + 4.82149350E-03 1.11678109E-17 6.31928867E-04 8.32497204E-19 1.47076948E-02 + 0.00000000E+00 1.88305024E-03 0.00000000E+00-4.27736602E-03-8.42567965E-09 + 2.21604441E-05 4.37585831E-11 0.00000000E+00-1.16336834E-08 0.00000000E+00 + 6.03780467E-11-9.19229605E-04 0.00000000E+00-3.01392320E-04 7.28532786E-19 + 0.00000000E+00 5.74551770E-10 0.00000000E+00-2.89682638E-14-2.05236483E-04 + 4.20751546E-10 3.50090628E-08-2.20766034E-15 1.88305024E-03 0.00000000E+00 + 7.53216307E-03 0.00000000E+00 6.31928867E-04-8.32497204E-19 2.52868999E-03 +-4.28146998E-18 0.00000000E+00-1.28613473E-08 0.00000000E+00-5.86542196E-14 + 4.78185437E-03-9.27400750E-09 6.94278216E-08-5.79325256E-15 1.88304487E-03 + 0.00000000E+00-9.63798883E-04 0.00000000E+00 6.31927834E-04-9.18726606E-19 +-3.31219573E-04 6.83613562E-19 0.00000000E+00 5.94894445E-10 0.00000000E+00 +-2.97325027E-14-2.29306570E-04 4.22761062E-10 3.44472673E-08-3.58982636E-15 + 3.50090628E-08 2.20766034E-15 0.00000000E+00 2.89682638E-14 1.11829399E-05 + 4.03821258E-20 6.69439419E-08 2.45943852E-22-9.45380076E-05 0.00000000E+00 +-5.65876297E-07 0.00000000E+00-2.21604441E-05-4.37585831E-11 6.94278216E-08 + 5.79325256E-15 0.00000000E+00-6.03780467E-11 0.00000000E+00 5.86542196E-14 + 3.63615436E-07-7.24026372E-21-1.75837461E-07-7.29427549E-22-3.01191215E-06 + 0.00000000E+00 1.48631201E-06 0.00000000E+00 2.29938196E-05 4.38282820E-11 + 3.44472673E-08 3.58982636E-15 0.00000000E+00 6.10823742E-11 0.00000000E+00 + 2.97325027E-14-1.08193461E-05-4.89580150E-20 6.49203760E-08 2.92339699E-22 + 9.15247750E-05 0.00000000E+00-5.49107993E-07 0.00000000E+00-2.20065188E-04 +-4.21686240E-10 0.00000000E+00-5.86821604E-10-1.78669275E-03-6.55947521E-18 +-1.11577279E-05-4.16548012E-20 1.51030534E-02 0.00000000E+00 9.43087786E-05 + 0.00000000E+00 4.27736602E-03 8.42567965E-09 4.78185437E-03 9.27400750E-09 + 0.00000000E+00 1.16336834E-08 0.00000000E+00 1.28613473E-08-1.01689748E-02 +-4.27002821E-17 3.63615436E-07-7.24026372E-21 8.59357221E-02 0.00000000E+00 +-3.01191215E-06 0.00000000E+00 4.41643418E-03 8.43733237E-09-2.14715689E-04 +-4.21240841E-10 0.00000000E+00 1.17512370E-08 0.00000000E+00-5.82300815E-10 +-1.73269490E-03-7.80388727E-18 1.08460741E-05 4.86152281E-20 1.46555885E-02 + 0.00000000E+00-9.17264639E-05 0.00000000E+00 0.00000000E+00 2.89682638E-14 +-3.50090628E-08 2.20766034E-15-9.45380076E-05 0.00000000E+00-5.65876297E-07 + 0.00000000E+00 1.11829399E-05-4.03821258E-20 6.69439419E-08-2.45943852E-22 + 0.00000000E+00-6.03780467E-11 0.00000000E+00 5.86542196E-14 2.21604441E-05 +-4.37585831E-11-6.94278216E-08 5.79325256E-15-3.01191215E-06 0.00000000E+00 + 1.48631201E-06 0.00000000E+00 3.63615436E-07 7.24026372E-21-1.75837461E-07 + 7.29427549E-22 0.00000000E+00 6.10823742E-11 0.00000000E+00 2.97325027E-14 +-2.29938196E-05 4.38282820E-11-3.44472673E-08 3.58982636E-15 9.15247750E-05 + 0.00000000E+00-5.49107993E-07 0.00000000E+00-1.08193461E-05 4.89580150E-20 + 6.49203760E-08-2.92339699E-22 0.00000000E+00-5.86821604E-10 2.20065188E-04 +-4.21686240E-10 1.51030534E-02 0.00000000E+00 9.43087786E-05 0.00000000E+00 +-1.78669275E-03 6.55947521E-18-1.11577279E-05 4.16548012E-20 0.00000000E+00 + 1.16336834E-08 0.00000000E+00 1.28613473E-08-4.27736602E-03 8.42567965E-09 +-4.78185437E-03 9.27400750E-09 8.59357221E-02 0.00000000E+00-3.01191215E-06 + 0.00000000E+00-1.01689748E-02 4.27002821E-17 3.63615436E-07 7.24026372E-21 + 0.00000000E+00 1.17512370E-08 0.00000000E+00-5.82300815E-10-4.41643418E-03 + 8.43733237E-09 2.14715689E-04-4.21240841E-10 1.46555885E-02 0.00000000E+00 +-9.17264639E-05 0.00000000E+00-1.73269490E-03 7.80388727E-18 1.08460741E-05 +-4.86152281E-20-3.01392320E-04-7.28532786E-19-9.19229605E-04 0.00000000E+00 + 2.05236483E-04 4.20751546E-10-3.50090628E-08-2.20766034E-15 0.00000000E+00 + 5.74551770E-10 0.00000000E+00-2.89682638E-14 6.31928867E-04 8.32497204E-19 + 2.52868999E-03 4.28146998E-18 1.88305024E-03 0.00000000E+00 7.53216307E-03 + 0.00000000E+00-4.78185437E-03-9.27400750E-09-6.94278216E-08-5.79325256E-15 + 0.00000000E+00-1.28613473E-08 0.00000000E+00-5.86542196E-14 6.31927834E-04 + 9.18726606E-19-3.31219573E-04-6.83613562E-19 1.88304487E-03 0.00000000E+00 +-9.63798883E-04 0.00000000E+00 2.29306570E-04 4.22761062E-10-3.44472673E-08 +-3.58982636E-15 0.00000000E+00 5.94894445E-10 0.00000000E+00-2.97325027E-14 + 1.79386818E-03 0.00000000E+00 5.73640413E-04-2.08163394E-18 0.00000000E+00 +-1.15935277E-08 0.00000000E+00-6.02621737E-11 4.22883581E-03-8.42262095E-09 + 2.20204079E-05-4.37497524E-11 1.47076948E-02 0.00000000E+00 1.88305024E-03 + 0.00000000E+00 4.82149350E-03-1.11678109E-17 6.31928867E-04-8.32497204E-19 + 0.00000000E+00-1.16336834E-08 0.00000000E+00 6.03780467E-11 4.27736602E-03 +-8.42567965E-09-2.21604441E-05 4.37585831E-11-8.29980962E-04 0.00000000E+00 +-2.45857978E-04 6.08322244E-19 0.00000000E+00 5.59870131E-10 0.00000000E+00 +-2.69768252E-14-1.85878524E-04 4.21172319E-10 3.60098416E-08 1.21486113E-15 + 1.70462352E-03 0.00000000E+00 6.81845998E-03 0.00000000E+00 5.18103266E-04 +-1.10082855E-18 2.07339878E-03-5.57313482E-18 0.00000000E+00-1.25233199E-08 + 0.00000000E+00-5.50120678E-14 4.36364350E-03-9.25738862E-09 7.15065350E-08 + 5.66949575E-16 1.70461871E-03 0.00000000E+00-8.74622985E-04 0.00000000E+00 + 5.18102512E-04-1.48072214E-18-2.72935947E-04 9.77117126E-19 0.00000000E+00 + 5.78943361E-10 0.00000000E+00-2.80596544E-14-2.10668162E-04 4.20967826E-10 + 3.55229696E-08-6.21489896E-16 3.60098416E-08-1.21486113E-15 0.00000000E+00 + 2.69768252E-14 1.17992074E-05 2.70774355E-20 7.06463208E-08 1.67578564E-22 +-1.01381395E-04 0.00000000E+00-6.06685783E-07 0.00000000E+00-2.01736269E-05 +-4.37198958E-11 7.15065350E-08-5.66949575E-16 0.00000000E+00-5.88051293E-11 + 0.00000000E+00 5.50120678E-14 3.22528899E-07 8.67018607E-23-1.86014372E-07 +-4.91131315E-22-3.90417123E-06 0.00000000E+00 1.58839896E-06 0.00000000E+00 + 2.10319270E-05 4.37131012E-11 3.55229696E-08 6.21489896E-16 0.00000000E+00 + 5.94656219E-11 0.00000000E+00 2.80596544E-14-1.14767161E-05-3.00295975E-20 + 6.88514485E-08 1.80862254E-22 9.74750636E-05 0.00000000E+00-5.84948203E-07 + 0.00000000E+00-2.01131067E-04-4.20657123E-10 0.00000000E+00-5.71296242E-10 +-1.88548525E-03-4.46330207E-18-1.17768914E-05-2.87671283E-20 1.61920851E-02 + 0.00000000E+00 1.01083591E-04 0.00000000E+00 3.89512752E-03 8.41714598E-09 + 4.36364350E-03 9.25738862E-09 0.00000000E+00 1.13301786E-08 0.00000000E+00 + 1.25233199E-08-1.07573092E-02-2.97010531E-17 3.22528899E-07 8.67018607E-23 + 9.18334052E-02 0.00000000E+00-3.90417123E-06 0.00000000E+00 4.03835293E-03 + 8.41603701E-09-1.95621714E-04-4.20705082E-10 0.00000000E+00 1.14404180E-08 + 0.00000000E+00-5.67058483E-10-1.83759241E-03-4.83493929E-18 1.15004636E-05 + 3.03960274E-20 1.56119980E-02 0.00000000E+00-9.77360296E-05 0.00000000E+00 + 0.00000000E+00 2.69768252E-14-3.60098416E-08-1.21486113E-15-1.01381395E-04 + 0.00000000E+00-6.06685783E-07 0.00000000E+00 1.17992074E-05-2.70774355E-20 + 7.06463208E-08-1.67578564E-22 0.00000000E+00-5.88051293E-11 0.00000000E+00 + 5.50120678E-14 2.01736269E-05-4.37198958E-11-7.15065350E-08-5.66949575E-16 +-3.90417123E-06 0.00000000E+00 1.58839896E-06 0.00000000E+00 3.22528899E-07 +-8.67018607E-23-1.86014372E-07 4.91131315E-22 0.00000000E+00 5.94656219E-11 + 0.00000000E+00 2.80596544E-14-2.10319270E-05 4.37131012E-11-3.55229696E-08 + 6.21489896E-16 9.74750636E-05 0.00000000E+00-5.84948203E-07 0.00000000E+00 +-1.14767161E-05 3.00295975E-20 6.88514485E-08-1.80862254E-22 0.00000000E+00 +-5.71296242E-10 2.01131067E-04-4.20657123E-10 1.61920851E-02 0.00000000E+00 + 1.01083591E-04 0.00000000E+00-1.88548525E-03 4.46330207E-18-1.17768914E-05 + 2.87671283E-20 0.00000000E+00 1.13301786E-08 0.00000000E+00 1.25233199E-08 +-3.89512752E-03 8.41714598E-09-4.36364350E-03 9.25738862E-09 9.18334052E-02 + 0.00000000E+00-3.90417123E-06 0.00000000E+00-1.07573092E-02 2.97010531E-17 + 3.22528899E-07-8.67018607E-23 0.00000000E+00 1.14404180E-08 0.00000000E+00 +-5.67058483E-10-4.03835293E-03 8.41603701E-09 1.95621714E-04-4.20705082E-10 + 1.56119980E-02 0.00000000E+00-9.77360296E-05 0.00000000E+00-1.83759241E-03 + 4.83493929E-18 1.15004636E-05-3.03960274E-20-2.45857978E-04-6.08322244E-19 +-8.29980962E-04 0.00000000E+00 1.85878524E-04 4.21172319E-10-3.60098416E-08 + 1.21486113E-15 0.00000000E+00 5.59870131E-10 0.00000000E+00-2.69768252E-14 + 5.18103266E-04 1.10082855E-18 2.07339878E-03 5.57313482E-18 1.70462352E-03 + 0.00000000E+00 6.81845998E-03 0.00000000E+00-4.36364350E-03-9.25738862E-09 +-7.15065350E-08 5.66949575E-16 0.00000000E+00-1.25233199E-08 0.00000000E+00 +-5.50120678E-14 5.18102512E-04 1.48072214E-18-2.72935947E-04-9.77117126E-19 + 1.70461871E-03 0.00000000E+00-8.74622985E-04 0.00000000E+00 2.10668162E-04 + 4.20967826E-10-3.55229696E-08-6.21489896E-16 0.00000000E+00 5.78943361E-10 + 0.00000000E+00-2.80596544E-14-8.74622985E-04 0.00000000E+00-2.72935947E-04 + 9.77117126E-19 0.00000000E+00 5.67058483E-10 0.00000000E+00-2.80596544E-14 +-1.95621714E-04 4.20705082E-10 3.55229696E-08-6.21489896E-16 1.79387323E-03 + 0.00000000E+00 7.17545701E-03 0.00000000E+00 5.73641275E-04-2.42774637E-18 + 2.29554547E-03-8.22964374E-18 0.00000000E+00-1.26896362E-08 0.00000000E+00 +-5.69911476E-14 4.57427828E-03-9.26098984E-09 7.05210748E-08-2.83837889E-15 + 1.79386818E-03 0.00000000E+00-9.19229605E-04 0.00000000E+00 5.73640413E-04 +-2.08163394E-18-3.01392320E-04 7.28532786E-19 0.00000000E+00 5.86821604E-10 + 0.00000000E+00-2.89682638E-14-2.20065188E-04 4.21686240E-10 3.50090628E-08 +-2.20766034E-15 3.55229696E-08 6.21489896E-16 0.00000000E+00 2.80596544E-14 + 1.15004636E-05 3.03960274E-20 6.88514485E-08 1.80862254E-22-9.77360296E-05 + 0.00000000E+00-5.84948203E-07 0.00000000E+00-2.11740189E-05-4.37155872E-11 + 7.05210748E-08 2.83837889E-15 0.00000000E+00-5.95778605E-11 0.00000000E+00 + 5.69911476E-14 3.42760098E-07-1.36359826E-20-1.81078267E-07-5.48152478E-22 +-3.42551312E-06 0.00000000E+00 1.53404809E-06 0.00000000E+00 2.20204079E-05 + 4.37497524E-11 3.50090628E-08 2.20766034E-15 0.00000000E+00 6.02621737E-11 + 0.00000000E+00 2.89682638E-14-1.11577279E-05-4.16548012E-20 6.69439419E-08 + 2.45943852E-22 9.43087786E-05 0.00000000E+00-5.65876297E-07 0.00000000E+00 +-2.10668162E-04-4.20967826E-10 0.00000000E+00-5.78943361E-10-1.83759241E-03 +-4.83493929E-18-1.14767161E-05-3.00295975E-20 1.56119980E-02 0.00000000E+00 + 9.74750636E-05 0.00000000E+00 4.08759583E-03 8.41689654E-09 4.57427828E-03 + 9.26098984E-09 0.00000000E+00 1.14793137E-08 0.00000000E+00 1.26896362E-08 +-1.04719489E-02-3.07265899E-17 3.42760098E-07-1.36359826E-20 8.86935480E-02 + 0.00000000E+00-3.42551312E-06 0.00000000E+00 4.22883581E-03 8.42262095E-09 +-2.05236483E-04-4.20751546E-10 0.00000000E+00 1.15935277E-08 0.00000000E+00 +-5.74551770E-10-1.78669275E-03-6.55947521E-18 1.11829399E-05 4.03821258E-20 + 1.51030534E-02 0.00000000E+00-9.45380076E-05 0.00000000E+00 0.00000000E+00 + 2.80596544E-14-3.55229696E-08 6.21489896E-16-9.77360296E-05 0.00000000E+00 +-5.84948203E-07 0.00000000E+00 1.15004636E-05-3.03960274E-20 6.88514485E-08 +-1.80862254E-22 0.00000000E+00-5.95778605E-11 0.00000000E+00 5.69911476E-14 + 2.11740189E-05-4.37155872E-11-7.05210748E-08 2.83837889E-15-3.42551312E-06 + 0.00000000E+00 1.53404809E-06 0.00000000E+00 3.42760098E-07 1.36359826E-20 +-1.81078267E-07 5.48152478E-22 0.00000000E+00 6.02621737E-11 0.00000000E+00 + 2.89682638E-14-2.20204079E-05 4.37497524E-11-3.50090628E-08 2.20766034E-15 + 9.43087786E-05 0.00000000E+00-5.65876297E-07 0.00000000E+00-1.11577279E-05 + 4.16548012E-20 6.69439419E-08-2.45943852E-22 0.00000000E+00-5.78943361E-10 + 2.10668162E-04-4.20967826E-10 1.56119980E-02 0.00000000E+00 9.74750636E-05 + 0.00000000E+00-1.83759241E-03 4.83493929E-18-1.14767161E-05 3.00295975E-20 + 0.00000000E+00 1.14793137E-08 0.00000000E+00 1.26896362E-08-4.08759583E-03 + 8.41689654E-09-4.57427828E-03 9.26098984E-09 8.86935480E-02 0.00000000E+00 +-3.42551312E-06 0.00000000E+00-1.04719489E-02 3.07265899E-17 3.42760098E-07 + 1.36359826E-20 0.00000000E+00 1.15935277E-08 0.00000000E+00-5.74551770E-10 +-4.22883581E-03 8.42262095E-09 2.05236483E-04-4.20751546E-10 1.51030534E-02 + 0.00000000E+00-9.45380076E-05 0.00000000E+00-1.78669275E-03 6.55947521E-18 + 1.11829399E-05-4.03821258E-20-2.72935947E-04-9.77117126E-19-8.74622985E-04 + 0.00000000E+00 1.95621714E-04 4.20705082E-10-3.55229696E-08-6.21489896E-16 + 0.00000000E+00 5.67058483E-10 0.00000000E+00-2.80596544E-14 5.73641275E-04 + 2.42774637E-18 2.29554547E-03 8.22964374E-18 1.79387323E-03 0.00000000E+00 + 7.17545701E-03 0.00000000E+00-4.57427828E-03-9.26098984E-09-7.05210748E-08 +-2.83837889E-15 0.00000000E+00-1.26896362E-08 0.00000000E+00-5.69911476E-14 + 5.73640413E-04 2.08163394E-18-3.01392320E-04-7.28532786E-19 1.79386818E-03 + 0.00000000E+00-9.19229605E-04 0.00000000E+00 2.20065188E-04 4.21686240E-10 +-3.50090628E-08-2.20766034E-15 0.00000000E+00 5.86821604E-10 0.00000000E+00 +-2.89682638E-14 5.18102512E-04 1.48072214E-18 1.70461871E-03 0.00000000E+00 +-4.03835293E-03-8.41603701E-09-2.10319270E-05-4.37131012E-11 0.00000000E+00 +-1.14404180E-08 0.00000000E+00-5.94656219E-11 4.36618727E-03 1.65812449E-17 + 5.73641275E-04 2.42774637E-18 1.39939877E-02 0.00000000E+00 1.79387323E-03 + 0.00000000E+00-4.08759583E-03-8.41689654E-09 2.11740189E-05 4.37155872E-11 + 0.00000000E+00-1.14793137E-08 0.00000000E+00 5.95778605E-11 1.70461871E-03 + 0.00000000E+00 5.18102512E-04-1.48072214E-18 0.00000000E+00-1.14404180E-08 + 0.00000000E+00-5.94656219E-11 4.03835293E-03-8.41603701E-09 2.10319270E-05 +-4.37131012E-11 1.39939877E-02 0.00000000E+00 1.79387323E-03 0.00000000E+00 + 4.36618727E-03-1.65812449E-17 5.73641275E-04-2.42774637E-18 0.00000000E+00 +-1.14793137E-08 0.00000000E+00 5.95778605E-11 4.08759583E-03-8.41689654E-09 +-2.11740189E-05 4.37155872E-11 4.49509255E-05 0.00000000E+00-2.40909084E-08 +-4.20804442E-23 0.00000000E+00-1.40466514E-11 4.11751495E-08-1.31036026E-10 + 0.00000000E+00-1.40466514E-11 4.11751495E-08-1.31036026E-10 3.46215210E-03 + 0.00000000E+00-2.24783720E-05 0.00000000E+00-2.93440489E-06-3.63226763E-21 + 1.76503909E-08 2.42039935E-23 0.00000000E+00-5.89886133E-11 0.00000000E+00 +-2.98130723E-13 4.84988889E-07-4.38532884E-10 4.00332114E-08 1.00930141E-11 + 0.00000000E+00-5.89886133E-11 0.00000000E+00-2.98130723E-13 4.84988889E-07 +-4.38532884E-10 4.00332114E-08 1.00930141E-11 4.84988889E-07 4.38532884E-10 + 0.00000000E+00 5.89886133E-11-2.51328991E-06 4.58918167E-21 1.63168975E-08 + 0.00000000E+00 3.04454833E-02-3.86047019E-17 2.12979992E+01 0.00000000E+00 + 1.36530472E-04 7.37327475E-08-6.45121735E-07-3.98160827E-10 0.00000000E+00 + 1.16619185E-08 0.00000000E+00-6.01811362E-11-1.55414590E-06 4.27330687E-20 + 2.12487408E-06 6.09421977E-21 3.59792902E-04 0.00000000E+00 8.99351051E-05 + 0.00000000E+00 2.43548839E-01 1.57193558E-16 3.04422621E-02 7.79065537E-17 + 4.25964458E+01 0.00000000E+00 3.45529031E-05 0.00000000E+00 0.00000000E+00 + 5.89886133E-11-4.84988889E-07 4.38532884E-10 1.63168975E-08 0.00000000E+00 +-2.51328991E-06-4.58918167E-21 2.12979992E+01 0.00000000E+00 3.04454833E-02 + 3.86047019E-17 0.00000000E+00 1.16619185E-08 0.00000000E+00-6.01811362E-11 +-1.36530472E-04 7.37327475E-08 6.45121735E-07-3.98160827E-10 3.59792902E-04 + 0.00000000E+00 8.99351051E-05 0.00000000E+00-1.55414590E-06-4.27330687E-20 + 2.12487408E-06-6.09421977E-21 4.25964458E+01 0.00000000E+00 3.45529031E-05 + 0.00000000E+00 2.43548839E-01-1.57193558E-16 3.04422621E-02-7.79065537E-17 + 4.84988889E-07 4.38532884E-10 0.00000000E+00 5.89886133E-11-2.51328991E-06 + 4.58918167E-21 1.63168975E-08 0.00000000E+00-2.51328991E-06 4.58918167E-21 + 1.63168975E-08 0.00000000E+00 1.36530472E-04 7.37327475E-08-6.45121735E-07 +-3.98160827E-10 0.00000000E+00 1.16619185E-08 0.00000000E+00-6.01811362E-11 +-1.55414590E-06 4.27330687E-20 2.12487408E-06 6.09421977E-21 3.59792902E-04 + 0.00000000E+00 8.99351051E-05 0.00000000E+00-1.55414590E-06 4.27330687E-20 + 2.12487408E-06 6.09421977E-21 3.59792902E-04 0.00000000E+00 8.99351051E-05 + 0.00000000E+00 0.00000000E+00 5.89886133E-11-4.84988889E-07 4.38532884E-10 + 1.63168975E-08 0.00000000E+00-2.51328991E-06-4.58918167E-21 1.63168975E-08 + 0.00000000E+00-2.51328991E-06-4.58918167E-21 0.00000000E+00 1.16619185E-08 + 0.00000000E+00-6.01811362E-11-1.36530472E-04 7.37327475E-08 6.45121735E-07 +-3.98160827E-10 3.59792902E-04 0.00000000E+00 8.99351051E-05 0.00000000E+00 +-1.55414590E-06-4.27330687E-20 2.12487408E-06-6.09421977E-21 3.59792902E-04 + 0.00000000E+00 8.99351051E-05 0.00000000E+00-1.55414590E-06-4.27330687E-20 + 2.12487408E-06-6.09421977E-21 4.11751495E-08 1.31036026E-10 0.00000000E+00 + 1.40466514E-11-3.86697810E-06 9.55469012E-21 2.25139369E-05 0.00000000E+00 + 6.08904291E-02-4.80798488E-17 5.32448720E+01 0.00000000E+00-1.39170647E-05 +-1.93645462E-09 4.00332114E-08-1.00930141E-11 0.00000000E+00-6.32691269E-10 + 0.00000000E+00 2.98130723E-13-2.51328991E-06 4.58918167E-21 9.71039581E-08 +-2.67085036E-21 1.63168975E-08 0.00000000E+00-2.24878555E-05 0.00000000E+00 + 3.04454833E-02-3.86047019E-17-1.52219364E-02-9.82546293E-18 2.12979992E+01 + 0.00000000E+00-5.32450844E+00 0.00000000E+00 0.00000000E+00 1.40466514E-11 +-4.11751495E-08 1.31036026E-10 2.25139369E-05 0.00000000E+00-3.86697810E-06 +-9.55469012E-21 5.32448720E+01 0.00000000E+00 6.08904291E-02 4.80798488E-17 + 0.00000000E+00-6.32691269E-10 0.00000000E+00 2.98130723E-13 1.39170647E-05 +-1.93645462E-09-4.00332114E-08-1.00930141E-11 1.63168975E-08 0.00000000E+00 +-2.24878555E-05 0.00000000E+00-2.51328991E-06-4.58918167E-21 9.71039581E-08 + 2.67085036E-21 2.12979992E+01 0.00000000E+00-5.32450844E+00 0.00000000E+00 + 3.04454833E-02 3.86047019E-17-1.52219364E-02 9.82546293E-18 4.11751495E-08 + 1.31036026E-10 0.00000000E+00 1.40466514E-11-3.86697810E-06 9.55469012E-21 + 2.25139369E-05 0.00000000E+00-3.86697810E-06 9.55469012E-21 2.25139369E-05 + 0.00000000E+00-1.39170647E-05-1.93645462E-09 4.00332114E-08-1.00930141E-11 + 0.00000000E+00-6.32691269E-10 0.00000000E+00 2.98130723E-13-2.51328991E-06 + 4.58918167E-21 9.71039581E-08-2.67085036E-21 1.63168975E-08 0.00000000E+00 +-2.24878555E-05 0.00000000E+00-2.51328991E-06 4.58918167E-21 9.71039581E-08 +-2.67085036E-21 1.63168975E-08 0.00000000E+00-2.24878555E-05 0.00000000E+00 + 0.00000000E+00 1.40466514E-11-4.11751495E-08 1.31036026E-10 2.25139369E-05 + 0.00000000E+00-3.86697810E-06-9.55469012E-21 2.25139369E-05 0.00000000E+00 +-3.86697810E-06-9.55469012E-21 0.00000000E+00-6.32691269E-10 0.00000000E+00 + 2.98130723E-13 1.39170647E-05-1.93645462E-09-4.00332114E-08-1.00930141E-11 + 1.63168975E-08 0.00000000E+00-2.24878555E-05 0.00000000E+00-2.51328991E-06 +-4.58918167E-21 9.71039581E-08 2.67085036E-21 1.63168975E-08 0.00000000E+00 +-2.24878555E-05 0.00000000E+00-2.51328991E-06-4.58918167E-21 9.71039581E-08 + 2.67085036E-21-2.40909084E-08 4.20804442E-23 4.49509255E-05 0.00000000E+00 +-4.11751495E-08-1.31036026E-10 0.00000000E+00-1.40466514E-11-4.11751495E-08 +-1.31036026E-10 0.00000000E+00-1.40466514E-11-2.93440489E-06 3.63226763E-21 + 1.76503909E-08-2.42039935E-23 3.46215210E-03 0.00000000E+00-2.24783720E-05 + 0.00000000E+00-4.84988889E-07-4.38532884E-10-4.00332114E-08 1.00930141E-11 + 0.00000000E+00-5.89886133E-11 0.00000000E+00-2.98130723E-13-4.84988889E-07 +-4.38532884E-10-4.00332114E-08 1.00930141E-11 0.00000000E+00-5.89886133E-11 + 0.00000000E+00-2.98130723E-13 2.96827850E-04 4.30614799E-08 1.60584009E-06 + 2.14336226E-10 0.00000000E+00 1.20857195E-08 0.00000000E+00 6.27692959E-11 + 1.89081858E-06 3.34243744E-21 8.99355087E-05 0.00000000E+00 3.04424223E-02 + 9.43265053E-17 1.99049519E+00 0.00000000E+00 3.52318272E-04 3.58174219E-08 +-1.76596770E-06-1.93432292E-10 0.00000000E+00 1.20571371E-08 0.00000000E+00 +-6.26743089E-11 3.86152484E-05 9.06993318E-20 8.03884968E-06 2.25708054E-20 + 1.07938443E-03 0.00000000E+00 1.79914386E-04 0.00000000E+00 2.43560646E-01 + 8.75244199E-16 3.04480903E-02 1.05163947E-16 1.15452375E+01 0.00000000E+00 + 9.95339906E-01 0.00000000E+00 3.46215210E-03 0.00000000E+00-2.93440489E-06 +-3.63226763E-21 0.00000000E+00 6.32691269E-10-1.39170647E-05 1.93645462E-09 + 0.00000000E+00 6.32691269E-10-1.39170647E-05 1.93645462E-09 1.64755271E+00 + 0.00000000E+00-2.23205429E-03 0.00000000E+00-2.65585772E-03 1.26003415E-18 + 7.86061908E-08 1.16526156E-20 0.00000000E+00-1.16619185E-08 0.00000000E+00 +-1.32213241E-08 1.36530472E-04-7.37327475E-08 2.38346856E-04-6.19504734E-08 + 0.00000000E+00-1.16619185E-08 0.00000000E+00-1.32213241E-08 1.36530472E-04 +-7.37327475E-08 2.38346856E-04-6.19504734E-08 1.74219402E-01 0.00000000E+00 +-1.11698387E-03 0.00000000E+00-4.55670288E-04 1.05052103E-18 2.85016886E-06 +-6.20377319E-21 0.00000000E+00-1.20857195E-08 0.00000000E+00 6.07284573E-10 + 2.96827850E-04-4.30614799E-08-7.75099760E-06 3.11617040E-09 0.00000000E+00 +-1.20857195E-08 0.00000000E+00 6.07284573E-10 2.96827850E-04-4.30614799E-08 +-7.75099760E-06 3.11617040E-09-2.24783720E-05 0.00000000E+00 1.76503909E-08 + 2.42039935E-23 0.00000000E+00-2.98130723E-13 4.00332114E-08 1.00930141E-11 + 0.00000000E+00-2.98130723E-13 4.00332114E-08 1.00930141E-11-2.23205429E-03 + 0.00000000E+00 3.19403151E-05 0.00000000E+00 7.86061908E-08 1.16526156E-20 +-4.60565375E-08 2.11580797E-23 0.00000000E+00 6.01811362E-11 0.00000000E+00 +-1.63262927E-13-6.45121735E-07 3.98160827E-10 8.00546092E-08 1.53186028E-11 + 0.00000000E+00 6.01811362E-11 0.00000000E+00-1.63262927E-13-6.45121735E-07 + 3.98160827E-10 8.00546092E-08 1.53186028E-11 1.06036391E-03 0.00000000E+00 +-6.51670722E-06 0.00000000E+00-2.84779494E-06 6.93746626E-21 1.70747902E-08 +-3.94128332E-23 0.00000000E+00-6.27692959E-11 0.00000000E+00 2.37467613E-14 + 1.60584009E-06-2.14336226E-10 4.00319026E-08 5.22598364E-12 0.00000000E+00 +-6.27692959E-11 0.00000000E+00 2.37467613E-14 1.60584009E-06-2.14336226E-10 + 4.00319026E-08 5.22598364E-12-2.93440489E-06 3.63226763E-21 3.46215210E-03 + 0.00000000E+00 1.39170647E-05 1.93645462E-09 0.00000000E+00 6.32691269E-10 + 1.39170647E-05 1.93645462E-09 0.00000000E+00 6.32691269E-10-2.65585772E-03 +-1.26003415E-18 7.86061908E-08-1.16526156E-20 1.64755271E+00 0.00000000E+00 +-2.23205429E-03 0.00000000E+00-1.36530472E-04-7.37327475E-08-2.38346856E-04 +-6.19504734E-08 0.00000000E+00-1.16619185E-08 0.00000000E+00-1.32213241E-08 +-1.36530472E-04-7.37327475E-08-2.38346856E-04-6.19504734E-08 0.00000000E+00 +-1.16619185E-08 0.00000000E+00-1.32213241E-08-4.55670288E-04-1.05052103E-18 + 2.85016886E-06 6.20377319E-21 1.74219402E-01 0.00000000E+00-1.11698387E-03 + 0.00000000E+00-2.96827850E-04-4.30614799E-08 7.75099760E-06 3.11617040E-09 + 0.00000000E+00-1.20857195E-08 0.00000000E+00 6.07284573E-10-2.96827850E-04 +-4.30614799E-08 7.75099760E-06 3.11617040E-09 0.00000000E+00-1.20857195E-08 + 0.00000000E+00 6.07284573E-10 1.76503909E-08-2.42039935E-23-2.24783720E-05 + 0.00000000E+00-4.00332114E-08 1.00930141E-11 0.00000000E+00-2.98130723E-13 +-4.00332114E-08 1.00930141E-11 0.00000000E+00-2.98130723E-13 7.86061908E-08 +-1.16526156E-20-4.60565375E-08-2.11580797E-23-2.23205429E-03 0.00000000E+00 + 3.19403151E-05 0.00000000E+00 6.45121735E-07 3.98160827E-10-8.00546092E-08 + 1.53186028E-11 0.00000000E+00 6.01811362E-11 0.00000000E+00-1.63262927E-13 + 6.45121735E-07 3.98160827E-10-8.00546092E-08 1.53186028E-11 0.00000000E+00 + 6.01811362E-11 0.00000000E+00-1.63262927E-13-2.84779494E-06-6.93746626E-21 + 1.70747902E-08 3.94128332E-23 1.06036391E-03 0.00000000E+00-6.51670722E-06 + 0.00000000E+00-1.60584009E-06-2.14336226E-10-4.00319026E-08 5.22598364E-12 + 0.00000000E+00-6.27692959E-11 0.00000000E+00 2.37467613E-14-1.60584009E-06 +-2.14336226E-10-4.00319026E-08 5.22598364E-12 0.00000000E+00-6.27692959E-11 + 0.00000000E+00 2.37467613E-14 0.00000000E+00 2.98130723E-13-4.00332114E-08 +-1.00930141E-11-2.24878555E-05 0.00000000E+00 9.71039581E-08 2.67085036E-21 +-2.24878555E-05 0.00000000E+00 9.71039581E-08 2.67085036E-21 0.00000000E+00 + 1.32213241E-08 0.00000000E+00 1.63262927E-13-2.38346856E-04 6.19504734E-08 +-8.00546092E-08-1.53186028E-11 8.99351051E-05 0.00000000E+00 3.59762062E-04 + 0.00000000E+00 2.12487408E-06-6.09421977E-21 8.59019160E-06-2.54342703E-20 + 8.99351051E-05 0.00000000E+00 3.59762062E-04 0.00000000E+00 2.12487408E-06 +-6.09421977E-21 8.59019160E-06-2.54342703E-20 0.00000000E+00-5.98310281E-10 + 0.00000000E+00-2.37467613E-14 2.47064046E-05-9.02710109E-10-4.00319026E-08 +-5.22598364E-12 8.99355087E-05 0.00000000E+00-6.74624738E-05 0.00000000E+00 + 1.89081858E-06-3.34243744E-21-2.48241706E-06 6.47831070E-21 8.99355087E-05 + 0.00000000E+00-6.74624738E-05 0.00000000E+00 1.89081858E-06-3.34243744E-21 +-2.48241706E-06 6.47831070E-21 4.00332114E-08-1.00930141E-11 0.00000000E+00 + 2.98130723E-13 9.71039581E-08-2.67085036E-21-2.24878555E-05 0.00000000E+00 + 9.71039581E-08-2.67085036E-21-2.24878555E-05 0.00000000E+00 2.38346856E-04 + 6.19504734E-08 8.00546092E-08-1.53186028E-11 0.00000000E+00 1.32213241E-08 + 0.00000000E+00 1.63262927E-13 2.12487408E-06 6.09421977E-21 8.59019160E-06 + 2.54342703E-20 8.99351051E-05 0.00000000E+00 3.59762062E-04 0.00000000E+00 + 2.12487408E-06 6.09421977E-21 8.59019160E-06 2.54342703E-20 8.99351051E-05 + 0.00000000E+00 3.59762062E-04 0.00000000E+00-2.47064046E-05-9.02710109E-10 + 4.00319026E-08-5.22598364E-12 0.00000000E+00-5.98310281E-10 0.00000000E+00 +-2.37467613E-14 1.89081858E-06 3.34243744E-21-2.48241706E-06-6.47831070E-21 + 8.99355087E-05 0.00000000E+00-6.74624738E-05 0.00000000E+00 1.89081858E-06 + 3.34243744E-21-2.48241706E-06-6.47831070E-21 8.99355087E-05 0.00000000E+00 +-6.74624738E-05 0.00000000E+00 0.00000000E+00 2.98130723E-13-4.00332114E-08 +-1.00930141E-11-2.24878555E-05 0.00000000E+00 9.71039581E-08 2.67085036E-21 +-5.32450844E+00 0.00000000E+00-1.52219364E-02 9.82546293E-18 0.00000000E+00 + 1.32213241E-08 0.00000000E+00 1.63262927E-13-2.38346856E-04 6.19504734E-08 +-8.00546092E-08-1.53186028E-11 8.99351051E-05 0.00000000E+00 3.59762062E-04 + 0.00000000E+00 2.12487408E-06-6.09421977E-21 8.59019160E-06-2.54342703E-20 + 3.45529031E-05 0.00000000E+00 9.15630721E+00 0.00000000E+00 3.04422621E-02 +-7.79065537E-17 1.21772463E-01-3.05345911E-16 0.00000000E+00-5.98310281E-10 + 0.00000000E+00-2.37467613E-14 2.47064046E-05-9.02710109E-10-4.00319026E-08 +-5.22598364E-12 8.99355087E-05 0.00000000E+00-6.74624738E-05 0.00000000E+00 + 1.89081858E-06-3.34243744E-21-2.48241706E-06 6.47831070E-21 1.99049519E+00 + 0.00000000E+00-7.46458775E-01 0.00000000E+00 3.04424223E-02-9.43265053E-17 +-1.52226282E-02 4.98726132E-17 4.00332114E-08-1.00930141E-11 0.00000000E+00 + 2.98130723E-13 9.71039581E-08-2.67085036E-21-2.24878555E-05 0.00000000E+00 +-1.52219364E-02-9.82546293E-18-5.32450844E+00 0.00000000E+00 2.38346856E-04 + 6.19504734E-08 8.00546092E-08-1.53186028E-11 0.00000000E+00 1.32213241E-08 + 0.00000000E+00 1.63262927E-13 2.12487408E-06 6.09421977E-21 8.59019160E-06 + 2.54342703E-20 8.99351051E-05 0.00000000E+00 3.59762062E-04 0.00000000E+00 + 3.04422621E-02 7.79065537E-17 1.21772463E-01 3.05345911E-16 3.45529031E-05 + 0.00000000E+00 9.15630721E+00 0.00000000E+00-2.47064046E-05-9.02710109E-10 + 4.00319026E-08-5.22598364E-12 0.00000000E+00-5.98310281E-10 0.00000000E+00 +-2.37467613E-14 1.89081858E-06 3.34243744E-21-2.48241706E-06-6.47831070E-21 + 8.99355087E-05 0.00000000E+00-6.74624738E-05 0.00000000E+00 3.04424223E-02 + 9.43265053E-17-1.52226282E-02-4.98726132E-17 1.99049519E+00 0.00000000E+00 +-7.46458775E-01 0.00000000E+00 0.00000000E+00 1.20857195E-08 0.00000000E+00 + 6.27692959E-11-2.96827850E-04 4.30614799E-08-1.60584009E-06 2.14336226E-10 + 8.99355087E-05 0.00000000E+00 1.89081858E-06-3.34243744E-21 8.99355087E-05 + 0.00000000E+00 1.89081858E-06-3.34243744E-21 0.00000000E+00 1.20571371E-08 + 0.00000000E+00-6.26743089E-11-3.52318272E-04 3.58174219E-08 1.76596770E-06 +-1.93432292E-10 1.07938443E-03 0.00000000E+00 1.79914386E-04 0.00000000E+00 + 3.86152484E-05-9.06993318E-20 8.03884968E-06-2.25708054E-20 1.07938443E-03 + 0.00000000E+00 1.79914386E-04 0.00000000E+00 3.86152484E-05-9.06993318E-20 + 8.03884968E-06-2.25708054E-20 2.96827850E-04 4.30614799E-08 1.60584009E-06 + 2.14336226E-10 0.00000000E+00 1.20857195E-08 0.00000000E+00 6.27692959E-11 + 1.89081858E-06 3.34243744E-21 8.99355087E-05 0.00000000E+00 1.89081858E-06 + 3.34243744E-21 8.99355087E-05 0.00000000E+00 3.52318272E-04 3.58174219E-08 +-1.76596770E-06-1.93432292E-10 0.00000000E+00 1.20571371E-08 0.00000000E+00 +-6.26743089E-11 3.86152484E-05 9.06993318E-20 8.03884968E-06 2.25708054E-20 + 1.07938443E-03 0.00000000E+00 1.79914386E-04 0.00000000E+00 3.86152484E-05 + 9.06993318E-20 8.03884968E-06 2.25708054E-20 1.07938443E-03 0.00000000E+00 + 1.79914386E-04 0.00000000E+00 0.00000000E+00 1.20857195E-08 0.00000000E+00 + 6.27692959E-11-2.96827850E-04 4.30614799E-08-1.60584009E-06 2.14336226E-10 + 8.99355087E-05 0.00000000E+00 1.89081858E-06-3.34243744E-21 1.99049519E+00 + 0.00000000E+00 3.04424223E-02-9.43265053E-17 0.00000000E+00 1.20571371E-08 + 0.00000000E+00-6.26743089E-11-3.52318272E-04 3.58174219E-08 1.76596770E-06 +-1.93432292E-10 1.07938443E-03 0.00000000E+00 1.79914386E-04 0.00000000E+00 + 3.86152484E-05-9.06993318E-20 8.03884968E-06-2.25708054E-20 1.15452375E+01 + 0.00000000E+00 9.95339906E-01 0.00000000E+00 2.43560646E-01-8.75244199E-16 + 3.04480903E-02-1.05163947E-16 5.12633896E-04 2.38640242E-08 2.72678577E-06 + 1.21299299E-10 0.00000000E+00 1.20012210E-08 0.00000000E+00 6.23497348E-11 + 8.03935107E-06 2.88699829E-20 1.79911893E-04 0.00000000E+00 3.04480281E-02 + 7.33421282E-17 1.04040854E+00 0.00000000E+00 5.68131739E-04 2.19182897E-08 +-2.88693442E-06-1.15794206E-10 0.00000000E+00 1.20174288E-08 0.00000000E+00 +-6.23997595E-11 1.04956041E-04 3.56535389E-19 1.85000411E-05 5.61302147E-20 + 1.79946880E-03 0.00000000E+00 2.69962119E-04 0.00000000E+00 2.43619469E-01 + 2.11750019E-16 3.04570830E-02-2.65162758E-18 6.85586021E+00 0.00000000E+00 + 6.93716262E-01 0.00000000E+00 1.74219402E-01 0.00000000E+00 1.06036391E-03 + 0.00000000E+00-4.55670288E-04 1.05052103E-18-2.84779494E-06 6.93746626E-21 + 0.00000000E+00 5.98310281E-10-2.47064046E-05 9.02710109E-10 0.00000000E+00 + 5.98310281E-10-2.47064046E-05 9.02710109E-10 7.59315917E-01 0.00000000E+00 +-4.54643281E-04 0.00000000E+00-2.61817667E-03 9.70437203E-18 3.57548951E-08 + 7.00338996E-21 0.00000000E+00-1.20571371E-08 0.00000000E+00-1.32048739E-08 + 3.52318272E-04-3.58174219E-08 4.75721252E-04-3.09450206E-08 0.00000000E+00 +-1.20571371E-08 0.00000000E+00-1.32048739E-08 3.52318272E-04-3.58174219E-08 + 4.75721252E-04-3.09450206E-08 1.03550242E-01 0.00000000E+00-6.57289798E-04 + 0.00000000E+00-4.50221714E-04 2.04249510E-18 2.81655538E-06-1.27299719E-20 + 0.00000000E+00-1.20012210E-08 0.00000000E+00 5.98120072E-10 5.12633896E-04 +-2.38640242E-08-1.85403385E-05 1.45442440E-09 0.00000000E+00-1.20012210E-08 + 0.00000000E+00 5.98120072E-10 5.12633896E-04-2.38640242E-08-1.85403385E-05 + 1.45442440E-09-7.75099760E-06-3.11617040E-09 4.00319026E-08-5.22598364E-12 + 0.00000000E+00-6.07284573E-10 0.00000000E+00-2.37467613E-14-2.48241706E-06 +-6.47831070E-21-6.74624738E-05 0.00000000E+00-1.52226282E-02-4.98726132E-17 +-7.46458775E-01 0.00000000E+00 4.75721252E-04 3.09450206E-08 8.00661270E-08 +-5.47824535E-12 0.00000000E+00 1.32048739E-08 0.00000000E+00-3.87076439E-14 + 8.03884968E-06 2.25708054E-20 3.36959327E-05 1.05424862E-19 1.79914386E-04 + 0.00000000E+00 7.19678004E-04 0.00000000E+00 3.04480903E-02 1.05163947E-16 + 1.21793452E-01 3.27621091E-16 9.95339906E-01 0.00000000E+00 4.30151852E+00 + 0.00000000E+00-3.54980149E-05-8.62005532E-10 4.00371611E-08-1.37627343E-12 + 0.00000000E+00-6.03135107E-10 0.00000000E+00 1.25061766E-14 8.03935107E-06 + 2.88699829E-20-6.63484803E-06-2.12500494E-20 1.79911893E-04 0.00000000E+00 +-1.12468503E-04 0.00000000E+00 3.04480281E-02 7.33421282E-17-1.52262778E-02 +-1.76726252E-17 1.04040854E+00 0.00000000E+00-4.33531200E-01 0.00000000E+00 + 0.00000000E+00-6.07284573E-10 0.00000000E+00-2.37467613E-14 7.75099760E-06 +-3.11617040E-09-4.00319026E-08-5.22598364E-12-6.74624738E-05 0.00000000E+00 +-2.48241706E-06 6.47831070E-21-7.46458775E-01 0.00000000E+00-1.52226282E-02 + 4.98726132E-17 0.00000000E+00 1.32048739E-08 0.00000000E+00-3.87076439E-14 +-4.75721252E-04 3.09450206E-08-8.00661270E-08-5.47824535E-12 1.79914386E-04 + 0.00000000E+00 7.19678004E-04 0.00000000E+00 8.03884968E-06-2.25708054E-20 + 3.36959327E-05-1.05424862E-19 9.95339906E-01 0.00000000E+00 4.30151852E+00 + 0.00000000E+00 3.04480903E-02-1.05163947E-16 1.21793452E-01-3.27621091E-16 + 0.00000000E+00-6.03135107E-10 0.00000000E+00 1.25061766E-14 3.54980149E-05 +-8.62005532E-10-4.00371611E-08-1.37627343E-12 1.79911893E-04 0.00000000E+00 +-1.12468503E-04 0.00000000E+00 8.03935107E-06-2.88699829E-20-6.63484803E-06 + 2.12500494E-20 1.04040854E+00 0.00000000E+00-4.33531200E-01 0.00000000E+00 + 3.04480281E-02-7.33421282E-17-1.52262778E-02 1.76726252E-17-7.75099760E-06 +-3.11617040E-09 4.00319026E-08-5.22598364E-12 0.00000000E+00-6.07284573E-10 + 0.00000000E+00-2.37467613E-14-2.48241706E-06-6.47831070E-21-6.74624738E-05 + 0.00000000E+00-2.48241706E-06-6.47831070E-21-6.74624738E-05 0.00000000E+00 + 4.75721252E-04 3.09450206E-08 8.00661270E-08-5.47824535E-12 0.00000000E+00 + 1.32048739E-08 0.00000000E+00-3.87076439E-14 8.03884968E-06 2.25708054E-20 + 3.36959327E-05 1.05424862E-19 1.79914386E-04 0.00000000E+00 7.19678004E-04 + 0.00000000E+00 8.03884968E-06 2.25708054E-20 3.36959327E-05 1.05424862E-19 + 1.79914386E-04 0.00000000E+00 7.19678004E-04 0.00000000E+00-3.54980149E-05 +-8.62005532E-10 4.00371611E-08-1.37627343E-12 0.00000000E+00-6.03135107E-10 + 0.00000000E+00 1.25061766E-14 8.03935107E-06 2.88699829E-20-6.63484803E-06 +-2.12500494E-20 1.79911893E-04 0.00000000E+00-1.12468503E-04 0.00000000E+00 + 8.03935107E-06 2.88699829E-20-6.63484803E-06-2.12500494E-20 1.79911893E-04 + 0.00000000E+00-1.12468503E-04 0.00000000E+00 0.00000000E+00-6.07284573E-10 + 0.00000000E+00-2.37467613E-14 7.75099760E-06-3.11617040E-09-4.00319026E-08 +-5.22598364E-12-6.74624738E-05 0.00000000E+00-2.48241706E-06 6.47831070E-21 +-6.74624738E-05 0.00000000E+00-2.48241706E-06 6.47831070E-21 0.00000000E+00 + 1.32048739E-08 0.00000000E+00-3.87076439E-14-4.75721252E-04 3.09450206E-08 +-8.00661270E-08-5.47824535E-12 1.79914386E-04 0.00000000E+00 7.19678004E-04 + 0.00000000E+00 8.03884968E-06-2.25708054E-20 3.36959327E-05-1.05424862E-19 + 1.79914386E-04 0.00000000E+00 7.19678004E-04 0.00000000E+00 8.03884968E-06 +-2.25708054E-20 3.36959327E-05-1.05424862E-19 0.00000000E+00-6.03135107E-10 + 0.00000000E+00 1.25061766E-14 3.54980149E-05-8.62005532E-10-4.00371611E-08 +-1.37627343E-12 1.79911893E-04 0.00000000E+00-1.12468503E-04 0.00000000E+00 + 8.03935107E-06-2.88699829E-20-6.63484803E-06 2.12500494E-20 1.79911893E-04 + 0.00000000E+00-1.12468503E-04 0.00000000E+00 8.03935107E-06-2.88699829E-20 +-6.63484803E-06 2.12500494E-20 2.85016886E-06 6.20377319E-21 1.70747902E-08 + 3.94128332E-23-1.11698387E-03 0.00000000E+00-6.51670722E-06 0.00000000E+00 +-4.00319026E-08 5.22598364E-12 0.00000000E+00 2.37467613E-14-4.00319026E-08 + 5.22598364E-12 0.00000000E+00 2.37467613E-14 3.57548951E-08-7.00338996E-21 +-4.52721089E-08-1.62489536E-22-4.54643281E-04 0.00000000E+00 1.34256245E-05 + 0.00000000E+00 1.76596770E-06 1.93432292E-10-8.00661270E-08 5.47824535E-12 + 0.00000000E+00 6.26743089E-11 0.00000000E+00 3.87076439E-14 1.76596770E-06 + 1.93432292E-10-8.00661270E-08 5.47824535E-12 0.00000000E+00 6.26743089E-11 + 0.00000000E+00 3.87076439E-14-2.81330261E-06-1.28258817E-20 1.68709408E-08 + 7.66854568E-23 6.37319247E-04 0.00000000E+00-3.87786425E-06 0.00000000E+00 +-2.72678577E-06-1.21299299E-10-4.00371611E-08 1.37627343E-12 0.00000000E+00 +-6.23497348E-11 0.00000000E+00-1.25061766E-14-2.72678577E-06-1.21299299E-10 +-4.00371611E-08 1.37627343E-12 0.00000000E+00-6.23497348E-11 0.00000000E+00 +-1.25061766E-14-4.55670288E-04-1.05052103E-18-2.84779494E-06-6.93746626E-21 + 1.74219402E-01 0.00000000E+00 1.06036391E-03 0.00000000E+00 2.47064046E-05 + 9.02710109E-10 0.00000000E+00 5.98310281E-10 2.47064046E-05 9.02710109E-10 + 0.00000000E+00 5.98310281E-10-2.61817667E-03-9.70437203E-18 3.57548951E-08 +-7.00338996E-21 7.59315917E-01 0.00000000E+00-4.54643281E-04 0.00000000E+00 +-3.52318272E-04-3.58174219E-08-4.75721252E-04-3.09450206E-08 0.00000000E+00 +-1.20571371E-08 0.00000000E+00-1.32048739E-08-3.52318272E-04-3.58174219E-08 +-4.75721252E-04-3.09450206E-08 0.00000000E+00-1.20571371E-08 0.00000000E+00 +-1.32048739E-08-4.50221714E-04-2.04249510E-18 2.81655538E-06 1.27299719E-20 + 1.03550242E-01 0.00000000E+00-6.57289798E-04 0.00000000E+00-5.12633896E-04 +-2.38640242E-08 1.85403385E-05 1.45442440E-09 0.00000000E+00-1.20012210E-08 + 0.00000000E+00 5.98120072E-10-5.12633896E-04-2.38640242E-08 1.85403385E-05 + 1.45442440E-09 0.00000000E+00-1.20012210E-08 0.00000000E+00 5.98120072E-10 +-1.11698387E-03 0.00000000E+00-6.51670722E-06 0.00000000E+00 2.85016886E-06 +-6.20377319E-21 1.70747902E-08-3.94128332E-23 0.00000000E+00 2.37467613E-14 + 4.00319026E-08 5.22598364E-12 0.00000000E+00 2.37467613E-14 4.00319026E-08 + 5.22598364E-12-4.54643281E-04 0.00000000E+00 1.34256245E-05 0.00000000E+00 + 3.57548951E-08 7.00338996E-21-4.52721089E-08 1.62489536E-22 0.00000000E+00 + 6.26743089E-11 0.00000000E+00 3.87076439E-14-1.76596770E-06 1.93432292E-10 + 8.00661270E-08 5.47824535E-12 0.00000000E+00 6.26743089E-11 0.00000000E+00 + 3.87076439E-14-1.76596770E-06 1.93432292E-10 8.00661270E-08 5.47824535E-12 + 6.37319247E-04 0.00000000E+00-3.87786425E-06 0.00000000E+00-2.81330261E-06 + 1.28258817E-20 1.68709408E-08-7.66854568E-23 0.00000000E+00-6.23497348E-11 + 0.00000000E+00-1.25061766E-14 2.72678577E-06-1.21299299E-10 4.00371611E-08 + 1.37627343E-12 0.00000000E+00-6.23497348E-11 0.00000000E+00-1.25061766E-14 + 2.72678577E-06-1.21299299E-10 4.00371611E-08 1.37627343E-12 0.00000000E+00 + 1.20012210E-08 0.00000000E+00 6.23497348E-11-5.12633896E-04 2.38640242E-08 +-2.72678577E-06 1.21299299E-10 1.79911893E-04 0.00000000E+00 8.03935107E-06 +-2.88699829E-20 1.79911893E-04 0.00000000E+00 8.03935107E-06-2.88699829E-20 + 0.00000000E+00 1.20174288E-08 0.00000000E+00-6.23997595E-11-5.68131739E-04 + 2.19182897E-08 2.88693442E-06-1.15794206E-10 1.79946880E-03 0.00000000E+00 + 2.69962119E-04 0.00000000E+00 1.04956041E-04-3.56535389E-19 1.85000411E-05 +-5.61302147E-20 1.79946880E-03 0.00000000E+00 2.69962119E-04 0.00000000E+00 + 1.04956041E-04-3.56535389E-19 1.85000411E-05-5.61302147E-20 5.12633896E-04 + 2.38640242E-08 2.72678577E-06 1.21299299E-10 0.00000000E+00 1.20012210E-08 + 0.00000000E+00 6.23497348E-11 8.03935107E-06 2.88699829E-20 1.79911893E-04 + 0.00000000E+00 8.03935107E-06 2.88699829E-20 1.79911893E-04 0.00000000E+00 + 5.68131739E-04 2.19182897E-08-2.88693442E-06-1.15794206E-10 0.00000000E+00 + 1.20174288E-08 0.00000000E+00-6.23997595E-11 1.04956041E-04 3.56535389E-19 + 1.85000411E-05 5.61302147E-20 1.79946880E-03 0.00000000E+00 2.69962119E-04 + 0.00000000E+00 1.04956041E-04 3.56535389E-19 1.85000411E-05 5.61302147E-20 + 1.79946880E-03 0.00000000E+00 2.69962119E-04 0.00000000E+00 0.00000000E+00 + 1.20012210E-08 0.00000000E+00 6.23497348E-11-5.12633896E-04 2.38640242E-08 +-2.72678577E-06 1.21299299E-10 1.79911893E-04 0.00000000E+00 8.03935107E-06 +-2.88699829E-20 1.04040854E+00 0.00000000E+00 3.04480281E-02-7.33421282E-17 + 0.00000000E+00 1.20174288E-08 0.00000000E+00-6.23997595E-11-5.68131739E-04 + 2.19182897E-08 2.88693442E-06-1.15794206E-10 1.79946880E-03 0.00000000E+00 + 2.69962119E-04 0.00000000E+00 1.04956041E-04-3.56535389E-19 1.85000411E-05 +-5.61302147E-20 6.85586021E+00 0.00000000E+00 6.93716262E-01 0.00000000E+00 + 2.43619469E-01-2.11750019E-16 3.04570830E-02 2.65162758E-18 7.28403617E-04 + 1.79388205E-08 3.84745108E-06 9.18196769E-11 0.00000000E+00 1.20533236E-08 + 0.00000000E+00 6.26131844E-11 1.84996244E-05 4.72947059E-20 2.69959957E-04 + 0.00000000E+00 3.04569905E-02 1.48691177E-17 7.01787952E-01 0.00000000E+00 + 7.83802446E-04 1.68344745E-08-4.00731985E-06-8.86251281E-11 0.00000000E+00 + 1.20571862E-08 0.00000000E+00-6.26236510E-11 2.05232888E-04 4.20159737E-19 + 3.31061369E-05 6.34179378E-20 2.52030057E-03 0.00000000E+00 3.60124633E-04 + 0.00000000E+00 2.43705163E-01 6.40756784E-16 3.04695545E-02 1.45867592E-16 + 4.88406857E+00 0.00000000E+00 5.26451423E-01 0.00000000E+00 1.03550242E-01 + 0.00000000E+00 6.37319247E-04 0.00000000E+00-4.50221714E-04 2.04249510E-18 +-2.81330261E-06 1.28258817E-20 0.00000000E+00 6.03135107E-10-3.54980149E-05 + 8.62005532E-10 0.00000000E+00 6.03135107E-10-3.54980149E-05 8.62005532E-10 + 5.00624946E-01 0.00000000E+00-1.96208182E-04 0.00000000E+00-2.57845141E-03 + 1.07736966E-17 5.83895678E-08-4.34983776E-21 0.00000000E+00-1.20174288E-08 + 0.00000000E+00-1.32457192E-08 5.68131739E-04-2.19182897E-08 7.13123719E-04 +-2.17147902E-08 0.00000000E+00-1.20174288E-08 0.00000000E+00-1.32457192E-08 + 5.68131739E-04-2.19182897E-08 7.13123719E-04-2.17147902E-08 7.38446799E-02 + 0.00000000E+00-4.66716499E-04 0.00000000E+00-4.41589833E-04 1.53590813E-18 + 2.76342658E-06-9.70934951E-21 0.00000000E+00-1.20533236E-08 0.00000000E+00 + 6.02136996E-10 7.28403617E-04-1.79388205E-08-2.93398284E-05 1.04148447E-09 + 0.00000000E+00-1.20533236E-08 0.00000000E+00 6.02136996E-10 7.28403617E-04 +-1.79388205E-08-2.93398284E-05 1.04148447E-09-1.85403385E-05-1.45442440E-09 + 4.00371611E-08-1.37627343E-12 0.00000000E+00-5.98120072E-10 0.00000000E+00 + 1.25061766E-14-6.63484803E-06-2.12500494E-20-1.12468503E-04 0.00000000E+00 +-1.52262778E-02-1.76726252E-17-4.33531200E-01 0.00000000E+00 7.13123719E-04 + 2.17147902E-08 8.00762788E-08-1.86355687E-12 0.00000000E+00 1.32457192E-08 + 0.00000000E+00 1.94002525E-14 1.85000411E-05 5.61302147E-20 7.54800474E-05 + 2.03098584E-19 2.69962119E-04 0.00000000E+00 1.07988506E-03 0.00000000E+00 + 3.04570830E-02-2.65162758E-18 1.21829401E-01 9.80370983E-17 6.93716262E-01 + 0.00000000E+00 2.85213344E+00 0.00000000E+00-4.62673721E-05-7.03895672E-10 + 3.99671908E-08-7.98637196E-13 0.00000000E+00-6.03304141E-10 0.00000000E+00 + 2.61665674E-15 1.84996244E-05 4.72947059E-20-1.29014403E-05-2.76781609E-20 + 2.69959957E-04 0.00000000E+00-1.57521148E-04 0.00000000E+00 3.04569905E-02 + 1.48691177E-17-1.52316362E-02-4.01841774E-17 7.01787952E-01 0.00000000E+00 +-3.07059844E-01 0.00000000E+00 0.00000000E+00-5.98120072E-10 0.00000000E+00 + 1.25061766E-14 1.85403385E-05-1.45442440E-09-4.00371611E-08-1.37627343E-12 +-1.12468503E-04 0.00000000E+00-6.63484803E-06 2.12500494E-20-4.33531200E-01 + 0.00000000E+00-1.52262778E-02 1.76726252E-17 0.00000000E+00 1.32457192E-08 + 0.00000000E+00 1.94002525E-14-7.13123719E-04 2.17147902E-08-8.00762788E-08 +-1.86355687E-12 2.69962119E-04 0.00000000E+00 1.07988506E-03 0.00000000E+00 + 1.85000411E-05-5.61302147E-20 7.54800474E-05-2.03098584E-19 6.93716262E-01 + 0.00000000E+00 2.85213344E+00 0.00000000E+00 3.04570830E-02 2.65162758E-18 + 1.21829401E-01-9.80370983E-17 0.00000000E+00-6.03304141E-10 0.00000000E+00 + 2.61665674E-15 4.62673721E-05-7.03895672E-10-3.99671908E-08-7.98637196E-13 + 2.69959957E-04 0.00000000E+00-1.57521148E-04 0.00000000E+00 1.84996244E-05 +-4.72947059E-20-1.29014403E-05 2.76781609E-20 7.01787952E-01 0.00000000E+00 +-3.07059844E-01 0.00000000E+00 3.04569905E-02-1.48691177E-17-1.52316362E-02 + 4.01841774E-17-1.85403385E-05-1.45442440E-09 4.00371611E-08-1.37627343E-12 + 0.00000000E+00-5.98120072E-10 0.00000000E+00 1.25061766E-14-6.63484803E-06 +-2.12500494E-20-1.12468503E-04 0.00000000E+00-6.63484803E-06-2.12500494E-20 +-1.12468503E-04 0.00000000E+00 7.13123719E-04 2.17147902E-08 8.00762788E-08 +-1.86355687E-12 0.00000000E+00 1.32457192E-08 0.00000000E+00 1.94002525E-14 + 1.85000411E-05 5.61302147E-20 7.54800474E-05 2.03098584E-19 2.69962119E-04 + 0.00000000E+00 1.07988506E-03 0.00000000E+00 1.85000411E-05 5.61302147E-20 + 7.54800474E-05 2.03098584E-19 2.69962119E-04 0.00000000E+00 1.07988506E-03 + 0.00000000E+00-4.62673721E-05-7.03895672E-10 3.99671908E-08-7.98637196E-13 + 0.00000000E+00-6.03304141E-10 0.00000000E+00 2.61665674E-15 1.84996244E-05 + 4.72947059E-20-1.29014403E-05-2.76781609E-20 2.69959957E-04 0.00000000E+00 +-1.57521148E-04 0.00000000E+00 1.84996244E-05 4.72947059E-20-1.29014403E-05 +-2.76781609E-20 2.69959957E-04 0.00000000E+00-1.57521148E-04 0.00000000E+00 + 0.00000000E+00-5.98120072E-10 0.00000000E+00 1.25061766E-14 1.85403385E-05 +-1.45442440E-09-4.00371611E-08-1.37627343E-12-1.12468503E-04 0.00000000E+00 +-6.63484803E-06 2.12500494E-20-1.12468503E-04 0.00000000E+00-6.63484803E-06 + 2.12500494E-20 0.00000000E+00 1.32457192E-08 0.00000000E+00 1.94002525E-14 +-7.13123719E-04 2.17147902E-08-8.00762788E-08-1.86355687E-12 2.69962119E-04 + 0.00000000E+00 1.07988506E-03 0.00000000E+00 1.85000411E-05-5.61302147E-20 + 7.54800474E-05-2.03098584E-19 2.69962119E-04 0.00000000E+00 1.07988506E-03 + 0.00000000E+00 1.85000411E-05-5.61302147E-20 7.54800474E-05-2.03098584E-19 + 0.00000000E+00-6.03304141E-10 0.00000000E+00 2.61665674E-15 4.62673721E-05 +-7.03895672E-10-3.99671908E-08-7.98637196E-13 2.69959957E-04 0.00000000E+00 +-1.57521148E-04 0.00000000E+00 1.84996244E-05-4.72947059E-20-1.29014403E-05 + 2.76781609E-20 2.69959957E-04 0.00000000E+00-1.57521148E-04 0.00000000E+00 + 1.84996244E-05-4.72947059E-20-1.29014403E-05 2.76781609E-20 2.81655538E-06 + 1.27299719E-20 1.68709408E-08 7.66854568E-23-6.57289798E-04 0.00000000E+00 +-3.87786425E-06 0.00000000E+00-4.00371611E-08 1.37627343E-12 0.00000000E+00 +-1.25061766E-14-4.00371611E-08 1.37627343E-12 0.00000000E+00-1.25061766E-14 + 5.83895678E-08 4.34983776E-21-4.45784504E-08-1.82919987E-22-1.96208182E-04 + 0.00000000E+00 8.74060922E-06 0.00000000E+00 2.88693442E-06 1.15794206E-10 +-8.00762788E-08 1.86355687E-12 0.00000000E+00 6.23997595E-11 0.00000000E+00 +-1.94002525E-14 2.88693442E-06 1.15794206E-10-8.00762788E-08 1.86355687E-12 + 0.00000000E+00 6.23997595E-11 0.00000000E+00-1.94002525E-14-2.75847080E-06 +-9.48370596E-21 1.65473286E-08 5.74287815E-23 4.56590205E-04 0.00000000E+00 +-2.76624049E-06 0.00000000E+00-3.84745108E-06-9.18196769E-11-3.99671908E-08 + 7.98637196E-13 0.00000000E+00-6.26131844E-11 0.00000000E+00-2.61665674E-15 +-3.84745108E-06-9.18196769E-11-3.99671908E-08 7.98637196E-13 0.00000000E+00 +-6.26131844E-11 0.00000000E+00-2.61665674E-15-4.50221714E-04-2.04249510E-18 +-2.81330261E-06-1.28258817E-20 1.03550242E-01 0.00000000E+00 6.37319247E-04 + 0.00000000E+00 3.54980149E-05 8.62005532E-10 0.00000000E+00 6.03135107E-10 + 3.54980149E-05 8.62005532E-10 0.00000000E+00 6.03135107E-10-2.57845141E-03 +-1.07736966E-17 5.83895678E-08 4.34983776E-21 5.00624946E-01 0.00000000E+00 +-1.96208182E-04 0.00000000E+00-5.68131739E-04-2.19182897E-08-7.13123719E-04 +-2.17147902E-08 0.00000000E+00-1.20174288E-08 0.00000000E+00-1.32457192E-08 +-5.68131739E-04-2.19182897E-08-7.13123719E-04-2.17147902E-08 0.00000000E+00 +-1.20174288E-08 0.00000000E+00-1.32457192E-08-4.41589833E-04-1.53590813E-18 + 2.76342658E-06 9.70934951E-21 7.38446799E-02 0.00000000E+00-4.66716499E-04 + 0.00000000E+00-7.28403617E-04-1.79388205E-08 2.93398284E-05 1.04148447E-09 + 0.00000000E+00-1.20533236E-08 0.00000000E+00 6.02136996E-10-7.28403617E-04 +-1.79388205E-08 2.93398284E-05 1.04148447E-09 0.00000000E+00-1.20533236E-08 + 0.00000000E+00 6.02136996E-10-6.57289798E-04 0.00000000E+00-3.87786425E-06 + 0.00000000E+00 2.81655538E-06-1.27299719E-20 1.68709408E-08-7.66854568E-23 + 0.00000000E+00-1.25061766E-14 4.00371611E-08 1.37627343E-12 0.00000000E+00 +-1.25061766E-14 4.00371611E-08 1.37627343E-12-1.96208182E-04 0.00000000E+00 + 8.74060922E-06 0.00000000E+00 5.83895678E-08-4.34983776E-21-4.45784504E-08 + 1.82919987E-22 0.00000000E+00 6.23997595E-11 0.00000000E+00-1.94002525E-14 +-2.88693442E-06 1.15794206E-10 8.00762788E-08 1.86355687E-12 0.00000000E+00 + 6.23997595E-11 0.00000000E+00-1.94002525E-14-2.88693442E-06 1.15794206E-10 + 8.00762788E-08 1.86355687E-12 4.56590205E-04 0.00000000E+00-2.76624049E-06 + 0.00000000E+00-2.75847080E-06 9.48370596E-21 1.65473286E-08-5.74287815E-23 + 0.00000000E+00-6.26131844E-11 0.00000000E+00-2.61665674E-15 3.84745108E-06 +-9.18196769E-11 3.99671908E-08 7.98637196E-13 0.00000000E+00-6.26131844E-11 + 0.00000000E+00-2.61665674E-15 3.84745108E-06-9.18196769E-11 3.99671908E-08 + 7.98637196E-13 0.00000000E+00 1.20533236E-08 0.00000000E+00 6.26131844E-11 +-7.28403617E-04 1.79388205E-08-3.84745108E-06 9.18196769E-11 2.69959957E-04 + 0.00000000E+00 1.84996244E-05-4.72947059E-20 2.69959957E-04 0.00000000E+00 + 1.84996244E-05-4.72947059E-20 0.00000000E+00 1.20571862E-08 0.00000000E+00 +-6.26236510E-11-7.83802446E-04 1.68344745E-08 4.00731985E-06-8.86251281E-11 + 2.52030057E-03 0.00000000E+00 3.60124633E-04 0.00000000E+00 2.05232888E-04 +-4.20159737E-19 3.31061369E-05-6.34179378E-20 2.52030057E-03 0.00000000E+00 + 3.60124633E-04 0.00000000E+00 2.05232888E-04-4.20159737E-19 3.31061369E-05 +-6.34179378E-20 7.28403617E-04 1.79388205E-08 3.84745108E-06 9.18196769E-11 + 0.00000000E+00 1.20533236E-08 0.00000000E+00 6.26131844E-11 1.84996244E-05 + 4.72947059E-20 2.69959957E-04 0.00000000E+00 1.84996244E-05 4.72947059E-20 + 2.69959957E-04 0.00000000E+00 7.83802446E-04 1.68344745E-08-4.00731985E-06 +-8.86251281E-11 0.00000000E+00 1.20571862E-08 0.00000000E+00-6.26236510E-11 + 2.05232888E-04 4.20159737E-19 3.31061369E-05 6.34179378E-20 2.52030057E-03 + 0.00000000E+00 3.60124633E-04 0.00000000E+00 2.05232888E-04 4.20159737E-19 + 3.31061369E-05 6.34179378E-20 2.52030057E-03 0.00000000E+00 3.60124633E-04 + 0.00000000E+00 0.00000000E+00 1.20533236E-08 0.00000000E+00 6.26131844E-11 +-7.28403617E-04 1.79388205E-08-3.84745108E-06 9.18196769E-11 2.69959957E-04 + 0.00000000E+00 1.84996244E-05-4.72947059E-20 7.01787952E-01 0.00000000E+00 + 3.04569905E-02-1.48691177E-17 0.00000000E+00 1.20571862E-08 0.00000000E+00 +-6.26236510E-11-7.83802446E-04 1.68344745E-08 4.00731985E-06-8.86251281E-11 + 2.52030057E-03 0.00000000E+00 3.60124633E-04 0.00000000E+00 2.05232888E-04 +-4.20159737E-19 3.31061369E-05-6.34179378E-20 4.88406857E+00 0.00000000E+00 + 5.26451423E-01 0.00000000E+00 2.43705163E-01-6.40756784E-16 3.04695545E-02 +-1.45867592E-16 9.43357356E-04 1.45357677E-08 4.96357275E-06 7.48028240E-11 + 0.00000000E+00 1.20744098E-08 0.00000000E+00 6.27304824E-11 3.31068566E-05 + 8.21190576E-20 3.60121900E-04 0.00000000E+00 3.04694652E-02 1.59557089E-16 + 5.28923861E-01 0.00000000E+00 9.98426591E-04 1.39711211E-08-5.12248152E-06 +-7.31822643E-11 0.00000000E+00 1.20896304E-08 0.00000000E+00-6.27741751E-11 + 3.38772847E-04 6.28018266E-19 5.18836571E-05 6.00996193E-20 3.24219056E-03 + 0.00000000E+00 4.50437997E-04 0.00000000E+00 2.43819302E-01 1.27254241E-15 + 3.04856147E-02 1.39606146E-16 3.79521021E+00 0.00000000E+00 4.23253149E-01 + 0.00000000E+00 7.38446799E-02 0.00000000E+00 4.56590205E-04 0.00000000E+00 +-4.41589833E-04 1.53590813E-18-2.75847080E-06 9.48370596E-21 0.00000000E+00 + 6.03304141E-10-4.62673721E-05 7.03895672E-10 0.00000000E+00 6.03304141E-10 +-4.62673721E-05 7.03895672E-10 3.74432269E-01 0.00000000E+00-1.09189310E-04 + 0.00000000E+00-2.51934704E-03 9.12191690E-18 7.84221017E-08 2.61903684E-21 + 0.00000000E+00-1.20571862E-08 0.00000000E+00-1.32683861E-08 7.83802446E-04 +-1.68344745E-08 9.50054445E-04-1.70610481E-08 0.00000000E+00-1.20571862E-08 + 0.00000000E+00-1.32683861E-08 7.83802446E-04-1.68344745E-08 9.50054445E-04 +-1.70610481E-08 5.74549672E-02 0.00000000E+00-3.62254380E-04 0.00000000E+00 +-4.29934992E-04 1.79579035E-18 2.69121152E-06-1.11589027E-20 0.00000000E+00 +-1.20744098E-08 0.00000000E+00 6.01925375E-10 9.43357356E-04-1.45357677E-08 +-4.01296596E-05 8.00484630E-10 0.00000000E+00-1.20744098E-08 0.00000000E+00 + 6.01925375E-10 9.43357356E-04-1.45357677E-08-4.01296596E-05 8.00484630E-10 +-2.93398284E-05-1.04148447E-09 3.99671908E-08-7.98637196E-13 0.00000000E+00 +-6.02136996E-10 0.00000000E+00 2.61665674E-15-1.29014403E-05-2.76781609E-20 +-1.57521148E-04 0.00000000E+00-1.52316362E-02-4.01841774E-17-3.07059844E-01 + 0.00000000E+00 9.50054445E-04 1.70610481E-08 7.96777527E-08-1.10288433E-12 + 0.00000000E+00 1.32683861E-08 0.00000000E+00 4.76539318E-15 3.31061369E-05 + 6.34179378E-20 1.33915447E-04 2.77257248E-19 3.60124633E-04 0.00000000E+00 + 1.44054723E-03 0.00000000E+00 3.04695545E-02 1.45867592E-16 1.21879320E-01 + 5.56667658E-16 5.26451423E-01 0.00000000E+00 2.13562205E+00 0.00000000E+00 +-5.69563318E-05-6.28123444E-10 3.97271943E-08-4.05139921E-13 0.00000000E+00 +-6.06571712E-10 0.00000000E+00 1.09231881E-14 3.31068566E-05 8.21190576E-20 +-2.12476284E-05-3.55546692E-20 3.60121900E-04 0.00000000E+00-2.02639974E-04 + 0.00000000E+00 3.04694652E-02 1.59557089E-16-1.52387700E-02-7.47908089E-17 + 5.28923861E-01 0.00000000E+00-2.38044252E-01 0.00000000E+00 0.00000000E+00 +-6.02136996E-10 0.00000000E+00 2.61665674E-15 2.93398284E-05-1.04148447E-09 +-3.99671908E-08-7.98637196E-13-1.57521148E-04 0.00000000E+00-1.29014403E-05 + 2.76781609E-20-3.07059844E-01 0.00000000E+00-1.52316362E-02 4.01841774E-17 + 0.00000000E+00 1.32683861E-08 0.00000000E+00 4.76539318E-15-9.50054445E-04 + 1.70610481E-08-7.96777527E-08-1.10288433E-12 3.60124633E-04 0.00000000E+00 + 1.44054723E-03 0.00000000E+00 3.31061369E-05-6.34179378E-20 1.33915447E-04 +-2.77257248E-19 5.26451423E-01 0.00000000E+00 2.13562205E+00 0.00000000E+00 + 3.04695545E-02-1.45867592E-16 1.21879320E-01-5.56667658E-16 0.00000000E+00 +-6.06571712E-10 0.00000000E+00 1.09231881E-14 5.69563318E-05-6.28123444E-10 +-3.97271943E-08-4.05139921E-13 3.60121900E-04 0.00000000E+00-2.02639974E-04 + 0.00000000E+00 3.31068566E-05-8.21190576E-20-2.12476284E-05 3.55546692E-20 + 5.28923861E-01 0.00000000E+00-2.38044252E-01 0.00000000E+00 3.04694652E-02 +-1.59557089E-16-1.52387700E-02 7.47908089E-17-2.93398284E-05-1.04148447E-09 + 3.99671908E-08-7.98637196E-13 0.00000000E+00-6.02136996E-10 0.00000000E+00 + 2.61665674E-15-1.29014403E-05-2.76781609E-20-1.57521148E-04 0.00000000E+00 +-1.29014403E-05-2.76781609E-20-1.57521148E-04 0.00000000E+00 9.50054445E-04 + 1.70610481E-08 7.96777527E-08-1.10288433E-12 0.00000000E+00 1.32683861E-08 + 0.00000000E+00 4.76539318E-15 3.31061369E-05 6.34179378E-20 1.33915447E-04 + 2.77257248E-19 3.60124633E-04 0.00000000E+00 1.44054723E-03 0.00000000E+00 + 3.31061369E-05 6.34179378E-20 1.33915447E-04 2.77257248E-19 3.60124633E-04 + 0.00000000E+00 1.44054723E-03 0.00000000E+00-5.69563318E-05-6.28123444E-10 + 3.97271943E-08-4.05139921E-13 0.00000000E+00-6.06571712E-10 0.00000000E+00 + 1.09231881E-14 3.31068566E-05 8.21190576E-20-2.12476284E-05-3.55546692E-20 + 3.60121900E-04 0.00000000E+00-2.02639974E-04 0.00000000E+00 3.31068566E-05 + 8.21190576E-20-2.12476284E-05-3.55546692E-20 3.60121900E-04 0.00000000E+00 +-2.02639974E-04 0.00000000E+00 0.00000000E+00-6.02136996E-10 0.00000000E+00 + 2.61665674E-15 2.93398284E-05-1.04148447E-09-3.99671908E-08-7.98637196E-13 +-1.57521148E-04 0.00000000E+00-1.29014403E-05 2.76781609E-20-1.57521148E-04 + 0.00000000E+00-1.29014403E-05 2.76781609E-20 0.00000000E+00 1.32683861E-08 + 0.00000000E+00 4.76539318E-15-9.50054445E-04 1.70610481E-08-7.96777527E-08 +-1.10288433E-12 3.60124633E-04 0.00000000E+00 1.44054723E-03 0.00000000E+00 + 3.31061369E-05-6.34179378E-20 1.33915447E-04-2.77257248E-19 3.60124633E-04 + 0.00000000E+00 1.44054723E-03 0.00000000E+00 3.31061369E-05-6.34179378E-20 + 1.33915447E-04-2.77257248E-19 0.00000000E+00-6.06571712E-10 0.00000000E+00 + 1.09231881E-14 5.69563318E-05-6.28123444E-10-3.97271943E-08-4.05139921E-13 + 3.60121900E-04 0.00000000E+00-2.02639974E-04 0.00000000E+00 3.31068566E-05 +-8.21190576E-20-2.12476284E-05 3.55546692E-20 3.60121900E-04 0.00000000E+00 +-2.02639974E-04 0.00000000E+00 3.31068566E-05-8.21190576E-20-2.12476284E-05 + 3.55546692E-20 2.76342658E-06 9.70934951E-21 1.65473286E-08 5.74287815E-23 +-4.66716499E-04 0.00000000E+00-2.76624049E-06 0.00000000E+00-3.99671908E-08 + 7.98637196E-13 0.00000000E+00-2.61665674E-15-3.99671908E-08 7.98637196E-13 + 0.00000000E+00-2.61665674E-15 7.84221017E-08-2.61903684E-21-4.35597697E-08 +-1.61637492E-22-1.09189310E-04 0.00000000E+00 6.50985065E-06 0.00000000E+00 + 4.00731985E-06 8.86251281E-11-7.96777527E-08 1.10288433E-12 0.00000000E+00 + 6.26236510E-11 0.00000000E+00-4.76539318E-15 4.00731985E-06 8.86251281E-11 +-7.96777527E-08 1.10288433E-12 0.00000000E+00 6.26236510E-11 0.00000000E+00 +-4.76539318E-15-2.68493262E-06-1.13072021E-20 1.61105167E-08 6.73945958E-23 + 3.56150735E-04 0.00000000E+00-2.15252822E-06 0.00000000E+00-4.96357275E-06 +-7.48028240E-11-3.97271943E-08 4.05139921E-13 0.00000000E+00-6.27304824E-11 + 0.00000000E+00-1.09231881E-14-4.96357275E-06-7.48028240E-11-3.97271943E-08 + 4.05139921E-13 0.00000000E+00-6.27304824E-11 0.00000000E+00-1.09231881E-14 +-4.41589833E-04-1.53590813E-18-2.75847080E-06-9.48370596E-21 7.38446799E-02 + 0.00000000E+00 4.56590205E-04 0.00000000E+00 4.62673721E-05 7.03895672E-10 + 0.00000000E+00 6.03304141E-10 4.62673721E-05 7.03895672E-10 0.00000000E+00 + 6.03304141E-10-2.51934704E-03-9.12191690E-18 7.84221017E-08-2.61903684E-21 + 3.74432269E-01 0.00000000E+00-1.09189310E-04 0.00000000E+00-7.83802446E-04 +-1.68344745E-08-9.50054445E-04-1.70610481E-08 0.00000000E+00-1.20571862E-08 + 0.00000000E+00-1.32683861E-08-7.83802446E-04-1.68344745E-08-9.50054445E-04 +-1.70610481E-08 0.00000000E+00-1.20571862E-08 0.00000000E+00-1.32683861E-08 +-4.29934992E-04-1.79579035E-18 2.69121152E-06 1.11589027E-20 5.74549672E-02 + 0.00000000E+00-3.62254380E-04 0.00000000E+00-9.43357356E-04-1.45357677E-08 + 4.01296596E-05 8.00484630E-10 0.00000000E+00-1.20744098E-08 0.00000000E+00 + 6.01925375E-10-9.43357356E-04-1.45357677E-08 4.01296596E-05 8.00484630E-10 + 0.00000000E+00-1.20744098E-08 0.00000000E+00 6.01925375E-10-4.66716499E-04 + 0.00000000E+00-2.76624049E-06 0.00000000E+00 2.76342658E-06-9.70934951E-21 + 1.65473286E-08-5.74287815E-23 0.00000000E+00-2.61665674E-15 3.99671908E-08 + 7.98637196E-13 0.00000000E+00-2.61665674E-15 3.99671908E-08 7.98637196E-13 +-1.09189310E-04 0.00000000E+00 6.50985065E-06 0.00000000E+00 7.84221017E-08 + 2.61903684E-21-4.35597697E-08 1.61637492E-22 0.00000000E+00 6.26236510E-11 + 0.00000000E+00-4.76539318E-15-4.00731985E-06 8.86251281E-11 7.96777527E-08 + 1.10288433E-12 0.00000000E+00 6.26236510E-11 0.00000000E+00-4.76539318E-15 +-4.00731985E-06 8.86251281E-11 7.96777527E-08 1.10288433E-12 3.56150735E-04 + 0.00000000E+00-2.15252822E-06 0.00000000E+00-2.68493262E-06 1.13072021E-20 + 1.61105167E-08-6.73945958E-23 0.00000000E+00-6.27304824E-11 0.00000000E+00 +-1.09231881E-14 4.96357275E-06-7.48028240E-11 3.97271943E-08 4.05139921E-13 + 0.00000000E+00-6.27304824E-11 0.00000000E+00-1.09231881E-14 4.96357275E-06 +-7.48028240E-11 3.97271943E-08 4.05139921E-13 0.00000000E+00 1.20744098E-08 + 0.00000000E+00 6.27304824E-11-9.43357356E-04 1.45357677E-08-4.96357275E-06 + 7.48028240E-11 3.60121900E-04 0.00000000E+00 3.31068566E-05-8.21190576E-20 + 3.60121900E-04 0.00000000E+00 3.31068566E-05-8.21190576E-20 0.00000000E+00 + 1.20896304E-08 0.00000000E+00-6.27741751E-11-9.98426591E-04 1.39711211E-08 + 5.12248152E-06-7.31822643E-11 3.24219056E-03 0.00000000E+00 4.50437997E-04 + 0.00000000E+00 3.38772847E-04-6.28018266E-19 5.18836571E-05-6.00996193E-20 + 3.24219056E-03 0.00000000E+00 4.50437997E-04 0.00000000E+00 3.38772847E-04 +-6.28018266E-19 5.18836571E-05-6.00996193E-20 9.43357356E-04 1.45357677E-08 + 4.96357275E-06 7.48028240E-11 0.00000000E+00 1.20744098E-08 0.00000000E+00 + 6.27304824E-11 3.31068566E-05 8.21190576E-20 3.60121900E-04 0.00000000E+00 + 3.31068566E-05 8.21190576E-20 3.60121900E-04 0.00000000E+00 9.98426591E-04 + 1.39711211E-08-5.12248152E-06-7.31822643E-11 0.00000000E+00 1.20896304E-08 + 0.00000000E+00-6.27741751E-11 3.38772847E-04 6.28018266E-19 5.18836571E-05 + 6.00996193E-20 3.24219056E-03 0.00000000E+00 4.50437997E-04 0.00000000E+00 + 3.38772847E-04 6.28018266E-19 5.18836571E-05 6.00996193E-20 3.24219056E-03 + 0.00000000E+00 4.50437997E-04 0.00000000E+00 0.00000000E+00 1.20744098E-08 + 0.00000000E+00 6.27304824E-11-9.43357356E-04 1.45357677E-08-4.96357275E-06 + 7.48028240E-11 3.60121900E-04 0.00000000E+00 3.31068566E-05-8.21190576E-20 + 5.28923861E-01 0.00000000E+00 3.04694652E-02-1.59557089E-16 0.00000000E+00 + 1.20896304E-08 0.00000000E+00-6.27741751E-11-9.98426591E-04 1.39711211E-08 + 5.12248152E-06-7.31822643E-11 3.24219056E-03 0.00000000E+00 4.50437997E-04 + 0.00000000E+00 3.38772847E-04-6.28018266E-19 5.18836571E-05-6.00996193E-20 + 3.79521021E+00 0.00000000E+00 4.23253149E-01 0.00000000E+00 2.43819302E-01 +-1.27254241E-15 3.04856147E-02-1.39606146E-16 1.15712002E-03 1.26673472E-08 + 6.07356017E-06 6.53761040E-11 0.00000000E+00 1.21387422E-08 0.00000000E+00 + 6.30517225E-11 5.18838302E-05 4.96031128E-21 4.50435069E-04 0.00000000E+00 + 3.04855228E-02 1.10406303E-16 4.24250527E-01 0.00000000E+00 1.21191772E-03 + 1.23372684E-08-6.23168798E-06-6.44224616E-11 0.00000000E+00 1.21279096E-08 + 0.00000000E+00-6.30222011E-11 5.05620373E-04 5.32131861E-19 7.48181387E-05 + 1.74434762E-19 3.96544202E-03 0.00000000E+00 5.40940354E-04 0.00000000E+00 + 2.43962000E-01 5.24770833E-16 3.05052329E-02 3.59871873E-17 3.10426787E+00 + 0.00000000E+00 3.53658182E-01 0.00000000E+00 5.74549672E-02 0.00000000E+00 + 3.56150735E-04 0.00000000E+00-4.29934992E-04 1.79579035E-18-2.68493262E-06 + 1.13072021E-20 0.00000000E+00 6.06571712E-10-5.69563318E-05 6.28123444E-10 + 0.00000000E+00 6.06571712E-10-5.69563318E-05 6.28123444E-10 2.99487918E-01 + 0.00000000E+00-6.94632345E-05 0.00000000E+00-2.44378230E-03 9.86575575E-18 + 9.80058599E-08-3.07675707E-21 0.00000000E+00-1.20896304E-08 0.00000000E+00 +-1.33332525E-08 9.98426591E-04-1.39711211E-08 1.18564148E-03-1.45765685E-08 + 0.00000000E+00-1.20896304E-08 0.00000000E+00-1.33332525E-08 9.98426591E-04 +-1.39711211E-08 1.18564148E-03-1.45765685E-08 4.70686692E-02 0.00000000E+00 +-2.96310163E-04 0.00000000E+00-4.15388238E-04 1.42338342E-18 2.60096239E-06 +-9.04409808E-21 0.00000000E+00-1.21387422E-08 0.00000000E+00 6.07746368E-10 + 1.15712002E-03-1.26673472E-08-5.08524956E-05 6.77085146E-10 0.00000000E+00 +-1.21387422E-08 0.00000000E+00 6.07746368E-10 1.15712002E-03-1.26673472E-08 +-5.08524956E-05 6.77085146E-10-4.01296596E-05-8.00484630E-10 3.97271943E-08 +-4.05139921E-13 0.00000000E+00-6.01925375E-10 0.00000000E+00 1.09231881E-14 +-2.12476284E-05-3.55546692E-20-2.02639974E-04 0.00000000E+00-1.52387700E-02 +-7.47908089E-17-2.38044252E-01 0.00000000E+00 1.18564148E-03 1.45765685E-08 + 7.92514849E-08-6.59124682E-13 0.00000000E+00 1.33332525E-08 0.00000000E+00 + 4.10887169E-14 5.18836571E-05 6.00996193E-20 2.09019870E-04 1.98396506E-19 + 4.50437997E-04 0.00000000E+00 1.80181383E-03 0.00000000E+00 3.04856147E-02 + 1.39606146E-16 1.21943547E-01 4.79969868E-16 4.23253149E-01 0.00000000E+00 + 1.70753344E+00 0.00000000E+00-6.75962579E-05-5.76205544E-10 3.95319535E-08 +-2.38410603E-13 0.00000000E+00-6.04469862E-10 0.00000000E+00-7.38034003E-15 + 5.18838302E-05 4.96031128E-21-3.16754922E-05-4.48487683E-20 4.50435069E-04 + 0.00000000E+00-2.47843856E-04 0.00000000E+00 3.04855228E-02 1.10406303E-16 +-1.52476889E-02-3.65983727E-17 4.24250527E-01 0.00000000E+00-1.94477177E-01 + 0.00000000E+00 0.00000000E+00-6.01925375E-10 0.00000000E+00 1.09231881E-14 + 4.01296596E-05-8.00484630E-10-3.97271943E-08-4.05139921E-13-2.02639974E-04 + 0.00000000E+00-2.12476284E-05 3.55546692E-20-2.38044252E-01 0.00000000E+00 +-1.52387700E-02 7.47908089E-17 0.00000000E+00 1.33332525E-08 0.00000000E+00 + 4.10887169E-14-1.18564148E-03 1.45765685E-08-7.92514849E-08-6.59124682E-13 + 4.50437997E-04 0.00000000E+00 1.80181383E-03 0.00000000E+00 5.18836571E-05 +-6.00996193E-20 2.09019870E-04-1.98396506E-19 4.23253149E-01 0.00000000E+00 + 1.70753344E+00 0.00000000E+00 3.04856147E-02-1.39606146E-16 1.21943547E-01 +-4.79969868E-16 0.00000000E+00-6.04469862E-10 0.00000000E+00-7.38034003E-15 + 6.75962579E-05-5.76205544E-10-3.95319535E-08-2.38410603E-13 4.50435069E-04 + 0.00000000E+00-2.47843856E-04 0.00000000E+00 5.18838302E-05-4.96031128E-21 +-3.16754922E-05 4.48487683E-20 4.24250527E-01 0.00000000E+00-1.94477177E-01 + 0.00000000E+00 3.04855228E-02-1.10406303E-16-1.52476889E-02 3.65983727E-17 +-4.01296596E-05-8.00484630E-10 3.97271943E-08-4.05139921E-13 0.00000000E+00 +-6.01925375E-10 0.00000000E+00 1.09231881E-14-2.12476284E-05-3.55546692E-20 +-2.02639974E-04 0.00000000E+00-2.12476284E-05-3.55546692E-20-2.02639974E-04 + 0.00000000E+00 1.18564148E-03 1.45765685E-08 7.92514849E-08-6.59124682E-13 + 0.00000000E+00 1.33332525E-08 0.00000000E+00 4.10887169E-14 5.18836571E-05 + 6.00996193E-20 2.09019870E-04 1.98396506E-19 4.50437997E-04 0.00000000E+00 + 1.80181383E-03 0.00000000E+00 5.18836571E-05 6.00996193E-20 2.09019870E-04 + 1.98396506E-19 4.50437997E-04 0.00000000E+00 1.80181383E-03 0.00000000E+00 +-6.75962579E-05-5.76205544E-10 3.95319535E-08-2.38410603E-13 0.00000000E+00 +-6.04469862E-10 0.00000000E+00-7.38034003E-15 5.18838302E-05 4.96031128E-21 +-3.16754922E-05-4.48487683E-20 4.50435069E-04 0.00000000E+00-2.47843856E-04 + 0.00000000E+00 5.18838302E-05 4.96031128E-21-3.16754922E-05-4.48487683E-20 + 4.50435069E-04 0.00000000E+00-2.47843856E-04 0.00000000E+00 0.00000000E+00 +-6.01925375E-10 0.00000000E+00 1.09231881E-14 4.01296596E-05-8.00484630E-10 +-3.97271943E-08-4.05139921E-13-2.02639974E-04 0.00000000E+00-2.12476284E-05 + 3.55546692E-20-2.02639974E-04 0.00000000E+00-2.12476284E-05 3.55546692E-20 + 0.00000000E+00 1.33332525E-08 0.00000000E+00 4.10887169E-14-1.18564148E-03 + 1.45765685E-08-7.92514849E-08-6.59124682E-13 4.50437997E-04 0.00000000E+00 + 1.80181383E-03 0.00000000E+00 5.18836571E-05-6.00996193E-20 2.09019870E-04 +-1.98396506E-19 4.50437997E-04 0.00000000E+00 1.80181383E-03 0.00000000E+00 + 5.18836571E-05-6.00996193E-20 2.09019870E-04-1.98396506E-19 0.00000000E+00 +-6.04469862E-10 0.00000000E+00-7.38034003E-15 6.75962579E-05-5.76205544E-10 +-3.95319535E-08-2.38410603E-13 4.50435069E-04 0.00000000E+00-2.47843856E-04 + 0.00000000E+00 5.18838302E-05-4.96031128E-21-3.16754922E-05 4.48487683E-20 + 4.50435069E-04 0.00000000E+00-2.47843856E-04 0.00000000E+00 5.18838302E-05 +-4.96031128E-21-3.16754922E-05 4.48487683E-20 2.69121152E-06 1.11589027E-20 + 1.61105167E-08 6.73945958E-23-3.62254380E-04 0.00000000E+00-2.15252822E-06 + 0.00000000E+00-3.97271943E-08 4.05139921E-13 0.00000000E+00-1.09231881E-14 +-3.97271943E-08 4.05139921E-13 0.00000000E+00-1.09231881E-14 9.80058599E-08 + 3.07675707E-21-4.22516598E-08-1.66457424E-22-6.94632345E-05 0.00000000E+00 + 5.19686000E-06 0.00000000E+00 5.12248152E-06 7.31822643E-11-7.92514849E-08 + 6.59124682E-13 0.00000000E+00 6.27741751E-11 0.00000000E+00-4.10887169E-14 + 5.12248152E-06 7.31822643E-11-7.92514849E-08 6.59124682E-13 0.00000000E+00 + 6.27741751E-11 0.00000000E+00-4.10887169E-14-2.59326559E-06-8.75083466E-21 + 1.55653273E-08 5.32998166E-23 2.92236183E-04 0.00000000E+00-1.76350734E-06 + 0.00000000E+00-6.07356017E-06-6.53761040E-11-3.95319535E-08 2.38410603E-13 + 0.00000000E+00-6.30517225E-11 0.00000000E+00 7.38034003E-15-6.07356017E-06 +-6.53761040E-11-3.95319535E-08 2.38410603E-13 0.00000000E+00-6.30517225E-11 + 0.00000000E+00 7.38034003E-15-4.29934992E-04-1.79579035E-18-2.68493262E-06 +-1.13072021E-20 5.74549672E-02 0.00000000E+00 3.56150735E-04 0.00000000E+00 + 5.69563318E-05 6.28123444E-10 0.00000000E+00 6.06571712E-10 5.69563318E-05 + 6.28123444E-10 0.00000000E+00 6.06571712E-10-2.44378230E-03-9.86575575E-18 + 9.80058599E-08 3.07675707E-21 2.99487918E-01 0.00000000E+00-6.94632345E-05 + 0.00000000E+00-9.98426591E-04-1.39711211E-08-1.18564148E-03-1.45765685E-08 + 0.00000000E+00-1.20896304E-08 0.00000000E+00-1.33332525E-08-9.98426591E-04 +-1.39711211E-08-1.18564148E-03-1.45765685E-08 0.00000000E+00-1.20896304E-08 + 0.00000000E+00-1.33332525E-08-4.15388238E-04-1.42338342E-18 2.60096239E-06 + 9.04409808E-21 4.70686692E-02 0.00000000E+00-2.96310163E-04 0.00000000E+00 +-1.15712002E-03-1.26673472E-08 5.08524956E-05 6.77085146E-10 0.00000000E+00 +-1.21387422E-08 0.00000000E+00 6.07746368E-10-1.15712002E-03-1.26673472E-08 + 5.08524956E-05 6.77085146E-10 0.00000000E+00-1.21387422E-08 0.00000000E+00 + 6.07746368E-10-3.62254380E-04 0.00000000E+00-2.15252822E-06 0.00000000E+00 + 2.69121152E-06-1.11589027E-20 1.61105167E-08-6.73945958E-23 0.00000000E+00 +-1.09231881E-14 3.97271943E-08 4.05139921E-13 0.00000000E+00-1.09231881E-14 + 3.97271943E-08 4.05139921E-13-6.94632345E-05 0.00000000E+00 5.19686000E-06 + 0.00000000E+00 9.80058599E-08-3.07675707E-21-4.22516598E-08 1.66457424E-22 + 0.00000000E+00 6.27741751E-11 0.00000000E+00-4.10887169E-14-5.12248152E-06 + 7.31822643E-11 7.92514849E-08 6.59124682E-13 0.00000000E+00 6.27741751E-11 + 0.00000000E+00-4.10887169E-14-5.12248152E-06 7.31822643E-11 7.92514849E-08 + 6.59124682E-13 2.92236183E-04 0.00000000E+00-1.76350734E-06 0.00000000E+00 +-2.59326559E-06 8.75083466E-21 1.55653273E-08-5.32998166E-23 0.00000000E+00 +-6.30517225E-11 0.00000000E+00 7.38034003E-15 6.07356017E-06-6.53761040E-11 + 3.95319535E-08 2.38410603E-13 0.00000000E+00-6.30517225E-11 0.00000000E+00 + 7.38034003E-15 6.07356017E-06-6.53761040E-11 3.95319535E-08 2.38410603E-13 + 0.00000000E+00 1.21387422E-08 0.00000000E+00 6.30517225E-11-1.15712002E-03 + 1.26673472E-08-6.07356017E-06 6.53761040E-11 4.50435069E-04 0.00000000E+00 + 5.18838302E-05-4.96031128E-21 4.50435069E-04 0.00000000E+00 5.18838302E-05 +-4.96031128E-21 0.00000000E+00 1.21279096E-08 0.00000000E+00-6.30222011E-11 +-1.21191772E-03 1.23372684E-08 6.23168798E-06-6.44224616E-11 3.96544202E-03 + 0.00000000E+00 5.40940354E-04 0.00000000E+00 5.05620373E-04-5.32131861E-19 + 7.48181387E-05-1.74434762E-19 3.96544202E-03 0.00000000E+00 5.40940354E-04 + 0.00000000E+00 5.05620373E-04-5.32131861E-19 7.48181387E-05-1.74434762E-19 + 1.15712002E-03 1.26673472E-08 6.07356017E-06 6.53761040E-11 0.00000000E+00 + 1.21387422E-08 0.00000000E+00 6.30517225E-11 5.18838302E-05 4.96031128E-21 + 4.50435069E-04 0.00000000E+00 5.18838302E-05 4.96031128E-21 4.50435069E-04 + 0.00000000E+00 1.21191772E-03 1.23372684E-08-6.23168798E-06-6.44224616E-11 + 0.00000000E+00 1.21279096E-08 0.00000000E+00-6.30222011E-11 5.05620373E-04 + 5.32131861E-19 7.48181387E-05 1.74434762E-19 3.96544202E-03 0.00000000E+00 + 5.40940354E-04 0.00000000E+00 5.05620373E-04 5.32131861E-19 7.48181387E-05 + 1.74434762E-19 3.96544202E-03 0.00000000E+00 5.40940354E-04 0.00000000E+00 + 0.00000000E+00 1.21387422E-08 0.00000000E+00 6.30517225E-11-1.15712002E-03 + 1.26673472E-08-6.07356017E-06 6.53761040E-11 4.50435069E-04 0.00000000E+00 + 5.18838302E-05-4.96031128E-21 4.24250527E-01 0.00000000E+00 3.04855228E-02 +-1.10406303E-16 0.00000000E+00 1.21279096E-08 0.00000000E+00-6.30222011E-11 +-1.21191772E-03 1.23372684E-08 6.23168798E-06-6.44224616E-11 3.96544202E-03 + 0.00000000E+00 5.40940354E-04 0.00000000E+00 5.05620373E-04-5.32131861E-19 + 7.48181387E-05-1.74434762E-19 3.10426787E+00 0.00000000E+00 3.53658182E-01 + 0.00000000E+00 2.43962000E-01-5.24770833E-16 3.05052329E-02-3.59871873E-17 + 1.36973968E-03 1.17315123E-08 7.17751334E-06 6.07640482E-11 0.00000000E+00 + 1.19752841E-08 0.00000000E+00 6.21268488E-11 7.48185997E-05 2.80812926E-19 + 5.40936972E-04 0.00000000E+00 3.05051474E-02 5.49754151E-17 3.54135028E-01 + 0.00000000E+00 1.42416081E-03 1.15929694E-08-7.33455437E-06-6.03674136E-11 + 0.00000000E+00 1.19143481E-08 0.00000000E+00-6.19489137E-11 7.05702772E-04 + 2.60561055E-18 1.01903190E-04 3.01009373E-19 4.69035571E-03 0.00000000E+00 + 6.31669660E-04 0.00000000E+00 2.44133215E-01 5.88104593E-16 3.05284070E-02 + 8.77936662E-17 2.62673415E+00 0.00000000E+00 3.03662001E-01 0.00000000E+00 + 4.70686692E-02 0.00000000E+00 2.92236183E-04 0.00000000E+00-4.15388238E-04 + 1.42338342E-18-2.59326559E-06 8.75083466E-21 0.00000000E+00 6.04469862E-10 +-6.75962579E-05 5.76205544E-10 0.00000000E+00 6.04469862E-10-6.75962579E-05 + 5.76205544E-10 2.49829652E-01 0.00000000E+00-4.80268846E-05 0.00000000E+00 +-2.35133601E-03 7.06606508E-18 1.17447073E-07-1.80710822E-21 0.00000000E+00 +-1.21279096E-08 0.00000000E+00-1.32753821E-08 1.21191772E-03-1.23372684E-08 + 1.42003874E-03-1.31710549E-08 0.00000000E+00-1.21279096E-08 0.00000000E+00 +-1.32753821E-08 1.21191772E-03-1.23372684E-08 1.42003874E-03-1.31710549E-08 + 3.99024901E-02 0.00000000E+00-2.50926479E-04 0.00000000E+00-3.97940900E-04 + 1.13270771E-18 2.49257327E-06-7.10148688E-21 0.00000000E+00-1.19752841E-08 + 0.00000000E+00 6.06772804E-10 1.36973968E-03-1.17315123E-08-6.15305081E-05 + 6.04620057E-10 0.00000000E+00-1.19752841E-08 0.00000000E+00 6.06772804E-10 + 1.36973968E-03-1.17315123E-08-6.15305081E-05 6.04620057E-10-5.08524956E-05 +-6.77085146E-10 3.95319535E-08-2.38410603E-13 0.00000000E+00-6.07746368E-10 + 0.00000000E+00-7.38034003E-15-3.16754922E-05-4.48487683E-20-2.47843856E-04 + 0.00000000E+00-1.52476889E-02-3.65983727E-17-1.94477177E-01 0.00000000E+00 + 1.42003874E-03 1.31710549E-08 7.88394604E-08-2.74806254E-13 0.00000000E+00 + 1.32753821E-08 0.00000000E+00-9.58296347E-14 7.48181387E-05 1.74434762E-19 + 3.00755851E-04 8.58263839E-19 5.40940354E-04 0.00000000E+00 2.16383601E-03 + 0.00000000E+00 3.05052329E-02 3.59871873E-17 1.22022028E-01 2.21230207E-16 + 3.53658182E-01 0.00000000E+00 1.42277135E+00 0.00000000E+00-7.81592117E-05 +-5.62348143E-10 3.92602581E-08-9.91586589E-14 0.00000000E+00-5.88113106E-10 + 0.00000000E+00-4.44837599E-14 7.48185997E-05 2.80812926E-19-4.41804474E-05 +-1.45455575E-19 5.40936972E-04 0.00000000E+00-2.93151658E-04 0.00000000E+00 + 3.05051474E-02 5.49754151E-17-1.52583886E-02-3.56922703E-17 3.54135028E-01 + 0.00000000E+00-1.64449257E-01 0.00000000E+00 0.00000000E+00-6.07746368E-10 + 0.00000000E+00-7.38034003E-15 5.08524956E-05-6.77085146E-10-3.95319535E-08 +-2.38410603E-13-2.47843856E-04 0.00000000E+00-3.16754922E-05 4.48487683E-20 +-1.94477177E-01 0.00000000E+00-1.52476889E-02 3.65983727E-17 0.00000000E+00 + 1.32753821E-08 0.00000000E+00-9.58296347E-14-1.42003874E-03 1.31710549E-08 +-7.88394604E-08-2.74806254E-13 5.40940354E-04 0.00000000E+00 2.16383601E-03 + 0.00000000E+00 7.48181387E-05-1.74434762E-19 3.00755851E-04-8.58263839E-19 + 3.53658182E-01 0.00000000E+00 1.42277135E+00 0.00000000E+00 3.05052329E-02 +-3.59871873E-17 1.22022028E-01-2.21230207E-16 0.00000000E+00-5.88113106E-10 + 0.00000000E+00-4.44837599E-14 7.81592117E-05-5.62348143E-10-3.92602581E-08 +-9.91586589E-14 5.40936972E-04 0.00000000E+00-2.93151658E-04 0.00000000E+00 + 7.48185997E-05-2.80812926E-19-4.41804474E-05 1.45455575E-19 3.54135028E-01 + 0.00000000E+00-1.64449257E-01 0.00000000E+00 3.05051474E-02-5.49754151E-17 +-1.52583886E-02 3.56922703E-17-5.08524956E-05-6.77085146E-10 3.95319535E-08 +-2.38410603E-13 0.00000000E+00-6.07746368E-10 0.00000000E+00-7.38034003E-15 +-3.16754922E-05-4.48487683E-20-2.47843856E-04 0.00000000E+00-3.16754922E-05 +-4.48487683E-20-2.47843856E-04 0.00000000E+00 1.42003874E-03 1.31710549E-08 + 7.88394604E-08-2.74806254E-13 0.00000000E+00 1.32753821E-08 0.00000000E+00 +-9.58296347E-14 7.48181387E-05 1.74434762E-19 3.00755851E-04 8.58263839E-19 + 5.40940354E-04 0.00000000E+00 2.16383601E-03 0.00000000E+00 7.48181387E-05 + 1.74434762E-19 3.00755851E-04 8.58263839E-19 5.40940354E-04 0.00000000E+00 + 2.16383601E-03 0.00000000E+00-7.81592117E-05-5.62348143E-10 3.92602581E-08 +-9.91586589E-14 0.00000000E+00-5.88113106E-10 0.00000000E+00-4.44837599E-14 + 7.48185997E-05 2.80812926E-19-4.41804474E-05-1.45455575E-19 5.40936972E-04 + 0.00000000E+00-2.93151658E-04 0.00000000E+00 7.48185997E-05 2.80812926E-19 +-4.41804474E-05-1.45455575E-19 5.40936972E-04 0.00000000E+00-2.93151658E-04 + 0.00000000E+00 0.00000000E+00-6.07746368E-10 0.00000000E+00-7.38034003E-15 + 5.08524956E-05-6.77085146E-10-3.95319535E-08-2.38410603E-13-2.47843856E-04 + 0.00000000E+00-3.16754922E-05 4.48487683E-20-2.47843856E-04 0.00000000E+00 +-3.16754922E-05 4.48487683E-20 0.00000000E+00 1.32753821E-08 0.00000000E+00 +-9.58296347E-14-1.42003874E-03 1.31710549E-08-7.88394604E-08-2.74806254E-13 + 5.40940354E-04 0.00000000E+00 2.16383601E-03 0.00000000E+00 7.48181387E-05 +-1.74434762E-19 3.00755851E-04-8.58263839E-19 5.40940354E-04 0.00000000E+00 + 2.16383601E-03 0.00000000E+00 7.48181387E-05-1.74434762E-19 3.00755851E-04 +-8.58263839E-19 0.00000000E+00-5.88113106E-10 0.00000000E+00-4.44837599E-14 + 7.81592117E-05-5.62348143E-10-3.92602581E-08-9.91586589E-14 5.40936972E-04 + 0.00000000E+00-2.93151658E-04 0.00000000E+00 7.48185997E-05-2.80812926E-19 +-4.41804474E-05 1.45455575E-19 5.40936972E-04 0.00000000E+00-2.93151658E-04 + 0.00000000E+00 7.48185997E-05-2.80812926E-19-4.41804474E-05 1.45455575E-19 + 2.60096239E-06 9.04409808E-21 1.55653273E-08 5.32998166E-23-2.96310163E-04 + 0.00000000E+00-1.76350734E-06 0.00000000E+00-3.95319535E-08 2.38410603E-13 + 0.00000000E+00 7.38034003E-15-3.95319535E-08 2.38410603E-13 0.00000000E+00 + 7.38034003E-15 1.17447073E-07 1.80710822E-21-4.06527608E-08-1.24505897E-22 +-4.80268846E-05 0.00000000E+00 4.33066000E-06 0.00000000E+00 6.23168798E-06 + 6.44224616E-11-7.88394604E-08 2.74806254E-13 0.00000000E+00 6.30222011E-11 + 0.00000000E+00 9.58296347E-14 6.23168798E-06 6.44224616E-11-7.88394604E-08 + 2.74806254E-13 0.00000000E+00 6.30222011E-11 0.00000000E+00 9.58296347E-14 +-2.48347159E-06-7.06102302E-21 1.49114769E-08 4.24305898E-23 2.48017929E-04 + 0.00000000E+00-1.49505803E-06 0.00000000E+00-7.17751334E-06-6.07640482E-11 +-3.92602581E-08 9.91586589E-14 0.00000000E+00-6.21268488E-11 0.00000000E+00 + 4.44837599E-14-7.17751334E-06-6.07640482E-11-3.92602581E-08 9.91586589E-14 + 0.00000000E+00-6.21268488E-11 0.00000000E+00 4.44837599E-14-4.15388238E-04 +-1.42338342E-18-2.59326559E-06-8.75083466E-21 4.70686692E-02 0.00000000E+00 + 2.92236183E-04 0.00000000E+00 6.75962579E-05 5.76205544E-10 0.00000000E+00 + 6.04469862E-10 6.75962579E-05 5.76205544E-10 0.00000000E+00 6.04469862E-10 +-2.35133601E-03-7.06606508E-18 1.17447073E-07 1.80710822E-21 2.49829652E-01 + 0.00000000E+00-4.80268846E-05 0.00000000E+00-1.21191772E-03-1.23372684E-08 +-1.42003874E-03-1.31710549E-08 0.00000000E+00-1.21279096E-08 0.00000000E+00 +-1.32753821E-08-1.21191772E-03-1.23372684E-08-1.42003874E-03-1.31710549E-08 + 0.00000000E+00-1.21279096E-08 0.00000000E+00-1.32753821E-08-3.97940900E-04 +-1.13270771E-18 2.49257327E-06 7.10148688E-21 3.99024901E-02 0.00000000E+00 +-2.50926479E-04 0.00000000E+00-1.36973968E-03-1.17315123E-08 6.15305081E-05 + 6.04620057E-10 0.00000000E+00-1.19752841E-08 0.00000000E+00 6.06772804E-10 +-1.36973968E-03-1.17315123E-08 6.15305081E-05 6.04620057E-10 0.00000000E+00 +-1.19752841E-08 0.00000000E+00 6.06772804E-10-2.96310163E-04 0.00000000E+00 +-1.76350734E-06 0.00000000E+00 2.60096239E-06-9.04409808E-21 1.55653273E-08 +-5.32998166E-23 0.00000000E+00 7.38034003E-15 3.95319535E-08 2.38410603E-13 + 0.00000000E+00 7.38034003E-15 3.95319535E-08 2.38410603E-13-4.80268846E-05 + 0.00000000E+00 4.33066000E-06 0.00000000E+00 1.17447073E-07-1.80710822E-21 +-4.06527608E-08 1.24505897E-22 0.00000000E+00 6.30222011E-11 0.00000000E+00 + 9.58296347E-14-6.23168798E-06 6.44224616E-11 7.88394604E-08 2.74806254E-13 + 0.00000000E+00 6.30222011E-11 0.00000000E+00 9.58296347E-14-6.23168798E-06 + 6.44224616E-11 7.88394604E-08 2.74806254E-13 2.48017929E-04 0.00000000E+00 +-1.49505803E-06 0.00000000E+00-2.48347159E-06 7.06102302E-21 1.49114769E-08 +-4.24305898E-23 0.00000000E+00-6.21268488E-11 0.00000000E+00 4.44837599E-14 + 7.17751334E-06-6.07640482E-11 3.92602581E-08 9.91586589E-14 0.00000000E+00 +-6.21268488E-11 0.00000000E+00 4.44837599E-14 7.17751334E-06-6.07640482E-11 + 3.92602581E-08 9.91586589E-14 0.00000000E+00 1.19752841E-08 0.00000000E+00 + 6.21268488E-11-1.36973968E-03 1.17315123E-08-7.17751334E-06 6.07640482E-11 + 5.40936972E-04 0.00000000E+00 7.48185997E-05-2.80812926E-19 5.40936972E-04 + 0.00000000E+00 7.48185997E-05-2.80812926E-19 0.00000000E+00 1.19143481E-08 + 0.00000000E+00-6.19489137E-11-1.42416081E-03 1.15929694E-08 7.33455437E-06 +-6.03674136E-11 4.69035571E-03 0.00000000E+00 6.31669660E-04 0.00000000E+00 + 7.05702772E-04-2.60561055E-18 1.01903190E-04-3.01009373E-19 4.69035571E-03 + 0.00000000E+00 6.31669660E-04 0.00000000E+00 7.05702772E-04-2.60561055E-18 + 1.01903190E-04-3.01009373E-19 1.36973968E-03 1.17315123E-08 7.17751334E-06 + 6.07640482E-11 0.00000000E+00 1.19752841E-08 0.00000000E+00 6.21268488E-11 + 7.48185997E-05 2.80812926E-19 5.40936972E-04 0.00000000E+00 7.48185997E-05 + 2.80812926E-19 5.40936972E-04 0.00000000E+00 1.42416081E-03 1.15929694E-08 +-7.33455437E-06-6.03674136E-11 0.00000000E+00 1.19143481E-08 0.00000000E+00 +-6.19489137E-11 7.05702772E-04 2.60561055E-18 1.01903190E-04 3.01009373E-19 + 4.69035571E-03 0.00000000E+00 6.31669660E-04 0.00000000E+00 7.05702772E-04 + 2.60561055E-18 1.01903190E-04 3.01009373E-19 4.69035571E-03 0.00000000E+00 + 6.31669660E-04 0.00000000E+00 0.00000000E+00 1.19752841E-08 0.00000000E+00 + 6.21268488E-11-1.36973968E-03 1.17315123E-08-7.17751334E-06 6.07640482E-11 + 5.40936972E-04 0.00000000E+00 7.48185997E-05-2.80812926E-19 3.54135028E-01 + 0.00000000E+00 3.05051474E-02-5.49754151E-17 0.00000000E+00 1.19143481E-08 + 0.00000000E+00-6.19489137E-11-1.42416081E-03 1.15929694E-08 7.33455437E-06 +-6.03674136E-11 4.69035571E-03 0.00000000E+00 6.31669660E-04 0.00000000E+00 + 7.05702772E-04-2.60561055E-18 1.01903190E-04-3.01009373E-19 2.62673415E+00 + 0.00000000E+00 3.03662001E-01 0.00000000E+00 2.44133215E-01-5.88104593E-16 + 3.05284070E-02-8.77936662E-17 1.58073074E-03 1.12553575E-08 8.27292217E-06 + 5.83448714E-11 0.00000000E+00 1.18055170E-08 0.00000000E+00 6.12924984E-11 + 1.01903238E-04 1.60600024E-19 6.31666092E-04 0.00000000E+00 3.05283107E-02 + 7.86553336E-17 3.03917772E-01 0.00000000E+00 1.63475148E-03 1.11597344E-08 +-8.42880689E-06-5.80689374E-11 0.00000000E+00 1.17853813E-08 0.00000000E+00 +-6.12347958E-11 9.38944655E-04 1.55085154E-18 1.33128469E-04 3.07918278E-19 + 5.41723804E-03 0.00000000E+00 7.22663767E-04 0.00000000E+00 2.44332697E-01 + 7.09322568E-16 3.05551204E-02 1.02729575E-16 2.27696373E+00 0.00000000E+00 + 2.66047137E-01 0.00000000E+00 3.99024901E-02 0.00000000E+00 2.48017929E-04 + 0.00000000E+00-3.97940900E-04 1.13270771E-18-2.48347159E-06 7.06102302E-21 + 0.00000000E+00 5.88113106E-10-7.81592117E-05 5.62348143E-10 0.00000000E+00 + 5.88113106E-10-7.81592117E-05 5.62348143E-10 2.14523457E-01 0.00000000E+00 +-3.51509107E-05 0.00000000E+00-2.24197947E-03 6.52629251E-18 1.37473932E-07 + 4.44225708E-22 0.00000000E+00-1.19143481E-08 0.00000000E+00-1.30312694E-08 + 1.42416081E-03-1.15929694E-08 1.65282657E-03-1.25530732E-08 0.00000000E+00 +-1.19143481E-08 0.00000000E+00-1.30312694E-08 1.42416081E-03-1.15929694E-08 + 1.65282657E-03-1.25530732E-08 3.46641500E-02 0.00000000E+00-2.17811692E-04 + 0.00000000E+00-3.77532956E-04 1.22100633E-18 2.36567456E-06-7.54053726E-21 + 0.00000000E+00-1.18055170E-08 0.00000000E+00 5.92978458E-10 1.58073074E-03 +-1.12553575E-08-7.21321246E-05 5.75239178E-10 0.00000000E+00-1.18055170E-08 + 0.00000000E+00 5.92978458E-10 1.58073074E-03-1.12553575E-08-7.21321246E-05 + 5.75239178E-10-6.15305081E-05-6.04620057E-10 3.92602581E-08-9.91586589E-14 + 0.00000000E+00-6.06772804E-10 0.00000000E+00-4.44837599E-14-4.41804474E-05 +-1.45455575E-19-2.93151658E-04 0.00000000E+00-1.52583886E-02-3.56922703E-17 +-1.64449257E-01 0.00000000E+00 1.65282657E-03 1.25530732E-08 7.81608896E-08 +-1.69681079E-13 0.00000000E+00 1.30312694E-08 0.00000000E+00-5.04169718E-14 + 1.01903190E-04 3.01009373E-19 4.09091801E-04 9.67035929E-19 6.31669660E-04 + 0.00000000E+00 2.52676630E-03 0.00000000E+00 3.05284070E-02 8.77936662E-17 + 1.22114703E-01 3.29349503E-16 3.03662001E-01 0.00000000E+00 1.21966020E+00 + 0.00000000E+00-8.86384800E-05-5.46020983E-10 3.89711804E-08-6.89835202E-14 + 0.00000000E+00-5.86833604E-10 0.00000000E+00-1.44256412E-14 1.01903238E-04 + 1.60600024E-19-5.87579268E-05-1.17129576E-19 6.31666092E-04 0.00000000E+00 +-3.38582465E-04 0.00000000E+00 3.05283107E-02 7.86553336E-17-1.52708578E-02 +-4.53462273E-17 3.03917772E-01 0.00000000E+00-1.42491227E-01 0.00000000E+00 + 0.00000000E+00-6.06772804E-10 0.00000000E+00-4.44837599E-14 6.15305081E-05 +-6.04620057E-10-3.92602581E-08-9.91586589E-14-2.93151658E-04 0.00000000E+00 +-4.41804474E-05 1.45455575E-19-1.64449257E-01 0.00000000E+00-1.52583886E-02 + 3.56922703E-17 0.00000000E+00 1.30312694E-08 0.00000000E+00-5.04169718E-14 +-1.65282657E-03 1.25530732E-08-7.81608896E-08-1.69681079E-13 6.31669660E-04 + 0.00000000E+00 2.52676630E-03 0.00000000E+00 1.01903190E-04-3.01009373E-19 + 4.09091801E-04-9.67035929E-19 3.03662001E-01 0.00000000E+00 1.21966020E+00 + 0.00000000E+00 3.05284070E-02-8.77936662E-17 1.22114703E-01-3.29349503E-16 + 0.00000000E+00-5.86833604E-10 0.00000000E+00-1.44256412E-14 8.86384800E-05 +-5.46020983E-10-3.89711804E-08-6.89835202E-14 6.31666092E-04 0.00000000E+00 +-3.38582465E-04 0.00000000E+00 1.01903238E-04-1.60600024E-19-5.87579268E-05 + 1.17129576E-19 3.03917772E-01 0.00000000E+00-1.42491227E-01 0.00000000E+00 + 3.05283107E-02-7.86553336E-17-1.52708578E-02 4.53462273E-17-6.15305081E-05 +-6.04620057E-10 3.92602581E-08-9.91586589E-14 0.00000000E+00-6.06772804E-10 + 0.00000000E+00-4.44837599E-14-4.41804474E-05-1.45455575E-19-2.93151658E-04 + 0.00000000E+00-4.41804474E-05-1.45455575E-19-2.93151658E-04 0.00000000E+00 + 1.65282657E-03 1.25530732E-08 7.81608896E-08-1.69681079E-13 0.00000000E+00 + 1.30312694E-08 0.00000000E+00-5.04169718E-14 1.01903190E-04 3.01009373E-19 + 4.09091801E-04 9.67035929E-19 6.31669660E-04 0.00000000E+00 2.52676630E-03 + 0.00000000E+00 1.01903190E-04 3.01009373E-19 4.09091801E-04 9.67035929E-19 + 6.31669660E-04 0.00000000E+00 2.52676630E-03 0.00000000E+00-8.86384800E-05 +-5.46020983E-10 3.89711804E-08-6.89835202E-14 0.00000000E+00-5.86833604E-10 + 0.00000000E+00-1.44256412E-14 1.01903238E-04 1.60600024E-19-5.87579268E-05 +-1.17129576E-19 6.31666092E-04 0.00000000E+00-3.38582465E-04 0.00000000E+00 + 1.01903238E-04 1.60600024E-19-5.87579268E-05-1.17129576E-19 6.31666092E-04 + 0.00000000E+00-3.38582465E-04 0.00000000E+00 0.00000000E+00-6.06772804E-10 + 0.00000000E+00-4.44837599E-14 6.15305081E-05-6.04620057E-10-3.92602581E-08 +-9.91586589E-14-2.93151658E-04 0.00000000E+00-4.41804474E-05 1.45455575E-19 +-2.93151658E-04 0.00000000E+00-4.41804474E-05 1.45455575E-19 0.00000000E+00 + 1.30312694E-08 0.00000000E+00-5.04169718E-14-1.65282657E-03 1.25530732E-08 +-7.81608896E-08-1.69681079E-13 6.31669660E-04 0.00000000E+00 2.52676630E-03 + 0.00000000E+00 1.01903190E-04-3.01009373E-19 4.09091801E-04-9.67035929E-19 + 6.31669660E-04 0.00000000E+00 2.52676630E-03 0.00000000E+00 1.01903190E-04 +-3.01009373E-19 4.09091801E-04-9.67035929E-19 0.00000000E+00-5.86833604E-10 + 0.00000000E+00-1.44256412E-14 8.86384800E-05-5.46020983E-10-3.89711804E-08 +-6.89835202E-14 6.31666092E-04 0.00000000E+00-3.38582465E-04 0.00000000E+00 + 1.01903238E-04-1.60600024E-19-5.87579268E-05 1.17129576E-19 6.31666092E-04 + 0.00000000E+00-3.38582465E-04 0.00000000E+00 1.01903238E-04-1.60600024E-19 +-5.87579268E-05 1.17129576E-19 2.49257327E-06 7.10148688E-21 1.49114769E-08 + 4.24305898E-23-2.50926479E-04 0.00000000E+00-1.49505803E-06 0.00000000E+00 +-3.92602581E-08 9.91586589E-14 0.00000000E+00 4.44837599E-14-3.92602581E-08 + 9.91586589E-14 0.00000000E+00 4.44837599E-14 1.37473932E-07-4.44225708E-22 +-3.87612569E-08-1.14812891E-22-3.51509107E-05 0.00000000E+00 3.71631743E-06 + 0.00000000E+00 7.33455437E-06 6.03674136E-11-7.81608896E-08 1.69681079E-13 + 0.00000000E+00 6.19489137E-11 0.00000000E+00 5.04169718E-14 7.33455437E-06 + 6.03674136E-11-7.81608896E-08 1.69681079E-13 0.00000000E+00 6.19489137E-11 + 0.00000000E+00 5.04169718E-14-2.35516542E-06-7.72232491E-21 1.41466737E-08 + 4.57026718E-23 2.15633673E-04 0.00000000E+00-1.29880983E-06 0.00000000E+00 +-8.27292217E-06-5.83448714E-11-3.89711804E-08 6.89835202E-14 0.00000000E+00 +-6.12924984E-11 0.00000000E+00 1.44256412E-14-8.27292217E-06-5.83448714E-11 +-3.89711804E-08 6.89835202E-14 0.00000000E+00-6.12924984E-11 0.00000000E+00 + 1.44256412E-14-3.97940900E-04-1.13270771E-18-2.48347159E-06-7.06102302E-21 + 3.99024901E-02 0.00000000E+00 2.48017929E-04 0.00000000E+00 7.81592117E-05 + 5.62348143E-10 0.00000000E+00 5.88113106E-10 7.81592117E-05 5.62348143E-10 + 0.00000000E+00 5.88113106E-10-2.24197947E-03-6.52629251E-18 1.37473932E-07 +-4.44225708E-22 2.14523457E-01 0.00000000E+00-3.51509107E-05 0.00000000E+00 +-1.42416081E-03-1.15929694E-08-1.65282657E-03-1.25530732E-08 0.00000000E+00 +-1.19143481E-08 0.00000000E+00-1.30312694E-08-1.42416081E-03-1.15929694E-08 +-1.65282657E-03-1.25530732E-08 0.00000000E+00-1.19143481E-08 0.00000000E+00 +-1.30312694E-08-3.77532956E-04-1.22100633E-18 2.36567456E-06 7.54053726E-21 + 3.46641500E-02 0.00000000E+00-2.17811692E-04 0.00000000E+00-1.58073074E-03 +-1.12553575E-08 7.21321246E-05 5.75239178E-10 0.00000000E+00-1.18055170E-08 + 0.00000000E+00 5.92978458E-10-1.58073074E-03-1.12553575E-08 7.21321246E-05 + 5.75239178E-10 0.00000000E+00-1.18055170E-08 0.00000000E+00 5.92978458E-10 +-2.50926479E-04 0.00000000E+00-1.49505803E-06 0.00000000E+00 2.49257327E-06 +-7.10148688E-21 1.49114769E-08-4.24305898E-23 0.00000000E+00 4.44837599E-14 + 3.92602581E-08 9.91586589E-14 0.00000000E+00 4.44837599E-14 3.92602581E-08 + 9.91586589E-14-3.51509107E-05 0.00000000E+00 3.71631743E-06 0.00000000E+00 + 1.37473932E-07 4.44225708E-22-3.87612569E-08 1.14812891E-22 0.00000000E+00 + 6.19489137E-11 0.00000000E+00 5.04169718E-14-7.33455437E-06 6.03674136E-11 + 7.81608896E-08 1.69681079E-13 0.00000000E+00 6.19489137E-11 0.00000000E+00 + 5.04169718E-14-7.33455437E-06 6.03674136E-11 7.81608896E-08 1.69681079E-13 + 2.15633673E-04 0.00000000E+00-1.29880983E-06 0.00000000E+00-2.35516542E-06 + 7.72232491E-21 1.41466737E-08-4.57026718E-23 0.00000000E+00-6.12924984E-11 + 0.00000000E+00 1.44256412E-14 8.27292217E-06-5.83448714E-11 3.89711804E-08 + 6.89835202E-14 0.00000000E+00-6.12924984E-11 0.00000000E+00 1.44256412E-14 + 8.27292217E-06-5.83448714E-11 3.89711804E-08 6.89835202E-14 0.00000000E+00 + 1.18055170E-08 0.00000000E+00 6.12924984E-11-1.58073074E-03 1.12553575E-08 +-8.27292217E-06 5.83448714E-11 6.31666092E-04 0.00000000E+00 1.01903238E-04 +-1.60600024E-19 6.31666092E-04 0.00000000E+00 1.01903238E-04-1.60600024E-19 + 0.00000000E+00 1.17853813E-08 0.00000000E+00-6.12347958E-11-1.63475148E-03 + 1.11597344E-08 8.42880689E-06-5.80689374E-11 5.41723804E-03 0.00000000E+00 + 7.22663767E-04 0.00000000E+00 9.38944655E-04-1.55085154E-18 1.33128469E-04 +-3.07918278E-19 5.41723804E-03 0.00000000E+00 7.22663767E-04 0.00000000E+00 + 9.38944655E-04-1.55085154E-18 1.33128469E-04-3.07918278E-19 1.58073074E-03 + 1.12553575E-08 8.27292217E-06 5.83448714E-11 0.00000000E+00 1.18055170E-08 + 0.00000000E+00 6.12924984E-11 1.01903238E-04 1.60600024E-19 6.31666092E-04 + 0.00000000E+00 1.01903238E-04 1.60600024E-19 6.31666092E-04 0.00000000E+00 + 1.63475148E-03 1.11597344E-08-8.42880689E-06-5.80689374E-11 0.00000000E+00 + 1.17853813E-08 0.00000000E+00-6.12347958E-11 9.38944655E-04 1.55085154E-18 + 1.33128469E-04 3.07918278E-19 5.41723804E-03 0.00000000E+00 7.22663767E-04 + 0.00000000E+00 9.38944655E-04 1.55085154E-18 1.33128469E-04 3.07918278E-19 + 5.41723804E-03 0.00000000E+00 7.22663767E-04 0.00000000E+00 0.00000000E+00 + 1.18055170E-08 0.00000000E+00 6.12924984E-11-1.58073074E-03 1.12553575E-08 +-8.27292217E-06 5.83448714E-11 6.31666092E-04 0.00000000E+00 1.01903238E-04 +-1.60600024E-19 3.03917772E-01 0.00000000E+00 3.05283107E-02-7.86553336E-17 + 0.00000000E+00 1.17853813E-08 0.00000000E+00-6.12347958E-11-1.63475148E-03 + 1.11597344E-08 8.42880689E-06-5.80689374E-11 5.41723804E-03 0.00000000E+00 + 7.22663767E-04 0.00000000E+00 9.38944655E-04-1.55085154E-18 1.33128469E-04 +-3.07918278E-19 2.27696373E+00 0.00000000E+00 2.66047137E-01 0.00000000E+00 + 2.44332697E-01-7.09322568E-16 3.05551204E-02-1.02729575E-16 1.79023118E-03 + 1.09435191E-08 9.36056521E-06 5.67706657E-11 0.00000000E+00 1.17574526E-08 + 0.00000000E+00 6.10672683E-11 1.33128862E-04 4.51573668E-19 7.22659693E-04 + 0.00000000E+00 3.05550389E-02 1.12224164E-16 2.66196436E-01 0.00000000E+00 + 1.84377791E-03 1.08853685E-08-9.51508093E-06-5.66030577E-11 0.00000000E+00 + 1.17579707E-08 0.00000000E+00-6.10688336E-11 1.20526852E-03 4.16981307E-18 + 1.68482688E-04 5.18401609E-19 6.14639173E-03 0.00000000E+00 8.13961418E-04 + 0.00000000E+00 2.44560653E-01 9.26576765E-16 3.05853713E-02 1.13360392E-16 + 2.00975531E+00 0.00000000E+00 2.36739262E-01 0.00000000E+00 3.46641500E-02 + 0.00000000E+00 2.15633673E-04 0.00000000E+00-3.77532956E-04 1.22100633E-18 +-2.35516542E-06 7.72232491E-21 0.00000000E+00 5.86833604E-10-8.86384800E-05 + 5.46020983E-10 0.00000000E+00 5.86833604E-10-8.86384800E-05 5.46020983E-10 + 1.88152888E-01 0.00000000E+00-2.68106938E-05 0.00000000E+00-2.11570344E-03 + 8.60624542E-18 1.56907343E-07 4.16414062E-21 0.00000000E+00-1.17853813E-08 + 0.00000000E+00-1.29416513E-08 1.63475148E-03-1.11597344E-08 1.88390148E-03 +-1.21440386E-08 0.00000000E+00-1.17853813E-08 0.00000000E+00-1.29416513E-08 + 1.63475148E-03-1.11597344E-08 1.88390148E-03-1.21440386E-08 3.06718801E-02 + 0.00000000E+00-1.92608101E-04 0.00000000E+00-3.54223893E-04 1.80628666E-18 + 2.22064604E-06-1.11485358E-20 0.00000000E+00-1.17574526E-08 0.00000000E+00 + 5.87916297E-10 1.79023118E-03-1.09435191E-08-8.26660030E-05 5.54759589E-10 + 0.00000000E+00-1.17574526E-08 0.00000000E+00 5.87916297E-10 1.79023118E-03 +-1.09435191E-08-8.26660030E-05 5.54759589E-10-7.21321246E-05-5.75239178E-10 + 3.89711804E-08-6.89835202E-14 0.00000000E+00-5.92978458E-10 0.00000000E+00 +-1.44256412E-14-5.87579268E-05-1.17129576E-19-3.38582465E-04 0.00000000E+00 +-1.52708578E-02-4.53462273E-17-1.42491227E-01 0.00000000E+00 1.88390148E-03 + 1.21440386E-08 7.76848215E-08-1.05751896E-13 0.00000000E+00 1.29416513E-08 + 0.00000000E+00-1.40298709E-14 1.33128469E-04 3.07918278E-19 5.33989307E-04 + 1.49127065E-18 7.22663767E-04 0.00000000E+00 2.89075565E-03 0.00000000E+00 + 3.05551204E-02 1.02729575E-16 1.22221577E-01 4.21792881E-16 2.66047137E-01 + 0.00000000E+00 1.06749187E+00 0.00000000E+00-9.90275086E-05-5.36995041E-10 + 3.86289303E-08-4.19020202E-14 0.00000000E+00-5.88075960E-10 0.00000000E+00 + 3.91323208E-16 1.33128862E-04 4.51573668E-19-7.54028875E-05-2.42493819E-19 + 7.22659693E-04 0.00000000E+00-3.84155278E-04 0.00000000E+00 3.05550389E-02 + 1.12224164E-16-1.52851025E-02-5.63961389E-17 2.66196436E-01 0.00000000E+00 +-1.25733924E-01 0.00000000E+00 0.00000000E+00-5.92978458E-10 0.00000000E+00 +-1.44256412E-14 7.21321246E-05-5.75239178E-10-3.89711804E-08-6.89835202E-14 +-3.38582465E-04 0.00000000E+00-5.87579268E-05 1.17129576E-19-1.42491227E-01 + 0.00000000E+00-1.52708578E-02 4.53462273E-17 0.00000000E+00 1.29416513E-08 + 0.00000000E+00-1.40298709E-14-1.88390148E-03 1.21440386E-08-7.76848215E-08 +-1.05751896E-13 7.22663767E-04 0.00000000E+00 2.89075565E-03 0.00000000E+00 + 1.33128469E-04-3.07918278E-19 5.33989307E-04-1.49127065E-18 2.66047137E-01 + 0.00000000E+00 1.06749187E+00 0.00000000E+00 3.05551204E-02-1.02729575E-16 + 1.22221577E-01-4.21792881E-16 0.00000000E+00-5.88075960E-10 0.00000000E+00 + 3.91323208E-16 9.90275086E-05-5.36995041E-10-3.86289303E-08-4.19020202E-14 + 7.22659693E-04 0.00000000E+00-3.84155278E-04 0.00000000E+00 1.33128862E-04 +-4.51573668E-19-7.54028875E-05 2.42493819E-19 2.66196436E-01 0.00000000E+00 +-1.25733924E-01 0.00000000E+00 3.05550389E-02-1.12224164E-16-1.52851025E-02 + 5.63961389E-17-7.21321246E-05-5.75239178E-10 3.89711804E-08-6.89835202E-14 + 0.00000000E+00-5.92978458E-10 0.00000000E+00-1.44256412E-14-5.87579268E-05 +-1.17129576E-19-3.38582465E-04 0.00000000E+00-5.87579268E-05-1.17129576E-19 +-3.38582465E-04 0.00000000E+00 1.88390148E-03 1.21440386E-08 7.76848215E-08 +-1.05751896E-13 0.00000000E+00 1.29416513E-08 0.00000000E+00-1.40298709E-14 + 1.33128469E-04 3.07918278E-19 5.33989307E-04 1.49127065E-18 7.22663767E-04 + 0.00000000E+00 2.89075565E-03 0.00000000E+00 1.33128469E-04 3.07918278E-19 + 5.33989307E-04 1.49127065E-18 7.22663767E-04 0.00000000E+00 2.89075565E-03 + 0.00000000E+00-9.90275086E-05-5.36995041E-10 3.86289303E-08-4.19020202E-14 + 0.00000000E+00-5.88075960E-10 0.00000000E+00 3.91323208E-16 1.33128862E-04 + 4.51573668E-19-7.54028875E-05-2.42493819E-19 7.22659693E-04 0.00000000E+00 +-3.84155278E-04 0.00000000E+00 1.33128862E-04 4.51573668E-19-7.54028875E-05 +-2.42493819E-19 7.22659693E-04 0.00000000E+00-3.84155278E-04 0.00000000E+00 + 0.00000000E+00-5.92978458E-10 0.00000000E+00-1.44256412E-14 7.21321246E-05 +-5.75239178E-10-3.89711804E-08-6.89835202E-14-3.38582465E-04 0.00000000E+00 +-5.87579268E-05 1.17129576E-19-3.38582465E-04 0.00000000E+00-5.87579268E-05 + 1.17129576E-19 0.00000000E+00 1.29416513E-08 0.00000000E+00-1.40298709E-14 +-1.88390148E-03 1.21440386E-08-7.76848215E-08-1.05751896E-13 7.22663767E-04 + 0.00000000E+00 2.89075565E-03 0.00000000E+00 1.33128469E-04-3.07918278E-19 + 5.33989307E-04-1.49127065E-18 7.22663767E-04 0.00000000E+00 2.89075565E-03 + 0.00000000E+00 1.33128469E-04-3.07918278E-19 5.33989307E-04-1.49127065E-18 + 0.00000000E+00-5.88075960E-10 0.00000000E+00 3.91323208E-16 9.90275086E-05 +-5.36995041E-10-3.86289303E-08-4.19020202E-14 7.22659693E-04 0.00000000E+00 +-3.84155278E-04 0.00000000E+00 1.33128862E-04-4.51573668E-19-7.54028875E-05 + 2.42493819E-19 7.22659693E-04 0.00000000E+00-3.84155278E-04 0.00000000E+00 + 1.33128862E-04-4.51573668E-19-7.54028875E-05 2.42493819E-19 2.36567456E-06 + 7.54053726E-21 1.41466737E-08 4.57026718E-23-2.17811692E-04 0.00000000E+00 +-1.29880983E-06 0.00000000E+00-3.89711804E-08 6.89835202E-14 0.00000000E+00 + 1.44256412E-14-3.89711804E-08 6.89835202E-14 0.00000000E+00 1.44256412E-14 + 1.56907343E-07-4.16414062E-21-3.65770498E-08-1.49831664E-22-2.68106938E-05 + 0.00000000E+00 3.25815533E-06 0.00000000E+00 8.42880689E-06 5.80689374E-11 +-7.76848215E-08 1.05751896E-13 0.00000000E+00 6.12347958E-11 0.00000000E+00 + 1.40298709E-14 8.42880689E-06 5.80689374E-11-7.76848215E-08 1.05751896E-13 + 0.00000000E+00 6.12347958E-11 0.00000000E+00 1.40298709E-14-2.20871653E-06 +-1.14413387E-20 1.32731981E-08 6.77160463E-23 1.90917965E-04 0.00000000E+00 +-1.14923601E-06 0.00000000E+00-9.36056521E-06-5.67706657E-11-3.86289303E-08 + 4.19020202E-14 0.00000000E+00-6.10672683E-11 0.00000000E+00-3.91323208E-16 +-9.36056521E-06-5.67706657E-11-3.86289303E-08 4.19020202E-14 0.00000000E+00 +-6.10672683E-11 0.00000000E+00-3.91323208E-16-3.77532956E-04-1.22100633E-18 +-2.35516542E-06-7.72232491E-21 3.46641500E-02 0.00000000E+00 2.15633673E-04 + 0.00000000E+00 8.86384800E-05 5.46020983E-10 0.00000000E+00 5.86833604E-10 + 8.86384800E-05 5.46020983E-10 0.00000000E+00 5.86833604E-10-2.11570344E-03 +-8.60624542E-18 1.56907343E-07-4.16414062E-21 1.88152888E-01 0.00000000E+00 +-2.68106938E-05 0.00000000E+00-1.63475148E-03-1.11597344E-08-1.88390148E-03 +-1.21440386E-08 0.00000000E+00-1.17853813E-08 0.00000000E+00-1.29416513E-08 +-1.63475148E-03-1.11597344E-08-1.88390148E-03-1.21440386E-08 0.00000000E+00 +-1.17853813E-08 0.00000000E+00-1.29416513E-08-3.54223893E-04-1.80628666E-18 + 2.22064604E-06 1.11485358E-20 3.06718801E-02 0.00000000E+00-1.92608101E-04 + 0.00000000E+00-1.79023118E-03-1.09435191E-08 8.26660030E-05 5.54759589E-10 + 0.00000000E+00-1.17574526E-08 0.00000000E+00 5.87916297E-10-1.79023118E-03 +-1.09435191E-08 8.26660030E-05 5.54759589E-10 0.00000000E+00-1.17574526E-08 + 0.00000000E+00 5.87916297E-10-2.17811692E-04 0.00000000E+00-1.29880983E-06 + 0.00000000E+00 2.36567456E-06-7.54053726E-21 1.41466737E-08-4.57026718E-23 + 0.00000000E+00 1.44256412E-14 3.89711804E-08 6.89835202E-14 0.00000000E+00 + 1.44256412E-14 3.89711804E-08 6.89835202E-14-2.68106938E-05 0.00000000E+00 + 3.25815533E-06 0.00000000E+00 1.56907343E-07 4.16414062E-21-3.65770498E-08 + 1.49831664E-22 0.00000000E+00 6.12347958E-11 0.00000000E+00 1.40298709E-14 +-8.42880689E-06 5.80689374E-11 7.76848215E-08 1.05751896E-13 0.00000000E+00 + 6.12347958E-11 0.00000000E+00 1.40298709E-14-8.42880689E-06 5.80689374E-11 + 7.76848215E-08 1.05751896E-13 1.90917965E-04 0.00000000E+00-1.14923601E-06 + 0.00000000E+00-2.20871653E-06 1.14413387E-20 1.32731981E-08-6.77160463E-23 + 0.00000000E+00-6.10672683E-11 0.00000000E+00-3.91323208E-16 9.36056521E-06 +-5.67706657E-11 3.86289303E-08 4.19020202E-14 0.00000000E+00-6.10672683E-11 + 0.00000000E+00-3.91323208E-16 9.36056521E-06-5.67706657E-11 3.86289303E-08 + 4.19020202E-14 0.00000000E+00 1.17574526E-08 0.00000000E+00 6.10672683E-11 +-1.79023118E-03 1.09435191E-08-9.36056521E-06 5.67706657E-11 7.22659693E-04 + 0.00000000E+00 1.33128862E-04-4.51573668E-19 7.22659693E-04 0.00000000E+00 + 1.33128862E-04-4.51573668E-19 0.00000000E+00 1.17579707E-08 0.00000000E+00 +-6.10688336E-11-1.84377791E-03 1.08853685E-08 9.51508093E-06-5.66030577E-11 + 6.14639173E-03 0.00000000E+00 8.13961418E-04 0.00000000E+00 1.20526852E-03 +-4.16981307E-18 1.68482688E-04-5.18401609E-19 6.14639173E-03 0.00000000E+00 + 8.13961418E-04 0.00000000E+00 1.20526852E-03-4.16981307E-18 1.68482688E-04 +-5.18401609E-19 1.79023118E-03 1.09435191E-08 9.36056521E-06 5.67706657E-11 + 0.00000000E+00 1.17574526E-08 0.00000000E+00 6.10672683E-11 1.33128862E-04 + 4.51573668E-19 7.22659693E-04 0.00000000E+00 1.33128862E-04 4.51573668E-19 + 7.22659693E-04 0.00000000E+00 1.84377791E-03 1.08853685E-08-9.51508093E-06 +-5.66030577E-11 0.00000000E+00 1.17579707E-08 0.00000000E+00-6.10688336E-11 + 1.20526852E-03 4.16981307E-18 1.68482688E-04 5.18401609E-19 6.14639173E-03 + 0.00000000E+00 8.13961418E-04 0.00000000E+00 1.20526852E-03 4.16981307E-18 + 1.68482688E-04 5.18401609E-19 6.14639173E-03 0.00000000E+00 8.13961418E-04 + 0.00000000E+00 0.00000000E+00 1.17574526E-08 0.00000000E+00 6.10672683E-11 +-1.79023118E-03 1.09435191E-08-9.36056521E-06 5.67706657E-11 7.22659693E-04 + 0.00000000E+00 1.33128862E-04-4.51573668E-19 2.66196436E-01 0.00000000E+00 + 3.05550389E-02-1.12224164E-16 0.00000000E+00 1.17579707E-08 0.00000000E+00 +-6.10688336E-11-1.84377791E-03 1.08853685E-08 9.51508093E-06-5.66030577E-11 + 6.14639173E-03 0.00000000E+00 8.13961418E-04 0.00000000E+00 1.20526852E-03 +-4.16981307E-18 1.68482688E-04-5.18401609E-19 2.00975531E+00 0.00000000E+00 + 2.36739262E-01 0.00000000E+00 2.44560653E-01-9.26576765E-16 3.05853713E-02 +-1.13360392E-16 1.99762190E-03 1.07542545E-08 1.04370985E-05 5.58165913E-11 + 0.00000000E+00 1.17854488E-08 0.00000000E+00 6.12325881E-11 1.68482475E-04 + 3.95612048E-19 8.13957259E-04 0.00000000E+00 3.05852747E-02 1.05133790E-16 + 2.36831987E-01 0.00000000E+00 2.05062749E-03 1.07205402E-08-1.05900533E-05 +-5.57193983E-11 0.00000000E+00 1.18025489E-08 0.00000000E+00-6.12819975E-11 + 1.50456671E-03 3.67933153E-18 2.07952918E-04 5.85625880E-19 6.87812632E-03 + 0.00000000E+00 9.05600086E-04 0.00000000E+00 2.44816538E-01 7.96021375E-16 + 3.06191128E-02 9.72281895E-17 1.79898496E+00 0.00000000E+00 2.13269988E-01 + 0.00000000E+00 3.06718801E-02 0.00000000E+00 1.90917965E-04 0.00000000E+00 +-3.54223893E-04 1.80628666E-18-2.20871653E-06 1.14413387E-20 0.00000000E+00 + 5.88075960E-10-9.90275086E-05 5.36995041E-10 0.00000000E+00 5.88075960E-10 +-9.90275086E-05 5.36995041E-10 1.67724493E-01 0.00000000E+00-2.11038020E-05 + 0.00000000E+00-1.97241817E-03 1.13243119E-17 1.77004386E-07 2.93429209E-22 + 0.00000000E+00-1.17579707E-08 0.00000000E+00-1.29432682E-08 1.84377791E-03 +-1.08853685E-08 2.11295252E-03-1.18935352E-08 0.00000000E+00-1.17579707E-08 + 0.00000000E+00-1.29432682E-08 1.84377791E-03-1.08853685E-08 2.11295252E-03 +-1.18935352E-08 2.75311914E-02 0.00000000E+00-1.72801310E-04 0.00000000E+00 +-3.27944793E-04 1.79926192E-18 2.05703689E-06-1.14681222E-20 0.00000000E+00 +-1.17854488E-08 0.00000000E+00 5.87161023E-10 1.99762190E-03-1.07542545E-08 +-9.31055297E-05 5.42140330E-10 0.00000000E+00-1.17854488E-08 0.00000000E+00 + 5.87161023E-10 1.99762190E-03-1.07542545E-08-9.31055297E-05 5.42140330E-10 +-8.26660030E-05-5.54759589E-10 3.86289303E-08-4.19020202E-14 0.00000000E+00 +-5.87916297E-10 0.00000000E+00 3.91323208E-16-7.54028875E-05-2.42493819E-19 +-3.84155278E-04 0.00000000E+00-1.52851025E-02-5.63961389E-17-1.25733924E-01 + 0.00000000E+00 2.11295252E-03 1.18935352E-08 7.67985646E-08-6.50162542E-14 + 0.00000000E+00 1.29432682E-08 0.00000000E+00 1.44244215E-14 1.68482688E-04 + 5.18401609E-19 6.75400682E-04 1.87151266E-18 8.13961418E-04 0.00000000E+00 + 3.25595930E-03 0.00000000E+00 3.05853713E-02 1.13360392E-16 1.22342544E-01 + 4.33648282E-16 2.36739262E-01 0.00000000E+00 9.49247872E-01 0.00000000E+00 +-1.09301710E-04-5.31840527E-10 3.82387209E-08-2.42982346E-14 0.00000000E+00 +-5.92387307E-10 0.00000000E+00 1.23523320E-14 1.68482475E-04 3.95612048E-19 +-9.41088483E-05-2.45309482E-19 8.13957259E-04 0.00000000E+00-4.29889336E-04 + 0.00000000E+00 3.05852747E-02 1.05133790E-16-1.53010969E-02-5.05904948E-17 + 2.36831987E-01 0.00000000E+00-1.12525494E-01 0.00000000E+00 0.00000000E+00 +-5.87916297E-10 0.00000000E+00 3.91323208E-16 8.26660030E-05-5.54759589E-10 +-3.86289303E-08-4.19020202E-14-3.84155278E-04 0.00000000E+00-7.54028875E-05 + 2.42493819E-19-1.25733924E-01 0.00000000E+00-1.52851025E-02 5.63961389E-17 + 0.00000000E+00 1.29432682E-08 0.00000000E+00 1.44244215E-14-2.11295252E-03 + 1.18935352E-08-7.67985646E-08-6.50162542E-14 8.13961418E-04 0.00000000E+00 + 3.25595930E-03 0.00000000E+00 1.68482688E-04-5.18401609E-19 6.75400682E-04 +-1.87151266E-18 2.36739262E-01 0.00000000E+00 9.49247872E-01 0.00000000E+00 + 3.05853713E-02-1.13360392E-16 1.22342544E-01-4.33648282E-16 0.00000000E+00 +-5.92387307E-10 0.00000000E+00 1.23523320E-14 1.09301710E-04-5.31840527E-10 +-3.82387209E-08-2.42982346E-14 8.13957259E-04 0.00000000E+00-4.29889336E-04 + 0.00000000E+00 1.68482475E-04-3.95612048E-19-9.41088483E-05 2.45309482E-19 + 2.36831987E-01 0.00000000E+00-1.12525494E-01 0.00000000E+00 3.05852747E-02 +-1.05133790E-16-1.53010969E-02 5.05904948E-17-8.26660030E-05-5.54759589E-10 + 3.86289303E-08-4.19020202E-14 0.00000000E+00-5.87916297E-10 0.00000000E+00 + 3.91323208E-16-7.54028875E-05-2.42493819E-19-3.84155278E-04 0.00000000E+00 +-7.54028875E-05-2.42493819E-19-3.84155278E-04 0.00000000E+00 2.11295252E-03 + 1.18935352E-08 7.67985646E-08-6.50162542E-14 0.00000000E+00 1.29432682E-08 + 0.00000000E+00 1.44244215E-14 1.68482688E-04 5.18401609E-19 6.75400682E-04 + 1.87151266E-18 8.13961418E-04 0.00000000E+00 3.25595930E-03 0.00000000E+00 + 1.68482688E-04 5.18401609E-19 6.75400682E-04 1.87151266E-18 8.13961418E-04 + 0.00000000E+00 3.25595930E-03 0.00000000E+00-1.09301710E-04-5.31840527E-10 + 3.82387209E-08-2.42982346E-14 0.00000000E+00-5.92387307E-10 0.00000000E+00 + 1.23523320E-14 1.68482475E-04 3.95612048E-19-9.41088483E-05-2.45309482E-19 + 8.13957259E-04 0.00000000E+00-4.29889336E-04 0.00000000E+00 1.68482475E-04 + 3.95612048E-19-9.41088483E-05-2.45309482E-19 8.13957259E-04 0.00000000E+00 +-4.29889336E-04 0.00000000E+00 0.00000000E+00-5.87916297E-10 0.00000000E+00 + 3.91323208E-16 8.26660030E-05-5.54759589E-10-3.86289303E-08-4.19020202E-14 +-3.84155278E-04 0.00000000E+00-7.54028875E-05 2.42493819E-19-3.84155278E-04 + 0.00000000E+00-7.54028875E-05 2.42493819E-19 0.00000000E+00 1.29432682E-08 + 0.00000000E+00 1.44244215E-14-2.11295252E-03 1.18935352E-08-7.67985646E-08 +-6.50162542E-14 8.13961418E-04 0.00000000E+00 3.25595930E-03 0.00000000E+00 + 1.68482688E-04-5.18401609E-19 6.75400682E-04-1.87151266E-18 8.13961418E-04 + 0.00000000E+00 3.25595930E-03 0.00000000E+00 1.68482688E-04-5.18401609E-19 + 6.75400682E-04-1.87151266E-18 0.00000000E+00-5.92387307E-10 0.00000000E+00 + 1.23523320E-14 1.09301710E-04-5.31840527E-10-3.82387209E-08-2.42982346E-14 + 8.13957259E-04 0.00000000E+00-4.29889336E-04 0.00000000E+00 1.68482475E-04 +-3.95612048E-19-9.41088483E-05 2.45309482E-19 8.13957259E-04 0.00000000E+00 +-4.29889336E-04 0.00000000E+00 1.68482475E-04-3.95612048E-19-9.41088483E-05 + 2.45309482E-19 2.22064604E-06 1.11485358E-20 1.32731981E-08 6.77160463E-23 +-1.92608101E-04 0.00000000E+00-1.14923601E-06 0.00000000E+00-3.86289303E-08 + 4.19020202E-14 0.00000000E+00-3.91323208E-16-3.86289303E-08 4.19020202E-14 + 0.00000000E+00-3.91323208E-16 1.77004386E-07-2.93429209E-22-3.40990887E-08 +-1.89235579E-22-2.11038020E-05 0.00000000E+00 2.90359115E-06 0.00000000E+00 + 9.51508093E-06 5.66030577E-11-7.67985646E-08 6.50162542E-14 0.00000000E+00 + 6.10688336E-11 0.00000000E+00-1.44244215E-14 9.51508093E-06 5.66030577E-11 +-7.67985646E-08 6.50162542E-14 0.00000000E+00 6.10688336E-11 0.00000000E+00 +-1.44244215E-14-2.04370907E-06-1.10417230E-20 1.22884186E-08 6.75291416E-23 + 1.71453150E-04 0.00000000E+00-1.03156288E-06 0.00000000E+00-1.04370985E-05 +-5.58165913E-11-3.82387209E-08 2.42982346E-14 0.00000000E+00-6.12325881E-11 + 0.00000000E+00-1.23523320E-14-1.04370985E-05-5.58165913E-11-3.82387209E-08 + 2.42982346E-14 0.00000000E+00-6.12325881E-11 0.00000000E+00-1.23523320E-14 +-3.54223893E-04-1.80628666E-18-2.20871653E-06-1.14413387E-20 3.06718801E-02 + 0.00000000E+00 1.90917965E-04 0.00000000E+00 9.90275086E-05 5.36995041E-10 + 0.00000000E+00 5.88075960E-10 9.90275086E-05 5.36995041E-10 0.00000000E+00 + 5.88075960E-10-1.97241817E-03-1.13243119E-17 1.77004386E-07-2.93429209E-22 + 1.67724493E-01 0.00000000E+00-2.11038020E-05 0.00000000E+00-1.84377791E-03 +-1.08853685E-08-2.11295252E-03-1.18935352E-08 0.00000000E+00-1.17579707E-08 + 0.00000000E+00-1.29432682E-08-1.84377791E-03-1.08853685E-08-2.11295252E-03 +-1.18935352E-08 0.00000000E+00-1.17579707E-08 0.00000000E+00-1.29432682E-08 +-3.27944793E-04-1.79926192E-18 2.05703689E-06 1.14681222E-20 2.75311914E-02 + 0.00000000E+00-1.72801310E-04 0.00000000E+00-1.99762190E-03-1.07542545E-08 + 9.31055297E-05 5.42140330E-10 0.00000000E+00-1.17854488E-08 0.00000000E+00 + 5.87161023E-10-1.99762190E-03-1.07542545E-08 9.31055297E-05 5.42140330E-10 + 0.00000000E+00-1.17854488E-08 0.00000000E+00 5.87161023E-10-1.92608101E-04 + 0.00000000E+00-1.14923601E-06 0.00000000E+00 2.22064604E-06-1.11485358E-20 + 1.32731981E-08-6.77160463E-23 0.00000000E+00-3.91323208E-16 3.86289303E-08 + 4.19020202E-14 0.00000000E+00-3.91323208E-16 3.86289303E-08 4.19020202E-14 +-2.11038020E-05 0.00000000E+00 2.90359115E-06 0.00000000E+00 1.77004386E-07 + 2.93429209E-22-3.40990887E-08 1.89235579E-22 0.00000000E+00 6.10688336E-11 + 0.00000000E+00-1.44244215E-14-9.51508093E-06 5.66030577E-11 7.67985646E-08 + 6.50162542E-14 0.00000000E+00 6.10688336E-11 0.00000000E+00-1.44244215E-14 +-9.51508093E-06 5.66030577E-11 7.67985646E-08 6.50162542E-14 1.71453150E-04 + 0.00000000E+00-1.03156288E-06 0.00000000E+00-2.04370907E-06 1.10417230E-20 + 1.22884186E-08-6.75291416E-23 0.00000000E+00-6.12325881E-11 0.00000000E+00 +-1.23523320E-14 1.04370985E-05-5.58165913E-11 3.82387209E-08 2.42982346E-14 + 0.00000000E+00-6.12325881E-11 0.00000000E+00-1.23523320E-14 1.04370985E-05 +-5.58165913E-11 3.82387209E-08 2.42982346E-14 0.00000000E+00 1.17854488E-08 + 0.00000000E+00 6.12325881E-11-1.99762190E-03 1.07542545E-08-1.04370985E-05 + 5.58165913E-11 8.13957259E-04 0.00000000E+00 1.68482475E-04-3.95612048E-19 + 8.13957259E-04 0.00000000E+00 1.68482475E-04-3.95612048E-19 0.00000000E+00 + 1.18025489E-08 0.00000000E+00-6.12819975E-11-2.05062749E-03 1.07205402E-08 + 1.05900533E-05-5.57193983E-11 6.87812632E-03 0.00000000E+00 9.05600086E-04 + 0.00000000E+00 1.50456671E-03-3.67933153E-18 2.07952918E-04-5.85625880E-19 + 6.87812632E-03 0.00000000E+00 9.05600086E-04 0.00000000E+00 1.50456671E-03 +-3.67933153E-18 2.07952918E-04-5.85625880E-19 1.99762190E-03 1.07542545E-08 + 1.04370985E-05 5.58165913E-11 0.00000000E+00 1.17854488E-08 0.00000000E+00 + 6.12325881E-11 1.68482475E-04 3.95612048E-19 8.13957259E-04 0.00000000E+00 + 1.68482475E-04 3.95612048E-19 8.13957259E-04 0.00000000E+00 2.05062749E-03 + 1.07205402E-08-1.05900533E-05-5.57193983E-11 0.00000000E+00 1.18025489E-08 + 0.00000000E+00-6.12819975E-11 1.50456671E-03 3.67933153E-18 2.07952918E-04 + 5.85625880E-19 6.87812632E-03 0.00000000E+00 9.05600086E-04 0.00000000E+00 + 1.50456671E-03 3.67933153E-18 2.07952918E-04 5.85625880E-19 6.87812632E-03 + 0.00000000E+00 9.05600086E-04 0.00000000E+00 0.00000000E+00 1.17854488E-08 + 0.00000000E+00 6.12325881E-11-1.99762190E-03 1.07542545E-08-1.04370985E-05 + 5.58165913E-11 8.13957259E-04 0.00000000E+00 1.68482475E-04-3.95612048E-19 + 2.36831987E-01 0.00000000E+00 3.05852747E-02-1.05133790E-16 0.00000000E+00 + 1.18025489E-08 0.00000000E+00-6.12819975E-11-2.05062749E-03 1.07205402E-08 + 1.05900533E-05-5.57193983E-11 6.87812632E-03 0.00000000E+00 9.05600086E-04 + 0.00000000E+00 1.50456671E-03-3.67933153E-18 2.07952918E-04-5.85625880E-19 + 1.79898496E+00 0.00000000E+00 2.13269988E-01 0.00000000E+00 2.44816538E-01 +-7.96021375E-16 3.06191128E-02-9.72281895E-17 2.20300418E-03 1.06518791E-08 + 1.15032275E-05 5.53071493E-11 0.00000000E+00 1.18697647E-08 0.00000000E+00 + 6.16843841E-11 2.07953115E-04 6.72295753E-19 9.05595393E-04 0.00000000E+00 + 3.06190277E-02 1.00321671E-16 2.13330612E-01 0.00000000E+00 2.25545765E-03 + 1.06369203E-08-1.16545900E-05-5.52640458E-11 0.00000000E+00 1.18986379E-08 + 0.00000000E+00-6.17677436E-11 1.83674212E-03 6.23084662E-18 2.51524777E-04 + 8.44792984E-19 7.61274116E-03 0.00000000E+00 9.97618518E-04 0.00000000E+00 + 2.45100545E-01 8.33350026E-16 3.06563550E-02 1.08549463E-16 1.62850543E+00 + 0.00000000E+00 1.94059084E-01 0.00000000E+00 2.75311914E-02 0.00000000E+00 + 1.71453150E-04 0.00000000E+00-3.27944793E-04 1.79926192E-18-2.04370907E-06 + 1.10417230E-20 0.00000000E+00 5.92387307E-10-1.09301710E-04 5.31840527E-10 + 0.00000000E+00 5.92387307E-10-1.09301710E-04 5.31840527E-10 1.51448845E-01 + 0.00000000E+00-1.70234201E-05 0.00000000E+00-1.81223819E-03 7.35626607E-18 + 1.96468110E-07-7.08210713E-21 0.00000000E+00-1.18025489E-08 0.00000000E+00 +-1.30157885E-08 2.05062749E-03-1.07205402E-08 2.33968436E-03-1.17484887E-08 + 0.00000000E+00-1.18025489E-08 0.00000000E+00-1.30157885E-08 2.05062749E-03 +-1.07205402E-08 2.33968436E-03-1.17484887E-08 2.49987212E-02 0.00000000E+00 +-1.56843504E-04 0.00000000E+00-2.98759875E-04 8.54710123E-19 1.87528055E-06 +-5.44214385E-21 0.00000000E+00-1.18697647E-08 0.00000000E+00 5.89856018E-10 + 2.20300418E-03-1.06518791E-08-1.03444229E-04 5.34594291E-10 0.00000000E+00 +-1.18697647E-08 0.00000000E+00 5.89856018E-10 2.20300418E-03-1.06518791E-08 +-1.03444229E-04 5.34594291E-10-9.31055297E-05-5.42140330E-10 3.82387209E-08 +-2.42982346E-14 0.00000000E+00-5.87161023E-10 0.00000000E+00 1.23523320E-14 +-9.41088483E-05-2.45309482E-19-4.29889336E-04 0.00000000E+00-1.53010969E-02 +-5.05904948E-17-1.12525494E-01 0.00000000E+00 2.33968436E-03 1.17484887E-08 + 7.61083611E-08-3.37467720E-14 0.00000000E+00 1.30157885E-08 0.00000000E+00 + 3.37924825E-14 2.07952918E-04 5.85625880E-19 8.33276886E-04 2.51064878E-18 + 9.05600086E-04 0.00000000E+00 3.62252688E-03 0.00000000E+00 3.06191128E-02 + 9.72281895E-17 1.22477527E-01 4.00872785E-16 2.13269988E-01 0.00000000E+00 + 8.54733484E-01 0.00000000E+00-1.19471728E-04-5.30024738E-10 3.78406271E-08 +-1.07758787E-14 0.00000000E+00-5.98679225E-10 0.00000000E+00 2.08398851E-14 + 2.07953115E-04 6.72295753E-19-1.14869473E-04-3.79272184E-19 9.05595393E-04 + 0.00000000E+00-4.75803478E-04 0.00000000E+00 3.06190277E-02 1.00321671E-16 +-1.53188457E-02-5.22177835E-17 2.13330612E-01 0.00000000E+00-1.01847424E-01 + 0.00000000E+00 0.00000000E+00-5.87161023E-10 0.00000000E+00 1.23523320E-14 + 9.31055297E-05-5.42140330E-10-3.82387209E-08-2.42982346E-14-4.29889336E-04 + 0.00000000E+00-9.41088483E-05 2.45309482E-19-1.12525494E-01 0.00000000E+00 +-1.53010969E-02 5.05904948E-17 0.00000000E+00 1.30157885E-08 0.00000000E+00 + 3.37924825E-14-2.33968436E-03 1.17484887E-08-7.61083611E-08-3.37467720E-14 + 9.05600086E-04 0.00000000E+00 3.62252688E-03 0.00000000E+00 2.07952918E-04 +-5.85625880E-19 8.33276886E-04-2.51064878E-18 2.13269988E-01 0.00000000E+00 + 8.54733484E-01 0.00000000E+00 3.06191128E-02-9.72281895E-17 1.22477527E-01 +-4.00872785E-16 0.00000000E+00-5.98679225E-10 0.00000000E+00 2.08398851E-14 + 1.19471728E-04-5.30024738E-10-3.78406271E-08-1.07758787E-14 9.05595393E-04 + 0.00000000E+00-4.75803478E-04 0.00000000E+00 2.07953115E-04-6.72295753E-19 +-1.14869473E-04 3.79272184E-19 2.13330612E-01 0.00000000E+00-1.01847424E-01 + 0.00000000E+00 3.06190277E-02-1.00321671E-16-1.53188457E-02 5.22177835E-17 +-9.31055297E-05-5.42140330E-10 3.82387209E-08-2.42982346E-14 0.00000000E+00 +-5.87161023E-10 0.00000000E+00 1.23523320E-14-9.41088483E-05-2.45309482E-19 +-4.29889336E-04 0.00000000E+00-9.41088483E-05-2.45309482E-19-4.29889336E-04 + 0.00000000E+00 2.33968436E-03 1.17484887E-08 7.61083611E-08-3.37467720E-14 + 0.00000000E+00 1.30157885E-08 0.00000000E+00 3.37924825E-14 2.07952918E-04 + 5.85625880E-19 8.33276886E-04 2.51064878E-18 9.05600086E-04 0.00000000E+00 + 3.62252688E-03 0.00000000E+00 2.07952918E-04 5.85625880E-19 8.33276886E-04 + 2.51064878E-18 9.05600086E-04 0.00000000E+00 3.62252688E-03 0.00000000E+00 +-1.19471728E-04-5.30024738E-10 3.78406271E-08-1.07758787E-14 0.00000000E+00 +-5.98679225E-10 0.00000000E+00 2.08398851E-14 2.07953115E-04 6.72295753E-19 +-1.14869473E-04-3.79272184E-19 9.05595393E-04 0.00000000E+00-4.75803478E-04 + 0.00000000E+00 2.07953115E-04 6.72295753E-19-1.14869473E-04-3.79272184E-19 + 9.05595393E-04 0.00000000E+00-4.75803478E-04 0.00000000E+00 0.00000000E+00 +-5.87161023E-10 0.00000000E+00 1.23523320E-14 9.31055297E-05-5.42140330E-10 +-3.82387209E-08-2.42982346E-14-4.29889336E-04 0.00000000E+00-9.41088483E-05 + 2.45309482E-19-4.29889336E-04 0.00000000E+00-9.41088483E-05 2.45309482E-19 + 0.00000000E+00 1.30157885E-08 0.00000000E+00 3.37924825E-14-2.33968436E-03 + 1.17484887E-08-7.61083611E-08-3.37467720E-14 9.05600086E-04 0.00000000E+00 + 3.62252688E-03 0.00000000E+00 2.07952918E-04-5.85625880E-19 8.33276886E-04 +-2.51064878E-18 9.05600086E-04 0.00000000E+00 3.62252688E-03 0.00000000E+00 + 2.07952918E-04-5.85625880E-19 8.33276886E-04-2.51064878E-18 0.00000000E+00 +-5.98679225E-10 0.00000000E+00 2.08398851E-14 1.19471728E-04-5.30024738E-10 +-3.78406271E-08-1.07758787E-14 9.05595393E-04 0.00000000E+00-4.75803478E-04 + 0.00000000E+00 2.07953115E-04-6.72295753E-19-1.14869473E-04 3.79272184E-19 + 9.05595393E-04 0.00000000E+00-4.75803478E-04 0.00000000E+00 2.07953115E-04 +-6.72295753E-19-1.14869473E-04 3.79272184E-19 2.05703689E-06 1.14681222E-20 + 1.22884186E-08 6.75291416E-23-1.72801310E-04 0.00000000E+00-1.03156288E-06 + 0.00000000E+00-3.82387209E-08 2.42982346E-14 0.00000000E+00-1.23523320E-14 +-3.82387209E-08 2.42982346E-14 0.00000000E+00-1.23523320E-14 1.96468110E-07 + 7.08210713E-21-3.13283520E-08-1.29715557E-22-1.70234201E-05 0.00000000E+00 + 2.62130250E-06 0.00000000E+00 1.05900533E-05 5.57193983E-11-7.61083611E-08 + 3.37467720E-14 0.00000000E+00 6.12819975E-11 0.00000000E+00-3.37924825E-14 + 1.05900533E-05 5.57193983E-11-7.61083611E-08 3.37467720E-14 0.00000000E+00 + 6.12819975E-11 0.00000000E+00-3.37924825E-14-1.86051828E-06-5.23555177E-21 + 1.11947956E-08 3.19303140E-23 1.55744337E-04 0.00000000E+00-9.36675536E-07 + 0.00000000E+00-1.15032275E-05-5.53071493E-11-3.78406271E-08 1.07758787E-14 + 0.00000000E+00-6.16843841E-11 0.00000000E+00-2.08398851E-14-1.15032275E-05 +-5.53071493E-11-3.78406271E-08 1.07758787E-14 0.00000000E+00-6.16843841E-11 + 0.00000000E+00-2.08398851E-14-3.27944793E-04-1.79926192E-18-2.04370907E-06 +-1.10417230E-20 2.75311914E-02 0.00000000E+00 1.71453150E-04 0.00000000E+00 + 1.09301710E-04 5.31840527E-10 0.00000000E+00 5.92387307E-10 1.09301710E-04 + 5.31840527E-10 0.00000000E+00 5.92387307E-10-1.81223819E-03-7.35626607E-18 + 1.96468110E-07 7.08210713E-21 1.51448845E-01 0.00000000E+00-1.70234201E-05 + 0.00000000E+00-2.05062749E-03-1.07205402E-08-2.33968436E-03-1.17484887E-08 + 0.00000000E+00-1.18025489E-08 0.00000000E+00-1.30157885E-08-2.05062749E-03 +-1.07205402E-08-2.33968436E-03-1.17484887E-08 0.00000000E+00-1.18025489E-08 + 0.00000000E+00-1.30157885E-08-2.98759875E-04-8.54710123E-19 1.87528055E-06 + 5.44214385E-21 2.49987212E-02 0.00000000E+00-1.56843504E-04 0.00000000E+00 +-2.20300418E-03-1.06518791E-08 1.03444229E-04 5.34594291E-10 0.00000000E+00 +-1.18697647E-08 0.00000000E+00 5.89856018E-10-2.20300418E-03-1.06518791E-08 + 1.03444229E-04 5.34594291E-10 0.00000000E+00-1.18697647E-08 0.00000000E+00 + 5.89856018E-10-1.72801310E-04 0.00000000E+00-1.03156288E-06 0.00000000E+00 + 2.05703689E-06-1.14681222E-20 1.22884186E-08-6.75291416E-23 0.00000000E+00 +-1.23523320E-14 3.82387209E-08 2.42982346E-14 0.00000000E+00-1.23523320E-14 + 3.82387209E-08 2.42982346E-14-1.70234201E-05 0.00000000E+00 2.62130250E-06 + 0.00000000E+00 1.96468110E-07-7.08210713E-21-3.13283520E-08 1.29715557E-22 + 0.00000000E+00 6.12819975E-11 0.00000000E+00-3.37924825E-14-1.05900533E-05 + 5.57193983E-11 7.61083611E-08 3.37467720E-14 0.00000000E+00 6.12819975E-11 + 0.00000000E+00-3.37924825E-14-1.05900533E-05 5.57193983E-11 7.61083611E-08 + 3.37467720E-14 1.55744337E-04 0.00000000E+00-9.36675536E-07 0.00000000E+00 +-1.86051828E-06 5.23555177E-21 1.11947956E-08-3.19303140E-23 0.00000000E+00 +-6.16843841E-11 0.00000000E+00-2.08398851E-14 1.15032275E-05-5.53071493E-11 + 3.78406271E-08 1.07758787E-14 0.00000000E+00-6.16843841E-11 0.00000000E+00 +-2.08398851E-14 1.15032275E-05-5.53071493E-11 3.78406271E-08 1.07758787E-14 + 0.00000000E+00 1.18697647E-08 0.00000000E+00 6.16843841E-11-2.20300418E-03 + 1.06518791E-08-1.15032275E-05 5.53071493E-11 9.05595393E-04 0.00000000E+00 + 2.07953115E-04-6.72295753E-19 9.05595393E-04 0.00000000E+00 2.07953115E-04 +-6.72295753E-19 0.00000000E+00 1.18986379E-08 0.00000000E+00-6.17677436E-11 +-2.25545765E-03 1.06369203E-08 1.16545900E-05-5.52640458E-11 7.61274116E-03 + 0.00000000E+00 9.97618518E-04 0.00000000E+00 1.83674212E-03-6.23084662E-18 + 2.51524777E-04-8.44792984E-19 7.61274116E-03 0.00000000E+00 9.97618518E-04 + 0.00000000E+00 1.83674212E-03-6.23084662E-18 2.51524777E-04-8.44792984E-19 + 2.20300418E-03 1.06518791E-08 1.15032275E-05 5.53071493E-11 0.00000000E+00 + 1.18697647E-08 0.00000000E+00 6.16843841E-11 2.07953115E-04 6.72295753E-19 + 9.05595393E-04 0.00000000E+00 2.07953115E-04 6.72295753E-19 9.05595393E-04 + 0.00000000E+00 2.25545765E-03 1.06369203E-08-1.16545900E-05-5.52640458E-11 + 0.00000000E+00 1.18986379E-08 0.00000000E+00-6.17677436E-11 1.83674212E-03 + 6.23084662E-18 2.51524777E-04 8.44792984E-19 7.61274116E-03 0.00000000E+00 + 9.97618518E-04 0.00000000E+00 1.83674212E-03 6.23084662E-18 2.51524777E-04 + 8.44792984E-19 7.61274116E-03 0.00000000E+00 9.97618518E-04 0.00000000E+00 + 0.00000000E+00 1.18697647E-08 0.00000000E+00 6.16843841E-11-2.20300418E-03 + 1.06518791E-08-1.15032275E-05 5.53071493E-11 9.05595393E-04 0.00000000E+00 + 2.07953115E-04-6.72295753E-19 2.13330612E-01 0.00000000E+00 3.06190277E-02 +-1.00321671E-16 0.00000000E+00 1.18986379E-08 0.00000000E+00-6.17677436E-11 +-2.25545765E-03 1.06369203E-08 1.16545900E-05-5.52640458E-11 7.61274116E-03 + 0.00000000E+00 9.97618518E-04 0.00000000E+00 1.83674212E-03-6.23084662E-18 + 2.51524777E-04-8.44792984E-19 1.62850543E+00 0.00000000E+00 1.94059084E-01 + 0.00000000E+00 2.45100545E-01-8.33350026E-16 3.06563550E-02-1.08549463E-16 + 2.40598848E-03 1.06153884E-08 1.25567037E-05 5.51345117E-11 0.00000000E+00 + 1.19958400E-08 0.00000000E+00 6.23498753E-11 2.51524477E-04 8.08569272E-19 + 9.97613725E-04 0.00000000E+00 3.06562634E-02 1.06812293E-16 1.94100279E-01 + 0.00000000E+00 2.45773183E-03 1.06147830E-08-1.27060121E-05-5.51328090E-11 + 0.00000000E+00 1.20337861E-08 0.00000000E+00-6.24594006E-11 2.20166244E-03 + 6.30932886E-18 2.99182475E-04 7.77901837E-19 8.35055003E-03 0.00000000E+00 + 1.09005505E-03 0.00000000E+00 2.45412257E-01 1.04525901E-15 3.06970480E-02 + 1.54683961E-16 1.48779255E+00 0.00000000E+00 1.78048251E-01 0.00000000E+00 + 2.49987212E-02 0.00000000E+00 1.55744337E-04 0.00000000E+00-2.98759875E-04 + 8.54710123E-19-1.86051828E-06 5.23555177E-21 0.00000000E+00 5.98679225E-10 +-1.19471728E-04 5.30024738E-10 0.00000000E+00 5.98679225E-10-1.19471728E-04 + 5.30024738E-10 1.38190515E-01 0.00000000E+00-1.40079352E-05 0.00000000E+00 +-1.63492905E-03 4.29551783E-18 2.16730696E-07-1.03140021E-21 0.00000000E+00 +-1.18986379E-08 0.00000000E+00-1.31388955E-08 2.25545765E-03-1.06369203E-08 + 2.56403839E-03-1.16839129E-08 0.00000000E+00-1.18986379E-08 0.00000000E+00 +-1.31388955E-08 2.25545765E-03-1.06369203E-08 2.56403839E-03-1.16839129E-08 + 2.29154669E-02 0.00000000E+00-1.43725280E-04 0.00000000E+00-2.66577079E-04 + 6.36839842E-19 1.67477331E-06-4.06779359E-21 0.00000000E+00-1.19958400E-08 + 0.00000000E+00 5.94987135E-10 2.40598848E-03-1.06153884E-08-1.13683729E-04 + 5.30917205E-10 0.00000000E+00-1.19958400E-08 0.00000000E+00 5.94987135E-10 + 2.40598848E-03-1.06153884E-08-1.13683729E-04 5.30917205E-10-1.03444229E-04 +-5.34594291E-10 3.78406271E-08-1.07758787E-14 0.00000000E+00-5.89856018E-10 + 0.00000000E+00 2.08398851E-14-1.14869473E-04-3.79272184E-19-4.75803478E-04 + 0.00000000E+00-1.53188457E-02-5.22177835E-17-1.01847424E-01 0.00000000E+00 + 2.56403839E-03 1.16839129E-08 7.51776382E-08-1.04677226E-14 0.00000000E+00 + 1.31388955E-08 0.00000000E+00 4.87327602E-14 2.51524777E-04 8.44792984E-19 + 1.00755797E-03 3.23318192E-18 9.97618518E-04 0.00000000E+00 3.99061392E-03 + 0.00000000E+00 3.06563550E-02 1.08549463E-16 1.22626472E-01 4.44880074E-16 + 1.94059084E-01 0.00000000E+00 7.77468529E-01 0.00000000E+00-1.29494161E-04 +-5.30733077E-10 3.73271039E-08-4.25675456E-16 0.00000000E+00-6.06582311E-10 + 0.00000000E+00 2.73813240E-14 2.51524477E-04 8.08569272E-19-1.37676738E-04 +-3.96617777E-19 9.97613725E-04 0.00000000E+00-5.21917193E-04 0.00000000E+00 + 3.06562634E-02 1.06812293E-16-1.53383279E-02-6.53740633E-17 1.94100279E-01 + 0.00000000E+00-9.30371326E-02 0.00000000E+00 0.00000000E+00-5.89856018E-10 + 0.00000000E+00 2.08398851E-14 1.03444229E-04-5.34594291E-10-3.78406271E-08 +-1.07758787E-14-4.75803478E-04 0.00000000E+00-1.14869473E-04 3.79272184E-19 +-1.01847424E-01 0.00000000E+00-1.53188457E-02 5.22177835E-17 0.00000000E+00 + 1.31388955E-08 0.00000000E+00 4.87327602E-14-2.56403839E-03 1.16839129E-08 +-7.51776382E-08-1.04677226E-14 9.97618518E-04 0.00000000E+00 3.99061392E-03 + 0.00000000E+00 2.51524777E-04-8.44792984E-19 1.00755797E-03-3.23318192E-18 + 1.94059084E-01 0.00000000E+00 7.77468529E-01 0.00000000E+00 3.06563550E-02 +-1.08549463E-16 1.22626472E-01-4.44880074E-16 0.00000000E+00-6.06582311E-10 + 0.00000000E+00 2.73813240E-14 1.29494161E-04-5.30733077E-10-3.73271039E-08 +-4.25675456E-16 9.97613725E-04 0.00000000E+00-5.21917193E-04 0.00000000E+00 + 2.51524477E-04-8.08569272E-19-1.37676738E-04 3.96617777E-19 1.94100279E-01 + 0.00000000E+00-9.30371326E-02 0.00000000E+00 3.06562634E-02-1.06812293E-16 +-1.53383279E-02 6.53740633E-17-1.03444229E-04-5.34594291E-10 3.78406271E-08 +-1.07758787E-14 0.00000000E+00-5.89856018E-10 0.00000000E+00 2.08398851E-14 +-1.14869473E-04-3.79272184E-19-4.75803478E-04 0.00000000E+00-1.14869473E-04 +-3.79272184E-19-4.75803478E-04 0.00000000E+00 2.56403839E-03 1.16839129E-08 + 7.51776382E-08-1.04677226E-14 0.00000000E+00 1.31388955E-08 0.00000000E+00 + 4.87327602E-14 2.51524777E-04 8.44792984E-19 1.00755797E-03 3.23318192E-18 + 9.97618518E-04 0.00000000E+00 3.99061392E-03 0.00000000E+00 2.51524777E-04 + 8.44792984E-19 1.00755797E-03 3.23318192E-18 9.97618518E-04 0.00000000E+00 + 3.99061392E-03 0.00000000E+00-1.29494161E-04-5.30733077E-10 3.73271039E-08 +-4.25675456E-16 0.00000000E+00-6.06582311E-10 0.00000000E+00 2.73813240E-14 + 2.51524477E-04 8.08569272E-19-1.37676738E-04-3.96617777E-19 9.97613725E-04 + 0.00000000E+00-5.21917193E-04 0.00000000E+00 2.51524477E-04 8.08569272E-19 +-1.37676738E-04-3.96617777E-19 9.97613725E-04 0.00000000E+00-5.21917193E-04 + 0.00000000E+00 0.00000000E+00-5.89856018E-10 0.00000000E+00 2.08398851E-14 + 1.03444229E-04-5.34594291E-10-3.78406271E-08-1.07758787E-14-4.75803478E-04 + 0.00000000E+00-1.14869473E-04 3.79272184E-19-4.75803478E-04 0.00000000E+00 +-1.14869473E-04 3.79272184E-19 0.00000000E+00 1.31388955E-08 0.00000000E+00 + 4.87327602E-14-2.56403839E-03 1.16839129E-08-7.51776382E-08-1.04677226E-14 + 9.97618518E-04 0.00000000E+00 3.99061392E-03 0.00000000E+00 2.51524777E-04 +-8.44792984E-19 1.00755797E-03-3.23318192E-18 9.97618518E-04 0.00000000E+00 + 3.99061392E-03 0.00000000E+00 2.51524777E-04-8.44792984E-19 1.00755797E-03 +-3.23318192E-18 0.00000000E+00-6.06582311E-10 0.00000000E+00 2.73813240E-14 + 1.29494161E-04-5.30733077E-10-3.73271039E-08-4.25675456E-16 9.97613725E-04 + 0.00000000E+00-5.21917193E-04 0.00000000E+00 2.51524477E-04-8.08569272E-19 +-1.37676738E-04 3.96617777E-19 9.97613725E-04 0.00000000E+00-5.21917193E-04 + 0.00000000E+00 2.51524477E-04-8.08569272E-19-1.37676738E-04 3.96617777E-19 + 1.87528055E-06 5.44214385E-21 1.11947956E-08 3.19303140E-23-1.56843504E-04 + 0.00000000E+00-9.36675536E-07 0.00000000E+00-3.78406271E-08 1.07758787E-14 + 0.00000000E+00-2.08398851E-14-3.78406271E-08 1.07758787E-14 0.00000000E+00 +-2.08398851E-14 2.16730696E-07 1.03140021E-21-2.82620199E-08-7.41415186E-23 +-1.40079352E-05 0.00000000E+00 2.39146261E-06 0.00000000E+00 1.16545900E-05 + 5.52640458E-11-7.51776382E-08 1.04677226E-14 0.00000000E+00 6.17677436E-11 + 0.00000000E+00-4.87327602E-14 1.16545900E-05 5.52640458E-11-7.51776382E-08 + 1.04677226E-14 0.00000000E+00 6.17677436E-11 0.00000000E+00-4.87327602E-14 +-1.65859214E-06-3.89855590E-21 9.98883334E-09 2.38930288E-23 1.42812876E-04 + 0.00000000E+00-8.58617942E-07 0.00000000E+00-1.25567037E-05-5.51345117E-11 +-3.73271039E-08 4.25675456E-16 0.00000000E+00-6.23498753E-11 0.00000000E+00 +-2.73813240E-14-1.25567037E-05-5.51345117E-11-3.73271039E-08 4.25675456E-16 + 0.00000000E+00-6.23498753E-11 0.00000000E+00-2.73813240E-14-2.98759875E-04 +-8.54710123E-19-1.86051828E-06-5.23555177E-21 2.49987212E-02 0.00000000E+00 + 1.55744337E-04 0.00000000E+00 1.19471728E-04 5.30024738E-10 0.00000000E+00 + 5.98679225E-10 1.19471728E-04 5.30024738E-10 0.00000000E+00 5.98679225E-10 +-1.63492905E-03-4.29551783E-18 2.16730696E-07 1.03140021E-21 1.38190515E-01 + 0.00000000E+00-1.40079352E-05 0.00000000E+00-2.25545765E-03-1.06369203E-08 +-2.56403839E-03-1.16839129E-08 0.00000000E+00-1.18986379E-08 0.00000000E+00 +-1.31388955E-08-2.25545765E-03-1.06369203E-08-2.56403839E-03-1.16839129E-08 + 0.00000000E+00-1.18986379E-08 0.00000000E+00-1.31388955E-08-2.66577079E-04 +-6.36839842E-19 1.67477331E-06 4.06779359E-21 2.29154669E-02 0.00000000E+00 +-1.43725280E-04 0.00000000E+00-2.40598848E-03-1.06153884E-08 1.13683729E-04 + 5.30917205E-10 0.00000000E+00-1.19958400E-08 0.00000000E+00 5.94987135E-10 +-2.40598848E-03-1.06153884E-08 1.13683729E-04 5.30917205E-10 0.00000000E+00 +-1.19958400E-08 0.00000000E+00 5.94987135E-10-1.56843504E-04 0.00000000E+00 +-9.36675536E-07 0.00000000E+00 1.87528055E-06-5.44214385E-21 1.11947956E-08 +-3.19303140E-23 0.00000000E+00-2.08398851E-14 3.78406271E-08 1.07758787E-14 + 0.00000000E+00-2.08398851E-14 3.78406271E-08 1.07758787E-14-1.40079352E-05 + 0.00000000E+00 2.39146261E-06 0.00000000E+00 2.16730696E-07-1.03140021E-21 +-2.82620199E-08 7.41415186E-23 0.00000000E+00 6.17677436E-11 0.00000000E+00 +-4.87327602E-14-1.16545900E-05 5.52640458E-11 7.51776382E-08 1.04677226E-14 + 0.00000000E+00 6.17677436E-11 0.00000000E+00-4.87327602E-14-1.16545900E-05 + 5.52640458E-11 7.51776382E-08 1.04677226E-14 1.42812876E-04 0.00000000E+00 +-8.58617942E-07 0.00000000E+00-1.65859214E-06 3.89855590E-21 9.98883334E-09 +-2.38930288E-23 0.00000000E+00-6.23498753E-11 0.00000000E+00-2.73813240E-14 + 1.25567037E-05-5.51345117E-11 3.73271039E-08 4.25675456E-16 0.00000000E+00 +-6.23498753E-11 0.00000000E+00-2.73813240E-14 1.25567037E-05-5.51345117E-11 + 3.73271039E-08 4.25675456E-16 0.00000000E+00 1.19958400E-08 0.00000000E+00 + 6.23498753E-11-2.40598848E-03 1.06153884E-08-1.25567037E-05 5.51345117E-11 + 9.97613725E-04 0.00000000E+00 2.51524477E-04-8.08569272E-19 9.97613725E-04 + 0.00000000E+00 2.51524477E-04-8.08569272E-19 0.00000000E+00 1.20337861E-08 + 0.00000000E+00-6.24594006E-11-2.45773183E-03 1.06147830E-08 1.27060121E-05 +-5.51328090E-11 8.35055003E-03 0.00000000E+00 1.09005505E-03 0.00000000E+00 + 2.20166244E-03-6.30932886E-18 2.99182475E-04-7.77901837E-19 8.35055003E-03 + 0.00000000E+00 1.09005505E-03 0.00000000E+00 2.20166244E-03-6.30932886E-18 + 2.99182475E-04-7.77901837E-19 2.40598848E-03 1.06153884E-08 1.25567037E-05 + 5.51345117E-11 0.00000000E+00 1.19958400E-08 0.00000000E+00 6.23498753E-11 + 2.51524477E-04 8.08569272E-19 9.97613725E-04 0.00000000E+00 2.51524477E-04 + 8.08569272E-19 9.97613725E-04 0.00000000E+00 2.45773183E-03 1.06147830E-08 +-1.27060121E-05-5.51328090E-11 0.00000000E+00 1.20337861E-08 0.00000000E+00 +-6.24594006E-11 2.20166244E-03 6.30932886E-18 2.99182475E-04 7.77901837E-19 + 8.35055003E-03 0.00000000E+00 1.09005505E-03 0.00000000E+00 2.20166244E-03 + 6.30932886E-18 2.99182475E-04 7.77901837E-19 8.35055003E-03 0.00000000E+00 + 1.09005505E-03 0.00000000E+00 0.00000000E+00 1.19958400E-08 0.00000000E+00 + 6.23498753E-11-2.40598848E-03 1.06153884E-08-1.25567037E-05 5.51345117E-11 + 9.97613725E-04 0.00000000E+00 2.51524477E-04-8.08569272E-19 1.94100279E-01 + 0.00000000E+00 3.06562634E-02-1.06812293E-16 0.00000000E+00 1.20337861E-08 + 0.00000000E+00-6.24594006E-11-2.45773183E-03 1.06147830E-08 1.27060121E-05 +-5.51328090E-11 8.35055003E-03 0.00000000E+00 1.09005505E-03 0.00000000E+00 + 2.20166244E-03-6.30932886E-18 2.99182475E-04-7.77901837E-19 1.48779255E+00 + 0.00000000E+00 1.78048251E-01 0.00000000E+00 2.45412257E-01-1.04525901E-15 + 3.06970480E-02-1.54683961E-16 3.18891877E-03 1.08946909E-08 1.66194131E-05 + 5.66260921E-11 0.00000000E+00 1.27632137E-08 0.00000000E+00 6.63601531E-11 + 4.66485193E-04 1.17511322E-18 1.37025138E-03 0.00000000E+00 3.08395779E-02 + 7.11749993E-17 1.42855211E-01 0.00000000E+00 3.23744248E-03 1.09292286E-08 +-1.67594304E-05-5.67257666E-11 0.00000000E+00 1.28225002E-08 0.00000000E+00 +-6.65312373E-11 3.98598104E-03 9.23413590E-18 5.30295395E-04 1.15961660E-18 + 1.13398450E-02 0.00000000E+00 1.46475220E-03 0.00000000E+00 2.46933143E-01 + 4.43821644E-16 3.08939460E-02 4.74640937E-17 1.10730613E+00 0.00000000E+00 + 1.34053126E-01 0.00000000E+00 2.99796244E-03 1.07762798E-08 1.56286813E-05 + 5.60034495E-11 0.00000000E+00 1.25420104E-08 0.00000000E+00 6.52068237E-11 + 4.06682403E-04 6.07413155E-19 1.27633039E-03 0.00000000E+00 3.07886470E-02 + 1.20610020E-16 1.52912176E-01 0.00000000E+00 3.04740482E-03 1.08042051E-08 +-1.57713530E-05-5.60840478E-11 0.00000000E+00 1.25974050E-08 0.00000000E+00 +-6.53666808E-11 3.49152385E-03 7.09141990E-18 4.66485513E-04 1.18096522E-18 + 1.05861923E-02 0.00000000E+00 1.37025727E-03 0.00000000E+00 2.46512296E-01 + 8.20576965E-16 3.08396676E-02 7.95757101E-17 1.18262332E+00 0.00000000E+00 + 1.42843582E-01 0.00000000E+00 2.80365502E-03 1.06863279E-08 1.46204401E-05 + 5.55272328E-11 0.00000000E+00 1.23377679E-08 0.00000000E+00 6.41406598E-11 + 3.50907835E-04 9.60342103E-19 1.18294269E-03 0.00000000E+00 3.07411005E-02 + 9.48681227E-17 1.64523745E-01 0.00000000E+00 2.85392737E-03 1.07064788E-08 +-1.47655044E-05-5.55854035E-11 0.00000000E+00 1.23884980E-08 0.00000000E+00 +-6.42870612E-11 3.02920808E-03 6.31637785E-18 4.06682674E-04 6.24656760E-19 + 9.83696822E-03 0.00000000E+00 1.27633610E-03 0.00000000E+00 2.46118381E-01 + 8.15350141E-16 3.07887371E-02 1.13511434E-16 1.26918664E+00 0.00000000E+00 + 1.52896741E-01 0.00000000E+00 2.60619933E-03 1.06302561E-08 1.35957741E-05 + 5.52251380E-11 0.00000000E+00 1.21540857E-08 0.00000000E+00 6.31800472E-11 + 2.99182429E-04 7.81594890E-19 1.09004987E-03 0.00000000E+00 3.06969586E-02 + 1.61102507E-16 1.78077196E-01 0.00000000E+00 2.65725714E-03 1.06410863E-08 +-1.37431091E-05-5.52564206E-11 0.00000000E+00 1.21991225E-08 0.00000000E+00 +-6.33100259E-11 2.59920279E-03 6.98168977E-18 3.50908122E-04 9.55982233E-19 + 9.09185545E-03 0.00000000E+00 1.18294805E-03 0.00000000E+00 2.45751613E-01 + 1.07948334E-15 3.07411896E-02 1.03529338E-16 1.36969611E+00 0.00000000E+00 + 1.64502845E-01 0.00000000E+00 2.29154669E-02 0.00000000E+00 1.42812876E-04 + 0.00000000E+00-2.66577079E-04 6.36839842E-19-1.65859214E-06 3.89855590E-21 + 0.00000000E+00 6.06582311E-10-1.29494161E-04 5.30733077E-10 0.00000000E+00 + 6.06582311E-10-1.29494161E-04 5.30733077E-10 1.27192306E-01 0.00000000E+00 +-1.17157224E-05 0.00000000E+00-1.44048393E-03 2.60608195E-18 2.36564584E-07 +-2.34005575E-21 0.00000000E+00-1.20337861E-08 0.00000000E+00-1.33009306E-08 + 2.45773183E-03-1.06147830E-08 2.78539120E-03-1.16809038E-08 0.00000000E+00 +-1.20337861E-08 0.00000000E+00-1.33009306E-08 2.45773183E-03-1.06147830E-08 + 2.78539120E-03-1.16809038E-08 2.11735114E-02 0.00000000E+00-1.32762311E-04 + 0.00000000E+00-2.31441070E-04 3.22011015E-19 1.45581460E-06-2.03544583E-21 + 0.00000000E+00-1.21540857E-08 0.00000000E+00 6.01984528E-10 2.60619933E-03 +-1.06302561E-08-1.23782000E-04 5.30185649E-10 0.00000000E+00-1.21540857E-08 + 0.00000000E+00 6.01984528E-10 2.60619933E-03-1.06302561E-08-1.23782000E-04 + 5.30185649E-10-1.13683729E-04-5.30917205E-10 3.73271039E-08-4.25675456E-16 + 0.00000000E+00-5.94987135E-10 0.00000000E+00 2.73813240E-14-1.37676738E-04 +-3.96617777E-19-5.21917193E-04 0.00000000E+00-1.53383279E-02-6.53740633E-17 +-9.30371326E-02 0.00000000E+00 2.78539120E-03 1.16809038E-08 7.41262247E-08 + 7.92732036E-15 0.00000000E+00 1.33009306E-08 0.00000000E+00 6.01757089E-14 + 2.99182475E-04 7.77901837E-19 1.19818257E-03 3.19071014E-18 1.09005505E-03 + 0.00000000E+00 4.36037303E-03 0.00000000E+00 3.06970480E-02 1.54683961E-16 + 1.22789244E-01 5.94525715E-16 1.78048251E-01 0.00000000E+00 7.13135765E-01 + 0.00000000E+00-1.39383061E-04-5.33495457E-10 3.68337430E-08 7.82065732E-15 + 0.00000000E+00-6.15746173E-10 0.00000000E+00 3.24946701E-14 2.99182429E-04 + 7.81594890E-19-1.62522638E-04-4.34394281E-19 1.09004987E-03 0.00000000E+00 +-5.68249479E-04 0.00000000E+00 3.06969586E-02 1.61102507E-16-1.53595370E-02 +-6.61579614E-17 1.78077196E-01 0.00000000E+00-8.56450101E-02 0.00000000E+00 + 0.00000000E+00-5.94987135E-10 0.00000000E+00 2.73813240E-14 1.13683729E-04 +-5.30917205E-10-3.73271039E-08-4.25675456E-16-5.21917193E-04 0.00000000E+00 +-1.37676738E-04 3.96617777E-19-9.30371326E-02 0.00000000E+00-1.53383279E-02 + 6.53740633E-17 0.00000000E+00 1.33009306E-08 0.00000000E+00 6.01757089E-14 +-2.78539120E-03 1.16809038E-08-7.41262247E-08 7.92732036E-15 1.09005505E-03 + 0.00000000E+00 4.36037303E-03 0.00000000E+00 2.99182475E-04-7.77901837E-19 + 1.19818257E-03-3.19071014E-18 1.78048251E-01 0.00000000E+00 7.13135765E-01 + 0.00000000E+00 3.06970480E-02-1.54683961E-16 1.22789244E-01-5.94525715E-16 + 0.00000000E+00-6.15746173E-10 0.00000000E+00 3.24946701E-14 1.39383061E-04 +-5.33495457E-10-3.68337430E-08 7.82065732E-15 1.09004987E-03 0.00000000E+00 +-5.68249479E-04 0.00000000E+00 2.99182429E-04-7.81594890E-19-1.62522638E-04 + 4.34394281E-19 1.78077196E-01 0.00000000E+00-8.56450101E-02 0.00000000E+00 + 3.06969586E-02-1.61102507E-16-1.53595370E-02 6.61579614E-17-1.13683729E-04 +-5.30917205E-10 3.73271039E-08-4.25675456E-16 0.00000000E+00-5.94987135E-10 + 0.00000000E+00 2.73813240E-14-1.37676738E-04-3.96617777E-19-5.21917193E-04 + 0.00000000E+00-1.37676738E-04-3.96617777E-19-5.21917193E-04 0.00000000E+00 + 2.78539120E-03 1.16809038E-08 7.41262247E-08 7.92732036E-15 0.00000000E+00 + 1.33009306E-08 0.00000000E+00 6.01757089E-14 2.99182475E-04 7.77901837E-19 + 1.19818257E-03 3.19071014E-18 1.09005505E-03 0.00000000E+00 4.36037303E-03 + 0.00000000E+00 2.99182475E-04 7.77901837E-19 1.19818257E-03 3.19071014E-18 + 1.09005505E-03 0.00000000E+00 4.36037303E-03 0.00000000E+00-1.39383061E-04 +-5.33495457E-10 3.68337430E-08 7.82065732E-15 0.00000000E+00-6.15746173E-10 + 0.00000000E+00 3.24946701E-14 2.99182429E-04 7.81594890E-19-1.62522638E-04 +-4.34394281E-19 1.09004987E-03 0.00000000E+00-5.68249479E-04 0.00000000E+00 + 2.99182429E-04 7.81594890E-19-1.62522638E-04-4.34394281E-19 1.09004987E-03 + 0.00000000E+00-5.68249479E-04 0.00000000E+00 0.00000000E+00-5.94987135E-10 + 0.00000000E+00 2.73813240E-14 1.13683729E-04-5.30917205E-10-3.73271039E-08 +-4.25675456E-16-5.21917193E-04 0.00000000E+00-1.37676738E-04 3.96617777E-19 +-5.21917193E-04 0.00000000E+00-1.37676738E-04 3.96617777E-19 0.00000000E+00 + 1.33009306E-08 0.00000000E+00 6.01757089E-14-2.78539120E-03 1.16809038E-08 +-7.41262247E-08 7.92732036E-15 1.09005505E-03 0.00000000E+00 4.36037303E-03 + 0.00000000E+00 2.99182475E-04-7.77901837E-19 1.19818257E-03-3.19071014E-18 + 1.09005505E-03 0.00000000E+00 4.36037303E-03 0.00000000E+00 2.99182475E-04 +-7.77901837E-19 1.19818257E-03-3.19071014E-18 0.00000000E+00-6.15746173E-10 + 0.00000000E+00 3.24946701E-14 1.39383061E-04-5.33495457E-10-3.68337430E-08 + 7.82065732E-15 1.09004987E-03 0.00000000E+00-5.68249479E-04 0.00000000E+00 + 2.99182429E-04-7.81594890E-19-1.62522638E-04 4.34394281E-19 1.09004987E-03 + 0.00000000E+00-5.68249479E-04 0.00000000E+00 2.99182429E-04-7.81594890E-19 +-1.62522638E-04 4.34394281E-19 1.67477331E-06 4.06779359E-21 9.98883334E-09 + 2.38930288E-23-1.43725280E-04 0.00000000E+00-8.58617942E-07 0.00000000E+00 +-3.73271039E-08 4.25675456E-16 0.00000000E+00-2.73813240E-14-3.73271039E-08 + 4.25675456E-16 0.00000000E+00-2.73813240E-14 2.36564584E-07 2.34005575E-21 +-2.48988979E-08-4.63515815E-23-1.17157224E-05 0.00000000E+00 2.20087798E-06 + 0.00000000E+00 1.27060121E-05 5.51328090E-11-7.41262247E-08-7.92732036E-15 + 0.00000000E+00 6.24594006E-11 0.00000000E+00-6.01757089E-14 1.27060121E-05 + 5.51328090E-11-7.41262247E-08-7.92732036E-15 0.00000000E+00 6.24594006E-11 + 0.00000000E+00-6.01757089E-14-1.43819357E-06-1.98694881E-21 8.67224219E-09 + 1.20257612E-23 1.31993759E-04 0.00000000E+00-7.93347449E-07 0.00000000E+00 +-1.35957741E-05-5.52251380E-11-3.68337430E-08-7.82065732E-15 0.00000000E+00 +-6.31800472E-11 0.00000000E+00-3.24946701E-14-1.35957741E-05-5.52251380E-11 +-3.68337430E-08-7.82065732E-15 0.00000000E+00-6.31800472E-11 0.00000000E+00 +-3.24946701E-14-2.66577079E-04-6.36839842E-19-1.65859214E-06-3.89855590E-21 + 2.29154669E-02 0.00000000E+00 1.42812876E-04 0.00000000E+00 1.29494161E-04 + 5.30733077E-10 0.00000000E+00 6.06582311E-10 1.29494161E-04 5.30733077E-10 + 0.00000000E+00 6.06582311E-10-1.44048393E-03-2.60608195E-18 2.36564584E-07 + 2.34005575E-21 1.27192306E-01 0.00000000E+00-1.17157224E-05 0.00000000E+00 +-2.45773183E-03-1.06147830E-08-2.78539120E-03-1.16809038E-08 0.00000000E+00 +-1.20337861E-08 0.00000000E+00-1.33009306E-08-2.45773183E-03-1.06147830E-08 +-2.78539120E-03-1.16809038E-08 0.00000000E+00-1.20337861E-08 0.00000000E+00 +-1.33009306E-08-2.31441070E-04-3.22011015E-19 1.45581460E-06 2.03544583E-21 + 2.11735114E-02 0.00000000E+00-1.32762311E-04 0.00000000E+00-2.60619933E-03 +-1.06302561E-08 1.23782000E-04 5.30185649E-10 0.00000000E+00-1.21540857E-08 + 0.00000000E+00 6.01984528E-10-2.60619933E-03-1.06302561E-08 1.23782000E-04 + 5.30185649E-10 0.00000000E+00-1.21540857E-08 0.00000000E+00 6.01984528E-10 +-1.43725280E-04 0.00000000E+00-8.58617942E-07 0.00000000E+00 1.67477331E-06 +-4.06779359E-21 9.98883334E-09-2.38930288E-23 0.00000000E+00-2.73813240E-14 + 3.73271039E-08 4.25675456E-16 0.00000000E+00-2.73813240E-14 3.73271039E-08 + 4.25675456E-16-1.17157224E-05 0.00000000E+00 2.20087798E-06 0.00000000E+00 + 2.36564584E-07-2.34005575E-21-2.48988979E-08 4.63515815E-23 0.00000000E+00 + 6.24594006E-11 0.00000000E+00-6.01757089E-14-1.27060121E-05 5.51328090E-11 + 7.41262247E-08-7.92732036E-15 0.00000000E+00 6.24594006E-11 0.00000000E+00 +-6.01757089E-14-1.27060121E-05 5.51328090E-11 7.41262247E-08-7.92732036E-15 + 1.31993759E-04 0.00000000E+00-7.93347449E-07 0.00000000E+00-1.43819357E-06 + 1.98694881E-21 8.67224219E-09-1.20257612E-23 0.00000000E+00-6.31800472E-11 + 0.00000000E+00-3.24946701E-14 1.35957741E-05-5.52251380E-11 3.68337430E-08 +-7.82065732E-15 0.00000000E+00-6.31800472E-11 0.00000000E+00-3.24946701E-14 + 1.35957741E-05-5.52251380E-11 3.68337430E-08-7.82065732E-15 0.00000000E+00 + 1.21540857E-08 0.00000000E+00 6.31800472E-11-2.60619933E-03 1.06302561E-08 +-1.35957741E-05 5.52251380E-11 1.09004987E-03 0.00000000E+00 2.99182429E-04 +-7.81594890E-19 1.09004987E-03 0.00000000E+00 2.99182429E-04-7.81594890E-19 + 0.00000000E+00 1.21991225E-08 0.00000000E+00-6.33100259E-11-2.65725714E-03 + 1.06410863E-08 1.37431091E-05-5.52564206E-11 9.09185545E-03 0.00000000E+00 + 1.18294805E-03 0.00000000E+00 2.59920279E-03-6.98168977E-18 3.50908122E-04 +-9.55982233E-19 9.09185545E-03 0.00000000E+00 1.18294805E-03 0.00000000E+00 + 2.59920279E-03-6.98168977E-18 3.50908122E-04-9.55982233E-19 2.60619933E-03 + 1.06302561E-08 1.35957741E-05 5.52251380E-11 0.00000000E+00 1.21540857E-08 + 0.00000000E+00 6.31800472E-11 2.99182429E-04 7.81594890E-19 1.09004987E-03 + 0.00000000E+00 2.99182429E-04 7.81594890E-19 1.09004987E-03 0.00000000E+00 + 2.65725714E-03 1.06410863E-08-1.37431091E-05-5.52564206E-11 0.00000000E+00 + 1.21991225E-08 0.00000000E+00-6.33100259E-11 2.59920279E-03 6.98168977E-18 + 3.50908122E-04 9.55982233E-19 9.09185545E-03 0.00000000E+00 1.18294805E-03 + 0.00000000E+00 2.59920279E-03 6.98168977E-18 3.50908122E-04 9.55982233E-19 + 9.09185545E-03 0.00000000E+00 1.18294805E-03 0.00000000E+00 0.00000000E+00 + 1.21540857E-08 0.00000000E+00 6.31800472E-11-2.60619933E-03 1.06302561E-08 +-1.35957741E-05 5.52251380E-11 1.09004987E-03 0.00000000E+00 2.99182429E-04 +-7.81594890E-19 1.78077196E-01 0.00000000E+00 3.06969586E-02-1.61102507E-16 + 0.00000000E+00 1.21991225E-08 0.00000000E+00-6.33100259E-11-2.65725714E-03 + 1.06410863E-08 1.37431091E-05-5.52564206E-11 9.09185545E-03 0.00000000E+00 + 1.18294805E-03 0.00000000E+00 2.59920279E-03-6.98168977E-18 3.50908122E-04 +-9.55982233E-19 1.36969611E+00 0.00000000E+00 1.64502845E-01 0.00000000E+00 + 2.45751613E-01-1.07948334E-15 3.07411896E-02-1.03529338E-16 2.11735114E-02 + 0.00000000E+00 1.31993759E-04 0.00000000E+00-2.31441070E-04 3.22011015E-19 +-1.43819357E-06 1.98694881E-21 0.00000000E+00 6.15746173E-10-1.39383061E-04 + 5.33495457E-10 0.00000000E+00 6.15746173E-10-1.39383061E-04 5.33495457E-10 + 1.17932426E-01 0.00000000E+00-9.93154514E-06 0.00000000E+00-1.22883562E-03 + 1.98967238E-18 2.56638929E-07 8.99672587E-22 0.00000000E+00-1.21991225E-08 + 0.00000000E+00-1.34933643E-08 2.65725714E-03-1.06410863E-08 3.00377068E-03 +-1.17269246E-08 0.00000000E+00-1.21991225E-08 0.00000000E+00-1.34933643E-08 + 2.65725714E-03-1.06410863E-08 3.00377068E-03-1.17269246E-08 1.96970843E-02 + 0.00000000E+00-1.23474852E-04 0.00000000E+00-1.93327000E-04 4.36357554E-19 + 1.21822554E-06-2.67571767E-21 0.00000000E+00-1.23377679E-08 0.00000000E+00 + 6.10434553E-10 2.80365502E-03-1.06863279E-08-1.33754480E-04 5.31788420E-10 + 0.00000000E+00-1.23377679E-08 0.00000000E+00 6.10434553E-10 2.80365502E-03 +-1.06863279E-08-1.33754480E-04 5.31788420E-10-1.23782000E-04-5.30185649E-10 + 3.68337430E-08 7.82065732E-15 0.00000000E+00-6.01984528E-10 0.00000000E+00 + 3.24946701E-14-1.62522638E-04-4.34394281E-19-5.68249479E-04 0.00000000E+00 +-1.53595370E-02-6.61579614E-17-8.56450101E-02 0.00000000E+00 3.00377068E-03 + 1.17269246E-08 7.31133971E-08 2.27169273E-14 0.00000000E+00 1.34933643E-08 + 0.00000000E+00 6.92939239E-14 3.50908122E-04 9.55982233E-19 1.40507799E-03 + 3.65845871E-18 1.18294805E-03 0.00000000E+00 4.73195837E-03 0.00000000E+00 + 3.07411896E-02 1.03529338E-16 1.22965796E-01 4.22745897E-16 1.64502845E-01 + 0.00000000E+00 6.58748651E-01 0.00000000E+00-1.49115465E-04-5.37946105E-10 + 3.62660783E-08 1.45426791E-14 0.00000000E+00-6.25935734E-10 0.00000000E+00 + 3.66003485E-14 3.50907835E-04 9.60342103E-19-1.89397627E-04-3.96249716E-19 + 1.18294269E-03 0.00000000E+00-6.14819697E-04 0.00000000E+00 3.07411005E-02 + 9.48681227E-17-1.53824594E-02-5.20948891E-17 1.64523745E-01 0.00000000E+00 +-7.93551215E-02 0.00000000E+00 0.00000000E+00-6.01984528E-10 0.00000000E+00 + 3.24946701E-14 1.23782000E-04-5.30185649E-10-3.68337430E-08 7.82065732E-15 +-5.68249479E-04 0.00000000E+00-1.62522638E-04 4.34394281E-19-8.56450101E-02 + 0.00000000E+00-1.53595370E-02 6.61579614E-17 0.00000000E+00 1.34933643E-08 + 0.00000000E+00 6.92939239E-14-3.00377068E-03 1.17269246E-08-7.31133971E-08 + 2.27169273E-14 1.18294805E-03 0.00000000E+00 4.73195837E-03 0.00000000E+00 + 3.50908122E-04-9.55982233E-19 1.40507799E-03-3.65845871E-18 1.64502845E-01 + 0.00000000E+00 6.58748651E-01 0.00000000E+00 3.07411896E-02-1.03529338E-16 + 1.22965796E-01-4.22745897E-16 0.00000000E+00-6.25935734E-10 0.00000000E+00 + 3.66003485E-14 1.49115465E-04-5.37946105E-10-3.62660783E-08 1.45426791E-14 + 1.18294269E-03 0.00000000E+00-6.14819697E-04 0.00000000E+00 3.50907835E-04 +-9.60342103E-19-1.89397627E-04 3.96249716E-19 1.64523745E-01 0.00000000E+00 +-7.93551215E-02 0.00000000E+00 3.07411005E-02-9.48681227E-17-1.53824594E-02 + 5.20948891E-17-1.23782000E-04-5.30185649E-10 3.68337430E-08 7.82065732E-15 + 0.00000000E+00-6.01984528E-10 0.00000000E+00 3.24946701E-14-1.62522638E-04 +-4.34394281E-19-5.68249479E-04 0.00000000E+00-1.62522638E-04-4.34394281E-19 +-5.68249479E-04 0.00000000E+00 3.00377068E-03 1.17269246E-08 7.31133971E-08 + 2.27169273E-14 0.00000000E+00 1.34933643E-08 0.00000000E+00 6.92939239E-14 + 3.50908122E-04 9.55982233E-19 1.40507799E-03 3.65845871E-18 1.18294805E-03 + 0.00000000E+00 4.73195837E-03 0.00000000E+00 3.50908122E-04 9.55982233E-19 + 1.40507799E-03 3.65845871E-18 1.18294805E-03 0.00000000E+00 4.73195837E-03 + 0.00000000E+00-1.49115465E-04-5.37946105E-10 3.62660783E-08 1.45426791E-14 + 0.00000000E+00-6.25935734E-10 0.00000000E+00 3.66003485E-14 3.50907835E-04 + 9.60342103E-19-1.89397627E-04-3.96249716E-19 1.18294269E-03 0.00000000E+00 +-6.14819697E-04 0.00000000E+00 3.50907835E-04 9.60342103E-19-1.89397627E-04 +-3.96249716E-19 1.18294269E-03 0.00000000E+00-6.14819697E-04 0.00000000E+00 + 0.00000000E+00-6.01984528E-10 0.00000000E+00 3.24946701E-14 1.23782000E-04 +-5.30185649E-10-3.68337430E-08 7.82065732E-15-5.68249479E-04 0.00000000E+00 +-1.62522638E-04 4.34394281E-19-5.68249479E-04 0.00000000E+00-1.62522638E-04 + 4.34394281E-19 0.00000000E+00 1.34933643E-08 0.00000000E+00 6.92939239E-14 +-3.00377068E-03 1.17269246E-08-7.31133971E-08 2.27169273E-14 1.18294805E-03 + 0.00000000E+00 4.73195837E-03 0.00000000E+00 3.50908122E-04-9.55982233E-19 + 1.40507799E-03-3.65845871E-18 1.18294805E-03 0.00000000E+00 4.73195837E-03 + 0.00000000E+00 3.50908122E-04-9.55982233E-19 1.40507799E-03-3.65845871E-18 + 0.00000000E+00-6.25935734E-10 0.00000000E+00 3.66003485E-14 1.49115465E-04 +-5.37946105E-10-3.62660783E-08 1.45426791E-14 1.18294269E-03 0.00000000E+00 +-6.14819697E-04 0.00000000E+00 3.50907835E-04-9.60342103E-19-1.89397627E-04 + 3.96249716E-19 1.18294269E-03 0.00000000E+00-6.14819697E-04 0.00000000E+00 + 3.50907835E-04-9.60342103E-19-1.89397627E-04 3.96249716E-19 1.45581460E-06 + 2.03544583E-21 8.67224219E-09 1.20257612E-23-1.32762311E-04 0.00000000E+00 +-7.93347449E-07 0.00000000E+00-3.68337430E-08-7.82065732E-15 0.00000000E+00 +-3.24946701E-14-3.68337430E-08-7.82065732E-15 0.00000000E+00-3.24946701E-14 + 2.56638929E-07-8.99672587E-22-2.12388894E-08-3.59242823E-23-9.93154514E-06 + 0.00000000E+00 2.04046141E-06 0.00000000E+00 1.37431091E-05 5.52564206E-11 +-7.31133971E-08-2.27169273E-14 0.00000000E+00 6.33100259E-11 0.00000000E+00 +-6.92939239E-14 1.37431091E-05 5.52564206E-11-7.31133971E-08-2.27169273E-14 + 0.00000000E+00 6.33100259E-11 0.00000000E+00-6.92939239E-14-1.19918918E-06 +-2.78189374E-21 7.24407438E-09 1.63629852E-23 1.22819330E-04 0.00000000E+00 +-7.38025543E-07 0.00000000E+00-1.46204401E-05-5.55272328E-11-3.62660783E-08 +-1.45426791E-14 0.00000000E+00-6.41406598E-11 0.00000000E+00-3.66003485E-14 +-1.46204401E-05-5.55272328E-11-3.62660783E-08-1.45426791E-14 0.00000000E+00 +-6.41406598E-11 0.00000000E+00-3.66003485E-14-2.31441070E-04-3.22011015E-19 +-1.43819357E-06-1.98694881E-21 2.11735114E-02 0.00000000E+00 1.31993759E-04 + 0.00000000E+00 1.39383061E-04 5.33495457E-10 0.00000000E+00 6.15746173E-10 + 1.39383061E-04 5.33495457E-10 0.00000000E+00 6.15746173E-10-1.22883562E-03 +-1.98967238E-18 2.56638929E-07-8.99672587E-22 1.17932426E-01 0.00000000E+00 +-9.93154514E-06 0.00000000E+00-2.65725714E-03-1.06410863E-08-3.00377068E-03 +-1.17269246E-08 0.00000000E+00-1.21991225E-08 0.00000000E+00-1.34933643E-08 +-2.65725714E-03-1.06410863E-08-3.00377068E-03-1.17269246E-08 0.00000000E+00 +-1.21991225E-08 0.00000000E+00-1.34933643E-08-1.93327000E-04-4.36357554E-19 + 1.21822554E-06 2.67571767E-21 1.96970843E-02 0.00000000E+00-1.23474852E-04 + 0.00000000E+00-2.80365502E-03-1.06863279E-08 1.33754480E-04 5.31788420E-10 + 0.00000000E+00-1.23377679E-08 0.00000000E+00 6.10434553E-10-2.80365502E-03 +-1.06863279E-08 1.33754480E-04 5.31788420E-10 0.00000000E+00-1.23377679E-08 + 0.00000000E+00 6.10434553E-10-1.32762311E-04 0.00000000E+00-7.93347449E-07 + 0.00000000E+00 1.45581460E-06-2.03544583E-21 8.67224219E-09-1.20257612E-23 + 0.00000000E+00-3.24946701E-14 3.68337430E-08-7.82065732E-15 0.00000000E+00 +-3.24946701E-14 3.68337430E-08-7.82065732E-15-9.93154514E-06 0.00000000E+00 + 2.04046141E-06 0.00000000E+00 2.56638929E-07 8.99672587E-22-2.12388894E-08 + 3.59242823E-23 0.00000000E+00 6.33100259E-11 0.00000000E+00-6.92939239E-14 +-1.37431091E-05 5.52564206E-11 7.31133971E-08-2.27169273E-14 0.00000000E+00 + 6.33100259E-11 0.00000000E+00-6.92939239E-14-1.37431091E-05 5.52564206E-11 + 7.31133971E-08-2.27169273E-14 1.22819330E-04 0.00000000E+00-7.38025543E-07 + 0.00000000E+00-1.19918918E-06 2.78189374E-21 7.24407438E-09-1.63629852E-23 + 0.00000000E+00-6.41406598E-11 0.00000000E+00-3.66003485E-14 1.46204401E-05 +-5.55272328E-11 3.62660783E-08-1.45426791E-14 0.00000000E+00-6.41406598E-11 + 0.00000000E+00-3.66003485E-14 1.46204401E-05-5.55272328E-11 3.62660783E-08 +-1.45426791E-14 0.00000000E+00 1.23377679E-08 0.00000000E+00 6.41406598E-11 +-2.80365502E-03 1.06863279E-08-1.46204401E-05 5.55272328E-11 1.18294269E-03 + 0.00000000E+00 3.50907835E-04-9.60342103E-19 1.18294269E-03 0.00000000E+00 + 3.50907835E-04-9.60342103E-19 0.00000000E+00 1.23884980E-08 0.00000000E+00 +-6.42870612E-11-2.85392737E-03 1.07064788E-08 1.47655044E-05-5.55854035E-11 + 9.83696822E-03 0.00000000E+00 1.27633610E-03 0.00000000E+00 3.02920808E-03 +-6.31637785E-18 4.06682674E-04-6.24656760E-19 9.83696822E-03 0.00000000E+00 + 1.27633610E-03 0.00000000E+00 3.02920808E-03-6.31637785E-18 4.06682674E-04 +-6.24656760E-19 2.80365502E-03 1.06863279E-08 1.46204401E-05 5.55272328E-11 + 0.00000000E+00 1.23377679E-08 0.00000000E+00 6.41406598E-11 3.50907835E-04 + 9.60342103E-19 1.18294269E-03 0.00000000E+00 3.50907835E-04 9.60342103E-19 + 1.18294269E-03 0.00000000E+00 2.85392737E-03 1.07064788E-08-1.47655044E-05 +-5.55854035E-11 0.00000000E+00 1.23884980E-08 0.00000000E+00-6.42870612E-11 + 3.02920808E-03 6.31637785E-18 4.06682674E-04 6.24656760E-19 9.83696822E-03 + 0.00000000E+00 1.27633610E-03 0.00000000E+00 3.02920808E-03 6.31637785E-18 + 4.06682674E-04 6.24656760E-19 9.83696822E-03 0.00000000E+00 1.27633610E-03 + 0.00000000E+00 0.00000000E+00 1.23377679E-08 0.00000000E+00 6.41406598E-11 +-2.80365502E-03 1.06863279E-08-1.46204401E-05 5.55272328E-11 1.18294269E-03 + 0.00000000E+00 3.50907835E-04-9.60342103E-19 1.64523745E-01 0.00000000E+00 + 3.07411005E-02-9.48681227E-17 0.00000000E+00 1.23884980E-08 0.00000000E+00 +-6.42870612E-11-2.85392737E-03 1.07064788E-08 1.47655044E-05-5.55854035E-11 + 9.83696822E-03 0.00000000E+00 1.27633610E-03 0.00000000E+00 3.02920808E-03 +-6.31637785E-18 4.06682674E-04-6.24656760E-19 1.26918664E+00 0.00000000E+00 + 1.52896741E-01 0.00000000E+00 2.46118381E-01-8.15350141E-16 3.07887371E-02 +-1.13511434E-16 1.96970843E-02 0.00000000E+00 1.22819330E-04 0.00000000E+00 +-1.93327000E-04 4.36357554E-19-1.19918918E-06 2.78189374E-21 0.00000000E+00 + 6.25935734E-10-1.49115465E-04 5.37946105E-10 0.00000000E+00 6.25935734E-10 +-1.49115465E-04 5.37946105E-10 1.10037634E-01 0.00000000E+00-8.51669741E-06 + 0.00000000E+00-1.00005509E-03 2.75426384E-18 2.76751843E-07-2.09819154E-22 + 0.00000000E+00-1.23884980E-08 0.00000000E+00-1.37102019E-08 2.85392737E-03 +-1.07064788E-08 3.21881849E-03-1.18128872E-08 0.00000000E+00-1.23884980E-08 + 0.00000000E+00-1.37102019E-08 2.85392737E-03-1.07064788E-08 3.21881849E-03 +-1.18128872E-08 1.84311727E-02 0.00000000E+00-1.15514818E-04 0.00000000E+00 +-1.52222884E-04 4.22038138E-19 9.61969799E-07-2.67287295E-21 0.00000000E+00 +-1.25420104E-08 0.00000000E+00 6.20045796E-10 2.99796244E-03-1.07762798E-08 +-1.43575629E-04 5.35285289E-10 0.00000000E+00-1.25420104E-08 0.00000000E+00 + 6.20045796E-10 2.99796244E-03-1.07762798E-08-1.43575629E-04 5.35285289E-10 +-1.33754480E-04-5.31788420E-10 3.62660783E-08 1.45426791E-14 0.00000000E+00 +-6.10434553E-10 0.00000000E+00 3.66003485E-14-1.89397627E-04-3.96249716E-19 +-6.14819697E-04 0.00000000E+00-1.53824594E-02-5.20948891E-17-7.93551215E-02 + 0.00000000E+00 3.21881849E-03 1.18128872E-08 7.19203836E-08 3.49336857E-14 + 0.00000000E+00 1.37102019E-08 0.00000000E+00 7.66833622E-14 4.06682674E-04 + 6.24656760E-19 1.62816875E-03 2.77288010E-18 1.27633610E-03 0.00000000E+00 + 5.10552352E-03 0.00000000E+00 3.07887371E-02 1.13511434E-16 1.23155977E-01 + 4.48073193E-16 1.52896741E-01 0.00000000E+00 6.12174400E-01 0.00000000E+00 +-1.58683069E-04-5.43818346E-10 3.56679367E-08 2.01495625E-14 0.00000000E+00 +-6.36972165E-10 0.00000000E+00 3.99642700E-14 4.06682403E-04 6.07413155E-19 +-2.18291979E-04-4.47094593E-19 1.27633039E-03 0.00000000E+00-6.61646915E-04 + 0.00000000E+00 3.07886470E-02 1.20610020E-16-1.54070787E-02-5.00464325E-17 + 1.52912176E-01 0.00000000E+00-7.39389393E-02 0.00000000E+00 0.00000000E+00 +-6.10434553E-10 0.00000000E+00 3.66003485E-14 1.33754480E-04-5.31788420E-10 +-3.62660783E-08 1.45426791E-14-6.14819697E-04 0.00000000E+00-1.89397627E-04 + 3.96249716E-19-7.93551215E-02 0.00000000E+00-1.53824594E-02 5.20948891E-17 + 0.00000000E+00 1.37102019E-08 0.00000000E+00 7.66833622E-14-3.21881849E-03 + 1.18128872E-08-7.19203836E-08 3.49336857E-14 1.27633610E-03 0.00000000E+00 + 5.10552352E-03 0.00000000E+00 4.06682674E-04-6.24656760E-19 1.62816875E-03 +-2.77288010E-18 1.52896741E-01 0.00000000E+00 6.12174400E-01 0.00000000E+00 + 3.07887371E-02-1.13511434E-16 1.23155977E-01-4.48073193E-16 0.00000000E+00 +-6.36972165E-10 0.00000000E+00 3.99642700E-14 1.58683069E-04-5.43818346E-10 +-3.56679367E-08 2.01495625E-14 1.27633039E-03 0.00000000E+00-6.61646915E-04 + 0.00000000E+00 4.06682403E-04-6.07413155E-19-2.18291979E-04 4.47094593E-19 + 1.52912176E-01 0.00000000E+00-7.39389393E-02 0.00000000E+00 3.07886470E-02 +-1.20610020E-16-1.54070787E-02 5.00464325E-17-1.33754480E-04-5.31788420E-10 + 3.62660783E-08 1.45426791E-14 0.00000000E+00-6.10434553E-10 0.00000000E+00 + 3.66003485E-14-1.89397627E-04-3.96249716E-19-6.14819697E-04 0.00000000E+00 +-1.89397627E-04-3.96249716E-19-6.14819697E-04 0.00000000E+00 3.21881849E-03 + 1.18128872E-08 7.19203836E-08 3.49336857E-14 0.00000000E+00 1.37102019E-08 + 0.00000000E+00 7.66833622E-14 4.06682674E-04 6.24656760E-19 1.62816875E-03 + 2.77288010E-18 1.27633610E-03 0.00000000E+00 5.10552352E-03 0.00000000E+00 + 4.06682674E-04 6.24656760E-19 1.62816875E-03 2.77288010E-18 1.27633610E-03 + 0.00000000E+00 5.10552352E-03 0.00000000E+00-1.58683069E-04-5.43818346E-10 + 3.56679367E-08 2.01495625E-14 0.00000000E+00-6.36972165E-10 0.00000000E+00 + 3.99642700E-14 4.06682403E-04 6.07413155E-19-2.18291979E-04-4.47094593E-19 + 1.27633039E-03 0.00000000E+00-6.61646915E-04 0.00000000E+00 4.06682403E-04 + 6.07413155E-19-2.18291979E-04-4.47094593E-19 1.27633039E-03 0.00000000E+00 +-6.61646915E-04 0.00000000E+00 0.00000000E+00-6.10434553E-10 0.00000000E+00 + 3.66003485E-14 1.33754480E-04-5.31788420E-10-3.62660783E-08 1.45426791E-14 +-6.14819697E-04 0.00000000E+00-1.89397627E-04 3.96249716E-19-6.14819697E-04 + 0.00000000E+00-1.89397627E-04 3.96249716E-19 0.00000000E+00 1.37102019E-08 + 0.00000000E+00 7.66833622E-14-3.21881849E-03 1.18128872E-08-7.19203836E-08 + 3.49336857E-14 1.27633610E-03 0.00000000E+00 5.10552352E-03 0.00000000E+00 + 4.06682674E-04-6.24656760E-19 1.62816875E-03-2.77288010E-18 1.27633610E-03 + 0.00000000E+00 5.10552352E-03 0.00000000E+00 4.06682674E-04-6.24656760E-19 + 1.62816875E-03-2.77288010E-18 0.00000000E+00-6.36972165E-10 0.00000000E+00 + 3.99642700E-14 1.58683069E-04-5.43818346E-10-3.56679367E-08 2.01495625E-14 + 1.27633039E-03 0.00000000E+00-6.61646915E-04 0.00000000E+00 4.06682403E-04 +-6.07413155E-19-2.18291979E-04 4.47094593E-19 1.27633039E-03 0.00000000E+00 +-6.61646915E-04 0.00000000E+00 4.06682403E-04-6.07413155E-19-2.18291979E-04 + 4.47094593E-19 1.21822554E-06 2.67571767E-21 7.24407438E-09 1.63629852E-23 +-1.23474852E-04 0.00000000E+00-7.38025543E-07 0.00000000E+00-3.62660783E-08 +-1.45426791E-14 0.00000000E+00-3.66003485E-14-3.62660783E-08-1.45426791E-14 + 0.00000000E+00-3.66003485E-14 2.76751843E-07 2.09819154E-22-1.72817519E-08 +-4.52516541E-23-8.51669741E-06 0.00000000E+00 1.90372586E-06 0.00000000E+00 + 1.47655044E-05 5.55854035E-11-7.19203836E-08-3.49336857E-14 0.00000000E+00 + 6.42870612E-11 0.00000000E+00-7.66833622E-14 1.47655044E-05 5.55854035E-11 +-7.19203836E-08-3.49336857E-14 0.00000000E+00 6.42870612E-11 0.00000000E+00 +-7.66833622E-14-9.41466737E-07-2.60024549E-21 5.70389214E-09 1.57735176E-23 + 1.14949796E-04 0.00000000E+00-6.90591171E-07 0.00000000E+00-1.56286813E-05 +-5.60034495E-11-3.56679367E-08-2.01495625E-14 0.00000000E+00-6.52068237E-11 + 0.00000000E+00-3.99642700E-14-1.56286813E-05-5.60034495E-11-3.56679367E-08 +-2.01495625E-14 0.00000000E+00-6.52068237E-11 0.00000000E+00-3.99642700E-14 +-1.93327000E-04-4.36357554E-19-1.19918918E-06-2.78189374E-21 1.96970843E-02 + 0.00000000E+00 1.22819330E-04 0.00000000E+00 1.49115465E-04 5.37946105E-10 + 0.00000000E+00 6.25935734E-10 1.49115465E-04 5.37946105E-10 0.00000000E+00 + 6.25935734E-10-1.00005509E-03-2.75426384E-18 2.76751843E-07 2.09819154E-22 + 1.10037634E-01 0.00000000E+00-8.51669741E-06 0.00000000E+00-2.85392737E-03 +-1.07064788E-08-3.21881849E-03-1.18128872E-08 0.00000000E+00-1.23884980E-08 + 0.00000000E+00-1.37102019E-08-2.85392737E-03-1.07064788E-08-3.21881849E-03 +-1.18128872E-08 0.00000000E+00-1.23884980E-08 0.00000000E+00-1.37102019E-08 +-1.52222884E-04-4.22038138E-19 9.61969799E-07 2.67287295E-21 1.84311727E-02 + 0.00000000E+00-1.15514818E-04 0.00000000E+00-2.99796244E-03-1.07762798E-08 + 1.43575629E-04 5.35285289E-10 0.00000000E+00-1.25420104E-08 0.00000000E+00 + 6.20045796E-10-2.99796244E-03-1.07762798E-08 1.43575629E-04 5.35285289E-10 + 0.00000000E+00-1.25420104E-08 0.00000000E+00 6.20045796E-10-1.23474852E-04 + 0.00000000E+00-7.38025543E-07 0.00000000E+00 1.21822554E-06-2.67571767E-21 + 7.24407438E-09-1.63629852E-23 0.00000000E+00-3.66003485E-14 3.62660783E-08 +-1.45426791E-14 0.00000000E+00-3.66003485E-14 3.62660783E-08-1.45426791E-14 +-8.51669741E-06 0.00000000E+00 1.90372586E-06 0.00000000E+00 2.76751843E-07 +-2.09819154E-22-1.72817519E-08 4.52516541E-23 0.00000000E+00 6.42870612E-11 + 0.00000000E+00-7.66833622E-14-1.47655044E-05 5.55854035E-11 7.19203836E-08 +-3.49336857E-14 0.00000000E+00 6.42870612E-11 0.00000000E+00-7.66833622E-14 +-1.47655044E-05 5.55854035E-11 7.19203836E-08-3.49336857E-14 1.14949796E-04 + 0.00000000E+00-6.90591171E-07 0.00000000E+00-9.41466737E-07 2.60024549E-21 + 5.70389214E-09-1.57735176E-23 0.00000000E+00-6.52068237E-11 0.00000000E+00 +-3.99642700E-14 1.56286813E-05-5.60034495E-11 3.56679367E-08-2.01495625E-14 + 0.00000000E+00-6.52068237E-11 0.00000000E+00-3.99642700E-14 1.56286813E-05 +-5.60034495E-11 3.56679367E-08-2.01495625E-14 0.00000000E+00 1.25420104E-08 + 0.00000000E+00 6.52068237E-11-2.99796244E-03 1.07762798E-08-1.56286813E-05 + 5.60034495E-11 1.27633039E-03 0.00000000E+00 4.06682403E-04-6.07413155E-19 + 1.27633039E-03 0.00000000E+00 4.06682403E-04-6.07413155E-19 0.00000000E+00 + 1.25974050E-08 0.00000000E+00-6.53666808E-11-3.04740482E-03 1.08042051E-08 + 1.57713530E-05-5.60840478E-11 1.05861923E-02 0.00000000E+00 1.37025727E-03 + 0.00000000E+00 3.49152385E-03-7.09141990E-18 4.66485513E-04-1.18096522E-18 + 1.05861923E-02 0.00000000E+00 1.37025727E-03 0.00000000E+00 3.49152385E-03 +-7.09141990E-18 4.66485513E-04-1.18096522E-18 2.99796244E-03 1.07762798E-08 + 1.56286813E-05 5.60034495E-11 0.00000000E+00 1.25420104E-08 0.00000000E+00 + 6.52068237E-11 4.06682403E-04 6.07413155E-19 1.27633039E-03 0.00000000E+00 + 4.06682403E-04 6.07413155E-19 1.27633039E-03 0.00000000E+00 3.04740482E-03 + 1.08042051E-08-1.57713530E-05-5.60840478E-11 0.00000000E+00 1.25974050E-08 + 0.00000000E+00-6.53666808E-11 3.49152385E-03 7.09141990E-18 4.66485513E-04 + 1.18096522E-18 1.05861923E-02 0.00000000E+00 1.37025727E-03 0.00000000E+00 + 3.49152385E-03 7.09141990E-18 4.66485513E-04 1.18096522E-18 1.05861923E-02 + 0.00000000E+00 1.37025727E-03 0.00000000E+00 0.00000000E+00 1.25420104E-08 + 0.00000000E+00 6.52068237E-11-2.99796244E-03 1.07762798E-08-1.56286813E-05 + 5.60034495E-11 1.27633039E-03 0.00000000E+00 4.06682403E-04-6.07413155E-19 + 1.52912176E-01 0.00000000E+00 3.07886470E-02-1.20610020E-16 0.00000000E+00 + 1.25974050E-08 0.00000000E+00-6.53666808E-11-3.04740482E-03 1.08042051E-08 + 1.57713530E-05-5.60840478E-11 1.05861923E-02 0.00000000E+00 1.37025727E-03 + 0.00000000E+00 3.49152385E-03-7.09141990E-18 4.66485513E-04-1.18096522E-18 + 1.18262332E+00 0.00000000E+00 1.42843582E-01 0.00000000E+00 2.46512296E-01 +-8.20576965E-16 3.08396676E-02-7.95757101E-17 1.84311727E-02 0.00000000E+00 + 1.14949796E-04 0.00000000E+00-1.52222884E-04 4.22038138E-19-9.41466737E-07 + 2.60024549E-21 0.00000000E+00 6.36972165E-10-1.58683069E-04 5.43818346E-10 + 0.00000000E+00 6.36972165E-10-1.58683069E-04 5.43818346E-10 1.03234703E-01 + 0.00000000E+00-7.37537209E-06 0.00000000E+00-7.53806080E-04 3.05249244E-18 + 2.97032093E-07 3.30378404E-21 0.00000000E+00-1.25974050E-08 0.00000000E+00 +-1.39470238E-08 3.04740482E-03-1.08042051E-08 3.43029201E-03-1.19321554E-08 + 0.00000000E+00-1.25974050E-08 0.00000000E+00-1.39470238E-08 3.04740482E-03 +-1.08042051E-08 3.43029201E-03-1.19321554E-08 1.73350316E-02 0.00000000E+00 +-1.08624704E-04 0.00000000E+00-1.08107595E-04 8.66002379E-19 6.86869346E-07 +-5.23105304E-21 0.00000000E+00-1.27632137E-08 0.00000000E+00 6.30604955E-10 + 3.18891877E-03-1.08946909E-08-1.53240554E-04 5.40355350E-10 0.00000000E+00 +-1.27632137E-08 0.00000000E+00 6.30604955E-10 3.18891877E-03-1.08946909E-08 +-1.53240554E-04 5.40355350E-10-1.43575629E-04-5.35285289E-10 3.56679367E-08 + 2.01495625E-14 0.00000000E+00-6.20045796E-10 0.00000000E+00 3.99642700E-14 +-2.18291979E-04-4.47094593E-19-6.61646915E-04 0.00000000E+00-1.54070787E-02 +-5.00464325E-17-7.39389393E-02 0.00000000E+00 3.43029201E-03 1.19321554E-08 + 7.06622747E-08 4.52286578E-14 0.00000000E+00 1.39470238E-08 0.00000000E+00 + 8.28002445E-14 4.66485513E-04 1.18096522E-18 1.86737241E-03 4.52258903E-18 + 1.37025727E-03 0.00000000E+00 5.48122226E-03 0.00000000E+00 3.08396676E-02 + 7.95757101E-17 1.23359687E-01 3.07813966E-16 1.42843582E-01 0.00000000E+00 + 5.71849904E-01 0.00000000E+00-1.68067231E-04-5.50908790E-10 3.50043425E-08 + 2.49186357E-14 0.00000000E+00-6.48720455E-10 0.00000000E+00 4.27710347E-14 + 4.66485193E-04 1.17511322E-18-2.49195147E-04-5.83682453E-19 1.37025138E-03 + 0.00000000E+00-7.08750895E-04 0.00000000E+00 3.08395779E-02 7.11749993E-17 +-1.54333810E-02-2.96597732E-17 1.42855211E-01 0.00000000E+00-6.92270842E-02 + 0.00000000E+00 0.00000000E+00-6.20045796E-10 0.00000000E+00 3.99642700E-14 + 1.43575629E-04-5.35285289E-10-3.56679367E-08 2.01495625E-14-6.61646915E-04 + 0.00000000E+00-2.18291979E-04 4.47094593E-19-7.39389393E-02 0.00000000E+00 +-1.54070787E-02 5.00464325E-17 0.00000000E+00 1.39470238E-08 0.00000000E+00 + 8.28002445E-14-3.43029201E-03 1.19321554E-08-7.06622747E-08 4.52286578E-14 + 1.37025727E-03 0.00000000E+00 5.48122226E-03 0.00000000E+00 4.66485513E-04 +-1.18096522E-18 1.86737241E-03-4.52258903E-18 1.42843582E-01 0.00000000E+00 + 5.71849904E-01 0.00000000E+00 3.08396676E-02-7.95757101E-17 1.23359687E-01 +-3.07813966E-16 0.00000000E+00-6.48720455E-10 0.00000000E+00 4.27710347E-14 + 1.68067231E-04-5.50908790E-10-3.50043425E-08 2.49186357E-14 1.37025138E-03 + 0.00000000E+00-7.08750895E-04 0.00000000E+00 4.66485193E-04-1.17511322E-18 +-2.49195147E-04 5.83682453E-19 1.42855211E-01 0.00000000E+00-6.92270842E-02 + 0.00000000E+00 3.08395779E-02-7.11749993E-17-1.54333810E-02 2.96597732E-17 +-1.43575629E-04-5.35285289E-10 3.56679367E-08 2.01495625E-14 0.00000000E+00 +-6.20045796E-10 0.00000000E+00 3.99642700E-14-2.18291979E-04-4.47094593E-19 +-6.61646915E-04 0.00000000E+00-2.18291979E-04-4.47094593E-19-6.61646915E-04 + 0.00000000E+00 3.43029201E-03 1.19321554E-08 7.06622747E-08 4.52286578E-14 + 0.00000000E+00 1.39470238E-08 0.00000000E+00 8.28002445E-14 4.66485513E-04 + 1.18096522E-18 1.86737241E-03 4.52258903E-18 1.37025727E-03 0.00000000E+00 + 5.48122226E-03 0.00000000E+00 4.66485513E-04 1.18096522E-18 1.86737241E-03 + 4.52258903E-18 1.37025727E-03 0.00000000E+00 5.48122226E-03 0.00000000E+00 +-1.68067231E-04-5.50908790E-10 3.50043425E-08 2.49186357E-14 0.00000000E+00 +-6.48720455E-10 0.00000000E+00 4.27710347E-14 4.66485193E-04 1.17511322E-18 +-2.49195147E-04-5.83682453E-19 1.37025138E-03 0.00000000E+00-7.08750895E-04 + 0.00000000E+00 4.66485193E-04 1.17511322E-18-2.49195147E-04-5.83682453E-19 + 1.37025138E-03 0.00000000E+00-7.08750895E-04 0.00000000E+00 0.00000000E+00 +-6.20045796E-10 0.00000000E+00 3.99642700E-14 1.43575629E-04-5.35285289E-10 +-3.56679367E-08 2.01495625E-14-6.61646915E-04 0.00000000E+00-2.18291979E-04 + 4.47094593E-19-6.61646915E-04 0.00000000E+00-2.18291979E-04 4.47094593E-19 + 0.00000000E+00 1.39470238E-08 0.00000000E+00 8.28002445E-14-3.43029201E-03 + 1.19321554E-08-7.06622747E-08 4.52286578E-14 1.37025727E-03 0.00000000E+00 + 5.48122226E-03 0.00000000E+00 4.66485513E-04-1.18096522E-18 1.86737241E-03 +-4.52258903E-18 1.37025727E-03 0.00000000E+00 5.48122226E-03 0.00000000E+00 + 4.66485513E-04-1.18096522E-18 1.86737241E-03-4.52258903E-18 0.00000000E+00 +-6.48720455E-10 0.00000000E+00 4.27710347E-14 1.68067231E-04-5.50908790E-10 +-3.50043425E-08 2.49186357E-14 1.37025138E-03 0.00000000E+00-7.08750895E-04 + 0.00000000E+00 4.66485193E-04-1.17511322E-18-2.49195147E-04 5.83682453E-19 + 1.37025138E-03 0.00000000E+00-7.08750895E-04 0.00000000E+00 4.66485193E-04 +-1.17511322E-18-2.49195147E-04 5.83682453E-19 9.61969799E-07 2.67287295E-21 + 5.70389214E-09 1.57735176E-23-1.15514818E-04 0.00000000E+00-6.90591171E-07 + 0.00000000E+00-3.56679367E-08-2.01495625E-14 0.00000000E+00-3.99642700E-14 +-3.56679367E-08-2.01495625E-14 0.00000000E+00-3.99642700E-14 2.97032093E-07 +-3.30378404E-21-1.30236545E-08-5.84792283E-23-7.37537209E-06 0.00000000E+00 + 1.78592139E-06 0.00000000E+00 1.57713530E-05 5.60840478E-11-7.06622747E-08 +-4.52286578E-14 0.00000000E+00 6.53666808E-11 0.00000000E+00-8.28002445E-14 + 1.57713530E-05 5.60840478E-11-7.06622747E-08-4.52286578E-14 0.00000000E+00 + 6.53666808E-11 0.00000000E+00-8.28002445E-14-6.64939836E-07-5.60555578E-21 + 4.05090022E-09 3.25265280E-23 1.08133195E-04 0.00000000E+00-6.49517827E-07 + 0.00000000E+00-1.66194131E-05-5.66260921E-11-3.50043425E-08-2.49186357E-14 + 0.00000000E+00-6.63601531E-11 0.00000000E+00-4.27710347E-14-1.66194131E-05 +-5.66260921E-11-3.50043425E-08-2.49186357E-14 0.00000000E+00-6.63601531E-11 + 0.00000000E+00-4.27710347E-14-1.52222884E-04-4.22038138E-19-9.41466737E-07 +-2.60024549E-21 1.84311727E-02 0.00000000E+00 1.14949796E-04 0.00000000E+00 + 1.58683069E-04 5.43818346E-10 0.00000000E+00 6.36972165E-10 1.58683069E-04 + 5.43818346E-10 0.00000000E+00 6.36972165E-10-7.53806080E-04-3.05249244E-18 + 2.97032093E-07-3.30378404E-21 1.03234703E-01 0.00000000E+00-7.37537209E-06 + 0.00000000E+00-3.04740482E-03-1.08042051E-08-3.43029201E-03-1.19321554E-08 + 0.00000000E+00-1.25974050E-08 0.00000000E+00-1.39470238E-08-3.04740482E-03 +-1.08042051E-08-3.43029201E-03-1.19321554E-08 0.00000000E+00-1.25974050E-08 + 0.00000000E+00-1.39470238E-08-1.08107595E-04-8.66002379E-19 6.86869346E-07 + 5.23105304E-21 1.73350316E-02 0.00000000E+00-1.08624704E-04 0.00000000E+00 +-3.18891877E-03-1.08946909E-08 1.53240554E-04 5.40355350E-10 0.00000000E+00 +-1.27632137E-08 0.00000000E+00 6.30604955E-10-3.18891877E-03-1.08946909E-08 + 1.53240554E-04 5.40355350E-10 0.00000000E+00-1.27632137E-08 0.00000000E+00 + 6.30604955E-10-1.15514818E-04 0.00000000E+00-6.90591171E-07 0.00000000E+00 + 9.61969799E-07-2.67287295E-21 5.70389214E-09-1.57735176E-23 0.00000000E+00 +-3.99642700E-14 3.56679367E-08-2.01495625E-14 0.00000000E+00-3.99642700E-14 + 3.56679367E-08-2.01495625E-14-7.37537209E-06 0.00000000E+00 1.78592139E-06 + 0.00000000E+00 2.97032093E-07 3.30378404E-21-1.30236545E-08 5.84792283E-23 + 0.00000000E+00 6.53666808E-11 0.00000000E+00-8.28002445E-14-1.57713530E-05 + 5.60840478E-11 7.06622747E-08-4.52286578E-14 0.00000000E+00 6.53666808E-11 + 0.00000000E+00-8.28002445E-14-1.57713530E-05 5.60840478E-11 7.06622747E-08 +-4.52286578E-14 1.08133195E-04 0.00000000E+00-6.49517827E-07 0.00000000E+00 +-6.64939836E-07 5.60555578E-21 4.05090022E-09-3.25265280E-23 0.00000000E+00 +-6.63601531E-11 0.00000000E+00-4.27710347E-14 1.66194131E-05-5.66260921E-11 + 3.50043425E-08-2.49186357E-14 0.00000000E+00-6.63601531E-11 0.00000000E+00 +-4.27710347E-14 1.66194131E-05-5.66260921E-11 3.50043425E-08-2.49186357E-14 + 0.00000000E+00 1.27632137E-08 0.00000000E+00 6.63601531E-11-3.18891877E-03 + 1.08946909E-08-1.66194131E-05 5.66260921E-11 1.37025138E-03 0.00000000E+00 + 4.66485193E-04-1.17511322E-18 1.37025138E-03 0.00000000E+00 4.66485193E-04 +-1.17511322E-18 0.00000000E+00 1.28225002E-08 0.00000000E+00-6.65312373E-11 +-3.23744248E-03 1.09292286E-08 1.67594304E-05-5.67257666E-11 1.13398450E-02 + 0.00000000E+00 1.46475220E-03 0.00000000E+00 3.98598104E-03-9.23413590E-18 + 5.30295395E-04-1.15961660E-18 1.13398450E-02 0.00000000E+00 1.46475220E-03 + 0.00000000E+00 3.98598104E-03-9.23413590E-18 5.30295395E-04-1.15961660E-18 + 3.18891877E-03 1.08946909E-08 1.66194131E-05 5.66260921E-11 0.00000000E+00 + 1.27632137E-08 0.00000000E+00 6.63601531E-11 4.66485193E-04 1.17511322E-18 + 1.37025138E-03 0.00000000E+00 4.66485193E-04 1.17511322E-18 1.37025138E-03 + 0.00000000E+00 3.23744248E-03 1.09292286E-08-1.67594304E-05-5.67257666E-11 + 0.00000000E+00 1.28225002E-08 0.00000000E+00-6.65312373E-11 3.98598104E-03 + 9.23413590E-18 5.30295395E-04 1.15961660E-18 1.13398450E-02 0.00000000E+00 + 1.46475220E-03 0.00000000E+00 3.98598104E-03 9.23413590E-18 5.30295395E-04 + 1.15961660E-18 1.13398450E-02 0.00000000E+00 1.46475220E-03 0.00000000E+00 + 0.00000000E+00 1.27632137E-08 0.00000000E+00 6.63601531E-11-3.18891877E-03 + 1.08946909E-08-1.66194131E-05 5.66260921E-11 1.37025138E-03 0.00000000E+00 + 4.66485193E-04-1.17511322E-18 1.42855211E-01 0.00000000E+00 3.08395779E-02 +-7.11749993E-17 0.00000000E+00 1.28225002E-08 0.00000000E+00-6.65312373E-11 +-3.23744248E-03 1.09292286E-08 1.67594304E-05-5.67257666E-11 1.13398450E-02 + 0.00000000E+00 1.46475220E-03 0.00000000E+00 3.98598104E-03-9.23413590E-18 + 5.30295395E-04-1.15961660E-18 1.10730613E+00 0.00000000E+00 1.34053126E-01 + 0.00000000E+00 2.46933143E-01-4.43821644E-16 3.08939460E-02-4.74640937E-17 + 1.73350316E-02 0.00000000E+00 1.08133195E-04 0.00000000E+00-1.08107595E-04 + 8.66002379E-19-6.64939836E-07 5.60555578E-21 0.00000000E+00 6.48720455E-10 +-1.68067231E-04 5.50908790E-10 0.00000000E+00 6.48720455E-10-1.68067231E-04 + 5.50908790E-10 9.73185643E-02 0.00000000E+00-6.44105717E-06 0.00000000E+00 +-4.90265188E-04 5.25884635E-18 3.17368784E-07-2.91936120E-21 0.00000000E+00 +-1.28225002E-08 0.00000000E+00-1.42005171E-08 3.23744248E-03-1.09292286E-08 + 3.63786209E-03-1.20797445E-08 0.00000000E+00-1.28225002E-08 0.00000000E+00 +-1.42005171E-08 3.23744248E-03-1.09292286E-08 3.63786209E-03-1.20797445E-08 + 1.63778388E-02 0.00000000E+00-1.02609748E-04 0.00000000E+00-6.09715301E-05 + 5.02490754E-19 3.92910811E-07-3.41022484E-21 0.00000000E+00-1.29986524E-08 + 0.00000000E+00 6.41952276E-10 3.37628133E-03-1.10374652E-08-1.62727721E-04 + 5.46758413E-10 0.00000000E+00-1.29986524E-08 0.00000000E+00 6.41952276E-10 + 3.37628133E-03-1.10374652E-08-1.62727721E-04 5.46758413E-10-1.53240554E-04 +-5.40355350E-10 3.50043425E-08 2.49186357E-14 0.00000000E+00-6.30604955E-10 + 0.00000000E+00 4.27710347E-14-2.49195147E-04-5.83682453E-19-7.08750895E-04 + 0.00000000E+00-1.54333810E-02-2.96597732E-17-6.92270842E-02 0.00000000E+00 + 3.63786209E-03 1.20797445E-08 6.93257784E-08 5.40684513E-14 0.00000000E+00 + 1.42005171E-08 0.00000000E+00 8.79480904E-14 5.30295395E-04 1.15961660E-18 + 2.12260318E-03 5.04649778E-18 1.46475220E-03 0.00000000E+00 5.85921468E-03 + 0.00000000E+00 3.08939460E-02 4.74640937E-17 1.23576791E-01 2.38825112E-16 + 1.34053126E-01 0.00000000E+00 5.36602938E-01 0.00000000E+00-1.77268886E-04 +-5.59060630E-10 3.43308526E-08 2.90466746E-14 0.00000000E+00-6.61076235E-10 + 0.00000000E+00 4.51514036E-14 5.30295064E-04 1.21786742E-18-2.82095725E-04 +-8.25633236E-19 1.46474602E-03 0.00000000E+00-7.56150963E-04 0.00000000E+00 + 3.08938568E-02 5.42604561E-17-1.54613504E-02-4.69646868E-17 1.34062038E-01 + 0.00000000E+00-6.50913295E-02 0.00000000E+00 0.00000000E+00-6.30604955E-10 + 0.00000000E+00 4.27710347E-14 1.53240554E-04-5.40355350E-10-3.50043425E-08 + 2.49186357E-14-7.08750895E-04 0.00000000E+00-2.49195147E-04 5.83682453E-19 +-6.92270842E-02 0.00000000E+00-1.54333810E-02 2.96597732E-17 0.00000000E+00 + 1.42005171E-08 0.00000000E+00 8.79480904E-14-3.63786209E-03 1.20797445E-08 +-6.93257784E-08 5.40684513E-14 1.46475220E-03 0.00000000E+00 5.85921468E-03 + 0.00000000E+00 5.30295395E-04-1.15961660E-18 2.12260318E-03-5.04649778E-18 + 1.34053126E-01 0.00000000E+00 5.36602938E-01 0.00000000E+00 3.08939460E-02 +-4.74640937E-17 1.23576791E-01-2.38825112E-16 0.00000000E+00-6.61076235E-10 + 0.00000000E+00 4.51514036E-14 1.77268886E-04-5.59060630E-10-3.43308526E-08 + 2.90466746E-14 1.46474602E-03 0.00000000E+00-7.56150963E-04 0.00000000E+00 + 5.30295064E-04-1.21786742E-18-2.82095725E-04 8.25633236E-19 1.34062038E-01 + 0.00000000E+00-6.50913295E-02 0.00000000E+00 3.08938568E-02-5.42604561E-17 +-1.54613504E-02 4.69646868E-17-1.53240554E-04-5.40355350E-10 3.50043425E-08 + 2.49186357E-14 0.00000000E+00-6.30604955E-10 0.00000000E+00 4.27710347E-14 +-2.49195147E-04-5.83682453E-19-7.08750895E-04 0.00000000E+00-2.49195147E-04 +-5.83682453E-19-7.08750895E-04 0.00000000E+00 3.63786209E-03 1.20797445E-08 + 6.93257784E-08 5.40684513E-14 0.00000000E+00 1.42005171E-08 0.00000000E+00 + 8.79480904E-14 5.30295395E-04 1.15961660E-18 2.12260318E-03 5.04649778E-18 + 1.46475220E-03 0.00000000E+00 5.85921468E-03 0.00000000E+00 5.30295395E-04 + 1.15961660E-18 2.12260318E-03 5.04649778E-18 1.46475220E-03 0.00000000E+00 + 5.85921468E-03 0.00000000E+00-1.77268886E-04-5.59060630E-10 3.43308526E-08 + 2.90466746E-14 0.00000000E+00-6.61076235E-10 0.00000000E+00 4.51514036E-14 + 5.30295064E-04 1.21786742E-18-2.82095725E-04-8.25633236E-19 1.46474602E-03 + 0.00000000E+00-7.56150963E-04 0.00000000E+00 5.30295064E-04 1.21786742E-18 +-2.82095725E-04-8.25633236E-19 1.46474602E-03 0.00000000E+00-7.56150963E-04 + 0.00000000E+00 0.00000000E+00-6.30604955E-10 0.00000000E+00 4.27710347E-14 + 1.53240554E-04-5.40355350E-10-3.50043425E-08 2.49186357E-14-7.08750895E-04 + 0.00000000E+00-2.49195147E-04 5.83682453E-19-7.08750895E-04 0.00000000E+00 +-2.49195147E-04 5.83682453E-19 0.00000000E+00 1.42005171E-08 0.00000000E+00 + 8.79480904E-14-3.63786209E-03 1.20797445E-08-6.93257784E-08 5.40684513E-14 + 1.46475220E-03 0.00000000E+00 5.85921468E-03 0.00000000E+00 5.30295395E-04 +-1.15961660E-18 2.12260318E-03-5.04649778E-18 1.46475220E-03 0.00000000E+00 + 5.85921468E-03 0.00000000E+00 5.30295395E-04-1.15961660E-18 2.12260318E-03 +-5.04649778E-18 0.00000000E+00-6.61076235E-10 0.00000000E+00 4.51514036E-14 + 1.77268886E-04-5.59060630E-10-3.43308526E-08 2.90466746E-14 1.46474602E-03 + 0.00000000E+00-7.56150963E-04 0.00000000E+00 5.30295064E-04-1.21786742E-18 +-2.82095725E-04 8.25633236E-19 1.46474602E-03 0.00000000E+00-7.56150963E-04 + 0.00000000E+00 5.30295064E-04-1.21786742E-18-2.82095725E-04 8.25633236E-19 + 6.86869346E-07 5.23105304E-21 4.05090022E-09 3.25265280E-23-1.08624704E-04 + 0.00000000E+00-6.49517827E-07 0.00000000E+00-3.50043425E-08-2.49186357E-14 + 0.00000000E+00-4.27710347E-14-3.50043425E-08-2.49186357E-14 0.00000000E+00 +-4.27710347E-14 3.17368784E-07 2.91936120E-21-8.46546673E-09-8.02724933E-23 +-6.44105717E-06 0.00000000E+00 1.68348993E-06 0.00000000E+00 1.67594304E-05 + 5.67257666E-11-6.93257784E-08-5.40684513E-14 0.00000000E+00 6.65312373E-11 + 0.00000000E+00-8.79480904E-14 1.67594304E-05 5.67257666E-11-6.93257784E-08 +-5.40684513E-14 0.00000000E+00 6.65312373E-11 0.00000000E+00-8.79480904E-14 +-3.69502373E-07-2.86626192E-21 2.28474333E-09 1.87626260E-23 1.02178883E-04 + 0.00000000E+00-6.13650719E-07 0.00000000E+00-1.75914525E-05-5.73742138E-11 +-3.43308526E-08-2.90466746E-14 0.00000000E+00-6.75867093E-11 0.00000000E+00 +-4.51514036E-14-1.75914525E-05-5.73742138E-11-3.43308526E-08-2.90466746E-14 + 0.00000000E+00-6.75867093E-11 0.00000000E+00-4.51514036E-14-1.08107595E-04 +-8.66002379E-19-6.64939836E-07-5.60555578E-21 1.73350316E-02 0.00000000E+00 + 1.08133195E-04 0.00000000E+00 1.68067231E-04 5.50908790E-10 0.00000000E+00 + 6.48720455E-10 1.68067231E-04 5.50908790E-10 0.00000000E+00 6.48720455E-10 +-4.90265188E-04-5.25884635E-18 3.17368784E-07 2.91936120E-21 9.73185643E-02 + 0.00000000E+00-6.44105717E-06 0.00000000E+00-3.23744248E-03-1.09292286E-08 +-3.63786209E-03-1.20797445E-08 0.00000000E+00-1.28225002E-08 0.00000000E+00 +-1.42005171E-08-3.23744248E-03-1.09292286E-08-3.63786209E-03-1.20797445E-08 + 0.00000000E+00-1.28225002E-08 0.00000000E+00-1.42005171E-08-6.09715301E-05 +-5.02490754E-19 3.92910811E-07 3.41022484E-21 1.63778388E-02 0.00000000E+00 +-1.02609748E-04 0.00000000E+00-3.37628133E-03-1.10374652E-08 1.62727721E-04 + 5.46758413E-10 0.00000000E+00-1.29986524E-08 0.00000000E+00 6.41952276E-10 +-3.37628133E-03-1.10374652E-08 1.62727721E-04 5.46758413E-10 0.00000000E+00 +-1.29986524E-08 0.00000000E+00 6.41952276E-10-1.08624704E-04 0.00000000E+00 +-6.49517827E-07 0.00000000E+00 6.86869346E-07-5.23105304E-21 4.05090022E-09 +-3.25265280E-23 0.00000000E+00-4.27710347E-14 3.50043425E-08-2.49186357E-14 + 0.00000000E+00-4.27710347E-14 3.50043425E-08-2.49186357E-14-6.44105717E-06 + 0.00000000E+00 1.68348993E-06 0.00000000E+00 3.17368784E-07-2.91936120E-21 +-8.46546673E-09 8.02724933E-23 0.00000000E+00 6.65312373E-11 0.00000000E+00 +-8.79480904E-14-1.67594304E-05 5.67257666E-11 6.93257784E-08-5.40684513E-14 + 0.00000000E+00 6.65312373E-11 0.00000000E+00-8.79480904E-14-1.67594304E-05 + 5.67257666E-11 6.93257784E-08-5.40684513E-14 1.02178883E-04 0.00000000E+00 +-6.13650719E-07 0.00000000E+00-3.69502373E-07 2.86626192E-21 2.28474333E-09 +-1.87626260E-23 0.00000000E+00-6.75867093E-11 0.00000000E+00-4.51514036E-14 + 1.75914525E-05-5.73742138E-11 3.43308526E-08-2.90466746E-14 0.00000000E+00 +-6.75867093E-11 0.00000000E+00-4.51514036E-14 1.75914525E-05-5.73742138E-11 + 3.43308526E-08-2.90466746E-14 3.37628133E-03 1.10374652E-08 1.75914525E-05 + 5.73742138E-11 0.00000000E+00 1.29986524E-08 0.00000000E+00 6.75867093E-11 + 5.30295064E-04 1.21786742E-18 1.46474602E-03 0.00000000E+00 3.08938568E-02 + 5.42604561E-17 1.34062038E-01 0.00000000E+00 3.42387044E-03 1.10777263E-08 +-1.77287759E-05-5.74904005E-11 0.00000000E+00 1.30612394E-08 0.00000000E+00 +-6.77673149E-11 4.51239745E-03 1.33834824E-17 5.98087834E-04 2.08466552E-18 + 1.20982350E-02 0.00000000E+00 1.55985783E-03 0.00000000E+00 2.47380666E-01 + 7.57200916E-16 3.09515449E-02 1.33598291E-16 1.04119002E+00 0.00000000E+00 + 1.26303280E-01 0.00000000E+00 0.00000000E+00 1.29986524E-08 0.00000000E+00 + 6.75867093E-11-3.37628133E-03 1.10374652E-08-1.75914525E-05 5.73742138E-11 + 1.46474602E-03 0.00000000E+00 5.30295064E-04-1.21786742E-18 1.46474602E-03 + 0.00000000E+00 5.30295064E-04-1.21786742E-18 0.00000000E+00 1.30612394E-08 + 0.00000000E+00-6.77673149E-11-3.42387044E-03 1.10777263E-08 1.77287759E-05 +-5.74904005E-11 1.20982350E-02 0.00000000E+00 1.55985783E-03 0.00000000E+00 + 4.51239745E-03-1.33834824E-17 5.98087834E-04-2.08466552E-18 1.20982350E-02 + 0.00000000E+00 1.55985783E-03 0.00000000E+00 4.51239745E-03-1.33834824E-17 + 5.98087834E-04-2.08466552E-18 3.37628133E-03 1.10374652E-08 1.75914525E-05 + 5.73742138E-11 0.00000000E+00 1.29986524E-08 0.00000000E+00 6.75867093E-11 + 5.30295064E-04 1.21786742E-18 1.46474602E-03 0.00000000E+00 5.30295064E-04 + 1.21786742E-18 1.46474602E-03 0.00000000E+00 3.42387044E-03 1.10777263E-08 +-1.77287759E-05-5.74904005E-11 0.00000000E+00 1.30612394E-08 0.00000000E+00 +-6.77673149E-11 4.51239745E-03 1.33834824E-17 5.98087834E-04 2.08466552E-18 + 1.20982350E-02 0.00000000E+00 1.55985783E-03 0.00000000E+00 4.51239745E-03 + 1.33834824E-17 5.98087834E-04 2.08466552E-18 1.20982350E-02 0.00000000E+00 + 1.55985783E-03 0.00000000E+00 0.00000000E+00 1.29986524E-08 0.00000000E+00 + 6.75867093E-11-3.37628133E-03 1.10374652E-08-1.75914525E-05 5.73742138E-11 + 1.46474602E-03 0.00000000E+00 5.30295064E-04-1.21786742E-18 1.34062038E-01 + 0.00000000E+00 3.08938568E-02-5.42604561E-17 0.00000000E+00 1.30612394E-08 + 0.00000000E+00-6.77673149E-11-3.42387044E-03 1.10777263E-08 1.77287759E-05 +-5.74904005E-11 1.20982350E-02 0.00000000E+00 1.55985783E-03 0.00000000E+00 + 4.51239745E-03-1.33834824E-17 5.98087834E-04-2.08466552E-18 1.04119002E+00 + 0.00000000E+00 1.26303280E-01 0.00000000E+00 2.47380666E-01-7.57200916E-16 + 3.09515449E-02-1.33598291E-16 3.73933855E-03 1.13841572E-08 1.94746300E-05 + 5.91857201E-11 0.00000000E+00 1.35042826E-08 0.00000000E+00 7.02187729E-11 + 6.69836861E-04 2.25684001E-18 1.65560763E-03 0.00000000E+00 3.10123216E-02 + 1.06033020E-16 1.19426488E-01 0.00000000E+00 3.78481071E-03 1.14339307E-08 +-1.96058431E-05-5.93293506E-11 0.00000000E+00 1.35721818E-08 0.00000000E+00 +-7.04147030E-11 5.66029950E-03 2.01820988E-17 7.45517793E-04 2.53812162E-18 + 1.36304698E-02 0.00000000E+00 1.75206054E-03 0.00000000E+00 2.48354458E-01 + 6.41248053E-16 3.10765226E-02 5.64284492E-17 9.30592878E-01 0.00000000E+00 + 1.13269851E-01 0.00000000E+00 3.55985759E-03 1.12014449E-08 1.85437037E-05 + 5.82316456E-11 0.00000000E+00 1.32462245E-08 0.00000000E+00 6.88757290E-11 + 5.98087376E-04 1.97210373E-18 1.55985140E-03 0.00000000E+00 3.09514547E-02 + 1.35474268E-16 1.26310204E-01 0.00000000E+00 3.60640812E-03 1.12467354E-08 +-1.86780274E-05-5.83623424E-11 0.00000000E+00 1.33116495E-08 0.00000000E+00 +-6.90645216E-11 5.07057202E-03 1.54542871E-17 6.69837368E-04 1.97333379E-18 + 1.28616713E-02 0.00000000E+00 1.65561435E-03 0.00000000E+00 2.47854532E-01 + 1.01235124E-15 3.10124112E-02 1.11524575E-16 9.82697582E-01 0.00000000E+00 + 1.19421035E-01 0.00000000E+00 0.00000000E+00 1.32462245E-08 0.00000000E+00 + 6.88757290E-11-3.55985759E-03 1.12014449E-08-1.85437037E-05 5.82316456E-11 + 1.55985140E-03 0.00000000E+00 5.98087376E-04-1.97210373E-18 1.55985140E-03 + 0.00000000E+00 5.98087376E-04-1.97210373E-18 0.00000000E+00 1.33116495E-08 + 0.00000000E+00-6.90645216E-11-3.60640812E-03 1.12467354E-08 1.86780274E-05 +-5.83623424E-11 1.28616713E-02 0.00000000E+00 1.65561435E-03 0.00000000E+00 + 5.07057202E-03-1.54542871E-17 6.69837368E-04-1.97333379E-18 1.28616713E-02 + 0.00000000E+00 1.65561435E-03 0.00000000E+00 5.07057202E-03-1.54542871E-17 + 6.69837368E-04-1.97333379E-18 3.55985759E-03 1.12014449E-08 1.85437037E-05 + 5.82316456E-11 0.00000000E+00 1.32462245E-08 0.00000000E+00 6.88757290E-11 + 5.98087376E-04 1.97210373E-18 1.55985140E-03 0.00000000E+00 5.98087376E-04 + 1.97210373E-18 1.55985140E-03 0.00000000E+00 3.60640812E-03 1.12467354E-08 +-1.86780274E-05-5.83623424E-11 0.00000000E+00 1.33116495E-08 0.00000000E+00 +-6.90645216E-11 5.07057202E-03 1.54542871E-17 6.69837368E-04 1.97333379E-18 + 1.28616713E-02 0.00000000E+00 1.65561435E-03 0.00000000E+00 5.07057202E-03 + 1.54542871E-17 6.69837368E-04 1.97333379E-18 1.28616713E-02 0.00000000E+00 + 1.65561435E-03 0.00000000E+00 0.00000000E+00 1.32462245E-08 0.00000000E+00 + 6.88757290E-11-3.55985759E-03 1.12014449E-08-1.85437037E-05 5.82316456E-11 + 1.55985140E-03 0.00000000E+00 5.98087376E-04-1.97210373E-18 1.26310204E-01 + 0.00000000E+00 3.09514547E-02-1.35474268E-16 0.00000000E+00 1.33116495E-08 + 0.00000000E+00-6.90645216E-11-3.60640812E-03 1.12467354E-08 1.86780274E-05 +-5.83623424E-11 1.28616713E-02 0.00000000E+00 1.65561435E-03 0.00000000E+00 + 5.07057202E-03-1.54542871E-17 6.69837368E-04-1.97333379E-18 9.82697582E-01 + 0.00000000E+00 1.19421035E-01 0.00000000E+00 2.47854532E-01-1.01235124E-15 + 3.10124112E-02-1.11524575E-16 1.63778388E-02 0.00000000E+00 1.02178883E-04 + 0.00000000E+00-6.09715301E-05 5.02490754E-19-3.69502373E-07 2.86626192E-21 + 0.00000000E+00 6.61076235E-10-1.77268886E-04 5.59060630E-10 0.00000000E+00 + 6.61076235E-10-1.77268886E-04 5.59060630E-10 9.21332007E-02 0.00000000E+00 +-5.66664573E-06 0.00000000E+00-2.09091798E-04 1.74733010E-18 3.37839566E-07 + 1.12619249E-21 0.00000000E+00-1.30612394E-08 0.00000000E+00-1.44681447E-08 + 3.42387044E-03-1.10777263E-08 3.84140447E-03-1.22518416E-08 0.00000000E+00 +-1.30612394E-08 0.00000000E+00-1.44681447E-08 3.42387044E-03-1.10777263E-08 + 3.84140447E-03-1.22518416E-08 1.55357984E-02 0.00000000E+00-9.73198184E-05 + 0.00000000E+00-1.07934970E-05 6.25493877E-19 7.99209911E-08-3.63139980E-21 + 0.00000000E+00-1.32462245E-08 0.00000000E+00 6.53965997E-10 3.55985759E-03 +-1.12014449E-08-1.72038893E-04 5.54311349E-10 0.00000000E+00-1.32462245E-08 + 0.00000000E+00 6.53965997E-10 3.55985759E-03-1.12014449E-08-1.72038893E-04 + 5.54311349E-10-1.62727721E-04-5.46758413E-10 3.43308526E-08 2.90466746E-14 + 0.00000000E+00-6.41952276E-10 0.00000000E+00 4.51514036E-14-2.82095725E-04 +-8.25633236E-19-7.56150963E-04 0.00000000E+00-1.54613504E-02-4.69646868E-17 +-6.50913295E-02 0.00000000E+00 3.84140447E-03 1.22518416E-08 6.78993153E-08 + 6.17814029E-14 0.00000000E+00 1.44681447E-08 0.00000000E+00 9.23457622E-14 + 5.98087834E-04 2.08466552E-18 2.39376366E-03 7.82764522E-18 1.55985783E-03 + 0.00000000E+00 6.23965101E-03 0.00000000E+00 3.09515449E-02 1.33598291E-16 + 1.23807167E-01 5.02230023E-16 1.26303280E-01 0.00000000E+00 5.05537532E-01 + 0.00000000E+00-1.86262667E-04-5.68150309E-10 3.35809077E-08 3.26742122E-14 + 0.00000000E+00-6.73957080E-10 0.00000000E+00 4.71981452E-14 5.98087376E-04 + 1.97210373E-18-3.16981186E-04-9.86359380E-19 1.55985140E-03 0.00000000E+00 +-8.03866436E-04 0.00000000E+00 3.09514547E-02 1.35474268E-16-1.54909665E-02 +-6.17497107E-17 1.26310204E-01 0.00000000E+00-6.14328097E-02 0.00000000E+00 + 0.00000000E+00-6.41952276E-10 0.00000000E+00 4.51514036E-14 1.62727721E-04 +-5.46758413E-10-3.43308526E-08 2.90466746E-14-7.56150963E-04 0.00000000E+00 +-2.82095725E-04 8.25633236E-19-6.50913295E-02 0.00000000E+00-1.54613504E-02 + 4.69646868E-17 0.00000000E+00 1.44681447E-08 0.00000000E+00 9.23457622E-14 +-3.84140447E-03 1.22518416E-08-6.78993153E-08 6.17814029E-14 1.55985783E-03 + 0.00000000E+00 6.23965101E-03 0.00000000E+00 5.98087834E-04-2.08466552E-18 + 2.39376366E-03-7.82764522E-18 1.26303280E-01 0.00000000E+00 5.05537532E-01 + 0.00000000E+00 3.09515449E-02-1.33598291E-16 1.23807167E-01-5.02230023E-16 + 0.00000000E+00-6.73957080E-10 0.00000000E+00 4.71981452E-14 1.86262667E-04 +-5.68150309E-10-3.35809077E-08 3.26742122E-14 1.55985140E-03 0.00000000E+00 +-8.03866436E-04 0.00000000E+00 5.98087376E-04-1.97210373E-18-3.16981186E-04 + 9.86359380E-19 1.26310204E-01 0.00000000E+00-6.14328097E-02 0.00000000E+00 + 3.09514547E-02-1.35474268E-16-1.54909665E-02 6.17497107E-17-1.62727721E-04 +-5.46758413E-10 3.43308526E-08 2.90466746E-14 0.00000000E+00-6.41952276E-10 + 0.00000000E+00 4.51514036E-14-2.82095725E-04-8.25633236E-19-7.56150963E-04 + 0.00000000E+00-2.82095725E-04-8.25633236E-19-7.56150963E-04 0.00000000E+00 + 3.84140447E-03 1.22518416E-08 6.78993153E-08 6.17814029E-14 0.00000000E+00 + 1.44681447E-08 0.00000000E+00 9.23457622E-14 5.98087834E-04 2.08466552E-18 + 2.39376366E-03 7.82764522E-18 1.55985783E-03 0.00000000E+00 6.23965101E-03 + 0.00000000E+00 5.98087834E-04 2.08466552E-18 2.39376366E-03 7.82764522E-18 + 1.55985783E-03 0.00000000E+00 6.23965101E-03 0.00000000E+00-1.86262667E-04 +-5.68150309E-10 3.35809077E-08 3.26742122E-14 0.00000000E+00-6.73957080E-10 + 0.00000000E+00 4.71981452E-14 5.98087376E-04 1.97210373E-18-3.16981186E-04 +-9.86359380E-19 1.55985140E-03 0.00000000E+00-8.03866436E-04 0.00000000E+00 + 5.98087376E-04 1.97210373E-18-3.16981186E-04-9.86359380E-19 1.55985140E-03 + 0.00000000E+00-8.03866436E-04 0.00000000E+00 0.00000000E+00-6.41952276E-10 + 0.00000000E+00 4.51514036E-14 1.62727721E-04-5.46758413E-10-3.43308526E-08 + 2.90466746E-14-7.56150963E-04 0.00000000E+00-2.82095725E-04 8.25633236E-19 +-7.56150963E-04 0.00000000E+00-2.82095725E-04 8.25633236E-19 0.00000000E+00 + 1.44681447E-08 0.00000000E+00 9.23457622E-14-3.84140447E-03 1.22518416E-08 +-6.78993153E-08 6.17814029E-14 1.55985783E-03 0.00000000E+00 6.23965101E-03 + 0.00000000E+00 5.98087834E-04-2.08466552E-18 2.39376366E-03-7.82764522E-18 + 1.55985783E-03 0.00000000E+00 6.23965101E-03 0.00000000E+00 5.98087834E-04 +-2.08466552E-18 2.39376366E-03-7.82764522E-18 0.00000000E+00-6.73957080E-10 + 0.00000000E+00 4.71981452E-14 1.86262667E-04-5.68150309E-10-3.35809077E-08 + 3.26742122E-14 1.55985140E-03 0.00000000E+00-8.03866436E-04 0.00000000E+00 + 5.98087376E-04-1.97210373E-18-3.16981186E-04 9.86359380E-19 1.55985140E-03 + 0.00000000E+00-8.03866436E-04 0.00000000E+00 5.98087376E-04-1.97210373E-18 +-3.16981186E-04 9.86359380E-19 3.92910811E-07 3.41022484E-21 2.28474333E-09 + 1.87626260E-23-1.02609748E-04 0.00000000E+00-6.13650719E-07 0.00000000E+00 +-3.43308526E-08-2.90466746E-14 0.00000000E+00-4.51514036E-14-3.43308526E-08 +-2.90466746E-14 0.00000000E+00-4.51514036E-14 3.37839566E-07-1.12619249E-21 +-3.60338404E-09-4.21931663E-23-5.66664573E-06 0.00000000E+00 1.59372021E-06 + 0.00000000E+00 1.77287759E-05 5.74904005E-11-6.78993153E-08-6.17814029E-14 + 0.00000000E+00 6.77673149E-11 0.00000000E+00-9.23457622E-14 1.77287759E-05 + 5.74904005E-11-6.78993153E-08-6.17814029E-14 0.00000000E+00 6.77673149E-11 + 0.00000000E+00-9.23457622E-14-5.50629385E-08-4.18819921E-21 4.04629904E-10 + 2.34209122E-23 9.69394486E-05 0.00000000E+00-5.82098282E-07 0.00000000E+00 +-1.85437037E-05-5.82316456E-11-3.35809077E-08-3.26742122E-14 0.00000000E+00 +-6.88757290E-11 0.00000000E+00-4.71981452E-14-1.85437037E-05-5.82316456E-11 +-3.35809077E-08-3.26742122E-14 0.00000000E+00-6.88757290E-11 0.00000000E+00 +-4.71981452E-14-6.09715301E-05-5.02490754E-19-3.69502373E-07-2.86626192E-21 + 1.63778388E-02 0.00000000E+00 1.02178883E-04 0.00000000E+00 1.77268886E-04 + 5.59060630E-10 0.00000000E+00 6.61076235E-10 1.77268886E-04 5.59060630E-10 + 0.00000000E+00 6.61076235E-10-2.09091798E-04-1.74733010E-18 3.37839566E-07 +-1.12619249E-21 9.21332007E-02 0.00000000E+00-5.66664573E-06 0.00000000E+00 +-3.42387044E-03-1.10777263E-08-3.84140447E-03-1.22518416E-08 0.00000000E+00 +-1.30612394E-08 0.00000000E+00-1.44681447E-08-3.42387044E-03-1.10777263E-08 +-3.84140447E-03-1.22518416E-08 0.00000000E+00-1.30612394E-08 0.00000000E+00 +-1.44681447E-08-1.07934970E-05-6.25493877E-19 7.99209911E-08 3.63139980E-21 + 1.55357984E-02 0.00000000E+00-9.73198184E-05 0.00000000E+00-3.55985759E-03 +-1.12014449E-08 1.72038893E-04 5.54311349E-10 0.00000000E+00-1.32462245E-08 + 0.00000000E+00 6.53965997E-10-3.55985759E-03-1.12014449E-08 1.72038893E-04 + 5.54311349E-10 0.00000000E+00-1.32462245E-08 0.00000000E+00 6.53965997E-10 +-1.02609748E-04 0.00000000E+00-6.13650719E-07 0.00000000E+00 3.92910811E-07 +-3.41022484E-21 2.28474333E-09-1.87626260E-23 0.00000000E+00-4.51514036E-14 + 3.43308526E-08-2.90466746E-14 0.00000000E+00-4.51514036E-14 3.43308526E-08 +-2.90466746E-14-5.66664573E-06 0.00000000E+00 1.59372021E-06 0.00000000E+00 + 3.37839566E-07 1.12619249E-21-3.60338404E-09 4.21931663E-23 0.00000000E+00 + 6.77673149E-11 0.00000000E+00-9.23457622E-14-1.77287759E-05 5.74904005E-11 + 6.78993153E-08-6.17814029E-14 0.00000000E+00 6.77673149E-11 0.00000000E+00 +-9.23457622E-14-1.77287759E-05 5.74904005E-11 6.78993153E-08-6.17814029E-14 + 9.69394486E-05 0.00000000E+00-5.82098282E-07 0.00000000E+00-5.50629385E-08 + 4.18819921E-21 4.04629904E-10-2.34209122E-23 0.00000000E+00-6.88757290E-11 + 0.00000000E+00-4.71981452E-14 1.85437037E-05-5.82316456E-11 3.35809077E-08 +-3.26742122E-14 0.00000000E+00-6.88757290E-11 0.00000000E+00-4.71981452E-14 + 1.85437037E-05-5.82316456E-11 3.35809077E-08-3.26742122E-14 1.55357984E-02 + 0.00000000E+00 9.69394486E-05 0.00000000E+00-1.07934970E-05 6.25493877E-19 +-5.50629385E-08 4.18819921E-21 0.00000000E+00 6.73957080E-10-1.86262667E-04 + 5.68150309E-10 0.00000000E+00 6.73957080E-10-1.86262667E-04 5.68150309E-10 + 8.75564702E-02 0.00000000E+00-5.01768613E-06 0.00000000E+00 8.96015981E-05 + 6.05671826E-18 3.58415057E-07 3.62204566E-21 0.00000000E+00-1.33116495E-08 + 0.00000000E+00-1.47479251E-08 3.60640812E-03-1.12467354E-08 4.04052513E-03 +-1.24454730E-08 0.00000000E+00-1.33116495E-08 0.00000000E+00-1.47479251E-08 + 3.60640812E-03-1.12467354E-08 4.04052513E-03-1.24454730E-08 1.47902400E-02 + 0.00000000E+00-9.26370669E-05 0.00000000E+00 4.24401357E-05 1.09801840E-18 +-2.52151547E-07-7.01480269E-21 0.00000000E+00-1.35042826E-08 0.00000000E+00 + 6.66550967E-10 3.73933855E-03-1.13841572E-08-1.81150365E-04 5.62871447E-10 + 0.00000000E+00-1.35042826E-08 0.00000000E+00 6.66550967E-10 3.73933855E-03 +-1.13841572E-08-1.81150365E-04 5.62871447E-10-1.72038893E-04-5.54311349E-10 + 3.35809077E-08 3.26742122E-14 0.00000000E+00-6.53965997E-10 0.00000000E+00 + 4.71981452E-14-3.16981186E-04-9.86359380E-19-8.03866436E-04 0.00000000E+00 +-1.54909665E-02-6.17497107E-17-6.14328097E-02 0.00000000E+00 4.04052513E-03 + 1.24454730E-08 6.63726649E-08 6.86107824E-14 0.00000000E+00 1.47479251E-08 + 0.00000000E+00 9.61548650E-14 6.69837368E-04 1.97333379E-18 2.68075234E-03 + 8.53759535E-18 1.65561435E-03 0.00000000E+00 6.62269041E-03 0.00000000E+00 + 3.10124112E-02 1.11524575E-16 1.24050624E-01 4.25956419E-16 1.19421035E-01 + 0.00000000E+00 4.77956660E-01 0.00000000E+00-1.95044666E-04-5.78080161E-10 + 3.28032585E-08 3.59076205E-14 0.00000000E+00-6.87298010E-10 0.00000000E+00 + 4.89825262E-14 6.69836861E-04 2.25684001E-18-3.53838664E-04-1.19874041E-18 + 1.65560763E-03 0.00000000E+00-8.51917043E-04 0.00000000E+00 3.10123216E-02 + 1.06033020E-16-1.55222111E-02-4.06153673E-17 1.19426488E-01 0.00000000E+00 +-5.81740847E-02 0.00000000E+00 0.00000000E+00-6.53965997E-10 0.00000000E+00 + 4.71981452E-14 1.72038893E-04-5.54311349E-10-3.35809077E-08 3.26742122E-14 +-8.03866436E-04 0.00000000E+00-3.16981186E-04 9.86359380E-19-6.14328097E-02 + 0.00000000E+00-1.54909665E-02 6.17497107E-17 0.00000000E+00 1.47479251E-08 + 0.00000000E+00 9.61548650E-14-4.04052513E-03 1.24454730E-08-6.63726649E-08 + 6.86107824E-14 1.65561435E-03 0.00000000E+00 6.62269041E-03 0.00000000E+00 + 6.69837368E-04-1.97333379E-18 2.68075234E-03-8.53759535E-18 1.19421035E-01 + 0.00000000E+00 4.77956660E-01 0.00000000E+00 3.10124112E-02-1.11524575E-16 + 1.24050624E-01-4.25956419E-16 0.00000000E+00-6.87298010E-10 0.00000000E+00 + 4.89825262E-14 1.95044666E-04-5.78080161E-10-3.28032585E-08 3.59076205E-14 + 1.65560763E-03 0.00000000E+00-8.51917043E-04 0.00000000E+00 6.69836861E-04 +-2.25684001E-18-3.53838664E-04 1.19874041E-18 1.19426488E-01 0.00000000E+00 +-5.81740847E-02 0.00000000E+00 3.10123216E-02-1.06033020E-16-1.55222111E-02 + 4.06153673E-17-1.72038893E-04-5.54311349E-10 3.35809077E-08 3.26742122E-14 + 0.00000000E+00-6.53965997E-10 0.00000000E+00 4.71981452E-14-3.16981186E-04 +-9.86359380E-19-8.03866436E-04 0.00000000E+00-3.16981186E-04-9.86359380E-19 +-8.03866436E-04 0.00000000E+00 4.04052513E-03 1.24454730E-08 6.63726649E-08 + 6.86107824E-14 0.00000000E+00 1.47479251E-08 0.00000000E+00 9.61548650E-14 + 6.69837368E-04 1.97333379E-18 2.68075234E-03 8.53759535E-18 1.65561435E-03 + 0.00000000E+00 6.62269041E-03 0.00000000E+00 6.69837368E-04 1.97333379E-18 + 2.68075234E-03 8.53759535E-18 1.65561435E-03 0.00000000E+00 6.62269041E-03 + 0.00000000E+00-1.95044666E-04-5.78080161E-10 3.28032585E-08 3.59076205E-14 + 0.00000000E+00-6.87298010E-10 0.00000000E+00 4.89825262E-14 6.69836861E-04 + 2.25684001E-18-3.53838664E-04-1.19874041E-18 1.65560763E-03 0.00000000E+00 +-8.51917043E-04 0.00000000E+00 6.69836861E-04 2.25684001E-18-3.53838664E-04 +-1.19874041E-18 1.65560763E-03 0.00000000E+00-8.51917043E-04 0.00000000E+00 + 0.00000000E+00-6.53965997E-10 0.00000000E+00 4.71981452E-14 1.72038893E-04 +-5.54311349E-10-3.35809077E-08 3.26742122E-14-8.03866436E-04 0.00000000E+00 +-3.16981186E-04 9.86359380E-19-8.03866436E-04 0.00000000E+00-3.16981186E-04 + 9.86359380E-19 0.00000000E+00 1.47479251E-08 0.00000000E+00 9.61548650E-14 +-4.04052513E-03 1.24454730E-08-6.63726649E-08 6.86107824E-14 1.65561435E-03 + 0.00000000E+00 6.62269041E-03 0.00000000E+00 6.69837368E-04-1.97333379E-18 + 2.68075234E-03-8.53759535E-18 1.65561435E-03 0.00000000E+00 6.62269041E-03 + 0.00000000E+00 6.69837368E-04-1.97333379E-18 2.68075234E-03-8.53759535E-18 + 0.00000000E+00-6.87298010E-10 0.00000000E+00 4.89825262E-14 1.95044666E-04 +-5.78080161E-10-3.28032585E-08 3.59076205E-14 1.65560763E-03 0.00000000E+00 +-8.51917043E-04 0.00000000E+00 6.69836861E-04-2.25684001E-18-3.53838664E-04 + 1.19874041E-18 1.65560763E-03 0.00000000E+00-8.51917043E-04 0.00000000E+00 + 6.69836861E-04-2.25684001E-18-3.53838664E-04 1.19874041E-18 7.99209911E-08 + 3.63139980E-21 4.04629904E-10 2.34209122E-23-9.73198184E-05 0.00000000E+00 +-5.82098282E-07 0.00000000E+00-3.35809077E-08-3.26742122E-14 0.00000000E+00 +-4.71981452E-14-3.35809077E-08-3.26742122E-14 0.00000000E+00-4.71981452E-14 + 3.58415057E-07-3.62204566E-21 1.56239093E-09-9.67273515E-23-5.01768613E-06 + 0.00000000E+00 1.51449637E-06 0.00000000E+00 1.86780274E-05 5.83623424E-11 +-6.63726649E-08-6.86107824E-14 0.00000000E+00 6.90645216E-11 0.00000000E+00 +-9.61548650E-14 1.86780274E-05 5.83623424E-11-6.63726649E-08-6.86107824E-14 + 0.00000000E+00 6.90645216E-11 0.00000000E+00-9.61548650E-14 2.78497228E-07 +-6.73284424E-21-1.58994964E-09 4.13167003E-23 9.22992794E-05 0.00000000E+00 +-5.54160978E-07 0.00000000E+00-1.94746300E-05-5.91857201E-11-3.28032585E-08 +-3.59076205E-14 0.00000000E+00-7.02187729E-11 0.00000000E+00-4.89825262E-14 +-1.94746300E-05-5.91857201E-11-3.28032585E-08-3.59076205E-14 0.00000000E+00 +-7.02187729E-11 0.00000000E+00-4.89825262E-14-1.07934970E-05-6.25493877E-19 +-5.50629385E-08-4.18819921E-21 1.55357984E-02 0.00000000E+00 9.69394486E-05 + 0.00000000E+00 1.86262667E-04 5.68150309E-10 0.00000000E+00 6.73957080E-10 + 1.86262667E-04 5.68150309E-10 0.00000000E+00 6.73957080E-10 8.96015981E-05 +-6.05671826E-18 3.58415057E-07-3.62204566E-21 8.75564702E-02 0.00000000E+00 +-5.01768613E-06 0.00000000E+00-3.60640812E-03-1.12467354E-08-4.04052513E-03 +-1.24454730E-08 0.00000000E+00-1.33116495E-08 0.00000000E+00-1.47479251E-08 +-3.60640812E-03-1.12467354E-08-4.04052513E-03-1.24454730E-08 0.00000000E+00 +-1.33116495E-08 0.00000000E+00-1.47479251E-08 4.24401357E-05-1.09801840E-18 +-2.52151547E-07 7.01480269E-21 1.47902400E-02 0.00000000E+00-9.26370669E-05 + 0.00000000E+00-3.73933855E-03-1.13841572E-08 1.81150365E-04 5.62871447E-10 + 0.00000000E+00-1.35042826E-08 0.00000000E+00 6.66550967E-10-3.73933855E-03 +-1.13841572E-08 1.81150365E-04 5.62871447E-10 0.00000000E+00-1.35042826E-08 + 0.00000000E+00 6.66550967E-10-9.73198184E-05 0.00000000E+00-5.82098282E-07 + 0.00000000E+00 7.99209911E-08-3.63139980E-21 4.04629904E-10-2.34209122E-23 + 0.00000000E+00-4.71981452E-14 3.35809077E-08-3.26742122E-14 0.00000000E+00 +-4.71981452E-14 3.35809077E-08-3.26742122E-14-5.01768613E-06 0.00000000E+00 + 1.51449637E-06 0.00000000E+00 3.58415057E-07 3.62204566E-21 1.56239093E-09 + 9.67273515E-23 0.00000000E+00 6.90645216E-11 0.00000000E+00-9.61548650E-14 +-1.86780274E-05 5.83623424E-11 6.63726649E-08-6.86107824E-14 0.00000000E+00 + 6.90645216E-11 0.00000000E+00-9.61548650E-14-1.86780274E-05 5.83623424E-11 + 6.63726649E-08-6.86107824E-14 9.22992794E-05 0.00000000E+00-5.54160978E-07 + 0.00000000E+00 2.78497228E-07 6.73284424E-21-1.58994964E-09-4.13167003E-23 + 0.00000000E+00-7.02187729E-11 0.00000000E+00-4.89825262E-14 1.94746300E-05 +-5.91857201E-11 3.28032585E-08-3.59076205E-14 0.00000000E+00-7.02187729E-11 + 0.00000000E+00-4.89825262E-14 1.94746300E-05-5.91857201E-11 3.28032585E-08 +-3.59076205E-14 0.00000000E+00 1.35042826E-08 0.00000000E+00 7.02187729E-11 +-3.73933855E-03 1.13841572E-08-1.94746300E-05 5.91857201E-11 1.65560763E-03 + 0.00000000E+00 6.69836861E-04-2.25684001E-18 1.65560763E-03 0.00000000E+00 + 6.69836861E-04-2.25684001E-18 0.00000000E+00 1.35721818E-08 0.00000000E+00 +-7.04147030E-11-3.78481071E-03 1.14339307E-08 1.96058431E-05-5.93293506E-11 + 1.36304698E-02 0.00000000E+00 1.75206054E-03 0.00000000E+00 5.66029950E-03 +-2.01820988E-17 7.45517793E-04-2.53812162E-18 1.36304698E-02 0.00000000E+00 + 1.75206054E-03 0.00000000E+00 5.66029950E-03-2.01820988E-17 7.45517793E-04 +-2.53812162E-18 3.73933855E-03 1.13841572E-08 1.94746300E-05 5.91857201E-11 + 0.00000000E+00 1.35042826E-08 0.00000000E+00 7.02187729E-11 6.69836861E-04 + 2.25684001E-18 1.65560763E-03 0.00000000E+00 6.69836861E-04 2.25684001E-18 + 1.65560763E-03 0.00000000E+00 3.78481071E-03 1.14339307E-08-1.96058431E-05 +-5.93293506E-11 0.00000000E+00 1.35721818E-08 0.00000000E+00-7.04147030E-11 + 5.66029950E-03 2.01820988E-17 7.45517793E-04 2.53812162E-18 1.36304698E-02 + 0.00000000E+00 1.75206054E-03 0.00000000E+00 5.66029950E-03 2.01820988E-17 + 7.45517793E-04 2.53812162E-18 1.36304698E-02 0.00000000E+00 1.75206054E-03 + 0.00000000E+00 0.00000000E+00 1.35042826E-08 0.00000000E+00 7.02187729E-11 +-3.73933855E-03 1.13841572E-08-1.94746300E-05 5.91857201E-11 1.65560763E-03 + 0.00000000E+00 6.69836861E-04-2.25684001E-18 1.19426488E-01 0.00000000E+00 + 3.10123216E-02-1.06033020E-16 0.00000000E+00 1.35721818E-08 0.00000000E+00 +-7.04147030E-11-3.78481071E-03 1.14339307E-08 1.96058431E-05-5.93293506E-11 + 1.36304698E-02 0.00000000E+00 1.75206054E-03 0.00000000E+00 5.66029950E-03 +-2.01820988E-17 7.45517793E-04-2.53812162E-18 9.30592878E-01 0.00000000E+00 + 1.13269851E-01 0.00000000E+00 2.48354458E-01-6.41248053E-16 3.10765226E-02 +-5.64284492E-17 6.50928138E-03 0.00000000E+00 3.06365241E-05 0.00000000E+00 + 1.31230169E-03-4.87650804E-18 6.19138708E-06-2.29843270E-20 0.00000000E+00 +-1.24827704E-10-2.29265257E-04-1.07197462E-10 0.00000000E+00-1.24827704E-10 +-2.29265257E-04-1.07197462E-10 1.87512929E-02 0.00000000E+00-5.17679706E-05 + 0.00000000E+00 3.84441653E-03-1.41688665E-17-1.05560173E-05 3.90219168E-20 + 0.00000000E+00-4.87166607E-09 0.00000000E+00-9.38462609E-10 4.57061742E-03 +-4.14102755E-09 2.51683468E-03-7.96052301E-10 0.00000000E+00-4.87166607E-09 + 0.00000000E+00-9.38462609E-10 4.57061742E-03-4.14102755E-09 2.51683468E-03 +-7.96052301E-10-2.27488326E-04-6.20467873E-10 3.16206903E-09-1.29360787E-12 + 0.00000000E+00-7.27570100E-10 0.00000000E+00-1.51534493E-12-1.09271660E-03 +-2.48943771E-18-1.42537591E-03 0.00000000E+00-1.23717249E-02-2.51217038E-17 +-2.20383866E-02 0.00000000E+00 2.51683468E-03 7.96052301E-10-4.47458764E-06 +-1.78420705E-12 0.00000000E+00 9.38462609E-10 0.00000000E+00-2.10459794E-12 + 2.22653918E-03 4.97512614E-18 4.43253626E-03 1.00280934E-17 2.88428653E-03 + 0.00000000E+00 5.75176074E-03 0.00000000E+00 2.47761074E-02 7.13508582E-17 + 4.95351995E-02 1.33612476E-16 4.36849440E-02 0.00000000E+00 8.75662485E-02 + 0.00000000E+00 4.56480308E-03 6.52256408E-09 1.78613161E-05 2.36382481E-11 + 0.00000000E+00 7.66143530E-09 0.00000000E+00 2.77773453E-11 2.14432722E-03 + 4.98262469E-18 2.81721709E-03 0.00000000E+00 2.47107924E-02 2.91359571E-17 + 4.44686025E-02 0.00000000E+00 4.57061742E-03 4.14102755E-09-1.78739643E-05 +-1.84638166E-11 0.00000000E+00 4.87166607E-09 0.00000000E+00-2.17159656E-11 + 1.74833260E-02 3.94248488E-17 2.22653918E-03 4.97512614E-18 2.28061455E-02 + 0.00000000E+00 2.88428653E-03 0.00000000E+00 1.97950279E-01 3.94122483E-16 + 2.47761074E-02 7.13508582E-17 3.52609973E-01 0.00000000E+00 4.36849440E-02 + 0.00000000E+00 0.00000000E+00-7.27570100E-10 0.00000000E+00-1.51534493E-12 + 2.27488326E-04-6.20467873E-10-3.16206903E-09-1.29360787E-12-1.42537591E-03 + 0.00000000E+00-1.09271660E-03 2.48943771E-18-2.20383866E-02 0.00000000E+00 +-1.23717249E-02 2.51217038E-17 0.00000000E+00 9.38462609E-10 0.00000000E+00 +-2.10459794E-12-2.51683468E-03 7.96052301E-10 4.47458764E-06-1.78420705E-12 + 2.88428653E-03 0.00000000E+00 5.75176074E-03 0.00000000E+00 2.22653918E-03 +-4.97512614E-18 4.43253626E-03-1.00280934E-17 4.36849440E-02 0.00000000E+00 + 8.75662485E-02 0.00000000E+00 2.47761074E-02-7.13508582E-17 4.95351995E-02 +-1.33612476E-16 0.00000000E+00 7.66143530E-09 0.00000000E+00 2.77773453E-11 +-4.56480308E-03 6.52256408E-09-1.78613161E-05 2.36382481E-11 2.81721709E-03 + 0.00000000E+00 2.14432722E-03-4.98262469E-18 4.44686025E-02 0.00000000E+00 + 2.47107924E-02-2.91359571E-17 0.00000000E+00 4.87166607E-09 0.00000000E+00 +-2.17159656E-11-4.57061742E-03 4.14102755E-09 1.78739643E-05-1.84638166E-11 + 2.28061455E-02 0.00000000E+00 2.88428653E-03 0.00000000E+00 1.74833260E-02 +-3.94248488E-17 2.22653918E-03-4.97512614E-18 3.52609973E-01 0.00000000E+00 + 4.36849440E-02 0.00000000E+00 1.97950279E-01-3.94122483E-16 2.47761074E-02 +-7.13508582E-17-2.27488326E-04-6.20467873E-10 3.16206903E-09-1.29360787E-12 + 0.00000000E+00-7.27570100E-10 0.00000000E+00-1.51534493E-12-1.09271660E-03 +-2.48943771E-18-1.42537591E-03 0.00000000E+00-1.09271660E-03-2.48943771E-18 +-1.42537591E-03 0.00000000E+00 2.51683468E-03 7.96052301E-10-4.47458764E-06 +-1.78420705E-12 0.00000000E+00 9.38462609E-10 0.00000000E+00-2.10459794E-12 + 2.22653918E-03 4.97512614E-18 4.43253626E-03 1.00280934E-17 2.88428653E-03 + 0.00000000E+00 5.75176074E-03 0.00000000E+00 2.22653918E-03 4.97512614E-18 + 4.43253626E-03 1.00280934E-17 2.88428653E-03 0.00000000E+00 5.75176074E-03 + 0.00000000E+00 4.56480308E-03 6.52256408E-09 1.78613161E-05 2.36382481E-11 + 0.00000000E+00 7.66143530E-09 0.00000000E+00 2.77773453E-11 2.14432722E-03 + 4.98262469E-18 2.81721709E-03 0.00000000E+00 2.14432722E-03 4.98262469E-18 + 2.81721709E-03 0.00000000E+00 4.57061742E-03 4.14102755E-09-1.78739643E-05 +-1.84638166E-11 0.00000000E+00 4.87166607E-09 0.00000000E+00-2.17159656E-11 + 1.74833260E-02 3.94248488E-17 2.22653918E-03 4.97512614E-18 2.28061455E-02 + 0.00000000E+00 2.88428653E-03 0.00000000E+00 1.74833260E-02 3.94248488E-17 + 2.22653918E-03 4.97512614E-18 2.28061455E-02 0.00000000E+00 2.88428653E-03 + 0.00000000E+00 0.00000000E+00-7.27570100E-10 0.00000000E+00-1.51534493E-12 + 2.27488326E-04-6.20467873E-10-3.16206903E-09-1.29360787E-12-1.42537591E-03 + 0.00000000E+00-1.09271660E-03 2.48943771E-18-1.42537591E-03 0.00000000E+00 +-1.09271660E-03 2.48943771E-18 0.00000000E+00 9.38462609E-10 0.00000000E+00 +-2.10459794E-12-2.51683468E-03 7.96052301E-10 4.47458764E-06-1.78420705E-12 + 2.88428653E-03 0.00000000E+00 5.75176074E-03 0.00000000E+00 2.22653918E-03 +-4.97512614E-18 4.43253626E-03-1.00280934E-17 2.88428653E-03 0.00000000E+00 + 5.75176074E-03 0.00000000E+00 2.22653918E-03-4.97512614E-18 4.43253626E-03 +-1.00280934E-17 0.00000000E+00 7.66143530E-09 0.00000000E+00 2.77773453E-11 +-4.56480308E-03 6.52256408E-09-1.78613161E-05 2.36382481E-11 2.81721709E-03 + 0.00000000E+00 2.14432722E-03-4.98262469E-18 2.81721709E-03 0.00000000E+00 + 2.14432722E-03-4.98262469E-18 0.00000000E+00 4.87166607E-09 0.00000000E+00 +-2.17159656E-11-4.57061742E-03 4.14102755E-09 1.78739643E-05-1.84638166E-11 + 2.28061455E-02 0.00000000E+00 2.88428653E-03 0.00000000E+00 1.74833260E-02 +-3.94248488E-17 2.22653918E-03-4.97512614E-18 2.28061455E-02 0.00000000E+00 + 2.88428653E-03 0.00000000E+00 1.74833260E-02-3.94248488E-17 2.22653918E-03 +-4.97512614E-18-6.16659582E-06-2.29388208E-20-2.78887831E-08-1.03641438E-22 +-3.06615677E-05 0.00000000E+00-1.38334004E-07 0.00000000E+00-3.16206903E-09 + 1.29360787E-12 0.00000000E+00 1.51534493E-12-3.16206903E-09 1.29360787E-12 + 0.00000000E+00 1.51534493E-12-1.05560173E-05-3.90219168E-20 3.74276068E-08 + 1.38613576E-22-5.17679706E-05 0.00000000E+00 1.84201018E-07 0.00000000E+00 + 1.78739643E-05 1.84638166E-11 4.47458764E-06 1.78420705E-12 0.00000000E+00 + 2.17159656E-11 0.00000000E+00 2.10459794E-12 1.78739643E-05 1.84638166E-11 + 4.47458764E-06 1.78420705E-12 0.00000000E+00 2.17159656E-11 0.00000000E+00 + 2.10459794E-12 1.31230169E-03 4.87650804E-18 6.19138708E-06 2.29843270E-20 + 6.50928138E-03 0.00000000E+00 3.06365241E-05 0.00000000E+00 2.29265257E-04 +-1.07197462E-10 0.00000000E+00-1.24827704E-10 2.29265257E-04-1.07197462E-10 + 0.00000000E+00-1.24827704E-10 3.84441653E-03 1.41688665E-17-1.05560173E-05 +-3.90219168E-20 1.87512929E-02 0.00000000E+00-5.17679706E-05 0.00000000E+00 +-4.57061742E-03-4.14102755E-09-2.51683468E-03-7.96052301E-10 0.00000000E+00 +-4.87166607E-09 0.00000000E+00-9.38462609E-10-4.57061742E-03-4.14102755E-09 +-2.51683468E-03-7.96052301E-10 0.00000000E+00-4.87166607E-09 0.00000000E+00 +-9.38462609E-10-3.06615677E-05 0.00000000E+00-1.38334004E-07 0.00000000E+00 +-6.16659582E-06 2.29388208E-20-2.78887831E-08 1.03641438E-22 0.00000000E+00 + 1.51534493E-12 3.16206903E-09 1.29360787E-12 0.00000000E+00 1.51534493E-12 + 3.16206903E-09 1.29360787E-12-5.17679706E-05 0.00000000E+00 1.84201018E-07 + 0.00000000E+00-1.05560173E-05 3.90219168E-20 3.74276068E-08-1.38613576E-22 + 0.00000000E+00 2.17159656E-11 0.00000000E+00 2.10459794E-12-1.78739643E-05 + 1.84638166E-11-4.47458764E-06 1.78420705E-12 0.00000000E+00 2.17159656E-11 + 0.00000000E+00 2.10459794E-12-1.78739643E-05 1.84638166E-11-4.47458764E-06 + 1.78420705E-12-2.26075347E-04-6.59647223E-10 3.75570681E-09-3.74879498E-13 + 0.00000000E+00-7.61482664E-10 0.00000000E+00-4.13197110E-13-1.05188479E-03 +-2.79949782E-18-1.39193211E-03 0.00000000E+00-1.23386165E-02-1.09608352E-17 +-2.24375345E-02 0.00000000E+00 5.01140417E-03 1.01464726E-08 7.07039325E-09 +-1.61055597E-12 0.00000000E+00 1.18844306E-08 0.00000000E+00-1.85716606E-12 + 2.14426594E-03 5.03239378E-18 8.57762161E-03 2.04319392E-17 2.81713339E-03 + 0.00000000E+00 1.12688905E-02 0.00000000E+00 2.47100065E-02 2.90525835E-17 + 9.88415145E-02 1.26360496E-16 4.44670589E-02 0.00000000E+00 1.77882882E-01 + 0.00000000E+00-2.29265257E-04 1.07197462E-10 3.16206903E-09-1.29360787E-12 + 0.00000000E+00 1.24827704E-10 0.00000000E+00-1.51534493E-12 2.14432722E-03 + 4.98262469E-18-1.09271660E-03-2.48943771E-18 2.81721709E-03 0.00000000E+00 +-1.42537591E-03 0.00000000E+00 2.47107924E-02 2.91359571E-17-1.23717249E-02 +-2.51217038E-17 4.44686025E-02 0.00000000E+00-2.20383866E-02 0.00000000E+00 + 6.58072453E-03 0.00000000E+00 3.09721118E-05 0.00000000E+00 1.24458427E-03 +-4.66717884E-18 5.87224580E-06-2.20335315E-20 0.00000000E+00 5.26712703E-10 +-2.28187918E-04 4.46890440E-10 0.00000000E+00 5.26712703E-10-2.28187918E-04 + 4.46890440E-10 3.78129638E-02 0.00000000E+00-3.62408526E-07 0.00000000E+00 + 7.38560376E-03-2.76749755E-17 3.43510607E-07-1.04380797E-21 0.00000000E+00 +-1.26760070E-08 0.00000000E+00-1.18844306E-08 4.54618375E-03-1.08670212E-08 + 5.01140417E-03-1.01464726E-08 0.00000000E+00-1.26760070E-08 0.00000000E+00 +-1.18844306E-08 4.54618375E-03-1.08670212E-08 5.01140417E-03-1.01464726E-08 + 6.50928138E-03 0.00000000E+00-3.06615677E-05 0.00000000E+00 1.31230169E-03 +-4.87650804E-18-6.16659582E-06 2.29388208E-20 0.00000000E+00-7.66143530E-09 + 0.00000000E+00 7.27570100E-10 4.56480308E-03-6.52256408E-09-2.27488326E-04 + 6.20467873E-10 0.00000000E+00-7.66143530E-09 0.00000000E+00 7.27570100E-10 + 4.56480308E-03-6.52256408E-09-2.27488326E-04 6.20467873E-10-3.09987668E-05 + 0.00000000E+00-1.39852334E-07 0.00000000E+00-5.84803556E-06 2.19195393E-20 +-2.64496313E-08 9.92014838E-23 0.00000000E+00 4.13197110E-13 3.75570681E-09 + 3.74879498E-13 0.00000000E+00 4.13197110E-13 3.75570681E-09 3.74879498E-13 +-3.62408526E-07 0.00000000E+00 3.70900439E-07 0.00000000E+00 3.43510607E-07 +-1.04380797E-21 7.24458804E-08-2.71060893E-22 0.00000000E+00 5.04394958E-11 + 0.00000000E+00 1.85716606E-12-1.77773451E-05 4.32704077E-11 7.07039325E-09 + 1.61055597E-12 0.00000000E+00 5.04394958E-11 0.00000000E+00 1.85716606E-12 +-1.77773451E-05 4.32704077E-11 7.07039325E-09 1.61055597E-12 3.06365241E-05 + 0.00000000E+00-1.38334004E-07 0.00000000E+00 6.19138708E-06-2.29843270E-20 +-2.78887831E-08 1.03641438E-22 0.00000000E+00-2.77773453E-11 0.00000000E+00 + 1.51534493E-12 1.78613161E-05-2.36382481E-11 3.16206903E-09 1.29360787E-12 + 0.00000000E+00-2.77773453E-11 0.00000000E+00 1.51534493E-12 1.78613161E-05 +-2.36382481E-11 3.16206903E-09 1.29360787E-12 1.24458427E-03 4.66717884E-18 + 5.87224580E-06 2.20335315E-20 6.58072453E-03 0.00000000E+00 3.09721118E-05 + 0.00000000E+00 2.28187918E-04 4.46890440E-10 0.00000000E+00 5.26712703E-10 + 2.28187918E-04 4.46890440E-10 0.00000000E+00 5.26712703E-10 7.38560376E-03 + 2.76749755E-17 3.43510607E-07 1.04380797E-21 3.78129638E-02 0.00000000E+00 +-3.62408526E-07 0.00000000E+00-4.54618375E-03-1.08670212E-08-5.01140417E-03 +-1.01464726E-08 0.00000000E+00-1.26760070E-08 0.00000000E+00-1.18844306E-08 +-4.54618375E-03-1.08670212E-08-5.01140417E-03-1.01464726E-08 0.00000000E+00 +-1.26760070E-08 0.00000000E+00-1.18844306E-08 1.31230169E-03 4.87650804E-18 +-6.16659582E-06-2.29388208E-20 6.50928138E-03 0.00000000E+00-3.06615677E-05 + 0.00000000E+00-4.56480308E-03-6.52256408E-09 2.27488326E-04 6.20467873E-10 + 0.00000000E+00-7.66143530E-09 0.00000000E+00 7.27570100E-10-4.56480308E-03 +-6.52256408E-09 2.27488326E-04 6.20467873E-10 0.00000000E+00-7.66143530E-09 + 0.00000000E+00 7.27570100E-10-5.84803556E-06-2.19195393E-20-2.64496313E-08 +-9.92014838E-23-3.09987668E-05 0.00000000E+00-1.39852334E-07 0.00000000E+00 +-3.75570681E-09 3.74879498E-13 0.00000000E+00 4.13197110E-13-3.75570681E-09 + 3.74879498E-13 0.00000000E+00 4.13197110E-13 3.43510607E-07 1.04380797E-21 + 7.24458804E-08 2.71060893E-22-3.62408526E-07 0.00000000E+00 3.70900439E-07 + 0.00000000E+00 1.77773451E-05 4.32704077E-11-7.07039325E-09 1.61055597E-12 + 0.00000000E+00 5.04394958E-11 0.00000000E+00 1.85716606E-12 1.77773451E-05 + 4.32704077E-11-7.07039325E-09 1.61055597E-12 0.00000000E+00 5.04394958E-11 + 0.00000000E+00 1.85716606E-12 6.19138708E-06 2.29843270E-20-2.78887831E-08 +-1.03641438E-22 3.06365241E-05 0.00000000E+00-1.38334004E-07 0.00000000E+00 +-1.78613161E-05-2.36382481E-11-3.16206903E-09 1.29360787E-12 0.00000000E+00 +-2.77773453E-11 0.00000000E+00 1.51534493E-12-1.78613161E-05-2.36382481E-11 +-3.16206903E-09 1.29360787E-12 0.00000000E+00-2.77773453E-11 0.00000000E+00 + 1.51534493E-12 0.00000000E+00 1.34460767E-08 0.00000000E+00 5.20922842E-11 +-4.53926966E-03 1.15647113E-08-1.77623223E-05 4.47699256E-11 2.75059506E-03 + 0.00000000E+00 2.06327321E-03-6.16559751E-18 2.75059506E-03 0.00000000E+00 + 2.06327321E-03-6.16559751E-18 0.00000000E+00 1.26760070E-08 0.00000000E+00 +-5.04394958E-11-4.54618375E-03 1.08670212E-08 1.77773451E-05-4.32704077E-11 + 2.22706126E-02 0.00000000E+00 2.81713339E-03 0.00000000E+00 1.68296980E-02 +-4.48406387E-17 2.14426594E-03-5.03239378E-18 2.22706126E-02 0.00000000E+00 + 2.81713339E-03 0.00000000E+00 1.68296980E-02-4.48406387E-17 2.14426594E-03 +-5.03239378E-18 0.00000000E+00-7.61482664E-10 0.00000000E+00-4.13197110E-13 + 2.26075347E-04-6.59647223E-10-3.75570681E-09-3.74879498E-13-1.39193211E-03 + 0.00000000E+00-1.05188479E-03 2.79949782E-18-1.39193211E-03 0.00000000E+00 +-1.05188479E-03 2.79949782E-18 0.00000000E+00 1.18844306E-08 0.00000000E+00 +-1.85716606E-12-5.01140417E-03 1.01464726E-08-7.07039325E-09-1.61055597E-12 + 2.81713339E-03 0.00000000E+00 1.12688905E-02 0.00000000E+00 2.14426594E-03 +-5.03239378E-18 8.57762161E-03-2.04319392E-17 2.81713339E-03 0.00000000E+00 + 1.12688905E-02 0.00000000E+00 2.14426594E-03-5.03239378E-18 8.57762161E-03 +-2.04319392E-17 0.00000000E+00 1.24827704E-10 0.00000000E+00-1.51534493E-12 + 2.29265257E-04 1.07197462E-10-3.16206903E-09-1.29360787E-12 2.81721709E-03 + 0.00000000E+00-1.42537591E-03 0.00000000E+00 2.14432722E-03-4.98262469E-18 +-1.09271660E-03 2.48943771E-18 2.81721709E-03 0.00000000E+00-1.42537591E-03 + 0.00000000E+00 2.14432722E-03-4.98262469E-18-1.09271660E-03 2.48943771E-18 + 4.53926966E-03 1.15647113E-08 1.77623223E-05 4.47699256E-11 0.00000000E+00 + 1.34460767E-08 0.00000000E+00 5.20922842E-11 2.06327321E-03 6.16559751E-18 + 2.75059506E-03 0.00000000E+00 2.06327321E-03 6.16559751E-18 2.75059506E-03 + 0.00000000E+00 4.54618375E-03 1.08670212E-08-1.77773451E-05-4.32704077E-11 + 0.00000000E+00 1.26760070E-08 0.00000000E+00-5.04394958E-11 1.68296980E-02 + 4.48406387E-17 2.14426594E-03 5.03239378E-18 2.22706126E-02 0.00000000E+00 + 2.81713339E-03 0.00000000E+00 1.68296980E-02 4.48406387E-17 2.14426594E-03 + 5.03239378E-18 2.22706126E-02 0.00000000E+00 2.81713339E-03 0.00000000E+00 +-2.26075347E-04-6.59647223E-10 3.75570681E-09-3.74879498E-13 0.00000000E+00 +-7.61482664E-10 0.00000000E+00-4.13197110E-13-1.05188479E-03-2.79949782E-18 +-1.39193211E-03 0.00000000E+00-1.05188479E-03-2.79949782E-18-1.39193211E-03 + 0.00000000E+00 5.01140417E-03 1.01464726E-08 7.07039325E-09-1.61055597E-12 + 0.00000000E+00 1.18844306E-08 0.00000000E+00-1.85716606E-12 2.14426594E-03 + 5.03239378E-18 8.57762161E-03 2.04319392E-17 2.81713339E-03 0.00000000E+00 + 1.12688905E-02 0.00000000E+00 2.14426594E-03 5.03239378E-18 8.57762161E-03 + 2.04319392E-17 2.81713339E-03 0.00000000E+00 1.12688905E-02 0.00000000E+00 +-2.29265257E-04 1.07197462E-10 3.16206903E-09-1.29360787E-12 0.00000000E+00 + 1.24827704E-10 0.00000000E+00-1.51534493E-12 2.14432722E-03 4.98262469E-18 +-1.09271660E-03-2.48943771E-18 2.81721709E-03 0.00000000E+00-1.42537591E-03 + 0.00000000E+00 2.14432722E-03 4.98262469E-18-1.09271660E-03-2.48943771E-18 + 2.81721709E-03 0.00000000E+00-1.42537591E-03 0.00000000E+00 0.00000000E+00 + 1.34460767E-08 0.00000000E+00 5.20922842E-11-4.53926966E-03 1.15647113E-08 +-1.77623223E-05 4.47699256E-11 2.75059506E-03 0.00000000E+00 2.06327321E-03 +-6.16559751E-18 4.52830791E-02 0.00000000E+00 2.46444594E-02-1.47907573E-17 + 0.00000000E+00 1.26760070E-08 0.00000000E+00-5.04394958E-11-4.54618375E-03 + 1.08670212E-08 1.77773451E-05-4.32704077E-11 2.22706126E-02 0.00000000E+00 + 2.81713339E-03 0.00000000E+00 1.68296980E-02-4.48406387E-17 2.14426594E-03 +-5.03239378E-18 3.58988369E-01 0.00000000E+00 4.44670589E-02 0.00000000E+00 + 1.97416506E-01-1.66835622E-16 2.47100065E-02-2.90525835E-17 0.00000000E+00 +-7.61482664E-10 0.00000000E+00-4.13197110E-13 2.26075347E-04-6.59647223E-10 +-3.75570681E-09-3.74879498E-13-1.39193211E-03 0.00000000E+00-1.05188479E-03 + 2.79949782E-18-2.24375345E-02 0.00000000E+00-1.23386165E-02 1.09608352E-17 + 0.00000000E+00 1.18844306E-08 0.00000000E+00-1.85716606E-12-5.01140417E-03 + 1.01464726E-08-7.07039325E-09-1.61055597E-12 2.81713339E-03 0.00000000E+00 + 1.12688905E-02 0.00000000E+00 2.14426594E-03-5.03239378E-18 8.57762161E-03 +-2.04319392E-17 4.44670589E-02 0.00000000E+00 1.77882882E-01 0.00000000E+00 + 2.47100065E-02-2.90525835E-17 9.88415145E-02-1.26360496E-16 0.00000000E+00 + 1.24827704E-10 0.00000000E+00-1.51534493E-12 2.29265257E-04 1.07197462E-10 +-3.16206903E-09-1.29360787E-12 2.81721709E-03 0.00000000E+00-1.42537591E-03 + 0.00000000E+00 2.14432722E-03-4.98262469E-18-1.09271660E-03 2.48943771E-18 + 4.44686025E-02 0.00000000E+00-2.20383866E-02 0.00000000E+00 2.47107924E-02 +-2.91359571E-17-1.23717249E-02 2.51217038E-17 4.53926966E-03 1.15647113E-08 + 1.77623223E-05 4.47699256E-11 0.00000000E+00 1.34460767E-08 0.00000000E+00 + 5.20922842E-11 2.06327321E-03 6.16559751E-18 2.75059506E-03 0.00000000E+00 + 2.46444594E-02 1.47907573E-17 4.52830791E-02 0.00000000E+00 4.54618375E-03 + 1.08670212E-08-1.77773451E-05-4.32704077E-11 0.00000000E+00 1.26760070E-08 + 0.00000000E+00-5.04394958E-11 1.68296980E-02 4.48406387E-17 2.14426594E-03 + 5.03239378E-18 2.22706126E-02 0.00000000E+00 2.81713339E-03 0.00000000E+00 + 1.97416506E-01 1.66835622E-16 2.47100065E-02 2.90525835E-17 3.58988369E-01 + 0.00000000E+00 4.44670589E-02 0.00000000E+00 5.97945193E-03 1.62930467E-08 + 3.10721744E-05 8.45799959E-11 0.00000000E+00 1.87358990E-08 0.00000000E+00 + 9.72749140E-11 2.59949574E-03 4.27672608E-18 3.53626850E-03 0.00000000E+00 + 3.26098680E-02 5.78076322E-17 6.16393998E-02 0.00000000E+00 5.99367294E-03 + 1.62489536E-08-3.11132090E-05-8.44633404E-11 0.00000000E+00 1.87119159E-08 + 0.00000000E+00-9.72164760E-11 2.13547864E-02 5.52055320E-17 2.73941246E-03 + 8.90375909E-18 2.87529656E-02 0.00000000E+00 3.65206025E-03 0.00000000E+00 + 2.61326225E-01 2.84711866E-16 3.27216646E-02 1.70917629E-17 4.87020872E-01 + 0.00000000E+00 6.01218408E-02 0.00000000E+00 8.85519020E-03 0.00000000E+00 + 5.53261909E-05 0.00000000E+00 1.55073862E-03-5.00778496E-18 9.72220608E-06 +-3.18707215E-20 0.00000000E+00 9.32650430E-10-3.01486722E-04 8.06329969E-10 + 0.00000000E+00 9.32650430E-10-3.01486722E-04 8.06329969E-10 4.45432806E-02 + 0.00000000E+00-4.08758294E-05 0.00000000E+00 8.11293721E-03-2.92498338E-17 +-6.80657944E-06 2.04842944E-20 0.00000000E+00-1.87119159E-08 0.00000000E+00 +-1.79367425E-08 5.99367294E-03-1.62489536E-08 5.79674668E-03-1.55095688E-08 + 0.00000000E+00-1.87119159E-08 0.00000000E+00-1.79367425E-08 5.99367294E-03 +-1.62489536E-08 5.79674668E-03-1.55095688E-08 6.58072453E-03 0.00000000E+00 +-3.09987668E-05 0.00000000E+00 1.24458427E-03-4.66717884E-18-5.84803556E-06 + 2.19195393E-20 0.00000000E+00-1.34460767E-08 0.00000000E+00 7.61482664E-10 + 4.53926966E-03-1.15647113E-08-2.26075347E-04 6.59647223E-10 0.00000000E+00 +-1.34460767E-08 0.00000000E+00 7.61482664E-10 4.53926966E-03-1.15647113E-08 +-2.26075347E-04 6.59647223E-10-2.97141383E-04-8.19599366E-10 1.02586464E-08 +-2.91638816E-14 0.00000000E+00-9.39771395E-10 0.00000000E+00-1.46094951E-14 +-1.33472705E-03-3.29512129E-18-1.79708219E-03 0.00000000E+00-1.63328831E-02 +-1.87248488E-17-3.04403101E-02 0.00000000E+00 5.79674668E-03 1.55095688E-08 +-3.36540984E-06-9.24957453E-12 0.00000000E+00 1.79367425E-08 0.00000000E+00 +-1.06094646E-11 2.73941246E-03 8.90375909E-18 9.59088113E-03 2.79500114E-17 + 3.65206025E-03 0.00000000E+00 1.27931149E-02 0.00000000E+00 3.27216646E-02 + 1.70917629E-17 1.14720882E-01 8.36334492E-17 6.01218408E-02 0.00000000E+00 + 2.10991912E-01 0.00000000E+00-2.28187918E-04-4.46890440E-10 3.75570681E-09 +-3.74879498E-13 0.00000000E+00-5.26712703E-10 0.00000000E+00-4.13197110E-13 + 2.06327321E-03 6.16559751E-18-1.05188479E-03-2.79949782E-18 2.75059506E-03 + 0.00000000E+00-1.39193211E-03 0.00000000E+00 2.46444594E-02 1.47907573E-17 +-1.23386165E-02-1.09608352E-17 4.52830791E-02 0.00000000E+00-2.24375345E-02 + 0.00000000E+00 0.00000000E+00-9.39771395E-10 0.00000000E+00-1.46094951E-14 + 2.97141383E-04-8.19599366E-10-1.02586464E-08-2.91638816E-14-1.79708219E-03 + 0.00000000E+00-1.33472705E-03 3.29512129E-18-3.04403101E-02 0.00000000E+00 +-1.63328831E-02 1.87248488E-17 0.00000000E+00 1.79367425E-08 0.00000000E+00 +-1.06094646E-11-5.79674668E-03 1.55095688E-08 3.36540984E-06-9.24957453E-12 + 3.65206025E-03 0.00000000E+00 1.27931149E-02 0.00000000E+00 2.73941246E-03 +-8.90375909E-18 9.59088113E-03-2.79500114E-17 6.01218408E-02 0.00000000E+00 + 2.10991912E-01 0.00000000E+00 3.27216646E-02-1.70917629E-17 1.14720882E-01 +-8.36334492E-17 0.00000000E+00-5.26712703E-10 0.00000000E+00-4.13197110E-13 + 2.28187918E-04-4.46890440E-10-3.75570681E-09-3.74879498E-13 2.75059506E-03 + 0.00000000E+00-1.39193211E-03 0.00000000E+00 2.06327321E-03-6.16559751E-18 +-1.05188479E-03 2.79949782E-18 4.52830791E-02 0.00000000E+00-2.24375345E-02 + 0.00000000E+00 2.46444594E-02-1.47907573E-17-1.23386165E-02 1.09608352E-17 +-2.97141383E-04-8.19599366E-10 1.02586464E-08-2.91638816E-14 0.00000000E+00 +-9.39771395E-10 0.00000000E+00-1.46094951E-14-1.33472705E-03-3.29512129E-18 +-1.79708219E-03 0.00000000E+00-1.33472705E-03-3.29512129E-18-1.79708219E-03 + 0.00000000E+00 5.79674668E-03 1.55095688E-08-3.36540984E-06-9.24957453E-12 + 0.00000000E+00 1.79367425E-08 0.00000000E+00-1.06094646E-11 2.73941246E-03 + 8.90375909E-18 9.59088113E-03 2.79500114E-17 3.65206025E-03 0.00000000E+00 + 1.27931149E-02 0.00000000E+00 2.73941246E-03 8.90375909E-18 9.59088113E-03 + 2.79500114E-17 3.65206025E-03 0.00000000E+00 1.27931149E-02 0.00000000E+00 +-2.28187918E-04-4.46890440E-10 3.75570681E-09-3.74879498E-13 0.00000000E+00 +-5.26712703E-10 0.00000000E+00-4.13197110E-13 2.06327321E-03 6.16559751E-18 +-1.05188479E-03-2.79949782E-18 2.75059506E-03 0.00000000E+00-1.39193211E-03 + 0.00000000E+00 2.06327321E-03 6.16559751E-18-1.05188479E-03-2.79949782E-18 + 2.75059506E-03 0.00000000E+00-1.39193211E-03 0.00000000E+00 0.00000000E+00 +-9.39771395E-10 0.00000000E+00-1.46094951E-14 2.97141383E-04-8.19599366E-10 +-1.02586464E-08-2.91638816E-14-1.79708219E-03 0.00000000E+00-1.33472705E-03 + 3.29512129E-18-1.79708219E-03 0.00000000E+00-1.33472705E-03 3.29512129E-18 + 0.00000000E+00 1.79367425E-08 0.00000000E+00-1.06094646E-11-5.79674668E-03 + 1.55095688E-08 3.36540984E-06-9.24957453E-12 3.65206025E-03 0.00000000E+00 + 1.27931149E-02 0.00000000E+00 2.73941246E-03-8.90375909E-18 9.59088113E-03 +-2.79500114E-17 3.65206025E-03 0.00000000E+00 1.27931149E-02 0.00000000E+00 + 2.73941246E-03-8.90375909E-18 9.59088113E-03-2.79500114E-17 0.00000000E+00 +-5.26712703E-10 0.00000000E+00-4.13197110E-13 2.28187918E-04-4.46890440E-10 +-3.75570681E-09-3.74879498E-13 2.75059506E-03 0.00000000E+00-1.39193211E-03 + 0.00000000E+00 2.06327321E-03-6.16559751E-18-1.05188479E-03 2.79949782E-18 + 2.75059506E-03 0.00000000E+00-1.39193211E-03 0.00000000E+00 2.06327321E-03 +-6.16559751E-18-1.05188479E-03 2.79949782E-18-9.66714802E-06-3.07525469E-20 +-5.80972675E-08-1.87704649E-22-5.53929930E-05 0.00000000E+00-3.31753710E-07 + 0.00000000E+00-1.02586464E-08 2.91638816E-14 0.00000000E+00 1.46094951E-14 +-1.02586464E-08 2.91638816E-14 0.00000000E+00 1.46094951E-14-6.80657944E-06 +-2.04842944E-20 1.13208269E-07 3.95626511E-22-4.08758294E-05 0.00000000E+00 + 6.28204157E-07 0.00000000E+00 3.11132090E-05 8.44633404E-11 3.36540984E-06 + 9.24957453E-12 0.00000000E+00 9.72164760E-11 0.00000000E+00 1.06094646E-11 + 3.11132090E-05 8.44633404E-11 3.36540984E-06 9.24957453E-12 0.00000000E+00 + 9.72164760E-11 0.00000000E+00 1.06094646E-11 5.87224580E-06 2.20335315E-20 +-2.64496313E-08-9.92014838E-23 3.09721118E-05 0.00000000E+00-1.39852334E-07 + 0.00000000E+00-1.77623223E-05-4.47699256E-11-3.75570681E-09 3.74879498E-13 + 0.00000000E+00-5.20922842E-11 0.00000000E+00 4.13197110E-13-1.77623223E-05 +-4.47699256E-11-3.75570681E-09 3.74879498E-13 0.00000000E+00-5.20922842E-11 + 0.00000000E+00 4.13197110E-13 1.55073862E-03 5.00778496E-18 9.72220608E-06 + 3.18707215E-20 8.85519020E-03 0.00000000E+00 5.53261909E-05 0.00000000E+00 + 3.01486722E-04 8.06329969E-10 0.00000000E+00 9.32650430E-10 3.01486722E-04 + 8.06329969E-10 0.00000000E+00 9.32650430E-10 8.11293721E-03 2.92498338E-17 +-6.80657944E-06-2.04842944E-20 4.45432806E-02 0.00000000E+00-4.08758294E-05 + 0.00000000E+00-5.99367294E-03-1.62489536E-08-5.79674668E-03-1.55095688E-08 + 0.00000000E+00-1.87119159E-08 0.00000000E+00-1.79367425E-08-5.99367294E-03 +-1.62489536E-08-5.79674668E-03-1.55095688E-08 0.00000000E+00-1.87119159E-08 + 0.00000000E+00-1.79367425E-08 1.24458427E-03 4.66717884E-18-5.84803556E-06 +-2.19195393E-20 6.58072453E-03 0.00000000E+00-3.09987668E-05 0.00000000E+00 +-4.53926966E-03-1.15647113E-08 2.26075347E-04 6.59647223E-10 0.00000000E+00 +-1.34460767E-08 0.00000000E+00 7.61482664E-10-4.53926966E-03-1.15647113E-08 + 2.26075347E-04 6.59647223E-10 0.00000000E+00-1.34460767E-08 0.00000000E+00 + 7.61482664E-10-5.53929930E-05 0.00000000E+00-3.31753710E-07 0.00000000E+00 +-9.66714802E-06 3.07525469E-20-5.80972675E-08 1.87704649E-22 0.00000000E+00 + 1.46094951E-14 1.02586464E-08 2.91638816E-14 0.00000000E+00 1.46094951E-14 + 1.02586464E-08 2.91638816E-14-4.08758294E-05 0.00000000E+00 6.28204157E-07 + 0.00000000E+00-6.80657944E-06 2.04842944E-20 1.13208269E-07-3.95626511E-22 + 0.00000000E+00 9.72164760E-11 0.00000000E+00 1.06094646E-11-3.11132090E-05 + 8.44633404E-11-3.36540984E-06 9.24957453E-12 0.00000000E+00 9.72164760E-11 + 0.00000000E+00 1.06094646E-11-3.11132090E-05 8.44633404E-11-3.36540984E-06 + 9.24957453E-12 3.09721118E-05 0.00000000E+00-1.39852334E-07 0.00000000E+00 + 5.87224580E-06-2.20335315E-20-2.64496313E-08 9.92014838E-23 0.00000000E+00 +-5.20922842E-11 0.00000000E+00 4.13197110E-13 1.77623223E-05-4.47699256E-11 + 3.75570681E-09 3.74879498E-13 0.00000000E+00-5.20922842E-11 0.00000000E+00 + 4.13197110E-13 1.77623223E-05-4.47699256E-11 3.75570681E-09 3.74879498E-13 + 0.00000000E+00 1.87358990E-08 0.00000000E+00 9.72749140E-11-5.97945193E-03 + 1.62930467E-08-3.10721744E-05 8.45799959E-11 3.53626850E-03 0.00000000E+00 + 2.59949574E-03-4.27672608E-18 3.53626850E-03 0.00000000E+00 2.59949574E-03 +-4.27672608E-18 0.00000000E+00 1.87119159E-08 0.00000000E+00-9.72164760E-11 +-5.99367294E-03 1.62489536E-08 3.11132090E-05-8.44633404E-11 2.87529656E-02 + 0.00000000E+00 3.65206025E-03 0.00000000E+00 2.13547864E-02-5.52055320E-17 + 2.73941246E-03-8.90375909E-18 2.87529656E-02 0.00000000E+00 3.65206025E-03 + 0.00000000E+00 2.13547864E-02-5.52055320E-17 2.73941246E-03-8.90375909E-18 + 5.97945193E-03 1.62930467E-08 3.10721744E-05 8.45799959E-11 0.00000000E+00 + 1.87358990E-08 0.00000000E+00 9.72749140E-11 2.59949574E-03 4.27672608E-18 + 3.53626850E-03 0.00000000E+00 2.59949574E-03 4.27672608E-18 3.53626850E-03 + 0.00000000E+00 5.99367294E-03 1.62489536E-08-3.11132090E-05-8.44633404E-11 + 0.00000000E+00 1.87119159E-08 0.00000000E+00-9.72164760E-11 2.13547864E-02 + 5.52055320E-17 2.73941246E-03 8.90375909E-18 2.87529656E-02 0.00000000E+00 + 3.65206025E-03 0.00000000E+00 2.13547864E-02 5.52055320E-17 2.73941246E-03 + 8.90375909E-18 2.87529656E-02 0.00000000E+00 3.65206025E-03 0.00000000E+00 + 0.00000000E+00 1.87358990E-08 0.00000000E+00 9.72749140E-11-5.97945193E-03 + 1.62930467E-08-3.10721744E-05 8.45799959E-11 3.53626850E-03 0.00000000E+00 + 2.59949574E-03-4.27672608E-18 6.16393998E-02 0.00000000E+00 3.26098680E-02 +-5.78076322E-17 0.00000000E+00 1.87119159E-08 0.00000000E+00-9.72164760E-11 +-5.99367294E-03 1.62489536E-08 3.11132090E-05-8.44633404E-11 2.87529656E-02 + 0.00000000E+00 3.65206025E-03 0.00000000E+00 2.13547864E-02-5.52055320E-17 + 2.73941246E-03-8.90375909E-18 4.87020872E-01 0.00000000E+00 6.01218408E-02 + 0.00000000E+00 2.61326225E-01-2.84711866E-16 3.27216646E-02-1.70917629E-17 + 5.91820629E-03 1.62710031E-08 3.07569146E-05 8.45825574E-11 0.00000000E+00 + 1.87652591E-08 0.00000000E+00 9.75284361E-11 2.46268171E-03 4.00014899E-18 + 3.42183754E-03 0.00000000E+00 3.24992731E-02 6.30951619E-17 6.32474231E-02 + 0.00000000E+00 5.93483151E-03 1.63218133E-08-3.08048860E-05-8.47319133E-11 + 0.00000000E+00 1.88048132E-08 0.00000000E+00-9.76458784E-11 2.02477481E-02 + 2.40474954E-17 2.59948652E-03 2.90270919E-18 2.78319708E-02 0.00000000E+00 + 3.53626111E-03 0.00000000E+00 2.60435396E-01 5.40907831E-16 3.26097671E-02 + 6.66000030E-17 4.99517269E-01 0.00000000E+00 6.16388531E-02 0.00000000E+00 + 8.99981963E-03 0.00000000E+00 5.62277661E-05 0.00000000E+00 1.43802116E-03 +-3.83849292E-18 9.01670128E-06-2.36657650E-20 0.00000000E+00 9.44429965E-10 +-2.98853203E-04 8.21894993E-10 0.00000000E+00 9.44429965E-10-2.98853203E-04 + 8.21894993E-10 5.15743796E-02 0.00000000E+00-9.73982466E-07 0.00000000E+00 + 8.63208934E-03-2.32733225E-17 7.58863198E-07-9.58270535E-21 0.00000000E+00 +-1.88048132E-08 0.00000000E+00-2.06696984E-08 5.93483151E-03-1.63218133E-08 + 6.55366955E-03-1.79700113E-08 0.00000000E+00-1.88048132E-08 0.00000000E+00 +-2.06696984E-08 5.93483151E-03-1.63218133E-08 6.55366955E-03-1.79700113E-08 + 8.85519020E-03 0.00000000E+00-5.53929930E-05 0.00000000E+00 1.55073862E-03 +-5.00778496E-18-9.66714802E-06 3.07525469E-20 0.00000000E+00-1.87358990E-08 + 0.00000000E+00 9.39771395E-10 5.97945193E-03-1.62930467E-08-2.97141383E-04 + 8.19599366E-10 0.00000000E+00-1.87358990E-08 0.00000000E+00 9.39771395E-10 + 5.97945193E-03-1.62930467E-08-2.97141383E-04 8.19599366E-10-2.93773253E-04 +-8.06316730E-10 1.19928340E-08 3.73389913E-14 0.00000000E+00-9.32280177E-10 + 0.00000000E+00 2.93605608E-14-1.26554206E-03-1.72571455E-18-1.73952466E-03 + 0.00000000E+00-1.62772601E-02-3.24237912E-17-3.12215690E-02 0.00000000E+00 + 6.55366955E-03 1.79700113E-08 2.22782230E-08-3.51516527E-14 0.00000000E+00 + 2.06696984E-08 0.00000000E+00-7.67951082E-14 2.59948652E-03 2.90270919E-18 + 1.03990755E-02 1.64253247E-17 3.53626111E-03 0.00000000E+00 1.41455471E-02 + 0.00000000E+00 3.26097671E-02 6.66000030E-17 1.30439728E-01 2.32766576E-16 + 6.16388531E-02 0.00000000E+00 2.46588995E-01 0.00000000E+00-3.01486722E-04 +-8.06329969E-10 1.02586464E-08-2.91638816E-14 0.00000000E+00-9.32650430E-10 + 0.00000000E+00-1.46094951E-14 2.59949574E-03 4.27672608E-18-1.33472705E-03 +-3.29512129E-18 3.53626850E-03 0.00000000E+00-1.79708219E-03 0.00000000E+00 + 3.26098680E-02 5.78076322E-17-1.63328831E-02-1.87248488E-17 6.16393998E-02 + 0.00000000E+00-3.04403101E-02 0.00000000E+00 0.00000000E+00-9.32280177E-10 + 0.00000000E+00 2.93605608E-14 2.93773253E-04-8.06316730E-10-1.19928340E-08 + 3.73389913E-14-1.73952466E-03 0.00000000E+00-1.26554206E-03 1.72571455E-18 +-3.12215690E-02 0.00000000E+00-1.62772601E-02 3.24237912E-17 0.00000000E+00 + 2.06696984E-08 0.00000000E+00-7.67951082E-14-6.55366955E-03 1.79700113E-08 +-2.22782230E-08-3.51516527E-14 3.53626111E-03 0.00000000E+00 1.41455471E-02 + 0.00000000E+00 2.59948652E-03-2.90270919E-18 1.03990755E-02-1.64253247E-17 + 6.16388531E-02 0.00000000E+00 2.46588995E-01 0.00000000E+00 3.26097671E-02 +-6.66000030E-17 1.30439728E-01-2.32766576E-16 0.00000000E+00-9.32650430E-10 + 0.00000000E+00-1.46094951E-14 3.01486722E-04-8.06329969E-10-1.02586464E-08 +-2.91638816E-14 3.53626850E-03 0.00000000E+00-1.79708219E-03 0.00000000E+00 + 2.59949574E-03-4.27672608E-18-1.33472705E-03 3.29512129E-18 6.16393998E-02 + 0.00000000E+00-3.04403101E-02 0.00000000E+00 3.26098680E-02-5.78076322E-17 +-1.63328831E-02 1.87248488E-17-2.93773253E-04-8.06316730E-10 1.19928340E-08 + 3.73389913E-14 0.00000000E+00-9.32280177E-10 0.00000000E+00 2.93605608E-14 +-1.26554206E-03-1.72571455E-18-1.73952466E-03 0.00000000E+00-1.26554206E-03 +-1.72571455E-18-1.73952466E-03 0.00000000E+00 6.55366955E-03 1.79700113E-08 + 2.22782230E-08-3.51516527E-14 0.00000000E+00 2.06696984E-08 0.00000000E+00 +-7.67951082E-14 2.59948652E-03 2.90270919E-18 1.03990755E-02 1.64253247E-17 + 3.53626111E-03 0.00000000E+00 1.41455471E-02 0.00000000E+00 2.59948652E-03 + 2.90270919E-18 1.03990755E-02 1.64253247E-17 3.53626111E-03 0.00000000E+00 + 1.41455471E-02 0.00000000E+00-3.01486722E-04-8.06329969E-10 1.02586464E-08 +-2.91638816E-14 0.00000000E+00-9.32650430E-10 0.00000000E+00-1.46094951E-14 + 2.59949574E-03 4.27672608E-18-1.33472705E-03-3.29512129E-18 3.53626850E-03 + 0.00000000E+00-1.79708219E-03 0.00000000E+00 2.59949574E-03 4.27672608E-18 +-1.33472705E-03-3.29512129E-18 3.53626850E-03 0.00000000E+00-1.79708219E-03 + 0.00000000E+00 0.00000000E+00-9.32280177E-10 0.00000000E+00 2.93605608E-14 + 2.93773253E-04-8.06316730E-10-1.19928340E-08 3.73389913E-14-1.73952466E-03 + 0.00000000E+00-1.26554206E-03 1.72571455E-18-1.73952466E-03 0.00000000E+00 +-1.26554206E-03 1.72571455E-18 0.00000000E+00 2.06696984E-08 0.00000000E+00 +-7.67951082E-14-6.55366955E-03 1.79700113E-08-2.22782230E-08-3.51516527E-14 + 3.53626111E-03 0.00000000E+00 1.41455471E-02 0.00000000E+00 2.59948652E-03 +-2.90270919E-18 1.03990755E-02-1.64253247E-17 3.53626111E-03 0.00000000E+00 + 1.41455471E-02 0.00000000E+00 2.59948652E-03-2.90270919E-18 1.03990755E-02 +-1.64253247E-17 0.00000000E+00-9.32650430E-10 0.00000000E+00-1.46094951E-14 + 3.01486722E-04-8.06329969E-10-1.02586464E-08-2.91638816E-14 3.53626850E-03 + 0.00000000E+00-1.79708219E-03 0.00000000E+00 2.59949574E-03-4.27672608E-18 +-1.33472705E-03 3.29512129E-18 3.53626850E-03 0.00000000E+00-1.79708219E-03 + 0.00000000E+00 2.59949574E-03-4.27672608E-18-1.33472705E-03 3.29512129E-18 +-8.96336248E-06-2.42966068E-20-5.38746809E-08-1.43499321E-22-5.63000931E-05 + 0.00000000E+00-3.37174109E-07 0.00000000E+00-1.19928340E-08-3.73389913E-14 + 0.00000000E+00-2.93605608E-14-1.19928340E-08-3.73389913E-14 0.00000000E+00 +-2.93605608E-14 7.58863198E-07 9.58270535E-21 1.49275093E-07 4.19548066E-22 +-9.73982466E-07 0.00000000E+00 8.91836805E-07 0.00000000E+00 3.08048860E-05 + 8.47319133E-11-2.22782230E-08 3.51516527E-14 0.00000000E+00 9.76458784E-11 + 0.00000000E+00 7.67951082E-14 3.08048860E-05 8.47319133E-11-2.22782230E-08 + 3.51516527E-14 0.00000000E+00 9.76458784E-11 0.00000000E+00 7.67951082E-14 + 9.72220608E-06 3.18707215E-20-5.80972675E-08-1.87704649E-22 5.53261909E-05 + 0.00000000E+00-3.31753710E-07 0.00000000E+00-3.10721744E-05-8.45799959E-11 +-1.02586464E-08 2.91638816E-14 0.00000000E+00-9.72749140E-11 0.00000000E+00 + 1.46094951E-14-3.10721744E-05-8.45799959E-11-1.02586464E-08 2.91638816E-14 + 0.00000000E+00-9.72749140E-11 0.00000000E+00 1.46094951E-14 1.43802116E-03 + 3.83849292E-18 9.01670128E-06 2.36657650E-20 8.99981963E-03 0.00000000E+00 + 5.62277661E-05 0.00000000E+00 2.98853203E-04 8.21894993E-10 0.00000000E+00 + 9.44429965E-10 2.98853203E-04 8.21894993E-10 0.00000000E+00 9.44429965E-10 + 8.63208934E-03 2.32733225E-17 7.58863198E-07 9.58270535E-21 5.15743796E-02 + 0.00000000E+00-9.73982466E-07 0.00000000E+00-5.93483151E-03-1.63218133E-08 +-6.55366955E-03-1.79700113E-08 0.00000000E+00-1.88048132E-08 0.00000000E+00 +-2.06696984E-08-5.93483151E-03-1.63218133E-08-6.55366955E-03-1.79700113E-08 + 0.00000000E+00-1.88048132E-08 0.00000000E+00-2.06696984E-08 1.55073862E-03 + 5.00778496E-18-9.66714802E-06-3.07525469E-20 8.85519020E-03 0.00000000E+00 +-5.53929930E-05 0.00000000E+00-5.97945193E-03-1.62930467E-08 2.97141383E-04 + 8.19599366E-10 0.00000000E+00-1.87358990E-08 0.00000000E+00 9.39771395E-10 +-5.97945193E-03-1.62930467E-08 2.97141383E-04 8.19599366E-10 0.00000000E+00 +-1.87358990E-08 0.00000000E+00 9.39771395E-10-5.63000931E-05 0.00000000E+00 +-3.37174109E-07 0.00000000E+00-8.96336248E-06 2.42966068E-20-5.38746809E-08 + 1.43499321E-22 0.00000000E+00-2.93605608E-14 1.19928340E-08-3.73389913E-14 + 0.00000000E+00-2.93605608E-14 1.19928340E-08-3.73389913E-14-9.73982466E-07 + 0.00000000E+00 8.91836805E-07 0.00000000E+00 7.58863198E-07-9.58270535E-21 + 1.49275093E-07-4.19548066E-22 0.00000000E+00 9.76458784E-11 0.00000000E+00 + 7.67951082E-14-3.08048860E-05 8.47319133E-11 2.22782230E-08 3.51516527E-14 + 0.00000000E+00 9.76458784E-11 0.00000000E+00 7.67951082E-14-3.08048860E-05 + 8.47319133E-11 2.22782230E-08 3.51516527E-14 5.53261909E-05 0.00000000E+00 +-3.31753710E-07 0.00000000E+00 9.72220608E-06-3.18707215E-20-5.80972675E-08 + 1.87704649E-22 0.00000000E+00-9.72749140E-11 0.00000000E+00 1.46094951E-14 + 3.10721744E-05-8.45799959E-11 1.02586464E-08 2.91638816E-14 0.00000000E+00 +-9.72749140E-11 0.00000000E+00 1.46094951E-14 3.10721744E-05-8.45799959E-11 + 1.02586464E-08 2.91638816E-14 0.00000000E+00 1.87652591E-08 0.00000000E+00 + 9.75284361E-11-5.91820629E-03 1.62710031E-08-3.07569146E-05 8.45825574E-11 + 3.42183754E-03 0.00000000E+00 2.46268171E-03-4.00014899E-18 3.42183754E-03 + 0.00000000E+00 2.46268171E-03-4.00014899E-18 0.00000000E+00 1.88048132E-08 + 0.00000000E+00-9.76458784E-11-5.93483151E-03 1.63218133E-08 3.08048860E-05 +-8.47319133E-11 2.78319708E-02 0.00000000E+00 3.53626111E-03 0.00000000E+00 + 2.02477481E-02-2.40474954E-17 2.59948652E-03-2.90270919E-18 2.78319708E-02 + 0.00000000E+00 3.53626111E-03 0.00000000E+00 2.02477481E-02-2.40474954E-17 + 2.59948652E-03-2.90270919E-18 5.91820629E-03 1.62710031E-08 3.07569146E-05 + 8.45825574E-11 0.00000000E+00 1.87652591E-08 0.00000000E+00 9.75284361E-11 + 2.46268171E-03 4.00014899E-18 3.42183754E-03 0.00000000E+00 2.46268171E-03 + 4.00014899E-18 3.42183754E-03 0.00000000E+00 5.93483151E-03 1.63218133E-08 +-3.08048860E-05-8.47319133E-11 0.00000000E+00 1.88048132E-08 0.00000000E+00 +-9.76458784E-11 2.02477481E-02 2.40474954E-17 2.59948652E-03 2.90270919E-18 + 2.78319708E-02 0.00000000E+00 3.53626111E-03 0.00000000E+00 2.02477481E-02 + 2.40474954E-17 2.59948652E-03 2.90270919E-18 2.78319708E-02 0.00000000E+00 + 3.53626111E-03 0.00000000E+00 0.00000000E+00 1.87652591E-08 0.00000000E+00 + 9.75284361E-11-5.91820629E-03 1.62710031E-08-3.07569146E-05 8.45825574E-11 + 3.42183754E-03 0.00000000E+00 2.46268171E-03-4.00014899E-18 6.32474231E-02 + 0.00000000E+00 3.24992731E-02-6.30951619E-17 0.00000000E+00 1.88048132E-08 + 0.00000000E+00-9.76458784E-11-5.93483151E-03 1.63218133E-08 3.08048860E-05 +-8.47319133E-11 2.78319708E-02 0.00000000E+00 3.53626111E-03 0.00000000E+00 + 2.02477481E-02-2.40474954E-17 2.59948652E-03-2.90270919E-18 4.99517269E-01 + 0.00000000E+00 6.16388531E-02 0.00000000E+00 2.60435396E-01-5.40907831E-16 + 3.26097671E-02-6.66000030E-17 5.84801230E-03 1.59314416E-08 3.03950530E-05 + 8.28448836E-11 0.00000000E+00 1.84360994E-08 0.00000000E+00 9.58488182E-11 + 2.32911557E-03 6.23195571E-18 3.30884414E-03 0.00000000E+00 3.23911639E-02 + 8.02921054E-17 6.49565437E-02 0.00000000E+00 5.86690756E-03 1.60210629E-08 +-3.04495740E-05-8.31030585E-11 0.00000000E+00 1.85225266E-08 0.00000000E+00 +-9.60975538E-11 1.91662945E-02 4.71516685E-17 2.46268942E-03 5.12139935E-18 + 2.69224054E-02 0.00000000E+00 3.42185444E-03 0.00000000E+00 2.59561744E-01 + 5.19470162E-16 3.24994141E-02 5.39449728E-17 5.12785565E-01 0.00000000E+00 + 6.32473035E-02 0.00000000E+00 9.15636419E-03 0.00000000E+00 5.72036162E-05 + 0.00000000E+00 1.32891196E-03-4.56733656E-18 8.33374908E-06-2.90041387E-20 + 0.00000000E+00 9.37284300E-10-2.95747259E-04 8.12583895E-10 0.00000000E+00 + 9.37284300E-10-2.95747259E-04 8.12583895E-10 5.24438997E-02 0.00000000E+00 +-1.05413637E-06 0.00000000E+00 7.99125440E-03-2.63294231E-17 7.34503644E-07 + 7.37838736E-21 0.00000000E+00-1.85225266E-08 0.00000000E+00-2.05215764E-08 + 5.86690756E-03-1.60210629E-08 6.48258185E-03-1.77717936E-08 0.00000000E+00 +-1.85225266E-08 0.00000000E+00-2.05215764E-08 5.86690756E-03-1.60210629E-08 + 6.48258185E-03-1.77717936E-08 8.99981963E-03 0.00000000E+00-5.63000931E-05 + 0.00000000E+00 1.43802116E-03-3.83849292E-18-8.96336248E-06 2.42966068E-20 + 0.00000000E+00-1.87652591E-08 0.00000000E+00 9.32280177E-10 5.91820629E-03 +-1.62710031E-08-2.93773253E-04 8.06316730E-10 0.00000000E+00-1.87652591E-08 + 0.00000000E+00 9.32280177E-10 5.91820629E-03-1.62710031E-08-2.93773253E-04 + 8.06316730E-10-2.89973692E-04-7.85207648E-10 1.36302589E-08 6.45437313E-14 + 0.00000000E+00-9.10888339E-10 0.00000000E+00 6.21839221E-14-1.19795125E-03 +-2.83833877E-18-1.68267465E-03 0.00000000E+00-1.62226445E-02-3.35592696E-17 +-3.20509618E-02 0.00000000E+00 6.48258185E-03 1.77717936E-08 2.55845816E-08 + 1.42836868E-13 0.00000000E+00 2.05215764E-08 0.00000000E+00 1.44611847E-13 + 2.46268942E-03 5.12139935E-18 9.85189640E-03 1.82648175E-17 3.42185444E-03 + 0.00000000E+00 1.36878889E-02 0.00000000E+00 3.24994141E-02 5.39449728E-17 + 1.29998177E-01 2.44616867E-16 6.32473035E-02 0.00000000E+00 2.53025409E-01 + 0.00000000E+00-2.98853203E-04-8.21894993E-10 1.19928340E-08 3.73389913E-14 + 0.00000000E+00-9.44429965E-10 0.00000000E+00 2.93605608E-14 2.46268171E-03 + 4.00014899E-18-1.26554206E-03-1.72571455E-18 3.42183754E-03 0.00000000E+00 +-1.73952466E-03 0.00000000E+00 3.24992731E-02 6.30951619E-17-1.62772601E-02 +-3.24237912E-17 6.32474231E-02 0.00000000E+00-3.12215690E-02 0.00000000E+00 + 0.00000000E+00-9.10888339E-10 0.00000000E+00 6.21839221E-14 2.89973692E-04 +-7.85207648E-10-1.36302589E-08 6.45437313E-14-1.68267465E-03 0.00000000E+00 +-1.19795125E-03 2.83833877E-18-3.20509618E-02 0.00000000E+00-1.62226445E-02 + 3.35592696E-17 0.00000000E+00 2.05215764E-08 0.00000000E+00 1.44611847E-13 +-6.48258185E-03 1.77717936E-08-2.55845816E-08 1.42836868E-13 3.42185444E-03 + 0.00000000E+00 1.36878889E-02 0.00000000E+00 2.46268942E-03-5.12139935E-18 + 9.85189640E-03-1.82648175E-17 6.32473035E-02 0.00000000E+00 2.53025409E-01 + 0.00000000E+00 3.24994141E-02-5.39449728E-17 1.29998177E-01-2.44616867E-16 + 0.00000000E+00-9.44429965E-10 0.00000000E+00 2.93605608E-14 2.98853203E-04 +-8.21894993E-10-1.19928340E-08 3.73389913E-14 3.42183754E-03 0.00000000E+00 +-1.73952466E-03 0.00000000E+00 2.46268171E-03-4.00014899E-18-1.26554206E-03 + 1.72571455E-18 6.32474231E-02 0.00000000E+00-3.12215690E-02 0.00000000E+00 + 3.24992731E-02-6.30951619E-17-1.62772601E-02 3.24237912E-17-2.89973692E-04 +-7.85207648E-10 1.36302589E-08 6.45437313E-14 0.00000000E+00-9.10888339E-10 + 0.00000000E+00 6.21839221E-14-1.19795125E-03-2.83833877E-18-1.68267465E-03 + 0.00000000E+00-1.19795125E-03-2.83833877E-18-1.68267465E-03 0.00000000E+00 + 6.48258185E-03 1.77717936E-08 2.55845816E-08 1.42836868E-13 0.00000000E+00 + 2.05215764E-08 0.00000000E+00 1.44611847E-13 2.46268942E-03 5.12139935E-18 + 9.85189640E-03 1.82648175E-17 3.42185444E-03 0.00000000E+00 1.36878889E-02 + 0.00000000E+00 2.46268942E-03 5.12139935E-18 9.85189640E-03 1.82648175E-17 + 3.42185444E-03 0.00000000E+00 1.36878889E-02 0.00000000E+00-2.98853203E-04 +-8.21894993E-10 1.19928340E-08 3.73389913E-14 0.00000000E+00-9.44429965E-10 + 0.00000000E+00 2.93605608E-14 2.46268171E-03 4.00014899E-18-1.26554206E-03 +-1.72571455E-18 3.42183754E-03 0.00000000E+00-1.73952466E-03 0.00000000E+00 + 2.46268171E-03 4.00014899E-18-1.26554206E-03-1.72571455E-18 3.42183754E-03 + 0.00000000E+00-1.73952466E-03 0.00000000E+00 0.00000000E+00-9.10888339E-10 + 0.00000000E+00 6.21839221E-14 2.89973692E-04-7.85207648E-10-1.36302589E-08 + 6.45437313E-14-1.68267465E-03 0.00000000E+00-1.19795125E-03 2.83833877E-18 +-1.68267465E-03 0.00000000E+00-1.19795125E-03 2.83833877E-18 0.00000000E+00 + 2.05215764E-08 0.00000000E+00 1.44611847E-13-6.48258185E-03 1.77717936E-08 +-2.55845816E-08 1.42836868E-13 3.42185444E-03 0.00000000E+00 1.36878889E-02 + 0.00000000E+00 2.46268942E-03-5.12139935E-18 9.85189640E-03-1.82648175E-17 + 3.42185444E-03 0.00000000E+00 1.36878889E-02 0.00000000E+00 2.46268942E-03 +-5.12139935E-18 9.85189640E-03-1.82648175E-17 0.00000000E+00-9.44429965E-10 + 0.00000000E+00 2.93605608E-14 2.98853203E-04-8.21894993E-10-1.19928340E-08 + 3.73389913E-14 3.42183754E-03 0.00000000E+00-1.73952466E-03 0.00000000E+00 + 2.46268171E-03-4.00014899E-18-1.26554206E-03 1.72571455E-18 3.42183754E-03 + 0.00000000E+00-1.73952466E-03 0.00000000E+00 2.46268171E-03-4.00014899E-18 +-1.26554206E-03 1.72571455E-18-8.28213344E-06-2.81402042E-20-4.97872470E-08 +-1.71476289E-22-5.72819065E-05 0.00000000E+00-3.43040951E-07 0.00000000E+00 +-1.36302589E-08-6.45437313E-14 0.00000000E+00-6.21839221E-14-1.36302589E-08 +-6.45437313E-14 0.00000000E+00-6.21839221E-14 7.34503644E-07-7.37838736E-21 + 1.38195027E-07 4.39216204E-22-1.05413637E-06 0.00000000E+00 9.06881138E-07 + 0.00000000E+00 3.04495740E-05 8.31030585E-11-2.55845816E-08-1.42836868E-13 + 0.00000000E+00 9.60975538E-11 0.00000000E+00-1.44611847E-13 3.04495740E-05 + 8.31030585E-11-2.55845816E-08-1.42836868E-13 0.00000000E+00 9.60975538E-11 + 0.00000000E+00-1.44611847E-13 9.01670128E-06 2.36657650E-20-5.38746809E-08 +-1.43499321E-22 5.62277661E-05 0.00000000E+00-3.37174109E-07 0.00000000E+00 +-3.07569146E-05-8.45825574E-11-1.19928340E-08-3.73389913E-14 0.00000000E+00 +-9.75284361E-11 0.00000000E+00-2.93605608E-14-3.07569146E-05-8.45825574E-11 +-1.19928340E-08-3.73389913E-14 0.00000000E+00-9.75284361E-11 0.00000000E+00 +-2.93605608E-14 1.32891196E-03 4.56733656E-18 8.33374908E-06 2.90041387E-20 + 9.15636419E-03 0.00000000E+00 5.72036162E-05 0.00000000E+00 2.95747259E-04 + 8.12583895E-10 0.00000000E+00 9.37284300E-10 2.95747259E-04 8.12583895E-10 + 0.00000000E+00 9.37284300E-10 7.99125440E-03 2.63294231E-17 7.34503644E-07 +-7.37838736E-21 5.24438997E-02 0.00000000E+00-1.05413637E-06 0.00000000E+00 +-5.86690756E-03-1.60210629E-08-6.48258185E-03-1.77717936E-08 0.00000000E+00 +-1.85225266E-08 0.00000000E+00-2.05215764E-08-5.86690756E-03-1.60210629E-08 +-6.48258185E-03-1.77717936E-08 0.00000000E+00-1.85225266E-08 0.00000000E+00 +-2.05215764E-08 1.43802116E-03 3.83849292E-18-8.96336248E-06-2.42966068E-20 + 8.99981963E-03 0.00000000E+00-5.63000931E-05 0.00000000E+00-5.91820629E-03 +-1.62710031E-08 2.93773253E-04 8.06316730E-10 0.00000000E+00-1.87652591E-08 + 0.00000000E+00 9.32280177E-10-5.91820629E-03-1.62710031E-08 2.93773253E-04 + 8.06316730E-10 0.00000000E+00-1.87652591E-08 0.00000000E+00 9.32280177E-10 +-5.72819065E-05 0.00000000E+00-3.43040951E-07 0.00000000E+00-8.28213344E-06 + 2.81402042E-20-4.97872470E-08 1.71476289E-22 0.00000000E+00-6.21839221E-14 + 1.36302589E-08-6.45437313E-14 0.00000000E+00-6.21839221E-14 1.36302589E-08 +-6.45437313E-14-1.05413637E-06 0.00000000E+00 9.06881138E-07 0.00000000E+00 + 7.34503644E-07 7.37838736E-21 1.38195027E-07-4.39216204E-22 0.00000000E+00 + 9.60975538E-11 0.00000000E+00-1.44611847E-13-3.04495740E-05 8.31030585E-11 + 2.55845816E-08-1.42836868E-13 0.00000000E+00 9.60975538E-11 0.00000000E+00 +-1.44611847E-13-3.04495740E-05 8.31030585E-11 2.55845816E-08-1.42836868E-13 + 5.62277661E-05 0.00000000E+00-3.37174109E-07 0.00000000E+00 9.01670128E-06 +-2.36657650E-20-5.38746809E-08 1.43499321E-22 0.00000000E+00-9.75284361E-11 + 0.00000000E+00-2.93605608E-14 3.07569146E-05-8.45825574E-11 1.19928340E-08 +-3.73389913E-14 0.00000000E+00-9.75284361E-11 0.00000000E+00-2.93605608E-14 + 3.07569146E-05-8.45825574E-11 1.19928340E-08-3.73389913E-14 0.00000000E+00 + 1.84360994E-08 0.00000000E+00 9.58488182E-11-5.84801230E-03 1.59314416E-08 +-3.03950530E-05 8.28448836E-11 3.30884414E-03 0.00000000E+00 2.32911557E-03 +-6.23195571E-18 3.30884414E-03 0.00000000E+00 2.32911557E-03-6.23195571E-18 + 0.00000000E+00 1.85225266E-08 0.00000000E+00-9.60975538E-11-5.86690756E-03 + 1.60210629E-08 3.04495740E-05-8.31030585E-11 2.69224054E-02 0.00000000E+00 + 3.42185444E-03 0.00000000E+00 1.91662945E-02-4.71516685E-17 2.46268942E-03 +-5.12139935E-18 2.69224054E-02 0.00000000E+00 3.42185444E-03 0.00000000E+00 + 1.91662945E-02-4.71516685E-17 2.46268942E-03-5.12139935E-18 5.84801230E-03 + 1.59314416E-08 3.03950530E-05 8.28448836E-11 0.00000000E+00 1.84360994E-08 + 0.00000000E+00 9.58488182E-11 2.32911557E-03 6.23195571E-18 3.30884414E-03 + 0.00000000E+00 2.32911557E-03 6.23195571E-18 3.30884414E-03 0.00000000E+00 + 5.86690756E-03 1.60210629E-08-3.04495740E-05-8.31030585E-11 0.00000000E+00 + 1.85225266E-08 0.00000000E+00-9.60975538E-11 1.91662945E-02 4.71516685E-17 + 2.46268942E-03 5.12139935E-18 2.69224054E-02 0.00000000E+00 3.42185444E-03 + 0.00000000E+00 1.91662945E-02 4.71516685E-17 2.46268942E-03 5.12139935E-18 + 2.69224054E-02 0.00000000E+00 3.42185444E-03 0.00000000E+00 0.00000000E+00 + 1.84360994E-08 0.00000000E+00 9.58488182E-11-5.84801230E-03 1.59314416E-08 +-3.03950530E-05 8.28448836E-11 3.30884414E-03 0.00000000E+00 2.32911557E-03 +-6.23195571E-18 6.49565437E-02 0.00000000E+00 3.23911639E-02-8.02921054E-17 + 0.00000000E+00 1.85225266E-08 0.00000000E+00-9.60975538E-11-5.86690756E-03 + 1.60210629E-08 3.04495740E-05-8.31030585E-11 2.69224054E-02 0.00000000E+00 + 3.42185444E-03 0.00000000E+00 1.91662945E-02-4.71516685E-17 2.46268942E-03 +-5.12139935E-18 5.12785565E-01 0.00000000E+00 6.32473035E-02 0.00000000E+00 + 2.59561744E-01-5.19470162E-16 3.24994141E-02-5.39449728E-17 5.76908586E-03 + 1.55929159E-08 2.99877757E-05 8.10878574E-11 0.00000000E+00 1.81133405E-08 + 0.00000000E+00 9.41749501E-11 2.19881840E-03 6.78436473E-18 3.19719271E-03 + 0.00000000E+00 3.22851641E-02 8.26035667E-17 6.67748425E-02 0.00000000E+00 + 5.79020672E-03 1.56811786E-08-3.00487209E-05-8.13427179E-11 0.00000000E+00 + 1.81983748E-08 0.00000000E+00-9.44205640E-11 1.81108061E-02 4.89852724E-17 + 2.32911916E-03 5.70728089E-18 2.60238112E-02 0.00000000E+00 3.30885522E-03 + 0.00000000E+00 2.58704982E-01 6.93850403E-16 3.23912444E-02 8.72980460E-17 + 5.26891740E-01 0.00000000E+00 6.49562595E-02 0.00000000E+00 9.32580950E-03 + 0.00000000E+00 5.82598827E-05 0.00000000E+00 1.22334642E-03-2.56110250E-18 + 7.67296125E-06-1.61425573E-20 0.00000000E+00 9.20744546E-10-2.92197082E-04 + 7.95313638E-10 0.00000000E+00 9.20744546E-10-2.92197082E-04 7.95313638E-10 + 5.33850645E-02 0.00000000E+00-1.14100310E-06 0.00000000E+00 7.37111879E-03 +-1.97188932E-17 7.10674077E-07-1.55315058E-20 0.00000000E+00-1.81983748E-08 + 0.00000000E+00-2.01491718E-08 5.79020672E-03-1.56811786E-08 6.40177624E-03 +-1.73869493E-08 0.00000000E+00-1.81983748E-08 0.00000000E+00-2.01491718E-08 + 5.79020672E-03-1.56811786E-08 6.40177624E-03-1.73869493E-08 9.15636419E-03 + 0.00000000E+00-5.72819065E-05 0.00000000E+00 1.32891196E-03-4.56733656E-18 +-8.28213344E-06 2.81402042E-20 0.00000000E+00-1.84360994E-08 0.00000000E+00 + 9.10888339E-10 5.84801230E-03-1.59314416E-08-2.89973692E-04 7.85207648E-10 + 0.00000000E+00-1.84360994E-08 0.00000000E+00 9.10888339E-10 5.84801230E-03 +-1.59314416E-08-2.89973692E-04 7.85207648E-10-2.85743431E-04-7.68340888E-10 + 1.52363001E-08 6.37151206E-14 0.00000000E+00-8.94756941E-10 0.00000000E+00 + 6.14034667E-14-1.13198439E-03-3.12291141E-18-1.62651198E-03 0.00000000E+00 +-1.61691021E-02-4.24754032E-17-3.29327755E-02 0.00000000E+00 6.40177624E-03 + 1.73869493E-08 2.88389379E-08 1.22277221E-13 0.00000000E+00 2.01491718E-08 + 0.00000000E+00 1.14739700E-13 2.32911916E-03 5.70728089E-18 9.31763845E-03 + 2.38477269E-17 3.30885522E-03 0.00000000E+00 1.32358801E-02 0.00000000E+00 + 3.23912444E-02 8.72980460E-17 1.29565591E-01 3.24511850E-16 6.49562595E-02 + 0.00000000E+00 2.59864655E-01 0.00000000E+00-2.95747259E-04-8.12583895E-10 + 1.36302589E-08 6.45437313E-14 0.00000000E+00-9.37284300E-10 0.00000000E+00 + 6.21839221E-14 2.32911557E-03 6.23195571E-18-1.19795125E-03-2.83833877E-18 + 3.30884414E-03 0.00000000E+00-1.68267465E-03 0.00000000E+00 3.23911639E-02 + 8.02921054E-17-1.62226445E-02-3.35592696E-17 6.49565437E-02 0.00000000E+00 +-3.20509618E-02 0.00000000E+00 0.00000000E+00-8.94756941E-10 0.00000000E+00 + 6.14034667E-14 2.85743431E-04-7.68340888E-10-1.52363001E-08 6.37151206E-14 +-1.62651198E-03 0.00000000E+00-1.13198439E-03 3.12291141E-18-3.29327755E-02 + 0.00000000E+00-1.61691021E-02 4.24754032E-17 0.00000000E+00 2.01491718E-08 + 0.00000000E+00 1.14739700E-13-6.40177624E-03 1.73869493E-08-2.88389379E-08 + 1.22277221E-13 3.30885522E-03 0.00000000E+00 1.32358801E-02 0.00000000E+00 + 2.32911916E-03-5.70728089E-18 9.31763845E-03-2.38477269E-17 6.49562595E-02 + 0.00000000E+00 2.59864655E-01 0.00000000E+00 3.23912444E-02-8.72980460E-17 + 1.29565591E-01-3.24511850E-16 0.00000000E+00-9.37284300E-10 0.00000000E+00 + 6.21839221E-14 2.95747259E-04-8.12583895E-10-1.36302589E-08 6.45437313E-14 + 3.30884414E-03 0.00000000E+00-1.68267465E-03 0.00000000E+00 2.32911557E-03 +-6.23195571E-18-1.19795125E-03 2.83833877E-18 6.49565437E-02 0.00000000E+00 +-3.20509618E-02 0.00000000E+00 3.23911639E-02-8.02921054E-17-1.62226445E-02 + 3.35592696E-17-2.85743431E-04-7.68340888E-10 1.52363001E-08 6.37151206E-14 + 0.00000000E+00-8.94756941E-10 0.00000000E+00 6.14034667E-14-1.13198439E-03 +-3.12291141E-18-1.62651198E-03 0.00000000E+00-1.13198439E-03-3.12291141E-18 +-1.62651198E-03 0.00000000E+00 6.40177624E-03 1.73869493E-08 2.88389379E-08 + 1.22277221E-13 0.00000000E+00 2.01491718E-08 0.00000000E+00 1.14739700E-13 + 2.32911916E-03 5.70728089E-18 9.31763845E-03 2.38477269E-17 3.30885522E-03 + 0.00000000E+00 1.32358801E-02 0.00000000E+00 2.32911916E-03 5.70728089E-18 + 9.31763845E-03 2.38477269E-17 3.30885522E-03 0.00000000E+00 1.32358801E-02 + 0.00000000E+00-2.95747259E-04-8.12583895E-10 1.36302589E-08 6.45437313E-14 + 0.00000000E+00-9.37284300E-10 0.00000000E+00 6.21839221E-14 2.32911557E-03 + 6.23195571E-18-1.19795125E-03-2.83833877E-18 3.30884414E-03 0.00000000E+00 +-1.68267465E-03 0.00000000E+00 2.32911557E-03 6.23195571E-18-1.19795125E-03 +-2.83833877E-18 3.30884414E-03 0.00000000E+00-1.68267465E-03 0.00000000E+00 + 0.00000000E+00-8.94756941E-10 0.00000000E+00 6.14034667E-14 2.85743431E-04 +-7.68340888E-10-1.52363001E-08 6.37151206E-14-1.62651198E-03 0.00000000E+00 +-1.13198439E-03 3.12291141E-18-1.62651198E-03 0.00000000E+00-1.13198439E-03 + 3.12291141E-18 0.00000000E+00 2.01491718E-08 0.00000000E+00 1.14739700E-13 +-6.40177624E-03 1.73869493E-08-2.88389379E-08 1.22277221E-13 3.30885522E-03 + 0.00000000E+00 1.32358801E-02 0.00000000E+00 2.32911916E-03-5.70728089E-18 + 9.31763845E-03-2.38477269E-17 3.30885522E-03 0.00000000E+00 1.32358801E-02 + 0.00000000E+00 2.32911916E-03-5.70728089E-18 9.31763845E-03-2.38477269E-17 + 0.00000000E+00-9.37284300E-10 0.00000000E+00 6.21839221E-14 2.95747259E-04 +-8.12583895E-10-1.36302589E-08 6.45437313E-14 3.30884414E-03 0.00000000E+00 +-1.68267465E-03 0.00000000E+00 2.32911557E-03-6.23195571E-18-1.19795125E-03 + 2.83833877E-18 3.30884414E-03 0.00000000E+00-1.68267465E-03 0.00000000E+00 + 2.32911557E-03-6.23195571E-18-1.19795125E-03 2.83833877E-18-7.62303922E-06 +-1.58533488E-20-4.58325214E-08-9.56922938E-23-5.83446183E-05 0.00000000E+00 +-3.49391184E-07 0.00000000E+00-1.52363001E-08-6.37151206E-14 0.00000000E+00 +-6.14034667E-14-1.52363001E-08-6.37151206E-14 0.00000000E+00-6.14034667E-14 + 7.10674077E-07 1.55315058E-20 1.27472505E-07 3.48456114E-22-1.14100310E-06 + 0.00000000E+00 9.23164760E-07 0.00000000E+00 3.00487209E-05 8.13427179E-11 +-2.88389379E-08-1.22277221E-13 0.00000000E+00 9.44205640E-11 0.00000000E+00 +-1.14739700E-13 3.00487209E-05 8.13427179E-11-2.88389379E-08-1.22277221E-13 + 0.00000000E+00 9.44205640E-11 0.00000000E+00-1.14739700E-13 8.33374908E-06 + 2.90041387E-20-4.97872470E-08-1.71476289E-22 5.72036162E-05 0.00000000E+00 +-3.43040951E-07 0.00000000E+00-3.03950530E-05-8.28448836E-11-1.36302589E-08 +-6.45437313E-14 0.00000000E+00-9.58488182E-11 0.00000000E+00-6.21839221E-14 +-3.03950530E-05-8.28448836E-11-1.36302589E-08-6.45437313E-14 0.00000000E+00 +-9.58488182E-11 0.00000000E+00-6.21839221E-14 1.22334642E-03 2.56110250E-18 + 7.67296125E-06 1.61425573E-20 9.32580950E-03 0.00000000E+00 5.82598827E-05 + 0.00000000E+00 2.92197082E-04 7.95313638E-10 0.00000000E+00 9.20744546E-10 + 2.92197082E-04 7.95313638E-10 0.00000000E+00 9.20744546E-10 7.37111879E-03 + 1.97188932E-17 7.10674077E-07 1.55315058E-20 5.33850645E-02 0.00000000E+00 +-1.14100310E-06 0.00000000E+00-5.79020672E-03-1.56811786E-08-6.40177624E-03 +-1.73869493E-08 0.00000000E+00-1.81983748E-08 0.00000000E+00-2.01491718E-08 +-5.79020672E-03-1.56811786E-08-6.40177624E-03-1.73869493E-08 0.00000000E+00 +-1.81983748E-08 0.00000000E+00-2.01491718E-08 1.32891196E-03 4.56733656E-18 +-8.28213344E-06-2.81402042E-20 9.15636419E-03 0.00000000E+00-5.72819065E-05 + 0.00000000E+00-5.84801230E-03-1.59314416E-08 2.89973692E-04 7.85207648E-10 + 0.00000000E+00-1.84360994E-08 0.00000000E+00 9.10888339E-10-5.84801230E-03 +-1.59314416E-08 2.89973692E-04 7.85207648E-10 0.00000000E+00-1.84360994E-08 + 0.00000000E+00 9.10888339E-10-5.83446183E-05 0.00000000E+00-3.49391184E-07 + 0.00000000E+00-7.62303922E-06 1.58533488E-20-4.58325214E-08 9.56922938E-23 + 0.00000000E+00-6.14034667E-14 1.52363001E-08-6.37151206E-14 0.00000000E+00 +-6.14034667E-14 1.52363001E-08-6.37151206E-14-1.14100310E-06 0.00000000E+00 + 9.23164760E-07 0.00000000E+00 7.10674077E-07-1.55315058E-20 1.27472505E-07 +-3.48456114E-22 0.00000000E+00 9.44205640E-11 0.00000000E+00-1.14739700E-13 +-3.00487209E-05 8.13427179E-11 2.88389379E-08-1.22277221E-13 0.00000000E+00 + 9.44205640E-11 0.00000000E+00-1.14739700E-13-3.00487209E-05 8.13427179E-11 + 2.88389379E-08-1.22277221E-13 5.72036162E-05 0.00000000E+00-3.43040951E-07 + 0.00000000E+00 8.33374908E-06-2.90041387E-20-4.97872470E-08 1.71476289E-22 + 0.00000000E+00-9.58488182E-11 0.00000000E+00-6.21839221E-14 3.03950530E-05 +-8.28448836E-11 1.36302589E-08-6.45437313E-14 0.00000000E+00-9.58488182E-11 + 0.00000000E+00-6.21839221E-14 3.03950530E-05-8.28448836E-11 1.36302589E-08 +-6.45437313E-14 0.00000000E+00 1.81133405E-08 0.00000000E+00 9.41749501E-11 +-5.76908586E-03 1.55929159E-08-2.99877757E-05 8.10878574E-11 3.19719271E-03 + 0.00000000E+00 2.19881840E-03-6.78436473E-18 3.19719271E-03 0.00000000E+00 + 2.19881840E-03-6.78436473E-18 0.00000000E+00 1.81983748E-08 0.00000000E+00 +-9.44205640E-11-5.79020672E-03 1.56811786E-08 3.00487209E-05-8.13427179E-11 + 2.60238112E-02 0.00000000E+00 3.30885522E-03 0.00000000E+00 1.81108061E-02 +-4.89852724E-17 2.32911916E-03-5.70728089E-18 2.60238112E-02 0.00000000E+00 + 3.30885522E-03 0.00000000E+00 1.81108061E-02-4.89852724E-17 2.32911916E-03 +-5.70728089E-18 5.76908586E-03 1.55929159E-08 2.99877757E-05 8.10878574E-11 + 0.00000000E+00 1.81133405E-08 0.00000000E+00 9.41749501E-11 2.19881840E-03 + 6.78436473E-18 3.19719271E-03 0.00000000E+00 2.19881840E-03 6.78436473E-18 + 3.19719271E-03 0.00000000E+00 5.79020672E-03 1.56811786E-08-3.00487209E-05 +-8.13427179E-11 0.00000000E+00 1.81983748E-08 0.00000000E+00-9.44205640E-11 + 1.81108061E-02 4.89852724E-17 2.32911916E-03 5.70728089E-18 2.60238112E-02 + 0.00000000E+00 3.30885522E-03 0.00000000E+00 1.81108061E-02 4.89852724E-17 + 2.32911916E-03 5.70728089E-18 2.60238112E-02 0.00000000E+00 3.30885522E-03 + 0.00000000E+00 0.00000000E+00 1.81133405E-08 0.00000000E+00 9.41749501E-11 +-5.76908586E-03 1.55929159E-08-2.99877757E-05 8.10878574E-11 3.19719271E-03 + 0.00000000E+00 2.19881840E-03-6.78436473E-18 6.67748425E-02 0.00000000E+00 + 3.22851641E-02-8.26035667E-17 0.00000000E+00 1.81983748E-08 0.00000000E+00 +-9.44205640E-11-5.79020672E-03 1.56811786E-08 3.00487209E-05-8.13427179E-11 + 2.60238112E-02 0.00000000E+00 3.30885522E-03 0.00000000E+00 1.81108061E-02 +-4.89852724E-17 2.32911916E-03-5.70728089E-18 5.26891740E-01 0.00000000E+00 + 6.49562595E-02 0.00000000E+00 2.58704982E-01-6.93850403E-16 3.23912444E-02 +-8.72980460E-17 5.68180576E-03 1.52482245E-08 2.95369603E-05 7.92966569E-11 + 0.00000000E+00 1.77771835E-08 0.00000000E+00 9.24293752E-11 2.07185090E-03 + 9.58677228E-18 3.08685020E-03 0.00000000E+00 3.21814691E-02 8.97802769E-17 + 6.87126594E-02 0.00000000E+00 5.70502407E-03 1.53362154E-08-2.96039546E-05 +-7.95505221E-11 0.00000000E+00 1.78632906E-08 0.00000000E+00-9.26777854E-11 + 1.70817348E-02 6.78900744E-17 2.19882241E-03 7.09452185E-18 2.51358509E-02 + 0.00000000E+00 3.19720434E-03 0.00000000E+00 2.57866246E-01 6.62536703E-16 + 3.22852585E-02 7.79925675E-17 5.41913060E-01 0.00000000E+00 6.67745347E-02 + 0.00000000E+00 9.50931653E-03 0.00000000E+00 5.94037342E-05 0.00000000E+00 + 1.12130522E-03-2.94524948E-18 7.03420116E-06-1.82585187E-20 0.00000000E+00 + 9.04175640E-10-2.88206530E-04 7.78066934E-10 0.00000000E+00 9.04175640E-10 +-2.88206530E-04 7.78066934E-10 5.44038861E-02 0.00000000E+00-1.23561660E-06 + 0.00000000E+00 6.77136049E-03-1.51915483E-17 6.86954619E-07 3.46300968E-21 + 0.00000000E+00-1.78632906E-08 0.00000000E+00-1.97872792E-08 5.70502407E-03 +-1.53362154E-08 6.31146905E-03-1.70107669E-08 0.00000000E+00-1.78632906E-08 + 0.00000000E+00-1.97872792E-08 5.70502407E-03-1.53362154E-08 6.31146905E-03 +-1.70107669E-08 9.32580950E-03 0.00000000E+00-5.83446183E-05 0.00000000E+00 + 1.22334642E-03-2.56110250E-18-7.62303922E-06 1.58533488E-20 0.00000000E+00 +-1.81133405E-08 0.00000000E+00 8.94756941E-10 5.76908586E-03-1.55929159E-08 +-2.85743431E-04 7.68340888E-10 0.00000000E+00-1.81133405E-08 0.00000000E+00 + 8.94756941E-10 5.76908586E-03-1.55929159E-08-2.85743431E-04 7.68340888E-10 +-2.81112050E-04-7.51181301E-10 1.67485839E-08 6.34663132E-14 0.00000000E+00 +-8.77865997E-10 0.00000000E+00 6.21025524E-14-1.06766833E-03-4.17032353E-18 +-1.57101364E-03 0.00000000E+00-1.61166819E-02-4.19432111E-17-3.38717985E-02 + 0.00000000E+00 6.31146905E-03 1.70107669E-08 3.19691203E-08 1.28912140E-13 + 0.00000000E+00 1.97872792E-08 0.00000000E+00 1.25857622E-13 2.19882241E-03 + 7.09452185E-18 8.79647065E-03 2.82352026E-17 3.19720434E-03 0.00000000E+00 + 1.27892614E-02 0.00000000E+00 3.22852585E-02 7.79925675E-17 1.29141664E-01 + 3.26605840E-16 6.67745347E-02 0.00000000E+00 2.67141448E-01 0.00000000E+00 +-2.92197082E-04-7.95313638E-10 1.52363001E-08 6.37151206E-14 0.00000000E+00 +-9.20744546E-10 0.00000000E+00 6.14034667E-14 2.19881840E-03 6.78436473E-18 +-1.13198439E-03-3.12291141E-18 3.19719271E-03 0.00000000E+00-1.62651198E-03 + 0.00000000E+00 3.22851641E-02 8.26035667E-17-1.61691021E-02-4.24754032E-17 + 6.67748425E-02 0.00000000E+00-3.29327755E-02 0.00000000E+00 0.00000000E+00 +-8.77865997E-10 0.00000000E+00 6.21025524E-14 2.81112050E-04-7.51181301E-10 +-1.67485839E-08 6.34663132E-14-1.57101364E-03 0.00000000E+00-1.06766833E-03 + 4.17032353E-18-3.38717985E-02 0.00000000E+00-1.61166819E-02 4.19432111E-17 + 0.00000000E+00 1.97872792E-08 0.00000000E+00 1.25857622E-13-6.31146905E-03 + 1.70107669E-08-3.19691203E-08 1.28912140E-13 3.19720434E-03 0.00000000E+00 + 1.27892614E-02 0.00000000E+00 2.19882241E-03-7.09452185E-18 8.79647065E-03 +-2.82352026E-17 6.67745347E-02 0.00000000E+00 2.67141448E-01 0.00000000E+00 + 3.22852585E-02-7.79925675E-17 1.29141664E-01-3.26605840E-16 0.00000000E+00 +-9.20744546E-10 0.00000000E+00 6.14034667E-14 2.92197082E-04-7.95313638E-10 +-1.52363001E-08 6.37151206E-14 3.19719271E-03 0.00000000E+00-1.62651198E-03 + 0.00000000E+00 2.19881840E-03-6.78436473E-18-1.13198439E-03 3.12291141E-18 + 6.67748425E-02 0.00000000E+00-3.29327755E-02 0.00000000E+00 3.22851641E-02 +-8.26035667E-17-1.61691021E-02 4.24754032E-17-2.81112050E-04-7.51181301E-10 + 1.67485839E-08 6.34663132E-14 0.00000000E+00-8.77865997E-10 0.00000000E+00 + 6.21025524E-14-1.06766833E-03-4.17032353E-18-1.57101364E-03 0.00000000E+00 +-1.06766833E-03-4.17032353E-18-1.57101364E-03 0.00000000E+00 6.31146905E-03 + 1.70107669E-08 3.19691203E-08 1.28912140E-13 0.00000000E+00 1.97872792E-08 + 0.00000000E+00 1.25857622E-13 2.19882241E-03 7.09452185E-18 8.79647065E-03 + 2.82352026E-17 3.19720434E-03 0.00000000E+00 1.27892614E-02 0.00000000E+00 + 2.19882241E-03 7.09452185E-18 8.79647065E-03 2.82352026E-17 3.19720434E-03 + 0.00000000E+00 1.27892614E-02 0.00000000E+00-2.92197082E-04-7.95313638E-10 + 1.52363001E-08 6.37151206E-14 0.00000000E+00-9.20744546E-10 0.00000000E+00 + 6.14034667E-14 2.19881840E-03 6.78436473E-18-1.13198439E-03-3.12291141E-18 + 3.19719271E-03 0.00000000E+00-1.62651198E-03 0.00000000E+00 2.19881840E-03 + 6.78436473E-18-1.13198439E-03-3.12291141E-18 3.19719271E-03 0.00000000E+00 +-1.62651198E-03 0.00000000E+00 0.00000000E+00-8.77865997E-10 0.00000000E+00 + 6.21025524E-14 2.81112050E-04-7.51181301E-10-1.67485839E-08 6.34663132E-14 +-1.57101364E-03 0.00000000E+00-1.06766833E-03 4.17032353E-18-1.57101364E-03 + 0.00000000E+00-1.06766833E-03 4.17032353E-18 0.00000000E+00 1.97872792E-08 + 0.00000000E+00 1.25857622E-13-6.31146905E-03 1.70107669E-08-3.19691203E-08 + 1.28912140E-13 3.19720434E-03 0.00000000E+00 1.27892614E-02 0.00000000E+00 + 2.19882241E-03-7.09452185E-18 8.79647065E-03-2.82352026E-17 3.19720434E-03 + 0.00000000E+00 1.27892614E-02 0.00000000E+00 2.19882241E-03-7.09452185E-18 + 8.79647065E-03-2.82352026E-17 0.00000000E+00-9.20744546E-10 0.00000000E+00 + 6.14034667E-14 2.92197082E-04-7.95313638E-10-1.52363001E-08 6.37151206E-14 + 3.19719271E-03 0.00000000E+00-1.62651198E-03 0.00000000E+00 2.19881840E-03 +-6.78436473E-18-1.13198439E-03 3.12291141E-18 3.19719271E-03 0.00000000E+00 +-1.62651198E-03 0.00000000E+00 2.19881840E-03-6.78436473E-18-1.13198439E-03 + 3.12291141E-18-6.98597590E-06-1.85728418E-20-4.20097894E-08-1.10398524E-22 +-5.94955755E-05 0.00000000E+00-3.56268299E-07 0.00000000E+00-1.67485839E-08 +-6.34663132E-14 0.00000000E+00-6.21025524E-14-1.67485839E-08-6.34663132E-14 + 0.00000000E+00-6.21025524E-14 6.86954619E-07-3.46300968E-21 1.17102516E-07 + 2.67568472E-22-1.23561660E-06 0.00000000E+00 9.40793173E-07 0.00000000E+00 + 2.96039546E-05 7.95505221E-11-3.19691203E-08-1.28912140E-13 0.00000000E+00 + 9.26777854E-11 0.00000000E+00-1.25857622E-13 2.96039546E-05 7.95505221E-11 +-3.19691203E-08-1.28912140E-13 0.00000000E+00 9.26777854E-11 0.00000000E+00 +-1.25857622E-13 7.67296125E-06 1.61425573E-20-4.58325214E-08-9.56922938E-23 + 5.82598827E-05 0.00000000E+00-3.49391184E-07 0.00000000E+00-2.99877757E-05 +-8.10878574E-11-1.52363001E-08-6.37151206E-14 0.00000000E+00-9.41749501E-11 + 0.00000000E+00-6.14034667E-14-2.99877757E-05-8.10878574E-11-1.52363001E-08 +-6.37151206E-14 0.00000000E+00-9.41749501E-11 0.00000000E+00-6.14034667E-14 + 1.12130522E-03 2.94524948E-18 7.03420116E-06 1.82585187E-20 9.50931653E-03 + 0.00000000E+00 5.94037342E-05 0.00000000E+00 2.88206530E-04 7.78066934E-10 + 0.00000000E+00 9.04175640E-10 2.88206530E-04 7.78066934E-10 0.00000000E+00 + 9.04175640E-10 6.77136049E-03 1.51915483E-17 6.86954619E-07-3.46300968E-21 + 5.44038861E-02 0.00000000E+00-1.23561660E-06 0.00000000E+00-5.70502407E-03 +-1.53362154E-08-6.31146905E-03-1.70107669E-08 0.00000000E+00-1.78632906E-08 + 0.00000000E+00-1.97872792E-08-5.70502407E-03-1.53362154E-08-6.31146905E-03 +-1.70107669E-08 0.00000000E+00-1.78632906E-08 0.00000000E+00-1.97872792E-08 + 1.22334642E-03 2.56110250E-18-7.62303922E-06-1.58533488E-20 9.32580950E-03 + 0.00000000E+00-5.83446183E-05 0.00000000E+00-5.76908586E-03-1.55929159E-08 + 2.85743431E-04 7.68340888E-10 0.00000000E+00-1.81133405E-08 0.00000000E+00 + 8.94756941E-10-5.76908586E-03-1.55929159E-08 2.85743431E-04 7.68340888E-10 + 0.00000000E+00-1.81133405E-08 0.00000000E+00 8.94756941E-10-5.94955755E-05 + 0.00000000E+00-3.56268299E-07 0.00000000E+00-6.98597590E-06 1.85728418E-20 +-4.20097894E-08 1.10398524E-22 0.00000000E+00-6.21025524E-14 1.67485839E-08 +-6.34663132E-14 0.00000000E+00-6.21025524E-14 1.67485839E-08-6.34663132E-14 +-1.23561660E-06 0.00000000E+00 9.40793173E-07 0.00000000E+00 6.86954619E-07 + 3.46300968E-21 1.17102516E-07-2.67568472E-22 0.00000000E+00 9.26777854E-11 + 0.00000000E+00-1.25857622E-13-2.96039546E-05 7.95505221E-11 3.19691203E-08 +-1.28912140E-13 0.00000000E+00 9.26777854E-11 0.00000000E+00-1.25857622E-13 +-2.96039546E-05 7.95505221E-11 3.19691203E-08-1.28912140E-13 5.82598827E-05 + 0.00000000E+00-3.49391184E-07 0.00000000E+00 7.67296125E-06-1.61425573E-20 +-4.58325214E-08 9.56922938E-23 0.00000000E+00-9.41749501E-11 0.00000000E+00 +-6.14034667E-14 2.99877757E-05-8.10878574E-11 1.52363001E-08-6.37151206E-14 + 0.00000000E+00-9.41749501E-11 0.00000000E+00-6.14034667E-14 2.99877757E-05 +-8.10878574E-11 1.52363001E-08-6.37151206E-14 0.00000000E+00 1.77771835E-08 + 0.00000000E+00 9.24293752E-11-5.68180576E-03 1.52482245E-08-2.95369603E-05 + 7.92966569E-11 3.08685020E-03 0.00000000E+00 2.07185090E-03-9.58677228E-18 + 3.08685020E-03 0.00000000E+00 2.07185090E-03-9.58677228E-18 0.00000000E+00 + 1.78632906E-08 0.00000000E+00-9.26777854E-11-5.70502407E-03 1.53362154E-08 + 2.96039546E-05-7.95505221E-11 2.51358509E-02 0.00000000E+00 3.19720434E-03 + 0.00000000E+00 1.70817348E-02-6.78900744E-17 2.19882241E-03-7.09452185E-18 + 2.51358509E-02 0.00000000E+00 3.19720434E-03 0.00000000E+00 1.70817348E-02 +-6.78900744E-17 2.19882241E-03-7.09452185E-18 5.68180576E-03 1.52482245E-08 + 2.95369603E-05 7.92966569E-11 0.00000000E+00 1.77771835E-08 0.00000000E+00 + 9.24293752E-11 2.07185090E-03 9.58677228E-18 3.08685020E-03 0.00000000E+00 + 2.07185090E-03 9.58677228E-18 3.08685020E-03 0.00000000E+00 5.70502407E-03 + 1.53362154E-08-2.96039546E-05-7.95505221E-11 0.00000000E+00 1.78632906E-08 + 0.00000000E+00-9.26777854E-11 1.70817348E-02 6.78900744E-17 2.19882241E-03 + 7.09452185E-18 2.51358509E-02 0.00000000E+00 3.19720434E-03 0.00000000E+00 + 1.70817348E-02 6.78900744E-17 2.19882241E-03 7.09452185E-18 2.51358509E-02 + 0.00000000E+00 3.19720434E-03 0.00000000E+00 0.00000000E+00 1.77771835E-08 + 0.00000000E+00 9.24293752E-11-5.68180576E-03 1.52482245E-08-2.95369603E-05 + 7.92966569E-11 3.08685020E-03 0.00000000E+00 2.07185090E-03-9.58677228E-18 + 6.87126594E-02 0.00000000E+00 3.21814691E-02-8.97802769E-17 0.00000000E+00 + 1.78632906E-08 0.00000000E+00-9.26777854E-11-5.70502407E-03 1.53362154E-08 + 2.96039546E-05-7.95505221E-11 2.51358509E-02 0.00000000E+00 3.19720434E-03 + 0.00000000E+00 1.70817348E-02-6.78900744E-17 2.19882241E-03-7.09452185E-18 + 5.41913060E-01 0.00000000E+00 6.67745347E-02 0.00000000E+00 2.57866246E-01 +-6.62536703E-16 3.22852585E-02-7.79925675E-17 5.58649320E-03 1.49107484E-08 + 2.90443851E-05 7.75420582E-11 0.00000000E+00 1.74443163E-08 0.00000000E+00 + 9.07001864E-11 1.94826233E-03 3.72250916E-18 2.97776896E-03 0.00000000E+00 + 3.20801480E-02 1.01968760E-16 7.07814028E-02 0.00000000E+00 5.61176812E-03 + 1.49969008E-08-2.91173153E-05-7.77906571E-11 0.00000000E+00 1.75297687E-08 + 0.00000000E+00-9.09467702E-11 1.60794946E-02 5.42054407E-17 2.07185455E-03 + 9.61415372E-18 2.42581671E-02 0.00000000E+00 3.08686146E-03 0.00000000E+00 + 2.57046140E-01 7.76117064E-16 3.21815600E-02 9.16850905E-17 5.57935541E-01 + 0.00000000E+00 6.87122826E-02 0.00000000E+00 9.70823611E-03 0.00000000E+00 + 6.06436474E-05 0.00000000E+00 1.02276816E-03-2.82492979E-18 6.41735957E-06 +-1.78773838E-20 0.00000000E+00 8.87410413E-10-2.83806714E-04 7.60863639E-10 + 0.00000000E+00 8.87410413E-10-2.83806714E-04 7.60863639E-10 5.55079470E-02 + 0.00000000E+00-1.33942420E-06 0.00000000E+00 6.19194947E-03-1.76678758E-17 + 6.63351860E-07-7.99801471E-22 0.00000000E+00-1.75297687E-08 0.00000000E+00 +-1.94186533E-08 5.61176812E-03-1.49969008E-08 6.21216396E-03-1.66342274E-08 + 0.00000000E+00-1.75297687E-08 0.00000000E+00-1.94186533E-08 5.61176812E-03 +-1.49969008E-08 6.21216396E-03-1.66342274E-08 9.50931653E-03 0.00000000E+00 +-5.94955755E-05 0.00000000E+00 1.12130522E-03-2.94524948E-18-6.98597590E-06 + 1.85728418E-20 0.00000000E+00-1.77771835E-08 0.00000000E+00 8.77865997E-10 + 5.68180576E-03-1.52482245E-08-2.81112050E-04 7.51181301E-10 0.00000000E+00 +-1.77771835E-08 0.00000000E+00 8.77865997E-10 5.68180576E-03-1.52482245E-08 +-2.81112050E-04 7.51181301E-10-2.76083797E-04-7.34539045E-10 1.82325560E-08 + 6.21497268E-14 0.00000000E+00-8.61299623E-10 0.00000000E+00 6.16459487E-14 +-1.00502922E-03-3.33416572E-18-1.51615760E-03 0.00000000E+00-1.60654270E-02 +-4.84134625E-17-3.48734214E-02 0.00000000E+00 6.21216396E-03 1.66342274E-08 + 3.49446081E-08 1.25351599E-13 0.00000000E+00 1.94186533E-08 0.00000000E+00 + 1.23320926E-13 2.07185455E-03 9.61415372E-18 8.28861779E-03 3.55134924E-17 + 3.08686146E-03 0.00000000E+00 1.23478740E-02 0.00000000E+00 3.21815600E-02 + 9.16850905E-17 1.28726908E-01 3.62701750E-16 6.87122826E-02 0.00000000E+00 + 2.74896668E-01 0.00000000E+00-2.88206530E-04-7.78066934E-10 1.67485839E-08 + 6.34663132E-14 0.00000000E+00-9.04175640E-10 0.00000000E+00 6.21025524E-14 + 2.07185090E-03 9.58677228E-18-1.06766833E-03-4.17032353E-18 3.08685020E-03 + 0.00000000E+00-1.57101364E-03 0.00000000E+00 3.21814691E-02 8.97802769E-17 +-1.61166819E-02-4.19432111E-17 6.87126594E-02 0.00000000E+00-3.38717985E-02 + 0.00000000E+00 0.00000000E+00-8.61299623E-10 0.00000000E+00 6.16459487E-14 + 2.76083797E-04-7.34539045E-10-1.82325560E-08 6.21497268E-14-1.51615760E-03 + 0.00000000E+00-1.00502922E-03 3.33416572E-18-3.48734214E-02 0.00000000E+00 +-1.60654270E-02 4.84134625E-17 0.00000000E+00 1.94186533E-08 0.00000000E+00 + 1.23320926E-13-6.21216396E-03 1.66342274E-08-3.49446081E-08 1.25351599E-13 + 3.08686146E-03 0.00000000E+00 1.23478740E-02 0.00000000E+00 2.07185455E-03 +-9.61415372E-18 8.28861779E-03-3.55134924E-17 6.87122826E-02 0.00000000E+00 + 2.74896668E-01 0.00000000E+00 3.21815600E-02-9.16850905E-17 1.28726908E-01 +-3.62701750E-16 0.00000000E+00-9.04175640E-10 0.00000000E+00 6.21025524E-14 + 2.88206530E-04-7.78066934E-10-1.67485839E-08 6.34663132E-14 3.08685020E-03 + 0.00000000E+00-1.57101364E-03 0.00000000E+00 2.07185090E-03-9.58677228E-18 +-1.06766833E-03 4.17032353E-18 6.87126594E-02 0.00000000E+00-3.38717985E-02 + 0.00000000E+00 3.21814691E-02-8.97802769E-17-1.61166819E-02 4.19432111E-17 +-2.76083797E-04-7.34539045E-10 1.82325560E-08 6.21497268E-14 0.00000000E+00 +-8.61299623E-10 0.00000000E+00 6.16459487E-14-1.00502922E-03-3.33416572E-18 +-1.51615760E-03 0.00000000E+00-1.00502922E-03-3.33416572E-18-1.51615760E-03 + 0.00000000E+00 6.21216396E-03 1.66342274E-08 3.49446081E-08 1.25351599E-13 + 0.00000000E+00 1.94186533E-08 0.00000000E+00 1.23320926E-13 2.07185455E-03 + 9.61415372E-18 8.28861779E-03 3.55134924E-17 3.08686146E-03 0.00000000E+00 + 1.23478740E-02 0.00000000E+00 2.07185455E-03 9.61415372E-18 8.28861779E-03 + 3.55134924E-17 3.08686146E-03 0.00000000E+00 1.23478740E-02 0.00000000E+00 +-2.88206530E-04-7.78066934E-10 1.67485839E-08 6.34663132E-14 0.00000000E+00 +-9.04175640E-10 0.00000000E+00 6.21025524E-14 2.07185090E-03 9.58677228E-18 +-1.06766833E-03-4.17032353E-18 3.08685020E-03 0.00000000E+00-1.57101364E-03 + 0.00000000E+00 2.07185090E-03 9.58677228E-18-1.06766833E-03-4.17032353E-18 + 3.08685020E-03 0.00000000E+00-1.57101364E-03 0.00000000E+00 0.00000000E+00 +-8.61299623E-10 0.00000000E+00 6.16459487E-14 2.76083797E-04-7.34539045E-10 +-1.82325560E-08 6.21497268E-14-1.51615760E-03 0.00000000E+00-1.00502922E-03 + 3.33416572E-18-1.51615760E-03 0.00000000E+00-1.00502922E-03 3.33416572E-18 + 0.00000000E+00 1.94186533E-08 0.00000000E+00 1.23320926E-13-6.21216396E-03 + 1.66342274E-08-3.49446081E-08 1.25351599E-13 3.08686146E-03 0.00000000E+00 + 1.23478740E-02 0.00000000E+00 2.07185455E-03-9.61415372E-18 8.28861779E-03 +-3.55134924E-17 3.08686146E-03 0.00000000E+00 1.23478740E-02 0.00000000E+00 + 2.07185455E-03-9.61415372E-18 8.28861779E-03-3.55134924E-17 0.00000000E+00 +-9.04175640E-10 0.00000000E+00 6.21025524E-14 2.88206530E-04-7.78066934E-10 +-1.67485839E-08 6.34663132E-14 3.08685020E-03 0.00000000E+00-1.57101364E-03 + 0.00000000E+00 2.07185090E-03-9.58677228E-18-1.06766833E-03 4.17032353E-18 + 3.08685020E-03 0.00000000E+00-1.57101364E-03 0.00000000E+00 2.07185090E-03 +-9.58677228E-18-1.06766833E-03 4.17032353E-18-6.37080126E-06-1.74478440E-20 +-3.83183027E-08-1.05873576E-22-6.07431963E-05 0.00000000E+00-3.63722941E-07 + 0.00000000E+00-1.82325560E-08-6.21497268E-14 0.00000000E+00-6.16459487E-14 +-1.82325560E-08-6.21497268E-14 0.00000000E+00-6.16459487E-14 6.63351860E-07 + 7.99801471E-22 1.07083922E-07 2.97751428E-22-1.33942420E-06 0.00000000E+00 + 9.59894928E-07 0.00000000E+00 2.91173153E-05 7.77906571E-11-3.49446081E-08 +-1.25351599E-13 0.00000000E+00 9.09467702E-11 0.00000000E+00-1.23320926E-13 + 2.91173153E-05 7.77906571E-11-3.49446081E-08-1.25351599E-13 0.00000000E+00 + 9.09467702E-11 0.00000000E+00-1.23320926E-13 7.03420116E-06 1.82585187E-20 +-4.20097894E-08-1.10398524E-22 5.94037342E-05 0.00000000E+00-3.56268299E-07 + 0.00000000E+00-2.95369603E-05-7.92966569E-11-1.67485839E-08-6.34663132E-14 + 0.00000000E+00-9.24293752E-11 0.00000000E+00-6.21025524E-14-2.95369603E-05 +-7.92966569E-11-1.67485839E-08-6.34663132E-14 0.00000000E+00-9.24293752E-11 + 0.00000000E+00-6.21025524E-14 1.02276816E-03 2.82492979E-18 6.41735957E-06 + 1.78773838E-20 9.70823611E-03 0.00000000E+00 6.06436474E-05 0.00000000E+00 + 2.83806714E-04 7.60863639E-10 0.00000000E+00 8.87410413E-10 2.83806714E-04 + 7.60863639E-10 0.00000000E+00 8.87410413E-10 6.19194947E-03 1.76678758E-17 + 6.63351860E-07 7.99801471E-22 5.55079470E-02 0.00000000E+00-1.33942420E-06 + 0.00000000E+00-5.61176812E-03-1.49969008E-08-6.21216396E-03-1.66342274E-08 + 0.00000000E+00-1.75297687E-08 0.00000000E+00-1.94186533E-08-5.61176812E-03 +-1.49969008E-08-6.21216396E-03-1.66342274E-08 0.00000000E+00-1.75297687E-08 + 0.00000000E+00-1.94186533E-08 1.12130522E-03 2.94524948E-18-6.98597590E-06 +-1.85728418E-20 9.50931653E-03 0.00000000E+00-5.94955755E-05 0.00000000E+00 +-5.68180576E-03-1.52482245E-08 2.81112050E-04 7.51181301E-10 0.00000000E+00 +-1.77771835E-08 0.00000000E+00 8.77865997E-10-5.68180576E-03-1.52482245E-08 + 2.81112050E-04 7.51181301E-10 0.00000000E+00-1.77771835E-08 0.00000000E+00 + 8.77865997E-10-6.07431963E-05 0.00000000E+00-3.63722941E-07 0.00000000E+00 +-6.37080126E-06 1.74478440E-20-3.83183027E-08 1.05873576E-22 0.00000000E+00 +-6.16459487E-14 1.82325560E-08-6.21497268E-14 0.00000000E+00-6.16459487E-14 + 1.82325560E-08-6.21497268E-14-1.33942420E-06 0.00000000E+00 9.59894928E-07 + 0.00000000E+00 6.63351860E-07-7.99801471E-22 1.07083922E-07-2.97751428E-22 + 0.00000000E+00 9.09467702E-11 0.00000000E+00-1.23320926E-13-2.91173153E-05 + 7.77906571E-11 3.49446081E-08-1.25351599E-13 0.00000000E+00 9.09467702E-11 + 0.00000000E+00-1.23320926E-13-2.91173153E-05 7.77906571E-11 3.49446081E-08 +-1.25351599E-13 5.94037342E-05 0.00000000E+00-3.56268299E-07 0.00000000E+00 + 7.03420116E-06-1.82585187E-20-4.20097894E-08 1.10398524E-22 0.00000000E+00 +-9.24293752E-11 0.00000000E+00-6.21025524E-14 2.95369603E-05-7.92966569E-11 + 1.67485839E-08-6.34663132E-14 0.00000000E+00-9.24293752E-11 0.00000000E+00 +-6.21025524E-14 2.95369603E-05-7.92966569E-11 1.67485839E-08-6.34663132E-14 + 0.00000000E+00 1.74443163E-08 0.00000000E+00 9.07001864E-11-5.58649320E-03 + 1.49107484E-08-2.90443851E-05 7.75420582E-11 2.97776896E-03 0.00000000E+00 + 1.94826233E-03-3.72250916E-18 2.97776896E-03 0.00000000E+00 1.94826233E-03 +-3.72250916E-18 0.00000000E+00 1.75297687E-08 0.00000000E+00-9.09467702E-11 +-5.61176812E-03 1.49969008E-08 2.91173153E-05-7.77906571E-11 2.42581671E-02 + 0.00000000E+00 3.08686146E-03 0.00000000E+00 1.60794946E-02-5.42054407E-17 + 2.07185455E-03-9.61415372E-18 2.42581671E-02 0.00000000E+00 3.08686146E-03 + 0.00000000E+00 1.60794946E-02-5.42054407E-17 2.07185455E-03-9.61415372E-18 + 5.58649320E-03 1.49107484E-08 2.90443851E-05 7.75420582E-11 0.00000000E+00 + 1.74443163E-08 0.00000000E+00 9.07001864E-11 1.94826233E-03 3.72250916E-18 + 2.97776896E-03 0.00000000E+00 1.94826233E-03 3.72250916E-18 2.97776896E-03 + 0.00000000E+00 5.61176812E-03 1.49969008E-08-2.91173153E-05-7.77906571E-11 + 0.00000000E+00 1.75297687E-08 0.00000000E+00-9.09467702E-11 1.60794946E-02 + 5.42054407E-17 2.07185455E-03 9.61415372E-18 2.42581671E-02 0.00000000E+00 + 3.08686146E-03 0.00000000E+00 1.60794946E-02 5.42054407E-17 2.07185455E-03 + 9.61415372E-18 2.42581671E-02 0.00000000E+00 3.08686146E-03 0.00000000E+00 + 0.00000000E+00 1.74443163E-08 0.00000000E+00 9.07001864E-11-5.58649320E-03 + 1.49107484E-08-2.90443851E-05 7.75420582E-11 2.97776896E-03 0.00000000E+00 + 1.94826233E-03-3.72250916E-18 7.07814028E-02 0.00000000E+00 3.20801480E-02 +-1.01968760E-16 0.00000000E+00 1.75297687E-08 0.00000000E+00-9.09467702E-11 +-5.61176812E-03 1.49969008E-08 2.91173153E-05-7.77906571E-11 2.42581671E-02 + 0.00000000E+00 3.08686146E-03 0.00000000E+00 1.60794946E-02-5.42054407E-17 + 2.07185455E-03-9.61415372E-18 5.57935541E-01 0.00000000E+00 6.87122826E-02 + 0.00000000E+00 2.57046140E-01-7.76117064E-16 3.21815600E-02-9.16850905E-17 + 5.48333417E-03 1.45807591E-08 2.85109682E-05 7.58259426E-11 0.00000000E+00 + 1.71140754E-08 0.00000000E+00 8.89841868E-11 1.82810490E-03 3.30222348E-18 + 2.86990801E-03 0.00000000E+00 3.19812816E-02 1.10710122E-16 7.29940319E-02 + 0.00000000E+00 5.51059712E-03 1.46648231E-08-2.85896349E-05-7.60685020E-11 + 0.00000000E+00 1.71986476E-08 0.00000000E+00-8.92282110E-11 1.51044946E-02 + 2.40504938E-17 1.94826564E-03 3.22506667E-18 2.33904075E-02 0.00000000E+00 + 2.97777966E-03 0.00000000E+00 2.56245368E-01 8.62754447E-16 3.20802392E-02 + 1.02998118E-16 5.75056797E-01 0.00000000E+00 7.07809547E-02 0.00000000E+00 + 9.92391215E-03 0.00000000E+00 6.19879592E-05 0.00000000E+00 9.27649615E-04 +-2.38100162E-18 5.82190668E-06-1.47919452E-20 0.00000000E+00 8.70744152E-10 +-2.79002658E-04 7.43994686E-10 0.00000000E+00 8.70744152E-10-2.79002658E-04 + 7.43994686E-10 5.67047718E-02 0.00000000E+00-1.45217968E-06 0.00000000E+00 + 5.63255309E-03-1.42366960E-17 6.40353002E-07-3.42444934E-21 0.00000000E+00 +-1.71986476E-08 0.00000000E+00-1.90533146E-08 5.51059712E-03-1.46648231E-08 + 6.10407348E-03-1.62658447E-08 0.00000000E+00-1.71986476E-08 0.00000000E+00 +-1.90533146E-08 5.51059712E-03-1.46648231E-08 6.10407348E-03-1.62658447E-08 + 9.70823611E-03 0.00000000E+00-6.07431963E-05 0.00000000E+00 1.02276816E-03 +-2.82492979E-18-6.37080126E-06 1.74478440E-20 0.00000000E+00-1.74443163E-08 + 0.00000000E+00 8.61299623E-10 5.58649320E-03-1.49107484E-08-2.76083797E-04 + 7.34539045E-10 0.00000000E+00-1.74443163E-08 0.00000000E+00 8.61299623E-10 + 5.58649320E-03-1.49107484E-08-2.76083797E-04 7.34539045E-10-2.70672289E-04 +-7.18308503E-10 1.96666770E-08 6.06398415E-14 0.00000000E+00-8.44902705E-10 + 0.00000000E+00 6.10060468E-14-9.44092636E-04-1.63182254E-18-1.46192192E-03 + 0.00000000E+00-1.60153802E-02-5.34270599E-17-3.59437467E-02 0.00000000E+00 + 6.10407348E-03 1.62658447E-08 3.78768869E-08 1.22759750E-13 0.00000000E+00 + 1.90533146E-08 0.00000000E+00 1.22625861E-13 1.94826564E-03 3.22506667E-18 + 7.79428142E-03 1.59335072E-17 2.97777966E-03 0.00000000E+00 1.19115333E-02 + 0.00000000E+00 3.20802392E-02 1.02998118E-16 1.28321652E-01 4.08688011E-16 + 7.07809547E-02 0.00000000E+00 2.83176128E-01 0.00000000E+00-2.83806714E-04 +-7.60863639E-10 1.82325560E-08 6.21497268E-14 0.00000000E+00-8.87410413E-10 + 0.00000000E+00 6.16459487E-14 1.94826233E-03 3.72250916E-18-1.00502922E-03 +-3.33416572E-18 2.97776896E-03 0.00000000E+00-1.51615760E-03 0.00000000E+00 + 3.20801480E-02 1.01968760E-16-1.60654270E-02-4.84134625E-17 7.07814028E-02 + 0.00000000E+00-3.48734214E-02 0.00000000E+00 0.00000000E+00-8.44902705E-10 + 0.00000000E+00 6.10060468E-14 2.70672289E-04-7.18308503E-10-1.96666770E-08 + 6.06398415E-14-1.46192192E-03 0.00000000E+00-9.44092636E-04 1.63182254E-18 +-3.59437467E-02 0.00000000E+00-1.60153802E-02 5.34270599E-17 0.00000000E+00 + 1.90533146E-08 0.00000000E+00 1.22625861E-13-6.10407348E-03 1.62658447E-08 +-3.78768869E-08 1.22759750E-13 2.97777966E-03 0.00000000E+00 1.19115333E-02 + 0.00000000E+00 1.94826564E-03-3.22506667E-18 7.79428142E-03-1.59335072E-17 + 7.07809547E-02 0.00000000E+00 2.83176128E-01 0.00000000E+00 3.20802392E-02 +-1.02998118E-16 1.28321652E-01-4.08688011E-16 0.00000000E+00-8.87410413E-10 + 0.00000000E+00 6.16459487E-14 2.83806714E-04-7.60863639E-10-1.82325560E-08 + 6.21497268E-14 2.97776896E-03 0.00000000E+00-1.51615760E-03 0.00000000E+00 + 1.94826233E-03-3.72250916E-18-1.00502922E-03 3.33416572E-18 7.07814028E-02 + 0.00000000E+00-3.48734214E-02 0.00000000E+00 3.20801480E-02-1.01968760E-16 +-1.60654270E-02 4.84134625E-17-2.70672289E-04-7.18308503E-10 1.96666770E-08 + 6.06398415E-14 0.00000000E+00-8.44902705E-10 0.00000000E+00 6.10060468E-14 +-9.44092636E-04-1.63182254E-18-1.46192192E-03 0.00000000E+00-9.44092636E-04 +-1.63182254E-18-1.46192192E-03 0.00000000E+00 6.10407348E-03 1.62658447E-08 + 3.78768869E-08 1.22759750E-13 0.00000000E+00 1.90533146E-08 0.00000000E+00 + 1.22625861E-13 1.94826564E-03 3.22506667E-18 7.79428142E-03 1.59335072E-17 + 2.97777966E-03 0.00000000E+00 1.19115333E-02 0.00000000E+00 1.94826564E-03 + 3.22506667E-18 7.79428142E-03 1.59335072E-17 2.97777966E-03 0.00000000E+00 + 1.19115333E-02 0.00000000E+00-2.83806714E-04-7.60863639E-10 1.82325560E-08 + 6.21497268E-14 0.00000000E+00-8.87410413E-10 0.00000000E+00 6.16459487E-14 + 1.94826233E-03 3.72250916E-18-1.00502922E-03-3.33416572E-18 2.97776896E-03 + 0.00000000E+00-1.51615760E-03 0.00000000E+00 1.94826233E-03 3.72250916E-18 +-1.00502922E-03-3.33416572E-18 2.97776896E-03 0.00000000E+00-1.51615760E-03 + 0.00000000E+00 0.00000000E+00-8.44902705E-10 0.00000000E+00 6.10060468E-14 + 2.70672289E-04-7.18308503E-10-1.96666770E-08 6.06398415E-14-1.46192192E-03 + 0.00000000E+00-9.44092636E-04 1.63182254E-18-1.46192192E-03 0.00000000E+00 +-9.44092636E-04 1.63182254E-18 0.00000000E+00 1.90533146E-08 0.00000000E+00 + 1.22625861E-13-6.10407348E-03 1.62658447E-08-3.78768869E-08 1.22759750E-13 + 2.97777966E-03 0.00000000E+00 1.19115333E-02 0.00000000E+00 1.94826564E-03 +-3.22506667E-18 7.79428142E-03-1.59335072E-17 2.97777966E-03 0.00000000E+00 + 1.19115333E-02 0.00000000E+00 1.94826564E-03-3.22506667E-18 7.79428142E-03 +-1.59335072E-17 0.00000000E+00-8.87410413E-10 0.00000000E+00 6.16459487E-14 + 2.83806714E-04-7.60863639E-10-1.82325560E-08 6.21497268E-14 2.97776896E-03 + 0.00000000E+00-1.51615760E-03 0.00000000E+00 1.94826233E-03-3.72250916E-18 +-1.00502922E-03 3.33416572E-18 2.97776896E-03 0.00000000E+00-1.51615760E-03 + 0.00000000E+00 1.94826233E-03-3.72250916E-18-1.00502922E-03 3.33416572E-18 +-5.77697364E-06-1.49663496E-20-3.47548451E-08-8.90827496E-23-6.20959458E-05 + 0.00000000E+00-3.71805439E-07 0.00000000E+00-1.96666770E-08-6.06398415E-14 + 0.00000000E+00-6.10060468E-14-1.96666770E-08-6.06398415E-14 0.00000000E+00 +-6.10060468E-14 6.40353002E-07 3.42444934E-21 9.74111769E-08 2.52361273E-22 +-1.45217968E-06 0.00000000E+00 9.80602257E-07 0.00000000E+00 2.85896349E-05 + 7.60685020E-11-3.78768869E-08-1.22759750E-13 0.00000000E+00 8.92282110E-11 + 0.00000000E+00-1.22625861E-13 2.85896349E-05 7.60685020E-11-3.78768869E-08 +-1.22759750E-13 0.00000000E+00 8.92282110E-11 0.00000000E+00-1.22625861E-13 + 6.41735957E-06 1.78773838E-20-3.83183027E-08-1.05873576E-22 6.06436474E-05 + 0.00000000E+00-3.63722941E-07 0.00000000E+00-2.90443851E-05-7.75420582E-11 +-1.82325560E-08-6.21497268E-14 0.00000000E+00-9.07001864E-11 0.00000000E+00 +-6.16459487E-14-2.90443851E-05-7.75420582E-11-1.82325560E-08-6.21497268E-14 + 0.00000000E+00-9.07001864E-11 0.00000000E+00-6.16459487E-14 9.27649615E-04 + 2.38100162E-18 5.82190668E-06 1.47919452E-20 9.92391215E-03 0.00000000E+00 + 6.19879592E-05 0.00000000E+00 2.79002658E-04 7.43994686E-10 0.00000000E+00 + 8.70744152E-10 2.79002658E-04 7.43994686E-10 0.00000000E+00 8.70744152E-10 + 5.63255309E-03 1.42366960E-17 6.40353002E-07 3.42444934E-21 5.67047718E-02 + 0.00000000E+00-1.45217968E-06 0.00000000E+00-5.51059712E-03-1.46648231E-08 +-6.10407348E-03-1.62658447E-08 0.00000000E+00-1.71986476E-08 0.00000000E+00 +-1.90533146E-08-5.51059712E-03-1.46648231E-08-6.10407348E-03-1.62658447E-08 + 0.00000000E+00-1.71986476E-08 0.00000000E+00-1.90533146E-08 1.02276816E-03 + 2.82492979E-18-6.37080126E-06-1.74478440E-20 9.70823611E-03 0.00000000E+00 +-6.07431963E-05 0.00000000E+00-5.58649320E-03-1.49107484E-08 2.76083797E-04 + 7.34539045E-10 0.00000000E+00-1.74443163E-08 0.00000000E+00 8.61299623E-10 +-5.58649320E-03-1.49107484E-08 2.76083797E-04 7.34539045E-10 0.00000000E+00 +-1.74443163E-08 0.00000000E+00 8.61299623E-10-6.20959458E-05 0.00000000E+00 +-3.71805439E-07 0.00000000E+00-5.77697364E-06 1.49663496E-20-3.47548451E-08 + 8.90827496E-23 0.00000000E+00-6.10060468E-14 1.96666770E-08-6.06398415E-14 + 0.00000000E+00-6.10060468E-14 1.96666770E-08-6.06398415E-14-1.45217968E-06 + 0.00000000E+00 9.80602257E-07 0.00000000E+00 6.40353002E-07-3.42444934E-21 + 9.74111769E-08-2.52361273E-22 0.00000000E+00 8.92282110E-11 0.00000000E+00 +-1.22625861E-13-2.85896349E-05 7.60685020E-11 3.78768869E-08-1.22759750E-13 + 0.00000000E+00 8.92282110E-11 0.00000000E+00-1.22625861E-13-2.85896349E-05 + 7.60685020E-11 3.78768869E-08-1.22759750E-13 6.06436474E-05 0.00000000E+00 +-3.63722941E-07 0.00000000E+00 6.41735957E-06-1.78773838E-20-3.83183027E-08 + 1.05873576E-22 0.00000000E+00-9.07001864E-11 0.00000000E+00-6.16459487E-14 + 2.90443851E-05-7.75420582E-11 1.82325560E-08-6.21497268E-14 0.00000000E+00 +-9.07001864E-11 0.00000000E+00-6.16459487E-14 2.90443851E-05-7.75420582E-11 + 1.82325560E-08-6.21497268E-14 0.00000000E+00 1.71140754E-08 0.00000000E+00 + 8.89841868E-11-5.48333417E-03 1.45807591E-08-2.85109682E-05 7.58259426E-11 + 2.86990801E-03 0.00000000E+00 1.82810490E-03-3.30222348E-18 2.86990801E-03 + 0.00000000E+00 1.82810490E-03-3.30222348E-18 0.00000000E+00 1.71986476E-08 + 0.00000000E+00-8.92282110E-11-5.51059712E-03 1.46648231E-08 2.85896349E-05 +-7.60685020E-11 2.33904075E-02 0.00000000E+00 2.97777966E-03 0.00000000E+00 + 1.51044946E-02-2.40504938E-17 1.94826564E-03-3.22506667E-18 2.33904075E-02 + 0.00000000E+00 2.97777966E-03 0.00000000E+00 1.51044946E-02-2.40504938E-17 + 1.94826564E-03-3.22506667E-18 5.48333417E-03 1.45807591E-08 2.85109682E-05 + 7.58259426E-11 0.00000000E+00 1.71140754E-08 0.00000000E+00 8.89841868E-11 + 1.82810490E-03 3.30222348E-18 2.86990801E-03 0.00000000E+00 1.82810490E-03 + 3.30222348E-18 2.86990801E-03 0.00000000E+00 5.51059712E-03 1.46648231E-08 +-2.85896349E-05-7.60685020E-11 0.00000000E+00 1.71986476E-08 0.00000000E+00 +-8.92282110E-11 1.51044946E-02 2.40504938E-17 1.94826564E-03 3.22506667E-18 + 2.33904075E-02 0.00000000E+00 2.97777966E-03 0.00000000E+00 1.51044946E-02 + 2.40504938E-17 1.94826564E-03 3.22506667E-18 2.33904075E-02 0.00000000E+00 + 2.97777966E-03 0.00000000E+00 0.00000000E+00 1.71140754E-08 0.00000000E+00 + 8.89841868E-11-5.48333417E-03 1.45807591E-08-2.85109682E-05 7.58259426E-11 + 2.86990801E-03 0.00000000E+00 1.82810490E-03-3.30222348E-18 7.29940319E-02 + 0.00000000E+00 3.19812816E-02-1.10710122E-16 0.00000000E+00 1.71986476E-08 + 0.00000000E+00-8.92282110E-11-5.51059712E-03 1.46648231E-08 2.85896349E-05 +-7.60685020E-11 2.33904075E-02 0.00000000E+00 2.97777966E-03 0.00000000E+00 + 1.51044946E-02-2.40504938E-17 1.94826564E-03-3.22506667E-18 5.75056797E-01 + 0.00000000E+00 7.07809547E-02 0.00000000E+00 2.56245368E-01-8.62754447E-16 + 3.20802392E-02-1.02998118E-16 5.37265521E-03 1.42591460E-08 2.79383871E-05 + 7.41532836E-11 0.00000000E+00 1.67874797E-08 0.00000000E+00 8.72871233E-11 + 1.71142790E-03 5.04184382E-18 2.76322618E-03 0.00000000E+00 3.18849585E-02 + 7.86895398E-17 7.53653253E-02 0.00000000E+00 5.40181790E-03 1.43410554E-08 +-2.80225361E-05-7.43896301E-11 0.00000000E+00 1.68711356E-08 0.00000000E+00 +-8.75285091E-11 1.41571429E-02 3.86143922E-17 1.82810811E-03 4.03948329E-18 + 2.25322484E-02 0.00000000E+00 2.86991859E-03 0.00000000E+00 2.55464585E-01 + 7.54342736E-16 3.19813722E-02 1.09459049E-16 5.93387629E-01 0.00000000E+00 + 7.29934964E-02 0.00000000E+00 1.01580228E-02 0.00000000E+00 6.34470882E-05 + 0.00000000E+00 8.35913479E-04-3.18989215E-18 5.24759342E-06-1.98747951E-20 + 0.00000000E+00 8.54251359E-10-2.73806992E-04 7.27531143E-10 0.00000000E+00 + 8.54251359E-10-2.73806992E-04 7.27531143E-10 5.80030827E-02 0.00000000E+00 +-1.57625180E-06 0.00000000E+00 5.09274113E-03-1.59978595E-17 6.17593519E-07 + 6.56462951E-21 0.00000000E+00-1.68711356E-08 0.00000000E+00-1.86915598E-08 + 5.40181790E-03-1.43410554E-08 5.98747791E-03-1.59062708E-08 0.00000000E+00 +-1.68711356E-08 0.00000000E+00-1.86915598E-08 5.40181790E-03-1.43410554E-08 + 5.98747791E-03-1.59062708E-08 9.92391215E-03 0.00000000E+00-6.20959458E-05 + 0.00000000E+00 9.27649615E-04-2.38100162E-18-5.77697364E-06 1.49663496E-20 + 0.00000000E+00-1.71140754E-08 0.00000000E+00 8.44902705E-10 5.48333417E-03 +-1.45807591E-08-2.70672289E-04 7.18308503E-10 0.00000000E+00-1.71140754E-08 + 0.00000000E+00 8.44902705E-10 5.48333417E-03-1.45807591E-08-2.70672289E-04 + 7.18308503E-10-2.64896136E-04-7.02503236E-10 2.10372404E-08 5.90866267E-14 + 0.00000000E+00-8.28689812E-10 0.00000000E+00 6.03464434E-14-8.84884002E-04 +-2.27033178E-18-1.40828619E-03 0.00000000E+00-1.59665827E-02-4.70371472E-17 +-3.70897054E-02 0.00000000E+00 5.98747791E-03 1.59062708E-08 4.06859671E-08 + 1.19621791E-13 0.00000000E+00 1.86915598E-08 0.00000000E+00 1.21217679E-13 + 1.82810811E-03 4.03948329E-18 7.31366903E-03 1.49856745E-17 2.86991859E-03 + 0.00000000E+00 1.14800744E-02 0.00000000E+00 3.19813722E-02 1.09459049E-16 + 1.27926216E-01 4.27082833E-16 7.29934964E-02 0.00000000E+00 2.92031753E-01 + 0.00000000E+00-2.79002658E-04-7.43994686E-10 1.96666770E-08 6.06398415E-14 + 0.00000000E+00-8.70744152E-10 0.00000000E+00 6.10060468E-14 1.82810490E-03 + 3.30222348E-18-9.44092636E-04-1.63182254E-18 2.86990801E-03 0.00000000E+00 +-1.46192192E-03 0.00000000E+00 3.19812816E-02 1.10710122E-16-1.60153802E-02 +-5.34270599E-17 7.29940319E-02 0.00000000E+00-3.59437467E-02 0.00000000E+00 + 0.00000000E+00-8.28689812E-10 0.00000000E+00 6.03464434E-14 2.64896136E-04 +-7.02503236E-10-2.10372404E-08 5.90866267E-14-1.40828619E-03 0.00000000E+00 +-8.84884002E-04 2.27033178E-18-3.70897054E-02 0.00000000E+00-1.59665827E-02 + 4.70371472E-17 0.00000000E+00 1.86915598E-08 0.00000000E+00 1.21217679E-13 +-5.98747791E-03 1.59062708E-08-4.06859671E-08 1.19621791E-13 2.86991859E-03 + 0.00000000E+00 1.14800744E-02 0.00000000E+00 1.82810811E-03-4.03948329E-18 + 7.31366903E-03-1.49856745E-17 7.29934964E-02 0.00000000E+00 2.92031753E-01 + 0.00000000E+00 3.19813722E-02-1.09459049E-16 1.27926216E-01-4.27082833E-16 + 0.00000000E+00-8.70744152E-10 0.00000000E+00 6.10060468E-14 2.79002658E-04 +-7.43994686E-10-1.96666770E-08 6.06398415E-14 2.86990801E-03 0.00000000E+00 +-1.46192192E-03 0.00000000E+00 1.82810490E-03-3.30222348E-18-9.44092636E-04 + 1.63182254E-18 7.29940319E-02 0.00000000E+00-3.59437467E-02 0.00000000E+00 + 3.19812816E-02-1.10710122E-16-1.60153802E-02 5.34270599E-17-2.64896136E-04 +-7.02503236E-10 2.10372404E-08 5.90866267E-14 0.00000000E+00-8.28689812E-10 + 0.00000000E+00 6.03464434E-14-8.84884002E-04-2.27033178E-18-1.40828619E-03 + 0.00000000E+00-8.84884002E-04-2.27033178E-18-1.40828619E-03 0.00000000E+00 + 5.98747791E-03 1.59062708E-08 4.06859671E-08 1.19621791E-13 0.00000000E+00 + 1.86915598E-08 0.00000000E+00 1.21217679E-13 1.82810811E-03 4.03948329E-18 + 7.31366903E-03 1.49856745E-17 2.86991859E-03 0.00000000E+00 1.14800744E-02 + 0.00000000E+00 1.82810811E-03 4.03948329E-18 7.31366903E-03 1.49856745E-17 + 2.86991859E-03 0.00000000E+00 1.14800744E-02 0.00000000E+00-2.79002658E-04 +-7.43994686E-10 1.96666770E-08 6.06398415E-14 0.00000000E+00-8.70744152E-10 + 0.00000000E+00 6.10060468E-14 1.82810490E-03 3.30222348E-18-9.44092636E-04 +-1.63182254E-18 2.86990801E-03 0.00000000E+00-1.46192192E-03 0.00000000E+00 + 1.82810490E-03 3.30222348E-18-9.44092636E-04-1.63182254E-18 2.86990801E-03 + 0.00000000E+00-1.46192192E-03 0.00000000E+00 0.00000000E+00-8.28689812E-10 + 0.00000000E+00 6.03464434E-14 2.64896136E-04-7.02503236E-10-2.10372404E-08 + 5.90866267E-14-1.40828619E-03 0.00000000E+00-8.84884002E-04 2.27033178E-18 +-1.40828619E-03 0.00000000E+00-8.84884002E-04 2.27033178E-18 0.00000000E+00 + 1.86915598E-08 0.00000000E+00 1.21217679E-13-5.98747791E-03 1.59062708E-08 +-4.06859671E-08 1.19621791E-13 2.86991859E-03 0.00000000E+00 1.14800744E-02 + 0.00000000E+00 1.82810811E-03-4.03948329E-18 7.31366903E-03-1.49856745E-17 + 2.86991859E-03 0.00000000E+00 1.14800744E-02 0.00000000E+00 1.82810811E-03 +-4.03948329E-18 7.31366903E-03-1.49856745E-17 0.00000000E+00-8.70744152E-10 + 0.00000000E+00 6.10060468E-14 2.79002658E-04-7.43994686E-10-1.96666770E-08 + 6.06398415E-14 2.86990801E-03 0.00000000E+00-1.46192192E-03 0.00000000E+00 + 1.82810490E-03-3.30222348E-18-9.44092636E-04 1.63182254E-18 2.86990801E-03 + 0.00000000E+00-1.46192192E-03 0.00000000E+00 1.82810490E-03-3.30222348E-18 +-9.44092636E-04 1.63182254E-18-5.20429128E-06-2.00389632E-20-3.13180677E-08 +-1.19791821E-22-6.35643898E-05 0.00000000E+00-3.80578680E-07 0.00000000E+00 +-2.10372404E-08-5.90866267E-14 0.00000000E+00-6.03464434E-14-2.10372404E-08 +-5.90866267E-14 0.00000000E+00-6.03464434E-14 6.17593519E-07-6.56462951E-21 + 8.80774507E-08 2.78163719E-22-1.57625180E-06 0.00000000E+00 1.00306595E-06 + 0.00000000E+00 2.80225361E-05 7.43896301E-11-4.06859671E-08-1.19621791E-13 + 0.00000000E+00 8.75285091E-11 0.00000000E+00-1.21217679E-13 2.80225361E-05 + 7.43896301E-11-4.06859671E-08-1.19621791E-13 0.00000000E+00 8.75285091E-11 + 0.00000000E+00-1.21217679E-13 5.82190668E-06 1.47919452E-20-3.47548451E-08 +-8.90827496E-23 6.19879592E-05 0.00000000E+00-3.71805439E-07 0.00000000E+00 +-2.85109682E-05-7.58259426E-11-1.96666770E-08-6.06398415E-14 0.00000000E+00 +-8.89841868E-11 0.00000000E+00-6.10060468E-14-2.85109682E-05-7.58259426E-11 +-1.96666770E-08-6.06398415E-14 0.00000000E+00-8.89841868E-11 0.00000000E+00 +-6.10060468E-14 8.35913479E-04 3.18989215E-18 5.24759342E-06 1.98747951E-20 + 1.01580228E-02 0.00000000E+00 6.34470882E-05 0.00000000E+00 2.73806992E-04 + 7.27531143E-10 0.00000000E+00 8.54251359E-10 2.73806992E-04 7.27531143E-10 + 0.00000000E+00 8.54251359E-10 5.09274113E-03 1.59978595E-17 6.17593519E-07 +-6.56462951E-21 5.80030827E-02 0.00000000E+00-1.57625180E-06 0.00000000E+00 +-5.40181790E-03-1.43410554E-08-5.98747791E-03-1.59062708E-08 0.00000000E+00 +-1.68711356E-08 0.00000000E+00-1.86915598E-08-5.40181790E-03-1.43410554E-08 +-5.98747791E-03-1.59062708E-08 0.00000000E+00-1.68711356E-08 0.00000000E+00 +-1.86915598E-08 9.27649615E-04 2.38100162E-18-5.77697364E-06-1.49663496E-20 + 9.92391215E-03 0.00000000E+00-6.20959458E-05 0.00000000E+00-5.48333417E-03 +-1.45807591E-08 2.70672289E-04 7.18308503E-10 0.00000000E+00-1.71140754E-08 + 0.00000000E+00 8.44902705E-10-5.48333417E-03-1.45807591E-08 2.70672289E-04 + 7.18308503E-10 0.00000000E+00-1.71140754E-08 0.00000000E+00 8.44902705E-10 +-6.35643898E-05 0.00000000E+00-3.80578680E-07 0.00000000E+00-5.20429128E-06 + 2.00389632E-20-3.13180677E-08 1.19791821E-22 0.00000000E+00-6.03464434E-14 + 2.10372404E-08-5.90866267E-14 0.00000000E+00-6.03464434E-14 2.10372404E-08 +-5.90866267E-14-1.57625180E-06 0.00000000E+00 1.00306595E-06 0.00000000E+00 + 6.17593519E-07 6.56462951E-21 8.80774507E-08-2.78163719E-22 0.00000000E+00 + 8.75285091E-11 0.00000000E+00-1.21217679E-13-2.80225361E-05 7.43896301E-11 + 4.06859671E-08-1.19621791E-13 0.00000000E+00 8.75285091E-11 0.00000000E+00 +-1.21217679E-13-2.80225361E-05 7.43896301E-11 4.06859671E-08-1.19621791E-13 + 6.19879592E-05 0.00000000E+00-3.71805439E-07 0.00000000E+00 5.82190668E-06 +-1.47919452E-20-3.47548451E-08 8.90827496E-23 0.00000000E+00-8.89841868E-11 + 0.00000000E+00-6.10060468E-14 2.85109682E-05-7.58259426E-11 1.96666770E-08 +-6.06398415E-14 0.00000000E+00-8.89841868E-11 0.00000000E+00-6.10060468E-14 + 2.85109682E-05-7.58259426E-11 1.96666770E-08-6.06398415E-14 0.00000000E+00 + 1.67874797E-08 0.00000000E+00 8.72871233E-11-5.37265521E-03 1.42591460E-08 +-2.79383871E-05 7.41532836E-11 2.76322618E-03 0.00000000E+00 1.71142790E-03 +-5.04184382E-18 2.76322618E-03 0.00000000E+00 1.71142790E-03-5.04184382E-18 + 0.00000000E+00 1.68711356E-08 0.00000000E+00-8.75285091E-11-5.40181790E-03 + 1.43410554E-08 2.80225361E-05-7.43896301E-11 2.25322484E-02 0.00000000E+00 + 2.86991859E-03 0.00000000E+00 1.41571429E-02-3.86143922E-17 1.82810811E-03 +-4.03948329E-18 2.25322484E-02 0.00000000E+00 2.86991859E-03 0.00000000E+00 + 1.41571429E-02-3.86143922E-17 1.82810811E-03-4.03948329E-18 5.37265521E-03 + 1.42591460E-08 2.79383871E-05 7.41532836E-11 0.00000000E+00 1.67874797E-08 + 0.00000000E+00 8.72871233E-11 1.71142790E-03 5.04184382E-18 2.76322618E-03 + 0.00000000E+00 1.71142790E-03 5.04184382E-18 2.76322618E-03 0.00000000E+00 + 5.40181790E-03 1.43410554E-08-2.80225361E-05-7.43896301E-11 0.00000000E+00 + 1.68711356E-08 0.00000000E+00-8.75285091E-11 1.41571429E-02 3.86143922E-17 + 1.82810811E-03 4.03948329E-18 2.25322484E-02 0.00000000E+00 2.86991859E-03 + 0.00000000E+00 1.41571429E-02 3.86143922E-17 1.82810811E-03 4.03948329E-18 + 2.25322484E-02 0.00000000E+00 2.86991859E-03 0.00000000E+00 0.00000000E+00 + 1.67874797E-08 0.00000000E+00 8.72871233E-11-5.37265521E-03 1.42591460E-08 +-2.79383871E-05 7.41532836E-11 2.76322618E-03 0.00000000E+00 1.71142790E-03 +-5.04184382E-18 7.53653253E-02 0.00000000E+00 3.18849585E-02-7.86895398E-17 + 0.00000000E+00 1.68711356E-08 0.00000000E+00-8.75285091E-11-5.40181790E-03 + 1.43410554E-08 2.80225361E-05-7.43896301E-11 2.25322484E-02 0.00000000E+00 + 2.86991859E-03 0.00000000E+00 1.41571429E-02-3.86143922E-17 1.82810811E-03 +-4.03948329E-18 5.93387629E-01 0.00000000E+00 7.29934964E-02 0.00000000E+00 + 2.55464585E-01-7.54342736E-16 3.19813722E-02-1.09459049E-16 5.25481749E-03 + 1.39460877E-08 2.73285266E-05 7.25249473E-11 0.00000000E+00 1.64645670E-08 + 0.00000000E+00 8.56090999E-11 1.59827776E-03 3.07194056E-19 2.65767940E-03 + 0.00000000E+00 3.17912517E-02 6.24604176E-17 7.79121484E-02 0.00000000E+00 + 5.28579158E-03 1.40257631E-08-2.74179011E-05-7.27548477E-11 0.00000000E+00 + 1.65472474E-08 0.00000000E+00-8.58476706E-11 1.32378201E-02 1.31500233E-17 + 1.71143086E-03 3.89020246E-18 2.16833443E-02 0.00000000E+00 2.76323637E-03 + 0.00000000E+00 2.54704445E-01 5.66111986E-16 3.18850492E-02 7.89254561E-17 + 6.13054529E-01 0.00000000E+00 7.53646881E-02 0.00000000E+00 1.04125372E-02 + 0.00000000E+00 6.50332846E-05 0.00000000E+00 7.47559263E-04-1.13575472E-18 + 4.69442679E-06-7.83265530E-21 0.00000000E+00 8.37932657E-10-2.68237425E-04 + 7.11481538E-10 0.00000000E+00 8.37932657E-10-2.68237425E-04 7.11481538E-10 + 5.94134350E-02 0.00000000E+00-1.71361916E-06 0.00000000E+00 4.57249694E-03 +-1.48270852E-17 5.94818675E-07-1.55263934E-20 0.00000000E+00-1.65472474E-08 + 0.00000000E+00-1.83337686E-08 5.28579158E-03-1.40257631E-08 5.86275860E-03 +-1.55559426E-08 0.00000000E+00-1.65472474E-08 0.00000000E+00-1.83337686E-08 + 5.28579158E-03-1.40257631E-08 5.86275860E-03-1.55559426E-08 1.01580228E-02 + 0.00000000E+00-6.35643898E-05 0.00000000E+00 8.35913479E-04-3.18989215E-18 +-5.20429128E-06 2.00389632E-20 0.00000000E+00-1.67874797E-08 0.00000000E+00 + 8.28689812E-10 5.37265521E-03-1.42591460E-08-2.64896136E-04 7.02503236E-10 + 0.00000000E+00-1.67874797E-08 0.00000000E+00 8.28689812E-10 5.37265521E-03 +-1.42591460E-08-2.64896136E-04 7.02503236E-10-2.58773112E-04-6.87136258E-10 + 2.23436279E-08 5.74751023E-14 0.00000000E+00-8.12669184E-10 0.00000000E+00 + 5.96426813E-14-8.27427155E-04-1.04934913E-18-1.35522894E-03 0.00000000E+00 +-1.59190752E-02-3.53464684E-17-3.83192091E-02 0.00000000E+00 5.86275860E-03 + 1.55559426E-08 4.33521663E-08 1.16473308E-13 0.00000000E+00 1.83337686E-08 + 0.00000000E+00 1.19875871E-13 1.71143086E-03 3.89020246E-18 6.84697719E-03 + 1.63570976E-17 2.76323637E-03 0.00000000E+00 1.10533307E-02 0.00000000E+00 + 3.18850492E-02 7.89254561E-17 1.27540950E-01 3.19991554E-16 7.53646881E-02 + 0.00000000E+00 3.01522752E-01 0.00000000E+00-2.73806992E-04-7.27531143E-10 + 2.10372404E-08 5.90866267E-14 0.00000000E+00-8.54251359E-10 0.00000000E+00 + 6.03464434E-14 1.71142790E-03 5.04184382E-18-8.84884002E-04-2.27033178E-18 + 2.76322618E-03 0.00000000E+00-1.40828619E-03 0.00000000E+00 3.18849585E-02 + 7.86895398E-17-1.59665827E-02-4.70371472E-17 7.53653253E-02 0.00000000E+00 +-3.70897054E-02 0.00000000E+00 0.00000000E+00-8.12669184E-10 0.00000000E+00 + 5.96426813E-14 2.58773112E-04-6.87136258E-10-2.23436279E-08 5.74751023E-14 +-1.35522894E-03 0.00000000E+00-8.27427155E-04 1.04934913E-18-3.83192091E-02 + 0.00000000E+00-1.59190752E-02 3.53464684E-17 0.00000000E+00 1.83337686E-08 + 0.00000000E+00 1.19875871E-13-5.86275860E-03 1.55559426E-08-4.33521663E-08 + 1.16473308E-13 2.76323637E-03 0.00000000E+00 1.10533307E-02 0.00000000E+00 + 1.71143086E-03-3.89020246E-18 6.84697719E-03-1.63570976E-17 7.53646881E-02 + 0.00000000E+00 3.01522752E-01 0.00000000E+00 3.18850492E-02-7.89254561E-17 + 1.27540950E-01-3.19991554E-16 0.00000000E+00-8.54251359E-10 0.00000000E+00 + 6.03464434E-14 2.73806992E-04-7.27531143E-10-2.10372404E-08 5.90866267E-14 + 2.76322618E-03 0.00000000E+00-1.40828619E-03 0.00000000E+00 1.71142790E-03 +-5.04184382E-18-8.84884002E-04 2.27033178E-18 7.53653253E-02 0.00000000E+00 +-3.70897054E-02 0.00000000E+00 3.18849585E-02-7.86895398E-17-1.59665827E-02 + 4.70371472E-17-2.58773112E-04-6.87136258E-10 2.23436279E-08 5.74751023E-14 + 0.00000000E+00-8.12669184E-10 0.00000000E+00 5.96426813E-14-8.27427155E-04 +-1.04934913E-18-1.35522894E-03 0.00000000E+00-8.27427155E-04-1.04934913E-18 +-1.35522894E-03 0.00000000E+00 5.86275860E-03 1.55559426E-08 4.33521663E-08 + 1.16473308E-13 0.00000000E+00 1.83337686E-08 0.00000000E+00 1.19875871E-13 + 1.71143086E-03 3.89020246E-18 6.84697719E-03 1.63570976E-17 2.76323637E-03 + 0.00000000E+00 1.10533307E-02 0.00000000E+00 1.71143086E-03 3.89020246E-18 + 6.84697719E-03 1.63570976E-17 2.76323637E-03 0.00000000E+00 1.10533307E-02 + 0.00000000E+00-2.73806992E-04-7.27531143E-10 2.10372404E-08 5.90866267E-14 + 0.00000000E+00-8.54251359E-10 0.00000000E+00 6.03464434E-14 1.71142790E-03 + 5.04184382E-18-8.84884002E-04-2.27033178E-18 2.76322618E-03 0.00000000E+00 +-1.40828619E-03 0.00000000E+00 1.71142790E-03 5.04184382E-18-8.84884002E-04 +-2.27033178E-18 2.76322618E-03 0.00000000E+00-1.40828619E-03 0.00000000E+00 + 0.00000000E+00-8.12669184E-10 0.00000000E+00 5.96426813E-14 2.58773112E-04 +-6.87136258E-10-2.23436279E-08 5.74751023E-14-1.35522894E-03 0.00000000E+00 +-8.27427155E-04 1.04934913E-18-1.35522894E-03 0.00000000E+00-8.27427155E-04 + 1.04934913E-18 0.00000000E+00 1.83337686E-08 0.00000000E+00 1.19875871E-13 +-5.86275860E-03 1.55559426E-08-4.33521663E-08 1.16473308E-13 2.76323637E-03 + 0.00000000E+00 1.10533307E-02 0.00000000E+00 1.71143086E-03-3.89020246E-18 + 6.84697719E-03-1.63570976E-17 2.76323637E-03 0.00000000E+00 1.10533307E-02 + 0.00000000E+00 1.71143086E-03-3.89020246E-18 6.84697719E-03-1.63570976E-17 + 0.00000000E+00-8.54251359E-10 0.00000000E+00 6.03464434E-14 2.73806992E-04 +-7.27531143E-10-2.10372404E-08 5.90866267E-14 2.76322618E-03 0.00000000E+00 +-1.40828619E-03 0.00000000E+00 1.71142790E-03-5.04184382E-18-8.84884002E-04 + 2.27033178E-18 2.76322618E-03 0.00000000E+00-1.40828619E-03 0.00000000E+00 + 1.71142790E-03-5.04184382E-18-8.84884002E-04 2.27033178E-18-4.65274217E-06 +-6.34273504E-21-2.80079613E-08-4.23026181E-23-6.51609043E-05 0.00000000E+00 +-3.90116469E-07 0.00000000E+00-2.23436279E-08-5.74751023E-14 0.00000000E+00 +-5.96426813E-14-2.23436279E-08-5.74751023E-14 0.00000000E+00-5.96426813E-14 + 5.94818675E-07 1.55263934E-20 7.90817695E-08 2.37514461E-22-1.71361916E-06 + 0.00000000E+00 1.02746848E-06 0.00000000E+00 2.74179011E-05 7.27548477E-11 +-4.33521663E-08-1.16473308E-13 0.00000000E+00 8.58476706E-11 0.00000000E+00 +-1.19875871E-13 2.74179011E-05 7.27548477E-11-4.33521663E-08-1.16473308E-13 + 0.00000000E+00 8.58476706E-11 0.00000000E+00-1.19875871E-13 5.24759342E-06 + 1.98747951E-20-3.13180677E-08-1.19791821E-22 6.34470882E-05 0.00000000E+00 +-3.80578680E-07 0.00000000E+00-2.79383871E-05-7.41532836E-11-2.10372404E-08 +-5.90866267E-14 0.00000000E+00-8.72871233E-11 0.00000000E+00-6.03464434E-14 +-2.79383871E-05-7.41532836E-11-2.10372404E-08-5.90866267E-14 0.00000000E+00 +-8.72871233E-11 0.00000000E+00-6.03464434E-14 7.47559263E-04 1.13575472E-18 + 4.69442679E-06 7.83265530E-21 1.04125372E-02 0.00000000E+00 6.50332846E-05 + 0.00000000E+00 2.68237425E-04 7.11481538E-10 0.00000000E+00 8.37932657E-10 + 2.68237425E-04 7.11481538E-10 0.00000000E+00 8.37932657E-10 4.57249694E-03 + 1.48270852E-17 5.94818675E-07 1.55263934E-20 5.94134350E-02 0.00000000E+00 +-1.71361916E-06 0.00000000E+00-5.28579158E-03-1.40257631E-08-5.86275860E-03 +-1.55559426E-08 0.00000000E+00-1.65472474E-08 0.00000000E+00-1.83337686E-08 +-5.28579158E-03-1.40257631E-08-5.86275860E-03-1.55559426E-08 0.00000000E+00 +-1.65472474E-08 0.00000000E+00-1.83337686E-08 8.35913479E-04 3.18989215E-18 +-5.20429128E-06-2.00389632E-20 1.01580228E-02 0.00000000E+00-6.35643898E-05 + 0.00000000E+00-5.37265521E-03-1.42591460E-08 2.64896136E-04 7.02503236E-10 + 0.00000000E+00-1.67874797E-08 0.00000000E+00 8.28689812E-10-5.37265521E-03 +-1.42591460E-08 2.64896136E-04 7.02503236E-10 0.00000000E+00-1.67874797E-08 + 0.00000000E+00 8.28689812E-10-6.51609043E-05 0.00000000E+00-3.90116469E-07 + 0.00000000E+00-4.65274217E-06 6.34273504E-21-2.80079613E-08 4.23026181E-23 + 0.00000000E+00-5.96426813E-14 2.23436279E-08-5.74751023E-14 0.00000000E+00 +-5.96426813E-14 2.23436279E-08-5.74751023E-14-1.71361916E-06 0.00000000E+00 + 1.02746848E-06 0.00000000E+00 5.94818675E-07-1.55263934E-20 7.90817695E-08 +-2.37514461E-22 0.00000000E+00 8.58476706E-11 0.00000000E+00-1.19875871E-13 +-2.74179011E-05 7.27548477E-11 4.33521663E-08-1.16473308E-13 0.00000000E+00 + 8.58476706E-11 0.00000000E+00-1.19875871E-13-2.74179011E-05 7.27548477E-11 + 4.33521663E-08-1.16473308E-13 6.34470882E-05 0.00000000E+00-3.80578680E-07 + 0.00000000E+00 5.24759342E-06-1.98747951E-20-3.13180677E-08 1.19791821E-22 + 0.00000000E+00-8.72871233E-11 0.00000000E+00-6.03464434E-14 2.79383871E-05 +-7.41532836E-11 2.10372404E-08-5.90866267E-14 0.00000000E+00-8.72871233E-11 + 0.00000000E+00-6.03464434E-14 2.79383871E-05-7.41532836E-11 2.10372404E-08 +-5.90866267E-14 0.00000000E+00 1.64645670E-08 0.00000000E+00 8.56090999E-11 +-5.25481749E-03 1.39460877E-08-2.73285266E-05 7.25249473E-11 2.65767940E-03 + 0.00000000E+00 1.59827776E-03-3.07194056E-19 2.65767940E-03 0.00000000E+00 + 1.59827776E-03-3.07194056E-19 0.00000000E+00 1.65472474E-08 0.00000000E+00 +-8.58476706E-11-5.28579158E-03 1.40257631E-08 2.74179011E-05-7.27548477E-11 + 2.16833443E-02 0.00000000E+00 2.76323637E-03 0.00000000E+00 1.32378201E-02 +-1.31500233E-17 1.71143086E-03-3.89020246E-18 2.16833443E-02 0.00000000E+00 + 2.76323637E-03 0.00000000E+00 1.32378201E-02-1.31500233E-17 1.71143086E-03 +-3.89020246E-18 5.25481749E-03 1.39460877E-08 2.73285266E-05 7.25249473E-11 + 0.00000000E+00 1.64645670E-08 0.00000000E+00 8.56090999E-11 1.59827776E-03 + 3.07194056E-19 2.65767940E-03 0.00000000E+00 1.59827776E-03 3.07194056E-19 + 2.65767940E-03 0.00000000E+00 5.28579158E-03 1.40257631E-08-2.74179011E-05 +-7.27548477E-11 0.00000000E+00 1.65472474E-08 0.00000000E+00-8.58476706E-11 + 1.32378201E-02 1.31500233E-17 1.71143086E-03 3.89020246E-18 2.16833443E-02 + 0.00000000E+00 2.76323637E-03 0.00000000E+00 1.32378201E-02 1.31500233E-17 + 1.71143086E-03 3.89020246E-18 2.16833443E-02 0.00000000E+00 2.76323637E-03 + 0.00000000E+00 0.00000000E+00 1.64645670E-08 0.00000000E+00 8.56090999E-11 +-5.25481749E-03 1.39460877E-08-2.73285266E-05 7.25249473E-11 2.65767940E-03 + 0.00000000E+00 1.59827776E-03-3.07194056E-19 7.79121484E-02 0.00000000E+00 + 3.17912517E-02-6.24604176E-17 0.00000000E+00 1.65472474E-08 0.00000000E+00 +-8.58476706E-11-5.28579158E-03 1.40257631E-08 2.74179011E-05-7.27548477E-11 + 2.16833443E-02 0.00000000E+00 2.76323637E-03 0.00000000E+00 1.32378201E-02 +-1.31500233E-17 1.71143086E-03-3.89020246E-18 6.13054529E-01 0.00000000E+00 + 7.53646881E-02 0.00000000E+00 2.54704445E-01-5.66111986E-16 3.18850492E-02 +-7.89254561E-17 5.13004616E-03 1.36419098E-08 2.66825903E-05 7.09426319E-11 + 0.00000000E+00 1.61455713E-08 0.00000000E+00 8.39513528E-11 1.48869981E-03 + 8.51473568E-18 2.55322679E-03 0.00000000E+00 3.17002332E-02 3.72592135E-17 + 8.06538711E-02 0.00000000E+00 5.16278301E-03 1.37192714E-08-2.67770526E-05 +-7.11658572E-11 0.00000000E+00 1.62272256E-08 0.00000000E+00-8.41869640E-11 + 1.23468946E-02 4.53867764E-17 1.59828056E-03 1.91281386E-18 2.08433575E-02 + 0.00000000E+00 2.65768930E-03 0.00000000E+00 2.53965523E-01 3.93043741E-16 + 3.17913421E-02 6.16037817E-17 6.34202278E-01 0.00000000E+00 7.79113882E-02 + 0.00000000E+00 1.06895961E-02 0.00000000E+00 6.67598937E-05 0.00000000E+00 + 6.62541288E-04-1.28136632E-18 4.16212610E-06-7.32980403E-21 0.00000000E+00 + 8.21800780E-10-2.62312661E-04 6.95861800E-10 0.00000000E+00 8.21800780E-10 +-2.62312661E-04 6.95861800E-10 6.09477772E-02 0.00000000E+00-1.86534041E-06 + 0.00000000E+00 4.07167374E-03-3.21857444E-18 5.72369280E-07 1.76617854E-21 + 0.00000000E+00-1.62272256E-08 0.00000000E+00-1.79801387E-08 5.16278301E-03 +-1.37192714E-08 5.73027854E-03-1.52151638E-08 0.00000000E+00-1.62272256E-08 + 0.00000000E+00-1.79801387E-08 5.16278301E-03-1.37192714E-08 5.73027854E-03 +-1.52151638E-08 1.04125372E-02 0.00000000E+00-6.51609043E-05 0.00000000E+00 + 7.47559263E-04-1.13575472E-18-4.65274217E-06 6.34273504E-21 0.00000000E+00 +-1.64645670E-08 0.00000000E+00 8.12669184E-10 5.25481749E-03-1.39460877E-08 +-2.58773112E-04 6.87136258E-10 0.00000000E+00-1.64645670E-08 0.00000000E+00 + 8.12669184E-10 5.25481749E-03-1.39460877E-08-2.58773112E-04 6.87136258E-10 +-2.52309708E-04-6.72223487E-10 2.36155764E-08 5.58063262E-14 0.00000000E+00 +-7.96850822E-10 0.00000000E+00 5.89027984E-14-7.71745094E-04-2.60688738E-18 +-1.30272902E-03 0.00000000E+00-1.58728938E-02-2.47157488E-17-3.96413148E-02 + 0.00000000E+00 5.73027854E-03 1.52151638E-08 4.59387584E-08 1.13196834E-13 + 0.00000000E+00 1.79801387E-08 0.00000000E+00 1.18434488E-13 1.59828056E-03 + 1.91281386E-18 6.39439251E-03 7.94574565E-18 2.65768930E-03 0.00000000E+00 + 1.06311283E-02 0.00000000E+00 3.17913421E-02 6.16037817E-17 1.27166148E-01 + 2.45432362E-16 7.79113882E-02 0.00000000E+00 3.11716723E-01 0.00000000E+00 +-2.68237425E-04-7.11481538E-10 2.23436279E-08 5.74751023E-14 0.00000000E+00 +-8.37932657E-10 0.00000000E+00 5.96426813E-14 1.59827776E-03 3.07194056E-19 +-8.27427155E-04-1.04934913E-18 2.65767940E-03 0.00000000E+00-1.35522894E-03 + 0.00000000E+00 3.17912517E-02 6.24604176E-17-1.59190752E-02-3.53464684E-17 + 7.79121484E-02 0.00000000E+00-3.83192091E-02 0.00000000E+00 0.00000000E+00 +-7.96850822E-10 0.00000000E+00 5.89027984E-14 2.52309708E-04-6.72223487E-10 +-2.36155764E-08 5.58063262E-14-1.30272902E-03 0.00000000E+00-7.71745094E-04 + 2.60688738E-18-3.96413148E-02 0.00000000E+00-1.58728938E-02 2.47157488E-17 + 0.00000000E+00 1.79801387E-08 0.00000000E+00 1.18434488E-13-5.73027854E-03 + 1.52151638E-08-4.59387584E-08 1.13196834E-13 2.65768930E-03 0.00000000E+00 + 1.06311283E-02 0.00000000E+00 1.59828056E-03-1.91281386E-18 6.39439251E-03 +-7.94574565E-18 7.79113882E-02 0.00000000E+00 3.11716723E-01 0.00000000E+00 + 3.17913421E-02-6.16037817E-17 1.27166148E-01-2.45432362E-16 0.00000000E+00 +-8.37932657E-10 0.00000000E+00 5.96426813E-14 2.68237425E-04-7.11481538E-10 +-2.23436279E-08 5.74751023E-14 2.65767940E-03 0.00000000E+00-1.35522894E-03 + 0.00000000E+00 1.59827776E-03-3.07194056E-19-8.27427155E-04 1.04934913E-18 + 7.79121484E-02 0.00000000E+00-3.83192091E-02 0.00000000E+00 3.17912517E-02 +-6.24604176E-17-1.59190752E-02 3.53464684E-17-2.52309708E-04-6.72223487E-10 + 2.36155764E-08 5.58063262E-14 0.00000000E+00-7.96850822E-10 0.00000000E+00 + 5.89027984E-14-7.71745094E-04-2.60688738E-18-1.30272902E-03 0.00000000E+00 +-7.71745094E-04-2.60688738E-18-1.30272902E-03 0.00000000E+00 5.73027854E-03 + 1.52151638E-08 4.59387584E-08 1.13196834E-13 0.00000000E+00 1.79801387E-08 + 0.00000000E+00 1.18434488E-13 1.59828056E-03 1.91281386E-18 6.39439251E-03 + 7.94574565E-18 2.65768930E-03 0.00000000E+00 1.06311283E-02 0.00000000E+00 + 1.59828056E-03 1.91281386E-18 6.39439251E-03 7.94574565E-18 2.65768930E-03 + 0.00000000E+00 1.06311283E-02 0.00000000E+00-2.68237425E-04-7.11481538E-10 + 2.23436279E-08 5.74751023E-14 0.00000000E+00-8.37932657E-10 0.00000000E+00 + 5.96426813E-14 1.59827776E-03 3.07194056E-19-8.27427155E-04-1.04934913E-18 + 2.65767940E-03 0.00000000E+00-1.35522894E-03 0.00000000E+00 1.59827776E-03 + 3.07194056E-19-8.27427155E-04-1.04934913E-18 2.65767940E-03 0.00000000E+00 +-1.35522894E-03 0.00000000E+00 0.00000000E+00-7.96850822E-10 0.00000000E+00 + 5.89027984E-14 2.52309708E-04-6.72223487E-10-2.36155764E-08 5.58063262E-14 +-1.30272902E-03 0.00000000E+00-7.71745094E-04 2.60688738E-18-1.30272902E-03 + 0.00000000E+00-7.71745094E-04 2.60688738E-18 0.00000000E+00 1.79801387E-08 + 0.00000000E+00 1.18434488E-13-5.73027854E-03 1.52151638E-08-4.59387584E-08 + 1.13196834E-13 2.65768930E-03 0.00000000E+00 1.06311283E-02 0.00000000E+00 + 1.59828056E-03-1.91281386E-18 6.39439251E-03-7.94574565E-18 2.65768930E-03 + 0.00000000E+00 1.06311283E-02 0.00000000E+00 1.59828056E-03-1.91281386E-18 + 6.39439251E-03-7.94574565E-18 0.00000000E+00-8.37932657E-10 0.00000000E+00 + 5.96426813E-14 2.68237425E-04-7.11481538E-10-2.23436279E-08 5.74751023E-14 + 2.65767940E-03 0.00000000E+00-1.35522894E-03 0.00000000E+00 1.59827776E-03 +-3.07194056E-19-8.27427155E-04 1.04934913E-18 2.65767940E-03 0.00000000E+00 +-1.35522894E-03 0.00000000E+00 1.59827776E-03-3.07194056E-19-8.27427155E-04 + 1.04934913E-18-4.12203555E-06-8.67992250E-21-2.48228106E-08-4.78910259E-23 +-6.68989104E-05 0.00000000E+00-4.00499004E-07 0.00000000E+00-2.36155764E-08 +-5.58063262E-14 0.00000000E+00-5.89027984E-14-2.36155764E-08-5.58063262E-14 + 0.00000000E+00-5.89027984E-14 5.72369280E-07-1.76617854E-21 7.04217157E-08 + 8.44824150E-23-1.86534041E-06 0.00000000E+00 1.05401586E-06 0.00000000E+00 + 2.67770526E-05 7.11658572E-11-4.59387584E-08-1.13196834E-13 0.00000000E+00 + 8.41869640E-11 0.00000000E+00-1.18434488E-13 2.67770526E-05 7.11658572E-11 +-4.59387584E-08-1.13196834E-13 0.00000000E+00 8.41869640E-11 0.00000000E+00 +-1.18434488E-13 4.69442679E-06 7.83265530E-21-2.80079613E-08-4.23026181E-23 + 6.50332846E-05 0.00000000E+00-3.90116469E-07 0.00000000E+00-2.73285266E-05 +-7.25249473E-11-2.23436279E-08-5.74751023E-14 0.00000000E+00-8.56090999E-11 + 0.00000000E+00-5.96426813E-14-2.73285266E-05-7.25249473E-11-2.23436279E-08 +-5.74751023E-14 0.00000000E+00-8.56090999E-11 0.00000000E+00-5.96426813E-14 + 6.62541288E-04 1.28136632E-18 4.16212610E-06 7.32980403E-21 1.06895961E-02 + 0.00000000E+00 6.67598937E-05 0.00000000E+00 2.62312661E-04 6.95861800E-10 + 0.00000000E+00 8.21800780E-10 2.62312661E-04 6.95861800E-10 0.00000000E+00 + 8.21800780E-10 4.07167374E-03 3.21857444E-18 5.72369280E-07-1.76617854E-21 + 6.09477772E-02 0.00000000E+00-1.86534041E-06 0.00000000E+00-5.16278301E-03 +-1.37192714E-08-5.73027854E-03-1.52151638E-08 0.00000000E+00-1.62272256E-08 + 0.00000000E+00-1.79801387E-08-5.16278301E-03-1.37192714E-08-5.73027854E-03 +-1.52151638E-08 0.00000000E+00-1.62272256E-08 0.00000000E+00-1.79801387E-08 + 7.47559263E-04 1.13575472E-18-4.65274217E-06-6.34273504E-21 1.04125372E-02 + 0.00000000E+00-6.51609043E-05 0.00000000E+00-5.25481749E-03-1.39460877E-08 + 2.58773112E-04 6.87136258E-10 0.00000000E+00-1.64645670E-08 0.00000000E+00 + 8.12669184E-10-5.25481749E-03-1.39460877E-08 2.58773112E-04 6.87136258E-10 + 0.00000000E+00-1.64645670E-08 0.00000000E+00 8.12669184E-10-6.68989104E-05 + 0.00000000E+00-4.00499004E-07 0.00000000E+00-4.12203555E-06 8.67992250E-21 +-2.48228106E-08 4.78910259E-23 0.00000000E+00-5.89027984E-14 2.36155764E-08 +-5.58063262E-14 0.00000000E+00-5.89027984E-14 2.36155764E-08-5.58063262E-14 +-1.86534041E-06 0.00000000E+00 1.05401586E-06 0.00000000E+00 5.72369280E-07 + 1.76617854E-21 7.04217157E-08-8.44824150E-23 0.00000000E+00 8.41869640E-11 + 0.00000000E+00-1.18434488E-13-2.67770526E-05 7.11658572E-11 4.59387584E-08 +-1.13196834E-13 0.00000000E+00 8.41869640E-11 0.00000000E+00-1.18434488E-13 +-2.67770526E-05 7.11658572E-11 4.59387584E-08-1.13196834E-13 6.50332846E-05 + 0.00000000E+00-3.90116469E-07 0.00000000E+00 4.69442679E-06-7.83265530E-21 +-2.80079613E-08 4.23026181E-23 0.00000000E+00-8.56090999E-11 0.00000000E+00 +-5.96426813E-14 2.73285266E-05-7.25249473E-11 2.23436279E-08-5.74751023E-14 + 0.00000000E+00-8.56090999E-11 0.00000000E+00-5.96426813E-14 2.73285266E-05 +-7.25249473E-11 2.23436279E-08-5.74751023E-14 0.00000000E+00 1.61455713E-08 + 0.00000000E+00 8.39513528E-11-5.13004616E-03 1.36419098E-08-2.66825903E-05 + 7.09426319E-11 2.55322679E-03 0.00000000E+00 1.48869981E-03-8.51473568E-18 + 2.55322679E-03 0.00000000E+00 1.48869981E-03-8.51473568E-18 0.00000000E+00 + 1.62272256E-08 0.00000000E+00-8.41869640E-11-5.16278301E-03 1.37192714E-08 + 2.67770526E-05-7.11658572E-11 2.08433575E-02 0.00000000E+00 2.65768930E-03 + 0.00000000E+00 1.23468946E-02-4.53867764E-17 1.59828056E-03-1.91281386E-18 + 2.08433575E-02 0.00000000E+00 2.65768930E-03 0.00000000E+00 1.23468946E-02 +-4.53867764E-17 1.59828056E-03-1.91281386E-18 5.13004616E-03 1.36419098E-08 + 2.66825903E-05 7.09426319E-11 0.00000000E+00 1.61455713E-08 0.00000000E+00 + 8.39513528E-11 1.48869981E-03 8.51473568E-18 2.55322679E-03 0.00000000E+00 + 1.48869981E-03 8.51473568E-18 2.55322679E-03 0.00000000E+00 5.16278301E-03 + 1.37192714E-08-2.67770526E-05-7.11658572E-11 0.00000000E+00 1.62272256E-08 + 0.00000000E+00-8.41869640E-11 1.23468946E-02 4.53867764E-17 1.59828056E-03 + 1.91281386E-18 2.08433575E-02 0.00000000E+00 2.65768930E-03 0.00000000E+00 + 1.23468946E-02 4.53867764E-17 1.59828056E-03 1.91281386E-18 2.08433575E-02 + 0.00000000E+00 2.65768930E-03 0.00000000E+00 0.00000000E+00 1.61455713E-08 + 0.00000000E+00 8.39513528E-11-5.13004616E-03 1.36419098E-08-2.66825903E-05 + 7.09426319E-11 2.55322679E-03 0.00000000E+00 1.48869981E-03-8.51473568E-18 + 8.06538711E-02 0.00000000E+00 3.17002332E-02-3.72592135E-17 0.00000000E+00 + 1.62272256E-08 0.00000000E+00-8.41869640E-11-5.16278301E-03 1.37192714E-08 + 2.67770526E-05-7.11658572E-11 2.08433575E-02 0.00000000E+00 2.65768930E-03 + 0.00000000E+00 1.23468946E-02-4.53867764E-17 1.59828056E-03-1.91281386E-18 + 6.34202278E-01 0.00000000E+00 7.79113882E-02 0.00000000E+00 2.53965523E-01 +-3.93043741E-16 3.17913421E-02-6.16037817E-17 4.99861328E-03 1.33469582E-08 + 2.60019680E-05 6.94081162E-11 0.00000000E+00 1.58307203E-08 0.00000000E+00 + 8.23150473E-11 1.38273676E-03 5.45447543E-19 2.44982624E-03 0.00000000E+00 + 3.16119696E-02 7.04588741E-17 8.36128445E-02 0.00000000E+00 5.03303721E-03 + 1.34219111E-08-2.61012977E-05-6.96243919E-11 0.00000000E+00 1.59112842E-08 + 0.00000000E+00-8.25475130E-11 1.14847169E-02 2.96186639E-17 1.48870231E-03 + 7.19681856E-18 2.00119554E-02 0.00000000E+00 2.55323636E-03 0.00000000E+00 + 2.53248378E-01 3.66269987E-16 3.17003238E-02 3.05517383E-17 6.56997609E-01 + 0.00000000E+00 8.06529646E-02 0.00000000E+00 1.09916887E-02 0.00000000E+00 + 6.86423661E-05 0.00000000E+00 5.80827978E-04-3.36050674E-18 3.65048962E-06 +-2.09085556E-20 0.00000000E+00 8.05864746E-10-2.56041225E-04 6.80686546E-10 + 0.00000000E+00 8.05864746E-10-2.56041225E-04 6.80686546E-10 6.26192815E-02 + 0.00000000E+00-2.03385225E-06 0.00000000E+00 3.59002130E-03-1.48470091E-17 + 5.50113834E-07 1.50281726E-20 0.00000000E+00-1.59112842E-08 0.00000000E+00 +-1.76309011E-08 5.03303721E-03-1.34219111E-08 5.59026708E-03-1.48842853E-08 + 0.00000000E+00-1.59112842E-08 0.00000000E+00-1.76309011E-08 5.03303721E-03 +-1.34219111E-08 5.59026708E-03-1.48842853E-08 1.06895961E-02 0.00000000E+00 +-6.68989104E-05 0.00000000E+00 6.62541288E-04-1.28136632E-18-4.12203555E-06 + 8.67992250E-21 0.00000000E+00-1.61455713E-08 0.00000000E+00 7.96850822E-10 + 5.13004616E-03-1.36419098E-08-2.52309708E-04 6.72223487E-10 0.00000000E+00 +-1.61455713E-08 0.00000000E+00 7.96850822E-10 5.13004616E-03-1.36419098E-08 +-2.52309708E-04 6.72223487E-10-2.45522789E-04-6.57784243E-10 2.48324306E-08 + 5.40689114E-14 0.00000000E+00-7.81247960E-10 0.00000000E+00 5.81164074E-14 +-7.17859768E-04-1.93556653E-18-1.25076565E-03 0.00000000E+00-1.58280733E-02 +-2.52526531E-17-4.10664523E-02 0.00000000E+00 5.59026708E-03 1.48842853E-08 + 4.84201361E-08 1.09795244E-13 0.00000000E+00 1.76309011E-08 0.00000000E+00 + 1.16912045E-13 1.48870231E-03 7.19681856E-18 5.95609546E-03 2.67304467E-17 + 2.55323636E-03 0.00000000E+00 1.02133022E-02 0.00000000E+00 3.17003238E-02 + 3.05517383E-17 1.26802098E-01 1.58769458E-16 8.06529646E-02 0.00000000E+00 + 3.22691311E-01 0.00000000E+00-2.62312661E-04-6.95861800E-10 2.36155764E-08 + 5.58063262E-14 0.00000000E+00-8.21800780E-10 0.00000000E+00 5.89027984E-14 + 1.48869981E-03 8.51473568E-18-7.71745094E-04-2.60688738E-18 2.55322679E-03 + 0.00000000E+00-1.30272902E-03 0.00000000E+00 3.17002332E-02 3.72592135E-17 +-1.58728938E-02-2.47157488E-17 8.06538711E-02 0.00000000E+00-3.96413148E-02 + 0.00000000E+00 0.00000000E+00-7.81247960E-10 0.00000000E+00 5.81164074E-14 + 2.45522789E-04-6.57784243E-10-2.48324306E-08 5.40689114E-14-1.25076565E-03 + 0.00000000E+00-7.17859768E-04 1.93556653E-18-4.10664523E-02 0.00000000E+00 +-1.58280733E-02 2.52526531E-17 0.00000000E+00 1.76309011E-08 0.00000000E+00 + 1.16912045E-13-5.59026708E-03 1.48842853E-08-4.84201361E-08 1.09795244E-13 + 2.55323636E-03 0.00000000E+00 1.02133022E-02 0.00000000E+00 1.48870231E-03 +-7.19681856E-18 5.95609546E-03-2.67304467E-17 8.06529646E-02 0.00000000E+00 + 3.22691311E-01 0.00000000E+00 3.17003238E-02-3.05517383E-17 1.26802098E-01 +-1.58769458E-16 0.00000000E+00-8.21800780E-10 0.00000000E+00 5.89027984E-14 + 2.62312661E-04-6.95861800E-10-2.36155764E-08 5.58063262E-14 2.55322679E-03 + 0.00000000E+00-1.30272902E-03 0.00000000E+00 1.48869981E-03-8.51473568E-18 +-7.71745094E-04 2.60688738E-18 8.06538711E-02 0.00000000E+00-3.96413148E-02 + 0.00000000E+00 3.17002332E-02-3.72592135E-17-1.58728938E-02 2.47157488E-17 +-2.45522789E-04-6.57784243E-10 2.48324306E-08 5.40689114E-14 0.00000000E+00 +-7.81247960E-10 0.00000000E+00 5.81164074E-14-7.17859768E-04-1.93556653E-18 +-1.25076565E-03 0.00000000E+00-7.17859768E-04-1.93556653E-18-1.25076565E-03 + 0.00000000E+00 5.59026708E-03 1.48842853E-08 4.84201361E-08 1.09795244E-13 + 0.00000000E+00 1.76309011E-08 0.00000000E+00 1.16912045E-13 1.48870231E-03 + 7.19681856E-18 5.95609546E-03 2.67304467E-17 2.55323636E-03 0.00000000E+00 + 1.02133022E-02 0.00000000E+00 1.48870231E-03 7.19681856E-18 5.95609546E-03 + 2.67304467E-17 2.55323636E-03 0.00000000E+00 1.02133022E-02 0.00000000E+00 +-2.62312661E-04-6.95861800E-10 2.36155764E-08 5.58063262E-14 0.00000000E+00 +-8.21800780E-10 0.00000000E+00 5.89027984E-14 1.48869981E-03 8.51473568E-18 +-7.71745094E-04-2.60688738E-18 2.55322679E-03 0.00000000E+00-1.30272902E-03 + 0.00000000E+00 1.48869981E-03 8.51473568E-18-7.71745094E-04-2.60688738E-18 + 2.55322679E-03 0.00000000E+00-1.30272902E-03 0.00000000E+00 0.00000000E+00 +-7.81247960E-10 0.00000000E+00 5.81164074E-14 2.45522789E-04-6.57784243E-10 +-2.48324306E-08 5.40689114E-14-1.25076565E-03 0.00000000E+00-7.17859768E-04 + 1.93556653E-18-1.25076565E-03 0.00000000E+00-7.17859768E-04 1.93556653E-18 + 0.00000000E+00 1.76309011E-08 0.00000000E+00 1.16912045E-13-5.59026708E-03 + 1.48842853E-08-4.84201361E-08 1.09795244E-13 2.55323636E-03 0.00000000E+00 + 1.02133022E-02 0.00000000E+00 1.48870231E-03-7.19681856E-18 5.95609546E-03 +-2.67304467E-17 2.55323636E-03 0.00000000E+00 1.02133022E-02 0.00000000E+00 + 1.48870231E-03-7.19681856E-18 5.95609546E-03-2.67304467E-17 0.00000000E+00 +-8.21800780E-10 0.00000000E+00 5.89027984E-14 2.62312661E-04-6.95861800E-10 +-2.36155764E-08 5.58063262E-14 2.55322679E-03 0.00000000E+00-1.30272902E-03 + 0.00000000E+00 1.48869981E-03-8.51473568E-18-7.71745094E-04 2.60688738E-18 + 2.55322679E-03 0.00000000E+00-1.30272902E-03 0.00000000E+00 1.48869981E-03 +-8.51473568E-18-7.71745094E-04 2.60688738E-18-3.61197924E-06-2.11421703E-20 +-2.17614400E-08-1.26218455E-22-6.87940846E-05 0.00000000E+00-4.11819567E-07 + 0.00000000E+00-2.48324306E-08-5.40689114E-14 0.00000000E+00-5.81164074E-14 +-2.48324306E-08-5.40689114E-14 0.00000000E+00-5.81164074E-14 5.50113834E-07 +-1.50281726E-20 6.20931825E-08 2.46059960E-22-2.03385225E-06 0.00000000E+00 + 1.08293750E-06 0.00000000E+00 2.61012977E-05 6.96243919E-11-4.84201361E-08 +-1.09795244E-13 0.00000000E+00 8.25475130E-11 0.00000000E+00-1.16912045E-13 + 2.61012977E-05 6.96243919E-11-4.84201361E-08-1.09795244E-13 0.00000000E+00 + 8.25475130E-11 0.00000000E+00-1.16912045E-13 4.16212610E-06 7.32980403E-21 +-2.48228106E-08-4.78910259E-23 6.67598937E-05 0.00000000E+00-4.00499004E-07 + 0.00000000E+00-2.66825903E-05-7.09426319E-11-2.36155764E-08-5.58063262E-14 + 0.00000000E+00-8.39513528E-11 0.00000000E+00-5.89027984E-14-2.66825903E-05 +-7.09426319E-11-2.36155764E-08-5.58063262E-14 0.00000000E+00-8.39513528E-11 + 0.00000000E+00-5.89027984E-14 5.80827978E-04 3.36050674E-18 3.65048962E-06 + 2.09085556E-20 1.09916887E-02 0.00000000E+00 6.86423661E-05 0.00000000E+00 + 2.56041225E-04 6.80686546E-10 0.00000000E+00 8.05864746E-10 2.56041225E-04 + 6.80686546E-10 0.00000000E+00 8.05864746E-10 3.59002130E-03 1.48470091E-17 + 5.50113834E-07-1.50281726E-20 6.26192815E-02 0.00000000E+00-2.03385225E-06 + 0.00000000E+00-5.03303721E-03-1.34219111E-08-5.59026708E-03-1.48842853E-08 + 0.00000000E+00-1.59112842E-08 0.00000000E+00-1.76309011E-08-5.03303721E-03 +-1.34219111E-08-5.59026708E-03-1.48842853E-08 0.00000000E+00-1.59112842E-08 + 0.00000000E+00-1.76309011E-08 6.62541288E-04 1.28136632E-18-4.12203555E-06 +-8.67992250E-21 1.06895961E-02 0.00000000E+00-6.68989104E-05 0.00000000E+00 +-5.13004616E-03-1.36419098E-08 2.52309708E-04 6.72223487E-10 0.00000000E+00 +-1.61455713E-08 0.00000000E+00 7.96850822E-10-5.13004616E-03-1.36419098E-08 + 2.52309708E-04 6.72223487E-10 0.00000000E+00-1.61455713E-08 0.00000000E+00 + 7.96850822E-10-6.87940846E-05 0.00000000E+00-4.11819567E-07 0.00000000E+00 +-3.61197924E-06 2.11421703E-20-2.17614400E-08 1.26218455E-22 0.00000000E+00 +-5.81164074E-14 2.48324306E-08-5.40689114E-14 0.00000000E+00-5.81164074E-14 + 2.48324306E-08-5.40689114E-14-2.03385225E-06 0.00000000E+00 1.08293750E-06 + 0.00000000E+00 5.50113834E-07 1.50281726E-20 6.20931825E-08-2.46059960E-22 + 0.00000000E+00 8.25475130E-11 0.00000000E+00-1.16912045E-13-2.61012977E-05 + 6.96243919E-11 4.84201361E-08-1.09795244E-13 0.00000000E+00 8.25475130E-11 + 0.00000000E+00-1.16912045E-13-2.61012977E-05 6.96243919E-11 4.84201361E-08 +-1.09795244E-13 6.67598937E-05 0.00000000E+00-4.00499004E-07 0.00000000E+00 + 4.16212610E-06-7.32980403E-21-2.48228106E-08 4.78910259E-23 0.00000000E+00 +-8.39513528E-11 0.00000000E+00-5.89027984E-14 2.66825903E-05-7.09426319E-11 + 2.36155764E-08-5.58063262E-14 0.00000000E+00-8.39513528E-11 0.00000000E+00 +-5.89027984E-14 2.66825903E-05-7.09426319E-11 2.36155764E-08-5.58063262E-14 + 0.00000000E+00 1.58307203E-08 0.00000000E+00 8.23150473E-11-4.99861328E-03 + 1.33469582E-08-2.60019680E-05 6.94081162E-11 2.44982624E-03 0.00000000E+00 + 1.38273676E-03-5.45447543E-19 2.44982624E-03 0.00000000E+00 1.38273676E-03 +-5.45447543E-19 0.00000000E+00 1.59112842E-08 0.00000000E+00-8.25475130E-11 +-5.03303721E-03 1.34219111E-08 2.61012977E-05-6.96243919E-11 2.00119554E-02 + 0.00000000E+00 2.55323636E-03 0.00000000E+00 1.14847169E-02-2.96186639E-17 + 1.48870231E-03-7.19681856E-18 2.00119554E-02 0.00000000E+00 2.55323636E-03 + 0.00000000E+00 1.14847169E-02-2.96186639E-17 1.48870231E-03-7.19681856E-18 + 4.99861328E-03 1.33469582E-08 2.60019680E-05 6.94081162E-11 0.00000000E+00 + 1.58307203E-08 0.00000000E+00 8.23150473E-11 1.38273676E-03 5.45447543E-19 + 2.44982624E-03 0.00000000E+00 1.38273676E-03 5.45447543E-19 2.44982624E-03 + 0.00000000E+00 5.03303721E-03 1.34219111E-08-2.61012977E-05-6.96243919E-11 + 0.00000000E+00 1.59112842E-08 0.00000000E+00-8.25475130E-11 1.14847169E-02 + 2.96186639E-17 1.48870231E-03 7.19681856E-18 2.00119554E-02 0.00000000E+00 + 2.55323636E-03 0.00000000E+00 1.14847169E-02 2.96186639E-17 1.48870231E-03 + 7.19681856E-18 2.00119554E-02 0.00000000E+00 2.55323636E-03 0.00000000E+00 + 0.00000000E+00 1.58307203E-08 0.00000000E+00 8.23150473E-11-4.99861328E-03 + 1.33469582E-08-2.60019680E-05 6.94081162E-11 2.44982624E-03 0.00000000E+00 + 1.38273676E-03-5.45447543E-19 8.36128445E-02 0.00000000E+00 3.16119696E-02 +-7.04588741E-17 0.00000000E+00 1.59112842E-08 0.00000000E+00-8.25475130E-11 +-5.03303721E-03 1.34219111E-08 2.61012977E-05-6.96243919E-11 2.00119554E-02 + 0.00000000E+00 2.55323636E-03 0.00000000E+00 1.14847169E-02-2.96186639E-17 + 1.48870231E-03-7.19681856E-18 6.56997609E-01 0.00000000E+00 8.06529646E-02 + 0.00000000E+00 2.53248378E-01-3.66269987E-16 3.17003238E-02-3.05517383E-17 + 4.86075581E-03 1.30616280E-08 2.52878955E-05 6.79234373E-11 0.00000000E+00 + 1.55202773E-08 0.00000000E+00 8.07015437E-11 1.28043105E-03 3.40777737E-18 + 2.34743654E-03 0.00000000E+00 3.15265277E-02 1.04649952E-16 8.68149937E-02 + 0.00000000E+00 4.89680507E-03 1.31340656E-08-2.53919163E-05-6.81324562E-11 + 0.00000000E+00 1.55996802E-08 0.00000000E+00-8.09306600E-11 1.06516294E-02 + 1.57270646E-17 1.38273908E-03 8.41835607E-19 1.91888049E-02 0.00000000E+00 + 2.44983550E-03 0.00000000E+00 2.52553530E-01 8.76603235E-16 3.16120592E-02 + 9.47988447E-17 6.81633378E-01 0.00000000E+00 8.36117581E-02 0.00000000E+00 + 1.13216876E-02 0.00000000E+00 7.06985711E-05 0.00000000E+00 5.02368150E-04 +-1.97397660E-18 3.15920268E-06-1.29098602E-20 0.00000000E+00 7.90136622E-10 +-2.49437815E-04 6.65973523E-10 0.00000000E+00 7.90136622E-10-2.49437815E-04 + 6.65973523E-10 6.44435088E-02 0.00000000E+00-2.22163385E-06 0.00000000E+00 + 3.12733081E-03-1.71465606E-17 5.28230132E-07-1.04488351E-20 0.00000000E+00 +-1.55996802E-08 0.00000000E+00-1.72863270E-08 4.89680507E-03-1.31340656E-08 + 5.44303140E-03-1.45637109E-08 0.00000000E+00-1.55996802E-08 0.00000000E+00 +-1.72863270E-08 4.89680507E-03-1.31340656E-08 5.44303140E-03-1.45637109E-08 + 1.09916887E-02 0.00000000E+00-6.87940846E-05 0.00000000E+00 5.80827978E-04 +-3.36050674E-18-3.61197924E-06 2.11421703E-20 0.00000000E+00-1.58307203E-08 + 0.00000000E+00 7.81247960E-10 4.99861328E-03-1.33469582E-08-2.45522789E-04 + 6.57784243E-10 0.00000000E+00-1.58307203E-08 0.00000000E+00 7.81247960E-10 + 4.99861328E-03-1.33469582E-08-2.45522789E-04 6.57784243E-10-2.38422733E-04 +-6.43839774E-10 2.60052053E-08 5.22547100E-14 0.00000000E+00-7.65874611E-10 + 0.00000000E+00 5.72790698E-14-6.65792532E-04-1.06240324E-18-1.19931801E-03 + 0.00000000E+00-1.57846467E-02-4.98621993E-17-4.26066879E-02 0.00000000E+00 + 5.44303140E-03 1.45637109E-08 5.08236504E-08 1.06250655E-13 0.00000000E+00 + 1.72863270E-08 0.00000000E+00 1.15294289E-13 1.38273908E-03 8.41835607E-19 + 5.53225806E-03 6.10119392E-18 2.44983550E-03 0.00000000E+00 9.79968469E-03 + 0.00000000E+00 3.16120592E-02 9.47988447E-17 1.26449066E-01 3.19460499E-16 + 8.36117581E-02 0.00000000E+00 3.34536116E-01 0.00000000E+00-2.56041225E-04 +-6.80686546E-10 2.48324306E-08 5.40689114E-14 0.00000000E+00-8.05864746E-10 + 0.00000000E+00 5.81164074E-14 1.38273676E-03 5.45447543E-19-7.17859768E-04 +-1.93556653E-18 2.44982624E-03 0.00000000E+00-1.25076565E-03 0.00000000E+00 + 3.16119696E-02 7.04588741E-17-1.58280733E-02-2.52526531E-17 8.36128445E-02 + 0.00000000E+00-4.10664523E-02 0.00000000E+00 0.00000000E+00-7.65874611E-10 + 0.00000000E+00 5.72790698E-14 2.38422733E-04-6.43839774E-10-2.60052053E-08 + 5.22547100E-14-1.19931801E-03 0.00000000E+00-6.65792532E-04 1.06240324E-18 +-4.26066879E-02 0.00000000E+00-1.57846467E-02 4.98621993E-17 0.00000000E+00 + 1.72863270E-08 0.00000000E+00 1.15294289E-13-5.44303140E-03 1.45637109E-08 +-5.08236504E-08 1.06250655E-13 2.44983550E-03 0.00000000E+00 9.79968469E-03 + 0.00000000E+00 1.38273908E-03-8.41835607E-19 5.53225806E-03-6.10119392E-18 + 8.36117581E-02 0.00000000E+00 3.34536116E-01 0.00000000E+00 3.16120592E-02 +-9.47988447E-17 1.26449066E-01-3.19460499E-16 0.00000000E+00-8.05864746E-10 + 0.00000000E+00 5.81164074E-14 2.56041225E-04-6.80686546E-10-2.48324306E-08 + 5.40689114E-14 2.44982624E-03 0.00000000E+00-1.25076565E-03 0.00000000E+00 + 1.38273676E-03-5.45447543E-19-7.17859768E-04 1.93556653E-18 8.36128445E-02 + 0.00000000E+00-4.10664523E-02 0.00000000E+00 3.16119696E-02-7.04588741E-17 +-1.58280733E-02 2.52526531E-17-2.38422733E-04-6.43839774E-10 2.60052053E-08 + 5.22547100E-14 0.00000000E+00-7.65874611E-10 0.00000000E+00 5.72790698E-14 +-6.65792532E-04-1.06240324E-18-1.19931801E-03 0.00000000E+00-6.65792532E-04 +-1.06240324E-18-1.19931801E-03 0.00000000E+00 5.44303140E-03 1.45637109E-08 + 5.08236504E-08 1.06250655E-13 0.00000000E+00 1.72863270E-08 0.00000000E+00 + 1.15294289E-13 1.38273908E-03 8.41835607E-19 5.53225806E-03 6.10119392E-18 + 2.44983550E-03 0.00000000E+00 9.79968469E-03 0.00000000E+00 1.38273908E-03 + 8.41835607E-19 5.53225806E-03 6.10119392E-18 2.44983550E-03 0.00000000E+00 + 9.79968469E-03 0.00000000E+00-2.56041225E-04-6.80686546E-10 2.48324306E-08 + 5.40689114E-14 0.00000000E+00-8.05864746E-10 0.00000000E+00 5.81164074E-14 + 1.38273676E-03 5.45447543E-19-7.17859768E-04-1.93556653E-18 2.44982624E-03 + 0.00000000E+00-1.25076565E-03 0.00000000E+00 1.38273676E-03 5.45447543E-19 +-7.17859768E-04-1.93556653E-18 2.44982624E-03 0.00000000E+00-1.25076565E-03 + 0.00000000E+00 0.00000000E+00-7.65874611E-10 0.00000000E+00 5.72790698E-14 + 2.38422733E-04-6.43839774E-10-2.60052053E-08 5.22547100E-14-1.19931801E-03 + 0.00000000E+00-6.65792532E-04 1.06240324E-18-1.19931801E-03 0.00000000E+00 +-6.65792532E-04 1.06240324E-18 0.00000000E+00 1.72863270E-08 0.00000000E+00 + 1.15294289E-13-5.44303140E-03 1.45637109E-08-5.08236504E-08 1.06250655E-13 + 2.44983550E-03 0.00000000E+00 9.79968469E-03 0.00000000E+00 1.38273908E-03 +-8.41835607E-19 5.53225806E-03-6.10119392E-18 2.44983550E-03 0.00000000E+00 + 9.79968469E-03 0.00000000E+00 1.38273908E-03-8.41835607E-19 5.53225806E-03 +-6.10119392E-18 0.00000000E+00-8.05864746E-10 0.00000000E+00 5.81164074E-14 + 2.56041225E-04-6.80686546E-10-2.48324306E-08 5.40689114E-14 2.44982624E-03 + 0.00000000E+00-1.25076565E-03 0.00000000E+00 1.38273676E-03-5.45447543E-19 +-7.17859768E-04 1.93556653E-18 2.44982624E-03 0.00000000E+00-1.25076565E-03 + 0.00000000E+00 1.38273676E-03-5.45447543E-19-7.17859768E-04 1.93556653E-18 +-3.12224754E-06-1.17698368E-20-1.88219264E-08-7.39356604E-23-7.08644776E-05 + 0.00000000E+00-4.24185784E-07 0.00000000E+00-2.60052053E-08-5.22547100E-14 + 0.00000000E+00-5.72790698E-14-2.60052053E-08-5.22547100E-14 0.00000000E+00 +-5.72790698E-14 5.28230132E-07 1.04488351E-20 5.40923128E-08 2.83842594E-22 +-2.22163385E-06 0.00000000E+00 1.11450188E-06 0.00000000E+00 2.53919163E-05 + 6.81324562E-11-5.08236504E-08-1.06250655E-13 0.00000000E+00 8.09306600E-11 + 0.00000000E+00-1.15294289E-13 2.53919163E-05 6.81324562E-11-5.08236504E-08 +-1.06250655E-13 0.00000000E+00 8.09306600E-11 0.00000000E+00-1.15294289E-13 + 3.65048962E-06 2.09085556E-20-2.17614400E-08-1.26218455E-22 6.86423661E-05 + 0.00000000E+00-4.11819567E-07 0.00000000E+00-2.60019680E-05-6.94081162E-11 +-2.48324306E-08-5.40689114E-14 0.00000000E+00-8.23150473E-11 0.00000000E+00 +-5.81164074E-14-2.60019680E-05-6.94081162E-11-2.48324306E-08-5.40689114E-14 + 0.00000000E+00-8.23150473E-11 0.00000000E+00-5.81164074E-14 5.02368150E-04 + 1.97397660E-18 3.15920268E-06 1.29098602E-20 1.13216876E-02 0.00000000E+00 + 7.06985711E-05 0.00000000E+00 2.49437815E-04 6.65973523E-10 0.00000000E+00 + 7.90136622E-10 2.49437815E-04 6.65973523E-10 0.00000000E+00 7.90136622E-10 + 3.12733081E-03 1.71465606E-17 5.28230132E-07 1.04488351E-20 6.44435088E-02 + 0.00000000E+00-2.22163385E-06 0.00000000E+00-4.89680507E-03-1.31340656E-08 +-5.44303140E-03-1.45637109E-08 0.00000000E+00-1.55996802E-08 0.00000000E+00 +-1.72863270E-08-4.89680507E-03-1.31340656E-08-5.44303140E-03-1.45637109E-08 + 0.00000000E+00-1.55996802E-08 0.00000000E+00-1.72863270E-08 5.80827978E-04 + 3.36050674E-18-3.61197924E-06-2.11421703E-20 1.09916887E-02 0.00000000E+00 +-6.87940846E-05 0.00000000E+00-4.99861328E-03-1.33469582E-08 2.45522789E-04 + 6.57784243E-10 0.00000000E+00-1.58307203E-08 0.00000000E+00 7.81247960E-10 +-4.99861328E-03-1.33469582E-08 2.45522789E-04 6.57784243E-10 0.00000000E+00 +-1.58307203E-08 0.00000000E+00 7.81247960E-10-7.08644776E-05 0.00000000E+00 +-4.24185784E-07 0.00000000E+00-3.12224754E-06 1.17698368E-20-1.88219264E-08 + 7.39356604E-23 0.00000000E+00-5.72790698E-14 2.60052053E-08-5.22547100E-14 + 0.00000000E+00-5.72790698E-14 2.60052053E-08-5.22547100E-14-2.22163385E-06 + 0.00000000E+00 1.11450188E-06 0.00000000E+00 5.28230132E-07-1.04488351E-20 + 5.40923128E-08-2.83842594E-22 0.00000000E+00 8.09306600E-11 0.00000000E+00 +-1.15294289E-13-2.53919163E-05 6.81324562E-11 5.08236504E-08-1.06250655E-13 + 0.00000000E+00 8.09306600E-11 0.00000000E+00-1.15294289E-13-2.53919163E-05 + 6.81324562E-11 5.08236504E-08-1.06250655E-13 6.86423661E-05 0.00000000E+00 +-4.11819567E-07 0.00000000E+00 3.65048962E-06-2.09085556E-20-2.17614400E-08 + 1.26218455E-22 0.00000000E+00-8.23150473E-11 0.00000000E+00-5.81164074E-14 + 2.60019680E-05-6.94081162E-11 2.48324306E-08-5.40689114E-14 0.00000000E+00 +-8.23150473E-11 0.00000000E+00-5.81164074E-14 2.60019680E-05-6.94081162E-11 + 2.48324306E-08-5.40689114E-14 0.00000000E+00 1.55202773E-08 0.00000000E+00 + 8.07015437E-11-4.86075581E-03 1.30616280E-08-2.52878955E-05 6.79234373E-11 + 2.34743654E-03 0.00000000E+00 1.28043105E-03-3.40777737E-18 2.34743654E-03 + 0.00000000E+00 1.28043105E-03-3.40777737E-18 0.00000000E+00 1.55996802E-08 + 0.00000000E+00-8.09306600E-11-4.89680507E-03 1.31340656E-08 2.53919163E-05 +-6.81324562E-11 1.91888049E-02 0.00000000E+00 2.44983550E-03 0.00000000E+00 + 1.06516294E-02-1.57270646E-17 1.38273908E-03-8.41835607E-19 1.91888049E-02 + 0.00000000E+00 2.44983550E-03 0.00000000E+00 1.06516294E-02-1.57270646E-17 + 1.38273908E-03-8.41835607E-19 4.86075581E-03 1.30616280E-08 2.52878955E-05 + 6.79234373E-11 0.00000000E+00 1.55202773E-08 0.00000000E+00 8.07015437E-11 + 1.28043105E-03 3.40777737E-18 2.34743654E-03 0.00000000E+00 1.28043105E-03 + 3.40777737E-18 2.34743654E-03 0.00000000E+00 4.89680507E-03 1.31340656E-08 +-2.53919163E-05-6.81324562E-11 0.00000000E+00 1.55996802E-08 0.00000000E+00 +-8.09306600E-11 1.06516294E-02 1.57270646E-17 1.38273908E-03 8.41835607E-19 + 1.91888049E-02 0.00000000E+00 2.44983550E-03 0.00000000E+00 1.06516294E-02 + 1.57270646E-17 1.38273908E-03 8.41835607E-19 1.91888049E-02 0.00000000E+00 + 2.44983550E-03 0.00000000E+00 0.00000000E+00 1.55202773E-08 0.00000000E+00 + 8.07015437E-11-4.86075581E-03 1.30616280E-08-2.52878955E-05 6.79234373E-11 + 2.34743654E-03 0.00000000E+00 1.28043105E-03-3.40777737E-18 8.68149937E-02 + 0.00000000E+00 3.15265277E-02-1.04649952E-16 0.00000000E+00 1.55996802E-08 + 0.00000000E+00-8.09306600E-11-4.89680507E-03 1.31340656E-08 2.53919163E-05 +-6.81324562E-11 1.91888049E-02 0.00000000E+00 2.44983550E-03 0.00000000E+00 + 1.06516294E-02-1.57270646E-17 1.38273908E-03-8.41835607E-19 6.81633378E-01 + 0.00000000E+00 8.36117581E-02 0.00000000E+00 2.52553530E-01-8.76603235E-16 + 3.16120592E-02-9.47988447E-17 4.71680355E-03 1.27863801E-08 2.45420636E-05 + 6.64909702E-11 0.00000000E+00 1.52145515E-08 0.00000000E+00 7.91124323E-11 + 1.18182214E-03 4.73657903E-18 2.24601660E-03 0.00000000E+00 3.14439758E-02 + 4.53434017E-17 9.02905814E-02 0.00000000E+00 4.75438874E-03 1.28561775E-08 +-2.46505160E-05-6.66923715E-11 0.00000000E+00 1.52927095E-08 0.00000000E+00 +-7.93379576E-11 9.84795882E-03 3.68310046E-17 1.28043311E-03 3.97799735E-18 + 1.83735766E-02 0.00000000E+00 2.34744546E-03 0.00000000E+00 2.51881546E-01 + 3.43811958E-16 3.15266187E-02 6.48723134E-17 7.08334121E-01 0.00000000E+00 + 8.68136933E-02 0.00000000E+00 1.16830136E-02 0.00000000E+00 7.29497447E-05 + 0.00000000E+00 4.27146865E-04-5.19429226E-19 2.68815852E-06-3.25940067E-21 + 0.00000000E+00 7.74629514E-10-2.42513651E-04 6.51742487E-10 0.00000000E+00 + 7.74629514E-10-2.42513651E-04 6.51742487E-10 6.64384788E-02 0.00000000E+00 +-2.43248794E-06 0.00000000E+00 2.68335900E-03-5.84207165E-18 5.06425783E-07 +-1.03302718E-20 0.00000000E+00-1.52927095E-08 0.00000000E+00-1.69467210E-08 + 4.75438874E-03-1.28561775E-08 5.28884979E-03-1.42538984E-08 0.00000000E+00 +-1.52927095E-08 0.00000000E+00-1.69467210E-08 4.75438874E-03-1.28561775E-08 + 5.28884979E-03-1.42538984E-08 1.13216876E-02 0.00000000E+00-7.08644776E-05 + 0.00000000E+00 5.02368150E-04-1.97397660E-18-3.12224754E-06 1.17698368E-20 + 0.00000000E+00-1.55202773E-08 0.00000000E+00 7.65874611E-10 4.86075581E-03 +-1.30616280E-08-2.38422733E-04 6.43839774E-10 0.00000000E+00-1.55202773E-08 + 0.00000000E+00 7.65874611E-10 4.86075581E-03-1.30616280E-08-2.38422733E-04 + 6.43839774E-10-2.31029267E-04-6.30415478E-10 2.71131037E-08 5.03503294E-14 + 0.00000000E+00-7.50747861E-10 0.00000000E+00 5.63813042E-14-6.15563814E-04 +-2.17864410E-18-1.14836552E-03 0.00000000E+00-1.57426486E-02-2.75539288E-17 +-4.42760687E-02 0.00000000E+00 5.28884979E-03 1.42538984E-08 5.30981111E-08 + 1.02537318E-13 0.00000000E+00 1.69467210E-08 0.00000000E+00 1.13563152E-13 + 1.28043311E-03 3.97799735E-18 5.12304886E-03 1.41016270E-17 2.34744546E-03 + 0.00000000E+00 9.39011057E-03 0.00000000E+00 3.15266187E-02 6.48723134E-17 + 1.26107324E-01 3.28536009E-16 8.68136933E-02 0.00000000E+00 3.47355104E-01 + 0.00000000E+00-2.49437815E-04-6.65973523E-10 2.60052053E-08 5.22547100E-14 + 0.00000000E+00-7.90136622E-10 0.00000000E+00 5.72790698E-14 1.28043105E-03 + 3.40777737E-18-6.65792532E-04-1.06240324E-18 2.34743654E-03 0.00000000E+00 +-1.19931801E-03 0.00000000E+00 3.15265277E-02 1.04649952E-16-1.57846467E-02 +-4.98621993E-17 8.68149937E-02 0.00000000E+00-4.26066879E-02 0.00000000E+00 + 0.00000000E+00-7.50747861E-10 0.00000000E+00 5.63813042E-14 2.31029267E-04 +-6.30415478E-10-2.71131037E-08 5.03503294E-14-1.14836552E-03 0.00000000E+00 +-6.15563814E-04 2.17864410E-18-4.42760687E-02 0.00000000E+00-1.57426486E-02 + 2.75539288E-17 0.00000000E+00 1.69467210E-08 0.00000000E+00 1.13563152E-13 +-5.28884979E-03 1.42538984E-08-5.30981111E-08 1.02537318E-13 2.34744546E-03 + 0.00000000E+00 9.39011057E-03 0.00000000E+00 1.28043311E-03-3.97799735E-18 + 5.12304886E-03-1.41016270E-17 8.68136933E-02 0.00000000E+00 3.47355104E-01 + 0.00000000E+00 3.15266187E-02-6.48723134E-17 1.26107324E-01-3.28536009E-16 + 0.00000000E+00-7.90136622E-10 0.00000000E+00 5.72790698E-14 2.49437815E-04 +-6.65973523E-10-2.60052053E-08 5.22547100E-14 2.34743654E-03 0.00000000E+00 +-1.19931801E-03 0.00000000E+00 1.28043105E-03-3.40777737E-18-6.65792532E-04 + 1.06240324E-18 8.68149937E-02 0.00000000E+00-4.26066879E-02 0.00000000E+00 + 3.15265277E-02-1.04649952E-16-1.57846467E-02 4.98621993E-17-2.31029267E-04 +-6.30415478E-10 2.71131037E-08 5.03503294E-14 0.00000000E+00-7.50747861E-10 + 0.00000000E+00 5.63813042E-14-6.15563814E-04-2.17864410E-18-1.14836552E-03 + 0.00000000E+00-6.15563814E-04-2.17864410E-18-1.14836552E-03 0.00000000E+00 + 5.28884979E-03 1.42538984E-08 5.30981111E-08 1.02537318E-13 0.00000000E+00 + 1.69467210E-08 0.00000000E+00 1.13563152E-13 1.28043311E-03 3.97799735E-18 + 5.12304886E-03 1.41016270E-17 2.34744546E-03 0.00000000E+00 9.39011057E-03 + 0.00000000E+00 1.28043311E-03 3.97799735E-18 5.12304886E-03 1.41016270E-17 + 2.34744546E-03 0.00000000E+00 9.39011057E-03 0.00000000E+00-2.49437815E-04 +-6.65973523E-10 2.60052053E-08 5.22547100E-14 0.00000000E+00-7.90136622E-10 + 0.00000000E+00 5.72790698E-14 1.28043105E-03 3.40777737E-18-6.65792532E-04 +-1.06240324E-18 2.34743654E-03 0.00000000E+00-1.19931801E-03 0.00000000E+00 + 1.28043105E-03 3.40777737E-18-6.65792532E-04-1.06240324E-18 2.34743654E-03 + 0.00000000E+00-1.19931801E-03 0.00000000E+00 0.00000000E+00-7.50747861E-10 + 0.00000000E+00 5.63813042E-14 2.31029267E-04-6.30415478E-10-2.71131037E-08 + 5.03503294E-14-1.14836552E-03 0.00000000E+00-6.15563814E-04 2.17864410E-18 +-1.14836552E-03 0.00000000E+00-6.15563814E-04 2.17864410E-18 0.00000000E+00 + 1.69467210E-08 0.00000000E+00 1.13563152E-13-5.28884979E-03 1.42538984E-08 +-5.30981111E-08 1.02537318E-13 2.34744546E-03 0.00000000E+00 9.39011057E-03 + 0.00000000E+00 1.28043311E-03-3.97799735E-18 5.12304886E-03-1.41016270E-17 + 2.34744546E-03 0.00000000E+00 9.39011057E-03 0.00000000E+00 1.28043311E-03 +-3.97799735E-18 5.12304886E-03-1.41016270E-17 0.00000000E+00-7.90136622E-10 + 0.00000000E+00 5.72790698E-14 2.49437815E-04-6.65973523E-10-2.60052053E-08 + 5.22547100E-14 2.34743654E-03 0.00000000E+00-1.19931801E-03 0.00000000E+00 + 1.28043105E-03-3.40777737E-18-6.65792532E-04 1.06240324E-18 2.34743654E-03 + 0.00000000E+00-1.19931801E-03 0.00000000E+00 1.28043105E-03-3.40777737E-18 +-6.65792532E-04 1.06240324E-18-2.65276132E-06-3.21283219E-21-1.60037175E-08 +-1.92415306E-23-7.31316285E-05 0.00000000E+00-4.37725845E-07 0.00000000E+00 +-2.71131037E-08-5.03503294E-14 0.00000000E+00-5.63813042E-14-2.71131037E-08 +-5.03503294E-14 0.00000000E+00-5.63813042E-14 5.06425783E-07 1.03302718E-20 + 4.64153110E-08 1.10767088E-22-2.43248794E-06 0.00000000E+00 1.14902189E-06 + 0.00000000E+00 2.46505160E-05 6.66923715E-11-5.30981111E-08-1.02537318E-13 + 0.00000000E+00 7.93379576E-11 0.00000000E+00-1.13563152E-13 2.46505160E-05 + 6.66923715E-11-5.30981111E-08-1.02537318E-13 0.00000000E+00 7.93379576E-11 + 0.00000000E+00-1.13563152E-13 3.15920268E-06 1.29098602E-20-1.88219264E-08 +-7.39356604E-23 7.06985711E-05 0.00000000E+00-4.24185784E-07 0.00000000E+00 +-2.52878955E-05-6.79234373E-11-2.60052053E-08-5.22547100E-14 0.00000000E+00 +-8.07015437E-11 0.00000000E+00-5.72790698E-14-2.52878955E-05-6.79234373E-11 +-2.60052053E-08-5.22547100E-14 0.00000000E+00-8.07015437E-11 0.00000000E+00 +-5.72790698E-14 4.27146865E-04 5.19429226E-19 2.68815852E-06 3.25940067E-21 + 1.16830136E-02 0.00000000E+00 7.29497447E-05 0.00000000E+00 2.42513651E-04 + 6.51742487E-10 0.00000000E+00 7.74629514E-10 2.42513651E-04 6.51742487E-10 + 0.00000000E+00 7.74629514E-10 2.68335900E-03 5.84207165E-18 5.06425783E-07 + 1.03302718E-20 6.64384788E-02 0.00000000E+00-2.43248794E-06 0.00000000E+00 +-4.75438874E-03-1.28561775E-08-5.28884979E-03-1.42538984E-08 0.00000000E+00 +-1.52927095E-08 0.00000000E+00-1.69467210E-08-4.75438874E-03-1.28561775E-08 +-5.28884979E-03-1.42538984E-08 0.00000000E+00-1.52927095E-08 0.00000000E+00 +-1.69467210E-08 5.02368150E-04 1.97397660E-18-3.12224754E-06-1.17698368E-20 + 1.13216876E-02 0.00000000E+00-7.08644776E-05 0.00000000E+00-4.86075581E-03 +-1.30616280E-08 2.38422733E-04 6.43839774E-10 0.00000000E+00-1.55202773E-08 + 0.00000000E+00 7.65874611E-10-4.86075581E-03-1.30616280E-08 2.38422733E-04 + 6.43839774E-10 0.00000000E+00-1.55202773E-08 0.00000000E+00 7.65874611E-10 +-7.31316285E-05 0.00000000E+00-4.37725845E-07 0.00000000E+00-2.65276132E-06 + 3.21283219E-21-1.60037175E-08 1.92415306E-23 0.00000000E+00-5.63813042E-14 + 2.71131037E-08-5.03503294E-14 0.00000000E+00-5.63813042E-14 2.71131037E-08 +-5.03503294E-14-2.43248794E-06 0.00000000E+00 1.14902189E-06 0.00000000E+00 + 5.06425783E-07-1.03302718E-20 4.64153110E-08-1.10767088E-22 0.00000000E+00 + 7.93379576E-11 0.00000000E+00-1.13563152E-13-2.46505160E-05 6.66923715E-11 + 5.30981111E-08-1.02537318E-13 0.00000000E+00 7.93379576E-11 0.00000000E+00 +-1.13563152E-13-2.46505160E-05 6.66923715E-11 5.30981111E-08-1.02537318E-13 + 7.06985711E-05 0.00000000E+00-4.24185784E-07 0.00000000E+00 3.15920268E-06 +-1.29098602E-20-1.88219264E-08 7.39356604E-23 0.00000000E+00-8.07015437E-11 + 0.00000000E+00-5.72790698E-14 2.52878955E-05-6.79234373E-11 2.60052053E-08 +-5.22547100E-14 0.00000000E+00-8.07015437E-11 0.00000000E+00-5.72790698E-14 + 2.52878955E-05-6.79234373E-11 2.60052053E-08-5.22547100E-14 0.00000000E+00 + 1.52145515E-08 0.00000000E+00 7.91124323E-11-4.71680355E-03 1.27863801E-08 +-2.45420636E-05 6.64909702E-11 2.24601660E-03 0.00000000E+00 1.18182214E-03 +-4.73657903E-18 2.24601660E-03 0.00000000E+00 1.18182214E-03-4.73657903E-18 + 0.00000000E+00 1.52927095E-08 0.00000000E+00-7.93379576E-11-4.75438874E-03 + 1.28561775E-08 2.46505160E-05-6.66923715E-11 1.83735766E-02 0.00000000E+00 + 2.34744546E-03 0.00000000E+00 9.84795882E-03-3.68310046E-17 1.28043311E-03 +-3.97799735E-18 1.83735766E-02 0.00000000E+00 2.34744546E-03 0.00000000E+00 + 9.84795882E-03-3.68310046E-17 1.28043311E-03-3.97799735E-18 4.71680355E-03 + 1.27863801E-08 2.45420636E-05 6.64909702E-11 0.00000000E+00 1.52145515E-08 + 0.00000000E+00 7.91124323E-11 1.18182214E-03 4.73657903E-18 2.24601660E-03 + 0.00000000E+00 1.18182214E-03 4.73657903E-18 2.24601660E-03 0.00000000E+00 + 4.75438874E-03 1.28561775E-08-2.46505160E-05-6.66923715E-11 0.00000000E+00 + 1.52927095E-08 0.00000000E+00-7.93379576E-11 9.84795882E-03 3.68310046E-17 + 1.28043311E-03 3.97799735E-18 1.83735766E-02 0.00000000E+00 2.34744546E-03 + 0.00000000E+00 9.84795882E-03 3.68310046E-17 1.28043311E-03 3.97799735E-18 + 1.83735766E-02 0.00000000E+00 2.34744546E-03 0.00000000E+00 0.00000000E+00 + 1.52145515E-08 0.00000000E+00 7.91124323E-11-4.71680355E-03 1.27863801E-08 +-2.45420636E-05 6.64909702E-11 2.24601660E-03 0.00000000E+00 1.18182214E-03 +-4.73657903E-18 9.02905814E-02 0.00000000E+00 3.14439758E-02-4.53434017E-17 + 0.00000000E+00 1.52927095E-08 0.00000000E+00-7.93379576E-11-4.75438874E-03 + 1.28561775E-08 2.46505160E-05-6.66923715E-11 1.83735766E-02 0.00000000E+00 + 2.34744546E-03 0.00000000E+00 9.84795882E-03-3.68310046E-17 1.28043311E-03 +-3.97799735E-18 7.08334121E-01 0.00000000E+00 8.68136933E-02 0.00000000E+00 + 2.51881546E-01-3.43811958E-16 3.15266187E-02-6.48723134E-17 4.56702803E-03 + 1.25217424E-08 2.37659165E-05 6.51134331E-11 0.00000000E+00 1.49138935E-08 + 0.00000000E+00 7.75495211E-11 1.08694880E-03 1.90613701E-18 2.14552658E-03 + 0.00000000E+00 3.13643641E-02 9.02920365E-17 9.40750979E-02 0.00000000E+00 + 4.60609016E-03 1.25887561E-08-2.38786309E-05-6.53068033E-11 0.00000000E+00 + 1.49907114E-08 0.00000000E+00-7.77711804E-11 9.07401719E-03 2.34019835E-17 + 1.18182383E-03 4.14256900E-18 1.75659463E-02 0.00000000E+00 2.24602511E-03 + 0.00000000E+00 2.51232869E-01 8.54002422E-16 3.14440656E-02 9.47329908E-17 + 7.37362444E-01 0.00000000E+00 9.02890128E-02 0.00000000E+00 1.20796356E-02 + 0.00000000E+00 7.54205759E-05 0.00000000E+00 3.55149452E-04-8.91938128E-19 + 2.23727643E-06-5.74488050E-21 0.00000000E+00 7.59358956E-10-2.35287727E-04 + 6.38016603E-10 0.00000000E+00 7.59358956E-10-2.35287727E-04 6.38016603E-10 + 6.86256096E-02 0.00000000E+00-2.67003179E-06 0.00000000E+00 2.25808368E-03 +-4.37920279E-18 4.84715292E-07 4.37096832E-21 0.00000000E+00-1.49907114E-08 + 0.00000000E+00-1.66124406E-08 4.60609016E-03-1.25887561E-08 5.12809205E-03 +-1.39553818E-08 0.00000000E+00-1.49907114E-08 0.00000000E+00-1.66124406E-08 + 4.60609016E-03-1.25887561E-08 5.12809205E-03-1.39553818E-08 1.16830136E-02 + 0.00000000E+00-7.31316285E-05 0.00000000E+00 4.27146865E-04-5.19429226E-19 +-2.65276132E-06 3.21283219E-21 0.00000000E+00-1.52145515E-08 0.00000000E+00 + 7.50747861E-10 4.71680355E-03-1.27863801E-08-2.31029267E-04 6.30415478E-10 + 0.00000000E+00-1.52145515E-08 0.00000000E+00 7.50747861E-10 4.71680355E-03 +-1.27863801E-08-2.31029267E-04 6.30415478E-10-2.23352058E-04-6.17540149E-10 + 2.81786064E-08 4.83425387E-14 0.00000000E+00-7.35886779E-10 0.00000000E+00 + 5.54148281E-14-5.67193156E-04-1.51217650E-18-1.09788792E-03 0.00000000E+00 +-1.57021074E-02-4.62562568E-17-4.60910277E-02 0.00000000E+00 5.12809205E-03 + 1.39553818E-08 5.52676095E-08 9.86333132E-14 0.00000000E+00 1.66124406E-08 + 0.00000000E+00 1.11705524E-13 1.18182383E-03 4.14256900E-18 4.72862639E-03 + 1.66713089E-17 2.24602511E-03 0.00000000E+00 8.98441580E-03 0.00000000E+00 + 3.14440656E-02 9.47329908E-17 1.25777133E-01 2.85690070E-16 9.02890128E-02 + 0.00000000E+00 3.61269613E-01 0.00000000E+00-2.42513651E-04-6.51742487E-10 + 2.71131037E-08 5.03503294E-14 0.00000000E+00-7.74629514E-10 0.00000000E+00 + 5.63813042E-14 1.18182214E-03 4.73657903E-18-6.15563814E-04-2.17864410E-18 + 2.24601660E-03 0.00000000E+00-1.14836552E-03 0.00000000E+00 3.14439758E-02 + 4.53434017E-17-1.57426486E-02-2.75539288E-17 9.02905814E-02 0.00000000E+00 +-4.42760687E-02 0.00000000E+00 0.00000000E+00-7.35886779E-10 0.00000000E+00 + 5.54148281E-14 2.23352058E-04-6.17540149E-10-2.81786064E-08 4.83425387E-14 +-1.09788792E-03 0.00000000E+00-5.67193156E-04 1.51217650E-18-4.60910277E-02 + 0.00000000E+00-1.57021074E-02 4.62562568E-17 0.00000000E+00 1.66124406E-08 + 0.00000000E+00 1.11705524E-13-5.12809205E-03 1.39553818E-08-5.52676095E-08 + 9.86333132E-14 2.24602511E-03 0.00000000E+00 8.98441580E-03 0.00000000E+00 + 1.18182383E-03-4.14256900E-18 4.72862639E-03-1.66713089E-17 9.02890128E-02 + 0.00000000E+00 3.61269613E-01 0.00000000E+00 3.14440656E-02-9.47329908E-17 + 1.25777133E-01-2.85690070E-16 0.00000000E+00-7.74629514E-10 0.00000000E+00 + 5.63813042E-14 2.42513651E-04-6.51742487E-10-2.71131037E-08 5.03503294E-14 + 2.24601660E-03 0.00000000E+00-1.14836552E-03 0.00000000E+00 1.18182214E-03 +-4.73657903E-18-6.15563814E-04 2.17864410E-18 9.02905814E-02 0.00000000E+00 +-4.42760687E-02 0.00000000E+00 3.14439758E-02-4.53434017E-17-1.57426486E-02 + 2.75539288E-17-2.23352058E-04-6.17540149E-10 2.81786064E-08 4.83425387E-14 + 0.00000000E+00-7.35886779E-10 0.00000000E+00 5.54148281E-14-5.67193156E-04 +-1.51217650E-18-1.09788792E-03 0.00000000E+00-5.67193156E-04-1.51217650E-18 +-1.09788792E-03 0.00000000E+00 5.12809205E-03 1.39553818E-08 5.52676095E-08 + 9.86333132E-14 0.00000000E+00 1.66124406E-08 0.00000000E+00 1.11705524E-13 + 1.18182383E-03 4.14256900E-18 4.72862639E-03 1.66713089E-17 2.24602511E-03 + 0.00000000E+00 8.98441580E-03 0.00000000E+00 1.18182383E-03 4.14256900E-18 + 4.72862639E-03 1.66713089E-17 2.24602511E-03 0.00000000E+00 8.98441580E-03 + 0.00000000E+00-2.42513651E-04-6.51742487E-10 2.71131037E-08 5.03503294E-14 + 0.00000000E+00-7.74629514E-10 0.00000000E+00 5.63813042E-14 1.18182214E-03 + 4.73657903E-18-6.15563814E-04-2.17864410E-18 2.24601660E-03 0.00000000E+00 +-1.14836552E-03 0.00000000E+00 1.18182214E-03 4.73657903E-18-6.15563814E-04 +-2.17864410E-18 2.24601660E-03 0.00000000E+00-1.14836552E-03 0.00000000E+00 + 0.00000000E+00-7.35886779E-10 0.00000000E+00 5.54148281E-14 2.23352058E-04 +-6.17540149E-10-2.81786064E-08 4.83425387E-14-1.09788792E-03 0.00000000E+00 +-5.67193156E-04 1.51217650E-18-1.09788792E-03 0.00000000E+00-5.67193156E-04 + 1.51217650E-18 0.00000000E+00 1.66124406E-08 0.00000000E+00 1.11705524E-13 +-5.12809205E-03 1.39553818E-08-5.52676095E-08 9.86333132E-14 2.24602511E-03 + 0.00000000E+00 8.98441580E-03 0.00000000E+00 1.18182383E-03-4.14256900E-18 + 4.72862639E-03-1.66713089E-17 2.24602511E-03 0.00000000E+00 8.98441580E-03 + 0.00000000E+00 1.18182383E-03-4.14256900E-18 4.72862639E-03-1.66713089E-17 + 0.00000000E+00-7.74629514E-10 0.00000000E+00 5.63813042E-14 2.42513651E-04 +-6.51742487E-10-2.71131037E-08 5.03503294E-14 2.24601660E-03 0.00000000E+00 +-1.14836552E-03 0.00000000E+00 1.18182214E-03-4.73657903E-18-6.15563814E-04 + 2.17864410E-18 2.24601660E-03 0.00000000E+00-1.14836552E-03 0.00000000E+00 + 1.18182214E-03-4.73657903E-18-6.15563814E-04 2.17864410E-18-2.20341842E-06 +-5.43899306E-21-1.33062681E-08-3.37229159E-23-7.56204789E-05 0.00000000E+00 +-4.52588468E-07 0.00000000E+00-2.81786064E-08-4.83425387E-14 0.00000000E+00 +-5.54148281E-14-2.81786064E-08-4.83425387E-14 0.00000000E+00-5.54148281E-14 + 4.84715292E-07-4.37096832E-21 3.90613288E-08 7.37330988E-23-2.67003179E-06 + 0.00000000E+00 1.18686740E-06 0.00000000E+00 2.38786309E-05 6.53068033E-11 +-5.52676095E-08-9.86333132E-14 0.00000000E+00 7.77711804E-11 0.00000000E+00 +-1.11705524E-13 2.38786309E-05 6.53068033E-11-5.52676095E-08-9.86333132E-14 + 0.00000000E+00 7.77711804E-11 0.00000000E+00-1.11705524E-13 2.68815852E-06 + 3.25940067E-21-1.60037175E-08-1.92415306E-23 7.29497447E-05 0.00000000E+00 +-4.37725845E-07 0.00000000E+00-2.45420636E-05-6.64909702E-11-2.71131037E-08 +-5.03503294E-14 0.00000000E+00-7.91124323E-11 0.00000000E+00-5.63813042E-14 +-2.45420636E-05-6.64909702E-11-2.71131037E-08-5.03503294E-14 0.00000000E+00 +-7.91124323E-11 0.00000000E+00-5.63813042E-14 3.55149452E-04 8.91938128E-19 + 2.23727643E-06 5.74488050E-21 1.20796356E-02 0.00000000E+00 7.54205759E-05 + 0.00000000E+00 2.35287727E-04 6.38016603E-10 0.00000000E+00 7.59358956E-10 + 2.35287727E-04 6.38016603E-10 0.00000000E+00 7.59358956E-10 2.25808368E-03 + 4.37920279E-18 4.84715292E-07-4.37096832E-21 6.86256096E-02 0.00000000E+00 +-2.67003179E-06 0.00000000E+00-4.60609016E-03-1.25887561E-08-5.12809205E-03 +-1.39553818E-08 0.00000000E+00-1.49907114E-08 0.00000000E+00-1.66124406E-08 +-4.60609016E-03-1.25887561E-08-5.12809205E-03-1.39553818E-08 0.00000000E+00 +-1.49907114E-08 0.00000000E+00-1.66124406E-08 4.27146865E-04 5.19429226E-19 +-2.65276132E-06-3.21283219E-21 1.16830136E-02 0.00000000E+00-7.31316285E-05 + 0.00000000E+00-4.71680355E-03-1.27863801E-08 2.31029267E-04 6.30415478E-10 + 0.00000000E+00-1.52145515E-08 0.00000000E+00 7.50747861E-10-4.71680355E-03 +-1.27863801E-08 2.31029267E-04 6.30415478E-10 0.00000000E+00-1.52145515E-08 + 0.00000000E+00 7.50747861E-10-7.56204789E-05 0.00000000E+00-4.52588468E-07 + 0.00000000E+00-2.20341842E-06 5.43899306E-21-1.33062681E-08 3.37229159E-23 + 0.00000000E+00-5.54148281E-14 2.81786064E-08-4.83425387E-14 0.00000000E+00 +-5.54148281E-14 2.81786064E-08-4.83425387E-14-2.67003179E-06 0.00000000E+00 + 1.18686740E-06 0.00000000E+00 4.84715292E-07 4.37096832E-21 3.90613288E-08 +-7.37330988E-23 0.00000000E+00 7.77711804E-11 0.00000000E+00-1.11705524E-13 +-2.38786309E-05 6.53068033E-11 5.52676095E-08-9.86333132E-14 0.00000000E+00 + 7.77711804E-11 0.00000000E+00-1.11705524E-13-2.38786309E-05 6.53068033E-11 + 5.52676095E-08-9.86333132E-14 7.29497447E-05 0.00000000E+00-4.37725845E-07 + 0.00000000E+00 2.68815852E-06-3.25940067E-21-1.60037175E-08 1.92415306E-23 + 0.00000000E+00-7.91124323E-11 0.00000000E+00-5.63813042E-14 2.45420636E-05 +-6.64909702E-11 2.71131037E-08-5.03503294E-14 0.00000000E+00-7.91124323E-11 + 0.00000000E+00-5.63813042E-14 2.45420636E-05-6.64909702E-11 2.71131037E-08 +-5.03503294E-14 0.00000000E+00 1.49138935E-08 0.00000000E+00 7.75495211E-11 +-4.56702803E-03 1.25217424E-08-2.37659165E-05 6.51134331E-11 2.14552658E-03 + 0.00000000E+00 1.08694880E-03-1.90613701E-18 2.14552658E-03 0.00000000E+00 + 1.08694880E-03-1.90613701E-18 0.00000000E+00 1.49907114E-08 0.00000000E+00 +-7.77711804E-11-4.60609016E-03 1.25887561E-08 2.38786309E-05-6.53068033E-11 + 1.75659463E-02 0.00000000E+00 2.24602511E-03 0.00000000E+00 9.07401719E-03 +-2.34019835E-17 1.18182383E-03-4.14256900E-18 1.75659463E-02 0.00000000E+00 + 2.24602511E-03 0.00000000E+00 9.07401719E-03-2.34019835E-17 1.18182383E-03 +-4.14256900E-18 4.56702803E-03 1.25217424E-08 2.37659165E-05 6.51134331E-11 + 0.00000000E+00 1.49138935E-08 0.00000000E+00 7.75495211E-11 1.08694880E-03 + 1.90613701E-18 2.14552658E-03 0.00000000E+00 1.08694880E-03 1.90613701E-18 + 2.14552658E-03 0.00000000E+00 4.60609016E-03 1.25887561E-08-2.38786309E-05 +-6.53068033E-11 0.00000000E+00 1.49907114E-08 0.00000000E+00-7.77711804E-11 + 9.07401719E-03 2.34019835E-17 1.18182383E-03 4.14256900E-18 1.75659463E-02 + 0.00000000E+00 2.24602511E-03 0.00000000E+00 9.07401719E-03 2.34019835E-17 + 1.18182383E-03 4.14256900E-18 1.75659463E-02 0.00000000E+00 2.24602511E-03 + 0.00000000E+00 0.00000000E+00 1.49138935E-08 0.00000000E+00 7.75495211E-11 +-4.56702803E-03 1.25217424E-08-2.37659165E-05 6.51134331E-11 2.14552658E-03 + 0.00000000E+00 1.08694880E-03-1.90613701E-18 9.40750979E-02 0.00000000E+00 + 3.13643641E-02-9.02920365E-17 0.00000000E+00 1.49907114E-08 0.00000000E+00 +-7.77711804E-11-4.60609016E-03 1.25887561E-08 2.38786309E-05-6.53068033E-11 + 1.75659463E-02 0.00000000E+00 2.24602511E-03 0.00000000E+00 9.07401719E-03 +-2.34019835E-17 1.18182383E-03-4.14256900E-18 7.37362444E-01 0.00000000E+00 + 9.02890128E-02 0.00000000E+00 2.51232869E-01-8.54002422E-16 3.14440656E-02 +-9.47329908E-17 1.25161774E-02 0.00000000E+00 7.81397790E-05 0.00000000E+00 + 2.86330873E-04 7.03309438E-19 1.80627310E-06 4.22269426E-21 0.00000000E+00 + 7.44342461E-10-2.27770981E-04 6.24822253E-10 0.00000000E+00 7.44342461E-10 +-2.27770981E-04 6.24822253E-10 7.10295563E-02 0.00000000E+00-2.93864895E-06 + 0.00000000E+00 1.85130119E-03-6.44848100E-19 4.63330949E-07-1.29760010E-20 + 0.00000000E+00-1.46940833E-08 0.00000000E+00-1.62838947E-08 4.45212851E-03 +-1.23323976E-08 4.96101603E-03-1.36687762E-08 0.00000000E+00-1.46940833E-08 + 0.00000000E+00-1.62838947E-08 4.45212851E-03-1.23323976E-08 4.96101603E-03 +-1.36687762E-08 1.20796356E-02 0.00000000E+00-7.56204789E-05 0.00000000E+00 + 3.55149452E-04-8.91938128E-19-2.20341842E-06 5.43899306E-21 0.00000000E+00 +-1.49138935E-08 0.00000000E+00 7.35886779E-10 4.56702803E-03-1.25217424E-08 +-2.23352058E-04 6.17540149E-10 0.00000000E+00-1.49138935E-08 0.00000000E+00 + 7.35886779E-10 4.56702803E-03-1.25217424E-08-2.23352058E-04 6.17540149E-10 +-2.15402643E-04-6.05248399E-10 2.92002098E-08 4.62118784E-14 0.00000000E+00 +-7.21314530E-10 0.00000000E+00 5.43662646E-14-5.20699550E-04-1.41675763E-18 +-1.04786517E-03 0.00000000E+00-1.56630516E-02-1.10609084E-17-4.80709288E-02 + 0.00000000E+00 4.96101603E-03 1.36687762E-08 5.73620276E-08 9.45031645E-14 + 0.00000000E+00 1.62838947E-08 0.00000000E+00 1.09696856E-13 1.08695041E-03 + 1.86290511E-18 4.34914589E-03 9.06031726E-18 2.14553501E-03 0.00000000E+00 + 8.58244086E-03 0.00000000E+00 3.13644545E-02 3.95776748E-17 1.25458708E-01 + 2.48569063E-16 9.40732007E-02 0.00000000E+00 3.76422033E-01 0.00000000E+00 +-2.35287727E-04-6.38016603E-10 2.81786064E-08 4.83425387E-14 0.00000000E+00 +-7.59358956E-10 0.00000000E+00 5.54148281E-14 1.08694880E-03 1.90613701E-18 +-5.67193156E-04-1.51217650E-18 2.14552658E-03 0.00000000E+00-1.09788792E-03 + 0.00000000E+00 3.13643641E-02 9.02920365E-17-1.57021074E-02-4.62562568E-17 + 9.40750979E-02 0.00000000E+00-4.60910277E-02 0.00000000E+00 0.00000000E+00 +-7.21314530E-10 0.00000000E+00 5.43662646E-14 2.15402643E-04-6.05248399E-10 +-2.92002098E-08 4.62118784E-14-1.04786517E-03 0.00000000E+00-5.20699550E-04 + 1.41675763E-18-4.80709288E-02 0.00000000E+00-1.56630516E-02 1.10609084E-17 + 0.00000000E+00 1.62838947E-08 0.00000000E+00 1.09696856E-13-4.96101603E-03 + 1.36687762E-08-5.73620276E-08 9.45031645E-14 2.14553501E-03 0.00000000E+00 + 8.58244086E-03 0.00000000E+00 1.08695041E-03-1.86290511E-18 4.34914589E-03 +-9.06031726E-18 9.40732007E-02 0.00000000E+00 3.76422033E-01 0.00000000E+00 + 3.13644545E-02-3.95776748E-17 1.25458708E-01-2.48569063E-16 0.00000000E+00 +-7.59358956E-10 0.00000000E+00 5.54148281E-14 2.35287727E-04-6.38016603E-10 +-2.81786064E-08 4.83425387E-14 2.14552658E-03 0.00000000E+00-1.09788792E-03 + 0.00000000E+00 1.08694880E-03-1.90613701E-18-5.67193156E-04 1.51217650E-18 + 9.40750979E-02 0.00000000E+00-4.60910277E-02 0.00000000E+00 3.13643641E-02 +-9.02920365E-17-1.57021074E-02 4.62562568E-17-2.15402643E-04-6.05248399E-10 + 2.92002098E-08 4.62118784E-14 0.00000000E+00-7.21314530E-10 0.00000000E+00 + 5.43662646E-14-5.20699550E-04-1.41675763E-18-1.04786517E-03 0.00000000E+00 +-5.20699550E-04-1.41675763E-18-1.04786517E-03 0.00000000E+00 4.96101603E-03 + 1.36687762E-08 5.73620276E-08 9.45031645E-14 0.00000000E+00 1.62838947E-08 + 0.00000000E+00 1.09696856E-13 1.08695041E-03 1.86290511E-18 4.34914589E-03 + 9.06031726E-18 2.14553501E-03 0.00000000E+00 8.58244086E-03 0.00000000E+00 + 1.08695041E-03 1.86290511E-18 4.34914589E-03 9.06031726E-18 2.14553501E-03 + 0.00000000E+00 8.58244086E-03 0.00000000E+00-2.35287727E-04-6.38016603E-10 + 2.81786064E-08 4.83425387E-14 0.00000000E+00-7.59358956E-10 0.00000000E+00 + 5.54148281E-14 1.08694880E-03 1.90613701E-18-5.67193156E-04-1.51217650E-18 + 2.14552658E-03 0.00000000E+00-1.09788792E-03 0.00000000E+00 1.08694880E-03 + 1.90613701E-18-5.67193156E-04-1.51217650E-18 2.14552658E-03 0.00000000E+00 +-1.09788792E-03 0.00000000E+00 0.00000000E+00-7.21314530E-10 0.00000000E+00 + 5.43662646E-14 2.15402643E-04-6.05248399E-10-2.92002098E-08 4.62118784E-14 +-1.04786517E-03 0.00000000E+00-5.20699550E-04 1.41675763E-18-1.04786517E-03 + 0.00000000E+00-5.20699550E-04 1.41675763E-18 0.00000000E+00 1.62838947E-08 + 0.00000000E+00 1.09696856E-13-4.96101603E-03 1.36687762E-08-5.73620276E-08 + 9.45031645E-14 2.14553501E-03 0.00000000E+00 8.58244086E-03 0.00000000E+00 + 1.08695041E-03-1.86290511E-18 4.34914589E-03-9.06031726E-18 2.14553501E-03 + 0.00000000E+00 8.58244086E-03 0.00000000E+00 1.08695041E-03-1.86290511E-18 + 4.34914589E-03-9.06031726E-18 0.00000000E+00-7.59358956E-10 0.00000000E+00 + 5.54148281E-14 2.35287727E-04-6.38016603E-10-2.81786064E-08 4.83425387E-14 + 2.14552658E-03 0.00000000E+00-1.09788792E-03 0.00000000E+00 1.08694880E-03 +-1.90613701E-18-5.67193156E-04 1.51217650E-18 2.14552658E-03 0.00000000E+00 +-1.09788792E-03 0.00000000E+00 1.08694880E-03-1.90613701E-18-5.67193156E-04 + 1.51217650E-18-1.77393866E-06 4.60215281E-21-1.07278859E-08 2.66510190E-23 +-7.83601306E-05 0.00000000E+00-4.68946898E-07 0.00000000E+00-2.92002098E-08 +-4.62118784E-14 0.00000000E+00-5.43662646E-14-2.92002098E-08-4.62118784E-14 + 0.00000000E+00-5.43662646E-14 4.63330949E-07 1.29760010E-20 3.20270768E-08 + 1.03705704E-23-2.93864895E-06 0.00000000E+00 1.22846603E-06 0.00000000E+00 + 2.30773953E-05 6.39788789E-11-5.73620276E-08-9.45031645E-14 0.00000000E+00 + 7.62324141E-11 0.00000000E+00-1.09696856E-13 2.30773953E-05 6.39788789E-11 +-5.73620276E-08-9.45031645E-14 0.00000000E+00 7.62324141E-11 0.00000000E+00 +-1.09696856E-13 2.23727643E-06 5.74488050E-21-1.33062681E-08-3.37229159E-23 + 7.54205759E-05 0.00000000E+00-4.52588468E-07 0.00000000E+00-2.37659165E-05 +-6.51134331E-11-2.81786064E-08-4.83425387E-14 0.00000000E+00-7.75495211E-11 + 0.00000000E+00-5.54148281E-14-2.37659165E-05-6.51134331E-11-2.81786064E-08 +-4.83425387E-14 0.00000000E+00-7.75495211E-11 0.00000000E+00-5.54148281E-14 + 2.86330873E-04-7.03309438E-19 1.80627310E-06-4.22269426E-21 1.25161774E-02 + 0.00000000E+00 7.81397790E-05 0.00000000E+00 2.27770981E-04 6.24822253E-10 + 0.00000000E+00 7.44342461E-10 2.27770981E-04 6.24822253E-10 0.00000000E+00 + 7.44342461E-10 1.85130119E-03 6.44848100E-19 4.63330949E-07 1.29760010E-20 + 7.10295563E-02 0.00000000E+00-2.93864895E-06 0.00000000E+00-4.45212851E-03 +-1.23323976E-08-4.96101603E-03-1.36687762E-08 0.00000000E+00-1.46940833E-08 + 0.00000000E+00-1.62838947E-08-4.45212851E-03-1.23323976E-08-4.96101603E-03 +-1.36687762E-08 0.00000000E+00-1.46940833E-08 0.00000000E+00-1.62838947E-08 + 3.55149452E-04 8.91938128E-19-2.20341842E-06-5.43899306E-21 1.20796356E-02 + 0.00000000E+00-7.56204789E-05 0.00000000E+00-4.56702803E-03-1.25217424E-08 + 2.23352058E-04 6.17540149E-10 0.00000000E+00-1.49138935E-08 0.00000000E+00 + 7.35886779E-10-4.56702803E-03-1.25217424E-08 2.23352058E-04 6.17540149E-10 + 0.00000000E+00-1.49138935E-08 0.00000000E+00 7.35886779E-10-7.83601306E-05 + 0.00000000E+00-4.68946898E-07 0.00000000E+00-1.77393866E-06-4.60215281E-21 +-1.07278859E-08-2.66510190E-23 0.00000000E+00-5.43662646E-14 2.92002098E-08 +-4.62118784E-14 0.00000000E+00-5.43662646E-14 2.92002098E-08-4.62118784E-14 +-2.93864895E-06 0.00000000E+00 1.22846603E-06 0.00000000E+00 4.63330949E-07 +-1.29760010E-20 3.20270768E-08-1.03705704E-23 0.00000000E+00 7.62324141E-11 + 0.00000000E+00-1.09696856E-13-2.30773953E-05 6.39788789E-11 5.73620276E-08 +-9.45031645E-14 0.00000000E+00 7.62324141E-11 0.00000000E+00-1.09696856E-13 +-2.30773953E-05 6.39788789E-11 5.73620276E-08-9.45031645E-14 7.54205759E-05 + 0.00000000E+00-4.52588468E-07 0.00000000E+00 2.23727643E-06-5.74488050E-21 +-1.33062681E-08 3.37229159E-23 0.00000000E+00-7.75495211E-11 0.00000000E+00 +-5.54148281E-14 2.37659165E-05-6.51134331E-11 2.81786064E-08-4.83425387E-14 + 0.00000000E+00-7.75495211E-11 0.00000000E+00-5.54148281E-14 2.37659165E-05 +-6.51134331E-11 2.81786064E-08-4.83425387E-14 4.41165039E-03 1.22683379E-08 + 2.29605944E-05 6.37940314E-11 0.00000000E+00 1.46187193E-08 0.00000000E+00 + 7.60149490E-11 9.95847790E-04 3.80412543E-18 2.04592565E-03 0.00000000E+00 + 3.12877521E-02 4.66595877E-18 9.82105147E-02 0.00000000E+00 4.45212851E-03 + 1.23323976E-08-2.30773953E-05-6.39788789E-11 0.00000000E+00 1.46940833E-08 + 0.00000000E+00-7.62324141E-11 8.33010976E-03 2.15738525E-17 1.08695041E-03 + 1.86290511E-18 1.67655945E-02 0.00000000E+00 2.14553501E-03 0.00000000E+00 + 2.50607962E-01 7.04733661E-17 3.13644545E-02 3.95776748E-17 7.69027795E-01 + 0.00000000E+00 9.40732007E-02 0.00000000E+00 0.00000000E+00 1.46187193E-08 + 0.00000000E+00 7.60149490E-11-4.41165039E-03 1.22683379E-08-2.29605944E-05 + 6.37940314E-11 2.04592565E-03 0.00000000E+00 9.95847790E-04-3.80412543E-18 + 2.04592565E-03 0.00000000E+00 9.95847790E-04-3.80412543E-18 0.00000000E+00 + 1.46940833E-08 0.00000000E+00-7.62324141E-11-4.45212851E-03 1.23323976E-08 + 2.30773953E-05-6.39788789E-11 1.67655945E-02 0.00000000E+00 2.14553501E-03 + 0.00000000E+00 8.33010976E-03-2.15738525E-17 1.08695041E-03-1.86290511E-18 + 1.67655945E-02 0.00000000E+00 2.14553501E-03 0.00000000E+00 8.33010976E-03 +-2.15738525E-17 1.08695041E-03-1.86290511E-18 4.41165039E-03 1.22683379E-08 + 2.29605944E-05 6.37940314E-11 0.00000000E+00 1.46187193E-08 0.00000000E+00 + 7.60149490E-11 9.95847790E-04 3.80412543E-18 2.04592565E-03 0.00000000E+00 + 9.95847790E-04 3.80412543E-18 2.04592565E-03 0.00000000E+00 4.45212851E-03 + 1.23323976E-08-2.30773953E-05-6.39788789E-11 0.00000000E+00 1.46940833E-08 + 0.00000000E+00-7.62324141E-11 8.33010976E-03 2.15738525E-17 1.08695041E-03 + 1.86290511E-18 1.67655945E-02 0.00000000E+00 2.14553501E-03 0.00000000E+00 + 8.33010976E-03 2.15738525E-17 1.08695041E-03 1.86290511E-18 1.67655945E-02 + 0.00000000E+00 2.14553501E-03 0.00000000E+00 0.00000000E+00 1.46187193E-08 + 0.00000000E+00 7.60149490E-11-4.41165039E-03 1.22683379E-08-2.29605944E-05 + 6.37940314E-11 2.04592565E-03 0.00000000E+00 9.95847790E-04-3.80412543E-18 + 9.82105147E-02 0.00000000E+00 3.12877521E-02-4.66595877E-18 0.00000000E+00 + 1.46940833E-08 0.00000000E+00-7.62324141E-11-4.45212851E-03 1.23323976E-08 + 2.30773953E-05-6.39788789E-11 1.67655945E-02 0.00000000E+00 2.14553501E-03 + 0.00000000E+00 8.33010976E-03-2.15738525E-17 1.08695041E-03-1.86290511E-18 + 7.69027795E-01 0.00000000E+00 9.40732007E-02 0.00000000E+00 2.50607962E-01 +-7.04733661E-17 3.13644545E-02-3.95776748E-17 1.29981872E-02 0.00000000E+00 + 8.11418015E-05 0.00000000E+00 2.20677511E-04 2.22842284E-19 1.39505857E-06 + 1.51864099E-21 0.00000000E+00 7.29600947E-10-2.19974859E-04 6.12190746E-10 + 0.00000000E+00 7.29600947E-10-2.19974859E-04 6.12190746E-10 7.36795879E-02 + 0.00000000E+00-3.24461298E-06 0.00000000E+00 1.46283271E-03 3.45021393E-18 + 4.42018187E-07 4.76749403E-21 0.00000000E+00-1.44032962E-08 0.00000000E+00 +-1.59615704E-08 4.29276622E-03-1.20878074E-08 4.78788415E-03-1.33948108E-08 + 0.00000000E+00-1.44032962E-08 0.00000000E+00-1.59615704E-08 4.29276622E-03 +-1.20878074E-08 4.78788415E-03-1.33948108E-08 1.25161774E-02 0.00000000E+00 +-7.83601306E-05 0.00000000E+00 2.86330873E-04 7.03309438E-19-1.77393866E-06 +-4.60215281E-21 0.00000000E+00-1.46187193E-08 0.00000000E+00 7.21314530E-10 + 4.41165039E-03-1.22683379E-08-2.15402643E-04 6.05248399E-10 0.00000000E+00 +-1.46187193E-08 0.00000000E+00 7.21314530E-10 4.41165039E-03-1.22683379E-08 +-2.15402643E-04 6.05248399E-10 4.25094497E-03 1.20269034E-08 2.21275126E-05 + 6.25365547E-11 0.00000000E+00 1.43295207E-08 0.00000000E+00 7.45112456E-11 + 9.08553320E-04 5.74139386E-18 1.94717265E-03 0.00000000E+00 3.12141924E-02 + 1.26192557E-16 1.02746784E-01 0.00000000E+00 4.29276622E-03 1.20878074E-08 +-2.22481889E-05-6.27122977E-11 0.00000000E+00 1.44032962E-08 0.00000000E+00 +-7.47241280E-11 7.61651613E-03 4.13241572E-17 9.95848971E-04 4.26554444E-18 + 1.59721872E-02 0.00000000E+00 2.04593346E-03 0.00000000E+00 2.50007257E-01 + 6.97128680E-16 3.12878419E-02 3.75651676E-17 8.03697274E-01 0.00000000E+00 + 9.82082056E-02 0.00000000E+00 0.00000000E+00 1.43295207E-08 0.00000000E+00 + 7.45112456E-11-4.25094497E-03 1.20269034E-08-2.21275126E-05 6.25365547E-11 + 1.94717265E-03 0.00000000E+00 9.08553320E-04-5.74139386E-18 1.94717265E-03 + 0.00000000E+00 9.08553320E-04-5.74139386E-18 0.00000000E+00 1.44032962E-08 + 0.00000000E+00-7.47241280E-11-4.29276622E-03 1.20878074E-08 2.22481889E-05 +-6.27122977E-11 1.59721872E-02 0.00000000E+00 2.04593346E-03 0.00000000E+00 + 7.61651613E-03-4.13241572E-17 9.95848971E-04-4.26554444E-18 1.59721872E-02 + 0.00000000E+00 2.04593346E-03 0.00000000E+00 7.61651613E-03-4.13241572E-17 + 9.95848971E-04-4.26554444E-18 4.25094497E-03 1.20269034E-08 2.21275126E-05 + 6.25365547E-11 0.00000000E+00 1.43295207E-08 0.00000000E+00 7.45112456E-11 + 9.08553320E-04 5.74139386E-18 1.94717265E-03 0.00000000E+00 9.08553320E-04 + 5.74139386E-18 1.94717265E-03 0.00000000E+00 4.29276622E-03 1.20878074E-08 +-2.22481889E-05-6.27122977E-11 0.00000000E+00 1.44032962E-08 0.00000000E+00 +-7.47241280E-11 7.61651613E-03 4.13241572E-17 9.95848971E-04 4.26554444E-18 + 1.59721872E-02 0.00000000E+00 2.04593346E-03 0.00000000E+00 7.61651613E-03 + 4.13241572E-17 9.95848971E-04 4.26554444E-18 1.59721872E-02 0.00000000E+00 + 2.04593346E-03 0.00000000E+00 0.00000000E+00 1.43295207E-08 0.00000000E+00 + 7.45112456E-11-4.25094497E-03 1.20269034E-08-2.21275126E-05 6.25365547E-11 + 1.94717265E-03 0.00000000E+00 9.08553320E-04-5.74139386E-18 1.02746784E-01 + 0.00000000E+00 3.12141924E-02-1.26192557E-16 0.00000000E+00 1.44032962E-08 + 0.00000000E+00-7.47241280E-11-4.29276622E-03 1.20878074E-08 2.22481889E-05 +-6.27122977E-11 1.59721872E-02 0.00000000E+00 2.04593346E-03 0.00000000E+00 + 7.61651613E-03-4.13241572E-17 9.95848971E-04-4.26554444E-18 8.03697274E-01 + 0.00000000E+00 9.82082056E-02 0.00000000E+00 2.50007257E-01-6.97128680E-16 + 3.12878419E-02-3.75651676E-17-2.07196130E-04-5.93581114E-10 3.01690769E-08 + 4.39357560E-14 0.00000000E+00-7.07058392E-10 0.00000000E+00 5.32206124E-14 +-4.76100573E-04-2.50173457E-18-9.98276528E-04 0.00000000E+00-1.56255086E-02 +-4.09394313E-17-5.02387473E-02 0.00000000E+00 4.78788415E-03 1.33948108E-08 + 5.93527872E-08 9.01065735E-14 0.00000000E+00 1.59615704E-08 0.00000000E+00 + 1.07510426E-13 9.95848971E-04 4.26554444E-18 3.98475333E-03 1.59708701E-17 + 2.04593346E-03 0.00000000E+00 8.18402138E-03 0.00000000E+00 3.12878419E-02 + 3.75651676E-17 1.25152278E-01 1.29328808E-16 9.82082056E-02 0.00000000E+00 + 3.92980746E-01 0.00000000E+00-2.27770981E-04-6.24822253E-10 2.92002098E-08 + 4.62118784E-14 0.00000000E+00-7.44342461E-10 0.00000000E+00 5.43662646E-14 + 9.95847790E-04 3.80412543E-18-5.20699550E-04-1.41675763E-18 2.04592565E-03 + 0.00000000E+00-1.04786517E-03 0.00000000E+00 3.12877521E-02 4.66595877E-18 +-1.56630516E-02-1.10609084E-17 9.82105147E-02 0.00000000E+00-4.80709288E-02 + 0.00000000E+00 0.00000000E+00-7.07058392E-10 0.00000000E+00 5.32206124E-14 + 2.07196130E-04-5.93581114E-10-3.01690769E-08 4.39357560E-14-9.98276528E-04 + 0.00000000E+00-4.76100573E-04 2.50173457E-18-5.02387473E-02 0.00000000E+00 +-1.56255086E-02 4.09394313E-17 0.00000000E+00 1.59615704E-08 0.00000000E+00 + 1.07510426E-13-4.78788415E-03 1.33948108E-08-5.93527872E-08 9.01065735E-14 + 2.04593346E-03 0.00000000E+00 8.18402138E-03 0.00000000E+00 9.95848971E-04 +-4.26554444E-18 3.98475333E-03-1.59708701E-17 9.82082056E-02 0.00000000E+00 + 3.92980746E-01 0.00000000E+00 3.12878419E-02-3.75651676E-17 1.25152278E-01 +-1.29328808E-16 0.00000000E+00-7.44342461E-10 0.00000000E+00 5.43662646E-14 + 2.27770981E-04-6.24822253E-10-2.92002098E-08 4.62118784E-14 2.04592565E-03 + 0.00000000E+00-1.04786517E-03 0.00000000E+00 9.95847790E-04-3.80412543E-18 +-5.20699550E-04 1.41675763E-18 9.82105147E-02 0.00000000E+00-4.80709288E-02 + 0.00000000E+00 3.12877521E-02-4.66595877E-18-1.56630516E-02 1.10609084E-17 +-2.07196130E-04-5.93581114E-10 3.01690769E-08 4.39357560E-14 0.00000000E+00 +-7.07058392E-10 0.00000000E+00 5.32206124E-14-4.76100573E-04-2.50173457E-18 +-9.98276528E-04 0.00000000E+00-4.76100573E-04-2.50173457E-18-9.98276528E-04 + 0.00000000E+00 4.78788415E-03 1.33948108E-08 5.93527872E-08 9.01065735E-14 + 0.00000000E+00 1.59615704E-08 0.00000000E+00 1.07510426E-13 9.95848971E-04 + 4.26554444E-18 3.98475333E-03 1.59708701E-17 2.04593346E-03 0.00000000E+00 + 8.18402138E-03 0.00000000E+00 9.95848971E-04 4.26554444E-18 3.98475333E-03 + 1.59708701E-17 2.04593346E-03 0.00000000E+00 8.18402138E-03 0.00000000E+00 +-2.27770981E-04-6.24822253E-10 2.92002098E-08 4.62118784E-14 0.00000000E+00 +-7.44342461E-10 0.00000000E+00 5.43662646E-14 9.95847790E-04 3.80412543E-18 +-5.20699550E-04-1.41675763E-18 2.04592565E-03 0.00000000E+00-1.04786517E-03 + 0.00000000E+00 9.95847790E-04 3.80412543E-18-5.20699550E-04-1.41675763E-18 + 2.04592565E-03 0.00000000E+00-1.04786517E-03 0.00000000E+00 0.00000000E+00 +-7.07058392E-10 0.00000000E+00 5.32206124E-14 2.07196130E-04-5.93581114E-10 +-3.01690769E-08 4.39357560E-14-9.98276528E-04 0.00000000E+00-4.76100573E-04 + 2.50173457E-18-9.98276528E-04 0.00000000E+00-4.76100573E-04 2.50173457E-18 + 0.00000000E+00 1.59615704E-08 0.00000000E+00 1.07510426E-13-4.78788415E-03 + 1.33948108E-08-5.93527872E-08 9.01065735E-14 2.04593346E-03 0.00000000E+00 + 8.18402138E-03 0.00000000E+00 9.95848971E-04-4.26554444E-18 3.98475333E-03 +-1.59708701E-17 2.04593346E-03 0.00000000E+00 8.18402138E-03 0.00000000E+00 + 9.95848971E-04-4.26554444E-18 3.98475333E-03-1.59708701E-17 0.00000000E+00 +-7.44342461E-10 0.00000000E+00 5.43662646E-14 2.27770981E-04-6.24822253E-10 +-2.92002098E-08 4.62118784E-14 2.04592565E-03 0.00000000E+00-1.04786517E-03 + 0.00000000E+00 9.95847790E-04-3.80412543E-18-5.20699550E-04 1.41675763E-18 + 2.04592565E-03 0.00000000E+00-1.04786517E-03 0.00000000E+00 9.95847790E-04 +-3.80412543E-18-5.20699550E-04 1.41675763E-18-1.36424265E-06 1.25717766E-21 +-8.26806837E-09 8.24642932E-24-8.13855135E-05 0.00000000E+00-4.87009031E-07 + 0.00000000E+00-3.01690769E-08-4.39357560E-14 0.00000000E+00-5.32206124E-14 +-3.01690769E-08-4.39357560E-14 0.00000000E+00-5.32206124E-14 4.42018187E-07 +-4.76749403E-21 2.53095368E-08-5.42617630E-23-3.24461298E-06 0.00000000E+00 + 1.27432483E-06 0.00000000E+00 2.22481889E-05 6.27122977E-11-5.93527872E-08 +-9.01065735E-14 0.00000000E+00 7.47241280E-11 0.00000000E+00-1.07510426E-13 + 2.22481889E-05 6.27122977E-11-5.93527872E-08-9.01065735E-14 0.00000000E+00 + 7.47241280E-11 0.00000000E+00-1.07510426E-13 1.80627310E-06-4.22269426E-21 +-1.07278859E-08 2.66510190E-23 7.81397790E-05 0.00000000E+00-4.68946898E-07 + 0.00000000E+00-2.29605944E-05-6.37940314E-11-2.92002098E-08-4.62118784E-14 + 0.00000000E+00-7.60149490E-11 0.00000000E+00-5.43662646E-14-2.29605944E-05 +-6.37940314E-11-2.92002098E-08-4.62118784E-14 0.00000000E+00-7.60149490E-11 + 0.00000000E+00-5.43662646E-14 2.20677511E-04-2.22842284E-19 1.39505857E-06 +-1.51864099E-21 1.29981872E-02 0.00000000E+00 8.11418015E-05 0.00000000E+00 + 2.19974859E-04 6.12190746E-10 0.00000000E+00 7.29600947E-10 2.19974859E-04 + 6.12190746E-10 0.00000000E+00 7.29600947E-10 1.46283271E-03-3.45021393E-18 + 4.42018187E-07-4.76749403E-21 7.36795879E-02 0.00000000E+00-3.24461298E-06 + 0.00000000E+00-4.29276622E-03-1.20878074E-08-4.78788415E-03-1.33948108E-08 + 0.00000000E+00-1.44032962E-08 0.00000000E+00-1.59615704E-08-4.29276622E-03 +-1.20878074E-08-4.78788415E-03-1.33948108E-08 0.00000000E+00-1.44032962E-08 + 0.00000000E+00-1.59615704E-08 2.86330873E-04-7.03309438E-19-1.77393866E-06 + 4.60215281E-21 1.25161774E-02 0.00000000E+00-7.83601306E-05 0.00000000E+00 +-4.41165039E-03-1.22683379E-08 2.15402643E-04 6.05248399E-10 0.00000000E+00 +-1.46187193E-08 0.00000000E+00 7.21314530E-10-4.41165039E-03-1.22683379E-08 + 2.15402643E-04 6.05248399E-10 0.00000000E+00-1.46187193E-08 0.00000000E+00 + 7.21314530E-10-8.13855135E-05 0.00000000E+00-4.87009031E-07 0.00000000E+00 +-1.36424265E-06-1.25717766E-21-8.26806837E-09-8.24642932E-24 0.00000000E+00 +-5.32206124E-14 3.01690769E-08-4.39357560E-14 0.00000000E+00-5.32206124E-14 + 3.01690769E-08-4.39357560E-14-3.24461298E-06 0.00000000E+00 1.27432483E-06 + 0.00000000E+00 4.42018187E-07 4.76749403E-21 2.53095368E-08 5.42617630E-23 + 0.00000000E+00 7.47241280E-11 0.00000000E+00-1.07510426E-13-2.22481889E-05 + 6.27122977E-11 5.93527872E-08-9.01065735E-14 0.00000000E+00 7.47241280E-11 + 0.00000000E+00-1.07510426E-13-2.22481889E-05 6.27122977E-11 5.93527872E-08 +-9.01065735E-14 7.81397790E-05 0.00000000E+00-4.68946898E-07 0.00000000E+00 + 1.80627310E-06 4.22269426E-21-1.07278859E-08-2.66510190E-23 0.00000000E+00 +-7.60149490E-11 0.00000000E+00-5.43662646E-14 2.29605944E-05-6.37940314E-11 + 2.92002098E-08-4.62118784E-14 0.00000000E+00-7.60149490E-11 0.00000000E+00 +-5.43662646E-14 2.29605944E-05-6.37940314E-11 2.92002098E-08-4.62118784E-14 + 4.08515012E-03 1.17983182E-08 2.12679336E-05 6.13455240E-11 0.00000000E+00 + 1.40468853E-08 0.00000000E+00 7.30414309E-11 8.25099295E-04 2.13808026E-18 + 1.84922867E-03 0.00000000E+00 3.11437367E-02 7.90831089E-17 1.07743833E-01 + 0.00000000E+00 4.12826266E-03 1.18558249E-08-2.13923373E-05-6.15114654E-11 + 0.00000000E+00 1.41189107E-08 0.00000000E+00-7.32492647E-11 6.93351243E-03 + 3.23746447E-17 9.08554351E-04 5.73751484E-18 1.51854102E-02 0.00000000E+00 + 1.94718030E-03 0.00000000E+00 2.49431184E-01 8.23739222E-16 3.12142826E-02 + 1.21747515E-16 8.41809663E-01 0.00000000E+00 1.02743957E-01 0.00000000E+00 + 1.35322671E-02 0.00000000E+00 8.44676488E-05 0.00000000E+00 1.58166401E-04 +-1.38437490E-19 1.00349453E-06-6.84029931E-22 0.00000000E+00 7.15159044E-10 +-2.11914964E-04 6.00159004E-10 0.00000000E+00 7.15159044E-10-2.11914964E-04 + 6.00159004E-10 7.66107330E-02 0.00000000E+00-3.59498918E-06 0.00000000E+00 + 1.09259860E-03 3.99518305E-19 4.20864329E-07 1.70102969E-21 0.00000000E+00 +-1.41189107E-08 0.00000000E+00-1.56460445E-08 4.12826266E-03-1.18558249E-08 + 4.60900226E-03-1.31343496E-08 0.00000000E+00-1.41189107E-08 0.00000000E+00 +-1.56460445E-08 4.12826266E-03-1.18558249E-08 4.60900226E-03-1.31343496E-08 + 1.29981872E-02 0.00000000E+00-8.13855135E-05 0.00000000E+00 2.20677511E-04 + 2.22842284E-19-1.36424265E-06-1.25717766E-21 0.00000000E+00-1.43295207E-08 + 0.00000000E+00 7.07058392E-10 4.25094497E-03-1.20269034E-08-2.07196130E-04 + 5.93581114E-10 0.00000000E+00-1.43295207E-08 0.00000000E+00 7.07058392E-10 + 4.25094497E-03-1.20269034E-08-2.07196130E-04 5.93581114E-10-1.98741655E-04 +-5.82587417E-10 3.11009177E-08 4.14853645E-14 0.00000000E+00-6.93151216E-10 + 0.00000000E+00 5.19584639E-14-4.33413411E-04-1.96889877E-18-9.49102242E-04 + 0.00000000E+00-1.55895048E-02-5.02076560E-17-5.26219474E-02 0.00000000E+00 + 4.60900226E-03 1.31343496E-08 6.12475543E-08 8.53921978E-14 0.00000000E+00 + 1.56460445E-08 0.00000000E+00 1.05111746E-13 9.08554351E-04 5.73751484E-18 + 3.63558713E-03 2.11199572E-17 1.94718030E-03 0.00000000E+00 7.78899499E-03 + 0.00000000E+00 3.12142826E-02 1.21747515E-16 1.24858058E-01 4.48277839E-16 + 1.02743957E-01 0.00000000E+00 4.11146227E-01 0.00000000E+00-2.19974859E-04 +-6.12190746E-10 3.01690769E-08 4.39357560E-14 0.00000000E+00-7.29600947E-10 + 0.00000000E+00 5.32206124E-14 9.08553320E-04 5.74139386E-18-4.76100573E-04 +-2.50173457E-18 1.94717265E-03 0.00000000E+00-9.98276528E-04 0.00000000E+00 + 3.12141924E-02 1.26192557E-16-1.56255086E-02-4.09394313E-17 1.02746784E-01 + 0.00000000E+00-5.02387473E-02 0.00000000E+00 0.00000000E+00-6.93151216E-10 + 0.00000000E+00 5.19584639E-14 1.98741655E-04-5.82587417E-10-3.11009177E-08 + 4.14853645E-14-9.49102242E-04 0.00000000E+00-4.33413411E-04 1.96889877E-18 +-5.26219474E-02 0.00000000E+00-1.55895048E-02 5.02076560E-17 0.00000000E+00 + 1.56460445E-08 0.00000000E+00 1.05111746E-13-4.60900226E-03 1.31343496E-08 +-6.12475543E-08 8.53921978E-14 1.94718030E-03 0.00000000E+00 7.78899499E-03 + 0.00000000E+00 9.08554351E-04-5.73751484E-18 3.63558713E-03-2.11199572E-17 + 1.02743957E-01 0.00000000E+00 4.11146227E-01 0.00000000E+00 3.12142826E-02 +-1.21747515E-16 1.24858058E-01-4.48277839E-16 0.00000000E+00-7.29600947E-10 + 0.00000000E+00 5.32206124E-14 2.19974859E-04-6.12190746E-10-3.01690769E-08 + 4.39357560E-14 1.94717265E-03 0.00000000E+00-9.98276528E-04 0.00000000E+00 + 9.08553320E-04-5.74139386E-18-4.76100573E-04 2.50173457E-18 1.02746784E-01 + 0.00000000E+00-5.02387473E-02 0.00000000E+00 3.12141924E-02-1.26192557E-16 +-1.56255086E-02 4.09394313E-17-1.98741655E-04-5.82587417E-10 3.11009177E-08 + 4.14853645E-14 0.00000000E+00-6.93151216E-10 0.00000000E+00 5.19584639E-14 +-4.33413411E-04-1.96889877E-18-9.49102242E-04 0.00000000E+00-4.33413411E-04 +-1.96889877E-18-9.49102242E-04 0.00000000E+00 4.60900226E-03 1.31343496E-08 + 6.12475543E-08 8.53921978E-14 0.00000000E+00 1.56460445E-08 0.00000000E+00 + 1.05111746E-13 9.08554351E-04 5.73751484E-18 3.63558713E-03 2.11199572E-17 + 1.94718030E-03 0.00000000E+00 7.78899499E-03 0.00000000E+00 9.08554351E-04 + 5.73751484E-18 3.63558713E-03 2.11199572E-17 1.94718030E-03 0.00000000E+00 + 7.78899499E-03 0.00000000E+00-2.19974859E-04-6.12190746E-10 3.01690769E-08 + 4.39357560E-14 0.00000000E+00-7.29600947E-10 0.00000000E+00 5.32206124E-14 + 9.08553320E-04 5.74139386E-18-4.76100573E-04-2.50173457E-18 1.94717265E-03 + 0.00000000E+00-9.98276528E-04 0.00000000E+00 9.08553320E-04 5.74139386E-18 +-4.76100573E-04-2.50173457E-18 1.94717265E-03 0.00000000E+00-9.98276528E-04 + 0.00000000E+00 0.00000000E+00-6.93151216E-10 0.00000000E+00 5.19584639E-14 + 1.98741655E-04-5.82587417E-10-3.11009177E-08 4.14853645E-14-9.49102242E-04 + 0.00000000E+00-4.33413411E-04 1.96889877E-18-9.49102242E-04 0.00000000E+00 +-4.33413411E-04 1.96889877E-18 0.00000000E+00 1.56460445E-08 0.00000000E+00 + 1.05111746E-13-4.60900226E-03 1.31343496E-08-6.12475543E-08 8.53921978E-14 + 1.94718030E-03 0.00000000E+00 7.78899499E-03 0.00000000E+00 9.08554351E-04 +-5.73751484E-18 3.63558713E-03-2.11199572E-17 1.94718030E-03 0.00000000E+00 + 7.78899499E-03 0.00000000E+00 9.08554351E-04-5.73751484E-18 3.63558713E-03 +-2.11199572E-17 0.00000000E+00-7.29600947E-10 0.00000000E+00 5.32206124E-14 + 2.19974859E-04-6.12190746E-10-3.01690769E-08 4.39357560E-14 1.94717265E-03 + 0.00000000E+00-9.98276528E-04 0.00000000E+00 9.08553320E-04-5.74139386E-18 +-4.76100573E-04 2.50173457E-18 1.94717265E-03 0.00000000E+00-9.98276528E-04 + 0.00000000E+00 9.08553320E-04-5.74139386E-18-4.76100573E-04 2.50173457E-18 +-9.74181797E-07-1.04121684E-21-5.92595622E-09-5.13084454E-24-8.47381769E-05 + 0.00000000E+00-5.07022245E-07 0.00000000E+00-3.11009177E-08-4.14853645E-14 + 0.00000000E+00-5.19584639E-14-3.11009177E-08-4.14853645E-14 0.00000000E+00 +-5.19584639E-14 4.20864329E-07-1.70102969E-21 1.89071502E-08-5.53760052E-24 +-3.59498918E-06 0.00000000E+00 1.32505010E-06 0.00000000E+00 2.13923373E-05 + 6.15114654E-11-6.12475543E-08-8.53921978E-14 0.00000000E+00 7.32492647E-11 + 0.00000000E+00-1.05111746E-13 2.13923373E-05 6.15114654E-11-6.12475543E-08 +-8.53921978E-14 0.00000000E+00 7.32492647E-11 0.00000000E+00-1.05111746E-13 + 1.39505857E-06-1.51864099E-21-8.26806837E-09 8.24642932E-24 8.11418015E-05 + 0.00000000E+00-4.87009031E-07 0.00000000E+00-2.21275126E-05-6.25365547E-11 +-3.01690769E-08-4.39357560E-14 0.00000000E+00-7.45112456E-11 0.00000000E+00 +-5.32206124E-14-2.21275126E-05-6.25365547E-11-3.01690769E-08-4.39357560E-14 + 0.00000000E+00-7.45112456E-11 0.00000000E+00-5.32206124E-14 1.58166401E-04 + 1.38437490E-19 1.00349453E-06 6.84029931E-22 1.35322671E-02 0.00000000E+00 + 8.44676488E-05 0.00000000E+00 2.11914964E-04 6.00159004E-10 0.00000000E+00 + 7.15159044E-10 2.11914964E-04 6.00159004E-10 0.00000000E+00 7.15159044E-10 + 1.09259860E-03-3.99518305E-19 4.20864329E-07-1.70102969E-21 7.66107330E-02 + 0.00000000E+00-3.59498918E-06 0.00000000E+00-4.12826266E-03-1.18558249E-08 +-4.60900226E-03-1.31343496E-08 0.00000000E+00-1.41189107E-08 0.00000000E+00 +-1.56460445E-08-4.12826266E-03-1.18558249E-08-4.60900226E-03-1.31343496E-08 + 0.00000000E+00-1.41189107E-08 0.00000000E+00-1.56460445E-08 2.20677511E-04 +-2.22842284E-19-1.36424265E-06 1.25717766E-21 1.29981872E-02 0.00000000E+00 +-8.13855135E-05 0.00000000E+00-4.25094497E-03-1.20269034E-08 2.07196130E-04 + 5.93581114E-10 0.00000000E+00-1.43295207E-08 0.00000000E+00 7.07058392E-10 +-4.25094497E-03-1.20269034E-08 2.07196130E-04 5.93581114E-10 0.00000000E+00 +-1.43295207E-08 0.00000000E+00 7.07058392E-10-8.47381769E-05 0.00000000E+00 +-5.07022245E-07 0.00000000E+00-9.74181797E-07 1.04121684E-21-5.92595622E-09 + 5.13084454E-24 0.00000000E+00-5.19584639E-14 3.11009177E-08-4.14853645E-14 + 0.00000000E+00-5.19584639E-14 3.11009177E-08-4.14853645E-14-3.59498918E-06 + 0.00000000E+00 1.32505010E-06 0.00000000E+00 4.20864329E-07 1.70102969E-21 + 1.89071502E-08 5.53760052E-24 0.00000000E+00 7.32492647E-11 0.00000000E+00 +-1.05111746E-13-2.13923373E-05 6.15114654E-11 6.12475543E-08-8.53921978E-14 + 0.00000000E+00 7.32492647E-11 0.00000000E+00-1.05111746E-13-2.13923373E-05 + 6.15114654E-11 6.12475543E-08-8.53921978E-14 8.11418015E-05 0.00000000E+00 +-4.87009031E-07 0.00000000E+00 1.39505857E-06 1.51864099E-21-8.26806837E-09 +-8.24642932E-24 0.00000000E+00-7.45112456E-11 0.00000000E+00-5.32206124E-14 + 2.21275126E-05-6.25365547E-11 3.01690769E-08-4.39357560E-14 0.00000000E+00 +-7.45112456E-11 0.00000000E+00-5.32206124E-14 2.21275126E-05-6.25365547E-11 + 3.01690769E-08-4.39357560E-14 0.00000000E+00 1.40468853E-08 0.00000000E+00 + 7.30414309E-11-4.08515012E-03 1.17983182E-08-2.12679336E-05 6.13455240E-11 + 1.84922867E-03 0.00000000E+00 8.25099295E-04-2.13808026E-18 1.84922867E-03 + 0.00000000E+00 8.25099295E-04-2.13808026E-18 0.00000000E+00 1.41189107E-08 + 0.00000000E+00-7.32492647E-11-4.12826266E-03 1.18558249E-08 2.13923373E-05 +-6.15114654E-11 1.51854102E-02 0.00000000E+00 1.94718030E-03 0.00000000E+00 + 6.93351243E-03-3.23746447E-17 9.08554351E-04-5.73751484E-18 1.51854102E-02 + 0.00000000E+00 1.94718030E-03 0.00000000E+00 6.93351243E-03-3.23746447E-17 + 9.08554351E-04-5.73751484E-18 4.08515012E-03 1.17983182E-08 2.12679336E-05 + 6.13455240E-11 0.00000000E+00 1.40468853E-08 0.00000000E+00 7.30414309E-11 + 8.25099295E-04 2.13808026E-18 1.84922867E-03 0.00000000E+00 8.25099295E-04 + 2.13808026E-18 1.84922867E-03 0.00000000E+00 4.12826266E-03 1.18558249E-08 +-2.13923373E-05-6.15114654E-11 0.00000000E+00 1.41189107E-08 0.00000000E+00 +-7.32492647E-11 6.93351243E-03 3.23746447E-17 9.08554351E-04 5.73751484E-18 + 1.51854102E-02 0.00000000E+00 1.94718030E-03 0.00000000E+00 6.93351243E-03 + 3.23746447E-17 9.08554351E-04 5.73751484E-18 1.51854102E-02 0.00000000E+00 + 1.94718030E-03 0.00000000E+00 0.00000000E+00 1.40468853E-08 0.00000000E+00 + 7.30414309E-11-4.08515012E-03 1.17983182E-08-2.12679336E-05 6.13455240E-11 + 1.84922867E-03 0.00000000E+00 8.25099295E-04-2.13808026E-18 1.07743833E-01 + 0.00000000E+00 3.11437367E-02-7.90831089E-17 0.00000000E+00 1.41189107E-08 + 0.00000000E+00-7.32492647E-11-4.12826266E-03 1.18558249E-08 2.13923373E-05 +-6.15114654E-11 1.51854102E-02 0.00000000E+00 1.94718030E-03 0.00000000E+00 + 6.93351243E-03-3.23746447E-17 9.08554351E-04-5.73751484E-18 8.41809663E-01 + 0.00000000E+00 1.02743957E-01 0.00000000E+00 2.49431184E-01-8.23739222E-16 + 3.12142826E-02-1.21747515E-16 1.47902400E-02 0.00000000E+00 9.22992794E-05 + 0.00000000E+00 4.24401357E-05 1.09801840E-18 2.78497228E-07 6.73284424E-21 + 0.00000000E+00 6.87298010E-10-1.95044666E-04 5.78080161E-10 0.00000000E+00 + 6.87298010E-10-1.95044666E-04 5.78080161E-10 8.34925839E-02 0.00000000E+00 +-4.46820848E-06 0.00000000E+00 4.06106333E-04 2.83643359E-18 3.79212329E-07 +-1.03438315E-20 0.00000000E+00-1.35721818E-08 0.00000000E+00-1.50382976E-08 + 3.78481071E-03-1.14339307E-08 4.23501993E-03-1.26582949E-08 0.00000000E+00 +-1.35721818E-08 0.00000000E+00-1.50382976E-08 3.78481071E-03-1.14339307E-08 + 4.23501993E-03-1.26582949E-08 1.41263674E-02 0.00000000E+00-8.84682196E-05 + 0.00000000E+00 9.87625279E-05-2.68239386E-19-6.03536231E-07 1.39113583E-21 + 0.00000000E+00-1.37715204E-08 0.00000000E+00 6.79632666E-10 3.91451593E-03 +-1.15836412E-08-1.90055869E-04 5.72326723E-10 0.00000000E+00-1.37715204E-08 + 0.00000000E+00 6.79632666E-10 3.91451593E-03-1.15836412E-08-1.90055869E-04 + 5.72326723E-10-1.81150365E-04-5.62871447E-10 3.28032585E-08 3.59076205E-14 + 0.00000000E+00-6.66550967E-10 0.00000000E+00 4.89825262E-14-3.53838664E-04 +-1.19874041E-18-8.51917043E-04 0.00000000E+00-1.55222111E-02-4.06153673E-17 +-5.81740847E-02 0.00000000E+00 4.23501993E-03 1.26582949E-08 6.47577476E-08 + 7.47367728E-14 0.00000000E+00 1.50382976E-08 0.00000000E+00 9.94952174E-14 + 7.45517793E-04 2.53812162E-18 2.98346350E-03 8.70731385E-18 1.75206054E-03 + 0.00000000E+00 7.00848874E-03 0.00000000E+00 3.10765226E-02 5.64284492E-17 + 1.24307051E-01 2.43899722E-16 1.13269851E-01 0.00000000E+00 4.53310505E-01 + 0.00000000E+00-2.03598858E-04-5.88771117E-10 3.19735630E-08 3.88245308E-14 + 0.00000000E+00-7.01046243E-10 0.00000000E+00 5.05558018E-14 7.45517145E-04 + 1.93232118E-18-3.92654312E-04-8.60863394E-19 1.75205353E-03 0.00000000E+00 +-9.00322371E-04 0.00000000E+00 3.10764326E-02 5.37289317E-17-1.55550648E-02 +-3.09519654E-17 1.13274191E-01 0.00000000E+00-5.52536338E-02 0.00000000E+00 + 0.00000000E+00-6.66550967E-10 0.00000000E+00 4.89825262E-14 1.81150365E-04 +-5.62871447E-10-3.28032585E-08 3.59076205E-14-8.51917043E-04 0.00000000E+00 +-3.53838664E-04 1.19874041E-18-5.81740847E-02 0.00000000E+00-1.55222111E-02 + 4.06153673E-17 0.00000000E+00 1.50382976E-08 0.00000000E+00 9.94952174E-14 +-4.23501993E-03 1.26582949E-08-6.47577476E-08 7.47367728E-14 1.75206054E-03 + 0.00000000E+00 7.00848874E-03 0.00000000E+00 7.45517793E-04-2.53812162E-18 + 2.98346350E-03-8.70731385E-18 1.13269851E-01 0.00000000E+00 4.53310505E-01 + 0.00000000E+00 3.10765226E-02-5.64284492E-17 1.24307051E-01-2.43899722E-16 + 0.00000000E+00-7.01046243E-10 0.00000000E+00 5.05558018E-14 2.03598858E-04 +-5.88771117E-10-3.19735630E-08 3.88245308E-14 1.75205353E-03 0.00000000E+00 +-9.00322371E-04 0.00000000E+00 7.45517145E-04-1.93232118E-18-3.92654312E-04 + 8.60863394E-19 1.13274191E-01 0.00000000E+00-5.52536338E-02 0.00000000E+00 + 3.10764326E-02-5.37289317E-17-1.55550648E-02 3.09519654E-17-1.81150365E-04 +-5.62871447E-10 3.28032585E-08 3.59076205E-14 0.00000000E+00-6.66550967E-10 + 0.00000000E+00 4.89825262E-14-3.53838664E-04-1.19874041E-18-8.51917043E-04 + 0.00000000E+00-3.53838664E-04-1.19874041E-18-8.51917043E-04 0.00000000E+00 + 4.23501993E-03 1.26582949E-08 6.47577476E-08 7.47367728E-14 0.00000000E+00 + 1.50382976E-08 0.00000000E+00 9.94952174E-14 7.45517793E-04 2.53812162E-18 + 2.98346350E-03 8.70731385E-18 1.75206054E-03 0.00000000E+00 7.00848874E-03 + 0.00000000E+00 7.45517793E-04 2.53812162E-18 2.98346350E-03 8.70731385E-18 + 1.75206054E-03 0.00000000E+00 7.00848874E-03 0.00000000E+00-2.03598858E-04 +-5.88771117E-10 3.19735630E-08 3.88245308E-14 0.00000000E+00-7.01046243E-10 + 0.00000000E+00 5.05558018E-14 7.45517145E-04 1.93232118E-18-3.92654312E-04 +-8.60863394E-19 1.75205353E-03 0.00000000E+00-9.00322371E-04 0.00000000E+00 + 7.45517145E-04 1.93232118E-18-3.92654312E-04-8.60863394E-19 1.75205353E-03 + 0.00000000E+00-9.00322371E-04 0.00000000E+00 0.00000000E+00-6.66550967E-10 + 0.00000000E+00 4.89825262E-14 1.81150365E-04-5.62871447E-10-3.28032585E-08 + 3.59076205E-14-8.51917043E-04 0.00000000E+00-3.53838664E-04 1.19874041E-18 +-8.51917043E-04 0.00000000E+00-3.53838664E-04 1.19874041E-18 0.00000000E+00 + 1.50382976E-08 0.00000000E+00 9.94952174E-14-4.23501993E-03 1.26582949E-08 +-6.47577476E-08 7.47367728E-14 1.75206054E-03 0.00000000E+00 7.00848874E-03 + 0.00000000E+00 7.45517793E-04-2.53812162E-18 2.98346350E-03-8.70731385E-18 + 1.75206054E-03 0.00000000E+00 7.00848874E-03 0.00000000E+00 7.45517793E-04 +-2.53812162E-18 2.98346350E-03-8.70731385E-18 0.00000000E+00-7.01046243E-10 + 0.00000000E+00 5.05558018E-14 2.03598858E-04-5.88771117E-10-3.19735630E-08 + 3.88245308E-14 1.75205353E-03 0.00000000E+00-9.00322371E-04 0.00000000E+00 + 7.45517145E-04-1.93232118E-18-3.92654312E-04 8.60863394E-19 1.75205353E-03 + 0.00000000E+00-9.00322371E-04 0.00000000E+00 7.45517145E-04-1.93232118E-18 +-3.92654312E-04 8.60863394E-19-2.52151547E-07 7.01480269E-21-1.58994964E-09 + 4.13167003E-23-9.26370669E-05 0.00000000E+00-5.54160978E-07 0.00000000E+00 +-3.28032585E-08-3.59076205E-14 0.00000000E+00-4.89825262E-14-3.28032585E-08 +-3.59076205E-14 0.00000000E+00-4.89825262E-14 3.79212329E-07 1.03438315E-20 + 7.03563362E-09-4.54808695E-23-4.46820848E-06 0.00000000E+00 1.44415519E-06 + 0.00000000E+00 1.96058431E-05 5.93293506E-11-6.47577476E-08-7.47367728E-14 + 0.00000000E+00 7.04147030E-11 0.00000000E+00-9.94952174E-14 1.96058431E-05 + 5.93293506E-11-6.47577476E-08-7.47367728E-14 0.00000000E+00 7.04147030E-11 + 0.00000000E+00-9.94952174E-14 6.31363271E-07 1.98195865E-21-3.70023844E-09 +-1.02358979E-23 8.81666361E-05 0.00000000E+00-5.29284424E-07 0.00000000E+00 +-2.03831153E-05-6.02263797E-11-3.19735630E-08-3.88245308E-14 0.00000000E+00 +-7.16091402E-11 0.00000000E+00-5.05558018E-14-2.03831153E-05-6.02263797E-11 +-3.19735630E-08-3.88245308E-14 0.00000000E+00-7.16091402E-11 0.00000000E+00 +-5.05558018E-14 4.24401357E-05-1.09801840E-18 2.78497228E-07-6.73284424E-21 + 1.47902400E-02 0.00000000E+00 9.22992794E-05 0.00000000E+00 1.95044666E-04 + 5.78080161E-10 0.00000000E+00 6.87298010E-10 1.95044666E-04 5.78080161E-10 + 0.00000000E+00 6.87298010E-10 4.06106333E-04-2.83643359E-18 3.79212329E-07 + 1.03438315E-20 8.34925839E-02 0.00000000E+00-4.46820848E-06 0.00000000E+00 +-3.78481071E-03-1.14339307E-08-4.23501993E-03-1.26582949E-08 0.00000000E+00 +-1.35721818E-08 0.00000000E+00-1.50382976E-08-3.78481071E-03-1.14339307E-08 +-4.23501993E-03-1.26582949E-08 0.00000000E+00-1.35721818E-08 0.00000000E+00 +-1.50382976E-08 9.87625279E-05 2.68239386E-19-6.03536231E-07-1.39113583E-21 + 1.41263674E-02 0.00000000E+00-8.84682196E-05 0.00000000E+00-3.91451593E-03 +-1.15836412E-08 1.90055869E-04 5.72326723E-10 0.00000000E+00-1.37715204E-08 + 0.00000000E+00 6.79632666E-10-3.91451593E-03-1.15836412E-08 1.90055869E-04 + 5.72326723E-10 0.00000000E+00-1.37715204E-08 0.00000000E+00 6.79632666E-10 +-9.26370669E-05 0.00000000E+00-5.54160978E-07 0.00000000E+00-2.52151547E-07 +-7.01480269E-21-1.58994964E-09-4.13167003E-23 0.00000000E+00-4.89825262E-14 + 3.28032585E-08-3.59076205E-14 0.00000000E+00-4.89825262E-14 3.28032585E-08 +-3.59076205E-14-4.46820848E-06 0.00000000E+00 1.44415519E-06 0.00000000E+00 + 3.79212329E-07-1.03438315E-20 7.03563362E-09 4.54808695E-23 0.00000000E+00 + 7.04147030E-11 0.00000000E+00-9.94952174E-14-1.96058431E-05 5.93293506E-11 + 6.47577476E-08-7.47367728E-14 0.00000000E+00 7.04147030E-11 0.00000000E+00 +-9.94952174E-14-1.96058431E-05 5.93293506E-11 6.47577476E-08-7.47367728E-14 + 8.81666361E-05 0.00000000E+00-5.29284424E-07 0.00000000E+00 6.31363271E-07 +-1.98195865E-21-3.70023844E-09 1.02358979E-23 0.00000000E+00-7.16091402E-11 + 0.00000000E+00-5.05558018E-14 2.03831153E-05-6.02263797E-11 3.19735630E-08 +-3.88245308E-14 0.00000000E+00-7.16091402E-11 0.00000000E+00-5.05558018E-14 + 2.03831153E-05-6.02263797E-11 3.19735630E-08-3.88245308E-14 1.41263674E-02 + 0.00000000E+00 8.81666361E-05 0.00000000E+00 9.87625279E-05-2.68239386E-19 + 6.31363271E-07-1.98195865E-21 0.00000000E+00 7.01046243E-10-2.03598858E-04 + 5.88771117E-10 0.00000000E+00 7.01046243E-10-2.03598858E-04 5.88771117E-10 + 7.98647335E-02 0.00000000E+00-3.99877596E-06 0.00000000E+00 7.40421380E-04 +-2.41283213E-18 3.99947940E-07 1.82900681E-21 0.00000000E+00-1.38416010E-08 + 0.00000000E+00-1.53380087E-08 3.95883840E-03-1.16374589E-08 4.42460317E-03 +-1.28884278E-08 0.00000000E+00-1.38416010E-08 0.00000000E+00-1.53380087E-08 + 3.95883840E-03-1.16374589E-08 4.42460317E-03-1.28884278E-08 1.35322671E-02 + 0.00000000E+00-8.47381769E-05 0.00000000E+00 1.58166401E-04-1.38437490E-19 +-9.74181797E-07 1.04121684E-21 0.00000000E+00-1.40468853E-08 0.00000000E+00 + 6.93151216E-10 4.08515012E-03-1.17983182E-08-1.98741655E-04 5.82587417E-10 + 0.00000000E+00-1.40468853E-08 0.00000000E+00 6.93151216E-10 4.08515012E-03 +-1.17983182E-08-1.98741655E-04 5.82587417E-10-1.90055869E-04-5.72326723E-10 + 3.19735630E-08 3.88245308E-14 0.00000000E+00-6.79632666E-10 0.00000000E+00 + 5.05558018E-14-3.92654312E-04-8.60863394E-19-9.00322371E-04 0.00000000E+00 +-1.55550648E-02-3.09519654E-17-5.52536338E-02 0.00000000E+00 4.42460317E-03 + 1.28884278E-08 6.30678974E-08 8.02958786E-14 0.00000000E+00 1.53380087E-08 + 0.00000000E+00 1.02457764E-13 8.25100105E-04 1.51113240E-18 3.30178179E-03 + 8.74338825E-18 1.84923596E-03 0.00000000E+00 7.39720404E-03 0.00000000E+00 + 3.11438266E-02 7.00789299E-17 1.24576252E-01 3.07803770E-16 1.07740344E-01 + 0.00000000E+00 4.31159054E-01 0.00000000E+00-2.11914964E-04-6.00159004E-10 + 3.11009177E-08 4.14853645E-14 0.00000000E+00-7.15159044E-10 0.00000000E+00 + 5.19584639E-14 8.25099295E-04 2.13808026E-18-4.33413411E-04-1.96889877E-18 + 1.84922867E-03 0.00000000E+00-9.49102242E-04 0.00000000E+00 3.11437367E-02 + 7.90831089E-17-1.55895048E-02-5.02076560E-17 1.07743833E-01 0.00000000E+00 +-5.26219474E-02 0.00000000E+00 0.00000000E+00-6.79632666E-10 0.00000000E+00 + 5.05558018E-14 1.90055869E-04-5.72326723E-10-3.19735630E-08 3.88245308E-14 +-9.00322371E-04 0.00000000E+00-3.92654312E-04 8.60863394E-19-5.52536338E-02 + 0.00000000E+00-1.55550648E-02 3.09519654E-17 0.00000000E+00 1.53380087E-08 + 0.00000000E+00 1.02457764E-13-4.42460317E-03 1.28884278E-08-6.30678974E-08 + 8.02958786E-14 1.84923596E-03 0.00000000E+00 7.39720404E-03 0.00000000E+00 + 8.25100105E-04-1.51113240E-18 3.30178179E-03-8.74338825E-18 1.07740344E-01 + 0.00000000E+00 4.31159054E-01 0.00000000E+00 3.11438266E-02-7.00789299E-17 + 1.24576252E-01-3.07803770E-16 0.00000000E+00-7.15159044E-10 0.00000000E+00 + 5.19584639E-14 2.11914964E-04-6.00159004E-10-3.11009177E-08 4.14853645E-14 + 1.84922867E-03 0.00000000E+00-9.49102242E-04 0.00000000E+00 8.25099295E-04 +-2.13808026E-18-4.33413411E-04 1.96889877E-18 1.07743833E-01 0.00000000E+00 +-5.26219474E-02 0.00000000E+00 3.11437367E-02-7.90831089E-17-1.55895048E-02 + 5.02076560E-17-1.90055869E-04-5.72326723E-10 3.19735630E-08 3.88245308E-14 + 0.00000000E+00-6.79632666E-10 0.00000000E+00 5.05558018E-14-3.92654312E-04 +-8.60863394E-19-9.00322371E-04 0.00000000E+00-3.92654312E-04-8.60863394E-19 +-9.00322371E-04 0.00000000E+00 4.42460317E-03 1.28884278E-08 6.30678974E-08 + 8.02958786E-14 0.00000000E+00 1.53380087E-08 0.00000000E+00 1.02457764E-13 + 8.25100105E-04 1.51113240E-18 3.30178179E-03 8.74338825E-18 1.84923596E-03 + 0.00000000E+00 7.39720404E-03 0.00000000E+00 8.25100105E-04 1.51113240E-18 + 3.30178179E-03 8.74338825E-18 1.84923596E-03 0.00000000E+00 7.39720404E-03 + 0.00000000E+00-2.11914964E-04-6.00159004E-10 3.11009177E-08 4.14853645E-14 + 0.00000000E+00-7.15159044E-10 0.00000000E+00 5.19584639E-14 8.25099295E-04 + 2.13808026E-18-4.33413411E-04-1.96889877E-18 1.84922867E-03 0.00000000E+00 +-9.49102242E-04 0.00000000E+00 8.25099295E-04 2.13808026E-18-4.33413411E-04 +-1.96889877E-18 1.84922867E-03 0.00000000E+00-9.49102242E-04 0.00000000E+00 + 0.00000000E+00-6.79632666E-10 0.00000000E+00 5.05558018E-14 1.90055869E-04 +-5.72326723E-10-3.19735630E-08 3.88245308E-14-9.00322371E-04 0.00000000E+00 +-3.92654312E-04 8.60863394E-19-9.00322371E-04 0.00000000E+00-3.92654312E-04 + 8.60863394E-19 0.00000000E+00 1.53380087E-08 0.00000000E+00 1.02457764E-13 +-4.42460317E-03 1.28884278E-08-6.30678974E-08 8.02958786E-14 1.84923596E-03 + 0.00000000E+00 7.39720404E-03 0.00000000E+00 8.25100105E-04-1.51113240E-18 + 3.30178179E-03-8.74338825E-18 1.84923596E-03 0.00000000E+00 7.39720404E-03 + 0.00000000E+00 8.25100105E-04-1.51113240E-18 3.30178179E-03-8.74338825E-18 + 0.00000000E+00-7.15159044E-10 0.00000000E+00 5.19584639E-14 2.11914964E-04 +-6.00159004E-10-3.11009177E-08 4.14853645E-14 1.84922867E-03 0.00000000E+00 +-9.49102242E-04 0.00000000E+00 8.25099295E-04-2.13808026E-18-4.33413411E-04 + 1.96889877E-18 1.84922867E-03 0.00000000E+00-9.49102242E-04 0.00000000E+00 + 8.25099295E-04-2.13808026E-18-4.33413411E-04 1.96889877E-18-6.03536231E-07 +-1.39113583E-21-3.70023844E-09-1.02358979E-23-8.84682196E-05 0.00000000E+00 +-5.29284424E-07 0.00000000E+00-3.19735630E-08-3.88245308E-14 0.00000000E+00 +-5.05558018E-14-3.19735630E-08-3.88245308E-14 0.00000000E+00-5.05558018E-14 + 3.99947940E-07-1.82900681E-21 1.28169235E-08 3.24107635E-23-3.99877596E-06 + 0.00000000E+00 1.38136591E-06 0.00000000E+00 2.05110095E-05 6.03816778E-11 +-6.30678974E-08-8.02958786E-14 0.00000000E+00 7.18113634E-11 0.00000000E+00 +-1.02457764E-13 2.05110095E-05 6.03816778E-11-6.30678974E-08-8.02958786E-14 + 0.00000000E+00 7.18113634E-11 0.00000000E+00-1.02457764E-13 1.00349453E-06 + 6.84029931E-22-5.92595622E-09-5.13084454E-24 8.44676488E-05 0.00000000E+00 +-5.07022245E-07 0.00000000E+00-2.12679336E-05-6.13455240E-11-3.11009177E-08 +-4.14853645E-14 0.00000000E+00-7.30414309E-11 0.00000000E+00-5.19584639E-14 +-2.12679336E-05-6.13455240E-11-3.11009177E-08-4.14853645E-14 0.00000000E+00 +-7.30414309E-11 0.00000000E+00-5.19584639E-14 9.87625279E-05 2.68239386E-19 + 6.31363271E-07 1.98195865E-21 1.41263674E-02 0.00000000E+00 8.81666361E-05 + 0.00000000E+00 2.03598858E-04 5.88771117E-10 0.00000000E+00 7.01046243E-10 + 2.03598858E-04 5.88771117E-10 0.00000000E+00 7.01046243E-10 7.40421380E-04 + 2.41283213E-18 3.99947940E-07-1.82900681E-21 7.98647335E-02 0.00000000E+00 +-3.99877596E-06 0.00000000E+00-3.95883840E-03-1.16374589E-08-4.42460317E-03 +-1.28884278E-08 0.00000000E+00-1.38416010E-08 0.00000000E+00-1.53380087E-08 +-3.95883840E-03-1.16374589E-08-4.42460317E-03-1.28884278E-08 0.00000000E+00 +-1.38416010E-08 0.00000000E+00-1.53380087E-08 1.58166401E-04 1.38437490E-19 +-9.74181797E-07-1.04121684E-21 1.35322671E-02 0.00000000E+00-8.47381769E-05 + 0.00000000E+00-4.08515012E-03-1.17983182E-08 1.98741655E-04 5.82587417E-10 + 0.00000000E+00-1.40468853E-08 0.00000000E+00 6.93151216E-10-4.08515012E-03 +-1.17983182E-08 1.98741655E-04 5.82587417E-10 0.00000000E+00-1.40468853E-08 + 0.00000000E+00 6.93151216E-10-8.84682196E-05 0.00000000E+00-5.29284424E-07 + 0.00000000E+00-6.03536231E-07 1.39113583E-21-3.70023844E-09 1.02358979E-23 + 0.00000000E+00-5.05558018E-14 3.19735630E-08-3.88245308E-14 0.00000000E+00 +-5.05558018E-14 3.19735630E-08-3.88245308E-14-3.99877596E-06 0.00000000E+00 + 1.38136591E-06 0.00000000E+00 3.99947940E-07 1.82900681E-21 1.28169235E-08 +-3.24107635E-23 0.00000000E+00 7.18113634E-11 0.00000000E+00-1.02457764E-13 +-2.05110095E-05 6.03816778E-11 6.30678974E-08-8.02958786E-14 0.00000000E+00 + 7.18113634E-11 0.00000000E+00-1.02457764E-13-2.05110095E-05 6.03816778E-11 + 6.30678974E-08-8.02958786E-14 8.44676488E-05 0.00000000E+00-5.07022245E-07 + 0.00000000E+00 1.00349453E-06-6.84029931E-22-5.92595622E-09 5.13084454E-24 + 0.00000000E+00-7.30414309E-11 0.00000000E+00-5.19584639E-14 2.12679336E-05 +-6.13455240E-11 3.11009177E-08-4.14853645E-14 0.00000000E+00-7.30414309E-11 + 0.00000000E+00-5.19584639E-14 2.12679336E-05-6.13455240E-11 3.11009177E-08 +-4.14853645E-14 3.91451593E-03 1.15836412E-08 2.03831153E-05 6.02263797E-11 + 0.00000000E+00 1.37715204E-08 0.00000000E+00 7.16091402E-11 7.45517145E-04 + 1.93232118E-18 1.75205353E-03 0.00000000E+00 3.10764326E-02 5.37289317E-17 + 1.13274191E-01 0.00000000E+00 3.95883840E-03 1.16374589E-08-2.05110095E-05 +-6.03816778E-11 0.00000000E+00 1.38416010E-08 0.00000000E+00-7.18113634E-11 + 6.28135815E-03 1.19431478E-17 8.25100105E-04 1.51113240E-18 1.44049436E-02 + 0.00000000E+00 1.84923596E-03 0.00000000E+00 2.48880130E-01 4.69783448E-16 + 3.11438266E-02 7.00789299E-17 8.83893766E-01 0.00000000E+00 1.07740344E-01 + 0.00000000E+00 0.00000000E+00 1.37715204E-08 0.00000000E+00 7.16091402E-11 +-3.91451593E-03 1.15836412E-08-2.03831153E-05 6.02263797E-11 1.75205353E-03 + 0.00000000E+00 7.45517145E-04-1.93232118E-18 1.75205353E-03 0.00000000E+00 + 7.45517145E-04-1.93232118E-18 0.00000000E+00 1.38416010E-08 0.00000000E+00 +-7.18113634E-11-3.95883840E-03 1.16374589E-08 2.05110095E-05-6.03816778E-11 + 1.44049436E-02 0.00000000E+00 1.84923596E-03 0.00000000E+00 6.28135815E-03 +-1.19431478E-17 8.25100105E-04-1.51113240E-18 1.44049436E-02 0.00000000E+00 + 1.84923596E-03 0.00000000E+00 6.28135815E-03-1.19431478E-17 8.25100105E-04 +-1.51113240E-18 3.91451593E-03 1.15836412E-08 2.03831153E-05 6.02263797E-11 + 0.00000000E+00 1.37715204E-08 0.00000000E+00 7.16091402E-11 7.45517145E-04 + 1.93232118E-18 1.75205353E-03 0.00000000E+00 7.45517145E-04 1.93232118E-18 + 1.75205353E-03 0.00000000E+00 3.95883840E-03 1.16374589E-08-2.05110095E-05 +-6.03816778E-11 0.00000000E+00 1.38416010E-08 0.00000000E+00-7.18113634E-11 + 6.28135815E-03 1.19431478E-17 8.25100105E-04 1.51113240E-18 1.44049436E-02 + 0.00000000E+00 1.84923596E-03 0.00000000E+00 6.28135815E-03 1.19431478E-17 + 8.25100105E-04 1.51113240E-18 1.44049436E-02 0.00000000E+00 1.84923596E-03 + 0.00000000E+00 0.00000000E+00 1.37715204E-08 0.00000000E+00 7.16091402E-11 +-3.91451593E-03 1.15836412E-08-2.03831153E-05 6.02263797E-11 1.75205353E-03 + 0.00000000E+00 7.45517145E-04-1.93232118E-18 1.13274191E-01 0.00000000E+00 + 3.10764326E-02-5.37289317E-17 0.00000000E+00 1.38416010E-08 0.00000000E+00 +-7.18113634E-11-3.95883840E-03 1.16374589E-08 2.05110095E-05-6.03816778E-11 + 1.44049436E-02 0.00000000E+00 1.84923596E-03 0.00000000E+00 6.28135815E-03 +-1.19431478E-17 8.25100105E-04-1.51113240E-18 8.83893766E-01 0.00000000E+00 + 1.07740344E-01 0.00000000E+00 2.48880130E-01-4.69783448E-16 3.11438266E-02 +-7.00789299E-17 \ No newline at end of file diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dfgmr.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dfgmr.c new file mode 100644 index 0000000..dd7adff --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dfgmr.c @@ -0,0 +1,298 @@ + +/*! @file dfgmr.c + * \brief flexible GMRES from ITSOL developed by Yousef Saad. + */ + +/* ITSOL COPYRIGHT + +Copyright (C) 2006, the University of Minnesota + +ITSOL 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 [version 2 of the License, or any later version] +For details, see + +http://www.gnu.org/copyleft/gpl.html + +A copy of the GNU licencing agreement is attached to the ITSOL package +in the file GNU. For additional information contact the Free Software +Foundation Inc., 65 Mass Ave, Cambridge, MA 02139, USA. + +DISCLAIMER +---------- + +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. + +For information on ITSOL contact saad@cs.umn.edu +*/ + +#include "slu_ddefs.h" + +#define epsmac 1.0e-16 + +extern double ddot_(int *, double [], int *, double [], int *); +extern double dnrm2_(int *, double [], int *); + + +int dfgmr(int n, + void (*dmatvec) (double, double[], double, double[]), + void (*dpsolve) (int, double[], double[]), + double *rhs, double *sol, double tol, int im, int *itmax, FILE * fits) +{ +/*---------------------------------------------------------------------- +| *** Preconditioned FGMRES *** ++----------------------------------------------------------------------- +| This is a simple version of the ARMS preconditioned FGMRES algorithm. ++----------------------------------------------------------------------- +| Y. S. Dec. 2000. -- Apr. 2008 ++----------------------------------------------------------------------- +| on entry: +|---------- +| +| rhs = real vector of length n containing the right hand side. +| sol = real vector of length n containing an initial guess to the +| solution on input. +| tol = tolerance for stopping iteration +| im = Krylov subspace dimension +| (itmax) = max number of iterations allowed. +| fits = NULL: no output +| != NULL: file handle to output " resid vs time and its" +| +| on return: +|---------- +| fgmr int = 0 --> successful return. +| int = 1 --> convergence not achieved in itmax iterations. +| sol = contains an approximate solution (upon successful return). +| itmax = has changed. It now contains the number of steps required +| to converge -- ++----------------------------------------------------------------------- +| internal work arrays: +|---------- +| vv = work array of length [im+1][n] (used to store the Arnoldi +| basis) +| hh = work array of length [im][im+1] (Householder matrix) +| z = work array of length [im][n] to store preconditioned vectors ++----------------------------------------------------------------------- +| subroutines called : +| matvec - matrix-vector multiplication operation +| psolve - (right) preconditionning operation +| psolve can be a NULL pointer (GMRES without preconditioner) ++---------------------------------------------------------------------*/ + + int maxits = *itmax; + int i, i1, ii, j, k, k1, its, retval, i_1 = 1, i_2 = 2; + double beta, eps1 = 0.0, t, t0, gam; + double **hh, *c, *s, *rs; + double **vv, **z, tt; + double zero = 0.0; + double one = 1.0; + + its = 0; + vv = (double **)SUPERLU_MALLOC((im + 1) * sizeof(double *)); + for (i = 0; i <= im; i++) vv[i] = doubleMalloc(n); + z = (double **)SUPERLU_MALLOC(im * sizeof(double *)); + hh = (double **)SUPERLU_MALLOC(im * sizeof(double *)); + for (i = 0; i < im; i++) + { + hh[i] = doubleMalloc(i + 2); + z[i] = doubleMalloc(n); + } + c = doubleMalloc(im); + s = doubleMalloc(im); + rs = doubleMalloc(im + 1); + + /*---- outer loop starts here ----*/ + do + { + /*---- compute initial residual vector ----*/ + dmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + beta = dnrm2_(&n, vv[0], &i_1); + + /*---- print info if fits != null ----*/ + if (fits != NULL && its == 0) + fprintf(fits, "%8d %10.2e\n", its, beta); + /*if ( beta <= tol * dnrm2_(&n, rhs, &i_1) )*/ + if ( !(beta > tol * dnrm2_(&n, rhs, &i_1)) ) + break; + t = 1.0 / beta; + + /*---- normalize: vv[0] = vv[0] / beta ----*/ + for (j = 0; j < n; j++) + vv[0][j] = vv[0][j] * t; + if (its == 0) + eps1 = tol * beta; + + /*---- initialize 1-st term of rhs of hessenberg system ----*/ + rs[0] = beta; + for (i = 0; i < im; i++) + { + its++; + i1 = i + 1; + + /*------------------------------------------------------------ + | (Right) Preconditioning Operation z_{j} = M^{-1} v_{j} + +-----------------------------------------------------------*/ + if (dpsolve) + dpsolve(n, z[i], vv[i]); + else + dcopy_(&n, vv[i], &i_1, z[i], &i_1); + + /*---- matvec operation w = A z_{j} = A M^{-1} v_{j} ----*/ + dmatvec(one, z[i], zero, vv[i1]); + + /*------------------------------------------------------------ + | modified gram - schmidt... + | h_{i,j} = (w,v_{i}) + | w = w - h_{i,j} v_{i} + +------------------------------------------------------------*/ + t0 = dnrm2_(&n, vv[i1], &i_1); + for (j = 0; j <= i; j++) + { + double negt; + tt = ddot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] = tt; + negt = -tt; + daxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + + /*---- h_{j+1,j} = ||w||_{2} ----*/ + t = dnrm2_(&n, vv[i1], &i_1); + while (t < 0.5 * t0) + { + t0 = t; + for (j = 0; j <= i; j++) + { + double negt; + tt = ddot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] += tt; + negt = -tt; + daxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + t = dnrm2_(&n, vv[i1], &i_1); + } + + hh[i][i1] = t; + + if (t != 0.0) + { + /*---- v_{j+1} = w / h_{j+1,j} ----*/ + t = 1.0 / t; + for (k = 0; k < n; k++) + vv[i1][k] = vv[i1][k] * t; + } + /*--------------------------------------------------- + | done with modified gram schimdt and arnoldi step + | now update factorization of hh + +--------------------------------------------------*/ + + /*-------------------------------------------------------- + | perform previous transformations on i-th column of h + +-------------------------------------------------------*/ + for (k = 1; k <= i; k++) + { + k1 = k - 1; + tt = hh[i][k1]; + hh[i][k1] = c[k1] * tt + s[k1] * hh[i][k]; + hh[i][k] = -s[k1] * tt + c[k1] * hh[i][k]; + } + + gam = sqrt(pow(hh[i][i], 2) + pow(hh[i][i1], 2)); + + /*--------------------------------------------------- + | if gamma is zero then any small value will do + | affect only residual estimate + +--------------------------------------------------*/ + /* if (gam == 0.0) gam = epsmac; */ + + /*---- get next plane rotation ---*/ + if (gam == 0.0) + { + c[i] = one; + s[i] = zero; + } + else + { + c[i] = hh[i][i] / gam; + s[i] = hh[i][i1] / gam; + } + + rs[i1] = -s[i] * rs[i]; + rs[i] = c[i] * rs[i]; + + /*---------------------------------------------------- + | determine residual norm and test for convergence + +---------------------------------------------------*/ + hh[i][i] = c[i] * hh[i][i] + s[i] * hh[i][i1]; + beta = fabs(rs[i1]); + if (fits != NULL) + fprintf(fits, "%8d %10.2e\n", its, beta); + if (beta <= eps1 || its >= maxits) + break; + } + + if (i == im) i--; + + /*---- now compute solution. 1st, solve upper triangular system ----*/ + rs[i] = rs[i] / hh[i][i]; + + for (ii = 1; ii <= i; ii++) + { + k = i - ii; + k1 = k + 1; + tt = rs[k]; + for (j = k1; j <= i; j++) + tt = tt - hh[j][k] * rs[j]; + rs[k] = tt / hh[k][k]; + } + + /*---- linear combination of v[i]'s to get sol. ----*/ + for (j = 0; j <= i; j++) + { + tt = rs[j]; + for (k = 0; k < n; k++) + sol[k] += tt * z[j][k]; + } + + /* calculate the residual and output */ + dmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + + /*---- print info if fits != null ----*/ + beta = dnrm2_(&n, vv[0], &i_1); + + /*---- restart outer loop if needed ----*/ + /*if (beta >= eps1 / tol)*/ + if ( !(beta < eps1 / tol) ) + { + its = maxits + 10; + break; + } + if (beta <= eps1) + break; + } while(its < maxits); + + retval = (its >= maxits); + for (i = 0; i <= im; i++) + SUPERLU_FREE(vv[i]); + SUPERLU_FREE(vv); + for (i = 0; i < im; i++) + { + SUPERLU_FREE(hh[i]); + SUPERLU_FREE(z[i]); + } + SUPERLU_FREE(hh); + SUPERLU_FREE(z); + SUPERLU_FREE(c); + SUPERLU_FREE(s); + SUPERLU_FREE(rs); + + *itmax = its; + + return retval; +} /*----end of fgmr ----*/ diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/ditersol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/ditersol.c new file mode 100644 index 0000000..e819daf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/ditersol.c @@ -0,0 +1,315 @@ + +#include "slu_ddefs.h" +/* + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Laboratory + * November, 2010 + */ + +int *GLOBAL_PERM_C, *GLOBAL_PERM_R; +SuperMatrix *GLOBAL_A, *GLOBAL_L, *GLOBAL_U; +SuperLUStat_t *GLOBAL_STAT; + +void dmatvec_mult(double alpha, double x[], double beta, double y[]) +{ + SuperMatrix *A = GLOBAL_A; + + sp_dgemv("N", alpha, A, x, 1, beta, y, 1); +} + +void dpsolve(int n, double x[], double y[]) +{ + extern void dcopy_(int *, double [], int *, double [], int *); + + int i_1 = 1; + SuperMatrix *L = GLOBAL_L, *U = GLOBAL_U; + SuperLUStat_t *stat = GLOBAL_STAT; + int *perm_c = GLOBAL_PERM_C, *perm_r = GLOBAL_PERM_R; + int info; + static DNformat X; + static SuperMatrix XX = {SLU_DN, SLU_D, SLU_GE, 1, 1, &X}; + + dcopy_(&n, y, &i_1, x, &i_1); + XX.nrow = n; + X.lda = n; + X.nzval = x; + dgstrs(NOTRANS, L, U, perm_c, perm_r, &XX, stat, &info); +} + +int main(int argc, char *argv[]) +{ + void dmatvec_mult(double alpha, double x[], double beta, double y[]); + void dpsolve(int n, double x[], double y[]); + extern int dfgmr( int n, + void (*matvec_mult)(double, double [], double, double []), + void (*psolve)(int n, double [], double[]), + double *rhs, double *sol, double tol, int restrt, int *itmax, + FILE *fits); + extern int dfill_diag(int n, NCformat *Astore); + + char equed[1] = {'B'}; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + double *a; + int *asub, *xa; + int *etree; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int nrhs, ldx, lwork, info, m, n, nnz; + double *rhsb, *rhsx, *xact; + double *work = NULL; + double *R, *C; + double u, rpg, rcond; + double zero = 0.0; + double one = 1.0; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + + int restrt, iter, maxit, i; + double resid; + double *x, *b; + +#ifdef DEBUG + extern int num_drop_L, num_drop_U; +#endif + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 0.1; /* u=1.0 for complete factorization */ + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 0.1; //different from complete LU + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + options.RowPerm = LargeDiag; + options.ILU_DropTol = 1e-4; + options.ILU_FillTol = 1e-2; + options.ILU_FillFactor = 10.0; + options.ILU_DropRule = DROP_BASIC | DROP_AREA; + options.ILU_Norm = INF_NORM; + options.ILU_MILU = SILU; + */ + ilu_set_default_options(&options); + + /* Modify the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) ABORT("Malloc fails for work[]."); + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + if (argc < 2) + { + printf("Usage:\n%s [OPTION] < [INPUT] > [OUTPUT]\nOPTION:\n" + "-h -hb:\n\t[INPUT] is a Harwell-Boeing format matrix.\n" + "-r -rb:\n\t[INPUT] is a Rutherford-Boeing format matrix.\n" + "-t -triplet:\n\t[INPUT] is a triplet format matrix.\n", + argv[0]); + return 0; + } + else + { + switch (argv[1][1]) + { + case 'H': + case 'h': + printf("Input a Harwell-Boeing format matrix:\n"); + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'R': + case 'r': + printf("Input a Rutherford-Boeing format matrix:\n"); + dreadrb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'T': + case 't': + printf("Input a triplet format matrix:\n"); + dreadtriple(&m, &n, &nnz, &a, &asub, &xa); + break; + default: + printf("Unrecognized format.\n"); + return 0; + } + } + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + dfill_diag(n, Astore); + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + fflush(stdout); + + if ( !(rhsb = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + + info = 0; +#ifdef DEBUG + num_drop_L = 0; + num_drop_U = 0; +#endif + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Compute the incomplete factorization and compute the condition number + and pivot growth using dgsisx. */ + dgsisx(&options, &A, perm_c, perm_r, etree, equed, R, C, &L, &U, work, + lwork, &B, &X, &rpg, &rcond, &mem_usage, &stat, &info); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("dgsisx(): info %d\n", info); + if (info > 0 || rcond < 1e-8 || rpg > 1e8) + printf("WARNING: This preconditioner might be unstable.\n"); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + printf("n(A) = %d, nnz(A) = %d\n", n, Astore->nnz); + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("Fill ratio: nnz(F)/nnz(A) = %.3f\n", + ((double)(Lstore->nnz) + (double)(Ustore->nnz) - (double)n) + / (double)Astore->nnz); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + /* Set the global variables. */ + GLOBAL_A = &A; + GLOBAL_L = &L; + GLOBAL_U = &U; + GLOBAL_STAT = &stat; + GLOBAL_PERM_C = perm_c; + GLOBAL_PERM_R = perm_r; + + /* Set the variables used by GMRES. */ + restrt = SUPERLU_MIN(n / 3 + 1, 50); + maxit = 1000; + iter = maxit; + resid = 1e-8; + if (!(b = doubleMalloc(m))) ABORT("Malloc fails for b[]."); + if (!(x = doubleMalloc(n))) ABORT("Malloc fails for x[]."); + + if (info <= n + 1) + { + int i_1 = 1; + double maxferr = 0.0, nrmA, nrmB, res, t; + double temp; + extern double dnrm2_(int *, double [], int *); + extern void daxpy_(int *, double *, double [], int *, double [], int *); + + /* Call GMRES. */ + for (i = 0; i < n; i++) b[i] = rhsb[i]; + for (i = 0; i < n; i++) x[i] = zero; + + t = SuperLU_timer_(); + + dfgmr(n, dmatvec_mult, dpsolve, b, x, resid, restrt, &iter, stdout); + + t = SuperLU_timer_() - t; + + /* Output the result. */ + nrmA = dnrm2_(&(Astore->nnz), (double *)((DNformat *)A.Store)->nzval, + &i_1); + nrmB = dnrm2_(&m, b, &i_1); + sp_dgemv("N", -1.0, &A, x, 1, 1.0, b, 1); + res = dnrm2_(&m, b, &i_1); + resid = res / nrmB; + printf("||A||_F = %.1e, ||B||_2 = %.1e, ||B-A*X||_2 = %.1e, " + "relres = %.1e\n", nrmA, nrmB, res, resid); + + if (iter >= maxit) + { + if (resid >= 1.0) iter = -180; + else if (resid > 1e-8) iter = -111; + } + printf("iteration: %d\nresidual: %.1e\nGMRES time: %.2f seconds.\n", + iter, resid, t); + + /* Scale the solution back if equilibration was performed. */ + if (*equed == 'C' || *equed == 'B') + for (i = 0; i < n; i++) x[i] *= C[i]; + + for (i = 0; i < m; i++) { + maxferr = SUPERLU_MAX(maxferr, fabs(x[i] - xact[i])); + } + printf("||X-X_true||_oo = %.1e\n", maxferr); + } +#ifdef DEBUG + printf("%d entries in L and %d entries in U dropped.\n", + num_drop_L, num_drop_U); +#endif + fflush(stdout); + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork >= 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + SUPERLU_FREE(b); + SUPERLU_FREE(x); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol.c new file mode 100644 index 0000000..00a457e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol.c @@ -0,0 +1,115 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + double *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + double *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Read the matrix in Harwell-Boeing format. */ + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + dgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + dinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + dQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("dgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + dQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol1.c new file mode 100644 index 0000000..3de8515 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsol1.c @@ -0,0 +1,157 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + double *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + double *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Now we modify the default options to use the symmetric mode. */ + options.SymmetricMode = YES; + options.ColPerm = MMD_AT_PLUS_A; + options.DiagPivotThresh = 0.001; + +#if 1 + /* Read matrix A from a file in Harwell-Boeing format.*/ + if (argc < 2) + { + printf("Usage:\n%s [OPTION] < [INPUT] > [OUTPUT]\nOPTION:\n" + "-h -hb:\n\t[INPUT] is a Harwell-Boeing format matrix.\n" + "-r -rb:\n\t[INPUT] is a Rutherford-Boeing format matrix.\n" + "-t -triplet:\n\t[INPUT] is a triplet format matrix.\n", + argv[0]); + return 0; + } + else + { + switch (argv[1][1]) + { + case 'H': + case 'h': + printf("Input a Harwell-Boeing format matrix:\n"); + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'R': + case 'r': + printf("Input a Rutherford-Boeing format matrix:\n"); + dreadrb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'T': + case 't': + printf("Input a triplet format matrix:\n"); + dreadtriple(&m, &n, &nnz, &a, &asub, &xa); + break; + default: + printf("Unrecognized format.\n"); + return 0; + } + } +#else + /* Read the matrix in Harwell-Boeing format. */ + dreadhb(&m, &n, &nnz, &a, &asub, &xa); +#endif + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + dgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + dinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + dQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("dgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + dQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx.c new file mode 100644 index 0000000..fe91402 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx.c @@ -0,0 +1,212 @@ + +/* + * -- SuperLU routine (version 3.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * August 1, 2008 + * + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + double *a; + int *asub, *xa; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + double *rhsb, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + /* Add more functionalities that the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + options.IterRefine = DOUBLE; /* Perform double-precision refinement */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Solve the system and compute the condition number + and error bounds using dgssvx. */ + + dgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("dgssvx(): info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + if ( options.IterRefine != NOREFINE ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + + +/* + * Parse command line inputs. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx1.c new file mode 100644 index 0000000..a907d92 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx1.c @@ -0,0 +1,241 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program DLINSOLX1. + * + * This example illustrates how to use DGSSVX to solve systems with the same + * A but different right-hand side. + * In this case, we factorize A only once in the first call to DGSSVX, + * and reuse the following data structures in the subsequent call to DGSSVX: + * perm_c, perm_r, R, C, L, U. + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + double *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + double *rhsb, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default values for options argument: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ONLY PERFORM THE LU DECOMPOSITION */ + B.ncol = 0; /* Indicate not to solve the system */ + dgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("LU factorization: dgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + /* ------------------------------------------------------------ + NOW WE SOLVE THE LINEAR SYSTEM USING THE FACTORED FORM OF A. + ------------------------------------------------------------*/ + options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ + B.ncol = nrhs; /* Set the number of right-hand side */ + + /* Initialize the statistics variables. */ + StatInit(&stat); + + dgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("Triangular solve: dgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) X.Store)->nzval; + + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx2.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx2.c new file mode 100644 index 0000000..367b5e6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dlinsolx2.c @@ -0,0 +1,277 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program DLINSOLX2. + * + * This example illustrates how to use DGSSVX to solve systems repeatedly + * with the same sparsity pattern of matrix A. + * In this case, the column permutation vector perm_c is computed once. + * The following data structures will be reused in the subsequent call to + * DGSSVX: perm_c, etree + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, A1, L, U; + SuperMatrix B, B1, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + double *a, *a1; + int *asub, *xa, *asub1, *xa1; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, j, m, n, nnz; + double *rhsb, *rhsb1, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + if ( !(a1 = doubleMalloc(nnz)) ) ABORT("Malloc fails for a1[]."); + if ( !(asub1 = intMalloc(nnz)) ) ABORT("Malloc fails for asub1[]."); + if ( !(xa1 = intMalloc(n+1)) ) ABORT("Malloc fails for xa1[]."); + for (i = 0; i < nnz; ++i) { + a1[i] = a[i]; + asub1[i] = asub[i]; + } + for (i = 0; i < n+1; ++i) xa1[i] = xa[i]; + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsb1 = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb1[]."); + if ( !(rhsx = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + dCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + ldx = n; + dGenXtrue(n, nrhs, xact, ldx); + dFillRHS(trans, nrhs, xact, ldx, &A, &B); + for (j = 0; j < nrhs; ++j) + for (i = 0; i < m; ++i) rhsb1[i+j*m] = rhsb[i+j*m]; + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ------------------------------------------------------------ + WE SOLVE THE LINEAR SYSTEM FOR THE FIRST TIME: AX = B + ------------------------------------------------------------*/ + dgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("First system: dgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + Destroy_CompCol_Matrix(&A); + Destroy_Dense_Matrix(&B); + if ( lwork >= 0 ) { /* Deallocate storage associated with L and U. */ + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + /* ------------------------------------------------------------ + NOW WE SOLVE ANOTHER LINEAR SYSTEM: A1*X = B1 + ONLY THE SPARSITY PATTERN OF A1 IS THE SAME AS THAT OF A. + ------------------------------------------------------------*/ + options.Fact = SamePattern; + StatInit(&stat); /* Initialize the statistics variables. */ + + dCreate_CompCol_Matrix(&A1, m, n, nnz, a1, asub1, xa1, + SLU_NC, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&B1, m, nrhs, rhsb1, m, SLU_DN, SLU_D, SLU_GE); + + dgssvx(&options, &A1, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B1, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("\nSecond system: dgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + double *sol = (double*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A1); + Destroy_Dense_Matrix(&B1); + Destroy_Dense_Matrix(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dreadtriple.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dreadtriple.c new file mode 100644 index 0000000..933e3bf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/dreadtriple.c @@ -0,0 +1,118 @@ +#include +#include "slu_ddefs.h" +#include "slu_util.h" + + +void +dreadtriple(int *m, int *n, int *nonz, + double **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int i, j, k, jsize, lasta, nnz, nz; + double *a, *val; + int *asub, *xa, *row, *col; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d", n, nonz); + *m = *n; + printf("m %d, n %d, nonz %d\n", *m, *n, *nonz); + dallocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (double *) SUPERLU_MALLOC(*nonz * sizeof(double)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + for (j = 0; j < *n; ++j) xa[j] = 0; + + /* Read into the triplet array from a file */ + for (nnz = 0, nz = 0; nnz < *nonz; ++nnz) { + scanf("%d%d%lf\n", &row[nz], &col[nz], &val[nz]); + /* Change to 0-based indexing. */ +#if 0 + --row[nz]; + --col[nz]; +#endif + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n + /*|| val[nz] == 0.*/) { + fprintf(stderr, "nz %d, (%d, %d) = %e out of bound, removed\n", + nz, row[nz], col[nz], val[nz]); + exit(-1); + } else { + ++xa[col[nz]]; + ++nz; + } + } + + *nonz = nz; + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } +#endif + +} + + +void dreadrhs(int m, double *b) +{ + FILE *fp, *fopen(); + int i, j; + + if ( !(fp = fopen("b.dat", "r")) ) { + fprintf(stderr, "dreadrhs: file does not exist\n"); + exit(-1); + } + for (i = 0; i < m; ++i) + fscanf(fp, "%lf\n", &b[i]); + /*fscanf(fp, "%d%lf\n", &j, &b[i]);*/ + /* readpair_(j, &b[i]);*/ + fclose(fp); +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/fgmr.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/fgmr.c new file mode 100644 index 0000000..e9b7a45 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/fgmr.c @@ -0,0 +1,263 @@ +#include +#include +#include +#include +#include "slu_ddefs.h" + +#define epsmac 1.0e-16 +extern double ddot_(int *, double [], int *, double [], int *); +extern double dnrm2_(int *, double [], int *); +extern void daxpy_(int *, double *, double [], int *, double [], int *); +extern double dcopy_(int *, double [], int *, double [], int *); + +int fgmr(int n, + void (*matvec) (double, double[], double, double[]), + void (*psolve) (int, double[], double[]), + double *rhs, double *sol, double tol, int im, int *itmax, FILE * fits) +{ +/*---------------------------------------------------------------------- +| *** Preconditioned FGMRES *** ++----------------------------------------------------------------------- +| This is a simple version of the ARMS preconditioned FGMRES algorithm. ++----------------------------------------------------------------------- +| Y. S. Dec. 2000. -- Apr. 2008 ++----------------------------------------------------------------------- +| on entry: +|---------- +| +| rhs = real vector of length n containing the right hand side. +| sol = real vector of length n containing an initial guess to the +| solution on input. +| tol = tolerance for stopping iteration +| im = Krylov subspace dimension +| (itmax) = max number of iterations allowed. +| fits = NULL: no output +| != NULL: file handle to output " resid vs time and its" +| +| on return: +|---------- +| fgmr int = 0 --> successful return. +| int = 1 --> convergence not achieved in itmax iterations. +| sol = contains an approximate solution (upon successful return). +| itmax = has changed. It now contains the number of steps required +| to converge -- ++----------------------------------------------------------------------- +| internal work arrays: +|---------- +| vv = work array of length [im+1][n] (used to store the Arnoldi +| basis) +| hh = work array of length [im][im+1] (Householder matrix) +| z = work array of length [im][n] to store preconditioned vectors ++----------------------------------------------------------------------- +| subroutines called : +| matvec - matrix-vector multiplication operation +| psolve - (right) preconditionning operation +| psolve can be a NULL pointer (GMRES without preconditioner) ++---------------------------------------------------------------------*/ + + int maxits = *itmax; + int i, i1, ii, j, k, k1, its, retval, i_1 = 1; + double **hh, *c, *s, *rs, t, t0; + double beta, eps1 = 0.0, gam, **vv, **z; + + its = 0; + vv = (double **)SUPERLU_MALLOC((im + 1) * sizeof(double *)); + for (i = 0; i <= im; i++) + vv[i] = doubleMalloc(n); + z = (double **)SUPERLU_MALLOC(im * sizeof(double *)); + hh = (double **)SUPERLU_MALLOC(im * sizeof(double *)); + for (i = 0; i < im; i++) + { + hh[i] = doubleMalloc(i + 2); + z[i] = doubleMalloc(n); + } + c = doubleMalloc(im); + s = doubleMalloc(im); + rs = doubleMalloc(im + 1); + + /*---- outer loop starts here ----*/ + do + { + /*---- compute initial residual vector ----*/ + matvec(1.0, sol, 0.0, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + beta = dnrm2_(&n, vv[0], &i_1); + + /*---- print info if fits != null ----*/ + if (fits != NULL && its == 0) + fprintf(fits, "%8d %10.2e\n", its, beta); + /*if ( beta < tol * dnrm2_(&n, rhs, &i_1) )*/ + if ( !(beta >= tol * dnrm2_(&n, rhs, &i_1)) ) + break; + t = 1.0 / beta; + + /*---- normalize: vv[0] = vv[0] / beta ----*/ + for (j = 0; j < n; j++) + vv[0][j] = vv[0][j] * t; + if (its == 0) + eps1 = tol * beta; + + /*---- initialize 1-st term of rhs of hessenberg system ----*/ + rs[0] = beta; + for (i = 0; i < im; i++) + { + its++; + i1 = i + 1; + + /*------------------------------------------------------------ + | (Right) Preconditioning Operation z_{j} = M^{-1} v_{j} + +-----------------------------------------------------------*/ + if (psolve) + psolve(n, z[i], vv[i]); + else + dcopy_(&n, vv[i], &i_1, z[i], &i_1); + + /*---- matvec operation w = A z_{j} = A M^{-1} v_{j} ----*/ + matvec(1.0, z[i], 0.0, vv[i1]); + + /*------------------------------------------------------------ + | modified gram - schmidt... + | h_{i,j} = (w,v_{i}) + | w = w - h_{i,j} v_{i} + +------------------------------------------------------------*/ + t0 = dnrm2_(&n, vv[i1], &i_1); + for (j = 0; j <= i; j++) + { + double negt; + t = ddot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] = t; + negt = -t; + daxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + + /*---- h_{j+1,j} = ||w||_{2} ----*/ + t = dnrm2_(&n, vv[i1], &i_1); + while (t < 0.5 * t0) + { + t0 = t; + for (j = 0; j <= i; j++) + { + double negt; + t = ddot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] += t; + negt = -t; + daxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + t = dnrm2_(&n, vv[i1], &i_1); + } + hh[i][i1] = t; + if (t != 0.0) + { + /*---- v_{j+1} = w / h_{j+1,j} ----*/ + t = 1.0 / t; + for (k = 0; k < n; k++) + vv[i1][k] = vv[i1][k] * t; + } + /*--------------------------------------------------- + | done with modified gram schimdt and arnoldi step + | now update factorization of hh + +--------------------------------------------------*/ + + /*-------------------------------------------------------- + | perform previous transformations on i-th column of h + +-------------------------------------------------------*/ + for (k = 1; k <= i; k++) + { + k1 = k - 1; + t = hh[i][k1]; + hh[i][k1] = c[k1] * t + s[k1] * hh[i][k]; + hh[i][k] = -s[k1] * t + c[k1] * hh[i][k]; + } + gam = sqrt(pow(hh[i][i], 2) + pow(hh[i][i1], 2)); + + /*--------------------------------------------------- + | if gamma is zero then any small value will do + | affect only residual estimate + +--------------------------------------------------*/ + /* if (gam == 0.0) gam = epsmac; */ + + /*---- get next plane rotation ---*/ + if (gam > 0.0) + { + c[i] = hh[i][i] / gam; + s[i] = hh[i][i1] / gam; + } + else + { + c[i] = 1.0; + s[i] = 0.0; + } + rs[i1] = -s[i] * rs[i]; + rs[i] = c[i] * rs[i]; + + /*---------------------------------------------------- + | determine residual norm and test for convergence + +---------------------------------------------------*/ + hh[i][i] = c[i] * hh[i][i] + s[i] * hh[i][i1]; + beta = fabs(rs[i1]); + if (fits != NULL) + fprintf(fits, "%8d %10.2e\n", its, beta); + if (beta <= eps1 || its >= maxits) + break; + } + + if (i == im) i--; + /*---- now compute solution. 1st, solve upper triangular system ----*/ + rs[i] = rs[i] / hh[i][i]; + for (ii = 1; ii <= i; ii++) + { + k = i - ii; + k1 = k + 1; + t = rs[k]; + for (j = k1; j <= i; j++) + t = t - hh[j][k] * rs[j]; + rs[k] = t / hh[k][k]; + } + + /*---- linear combination of v[i]'s to get sol. ----*/ + for (j = 0; j <= i; j++) + { + t = rs[j]; + for (k = 0; k < n; k++) + sol[k] += t * z[j][k]; + } + + /* calculate the residual and output */ + matvec(1.0, sol, 0.0, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + + /*---- print info if fits != null ----*/ + beta = dnrm2_(&n, vv[0], &i_1); + + /*---- restart outer loop if needed ----*/ + /*if (beta >= eps1 / tol)*/ + if ( !(beta < eps1 / tol) ) + { + its = maxits + 10; + break; + } + if (beta <= eps1) + break; + } while(its < maxits); + + retval = (its >= maxits); + for (i = 0; i <= im; i++) + SUPERLU_FREE(vv[i]); + SUPERLU_FREE(vv); + for (i = 0; i < im; i++) + { + SUPERLU_FREE(hh[i]); + SUPERLU_FREE(z[i]); + } + SUPERLU_FREE(hh); + SUPERLU_FREE(z); + SUPERLU_FREE(c); + SUPERLU_FREE(s); + SUPERLU_FREE(rs); + + *itmax = its; + + return retval; +} /*----end of fgmr ----*/ diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10 b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10 new file mode 100644 index 0000000..09e1441 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10 @@ -0,0 +1,146 @@ +10x10 grid, with COLMMD order + 145 11 39 92 0 +RUA 100 100 460 0 +(10I8) (12I6) (5E16.8) + 1 6 10 13 17 22 26 30 35 40 + 45 50 55 60 65 70 75 79 83 88 + 92 95 99 103 108 112 117 122 127 131 + 136 140 145 150 155 160 165 169 173 176 + 180 184 188 193 197 202 207 211 215 220 + 225 230 235 239 242 246 251 255 259 264 + 269 274 279 284 289 294 299 303 307 312 + 317 322 327 332 337 342 347 352 356 360 + 365 370 374 379 384 389 394 399 404 409 + 413 417 422 427 432 437 442 447 452 457 + 461 + 46 55 56 57 66 60 69 70 80 90 99 100 + 89 98 99 100 79 88 89 90 99 80 89 90 + 100 70 79 80 90 69 78 79 80 89 78 87 + 88 89 98 59 68 69 70 79 68 77 78 79 + 88 58 67 68 69 78 67 76 77 78 87 57 + 66 67 68 77 47 56 57 58 67 34 43 44 + 45 54 85 94 95 96 86 95 96 97 75 84 + 85 86 95 51 61 62 71 81 91 92 82 91 + 92 93 71 81 82 91 62 71 72 73 82 61 + 71 72 81 72 81 82 83 92 52 61 62 63 + 72 63 72 73 74 83 84 93 94 95 74 83 + 84 85 94 83 92 93 94 73 82 83 84 93 + 64 73 74 75 84 53 62 63 64 73 43 52 + 53 54 63 54 63 64 65 74 4 5 6 15 + 5 6 7 16 1 2 11 1 2 3 12 21 + 31 32 41 1 11 12 21 12 21 22 23 32 + 11 21 22 31 2 11 12 13 22 3 12 13 + 14 23 2 3 4 13 3 4 5 14 4 13 + 14 15 24 5 14 15 16 25 13 22 23 24 + 33 22 31 32 33 42 30 39 40 50 9 10 + 20 8 9 10 19 9 18 19 20 29 20 29 + 30 40 10 19 20 30 19 28 29 30 39 8 + 17 18 19 28 18 27 28 29 38 29 38 39 + 40 49 17 26 27 28 37 28 37 38 39 48 + 7 16 17 18 27 6 15 16 17 26 7 8 + 9 18 6 7 8 17 15 24 25 26 35 16 + 25 26 27 36 42 51 52 53 62 24 33 34 + 35 44 14 23 24 25 34 23 32 33 34 43 + 25 34 35 36 45 32 41 42 43 52 33 42 + 43 44 53 31 41 42 51 41 51 52 61 35 + 44 45 46 55 36 45 46 47 56 50 59 60 + 70 26 35 36 37 46 27 36 37 38 47 37 + 46 47 48 57 38 47 48 49 58 48 57 58 + 59 68 39 48 49 50 59 49 58 59 60 69 + 40 49 50 60 88 97 98 99 44 53 54 55 + 64 45 54 55 56 65 55 64 65 66 75 56 + 65 66 67 76 65 74 75 76 85 66 75 76 + 77 86 76 85 86 87 96 77 86 87 88 97 + 87 96 97 98 + 1.26819336e+00 -3.12426583e-02 7.78211737e-01 2.18048355e+00 4.37813682e-01 + -3.96516210e-01 1.38880676e+00 1.36442229e+00 6.58152637e-01 -6.92971494e-01 + -8.59806235e-01 5.29038063e-01 -1.74530599e-01 9.78788421e-01 1.28955368e+00 + -5.30575045e-01 1.83403368e+00 -1.71591032e+00 8.69317059e-02 1.95567435e+00 + 1.61453770e-01 -6.28688359e-01 -1.43882447e+00 -6.65959686e-02 3.73380863e-01 + 1.39860373e-01 -7.48088838e-01 -6.28974933e-01 1.39483065e+00 4.20988804e-01 + -4.33373058e-01 7.06251990e-01 2.27856907e-01 -1.01699185e+00 8.25892307e-01 + 1.47039036e+00 -1.37890689e+00 -2.60172069e-01 9.94768173e-01 -1.58105341e+00 + 1.04902235e+00 3.02689036e-01 -1.22650234e+00 6.96000951e-02 1.33881437e+00 + 1.22229851e+00 -1.59597816e+00 -1.06773032e+00 -7.59919212e-01 -1.98499916e-01 + -1.41404614e-01 4.11267927e-01 -1.17905966e+00 -2.77775506e-01 1.93931843e+00 + -8.95840361e-01 -3.04157583e-01 5.55253123e-01 -3.24246851e-01 -9.11425420e-01 + -9.96089984e-01 1.19514263e+00 -1.59447782e-01 2.70402605e+00 1.33332898e+00 + 2.51078139e-01 -3.10470908e-01 -9.23003724e-01 -3.84775736e-01 -1.46163875e+00 + 1.55446592e+00 -5.97535384e-01 -1.21056787e+00 -7.02668798e-01 9.53355517e-01 + -1.93005494e+00 5.12844987e-01 3.93682449e-01 -9.05426500e-01 -1.27447328e+00 + 3.46546103e-01 -1.19523544e+00 8.66840733e-01 1.29184358e+00 4.34312653e-01 + -3.86206929e-01 -1.12563760e-01 9.59664371e-01 2.08759311e+00 1.52468053e+00 + -1.95260790e-01 2.17314078e-01 -1.79456822e-01 2.56729070e-02 6.42066362e-01 + 9.23086649e-01 -1.55510777e+00 6.63594033e-01 -1.64769114e+00 -2.01498584e+00 + 4.91716881e-01 -1.55497528e+00 -3.97913855e-01 8.64279576e-01 -1.77618078e-01 + 1.87438052e+00 1.72400235e-01 4.91313669e-01 8.00733701e-01 -7.67268997e-01 + 3.64419504e-01 -1.40609081e-01 2.44943669e-01 -2.67458500e-01 -5.70245480e-01 + -1.87266787e-01 1.72603158e-02 2.46340439e-01 -8.54484721e-01 1.15778270e+00 + 1.61907723e-01 1.27174349e+00 -3.53443680e-02 -1.50132884e+00 3.65373411e-01 + -1.98659856e-01 9.94299745e-01 -8.03474714e-01 -5.91204478e-01 1.69154641e+00 + -7.24410496e-01 1.19219551e+00 1.86746737e-01 1.59493888e+00 3.21307056e-01 + -6.09499611e-01 5.65239403e-01 -6.10781446e-01 1.23111147e+00 1.20855665e+00 + -6.38854660e-01 6.05540299e-01 -6.24480544e-01 5.72228122e-01 -1.38972170e+00 + 2.29327812e-01 2.71190237e-01 -3.66360220e-01 1.37696039e+00 1.55706376e+00 + -1.93543855e-01 1.65130117e+00 -1.89877818e+00 1.82252476e+00 7.65458387e-01 + -5.94524008e-01 1.30245975e-01 3.50135051e-02 -6.24674139e-01 -1.51841513e+00 + -1.05107061e+00 4.99305134e-02 -1.45474887e+00 4.66545850e-01 -3.60029626e-01 + -1.35576294e-01 -1.34933848e+00 -1.27044990e+00 9.84570273e-01 -4.48806138e-02 + -7.98944517e-01 -7.65172429e-01 1.16495351e+00 6.26839083e-01 7.50801547e-02 + 3.51606903e-01 -6.96512535e-01 1.69614248e+00 5.90597780e-02 9.68481048e-01 + 6.70291997e-01 4.20146042e-01 -2.87275127e+00 -2.04134535e-03 1.60651096e+00 + 8.47648635e-01 2.68100812e-01 3.98848528e-02 -2.48284251e+00 1.15865471e+00 + -1.02627947e+00 1.15348699e+00 6.15769628e-01 9.77894070e-01 -1.11534771e+00 + -5.50021449e-01 -9.23489086e-01 -7.04993878e-02 1.47891351e-01 -5.57093642e-01 + -3.36705699e-01 4.15227463e-01 1.55781354e+00 -2.44429890e+00 -1.09819539e+00 + 1.12264786e+00 1.79707178e+00 2.64068529e-01 8.71673289e-01 -1.44617154e+00 + -7.01165346e-01 1.24598212e+00 -6.38976995e-01 5.77350219e-01 5.81667258e-01 + -2.71354296e-01 4.14191307e-01 -9.77814227e-01 -1.02146617e+00 3.17687980e-01 + 1.51610780e+00 7.49432453e-01 -5.07700387e-01 8.85299448e-01 -7.86456613e-01 + 6.34808588e-01 8.20409762e-01 -1.76026510e-01 5.62473875e-01 1.68587408e+00 + 2.79245535e-02 -9.02030581e-01 -2.05325749e+00 8.90862977e-02 -1.04842345e+00 + 4.22723685e-01 -8.44414378e-01 -3.11629756e-01 -3.22939921e-01 3.17987916e-01 + -5.11172208e-01 1.12516182e+00 7.28641592e-01 -2.37745429e+00 -2.73782416e-01 + 3.49733203e-02 -1.80786206e+00 1.02819255e+00 3.94600309e-01 6.39405642e-01 + -7.59696649e-01 -6.74720856e-01 -1.17168719e+00 2.03293002e+00 8.74212895e-01 + 1.75240173e+00 -3.20050826e-01 -1.37413808e-01 2.92314877e-01 2.56591024e+00 + -4.57815644e-01 -1.61082701e+00 -2.66952378e+00 7.03144053e-01 -5.24115850e-02 + 2.01849612e+00 9.24159405e-01 -1.81411470e+00 4.38705098e-01 -1.24734432e+00 + 3.24666917e-01 3.90070410e-01 -4.05138317e-01 -3.68411285e-01 1.14789528e+00 + 4.14302603e-02 -1.09804965e+00 1.56672375e+00 4.99520851e-01 -1.05537507e+00 + -4.50743203e-01 1.27037824e+00 8.98693601e-01 8.74127225e-01 7.61126995e-01 + -1.65923455e-01 3.00907437e-01 -3.22467327e-01 5.62147834e-01 -1.06392289e+00 + 3.51588948e-01 1.13299993e+00 1.49994248e-01 -2.48093553e-01 -7.26249000e-01 + -4.45040301e-01 -6.12911120e-01 -2.09144085e-01 7.56218970e-01 4.00486023e-01 + -1.34138072e+00 3.75041024e-01 8.61734897e-01 -5.62251244e-02 5.13478174e-01 + 3.96680866e-01 -6.20214209e-01 2.37148765e-01 -1.58684699e+00 -4.01484810e-01 + -7.70692269e-01 -2.62680506e-01 9.76489544e-01 9.77815041e-01 1.17002111e+00 + 1.59310862e-01 1.83613203e+00 -3.82918259e-01 1.55082745e-01 -9.64648249e-01 + 3.87564313e-02 -1.52762265e+00 9.64938959e-01 5.26162503e-01 -1.84454117e-01 + 1.98782828e-01 -1.27442875e-01 5.54171561e-01 -1.09734432e+00 -7.31301400e-01 + 1.40473192e+00 2.08709913e+00 3.65118460e-01 8.46105526e-01 -1.84537657e-01 + 1.03071442e+00 1.59042684e+00 3.21916399e-02 8.89163671e-01 -1.29915249e+00 + 1.18257310e+00 -2.21360782e-01 1.66494939e-02 -1.19236124e+00 -1.31646297e-01 + 1.48752430e+00 -8.36821231e-01 -1.30098190e+00 1.57413186e+00 1.16603996e+00 + 7.86429695e-01 3.97810484e-01 1.04978596e+00 -3.40795563e-01 3.36296999e-01 + 8.99883574e-01 -2.00898856e-01 -2.33734975e-01 1.44990660e+00 3.56429388e-01 + 6.52635669e-01 2.15671161e-01 -2.63896186e-01 1.80244024e+00 -6.42984172e-01 + 1.09555050e-01 -7.19037696e-01 4.20627573e-01 -1.93113369e+00 3.20690754e+00 + 5.36007045e-01 2.98450536e-01 2.84043161e-01 1.81747171e+00 -5.84302130e-01 + -1.01067382e+00 -9.60498312e-01 6.91159584e-01 -7.58618207e-01 -9.69717328e-02 + -1.40694905e+00 1.03081246e+00 -7.59874404e-01 6.60299785e-01 -1.10250960e+00 + -1.02970645e-01 -1.05980154e+00 -1.23856594e+00 -1.88923606e+00 -9.73584554e-01 + 2.12115839e-01 4.93441991e-01 1.54717659e+00 1.15818057e+00 8.62500188e-01 + -1.03470562e+00 -1.92672883e-01 -1.29972278e+00 6.44932748e-01 -2.14835899e+00 + -1.02884453e+00 -1.41582116e-01 -2.52670612e+00 3.06595916e-01 9.68992176e-01 + -7.47317127e-01 -2.79602442e+00 6.96731554e-01 -3.12981493e-01 -5.93617619e-01 + 3.32322162e-01 5.58850703e-01 -9.14800738e-01 -5.14012560e-01 1.89626061e+00 + -2.53229992e-01 -5.39775241e-01 1.87995711e+00 -1.00384945e+00 -4.97445878e-01 + -1.50439715e+00 -9.54492989e-02 3.96727054e-01 -5.27114908e-01 3.44571056e-01 + -7.23290526e-01 5.45436841e-01 1.32031907e+00 -4.04494328e-01 4.18468509e-01 + 2.47348750e-01 7.04110315e-01 6.31938853e-01 -9.92362113e-01 1.76670837e+00 + -3.82103635e-01 -7.97532757e-01 -9.36740612e-01 -2.43346549e-03 3.96086166e-01 + -5.08693172e-01 -2.68285779e-01 -1.08214045e+00 2.01413372e+00 1.94403113e+00 + -1.52152942e+00 -9.64333079e-01 -2.05725119e+00 1.49996068e-01 5.42037571e-01 + 2.54408816e-01 -3.07240694e-01 -4.17111830e-01 1.13680483e+00 3.91313809e-01 + 1.60514782e+00 6.67201442e-01 -6.77937746e-02 -1.73566011e+00 8.06348573e-01 diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10.out b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10.out new file mode 100644 index 0000000..73f80f6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/g10.out @@ -0,0 +1,88 @@ +==2847== Memcheck, a memory error detector. +==2847== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. +==2847== Using LibVEX rev 1804, a library for dynamic binary translation. +==2847== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. +==2847== Using valgrind-3.3.0-Debian, a dynamic binary instrumentation framework. +==2847== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. +==2847== For more details, rerun with: -v +==2847== +Input a Harwell-Boeing format matrix: +10x10 grid, with COLMMD order +Dimension 100x100; # nonzeros 559 +==2847== Use of uninitialised value of size 8 +==2847== at 0x40F8E1: ilu_ddrop_row (ilu_ddrop_row.c:182) +==2847== by 0x40D30E: dgsitrf (dgsitrf.c:335) +==2847== by 0x40C25E: dgsisx (dgsisx.c:615) +==2847== by 0x401D93: main (ditersol.c:194) +==2847== +==2847== Use of uninitialised value of size 8 +==2847== at 0x40F8E1: ilu_ddrop_row (ilu_ddrop_row.c:182) +==2847== by 0x40E5AC: dgsitrf (dgsitrf.c:549) +==2847== by 0x40C25E: dgsisx (dgsisx.c:615) +==2847== by 0x401D93: main (ditersol.c:194) +new quota = 10, iwork size for initilization = 9 +new quota = 10, iwork size for initilization = 8 +new quota = 7, iwork size for initilization = 6 +new quota = 10, iwork size for initilization = 8 +new quota = 4, iwork size for initilization = 4 +new quota = 14, iwork size for initilization = 14 +new quota = 5, iwork size for initilization = 12 +new quota = 5, iwork size for initilization = 12 +new quota = 4, iwork size for initilization = 15 +new quota = 6, iwork size for initilization = 9 +new quota = 4, iwork size for initilization = 15 +new quota = 5, iwork size for initilization = 7 +new quota = 2, iwork size for initilization = 4 +new quota = 4, iwork size for initilization = 14 +dgsisx(): info 0 +Recip. pivot growth = 2.557034e-01 +Recip. condition number = 1.254455e-04 +n(A) = 100, nnz(A) = 559 +No of nonzeros in factor L = 617 +No of nonzeros in factor U = 773 +No of nonzeros in L+U = 1290 +Fill ratio: nnz(F)/nnz(A) = 2.308 +L\U MB 0.016 total MB needed 0.040 + 0 1.57e+01 + 1 1.46e+01 + 2 6.79e+00 + 3 3.42e+00 + 4 2.18e+00 + 5 1.53e+00 + 6 1.29e+00 + 7 1.12e+00 + 8 7.69e-01 + 9 5.71e-01 + 10 3.73e-01 + 11 3.36e-01 + 12 3.35e-01 + 13 2.88e-01 + 14 2.53e-01 + 15 1.27e-01 + 16 6.49e-02 + 17 4.79e-02 + 18 2.00e-02 + 19 8.33e-03 + 20 3.59e-03 + 21 5.57e-04 + 22 1.16e-04 + 23 2.77e-05 + 24 4.25e-06 + 25 6.13e-07 + 26 4.05e-08 +||A||_F = 1.6e+01, ||B||_2 = 1.6e+01, ||B-A*X||_2 = 4.1e-08, relres = 2.6e-09 +iteration: 26 +residual: 2.6e-09 +GMRES time: 0.15 seconds. +||X-X_true||_oo = 1.2e-06 +Factor time = 0.40 +Factor flops = 2.263600e+04 Mflops = 0.06 +Solve time = 0.13 +Solve flops = 2.580000e+03 Mflops = 0.02 +Number of memory expansions: 0 +==2847== +==2847== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 8 from 1) +==2847== malloc/free: in use at exit: 0 bytes in 0 blocks. +==2847== malloc/free: 234 allocs, 234 frees, 242,064 bytes allocated. +==2847== For counts of detected errors, rerun with: -v +==2847== All heap blocks were freed -- no leaks are possible. diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sfgmr.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sfgmr.c new file mode 100644 index 0000000..66d2ff8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sfgmr.c @@ -0,0 +1,298 @@ + +/*! @file sfgmr.c + * \brief flexible GMRES from ITSOL developed by Yousef Saad. + */ + +/* ITSOL COPYRIGHT + +Copyright (C) 2006, the University of Minnesota + +ITSOL 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 [version 2 of the License, or any later version] +For details, see + +http://www.gnu.org/copyleft/gpl.html + +A copy of the GNU licencing agreement is attached to the ITSOL package +in the file GNU. For additional information contact the Free Software +Foundation Inc., 65 Mass Ave, Cambridge, MA 02139, USA. + +DISCLAIMER +---------- + +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. + +For information on ITSOL contact saad@cs.umn.edu +*/ + +#include "slu_sdefs.h" + +#define epsmac 1.0e-16 + +extern float sdot_(int *, float [], int *, float [], int *); +extern float snrm2_(int *, float [], int *); + + +int sfgmr(int n, + void (*smatvec) (float, float[], float, float[]), + void (*spsolve) (int, float[], float[]), + float *rhs, float *sol, double tol, int im, int *itmax, FILE * fits) +{ +/*---------------------------------------------------------------------- +| *** Preconditioned FGMRES *** ++----------------------------------------------------------------------- +| This is a simple version of the ARMS preconditioned FGMRES algorithm. ++----------------------------------------------------------------------- +| Y. S. Dec. 2000. -- Apr. 2008 ++----------------------------------------------------------------------- +| on entry: +|---------- +| +| rhs = real vector of length n containing the right hand side. +| sol = real vector of length n containing an initial guess to the +| solution on input. +| tol = tolerance for stopping iteration +| im = Krylov subspace dimension +| (itmax) = max number of iterations allowed. +| fits = NULL: no output +| != NULL: file handle to output " resid vs time and its" +| +| on return: +|---------- +| fgmr int = 0 --> successful return. +| int = 1 --> convergence not achieved in itmax iterations. +| sol = contains an approximate solution (upon successful return). +| itmax = has changed. It now contains the number of steps required +| to converge -- ++----------------------------------------------------------------------- +| internal work arrays: +|---------- +| vv = work array of length [im+1][n] (used to store the Arnoldi +| basis) +| hh = work array of length [im][im+1] (Householder matrix) +| z = work array of length [im][n] to store preconditioned vectors ++----------------------------------------------------------------------- +| subroutines called : +| matvec - matrix-vector multiplication operation +| psolve - (right) preconditionning operation +| psolve can be a NULL pointer (GMRES without preconditioner) ++---------------------------------------------------------------------*/ + + int maxits = *itmax; + int i, i1, ii, j, k, k1, its, retval, i_1 = 1, i_2 = 2; + float beta, eps1 = 0.0, t, t0, gam; + float **hh, *c, *s, *rs; + float **vv, **z, tt; + float zero = 0.0; + float one = 1.0; + + its = 0; + vv = (float **)SUPERLU_MALLOC((im + 1) * sizeof(float *)); + for (i = 0; i <= im; i++) vv[i] = floatMalloc(n); + z = (float **)SUPERLU_MALLOC(im * sizeof(float *)); + hh = (float **)SUPERLU_MALLOC(im * sizeof(float *)); + for (i = 0; i < im; i++) + { + hh[i] = floatMalloc(i + 2); + z[i] = floatMalloc(n); + } + c = floatMalloc(im); + s = floatMalloc(im); + rs = floatMalloc(im + 1); + + /*---- outer loop starts here ----*/ + do + { + /*---- compute initial residual vector ----*/ + smatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + beta = snrm2_(&n, vv[0], &i_1); + + /*---- print info if fits != null ----*/ + if (fits != NULL && its == 0) + fprintf(fits, "%8d %10.2e\n", its, beta); + /*if ( beta <= tol * dnrm2_(&n, rhs, &i_1) )*/ + if ( !(beta > tol * snrm2_(&n, rhs, &i_1)) ) + break; + t = 1.0 / beta; + + /*---- normalize: vv[0] = vv[0] / beta ----*/ + for (j = 0; j < n; j++) + vv[0][j] = vv[0][j] * t; + if (its == 0) + eps1 = tol * beta; + + /*---- initialize 1-st term of rhs of hessenberg system ----*/ + rs[0] = beta; + for (i = 0; i < im; i++) + { + its++; + i1 = i + 1; + + /*------------------------------------------------------------ + | (Right) Preconditioning Operation z_{j} = M^{-1} v_{j} + +-----------------------------------------------------------*/ + if (spsolve) + spsolve(n, z[i], vv[i]); + else + scopy_(&n, vv[i], &i_1, z[i], &i_1); + + /*---- matvec operation w = A z_{j} = A M^{-1} v_{j} ----*/ + smatvec(one, z[i], zero, vv[i1]); + + /*------------------------------------------------------------ + | modified gram - schmidt... + | h_{i,j} = (w,v_{i}) + | w = w - h_{i,j} v_{i} + +------------------------------------------------------------*/ + t0 = snrm2_(&n, vv[i1], &i_1); + for (j = 0; j <= i; j++) + { + float negt; + tt = sdot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] = tt; + negt = -tt; + saxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + + /*---- h_{j+1,j} = ||w||_{2} ----*/ + t = snrm2_(&n, vv[i1], &i_1); + while (t < 0.5 * t0) + { + t0 = t; + for (j = 0; j <= i; j++) + { + float negt; + tt = sdot_(&n, vv[j], &i_1, vv[i1], &i_1); + hh[i][j] += tt; + negt = -tt; + saxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + t = snrm2_(&n, vv[i1], &i_1); + } + + hh[i][i1] = t; + + if (t != 0.0) + { + /*---- v_{j+1} = w / h_{j+1,j} ----*/ + t = 1.0 / t; + for (k = 0; k < n; k++) + vv[i1][k] = vv[i1][k] * t; + } + /*--------------------------------------------------- + | done with modified gram schimdt and arnoldi step + | now update factorization of hh + +--------------------------------------------------*/ + + /*-------------------------------------------------------- + | perform previous transformations on i-th column of h + +-------------------------------------------------------*/ + for (k = 1; k <= i; k++) + { + k1 = k - 1; + tt = hh[i][k1]; + hh[i][k1] = c[k1] * tt + s[k1] * hh[i][k]; + hh[i][k] = -s[k1] * tt + c[k1] * hh[i][k]; + } + + gam = sqrt(pow(hh[i][i], 2) + pow(hh[i][i1], 2)); + + /*--------------------------------------------------- + | if gamma is zero then any small value will do + | affect only residual estimate + +--------------------------------------------------*/ + /* if (gam == 0.0) gam = epsmac; */ + + /*---- get next plane rotation ---*/ + if (gam == 0.0) + { + c[i] = one; + s[i] = zero; + } + else + { + c[i] = hh[i][i] / gam; + s[i] = hh[i][i1] / gam; + } + + rs[i1] = -s[i] * rs[i]; + rs[i] = c[i] * rs[i]; + + /*---------------------------------------------------- + | determine residual norm and test for convergence + +---------------------------------------------------*/ + hh[i][i] = c[i] * hh[i][i] + s[i] * hh[i][i1]; + beta = fabs(rs[i1]); + if (fits != NULL) + fprintf(fits, "%8d %10.2e\n", its, beta); + if (beta <= eps1 || its >= maxits) + break; + } + + if (i == im) i--; + + /*---- now compute solution. 1st, solve upper triangular system ----*/ + rs[i] = rs[i] / hh[i][i]; + + for (ii = 1; ii <= i; ii++) + { + k = i - ii; + k1 = k + 1; + tt = rs[k]; + for (j = k1; j <= i; j++) + tt = tt - hh[j][k] * rs[j]; + rs[k] = tt / hh[k][k]; + } + + /*---- linear combination of v[i]'s to get sol. ----*/ + for (j = 0; j <= i; j++) + { + tt = rs[j]; + for (k = 0; k < n; k++) + sol[k] += tt * z[j][k]; + } + + /* calculate the residual and output */ + smatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + vv[0][j] = rhs[j] - vv[0][j]; /* vv[0]= initial residual */ + + /*---- print info if fits != null ----*/ + beta = snrm2_(&n, vv[0], &i_1); + + /*---- restart outer loop if needed ----*/ + /*if (beta >= eps1 / tol)*/ + if ( !(beta < eps1 / tol) ) + { + its = maxits + 10; + break; + } + if (beta <= eps1) + break; + } while(its < maxits); + + retval = (its >= maxits); + for (i = 0; i <= im; i++) + SUPERLU_FREE(vv[i]); + SUPERLU_FREE(vv); + for (i = 0; i < im; i++) + { + SUPERLU_FREE(hh[i]); + SUPERLU_FREE(z[i]); + } + SUPERLU_FREE(hh); + SUPERLU_FREE(z); + SUPERLU_FREE(c); + SUPERLU_FREE(s); + SUPERLU_FREE(rs); + + *itmax = its; + + return retval; +} /*----end of fgmr ----*/ diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sitersol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sitersol.c new file mode 100644 index 0000000..2ebe506 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sitersol.c @@ -0,0 +1,315 @@ + +#include "slu_sdefs.h" +/* + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Laboratory + * November, 2010 + */ + +int *GLOBAL_PERM_C, *GLOBAL_PERM_R; +SuperMatrix *GLOBAL_A, *GLOBAL_L, *GLOBAL_U; +SuperLUStat_t *GLOBAL_STAT; + +void smatvec_mult(float alpha, float x[], float beta, float y[]) +{ + SuperMatrix *A = GLOBAL_A; + + sp_sgemv("N", alpha, A, x, 1, beta, y, 1); +} + +void spsolve(int n, float x[], float y[]) +{ + extern void scopy_(int *, float [], int *, float [], int *); + + int i_1 = 1; + SuperMatrix *L = GLOBAL_L, *U = GLOBAL_U; + SuperLUStat_t *stat = GLOBAL_STAT; + int *perm_c = GLOBAL_PERM_C, *perm_r = GLOBAL_PERM_R; + int info; + static DNformat X; + static SuperMatrix XX = {SLU_DN, SLU_S, SLU_GE, 1, 1, &X}; + + scopy_(&n, y, &i_1, x, &i_1); + XX.nrow = n; + X.lda = n; + X.nzval = x; + sgstrs(NOTRANS, L, U, perm_c, perm_r, &XX, stat, &info); +} + +int main(int argc, char *argv[]) +{ + void smatvec_mult(float alpha, float x[], float beta, float y[]); + void spsolve(int n, float x[], float y[]); + extern int sfgmr( int n, + void (*matvec_mult)(float, float [], float, float []), + void (*psolve)(int n, float [], float[]), + float *rhs, float *sol, double tol, int restrt, int *itmax, + FILE *fits); + extern int sfill_diag(int n, NCformat *Astore); + + char equed[1] = {'B'}; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + float *a; + int *asub, *xa; + int *etree; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int nrhs, ldx, lwork, info, m, n, nnz; + float *rhsb, *rhsx, *xact; + float *work = NULL; + float *R, *C; + float u, rpg, rcond; + float zero = 0.0; + float one = 1.0; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + + int restrt, iter, maxit, i; + double resid; + float *x, *b; + +#ifdef DEBUG + extern int num_drop_L, num_drop_U; +#endif + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 0.1; /* u=1.0 for complete factorization */ + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 0.1; //different from complete LU + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + options.RowPerm = LargeDiag; + options.ILU_DropTol = 1e-4; + options.ILU_FillTol = 1e-2; + options.ILU_FillFactor = 10.0; + options.ILU_DropRule = DROP_BASIC | DROP_AREA; + options.ILU_Norm = INF_NORM; + options.ILU_MILU = SILU; + */ + ilu_set_default_options(&options); + + /* Modify the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) ABORT("Malloc fails for work[]."); + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + if (argc < 2) + { + printf("Usage:\n%s [OPTION] < [INPUT] > [OUTPUT]\nOPTION:\n" + "-h -hb:\n\t[INPUT] is a Harwell-Boeing format matrix.\n" + "-r -rb:\n\t[INPUT] is a Rutherford-Boeing format matrix.\n" + "-t -triplet:\n\t[INPUT] is a triplet format matrix.\n", + argv[0]); + return 0; + } + else + { + switch (argv[1][1]) + { + case 'H': + case 'h': + printf("Input a Harwell-Boeing format matrix:\n"); + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'R': + case 'r': + printf("Input a Rutherford-Boeing format matrix:\n"); + sreadrb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'T': + case 't': + printf("Input a triplet format matrix:\n"); + sreadtriple(&m, &n, &nnz, &a, &asub, &xa); + break; + default: + printf("Unrecognized format.\n"); + return 0; + } + } + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + sfill_diag(n, Astore); + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + fflush(stdout); + + if ( !(rhsb = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + + info = 0; +#ifdef DEBUG + num_drop_L = 0; + num_drop_U = 0; +#endif + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Compute the incomplete factorization and compute the condition number + and pivot growth using dgsisx. */ + sgsisx(&options, &A, perm_c, perm_r, etree, equed, R, C, &L, &U, work, + lwork, &B, &X, &rpg, &rcond, &mem_usage, &stat, &info); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("sgsisx(): info %d\n", info); + if (info > 0 || rcond < 1e-8 || rpg > 1e8) + printf("WARNING: This preconditioner might be unstable.\n"); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + printf("n(A) = %d, nnz(A) = %d\n", n, Astore->nnz); + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("Fill ratio: nnz(F)/nnz(A) = %.3f\n", + ((double)(Lstore->nnz) + (double)(Ustore->nnz) - (double)n) + / (double)Astore->nnz); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + /* Set the global variables. */ + GLOBAL_A = &A; + GLOBAL_L = &L; + GLOBAL_U = &U; + GLOBAL_STAT = &stat; + GLOBAL_PERM_C = perm_c; + GLOBAL_PERM_R = perm_r; + + /* Set the variables used by GMRES. */ + restrt = SUPERLU_MIN(n / 3 + 1, 50); + maxit = 1000; + iter = maxit; + resid = 1e-8; + if (!(b = floatMalloc(m))) ABORT("Malloc fails for b[]."); + if (!(x = floatMalloc(n))) ABORT("Malloc fails for x[]."); + + if (info <= n + 1) + { + int i_1 = 1; + double maxferr = 0.0, nrmA, nrmB, res, t; + float temp; + extern float snrm2_(int *, float [], int *); + extern void saxpy_(int *, float *, float [], int *, float [], int *); + + /* Call GMRES. */ + for (i = 0; i < n; i++) b[i] = rhsb[i]; + for (i = 0; i < n; i++) x[i] = zero; + + t = SuperLU_timer_(); + + sfgmr(n, smatvec_mult, spsolve, b, x, resid, restrt, &iter, stdout); + + t = SuperLU_timer_() - t; + + /* Output the result. */ + nrmA = snrm2_(&(Astore->nnz), (float *)((DNformat *)A.Store)->nzval, + &i_1); + nrmB = snrm2_(&m, b, &i_1); + sp_sgemv("N", -1.0, &A, x, 1, 1.0, b, 1); + res = snrm2_(&m, b, &i_1); + resid = res / nrmB; + printf("||A||_F = %.1e, ||B||_2 = %.1e, ||B-A*X||_2 = %.1e, " + "relres = %.1e\n", nrmA, nrmB, res, resid); + + if (iter >= maxit) + { + if (resid >= 1.0) iter = -180; + else if (resid > 1e-8) iter = -111; + } + printf("iteration: %d\nresidual: %.1e\nGMRES time: %.2f seconds.\n", + iter, resid, t); + + /* Scale the solution back if equilibration was performed. */ + if (*equed == 'C' || *equed == 'B') + for (i = 0; i < n; i++) x[i] *= C[i]; + + for (i = 0; i < m; i++) { + maxferr = SUPERLU_MAX(maxferr, fabs(x[i] - xact[i])); + } + printf("||X-X_true||_oo = %.1e\n", maxferr); + } +#ifdef DEBUG + printf("%d entries in L and %d entries in U dropped.\n", + num_drop_L, num_drop_U); +#endif + fflush(stdout); + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork >= 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + SUPERLU_FREE(b); + SUPERLU_FREE(x); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol.c new file mode 100644 index 0000000..d31285e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol.c @@ -0,0 +1,115 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_sdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + float *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + float *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Read the matrix in Harwell-Boeing format. */ + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + sgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + sinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + sQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("sgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + sQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol1.c new file mode 100644 index 0000000..651026a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsol1.c @@ -0,0 +1,120 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_sdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + float *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + float *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Now we modify the default options to use the symmetric mode. */ + options.SymmetricMode = YES; + options.ColPerm = MMD_AT_PLUS_A; + options.DiagPivotThresh = 0.001; + + /* Read the matrix in Harwell-Boeing format. */ + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + sgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + sinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + sQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("sgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + sQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx.c new file mode 100644 index 0000000..31eab9b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx.c @@ -0,0 +1,212 @@ + +/* + * -- SuperLU routine (version 3.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * August 1, 2008 + * + */ +#include "slu_sdefs.h" + +main(int argc, char *argv[]) +{ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + float *a; + int *asub, *xa; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + float *rhsb, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + /* Add more functionalities that the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + options.IterRefine = SINGLE; /* Perform single-precision refinement */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("SLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Solve the system and compute the condition number + and error bounds using dgssvx. */ + + sgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("sgssvx(): info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + if ( options.IterRefine != NOREFINE ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + + +/* + * Parse command line inputs. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + float *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx1.c new file mode 100644 index 0000000..cc83802 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx1.c @@ -0,0 +1,241 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_sdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program SLINSOLX1. + * + * This example illustrates how to use SGSSVX to solve systems with the same + * A but different right-hand side. + * In this case, we factorize A only once in the first call to DGSSVX, + * and reuse the following data structures in the subsequent call to SGSSVX: + * perm_c, perm_r, R, C, L, U. + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + float *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + float *rhsb, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default values for options argument: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("SLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ONLY PERFORM THE LU DECOMPOSITION */ + B.ncol = 0; /* Indicate not to solve the system */ + sgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("LU factorization: sgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + /* ------------------------------------------------------------ + NOW WE SOLVE THE LINEAR SYSTEM USING THE FACTORED FORM OF A. + ------------------------------------------------------------*/ + options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ + B.ncol = nrhs; /* Set the number of right-hand side */ + + /* Initialize the statistics variables. */ + StatInit(&stat); + + sgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("Triangular solve: sgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) X.Store)->nzval; + + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + float *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx2.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx2.c new file mode 100644 index 0000000..cdf78d1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/slinsolx2.c @@ -0,0 +1,277 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_sdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program SLINSOLX2. + * + * This example illustrates how to use SGSSVX to solve systems repeatedly + * with the same sparsity pattern of matrix A. + * In this case, the column permutation vector perm_c is computed once. + * The following data structures will be reused in the subsequent call to + * SGSSVX: perm_c, etree + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, A1, L, U; + SuperMatrix B, B1, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + float *a, *a1; + int *asub, *xa, *asub1, *xa1; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, j, m, n, nnz; + float *rhsb, *rhsb1, *rhsx, *xact; + float *R, *C; + float *ferr, *berr; + float u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + if ( !(a1 = floatMalloc(nnz)) ) ABORT("Malloc fails for a1[]."); + if ( !(asub1 = intMalloc(nnz)) ) ABORT("Malloc fails for asub1[]."); + if ( !(xa1 = intMalloc(n+1)) ) ABORT("Malloc fails for xa1[]."); + for (i = 0; i < nnz; ++i) { + a1[i] = a[i]; + asub1[i] = asub[i]; + } + for (i = 0; i < n+1; ++i) xa1[i] = xa[i]; + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsb1 = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb1[]."); + if ( !(rhsx = floatMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + sCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + ldx = n; + sGenXtrue(n, nrhs, xact, ldx); + sFillRHS(trans, nrhs, xact, ldx, &A, &B); + for (j = 0; j < nrhs; ++j) + for (i = 0; i < m; ++i) rhsb1[i+j*m] = rhsb[i+j*m]; + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(R = (float *) SUPERLU_MALLOC(A.nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (float *) SUPERLU_MALLOC(A.ncol * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (float *) SUPERLU_MALLOC(nrhs * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ------------------------------------------------------------ + WE SOLVE THE LINEAR SYSTEM FOR THE FIRST TIME: AX = B + ------------------------------------------------------------*/ + sgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("First system: sgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + Destroy_CompCol_Matrix(&A); + Destroy_Dense_Matrix(&B); + if ( lwork >= 0 ) { /* Deallocate storage associated with L and U. */ + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + /* ------------------------------------------------------------ + NOW WE SOLVE ANOTHER LINEAR SYSTEM: A1*X = B1 + ONLY THE SPARSITY PATTERN OF A1 IS THE SAME AS THAT OF A. + ------------------------------------------------------------*/ + options.Fact = SamePattern; + StatInit(&stat); /* Initialize the statistics variables. */ + + sCreate_CompCol_Matrix(&A1, m, n, nnz, a1, asub1, xa1, + SLU_NC, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&B1, m, nrhs, rhsb1, m, SLU_DN, SLU_S, SLU_GE); + + sgssvx(&options, &A1, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B1, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("\nSecond system: sgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + float *sol = (float*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A1); + Destroy_Dense_Matrix(&B1); + Destroy_Dense_Matrix(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sp_ienv.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sp_ienv.c new file mode 100644 index 0000000..d1ed662 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/sp_ienv.c @@ -0,0 +1,79 @@ +/*! @file sp_ienv.c + * \brief Chooses machine-dependent parameters for the local + * environment. + * + * -- SuperLU routine (version 4.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November, 2010 + * +*/ + +/* + * File name: sp_ienv.c + * History: Modified from lapack routine ILAENV + */ +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    sp_ienv() is inquired to choose machine-dependent parameters for the
    +    local environment. See ISPEC for a description of the parameters.   
    +
    +    This version provides a set of parameters which should give good,   
    +    but not optimal, performance on many of the currently available   
    +    computers.  Users are encouraged to modify this subroutine to set   
    +    the tuning parameters for their particular machine using the option   
    +    and problem size information in the arguments.   
    +
    +    Arguments   
    +    =========   
    +
    +    ISPEC   (input) int
    +            Specifies the parameter to be returned as the value of SP_IENV.   
    +            = 1: the panel size w; a panel consists of w consecutive
    +	         columns of matrix A in the process of Gaussian elimination.
    +		 The best value depends on machine's cache characters.
    +            = 2: the relaxation parameter relax; if the number of
    +	         nodes (columns) in a subtree of the elimination tree is less
    +		 than relax, this subtree is considered as one supernode,
    +		 regardless of their row structures.
    +            = 3: the maximum size for a supernode in complete LU;
    +	    = 4: the minimum row dimension for 2-D blocking to be used;
    +	    = 5: the minimum column dimension for 2-D blocking to be used;
    +	    = 6: the estimated fills factor for L and U, compared with A;
    +	    = 7: the maximum size for a supernode in ILU.
    +	    
    +   (SP_IENV) (output) int
    +            >= 0: the value of the parameter specified by ISPEC   
    +            < 0:  if SP_IENV = -k, the k-th argument had an illegal value. 
    +  
    +    ===================================================================== 
    +
    +*/ +int +sp_ienv(int ispec) +{ + int i; + + switch (ispec) { + case 1: return (12); + case 2: return (1); + case 3: return (100); + case 4: return (200); + case 5: return (60); + case 6: return (20); + case 7: return (10); + } + + /* Invalid value for ISPEC */ + i = 1; + xerbla_("sp_ienv", &i); + return 0; + +} /* sp_ienv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/superlu.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/superlu.c new file mode 100644 index 0000000..f109e1a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/superlu.c @@ -0,0 +1,84 @@ +/*! @file superlu.c + * \brief a small 5x5 example + * + *
    + * * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include "slu_ddefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * This is the small 5x5 example used in the Sections 2 and 3 of the + * Users' Guide to illustrate how to call a SuperLU routine, and the + * matrix data structures used by SuperLU. + * + */ + SuperMatrix A, L, U, B; + double *a, *rhs; + double s, u, p, e, r, l; + int *asub, *xa; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int nrhs, info, i, m, n, nnz, permc_spec; + superlu_options_t options; + SuperLUStat_t stat; + + /* Initialize matrix A. */ + m = n = 5; + nnz = 12; + if ( !(a = doubleMalloc(nnz)) ) ABORT("Malloc fails for a[]."); + if ( !(asub = intMalloc(nnz)) ) ABORT("Malloc fails for asub[]."); + if ( !(xa = intMalloc(n+1)) ) ABORT("Malloc fails for xa[]."); + s = 19.0; u = 21.0; p = 16.0; e = 5.0; r = 18.0; l = 12.0; + a[0] = s; a[1] = l; a[2] = l; a[3] = u; a[4] = l; a[5] = l; + a[6] = u; a[7] = p; a[8] = u; a[9] = e; a[10]= u; a[11]= r; + asub[0] = 0; asub[1] = 1; asub[2] = 4; asub[3] = 1; + asub[4] = 2; asub[5] = 4; asub[6] = 0; asub[7] = 2; + asub[8] = 0; asub[9] = 3; asub[10]= 3; asub[11]= 4; + xa[0] = 0; xa[1] = 3; xa[2] = 6; xa[3] = 8; xa[4] = 10; xa[5] = 12; + + /* Create matrix A in the format expected by SuperLU. */ + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + + /* Create right-hand side matrix B. */ + nrhs = 1; + if ( !(rhs = doubleMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + for (i = 0; i < m; ++i) rhs[i] = 1.0; + dCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_D, SLU_GE); + + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + + /* Set the default input options. */ + set_default_options(&options); + options.ColPerm = NATURAL; + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Solve the linear system. */ + dgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + dPrint_CompCol_Matrix("A", &A); + dPrint_CompCol_Matrix("U", &U); + dPrint_SuperNode_Matrix("L", &L); + print_int_vec("\nperm_r", m, perm_r); + + /* De-allocate storage */ + SUPERLU_FREE (rhs); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + StatFree(&stat); +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/temp b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/temp new file mode 100644 index 0000000..4168467 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/temp @@ -0,0 +1,13 @@ +10x10 grid, with COLMMD order +Dimension 100x100; # nonzeros 460 +||X - Xtrue||/||X|| = 1.161293e-13 +No of nonzeros in factor L = 855 +No of nonzeros in factor U = 993 +No of nonzeros in L+U = 1748 +FILL ratio = 3.8 +L\U MB 0.020 total MB needed 0.043 +Factor time = 0.28 +Factor flops = 1.676900e+04 Mflops = 0.06 +Solve time = 0.13 +Solve flops = 3.496000e+03 Mflops = 0.03 +Number of memory expansions: 0 diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zfgmr.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zfgmr.c new file mode 100644 index 0000000..c1f0479 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zfgmr.c @@ -0,0 +1,334 @@ + +/*! @file zfgmr.c + * \brief flexible GMRES from ITSOL developed by Yousef Saad. + */ + +/* ITSOL COPYRIGHT + +Copyright (C) 2006, the University of Minnesota + +ITSOL 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 [version 2 of the License, or any later version] +For details, see + +http://www.gnu.org/copyleft/gpl.html + +A copy of the GNU licencing agreement is attached to the ITSOL package +in the file GNU. For additional information contact the Free Software +Foundation Inc., 65 Mass Ave, Cambridge, MA 02139, USA. + +DISCLAIMER +---------- + +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. + +For information on ITSOL contact saad@cs.umn.edu +*/ + +#include "slu_zdefs.h" + +#define epsmac 1.0e-16 + +extern void zdotc_(doublecomplex *, int *, doublecomplex [], int *, doublecomplex [], int *); +extern double dznrm2_(int *, doublecomplex [], int *); + + +int zfgmr(int n, + void (*zmatvec) (doublecomplex, doublecomplex[], doublecomplex, doublecomplex[]), + void (*zpsolve) (int, doublecomplex[], doublecomplex[]), + doublecomplex *rhs, doublecomplex *sol, double tol, int im, int *itmax, FILE * fits) +{ +/*---------------------------------------------------------------------- +| *** Preconditioned FGMRES *** ++----------------------------------------------------------------------- +| This is a simple version of the ARMS preconditioned FGMRES algorithm. ++----------------------------------------------------------------------- +| Y. S. Dec. 2000. -- Apr. 2008 ++----------------------------------------------------------------------- +| on entry: +|---------- +| +| rhs = real vector of length n containing the right hand side. +| sol = real vector of length n containing an initial guess to the +| solution on input. +| tol = tolerance for stopping iteration +| im = Krylov subspace dimension +| (itmax) = max number of iterations allowed. +| fits = NULL: no output +| != NULL: file handle to output " resid vs time and its" +| +| on return: +|---------- +| fgmr int = 0 --> successful return. +| int = 1 --> convergence not achieved in itmax iterations. +| sol = contains an approximate solution (upon successful return). +| itmax = has changed. It now contains the number of steps required +| to converge -- ++----------------------------------------------------------------------- +| internal work arrays: +|---------- +| vv = work array of length [im+1][n] (used to store the Arnoldi +| basis) +| hh = work array of length [im][im+1] (Householder matrix) +| z = work array of length [im][n] to store preconditioned vectors ++----------------------------------------------------------------------- +| subroutines called : +| matvec - matrix-vector multiplication operation +| psolve - (right) preconditionning operation +| psolve can be a NULL pointer (GMRES without preconditioner) ++---------------------------------------------------------------------*/ + + int maxits = *itmax; + int i, i1, ii, j, k, k1, its, retval, i_1 = 1, i_2 = 2; + double beta, eps1 = 0.0, t, t0, gam; + doublecomplex **hh, *c, *s, *rs; + doublecomplex **vv, **z, tt; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + doublecomplex tt1, tt2; + + its = 0; + vv = (doublecomplex **)SUPERLU_MALLOC((im + 1) * sizeof(doublecomplex *)); + for (i = 0; i <= im; i++) vv[i] = doublecomplexMalloc(n); + z = (doublecomplex **)SUPERLU_MALLOC(im * sizeof(doublecomplex *)); + hh = (doublecomplex **)SUPERLU_MALLOC(im * sizeof(doublecomplex *)); + for (i = 0; i < im; i++) + { + hh[i] = doublecomplexMalloc(i + 2); + z[i] = doublecomplexMalloc(n); + } + c = doublecomplexMalloc(im); + s = doublecomplexMalloc(im); + rs = doublecomplexMalloc(im + 1); + + /*---- outer loop starts here ----*/ + do + { + /*---- compute initial residual vector ----*/ + zmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + z_sub(&vv[0][j], &rhs[j], &vv[0][j]); /* vv[0]= initial residual */ + beta = dznrm2_(&n, vv[0], &i_1); + + /*---- print info if fits != null ----*/ + if (fits != NULL && its == 0) + fprintf(fits, "%8d %10.2e\n", its, beta); + /*if ( beta <= tol * dnrm2_(&n, rhs, &i_1) )*/ + if ( !(beta > tol * dznrm2_(&n, rhs, &i_1)) ) + break; + t = 1.0 / beta; + + /*---- normalize: vv[0] = vv[0] / beta ----*/ + for (j = 0; j < n; j++) + zd_mult(&vv[0][j], &vv[0][j], t); + if (its == 0) + eps1 = tol * beta; + + /*---- initialize 1-st term of rhs of hessenberg system ----*/ + rs[0].r = beta; + rs[0].i = 0.0; + for (i = 0; i < im; i++) + { + its++; + i1 = i + 1; + + /*------------------------------------------------------------ + | (Right) Preconditioning Operation z_{j} = M^{-1} v_{j} + +-----------------------------------------------------------*/ + if (zpsolve) + zpsolve(n, z[i], vv[i]); + else + zcopy_(&n, vv[i], &i_1, z[i], &i_1); + + /*---- matvec operation w = A z_{j} = A M^{-1} v_{j} ----*/ + zmatvec(one, z[i], zero, vv[i1]); + + /*------------------------------------------------------------ + | modified gram - schmidt... + | h_{i,j} = (w,v_{i}) + | w = w - h_{i,j} v_{i} + +------------------------------------------------------------*/ + t0 = dznrm2_(&n, vv[i1], &i_1); + for (j = 0; j <= i; j++) + { + doublecomplex negt; +#if 0 + zdotc_(&tt, &n, vv[j], &i_1, vv[i1], &i_1); +#else + tt = zero; + for (k = 0; k < n; ++k) { + zz_conj(&tt1, &vv[j][k]); + zz_mult(&tt2, &tt1, &vv[i1][k]); + z_add(&tt, &tt, &tt2); + } +#endif + hh[i][j] = tt; + negt.r = -tt.r; + negt.i = -tt.i; + zaxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + + /*---- h_{j+1,j} = ||w||_{2} ----*/ + t = dznrm2_(&n, vv[i1], &i_1); + while (t < 0.5 * t0) + { + t0 = t; + for (j = 0; j <= i; j++) + { + doublecomplex negt; +#if 0 + zdotc_(&tt, &n, vv[j], &i_1, vv[i1], &i_1); +#else + tt = zero; + for (k = 0; k < n; ++k) { + zz_conj(&tt1, &vv[j][k]); + zz_mult(&tt2, &tt1, &vv[i1][k]); + z_add(&tt, &tt, &tt2); + } +#endif + z_add(&hh[i][j], &hh[i][j], &tt); + negt.r = -tt.r; + negt.i = -tt.i; + zaxpy_(&n, &negt, vv[j], &i_1, vv[i1], &i_1); + } + t = dznrm2_(&n, vv[i1], &i_1); + } + + hh[i][i1].r = t; + hh[i][i1].i = 0.0; + + if (t != 0.0) + { + /*---- v_{j+1} = w / h_{j+1,j} ----*/ + t = 1.0 / t; + for (k = 0; k < n; k++) + zd_mult(&vv[i1][k], &vv[i1][k], t); + } + /*--------------------------------------------------- + | done with modified gram schimdt and arnoldi step + | now update factorization of hh + +--------------------------------------------------*/ + + /*-------------------------------------------------------- + | perform previous transformations on i-th column of h + +-------------------------------------------------------*/ + for (k = 1; k <= i; k++) + { + k1 = k - 1; + tt = hh[i][k1]; + zz_mult(&tt1, &c[k1], &tt); + zz_mult(&tt2, &s[k1], &hh[i][k]); + z_add(&hh[i][k1], &tt1, &tt2); + + zz_mult(&tt1, &s[k1], &tt); + zz_mult(&tt2, &c[k1], &hh[i][k]); + z_sub(&hh[i][k], &tt2, &tt1); + } + + gam = dznrm2_(&i_2, &hh[i][i], &i_1); + + /*--------------------------------------------------- + | if gamma is zero then any small value will do + | affect only residual estimate + +--------------------------------------------------*/ + /* if (gam == 0.0) gam = epsmac; */ + + /*---- get next plane rotation ---*/ + if (gam == 0.0) + { + c[i] = one; + s[i] = zero; + } + else + { + gam = 1.0 / gam; + zd_mult(&c[i], &hh[i][i], gam); + zd_mult(&s[i], &hh[i][i1], gam); + } + + zz_mult(&rs[i1], &s[i], &rs[i]); + rs[i1].r = -rs[i1].r; rs[i1].i = -rs[i1].i; + zz_mult(&rs[i], &c[i], &rs[i]); + + /*---------------------------------------------------- + | determine residual norm and test for convergence + +---------------------------------------------------*/ + zz_mult(&tt1, &c[i], &hh[i][i]); + zz_mult(&tt2, &s[i], &hh[i][i1]); + z_add(&hh[i][i], &tt1, &tt2); + beta = z_abs1(&rs[i1]); + if (fits != NULL) + fprintf(fits, "%8d %10.2e\n", its, beta); + if (beta <= eps1 || its >= maxits) + break; + } + + if (i == im) i--; + + /*---- now compute solution. 1st, solve upper triangular system ----*/ + z_div(&rs[i], &rs[i], &hh[i][i]); + + for (ii = 1; ii <= i; ii++) + { + k = i - ii; + k1 = k + 1; + tt = rs[k]; + for (j = k1; j <= i; j++) { + zz_mult(&tt1, &hh[j][k], &rs[j]); + z_sub(&tt, &tt, &tt1); + } + z_div(&rs[k], &tt, &hh[k][k]); + } + + /*---- linear combination of v[i]'s to get sol. ----*/ + for (j = 0; j <= i; j++) + { + tt = rs[j]; + for (k = 0; k < n; k++) { + zz_mult(&tt1, &tt, &z[j][k]); + z_add(&sol[k], &sol[k], &tt1); + } + } + + /* calculate the residual and output */ + zmatvec(one, sol, zero, vv[0]); + for (j = 0; j < n; j++) + z_sub(&vv[0][j], &rhs[j], &vv[0][j]);/* vv[0]= initial residual */ + + /*---- print info if fits != null ----*/ + beta = dznrm2_(&n, vv[0], &i_1); + + /*---- restart outer loop if needed ----*/ + /*if (beta >= eps1 / tol)*/ + if ( !(beta < eps1 / tol) ) + { + its = maxits + 10; + break; + } + if (beta <= eps1) + break; + } while(its < maxits); + + retval = (its >= maxits); + for (i = 0; i <= im; i++) + SUPERLU_FREE(vv[i]); + SUPERLU_FREE(vv); + for (i = 0; i < im; i++) + { + SUPERLU_FREE(hh[i]); + SUPERLU_FREE(z[i]); + } + SUPERLU_FREE(hh); + SUPERLU_FREE(z); + SUPERLU_FREE(c); + SUPERLU_FREE(s); + SUPERLU_FREE(rs); + + *itmax = its; + + return retval; +} /*----end of fgmr ----*/ diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zitersol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zitersol.c new file mode 100644 index 0000000..950f2fc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zitersol.c @@ -0,0 +1,317 @@ + +#include "slu_zdefs.h" +/* + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Laboratory + * November, 2010 + */ + +int *GLOBAL_PERM_C, *GLOBAL_PERM_R; +SuperMatrix *GLOBAL_A, *GLOBAL_L, *GLOBAL_U; +SuperLUStat_t *GLOBAL_STAT; + +void zmatvec_mult(doublecomplex alpha, doublecomplex x[], doublecomplex beta, doublecomplex y[]) +{ + SuperMatrix *A = GLOBAL_A; + + sp_zgemv("N", alpha, A, x, 1, beta, y, 1); +} + +void zpsolve(int n, doublecomplex x[], doublecomplex y[]) +{ + extern void zcopy_(int *, doublecomplex [], int *, doublecomplex [], int *); + + int i_1 = 1; + SuperMatrix *L = GLOBAL_L, *U = GLOBAL_U; + SuperLUStat_t *stat = GLOBAL_STAT; + int *perm_c = GLOBAL_PERM_C, *perm_r = GLOBAL_PERM_R; + int info; + static DNformat X; + static SuperMatrix XX = {SLU_DN, SLU_Z, SLU_GE, 1, 1, &X}; + + zcopy_(&n, y, &i_1, x, &i_1); + XX.nrow = n; + X.lda = n; + X.nzval = x; + zgstrs(NOTRANS, L, U, perm_c, perm_r, &XX, stat, &info); +} + +int main(int argc, char *argv[]) +{ + void zmatvec_mult(doublecomplex alpha, doublecomplex x[], doublecomplex beta, doublecomplex y[]); + void zpsolve(int n, doublecomplex x[], doublecomplex y[]); + extern int zfgmr( int n, + void (*matvec_mult)(doublecomplex, doublecomplex [], doublecomplex, doublecomplex []), + void (*psolve)(int n, doublecomplex [], doublecomplex[]), + doublecomplex *rhs, doublecomplex *sol, double tol, int restrt, int *itmax, + FILE *fits); + extern int zfill_diag(int n, NCformat *Astore); + + char equed[1] = {'B'}; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + doublecomplex *a; + int *asub, *xa; + int *etree; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int nrhs, ldx, lwork, info, m, n, nnz; + doublecomplex *rhsb, *rhsx, *xact; + doublecomplex *work = NULL; + double *R, *C; + double u, rpg, rcond; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + doublecomplex none = {-1.0, 0.0}; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + + int restrt, iter, maxit, i; + double resid; + doublecomplex *x, *b; + +#ifdef DEBUG + extern int num_drop_L, num_drop_U; +#endif + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 0.1; /* u=1.0 for complete factorization */ + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 0.1; //different from complete LU + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + options.RowPerm = LargeDiag; + options.ILU_DropTol = 1e-4; + options.ILU_FillTol = 1e-2; + options.ILU_FillFactor = 10.0; + options.ILU_DropRule = DROP_BASIC | DROP_AREA; + options.ILU_Norm = INF_NORM; + options.ILU_MILU = SILU; + */ + ilu_set_default_options(&options); + + /* Modify the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) ABORT("Malloc fails for work[]."); + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + if (argc < 2) + { + printf("Usage:\n%s [OPTION] < [INPUT] > [OUTPUT]\nOPTION:\n" + "-h -hb:\n\t[INPUT] is a Harwell-Boeing format matrix.\n" + "-r -rb:\n\t[INPUT] is a Rutherford-Boeing format matrix.\n" + "-t -triplet:\n\t[INPUT] is a triplet format matrix.\n", + argv[0]); + return 0; + } + else + { + switch (argv[1][1]) + { + case 'H': + case 'h': + printf("Input a Harwell-Boeing format matrix:\n"); + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'R': + case 'r': + printf("Input a Rutherford-Boeing format matrix:\n"); + zreadrb(&m, &n, &nnz, &a, &asub, &xa); + break; + case 'T': + case 't': + printf("Input a triplet format matrix:\n"); + zreadtriple(&m, &n, &nnz, &a, &asub, &xa); + break; + default: + printf("Unrecognized format.\n"); + return 0; + } + } + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + zfill_diag(n, Astore); + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + fflush(stdout); + + if ( !(rhsb = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + + info = 0; +#ifdef DEBUG + num_drop_L = 0; + num_drop_U = 0; +#endif + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Compute the incomplete factorization and compute the condition number + and pivot growth using dgsisx. */ + zgsisx(&options, &A, perm_c, perm_r, etree, equed, R, C, &L, &U, work, + lwork, &B, &X, &rpg, &rcond, &mem_usage, &stat, &info); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("zgsisx(): info %d\n", info); + if (info > 0 || rcond < 1e-8 || rpg > 1e8) + printf("WARNING: This preconditioner might be unstable.\n"); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + printf("n(A) = %d, nnz(A) = %d\n", n, Astore->nnz); + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("Fill ratio: nnz(F)/nnz(A) = %.3f\n", + ((double)(Lstore->nnz) + (double)(Ustore->nnz) - (double)n) + / (double)Astore->nnz); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + /* Set the global variables. */ + GLOBAL_A = &A; + GLOBAL_L = &L; + GLOBAL_U = &U; + GLOBAL_STAT = &stat; + GLOBAL_PERM_C = perm_c; + GLOBAL_PERM_R = perm_r; + + /* Set the variables used by GMRES. */ + restrt = SUPERLU_MIN(n / 3 + 1, 50); + maxit = 1000; + iter = maxit; + resid = 1e-8; + if (!(b = doublecomplexMalloc(m))) ABORT("Malloc fails for b[]."); + if (!(x = doublecomplexMalloc(n))) ABORT("Malloc fails for x[]."); + + if (info <= n + 1) + { + int i_1 = 1; + double maxferr = 0.0, nrmA, nrmB, res, t; + doublecomplex temp; + extern double dznrm2_(int *, doublecomplex [], int *); + extern void zaxpy_(int *, doublecomplex *, doublecomplex [], int *, doublecomplex [], int *); + + /* Call GMRES. */ + for (i = 0; i < n; i++) b[i] = rhsb[i]; + for (i = 0; i < n; i++) x[i] = zero; + + t = SuperLU_timer_(); + + zfgmr(n, zmatvec_mult, zpsolve, b, x, resid, restrt, &iter, stdout); + + t = SuperLU_timer_() - t; + + /* Output the result. */ + nrmA = dznrm2_(&(Astore->nnz), (doublecomplex *)((DNformat *)A.Store)->nzval, + &i_1); + nrmB = dznrm2_(&m, b, &i_1); + sp_zgemv("N", none, &A, x, 1, one, b, 1); + res = dznrm2_(&m, b, &i_1); + resid = res / nrmB; + printf("||A||_F = %.1e, ||B||_2 = %.1e, ||B-A*X||_2 = %.1e, " + "relres = %.1e\n", nrmA, nrmB, res, resid); + + if (iter >= maxit) + { + if (resid >= 1.0) iter = -180; + else if (resid > 1e-8) iter = -111; + } + printf("iteration: %d\nresidual: %.1e\nGMRES time: %.2f seconds.\n", + iter, resid, t); + + /* Scale the solution back if equilibration was performed. */ + if (*equed == 'C' || *equed == 'B') + for (i = 0; i < n; i++) zd_mult(&x[i], &x[i], C[i]); + + for (i = 0; i < m; i++) { + z_sub(&temp, &x[i], &xact[i]); + maxferr = SUPERLU_MAX(maxferr, z_abs1(&temp)); + } + printf("||X-X_true||_oo = %.1e\n", maxferr); + } +#ifdef DEBUG + printf("%d entries in L and %d entries in U dropped.\n", + num_drop_L, num_drop_U); +#endif + fflush(stdout); + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork >= 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + SUPERLU_FREE(b); + SUPERLU_FREE(x); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol.c new file mode 100644 index 0000000..4304cb4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol.c @@ -0,0 +1,115 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_zdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + doublecomplex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + doublecomplex *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Read the matrix in Harwell-Boeing format. */ + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + zgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + zinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + zQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("zgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + zQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol1.c new file mode 100644 index 0000000..6568ba7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsol1.c @@ -0,0 +1,120 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_zdefs.h" + +main(int argc, char *argv[]) +{ + SuperMatrix A; + NCformat *Astore; + doublecomplex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + SuperMatrix L; /* factor L */ + SCformat *Lstore; + SuperMatrix U; /* factor U */ + NCformat *Ustore; + SuperMatrix B; + int nrhs, ldx, info, m, n, nnz; + doublecomplex *xact, *rhs; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Now we modify the default options to use the symmetric mode. */ + options.SymmetricMode = YES; + options.ColPerm = MMD_AT_PLUS_A; + options.DiagPivotThresh = 0.001; + + /* Read the matrix in Harwell-Boeing format. */ + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + nrhs = 1; + if ( !(rhs = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhs[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhs, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(options.Trans, nrhs, xact, ldx, &A, &B); + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + zgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + + if ( info == 0 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) B.Store)->nzval; + + /* Compute the infinity norm of the error. */ + zinf_norm_error(nrhs, &B, xact); + + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + zQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + } else { + printf("zgssv() error returns INFO= %d\n", info); + if ( info <= n ) { /* factorization completes */ + zQuerySpace(&L, &U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhs); + SUPERLU_FREE (xact); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx.c new file mode 100644 index 0000000..a2ada4e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx.c @@ -0,0 +1,212 @@ + +/* + * -- SuperLU routine (version 3.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * August 1, 2008 + * + */ +#include "slu_zdefs.h" + +main(int argc, char *argv[]) +{ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + doublecomplex *a; + int *asub, *xa; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + doublecomplex *rhsb, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + /* Add more functionalities that the defaults. */ + options.PivotGrowth = YES; /* Compute reciprocal pivot growth */ + options.ConditionNumber = YES;/* Compute reciprocal condition number */ + options.IterRefine = DOUBLE; /* Perform double-precision refinement */ + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("ZLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Solve the system and compute the condition number + and error bounds using dgssvx. */ + + zgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("zgssvx(): info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth == YES ) + printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber == YES ) + printf("Recip. condition number = %e\n", rcond); + if ( options.IterRefine != NOREFINE ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + + +/* + * Parse command line inputs. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:w:r:u:f:t:p:e:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx1.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx1.c new file mode 100644 index 0000000..ec261a7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx1.c @@ -0,0 +1,241 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_zdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program ZLINSOLX1. + * + * This example illustrates how to use ZGSSVX to solve systems with the same + * A but different right-hand side. + * In this case, we factorize A only once in the first call to DGSSVX, + * and reuse the following data structures in the subsequent call to ZGSSVX: + * perm_c, perm_r, R, C, L, U. + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, L, U; + SuperMatrix B, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + doublecomplex *a; + int *asub, *xa; + int *perm_c; /* column permutation vector */ + int *perm_r; /* row permutations from partial pivoting */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, m, n, nnz; + doublecomplex *rhsb, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default values for options argument: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("ZLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsx = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(trans, nrhs, xact, ldx, &A, &B); + + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ONLY PERFORM THE LU DECOMPOSITION */ + B.ncol = 0; /* Indicate not to solve the system */ + zgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("LU factorization: zgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + /* ------------------------------------------------------------ + NOW WE SOLVE THE LINEAR SYSTEM USING THE FACTORED FORM OF A. + ------------------------------------------------------------*/ + options.Fact = FACTORED; /* Indicate the factored form of A is supplied. */ + B.ncol = nrhs; /* Set the number of right-hand side */ + + /* Initialize the statistics variables. */ + StatInit(&stat); + + zgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("Triangular solve: zgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) X.Store)->nzval; + + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (rhsx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx2.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx2.c new file mode 100644 index 0000000..8d57991 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zlinsolx2.c @@ -0,0 +1,277 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_zdefs.h" + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * The driver program ZLINSOLX2. + * + * This example illustrates how to use ZGSSVX to solve systems repeatedly + * with the same sparsity pattern of matrix A. + * In this case, the column permutation vector perm_c is computed once. + * The following data structures will be reused in the subsequent call to + * ZGSSVX: perm_c, etree + * + */ + char equed[1]; + yes_no_t equil; + trans_t trans; + SuperMatrix A, A1, L, U; + SuperMatrix B, B1, X; + NCformat *Astore; + NCformat *Ustore; + SCformat *Lstore; + doublecomplex *a, *a1; + int *asub, *xa, *asub1, *xa1; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; + void *work; + int info, lwork, nrhs, ldx; + int i, j, m, n, nnz; + doublecomplex *rhsb, *rhsb1, *rhsx, *xact; + double *R, *C; + double *ferr, *berr; + double u, rpg, rcond; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + extern void parse_command_line(); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Enter main()"); +#endif + + /* Defaults */ + lwork = 0; + nrhs = 1; + equil = YES; + u = 1.0; + trans = NOTRANS; + + /* Set the default input options: + options.Fact = DOFACT; + options.Equil = YES; + options.ColPerm = COLAMD; + options.DiagPivotThresh = 1.0; + options.Trans = NOTRANS; + options.IterRefine = NOREFINE; + options.SymmetricMode = NO; + options.PivotGrowth = NO; + options.ConditionNumber = NO; + options.PrintStat = YES; + */ + set_default_options(&options); + + /* Can use command line input to modify the defaults. */ + parse_command_line(argc, argv, &lwork, &u, &equil, &trans); + options.Equil = equil; + options.DiagPivotThresh = u; + options.Trans = trans; + + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + ABORT("DLINSOLX: cannot allocate work[]"); + } + } + + /* Read matrix A from a file in Harwell-Boeing format.*/ + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + if ( !(a1 = doublecomplexMalloc(nnz)) ) ABORT("Malloc fails for a1[]."); + if ( !(asub1 = intMalloc(nnz)) ) ABORT("Malloc fails for asub1[]."); + if ( !(xa1 = intMalloc(n+1)) ) ABORT("Malloc fails for xa1[]."); + for (i = 0; i < nnz; ++i) { + a1[i] = a[i]; + asub1[i] = asub[i]; + } + for (i = 0; i < n+1; ++i) xa1[i] = xa[i]; + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + Astore = A.Store; + printf("Dimension %dx%d; # nonzeros %d\n", A.nrow, A.ncol, Astore->nnz); + + if ( !(rhsb = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb[]."); + if ( !(rhsb1 = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsb1[]."); + if ( !(rhsx = doublecomplexMalloc(m * nrhs)) ) ABORT("Malloc fails for rhsx[]."); + zCreate_Dense_Matrix(&B, m, nrhs, rhsb, m, SLU_DN, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&X, m, nrhs, rhsx, m, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + ldx = n; + zGenXtrue(n, nrhs, xact, ldx); + zFillRHS(trans, nrhs, xact, ldx, &A, &B); + for (j = 0; j < nrhs; ++j) + for (i = 0; i < m; ++i) rhsb1[i+j*m] = rhsb[i+j*m]; + + if ( !(perm_c = intMalloc(n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(perm_r = intMalloc(m)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(etree = intMalloc(n)) ) ABORT("Malloc fails for etree[]."); + if ( !(R = (double *) SUPERLU_MALLOC(A.nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for R[]."); + if ( !(C = (double *) SUPERLU_MALLOC(A.ncol * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for C[]."); + if ( !(ferr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for ferr[]."); + if ( !(berr = (double *) SUPERLU_MALLOC(nrhs * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for berr[]."); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* ------------------------------------------------------------ + WE SOLVE THE LINEAR SYSTEM FOR THE FIRST TIME: AX = B + ------------------------------------------------------------*/ + zgssvx(&options, &A, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("First system: zgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("FILL ratio = %.1f\n", (float)(Lstore->nnz + Ustore->nnz - n)/nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + Destroy_CompCol_Matrix(&A); + Destroy_Dense_Matrix(&B); + if ( lwork >= 0 ) { /* Deallocate storage associated with L and U. */ + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + /* ------------------------------------------------------------ + NOW WE SOLVE ANOTHER LINEAR SYSTEM: A1*X = B1 + ONLY THE SPARSITY PATTERN OF A1 IS THE SAME AS THAT OF A. + ------------------------------------------------------------*/ + options.Fact = SamePattern; + StatInit(&stat); /* Initialize the statistics variables. */ + + zCreate_CompCol_Matrix(&A1, m, n, nnz, a1, asub1, xa1, + SLU_NC, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&B1, m, nrhs, rhsb1, m, SLU_DN, SLU_Z, SLU_GE); + + zgssvx(&options, &A1, perm_c, perm_r, etree, equed, R, C, + &L, &U, work, lwork, &B1, &X, &rpg, &rcond, ferr, berr, + &mem_usage, &stat, &info); + + printf("\nSecond system: zgssvx() returns info %d\n", info); + + if ( info == 0 || info == n+1 ) { + + /* This is how you could access the solution matrix. */ + doublecomplex *sol = (doublecomplex*) ((DNformat*) X.Store)->nzval; + + if ( options.PivotGrowth ) printf("Recip. pivot growth = %e\n", rpg); + if ( options.ConditionNumber ) + printf("Recip. condition number = %e\n", rcond); + Lstore = (SCformat *) L.Store; + Ustore = (NCformat *) U.Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz - n); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + if ( options.IterRefine ) { + printf("Iterative Refinement:\n"); + printf("%8s%8s%16s%16s\n", "rhs", "Steps", "FERR", "BERR"); + for (i = 0; i < nrhs; ++i) + printf("%8d%8d%16e%16e\n", i+1, stat.RefineSteps, ferr[i], berr[i]); + } + fflush(stdout); + } else if ( info > 0 && lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", info - n); + } + + if ( options.PrintStat ) StatPrint(&stat); + StatFree(&stat); + + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + Destroy_CompCol_Matrix(&A1); + Destroy_Dense_Matrix(&B1); + Destroy_Dense_Matrix(&X); + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } else if ( lwork > 0 ) { + SUPERLU_FREE(work); + } + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC("Exit main()"); +#endif +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +void +parse_command_line(int argc, char *argv[], int *lwork, + double *u, yes_no_t *equil, trans_t *trans ) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "hl:u:e:t:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-l - length of work[*] array\n"); + printf("\t-u - pivoting threshold\n"); + printf("\t-e <0 or 1> - equilibrate or not\n"); + printf("\t-t <0 or 1> - solve transposed system or not\n"); + exit(1); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + case 'e': *equil = atoi(optarg); + break; + case 't': *trans = atoi(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zreadtriple.c b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zreadtriple.c new file mode 100644 index 0000000..5924f09 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/EXAMPLE/zreadtriple.c @@ -0,0 +1,90 @@ + +#include +#include +#include "slu_zdefs.h" +#include "slu_util.h" + + +void +zreadtriple(int *m, int *n, int *nonz, + doublecomplex **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int i, j, k, jsize, nz, lasta; + doublecomplex *a, *val; + int *asub, *xa, *row, *col; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d%d", m, n, nonz); +#ifdef DEBUG + printf("zreadtriple(): *m %d, *n %d, *nonz, %d\n", *m, *n, *nonz); +#endif + zallocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (doublecomplex *) SUPERLU_MALLOC(*nonz * sizeof(doublecomplex)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + /* Read into the triplet array from a file */ + for (i = 0; i < *n+1; ++i) xa[i] = 0; + for (nz = 0; nz < *nonz; ++nz) { + scanf("%d%d%lf%lf\n", &row[nz], &col[nz], &val[nz].r, &val[nz].i); + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n) { + fprintf(stderr, "(%d, %d) out of bound!\n", row[nz], col[nz]); + exit (-1); + } + ++xa[col[nz]]; /* Count number of nonzeros in each column */ + } + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } +#endif + +} diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/Makefile b/thirdparty/superlu/SuperLU_4.1/FORTRAN/Makefile new file mode 100644 index 0000000..7e1f81e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/Makefile @@ -0,0 +1,28 @@ +include ../make.inc + +####################################################################### +# This makefile creates the Fortran example interface to use the +# C routines in SuperLU. +####################################################################### + +HEADER = ../SRC +LIBS = $(SUPERLULIB) $(BLASLIB) -lm + +F77EXM = f77_main.o hbcode1.o c_fortran_dgssv.o + +all: f77exm + +f77exm: $(F77EXM) $(SUPERLULIB) + $(FORTRAN) $(LOADOPTS) $(F77EXM) $(LIBS) -o $@ + +c_fortran_zgssv.o: c_fortran_zgssv.c + $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE) + +.c.o: + $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE) + +.f.o: + $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE) + +clean: + rm -f *.o f77exm diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/README b/thirdparty/superlu/SuperLU_4.1/FORTRAN/README new file mode 100644 index 0000000..c51a527 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/README @@ -0,0 +1,10 @@ + FORTRAN INTERFACE + +This directory contains the Fortran example interface to use the +C routines in SuperLU. + +To compile the examples, type: + % make + +To run the examples, type: + % f77exm < ../EXAMPLE/g10 diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_cgssv.c b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_cgssv.c new file mode 100644 index 0000000..550f3e7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_cgssv.c @@ -0,0 +1,174 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "slu_cdefs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef int fptr; /* 32-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_cgssv_(int *iopt, int *n, int *nnz, int *nrhs, + complex *values, int *rowind, int *colptr, + complex *b, int *ldb, + fptr *f_factors, /* a handle containing the address + pointing to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * f_factors (input/output) fptr* + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + cCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_C, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = options.ColPerm; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + cgstrf(&options, &AC, relax, panel_size, etree, + NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + cQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } else { + printf("cgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + cQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + *f_factors = (fptr) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + cCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_C, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + cgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_cgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c new file mode 100644 index 0000000..2cd56a8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c @@ -0,0 +1,174 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "slu_ddefs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef long long fptr; /* 64-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_dgssv_(int *iopt, int *n, int *nnz, int *nrhs, + double *values, int *rowind, int *colptr, + double *b, int *ldb, + fptr *f_factors, /* a handle containing the address + pointing to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * f_factors (input/output) fptr* + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + dCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_D, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = options.ColPerm; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + dgstrf(&options, &AC, relax, panel_size, etree, + NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } else { + printf("dgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + *f_factors = (fptr) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + dCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_D, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + dgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_dgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.bak b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.bak new file mode 100644 index 0000000..284abef --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.bak @@ -0,0 +1,175 @@ +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "dsp_defs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef int fptr; /* 32-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_dgssv_(int *iopt, int *n, int *nnz, int *nrhs, double *values, + int *rowind, int *colptr, double *b, int *ldb, + fptr *f_factors, /* a handle containing the address + pointing to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * f_factors (input/output) fptr* + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + double drop_tol = 0.0; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + dCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_D, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = options.ColPerm; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + dgstrf(&options, &AC, drop_tol, relax, panel_size, + etree, NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\texpansions %d\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6, + mem_usage.expansions); + } else { + printf("dgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\texpansions %d\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6, + mem_usage.expansions); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + *f_factors = (fptr) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + dCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_D, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + dgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_dgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.old b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.old new file mode 100644 index 0000000..7eb3fc6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_dgssv.c.old @@ -0,0 +1,175 @@ +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "dsp_defs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef int fptr; /* 32-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_dgssv_(int *iopt, int *n, int *nnz, int *nrhs, double *values, + int *rowind, int *colptr, double *b, int *ldb, + int factors[HANDLE_SIZE], /* a handle containing the pointer + to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * factors (input/output) int array of size 8 + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + double drop_tol = 0.0; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + dCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_D, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = 3; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + dgstrf(&options, &AC, drop_tol, relax, panel_size, + etree, NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\texpansions %d\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6, + mem_usage.expansions); + } else { + printf("dgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + dQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\texpansions %d\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6, + mem_usage.expansions); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + factors[0] = (int) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) factors[0]; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + dCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_D, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + dgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) factors[0]; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_dgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_sgssv.c b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_sgssv.c new file mode 100644 index 0000000..873833c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_sgssv.c @@ -0,0 +1,174 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "slu_sdefs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef int fptr; /* 32-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_sgssv_(int *iopt, int *n, int *nnz, int *nrhs, + float *values, int *rowind, int *colptr, + float *b, int *ldb, + fptr *f_factors, /* a handle containing the address + pointing to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * f_factors (input/output) fptr* + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + sCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_S, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = options.ColPerm; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + sgstrf(&options, &AC, relax, panel_size, etree, + NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + sQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } else { + printf("sgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + sQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + *f_factors = (fptr) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + sCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_S, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + sgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_sgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_zgssv.c b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_zgssv.c new file mode 100644 index 0000000..ce43570 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/c_fortran_zgssv.c @@ -0,0 +1,174 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ + +#include "slu_zdefs.h" + +#define HANDLE_SIZE 8 +/* kind of integer to hold a pointer. Use int. + This might need to be changed on 64-bit systems. */ +typedef int fptr; /* 32-bit by default */ + +typedef struct { + SuperMatrix *L; + SuperMatrix *U; + int *perm_c; + int *perm_r; +} factors_t; + +void +c_fortran_zgssv_(int *iopt, int *n, int *nnz, int *nrhs, + doublecomplex *values, int *rowind, int *colptr, + doublecomplex *b, int *ldb, + fptr *f_factors, /* a handle containing the address + pointing to the factored matrices */ + int *info) + +{ +/* + * This routine can be called from Fortran. + * + * iopt (input) int + * Specifies the operation: + * = 1, performs LU decomposition for the first time + * = 2, performs triangular solve + * = 3, free all the storage in the end + * + * f_factors (input/output) fptr* + * If iopt == 1, it is an output and contains the pointer pointing to + * the structure of the factored matrices. + * Otherwise, it it an input. + * + */ + + SuperMatrix A, AC, B; + SuperMatrix *L, *U; + int *perm_r; /* row permutations from partial pivoting */ + int *perm_c; /* column permutation vector */ + int *etree; /* column elimination tree */ + SCformat *Lstore; + NCformat *Ustore; + int i, panel_size, permc_spec, relax; + trans_t trans; + mem_usage_t mem_usage; + superlu_options_t options; + SuperLUStat_t stat; + factors_t *LUfactors; + + trans = NOTRANS; + + if ( *iopt == 1 ) { /* LU decomposition */ + + /* Set the default input options. */ + set_default_options(&options); + + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Adjust to 0-based indexing */ + for (i = 0; i < *nnz; ++i) --rowind[i]; + for (i = 0; i <= *n; ++i) --colptr[i]; + + zCreate_CompCol_Matrix(&A, *n, *n, *nnz, values, rowind, colptr, + SLU_NC, SLU_Z, SLU_GE); + L = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + U = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + if ( !(perm_r = intMalloc(*n)) ) ABORT("Malloc fails for perm_r[]."); + if ( !(perm_c = intMalloc(*n)) ) ABORT("Malloc fails for perm_c[]."); + if ( !(etree = intMalloc(*n)) ) ABORT("Malloc fails for etree[]."); + + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = 0: natural ordering + * permc_spec = 1: minimum degree on structure of A'*A + * permc_spec = 2: minimum degree on structure of A'+A + * permc_spec = 3: approximate minimum degree for unsymmetric matrices + */ + permc_spec = options.ColPerm; + get_perm_c(permc_spec, &A, perm_c); + + sp_preorder(&options, &A, perm_c, etree, &AC); + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + zgstrf(&options, &AC, relax, panel_size, etree, + NULL, 0, perm_c, perm_r, L, U, &stat, info); + + if ( *info == 0 ) { + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("No of nonzeros in factor L = %d\n", Lstore->nnz); + printf("No of nonzeros in factor U = %d\n", Ustore->nnz); + printf("No of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + zQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } else { + printf("zgstrf() error returns INFO= %d\n", *info); + if ( *info <= *n ) { /* factorization completes */ + zQuerySpace(L, U, &mem_usage); + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage.for_lu/1e6, mem_usage.total_needed/1e6); + } + } + + /* Restore to 1-based indexing */ + for (i = 0; i < *nnz; ++i) ++rowind[i]; + for (i = 0; i <= *n; ++i) ++colptr[i]; + + /* Save the LU factors in the factors handle */ + LUfactors = (factors_t*) SUPERLU_MALLOC(sizeof(factors_t)); + LUfactors->L = L; + LUfactors->U = U; + LUfactors->perm_c = perm_c; + LUfactors->perm_r = perm_r; + *f_factors = (fptr) LUfactors; + + /* Free un-wanted storage */ + SUPERLU_FREE(etree); + Destroy_SuperMatrix_Store(&A); + Destroy_CompCol_Permuted(&AC); + StatFree(&stat); + + } else if ( *iopt == 2 ) { /* Triangular solve */ + /* Initialize the statistics variables. */ + StatInit(&stat); + + /* Extract the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + L = LUfactors->L; + U = LUfactors->U; + perm_c = LUfactors->perm_c; + perm_r = LUfactors->perm_r; + + zCreate_Dense_Matrix(&B, *n, *nrhs, b, *ldb, SLU_DN, SLU_Z, SLU_GE); + + /* Solve the system A*X=B, overwriting B with X. */ + zgstrs (trans, L, U, perm_c, perm_r, &B, &stat, info); + + Destroy_SuperMatrix_Store(&B); + StatFree(&stat); + + } else if ( *iopt == 3 ) { /* Free storage */ + /* Free the LU factors in the factors handle */ + LUfactors = (factors_t*) *f_factors; + SUPERLU_FREE (LUfactors->perm_r); + SUPERLU_FREE (LUfactors->perm_c); + Destroy_SuperNode_Matrix(LUfactors->L); + Destroy_CompCol_Matrix(LUfactors->U); + SUPERLU_FREE (LUfactors->L); + SUPERLU_FREE (LUfactors->U); + SUPERLU_FREE (LUfactors); + } else { + fprintf(stderr,"Invalid iopt=%d passed to c_fortran_zgssv()\n",*iopt); + exit(-1); + } +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f new file mode 100644 index 0000000..997f88e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f @@ -0,0 +1,48 @@ + program f77_main + integer maxn, maxnz + parameter ( maxn = 10000, maxnz = 100000 ) + integer rowind(maxnz), colptr(maxn) + real*8 values(maxnz), b(maxn) + integer n, nnz, nrhs, ldb, info, iopt + integer*8 factors +* + call hbcode1(n, n, nnz, values, rowind, colptr) +* + nrhs = 1 + ldb = n + do i = 1, n + b(i) = 1 + enddo +* +* First, factorize the matrix. The factors are stored in *factors* handle. + iopt = 1 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + if (info .eq. 0) then + write (*,*) 'Factorization succeeded' + else + write(*,*) 'INFO from factorization = ', info + endif +* +* Second, solve the system using the existing factors. + iopt = 2 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + if (info .eq. 0) then + write (*,*) 'Solve succeeded' + write (*,*) (b(i), i=1, 10) + else + write(*,*) 'INFO from triangular solve = ', info + endif + +* Last, free the storage allocated inside SuperLU + iopt = 3 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + stop + end + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f.old b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f.old new file mode 100644 index 0000000..aa7e429 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77_main.f.old @@ -0,0 +1,48 @@ + program f77_main + integer maxn, maxnz + parameter ( maxn = 10000, maxnz = 100000 ) + integer rowind(maxnz), colptr(maxn) + real*8 values(maxnz), b(maxn) + integer n, nnz, nrhs, ldb, info + integer factors(8), iopt +* + call hbcode1(n, n, nnz, values, rowind, colptr) +* + nrhs = 1 + ldb = n + do i = 1, n + b(i) = 1 + enddo +* +* First, factorize the matrix. The factors are stored in factor() handle. + iopt = 1 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + if (info .eq. 0) then + write (*,*) 'Factorization succeeded' + else + write(*,*) 'INFO from factorization = ', info + endif +* +* Second, solve the system using the existing factors. + iopt = 2 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + if (info .eq. 0) then + write (*,*) 'Solve succeeded' + write (*,*) (b(i), i=1, 10) + else + write(*,*) 'INFO from triangular solve = ', info + endif + +* Last, free the storage allocated inside SuperLU + iopt = 3 + call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr, + $ b, ldb, factors, info ) +* + stop + end + + diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77exm.out b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77exm.out new file mode 100644 index 0000000..186fa25 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/f77exm.out @@ -0,0 +1,9 @@ +No of nonzeros in factor L = 835 +No of nonzeros in factor U = 978 +No of nonzeros in L+U = 1813 +L\U MB 0.020 total MB needed 0.040 expansions 0 + Factorization succeeded + Solve succeeded + 188.45681574593 133.96798695468 -470.23879928609 -278.80339526911 + 19.917307361526 272.77268232866 -247.80663474720 -313.99765880983 + -91.277211882061 99.759496460021 diff --git a/thirdparty/superlu/SuperLU_4.1/FORTRAN/hbcode1.f b/thirdparty/superlu/SuperLU_4.1/FORTRAN/hbcode1.f new file mode 100644 index 0000000..df63c6c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/FORTRAN/hbcode1.f @@ -0,0 +1,46 @@ + subroutine hbcode1(nrow, ncol, nnzero, values, rowind, colptr) + +C ================================================================ +C ... SAMPLE CODE FOR READING A SPARSE MATRIX IN STANDARD FORMAT +C ================================================================ + + CHARACTER TITLE*72 , KEY*8 , MXTYPE*3 , + 1 PTRFMT*16, INDFMT*16, VALFMT*20, RHSFMT*20 + + INTEGER TOTCRD, PTRCRD, INDCRD, VALCRD, RHSCRD, + 1 NROW , NCOL , NNZERO, NELTVL + + INTEGER COLPTR (*), ROWIND (*) + + REAL*8 VALUES (*) + +C ------------------------ +C ... READ IN HEADER BLOCK +C ------------------------ + + READ ( *, 1000 ) TITLE , KEY , + 1 TOTCRD, PTRCRD, INDCRD, VALCRD, RHSCRD, + 2 MXTYPE, NROW , NCOL , NNZERO, NELTVL, + 3 PTRFMT, INDFMT, VALFMT, RHSFMT + 1000 FORMAT ( A72, A8 / 5I14 / A3, 11X, 4I14 / 2A16, 2A20 ) + +C ------------------------- +C ... READ MATRIX STRUCTURE +C ------------------------- + + READ ( *, PTRFMT ) ( COLPTR (I), I = 1, NCOL+1 ) + + READ ( *, INDFMT ) ( ROWIND (I), I = 1, NNZERO ) + + IF ( VALCRD .GT. 0 ) THEN + +C ---------------------- +C ... READ MATRIX VALUES +C ---------------------- + + READ ( *, VALFMT ) ( VALUES (I), I = 1, NNZERO ) + + ENDIF + + return + end diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/Makefile b/thirdparty/superlu/SuperLU_4.1/INSTALL/Makefile new file mode 100644 index 0000000..a75e370 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/Makefile @@ -0,0 +1,26 @@ +include ../make.inc + +all: testdlamch testslamch testtimer install.out + +testdlamch: dlamch.o lsame.o dlamchtst.o + $(LOADER) $(LOADOPTS) -o testdlamch dlamch.o lsame.o dlamchtst.o + +testslamch: slamch.o lsame.o slamchtst.o + $(LOADER) $(LOADOPTS) -o testslamch slamch.o lsame.o slamchtst.o + +testtimer: superlu_timer.o timertst.o + $(LOADER) $(LOADOPTS) -o testtimer superlu_timer.o timertst.o + +install.out: install.csh + @echo Testing machines parameters and timer + csh install.csh + +slamch.o: slamch.c ; $(CC) -c $(NOOPTS) $< +dlamch.o: dlamch.c ; $(CC) -c $(NOOPTS) $< +superlu_timer.o: superlu_timer.c; $(CC) -c $(NOOPTS) $< + +.c.o: + $(CC) $(CFLAGS) -c $< + +clean: + rm -f *.o test* *.out diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamch.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamch.c new file mode 100644 index 0000000..6db3da6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamch.c @@ -0,0 +1,963 @@ +#include +#define TRUE_ (1) +#define FALSE_ (0) +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) + +double dlamch_(char *cmach) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + Purpose + ======= + + DLAMCH determines double precision machine parameters. + + Arguments + ========= + + CMACH (input) CHARACTER*1 + Specifies the value to be returned by DLAMCH: + = 'E' or 'e', DLAMCH := eps + = 'S' or 's , DLAMCH := sfmin + = 'B' or 'b', DLAMCH := base + = 'P' or 'p', DLAMCH := eps*base + = 'N' or 'n', DLAMCH := t + = 'R' or 'r', DLAMCH := rnd + = 'M' or 'm', DLAMCH := emin + = 'U' or 'u', DLAMCH := rmin + = 'L' or 'l', DLAMCH := emax + = 'O' or 'o', DLAMCH := rmax + + where + + eps = relative machine precision + sfmin = safe minimum, such that 1/sfmin does not overflow + base = base of the machine + prec = eps*base + t = number of (base) digits in the mantissa + rnd = 1.0 when rounding occurs in addition, 0.0 otherwise + emin = minimum exponent before (gradual) underflow + rmin = underflow threshold - base**(emin-1) + emax = largest exponent before overflow + rmax = overflow threshold - (base**emax)*(1-eps) + + ===================================================================== +*/ + + static int first = TRUE_; + + /* System generated locals */ + int i__1; + double ret_val; + /* Builtin functions */ + double pow_di(double *, int *); + /* Local variables */ + static double base; + static int beta; + static double emin, prec, emax; + static int imin, imax; + static int lrnd; + static double rmin, rmax, t, rmach; +/* extern int lsame_(char *, char *);*/ + static double small, sfmin; + extern /* Subroutine */ int dlamc2_(int *, int *, int *, + double *, int *, double *, int *, double *); + static int it; + static double rnd, eps; + + if (first) { + first = FALSE_; + dlamc2_(&beta, &it, &lrnd, &eps, &imin, &rmin, &imax, &rmax); + base = (double) beta; + t = (double) it; + if (lrnd) { + rnd = 1.; + i__1 = 1 - it; + eps = pow_di(&base, &i__1) / 2; + } else { + rnd = 0.; + i__1 = 1 - it; + eps = pow_di(&base, &i__1); + } + prec = eps * base; + emin = (double) imin; + emax = (double) imax; + sfmin = rmin; + small = 1. / rmax; + if (small >= sfmin) { + + /* Use SMALL plus a bit, to avoid the possibility of rounding + causing overflow when computing 1/sfmin. */ + sfmin = small * (eps + 1.); + } + } + + if (lsame_(cmach, "E")) { + rmach = eps; + } else if (lsame_(cmach, "S")) { + rmach = sfmin; + } else if (lsame_(cmach, "B")) { + rmach = base; + } else if (lsame_(cmach, "P")) { + rmach = prec; + } else if (lsame_(cmach, "N")) { + rmach = t; + } else if (lsame_(cmach, "R")) { + rmach = rnd; + } else if (lsame_(cmach, "M")) { + rmach = emin; + } else if (lsame_(cmach, "U")) { + rmach = rmin; + } else if (lsame_(cmach, "L")) { + rmach = emax; + } else if (lsame_(cmach, "O")) { + rmach = rmax; + } + + ret_val = rmach; + return ret_val; + +/* End of DLAMCH */ + +} /* dlamch_ */ + + +/* Subroutine */ int dlamc1_(int *beta, int *t, int *rnd, int + *ieee1) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC1 determines the machine parameters given by BETA, T, RND, and + IEEE1. + + Arguments + ========= + + BETA (output) INT + The base of the machine. + + T (output) INT + The number of ( BETA ) digits in the mantissa. + + RND (output) INT + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not + + be a reliable guide to the way in which the machine performs + + its arithmetic. + + IEEE1 (output) INT + Specifies whether rounding appears to be done in the IEEE + 'round to nearest' style. + + Further Details + =============== + + The routine is based on the routine ENVRON by Malcolm and + incorporates suggestions by Gentleman and Marovich. See + + Malcolm M. A. (1972) Algorithms to reveal properties of + floating-point arithmetic. Comms. of the ACM, 15, 949-951. + + Gentleman W. M. and Marovich S. B. (1974) More on algorithms + that reveal properties of floating point arithmetic units. + Comms. of the ACM, 17, 276-277. + + ===================================================================== +*/ + /* Initialized data */ + static int first = TRUE_; + /* System generated locals */ + double d__1, d__2; + /* Local variables */ + static int lrnd; + static double a, b, c, f; + static int lbeta; + static double savec; + extern double dlamc3_(double *, double *); + static int lieee1; + static double t1, t2; + static int lt; + static double one, qtr; + + if (first) { + first = FALSE_; + one = 1.; + +/* LBETA, LIEEE1, LT and LRND are the local values of BE +TA, + IEEE1, T and RND. + + Throughout this routine we use the function DLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + Compute a = 2.0**m with the smallest positive integer m s +uch + that + + fl( a + 1.0 ) = a. */ + + a = 1.; + c = 1.; + +/* + WHILE( C.EQ.ONE )LOOP */ +L10: + if (c == one) { + a *= 2; + c = dlamc3_(&a, &one); + d__1 = -a; + c = dlamc3_(&c, &d__1); + goto L10; + } +/* + END WHILE + + Now compute b = 2.0**m with the smallest positive integer +m + such that + + fl( a + b ) .gt. a. */ + + b = 1.; + c = dlamc3_(&a, &b); + +/* + WHILE( C.EQ.A )LOOP */ +L20: + if (c == a) { + b *= 2; + c = dlamc3_(&a, &b); + goto L20; + } +/* + END WHILE + + Now compute the base. a and c are neighbouring floating po +int + numbers in the interval ( beta**t, beta**( t + 1 ) ) and + so + their difference is beta. Adding 0.25 to c is to ensure that + it + is truncated to beta and not ( beta - 1 ). */ + + qtr = one / 4; + savec = c; + d__1 = -a; + c = dlamc3_(&c, &d__1); + lbeta = (int) (c + qtr); + +/* Now determine whether rounding or chopping occurs, by addin +g a + bit less than beta/2 and a bit more than beta/2 to + a. */ + + b = (double) lbeta; + d__1 = b / 2; + d__2 = -b / 100; + f = dlamc3_(&d__1, &d__2); + c = dlamc3_(&f, &a); + if (c == a) { + lrnd = TRUE_; + } else { + lrnd = FALSE_; + } + d__1 = b / 2; + d__2 = b / 100; + f = dlamc3_(&d__1, &d__2); + c = dlamc3_(&f, &a); + if (lrnd && c == a) { + lrnd = FALSE_; + } + +/* Try and decide whether rounding is done in the IEEE 'round + to + nearest' style. B/2 is half a unit in the last place of the +two + numbers A and SAVEC. Furthermore, A is even, i.e. has last +bit + zero, and SAVEC is odd. Thus adding B/2 to A should not cha +nge + A, but adding B/2 to SAVEC should change SAVEC. */ + + d__1 = b / 2; + t1 = dlamc3_(&d__1, &a); + d__1 = b / 2; + t2 = dlamc3_(&d__1, &savec); + lieee1 = t1 == a && t2 > savec && lrnd; + +/* Now find the mantissa, t. It should be the integer part + of + log to the base beta of a, however it is safer to determine + t + by powering. So we find t as the smallest positive integer +for + which + + fl( beta**t + 1.0 ) = 1.0. */ + + lt = 0; + a = 1.; + c = 1.; + +/* + WHILE( C.EQ.ONE )LOOP */ +L30: + if (c == one) { + ++lt; + a *= lbeta; + c = dlamc3_(&a, &one); + d__1 = -a; + c = dlamc3_(&c, &d__1); + goto L30; + } +/* + END WHILE */ + + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *ieee1 = lieee1; + return 0; + +/* End of DLAMC1 */ + +} /* dlamc1_ */ + + +/* Subroutine */ int dlamc2_(int *beta, int *t, int *rnd, + double *eps, int *emin, double *rmin, int *emax, + double *rmax) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC2 determines the machine parameters specified in its argument + list. + + Arguments + ========= + + BETA (output) INT + The base of the machine. + + T (output) INT + The number of ( BETA ) digits in the mantissa. + + RND (output) INT + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not + + be a reliable guide to the way in which the machine performs + + its arithmetic. + + EPS (output) DOUBLE PRECISION + The smallest positive number such that + + fl( 1.0 - EPS ) .LT. 1.0, + + where fl denotes the computed value. + + EMIN (output) INT + The minimum exponent before (gradual) underflow occurs. + + RMIN (output) DOUBLE PRECISION + The smallest normalized number for the machine, given by + BASE**( EMIN - 1 ), where BASE is the floating point value + + of BETA. + + EMAX (output) INT + The maximum exponent before overflow occurs. + + RMAX (output) DOUBLE PRECISION + The largest positive number for the machine, given by + BASE**EMAX * ( 1 - EPS ), where BASE is the floating point + + value of BETA. + + Further Details + =============== + + The computation of EPS is based on a routine PARANOIA by + W. Kahan of the University of California at Berkeley. + + ===================================================================== +*/ + /* Table of constant values */ + static int c__1 = 1; + + /* Initialized data */ + static int first = TRUE_; + static int iwarn = FALSE_; + /* System generated locals */ + int i__1; + double d__1, d__2, d__3, d__4, d__5; + /* Builtin functions */ + double pow_di(double *, int *); + /* Local variables */ + static int ieee; + static double half; + static int lrnd; + static double leps, zero, a, b, c; + static int i, lbeta; + static double rbase; + static int lemin, lemax, gnmin; + static double small; + static int gpmin; + static double third, lrmin, lrmax, sixth; + extern /* Subroutine */ int dlamc1_(int *, int *, int *, + int *); + extern double dlamc3_(double *, double *); + static int lieee1; + extern /* Subroutine */ int dlamc4_(int *, double *, int *), + dlamc5_(int *, int *, int *, int *, int *, + double *); + static int lt, ngnmin, ngpmin; + static double one, two; + + if (first) { + first = FALSE_; + zero = 0.; + one = 1.; + two = 2.; + +/* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values + of + BETA, T, RND, EPS, EMIN and RMIN. + + Throughout this routine we use the function DLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. +*/ + + dlamc1_(&lbeta, <, &lrnd, &lieee1); + +/* Start to find EPS. */ + + b = (double) lbeta; + i__1 = -lt; + a = pow_di(&b, &i__1); + leps = a; + +/* Try some tricks to see whether or not this is the correct E +PS. */ + + b = two / 3; + half = one / 2; + d__1 = -half; + sixth = dlamc3_(&b, &d__1); + third = dlamc3_(&sixth, &sixth); + d__1 = -half; + b = dlamc3_(&third, &d__1); + b = dlamc3_(&b, &sixth); + b = abs(b); + if (b < leps) { + b = leps; + } + + leps = 1.; + +/* + WHILE( ( LEPS.GT.B ).AND.( B.GT.ZERO ) )LOOP */ +L10: + if (leps > b && b > zero) { + leps = b; + d__1 = half * leps; +/* Computing 5th power */ + d__3 = two, d__4 = d__3, d__3 *= d__3; +/* Computing 2nd power */ + d__5 = leps; + d__2 = d__4 * (d__3 * d__3) * (d__5 * d__5); + c = dlamc3_(&d__1, &d__2); + d__1 = -c; + c = dlamc3_(&half, &d__1); + b = dlamc3_(&half, &c); + d__1 = -b; + c = dlamc3_(&half, &d__1); + b = dlamc3_(&half, &c); + goto L10; + } +/* + END WHILE */ + + if (a < leps) { + leps = a; + } + +/* Computation of EPS complete. + + Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3 +)). + Keep dividing A by BETA until (gradual) underflow occurs. T +his + is detected when we cannot recover the previous A. */ + + rbase = one / lbeta; + small = one; + for (i = 1; i <= 3; ++i) { + d__1 = small * rbase; + small = dlamc3_(&d__1, &zero); +/* L20: */ + } + a = dlamc3_(&one, &small); + dlamc4_(&ngpmin, &one, &lbeta); + d__1 = -one; + dlamc4_(&ngnmin, &d__1, &lbeta); + dlamc4_(&gpmin, &a, &lbeta); + d__1 = -a; + dlamc4_(&gnmin, &d__1, &lbeta); + ieee = FALSE_; + + if (ngpmin == ngnmin && gpmin == gnmin) { + if (ngpmin == gpmin) { + lemin = ngpmin; +/* ( Non twos-complement machines, no gradual under +flow; + e.g., VAX ) */ + } else if (gpmin - ngpmin == 3) { + lemin = ngpmin - 1 + lt; + ieee = TRUE_; +/* ( Non twos-complement machines, with gradual und +erflow; + e.g., IEEE standard followers ) */ + } else { + lemin = min(ngpmin,gpmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if (ngpmin == gpmin && ngnmin == gnmin) { + if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) { + lemin = max(ngpmin,ngnmin); +/* ( Twos-complement machines, no gradual underflow +; + e.g., CYBER 205 ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1 && gpmin == gnmin) + { + if (gpmin - min(ngpmin,ngnmin) == 3) { + lemin = max(ngpmin,ngnmin) - 1 + lt; +/* ( Twos-complement machines with gradual underflo +w; + no known machine ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else { +/* Computing MIN */ + i__1 = min(ngpmin,ngnmin), i__1 = min(i__1,gpmin); + lemin = min(i__1,gnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } +/* ** + Comment out this if block if EMIN is ok */ + if (iwarn) { + first = TRUE_; + printf("\n\n WARNING. The value EMIN may be incorrect:- "); + printf("EMIN = %8i\n",lemin); + printf("If, after inspection, the value EMIN looks acceptable"); + printf("please comment out \n the IF block as marked within the"); + printf("code of routine DLAMC2, \n otherwise supply EMIN"); + printf("explicitly.\n"); + } +/* ** + + Assume IEEE arithmetic if we found denormalised numbers abo +ve, + or if arithmetic seems to round in the IEEE style, determi +ned + in routine DLAMC1. A true IEEE machine should have both thi +ngs + true; however, faulty machines may have one or the other. */ + + ieee = ieee || lieee1; + +/* Compute RMIN by successive division by BETA. We could comp +ute + RMIN as BASE**( EMIN - 1 ), but some machines underflow dur +ing + this computation. */ + + lrmin = 1.; + i__1 = 1 - lemin; + for (i = 1; i <= 1-lemin; ++i) { + d__1 = lrmin * rbase; + lrmin = dlamc3_(&d__1, &zero); +/* L30: */ + } + +/* Finally, call DLAMC5 to compute EMAX and RMAX. */ + + dlamc5_(&lbeta, <, &lemin, &ieee, &lemax, &lrmax); + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *eps = leps; + *emin = lemin; + *rmin = lrmin; + *emax = lemax; + *rmax = lrmax; + + return 0; + + +/* End of DLAMC2 */ + +} /* dlamc2_ */ + + +double dlamc3_(double *a, double *b) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC3 is intended to force A and B to be stored prior to doing + + the addition of A and B , for use in situations where optimizers + + might hold one of these in a register. + + Arguments + ========= + + A, B (input) DOUBLE PRECISION + The values A and B. + + ===================================================================== +*/ +/* >>Start of File<< + System generated locals */ + double ret_val; + + ret_val = *a + *b; + + return ret_val; + +/* End of DLAMC3 */ + +} /* dlamc3_ */ + + +/* Subroutine */ int dlamc4_(int *emin, double *start, int *base) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC4 is a service routine for DLAMC2. + + Arguments + ========= + + EMIN (output) EMIN + The minimum exponent before (gradual) underflow, computed by + + setting A = START and dividing by BASE until the previous A + can not be recovered. + + START (input) DOUBLE PRECISION + The starting point for determining EMIN. + + BASE (input) INT + The base of the machine. + + ===================================================================== +*/ + /* System generated locals */ + int i__1; + double d__1; + /* Local variables */ + static double zero, a; + static int i; + static double rbase, b1, b2, c1, c2, d1, d2; + extern double dlamc3_(double *, double *); + static double one; + + a = *start; + one = 1.; + rbase = one / *base; + zero = 0.; + *emin = 1; + d__1 = a * rbase; + b1 = dlamc3_(&d__1, &zero); + c1 = a; + c2 = a; + d1 = a; + d2 = a; +/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. + $ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */ +L10: + if (c1 == a && c2 == a && d1 == a && d2 == a) { + --(*emin); + a = b1; + d__1 = a / *base; + b1 = dlamc3_(&d__1, &zero); + d__1 = b1 * *base; + c1 = dlamc3_(&d__1, &zero); + d1 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d1 += b1; +/* L20: */ + } + d__1 = a * rbase; + b2 = dlamc3_(&d__1, &zero); + d__1 = b2 / rbase; + c2 = dlamc3_(&d__1, &zero); + d2 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d2 += b2; +/* L30: */ + } + goto L10; + } +/* + END WHILE */ + + return 0; + +/* End of DLAMC4 */ + +} /* dlamc4_ */ + + +/* Subroutine */ int dlamc5_(int *beta, int *p, int *emin, + int *ieee, int *emax, double *rmax) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLAMC5 attempts to compute RMAX, the largest machine floating-point + number, without overflow. It assumes that EMAX + abs(EMIN) sum + approximately to a power of 2. It will fail on machines where this + assumption does not hold, for example, the Cyber 205 (EMIN = -28625, + + EMAX = 28718). It will also fail if the value supplied for EMIN is + too large (i.e. too close to zero), probably with overflow. + + Arguments + ========= + + BETA (input) INT + The base of floating-point arithmetic. + + P (input) INT + The number of base BETA digits in the mantissa of a + floating-point value. + + EMIN (input) INT + The minimum exponent before (gradual) underflow. + + IEEE (input) INT + A int flag specifying whether or not the arithmetic + system is thought to comply with the IEEE standard. + + EMAX (output) INT + The largest exponent before overflow + + RMAX (output) DOUBLE PRECISION + The largest machine floating-point number. + + ===================================================================== + + + + First compute LEXP and UEXP, two powers of 2 that bound + abs(EMIN). We then assume that EMAX + abs(EMIN) will sum + approximately to the bound that is closest to abs(EMIN). + (EMAX is the exponent of the required number RMAX). */ + /* Table of constant values */ + static double c_b5 = 0.; + + /* System generated locals */ + int i__1; + double d__1; + /* Local variables */ + static int lexp; + static double oldy; + static int uexp, i; + static double y, z; + static int nbits; + extern double dlamc3_(double *, double *); + static double recbas; + static int exbits, expsum, try__; + + + + lexp = 1; + exbits = 1; +L10: + try__ = lexp << 1; + if (try__ <= -(*emin)) { + lexp = try__; + ++exbits; + goto L10; + } + if (lexp == -(*emin)) { + uexp = lexp; + } else { + uexp = try__; + ++exbits; + } + +/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater + than or equal to EMIN. EXBITS is the number of bits needed to + store the exponent. */ + + if (uexp + *emin > -lexp - *emin) { + expsum = lexp << 1; + } else { + expsum = uexp << 1; + } + +/* EXPSUM is the exponent range, approximately equal to + EMAX - EMIN + 1 . */ + + *emax = expsum + *emin - 1; + nbits = exbits + 1 + *p; + +/* NBITS is the total number of bits needed to store a + floating-point number. */ + + if (nbits % 2 == 1 && *beta == 2) { + +/* Either there are an odd number of bits used to store a + floating-point number, which is unlikely, or some bits are + + not used in the representation of numbers, which is possible +, + (e.g. Cray machines) or the mantissa has an implicit bit, + (e.g. IEEE machines, Dec Vax machines), which is perhaps the + + most likely. We have to assume the last alternative. + If this is true, then we need to reduce EMAX by one because + + there must be some way of representing zero in an implicit-b +it + system. On machines like Cray, we are reducing EMAX by one + + unnecessarily. */ + + --(*emax); + } + + if (*ieee) { + +/* Assume we are on an IEEE machine which reserves one exponent + + for infinity and NaN. */ + + --(*emax); + } + +/* Now create RMAX, the largest machine number, which should + be equal to (1.0 - BETA**(-P)) * BETA**EMAX . + + First compute 1.0 - BETA**(-P), being careful that the + result is less than 1.0 . */ + + recbas = 1. / *beta; + z = *beta - 1.; + y = 0.; + i__1 = *p; + for (i = 1; i <= *p; ++i) { + z *= recbas; + if (y < 1.) { + oldy = y; + } + y = dlamc3_(&y, &z); +/* L20: */ + } + if (y >= 1.) { + y = oldy; + } + +/* Now multiply by BETA**EMAX to get RMAX. */ + + i__1 = *emax; + for (i = 1; i <= *emax; ++i) { + d__1 = y * *beta; + y = dlamc3_(&d__1, &c_b5); +/* L30: */ + } + + *rmax = y; + return 0; + +/* End of DLAMC5 */ + +} /* dlamc5_ */ + +double pow_di(double *ap, int *bp) +{ + double pow, x; + int n; + + pow = 1; + x = *ap; + n = *bp; + + if(n != 0){ + if(n < 0) { + n = -n; + x = 1/x; + } + for( ; ; ) { + if(n & 01) pow *= x; + if(n >>= 1) x *= x; + else break; + } + } + return(pow); +} + diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamchtst.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamchtst.c new file mode 100644 index 0000000..e589d23 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/dlamchtst.c @@ -0,0 +1,34 @@ +#include + + +main() +{ + /* Local variables */ + double base, emin, prec, emax, rmin, rmax, t, sfmin; + extern double dlamch_(char *); + double rnd, eps; + + eps = dlamch_("Epsilon"); + sfmin = dlamch_("Safe minimum"); + base = dlamch_("Base"); + prec = dlamch_("Precision"); + t = dlamch_("Number of digits in mantissa"); + rnd = dlamch_("Rounding mode"); + emin = dlamch_("Minnimum exponent"); + rmin = dlamch_("Underflow threshold"); + emax = dlamch_("Largest exponent"); + rmax = dlamch_("Overflow threshold"); + + printf(" Epsilon = %e\n", eps); + printf(" Safe minimum = %e\n", sfmin); + printf(" Base = %.0f\n", base); + printf(" Precision = %e\n", prec); + printf(" Number of digits in mantissa = %.0f\n", t); + printf(" Rounding mode = %.0f\n", rnd); + printf(" Minimum exponent = %.0f\n", emin); + printf(" Underflow threshold = %e\n", rmin); + printf(" Largest exponent = %.0f\n", emax); + printf(" Overflow threshold = %e\n", rmax); + printf(" Reciprocal of safe minimum = %e\n", 1./sfmin); + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/install.csh b/thirdparty/superlu/SuperLU_4.1/INSTALL/install.csh new file mode 100644 index 0000000..57e9e74 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/install.csh @@ -0,0 +1,14 @@ +#! /bin/csh + +set ofile = install.out # output file + +echo '---- SINGLE PRECISION' >! $ofile +./testslamch >> $ofile +echo '' >> $ofile +echo ---- DOUBLE PRECISION >> $ofile +./testdlamch >> $ofile +echo '' >> $ofile +echo ---- TIMER >> $ofile +./testtimer >> $ofile + + diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/lsame.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/lsame.c new file mode 100644 index 0000000..fba47c6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/lsame.c @@ -0,0 +1,70 @@ +int lsame_(char *ca, char *cb) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + Purpose + ======= + + LSAME returns .TRUE. if CA is the same letter as CB regardless of case. + + Arguments + ========= + + CA (input) CHARACTER*1 + CB (input) CHARACTER*1 + CA and CB specify the single characters to be compared. + + ===================================================================== +*/ + + /* System generated locals */ + int ret_val; + + /* Local variables */ + int inta, intb, zcode; + + ret_val = *(unsigned char *)ca == *(unsigned char *)cb; + if (ret_val) { + return ret_val; + } + + /* Now test for equivalence if both characters are alphabetic. */ + + zcode = 'Z'; + + /* Use 'Z' rather than 'A' so that ASCII can be detected on Prime + machines, on which ICHAR returns a value with bit 8 set. + ICHAR('A') on Prime machines returns 193 which is the same as + ICHAR('A') on an EBCDIC machine. */ + + inta = *(unsigned char *)ca; + intb = *(unsigned char *)cb; + + if (zcode == 90 || zcode == 122) { + /* ASCII is assumed - ZCODE is the ASCII code of either lower or + upper case 'Z'. */ + if (inta >= 97 && inta <= 122) inta += -32; + if (intb >= 97 && intb <= 122) intb += -32; + + } else if (zcode == 233 || zcode == 169) { + /* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or + upper case 'Z'. */ + if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta + >= 162 && inta <= 169) + inta += 64; + if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb + >= 162 && intb <= 169) + intb += 64; + } else if (zcode == 218 || zcode == 250) { + /* ASCII is assumed, on Prime machines - ZCODE is the ASCII code + plus 128 of either lower or upper case 'Z'. */ + if (inta >= 225 && inta <= 250) inta += -32; + if (intb >= 225 && intb <= 250) intb += -32; + } + ret_val = inta == intb; + return ret_val; + +} /* lsame_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/slamch.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/slamch.c new file mode 100644 index 0000000..24bbe6f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/slamch.c @@ -0,0 +1,982 @@ +#include +#define TRUE_ (1) +#define FALSE_ (0) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (double)abs(x) + +float slamch_(char *cmach) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMCH determines single precision machine parameters. + + Arguments + ========= + + CMACH (input) CHARACTER*1 + Specifies the value to be returned by SLAMCH: + = 'E' or 'e', SLAMCH := eps + = 'S' or 's , SLAMCH := sfmin + = 'B' or 'b', SLAMCH := base + = 'P' or 'p', SLAMCH := eps*base + = 'N' or 'n', SLAMCH := t + = 'R' or 'r', SLAMCH := rnd + = 'M' or 'm', SLAMCH := emin + = 'U' or 'u', SLAMCH := rmin + = 'L' or 'l', SLAMCH := emax + = 'O' or 'o', SLAMCH := rmax + + where + + eps = relative machine precision + sfmin = safe minimum, such that 1/sfmin does not overflow + base = base of the machine + prec = eps*base + t = number of (base) digits in the mantissa + rnd = 1.0 when rounding occurs in addition, 0.0 otherwise + emin = minimum exponent before (gradual) underflow + rmin = underflow threshold - base**(emin-1) + emax = largest exponent before overflow + rmax = overflow threshold - (base**emax)*(1-eps) + + ===================================================================== +*/ +/* >>Start of File<< + Initialized data */ + static int first = TRUE_; + /* System generated locals */ + int i__1; + float ret_val; + /* Builtin functions */ + double pow_ri(float *, int *); + /* Local variables */ + static float base; + static int beta; + static float emin, prec, emax; + static int imin, imax; + static int lrnd; + static float rmin, rmax, t, rmach; + extern int lsame_(char *, char *); + static float small, sfmin; + extern /* Subroutine */ int slamc2_(int *, int *, int *, float + *, int *, float *, int *, float *); + static int it; + static float rnd, eps; + + + + if (first) { + first = FALSE_; + slamc2_(&beta, &it, &lrnd, &eps, &imin, &rmin, &imax, &rmax); + base = (float) beta; + t = (float) it; + if (lrnd) { + rnd = 1.f; + i__1 = 1 - it; + eps = pow_ri(&base, &i__1) / 2; + } else { + rnd = 0.f; + i__1 = 1 - it; + eps = pow_ri(&base, &i__1); + } + prec = eps * base; + emin = (float) imin; + emax = (float) imax; + sfmin = rmin; + small = 1.f / rmax; + if (small >= sfmin) { + +/* Use SMALL plus a bit, to avoid the possibility of rou +nding + causing overflow when computing 1/sfmin. */ + + sfmin = small * (eps + 1.f); + } + } + + if (lsame_(cmach, "E")) { + rmach = eps; + } else if (lsame_(cmach, "S")) { + rmach = sfmin; + } else if (lsame_(cmach, "B")) { + rmach = base; + } else if (lsame_(cmach, "P")) { + rmach = prec; + } else if (lsame_(cmach, "N")) { + rmach = t; + } else if (lsame_(cmach, "R")) { + rmach = rnd; + } else if (lsame_(cmach, "M")) { + rmach = emin; + } else if (lsame_(cmach, "U")) { + rmach = rmin; + } else if (lsame_(cmach, "L")) { + rmach = emax; + } else if (lsame_(cmach, "O")) { + rmach = rmax; + } + + ret_val = rmach; + return ret_val; + +/* End of SLAMCH */ + +} /* slamch_ */ + + +/* Subroutine */ int slamc1_(int *beta, int *t, int *rnd, int + *ieee1) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMC1 determines the machine parameters given by BETA, T, RND, and + IEEE1. + + Arguments + ========= + + BETA (output) INT + The base of the machine. + + T (output) INT + The number of ( BETA ) digits in the mantissa. + + RND (output) INT + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not + + be a reliable guide to the way in which the machine performs + + its arithmetic. + + IEEE1 (output) INT + Specifies whether rounding appears to be done in the IEEE + 'round to nearest' style. + + Further Details + =============== + + The routine is based on the routine ENVRON by Malcolm and + incorporates suggestions by Gentleman and Marovich. See + + Malcolm M. A. (1972) Algorithms to reveal properties of + floating-point arithmetic. Comms. of the ACM, 15, 949-951. + + Gentleman W. M. and Marovich S. B. (1974) More on algorithms + that reveal properties of floating point arithmetic units. + Comms. of the ACM, 17, 276-277. + + ===================================================================== +*/ + /* Initialized data */ + static int first = TRUE_; + /* System generated locals */ + float r__1, r__2; + /* Local variables */ + static int lrnd; + static float a, b, c, f; + static int lbeta; + static float savec; + static int lieee1; + static float t1, t2; + extern double slamc3_(float *, float *); + static int lt; + static float one, qtr; + + + + if (first) { + first = FALSE_; + one = 1.f; + +/* LBETA, LIEEE1, LT and LRND are the local values of BE +TA, + IEEE1, T and RND. + + Throughout this routine we use the function SLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + Compute a = 2.0**m with the smallest positive integer m s +uch + that + + fl( a + 1.0 ) = a. */ + + a = 1.f; + c = 1.f; + +/* + WHILE( C.EQ.ONE )LOOP */ +L10: + if (c == one) { + a *= 2; + c = slamc3_(&a, &one); + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + goto L10; + } +/* + END WHILE + + Now compute b = 2.0**m with the smallest positive integer +m + such that + + fl( a + b ) .gt. a. */ + + b = 1.f; + c = slamc3_(&a, &b); + +/* + WHILE( C.EQ.A )LOOP */ +L20: + if (c == a) { + b *= 2; + c = slamc3_(&a, &b); + goto L20; + } +/* + END WHILE + + Now compute the base. a and c are neighbouring floating po +int + numbers in the interval ( beta**t, beta**( t + 1 ) ) and + so + their difference is beta. Adding 0.25 to c is to ensure that + it + is truncated to beta and not ( beta - 1 ). */ + + qtr = one / 4; + savec = c; + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + lbeta = c + qtr; + +/* Now determine whether rounding or chopping occurs, by addin +g a + bit less than beta/2 and a bit more than beta/2 to + a. */ + + b = (float) lbeta; + r__1 = b / 2; + r__2 = -(double)b / 100; + f = slamc3_(&r__1, &r__2); + c = slamc3_(&f, &a); + if (c == a) { + lrnd = TRUE_; + } else { + lrnd = FALSE_; + } + r__1 = b / 2; + r__2 = b / 100; + f = slamc3_(&r__1, &r__2); + c = slamc3_(&f, &a); + if (lrnd && c == a) { + lrnd = FALSE_; + } + +/* Try and decide whether rounding is done in the IEEE 'round + to + nearest' style. B/2 is half a unit in the last place of the +two + numbers A and SAVEC. Furthermore, A is even, i.e. has last +bit + zero, and SAVEC is odd. Thus adding B/2 to A should not cha +nge + A, but adding B/2 to SAVEC should change SAVEC. */ + + r__1 = b / 2; + t1 = slamc3_(&r__1, &a); + r__1 = b / 2; + t2 = slamc3_(&r__1, &savec); + lieee1 = t1 == a && t2 > savec && lrnd; + +/* Now find the mantissa, t. It should be the integer part + of + log to the base beta of a, however it is safer to determine + t + by powering. So we find t as the smallest positive integer +for + which + + fl( beta**t + 1.0 ) = 1.0. */ + + lt = 0; + a = 1.f; + c = 1.f; + +/* + WHILE( C.EQ.ONE )LOOP */ +L30: + if (c == one) { + ++lt; + a *= lbeta; + c = slamc3_(&a, &one); + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + goto L30; + } +/* + END WHILE */ + + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *ieee1 = lieee1; + return 0; + +/* End of SLAMC1 */ + +} /* slamc1_ */ + + +/* Subroutine */ int slamc2_(int *beta, int *t, int *rnd, float * + eps, int *emin, float *rmin, int *emax, float *rmax) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMC2 determines the machine parameters specified in its argument + list. + + Arguments + ========= + + BETA (output) INT + The base of the machine. + + T (output) INT + The number of ( BETA ) digits in the mantissa. + + RND (output) INT + Specifies whether proper rounding ( RND = .TRUE. ) or + chopping ( RND = .FALSE. ) occurs in addition. This may not + + be a reliable guide to the way in which the machine performs + + its arithmetic. + + EPS (output) FLOAT + The smallest positive number such that + + fl( 1.0 - EPS ) .LT. 1.0, + + where fl denotes the computed value. + + EMIN (output) INT + The minimum exponent before (gradual) underflow occurs. + + RMIN (output) FLOAT + The smallest normalized number for the machine, given by + BASE**( EMIN - 1 ), where BASE is the floating point value + + of BETA. + + EMAX (output) INT + The maximum exponent before overflow occurs. + + RMAX (output) FLOAT + The largest positive number for the machine, given by + BASE**EMAX * ( 1 - EPS ), where BASE is the floating point + + value of BETA. + + Further Details + =============== + + The computation of EPS is based on a routine PARANOIA by + W. Kahan of the University of California at Berkeley. + + ===================================================================== +*/ + /* Table of constant values */ + static int c__1 = 1; + + /* Initialized data */ + static int first = TRUE_; + static int iwarn = FALSE_; + /* System generated locals */ + int i__1; + float r__1, r__2, r__3, r__4, r__5; + /* Builtin functions */ + double pow_ri(float *, int *); + /* Local variables */ + static int ieee; + static float half; + static int lrnd; + static float leps, zero, a, b, c; + static int i, lbeta; + static float rbase; + static int lemin, lemax, gnmin; + static float small; + static int gpmin; + static float third, lrmin, lrmax, sixth; + static int lieee1; + extern /* Subroutine */ int slamc1_(int *, int *, int *, + int *); + extern double slamc3_(float *, float *); + extern /* Subroutine */ int slamc4_(int *, float *, int *), + slamc5_(int *, int *, int *, int *, int *, + float *); + static int lt, ngnmin, ngpmin; + static float one, two; + + + + if (first) { + first = FALSE_; + zero = 0.f; + one = 1.f; + two = 2.f; + +/* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values + of + BETA, T, RND, EPS, EMIN and RMIN. + + Throughout this routine we use the function SLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + SLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. +*/ + + slamc1_(&lbeta, <, &lrnd, &lieee1); + +/* Start to find EPS. */ + + b = (float) lbeta; + i__1 = -lt; + a = pow_ri(&b, &i__1); + leps = a; + +/* Try some tricks to see whether or not this is the correct E +PS. */ + + b = two / 3; + half = one / 2; + r__1 = -(double)half; + sixth = slamc3_(&b, &r__1); + third = slamc3_(&sixth, &sixth); + r__1 = -(double)half; + b = slamc3_(&third, &r__1); + b = slamc3_(&b, &sixth); + b = dabs(b); + if (b < leps) { + b = leps; + } + + leps = 1.f; + +/* + WHILE( ( LEPS.GT.B ).AND.( B.GT.ZERO ) )LOOP */ +L10: + if (leps > b && b > zero) { + leps = b; + r__1 = half * leps; +/* Computing 5th power */ + r__3 = two, r__4 = r__3, r__3 *= r__3; +/* Computing 2nd power */ + r__5 = leps; + r__2 = r__4 * (r__3 * r__3) * (r__5 * r__5); + c = slamc3_(&r__1, &r__2); + r__1 = -(double)c; + c = slamc3_(&half, &r__1); + b = slamc3_(&half, &c); + r__1 = -(double)b; + c = slamc3_(&half, &r__1); + b = slamc3_(&half, &c); + goto L10; + } +/* + END WHILE */ + + if (a < leps) { + leps = a; + } + +/* Computation of EPS complete. + + Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3 +)). + Keep dividing A by BETA until (gradual) underflow occurs. T +his + is detected when we cannot recover the previous A. */ + + rbase = one / lbeta; + small = one; + for (i = 1; i <= 3; ++i) { + r__1 = small * rbase; + small = slamc3_(&r__1, &zero); +/* L20: */ + } + a = slamc3_(&one, &small); + slamc4_(&ngpmin, &one, &lbeta); + r__1 = -(double)one; + slamc4_(&ngnmin, &r__1, &lbeta); + slamc4_(&gpmin, &a, &lbeta); + r__1 = -(double)a; + slamc4_(&gnmin, &r__1, &lbeta); + ieee = FALSE_; + + if (ngpmin == ngnmin && gpmin == gnmin) { + if (ngpmin == gpmin) { + lemin = ngpmin; +/* ( Non twos-complement machines, no gradual under +flow; + e.g., VAX ) */ + } else if (gpmin - ngpmin == 3) { + lemin = ngpmin - 1 + lt; + ieee = TRUE_; +/* ( Non twos-complement machines, with gradual und +erflow; + e.g., IEEE standard followers ) */ + } else { + lemin = min(ngpmin,gpmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if (ngpmin == gpmin && ngnmin == gnmin) { + if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) { + lemin = max(ngpmin,ngnmin); +/* ( Twos-complement machines, no gradual underflow +; + e.g., CYBER 205 ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1 && gpmin == gnmin) + { + if (gpmin - min(ngpmin,ngnmin) == 3) { + lemin = max(ngpmin,ngnmin) - 1 + lt; +/* ( Twos-complement machines with gradual underflo +w; + no known machine ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else { +/* Computing MIN */ + i__1 = min(ngpmin,ngnmin), i__1 = min(i__1,gpmin); + lemin = min(i__1,gnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } +/* ** + Comment out this if block if EMIN is ok */ + if (iwarn) { + first = TRUE_; + printf("\n\n WARNING. The value EMIN may be incorrect:- "); + printf("EMIN = %8i\n",lemin); + printf("If, after inspection, the value EMIN looks acceptable"); + printf("please comment out \n the IF block as marked within the"); + printf("code of routine SLAMC2, \n otherwise supply EMIN"); + printf("explicitly.\n"); + } +/* ** + + Assume IEEE arithmetic if we found denormalised numbers abo +ve, + or if arithmetic seems to round in the IEEE style, determi +ned + in routine SLAMC1. A true IEEE machine should have both thi +ngs + true; however, faulty machines may have one or the other. */ + + ieee = ieee || lieee1; + +/* Compute RMIN by successive division by BETA. We could comp +ute + RMIN as BASE**( EMIN - 1 ), but some machines underflow dur +ing + this computation. */ + + lrmin = 1.f; + i__1 = 1 - lemin; + for (i = 1; i <= 1-lemin; ++i) { + r__1 = lrmin * rbase; + lrmin = slamc3_(&r__1, &zero); +/* L30: */ + } + +/* Finally, call SLAMC5 to compute EMAX and RMAX. */ + + slamc5_(&lbeta, <, &lemin, &ieee, &lemax, &lrmax); + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *eps = leps; + *emin = lemin; + *rmin = lrmin; + *emax = lemax; + *rmax = lrmax; + + return 0; + + +/* End of SLAMC2 */ + +} /* slamc2_ */ + + +double slamc3_(float *a, float *b) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMC3 is intended to force A and B to be stored prior to doing + + the addition of A and B , for use in situations where optimizers + + might hold one of these in a register. + + Arguments + ========= + + A, B (input) FLOAT + The values A and B. + + ===================================================================== +*/ +/* >>Start of File<< + System generated locals */ + float ret_val; + + + + ret_val = *a + *b; + + return ret_val; + +/* End of SLAMC3 */ + +} /* slamc3_ */ + + +/* Subroutine */ int slamc4_(int *emin, float *start, int *base) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMC4 is a service routine for SLAMC2. + + Arguments + ========= + + EMIN (output) EMIN + The minimum exponent before (gradual) underflow, computed by + + setting A = START and dividing by BASE until the previous A + can not be recovered. + + START (input) FLOAT + The starting point for determining EMIN. + + BASE (input) INT + The base of the machine. + + ===================================================================== +*/ + /* System generated locals */ + int i__1; + float r__1; + /* Local variables */ + static float zero, a; + static int i; + static float rbase, b1, b2, c1, c2, d1, d2; + extern double slamc3_(float *, float *); + static float one; + + + + a = *start; + one = 1.f; + rbase = one / *base; + zero = 0.f; + *emin = 1; + r__1 = a * rbase; + b1 = slamc3_(&r__1, &zero); + c1 = a; + c2 = a; + d1 = a; + d2 = a; +/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. + $ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */ +L10: + if (c1 == a && c2 == a && d1 == a && d2 == a) { + --(*emin); + a = b1; + r__1 = a / *base; + b1 = slamc3_(&r__1, &zero); + r__1 = b1 * *base; + c1 = slamc3_(&r__1, &zero); + d1 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d1 += b1; +/* L20: */ + } + r__1 = a * rbase; + b2 = slamc3_(&r__1, &zero); + r__1 = b2 / rbase; + c2 = slamc3_(&r__1, &zero); + d2 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d2 += b2; +/* L30: */ + } + goto L10; + } +/* + END WHILE */ + + return 0; + +/* End of SLAMC4 */ + +} /* slamc4_ */ + + +/* Subroutine */ int slamc5_(int *beta, int *p, int *emin, + int *ieee, int *emax, float *rmax) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLAMC5 attempts to compute RMAX, the largest machine floating-point + number, without overflow. It assumes that EMAX + abs(EMIN) sum + approximately to a power of 2. It will fail on machines where this + assumption does not hold, for example, the Cyber 205 (EMIN = -28625, + + EMAX = 28718). It will also fail if the value supplied for EMIN is + too large (i.e. too close to zero), probably with overflow. + + Arguments + ========= + + BETA (input) INT + The base of floating-point arithmetic. + + P (input) INT + The number of base BETA digits in the mantissa of a + floating-point value. + + EMIN (input) INT + The minimum exponent before (gradual) underflow. + + IEEE (input) INT + A logical flag specifying whether or not the arithmetic + system is thought to comply with the IEEE standard. + + EMAX (output) INT + The largest exponent before overflow + + RMAX (output) FLOAT + The largest machine floating-point number. + + ===================================================================== + + + + First compute LEXP and UEXP, two powers of 2 that bound + abs(EMIN). We then assume that EMAX + abs(EMIN) will sum + approximately to the bound that is closest to abs(EMIN). + (EMAX is the exponent of the required number RMAX). */ + /* Table of constant values */ + static float c_b5 = 0.f; + + /* System generated locals */ + int i__1; + float r__1; + /* Local variables */ + static int lexp; + static float oldy; + static int uexp, i; + static float y, z; + static int nbits; + extern double slamc3_(float *, float *); + static float recbas; + static int exbits, expsum, try__; + + + + lexp = 1; + exbits = 1; +L10: + try__ = lexp << 1; + if (try__ <= -(*emin)) { + lexp = try__; + ++exbits; + goto L10; + } + if (lexp == -(*emin)) { + uexp = lexp; + } else { + uexp = try__; + ++exbits; + } + +/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater + than or equal to EMIN. EXBITS is the number of bits needed to + store the exponent. */ + + if (uexp + *emin > -lexp - *emin) { + expsum = lexp << 1; + } else { + expsum = uexp << 1; + } + +/* EXPSUM is the exponent range, approximately equal to + EMAX - EMIN + 1 . */ + + *emax = expsum + *emin - 1; + nbits = exbits + 1 + *p; + +/* NBITS is the total number of bits needed to store a + floating-point number. */ + + if (nbits % 2 == 1 && *beta == 2) { + +/* Either there are an odd number of bits used to store a + floating-point number, which is unlikely, or some bits are + + not used in the representation of numbers, which is possible +, + (e.g. Cray machines) or the mantissa has an implicit bit, + (e.g. IEEE machines, Dec Vax machines), which is perhaps the + + most likely. We have to assume the last alternative. + If this is true, then we need to reduce EMAX by one because + + there must be some way of representing zero in an implicit-b +it + system. On machines like Cray, we are reducing EMAX by one + + unnecessarily. */ + + --(*emax); + } + + if (*ieee) { + +/* Assume we are on an IEEE machine which reserves one exponent + + for infinity and NaN. */ + + --(*emax); + } + +/* Now create RMAX, the largest machine number, which should + be equal to (1.0 - BETA**(-P)) * BETA**EMAX . + + First compute 1.0 - BETA**(-P), being careful that the + result is less than 1.0 . */ + + recbas = 1.f / *beta; + z = *beta - 1.f; + y = 0.f; + i__1 = *p; + for (i = 1; i <= *p; ++i) { + z *= recbas; + if (y < 1.f) { + oldy = y; + } + y = slamc3_(&y, &z); +/* L20: */ + } + if (y >= 1.f) { + y = oldy; + } + +/* Now multiply by BETA**EMAX to get RMAX. */ + + i__1 = *emax; + for (i = 1; i <= *emax; ++i) { + r__1 = y * *beta; + y = slamc3_(&r__1, &c_b5); +/* L30: */ + } + + *rmax = y; + return 0; + +/* End of SLAMC5 */ + +} /* slamc5_ */ + + +double pow_ri(float *ap, int *bp) +{ +double pow, x; +int n; + +pow = 1; +x = *ap; +n = *bp; + +if(n != 0) + { + if(n < 0) + { + n = -n; + x = 1/x; + } + for( ; ; ) + { + if(n & 01) + pow *= x; + if(n >>= 1) + x *= x; + else + break; + } + } +return(pow); +} diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/slamchtst.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/slamchtst.c new file mode 100644 index 0000000..49b88fe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/slamchtst.c @@ -0,0 +1,33 @@ +#include + +int main() +{ + /* Local variables */ + float base, emin, prec, emax, rmin, rmax, t, sfmin; + extern float slamch_(char *); + float rnd, eps; + + eps = slamch_("Epsilon"); + sfmin = slamch_("Safe minimum"); + base = slamch_("Base"); + prec = slamch_("Precision"); + t = slamch_("Number of digits in mantissa"); + rnd = slamch_("Rounding mode"); + emin = slamch_("Minnimum exponent"); + rmin = slamch_("Underflow threshold"); + emax = slamch_("Largest exponent"); + rmax = slamch_("Overflow threshold"); + + printf(" Epsilon = %e\n", eps); + printf(" Safe minimum = %e\n", sfmin); + printf(" Base = %.0f\n", base); + printf(" Precision = %e\n", prec); + printf(" Number of digits in mantissa = %.0f\n", t); + printf(" Rounding mode = %.0f\n", rnd); + printf(" Minimum exponent = %.0f\n", emin); + printf(" Underflow threshold = %e\n", rmin); + printf(" Largest exponent = %.0f\n", emax); + printf(" Overflow threshold = %e\n", rmax); + printf(" Reciprocal of safe minimum = %e\n", 1./sfmin); + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/superlu_timer.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/superlu_timer.c new file mode 100644 index 0000000..2ef2a4a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/superlu_timer.c @@ -0,0 +1,45 @@ +/* + * Purpose + * ======= + * Returns the time in seconds used by the process. + * + * Note: the timer function call is machine dependent. Use conditional + * compilation to choose the appropriate function. + * + */ + + +#ifdef SUN +/* + * It uses the system call gethrtime(3C), which is accurate to + * nanoseconds. +*/ +#include + +double SuperLU_timer_() { + return ( (double)gethrtime() / 1e9 ); +} + +#else + +#include +#include +#include +#include + +#ifndef CLK_TCK +#define CLK_TCK 60 +#endif + +double SuperLU_timer_() +{ + struct tms use; + double tmp; + times(&use); + tmp = use.tms_utime; + tmp += use.tms_stime; + return (double)(tmp) / CLK_TCK; +} + +#endif + diff --git a/thirdparty/superlu/SuperLU_4.1/INSTALL/timertst.c b/thirdparty/superlu/SuperLU_4.1/INSTALL/timertst.c new file mode 100644 index 0000000..eed1e70 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/INSTALL/timertst.c @@ -0,0 +1,91 @@ +#include +#include + +void mysub(int n, double *x, double *y) +{ + return; +} + +main() +{ + /* Parameters */ +#define NMAX 1000 +#define ITS 100000 + + int i, j, iters; + double alpha, avg, t1, t2, tnotim; + double x[NMAX], y[NMAX]; + double SuperLU_timer_(); + + /* Initialize X and Y */ + for (i = 0; i < NMAX; ++i) { + x[i] = 1.0 / (double)(i+1); + y[i] = (double)(NMAX - i) / (double)NMAX; + } + alpha = 0.315; + + /* Time DAXPY operations */ + iters = ITS; + tnotim = 0.0; + while ( tnotim <= 0.0 ) { + t1 = SuperLU_timer_(); + for (j = 0; j < iters; ++j) { + for (i = 0; i < NMAX; ++i) y[i] += alpha * x[i]; + alpha = -alpha; + } + t2 = SuperLU_timer_(); + tnotim = t2 - t1; + if ( tnotim > 0. ){ + float ops = 2.0 * iters * NMAX * 1e-9; + printf("Time for %d DAXPYs = %10.3g seconds\n", + iters, tnotim); + printf("DAXPY performance rate = %10.3g Gflops\n", ops/tnotim); + } else { + /* this makes sure we dont keep trying forever */ + if ( iters > 100000000 ) { + printf("*** Error: Time for operations was zero.\n" + "\tThe timer may not be working correctly.\n"); + /*exit(9);*/ + } + iters *= 10; + } + } + + /* Force gcc not to optimize away the previous loop (DCS) */ + printf("y[0]=%g\n", y[0]) ; + + t1 = SuperLU_timer_(); + for (j = 0; j < ITS; ++j) { + for (i = 0; i < NMAX; ++i) + y[i] += alpha * x[i]; + alpha = -alpha; + } + t2 = SuperLU_timer_(); + tnotim = t2 - t1; + + /* Time 1,000,000 DAXPY operations with SuperLU_timer_() + in the outer loop */ + t1 = SuperLU_timer_(); + for (j = 0; j < ITS; ++j) { + for (i = 0; i < NMAX; ++i) + y[i] += alpha * x[i]; + alpha = -alpha; + t2 = SuperLU_timer_(); + } + + /* Compute the time in milliseconds used by an average call to + SuperLU_timer_(). */ + printf("Including DSECND, time = %10.3g seconds\n", t2-t1); + avg = ( (t2 - t1) - tnotim )*1000. / (double)ITS; + printf("Average time for DSECND = %10.3g milliseconds\n", avg); + + /* Compute the equivalent number of floating point operations used + by an average call to DSECND. */ + if ( tnotim > 0. ) + printf("Equivalent floating point ops = %10.3g ops\n", + 1000.*avg / tnotim); + + mysub(NMAX, x, y); + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.alpha b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.alpha new file mode 100644 index 0000000..a28cb5f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.alpha @@ -0,0 +1,49 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _alpha + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -ldxml +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = cc +CFLAGS = -O2 +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = -O2 +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/matlab diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.altix b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.altix new file mode 100644 index 0000000..f2a5c6e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.altix @@ -0,0 +1,58 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _Altix + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a + +BLASDEF = -DUSE_VENDOR_BLAS +#BLASLIB = -L/usr/common/intel/mkl/8.1.014/lib/64 \ +# -lmkl_solver -lmkl_lapack -lmkl_ipf -lguide -lm +BLASLIB = $(MKL) +TMGLIB = tmglib$(PLAT).a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = icc +ISA = -ftz -mp +CFLAGS = $(ISA) -O3 +NOOPTS = $(ISA) -O0 +FORTRAN = ifort +FFLAGS = -ftz -mp -O3 +LOADER = ifort +LOADOPTS = $(ISA) + +# +# C preprocessor defs for compilation (-DNoChange, -DAdd_, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/common/usg/matlab/7.1.0.R14 diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.cray b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.cray new file mode 100644 index 0000000..567e8ac --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.cray @@ -0,0 +1,56 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: November 15, 1997 Version 1.1 +# +# Modified: September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _cray + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a + +# +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = cc +CFLAGS = -D_CRAY -O3 -h aggress +#CFLAGS = -O3 -h scalar3,aggress,split,unroll,inline3 -D_CRAY +PTROPT = -h restrict=a +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DUpCase +# +# The directory in which Matlab is installed +# +MATLAB = /usr/local/matlab diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.hppa b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.hppa new file mode 100644 index 0000000..6caadda --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.hppa @@ -0,0 +1,58 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _hppa + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a + +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -lblas -lcl +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = echo +# +# Compiler and optimization +# +CC = gcc +CFLAGS = -O3 +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = -O3 +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DNoChange +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/matlab + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.inc b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.inc new file mode 100644 index 0000000..5522cc1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.inc @@ -0,0 +1,53 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _linux + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASLIB = $(SuperLUroot)/lib/libblas.a +TMGLIB = libtmglib.a + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = gcc +CFLAGS = -O2 +FORTRAN = g77 +FFLAGS = -O2 +LOADER = g77 +LOADOPTS = + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/matlab + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.linux b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.linux new file mode 100644 index 0000000..32e7d91 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.linux @@ -0,0 +1,65 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _linux + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a + +#BLASLIB = $(SuperLUroot)/lib/libblas.a + +## ATLAS BLAS causes single-precision to fail +#BLASDEF = -DUSE_VENDOR_BLAS +#BLASLIB = -L/usr/lib/atlas -lblas + +## This BLAS causes single-precision to fail the test in SuperLU +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -L/usr/lib -lblas + +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = gcc +CFLAGS = -O3 +NOOPTS = +FORTRAN = g77 +FFLAGS = -O2 +LOADER = $(FORTRAN) +LOADOPTS = + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/matlab + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.mac-x b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.mac-x new file mode 100644 index 0000000..9caa50d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.mac-x @@ -0,0 +1,55 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _mac_x + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASLIB = $(SuperLUroot)/lib/libblas.a +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = gcc +CFLAGS = -O2 +NOOPTS = +FORTRAN = /Applications/Absoft/bin/f90 +FFLAGS = -O3 -cpu:g5 -YEXT_NAMES=LCS -s -YEXT_SFX=_ +LOADER = $(FORTRAN) +LOADOPTS = + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DUpCase, or -DAdd__) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /Applications/MATLAB74/bin/matlab + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.rs6k b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.rs6k new file mode 100644 index 0000000..aad6794 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.rs6k @@ -0,0 +1,61 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _rs6k + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +# +# If you don't have ESSL, you can use the following blaslib instead: +# BLASLIB = -lblas -lxlf -lxlf90 +# which may be slower than ESSL +# +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -lessl +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = xlc +CFLAGS = -O3 +NOOPTS = +FORTRAN = xlf +FFLAGS = -O3 +LOADER = xlf +LOADOPTS = -bmaxdata:0x80000000 +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DNoChange +# +# The directory in which Matlab is installed +# +MATLAB = /usr/local/matlab + + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sgi b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sgi new file mode 100644 index 0000000..5f0f41d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sgi @@ -0,0 +1,53 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _sgi + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASLIB = $(SuperLUroot)/lib/libblas.a +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = echo + +CC = cc +CFLAGS = -O2 +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/local/matlab diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.solaris b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.solaris new file mode 100644 index 0000000..f639c3d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.solaris @@ -0,0 +1,54 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _solaris + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASLIB = $(SuperLUroot)/lib/libblas.a +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = cc +CFLAGS = -xO3 -xcg92 +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = -xO3 + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/pkg/matlab diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sp b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sp new file mode 100644 index 0000000..f965b57 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sp @@ -0,0 +1,62 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _sp + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +# +# If you don't have ESSL, you can use the following blaslib instead: +# BLASLIB = -lblas -lxlf -lxlf90 +# which may be slower than ESSL +# +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -lessl + +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = xlc +CFLAGS = -O3 -qarch=pwr3 -qalias=allptrs +NOOPTS = +FORTRAN = xlf +FFLAGS = -O3 -qarch=pwr3 +LOADER = xlf +LOADOPTS = -bmaxdata:0x80000000 +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DNoChange +# +# The directory in which Matlab is installed +# +MATLAB = /usr/local/matlab + + diff --git a/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sun4 b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sun4 new file mode 100644 index 0000000..451874e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MAKE_INC/make.sun4 @@ -0,0 +1,59 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _sun4 + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +BLASLIB = $(SuperLUroot)/lib/libblas.a +TMGLIB = libtmglib.a +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib +# +# Compiler and optimization +# +CC = gcc +CFLAGS = -O3 +NOOPTS = +FORTRAN = f77 +FFLAGS = -O +LOADER = f77 +LOADOPTS = -O3 + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/pkg/matlab + + + diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/Makefile b/thirdparty/superlu/SuperLU_4.1/MATLAB/Makefile new file mode 100644 index 0000000..980acd7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/Makefile @@ -0,0 +1,20 @@ +include ../make.inc + +LUSRC = ../SRC +HEADER = -I$(LUSRC) -I$(MATLAB)/extern/include +# +# For Matlab Version 4 compatibility: comment out -DV5, add -V4 in FFLAGS +FLAGS = -O -DV5 + +all: mexlusolve mexsuperlu + +mexlusolve: mexlusolve.c $(SUPERLULIB) + ${MATLAB}/bin/mex $(HEADER) ${FLAGS} mexlusolve.c \ + $(SUPERLULIB) $(BLASLIB) -lm + +mexsuperlu: mexsuperlu.c $(SUPERLULIB) + ${MATLAB}/bin/mex $(HEADER) ${FLAGS} mexsuperlu.c \ + $(SUPERLULIB) $(BLASLIB) -lm + +clean: + rm -f *.o *.mex* diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/README b/thirdparty/superlu/SuperLU_4.1/MATLAB/README new file mode 100644 index 0000000..7e84851 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/README @@ -0,0 +1,20 @@ +This directory contains the following Matlab script files, +which can be invoked in Matlab: + + superlu.m Supernodal LU factorization + lusolve.m Solve linear systems by supernodal LU factorization + trysuperlu.m Test the Matlab interface to SUPERLU + trylusolve.m Test the Matlab interface to LUSOLVE + copyright.m Complete copyright and licensing notice + +Say HELP SUPERLU and HELP LUSOLVE to Matlab for details. + +-------- +| NOTE | +-------- + The Makefile is set up so that the MEX-files are compatible with Matlab + Version 5. For Version 4 compatibility, you need to change + FLAGS = -O -DV5 + to + FLAGS = -O -V4 + in Makefile. diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/airfoil2.mat b/thirdparty/superlu/SuperLU_4.1/MATLAB/airfoil2.mat new file mode 100644 index 0000000..6f41ef2 Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/MATLAB/airfoil2.mat differ diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/babble.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/babble.m new file mode 100644 index 0000000..24401cf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/babble.m @@ -0,0 +1,2 @@ +% BABBLE Set the sparse monitor flag to very verbose. +spparms('spumoni', 2); \ No newline at end of file diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/burble.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/burble.m new file mode 100644 index 0000000..f137588 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/burble.m @@ -0,0 +1,2 @@ +% BURBLE Set the sparse monitor flag to extremely verbose. +spparms('spumoni', 3); \ No newline at end of file diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/copyright.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/copyright.m new file mode 100644 index 0000000..2e3e5f3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/copyright.m @@ -0,0 +1,14 @@ +% +% Copyright (c) 1994 by Xerox Corporation. All rights reserved. +% +% THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY +% EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. +% +% Permission is hereby granted to use or copy this program for any +% purpose, provided the above notices are retained on all copies. +% Permission to modify the code and to distribute modified code is +% granted, provided the above notices are retained, and a notice that +% the code was modified is included with the above copyright notice. +% + +help copyright diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/hbo.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/hbo.m new file mode 100644 index 0000000..30467af --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/hbo.m @@ -0,0 +1,119 @@ +function [A,xy,B,hbtype,rhstype] = hbo(file) +%HBO Read and process a Harwell-Boeing sparse matrix file. +% A = HBO('matfile') gets the sparse matrix from the specified .mat file. +% +% [A,xy,B,hbtype,rhstype] = HBO('matfile') also gets: +% xy: node coordinates (if present) +% B: right-hand sides, starting guesses, or exact solutions (if present) +% hbtype: matrix type, which will be one of the following three-letter +% codes: CSA, PRA, PSA, PSE, PUA, RRA, RSA, RUA, RZA, UNK +% rhstype: a description of B, for which see the user's guide. +% +% In addition to reading the file, HBO assembles any unassembled matrices, +% symmetrizes any symmetric matrices, and implicitizes any explicit zeros. +% +% HBO .mat files are created from Harwell-Boeing data files by the +% stand-alone Fortran process, HBO2MAT. These .mat files contain: +% +% For assembled, type xxA, matrices: +% A - the sparse matrix. +% hbtitle - The first 72 characters of the first "card". +% hbname - The matrix name, same as file name without .mat. +% hbtype - One of those three letter codes. +% hbfill - If present, the value inserted in pattern matrices. +% hbzero - If present, the value inserted for explicit zeros. +% rhstype - If present, the right hand side type. +% xy - If present, a matrix whose rows are node coordinates. +% B - If present, a matrix whose columns are right-hand +% sides, etc. +% +% For unassembled, xxE, matrices: +% hbtitle - The first 72 characters of the first "card". +% hbname - The matrix name, same as file name without .mat. +% hbtype - Only type PSE exists in current collection. +% varind and elptr - The indices specifying the locations +% of the constituent elements. +% +% Say "help harwell" for more information about the collection. +% See also HBOLIST, HBOFIND. + +% Cleve Moler, The MathWorks, 4/2/94. + +load(file) + +if ~exist('hbtype') + hbtype = 'UNK'; + A = A; + +% PSE - Pattern symmetric unassembled +elseif strcmp(hbtype,'PSE') + n1 = length(elptr); + elptr(n1) = []; + J = varind; + I = zeros(size(J)); + I(elptr) = ones(size(elptr)); + I = cumsum(I); + A = sparse(I,J,1); + A = A'*A; + +% RSA - Real symmetric +elseif strcmp(hbtype,'RSA') + A = A + A' - diag(diag(A)); + +% RZA - Real skew symmetric +elseif strcmp(hbtype,'RZA') + A = A - A'; + +% RUA - Real unsymmetric +elseif strcmp(hbtype,'RUA') + A = A; + +% RRA - Real rectangular +elseif strcmp(hbtype,'RRA') + A = A; + +% CSA - Complex symmetric +elseif strcmp(hbtype,'CSA') + A = A + A' - diag(diag(A)); + +% PSA - Pattern symmetric +elseif strcmp(hbtype,'PSA') + A = A + A' - diag(diag(A)); + +% PUA - Pattern unsymmetric +elseif strcmp(hbtype,'PUA') + A = A; + +% PRA - Pattern rectangular +elseif strcmp(hbtype,'PRA') + A = A; + +else + error(['Harwell-Boeing type ' hbtype ' unexpected.']) +end + +% Remove any explict zeros + +if exist('hbzero') + k = find(A == hbzero); + A(k) = sparse(length(k),1); +end + +% Get any right-hand side vectors or coordinates. + +if exist('xyz') + xy = xyz; +end; + +if ~exist('xy') + xy = []; +end; + +if ~exist('B') + B = []; + rhstype = 'NON'; +end; + +if ~exist('rhstype') + rhstype = 'UNK'; +end; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/isperm.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/isperm.m new file mode 100644 index 0000000..afcf9e6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/isperm.m @@ -0,0 +1,9 @@ +function result = isperm(p) +% ISPERM Is the argument a permutation? + +result = 0; +if min(size(p)) > 1, return, end; +ds = diff(sort(p)); +if any(ds ~= 1), return, end; +if min(p) ~= 1, return, end; +result = 1; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/lusolve.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/lusolve.m new file mode 100644 index 0000000..fab2b38 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/lusolve.m @@ -0,0 +1,62 @@ +function x = lusolve(A,b,Pcol) +% LUSOLVE : Solve linear systems by supernodal LU factorization. +% +% x = lusolve(A, b) returns the solution to the linear system A*x = b, +% using a supernodal LU factorization that is faster than Matlab's +% builtin LU. This m-file just calls a mex routine to do the work. +% +% By default, A is preordered by column minimum degree before factorization. +% Optionally, the user can supply a desired column ordering: +% +% x = lusolve(A, b, pcol) uses pcol as a column permutation. +% It still returns x = A\b, but it factors A(:,pcol) (if pcol is a +% permutation vector) or A*Pcol (if Pcol is a permutation matrix). +% +% x = lusolve(A, b, 0) suppresses the default minimum degree ordering; +% that is, it forces the identity permutation on columns. +% +% See also SUPERLU. +% +% John Gilbert, 6 April 1995 +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +[m,n] = size(A); +if m ~= n + error('matrix must be square'); +end; +[mb,nb] = size(b); +if mb ~= n + error('right-hand side must have same row dimension as matrix'); +end; +if n == 0 + x = []; + return; +end; + +% As necessary, compute the column permutation, and +% convert it from a permutation vector to a permutation matrix +% to fit the internal data structures of mexlusolve. +if nargin < 3 + Pcol = colamd(A); +end; +if isempty(Pcol) | Pcol == 0 + Pcol = speye(n); +end; +if min(size(Pcol)) == 1 + Pcol = sparse(1:n,Pcol,1,n,n); +end; + +% Make sure the matrices are sparse and the vector is full. +if ~issparse(A) + A = sparse(A); +end; +if issparse(b) + b = full(b); +end; +if ~issparse(Pcol) + Pcol = sparse(Pcol); +end; + +x = mexlusolve(A,b,Pcol); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.c b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.c new file mode 100644 index 0000000..6db98a5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.c @@ -0,0 +1,149 @@ +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include +#include "mex.h" +#include "slu_ddefs.h" + +#ifdef V5 +#define MatlabMatrix mxArray +#else /* V4 */ +#define MatlabMatrix Matrix +#endif + + +/* Aliases for input and output arguments */ +#define A_in prhs[0] +#define b_in prhs[1] +#define Pc_in prhs[2] +#define x_out plhs[0] + +#define verbose (SPUMONI>0) +#define babble (SPUMONI>1) +#define burble (SPUMONI>2) + +void mexFunction( + int nlhs, /* number of expected outputs */ + MatlabMatrix *plhs[], /* matrix pointer array returning outputs */ + int nrhs, /* number of inputs */ +#ifdef V5 + const MatlabMatrix *prhs[] /* matrix pointer array for inputs. */ +#else /* V4 */ + MatlabMatrix *prhs[] /* matrix pointer array for inputs */ +#endif + ) +{ + int SPUMONI; /* ... as should the sparse monitor flag */ +#ifdef V5 + double FlopsInSuperLU; /* ... as should the flop counter. */ +#else /* V4 */ + Real FlopsInSuperLU; /* ... as should the flop counter */ +#endif + extern flops_t LUFactFlops(SuperLUStat_t*); + extern flops_t LUSolveFlops(SuperLUStat_t*); + + /* Arguments to dgssv(). */ + SuperMatrix A; + SuperMatrix B; + SuperMatrix L, U; + int m, n, nnz; + int numrhs; + double *vb, *x; + double *val; + int *rowind; + int *colptr; + int *perm_r, *perm_c; + int info; + MatlabMatrix *X, *Y; /* args to calls back to Matlab */ + int i, mexerr; + superlu_options_t options; + SuperLUStat_t stat; + + /* Check number of arguments passed from Matlab. */ + if (nrhs != 3) { + mexErrMsgTxt("LUSOLVE requires 3 input arguments."); + } else if (nlhs != 1) { + mexErrMsgTxt("LUSOLVE requires 1 output argument."); + } + + /* Read the Sparse Monitor Flag */ + X = mxCreateString("spumoni"); + mexerr = mexCallMATLAB(1, &Y, 1, &X, "sparsfun"); + SPUMONI = mxGetScalar(Y); +#ifdef V5 + mxDestroyArray(Y); + mxDestroyArray(X); +#else + mxFreeMatrix(Y); + mxFreeMatrix(X); +#endif + + m = mxGetM(A_in); + n = mxGetN(A_in); + numrhs = mxGetN(b_in); + if ( babble ) printf("m=%d, n=%d, numrhs=%d\n", m, n, numrhs); + vb = mxGetPr(b_in); +#ifdef V5 + x_out = mxCreateDoubleMatrix(m, numrhs, mxREAL); +#else + x_out = mxCreateFull(m, numrhs, REAL); +#endif + x = mxGetPr(x_out); + perm_r = (int *) mxCalloc(m, sizeof(int)); + perm_c = mxGetIr(Pc_in); + + val = mxGetPr(A_in); + rowind = mxGetIr(A_in); + colptr = mxGetJc(A_in); + nnz = colptr[n]; + dCreate_CompCol_Matrix(&A, m, n, nnz, val, rowind, colptr, + SLU_NC, SLU_D, SLU_GE); + dCopy_Dense_Matrix(m, numrhs, vb, m, x, m); + dCreate_Dense_Matrix(&B, m, numrhs, x, m, SLU_DN, SLU_D, SLU_GE); + + FlopsInSuperLU = 0; + + set_default_options(&options); + options.ColPerm = MY_PERMC; + StatInit(&stat); + + /* Call simple driver */ + if ( verbose ) + mexPrintf("Call LUSOLVE, use SUPERLU to factor first ...\n"); + dgssv(&options, &A, perm_c, perm_r, &L, &U, &B, &stat, &info); + +#if 0 /* FLOPS is not available in the new Matlab. */ + /* Tell Matlab how many flops we did. */ + FlopsInSuperLU += LUFactFlops(&stat) + LUSolveFlops(&stat); + if ( verbose ) mexPrintf("LUSOLVE flops: %.f\n", FlopsInSuperLU); + mexerr = mexCallMATLAB(1, &X, 0, NULL, "flops"); + *(mxGetPr(X)) += FlopsInSuperLU; + mexerr = mexCallMATLAB(1, &Y, 1, &X, "flops"); +#ifdef V5 + mxDestroyArray(Y); + mxDestroyArray(X); +#else + mxFreeMatrix(Y); + mxFreeMatrix(X); +#endif +#endif + + /* Construct Matlab solution matrix. */ + if ( !info ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + if ( babble ) printf("Destroy L & U from SuperLU...\n"); + } else { + mexErrMsgTxt("Error returned from C dgssv()."); + } + + mxFree(perm_r); + StatFree(&stat); + + return; + +} diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.m new file mode 100644 index 0000000..0d07e65 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexlusolve.m @@ -0,0 +1,13 @@ +function x = mexlusolve(A,b,Pcol) +% MEXLUSOLVE : Supernodal LU factor-and-solve. +% +% MEXLUSOLVE is the mex-file version of the supernodal solver. +% The user will normally call LUSOLVE, which calls MEXLUSOLVE. +% See LUSOLVE for a description of parameters. + +% Above is the text for HELP MEXLUSOLVE; the following will be executed +% only if the mex-file appropriate for the machine can't be found. + +disp('Warning: Executable mexlusolve.mex not found for this architecture.'); +disp('The supernodal LU package seems not to be installed (or built for Matlab).'); +x = zeros(size(A,2),1); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/mexopts.sh.old b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexopts.sh.old new file mode 100644 index 0000000..9cc708d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexopts.sh.old @@ -0,0 +1,234 @@ +# +# mexopts.sh Shell script for configuring MEX-file creation script, +# mex. +# +# usage: Do not call this file directly; it is sourced by the +# mex shell script. Modify only if you don't like the +# defaults after running mex. No spaces are allowed +# around the '=' in the variable assignment. +# +# SELECTION_TAGs occur in template option files and are used by MATLAB +# tools, such as mex and mbuild, to determine the purpose of the contents +# of an option file. These tags are only interpreted when preceded by '#' +# and followed by ':'. +# +#SELECTION_TAG_MEX_OPT: Template Options file for building MEXfiles using the native compiler +# +# Copyright (c) 1984-1998 by The MathWorks, Inc. +# All Rights Reserved. +# $Revision: 1.40 $ $Date: 1997/12/05 20:18:39 $ +#---------------------------------------------------------------------------- +# + case "$Arch" in + Undetermined) +#---------------------------------------------------------------------------- +# Change this line if you need to specify the location of the MATLAB +# root directory. The cmex script needs to know where to find utility +# routines so that it can determine the architecture; therefore, this +# assignment needs to be done while the architecture is still +# undetermined. +#---------------------------------------------------------------------------- + MATLAB="$MATLAB" + ;; + alpha) +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='-ieee -std1' + CLIBS='' + COPTIMFLAGS='-O2 -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='-shared' + FLIBS='-lUfor -lfor -lFutil' + FOPTIMFLAGS='-O2' + FDEBUGFLAGS='-g' +# + LD='ld' + LDFLAGS="-expect_unresolved '*' -shared -hidden -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + hp700) +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='+z -D_HPUX_SOURCE -Aa +DA1.1' + CLIBS='' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='+z +DA1.1' + FLIBS='' + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='ld' + LDFLAGS="-b +e $ENTRYPOINT +e mexVersion" + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + ibm_rs) +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='-qlanglvl=ansi' + CLIBS='-lm' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='' + FLIBS="$MATLAB/extern/lib/ibm_rs/fmex1.o -lm" + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='cc' + LDFLAGS="-bI:$MATLAB/extern/lib/ibm_rs/exp.ibm_rs -bE:$MATLAB/extern/lib/ibm_rs/$MAPFILE -bM:SRE -e $ENTRYPOINT" + LDOPTIMFLAGS='-s' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + lnx86) +#---------------------------------------------------------------------------- + CC='gcc' + CFLAGS='' + CLIBS='' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# +# Use these flags for using f2c and gcc for Fortan MEX-Files +# + FC='f2c' + FOPTIMFLAGS='' + FFLAGS='' + FDEBUGFLAGS='-g' + FLIBS='-lf2c -Wl,--defsym,MAIN__=mexfunction_' +# +# Use these flags for using the Absoft F77 Fortran Compiler +# + # FC='f77' + # FOPTIMFLAGS='' + # FFLAGS='-f -N1 -N9 -N70' + # FDEBUGFLAGS='-gg' + # FLIBS='-lf77' +# + LD='gcc' + LDFLAGS='-shared -rdynamic' + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + sgi) +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='-ansi -mips2' + CLIBS='' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='' + FLIBS='' + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='ld' + LDFLAGS="-shared -U -Bsymbolic -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' + ;; +#---------------------------------------------------------------------------- + sgi64) +# R8000 only: The default action of mex is to generate full MIPS IV +# (R8000) instruction set. +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='-ansi -mips4 -64' + CLIBS='' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='-mips4 -64' + FLIBS='' + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='ld' + LDFLAGS="-mips4 -64 -shared -U -Bsymbolic -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' + ;; +#---------------------------------------------------------------------------- + sol2) +#---------------------------------------------------------------------------- + CC='cc' + CFLAGS='-dalign' + CLIBS='' + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='-dalign' + FLIBS='' + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='/usr/ccs/bin/ld' + LDFLAGS="-G -M $MATLAB/extern/lib/sol2/$MAPFILE" + LDOPTIMFLAGS='' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + sun4) +#---------------------------------------------------------------------------- +# A dry run of the appropriate compiler is done in the mex script to +# generate the correct library list. Use -v option to see what +# libraries are actually being linked in. +#---------------------------------------------------------------------------- + CC='acc' + CFLAGS='-DMEXSUN4' + CLIBS="$MATLAB/extern/lib/sun4/libmex.a -lm" + COPTIMFLAGS='-O -DNDEBUG' + CDEBUGFLAGS='-g' +# + FC='f77' + FFLAGS='' + FLIBS="$MATLAB/extern/lib/sun4/libmex.a -lm" + FOPTIMFLAGS='-O' + FDEBUGFLAGS='-g' +# + LD='ld' + LDFLAGS='-d -r -u _mex_entry_pt -u _mexFunction' + LDOPTIMFLAGS='-x' + LDDEBUGFLAGS='' +#---------------------------------------------------------------------------- + ;; + esac +############################################################################# +# +# Architecture independent lines: +# +# Set and uncomment any lines which will apply to all architectures. +# +#---------------------------------------------------------------------------- +# CC="$CC" +# CFLAGS="$CFLAGS" +# COPTIMFLAGS="$COPTIMFLAGS" +# CDEBUGFLAGS="$CDEBUGFLAGS" +# CLIBS="$CLIBS" +# +# FC="$FC" +# FFLAGS="$FFLAGS" +# FOPTIMFLAGS="$FOPTIMFLAGS" +# FDEBUGFLAGS="$FDEBUGFLAGS" +# FLIBS="$FLIBS" +# +# LD="$LD" +# LDFLAGS="$LDFLAGS" +# LDOPTIMFLAGS="$LDOPTIMFLAGS" +# LDDEBUGFLAGS="$LDDEBUGFLAGS" +#---------------------------------------------------------------------------- +############################################################################# diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.c b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.c new file mode 100644 index 0000000..e2ef2f3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.c @@ -0,0 +1,263 @@ +/* + * -- SuperLU routine (version 4.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * June 30, 2009 + * + */ +#include +#include "mex.h" +#include "slu_ddefs.h" + + +#ifdef V5 +#define MatlabMatrix mxArray +#else /* V4 */ +#define MatlabMatrix Matrix +#endif + + + +/* Aliases for input and output arguments */ +#define A_in prhs[0] +#define Pc_in prhs[1] +#define L_out plhs[0] +#define U_out plhs[1] +#define Pr_out plhs[2] +#define Pc_out plhs[3] + +void LUextract(SuperMatrix *, SuperMatrix *, double *, int *, int *, + double *, int *, int *, int *, int*); + +#define verbose (SPUMONI>0) +#define babble (SPUMONI>1) +#define burble (SPUMONI>2) + +void mexFunction( + int nlhs, /* number of expected outputs */ + MatlabMatrix *plhs[], /* matrix pointer array returning outputs */ + int nrhs, /* number of inputs */ +#ifdef V5 + const MatlabMatrix *prhs[] /* matrix pointer array for inputs */ +#else /* V4 */ + MatlabMatrix *prhs[] /* matrix pointer array for inputs */ +#endif + ) +{ + int SPUMONI; /* ... as should the sparse monitor flag */ +#ifdef V5 + double FlopsInSuperLU; /* ... as should the flop counter */ +#else + Real FlopsInSuperLU; /* ... as should the flop counter */ +#endif + extern flops_t LUFactFlops(SuperLUStat_t *); + + /* Arguments to C dgstrf(). */ + SuperMatrix A; + SuperMatrix Ac; /* Matrix postmultiplied by Pc */ + SuperMatrix L, U; + int m, n, nnz; + double *val; + int *rowind; + int *colptr; + int *etree, *perm_r, *perm_c; + int panel_size, relax; + double thresh = 1.0; /* diagonal pivoting threshold */ + int info; + MatlabMatrix *X, *Y; /* args to calls back to Matlab */ + int i, mexerr; + double *dp; + double *Lval, *Uval; + int *Lrow, *Urow; + int *Lcol, *Ucol; + int nnzL, nnzU, snnzL, snnzU; + superlu_options_t options; + SuperLUStat_t stat; + + /* Check number of arguments passed from Matlab. */ + if (nrhs != 2) { + mexErrMsgTxt("SUPERLU requires 2 input arguments."); + } else if (nlhs != 4) { + mexErrMsgTxt("SUPERLU requires 4 output arguments."); + } + + /* Read the Sparse Monitor Flag */ + X = mxCreateString("spumoni"); + mexerr = mexCallMATLAB(1, &Y, 1, &X, "sparsfun"); + SPUMONI = mxGetScalar(Y); +#ifdef V5 + mxDestroyArray(Y); + mxDestroyArray(X); +#else + mxFreeMatrix(Y); + mxFreeMatrix(X); +#endif + + m = mxGetM(A_in); + n = mxGetN(A_in); + etree = (int *) mxCalloc(n, sizeof(int)); + perm_r = (int *) mxCalloc(m, sizeof(int)); + perm_c = mxGetIr(Pc_in); + val = mxGetPr(A_in); + rowind = mxGetIr(A_in); + colptr = mxGetJc(A_in); + nnz = colptr[n]; + dCreate_CompCol_Matrix(&A, m, n, nnz, val, rowind, colptr, + SLU_NC, SLU_D, SLU_GE); + panel_size = sp_ienv(1); + relax = sp_ienv(2); + thresh = 1.0; + FlopsInSuperLU = 0; + + set_default_options(&options); + StatInit(&stat); + + if ( verbose ) mexPrintf("Apply column perm to A and compute etree...\n"); + sp_preorder(&options, &A, perm_c, etree, &Ac); + + if ( verbose ) { + mexPrintf("LU factorization...\n"); + mexPrintf("\tpanel_size %d, relax %d, diag_pivot_thresh %.2g\n", + panel_size, relax, thresh); + } + + dgstrf(&options, &Ac, relax, panel_size, etree, + NULL, 0, perm_c, perm_r, &L, &U, &stat, &info); + + if ( verbose ) mexPrintf("INFO from dgstrf %d\n", info); + +#if 0 /* FLOPS is not available in the new Matlab. */ + /* Tell Matlab how many flops we did. */ + FlopsInSuperLU += LUFactFlops(&stat); + if (verbose) mexPrintf("SUPERLU flops: %.f\n", FlopsInSuperLU); + mexerr = mexCallMATLAB(1, &X, 0, NULL, "flops"); + *(mxGetPr(X)) += FlopsInSuperLU; + mexerr = mexCallMATLAB(1, &Y, 1, &X, "flops"); +#ifdef V5 + mxDestroyArray(Y); + mxDestroyArray(X); +#else + mxFreeMatrix(Y); + mxFreeMatrix(X); +#endif +#endif + + /* Construct output arguments for Matlab. */ + if ( info >= 0 && info <= n ) { +#ifdef V5 + Pr_out = mxCreateDoubleMatrix(m, 1, mxREAL); +#else + Pr_out = mxCreateFull(m, 1, REAL); +#endif + dp = mxGetPr(Pr_out); + for (i = 0; i < m; *dp++ = (double) perm_r[i++]+1); +#ifdef V5 + Pc_out = mxCreateDoubleMatrix(n, 1, mxREAL); +#else + Pc_out = mxCreateFull(n, 1, REAL); +#endif + dp = mxGetPr(Pc_out); + for (i = 0; i < n; *dp++ = (double) perm_c[i++]+1); + + /* Now for L and U */ + nnzL = ((SCformat*)L.Store)->nnz; /* count diagonals */ + nnzU = ((NCformat*)U.Store)->nnz; + +#ifdef V5 + L_out = mxCreateSparse(m, n, nnzL, mxREAL); +#else + L_out = mxCreateSparse(m, n, nnzL, REAL); +#endif + Lval = mxGetPr(L_out); + Lrow = mxGetIr(L_out); + Lcol = mxGetJc(L_out); + +#ifdef V5 + U_out = mxCreateSparse(m, n, nnzU, mxREAL); +#else + U_out = mxCreateSparse(m, n, nnzU, REAL); +#endif + Uval = mxGetPr(U_out); + Urow = mxGetIr(U_out); + Ucol = mxGetJc(U_out); + + LUextract(&L, &U, Lval, Lrow, Lcol, Uval, Urow, Ucol, &snnzL, &snnzU); + + Destroy_CompCol_Permuted(&Ac); + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + + if (babble) mexPrintf("factor nonzeros: %d unsqueezed, %d squeezed.\n", + nnzL + nnzU, snnzL + snnzU); + } else { + mexErrMsgTxt("Error returned from C dgstrf()."); + } + + mxFree(etree); + mxFree(perm_r); + StatFree(&stat); + return; +} + +void +LUextract(SuperMatrix *L, SuperMatrix *U, double *Lval, int *Lrow, + int *Lcol, double *Uval, int *Urow, int *Ucol, int *snnzL, + int *snnzU) +{ + int i, j, k; + int upper; + int fsupc, istart, nsupr; + int lastl = 0, lastu = 0; + SCformat *Lstore; + NCformat *Ustore; + double *SNptr; + + Lstore = L->Store; + Ustore = U->Store; + Lcol[0] = 0; + Ucol[0] = 0; + + /* for each supernode */ + for (k = 0; k <= Lstore->nsuper; ++k) { + + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + upper = 1; + + /* for each column in the supernode */ + for (j = fsupc; j < L_FST_SUPC(k+1); ++j) { + SNptr = &((double*)Lstore->nzval)[L_NZ_START(j)]; + + /* Extract U */ + for (i = U_NZ_START(j); i < U_NZ_START(j+1); ++i) { + Uval[lastu] = ((double*)Ustore->nzval)[i]; + /* Matlab doesn't like explicit zero. */ + if (Uval[lastu] != 0.0) Urow[lastu++] = U_SUB(i); + } + for (i = 0; i < upper; ++i) { /* upper triangle in the supernode */ + Uval[lastu] = SNptr[i]; + /* Matlab doesn't like explicit zero. */ + if (Uval[lastu] != 0.0) Urow[lastu++] = L_SUB(istart+i); + } + Ucol[j+1] = lastu; + + /* Extract L */ + Lval[lastl] = 1.0; /* unit diagonal */ + Lrow[lastl++] = L_SUB(istart + upper - 1); + for (i = upper; i < nsupr; ++i) { + Lval[lastl] = SNptr[i]; + /* Matlab doesn't like explicit zero. */ + if (Lval[lastl] != 0.0) Lrow[lastl++] = L_SUB(istart+i); + } + Lcol[j+1] = lastl; + + ++upper; + + } /* for j ... */ + + } /* for k ... */ + + *snnzL = lastl; + *snnzU = lastu; +} diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.m new file mode 100644 index 0000000..c755ff9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/mexsuperlu.m @@ -0,0 +1,17 @@ +function [L,U,prow,pcol] = mexsuperlu(A,psparse); +% MEXSUPERLU : Supernodal LU factorization +% +% MEXSUPERLU is the mex-file version of the supernodal factorization. +% The user will normally call SUPERLU, which calls MEXSUPERLU. +% See SUPERLU for a description of parameters. + +% Above is the text for HELP MEXSUPERLU; the following will be executed +% only if the mex-file appropriate for the machine can't be found. + +disp('Warning: Executable mexsuperlu.mex not found for this architecture.'); +disp('The supernodal LU package seems not to be installed for Matlab.'); +n = max(size(A)); +L = sparse(n,n); +U = sparse(n,n); +prow = 1:n; +pcol = 1:n; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/permutation.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/permutation.m new file mode 100644 index 0000000..c6d4d04 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/permutation.m @@ -0,0 +1,59 @@ +% PERMUTATION : Helpful notes on permutation matrices and vectors. +% +% +% There are two ways to represent permutations in Matlab. +% +% A *permutation matrix* is a square matrix P that is zero except for exactly +% one 1 in each row and each column. A *permutation vector* is a 1 by n +% or n by 1 vector p that contains each of the integers 1:n exactly once. +% +% +% Let A be any n by n matrix, P be an n by n permutation matrix, and p be +% a permutation vector of length n. Then: +% +% P*A is a permutation of the rows of A. +% A*P' is the same permutation of the columns of A. Remember the transpose! +% +% A(p,:) is a permutation of the rows of A. +% A(:,p) is the same permutation of the columns of A. +% +% +% Matrix P and column vector p represent the same permutation if and only if +% any of the following three equivalent conditions holds: +% +% p = P*(1:n)' or P = sparse(1:n,p,1,n,n) or P = I(p,:), +% +% where I = speye(n,n) is the identity matrix of the right size. +% +% +% The inverse of a permutation matrix is its transpose: +% +% Pinv = inv(P) = P' +% +% The inverse of a permutation vector can be computed by a one-liner: +% +% pinv(p) = 1:n; +% +% (This works only if pinv doesn't already exist, or exists with the correct +% dimensions. To be safe, say: pinv=zeros(1,n); pinv(p)=1:n; ) +% +% +% Products of permutations go one way for matrices and the other way for +% vectors. If P1, P2, and P3 are permutation matrices and p1, p2, and p3 +% are the corresponding permutation vectors, then +% +% P1 = P2 * P3 if and only if p1 = p3(p2). +% +% +% Permutation vectors are a little more compact to store and efficient +% to apply than sparse permutation matrices (and much better than full +% permutation matrices). A sparse permutation matrix takes about twice +% the memory of a permutation vector. The Matlab function LU returns +% a permutation matrix (sparse if the input was sparse); most other +% built-in Matlab functions return permutation vectors, including +% SYMRCM, SYMMMD, COLAMD, DMPERM, and ETREE. + +% John Gilbert, 6 April 1995 +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. + +help permutation diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/resetrandoms.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/resetrandoms.m new file mode 100644 index 0000000..f818359 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/resetrandoms.m @@ -0,0 +1,10 @@ +function resetrandoms +% RESETRANDOMS : Initialize random number generators for repeatability. +% +% John Gilbert, 1994. +% Copyright (c) 1990-1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + +rand('seed',0); +randn('seed',0); + diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/smallmesh.mat b/thirdparty/superlu/SuperLU_4.1/MATLAB/smallmesh.mat new file mode 100644 index 0000000..41dd5d8 Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/MATLAB/smallmesh.mat differ diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/spart2.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/spart2.m new file mode 100644 index 0000000..90d6f02 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/spart2.m @@ -0,0 +1,28 @@ +function [r,s] = spart2(A) +% SPART2 : supernode partition +% +% [r,x] = spart2(A) partitions the columns of A according to supernode +% definition 2: +% A supernode in A = L+U is a sequence of adjacent columns in which +% the diagonal block of L is full, +% and below the diagonal all the columns (of L) have the same row structure. +% Output: row and column partitions r and s suitable for SPYPART(A,r,s) +% +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +[nr,nc] = size(A); +A = spones(A); +A = tril(A) | speye(nr,nc); + +A1 = tril([zeros(nr,1) A]); +A2 = [A ones(nr,1)]; + +signature = sum(xor(A1,A2)); +r = find(signature); +r = r'; +if nargout > 1, + s = r; + r = [1 nr+1]; +end; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/spypart.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/spypart.m new file mode 100644 index 0000000..c83ee54 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/spypart.m @@ -0,0 +1,35 @@ +function spypart(S, rp, cp); +%SPYPART Spy plot with partitioning. +% SPYPART(S,rp,cp) plots the sparsity pattern of a matrix S, +% with lines marking a block partition described by +% rp (rows) and cp (columns). +% If S is square, cp may be omitted and defaults to rp. +% +% Partitions are specified as in the output of DMPERM: +% There are length(rp)-1 row blocks, of sizes diff(rp), with rp(1)=1. + +% Copyright (c) 1984-98 by The MathWorks, Inc. +% $Revision: 5.3 $ $Date: 1997/11/21 23:27:12 $ + +if (nargin < 3), cp = rp; end + +spy(S) +hold on + +[m,n] = size(S); +if length(rp) > 2 + k = length(rp)-2; + X = [zeros(1,k); n+ones(1,k)]; + Y = rp(2:k+1) - 0.5; + Y = [Y; Y]; + plot(X,Y,'w-') +end +if length(cp) > 2 + k = length(cp)-2; + X = cp(2:k+1) - .5; + X = [X; X]; + Y = [zeros(1,k); m+ones(1,k)]; + plot(X,Y,'w-') +end +axis('ij') +hold off diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/superlu.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/superlu.m new file mode 100644 index 0000000..960f177 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/superlu.m @@ -0,0 +1,143 @@ +function [L,U,prow,pcol] = superlu(A,psparse) +% SUPERLU : Supernodal LU factorization +% +% Executive summary: +% +% [L,U,p] = superlu(A) is like [L,U,P] = lu(A), but faster. +% [L,U,prow,pcol] = superlu(A) preorders the columns of A by min degree, +% yielding A(prow,pcol) = L*U. +% +% Details and options: +% +% With one input and two or three outputs, SUPERLU has the same effect as LU, +% except that the pivoting permutation is returned as a vector, not a matrix: +% +% [L,U,p] = superlu(A) returns unit lower triangular L, upper triangular U, +% and permutation vector p with A(p,:) = L*U. +% [L,U] = superlu(A) returns permuted triangular L and upper triangular U +% with A = L*U. +% +% With a second input, the columns of A are permuted before factoring: +% +% [L,U,prow] = superlu(A,psparse) returns triangular L and U and permutation +% prow with A(prow,psparse) = L*U. +% [L,U] = superlu(A,psparse) returns permuted triangular L and triangular U +% with A(:,psparse) = L*U. +% Here psparse will normally be a user-supplied permutation matrix or vector +% to be applied to the columns of A for sparsity. COLAMD is one way to get +% such a permutation; see below to make SUPERLU compute it automatically. +% (If psparse is a permutation matrix, the matrix factored is A*psparse'.) +% +% With a fourth output, a column permutation is computed and applied: +% +% [L,U,prow,pcol] = superlu(A,psparse) returns triangular L and U and +% permutations prow and pcol with A(prow,pcol) = L*U. +% Here psparse is a user-supplied column permutation for sparsity, +% and the matrix factored is A(:,psparse) (or A*psparse' if the +% input is a permutation matrix). Output pcol is a permutation +% that first performs psparse, then postorders the etree of the +% column intersection graph of A. The postorder does not affect +% sparsity, but makes supernodes in L consecutive. +% [L,U,prow,pcol] = superlu(A,0) is the same as ... = superlu(A,I); it does +% not permute for sparsity but it does postorder the etree. +% [L,U,prow,pcol] = superlu(A) is the same as ... = superlu(A,colamd(A)); +% it uses column minimum degree to permute columns for sparsity, +% then postorders the etree and factors. +% +% This m-file calls the mex-file MEXSUPERLU to do the work. +% +% See also COLAMD, LUSOLVE. +% +% John Gilbert, 6 April 1995. +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + +% Note on permutation matrices and vectors: +% +% Names beginning with p are permutation vectors; +% names beginning with P are the corresponding permutation matrices. +% +% Thus A(pfoo,pbar) is the same as Pfoo*A*Pbar'. +% +% We don't actually form any permutation matrices except Psparse, +% but matrix notation is easier to untangle in the comments. + + +[m,n] = size(A); +if m ~= n + error('matrix must be square.'); +end; +if n == 0 + L = []; U = []; prow = []; pcol = []; + return; +end; + +% If necessary, compute the column sparsity permutation. +if nargin < 2 + if nargout >= 4 + psparse = colamd(A); + else + psparse = 1:n; + end; +end; +if max(size(psparse)) <= 1 + psparse = 1:n; +end; + +% Compute the permutation-matrix version of psparse, +% which fits the internal data structures of mexsuperlu. +if min(size(psparse)) == 1 + Psparse = sparse(1:n,psparse,1,n,n); +else + Psparse = psparse; + psparse = Psparse*[1:n]'; +end; + +% Make sure the matrices are sparse. +if ~issparse(A) + A = sparse(A); +end; +if ~issparse(Psparse) + Psparse = sparse(Psparse); +end; + + +% The output permutations from the mex-file are dense permutation vectors. +[L,U,prowInv,pcolInv] = mexsuperlu(A,Psparse); +prow = zeros(1,n); +prow(prowInv) = 1:n; +pcol = zeros(1,n); +pcol(pcolInv) = 1:n; + +% We now have +% +% Prow*A*Psparse'*Post' = L*U (1) +% Pcol' = Psparse'*Post' +% +% (though we actually have the vectors, not the matrices, and +% we haven't computed Post explicitly from Pcol and Psparse). +% Now we figure out what the user really wanted returned, +% and rewrite (1) accordingly. + +if nargout == 4 + % Return both row and column permutations. + % This is what we've already got. + % (1) becomes Prow*A*Pcol' = L*U. +elseif nargout == 3 + % Return row permutation only. Fold the postorder perm + % but not the sparsity perm into it, and into L and U. + % This preserves triangularity of L and U. + % (1) becomes (Post'*Prow) * A * Psparse' = (Post'*L*Post) * (Post'*U*Post). + postInv = pcolInv(psparse); + prow = prow(postInv); + L = L(postInv,postInv); + U = U(postInv,postInv); +else % nargout <= 2 + % Return no permutations. Fold the postorder perm but + % not the sparsity perm into L and U. Fold the pivoting + % perm into L, which destroys its triangularity. + % (1) becomes A * Psparse' = (Prow'*L*Post) * (Post'*U*Post). + postInv = pcolInv(psparse); + L = L(prowInv,postInv); + U = U(postInv,postInv); +end; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/time.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/time.m new file mode 100644 index 0000000..8286451 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/time.m @@ -0,0 +1,12 @@ +function y = time() +%TIME Timestamp. +% S = TIME returns a string containing the date and time. + +% Copyright (c) 1984-93 by The MathWorks, Inc. + +t = clock; +base = t(1) - rem(t(1),100); +months = ['Jan';'Feb';'Mar';'Apr';'May';'Jun'; + 'Jul';'Aug';'Sep';'Oct';'Nov';'Dec']; +y = [int2str(t(3)),'-',months(t(2),:),'-',int2str(t(1)-base), ... + ' ',int2str(t(4)),':', int2str(t(5)),':', int2str(t(6))]; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/try2.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/try2.m new file mode 100644 index 0000000..69cd276 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/try2.m @@ -0,0 +1,68 @@ +function info = try2(A,pin); +% TRY2 : test SUPERLU with 2 outputs +% +% info = try2(A,pin); +% normally info is the residual norm; +% but info is at least 10^6 if U is not triangular +% or if the factors contain explicit zeros. +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +n = max(size(A)); +info = 0; + +if nargin == 1 + [l,u] = superlu(A); +elseif nargin == 2 + [l,u] = superlu(A,pin); +else + error('requires 1 or 2 inputs'); +end; + +figure(2); spy(l); title('L'); +figure(1); spy(u); title('U'); +drawnow; + +format compact +disp('SUPERLU with 2 outputs:'); +if any(any(triu(l,1))) + disp('L is *NOT* lower triangular.'); +else + disp('L is lower triangular.'); +end; +if nnz(l) == nnz(l+l) + disp('L has no explicit zeros.'); +else + disp('L contains explicit zeros.'); + info = info+10^6; +end; +if any(any(tril(u,-1))) + disp('U is *NOT* upper triangular.'); + info = info + 10^6; +else + disp('U is upper triangular.'); +end; +if nnz(u) == nnz(u+u) + disp('U has no explicit zeros.'); +else + disp('U contains explicit zeros.'); + info = info+10^6; +end; + +if nargin == 1 + rnorm = norm(A - l*u,inf); + fprintf(1,'||A - L*U|| = %d\n', rnorm); +elseif size(pin) == [n n] + rnorm = norm(A*pin' - l*u,inf); + fprintf(1,'||A*PIN'' - L*U|| = %d\n', rnorm); +elseif max(size(pin)) == n + rnorm = norm(A(:,pin) - l*u,inf); + fprintf(1,'||A(:,PIN) - L*U|| = %d\n', rnorm); +else + rnorm = norm(A - l*u,inf); + fprintf(1,'||A - L*U|| = %d\n', rnorm); +end; + +info = info + rnorm; +disp(' '); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/try3.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/try3.m new file mode 100644 index 0000000..3c51107 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/try3.m @@ -0,0 +1,82 @@ +function info = try3(A,pin); +% TRY3 : test SUPERLU with 3 outputs +% +% info = try3(A,pin); +% normally info is the residual norm; +% but info is at least 10^6 if the factors are not triangular, +% or the permutation isn't a permutation. +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +n = max(size(A)); +info = 0; + +if nargin == 1 + [l,u,pr] = superlu(A); +elseif nargin == 2 + [l,u,pr] = superlu(A,pin); +else + error('requires 1 or 2 inputs'); +end; + +figure(2); spy(l); title('L'); +figure(1); spy(u); title('U'); +drawnow; + +format compact +disp('SUPERLU with 3 outputs:'); +if any(any(triu(l,1))) + disp('L is *NOT* lower triangular.'); + info = info + 10^6; +else + disp('L is lower triangular.'); +end; +if nnz(l) == nnz(l+l) + disp('L has no explicit zeros.'); +else + disp('L contains explicit zeros.'); + info = info+10^6; +end; +if any(any(tril(u,-1))) + disp('U is *NOT* upper triangular.'); + info = info + 10^6; +else + disp('U is upper triangular.'); +end; +if nnz(u) == nnz(u+u) + disp('U has no explicit zeros.'); +else + disp('U contains explicit zeros.'); + info = info+10^6; +end; +if pr == [1:n] + disp('PROW is the identity permutation.'); +elseif isperm(pr) + disp('PROW is a non-identity permutation.'); +else + disp('PROW is *NOT* a permutation.'); + info = info + 10^6; +end; + +if nargin == 1 + rnorm = norm(A(pr,:) - l*u,inf); + fprintf(1,'||A(PROW,:) - L*U|| = %d\n', rnorm); +elseif size(pin) == [n n] + rnorm = norm(A(pr,:)*pin' - l*u,inf); + fprintf(1,'||A(PROW,:)*PIN'' - L*U|| = %d\n', rnorm); +elseif max(size(pin)) == n + rnorm = norm(A(pr,pin) - l*u,inf); + fprintf(1,'||A(PROW,PIN) - L*U|| = %d\n', rnorm); + if pr == pin + disp('PROW is the same as the input permutation.'); + else + disp('PROW is different from the input permutation.'); + end; +else + rnorm = norm(A(pr,:) - l*u,inf); + fprintf(1,'||A(PROW,:) - L*U|| = %d\n', rnorm); +end; + +info = info + rnorm; +disp(' '); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/try4.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/try4.m new file mode 100644 index 0000000..78041ee --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/try4.m @@ -0,0 +1,79 @@ +function info = try4(A,pin); +% TRY4 : test SUPERLU with 4 outputs +% +% info = try4(A,pin); +% normally info is the residual norm; +% but info is at least 10^6 if the factors are not triangular, +% or the permutations aren't permutations. +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +n = max(size(A)); +info = 0; + +if nargin == 1 + [l,u,pr,pc] = superlu(A); +elseif nargin == 2 + [l,u,pr,pc] = superlu(A,pin); +else + error('requires 1 or 2 inputs'); +end; + +% DOES NOT WORK IN MATLAB 5, NOT YET KNOW WHY -- XSL 5-25-98 +% figure(2); [r,s] = spart2(l); spypart(l,r,s); title('L'); +figure(2); spy(l); title('L'); +figure(1); spy(u); title('U'); +drawnow; + +format compact +disp('SUPERLU with 4 outputs:'); +if any(any(triu(l,1))) + disp('L is *NOT* lower triangular.'); + info = info + 10^6; +else + disp('L is lower triangular.'); +end; +if nnz(l) == nnz(l+l) + disp('L has no explicit zeros.'); +else + disp('L contains explicit zeros.'); + info = info+10^6; +end; +if any(any(tril(u,-1))) + disp('U is *NOT* upper triangular.'); + info = info + 10^6; +else + disp('U is upper triangular.'); +end; +if nnz(u) == nnz(u+u) + disp('U has no explicit zeros.'); +else + disp('U contains explicit zeros.'); + info = info+10^6; +end; +if pr == [1:n] + disp('PROW is the identity permutation.'); +elseif isperm(pr) + disp('PROW is a non-identity permutation.'); +else + disp('PROW is *NOT* a permutation.'); + info = info + 10^6; +end; +if pc == [1:n] + disp('PCOL is the identity permutation.'); +elseif isperm(pc) + disp('PCOL is a non-identity permutation.'); +else + disp('PCOL is *NOT* a permutation.'); + info = info + 10^6; +end; +if pr == pc + disp('PROW and PCOL are the same.') +else + disp('PROW and PCOL are different.') +end; +rnorm = norm(A(pr,pc) - l*u,inf); +fprintf(1,'||A(PROW,PCOL) - L*U|| = %d\n', rnorm); +info = info + rnorm; +disp(' '); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/trylusolve.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/trylusolve.m new file mode 100644 index 0000000..9abac68 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/trylusolve.m @@ -0,0 +1,137 @@ +function failed = trylusolve(A,b); +% TRYLUSOLVE : Test the Matlab interface to lusolve. +% +% failed = trylusolve; +% This runs several tests on lusolve, using a matrix with the +% structure of "smallmesh". It returns a list of failed tests. +% +% failed = trylusolve(A); +% failed = trylusolve(A,b); +% This times the solution of a system with the given matrix, +% both with lusolve and with Matlab's builtin "\" operator. +% Usually, "\" will be faster for triangular or symmetric postive +% definite matrices, and lusolve will be faster otherwise. +% +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + +disp(' '); +disp(['Testing LUSOLVE on ' time]); +disp(' '); + +format compact +resetrandoms; +if nargin == 0 + A = hbo('smallmesh'); +end; +[n,m] = size(A); +if n~=m, error('matrix must be square'), end; + +failed = []; +ntest = 0; +tol = 100 * eps * n^2; + +if nargin >= 1 % Just try a solve with the given input matrix. + ntest=ntest+1; + v = spparms; + spparms('spumoni',1); + fprintf('Matrix size: %d by %d with %d nonzeros.\n',n,m,nnz(A)); + disp(' '); + if nargin == 1 + b = rand(n,1); + end; + tic; x=A\b; t1=toc; + fprintf('A\\b time = %d seconds.\n',t1); + disp(' '); + tic; x=lusolve(A,b); t2=toc; + fprintf('LUSOLVE time = %d seconds.\n',t2); + disp(' '); + ratio = t1/t2; + fprintf('Ratio = %d\n',ratio); + residual_norm = norm(A*x-b,inf)/norm(A,inf) + disp(' '); + if residual_norm > tol + disp('*** FAILED ***'); failed = [failed ntest]; + end; + spparms(v); + return; +end; + +% With no inputs, try several tests on the small mesh. + + +A = sprandn(A); +p = randperm(n); +I = speye(n); +P = I(p,:); +b = rand(n,2); + +ntest=ntest+1; +fprintf('Test %d: Input perm 0.\n',ntest); +x = lusolve(A,b,0); +residual_norm = norm(A*x-b,inf) +disp(' '); +if residual_norm > tol + disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given as vector.\n',ntest); +x = lusolve(A,b,p); +residual_norm = norm(A*x-b,inf) +disp(' '); +if residual_norm > tol + disp('*** FAILED ***^G'), disp(' '), failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given as matrix.\n',ntest); +x = lusolve(A,b,P); +residual_norm = norm(A*x-b,inf) +disp(' '); +if residual_norm > tol + disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: No input perm (colamd done internally).\n',ntest); +x = lusolve(A,b); +residual_norm = norm(A*x-b,inf) +disp(' '); +if residual_norm > tol + disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: Empty matrix.\n',ntest); +x = lusolve([],[]); +disp(' '); +% if max(size(x)) +if length(x) + x + disp('*** FAILED ***^G'), disp(' '); + failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: Timing versus \\ on the 3-element airfoil matrix.\n',ntest); +A = hbo('airfoil2'); +n = max(size(A)); +A = sprandn(A); +b = rand(n,1); +tic; x=A\b; t1=toc; +fprintf('A\\b time = %d seconds.\n',t1); +tic; x=lusolve(A,b); t2=toc; +fprintf('LUSOLVE time = %d seconds.\n',t2); +ratio = t1/t2; +fprintf('Ratio = %d\n',ratio); +disp(' '); +if ratio < 1, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + + +nfailed = length(failed); +if nfailed + fprintf('\n%d tests failed.\n\n',nfailed); +else + fprintf('\nAll tests passed.\n\n',nfailed); +end; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/trysuperlu.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/trysuperlu.m new file mode 100644 index 0000000..012703f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/trysuperlu.m @@ -0,0 +1,219 @@ +function failed = trysuperlu(A); +% TRYSUPERLU : Test the Matlab interface to superlu. +% +% failed = trysuperlu; +% This runs several tests on superlu, using a matrix with the +% structure of "smallmesh". It returns a list of failed tests. +% +% failed = trysuperlu(A); +% This just times the factorization of A. +% +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + +disp(' '); +disp(['Testing SUPERLU on ' time]); +disp(' '); + +resetrandoms; +if nargin == 0 + A = hbo('smallmesh'); +end; +[n,m] = size(A); +if n~=m, error('matrix must be square'), end; + +failed = []; +ntest = 0; +tol = 100 * eps * n^2; + +if nargin == 1 % Just try to factor the given input matrix. + ntest=ntest+1; + fprintf('Matrix size: %d by %d with %d nonzeros.\n',n,m,nnz(A)); + r = trytime(A); + if r > tol, disp('*** FAILED ***'); failed = [failed ntest]; end; + return; +end; + +% With no input argument, try several tests on the small mesh. + +PivPostA = sprandn(A); +A = (n+1)*speye(n) - spones(A); % Diagonally dominant +[t,post] = etree(A'*A); + +if post == [1:n], disp('note: column etree already in postorder'), end; + +NoPivPostA = A(post,:); +NoPivNoPostA = A(post,post); +PivNoPostA = sprandn(NoPivNoPostA); +p = randperm(n); +pinv = zeros(1,n); +pinv(p) = 1:n; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, no postorder, 4 outputs.\n',ntest); +r = try4(NoPivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, no postorder, 3 outputs.\n',ntest); +r = try3(NoPivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, no postorder, 2 outputs.\n',ntest); +r = try2(NoPivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, no postorder, 4 outputs.\n',ntest); +r = try4(PivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, no postorder, 3 outputs.\n',ntest); +r = try3(PivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, no postorder, 2 outputs.\n',ntest); +r = try2(PivNoPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, postorder, 4 outputs.\n',ntest); +r = try4(NoPivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, postorder, 3 outputs.\n',ntest); +r = try3(NoPivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, no pivot, postorder, 2 outputs.\n',ntest); +r = try2(NoPivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, postorder, 4 outputs.\n',ntest); +r = try4(PivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, postorder, 3 outputs.\n',ntest); +r = try3(PivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm 0, pivot, postorder, 2 outputs.\n',ntest); +r = try2(PivPostA,0); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, no postorder, 4 outputs.\n',ntest); +r = try4(NoPivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, no postorder, 3 outputs.\n',ntest); +r = try3(NoPivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, no postorder, 2 outputs.\n',ntest); +r = try2(NoPivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, no postorder, 4 outputs.\n',ntest); +r = try4(PivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, no postorder, 3 outputs.\n',ntest); +r = try3(PivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, no postorder, 2 outputs.\n',ntest); +r = try2(PivNoPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, postorder, 4 outputs.\n',ntest); +r = try4(NoPivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, postorder, 3 outputs.\n',ntest); +r = try3(NoPivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, no pivot, postorder, 2 outputs.\n',ntest); +r = try2(NoPivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, postorder, 4 outputs.\n',ntest); +r = try4(PivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, postorder, 3 outputs.\n',ntest); +r = try3(PivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given, pivot, postorder, 2 outputs.\n',ntest); +r = try2(PivPostA(:,pinv),p); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: No input perm (colamd done internally), pivot, postorder, 4 outputs.\n',ntest); +r = try4(PivPostA); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: No input perm, pivot, postorder, 3 outputs.\n',ntest); +r = try3(PivPostA); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: No input perm, pivot, postorder, 2 outputs.\n',ntest); +r = try3(PivPostA); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Input perm given as matrix, pivot, postorder, 4 outputs.\n',ntest); +P = speye(n); +P = P(p,:); +r = try4(PivPostA*P,P); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +ntest=ntest+1; +fprintf('Test %d: Empty matrix.\n',ntest); +[L,U,PROW,PCOL] = superlu([]); +disp(' '); +if max([size(L) size(U) size(PROW) size(PCOL)]) + L, U, PROW, PCOL + disp('*** FAILED ***^G'), disp(' '); + failed = [failed ntest]; +end; + +ntest=ntest+1; +fprintf('Test %d: Timing versus LU on the 3-element airfoil matrix.\n',ntest); +A = hbo('airfoil2'); +n = max(size(A)); +A = sprandn(A); +pmmd = colamd(A); +A = A(:,pmmd); +r = trytime(A); +if r > tol, disp('*** FAILED ***'), disp(' '), failed = [failed ntest]; end; + +nfailed = length(failed); +if nfailed + fprintf('\n%d tests failed.\n\n',nfailed); +else + fprintf('\nAll tests passed.\n\n',nfailed); +end; diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/trytime.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/trytime.m new file mode 100644 index 0000000..a390e99 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/trytime.m @@ -0,0 +1,63 @@ +function info = trytime(A); +% TRYTIME : time SUPERLU with 3 outputs against Matlab's LU +% +% info = trytime(A); +% normally info is ||P*A*x-L*U*x|| / ||A|| (for a random x); +% but info is at least 10^6 if the factors are not triangular, +% or the permutation isn't a permutation. +% Copyright (c) 1995 by Xerox Corporation. All rights reserved. +% HELP COPYRIGHT for complete copyright and licensing notice. + + +n = max(size(A)); +info = 0; + +format compact +disp('SUPERLU with 3 outputs:'); + +tic;[L,U,P]=lu(A);t1=toc; +fprintf('LU time = %d seconds.\n',t1); +tic;[l,u,pr]=superlu(A);t2=toc; +fprintf('SUPERLU time = %d seconds.\n',t2); +ratio = t1/t2; +fprintf('Ratio = %d\n',ratio); + +if any(any(triu(l,1))) + disp('L is *NOT* lower triangular.'); + info = info + 10^6; +else + disp('L is lower triangular.'); +end; +if nnz(l) == nnz(l+l) + disp('L has no explicit zeros.'); +else + disp('L contains explicit zeros.'); + info = info+10^6; +end; +if any(any(tril(u,-1))) + disp('U is *NOT* upper triangular.'); + info = info + 10^6; +else + disp('U is upper triangular.'); +end; +if nnz(u) == nnz(u+u) + disp('U has no explicit zeros.'); +else + disp('U contains explicit zeros.'); + info = info+10^6; +end; +if pr == [1:n] + disp('PROW is the identity permutation.'); +elseif isperm(pr) + disp('PROW is a non-identity permutation.'); +else + disp('PROW is *NOT* a permutation.'); + info = info + 10^6; +end; + +x = rand(n,1); +rnorm = norm(A(pr,:)*x - l*(u*x),inf)/norm(A,inf); +fprintf(1,'||A(PROW,:)*x - L*U*x||/||A|| = %d\n', rnorm); + +info = info + rnorm; +disp(' '); diff --git a/thirdparty/superlu/SuperLU_4.1/MATLAB/verbose.m b/thirdparty/superlu/SuperLU_4.1/MATLAB/verbose.m new file mode 100644 index 0000000..e58ef9c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/MATLAB/verbose.m @@ -0,0 +1,2 @@ +% VERBOSE Set the sparse monitor flag to verbose. +spparms('spumoni', 1); diff --git a/thirdparty/superlu/SuperLU_4.1/Makefile b/thirdparty/superlu/SuperLU_4.1/Makefile new file mode 100644 index 0000000..d8d822c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/Makefile @@ -0,0 +1,60 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: Makefile +# +# Purpose: Top-level Makefile +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# October 15, 2003 Version 3.0 +# August 1, 2008 Version 3.1 +# +############################################################################ + +include make.inc + +all: install lib testing + +lib: superlulib tmglib + +clean: cleanlib cleantesting + +install: + ( cd INSTALL; $(MAKE) ) +# ( cd INSTALL; cp lsame.c ../SRC/; \ +# cp dlamch.c ../SRC/; cp slamch.c ../SRC/ ) + +blaslib: + ( cd CBLAS; $(MAKE) ) + +superlulib: + ( cd SRC; $(MAKE) ) + +tmglib: + ( cd TESTING/MATGEN; $(MAKE) ) + +matlabmex: + ( cd MATLAB; $(MAKE) ) + +testing: + ( cd TESTING ; $(MAKE) ) + +doc: + doxygen Doxyfile + +cleanlib: + ( cd SRC; $(MAKE) clean ) + ( cd TESTING/MATGEN; $(MAKE) clean ) + ( cd CBLAS; $(MAKE) clean ) + +cleantesting: + ( cd INSTALL; $(MAKE) clean ) + ( cd TESTING; $(MAKE) clean ) + ( cd MATLAB; $(MAKE) clean ) + ( cd EXAMPLE; $(MAKE) clean ) + ( cd FORTRAN; $(MAKE) clean ) diff --git a/thirdparty/superlu/SuperLU_4.1/README b/thirdparty/superlu/SuperLU_4.1/README new file mode 100644 index 0000000..6872d74 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/README @@ -0,0 +1,157 @@ + SuperLU (Version 4.1) + ===================== + +Copyright (c) 2003, The Regents of the University of California, through +Lawrence Berkeley National Laboratory (subject to receipt of any required +approvals from U.S. Dept. of Energy) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +(1) Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +(2) Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +(3) Neither the name of Lawrence Berkeley National Laboratory, U.S. Dept. of +Energy nor the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +SuperLU contains a set of subroutines to solve a sparse linear system +A*X=B. It uses Gaussian elimination with partial pivoting (GEPP). +The columns of A may be preordered before factorization; the +preordering for sparsity is completely separate from the factorization. + +SuperLU is implemented in ANSI C, and must be compiled with standard +ANSI C compilers. It provides functionality for both real and complex +matrices, in both single and double precision. The file names for the +single-precision real version start with letter "s" (such as sgstrf.c); +the file names for the double-precision real version start with letter "d" +(such as dgstrf.c); the file names for the single-precision complex +version start with letter "c" (such as cgstrf.c); the file names +for the double-precision complex version start with letter "z" +(such as zgstrf.c). + + +SuperLU contains the following directory structure: + + SuperLU/README instructions on installation + SuperLU/CBLAS/ needed BLAS routines in C, not necessarily fast + SuperLU/DOC/ Users' Guide and documentation of source code + SuperLU/EXAMPLE/ example programs + SuperLU/FORTRAN/ Fortran interface + SuperLU/INSTALL/ test machine dependent parameters; the Users' Guide. + SuperLU/MAKE_INC/ sample machine-specific make.inc files + SuperLU/MATLAB/ Matlab mex-file interface + SuperLU/SRC/ C source code, to be compiled into the superlu.a library + SuperLU/TESTING/ driver routines to test correctness + SuperLU/Makefile top level Makefile that does installation and testing + SuperLU/make.inc compiler, compile flags, library definitions and C + preprocessor definitions, included in all Makefiles. + (You may need to edit it to be suitable for your system + before compiling the whole package.) + + +Before installing the package, please examine the three things dependent +on your system setup: + +1. Edit the make.inc include file. + This make include file is referenced inside each of the Makefiles + in the various subdirectories. As a result, there is no need to + edit the Makefiles in the subdirectories. All information that is + machine specific has been defined in this include file. + + Example machine-specific make.inc include files are provided + in the MAKE_INC/ directory for several systems, such as Linux, + IBM RS/6000, SunOS 5.x (Solaris), HP-PA and MacX. + When you have selected the machine to which you wish + to install SuperLU, copy the appropriate sample include file (if one + is present) into make.inc. For example, if you wish to run + SuperLU on an linux, you can do + + cp MAKE_INC/make.linux make.inc + + For the systems other than listed above, slight modifications to the + make.inc file will need to be made. + +2. The BLAS library. + If there is BLAS library available on your machine, you may define + the following in the file SuperLU/make.inc: + BLASDEF = -DUSE_VENDOR_BLAS + BLASLIB = + + The CBLAS/ subdirectory contains the part of the C BLAS needed by + SuperLU package. However, these codes are intended for use only if there + is no faster implementation of the BLAS already available on your machine. + In this case, you should do the following: + + 1) In SuperLU/make.inc, undefine (comment out) BLASDEF, and define: + BLASLIB = ../lib/blas$(PLAT).a + + 2) Go to the SuperLU/ directory, type: + make blaslib + to make the BLAS library from the routines in the CBLAS/ subdirectory. + +3. C preprocessor definition CDEFS. + In the header file SRC/slu_Cnames.h, we use macros to determine how + C routines should be named so that they are callable by Fortran. + (Some vendor-supplied BLAS libraries do not have C interface. So the + re-naming is needed in order for the SuperLU BLAS calls (in C) to + interface with the Fortran-style BLAS.) + The possible options for CDEFS are: + + o -DAdd_: Fortran expects a C routine to have an underscore + postfixed to the name; + o -DNoChange: Fortran expects a C routine name to be identical to + that compiled by C; + o -DUpCase: Fortran expects a C routine name to be all uppercase. + +4. The Matlab MEX-file interface. + The MATLAB/ subdirectory includes Matlab C MEX-files, so that + our factor and solve routines can be called as alternatives to those + built into Matlab. In the file SuperLU/make.inc, define MATLAB to be the + directory in which Matlab is installed on your system, for example: + + MATLAB = /usr/local/matlab + + At the SuperLU/ directory, type "make matlabmex" to build the MEX-file + interface. After you have built the interface, you may go to the MATLAB/ + directory to test the correctness by typing (in Matlab): + trysuperlu + trylusolve + +A Makefile is provided in each subdirectory. The installation can be done +completely automatically by simply typing "make" at the top level. +The test results are in the files below: + INSTALL/install.out + TESTING/stest.out + TESTING/dtest.out + TESTING/ctest.out + TESTING/ztest.out + + +-------------------- +| RELEASE VERSIONS | +-------------------- + February 4, 1997 Version 1.0 + November 15, 1997 Version 1.1 + September 1, 1999 Version 2.0 + October 15, 2003 Version 3.0 + August 1, 2008 Version 3.1 + June 30, 2009 Version 4.0 + November 23, 2010 Version 4.1 diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/Makefile b/thirdparty/superlu/SuperLU_4.1/SRC/Makefile new file mode 100644 index 0000000..9f8f550 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/Makefile @@ -0,0 +1,152 @@ +# makefile for sparse supernodal LU, implemented in ANSI C +include ../make.inc + +####################################################################### +# This is the makefile to create a library for SuperLU. +# The files are organized as follows: +# +# ALLAUX -- Auxiliary routines called from all precisions of SuperLU +# LAAUX -- LAPACK auxiliary routines called from all precisions +# SLASRC -- LAPACK single precision real routines +# DLASRC -- LAPACK double precision real routines +# CLASRC -- LAPACK single precision complex routines +# ZLASRC -- LAPACK double precision complex routines +# SCLAUX -- LAPACK Auxiliary routines called from both real and complex +# DZLAUX -- LAPACK Auxiliary routines called from both double precision +# and complex*16 +# SLUSRC -- Single precision real SuperLU routines +# DLUSRC -- Double precision real SuperLU routines +# CLUSRC -- Single precision complex SuperLU routines +# ZLUSRC -- Double precision complex SuperLU routines +# +# The library can be set up to include routines for any combination +# of the four precisions. To create or add to the library, enter make +# followed by one or more of the precisions desired. Some examples: +# make single +# make single double +# make single double complex complex16 +# Alternatively, the command +# make +# without any arguments creates a library of all four precisions. +# The library is called +# superlu.a +# and is created at the next higher directory level. +# +# To remove the object files after the library is created, enter +# make clean +# +####################################################################### + +### LAPACK +LAAUX = lsame.o xerbla.o +SLASRC = slacon.o +DLASRC = dlacon.o +CLASRC = clacon.o scsum1.o icmax1.o +ZLASRC = zlacon.o dzsum1.o izmax1.o +SCLAUX = slamch.o +DZLAUX = dlamch.o + +### SuperLU +ALLAUX = superlu_timer.o util.o memory.o get_perm_c.o mmd.o \ + sp_coletree.o sp_preorder.o sp_ienv.o relax_snode.o \ + heap_relax_snode.o colamd.o \ + ilu_relax_snode.o ilu_heap_relax_snode.o mark_relax.o \ + mc64ad.o qselect.o + +SLUSRC = \ + sgssv.o sgssvx.o \ + ssp_blas2.o ssp_blas3.o sgscon.o \ + slangs.o sgsequ.o slaqgs.o spivotgrowth.o \ + sgsrfs.o sgstrf.o sgstrs.o scopy_to_ucol.o \ + ssnode_dfs.o ssnode_bmod.o \ + spanel_dfs.o spanel_bmod.o \ + sreadhb.o sreadrb.o sreadtriple.o \ + scolumn_dfs.o scolumn_bmod.o spivotL.o spruneL.o \ + smemory.o sutil.o smyblas2.o \ + sgsisx.o sgsitrf.o sldperm.o \ + ilu_sdrop_row.o ilu_ssnode_dfs.o \ + ilu_scolumn_dfs.o ilu_spanel_dfs.o ilu_scopy_to_ucol.o \ + ilu_spivotL.o sdiagonal.o + +DLUSRC = \ + dgssv.o dgssvx.o \ + dsp_blas2.o dsp_blas3.o dgscon.o \ + dlangs.o dgsequ.o dlaqgs.o dpivotgrowth.o \ + dgsrfs.o dgstrf.o dgstrs.o dcopy_to_ucol.o \ + dsnode_dfs.o dsnode_bmod.o dpanel_dfs.o dpanel_bmod.o \ + dreadhb.o dreadrb.o dreadtriple.o \ + dcolumn_dfs.o dcolumn_bmod.o dpivotL.o dpruneL.o \ + dmemory.o dutil.o dmyblas2.o \ + dgsisx.o dgsitrf.o dldperm.o \ + ilu_ddrop_row.o ilu_dsnode_dfs.o \ + ilu_dcolumn_dfs.o ilu_dpanel_dfs.o ilu_dcopy_to_ucol.o \ + ilu_dpivotL.o ddiagonal.o + ## dgstrsL.o dgstrsU.o + +CLUSRC = \ + scomplex.o cgssv.o cgssvx.o csp_blas2.o csp_blas3.o cgscon.o \ + clangs.o cgsequ.o claqgs.o cpivotgrowth.o \ + cgsrfs.o cgstrf.o cgstrs.o ccopy_to_ucol.o \ + csnode_dfs.o csnode_bmod.o \ + cpanel_dfs.o cpanel_bmod.o \ + creadhb.o creadrb.o creadtriple.o \ + ccolumn_dfs.o ccolumn_bmod.o cpivotL.o cpruneL.o \ + cmemory.o cutil.o cmyblas2.o \ + cgsisx.o cgsitrf.o cldperm.o \ + ilu_cdrop_row.o ilu_csnode_dfs.o \ + ilu_ccolumn_dfs.o ilu_cpanel_dfs.o ilu_ccopy_to_ucol.o \ + ilu_cpivotL.o cdiagonal.o + +ZLUSRC = \ + dcomplex.o zgssv.o zgssvx.o zsp_blas2.o zsp_blas3.o zgscon.o \ + zlangs.o zgsequ.o zlaqgs.o zpivotgrowth.o \ + zgsrfs.o zgstrf.o zgstrs.o zcopy_to_ucol.o \ + zsnode_dfs.o zsnode_bmod.o \ + zpanel_dfs.o zpanel_bmod.o \ + zreadhb.o zreadrb.o zreadtriple.o \ + zcolumn_dfs.o zcolumn_bmod.o zpivotL.o zpruneL.o \ + zmemory.o zutil.o zmyblas2.o \ + zgsisx.o zgsitrf.o zldperm.o \ + ilu_zdrop_row.o ilu_zsnode_dfs.o \ + ilu_zcolumn_dfs.o ilu_zpanel_dfs.o ilu_zcopy_to_ucol.o \ + ilu_zpivotL.o zdiagonal.o + +all: single double complex complex16 + +single: $(SLUSRC) $(ALLAUX) $(LAAUX) $(SLASRC) $(SCLAUX) + $(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \ + $(SLUSRC) $(ALLAUX) $(LAAUX) $(SLASRC) $(SCLAUX) + $(RANLIB) $(SUPERLULIB) + +double: $(DLUSRC) $(ALLAUX) $(LAAUX) $(DLASRC) $(DZLAUX) + $(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \ + $(DLUSRC) $(ALLAUX) $(LAAUX) $(DLASRC) $(DZLAUX) + $(RANLIB) $(SUPERLULIB) + +complex: $(CLUSRC) $(ALLAUX) $(LAAUX) $(CLASRC) $(SCLAUX) + $(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \ + $(CLUSRC) $(ALLAUX) $(LAAUX) $(CLASRC) $(SCLAUX) + $(RANLIB) $(SUPERLULIB) + +complex16: $(ZLUSRC) $(ALLAUX) $(LAAUX) $(ZLASRC) $(DZLAUX) + $(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \ + $(ZLUSRC) $(ALLAUX) $(LAAUX) $(ZLASRC) $(DZLAUX) + $(RANLIB) $(SUPERLULIB) + + +################################## +# Do not optimize these routines # +################################## +slamch.o: slamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $< +dlamch.o: dlamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $< +superlu_timer.o: superlu_timer.c ; $(CC) -c $(NOOPTS) $< +################################## + +.c.o: + $(CC) $(CFLAGS) $(CDEFS) $(BLASDEF) -c $< $(VERBOSE) + +.f.o: + $(FORTRAN) $(FFLAGS) -c $< + +clean: + rm -f *.o $(SUPERLULIB) diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_bmod.c new file mode 100644 index 0000000..d20e95c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_bmod.c @@ -0,0 +1,365 @@ + +/*! @file ccolumn_bmod.c + * \brief performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + *  Permission is hereby granted to use or copy this program for any
    + *  purpose, provided the above notices are retained on all copies.
    + *  Permission to modify the code and to distribute modified code is
    + *  granted, provided the above notices are retained, and a notice that
    + *  the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include +#include +#include "slu_cdefs.h" + +/* + * Function prototypes + */ +void cusolve(int, int, complex*, complex*); +void clsolve(int, int, complex*, complex*); +void cmatvec(int, int, int, complex*, complex*, complex*); + + + +/*! \brief + * + *
    + * Purpose:
    + * ========
    + * Performs numeric block updates (sup-col) in topological order.
    + * It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + * Special processing on the supernodal portion of L\U[*,j]
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +ccolumn_bmod ( + const int jcol, /* in */ + const int nseg, /* in */ + complex *dense, /* in */ + complex *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in */ + int fpanelc, /* in -- first column in the current panel */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + complex alpha, beta; + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in supernode + * nsupr = no of rows in supernode (used as leading dimension) + * luptr = location of supernodal LU-block in storage + * kfnz = first nonz in the k-th supernodal segment + * no_zeros = no of leading zeros in a supernodal U-segment + */ + complex ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int fsupc, nsupc, nsupr, segsze; + int nrow; /* No of rows in the matrix of matrix-vector */ + int jcolp1, jsupno, k, ksub, krep, krep_ind, ksupno; + register int lptr, kfnz, isub, irow, i; + register int no_zeros, new_next; + int ufirst, nextlu; + int fst_col; /* First column within small LU update */ + int d_fsupc; /* Distance between the first column of the current + panel and the first column of the current snode. */ + int *xsup, *supno; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + int nzlumax; + complex *tempv1; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + complex none = {-1.0, 0.0}; + complex comp_temp, comp_temp1; + int mem_error; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + nzlumax = Glu->nzlumax; + jcolp1 = jcol + 1; + jsupno = supno[jcol]; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + + krep = segrep[k]; + k--; + ksupno = supno[krep]; + if ( jsupno != ksupno ) { /* Outside the rectangular supernode */ + + fsupc = xsup[ksupno]; + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + /* Distance from the current supernode to the current panel; + d_fsupc=0 if fsupc > fpanelc. */ + d_fsupc = fst_col - fsupc; + + luptr = xlusup[fst_col] + d_fsupc; + lptr = xlsub[fsupc] + d_fsupc; + + kfnz = repfnz[krep]; + kfnz = SUPERLU_MAX ( kfnz, fpanelc ); + + segsze = krep - kfnz + 1; + nsupc = krep - fst_col + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nrow = nsupr - d_fsupc - nsupc; + krep_ind = lptr + nsupc - 1; + + + + + /* + * Case 1: Update U-segment of size 1 -- col-col update + */ + if ( segsze == 1 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + c_sub(&dense[irow], &dense[irow], &comp_temp); + luptr++; + } + + } else if ( segsze <= 3 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { /* Case 2: 2cols-col update */ + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + c_sub(&ukj, &ukj, &comp_temp); + dense[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense[irow], &dense[irow], &comp_temp); + } + } else { /* Case 3: 3cols-col update */ + ukj2 = dense[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + cc_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + c_sub(&ukj1, &ukj1, &comp_temp); + + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&ukj, &ukj, &comp_temp); + + dense[lsub[krep_ind]] = ukj; + dense[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + luptr2++; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense[irow], &dense[irow], &comp_temp); + } + } + + + } else { + /* + * Case: sup-col update + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense + */ + + no_zeros = kfnz - fst_col; + + /* Copy U[*,j] segment from dense[*] to tempv[*] */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + tempv[i] = dense[irow]; + ++isub; + } + + /* Dense triangular solve -- start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + ctrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + cgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + clsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + cmatvec (nsupr, nrow , segsze, &lusup[luptr], tempv, tempv1); +#endif + + + /* Scatter tempv[] into SPA dense[] as a temporary storage */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense[irow] = tempv[i]; + tempv[i] = zero; + ++isub; + } + + /* Scatter tempv1[] into SPA dense[] */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + c_sub(&dense[irow], &dense[irow], &tempv1[i]); + tempv1[i] = zero; + ++isub; + } + } + + } /* if jsupno ... */ + + } /* for each segment... */ + + /* + * Process the supernodal portion of L\U[*,j] + */ + nextlu = xlusup[jcol]; + fsupc = xsup[jsupno]; + + /* Copy the SPA dense into L\U[*,j] */ + new_next = nextlu + xlsub[fsupc+1] - xlsub[fsupc]; + while ( new_next > nzlumax ) { + if (mem_error = cLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, Glu)) + return (mem_error); + lusup = Glu->lusup; + lsub = Glu->lsub; + } + + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = zero; + ++nextlu; + } + + xlusup[jcolp1] = nextlu; /* Close L\U[*,jcol] */ + + /* For more updates within the panel (also within the current supernode), + * should start from the first column of the panel, or the first column + * of the supernode, whichever is bigger. There are 2 cases: + * 1) fsupc < fpanelc, then fst_col := fpanelc + * 2) fsupc >= fpanelc, then fst_col := fsupc + */ + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + if ( fst_col < jcol ) { + + /* Distance between the current supernode and the current panel. + d_fsupc=0 if fsupc >= fpanelc. */ + d_fsupc = fst_col - fsupc; + + lptr = xlsub[fsupc] + d_fsupc; + luptr = xlusup[fst_col] + d_fsupc; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nsupc = jcol - fst_col; /* Excluding jcol */ + nrow = nsupr - d_fsupc - nsupc; + + /* Points to the beginning of jcol in snode L\U(jsupno) */ + ufirst = xlusup[jcol] + d_fsupc; + + ops[TRSV] += 4 * nsupc * (nsupc - 1); + ops[GEMV] += 8 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#else + ctrsv_( "L", "N", "U", &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#endif + + alpha = none; beta = one; /* y := beta*y + alpha*A*x */ + +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + cgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + clsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + + cmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], tempv ); + + /* Copy updates from tempv[*] into lusup[*] */ + isub = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + c_sub(&lusup[isub], &lusup[isub], &tempv[i]); + tempv[i] = zero; + ++isub; + } + +#endif + + + } /* if fst_col < jcol ... */ + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_dfs.c new file mode 100644 index 0000000..58940ef --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ccolumn_dfs.c @@ -0,0 +1,275 @@ + +/*! @file ccolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include "slu_cdefs.h" + +/*! \brief What type of supernodes we want */ +#define T2_SUPER + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS 
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal 
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +ccolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *xprune, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom, istop; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(3); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonz */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ( mem_error = cLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( mem_error = + cLUMemXpand(jcol,nextl,LSUB,&nzlmax,Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + +#ifdef T2_SUPER + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; +#endif + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first and last columns of + * a supernode. (first for num values, last for pruning) + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1-1) ) { /* >= 3 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + istop = ito + jptr - jm1ptr; + xprune[jcolm1] = istop; /* Initialize xprune[jcol-1] */ + xlsub[jcol] = istop; + for (ifrom = jm1ptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; /* = istop + length(jcol) */ + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xprune[jcol] = nextl; /* Initialize upper bound for pruning */ + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ccopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/ccopy_to_ucol.c new file mode 100644 index 0000000..3e4b396 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ccopy_to_ucol.c @@ -0,0 +1,103 @@ + +/*! @file ccopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_cdefs.h" + +int +ccopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + complex *dense, /* modified - reset to zero on return */ + GlobalLU_t *Glu /* modified */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + complex *ucol; + int *usub, *xusub; + int nzumax; + complex zero = {0.0, 0.0}; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if (mem_error = cLUMemXpand(jcol, nextu, UCOL, &nzumax, Glu)) + return (mem_error); + ucol = Glu->ucol; + if (mem_error = cLUMemXpand(jcol, nextu, USUB, &nzumax, Glu)) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + dense[irow] = zero; + nextu++; + isub++; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cdiagonal.c b/thirdparty/superlu/SuperLU_4.1/SRC/cdiagonal.c new file mode 100644 index 0000000..7384da1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cdiagonal.c @@ -0,0 +1,133 @@ + +/*! @file cdiagonal.c + * \brief Auxiliary routines to work with diagonal elements + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +int cfill_diag(int n, NCformat *Astore) +/* fill explicit zeros on the diagonal entries, so that the matrix is not + structurally singular. */ +{ + complex *nzval = (complex *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + complex *nzval_new; + complex zero = {1.0, 0.0}; + int *rowind_new; + int i, j, diag; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = complexMalloc(nnz + fill); + rowind_new = intMalloc(nnz + fill); + fill = 0; + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + } + if (diag < 0) + { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = zero; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + Astore->nnz += fill; + return fill; +} + +int cdominate(int n, NCformat *Astore) +/* make the matrix diagonally dominant */ +{ + complex *nzval = (complex *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + complex *nzval_new; + int *rowind_new; + int i, j, diag; + double s; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = complexMalloc(nnz + fill); + rowind_new = intMalloc(nnz+ fill); + fill = 0; + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + s += c_abs1(&nzval_new[j + fill]); + } + if (diag >= 0) { + nzval_new[diag+fill].r = s * 3.0; + nzval_new[diag+fill].i = 0.0; + } else { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill].r = s * 3.0; + nzval_new[colptr[i + 1] + fill].i = 0.0; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + else + { + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + { + if (rowind[j] == i) diag = j; + s += c_abs1(&nzval[j]); + } + nzval[diag].r = s * 3.0; + nzval[diag].i = 0.0; + } + } + Astore->nnz += fill; + return fill; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgscon.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgscon.c new file mode 100644 index 0000000..e17532d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgscon.c @@ -0,0 +1,154 @@ + +/*! @file cgscon.c + * \brief Estimates reciprocal of the condition number of a general matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routines CGECON.
    + * 
    + */ + +/* + * File name: cgscon.c + * History: Modified from lapack routines CGECON. + */ +#include +#include "slu_cdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   CGSCON estimates the reciprocal of the condition number of a general 
    + *   real matrix A, in either the 1-norm or the infinity-norm, using   
    + *   the LU factorization computed by CGETRF.   *
    + *
    + *   An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    + *   condition number is computed as   
    + *      RCOND = 1 / ( norm(A) * norm(inv(A)) ).   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + *   Arguments   
    + *   =========   
    + *
    + *    NORM    (input) char*
    + *            Specifies whether the 1-norm condition number or the   
    + *            infinity-norm condition number is required:   
    + *            = '1' or 'O':  1-norm;   
    + *            = 'I':         Infinity-norm.
    + *	    
    + *    L       (input) SuperMatrix*
    + *            The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *            cgstrf(). Use compressed row subscripts storage for supernodes,
    + *            i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + * 
    + *    U       (input) SuperMatrix*
    + *            The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *            cgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *            Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *	    
    + *    ANORM   (input) float
    + *            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    + *            If NORM = 'I', the infinity-norm of the original matrix A.
    + *	    
    + *    RCOND   (output) float*
    + *           The reciprocal of the condition number of the matrix A,   
    + *           computed as RCOND = 1/(norm(A) * norm(inv(A))).
    + *	    
    + *    INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    ===================================================================== 
    + * 
    + */ + +void +cgscon(char *norm, SuperMatrix *L, SuperMatrix *U, + float anorm, float *rcond, SuperLUStat_t *stat, int *info) +{ + + + /* Local variables */ + int kase, kase1, onenrm, i; + float ainvnm; + complex *work; + extern int crscl_(int *, complex *, complex *, int *); + + extern int clacon_(int *, complex *, complex *, float *, int *); + + + /* Test the input parameters. */ + *info = 0; + onenrm = *(unsigned char *)norm == '1' || lsame_(norm, "O"); + if (! onenrm && ! lsame_(norm, "I")) *info = -1; + else if (L->nrow < 0 || L->nrow != L->ncol || + L->Stype != SLU_SC || L->Dtype != SLU_C || L->Mtype != SLU_TRLU) + *info = -2; + else if (U->nrow < 0 || U->nrow != U->ncol || + U->Stype != SLU_NC || U->Dtype != SLU_C || U->Mtype != SLU_TRU) + *info = -3; + if (*info != 0) { + i = -(*info); + xerbla_("cgscon", &i); + return; + } + + /* Quick return if possible */ + *rcond = 0.; + if ( L->nrow == 0 || U->nrow == 0) { + *rcond = 1.; + return; + } + + work = complexCalloc( 3*L->nrow ); + + + if ( !work ) + ABORT("Malloc fails for work arrays in cgscon."); + + /* Estimate the norm of inv(A). */ + ainvnm = 0.; + if ( onenrm ) kase1 = 1; + else kase1 = 2; + kase = 0; + + do { + clacon_(&L->nrow, &work[L->nrow], &work[0], &ainvnm, &kase); + + if (kase == 0) break; + + if (kase == kase1) { + /* Multiply by inv(L). */ + sp_ctrsv("L", "No trans", "Unit", L, U, &work[0], stat, info); + + /* Multiply by inv(U). */ + sp_ctrsv("U", "No trans", "Non-unit", L, U, &work[0], stat, info); + + } else { + + /* Multiply by inv(U'). */ + sp_ctrsv("U", "Transpose", "Non-unit", L, U, &work[0], stat, info); + + /* Multiply by inv(L'). */ + sp_ctrsv("L", "Transpose", "Unit", L, U, &work[0], stat, info); + + } + + } while ( kase != 0 ); + + /* Compute the estimate of the reciprocal condition number. */ + if (ainvnm != 0.) *rcond = (1. / ainvnm) / anorm; + + SUPERLU_FREE (work); + return; + +} /* cgscon */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgsequ.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgsequ.c new file mode 100644 index 0000000..db31e35 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgsequ.c @@ -0,0 +1,195 @@ + +/*! @file cgsequ.c + * \brief Computes row and column scalings + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from LAPACK routine CGEEQU
    + * 
    + */ +/* + * File name: cgsequ.c + * History: Modified from LAPACK routine CGEEQU + */ +#include +#include "slu_cdefs.h" + + + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   CGSEQU computes row and column scalings intended to equilibrate an   
    + *   M-by-N sparse matrix A and reduce its condition number. R returns the row
    + *   scale factors and C the column scale factors, chosen to try to make   
    + *   the largest element in each row and column of the matrix B with   
    + *   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.   
    + *
    + *   R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    + *   number and BIGNUM = largest safe number.  Use of these scaling   
    + *   factors is not guaranteed to reduce the condition number of A but   
    + *   works well in practice.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input) SuperMatrix*
    + *           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    + *           factors are to be computed. The type of A can be:
    + *           Stype = SLU_NC; Dtype = SLU_C; Mtype = SLU_GE.
    + *	    
    + *   R       (output) float*, size A->nrow
    + *           If INFO = 0 or INFO > M, R contains the row scale factors   
    + *           for A.
    + *	    
    + *   C       (output) float*, size A->ncol
    + *           If INFO = 0,  C contains the column scale factors for A.
    + *	    
    + *   ROWCND  (output) float*
    + *           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    + *           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    + *           AMAX is neither too large nor too small, it is not worth   
    + *           scaling by R.
    + *	    
    + *   COLCND  (output) float*
    + *           If INFO = 0, COLCND contains the ratio of the smallest   
    + *           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    + *           worth scaling by C.
    + *	    
    + *   AMAX    (output) float*
    + *           Absolute value of largest matrix element.  If AMAX is very   
    + *           close to overflow or very close to underflow, the matrix   
    + *           should be scaled.
    + *	    
    + *   INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *           > 0:  if INFO = i,  and i is   
    + *                 <= A->nrow:  the i-th row of A is exactly zero   
    + *                 >  A->ncol:  the (i-M)-th column of A is exactly zero   
    + *
    + *   ===================================================================== 
    + * 
    + */ +void +cgsequ(SuperMatrix *A, float *r, float *c, float *rowcnd, + float *colcnd, float *amax, int *info) +{ + + + /* Local variables */ + NCformat *Astore; + complex *Aval; + int i, j, irow; + float rcmin, rcmax; + float bignum, smlnum; + extern float slamch_(char *); + + /* Test the input parameters. */ + *info = 0; + if ( A->nrow < 0 || A->ncol < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -1; + if (*info != 0) { + i = -(*info); + xerbla_("cgsequ", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || A->ncol == 0 ) { + *rowcnd = 1.; + *colcnd = 1.; + *amax = 0.; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Get machine constants. */ + smlnum = slamch_("S"); + bignum = 1. / smlnum; + + /* Compute row scale factors. */ + for (i = 0; i < A->nrow; ++i) r[i] = 0.; + + /* Find the maximum element in each row. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + r[irow] = SUPERLU_MAX( r[irow], c_abs1(&Aval[i]) ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (i = 0; i < A->nrow; ++i) { + rcmax = SUPERLU_MAX(rcmax, r[i]); + rcmin = SUPERLU_MIN(rcmin, r[i]); + } + *amax = rcmax; + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (i = 0; i < A->nrow; ++i) + if (r[i] == 0.) { + *info = i + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (i = 0; i < A->nrow; ++i) + r[i] = 1. / SUPERLU_MIN( SUPERLU_MAX( r[i], smlnum ), bignum ); + /* Compute ROWCND = min(R(I)) / max(R(I)) */ + *rowcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + /* Compute column scale factors */ + for (j = 0; j < A->ncol; ++j) c[j] = 0.; + + /* Find the maximum element in each column, assuming the row + scalings computed above. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + c[j] = SUPERLU_MAX( c[j], c_abs1(&Aval[i]) * r[irow] ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->ncol; ++j) { + rcmax = SUPERLU_MAX(rcmax, c[j]); + rcmin = SUPERLU_MIN(rcmin, c[j]); + } + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (j = 0; j < A->ncol; ++j) + if ( c[j] == 0. ) { + *info = A->nrow + j + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (j = 0; j < A->ncol; ++j) + c[j] = 1. / SUPERLU_MIN( SUPERLU_MAX( c[j], smlnum ), bignum); + /* Compute COLCND = min(C(J)) / max(C(J)) */ + *colcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + return; + +} /* cgsequ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgsisx.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgsisx.c new file mode 100644 index 0000000..6571ccc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgsisx.c @@ -0,0 +1,723 @@ + +/*! @file cgsisx.c + * \brief Computes an approximate solutions of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * November, 2010
    + * 
    + */ +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSISX computes an approximate solutions of linear equations
    + * A*X=B or A'*X=B, using the ILU factorization from cgsitrf().
    + * An estimation of the condition number is provided. 
    + * The routine performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A is
    + *	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *	     = TRANS or CONJ).
    + *
    + *	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *	     matrix that usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the matrix A (after equilibration if options->Equil = YES)
    + *	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *	1.4. Compute the reciprocal pivot growth factor.
    + *
    + *	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    + *	     and info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	1.6. The system of equations is solved for X using the factored form
    + *	     of A.
    + *
    + *	1.7. options->IterRefine is not used
    + *
    + *	1.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *	1.9. options for ILU only
    + *	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    + *		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    + *		entries of modulus 1 on the diagonal and off-diagonal entries
    + *		of modulus at most 1. If MC64 fails, dgsequ() is used to
    + *		equilibrate the system.
    + *              ( Default: LargeDiag )
    + *	     2) options->ILU_DropTol = tau is the threshold for dropping.
    + *		For L, it is used directly (for the whole row in a supernode);
    + *		For U, ||A(:,i)||_oo * tau is used as the threshold
    + *	        for the	i-th column.
    + *		If a secondary dropping rule is required, tau will
    + *	        also be used to compute the second threshold.
    + *              ( Default: 1e-4 )
    + *	     3) options->ILU_FillFactor = gamma, used as the initial guess
    + *		of memory growth.
    + *		If a secondary dropping rule is required, it will also
    + *              be used as an upper bound of the memory.
    + *              ( Default: 10 )
    + *	     4) options->ILU_DropRule specifies the dropping rule.
    + *		Option	      Meaning
    + *		======	      ===========
    + *		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    + *		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    + *		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    + *			      p = gamma * nnz(A(:,j)).
    + *		DROP_AREA:    Variation of ILUTP, for j-th column, use
    + *			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    + *		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    + *			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    + *				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    + *			      Otherwise
    + *				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    + *			      tau_U(j) uses the similar rule.
    + *			      NOTE: the thresholds used by L and U are separate.
    + *		DROP_INTERP:  Compute the second dropping threshold by
    + *			      interpolation instead of sorting (default).
    + *			      In this case, the actual fill ratio is not
    + *			      guaranteed smaller than gamma.
    + *		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    + *		( Default: DROP_BASIC | DROP_AREA )
    + *	     5) options->ILU_Norm is the criterion of measuring the magnitude
    + *		of a row in a supernode of L. ( Default is INF_NORM )
    + *		options->ILU_Norm	RowSize(x[1:n])
    + *		=================	===============
    + *		ONE_NORM		||x||_1 / n
    + *		TWO_NORM		||x||_2 / sqrt(n)
    + *		INF_NORM		max{|x[i]|}
    + *	     6) options->ILU_MILU specifies the type of MILU's variation.
    + *		= SILU: do not perform Modified ILU;
    + *		= SMILU_1 (not recommended):
    + *		    U(i,i) := U(i,i) + sum(dropped entries);
    + *		= SMILU_2:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    + *		= SMILU_3:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    + *		NOTE: Even SMILU_1 does not preserve the column sum because of
    + *		late dropping.
    + *              ( Default: SILU )
    + *	     7) options->ILU_FillTol is used as the perturbation when
    + *		encountering zero pivots. If some U(i,i) = 0, so that U is
    + *		exactly singular, then
    + *		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    + *              ( Default: 1e-2 )
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *	to the transpose of A:
    + *
    + *	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A' is
    + *	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    + *	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *	2.2. Permute columns of transpose(A) (rows of A),
    + *	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    + *	     usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the transpose(A) (after equilibration if
    + *	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *	     permutation Pr determined by partial pivoting.
    + *
    + *	2.4. Compute the reciprocal pivot growth factor.
    + *
    + *	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    + *	     And info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	2.6. The system of equations is solved for X using the factored form
    + *	     of transpose(A).
    + *
    + *	2.7. If options->IterRefine is not used.
    + *
    + *	2.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the LU decomposition will be performed and how the
    + *	   system will be solved.
    + *
    + * A	   (input/output) SuperMatrix*
    + *	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *	   of the linear equations is A->nrow. Currently, the type of A can be:
    + *	   Stype = SLU_NC or SLU_NR, Dtype = SLU_C, Mtype = SLU_GE.
    + *	   In the future, more general A may be handled.
    + *
    + *	   On entry, If options->Fact = FACTORED and equed is not 'N',
    + *	   then A must have been equilibrated by the scaling factors in
    + *	   R and/or C.
    + *	   On exit, A is not modified
    + *         if options->Equil = NO, or
    + *         if options->Equil = YES but equed = 'N' on exit, or
    + *         if options->RowPerm = NO.
    + *
    + *	   Otherwise, if options->Equil = YES and equed is not 'N',
    + *	   A is scaled as follows:
    + *	   If A->Stype = SLU_NC:
    + *	     equed = 'R':  A := diag(R) * A
    + *	     equed = 'C':  A := A * diag(C)
    + *	     equed = 'B':  A := diag(R) * A * diag(C).
    + *	   If A->Stype = SLU_NR:
    + *	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix to an I-matrix, that is A is modified as follows:
    + *            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    + *            off-diagonal entries of modulus at most 1. P is a permutation
    + *            obtained from MC64.
    + *            If MC64 fails, cgsequ() is used to equilibrate the system,
    + *            and A is scaled as above, there is no permutation involved.
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *	   which defines the permutation matrix Pc; perm_c[i] = j means
    + *	   column i of A is in position j in A*Pc.
    + *	   On exit, perm_c may be overwritten by the product of the input
    + *	   perm_c and a permutation that postorders the elimination tree
    + *	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *	   is already in postorder.
    + *
    + *	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *	   which describes permutation of columns of transpose(A) 
    + *	   (rows of A) as described above.
    + *
    + * perm_r  (input/output) int*
    + *	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *	   which defines the permutation matrix Pr, and is determined
    + *	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *	   position j in Pr*A.
    + *
    + *	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *	   determines permutation of rows of transpose(A)
    + *	   (columns of A) as described above.
    + *
    + *	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	   will try to use the input perm_r, unless a certain threshold
    + *	   criterion is violated. In that case, perm_r is overwritten by a
    + *	   new permutation determined by partial pivoting or diagonal
    + *	   threshold pivoting.
    + *	   Otherwise, perm_r is output argument.
    + *
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *	   Elimination tree of Pc'*A'*A*Pc.
    + *	   If options->Fact != FACTORED and options->Fact != DOFACT,
    + *	   etree is an input argument, otherwise it is an output argument.
    + *	   Note: etree is a vector of parent pointers for a forest whose
    + *	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *	   Specifies the form of equilibration that was done.
    + *	   = 'N': No equilibration.
    + *	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *	   = 'B': Both row and column equilibration, i.e., A was replaced 
    + *		  by diag(R)*A*diag(C).
    + *	   If options->Fact = FACTORED, equed is an input argument,
    + *	   otherwise it is an output argument.
    + *
    + * R	   (input/output) float*, dimension (A->nrow)
    + *	   The row scale factors for A or transpose(A).
    + *	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *	   If equed = 'N' or 'C', R is not accessed.
    + *	   If options->Fact = FACTORED, R is an input argument,
    + *	       otherwise, R is output.
    + *	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *	       of R must be positive.
    + *
    + * C	   (input/output) float*, dimension (A->ncol)
    + *	   The column scale factors for A or transpose(A).
    + *	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *	   If equed = 'N' or 'R', C is not accessed.
    + *	   If options->Fact = FACTORED, C is an input argument,
    + *	       otherwise, C is output.
    + *	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *	       of C must be positive.
    + *
    + * L	   (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses compressed row subscripts storage for supernodes, i.e.,
    + *	   L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U	   (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses column-wise storage scheme, i.e., U has types:
    + *	   Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *	   User supplied workspace, should be large enough
    + *	   to hold data structures for factors L and U.
    + *	   On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 mem_usage->total_needed; no other side effects.
    + *
    + *	   See argument 'mem_usage' for memory usage statistics.
    + *
    + * B	   (input/output) SuperMatrix*
    + *	   B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *	   On entry, the right hand side matrix.
    + *	   If B->ncol = 0, only LU decomposition is performed, the triangular
    + *			   solve is skipped.
    + *	   On exit,
    + *	      if equed = 'N', B is not modified; otherwise
    + *	      if A->Stype = SLU_NC:
    + *		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *		    B is overwritten by diag(R)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *		    B is overwritten by diag(C)*B;
    + *	      if A->Stype = SLU_NR:
    + *		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *		    B is overwritten by diag(C)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *		    B is overwritten by diag(R)*B.
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix A to an I-matrix. Then, in addition to the scaling
    + *            above, B is further permuted by P*B if options->Trans = NOTRANS,
    + *            where P is obtained from MC64.
    + *
    + * X	   (output) SuperMatrix*
    + *	   X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *	   to the original system of equations. Note that A and B are modified
    + *	   on exit if equed is not 'N', and the solution to the equilibrated
    + *	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *	   and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) float*
    + *	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *	   The infinity norm is used. If recip_pivot_growth is much less
    + *	   than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) float*
    + *	   The estimate of the reciprocal condition number of the matrix A
    + *	   after equilibration (if done). If rcond is less than the machine
    + *	   precision (in particular, if rcond = 0), the matrix is singular
    + *	   to working precision. This condition is indicated by a return
    + *	   code of info > 0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *	   Record the memory usage statistics, consisting of following fields:
    + *	   - for_lu (float)
    + *	     The amount of space used in bytes for L\U data structures.
    + *	   - total_needed (float)
    + *	     The amount of space needed in bytes to perform factorization.
    + *	   - expansions (int)
    + *	     The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *	  Record the statistics on runtime and floating-point operation count.
    + *	  See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + *	   > 0: if info = i, and i is
    + *		<= A->ncol: number of zero pivots. They are replaced by small
    + *		      entries due to options->ILU_FillTol.
    + *		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *		      precision, meaning that the matrix is singular to
    + *		      working precision. Nevertheless, the solution and
    + *		      error bounds are computed because there are a number
    + *		      of situations where the computed solution can be more
    + *		      accurate than the value of RCOND would suggest.
    + *		> A->ncol+1: number of bytes allocated when memory allocation
    + *		      failure occurred, plus A->ncol.
    + * 
    + */ + +void +cgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, float *R, float *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, + float *recip_pivot_growth, float *rcond, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info) +{ + + DNformat *Bstore, *Xstore; + complex *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec, mc64; + trans_t trant; + char norm[1]; + int i, j, info1; + float amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + float diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + int *perm = NULL; + + /* External functions */ + extern float clangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + mc64 = (options->RowPerm == LargeDiag); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = slamch_("Safe minimum"); + bignum = 1. / smlnum; + } + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_C || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("cgsisx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + cCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact ) { + register int i, j; + NCformat *Astore = AA->Store; + int nnz = Astore->nnz; + int *colptr = Astore->colptr; + int *rowind = Astore->rowind; + complex *nzval = (complex *)Astore->nzval; + int n = AA->nrow; + + if ( mc64 ) { + *equed = 'B'; + /*rowequ = colequ = 1;*/ + t0 = SuperLU_timer_(); + if ((perm = intMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for perm[]"); + + info1 = cldperm(5, n, nnz, colptr, rowind, nzval, perm, R, C); + + if (info1 > 0) { /* MC64 fails, call cgsequ() later */ + mc64 = 0; + SUPERLU_FREE(perm); + perm = NULL; + } else { + rowequ = colequ = 1; + for (i = 0; i < n; i++) { + R[i] = exp(R[i]); + C[i] = exp(C[i]); + } + /* permute and scale the matrix */ + for (j = 0; j < n; j++) { + for (i = colptr[j]; i < colptr[j + 1]; i++) { + cs_mult(&nzval[i], &nzval[i], R[rowind[i]] * C[j]); + rowind[i] = perm[rowind[i]]; + } + } + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + if ( !mc64 & equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + cgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + claqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + cgsitrf(options, &AC, relax, panel_size, etree, work, lwork, + perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) return; + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = cPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = clangs(norm, AA); + cgscon(norm, L, U, anorm, rcond, stat, &info1); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { /* Solve the system */ + complex *tmp, *rhs_work; + int n = A->nrow; + if ( mc64 ) { + if ((tmp = complexMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for tmp[]"); + } + + /* Scale and permute the right-hand side if equilibration + and permutation from MC64 were performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], R[i]); + } + if ( mc64 ) { + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (i = 0; i < n; i++) tmp[perm[i]] = rhs_work[i]; + for (i = 0; i < n; i++) rhs_work[i] = tmp[i]; + } + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], C[i]); + } + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + cgstrs (trant, L, U, perm_c, perm_r, X, stat, &info1); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original + system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], C[i]); + } + } + } else { /* transposed system */ + if ( rowequ ) { + if ( mc64 ) { + for (j = 0; j < nrhs; j++) { + for (i = 0; i < n; i++) + tmp[i] = Xmat[i + j * ldx]; /*dcopy*/ + for (i = 0; i < n; i++) + cs_mult(&Xmat[i+j*ldx], &tmp[perm[i]], R[i]); + } + } else { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], R[i]); + } + } + } + } + + if ( mc64 ) SUPERLU_FREE(tmp); + + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < slamch_("E") && *info == 0) *info = A->ncol + 1; + } + + if (perm) SUPERLU_FREE(perm); + + if ( nofact ) { + ilu_cQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c new file mode 100644 index 0000000..40aa5a7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c @@ -0,0 +1,636 @@ + +/*! @file cgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +cgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + complex *cwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + complex *dense, *tempv; + float *stempv; + int *relax_end, *relax_fsupc; + complex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float *amax; + complex drop_sum; + float alpha, omega; /* used in MILU, mimicing DRIC */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + float *swork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + complex zero = {0.0, 0.0}; + float one = 1.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = cLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &cwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + cSetRWork(m, panel_size, cwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (float *) floatMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + swork2 = (float *)floatMalloc(n); + else + swork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + alpha = pow((double)n, -1.0 / options->ILU_MILU_Dim); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + stempv = (float *) tempv; + i = ilu_cdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, stempv, swork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_csnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = cLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register float tmp = c_abs1 (&a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + csnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_cpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_cpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + cpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_ccolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = ccolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = cLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_ccopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + swork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + if (drop_sum.r != 0.0 && drop_sum.i != 0.0) + { + omega = SUPERLU_MIN(2.0*(1.0-alpha)/c_abs1(&drop_sum), 1.0); + cs_mult(&drop_sum, &drop_sum, omega); + } + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_cpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + stempv = (float *) tempv; + i = ilu_cdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, stempv, swork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + cLUWorkFree(iwork, cwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + cCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_C, SLU_TRLU); + cCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_C, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( swork2 ) SUPERLU_FREE (swork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c.bak new file mode 100644 index 0000000..03474b1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgsitrf.c.bak @@ -0,0 +1,629 @@ + +/*! @file cgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +cgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + complex *cwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + complex *dense, *tempv; + float *stempv; + int *relax_end, *relax_fsupc; + complex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float *amax; + complex drop_sum; + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + int *iwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + complex zero = {0.0, 0.0}; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = cLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &cwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + cSetRWork(m, panel_size, cwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (float *) floatMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + iwork2 = (int *)intMalloc(n); + else + iwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + stempv = (float *) tempv; + i = ilu_cdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, stempv, iwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_csnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = cLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register float tmp = c_abs1 (&a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + csnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_cpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_cpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + cpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_ccolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = ccolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = cLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_ccopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + iwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + cs_mult(&drop_sum, &drop_sum, MILU_ALPHA); + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_cpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + stempv = (float *) tempv; + i = ilu_cdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, stempv, iwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + cLUWorkFree(iwork, cwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + cCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_C, SLU_TRLU); + cCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_C, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( iwork2 ) SUPERLU_FREE (iwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgsrfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgsrfs.c new file mode 100644 index 0000000..e7c2bc7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgsrfs.c @@ -0,0 +1,460 @@ + +/*! @file cgsrfs.c + * \brief Improves computed solution to a system of inear equations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routine CGERFS
    + * 
    + */ +/* + * File name: cgsrfs.c + * History: Modified from lapack routine CGERFS + */ +#include +#include "slu_cdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   CGSRFS improves the computed solution to a system of linear   
    + *   equations and provides error bounds and backward error estimates for 
    + *   the solution.   
    + *
    + *   If equilibration was performed, the system becomes:
    + *           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *   
    + *   A       (input) SuperMatrix*
    + *           The original matrix A in the system, or the scaled A if
    + *           equilibration was done. The type of A can be:
    + *           Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_GE.
    + *    
    + *   L       (input) SuperMatrix*
    + *	     The factor L from the factorization Pr*A*Pc=L*U. Use
    + *           compressed row subscripts storage for supernodes, 
    + *           i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + * 
    + *   U       (input) SuperMatrix*
    + *           The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *           cgstrf(). Use column-wise storage scheme, 
    + *           i.e., U has types: Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + *   perm_c  (input) int*, dimension (A->ncol)
    + *	     Column permutation vector, which defines the 
    + *           permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *           in position j in A*Pc.
    + *
    + *   perm_r  (input) int*, dimension (A->nrow)
    + *           Row permutation vector, which defines the permutation matrix Pr;
    + *           perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + *   equed   (input) Specifies the form of equilibration that was done.
    + *           = 'N': No equilibration.
    + *           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *           = 'C': Column equilibration, i.e., A was postmultiplied by
    + *                  diag(C).
    + *           = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                  by diag(R)*A*diag(C).
    + *
    + *   R       (input) float*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *           If equed = 'R' or 'B', A is premultiplied by diag(R).
    + *           If equed = 'N' or 'C', R is not accessed.
    + * 
    + *   C       (input) float*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    + *           If equed = 'N' or 'R', C is not accessed.
    + *
    + *   B       (input) SuperMatrix*
    + *           B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *           The right hand side matrix B.
    + *           if equed = 'R' or 'B', B is premultiplied by diag(R).
    + *
    + *   X       (input/output) SuperMatrix*
    + *           X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *           On entry, the solution matrix X, as computed by cgstrs().
    + *           On exit, the improved solution matrix X.
    + *           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    + *               in order to obtain the solution to the original system.
    + *
    + *   FERR    (output) float*, dimension (B->ncol)   
    + *           The estimated forward error bound for each solution vector   
    + *           X(j) (the j-th column of the solution matrix X).   
    + *           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *           is an estimated upper bound for the magnitude of the largest 
    + *           element in (X(j) - XTRUE) divided by the magnitude of the   
    + *           largest element in X(j).  The estimate is as reliable as   
    + *           the estimate for RCOND, and is almost always a slight   
    + *           overestimate of the true error.
    + *
    + *   BERR    (output) float*, dimension (B->ncol)   
    + *           The componentwise relative backward error of each solution   
    + *           vector X(j) (i.e., the smallest relative change in   
    + *           any element of A or B that makes X(j) an exact solution).
    + *
    + *   stat     (output) SuperLUStat_t*
    + *            Record the statistics on runtime and floating-point operation count.
    + *            See util.h for the definition of 'SuperLUStat_t'.
    + *
    + *   info    (output) int*   
    + *           = 0:  successful exit   
    + *            < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    Internal Parameters   
    + *    ===================   
    + *
    + *    ITMAX is the maximum number of steps of iterative refinement.   
    + *
    + * 
    + */ +void +cgsrfs(trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, char *equed, float *R, float *C, + SuperMatrix *B, SuperMatrix *X, float *ferr, float *berr, + SuperLUStat_t *stat, int *info) +{ + + +#define ITMAX 5 + + /* Table of constant values */ + int ione = 1; + complex ndone = {-1., 0.}; + complex done = {1., 0.}; + + /* Local variables */ + NCformat *Astore; + complex *Aval; + SuperMatrix Bjcol; + DNformat *Bstore, *Xstore, *Bjcol_store; + complex *Bmat, *Xmat, *Bptr, *Xptr; + int kase; + float safe1, safe2; + int i, j, k, irow, nz, count, notran, rowequ, colequ; + int ldb, ldx, nrhs; + float s, xk, lstres, eps, safmin; + char transc[1]; + trans_t transt; + complex *work; + float *rwork; + int *iwork; + + extern int clacon_(int *, complex *, complex *, float *, int *); +#ifdef _CRAY + extern int CCOPY(int *, complex *, int *, complex *, int *); + extern int CSAXPY(int *, complex *, complex *, int *, complex *, int *); +#else + extern int ccopy_(int *, complex *, int *, complex *, int *); + extern int caxpy_(int *, complex *, complex *, int *, complex *, int *); +#endif + + Astore = A->Store; + Aval = Astore->nzval; + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + /* Test the input parameters */ + *info = 0; + notran = (trans == NOTRANS); + if ( !notran && trans != TRANS && trans != CONJ ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -2; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_C || L->Mtype != SLU_TRLU ) + *info = -3; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_C || U->Mtype != SLU_TRU ) + *info = -4; + else if ( ldb < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || B->Mtype != SLU_GE ) + *info = -10; + else if ( ldx < SUPERLU_MAX(0, A->nrow) || + X->Stype != SLU_DN || X->Dtype != SLU_C || X->Mtype != SLU_GE ) + *info = -11; + if (*info != 0) { + i = -(*info); + xerbla_("cgsrfs", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || nrhs == 0) { + for (j = 0; j < nrhs; ++j) { + ferr[j] = 0.; + berr[j] = 0.; + } + return; + } + + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + + /* Allocate working space */ + work = complexMalloc(2*A->nrow); + rwork = (float *) SUPERLU_MALLOC( A->nrow * sizeof(float) ); + iwork = intMalloc(A->nrow); + if ( !work || !rwork || !iwork ) + ABORT("Malloc fails for work/rwork/iwork."); + + if ( notran ) { + *(unsigned char *)transc = 'N'; + transt = TRANS; + } else { + *(unsigned char *)transc = 'T'; + transt = NOTRANS; + } + + /* NZ = maximum number of nonzero elements in each row of A, plus 1 */ + nz = A->ncol + 1; + eps = slamch_("Epsilon"); + safmin = slamch_("Safe minimum"); + /* Set SAFE1 essentially to be the underflow threshold times the + number of additions in each row. */ + safe1 = nz * safmin; + safe2 = safe1 / eps; + + /* Compute the number of nonzeros in each row (or column) of A */ + for (i = 0; i < A->nrow; ++i) iwork[i] = 0; + if ( notran ) { + for (k = 0; k < A->ncol; ++k) + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + ++iwork[Astore->rowind[i]]; + } else { + for (k = 0; k < A->ncol; ++k) + iwork[k] = Astore->colptr[k+1] - Astore->colptr[k]; + } + + /* Copy one column of RHS B into Bjcol. */ + Bjcol.Stype = B->Stype; + Bjcol.Dtype = B->Dtype; + Bjcol.Mtype = B->Mtype; + Bjcol.nrow = B->nrow; + Bjcol.ncol = 1; + Bjcol.Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !Bjcol.Store ) ABORT("SUPERLU_MALLOC fails for Bjcol.Store"); + Bjcol_store = Bjcol.Store; + Bjcol_store->lda = ldb; + Bjcol_store->nzval = work; /* address aliasing */ + + /* Do for each right hand side ... */ + for (j = 0; j < nrhs; ++j) { + count = 0; + lstres = 3.; + Bptr = &Bmat[j*ldb]; + Xptr = &Xmat[j*ldx]; + + while (1) { /* Loop until stopping criterion is satisfied. */ + + /* Compute residual R = B - op(A) * X, + where op(A) = A, A**T, or A**H, depending on TRANS. */ + +#ifdef _CRAY + CCOPY(&A->nrow, Bptr, &ione, work, &ione); +#else + ccopy_(&A->nrow, Bptr, &ione, work, &ione); +#endif + sp_cgemv(transc, ndone, A, Xptr, ione, done, work, ione); + + /* Compute componentwise relative backward error from formula + max(i) ( abs(R(i)) / ( abs(op(A))*abs(X) + abs(B) )(i) ) + where abs(Z) is the componentwise absolute value of the matrix + or vector Z. If the i-th component of the denominator is less + than SAFE2, then SAFE1 is added to the i-th component of the + numerator before dividing. */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = c_abs1( &Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if (notran) { + for (k = 0; k < A->ncol; ++k) { + xk = c_abs1( &Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += c_abs1(&Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + s += c_abs1(&Aval[i]) * c_abs1(&Xptr[irow]); + } + rwork[k] += s; + } + } + s = 0.; + for (i = 0; i < A->nrow; ++i) { + if (rwork[i] > safe2) { + s = SUPERLU_MAX( s, c_abs1(&work[i]) / rwork[i] ); + } else if ( rwork[i] != 0.0 ) { + s = SUPERLU_MAX( s, (c_abs1(&work[i]) + safe1) / rwork[i] ); + } + /* If rwork[i] is exactly 0.0, then we know the true + residual also must be exactly 0.0. */ + } + berr[j] = s; + + /* Test stopping criterion. Continue iterating if + 1) The residual BERR(J) is larger than machine epsilon, and + 2) BERR(J) decreased by at least a factor of 2 during the + last iteration, and + 3) At most ITMAX iterations tried. */ + + if (berr[j] > eps && berr[j] * 2. <= lstres && count < ITMAX) { + /* Update solution and try again. */ + cgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + +#ifdef _CRAY + CAXPY(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#else + caxpy_(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#endif + lstres = berr[j]; + ++count; + } else { + break; + } + + } /* end while */ + + stat->RefineSteps = count; + + /* Bound error from formula: + norm(X - XTRUE) / norm(X) .le. FERR = norm( abs(inv(op(A)))* + ( abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) / norm(X) + where + norm(Z) is the magnitude of the largest component of Z + inv(op(A)) is the inverse of op(A) + abs(Z) is the componentwise absolute value of the matrix or + vector Z + NZ is the maximum number of nonzeros in any row of A, plus 1 + EPS is machine epsilon + + The i-th component of abs(R)+NZ*EPS*(abs(op(A))*abs(X)+abs(B)) + is incremented by SAFE1 if the i-th component of + abs(op(A))*abs(X) + abs(B) is less than SAFE2. + + Use CLACON to estimate the infinity-norm of the matrix + inv(op(A)) * diag(W), + where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = c_abs1( &Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if ( notran ) { + for (k = 0; k < A->ncol; ++k) { + xk = c_abs1( &Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += c_abs1(&Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + xk = c_abs1( &Xptr[irow] ); + s += c_abs1(&Aval[i]) * xk; + } + rwork[k] += s; + } + } + + for (i = 0; i < A->nrow; ++i) + if (rwork[i] > safe2) + rwork[i] = c_abs(&work[i]) + (iwork[i]+1)*eps*rwork[i]; + else + rwork[i] = c_abs(&work[i])+(iwork[i]+1)*eps*rwork[i]+safe1; + kase = 0; + + do { + clacon_(&A->nrow, &work[A->nrow], work, + &ferr[j], &kase); + if (kase == 0) break; + + if (kase == 1) { + /* Multiply by diag(W)*inv(op(A)**T)*(diag(C) or diag(R)). */ + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) { + cs_mult(&work[i], &work[i], C[i]); + } + else if ( !notran && rowequ ) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&work[i], &work[i], R[i]); + } + + cgstrs (transt, L, U, perm_c, perm_r, &Bjcol, stat, info); + + for (i = 0; i < A->nrow; ++i) { + cs_mult(&work[i], &work[i], rwork[i]); + } + } else { + /* Multiply by (diag(C) or diag(R))*inv(op(A))*diag(W). */ + for (i = 0; i < A->nrow; ++i) { + cs_mult(&work[i], &work[i], rwork[i]); + } + + cgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) { + cs_mult(&work[i], &work[i], C[i]); + } + else if ( !notran && rowequ ) + for (i = 0; i < A->ncol; ++i) { + cs_mult(&work[i], &work[i], R[i]); + } + } + + } while ( kase != 0 ); + + /* Normalize error. */ + lstres = 0.; + if ( notran && colequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, C[i] * c_abs1( &Xptr[i]) ); + } else if ( !notran && rowequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, R[i] * c_abs1( &Xptr[i]) ); + } else { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, c_abs1( &Xptr[i]) ); + } + if ( lstres != 0. ) + ferr[j] /= lstres; + + } /* for each RHS j ... */ + + SUPERLU_FREE(work); + SUPERLU_FREE(rwork); + SUPERLU_FREE(iwork); + SUPERLU_FREE(Bjcol.Store); + + return; + +} /* cgsrfs */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgssv.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgssv.c new file mode 100644 index 0000000..07f4784 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgssv.c @@ -0,0 +1,227 @@ + +/*! @file cgssv.c + * \brief Solves the system of linear equations A*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSSV solves the system of linear equations A*X=B, using the
    + * LU factorization from CGSTRF. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *
    + *      1.1. Permute the columns of A, forming A*Pc, where Pc
    + *           is a permutation matrix. For more details of this step, 
    + *           see sp_preorder.c.
    + *
    + *      1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    + *           by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      1.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    + *      above algorithm to the transpose of A:
    + *
    + *      2.1. Permute columns of transpose(A) (rows of A),
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    + *           determined by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      2.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR; Dtype = SLU_C; Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + * perm_c  (input/output) int*
    + *         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    + *         which defines the permutation matrix Pc; perm_c[i] = j means 
    + *         column i of A is in position j in A*Pc.
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + *         If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    + *            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    + *            On exit, perm_c may be overwritten by the product of the input
    + *            perm_c and a permutation that postorders the elimination tree
    + *            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *            is already in postorder.
    + *         Otherwise, it is an output argument.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined 
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->RowPerm = MY_PERMR or
    + *            options->Fact = SamePattern_SameRowPerm, perm_r is an
    + *            input argument.
    + *         otherwise it is an output argument.
    + *
    + * L       (output) SuperMatrix*
    + *         The factor L from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *         
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *         > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                so the solution could not be computed.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol.
    + * 
    + */ + +void +cgssv(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, + SuperLUStat_t *stat, int *info ) +{ + + DNformat *Bstore; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int lwork = 0, *etree, i; + + /* Set default values for some parameters */ + int panel_size; /* panel size */ + int relax; /* no of columns in a relaxed snodes */ + int permc_spec; + trans_t trans = NOTRANS; + double *utime; + double t; /* Temporary time */ + + /* Test the input parameters ... */ + *info = 0; + Bstore = B->Store; + if ( options->Fact != DOFACT ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -2; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || B->Mtype != SLU_GE ) + *info = -7; + if ( *info != 0 ) { + i = -(*info); + xerbla_("cgssv", &i); + return; + } + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + cCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + trans = TRANS; + } else { + if ( A->Stype == SLU_NC ) AA = A; + } + + t = SuperLU_timer_(); + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t; + + etree = intMalloc(A->ncol); + + t = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t; + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + /*printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4));*/ + t = SuperLU_timer_(); + /* Compute the LU factorization of A. */ + cgstrf(options, &AC, relax, panel_size, etree, + NULL, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t; + + t = SuperLU_timer_(); + if ( *info == 0 ) { + /* Solve the system A*X=B, overwriting B with X. */ + cgstrs (trans, L, U, perm_c, perm_r, B, stat, info); + } + utime[SOLVE] = SuperLU_timer_() - t; + + SUPERLU_FREE (etree); + Destroy_CompCol_Permuted(&AC); + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c new file mode 100644 index 0000000..890e227 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c @@ -0,0 +1,614 @@ + +/*! @file cgssvx.c + * \brief Solves the system of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + * the LU factorization from cgstrf(). Error bounds on the solution and
    + * a condition estimate are also provided. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *      1.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A is
    + *           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *           = TRANS or CONJ).
    + *
    + *      1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *           matrix that usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the matrix A (after equilibration if options->Equil = YES)
    + *           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *      1.4. Compute the reciprocal pivot growth factor.
    + *
    + *      1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form of 
    + *           A is used to estimate the condition number of the matrix A. If
    + *           the reciprocal of the condition number is less than machine
    + *           precision, info = A->ncol+1 is returned as a warning, but the
    + *           routine still goes on to solve for X and computes error bounds
    + *           as described below.
    + *
    + *      1.6. The system of equations is solved for X using the factored form
    + *           of A.
    + *
    + *      1.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      1.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *      to the transpose of A:
    + *
    + *      2.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A' is
    + *           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    + *           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *      2.2. Permute columns of transpose(A) (rows of A), 
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    + *           usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the transpose(A) (after equilibration if 
    + *           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *           permutation Pr determined by partial pivoting.
    + *
    + *      2.4. Compute the reciprocal pivot growth factor.
    + *
    + *      2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form 
    + *           of transpose(A) is used to estimate the condition number of the
    + *           matrix A. If the reciprocal of the condition number
    + *           is less than machine precision, info = A->nrow+1 is returned as
    + *           a warning, but the routine still goes on to solve for X and
    + *           computes error bounds as described below.
    + *
    + *      2.6. The system of equations is solved for X using the factored form
    + *           of transpose(A).
    + *
    + *      2.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      2.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input/output) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + *         On entry, If options->Fact = FACTORED and equed is not 'N', 
    + *         then A must have been equilibrated by the scaling factors in
    + *         R and/or C.  
    + *         On exit, A is not modified if options->Equil = NO, or if 
    + *         options->Equil = YES but equed = 'N' on exit.
    + *         Otherwise, if options->Equil = YES and equed is not 'N',
    + *         A is scaled as follows:
    + *         If A->Stype = SLU_NC:
    + *           equed = 'R':  A := diag(R) * A
    + *           equed = 'C':  A := A * diag(C)
    + *           equed = 'B':  A := diag(R) * A * diag(C).
    + *         If A->Stype = SLU_NR:
    + *           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *         which defines the permutation matrix Pc; perm_c[i] = j means
    + *         column i of A is in position j in A*Pc.
    + *         On exit, perm_c may be overwritten by the product of the input
    + *         perm_c and a permutation that postorders the elimination tree
    + *         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *         is already in postorder.
    + *
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *         will try to use the input perm_r, unless a certain threshold
    + *         criterion is violated. In that case, perm_r is overwritten by a
    + *         new permutation determined by partial pivoting or diagonal
    + *         threshold pivoting.
    + *         Otherwise, perm_r is output argument.
    + * 
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *         Elimination tree of Pc'*A'*A*Pc.
    + *         If options->Fact != FACTORED and options->Fact != DOFACT,
    + *         etree is an input argument, otherwise it is an output argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *         Specifies the form of equilibration that was done.
    + *         = 'N': No equilibration.
    + *         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *         = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                by diag(R)*A*diag(C).
    + *         If options->Fact = FACTORED, equed is an input argument,
    + *         otherwise it is an output argument.
    + *
    + * R       (input/output) float*, dimension (A->nrow)
    + *         The row scale factors for A or transpose(A).
    + *         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *         If equed = 'N' or 'C', R is not accessed.
    + *         If options->Fact = FACTORED, R is an input argument,
    + *             otherwise, R is output.
    + *         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *             of R must be positive.
    + * 
    + * C       (input/output) float*, dimension (A->ncol)
    + *         The column scale factors for A or transpose(A).
    + *         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *         If equed = 'N' or 'R', C is not accessed.
    + *         If options->Fact = FACTORED, C is an input argument,
    + *             otherwise, C is output.
    + *         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *             of C must be positive.
    + *         
    + * L       (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *         User supplied workspace, should be large enough
    + *         to hold data structures for factors L and U.
    + *         On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               mem_usage->total_needed; no other side effects.
    + *
    + *         See argument 'mem_usage' for memory usage statistics.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         If B->ncol = 0, only LU decomposition is performed, the triangular
    + *                         solve is skipped.
    + *         On exit,
    + *            if equed = 'N', B is not modified; otherwise
    + *            if A->Stype = SLU_NC:
    + *               if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *                  B is overwritten by diag(R)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *                  B is overwritten by diag(C)*B;
    + *            if A->Stype = SLU_NR:
    + *               if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *                  B is overwritten by diag(C)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *                  B is overwritten by diag(R)*B.
    + *
    + * X       (output) SuperMatrix*
    + *         X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE. 
    + *         If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *         to the original system of equations. Note that A and B are modified
    + *         on exit if equed is not 'N', and the solution to the equilibrated
    + *         system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *         and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) float*
    + *         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *         The infinity norm is used. If recip_pivot_growth is much less
    + *         than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) float*
    + *         The estimate of the reciprocal condition number of the matrix A
    + *         after equilibration (if done). If rcond is less than the machine
    + *         precision (in particular, if rcond = 0), the matrix is singular
    + *         to working precision. This condition is indicated by a return
    + *         code of info > 0.
    + *
    + * FERR    (output) float*, dimension (B->ncol)   
    + *         The estimated forward error bound for each solution vector   
    + *         X(j) (the j-th column of the solution matrix X).   
    + *         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *         is an estimated upper bound for the magnitude of the largest 
    + *         element in (X(j) - XTRUE) divided by the magnitude of the   
    + *         largest element in X(j).  The estimate is as reliable as   
    + *         the estimate for RCOND, and is almost always a slight   
    + *         overestimate of the true error.
    + *         If options->IterRefine = NOREFINE, ferr = 1.0.
    + *
    + * BERR    (output) float*, dimension (B->ncol)
    + *         The componentwise relative backward error of each solution   
    + *         vector X(j) (i.e., the smallest relative change in   
    + *         any element of A or B that makes X(j) an exact solution).
    + *         If options->IterRefine = NOREFINE, berr = 1.0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *         Record the memory usage statistics, consisting of following fields:
    + *         - for_lu (float)
    + *           The amount of space used in bytes for L\U data structures.
    + *         - total_needed (float)
    + *           The amount of space needed in bytes to perform factorization.
    + *         - expansions (int)
    + *           The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *         = 0: successful exit   
    + *         < 0: if info = -i, the i-th argument had an illegal value   
    + *         > 0: if info = i, and i is   
    + *              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    + *                    been completed, but the factor U is exactly   
    + *                    singular, so the solution and error bounds   
    + *                    could not be computed.   
    + *              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *                    precision, meaning that the matrix is singular to
    + *                    working precision. Nevertheless, the solution and
    + *                    error bounds are computed because there are a number
    + *                    of situations where the computed solution can be more
    + *                    accurate than the value of RCOND would suggest.   
    + *              > A->ncol+1: number of bytes allocated when memory allocation
    + *                    failure occurred, plus A->ncol.
    + * 
    + */ + +void +cgssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, float *R, float *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, + float *rcond, float *ferr, float *berr, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info ) +{ + + + DNformat *Bstore, *Xstore; + complex *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec; + trans_t trant; + char norm[1]; + int i, j, info1; + float amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + float diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + /* External functions */ + extern float clangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = slamch_("Safe minimum"); + bignum = 1. / smlnum; + } + +#if 0 +printf("dgssvx: Fact=%4d, Trans=%4d, equed=%c\n", + options->Fact, options->Trans, *equed); +#endif + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_C || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("cgssvx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + cCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact && equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + cgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + claqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + +/* printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4)); + fflush(stdout); */ + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + cgstrf(options, &AC, relax, panel_size, etree, + work, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) { + if ( *info <= A->ncol ) { + /* Compute the reciprocal pivot growth factor of the leading + rank-deficient *info columns of A. */ + *recip_pivot_growth = cPivotGrowth(*info, AA, perm_c, L, U); + } + return; + } + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = cPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = clangs(norm, AA); + cgscon(norm, L, U, anorm, rcond, stat, info); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Scale the right hand side if equilibration was performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], R[i]); + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], C[i]); + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + cgstrs (trant, L, U, perm_c, perm_r, X, stat, info); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Use iterative refinement to improve the computed solution and compute + error bounds and backward error estimates for it. */ + t0 = SuperLU_timer_(); + if ( options->IterRefine != NOREFINE ) { + cgsrfs(trant, AA, L, U, perm_c, perm_r, equed, R, C, B, + X, ferr, berr, stat, info); + } else { + for (j = 0; j < nrhs; ++j) ferr[j] = berr[j] = 1.0; + } + utime[REFINE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], C[i]); + } + } else if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], R[i]); + } + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < slamch_("E") ) *info = A->ncol + 1; + } + + if ( nofact ) { + cQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c.bak new file mode 100644 index 0000000..428ecb0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgssvx.c.bak @@ -0,0 +1,619 @@ + +/*! @file cgssvx.c + * \brief Solves the system of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + * the LU factorization from cgstrf(). Error bounds on the solution and
    + * a condition estimate are also provided. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *      1.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A is
    + *           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *           = TRANS or CONJ).
    + *
    + *      1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *           matrix that usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the matrix A (after equilibration if options->Equil = YES)
    + *           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *      1.4. Compute the reciprocal pivot growth factor.
    + *
    + *      1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form of 
    + *           A is used to estimate the condition number of the matrix A. If
    + *           the reciprocal of the condition number is less than machine
    + *           precision, info = A->ncol+1 is returned as a warning, but the
    + *           routine still goes on to solve for X and computes error bounds
    + *           as described below.
    + *
    + *      1.6. The system of equations is solved for X using the factored form
    + *           of A.
    + *
    + *      1.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      1.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *      to the transpose of A:
    + *
    + *      2.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A' is
    + *           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    + *           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *      2.2. Permute columns of transpose(A) (rows of A), 
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    + *           usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the transpose(A) (after equilibration if 
    + *           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *           permutation Pr determined by partial pivoting.
    + *
    + *      2.4. Compute the reciprocal pivot growth factor.
    + *
    + *      2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form 
    + *           of transpose(A) is used to estimate the condition number of the
    + *           matrix A. If the reciprocal of the condition number
    + *           is less than machine precision, info = A->nrow+1 is returned as
    + *           a warning, but the routine still goes on to solve for X and
    + *           computes error bounds as described below.
    + *
    + *      2.6. The system of equations is solved for X using the factored form
    + *           of transpose(A).
    + *
    + *      2.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      2.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input/output) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + *         On entry, If options->Fact = FACTORED and equed is not 'N', 
    + *         then A must have been equilibrated by the scaling factors in
    + *         R and/or C.  
    + *         On exit, A is not modified if options->Equil = NO, or if 
    + *         options->Equil = YES but equed = 'N' on exit.
    + *         Otherwise, if options->Equil = YES and equed is not 'N',
    + *         A is scaled as follows:
    + *         If A->Stype = SLU_NC:
    + *           equed = 'R':  A := diag(R) * A
    + *           equed = 'C':  A := A * diag(C)
    + *           equed = 'B':  A := diag(R) * A * diag(C).
    + *         If A->Stype = SLU_NR:
    + *           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *         which defines the permutation matrix Pc; perm_c[i] = j means
    + *         column i of A is in position j in A*Pc.
    + *         On exit, perm_c may be overwritten by the product of the input
    + *         perm_c and a permutation that postorders the elimination tree
    + *         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *         is already in postorder.
    + *
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *         will try to use the input perm_r, unless a certain threshold
    + *         criterion is violated. In that case, perm_r is overwritten by a
    + *         new permutation determined by partial pivoting or diagonal
    + *         threshold pivoting.
    + *         Otherwise, perm_r is output argument.
    + * 
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *         Elimination tree of Pc'*A'*A*Pc.
    + *         If options->Fact != FACTORED and options->Fact != DOFACT,
    + *         etree is an input argument, otherwise it is an output argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *         Specifies the form of equilibration that was done.
    + *         = 'N': No equilibration.
    + *         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *         = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                by diag(R)*A*diag(C).
    + *         If options->Fact = FACTORED, equed is an input argument,
    + *         otherwise it is an output argument.
    + *
    + * R       (input/output) float*, dimension (A->nrow)
    + *         The row scale factors for A or transpose(A).
    + *         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *         If equed = 'N' or 'C', R is not accessed.
    + *         If options->Fact = FACTORED, R is an input argument,
    + *             otherwise, R is output.
    + *         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *             of R must be positive.
    + * 
    + * C       (input/output) float*, dimension (A->ncol)
    + *         The column scale factors for A or transpose(A).
    + *         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *         If equed = 'N' or 'R', C is not accessed.
    + *         If options->Fact = FACTORED, C is an input argument,
    + *             otherwise, C is output.
    + *         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *             of C must be positive.
    + *         
    + * L       (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *         User supplied workspace, should be large enough
    + *         to hold data structures for factors L and U.
    + *         On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               mem_usage->total_needed; no other side effects.
    + *
    + *         See argument 'mem_usage' for memory usage statistics.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         If B->ncol = 0, only LU decomposition is performed, the triangular
    + *                         solve is skipped.
    + *         On exit,
    + *            if equed = 'N', B is not modified; otherwise
    + *            if A->Stype = SLU_NC:
    + *               if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *                  B is overwritten by diag(R)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *                  B is overwritten by diag(C)*B;
    + *            if A->Stype = SLU_NR:
    + *               if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *                  B is overwritten by diag(C)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *                  B is overwritten by diag(R)*B.
    + *
    + * X       (output) SuperMatrix*
    + *         X has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE. 
    + *         If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *         to the original system of equations. Note that A and B are modified
    + *         on exit if equed is not 'N', and the solution to the equilibrated
    + *         system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *         and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) float*
    + *         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *         The infinity norm is used. If recip_pivot_growth is much less
    + *         than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) float*
    + *         The estimate of the reciprocal condition number of the matrix A
    + *         after equilibration (if done). If rcond is less than the machine
    + *         precision (in particular, if rcond = 0), the matrix is singular
    + *         to working precision. This condition is indicated by a return
    + *         code of info > 0.
    + *
    + * FERR    (output) float*, dimension (B->ncol)   
    + *         The estimated forward error bound for each solution vector   
    + *         X(j) (the j-th column of the solution matrix X).   
    + *         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *         is an estimated upper bound for the magnitude of the largest 
    + *         element in (X(j) - XTRUE) divided by the magnitude of the   
    + *         largest element in X(j).  The estimate is as reliable as   
    + *         the estimate for RCOND, and is almost always a slight   
    + *         overestimate of the true error.
    + *         If options->IterRefine = NOREFINE, ferr = 1.0.
    + *
    + * BERR    (output) float*, dimension (B->ncol)
    + *         The componentwise relative backward error of each solution   
    + *         vector X(j) (i.e., the smallest relative change in   
    + *         any element of A or B that makes X(j) an exact solution).
    + *         If options->IterRefine = NOREFINE, berr = 1.0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *         Record the memory usage statistics, consisting of following fields:
    + *         - for_lu (float)
    + *           The amount of space used in bytes for L\U data structures.
    + *         - total_needed (float)
    + *           The amount of space needed in bytes to perform factorization.
    + *         - expansions (int)
    + *           The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *         = 0: successful exit   
    + *         < 0: if info = -i, the i-th argument had an illegal value   
    + *         > 0: if info = i, and i is   
    + *              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    + *                    been completed, but the factor U is exactly   
    + *                    singular, so the solution and error bounds   
    + *                    could not be computed.   
    + *              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *                    precision, meaning that the matrix is singular to
    + *                    working precision. Nevertheless, the solution and
    + *                    error bounds are computed because there are a number
    + *                    of situations where the computed solution can be more
    + *                    accurate than the value of RCOND would suggest.   
    + *              > A->ncol+1: number of bytes allocated when memory allocation
    + *                    failure occurred, plus A->ncol.
    + * 
    + */ + +void +cgssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, float *R, float *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, + float *rcond, float *ferr, float *berr, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info ) +{ + + + DNformat *Bstore, *Xstore; + complex *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec; + trans_t trant; + char norm[1]; + int i, j, info1; + float amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + float diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + /* External functions */ + extern float clangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = slamch_("Safe minimum"); + bignum = 1. / smlnum; + } + +#if 0 +printf("dgssvx: Fact=%4d, Trans=%4d, equed=%c\n", + options->Fact, options->Trans, *equed); +#endif + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_C || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_C || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("cgssvx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + cCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact && equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + cgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + claqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Scale the right hand side if equilibration was performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], R[i]); + } + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], C[i]); + } + } + } + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + +/* printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4)); + fflush(stdout); */ + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + cgstrf(options, &AC, relax, panel_size, etree, + work, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) { + if ( *info <= A->ncol ) { + /* Compute the reciprocal pivot growth factor of the leading + rank-deficient *info columns of A. */ + *recip_pivot_growth = cPivotGrowth(*info, AA, perm_c, L, U); + } + return; + } + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = cPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = clangs(norm, AA); + cgscon(norm, L, U, anorm, rcond, stat, info); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + cgstrs (trant, L, U, perm_c, perm_r, X, stat, info); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Use iterative refinement to improve the computed solution and compute + error bounds and backward error estimates for it. */ + t0 = SuperLU_timer_(); + if ( options->IterRefine != NOREFINE ) { + cgsrfs(trant, AA, L, U, perm_c, perm_r, equed, R, C, B, + X, ferr, berr, stat, info); + } else { + for (j = 0; j < nrhs; ++j) ferr[j] = berr[j] = 1.0; + } + utime[REFINE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], C[i]); + } + } + } else if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + cs_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], R[i]); + } + } + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < slamch_("E") ) *info = A->ncol + 1; + } + + if ( nofact ) { + cQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgstrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgstrf.c new file mode 100644 index 0000000..d3c23da --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgstrf.c @@ -0,0 +1,436 @@ + +/*! @file cgstrf.c + * \brief Computes an LU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSTRF computes an LU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = SLU_NCP; Dtype = SLU_C; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *          To control degree of relaxing supernodes. If the number
    + *          of nodes (columns) in a subtree of the elimination tree is less
    + *          than relax, this subtree is considered as one supernode,
    + *          regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *          A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *          Elimination tree of A'*A.
    + *          Note: etree is a vector of parent pointers for a forest whose
    + *          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *          On input, the columns of A should be permuted so that the
    + *          etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *          User-supplied work space and space for the output data structures.
    + *          Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the 
    + *          permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *          in position j in A*Pc.
    + *          When searching for diagonal, perm_c[*] is applied to the
    + *          row subscripts of A, so that diagonal threshold pivoting
    + *          can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *          Row permutation vector which defines the permutation matrix Pr,
    + *          perm_r[i] = j means row i of A is in position j in Pr*A.
    + *          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *             will try to use the input perm_r, unless a certain threshold
    + *             criterion is violated. In that case, perm_r is overwritten by
    + *             a new permutation determined by partial pivoting or diagonal
    + *             threshold pivoting.
    + *          Otherwise, perm_r is output argument;
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = SLU_NC, 
    + *          Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *          = 0: successful exit
    + *          < 0: if info = -i, the i-th argument had an illegal value
    + *          > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                and division by zero will occur if it is used to solve a
    + *                system of equations.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol. If lwork = -1, it is
    + *                the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays: 
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   xprune[0:n-1]: xprune[*] points to locations in subscript 
    + *	vector lsub[*]. For column i, xprune[i] denotes the point where 
    + *	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    + *	to be traversed for symbolic factorization.
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been 
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    + *	      see cpanel_dfs.c; marker2 is used for inner-factorization,
    + *            see ccolumn_dfs.c.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *      Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the 
    + *	last column of a supernode.
    + *      The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    + *	supernodal representative r, repfnz[r] is the location of the first 
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel. 
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    + *      the panel diagonal. These are filled in during cpanel_dfs(), and are
    + *      used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *	    	   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_cdefs.h.
    + * 
    + */ + +void +cgstrf (superlu_options_t *options, SuperMatrix *A, + int relax, int panel_size, int *etree, void *work, int lwork, + int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, + SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *iwork; + complex *cwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *xprune; + int *marker; + complex *dense, *tempv; + int *relax_end; + complex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float fill_ratio = sp_ienv(6); /* estimated fill ratio */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = cLUMemInit(fact, work, lwork, m, n, Astore->nnz, + panel_size, fill_ratio, L, U, &Glu, &iwork, &cwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &xprune, &marker); + cSetRWork(m, panel_size, cwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) { + heap_relax_snode(n, etree, relax, marker, relax_end); + } else { + relax_snode(n, etree, relax, marker, relax_end); + } + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = csnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + xprune, marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ( (*info = cLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu)) ) + return; + } + + for (icol = jcol; icol<= kcol; icol++) { + xusub[icol+1] = nextu; + + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) + dense[asub[k]] = a[k]; + + /* Numeric update within the snode */ + csnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if ( (*info = cpivotL(icol, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + +#ifdef DEBUG + cprint_lu_col("[1]: ", icol, pivrow, xprune, &Glu); +#endif + + } + + jcol = icol; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + cpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, panel_lsub, segrep, repfnz, xprune, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + cpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for ( jj = jcol; jj < jcol + panel_size; jj++) { + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + if ((*info = ccolumn_dfs(m, jj, perm_r, &nseg, &panel_lsub[k], + segrep, &repfnz[k], xprune, marker, + parent, xplore, &Glu)) != 0) return; + + /* Numeric updates */ + if ((*info = ccolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Copy the U-segments to ucol[*] */ + if ((*info = ccopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], &Glu)) != 0) + return; + + if ( (*info = cpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + + /* Prune columns (0:jj-1) using column jj */ + cpruneL(jj, perm_r, pivrow, nseg, segrep, + &repfnz[k], xprune, &Glu); + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + +#ifdef DEBUG + cprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); +#endif + + } + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + countnz(min_mn, xprune, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + cLUWorkFree(iwork, cwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + cCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_C, SLU_TRLU); + cCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_C, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cgstrs.c b/thirdparty/superlu/SuperLU_4.1/SRC/cgstrs.c new file mode 100644 index 0000000..d7f5a3f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cgstrs.c @@ -0,0 +1,350 @@ + +/*! @file cgstrs.c + * \brief Solves a system using LU factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_cdefs.h" + + +/* + * Function prototypes + */ +void cusolve(int, int, complex*, complex*); +void clsolve(int, int, complex*, complex*); +void cmatvec(int, int, int, complex*, complex*, complex*); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * CGSTRS solves a system of linear equations A*X=B or A'*X=B
    + * with A sparse and B dense, using the LU factorization computed by
    + * CGSTRF.
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *
    + * L       (input) SuperMatrix*
    + *         The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *         cgstrf(). Use compressed row subscripts storage for supernodes,
    + *         i.e., L has types: Stype = SLU_SC, Dtype = SLU_C, Mtype = SLU_TRLU.
    + *
    + * U       (input) SuperMatrix*
    + *         The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *         cgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_C, Mtype = SLU_TRU.
    + *
    + * perm_c  (input) int*, dimension (L->ncol)
    + *	   Column permutation vector, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + *
    + * perm_r  (input) int*, dimension (L->nrow)
    + *         Row permutation vector, which defines the permutation matrix Pr; 
    + *         perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_C, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + * 	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + * 
    + */ + +void +cgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, SuperMatrix *B, + SuperLUStat_t *stat, int *info) +{ + +#ifdef _CRAY + _fcd ftcs1, ftcs2, ftcs3, ftcs4; +#endif + int incx = 1, incy = 1; +#ifdef USE_VENDOR_BLAS + complex alpha = {1.0, 0.0}, beta = {1.0, 0.0}; + complex *work_col; +#endif + complex temp_comp; + DNformat *Bstore; + complex *Bmat; + SCformat *Lstore; + NCformat *Ustore; + complex *Lval, *Uval; + int fsupc, nrow, nsupr, nsupc, luptr, istart, irow; + int i, j, k, iptr, jcol, n, ldb, nrhs; + complex *work, *rhs_work, *soln; + flops_t solve_ops; + void cprint_soln(); + + /* Test input parameters ... */ + *info = 0; + Bstore = B->Store; + ldb = Bstore->lda; + nrhs = B->ncol; + if ( trans != NOTRANS && trans != TRANS && trans != CONJ ) *info = -1; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_C || L->Mtype != SLU_TRLU ) + *info = -2; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_C || U->Mtype != SLU_TRU ) + *info = -3; + else if ( ldb < SUPERLU_MAX(0, L->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_C || B->Mtype != SLU_GE ) + *info = -6; + if ( *info ) { + i = -(*info); + xerbla_("cgstrs", &i); + return; + } + + n = L->nrow; + work = complexCalloc(n * nrhs); + if ( !work ) ABORT("Malloc fails for local work[]."); + soln = complexMalloc(n); + if ( !soln ) ABORT("Malloc fails for local soln[]."); + + Bmat = Bstore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( trans == NOTRANS ) { + /* Permute right hand sides to form Pr*B */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_r[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + /* Forward solve PLy=Pb. */ + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + nrow = nsupr - nsupc; + + solve_ops += 4 * nsupc * (nsupc - 1) * nrhs; + solve_ops += 8 * nrow * nsupc * nrhs; + + if ( nsupc == 1 ) { + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + luptr = L_NZ_START(fsupc); + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); iptr++){ + irow = L_SUB(iptr); + ++luptr; + cc_mult(&temp_comp, &rhs_work[fsupc], &Lval[luptr]); + c_sub(&rhs_work[irow], &rhs_work[irow], &temp_comp); + } + } + } else { + luptr = L_NZ_START(fsupc); +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("N", strlen("N")); + ftcs3 = _cptofcd("U", strlen("U")); + CTRSM( ftcs1, ftcs1, ftcs2, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + CGEMM( ftcs2, ftcs2, &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#else + ctrsm_("L", "L", "N", "U", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + cgemm_( "N", "N", &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#endif + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + work_col = &work[j*n]; + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + c_sub(&rhs_work[irow], &rhs_work[irow], &work_col[i]); + work_col[i].r = 0.0; + work_col[i].i = 0.0; + iptr++; + } + } +#else + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + clsolve (nsupr, nsupc, &Lval[luptr], &rhs_work[fsupc]); + cmatvec (nsupr, nrow, nsupc, &Lval[luptr+nsupc], + &rhs_work[fsupc], &work[0] ); + + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + c_sub(&rhs_work[irow], &rhs_work[irow], &work[i]); + work[i].r = 0.; + work[i].i = 0.; + iptr++; + } + } +#endif + } /* else ... */ + } /* for L-solve */ + +#ifdef DEBUG + printf("After L-solve: y=\n"); + cprint_soln(n, nrhs, Bmat); +#endif + + /* + * Back solve Ux=y. + */ + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 4 * nsupc * (nsupc + 1) * nrhs; + + if ( nsupc == 1 ) { + rhs_work = &Bmat[0]; + for (j = 0; j < nrhs; j++) { + c_div(&rhs_work[fsupc], &rhs_work[fsupc], &Lval[luptr]); + rhs_work += ldb; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("U", strlen("U")); + ftcs3 = _cptofcd("N", strlen("N")); + CTRSM( ftcs1, ftcs2, ftcs3, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#else + ctrsm_("L", "U", "N", "N", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#endif +#else + for (j = 0; j < nrhs; j++) + cusolve ( nsupr, nsupc, &Lval[luptr], &Bmat[fsupc+j*ldb] ); +#endif + } + + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (jcol = fsupc; jcol < fsupc + nsupc; jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++ ){ + irow = U_SUB(i); + cc_mult(&temp_comp, &rhs_work[jcol], &Uval[i]); + c_sub(&rhs_work[irow], &rhs_work[irow], &temp_comp); + } + } + } + + } /* for U-solve */ + +#ifdef DEBUG + printf("After U-solve: x=\n"); + cprint_soln(n, nrhs, Bmat); +#endif + + /* Compute the final solution X := Pc*X. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_c[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = solve_ops; + + } else { /* Solve A'*X=B or CONJ(A)*X=B */ + /* Permute right hand sides to form Pc'*B. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_c[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = 0; + if (trans == TRANS) { + for (k = 0; k < nrhs; ++k) { + /* Multiply by inv(U'). */ + sp_ctrsv("U", "T", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by inv(L'). */ + sp_ctrsv("L", "T", "U", L, U, &Bmat[k*ldb], stat, info); + } + } else { /* trans == CONJ */ + for (k = 0; k < nrhs; ++k) { + /* Multiply by conj(inv(U')). */ + sp_ctrsv("U", "C", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by conj(inv(L')). */ + sp_ctrsv("L", "C", "U", L, U, &Bmat[k*ldb], stat, info); + } + } + /* Compute the final solution X := Pr'*X (=inv(Pr)*X) */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_r[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + } + + SUPERLU_FREE(work); + SUPERLU_FREE(soln); +} + +/* + * Diagnostic print of the solution vector + */ +void +cprint_soln(int n, int nrhs, complex *soln) +{ + int i; + + for (i = 0; i < n; i++) + printf("\t%d: %.4f\n", i, soln[i]); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c b/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c new file mode 100644 index 0000000..d206d5a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c @@ -0,0 +1,221 @@ + +/*! @file clacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" +#include "slu_scomplex.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   CLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) COMPLEX PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) COMPLEX PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *          where A' is the conjugate transpose of A,
    + *         and CLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *
    + *   EST    (output) FLOAT PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to CLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from CLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +clacon_(int *n, complex *v, complex *x, float *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + + /* System generated locals */ + float d__1; + + /* Local variables */ + static int iter; + static int jump, jlast; + static float altsgn, estold; + static int i, j; + float temp; + float safmin; + extern float slamch_(char *); + extern int icmax1_(int *, complex *, int *); + extern double scsum1_(int *, complex *, int *); + + safmin = slamch_("Safe minimum"); + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i].r = 1. / (float) (*n); + x[i].i = 0.; + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = c_abs(&v[0]); + /* ... QUIT */ + goto L150; + } + *est = scsum1_(n, x, &c__1); + + for (i = 0; i < *n; ++i) { + d__1 = c_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: + j = icmax1_(n, &x[0], &c__1); + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + CCOPY(n, x, &c__1, v, &c__1); +#else + ccopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; + *est = scsum1_(n, v, &c__1); + + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + d__1 = c_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; + j = icmax1_(n, &x[0], &c__1); + --j; + if (x[jlast].r != (d__1 = x[j].r, fabs(d__1)) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1].r = altsgn * ((float)(i - 1) / (float)(*n - 1) + 1.); + x[i-1].i = 0.; + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: + temp = scsum1_(n, x, &c__1) / (float)(*n * 3) * 2.; + if (temp > *est) { +#ifdef _CRAY + CCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + ccopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* clacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c.bak new file mode 100644 index 0000000..3b826f5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/clacon.c.bak @@ -0,0 +1,221 @@ + +/*! @file clacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" +#include "slu_scomplex.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   CLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) COMPLEX PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) COMPLEX PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *          where A' is the conjugate transpose of A,
    + *         and CLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *
    + *   EST    (output) FLOAT PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to CLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from CLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +clacon_(int *n, complex *v, complex *x, float *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + + /* System generated locals */ + float d__1; + + /* Local variables */ + static int iter; + static int jump, jlast; + static float altsgn, estold; + static int i, j; + float temp; + float safmin; + extern double slamch_(char *); + extern int icmax1_(int *, complex *, int *); + extern double scsum1_(int *, complex *, int *); + + safmin = slamch_("Safe minimum"); + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i].r = 1. / (float) (*n); + x[i].i = 0.; + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = c_abs(&v[0]); + /* ... QUIT */ + goto L150; + } + *est = scsum1_(n, x, &c__1); + + for (i = 0; i < *n; ++i) { + d__1 = c_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: + j = icmax1_(n, &x[0], &c__1); + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + CCOPY(n, x, &c__1, v, &c__1); +#else + ccopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; + *est = scsum1_(n, v, &c__1); + + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + d__1 = c_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; + j = icmax1_(n, &x[0], &c__1); + --j; + if (x[jlast].r != (d__1 = x[j].r, fabs(d__1)) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1].r = altsgn * ((float)(i - 1) / (float)(*n - 1) + 1.); + x[i-1].i = 0.; + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: + temp = scsum1_(n, x, &c__1) / (float)(*n * 3) * 2.; + if (temp > *est) { +#ifdef _CRAY + CCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + ccopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* clacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/clangs.c b/thirdparty/superlu/SuperLU_4.1/SRC/clangs.c new file mode 100644 index 0000000..f6d8506 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/clangs.c @@ -0,0 +1,119 @@ + +/*! @file clangs.c + * \brief Returns the value of the one norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from lapack routine CLANGE 
    + * 
    + */ +/* + * File name: clangs.c + * History: Modified from lapack routine CLANGE + */ +#include +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   CLANGS returns the value of the one norm, or the Frobenius norm, or 
    + *   the infinity norm, or the element of largest absolute value of a 
    + *   real matrix A.   
    + *
    + *   Description   
    + *   ===========   
    + *
    + *   CLANGE returns the value   
    + *
    + *      CLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    + *               (   
    + *               ( norm1(A),         NORM = '1', 'O' or 'o'   
    + *               (   
    + *               ( normI(A),         NORM = 'I' or 'i'   
    + *               (   
    + *               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'   
    + *
    + *   where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    + *   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    + *   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    + *   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.   
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   NORM    (input) CHARACTER*1   
    + *           Specifies the value to be returned in CLANGE as described above.   
    + *   A       (input) SuperMatrix*
    + *           The M by N sparse matrix A. 
    + *
    + *  =====================================================================
    + * 
    + */ + +float clangs(char *norm, SuperMatrix *A) +{ + + /* Local variables */ + NCformat *Astore; + complex *Aval; + int i, j, irow; + float value, sum; + float *rwork; + + Astore = A->Store; + Aval = Astore->nzval; + + if ( SUPERLU_MIN(A->nrow, A->ncol) == 0) { + value = 0.; + + } else if (lsame_(norm, "M")) { + /* Find max(abs(A(i,j))). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + value = SUPERLU_MAX( value, c_abs( &Aval[i]) ); + + } else if (lsame_(norm, "O") || *(unsigned char *)norm == '1') { + /* Find norm1(A). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) { + sum = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + sum += c_abs( &Aval[i] ); + value = SUPERLU_MAX(value,sum); + } + + } else if (lsame_(norm, "I")) { + /* Find normI(A). */ + if ( !(rwork = (float *) SUPERLU_MALLOC(A->nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for rwork."); + for (i = 0; i < A->nrow; ++i) rwork[i] = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) { + irow = Astore->rowind[i]; + rwork[irow] += c_abs( &Aval[i] ); + } + value = 0.; + for (i = 0; i < A->nrow; ++i) + value = SUPERLU_MAX(value, rwork[i]); + + SUPERLU_FREE (rwork); + + } else if (lsame_(norm, "F") || lsame_(norm, "E")) { + /* Find normF(A). */ + ABORT("Not implemented."); + } else + ABORT("Illegal norm specified."); + + return (value); + +} /* clangs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/claqgs.c b/thirdparty/superlu/SuperLU_4.1/SRC/claqgs.c new file mode 100644 index 0000000..8d469cf --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/claqgs.c @@ -0,0 +1,147 @@ + +/*! @file claqgs.c + * \brief Equlibrates a general sprase matrix + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Modified from LAPACK routine CLAQGE
    + * 
    + */ +/* + * File name: claqgs.c + * History: Modified from LAPACK routine CLAQGE + */ +#include +#include "slu_cdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   CLAQGS equilibrates a general sparse M by N matrix A using the row and   
    + *   scaling factors in the vectors R and C.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input/output) SuperMatrix*
    + *           On exit, the equilibrated matrix.  See EQUED for the form of 
    + *           the equilibrated matrix. The type of A can be:
    + *	    Stype = NC; Dtype = SLU_C; Mtype = GE.
    + *	    
    + *   R       (input) float*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *	    
    + *   C       (input) float*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *	    
    + *   ROWCND  (input) float
    + *           Ratio of the smallest R(i) to the largest R(i).
    + *	    
    + *   COLCND  (input) float
    + *           Ratio of the smallest C(i) to the largest C(i).
    + *	    
    + *   AMAX    (input) float
    + *           Absolute value of largest matrix entry.
    + *	    
    + *   EQUED   (output) char*
    + *           Specifies the form of equilibration that was done.   
    + *           = 'N':  No equilibration   
    + *           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    + *                   diag(R).   
    + *           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    + *                   by diag(C).   
    + *           = 'B':  Both row and column equilibration, i.e., A has been
    + *                   replaced by diag(R) * A * diag(C).   
    + *
    + *   Internal Parameters   
    + *   ===================   
    + *
    + *   THRESH is a threshold value used to decide if row or column scaling   
    + *   should be done based on the ratio of the row or column scaling   
    + *   factors.  If ROWCND < THRESH, row scaling is done, and if   
    + *   COLCND < THRESH, column scaling is done.   
    + *
    + *   LARGE and SMALL are threshold values used to decide if row scaling   
    + *   should be done based on the absolute size of the largest matrix   
    + *   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.   
    + *
    + *   ===================================================================== 
    + * 
    + */ + +void +claqgs(SuperMatrix *A, float *r, float *c, + float rowcnd, float colcnd, float amax, char *equed) +{ + + +#define THRESH (0.1) + + /* Local variables */ + NCformat *Astore; + complex *Aval; + int i, j, irow; + float large, small, cj; + float temp; + + + /* Quick return if possible */ + if (A->nrow <= 0 || A->ncol <= 0) { + *(unsigned char *)equed = 'N'; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Initialize LARGE and SMALL. */ + small = slamch_("Safe minimum") / slamch_("Precision"); + large = 1. / small; + + if (rowcnd >= THRESH && amax >= small && amax <= large) { + if (colcnd >= THRESH) + *(unsigned char *)equed = 'N'; + else { + /* Column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + cs_mult(&Aval[i], &Aval[i], cj); + } + } + *(unsigned char *)equed = 'C'; + } + } else if (colcnd >= THRESH) { + /* Row scaling, no column scaling */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + cs_mult(&Aval[i], &Aval[i], r[irow]); + } + *(unsigned char *)equed = 'R'; + } else { + /* Row and column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + temp = cj * r[irow]; + cs_mult(&Aval[i], &Aval[i], temp); + } + } + *(unsigned char *)equed = 'B'; + } + + return; + +} /* claqgs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cldperm.c b/thirdparty/superlu/SuperLU_4.1/SRC/cldperm.c new file mode 100644 index 0000000..bc4cc54 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cldperm.c @@ -0,0 +1,168 @@ + +/*! @file + * \brief Finds a row permutation so that the matrix has large entries on the diagonal + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +extern int_t mc64id_(int_t*); +extern int_t mc64ad_(int_t*, int_t*, int_t*, int_t [], int_t [], double [], + int_t*, int_t [], int_t*, int_t[], int_t*, double [], + int_t [], int_t []); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   CLDPERM finds a row permutation so that the matrix has large
    + *   entries on the diagonal.
    + *
    + * Arguments
    + * =========
    + *
    + * job    (input) int
    + *        Control the action. Possible values for JOB are:
    + *        = 1 : Compute a row permutation of the matrix so that the
    + *              permuted matrix has as many entries on its diagonal as
    + *              possible. The values on the diagonal are of arbitrary size.
    + *              HSL subroutine MC21A/AD is used for this.
    + *        = 2 : Compute a row permutation of the matrix so that the smallest 
    + *              value on the diagonal of the permuted matrix is maximized.
    + *        = 3 : Compute a row permutation of the matrix so that the smallest
    + *              value on the diagonal of the permuted matrix is maximized.
    + *              The algorithm differs from the one used for JOB = 2 and may
    + *              have quite a different performance.
    + *        = 4 : Compute a row permutation of the matrix so that the sum
    + *              of the diagonal entries of the permuted matrix is maximized.
    + *        = 5 : Compute a row permutation of the matrix so that the product
    + *              of the diagonal entries of the permuted matrix is maximized
    + *              and vectors to scale the matrix so that the nonzero diagonal 
    + *              entries of the permuted matrix are one in absolute value and 
    + *              all the off-diagonal entries are less than or equal to one in 
    + *              absolute value.
    + *        Restriction: 1 <= JOB <= 5.
    + *
    + * n      (input) int
    + *        The order of the matrix.
    + *
    + * nnz    (input) int
    + *        The number of nonzeros in the matrix.
    + *
    + * adjncy (input) int*, of size nnz
    + *        The adjacency structure of the matrix, which contains the row
    + *        indices of the nonzeros.
    + *
    + * colptr (input) int*, of size n+1
    + *        The pointers to the beginning of each column in ADJNCY.
    + *
    + * nzval  (input) complex*, of size nnz
    + *        The nonzero values of the matrix. nzval[k] is the value of
    + *        the entry corresponding to adjncy[k].
    + *        It is not used if job = 1.
    + *
    + * perm   (output) int*, of size n
    + *        The permutation vector. perm[i] = j means row i in the
    + *        original matrix is in row j of the permuted matrix.
    + *
    + * u      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the row scaling factors. 
    + *
    + * v      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the column scaling factors. 
    + *        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + * 
    + */ + +int +cldperm(int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], + complex nzval[], int_t *perm, float u[], float v[]) +{ + int_t i, liw, ldw, num; + int_t *iw, icntl[10], info[10]; + double *dw; + double *nzval_d = (double *) SUPERLU_MALLOC(nnz * sizeof(double)); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Enter cldperm()"); +#endif + liw = 5*n; + if ( job == 3 ) liw = 10*n + nnz; + if ( !(iw = intMalloc(liw)) ) ABORT("Malloc fails for iw[]"); + ldw = 3*n + nnz; + if ( !(dw = (double*) SUPERLU_MALLOC(ldw * sizeof(double))) ) + ABORT("Malloc fails for dw[]"); + + /* Increment one to get 1-based indexing. */ + for (i = 0; i <= n; ++i) ++colptr[i]; + for (i = 0; i < nnz; ++i) ++adjncy[i]; +#if ( DEBUGlevel>=2 ) + printf("LDPERM(): n %d, nnz %d\n", n, nnz); + slu_PrintInt10("colptr", n+1, colptr); + slu_PrintInt10("adjncy", nnz, adjncy); +#endif + + /* + * NOTE: + * ===== + * + * MC64AD assumes that column permutation vector is defined as: + * perm(i) = j means column i of permuted A is in column j of original A. + * + * Since a symmetric permutation preserves the diagonal entries. Then + * by the following relation: + * P'(A*P')P = P'A + * we can apply inverse(perm) to rows of A to get large diagonal entries. + * But, since 'perm' defined in MC64AD happens to be the reverse of + * SuperLU's definition of permutation vector, therefore, it is already + * an inverse for our purpose. We will thus use it directly. + * + */ + mc64id_(icntl); +#if 0 + /* Suppress error and warning messages. */ + icntl[0] = -1; + icntl[1] = -1; +#endif + + for (i = 0; i < nnz; ++i) nzval_d[i] = c_abs1(&nzval[i]); + mc64ad_(&job, &n, &nnz, colptr, adjncy, nzval_d, &num, perm, + &liw, iw, &ldw, dw, icntl, info); + +#if ( DEBUGlevel>=2 ) + slu_PrintInt10("perm", n, perm); + printf(".. After MC64AD info %d\tsize of matching %d\n", info[0], num); +#endif + if ( info[0] == 1 ) { /* Structurally singular */ + printf(".. The last %d permutations:\n", n-num); + slu_PrintInt10("perm", n-num, &perm[num]); + } + + /* Restore to 0-based indexing. */ + for (i = 0; i <= n; ++i) --colptr[i]; + for (i = 0; i < nnz; ++i) --adjncy[i]; + for (i = 0; i < n; ++i) --perm[i]; + + if ( job == 5 ) + for (i = 0; i < n; ++i) { + u[i] = dw[i]; + v[i] = dw[n+i]; + } + + SUPERLU_FREE(iw); + SUPERLU_FREE(dw); + SUPERLU_FREE(nzval_d); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Exit cldperm()"); +#endif + + return info[0]; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cmemory.c b/thirdparty/superlu/SuperLU_4.1/SRC/cmemory.c new file mode 100644 index 0000000..ef385c2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cmemory.c @@ -0,0 +1,701 @@ + +/*! @file cmemory.c + * \brief Memory details + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ +#include "slu_cdefs.h" + + +/* Internal prototypes */ +void *cexpand (int *, MemType,int, int, GlobalLU_t *); +int cLUWorkInit (int, int, int, int **, complex **, GlobalLU_t *); +void copy_mem_complex (int, void *, void *); +void cStackCompress (GlobalLU_t *); +void cSetupSpace (void *, int, GlobalLU_t *); +void *cuser_malloc (int, int, GlobalLU_t *); +void cuser_free (int, int, GlobalLU_t *); + +/* External prototypes (in memory.c - prec-independent) */ +extern void copy_mem_int (int, void *, void *); +extern void user_bcopy (char *, char *, int); + + +/* Macros to manipulate stack */ +#define StackFull(x) ( x + Glu->stack.used >= Glu->stack.size ) +#define NotDoubleAlign(addr) ( (long int)addr & 7 ) +#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) +#define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \ + (w + 1) * m * sizeof(complex) ) +#define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */ + + + + +/*! \brief Setup the memory model to be used for factorization. + * + * lwork = 0: use system malloc; + * lwork > 0: use user-supplied work[] space. + */ +void cSetupSpace(void *work, int lwork, GlobalLU_t *Glu) +{ + if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; /* malloc/free */ + } else if ( lwork > 0 ) { + Glu->MemModel = USER; /* user provided space */ + Glu->stack.used = 0; + Glu->stack.top1 = 0; + Glu->stack.top2 = (lwork/4)*4; /* must be word addressable */ + Glu->stack.size = Glu->stack.top2; + Glu->stack.array = (void *) work; + } +} + + + +void *cuser_malloc(int bytes, int which_end, GlobalLU_t *Glu) +{ + void *buf; + + if ( StackFull(bytes) ) return (NULL); + + if ( which_end == HEAD ) { + buf = (char*) Glu->stack.array + Glu->stack.top1; + Glu->stack.top1 += bytes; + } else { + Glu->stack.top2 -= bytes; + buf = (char*) Glu->stack.array + Glu->stack.top2; + } + + Glu->stack.used += bytes; + return buf; +} + + +void cuser_free(int bytes, int which_end, GlobalLU_t *Glu) +{ + if ( which_end == HEAD ) { + Glu->stack.top1 -= bytes; + } else { + Glu->stack.top2 += bytes; + } + Glu->stack.used -= bytes; +} + + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int cQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, iword, dword, panel_size = sp_ienv(1); + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(complex); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0*n + 3.0) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0 * panel_size + 4.0 + NO_MARKER) * n * iword + + (panel_size + 1.0) * n * dword ); + + return 0; +} /* cQuerySpace */ + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int ilu_cQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, panel_size = sp_ienv(1); + register float iword, dword; + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(double); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0f * n + 3.0f) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0f) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization. + ILU needs 5*n more integers than LU */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0f * panel_size + 9.0f + NO_MARKER) * n * iword + + (panel_size + 1.0f) * n * dword ); + + return 0; +} /* ilu_cQuerySpace */ + + +/*! \brief Allocate storage for the data structures common to all factor routines. + * + *
    + * For those unpredictable size, estimate as fill_ratio * nnz(A).
    + * Return value:
    + *     If lwork = -1, return the estimated amount of space required, plus n;
    + *     otherwise, return the amount of space actually allocated when
    + *     memory allocation failure occurred.
    + * 
    + */ +int +cLUMemInit(fact_t fact, void *work, int lwork, int m, int n, int annz, + int panel_size, float fill_ratio, SuperMatrix *L, SuperMatrix *U, + GlobalLU_t *Glu, int **iwork, complex **dwork) +{ + int info, iword, dword; + SCformat *Lstore; + NCformat *Ustore; + int *xsup, *supno; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + complex *ucol; + int *usub, *xusub; + int nzlmax, nzumax, nzlumax; + + iword = sizeof(int); + dword = sizeof(complex); + Glu->n = n; + Glu->num_expansions = 0; + + if ( !Glu->expanders ) + Glu->expanders = (ExpHeader*)SUPERLU_MALLOC( NO_MEMTYPE * + sizeof(ExpHeader) ); + if ( !Glu->expanders ) ABORT("SUPERLU_MALLOC fails for expanders"); + + if ( fact != SamePattern_SameRowPerm ) { + /* Guess for L\U factors */ + nzumax = nzlumax = fill_ratio * annz; + nzlmax = SUPERLU_MAX(1, fill_ratio/4.) * annz; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else { + cSetupSpace(work, lwork, Glu); + } + +#if ( PRNTlevel >= 1 ) + printf("cLUMemInit() called: fill_ratio %.0f, nzlmax %ld, nzumax %ld\n", + fill_ratio, nzlmax, nzumax); + fflush(stdout); +#endif + + /* Integer pointers for L\U factors */ + if ( Glu->MemModel == SYSTEM ) { + xsup = intMalloc(n+1); + supno = intMalloc(n+1); + xlsub = intMalloc(n+1); + xlusup = intMalloc(n+1); + xusub = intMalloc(n+1); + } else { + xsup = (int *)cuser_malloc((n+1) * iword, HEAD, Glu); + supno = (int *)cuser_malloc((n+1) * iword, HEAD, Glu); + xlsub = (int *)cuser_malloc((n+1) * iword, HEAD, Glu); + xlusup = (int *)cuser_malloc((n+1) * iword, HEAD, Glu); + xusub = (int *)cuser_malloc((n+1) * iword, HEAD, Glu); + } + + lusup = (complex *) cexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (complex *) cexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) cexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) cexpand( &nzumax, USUB, 0, 1, Glu ); + + while ( !lusup || !ucol || !lsub || !usub ) { + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE(lusup); + SUPERLU_FREE(ucol); + SUPERLU_FREE(lsub); + SUPERLU_FREE(usub); + } else { + cuser_free((nzlumax+nzumax)*dword+(nzlmax+nzumax)*iword, + HEAD, Glu); + } + nzlumax /= 2; + nzumax /= 2; + nzlmax /= 2; + if ( nzlumax < annz ) { + printf("Not enough memory to perform factorization.\n"); + return (cmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + } +#if ( PRNTlevel >= 1) + printf("cLUMemInit() reduce size: nzlmax %ld, nzumax %ld\n", + nzlmax, nzumax); + fflush(stdout); +#endif + lusup = (complex *) cexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (complex *) cexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) cexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) cexpand( &nzumax, USUB, 0, 1, Glu ); + } + + } else { + /* fact == SamePattern_SameRowPerm */ + Lstore = L->Store; + Ustore = U->Store; + xsup = Lstore->sup_to_col; + supno = Lstore->col_to_sup; + xlsub = Lstore->rowind_colptr; + xlusup = Lstore->nzval_colptr; + xusub = Ustore->colptr; + nzlmax = Glu->nzlmax; /* max from previous factorization */ + nzumax = Glu->nzumax; + nzlumax = Glu->nzlumax; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; + } else { + Glu->MemModel = USER; + Glu->stack.top2 = (lwork/4)*4; /* must be word-addressable */ + Glu->stack.size = Glu->stack.top2; + } + + lsub = Glu->expanders[LSUB].mem = Lstore->rowind; + lusup = Glu->expanders[LUSUP].mem = Lstore->nzval; + usub = Glu->expanders[USUB].mem = Ustore->rowind; + ucol = Glu->expanders[UCOL].mem = Ustore->nzval;; + Glu->expanders[LSUB].size = nzlmax; + Glu->expanders[LUSUP].size = nzlumax; + Glu->expanders[USUB].size = nzumax; + Glu->expanders[UCOL].size = nzumax; + } + + Glu->xsup = xsup; + Glu->supno = supno; + Glu->lsub = lsub; + Glu->xlsub = xlsub; + Glu->lusup = lusup; + Glu->xlusup = xlusup; + Glu->ucol = ucol; + Glu->usub = usub; + Glu->xusub = xusub; + Glu->nzlmax = nzlmax; + Glu->nzumax = nzumax; + Glu->nzlumax = nzlumax; + + info = cLUWorkInit(m, n, panel_size, iwork, dwork, Glu); + if ( info ) + return ( info + cmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + + ++Glu->num_expansions; + return 0; + +} /* cLUMemInit */ + +/*! \brief Allocate known working storage. Returns 0 if success, otherwise + returns the number of bytes allocated so far when failure occurred. */ +int +cLUWorkInit(int m, int n, int panel_size, int **iworkptr, + complex **dworkptr, GlobalLU_t *Glu) +{ + int isize, dsize, extra; + complex *old_ptr; + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + + isize = ( (2 * panel_size + 3 + NO_MARKER ) * m + n ) * sizeof(int); + dsize = (m * panel_size + + NUM_TEMPV(m,panel_size,maxsuper,rowblk)) * sizeof(complex); + + if ( Glu->MemModel == SYSTEM ) + *iworkptr = (int *) intCalloc(isize/sizeof(int)); + else + *iworkptr = (int *) cuser_malloc(isize, TAIL, Glu); + if ( ! *iworkptr ) { + fprintf(stderr, "cLUWorkInit: malloc fails for local iworkptr[]\n"); + return (isize + n); + } + + if ( Glu->MemModel == SYSTEM ) + *dworkptr = (complex *) SUPERLU_MALLOC(dsize); + else { + *dworkptr = (complex *) cuser_malloc(dsize, TAIL, Glu); + if ( NotDoubleAlign(*dworkptr) ) { + old_ptr = *dworkptr; + *dworkptr = (complex*) DoubleAlign(*dworkptr); + *dworkptr = (complex*) ((double*)*dworkptr - 1); + extra = (char*)old_ptr - (char*)*dworkptr; +#ifdef DEBUG + printf("cLUWorkInit: not aligned, extra %d\n", extra); +#endif + Glu->stack.top2 -= extra; + Glu->stack.used += extra; + } + } + if ( ! *dworkptr ) { + fprintf(stderr, "malloc fails for local dworkptr[]."); + return (isize + dsize + n); + } + + return 0; +} + + +/*! \brief Set up pointers for real working arrays. + */ +void +cSetRWork(int m, int panel_size, complex *dworkptr, + complex **dense, complex **tempv) +{ + complex zero = {0.0, 0.0}; + + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + *dense = dworkptr; + *tempv = *dense + panel_size*m; + cfill (*dense, m * panel_size, zero); + cfill (*tempv, NUM_TEMPV(m,panel_size,maxsuper,rowblk), zero); +} + +/*! \brief Free the working storage used by factor routines. + */ +void cLUWorkFree(int *iwork, complex *dwork, GlobalLU_t *Glu) +{ + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE (iwork); + SUPERLU_FREE (dwork); + } else { + Glu->stack.used -= (Glu->stack.size - Glu->stack.top2); + Glu->stack.top2 = Glu->stack.size; +/* cStackCompress(Glu); */ + } + + SUPERLU_FREE (Glu->expanders); + Glu->expanders = NULL; +} + +/*! \brief Expand the data structures for L and U during the factorization. + * + *
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +cLUMemXpand(int jcol, + int next, /* number of elements currently in the factors */ + MemType mem_type, /* which type of memory to expand */ + int *maxlen, /* modified - maximum length of a data structure */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + void *new_mem; + +#ifdef DEBUG + printf("cLUMemXpand(): jcol %d, next %d, maxlen %d, MemType %d\n", + jcol, next, *maxlen, mem_type); +#endif + + if (mem_type == USUB) + new_mem = cexpand(maxlen, mem_type, next, 1, Glu); + else + new_mem = cexpand(maxlen, mem_type, next, 0, Glu); + + if ( !new_mem ) { + int nzlmax = Glu->nzlmax; + int nzumax = Glu->nzumax; + int nzlumax = Glu->nzlumax; + fprintf(stderr, "Can't expand MemType %d: jcol %d\n", mem_type, jcol); + return (cmemory_usage(nzlmax, nzumax, nzlumax, Glu->n) + Glu->n); + } + + switch ( mem_type ) { + case LUSUP: + Glu->lusup = (complex *) new_mem; + Glu->nzlumax = *maxlen; + break; + case UCOL: + Glu->ucol = (complex *) new_mem; + Glu->nzumax = *maxlen; + break; + case LSUB: + Glu->lsub = (int *) new_mem; + Glu->nzlmax = *maxlen; + break; + case USUB: + Glu->usub = (int *) new_mem; + Glu->nzumax = *maxlen; + break; + } + + return 0; + +} + + + +void +copy_mem_complex(int howmany, void *old, void *new) +{ + register int i; + complex *dold = old; + complex *dnew = new; + for (i = 0; i < howmany; i++) dnew[i] = dold[i]; +} + +/*! \brief Expand the existing storage to accommodate more fill-ins. + */ +void +*cexpand ( + int *prev_len, /* length used from previous call */ + MemType type, /* which part of the memory to expand */ + int len_to_copy, /* size of the memory to be copied to new store */ + int keep_prev, /* = 1: use prev_len; + = 0: compute new_len to expand */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + float EXPAND = 1.5; + float alpha; + void *new_mem, *old_mem; + int new_len, tries, lword, extra, bytes_to_copy; + ExpHeader *expanders = Glu->expanders; /* Array of 4 types of memory */ + + alpha = EXPAND; + + if ( Glu->num_expansions == 0 || keep_prev ) { + /* First time allocate requested */ + new_len = *prev_len; + } else { + new_len = alpha * *prev_len; + } + + if ( type == LSUB || type == USUB ) lword = sizeof(int); + else lword = sizeof(complex); + + if ( Glu->MemModel == SYSTEM ) { + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + if ( Glu->num_expansions != 0 ) { + tries = 0; + if ( keep_prev ) { + if ( !new_mem ) return (NULL); + } else { + while ( !new_mem ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + } + } + if ( type == LSUB || type == USUB ) { + copy_mem_int(len_to_copy, expanders[type].mem, new_mem); + } else { + copy_mem_complex(len_to_copy, expanders[type].mem, new_mem); + } + SUPERLU_FREE (expanders[type].mem); + } + expanders[type].mem = (void *) new_mem; + + } else { /* MemModel == USER */ + if ( Glu->num_expansions == 0 ) { + new_mem = cuser_malloc(new_len * lword, HEAD, Glu); + if ( NotDoubleAlign(new_mem) && + (type == LUSUP || type == UCOL) ) { + old_mem = new_mem; + new_mem = (void *)DoubleAlign(new_mem); + extra = (char*)new_mem - (char*)old_mem; +#ifdef DEBUG + printf("expand(): not aligned, extra %d\n", extra); +#endif + Glu->stack.top1 += extra; + Glu->stack.used += extra; + } + expanders[type].mem = (void *) new_mem; + } else { + tries = 0; + extra = (new_len - *prev_len) * lword; + if ( keep_prev ) { + if ( StackFull(extra) ) return (NULL); + } else { + while ( StackFull(extra) ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + extra = (new_len - *prev_len) * lword; + } + } + + if ( type != USUB ) { + new_mem = (void*)((char*)expanders[type + 1].mem + extra); + bytes_to_copy = (char*)Glu->stack.array + Glu->stack.top1 + - (char*)expanders[type + 1].mem; + user_bcopy(expanders[type+1].mem, new_mem, bytes_to_copy); + + if ( type < USUB ) { + Glu->usub = expanders[USUB].mem = + (void*)((char*)expanders[USUB].mem + extra); + } + if ( type < LSUB ) { + Glu->lsub = expanders[LSUB].mem = + (void*)((char*)expanders[LSUB].mem + extra); + } + if ( type < UCOL ) { + Glu->ucol = expanders[UCOL].mem = + (void*)((char*)expanders[UCOL].mem + extra); + } + Glu->stack.top1 += extra; + Glu->stack.used += extra; + if ( type == UCOL ) { + Glu->stack.top1 += extra; /* Add same amount for USUB */ + Glu->stack.used += extra; + } + + } /* if ... */ + + } /* else ... */ + } + + expanders[type].size = new_len; + *prev_len = new_len; + if ( Glu->num_expansions ) ++Glu->num_expansions; + + return (void *) expanders[type].mem; + +} /* cexpand */ + + +/*! \brief Compress the work[] array to remove fragmentation. + */ +void +cStackCompress(GlobalLU_t *Glu) +{ + register int iword, dword, ndim; + char *last, *fragment; + int *ifrom, *ito; + complex *dfrom, *dto; + int *xlsub, *lsub, *xusub, *usub, *xlusup; + complex *ucol, *lusup; + + iword = sizeof(int); + dword = sizeof(complex); + ndim = Glu->n; + + xlsub = Glu->xlsub; + lsub = Glu->lsub; + xusub = Glu->xusub; + usub = Glu->usub; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + lusup = Glu->lusup; + + dfrom = ucol; + dto = (complex *)((char*)lusup + xlusup[ndim] * dword); + copy_mem_complex(xusub[ndim], dfrom, dto); + ucol = dto; + + ifrom = lsub; + ito = (int *) ((char*)ucol + xusub[ndim] * iword); + copy_mem_int(xlsub[ndim], ifrom, ito); + lsub = ito; + + ifrom = usub; + ito = (int *) ((char*)lsub + xlsub[ndim] * iword); + copy_mem_int(xusub[ndim], ifrom, ito); + usub = ito; + + last = (char*)usub + xusub[ndim] * iword; + fragment = (char*) (((char*)Glu->stack.array + Glu->stack.top1) - last); + Glu->stack.used -= (long int) fragment; + Glu->stack.top1 -= (long int) fragment; + + Glu->ucol = ucol; + Glu->lsub = lsub; + Glu->usub = usub; + +#ifdef DEBUG + printf("cStackCompress: fragment %d\n", fragment); + /* for (last = 0; last < ndim; ++last) + print_lu_col("After compress:", last, 0);*/ +#endif + +} + +/*! \brief Allocate storage for original matrix A + */ +void +callocateA(int n, int nnz, complex **a, int **asub, int **xa) +{ + *a = (complex *) complexMalloc(nnz); + *asub = (int *) intMalloc(nnz); + *xa = (int *) intMalloc(n+1); +} + + +complex *complexMalloc(int n) +{ + complex *buf; + buf = (complex *) SUPERLU_MALLOC((size_t)n * sizeof(complex)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in complexMalloc()\n"); + } + return (buf); +} + +complex *complexCalloc(int n) +{ + complex *buf; + register int i; + complex zero = {0.0, 0.0}; + buf = (complex *) SUPERLU_MALLOC((size_t)n * sizeof(complex)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in complexCalloc()\n"); + } + for (i = 0; i < n; ++i) buf[i] = zero; + return (buf); +} + + +int cmemory_usage(const int nzlmax, const int nzumax, + const int nzlumax, const int n) +{ + register int iword, dword; + + iword = sizeof(int); + dword = sizeof(complex); + + return (10 * n * iword + + nzlmax * iword + nzumax * (iword + dword) + nzlumax * dword); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cmyblas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/cmyblas2.c new file mode 100644 index 0000000..d7cf6fa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cmyblas2.c @@ -0,0 +1,188 @@ + +/*! @file cmyblas2.c + * \brief Level 2 Blas operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Purpose: + * Level 2 BLAS operations: solves and matvec, written in C. + * Note: + * This is only used when the system lacks an efficient BLAS library. + * + */ +/* + * File name: cmyblas2.c + */ +#include "slu_scomplex.h" + +/*! \brief Solves a dense UNIT lower triangular system + * + * The unit lower + * triangular matrix is stored in a 2D array M(1:nrow,1:ncol). + * The solution will be returned in the rhs vector. + */ +void clsolve ( int ldm, int ncol, complex *M, complex *rhs ) +{ + int k; + complex x0, x1, x2, x3, temp; + complex *M0; + complex *Mki0, *Mki1, *Mki2, *Mki3; + register int firstcol = 0; + + M0 = &M[0]; + + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + + x0 = rhs[firstcol]; + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&x1, &rhs[firstcol+1], &temp); + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&x2, &rhs[firstcol+2], &temp); + cc_mult(&temp, &x1, Mki1); Mki1++; + c_sub(&x2, &x2, &temp); + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&x3, &rhs[firstcol+3], &temp); + cc_mult(&temp, &x1, Mki1); Mki1++; + c_sub(&x3, &x3, &temp); + cc_mult(&temp, &x2, Mki2); Mki2++; + c_sub(&x3, &x3, &temp); + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + ++firstcol; + + for (k = firstcol; k < ncol; k++) { + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&rhs[k], &rhs[k], &temp); + cc_mult(&temp, &x1, Mki1); Mki1++; + c_sub(&rhs[k], &rhs[k], &temp); + cc_mult(&temp, &x2, Mki2); Mki2++; + c_sub(&rhs[k], &rhs[k], &temp); + cc_mult(&temp, &x3, Mki3); Mki3++; + c_sub(&rhs[k], &rhs[k], &temp); + } + + M0 += 4 * ldm + 4; + } + + if ( firstcol < ncol - 1 ) { /* Do 2 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + + x0 = rhs[firstcol]; + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&x1, &rhs[firstcol+1], &temp); + + rhs[++firstcol] = x1; + ++firstcol; + + for (k = firstcol; k < ncol; k++) { + cc_mult(&temp, &x0, Mki0); Mki0++; + c_sub(&rhs[k], &rhs[k], &temp); + cc_mult(&temp, &x1, Mki1); Mki1++; + c_sub(&rhs[k], &rhs[k], &temp); + } + } + +} + +/*! \brief Solves a dense upper triangular system. + * + * The upper triangular matrix is + * stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned + * in the rhs vector. + */ +void +cusolve ( ldm, ncol, M, rhs ) +int ldm; /* in */ +int ncol; /* in */ +complex *M; /* in */ +complex *rhs; /* modified */ +{ + complex xj, temp; + int jcol, j, irow; + + jcol = ncol - 1; + + for (j = 0; j < ncol; j++) { + + c_div(&xj, &rhs[jcol], &M[jcol + jcol*ldm]); /* M(jcol, jcol) */ + rhs[jcol] = xj; + + for (irow = 0; irow < jcol; irow++) { + cc_mult(&temp, &xj, &M[irow+jcol*ldm]); /* M(irow, jcol) */ + c_sub(&rhs[irow], &rhs[irow], &temp); + } + + jcol--; + + } +} + + +/*! \brief Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec. + * + * The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. + */ +void cmatvec ( ldm, nrow, ncol, M, vec, Mxvec ) +int ldm; /* in -- leading dimension of M */ +int nrow; /* in */ +int ncol; /* in */ +complex *M; /* in */ +complex *vec; /* in */ +complex *Mxvec; /* in/out */ +{ + complex vi0, vi1, vi2, vi3; + complex *M0, temp; + complex *Mki0, *Mki1, *Mki2, *Mki3; + register int firstcol = 0; + int k; + + M0 = &M[0]; + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + for (k = 0; k < nrow; k++) { + cc_mult(&temp, &vi0, Mki0); Mki0++; + c_add(&Mxvec[k], &Mxvec[k], &temp); + cc_mult(&temp, &vi1, Mki1); Mki1++; + c_add(&Mxvec[k], &Mxvec[k], &temp); + cc_mult(&temp, &vi2, Mki2); Mki2++; + c_add(&Mxvec[k], &Mxvec[k], &temp); + cc_mult(&temp, &vi3, Mki3); Mki3++; + c_add(&Mxvec[k], &Mxvec[k], &temp); + } + + M0 += 4 * ldm; + } + + while ( firstcol < ncol ) { /* Do 1 column */ + Mki0 = M0; + vi0 = vec[firstcol++]; + for (k = 0; k < nrow; k++) { + cc_mult(&temp, &vi0, Mki0); Mki0++; + c_add(&Mxvec[k], &Mxvec[k], &temp); + } + M0 += ldm; + } + +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/colamd.c b/thirdparty/superlu/SuperLU_4.1/SRC/colamd.c new file mode 100644 index 0000000..72c4390 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/colamd.c @@ -0,0 +1,3414 @@ +/*! @file colamd.c + *\brief A sparse matrix column ordering algorithm + +
    +    ========================================================================== 
    +    === colamd/symamd - a sparse matrix column ordering algorithm ============ 
    +    ========================================================================== 
    +
    +
    +    colamd:  an approximate minimum degree column ordering algorithm,
    +    	for LU factorization of symmetric or unsymmetric matrices,
    +	QR factorization, least squares, interior point methods for
    +	linear programming problems, and other related problems.
    +
    +    symamd:  an approximate minimum degree ordering algorithm for Cholesky
    +    	factorization of symmetric matrices.
    +
    +    Purpose:
    +
    +	Colamd computes a permutation Q such that the Cholesky factorization of
    +	(AQ)'(AQ) has less fill-in and requires fewer floating point operations
    +	than A'A.  This also provides a good ordering for sparse partial
    +	pivoting methods, P(AQ) = LU, where Q is computed prior to numerical
    +	factorization, and P is computed during numerical factorization via
    +	conventional partial pivoting with row interchanges.  Colamd is the
    +	column ordering method used in SuperLU, part of the ScaLAPACK library.
    +	It is also available as built-in function in MATLAB Version 6,
    +	available from MathWorks, Inc. (http://www.mathworks.com).  This
    +	routine can be used in place of colmmd in MATLAB.
    +
    +    	Symamd computes a permutation P of a symmetric matrix A such that the
    +	Cholesky factorization of PAP' has less fill-in and requires fewer
    +	floating point operations than A.  Symamd constructs a matrix M such
    +	that M'M has the same nonzero pattern of A, and then orders the columns
    +	of M using colmmd.  The column ordering of M is then returned as the
    +	row and column ordering P of A. 
    +
    +    Authors:
    +
    +	The authors of the code itself are Stefan I. Larimore and Timothy A.
    +	Davis (davis@cise.ufl.edu), University of Florida.  The algorithm was
    +	developed in collaboration with John Gilbert, Xerox PARC, and Esmond
    +	Ng, Oak Ridge National Laboratory.
    +
    +    Date:
    +
    +	September 8, 2003.  Version 2.3.
    +
    +    Acknowledgements:
    +
    +	This work was supported by the National Science Foundation, under
    +	grants DMS-9504974 and DMS-9803599.
    +
    +    Copyright and License:
    +
    +	Copyright (c) 1998-2003 by the University of Florida.
    +	All Rights Reserved.
    +
    +	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    +	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    +
    +	Permission is hereby granted to use, copy, modify, and/or distribute
    +	this program, provided that the Copyright, this License, and the
    +	Availability of the original version is retained on all copies and made
    +	accessible to the end-user of any code or package that includes COLAMD
    +	or any modified version of COLAMD. 
    +
    +    Availability:
    +
    +	The colamd/symamd library is available at
    +
    +	    http://www.cise.ufl.edu/research/sparse/colamd/
    +
    +	This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.c
    +	file.  It requires the colamd.h file.  It is required by the colamdmex.c
    +	and symamdmex.c files, for the MATLAB interface to colamd and symamd.
    +
    +    See the ChangeLog file for changes since Version 1.0.
    +
    +    ========================================================================== 
    +    === Description of user-callable routines ================================ 
    +    ========================================================================== 
    +
    +
    +    ----------------------------------------------------------------------------
    +    colamd_recommended:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    int colamd_recommended (int nnz, int n_row, int n_col) ;
    +
    +	    or as a C macro
    +
    +	    #include "colamd.h"
    +	    Alen = COLAMD_RECOMMENDED (int nnz, int n_row, int n_col) ;
    +
    +	Purpose:
    +
    +	    Returns recommended value of Alen for use by colamd.  Returns -1
    +	    if any input argument is negative.  The use of this routine
    +	    or macro is optional.  Note that the macro uses its arguments
    +	    more than once, so be careful for side effects, if you pass
    +	    expressions as arguments to COLAMD_RECOMMENDED.  Not needed for
    +	    symamd, which dynamically allocates its own memory.
    +
    +	Arguments (all input arguments):
    +
    +	    int nnz ;		Number of nonzeros in the matrix A.  This must
    +				be the same value as p [n_col] in the call to
    +				colamd - otherwise you will get a wrong value
    +				of the recommended memory to use.
    +
    +	    int n_row ;		Number of rows in the matrix A.
    +
    +	    int n_col ;		Number of columns in the matrix A.
    +
    +    ----------------------------------------------------------------------------
    +    colamd_set_defaults:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    colamd_set_defaults (double knobs [COLAMD_KNOBS]) ;
    +
    +	Purpose:
    +
    +	    Sets the default parameters.  The use of this routine is optional.
    +
    +	Arguments:
    +
    +	    double knobs [COLAMD_KNOBS] ;	Output only.
    +
    +		Colamd: rows with more than (knobs [COLAMD_DENSE_ROW] * n_col)
    +		entries are removed prior to ordering.  Columns with more than
    +		(knobs [COLAMD_DENSE_COL] * n_row) entries are removed prior to
    +		ordering, and placed last in the output column ordering. 
    +
    +		Symamd: uses only knobs [COLAMD_DENSE_ROW], which is knobs [0].
    +		Rows and columns with more than (knobs [COLAMD_DENSE_ROW] * n)
    +		entries are removed prior to ordering, and placed last in the
    +		output ordering.
    +
    +		COLAMD_DENSE_ROW and COLAMD_DENSE_COL are defined as 0 and 1,
    +		respectively, in colamd.h.  Default values of these two knobs
    +		are both 0.5.  Currently, only knobs [0] and knobs [1] are
    +		used, but future versions may use more knobs.  If so, they will
    +		be properly set to their defaults by the future version of
    +		colamd_set_defaults, so that the code that calls colamd will
    +		not need to change, assuming that you either use
    +		colamd_set_defaults, or pass a (double *) NULL pointer as the
    +		knobs array to colamd or symamd.
    +
    +    ----------------------------------------------------------------------------
    +    colamd:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    int colamd (int n_row, int n_col, int Alen, int *A, int *p,
    +	    	double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS]) ;
    +
    +	Purpose:
    +
    +	    Computes a column ordering (Q) of A such that P(AQ)=LU or
    +	    (AQ)'AQ=LL' have less fill-in and require fewer floating point
    +	    operations than factorizing the unpermuted matrix A or A'A,
    +	    respectively.
    +	    
    +	Returns:
    +
    +	    TRUE (1) if successful, FALSE (0) otherwise.
    +
    +	Arguments:
    +
    +	    int n_row ;		Input argument.
    +
    +		Number of rows in the matrix A.
    +		Restriction:  n_row >= 0.
    +		Colamd returns FALSE if n_row is negative.
    +
    +	    int n_col ;		Input argument.
    +
    +		Number of columns in the matrix A.
    +		Restriction:  n_col >= 0.
    +		Colamd returns FALSE if n_col is negative.
    +
    +	    int Alen ;		Input argument.
    +
    +		Restriction (see note):
    +		Alen >= 2*nnz + 6*(n_col+1) + 4*(n_row+1) + n_col
    +		Colamd returns FALSE if these conditions are not met.
    +
    +		Note:  this restriction makes an modest assumption regarding
    +		the size of the two typedef's structures in colamd.h.
    +		We do, however, guarantee that
    +
    +			Alen >= colamd_recommended (nnz, n_row, n_col)
    +		
    +		or equivalently as a C preprocessor macro: 
    +
    +			Alen >= COLAMD_RECOMMENDED (nnz, n_row, n_col)
    +
    +		will be sufficient.
    +
    +	    int A [Alen] ;	Input argument, undefined on output.
    +
    +		A is an integer array of size Alen.  Alen must be at least as
    +		large as the bare minimum value given above, but this is very
    +		low, and can result in excessive run time.  For best
    +		performance, we recommend that Alen be greater than or equal to
    +		colamd_recommended (nnz, n_row, n_col), which adds
    +		nnz/5 to the bare minimum value given above.
    +
    +		On input, the row indices of the entries in column c of the
    +		matrix are held in A [(p [c]) ... (p [c+1]-1)].  The row indices
    +		in a given column c need not be in ascending order, and
    +		duplicate row indices may be be present.  However, colamd will
    +		work a little faster if both of these conditions are met
    +		(Colamd puts the matrix into this format, if it finds that the
    +		the conditions are not met).
    +
    +		The matrix is 0-based.  That is, rows are in the range 0 to
    +		n_row-1, and columns are in the range 0 to n_col-1.  Colamd
    +		returns FALSE if any row index is out of range.
    +
    +		The contents of A are modified during ordering, and are
    +		undefined on output.
    +
    +	    int p [n_col+1] ;	Both input and output argument.
    +
    +		p is an integer array of size n_col+1.  On input, it holds the
    +		"pointers" for the column form of the matrix A.  Column c of
    +		the matrix A is held in A [(p [c]) ... (p [c+1]-1)].  The first
    +		entry, p [0], must be zero, and p [c] <= p [c+1] must hold
    +		for all c in the range 0 to n_col-1.  The value p [n_col] is
    +		thus the total number of entries in the pattern of the matrix A.
    +		Colamd returns FALSE if these conditions are not met.
    +
    +		On output, if colamd returns TRUE, the array p holds the column
    +		permutation (Q, for P(AQ)=LU or (AQ)'(AQ)=LL'), where p [0] is
    +		the first column index in the new ordering, and p [n_col-1] is
    +		the last.  That is, p [k] = j means that column j of A is the
    +		kth pivot column, in AQ, where k is in the range 0 to n_col-1
    +		(p [0] = j means that column j of A is the first column in AQ).
    +
    +		If colamd returns FALSE, then no permutation is returned, and
    +		p is undefined on output.
    +
    +	    double knobs [COLAMD_KNOBS] ;	Input argument.
    +
    +		See colamd_set_defaults for a description.
    +
    +	    int stats [COLAMD_STATS] ;		Output argument.
    +
    +		Statistics on the ordering, and error status.
    +		See colamd.h for related definitions.
    +		Colamd returns FALSE if stats is not present.
    +
    +		stats [0]:  number of dense or empty rows ignored.
    +
    +		stats [1]:  number of dense or empty columns ignored (and
    +				ordered last in the output permutation p)
    +				Note that a row can become "empty" if it
    +				contains only "dense" and/or "empty" columns,
    +				and similarly a column can become "empty" if it
    +				only contains "dense" and/or "empty" rows.
    +
    +		stats [2]:  number of garbage collections performed.
    +				This can be excessively high if Alen is close
    +				to the minimum required value.
    +
    +		stats [3]:  status code.  < 0 is an error code.
    +			    > 1 is a warning or notice.
    +
    +			0	OK.  Each column of the input matrix contained
    +				row indices in increasing order, with no
    +				duplicates.
    +
    +			1	OK, but columns of input matrix were jumbled
    +				(unsorted columns or duplicate entries).  Colamd
    +				had to do some extra work to sort the matrix
    +				first and remove duplicate entries, but it
    +				still was able to return a valid permutation
    +				(return value of colamd was TRUE).
    +
    +					stats [4]: highest numbered column that
    +						is unsorted or has duplicate
    +						entries.
    +					stats [5]: last seen duplicate or
    +						unsorted row index.
    +					stats [6]: number of duplicate or
    +						unsorted row indices.
    +
    +			-1	A is a null pointer
    +
    +			-2	p is a null pointer
    +
    +			-3 	n_row is negative
    +
    +					stats [4]: n_row
    +
    +			-4	n_col is negative
    +
    +					stats [4]: n_col
    +
    +			-5	number of nonzeros in matrix is negative
    +
    +					stats [4]: number of nonzeros, p [n_col]
    +
    +			-6	p [0] is nonzero
    +
    +					stats [4]: p [0]
    +
    +			-7	A is too small
    +
    +					stats [4]: required size
    +					stats [5]: actual size (Alen)
    +
    +			-8	a column has a negative number of entries
    +
    +					stats [4]: column with < 0 entries
    +					stats [5]: number of entries in col
    +
    +			-9	a row index is out of bounds
    +
    +					stats [4]: column with bad row index
    +					stats [5]: bad row index
    +					stats [6]: n_row, # of rows of matrx
    +
    +			-10	(unused; see symamd.c)
    +
    +			-999	(unused; see symamd.c)
    +
    +		Future versions may return more statistics in the stats array.
    +
    +	Example:
    +	
    +	    See http://www.cise.ufl.edu/research/sparse/colamd/example.c
    +	    for a complete example.
    +
    +	    To order the columns of a 5-by-4 matrix with 11 nonzero entries in
    +	    the following nonzero pattern
    +
    +	    	x 0 x 0
    +		x 0 x x
    +		0 x x 0
    +		0 0 x x
    +		x x 0 0
    +
    +	    with default knobs and no output statistics, do the following:
    +
    +		#include "colamd.h"
    +		#define ALEN COLAMD_RECOMMENDED (11, 5, 4)
    +		int A [ALEN] = {1, 2, 5, 3, 5, 1, 2, 3, 4, 2, 4} ;
    +		int p [ ] = {0, 3, 5, 9, 11} ;
    +		int stats [COLAMD_STATS] ;
    +		colamd (5, 4, ALEN, A, p, (double *) NULL, stats) ;
    +
    +	    The permutation is returned in the array p, and A is destroyed.
    +
    +    ----------------------------------------------------------------------------
    +    symamd:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    int symamd (int n, int *A, int *p, int *perm,
    +	    	double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS],
    +		void (*allocate) (size_t, size_t), void (*release) (void *)) ;
    +
    +	Purpose:
    +
    +    	    The symamd routine computes an ordering P of a symmetric sparse
    +	    matrix A such that the Cholesky factorization PAP' = LL' remains
    +	    sparse.  It is based on a column ordering of a matrix M constructed
    +	    so that the nonzero pattern of M'M is the same as A.  The matrix A
    +	    is assumed to be symmetric; only the strictly lower triangular part
    +	    is accessed.  You must pass your selected memory allocator (usually
    +	    calloc/free or mxCalloc/mxFree) to symamd, for it to allocate
    +	    memory for the temporary matrix M.
    +
    +	Returns:
    +
    +	    TRUE (1) if successful, FALSE (0) otherwise.
    +
    +	Arguments:
    +
    +	    int n ;		Input argument.
    +
    +	    	Number of rows and columns in the symmetrix matrix A.
    +		Restriction:  n >= 0.
    +		Symamd returns FALSE if n is negative.
    +
    +	    int A [nnz] ;	Input argument.
    +
    +	    	A is an integer array of size nnz, where nnz = p [n].
    +		
    +		The row indices of the entries in column c of the matrix are
    +		held in A [(p [c]) ... (p [c+1]-1)].  The row indices in a
    +		given column c need not be in ascending order, and duplicate
    +		row indices may be present.  However, symamd will run faster
    +		if the columns are in sorted order with no duplicate entries. 
    +
    +		The matrix is 0-based.  That is, rows are in the range 0 to
    +		n-1, and columns are in the range 0 to n-1.  Symamd
    +		returns FALSE if any row index is out of range.
    +
    +		The contents of A are not modified.
    +
    +	    int p [n+1] ;   	Input argument.
    +
    +		p is an integer array of size n+1.  On input, it holds the
    +		"pointers" for the column form of the matrix A.  Column c of
    +		the matrix A is held in A [(p [c]) ... (p [c+1]-1)].  The first
    +		entry, p [0], must be zero, and p [c] <= p [c+1] must hold
    +		for all c in the range 0 to n-1.  The value p [n] is
    +		thus the total number of entries in the pattern of the matrix A.
    +		Symamd returns FALSE if these conditions are not met.
    +
    +		The contents of p are not modified.
    +
    +	    int perm [n+1] ;   	Output argument.
    +
    +		On output, if symamd returns TRUE, the array perm holds the
    +		permutation P, where perm [0] is the first index in the new
    +		ordering, and perm [n-1] is the last.  That is, perm [k] = j
    +		means that row and column j of A is the kth column in PAP',
    +		where k is in the range 0 to n-1 (perm [0] = j means
    +		that row and column j of A are the first row and column in
    +		PAP').  The array is used as a workspace during the ordering,
    +		which is why it must be of length n+1, not just n.
    +
    +	    double knobs [COLAMD_KNOBS] ;	Input argument.
    +
    +		See colamd_set_defaults for a description.
    +
    +	    int stats [COLAMD_STATS] ;		Output argument.
    +
    +		Statistics on the ordering, and error status.
    +		See colamd.h for related definitions.
    +		Symamd returns FALSE if stats is not present.
    +
    +		stats [0]:  number of dense or empty row and columns ignored
    +				(and ordered last in the output permutation 
    +				perm).  Note that a row/column can become
    +				"empty" if it contains only "dense" and/or
    +				"empty" columns/rows.
    +
    +		stats [1]:  (same as stats [0])
    +
    +		stats [2]:  number of garbage collections performed.
    +
    +		stats [3]:  status code.  < 0 is an error code.
    +			    > 1 is a warning or notice.
    +
    +			0	OK.  Each column of the input matrix contained
    +				row indices in increasing order, with no
    +				duplicates.
    +
    +			1	OK, but columns of input matrix were jumbled
    +				(unsorted columns or duplicate entries).  Symamd
    +				had to do some extra work to sort the matrix
    +				first and remove duplicate entries, but it
    +				still was able to return a valid permutation
    +				(return value of symamd was TRUE).
    +
    +					stats [4]: highest numbered column that
    +						is unsorted or has duplicate
    +						entries.
    +					stats [5]: last seen duplicate or
    +						unsorted row index.
    +					stats [6]: number of duplicate or
    +						unsorted row indices.
    +
    +			-1	A is a null pointer
    +
    +			-2	p is a null pointer
    +
    +			-3	(unused, see colamd.c)
    +
    +			-4 	n is negative
    +
    +					stats [4]: n
    +
    +			-5	number of nonzeros in matrix is negative
    +
    +					stats [4]: # of nonzeros (p [n]).
    +
    +			-6	p [0] is nonzero
    +
    +					stats [4]: p [0]
    +
    +			-7	(unused)
    +
    +			-8	a column has a negative number of entries
    +
    +					stats [4]: column with < 0 entries
    +					stats [5]: number of entries in col
    +
    +			-9	a row index is out of bounds
    +
    +					stats [4]: column with bad row index
    +					stats [5]: bad row index
    +					stats [6]: n_row, # of rows of matrx
    +
    +			-10	out of memory (unable to allocate temporary
    +				workspace for M or count arrays using the
    +				"allocate" routine passed into symamd).
    +
    +			-999	internal error.  colamd failed to order the
    +				matrix M, when it should have succeeded.  This
    +				indicates a bug.  If this (and *only* this)
    +				error code occurs, please contact the authors.
    +				Don't contact the authors if you get any other
    +				error code.
    +
    +		Future versions may return more statistics in the stats array.
    +
    +	    void * (*allocate) (size_t, size_t)
    +
    +	    	A pointer to a function providing memory allocation.  The
    +		allocated memory must be returned initialized to zero.  For a
    +		C application, this argument should normally be a pointer to
    +		calloc.  For a MATLAB mexFunction, the routine mxCalloc is
    +		passed instead.
    +
    +	    void (*release) (size_t, size_t)
    +
    +	    	A pointer to a function that frees memory allocated by the
    +		memory allocation routine above.  For a C application, this
    +		argument should normally be a pointer to free.  For a MATLAB
    +		mexFunction, the routine mxFree is passed instead.
    +
    +
    +    ----------------------------------------------------------------------------
    +    colamd_report:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    colamd_report (int stats [COLAMD_STATS]) ;
    +
    +	Purpose:
    +
    +	    Prints the error status and statistics recorded in the stats
    +	    array on the standard error output (for a standard C routine)
    +	    or on the MATLAB output (for a mexFunction).
    +
    +	Arguments:
    +
    +	    int stats [COLAMD_STATS] ;	Input only.  Statistics from colamd.
    +
    +
    +    ----------------------------------------------------------------------------
    +    symamd_report:
    +    ----------------------------------------------------------------------------
    +
    +	C syntax:
    +
    +	    #include "colamd.h"
    +	    symamd_report (int stats [COLAMD_STATS]) ;
    +
    +	Purpose:
    +
    +	    Prints the error status and statistics recorded in the stats
    +	    array on the standard error output (for a standard C routine)
    +	    or on the MATLAB output (for a mexFunction).
    +
    +	Arguments:
    +
    +	    int stats [COLAMD_STATS] ;	Input only.  Statistics from symamd.
    +
    + 
    +*/ + +/* ========================================================================== */ +/* === Scaffolding code definitions ======================================== */ +/* ========================================================================== */ + +/* Ensure that debugging is turned off: */ +#ifndef NDEBUG +#define NDEBUG +#endif /* NDEBUG */ + +/* + Our "scaffolding code" philosophy: In our opinion, well-written library + code should keep its "debugging" code, and just normally have it turned off + by the compiler so as not to interfere with performance. This serves + several purposes: + + (1) assertions act as comments to the reader, telling you what the code + expects at that point. All assertions will always be true (unless + there really is a bug, of course). + + (2) leaving in the scaffolding code assists anyone who would like to modify + the code, or understand the algorithm (by reading the debugging output, + one can get a glimpse into what the code is doing). + + (3) (gasp!) for actually finding bugs. This code has been heavily tested + and "should" be fully functional and bug-free ... but you never know... + + To enable debugging, comment out the "#define NDEBUG" above. For a MATLAB + mexFunction, you will also need to modify mexopts.sh to remove the -DNDEBUG + definition. The code will become outrageously slow when debugging is + enabled. To control the level of debugging output, set an environment + variable D to 0 (little), 1 (some), 2, 3, or 4 (lots). When debugging, + you should see the following message on the standard output: + + colamd: debug version, D = 1 (THIS WILL BE SLOW!) + + or a similar message for symamd. If you don't, then debugging has not + been enabled. + +*/ + +/* ========================================================================== */ +/* === Include files ======================================================== */ +/* ========================================================================== */ + +#include "colamd.h" +#include + +#ifdef MATLAB_MEX_FILE +#include "mex.h" +#include "matrix.h" +#else +#include +#include +#endif /* MATLAB_MEX_FILE */ + +/* ========================================================================== */ +/* === Definitions ========================================================== */ +/* ========================================================================== */ + +/* Routines are either PUBLIC (user-callable) or PRIVATE (not user-callable) */ +#define PUBLIC +#define PRIVATE static + +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +#define ONES_COMPLEMENT(r) (-(r)-1) + +/* -------------------------------------------------------------------------- */ +/* Change for version 2.1: define TRUE and FALSE only if not yet defined */ +/* -------------------------------------------------------------------------- */ + +#ifndef TRUE +#define TRUE (1) +#endif + +#ifndef FALSE +#define FALSE (0) +#endif + +/* -------------------------------------------------------------------------- */ + +#define EMPTY (-1) + +/* Row and column status */ +#define ALIVE (0) +#define DEAD (-1) + +/* Column status */ +#define DEAD_PRINCIPAL (-1) +#define DEAD_NON_PRINCIPAL (-2) + +/* Macros for row and column status update and checking. */ +#define ROW_IS_DEAD(r) ROW_IS_MARKED_DEAD (Row[r].shared2.mark) +#define ROW_IS_MARKED_DEAD(row_mark) (row_mark < ALIVE) +#define ROW_IS_ALIVE(r) (Row [r].shared2.mark >= ALIVE) +#define COL_IS_DEAD(c) (Col [c].start < ALIVE) +#define COL_IS_ALIVE(c) (Col [c].start >= ALIVE) +#define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL) +#define KILL_ROW(r) { Row [r].shared2.mark = DEAD ; } +#define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; } +#define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; } + +/* ========================================================================== */ +/* === Colamd reporting mechanism =========================================== */ +/* ========================================================================== */ + +#ifdef MATLAB_MEX_FILE + +/* use mexPrintf in a MATLAB mexFunction, for debugging and statistics output */ +#define PRINTF mexPrintf + +/* In MATLAB, matrices are 1-based to the user, but 0-based internally */ +#define INDEX(i) ((i)+1) + +#else + +/* Use printf in standard C environment, for debugging and statistics output. */ +/* Output is generated only if debugging is enabled at compile time, or if */ +/* the caller explicitly calls colamd_report or symamd_report. */ +#define PRINTF printf + +/* In C, matrices are 0-based and indices are reported as such in *_report */ +#define INDEX(i) (i) + +#endif /* MATLAB_MEX_FILE */ + +/* ========================================================================== */ +/* === Prototypes of PRIVATE routines ======================================= */ +/* ========================================================================== */ + +PRIVATE int init_rows_cols +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int p [], + int stats [COLAMD_STATS] +) ; + +PRIVATE void init_scoring +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int head [], + double knobs [COLAMD_KNOBS], + int *p_n_row2, + int *p_n_col2, + int *p_max_deg +) ; + +PRIVATE int find_ordering +( + int n_row, + int n_col, + int Alen, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int head [], + int n_col2, + int max_deg, + int pfree +) ; + +PRIVATE void order_children +( + int n_col, + Colamd_Col Col [], + int p [] +) ; + +PRIVATE void detect_super_cols +( + +#ifndef NDEBUG + int n_col, + Colamd_Row Row [], +#endif /* NDEBUG */ + + Colamd_Col Col [], + int A [], + int head [], + int row_start, + int row_length +) ; + +PRIVATE int garbage_collection +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int *pfree +) ; + +PRIVATE int clear_mark +( + int n_row, + Colamd_Row Row [] +) ; + +PRIVATE void print_report +( + char *method, + int stats [COLAMD_STATS] +) ; + +/* ========================================================================== */ +/* === Debugging prototypes and definitions ================================= */ +/* ========================================================================== */ + +#ifndef NDEBUG + +/* colamd_debug is the *ONLY* global variable, and is only */ +/* present when debugging */ + +PRIVATE int colamd_debug ; /* debug print level */ + +#define DEBUG0(params) { (void) PRINTF params ; } +#define DEBUG1(params) { if (colamd_debug >= 1) (void) PRINTF params ; } +#define DEBUG2(params) { if (colamd_debug >= 2) (void) PRINTF params ; } +#define DEBUG3(params) { if (colamd_debug >= 3) (void) PRINTF params ; } +#define DEBUG4(params) { if (colamd_debug >= 4) (void) PRINTF params ; } + +#ifdef MATLAB_MEX_FILE +#define ASSERT(expression) (mxAssert ((expression), "")) +#else +#define ASSERT(expression) (assert (expression)) +#endif /* MATLAB_MEX_FILE */ + +PRIVATE void colamd_get_debug /* gets the debug print level from getenv */ +( + char *method +) ; + +PRIVATE void debug_deg_lists +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int head [], + int min_score, + int should, + int max_deg +) ; + +PRIVATE void debug_mark +( + int n_row, + Colamd_Row Row [], + int tag_mark, + int max_mark +) ; + +PRIVATE void debug_matrix +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [] +) ; + +PRIVATE void debug_structures +( + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int n_col2 +) ; + +#else /* NDEBUG */ + +/* === No debugging ========================================================= */ + +#define DEBUG0(params) ; +#define DEBUG1(params) ; +#define DEBUG2(params) ; +#define DEBUG3(params) ; +#define DEBUG4(params) ; + +#define ASSERT(expression) ((void) 0) + +#endif /* NDEBUG */ + +/* ========================================================================== */ + + + +/* ========================================================================== */ +/* === USER-CALLABLE ROUTINES: ============================================== */ +/* ========================================================================== */ + + +/* ========================================================================== */ +/* === colamd_recommended =================================================== */ +/* ========================================================================== */ + +/* + The colamd_recommended routine returns the suggested size for Alen. This + value has been determined to provide good balance between the number of + garbage collections and the memory requirements for colamd. If any + argument is negative, a -1 is returned as an error condition. This + function is also available as a macro defined in colamd.h, so that you + can use it for a statically-allocated array size. +*/ + +PUBLIC int colamd_recommended /* returns recommended value of Alen. */ +( + /* === Parameters ======================================================= */ + + int nnz, /* number of nonzeros in A */ + int n_row, /* number of rows in A */ + int n_col /* number of columns in A */ +) +{ + return (COLAMD_RECOMMENDED (nnz, n_row, n_col)) ; +} + + +/* ========================================================================== */ +/* === colamd_set_defaults ================================================== */ +/* ========================================================================== */ + +/* + The colamd_set_defaults routine sets the default values of the user- + controllable parameters for colamd: + + knobs [0] rows with knobs[0]*n_col entries or more are removed + prior to ordering in colamd. Rows and columns with + knobs[0]*n_col entries or more are removed prior to + ordering in symamd and placed last in the output + ordering. + + knobs [1] columns with knobs[1]*n_row entries or more are removed + prior to ordering in colamd, and placed last in the + column permutation. Symamd ignores this knob. + + knobs [2..19] unused, but future versions might use this +*/ + +PUBLIC void colamd_set_defaults +( + /* === Parameters ======================================================= */ + + double knobs [COLAMD_KNOBS] /* knob array */ +) +{ + /* === Local variables ================================================== */ + + int i ; + + if (!knobs) + { + return ; /* no knobs to initialize */ + } + for (i = 0 ; i < COLAMD_KNOBS ; i++) + { + knobs [i] = 0 ; + } + knobs [COLAMD_DENSE_ROW] = 0.5 ; /* ignore rows over 50% dense */ + knobs [COLAMD_DENSE_COL] = 0.5 ; /* ignore columns over 50% dense */ +} + + +/* ========================================================================== */ +/* === symamd =============================================================== */ +/* ========================================================================== */ + +PUBLIC int symamd /* return TRUE if OK, FALSE otherwise */ +( + /* === Parameters ======================================================= */ + + int n, /* number of rows and columns of A */ + int A [], /* row indices of A */ + int p [], /* column pointers of A */ + int perm [], /* output permutation, size n+1 */ + double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ + int stats [COLAMD_STATS], /* output statistics and error codes */ + void * (*allocate) (size_t, size_t), + /* pointer to calloc (ANSI C) or */ + /* mxCalloc (for MATLAB mexFunction) */ + void (*release) (void *) + /* pointer to free (ANSI C) or */ + /* mxFree (for MATLAB mexFunction) */ +) +{ + /* === Local variables ================================================== */ + + int *count ; /* length of each column of M, and col pointer*/ + int *mark ; /* mark array for finding duplicate entries */ + int *M ; /* row indices of matrix M */ + int Mlen ; /* length of M */ + int n_row ; /* number of rows in M */ + int nnz ; /* number of entries in A */ + int i ; /* row index of A */ + int j ; /* column index of A */ + int k ; /* row index of M */ + int mnz ; /* number of nonzeros in M */ + int pp ; /* index into a column of A */ + int last_row ; /* last row seen in the current column */ + int length ; /* number of nonzeros in a column */ + + double cknobs [COLAMD_KNOBS] ; /* knobs for colamd */ + double default_knobs [COLAMD_KNOBS] ; /* default knobs for colamd */ + int cstats [COLAMD_STATS] ; /* colamd stats */ + +#ifndef NDEBUG + colamd_get_debug ("symamd") ; +#endif /* NDEBUG */ + + /* === Check the input arguments ======================================== */ + + if (!stats) + { + DEBUG0 (("symamd: stats not present\n")) ; + return (FALSE) ; + } + for (i = 0 ; i < COLAMD_STATS ; i++) + { + stats [i] = 0 ; + } + stats [COLAMD_STATUS] = COLAMD_OK ; + stats [COLAMD_INFO1] = -1 ; + stats [COLAMD_INFO2] = -1 ; + + if (!A) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; + DEBUG0 (("symamd: A not present\n")) ; + return (FALSE) ; + } + + if (!p) /* p is not present */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; + DEBUG0 (("symamd: p not present\n")) ; + return (FALSE) ; + } + + if (n < 0) /* n must be >= 0 */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; + stats [COLAMD_INFO1] = n ; + DEBUG0 (("symamd: n negative %d\n", n)) ; + return (FALSE) ; + } + + nnz = p [n] ; + if (nnz < 0) /* nnz must be >= 0 */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; + stats [COLAMD_INFO1] = nnz ; + DEBUG0 (("symamd: number of entries negative %d\n", nnz)) ; + return (FALSE) ; + } + + if (p [0] != 0) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; + stats [COLAMD_INFO1] = p [0] ; + DEBUG0 (("symamd: p[0] not zero %d\n", p [0])) ; + return (FALSE) ; + } + + /* === If no knobs, set default knobs =================================== */ + + if (!knobs) + { + colamd_set_defaults (default_knobs) ; + knobs = default_knobs ; + } + + /* === Allocate count and mark ========================================== */ + + count = (int *) ((*allocate) (n+1, sizeof (int))) ; + if (!count) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; + DEBUG0 (("symamd: allocate count (size %d) failed\n", n+1)) ; + return (FALSE) ; + } + + mark = (int *) ((*allocate) (n+1, sizeof (int))) ; + if (!mark) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; + (*release) ((void *) count) ; + DEBUG0 (("symamd: allocate mark (size %d) failed\n", n+1)) ; + return (FALSE) ; + } + + /* === Compute column counts of M, check if A is valid ================== */ + + stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ + + for (i = 0 ; i < n ; i++) + { + mark [i] = -1 ; + } + + for (j = 0 ; j < n ; j++) + { + last_row = -1 ; + + length = p [j+1] - p [j] ; + if (length < 0) + { + /* column pointers must be non-decreasing */ + stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; + stats [COLAMD_INFO1] = j ; + stats [COLAMD_INFO2] = length ; + (*release) ((void *) count) ; + (*release) ((void *) mark) ; + DEBUG0 (("symamd: col %d negative length %d\n", j, length)) ; + return (FALSE) ; + } + + for (pp = p [j] ; pp < p [j+1] ; pp++) + { + i = A [pp] ; + if (i < 0 || i >= n) + { + /* row index i, in column j, is out of bounds */ + stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; + stats [COLAMD_INFO1] = j ; + stats [COLAMD_INFO2] = i ; + stats [COLAMD_INFO3] = n ; + (*release) ((void *) count) ; + (*release) ((void *) mark) ; + DEBUG0 (("symamd: row %d col %d out of bounds\n", i, j)) ; + return (FALSE) ; + } + + if (i <= last_row || mark [i] == j) + { + /* row index is unsorted or repeated (or both), thus col */ + /* is jumbled. This is a notice, not an error condition. */ + stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; + stats [COLAMD_INFO1] = j ; + stats [COLAMD_INFO2] = i ; + (stats [COLAMD_INFO3]) ++ ; + DEBUG1 (("symamd: row %d col %d unsorted/duplicate\n", i, j)) ; + } + + if (i > j && mark [i] != j) + { + /* row k of M will contain column indices i and j */ + count [i]++ ; + count [j]++ ; + } + + /* mark the row as having been seen in this column */ + mark [i] = j ; + + last_row = i ; + } + } + + if (stats [COLAMD_STATUS] == COLAMD_OK) + { + /* if there are no duplicate entries, then mark is no longer needed */ + (*release) ((void *) mark) ; + } + + /* === Compute column pointers of M ===================================== */ + + /* use output permutation, perm, for column pointers of M */ + perm [0] = 0 ; + for (j = 1 ; j <= n ; j++) + { + perm [j] = perm [j-1] + count [j-1] ; + } + for (j = 0 ; j < n ; j++) + { + count [j] = perm [j] ; + } + + /* === Construct M ====================================================== */ + + mnz = perm [n] ; + n_row = mnz / 2 ; + Mlen = colamd_recommended (mnz, n_row, n) ; + M = (int *) ((*allocate) (Mlen, sizeof (int))) ; + DEBUG0 (("symamd: M is %d-by-%d with %d entries, Mlen = %d\n", + n_row, n, mnz, Mlen)) ; + + if (!M) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; + (*release) ((void *) count) ; + (*release) ((void *) mark) ; + DEBUG0 (("symamd: allocate M (size %d) failed\n", Mlen)) ; + return (FALSE) ; + } + + k = 0 ; + + if (stats [COLAMD_STATUS] == COLAMD_OK) + { + /* Matrix is OK */ + for (j = 0 ; j < n ; j++) + { + ASSERT (p [j+1] - p [j] >= 0) ; + for (pp = p [j] ; pp < p [j+1] ; pp++) + { + i = A [pp] ; + ASSERT (i >= 0 && i < n) ; + if (i > j) + { + /* row k of M contains column indices i and j */ + M [count [i]++] = k ; + M [count [j]++] = k ; + k++ ; + } + } + } + } + else + { + /* Matrix is jumbled. Do not add duplicates to M. Unsorted cols OK. */ + DEBUG0 (("symamd: Duplicates in A.\n")) ; + for (i = 0 ; i < n ; i++) + { + mark [i] = -1 ; + } + for (j = 0 ; j < n ; j++) + { + ASSERT (p [j+1] - p [j] >= 0) ; + for (pp = p [j] ; pp < p [j+1] ; pp++) + { + i = A [pp] ; + ASSERT (i >= 0 && i < n) ; + if (i > j && mark [i] != j) + { + /* row k of M contains column indices i and j */ + M [count [i]++] = k ; + M [count [j]++] = k ; + k++ ; + mark [i] = j ; + } + } + } + (*release) ((void *) mark) ; + } + + /* count and mark no longer needed */ + (*release) ((void *) count) ; + ASSERT (k == n_row) ; + + /* === Adjust the knobs for M =========================================== */ + + for (i = 0 ; i < COLAMD_KNOBS ; i++) + { + cknobs [i] = knobs [i] ; + } + + /* there are no dense rows in M */ + cknobs [COLAMD_DENSE_ROW] = 1.0 ; + + if (n_row != 0 && n < n_row) + { + /* On input, the knob is a fraction of 1..n, the number of rows of A. */ + /* Convert it to a fraction of 1..n_row, of the number of rows of M. */ + cknobs [COLAMD_DENSE_COL] = (knobs [COLAMD_DENSE_ROW] * n) / n_row ; + } + else + { + /* no dense columns in M */ + cknobs [COLAMD_DENSE_COL] = 1.0 ; + } + + DEBUG0 (("symamd: dense col knob for M: %g\n", cknobs [COLAMD_DENSE_COL])) ; + + /* === Order the columns of M =========================================== */ + + if (!colamd (n_row, n, Mlen, M, perm, cknobs, cstats)) + { + /* This "cannot" happen, unless there is a bug in the code. */ + stats [COLAMD_STATUS] = COLAMD_ERROR_internal_error ; + (*release) ((void *) M) ; + DEBUG0 (("symamd: internal error!\n")) ; + return (FALSE) ; + } + + /* Note that the output permutation is now in perm */ + + /* === get the statistics for symamd from colamd ======================== */ + + /* note that a dense column in colamd means a dense row and col in symamd */ + stats [COLAMD_DENSE_ROW] = cstats [COLAMD_DENSE_COL] ; + stats [COLAMD_DENSE_COL] = cstats [COLAMD_DENSE_COL] ; + stats [COLAMD_DEFRAG_COUNT] = cstats [COLAMD_DEFRAG_COUNT] ; + + /* === Free M =========================================================== */ + + (*release) ((void *) M) ; + DEBUG0 (("symamd: done.\n")) ; + return (TRUE) ; + +} + +/* ========================================================================== */ +/* === colamd =============================================================== */ +/* ========================================================================== */ + +/* + The colamd routine computes a column ordering Q of a sparse matrix + A such that the LU factorization P(AQ) = LU remains sparse, where P is + selected via partial pivoting. The routine can also be viewed as + providing a permutation Q such that the Cholesky factorization + (AQ)'(AQ) = LL' remains sparse. +*/ + +PUBLIC int colamd /* returns TRUE if successful, FALSE otherwise*/ +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows in A */ + int n_col, /* number of columns in A */ + int Alen, /* length of A */ + int A [], /* row indices of A */ + int p [], /* pointers to columns in A */ + double knobs [COLAMD_KNOBS],/* parameters (uses defaults if NULL) */ + int stats [COLAMD_STATS] /* output statistics and error codes */ +) +{ + /* === Local variables ================================================== */ + + int i ; /* loop index */ + int nnz ; /* nonzeros in A */ + int Row_size ; /* size of Row [], in integers */ + int Col_size ; /* size of Col [], in integers */ + int need ; /* minimum required length of A */ + Colamd_Row *Row ; /* pointer into A of Row [0..n_row] array */ + Colamd_Col *Col ; /* pointer into A of Col [0..n_col] array */ + int n_col2 ; /* number of non-dense, non-empty columns */ + int n_row2 ; /* number of non-dense, non-empty rows */ + int ngarbage ; /* number of garbage collections performed */ + int max_deg ; /* maximum row degree */ + double default_knobs [COLAMD_KNOBS] ; /* default knobs array */ + +#ifndef NDEBUG + colamd_get_debug ("colamd") ; +#endif /* NDEBUG */ + + /* === Check the input arguments ======================================== */ + + if (!stats) + { + DEBUG0 (("colamd: stats not present\n")) ; + return (FALSE) ; + } + for (i = 0 ; i < COLAMD_STATS ; i++) + { + stats [i] = 0 ; + } + stats [COLAMD_STATUS] = COLAMD_OK ; + stats [COLAMD_INFO1] = -1 ; + stats [COLAMD_INFO2] = -1 ; + + if (!A) /* A is not present */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; + DEBUG0 (("colamd: A not present\n")) ; + return (FALSE) ; + } + + if (!p) /* p is not present */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; + DEBUG0 (("colamd: p not present\n")) ; + return (FALSE) ; + } + + if (n_row < 0) /* n_row must be >= 0 */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_nrow_negative ; + stats [COLAMD_INFO1] = n_row ; + DEBUG0 (("colamd: nrow negative %d\n", n_row)) ; + return (FALSE) ; + } + + if (n_col < 0) /* n_col must be >= 0 */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; + stats [COLAMD_INFO1] = n_col ; + DEBUG0 (("colamd: ncol negative %d\n", n_col)) ; + return (FALSE) ; + } + + nnz = p [n_col] ; + if (nnz < 0) /* nnz must be >= 0 */ + { + stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; + stats [COLAMD_INFO1] = nnz ; + DEBUG0 (("colamd: number of entries negative %d\n", nnz)) ; + return (FALSE) ; + } + + if (p [0] != 0) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; + stats [COLAMD_INFO1] = p [0] ; + DEBUG0 (("colamd: p[0] not zero %d\n", p [0])) ; + return (FALSE) ; + } + + /* === If no knobs, set default knobs =================================== */ + + if (!knobs) + { + colamd_set_defaults (default_knobs) ; + knobs = default_knobs ; + } + + /* === Allocate the Row and Col arrays from array A ===================== */ + + Col_size = COLAMD_C (n_col) ; + Row_size = COLAMD_R (n_row) ; + need = 2*nnz + n_col + Col_size + Row_size ; + + if (need > Alen) + { + /* not enough space in array A to perform the ordering */ + stats [COLAMD_STATUS] = COLAMD_ERROR_A_too_small ; + stats [COLAMD_INFO1] = need ; + stats [COLAMD_INFO2] = Alen ; + DEBUG0 (("colamd: Need Alen >= %d, given only Alen = %d\n", need,Alen)); + return (FALSE) ; + } + + Alen -= Col_size + Row_size ; + Col = (Colamd_Col *) &A [Alen] ; + Row = (Colamd_Row *) &A [Alen + Col_size] ; + + /* === Construct the row and column data structures ===================== */ + + if (!init_rows_cols (n_row, n_col, Row, Col, A, p, stats)) + { + /* input matrix is invalid */ + DEBUG0 (("colamd: Matrix invalid\n")) ; + return (FALSE) ; + } + + /* === Initialize scores, kill dense rows/columns ======================= */ + + init_scoring (n_row, n_col, Row, Col, A, p, knobs, + &n_row2, &n_col2, &max_deg) ; + + /* === Order the supercolumns =========================================== */ + + ngarbage = find_ordering (n_row, n_col, Alen, Row, Col, A, p, + n_col2, max_deg, 2*nnz) ; + + /* === Order the non-principal columns ================================== */ + + order_children (n_col, Col, p) ; + + /* === Return statistics in stats ======================================= */ + + stats [COLAMD_DENSE_ROW] = n_row - n_row2 ; + stats [COLAMD_DENSE_COL] = n_col - n_col2 ; + stats [COLAMD_DEFRAG_COUNT] = ngarbage ; + DEBUG0 (("colamd: done.\n")) ; + return (TRUE) ; +} + + +/* ========================================================================== */ +/* === colamd_report ======================================================== */ +/* ========================================================================== */ + +PUBLIC void colamd_report +( + int stats [COLAMD_STATS] +) +{ + print_report ("colamd", stats) ; +} + + +/* ========================================================================== */ +/* === symamd_report ======================================================== */ +/* ========================================================================== */ + +PUBLIC void symamd_report +( + int stats [COLAMD_STATS] +) +{ + print_report ("symamd", stats) ; +} + + + +/* ========================================================================== */ +/* === NON-USER-CALLABLE ROUTINES: ========================================== */ +/* ========================================================================== */ + +/* There are no user-callable routines beyond this point in the file */ + + +/* ========================================================================== */ +/* === init_rows_cols ======================================================= */ +/* ========================================================================== */ + +/* + Takes the column form of the matrix in A and creates the row form of the + matrix. Also, row and column attributes are stored in the Col and Row + structs. If the columns are un-sorted or contain duplicate row indices, + this routine will also sort and remove duplicate row indices from the + column form of the matrix. Returns FALSE if the matrix is invalid, + TRUE otherwise. Not user-callable. +*/ + +PRIVATE int init_rows_cols /* returns TRUE if OK, or FALSE otherwise */ +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows of A */ + int n_col, /* number of columns of A */ + Colamd_Row Row [], /* of size n_row+1 */ + Colamd_Col Col [], /* of size n_col+1 */ + int A [], /* row indices of A, of size Alen */ + int p [], /* pointers to columns in A, of size n_col+1 */ + int stats [COLAMD_STATS] /* colamd statistics */ +) +{ + /* === Local variables ================================================== */ + + int col ; /* a column index */ + int row ; /* a row index */ + int *cp ; /* a column pointer */ + int *cp_end ; /* a pointer to the end of a column */ + int *rp ; /* a row pointer */ + int *rp_end ; /* a pointer to the end of a row */ + int last_row ; /* previous row */ + + /* === Initialize columns, and check column pointers ==================== */ + + for (col = 0 ; col < n_col ; col++) + { + Col [col].start = p [col] ; + Col [col].length = p [col+1] - p [col] ; + + if (Col [col].length < 0) + { + /* column pointers must be non-decreasing */ + stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; + stats [COLAMD_INFO1] = col ; + stats [COLAMD_INFO2] = Col [col].length ; + DEBUG0 (("colamd: col %d length %d < 0\n", col, Col [col].length)) ; + return (FALSE) ; + } + + Col [col].shared1.thickness = 1 ; + Col [col].shared2.score = 0 ; + Col [col].shared3.prev = EMPTY ; + Col [col].shared4.degree_next = EMPTY ; + } + + /* p [0..n_col] no longer needed, used as "head" in subsequent routines */ + + /* === Scan columns, compute row degrees, and check row indices ========= */ + + stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ + + for (row = 0 ; row < n_row ; row++) + { + Row [row].length = 0 ; + Row [row].shared2.mark = -1 ; + } + + for (col = 0 ; col < n_col ; col++) + { + last_row = -1 ; + + cp = &A [p [col]] ; + cp_end = &A [p [col+1]] ; + + while (cp < cp_end) + { + row = *cp++ ; + + /* make sure row indices within range */ + if (row < 0 || row >= n_row) + { + stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; + stats [COLAMD_INFO1] = col ; + stats [COLAMD_INFO2] = row ; + stats [COLAMD_INFO3] = n_row ; + DEBUG0 (("colamd: row %d col %d out of bounds\n", row, col)) ; + return (FALSE) ; + } + + if (row <= last_row || Row [row].shared2.mark == col) + { + /* row index are unsorted or repeated (or both), thus col */ + /* is jumbled. This is a notice, not an error condition. */ + stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; + stats [COLAMD_INFO1] = col ; + stats [COLAMD_INFO2] = row ; + (stats [COLAMD_INFO3]) ++ ; + DEBUG1 (("colamd: row %d col %d unsorted/duplicate\n",row,col)); + } + + if (Row [row].shared2.mark != col) + { + Row [row].length++ ; + } + else + { + /* this is a repeated entry in the column, */ + /* it will be removed */ + Col [col].length-- ; + } + + /* mark the row as having been seen in this column */ + Row [row].shared2.mark = col ; + + last_row = row ; + } + } + + /* === Compute row pointers ============================================= */ + + /* row form of the matrix starts directly after the column */ + /* form of matrix in A */ + Row [0].start = p [n_col] ; + Row [0].shared1.p = Row [0].start ; + Row [0].shared2.mark = -1 ; + for (row = 1 ; row < n_row ; row++) + { + Row [row].start = Row [row-1].start + Row [row-1].length ; + Row [row].shared1.p = Row [row].start ; + Row [row].shared2.mark = -1 ; + } + + /* === Create row form ================================================== */ + + if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) + { + /* if cols jumbled, watch for repeated row indices */ + for (col = 0 ; col < n_col ; col++) + { + cp = &A [p [col]] ; + cp_end = &A [p [col+1]] ; + while (cp < cp_end) + { + row = *cp++ ; + if (Row [row].shared2.mark != col) + { + A [(Row [row].shared1.p)++] = col ; + Row [row].shared2.mark = col ; + } + } + } + } + else + { + /* if cols not jumbled, we don't need the mark (this is faster) */ + for (col = 0 ; col < n_col ; col++) + { + cp = &A [p [col]] ; + cp_end = &A [p [col+1]] ; + while (cp < cp_end) + { + A [(Row [*cp++].shared1.p)++] = col ; + } + } + } + + /* === Clear the row marks and set row degrees ========================== */ + + for (row = 0 ; row < n_row ; row++) + { + Row [row].shared2.mark = 0 ; + Row [row].shared1.degree = Row [row].length ; + } + + /* === See if we need to re-create columns ============================== */ + + if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) + { + DEBUG0 (("colamd: reconstructing column form, matrix jumbled\n")) ; + +#ifndef NDEBUG + /* make sure column lengths are correct */ + for (col = 0 ; col < n_col ; col++) + { + p [col] = Col [col].length ; + } + for (row = 0 ; row < n_row ; row++) + { + rp = &A [Row [row].start] ; + rp_end = rp + Row [row].length ; + while (rp < rp_end) + { + p [*rp++]-- ; + } + } + for (col = 0 ; col < n_col ; col++) + { + ASSERT (p [col] == 0) ; + } + /* now p is all zero (different than when debugging is turned off) */ +#endif /* NDEBUG */ + + /* === Compute col pointers ========================================= */ + + /* col form of the matrix starts at A [0]. */ + /* Note, we may have a gap between the col form and the row */ + /* form if there were duplicate entries, if so, it will be */ + /* removed upon the first garbage collection */ + Col [0].start = 0 ; + p [0] = Col [0].start ; + for (col = 1 ; col < n_col ; col++) + { + /* note that the lengths here are for pruned columns, i.e. */ + /* no duplicate row indices will exist for these columns */ + Col [col].start = Col [col-1].start + Col [col-1].length ; + p [col] = Col [col].start ; + } + + /* === Re-create col form =========================================== */ + + for (row = 0 ; row < n_row ; row++) + { + rp = &A [Row [row].start] ; + rp_end = rp + Row [row].length ; + while (rp < rp_end) + { + A [(p [*rp++])++] = row ; + } + } + } + + /* === Done. Matrix is not (or no longer) jumbled ====================== */ + + return (TRUE) ; +} + + +/* ========================================================================== */ +/* === init_scoring ========================================================= */ +/* ========================================================================== */ + +/* + Kills dense or empty columns and rows, calculates an initial score for + each column, and places all columns in the degree lists. Not user-callable. +*/ + +PRIVATE void init_scoring +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows of A */ + int n_col, /* number of columns of A */ + Colamd_Row Row [], /* of size n_row+1 */ + Colamd_Col Col [], /* of size n_col+1 */ + int A [], /* column form and row form of A */ + int head [], /* of size n_col+1 */ + double knobs [COLAMD_KNOBS],/* parameters */ + int *p_n_row2, /* number of non-dense, non-empty rows */ + int *p_n_col2, /* number of non-dense, non-empty columns */ + int *p_max_deg /* maximum row degree */ +) +{ + /* === Local variables ================================================== */ + + int c ; /* a column index */ + int r, row ; /* a row index */ + int *cp ; /* a column pointer */ + int deg ; /* degree of a row or column */ + int *cp_end ; /* a pointer to the end of a column */ + int *new_cp ; /* new column pointer */ + int col_length ; /* length of pruned column */ + int score ; /* current column score */ + int n_col2 ; /* number of non-dense, non-empty columns */ + int n_row2 ; /* number of non-dense, non-empty rows */ + int dense_row_count ; /* remove rows with more entries than this */ + int dense_col_count ; /* remove cols with more entries than this */ + int min_score ; /* smallest column score */ + int max_deg ; /* maximum row degree */ + int next_col ; /* Used to add to degree list.*/ + +#ifndef NDEBUG + int debug_count ; /* debug only. */ +#endif /* NDEBUG */ + + /* === Extract knobs ==================================================== */ + + dense_row_count = MAX (0, MIN (knobs [COLAMD_DENSE_ROW] * n_col, n_col)) ; + dense_col_count = MAX (0, MIN (knobs [COLAMD_DENSE_COL] * n_row, n_row)) ; + DEBUG1 (("colamd: densecount: %d %d\n", dense_row_count, dense_col_count)) ; + max_deg = 0 ; + n_col2 = n_col ; + n_row2 = n_row ; + + /* === Kill empty columns =============================================== */ + + /* Put the empty columns at the end in their natural order, so that LU */ + /* factorization can proceed as far as possible. */ + for (c = n_col-1 ; c >= 0 ; c--) + { + deg = Col [c].length ; + if (deg == 0) + { + /* this is a empty column, kill and order it last */ + Col [c].shared2.order = --n_col2 ; + KILL_PRINCIPAL_COL (c) ; + } + } + DEBUG1 (("colamd: null columns killed: %d\n", n_col - n_col2)) ; + + /* === Kill dense columns =============================================== */ + + /* Put the dense columns at the end, in their natural order */ + for (c = n_col-1 ; c >= 0 ; c--) + { + /* skip any dead columns */ + if (COL_IS_DEAD (c)) + { + continue ; + } + deg = Col [c].length ; + if (deg > dense_col_count) + { + /* this is a dense column, kill and order it last */ + Col [c].shared2.order = --n_col2 ; + /* decrement the row degrees */ + cp = &A [Col [c].start] ; + cp_end = cp + Col [c].length ; + while (cp < cp_end) + { + Row [*cp++].shared1.degree-- ; + } + KILL_PRINCIPAL_COL (c) ; + } + } + DEBUG1 (("colamd: Dense and null columns killed: %d\n", n_col - n_col2)) ; + + /* === Kill dense and empty rows ======================================== */ + + for (r = 0 ; r < n_row ; r++) + { + deg = Row [r].shared1.degree ; + ASSERT (deg >= 0 && deg <= n_col) ; + if (deg > dense_row_count || deg == 0) + { + /* kill a dense or empty row */ + KILL_ROW (r) ; + --n_row2 ; + } + else + { + /* keep track of max degree of remaining rows */ + max_deg = MAX (max_deg, deg) ; + } + } + DEBUG1 (("colamd: Dense and null rows killed: %d\n", n_row - n_row2)) ; + + /* === Compute initial column scores ==================================== */ + + /* At this point the row degrees are accurate. They reflect the number */ + /* of "live" (non-dense) columns in each row. No empty rows exist. */ + /* Some "live" columns may contain only dead rows, however. These are */ + /* pruned in the code below. */ + + /* now find the initial matlab score for each column */ + for (c = n_col-1 ; c >= 0 ; c--) + { + /* skip dead column */ + if (COL_IS_DEAD (c)) + { + continue ; + } + score = 0 ; + cp = &A [Col [c].start] ; + new_cp = cp ; + cp_end = cp + Col [c].length ; + while (cp < cp_end) + { + /* get a row */ + row = *cp++ ; + /* skip if dead */ + if (ROW_IS_DEAD (row)) + { + continue ; + } + /* compact the column */ + *new_cp++ = row ; + /* add row's external degree */ + score += Row [row].shared1.degree - 1 ; + /* guard against integer overflow */ + score = MIN (score, n_col) ; + } + /* determine pruned column length */ + col_length = (int) (new_cp - &A [Col [c].start]) ; + if (col_length == 0) + { + /* a newly-made null column (all rows in this col are "dense" */ + /* and have already been killed) */ + DEBUG2 (("Newly null killed: %d\n", c)) ; + Col [c].shared2.order = --n_col2 ; + KILL_PRINCIPAL_COL (c) ; + } + else + { + /* set column length and set score */ + ASSERT (score >= 0) ; + ASSERT (score <= n_col) ; + Col [c].length = col_length ; + Col [c].shared2.score = score ; + } + } + DEBUG1 (("colamd: Dense, null, and newly-null columns killed: %d\n", + n_col-n_col2)) ; + + /* At this point, all empty rows and columns are dead. All live columns */ + /* are "clean" (containing no dead rows) and simplicial (no supercolumns */ + /* yet). Rows may contain dead columns, but all live rows contain at */ + /* least one live column. */ + +#ifndef NDEBUG + debug_structures (n_row, n_col, Row, Col, A, n_col2) ; +#endif /* NDEBUG */ + + /* === Initialize degree lists ========================================== */ + +#ifndef NDEBUG + debug_count = 0 ; +#endif /* NDEBUG */ + + /* clear the hash buckets */ + for (c = 0 ; c <= n_col ; c++) + { + head [c] = EMPTY ; + } + min_score = n_col ; + /* place in reverse order, so low column indices are at the front */ + /* of the lists. This is to encourage natural tie-breaking */ + for (c = n_col-1 ; c >= 0 ; c--) + { + /* only add principal columns to degree lists */ + if (COL_IS_ALIVE (c)) + { + DEBUG4 (("place %d score %d minscore %d ncol %d\n", + c, Col [c].shared2.score, min_score, n_col)) ; + + /* === Add columns score to DList =============================== */ + + score = Col [c].shared2.score ; + + ASSERT (min_score >= 0) ; + ASSERT (min_score <= n_col) ; + ASSERT (score >= 0) ; + ASSERT (score <= n_col) ; + ASSERT (head [score] >= EMPTY) ; + + /* now add this column to dList at proper score location */ + next_col = head [score] ; + Col [c].shared3.prev = EMPTY ; + Col [c].shared4.degree_next = next_col ; + + /* if there already was a column with the same score, set its */ + /* previous pointer to this new column */ + if (next_col != EMPTY) + { + Col [next_col].shared3.prev = c ; + } + head [score] = c ; + + /* see if this score is less than current min */ + min_score = MIN (min_score, score) ; + +#ifndef NDEBUG + debug_count++ ; +#endif /* NDEBUG */ + + } + } + +#ifndef NDEBUG + DEBUG1 (("colamd: Live cols %d out of %d, non-princ: %d\n", + debug_count, n_col, n_col-debug_count)) ; + ASSERT (debug_count == n_col2) ; + debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2, max_deg) ; +#endif /* NDEBUG */ + + /* === Return number of remaining columns, and max row degree =========== */ + + *p_n_col2 = n_col2 ; + *p_n_row2 = n_row2 ; + *p_max_deg = max_deg ; +} + + +/* ========================================================================== */ +/* === find_ordering ======================================================== */ +/* ========================================================================== */ + +/* + Order the principal columns of the supercolumn form of the matrix + (no supercolumns on input). Uses a minimum approximate column minimum + degree ordering method. Not user-callable. +*/ + +PRIVATE int find_ordering /* return the number of garbage collections */ +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows of A */ + int n_col, /* number of columns of A */ + int Alen, /* size of A, 2*nnz + n_col or larger */ + Colamd_Row Row [], /* of size n_row+1 */ + Colamd_Col Col [], /* of size n_col+1 */ + int A [], /* column form and row form of A */ + int head [], /* of size n_col+1 */ + int n_col2, /* Remaining columns to order */ + int max_deg, /* Maximum row degree */ + int pfree /* index of first free slot (2*nnz on entry) */ +) +{ + /* === Local variables ================================================== */ + + int k ; /* current pivot ordering step */ + int pivot_col ; /* current pivot column */ + int *cp ; /* a column pointer */ + int *rp ; /* a row pointer */ + int pivot_row ; /* current pivot row */ + int *new_cp ; /* modified column pointer */ + int *new_rp ; /* modified row pointer */ + int pivot_row_start ; /* pointer to start of pivot row */ + int pivot_row_degree ; /* number of columns in pivot row */ + int pivot_row_length ; /* number of supercolumns in pivot row */ + int pivot_col_score ; /* score of pivot column */ + int needed_memory ; /* free space needed for pivot row */ + int *cp_end ; /* pointer to the end of a column */ + int *rp_end ; /* pointer to the end of a row */ + int row ; /* a row index */ + int col ; /* a column index */ + int max_score ; /* maximum possible score */ + int cur_score ; /* score of current column */ + unsigned int hash ; /* hash value for supernode detection */ + int head_column ; /* head of hash bucket */ + int first_col ; /* first column in hash bucket */ + int tag_mark ; /* marker value for mark array */ + int row_mark ; /* Row [row].shared2.mark */ + int set_difference ; /* set difference size of row with pivot row */ + int min_score ; /* smallest column score */ + int col_thickness ; /* "thickness" (no. of columns in a supercol) */ + int max_mark ; /* maximum value of tag_mark */ + int pivot_col_thickness ; /* number of columns represented by pivot col */ + int prev_col ; /* Used by Dlist operations. */ + int next_col ; /* Used by Dlist operations. */ + int ngarbage ; /* number of garbage collections performed */ + +#ifndef NDEBUG + int debug_d ; /* debug loop counter */ + int debug_step = 0 ; /* debug loop counter */ +#endif /* NDEBUG */ + + /* === Initialization and clear mark ==================================== */ + + max_mark = INT_MAX - n_col ; /* INT_MAX defined in */ + tag_mark = clear_mark (n_row, Row) ; + min_score = 0 ; + ngarbage = 0 ; + DEBUG1 (("colamd: Ordering, n_col2=%d\n", n_col2)) ; + + /* === Order the columns ================================================ */ + + for (k = 0 ; k < n_col2 ; /* 'k' is incremented below */) + { + +#ifndef NDEBUG + if (debug_step % 100 == 0) + { + DEBUG2 (("\n... Step k: %d out of n_col2: %d\n", k, n_col2)) ; + } + else + { + DEBUG3 (("\n----------Step k: %d out of n_col2: %d\n", k, n_col2)) ; + } + debug_step++ ; + debug_deg_lists (n_row, n_col, Row, Col, head, + min_score, n_col2-k, max_deg) ; + debug_matrix (n_row, n_col, Row, Col, A) ; +#endif /* NDEBUG */ + + /* === Select pivot column, and order it ============================ */ + + /* make sure degree list isn't empty */ + ASSERT (min_score >= 0) ; + ASSERT (min_score <= n_col) ; + ASSERT (head [min_score] >= EMPTY) ; + +#ifndef NDEBUG + for (debug_d = 0 ; debug_d < min_score ; debug_d++) + { + ASSERT (head [debug_d] == EMPTY) ; + } +#endif /* NDEBUG */ + + /* get pivot column from head of minimum degree list */ + while (head [min_score] == EMPTY && min_score < n_col) + { + min_score++ ; + } + pivot_col = head [min_score] ; + ASSERT (pivot_col >= 0 && pivot_col <= n_col) ; + next_col = Col [pivot_col].shared4.degree_next ; + head [min_score] = next_col ; + if (next_col != EMPTY) + { + Col [next_col].shared3.prev = EMPTY ; + } + + ASSERT (COL_IS_ALIVE (pivot_col)) ; + DEBUG3 (("Pivot col: %d\n", pivot_col)) ; + + /* remember score for defrag check */ + pivot_col_score = Col [pivot_col].shared2.score ; + + /* the pivot column is the kth column in the pivot order */ + Col [pivot_col].shared2.order = k ; + + /* increment order count by column thickness */ + pivot_col_thickness = Col [pivot_col].shared1.thickness ; + k += pivot_col_thickness ; + ASSERT (pivot_col_thickness > 0) ; + + /* === Garbage_collection, if necessary ============================= */ + + needed_memory = MIN (pivot_col_score, n_col - k) ; + if (pfree + needed_memory >= Alen) + { + pfree = garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ; + ngarbage++ ; + /* after garbage collection we will have enough */ + ASSERT (pfree + needed_memory < Alen) ; + /* garbage collection has wiped out the Row[].shared2.mark array */ + tag_mark = clear_mark (n_row, Row) ; + +#ifndef NDEBUG + debug_matrix (n_row, n_col, Row, Col, A) ; +#endif /* NDEBUG */ + } + + /* === Compute pivot row pattern ==================================== */ + + /* get starting location for this new merged row */ + pivot_row_start = pfree ; + + /* initialize new row counts to zero */ + pivot_row_degree = 0 ; + + /* tag pivot column as having been visited so it isn't included */ + /* in merged pivot row */ + Col [pivot_col].shared1.thickness = -pivot_col_thickness ; + + /* pivot row is the union of all rows in the pivot column pattern */ + cp = &A [Col [pivot_col].start] ; + cp_end = cp + Col [pivot_col].length ; + while (cp < cp_end) + { + /* get a row */ + row = *cp++ ; + DEBUG4 (("Pivot col pattern %d %d\n", ROW_IS_ALIVE (row), row)) ; + /* skip if row is dead */ + if (ROW_IS_DEAD (row)) + { + continue ; + } + rp = &A [Row [row].start] ; + rp_end = rp + Row [row].length ; + while (rp < rp_end) + { + /* get a column */ + col = *rp++ ; + /* add the column, if alive and untagged */ + col_thickness = Col [col].shared1.thickness ; + if (col_thickness > 0 && COL_IS_ALIVE (col)) + { + /* tag column in pivot row */ + Col [col].shared1.thickness = -col_thickness ; + ASSERT (pfree < Alen) ; + /* place column in pivot row */ + A [pfree++] = col ; + pivot_row_degree += col_thickness ; + } + } + } + + /* clear tag on pivot column */ + Col [pivot_col].shared1.thickness = pivot_col_thickness ; + max_deg = MAX (max_deg, pivot_row_degree) ; + +#ifndef NDEBUG + DEBUG3 (("check2\n")) ; + debug_mark (n_row, Row, tag_mark, max_mark) ; +#endif /* NDEBUG */ + + /* === Kill all rows used to construct pivot row ==================== */ + + /* also kill pivot row, temporarily */ + cp = &A [Col [pivot_col].start] ; + cp_end = cp + Col [pivot_col].length ; + while (cp < cp_end) + { + /* may be killing an already dead row */ + row = *cp++ ; + DEBUG3 (("Kill row in pivot col: %d\n", row)) ; + KILL_ROW (row) ; + } + + /* === Select a row index to use as the new pivot row =============== */ + + pivot_row_length = pfree - pivot_row_start ; + if (pivot_row_length > 0) + { + /* pick the "pivot" row arbitrarily (first row in col) */ + pivot_row = A [Col [pivot_col].start] ; + DEBUG3 (("Pivotal row is %d\n", pivot_row)) ; + } + else + { + /* there is no pivot row, since it is of zero length */ + pivot_row = EMPTY ; + ASSERT (pivot_row_length == 0) ; + } + ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ; + + /* === Approximate degree computation =============================== */ + + /* Here begins the computation of the approximate degree. The column */ + /* score is the sum of the pivot row "length", plus the size of the */ + /* set differences of each row in the column minus the pattern of the */ + /* pivot row itself. The column ("thickness") itself is also */ + /* excluded from the column score (we thus use an approximate */ + /* external degree). */ + + /* The time taken by the following code (compute set differences, and */ + /* add them up) is proportional to the size of the data structure */ + /* being scanned - that is, the sum of the sizes of each column in */ + /* the pivot row. Thus, the amortized time to compute a column score */ + /* is proportional to the size of that column (where size, in this */ + /* context, is the column "length", or the number of row indices */ + /* in that column). The number of row indices in a column is */ + /* monotonically non-decreasing, from the length of the original */ + /* column on input to colamd. */ + + /* === Compute set differences ====================================== */ + + DEBUG3 (("** Computing set differences phase. **\n")) ; + + /* pivot row is currently dead - it will be revived later. */ + + DEBUG3 (("Pivot row: ")) ; + /* for each column in pivot row */ + rp = &A [pivot_row_start] ; + rp_end = rp + pivot_row_length ; + while (rp < rp_end) + { + col = *rp++ ; + ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; + DEBUG3 (("Col: %d\n", col)) ; + + /* clear tags used to construct pivot row pattern */ + col_thickness = -Col [col].shared1.thickness ; + ASSERT (col_thickness > 0) ; + Col [col].shared1.thickness = col_thickness ; + + /* === Remove column from degree list =========================== */ + + cur_score = Col [col].shared2.score ; + prev_col = Col [col].shared3.prev ; + next_col = Col [col].shared4.degree_next ; + ASSERT (cur_score >= 0) ; + ASSERT (cur_score <= n_col) ; + ASSERT (cur_score >= EMPTY) ; + if (prev_col == EMPTY) + { + head [cur_score] = next_col ; + } + else + { + Col [prev_col].shared4.degree_next = next_col ; + } + if (next_col != EMPTY) + { + Col [next_col].shared3.prev = prev_col ; + } + + /* === Scan the column ========================================== */ + + cp = &A [Col [col].start] ; + cp_end = cp + Col [col].length ; + while (cp < cp_end) + { + /* get a row */ + row = *cp++ ; + row_mark = Row [row].shared2.mark ; + /* skip if dead */ + if (ROW_IS_MARKED_DEAD (row_mark)) + { + continue ; + } + ASSERT (row != pivot_row) ; + set_difference = row_mark - tag_mark ; + /* check if the row has been seen yet */ + if (set_difference < 0) + { + ASSERT (Row [row].shared1.degree <= max_deg) ; + set_difference = Row [row].shared1.degree ; + } + /* subtract column thickness from this row's set difference */ + set_difference -= col_thickness ; + ASSERT (set_difference >= 0) ; + /* absorb this row if the set difference becomes zero */ + if (set_difference == 0) + { + DEBUG3 (("aggressive absorption. Row: %d\n", row)) ; + KILL_ROW (row) ; + } + else + { + /* save the new mark */ + Row [row].shared2.mark = set_difference + tag_mark ; + } + } + } + +#ifndef NDEBUG + debug_deg_lists (n_row, n_col, Row, Col, head, + min_score, n_col2-k-pivot_row_degree, max_deg) ; +#endif /* NDEBUG */ + + /* === Add up set differences for each column ======================= */ + + DEBUG3 (("** Adding set differences phase. **\n")) ; + + /* for each column in pivot row */ + rp = &A [pivot_row_start] ; + rp_end = rp + pivot_row_length ; + while (rp < rp_end) + { + /* get a column */ + col = *rp++ ; + ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; + hash = 0 ; + cur_score = 0 ; + cp = &A [Col [col].start] ; + /* compact the column */ + new_cp = cp ; + cp_end = cp + Col [col].length ; + + DEBUG4 (("Adding set diffs for Col: %d.\n", col)) ; + + while (cp < cp_end) + { + /* get a row */ + row = *cp++ ; + ASSERT(row >= 0 && row < n_row) ; + row_mark = Row [row].shared2.mark ; + /* skip if dead */ + if (ROW_IS_MARKED_DEAD (row_mark)) + { + continue ; + } + ASSERT (row_mark > tag_mark) ; + /* compact the column */ + *new_cp++ = row ; + /* compute hash function */ + hash += row ; + /* add set difference */ + cur_score += row_mark - tag_mark ; + /* integer overflow... */ + cur_score = MIN (cur_score, n_col) ; + } + + /* recompute the column's length */ + Col [col].length = (int) (new_cp - &A [Col [col].start]) ; + + /* === Further mass elimination ================================= */ + + if (Col [col].length == 0) + { + DEBUG4 (("further mass elimination. Col: %d\n", col)) ; + /* nothing left but the pivot row in this column */ + KILL_PRINCIPAL_COL (col) ; + pivot_row_degree -= Col [col].shared1.thickness ; + ASSERT (pivot_row_degree >= 0) ; + /* order it */ + Col [col].shared2.order = k ; + /* increment order count by column thickness */ + k += Col [col].shared1.thickness ; + } + else + { + /* === Prepare for supercolumn detection ==================== */ + + DEBUG4 (("Preparing supercol detection for Col: %d.\n", col)) ; + + /* save score so far */ + Col [col].shared2.score = cur_score ; + + /* add column to hash table, for supercolumn detection */ + hash %= n_col + 1 ; + + DEBUG4 ((" Hash = %d, n_col = %d.\n", hash, n_col)) ; + ASSERT (hash <= n_col) ; + + head_column = head [hash] ; + if (head_column > EMPTY) + { + /* degree list "hash" is non-empty, use prev (shared3) of */ + /* first column in degree list as head of hash bucket */ + first_col = Col [head_column].shared3.headhash ; + Col [head_column].shared3.headhash = col ; + } + else + { + /* degree list "hash" is empty, use head as hash bucket */ + first_col = - (head_column + 2) ; + head [hash] = - (col + 2) ; + } + Col [col].shared4.hash_next = first_col ; + + /* save hash function in Col [col].shared3.hash */ + Col [col].shared3.hash = (int) hash ; + ASSERT (COL_IS_ALIVE (col)) ; + } + } + + /* The approximate external column degree is now computed. */ + + /* === Supercolumn detection ======================================== */ + + DEBUG3 (("** Supercolumn detection phase. **\n")) ; + + detect_super_cols ( + +#ifndef NDEBUG + n_col, Row, +#endif /* NDEBUG */ + + Col, A, head, pivot_row_start, pivot_row_length) ; + + /* === Kill the pivotal column ====================================== */ + + KILL_PRINCIPAL_COL (pivot_col) ; + + /* === Clear mark =================================================== */ + + tag_mark += (max_deg + 1) ; + if (tag_mark >= max_mark) + { + DEBUG2 (("clearing tag_mark\n")) ; + tag_mark = clear_mark (n_row, Row) ; + } + +#ifndef NDEBUG + DEBUG3 (("check3\n")) ; + debug_mark (n_row, Row, tag_mark, max_mark) ; +#endif /* NDEBUG */ + + /* === Finalize the new pivot row, and column scores ================ */ + + DEBUG3 (("** Finalize scores phase. **\n")) ; + + /* for each column in pivot row */ + rp = &A [pivot_row_start] ; + /* compact the pivot row */ + new_rp = rp ; + rp_end = rp + pivot_row_length ; + while (rp < rp_end) + { + col = *rp++ ; + /* skip dead columns */ + if (COL_IS_DEAD (col)) + { + continue ; + } + *new_rp++ = col ; + /* add new pivot row to column */ + A [Col [col].start + (Col [col].length++)] = pivot_row ; + + /* retrieve score so far and add on pivot row's degree. */ + /* (we wait until here for this in case the pivot */ + /* row's degree was reduced due to mass elimination). */ + cur_score = Col [col].shared2.score + pivot_row_degree ; + + /* calculate the max possible score as the number of */ + /* external columns minus the 'k' value minus the */ + /* columns thickness */ + max_score = n_col - k - Col [col].shared1.thickness ; + + /* make the score the external degree of the union-of-rows */ + cur_score -= Col [col].shared1.thickness ; + + /* make sure score is less or equal than the max score */ + cur_score = MIN (cur_score, max_score) ; + ASSERT (cur_score >= 0) ; + + /* store updated score */ + Col [col].shared2.score = cur_score ; + + /* === Place column back in degree list ========================= */ + + ASSERT (min_score >= 0) ; + ASSERT (min_score <= n_col) ; + ASSERT (cur_score >= 0) ; + ASSERT (cur_score <= n_col) ; + ASSERT (head [cur_score] >= EMPTY) ; + next_col = head [cur_score] ; + Col [col].shared4.degree_next = next_col ; + Col [col].shared3.prev = EMPTY ; + if (next_col != EMPTY) + { + Col [next_col].shared3.prev = col ; + } + head [cur_score] = col ; + + /* see if this score is less than current min */ + min_score = MIN (min_score, cur_score) ; + + } + +#ifndef NDEBUG + debug_deg_lists (n_row, n_col, Row, Col, head, + min_score, n_col2-k, max_deg) ; +#endif /* NDEBUG */ + + /* === Resurrect the new pivot row ================================== */ + + if (pivot_row_degree > 0) + { + /* update pivot row length to reflect any cols that were killed */ + /* during super-col detection and mass elimination */ + Row [pivot_row].start = pivot_row_start ; + Row [pivot_row].length = (int) (new_rp - &A[pivot_row_start]) ; + Row [pivot_row].shared1.degree = pivot_row_degree ; + Row [pivot_row].shared2.mark = 0 ; + /* pivot row is no longer dead */ + } + } + + /* === All principal columns have now been ordered ====================== */ + + return (ngarbage) ; +} + + +/* ========================================================================== */ +/* === order_children ======================================================= */ +/* ========================================================================== */ + +/* + The find_ordering routine has ordered all of the principal columns (the + representatives of the supercolumns). The non-principal columns have not + yet been ordered. This routine orders those columns by walking up the + parent tree (a column is a child of the column which absorbed it). The + final permutation vector is then placed in p [0 ... n_col-1], with p [0] + being the first column, and p [n_col-1] being the last. It doesn't look + like it at first glance, but be assured that this routine takes time linear + in the number of columns. Although not immediately obvious, the time + taken by this routine is O (n_col), that is, linear in the number of + columns. Not user-callable. +*/ + +PRIVATE void order_children +( + /* === Parameters ======================================================= */ + + int n_col, /* number of columns of A */ + Colamd_Col Col [], /* of size n_col+1 */ + int p [] /* p [0 ... n_col-1] is the column permutation*/ +) +{ + /* === Local variables ================================================== */ + + int i ; /* loop counter for all columns */ + int c ; /* column index */ + int parent ; /* index of column's parent */ + int order ; /* column's order */ + + /* === Order each non-principal column ================================== */ + + for (i = 0 ; i < n_col ; i++) + { + /* find an un-ordered non-principal column */ + ASSERT (COL_IS_DEAD (i)) ; + if (!COL_IS_DEAD_PRINCIPAL (i) && Col [i].shared2.order == EMPTY) + { + parent = i ; + /* once found, find its principal parent */ + do + { + parent = Col [parent].shared1.parent ; + } while (!COL_IS_DEAD_PRINCIPAL (parent)) ; + + /* now, order all un-ordered non-principal columns along path */ + /* to this parent. collapse tree at the same time */ + c = i ; + /* get order of parent */ + order = Col [parent].shared2.order ; + + do + { + ASSERT (Col [c].shared2.order == EMPTY) ; + + /* order this column */ + Col [c].shared2.order = order++ ; + /* collaps tree */ + Col [c].shared1.parent = parent ; + + /* get immediate parent of this column */ + c = Col [c].shared1.parent ; + + /* continue until we hit an ordered column. There are */ + /* guarranteed not to be anymore unordered columns */ + /* above an ordered column */ + } while (Col [c].shared2.order == EMPTY) ; + + /* re-order the super_col parent to largest order for this group */ + Col [parent].shared2.order = order ; + } + } + + /* === Generate the permutation ========================================= */ + + for (c = 0 ; c < n_col ; c++) + { + p [Col [c].shared2.order] = c ; + } +} + + +/* ========================================================================== */ +/* === detect_super_cols ==================================================== */ +/* ========================================================================== */ + +/* + Detects supercolumns by finding matches between columns in the hash buckets. + Check amongst columns in the set A [row_start ... row_start + row_length-1]. + The columns under consideration are currently *not* in the degree lists, + and have already been placed in the hash buckets. + + The hash bucket for columns whose hash function is equal to h is stored + as follows: + + if head [h] is >= 0, then head [h] contains a degree list, so: + + head [h] is the first column in degree bucket h. + Col [head [h]].headhash gives the first column in hash bucket h. + + otherwise, the degree list is empty, and: + + -(head [h] + 2) is the first column in hash bucket h. + + For a column c in a hash bucket, Col [c].shared3.prev is NOT a "previous + column" pointer. Col [c].shared3.hash is used instead as the hash number + for that column. The value of Col [c].shared4.hash_next is the next column + in the same hash bucket. + + Assuming no, or "few" hash collisions, the time taken by this routine is + linear in the sum of the sizes (lengths) of each column whose score has + just been computed in the approximate degree computation. + Not user-callable. +*/ + +PRIVATE void detect_super_cols +( + /* === Parameters ======================================================= */ + +#ifndef NDEBUG + /* these two parameters are only needed when debugging is enabled: */ + int n_col, /* number of columns of A */ + Colamd_Row Row [], /* of size n_row+1 */ +#endif /* NDEBUG */ + + Colamd_Col Col [], /* of size n_col+1 */ + int A [], /* row indices of A */ + int head [], /* head of degree lists and hash buckets */ + int row_start, /* pointer to set of columns to check */ + int row_length /* number of columns to check */ +) +{ + /* === Local variables ================================================== */ + + int hash ; /* hash value for a column */ + int *rp ; /* pointer to a row */ + int c ; /* a column index */ + int super_c ; /* column index of the column to absorb into */ + int *cp1 ; /* column pointer for column super_c */ + int *cp2 ; /* column pointer for column c */ + int length ; /* length of column super_c */ + int prev_c ; /* column preceding c in hash bucket */ + int i ; /* loop counter */ + int *rp_end ; /* pointer to the end of the row */ + int col ; /* a column index in the row to check */ + int head_column ; /* first column in hash bucket or degree list */ + int first_col ; /* first column in hash bucket */ + + /* === Consider each column in the row ================================== */ + + rp = &A [row_start] ; + rp_end = rp + row_length ; + while (rp < rp_end) + { + col = *rp++ ; + if (COL_IS_DEAD (col)) + { + continue ; + } + + /* get hash number for this column */ + hash = Col [col].shared3.hash ; + ASSERT (hash <= n_col) ; + + /* === Get the first column in this hash bucket ===================== */ + + head_column = head [hash] ; + if (head_column > EMPTY) + { + first_col = Col [head_column].shared3.headhash ; + } + else + { + first_col = - (head_column + 2) ; + } + + /* === Consider each column in the hash bucket ====================== */ + + for (super_c = first_col ; super_c != EMPTY ; + super_c = Col [super_c].shared4.hash_next) + { + ASSERT (COL_IS_ALIVE (super_c)) ; + ASSERT (Col [super_c].shared3.hash == hash) ; + length = Col [super_c].length ; + + /* prev_c is the column preceding column c in the hash bucket */ + prev_c = super_c ; + + /* === Compare super_c with all columns after it ================ */ + + for (c = Col [super_c].shared4.hash_next ; + c != EMPTY ; c = Col [c].shared4.hash_next) + { + ASSERT (c != super_c) ; + ASSERT (COL_IS_ALIVE (c)) ; + ASSERT (Col [c].shared3.hash == hash) ; + + /* not identical if lengths or scores are different */ + if (Col [c].length != length || + Col [c].shared2.score != Col [super_c].shared2.score) + { + prev_c = c ; + continue ; + } + + /* compare the two columns */ + cp1 = &A [Col [super_c].start] ; + cp2 = &A [Col [c].start] ; + + for (i = 0 ; i < length ; i++) + { + /* the columns are "clean" (no dead rows) */ + ASSERT (ROW_IS_ALIVE (*cp1)) ; + ASSERT (ROW_IS_ALIVE (*cp2)) ; + /* row indices will same order for both supercols, */ + /* no gather scatter nessasary */ + if (*cp1++ != *cp2++) + { + break ; + } + } + + /* the two columns are different if the for-loop "broke" */ + if (i != length) + { + prev_c = c ; + continue ; + } + + /* === Got it! two columns are identical =================== */ + + ASSERT (Col [c].shared2.score == Col [super_c].shared2.score) ; + + Col [super_c].shared1.thickness += Col [c].shared1.thickness ; + Col [c].shared1.parent = super_c ; + KILL_NON_PRINCIPAL_COL (c) ; + /* order c later, in order_children() */ + Col [c].shared2.order = EMPTY ; + /* remove c from hash bucket */ + Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ; + } + } + + /* === Empty this hash bucket ======================================= */ + + if (head_column > EMPTY) + { + /* corresponding degree list "hash" is not empty */ + Col [head_column].shared3.headhash = EMPTY ; + } + else + { + /* corresponding degree list "hash" is empty */ + head [hash] = EMPTY ; + } + } +} + + +/* ========================================================================== */ +/* === garbage_collection =================================================== */ +/* ========================================================================== */ + +/* + Defragments and compacts columns and rows in the workspace A. Used when + all avaliable memory has been used while performing row merging. Returns + the index of the first free position in A, after garbage collection. The + time taken by this routine is linear is the size of the array A, which is + itself linear in the number of nonzeros in the input matrix. + Not user-callable. +*/ + +PRIVATE int garbage_collection /* returns the new value of pfree */ +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows */ + int n_col, /* number of columns */ + Colamd_Row Row [], /* row info */ + Colamd_Col Col [], /* column info */ + int A [], /* A [0 ... Alen-1] holds the matrix */ + int *pfree /* &A [0] ... pfree is in use */ +) +{ + /* === Local variables ================================================== */ + + int *psrc ; /* source pointer */ + int *pdest ; /* destination pointer */ + int j ; /* counter */ + int r ; /* a row index */ + int c ; /* a column index */ + int length ; /* length of a row or column */ + +#ifndef NDEBUG + int debug_rows ; + DEBUG2 (("Defrag..\n")) ; + for (psrc = &A[0] ; psrc < pfree ; psrc++) ASSERT (*psrc >= 0) ; + debug_rows = 0 ; +#endif /* NDEBUG */ + + /* === Defragment the columns =========================================== */ + + pdest = &A[0] ; + for (c = 0 ; c < n_col ; c++) + { + if (COL_IS_ALIVE (c)) + { + psrc = &A [Col [c].start] ; + + /* move and compact the column */ + ASSERT (pdest <= psrc) ; + Col [c].start = (int) (pdest - &A [0]) ; + length = Col [c].length ; + for (j = 0 ; j < length ; j++) + { + r = *psrc++ ; + if (ROW_IS_ALIVE (r)) + { + *pdest++ = r ; + } + } + Col [c].length = (int) (pdest - &A [Col [c].start]) ; + } + } + + /* === Prepare to defragment the rows =================================== */ + + for (r = 0 ; r < n_row ; r++) + { + if (ROW_IS_ALIVE (r)) + { + if (Row [r].length == 0) + { + /* this row is of zero length. cannot compact it, so kill it */ + DEBUG3 (("Defrag row kill\n")) ; + KILL_ROW (r) ; + } + else + { + /* save first column index in Row [r].shared2.first_column */ + psrc = &A [Row [r].start] ; + Row [r].shared2.first_column = *psrc ; + ASSERT (ROW_IS_ALIVE (r)) ; + /* flag the start of the row with the one's complement of row */ + *psrc = ONES_COMPLEMENT (r) ; + +#ifndef NDEBUG + debug_rows++ ; +#endif /* NDEBUG */ + + } + } + } + + /* === Defragment the rows ============================================== */ + + psrc = pdest ; + while (psrc < pfree) + { + /* find a negative number ... the start of a row */ + if (*psrc++ < 0) + { + psrc-- ; + /* get the row index */ + r = ONES_COMPLEMENT (*psrc) ; + ASSERT (r >= 0 && r < n_row) ; + /* restore first column index */ + *psrc = Row [r].shared2.first_column ; + ASSERT (ROW_IS_ALIVE (r)) ; + + /* move and compact the row */ + ASSERT (pdest <= psrc) ; + Row [r].start = (int) (pdest - &A [0]) ; + length = Row [r].length ; + for (j = 0 ; j < length ; j++) + { + c = *psrc++ ; + if (COL_IS_ALIVE (c)) + { + *pdest++ = c ; + } + } + Row [r].length = (int) (pdest - &A [Row [r].start]) ; + +#ifndef NDEBUG + debug_rows-- ; +#endif /* NDEBUG */ + + } + } + /* ensure we found all the rows */ + ASSERT (debug_rows == 0) ; + + /* === Return the new value of pfree ==================================== */ + + return ((int) (pdest - &A [0])) ; +} + + +/* ========================================================================== */ +/* === clear_mark =========================================================== */ +/* ========================================================================== */ + +/* + Clears the Row [].shared2.mark array, and returns the new tag_mark. + Return value is the new tag_mark. Not user-callable. +*/ + +PRIVATE int clear_mark /* return the new value for tag_mark */ +( + /* === Parameters ======================================================= */ + + int n_row, /* number of rows in A */ + Colamd_Row Row [] /* Row [0 ... n_row-1].shared2.mark is set to zero */ +) +{ + /* === Local variables ================================================== */ + + int r ; + + for (r = 0 ; r < n_row ; r++) + { + if (ROW_IS_ALIVE (r)) + { + Row [r].shared2.mark = 0 ; + } + } + return (1) ; +} + + +/* ========================================================================== */ +/* === print_report ========================================================= */ +/* ========================================================================== */ + +PRIVATE void print_report +( + char *method, + int stats [COLAMD_STATS] +) +{ + + int i1, i2, i3 ; + + if (!stats) + { + PRINTF ("%s: No statistics available.\n", method) ; + return ; + } + + i1 = stats [COLAMD_INFO1] ; + i2 = stats [COLAMD_INFO2] ; + i3 = stats [COLAMD_INFO3] ; + + if (stats [COLAMD_STATUS] >= 0) + { + PRINTF ("%s: OK. ", method) ; + } + else + { + PRINTF ("%s: ERROR. ", method) ; + } + + switch (stats [COLAMD_STATUS]) + { + + case COLAMD_OK_BUT_JUMBLED: + + PRINTF ("Matrix has unsorted or duplicate row indices.\n") ; + + PRINTF ("%s: number of duplicate or out-of-order row indices: %d\n", + method, i3) ; + + PRINTF ("%s: last seen duplicate or out-of-order row index: %d\n", + method, INDEX (i2)) ; + + PRINTF ("%s: last seen in column: %d", + method, INDEX (i1)) ; + + /* no break - fall through to next case instead */ + + case COLAMD_OK: + + PRINTF ("\n") ; + + PRINTF ("%s: number of dense or empty rows ignored: %d\n", + method, stats [COLAMD_DENSE_ROW]) ; + + PRINTF ("%s: number of dense or empty columns ignored: %d\n", + method, stats [COLAMD_DENSE_COL]) ; + + PRINTF ("%s: number of garbage collections performed: %d\n", + method, stats [COLAMD_DEFRAG_COUNT]) ; + break ; + + case COLAMD_ERROR_A_not_present: + + PRINTF ("Array A (row indices of matrix) not present.\n") ; + break ; + + case COLAMD_ERROR_p_not_present: + + PRINTF ("Array p (column pointers for matrix) not present.\n") ; + break ; + + case COLAMD_ERROR_nrow_negative: + + PRINTF ("Invalid number of rows (%d).\n", i1) ; + break ; + + case COLAMD_ERROR_ncol_negative: + + PRINTF ("Invalid number of columns (%d).\n", i1) ; + break ; + + case COLAMD_ERROR_nnz_negative: + + PRINTF ("Invalid number of nonzero entries (%d).\n", i1) ; + break ; + + case COLAMD_ERROR_p0_nonzero: + + PRINTF ("Invalid column pointer, p [0] = %d, must be zero.\n", i1) ; + break ; + + case COLAMD_ERROR_A_too_small: + + PRINTF ("Array A too small.\n") ; + PRINTF (" Need Alen >= %d, but given only Alen = %d.\n", + i1, i2) ; + break ; + + case COLAMD_ERROR_col_length_negative: + + PRINTF + ("Column %d has a negative number of nonzero entries (%d).\n", + INDEX (i1), i2) ; + break ; + + case COLAMD_ERROR_row_index_out_of_bounds: + + PRINTF + ("Row index (row %d) out of bounds (%d to %d) in column %d.\n", + INDEX (i2), INDEX (0), INDEX (i3-1), INDEX (i1)) ; + break ; + + case COLAMD_ERROR_out_of_memory: + + PRINTF ("Out of memory.\n") ; + break ; + + case COLAMD_ERROR_internal_error: + + /* if this happens, there is a bug in the code */ + PRINTF + ("Internal error! Please contact authors (davis@cise.ufl.edu).\n") ; + break ; + } +} + + + + +/* ========================================================================== */ +/* === colamd debugging routines ============================================ */ +/* ========================================================================== */ + +/* When debugging is disabled, the remainder of this file is ignored. */ + +#ifndef NDEBUG + + +/* ========================================================================== */ +/* === debug_structures ===================================================== */ +/* ========================================================================== */ + +/* + At this point, all empty rows and columns are dead. All live columns + are "clean" (containing no dead rows) and simplicial (no supercolumns + yet). Rows may contain dead columns, but all live rows contain at + least one live column. +*/ + +PRIVATE void debug_structures +( + /* === Parameters ======================================================= */ + + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [], + int n_col2 +) +{ + /* === Local variables ================================================== */ + + int i ; + int c ; + int *cp ; + int *cp_end ; + int len ; + int score ; + int r ; + int *rp ; + int *rp_end ; + int deg ; + + /* === Check A, Row, and Col ============================================ */ + + for (c = 0 ; c < n_col ; c++) + { + if (COL_IS_ALIVE (c)) + { + len = Col [c].length ; + score = Col [c].shared2.score ; + DEBUG4 (("initial live col %5d %5d %5d\n", c, len, score)) ; + ASSERT (len > 0) ; + ASSERT (score >= 0) ; + ASSERT (Col [c].shared1.thickness == 1) ; + cp = &A [Col [c].start] ; + cp_end = cp + len ; + while (cp < cp_end) + { + r = *cp++ ; + ASSERT (ROW_IS_ALIVE (r)) ; + } + } + else + { + i = Col [c].shared2.order ; + ASSERT (i >= n_col2 && i < n_col) ; + } + } + + for (r = 0 ; r < n_row ; r++) + { + if (ROW_IS_ALIVE (r)) + { + i = 0 ; + len = Row [r].length ; + deg = Row [r].shared1.degree ; + ASSERT (len > 0) ; + ASSERT (deg > 0) ; + rp = &A [Row [r].start] ; + rp_end = rp + len ; + while (rp < rp_end) + { + c = *rp++ ; + if (COL_IS_ALIVE (c)) + { + i++ ; + } + } + ASSERT (i > 0) ; + } + } +} + + +/* ========================================================================== */ +/* === debug_deg_lists ====================================================== */ +/* ========================================================================== */ + +/* + Prints the contents of the degree lists. Counts the number of columns + in the degree list and compares it to the total it should have. Also + checks the row degrees. +*/ + +PRIVATE void debug_deg_lists +( + /* === Parameters ======================================================= */ + + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int head [], + int min_score, + int should, + int max_deg +) +{ + /* === Local variables ================================================== */ + + int deg ; + int col ; + int have ; + int row ; + + /* === Check the degree lists =========================================== */ + + if (n_col > 10000 && colamd_debug <= 0) + { + return ; + } + have = 0 ; + DEBUG4 (("Degree lists: %d\n", min_score)) ; + for (deg = 0 ; deg <= n_col ; deg++) + { + col = head [deg] ; + if (col == EMPTY) + { + continue ; + } + DEBUG4 (("%d:", deg)) ; + while (col != EMPTY) + { + DEBUG4 ((" %d", col)) ; + have += Col [col].shared1.thickness ; + ASSERT (COL_IS_ALIVE (col)) ; + col = Col [col].shared4.degree_next ; + } + DEBUG4 (("\n")) ; + } + DEBUG4 (("should %d have %d\n", should, have)) ; + ASSERT (should == have) ; + + /* === Check the row degrees ============================================ */ + + if (n_row > 10000 && colamd_debug <= 0) + { + return ; + } + for (row = 0 ; row < n_row ; row++) + { + if (ROW_IS_ALIVE (row)) + { + ASSERT (Row [row].shared1.degree <= max_deg) ; + } + } +} + + +/* ========================================================================== */ +/* === debug_mark =========================================================== */ +/* ========================================================================== */ + +/* + Ensures that the tag_mark is less that the maximum and also ensures that + each entry in the mark array is less than the tag mark. +*/ + +PRIVATE void debug_mark +( + /* === Parameters ======================================================= */ + + int n_row, + Colamd_Row Row [], + int tag_mark, + int max_mark +) +{ + /* === Local variables ================================================== */ + + int r ; + + /* === Check the Row marks ============================================== */ + + ASSERT (tag_mark > 0 && tag_mark <= max_mark) ; + if (n_row > 10000 && colamd_debug <= 0) + { + return ; + } + for (r = 0 ; r < n_row ; r++) + { + ASSERT (Row [r].shared2.mark < tag_mark) ; + } +} + + +/* ========================================================================== */ +/* === debug_matrix ========================================================= */ +/* ========================================================================== */ + +/* + Prints out the contents of the columns and the rows. +*/ + +PRIVATE void debug_matrix +( + /* === Parameters ======================================================= */ + + int n_row, + int n_col, + Colamd_Row Row [], + Colamd_Col Col [], + int A [] +) +{ + /* === Local variables ================================================== */ + + int r ; + int c ; + int *rp ; + int *rp_end ; + int *cp ; + int *cp_end ; + + /* === Dump the rows and columns of the matrix ========================== */ + + if (colamd_debug < 3) + { + return ; + } + DEBUG3 (("DUMP MATRIX:\n")) ; + for (r = 0 ; r < n_row ; r++) + { + DEBUG3 (("Row %d alive? %d\n", r, ROW_IS_ALIVE (r))) ; + if (ROW_IS_DEAD (r)) + { + continue ; + } + DEBUG3 (("start %d length %d degree %d\n", + Row [r].start, Row [r].length, Row [r].shared1.degree)) ; + rp = &A [Row [r].start] ; + rp_end = rp + Row [r].length ; + while (rp < rp_end) + { + c = *rp++ ; + DEBUG4 ((" %d col %d\n", COL_IS_ALIVE (c), c)) ; + } + } + + for (c = 0 ; c < n_col ; c++) + { + DEBUG3 (("Col %d alive? %d\n", c, COL_IS_ALIVE (c))) ; + if (COL_IS_DEAD (c)) + { + continue ; + } + DEBUG3 (("start %d length %d shared1 %d shared2 %d\n", + Col [c].start, Col [c].length, + Col [c].shared1.thickness, Col [c].shared2.score)) ; + cp = &A [Col [c].start] ; + cp_end = cp + Col [c].length ; + while (cp < cp_end) + { + r = *cp++ ; + DEBUG4 ((" %d row %d\n", ROW_IS_ALIVE (r), r)) ; + } + } +} + +PRIVATE void colamd_get_debug +( + char *method +) +{ + colamd_debug = 0 ; /* no debug printing */ + + /* get "D" environment variable, which gives the debug printing level */ + if (getenv ("D")) + { + colamd_debug = atoi (getenv ("D")) ; + } + + DEBUG0 (("%s: debug version, D = %d (THIS WILL BE SLOW!)\n", + method, colamd_debug)) ; +} + +#endif /* NDEBUG */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/colamd.h b/thirdparty/superlu/SuperLU_4.1/SRC/colamd.h new file mode 100644 index 0000000..aacbd3f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/colamd.h @@ -0,0 +1,249 @@ +/*! @file colamd.h + \brief Colamd prototypes and definitions + +
     
    +    ==========================================================================
    +    === colamd/symamd prototypes and definitions =============================
    +    ==========================================================================
    +
    +    You must include this file (colamd.h) in any routine that uses colamd,
    +    symamd, or the related macros and definitions.
    +
    +    Authors:
    +
    +	The authors of the code itself are Stefan I. Larimore and Timothy A.
    +	Davis (davis@cise.ufl.edu), University of Florida.  The algorithm was
    +	developed in collaboration with John Gilbert, Xerox PARC, and Esmond
    +	Ng, Oak Ridge National Laboratory.
    +
    +    Date:
    +
    +	September 8, 2003.  Version 2.3.
    +
    +    Acknowledgements:
    +
    +	This work was supported by the National Science Foundation, under
    +	grants DMS-9504974 and DMS-9803599.
    +
    +    Notice:
    +
    +	Copyright (c) 1998-2003 by the University of Florida.
    +	All Rights Reserved.
    +
    +	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    +	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    +
    +	Permission is hereby granted to use, copy, modify, and/or distribute
    +	this program, provided that the Copyright, this License, and the
    +	Availability of the original version is retained on all copies and made
    +	accessible to the end-user of any code or package that includes COLAMD
    +	or any modified version of COLAMD. 
    +
    +    Availability:
    +
    +	The colamd/symamd library is available at
    +
    +	    http://www.cise.ufl.edu/research/sparse/colamd/
    +
    +	This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.h
    +	file.  It is required by the colamd.c, colamdmex.c, and symamdmex.c
    +	files, and by any C code that calls the routines whose prototypes are
    +	listed below, or that uses the colamd/symamd definitions listed below.
    + 
    +*/ + +#ifndef COLAMD_H +#define COLAMD_H + +/* ========================================================================== */ +/* === Include files ======================================================== */ +/* ========================================================================== */ + +#include + +/* ========================================================================== */ +/* === Knob and statistics definitions ====================================== */ +/* ========================================================================== */ + +/* size of the knobs [ ] array. Only knobs [0..1] are currently used. */ +#define COLAMD_KNOBS 20 + +/* number of output statistics. Only stats [0..6] are currently used. */ +#define COLAMD_STATS 20 + +/* knobs [0] and stats [0]: dense row knob and output statistic. */ +#define COLAMD_DENSE_ROW 0 + +/* knobs [1] and stats [1]: dense column knob and output statistic. */ +#define COLAMD_DENSE_COL 1 + +/* stats [2]: memory defragmentation count output statistic */ +#define COLAMD_DEFRAG_COUNT 2 + +/* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */ +#define COLAMD_STATUS 3 + +/* stats [4..6]: error info, or info on jumbled columns */ +#define COLAMD_INFO1 4 +#define COLAMD_INFO2 5 +#define COLAMD_INFO3 6 + +/* error codes returned in stats [3]: */ +#define COLAMD_OK (0) +#define COLAMD_OK_BUT_JUMBLED (1) +#define COLAMD_ERROR_A_not_present (-1) +#define COLAMD_ERROR_p_not_present (-2) +#define COLAMD_ERROR_nrow_negative (-3) +#define COLAMD_ERROR_ncol_negative (-4) +#define COLAMD_ERROR_nnz_negative (-5) +#define COLAMD_ERROR_p0_nonzero (-6) +#define COLAMD_ERROR_A_too_small (-7) +#define COLAMD_ERROR_col_length_negative (-8) +#define COLAMD_ERROR_row_index_out_of_bounds (-9) +#define COLAMD_ERROR_out_of_memory (-10) +#define COLAMD_ERROR_internal_error (-999) + +/* ========================================================================== */ +/* === Row and Column structures ============================================ */ +/* ========================================================================== */ + +/* User code that makes use of the colamd/symamd routines need not directly */ +/* reference these structures. They are used only for the COLAMD_RECOMMENDED */ +/* macro. */ + +typedef struct Colamd_Col_struct +{ + int start ; /* index for A of first row in this column, or DEAD */ + /* if column is dead */ + int length ; /* number of rows in this column */ + union + { + int thickness ; /* number of original columns represented by this */ + /* col, if the column is alive */ + int parent ; /* parent in parent tree super-column structure, if */ + /* the column is dead */ + } shared1 ; + union + { + int score ; /* the score used to maintain heap, if col is alive */ + int order ; /* pivot ordering of this column, if col is dead */ + } shared2 ; + union + { + int headhash ; /* head of a hash bucket, if col is at the head of */ + /* a degree list */ + int hash ; /* hash value, if col is not in a degree list */ + int prev ; /* previous column in degree list, if col is in a */ + /* degree list (but not at the head of a degree list) */ + } shared3 ; + union + { + int degree_next ; /* next column, if col is in a degree list */ + int hash_next ; /* next column, if col is in a hash list */ + } shared4 ; + +} Colamd_Col ; + +typedef struct Colamd_Row_struct +{ + int start ; /* index for A of first col in this row */ + int length ; /* number of principal columns in this row */ + union + { + int degree ; /* number of principal & non-principal columns in row */ + int p ; /* used as a row pointer in init_rows_cols () */ + } shared1 ; + union + { + int mark ; /* for computing set differences and marking dead rows*/ + int first_column ;/* first column in row (used in garbage collection) */ + } shared2 ; + +} Colamd_Row ; + +/* ========================================================================== */ +/* === Colamd recommended memory size ======================================= */ +/* ========================================================================== */ + +/* + The recommended length Alen of the array A passed to colamd is given by + the COLAMD_RECOMMENDED (nnz, n_row, n_col) macro. It returns -1 if any + argument is negative. 2*nnz space is required for the row and column + indices of the matrix. COLAMD_C (n_col) + COLAMD_R (n_row) space is + required for the Col and Row arrays, respectively, which are internal to + colamd. An additional n_col space is the minimal amount of "elbow room", + and nnz/5 more space is recommended for run time efficiency. + + This macro is not needed when using symamd. + + Explicit typecast to int added Sept. 23, 2002, COLAMD version 2.2, to avoid + gcc -pedantic warning messages. +*/ + +#define COLAMD_C(n_col) ((int) (((n_col) + 1) * sizeof (Colamd_Col) / sizeof (int))) +#define COLAMD_R(n_row) ((int) (((n_row) + 1) * sizeof (Colamd_Row) / sizeof (int))) + +#define COLAMD_RECOMMENDED(nnz, n_row, n_col) \ +( \ +((nnz) < 0 || (n_row) < 0 || (n_col) < 0) \ +? \ + (-1) \ +: \ + (2 * (nnz) + COLAMD_C (n_col) + COLAMD_R (n_row) + (n_col) + ((nnz) / 5)) \ +) + +/* ========================================================================== */ +/* === Prototypes of user-callable routines ================================= */ +/* ========================================================================== */ + +int colamd_recommended /* returns recommended value of Alen, */ + /* or (-1) if input arguments are erroneous */ +( + int nnz, /* nonzeros in A */ + int n_row, /* number of rows in A */ + int n_col /* number of columns in A */ +) ; + +void colamd_set_defaults /* sets default parameters */ +( /* knobs argument is modified on output */ + double knobs [COLAMD_KNOBS] /* parameter settings for colamd */ +) ; + +int colamd /* returns (1) if successful, (0) otherwise*/ +( /* A and p arguments are modified on output */ + int n_row, /* number of rows in A */ + int n_col, /* number of columns in A */ + int Alen, /* size of the array A */ + int A [], /* row indices of A, of size Alen */ + int p [], /* column pointers of A, of size n_col+1 */ + double knobs [COLAMD_KNOBS],/* parameter settings for colamd */ + int stats [COLAMD_STATS] /* colamd output statistics and error codes */ +) ; + +int symamd /* return (1) if OK, (0) otherwise */ +( + int n, /* number of rows and columns of A */ + int A [], /* row indices of A */ + int p [], /* column pointers of A */ + int perm [], /* output permutation, size n_col+1 */ + double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ + int stats [COLAMD_STATS], /* output statistics and error codes */ + void * (*allocate) (size_t, size_t), + /* pointer to calloc (ANSI C) or */ + /* mxCalloc (for MATLAB mexFunction) */ + void (*release) (void *) + /* pointer to free (ANSI C) or */ + /* mxFree (for MATLAB mexFunction) */ +) ; + +void colamd_report +( + int stats [COLAMD_STATS] +) ; + +void symamd_report +( + int stats [COLAMD_STATS] +) ; + +#endif /* COLAMD_H */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_bmod.c new file mode 100644 index 0000000..93dc4ba --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_bmod.c @@ -0,0 +1,487 @@ + +/*! @file cpanel_bmod.c + * \brief Performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ +/* + +*/ + +#include +#include +#include "slu_cdefs.h" + +/* + * Function prototypes + */ +void clsolve(int, int, complex *, complex *); +void cmatvec(int, int, int, complex *, complex *, complex *); +extern void ccheck_tempv(); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *    Performs numeric block updates (sup-panel) in topological order.
    + *    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + *    Special processing on the supernodal portion of L\U[*,j]
    + *
    + *    Before entering this routine, the original nonzeros in the panel 
    + *    were already copied into the spa[m,w].
    + *
    + *    Updated/Output parameters-
    + *    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    + *    collectively in the m-by-w vector dense[*]. 
    + * 
    + */ + +void +cpanel_bmod ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + const int nseg, /* in */ + complex *dense, /* out, of size n by w */ + complex *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in, of size n by w */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + complex alpha, beta; +#endif + + register int k, ksub; + int fsupc, nsupc, nsupr, nrow; + int krep, krep_ind; + complex ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int segsze; + int block_nrow; /* no of rows in a block row */ + register int lptr; /* Points to the row subscripts of a supernode */ + int kfnz, irow, no_zeros; + register int isub, isub1, i; + register int jj; /* Index through each column in the panel */ + int *xsup, *supno; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + int *repfnz_col; /* repfnz[] for a column in the panel */ + complex *dense_col; /* dense[] for a column in the panel */ + complex *tempv1; /* Used in 1-D update */ + complex *TriTmp, *MatvecTmp; /* used in 2-D update */ + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + complex comp_temp, comp_temp1; + register int ldaTmp; + register int r_ind, r_hi; + static int first = 1, maxsuper, rowblk, colblk; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + if ( first ) { + maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ); + rowblk = sp_ienv(4); + colblk = sp_ienv(5); + first = 0; + } + ldaTmp = maxsuper + rowblk; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { /* for each updating supernode */ + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in a supernode + * nsupr = no of rows in a supernode + */ + krep = segrep[k--]; + fsupc = xsup[supno[krep]]; + nsupc = krep - fsupc + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nrow = nsupr - nsupc; + lptr = xlsub[fsupc]; + krep_ind = lptr + nsupc - 1; + + repfnz_col = repfnz; + dense_col = dense; + + if ( nsupc >= colblk && nrow > rowblk ) { /* 2-D block update */ + + TriTmp = tempv; + + /* Sequence through each column in panel -- triangular solves */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp ) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += 4 * segsze * (segsze - 1); + ops[GEMV] += 8 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + c_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + cc_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + c_sub(&ukj1, &ukj1, &comp_temp); + + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; luptr2++; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } + + } else { /* segsze >= 4 */ + + /* Copy U[*,j] segment from dense[*] to TriTmp[*], which + holds the result of triangular solves. */ + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + TriTmp[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#else + ctrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#endif +#else + clsolve ( nsupr, segsze, &lusup[luptr], TriTmp ); +#endif + + + } /* else ... */ + + } /* for jj ... end tri-solves */ + + /* Block row updates; push all the way into dense[*] block */ + for ( r_ind = 0; r_ind < nrow; r_ind += rowblk ) { + + r_hi = SUPERLU_MIN(nrow, r_ind + rowblk); + block_nrow = SUPERLU_MIN(rowblk, r_hi - r_ind); + luptr = xlusup[fsupc] + nsupc + r_ind; + isub1 = lptr + nsupc + r_ind; + + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + /* Sequence through each column in panel -- matrix-vector */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + /* Perform a block update, and scatter the result of + matrix-vector to dense[]. */ + no_zeros = kfnz - fsupc; + luptr1 = luptr + nsupr * no_zeros; + MatvecTmp = &TriTmp[maxsuper]; + +#ifdef USE_VENDOR_BLAS + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV(ftcs2, &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#else + cgemv_("N", &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#endif +#else + cmatvec(nsupr, block_nrow, segsze, &lusup[luptr1], + TriTmp, MatvecTmp); +#endif + + /* Scatter MatvecTmp[*] into SPA dense[*] temporarily + * such that MatvecTmp[*] can be re-used for the + * the next blok row update. dense[] will be copied into + * global store after the whole panel has been finished. + */ + isub = isub1; + for (i = 0; i < block_nrow; i++) { + irow = lsub[isub]; + c_sub(&dense_col[irow], &dense_col[irow], + &MatvecTmp[i]); + MatvecTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } /* for each block row ... */ + + /* Scatter the triangular solves into SPA dense[*] */ + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = TriTmp[i]; + TriTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } else { /* 1-D block modification */ + + + /* Sequence through each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += 4 * segsze * (segsze - 1); + ops[GEMV] += 8 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + c_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + cc_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + c_sub(&ukj1, &ukj1, &comp_temp); + + cc_mult(&comp_temp, &ukj1, &lusup[luptr1]); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; ++luptr2; + cc_mult(&comp_temp, &ukj, &lusup[luptr]); + cc_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + cc_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + c_add(&comp_temp, &comp_temp, &comp_temp1); + c_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } + + } else { /* segsze >= 4 */ + /* + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense[]. + */ + no_zeros = kfnz - fsupc; + + /* Copy U[*,j] segment from dense[*] to tempv[*]: + * The result of triangular solve is in tempv[*]; + * The result of matrix vector update is in dense_col[*] + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + tempv[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + ctrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + cgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + clsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + cmatvec (nsupr, nrow, segsze, &lusup[luptr], tempv, tempv1); +#endif + + /* Scatter tempv[*] into SPA dense[*] temporarily, such + * that tempv[*] can be used for the triangular solve of + * the next column of the panel. They will be copied into + * ucol[*] after the whole panel has been finished. + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = tempv[i]; + tempv[i] = zero; + isub++; + } + + /* Scatter the update from tempv1[*] into SPA dense[*] */ + /* Start dense rectangular L */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + c_sub(&dense_col[irow], &dense_col[irow], &tempv1[i]); + tempv1[i] = zero; + ++isub; + } + + } /* else segsze>=4 ... */ + + } /* for each column in the panel... */ + + } /* else 1-D update ... */ + + } /* for each updating supernode ... */ + +} + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_dfs.c new file mode 100644 index 0000000..57a603e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cpanel_dfs.c @@ -0,0 +1,254 @@ + +/*! @file cpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel. 
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a 
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ + +void +cpanel_dfs ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + complex *dense, /* out */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *xprune, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + NCPformat *Astore; + complex *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + complex *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/cpivotL.c new file mode 100644 index 0000000..a14ea72 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cpivotL.c @@ -0,0 +1,185 @@ + +/*! @file cpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include +#include "slu_cdefs.h" + +#undef DEBUG + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *           pivot row = k;
    + *       ELSE IF abs(A_jj) >= thresh THEN
    + *           pivot row = j;
    + *       ELSE
    + *           pivot row = m;
    + * 
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0      success;
    + *                 i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +cpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int *iperm_r, /* in - inverse of perm_r */ + int *iperm_c, /* in - used to find diagonal of Pc*A*Pc' */ + int *pivrow, /* out */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + complex one = {1.0, 0.0}; + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + int pivptr, old_pivptr, diag, diagind; + float pivmax, rtemp, thresh; + complex temp; + complex *lu_sup_ptr; + complex *lu_col_ptr; + int *lsub_ptr; + int isub, icol, k, itemp; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + /* Initialize pointers */ + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + +#ifdef DEBUG +if ( jcol == MIN_COL ) { + printf("Before cdiv: col %d\n", jcol); + for (k = nsupc; k < nsupr; k++) + printf(" lu[%d] %f\n", lsub_ptr[k], lu_col_ptr[k]); +} +#endif + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + if ( *usepr ) *pivrow = iperm_r[jcol]; + diagind = iperm_c[jcol]; + pivmax = 0.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + for (isub = nsupc; isub < nsupr; ++isub) { + rtemp = c_abs1 (&lu_col_ptr[isub]); + if ( rtemp > pivmax ) { + pivmax = rtemp; + pivptr = isub; + } + if ( *usepr && lsub_ptr[isub] == *pivrow ) old_pivptr = isub; + if ( lsub_ptr[isub] == diagind ) diag = isub; + } + + /* Test for singularity */ + if ( pivmax == 0.0 ) { +#if 1 + *pivrow = lsub_ptr[pivptr]; + perm_r[*pivrow] = jcol; +#else + perm_r[diagind] = jcol; +#endif + *usepr = 0; + return (jcol+1); + } + + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + rtemp = c_abs1 (&lu_col_ptr[old_pivptr]); + if ( rtemp != 0.0 && rtemp >= thresh ) + pivptr = old_pivptr; + else + *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + rtemp = c_abs1 (&lu_col_ptr[diag]); + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += 10 * (nsupr - nsupc); + + c_div(&temp, &one, &lu_col_ptr[nsupc]); + for (k = nsupc+1; k < nsupr; k++) + cc_mult(&lu_col_ptr[k], &lu_col_ptr[k], &temp); + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cpivotgrowth.c b/thirdparty/superlu/SuperLU_4.1/SRC/cpivotgrowth.c new file mode 100644 index 0000000..db51443 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cpivotgrowth.c @@ -0,0 +1,114 @@ + +/*! @file cpivotgrowth.c + * \brief Computes the reciprocal pivot growth factor + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Compute the reciprocal pivot growth factor of the leading ncols columns
    + * of the matrix, using the formula:
    + *     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )
    + *
    + * Arguments
    + * =========
    + *
    + * ncols    (input) int
    + *          The number of columns of matrices A, L and U.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = NC; Dtype = SLU_C; Mtype = GE.
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SC; Dtype = SLU_C; Mtype = TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = NC;
    + *          Dtype = SLU_C; Mtype = TRU.
    + * 
    + */ + +float +cPivotGrowth(int ncols, SuperMatrix *A, int *perm_c, + SuperMatrix *L, SuperMatrix *U) +{ + + NCformat *Astore; + SCformat *Lstore; + NCformat *Ustore; + complex *Aval, *Lval, *Uval; + int fsupc, nsupr, luptr, nz_in_U; + int i, j, k, oldcol; + int *inv_perm_c; + float rpg, maxaj, maxuj; + float smlnum; + complex *luval; + complex temp_comp; + + /* Get machine constants. */ + smlnum = slamch_("S"); + rpg = 1. / smlnum; + + Astore = A->Store; + Lstore = L->Store; + Ustore = U->Store; + Aval = Astore->nzval; + Lval = Lstore->nzval; + Uval = Ustore->nzval; + + inv_perm_c = (int *) SUPERLU_MALLOC(A->ncol*sizeof(int)); + for (j = 0; j < A->ncol; ++j) inv_perm_c[perm_c[j]] = j; + + for (k = 0; k <= Lstore->nsuper; ++k) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + luptr = L_NZ_START(fsupc); + luval = &Lval[luptr]; + nz_in_U = 1; + + for (j = fsupc; j < L_FST_SUPC(k+1) && j < ncols; ++j) { + maxaj = 0.; + oldcol = inv_perm_c[j]; + for (i = Astore->colptr[oldcol]; i < Astore->colptr[oldcol+1]; ++i) + maxaj = SUPERLU_MAX( maxaj, c_abs1( &Aval[i]) ); + + maxuj = 0.; + for (i = Ustore->colptr[j]; i < Ustore->colptr[j+1]; i++) + maxuj = SUPERLU_MAX( maxuj, c_abs1( &Uval[i]) ); + + /* Supernode */ + for (i = 0; i < nz_in_U; ++i) + maxuj = SUPERLU_MAX( maxuj, c_abs1( &luval[i]) ); + + ++nz_in_U; + luval += nsupr; + + if ( maxuj == 0. ) + rpg = SUPERLU_MIN( rpg, 1.); + else + rpg = SUPERLU_MIN( rpg, maxaj / maxuj ); + } + + if ( j >= ncols ) break; + } + + SUPERLU_FREE(inv_perm_c); + return (rpg); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cpruneL.c b/thirdparty/superlu/SuperLU_4.1/SRC/cpruneL.c new file mode 100644 index 0000000..22a9ff5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cpruneL.c @@ -0,0 +1,154 @@ + +/*! @file cpruneL.c + * \brief Prunes the L-structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + *
    + */ + + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Prunes the L-structure of supernodes whose L-structure
    + *   contains the current pivot row "pivrow"
    + * 
    + */ + +void +cpruneL( + const int jcol, /* in */ + const int *perm_r, /* in */ + const int pivrow, /* in */ + const int nseg, /* in */ + const int *segrep, /* in */ + const int *repfnz, /* in */ + int *xprune, /* out */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + + complex utemp; + int jsupno, irep, irep1, kmin, kmax, krow, movnum; + int i, ktemp, minloc, maxloc; + int do_prune; /* logical variable */ + int *xsup, *supno; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + /* + * For each supernode-rep irep in U[*,j] + */ + jsupno = supno[jcol]; + for (i = 0; i < nseg; i++) { + + irep = segrep[i]; + irep1 = irep + 1; + do_prune = FALSE; + + /* Don't prune with a zero U-segment */ + if ( repfnz[irep] == EMPTY ) + continue; + + /* If a snode overlaps with the next panel, then the U-segment + * is fragmented into two parts -- irep and irep1. We should let + * pruning occur at the rep-column in irep1's snode. + */ + if ( supno[irep] == supno[irep1] ) /* Don't prune */ + continue; + + /* + * If it has not been pruned & it has a nonz in row L[pivrow,i] + */ + if ( supno[irep] != jsupno ) { + if ( xprune[irep] >= xlsub[irep1] ) { + kmin = xlsub[irep]; + kmax = xlsub[irep1] - 1; + for (krow = kmin; krow <= kmax; krow++) + if ( lsub[krow] == pivrow ) { + do_prune = TRUE; + break; + } + } + + if ( do_prune ) { + + /* Do a quicksort-type partition + * movnum=TRUE means that the num values have to be exchanged. + */ + movnum = FALSE; + if ( irep == xsup[supno[irep]] ) /* Snode of size 1 */ + movnum = TRUE; + + while ( kmin <= kmax ) { + + if ( perm_r[lsub[kmax]] == EMPTY ) + kmax--; + else if ( perm_r[lsub[kmin]] != EMPTY ) + kmin++; + else { /* kmin below pivrow (not yet pivoted), and kmax + * above pivrow: interchange the two subscripts + */ + ktemp = lsub[kmin]; + lsub[kmin] = lsub[kmax]; + lsub[kmax] = ktemp; + + /* If the supernode has only one column, then we + * only keep one set of subscripts. For any subscript + * interchange performed, similar interchange must be + * done on the numerical values. + */ + if ( movnum ) { + minloc = xlusup[irep] + (kmin - xlsub[irep]); + maxloc = xlusup[irep] + (kmax - xlsub[irep]); + utemp = lusup[minloc]; + lusup[minloc] = lusup[maxloc]; + lusup[maxloc] = utemp; + } + + kmin++; + kmax--; + + } + + } /* while */ + + xprune[irep] = kmin; /* Pruning */ + +#ifdef CHK_PRUNE + printf(" After cpruneL(),using col %d: xprune[%d] = %d\n", + jcol, irep, kmin); +#endif + } /* if do_prune */ + + } /* if */ + + } /* for each U-segment... */ +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/creadhb.c b/thirdparty/superlu/SuperLU_4.1/SRC/creadhb.c new file mode 100644 index 0000000..a01bdc5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/creadhb.c @@ -0,0 +1,267 @@ + +/*! @file creadhb.c + * \brief Read a matrix stored in Harwell-Boeing format + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Purpose
    + * =======
    + * 
    + * Read a COMPLEX PRECISION matrix stored in Harwell-Boeing format 
    + * as described below.
    + * 
    + * Line 1 (A72,A8) 
    + *  	Col. 1 - 72   Title (TITLE) 
    + *	Col. 73 - 80  Key (KEY) 
    + * 
    + * Line 2 (5I14) 
    + * 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + * 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + * 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + * 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    + *	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    + *                    (including starting guesses and solution vectors 
    + *		       if present) 
    + *           	      (zero indicates no right-hand side data is present) 
    + *
    + * Line 3 (A3, 11X, 4I14) 
    + *   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + * 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + * 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    + *	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    + *	              (equal to number of entries for assembled matrices) 
    + * 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    + *	              (zero in the case of assembled matrices) 
    + * Line 4 (2A16, 2A20) 
    + * 	Col. 1 - 16   Format for pointers (PTRFMT) 
    + *	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    + *	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + * 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT) 
    + *
    + * Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    + *    	Col. 1 	      Right-hand side type: 
    + *	         	  F for full storage or M for same format as matrix 
    + *    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    + *    	Col. 3        X if an exact solution vector(s) is supplied. 
    + *	Col. 15 - 28  Number of right-hand sides (NRHS) 
    + *	Col. 29 - 42  Number of row indices (NRHSIX) 
    + *          	      (ignored in case of unassembled matrices) 
    + *
    + * The three character type field on line 3 describes the matrix type. 
    + * The following table lists the permitted values for each of the three 
    + * characters. As an example of the type field, RSA denotes that the matrix 
    + * is real, symmetric, and assembled. 
    + *
    + * First Character: 
    + *	R Real matrix 
    + *	C Complex matrix 
    + *	P Pattern only (no numerical values supplied) 
    + *
    + * Second Character: 
    + *	S Symmetric 
    + *	U Unsymmetric 
    + *	H Hermitian 
    + *	Z Skew symmetric 
    + *	R Rectangular 
    + *
    + * Third Character: 
    + *	A Assembled 
    + *	E Elemental matrices (unassembled) 
    + *
    + * 
    + */ +#include +#include +#include "slu_cdefs.h" + + +/*! \brief Eat up the rest of the current line */ +int cDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +int cParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +int cParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + * + * Purpose + * ======= + * + * Read a COMPLEX PRECISION matrix stored in Rutherford-Boeing format + * as described below. + * + * Line 1 (A72, A8) + * Col. 1 - 72 Title (TITLE) + * Col. 73 - 80 Matrix name / identifier (MTRXID) + * + * Line 2 (I14, 3(1X, I13)) + * Col. 1 - 14 Total number of lines excluding header (TOTCRD) + * Col. 16 - 28 Number of lines for pointers (PTRCRD) + * Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) + * Col. 44 - 56 Number of lines for numerical values (VALCRD) + * + * Line 3 (A3, 11X, 4(1X, I13)) + * Col. 1 - 3 Matrix type (see below) (MXTYPE) + * Col. 15 - 28 Compressed Column: Number of rows (NROW) + * Elemental: Largest integer used to index variable (MVAR) + * Col. 30 - 42 Compressed Column: Number of columns (NCOL) + * Elemental: Number of element matrices (NELT) + * Col. 44 - 56 Compressed Column: Number of entries (NNZERO) + * Elemental: Number of variable indeces (NVARIX) + * Col. 58 - 70 Compressed Column: Unused, explicitly zero + * Elemental: Number of elemental matrix entries (NELTVL) + * + * Line 4 (2A16, A20) + * Col. 1 - 16 Fortran format for pointers (PTRFMT) + * Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) + * Col. 33 - 52 Fortran format for numerical values of coefficient matrix + * (VALFMT) + * (blank in the case of matrix patterns) + * + * The three character type field on line 3 describes the matrix type. + * The following table lists the permitted values for each of the three + * characters. As an example of the type field, RSA denotes that the matrix + * is real, symmetric, and assembled. + * + * First Character: + * R Real matrix + * C Complex matrix + * I integer matrix + * P Pattern only (no numerical values supplied) + * Q Pattern only (numerical values supplied in associated auxiliary value + * file) + * + * Second Character: + * S Symmetric + * U Unsymmetric + * H Hermitian + * Z Skew symmetric + * R Rectangular + * + * Third Character: + * A Compressed column form + * E Elemental form + * + * + */ + +#include "slu_cdefs.h" + + +/*! \brief Eat up the rest of the current line */ +static int cDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +static int cParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +static int cParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + */ + +#include "slu_cdefs.h" + + +void +creadtriple(int *m, int *n, int *nonz, + complex **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int j, k, jsize, nnz, nz; + complex *a, *val; + int *asub, *xa, *row, *col; + int zero_base = 0; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d", n, nonz); + *m = *n; + printf("m %d, n %d, nonz %d\n", *m, *n, *nonz); + callocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (complex *) SUPERLU_MALLOC(*nonz * sizeof(complex)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + for (j = 0; j < *n; ++j) xa[j] = 0; + + /* Read into the triplet array from a file */ + for (nnz = 0, nz = 0; nnz < *nonz; ++nnz) { + scanf("%d%d%f%f\n", &row[nz], &col[nz], &val[nz].r, &val[nz].i); + + if ( nnz == 0 ) { /* first nonzero */ + if ( row[0] == 0 || col[0] == 0 ) { + zero_base = 1; + printf("triplet file: row/col indices are zero-based.\n"); + } else + printf("triplet file: row/col indices are one-based.\n"); + } + + if ( !zero_base ) { + /* Change to 0-based indexing. */ + --row[nz]; + --col[nz]; + } + + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n + /*|| val[nz] == 0.*/) { + fprintf(stderr, "nz %d, (%d, %d) = (%e,%e) out of bound, removed\n", + nz, row[nz], col[nz], val[nz].r, val[nz].i); + exit(-1); + } else { + ++xa[col[nz]]; + ++nz; + } + } + + *nonz = nz; + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + { + int i; + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } + } +#endif + +} + + +void creadrhs(int m, complex *b) +{ + FILE *fp, *fopen(); + int i; + /*int j;*/ + + if ( !(fp = fopen("b.dat", "r")) ) { + fprintf(stderr, "dreadrhs: file does not exist\n"); + exit(-1); + } + for (i = 0; i < m; ++i) + fscanf(fp, "%f%f\n", &b[i].r, &b[i].i); + + /* readpair_(j, &b[i]);*/ + fclose(fp); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/csnode_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/csnode_bmod.c new file mode 100644 index 0000000..40c21f5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/csnode_bmod.c @@ -0,0 +1,120 @@ + +/*! @file csnode_bmod.c + * \brief Performs numeric block updates within the relaxed snode. + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_cdefs.h" + + +/*! \brief Performs numeric block updates within the relaxed snode. + */ +int +csnode_bmod ( + const int jcol, /* in */ + const int jsupno, /* in */ + const int fsupc, /* in */ + complex *dense, /* in */ + complex *tempv, /* working array */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + complex alpha = {-1.0, 0.0}, beta = {1.0, 0.0}; +#endif + + complex comp_zero = {0.0, 0.0}; + int luptr, nsupc, nsupr, nrow; + int isub, irow, i, iptr; + register int ufirst, nextlu; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + nextlu = xlusup[jcol]; + + /* + * Process the supernodal portion of L\U[*,j] + */ + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = comp_zero; + ++nextlu; + } + + xlusup[jcol + 1] = nextlu; /* Initialize xlusup for next column */ + + if ( fsupc < jcol ) { + + luptr = xlusup[fsupc]; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nsupc = jcol - fsupc; /* Excluding jcol */ + ufirst = xlusup[jcol]; /* Points to the beginning of column + jcol in supernode L\U(jsupno). */ + nrow = nsupr - nsupc; + + ops[TRSV] += 4 * nsupc * (nsupc - 1); + ops[GEMV] += 8 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + CGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + ctrsv_( "L", "N", "U", &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + cgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + clsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + cmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], &tempv[0] ); + + /* Scatter tempv[*] into lusup[*] */ + iptr = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + c_sub(&lusup[iptr], &lusup[iptr], &tempv[i]); + ++iptr; + tempv[i] = comp_zero; + } +#endif + + } + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/csnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/csnode_dfs.c new file mode 100644 index 0000000..175da09 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/csnode_dfs.c @@ -0,0 +1,112 @@ + +/*! @file csnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    csnode_dfs() - Determine the union of the row structures of those 
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +csnode_dfs ( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *xprune, /* out */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, ifrom, ito, nextl, new_next; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) { + if ( mem_error = cLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1, then make a copy of the subscripts for pruning */ + if ( jcol < kcol ) { + new_next = nextl + (nextl - xlsub[jcol]); + while ( new_next > nzlmax ) { + if ( mem_error = cLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + ito = nextl; + for (ifrom = xlsub[jcol]; ifrom < nextl; ) + lsub[ito++] = lsub[ifrom++]; + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + nextl = ito; + } + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xprune[kcol] = nextl; + xlsub[kcol+1] = nextl; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas2.c new file mode 100644 index 0000000..2ab271d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas2.c @@ -0,0 +1,573 @@ + +/*! @file csp_blas2.c + * \brief Sparse BLAS 2, using some dense BLAS 2 operations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +/* + * File name: csp_blas2.c + * Purpose: Sparse BLAS 2, using some dense BLAS 2 operations. + */ + +#include "slu_cdefs.h" + +/* + * Function prototypes + */ +void cusolve(int, int, complex*, complex*); +void clsolve(int, int, complex*, complex*); +void cmatvec(int, int, int, complex*, complex*, complex*); + +/*! \brief Solves one of the systems of equations A*x = b, or A'*x = b + * + *
    + *   Purpose
    + *   =======
    + *
    + *   sp_ctrsv() solves one of the systems of equations   
    + *       A*x = b,   or   A'*x = b,
    + *   where b and x are n element vectors and A is a sparse unit , or   
    + *   non-unit, upper or lower triangular matrix.   
    + *   No test for singularity or near-singularity is included in this   
    + *   routine. Such tests must be performed before calling this routine.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   uplo   - (input) char*
    + *            On entry, uplo specifies whether the matrix is an upper or   
    + *             lower triangular matrix as follows:   
    + *                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    + *                uplo = 'L' or 'l'   A is a lower triangular matrix.   
    + *
    + *   trans  - (input) char*
    + *             On entry, trans specifies the equations to be solved as   
    + *             follows:   
    + *                trans = 'N' or 'n'   A*x = b.   
    + *                trans = 'T' or 't'   A'*x = b.
    + *                trans = 'C' or 'c'   A^H*x = b.   
    + *
    + *   diag   - (input) char*
    + *             On entry, diag specifies whether or not A is unit   
    + *             triangular as follows:   
    + *                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    + *                diag = 'N' or 'n'   A is not assumed to be unit   
    + *                                    triangular.   
    + *	     
    + *   L       - (input) SuperMatrix*
    + *	       The factor L from the factorization Pr*A*Pc=L*U. Use
    + *             compressed row subscripts storage for supernodes,
    + *             i.e., L has types: Stype = SC, Dtype = SLU_C, Mtype = TRLU.
    + *
    + *   U       - (input) SuperMatrix*
    + *	        The factor U from the factorization Pr*A*Pc=L*U.
    + *	        U has types: Stype = NC, Dtype = SLU_C, Mtype = TRU.
    + *    
    + *   x       - (input/output) complex*
    + *             Before entry, the incremented array X must contain the n   
    + *             element right-hand side vector b. On exit, X is overwritten 
    + *             with the solution vector x.
    + *
    + *   info    - (output) int*
    + *             If *info = -i, the i-th argument had an illegal value.
    + * 
    + */ +int +sp_ctrsv(char *uplo, char *trans, char *diag, SuperMatrix *L, + SuperMatrix *U, complex *x, SuperLUStat_t *stat, int *info) +{ +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + SCformat *Lstore; + NCformat *Ustore; + complex *Lval, *Uval; + int incx = 1, incy = 1; + complex temp; + complex alpha = {1.0, 0.0}, beta = {1.0, 0.0}; + complex comp_zero = {0.0, 0.0}; + int nrow; + int fsupc, nsupr, nsupc, luptr, istart, irow; + int i, k, iptr, jcol; + complex *work; + flops_t solve_ops; + + /* Test the input parameters */ + *info = 0; + if ( !lsame_(uplo,"L") && !lsame_(uplo, "U") ) *info = -1; + else if ( !lsame_(trans, "N") && !lsame_(trans, "T") && + !lsame_(trans, "C")) *info = -2; + else if ( !lsame_(diag, "U") && !lsame_(diag, "N") ) *info = -3; + else if ( L->nrow != L->ncol || L->nrow < 0 ) *info = -4; + else if ( U->nrow != U->ncol || U->nrow < 0 ) *info = -5; + if ( *info ) { + i = -(*info); + xerbla_("sp_ctrsv", &i); + return 0; + } + + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( !(work = complexCalloc(L->nrow)) ) + ABORT("Malloc fails for work in sp_ctrsv()."); + + if ( lsame_(trans, "N") ) { /* Form x := inv(A)*x. */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L)*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + nrow = nsupr - nsupc; + + /* 1 c_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc - 1) + 10 * nsupc; + solve_ops += 8 * nrow * nsupc; + + if ( nsupc == 1 ) { + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); ++iptr) { + irow = L_SUB(iptr); + ++luptr; + cc_mult(&comp_zero, &x[fsupc], &Lval[luptr]); + c_sub(&x[irow], &x[irow], &comp_zero); + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + CGEMV(ftcs2, &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#else + ctrsv_("L", "N", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + cgemv_("N", &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#endif +#else + clsolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc]); + + cmatvec ( nsupr, nsupr-nsupc, nsupc, &Lval[luptr+nsupc], + &x[fsupc], &work[0] ); +#endif + + iptr = istart + nsupc; + for (i = 0; i < nrow; ++i, ++iptr) { + irow = L_SUB(iptr); + c_sub(&x[irow], &x[irow], &work[i]); /* Scatter */ + work[i] = comp_zero; + + } + } + } /* for k ... */ + + } else { + /* Form x := inv(U)*x */ + + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + /* 1 c_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + c_div(&x[fsupc], &x[fsupc], &Lval[luptr]); + for (i = U_NZ_START(fsupc); i < U_NZ_START(fsupc+1); ++i) { + irow = U_SUB(i); + cc_mult(&comp_zero, &x[fsupc], &Uval[i]); + c_sub(&x[irow], &x[irow], &comp_zero); + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV(ftcs3, ftcs2, ftcs2, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ctrsv_("U", "N", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif +#else + cusolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc] ); +#endif + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); + i++) { + irow = U_SUB(i); + cc_mult(&comp_zero, &x[jcol], &Uval[i]); + c_sub(&x[irow], &x[irow], &comp_zero); + } + } + } + } /* for k ... */ + + } + } else if ( lsame_(trans, "T") ) { /* Form x := inv(A')*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L')*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 8 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + cc_mult(&comp_zero, &x[irow], &Lval[i]); + c_sub(&x[jcol], &x[jcol], &comp_zero); + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += 4 * nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + CTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ctrsv_("L", "T", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := inv(U')*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + cc_mult(&comp_zero, &x[irow], &Uval[i]); + c_sub(&x[jcol], &x[jcol], &comp_zero); + } + } + + /* 1 c_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + c_div(&x[fsupc], &x[fsupc], &Lval[luptr]); + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ctrsv_("U", "T", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } else { /* Form x := conj(inv(A'))*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := conj(inv(L'))*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 8 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + cc_conj(&temp, &Lval[i]); + cc_mult(&comp_zero, &x[irow], &temp); + c_sub(&x[jcol], &x[jcol], &comp_zero); + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += 4 * nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd(trans, strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + CTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ctrsv_("L", trans, "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := conj(inv(U'))*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + cc_conj(&temp, &Uval[i]); + cc_mult(&comp_zero, &x[irow], &temp); + c_sub(&x[jcol], &x[jcol], &comp_zero); + } + } + + /* 1 c_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + cc_conj(&temp, &Lval[luptr]); + c_div(&x[fsupc], &x[fsupc], &temp); + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd(trans, strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ctrsv_("U", trans, "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } + + stat->ops[SOLVE] += solve_ops; + SUPERLU_FREE(work); + return 0; +} + + + +/*! \brief Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y + * + *
      
    + *   Purpose   
    + *   =======   
    + *
    + *   sp_cgemv()  performs one of the matrix-vector operations   
    + *      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    + *   where alpha and beta are scalars, x and y are vectors and A is a
    + *   sparse A->nrow by A->ncol matrix.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   TRANS  - (input) char*
    + *            On entry, TRANS specifies the operation to be performed as   
    + *            follows:   
    + *               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    + *               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    + *               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.   
    + *
    + *   ALPHA  - (input) complex
    + *            On entry, ALPHA specifies the scalar alpha.   
    + *
    + *   A      - (input) SuperMatrix*
    + *            Before entry, the leading m by n part of the array A must   
    + *            contain the matrix of coefficients.   
    + *
    + *   X      - (input) complex*, array of DIMENSION at least   
    + *            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    + *           and at least   
    + *            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    + *            Before entry, the incremented array X must contain the   
    + *            vector x.   
    + * 
    + *   INCX   - (input) int
    + *            On entry, INCX specifies the increment for the elements of   
    + *            X. INCX must not be zero.   
    + *
    + *   BETA   - (input) complex
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then Y need not be set on input.   
    + *
    + *   Y      - (output) complex*,  array of DIMENSION at least   
    + *            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    + *            Before entry with BETA non-zero, the incremented array Y   
    + *            must contain the vector y. On exit, Y is overwritten by the 
    + *            updated vector y.
    + *	      
    + *   INCY   - (input) int
    + *            On entry, INCY specifies the increment for the elements of   
    + *            Y. INCY must not be zero.   
    + *
    + *    ==== Sparse Level 2 Blas routine.   
    + * 
    +*/ +int +sp_cgemv(char *trans, complex alpha, SuperMatrix *A, complex *x, + int incx, complex beta, complex *y, int incy) +{ + + /* Local variables */ + NCformat *Astore; + complex *Aval; + int info; + complex temp, temp1; + int lenx, leny, i, j, irow; + int iy, jx, jy, kx, ky; + int notran; + complex comp_zero = {0.0, 0.0}; + complex comp_one = {1.0, 0.0}; + + notran = lsame_(trans, "N"); + Astore = A->Store; + Aval = Astore->nzval; + + /* Test the input parameters */ + info = 0; + if ( !notran && !lsame_(trans, "T") && !lsame_(trans, "C")) info = 1; + else if ( A->nrow < 0 || A->ncol < 0 ) info = 3; + else if (incx == 0) info = 5; + else if (incy == 0) info = 8; + if (info != 0) { + xerbla_("sp_cgemv ", &info); + return 0; + } + + /* Quick return if possible. */ + if (A->nrow == 0 || A->ncol == 0 || + c_eq(&alpha, &comp_zero) && + c_eq(&beta, &comp_one)) + return 0; + + + /* Set LENX and LENY, the lengths of the vectors x and y, and set + up the start points in X and Y. */ + if (lsame_(trans, "N")) { + lenx = A->ncol; + leny = A->nrow; + } else { + lenx = A->nrow; + leny = A->ncol; + } + if (incx > 0) kx = 0; + else kx = - (lenx - 1) * incx; + if (incy > 0) ky = 0; + else ky = - (leny - 1) * incy; + + /* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + /* First form y := beta*y. */ + if ( !c_eq(&beta, &comp_one) ) { + if (incy == 1) { + if ( c_eq(&beta, &comp_zero) ) + for (i = 0; i < leny; ++i) y[i] = comp_zero; + else + for (i = 0; i < leny; ++i) + cc_mult(&y[i], &beta, &y[i]); + } else { + iy = ky; + if ( c_eq(&beta, &comp_zero) ) + for (i = 0; i < leny; ++i) { + y[iy] = comp_zero; + iy += incy; + } + else + for (i = 0; i < leny; ++i) { + cc_mult(&y[iy], &beta, &y[iy]); + iy += incy; + } + } + } + + if ( c_eq(&alpha, &comp_zero) ) return 0; + + if ( notran ) { + /* Form y := alpha*A*x + y. */ + jx = kx; + if (incy == 1) { + for (j = 0; j < A->ncol; ++j) { + if ( !c_eq(&x[jx], &comp_zero) ) { + cc_mult(&temp, &alpha, &x[jx]); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + cc_mult(&temp1, &temp, &Aval[i]); + c_add(&y[irow], &y[irow], &temp1); + } + } + jx += incx; + } + } else { + ABORT("Not implemented."); + } + } else { + /* Form y := alpha*A'*x + y. */ + jy = ky; + if (incx == 1) { + for (j = 0; j < A->ncol; ++j) { + temp = comp_zero; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + cc_mult(&temp1, &Aval[i], &x[irow]); + c_add(&temp, &temp, &temp1); + } + cc_mult(&temp1, &alpha, &temp); + c_add(&y[jy], &y[jy], &temp1); + jy += incy; + } + } else { + ABORT("Not implemented."); + } + } + return 0; +} /* sp_cgemv */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas3.c b/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas3.c new file mode 100644 index 0000000..84ff940 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/csp_blas3.c @@ -0,0 +1,127 @@ + +/*! @file csp_blas3.c + * \brief Sparse BLAS3, using some dense BLAS3 operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +/* + * File name: sp_blas3.c + * Purpose: Sparse BLAS3, using some dense BLAS3 operations. + */ + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + * 
    + *   sp_c performs one of the matrix-matrix operations   
    + * 
    + *      C := alpha*op( A )*op( B ) + beta*C,   
    + * 
    + *   where  op( X ) is one of 
    + * 
    + *      op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),
    + * 
    + *   alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    + *   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix. 
    + *   
    + * 
    + *   Parameters   
    + *   ==========   
    + * 
    + *   TRANSA - (input) char*
    + *            On entry, TRANSA specifies the form of op( A ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSA = 'N' or 'n',  op( A ) = A.   
    + *               TRANSA = 'T' or 't',  op( A ) = A'.   
    + *               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    + *            Unchanged on exit.   
    + * 
    + *   TRANSB - (input) char*
    + *            On entry, TRANSB specifies the form of op( B ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSB = 'N' or 'n',  op( B ) = B.   
    + *               TRANSB = 'T' or 't',  op( B ) = B'.   
    + *               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    + *            Unchanged on exit.   
    + * 
    + *   M      - (input) int   
    + *            On entry,  M  specifies  the number of rows of the matrix 
    + *	     op( A ) and of the matrix C.  M must be at least zero. 
    + *	     Unchanged on exit.   
    + * 
    + *   N      - (input) int
    + *            On entry,  N specifies the number of columns of the matrix 
    + *	     op( B ) and the number of columns of the matrix C. N must be 
    + *	     at least zero.
    + *	     Unchanged on exit.   
    + * 
    + *   K      - (input) int
    + *            On entry, K specifies the number of columns of the matrix 
    + *	     op( A ) and the number of rows of the matrix op( B ). K must 
    + *	     be at least  zero.   
    + *           Unchanged on exit.
    + *      
    + *   ALPHA  - (input) complex
    + *            On entry, ALPHA specifies the scalar alpha.   
    + * 
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_C; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + * 
    + *   B      - COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    + *            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    + *            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    + *            part of the array B must contain the matrix B, otherwise 
    + *            the leading n by k part of the array B must contain the 
    + *            matrix B.   
    + *            Unchanged on exit.   
    + * 
    + *   LDB    - (input) int
    + *            On entry, LDB specifies the first dimension of B as declared 
    + *            in the calling (sub) program. LDB must be at least max( 1, n ).  
    + *            Unchanged on exit.   
    + * 
    + *   BETA   - (input) complex
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then C need not be set on input.   
    + *  
    + *   C      - COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    + *            Before entry, the leading m by n part of the array C must 
    + *            contain the matrix C,  except when beta is zero, in which 
    + *            case C need not be set on entry.   
    + *            On exit, the array C is overwritten by the m by n matrix 
    + *	     ( alpha*op( A )*B + beta*C ).   
    + *  
    + *   LDC    - (input) int
    + *            On entry, LDC specifies the first dimension of C as declared 
    + *            in the calling (sub)program. LDC must be at least max(1,m).   
    + *            Unchanged on exit.   
    + *  
    + *   ==== Sparse Level 3 Blas routine.   
    + * 
    + */ + +int +sp_cgemm(char *transa, char *transb, int m, int n, int k, + complex alpha, SuperMatrix *A, complex *b, int ldb, + complex beta, complex *c, int ldc) +{ + int incx = 1, incy = 1; + int j; + + for (j = 0; j < n; ++j) { + sp_cgemv(transa, alpha, A, &b[ldb*j], incx, beta, &c[ldc*j], incy); + } + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/cutil.c b/thirdparty/superlu/SuperLU_4.1/SRC/cutil.c new file mode 100644 index 0000000..e9489a3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/cutil.c @@ -0,0 +1,475 @@ + +/*! @file cutil.c + * \brief Matrix utility functions + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include "slu_cdefs.h" + +void +cCreate_CompCol_Matrix(SuperMatrix *A, int m, int n, int nnz, + complex *nzval, int *rowind, int *colptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NCformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NCformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->rowind = rowind; + Astore->colptr = colptr; +} + +void +cCreate_CompRow_Matrix(SuperMatrix *A, int m, int n, int nnz, + complex *nzval, int *colind, int *rowptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NRformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NRformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->colind = colind; + Astore->rowptr = rowptr; +} + +/*! \brief Copy matrix A into matrix B. */ +void +cCopy_CompCol_Matrix(SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore, *Bstore; + int ncol, nnz, i; + + B->Stype = A->Stype; + B->Dtype = A->Dtype; + B->Mtype = A->Mtype; + B->nrow = A->nrow;; + B->ncol = ncol = A->ncol; + Astore = (NCformat *) A->Store; + Bstore = (NCformat *) B->Store; + Bstore->nnz = nnz = Astore->nnz; + for (i = 0; i < nnz; ++i) + ((complex *)Bstore->nzval)[i] = ((complex *)Astore->nzval)[i]; + for (i = 0; i < nnz; ++i) Bstore->rowind[i] = Astore->rowind[i]; + for (i = 0; i <= ncol; ++i) Bstore->colptr[i] = Astore->colptr[i]; +} + + +void +cCreate_Dense_Matrix(SuperMatrix *X, int m, int n, complex *x, int ldx, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + DNformat *Xstore; + + X->Stype = stype; + X->Dtype = dtype; + X->Mtype = mtype; + X->nrow = m; + X->ncol = n; + X->Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !(X->Store) ) ABORT("SUPERLU_MALLOC fails for X->Store"); + Xstore = (DNformat *) X->Store; + Xstore->lda = ldx; + Xstore->nzval = (complex *) x; +} + +void +cCopy_Dense_Matrix(int M, int N, complex *X, int ldx, + complex *Y, int ldy) +{ +/*! \brief Copies a two-dimensional matrix X to another matrix Y. + */ + int i, j; + + for (j = 0; j < N; ++j) + for (i = 0; i < M; ++i) + Y[i + j*ldy] = X[i + j*ldx]; +} + +void +cCreate_SuperNode_Matrix(SuperMatrix *L, int m, int n, int nnz, + complex *nzval, int *nzval_colptr, int *rowind, + int *rowind_colptr, int *col_to_sup, int *sup_to_col, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + SCformat *Lstore; + + L->Stype = stype; + L->Dtype = dtype; + L->Mtype = mtype; + L->nrow = m; + L->ncol = n; + L->Store = (void *) SUPERLU_MALLOC( sizeof(SCformat) ); + if ( !(L->Store) ) ABORT("SUPERLU_MALLOC fails for L->Store"); + Lstore = L->Store; + Lstore->nnz = nnz; + Lstore->nsuper = col_to_sup[n]; + Lstore->nzval = nzval; + Lstore->nzval_colptr = nzval_colptr; + Lstore->rowind = rowind; + Lstore->rowind_colptr = rowind_colptr; + Lstore->col_to_sup = col_to_sup; + Lstore->sup_to_col = sup_to_col; + +} + + +/*! \brief Convert a row compressed storage into a column compressed storage. + */ +void +cCompRow_to_CompCol(int m, int n, int nnz, + complex *a, int *colind, int *rowptr, + complex **at, int **rowind, int **colptr) +{ + register int i, j, col, relpos; + int *marker; + + /* Allocate storage for another copy of the matrix. */ + *at = (complex *) complexMalloc(nnz); + *rowind = (int *) intMalloc(nnz); + *colptr = (int *) intMalloc(n+1); + marker = (int *) intCalloc(n); + + /* Get counts of each column of A, and set up column pointers */ + for (i = 0; i < m; ++i) + for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; + (*colptr)[0] = 0; + for (j = 0; j < n; ++j) { + (*colptr)[j+1] = (*colptr)[j] + marker[j]; + marker[j] = (*colptr)[j]; + } + + /* Transfer the matrix into the compressed column storage. */ + for (i = 0; i < m; ++i) { + for (j = rowptr[i]; j < rowptr[i+1]; ++j) { + col = colind[j]; + relpos = marker[col]; + (*rowind)[relpos] = i; + (*at)[relpos] = a[j]; + ++marker[col]; + } + } + + SUPERLU_FREE(marker); +} + + +void +cPrint_CompCol_Matrix(char *what, SuperMatrix *A) +{ + NCformat *Astore; + register int i,n; + float *dp; + + printf("\nCompCol matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (NCformat *) A->Store; + dp = (float *) Astore->nzval; + printf("nrow %d, ncol %d, nnz %d\n", A->nrow,A->ncol,Astore->nnz); + printf("nzval: "); + for (i = 0; i < 2*Astore->colptr[n]; ++i) printf("%f ", dp[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%d ", Astore->rowind[i]); + printf("\ncolptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->colptr[i]); + printf("\n"); + fflush(stdout); +} + +void +cPrint_SuperNode_Matrix(char *what, SuperMatrix *A) +{ + SCformat *Astore; + register int i, j, k, c, d, n, nsup; + float *dp; + int *col_to_sup, *sup_to_col, *rowind, *rowind_colptr; + + printf("\nSuperNode matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (SCformat *) A->Store; + dp = (float *) Astore->nzval; + col_to_sup = Astore->col_to_sup; + sup_to_col = Astore->sup_to_col; + rowind_colptr = Astore->rowind_colptr; + rowind = Astore->rowind; + printf("nrow %d, ncol %d, nnz %d, nsuper %d\n", + A->nrow,A->ncol,Astore->nnz,Astore->nsuper); + printf("nzval:\n"); + for (k = 0; k <= Astore->nsuper; ++k) { + c = sup_to_col[k]; + nsup = sup_to_col[k+1] - c; + for (j = c; j < c + nsup; ++j) { + d = Astore->nzval_colptr[j]; + for (i = rowind_colptr[c]; i < rowind_colptr[c+1]; ++i) { + printf("%d\t%d\t%e\t%e\n", rowind[i], j, dp[d], dp[d+1]); + d += 2; + } + } + } +#if 0 + for (i = 0; i < 2*Astore->nzval_colptr[n]; ++i) printf("%f ", dp[i]); +#endif + printf("\nnzval_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->nzval_colptr[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->rowind_colptr[n]; ++i) + printf("%d ", Astore->rowind[i]); + printf("\nrowind_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->rowind_colptr[i]); + printf("\ncol_to_sup: "); + for (i = 0; i < n; ++i) printf("%d ", col_to_sup[i]); + printf("\nsup_to_col: "); + for (i = 0; i <= Astore->nsuper+1; ++i) + printf("%d ", sup_to_col[i]); + printf("\n"); + fflush(stdout); +} + +void +cPrint_Dense_Matrix(char *what, SuperMatrix *A) +{ + DNformat *Astore = (DNformat *) A->Store; + register int i, j, lda = Astore->lda; + float *dp; + + printf("\nDense matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + dp = (float *) Astore->nzval; + printf("nrow %d, ncol %d, lda %d\n", A->nrow,A->ncol,lda); + printf("\nnzval: "); + for (j = 0; j < A->ncol; ++j) { + for (i = 0; i < 2*A->nrow; ++i) printf("%f ", dp[i + j*2*lda]); + printf("\n"); + } + printf("\n"); + fflush(stdout); +} + +/*! \brief Diagnostic print of column "jcol" in the U/L factor. + */ +void +cprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu) +{ + int i, k, fsupc; + int *xsup, *supno; + int *xlsub, *lsub; + complex *lusup; + int *xlusup; + complex *ucol; + int *usub, *xusub; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + + printf("%s", msg); + printf("col %d: pivrow %d, supno %d, xprune %d\n", + jcol, pivrow, supno[jcol], xprune[jcol]); + + printf("\tU-col:\n"); + for (i = xusub[jcol]; i < xusub[jcol+1]; i++) + printf("\t%d%10.4f, %10.4f\n", usub[i], ucol[i].r, ucol[i].i); + printf("\tL-col in rectangular snode:\n"); + fsupc = xsup[supno[jcol]]; /* first col of the snode */ + i = xlsub[fsupc]; + k = xlusup[jcol]; + while ( i < xlsub[fsupc+1] && k < xlusup[jcol+1] ) { + printf("\t%d\t%10.4f, %10.4f\n", lsub[i], lusup[k].r, lusup[k].i); + i++; k++; + } + fflush(stdout); +} + + +/*! \brief Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod". + */ +void ccheck_tempv(int n, complex *tempv) +{ + int i; + + for (i = 0; i < n; i++) { + if ((tempv[i].r != 0.0) || (tempv[i].i != 0.0)) + { + fprintf(stderr,"tempv[%d] = {%f, %f}\n", i, tempv[i].r, tempv[i].i); + ABORT("ccheck_tempv"); + } + } +} + + +void +cGenXtrue(int n, int nrhs, complex *x, int ldx) +{ + int i, j; + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + x[i + j*ldx].r = 1.0; + x[i + j*ldx].i = 0.0; + } +} + +/*! \brief Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's + */ +void +cFillRHS(trans_t trans, int nrhs, complex *x, int ldx, + SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore; + complex *Aval; + DNformat *Bstore; + complex *rhs; + complex one = {1.0, 0.0}; + complex zero = {0.0, 0.0}; + int ldc; + char transc[1]; + + Astore = A->Store; + Aval = (complex *) Astore->nzval; + Bstore = B->Store; + rhs = Bstore->nzval; + ldc = Bstore->lda; + + if ( trans == NOTRANS ) *(unsigned char *)transc = 'N'; + else *(unsigned char *)transc = 'T'; + + sp_cgemm(transc, "N", A->nrow, nrhs, A->ncol, one, A, + x, ldx, zero, rhs, ldc); + +} + +/*! \brief Fills a complex precision array with a given value. + */ +void +cfill(complex *a, int alen, complex dval) +{ + register int i; + for (i = 0; i < alen; i++) a[i] = dval; +} + + + +/*! \brief Check the inf-norm of the error vector + */ +void cinf_norm_error(int nrhs, SuperMatrix *X, complex *xtrue) +{ + DNformat *Xstore; + float err, xnorm; + complex *Xmat, *soln_work; + complex temp; + int i, j; + + Xstore = X->Store; + Xmat = Xstore->nzval; + + for (j = 0; j < nrhs; j++) { + soln_work = &Xmat[j*Xstore->lda]; + err = xnorm = 0.0; + for (i = 0; i < X->nrow; i++) { + c_sub(&temp, &soln_work[i], &xtrue[i]); + err = SUPERLU_MAX(err, c_abs(&temp)); + xnorm = SUPERLU_MAX(xnorm, c_abs(&soln_work[i])); + } + err = err / xnorm; + printf("||X - Xtrue||/||X|| = %e\n", err); + } +} + + + +/*! \brief Print performance of the code. */ +void +cPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, + float rpg, float rcond, float *ferr, + float *berr, char *equed, SuperLUStat_t *stat) +{ + SCformat *Lstore; + NCformat *Ustore; + double *utime; + flops_t *ops; + + utime = stat->utime; + ops = stat->ops; + + if ( utime[FACT] != 0. ) + printf("Factor flops = %e\tMflops = %8.2f\n", ops[FACT], + ops[FACT]*1e-6/utime[FACT]); + printf("Identify relaxed snodes = %8.2f\n", utime[RELAX]); + if ( utime[SOLVE] != 0. ) + printf("Solve flops = %.0f, Mflops = %8.2f\n", ops[SOLVE], + ops[SOLVE]*1e-6/utime[SOLVE]); + + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("\tNo of nonzeros in factor L = %d\n", Lstore->nnz); + printf("\tNo of nonzeros in factor U = %d\n", Ustore->nnz); + printf("\tNo of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage->for_lu/1e6, mem_usage->total_needed/1e6); + printf("Number of memory expansions: %d\n", stat->expansions); + + printf("\tFactor\tMflops\tSolve\tMflops\tEtree\tEquil\tRcond\tRefine\n"); + printf("PERF:%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f\n", + utime[FACT], ops[FACT]*1e-6/utime[FACT], + utime[SOLVE], ops[SOLVE]*1e-6/utime[SOLVE], + utime[ETREE], utime[EQUIL], utime[RCOND], utime[REFINE]); + + printf("\tRpg\t\tRcond\t\tFerr\t\tBerr\t\tEquil?\n"); + printf("NUM:\t%e\t%e\t%e\t%e\t%s\n", + rpg, rcond, ferr[0], berr[0], equed); + +} + + + + +print_complex_vec(char *what, int n, complex *vec) +{ + int i; + printf("%s: n %d\n", what, n); + for (i = 0; i < n; ++i) printf("%d\t%f%f\n", i, vec[i].r, vec[i].i); + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_bmod.c new file mode 100644 index 0000000..0eb2386 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_bmod.c @@ -0,0 +1,352 @@ + +/*! @file dcolumn_bmod.c + * \brief performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + *  Permission is hereby granted to use or copy this program for any
    + *  purpose, provided the above notices are retained on all copies.
    + *  Permission to modify the code and to distribute modified code is
    + *  granted, provided the above notices are retained, and a notice that
    + *  the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include +#include +#include "slu_ddefs.h" + +/* + * Function prototypes + */ +void dusolve(int, int, double*, double*); +void dlsolve(int, int, double*, double*); +void dmatvec(int, int, int, double*, double*, double*); + + + +/*! \brief + * + *
    + * Purpose:
    + * ========
    + * Performs numeric block updates (sup-col) in topological order.
    + * It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + * Special processing on the supernodal portion of L\U[*,j]
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +dcolumn_bmod ( + const int jcol, /* in */ + const int nseg, /* in */ + double *dense, /* in */ + double *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in */ + int fpanelc, /* in -- first column in the current panel */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + double alpha, beta; + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in supernode + * nsupr = no of rows in supernode (used as leading dimension) + * luptr = location of supernodal LU-block in storage + * kfnz = first nonz in the k-th supernodal segment + * no_zeros = no of leading zeros in a supernodal U-segment + */ + double ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int fsupc, nsupc, nsupr, segsze; + int nrow; /* No of rows in the matrix of matrix-vector */ + int jcolp1, jsupno, k, ksub, krep, krep_ind, ksupno; + register int lptr, kfnz, isub, irow, i; + register int no_zeros, new_next; + int ufirst, nextlu; + int fst_col; /* First column within small LU update */ + int d_fsupc; /* Distance between the first column of the current + panel and the first column of the current snode. */ + int *xsup, *supno; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + int nzlumax; + double *tempv1; + double zero = 0.0; + double one = 1.0; + double none = -1.0; + int mem_error; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + nzlumax = Glu->nzlumax; + jcolp1 = jcol + 1; + jsupno = supno[jcol]; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + + krep = segrep[k]; + k--; + ksupno = supno[krep]; + if ( jsupno != ksupno ) { /* Outside the rectangular supernode */ + + fsupc = xsup[ksupno]; + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + /* Distance from the current supernode to the current panel; + d_fsupc=0 if fsupc > fpanelc. */ + d_fsupc = fst_col - fsupc; + + luptr = xlusup[fst_col] + d_fsupc; + lptr = xlsub[fsupc] + d_fsupc; + + kfnz = repfnz[krep]; + kfnz = SUPERLU_MAX ( kfnz, fpanelc ); + + segsze = krep - kfnz + 1; + nsupc = krep - fst_col + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nrow = nsupr - d_fsupc - nsupc; + krep_ind = lptr + nsupc - 1; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + + /* + * Case 1: Update U-segment of size 1 -- col-col update + */ + if ( segsze == 1 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + dense[irow] -= ukj*lusup[luptr]; + luptr++; + } + + } else if ( segsze <= 3 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { /* Case 2: 2cols-col update */ + ukj -= ukj1 * lusup[luptr1]; + dense[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + dense[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] ); + } + } else { /* Case 3: 3cols-col update */ + ukj2 = dense[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense[lsub[krep_ind]] = ukj; + dense[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + luptr2++; + dense[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + + + } else { + /* + * Case: sup-col update + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense + */ + + no_zeros = kfnz - fst_col; + + /* Copy U[*,j] segment from dense[*] to tempv[*] */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + tempv[i] = dense[irow]; + ++isub; + } + + /* Dense triangular solve -- start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + dtrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + dgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + dlsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + dmatvec (nsupr, nrow , segsze, &lusup[luptr], tempv, tempv1); +#endif + + + /* Scatter tempv[] into SPA dense[] as a temporary storage */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense[irow] = tempv[i]; + tempv[i] = zero; + ++isub; + } + + /* Scatter tempv1[] into SPA dense[] */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + dense[irow] -= tempv1[i]; + tempv1[i] = zero; + ++isub; + } + } + + } /* if jsupno ... */ + + } /* for each segment... */ + + /* + * Process the supernodal portion of L\U[*,j] + */ + nextlu = xlusup[jcol]; + fsupc = xsup[jsupno]; + + /* Copy the SPA dense into L\U[*,j] */ + new_next = nextlu + xlsub[fsupc+1] - xlsub[fsupc]; + while ( new_next > nzlumax ) { + if (mem_error = dLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, Glu)) + return (mem_error); + lusup = Glu->lusup; + lsub = Glu->lsub; + } + + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = zero; + ++nextlu; + } + + xlusup[jcolp1] = nextlu; /* Close L\U[*,jcol] */ + + /* For more updates within the panel (also within the current supernode), + * should start from the first column of the panel, or the first column + * of the supernode, whichever is bigger. There are 2 cases: + * 1) fsupc < fpanelc, then fst_col := fpanelc + * 2) fsupc >= fpanelc, then fst_col := fsupc + */ + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + if ( fst_col < jcol ) { + + /* Distance between the current supernode and the current panel. + d_fsupc=0 if fsupc >= fpanelc. */ + d_fsupc = fst_col - fsupc; + + lptr = xlsub[fsupc] + d_fsupc; + luptr = xlusup[fst_col] + d_fsupc; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nsupc = jcol - fst_col; /* Excluding jcol */ + nrow = nsupr - d_fsupc - nsupc; + + /* Points to the beginning of jcol in snode L\U(jsupno) */ + ufirst = xlusup[jcol] + d_fsupc; + + ops[TRSV] += nsupc * (nsupc - 1); + ops[GEMV] += 2 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#else + dtrsv_( "L", "N", "U", &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#endif + + alpha = none; beta = one; /* y := beta*y + alpha*A*x */ + +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + dgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + dlsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + + dmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], tempv ); + + /* Copy updates from tempv[*] into lusup[*] */ + isub = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + lusup[isub] -= tempv[i]; + tempv[i] = 0.0; + ++isub; + } + +#endif + + + } /* if fst_col < jcol ... */ + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_dfs.c new file mode 100644 index 0000000..deebf94 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dcolumn_dfs.c @@ -0,0 +1,275 @@ + +/*! @file dcolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include "slu_ddefs.h" + +/*! \brief What type of supernodes we want */ +#define T2_SUPER + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS 
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal 
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +dcolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *xprune, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom, istop; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(3); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonz */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ( mem_error = dLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( mem_error = + dLUMemXpand(jcol,nextl,LSUB,&nzlmax,Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + +#ifdef T2_SUPER + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; +#endif + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first and last columns of + * a supernode. (first for num values, last for pruning) + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1-1) ) { /* >= 3 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + istop = ito + jptr - jm1ptr; + xprune[jcolm1] = istop; /* Initialize xprune[jcol-1] */ + xlsub[jcol] = istop; + for (ifrom = jm1ptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; /* = istop + length(jcol) */ + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xprune[jcol] = nextl; /* Initialize upper bound for pruning */ + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dcomplex.c b/thirdparty/superlu/SuperLU_4.1/SRC/dcomplex.c new file mode 100644 index 0000000..42496a6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dcomplex.c @@ -0,0 +1,147 @@ + +/*! @file dcomplex.c + * \brief Common arithmetic for complex type + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * This file defines common arithmetic operations for complex type.
    + * 
    + */ + +#include +#include +#include +#include "slu_dcomplex.h" + + +/*! \brief Complex Division c = a/b */ +void z_div(doublecomplex *c, doublecomplex *a, doublecomplex *b) +{ + double ratio, den; + double abr, abi, cr, ci; + + if( (abr = b->r) < 0.) + abr = - abr; + if( (abi = b->i) < 0.) + abi = - abi; + if( abr <= abi ) { + if (abi == 0) { + fprintf(stderr, "z_div.c: division by zero\n"); + exit(-1); + } + ratio = b->r / b->i ; + den = b->i * (1 + ratio*ratio); + cr = (a->r*ratio + a->i) / den; + ci = (a->i*ratio - a->r) / den; + } else { + ratio = b->i / b->r ; + den = b->r * (1 + ratio*ratio); + cr = (a->r + a->i*ratio) / den; + ci = (a->i - a->r*ratio) / den; + } + c->r = cr; + c->i = ci; +} + + +/*! \brief Returns sqrt(z.r^2 + z.i^2) */ +double z_abs(doublecomplex *z) +{ + double temp; + double real = z->r; + double imag = z->i; + + if (real < 0) real = -real; + if (imag < 0) imag = -imag; + if (imag > real) { + temp = real; + real = imag; + imag = temp; + } + if ((real+imag) == real) return(real); + + temp = imag/real; + temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ + return (temp); +} + + +/*! \brief Approximates the abs. Returns abs(z.r) + abs(z.i) */ +double z_abs1(doublecomplex *z) +{ + double real = z->r; + double imag = z->i; + + if (real < 0) real = -real; + if (imag < 0) imag = -imag; + + return (real + imag); +} + +/*! \brief Return the exponentiation */ +void z_exp(doublecomplex *r, doublecomplex *z) +{ + double expx; + + expx = exp(z->r); + r->r = expx * cos(z->i); + r->i = expx * sin(z->i); +} + +/*! \brief Return the complex conjugate */ +void d_cnjg(doublecomplex *r, doublecomplex *z) +{ + r->r = z->r; + r->i = -z->i; +} + +/*! \brief Return the imaginary part */ +double d_imag(doublecomplex *z) +{ + return (z->i); +} + + +/*! \brief SIGN functions for complex number. Returns z/abs(z) */ +doublecomplex z_sgn(doublecomplex *z) +{ + register double t = z_abs(z); + register doublecomplex retval; + + if (t == 0.0) { + retval.r = 1.0, retval.i = 0.0; + } else { + retval.r = z->r / t, retval.i = z->i / t; + } + + return retval; +} + +/*! \brief Square-root of a complex number. */ +doublecomplex z_sqrt(doublecomplex *z) +{ + doublecomplex retval; + register double cr, ci, real, imag; + + real = z->r; + imag = z->i; + + if ( imag == 0.0 ) { + retval.r = sqrt(real); + retval.i = 0.0; + } else { + ci = (sqrt(real*real + imag*imag) - real) / 2.0; + ci = sqrt(ci); + cr = imag / (2.0 * ci); + retval.r = cr; + retval.i = ci; + } + + return retval; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dcopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/dcopy_to_ucol.c new file mode 100644 index 0000000..5a1d7b7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dcopy_to_ucol.c @@ -0,0 +1,103 @@ + +/*! @file dcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_ddefs.h" + +int +dcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + double *dense, /* modified - reset to zero on return */ + GlobalLU_t *Glu /* modified */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + double *ucol; + int *usub, *xusub; + int nzumax; + double zero = 0.0; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if (mem_error = dLUMemXpand(jcol, nextu, UCOL, &nzumax, Glu)) + return (mem_error); + ucol = Glu->ucol; + if (mem_error = dLUMemXpand(jcol, nextu, USUB, &nzumax, Glu)) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + dense[irow] = zero; + nextu++; + isub++; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ddiagonal.c b/thirdparty/superlu/SuperLU_4.1/SRC/ddiagonal.c new file mode 100644 index 0000000..60c7aa1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ddiagonal.c @@ -0,0 +1,129 @@ + +/*! @file ddiagonal.c + * \brief Auxiliary routines to work with diagonal elements + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +int dfill_diag(int n, NCformat *Astore) +/* fill explicit zeros on the diagonal entries, so that the matrix is not + structurally singular. */ +{ + double *nzval = (double *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + double *nzval_new; + double zero = 0.0; + int *rowind_new; + int i, j, diag; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = doubleMalloc(nnz + fill); + rowind_new = intMalloc(nnz + fill); + fill = 0; + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + } + if (diag < 0) + { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = zero; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + Astore->nnz += fill; + return fill; +} + +int ddominate(int n, NCformat *Astore) +/* make the matrix diagonally dominant */ +{ + double *nzval = (double *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + double *nzval_new; + int *rowind_new; + int i, j, diag; + double s; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = doubleMalloc(nnz + fill); + rowind_new = intMalloc(nnz+ fill); + fill = 0; + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + s += fabs(nzval_new[j + fill] = nzval[j]); + } + if (diag >= 0) { + nzval_new[diag+fill] = s * 3.0; + } else { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = s * 3.0; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + else + { + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + { + if (rowind[j] == i) diag = j; + s += fabs(nzval[j]); + } + nzval[diag] = s * 3.0; + } + } + Astore->nnz += fill; + return fill; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgscon.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgscon.c new file mode 100644 index 0000000..d91474a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgscon.c @@ -0,0 +1,157 @@ + +/*! @file dgscon.c + * \brief Estimates reciprocal of the condition number of a general matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routines DGECON.
    + * 
    + */ + +/* + * File name: dgscon.c + * History: Modified from lapack routines DGECON. + */ +#include +#include "slu_ddefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   DGSCON estimates the reciprocal of the condition number of a general 
    + *   real matrix A, in either the 1-norm or the infinity-norm, using   
    + *   the LU factorization computed by DGETRF.   *
    + *
    + *   An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    + *   condition number is computed as   
    + *      RCOND = 1 / ( norm(A) * norm(inv(A)) ).   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + *   Arguments   
    + *   =========   
    + *
    + *    NORM    (input) char*
    + *            Specifies whether the 1-norm condition number or the   
    + *            infinity-norm condition number is required:   
    + *            = '1' or 'O':  1-norm;   
    + *            = 'I':         Infinity-norm.
    + *	    
    + *    L       (input) SuperMatrix*
    + *            The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *            dgstrf(). Use compressed row subscripts storage for supernodes,
    + *            i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + * 
    + *    U       (input) SuperMatrix*
    + *            The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *            dgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *            Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *	    
    + *    ANORM   (input) double
    + *            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    + *            If NORM = 'I', the infinity-norm of the original matrix A.
    + *	    
    + *    RCOND   (output) double*
    + *           The reciprocal of the condition number of the matrix A,   
    + *           computed as RCOND = 1/(norm(A) * norm(inv(A))).
    + *	    
    + *    INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    ===================================================================== 
    + * 
    + */ + +void +dgscon(char *norm, SuperMatrix *L, SuperMatrix *U, + double anorm, double *rcond, SuperLUStat_t *stat, int *info) +{ + + + /* Local variables */ + int kase, kase1, onenrm, i; + double ainvnm; + double *work; + int *iwork; + extern int drscl_(int *, double *, double *, int *); + + extern int dlacon_(int *, double *, double *, int *, double *, int *); + + + /* Test the input parameters. */ + *info = 0; + onenrm = *(unsigned char *)norm == '1' || lsame_(norm, "O"); + if (! onenrm && ! lsame_(norm, "I")) *info = -1; + else if (L->nrow < 0 || L->nrow != L->ncol || + L->Stype != SLU_SC || L->Dtype != SLU_D || L->Mtype != SLU_TRLU) + *info = -2; + else if (U->nrow < 0 || U->nrow != U->ncol || + U->Stype != SLU_NC || U->Dtype != SLU_D || U->Mtype != SLU_TRU) + *info = -3; + if (*info != 0) { + i = -(*info); + xerbla_("dgscon", &i); + return; + } + + /* Quick return if possible */ + *rcond = 0.; + if ( L->nrow == 0 || U->nrow == 0) { + *rcond = 1.; + return; + } + + work = doubleCalloc( 3*L->nrow ); + iwork = intMalloc( L->nrow ); + + + if ( !work || !iwork ) + ABORT("Malloc fails for work arrays in dgscon."); + + /* Estimate the norm of inv(A). */ + ainvnm = 0.; + if ( onenrm ) kase1 = 1; + else kase1 = 2; + kase = 0; + + do { + dlacon_(&L->nrow, &work[L->nrow], &work[0], &iwork[0], &ainvnm, &kase); + + if (kase == 0) break; + + if (kase == kase1) { + /* Multiply by inv(L). */ + sp_dtrsv("L", "No trans", "Unit", L, U, &work[0], stat, info); + + /* Multiply by inv(U). */ + sp_dtrsv("U", "No trans", "Non-unit", L, U, &work[0], stat, info); + + } else { + + /* Multiply by inv(U'). */ + sp_dtrsv("U", "Transpose", "Non-unit", L, U, &work[0], stat, info); + + /* Multiply by inv(L'). */ + sp_dtrsv("L", "Transpose", "Unit", L, U, &work[0], stat, info); + + } + + } while ( kase != 0 ); + + /* Compute the estimate of the reciprocal condition number. */ + if (ainvnm != 0.) *rcond = (1. / ainvnm) / anorm; + + SUPERLU_FREE (work); + SUPERLU_FREE (iwork); + return; + +} /* dgscon */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgsequ.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgsequ.c new file mode 100644 index 0000000..73870d4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgsequ.c @@ -0,0 +1,195 @@ + +/*! @file dgsequ.c + * \brief Computes row and column scalings + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from LAPACK routine DGEEQU
    + * 
    + */ +/* + * File name: dgsequ.c + * History: Modified from LAPACK routine DGEEQU + */ +#include +#include "slu_ddefs.h" + + + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   DGSEQU computes row and column scalings intended to equilibrate an   
    + *   M-by-N sparse matrix A and reduce its condition number. R returns the row
    + *   scale factors and C the column scale factors, chosen to try to make   
    + *   the largest element in each row and column of the matrix B with   
    + *   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.   
    + *
    + *   R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    + *   number and BIGNUM = largest safe number.  Use of these scaling   
    + *   factors is not guaranteed to reduce the condition number of A but   
    + *   works well in practice.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input) SuperMatrix*
    + *           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    + *           factors are to be computed. The type of A can be:
    + *           Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE.
    + *	    
    + *   R       (output) double*, size A->nrow
    + *           If INFO = 0 or INFO > M, R contains the row scale factors   
    + *           for A.
    + *	    
    + *   C       (output) double*, size A->ncol
    + *           If INFO = 0,  C contains the column scale factors for A.
    + *	    
    + *   ROWCND  (output) double*
    + *           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    + *           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    + *           AMAX is neither too large nor too small, it is not worth   
    + *           scaling by R.
    + *	    
    + *   COLCND  (output) double*
    + *           If INFO = 0, COLCND contains the ratio of the smallest   
    + *           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    + *           worth scaling by C.
    + *	    
    + *   AMAX    (output) double*
    + *           Absolute value of largest matrix element.  If AMAX is very   
    + *           close to overflow or very close to underflow, the matrix   
    + *           should be scaled.
    + *	    
    + *   INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *           > 0:  if INFO = i,  and i is   
    + *                 <= A->nrow:  the i-th row of A is exactly zero   
    + *                 >  A->ncol:  the (i-M)-th column of A is exactly zero   
    + *
    + *   ===================================================================== 
    + * 
    + */ +void +dgsequ(SuperMatrix *A, double *r, double *c, double *rowcnd, + double *colcnd, double *amax, int *info) +{ + + + /* Local variables */ + NCformat *Astore; + double *Aval; + int i, j, irow; + double rcmin, rcmax; + double bignum, smlnum; + extern double dlamch_(char *); + + /* Test the input parameters. */ + *info = 0; + if ( A->nrow < 0 || A->ncol < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_D || A->Mtype != SLU_GE ) + *info = -1; + if (*info != 0) { + i = -(*info); + xerbla_("dgsequ", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || A->ncol == 0 ) { + *rowcnd = 1.; + *colcnd = 1.; + *amax = 0.; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Get machine constants. */ + smlnum = dlamch_("S"); + bignum = 1. / smlnum; + + /* Compute row scale factors. */ + for (i = 0; i < A->nrow; ++i) r[i] = 0.; + + /* Find the maximum element in each row. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + r[irow] = SUPERLU_MAX( r[irow], fabs(Aval[i]) ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (i = 0; i < A->nrow; ++i) { + rcmax = SUPERLU_MAX(rcmax, r[i]); + rcmin = SUPERLU_MIN(rcmin, r[i]); + } + *amax = rcmax; + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (i = 0; i < A->nrow; ++i) + if (r[i] == 0.) { + *info = i + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (i = 0; i < A->nrow; ++i) + r[i] = 1. / SUPERLU_MIN( SUPERLU_MAX( r[i], smlnum ), bignum ); + /* Compute ROWCND = min(R(I)) / max(R(I)) */ + *rowcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + /* Compute column scale factors */ + for (j = 0; j < A->ncol; ++j) c[j] = 0.; + + /* Find the maximum element in each column, assuming the row + scalings computed above. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + c[j] = SUPERLU_MAX( c[j], fabs(Aval[i]) * r[irow] ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->ncol; ++j) { + rcmax = SUPERLU_MAX(rcmax, c[j]); + rcmin = SUPERLU_MIN(rcmin, c[j]); + } + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (j = 0; j < A->ncol; ++j) + if ( c[j] == 0. ) { + *info = A->nrow + j + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (j = 0; j < A->ncol; ++j) + c[j] = 1. / SUPERLU_MIN( SUPERLU_MAX( c[j], smlnum ), bignum); + /* Compute COLCND = min(C(J)) / max(C(J)) */ + *colcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + return; + +} /* dgsequ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgsisx.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgsisx.c new file mode 100644 index 0000000..6c2b902 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgsisx.c @@ -0,0 +1,723 @@ + +/*! @file dgsisx.c + * \brief Computes an approximate solutions of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * November, 2010
    + * 
    + */ +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSISX computes an approximate solutions of linear equations
    + * A*X=B or A'*X=B, using the ILU factorization from dgsitrf().
    + * An estimation of the condition number is provided. 
    + * The routine performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A is
    + *	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *	     = TRANS or CONJ).
    + *
    + *	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *	     matrix that usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the matrix A (after equilibration if options->Equil = YES)
    + *	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *	1.4. Compute the reciprocal pivot growth factor.
    + *
    + *	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    + *	     and info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	1.6. The system of equations is solved for X using the factored form
    + *	     of A.
    + *
    + *	1.7. options->IterRefine is not used
    + *
    + *	1.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *	1.9. options for ILU only
    + *	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    + *		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    + *		entries of modulus 1 on the diagonal and off-diagonal entries
    + *		of modulus at most 1. If MC64 fails, dgsequ() is used to
    + *		equilibrate the system.
    + *              ( Default: LargeDiag )
    + *	     2) options->ILU_DropTol = tau is the threshold for dropping.
    + *		For L, it is used directly (for the whole row in a supernode);
    + *		For U, ||A(:,i)||_oo * tau is used as the threshold
    + *	        for the	i-th column.
    + *		If a secondary dropping rule is required, tau will
    + *	        also be used to compute the second threshold.
    + *              ( Default: 1e-4 )
    + *	     3) options->ILU_FillFactor = gamma, used as the initial guess
    + *		of memory growth.
    + *		If a secondary dropping rule is required, it will also
    + *              be used as an upper bound of the memory.
    + *              ( Default: 10 )
    + *	     4) options->ILU_DropRule specifies the dropping rule.
    + *		Option	      Meaning
    + *		======	      ===========
    + *		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    + *		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    + *		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    + *			      p = gamma * nnz(A(:,j)).
    + *		DROP_AREA:    Variation of ILUTP, for j-th column, use
    + *			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    + *		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    + *			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    + *				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    + *			      Otherwise
    + *				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    + *			      tau_U(j) uses the similar rule.
    + *			      NOTE: the thresholds used by L and U are separate.
    + *		DROP_INTERP:  Compute the second dropping threshold by
    + *			      interpolation instead of sorting (default).
    + *			      In this case, the actual fill ratio is not
    + *			      guaranteed smaller than gamma.
    + *		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    + *		( Default: DROP_BASIC | DROP_AREA )
    + *	     5) options->ILU_Norm is the criterion of measuring the magnitude
    + *		of a row in a supernode of L. ( Default is INF_NORM )
    + *		options->ILU_Norm	RowSize(x[1:n])
    + *		=================	===============
    + *		ONE_NORM		||x||_1 / n
    + *		TWO_NORM		||x||_2 / sqrt(n)
    + *		INF_NORM		max{|x[i]|}
    + *	     6) options->ILU_MILU specifies the type of MILU's variation.
    + *		= SILU: do not perform Modified ILU;
    + *		= SMILU_1 (not recommended):
    + *		    U(i,i) := U(i,i) + sum(dropped entries);
    + *		= SMILU_2:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    + *		= SMILU_3:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    + *		NOTE: Even SMILU_1 does not preserve the column sum because of
    + *		late dropping.
    + *              ( Default: SILU )
    + *	     7) options->ILU_FillTol is used as the perturbation when
    + *		encountering zero pivots. If some U(i,i) = 0, so that U is
    + *		exactly singular, then
    + *		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    + *              ( Default: 1e-2 )
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *	to the transpose of A:
    + *
    + *	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A' is
    + *	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    + *	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *	2.2. Permute columns of transpose(A) (rows of A),
    + *	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    + *	     usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the transpose(A) (after equilibration if
    + *	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *	     permutation Pr determined by partial pivoting.
    + *
    + *	2.4. Compute the reciprocal pivot growth factor.
    + *
    + *	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    + *	     And info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	2.6. The system of equations is solved for X using the factored form
    + *	     of transpose(A).
    + *
    + *	2.7. If options->IterRefine is not used.
    + *
    + *	2.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the LU decomposition will be performed and how the
    + *	   system will be solved.
    + *
    + * A	   (input/output) SuperMatrix*
    + *	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *	   of the linear equations is A->nrow. Currently, the type of A can be:
    + *	   Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *	   In the future, more general A may be handled.
    + *
    + *	   On entry, If options->Fact = FACTORED and equed is not 'N',
    + *	   then A must have been equilibrated by the scaling factors in
    + *	   R and/or C.
    + *	   On exit, A is not modified
    + *         if options->Equil = NO, or
    + *         if options->Equil = YES but equed = 'N' on exit, or
    + *         if options->RowPerm = NO.
    + *
    + *	   Otherwise, if options->Equil = YES and equed is not 'N',
    + *	   A is scaled as follows:
    + *	   If A->Stype = SLU_NC:
    + *	     equed = 'R':  A := diag(R) * A
    + *	     equed = 'C':  A := A * diag(C)
    + *	     equed = 'B':  A := diag(R) * A * diag(C).
    + *	   If A->Stype = SLU_NR:
    + *	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix to an I-matrix, that is A is modified as follows:
    + *            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    + *            off-diagonal entries of modulus at most 1. P is a permutation
    + *            obtained from MC64.
    + *            If MC64 fails, dgsequ() is used to equilibrate the system,
    + *            and A is scaled as above, there is no permutation involved.
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *	   which defines the permutation matrix Pc; perm_c[i] = j means
    + *	   column i of A is in position j in A*Pc.
    + *	   On exit, perm_c may be overwritten by the product of the input
    + *	   perm_c and a permutation that postorders the elimination tree
    + *	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *	   is already in postorder.
    + *
    + *	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *	   which describes permutation of columns of transpose(A) 
    + *	   (rows of A) as described above.
    + *
    + * perm_r  (input/output) int*
    + *	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *	   which defines the permutation matrix Pr, and is determined
    + *	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *	   position j in Pr*A.
    + *
    + *	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *	   determines permutation of rows of transpose(A)
    + *	   (columns of A) as described above.
    + *
    + *	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	   will try to use the input perm_r, unless a certain threshold
    + *	   criterion is violated. In that case, perm_r is overwritten by a
    + *	   new permutation determined by partial pivoting or diagonal
    + *	   threshold pivoting.
    + *	   Otherwise, perm_r is output argument.
    + *
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *	   Elimination tree of Pc'*A'*A*Pc.
    + *	   If options->Fact != FACTORED and options->Fact != DOFACT,
    + *	   etree is an input argument, otherwise it is an output argument.
    + *	   Note: etree is a vector of parent pointers for a forest whose
    + *	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *	   Specifies the form of equilibration that was done.
    + *	   = 'N': No equilibration.
    + *	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *	   = 'B': Both row and column equilibration, i.e., A was replaced 
    + *		  by diag(R)*A*diag(C).
    + *	   If options->Fact = FACTORED, equed is an input argument,
    + *	   otherwise it is an output argument.
    + *
    + * R	   (input/output) double*, dimension (A->nrow)
    + *	   The row scale factors for A or transpose(A).
    + *	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *	   If equed = 'N' or 'C', R is not accessed.
    + *	   If options->Fact = FACTORED, R is an input argument,
    + *	       otherwise, R is output.
    + *	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *	       of R must be positive.
    + *
    + * C	   (input/output) double*, dimension (A->ncol)
    + *	   The column scale factors for A or transpose(A).
    + *	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *	   If equed = 'N' or 'R', C is not accessed.
    + *	   If options->Fact = FACTORED, C is an input argument,
    + *	       otherwise, C is output.
    + *	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *	       of C must be positive.
    + *
    + * L	   (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses compressed row subscripts storage for supernodes, i.e.,
    + *	   L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U	   (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses column-wise storage scheme, i.e., U has types:
    + *	   Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *	   User supplied workspace, should be large enough
    + *	   to hold data structures for factors L and U.
    + *	   On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 mem_usage->total_needed; no other side effects.
    + *
    + *	   See argument 'mem_usage' for memory usage statistics.
    + *
    + * B	   (input/output) SuperMatrix*
    + *	   B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *	   On entry, the right hand side matrix.
    + *	   If B->ncol = 0, only LU decomposition is performed, the triangular
    + *			   solve is skipped.
    + *	   On exit,
    + *	      if equed = 'N', B is not modified; otherwise
    + *	      if A->Stype = SLU_NC:
    + *		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *		    B is overwritten by diag(R)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *		    B is overwritten by diag(C)*B;
    + *	      if A->Stype = SLU_NR:
    + *		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *		    B is overwritten by diag(C)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *		    B is overwritten by diag(R)*B.
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix A to an I-matrix. Then, in addition to the scaling
    + *            above, B is further permuted by P*B if options->Trans = NOTRANS,
    + *            where P is obtained from MC64.
    + *
    + * X	   (output) SuperMatrix*
    + *	   X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *	   to the original system of equations. Note that A and B are modified
    + *	   on exit if equed is not 'N', and the solution to the equilibrated
    + *	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *	   and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) double*
    + *	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *	   The infinity norm is used. If recip_pivot_growth is much less
    + *	   than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) double*
    + *	   The estimate of the reciprocal condition number of the matrix A
    + *	   after equilibration (if done). If rcond is less than the machine
    + *	   precision (in particular, if rcond = 0), the matrix is singular
    + *	   to working precision. This condition is indicated by a return
    + *	   code of info > 0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *	   Record the memory usage statistics, consisting of following fields:
    + *	   - for_lu (float)
    + *	     The amount of space used in bytes for L\U data structures.
    + *	   - total_needed (float)
    + *	     The amount of space needed in bytes to perform factorization.
    + *	   - expansions (int)
    + *	     The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *	  Record the statistics on runtime and floating-point operation count.
    + *	  See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + *	   > 0: if info = i, and i is
    + *		<= A->ncol: number of zero pivots. They are replaced by small
    + *		      entries due to options->ILU_FillTol.
    + *		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *		      precision, meaning that the matrix is singular to
    + *		      working precision. Nevertheless, the solution and
    + *		      error bounds are computed because there are a number
    + *		      of situations where the computed solution can be more
    + *		      accurate than the value of RCOND would suggest.
    + *		> A->ncol+1: number of bytes allocated when memory allocation
    + *		      failure occurred, plus A->ncol.
    + * 
    + */ + +void +dgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, double *R, double *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, + double *recip_pivot_growth, double *rcond, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info) +{ + + DNformat *Bstore, *Xstore; + double *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec, mc64; + trans_t trant; + char norm[1]; + int i, j, info1; + double amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + double diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + int *perm = NULL; + + /* External functions */ + extern double dlangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + mc64 = (options->RowPerm == LargeDiag); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = dlamch_("Safe minimum"); + bignum = 1. / smlnum; + } + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_D || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_D || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_D || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("dgsisx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + dCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact ) { + register int i, j; + NCformat *Astore = AA->Store; + int nnz = Astore->nnz; + int *colptr = Astore->colptr; + int *rowind = Astore->rowind; + double *nzval = (double *)Astore->nzval; + int n = AA->nrow; + + if ( mc64 ) { + *equed = 'B'; + /*rowequ = colequ = 1;*/ + t0 = SuperLU_timer_(); + if ((perm = intMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for perm[]"); + + info1 = dldperm(5, n, nnz, colptr, rowind, nzval, perm, R, C); + + if (info1 > 0) { /* MC64 fails, call dgsequ() later */ + mc64 = 0; + SUPERLU_FREE(perm); + perm = NULL; + } else { + rowequ = colequ = 1; + for (i = 0; i < n; i++) { + R[i] = exp(R[i]); + C[i] = exp(C[i]); + } + /* permute and scale the matrix */ + for (j = 0; j < n; j++) { + for (i = colptr[j]; i < colptr[j + 1]; i++) { + nzval[i] *= R[rowind[i]] * C[j]; + rowind[i] = perm[rowind[i]]; + } + } + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + if ( !mc64 & equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + dgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + dlaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + dgsitrf(options, &AC, relax, panel_size, etree, work, lwork, + perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) return; + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = dPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = dlangs(norm, AA); + dgscon(norm, L, U, anorm, rcond, stat, &info1); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { /* Solve the system */ + double *tmp, *rhs_work; + int n = A->nrow; + if ( mc64 ) { + if ((tmp = doubleMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for tmp[]"); + } + + /* Scale and permute the right-hand side if equilibration + and permutation from MC64 were performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) + Bmat[i + j*ldb] *= R[i]; + } + if ( mc64 ) { + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (i = 0; i < n; i++) tmp[perm[i]] = rhs_work[i]; + for (i = 0; i < n; i++) rhs_work[i] = tmp[i]; + } + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + Bmat[i + j*ldb] *= C[i]; + } + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + dgstrs (trant, L, U, perm_c, perm_r, X, stat, &info1); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original + system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + Xmat[i + j*ldx] *= C[i]; + } + } + } else { /* transposed system */ + if ( rowequ ) { + if ( mc64 ) { + for (j = 0; j < nrhs; j++) { + for (i = 0; i < n; i++) + tmp[i] = Xmat[i + j * ldx]; /*dcopy*/ + for (i = 0; i < n; i++) + Xmat[i + j * ldx] = R[i] * tmp[perm[i]]; + } + } else { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + Xmat[i + j*ldx] *= R[i]; + } + } + } + } + + if ( mc64 ) SUPERLU_FREE(tmp); + + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < dlamch_("E") && *info == 0) *info = A->ncol + 1; + } + + if (perm) SUPERLU_FREE(perm); + + if ( nofact ) { + ilu_dQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c new file mode 100644 index 0000000..ec46e70 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c @@ -0,0 +1,638 @@ + +/*! @file dgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +dgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + double *dwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + double *dense, *tempv; + int *relax_end, *relax_fsupc; + double *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double *amax; + double drop_sum; + double alpha, omega; /* used in MILU, mimicing DRIC */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + double *dwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + double zero = 0.0; + double one = 1.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = dLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &dwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + dSetRWork(m, panel_size, dwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (double *) doubleMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + dwork2 = (double *)doubleMalloc(n); + else + dwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + alpha = pow((double)n, -1.0 / options->ILU_MILU_Dim); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + i = ilu_ddrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, tempv, dwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_dsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = dLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register double tmp = fabs(a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + dsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_dpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_dpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + dpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_dcolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = dcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = dLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_dcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + dwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + if (drop_sum != zero) + { + if (drop_sum > zero) + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) + * amax[jj - jcol] / drop_sum, one); + else + omega = SUPERLU_MAX(2.0 * (1.0 - alpha) + * amax[jj - jcol] / drop_sum, -one); + drop_sum *= omega; + } + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_dpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + i = ilu_ddrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, tempv, dwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + dLUWorkFree(iwork, dwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + dCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_D, SLU_TRLU); + dCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_D, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( dwork2 ) SUPERLU_FREE (dwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c.bak new file mode 100644 index 0000000..969b5c1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgsitrf.c.bak @@ -0,0 +1,626 @@ + +/*! @file dgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +dgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + double *dwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + double *dense, *tempv; + int *relax_end, *relax_fsupc; + double *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double *amax; + double drop_sum; + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + int *iwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + double zero = 0.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = dLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &dwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + dSetRWork(m, panel_size, dwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (double *) doubleMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + iwork2 = (int *)intMalloc(n); + else + iwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + i = ilu_ddrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, tempv, iwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_dsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = dLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register double tmp = fabs(a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + dsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_dpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_dpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + dpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_dcolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = dcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = dLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_dcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + iwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + drop_sum *= MILU_ALPHA; + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_dpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + i = ilu_ddrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, tempv, iwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + dLUWorkFree(iwork, dwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + dCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_D, SLU_TRLU); + dCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_D, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( iwork2 ) SUPERLU_FREE (iwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgsrfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgsrfs.c new file mode 100644 index 0000000..55531b0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgsrfs.c @@ -0,0 +1,452 @@ + +/*! @file dgsrfs.c + * \brief Improves computed solution to a system of inear equations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routine DGERFS
    + * 
    + */ +/* + * File name: dgsrfs.c + * History: Modified from lapack routine DGERFS + */ +#include +#include "slu_ddefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   DGSRFS improves the computed solution to a system of linear   
    + *   equations and provides error bounds and backward error estimates for 
    + *   the solution.   
    + *
    + *   If equilibration was performed, the system becomes:
    + *           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *   
    + *   A       (input) SuperMatrix*
    + *           The original matrix A in the system, or the scaled A if
    + *           equilibration was done. The type of A can be:
    + *           Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_GE.
    + *    
    + *   L       (input) SuperMatrix*
    + *	     The factor L from the factorization Pr*A*Pc=L*U. Use
    + *           compressed row subscripts storage for supernodes, 
    + *           i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + * 
    + *   U       (input) SuperMatrix*
    + *           The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *           dgstrf(). Use column-wise storage scheme, 
    + *           i.e., U has types: Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + *   perm_c  (input) int*, dimension (A->ncol)
    + *	     Column permutation vector, which defines the 
    + *           permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *           in position j in A*Pc.
    + *
    + *   perm_r  (input) int*, dimension (A->nrow)
    + *           Row permutation vector, which defines the permutation matrix Pr;
    + *           perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + *   equed   (input) Specifies the form of equilibration that was done.
    + *           = 'N': No equilibration.
    + *           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *           = 'C': Column equilibration, i.e., A was postmultiplied by
    + *                  diag(C).
    + *           = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                  by diag(R)*A*diag(C).
    + *
    + *   R       (input) double*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *           If equed = 'R' or 'B', A is premultiplied by diag(R).
    + *           If equed = 'N' or 'C', R is not accessed.
    + * 
    + *   C       (input) double*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    + *           If equed = 'N' or 'R', C is not accessed.
    + *
    + *   B       (input) SuperMatrix*
    + *           B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *           The right hand side matrix B.
    + *           if equed = 'R' or 'B', B is premultiplied by diag(R).
    + *
    + *   X       (input/output) SuperMatrix*
    + *           X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *           On entry, the solution matrix X, as computed by dgstrs().
    + *           On exit, the improved solution matrix X.
    + *           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    + *               in order to obtain the solution to the original system.
    + *
    + *   FERR    (output) double*, dimension (B->ncol)   
    + *           The estimated forward error bound for each solution vector   
    + *           X(j) (the j-th column of the solution matrix X).   
    + *           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *           is an estimated upper bound for the magnitude of the largest 
    + *           element in (X(j) - XTRUE) divided by the magnitude of the   
    + *           largest element in X(j).  The estimate is as reliable as   
    + *           the estimate for RCOND, and is almost always a slight   
    + *           overestimate of the true error.
    + *
    + *   BERR    (output) double*, dimension (B->ncol)   
    + *           The componentwise relative backward error of each solution   
    + *           vector X(j) (i.e., the smallest relative change in   
    + *           any element of A or B that makes X(j) an exact solution).
    + *
    + *   stat     (output) SuperLUStat_t*
    + *            Record the statistics on runtime and floating-point operation count.
    + *            See util.h for the definition of 'SuperLUStat_t'.
    + *
    + *   info    (output) int*   
    + *           = 0:  successful exit   
    + *            < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    Internal Parameters   
    + *    ===================   
    + *
    + *    ITMAX is the maximum number of steps of iterative refinement.   
    + *
    + * 
    + */ +void +dgsrfs(trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, char *equed, double *R, double *C, + SuperMatrix *B, SuperMatrix *X, double *ferr, double *berr, + SuperLUStat_t *stat, int *info) +{ + + +#define ITMAX 5 + + /* Table of constant values */ + int ione = 1; + double ndone = -1.; + double done = 1.; + + /* Local variables */ + NCformat *Astore; + double *Aval; + SuperMatrix Bjcol; + DNformat *Bstore, *Xstore, *Bjcol_store; + double *Bmat, *Xmat, *Bptr, *Xptr; + int kase; + double safe1, safe2; + int i, j, k, irow, nz, count, notran, rowequ, colequ; + int ldb, ldx, nrhs; + double s, xk, lstres, eps, safmin; + char transc[1]; + trans_t transt; + double *work; + double *rwork; + int *iwork; + + extern int dlacon_(int *, double *, double *, int *, double *, int *); +#ifdef _CRAY + extern int SCOPY(int *, double *, int *, double *, int *); + extern int SSAXPY(int *, double *, double *, int *, double *, int *); +#else + extern int dcopy_(int *, double *, int *, double *, int *); + extern int daxpy_(int *, double *, double *, int *, double *, int *); +#endif + + Astore = A->Store; + Aval = Astore->nzval; + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + /* Test the input parameters */ + *info = 0; + notran = (trans == NOTRANS); + if ( !notran && trans != TRANS && trans != CONJ ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_D || A->Mtype != SLU_GE ) + *info = -2; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_D || L->Mtype != SLU_TRLU ) + *info = -3; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_D || U->Mtype != SLU_TRU ) + *info = -4; + else if ( ldb < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_D || B->Mtype != SLU_GE ) + *info = -10; + else if ( ldx < SUPERLU_MAX(0, A->nrow) || + X->Stype != SLU_DN || X->Dtype != SLU_D || X->Mtype != SLU_GE ) + *info = -11; + if (*info != 0) { + i = -(*info); + xerbla_("dgsrfs", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || nrhs == 0) { + for (j = 0; j < nrhs; ++j) { + ferr[j] = 0.; + berr[j] = 0.; + } + return; + } + + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + + /* Allocate working space */ + work = doubleMalloc(2*A->nrow); + rwork = (double *) SUPERLU_MALLOC( A->nrow * sizeof(double) ); + iwork = intMalloc(2*A->nrow); + if ( !work || !rwork || !iwork ) + ABORT("Malloc fails for work/rwork/iwork."); + + if ( notran ) { + *(unsigned char *)transc = 'N'; + transt = TRANS; + } else { + *(unsigned char *)transc = 'T'; + transt = NOTRANS; + } + + /* NZ = maximum number of nonzero elements in each row of A, plus 1 */ + nz = A->ncol + 1; + eps = dlamch_("Epsilon"); + safmin = dlamch_("Safe minimum"); + /* Set SAFE1 essentially to be the underflow threshold times the + number of additions in each row. */ + safe1 = nz * safmin; + safe2 = safe1 / eps; + + /* Compute the number of nonzeros in each row (or column) of A */ + for (i = 0; i < A->nrow; ++i) iwork[i] = 0; + if ( notran ) { + for (k = 0; k < A->ncol; ++k) + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + ++iwork[Astore->rowind[i]]; + } else { + for (k = 0; k < A->ncol; ++k) + iwork[k] = Astore->colptr[k+1] - Astore->colptr[k]; + } + + /* Copy one column of RHS B into Bjcol. */ + Bjcol.Stype = B->Stype; + Bjcol.Dtype = B->Dtype; + Bjcol.Mtype = B->Mtype; + Bjcol.nrow = B->nrow; + Bjcol.ncol = 1; + Bjcol.Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !Bjcol.Store ) ABORT("SUPERLU_MALLOC fails for Bjcol.Store"); + Bjcol_store = Bjcol.Store; + Bjcol_store->lda = ldb; + Bjcol_store->nzval = work; /* address aliasing */ + + /* Do for each right hand side ... */ + for (j = 0; j < nrhs; ++j) { + count = 0; + lstres = 3.; + Bptr = &Bmat[j*ldb]; + Xptr = &Xmat[j*ldx]; + + while (1) { /* Loop until stopping criterion is satisfied. */ + + /* Compute residual R = B - op(A) * X, + where op(A) = A, A**T, or A**H, depending on TRANS. */ + +#ifdef _CRAY + SCOPY(&A->nrow, Bptr, &ione, work, &ione); +#else + dcopy_(&A->nrow, Bptr, &ione, work, &ione); +#endif + sp_dgemv(transc, ndone, A, Xptr, ione, done, work, ione); + + /* Compute componentwise relative backward error from formula + max(i) ( abs(R(i)) / ( abs(op(A))*abs(X) + abs(B) )(i) ) + where abs(Z) is the componentwise absolute value of the matrix + or vector Z. If the i-th component of the denominator is less + than SAFE2, then SAFE1 is added to the i-th component of the + numerator before dividing. */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = fabs( Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if (notran) { + for (k = 0; k < A->ncol; ++k) { + xk = fabs( Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += fabs(Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + s += fabs(Aval[i]) * fabs(Xptr[irow]); + } + rwork[k] += s; + } + } + s = 0.; + for (i = 0; i < A->nrow; ++i) { + if (rwork[i] > safe2) { + s = SUPERLU_MAX( s, fabs(work[i]) / rwork[i] ); + } else if ( rwork[i] != 0.0 ) { + /* Adding SAFE1 to the numerator guards against + spuriously zero residuals (underflow). */ + s = SUPERLU_MAX( s, (safe1 + fabs(work[i])) / rwork[i] ); + } + /* If rwork[i] is exactly 0.0, then we know the true + residual also must be exactly 0.0. */ + } + berr[j] = s; + + /* Test stopping criterion. Continue iterating if + 1) The residual BERR(J) is larger than machine epsilon, and + 2) BERR(J) decreased by at least a factor of 2 during the + last iteration, and + 3) At most ITMAX iterations tried. */ + + if (berr[j] > eps && berr[j] * 2. <= lstres && count < ITMAX) { + /* Update solution and try again. */ + dgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + +#ifdef _CRAY + SAXPY(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#else + daxpy_(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#endif + lstres = berr[j]; + ++count; + } else { + break; + } + + } /* end while */ + + stat->RefineSteps = count; + + /* Bound error from formula: + norm(X - XTRUE) / norm(X) .le. FERR = norm( abs(inv(op(A)))* + ( abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) / norm(X) + where + norm(Z) is the magnitude of the largest component of Z + inv(op(A)) is the inverse of op(A) + abs(Z) is the componentwise absolute value of the matrix or + vector Z + NZ is the maximum number of nonzeros in any row of A, plus 1 + EPS is machine epsilon + + The i-th component of abs(R)+NZ*EPS*(abs(op(A))*abs(X)+abs(B)) + is incremented by SAFE1 if the i-th component of + abs(op(A))*abs(X) + abs(B) is less than SAFE2. + + Use DLACON to estimate the infinity-norm of the matrix + inv(op(A)) * diag(W), + where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = fabs( Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if ( notran ) { + for (k = 0; k < A->ncol; ++k) { + xk = fabs( Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += fabs(Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + xk = fabs( Xptr[irow] ); + s += fabs(Aval[i]) * xk; + } + rwork[k] += s; + } + } + + for (i = 0; i < A->nrow; ++i) + if (rwork[i] > safe2) + rwork[i] = fabs(work[i]) + (iwork[i]+1)*eps*rwork[i]; + else + rwork[i] = fabs(work[i])+(iwork[i]+1)*eps*rwork[i]+safe1; + + kase = 0; + + do { + dlacon_(&A->nrow, &work[A->nrow], work, + &iwork[A->nrow], &ferr[j], &kase); + if (kase == 0) break; + + if (kase == 1) { + /* Multiply by diag(W)*inv(op(A)**T)*(diag(C) or diag(R)). */ + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= C[i]; + else if ( !notran && rowequ ) + for (i = 0; i < A->nrow; ++i) work[i] *= R[i]; + + dgstrs (transt, L, U, perm_c, perm_r, &Bjcol, stat, info); + + for (i = 0; i < A->nrow; ++i) work[i] *= rwork[i]; + } else { + /* Multiply by (diag(C) or diag(R))*inv(op(A))*diag(W). */ + for (i = 0; i < A->nrow; ++i) work[i] *= rwork[i]; + + dgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= C[i]; + else if ( !notran && rowequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= R[i]; + } + + } while ( kase != 0 ); + + + /* Normalize error. */ + lstres = 0.; + if ( notran && colequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, C[i] * fabs( Xptr[i]) ); + } else if ( !notran && rowequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, R[i] * fabs( Xptr[i]) ); + } else { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, fabs( Xptr[i]) ); + } + if ( lstres != 0. ) + ferr[j] /= lstres; + + } /* for each RHS j ... */ + + SUPERLU_FREE(work); + SUPERLU_FREE(rwork); + SUPERLU_FREE(iwork); + SUPERLU_FREE(Bjcol.Store); + + return; + +} /* dgsrfs */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgssv.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgssv.c new file mode 100644 index 0000000..5baeda0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgssv.c @@ -0,0 +1,227 @@ + +/*! @file dgssv.c + * \brief Solves the system of linear equations A*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSSV solves the system of linear equations A*X=B, using the
    + * LU factorization from DGSTRF. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *
    + *      1.1. Permute the columns of A, forming A*Pc, where Pc
    + *           is a permutation matrix. For more details of this step, 
    + *           see sp_preorder.c.
    + *
    + *      1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    + *           by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      1.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    + *      above algorithm to the transpose of A:
    + *
    + *      2.1. Permute columns of transpose(A) (rows of A),
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    + *           determined by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      2.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR; Dtype = SLU_D; Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + * perm_c  (input/output) int*
    + *         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    + *         which defines the permutation matrix Pc; perm_c[i] = j means 
    + *         column i of A is in position j in A*Pc.
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + *         If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    + *            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    + *            On exit, perm_c may be overwritten by the product of the input
    + *            perm_c and a permutation that postorders the elimination tree
    + *            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *            is already in postorder.
    + *         Otherwise, it is an output argument.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined 
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->RowPerm = MY_PERMR or
    + *            options->Fact = SamePattern_SameRowPerm, perm_r is an
    + *            input argument.
    + *         otherwise it is an output argument.
    + *
    + * L       (output) SuperMatrix*
    + *         The factor L from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *         
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *         > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                so the solution could not be computed.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol.
    + * 
    + */ + +void +dgssv(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, + SuperLUStat_t *stat, int *info ) +{ + + DNformat *Bstore; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int lwork = 0, *etree, i; + + /* Set default values for some parameters */ + int panel_size; /* panel size */ + int relax; /* no of columns in a relaxed snodes */ + int permc_spec; + trans_t trans = NOTRANS; + double *utime; + double t; /* Temporary time */ + + /* Test the input parameters ... */ + *info = 0; + Bstore = B->Store; + if ( options->Fact != DOFACT ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_D || A->Mtype != SLU_GE ) + *info = -2; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_D || B->Mtype != SLU_GE ) + *info = -7; + if ( *info != 0 ) { + i = -(*info); + xerbla_("dgssv", &i); + return; + } + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + dCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + trans = TRANS; + } else { + if ( A->Stype == SLU_NC ) AA = A; + } + + t = SuperLU_timer_(); + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t; + + etree = intMalloc(A->ncol); + + t = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t; + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + /*printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4));*/ + t = SuperLU_timer_(); + /* Compute the LU factorization of A. */ + dgstrf(options, &AC, relax, panel_size, etree, + NULL, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t; + + t = SuperLU_timer_(); + if ( *info == 0 ) { + /* Solve the system A*X=B, overwriting B with X. */ + dgstrs (trans, L, U, perm_c, perm_r, B, stat, info); + } + utime[SOLVE] = SuperLU_timer_() - t; + + SUPERLU_FREE (etree); + Destroy_CompCol_Permuted(&AC); + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgssvx.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgssvx.c new file mode 100644 index 0000000..7d97d0f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgssvx.c @@ -0,0 +1,614 @@ + +/*! @file dgssvx.c + * \brief Solves the system of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + * the LU factorization from dgstrf(). Error bounds on the solution and
    + * a condition estimate are also provided. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *      1.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A is
    + *           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *           = TRANS or CONJ).
    + *
    + *      1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *           matrix that usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the matrix A (after equilibration if options->Equil = YES)
    + *           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *      1.4. Compute the reciprocal pivot growth factor.
    + *
    + *      1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form of 
    + *           A is used to estimate the condition number of the matrix A. If
    + *           the reciprocal of the condition number is less than machine
    + *           precision, info = A->ncol+1 is returned as a warning, but the
    + *           routine still goes on to solve for X and computes error bounds
    + *           as described below.
    + *
    + *      1.6. The system of equations is solved for X using the factored form
    + *           of A.
    + *
    + *      1.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      1.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *      to the transpose of A:
    + *
    + *      2.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A' is
    + *           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    + *           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *      2.2. Permute columns of transpose(A) (rows of A), 
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    + *           usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the transpose(A) (after equilibration if 
    + *           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *           permutation Pr determined by partial pivoting.
    + *
    + *      2.4. Compute the reciprocal pivot growth factor.
    + *
    + *      2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form 
    + *           of transpose(A) is used to estimate the condition number of the
    + *           matrix A. If the reciprocal of the condition number
    + *           is less than machine precision, info = A->nrow+1 is returned as
    + *           a warning, but the routine still goes on to solve for X and
    + *           computes error bounds as described below.
    + *
    + *      2.6. The system of equations is solved for X using the factored form
    + *           of transpose(A).
    + *
    + *      2.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      2.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input/output) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + *         On entry, If options->Fact = FACTORED and equed is not 'N', 
    + *         then A must have been equilibrated by the scaling factors in
    + *         R and/or C.  
    + *         On exit, A is not modified if options->Equil = NO, or if 
    + *         options->Equil = YES but equed = 'N' on exit.
    + *         Otherwise, if options->Equil = YES and equed is not 'N',
    + *         A is scaled as follows:
    + *         If A->Stype = SLU_NC:
    + *           equed = 'R':  A := diag(R) * A
    + *           equed = 'C':  A := A * diag(C)
    + *           equed = 'B':  A := diag(R) * A * diag(C).
    + *         If A->Stype = SLU_NR:
    + *           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *         which defines the permutation matrix Pc; perm_c[i] = j means
    + *         column i of A is in position j in A*Pc.
    + *         On exit, perm_c may be overwritten by the product of the input
    + *         perm_c and a permutation that postorders the elimination tree
    + *         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *         is already in postorder.
    + *
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *         will try to use the input perm_r, unless a certain threshold
    + *         criterion is violated. In that case, perm_r is overwritten by a
    + *         new permutation determined by partial pivoting or diagonal
    + *         threshold pivoting.
    + *         Otherwise, perm_r is output argument.
    + * 
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *         Elimination tree of Pc'*A'*A*Pc.
    + *         If options->Fact != FACTORED and options->Fact != DOFACT,
    + *         etree is an input argument, otherwise it is an output argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *         Specifies the form of equilibration that was done.
    + *         = 'N': No equilibration.
    + *         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *         = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                by diag(R)*A*diag(C).
    + *         If options->Fact = FACTORED, equed is an input argument,
    + *         otherwise it is an output argument.
    + *
    + * R       (input/output) double*, dimension (A->nrow)
    + *         The row scale factors for A or transpose(A).
    + *         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *         If equed = 'N' or 'C', R is not accessed.
    + *         If options->Fact = FACTORED, R is an input argument,
    + *             otherwise, R is output.
    + *         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *             of R must be positive.
    + * 
    + * C       (input/output) double*, dimension (A->ncol)
    + *         The column scale factors for A or transpose(A).
    + *         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *         If equed = 'N' or 'R', C is not accessed.
    + *         If options->Fact = FACTORED, C is an input argument,
    + *             otherwise, C is output.
    + *         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *             of C must be positive.
    + *         
    + * L       (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *         User supplied workspace, should be large enough
    + *         to hold data structures for factors L and U.
    + *         On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               mem_usage->total_needed; no other side effects.
    + *
    + *         See argument 'mem_usage' for memory usage statistics.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         If B->ncol = 0, only LU decomposition is performed, the triangular
    + *                         solve is skipped.
    + *         On exit,
    + *            if equed = 'N', B is not modified; otherwise
    + *            if A->Stype = SLU_NC:
    + *               if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *                  B is overwritten by diag(R)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *                  B is overwritten by diag(C)*B;
    + *            if A->Stype = SLU_NR:
    + *               if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *                  B is overwritten by diag(C)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *                  B is overwritten by diag(R)*B.
    + *
    + * X       (output) SuperMatrix*
    + *         X has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE. 
    + *         If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *         to the original system of equations. Note that A and B are modified
    + *         on exit if equed is not 'N', and the solution to the equilibrated
    + *         system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *         and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) double*
    + *         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *         The infinity norm is used. If recip_pivot_growth is much less
    + *         than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) double*
    + *         The estimate of the reciprocal condition number of the matrix A
    + *         after equilibration (if done). If rcond is less than the machine
    + *         precision (in particular, if rcond = 0), the matrix is singular
    + *         to working precision. This condition is indicated by a return
    + *         code of info > 0.
    + *
    + * FERR    (output) double*, dimension (B->ncol)   
    + *         The estimated forward error bound for each solution vector   
    + *         X(j) (the j-th column of the solution matrix X).   
    + *         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *         is an estimated upper bound for the magnitude of the largest 
    + *         element in (X(j) - XTRUE) divided by the magnitude of the   
    + *         largest element in X(j).  The estimate is as reliable as   
    + *         the estimate for RCOND, and is almost always a slight   
    + *         overestimate of the true error.
    + *         If options->IterRefine = NOREFINE, ferr = 1.0.
    + *
    + * BERR    (output) double*, dimension (B->ncol)
    + *         The componentwise relative backward error of each solution   
    + *         vector X(j) (i.e., the smallest relative change in   
    + *         any element of A or B that makes X(j) an exact solution).
    + *         If options->IterRefine = NOREFINE, berr = 1.0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *         Record the memory usage statistics, consisting of following fields:
    + *         - for_lu (float)
    + *           The amount of space used in bytes for L\U data structures.
    + *         - total_needed (float)
    + *           The amount of space needed in bytes to perform factorization.
    + *         - expansions (int)
    + *           The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *         = 0: successful exit   
    + *         < 0: if info = -i, the i-th argument had an illegal value   
    + *         > 0: if info = i, and i is   
    + *              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    + *                    been completed, but the factor U is exactly   
    + *                    singular, so the solution and error bounds   
    + *                    could not be computed.   
    + *              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *                    precision, meaning that the matrix is singular to
    + *                    working precision. Nevertheless, the solution and
    + *                    error bounds are computed because there are a number
    + *                    of situations where the computed solution can be more
    + *                    accurate than the value of RCOND would suggest.   
    + *              > A->ncol+1: number of bytes allocated when memory allocation
    + *                    failure occurred, plus A->ncol.
    + * 
    + */ + +void +dgssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, double *R, double *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, + double *rcond, double *ferr, double *berr, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info ) +{ + + + DNformat *Bstore, *Xstore; + double *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec; + trans_t trant; + char norm[1]; + int i, j, info1; + double amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + double diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + /* External functions */ + extern double dlangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = dlamch_("Safe minimum"); + bignum = 1. / smlnum; + } + +#if 0 +printf("dgssvx: Fact=%4d, Trans=%4d, equed=%c\n", + options->Fact, options->Trans, *equed); +#endif + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_D || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_D || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_D || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("dgssvx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + dCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact && equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + dgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + dlaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + +/* printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4)); + fflush(stdout); */ + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + dgstrf(options, &AC, relax, panel_size, etree, + work, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) { + if ( *info <= A->ncol ) { + /* Compute the reciprocal pivot growth factor of the leading + rank-deficient *info columns of A. */ + *recip_pivot_growth = dPivotGrowth(*info, AA, perm_c, L, U); + } + return; + } + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = dPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = dlangs(norm, AA); + dgscon(norm, L, U, anorm, rcond, stat, info); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Scale the right hand side if equilibration was performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Bmat[i + j*ldb] *= R[i]; + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Bmat[i + j*ldb] *= C[i]; + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + dgstrs (trant, L, U, perm_c, perm_r, X, stat, info); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Use iterative refinement to improve the computed solution and compute + error bounds and backward error estimates for it. */ + t0 = SuperLU_timer_(); + if ( options->IterRefine != NOREFINE ) { + dgsrfs(trant, AA, L, U, perm_c, perm_r, equed, R, C, B, + X, ferr, berr, stat, info); + } else { + for (j = 0; j < nrhs; ++j) ferr[j] = berr[j] = 1.0; + } + utime[REFINE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Xmat[i + j*ldx] *= C[i]; + } + } else if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Xmat[i + j*ldx] *= R[i]; + } + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < dlamch_("E") ) *info = A->ncol + 1; + } + + if ( nofact ) { + dQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgstrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgstrf.c new file mode 100644 index 0000000..0c04227 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgstrf.c @@ -0,0 +1,438 @@ + +/*! @file dgstrf.c + * \brief Computes an LU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSTRF computes an LU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = SLU_NCP; Dtype = SLU_D; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *          To control degree of relaxing supernodes. If the number
    + *          of nodes (columns) in a subtree of the elimination tree is less
    + *          than relax, this subtree is considered as one supernode,
    + *          regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *          A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *          Elimination tree of A'*A.
    + *          Note: etree is a vector of parent pointers for a forest whose
    + *          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *          On input, the columns of A should be permuted so that the
    + *          etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *          User-supplied work space and space for the output data structures.
    + *          Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the 
    + *          permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *          in position j in A*Pc.
    + *          When searching for diagonal, perm_c[*] is applied to the
    + *          row subscripts of A, so that diagonal threshold pivoting
    + *          can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *          Row permutation vector which defines the permutation matrix Pr,
    + *          perm_r[i] = j means row i of A is in position j in Pr*A.
    + *          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *             will try to use the input perm_r, unless a certain threshold
    + *             criterion is violated. In that case, perm_r is overwritten by
    + *             a new permutation determined by partial pivoting or diagonal
    + *             threshold pivoting.
    + *          Otherwise, perm_r is output argument;
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = SLU_NC, 
    + *          Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *          = 0: successful exit
    + *          < 0: if info = -i, the i-th argument had an illegal value
    + *          > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                and division by zero will occur if it is used to solve a
    + *                system of equations.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol. If lwork = -1, it is
    + *                the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays: 
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   xprune[0:n-1]: xprune[*] points to locations in subscript 
    + *	vector lsub[*]. For column i, xprune[i] denotes the point where 
    + *	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    + *	to be traversed for symbolic factorization.
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been 
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    + *	      see dpanel_dfs.c; marker2 is used for inner-factorization,
    + *            see dcolumn_dfs.c.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *      Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the 
    + *	last column of a supernode.
    + *      The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    + *	supernodal representative r, repfnz[r] is the location of the first 
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel. 
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    + *      the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *      used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *	    	   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_ddefs.h.
    + * 
    + */ + +void +dgstrf (superlu_options_t *options, SuperMatrix *A, + int relax, int panel_size, int *etree, void *work, int lwork, + int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, + SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *iwork; + double *dwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *xprune; + int *marker; + double *dense, *tempv; + int *relax_end; + double *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double fill_ratio = sp_ienv(6); /* estimated fill ratio */ + + /*static*/ GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + /* DANIELE: tolto static, nocivo x multithread */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + memset(&Glu, 0, sizeof(GlobalLU_t)); // static inizializzava tutto a 0 + *info = dLUMemInit(fact, work, lwork, m, n, Astore->nnz, + panel_size, fill_ratio, L, U, &Glu, &iwork, &dwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &xprune, &marker); + dSetRWork(m, panel_size, dwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) { + heap_relax_snode(n, etree, relax, marker, relax_end); + } else { + relax_snode(n, etree, relax, marker, relax_end); + } + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = dsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + xprune, marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ( (*info = dLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu)) ) + return; + } + + for (icol = jcol; icol<= kcol; icol++) { + xusub[icol+1] = nextu; + + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) + dense[asub[k]] = a[k]; + + /* Numeric update within the snode */ + dsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if ( (*info = dpivotL(icol, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + +#ifdef DEBUG + dprint_lu_col("[1]: ", icol, pivrow, xprune, &Glu); +#endif + + } + + jcol = icol; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + dpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, panel_lsub, segrep, repfnz, xprune, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + dpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for ( jj = jcol; jj < jcol + panel_size; jj++) { + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + if ((*info = dcolumn_dfs(m, jj, perm_r, &nseg, &panel_lsub[k], + segrep, &repfnz[k], xprune, marker, + parent, xplore, &Glu)) != 0) return; + + /* Numeric updates */ + if ((*info = dcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Copy the U-segments to ucol[*] */ + if ((*info = dcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], &Glu)) != 0) + return; + + if ( (*info = dpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + + /* Prune columns (0:jj-1) using column jj */ + dpruneL(jj, perm_r, pivrow, nseg, segrep, + &repfnz[k], xprune, &Glu); + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + +#ifdef DEBUG + dprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); +#endif + + } + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + countnz(min_mn, xprune, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + dLUWorkFree(iwork, dwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + dCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_D, SLU_TRLU); + dCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_D, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dgstrs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dgstrs.c new file mode 100644 index 0000000..4e0247b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dgstrs.c @@ -0,0 +1,337 @@ + +/*! @file dgstrs.c + * \brief Solves a system using LU factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_ddefs.h" + + +/* + * Function prototypes + */ +void dusolve(int, int, double*, double*); +void dlsolve(int, int, double*, double*); +void dmatvec(int, int, int, double*, double*, double*); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * DGSTRS solves a system of linear equations A*X=B or A'*X=B
    + * with A sparse and B dense, using the LU factorization computed by
    + * DGSTRF.
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *
    + * L       (input) SuperMatrix*
    + *         The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *         dgstrf(). Use compressed row subscripts storage for supernodes,
    + *         i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
    + *
    + * U       (input) SuperMatrix*
    + *         The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *         dgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_D, Mtype = SLU_TRU.
    + *
    + * perm_c  (input) int*, dimension (L->ncol)
    + *	   Column permutation vector, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + *
    + * perm_r  (input) int*, dimension (L->nrow)
    + *         Row permutation vector, which defines the permutation matrix Pr; 
    + *         perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_D, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + * 	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + * 
    + */ + +void +dgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, SuperMatrix *B, + SuperLUStat_t *stat, int *info) +{ + +#ifdef _CRAY + _fcd ftcs1, ftcs2, ftcs3, ftcs4; +#endif + int incx = 1, incy = 1; +#ifdef USE_VENDOR_BLAS + double alpha = 1.0, beta = 1.0; + double *work_col; +#endif + DNformat *Bstore; + double *Bmat; + SCformat *Lstore; + NCformat *Ustore; + double *Lval, *Uval; + int fsupc, nrow, nsupr, nsupc, luptr, istart, irow; + int i, j, k, iptr, jcol, n, ldb, nrhs; + double *work, *rhs_work, *soln; + flops_t solve_ops; + void dprint_soln(); + + /* Test input parameters ... */ + *info = 0; + Bstore = B->Store; + ldb = Bstore->lda; + nrhs = B->ncol; + if ( trans != NOTRANS && trans != TRANS && trans != CONJ ) *info = -1; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_D || L->Mtype != SLU_TRLU ) + *info = -2; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_D || U->Mtype != SLU_TRU ) + *info = -3; + else if ( ldb < SUPERLU_MAX(0, L->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_D || B->Mtype != SLU_GE ) + *info = -6; + if ( *info ) { + i = -(*info); + xerbla_("dgstrs", &i); + return; + } + + n = L->nrow; + work = doubleCalloc(n * nrhs); + if ( !work ) ABORT("Malloc fails for local work[]."); + soln = doubleMalloc(n); + if ( !soln ) ABORT("Malloc fails for local soln[]."); + + Bmat = Bstore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( trans == NOTRANS ) { + /* Permute right hand sides to form Pr*B */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_r[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + /* Forward solve PLy=Pb. */ + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + nrow = nsupr - nsupc; + + solve_ops += nsupc * (nsupc - 1) * nrhs; + solve_ops += 2 * nrow * nsupc * nrhs; + + if ( nsupc == 1 ) { + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + luptr = L_NZ_START(fsupc); + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); iptr++){ + irow = L_SUB(iptr); + ++luptr; + rhs_work[irow] -= rhs_work[fsupc] * Lval[luptr]; + } + } + } else { + luptr = L_NZ_START(fsupc); +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("N", strlen("N")); + ftcs3 = _cptofcd("U", strlen("U")); + STRSM( ftcs1, ftcs1, ftcs2, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + SGEMM( ftcs2, ftcs2, &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#else + dtrsm_("L", "L", "N", "U", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + dgemm_( "N", "N", &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#endif + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + work_col = &work[j*n]; + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + rhs_work[irow] -= work_col[i]; /* Scatter */ + work_col[i] = 0.0; + iptr++; + } + } +#else + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + dlsolve (nsupr, nsupc, &Lval[luptr], &rhs_work[fsupc]); + dmatvec (nsupr, nrow, nsupc, &Lval[luptr+nsupc], + &rhs_work[fsupc], &work[0] ); + + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + rhs_work[irow] -= work[i]; + work[i] = 0.0; + iptr++; + } + } +#endif + } /* else ... */ + } /* for L-solve */ + +#ifdef DEBUG + printf("After L-solve: y=\n"); + dprint_soln(n, nrhs, Bmat); +#endif + + /* + * Back solve Ux=y. + */ + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += nsupc * (nsupc + 1) * nrhs; + + if ( nsupc == 1 ) { + rhs_work = &Bmat[0]; + for (j = 0; j < nrhs; j++) { + rhs_work[fsupc] /= Lval[luptr]; + rhs_work += ldb; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("U", strlen("U")); + ftcs3 = _cptofcd("N", strlen("N")); + STRSM( ftcs1, ftcs2, ftcs3, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#else + dtrsm_("L", "U", "N", "N", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#endif +#else + for (j = 0; j < nrhs; j++) + dusolve ( nsupr, nsupc, &Lval[luptr], &Bmat[fsupc+j*ldb] ); +#endif + } + + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (jcol = fsupc; jcol < fsupc + nsupc; jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++ ){ + irow = U_SUB(i); + rhs_work[irow] -= rhs_work[jcol] * Uval[i]; + } + } + } + + } /* for U-solve */ + +#ifdef DEBUG + printf("After U-solve: x=\n"); + dprint_soln(n, nrhs, Bmat); +#endif + + /* Compute the final solution X := Pc*X. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_c[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = solve_ops; + + } else { /* Solve A'*X=B or CONJ(A)*X=B */ + /* Permute right hand sides to form Pc'*B. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_c[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = 0; + for (k = 0; k < nrhs; ++k) { + + /* Multiply by inv(U'). */ + sp_dtrsv("U", "T", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by inv(L'). */ + sp_dtrsv("L", "T", "U", L, U, &Bmat[k*ldb], stat, info); + + } + /* Compute the final solution X := Pr'*X (=inv(Pr)*X) */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_r[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + } + + SUPERLU_FREE(work); + SUPERLU_FREE(soln); +} + +/* + * Diagnostic print of the solution vector + */ +void +dprint_soln(int n, int nrhs, double *soln) +{ + int i; + + for (i = 0; i < n; i++) + printf("\t%d: %.4f\n", i, soln[i]); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c b/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c new file mode 100644 index 0000000..951fe7a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c @@ -0,0 +1,236 @@ + +/*! @file dlacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   DLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) DOUBLE PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) DOUBLE PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *         and DLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *   ISGN   (workspace) INT array, dimension (N)
    + *
    + *   EST    (output) DOUBLE PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to DLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from DLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +dlacon_(int *n, double *v, double *x, int *isgn, double *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + double zero = 0.0; + double one = 1.0; + + /* Local variables */ + static int iter; + static int jump, jlast; + static double altsgn, estold; + static int i, j; + double temp; +#ifdef _CRAY + extern int ISAMAX(int *, double *, int *); + extern double SASUM(int *, double *, int *); + extern int SCOPY(int *, double *, int *, double *, int *); +#else + extern int idamax_(int *, double *, int *); + extern double dasum_(int *, double *, int *); + extern int dcopy_(int *, double *, int *, double *, int *); +#endif +#define d_sign(a, b) (b >= 0 ? fabs(a) : -fabs(a)) /* Copy sign */ +#define i_dnnt(a) \ + ( a>=0 ? floor(a+.5) : -floor(.5-a) ) /* Round to nearest integer */ + + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i] = 1. / (double) (*n); + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = fabs(v[0]); + /* ... QUIT */ + goto L150; + } +#ifdef _CRAY + *est = SASUM(n, x, &c__1); +#else + *est = dasum_(n, x, &c__1); +#endif + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = idamax_(n, &x[0], &c__1); +#endif + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + SCOPY(n, x, &c__1, v, &c__1); +#else + dcopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; +#ifdef _CRAY + *est = SASUM(n, v, &c__1); +#else + *est = dasum_(n, v, &c__1); +#endif + + for (i = 0; i < *n; ++i) + if (i_dnnt(d_sign(one, x[i])) != isgn[i]) + goto L90; + + /* REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED. */ + goto L120; + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = idamax_(n, &x[0], &c__1); +#endif + --j; + if (x[jlast] != fabs(x[j]) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1] = altsgn * ((double)(i - 1) / (double)(*n - 1) + 1.); + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: +#ifdef _CRAY + temp = SASUM(n, x, &c__1) / (double)(*n * 3) * 2.; +#else + temp = dasum_(n, x, &c__1) / (double)(*n * 3) * 2.; +#endif + if (temp > *est) { +#ifdef _CRAY + SCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + dcopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* dlacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c.bak new file mode 100644 index 0000000..951fe7a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dlacon.c.bak @@ -0,0 +1,236 @@ + +/*! @file dlacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   DLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) DOUBLE PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) DOUBLE PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *         and DLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *   ISGN   (workspace) INT array, dimension (N)
    + *
    + *   EST    (output) DOUBLE PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to DLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from DLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +dlacon_(int *n, double *v, double *x, int *isgn, double *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + double zero = 0.0; + double one = 1.0; + + /* Local variables */ + static int iter; + static int jump, jlast; + static double altsgn, estold; + static int i, j; + double temp; +#ifdef _CRAY + extern int ISAMAX(int *, double *, int *); + extern double SASUM(int *, double *, int *); + extern int SCOPY(int *, double *, int *, double *, int *); +#else + extern int idamax_(int *, double *, int *); + extern double dasum_(int *, double *, int *); + extern int dcopy_(int *, double *, int *, double *, int *); +#endif +#define d_sign(a, b) (b >= 0 ? fabs(a) : -fabs(a)) /* Copy sign */ +#define i_dnnt(a) \ + ( a>=0 ? floor(a+.5) : -floor(.5-a) ) /* Round to nearest integer */ + + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i] = 1. / (double) (*n); + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = fabs(v[0]); + /* ... QUIT */ + goto L150; + } +#ifdef _CRAY + *est = SASUM(n, x, &c__1); +#else + *est = dasum_(n, x, &c__1); +#endif + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = idamax_(n, &x[0], &c__1); +#endif + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + SCOPY(n, x, &c__1, v, &c__1); +#else + dcopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; +#ifdef _CRAY + *est = SASUM(n, v, &c__1); +#else + *est = dasum_(n, v, &c__1); +#endif + + for (i = 0; i < *n; ++i) + if (i_dnnt(d_sign(one, x[i])) != isgn[i]) + goto L90; + + /* REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED. */ + goto L120; + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = idamax_(n, &x[0], &c__1); +#endif + --j; + if (x[jlast] != fabs(x[j]) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1] = altsgn * ((double)(i - 1) / (double)(*n - 1) + 1.); + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: +#ifdef _CRAY + temp = SASUM(n, x, &c__1) / (double)(*n * 3) * 2.; +#else + temp = dasum_(n, x, &c__1) / (double)(*n * 3) * 2.; +#endif + if (temp > *est) { +#ifdef _CRAY + SCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + dcopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* dlacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dlamch.c b/thirdparty/superlu/SuperLU_4.1/SRC/dlamch.c new file mode 100644 index 0000000..678ac35 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dlamch.c @@ -0,0 +1,971 @@ +/*! @file dlamch.c + * \brief Determines double precision machine parameters + * + *
    + *       -- LAPACK auxiliary routine (version 2.0) --   
    + *       Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *       Courant Institute, Argonne National Lab, and Rice University   
    + *       October 31, 1992   
    + * 
    + */ +#include +#include "slu_Cnames.h" + +#define TRUE_ (1) +#define FALSE_ (0) +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) + + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DLAMCH determines double precision machine parameters.   
    +
    +    Arguments   
    +    =========   
    +
    +    CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by DLAMCH:   
    +            = 'E' or 'e',   DLAMCH := eps   
    +            = 'S' or 's ,   DLAMCH := sfmin   
    +            = 'B' or 'b',   DLAMCH := base   
    +            = 'P' or 'p',   DLAMCH := eps*base   
    +            = 'N' or 'n',   DLAMCH := t   
    +            = 'R' or 'r',   DLAMCH := rnd   
    +            = 'M' or 'm',   DLAMCH := emin   
    +            = 'U' or 'u',   DLAMCH := rmin   
    +            = 'L' or 'l',   DLAMCH := emax   
    +            = 'O' or 'o',   DLAMCH := rmax   
    +
    +            where   
    +
    +            eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)   
    +
    +   ===================================================================== 
    +
    +*/ +double dlamch_(char *cmach) +{ + + + static int first = TRUE_; + + /* System generated locals */ + int i__1; + double ret_val; + /* Builtin functions */ + double pow_di(double *, int *); + /* Local variables */ + static double base; + static int beta; + static double emin, prec, emax; + static int imin, imax; + static int lrnd; + static double rmin, rmax, t, rmach; + extern int lsame_(char *, char *); + static double small, sfmin; + extern /* Subroutine */ int dlamc2_(int *, int *, int *, + double *, int *, double *, int *, double *); + static int it; + static double rnd, eps; + + if (first) { + first = FALSE_; + dlamc2_(&beta, &it, &lrnd, &eps, &imin, &rmin, &imax, &rmax); + base = (double) beta; + t = (double) it; + if (lrnd) { + rnd = 1.; + i__1 = 1 - it; + eps = pow_di(&base, &i__1) / 2; + } else { + rnd = 0.; + i__1 = 1 - it; + eps = pow_di(&base, &i__1); + } + prec = eps * base; + emin = (double) imin; + emax = (double) imax; + sfmin = rmin; + small = 1. / rmax; + if (small >= sfmin) { + + /* Use SMALL plus a bit, to avoid the possibility of rounding + causing overflow when computing 1/sfmin. */ + sfmin = small * (eps + 1.); + } + } + + if (lsame_(cmach, "E")) { + rmach = eps; + } else if (lsame_(cmach, "S")) { + rmach = sfmin; + } else if (lsame_(cmach, "B")) { + rmach = base; + } else if (lsame_(cmach, "P")) { + rmach = prec; + } else if (lsame_(cmach, "N")) { + rmach = t; + } else if (lsame_(cmach, "R")) { + rmach = rnd; + } else if (lsame_(cmach, "M")) { + rmach = emin; + } else if (lsame_(cmach, "U")) { + rmach = rmin; + } else if (lsame_(cmach, "L")) { + rmach = emax; + } else if (lsame_(cmach, "O")) { + rmach = rmax; + } + + ret_val = rmach; + return ret_val; + +/* End of DLAMCH */ + +} /* dlamch_ */ +/* Subroutine */ +/*! \brief + +
    + Purpose   
    +    =======   
    +
    +    DLAMC1 determines the machine parameters given by BETA, T, RND, and   
    +    IEEE1.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (output) INT   
    +            The base of the machine.   
    +
    +    T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.   
    +
    +    RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not 
    +  
    +            be a reliable guide to the way in which the machine performs 
    +  
    +            its arithmetic.   
    +
    +    IEEE1   (output) INT   
    +            Specifies whether rounding appears to be done in the IEEE   
    +            'round to nearest' style.   
    +
    +    Further Details   
    +    ===============   
    +
    +    The routine is based on the routine  ENVRON  by Malcolm and   
    +    incorporates suggestions by Gentleman and Marovich. See   
    +
    +       Malcolm M. A. (1972) Algorithms to reveal properties of   
    +          floating-point arithmetic. Comms. of the ACM, 15, 949-951.   
    +
    +       Gentleman W. M. and Marovich S. B. (1974) More on algorithms   
    +          that reveal properties of floating point arithmetic units.   
    +          Comms. of the ACM, 17, 276-277.   
    +
    +   ===================================================================== 
    +
    +*/ +int dlamc1_(int *beta, int *t, int *rnd, int + *ieee1) +{ + /* Initialized data */ + static int first = TRUE_; + /* System generated locals */ + double d__1, d__2; + /* Local variables */ + static int lrnd; + static double a, b, c, f; + static int lbeta; + static double savec; + extern double dlamc3_(double *, double *); + static int lieee1; + static double t1, t2; + static int lt; + static double one, qtr; + + if (first) { + first = FALSE_; + one = 1.; + +/* LBETA, LIEEE1, LT and LRND are the local values of BE +TA, + IEEE1, T and RND. + + Throughout this routine we use the function DLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + Compute a = 2.0**m with the smallest positive integer m s +uch + that + + fl( a + 1.0 ) = a. */ + + a = 1.; + c = 1.; + +/* + WHILE( C.EQ.ONE )LOOP */ +L10: + if (c == one) { + a *= 2; + c = dlamc3_(&a, &one); + d__1 = -a; + c = dlamc3_(&c, &d__1); + goto L10; + } +/* + END WHILE + + Now compute b = 2.0**m with the smallest positive integer +m + such that + + fl( a + b ) .gt. a. */ + + b = 1.; + c = dlamc3_(&a, &b); + +/* + WHILE( C.EQ.A )LOOP */ +L20: + if (c == a) { + b *= 2; + c = dlamc3_(&a, &b); + goto L20; + } +/* + END WHILE + + Now compute the base. a and c are neighbouring floating po +int + numbers in the interval ( beta**t, beta**( t + 1 ) ) and + so + their difference is beta. Adding 0.25 to c is to ensure that + it + is truncated to beta and not ( beta - 1 ). */ + + qtr = one / 4; + savec = c; + d__1 = -a; + c = dlamc3_(&c, &d__1); + lbeta = (int) (c + qtr); + +/* Now determine whether rounding or chopping occurs, by addin +g a + bit less than beta/2 and a bit more than beta/2 to + a. */ + + b = (double) lbeta; + d__1 = b / 2; + d__2 = -b / 100; + f = dlamc3_(&d__1, &d__2); + c = dlamc3_(&f, &a); + if (c == a) { + lrnd = TRUE_; + } else { + lrnd = FALSE_; + } + d__1 = b / 2; + d__2 = b / 100; + f = dlamc3_(&d__1, &d__2); + c = dlamc3_(&f, &a); + if (lrnd && c == a) { + lrnd = FALSE_; + } + +/* Try and decide whether rounding is done in the IEEE 'round + to + nearest' style. B/2 is half a unit in the last place of the +two + numbers A and SAVEC. Furthermore, A is even, i.e. has last +bit + zero, and SAVEC is odd. Thus adding B/2 to A should not cha +nge + A, but adding B/2 to SAVEC should change SAVEC. */ + + d__1 = b / 2; + t1 = dlamc3_(&d__1, &a); + d__1 = b / 2; + t2 = dlamc3_(&d__1, &savec); + lieee1 = t1 == a && t2 > savec && lrnd; + +/* Now find the mantissa, t. It should be the integer part + of + log to the base beta of a, however it is safer to determine + t + by powering. So we find t as the smallest positive integer +for + which + + fl( beta**t + 1.0 ) = 1.0. */ + + lt = 0; + a = 1.; + c = 1.; + +/* + WHILE( C.EQ.ONE )LOOP */ +L30: + if (c == one) { + ++lt; + a *= lbeta; + c = dlamc3_(&a, &one); + d__1 = -a; + c = dlamc3_(&c, &d__1); + goto L30; + } +/* + END WHILE */ + + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *ieee1 = lieee1; + return 0; + +/* End of DLAMC1 */ + +} /* dlamc1_ */ + + +/* Subroutine */ +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DLAMC2 determines the machine parameters specified in its argument   
    +    list.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (output) INT   
    +            The base of the machine.   
    +
    +    T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.   
    +
    +    RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not 
    +  
    +            be a reliable guide to the way in which the machine performs 
    +  
    +            its arithmetic.   
    +
    +    EPS     (output) DOUBLE PRECISION   
    +            The smallest positive number such that   
    +
    +               fl( 1.0 - EPS ) .LT. 1.0,   
    +
    +            where fl denotes the computed value.   
    +
    +    EMIN    (output) INT   
    +            The minimum exponent before (gradual) underflow occurs.   
    +
    +    RMIN    (output) DOUBLE PRECISION   
    +            The smallest normalized number for the machine, given by   
    +            BASE**( EMIN - 1 ), where  BASE  is the floating point value 
    +  
    +            of BETA.   
    +
    +    EMAX    (output) INT   
    +            The maximum exponent before overflow occurs.   
    +
    +    RMAX    (output) DOUBLE PRECISION   
    +            The largest positive number for the machine, given by   
    +            BASE**EMAX * ( 1 - EPS ), where  BASE  is the floating point 
    +  
    +            value of BETA.   
    +
    +    Further Details   
    +    ===============   
    +
    +    The computation of  EPS  is based on a routine PARANOIA by   
    +    W. Kahan of the University of California at Berkeley.   
    +
    +   ===================================================================== 
    +
    +*/ +int dlamc2_(int *beta, int *t, int *rnd, + double *eps, int *emin, double *rmin, int *emax, + double *rmax) +{ + + /* Table of constant values */ + static int c__1 = 1; + + /* Initialized data */ + static int first = TRUE_; + static int iwarn = FALSE_; + /* System generated locals */ + int i__1; + double d__1, d__2, d__3, d__4, d__5; + /* Builtin functions */ + double pow_di(double *, int *); + /* Local variables */ + static int ieee; + static double half; + static int lrnd; + static double leps, zero, a, b, c; + static int i, lbeta; + static double rbase; + static int lemin, lemax, gnmin; + static double small; + static int gpmin; + static double third, lrmin, lrmax, sixth; + extern /* Subroutine */ int dlamc1_(int *, int *, int *, + int *); + extern double dlamc3_(double *, double *); + static int lieee1; + extern /* Subroutine */ int dlamc4_(int *, double *, int *), + dlamc5_(int *, int *, int *, int *, int *, + double *); + static int lt, ngnmin, ngpmin; + static double one, two; + + if (first) { + first = FALSE_; + zero = 0.; + one = 1.; + two = 2.; + +/* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values + of + BETA, T, RND, EPS, EMIN and RMIN. + + Throughout this routine we use the function DLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. +*/ + + dlamc1_(&lbeta, <, &lrnd, &lieee1); + +/* Start to find EPS. */ + + b = (double) lbeta; + i__1 = -lt; + a = pow_di(&b, &i__1); + leps = a; + +/* Try some tricks to see whether or not this is the correct E +PS. */ + + b = two / 3; + half = one / 2; + d__1 = -half; + sixth = dlamc3_(&b, &d__1); + third = dlamc3_(&sixth, &sixth); + d__1 = -half; + b = dlamc3_(&third, &d__1); + b = dlamc3_(&b, &sixth); + b = abs(b); + if (b < leps) { + b = leps; + } + + leps = 1.; + +/* + WHILE( ( LEPS.GT.B ).AND.( B.GT.ZERO ) )LOOP */ +L10: + if (leps > b && b > zero) { + leps = b; + d__1 = half * leps; +/* Computing 5th power */ + d__3 = two, d__4 = d__3, d__3 *= d__3; +/* Computing 2nd power */ + d__5 = leps; + d__2 = d__4 * (d__3 * d__3) * (d__5 * d__5); + c = dlamc3_(&d__1, &d__2); + d__1 = -c; + c = dlamc3_(&half, &d__1); + b = dlamc3_(&half, &c); + d__1 = -b; + c = dlamc3_(&half, &d__1); + b = dlamc3_(&half, &c); + goto L10; + } +/* + END WHILE */ + + if (a < leps) { + leps = a; + } + +/* Computation of EPS complete. + + Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3 +)). + Keep dividing A by BETA until (gradual) underflow occurs. T +his + is detected when we cannot recover the previous A. */ + + rbase = one / lbeta; + small = one; + for (i = 1; i <= 3; ++i) { + d__1 = small * rbase; + small = dlamc3_(&d__1, &zero); +/* L20: */ + } + a = dlamc3_(&one, &small); + dlamc4_(&ngpmin, &one, &lbeta); + d__1 = -one; + dlamc4_(&ngnmin, &d__1, &lbeta); + dlamc4_(&gpmin, &a, &lbeta); + d__1 = -a; + dlamc4_(&gnmin, &d__1, &lbeta); + ieee = FALSE_; + + if (ngpmin == ngnmin && gpmin == gnmin) { + if (ngpmin == gpmin) { + lemin = ngpmin; +/* ( Non twos-complement machines, no gradual under +flow; + e.g., VAX ) */ + } else if (gpmin - ngpmin == 3) { + lemin = ngpmin - 1 + lt; + ieee = TRUE_; +/* ( Non twos-complement machines, with gradual und +erflow; + e.g., IEEE standard followers ) */ + } else { + lemin = min(ngpmin,gpmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if (ngpmin == gpmin && ngnmin == gnmin) { + if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) { + lemin = max(ngpmin,ngnmin); +/* ( Twos-complement machines, no gradual underflow +; + e.g., CYBER 205 ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1 && gpmin == gnmin) + { + if (gpmin - min(ngpmin,ngnmin) == 3) { + lemin = max(ngpmin,ngnmin) - 1 + lt; +/* ( Twos-complement machines with gradual underflo +w; + no known machine ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else { +/* Computing MIN */ + i__1 = min(ngpmin,ngnmin), i__1 = min(i__1,gpmin); + lemin = min(i__1,gnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } +/* ** + Comment out this if block if EMIN is ok */ + if (iwarn) { + first = TRUE_; + printf("\n\n WARNING. The value EMIN may be incorrect:- "); + printf("EMIN = %8i\n",lemin); + printf("If, after inspection, the value EMIN looks acceptable"); + printf("please comment out \n the IF block as marked within the"); + printf("code of routine DLAMC2, \n otherwise supply EMIN"); + printf("explicitly.\n"); + } +/* ** + + Assume IEEE arithmetic if we found denormalised numbers abo +ve, + or if arithmetic seems to round in the IEEE style, determi +ned + in routine DLAMC1. A true IEEE machine should have both thi +ngs + true; however, faulty machines may have one or the other. */ + + ieee = ieee || lieee1; + +/* Compute RMIN by successive division by BETA. We could comp +ute + RMIN as BASE**( EMIN - 1 ), but some machines underflow dur +ing + this computation. */ + + lrmin = 1.; + i__1 = 1 - lemin; + for (i = 1; i <= 1-lemin; ++i) { + d__1 = lrmin * rbase; + lrmin = dlamc3_(&d__1, &zero); +/* L30: */ + } + +/* Finally, call DLAMC5 to compute EMAX and RMAX. */ + + dlamc5_(&lbeta, <, &lemin, &ieee, &lemax, &lrmax); + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *eps = leps; + *emin = lemin; + *rmin = lrmin; + *emax = lemax; + *rmax = lrmax; + + return 0; + + +/* End of DLAMC2 */ + +} /* dlamc2_ */ + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DLAMC3  is intended to force  A  and  B  to be stored prior to doing 
    +  
    +    the addition of  A  and  B ,  for use in situations where optimizers 
    +  
    +    might hold one of these in a register.   
    +
    +    Arguments   
    +    =========   
    +
    +    A, B    (input) DOUBLE PRECISION   
    +            The values A and B.   
    +
    +   ===================================================================== 
    +
    +*/ +double dlamc3_(double *a, double *b) +{ +/* >>Start of File<< + System generated locals */ + double ret_val; + + ret_val = *a + *b; + + return ret_val; + +/* End of DLAMC3 */ + +} /* dlamc3_ */ + + +/* Subroutine */ +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DLAMC4 is a service routine for DLAMC2.   
    +
    +    Arguments   
    +    =========   
    +
    +    EMIN    (output) EMIN   
    +            The minimum exponent before (gradual) underflow, computed by 
    +  
    +            setting A = START and dividing by BASE until the previous A   
    +            can not be recovered.   
    +
    +    START   (input) DOUBLE PRECISION   
    +            The starting point for determining EMIN.   
    +
    +    BASE    (input) INT   
    +            The base of the machine.   
    +
    +   ===================================================================== 
    +
    +*/ + +int dlamc4_(int *emin, double *start, int *base) +{ + /* System generated locals */ + int i__1; + double d__1; + /* Local variables */ + static double zero, a; + static int i; + static double rbase, b1, b2, c1, c2, d1, d2; + extern double dlamc3_(double *, double *); + static double one; + + a = *start; + one = 1.; + rbase = one / *base; + zero = 0.; + *emin = 1; + d__1 = a * rbase; + b1 = dlamc3_(&d__1, &zero); + c1 = a; + c2 = a; + d1 = a; + d2 = a; +/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. + $ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */ +L10: + if (c1 == a && c2 == a && d1 == a && d2 == a) { + --(*emin); + a = b1; + d__1 = a / *base; + b1 = dlamc3_(&d__1, &zero); + d__1 = b1 * *base; + c1 = dlamc3_(&d__1, &zero); + d1 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d1 += b1; +/* L20: */ + } + d__1 = a * rbase; + b2 = dlamc3_(&d__1, &zero); + d__1 = b2 / rbase; + c2 = dlamc3_(&d__1, &zero); + d2 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d2 += b2; +/* L30: */ + } + goto L10; + } +/* + END WHILE */ + + return 0; + +/* End of DLAMC4 */ + +} /* dlamc4_ */ + + +/* Subroutine */ +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DLAMC5 attempts to compute RMAX, the largest machine floating-point   
    +    number, without overflow.  It assumes that EMAX + abs(EMIN) sum   
    +    approximately to a power of 2.  It will fail on machines where this   
    +    assumption does not hold, for example, the Cyber 205 (EMIN = -28625, 
    +  
    +    EMAX = 28718).  It will also fail if the value supplied for EMIN is   
    +    too large (i.e. too close to zero), probably with overflow.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (input) INT   
    +            The base of floating-point arithmetic.   
    +
    +    P       (input) INT   
    +            The number of base BETA digits in the mantissa of a   
    +            floating-point value.   
    +
    +    EMIN    (input) INT   
    +            The minimum exponent before (gradual) underflow.   
    +
    +    IEEE    (input) INT   
    +            A int flag specifying whether or not the arithmetic   
    +            system is thought to comply with the IEEE standard.   
    +
    +    EMAX    (output) INT   
    +            The largest exponent before overflow   
    +
    +    RMAX    (output) DOUBLE PRECISION   
    +            The largest machine floating-point number.   
    +
    +   ===================================================================== 
    +  
    +
    +
    +       First compute LEXP and UEXP, two powers of 2 that bound   
    +       abs(EMIN). We then assume that EMAX + abs(EMIN) will sum   
    +       approximately to the bound that is closest to abs(EMIN).   
    +       (EMAX is the exponent of the required number RMAX).
    +
    +*/ +int dlamc5_(int *beta, int *p, int *emin, + int *ieee, int *emax, double *rmax) +{ + + /* Table of constant values */ + static double c_b5 = 0.; + + /* System generated locals */ + int i__1; + double d__1; + /* Local variables */ + static int lexp; + static double oldy; + static int uexp, i; + static double y, z; + static int nbits; + extern double dlamc3_(double *, double *); + static double recbas; + static int exbits, expsum, try__; + + + + lexp = 1; + exbits = 1; +L10: + try__ = lexp << 1; + if (try__ <= -(*emin)) { + lexp = try__; + ++exbits; + goto L10; + } + if (lexp == -(*emin)) { + uexp = lexp; + } else { + uexp = try__; + ++exbits; + } + +/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater + than or equal to EMIN. EXBITS is the number of bits needed to + store the exponent. */ + + if (uexp + *emin > -lexp - *emin) { + expsum = lexp << 1; + } else { + expsum = uexp << 1; + } + +/* EXPSUM is the exponent range, approximately equal to + EMAX - EMIN + 1 . */ + + *emax = expsum + *emin - 1; + nbits = exbits + 1 + *p; + +/* NBITS is the total number of bits needed to store a + floating-point number. */ + + if (nbits % 2 == 1 && *beta == 2) { + +/* Either there are an odd number of bits used to store a + floating-point number, which is unlikely, or some bits are + + not used in the representation of numbers, which is possible +, + (e.g. Cray machines) or the mantissa has an implicit bit, + (e.g. IEEE machines, Dec Vax machines), which is perhaps the + + most likely. We have to assume the last alternative. + If this is true, then we need to reduce EMAX by one because + + there must be some way of representing zero in an implicit-b +it + system. On machines like Cray, we are reducing EMAX by one + + unnecessarily. */ + + --(*emax); + } + + if (*ieee) { + +/* Assume we are on an IEEE machine which reserves one exponent + + for infinity and NaN. */ + + --(*emax); + } + +/* Now create RMAX, the largest machine number, which should + be equal to (1.0 - BETA**(-P)) * BETA**EMAX . + + First compute 1.0 - BETA**(-P), being careful that the + result is less than 1.0 . */ + + recbas = 1. / *beta; + z = *beta - 1.; + y = 0.; + i__1 = *p; + for (i = 1; i <= *p; ++i) { + z *= recbas; + if (y < 1.) { + oldy = y; + } + y = dlamc3_(&y, &z); +/* L20: */ + } + if (y >= 1.) { + y = oldy; + } + +/* Now multiply by BETA**EMAX to get RMAX. */ + + i__1 = *emax; + for (i = 1; i <= *emax; ++i) { + d__1 = y * *beta; + y = dlamc3_(&d__1, &c_b5); +/* L30: */ + } + + *rmax = y; + return 0; + +/* End of DLAMC5 */ + +} /* dlamc5_ */ + +double pow_di(double *ap, int *bp) +{ + double pow, x; + int n; + + pow = 1; + x = *ap; + n = *bp; + + if(n != 0){ + if(n < 0) { + n = -n; + x = 1/x; + } + for( ; ; ) { + if(n & 01) pow *= x; + if(n >>= 1) x *= x; + else break; + } + } + return(pow); +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dlangs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dlangs.c new file mode 100644 index 0000000..871cd33 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dlangs.c @@ -0,0 +1,119 @@ + +/*! @file dlangs.c + * \brief Returns the value of the one norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from lapack routine DLANGE 
    + * 
    + */ +/* + * File name: dlangs.c + * History: Modified from lapack routine DLANGE + */ +#include +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   DLANGS returns the value of the one norm, or the Frobenius norm, or 
    + *   the infinity norm, or the element of largest absolute value of a 
    + *   real matrix A.   
    + *
    + *   Description   
    + *   ===========   
    + *
    + *   DLANGE returns the value   
    + *
    + *      DLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    + *               (   
    + *               ( norm1(A),         NORM = '1', 'O' or 'o'   
    + *               (   
    + *               ( normI(A),         NORM = 'I' or 'i'   
    + *               (   
    + *               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'   
    + *
    + *   where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    + *   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    + *   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    + *   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.   
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   NORM    (input) CHARACTER*1   
    + *           Specifies the value to be returned in DLANGE as described above.   
    + *   A       (input) SuperMatrix*
    + *           The M by N sparse matrix A. 
    + *
    + *  =====================================================================
    + * 
    + */ + +double dlangs(char *norm, SuperMatrix *A) +{ + + /* Local variables */ + NCformat *Astore; + double *Aval; + int i, j, irow; + double value, sum; + double *rwork; + + Astore = A->Store; + Aval = Astore->nzval; + + if ( SUPERLU_MIN(A->nrow, A->ncol) == 0) { + value = 0.; + + } else if (lsame_(norm, "M")) { + /* Find max(abs(A(i,j))). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + value = SUPERLU_MAX( value, fabs( Aval[i]) ); + + } else if (lsame_(norm, "O") || *(unsigned char *)norm == '1') { + /* Find norm1(A). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) { + sum = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + sum += fabs(Aval[i]); + value = SUPERLU_MAX(value,sum); + } + + } else if (lsame_(norm, "I")) { + /* Find normI(A). */ + if ( !(rwork = (double *) SUPERLU_MALLOC(A->nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for rwork."); + for (i = 0; i < A->nrow; ++i) rwork[i] = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) { + irow = Astore->rowind[i]; + rwork[irow] += fabs(Aval[i]); + } + value = 0.; + for (i = 0; i < A->nrow; ++i) + value = SUPERLU_MAX(value, rwork[i]); + + SUPERLU_FREE (rwork); + + } else if (lsame_(norm, "F") || lsame_(norm, "E")) { + /* Find normF(A). */ + ABORT("Not implemented."); + } else + ABORT("Illegal norm specified."); + + return (value); + +} /* dlangs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dlaqgs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dlaqgs.c new file mode 100644 index 0000000..c25d47a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dlaqgs.c @@ -0,0 +1,145 @@ + +/*! @file dlaqgs.c + * \brief Equlibrates a general sprase matrix + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Modified from LAPACK routine DLAQGE
    + * 
    + */ +/* + * File name: dlaqgs.c + * History: Modified from LAPACK routine DLAQGE + */ +#include +#include "slu_ddefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   DLAQGS equilibrates a general sparse M by N matrix A using the row and   
    + *   scaling factors in the vectors R and C.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input/output) SuperMatrix*
    + *           On exit, the equilibrated matrix.  See EQUED for the form of 
    + *           the equilibrated matrix. The type of A can be:
    + *	    Stype = NC; Dtype = SLU_D; Mtype = GE.
    + *	    
    + *   R       (input) double*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *	    
    + *   C       (input) double*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *	    
    + *   ROWCND  (input) double
    + *           Ratio of the smallest R(i) to the largest R(i).
    + *	    
    + *   COLCND  (input) double
    + *           Ratio of the smallest C(i) to the largest C(i).
    + *	    
    + *   AMAX    (input) double
    + *           Absolute value of largest matrix entry.
    + *	    
    + *   EQUED   (output) char*
    + *           Specifies the form of equilibration that was done.   
    + *           = 'N':  No equilibration   
    + *           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    + *                   diag(R).   
    + *           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    + *                   by diag(C).   
    + *           = 'B':  Both row and column equilibration, i.e., A has been
    + *                   replaced by diag(R) * A * diag(C).   
    + *
    + *   Internal Parameters   
    + *   ===================   
    + *
    + *   THRESH is a threshold value used to decide if row or column scaling   
    + *   should be done based on the ratio of the row or column scaling   
    + *   factors.  If ROWCND < THRESH, row scaling is done, and if   
    + *   COLCND < THRESH, column scaling is done.   
    + *
    + *   LARGE and SMALL are threshold values used to decide if row scaling   
    + *   should be done based on the absolute size of the largest matrix   
    + *   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.   
    + *
    + *   ===================================================================== 
    + * 
    + */ + +void +dlaqgs(SuperMatrix *A, double *r, double *c, + double rowcnd, double colcnd, double amax, char *equed) +{ + + +#define THRESH (0.1) + + /* Local variables */ + NCformat *Astore; + double *Aval; + int i, j, irow; + double large, small, cj; + + + /* Quick return if possible */ + if (A->nrow <= 0 || A->ncol <= 0) { + *(unsigned char *)equed = 'N'; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Initialize LARGE and SMALL. */ + small = dlamch_("Safe minimum") / dlamch_("Precision"); + large = 1. / small; + + if (rowcnd >= THRESH && amax >= small && amax <= large) { + if (colcnd >= THRESH) + *(unsigned char *)equed = 'N'; + else { + /* Column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + Aval[i] *= cj; + } + } + *(unsigned char *)equed = 'C'; + } + } else if (colcnd >= THRESH) { + /* Row scaling, no column scaling */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + Aval[i] *= r[irow]; + } + *(unsigned char *)equed = 'R'; + } else { + /* Row and column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + Aval[i] *= cj * r[irow]; + } + } + *(unsigned char *)equed = 'B'; + } + + return; + +} /* dlaqgs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dldperm.c b/thirdparty/superlu/SuperLU_4.1/SRC/dldperm.c new file mode 100644 index 0000000..e343839 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dldperm.c @@ -0,0 +1,165 @@ + +/*! @file + * \brief Finds a row permutation so that the matrix has large entries on the diagonal + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +extern int_t mc64id_(int_t*); +extern int_t mc64ad_(int_t*, int_t*, int_t*, int_t [], int_t [], double [], + int_t*, int_t [], int_t*, int_t[], int_t*, double [], + int_t [], int_t []); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   DLDPERM finds a row permutation so that the matrix has large
    + *   entries on the diagonal.
    + *
    + * Arguments
    + * =========
    + *
    + * job    (input) int
    + *        Control the action. Possible values for JOB are:
    + *        = 1 : Compute a row permutation of the matrix so that the
    + *              permuted matrix has as many entries on its diagonal as
    + *              possible. The values on the diagonal are of arbitrary size.
    + *              HSL subroutine MC21A/AD is used for this.
    + *        = 2 : Compute a row permutation of the matrix so that the smallest 
    + *              value on the diagonal of the permuted matrix is maximized.
    + *        = 3 : Compute a row permutation of the matrix so that the smallest
    + *              value on the diagonal of the permuted matrix is maximized.
    + *              The algorithm differs from the one used for JOB = 2 and may
    + *              have quite a different performance.
    + *        = 4 : Compute a row permutation of the matrix so that the sum
    + *              of the diagonal entries of the permuted matrix is maximized.
    + *        = 5 : Compute a row permutation of the matrix so that the product
    + *              of the diagonal entries of the permuted matrix is maximized
    + *              and vectors to scale the matrix so that the nonzero diagonal 
    + *              entries of the permuted matrix are one in absolute value and 
    + *              all the off-diagonal entries are less than or equal to one in 
    + *              absolute value.
    + *        Restriction: 1 <= JOB <= 5.
    + *
    + * n      (input) int
    + *        The order of the matrix.
    + *
    + * nnz    (input) int
    + *        The number of nonzeros in the matrix.
    + *
    + * adjncy (input) int*, of size nnz
    + *        The adjacency structure of the matrix, which contains the row
    + *        indices of the nonzeros.
    + *
    + * colptr (input) int*, of size n+1
    + *        The pointers to the beginning of each column in ADJNCY.
    + *
    + * nzval  (input) double*, of size nnz
    + *        The nonzero values of the matrix. nzval[k] is the value of
    + *        the entry corresponding to adjncy[k].
    + *        It is not used if job = 1.
    + *
    + * perm   (output) int*, of size n
    + *        The permutation vector. perm[i] = j means row i in the
    + *        original matrix is in row j of the permuted matrix.
    + *
    + * u      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the row scaling factors. 
    + *
    + * v      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the column scaling factors. 
    + *        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + * 
    + */ + +int +dldperm(int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], + double nzval[], int_t *perm, double u[], double v[]) +{ + int_t i, liw, ldw, num; + int_t *iw, icntl[10], info[10]; + double *dw; + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Enter dldperm()"); +#endif + liw = 5*n; + if ( job == 3 ) liw = 10*n + nnz; + if ( !(iw = intMalloc(liw)) ) ABORT("Malloc fails for iw[]"); + ldw = 3*n + nnz; + if ( !(dw = (double*) SUPERLU_MALLOC(ldw * sizeof(double))) ) + ABORT("Malloc fails for dw[]"); + + /* Increment one to get 1-based indexing. */ + for (i = 0; i <= n; ++i) ++colptr[i]; + for (i = 0; i < nnz; ++i) ++adjncy[i]; +#if ( DEBUGlevel>=2 ) + printf("LDPERM(): n %d, nnz %d\n", n, nnz); + slu_PrintInt10("colptr", n+1, colptr); + slu_PrintInt10("adjncy", nnz, adjncy); +#endif + + /* + * NOTE: + * ===== + * + * MC64AD assumes that column permutation vector is defined as: + * perm(i) = j means column i of permuted A is in column j of original A. + * + * Since a symmetric permutation preserves the diagonal entries. Then + * by the following relation: + * P'(A*P')P = P'A + * we can apply inverse(perm) to rows of A to get large diagonal entries. + * But, since 'perm' defined in MC64AD happens to be the reverse of + * SuperLU's definition of permutation vector, therefore, it is already + * an inverse for our purpose. We will thus use it directly. + * + */ + mc64id_(icntl); +#if 0 + /* Suppress error and warning messages. */ + icntl[0] = -1; + icntl[1] = -1; +#endif + + mc64ad_(&job, &n, &nnz, colptr, adjncy, nzval, &num, perm, + &liw, iw, &ldw, dw, icntl, info); + +#if ( DEBUGlevel>=2 ) + slu_PrintInt10("perm", n, perm); + printf(".. After MC64AD info %d\tsize of matching %d\n", info[0], num); +#endif + if ( info[0] == 1 ) { /* Structurally singular */ + printf(".. The last %d permutations:\n", n-num); + slu_PrintInt10("perm", n-num, &perm[num]); + } + + /* Restore to 0-based indexing. */ + for (i = 0; i <= n; ++i) --colptr[i]; + for (i = 0; i < nnz; ++i) --adjncy[i]; + for (i = 0; i < n; ++i) --perm[i]; + + if ( job == 5 ) + for (i = 0; i < n; ++i) { + u[i] = dw[i]; + v[i] = dw[n+i]; + } + + SUPERLU_FREE(iw); + SUPERLU_FREE(dw); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Exit dldperm()"); +#endif + + return info[0]; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dmemory.c b/thirdparty/superlu/SuperLU_4.1/SRC/dmemory.c new file mode 100644 index 0000000..0c03e0e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dmemory.c @@ -0,0 +1,701 @@ + +/*! @file dmemory.c + * \brief Memory details + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ +#include "slu_ddefs.h" + + +/* Internal prototypes */ +void *dexpand (int *, MemType,int, int, GlobalLU_t *); +int dLUWorkInit (int, int, int, int **, double **, GlobalLU_t *); +void copy_mem_double (int, void *, void *); +void dStackCompress (GlobalLU_t *); +void dSetupSpace (void *, int, GlobalLU_t *); +void *duser_malloc (int, int, GlobalLU_t *); +void duser_free (int, int, GlobalLU_t *); + +/* External prototypes (in memory.c - prec-independent) */ +extern void copy_mem_int (int, void *, void *); +extern void user_bcopy (char *, char *, int); + + +/* Macros to manipulate stack */ +#define StackFull(x) ( x + Glu->stack.used >= Glu->stack.size ) +#define NotDoubleAlign(addr) ( (long int)addr & 7 ) +#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) +#define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \ + (w + 1) * m * sizeof(double) ) +#define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */ + + + + +/*! \brief Setup the memory model to be used for factorization. + * + * lwork = 0: use system malloc; + * lwork > 0: use user-supplied work[] space. + */ +void dSetupSpace(void *work, int lwork, GlobalLU_t *Glu) +{ + if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; /* malloc/free */ + } else if ( lwork > 0 ) { + Glu->MemModel = USER; /* user provided space */ + Glu->stack.used = 0; + Glu->stack.top1 = 0; + Glu->stack.top2 = (lwork/4)*4; /* must be word addressable */ + Glu->stack.size = Glu->stack.top2; + Glu->stack.array = (void *) work; + } +} + + + +void *duser_malloc(int bytes, int which_end, GlobalLU_t *Glu) +{ + void *buf; + + if ( StackFull(bytes) ) return (NULL); + + if ( which_end == HEAD ) { + buf = (char*) Glu->stack.array + Glu->stack.top1; + Glu->stack.top1 += bytes; + } else { + Glu->stack.top2 -= bytes; + buf = (char*) Glu->stack.array + Glu->stack.top2; + } + + Glu->stack.used += bytes; + return buf; +} + + +void duser_free(int bytes, int which_end, GlobalLU_t *Glu) +{ + if ( which_end == HEAD ) { + Glu->stack.top1 -= bytes; + } else { + Glu->stack.top2 += bytes; + } + Glu->stack.used -= bytes; +} + + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int dQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, iword, dword, panel_size = sp_ienv(1); + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(double); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0*n + 3.0) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0 * panel_size + 4.0 + NO_MARKER) * n * iword + + (panel_size + 1.0) * n * dword ); + + return 0; +} /* dQuerySpace */ + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int ilu_dQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, panel_size = sp_ienv(1); + register float iword, dword; + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(double); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0f * n + 3.0f) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0f) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization. + ILU needs 5*n more integers than LU */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0f * panel_size + 9.0f + NO_MARKER) * n * iword + + (panel_size + 1.0f) * n * dword ); + + return 0; +} /* ilu_dQuerySpace */ + + +/*! \brief Allocate storage for the data structures common to all factor routines. + * + *
    + * For those unpredictable size, estimate as fill_ratio * nnz(A).
    + * Return value:
    + *     If lwork = -1, return the estimated amount of space required, plus n;
    + *     otherwise, return the amount of space actually allocated when
    + *     memory allocation failure occurred.
    + * 
    + */ +int +dLUMemInit(fact_t fact, void *work, int lwork, int m, int n, int annz, + int panel_size, double fill_ratio, SuperMatrix *L, SuperMatrix *U, + GlobalLU_t *Glu, int **iwork, double **dwork) +{ + int info, iword, dword; + SCformat *Lstore; + NCformat *Ustore; + int *xsup, *supno; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + double *ucol; + int *usub, *xusub; + int nzlmax, nzumax, nzlumax; + + iword = sizeof(int); + dword = sizeof(double); + Glu->n = n; + Glu->num_expansions = 0; + + if ( !Glu->expanders ) + Glu->expanders = (ExpHeader*)SUPERLU_MALLOC( NO_MEMTYPE * + sizeof(ExpHeader) ); + if ( !Glu->expanders ) ABORT("SUPERLU_MALLOC fails for expanders"); + + if ( fact != SamePattern_SameRowPerm ) { + /* Guess for L\U factors */ + nzumax = nzlumax = fill_ratio * annz; + nzlmax = SUPERLU_MAX(1, fill_ratio/4.) * annz; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else { + dSetupSpace(work, lwork, Glu); + } + +#if ( PRNTlevel >= 1 ) + printf("dLUMemInit() called: fill_ratio %.0f, nzlmax %ld, nzumax %ld\n", + fill_ratio, nzlmax, nzumax); + fflush(stdout); +#endif + + /* Integer pointers for L\U factors */ + if ( Glu->MemModel == SYSTEM ) { + xsup = intMalloc(n+1); + supno = intMalloc(n+1); + xlsub = intMalloc(n+1); + xlusup = intMalloc(n+1); + xusub = intMalloc(n+1); + } else { + xsup = (int *)duser_malloc((n+1) * iword, HEAD, Glu); + supno = (int *)duser_malloc((n+1) * iword, HEAD, Glu); + xlsub = (int *)duser_malloc((n+1) * iword, HEAD, Glu); + xlusup = (int *)duser_malloc((n+1) * iword, HEAD, Glu); + xusub = (int *)duser_malloc((n+1) * iword, HEAD, Glu); + } + + lusup = (double *) dexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (double *) dexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) dexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) dexpand( &nzumax, USUB, 0, 1, Glu ); + + while ( !lusup || !ucol || !lsub || !usub ) { + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE(lusup); + SUPERLU_FREE(ucol); + SUPERLU_FREE(lsub); + SUPERLU_FREE(usub); + } else { + duser_free((nzlumax+nzumax)*dword+(nzlmax+nzumax)*iword, + HEAD, Glu); + } + nzlumax /= 2; + nzumax /= 2; + nzlmax /= 2; + if ( nzlumax < annz ) { + printf("Not enough memory to perform factorization.\n"); + return (dmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + } +#if ( PRNTlevel >= 1) + printf("dLUMemInit() reduce size: nzlmax %ld, nzumax %ld\n", + nzlmax, nzumax); + fflush(stdout); +#endif + lusup = (double *) dexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (double *) dexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) dexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) dexpand( &nzumax, USUB, 0, 1, Glu ); + } + + } else { + /* fact == SamePattern_SameRowPerm */ + Lstore = L->Store; + Ustore = U->Store; + xsup = Lstore->sup_to_col; + supno = Lstore->col_to_sup; + xlsub = Lstore->rowind_colptr; + xlusup = Lstore->nzval_colptr; + xusub = Ustore->colptr; + nzlmax = Glu->nzlmax; /* max from previous factorization */ + nzumax = Glu->nzumax; + nzlumax = Glu->nzlumax; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; + } else { + Glu->MemModel = USER; + Glu->stack.top2 = (lwork/4)*4; /* must be word-addressable */ + Glu->stack.size = Glu->stack.top2; + } + + lsub = Glu->expanders[LSUB].mem = Lstore->rowind; + lusup = Glu->expanders[LUSUP].mem = Lstore->nzval; + usub = Glu->expanders[USUB].mem = Ustore->rowind; + ucol = Glu->expanders[UCOL].mem = Ustore->nzval;; + Glu->expanders[LSUB].size = nzlmax; + Glu->expanders[LUSUP].size = nzlumax; + Glu->expanders[USUB].size = nzumax; + Glu->expanders[UCOL].size = nzumax; + } + + Glu->xsup = xsup; + Glu->supno = supno; + Glu->lsub = lsub; + Glu->xlsub = xlsub; + Glu->lusup = lusup; + Glu->xlusup = xlusup; + Glu->ucol = ucol; + Glu->usub = usub; + Glu->xusub = xusub; + Glu->nzlmax = nzlmax; + Glu->nzumax = nzumax; + Glu->nzlumax = nzlumax; + + info = dLUWorkInit(m, n, panel_size, iwork, dwork, Glu); + if ( info ) + return ( info + dmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + + ++Glu->num_expansions; + return 0; + +} /* dLUMemInit */ + +/*! \brief Allocate known working storage. Returns 0 if success, otherwise + returns the number of bytes allocated so far when failure occurred. */ +int +dLUWorkInit(int m, int n, int panel_size, int **iworkptr, + double **dworkptr, GlobalLU_t *Glu) +{ + int isize, dsize, extra; + double *old_ptr; + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + + isize = ( (2 * panel_size + 3 + NO_MARKER ) * m + n ) * sizeof(int); + dsize = (m * panel_size + + NUM_TEMPV(m,panel_size,maxsuper,rowblk)) * sizeof(double); + + if ( Glu->MemModel == SYSTEM ) + *iworkptr = (int *) intCalloc(isize/sizeof(int)); + else + *iworkptr = (int *) duser_malloc(isize, TAIL, Glu); + if ( ! *iworkptr ) { + fprintf(stderr, "dLUWorkInit: malloc fails for local iworkptr[]\n"); + return (isize + n); + } + + if ( Glu->MemModel == SYSTEM ) + *dworkptr = (double *) SUPERLU_MALLOC(dsize); + else { + *dworkptr = (double *) duser_malloc(dsize, TAIL, Glu); + if ( NotDoubleAlign(*dworkptr) ) { + old_ptr = *dworkptr; + *dworkptr = (double*) DoubleAlign(*dworkptr); + *dworkptr = (double*) ((double*)*dworkptr - 1); + extra = (char*)old_ptr - (char*)*dworkptr; +#ifdef DEBUG + printf("dLUWorkInit: not aligned, extra %d\n", extra); +#endif + Glu->stack.top2 -= extra; + Glu->stack.used += extra; + } + } + if ( ! *dworkptr ) { + fprintf(stderr, "malloc fails for local dworkptr[]."); + return (isize + dsize + n); + } + + return 0; +} + + +/*! \brief Set up pointers for real working arrays. + */ +void +dSetRWork(int m, int panel_size, double *dworkptr, + double **dense, double **tempv) +{ + double zero = 0.0; + + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + *dense = dworkptr; + *tempv = *dense + panel_size*m; + dfill (*dense, m * panel_size, zero); + dfill (*tempv, NUM_TEMPV(m,panel_size,maxsuper,rowblk), zero); +} + +/*! \brief Free the working storage used by factor routines. + */ +void dLUWorkFree(int *iwork, double *dwork, GlobalLU_t *Glu) +{ + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE (iwork); + SUPERLU_FREE (dwork); + } else { + Glu->stack.used -= (Glu->stack.size - Glu->stack.top2); + Glu->stack.top2 = Glu->stack.size; +/* dStackCompress(Glu); */ + } + + SUPERLU_FREE (Glu->expanders); + Glu->expanders = NULL; +} + +/*! \brief Expand the data structures for L and U during the factorization. + * + *
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +dLUMemXpand(int jcol, + int next, /* number of elements currently in the factors */ + MemType mem_type, /* which type of memory to expand */ + int *maxlen, /* modified - maximum length of a data structure */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + void *new_mem; + +#ifdef DEBUG + printf("dLUMemXpand(): jcol %d, next %d, maxlen %d, MemType %d\n", + jcol, next, *maxlen, mem_type); +#endif + + if (mem_type == USUB) + new_mem = dexpand(maxlen, mem_type, next, 1, Glu); + else + new_mem = dexpand(maxlen, mem_type, next, 0, Glu); + + if ( !new_mem ) { + int nzlmax = Glu->nzlmax; + int nzumax = Glu->nzumax; + int nzlumax = Glu->nzlumax; + fprintf(stderr, "Can't expand MemType %d: jcol %d\n", mem_type, jcol); + return (dmemory_usage(nzlmax, nzumax, nzlumax, Glu->n) + Glu->n); + } + + switch ( mem_type ) { + case LUSUP: + Glu->lusup = (double *) new_mem; + Glu->nzlumax = *maxlen; + break; + case UCOL: + Glu->ucol = (double *) new_mem; + Glu->nzumax = *maxlen; + break; + case LSUB: + Glu->lsub = (int *) new_mem; + Glu->nzlmax = *maxlen; + break; + case USUB: + Glu->usub = (int *) new_mem; + Glu->nzumax = *maxlen; + break; + } + + return 0; + +} + + + +void +copy_mem_double(int howmany, void *old, void *new) +{ + register int i; + double *dold = old; + double *dnew = new; + for (i = 0; i < howmany; i++) dnew[i] = dold[i]; +} + +/*! \brief Expand the existing storage to accommodate more fill-ins. + */ +void +*dexpand ( + int *prev_len, /* length used from previous call */ + MemType type, /* which part of the memory to expand */ + int len_to_copy, /* size of the memory to be copied to new store */ + int keep_prev, /* = 1: use prev_len; + = 0: compute new_len to expand */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + float EXPAND = 1.5; + float alpha; + void *new_mem, *old_mem; + int new_len, tries, lword, extra, bytes_to_copy; + ExpHeader *expanders = Glu->expanders; /* Array of 4 types of memory */ + + alpha = EXPAND; + + if ( Glu->num_expansions == 0 || keep_prev ) { + /* First time allocate requested */ + new_len = *prev_len; + } else { + new_len = alpha * *prev_len; + } + + if ( type == LSUB || type == USUB ) lword = sizeof(int); + else lword = sizeof(double); + + if ( Glu->MemModel == SYSTEM ) { + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + if ( Glu->num_expansions != 0 ) { + tries = 0; + if ( keep_prev ) { + if ( !new_mem ) return (NULL); + } else { + while ( !new_mem ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + } + } + if ( type == LSUB || type == USUB ) { + copy_mem_int(len_to_copy, expanders[type].mem, new_mem); + } else { + copy_mem_double(len_to_copy, expanders[type].mem, new_mem); + } + SUPERLU_FREE (expanders[type].mem); + } + expanders[type].mem = (void *) new_mem; + + } else { /* MemModel == USER */ + if ( Glu->num_expansions == 0 ) { + new_mem = duser_malloc(new_len * lword, HEAD, Glu); + if ( NotDoubleAlign(new_mem) && + (type == LUSUP || type == UCOL) ) { + old_mem = new_mem; + new_mem = (void *)DoubleAlign(new_mem); + extra = (char*)new_mem - (char*)old_mem; +#ifdef DEBUG + printf("expand(): not aligned, extra %d\n", extra); +#endif + Glu->stack.top1 += extra; + Glu->stack.used += extra; + } + expanders[type].mem = (void *) new_mem; + } else { + tries = 0; + extra = (new_len - *prev_len) * lword; + if ( keep_prev ) { + if ( StackFull(extra) ) return (NULL); + } else { + while ( StackFull(extra) ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + extra = (new_len - *prev_len) * lword; + } + } + + if ( type != USUB ) { + new_mem = (void*)((char*)expanders[type + 1].mem + extra); + bytes_to_copy = (char*)Glu->stack.array + Glu->stack.top1 + - (char*)expanders[type + 1].mem; + user_bcopy(expanders[type+1].mem, new_mem, bytes_to_copy); + + if ( type < USUB ) { + Glu->usub = expanders[USUB].mem = + (void*)((char*)expanders[USUB].mem + extra); + } + if ( type < LSUB ) { + Glu->lsub = expanders[LSUB].mem = + (void*)((char*)expanders[LSUB].mem + extra); + } + if ( type < UCOL ) { + Glu->ucol = expanders[UCOL].mem = + (void*)((char*)expanders[UCOL].mem + extra); + } + Glu->stack.top1 += extra; + Glu->stack.used += extra; + if ( type == UCOL ) { + Glu->stack.top1 += extra; /* Add same amount for USUB */ + Glu->stack.used += extra; + } + + } /* if ... */ + + } /* else ... */ + } + + expanders[type].size = new_len; + *prev_len = new_len; + if ( Glu->num_expansions ) ++Glu->num_expansions; + + return (void *) expanders[type].mem; + +} /* dexpand */ + + +/*! \brief Compress the work[] array to remove fragmentation. + */ +void +dStackCompress(GlobalLU_t *Glu) +{ + register int iword, dword, ndim; + char *last, *fragment; + int *ifrom, *ito; + double *dfrom, *dto; + int *xlsub, *lsub, *xusub, *usub, *xlusup; + double *ucol, *lusup; + + iword = sizeof(int); + dword = sizeof(double); + ndim = Glu->n; + + xlsub = Glu->xlsub; + lsub = Glu->lsub; + xusub = Glu->xusub; + usub = Glu->usub; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + lusup = Glu->lusup; + + dfrom = ucol; + dto = (double *)((char*)lusup + xlusup[ndim] * dword); + copy_mem_double(xusub[ndim], dfrom, dto); + ucol = dto; + + ifrom = lsub; + ito = (int *) ((char*)ucol + xusub[ndim] * iword); + copy_mem_int(xlsub[ndim], ifrom, ito); + lsub = ito; + + ifrom = usub; + ito = (int *) ((char*)lsub + xlsub[ndim] * iword); + copy_mem_int(xusub[ndim], ifrom, ito); + usub = ito; + + last = (char*)usub + xusub[ndim] * iword; + fragment = (char*) (((char*)Glu->stack.array + Glu->stack.top1) - last); + Glu->stack.used -= (long int) fragment; + Glu->stack.top1 -= (long int) fragment; + + Glu->ucol = ucol; + Glu->lsub = lsub; + Glu->usub = usub; + +#ifdef DEBUG + printf("dStackCompress: fragment %d\n", fragment); + /* for (last = 0; last < ndim; ++last) + print_lu_col("After compress:", last, 0);*/ +#endif + +} + +/*! \brief Allocate storage for original matrix A + */ +void +dallocateA(int n, int nnz, double **a, int **asub, int **xa) +{ + *a = (double *) doubleMalloc(nnz); + *asub = (int *) intMalloc(nnz); + *xa = (int *) intMalloc(n+1); +} + + +double *doubleMalloc(int n) +{ + double *buf; + buf = (double *) SUPERLU_MALLOC((size_t)n * sizeof(double)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in doubleMalloc()\n"); + } + return (buf); +} + +double *doubleCalloc(int n) +{ + double *buf; + register int i; + double zero = 0.0; + buf = (double *) SUPERLU_MALLOC((size_t)n * sizeof(double)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in doubleCalloc()\n"); + } + for (i = 0; i < n; ++i) buf[i] = zero; + return (buf); +} + + +int dmemory_usage(const int nzlmax, const int nzumax, + const int nzlumax, const int n) +{ + register int iword, dword; + + iword = sizeof(int); + dword = sizeof(double); + + return (10 * n * iword + + nzlmax * iword + nzumax * (iword + dword) + nzlumax * dword); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dmyblas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/dmyblas2.c new file mode 100644 index 0000000..2a58f5b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dmyblas2.c @@ -0,0 +1,230 @@ + +/*! @file dmyblas2.c + * \brief Level 2 Blas operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Purpose: + * Level 2 BLAS operations: solves and matvec, written in C. + * Note: + * This is only used when the system lacks an efficient BLAS library. + * + */ +/* + * File name: dmyblas2.c + */ + +/*! \brief Solves a dense UNIT lower triangular system + * + * The unit lower + * triangular matrix is stored in a 2D array M(1:nrow,1:ncol). + * The solution will be returned in the rhs vector. + */ +void dlsolve ( int ldm, int ncol, double *M, double *rhs ) +{ + int k; + double x0, x1, x2, x3, x4, x5, x6, x7; + double *M0; + register double *Mki0, *Mki1, *Mki2, *Mki3, *Mki4, *Mki5, *Mki6, *Mki7; + register int firstcol = 0; + + M0 = &M[0]; + + while ( firstcol < ncol - 7 ) { /* Do 8 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + Mki4 = Mki3 + ldm + 1; + Mki5 = Mki4 + ldm + 1; + Mki6 = Mki5 + ldm + 1; + Mki7 = Mki6 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + x2 = rhs[firstcol+2] - x0 * *Mki0++ - x1 * *Mki1++; + x3 = rhs[firstcol+3] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++; + x4 = rhs[firstcol+4] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++; + x5 = rhs[firstcol+5] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++; + x6 = rhs[firstcol+6] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++ - x5 * *Mki5++; + x7 = rhs[firstcol+7] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++ - x5 * *Mki5++ + - x6 * *Mki6++; + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + rhs[++firstcol] = x4; + rhs[++firstcol] = x5; + rhs[++firstcol] = x6; + rhs[++firstcol] = x7; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++ + - x2 * *Mki2++ - x3 * *Mki3++ + - x4 * *Mki4++ - x5 * *Mki5++ + - x6 * *Mki6++ - x7 * *Mki7++; + + M0 += 8 * ldm + 8; + } + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + x2 = rhs[firstcol+2] - x0 * *Mki0++ - x1 * *Mki1++; + x3 = rhs[firstcol+3] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++; + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++ + - x2 * *Mki2++ - x3 * *Mki3++; + + M0 += 4 * ldm + 4; + } + + if ( firstcol < ncol - 1 ) { /* Do 2 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + + rhs[++firstcol] = x1; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++; + + } + +} + +/*! \brief Solves a dense upper triangular system + * + * The upper triangular matrix is + * stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned + * in the rhs vector. + */ +void +dusolve ( ldm, ncol, M, rhs ) +int ldm; /* in */ +int ncol; /* in */ +double *M; /* in */ +double *rhs; /* modified */ +{ + double xj; + int jcol, j, irow; + + jcol = ncol - 1; + + for (j = 0; j < ncol; j++) { + + xj = rhs[jcol] / M[jcol + jcol*ldm]; /* M(jcol, jcol) */ + rhs[jcol] = xj; + + for (irow = 0; irow < jcol; irow++) + rhs[irow] -= xj * M[irow + jcol*ldm]; /* M(irow, jcol) */ + + jcol--; + + } +} + + +/*! \brief Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec. + * + * The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. + */ +void dmatvec ( ldm, nrow, ncol, M, vec, Mxvec ) + +int ldm; /* in -- leading dimension of M */ +int nrow; /* in */ +int ncol; /* in */ +double *M; /* in */ +double *vec; /* in */ +double *Mxvec; /* in/out */ + +{ + double vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7; + double *M0; + register double *Mki0, *Mki1, *Mki2, *Mki3, *Mki4, *Mki5, *Mki6, *Mki7; + register int firstcol = 0; + int k; + + M0 = &M[0]; + while ( firstcol < ncol - 7 ) { /* Do 8 columns */ + + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + Mki4 = Mki3 + ldm; + Mki5 = Mki4 + ldm; + Mki6 = Mki5 + ldm; + Mki7 = Mki6 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + vi4 = vec[firstcol++]; + vi5 = vec[firstcol++]; + vi6 = vec[firstcol++]; + vi7 = vec[firstcol++]; + + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++ + vi1 * *Mki1++ + + vi2 * *Mki2++ + vi3 * *Mki3++ + + vi4 * *Mki4++ + vi5 * *Mki5++ + + vi6 * *Mki6++ + vi7 * *Mki7++; + + M0 += 8 * ldm; + } + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++ + vi1 * *Mki1++ + + vi2 * *Mki2++ + vi3 * *Mki3++ ; + + M0 += 4 * ldm; + } + + while ( firstcol < ncol ) { /* Do 1 column */ + + Mki0 = M0; + vi0 = vec[firstcol++]; + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++; + + M0 += ldm; + } + +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_bmod.c new file mode 100644 index 0000000..f2ae3a8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_bmod.c @@ -0,0 +1,459 @@ + +/*! @file dpanel_bmod.c + * \brief Performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ +/* + +*/ + +#include +#include +#include "slu_ddefs.h" + +/* + * Function prototypes + */ +void dlsolve(int, int, double *, double *); +void dmatvec(int, int, int, double *, double *, double *); +extern void dcheck_tempv(); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *    Performs numeric block updates (sup-panel) in topological order.
    + *    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + *    Special processing on the supernodal portion of L\U[*,j]
    + *
    + *    Before entering this routine, the original nonzeros in the panel 
    + *    were already copied into the spa[m,w].
    + *
    + *    Updated/Output parameters-
    + *    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    + *    collectively in the m-by-w vector dense[*]. 
    + * 
    + */ + +void +dpanel_bmod ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + const int nseg, /* in */ + double *dense, /* out, of size n by w */ + double *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in, of size n by w */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + double alpha, beta; +#endif + + register int k, ksub; + int fsupc, nsupc, nsupr, nrow; + int krep, krep_ind; + double ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int segsze; + int block_nrow; /* no of rows in a block row */ + register int lptr; /* Points to the row subscripts of a supernode */ + int kfnz, irow, no_zeros; + register int isub, isub1, i; + register int jj; /* Index through each column in the panel */ + int *xsup, *supno; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + int *repfnz_col; /* repfnz[] for a column in the panel */ + double *dense_col; /* dense[] for a column in the panel */ + double *tempv1; /* Used in 1-D update */ + double *TriTmp, *MatvecTmp; /* used in 2-D update */ + double zero = 0.0; + double one = 1.0; + register int ldaTmp; + register int r_ind, r_hi; + static int first = 1, maxsuper, rowblk, colblk; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + if ( first ) { + maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ); + rowblk = sp_ienv(4); + colblk = sp_ienv(5); + first = 0; + } + ldaTmp = maxsuper + rowblk; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { /* for each updating supernode */ + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in a supernode + * nsupr = no of rows in a supernode + */ + krep = segrep[k--]; + fsupc = xsup[supno[krep]]; + nsupc = krep - fsupc + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nrow = nsupr - nsupc; + lptr = xlsub[fsupc]; + krep_ind = lptr + nsupc - 1; + + repfnz_col = repfnz; + dense_col = dense; + + if ( nsupc >= colblk && nrow > rowblk ) { /* 2-D block update */ + + TriTmp = tempv; + + /* Sequence through each column in panel -- triangular solves */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp ) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + dense_col[irow] -= ukj * lusup[luptr]; + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + ukj -= ukj1 * lusup[luptr1]; + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; + dense_col[irow] -= (ukj*lusup[luptr] + + ukj1*lusup[luptr1]); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; luptr2++; + dense_col[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + } else { /* segsze >= 4 */ + + /* Copy U[*,j] segment from dense[*] to TriTmp[*], which + holds the result of triangular solves. */ + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + TriTmp[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#else + dtrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#endif +#else + dlsolve ( nsupr, segsze, &lusup[luptr], TriTmp ); +#endif + + + } /* else ... */ + + } /* for jj ... end tri-solves */ + + /* Block row updates; push all the way into dense[*] block */ + for ( r_ind = 0; r_ind < nrow; r_ind += rowblk ) { + + r_hi = SUPERLU_MIN(nrow, r_ind + rowblk); + block_nrow = SUPERLU_MIN(rowblk, r_hi - r_ind); + luptr = xlusup[fsupc] + nsupc + r_ind; + isub1 = lptr + nsupc + r_ind; + + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + /* Sequence through each column in panel -- matrix-vector */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + /* Perform a block update, and scatter the result of + matrix-vector to dense[]. */ + no_zeros = kfnz - fsupc; + luptr1 = luptr + nsupr * no_zeros; + MatvecTmp = &TriTmp[maxsuper]; + +#ifdef USE_VENDOR_BLAS + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV(ftcs2, &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#else + dgemv_("N", &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#endif +#else + dmatvec(nsupr, block_nrow, segsze, &lusup[luptr1], + TriTmp, MatvecTmp); +#endif + + /* Scatter MatvecTmp[*] into SPA dense[*] temporarily + * such that MatvecTmp[*] can be re-used for the + * the next blok row update. dense[] will be copied into + * global store after the whole panel has been finished. + */ + isub = isub1; + for (i = 0; i < block_nrow; i++) { + irow = lsub[isub]; + dense_col[irow] -= MatvecTmp[i]; + MatvecTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } /* for each block row ... */ + + /* Scatter the triangular solves into SPA dense[*] */ + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = TriTmp[i]; + TriTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } else { /* 1-D block modification */ + + + /* Sequence through each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + dense_col[irow] -= ukj * lusup[luptr]; + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + ukj -= ukj1 * lusup[luptr1]; + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; + dense_col[irow] -= (ukj*lusup[luptr] + + ukj1*lusup[luptr1]); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; ++luptr2; + dense_col[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + } else { /* segsze >= 4 */ + /* + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense[]. + */ + no_zeros = kfnz - fsupc; + + /* Copy U[*,j] segment from dense[*] to tempv[*]: + * The result of triangular solve is in tempv[*]; + * The result of matrix vector update is in dense_col[*] + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + tempv[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + dtrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + dgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + dlsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + dmatvec (nsupr, nrow, segsze, &lusup[luptr], tempv, tempv1); +#endif + + /* Scatter tempv[*] into SPA dense[*] temporarily, such + * that tempv[*] can be used for the triangular solve of + * the next column of the panel. They will be copied into + * ucol[*] after the whole panel has been finished. + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = tempv[i]; + tempv[i] = zero; + isub++; + } + + /* Scatter the update from tempv1[*] into SPA dense[*] */ + /* Start dense rectangular L */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + dense_col[irow] -= tempv1[i]; + tempv1[i] = zero; + ++isub; + } + + } /* else segsze>=4 ... */ + + } /* for each column in the panel... */ + + } /* else 1-D update ... */ + + } /* for each updating supernode ... */ + +} + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_dfs.c new file mode 100644 index 0000000..73343e5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dpanel_dfs.c @@ -0,0 +1,254 @@ + +/*! @file dpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel. 
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a 
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ + +void +dpanel_dfs ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + double *dense, /* out */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *xprune, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + NCPformat *Astore; + double *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + double *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/dpivotL.c new file mode 100644 index 0000000..bcfa96d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dpivotL.c @@ -0,0 +1,184 @@ + +/*! @file dpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include +#include "slu_ddefs.h" + +#undef DEBUG + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *           pivot row = k;
    + *       ELSE IF abs(A_jj) >= thresh THEN
    + *           pivot row = j;
    + *       ELSE
    + *           pivot row = m;
    + * 
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0      success;
    + *                 i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +dpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int *iperm_r, /* in - inverse of perm_r */ + int *iperm_c, /* in - used to find diagonal of Pc*A*Pc' */ + int *pivrow, /* out */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + int pivptr, old_pivptr, diag, diagind; + double pivmax, rtemp, thresh; + double temp; + double *lu_sup_ptr; + double *lu_col_ptr; + int *lsub_ptr; + int isub, icol, k, itemp; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + /* Initialize pointers */ + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + +#ifdef DEBUG +if ( jcol == MIN_COL ) { + printf("Before cdiv: col %d\n", jcol); + for (k = nsupc; k < nsupr; k++) + printf(" lu[%d] %f\n", lsub_ptr[k], lu_col_ptr[k]); +} +#endif + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + if ( *usepr ) *pivrow = iperm_r[jcol]; + diagind = iperm_c[jcol]; + pivmax = 0.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + for (isub = nsupc; isub < nsupr; ++isub) { + rtemp = fabs (lu_col_ptr[isub]); + if ( rtemp > pivmax ) { + pivmax = rtemp; + pivptr = isub; + } + if ( *usepr && lsub_ptr[isub] == *pivrow ) old_pivptr = isub; + if ( lsub_ptr[isub] == diagind ) diag = isub; + } + + /* Test for singularity */ + if ( pivmax == 0.0 ) { +#if 1 + *pivrow = lsub_ptr[pivptr]; + perm_r[*pivrow] = jcol; +#else + perm_r[diagind] = jcol; +#endif + *usepr = 0; + return (jcol+1); + } + + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + rtemp = fabs (lu_col_ptr[old_pivptr]); + if ( rtemp != 0.0 && rtemp >= thresh ) + pivptr = old_pivptr; + else + *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + rtemp = fabs (lu_col_ptr[diag]); + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += nsupr - nsupc; + + temp = 1.0 / lu_col_ptr[nsupc]; + for (k = nsupc+1; k < nsupr; k++) + lu_col_ptr[k] *= temp; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dpivotgrowth.c b/thirdparty/superlu/SuperLU_4.1/SRC/dpivotgrowth.c new file mode 100644 index 0000000..14fec65 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dpivotgrowth.c @@ -0,0 +1,113 @@ + +/*! @file dpivotgrowth.c + * \brief Computes the reciprocal pivot growth factor + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Compute the reciprocal pivot growth factor of the leading ncols columns
    + * of the matrix, using the formula:
    + *     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )
    + *
    + * Arguments
    + * =========
    + *
    + * ncols    (input) int
    + *          The number of columns of matrices A, L and U.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = NC; Dtype = SLU_D; Mtype = GE.
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SC; Dtype = SLU_D; Mtype = TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = NC;
    + *          Dtype = SLU_D; Mtype = TRU.
    + * 
    + */ + +double +dPivotGrowth(int ncols, SuperMatrix *A, int *perm_c, + SuperMatrix *L, SuperMatrix *U) +{ + + NCformat *Astore; + SCformat *Lstore; + NCformat *Ustore; + double *Aval, *Lval, *Uval; + int fsupc, nsupr, luptr, nz_in_U; + int i, j, k, oldcol; + int *inv_perm_c; + double rpg, maxaj, maxuj; + double smlnum; + double *luval; + + /* Get machine constants. */ + smlnum = dlamch_("S"); + rpg = 1. / smlnum; + + Astore = A->Store; + Lstore = L->Store; + Ustore = U->Store; + Aval = Astore->nzval; + Lval = Lstore->nzval; + Uval = Ustore->nzval; + + inv_perm_c = (int *) SUPERLU_MALLOC(A->ncol*sizeof(int)); + for (j = 0; j < A->ncol; ++j) inv_perm_c[perm_c[j]] = j; + + for (k = 0; k <= Lstore->nsuper; ++k) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + luptr = L_NZ_START(fsupc); + luval = &Lval[luptr]; + nz_in_U = 1; + + for (j = fsupc; j < L_FST_SUPC(k+1) && j < ncols; ++j) { + maxaj = 0.; + oldcol = inv_perm_c[j]; + for (i = Astore->colptr[oldcol]; i < Astore->colptr[oldcol+1]; ++i) + maxaj = SUPERLU_MAX( maxaj, fabs(Aval[i]) ); + + maxuj = 0.; + for (i = Ustore->colptr[j]; i < Ustore->colptr[j+1]; i++) + maxuj = SUPERLU_MAX( maxuj, fabs(Uval[i]) ); + + /* Supernode */ + for (i = 0; i < nz_in_U; ++i) + maxuj = SUPERLU_MAX( maxuj, fabs(luval[i]) ); + + ++nz_in_U; + luval += nsupr; + + if ( maxuj == 0. ) + rpg = SUPERLU_MIN( rpg, 1.); + else + rpg = SUPERLU_MIN( rpg, maxaj / maxuj ); + } + + if ( j >= ncols ) break; + } + + SUPERLU_FREE(inv_perm_c); + return (rpg); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dpruneL.c b/thirdparty/superlu/SuperLU_4.1/SRC/dpruneL.c new file mode 100644 index 0000000..62b8099 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dpruneL.c @@ -0,0 +1,154 @@ + +/*! @file dpruneL.c + * \brief Prunes the L-structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + *
    + */ + + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Prunes the L-structure of supernodes whose L-structure
    + *   contains the current pivot row "pivrow"
    + * 
    + */ + +void +dpruneL( + const int jcol, /* in */ + const int *perm_r, /* in */ + const int pivrow, /* in */ + const int nseg, /* in */ + const int *segrep, /* in */ + const int *repfnz, /* in */ + int *xprune, /* out */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + + double utemp; + int jsupno, irep, irep1, kmin, kmax, krow, movnum; + int i, ktemp, minloc, maxloc; + int do_prune; /* logical variable */ + int *xsup, *supno; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + /* + * For each supernode-rep irep in U[*,j] + */ + jsupno = supno[jcol]; + for (i = 0; i < nseg; i++) { + + irep = segrep[i]; + irep1 = irep + 1; + do_prune = FALSE; + + /* Don't prune with a zero U-segment */ + if ( repfnz[irep] == EMPTY ) + continue; + + /* If a snode overlaps with the next panel, then the U-segment + * is fragmented into two parts -- irep and irep1. We should let + * pruning occur at the rep-column in irep1's snode. + */ + if ( supno[irep] == supno[irep1] ) /* Don't prune */ + continue; + + /* + * If it has not been pruned & it has a nonz in row L[pivrow,i] + */ + if ( supno[irep] != jsupno ) { + if ( xprune[irep] >= xlsub[irep1] ) { + kmin = xlsub[irep]; + kmax = xlsub[irep1] - 1; + for (krow = kmin; krow <= kmax; krow++) + if ( lsub[krow] == pivrow ) { + do_prune = TRUE; + break; + } + } + + if ( do_prune ) { + + /* Do a quicksort-type partition + * movnum=TRUE means that the num values have to be exchanged. + */ + movnum = FALSE; + if ( irep == xsup[supno[irep]] ) /* Snode of size 1 */ + movnum = TRUE; + + while ( kmin <= kmax ) { + + if ( perm_r[lsub[kmax]] == EMPTY ) + kmax--; + else if ( perm_r[lsub[kmin]] != EMPTY ) + kmin++; + else { /* kmin below pivrow (not yet pivoted), and kmax + * above pivrow: interchange the two subscripts + */ + ktemp = lsub[kmin]; + lsub[kmin] = lsub[kmax]; + lsub[kmax] = ktemp; + + /* If the supernode has only one column, then we + * only keep one set of subscripts. For any subscript + * interchange performed, similar interchange must be + * done on the numerical values. + */ + if ( movnum ) { + minloc = xlusup[irep] + (kmin - xlsub[irep]); + maxloc = xlusup[irep] + (kmax - xlsub[irep]); + utemp = lusup[minloc]; + lusup[minloc] = lusup[maxloc]; + lusup[maxloc] = utemp; + } + + kmin++; + kmax--; + + } + + } /* while */ + + xprune[irep] = kmin; /* Pruning */ + +#ifdef CHK_PRUNE + printf(" After dpruneL(),using col %d: xprune[%d] = %d\n", + jcol, irep, kmin); +#endif + } /* if do_prune */ + + } /* if */ + + } /* for each U-segment... */ +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dreadhb.c b/thirdparty/superlu/SuperLU_4.1/SRC/dreadhb.c new file mode 100644 index 0000000..e2aa3d6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dreadhb.c @@ -0,0 +1,257 @@ + +/*! @file dreadhb.c + * \brief Read a matrix stored in Harwell-Boeing format + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Purpose
    + * =======
    + * 
    + * Read a DOUBLE PRECISION matrix stored in Harwell-Boeing format 
    + * as described below.
    + * 
    + * Line 1 (A72,A8) 
    + *  	Col. 1 - 72   Title (TITLE) 
    + *	Col. 73 - 80  Key (KEY) 
    + * 
    + * Line 2 (5I14) 
    + * 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + * 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + * 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + * 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    + *	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    + *                    (including starting guesses and solution vectors 
    + *		       if present) 
    + *           	      (zero indicates no right-hand side data is present) 
    + *
    + * Line 3 (A3, 11X, 4I14) 
    + *   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + * 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + * 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    + *	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    + *	              (equal to number of entries for assembled matrices) 
    + * 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    + *	              (zero in the case of assembled matrices) 
    + * Line 4 (2A16, 2A20) 
    + * 	Col. 1 - 16   Format for pointers (PTRFMT) 
    + *	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    + *	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + * 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT) 
    + *
    + * Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    + *    	Col. 1 	      Right-hand side type: 
    + *	         	  F for full storage or M for same format as matrix 
    + *    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    + *    	Col. 3        X if an exact solution vector(s) is supplied. 
    + *	Col. 15 - 28  Number of right-hand sides (NRHS) 
    + *	Col. 29 - 42  Number of row indices (NRHSIX) 
    + *          	      (ignored in case of unassembled matrices) 
    + *
    + * The three character type field on line 3 describes the matrix type. 
    + * The following table lists the permitted values for each of the three 
    + * characters. As an example of the type field, RSA denotes that the matrix 
    + * is real, symmetric, and assembled. 
    + *
    + * First Character: 
    + *	R Real matrix 
    + *	C Complex matrix 
    + *	P Pattern only (no numerical values supplied) 
    + *
    + * Second Character: 
    + *	S Symmetric 
    + *	U Unsymmetric 
    + *	H Hermitian 
    + *	Z Skew symmetric 
    + *	R Rectangular 
    + *
    + * Third Character: 
    + *	A Assembled 
    + *	E Elemental matrices (unassembled) 
    + *
    + * 
    + */ +#include +#include +#include "slu_ddefs.h" + + +/*! \brief Eat up the rest of the current line */ +int dDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +int dParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +int dParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + * + * Purpose + * ======= + * + * Read a DOUBLE PRECISION matrix stored in Rutherford-Boeing format + * as described below. + * + * Line 1 (A72, A8) + * Col. 1 - 72 Title (TITLE) + * Col. 73 - 80 Matrix name / identifier (MTRXID) + * + * Line 2 (I14, 3(1X, I13)) + * Col. 1 - 14 Total number of lines excluding header (TOTCRD) + * Col. 16 - 28 Number of lines for pointers (PTRCRD) + * Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) + * Col. 44 - 56 Number of lines for numerical values (VALCRD) + * + * Line 3 (A3, 11X, 4(1X, I13)) + * Col. 1 - 3 Matrix type (see below) (MXTYPE) + * Col. 15 - 28 Compressed Column: Number of rows (NROW) + * Elemental: Largest integer used to index variable (MVAR) + * Col. 30 - 42 Compressed Column: Number of columns (NCOL) + * Elemental: Number of element matrices (NELT) + * Col. 44 - 56 Compressed Column: Number of entries (NNZERO) + * Elemental: Number of variable indeces (NVARIX) + * Col. 58 - 70 Compressed Column: Unused, explicitly zero + * Elemental: Number of elemental matrix entries (NELTVL) + * + * Line 4 (2A16, A20) + * Col. 1 - 16 Fortran format for pointers (PTRFMT) + * Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) + * Col. 33 - 52 Fortran format for numerical values of coefficient matrix + * (VALFMT) + * (blank in the case of matrix patterns) + * + * The three character type field on line 3 describes the matrix type. + * The following table lists the permitted values for each of the three + * characters. As an example of the type field, RSA denotes that the matrix + * is real, symmetric, and assembled. + * + * First Character: + * R Real matrix + * C Complex matrix + * I integer matrix + * P Pattern only (no numerical values supplied) + * Q Pattern only (numerical values supplied in associated auxiliary value + * file) + * + * Second Character: + * S Symmetric + * U Unsymmetric + * H Hermitian + * Z Skew symmetric + * R Rectangular + * + * Third Character: + * A Compressed column form + * E Elemental form + * + * + */ + +#include "slu_ddefs.h" + + +/*! \brief Eat up the rest of the current line */ +static int dDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +static int dParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +static int dParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + */ + +#include "slu_ddefs.h" + + +void +dreadtriple(int *m, int *n, int *nonz, + double **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int j, k, jsize, nnz, nz; + double *a, *val; + int *asub, *xa, *row, *col; + int zero_base = 0; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d", n, nonz); + *m = *n; + printf("m %d, n %d, nonz %d\n", *m, *n, *nonz); + dallocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (double *) SUPERLU_MALLOC(*nonz * sizeof(double)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + for (j = 0; j < *n; ++j) xa[j] = 0; + + /* Read into the triplet array from a file */ + for (nnz = 0, nz = 0; nnz < *nonz; ++nnz) { + scanf("%d%d%lf\n", &row[nz], &col[nz], &val[nz]); + + if ( nnz == 0 ) { /* first nonzero */ + if ( row[0] == 0 || col[0] == 0 ) { + zero_base = 1; + printf("triplet file: row/col indices are zero-based.\n"); + } else + printf("triplet file: row/col indices are one-based.\n"); + } + + if ( !zero_base ) { + /* Change to 0-based indexing. */ + --row[nz]; + --col[nz]; + } + + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n + /*|| val[nz] == 0.*/) { + fprintf(stderr, "nz %d, (%d, %d) = %e out of bound, removed\n", + nz, row[nz], col[nz], val[nz]); + exit(-1); + } else { + ++xa[col[nz]]; + ++nz; + } + } + + *nonz = nz; + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + { + int i; + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } + } +#endif + +} + + +void dreadrhs(int m, double *b) +{ + FILE *fp, *fopen(); + int i; + /*int j;*/ + + if ( !(fp = fopen("b.dat", "r")) ) { + fprintf(stderr, "dreadrhs: file does not exist\n"); + exit(-1); + } + for (i = 0; i < m; ++i) + fscanf(fp, "%lf\n", &b[i]); + + /* readpair_(j, &b[i]);*/ + fclose(fp); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_bmod.c new file mode 100644 index 0000000..8d70a99 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_bmod.c @@ -0,0 +1,118 @@ + +/*! @file dsnode_bmod.c + * \brief Performs numeric block updates within the relaxed snode. + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_ddefs.h" + + +/*! \brief Performs numeric block updates within the relaxed snode. + */ +int +dsnode_bmod ( + const int jcol, /* in */ + const int jsupno, /* in */ + const int fsupc, /* in */ + double *dense, /* in */ + double *tempv, /* working array */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + double alpha = -1.0, beta = 1.0; +#endif + + int luptr, nsupc, nsupr, nrow; + int isub, irow, i, iptr; + register int ufirst, nextlu; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + nextlu = xlusup[jcol]; + + /* + * Process the supernodal portion of L\U[*,j] + */ + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = 0; + ++nextlu; + } + + xlusup[jcol + 1] = nextlu; /* Initialize xlusup for next column */ + + if ( fsupc < jcol ) { + + luptr = xlusup[fsupc]; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nsupc = jcol - fsupc; /* Excluding jcol */ + ufirst = xlusup[jcol]; /* Points to the beginning of column + jcol in supernode L\U(jsupno). */ + nrow = nsupr - nsupc; + + ops[TRSV] += nsupc * (nsupc - 1); + ops[GEMV] += 2 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + SGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + dtrsv_( "L", "N", "U", &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + dgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + dlsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + dmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], &tempv[0] ); + + /* Scatter tempv[*] into lusup[*] */ + iptr = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + lusup[iptr++] -= tempv[i]; + tempv[i] = 0.0; + } +#endif + + } + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_dfs.c new file mode 100644 index 0000000..9672fe6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dsnode_dfs.c @@ -0,0 +1,112 @@ + +/*! @file dsnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    dsnode_dfs() - Determine the union of the row structures of those 
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +dsnode_dfs ( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *xprune, /* out */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, ifrom, ito, nextl, new_next; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) { + if ( mem_error = dLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1, then make a copy of the subscripts for pruning */ + if ( jcol < kcol ) { + new_next = nextl + (nextl - xlsub[jcol]); + while ( new_next > nzlmax ) { + if ( mem_error = dLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + ito = nextl; + for (ifrom = xlsub[jcol]; ifrom < nextl; ) + lsub[ito++] = lsub[ifrom++]; + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + nextl = ito; + } + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xprune[kcol] = nextl; + xlsub[kcol+1] = nextl; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas2.c new file mode 100644 index 0000000..59d6d40 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas2.c @@ -0,0 +1,477 @@ + +/*! @file dsp_blas2.c + * \brief Sparse BLAS 2, using some dense BLAS 2 operations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +/* + * File name: dsp_blas2.c + * Purpose: Sparse BLAS 2, using some dense BLAS 2 operations. + */ + +#include "slu_ddefs.h" + +/* + * Function prototypes + */ +void dusolve(int, int, double*, double*); +void dlsolve(int, int, double*, double*); +void dmatvec(int, int, int, double*, double*, double*); + +/*! \brief Solves one of the systems of equations A*x = b, or A'*x = b + * + *
    + *   Purpose
    + *   =======
    + *
    + *   sp_dtrsv() solves one of the systems of equations   
    + *       A*x = b,   or   A'*x = b,
    + *   where b and x are n element vectors and A is a sparse unit , or   
    + *   non-unit, upper or lower triangular matrix.   
    + *   No test for singularity or near-singularity is included in this   
    + *   routine. Such tests must be performed before calling this routine.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   uplo   - (input) char*
    + *            On entry, uplo specifies whether the matrix is an upper or   
    + *             lower triangular matrix as follows:   
    + *                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    + *                uplo = 'L' or 'l'   A is a lower triangular matrix.   
    + *
    + *   trans  - (input) char*
    + *             On entry, trans specifies the equations to be solved as   
    + *             follows:   
    + *                trans = 'N' or 'n'   A*x = b.   
    + *                trans = 'T' or 't'   A'*x = b.
    + *                trans = 'C' or 'c'   A'*x = b.   
    + *
    + *   diag   - (input) char*
    + *             On entry, diag specifies whether or not A is unit   
    + *             triangular as follows:   
    + *                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    + *                diag = 'N' or 'n'   A is not assumed to be unit   
    + *                                    triangular.   
    + *	     
    + *   L       - (input) SuperMatrix*
    + *	       The factor L from the factorization Pr*A*Pc=L*U. Use
    + *             compressed row subscripts storage for supernodes,
    + *             i.e., L has types: Stype = SC, Dtype = SLU_D, Mtype = TRLU.
    + *
    + *   U       - (input) SuperMatrix*
    + *	        The factor U from the factorization Pr*A*Pc=L*U.
    + *	        U has types: Stype = NC, Dtype = SLU_D, Mtype = TRU.
    + *    
    + *   x       - (input/output) double*
    + *             Before entry, the incremented array X must contain the n   
    + *             element right-hand side vector b. On exit, X is overwritten 
    + *             with the solution vector x.
    + *
    + *   info    - (output) int*
    + *             If *info = -i, the i-th argument had an illegal value.
    + * 
    + */ +int +sp_dtrsv(char *uplo, char *trans, char *diag, SuperMatrix *L, + SuperMatrix *U, double *x, SuperLUStat_t *stat, int *info) +{ +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + SCformat *Lstore; + NCformat *Ustore; + double *Lval, *Uval; + int incx = 1, incy = 1; + double alpha = 1.0, beta = 1.0; + int nrow; + int fsupc, nsupr, nsupc, luptr, istart, irow; + int i, k, iptr, jcol; + double *work; + flops_t solve_ops; + + /* Test the input parameters */ + *info = 0; + if ( !lsame_(uplo,"L") && !lsame_(uplo, "U") ) *info = -1; + else if ( !lsame_(trans, "N") && !lsame_(trans, "T") && + !lsame_(trans, "C")) *info = -2; + else if ( !lsame_(diag, "U") && !lsame_(diag, "N") ) *info = -3; + else if ( L->nrow != L->ncol || L->nrow < 0 ) *info = -4; + else if ( U->nrow != U->ncol || U->nrow < 0 ) *info = -5; + if ( *info ) { + i = -(*info); + xerbla_("sp_dtrsv", &i); + return 0; + } + + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( !(work = doubleCalloc(L->nrow)) ) + ABORT("Malloc fails for work in sp_dtrsv()."); + + if ( lsame_(trans, "N") ) { /* Form x := inv(A)*x. */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L)*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + nrow = nsupr - nsupc; + + solve_ops += nsupc * (nsupc - 1); + solve_ops += 2 * nrow * nsupc; + + if ( nsupc == 1 ) { + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); ++iptr) { + irow = L_SUB(iptr); + ++luptr; + x[irow] -= x[fsupc] * Lval[luptr]; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + SGEMV(ftcs2, &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#else + dtrsv_("L", "N", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + dgemv_("N", &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#endif +#else + dlsolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc]); + + dmatvec ( nsupr, nsupr-nsupc, nsupc, &Lval[luptr+nsupc], + &x[fsupc], &work[0] ); +#endif + + iptr = istart + nsupc; + for (i = 0; i < nrow; ++i, ++iptr) { + irow = L_SUB(iptr); + x[irow] -= work[i]; /* Scatter */ + work[i] = 0.0; + + } + } + } /* for k ... */ + + } else { + /* Form x := inv(U)*x */ + + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += nsupc * (nsupc + 1); + + if ( nsupc == 1 ) { + x[fsupc] /= Lval[luptr]; + for (i = U_NZ_START(fsupc); i < U_NZ_START(fsupc+1); ++i) { + irow = U_SUB(i); + x[irow] -= x[fsupc] * Uval[i]; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV(ftcs3, ftcs2, ftcs2, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + dtrsv_("U", "N", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif +#else + dusolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc] ); +#endif + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); + i++) { + irow = U_SUB(i); + x[irow] -= x[jcol] * Uval[i]; + } + } + } + } /* for k ... */ + + } + } else { /* Form x := inv(A')*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L')*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 2 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + x[jcol] -= x[irow] * Lval[i]; + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + STRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + dtrsv_("L", "T", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := inv(U')*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + x[jcol] -= x[irow] * Uval[i]; + } + } + + solve_ops += nsupc * (nsupc + 1); + + if ( nsupc == 1 ) { + x[fsupc] /= Lval[luptr]; + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + dtrsv_("U", "T", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } + + stat->ops[SOLVE] += solve_ops; + SUPERLU_FREE(work); + return 0; +} + + + +/*! \brief Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   sp_dgemv()  performs one of the matrix-vector operations   
    + *      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    + *   where alpha and beta are scalars, x and y are vectors and A is a
    + *   sparse A->nrow by A->ncol matrix.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   TRANS  - (input) char*
    + *            On entry, TRANS specifies the operation to be performed as   
    + *            follows:   
    + *               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    + *               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    + *               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.   
    + *
    + *   ALPHA  - (input) double
    + *            On entry, ALPHA specifies the scalar alpha.   
    + *
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + *
    + *   X      - (input) double*, array of DIMENSION at least   
    + *            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    + *            Before entry, the incremented array X must contain the   
    + *            vector x.   
    + *
    + *   INCX   - (input) int
    + *            On entry, INCX specifies the increment for the elements of   
    + *            X. INCX must not be zero.   
    + *
    + *   BETA   - (input) double
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then Y need not be set on input.   
    + *
    + *   Y      - (output) double*,  array of DIMENSION at least   
    + *            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    + *            Before entry with BETA non-zero, the incremented array Y   
    + *            must contain the vector y. On exit, Y is overwritten by the 
    + *            updated vector y.
    + *	     
    + *   INCY   - (input) int
    + *            On entry, INCY specifies the increment for the elements of   
    + *            Y. INCY must not be zero.   
    + *
    + *   ==== Sparse Level 2 Blas routine.   
    + * 
    + */ + +int +sp_dgemv(char *trans, double alpha, SuperMatrix *A, double *x, + int incx, double beta, double *y, int incy) +{ + /* Local variables */ + NCformat *Astore; + double *Aval; + int info; + double temp; + int lenx, leny, i, j, irow; + int iy, jx, jy, kx, ky; + int notran; + + notran = lsame_(trans, "N"); + Astore = A->Store; + Aval = Astore->nzval; + + /* Test the input parameters */ + info = 0; + if ( !notran && !lsame_(trans, "T") && !lsame_(trans, "C")) info = 1; + else if ( A->nrow < 0 || A->ncol < 0 ) info = 3; + else if (incx == 0) info = 5; + else if (incy == 0) info = 8; + if (info != 0) { + xerbla_("sp_dgemv ", &info); + return 0; + } + + /* Quick return if possible. */ + if (A->nrow == 0 || A->ncol == 0 || (alpha == 0. && beta == 1.)) + return 0; + + /* Set LENX and LENY, the lengths of the vectors x and y, and set + up the start points in X and Y. */ + if (lsame_(trans, "N")) { + lenx = A->ncol; + leny = A->nrow; + } else { + lenx = A->nrow; + leny = A->ncol; + } + if (incx > 0) kx = 0; + else kx = - (lenx - 1) * incx; + if (incy > 0) ky = 0; + else ky = - (leny - 1) * incy; + + /* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + /* First form y := beta*y. */ + if (beta != 1.) { + if (incy == 1) { + if (beta == 0.) + for (i = 0; i < leny; ++i) y[i] = 0.; + else + for (i = 0; i < leny; ++i) y[i] = beta * y[i]; + } else { + iy = ky; + if (beta == 0.) + for (i = 0; i < leny; ++i) { + y[iy] = 0.; + iy += incy; + } + else + for (i = 0; i < leny; ++i) { + y[iy] = beta * y[iy]; + iy += incy; + } + } + } + + if (alpha == 0.) return 0; + + if ( notran ) { + /* Form y := alpha*A*x + y. */ + jx = kx; + if (incy == 1) { + for (j = 0; j < A->ncol; ++j) { + if (x[jx] != 0.) { + temp = alpha * x[jx]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + y[irow] += temp * Aval[i]; + } + } + jx += incx; + } + } else { + ABORT("Not implemented."); + } + } else { + /* Form y := alpha*A'*x + y. */ + jy = ky; + if (incx == 1) { + for (j = 0; j < A->ncol; ++j) { + temp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + temp += Aval[i] * x[irow]; + } + y[jy] += alpha * temp; + jy += incy; + } + } else { + ABORT("Not implemented."); + } + } + return 0; +} /* sp_dgemv */ + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas3.c b/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas3.c new file mode 100644 index 0000000..f0c7233 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dsp_blas3.c @@ -0,0 +1,127 @@ + +/*! @file dsp_blas3.c + * \brief Sparse BLAS3, using some dense BLAS3 operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +/* + * File name: sp_blas3.c + * Purpose: Sparse BLAS3, using some dense BLAS3 operations. + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + * 
    + *   sp_d performs one of the matrix-matrix operations   
    + * 
    + *      C := alpha*op( A )*op( B ) + beta*C,   
    + * 
    + *   where  op( X ) is one of 
    + * 
    + *      op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),
    + * 
    + *   alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    + *   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix. 
    + *   
    + * 
    + *   Parameters   
    + *   ==========   
    + * 
    + *   TRANSA - (input) char*
    + *            On entry, TRANSA specifies the form of op( A ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSA = 'N' or 'n',  op( A ) = A.   
    + *               TRANSA = 'T' or 't',  op( A ) = A'.   
    + *               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    + *            Unchanged on exit.   
    + * 
    + *   TRANSB - (input) char*
    + *            On entry, TRANSB specifies the form of op( B ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSB = 'N' or 'n',  op( B ) = B.   
    + *               TRANSB = 'T' or 't',  op( B ) = B'.   
    + *               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    + *            Unchanged on exit.   
    + * 
    + *   M      - (input) int   
    + *            On entry,  M  specifies  the number of rows of the matrix 
    + *	     op( A ) and of the matrix C.  M must be at least zero. 
    + *	     Unchanged on exit.   
    + * 
    + *   N      - (input) int
    + *            On entry,  N specifies the number of columns of the matrix 
    + *	     op( B ) and the number of columns of the matrix C. N must be 
    + *	     at least zero.
    + *	     Unchanged on exit.   
    + * 
    + *   K      - (input) int
    + *            On entry, K specifies the number of columns of the matrix 
    + *	     op( A ) and the number of rows of the matrix op( B ). K must 
    + *	     be at least  zero.   
    + *           Unchanged on exit.
    + *      
    + *   ALPHA  - (input) double
    + *            On entry, ALPHA specifies the scalar alpha.   
    + * 
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_D; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + * 
    + *   B      - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    + *            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    + *            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    + *            part of the array B must contain the matrix B, otherwise 
    + *            the leading n by k part of the array B must contain the 
    + *            matrix B.   
    + *            Unchanged on exit.   
    + * 
    + *   LDB    - (input) int
    + *            On entry, LDB specifies the first dimension of B as declared 
    + *            in the calling (sub) program. LDB must be at least max( 1, n ).  
    + *            Unchanged on exit.   
    + * 
    + *   BETA   - (input) double
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then C need not be set on input.   
    + *  
    + *   C      - DOUBLE PRECISION array of DIMENSION ( LDC, n ).   
    + *            Before entry, the leading m by n part of the array C must 
    + *            contain the matrix C,  except when beta is zero, in which 
    + *            case C need not be set on entry.   
    + *            On exit, the array C is overwritten by the m by n matrix 
    + *	     ( alpha*op( A )*B + beta*C ).   
    + *  
    + *   LDC    - (input) int
    + *            On entry, LDC specifies the first dimension of C as declared 
    + *            in the calling (sub)program. LDC must be at least max(1,m).   
    + *            Unchanged on exit.   
    + *  
    + *   ==== Sparse Level 3 Blas routine.   
    + * 
    + */ + +int +sp_dgemm(char *transa, char *transb, int m, int n, int k, + double alpha, SuperMatrix *A, double *b, int ldb, + double beta, double *c, int ldc) +{ + int incx = 1, incy = 1; + int j; + + for (j = 0; j < n; ++j) { + sp_dgemv(transa, alpha, A, &b[ldb*j], incx, beta, &c[ldc*j], incy); + } + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dutil.c b/thirdparty/superlu/SuperLU_4.1/SRC/dutil.c new file mode 100644 index 0000000..807ff2f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dutil.c @@ -0,0 +1,471 @@ + +/*! @file dutil.c + * \brief Matrix utility functions + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include "slu_ddefs.h" + +void +dCreate_CompCol_Matrix(SuperMatrix *A, int m, int n, int nnz, + double *nzval, int *rowind, int *colptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NCformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NCformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->rowind = rowind; + Astore->colptr = colptr; +} + +void +dCreate_CompRow_Matrix(SuperMatrix *A, int m, int n, int nnz, + double *nzval, int *colind, int *rowptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NRformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NRformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->colind = colind; + Astore->rowptr = rowptr; +} + +/*! \brief Copy matrix A into matrix B. */ +void +dCopy_CompCol_Matrix(SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore, *Bstore; + int ncol, nnz, i; + + B->Stype = A->Stype; + B->Dtype = A->Dtype; + B->Mtype = A->Mtype; + B->nrow = A->nrow;; + B->ncol = ncol = A->ncol; + Astore = (NCformat *) A->Store; + Bstore = (NCformat *) B->Store; + Bstore->nnz = nnz = Astore->nnz; + for (i = 0; i < nnz; ++i) + ((double *)Bstore->nzval)[i] = ((double *)Astore->nzval)[i]; + for (i = 0; i < nnz; ++i) Bstore->rowind[i] = Astore->rowind[i]; + for (i = 0; i <= ncol; ++i) Bstore->colptr[i] = Astore->colptr[i]; +} + + +void +dCreate_Dense_Matrix(SuperMatrix *X, int m, int n, double *x, int ldx, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + DNformat *Xstore; + + X->Stype = stype; + X->Dtype = dtype; + X->Mtype = mtype; + X->nrow = m; + X->ncol = n; + X->Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !(X->Store) ) ABORT("SUPERLU_MALLOC fails for X->Store"); + Xstore = (DNformat *) X->Store; + Xstore->lda = ldx; + Xstore->nzval = (double *) x; +} + +void +dCopy_Dense_Matrix(int M, int N, double *X, int ldx, + double *Y, int ldy) +{ +/*! \brief Copies a two-dimensional matrix X to another matrix Y. + */ + int i, j; + + for (j = 0; j < N; ++j) + for (i = 0; i < M; ++i) + Y[i + j*ldy] = X[i + j*ldx]; +} + +void +dCreate_SuperNode_Matrix(SuperMatrix *L, int m, int n, int nnz, + double *nzval, int *nzval_colptr, int *rowind, + int *rowind_colptr, int *col_to_sup, int *sup_to_col, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + SCformat *Lstore; + + L->Stype = stype; + L->Dtype = dtype; + L->Mtype = mtype; + L->nrow = m; + L->ncol = n; + L->Store = (void *) SUPERLU_MALLOC( sizeof(SCformat) ); + if ( !(L->Store) ) ABORT("SUPERLU_MALLOC fails for L->Store"); + Lstore = L->Store; + Lstore->nnz = nnz; + Lstore->nsuper = col_to_sup[n]; + Lstore->nzval = nzval; + Lstore->nzval_colptr = nzval_colptr; + Lstore->rowind = rowind; + Lstore->rowind_colptr = rowind_colptr; + Lstore->col_to_sup = col_to_sup; + Lstore->sup_to_col = sup_to_col; + +} + + +/*! \brief Convert a row compressed storage into a column compressed storage. + */ +void +dCompRow_to_CompCol(int m, int n, int nnz, + double *a, int *colind, int *rowptr, + double **at, int **rowind, int **colptr) +{ + register int i, j, col, relpos; + int *marker; + + /* Allocate storage for another copy of the matrix. */ + *at = (double *) doubleMalloc(nnz); + *rowind = (int *) intMalloc(nnz); + *colptr = (int *) intMalloc(n+1); + marker = (int *) intCalloc(n); + + /* Get counts of each column of A, and set up column pointers */ + for (i = 0; i < m; ++i) + for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; + (*colptr)[0] = 0; + for (j = 0; j < n; ++j) { + (*colptr)[j+1] = (*colptr)[j] + marker[j]; + marker[j] = (*colptr)[j]; + } + + /* Transfer the matrix into the compressed column storage. */ + for (i = 0; i < m; ++i) { + for (j = rowptr[i]; j < rowptr[i+1]; ++j) { + col = colind[j]; + relpos = marker[col]; + (*rowind)[relpos] = i; + (*at)[relpos] = a[j]; + ++marker[col]; + } + } + + SUPERLU_FREE(marker); +} + + +void +dPrint_CompCol_Matrix(char *what, SuperMatrix *A) +{ + NCformat *Astore; + register int i,n; + double *dp; + + printf("\nCompCol matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (NCformat *) A->Store; + dp = (double *) Astore->nzval; + printf("nrow %d, ncol %d, nnz %d\n", A->nrow,A->ncol,Astore->nnz); + printf("nzval: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%f ", dp[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%d ", Astore->rowind[i]); + printf("\ncolptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->colptr[i]); + printf("\n"); + fflush(stdout); +} + +void +dPrint_SuperNode_Matrix(char *what, SuperMatrix *A) +{ + SCformat *Astore; + register int i, j, k, c, d, n, nsup; + double *dp; + int *col_to_sup, *sup_to_col, *rowind, *rowind_colptr; + + printf("\nSuperNode matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (SCformat *) A->Store; + dp = (double *) Astore->nzval; + col_to_sup = Astore->col_to_sup; + sup_to_col = Astore->sup_to_col; + rowind_colptr = Astore->rowind_colptr; + rowind = Astore->rowind; + printf("nrow %d, ncol %d, nnz %d, nsuper %d\n", + A->nrow,A->ncol,Astore->nnz,Astore->nsuper); + printf("nzval:\n"); + for (k = 0; k <= Astore->nsuper; ++k) { + c = sup_to_col[k]; + nsup = sup_to_col[k+1] - c; + for (j = c; j < c + nsup; ++j) { + d = Astore->nzval_colptr[j]; + for (i = rowind_colptr[c]; i < rowind_colptr[c+1]; ++i) { + printf("%d\t%d\t%e\n", rowind[i], j, dp[d++]); + } + } + } +#if 0 + for (i = 0; i < Astore->nzval_colptr[n]; ++i) printf("%f ", dp[i]); +#endif + printf("\nnzval_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->nzval_colptr[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->rowind_colptr[n]; ++i) + printf("%d ", Astore->rowind[i]); + printf("\nrowind_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->rowind_colptr[i]); + printf("\ncol_to_sup: "); + for (i = 0; i < n; ++i) printf("%d ", col_to_sup[i]); + printf("\nsup_to_col: "); + for (i = 0; i <= Astore->nsuper+1; ++i) + printf("%d ", sup_to_col[i]); + printf("\n"); + fflush(stdout); +} + +void +dPrint_Dense_Matrix(char *what, SuperMatrix *A) +{ + DNformat *Astore = (DNformat *) A->Store; + register int i, j, lda = Astore->lda; + double *dp; + + printf("\nDense matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + dp = (double *) Astore->nzval; + printf("nrow %d, ncol %d, lda %d\n", A->nrow,A->ncol,lda); + printf("\nnzval: "); + for (j = 0; j < A->ncol; ++j) { + for (i = 0; i < A->nrow; ++i) printf("%f ", dp[i + j*lda]); + printf("\n"); + } + printf("\n"); + fflush(stdout); +} + +/*! \brief Diagnostic print of column "jcol" in the U/L factor. + */ +void +dprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu) +{ + int i, k, fsupc; + int *xsup, *supno; + int *xlsub, *lsub; + double *lusup; + int *xlusup; + double *ucol; + int *usub, *xusub; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + + printf("%s", msg); + printf("col %d: pivrow %d, supno %d, xprune %d\n", + jcol, pivrow, supno[jcol], xprune[jcol]); + + printf("\tU-col:\n"); + for (i = xusub[jcol]; i < xusub[jcol+1]; i++) + printf("\t%d%10.4f\n", usub[i], ucol[i]); + printf("\tL-col in rectangular snode:\n"); + fsupc = xsup[supno[jcol]]; /* first col of the snode */ + i = xlsub[fsupc]; + k = xlusup[jcol]; + while ( i < xlsub[fsupc+1] && k < xlusup[jcol+1] ) { + printf("\t%d\t%10.4f\n", lsub[i], lusup[k]); + i++; k++; + } + fflush(stdout); +} + + +/*! \brief Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod". + */ +void dcheck_tempv(int n, double *tempv) +{ + int i; + + for (i = 0; i < n; i++) { + if (tempv[i] != 0.0) + { + fprintf(stderr,"tempv[%d] = %f\n", i,tempv[i]); + ABORT("dcheck_tempv"); + } + } +} + + +void +dGenXtrue(int n, int nrhs, double *x, int ldx) +{ + int i, j; + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + x[i + j*ldx] = 1.0;/* + (double)(i+1.)/n;*/ + } +} + +/*! \brief Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's + */ +void +dFillRHS(trans_t trans, int nrhs, double *x, int ldx, + SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore; + double *Aval; + DNformat *Bstore; + double *rhs; + double one = 1.0; + double zero = 0.0; + int ldc; + char transc[1]; + + Astore = A->Store; + Aval = (double *) Astore->nzval; + Bstore = B->Store; + rhs = Bstore->nzval; + ldc = Bstore->lda; + + if ( trans == NOTRANS ) *(unsigned char *)transc = 'N'; + else *(unsigned char *)transc = 'T'; + + sp_dgemm(transc, "N", A->nrow, nrhs, A->ncol, one, A, + x, ldx, zero, rhs, ldc); + +} + +/*! \brief Fills a double precision array with a given value. + */ +void +dfill(double *a, int alen, double dval) +{ + register int i; + for (i = 0; i < alen; i++) a[i] = dval; +} + + + +/*! \brief Check the inf-norm of the error vector + */ +void dinf_norm_error(int nrhs, SuperMatrix *X, double *xtrue) +{ + DNformat *Xstore; + double err, xnorm; + double *Xmat, *soln_work; + int i, j; + + Xstore = X->Store; + Xmat = Xstore->nzval; + + for (j = 0; j < nrhs; j++) { + soln_work = &Xmat[j*Xstore->lda]; + err = xnorm = 0.0; + for (i = 0; i < X->nrow; i++) { + err = SUPERLU_MAX(err, fabs(soln_work[i] - xtrue[i])); + xnorm = SUPERLU_MAX(xnorm, fabs(soln_work[i])); + } + err = err / xnorm; + printf("||X - Xtrue||/||X|| = %e\n", err); + } +} + + + +/*! \brief Print performance of the code. */ +void +dPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, + double rpg, double rcond, double *ferr, + double *berr, char *equed, SuperLUStat_t *stat) +{ + SCformat *Lstore; + NCformat *Ustore; + double *utime; + flops_t *ops; + + utime = stat->utime; + ops = stat->ops; + + if ( utime[FACT] != 0. ) + printf("Factor flops = %e\tMflops = %8.2f\n", ops[FACT], + ops[FACT]*1e-6/utime[FACT]); + printf("Identify relaxed snodes = %8.2f\n", utime[RELAX]); + if ( utime[SOLVE] != 0. ) + printf("Solve flops = %.0f, Mflops = %8.2f\n", ops[SOLVE], + ops[SOLVE]*1e-6/utime[SOLVE]); + + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("\tNo of nonzeros in factor L = %d\n", Lstore->nnz); + printf("\tNo of nonzeros in factor U = %d\n", Ustore->nnz); + printf("\tNo of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage->for_lu/1e6, mem_usage->total_needed/1e6); + printf("Number of memory expansions: %d\n", stat->expansions); + + printf("\tFactor\tMflops\tSolve\tMflops\tEtree\tEquil\tRcond\tRefine\n"); + printf("PERF:%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f\n", + utime[FACT], ops[FACT]*1e-6/utime[FACT], + utime[SOLVE], ops[SOLVE]*1e-6/utime[SOLVE], + utime[ETREE], utime[EQUIL], utime[RCOND], utime[REFINE]); + + printf("\tRpg\t\tRcond\t\tFerr\t\tBerr\t\tEquil?\n"); + printf("NUM:\t%e\t%e\t%e\t%e\t%s\n", + rpg, rcond, ferr[0], berr[0], equed); + +} + + + + +print_double_vec(char *what, int n, double *vec) +{ + int i; + printf("%s: n %d\n", what, n); + for (i = 0; i < n; ++i) printf("%d\t%f\n", i, vec[i]); + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/dzsum1.c b/thirdparty/superlu/SuperLU_4.1/SRC/dzsum1.c new file mode 100644 index 0000000..ffaac7a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/dzsum1.c @@ -0,0 +1,94 @@ +/*! @file dzsum1.c + * \brief Takes sum of the absolute values of a complex vector and returns a double precision result + * + *
    + *     -- LAPACK auxiliary routine (version 2.0) --   
    + *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *     Courant Institute, Argonne National Lab, and Rice University   
    + *     October 31, 1992   
    + * 
    + */ + +#include "slu_dcomplex.h" +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    DZSUM1 takes the sum of the absolute values of a complex   
    +    vector and returns a double precision result.   
    +
    +    Based on DZASUM from the Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.   
    +
    +    Contributed by Nick Higham for use with ZLACON.   
    +
    +    Arguments   
    +    =========   
    +
    +    N       (input) INT   
    +            The number of elements in the vector CX.   
    +
    +    CX      (input) COMPLEX*16 array, dimension (N)   
    +            The vector whose elements will be summed.   
    +
    +    INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX > 0.   
    +
    +    ===================================================================== 
    +
    +*/ +double dzsum1_(int *n, doublecomplex *cx, int *incx) +{ + + /* Builtin functions */ + double z_abs(doublecomplex *); + + /* Local variables */ + int i, nincx; + double stemp; + + +#define CX(I) cx[(I)-1] + + stemp = 0.; + if (*n <= 0) { + return stemp; + } + if (*incx == 1) { + goto L20; + } + + /* CODE FOR INCREMENT NOT EQUAL TO 1 */ + + nincx = *n * *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + + /* NEXT LINE MODIFIED. */ + + stemp += z_abs(&CX(i)); +/* L10: */ + } + + return stemp; + + /* CODE FOR INCREMENT EQUAL TO 1 */ + +L20: + for (i = 1; i <= *n; ++i) { + + /* NEXT LINE MODIFIED. */ + + stemp += z_abs(&CX(i)); +/* L30: */ + } + + return stemp; + + /* End of DZSUM1 */ + +} /* dzsum1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/get_perm_c.c b/thirdparty/superlu/SuperLU_4.1/SRC/get_perm_c.c new file mode 100644 index 0000000..f99908e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/get_perm_c.c @@ -0,0 +1,457 @@ +/*! @file get_perm_c.c + * \brief Matrix permutation operations + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + * 
    + */ +#include "slu_ddefs.h" +#include "colamd.h" + +extern int genmmd_(int *, int *, int *, int *, int *, int *, int *, + int *, int *, int *, int *, int *); + +void +get_colamd( + const int m, /* number of rows in matrix A. */ + const int n, /* number of columns in matrix A. */ + const int nnz,/* number of nonzeros in matrix A. */ + int *colptr, /* column pointer of size n+1 for matrix A. */ + int *rowind, /* row indices of size nz for matrix A. */ + int *perm_c /* out - the column permutation vector. */ + ) +{ + int Alen, *A, i, info, *p; + double knobs[COLAMD_KNOBS]; + int stats[COLAMD_STATS]; + + Alen = colamd_recommended(nnz, m, n); + + colamd_set_defaults(knobs); + + if (!(A = (int *) SUPERLU_MALLOC(Alen * sizeof(int))) ) + ABORT("Malloc fails for A[]"); + if (!(p = (int *) SUPERLU_MALLOC((n+1) * sizeof(int))) ) + ABORT("Malloc fails for p[]"); + for (i = 0; i <= n; ++i) p[i] = colptr[i]; + for (i = 0; i < nnz; ++i) A[i] = rowind[i]; + info = colamd(m, n, Alen, A, p, knobs, stats); + if ( info == FALSE ) ABORT("COLAMD failed"); + + for (i = 0; i < n; ++i) perm_c[p[i]] = i; + + SUPERLU_FREE(A); + SUPERLU_FREE(p); +} +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Form the structure of A'*A. A is an m-by-n matrix in column oriented
    + * format represented by (colptr, rowind). The output A'*A is in column
    + * oriented format (symmetrically, also row oriented), represented by
    + * (ata_colptr, ata_rowind).
    + *
    + * This routine is modified from GETATA routine by Tim Davis.
    + * The complexity of this algorithm is: SUM_{i=1,m} r(i)^2,
    + * i.e., the sum of the square of the row counts.
    + *
    + * Questions
    + * =========
    + *     o  Do I need to withhold the *dense* rows?
    + *     o  How do I know the number of nonzeros in A'*A?
    + * 
    + */ +void +getata( + const int m, /* number of rows in matrix A. */ + const int n, /* number of columns in matrix A. */ + const int nz, /* number of nonzeros in matrix A */ + int *colptr, /* column pointer of size n+1 for matrix A. */ + int *rowind, /* row indices of size nz for matrix A. */ + int *atanz, /* out - on exit, returns the actual number of + nonzeros in matrix A'*A. */ + int **ata_colptr, /* out - size n+1 */ + int **ata_rowind /* out - size *atanz */ + ) +{ + register int i, j, k, col, num_nz, ti, trow; + int *marker, *b_colptr, *b_rowind; + int *t_colptr, *t_rowind; /* a column oriented form of T = A' */ + + if ( !(marker = (int*) SUPERLU_MALLOC((SUPERLU_MAX(m,n)+1)*sizeof(int))) ) + ABORT("SUPERLU_MALLOC fails for marker[]"); + if ( !(t_colptr = (int*) SUPERLU_MALLOC((m+1) * sizeof(int))) ) + ABORT("SUPERLU_MALLOC t_colptr[]"); + if ( !(t_rowind = (int*) SUPERLU_MALLOC(nz * sizeof(int))) ) + ABORT("SUPERLU_MALLOC fails for t_rowind[]"); + + + /* Get counts of each column of T, and set up column pointers */ + for (i = 0; i < m; ++i) marker[i] = 0; + for (j = 0; j < n; ++j) { + for (i = colptr[j]; i < colptr[j+1]; ++i) + ++marker[rowind[i]]; + } + t_colptr[0] = 0; + for (i = 0; i < m; ++i) { + t_colptr[i+1] = t_colptr[i] + marker[i]; + marker[i] = t_colptr[i]; + } + + /* Transpose the matrix from A to T */ + for (j = 0; j < n; ++j) + for (i = colptr[j]; i < colptr[j+1]; ++i) { + col = rowind[i]; + t_rowind[marker[col]] = j; + ++marker[col]; + } + + + /* ---------------------------------------------------------------- + compute B = T * A, where column j of B is: + + Struct (B_*j) = UNION ( Struct (T_*k) ) + A_kj != 0 + + do not include the diagonal entry + + ( Partition A as: A = (A_*1, ..., A_*n) + Then B = T * A = (T * A_*1, ..., T * A_*n), where + T * A_*j = (T_*1, ..., T_*m) * A_*j. ) + ---------------------------------------------------------------- */ + + /* Zero the diagonal flag */ + for (i = 0; i < n; ++i) marker[i] = -1; + + /* First pass determines number of nonzeros in B */ + num_nz = 0; + for (j = 0; j < n; ++j) { + /* Flag the diagonal so it's not included in the B matrix */ + marker[j] = j; + + for (i = colptr[j]; i < colptr[j+1]; ++i) { + /* A_kj is nonzero, add pattern of column T_*k to B_*j */ + k = rowind[i]; + for (ti = t_colptr[k]; ti < t_colptr[k+1]; ++ti) { + trow = t_rowind[ti]; + if ( marker[trow] != j ) { + marker[trow] = j; + num_nz++; + } + } + } + } + *atanz = num_nz; + + /* Allocate storage for A'*A */ + if ( !(*ata_colptr = (int*) SUPERLU_MALLOC( (n+1) * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for ata_colptr[]"); + if ( *atanz ) { + if ( !(*ata_rowind = (int*) SUPERLU_MALLOC( *atanz * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for ata_rowind[]"); + } + b_colptr = *ata_colptr; /* aliasing */ + b_rowind = *ata_rowind; + + /* Zero the diagonal flag */ + for (i = 0; i < n; ++i) marker[i] = -1; + + /* Compute each column of B, one at a time */ + num_nz = 0; + for (j = 0; j < n; ++j) { + b_colptr[j] = num_nz; + + /* Flag the diagonal so it's not included in the B matrix */ + marker[j] = j; + + for (i = colptr[j]; i < colptr[j+1]; ++i) { + /* A_kj is nonzero, add pattern of column T_*k to B_*j */ + k = rowind[i]; + for (ti = t_colptr[k]; ti < t_colptr[k+1]; ++ti) { + trow = t_rowind[ti]; + if ( marker[trow] != j ) { + marker[trow] = j; + b_rowind[num_nz++] = trow; + } + } + } + } + b_colptr[n] = num_nz; + + SUPERLU_FREE(marker); + SUPERLU_FREE(t_colptr); + SUPERLU_FREE(t_rowind); +} + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Form the structure of A'+A. A is an n-by-n matrix in column oriented
    + * format represented by (colptr, rowind). The output A'+A is in column
    + * oriented format (symmetrically, also row oriented), represented by
    + * (b_colptr, b_rowind).
    + * 
    + */ +void +at_plus_a( + const int n, /* number of columns in matrix A. */ + const int nz, /* number of nonzeros in matrix A */ + int *colptr, /* column pointer of size n+1 for matrix A. */ + int *rowind, /* row indices of size nz for matrix A. */ + int *bnz, /* out - on exit, returns the actual number of + nonzeros in matrix A'*A. */ + int **b_colptr, /* out - size n+1 */ + int **b_rowind /* out - size *bnz */ + ) +{ + register int i, j, k, col, num_nz; + int *t_colptr, *t_rowind; /* a column oriented form of T = A' */ + int *marker; + + if ( !(marker = (int*) SUPERLU_MALLOC( n * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for marker[]"); + if ( !(t_colptr = (int*) SUPERLU_MALLOC( (n+1) * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for t_colptr[]"); + if ( !(t_rowind = (int*) SUPERLU_MALLOC( nz * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails t_rowind[]"); + + + /* Get counts of each column of T, and set up column pointers */ + for (i = 0; i < n; ++i) marker[i] = 0; + for (j = 0; j < n; ++j) { + for (i = colptr[j]; i < colptr[j+1]; ++i) + ++marker[rowind[i]]; + } + t_colptr[0] = 0; + for (i = 0; i < n; ++i) { + t_colptr[i+1] = t_colptr[i] + marker[i]; + marker[i] = t_colptr[i]; + } + + /* Transpose the matrix from A to T */ + for (j = 0; j < n; ++j) + for (i = colptr[j]; i < colptr[j+1]; ++i) { + col = rowind[i]; + t_rowind[marker[col]] = j; + ++marker[col]; + } + + + /* ---------------------------------------------------------------- + compute B = A + T, where column j of B is: + + Struct (B_*j) = Struct (A_*k) UNION Struct (T_*k) + + do not include the diagonal entry + ---------------------------------------------------------------- */ + + /* Zero the diagonal flag */ + for (i = 0; i < n; ++i) marker[i] = -1; + + /* First pass determines number of nonzeros in B */ + num_nz = 0; + for (j = 0; j < n; ++j) { + /* Flag the diagonal so it's not included in the B matrix */ + marker[j] = j; + + /* Add pattern of column A_*k to B_*j */ + for (i = colptr[j]; i < colptr[j+1]; ++i) { + k = rowind[i]; + if ( marker[k] != j ) { + marker[k] = j; + ++num_nz; + } + } + + /* Add pattern of column T_*k to B_*j */ + for (i = t_colptr[j]; i < t_colptr[j+1]; ++i) { + k = t_rowind[i]; + if ( marker[k] != j ) { + marker[k] = j; + ++num_nz; + } + } + } + *bnz = num_nz; + + /* Allocate storage for A+A' */ + if ( !(*b_colptr = (int*) SUPERLU_MALLOC( (n+1) * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for b_colptr[]"); + if ( *bnz) { + if ( !(*b_rowind = (int*) SUPERLU_MALLOC( *bnz * sizeof(int)) ) ) + ABORT("SUPERLU_MALLOC fails for b_rowind[]"); + } + + /* Zero the diagonal flag */ + for (i = 0; i < n; ++i) marker[i] = -1; + + /* Compute each column of B, one at a time */ + num_nz = 0; + for (j = 0; j < n; ++j) { + (*b_colptr)[j] = num_nz; + + /* Flag the diagonal so it's not included in the B matrix */ + marker[j] = j; + + /* Add pattern of column A_*k to B_*j */ + for (i = colptr[j]; i < colptr[j+1]; ++i) { + k = rowind[i]; + if ( marker[k] != j ) { + marker[k] = j; + (*b_rowind)[num_nz++] = k; + } + } + + /* Add pattern of column T_*k to B_*j */ + for (i = t_colptr[j]; i < t_colptr[j+1]; ++i) { + k = t_rowind[i]; + if ( marker[k] != j ) { + marker[k] = j; + (*b_rowind)[num_nz++] = k; + } + } + } + (*b_colptr)[n] = num_nz; + + SUPERLU_FREE(marker); + SUPERLU_FREE(t_colptr); + SUPERLU_FREE(t_rowind); +} + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * GET_PERM_C obtains a permutation matrix Pc, by applying the multiple
    + * minimum degree ordering code by Joseph Liu to matrix A'*A or A+A'.
    + * or using approximate minimum degree column ordering by Davis et. al.
    + * The LU factorization of A*Pc tends to have less fill than the LU 
    + * factorization of A.
    + *
    + * Arguments
    + * =========
    + *
    + * ispec   (input) int
    + *         Specifies the type of column ordering to reduce fill:
    + *         = 1: minimum degree on the structure of A^T * A
    + *         = 2: minimum degree on the structure of A^T + A
    + *         = 3: approximate minimum degree for unsymmetric matrices
    + *         If ispec == 0, the natural ordering (i.e., Pc = I) is returned.
    + * 
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A 
    + *         can be: Stype = NC; Dtype = _D; Mtype = GE. In the future,
    + *         more general A can be handled.
    + *
    + * perm_c  (output) int*
    + *	   Column permutation vector of size A->ncol, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + * 
    + */ +void +get_perm_c(int ispec, SuperMatrix *A, int *perm_c) +{ + NCformat *Astore = A->Store; + int m, n, bnz = 0, *b_colptr, i; + int delta, maxint, nofsub, *invp; + int *b_rowind, *dhead, *qsize, *llist, *marker; + double t, SuperLU_timer_(); + + m = A->nrow; + n = A->ncol; + + t = SuperLU_timer_(); + switch ( ispec ) { + case (NATURAL): /* Natural ordering */ + for (i = 0; i < n; ++i) perm_c[i] = i; +#if ( PRNTlevel>=1 ) + printf("Use natural column ordering.\n"); +#endif + return; + case (MMD_ATA): /* Minimum degree ordering on A'*A */ + getata(m, n, Astore->nnz, Astore->colptr, Astore->rowind, + &bnz, &b_colptr, &b_rowind); +#if ( PRNTlevel>=1 ) + printf("Use minimum degree ordering on A'*A.\n"); +#endif + t = SuperLU_timer_() - t; + /*printf("Form A'*A time = %8.3f\n", t);*/ + break; + case (MMD_AT_PLUS_A): /* Minimum degree ordering on A'+A */ + if ( m != n ) ABORT("Matrix is not square"); + at_plus_a(n, Astore->nnz, Astore->colptr, Astore->rowind, + &bnz, &b_colptr, &b_rowind); +#if ( PRNTlevel>=1 ) + printf("Use minimum degree ordering on A'+A.\n"); +#endif + t = SuperLU_timer_() - t; + /*printf("Form A'+A time = %8.3f\n", t);*/ + break; + case (COLAMD): /* Approximate minimum degree column ordering. */ + get_colamd(m, n, Astore->nnz, Astore->colptr, Astore->rowind, perm_c); +#if ( PRNTlevel>=1 ) + printf(".. Use approximate minimum degree column ordering.\n"); +#endif + return; + default: + ABORT("Invalid ISPEC"); + } + + if ( bnz != 0 ) { + t = SuperLU_timer_(); + + /* Initialize and allocate storage for GENMMD. */ + delta = 0; /* DELTA is a parameter to allow the choice of nodes + whose degree <= min-degree + DELTA. */ + maxint = 2147483647; /* 2**31 - 1 */ + invp = (int *) SUPERLU_MALLOC((n+delta)*sizeof(int)); + if ( !invp ) ABORT("SUPERLU_MALLOC fails for invp."); + dhead = (int *) SUPERLU_MALLOC((n+delta)*sizeof(int)); + if ( !dhead ) ABORT("SUPERLU_MALLOC fails for dhead."); + qsize = (int *) SUPERLU_MALLOC((n+delta)*sizeof(int)); + if ( !qsize ) ABORT("SUPERLU_MALLOC fails for qsize."); + llist = (int *) SUPERLU_MALLOC(n*sizeof(int)); + if ( !llist ) ABORT("SUPERLU_MALLOC fails for llist."); + marker = (int *) SUPERLU_MALLOC(n*sizeof(int)); + if ( !marker ) ABORT("SUPERLU_MALLOC fails for marker."); + + /* Transform adjacency list into 1-based indexing required by GENMMD.*/ + for (i = 0; i <= n; ++i) ++b_colptr[i]; + for (i = 0; i < bnz; ++i) ++b_rowind[i]; + + genmmd_(&n, b_colptr, b_rowind, perm_c, invp, &delta, dhead, + qsize, llist, marker, &maxint, &nofsub); + + /* Transform perm_c into 0-based indexing. */ + for (i = 0; i < n; ++i) --perm_c[i]; + + SUPERLU_FREE(invp); + SUPERLU_FREE(dhead); + SUPERLU_FREE(qsize); + SUPERLU_FREE(llist); + SUPERLU_FREE(marker); + SUPERLU_FREE(b_rowind); + + t = SuperLU_timer_() - t; + /* printf("call GENMMD time = %8.3f\n", t);*/ + + } else { /* Empty adjacency structure */ + for (i = 0; i < n; ++i) perm_c[i] = i; + } + + SUPERLU_FREE(b_colptr); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/heap_relax_snode.c b/thirdparty/superlu/SuperLU_4.1/SRC/heap_relax_snode.c new file mode 100644 index 0000000..1dafd82 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/heap_relax_snode.c @@ -0,0 +1,124 @@ +/*! @file heap_relax_snode.c + * \brief Identify the initial relaxed supernodes + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    + *    the matrix has been reordered according to the postorder of the etree.
    + * 
    + */ + +void +heap_relax_snode ( + const int n, + int *et, /* column elimination tree */ + const int relax_columns, /* max no of columns allowed in a + relaxed snode */ + int *descendants, /* no of descendants of each node + in the etree */ + int *relax_end /* last column in a supernode */ + ) +{ + register int i, j, k, l, parent; + register int snode_start; /* beginning of a snode */ + int *et_save, *post, *inv_post, *iwork; + int nsuper_et = 0, nsuper_et_post = 0; + + /* The etree may not be postordered, but is heap ordered. */ + + iwork = (int*) intMalloc(3*n+2); + if ( !iwork ) ABORT("SUPERLU_MALLOC fails for iwork[]"); + inv_post = iwork + n+1; + et_save = inv_post + n+1; + + /* Post order etree */ + post = (int *) TreePostorder(n, et); + for (i = 0; i < n+1; ++i) inv_post[post[i]] = i; + + /* Renumber etree in postorder */ + for (i = 0; i < n; ++i) { + iwork[post[i]] = post[et[i]]; + et_save[i] = et[i]; /* Save the original etree */ + } + for (i = 0; i < n; ++i) et[i] = iwork[i]; + + /* Compute the number of descendants of each node in the etree */ + ifill (relax_end, n, EMPTY); + for (j = 0; j < n; j++) descendants[j] = 0; + for (j = 0; j < n; j++) { + parent = et[j]; + if ( parent != n ) /* not the dummy root */ + descendants[parent] += descendants[j] + 1; + } + + /* Identify the relaxed supernodes by postorder traversal of the etree. */ + for (j = 0; j < n; ) { + parent = et[j]; + snode_start = j; + while ( parent != n && descendants[parent] < relax_columns ) { + j = parent; + parent = et[j]; + } + /* Found a supernode in postordered etree; j is the last column. */ + ++nsuper_et_post; + k = n; + for (i = snode_start; i <= j; ++i) + k = SUPERLU_MIN(k, inv_post[i]); + l = inv_post[j]; + if ( (l - k) == (j - snode_start) ) { + /* It's also a supernode in the original etree */ + relax_end[k] = l; /* Last column is recorded */ + ++nsuper_et; + } else { + for (i = snode_start; i <= j; ++i) { + l = inv_post[i]; + if ( descendants[i] == 0 ) { + relax_end[l] = l; + ++nsuper_et; + } + } + } + j++; + /* Search for a new leaf */ + while ( descendants[j] != 0 && j < n ) j++; + } + +#if ( PRNTlevel>=1 ) + printf(".. heap_snode_relax:\n" + "\tNo of relaxed snodes in postordered etree:\t%d\n" + "\tNo of relaxed snodes in original etree:\t%d\n", + nsuper_et_post, nsuper_et); +#endif + + /* Recover the original etree */ + for (i = 0; i < n; ++i) et[i] = et_save[i]; + + SUPERLU_FREE(post); + SUPERLU_FREE(iwork); +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/html_mainpage.h b/thirdparty/superlu/SuperLU_4.1/SRC/html_mainpage.h new file mode 100644 index 0000000..0b789fb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/html_mainpage.h @@ -0,0 +1,21 @@ +/*! \mainpage SuperLU Documentation + +SuperLU is a general purpose library for the direct solution of large, +sparse, nonsymmetric systems of linear equations on high performance +machines. The library is written in C and is callable from either C or +Fortran. The library routines perform an LU decomposition with +partial pivoting and triangular system solves through forward and back +substitution. The library also provides threshold-based ILU factorization +preconditioners. + +The factorization routines can handle non-square +matrices but the triangular solves are performed only for square +matrices. The matrix columns may be preordered (before factorization) +either through library or user supplied routines. This preordering for +sparsity is completely separate from the factorization. Working +precision iterative refinement subroutines are provided for improved +backward stability. Routines are also provided to equilibrate the +system, estimate the condition number, calculate the relative backward +error, and estimate error bounds for the refined solutions. + + */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/icmax1.c b/thirdparty/superlu/SuperLU_4.1/SRC/icmax1.c new file mode 100644 index 0000000..419c728 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/icmax1.c @@ -0,0 +1,116 @@ +/*! @file icmax1.c + * \brief Finds the index of the element whose real part has maximum absolute value + * + *
    + *     -- LAPACK auxiliary routine (version 2.0) --   
    + *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *     Courant Institute, Argonne National Lab, and Rice University   
    + *     October 31, 1992   
    + * 
    + */ +#include +#include "slu_scomplex.h" +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    ICMAX1 finds the index of the element whose real part has maximum   
    +    absolute value.   
    +
    +    Based on ICAMAX from Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.   
    +
    +    Contributed by Nick Higham for use with CLACON.   
    +
    +    Arguments   
    +    =========   
    +
    +    N       (input) INT   
    +            The number of elements in the vector CX.   
    +
    +    CX      (input) COMPLEX array, dimension (N)   
    +            The vector whose elements will be summed.   
    +
    +    INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX >= 1.   
    +
    +   ===================================================================== 
    +  
    +*/ +int icmax1_(int *n, complex *cx, int *incx) +{ +/* + NEXT LINE IS THE ONLY MODIFICATION. + + + Parameter adjustments + Function Body */ + /* System generated locals */ + int ret_val, i__1, i__2; + float r__1; + /* Local variables */ + static float smax; + static int i, ix; + + +#define CX(I) cx[(I)-1] + + + ret_val = 0; + if (*n < 1) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L30; + } + +/* CODE FOR INCREMENT NOT EQUAL TO 1 */ + + ix = 1; + smax = (r__1 = CX(1).r, fabs(r__1)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = ix; + if ((r__1 = CX(ix).r, fabs(r__1)) <= smax) { + goto L10; + } + ret_val = i; + i__2 = ix; + smax = (r__1 = CX(ix).r, fabs(r__1)); +L10: + ix += *incx; +/* L20: */ + } + return ret_val; + +/* CODE FOR INCREMENT EQUAL TO 1 */ + +L30: + smax = (r__1 = CX(1).r, fabs(r__1)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = i; + if ((r__1 = CX(i).r, fabs(r__1)) <= smax) { + goto L40; + } + ret_val = i; + i__2 = i; + smax = (r__1 = CX(i).r, fabs(r__1)); +L40: + ; + } + return ret_val; + +/* End of ICMAX1 */ + +} /* icmax1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccolumn_dfs.c new file mode 100644 index 0000000..fc9f403 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccolumn_dfs.c @@ -0,0 +1,258 @@ + +/*! @file ilu_ccolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    +*/ + +#include "slu_cdefs.h" + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   ILU_CCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +ilu_ccolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the + dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(7); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonzero */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ((mem_error = cLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu))) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( (mem_error = cLUMemXpand(jcol,nextl, + LSUB,&nzlmax,Glu)) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; + + /* Always start a new supernode for a singular column */ + if ( nextl == jptr ) jsuper = EMPTY; + + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first columns of the supernode. + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1) ) { /* >= 2 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + xlsub[jcol] = ito; + for (ifrom = jptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c new file mode 100644 index 0000000..b6b0328 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c @@ -0,0 +1,211 @@ + +/*! @file ilu_ccopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory
    + * November, 2010
    + * 
    + */ + +#include "slu_cdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +extern void ccopy_(int *, complex [], int *, complex [], int *); + +#if 0 +static complex *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register float xx = c_abs1(&A[*x]), yy = c_abs1(&A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} +#endif + +int +ilu_ccopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + complex *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + complex *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + float *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + complex *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register float d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + complex zero = {0.0, 0.0}; + int i_1 = 1; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = cLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = cLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = c_abs1(&dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + c_add(sum, sum, &dense[irow]); + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + sum->r += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + i_1 = xusub[jcol]; + for (i = 0; i < m; ++i, ++i_1) work[i] = c_abs1(&ucol[i_1]); + tol = sqselect(m, work, quota); +#if 0 + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); +#endif + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (c_abs1(&ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + c_add(sum, sum, &ucol[i]); + break; + case SMILU_3: + sum->r += tmp; + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) { + sum->r = c_abs1(sum); sum->i = 0.0; + } + if (milu == SMILU_3) sum->i = 0.0; + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c.bak new file mode 100644 index 0000000..ba32096 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ccopy_to_ucol.c.bak @@ -0,0 +1,202 @@ + +/*! @file ilu_ccopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +static complex *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register float xx = c_abs1(&A[*x]), yy = c_abs1(&A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} + + +int +ilu_ccopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + complex *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + complex *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + int *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + complex *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register float d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + complex zero = {0.0, 0.0}; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = cLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = cLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = c_abs1(&dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + c_add(sum, sum, &dense[irow]); + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + sum->r += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (c_abs1(&ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + c_add(sum, sum, &ucol[i]); + break; + case SMILU_3: + sum->r += tmp; + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) { + sum->r = c_abs1(sum); sum->i = 0.0; + } + if (milu == SMILU_3) sum->i = 0.0; + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cdrop_row.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cdrop_row.c new file mode 100644 index 0000000..44173c8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cdrop_row.c @@ -0,0 +1,339 @@ + +/*! @file ilu_cdrop_row.c + * \brief Drop small rows from L + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include +#include +#include "slu_cdefs.h" + +extern void cswap_(int *, complex [], int *, complex [], int *); +extern void caxpy_(int *, complex *, complex [], int *, complex [], int *); +extern void ccopy_(int *, complex [], int *, complex [], int *); +extern float scasum_(int *, complex *, int *); +extern float scnrm2_(int *, complex *, int *); +extern double dnrm2_(int *, double [], int *); +extern int icamax_(int *, complex [], int *); + +static float *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + if (A[*x] - A[*y] > 0.0) return -1; + else if (A[*x] - A[*y] < 0.0) return 1; + else return 0; +} + +/*! \brief + *
    + * Purpose
    + * =======
    + *    ilu_cdrop_row() - Drop some small rows from the previous 
    + *    supernode (L-part only).
    + * 
    + */ +int ilu_cdrop_row( + superlu_options_t *options, /* options */ + int first, /* index of the first column in the supernode */ + int last, /* index of the last column in the supernode */ + double drop_tol, /* dropping parameter */ + int quota, /* maximum nonzero entries allowed */ + int *nnzLj, /* in/out number of nonzeros in L(:, 1:last) */ + double *fill_tol, /* in/out - on exit, fill_tol=-num_zero_pivots, + * does not change if options->ILU_MILU != SMILU1 */ + GlobalLU_t *Glu, /* modified */ + float swork[], /* working space + * the length of swork[] should be no less than + * the number of rows in the supernode */ + float swork2[], /* working space with the same size as swork[], + * used only by the second dropping rule */ + int lastc /* if lastc == 0, there is nothing after the + * working supernode [first:last]; + * if lastc == 1, there is one more column after + * the working supernode. */ ) +{ + register int i, j, k, m1; + register int nzlc; /* number of nonzeros in column last+1 */ + register int xlusup_first, xlsub_first; + int m, n; /* m x n is the size of the supernode */ + int r = 0; /* number of dropped rows */ + register float *temp; + register complex *lusup = Glu->lusup; + register int *lsub = Glu->lsub; + register int *xlsub = Glu->xlsub; + register int *xlusup = Glu->xlusup; + register float d_max = 0.0, d_min = 1.0; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + norm_t nrm = options->ILU_Norm; + complex zero = {0.0, 0.0}; + complex one = {1.0, 0.0}; + complex none = {-1.0, 0.0}; + int i_1 = 1; + int inc_diag; /* inc_diag = m + 1 */ + int nzp = 0; /* number of zero pivots */ + float alpha = pow((double)(Glu->n), -1.0 / options->ILU_MILU_Dim); + + xlusup_first = xlusup[first]; + xlsub_first = xlsub[first]; + m = xlusup[first + 1] - xlusup_first; + n = last - first + 1; + m1 = m - 1; + inc_diag = m + 1; + nzlc = lastc ? (xlusup[last + 2] - xlusup[last + 1]) : 0; + temp = swork - n; + + /* Quick return if nothing to do. */ + if (m == 0 || m == n || drop_rule == NODROP) + { + *nnzLj += m * n; + return 0; + } + + /* basic dropping: ILU(tau) */ + for (i = n; i <= m1; ) + { + /* the average abs value of ith row */ + switch (nrm) + { + case ONE_NORM: + temp[i] = scasum_(&n, &lusup[xlusup_first + i], &m) / (double)n; + break; + case TWO_NORM: + temp[i] = scnrm2_(&n, &lusup[xlusup_first + i], &m) + / sqrt((double)n); + break; + case INF_NORM: + default: + k = icamax_(&n, &lusup[xlusup_first + i], &m) - 1; + temp[i] = c_abs1(&lusup[xlusup_first + i + m * k]); + break; + } + + /* drop small entries due to drop_tol */ + if (drop_rule & DROP_BASIC && temp[i] < drop_tol) + { + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + caxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m].r += + c_abs1(&lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + ccopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + cswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m].r = + c_abs1(&lusup[xlusup_first + m1 + j * m]); + lusup[xlusup_first + m1 + j * m].i = 0.0; + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + continue; + } /* if dropping */ + else + { + if (temp[i] > d_max) d_max = temp[i]; + if (temp[i] < d_min) d_min = temp[i]; + } + i++; + } /* for */ + + /* Secondary dropping: drop more rows according to the quota. */ + quota = ceil((double)quota / (double)n); + if (drop_rule & DROP_SECONDARY && m - r > quota) + { + register double tol = d_max; + + /* Calculate the second dropping tolerance */ + if (quota > n) + { + if (drop_rule & DROP_INTERP) /* by interpolation */ + { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / (m - n - r)); + } + else /* by quick select */ + { + int len = m1 - n + 1; + scopy_(&len, swork, &i_1, swork2, &i_1); + tol = sqselect(len, swork2, quota - n); +#if 0 + register int *itemp = iwork - n; + A = temp; + for (i = n; i <= m1; i++) itemp[i] = i; + qsort(iwork, m1 - n + 1, sizeof(int), _compare_); + tol = temp[itemp[quota]]; +#endif + } + } + + for (i = n; i <= m1; ) + { + if (temp[i] <= tol) + { + register int j; + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + caxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m].r += + c_abs1(&lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + ccopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + cswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m].r = + c_abs1(&lusup[xlusup_first + m1 + j * m]); + lusup[xlusup_first + m1 + j * m].i = 0.0; + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + temp[i] = temp[m1]; + + continue; + } + i++; + + } /* for */ + + } /* if secondary dropping */ + + for (i = n; i < m; i++) temp[i] = 0.0; + + if (r == 0) + { + *nnzLj += m * n; + return 0; + } + + /* add dropped entries to the diagnal */ + if (milu != SILU) + { + register int j; + complex t; + float omega; + for (j = 0; j < n; j++) + { + t = lusup[xlusup_first + (m - 1) + j * m]; + if (t.r == 0.0 && t.i == 0.0) continue; + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) / c_abs1(&t), 1.0); + cs_mult(&t, &t, omega); + + switch (milu) + { + case SMILU_1: + if ( !(c_eq(&t, &none)) ) { + c_add(&t, &t, &one); + cc_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + &t); + } + else + { + cs_mult( + &lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + *fill_tol); +#ifdef DEBUG + printf("[1] ZERO PIVOT: FILL col %d.\n", first + j); + fflush(stdout); +#endif + nzp++; + } + break; + case SMILU_2: + cs_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + 1.0 + c_abs1(&t)); + break; + case SMILU_3: + c_add(&t, &t, &one); + cc_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + &t); + break; + case SILU: + default: + break; + } + } + if (nzp > 0) *fill_tol = -nzp; + } + + /* Remove dropped entries from the memory and fix the pointers. */ + m1 = m - r; + for (j = 1; j < n; j++) + { + register int tmp1, tmp2; + tmp1 = xlusup_first + j * m1; + tmp2 = xlusup_first + j * m; + for (i = 0; i < m1; i++) + lusup[i + tmp1] = lusup[i + tmp2]; + } + for (i = 0; i < nzlc; i++) + lusup[xlusup_first + i + n * m1] = lusup[xlusup_first + i + n * m]; + for (i = 0; i < nzlc; i++) + lsub[xlsub[last + 1] - r + i] = lsub[xlsub[last + 1] + i]; + for (i = first + 1; i <= last + 1; i++) + { + xlusup[i] -= r * (i - first); + xlsub[i] -= r; + } + if (lastc) + { + xlusup[last + 2] -= r * n; + xlsub[last + 2] -= r; + } + + *nnzLj += (m - r) * n; + return r; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpanel_dfs.c new file mode 100644 index 0000000..05a5bf5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpanel_dfs.c @@ -0,0 +1,248 @@ + +/*! @file ilu_cpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols and + * record the entries with maximum absolute value in each column + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel.
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ +void +ilu_cpanel_dfs( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + complex *dense, /* out */ + float *amax, /* out - max. abs. value of each column in panel */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ +) +{ + + NCPformat *Astore; + complex *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + complex *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + float *amax_col; + register double tmp; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + amax_col = amax; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + *amax_col = 0.0; + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + tmp = c_abs1(&a[k]); + if (tmp > *amax_col) *amax_col = tmp; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + amax_col++; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpivotL.c new file mode 100644 index 0000000..d806485 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_cpivotL.c @@ -0,0 +1,274 @@ + +/*! @file ilu_cpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + + +#include +#include +#include "slu_cdefs.h" + +#ifndef SGN +#define SGN(x) ((x)>=0?1:-1) +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *	     pivot row = k;
    + *	 ELSE IF abs(A_jj) >= thresh THEN
    + *	     pivot row = j;
    + *	 ELSE
    + *	     pivot row = m;
    + *
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0	  success;
    + *		   i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +ilu_cpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by + * perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int diagind, /* diagonal of Pc*A*Pc' */ + int *swap, /* in/out record the row permutation */ + int *iswap, /* in/out inverse of swap, it is the same as + perm_r after the factorization */ + int *marker, /* in */ + int *pivrow, /* in/out, as an input if *usepr!=0 */ + double fill_tol, /* in - fill tolerance of current column + * used for a singular column */ + milu_t milu, /* in */ + complex drop_sum, /* in - computed in ilu_ccopy_to_ucol() + (MILU only) */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int n; /* number of columns */ + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + register int pivptr; + int old_pivptr, diag, ptr0; + register float pivmax, rtemp; + float thresh; + complex temp; + complex *lu_sup_ptr; + complex *lu_col_ptr; + int *lsub_ptr; + register int isub, icol, k, itemp; + int *lsub, *xlsub; + complex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + int info; + complex one = {1.0, 0.0}; + + /* Initialize pointers */ + n = Glu->n; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + pivmax = -1.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + ptr0 = EMPTY; + for (isub = nsupc; isub < nsupr; ++isub) { + if (marker[lsub_ptr[isub]] > jcol) + continue; /* do not overlap with a later relaxed supernode */ + + switch (milu) { + case SMILU_1: + c_add(&temp, &lu_col_ptr[isub], &drop_sum); + rtemp = c_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + /* In this case, drop_sum contains the sum of the abs. value */ + rtemp = c_abs1(&lu_col_ptr[isub]); + break; + case SILU: + default: + rtemp = c_abs1(&lu_col_ptr[isub]); + break; + } + if (rtemp > pivmax) { pivmax = rtemp; pivptr = isub; } + if (*usepr && lsub_ptr[isub] == *pivrow) old_pivptr = isub; + if (lsub_ptr[isub] == diagind) diag = isub; + if (ptr0 == EMPTY) ptr0 = isub; + } + + if (milu == SMILU_2 || milu == SMILU_3) pivmax += drop_sum.r; + + /* Test for singularity */ + if (pivmax < 0.0) { + fprintf(stderr, "[0]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + if ( pivmax == 0.0 ) { + if (diag != EMPTY) + *pivrow = lsub_ptr[pivptr = diag]; + else if (ptr0 != EMPTY) + *pivrow = lsub_ptr[pivptr = ptr0]; + else { + /* look for the first row which does not + belong to any later supernodes */ + for (icol = jcol; icol < n; icol++) + if (marker[swap[icol]] <= jcol) break; + if (icol >= n) { + fprintf(stderr, "[1]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + + *pivrow = swap[icol]; + + /* pick up the pivot row */ + for (isub = nsupc; isub < nsupr; ++isub) + if ( lsub_ptr[isub] == *pivrow ) { pivptr = isub; break; } + } + pivmax = fill_tol; + lu_col_ptr[pivptr].r = pivmax; + lu_col_ptr[pivptr].i = 0.0; + *usepr = 0; +#ifdef DEBUG + printf("[0] ZERO PIVOT: FILL (%d, %d).\n", *pivrow, jcol); + fflush(stdout); +#endif + info =jcol + 1; + } /* if (*pivrow == 0.0) */ + else { + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + switch (milu) { + case SMILU_1: + c_add(&temp, &lu_col_ptr[old_pivptr], &drop_sum); + rtemp = c_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + rtemp = c_abs1(&lu_col_ptr[old_pivptr]) + drop_sum.r; + break; + case SILU: + default: + rtemp = c_abs1(&lu_col_ptr[old_pivptr]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = old_pivptr; + else *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + switch (milu) { + case SMILU_1: + c_add(&temp, &lu_col_ptr[diag], &drop_sum); + rtemp = c_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + rtemp = c_abs1(&lu_col_ptr[diag]) + drop_sum.r; + break; + case SILU: + default: + rtemp = c_abs1(&lu_col_ptr[diag]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + info = 0; + + /* Reset the diagonal */ + switch (milu) { + case SMILU_1: + c_add(&lu_col_ptr[pivptr], &lu_col_ptr[pivptr], &drop_sum); + break; + case SMILU_2: + case SMILU_3: + temp = c_sgn(&lu_col_ptr[pivptr]); + cc_mult(&temp, &temp, &drop_sum); + c_add(&lu_col_ptr[pivptr], &lu_col_ptr[pivptr], &drop_sum); + break; + case SILU: + default: + break; + } + + } /* else */ + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + if (jcol < n - 1) { + register int t1, t2, t; + t1 = iswap[*pivrow]; t2 = jcol; + if (t1 != t2) { + t = swap[t1]; swap[t1] = swap[t2]; swap[t2] = t; + t1 = swap[t1]; t2 = t; + t = iswap[t1]; iswap[t1] = iswap[t2]; iswap[t2] = t; + } + } /* if (jcol < n - 1) */ + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += 10 * (nsupr - nsupc); + c_div(&temp, &one, &lu_col_ptr[nsupc]); + for (k = nsupc+1; k < nsupr; k++) + cc_mult(&lu_col_ptr[k], &lu_col_ptr[k], &temp); + + return info; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_csnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_csnode_dfs.c new file mode 100644 index 0000000..161d154 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_csnode_dfs.c @@ -0,0 +1,90 @@ + +/*! @file ilu_csnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_cdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_csnode_dfs() - Determine the union of the row structures of those
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +ilu_csnode_dfs( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, nextl; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) + { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) + { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) + { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) + { + if ( (mem_error = cLUMemXpand(jcol, nextl, LSUB, &nzlmax, + Glu)) != 0) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1 */ + if ( jcol < kcol ) + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xlsub[kcol+1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcolumn_dfs.c new file mode 100644 index 0000000..a2e14db --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcolumn_dfs.c @@ -0,0 +1,258 @@ + +/*! @file ilu_dcolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    +*/ + +#include "slu_ddefs.h" + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   ILU_DCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +ilu_dcolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the + dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(7); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonzero */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ((mem_error = dLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu))) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( (mem_error = dLUMemXpand(jcol,nextl, + LSUB,&nzlmax,Glu)) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; + + /* Always start a new supernode for a singular column */ + if ( nextl == jptr ) jsuper = EMPTY; + + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first columns of the supernode. + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1) ) { /* >= 2 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + xlsub[jcol] = ito; + for (ifrom = jptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c new file mode 100644 index 0000000..e9162a7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c @@ -0,0 +1,207 @@ + +/*! @file ilu_dcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory
    + * November, 2010
    + * 
    + */ + +#include "slu_ddefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +extern void dcopy_(int *, double [], int *, double [], int *); + +#if 0 +static double *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = fabs(A[*x]), yy = fabs(A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} +#endif + +int +ilu_dcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + double *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + double *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + double *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + double *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register double d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + double zero = 0.0; + int i_1 = 1; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = dLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = dLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = fabs(dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += dense[irow]; + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + *sum += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + dcopy_(&m, &ucol[xusub[jcol]], &i_1, work, &i_1); + tol = dqselect(m, work, quota); +#if 0 + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); +#endif + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (fabs(ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += ucol[i]; + break; + case SMILU_3: + *sum += fabs(ucol[i]); + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) *sum = fabs(*sum); + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c.bak new file mode 100644 index 0000000..a27a148 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dcopy_to_ucol.c.bak @@ -0,0 +1,199 @@ + +/*! @file ilu_dcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +static double *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = fabs(A[*x]), yy = fabs(A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} + + +int +ilu_dcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + double *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + double *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + int *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + double *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register double d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + double zero = 0.0; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = dLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = dLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = fabs(dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += dense[irow]; + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + *sum += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (fabs(ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += ucol[i]; + break; + case SMILU_3: + *sum += fabs(ucol[i]); + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) *sum = fabs(*sum); + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c new file mode 100644 index 0000000..a08c85c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c @@ -0,0 +1,329 @@ + +/*! @file ilu_ddrop_row.c + * \brief Drop small rows from L + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include +#include +#include "slu_ddefs.h" + +extern void dswap_(int *, double [], int *, double [], int *); +extern void daxpy_(int *, double *, double [], int *, double [], int *); +extern void dcopy_(int *, double [], int *, double [], int *); +extern double dasum_(int *, double *, int *); +extern double dnrm2_(int *, double *, int *); +extern double dnrm2_(int *, double [], int *); +extern int idamax_(int *, double [], int *); + +static double *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + if (A[*x] - A[*y] > 0.0) return -1; + else if (A[*x] - A[*y] < 0.0) return 1; + else return 0; +} + +/*! \brief + *
    + * Purpose
    + * =======
    + *    ilu_ddrop_row() - Drop some small rows from the previous 
    + *    supernode (L-part only).
    + * 
    + */ +int ilu_ddrop_row( + superlu_options_t *options, /* options */ + int first, /* index of the first column in the supernode */ + int last, /* index of the last column in the supernode */ + double drop_tol, /* dropping parameter */ + int quota, /* maximum nonzero entries allowed */ + int *nnzLj, /* in/out number of nonzeros in L(:, 1:last) */ + double *fill_tol, /* in/out - on exit, fill_tol=-num_zero_pivots, + * does not change if options->ILU_MILU != SMILU1 */ + GlobalLU_t *Glu, /* modified */ + double dwork[], /* working space + * the length of dwork[] should be no less than + * the number of rows in the supernode */ + double dwork2[], /* working space with the same size as dwork[], + * used only by the second dropping rule */ + int lastc /* if lastc == 0, there is nothing after the + * working supernode [first:last]; + * if lastc == 1, there is one more column after + * the working supernode. */ ) +{ + register int i, j, k, m1; + register int nzlc; /* number of nonzeros in column last+1 */ + register int xlusup_first, xlsub_first; + int m, n; /* m x n is the size of the supernode */ + int r = 0; /* number of dropped rows */ + register double *temp; + register double *lusup = Glu->lusup; + register int *lsub = Glu->lsub; + register int *xlsub = Glu->xlsub; + register int *xlusup = Glu->xlusup; + register double d_max = 0.0, d_min = 1.0; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + norm_t nrm = options->ILU_Norm; + double zero = 0.0; + double one = 1.0; + double none = -1.0; + int i_1 = 1; + int inc_diag; /* inc_diag = m + 1 */ + int nzp = 0; /* number of zero pivots */ + double alpha = pow((double)(Glu->n), -1.0 / options->ILU_MILU_Dim); + + xlusup_first = xlusup[first]; + xlsub_first = xlsub[first]; + m = xlusup[first + 1] - xlusup_first; + n = last - first + 1; + m1 = m - 1; + inc_diag = m + 1; + nzlc = lastc ? (xlusup[last + 2] - xlusup[last + 1]) : 0; + temp = dwork - n; + + /* Quick return if nothing to do. */ + if (m == 0 || m == n || drop_rule == NODROP) + { + *nnzLj += m * n; + return 0; + } + + /* basic dropping: ILU(tau) */ + for (i = n; i <= m1; ) + { + /* the average abs value of ith row */ + switch (nrm) + { + case ONE_NORM: + temp[i] = dasum_(&n, &lusup[xlusup_first + i], &m) / (double)n; + break; + case TWO_NORM: + temp[i] = dnrm2_(&n, &lusup[xlusup_first + i], &m) + / sqrt((double)n); + break; + case INF_NORM: + default: + k = idamax_(&n, &lusup[xlusup_first + i], &m) - 1; + temp[i] = fabs(lusup[xlusup_first + i + m * k]); + break; + } + + /* drop small entries due to drop_tol */ + if (drop_rule & DROP_BASIC && temp[i] < drop_tol) + { + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + daxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + dcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + dswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + continue; + } /* if dropping */ + else + { + if (temp[i] > d_max) d_max = temp[i]; + if (temp[i] < d_min) d_min = temp[i]; + } + i++; + } /* for */ + + /* Secondary dropping: drop more rows according to the quota. */ + quota = ceil((double)quota / (double)n); + if (drop_rule & DROP_SECONDARY && m - r > quota) + { + register double tol = d_max; + + /* Calculate the second dropping tolerance */ + if (quota > n) + { + if (drop_rule & DROP_INTERP) /* by interpolation */ + { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / (m - n - r)); + } + else /* by quick select */ + { + int len = m1 - n + 1; + dcopy_(&len, dwork, &i_1, dwork2, &i_1); + tol = dqselect(len, dwork2, quota - n); +#if 0 + register int *itemp = iwork - n; + A = temp; + for (i = n; i <= m1; i++) itemp[i] = i; + qsort(iwork, m1 - n + 1, sizeof(int), _compare_); + tol = temp[itemp[quota]]; +#endif + } + } + + for (i = n; i <= m1; ) + { + if (temp[i] <= tol) + { + register int j; + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + daxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + dcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + dswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + temp[i] = temp[m1]; + + continue; + } + i++; + + } /* for */ + + } /* if secondary dropping */ + + for (i = n; i < m; i++) temp[i] = 0.0; + + if (r == 0) + { + *nnzLj += m * n; + return 0; + } + + /* add dropped entries to the diagnal */ + if (milu != SILU) + { + register int j; + double t; + double omega; + for (j = 0; j < n; j++) + { + t = lusup[xlusup_first + (m - 1) + j * m]; + if (t == zero) continue; + if (t > zero) + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) / t, 1.0); + else + omega = SUPERLU_MAX(2.0 * (1.0 - alpha) / t, -1.0); + t *= omega; + + switch (milu) + { + case SMILU_1: + if (t != none) { + lusup[xlusup_first + j * inc_diag] *= (one + t); + } + else + { + lusup[xlusup_first + j * inc_diag] *= *fill_tol; +#ifdef DEBUG + printf("[1] ZERO PIVOT: FILL col %d.\n", first + j); + fflush(stdout); +#endif + nzp++; + } + break; + case SMILU_2: + lusup[xlusup_first + j * inc_diag] *= (1.0 + fabs(t)); + break; + case SMILU_3: + lusup[xlusup_first + j * inc_diag] *= (one + t); + break; + case SILU: + default: + break; + } + } + if (nzp > 0) *fill_tol = -nzp; + } + + /* Remove dropped entries from the memory and fix the pointers. */ + m1 = m - r; + for (j = 1; j < n; j++) + { + register int tmp1, tmp2; + tmp1 = xlusup_first + j * m1; + tmp2 = xlusup_first + j * m; + for (i = 0; i < m1; i++) + lusup[i + tmp1] = lusup[i + tmp2]; + } + for (i = 0; i < nzlc; i++) + lusup[xlusup_first + i + n * m1] = lusup[xlusup_first + i + n * m]; + for (i = 0; i < nzlc; i++) + lsub[xlsub[last + 1] - r + i] = lsub[xlsub[last + 1] + i]; + for (i = first + 1; i <= last + 1; i++) + { + xlusup[i] -= r * (i - first); + xlsub[i] -= r; + } + if (lastc) + { + xlusup[last + 2] -= r * n; + xlsub[last + 2] -= r; + } + + *nnzLj += (m - r) * n; + return r; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c.bak new file mode 100644 index 0000000..caffa13 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ddrop_row.c.bak @@ -0,0 +1,311 @@ + +/*! @file ilu_ddrop_row.c + * \brief Drop small rows from L + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * <\pre>
    + */
    +
    +#include 
    +#include 
    +#include "slu_ddefs.h"
    +
    +extern void dswap_(int *, double [], int *, double [], int *);
    +extern void daxpy_(int *, double *, double [], int *, double [], int *);
    +
    +static double *A;  /* used in _compare_ only */
    +static int _compare_(const void *a, const void *b)
    +{
    +    register int *x = (int *)a, *y = (int *)b;
    +    if (A[*x] - A[*y] > 0.0) return -1;
    +    else if (A[*x] - A[*y] < 0.0) return 1;
    +    else return 0;
    +}
    +
    +/*! \brief
    + * 
    + * Purpose
    + * =======
    + *    ilu_ddrop_row() - Drop some small rows from the previous 
    + *    supernode (L-part only).
    + * 
    + */ +int ilu_ddrop_row( + superlu_options_t *options, /* options */ + int first, /* index of the first column in the supernode */ + int last, /* index of the last column in the supernode */ + double drop_tol, /* dropping parameter */ + int quota, /* maximum nonzero entries allowed */ + int *nnzLj, /* in/out number of nonzeros in L(:, 1:last) */ + double *fill_tol, /* in/out - on exit, fill_tol=-num_zero_pivots, + * does not change if options->ILU_MILU != SMILU1 */ + GlobalLU_t *Glu, /* modified */ + double dwork[], /* working space with minimum size last-first+1 */ + int iwork[], /* working space with minimum size m - n, + * used by the second dropping rule */ + int lastc /* if lastc == 0, there is nothing after the + * working supernode [first:last]; + * if lastc == 1, there is one more column after + * the working supernode. */ ) +{ + register int i, j, k, m1; + register int nzlc; /* number of nonzeros in column last+1 */ + register int xlusup_first, xlsub_first; + int m, n; /* m x n is the size of the supernode */ + int r = 0; /* number of dropped rows */ + register double *temp; + register double *lusup = Glu->lusup; + register int *lsub = Glu->lsub; + register int *xlsub = Glu->xlsub; + register int *xlusup = Glu->xlusup; + register double d_max = 0.0, d_min = 1.0; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + norm_t nrm = options->ILU_Norm; + double zero = 0.0; + double one = 1.0; + double none = -1.0; + int inc_diag; /* inc_diag = m + 1 */ + int nzp = 0; /* number of zero pivots */ + + xlusup_first = xlusup[first]; + xlsub_first = xlsub[first]; + m = xlusup[first + 1] - xlusup_first; + n = last - first + 1; + m1 = m - 1; + inc_diag = m + 1; + nzlc = lastc ? (xlusup[last + 2] - xlusup[last + 1]) : 0; + temp = dwork - n; + + /* Quick return if nothing to do. */ + if (m == 0 || m == n || drop_rule == NODROP) + { + *nnzLj += m * n; + return 0; + } + + /* basic dropping: ILU(tau) */ + for (i = n; i <= m1; ) + { + /* the average abs value of ith row */ + switch (nrm) + { + case ONE_NORM: + temp[i] = dasum_(&n, &lusup[xlusup_first + i], &m) / (double)n; + break; + case TWO_NORM: + temp[i] = dnrm2_(&n, &lusup[xlusup_first + i], &m) + / sqrt((double)n); + break; + case INF_NORM: + default: + k = idamax_(&n, &lusup[xlusup_first + i], &m) - 1; + temp[i] = fabs(lusup[xlusup_first + i + m * k]); + break; + } + + /* drop small entries due to drop_tol */ + if (drop_rule & DROP_BASIC && temp[i] < drop_tol) + { + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + daxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + dcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + dswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + continue; + } /* if dropping */ + else + { + if (temp[i] > d_max) d_max = temp[i]; + if (temp[i] < d_min) d_min = temp[i]; + } + i++; + } /* for */ + + /* Secondary dropping: drop more rows according to the quota. */ + quota = ceil((double)quota / (double)n); + if (drop_rule & DROP_SECONDARY && m - r > quota) + { + register double tol = d_max; + + /* Calculate the second dropping tolerance */ + if (quota > n) + { + if (drop_rule & DROP_INTERP) /* by interpolation */ + { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / (m - n - r)); + } + else /* by quick sort */ + { + register int *itemp = iwork - n; + A = temp; + for (i = n; i <= m1; i++) itemp[i] = i; + qsort(iwork, m1 - n + 1, sizeof(int), _compare_); + printf("new quota = %d, iwork size for initilization = %d\n", + quota, m1-n+1); + /* tol = temp[iwork[quota]]; bug! */ + assert( n <= quota <= m1 ); + tol = temp[itemp[quota]]; + } + } + + for (i = n; i <= m1; ) + { + if (temp[i] <= tol) + { + register int j; + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + daxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + dcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + dswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + temp[i] = temp[m1]; + + continue; + } + i++; + + } /* for */ + + } /* if secondary dropping */ + + for (i = n; i < m; i++) temp[i] = 0.0; + + if (r == 0) + { + *nnzLj += m * n; + return 0; + } + + /* add dropped entries to the diagnal */ + if (milu != SILU) + { + register int j; + double t; + for (j = 0; j < n; j++) + { + t = lusup[xlusup_first + (m - 1) + j * m] * MILU_ALPHA; + switch (milu) + { + case SMILU_1: + if (t != none) { + lusup[xlusup_first + j * inc_diag] *= (one + t); + } + else + { + lusup[xlusup_first + j * inc_diag] *= *fill_tol; +#ifdef DEBUG + printf("[1] ZERO PIVOT: FILL col %d.\n", first + j); + fflush(stdout); +#endif + nzp++; + } + break; + case SMILU_2: + lusup[xlusup_first + j * inc_diag] *= (1.0 + fabs(t)); + break; + case SMILU_3: + lusup[xlusup_first + j * inc_diag] *= (one + t); + break; + case SILU: + default: + break; + } + } + if (nzp > 0) *fill_tol = -nzp; + } + + /* Remove dropped entries from the memory and fix the pointers. */ + m1 = m - r; + for (j = 1; j < n; j++) + { + register int tmp1, tmp2; + tmp1 = xlusup_first + j * m1; + tmp2 = xlusup_first + j * m; + for (i = 0; i < m1; i++) + lusup[i + tmp1] = lusup[i + tmp2]; + } + for (i = 0; i < nzlc; i++) + lusup[xlusup_first + i + n * m1] = lusup[xlusup_first + i + n * m]; + for (i = 0; i < nzlc; i++) + lsub[xlsub[last + 1] - r + i] = lsub[xlsub[last + 1] + i]; + for (i = first + 1; i <= last + 1; i++) + { + xlusup[i] -= r * (i - first); + xlsub[i] -= r; + } + if (lastc) + { + xlusup[last + 2] -= r * n; + xlsub[last + 2] -= r; + } + + *nnzLj += (m - r) * n; + return r; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpanel_dfs.c new file mode 100644 index 0000000..5aae050 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpanel_dfs.c @@ -0,0 +1,248 @@ + +/*! @file ilu_dpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols and + * record the entries with maximum absolute value in each column + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel.
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ +void +ilu_dpanel_dfs( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + double *dense, /* out */ + double *amax, /* out - max. abs. value of each column in panel */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ +) +{ + + NCPformat *Astore; + double *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + double *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + double *amax_col; + register double tmp; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + amax_col = amax; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + *amax_col = 0.0; + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + tmp = fabs(a[k]); + if (tmp > *amax_col) *amax_col = tmp; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + amax_col++; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpivotL.c new file mode 100644 index 0000000..33c316d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dpivotL.c @@ -0,0 +1,266 @@ + +/*! @file ilu_dpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + + +#include +#include +#include "slu_ddefs.h" + +#ifndef SGN +#define SGN(x) ((x)>=0?1:-1) +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *	     pivot row = k;
    + *	 ELSE IF abs(A_jj) >= thresh THEN
    + *	     pivot row = j;
    + *	 ELSE
    + *	     pivot row = m;
    + *
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0	  success;
    + *		   i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +ilu_dpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by + * perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int diagind, /* diagonal of Pc*A*Pc' */ + int *swap, /* in/out record the row permutation */ + int *iswap, /* in/out inverse of swap, it is the same as + perm_r after the factorization */ + int *marker, /* in */ + int *pivrow, /* in/out, as an input if *usepr!=0 */ + double fill_tol, /* in - fill tolerance of current column + * used for a singular column */ + milu_t milu, /* in */ + double drop_sum, /* in - computed in ilu_dcopy_to_ucol() + (MILU only) */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int n; /* number of columns */ + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + register int pivptr; + int old_pivptr, diag, ptr0; + register double pivmax, rtemp; + double thresh; + double temp; + double *lu_sup_ptr; + double *lu_col_ptr; + int *lsub_ptr; + register int isub, icol, k, itemp; + int *lsub, *xlsub; + double *lusup; + int *xlusup; + flops_t *ops = stat->ops; + int info; + + /* Initialize pointers */ + n = Glu->n; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + pivmax = -1.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + ptr0 = EMPTY; + for (isub = nsupc; isub < nsupr; ++isub) { + if (marker[lsub_ptr[isub]] > jcol) + continue; /* do not overlap with a later relaxed supernode */ + + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[isub] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + /* In this case, drop_sum contains the sum of the abs. value */ + rtemp = fabs(lu_col_ptr[isub]); + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[isub]); + break; + } + if (rtemp > pivmax) { pivmax = rtemp; pivptr = isub; } + if (*usepr && lsub_ptr[isub] == *pivrow) old_pivptr = isub; + if (lsub_ptr[isub] == diagind) diag = isub; + if (ptr0 == EMPTY) ptr0 = isub; + } + + if (milu == SMILU_2 || milu == SMILU_3) pivmax += drop_sum; + + /* Test for singularity */ + if (pivmax < 0.0) { + fprintf(stderr, "[0]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + if ( pivmax == 0.0 ) { + if (diag != EMPTY) + *pivrow = lsub_ptr[pivptr = diag]; + else if (ptr0 != EMPTY) + *pivrow = lsub_ptr[pivptr = ptr0]; + else { + /* look for the first row which does not + belong to any later supernodes */ + for (icol = jcol; icol < n; icol++) + if (marker[swap[icol]] <= jcol) break; + if (icol >= n) { + fprintf(stderr, "[1]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + + *pivrow = swap[icol]; + + /* pick up the pivot row */ + for (isub = nsupc; isub < nsupr; ++isub) + if ( lsub_ptr[isub] == *pivrow ) { pivptr = isub; break; } + } + pivmax = fill_tol; + lu_col_ptr[pivptr] = pivmax; + *usepr = 0; +#ifdef DEBUG + printf("[0] ZERO PIVOT: FILL (%d, %d).\n", *pivrow, jcol); + fflush(stdout); +#endif + info =jcol + 1; + } /* if (*pivrow == 0.0) */ + else { + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[old_pivptr] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + rtemp = fabs(lu_col_ptr[old_pivptr]) + drop_sum; + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[old_pivptr]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = old_pivptr; + else *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[diag] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + rtemp = fabs(lu_col_ptr[diag]) + drop_sum; + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[diag]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + info = 0; + + /* Reset the diagonal */ + switch (milu) { + case SMILU_1: + lu_col_ptr[pivptr] += drop_sum; + break; + case SMILU_2: + case SMILU_3: + lu_col_ptr[pivptr] += SGN(lu_col_ptr[pivptr]) * drop_sum; + break; + case SILU: + default: + break; + } + + } /* else */ + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + if (jcol < n - 1) { + register int t1, t2, t; + t1 = iswap[*pivrow]; t2 = jcol; + if (t1 != t2) { + t = swap[t1]; swap[t1] = swap[t2]; swap[t2] = t; + t1 = swap[t1]; t2 = t; + t = iswap[t1]; iswap[t1] = iswap[t2]; iswap[t2] = t; + } + } /* if (jcol < n - 1) */ + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += nsupr - nsupc; + temp = 1.0 / lu_col_ptr[nsupc]; + for (k = nsupc+1; k < nsupr; k++) lu_col_ptr[k] *= temp; + + return info; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dsnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dsnode_dfs.c new file mode 100644 index 0000000..5251134 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_dsnode_dfs.c @@ -0,0 +1,90 @@ + +/*! @file ilu_dsnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_dsnode_dfs() - Determine the union of the row structures of those
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +ilu_dsnode_dfs( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, nextl; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) + { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) + { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) + { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) + { + if ( (mem_error = dLUMemXpand(jcol, nextl, LSUB, &nzlmax, + Glu)) != 0) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1 */ + if ( jcol < kcol ) + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xlsub[kcol+1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_heap_relax_snode.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_heap_relax_snode.c new file mode 100644 index 0000000..d7a98bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_heap_relax_snode.c @@ -0,0 +1,120 @@ +/*! @file ilu_heap_relax_snode.c + * \brief Identify the initial relaxed supernodes + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 1, 2009
    + * 
    + */ + +#include "slu_ddefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_heap_relax_snode() - Identify the initial relaxed supernodes,
    + *    assuming that the matrix has been reordered according to the postorder
    + *    of the etree.
    + * 
    + */ + +void +ilu_heap_relax_snode ( + const int n, + int *et, /* column elimination tree */ + const int relax_columns, /* max no of columns allowed in a + relaxed snode */ + int *descendants, /* no of descendants of each node + in the etree */ + int *relax_end, /* last column in a supernode + * if j-th column starts a relaxed + * supernode, relax_end[j] represents + * the last column of this supernode */ + int *relax_fsupc /* first column in a supernode + * relax_fsupc[j] represents the first + * column of j-th supernode */ + ) +{ + register int i, j, k, l, f, parent; + register int snode_start; /* beginning of a snode */ + int *et_save, *post, *inv_post, *iwork; + int nsuper_et = 0, nsuper_et_post = 0; + + /* The etree may not be postordered, but is heap ordered. */ + + iwork = (int*) intMalloc(3*n+2); + if ( !iwork ) ABORT("SUPERLU_MALLOC fails for iwork[]"); + inv_post = iwork + n+1; + et_save = inv_post + n+1; + + /* Post order etree */ + post = (int *) TreePostorder(n, et); + for (i = 0; i < n+1; ++i) inv_post[post[i]] = i; + + /* Renumber etree in postorder */ + for (i = 0; i < n; ++i) { + iwork[post[i]] = post[et[i]]; + et_save[i] = et[i]; /* Save the original etree */ + } + for (i = 0; i < n; ++i) et[i] = iwork[i]; + + /* Compute the number of descendants of each node in the etree */ + ifill (relax_end, n, EMPTY); + ifill (relax_fsupc, n, EMPTY); + for (j = 0; j < n; j++) descendants[j] = 0; + for (j = 0; j < n; j++) { + parent = et[j]; + if ( parent != n ) /* not the dummy root */ + descendants[parent] += descendants[j] + 1; + } + + /* Identify the relaxed supernodes by postorder traversal of the etree. */ + for ( f = j = 0; j < n; ) { + parent = et[j]; + snode_start = j; + while ( parent != n && descendants[parent] < relax_columns ) { + j = parent; + parent = et[j]; + } + /* Found a supernode in postordered etree; j is the last column. */ + ++nsuper_et_post; + k = n; + for (i = snode_start; i <= j; ++i) + k = SUPERLU_MIN(k, inv_post[i]); + l = inv_post[j]; + if ( (l - k) == (j - snode_start) ) { + /* It's also a supernode in the original etree */ + relax_end[k] = l; /* Last column is recorded */ + relax_fsupc[f++] = k; + ++nsuper_et; + } else { + for (i = snode_start; i <= j; ++i) { + l = inv_post[i]; + if ( descendants[i] == 0 ) { + relax_end[l] = l; + relax_fsupc[f++] = l; + ++nsuper_et; + } + } + } + j++; + /* Search for a new leaf */ + while ( descendants[j] != 0 && j < n ) j++; + } + +#if ( PRNTlevel>=1 ) + printf(".. heap_snode_relax:\n" + "\tNo of relaxed snodes in postordered etree:\t%d\n" + "\tNo of relaxed snodes in original etree:\t%d\n", + nsuper_et_post, nsuper_et); +#endif + + /* Recover the original etree */ + for (i = 0; i < n; ++i) et[i] = et_save[i]; + + SUPERLU_FREE(post); + SUPERLU_FREE(iwork); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_relax_snode.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_relax_snode.c new file mode 100644 index 0000000..124101a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_relax_snode.c @@ -0,0 +1,69 @@ +/*! @file ilu_relax_snode.c + * \brief Identify initial relaxed supernodes + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 1, 2009
    + * 
    + */ + +#include "slu_ddefs.h" +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_relax_snode() - Identify the initial relaxed supernodes, assuming
    + *    that the matrix has been reordered according to the postorder of the
    + *    etree.
    + * 
    + */ +void +ilu_relax_snode ( + const int n, + int *et, /* column elimination tree */ + const int relax_columns, /* max no of columns allowed in a + relaxed snode */ + int *descendants, /* no of descendants of each node + in the etree */ + int *relax_end, /* last column in a supernode + * if j-th column starts a relaxed + * supernode, relax_end[j] represents + * the last column of this supernode */ + int *relax_fsupc /* first column in a supernode + * relax_fsupc[j] represents the first + * column of j-th supernode */ + ) +{ + + register int j, f, parent; + register int snode_start; /* beginning of a snode */ + + ifill (relax_end, n, EMPTY); + ifill (relax_fsupc, n, EMPTY); + for (j = 0; j < n; j++) descendants[j] = 0; + + /* Compute the number of descendants of each node in the etree */ + for (j = 0; j < n; j++) { + parent = et[j]; + if ( parent != n ) /* not the dummy root */ + descendants[parent] += descendants[j] + 1; + } + + /* Identify the relaxed supernodes by postorder traversal of the etree. */ + for (j = f = 0; j < n; ) { + parent = et[j]; + snode_start = j; + while ( parent != n && descendants[parent] < relax_columns ) { + j = parent; + parent = et[j]; + } + /* Found a supernode with j being the last column. */ + relax_end[snode_start] = j; /* Last column is recorded */ + j++; + relax_fsupc[f++] = snode_start; + /* Search for a new leaf */ + while ( descendants[j] != 0 && j < n ) j++; + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scolumn_dfs.c new file mode 100644 index 0000000..0e7631c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scolumn_dfs.c @@ -0,0 +1,258 @@ + +/*! @file ilu_scolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    +*/ + +#include "slu_sdefs.h" + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   ILU_SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +ilu_scolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the + dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(7); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonzero */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ((mem_error = sLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu))) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( (mem_error = sLUMemXpand(jcol,nextl, + LSUB,&nzlmax,Glu)) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; + + /* Always start a new supernode for a singular column */ + if ( nextl == jptr ) jsuper = EMPTY; + + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first columns of the supernode. + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1) ) { /* >= 2 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + xlsub[jcol] = ito; + for (ifrom = jptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c new file mode 100644 index 0000000..7e0e97c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c @@ -0,0 +1,207 @@ + +/*! @file ilu_scopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory
    + * November, 2010
    + * 
    + */ + +#include "slu_sdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +extern void scopy_(int *, float [], int *, float [], int *); + +#if 0 +static float *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = fabs(A[*x]), yy = fabs(A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} +#endif + +int +ilu_scopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + float *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + float *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + float *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + float *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register float d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + float zero = 0.0; + int i_1 = 1; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = sLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = sLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = fabs(dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += dense[irow]; + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + *sum += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + scopy_(&m, &ucol[xusub[jcol]], &i_1, work, &i_1); + tol = sqselect(m, work, quota); +#if 0 + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); +#endif + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (fabs(ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += ucol[i]; + break; + case SMILU_3: + *sum += fabs(ucol[i]); + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) *sum = fabs(*sum); + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c.bak new file mode 100644 index 0000000..2b3bc70 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_scopy_to_ucol.c.bak @@ -0,0 +1,199 @@ + +/*! @file ilu_scopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +static float *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = fabs(A[*x]), yy = fabs(A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} + + +int +ilu_scopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + float *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + float *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + int *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + float *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register float d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + float zero = 0.0; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = sLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = sLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = fabs(dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += dense[irow]; + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + *sum += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (fabs(ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + *sum += ucol[i]; + break; + case SMILU_3: + *sum += fabs(ucol[i]); + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) *sum = fabs(*sum); + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_sdrop_row.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_sdrop_row.c new file mode 100644 index 0000000..108f849 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_sdrop_row.c @@ -0,0 +1,329 @@ + +/*! @file ilu_sdrop_row.c + * \brief Drop small rows from L + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include +#include +#include "slu_sdefs.h" + +extern void sswap_(int *, float [], int *, float [], int *); +extern void saxpy_(int *, float *, float [], int *, float [], int *); +extern void scopy_(int *, float [], int *, float [], int *); +extern float sasum_(int *, float *, int *); +extern float snrm2_(int *, float *, int *); +extern double dnrm2_(int *, double [], int *); +extern int isamax_(int *, float [], int *); + +static float *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + if (A[*x] - A[*y] > 0.0) return -1; + else if (A[*x] - A[*y] < 0.0) return 1; + else return 0; +} + +/*! \brief + *
    + * Purpose
    + * =======
    + *    ilu_sdrop_row() - Drop some small rows from the previous 
    + *    supernode (L-part only).
    + * 
    + */ +int ilu_sdrop_row( + superlu_options_t *options, /* options */ + int first, /* index of the first column in the supernode */ + int last, /* index of the last column in the supernode */ + double drop_tol, /* dropping parameter */ + int quota, /* maximum nonzero entries allowed */ + int *nnzLj, /* in/out number of nonzeros in L(:, 1:last) */ + double *fill_tol, /* in/out - on exit, fill_tol=-num_zero_pivots, + * does not change if options->ILU_MILU != SMILU1 */ + GlobalLU_t *Glu, /* modified */ + float swork[], /* working space + * the length of swork[] should be no less than + * the number of rows in the supernode */ + float swork2[], /* working space with the same size as swork[], + * used only by the second dropping rule */ + int lastc /* if lastc == 0, there is nothing after the + * working supernode [first:last]; + * if lastc == 1, there is one more column after + * the working supernode. */ ) +{ + register int i, j, k, m1; + register int nzlc; /* number of nonzeros in column last+1 */ + register int xlusup_first, xlsub_first; + int m, n; /* m x n is the size of the supernode */ + int r = 0; /* number of dropped rows */ + register float *temp; + register float *lusup = Glu->lusup; + register int *lsub = Glu->lsub; + register int *xlsub = Glu->xlsub; + register int *xlusup = Glu->xlusup; + register float d_max = 0.0, d_min = 1.0; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + norm_t nrm = options->ILU_Norm; + float zero = 0.0; + float one = 1.0; + float none = -1.0; + int i_1 = 1; + int inc_diag; /* inc_diag = m + 1 */ + int nzp = 0; /* number of zero pivots */ + float alpha = pow((double)(Glu->n), -1.0 / options->ILU_MILU_Dim); + + xlusup_first = xlusup[first]; + xlsub_first = xlsub[first]; + m = xlusup[first + 1] - xlusup_first; + n = last - first + 1; + m1 = m - 1; + inc_diag = m + 1; + nzlc = lastc ? (xlusup[last + 2] - xlusup[last + 1]) : 0; + temp = swork - n; + + /* Quick return if nothing to do. */ + if (m == 0 || m == n || drop_rule == NODROP) + { + *nnzLj += m * n; + return 0; + } + + /* basic dropping: ILU(tau) */ + for (i = n; i <= m1; ) + { + /* the average abs value of ith row */ + switch (nrm) + { + case ONE_NORM: + temp[i] = sasum_(&n, &lusup[xlusup_first + i], &m) / (double)n; + break; + case TWO_NORM: + temp[i] = snrm2_(&n, &lusup[xlusup_first + i], &m) + / sqrt((double)n); + break; + case INF_NORM: + default: + k = isamax_(&n, &lusup[xlusup_first + i], &m) - 1; + temp[i] = fabs(lusup[xlusup_first + i + m * k]); + break; + } + + /* drop small entries due to drop_tol */ + if (drop_rule & DROP_BASIC && temp[i] < drop_tol) + { + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + saxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + scopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + sswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + continue; + } /* if dropping */ + else + { + if (temp[i] > d_max) d_max = temp[i]; + if (temp[i] < d_min) d_min = temp[i]; + } + i++; + } /* for */ + + /* Secondary dropping: drop more rows according to the quota. */ + quota = ceil((double)quota / (double)n); + if (drop_rule & DROP_SECONDARY && m - r > quota) + { + register double tol = d_max; + + /* Calculate the second dropping tolerance */ + if (quota > n) + { + if (drop_rule & DROP_INTERP) /* by interpolation */ + { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / (m - n - r)); + } + else /* by quick select */ + { + int len = m1 - n + 1; + scopy_(&len, swork, &i_1, swork2, &i_1); + tol = sqselect(len, swork2, quota - n); +#if 0 + register int *itemp = iwork - n; + A = temp; + for (i = n; i <= m1; i++) itemp[i] = i; + qsort(iwork, m1 - n + 1, sizeof(int), _compare_); + tol = temp[itemp[quota]]; +#endif + } + } + + for (i = n; i <= m1; ) + { + if (temp[i] <= tol) + { + register int j; + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + saxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m] += + fabs(lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + scopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + sswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m] = + fabs(lusup[xlusup_first + m1 + j * m]); + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + temp[i] = temp[m1]; + + continue; + } + i++; + + } /* for */ + + } /* if secondary dropping */ + + for (i = n; i < m; i++) temp[i] = 0.0; + + if (r == 0) + { + *nnzLj += m * n; + return 0; + } + + /* add dropped entries to the diagnal */ + if (milu != SILU) + { + register int j; + float t; + float omega; + for (j = 0; j < n; j++) + { + t = lusup[xlusup_first + (m - 1) + j * m]; + if (t == zero) continue; + if (t > zero) + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) / t, 1.0); + else + omega = SUPERLU_MAX(2.0 * (1.0 - alpha) / t, -1.0); + t *= omega; + + switch (milu) + { + case SMILU_1: + if (t != none) { + lusup[xlusup_first + j * inc_diag] *= (one + t); + } + else + { + lusup[xlusup_first + j * inc_diag] *= *fill_tol; +#ifdef DEBUG + printf("[1] ZERO PIVOT: FILL col %d.\n", first + j); + fflush(stdout); +#endif + nzp++; + } + break; + case SMILU_2: + lusup[xlusup_first + j * inc_diag] *= (1.0 + fabs(t)); + break; + case SMILU_3: + lusup[xlusup_first + j * inc_diag] *= (one + t); + break; + case SILU: + default: + break; + } + } + if (nzp > 0) *fill_tol = -nzp; + } + + /* Remove dropped entries from the memory and fix the pointers. */ + m1 = m - r; + for (j = 1; j < n; j++) + { + register int tmp1, tmp2; + tmp1 = xlusup_first + j * m1; + tmp2 = xlusup_first + j * m; + for (i = 0; i < m1; i++) + lusup[i + tmp1] = lusup[i + tmp2]; + } + for (i = 0; i < nzlc; i++) + lusup[xlusup_first + i + n * m1] = lusup[xlusup_first + i + n * m]; + for (i = 0; i < nzlc; i++) + lsub[xlsub[last + 1] - r + i] = lsub[xlsub[last + 1] + i]; + for (i = first + 1; i <= last + 1; i++) + { + xlusup[i] -= r * (i - first); + xlsub[i] -= r; + } + if (lastc) + { + xlusup[last + 2] -= r * n; + xlsub[last + 2] -= r; + } + + *nnzLj += (m - r) * n; + return r; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spanel_dfs.c new file mode 100644 index 0000000..a741846 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spanel_dfs.c @@ -0,0 +1,248 @@ + +/*! @file ilu_spanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols and + * record the entries with maximum absolute value in each column + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel.
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ +void +ilu_spanel_dfs( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + float *dense, /* out */ + float *amax, /* out - max. abs. value of each column in panel */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ +) +{ + + NCPformat *Astore; + float *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + float *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + float *amax_col; + register double tmp; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + amax_col = amax; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + *amax_col = 0.0; + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + tmp = fabs(a[k]); + if (tmp > *amax_col) *amax_col = tmp; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + amax_col++; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spivotL.c new file mode 100644 index 0000000..25b6b00 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_spivotL.c @@ -0,0 +1,266 @@ + +/*! @file ilu_spivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + + +#include +#include +#include "slu_sdefs.h" + +#ifndef SGN +#define SGN(x) ((x)>=0?1:-1) +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *	     pivot row = k;
    + *	 ELSE IF abs(A_jj) >= thresh THEN
    + *	     pivot row = j;
    + *	 ELSE
    + *	     pivot row = m;
    + *
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0	  success;
    + *		   i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +ilu_spivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by + * perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int diagind, /* diagonal of Pc*A*Pc' */ + int *swap, /* in/out record the row permutation */ + int *iswap, /* in/out inverse of swap, it is the same as + perm_r after the factorization */ + int *marker, /* in */ + int *pivrow, /* in/out, as an input if *usepr!=0 */ + double fill_tol, /* in - fill tolerance of current column + * used for a singular column */ + milu_t milu, /* in */ + float drop_sum, /* in - computed in ilu_scopy_to_ucol() + (MILU only) */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int n; /* number of columns */ + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + register int pivptr; + int old_pivptr, diag, ptr0; + register float pivmax, rtemp; + float thresh; + float temp; + float *lu_sup_ptr; + float *lu_col_ptr; + int *lsub_ptr; + register int isub, icol, k, itemp; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + flops_t *ops = stat->ops; + int info; + + /* Initialize pointers */ + n = Glu->n; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + pivmax = -1.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + ptr0 = EMPTY; + for (isub = nsupc; isub < nsupr; ++isub) { + if (marker[lsub_ptr[isub]] > jcol) + continue; /* do not overlap with a later relaxed supernode */ + + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[isub] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + /* In this case, drop_sum contains the sum of the abs. value */ + rtemp = fabs(lu_col_ptr[isub]); + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[isub]); + break; + } + if (rtemp > pivmax) { pivmax = rtemp; pivptr = isub; } + if (*usepr && lsub_ptr[isub] == *pivrow) old_pivptr = isub; + if (lsub_ptr[isub] == diagind) diag = isub; + if (ptr0 == EMPTY) ptr0 = isub; + } + + if (milu == SMILU_2 || milu == SMILU_3) pivmax += drop_sum; + + /* Test for singularity */ + if (pivmax < 0.0) { + fprintf(stderr, "[0]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + if ( pivmax == 0.0 ) { + if (diag != EMPTY) + *pivrow = lsub_ptr[pivptr = diag]; + else if (ptr0 != EMPTY) + *pivrow = lsub_ptr[pivptr = ptr0]; + else { + /* look for the first row which does not + belong to any later supernodes */ + for (icol = jcol; icol < n; icol++) + if (marker[swap[icol]] <= jcol) break; + if (icol >= n) { + fprintf(stderr, "[1]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + + *pivrow = swap[icol]; + + /* pick up the pivot row */ + for (isub = nsupc; isub < nsupr; ++isub) + if ( lsub_ptr[isub] == *pivrow ) { pivptr = isub; break; } + } + pivmax = fill_tol; + lu_col_ptr[pivptr] = pivmax; + *usepr = 0; +#ifdef DEBUG + printf("[0] ZERO PIVOT: FILL (%d, %d).\n", *pivrow, jcol); + fflush(stdout); +#endif + info =jcol + 1; + } /* if (*pivrow == 0.0) */ + else { + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[old_pivptr] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + rtemp = fabs(lu_col_ptr[old_pivptr]) + drop_sum; + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[old_pivptr]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = old_pivptr; + else *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + switch (milu) { + case SMILU_1: + rtemp = fabs(lu_col_ptr[diag] + drop_sum); + break; + case SMILU_2: + case SMILU_3: + rtemp = fabs(lu_col_ptr[diag]) + drop_sum; + break; + case SILU: + default: + rtemp = fabs(lu_col_ptr[diag]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + info = 0; + + /* Reset the diagonal */ + switch (milu) { + case SMILU_1: + lu_col_ptr[pivptr] += drop_sum; + break; + case SMILU_2: + case SMILU_3: + lu_col_ptr[pivptr] += SGN(lu_col_ptr[pivptr]) * drop_sum; + break; + case SILU: + default: + break; + } + + } /* else */ + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + if (jcol < n - 1) { + register int t1, t2, t; + t1 = iswap[*pivrow]; t2 = jcol; + if (t1 != t2) { + t = swap[t1]; swap[t1] = swap[t2]; swap[t2] = t; + t1 = swap[t1]; t2 = t; + t = iswap[t1]; iswap[t1] = iswap[t2]; iswap[t2] = t; + } + } /* if (jcol < n - 1) */ + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += nsupr - nsupc; + temp = 1.0 / lu_col_ptr[nsupc]; + for (k = nsupc+1; k < nsupr; k++) lu_col_ptr[k] *= temp; + + return info; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ssnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ssnode_dfs.c new file mode 100644 index 0000000..22ae226 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_ssnode_dfs.c @@ -0,0 +1,90 @@ + +/*! @file ilu_ssnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_ssnode_dfs() - Determine the union of the row structures of those
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +ilu_ssnode_dfs( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, nextl; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) + { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) + { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) + { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) + { + if ( (mem_error = sLUMemXpand(jcol, nextl, LSUB, &nzlmax, + Glu)) != 0) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1 */ + if ( jcol < kcol ) + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xlsub[kcol+1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcolumn_dfs.c new file mode 100644 index 0000000..dec9460 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcolumn_dfs.c @@ -0,0 +1,258 @@ + +/*! @file ilu_zcolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    +*/ + +#include "slu_zdefs.h" + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   ILU_ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +ilu_zcolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the + dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(7); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonzero */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ((mem_error = zLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu))) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( (mem_error = zLUMemXpand(jcol,nextl, + LSUB,&nzlmax,Glu)) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; + + /* Always start a new supernode for a singular column */ + if ( nextl == jptr ) jsuper = EMPTY; + + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first columns of the supernode. + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1) ) { /* >= 2 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + xlsub[jcol] = ito; + for (ifrom = jptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c new file mode 100644 index 0000000..ddf3a63 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c @@ -0,0 +1,211 @@ + +/*! @file ilu_zcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory
    + * November, 2010
    + * 
    + */ + +#include "slu_zdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +extern void zcopy_(int *, doublecomplex [], int *, doublecomplex [], int *); + +#if 0 +static doublecomplex *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = z_abs1(&A[*x]), yy = z_abs1(&A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} +#endif + +int +ilu_zcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + doublecomplex *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + doublecomplex *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + double *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register double d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + doublecomplex zero = {0.0, 0.0}; + int i_1 = 1; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = zLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = zLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = z_abs1(&dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + z_add(sum, sum, &dense[irow]); + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + sum->r += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + i_1 = xusub[jcol]; + for (i = 0; i < m; ++i, ++i_1) work[i] = z_abs1(&ucol[i_1]); + tol = dqselect(m, work, quota); +#if 0 + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); +#endif + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (z_abs1(&ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + z_add(sum, sum, &ucol[i]); + break; + case SMILU_3: + sum->r += tmp; + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) { + sum->r = z_abs1(sum); sum->i = 0.0; + } + if (milu == SMILU_3) sum->i = 0.0; + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c.bak new file mode 100644 index 0000000..9859c2f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zcopy_to_ucol.c.bak @@ -0,0 +1,202 @@ + +/*! @file ilu_zcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * and drop some small entries + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +#ifdef DEBUG +int num_drop_U; +#endif + +static doublecomplex *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + register double xx = z_abs1(&A[*x]), yy = z_abs1(&A[*y]); + if (xx > yy) return -1; + else if (xx < yy) return 1; + else return 0; +} + + +int +ilu_zcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + doublecomplex *dense, /* modified - reset to zero on return */ + int drop_rule,/* in */ + milu_t milu, /* in */ + double drop_tol, /* in */ + int quota, /* maximum nonzero entries allowed */ + doublecomplex *sum, /* out - the sum of dropped entries */ + int *nnzUj, /* in - out */ + GlobalLU_t *Glu, /* modified */ + int *work /* working space with minimum size n, + * used by the second dropping rule */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *ucol; + int *usub, *xusub; + int nzumax; + int m; /* number of entries in the nonzero U-segments */ + register double d_max = 0.0, d_min = 1.0 / dlamch_("Safe minimum"); + register double tmp; + doublecomplex zero = {0.0, 0.0}; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + *sum = zero; + if (drop_rule == NODROP) { + drop_tol = -1.0, quota = Glu->n; + } + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if ((mem_error = zLUMemXpand(jcol, nextu, UCOL, &nzumax, + Glu)) != 0) + return (mem_error); + ucol = Glu->ucol; + if ((mem_error = zLUMemXpand(jcol, nextu, USUB, &nzumax, + Glu)) != 0) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub++]; + tmp = z_abs1(&dense[irow]); + + /* first dropping rule */ + if (quota > 0 && tmp >= drop_tol) { + if (tmp > d_max) d_max = tmp; + if (tmp < d_min) d_min = tmp; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + nextu++; + } else { + switch (milu) { + case SMILU_1: + case SMILU_2: + z_add(sum, sum, &dense[irow]); + break; + case SMILU_3: + /* *sum += fabs(dense[irow]);*/ + sum->r += tmp; + break; + case SILU: + default: + break; + } +#ifdef DEBUG + num_drop_U++; +#endif + } + dense[irow] = zero; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + m = xusub[jcol + 1] - xusub[jcol]; + + /* second dropping rule */ + if (drop_rule & DROP_SECONDARY && m > quota) { + register double tol = d_max; + register int m0 = xusub[jcol] + m - 1; + + if (quota > 0) { + if (drop_rule & DROP_INTERP) { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / m); + } else { + A = &ucol[xusub[jcol]]; + for (i = 0; i < m; i++) work[i] = i; + qsort(work, m, sizeof(int), _compare_); + tol = fabs(usub[xusub[jcol] + work[quota]]); + } + } + for (i = xusub[jcol]; i <= m0; ) { + if (z_abs1(&ucol[i]) <= tol) { + switch (milu) { + case SMILU_1: + case SMILU_2: + z_add(sum, sum, &ucol[i]); + break; + case SMILU_3: + sum->r += tmp; + break; + case SILU: + default: + break; + } + ucol[i] = ucol[m0]; + usub[i] = usub[m0]; + m0--; + m--; +#ifdef DEBUG + num_drop_U++; +#endif + xusub[jcol + 1]--; + continue; + } + i++; + } + } + + if (milu == SMILU_2) { + sum->r = z_abs1(sum); sum->i = 0.0; + } + if (milu == SMILU_3) sum->i = 0.0; + + *nnzUj += m; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zdrop_row.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zdrop_row.c new file mode 100644 index 0000000..0a140d4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zdrop_row.c @@ -0,0 +1,339 @@ + +/*! @file ilu_zdrop_row.c + * \brief Drop small rows from L + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include +#include +#include "slu_zdefs.h" + +extern void zswap_(int *, doublecomplex [], int *, doublecomplex [], int *); +extern void zaxpy_(int *, doublecomplex *, doublecomplex [], int *, doublecomplex [], int *); +extern void zcopy_(int *, doublecomplex [], int *, doublecomplex [], int *); +extern double dzasum_(int *, doublecomplex *, int *); +extern double dznrm2_(int *, doublecomplex *, int *); +extern double dnrm2_(int *, double [], int *); +extern int izamax_(int *, doublecomplex [], int *); + +static double *A; /* used in _compare_ only */ +static int _compare_(const void *a, const void *b) +{ + register int *x = (int *)a, *y = (int *)b; + if (A[*x] - A[*y] > 0.0) return -1; + else if (A[*x] - A[*y] < 0.0) return 1; + else return 0; +} + +/*! \brief + *
    + * Purpose
    + * =======
    + *    ilu_zdrop_row() - Drop some small rows from the previous 
    + *    supernode (L-part only).
    + * 
    + */ +int ilu_zdrop_row( + superlu_options_t *options, /* options */ + int first, /* index of the first column in the supernode */ + int last, /* index of the last column in the supernode */ + double drop_tol, /* dropping parameter */ + int quota, /* maximum nonzero entries allowed */ + int *nnzLj, /* in/out number of nonzeros in L(:, 1:last) */ + double *fill_tol, /* in/out - on exit, fill_tol=-num_zero_pivots, + * does not change if options->ILU_MILU != SMILU1 */ + GlobalLU_t *Glu, /* modified */ + double dwork[], /* working space + * the length of dwork[] should be no less than + * the number of rows in the supernode */ + double dwork2[], /* working space with the same size as dwork[], + * used only by the second dropping rule */ + int lastc /* if lastc == 0, there is nothing after the + * working supernode [first:last]; + * if lastc == 1, there is one more column after + * the working supernode. */ ) +{ + register int i, j, k, m1; + register int nzlc; /* number of nonzeros in column last+1 */ + register int xlusup_first, xlsub_first; + int m, n; /* m x n is the size of the supernode */ + int r = 0; /* number of dropped rows */ + register double *temp; + register doublecomplex *lusup = Glu->lusup; + register int *lsub = Glu->lsub; + register int *xlsub = Glu->xlsub; + register int *xlusup = Glu->xlusup; + register double d_max = 0.0, d_min = 1.0; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + norm_t nrm = options->ILU_Norm; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + doublecomplex none = {-1.0, 0.0}; + int i_1 = 1; + int inc_diag; /* inc_diag = m + 1 */ + int nzp = 0; /* number of zero pivots */ + double alpha = pow((double)(Glu->n), -1.0 / options->ILU_MILU_Dim); + + xlusup_first = xlusup[first]; + xlsub_first = xlsub[first]; + m = xlusup[first + 1] - xlusup_first; + n = last - first + 1; + m1 = m - 1; + inc_diag = m + 1; + nzlc = lastc ? (xlusup[last + 2] - xlusup[last + 1]) : 0; + temp = dwork - n; + + /* Quick return if nothing to do. */ + if (m == 0 || m == n || drop_rule == NODROP) + { + *nnzLj += m * n; + return 0; + } + + /* basic dropping: ILU(tau) */ + for (i = n; i <= m1; ) + { + /* the average abs value of ith row */ + switch (nrm) + { + case ONE_NORM: + temp[i] = dzasum_(&n, &lusup[xlusup_first + i], &m) / (double)n; + break; + case TWO_NORM: + temp[i] = dznrm2_(&n, &lusup[xlusup_first + i], &m) + / sqrt((double)n); + break; + case INF_NORM: + default: + k = izamax_(&n, &lusup[xlusup_first + i], &m) - 1; + temp[i] = z_abs1(&lusup[xlusup_first + i + m * k]); + break; + } + + /* drop small entries due to drop_tol */ + if (drop_rule & DROP_BASIC && temp[i] < drop_tol) + { + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + zaxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m].r += + z_abs1(&lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + zcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + zswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m].r = + z_abs1(&lusup[xlusup_first + m1 + j * m]); + lusup[xlusup_first + m1 + j * m].i = 0.0; + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + continue; + } /* if dropping */ + else + { + if (temp[i] > d_max) d_max = temp[i]; + if (temp[i] < d_min) d_min = temp[i]; + } + i++; + } /* for */ + + /* Secondary dropping: drop more rows according to the quota. */ + quota = ceil((double)quota / (double)n); + if (drop_rule & DROP_SECONDARY && m - r > quota) + { + register double tol = d_max; + + /* Calculate the second dropping tolerance */ + if (quota > n) + { + if (drop_rule & DROP_INTERP) /* by interpolation */ + { + d_max = 1.0 / d_max; d_min = 1.0 / d_min; + tol = 1.0 / (d_max + (d_min - d_max) * quota / (m - n - r)); + } + else /* by quick select */ + { + int len = m1 - n + 1; + dcopy_(&len, dwork, &i_1, dwork2, &i_1); + tol = dqselect(len, dwork2, quota - n); +#if 0 + register int *itemp = iwork - n; + A = temp; + for (i = n; i <= m1; i++) itemp[i] = i; + qsort(iwork, m1 - n + 1, sizeof(int), _compare_); + tol = temp[itemp[quota]]; +#endif + } + } + + for (i = n; i <= m1; ) + { + if (temp[i] <= tol) + { + register int j; + r++; + /* drop the current row and move the last undropped row here */ + if (r > 1) /* add to last row */ + { + /* accumulate the sum (for MILU) */ + switch (milu) + { + case SMILU_1: + case SMILU_2: + zaxpy_(&n, &one, &lusup[xlusup_first + i], &m, + &lusup[xlusup_first + m - 1], &m); + break; + case SMILU_3: + for (j = 0; j < n; j++) + lusup[xlusup_first + (m - 1) + j * m].r += + z_abs1(&lusup[xlusup_first + i + j * m]); + break; + case SILU: + default: + break; + } + zcopy_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + } /* if (r > 1) */ + else /* move to last row */ + { + zswap_(&n, &lusup[xlusup_first + m1], &m, + &lusup[xlusup_first + i], &m); + if (milu == SMILU_3) + for (j = 0; j < n; j++) { + lusup[xlusup_first + m1 + j * m].r = + z_abs1(&lusup[xlusup_first + m1 + j * m]); + lusup[xlusup_first + m1 + j * m].i = 0.0; + } + } + lsub[xlsub_first + i] = lsub[xlsub_first + m1]; + m1--; + temp[i] = temp[m1]; + + continue; + } + i++; + + } /* for */ + + } /* if secondary dropping */ + + for (i = n; i < m; i++) temp[i] = 0.0; + + if (r == 0) + { + *nnzLj += m * n; + return 0; + } + + /* add dropped entries to the diagnal */ + if (milu != SILU) + { + register int j; + doublecomplex t; + double omega; + for (j = 0; j < n; j++) + { + t = lusup[xlusup_first + (m - 1) + j * m]; + if (t.r == 0.0 && t.i == 0.0) continue; + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) / z_abs1(&t), 1.0); + zd_mult(&t, &t, omega); + + switch (milu) + { + case SMILU_1: + if ( !(z_eq(&t, &none)) ) { + z_add(&t, &t, &one); + zz_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + &t); + } + else + { + zd_mult( + &lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + *fill_tol); +#ifdef DEBUG + printf("[1] ZERO PIVOT: FILL col %d.\n", first + j); + fflush(stdout); +#endif + nzp++; + } + break; + case SMILU_2: + zd_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + 1.0 + z_abs1(&t)); + break; + case SMILU_3: + z_add(&t, &t, &one); + zz_mult(&lusup[xlusup_first + j * inc_diag], + &lusup[xlusup_first + j * inc_diag], + &t); + break; + case SILU: + default: + break; + } + } + if (nzp > 0) *fill_tol = -nzp; + } + + /* Remove dropped entries from the memory and fix the pointers. */ + m1 = m - r; + for (j = 1; j < n; j++) + { + register int tmp1, tmp2; + tmp1 = xlusup_first + j * m1; + tmp2 = xlusup_first + j * m; + for (i = 0; i < m1; i++) + lusup[i + tmp1] = lusup[i + tmp2]; + } + for (i = 0; i < nzlc; i++) + lusup[xlusup_first + i + n * m1] = lusup[xlusup_first + i + n * m]; + for (i = 0; i < nzlc; i++) + lsub[xlsub[last + 1] - r + i] = lsub[xlsub[last + 1] + i]; + for (i = first + 1; i <= last + 1; i++) + { + xlusup[i] -= r * (i - first); + xlsub[i] -= r; + } + if (lastc) + { + xlusup[last + 2] -= r * n; + xlsub[last + 2] -= r; + } + + *nnzLj += (m - r) * n; + return r; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpanel_dfs.c new file mode 100644 index 0000000..3f5a081 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpanel_dfs.c @@ -0,0 +1,248 @@ + +/*! @file ilu_zpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols and + * record the entries with maximum absolute value in each column + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel.
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ +void +ilu_zpanel_dfs( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + doublecomplex *dense, /* out */ + double *amax, /* out - max. abs. value of each column in panel */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ +) +{ + + NCPformat *Astore; + doublecomplex *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + doublecomplex *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + double *amax_col; + register double tmp; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + amax_col = amax; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + *amax_col = 0.0; + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + tmp = z_abs1(&a[k]); + if (tmp > *amax_col) *amax_col = tmp; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[xsup[supno[krep]]]; + maxdfs = xlsub[krep + 1]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xlsub[krep + 1]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + amax_col++; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpivotL.c new file mode 100644 index 0000000..dafea2b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zpivotL.c @@ -0,0 +1,274 @@ + +/*! @file ilu_zpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + + +#include +#include +#include "slu_zdefs.h" + +#ifndef SGN +#define SGN(x) ((x)>=0?1:-1) +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *	     pivot row = k;
    + *	 ELSE IF abs(A_jj) >= thresh THEN
    + *	     pivot row = j;
    + *	 ELSE
    + *	     pivot row = m;
    + *
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0	  success;
    + *		   i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +ilu_zpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by + * perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int diagind, /* diagonal of Pc*A*Pc' */ + int *swap, /* in/out record the row permutation */ + int *iswap, /* in/out inverse of swap, it is the same as + perm_r after the factorization */ + int *marker, /* in */ + int *pivrow, /* in/out, as an input if *usepr!=0 */ + double fill_tol, /* in - fill tolerance of current column + * used for a singular column */ + milu_t milu, /* in */ + doublecomplex drop_sum, /* in - computed in ilu_zcopy_to_ucol() + (MILU only) */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int n; /* number of columns */ + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + register int pivptr; + int old_pivptr, diag, ptr0; + register double pivmax, rtemp; + double thresh; + doublecomplex temp; + doublecomplex *lu_sup_ptr; + doublecomplex *lu_col_ptr; + int *lsub_ptr; + register int isub, icol, k, itemp; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + int info; + doublecomplex one = {1.0, 0.0}; + + /* Initialize pointers */ + n = Glu->n; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + pivmax = -1.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + ptr0 = EMPTY; + for (isub = nsupc; isub < nsupr; ++isub) { + if (marker[lsub_ptr[isub]] > jcol) + continue; /* do not overlap with a later relaxed supernode */ + + switch (milu) { + case SMILU_1: + z_add(&temp, &lu_col_ptr[isub], &drop_sum); + rtemp = z_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + /* In this case, drop_sum contains the sum of the abs. value */ + rtemp = z_abs1(&lu_col_ptr[isub]); + break; + case SILU: + default: + rtemp = z_abs1(&lu_col_ptr[isub]); + break; + } + if (rtemp > pivmax) { pivmax = rtemp; pivptr = isub; } + if (*usepr && lsub_ptr[isub] == *pivrow) old_pivptr = isub; + if (lsub_ptr[isub] == diagind) diag = isub; + if (ptr0 == EMPTY) ptr0 = isub; + } + + if (milu == SMILU_2 || milu == SMILU_3) pivmax += drop_sum.r; + + /* Test for singularity */ + if (pivmax < 0.0) { + fprintf(stderr, "[0]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + if ( pivmax == 0.0 ) { + if (diag != EMPTY) + *pivrow = lsub_ptr[pivptr = diag]; + else if (ptr0 != EMPTY) + *pivrow = lsub_ptr[pivptr = ptr0]; + else { + /* look for the first row which does not + belong to any later supernodes */ + for (icol = jcol; icol < n; icol++) + if (marker[swap[icol]] <= jcol) break; + if (icol >= n) { + fprintf(stderr, "[1]: jcol=%d, SINGULAR!!!\n", jcol); + fflush(stderr); + exit(1); + } + + *pivrow = swap[icol]; + + /* pick up the pivot row */ + for (isub = nsupc; isub < nsupr; ++isub) + if ( lsub_ptr[isub] == *pivrow ) { pivptr = isub; break; } + } + pivmax = fill_tol; + lu_col_ptr[pivptr].r = pivmax; + lu_col_ptr[pivptr].i = 0.0; + *usepr = 0; +#ifdef DEBUG + printf("[0] ZERO PIVOT: FILL (%d, %d).\n", *pivrow, jcol); + fflush(stdout); +#endif + info =jcol + 1; + } /* if (*pivrow == 0.0) */ + else { + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + switch (milu) { + case SMILU_1: + z_add(&temp, &lu_col_ptr[old_pivptr], &drop_sum); + rtemp = z_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + rtemp = z_abs1(&lu_col_ptr[old_pivptr]) + drop_sum.r; + break; + case SILU: + default: + rtemp = z_abs1(&lu_col_ptr[old_pivptr]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = old_pivptr; + else *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + switch (milu) { + case SMILU_1: + z_add(&temp, &lu_col_ptr[diag], &drop_sum); + rtemp = z_abs1(&temp); + break; + case SMILU_2: + case SMILU_3: + rtemp = z_abs1(&lu_col_ptr[diag]) + drop_sum.r; + break; + case SILU: + default: + rtemp = z_abs1(&lu_col_ptr[diag]); + break; + } + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + info = 0; + + /* Reset the diagonal */ + switch (milu) { + case SMILU_1: + z_add(&lu_col_ptr[pivptr], &lu_col_ptr[pivptr], &drop_sum); + break; + case SMILU_2: + case SMILU_3: + temp = z_sgn(&lu_col_ptr[pivptr]); + zz_mult(&temp, &temp, &drop_sum); + z_add(&lu_col_ptr[pivptr], &lu_col_ptr[pivptr], &drop_sum); + break; + case SILU: + default: + break; + } + + } /* else */ + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + if (jcol < n - 1) { + register int t1, t2, t; + t1 = iswap[*pivrow]; t2 = jcol; + if (t1 != t2) { + t = swap[t1]; swap[t1] = swap[t2]; swap[t2] = t; + t1 = swap[t1]; t2 = t; + t = iswap[t1]; iswap[t1] = iswap[t2]; iswap[t2] = t; + } + } /* if (jcol < n - 1) */ + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += 10 * (nsupr - nsupc); + z_div(&temp, &one, &lu_col_ptr[nsupc]); + for (k = nsupc+1; k < nsupr; k++) + zz_mult(&lu_col_ptr[k], &lu_col_ptr[k], &temp); + + return info; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zsnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zsnode_dfs.c new file mode 100644 index 0000000..e7a357d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ilu_zsnode_dfs.c @@ -0,0 +1,90 @@ + +/*! @file ilu_zsnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ilu_zsnode_dfs() - Determine the union of the row structures of those
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore,
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +ilu_zsnode_dfs( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, nextl; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) + { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) + { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) + { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) + { + if ( (mem_error = zLUMemXpand(jcol, nextl, LSUB, &nzlmax, + Glu)) != 0) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1 */ + if ( jcol < kcol ) + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xlsub[kcol+1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/izmax1.c b/thirdparty/superlu/SuperLU_4.1/SRC/izmax1.c new file mode 100644 index 0000000..d0154ab --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/izmax1.c @@ -0,0 +1,113 @@ +/*! @file izmax1.c + * \brief Finds the index of the element whose real part has maximum absolute value + * + *
    + *     -- LAPACK auxiliary routine (version 2.0) --   
    + *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *     Courant Institute, Argonne National Lab, and Rice University   
    + *     October 31, 1992   
    + * 
    + */ +#include +#include "slu_dcomplex.h" +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    IZMAX1 finds the index of the element whose real part has maximum   
    +    absolute value.   
    +
    +    Based on IZAMAX from Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.   
    +
    +    Contributed by Nick Higham for use with ZLACON.   
    +
    +    Arguments   
    +    =========   
    +
    +    N       (input) INT   
    +            The number of elements in the vector CX.   
    +
    +    CX      (input) COMPLEX*16 array, dimension (N)   
    +            The vector whose elements will be summed.   
    +
    +    INCX    (input) INT   
    +            The spacing between successive values of CX.  INCX >= 1.   
    +
    +   ===================================================================== 
    +
    +*/ + +int +izmax1_(int *n, doublecomplex *cx, int *incx) +{ + + + /* System generated locals */ + int ret_val, i__1, i__2; + double d__1; + + /* Local variables */ + double smax; + int i, ix; + +#define CX(I) cx[(I)-1] + + ret_val = 0; + if (*n < 1) { + return ret_val; + } + ret_val = 1; + if (*n == 1) { + return ret_val; + } + if (*incx == 1) { + goto L30; + } + +/* CODE FOR INCREMENT NOT EQUAL TO 1 */ + + ix = 1; + smax = (d__1 = CX(1).r, fabs(d__1)); + ix += *incx; + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = ix; + if ((d__1 = CX(ix).r, fabs(d__1)) <= smax) { + goto L10; + } + ret_val = i; + i__2 = ix; + smax = (d__1 = CX(ix).r, fabs(d__1)); +L10: + ix += *incx; +/* L20: */ + } + return ret_val; + +/* CODE FOR INCREMENT EQUAL TO 1 */ + +L30: + smax = (d__1 = CX(1).r, fabs(d__1)); + i__1 = *n; + for (i = 2; i <= *n; ++i) { + i__2 = i; + if ((d__1 = CX(i).r, fabs(d__1)) <= smax) { + goto L40; + } + ret_val = i; + i__2 = i; + smax = (d__1 = CX(i).r, fabs(d__1)); +L40: + ; + } + return ret_val; + +/* End of IZMAX1 */ + +} /* izmax1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/lsame.c b/thirdparty/superlu/SuperLU_4.1/SRC/lsame.c new file mode 100644 index 0000000..073a551 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/lsame.c @@ -0,0 +1,83 @@ +/*! @file lsame.c + * \brief Check if CA is the same letter as CB regardless of case. + * + *
    + * -- LAPACK auxiliary routine (version 2.0) --   
    + *      Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *      Courant Institute, Argonne National Lab, and Rice University   
    + *      September 30, 1994   
    + * 
    + */ +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    LSAME returns .TRUE. if CA is the same letter as CB regardless of case.   
    +
    +    Arguments   
    +    =========   
    +
    +    CA      (input) CHARACTER*1   
    +    CB      (input) CHARACTER*1   
    +            CA and CB specify the single characters to be compared.   
    +
    +   ===================================================================== 
    +
    +*/ + +int lsame_(char *ca, char *cb) +{ + + + /* System generated locals */ + int ret_val; + + /* Local variables */ + int inta, intb, zcode; + + ret_val = *(unsigned char *)ca == *(unsigned char *)cb; + if (ret_val) { + return ret_val; + } + + /* Now test for equivalence if both characters are alphabetic. */ + + zcode = 'Z'; + + /* Use 'Z' rather than 'A' so that ASCII can be detected on Prime + machines, on which ICHAR returns a value with bit 8 set. + ICHAR('A') on Prime machines returns 193 which is the same as + ICHAR('A') on an EBCDIC machine. */ + + inta = *(unsigned char *)ca; + intb = *(unsigned char *)cb; + + if (zcode == 90 || zcode == 122) { + /* ASCII is assumed - ZCODE is the ASCII code of either lower or + upper case 'Z'. */ + if (inta >= 97 && inta <= 122) inta += -32; + if (intb >= 97 && intb <= 122) intb += -32; + + } else if (zcode == 233 || zcode == 169) { + /* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or + upper case 'Z'. */ + if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta + >= 162 && inta <= 169) + inta += 64; + if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb + >= 162 && intb <= 169) + intb += 64; + } else if (zcode == 218 || zcode == 250) { + /* ASCII is assumed, on Prime machines - ZCODE is the ASCII code + plus 128 of either lower or upper case 'Z'. */ + if (inta >= 225 && inta <= 250) inta += -32; + if (intb >= 225 && intb <= 250) intb += -32; + } + ret_val = inta == intb; + return ret_val; + +} /* lsame_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/mark_relax.c b/thirdparty/superlu/SuperLU_4.1/SRC/mark_relax.c new file mode 100644 index 0000000..b2338aa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/mark_relax.c @@ -0,0 +1,47 @@ +/*! @file mark_relax.c + * \brief Record the rows pivoted by the relaxed supernodes. + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 1, 2009
    + * <\pre>
    + */
    +#include "slu_ddefs.h"
    +
    +/*! \brief
    + *
    + * 
    + * Purpose
    + * =======
    + *    mark_relax() - record the rows used by the relaxed supernodes.
    + * 
    + */ +int mark_relax( + int n, /* order of the matrix A */ + int *relax_end, /* last column in a relaxed supernode. + * if j-th column starts a relaxed supernode, + * relax_end[j] represents the last column of + * this supernode. */ + int *relax_fsupc, /* first column in a relaxed supernode. + * relax_fsupc[j] represents the first column of + * j-th supernode. */ + int *xa_begin, /* Astore->colbeg */ + int *xa_end, /* Astore->colend */ + int *asub, /* row index of A */ + int *marker /* marker[j] is the maximum column index if j-th + * row belongs to a relaxed supernode. */ ) +{ + register int jcol, kcol; + register int i, j, k; + + for (i = 0; i < n && relax_fsupc[i] != EMPTY; i++) + { + jcol = relax_fsupc[i]; /* first column */ + kcol = relax_end[jcol]; /* last column */ + for (j = jcol; j <= kcol; j++) + for (k = xa_begin[j]; k < xa_end[j]; k++) + marker[asub[k]] = jcol; + } + return i; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/mc21.f b/thirdparty/superlu/SuperLU_4.1/SRC/mc21.f new file mode 100644 index 0000000..6e26a0f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/mc21.f @@ -0,0 +1,143 @@ +*######DATE 8 Oct 1992 COPYRIGHT Rutherford Appleton Laboratory +C######8/10/92 Toolpack tool decs employed. +C######8/10/92 D version created by name change only. + SUBROUTINE MC21AD(N,ICN,LICN,IP,LENR,IPERM,NUMNZ,IW) +C .. Scalar Arguments .. + INTEGER LICN,N,NUMNZ +C .. +C .. Array Arguments .. + INTEGER ICN(LICN),IP(N),IPERM(N),IW(N,4),LENR(N) +C .. +C .. External Subroutines .. + EXTERNAL MC21BD +C .. +C .. Executable Statements .. + CALL MC21BD(N,ICN,LICN,IP,LENR,IPERM,NUMNZ,IW(1,1),IW(1,2), + + IW(1,3),IW(1,4)) + RETURN +C + END + SUBROUTINE MC21BD(N,ICN,LICN,IP,LENR,IPERM,NUMNZ,PR,ARP,CV,OUT) +C PR(I) IS THE PREVIOUS ROW TO I IN THE DEPTH FIRST SEARCH. +C IT IS USED AS A WORK ARRAY IN THE SORTING ALGORITHM. +C ELEMENTS (IPERM(I),I) I=1, ... N ARE NON-ZERO AT THE END OF THE +C ALGORITHM UNLESS N ASSIGNMENTS HAVE NOT BEEN MADE. IN WHICH CASE +C (IPERM(I),I) WILL BE ZERO FOR N-NUMNZ ENTRIES. +C CV(I) IS THE MOST RECENT ROW EXTENSION AT WHICH COLUMN I +C WAS VISITED. +C ARP(I) IS ONE LESS THAN THE NUMBER OF NON-ZEROS IN ROW I +C WHICH HAVE NOT BEEN SCANNED WHEN LOOKING FOR A CHEAP ASSIGNMENT. +C OUT(I) IS ONE LESS THAN THE NUMBER OF NON-ZEROS IN ROW I +C WHICH HAVE NOT BEEN SCANNED DURING ONE PASS THROUGH THE MAIN LOOP. +C +C INITIALIZATION OF ARRAYS. +C .. Scalar Arguments .. + INTEGER LICN,N,NUMNZ +C .. +C .. Array Arguments .. + INTEGER ARP(N),CV(N),ICN(LICN),IP(N),IPERM(N),LENR(N),OUT(N),PR(N) +C .. +C .. Local Scalars .. + INTEGER I,II,IN1,IN2,IOUTK,J,J1,JORD,K,KK +C .. +C .. Executable Statements .. + DO 10 I = 1,N + ARP(I) = LENR(I) - 1 + CV(I) = 0 + IPERM(I) = 0 + 10 CONTINUE + NUMNZ = 0 +C +C +C MAIN LOOP. +C EACH PASS ROUND THIS LOOP EITHER RESULTS IN A NEW ASSIGNMENT +C OR GIVES A ROW WITH NO ASSIGNMENT. + DO 100 JORD = 1,N + J = JORD + PR(J) = -1 + DO 70 K = 1,JORD +C LOOK FOR A CHEAP ASSIGNMENT + IN1 = ARP(J) + IF (IN1.LT.0) GO TO 30 + IN2 = IP(J) + LENR(J) - 1 + IN1 = IN2 - IN1 + DO 20 II = IN1,IN2 + I = ICN(II) + IF (IPERM(I).EQ.0) GO TO 80 + 20 CONTINUE +C NO CHEAP ASSIGNMENT IN ROW. + ARP(J) = -1 +C BEGIN LOOKING FOR ASSIGNMENT CHAIN STARTING WITH ROW J. + 30 CONTINUE + OUT(J) = LENR(J) - 1 +C INNER LOOP. EXTENDS CHAIN BY ONE OR BACKTRACKS. + DO 60 KK = 1,JORD + IN1 = OUT(J) + IF (IN1.LT.0) GO TO 50 + IN2 = IP(J) + LENR(J) - 1 + IN1 = IN2 - IN1 +C FORWARD SCAN. + DO 40 II = IN1,IN2 + I = ICN(II) + IF (CV(I).EQ.JORD) GO TO 40 +C COLUMN I HAS NOT YET BEEN ACCESSED DURING THIS PASS. + J1 = J + J = IPERM(I) + CV(I) = JORD + PR(J) = J1 + OUT(J1) = IN2 - II - 1 + GO TO 70 +C + 40 CONTINUE +C +C BACKTRACKING STEP. + 50 CONTINUE + J = PR(J) + IF (J.EQ.-1) GO TO 100 + 60 CONTINUE +C + 70 CONTINUE +C +C NEW ASSIGNMENT IS MADE. + 80 CONTINUE + IPERM(I) = J + ARP(J) = IN2 - II - 1 + NUMNZ = NUMNZ + 1 + DO 90 K = 1,JORD + J = PR(J) + IF (J.EQ.-1) GO TO 100 + II = IP(J) + LENR(J) - OUT(J) - 2 + I = ICN(II) + IPERM(I) = J + 90 CONTINUE +C + 100 CONTINUE +C +C IF MATRIX IS STRUCTURALLY SINGULAR, WE NOW COMPLETE THE +C PERMUTATION IPERM. + IF (NUMNZ.EQ.N) RETURN + DO 110 I = 1,N + ARP(I) = 0 + 110 CONTINUE + K = 0 + DO 130 I = 1,N + IF (IPERM(I).NE.0) GO TO 120 + K = K + 1 + OUT(K) = I + GO TO 130 +C + 120 CONTINUE + J = IPERM(I) + ARP(J) = I + 130 CONTINUE + K = 0 + DO 140 I = 1,N + IF (ARP(I).NE.0) GO TO 140 + K = K + 1 + IOUTK = OUT(K) + IPERM(IOUTK) = I + 140 CONTINUE + RETURN +C + END + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.c b/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.c new file mode 100644 index 0000000..5d7600d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.c @@ -0,0 +1,2641 @@ +/* mc64ad.f -- translated by f2c (version 20100827). + You must link the resulting object file with libf2c: + on Microsoft Windows system, link with libf2c.lib; + on Linux or Unix systems, link with .../path/to/libf2c.a -lm + or, if you install libf2c.a in a standard place, with -lf2c -lm + -- in that order, at the end of the command line, as in + cc *.o -lf2c -lm + Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., + + http://www.netlib.org/f2c/libf2c.zip +*/ + +#include "slu_ddefs.h" + +#define abs(a) ((a) >= 0) ? (a) : -(a) +#define min(a,b) ((a) < (b)) ? (a) : (b) + +/* Table of constant values */ + +static int_t c__1 = 1; +static int_t c__2 = 2; + +/* CCCC COPYRIGHT (c) 1999 Council for the Central Laboratory of the */ +/* CCCC Research Councils. All rights reserved. */ +/* CCCC PACKAGE MC64A/AD */ +/* CCCC AUTHORS Iain Duff (i.duff@rl.ac.uk) and Jacko Koster (jak@ii.uib.no) */ +/* CCCC LAST UPDATE 20/09/99 */ +/* CCCC */ +/* *** Conditions on external use *** */ + +/* The user shall acknowledge the contribution of this */ +/* package in any publication of material dependent upon the use of */ +/* the package. The user shall use reasonable endeavours to notify */ +/* the authors of the package of this publication. */ + +/* The user can modify this code but, at no time */ +/* shall the right or title to all or any part of this package pass */ +/* to the user. The user shall make available free of charge */ +/* to the authors for any purpose all information relating to any */ +/* alteration or addition made to this package for the purposes of */ +/* extending the capabilities or enhancing the performance of this */ +/* package. */ + +/* The user shall not pass this code directly to a third party without the */ +/* express prior consent of the authors. Users wanting to licence their */ +/* own copy of these routines should send email to hsl@aeat.co.uk */ + +/* None of the comments from the Copyright notice up to and including this */ +/* one shall be removed or altered in any way. */ +/* ********************************************************************** */ +/* Subroutine */ int_t mc64id_(int_t *icntl) +{ + int_t i__; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* Purpose */ +/* ======= */ + +/* The components of the array ICNTL control the action of MC64A/AD. */ +/* Default values for these are set in this subroutine. */ + +/* Parameters */ +/* ========== */ + + +/* Local variables */ + +/* ICNTL(1) has default value 6. */ +/* It is the output stream for error messages. If it */ +/* is negative, these messages will be suppressed. */ + +/* ICNTL(2) has default value 6. */ +/* It is the output stream for warning messages. */ +/* If it is negative, these messages are suppressed. */ + +/* ICNTL(3) has default value -1. */ +/* It is the output stream for monitoring printing. */ +/* If it is negative, these messages are suppressed. */ + +/* ICNTL(4) has default value 0. */ +/* If left at the defaut value, the incoming data is checked for */ +/* out-of-range indices and duplicates. Setting ICNTL(4) to any */ +/* other will avoid the checks but is likely to cause problems */ +/* later if out-of-range indices or duplicates are present. */ +/* The user should only set ICNTL(4) non-zero, if the data is */ +/* known to avoid these problems. */ + +/* ICNTL(5) to ICNTL(10) are not used by MC64A/AD but are set to */ +/* zero in this routine. */ +/* Initialization of the ICNTL array. */ + /* Parameter adjustments */ + --icntl; + + /* Function Body */ + icntl[1] = 6; + icntl[2] = 6; + icntl[3] = -1; + for (i__ = 4; i__ <= 10; ++i__) { + icntl[i__] = 0; +/* L10: */ + } + return 0; +} /* mc64id_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64ad_(int_t *job, int_t *n, int_t *ne, int_t * + ip, int_t *irn, double *a, int_t *num, int_t *cperm, + int_t *liw, int_t *iw, int_t *ldw, double *dw, int_t * + icntl, int_t *info) +{ + /* System generated locals */ + int_t i__1, i__2; + double d__1, d__2; + + /* Builtin functions */ + double log(double); + + /* Local variables */ + int_t i__, j, k; + double fact, rinf; + + extern /* Subroutine */ int_t mc21ad_(int_t *, int_t *, int_t *, + int_t *, int_t *, int_t *, int_t *, int_t *), mc64bd_( + int_t *, int_t *, int_t *, int_t *, double *, int_t + *, int_t *, int_t *, int_t *, int_t *, int_t *, + double *), mc64rd_(int_t *, int_t *, int_t *, int_t *, + double *), mc64sd_(int_t *, int_t *, int_t *, int_t * + , double *, int_t *, int_t *, int_t *, int_t *, + int_t *, int_t *, int_t *, int_t *, int_t *), mc64wd_( + int_t *, int_t *, int_t *, int_t *, double *, int_t + *, int_t *, int_t *, int_t *, int_t *, int_t *, int_t + *, double *, double *); + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* Purpose */ +/* ======= */ + +/* This subroutine attempts to find a column permutation for an NxN */ +/* sparse matrix A = {a_ij} that makes the permuted matrix have N */ +/* entries on its diagonal. */ +/* If the matrix is structurally nonsingular, the subroutine optionally */ +/* returns a column permutation that maximizes the smallest element */ +/* on the diagonal, maximizes the sum of the diagonal entries, or */ +/* maximizes the product of the diagonal entries of the permuted matrix. */ +/* For the latter option, the subroutine also finds scaling factors */ +/* that may be used to scale the matrix so that the nonzero diagonal */ +/* entries of the permuted matrix are one in absolute value and all the */ +/* off-diagonal entries are less than or equal to one in absolute value. */ +/* The natural logarithms of the scaling factors u(i), i=1..N, for the */ +/* rows and v(j), j=1..N, for the columns are returned so that the */ +/* scaled matrix B = {b_ij} has entries b_ij = a_ij * EXP(u_i + v_j). */ + +/* Parameters */ +/* ========== */ + + +/* JOB is an INT_T variable which must be set by the user to */ +/* control the action. It is not altered by the subroutine. */ +/* Possible values for JOB are: */ +/* 1 Compute a column permutation of the matrix so that the */ +/* permuted matrix has as many entries on its diagonal as possible. */ +/* The values on the diagonal are of arbitrary size. HSL subroutine */ +/* MC21A/AD is used for this. See [1]. */ +/* 2 Compute a column permutation of the matrix so that the smallest */ +/* value on the diagonal of the permuted matrix is maximized. */ +/* See [3]. */ +/* 3 Compute a column permutation of the matrix so that the smallest */ +/* value on the diagonal of the permuted matrix is maximized. */ +/* The algorithm differs from the one used for JOB = 2 and may */ +/* have quite a different performance. See [2]. */ +/* 4 Compute a column permutation of the matrix so that the sum */ +/* of the diagonal entries of the permuted matrix is maximized. */ +/* See [3]. */ +/* 5 Compute a column permutation of the matrix so that the product */ +/* of the diagonal entries of the permuted matrix is maximized */ +/* and vectors to scale the matrix so that the nonzero diagonal */ +/* entries of the permuted matrix are one in absolute value and */ +/* all the off-diagonal entries are less than or equal to one in */ +/* absolute value. See [3]. */ +/* Restriction: 1 <= JOB <= 5. */ + +/* N is an INT_T variable which must be set by the user to the */ +/* order of the matrix A. It is not altered by the subroutine. */ +/* Restriction: N >= 1. */ + +/* NE is an INT_T variable which must be set by the user to the */ +/* number of entries in the matrix. It is not altered by the */ +/* subroutine. */ +/* Restriction: NE >= 1. */ + +/* IP is an INT_T array of length N+1. */ +/* IP(J), J=1..N, must be set by the user to the position in array IRN */ +/* of the first row index of an entry in column J. IP(N+1) must be set */ +/* to NE+1. It is not altered by the subroutine. */ + +/* IRN is an INT_T array of length NE. */ +/* IRN(K), K=1..NE, must be set by the user to hold the row indices of */ +/* the entries of the matrix. Those belonging to column J must be */ +/* stored contiguously in the positions IP(J)..IP(J+1)-1. The ordering */ +/* of the row indices within each column is unimportant. Repeated */ +/* entries are not allowed. The array IRN is not altered by the */ +/* subroutine. */ + +/* A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. */ +/* The user must set A(K), K=1..NE, to the numerical value of the */ +/* entry that corresponds to IRN(K). */ +/* It is not used by the subroutine when JOB = 1. */ +/* It is not altered by the subroutine. */ + +/* NUM is an INT_T variable that need not be set by the user. */ +/* On successful exit, NUM will be the number of entries on the */ +/* diagonal of the permuted matrix. */ +/* If NUM < N, the matrix is structurally singular. */ + +/* CPERM is an INT_T array of length N that need not be set by the */ +/* user. On successful exit, CPERM contains the column permutation. */ +/* Column CPERM(J) of the original matrix is column J in the permuted */ +/* matrix, J=1..N. */ + +/* LIW is an INT_T variable that must be set by the user to */ +/* the dimension of array IW. It is not altered by the subroutine. */ +/* Restriction: */ +/* JOB = 1 : LIW >= 5N */ +/* JOB = 2 : LIW >= 4N */ +/* JOB = 3 : LIW >= 10N + NE */ +/* JOB = 4 : LIW >= 5N */ +/* JOB = 5 : LIW >= 5N */ + +/* IW is an INT_T array of length LIW that is used for workspace. */ + +/* LDW is an INT_T variable that must be set by the user to the */ +/* dimension of array DW. It is not altered by the subroutine. */ +/* Restriction: */ +/* JOB = 1 : LDW is not used */ +/* JOB = 2 : LDW >= N */ +/* JOB = 3 : LDW >= NE */ +/* JOB = 4 : LDW >= 2N + NE */ +/* JOB = 5 : LDW >= 3N + NE */ + +/* DW is a REAL (DOUBLE PRECISION in the D-version) array of length LDW */ +/* that is used for workspace. If JOB = 5, on return, */ +/* DW(i) contains u_i, i=1..N, and DW(N+j) contains v_j, j=1..N. */ + +/* ICNTL is an INT_T array of length 10. Its components control the */ +/* output of MC64A/AD and must be set by the user before calling */ +/* MC64A/AD. They are not altered by the subroutine. */ + +/* ICNTL(1) must be set to specify the output stream for */ +/* error messages. If ICNTL(1) < 0, messages are suppressed. */ +/* The default value set by MC46I/ID is 6. */ + +/* ICNTL(2) must be set by the user to specify the output stream for */ +/* warning messages. If ICNTL(2) < 0, messages are suppressed. */ +/* The default value set by MC46I/ID is 6. */ + +/* ICNTL(3) must be set by the user to specify the output stream for */ +/* diagnostic messages. If ICNTL(3) < 0, messages are suppressed. */ +/* The default value set by MC46I/ID is -1. */ + +/* ICNTL(4) must be set by the user to a value other than 0 to avoid */ +/* checking of the input data. */ +/* The default value set by MC46I/ID is 0. */ + +/* INFO is an INT_T array of length 10 which need not be set by the */ +/* user. INFO(1) is set non-negative to indicate success. A negative */ +/* value is returned if an error occurred, a positive value if a */ +/* warning occurred. INFO(2) holds further information on the error. */ +/* On exit from the subroutine, INFO(1) will take one of the */ +/* following values: */ +/* 0 : successful entry (for structurally nonsingular matrix). */ +/* +1 : successful entry (for structurally singular matrix). */ +/* +2 : the returned scaling factors are large and may cause */ +/* overflow when used to scale the matrix. */ +/* (For JOB = 5 entry only.) */ +/* -1 : JOB < 1 or JOB > 5. Value of JOB held in INFO(2). */ +/* -2 : N < 1. Value of N held in INFO(2). */ +/* -3 : NE < 1. Value of NE held in INFO(2). */ +/* -4 : the defined length LIW violates the restriction on LIW. */ +/* Value of LIW required given by INFO(2). */ +/* -5 : the defined length LDW violates the restriction on LDW. */ +/* Value of LDW required given by INFO(2). */ +/* -6 : entries are found whose row indices are out of range. INFO(2) */ +/* contains the index of a column in which such an entry is found. */ +/* -7 : repeated entries are found. INFO(2) contains the index of a */ +/* column in which such entries are found. */ +/* INFO(3) to INFO(10) are not currently used and are set to zero by */ +/* the routine. */ + +/* References: */ +/* [1] I. S. Duff, (1981), */ +/* "Algorithm 575. Permutations for a zero-free diagonal", */ +/* ACM Trans. Math. Software 7(3), 387-390. */ +/* [2] I. S. Duff and J. Koster, (1998), */ +/* "The design and use of algorithms for permuting large */ +/* entries to the diagonal of sparse matrices", */ +/* SIAM J. Matrix Anal. Appl., vol. 20, no. 4, pp. 889-901. */ +/* [3] I. S. Duff and J. Koster, (1999), */ +/* "On algorithms for permuting large entries to the diagonal */ +/* of sparse matrices", */ +/* Technical Report RAL-TR-1999-030, RAL, Oxfordshire, England. */ +/* Local variables and parameters */ +/* External routines and functions */ +/* EXTERNAL FD05AD */ +/* DOUBLE PRECISION FD05AD */ +/* Intrinsic functions */ +/* Set RINF to largest positive real number (infinity) */ +/* XSL RINF = FD05AD(5) */ + /* Parameter adjustments */ + --cperm; + --ip; + --a; + --irn; + --iw; + --dw; + --icntl; + --info; + + /* Function Body */ + rinf = dlamch_("Overflow"); +/* Check value of JOB */ + if (*job < 1 || *job > 5) { + info[1] = -1; + info[2] = *job; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " because JOB = %d\n", *job); + } + goto L99; + } +/* Check value of N */ + if (*n < 1) { + info[1] = -2; + info[2] = *n; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " because N = %d\n", *job); + } + goto L99; + } +/* Check value of NE */ + if (*ne < 1) { + info[1] = -3; + info[2] = *ne; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " because NE = %d\n", *job); + } + goto L99; + } +/* Check LIW */ + if (*job == 1) { + k = *n * 5; + } + if (*job == 2) { + k = *n << 2; + } + if (*job == 3) { + k = *n * 10 + *ne; + } + if (*job == 4) { + k = *n * 5; + } + if (*job == 5) { + k = *n * 5; + } + if (*liw < k) { + info[1] = -4; + info[2] = k; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " LIW too small, must be at least %8d\n", k); + } + goto L99; + } +/* Check LDW */ +/* If JOB = 1, do not check */ + if (*job > 1) { + if (*job == 2) { + k = *n; + } + if (*job == 3) { + k = *ne; + } + if (*job == 4) { + k = (*n << 1) + *ne; + } + if (*job == 5) { + k = *n * 3 + *ne; + } + if (*ldw < k) { + info[1] = -5; + info[2] = k; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " LDW too small, must be at least %8d\n", k); + } + goto L99; + } + } + if (icntl[4] == 0) { +/* Check row indices. Use IW(1:N) as workspace */ + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + iw[i__] = 0; +/* L3: */ + } + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; +/* Check for row indices that are out of range */ + if (i__ < 1 || i__ > *n) { + info[1] = -6; + info[2] = j; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", + info[1], " Column %8d", j, + " contains an entry with invalid row index %8d\n", i__); + } + goto L99; + } +/* Check for repeated row indices within a column */ + if (iw[i__] == j) { + info[1] = -7; + info[2] = j; + if (icntl[1] >= 0) { + printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], + " Column %8d", j, + " contains two or more entries with row index %8d\n", i__); + } + goto L99; + } else { + iw[i__] = j; + } +/* L4: */ + } +/* L6: */ + } + } +/* Print diagnostics on input */ + if (icntl[3] >= 0) { + printf(" ****** Input parameters for MC64A/AD: JOB = %8d," + " N = %d, NE = %8d\n", *job, *n, *ne); + printf(" IP(1:N+1) = "); + for (j=1; j<=(*n+1); ++j) { + printf("%8d", ip[j]); + if (j%8 == 0) printf("\n"); + } + printf("\n IRN(1:NE) = "); + for (j=1; j<=(*ne); ++j) { + printf("%8d", irn[j]); + if (j%8 == 0) printf("\n"); + } + printf("\n"); + + if (*job > 1) { + printf(" A(1:NE) = "); + for (j=1; j<=(*ne); ++j) { + printf("%f14.4", a[j]); + if (j%4 == 0) printf("\n"); + } + printf("\n"); + } + } +/* Set components of INFO to zero */ + for (i__ = 1; i__ <= 10; ++i__) { + info[i__] = 0; +/* L8: */ + } +/* Compute maximum matching with MC21A/AD */ + if (*job == 1) { +/* Put length of column J in IW(J) */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + iw[j] = ip[j + 1] - ip[j]; +/* L10: */ + } +/* IW(N+1:5N) is workspace */ +#if 0 + mc21ad_(n, &irn[1], ne, &ip[1], &iw[1], &cperm[1], num, &iw[*n+1]); +#else + printf(" ****** Warning from MC64A/AD. Need to link mc21ad.\n"); +#endif + goto L90; + } +/* Compute bottleneck matching */ + if (*job == 2) { +/* IW(1:5N), DW(1:N) are workspaces */ + mc64bd_(n, ne, &ip[1], &irn[1], &a[1], &cperm[1], num, &iw[1], &iw[*n + + 1], &iw[(*n << 1) + 1], &iw[*n * 3 + 1], &dw[1]); + goto L90; + } +/* Compute bottleneck matching */ + if (*job == 3) { +/* Copy IRN(K) into IW(K), ABS(A(K)) into DW(K), K=1..NE */ + i__1 = *ne; + for (k = 1; k <= i__1; ++k) { + iw[k] = irn[k]; + dw[k] = (d__1 = a[k], abs(d__1)); +/* L20: */ + } +/* Sort entries in each column by decreasing value. */ + mc64rd_(n, ne, &ip[1], &iw[1], &dw[1]); +/* IW(NE+1:NE+10N) is workspace */ + mc64sd_(n, ne, &ip[1], &iw[1], &dw[1], &cperm[1], num, &iw[*ne + 1], & + iw[*ne + *n + 1], &iw[*ne + (*n << 1) + 1], &iw[*ne + *n * 3 + + 1], &iw[*ne + (*n << 2) + 1], &iw[*ne + *n * 5 + 1], &iw[* + ne + *n * 6 + 1]); + goto L90; + } + if (*job == 4) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + fact = 0.; + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + if ((d__1 = a[k], abs(d__1)) > fact) { + fact = (d__2 = a[k], abs(d__2)); + } +/* L30: */ + } + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + dw[(*n << 1) + k] = fact - (d__1 = a[k], abs(d__1)); +/* L40: */ + } +/* L50: */ + } +/* B = DW(2N+1:2N+NE); IW(1:5N) and DW(1:2N) are workspaces */ + mc64wd_(n, ne, &ip[1], &irn[1], &dw[(*n << 1) + 1], &cperm[1], num, & + iw[1], &iw[*n + 1], &iw[(*n << 1) + 1], &iw[*n * 3 + 1], &iw[( + *n << 2) + 1], &dw[1], &dw[*n + 1]); + goto L90; + } + if (*job == 5) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + fact = 0.; + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + dw[*n * 3 + k] = (d__1 = a[k], abs(d__1)); + if (dw[*n * 3 + k] > fact) { + fact = dw[*n * 3 + k]; + } +/* L60: */ + } + dw[(*n << 1) + j] = fact; + if (fact != 0.) { + fact = log(fact); + } else { + fact = rinf / *n; + } + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + if (dw[*n * 3 + k] != 0.) { + dw[*n * 3 + k] = fact - log(dw[*n * 3 + k]); + } else { + dw[*n * 3 + k] = rinf / *n; + } +/* L70: */ + } +/* L75: */ + } +/* B = DW(3N+1:3N+NE); IW(1:5N) and DW(1:2N) are workspaces */ + mc64wd_(n, ne, &ip[1], &irn[1], &dw[*n * 3 + 1], &cperm[1], num, &iw[ + 1], &iw[*n + 1], &iw[(*n << 1) + 1], &iw[*n * 3 + 1], &iw[(*n + << 2) + 1], &dw[1], &dw[*n + 1]); + if (*num == *n) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (dw[(*n << 1) + j] != 0.) { + dw[*n + j] -= log(dw[(*n << 1) + j]); + } else { + dw[*n + j] = 0.; + } +/* L80: */ + } + } +/* Check size of scaling factors */ + fact = log(rinf) * .5f; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (dw[j] < fact && dw[*n + j] < fact) { + goto L86; + } + info[1] = 2; + goto L90; +L86: + ; + } +/* GO TO 90 */ + } +L90: + if (info[1] == 0 && *num < *n) { +/* Matrix is structurally singular, return with warning */ + info[1] = 1; + if (icntl[2] >= 0) { + printf(" ****** Warning from MC64A/AD. INFO(1) = %2d", info[1], + " The matrix is structurally singular.\n"); + } + } + if (info[1] == 2) { +/* Scaling factors are large, return with warning */ + if (icntl[2] >= 0) { + printf(" ****** Warning from MC64A/AD. INFO(1) = %2d\n", info[1], + " Some scaling factors may be too large.\n"); + } + } +/* Print diagnostics on output */ + if (icntl[3] >= 0) { + printf(" ****** Output parameters for MC64A/AD: INFO(1:2) = %8d%8d\n", + info[1], info[2]); + printf(" NUM = ", *num); + printf(" CPERM(1:N) = "); + for (j=1; j<=*n; ++j) { + printf("%8d", cperm[j]); + if (j%8 == 0) printf("\n"); + } + if (*job == 5) { + printf("\n DW(1:N) = "); + for (j=1; j<=*n; ++j) { + printf("%11.3f", dw[j]); + if (j%5 == 0) printf("\n"); + } + printf("\n DW(N+1:2N) = "); + for (j=1; j<=*n; ++j) { + printf("%11.3f", dw[*n+j]); + if (j%5 == 0) printf("\n"); + } + printf("\n"); + } + } +/* Return from subroutine. */ +L99: + return 0; +} /* mc64ad_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64bd_(int_t *n, int_t *ne, int_t *ip, int_t * + irn, double *a, int_t *iperm, int_t *num, int_t *jperm, + int_t *pr, int_t *q, int_t *l, double *d__) +{ + /* System generated locals */ + int_t i__1, i__2, i__3; + double d__1, d__2, d__3; + + /* Local variables */ + int_t i__, j, k; + double a0; + int_t i0, q0; + double ai, di; + int_t ii, jj, kk; + double bv; + int_t up; + double dq0; + int_t kk1, kk2; + double csp; + int_t isp, jsp, low; + double dnew; + int_t jord, qlen, idum, jdum; + double rinf; + extern /* Subroutine */ int_t mc64dd_(int_t *, int_t *, int_t *, + double *, int_t *, int_t *), mc64ed_(int_t *, int_t *, + int_t *, double *, int_t *, int_t *), mc64fd_(int_t * + , int_t *, int_t *, int_t *, double *, int_t *, int_t *); + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* N, NE, IP, IRN are described in MC64A/AD. */ +/* A is a REAL (DOUBLE PRECISION in the D-version) array of length */ +/* NE. A(K), K=1..NE, must be set to the value of the entry */ +/* that corresponds to IRN(K). It is not altered. */ +/* IPERM is an INT_T array of length N. On exit, it contains the */ +/* matching: IPERM(I) = 0 or row I is matched to column IPERM(I). */ +/* NUM is INT_T variable. On exit, it contains the cardinality of the */ +/* matching stored in IPERM. */ +/* IW is an INT_T work array of length 4N. */ +/* DW is a REAL (DOUBLE PRECISION in D-version) work array of length N. */ +/* Local variables */ +/* Local parameters */ +/* Intrinsic functions */ +/* External subroutines and/or functions */ +/* EXTERNAL FD05AD,MC64DD,MC64ED,MC64FD, DLAMCH */ +/* DOUBLE PRECISION FD05AD, DLAMCH */ +/* Set RINF to largest positive real number */ +/* XSL RINF = FD05AD(5) */ + /* Parameter adjustments */ + --d__; + --l; + --q; + --pr; + --jperm; + --iperm; + --ip; + --a; + --irn; + + /* Function Body */ + rinf = dlamch_("Overflow"); +/* Initialization */ + *num = 0; + bv = rinf; + i__1 = *n; + for (k = 1; k <= i__1; ++k) { + iperm[k] = 0; + jperm[k] = 0; + pr[k] = ip[k]; + d__[k] = 0.; +/* L10: */ + } +/* Scan columns of matrix; */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + a0 = -1.; + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; + ai = (d__1 = a[k], abs(d__1)); + if (ai > d__[i__]) { + d__[i__] = ai; + } + if (jperm[j] != 0) { + goto L30; + } + if (ai >= bv) { + a0 = bv; + if (iperm[i__] != 0) { + goto L30; + } + jperm[j] = i__; + iperm[i__] = j; + ++(*num); + } else { + if (ai <= a0) { + goto L30; + } + a0 = ai; + i0 = i__; + } +L30: + ; + } + if (a0 != -1. && a0 < bv) { + bv = a0; + if (iperm[i0] != 0) { + goto L20; + } + iperm[i0] = j; + jperm[j] = i0; + ++(*num); + } +L20: + ; + } +/* Update BV with smallest of all the largest maximum absolute values */ +/* of the rows. */ + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { +/* Computing MIN */ + d__1 = bv, d__2 = d__[i__]; + bv = min(d__1,d__2); +/* L25: */ + } + if (*num == *n) { + goto L1000; + } +/* Rescan unassigned columns; improve initial assignment */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (jperm[j] != 0) { + goto L95; + } + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; + ai = (d__1 = a[k], abs(d__1)); + if (ai < bv) { + goto L50; + } + if (iperm[i__] == 0) { + goto L90; + } + jj = iperm[i__]; + kk1 = pr[jj]; + kk2 = ip[jj + 1] - 1; + if (kk1 > kk2) { + goto L50; + } + i__3 = kk2; + for (kk = kk1; kk <= i__3; ++kk) { + ii = irn[kk]; + if (iperm[ii] != 0) { + goto L70; + } + if ((d__1 = a[kk], abs(d__1)) >= bv) { + goto L80; + } +L70: + ; + } + pr[jj] = kk2 + 1; +L50: + ; + } + goto L95; +L80: + jperm[jj] = ii; + iperm[ii] = jj; + pr[jj] = kk + 1; +L90: + ++(*num); + jperm[j] = i__; + iperm[i__] = j; + pr[j] = k + 1; +L95: + ; + } + if (*num == *n) { + goto L1000; + } +/* Prepare for main loop */ + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + d__[i__] = -1.; + l[i__] = 0; +/* L99: */ + } +/* Main loop ... each pass round this loop is similar to Dijkstra's */ +/* algorithm for solving the single source shortest path problem */ + i__1 = *n; + for (jord = 1; jord <= i__1; ++jord) { + if (jperm[jord] != 0) { + goto L100; + } + qlen = 0; + low = *n + 1; + up = *n + 1; +/* CSP is cost of shortest path to any unassigned row */ +/* ISP is matrix position of unassigned row element in shortest path */ +/* JSP is column index of unassigned row element in shortest path */ + csp = -1.; +/* Build shortest path tree starting from unassigned column JORD */ + j = jord; + pr[j] = -1; +/* Scan column J */ + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; + dnew = (d__1 = a[k], abs(d__1)); + if (csp >= dnew) { + goto L115; + } + if (iperm[i__] == 0) { +/* Row I is unassigned; update shortest path info */ + csp = dnew; + isp = i__; + jsp = j; + if (csp >= bv) { + goto L160; + } + } else { + d__[i__] = dnew; + if (dnew >= bv) { +/* Add row I to Q2 */ + --low; + q[low] = i__; + } else { +/* Add row I to Q, and push it */ + ++qlen; + l[i__] = qlen; + mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__1); + } + jj = iperm[i__]; + pr[jj] = j; + } +L115: + ; + } + i__2 = *num; + for (jdum = 1; jdum <= i__2; ++jdum) { +/* If Q2 is empty, extract new rows from Q */ + if (low == up) { + if (qlen == 0) { + goto L160; + } + i__ = q[1]; + if (csp >= d__[i__]) { + goto L160; + } + bv = d__[i__]; + i__3 = *n; + for (idum = 1; idum <= i__3; ++idum) { + mc64ed_(&qlen, n, &q[1], &d__[1], &l[1], &c__1); + l[i__] = 0; + --low; + q[low] = i__; + if (qlen == 0) { + goto L153; + } + i__ = q[1]; + if (d__[i__] != bv) { + goto L153; + } +/* L152: */ + } +/* End of dummy loop; this point is never reached */ + } +/* Move row Q0 */ +L153: + --up; + q0 = q[up]; + dq0 = d__[q0]; + l[q0] = up; +/* Scan column that matches with row Q0 */ + j = iperm[q0]; + i__3 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__3; ++k) { + i__ = irn[k]; +/* Update D(I) */ + if (l[i__] >= up) { + goto L155; + } +/* Computing MIN */ + d__2 = dq0, d__3 = (d__1 = a[k], abs(d__1)); + dnew = min(d__2,d__3); + if (csp >= dnew) { + goto L155; + } + if (iperm[i__] == 0) { +/* Row I is unassigned; update shortest path info */ + csp = dnew; + isp = i__; + jsp = j; + if (csp >= bv) { + goto L160; + } + } else { + di = d__[i__]; + if (di >= bv || di >= dnew) { + goto L155; + } + d__[i__] = dnew; + if (dnew >= bv) { +/* Delete row I from Q (if necessary); add row I to Q2 */ + if (di != -1.) { + mc64fd_(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], + &c__1); + } + l[i__] = 0; + --low; + q[low] = i__; + } else { +/* Add row I to Q (if necessary); push row I up Q */ + if (di == -1.) { + ++qlen; + l[i__] = qlen; + } + mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__1); + } +/* Update tree */ + jj = iperm[i__]; + pr[jj] = j; + } +L155: + ; + } +/* L150: */ + } +/* If CSP = MINONE, no augmenting path is found */ +L160: + if (csp == -1.) { + goto L190; + } +/* Update bottleneck value */ + bv = min(bv,csp); +/* Find augmenting path by tracing backward in PR; update IPERM,JPERM */ + ++(*num); + i__ = isp; + j = jsp; + i__2 = *num + 1; + for (jdum = 1; jdum <= i__2; ++jdum) { + i0 = jperm[j]; + jperm[j] = i__; + iperm[i__] = j; + j = pr[j]; + if (j == -1) { + goto L190; + } + i__ = i0; +/* L170: */ + } +/* End of dummy loop; this point is never reached */ +L190: + i__2 = *n; + for (kk = up; kk <= i__2; ++kk) { + i__ = q[kk]; + d__[i__] = -1.; + l[i__] = 0; +/* L191: */ + } + i__2 = up - 1; + for (kk = low; kk <= i__2; ++kk) { + i__ = q[kk]; + d__[i__] = -1.; +/* L192: */ + } + i__2 = qlen; + for (kk = 1; kk <= i__2; ++kk) { + i__ = q[kk]; + d__[i__] = -1.; + l[i__] = 0; +/* L193: */ + } +L100: + ; + } +/* End of main loop */ +/* BV is bottleneck value of final matching */ + if (*num == *n) { + goto L1000; + } +/* Matrix is structurally singular, complete IPERM. */ +/* JPERM, PR are work arrays */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + jperm[j] = 0; +/* L300: */ + } + k = 0; + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + if (iperm[i__] == 0) { + ++k; + pr[k] = i__; + } else { + j = iperm[i__]; + jperm[j] = i__; + } +/* L310: */ + } + k = 0; + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + if (jperm[i__] != 0) { + goto L320; + } + ++k; + jdum = pr[k]; + iperm[jdum] = i__; +L320: + ; + } +L1000: + return 0; +} /* mc64bd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64dd_(int_t *i__, int_t *n, int_t *q, double + *d__, int_t *l, int_t *iway) +{ + /* System generated locals */ + int_t i__1; + + /* Local variables */ + double di; + int_t qk, pos, idum, posk; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* Variables N,Q,D,L are described in MC64B/BD */ +/* IF IWAY is equal to 1, then */ +/* node I is pushed from its current position upwards */ +/* IF IWAY is not equal to 1, then */ +/* node I is pushed from its current position downwards */ +/* Local variables and parameters */ + /* Parameter adjustments */ + --l; + --d__; + --q; + + /* Function Body */ + di = d__[*i__]; + pos = l[*i__]; +/* POS is index of current position of I in the tree */ + if (*iway == 1) { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + if (pos <= 1) { + goto L20; + } + posk = pos / 2; + qk = q[posk]; + if (di <= d__[qk]) { + goto L20; + } + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L10: */ + } +/* End of dummy loop; this point is never reached */ + } else { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + if (pos <= 1) { + goto L20; + } + posk = pos / 2; + qk = q[posk]; + if (di >= d__[qk]) { + goto L20; + } + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L15: */ + } +/* End of dummy loop; this point is never reached */ + } +/* End of dummy if; this point is never reached */ +L20: + q[pos] = *i__; + l[*i__] = pos; + return 0; +} /* mc64dd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64ed_(int_t *qlen, int_t *n, int_t *q, + double *d__, int_t *l, int_t *iway) +{ + /* System generated locals */ + int_t i__1; + + /* Local variables */ + int_t i__; + double di, dk, dr; + int_t pos, idum, posk; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* Variables QLEN,N,Q,D,L are described in MC64B/BD (IWAY = 1) or */ +/* MC64W/WD (IWAY = 2) */ +/* The root node is deleted from the binary heap. */ +/* Local variables and parameters */ +/* Move last element to begin of Q */ + /* Parameter adjustments */ + --l; + --d__; + --q; + + /* Function Body */ + i__ = q[*qlen]; + di = d__[i__]; + --(*qlen); + pos = 1; + if (*iway == 1) { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + posk = pos << 1; + if (posk > *qlen) { + goto L20; + } + dk = d__[q[posk]]; + if (posk < *qlen) { + dr = d__[q[posk + 1]]; + if (dk < dr) { + ++posk; + dk = dr; + } + } + if (di >= dk) { + goto L20; + } +/* Exchange old last element with larger priority child */ + q[pos] = q[posk]; + l[q[pos]] = pos; + pos = posk; +/* L10: */ + } +/* End of dummy loop; this point is never reached */ + } else { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + posk = pos << 1; + if (posk > *qlen) { + goto L20; + } + dk = d__[q[posk]]; + if (posk < *qlen) { + dr = d__[q[posk + 1]]; + if (dk > dr) { + ++posk; + dk = dr; + } + } + if (di <= dk) { + goto L20; + } +/* Exchange old last element with smaller child */ + q[pos] = q[posk]; + l[q[pos]] = pos; + pos = posk; +/* L15: */ + } +/* End of dummy loop; this point is never reached */ + } +/* End of dummy if; this point is never reached */ +L20: + q[pos] = i__; + l[i__] = pos; + return 0; +} /* mc64ed_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64fd_(int_t *pos0, int_t *qlen, int_t *n, + int_t *q, double *d__, int_t *l, int_t *iway) +{ + /* System generated locals */ + int_t i__1; + + /* Local variables */ + int_t i__; + double di, dk, dr; + int_t qk, pos, idum, posk; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* Variables QLEN,N,Q,D,L are described in MC64B/BD (IWAY = 1) or */ +/* MC64WD (IWAY = 2). */ +/* Move last element in the heap */ +/* Quick return, if possible */ + /* Parameter adjustments */ + --l; + --d__; + --q; + + /* Function Body */ + if (*qlen == *pos0) { + --(*qlen); + return 0; + } +/* Move last element from queue Q to position POS0 */ +/* POS is current position of node I in the tree */ + i__ = q[*qlen]; + di = d__[i__]; + --(*qlen); + pos = *pos0; + if (*iway == 1) { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + if (pos <= 1) { + goto L20; + } + posk = pos / 2; + qk = q[posk]; + if (di <= d__[qk]) { + goto L20; + } + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L10: */ + } +/* End of dummy loop; this point is never reached */ +L20: + q[pos] = i__; + l[i__] = pos; + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + posk = pos << 1; + if (posk > *qlen) { + goto L40; + } + dk = d__[q[posk]]; + if (posk < *qlen) { + dr = d__[q[posk + 1]]; + if (dk < dr) { + ++posk; + dk = dr; + } + } + if (di >= dk) { + goto L40; + } + qk = q[posk]; + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L30: */ + } +/* End of dummy loop; this point is never reached */ + } else { + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + if (pos <= 1) { + goto L34; + } + posk = pos / 2; + qk = q[posk]; + if (di >= d__[qk]) { + goto L34; + } + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L32: */ + } +/* End of dummy loop; this point is never reached */ +L34: + q[pos] = i__; + l[i__] = pos; + i__1 = *n; + for (idum = 1; idum <= i__1; ++idum) { + posk = pos << 1; + if (posk > *qlen) { + goto L40; + } + dk = d__[q[posk]]; + if (posk < *qlen) { + dr = d__[q[posk + 1]]; + if (dk > dr) { + ++posk; + dk = dr; + } + } + if (di <= dk) { + goto L40; + } + qk = q[posk]; + q[pos] = qk; + l[qk] = pos; + pos = posk; +/* L36: */ + } +/* End of dummy loop; this point is never reached */ + } +/* End of dummy if; this point is never reached */ +L40: + q[pos] = i__; + l[i__] = pos; + return 0; +} /* mc64fd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64rd_(int_t *n, int_t *ne, int_t *ip, int_t * + irn, double *a) +{ + /* System generated locals */ + int_t i__1, i__2, i__3; + + /* Local variables */ + int_t j, k, r__, s; + double ha; + int_t hi, td, mid, len, ipj; + double key; + int_t last, todo[50], first; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* This subroutine sorts the entries in each column of the */ +/* sparse matrix (defined by N,NE,IP,IRN,A) by decreasing */ +/* numerical value. */ +/* Local constants */ +/* Local variables */ +/* Local arrays */ + /* Parameter adjustments */ + --ip; + --a; + --irn; + + /* Function Body */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + len = ip[j + 1] - ip[j]; + if (len <= 1) { + goto L100; + } + ipj = ip[j]; +/* Sort array roughly with partial quicksort */ + if (len < 15) { + goto L400; + } + todo[0] = ipj; + todo[1] = ipj + len; + td = 2; +L500: + first = todo[td - 2]; + last = todo[td - 1]; +/* KEY is the smallest of two values present in interval [FIRST,LAST) */ + key = a[(first + last) / 2]; + i__2 = last - 1; + for (k = first; k <= i__2; ++k) { + ha = a[k]; + if (ha == key) { + goto L475; + } + if (ha > key) { + goto L470; + } + key = ha; + goto L470; +L475: + ; + } +/* Only one value found in interval, so it is already sorted */ + td += -2; + goto L425; +/* Reorder interval [FIRST,LAST) such that entries before MID are gt KEY */ +L470: + mid = first; + i__2 = last - 1; + for (k = first; k <= i__2; ++k) { + if (a[k] <= key) { + goto L450; + } + ha = a[mid]; + a[mid] = a[k]; + a[k] = ha; + hi = irn[mid]; + irn[mid] = irn[k]; + irn[k] = hi; + ++mid; +L450: + ; + } +/* Both subintervals [FIRST,MID), [MID,LAST) are nonempty */ +/* Stack the longest of the two subintervals first */ + if (mid - first >= last - mid) { + todo[td + 1] = last; + todo[td] = mid; + todo[td - 1] = mid; +/* TODO(TD-1) = FIRST */ + } else { + todo[td + 1] = mid; + todo[td] = first; + todo[td - 1] = last; + todo[td - 2] = mid; + } + td += 2; +L425: + if (td == 0) { + goto L400; + } +/* There is still work to be done */ + if (todo[td - 1] - todo[td - 2] >= 15) { + goto L500; + } +/* Next interval is already short enough for straightforward insertion */ + td += -2; + goto L425; +/* Complete sorting with straightforward insertion */ +L400: + i__2 = ipj + len - 1; + for (r__ = ipj + 1; r__ <= i__2; ++r__) { + if (a[r__ - 1] < a[r__]) { + ha = a[r__]; + hi = irn[r__]; + a[r__] = a[r__ - 1]; + irn[r__] = irn[r__ - 1]; + i__3 = ipj + 1; + for (s = r__ - 1; s >= i__3; --s) { + if (a[s - 1] < ha) { + a[s] = a[s - 1]; + irn[s] = irn[s - 1]; + } else { + a[s] = ha; + irn[s] = hi; + goto L200; + } +/* L300: */ + } + a[ipj] = ha; + irn[ipj] = hi; + } +L200: + ; + } +L100: + ; + } + return 0; +} /* mc64rd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64sd_(int_t *n, int_t *ne, int_t *ip, int_t * + irn, double *a, int_t *iperm, int_t *numx, int_t *w, + int_t *len, int_t *lenl, int_t *lenh, int_t *fc, int_t *iw, + int_t *iw4) +{ + /* System generated locals */ + int_t i__1, i__2, i__3, i__4; + + /* Local variables */ + int_t i__, j, k, l, ii, mod, cnt, num; + double bval, bmin, bmax, rinf; + int_t nval, wlen, idum1, idum2, idum3; + extern /* Subroutine */ int_t mc64qd_(int_t *, int_t *, int_t *, + int_t *, int_t *, double *, int_t *, double *), + mc64ud_(int_t *, int_t *, int_t *, int_t *, int_t *, + int_t *, int_t *, int_t *, int_t *, int_t *, int_t *, + int_t *, int_t *, int_t *, int_t *); + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* N, NE, IP, IRN, are described in MC64A/AD. */ +/* A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. */ +/* A(K), K=1..NE, must be set to the value of the entry that */ +/* corresponds to IRN(k). The entries in each column must be */ +/* non-negative and ordered by decreasing value. */ +/* IPERM is an INT_T array of length N. On exit, it contains the */ +/* bottleneck matching: IPERM(I) - 0 or row I is matched to column */ +/* IPERM(I). */ +/* NUMX is an INT_T variable. On exit, it contains the cardinality */ +/* of the matching stored in IPERM. */ +/* IW is an INT_T work array of length 10N. */ +/* FC is an int_t array of length N that contains the list of */ +/* unmatched columns. */ +/* LEN(J), LENL(J), LENH(J) are int_t arrays of length N that point */ +/* to entries in matrix column J. */ +/* In the matrix defined by the column parts IP(J)+LENL(J) we know */ +/* a matching does not exist; in the matrix defined by the column */ +/* parts IP(J)+LENH(J) we know one exists. */ +/* LEN(J) lies between LENL(J) and LENH(J) and determines the matrix */ +/* that is tested for a maximum matching. */ +/* W is an int_t array of length N and contains the indices of the */ +/* columns for which LENL ne LENH. */ +/* WLEN is number of indices stored in array W. */ +/* IW is int_t work array of length N. */ +/* IW4 is int_t work array of length 4N used by MC64U/UD. */ +/* EXTERNAL FD05AD,MC64QD,MC64UD */ +/* DOUBLE PRECISION FD05AD */ +/* BMIN and BMAX are such that a maximum matching exists for the input */ +/* matrix in which all entries smaller than BMIN are dropped. */ +/* For BMAX, a maximum matching does not exist. */ +/* BVAL is a value between BMIN and BMAX. */ +/* CNT is the number of calls made to MC64U/UD so far. */ +/* NUM is the cardinality of last matching found. */ +/* Set RINF to largest positive real number */ +/* XSL RINF = FD05AD(5) */ + /* Parameter adjustments */ + --iw4; + --iw; + --fc; + --lenh; + --lenl; + --len; + --w; + --iperm; + --ip; + --a; + --irn; + + /* Function Body */ + rinf = dlamch_("Overflow"); +/* Compute a first maximum matching from scratch on whole matrix. */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + fc[j] = j; + iw[j] = 0; + len[j] = ip[j + 1] - ip[j]; +/* L20: */ + } +/* The first call to MC64U/UD */ + cnt = 1; + mod = 1; + *numx = 0; + mc64ud_(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], numx, + n, &iw4[1], &iw4[*n + 1], &iw4[(*n << 1) + 1], &iw4[*n * 3 + 1]); +/* IW contains a maximum matching of length NUMX. */ + num = *numx; + if (num != *n) { +/* Matrix is structurally singular */ + bmax = rinf; + } else { +/* Matrix is structurally nonsingular, NUM=NUMX=N; */ +/* Set BMAX just above the smallest of all the maximum absolute */ +/* values of the columns */ + bmax = rinf; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + bval = 0.f; + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + if (a[k] > bval) { + bval = a[k]; + } +/* L25: */ + } + if (bval < bmax) { + bmax = bval; + } +/* L30: */ + } + bmax *= 1.001f; + } +/* Initialize BVAL,BMIN */ + bval = 0.f; + bmin = 0.f; +/* Initialize LENL,LEN,LENH,W,WLEN according to BMAX. */ +/* Set LEN(J), LENH(J) just after last entry in column J. */ +/* Set LENL(J) just after last entry in column J with value ge BMAX. */ + wlen = 0; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + l = ip[j + 1] - ip[j]; + lenh[j] = l; + len[j] = l; + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + if (a[k] < bmax) { + goto L46; + } +/* L45: */ + } +/* Column J is empty or all entries are ge BMAX */ + k = ip[j + 1]; +L46: + lenl[j] = k - ip[j]; +/* Add J to W if LENL(J) ne LENH(J) */ + if (lenl[j] == l) { + goto L48; + } + ++wlen; + w[wlen] = j; +L48: + ; + } +/* Main loop */ + i__1 = *ne; + for (idum1 = 1; idum1 <= i__1; ++idum1) { + if (num == *numx) { +/* We have a maximum matching in IW; store IW in IPERM */ + i__2 = *n; + for (i__ = 1; i__ <= i__2; ++i__) { + iperm[i__] = iw[i__]; +/* L50: */ + } +/* Keep going round this loop until matching IW is no longer maximum. */ + i__2 = *ne; + for (idum2 = 1; idum2 <= i__2; ++idum2) { + bmin = bval; + if (bmax == bmin) { + goto L99; + } +/* Find splitting value BVAL */ + mc64qd_(&ip[1], &lenl[1], &len[1], &w[1], &wlen, &a[1], &nval, + &bval); + if (nval <= 1) { + goto L99; + } +/* Set LEN such that all matrix entries with value lt BVAL are */ +/* discarded. Store old LEN in LENH. Do this for all columns W(K). */ +/* Each step, either K is incremented or WLEN is decremented. */ + k = 1; + i__3 = *n; + for (idum3 = 1; idum3 <= i__3; ++idum3) { + if (k > wlen) { + goto L71; + } + j = w[k]; + i__4 = ip[j] + lenl[j]; + for (ii = ip[j] + len[j] - 1; ii >= i__4; --ii) { + if (a[ii] >= bval) { + goto L60; + } + i__ = irn[ii]; + if (iw[i__] != j) { + goto L55; + } +/* Remove entry from matching */ + iw[i__] = 0; + --num; + fc[*n - num] = j; +L55: + ; + } +L60: + lenh[j] = len[j]; +/* IP(J)+LEN(J)-1 is last entry in column ge BVAL */ + len[j] = ii - ip[j] + 1; +/* If LENH(J) = LENL(J), remove J from W */ + if (lenl[j] == lenh[j]) { + w[k] = w[wlen]; + --wlen; + } else { + ++k; + } +/* L70: */ + } +L71: + if (num < *numx) { + goto L81; + } +/* L80: */ + } +/* End of dummy loop; this point is never reached */ +/* Set mode for next call to MC64U/UD */ +L81: + mod = 1; + } else { +/* We do not have a maximum matching in IW. */ + bmax = bval; +/* BMIN is the bottleneck value of a maximum matching; */ +/* for BMAX the matching is not maximum, so BMAX>BMIN */ +/* IF (BMAX .EQ. BMIN) GO TO 99 */ +/* Find splitting value BVAL */ + mc64qd_(&ip[1], &len[1], &lenh[1], &w[1], &wlen, &a[1], &nval, & + bval); + if (nval == 0 || bval == bmin) { + goto L99; + } +/* Set LEN such that all matrix entries with value ge BVAL are */ +/* inside matrix. Store old LEN in LENL. Do this for all columns W(K). */ +/* Each step, either K is incremented or WLEN is decremented. */ + k = 1; + i__2 = *n; + for (idum3 = 1; idum3 <= i__2; ++idum3) { + if (k > wlen) { + goto L88; + } + j = w[k]; + i__3 = ip[j] + lenh[j] - 1; + for (ii = ip[j] + len[j]; ii <= i__3; ++ii) { + if (a[ii] < bval) { + goto L86; + } +/* L85: */ + } +L86: + lenl[j] = len[j]; + len[j] = ii - ip[j]; + if (lenl[j] == lenh[j]) { + w[k] = w[wlen]; + --wlen; + } else { + ++k; + } +/* L87: */ + } +/* End of dummy loop; this point is never reached */ +/* Set mode for next call to MC64U/UD */ +L88: + mod = 0; + } + ++cnt; + mc64ud_(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], & + num, numx, &iw4[1], &iw4[*n + 1], &iw4[(*n << 1) + 1], &iw4[* + n * 3 + 1]); +/* IW contains maximum matching of length NUM */ +/* L90: */ + } +/* End of dummy loop; this point is never reached */ +/* BMIN is bottleneck value of final matching */ +L99: + if (*numx == *n) { + goto L1000; + } +/* The matrix is structurally singular, complete IPERM */ +/* W, IW are work arrays */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + w[j] = 0; +/* L300: */ + } + k = 0; + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + if (iperm[i__] == 0) { + ++k; + iw[k] = i__; + } else { + j = iperm[i__]; + w[j] = i__; + } +/* L310: */ + } + k = 0; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (w[j] != 0) { + goto L320; + } + ++k; + idum1 = iw[k]; + iperm[idum1] = j; +L320: + ; + } +L1000: + return 0; +} /* mc64sd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64qd_(int_t *ip, int_t *lenl, int_t *lenh, + int_t *w, int_t *wlen, double *a, int_t *nval, double * + val) +{ + /* System generated locals */ + int_t i__1, i__2, i__3; + + /* Local variables */ + int_t j, k, s; + double ha; + int_t ii, pos; + double split[10]; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* This routine searches for at most XX different numerical values */ +/* in the columns W(1:WLEN). XX>=2. */ +/* Each column J is scanned between IP(J)+LENL(J) and IP(J)+LENH(J)-1 */ +/* until XX values are found or all columns have been considered. */ +/* On output, NVAL is the number of different values that is found */ +/* and SPLIT(1:NVAL) contains the values in decreasing order. */ +/* If NVAL > 0, the routine returns VAL = SPLIT((NVAL+1)/2). */ + +/* Scan columns in W(1:WLEN). For each encountered value, if value not */ +/* already present in SPLIT(1:NVAL), insert value such that SPLIT */ +/* remains sorted by decreasing value. */ +/* The sorting is done by straightforward insertion; therefore the use */ +/* of this routine should be avoided for large XX (XX < 20). */ + /* Parameter adjustments */ + --a; + --w; + --lenh; + --lenl; + --ip; + + /* Function Body */ + *nval = 0; + i__1 = *wlen; + for (k = 1; k <= i__1; ++k) { + j = w[k]; + i__2 = ip[j] + lenh[j] - 1; + for (ii = ip[j] + lenl[j]; ii <= i__2; ++ii) { + ha = a[ii]; + if (*nval == 0) { + split[0] = ha; + *nval = 1; + } else { +/* Check presence of HA in SPLIT */ + for (s = *nval; s >= 1; --s) { + if (split[s - 1] == ha) { + goto L15; + } + if (split[s - 1] > ha) { + pos = s + 1; + goto L21; + } +/* L20: */ + } + pos = 1; +/* The insertion */ +L21: + i__3 = pos; + for (s = *nval; s >= i__3; --s) { + split[s] = split[s - 1]; +/* L22: */ + } + split[pos - 1] = ha; + ++(*nval); + } +/* Exit loop if XX values are found */ + if (*nval == 10) { + goto L11; + } +L15: + ; + } +/* L10: */ + } +/* Determine VAL */ +L11: + if (*nval > 0) { + *val = split[(*nval + 1) / 2 - 1]; + } + return 0; +} /* mc64qd_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64ud_(int_t *id, int_t *mod, int_t *n, int_t * + irn, int_t *lirn, int_t *ip, int_t *lenc, int_t *fc, int_t * + iperm, int_t *num, int_t *numx, int_t *pr, int_t *arp, + int_t *cv, int_t *out) +{ + /* System generated locals */ + int_t i__1, i__2, i__3, i__4; + + /* Local variables */ + int_t i__, j, k, j1, ii, kk, id0, id1, in1, in2, nfc, num0, num1, num2, + jord, last; + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* PR(J) is the previous column to J in the depth first search. */ +/* Array PR is used as workspace in the sorting algorithm. */ +/* Elements (I,IPERM(I)) I=1,..,N are entries at the end of the */ +/* algorithm unless N assignments have not been made in which case */ +/* N-NUM pairs (I,IPERM(I)) will not be entries in the matrix. */ +/* CV(I) is the most recent loop number (ID+JORD) at which row I */ +/* was visited. */ +/* ARP(J) is the number of entries in column J which have been scanned */ +/* when looking for a cheap assignment. */ +/* OUT(J) is one less than the number of entries in column J which have */ +/* not been scanned during one pass through the main loop. */ +/* NUMX is maximum possible size of matching. */ + /* Parameter adjustments */ + --out; + --cv; + --arp; + --pr; + --iperm; + --fc; + --lenc; + --ip; + --irn; + + /* Function Body */ + if (*id == 1) { +/* The first call to MC64U/UD. */ +/* Initialize CV and ARP; parameters MOD, NUMX are not accessed */ + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + cv[i__] = 0; + arp[i__] = 0; +/* L5: */ + } + num1 = *n; + num2 = *n; + } else { +/* Not the first call to MC64U/UD. */ +/* Re-initialize ARP if entries were deleted since last call to MC64U/UD */ + if (*mod == 1) { + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + arp[i__] = 0; +/* L8: */ + } + } + num1 = *numx; + num2 = *n - *numx; + } + num0 = *num; +/* NUM0 is size of input matching */ +/* NUM1 is maximum possible size of matching */ +/* NUM2 is maximum allowed number of unassigned rows/columns */ +/* NUM is size of current matching */ +/* Quick return if possible */ +/* IF (NUM.EQ.N) GO TO 199 */ +/* NFC is number of rows/columns that could not be assigned */ + nfc = 0; +/* Integers ID0+1 to ID0+N are unique numbers for call ID to MC64U/UD, */ +/* so 1st call uses 1..N, 2nd call uses N+1..2N, etc */ + id0 = (*id - 1) * *n; +/* Main loop. Each pass round this loop either results in a new */ +/* assignment or gives a column with no assignment */ + i__1 = *n; + for (jord = num0 + 1; jord <= i__1; ++jord) { +/* Each pass uses unique number ID1 */ + id1 = id0 + jord; +/* J is unmatched column */ + j = fc[jord - num0]; + pr[j] = -1; + i__2 = jord; + for (k = 1; k <= i__2; ++k) { +/* Look for a cheap assignment */ + if (arp[j] >= lenc[j]) { + goto L30; + } + in1 = ip[j] + arp[j]; + in2 = ip[j] + lenc[j] - 1; + i__3 = in2; + for (ii = in1; ii <= i__3; ++ii) { + i__ = irn[ii]; + if (iperm[i__] == 0) { + goto L80; + } +/* L20: */ + } +/* No cheap assignment in row */ + arp[j] = lenc[j]; +/* Begin looking for assignment chain starting with row J */ +L30: + out[j] = lenc[j] - 1; +/* Inner loop. Extends chain by one or backtracks */ + i__3 = jord; + for (kk = 1; kk <= i__3; ++kk) { + in1 = out[j]; + if (in1 < 0) { + goto L50; + } + in2 = ip[j] + lenc[j] - 1; + in1 = in2 - in1; +/* Forward scan */ + i__4 = in2; + for (ii = in1; ii <= i__4; ++ii) { + i__ = irn[ii]; + if (cv[i__] == id1) { + goto L40; + } +/* Column J has not yet been accessed during this pass */ + j1 = j; + j = iperm[i__]; + cv[i__] = id1; + pr[j] = j1; + out[j1] = in2 - ii - 1; + goto L70; +L40: + ; + } +/* Backtracking step. */ +L50: + j1 = pr[j]; + if (j1 == -1) { +/* No augmenting path exists for column J. */ + ++nfc; + fc[nfc] = j; + if (nfc > num2) { +/* A matching of maximum size NUM1 is not possible */ + last = jord; + goto L101; + } + goto L100; + } + j = j1; +/* L60: */ + } +/* End of dummy loop; this point is never reached */ +L70: + ; + } +/* End of dummy loop; this point is never reached */ +/* New assignment is made. */ +L80: + iperm[i__] = j; + arp[j] = ii - ip[j] + 1; + ++(*num); + i__2 = jord; + for (k = 1; k <= i__2; ++k) { + j = pr[j]; + if (j == -1) { + goto L95; + } + ii = ip[j] + lenc[j] - out[j] - 2; + i__ = irn[ii]; + iperm[i__] = j; +/* L90: */ + } +/* End of dummy loop; this point is never reached */ +L95: + if (*num == num1) { +/* A matching of maximum size NUM1 is found */ + last = jord; + goto L101; + } + +L100: + ; + } +/* All unassigned columns have been considered */ + last = *n; +/* Now, a transversal is computed or is not possible. */ +/* Complete FC before returning. */ +L101: + i__1 = *n; + for (jord = last + 1; jord <= i__1; ++jord) { + ++nfc; + fc[nfc] = fc[jord - num0]; +/* L110: */ + } +/* 199 RETURN */ + return 0; +} /* mc64ud_ */ + +/* ********************************************************************** */ +/* Subroutine */ int_t mc64wd_(int_t *n, int_t *ne, int_t *ip, int_t * + irn, double *a, int_t *iperm, int_t *num, int_t *jperm, + int_t *out, int_t *pr, int_t *q, int_t *l, double *u, + double *d__) +{ + /* System generated locals */ + int_t i__1, i__2, i__3; + + /* Local variables */ + int_t i__, j, k, i0, k0, k1, k2, q0; + double di; + int_t ii, jj, kk; + double vj; + int_t up; + double dq0; + int_t kk1, kk2; + double csp; + int_t isp, jsp, low; + double dmin__, dnew; + int_t jord, qlen, jdum; + double rinf; + extern /* Subroutine */ int_t mc64dd_(int_t *, int_t *, int_t *, + double *, int_t *, int_t *), mc64ed_(int_t *, int_t *, + int_t *, double *, int_t *, int_t *), mc64fd_(int_t * + , int_t *, int_t *, int_t *, double *, int_t *, + int_t *); + + +/* *** Copyright (c) 1999 Council for the Central Laboratory of the */ +/* Research Councils *** */ +/* *** Although every effort has been made to ensure robustness and *** */ +/* *** reliability of the subroutines in this MC64 suite, we *** */ +/* *** disclaim any liability arising through the use or misuse of *** */ +/* *** any of the subroutines. *** */ +/* *** Any problems? Contact ... */ +/* Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** */ + +/* N, NE, IP, IRN are described in MC64A/AD. */ +/* A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. */ +/* A(K), K=1..NE, must be set to the value of the entry that */ +/* corresponds to IRN(K). It is not altered. */ +/* All values A(K) must be non-negative. */ +/* IPERM is an INT_T array of length N. On exit, it contains the */ +/* weighted matching: IPERM(I) = 0 or row I is matched to column */ +/* IPERM(I). */ +/* NUM is an INT_T variable. On exit, it contains the cardinality of */ +/* the matching stored in IPERM. */ +/* IW is an INT_T work array of length 5N. */ +/* DW is a REAL (DOUBLE PRECISION in the D-version) array of length 2N. */ +/* On exit, U = D(1:N) contains the dual row variable and */ +/* V = D(N+1:2N) contains the dual column variable. If the matrix */ +/* is structurally nonsingular (NUM = N), the following holds: */ +/* U(I)+V(J) <= A(I,J) if IPERM(I) |= J */ +/* U(I)+V(J) = A(I,J) if IPERM(I) = J */ +/* U(I) = 0 if IPERM(I) = 0 */ +/* V(J) = 0 if there is no I for which IPERM(I) = J */ +/* Local variables */ +/* Local parameters */ +/* External subroutines and/or functions */ +/* EXTERNAL FD05AD,MC64DD,MC64ED,MC64FD */ +/* DOUBLE PRECISION FD05AD */ +/* Set RINF to largest positive real number */ +/* XSL RINF = FD05AD(5) */ + /* Parameter adjustments */ + --d__; + --u; + --l; + --q; + --pr; + --out; + --jperm; + --iperm; + --ip; + --a; + --irn; + + /* Function Body */ + rinf = dlamch_("Overflow"); +/* Initialization */ + *num = 0; + i__1 = *n; + for (k = 1; k <= i__1; ++k) { + u[k] = rinf; + d__[k] = 0.; + iperm[k] = 0; + jperm[k] = 0; + pr[k] = ip[k]; + l[k] = 0; +/* L10: */ + } +/* Initialize U(I) */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; + if (a[k] > u[i__]) { + goto L20; + } + u[i__] = a[k]; + iperm[i__] = j; + l[i__] = k; +L20: + ; + } +/* L30: */ + } + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + j = iperm[i__]; + if (j == 0) { + goto L40; + } +/* Row I is not empty */ + iperm[i__] = 0; + if (jperm[j] != 0) { + goto L40; + } +/* Assignment of column J to row I */ + ++(*num); + iperm[i__] = j; + jperm[j] = l[i__]; +L40: + ; + } + if (*num == *n) { + goto L1000; + } +/* Scan unassigned columns; improve assignment */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { +/* JPERM(J) ne 0 iff column J is already assigned */ + if (jperm[j] != 0) { + goto L95; + } + k1 = ip[j]; + k2 = ip[j + 1] - 1; +/* Continue only if column J is not empty */ + if (k1 > k2) { + goto L95; + } + vj = rinf; + i__2 = k2; + for (k = k1; k <= i__2; ++k) { + i__ = irn[k]; + di = a[k] - u[i__]; + if (di > vj) { + goto L50; + } + if (di < vj || di == rinf) { + goto L55; + } + if (iperm[i__] != 0 || iperm[i0] == 0) { + goto L50; + } +L55: + vj = di; + i0 = i__; + k0 = k; +L50: + ; + } + d__[j] = vj; + k = k0; + i__ = i0; + if (iperm[i__] == 0) { + goto L90; + } + i__2 = k2; + for (k = k0; k <= i__2; ++k) { + i__ = irn[k]; + if (a[k] - u[i__] > vj) { + goto L60; + } + jj = iperm[i__]; +/* Scan remaining part of assigned column JJ */ + kk1 = pr[jj]; + kk2 = ip[jj + 1] - 1; + if (kk1 > kk2) { + goto L60; + } + i__3 = kk2; + for (kk = kk1; kk <= i__3; ++kk) { + ii = irn[kk]; + if (iperm[ii] > 0) { + goto L70; + } + if (a[kk] - u[ii] <= d__[jj]) { + goto L80; + } +L70: + ; + } + pr[jj] = kk2 + 1; +L60: + ; + } + goto L95; +L80: + jperm[jj] = kk; + iperm[ii] = jj; + pr[jj] = kk + 1; +L90: + ++(*num); + jperm[j] = k; + iperm[i__] = j; + pr[j] = k + 1; +L95: + ; + } + if (*num == *n) { + goto L1000; + } +/* Prepare for main loop */ + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + d__[i__] = rinf; + l[i__] = 0; +/* L99: */ + } +/* Main loop ... each pass round this loop is similar to Dijkstra's */ +/* algorithm for solving the single source shortest path problem */ + i__1 = *n; + for (jord = 1; jord <= i__1; ++jord) { + if (jperm[jord] != 0) { + goto L100; + } +/* JORD is next unmatched column */ +/* DMIN is the length of shortest path in the tree */ + dmin__ = rinf; + qlen = 0; + low = *n + 1; + up = *n + 1; +/* CSP is the cost of the shortest augmenting path to unassigned row */ +/* IRN(ISP). The corresponding column index is JSP. */ + csp = rinf; +/* Build shortest path tree starting from unassigned column (root) JORD */ + j = jord; + pr[j] = -1; +/* Scan column J */ + i__2 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__2; ++k) { + i__ = irn[k]; + dnew = a[k] - u[i__]; + if (dnew >= csp) { + goto L115; + } + if (iperm[i__] == 0) { + csp = dnew; + isp = k; + jsp = j; + } else { + if (dnew < dmin__) { + dmin__ = dnew; + } + d__[i__] = dnew; + ++qlen; + q[qlen] = k; + } +L115: + ; + } +/* Initialize heap Q and Q2 with rows held in Q(1:QLEN) */ + q0 = qlen; + qlen = 0; + i__2 = q0; + for (kk = 1; kk <= i__2; ++kk) { + k = q[kk]; + i__ = irn[k]; + if (csp <= d__[i__]) { + d__[i__] = rinf; + goto L120; + } + if (d__[i__] <= dmin__) { + --low; + q[low] = i__; + l[i__] = low; + } else { + ++qlen; + l[i__] = qlen; + mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__2); + } +/* Update tree */ + jj = iperm[i__]; + out[jj] = k; + pr[jj] = j; +L120: + ; + } + i__2 = *num; + for (jdum = 1; jdum <= i__2; ++jdum) { +/* If Q2 is empty, extract rows from Q */ + if (low == up) { + if (qlen == 0) { + goto L160; + } + i__ = q[1]; + if (d__[i__] >= csp) { + goto L160; + } + dmin__ = d__[i__]; +L152: + mc64ed_(&qlen, n, &q[1], &d__[1], &l[1], &c__2); + --low; + q[low] = i__; + l[i__] = low; + if (qlen == 0) { + goto L153; + } + i__ = q[1]; + if (d__[i__] > dmin__) { + goto L153; + } + goto L152; + } +/* Q0 is row whose distance D(Q0) to the root is smallest */ +L153: + q0 = q[up - 1]; + dq0 = d__[q0]; +/* Exit loop if path to Q0 is longer than the shortest augmenting path */ + if (dq0 >= csp) { + goto L160; + } + --up; +/* Scan column that matches with row Q0 */ + j = iperm[q0]; + vj = dq0 - a[jperm[j]] + u[q0]; + i__3 = ip[j + 1] - 1; + for (k = ip[j]; k <= i__3; ++k) { + i__ = irn[k]; + if (l[i__] >= up) { + goto L155; + } +/* DNEW is new cost */ + dnew = vj + a[k] - u[i__]; +/* Do not update D(I) if DNEW ge cost of shortest path */ + if (dnew >= csp) { + goto L155; + } + if (iperm[i__] == 0) { +/* Row I is unmatched; update shortest path info */ + csp = dnew; + isp = k; + jsp = j; + } else { +/* Row I is matched; do not update D(I) if DNEW is larger */ + di = d__[i__]; + if (di <= dnew) { + goto L155; + } + if (l[i__] >= low) { + goto L155; + } + d__[i__] = dnew; + if (dnew <= dmin__) { + if (l[i__] != 0) { + mc64fd_(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], + &c__2); + } + --low; + q[low] = i__; + l[i__] = low; + } else { + if (l[i__] == 0) { + ++qlen; + l[i__] = qlen; + } + mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__2); + } +/* Update tree */ + jj = iperm[i__]; + out[jj] = k; + pr[jj] = j; + } +L155: + ; + } +/* L150: */ + } +/* If CSP = RINF, no augmenting path is found */ +L160: + if (csp == rinf) { + goto L190; + } +/* Find augmenting path by tracing backward in PR; update IPERM,JPERM */ + ++(*num); + i__ = irn[isp]; + iperm[i__] = jsp; + jperm[jsp] = isp; + j = jsp; + i__2 = *num; + for (jdum = 1; jdum <= i__2; ++jdum) { + jj = pr[j]; + if (jj == -1) { + goto L180; + } + k = out[j]; + i__ = irn[k]; + iperm[i__] = jj; + jperm[jj] = k; + j = jj; +/* L170: */ + } +/* End of dummy loop; this point is never reached */ +/* Update U for rows in Q(UP:N) */ +L180: + i__2 = *n; + for (kk = up; kk <= i__2; ++kk) { + i__ = q[kk]; + u[i__] = u[i__] + d__[i__] - csp; +/* L185: */ + } +L190: + i__2 = *n; + for (kk = low; kk <= i__2; ++kk) { + i__ = q[kk]; + d__[i__] = rinf; + l[i__] = 0; +/* L191: */ + } + i__2 = qlen; + for (kk = 1; kk <= i__2; ++kk) { + i__ = q[kk]; + d__[i__] = rinf; + l[i__] = 0; +/* L193: */ + } +L100: + ; + } +/* End of main loop */ +/* Set dual column variable in D(1:N) */ +L1000: + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + k = jperm[j]; + if (k != 0) { + d__[j] = a[k] - u[irn[k]]; + } else { + d__[j] = 0.; + } + if (iperm[j] == 0) { + u[j] = 0.; + } +/* L200: */ + } + if (*num == *n) { + goto L1100; + } +/* The matrix is structurally singular, complete IPERM. */ +/* JPERM, OUT are work arrays */ + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + jperm[j] = 0; +/* L300: */ + } + k = 0; + i__1 = *n; + for (i__ = 1; i__ <= i__1; ++i__) { + if (iperm[i__] == 0) { + ++k; + out[k] = i__; + } else { + j = iperm[i__]; + jperm[j] = i__; + } +/* L310: */ + } + k = 0; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (jperm[j] != 0) { + goto L320; + } + ++k; + jdum = out[k]; + iperm[jdum] = j; +L320: + ; + } +L1100: + return 0; +} /* mc64wd_ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.f.bak b/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.f.bak new file mode 100644 index 0000000..c68c4d7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/mc64ad.f.bak @@ -0,0 +1,2002 @@ +CCCCC COPYRIGHT (c) 1999 Council for the Central Laboratory of the +CCCCC Research Councils. All rights reserved. +CCCCC PACKAGE MC64A/AD +CCCCC AUTHORS Iain Duff (i.duff@rl.ac.uk) and Jacko Koster (jak@ii.uib.no) +CCCCC LAST UPDATE 20/09/99 +CCCCC +C *** Conditions on external use *** +C +C The user shall acknowledge the contribution of this +C package in any publication of material dependent upon the use of +C the package. The user shall use reasonable endeavours to notify +C the authors of the package of this publication. +C +C The user can modify this code but, at no time +C shall the right or title to all or any part of this package pass +C to the user. The user shall make available free of charge +C to the authors for any purpose all information relating to any +C alteration or addition made to this package for the purposes of +C extending the capabilities or enhancing the performance of this +C package. +C +C The user shall not pass this code directly to a third party without the +C express prior consent of the authors. Users wanting to licence their +C own copy of these routines should send email to hsl@aeat.co.uk +C +C None of the comments from the Copyright notice up to and including this +C one shall be removed or altered in any way. + +C********************************************************************** + SUBROUTINE MC64ID(ICNTL) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C +C Purpose +C ======= +C +C The components of the array ICNTL control the action of MC64A/AD. +C Default values for these are set in this subroutine. +C +C Parameters +C ========== +C + INTEGER ICNTL(10) +C +C Local variables + INTEGER I +C +C ICNTL(1) has default value 6. +C It is the output stream for error messages. If it +C is negative, these messages will be suppressed. +C +C ICNTL(2) has default value 6. +C It is the output stream for warning messages. +C If it is negative, these messages are suppressed. +C +C ICNTL(3) has default value -1. +C It is the output stream for monitoring printing. +C If it is negative, these messages are suppressed. +C +C ICNTL(4) has default value 0. +C If left at the defaut value, the incoming data is checked for +C out-of-range indices and duplicates. Setting ICNTL(4) to any +C other will avoid the checks but is likely to cause problems +C later if out-of-range indices or duplicates are present. +C The user should only set ICNTL(4) non-zero, if the data is +C known to avoid these problems. +C +C ICNTL(5) to ICNTL(10) are not used by MC64A/AD but are set to +C zero in this routine. + +C Initialization of the ICNTL array. + ICNTL(1) = 6 + ICNTL(2) = 6 + ICNTL(3) = -1 + DO 10 I = 4,10 + ICNTL(I) = 0 + 10 CONTINUE + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64AD(JOB,N,NE,IP,IRN,A,NUM,CPERM,LIW,IW,LDW,DW, + & ICNTL,INFO) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C +C Purpose +C ======= +C +C This subroutine attempts to find a column permutation for an NxN +C sparse matrix A = {a_ij} that makes the permuted matrix have N +C entries on its diagonal. +C If the matrix is structurally nonsingular, the subroutine optionally +C returns a column permutation that maximizes the smallest element +C on the diagonal, maximizes the sum of the diagonal entries, or +C maximizes the product of the diagonal entries of the permuted matrix. +C For the latter option, the subroutine also finds scaling factors +C that may be used to scale the matrix so that the nonzero diagonal +C entries of the permuted matrix are one in absolute value and all the +C off-diagonal entries are less than or equal to one in absolute value. +C The natural logarithms of the scaling factors u(i), i=1..N, for the +C rows and v(j), j=1..N, for the columns are returned so that the +C scaled matrix B = {b_ij} has entries b_ij = a_ij * EXP(u_i + v_j). +C +C Parameters +C ========== +C + INTEGER JOB,N,NE,NUM,LIW,LDW + INTEGER IP(N+1),IRN(NE),CPERM(N),IW(LIW),ICNTL(10),INFO(10) + DOUBLE PRECISION A(NE),DW(LDW) +C +C JOB is an INTEGER variable which must be set by the user to +C control the action. It is not altered by the subroutine. +C Possible values for JOB are: +C 1 Compute a column permutation of the matrix so that the +C permuted matrix has as many entries on its diagonal as possible. +C The values on the diagonal are of arbitrary size. HSL subroutine +C MC21A/AD is used for this. See [1]. +C 2 Compute a column permutation of the matrix so that the smallest +C value on the diagonal of the permuted matrix is maximized. +C See [3]. +C 3 Compute a column permutation of the matrix so that the smallest +C value on the diagonal of the permuted matrix is maximized. +C The algorithm differs from the one used for JOB = 2 and may +C have quite a different performance. See [2]. +C 4 Compute a column permutation of the matrix so that the sum +C of the diagonal entries of the permuted matrix is maximized. +C See [3]. +C 5 Compute a column permutation of the matrix so that the product +C of the diagonal entries of the permuted matrix is maximized +C and vectors to scale the matrix so that the nonzero diagonal +C entries of the permuted matrix are one in absolute value and +C all the off-diagonal entries are less than or equal to one in +C absolute value. See [3]. +C Restriction: 1 <= JOB <= 5. +C +C N is an INTEGER variable which must be set by the user to the +C order of the matrix A. It is not altered by the subroutine. +C Restriction: N >= 1. +C +C NE is an INTEGER variable which must be set by the user to the +C number of entries in the matrix. It is not altered by the +C subroutine. +C Restriction: NE >= 1. +C +C IP is an INTEGER array of length N+1. +C IP(J), J=1..N, must be set by the user to the position in array IRN +C of the first row index of an entry in column J. IP(N+1) must be set +C to NE+1. It is not altered by the subroutine. +C +C IRN is an INTEGER array of length NE. +C IRN(K), K=1..NE, must be set by the user to hold the row indices of +C the entries of the matrix. Those belonging to column J must be +C stored contiguously in the positions IP(J)..IP(J+1)-1. The ordering +C of the row indices within each column is unimportant. Repeated +C entries are not allowed. The array IRN is not altered by the +C subroutine. +C +C A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. +C The user must set A(K), K=1..NE, to the numerical value of the +C entry that corresponds to IRN(K). +C It is not used by the subroutine when JOB = 1. +C It is not altered by the subroutine. +C +C NUM is an INTEGER variable that need not be set by the user. +C On successful exit, NUM will be the number of entries on the +C diagonal of the permuted matrix. +C If NUM < N, the matrix is structurally singular. +C +C CPERM is an INTEGER array of length N that need not be set by the +C user. On successful exit, CPERM contains the column permutation. +C Column CPERM(J) of the original matrix is column J in the permuted +C matrix, J=1..N. +C +C LIW is an INTEGER variable that must be set by the user to +C the dimension of array IW. It is not altered by the subroutine. +C Restriction: +C JOB = 1 : LIW >= 5N +C JOB = 2 : LIW >= 4N +C JOB = 3 : LIW >= 10N + NE +C JOB = 4 : LIW >= 5N +C JOB = 5 : LIW >= 5N +C +C IW is an INTEGER array of length LIW that is used for workspace. +C +C LDW is an INTEGER variable that must be set by the user to the +C dimension of array DW. It is not altered by the subroutine. +C Restriction: +C JOB = 1 : LDW is not used +C JOB = 2 : LDW >= N +C JOB = 3 : LDW >= NE +C JOB = 4 : LDW >= 2N + NE +C JOB = 5 : LDW >= 3N + NE +C +C DW is a REAL (DOUBLE PRECISION in the D-version) array of length LDW +C that is used for workspace. If JOB = 5, on return, +C DW(i) contains u_i, i=1..N, and DW(N+j) contains v_j, j=1..N. +C +C ICNTL is an INTEGER array of length 10. Its components control the +C output of MC64A/AD and must be set by the user before calling +C MC64A/AD. They are not altered by the subroutine. +C +C ICNTL(1) must be set to specify the output stream for +C error messages. If ICNTL(1) < 0, messages are suppressed. +C The default value set by MC46I/ID is 6. +C +C ICNTL(2) must be set by the user to specify the output stream for +C warning messages. If ICNTL(2) < 0, messages are suppressed. +C The default value set by MC46I/ID is 6. +C +C ICNTL(3) must be set by the user to specify the output stream for +C diagnostic messages. If ICNTL(3) < 0, messages are suppressed. +C The default value set by MC46I/ID is -1. +C +C ICNTL(4) must be set by the user to a value other than 0 to avoid +C checking of the input data. +C The default value set by MC46I/ID is 0. +C +C INFO is an INTEGER array of length 10 which need not be set by the +C user. INFO(1) is set non-negative to indicate success. A negative +C value is returned if an error occurred, a positive value if a +C warning occurred. INFO(2) holds further information on the error. +C On exit from the subroutine, INFO(1) will take one of the +C following values: +C 0 : successful entry (for structurally nonsingular matrix). +C +1 : successful entry (for structurally singular matrix). +C +2 : the returned scaling factors are large and may cause +C overflow when used to scale the matrix. +C (For JOB = 5 entry only.) +C -1 : JOB < 1 or JOB > 5. Value of JOB held in INFO(2). +C -2 : N < 1. Value of N held in INFO(2). +C -3 : NE < 1. Value of NE held in INFO(2). +C -4 : the defined length LIW violates the restriction on LIW. +C Value of LIW required given by INFO(2). +C -5 : the defined length LDW violates the restriction on LDW. +C Value of LDW required given by INFO(2). +C -6 : entries are found whose row indices are out of range. INFO(2) +C contains the index of a column in which such an entry is found. +C -7 : repeated entries are found. INFO(2) contains the index of a +C column in which such entries are found. +C INFO(3) to INFO(10) are not currently used and are set to zero by +C the routine. +C +C References: +C [1] I. S. Duff, (1981), +C "Algorithm 575. Permutations for a zero-free diagonal", +C ACM Trans. Math. Software 7(3), 387-390. +C [2] I. S. Duff and J. Koster, (1998), +C "The design and use of algorithms for permuting large +C entries to the diagonal of sparse matrices", +C SIAM J. Matrix Anal. Appl., vol. 20, no. 4, pp. 889-901. +C [3] I. S. Duff and J. Koster, (1999), +C "On algorithms for permuting large entries to the diagonal +C of sparse matrices", +C Technical Report RAL-TR-1999-030, RAL, Oxfordshire, England. + +C Local variables and parameters + INTEGER I,J,K + DOUBLE PRECISION FACT,ZERO,RINF + PARAMETER (ZERO=0.0D+00) +C External routines and functions +c EXTERNAL FD05AD +c DOUBLE PRECISION FD05AD + EXTERNAL MC21AD,MC64BD,MC64RD,MC64SD,MC64WD, DLAMCH + DOUBLE PRECISION DLAMCH +C Intrinsic functions + INTRINSIC ABS,LOG + +C Set RINF to largest positive real number (infinity) +c XSL RINF = FD05AD(5) + RINF = DLAMCH('Overflow') + +C Check value of JOB + IF (JOB.LT.1 .OR. JOB.GT.5) THEN + INFO(1) = -1 + INFO(2) = JOB + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'JOB',JOB + GO TO 99 + ENDIF +C Check value of N + IF (N.LT.1) THEN + INFO(1) = -2 + INFO(2) = N + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'N',N + GO TO 99 + ENDIF +C Check value of NE + IF (NE.LT.1) THEN + INFO(1) = -3 + INFO(2) = NE + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'NE',NE + GO TO 99 + ENDIF +C Check LIW + IF (JOB.EQ.1) K = 5*N + IF (JOB.EQ.2) K = 4*N + IF (JOB.EQ.3) K = 10*N + NE + IF (JOB.EQ.4) K = 5*N + IF (JOB.EQ.5) K = 5*N + IF (LIW.LT.K) THEN + INFO(1) = -4 + INFO(2) = K + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9004) INFO(1),K + GO TO 99 + ENDIF +C Check LDW +C If JOB = 1, do not check + IF (JOB.GT.1) THEN + IF (JOB.EQ.2) K = N + IF (JOB.EQ.3) K = NE + IF (JOB.EQ.4) K = 2*N + NE + IF (JOB.EQ.5) K = 3*N + NE + IF (LDW.LT.K) THEN + INFO(1) = -5 + INFO(2) = K + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9005) INFO(1),K + GO TO 99 + ENDIF + ENDIF + IF (ICNTL(4).EQ.0) THEN +C Check row indices. Use IW(1:N) as workspace + DO 3 I = 1,N + IW(I) = 0 + 3 CONTINUE + DO 6 J = 1,N + DO 4 K = IP(J),IP(J+1)-1 + I = IRN(K) +C Check for row indices that are out of range + IF (I.LT.1 .OR. I.GT.N) THEN + INFO(1) = -6 + INFO(2) = J + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9006) INFO(1),J,I + GO TO 99 + ENDIF +C Check for repeated row indices within a column + IF (IW(I).EQ.J) THEN + INFO(1) = -7 + INFO(2) = J + IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9007) INFO(1),J,I + GO TO 99 + ELSE + IW(I) = J + ENDIF + 4 CONTINUE + 6 CONTINUE + ENDIF + +C Print diagnostics on input + IF (ICNTL(3).GE.0) THEN + WRITE(ICNTL(3),9020) JOB,N,NE + WRITE(ICNTL(3),9021) (IP(J),J=1,N+1) + WRITE(ICNTL(3),9022) (IRN(J),J=1,NE) + IF (JOB.GT.1) WRITE(ICNTL(3),9023) (A(J),J=1,NE) + ENDIF + +C Set components of INFO to zero + DO 8 I=1,10 + INFO(I) = 0 + 8 CONTINUE + +C Compute maximum matching with MC21A/AD + IF (JOB.EQ.1) THEN +C Put length of column J in IW(J) + DO 10 J = 1,N + IW(J) = IP(J+1) - IP(J) + 10 CONTINUE +C IW(N+1:5N) is workspace + CALL MC21AD(N,IRN,NE,IP,IW(1),CPERM,NUM,IW(N+1)) + GO TO 90 + ENDIF + +C Compute bottleneck matching + IF (JOB.EQ.2) THEN +C IW(1:5N), DW(1:N) are workspaces + CALL MC64BD(N,NE,IP,IRN,A,CPERM,NUM, + & IW(1),IW(N+1),IW(2*N+1),IW(3*N+1),DW) + GO TO 90 + ENDIF + +C Compute bottleneck matching + IF (JOB.EQ.3) THEN +C Copy IRN(K) into IW(K), ABS(A(K)) into DW(K), K=1..NE + DO 20 K = 1,NE + IW(K) = IRN(K) + DW(K) = ABS(A(K)) + 20 CONTINUE +C Sort entries in each column by decreasing value. + CALL MC64RD(N,NE,IP,IW,DW) +C IW(NE+1:NE+10N) is workspace + CALL MC64SD(N,NE,IP,IW(1),DW,CPERM,NUM,IW(NE+1), + & IW(NE+N+1),IW(NE+2*N+1),IW(NE+3*N+1),IW(NE+4*N+1), + & IW(NE+5*N+1),IW(NE+6*N+1)) + GO TO 90 + ENDIF + + IF (JOB.EQ.4) THEN + DO 50 J = 1,N + FACT = ZERO + DO 30 K = IP(J),IP(J+1)-1 + IF (ABS(A(K)).GT.FACT) FACT = ABS(A(K)) + 30 CONTINUE + DO 40 K = IP(J),IP(J+1)-1 + DW(2*N+K) = FACT - ABS(A(K)) + 40 CONTINUE + 50 CONTINUE +C B = DW(2N+1:2N+NE); IW(1:5N) and DW(1:2N) are workspaces + CALL MC64WD(N,NE,IP,IRN,DW(2*N+1),CPERM,NUM, + & IW(1),IW(N+1),IW(2*N+1),IW(3*N+1),IW(4*N+1), + & DW(1),DW(N+1)) + GO TO 90 + ENDIF + + IF (JOB.EQ.5) THEN + DO 75 J = 1,N + FACT = ZERO + DO 60 K = IP(J),IP(J+1)-1 + DW(3*N+K) = ABS(A(K)) + IF (DW(3*N+K).GT.FACT) FACT = DW(3*N+K) + 60 CONTINUE + DW(2*N+J) = FACT + IF (FACT.NE.ZERO) THEN + FACT = LOG(FACT) + ELSE + FACT = RINF/N + ENDIF + DO 70 K = IP(J),IP(J+1)-1 + IF (DW(3*N+K).NE.ZERO) THEN + DW(3*N+K) = FACT - LOG(DW(3*N+K)) + ELSE + DW(3*N+K) = RINF/N + ENDIF + 70 CONTINUE + 75 CONTINUE +C B = DW(3N+1:3N+NE); IW(1:5N) and DW(1:2N) are workspaces + CALL MC64WD(N,NE,IP,IRN,DW(3*N+1),CPERM,NUM, + & IW(1),IW(N+1),IW(2*N+1),IW(3*N+1),IW(4*N+1), + & DW(1),DW(N+1)) + IF (NUM.EQ.N) THEN + DO 80 J = 1,N + IF (DW(2*N+J).NE.ZERO) THEN + DW(N+J) = DW(N+J) - LOG(DW(2*N+J)) + ELSE + DW(N+J) = ZERO + ENDIF + 80 CONTINUE + ENDIF +C Check size of scaling factors + FACT = 0.5*LOG(RINF) + DO 86 J = 1,N + IF (DW(J).LT.FACT .AND. DW(N+J).LT.FACT) GO TO 86 + INFO(1) = 2 + GO TO 90 + 86 CONTINUE +C GO TO 90 + ENDIF + + 90 IF (INFO(1).EQ.0 .AND. NUM.LT.N) THEN +C Matrix is structurally singular, return with warning + INFO(1) = 1 + IF (ICNTL(2).GE.0) WRITE(ICNTL(2),9011) INFO(1) + ENDIF + IF (INFO(1).EQ.2) THEN +C Scaling factors are large, return with warning + IF (ICNTL(2).GE.0) WRITE(ICNTL(2),9012) INFO(1) + ENDIF + +C Print diagnostics on output + IF (ICNTL(3).GE.0) THEN + WRITE(ICNTL(3),9030) (INFO(J),J=1,2) + WRITE(ICNTL(3),9031) NUM + WRITE(ICNTL(3),9032) (CPERM(J),J=1,N) + IF (JOB.EQ.5) THEN + WRITE(ICNTL(3),9033) (DW(J),J=1,N) + WRITE(ICNTL(3),9034) (DW(N+J),J=1,N) + ENDIF + ENDIF + +C Return from subroutine. + 99 RETURN + + 9001 FORMAT (' ****** Error in MC64A/AD. INFO(1) = ',I2, + & ' because ',(A),' = ',I10) + 9004 FORMAT (' ****** Error in MC64A/AD. INFO(1) = ',I2/ + & ' LIW too small, must be at least ',I8) + 9005 FORMAT (' ****** Error in MC64A/AD. INFO(1) = ',I2/ + & ' LDW too small, must be at least ',I8) + 9006 FORMAT (' ****** Error in MC64A/AD. INFO(1) = ',I2/ + & ' Column ',I8, + & ' contains an entry with invalid row index ',I8) + 9007 FORMAT (' ****** Error in MC64A/AD. INFO(1) = ',I2/ + & ' Column ',I8, + & ' contains two or more entries with row index ',I8) + 9011 FORMAT (' ****** Warning from MC64A/AD. INFO(1) = ',I2/ + & ' The matrix is structurally singular.') + 9012 FORMAT (' ****** Warning from MC64A/AD. INFO(1) = ',I2/ + & ' Some scaling factors may be too large.') + 9020 FORMAT (' ****** Input parameters for MC64A/AD:'/ + & ' JOB = ',I8/' N = ',I8/' NE = ',I8) + 9021 FORMAT (' IP(1:N+1) = ',8I8/(14X,8I8)) + 9022 FORMAT (' IRN(1:NE) = ',8I8/(14X,8I8)) + 9023 FORMAT (' A(1:NE) = ',4(1PD14.4)/(14X,4(1PD14.4))) + 9030 FORMAT (' ****** Output parameters for MC64A/AD:'/ + & ' INFO(1:2) = ',2I8) + 9031 FORMAT (' NUM = ',I8) + 9032 FORMAT (' CPERM(1:N) = ',8I8/(14X,8I8)) + 9033 FORMAT (' DW(1:N) = ',5(F11.3)/(14X,5(F11.3))) + 9034 FORMAT (' DW(N+1:2N) = ',5(F11.3)/(14X,5(F11.3))) + END + +C********************************************************************** + SUBROUTINE MC64BD(N,NE,IP,IRN,A,IPERM,NUM,JPERM,PR,Q,L,D) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER N,NE,NUM + INTEGER IP(N+1),IRN(NE),IPERM(N),JPERM(N),PR(N),Q(N),L(N) + DOUBLE PRECISION A(NE),D(N) + +C N, NE, IP, IRN are described in MC64A/AD. +C A is a REAL (DOUBLE PRECISION in the D-version) array of length +C NE. A(K), K=1..NE, must be set to the value of the entry +C that corresponds to IRN(K). It is not altered. +C IPERM is an INTEGER array of length N. On exit, it contains the +C matching: IPERM(I) = 0 or row I is matched to column IPERM(I). +C NUM is INTEGER variable. On exit, it contains the cardinality of the +C matching stored in IPERM. +C IW is an INTEGER work array of length 4N. +C DW is a REAL (DOUBLE PRECISION in D-version) work array of length N. + +C Local variables + INTEGER I,II,J,JJ,JORD,Q0,QLEN,IDUM,JDUM,ISP,JSP, + & K,KK,KK1,KK2,I0,UP,LOW + DOUBLE PRECISION CSP,DI,DNEW,DQ0,AI,A0,BV +C Local parameters + DOUBLE PRECISION RINF,ZERO,MINONE + PARAMETER (ZERO=0.0D+0,MINONE=-1.0D+0) +C Intrinsic functions + INTRINSIC ABS,MIN +C External subroutines and/or functions +c EXTERNAL FD05AD,MC64DD,MC64ED,MC64FD, DLAMCH +c DOUBLE PRECISION FD05AD, DLAMCH + EXTERNAL MC64DD,MC64ED,MC64FD, DLAMCH + DOUBLE PRECISION DLAMCH + +C Set RINF to largest positive real number +c XSL RINF = FD05AD(5) + RINF = DLAMCH('Overflow') + +C Initialization + NUM = 0 + BV = RINF + DO 10 K = 1,N + IPERM(K) = 0 + JPERM(K) = 0 + PR(K) = IP(K) + D(K) = ZERO + 10 CONTINUE +C Scan columns of matrix; + DO 20 J = 1,N + A0 = MINONE + DO 30 K = IP(J),IP(J+1)-1 + I = IRN(K) + AI = ABS(A(K)) + IF (AI.GT.D(I)) D(I) = AI + IF (JPERM(J).NE.0) GO TO 30 + IF (AI.GE.BV) THEN + A0 = BV + IF (IPERM(I).NE.0) GO TO 30 + JPERM(J) = I + IPERM(I) = J + NUM = NUM + 1 + ELSE + IF (AI.LE.A0) GO TO 30 + A0 = AI + I0 = I + ENDIF + 30 CONTINUE + IF (A0.NE.MINONE .AND. A0.LT.BV) THEN + BV = A0 + IF (IPERM(I0).NE.0) GO TO 20 + IPERM(I0) = J + JPERM(J) = I0 + NUM = NUM + 1 + ENDIF + 20 CONTINUE +C Update BV with smallest of all the largest maximum absolute values +C of the rows. + DO 25 I = 1,N + BV = MIN(BV,D(I)) + 25 CONTINUE + IF (NUM.EQ.N) GO TO 1000 +C Rescan unassigned columns; improve initial assignment + DO 95 J = 1,N + IF (JPERM(J).NE.0) GO TO 95 + DO 50 K = IP(J),IP(J+1)-1 + I = IRN(K) + AI = ABS(A(K)) + IF (AI.LT.BV) GO TO 50 + IF (IPERM(I).EQ.0) GO TO 90 + JJ = IPERM(I) + KK1 = PR(JJ) + KK2 = IP(JJ+1) - 1 + IF (KK1.GT.KK2) GO TO 50 + DO 70 KK = KK1,KK2 + II = IRN(KK) + IF (IPERM(II).NE.0) GO TO 70 + IF (ABS(A(KK)).GE.BV) GO TO 80 + 70 CONTINUE + PR(JJ) = KK2 + 1 + 50 CONTINUE + GO TO 95 + 80 JPERM(JJ) = II + IPERM(II) = JJ + PR(JJ) = KK + 1 + 90 NUM = NUM + 1 + JPERM(J) = I + IPERM(I) = J + PR(J) = K + 1 + 95 CONTINUE + IF (NUM.EQ.N) GO TO 1000 + +C Prepare for main loop + DO 99 I = 1,N + D(I) = MINONE + L(I) = 0 + 99 CONTINUE + +C Main loop ... each pass round this loop is similar to Dijkstra's +C algorithm for solving the single source shortest path problem + + DO 100 JORD = 1,N + + IF (JPERM(JORD).NE.0) GO TO 100 + QLEN = 0 + LOW = N + 1 + UP = N + 1 +C CSP is cost of shortest path to any unassigned row +C ISP is matrix position of unassigned row element in shortest path +C JSP is column index of unassigned row element in shortest path + CSP = MINONE +C Build shortest path tree starting from unassigned column JORD + J = JORD + PR(J) = -1 + +C Scan column J + DO 115 K = IP(J),IP(J+1)-1 + I = IRN(K) + DNEW = ABS(A(K)) + IF (CSP.GE.DNEW) GO TO 115 + IF (IPERM(I).EQ.0) THEN +C Row I is unassigned; update shortest path info + CSP = DNEW + ISP = I + JSP = J + IF (CSP.GE.BV) GO TO 160 + ELSE + D(I) = DNEW + IF (DNEW.GE.BV) THEN +C Add row I to Q2 + LOW = LOW - 1 + Q(LOW) = I + ELSE +C Add row I to Q, and push it + QLEN = QLEN + 1 + L(I) = QLEN + CALL MC64DD(I,N,Q,D,L,1) + ENDIF + JJ = IPERM(I) + PR(JJ) = J + ENDIF + 115 CONTINUE + + DO 150 JDUM = 1,NUM +C If Q2 is empty, extract new rows from Q + IF (LOW.EQ.UP) THEN + IF (QLEN.EQ.0) GO TO 160 + I = Q(1) + IF (CSP.GE.D(I)) GO TO 160 + BV = D(I) + DO 152 IDUM = 1,N + CALL MC64ED(QLEN,N,Q,D,L,1) + L(I) = 0 + LOW = LOW - 1 + Q(LOW) = I + IF (QLEN.EQ.0) GO TO 153 + I = Q(1) + IF (D(I).NE.BV) GO TO 153 + 152 CONTINUE +C End of dummy loop; this point is never reached + ENDIF +C Move row Q0 + 153 UP = UP - 1 + Q0 = Q(UP) + DQ0 = D(Q0) + L(Q0) = UP +C Scan column that matches with row Q0 + J = IPERM(Q0) + DO 155 K = IP(J),IP(J+1)-1 + I = IRN(K) +C Update D(I) + IF (L(I).GE.UP) GO TO 155 + DNEW = MIN(DQ0,ABS(A(K))) + IF (CSP.GE.DNEW) GO TO 155 + IF (IPERM(I).EQ.0) THEN +C Row I is unassigned; update shortest path info + CSP = DNEW + ISP = I + JSP = J + IF (CSP.GE.BV) GO TO 160 + ELSE + DI = D(I) + IF (DI.GE.BV .OR. DI.GE.DNEW) GO TO 155 + D(I) = DNEW + IF (DNEW.GE.BV) THEN +C Delete row I from Q (if necessary); add row I to Q2 + IF (DI.NE.MINONE) + * CALL MC64FD(L(I),QLEN,N,Q,D,L,1) + L(I) = 0 + LOW = LOW - 1 + Q(LOW) = I + ELSE +C Add row I to Q (if necessary); push row I up Q + IF (DI.EQ.MINONE) THEN + QLEN = QLEN + 1 + L(I) = QLEN + ENDIF + CALL MC64DD(I,N,Q,D,L,1) + ENDIF +C Update tree + JJ = IPERM(I) + PR(JJ) = J + ENDIF + 155 CONTINUE + 150 CONTINUE + +C If CSP = MINONE, no augmenting path is found + 160 IF (CSP.EQ.MINONE) GO TO 190 +C Update bottleneck value + BV = MIN(BV,CSP) +C Find augmenting path by tracing backward in PR; update IPERM,JPERM + NUM = NUM + 1 + I = ISP + J = JSP + DO 170 JDUM = 1,NUM+1 + I0 = JPERM(J) + JPERM(J) = I + IPERM(I) = J + J = PR(J) + IF (J.EQ.-1) GO TO 190 + I = I0 + 170 CONTINUE +C End of dummy loop; this point is never reached + 190 DO 191 KK = UP,N + I = Q(KK) + D(I) = MINONE + L(I) = 0 + 191 CONTINUE + DO 192 KK = LOW,UP-1 + I = Q(KK) + D(I) = MINONE + 192 CONTINUE + DO 193 KK = 1,QLEN + I = Q(KK) + D(I) = MINONE + L(I) = 0 + 193 CONTINUE + + 100 CONTINUE +C End of main loop + +C BV is bottleneck value of final matching + IF (NUM.EQ.N) GO TO 1000 + +C Matrix is structurally singular, complete IPERM. +C JPERM, PR are work arrays + DO 300 J = 1,N + JPERM(J) = 0 + 300 CONTINUE + K = 0 + DO 310 I = 1,N + IF (IPERM(I).EQ.0) THEN + K = K + 1 + PR(K) = I + ELSE + J = IPERM(I) + JPERM(J) = I + ENDIF + 310 CONTINUE + K = 0 + DO 320 I = 1,N + IF (JPERM(I).NE.0) GO TO 320 + K = K + 1 + JDUM = PR(K) + IPERM(JDUM) = I + 320 CONTINUE + + 1000 RETURN + END + +C********************************************************************** + SUBROUTINE MC64DD(I,N,Q,D,L,IWAY) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER I,N,IWAY + INTEGER Q(N),L(N) + DOUBLE PRECISION D(N) + +C Variables N,Q,D,L are described in MC64B/BD +C IF IWAY is equal to 1, then +C node I is pushed from its current position upwards +C IF IWAY is not equal to 1, then +C node I is pushed from its current position downwards + +C Local variables and parameters + INTEGER IDUM,K,POS,POSK,QK + PARAMETER (K=2) + DOUBLE PRECISION DI + + DI = D(I) + POS = L(I) +C POS is index of current position of I in the tree + IF (IWAY.EQ.1) THEN + DO 10 IDUM = 1,N + IF (POS.LE.1) GO TO 20 + POSK = POS/K + QK = Q(POSK) + IF (DI.LE.D(QK)) GO TO 20 + Q(POS) = QK + L(QK) = POS + POS = POSK + 10 CONTINUE +C End of dummy loop; this point is never reached + ELSE + DO 15 IDUM = 1,N + IF (POS.LE.1) GO TO 20 + POSK = POS/K + QK = Q(POSK) + IF (DI.GE.D(QK)) GO TO 20 + Q(POS) = QK + L(QK) = POS + POS = POSK + 15 CONTINUE +C End of dummy loop; this point is never reached + ENDIF +C End of dummy if; this point is never reached + 20 Q(POS) = I + L(I) = POS + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64ED(QLEN,N,Q,D,L,IWAY) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER QLEN,N,IWAY + INTEGER Q(N),L(N) + DOUBLE PRECISION D(N) + +C Variables QLEN,N,Q,D,L are described in MC64B/BD (IWAY = 1) or +C MC64W/WD (IWAY = 2) +C The root node is deleted from the binary heap. + +C Local variables and parameters + INTEGER I,IDUM,K,POS,POSK + PARAMETER (K=2) + DOUBLE PRECISION DK,DR,DI + +C Move last element to begin of Q + I = Q(QLEN) + DI = D(I) + QLEN = QLEN - 1 + POS = 1 + IF (IWAY.EQ.1) THEN + DO 10 IDUM = 1,N + POSK = K*POS + IF (POSK.GT.QLEN) GO TO 20 + DK = D(Q(POSK)) + IF (POSK.LT.QLEN) THEN + DR = D(Q(POSK+1)) + IF (DK.LT.DR) THEN + POSK = POSK + 1 + DK = DR + ENDIF + ENDIF + IF (DI.GE.DK) GO TO 20 +C Exchange old last element with larger priority child + Q(POS) = Q(POSK) + L(Q(POS)) = POS + POS = POSK + 10 CONTINUE +C End of dummy loop; this point is never reached + ELSE + DO 15 IDUM = 1,N + POSK = K*POS + IF (POSK.GT.QLEN) GO TO 20 + DK = D(Q(POSK)) + IF (POSK.LT.QLEN) THEN + DR = D(Q(POSK+1)) + IF (DK.GT.DR) THEN + POSK = POSK + 1 + DK = DR + ENDIF + ENDIF + IF (DI.LE.DK) GO TO 20 +C Exchange old last element with smaller child + Q(POS) = Q(POSK) + L(Q(POS)) = POS + POS = POSK + 15 CONTINUE +C End of dummy loop; this point is never reached + ENDIF +C End of dummy if; this point is never reached + 20 Q(POS) = I + L(I) = POS + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64FD(POS0,QLEN,N,Q,D,L,IWAY) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER POS0,QLEN,N,IWAY + INTEGER Q(N),L(N) + DOUBLE PRECISION D(N) + +C Variables QLEN,N,Q,D,L are described in MC64B/BD (IWAY = 1) or +C MC64WD (IWAY = 2). +C Move last element in the heap + + INTEGER I,IDUM,K,POS,POSK,QK + PARAMETER (K=2) + DOUBLE PRECISION DK,DR,DI + +C Quick return, if possible + IF (QLEN.EQ.POS0) THEN + QLEN = QLEN - 1 + RETURN + ENDIF + +C Move last element from queue Q to position POS0 +C POS is current position of node I in the tree + I = Q(QLEN) + DI = D(I) + QLEN = QLEN - 1 + POS = POS0 + IF (IWAY.EQ.1) THEN + DO 10 IDUM = 1,N + IF (POS.LE.1) GO TO 20 + POSK = POS/K + QK = Q(POSK) + IF (DI.LE.D(QK)) GO TO 20 + Q(POS) = QK + L(QK) = POS + POS = POSK + 10 CONTINUE +C End of dummy loop; this point is never reached + 20 Q(POS) = I + L(I) = POS + DO 30 IDUM = 1,N + POSK = K*POS + IF (POSK.GT.QLEN) GO TO 40 + DK = D(Q(POSK)) + IF (POSK.LT.QLEN) THEN + DR = D(Q(POSK+1)) + IF (DK.LT.DR) THEN + POSK = POSK + 1 + DK = DR + ENDIF + ENDIF + IF (DI.GE.DK) GO TO 40 + QK = Q(POSK) + Q(POS) = QK + L(QK) = POS + POS = POSK + 30 CONTINUE +C End of dummy loop; this point is never reached + ELSE + DO 32 IDUM = 1,N + IF (POS.LE.1) GO TO 34 + POSK = POS/K + QK = Q(POSK) + IF (DI.GE.D(QK)) GO TO 34 + Q(POS) = QK + L(QK) = POS + POS = POSK + 32 CONTINUE +C End of dummy loop; this point is never reached + 34 Q(POS) = I + L(I) = POS + DO 36 IDUM = 1,N + POSK = K*POS + IF (POSK.GT.QLEN) GO TO 40 + DK = D(Q(POSK)) + IF (POSK.LT.QLEN) THEN + DR = D(Q(POSK+1)) + IF (DK.GT.DR) THEN + POSK = POSK + 1 + DK = DR + ENDIF + ENDIF + IF (DI.LE.DK) GO TO 40 + QK = Q(POSK) + Q(POS) = QK + L(QK) = POS + POS = POSK + 36 CONTINUE +C End of dummy loop; this point is never reached + ENDIF +C End of dummy if; this point is never reached + 40 Q(POS) = I + L(I) = POS + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64RD(N,NE,IP,IRN,A) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER N,NE + INTEGER IP(N+1),IRN(NE) + DOUBLE PRECISION A(NE) + +C This subroutine sorts the entries in each column of the +C sparse matrix (defined by N,NE,IP,IRN,A) by decreasing +C numerical value. + +C Local constants + INTEGER THRESH,TDLEN + PARAMETER (THRESH=15,TDLEN=50) +C Local variables + INTEGER J,IPJ,K,LEN,R,S,HI,FIRST,MID,LAST,TD + DOUBLE PRECISION HA,KEY +C Local arrays + INTEGER TODO(TDLEN) + + DO 100 J = 1,N + LEN = IP(J+1) - IP(J) + IF (LEN.LE.1) GO TO 100 + IPJ = IP(J) + +C Sort array roughly with partial quicksort + IF (LEN.LT.THRESH) GO TO 400 + TODO(1) = IPJ + TODO(2) = IPJ + LEN + TD = 2 + 500 CONTINUE + FIRST = TODO(TD-1) + LAST = TODO(TD) +C KEY is the smallest of two values present in interval [FIRST,LAST) + KEY = A((FIRST+LAST)/2) + DO 475 K = FIRST,LAST-1 + HA = A(K) + IF (HA.EQ.KEY) GO TO 475 + IF (HA.GT.KEY) GO TO 470 + KEY = HA + GO TO 470 + 475 CONTINUE +C Only one value found in interval, so it is already sorted + TD = TD - 2 + GO TO 425 + +C Reorder interval [FIRST,LAST) such that entries before MID are gt KEY + 470 MID = FIRST + DO 450 K = FIRST,LAST-1 + IF (A(K).LE.KEY) GO TO 450 + HA = A(MID) + A(MID) = A(K) + A(K) = HA + HI = IRN(MID) + IRN(MID) = IRN(K) + IRN(K) = HI + MID = MID + 1 + 450 CONTINUE +C Both subintervals [FIRST,MID), [MID,LAST) are nonempty +C Stack the longest of the two subintervals first + IF (MID-FIRST.GE.LAST-MID) THEN + TODO(TD+2) = LAST + TODO(TD+1) = MID + TODO(TD) = MID +C TODO(TD-1) = FIRST + ELSE + TODO(TD+2) = MID + TODO(TD+1) = FIRST + TODO(TD) = LAST + TODO(TD-1) = MID + ENDIF + TD = TD + 2 + + 425 CONTINUE + IF (TD.EQ.0) GO TO 400 +C There is still work to be done + IF (TODO(TD)-TODO(TD-1).GE.THRESH) GO TO 500 +C Next interval is already short enough for straightforward insertion + TD = TD - 2 + GO TO 425 + +C Complete sorting with straightforward insertion + 400 DO 200 R = IPJ+1,IPJ+LEN-1 + IF (A(R-1) .LT. A(R)) THEN + HA = A(R) + HI = IRN(R) + A(R) = A(R-1) + IRN(R) = IRN(R-1) + DO 300 S = R-1,IPJ+1,-1 + IF (A(S-1) .LT. HA) THEN + A(S) = A(S-1) + IRN(S) = IRN(S-1) + ELSE + A(S) = HA + IRN(S) = HI + GO TO 200 + END IF + 300 CONTINUE + A(IPJ) = HA + IRN(IPJ) = HI + END IF + 200 CONTINUE + + 100 CONTINUE + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64SD(N,NE,IP,IRN,A,IPERM,NUMX, + & W,LEN,LENL,LENH,FC,IW,IW4) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER N,NE,NUMX + INTEGER IP(N+1),IRN(NE),IPERM(N), + & W(N),LEN(N),LENL(N),LENH(N),FC(N),IW(N),IW4(4*N) + DOUBLE PRECISION A(NE) + +C N, NE, IP, IRN, are described in MC64A/AD. +C A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. +C A(K), K=1..NE, must be set to the value of the entry that +C corresponds to IRN(k). The entries in each column must be +C non-negative and ordered by decreasing value. +C IPERM is an INTEGER array of length N. On exit, it contains the +C bottleneck matching: IPERM(I) - 0 or row I is matched to column +C IPERM(I). +C NUMX is an INTEGER variable. On exit, it contains the cardinality +C of the matching stored in IPERM. +C IW is an INTEGER work array of length 10N. + +C FC is an integer array of length N that contains the list of +C unmatched columns. +C LEN(J), LENL(J), LENH(J) are integer arrays of length N that point +C to entries in matrix column J. +C In the matrix defined by the column parts IP(J)+LENL(J) we know +C a matching does not exist; in the matrix defined by the column +C parts IP(J)+LENH(J) we know one exists. +C LEN(J) lies between LENL(J) and LENH(J) and determines the matrix +C that is tested for a maximum matching. +C W is an integer array of length N and contains the indices of the +C columns for which LENL ne LENH. +C WLEN is number of indices stored in array W. +C IW is integer work array of length N. +C IW4 is integer work array of length 4N used by MC64U/UD. + + INTEGER NUM,NVAL,WLEN,II,I,J,K,L,CNT,MOD,IDUM1,IDUM2,IDUM3 + DOUBLE PRECISION BVAL,BMIN,BMAX,RINF +c EXTERNAL FD05AD,MC64QD,MC64UD +c DOUBLE PRECISION FD05AD + EXTERNAL MC64QD,MC64UD, DLAMCH + DOUBLE PRECISION DLAMCH + +C BMIN and BMAX are such that a maximum matching exists for the input +C matrix in which all entries smaller than BMIN are dropped. +C For BMAX, a maximum matching does not exist. +C BVAL is a value between BMIN and BMAX. +C CNT is the number of calls made to MC64U/UD so far. +C NUM is the cardinality of last matching found. + +C Set RINF to largest positive real number +c XSL RINF = FD05AD(5) + RINF = DLAMCH('Overflow') + +C Compute a first maximum matching from scratch on whole matrix. + DO 20 J = 1,N + FC(J) = J + IW(J) = 0 + LEN(J) = IP(J+1) - IP(J) + 20 CONTINUE +C The first call to MC64U/UD + CNT = 1 + MOD = 1 + NUMX = 0 + CALL MC64UD(CNT,MOD,N,IRN,NE,IP,LEN,FC,IW,NUMX,N, + & IW4(1),IW4(N+1),IW4(2*N+1),IW4(3*N+1)) + +C IW contains a maximum matching of length NUMX. + NUM = NUMX + + IF (NUM.NE.N) THEN +C Matrix is structurally singular + BMAX = RINF + ELSE +C Matrix is structurally nonsingular, NUM=NUMX=N; +C Set BMAX just above the smallest of all the maximum absolute +C values of the columns + BMAX = RINF + DO 30 J = 1,N + BVAL = 0.0 + DO 25 K = IP(J),IP(J+1)-1 + IF (A(K).GT.BVAL) BVAL = A(K) + 25 CONTINUE + IF (BVAL.LT.BMAX) BMAX = BVAL + 30 CONTINUE + BMAX = 1.001 * BMAX + ENDIF + +C Initialize BVAL,BMIN + BVAL = 0.0 + BMIN = 0.0 +C Initialize LENL,LEN,LENH,W,WLEN according to BMAX. +C Set LEN(J), LENH(J) just after last entry in column J. +C Set LENL(J) just after last entry in column J with value ge BMAX. + WLEN = 0 + DO 48 J = 1,N + L = IP(J+1) - IP(J) + LENH(J) = L + LEN(J) = L + DO 45 K = IP(J),IP(J+1)-1 + IF (A(K).LT.BMAX) GO TO 46 + 45 CONTINUE +C Column J is empty or all entries are ge BMAX + K = IP(J+1) + 46 LENL(J) = K - IP(J) +C Add J to W if LENL(J) ne LENH(J) + IF (LENL(J).EQ.L) GO TO 48 + WLEN = WLEN + 1 + W(WLEN) = J + 48 CONTINUE + +C Main loop + DO 90 IDUM1 = 1,NE + IF (NUM.EQ.NUMX) THEN +C We have a maximum matching in IW; store IW in IPERM + DO 50 I = 1,N + IPERM(I) = IW(I) + 50 CONTINUE +C Keep going round this loop until matching IW is no longer maximum. + DO 80 IDUM2 = 1,NE + BMIN = BVAL + IF (BMAX .EQ. BMIN) GO TO 99 +C Find splitting value BVAL + CALL MC64QD(IP,LENL,LEN,W,WLEN,A,NVAL,BVAL) + IF (NVAL.LE.1) GO TO 99 +C Set LEN such that all matrix entries with value lt BVAL are +C discarded. Store old LEN in LENH. Do this for all columns W(K). +C Each step, either K is incremented or WLEN is decremented. + K = 1 + DO 70 IDUM3 = 1,N + IF (K.GT.WLEN) GO TO 71 + J = W(K) + DO 55 II = IP(J)+LEN(J)-1,IP(J)+LENL(J),-1 + IF (A(II).GE.BVAL) GO TO 60 + I = IRN(II) + IF (IW(I).NE.J) GO TO 55 +C Remove entry from matching + IW(I) = 0 + NUM = NUM - 1 + FC(N-NUM) = J + 55 CONTINUE + 60 LENH(J) = LEN(J) +C IP(J)+LEN(J)-1 is last entry in column ge BVAL + LEN(J) = II - IP(J) + 1 +C If LENH(J) = LENL(J), remove J from W + IF (LENL(J).EQ.LENH(J)) THEN + W(K) = W(WLEN) + WLEN = WLEN - 1 + ELSE + K = K + 1 + ENDIF + 70 CONTINUE + 71 IF (NUM.LT.NUMX) GO TO 81 + 80 CONTINUE +C End of dummy loop; this point is never reached +C Set mode for next call to MC64U/UD + 81 MOD = 1 + ELSE +C We do not have a maximum matching in IW. + BMAX = BVAL +C BMIN is the bottleneck value of a maximum matching; +C for BMAX the matching is not maximum, so BMAX>BMIN +C IF (BMAX .EQ. BMIN) GO TO 99 +C Find splitting value BVAL + CALL MC64QD(IP,LEN,LENH,W,WLEN,A,NVAL,BVAL) + IF (NVAL.EQ.0. OR. BVAL.EQ.BMIN) GO TO 99 +C Set LEN such that all matrix entries with value ge BVAL are +C inside matrix. Store old LEN in LENL. Do this for all columns W(K). +C Each step, either K is incremented or WLEN is decremented. + K = 1 + DO 87 IDUM3 = 1,N + IF (K.GT.WLEN) GO TO 88 + J = W(K) + DO 85 II = IP(J)+LEN(J),IP(J)+LENH(J)-1 + IF (A(II).LT.BVAL) GO TO 86 + 85 CONTINUE + 86 LENL(J) = LEN(J) + LEN(J) = II - IP(J) + IF (LENL(J).EQ.LENH(J)) THEN + W(K) = W(WLEN) + WLEN = WLEN - 1 + ELSE + K = K + 1 + ENDIF + 87 CONTINUE +C End of dummy loop; this point is never reached +C Set mode for next call to MC64U/UD + 88 MOD = 0 + ENDIF + CNT = CNT + 1 + CALL MC64UD(CNT,MOD,N,IRN,NE,IP,LEN,FC,IW,NUM,NUMX, + & IW4(1),IW4(N+1),IW4(2*N+1),IW4(3*N+1)) + +C IW contains maximum matching of length NUM + 90 CONTINUE +C End of dummy loop; this point is never reached + +C BMIN is bottleneck value of final matching + 99 IF (NUMX.EQ.N) GO TO 1000 +C The matrix is structurally singular, complete IPERM +C W, IW are work arrays + DO 300 J = 1,N + W(J) = 0 + 300 CONTINUE + K = 0 + DO 310 I = 1,N + IF (IPERM(I).EQ.0) THEN + K = K + 1 + IW(K) = I + ELSE + J = IPERM(I) + W(J) = I + ENDIF + 310 CONTINUE + K = 0 + DO 320 J = 1,N + IF (W(J).NE.0) GO TO 320 + K = K + 1 + IDUM1 = IW(K) + IPERM(IDUM1) = J + 320 CONTINUE + + 1000 RETURN + END + +C********************************************************************** + SUBROUTINE MC64QD(IP,LENL,LENH,W,WLEN,A,NVAL,VAL) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER WLEN,NVAL + INTEGER IP(*),LENL(*),LENH(*),W(*) + DOUBLE PRECISION A(*),VAL + +C This routine searches for at most XX different numerical values +C in the columns W(1:WLEN). XX>=2. +C Each column J is scanned between IP(J)+LENL(J) and IP(J)+LENH(J)-1 +C until XX values are found or all columns have been considered. +C On output, NVAL is the number of different values that is found +C and SPLIT(1:NVAL) contains the values in decreasing order. +C If NVAL > 0, the routine returns VAL = SPLIT((NVAL+1)/2). +C + INTEGER XX,J,K,II,S,POS + PARAMETER (XX=10) + DOUBLE PRECISION SPLIT(XX),HA + +C Scan columns in W(1:WLEN). For each encountered value, if value not +C already present in SPLIT(1:NVAL), insert value such that SPLIT +C remains sorted by decreasing value. +C The sorting is done by straightforward insertion; therefore the use +C of this routine should be avoided for large XX (XX < 20). + NVAL = 0 + DO 10 K = 1,WLEN + J = W(K) + DO 15 II = IP(J)+LENL(J),IP(J)+LENH(J)-1 + HA = A(II) + IF (NVAL.EQ.0) THEN + SPLIT(1) = HA + NVAL = 1 + ELSE +C Check presence of HA in SPLIT + DO 20 S = NVAL,1,-1 + IF (SPLIT(S).EQ.HA) GO TO 15 + IF (SPLIT(S).GT.HA) THEN + POS = S + 1 + GO TO 21 + ENDIF + 20 CONTINUE + POS = 1 +C The insertion + 21 DO 22 S = NVAL,POS,-1 + SPLIT(S+1) = SPLIT(S) + 22 CONTINUE + SPLIT(POS) = HA + NVAL = NVAL + 1 + ENDIF +C Exit loop if XX values are found + IF (NVAL.EQ.XX) GO TO 11 + 15 CONTINUE + 10 CONTINUE +C Determine VAL + 11 IF (NVAL.GT.0) VAL = SPLIT((NVAL+1)/2) + + RETURN + END + +C********************************************************************** + SUBROUTINE MC64UD(ID,MOD,N,IRN,LIRN,IP,LENC,FC,IPERM,NUM,NUMX, + & PR,ARP,CV,OUT) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER ID,MOD,N,LIRN,NUM,NUMX + INTEGER ARP(N),CV(N),IRN(LIRN),IP(N), + & FC(N),IPERM(N),LENC(N),OUT(N),PR(N) + +C PR(J) is the previous column to J in the depth first search. +C Array PR is used as workspace in the sorting algorithm. +C Elements (I,IPERM(I)) I=1,..,N are entries at the end of the +C algorithm unless N assignments have not been made in which case +C N-NUM pairs (I,IPERM(I)) will not be entries in the matrix. +C CV(I) is the most recent loop number (ID+JORD) at which row I +C was visited. +C ARP(J) is the number of entries in column J which have been scanned +C when looking for a cheap assignment. +C OUT(J) is one less than the number of entries in column J which have +C not been scanned during one pass through the main loop. +C NUMX is maximum possible size of matching. + + INTEGER I,II,IN1,IN2,J,J1,JORD,K,KK,LAST,NFC, + & NUM0,NUM1,NUM2,ID0,ID1 + + IF (ID.EQ.1) THEN +C The first call to MC64U/UD. +C Initialize CV and ARP; parameters MOD, NUMX are not accessed + DO 5 I = 1,N + CV(I) = 0 + ARP(I) = 0 + 5 CONTINUE + NUM1 = N + NUM2 = N + ELSE +C Not the first call to MC64U/UD. +C Re-initialize ARP if entries were deleted since last call to MC64U/UD + IF (MOD.EQ.1) THEN + DO 8 I = 1,N + ARP(I) = 0 + 8 CONTINUE + ENDIF + NUM1 = NUMX + NUM2 = N - NUMX + ENDIF + NUM0 = NUM + +C NUM0 is size of input matching +C NUM1 is maximum possible size of matching +C NUM2 is maximum allowed number of unassigned rows/columns +C NUM is size of current matching + +C Quick return if possible +C IF (NUM.EQ.N) GO TO 199 +C NFC is number of rows/columns that could not be assigned + NFC = 0 +C Integers ID0+1 to ID0+N are unique numbers for call ID to MC64U/UD, +C so 1st call uses 1..N, 2nd call uses N+1..2N, etc + ID0 = (ID-1)*N + +C Main loop. Each pass round this loop either results in a new +C assignment or gives a column with no assignment + + DO 100 JORD = NUM0+1,N + +C Each pass uses unique number ID1 + ID1 = ID0 + JORD +C J is unmatched column + J = FC(JORD-NUM0) + PR(J) = -1 + DO 70 K = 1,JORD +C Look for a cheap assignment + IF (ARP(J).GE.LENC(J)) GO TO 30 + IN1 = IP(J) + ARP(J) + IN2 = IP(J) + LENC(J) - 1 + DO 20 II = IN1,IN2 + I = IRN(II) + IF (IPERM(I).EQ.0) GO TO 80 + 20 CONTINUE +C No cheap assignment in row + ARP(J) = LENC(J) +C Begin looking for assignment chain starting with row J + 30 OUT(J) = LENC(J) - 1 +C Inner loop. Extends chain by one or backtracks + DO 60 KK = 1,JORD + IN1 = OUT(J) + IF (IN1.LT.0) GO TO 50 + IN2 = IP(J) + LENC(J) - 1 + IN1 = IN2 - IN1 +C Forward scan + DO 40 II = IN1,IN2 + I = IRN(II) + IF (CV(I).EQ.ID1) GO TO 40 +C Column J has not yet been accessed during this pass + J1 = J + J = IPERM(I) + CV(I) = ID1 + PR(J) = J1 + OUT(J1) = IN2 - II - 1 + GO TO 70 + 40 CONTINUE +C Backtracking step. + 50 J1 = PR(J) + IF (J1.EQ.-1) THEN +C No augmenting path exists for column J. + NFC = NFC + 1 + FC(NFC) = J + IF (NFC.GT.NUM2) THEN +C A matching of maximum size NUM1 is not possible + LAST = JORD + GO TO 101 + ENDIF + GO TO 100 + ENDIF + J = J1 + 60 CONTINUE +C End of dummy loop; this point is never reached + 70 CONTINUE +C End of dummy loop; this point is never reached + +C New assignment is made. + 80 IPERM(I) = J + ARP(J) = II - IP(J) + 1 + NUM = NUM + 1 + DO 90 K = 1,JORD + J = PR(J) + IF (J.EQ.-1) GO TO 95 + II = IP(J) + LENC(J) - OUT(J) - 2 + I = IRN(II) + IPERM(I) = J + 90 CONTINUE +C End of dummy loop; this point is never reached + + 95 IF (NUM.EQ.NUM1) THEN +C A matching of maximum size NUM1 is found + LAST = JORD + GO TO 101 + ENDIF +C + 100 CONTINUE + +C All unassigned columns have been considered + LAST = N + +C Now, a transversal is computed or is not possible. +C Complete FC before returning. + 101 DO 110 JORD = LAST+1,N + NFC = NFC + 1 + FC(NFC) = FC(JORD-NUM0) + 110 CONTINUE + +C 199 RETURN + RETURN + END + +C********************************************************************** + SUBROUTINE MC64WD(N,NE,IP,IRN,A,IPERM,NUM, + & JPERM,OUT,PR,Q,L,U,D) + IMPLICIT NONE +C +C *** Copyright (c) 1999 Council for the Central Laboratory of the +C Research Councils *** +C *** Although every effort has been made to ensure robustness and *** +C *** reliability of the subroutines in this MC64 suite, we *** +C *** disclaim any liability arising through the use or misuse of *** +C *** any of the subroutines. *** +C *** Any problems? Contact ... +C Iain Duff (I.Duff@rl.ac.uk) or Jacko Koster (jak@ii.uib.no) *** +C + INTEGER N,NE,NUM + INTEGER IP(N+1),IRN(NE),IPERM(N), + & JPERM(N),OUT(N),PR(N),Q(N),L(N) + DOUBLE PRECISION A(NE),U(N),D(N) + +C N, NE, IP, IRN are described in MC64A/AD. +C A is a REAL (DOUBLE PRECISION in the D-version) array of length NE. +C A(K), K=1..NE, must be set to the value of the entry that +C corresponds to IRN(K). It is not altered. +C All values A(K) must be non-negative. +C IPERM is an INTEGER array of length N. On exit, it contains the +C weighted matching: IPERM(I) = 0 or row I is matched to column +C IPERM(I). +C NUM is an INTEGER variable. On exit, it contains the cardinality of +C the matching stored in IPERM. +C IW is an INTEGER work array of length 5N. +C DW is a REAL (DOUBLE PRECISION in the D-version) array of length 2N. +C On exit, U = D(1:N) contains the dual row variable and +C V = D(N+1:2N) contains the dual column variable. If the matrix +C is structurally nonsingular (NUM = N), the following holds: +C U(I)+V(J) <= A(I,J) if IPERM(I) |= J +C U(I)+V(J) = A(I,J) if IPERM(I) = J +C U(I) = 0 if IPERM(I) = 0 +C V(J) = 0 if there is no I for which IPERM(I) = J + +C Local variables + INTEGER I,I0,II,J,JJ,JORD,Q0,QLEN,JDUM,ISP,JSP, + & K,K0,K1,K2,KK,KK1,KK2,UP,LOW + DOUBLE PRECISION CSP,DI,DMIN,DNEW,DQ0,VJ +C Local parameters + DOUBLE PRECISION RINF,ZERO + PARAMETER (ZERO=0.0D+0) +C External subroutines and/or functions +c EXTERNAL FD05AD,MC64DD,MC64ED,MC64FD +c DOUBLE PRECISION FD05AD + EXTERNAL MC64DD,MC64ED,MC64FD, DLAMCH + DOUBLE PRECISION DLAMCH + + +C Set RINF to largest positive real number +c XSL RINF = FD05AD(5) + RINF = DLAMCH('Overflow') + +C Initialization + NUM = 0 + DO 10 K = 1,N + U(K) = RINF + D(K) = ZERO + IPERM(K) = 0 + JPERM(K) = 0 + PR(K) = IP(K) + L(K) = 0 + 10 CONTINUE +C Initialize U(I) + DO 30 J = 1,N + DO 20 K = IP(J),IP(J+1)-1 + I = IRN(K) + IF (A(K).GT.U(I)) GO TO 20 + U(I) = A(K) + IPERM(I) = J + L(I) = K + 20 CONTINUE + 30 CONTINUE + DO 40 I = 1,N + J = IPERM(I) + IF (J.EQ.0) GO TO 40 +C Row I is not empty + IPERM(I) = 0 + IF (JPERM(J).NE.0) GO TO 40 +C Assignment of column J to row I + NUM = NUM + 1 + IPERM(I) = J + JPERM(J) = L(I) + 40 CONTINUE + IF (NUM.EQ.N) GO TO 1000 +C Scan unassigned columns; improve assignment + DO 95 J = 1,N +C JPERM(J) ne 0 iff column J is already assigned + IF (JPERM(J).NE.0) GO TO 95 + K1 = IP(J) + K2 = IP(J+1) - 1 +C Continue only if column J is not empty + IF (K1.GT.K2) GO TO 95 + VJ = RINF + DO 50 K = K1,K2 + I = IRN(K) + DI = A(K) - U(I) + IF (DI.GT.VJ) GO TO 50 + IF (DI.LT.VJ .OR. DI.EQ.RINF) GO TO 55 + IF (IPERM(I).NE.0 .OR. IPERM(I0).EQ.0) GO TO 50 + 55 VJ = DI + I0 = I + K0 = K + 50 CONTINUE + D(J) = VJ + K = K0 + I = I0 + IF (IPERM(I).EQ.0) GO TO 90 + DO 60 K = K0,K2 + I = IRN(K) + IF (A(K)-U(I).GT.VJ) GO TO 60 + JJ = IPERM(I) +C Scan remaining part of assigned column JJ + KK1 = PR(JJ) + KK2 = IP(JJ+1) - 1 + IF (KK1.GT.KK2) GO TO 60 + DO 70 KK = KK1,KK2 + II = IRN(KK) + IF (IPERM(II).GT.0) GO TO 70 + IF (A(KK)-U(II).LE.D(JJ)) GO TO 80 + 70 CONTINUE + PR(JJ) = KK2 + 1 + 60 CONTINUE + GO TO 95 + 80 JPERM(JJ) = KK + IPERM(II) = JJ + PR(JJ) = KK + 1 + 90 NUM = NUM + 1 + JPERM(J) = K + IPERM(I) = J + PR(J) = K + 1 + 95 CONTINUE + IF (NUM.EQ.N) GO TO 1000 + +C Prepare for main loop + DO 99 I = 1,N + D(I) = RINF + L(I) = 0 + 99 CONTINUE + +C Main loop ... each pass round this loop is similar to Dijkstra's +C algorithm for solving the single source shortest path problem + + DO 100 JORD = 1,N + + IF (JPERM(JORD).NE.0) GO TO 100 +C JORD is next unmatched column +C DMIN is the length of shortest path in the tree + DMIN = RINF + QLEN = 0 + LOW = N + 1 + UP = N + 1 +C CSP is the cost of the shortest augmenting path to unassigned row +C IRN(ISP). The corresponding column index is JSP. + CSP = RINF +C Build shortest path tree starting from unassigned column (root) JORD + J = JORD + PR(J) = -1 + +C Scan column J + DO 115 K = IP(J),IP(J+1)-1 + I = IRN(K) + DNEW = A(K) - U(I) + IF (DNEW.GE.CSP) GO TO 115 + IF (IPERM(I).EQ.0) THEN + CSP = DNEW + ISP = K + JSP = J + ELSE + IF (DNEW.LT.DMIN) DMIN = DNEW + D(I) = DNEW + QLEN = QLEN + 1 + Q(QLEN) = K + ENDIF + 115 CONTINUE +C Initialize heap Q and Q2 with rows held in Q(1:QLEN) + Q0 = QLEN + QLEN = 0 + DO 120 KK = 1,Q0 + K = Q(KK) + I = IRN(K) + IF (CSP.LE.D(I)) THEN + D(I) = RINF + GO TO 120 + ENDIF + IF (D(I).LE.DMIN) THEN + LOW = LOW - 1 + Q(LOW) = I + L(I) = LOW + ELSE + QLEN = QLEN + 1 + L(I) = QLEN + CALL MC64DD(I,N,Q,D,L,2) + ENDIF +C Update tree + JJ = IPERM(I) + OUT(JJ) = K + PR(JJ) = J + 120 CONTINUE + + DO 150 JDUM = 1,NUM + +C If Q2 is empty, extract rows from Q + IF (LOW.EQ.UP) THEN + IF (QLEN.EQ.0) GO TO 160 + I = Q(1) + IF (D(I).GE.CSP) GO TO 160 + DMIN = D(I) + 152 CALL MC64ED(QLEN,N,Q,D,L,2) + LOW = LOW - 1 + Q(LOW) = I + L(I) = LOW + IF (QLEN.EQ.0) GO TO 153 + I = Q(1) + IF (D(I).GT.DMIN) GO TO 153 + GO TO 152 + ENDIF +C Q0 is row whose distance D(Q0) to the root is smallest + 153 Q0 = Q(UP-1) + DQ0 = D(Q0) +C Exit loop if path to Q0 is longer than the shortest augmenting path + IF (DQ0.GE.CSP) GO TO 160 + UP = UP - 1 + +C Scan column that matches with row Q0 + J = IPERM(Q0) + VJ = DQ0 - A(JPERM(J)) + U(Q0) + DO 155 K = IP(J),IP(J+1)-1 + I = IRN(K) + IF (L(I).GE.UP) GO TO 155 +C DNEW is new cost + DNEW = VJ + A(K)-U(I) +C Do not update D(I) if DNEW ge cost of shortest path + IF (DNEW.GE.CSP) GO TO 155 + IF (IPERM(I).EQ.0) THEN +C Row I is unmatched; update shortest path info + CSP = DNEW + ISP = K + JSP = J + ELSE +C Row I is matched; do not update D(I) if DNEW is larger + DI = D(I) + IF (DI.LE.DNEW) GO TO 155 + IF (L(I).GE.LOW) GO TO 155 + D(I) = DNEW + IF (DNEW.LE.DMIN) THEN + IF (L(I).NE.0) + * CALL MC64FD(L(I),QLEN,N,Q,D,L,2) + LOW = LOW - 1 + Q(LOW) = I + L(I) = LOW + ELSE + IF (L(I).EQ.0) THEN + QLEN = QLEN + 1 + L(I) = QLEN + ENDIF + CALL MC64DD(I,N,Q,D,L,2) + ENDIF +C Update tree + JJ = IPERM(I) + OUT(JJ) = K + PR(JJ) = J + ENDIF + 155 CONTINUE + 150 CONTINUE + +C If CSP = RINF, no augmenting path is found + 160 IF (CSP.EQ.RINF) GO TO 190 +C Find augmenting path by tracing backward in PR; update IPERM,JPERM + NUM = NUM + 1 + I = IRN(ISP) + IPERM(I) = JSP + JPERM(JSP) = ISP + J = JSP + DO 170 JDUM = 1,NUM + JJ = PR(J) + IF (JJ.EQ.-1) GO TO 180 + K = OUT(J) + I = IRN(K) + IPERM(I) = JJ + JPERM(JJ) = K + J = JJ + 170 CONTINUE +C End of dummy loop; this point is never reached + +C Update U for rows in Q(UP:N) + 180 DO 185 KK = UP,N + I = Q(KK) + U(I) = U(I) + D(I) - CSP + 185 CONTINUE + 190 DO 191 KK = LOW,N + I = Q(KK) + D(I) = RINF + L(I) = 0 + 191 CONTINUE + DO 193 KK = 1,QLEN + I = Q(KK) + D(I) = RINF + L(I) = 0 + 193 CONTINUE + + 100 CONTINUE +C End of main loop + + +C Set dual column variable in D(1:N) + 1000 DO 200 J = 1,N + K = JPERM(J) + IF (K.NE.0) THEN + D(J) = A(K) - U(IRN(K)) + ELSE + D(J) = ZERO + ENDIF + IF (IPERM(J).EQ.0) U(J) = ZERO + 200 CONTINUE + + IF (NUM.EQ.N) GO TO 1100 + +C The matrix is structurally singular, complete IPERM. +C JPERM, OUT are work arrays + DO 300 J = 1,N + JPERM(J) = 0 + 300 CONTINUE + K = 0 + DO 310 I = 1,N + IF (IPERM(I).EQ.0) THEN + K = K + 1 + OUT(K) = I + ELSE + J = IPERM(I) + JPERM(J) = I + ENDIF + 310 CONTINUE + K = 0 + DO 320 J = 1,N + IF (JPERM(J).NE.0) GO TO 320 + K = K + 1 + JDUM = OUT(K) + IPERM(JDUM) = J + 320 CONTINUE + 1100 RETURN + END + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/memory.c b/thirdparty/superlu/SuperLU_4.1/SRC/memory.c new file mode 100644 index 0000000..4e15d6c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/memory.c @@ -0,0 +1,210 @@ +/*! @file memory.c + * \brief Precision-independent memory-related routines + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +/** Precision-independent memory-related routines. + (Shared by [sdcz]memory.c) **/ + +#include "slu_ddefs.h" + + +#if ( DEBUGlevel>=1 ) /* Debug malloc/free. */ +int superlu_malloc_total = 0; + +#define PAD_FACTOR 2 +#define DWORD (sizeof(double)) /* Be sure it's no smaller than double. */ +/* size_t is usually defined as 'unsigned long' */ + +void *superlu_malloc(size_t size) +{ + char *buf; + + buf = (char *) malloc(size + DWORD); + if ( !buf ) { + printf("superlu_malloc fails: malloc_total %.0f MB, size %ld\n", + superlu_malloc_total*1e-6, size); + ABORT("superlu_malloc: out of memory"); + } + + ((int_t *) buf)[0] = size; +#if 0 + superlu_malloc_total += size + DWORD; +#else + superlu_malloc_total += size; +#endif + return (void *) (buf + DWORD); +} + +void superlu_free(void *addr) +{ + char *p = ((char *) addr) - DWORD; + + if ( !addr ) + ABORT("superlu_free: tried to free NULL pointer"); + + if ( !p ) + ABORT("superlu_free: tried to free NULL+DWORD pointer"); + + { + int_t n = ((int_t *) p)[0]; + + if ( !n ) + ABORT("superlu_free: tried to free a freed pointer"); + *((int_t *) p) = 0; /* Set to zero to detect duplicate free's. */ +#if 0 + superlu_malloc_total -= (n + DWORD); +#else + superlu_malloc_total -= n; +#endif + + if ( superlu_malloc_total < 0 ) + ABORT("superlu_malloc_total went negative!"); + + /*free (addr);*/ + free (p); + } + +} + +#else /* production mode */ + +void *superlu_malloc(size_t size) +{ + void *buf; + buf = (void *) malloc(size); + return (buf); +} + +void superlu_free(void *addr) +{ + free (addr); +} + +#endif + + +/*! \brief Set up pointers for integer working arrays. + */ +void +SetIWork(int m, int n, int panel_size, int *iworkptr, int **segrep, + int **parent, int **xplore, int **repfnz, int **panel_lsub, + int **xprune, int **marker) +{ + *segrep = iworkptr; + *parent = iworkptr + m; + *xplore = *parent + m; + *repfnz = *xplore + m; + *panel_lsub = *repfnz + panel_size * m; + *xprune = *panel_lsub + panel_size * m; + *marker = *xprune + n; + ifill (*repfnz, m * panel_size, EMPTY); + ifill (*panel_lsub, m * panel_size, EMPTY); +} + + +void +copy_mem_int(int howmany, void *old, void *new) +{ + register int i; + int *iold = old; + int *inew = new; + for (i = 0; i < howmany; i++) inew[i] = iold[i]; +} + + +void +user_bcopy(char *src, char *dest, int bytes) +{ + char *s_ptr, *d_ptr; + + s_ptr = src + bytes - 1; + d_ptr = dest + bytes - 1; + for (; d_ptr >= dest; --s_ptr, --d_ptr ) *d_ptr = *s_ptr; +} + + + +int *intMalloc(int n) +{ + int *buf; + buf = (int *) SUPERLU_MALLOC((size_t) n * sizeof(int)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC fails for buf in intMalloc()"); + } + return (buf); +} + +int *intCalloc(int n) +{ + int *buf; + register int i; + buf = (int *) SUPERLU_MALLOC(n * sizeof(int)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC fails for buf in intCalloc()"); + } + for (i = 0; i < n; ++i) buf[i] = 0; + return (buf); +} + + + +#if 0 +check_expanders() +{ + int p; + printf("Check expanders:\n"); + for (p = 0; p < NO_MEMTYPE; p++) { + printf("type %d, size %d, mem %d\n", + p, expanders[p].size, (int)expanders[p].mem); + } + + return 0; +} + + +StackInfo() +{ + printf("Stack: size %d, used %d, top1 %d, top2 %d\n", + stack.size, stack.used, stack.top1, stack.top2); + return 0; +} + + + +PrintStack(char *msg, GlobalLU_t *Glu) +{ + int i; + int *xlsub, *lsub, *xusub, *usub; + + xlsub = Glu->xlsub; + lsub = Glu->lsub; + xusub = Glu->xusub; + usub = Glu->usub; + + printf("%s\n", msg); + +/* printf("\nUCOL: "); + for (i = 0; i < xusub[ndim]; ++i) + printf("%f ", ucol[i]); + + printf("\nLSUB: "); + for (i = 0; i < xlsub[ndim]; ++i) + printf("%d ", lsub[i]); + + printf("\nUSUB: "); + for (i = 0; i < xusub[ndim]; ++i) + printf("%d ", usub[i]); + + printf("\n");*/ + return 0; +} +#endif + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/mmd.c b/thirdparty/superlu/SuperLU_4.1/SRC/mmd.c new file mode 100644 index 0000000..05f26ce --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/mmd.c @@ -0,0 +1,1012 @@ + +typedef int shortint; + +/* *************************************************************** */ +/* *************************************************************** */ +/* **** GENMMD ..... MULTIPLE MINIMUM EXTERNAL DEGREE **** */ +/* *************************************************************** */ +/* *************************************************************** */ + +/* AUTHOR - JOSEPH W.H. LIU */ +/* DEPT OF COMPUTER SCIENCE, YORK UNIVERSITY. */ + +/* PURPOSE - THIS ROUTINE IMPLEMENTS THE MINIMUM DEGREE */ +/* ALGORITHM. IT MAKES USE OF THE IMPLICIT REPRESENTATION */ +/* OF ELIMINATION GRAPHS BY QUOTIENT GRAPHS, AND THE */ +/* NOTION OF INDISTINGUISHABLE NODES. IT ALSO IMPLEMENTS */ +/* THE MODIFICATIONS BY MULTIPLE ELIMINATION AND MINIMUM */ +/* EXTERNAL DEGREE. */ +/* --------------------------------------------- */ +/* CAUTION - THE ADJACENCY VECTOR ADJNCY WILL BE */ +/* DESTROYED. */ +/* --------------------------------------------- */ + +/* INPUT PARAMETERS - */ +/* NEQNS - NUMBER OF EQUATIONS. */ +/* (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE. */ +/* DELTA - TOLERANCE VALUE FOR MULTIPLE ELIMINATION. */ +/* MAXINT - MAXIMUM MACHINE REPRESENTABLE (SHORT) INTEGER */ +/* (ANY SMALLER ESTIMATE WILL DO) FOR MARKING */ +/* NODES. */ + +/* OUTPUT PARAMETERS - */ +/* PERM - THE MINIMUM DEGREE ORDERING. */ +/* INVP - THE INVERSE OF PERM. */ +/* NOFSUB - AN UPPER BOUND ON THE NUMBER OF NONZERO */ +/* SUBSCRIPTS FOR THE COMPRESSED STORAGE SCHEME. */ + +/* WORKING PARAMETERS - */ +/* DHEAD - VECTOR FOR HEAD OF DEGREE LISTS. */ +/* INVP - USED TEMPORARILY FOR DEGREE FORWARD LINK. */ +/* PERM - USED TEMPORARILY FOR DEGREE BACKWARD LINK. */ +/* QSIZE - VECTOR FOR SIZE OF SUPERNODES. */ +/* LLIST - VECTOR FOR TEMPORARY LINKED LISTS. */ +/* MARKER - A TEMPORARY MARKER VECTOR. */ + +/* PROGRAM SUBROUTINES - */ +/* MMDELM, MMDINT, MMDNUM, MMDUPD. */ + +/* *************************************************************** */ + +/* Subroutine */ int genmmd_(int *neqns, int *xadj, shortint *adjncy, + shortint *invp, shortint *perm, int *delta, shortint *dhead, + shortint *qsize, shortint *llist, shortint *marker, int *maxint, + int *nofsub) +{ + /* System generated locals */ + int i__1; + + /* Local variables */ + static int mdeg, ehead, i, mdlmt, mdnode; + extern /* Subroutine */ int mmdelm_(int *, int *, shortint *, + shortint *, shortint *, shortint *, shortint *, shortint *, + shortint *, int *, int *), mmdupd_(int *, int *, + int *, shortint *, int *, int *, shortint *, shortint + *, shortint *, shortint *, shortint *, shortint *, int *, + int *), mmdint_(int *, int *, shortint *, shortint *, + shortint *, shortint *, shortint *, shortint *, shortint *), + mmdnum_(int *, shortint *, shortint *, shortint *); + static int nextmd, tag, num; + + +/* *************************************************************** */ + + +/* *************************************************************** */ + + /* Parameter adjustments */ + --marker; + --llist; + --qsize; + --dhead; + --perm; + --invp; + --adjncy; + --xadj; + + /* Function Body */ + if (*neqns <= 0) { + return 0; + } + +/* ------------------------------------------------ */ +/* INITIALIZATION FOR THE MINIMUM DEGREE ALGORITHM. */ +/* ------------------------------------------------ */ + *nofsub = 0; + mmdint_(neqns, &xadj[1], &adjncy[1], &dhead[1], &invp[1], &perm[1], & + qsize[1], &llist[1], &marker[1]); + +/* ---------------------------------------------- */ +/* NUM COUNTS THE NUMBER OF ORDERED NODES PLUS 1. */ +/* ---------------------------------------------- */ + num = 1; + +/* ----------------------------- */ +/* ELIMINATE ALL ISOLATED NODES. */ +/* ----------------------------- */ + nextmd = dhead[1]; +L100: + if (nextmd <= 0) { + goto L200; + } + mdnode = nextmd; + nextmd = invp[mdnode]; + marker[mdnode] = *maxint; + invp[mdnode] = -num; + ++num; + goto L100; + +L200: +/* ---------------------------------------- */ +/* SEARCH FOR NODE OF THE MINIMUM DEGREE. */ +/* MDEG IS THE CURRENT MINIMUM DEGREE; */ +/* TAG IS USED TO FACILITATE MARKING NODES. */ +/* ---------------------------------------- */ + if (num > *neqns) { + goto L1000; + } + tag = 1; + dhead[1] = 0; + mdeg = 2; +L300: + if (dhead[mdeg] > 0) { + goto L400; + } + ++mdeg; + goto L300; +L400: +/* ------------------------------------------------- */ +/* USE VALUE OF DELTA TO SET UP MDLMT, WHICH GOVERNS */ +/* WHEN A DEGREE UPDATE IS TO BE PERFORMED. */ +/* ------------------------------------------------- */ + mdlmt = mdeg + *delta; + ehead = 0; + +L500: + mdnode = dhead[mdeg]; + if (mdnode > 0) { + goto L600; + } + ++mdeg; + if (mdeg > mdlmt) { + goto L900; + } + goto L500; +L600: +/* ---------------------------------------- */ +/* REMOVE MDNODE FROM THE DEGREE STRUCTURE. */ +/* ---------------------------------------- */ + nextmd = invp[mdnode]; + dhead[mdeg] = nextmd; + if (nextmd > 0) { + perm[nextmd] = -mdeg; + } + invp[mdnode] = -num; + *nofsub = *nofsub + mdeg + qsize[mdnode] - 2; + if (num + qsize[mdnode] > *neqns) { + goto L1000; + } +/* ---------------------------------------------- */ +/* ELIMINATE MDNODE AND PERFORM QUOTIENT GRAPH */ +/* TRANSFORMATION. RESET TAG VALUE IF NECESSARY. */ +/* ---------------------------------------------- */ + ++tag; + if (tag < *maxint) { + goto L800; + } + tag = 1; + i__1 = *neqns; + for (i = 1; i <= i__1; ++i) { + if (marker[i] < *maxint) { + marker[i] = 0; + } +/* L700: */ + } +L800: + mmdelm_(&mdnode, &xadj[1], &adjncy[1], &dhead[1], &invp[1], &perm[1], & + qsize[1], &llist[1], &marker[1], maxint, &tag); + num += qsize[mdnode]; + llist[mdnode] = ehead; + ehead = mdnode; + if (*delta >= 0) { + goto L500; + } +L900: +/* ------------------------------------------- */ +/* UPDATE DEGREES OF THE NODES INVOLVED IN THE */ +/* MINIMUM DEGREE NODES ELIMINATION. */ +/* ------------------------------------------- */ + if (num > *neqns) { + goto L1000; + } + mmdupd_(&ehead, neqns, &xadj[1], &adjncy[1], delta, &mdeg, &dhead[1], & + invp[1], &perm[1], &qsize[1], &llist[1], &marker[1], maxint, &tag) + ; + goto L300; + +L1000: + mmdnum_(neqns, &perm[1], &invp[1], &qsize[1]); + return 0; + +} /* genmmd_ */ + +/* *************************************************************** */ +/* *************************************************************** */ +/* *** MMDINT ..... MULT MINIMUM DEGREE INITIALIZATION *** */ +/* *************************************************************** */ +/* *************************************************************** */ + +/* AUTHOR - JOSEPH W.H. LIU */ +/* DEPT OF COMPUTER SCIENCE, YORK UNIVERSITY. */ + +/* PURPOSE - THIS ROUTINE PERFORMS INITIALIZATION FOR THE */ +/* MULTIPLE ELIMINATION VERSION OF THE MINIMUM DEGREE */ +/* ALGORITHM. */ + +/* INPUT PARAMETERS - */ +/* NEQNS - NUMBER OF EQUATIONS. */ +/* (XADJ,ADJNCY) - ADJACENCY STRUCTURE. */ + +/* OUTPUT PARAMETERS - */ +/* (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE. */ +/* QSIZE - SIZE OF SUPERNODE (INITIALIZED TO ONE). */ +/* LLIST - LINKED LIST. */ +/* MARKER - MARKER VECTOR. */ + +/* *************************************************************** */ + +/* Subroutine */ int mmdint_(int *neqns, int *xadj, shortint *adjncy, + shortint *dhead, shortint *dforw, shortint *dbakw, shortint *qsize, + shortint *llist, shortint *marker) +{ + /* System generated locals */ + int i__1; + + /* Local variables */ + static int ndeg, node, fnode; + + +/* *************************************************************** */ + + +/* *************************************************************** */ + + /* Parameter adjustments */ + --marker; + --llist; + --qsize; + --dbakw; + --dforw; + --dhead; + --adjncy; + --xadj; + + /* Function Body */ + i__1 = *neqns; + for (node = 1; node <= i__1; ++node) { + dhead[node] = 0; + qsize[node] = 1; + marker[node] = 0; + llist[node] = 0; +/* L100: */ + } +/* ------------------------------------------ */ +/* INITIALIZE THE DEGREE DOUBLY LINKED LISTS. */ +/* ------------------------------------------ */ + i__1 = *neqns; + for (node = 1; node <= i__1; ++node) { + ndeg = xadj[node + 1] - xadj[node] + 1; + fnode = dhead[ndeg]; + dforw[node] = fnode; + dhead[ndeg] = node; + if (fnode > 0) { + dbakw[fnode] = node; + } + dbakw[node] = -ndeg; +/* L200: */ + } + return 0; + +} /* mmdint_ */ + +/* *************************************************************** */ +/* *************************************************************** */ +/* ** MMDELM ..... MULTIPLE MINIMUM DEGREE ELIMINATION *** */ +/* *************************************************************** */ +/* *************************************************************** */ + +/* AUTHOR - JOSEPH W.H. LIU */ +/* DEPT OF COMPUTER SCIENCE, YORK UNIVERSITY. */ + +/* PURPOSE - THIS ROUTINE ELIMINATES THE NODE MDNODE OF */ +/* MINIMUM DEGREE FROM THE ADJACENCY STRUCTURE, WHICH */ +/* IS STORED IN THE QUOTIENT GRAPH FORMAT. IT ALSO */ +/* TRANSFORMS THE QUOTIENT GRAPH REPRESENTATION OF THE */ +/* ELIMINATION GRAPH. */ + +/* INPUT PARAMETERS - */ +/* MDNODE - NODE OF MINIMUM DEGREE. */ +/* MAXINT - ESTIMATE OF MAXIMUM REPRESENTABLE (SHORT) */ +/* INT. */ +/* TAG - TAG VALUE. */ + +/* UPDATED PARAMETERS - */ +/* (XADJ,ADJNCY) - UPDATED ADJACENCY STRUCTURE. */ +/* (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE. */ +/* QSIZE - SIZE OF SUPERNODE. */ +/* MARKER - MARKER VECTOR. */ +/* LLIST - TEMPORARY LINKED LIST OF ELIMINATED NABORS. */ + +/* *************************************************************** */ + +/* Subroutine */ int mmdelm_(int *mdnode, int *xadj, shortint *adjncy, + shortint *dhead, shortint *dforw, shortint *dbakw, shortint *qsize, + shortint *llist, shortint *marker, int *maxint, int *tag) +{ + /* System generated locals */ + int i__1, i__2; + + /* Local variables */ + static int node, link, rloc, rlmt, i, j, nabor, rnode, elmnt, xqnbr, + istop, jstop, istrt, jstrt, nxnode, pvnode, nqnbrs, npv; + + +/* *************************************************************** */ + + +/* *************************************************************** */ + +/* ----------------------------------------------- */ +/* FIND REACHABLE SET AND PLACE IN DATA STRUCTURE. */ +/* ----------------------------------------------- */ + /* Parameter adjustments */ + --marker; + --llist; + --qsize; + --dbakw; + --dforw; + --dhead; + --adjncy; + --xadj; + + /* Function Body */ + marker[*mdnode] = *tag; + istrt = xadj[*mdnode]; + istop = xadj[*mdnode + 1] - 1; +/* ------------------------------------------------------- */ +/* ELMNT POINTS TO THE BEGINNING OF THE LIST OF ELIMINATED */ +/* NABORS OF MDNODE, AND RLOC GIVES THE STORAGE LOCATION */ +/* FOR THE NEXT REACHABLE NODE. */ +/* ------------------------------------------------------- */ + elmnt = 0; + rloc = istrt; + rlmt = istop; + i__1 = istop; + for (i = istrt; i <= i__1; ++i) { + nabor = adjncy[i]; + if (nabor == 0) { + goto L300; + } + if (marker[nabor] >= *tag) { + goto L200; + } + marker[nabor] = *tag; + if (dforw[nabor] < 0) { + goto L100; + } + adjncy[rloc] = nabor; + ++rloc; + goto L200; +L100: + llist[nabor] = elmnt; + elmnt = nabor; +L200: + ; + } +L300: +/* ----------------------------------------------------- */ +/* MERGE WITH REACHABLE NODES FROM GENERALIZED ELEMENTS. */ +/* ----------------------------------------------------- */ + if (elmnt <= 0) { + goto L1000; + } + adjncy[rlmt] = -elmnt; + link = elmnt; +L400: + jstrt = xadj[link]; + jstop = xadj[link + 1] - 1; + i__1 = jstop; + for (j = jstrt; j <= i__1; ++j) { + node = adjncy[j]; + link = -node; + if (node < 0) { + goto L400; + } else if (node == 0) { + goto L900; + } else { + goto L500; + } +L500: + if (marker[node] >= *tag || dforw[node] < 0) { + goto L800; + } + marker[node] = *tag; +/* --------------------------------- */ +/* USE STORAGE FROM ELIMINATED NODES */ +/* IF NECESSARY. */ +/* --------------------------------- */ +L600: + if (rloc < rlmt) { + goto L700; + } + link = -adjncy[rlmt]; + rloc = xadj[link]; + rlmt = xadj[link + 1] - 1; + goto L600; +L700: + adjncy[rloc] = node; + ++rloc; +L800: + ; + } +L900: + elmnt = llist[elmnt]; + goto L300; +L1000: + if (rloc <= rlmt) { + adjncy[rloc] = 0; + } +/* -------------------------------------------------------- */ +/* FOR EACH NODE IN THE REACHABLE SET, DO THE FOLLOWING ... */ +/* -------------------------------------------------------- */ + link = *mdnode; +L1100: + istrt = xadj[link]; + istop = xadj[link + 1] - 1; + i__1 = istop; + for (i = istrt; i <= i__1; ++i) { + rnode = adjncy[i]; + link = -rnode; + if (rnode < 0) { + goto L1100; + } else if (rnode == 0) { + goto L1800; + } else { + goto L1200; + } +L1200: +/* -------------------------------------------- */ +/* IF RNODE IS IN THE DEGREE LIST STRUCTURE ... */ +/* -------------------------------------------- */ + pvnode = dbakw[rnode]; + if (pvnode == 0 || pvnode == -(*maxint)) { + goto L1300; + } +/* ------------------------------------- */ +/* THEN REMOVE RNODE FROM THE STRUCTURE. */ +/* ------------------------------------- */ + nxnode = dforw[rnode]; + if (nxnode > 0) { + dbakw[nxnode] = pvnode; + } + if (pvnode > 0) { + dforw[pvnode] = nxnode; + } + npv = -pvnode; + if (pvnode < 0) { + dhead[npv] = nxnode; + } +L1300: +/* ---------------------------------------- */ +/* PURGE INACTIVE QUOTIENT NABORS OF RNODE. */ +/* ---------------------------------------- */ + jstrt = xadj[rnode]; + jstop = xadj[rnode + 1] - 1; + xqnbr = jstrt; + i__2 = jstop; + for (j = jstrt; j <= i__2; ++j) { + nabor = adjncy[j]; + if (nabor == 0) { + goto L1500; + } + if (marker[nabor] >= *tag) { + goto L1400; + } + adjncy[xqnbr] = nabor; + ++xqnbr; +L1400: + ; + } +L1500: +/* ---------------------------------------- */ +/* IF NO ACTIVE NABOR AFTER THE PURGING ... */ +/* ---------------------------------------- */ + nqnbrs = xqnbr - jstrt; + if (nqnbrs > 0) { + goto L1600; + } +/* ----------------------------- */ +/* THEN MERGE RNODE WITH MDNODE. */ +/* ----------------------------- */ + qsize[*mdnode] += qsize[rnode]; + qsize[rnode] = 0; + marker[rnode] = *maxint; + dforw[rnode] = -(*mdnode); + dbakw[rnode] = -(*maxint); + goto L1700; +L1600: +/* -------------------------------------- */ +/* ELSE FLAG RNODE FOR DEGREE UPDATE, AND */ +/* ADD MDNODE AS A NABOR OF RNODE. */ +/* -------------------------------------- */ + dforw[rnode] = nqnbrs + 1; + dbakw[rnode] = 0; + adjncy[xqnbr] = *mdnode; + ++xqnbr; + if (xqnbr <= jstop) { + adjncy[xqnbr] = 0; + } + +L1700: + ; + } +L1800: + return 0; + +} /* mmdelm_ */ + +/* *************************************************************** */ +/* *************************************************************** */ +/* ***** MMDUPD ..... MULTIPLE MINIMUM DEGREE UPDATE ***** */ +/* *************************************************************** */ +/* *************************************************************** */ + +/* AUTHOR - JOSEPH W.H. LIU */ +/* DEPT OF COMPUTER SCIENCE, YORK UNIVERSITY. */ + +/* PURPOSE - THIS ROUTINE UPDATES THE DEGREES OF NODES */ +/* AFTER A MULTIPLE ELIMINATION STEP. */ + +/* INPUT PARAMETERS - */ +/* EHEAD - THE BEGINNING OF THE LIST OF ELIMINATED */ +/* NODES (I.E., NEWLY FORMED ELEMENTS). */ +/* NEQNS - NUMBER OF EQUATIONS. */ +/* (XADJ,ADJNCY) - ADJACENCY STRUCTURE. */ +/* DELTA - TOLERANCE VALUE FOR MULTIPLE ELIMINATION. */ +/* MAXINT - MAXIMUM MACHINE REPRESENTABLE (SHORT) */ +/* INTEGER. */ + +/* UPDATED PARAMETERS - */ +/* MDEG - NEW MINIMUM DEGREE AFTER DEGREE UPDATE. */ +/* (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE. */ +/* QSIZE - SIZE OF SUPERNODE. */ +/* LLIST - WORKING LINKED LIST. */ +/* MARKER - MARKER VECTOR FOR DEGREE UPDATE. */ +/* TAG - TAG VALUE. */ + +/* *************************************************************** */ + +/* Subroutine */ int mmdupd_(int *ehead, int *neqns, int *xadj, + shortint *adjncy, int *delta, int *mdeg, shortint *dhead, + shortint *dforw, shortint *dbakw, shortint *qsize, shortint *llist, + shortint *marker, int *maxint, int *tag) +{ + /* System generated locals */ + int i__1, i__2; + + /* Local variables */ + static int node, mtag, link, mdeg0, i, j, enode, fnode, nabor, elmnt, + istop, jstop, q2head, istrt, jstrt, qxhead, iq2, deg, deg0; + + +/* *************************************************************** */ + + +/* *************************************************************** */ + + /* Parameter adjustments */ + --marker; + --llist; + --qsize; + --dbakw; + --dforw; + --dhead; + --adjncy; + --xadj; + + /* Function Body */ + mdeg0 = *mdeg + *delta; + elmnt = *ehead; +L100: +/* ------------------------------------------------------- */ +/* FOR EACH OF THE NEWLY FORMED ELEMENT, DO THE FOLLOWING. */ +/* (RESET TAG VALUE IF NECESSARY.) */ +/* ------------------------------------------------------- */ + if (elmnt <= 0) { + return 0; + } + mtag = *tag + mdeg0; + if (mtag < *maxint) { + goto L300; + } + *tag = 1; + i__1 = *neqns; + for (i = 1; i <= i__1; ++i) { + if (marker[i] < *maxint) { + marker[i] = 0; + } +/* L200: */ + } + mtag = *tag + mdeg0; +L300: +/* --------------------------------------------- */ +/* CREATE TWO LINKED LISTS FROM NODES ASSOCIATED */ +/* WITH ELMNT: ONE WITH TWO NABORS (Q2HEAD) IN */ +/* ADJACENCY STRUCTURE, AND THE OTHER WITH MORE */ +/* THAN TWO NABORS (QXHEAD). ALSO COMPUTE DEG0, */ +/* NUMBER OF NODES IN THIS ELEMENT. */ +/* --------------------------------------------- */ + q2head = 0; + qxhead = 0; + deg0 = 0; + link = elmnt; +L400: + istrt = xadj[link]; + istop = xadj[link + 1] - 1; + i__1 = istop; + for (i = istrt; i <= i__1; ++i) { + enode = adjncy[i]; + link = -enode; + if (enode < 0) { + goto L400; + } else if (enode == 0) { + goto L800; + } else { + goto L500; + } + +L500: + if (qsize[enode] == 0) { + goto L700; + } + deg0 += qsize[enode]; + marker[enode] = mtag; +/* ---------------------------------- */ +/* IF ENODE REQUIRES A DEGREE UPDATE, */ +/* THEN DO THE FOLLOWING. */ +/* ---------------------------------- */ + if (dbakw[enode] != 0) { + goto L700; + } +/* --------------------------------------- +*/ +/* PLACE EITHER IN QXHEAD OR Q2HEAD LISTS. +*/ +/* --------------------------------------- +*/ + if (dforw[enode] == 2) { + goto L600; + } + llist[enode] = qxhead; + qxhead = enode; + goto L700; +L600: + llist[enode] = q2head; + q2head = enode; +L700: + ; + } +L800: +/* -------------------------------------------- */ +/* FOR EACH ENODE IN Q2 LIST, DO THE FOLLOWING. */ +/* -------------------------------------------- */ + enode = q2head; + iq2 = 1; +L900: + if (enode <= 0) { + goto L1500; + } + if (dbakw[enode] != 0) { + goto L2200; + } + ++(*tag); + deg = deg0; +/* ------------------------------------------ */ +/* IDENTIFY THE OTHER ADJACENT ELEMENT NABOR. */ +/* ------------------------------------------ */ + istrt = xadj[enode]; + nabor = adjncy[istrt]; + if (nabor == elmnt) { + nabor = adjncy[istrt + 1]; + } +/* ------------------------------------------------ */ +/* IF NABOR IS UNELIMINATED, INCREASE DEGREE COUNT. */ +/* ------------------------------------------------ */ + link = nabor; + if (dforw[nabor] < 0) { + goto L1000; + } + deg += qsize[nabor]; + goto L2100; +L1000: +/* -------------------------------------------- */ +/* OTHERWISE, FOR EACH NODE IN THE 2ND ELEMENT, */ +/* DO THE FOLLOWING. */ +/* -------------------------------------------- */ + istrt = xadj[link]; + istop = xadj[link + 1] - 1; + i__1 = istop; + for (i = istrt; i <= i__1; ++i) { + node = adjncy[i]; + link = -node; + if (node == enode) { + goto L1400; + } + if (node < 0) { + goto L1000; + } else if (node == 0) { + goto L2100; + } else { + goto L1100; + } + +L1100: + if (qsize[node] == 0) { + goto L1400; + } + if (marker[node] >= *tag) { + goto L1200; + } +/* ----------------------------------- +-- */ +/* CASE WHEN NODE IS NOT YET CONSIDERED +. */ +/* ----------------------------------- +-- */ + marker[node] = *tag; + deg += qsize[node]; + goto L1400; +L1200: +/* ---------------------------------------- + */ +/* CASE WHEN NODE IS INDISTINGUISHABLE FROM + */ +/* ENODE. MERGE THEM INTO A NEW SUPERNODE. + */ +/* ---------------------------------------- + */ + if (dbakw[node] != 0) { + goto L1400; + } + if (dforw[node] != 2) { + goto L1300; + } + qsize[enode] += qsize[node]; + qsize[node] = 0; + marker[node] = *maxint; + dforw[node] = -enode; + dbakw[node] = -(*maxint); + goto L1400; +L1300: +/* -------------------------------------- +*/ +/* CASE WHEN NODE IS OUTMATCHED BY ENODE. +*/ +/* -------------------------------------- +*/ + if (dbakw[node] == 0) { + dbakw[node] = -(*maxint); + } +L1400: + ; + } + goto L2100; +L1500: +/* ------------------------------------------------ */ +/* FOR EACH ENODE IN THE QX LIST, DO THE FOLLOWING. */ +/* ------------------------------------------------ */ + enode = qxhead; + iq2 = 0; +L1600: + if (enode <= 0) { + goto L2300; + } + if (dbakw[enode] != 0) { + goto L2200; + } + ++(*tag); + deg = deg0; +/* --------------------------------- */ +/* FOR EACH UNMARKED NABOR OF ENODE, */ +/* DO THE FOLLOWING. */ +/* --------------------------------- */ + istrt = xadj[enode]; + istop = xadj[enode + 1] - 1; + i__1 = istop; + for (i = istrt; i <= i__1; ++i) { + nabor = adjncy[i]; + if (nabor == 0) { + goto L2100; + } + if (marker[nabor] >= *tag) { + goto L2000; + } + marker[nabor] = *tag; + link = nabor; +/* ------------------------------ */ +/* IF UNELIMINATED, INCLUDE IT IN */ +/* DEG COUNT. */ +/* ------------------------------ */ + if (dforw[nabor] < 0) { + goto L1700; + } + deg += qsize[nabor]; + goto L2000; +L1700: +/* ------------------------------- +*/ +/* IF ELIMINATED, INCLUDE UNMARKED +*/ +/* NODES IN THIS ELEMENT INTO THE +*/ +/* DEGREE COUNT. */ +/* ------------------------------- +*/ + jstrt = xadj[link]; + jstop = xadj[link + 1] - 1; + i__2 = jstop; + for (j = jstrt; j <= i__2; ++j) { + node = adjncy[j]; + link = -node; + if (node < 0) { + goto L1700; + } else if (node == 0) { + goto L2000; + } else { + goto L1800; + } + +L1800: + if (marker[node] >= *tag) { + goto L1900; + } + marker[node] = *tag; + deg += qsize[node]; +L1900: + ; + } +L2000: + ; + } +L2100: +/* ------------------------------------------- */ +/* UPDATE EXTERNAL DEGREE OF ENODE IN DEGREE */ +/* STRUCTURE, AND MDEG (MIN DEG) IF NECESSARY. */ +/* ------------------------------------------- */ + deg = deg - qsize[enode] + 1; + fnode = dhead[deg]; + dforw[enode] = fnode; + dbakw[enode] = -deg; + if (fnode > 0) { + dbakw[fnode] = enode; + } + dhead[deg] = enode; + if (deg < *mdeg) { + *mdeg = deg; + } +L2200: +/* ---------------------------------- */ +/* GET NEXT ENODE IN CURRENT ELEMENT. */ +/* ---------------------------------- */ + enode = llist[enode]; + if (iq2 == 1) { + goto L900; + } + goto L1600; +L2300: +/* ----------------------------- */ +/* GET NEXT ELEMENT IN THE LIST. */ +/* ----------------------------- */ + *tag = mtag; + elmnt = llist[elmnt]; + goto L100; + +} /* mmdupd_ */ + +/* *************************************************************** */ +/* *************************************************************** */ +/* ***** MMDNUM ..... MULTI MINIMUM DEGREE NUMBERING ***** */ +/* *************************************************************** */ +/* *************************************************************** */ + +/* AUTHOR - JOSEPH W.H. LIU */ +/* DEPT OF COMPUTER SCIENCE, YORK UNIVERSITY. */ + +/* PURPOSE - THIS ROUTINE PERFORMS THE FINAL STEP IN */ +/* PRODUCING THE PERMUTATION AND INVERSE PERMUTATION */ +/* VECTORS IN THE MULTIPLE ELIMINATION VERSION OF THE */ +/* MINIMUM DEGREE ORDERING ALGORITHM. */ + +/* INPUT PARAMETERS - */ +/* NEQNS - NUMBER OF EQUATIONS. */ +/* QSIZE - SIZE OF SUPERNODES AT ELIMINATION. */ + +/* UPDATED PARAMETERS - */ +/* INVP - INVERSE PERMUTATION VECTOR. ON INPUT, */ +/* IF QSIZE(NODE)=0, THEN NODE HAS BEEN MERGED */ +/* INTO THE NODE -INVP(NODE); OTHERWISE, */ +/* -INVP(NODE) IS ITS INVERSE LABELLING. */ + +/* OUTPUT PARAMETERS - */ +/* PERM - THE PERMUTATION VECTOR. */ + +/* *************************************************************** */ + +/* Subroutine */ int mmdnum_(int *neqns, shortint *perm, shortint *invp, + shortint *qsize) +{ + /* System generated locals */ + int i__1; + + /* Local variables */ + static int node, root, nextf, father, nqsize, num; + + +/* *************************************************************** */ + + +/* *************************************************************** */ + + /* Parameter adjustments */ + --qsize; + --invp; + --perm; + + /* Function Body */ + i__1 = *neqns; + for (node = 1; node <= i__1; ++node) { + nqsize = qsize[node]; + if (nqsize <= 0) { + perm[node] = invp[node]; + } + if (nqsize > 0) { + perm[node] = -invp[node]; + } +/* L100: */ + } +/* ------------------------------------------------------ */ +/* FOR EACH NODE WHICH HAS BEEN MERGED, DO THE FOLLOWING. */ +/* ------------------------------------------------------ */ + i__1 = *neqns; + for (node = 1; node <= i__1; ++node) { + if (perm[node] > 0) { + goto L500; + } +/* ----------------------------------------- */ +/* TRACE THE MERGED TREE UNTIL ONE WHICH HAS */ +/* NOT BEEN MERGED, CALL IT ROOT. */ +/* ----------------------------------------- */ + father = node; +L200: + if (perm[father] > 0) { + goto L300; + } + father = -perm[father]; + goto L200; +L300: +/* ----------------------- */ +/* NUMBER NODE AFTER ROOT. */ +/* ----------------------- */ + root = father; + num = perm[root] + 1; + invp[node] = -num; + perm[root] = num; +/* ------------------------ */ +/* SHORTEN THE MERGED TREE. */ +/* ------------------------ */ + father = node; +L400: + nextf = -perm[father]; + if (nextf <= 0) { + goto L500; + } + perm[father] = -root; + father = nextf; + goto L400; +L500: + ; + } +/* ---------------------- */ +/* READY TO COMPUTE PERM. */ +/* ---------------------- */ + i__1 = *neqns; + for (node = 1; node <= i__1; ++node) { + num = -invp[node]; + invp[node] = num; + perm[num] = node; +/* L600: */ + } + return 0; + +} /* mmdnum_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/qselect.c b/thirdparty/superlu/SuperLU_4.1/SRC/qselect.c new file mode 100644 index 0000000..60d77e4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/qselect.c @@ -0,0 +1,74 @@ + +/*! @file qselect.c + * \brief Quickselect: returns the k-th (zero-based) largest value in A[]. + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * November, 2010
    + * 
    + */ + +#include "slu_ddefs.h" + +double dqselect(int n, double A[], int k) +{ + register int i, j, p; + register double val; + + k = SUPERLU_MAX(k, 0); + k = SUPERLU_MIN(k, n - 1); + while (n > 1) + { + i = 0; j = n-1; + p = j; val = A[p]; + while (i < j) + { + for (; A[i] >= val && i < p; i++); + if (A[i] < val) { A[p] = A[i]; p = i; } + for (; A[j] <= val && j > p; j--); + if (A[j] > val) { A[p] = A[j]; p = j; } + } + A[p] = val; + if (p == k) return val; + else if (p > k) n = p; + else + { + p++; + n -= p; A += p; k -= p; + } + } + + return A[0]; +} + +float sqselect(int n, float A[], int k) +{ + register int i, j, p; + register float val; + + k = SUPERLU_MAX(k, 0); + k = SUPERLU_MIN(k, n - 1); + while (n > 1) + { + i = 0; j = n-1; + p = j; val = A[p]; + while (i < j) + { + for (; A[i] >= val && i < p; i++); + if (A[i] < val) { A[p] = A[i]; p = i; } + for (; A[j] <= val && j > p; j--); + if (A[j] > val) { A[p] = A[j]; p = j; } + } + A[p] = val; + if (p == k) return val; + else if (p > k) n = p; + else + { + p++; + n -= p; A += p; k -= p; + } + } + + return A[0]; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/relax_snode.c b/thirdparty/superlu/SuperLU_4.1/SRC/relax_snode.c new file mode 100644 index 0000000..f666b6e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/relax_snode.c @@ -0,0 +1,75 @@ +/*! @file relax_snode.c + * \brief Identify initial relaxed supernodes + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_ddefs.h" +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    relax_snode() - Identify the initial relaxed supernodes, assuming that 
    + *    the matrix has been reordered according to the postorder of the etree.
    + * 
    + */ +void +relax_snode ( + const int n, + int *et, /* column elimination tree */ + const int relax_columns, /* max no of columns allowed in a + relaxed snode */ + int *descendants, /* no of descendants of each node + in the etree */ + int *relax_end /* last column in a supernode */ + ) +{ + + register int j, parent; + register int snode_start; /* beginning of a snode */ + + ifill (relax_end, n, EMPTY); + for (j = 0; j < n; j++) descendants[j] = 0; + + /* Compute the number of descendants of each node in the etree */ + for (j = 0; j < n; j++) { + parent = et[j]; + if ( parent != n ) /* not the dummy root */ + descendants[parent] += descendants[j] + 1; + } + + /* Identify the relaxed supernodes by postorder traversal of the etree. */ + for (j = 0; j < n; ) { + parent = et[j]; + snode_start = j; + while ( parent != n && descendants[parent] < relax_columns ) { + j = parent; + parent = et[j]; + } + /* Found a supernode with j being the last column. */ + relax_end[snode_start] = j; /* Last column is recorded */ + j++; + /* Search for a new leaf */ + while ( descendants[j] != 0 && j < n ) j++; + } + + /*printf("No of relaxed snodes: %d; relaxed columns: %d\n", + nsuper, no_relaxed_col); */ +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_bmod.c new file mode 100644 index 0000000..c1839d3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_bmod.c @@ -0,0 +1,352 @@ + +/*! @file scolumn_bmod.c + * \brief performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + *  Permission is hereby granted to use or copy this program for any
    + *  purpose, provided the above notices are retained on all copies.
    + *  Permission to modify the code and to distribute modified code is
    + *  granted, provided the above notices are retained, and a notice that
    + *  the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include +#include +#include "slu_sdefs.h" + +/* + * Function prototypes + */ +void susolve(int, int, float*, float*); +void slsolve(int, int, float*, float*); +void smatvec(int, int, int, float*, float*, float*); + + + +/*! \brief + * + *
    + * Purpose:
    + * ========
    + * Performs numeric block updates (sup-col) in topological order.
    + * It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + * Special processing on the supernodal portion of L\U[*,j]
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +scolumn_bmod ( + const int jcol, /* in */ + const int nseg, /* in */ + float *dense, /* in */ + float *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in */ + int fpanelc, /* in -- first column in the current panel */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + float alpha, beta; + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in supernode + * nsupr = no of rows in supernode (used as leading dimension) + * luptr = location of supernodal LU-block in storage + * kfnz = first nonz in the k-th supernodal segment + * no_zeros = no of leading zeros in a supernodal U-segment + */ + float ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int fsupc, nsupc, nsupr, segsze; + int nrow; /* No of rows in the matrix of matrix-vector */ + int jcolp1, jsupno, k, ksub, krep, krep_ind, ksupno; + register int lptr, kfnz, isub, irow, i; + register int no_zeros, new_next; + int ufirst, nextlu; + int fst_col; /* First column within small LU update */ + int d_fsupc; /* Distance between the first column of the current + panel and the first column of the current snode. */ + int *xsup, *supno; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + int nzlumax; + float *tempv1; + float zero = 0.0; + float one = 1.0; + float none = -1.0; + int mem_error; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + nzlumax = Glu->nzlumax; + jcolp1 = jcol + 1; + jsupno = supno[jcol]; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + + krep = segrep[k]; + k--; + ksupno = supno[krep]; + if ( jsupno != ksupno ) { /* Outside the rectangular supernode */ + + fsupc = xsup[ksupno]; + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + /* Distance from the current supernode to the current panel; + d_fsupc=0 if fsupc > fpanelc. */ + d_fsupc = fst_col - fsupc; + + luptr = xlusup[fst_col] + d_fsupc; + lptr = xlsub[fsupc] + d_fsupc; + + kfnz = repfnz[krep]; + kfnz = SUPERLU_MAX ( kfnz, fpanelc ); + + segsze = krep - kfnz + 1; + nsupc = krep - fst_col + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nrow = nsupr - d_fsupc - nsupc; + krep_ind = lptr + nsupc - 1; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + + /* + * Case 1: Update U-segment of size 1 -- col-col update + */ + if ( segsze == 1 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + dense[irow] -= ukj*lusup[luptr]; + luptr++; + } + + } else if ( segsze <= 3 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { /* Case 2: 2cols-col update */ + ukj -= ukj1 * lusup[luptr1]; + dense[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + dense[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] ); + } + } else { /* Case 3: 3cols-col update */ + ukj2 = dense[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense[lsub[krep_ind]] = ukj; + dense[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + luptr2++; + dense[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + + + } else { + /* + * Case: sup-col update + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense + */ + + no_zeros = kfnz - fst_col; + + /* Copy U[*,j] segment from dense[*] to tempv[*] */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + tempv[i] = dense[irow]; + ++isub; + } + + /* Dense triangular solve -- start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + strsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + sgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + slsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + smatvec (nsupr, nrow , segsze, &lusup[luptr], tempv, tempv1); +#endif + + + /* Scatter tempv[] into SPA dense[] as a temporary storage */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense[irow] = tempv[i]; + tempv[i] = zero; + ++isub; + } + + /* Scatter tempv1[] into SPA dense[] */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + dense[irow] -= tempv1[i]; + tempv1[i] = zero; + ++isub; + } + } + + } /* if jsupno ... */ + + } /* for each segment... */ + + /* + * Process the supernodal portion of L\U[*,j] + */ + nextlu = xlusup[jcol]; + fsupc = xsup[jsupno]; + + /* Copy the SPA dense into L\U[*,j] */ + new_next = nextlu + xlsub[fsupc+1] - xlsub[fsupc]; + while ( new_next > nzlumax ) { + if (mem_error = sLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, Glu)) + return (mem_error); + lusup = Glu->lusup; + lsub = Glu->lsub; + } + + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = zero; + ++nextlu; + } + + xlusup[jcolp1] = nextlu; /* Close L\U[*,jcol] */ + + /* For more updates within the panel (also within the current supernode), + * should start from the first column of the panel, or the first column + * of the supernode, whichever is bigger. There are 2 cases: + * 1) fsupc < fpanelc, then fst_col := fpanelc + * 2) fsupc >= fpanelc, then fst_col := fsupc + */ + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + if ( fst_col < jcol ) { + + /* Distance between the current supernode and the current panel. + d_fsupc=0 if fsupc >= fpanelc. */ + d_fsupc = fst_col - fsupc; + + lptr = xlsub[fsupc] + d_fsupc; + luptr = xlusup[fst_col] + d_fsupc; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nsupc = jcol - fst_col; /* Excluding jcol */ + nrow = nsupr - d_fsupc - nsupc; + + /* Points to the beginning of jcol in snode L\U(jsupno) */ + ufirst = xlusup[jcol] + d_fsupc; + + ops[TRSV] += nsupc * (nsupc - 1); + ops[GEMV] += 2 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#else + strsv_( "L", "N", "U", &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#endif + + alpha = none; beta = one; /* y := beta*y + alpha*A*x */ + +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + sgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + slsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + + smatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], tempv ); + + /* Copy updates from tempv[*] into lusup[*] */ + isub = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + lusup[isub] -= tempv[i]; + tempv[i] = 0.0; + ++isub; + } + +#endif + + + } /* if fst_col < jcol ... */ + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_dfs.c new file mode 100644 index 0000000..4a412ab --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/scolumn_dfs.c @@ -0,0 +1,275 @@ + +/*! @file scolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include "slu_sdefs.h" + +/*! \brief What type of supernodes we want */ +#define T2_SUPER + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   SCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS 
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal 
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +scolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *xprune, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom, istop; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(3); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonz */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ( mem_error = sLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( mem_error = + sLUMemXpand(jcol,nextl,LSUB,&nzlmax,Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + +#ifdef T2_SUPER + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; +#endif + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first and last columns of + * a supernode. (first for num values, last for pruning) + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1-1) ) { /* >= 3 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + istop = ito + jptr - jm1ptr; + xprune[jcolm1] = istop; /* Initialize xprune[jcol-1] */ + xlsub[jcol] = istop; + for (ifrom = jm1ptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; /* = istop + length(jcol) */ + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xprune[jcol] = nextl; /* Initialize upper bound for pruning */ + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/scomplex.c b/thirdparty/superlu/SuperLU_4.1/SRC/scomplex.c new file mode 100644 index 0000000..2f78c07 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/scomplex.c @@ -0,0 +1,147 @@ + +/*! @file scomplex.c + * \brief Common arithmetic for complex type + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * This file defines common arithmetic operations for complex type.
    + * 
    + */ + +#include +#include +#include +#include "slu_scomplex.h" + + +/*! \brief Complex Division c = a/b */ +void c_div(complex *c, complex *a, complex *b) +{ + float ratio, den; + float abr, abi, cr, ci; + + if( (abr = b->r) < 0.) + abr = - abr; + if( (abi = b->i) < 0.) + abi = - abi; + if( abr <= abi ) { + if (abi == 0) { + fprintf(stderr, "z_div.c: division by zero\n"); + exit(-1); + } + ratio = b->r / b->i ; + den = b->i * (1 + ratio*ratio); + cr = (a->r*ratio + a->i) / den; + ci = (a->i*ratio - a->r) / den; + } else { + ratio = b->i / b->r ; + den = b->r * (1 + ratio*ratio); + cr = (a->r + a->i*ratio) / den; + ci = (a->i - a->r*ratio) / den; + } + c->r = cr; + c->i = ci; +} + + +/*! \brief Returns sqrt(z.r^2 + z.i^2) */ +double c_abs(complex *z) +{ + float temp; + float real = z->r; + float imag = z->i; + + if (real < 0) real = -real; + if (imag < 0) imag = -imag; + if (imag > real) { + temp = real; + real = imag; + imag = temp; + } + if ((real+imag) == real) return(real); + + temp = imag/real; + temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ + return (temp); +} + + +/*! \brief Approximates the abs. Returns abs(z.r) + abs(z.i) */ +double c_abs1(complex *z) +{ + float real = z->r; + float imag = z->i; + + if (real < 0) real = -real; + if (imag < 0) imag = -imag; + + return (real + imag); +} + +/*! \brief Return the exponentiation */ +void c_exp(complex *r, complex *z) +{ + float expx; + + expx = exp(z->r); + r->r = expx * cos(z->i); + r->i = expx * sin(z->i); +} + +/*! \brief Return the complex conjugate */ +void r_cnjg(complex *r, complex *z) +{ + r->r = z->r; + r->i = -z->i; +} + +/*! \brief Return the imaginary part */ +double r_imag(complex *z) +{ + return (z->i); +} + + +/*! \brief SIGN functions for complex number. Returns z/abs(z) */ +complex c_sgn(complex *z) +{ + register float t = c_abs(z); + register complex retval; + + if (t == 0.0) { + retval.r = 1.0, retval.i = 0.0; + } else { + retval.r = z->r / t, retval.i = z->i / t; + } + + return retval; +} + +/*! \brief Square-root of a complex number. */ +complex c_sqrt(complex *z) +{ + complex retval; + register float cr, ci, real, imag; + + real = z->r; + imag = z->i; + + if ( imag == 0.0 ) { + retval.r = sqrt(real); + retval.i = 0.0; + } else { + ci = (sqrt(real*real + imag*imag) - real) / 2.0; + ci = sqrt(ci); + cr = imag / (2.0 * ci); + retval.r = cr; + retval.i = ci; + } + + return retval; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/scopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/scopy_to_ucol.c new file mode 100644 index 0000000..2f6399f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/scopy_to_ucol.c @@ -0,0 +1,103 @@ + +/*! @file scopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_sdefs.h" + +int +scopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + float *dense, /* modified - reset to zero on return */ + GlobalLU_t *Glu /* modified */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + float *ucol; + int *usub, *xusub; + int nzumax; + float zero = 0.0; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if (mem_error = sLUMemXpand(jcol, nextu, UCOL, &nzumax, Glu)) + return (mem_error); + ucol = Glu->ucol; + if (mem_error = sLUMemXpand(jcol, nextu, USUB, &nzumax, Glu)) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + dense[irow] = zero; + nextu++; + isub++; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/scsum1.c b/thirdparty/superlu/SuperLU_4.1/SRC/scsum1.c new file mode 100644 index 0000000..5b4eb3a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/scsum1.c @@ -0,0 +1,99 @@ +/*! @file scsum1.c + * \brief Takes sum of the absolute values of a complex vector and returns a single precision result + * + *
    + *     -- LAPACK auxiliary routine (version 2.0) --   
    + *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *     Courant Institute, Argonne National Lab, and Rice University   
    + *     October 31, 1992   
    + * 
    + */ +#include "slu_scomplex.h" +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    SCSUM1 takes the sum of the absolute values of a complex   
    +    vector and returns a single precision result.   
    +
    +    Based on SCASUM from the Level 1 BLAS.   
    +    The change is to use the 'genuine' absolute value.   
    +
    +    Contributed by Nick Higham for use with CLACON.   
    +
    +    Arguments   
    +    =========   
    +
    +    N       (input) INT
    +            The number of elements in the vector CX.   
    +
    +    CX      (input) COMPLEX array, dimension (N)   
    +            The vector whose elements will be summed.   
    +
    +    INCX    (input) INT
    +            The spacing between successive values of CX.  INCX > 0.   
    +
    +    ===================================================================== 
    +
    +*/ +double scsum1_(int *n, complex *cx, int *incx) +{ + /* System generated locals */ + int i__1, i__2; + float ret_val; + /* Builtin functions */ + double c_abs(complex *); + /* Local variables */ + static int i, nincx; + static float stemp; + + +#define CX(I) cx[(I)-1] + + + ret_val = 0.f; + stemp = 0.f; + if (*n <= 0) { + return ret_val; + } + if (*incx == 1) { + goto L20; + } + +/* CODE FOR INCREMENT NOT EQUAL TO 1 */ + + nincx = *n * *incx; + i__1 = nincx; + i__2 = *incx; + for (i = 1; *incx < 0 ? i >= nincx : i <= nincx; i += *incx) { + +/* NEXT LINE MODIFIED. */ + + stemp += c_abs(&CX(i)); +/* L10: */ + } + ret_val = stemp; + return ret_val; + +/* CODE FOR INCREMENT EQUAL TO 1 */ + +L20: + i__2 = *n; + for (i = 1; i <= *n; ++i) { + +/* NEXT LINE MODIFIED. */ + + stemp += c_abs(&CX(i)); +/* L30: */ + } + ret_val = stemp; + return ret_val; + +/* End of SCSUM1 */ + +} /* scsum1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sdiagonal.c b/thirdparty/superlu/SuperLU_4.1/SRC/sdiagonal.c new file mode 100644 index 0000000..54a56c8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sdiagonal.c @@ -0,0 +1,129 @@ + +/*! @file sdiagonal.c + * \brief Auxiliary routines to work with diagonal elements + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +int sfill_diag(int n, NCformat *Astore) +/* fill explicit zeros on the diagonal entries, so that the matrix is not + structurally singular. */ +{ + float *nzval = (float *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + float *nzval_new; + float zero = 0.0; + int *rowind_new; + int i, j, diag; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = floatMalloc(nnz + fill); + rowind_new = intMalloc(nnz + fill); + fill = 0; + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + } + if (diag < 0) + { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = zero; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + Astore->nnz += fill; + return fill; +} + +int sdominate(int n, NCformat *Astore) +/* make the matrix diagonally dominant */ +{ + float *nzval = (float *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + float *nzval_new; + int *rowind_new; + int i, j, diag; + double s; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = floatMalloc(nnz + fill); + rowind_new = intMalloc(nnz+ fill); + fill = 0; + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + s += fabs(nzval_new[j + fill] = nzval[j]); + } + if (diag >= 0) { + nzval_new[diag+fill] = s * 3.0; + } else { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = s * 3.0; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + else + { + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + { + if (rowind[j] == i) diag = j; + s += fabs(nzval[j]); + } + nzval[diag] = s * 3.0; + } + } + Astore->nnz += fill; + return fill; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgscon.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgscon.c new file mode 100644 index 0000000..a474967 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgscon.c @@ -0,0 +1,157 @@ + +/*! @file sgscon.c + * \brief Estimates reciprocal of the condition number of a general matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routines SGECON.
    + * 
    + */ + +/* + * File name: sgscon.c + * History: Modified from lapack routines SGECON. + */ +#include +#include "slu_sdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   SGSCON estimates the reciprocal of the condition number of a general 
    + *   real matrix A, in either the 1-norm or the infinity-norm, using   
    + *   the LU factorization computed by SGETRF.   *
    + *
    + *   An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    + *   condition number is computed as   
    + *      RCOND = 1 / ( norm(A) * norm(inv(A)) ).   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + *   Arguments   
    + *   =========   
    + *
    + *    NORM    (input) char*
    + *            Specifies whether the 1-norm condition number or the   
    + *            infinity-norm condition number is required:   
    + *            = '1' or 'O':  1-norm;   
    + *            = 'I':         Infinity-norm.
    + *	    
    + *    L       (input) SuperMatrix*
    + *            The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *            sgstrf(). Use compressed row subscripts storage for supernodes,
    + *            i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + * 
    + *    U       (input) SuperMatrix*
    + *            The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *            sgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *            Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *	    
    + *    ANORM   (input) float
    + *            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    + *            If NORM = 'I', the infinity-norm of the original matrix A.
    + *	    
    + *    RCOND   (output) float*
    + *           The reciprocal of the condition number of the matrix A,   
    + *           computed as RCOND = 1/(norm(A) * norm(inv(A))).
    + *	    
    + *    INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    ===================================================================== 
    + * 
    + */ + +void +sgscon(char *norm, SuperMatrix *L, SuperMatrix *U, + float anorm, float *rcond, SuperLUStat_t *stat, int *info) +{ + + + /* Local variables */ + int kase, kase1, onenrm, i; + float ainvnm; + float *work; + int *iwork; + extern int srscl_(int *, float *, float *, int *); + + extern int slacon_(int *, float *, float *, int *, float *, int *); + + + /* Test the input parameters. */ + *info = 0; + onenrm = *(unsigned char *)norm == '1' || lsame_(norm, "O"); + if (! onenrm && ! lsame_(norm, "I")) *info = -1; + else if (L->nrow < 0 || L->nrow != L->ncol || + L->Stype != SLU_SC || L->Dtype != SLU_S || L->Mtype != SLU_TRLU) + *info = -2; + else if (U->nrow < 0 || U->nrow != U->ncol || + U->Stype != SLU_NC || U->Dtype != SLU_S || U->Mtype != SLU_TRU) + *info = -3; + if (*info != 0) { + i = -(*info); + xerbla_("sgscon", &i); + return; + } + + /* Quick return if possible */ + *rcond = 0.; + if ( L->nrow == 0 || U->nrow == 0) { + *rcond = 1.; + return; + } + + work = floatCalloc( 3*L->nrow ); + iwork = intMalloc( L->nrow ); + + + if ( !work || !iwork ) + ABORT("Malloc fails for work arrays in sgscon."); + + /* Estimate the norm of inv(A). */ + ainvnm = 0.; + if ( onenrm ) kase1 = 1; + else kase1 = 2; + kase = 0; + + do { + slacon_(&L->nrow, &work[L->nrow], &work[0], &iwork[0], &ainvnm, &kase); + + if (kase == 0) break; + + if (kase == kase1) { + /* Multiply by inv(L). */ + sp_strsv("L", "No trans", "Unit", L, U, &work[0], stat, info); + + /* Multiply by inv(U). */ + sp_strsv("U", "No trans", "Non-unit", L, U, &work[0], stat, info); + + } else { + + /* Multiply by inv(U'). */ + sp_strsv("U", "Transpose", "Non-unit", L, U, &work[0], stat, info); + + /* Multiply by inv(L'). */ + sp_strsv("L", "Transpose", "Unit", L, U, &work[0], stat, info); + + } + + } while ( kase != 0 ); + + /* Compute the estimate of the reciprocal condition number. */ + if (ainvnm != 0.) *rcond = (1. / ainvnm) / anorm; + + SUPERLU_FREE (work); + SUPERLU_FREE (iwork); + return; + +} /* sgscon */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgsequ.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgsequ.c new file mode 100644 index 0000000..3637d7e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgsequ.c @@ -0,0 +1,195 @@ + +/*! @file sgsequ.c + * \brief Computes row and column scalings + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from LAPACK routine SGEEQU
    + * 
    + */ +/* + * File name: sgsequ.c + * History: Modified from LAPACK routine SGEEQU + */ +#include +#include "slu_sdefs.h" + + + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   SGSEQU computes row and column scalings intended to equilibrate an   
    + *   M-by-N sparse matrix A and reduce its condition number. R returns the row
    + *   scale factors and C the column scale factors, chosen to try to make   
    + *   the largest element in each row and column of the matrix B with   
    + *   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.   
    + *
    + *   R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    + *   number and BIGNUM = largest safe number.  Use of these scaling   
    + *   factors is not guaranteed to reduce the condition number of A but   
    + *   works well in practice.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input) SuperMatrix*
    + *           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    + *           factors are to be computed. The type of A can be:
    + *           Stype = SLU_NC; Dtype = SLU_S; Mtype = SLU_GE.
    + *	    
    + *   R       (output) float*, size A->nrow
    + *           If INFO = 0 or INFO > M, R contains the row scale factors   
    + *           for A.
    + *	    
    + *   C       (output) float*, size A->ncol
    + *           If INFO = 0,  C contains the column scale factors for A.
    + *	    
    + *   ROWCND  (output) float*
    + *           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    + *           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    + *           AMAX is neither too large nor too small, it is not worth   
    + *           scaling by R.
    + *	    
    + *   COLCND  (output) float*
    + *           If INFO = 0, COLCND contains the ratio of the smallest   
    + *           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    + *           worth scaling by C.
    + *	    
    + *   AMAX    (output) float*
    + *           Absolute value of largest matrix element.  If AMAX is very   
    + *           close to overflow or very close to underflow, the matrix   
    + *           should be scaled.
    + *	    
    + *   INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *           > 0:  if INFO = i,  and i is   
    + *                 <= A->nrow:  the i-th row of A is exactly zero   
    + *                 >  A->ncol:  the (i-M)-th column of A is exactly zero   
    + *
    + *   ===================================================================== 
    + * 
    + */ +void +sgsequ(SuperMatrix *A, float *r, float *c, float *rowcnd, + float *colcnd, float *amax, int *info) +{ + + + /* Local variables */ + NCformat *Astore; + float *Aval; + int i, j, irow; + float rcmin, rcmax; + float bignum, smlnum; + extern float slamch_(char *); + + /* Test the input parameters. */ + *info = 0; + if ( A->nrow < 0 || A->ncol < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_S || A->Mtype != SLU_GE ) + *info = -1; + if (*info != 0) { + i = -(*info); + xerbla_("sgsequ", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || A->ncol == 0 ) { + *rowcnd = 1.; + *colcnd = 1.; + *amax = 0.; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Get machine constants. */ + smlnum = slamch_("S"); + bignum = 1. / smlnum; + + /* Compute row scale factors. */ + for (i = 0; i < A->nrow; ++i) r[i] = 0.; + + /* Find the maximum element in each row. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + r[irow] = SUPERLU_MAX( r[irow], fabs(Aval[i]) ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (i = 0; i < A->nrow; ++i) { + rcmax = SUPERLU_MAX(rcmax, r[i]); + rcmin = SUPERLU_MIN(rcmin, r[i]); + } + *amax = rcmax; + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (i = 0; i < A->nrow; ++i) + if (r[i] == 0.) { + *info = i + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (i = 0; i < A->nrow; ++i) + r[i] = 1. / SUPERLU_MIN( SUPERLU_MAX( r[i], smlnum ), bignum ); + /* Compute ROWCND = min(R(I)) / max(R(I)) */ + *rowcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + /* Compute column scale factors */ + for (j = 0; j < A->ncol; ++j) c[j] = 0.; + + /* Find the maximum element in each column, assuming the row + scalings computed above. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + c[j] = SUPERLU_MAX( c[j], fabs(Aval[i]) * r[irow] ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->ncol; ++j) { + rcmax = SUPERLU_MAX(rcmax, c[j]); + rcmin = SUPERLU_MIN(rcmin, c[j]); + } + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (j = 0; j < A->ncol; ++j) + if ( c[j] == 0. ) { + *info = A->nrow + j + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (j = 0; j < A->ncol; ++j) + c[j] = 1. / SUPERLU_MIN( SUPERLU_MAX( c[j], smlnum ), bignum); + /* Compute COLCND = min(C(J)) / max(C(J)) */ + *colcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + return; + +} /* sgsequ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgsisx.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgsisx.c new file mode 100644 index 0000000..94cdb69 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgsisx.c @@ -0,0 +1,723 @@ + +/*! @file sgsisx.c + * \brief Computes an approximate solutions of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * November, 2010
    + * 
    + */ +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSISX computes an approximate solutions of linear equations
    + * A*X=B or A'*X=B, using the ILU factorization from sgsitrf().
    + * An estimation of the condition number is provided. 
    + * The routine performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A is
    + *	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *	     = TRANS or CONJ).
    + *
    + *	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *	     matrix that usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the matrix A (after equilibration if options->Equil = YES)
    + *	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *	1.4. Compute the reciprocal pivot growth factor.
    + *
    + *	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    + *	     and info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	1.6. The system of equations is solved for X using the factored form
    + *	     of A.
    + *
    + *	1.7. options->IterRefine is not used
    + *
    + *	1.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *	1.9. options for ILU only
    + *	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    + *		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    + *		entries of modulus 1 on the diagonal and off-diagonal entries
    + *		of modulus at most 1. If MC64 fails, dgsequ() is used to
    + *		equilibrate the system.
    + *              ( Default: LargeDiag )
    + *	     2) options->ILU_DropTol = tau is the threshold for dropping.
    + *		For L, it is used directly (for the whole row in a supernode);
    + *		For U, ||A(:,i)||_oo * tau is used as the threshold
    + *	        for the	i-th column.
    + *		If a secondary dropping rule is required, tau will
    + *	        also be used to compute the second threshold.
    + *              ( Default: 1e-4 )
    + *	     3) options->ILU_FillFactor = gamma, used as the initial guess
    + *		of memory growth.
    + *		If a secondary dropping rule is required, it will also
    + *              be used as an upper bound of the memory.
    + *              ( Default: 10 )
    + *	     4) options->ILU_DropRule specifies the dropping rule.
    + *		Option	      Meaning
    + *		======	      ===========
    + *		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    + *		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    + *		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    + *			      p = gamma * nnz(A(:,j)).
    + *		DROP_AREA:    Variation of ILUTP, for j-th column, use
    + *			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    + *		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    + *			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    + *				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    + *			      Otherwise
    + *				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    + *			      tau_U(j) uses the similar rule.
    + *			      NOTE: the thresholds used by L and U are separate.
    + *		DROP_INTERP:  Compute the second dropping threshold by
    + *			      interpolation instead of sorting (default).
    + *			      In this case, the actual fill ratio is not
    + *			      guaranteed smaller than gamma.
    + *		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    + *		( Default: DROP_BASIC | DROP_AREA )
    + *	     5) options->ILU_Norm is the criterion of measuring the magnitude
    + *		of a row in a supernode of L. ( Default is INF_NORM )
    + *		options->ILU_Norm	RowSize(x[1:n])
    + *		=================	===============
    + *		ONE_NORM		||x||_1 / n
    + *		TWO_NORM		||x||_2 / sqrt(n)
    + *		INF_NORM		max{|x[i]|}
    + *	     6) options->ILU_MILU specifies the type of MILU's variation.
    + *		= SILU: do not perform Modified ILU;
    + *		= SMILU_1 (not recommended):
    + *		    U(i,i) := U(i,i) + sum(dropped entries);
    + *		= SMILU_2:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    + *		= SMILU_3:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    + *		NOTE: Even SMILU_1 does not preserve the column sum because of
    + *		late dropping.
    + *              ( Default: SILU )
    + *	     7) options->ILU_FillTol is used as the perturbation when
    + *		encountering zero pivots. If some U(i,i) = 0, so that U is
    + *		exactly singular, then
    + *		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    + *              ( Default: 1e-2 )
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *	to the transpose of A:
    + *
    + *	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A' is
    + *	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    + *	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *	2.2. Permute columns of transpose(A) (rows of A),
    + *	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    + *	     usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the transpose(A) (after equilibration if
    + *	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *	     permutation Pr determined by partial pivoting.
    + *
    + *	2.4. Compute the reciprocal pivot growth factor.
    + *
    + *	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    + *	     And info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	2.6. The system of equations is solved for X using the factored form
    + *	     of transpose(A).
    + *
    + *	2.7. If options->IterRefine is not used.
    + *
    + *	2.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the LU decomposition will be performed and how the
    + *	   system will be solved.
    + *
    + * A	   (input/output) SuperMatrix*
    + *	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *	   of the linear equations is A->nrow. Currently, the type of A can be:
    + *	   Stype = SLU_NC or SLU_NR, Dtype = SLU_S, Mtype = SLU_GE.
    + *	   In the future, more general A may be handled.
    + *
    + *	   On entry, If options->Fact = FACTORED and equed is not 'N',
    + *	   then A must have been equilibrated by the scaling factors in
    + *	   R and/or C.
    + *	   On exit, A is not modified
    + *         if options->Equil = NO, or
    + *         if options->Equil = YES but equed = 'N' on exit, or
    + *         if options->RowPerm = NO.
    + *
    + *	   Otherwise, if options->Equil = YES and equed is not 'N',
    + *	   A is scaled as follows:
    + *	   If A->Stype = SLU_NC:
    + *	     equed = 'R':  A := diag(R) * A
    + *	     equed = 'C':  A := A * diag(C)
    + *	     equed = 'B':  A := diag(R) * A * diag(C).
    + *	   If A->Stype = SLU_NR:
    + *	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix to an I-matrix, that is A is modified as follows:
    + *            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    + *            off-diagonal entries of modulus at most 1. P is a permutation
    + *            obtained from MC64.
    + *            If MC64 fails, sgsequ() is used to equilibrate the system,
    + *            and A is scaled as above, there is no permutation involved.
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *	   which defines the permutation matrix Pc; perm_c[i] = j means
    + *	   column i of A is in position j in A*Pc.
    + *	   On exit, perm_c may be overwritten by the product of the input
    + *	   perm_c and a permutation that postorders the elimination tree
    + *	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *	   is already in postorder.
    + *
    + *	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *	   which describes permutation of columns of transpose(A) 
    + *	   (rows of A) as described above.
    + *
    + * perm_r  (input/output) int*
    + *	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *	   which defines the permutation matrix Pr, and is determined
    + *	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *	   position j in Pr*A.
    + *
    + *	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *	   determines permutation of rows of transpose(A)
    + *	   (columns of A) as described above.
    + *
    + *	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	   will try to use the input perm_r, unless a certain threshold
    + *	   criterion is violated. In that case, perm_r is overwritten by a
    + *	   new permutation determined by partial pivoting or diagonal
    + *	   threshold pivoting.
    + *	   Otherwise, perm_r is output argument.
    + *
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *	   Elimination tree of Pc'*A'*A*Pc.
    + *	   If options->Fact != FACTORED and options->Fact != DOFACT,
    + *	   etree is an input argument, otherwise it is an output argument.
    + *	   Note: etree is a vector of parent pointers for a forest whose
    + *	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *	   Specifies the form of equilibration that was done.
    + *	   = 'N': No equilibration.
    + *	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *	   = 'B': Both row and column equilibration, i.e., A was replaced 
    + *		  by diag(R)*A*diag(C).
    + *	   If options->Fact = FACTORED, equed is an input argument,
    + *	   otherwise it is an output argument.
    + *
    + * R	   (input/output) float*, dimension (A->nrow)
    + *	   The row scale factors for A or transpose(A).
    + *	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *	   If equed = 'N' or 'C', R is not accessed.
    + *	   If options->Fact = FACTORED, R is an input argument,
    + *	       otherwise, R is output.
    + *	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *	       of R must be positive.
    + *
    + * C	   (input/output) float*, dimension (A->ncol)
    + *	   The column scale factors for A or transpose(A).
    + *	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *	   If equed = 'N' or 'R', C is not accessed.
    + *	   If options->Fact = FACTORED, C is an input argument,
    + *	       otherwise, C is output.
    + *	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *	       of C must be positive.
    + *
    + * L	   (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses compressed row subscripts storage for supernodes, i.e.,
    + *	   L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U	   (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses column-wise storage scheme, i.e., U has types:
    + *	   Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *	   User supplied workspace, should be large enough
    + *	   to hold data structures for factors L and U.
    + *	   On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 mem_usage->total_needed; no other side effects.
    + *
    + *	   See argument 'mem_usage' for memory usage statistics.
    + *
    + * B	   (input/output) SuperMatrix*
    + *	   B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *	   On entry, the right hand side matrix.
    + *	   If B->ncol = 0, only LU decomposition is performed, the triangular
    + *			   solve is skipped.
    + *	   On exit,
    + *	      if equed = 'N', B is not modified; otherwise
    + *	      if A->Stype = SLU_NC:
    + *		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *		    B is overwritten by diag(R)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *		    B is overwritten by diag(C)*B;
    + *	      if A->Stype = SLU_NR:
    + *		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *		    B is overwritten by diag(C)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *		    B is overwritten by diag(R)*B.
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix A to an I-matrix. Then, in addition to the scaling
    + *            above, B is further permuted by P*B if options->Trans = NOTRANS,
    + *            where P is obtained from MC64.
    + *
    + * X	   (output) SuperMatrix*
    + *	   X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *	   to the original system of equations. Note that A and B are modified
    + *	   on exit if equed is not 'N', and the solution to the equilibrated
    + *	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *	   and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) float*
    + *	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *	   The infinity norm is used. If recip_pivot_growth is much less
    + *	   than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) float*
    + *	   The estimate of the reciprocal condition number of the matrix A
    + *	   after equilibration (if done). If rcond is less than the machine
    + *	   precision (in particular, if rcond = 0), the matrix is singular
    + *	   to working precision. This condition is indicated by a return
    + *	   code of info > 0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *	   Record the memory usage statistics, consisting of following fields:
    + *	   - for_lu (float)
    + *	     The amount of space used in bytes for L\U data structures.
    + *	   - total_needed (float)
    + *	     The amount of space needed in bytes to perform factorization.
    + *	   - expansions (int)
    + *	     The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *	  Record the statistics on runtime and floating-point operation count.
    + *	  See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + *	   > 0: if info = i, and i is
    + *		<= A->ncol: number of zero pivots. They are replaced by small
    + *		      entries due to options->ILU_FillTol.
    + *		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *		      precision, meaning that the matrix is singular to
    + *		      working precision. Nevertheless, the solution and
    + *		      error bounds are computed because there are a number
    + *		      of situations where the computed solution can be more
    + *		      accurate than the value of RCOND would suggest.
    + *		> A->ncol+1: number of bytes allocated when memory allocation
    + *		      failure occurred, plus A->ncol.
    + * 
    + */ + +void +sgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, float *R, float *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, + float *recip_pivot_growth, float *rcond, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info) +{ + + DNformat *Bstore, *Xstore; + float *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec, mc64; + trans_t trant; + char norm[1]; + int i, j, info1; + float amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + float diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + int *perm = NULL; + + /* External functions */ + extern float slangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + mc64 = (options->RowPerm == LargeDiag); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = slamch_("Safe minimum"); + bignum = 1. / smlnum; + } + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_S || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_S || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_S || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("sgsisx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + sCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact ) { + register int i, j; + NCformat *Astore = AA->Store; + int nnz = Astore->nnz; + int *colptr = Astore->colptr; + int *rowind = Astore->rowind; + float *nzval = (float *)Astore->nzval; + int n = AA->nrow; + + if ( mc64 ) { + *equed = 'B'; + /*rowequ = colequ = 1;*/ + t0 = SuperLU_timer_(); + if ((perm = intMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for perm[]"); + + info1 = sldperm(5, n, nnz, colptr, rowind, nzval, perm, R, C); + + if (info1 > 0) { /* MC64 fails, call sgsequ() later */ + mc64 = 0; + SUPERLU_FREE(perm); + perm = NULL; + } else { + rowequ = colequ = 1; + for (i = 0; i < n; i++) { + R[i] = exp(R[i]); + C[i] = exp(C[i]); + } + /* permute and scale the matrix */ + for (j = 0; j < n; j++) { + for (i = colptr[j]; i < colptr[j + 1]; i++) { + nzval[i] *= R[rowind[i]] * C[j]; + rowind[i] = perm[rowind[i]]; + } + } + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + if ( !mc64 & equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + sgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + slaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + sgsitrf(options, &AC, relax, panel_size, etree, work, lwork, + perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) return; + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = sPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = slangs(norm, AA); + sgscon(norm, L, U, anorm, rcond, stat, &info1); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { /* Solve the system */ + float *tmp, *rhs_work; + int n = A->nrow; + if ( mc64 ) { + if ((tmp = floatMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for tmp[]"); + } + + /* Scale and permute the right-hand side if equilibration + and permutation from MC64 were performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) + Bmat[i + j*ldb] *= R[i]; + } + if ( mc64 ) { + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (i = 0; i < n; i++) tmp[perm[i]] = rhs_work[i]; + for (i = 0; i < n; i++) rhs_work[i] = tmp[i]; + } + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + Bmat[i + j*ldb] *= C[i]; + } + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + sgstrs (trant, L, U, perm_c, perm_r, X, stat, &info1); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original + system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + Xmat[i + j*ldx] *= C[i]; + } + } + } else { /* transposed system */ + if ( rowequ ) { + if ( mc64 ) { + for (j = 0; j < nrhs; j++) { + for (i = 0; i < n; i++) + tmp[i] = Xmat[i + j * ldx]; /*dcopy*/ + for (i = 0; i < n; i++) + Xmat[i + j * ldx] = R[i] * tmp[perm[i]]; + } + } else { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + Xmat[i + j*ldx] *= R[i]; + } + } + } + } + + if ( mc64 ) SUPERLU_FREE(tmp); + + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < slamch_("E") && *info == 0) *info = A->ncol + 1; + } + + if (perm) SUPERLU_FREE(perm); + + if ( nofact ) { + ilu_sQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c new file mode 100644 index 0000000..d3f1c21 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c @@ -0,0 +1,638 @@ + +/*! @file sgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +sgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + float *swork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + float *dense, *tempv; + int *relax_end, *relax_fsupc; + float *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float *amax; + float drop_sum; + float alpha, omega; /* used in MILU, mimicing DRIC */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + float *swork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + float zero = 0.0; + float one = 1.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = sLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &swork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + sSetRWork(m, panel_size, swork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (float *) floatMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + swork2 = (float *)floatMalloc(n); + else + swork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + alpha = pow((double)n, -1.0 / options->ILU_MILU_Dim); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + i = ilu_sdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, tempv, swork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_ssnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = sLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register float tmp = fabs(a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + ssnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_spivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_spanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + spanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_scolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = scolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = sLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_scopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + swork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + if (drop_sum != zero) + { + if (drop_sum > zero) + omega = SUPERLU_MIN(2.0 * (1.0 - alpha) + * amax[jj - jcol] / drop_sum, one); + else + omega = SUPERLU_MAX(2.0 * (1.0 - alpha) + * amax[jj - jcol] / drop_sum, -one); + drop_sum *= omega; + } + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_spivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + i = ilu_sdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, tempv, swork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + sLUWorkFree(iwork, swork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + sCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_S, SLU_TRLU); + sCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_S, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( swork2 ) SUPERLU_FREE (swork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c.bak new file mode 100644 index 0000000..3dfaadd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgsitrf.c.bak @@ -0,0 +1,626 @@ + +/*! @file sgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +sgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + float *swork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + float *dense, *tempv; + int *relax_end, *relax_fsupc; + float *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float *amax; + float drop_sum; + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + int *iwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + float zero = 0.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = sLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &swork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + sSetRWork(m, panel_size, swork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (float *) floatMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + iwork2 = (int *)intMalloc(n); + else + iwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + i = ilu_sdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, tempv, iwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_ssnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = sLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register float tmp = fabs(a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + ssnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_spivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_spanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + spanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_scolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = scolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = sLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_scopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + iwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + drop_sum *= MILU_ALPHA; + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_spivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + i = ilu_sdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, tempv, iwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + sLUWorkFree(iwork, swork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + sCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_S, SLU_TRLU); + sCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_S, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( iwork2 ) SUPERLU_FREE (iwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgsrfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgsrfs.c new file mode 100644 index 0000000..a93bc5b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgsrfs.c @@ -0,0 +1,452 @@ + +/*! @file sgsrfs.c + * \brief Improves computed solution to a system of inear equations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routine SGERFS
    + * 
    + */ +/* + * File name: sgsrfs.c + * History: Modified from lapack routine SGERFS + */ +#include +#include "slu_sdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   SGSRFS improves the computed solution to a system of linear   
    + *   equations and provides error bounds and backward error estimates for 
    + *   the solution.   
    + *
    + *   If equilibration was performed, the system becomes:
    + *           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *   
    + *   A       (input) SuperMatrix*
    + *           The original matrix A in the system, or the scaled A if
    + *           equilibration was done. The type of A can be:
    + *           Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_GE.
    + *    
    + *   L       (input) SuperMatrix*
    + *	     The factor L from the factorization Pr*A*Pc=L*U. Use
    + *           compressed row subscripts storage for supernodes, 
    + *           i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + * 
    + *   U       (input) SuperMatrix*
    + *           The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *           sgstrf(). Use column-wise storage scheme, 
    + *           i.e., U has types: Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + *   perm_c  (input) int*, dimension (A->ncol)
    + *	     Column permutation vector, which defines the 
    + *           permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *           in position j in A*Pc.
    + *
    + *   perm_r  (input) int*, dimension (A->nrow)
    + *           Row permutation vector, which defines the permutation matrix Pr;
    + *           perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + *   equed   (input) Specifies the form of equilibration that was done.
    + *           = 'N': No equilibration.
    + *           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *           = 'C': Column equilibration, i.e., A was postmultiplied by
    + *                  diag(C).
    + *           = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                  by diag(R)*A*diag(C).
    + *
    + *   R       (input) float*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *           If equed = 'R' or 'B', A is premultiplied by diag(R).
    + *           If equed = 'N' or 'C', R is not accessed.
    + * 
    + *   C       (input) float*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    + *           If equed = 'N' or 'R', C is not accessed.
    + *
    + *   B       (input) SuperMatrix*
    + *           B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *           The right hand side matrix B.
    + *           if equed = 'R' or 'B', B is premultiplied by diag(R).
    + *
    + *   X       (input/output) SuperMatrix*
    + *           X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *           On entry, the solution matrix X, as computed by sgstrs().
    + *           On exit, the improved solution matrix X.
    + *           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    + *               in order to obtain the solution to the original system.
    + *
    + *   FERR    (output) float*, dimension (B->ncol)   
    + *           The estimated forward error bound for each solution vector   
    + *           X(j) (the j-th column of the solution matrix X).   
    + *           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *           is an estimated upper bound for the magnitude of the largest 
    + *           element in (X(j) - XTRUE) divided by the magnitude of the   
    + *           largest element in X(j).  The estimate is as reliable as   
    + *           the estimate for RCOND, and is almost always a slight   
    + *           overestimate of the true error.
    + *
    + *   BERR    (output) float*, dimension (B->ncol)   
    + *           The componentwise relative backward error of each solution   
    + *           vector X(j) (i.e., the smallest relative change in   
    + *           any element of A or B that makes X(j) an exact solution).
    + *
    + *   stat     (output) SuperLUStat_t*
    + *            Record the statistics on runtime and floating-point operation count.
    + *            See util.h for the definition of 'SuperLUStat_t'.
    + *
    + *   info    (output) int*   
    + *           = 0:  successful exit   
    + *            < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    Internal Parameters   
    + *    ===================   
    + *
    + *    ITMAX is the maximum number of steps of iterative refinement.   
    + *
    + * 
    + */ +void +sgsrfs(trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, char *equed, float *R, float *C, + SuperMatrix *B, SuperMatrix *X, float *ferr, float *berr, + SuperLUStat_t *stat, int *info) +{ + + +#define ITMAX 5 + + /* Table of constant values */ + int ione = 1; + float ndone = -1.; + float done = 1.; + + /* Local variables */ + NCformat *Astore; + float *Aval; + SuperMatrix Bjcol; + DNformat *Bstore, *Xstore, *Bjcol_store; + float *Bmat, *Xmat, *Bptr, *Xptr; + int kase; + float safe1, safe2; + int i, j, k, irow, nz, count, notran, rowequ, colequ; + int ldb, ldx, nrhs; + float s, xk, lstres, eps, safmin; + char transc[1]; + trans_t transt; + float *work; + float *rwork; + int *iwork; + + extern int slacon_(int *, float *, float *, int *, float *, int *); +#ifdef _CRAY + extern int SCOPY(int *, float *, int *, float *, int *); + extern int SSAXPY(int *, float *, float *, int *, float *, int *); +#else + extern int scopy_(int *, float *, int *, float *, int *); + extern int saxpy_(int *, float *, float *, int *, float *, int *); +#endif + + Astore = A->Store; + Aval = Astore->nzval; + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + /* Test the input parameters */ + *info = 0; + notran = (trans == NOTRANS); + if ( !notran && trans != TRANS && trans != CONJ ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_S || A->Mtype != SLU_GE ) + *info = -2; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_S || L->Mtype != SLU_TRLU ) + *info = -3; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_S || U->Mtype != SLU_TRU ) + *info = -4; + else if ( ldb < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_S || B->Mtype != SLU_GE ) + *info = -10; + else if ( ldx < SUPERLU_MAX(0, A->nrow) || + X->Stype != SLU_DN || X->Dtype != SLU_S || X->Mtype != SLU_GE ) + *info = -11; + if (*info != 0) { + i = -(*info); + xerbla_("sgsrfs", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || nrhs == 0) { + for (j = 0; j < nrhs; ++j) { + ferr[j] = 0.; + berr[j] = 0.; + } + return; + } + + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + + /* Allocate working space */ + work = floatMalloc(2*A->nrow); + rwork = (float *) SUPERLU_MALLOC( A->nrow * sizeof(float) ); + iwork = intMalloc(2*A->nrow); + if ( !work || !rwork || !iwork ) + ABORT("Malloc fails for work/rwork/iwork."); + + if ( notran ) { + *(unsigned char *)transc = 'N'; + transt = TRANS; + } else { + *(unsigned char *)transc = 'T'; + transt = NOTRANS; + } + + /* NZ = maximum number of nonzero elements in each row of A, plus 1 */ + nz = A->ncol + 1; + eps = slamch_("Epsilon"); + safmin = slamch_("Safe minimum"); + /* Set SAFE1 essentially to be the underflow threshold times the + number of additions in each row. */ + safe1 = nz * safmin; + safe2 = safe1 / eps; + + /* Compute the number of nonzeros in each row (or column) of A */ + for (i = 0; i < A->nrow; ++i) iwork[i] = 0; + if ( notran ) { + for (k = 0; k < A->ncol; ++k) + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + ++iwork[Astore->rowind[i]]; + } else { + for (k = 0; k < A->ncol; ++k) + iwork[k] = Astore->colptr[k+1] - Astore->colptr[k]; + } + + /* Copy one column of RHS B into Bjcol. */ + Bjcol.Stype = B->Stype; + Bjcol.Dtype = B->Dtype; + Bjcol.Mtype = B->Mtype; + Bjcol.nrow = B->nrow; + Bjcol.ncol = 1; + Bjcol.Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !Bjcol.Store ) ABORT("SUPERLU_MALLOC fails for Bjcol.Store"); + Bjcol_store = Bjcol.Store; + Bjcol_store->lda = ldb; + Bjcol_store->nzval = work; /* address aliasing */ + + /* Do for each right hand side ... */ + for (j = 0; j < nrhs; ++j) { + count = 0; + lstres = 3.; + Bptr = &Bmat[j*ldb]; + Xptr = &Xmat[j*ldx]; + + while (1) { /* Loop until stopping criterion is satisfied. */ + + /* Compute residual R = B - op(A) * X, + where op(A) = A, A**T, or A**H, depending on TRANS. */ + +#ifdef _CRAY + SCOPY(&A->nrow, Bptr, &ione, work, &ione); +#else + scopy_(&A->nrow, Bptr, &ione, work, &ione); +#endif + sp_sgemv(transc, ndone, A, Xptr, ione, done, work, ione); + + /* Compute componentwise relative backward error from formula + max(i) ( abs(R(i)) / ( abs(op(A))*abs(X) + abs(B) )(i) ) + where abs(Z) is the componentwise absolute value of the matrix + or vector Z. If the i-th component of the denominator is less + than SAFE2, then SAFE1 is added to the i-th component of the + numerator before dividing. */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = fabs( Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if (notran) { + for (k = 0; k < A->ncol; ++k) { + xk = fabs( Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += fabs(Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + s += fabs(Aval[i]) * fabs(Xptr[irow]); + } + rwork[k] += s; + } + } + s = 0.; + for (i = 0; i < A->nrow; ++i) { + if (rwork[i] > safe2) { + s = SUPERLU_MAX( s, fabs(work[i]) / rwork[i] ); + } else if ( rwork[i] != 0.0 ) { + /* Adding SAFE1 to the numerator guards against + spuriously zero residuals (underflow). */ + s = SUPERLU_MAX( s, (safe1 + fabs(work[i])) / rwork[i] ); + } + /* If rwork[i] is exactly 0.0, then we know the true + residual also must be exactly 0.0. */ + } + berr[j] = s; + + /* Test stopping criterion. Continue iterating if + 1) The residual BERR(J) is larger than machine epsilon, and + 2) BERR(J) decreased by at least a factor of 2 during the + last iteration, and + 3) At most ITMAX iterations tried. */ + + if (berr[j] > eps && berr[j] * 2. <= lstres && count < ITMAX) { + /* Update solution and try again. */ + sgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + +#ifdef _CRAY + SAXPY(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#else + saxpy_(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#endif + lstres = berr[j]; + ++count; + } else { + break; + } + + } /* end while */ + + stat->RefineSteps = count; + + /* Bound error from formula: + norm(X - XTRUE) / norm(X) .le. FERR = norm( abs(inv(op(A)))* + ( abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) / norm(X) + where + norm(Z) is the magnitude of the largest component of Z + inv(op(A)) is the inverse of op(A) + abs(Z) is the componentwise absolute value of the matrix or + vector Z + NZ is the maximum number of nonzeros in any row of A, plus 1 + EPS is machine epsilon + + The i-th component of abs(R)+NZ*EPS*(abs(op(A))*abs(X)+abs(B)) + is incremented by SAFE1 if the i-th component of + abs(op(A))*abs(X) + abs(B) is less than SAFE2. + + Use SLACON to estimate the infinity-norm of the matrix + inv(op(A)) * diag(W), + where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = fabs( Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if ( notran ) { + for (k = 0; k < A->ncol; ++k) { + xk = fabs( Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += fabs(Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + xk = fabs( Xptr[irow] ); + s += fabs(Aval[i]) * xk; + } + rwork[k] += s; + } + } + + for (i = 0; i < A->nrow; ++i) + if (rwork[i] > safe2) + rwork[i] = fabs(work[i]) + (iwork[i]+1)*eps*rwork[i]; + else + rwork[i] = fabs(work[i])+(iwork[i]+1)*eps*rwork[i]+safe1; + + kase = 0; + + do { + slacon_(&A->nrow, &work[A->nrow], work, + &iwork[A->nrow], &ferr[j], &kase); + if (kase == 0) break; + + if (kase == 1) { + /* Multiply by diag(W)*inv(op(A)**T)*(diag(C) or diag(R)). */ + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= C[i]; + else if ( !notran && rowequ ) + for (i = 0; i < A->nrow; ++i) work[i] *= R[i]; + + sgstrs (transt, L, U, perm_c, perm_r, &Bjcol, stat, info); + + for (i = 0; i < A->nrow; ++i) work[i] *= rwork[i]; + } else { + /* Multiply by (diag(C) or diag(R))*inv(op(A))*diag(W). */ + for (i = 0; i < A->nrow; ++i) work[i] *= rwork[i]; + + sgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= C[i]; + else if ( !notran && rowequ ) + for (i = 0; i < A->ncol; ++i) work[i] *= R[i]; + } + + } while ( kase != 0 ); + + + /* Normalize error. */ + lstres = 0.; + if ( notran && colequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, C[i] * fabs( Xptr[i]) ); + } else if ( !notran && rowequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, R[i] * fabs( Xptr[i]) ); + } else { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, fabs( Xptr[i]) ); + } + if ( lstres != 0. ) + ferr[j] /= lstres; + + } /* for each RHS j ... */ + + SUPERLU_FREE(work); + SUPERLU_FREE(rwork); + SUPERLU_FREE(iwork); + SUPERLU_FREE(Bjcol.Store); + + return; + +} /* sgsrfs */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgssv.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgssv.c new file mode 100644 index 0000000..c567daa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgssv.c @@ -0,0 +1,227 @@ + +/*! @file sgssv.c + * \brief Solves the system of linear equations A*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSSV solves the system of linear equations A*X=B, using the
    + * LU factorization from SGSTRF. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *
    + *      1.1. Permute the columns of A, forming A*Pc, where Pc
    + *           is a permutation matrix. For more details of this step, 
    + *           see sp_preorder.c.
    + *
    + *      1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    + *           by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      1.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    + *      above algorithm to the transpose of A:
    + *
    + *      2.1. Permute columns of transpose(A) (rows of A),
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    + *           determined by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      2.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR; Dtype = SLU_S; Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + * perm_c  (input/output) int*
    + *         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    + *         which defines the permutation matrix Pc; perm_c[i] = j means 
    + *         column i of A is in position j in A*Pc.
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + *         If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    + *            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    + *            On exit, perm_c may be overwritten by the product of the input
    + *            perm_c and a permutation that postorders the elimination tree
    + *            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *            is already in postorder.
    + *         Otherwise, it is an output argument.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined 
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->RowPerm = MY_PERMR or
    + *            options->Fact = SamePattern_SameRowPerm, perm_r is an
    + *            input argument.
    + *         otherwise it is an output argument.
    + *
    + * L       (output) SuperMatrix*
    + *         The factor L from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *         
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *         > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                so the solution could not be computed.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol.
    + * 
    + */ + +void +sgssv(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, + SuperLUStat_t *stat, int *info ) +{ + + DNformat *Bstore; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int lwork = 0, *etree, i; + + /* Set default values for some parameters */ + int panel_size; /* panel size */ + int relax; /* no of columns in a relaxed snodes */ + int permc_spec; + trans_t trans = NOTRANS; + double *utime; + double t; /* Temporary time */ + + /* Test the input parameters ... */ + *info = 0; + Bstore = B->Store; + if ( options->Fact != DOFACT ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_S || A->Mtype != SLU_GE ) + *info = -2; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_S || B->Mtype != SLU_GE ) + *info = -7; + if ( *info != 0 ) { + i = -(*info); + xerbla_("sgssv", &i); + return; + } + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + sCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + trans = TRANS; + } else { + if ( A->Stype == SLU_NC ) AA = A; + } + + t = SuperLU_timer_(); + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t; + + etree = intMalloc(A->ncol); + + t = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t; + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + /*printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4));*/ + t = SuperLU_timer_(); + /* Compute the LU factorization of A. */ + sgstrf(options, &AC, relax, panel_size, etree, + NULL, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t; + + t = SuperLU_timer_(); + if ( *info == 0 ) { + /* Solve the system A*X=B, overwriting B with X. */ + sgstrs (trans, L, U, perm_c, perm_r, B, stat, info); + } + utime[SOLVE] = SuperLU_timer_() - t; + + SUPERLU_FREE (etree); + Destroy_CompCol_Permuted(&AC); + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgssvx.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgssvx.c new file mode 100644 index 0000000..35e7ec6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgssvx.c @@ -0,0 +1,614 @@ + +/*! @file sgssvx.c + * \brief Solves the system of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + * the LU factorization from sgstrf(). Error bounds on the solution and
    + * a condition estimate are also provided. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *      1.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A is
    + *           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *           = TRANS or CONJ).
    + *
    + *      1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *           matrix that usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the matrix A (after equilibration if options->Equil = YES)
    + *           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *      1.4. Compute the reciprocal pivot growth factor.
    + *
    + *      1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form of 
    + *           A is used to estimate the condition number of the matrix A. If
    + *           the reciprocal of the condition number is less than machine
    + *           precision, info = A->ncol+1 is returned as a warning, but the
    + *           routine still goes on to solve for X and computes error bounds
    + *           as described below.
    + *
    + *      1.6. The system of equations is solved for X using the factored form
    + *           of A.
    + *
    + *      1.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      1.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *      to the transpose of A:
    + *
    + *      2.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A' is
    + *           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    + *           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *      2.2. Permute columns of transpose(A) (rows of A), 
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    + *           usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the transpose(A) (after equilibration if 
    + *           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *           permutation Pr determined by partial pivoting.
    + *
    + *      2.4. Compute the reciprocal pivot growth factor.
    + *
    + *      2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form 
    + *           of transpose(A) is used to estimate the condition number of the
    + *           matrix A. If the reciprocal of the condition number
    + *           is less than machine precision, info = A->nrow+1 is returned as
    + *           a warning, but the routine still goes on to solve for X and
    + *           computes error bounds as described below.
    + *
    + *      2.6. The system of equations is solved for X using the factored form
    + *           of transpose(A).
    + *
    + *      2.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      2.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input/output) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + *         On entry, If options->Fact = FACTORED and equed is not 'N', 
    + *         then A must have been equilibrated by the scaling factors in
    + *         R and/or C.  
    + *         On exit, A is not modified if options->Equil = NO, or if 
    + *         options->Equil = YES but equed = 'N' on exit.
    + *         Otherwise, if options->Equil = YES and equed is not 'N',
    + *         A is scaled as follows:
    + *         If A->Stype = SLU_NC:
    + *           equed = 'R':  A := diag(R) * A
    + *           equed = 'C':  A := A * diag(C)
    + *           equed = 'B':  A := diag(R) * A * diag(C).
    + *         If A->Stype = SLU_NR:
    + *           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *         which defines the permutation matrix Pc; perm_c[i] = j means
    + *         column i of A is in position j in A*Pc.
    + *         On exit, perm_c may be overwritten by the product of the input
    + *         perm_c and a permutation that postorders the elimination tree
    + *         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *         is already in postorder.
    + *
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *         will try to use the input perm_r, unless a certain threshold
    + *         criterion is violated. In that case, perm_r is overwritten by a
    + *         new permutation determined by partial pivoting or diagonal
    + *         threshold pivoting.
    + *         Otherwise, perm_r is output argument.
    + * 
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *         Elimination tree of Pc'*A'*A*Pc.
    + *         If options->Fact != FACTORED and options->Fact != DOFACT,
    + *         etree is an input argument, otherwise it is an output argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *         Specifies the form of equilibration that was done.
    + *         = 'N': No equilibration.
    + *         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *         = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                by diag(R)*A*diag(C).
    + *         If options->Fact = FACTORED, equed is an input argument,
    + *         otherwise it is an output argument.
    + *
    + * R       (input/output) float*, dimension (A->nrow)
    + *         The row scale factors for A or transpose(A).
    + *         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *         If equed = 'N' or 'C', R is not accessed.
    + *         If options->Fact = FACTORED, R is an input argument,
    + *             otherwise, R is output.
    + *         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *             of R must be positive.
    + * 
    + * C       (input/output) float*, dimension (A->ncol)
    + *         The column scale factors for A or transpose(A).
    + *         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *         If equed = 'N' or 'R', C is not accessed.
    + *         If options->Fact = FACTORED, C is an input argument,
    + *             otherwise, C is output.
    + *         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *             of C must be positive.
    + *         
    + * L       (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *         User supplied workspace, should be large enough
    + *         to hold data structures for factors L and U.
    + *         On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               mem_usage->total_needed; no other side effects.
    + *
    + *         See argument 'mem_usage' for memory usage statistics.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         If B->ncol = 0, only LU decomposition is performed, the triangular
    + *                         solve is skipped.
    + *         On exit,
    + *            if equed = 'N', B is not modified; otherwise
    + *            if A->Stype = SLU_NC:
    + *               if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *                  B is overwritten by diag(R)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *                  B is overwritten by diag(C)*B;
    + *            if A->Stype = SLU_NR:
    + *               if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *                  B is overwritten by diag(C)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *                  B is overwritten by diag(R)*B.
    + *
    + * X       (output) SuperMatrix*
    + *         X has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE. 
    + *         If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *         to the original system of equations. Note that A and B are modified
    + *         on exit if equed is not 'N', and the solution to the equilibrated
    + *         system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *         and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) float*
    + *         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *         The infinity norm is used. If recip_pivot_growth is much less
    + *         than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) float*
    + *         The estimate of the reciprocal condition number of the matrix A
    + *         after equilibration (if done). If rcond is less than the machine
    + *         precision (in particular, if rcond = 0), the matrix is singular
    + *         to working precision. This condition is indicated by a return
    + *         code of info > 0.
    + *
    + * FERR    (output) float*, dimension (B->ncol)   
    + *         The estimated forward error bound for each solution vector   
    + *         X(j) (the j-th column of the solution matrix X).   
    + *         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *         is an estimated upper bound for the magnitude of the largest 
    + *         element in (X(j) - XTRUE) divided by the magnitude of the   
    + *         largest element in X(j).  The estimate is as reliable as   
    + *         the estimate for RCOND, and is almost always a slight   
    + *         overestimate of the true error.
    + *         If options->IterRefine = NOREFINE, ferr = 1.0.
    + *
    + * BERR    (output) float*, dimension (B->ncol)
    + *         The componentwise relative backward error of each solution   
    + *         vector X(j) (i.e., the smallest relative change in   
    + *         any element of A or B that makes X(j) an exact solution).
    + *         If options->IterRefine = NOREFINE, berr = 1.0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *         Record the memory usage statistics, consisting of following fields:
    + *         - for_lu (float)
    + *           The amount of space used in bytes for L\U data structures.
    + *         - total_needed (float)
    + *           The amount of space needed in bytes to perform factorization.
    + *         - expansions (int)
    + *           The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *         = 0: successful exit   
    + *         < 0: if info = -i, the i-th argument had an illegal value   
    + *         > 0: if info = i, and i is   
    + *              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    + *                    been completed, but the factor U is exactly   
    + *                    singular, so the solution and error bounds   
    + *                    could not be computed.   
    + *              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *                    precision, meaning that the matrix is singular to
    + *                    working precision. Nevertheless, the solution and
    + *                    error bounds are computed because there are a number
    + *                    of situations where the computed solution can be more
    + *                    accurate than the value of RCOND would suggest.   
    + *              > A->ncol+1: number of bytes allocated when memory allocation
    + *                    failure occurred, plus A->ncol.
    + * 
    + */ + +void +sgssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, float *R, float *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, float *recip_pivot_growth, + float *rcond, float *ferr, float *berr, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info ) +{ + + + DNformat *Bstore, *Xstore; + float *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec; + trans_t trant; + char norm[1]; + int i, j, info1; + float amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + float diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + /* External functions */ + extern float slangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = slamch_("Safe minimum"); + bignum = 1. / smlnum; + } + +#if 0 +printf("dgssvx: Fact=%4d, Trans=%4d, equed=%c\n", + options->Fact, options->Trans, *equed); +#endif + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_S || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_S || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_S || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("sgssvx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + sCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact && equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + sgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + slaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + +/* printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4)); + fflush(stdout); */ + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + sgstrf(options, &AC, relax, panel_size, etree, + work, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) { + if ( *info <= A->ncol ) { + /* Compute the reciprocal pivot growth factor of the leading + rank-deficient *info columns of A. */ + *recip_pivot_growth = sPivotGrowth(*info, AA, perm_c, L, U); + } + return; + } + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = sPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = slangs(norm, AA); + sgscon(norm, L, U, anorm, rcond, stat, info); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Scale the right hand side if equilibration was performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Bmat[i + j*ldb] *= R[i]; + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Bmat[i + j*ldb] *= C[i]; + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + sgstrs (trant, L, U, perm_c, perm_r, X, stat, info); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Use iterative refinement to improve the computed solution and compute + error bounds and backward error estimates for it. */ + t0 = SuperLU_timer_(); + if ( options->IterRefine != NOREFINE ) { + sgsrfs(trant, AA, L, U, perm_c, perm_r, equed, R, C, B, + X, ferr, berr, stat, info); + } else { + for (j = 0; j < nrhs; ++j) ferr[j] = berr[j] = 1.0; + } + utime[REFINE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Xmat[i + j*ldx] *= C[i]; + } + } else if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + Xmat[i + j*ldx] *= R[i]; + } + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < slamch_("E") ) *info = A->ncol + 1; + } + + if ( nofact ) { + sQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgstrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgstrf.c new file mode 100644 index 0000000..109f0bb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgstrf.c @@ -0,0 +1,436 @@ + +/*! @file sgstrf.c + * \brief Computes an LU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSTRF computes an LU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = SLU_NCP; Dtype = SLU_S; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *          To control degree of relaxing supernodes. If the number
    + *          of nodes (columns) in a subtree of the elimination tree is less
    + *          than relax, this subtree is considered as one supernode,
    + *          regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *          A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *          Elimination tree of A'*A.
    + *          Note: etree is a vector of parent pointers for a forest whose
    + *          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *          On input, the columns of A should be permuted so that the
    + *          etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *          User-supplied work space and space for the output data structures.
    + *          Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the 
    + *          permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *          in position j in A*Pc.
    + *          When searching for diagonal, perm_c[*] is applied to the
    + *          row subscripts of A, so that diagonal threshold pivoting
    + *          can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *          Row permutation vector which defines the permutation matrix Pr,
    + *          perm_r[i] = j means row i of A is in position j in Pr*A.
    + *          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *             will try to use the input perm_r, unless a certain threshold
    + *             criterion is violated. In that case, perm_r is overwritten by
    + *             a new permutation determined by partial pivoting or diagonal
    + *             threshold pivoting.
    + *          Otherwise, perm_r is output argument;
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = SLU_NC, 
    + *          Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *          = 0: successful exit
    + *          < 0: if info = -i, the i-th argument had an illegal value
    + *          > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                and division by zero will occur if it is used to solve a
    + *                system of equations.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol. If lwork = -1, it is
    + *                the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays: 
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   xprune[0:n-1]: xprune[*] points to locations in subscript 
    + *	vector lsub[*]. For column i, xprune[i] denotes the point where 
    + *	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    + *	to be traversed for symbolic factorization.
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been 
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    + *	      see spanel_dfs.c; marker2 is used for inner-factorization,
    + *            see scolumn_dfs.c.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *      Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the 
    + *	last column of a supernode.
    + *      The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    + *	supernodal representative r, repfnz[r] is the location of the first 
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel. 
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    + *      the panel diagonal. These are filled in during spanel_dfs(), and are
    + *      used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *	    	   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_sdefs.h.
    + * 
    + */ + +void +sgstrf (superlu_options_t *options, SuperMatrix *A, + int relax, int panel_size, int *etree, void *work, int lwork, + int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, + SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *iwork; + float *swork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *xprune; + int *marker; + float *dense, *tempv; + int *relax_end; + float *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + float fill_ratio = sp_ienv(6); /* estimated fill ratio */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = sLUMemInit(fact, work, lwork, m, n, Astore->nnz, + panel_size, fill_ratio, L, U, &Glu, &iwork, &swork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &xprune, &marker); + sSetRWork(m, panel_size, swork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) { + heap_relax_snode(n, etree, relax, marker, relax_end); + } else { + relax_snode(n, etree, relax, marker, relax_end); + } + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ssnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + xprune, marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ( (*info = sLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu)) ) + return; + } + + for (icol = jcol; icol<= kcol; icol++) { + xusub[icol+1] = nextu; + + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) + dense[asub[k]] = a[k]; + + /* Numeric update within the snode */ + ssnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if ( (*info = spivotL(icol, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + +#ifdef DEBUG + sprint_lu_col("[1]: ", icol, pivrow, xprune, &Glu); +#endif + + } + + jcol = icol; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + spanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, panel_lsub, segrep, repfnz, xprune, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + spanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for ( jj = jcol; jj < jcol + panel_size; jj++) { + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + if ((*info = scolumn_dfs(m, jj, perm_r, &nseg, &panel_lsub[k], + segrep, &repfnz[k], xprune, marker, + parent, xplore, &Glu)) != 0) return; + + /* Numeric updates */ + if ((*info = scolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Copy the U-segments to ucol[*] */ + if ((*info = scopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], &Glu)) != 0) + return; + + if ( (*info = spivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + + /* Prune columns (0:jj-1) using column jj */ + spruneL(jj, perm_r, pivrow, nseg, segrep, + &repfnz[k], xprune, &Glu); + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + +#ifdef DEBUG + sprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); +#endif + + } + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + countnz(min_mn, xprune, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + sLUWorkFree(iwork, swork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + sCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_S, SLU_TRLU); + sCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_S, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sgstrs.c b/thirdparty/superlu/SuperLU_4.1/SRC/sgstrs.c new file mode 100644 index 0000000..13b9bb4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sgstrs.c @@ -0,0 +1,337 @@ + +/*! @file sgstrs.c + * \brief Solves a system using LU factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_sdefs.h" + + +/* + * Function prototypes + */ +void susolve(int, int, float*, float*); +void slsolve(int, int, float*, float*); +void smatvec(int, int, int, float*, float*, float*); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * SGSTRS solves a system of linear equations A*X=B or A'*X=B
    + * with A sparse and B dense, using the LU factorization computed by
    + * SGSTRF.
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *
    + * L       (input) SuperMatrix*
    + *         The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *         sgstrf(). Use compressed row subscripts storage for supernodes,
    + *         i.e., L has types: Stype = SLU_SC, Dtype = SLU_S, Mtype = SLU_TRLU.
    + *
    + * U       (input) SuperMatrix*
    + *         The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *         sgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_S, Mtype = SLU_TRU.
    + *
    + * perm_c  (input) int*, dimension (L->ncol)
    + *	   Column permutation vector, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + *
    + * perm_r  (input) int*, dimension (L->nrow)
    + *         Row permutation vector, which defines the permutation matrix Pr; 
    + *         perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_S, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + * 	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + * 
    + */ + +void +sgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, SuperMatrix *B, + SuperLUStat_t *stat, int *info) +{ + +#ifdef _CRAY + _fcd ftcs1, ftcs2, ftcs3, ftcs4; +#endif + int incx = 1, incy = 1; +#ifdef USE_VENDOR_BLAS + float alpha = 1.0, beta = 1.0; + float *work_col; +#endif + DNformat *Bstore; + float *Bmat; + SCformat *Lstore; + NCformat *Ustore; + float *Lval, *Uval; + int fsupc, nrow, nsupr, nsupc, luptr, istart, irow; + int i, j, k, iptr, jcol, n, ldb, nrhs; + float *work, *rhs_work, *soln; + flops_t solve_ops; + void sprint_soln(); + + /* Test input parameters ... */ + *info = 0; + Bstore = B->Store; + ldb = Bstore->lda; + nrhs = B->ncol; + if ( trans != NOTRANS && trans != TRANS && trans != CONJ ) *info = -1; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_S || L->Mtype != SLU_TRLU ) + *info = -2; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_S || U->Mtype != SLU_TRU ) + *info = -3; + else if ( ldb < SUPERLU_MAX(0, L->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_S || B->Mtype != SLU_GE ) + *info = -6; + if ( *info ) { + i = -(*info); + xerbla_("sgstrs", &i); + return; + } + + n = L->nrow; + work = floatCalloc(n * nrhs); + if ( !work ) ABORT("Malloc fails for local work[]."); + soln = floatMalloc(n); + if ( !soln ) ABORT("Malloc fails for local soln[]."); + + Bmat = Bstore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( trans == NOTRANS ) { + /* Permute right hand sides to form Pr*B */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_r[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + /* Forward solve PLy=Pb. */ + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + nrow = nsupr - nsupc; + + solve_ops += nsupc * (nsupc - 1) * nrhs; + solve_ops += 2 * nrow * nsupc * nrhs; + + if ( nsupc == 1 ) { + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + luptr = L_NZ_START(fsupc); + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); iptr++){ + irow = L_SUB(iptr); + ++luptr; + rhs_work[irow] -= rhs_work[fsupc] * Lval[luptr]; + } + } + } else { + luptr = L_NZ_START(fsupc); +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("N", strlen("N")); + ftcs3 = _cptofcd("U", strlen("U")); + STRSM( ftcs1, ftcs1, ftcs2, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + SGEMM( ftcs2, ftcs2, &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#else + strsm_("L", "L", "N", "U", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + sgemm_( "N", "N", &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#endif + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + work_col = &work[j*n]; + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + rhs_work[irow] -= work_col[i]; /* Scatter */ + work_col[i] = 0.0; + iptr++; + } + } +#else + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + slsolve (nsupr, nsupc, &Lval[luptr], &rhs_work[fsupc]); + smatvec (nsupr, nrow, nsupc, &Lval[luptr+nsupc], + &rhs_work[fsupc], &work[0] ); + + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + rhs_work[irow] -= work[i]; + work[i] = 0.0; + iptr++; + } + } +#endif + } /* else ... */ + } /* for L-solve */ + +#ifdef DEBUG + printf("After L-solve: y=\n"); + sprint_soln(n, nrhs, Bmat); +#endif + + /* + * Back solve Ux=y. + */ + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += nsupc * (nsupc + 1) * nrhs; + + if ( nsupc == 1 ) { + rhs_work = &Bmat[0]; + for (j = 0; j < nrhs; j++) { + rhs_work[fsupc] /= Lval[luptr]; + rhs_work += ldb; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("U", strlen("U")); + ftcs3 = _cptofcd("N", strlen("N")); + STRSM( ftcs1, ftcs2, ftcs3, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#else + strsm_("L", "U", "N", "N", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#endif +#else + for (j = 0; j < nrhs; j++) + susolve ( nsupr, nsupc, &Lval[luptr], &Bmat[fsupc+j*ldb] ); +#endif + } + + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (jcol = fsupc; jcol < fsupc + nsupc; jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++ ){ + irow = U_SUB(i); + rhs_work[irow] -= rhs_work[jcol] * Uval[i]; + } + } + } + + } /* for U-solve */ + +#ifdef DEBUG + printf("After U-solve: x=\n"); + sprint_soln(n, nrhs, Bmat); +#endif + + /* Compute the final solution X := Pc*X. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_c[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = solve_ops; + + } else { /* Solve A'*X=B or CONJ(A)*X=B */ + /* Permute right hand sides to form Pc'*B. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_c[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = 0; + for (k = 0; k < nrhs; ++k) { + + /* Multiply by inv(U'). */ + sp_strsv("U", "T", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by inv(L'). */ + sp_strsv("L", "T", "U", L, U, &Bmat[k*ldb], stat, info); + + } + /* Compute the final solution X := Pr'*X (=inv(Pr)*X) */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_r[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + } + + SUPERLU_FREE(work); + SUPERLU_FREE(soln); +} + +/* + * Diagnostic print of the solution vector + */ +void +sprint_soln(int n, int nrhs, float *soln) +{ + int i; + + for (i = 0; i < n; i++) + printf("\t%d: %.4f\n", i, soln[i]); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c b/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c new file mode 100644 index 0000000..4e02fdc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c @@ -0,0 +1,236 @@ + +/*! @file slacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   SLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) FLOAT PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) FLOAT PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *         and SLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *   ISGN   (workspace) INT array, dimension (N)
    + *
    + *   EST    (output) FLOAT PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to SLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from SLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +slacon_(int *n, float *v, float *x, int *isgn, float *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + float zero = 0.0; + float one = 1.0; + + /* Local variables */ + static int iter; + static int jump, jlast; + static float altsgn, estold; + static int i, j; + float temp; +#ifdef _CRAY + extern int ISAMAX(int *, float *, int *); + extern float SASUM(int *, float *, int *); + extern int SCOPY(int *, float *, int *, float *, int *); +#else + extern int isamax_(int *, float *, int *); + extern float sasum_(int *, float *, int *); + extern int scopy_(int *, float *, int *, float *, int *); +#endif +#define d_sign(a, b) (b >= 0 ? fabs(a) : -fabs(a)) /* Copy sign */ +#define i_dnnt(a) \ + ( a>=0 ? floor(a+.5) : -floor(.5-a) ) /* Round to nearest integer */ + + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i] = 1. / (float) (*n); + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = fabs(v[0]); + /* ... QUIT */ + goto L150; + } +#ifdef _CRAY + *est = SASUM(n, x, &c__1); +#else + *est = sasum_(n, x, &c__1); +#endif + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = isamax_(n, &x[0], &c__1); +#endif + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + SCOPY(n, x, &c__1, v, &c__1); +#else + scopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; +#ifdef _CRAY + *est = SASUM(n, v, &c__1); +#else + *est = sasum_(n, v, &c__1); +#endif + + for (i = 0; i < *n; ++i) + if (i_dnnt(d_sign(one, x[i])) != isgn[i]) + goto L90; + + /* REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED. */ + goto L120; + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = isamax_(n, &x[0], &c__1); +#endif + --j; + if (x[jlast] != fabs(x[j]) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1] = altsgn * ((float)(i - 1) / (float)(*n - 1) + 1.); + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: +#ifdef _CRAY + temp = SASUM(n, x, &c__1) / (float)(*n * 3) * 2.; +#else + temp = sasum_(n, x, &c__1) / (float)(*n * 3) * 2.; +#endif + if (temp > *est) { +#ifdef _CRAY + SCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + scopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* slacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c.bak new file mode 100644 index 0000000..4e02fdc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slacon.c.bak @@ -0,0 +1,236 @@ + +/*! @file slacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   SLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) FLOAT PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) FLOAT PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *         and SLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *   ISGN   (workspace) INT array, dimension (N)
    + *
    + *   EST    (output) FLOAT PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to SLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from SLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +slacon_(int *n, float *v, float *x, int *isgn, float *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + float zero = 0.0; + float one = 1.0; + + /* Local variables */ + static int iter; + static int jump, jlast; + static float altsgn, estold; + static int i, j; + float temp; +#ifdef _CRAY + extern int ISAMAX(int *, float *, int *); + extern float SASUM(int *, float *, int *); + extern int SCOPY(int *, float *, int *, float *, int *); +#else + extern int isamax_(int *, float *, int *); + extern float sasum_(int *, float *, int *); + extern int scopy_(int *, float *, int *, float *, int *); +#endif +#define d_sign(a, b) (b >= 0 ? fabs(a) : -fabs(a)) /* Copy sign */ +#define i_dnnt(a) \ + ( a>=0 ? floor(a+.5) : -floor(.5-a) ) /* Round to nearest integer */ + + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i] = 1. / (float) (*n); + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = fabs(v[0]); + /* ... QUIT */ + goto L150; + } +#ifdef _CRAY + *est = SASUM(n, x, &c__1); +#else + *est = sasum_(n, x, &c__1); +#endif + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = isamax_(n, &x[0], &c__1); +#endif + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + SCOPY(n, x, &c__1, v, &c__1); +#else + scopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; +#ifdef _CRAY + *est = SASUM(n, v, &c__1); +#else + *est = sasum_(n, v, &c__1); +#endif + + for (i = 0; i < *n; ++i) + if (i_dnnt(d_sign(one, x[i])) != isgn[i]) + goto L90; + + /* REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED. */ + goto L120; + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + x[i] = d_sign(one, x[i]); + isgn[i] = i_dnnt(x[i]); + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; +#ifdef _CRAY + j = ISAMAX(n, &x[0], &c__1); +#else + j = isamax_(n, &x[0], &c__1); +#endif + --j; + if (x[jlast] != fabs(x[j]) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1] = altsgn * ((float)(i - 1) / (float)(*n - 1) + 1.); + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: +#ifdef _CRAY + temp = SASUM(n, x, &c__1) / (float)(*n * 3) * 2.; +#else + temp = sasum_(n, x, &c__1) / (float)(*n * 3) * 2.; +#endif + if (temp > *est) { +#ifdef _CRAY + SCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + scopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* slacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slamch.c b/thirdparty/superlu/SuperLU_4.1/SRC/slamch.c new file mode 100644 index 0000000..ec3cd61 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slamch.c @@ -0,0 +1,993 @@ +/*! @file slamch.c + * \brief Determines single precision machine parameters and other service routines + * + *
    + *   -- LAPACK auxiliary routine (version 2.0) --   
    + *      Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
    + *      Courant Institute, Argonne National Lab, and Rice University   
    + *      October 31, 1992   
    + * 
    + */ +#include +#include "slu_Cnames.h" + +#define TRUE_ (1) +#define FALSE_ (0) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (double)abs(x) + +/*! \brief + +
    + Purpose   
    +    =======   
    +
    +    SLAMCH determines single precision machine parameters.   
    +
    +    Arguments   
    +    =========   
    +
    +    CMACH   (input) CHARACTER*1   
    +            Specifies the value to be returned by SLAMCH:   
    +            = 'E' or 'e',   SLAMCH := eps   
    +            = 'S' or 's ,   SLAMCH := sfmin   
    +            = 'B' or 'b',   SLAMCH := base   
    +            = 'P' or 'p',   SLAMCH := eps*base   
    +            = 'N' or 'n',   SLAMCH := t   
    +            = 'R' or 'r',   SLAMCH := rnd   
    +            = 'M' or 'm',   SLAMCH := emin   
    +            = 'U' or 'u',   SLAMCH := rmin   
    +            = 'L' or 'l',   SLAMCH := emax   
    +            = 'O' or 'o',   SLAMCH := rmax   
    +
    +            where   
    +
    +            eps   = relative machine precision   
    +            sfmin = safe minimum, such that 1/sfmin does not overflow   
    +            base  = base of the machine   
    +            prec  = eps*base   
    +            t     = number of (base) digits in the mantissa   
    +            rnd   = 1.0 when rounding occurs in addition, 0.0 otherwise   
    +            emin  = minimum exponent before (gradual) underflow   
    +            rmin  = underflow threshold - base**(emin-1)   
    +            emax  = largest exponent before overflow   
    +            rmax  = overflow threshold  - (base**emax)*(1-eps)   
    +
    +   ===================================================================== 
    +
    +*/ +float slamch_(char *cmach) +{ +/* >>Start of File<< + Initialized data */ + static int first = TRUE_; + /* System generated locals */ + int i__1; + float ret_val; + /* Builtin functions */ + double pow_ri(float *, int *); + /* Local variables */ + static float base; + static int beta; + static float emin, prec, emax; + static int imin, imax; + static int lrnd; + static float rmin, rmax, t, rmach; + extern int lsame_(char *, char *); + static float small, sfmin; + extern /* Subroutine */ int slamc2_(int *, int *, int *, float + *, int *, float *, int *, float *); + static int it; + static float rnd, eps; + + + + if (first) { + first = FALSE_; + slamc2_(&beta, &it, &lrnd, &eps, &imin, &rmin, &imax, &rmax); + base = (float) beta; + t = (float) it; + if (lrnd) { + rnd = 1.f; + i__1 = 1 - it; + eps = pow_ri(&base, &i__1) / 2; + } else { + rnd = 0.f; + i__1 = 1 - it; + eps = pow_ri(&base, &i__1); + } + prec = eps * base; + emin = (float) imin; + emax = (float) imax; + sfmin = rmin; + small = 1.f / rmax; + if (small >= sfmin) { + +/* Use SMALL plus a bit, to avoid the possibility of rou +nding + causing overflow when computing 1/sfmin. */ + + sfmin = small * (eps + 1.f); + } + } + + if (lsame_(cmach, "E")) { + rmach = eps; + } else if (lsame_(cmach, "S")) { + rmach = sfmin; + } else if (lsame_(cmach, "B")) { + rmach = base; + } else if (lsame_(cmach, "P")) { + rmach = prec; + } else if (lsame_(cmach, "N")) { + rmach = t; + } else if (lsame_(cmach, "R")) { + rmach = rnd; + } else if (lsame_(cmach, "M")) { + rmach = emin; + } else if (lsame_(cmach, "U")) { + rmach = rmin; + } else if (lsame_(cmach, "L")) { + rmach = emax; + } else if (lsame_(cmach, "O")) { + rmach = rmax; + } + + ret_val = rmach; + return ret_val; + +/* End of SLAMCH */ + +} /* slamch_ */ + + +/* Subroutine */ +/*! \brief + +
    + Purpose   
    +    =======   
    +
    +    SLAMC1 determines the machine parameters given by BETA, T, RND, and   
    +    IEEE1.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (output) INT   
    +            The base of the machine.   
    +
    +    T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.   
    +
    +    RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not 
    +  
    +            be a reliable guide to the way in which the machine performs 
    +  
    +            its arithmetic.   
    +
    +    IEEE1   (output) INT   
    +            Specifies whether rounding appears to be done in the IEEE   
    +            'round to nearest' style.   
    +
    +    Further Details   
    +    ===============   
    +
    +    The routine is based on the routine  ENVRON  by Malcolm and   
    +    incorporates suggestions by Gentleman and Marovich. See   
    +
    +       Malcolm M. A. (1972) Algorithms to reveal properties of   
    +          floating-point arithmetic. Comms. of the ACM, 15, 949-951.   
    +
    +       Gentleman W. M. and Marovich S. B. (1974) More on algorithms   
    +          that reveal properties of floating point arithmetic units.   
    +          Comms. of the ACM, 17, 276-277.   
    +
    +   ===================================================================== 
    +
    +*/ + +int slamc1_(int *beta, int *t, int *rnd, int + *ieee1) +{ + /* Initialized data */ + static int first = TRUE_; + /* System generated locals */ + float r__1, r__2; + /* Local variables */ + static int lrnd; + static float a, b, c, f; + static int lbeta; + static float savec; + static int lieee1; + static float t1, t2; + extern double slamc3_(float *, float *); + static int lt; + static float one, qtr; + + + + if (first) { + first = FALSE_; + one = 1.f; + +/* LBETA, LIEEE1, LT and LRND are the local values of BE +TA, + IEEE1, T and RND. + + Throughout this routine we use the function SLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + Compute a = 2.0**m with the smallest positive integer m s +uch + that + + fl( a + 1.0 ) = a. */ + + a = 1.f; + c = 1.f; + +/* + WHILE( C.EQ.ONE )LOOP */ +L10: + if (c == one) { + a *= 2; + c = slamc3_(&a, &one); + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + goto L10; + } +/* + END WHILE + + Now compute b = 2.0**m with the smallest positive integer +m + such that + + fl( a + b ) .gt. a. */ + + b = 1.f; + c = slamc3_(&a, &b); + +/* + WHILE( C.EQ.A )LOOP */ +L20: + if (c == a) { + b *= 2; + c = slamc3_(&a, &b); + goto L20; + } +/* + END WHILE + + Now compute the base. a and c are neighbouring floating po +int + numbers in the interval ( beta**t, beta**( t + 1 ) ) and + so + their difference is beta. Adding 0.25 to c is to ensure that + it + is truncated to beta and not ( beta - 1 ). */ + + qtr = one / 4; + savec = c; + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + lbeta = c + qtr; + +/* Now determine whether rounding or chopping occurs, by addin +g a + bit less than beta/2 and a bit more than beta/2 to + a. */ + + b = (float) lbeta; + r__1 = b / 2; + r__2 = -(double)b / 100; + f = slamc3_(&r__1, &r__2); + c = slamc3_(&f, &a); + if (c == a) { + lrnd = TRUE_; + } else { + lrnd = FALSE_; + } + r__1 = b / 2; + r__2 = b / 100; + f = slamc3_(&r__1, &r__2); + c = slamc3_(&f, &a); + if (lrnd && c == a) { + lrnd = FALSE_; + } + +/* Try and decide whether rounding is done in the IEEE 'round + to + nearest' style. B/2 is half a unit in the last place of the +two + numbers A and SAVEC. Furthermore, A is even, i.e. has last +bit + zero, and SAVEC is odd. Thus adding B/2 to A should not cha +nge + A, but adding B/2 to SAVEC should change SAVEC. */ + + r__1 = b / 2; + t1 = slamc3_(&r__1, &a); + r__1 = b / 2; + t2 = slamc3_(&r__1, &savec); + lieee1 = t1 == a && t2 > savec && lrnd; + +/* Now find the mantissa, t. It should be the integer part + of + log to the base beta of a, however it is safer to determine + t + by powering. So we find t as the smallest positive integer +for + which + + fl( beta**t + 1.0 ) = 1.0. */ + + lt = 0; + a = 1.f; + c = 1.f; + +/* + WHILE( C.EQ.ONE )LOOP */ +L30: + if (c == one) { + ++lt; + a *= lbeta; + c = slamc3_(&a, &one); + r__1 = -(double)a; + c = slamc3_(&c, &r__1); + goto L30; + } +/* + END WHILE */ + + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *ieee1 = lieee1; + return 0; + +/* End of SLAMC1 */ + +} /* slamc1_ */ + + +/* Subroutine */ + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    SLAMC2 determines the machine parameters specified in its argument   
    +    list.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (output) INT   
    +            The base of the machine.   
    +
    +    T       (output) INT   
    +            The number of ( BETA ) digits in the mantissa.   
    +
    +    RND     (output) INT   
    +            Specifies whether proper rounding  ( RND = .TRUE. )  or   
    +            chopping  ( RND = .FALSE. )  occurs in addition. This may not 
    +  
    +            be a reliable guide to the way in which the machine performs 
    +  
    +            its arithmetic.   
    +
    +    EPS     (output) FLOAT   
    +            The smallest positive number such that   
    +
    +               fl( 1.0 - EPS ) .LT. 1.0,   
    +
    +            where fl denotes the computed value.   
    +
    +    EMIN    (output) INT   
    +            The minimum exponent before (gradual) underflow occurs.   
    +
    +    RMIN    (output) FLOAT   
    +            The smallest normalized number for the machine, given by   
    +            BASE**( EMIN - 1 ), where  BASE  is the floating point value 
    +  
    +            of BETA.   
    +
    +    EMAX    (output) INT   
    +            The maximum exponent before overflow occurs.   
    +
    +    RMAX    (output) FLOAT   
    +            The largest positive number for the machine, given by   
    +            BASE**EMAX * ( 1 - EPS ), where  BASE  is the floating point 
    +  
    +            value of BETA.   
    +
    +    Further Details   
    +    ===============   
    +
    +    The computation of  EPS  is based on a routine PARANOIA by   
    +    W. Kahan of the University of California at Berkeley.   
    +
    +   ===================================================================== 
    +
    +*/ +int slamc2_(int *beta, int *t, int *rnd, float * + eps, int *emin, float *rmin, int *emax, float *rmax) +{ + /* Table of constant values */ + static int c__1 = 1; + + /* Initialized data */ + static int first = TRUE_; + static int iwarn = FALSE_; + /* System generated locals */ + int i__1; + float r__1, r__2, r__3, r__4, r__5; + /* Builtin functions */ + double pow_ri(float *, int *); + /* Local variables */ + static int ieee; + static float half; + static int lrnd; + static float leps, zero, a, b, c; + static int i, lbeta; + static float rbase; + static int lemin, lemax, gnmin; + static float small; + static int gpmin; + static float third, lrmin, lrmax, sixth; + static int lieee1; + extern /* Subroutine */ int slamc1_(int *, int *, int *, + int *); + extern double slamc3_(float *, float *); + extern /* Subroutine */ int slamc4_(int *, float *, int *), + slamc5_(int *, int *, int *, int *, int *, + float *); + static int lt, ngnmin, ngpmin; + static float one, two; + + + + if (first) { + first = FALSE_; + zero = 0.f; + one = 1.f; + two = 2.f; + +/* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values + of + BETA, T, RND, EPS, EMIN and RMIN. + + Throughout this routine we use the function SLAMC3 to ens +ure + that relevant values are stored and not held in registers, + or + are not affected by optimizers. + + SLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1. +*/ + + slamc1_(&lbeta, <, &lrnd, &lieee1); + +/* Start to find EPS. */ + + b = (float) lbeta; + i__1 = -lt; + a = pow_ri(&b, &i__1); + leps = a; + +/* Try some tricks to see whether or not this is the correct E +PS. */ + + b = two / 3; + half = one / 2; + r__1 = -(double)half; + sixth = slamc3_(&b, &r__1); + third = slamc3_(&sixth, &sixth); + r__1 = -(double)half; + b = slamc3_(&third, &r__1); + b = slamc3_(&b, &sixth); + b = dabs(b); + if (b < leps) { + b = leps; + } + + leps = 1.f; + +/* + WHILE( ( LEPS.GT.B ).AND.( B.GT.ZERO ) )LOOP */ +L10: + if (leps > b && b > zero) { + leps = b; + r__1 = half * leps; +/* Computing 5th power */ + r__3 = two, r__4 = r__3, r__3 *= r__3; +/* Computing 2nd power */ + r__5 = leps; + r__2 = r__4 * (r__3 * r__3) * (r__5 * r__5); + c = slamc3_(&r__1, &r__2); + r__1 = -(double)c; + c = slamc3_(&half, &r__1); + b = slamc3_(&half, &c); + r__1 = -(double)b; + c = slamc3_(&half, &r__1); + b = slamc3_(&half, &c); + goto L10; + } +/* + END WHILE */ + + if (a < leps) { + leps = a; + } + +/* Computation of EPS complete. + + Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3 +)). + Keep dividing A by BETA until (gradual) underflow occurs. T +his + is detected when we cannot recover the previous A. */ + + rbase = one / lbeta; + small = one; + for (i = 1; i <= 3; ++i) { + r__1 = small * rbase; + small = slamc3_(&r__1, &zero); +/* L20: */ + } + a = slamc3_(&one, &small); + slamc4_(&ngpmin, &one, &lbeta); + r__1 = -(double)one; + slamc4_(&ngnmin, &r__1, &lbeta); + slamc4_(&gpmin, &a, &lbeta); + r__1 = -(double)a; + slamc4_(&gnmin, &r__1, &lbeta); + ieee = FALSE_; + + if (ngpmin == ngnmin && gpmin == gnmin) { + if (ngpmin == gpmin) { + lemin = ngpmin; +/* ( Non twos-complement machines, no gradual under +flow; + e.g., VAX ) */ + } else if (gpmin - ngpmin == 3) { + lemin = ngpmin - 1 + lt; + ieee = TRUE_; +/* ( Non twos-complement machines, with gradual und +erflow; + e.g., IEEE standard followers ) */ + } else { + lemin = min(ngpmin,gpmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if (ngpmin == gpmin && ngnmin == gnmin) { + if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) { + lemin = max(ngpmin,ngnmin); +/* ( Twos-complement machines, no gradual underflow +; + e.g., CYBER 205 ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1 && gpmin == gnmin) + { + if (gpmin - min(ngpmin,ngnmin) == 3) { + lemin = max(ngpmin,ngnmin) - 1 + lt; +/* ( Twos-complement machines with gradual underflo +w; + no known machine ) */ + } else { + lemin = min(ngpmin,ngnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } + + } else { +/* Computing MIN */ + i__1 = min(ngpmin,ngnmin), i__1 = min(i__1,gpmin); + lemin = min(i__1,gnmin); +/* ( A guess; no known machine ) */ + iwarn = TRUE_; + } +/* ** + Comment out this if block if EMIN is ok */ + if (iwarn) { + first = TRUE_; + printf("\n\n WARNING. The value EMIN may be incorrect:- "); + printf("EMIN = %8i\n",lemin); + printf("If, after inspection, the value EMIN looks acceptable"); + printf("please comment out \n the IF block as marked within the"); + printf("code of routine SLAMC2, \n otherwise supply EMIN"); + printf("explicitly.\n"); + } +/* ** + + Assume IEEE arithmetic if we found denormalised numbers abo +ve, + or if arithmetic seems to round in the IEEE style, determi +ned + in routine SLAMC1. A true IEEE machine should have both thi +ngs + true; however, faulty machines may have one or the other. */ + + ieee = ieee || lieee1; + +/* Compute RMIN by successive division by BETA. We could comp +ute + RMIN as BASE**( EMIN - 1 ), but some machines underflow dur +ing + this computation. */ + + lrmin = 1.f; + i__1 = 1 - lemin; + for (i = 1; i <= 1-lemin; ++i) { + r__1 = lrmin * rbase; + lrmin = slamc3_(&r__1, &zero); +/* L30: */ + } + +/* Finally, call SLAMC5 to compute EMAX and RMAX. */ + + slamc5_(&lbeta, <, &lemin, &ieee, &lemax, &lrmax); + } + + *beta = lbeta; + *t = lt; + *rnd = lrnd; + *eps = leps; + *emin = lemin; + *rmin = lrmin; + *emax = lemax; + *rmax = lrmax; + + return 0; + + +/* End of SLAMC2 */ + +} /* slamc2_ */ + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    SLAMC3  is intended to force  A  and  B  to be stored prior to doing 
    +  
    +    the addition of  A  and  B ,  for use in situations where optimizers 
    +  
    +    might hold one of these in a register.   
    +
    +    Arguments   
    +    =========   
    +
    +    A, B    (input) FLOAT   
    +            The values A and B.   
    +
    +   ===================================================================== 
    +
    +*/ + +double slamc3_(float *a, float *b) +{ + +/* >>Start of File<< + System generated locals */ + float ret_val; + + + + ret_val = *a + *b; + + return ret_val; + +/* End of SLAMC3 */ + +} /* slamc3_ */ + + +/* Subroutine */ + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    SLAMC4 is a service routine for SLAMC2.   
    +
    +    Arguments   
    +    =========   
    +
    +    EMIN    (output) EMIN   
    +            The minimum exponent before (gradual) underflow, computed by 
    +  
    +            setting A = START and dividing by BASE until the previous A   
    +            can not be recovered.   
    +
    +    START   (input) FLOAT   
    +            The starting point for determining EMIN.   
    +
    +    BASE    (input) INT   
    +            The base of the machine.   
    +
    +   ===================================================================== 
    +
    +*/ + +int slamc4_(int *emin, float *start, int *base) +{ + /* System generated locals */ + int i__1; + float r__1; + /* Local variables */ + static float zero, a; + static int i; + static float rbase, b1, b2, c1, c2, d1, d2; + extern double slamc3_(float *, float *); + static float one; + + + + a = *start; + one = 1.f; + rbase = one / *base; + zero = 0.f; + *emin = 1; + r__1 = a * rbase; + b1 = slamc3_(&r__1, &zero); + c1 = a; + c2 = a; + d1 = a; + d2 = a; +/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND. + $ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */ +L10: + if (c1 == a && c2 == a && d1 == a && d2 == a) { + --(*emin); + a = b1; + r__1 = a / *base; + b1 = slamc3_(&r__1, &zero); + r__1 = b1 * *base; + c1 = slamc3_(&r__1, &zero); + d1 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d1 += b1; +/* L20: */ + } + r__1 = a * rbase; + b2 = slamc3_(&r__1, &zero); + r__1 = b2 / rbase; + c2 = slamc3_(&r__1, &zero); + d2 = zero; + i__1 = *base; + for (i = 1; i <= *base; ++i) { + d2 += b2; +/* L30: */ + } + goto L10; + } +/* + END WHILE */ + + return 0; + +/* End of SLAMC4 */ + +} /* slamc4_ */ + + +/* Subroutine */ +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    SLAMC5 attempts to compute RMAX, the largest machine floating-point   
    +    number, without overflow.  It assumes that EMAX + abs(EMIN) sum   
    +    approximately to a power of 2.  It will fail on machines where this   
    +    assumption does not hold, for example, the Cyber 205 (EMIN = -28625, 
    +  
    +    EMAX = 28718).  It will also fail if the value supplied for EMIN is   
    +    too large (i.e. too close to zero), probably with overflow.   
    +
    +    Arguments   
    +    =========   
    +
    +    BETA    (input) INT   
    +            The base of floating-point arithmetic.   
    +
    +    P       (input) INT   
    +            The number of base BETA digits in the mantissa of a   
    +            floating-point value.   
    +
    +    EMIN    (input) INT   
    +            The minimum exponent before (gradual) underflow.   
    +
    +    IEEE    (input) INT   
    +            A logical flag specifying whether or not the arithmetic   
    +            system is thought to comply with the IEEE standard.   
    +
    +    EMAX    (output) INT   
    +            The largest exponent before overflow   
    +
    +    RMAX    (output) FLOAT   
    +            The largest machine floating-point number.   
    +
    +   ===================================================================== 
    +  
    +
    +
    +       First compute LEXP and UEXP, two powers of 2 that bound   
    +       abs(EMIN). We then assume that EMAX + abs(EMIN) will sum   
    +       approximately to the bound that is closest to abs(EMIN).   
    +       (EMAX is the exponent of the required number RMAX). 
    +
    +*/ + +int slamc5_(int *beta, int *p, int *emin, + int *ieee, int *emax, float *rmax) +{ + /* Table of constant values */ + static float c_b5 = 0.f; + + /* System generated locals */ + int i__1; + float r__1; + /* Local variables */ + static int lexp; + static float oldy; + static int uexp, i; + static float y, z; + static int nbits; + extern double slamc3_(float *, float *); + static float recbas; + static int exbits, expsum, try__; + + + + lexp = 1; + exbits = 1; +L10: + try__ = lexp << 1; + if (try__ <= -(*emin)) { + lexp = try__; + ++exbits; + goto L10; + } + if (lexp == -(*emin)) { + uexp = lexp; + } else { + uexp = try__; + ++exbits; + } + +/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater + than or equal to EMIN. EXBITS is the number of bits needed to + store the exponent. */ + + if (uexp + *emin > -lexp - *emin) { + expsum = lexp << 1; + } else { + expsum = uexp << 1; + } + +/* EXPSUM is the exponent range, approximately equal to + EMAX - EMIN + 1 . */ + + *emax = expsum + *emin - 1; + nbits = exbits + 1 + *p; + +/* NBITS is the total number of bits needed to store a + floating-point number. */ + + if (nbits % 2 == 1 && *beta == 2) { + +/* Either there are an odd number of bits used to store a + floating-point number, which is unlikely, or some bits are + + not used in the representation of numbers, which is possible +, + (e.g. Cray machines) or the mantissa has an implicit bit, + (e.g. IEEE machines, Dec Vax machines), which is perhaps the + + most likely. We have to assume the last alternative. + If this is true, then we need to reduce EMAX by one because + + there must be some way of representing zero in an implicit-b +it + system. On machines like Cray, we are reducing EMAX by one + + unnecessarily. */ + + --(*emax); + } + + if (*ieee) { + +/* Assume we are on an IEEE machine which reserves one exponent + + for infinity and NaN. */ + + --(*emax); + } + +/* Now create RMAX, the largest machine number, which should + be equal to (1.0 - BETA**(-P)) * BETA**EMAX . + + First compute 1.0 - BETA**(-P), being careful that the + result is less than 1.0 . */ + + recbas = 1.f / *beta; + z = *beta - 1.f; + y = 0.f; + i__1 = *p; + for (i = 1; i <= *p; ++i) { + z *= recbas; + if (y < 1.f) { + oldy = y; + } + y = slamc3_(&y, &z); +/* L20: */ + } + if (y >= 1.f) { + y = oldy; + } + +/* Now multiply by BETA**EMAX to get RMAX. */ + + i__1 = *emax; + for (i = 1; i <= *emax; ++i) { + r__1 = y * *beta; + y = slamc3_(&r__1, &c_b5); +/* L30: */ + } + + *rmax = y; + return 0; + +/* End of SLAMC5 */ + +} /* slamc5_ */ + + +double pow_ri(float *ap, int *bp) +{ +double pow, x; +int n; + +pow = 1; +x = *ap; +n = *bp; + +if(n != 0) + { + if(n < 0) + { + n = -n; + x = 1/x; + } + for( ; ; ) + { + if(n & 01) + pow *= x; + if(n >>= 1) + x *= x; + else + break; + } + } +return(pow); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slangs.c b/thirdparty/superlu/SuperLU_4.1/SRC/slangs.c new file mode 100644 index 0000000..d765f2d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slangs.c @@ -0,0 +1,119 @@ + +/*! @file slangs.c + * \brief Returns the value of the one norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from lapack routine SLANGE 
    + * 
    + */ +/* + * File name: slangs.c + * History: Modified from lapack routine SLANGE + */ +#include +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   SLANGS returns the value of the one norm, or the Frobenius norm, or 
    + *   the infinity norm, or the element of largest absolute value of a 
    + *   real matrix A.   
    + *
    + *   Description   
    + *   ===========   
    + *
    + *   SLANGE returns the value   
    + *
    + *      SLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    + *               (   
    + *               ( norm1(A),         NORM = '1', 'O' or 'o'   
    + *               (   
    + *               ( normI(A),         NORM = 'I' or 'i'   
    + *               (   
    + *               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'   
    + *
    + *   where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    + *   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    + *   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    + *   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.   
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   NORM    (input) CHARACTER*1   
    + *           Specifies the value to be returned in SLANGE as described above.   
    + *   A       (input) SuperMatrix*
    + *           The M by N sparse matrix A. 
    + *
    + *  =====================================================================
    + * 
    + */ + +float slangs(char *norm, SuperMatrix *A) +{ + + /* Local variables */ + NCformat *Astore; + float *Aval; + int i, j, irow; + float value, sum; + float *rwork; + + Astore = A->Store; + Aval = Astore->nzval; + + if ( SUPERLU_MIN(A->nrow, A->ncol) == 0) { + value = 0.; + + } else if (lsame_(norm, "M")) { + /* Find max(abs(A(i,j))). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + value = SUPERLU_MAX( value, fabs( Aval[i]) ); + + } else if (lsame_(norm, "O") || *(unsigned char *)norm == '1') { + /* Find norm1(A). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) { + sum = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + sum += fabs(Aval[i]); + value = SUPERLU_MAX(value,sum); + } + + } else if (lsame_(norm, "I")) { + /* Find normI(A). */ + if ( !(rwork = (float *) SUPERLU_MALLOC(A->nrow * sizeof(float))) ) + ABORT("SUPERLU_MALLOC fails for rwork."); + for (i = 0; i < A->nrow; ++i) rwork[i] = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) { + irow = Astore->rowind[i]; + rwork[irow] += fabs(Aval[i]); + } + value = 0.; + for (i = 0; i < A->nrow; ++i) + value = SUPERLU_MAX(value, rwork[i]); + + SUPERLU_FREE (rwork); + + } else if (lsame_(norm, "F") || lsame_(norm, "E")) { + /* Find normF(A). */ + ABORT("Not implemented."); + } else + ABORT("Illegal norm specified."); + + return (value); + +} /* slangs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slaqgs.c b/thirdparty/superlu/SuperLU_4.1/SRC/slaqgs.c new file mode 100644 index 0000000..dcadea0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slaqgs.c @@ -0,0 +1,145 @@ + +/*! @file slaqgs.c + * \brief Equlibrates a general sprase matrix + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Modified from LAPACK routine SLAQGE
    + * 
    + */ +/* + * File name: slaqgs.c + * History: Modified from LAPACK routine SLAQGE + */ +#include +#include "slu_sdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   SLAQGS equilibrates a general sparse M by N matrix A using the row and   
    + *   scaling factors in the vectors R and C.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input/output) SuperMatrix*
    + *           On exit, the equilibrated matrix.  See EQUED for the form of 
    + *           the equilibrated matrix. The type of A can be:
    + *	    Stype = NC; Dtype = SLU_S; Mtype = GE.
    + *	    
    + *   R       (input) float*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *	    
    + *   C       (input) float*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *	    
    + *   ROWCND  (input) float
    + *           Ratio of the smallest R(i) to the largest R(i).
    + *	    
    + *   COLCND  (input) float
    + *           Ratio of the smallest C(i) to the largest C(i).
    + *	    
    + *   AMAX    (input) float
    + *           Absolute value of largest matrix entry.
    + *	    
    + *   EQUED   (output) char*
    + *           Specifies the form of equilibration that was done.   
    + *           = 'N':  No equilibration   
    + *           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    + *                   diag(R).   
    + *           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    + *                   by diag(C).   
    + *           = 'B':  Both row and column equilibration, i.e., A has been
    + *                   replaced by diag(R) * A * diag(C).   
    + *
    + *   Internal Parameters   
    + *   ===================   
    + *
    + *   THRESH is a threshold value used to decide if row or column scaling   
    + *   should be done based on the ratio of the row or column scaling   
    + *   factors.  If ROWCND < THRESH, row scaling is done, and if   
    + *   COLCND < THRESH, column scaling is done.   
    + *
    + *   LARGE and SMALL are threshold values used to decide if row scaling   
    + *   should be done based on the absolute size of the largest matrix   
    + *   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.   
    + *
    + *   ===================================================================== 
    + * 
    + */ + +void +slaqgs(SuperMatrix *A, float *r, float *c, + float rowcnd, float colcnd, float amax, char *equed) +{ + + +#define THRESH (0.1) + + /* Local variables */ + NCformat *Astore; + float *Aval; + int i, j, irow; + float large, small, cj; + + + /* Quick return if possible */ + if (A->nrow <= 0 || A->ncol <= 0) { + *(unsigned char *)equed = 'N'; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Initialize LARGE and SMALL. */ + small = slamch_("Safe minimum") / slamch_("Precision"); + large = 1. / small; + + if (rowcnd >= THRESH && amax >= small && amax <= large) { + if (colcnd >= THRESH) + *(unsigned char *)equed = 'N'; + else { + /* Column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + Aval[i] *= cj; + } + } + *(unsigned char *)equed = 'C'; + } + } else if (colcnd >= THRESH) { + /* Row scaling, no column scaling */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + Aval[i] *= r[irow]; + } + *(unsigned char *)equed = 'R'; + } else { + /* Row and column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + Aval[i] *= cj * r[irow]; + } + } + *(unsigned char *)equed = 'B'; + } + + return; + +} /* slaqgs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sldperm.c b/thirdparty/superlu/SuperLU_4.1/SRC/sldperm.c new file mode 100644 index 0000000..8276d77 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sldperm.c @@ -0,0 +1,168 @@ + +/*! @file + * \brief Finds a row permutation so that the matrix has large entries on the diagonal + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_sdefs.h" + +extern int_t mc64id_(int_t*); +extern int_t mc64ad_(int_t*, int_t*, int_t*, int_t [], int_t [], double [], + int_t*, int_t [], int_t*, int_t[], int_t*, double [], + int_t [], int_t []); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   SLDPERM finds a row permutation so that the matrix has large
    + *   entries on the diagonal.
    + *
    + * Arguments
    + * =========
    + *
    + * job    (input) int
    + *        Control the action. Possible values for JOB are:
    + *        = 1 : Compute a row permutation of the matrix so that the
    + *              permuted matrix has as many entries on its diagonal as
    + *              possible. The values on the diagonal are of arbitrary size.
    + *              HSL subroutine MC21A/AD is used for this.
    + *        = 2 : Compute a row permutation of the matrix so that the smallest 
    + *              value on the diagonal of the permuted matrix is maximized.
    + *        = 3 : Compute a row permutation of the matrix so that the smallest
    + *              value on the diagonal of the permuted matrix is maximized.
    + *              The algorithm differs from the one used for JOB = 2 and may
    + *              have quite a different performance.
    + *        = 4 : Compute a row permutation of the matrix so that the sum
    + *              of the diagonal entries of the permuted matrix is maximized.
    + *        = 5 : Compute a row permutation of the matrix so that the product
    + *              of the diagonal entries of the permuted matrix is maximized
    + *              and vectors to scale the matrix so that the nonzero diagonal 
    + *              entries of the permuted matrix are one in absolute value and 
    + *              all the off-diagonal entries are less than or equal to one in 
    + *              absolute value.
    + *        Restriction: 1 <= JOB <= 5.
    + *
    + * n      (input) int
    + *        The order of the matrix.
    + *
    + * nnz    (input) int
    + *        The number of nonzeros in the matrix.
    + *
    + * adjncy (input) int*, of size nnz
    + *        The adjacency structure of the matrix, which contains the row
    + *        indices of the nonzeros.
    + *
    + * colptr (input) int*, of size n+1
    + *        The pointers to the beginning of each column in ADJNCY.
    + *
    + * nzval  (input) float*, of size nnz
    + *        The nonzero values of the matrix. nzval[k] is the value of
    + *        the entry corresponding to adjncy[k].
    + *        It is not used if job = 1.
    + *
    + * perm   (output) int*, of size n
    + *        The permutation vector. perm[i] = j means row i in the
    + *        original matrix is in row j of the permuted matrix.
    + *
    + * u      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the row scaling factors. 
    + *
    + * v      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the column scaling factors. 
    + *        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + * 
    + */ + +int +sldperm(int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], + float nzval[], int_t *perm, float u[], float v[]) +{ + int_t i, liw, ldw, num; + int_t *iw, icntl[10], info[10]; + double *dw; + double *nzval_d = (double *) SUPERLU_MALLOC(nnz * sizeof(double)); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Enter sldperm()"); +#endif + liw = 5*n; + if ( job == 3 ) liw = 10*n + nnz; + if ( !(iw = intMalloc(liw)) ) ABORT("Malloc fails for iw[]"); + ldw = 3*n + nnz; + if ( !(dw = (double*) SUPERLU_MALLOC(ldw * sizeof(double))) ) + ABORT("Malloc fails for dw[]"); + + /* Increment one to get 1-based indexing. */ + for (i = 0; i <= n; ++i) ++colptr[i]; + for (i = 0; i < nnz; ++i) ++adjncy[i]; +#if ( DEBUGlevel>=2 ) + printf("LDPERM(): n %d, nnz %d\n", n, nnz); + slu_PrintInt10("colptr", n+1, colptr); + slu_PrintInt10("adjncy", nnz, adjncy); +#endif + + /* + * NOTE: + * ===== + * + * MC64AD assumes that column permutation vector is defined as: + * perm(i) = j means column i of permuted A is in column j of original A. + * + * Since a symmetric permutation preserves the diagonal entries. Then + * by the following relation: + * P'(A*P')P = P'A + * we can apply inverse(perm) to rows of A to get large diagonal entries. + * But, since 'perm' defined in MC64AD happens to be the reverse of + * SuperLU's definition of permutation vector, therefore, it is already + * an inverse for our purpose. We will thus use it directly. + * + */ + mc64id_(icntl); +#if 0 + /* Suppress error and warning messages. */ + icntl[0] = -1; + icntl[1] = -1; +#endif + + for (i = 0; i < nnz; ++i) nzval_d[i] = nzval[i]; + mc64ad_(&job, &n, &nnz, colptr, adjncy, nzval_d, &num, perm, + &liw, iw, &ldw, dw, icntl, info); + +#if ( DEBUGlevel>=2 ) + slu_PrintInt10("perm", n, perm); + printf(".. After MC64AD info %d\tsize of matching %d\n", info[0], num); +#endif + if ( info[0] == 1 ) { /* Structurally singular */ + printf(".. The last %d permutations:\n", n-num); + slu_PrintInt10("perm", n-num, &perm[num]); + } + + /* Restore to 0-based indexing. */ + for (i = 0; i <= n; ++i) --colptr[i]; + for (i = 0; i < nnz; ++i) --adjncy[i]; + for (i = 0; i < n; ++i) --perm[i]; + + if ( job == 5 ) + for (i = 0; i < n; ++i) { + u[i] = dw[i]; + v[i] = dw[n+i]; + } + + SUPERLU_FREE(iw); + SUPERLU_FREE(dw); + SUPERLU_FREE(nzval_d); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Exit sldperm()"); +#endif + + return info[0]; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_Cnames.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_Cnames.h new file mode 100644 index 0000000..7bcd1bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_Cnames.h @@ -0,0 +1,458 @@ +/*! @file slu_Cnames.h + * \brief Macros defining how C routines will be called + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 1, 1997
    + *
    + * These macros define how C routines will be called.  ADD_ assumes that
    + * they will be called by fortran, which expects C routines to have an
    + * underscore postfixed to the name (Suns, and the Intel expect this).
    + * NOCHANGE indicates that fortran will be calling, and that it expects
    + * the name called by fortran to be identical to that compiled by the C
    + * (RS6K's do this).  UPCASE says it expects C routines called by fortran
    + * to be in all upcase (CRAY wants this). 
    + * 
    + */ +#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */ +#define __SUPERLU_CNAMES + + +#define ADD_ 0 +#define ADD__ 1 +#define NOCHANGE 2 +#define UPCASE 3 +#define OLD_CRAY 4 +#define C_CALL 5 + +#ifdef UpCase +#define F77_CALL_C UPCASE +#endif + +#ifdef NoChange +#define F77_CALL_C NOCHANGE +#endif + +#ifdef Add_ +#define F77_CALL_C ADD_ +#endif + +#ifdef Add__ +#define F77_CALL_C ADD__ +#endif + +#ifdef _CRAY +#define F77_CALL_C OLD_CRAY +#endif + +/* Default */ +#ifndef F77_CALL_C +#define F77_CALL_C ADD_ +#endif + + +#if (F77_CALL_C == ADD_) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * No redefinition necessary to have following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm_(...) + * + * This is the default. + */ + +#endif + +#if (F77_CALL_C == ADD__) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm__(...) + */ +/* BLAS */ +#define sswap_ sswap__ +#define saxpy_ saxpy__ +#define sasum_ sasum__ +#define isamax_ isamax__ +#define scopy_ scopy__ +#define sscal_ sscal__ +#define sger_ sger__ +#define snrm2_ snrm2__ +#define ssymv_ ssymv__ +#define sdot_ sdot__ +#define saxpy_ saxpy__ +#define ssyr2_ ssyr2__ +#define srot_ srot__ +#define sgemv_ sgemv__ +#define strsv_ strsv__ +#define sgemm_ sgemm__ +#define strsm_ strsm__ + +#define dswap_ dswap__ +#define daxpy_ daxpy__ +#define dasum_ dasum__ +#define idamax_ idamax__ +#define dcopy_ dcopy__ +#define dscal_ dscal__ +#define dger_ dger__ +#define dnrm2_ dnrm2__ +#define dsymv_ dsymv__ +#define ddot_ ddot__ +#define dsyr2_ dsyr2__ +#define drot_ drot__ +#define dgemv_ dgemv__ +#define dtrsv_ dtrsv__ +#define dgemm_ dgemm__ +#define dtrsm_ dtrsm__ + +#define cswap_ cswap__ +#define caxpy_ caxpy__ +#define scasum_ scasum__ +#define icamax_ icamax__ +#define ccopy_ ccopy__ +#define cscal_ cscal__ +#define scnrm2_ scnrm2__ +#define caxpy_ caxpy__ +#define cgemv_ cgemv__ +#define ctrsv_ ctrsv__ +#define cgemm_ cgemm__ +#define ctrsm_ ctrsm__ +#define cgerc_ cgerc__ +#define chemv_ chemv__ +#define cher2_ cher2__ + +#define zswap_ zswap__ +#define zaxpy_ zaxpy__ +#define dzasum_ dzasum__ +#define izamax_ izamax__ +#define zcopy_ zcopy__ +#define zscal_ zscal__ +#define dznrm2_ dznrm2__ +#define zaxpy_ zaxpy__ +#define zgemv_ zgemv__ +#define ztrsv_ ztrsv__ +#define zgemm_ zgemm__ +#define ztrsm_ ztrsm__ +#define zgerc_ zgerc__ +#define zhemv_ zhemv__ +#define zher2_ zher2__ + +/* LAPACK */ +#define dlamch_ dlamch__ +#define slamch_ slamch__ +#define xerbla_ xerbla__ +#define lsame_ lsame__ +#define dlacon_ dlacon__ +#define slacon_ slacon__ +#define icmax1_ icmax1__ +#define scsum1_ scsum1__ +#define clacon_ clacon__ +#define dzsum1_ dzsum1__ +#define izmax1_ izmax1__ +#define zlacon_ zlacon__ + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv__ +#define c_fortran_sgssv_ c_fortran_sgssv__ +#define c_fortran_dgssv_ c_fortran_dgssv__ +#define c_fortran_cgssv_ c_fortran_cgssv__ +#define c_fortran_zgssv_ c_fortran_zgssv__ +#endif + +#if (F77_CALL_C == UPCASE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void DGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define saxpy_ SAXPY +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ DSWAP +#define daxpy_ DAXPY +#define dasum_ DASUM +#define idamax_ IDAMAX +#define dcopy_ DCOPY +#define dscal_ DSCAL +#define dger_ DGER +#define dnrm2_ DNRM2 +#define dsymv_ DSYMV +#define ddot_ DDOT +#define dsyr2_ DSYR2 +#define drot_ DROT +#define dgemv_ DGEMV +#define dtrsv_ DTRSV +#define dgemm_ DGEMM +#define dtrsm_ DTRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == OLD_CRAY) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void SGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ SSWAP +#define daxpy_ SAXPY +#define dasum_ SASUM +#define idamax_ ISAMAX +#define dcopy_ SCOPY +#define dscal_ SSCAL +#define dger_ SGER +#define dnrm2_ SNRM2 +#define dsymv_ SSYMV +#define ddot_ SDOT +#define dsyr2_ SSYR2 +#define drot_ SROT +#define dgemv_ SGEMV +#define dtrsv_ STRSV +#define dgemm_ SGEMM +#define dtrsm_ STRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define caxpy_ CAXPY +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == NOCHANGE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm(...) + */ +/* BLAS */ +#define sswap_ sswap +#define saxpy_ saxpy +#define sasum_ sasum +#define isamax_ isamax +#define scopy_ scopy +#define sscal_ sscal +#define sger_ sger +#define snrm2_ snrm2 +#define ssymv_ ssymv +#define sdot_ sdot +#define saxpy_ saxpy +#define ssyr2_ ssyr2 +#define srot_ srot +#define sgemv_ sgemv +#define strsv_ strsv +#define sgemm_ sgemm +#define strsm_ strsm + +#define dswap_ dswap +#define daxpy_ daxpy +#define dasum_ dasum +#define idamax_ idamax +#define dcopy_ dcopy +#define dscal_ dscal +#define dger_ dger +#define dnrm2_ dnrm2 +#define dsymv_ dsymv +#define ddot_ ddot +#define dsyr2_ dsyr2 +#define drot_ drot +#define dgemv_ dgemv +#define dtrsv_ dtrsv +#define dgemm_ dgemm +#define dtrsm_ dtrsm + +#define cswap_ cswap +#define caxpy_ caxpy +#define scasum_ scasum +#define icamax_ icamax +#define ccopy_ ccopy +#define cscal_ cscal +#define scnrm2_ scnrm2 +#define cgemv_ cgemv +#define ctrsv_ ctrsv +#define cgemm_ cgemm +#define ctrsm_ ctrsm +#define cgerc_ cgerc +#define chemv_ chemv +#define cher2_ cher2 + +#define zswap_ zswap +#define zaxpy_ zaxpy +#define dzasum_ dzasum +#define izamax_ izamax +#define zcopy_ zcopy +#define zscal_ zscal +#define dznrm2_ dznrm2 +#define zgemv_ zgemv +#define ztrsv_ ztrsv +#define zgemm_ zgemm +#define ztrsm_ ztrsm +#define zgerc_ zgerc +#define zhemv_ zhemv +#define zher2_ zher2 + +/* LAPACK */ +#define dlamch_ dlamch +#define slamch_ slamch +#define xerbla_ xerbla +#define lsame_ lsame +#define dlacon_ dlacon +#define slacon_ slacon +#define icmax1_ icmax1 +#define scsum1_ scsum1 +#define clacon_ clacon +#define dzsum1_ dzsum1 +#define izmax1_ izmax1 +#define zlacon_ zlacon + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv +#define c_fortran_sgssv_ c_fortran_sgssv +#define c_fortran_dgssv_ c_fortran_dgssv +#define c_fortran_cgssv_ c_fortran_cgssv +#define c_fortran_zgssv_ c_fortran_zgssv +#endif + + +#endif /* __SUPERLU_CNAMES */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_cdefs.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_cdefs.h new file mode 100644 index 0000000..24d1374 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_cdefs.h @@ -0,0 +1,284 @@ + +/*! @file slu_cdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_cSP_DEFS + +/* + * File name: csp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" +#include "slu_scomplex.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + complex *lusup; /* L supernodes */ + int *xlusup; + complex *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + float *, float *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +cgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +cgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +cCreate_CompRow_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +cCopy_Dense_Matrix(int, int, complex *, int, complex *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void callocateA (int, int, complex **, int **, int **); +extern void cgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int csnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int csnode_bmod (const int, const int, const int, complex *, + complex *, GlobalLU_t *, SuperLUStat_t*); +extern void cpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, complex *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void cpanel_bmod (const int, const int, const int, const int, + complex *, complex *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int ccolumn_bmod (const int, const int, complex *, + complex *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int ccopy_to_ucol (int, int, int *, int *, int *, + complex *, GlobalLU_t *); +extern int cpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void cpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void creadmt (int *, int *, int *, complex **, int **, int **); +extern void cGenXtrue (int, int, complex *, int); +extern void cFillRHS (trans_t, int, complex *, int, SuperMatrix *, + SuperMatrix *); +extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void cgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int cldperm(int, int, int, int [], int [], complex [], + int [], float [], float []); +extern int ilu_csnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_cpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, complex *, float *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_ccolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_ccopy_to_ucol (int, int, int *, int *, int *, + complex *, int, milu_t, double, int, + complex *, int *, GlobalLU_t *, float *); +extern int ilu_cpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + complex, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_cdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + float *, float *, int); + + +/*! \brief Driver related */ + +extern void cgsequ (SuperMatrix *, float *, float *, float *, + float *, float *, int *); +extern void claqgs (SuperMatrix *, float *, float *, float, + float, float, char *); +extern void cgscon (char *, SuperMatrix *, SuperMatrix *, + float, float *, SuperLUStat_t*, int *); +extern float cPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, float *, + float *, SuperMatrix *, SuperMatrix *, + float *, float *, SuperLUStat_t*, int *); + +extern int sp_ctrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, complex *, SuperLUStat_t*, int *); +extern int sp_cgemv (char *, complex, SuperMatrix *, complex *, + int, complex, complex *, int); + +extern int sp_cgemm (char *, char *, int, int, int, complex, + SuperMatrix *, complex *, int, complex, + complex *, int); +extern float slamch_(char *); + + +/*! \brief Memory-related */ +extern int cLUMemInit (fact_t, void *, int, int, int, int, int, + float, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, complex **); +extern void cSetRWork (int, int, complex *, complex **, complex **); +extern void cLUWorkFree (int *, complex *, GlobalLU_t *); +extern int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern complex *complexMalloc(int); +extern complex *complexCalloc(int); +extern float *floatMalloc(int); +extern float *floatCalloc(int); +extern int cmemory_usage(const int, const int, const int, const int); +extern int cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void creadhb(int *, int *, int *, complex **, int **, int **); +extern void creadrb(int *, int *, int *, complex **, int **, int **); +extern void creadtriple(int *, int *, int *, complex **, int **, int **); +extern void cCompRow_to_CompCol(int, int, int, complex*, int*, int*, + complex **, int **, int **); +extern void cfill (complex *, int, complex); +extern void cinf_norm_error (int, SuperMatrix *, complex *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + complex, complex, complex *, complex *, char *); +extern float sqselect(int, float *, int); + + +/*! \brief Routines for debugging */ +extern void cPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void cPrint_Dense_Matrix(char *, SuperMatrix *); +extern void cprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, complex *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_cSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_dcomplex.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_dcomplex.h new file mode 100644 index 0000000..386ad68 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_dcomplex.h @@ -0,0 +1,78 @@ + +/*! @file slu_dcomplex.h + * \brief Header file for complex operations + *
     
    + *  -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Contains definitions for various complex operations.
    + * This header file is to be included in source files z*.c
    + * 
    + */ +#ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */ +#define __SUPERLU_DCOMPLEX + + +#ifndef DCOMPLEX_INCLUDE +#define DCOMPLEX_INCLUDE + +typedef struct { double r, i; } doublecomplex; + + +/* Macro definitions */ + +/*! \brief Complex Addition c = a + b */ +#define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \ + (c)->i = (a)->i + (b)->i; } + +/*! \brief Complex Subtraction c = a - b */ +#define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \ + (c)->i = (a)->i - (b)->i; } + +/*! \brief Complex-Double Multiplication */ +#define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \ + (c)->i = (a)->i * (b); } + +/*! \brief Complex-Complex Multiplication */ +#define zz_mult(c, a, b) { \ + double cr, ci; \ + cr = (a)->r * (b)->r - (a)->i * (b)->i; \ + ci = (a)->i * (b)->r + (a)->r * (b)->i; \ + (c)->r = cr; \ + (c)->i = ci; \ + } + +#define zz_conj(a, b) { \ + (a)->r = (b)->r; \ + (a)->i = -((b)->i); \ + } + +/*! \brief Complex equality testing */ +#define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Prototypes for functions in dcomplex.c */ +void z_div(doublecomplex *, doublecomplex *, doublecomplex *); +double z_abs(doublecomplex *); /* exact */ +double z_abs1(doublecomplex *); /* approximate */ +void z_exp(doublecomplex *, doublecomplex *); +void d_cnjg(doublecomplex *r, doublecomplex *z); +double d_imag(doublecomplex *); +doublecomplex z_sgn(doublecomplex *); +doublecomplex z_sqrt(doublecomplex *); + + + +#ifdef __cplusplus + } +#endif + +#endif + +#endif /* __SUPERLU_DCOMPLEX */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_ddefs.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_ddefs.h new file mode 100644 index 0000000..199fa96 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_ddefs.h @@ -0,0 +1,281 @@ + +/*! @file slu_ddefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_dSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_dSP_DEFS + +/* + * File name: dsp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + double *lusup; /* L supernodes */ + int *xlusup; + double *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +dgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +dgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + double *, double *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +dgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +dgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +dCreate_CompRow_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +dCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +dCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +dCopy_Dense_Matrix(int, int, double *, int, double *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void dallocateA (int, int, double **, int **, int **); +extern void dgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int dsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int dsnode_bmod (const int, const int, const int, double *, + double *, GlobalLU_t *, SuperLUStat_t*); +extern void dpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, double *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void dpanel_bmod (const int, const int, const int, const int, + double *, double *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int dcolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int dcolumn_bmod (const int, const int, double *, + double *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int dcopy_to_ucol (int, int, int *, int *, int *, + double *, GlobalLU_t *); +extern int dpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void dpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void dreadmt (int *, int *, int *, double **, int **, int **); +extern void dGenXtrue (int, int, double *, int); +extern void dFillRHS (trans_t, int, double *, int, SuperMatrix *, + SuperMatrix *); +extern void dgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void dgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int dldperm(int, int, int, int [], int [], double [], + int [], double [], double []); +extern int ilu_dsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_dpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, double *, double *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_dcolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_dcopy_to_ucol (int, int, int *, int *, int *, + double *, int, milu_t, double, int, + double *, int *, GlobalLU_t *, double *); +extern int ilu_dpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + double, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_ddrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + double *, double *, int); + + +/*! \brief Driver related */ + +extern void dgsequ (SuperMatrix *, double *, double *, double *, + double *, double *, int *); +extern void dlaqgs (SuperMatrix *, double *, double *, double, + double, double, char *); +extern void dgscon (char *, SuperMatrix *, SuperMatrix *, + double, double *, SuperLUStat_t*, int *); +extern double dPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void dgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, double *, + double *, SuperMatrix *, SuperMatrix *, + double *, double *, SuperLUStat_t*, int *); + +extern int sp_dtrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, double *, SuperLUStat_t*, int *); +extern int sp_dgemv (char *, double, SuperMatrix *, double *, + int, double, double *, int); + +extern int sp_dgemm (char *, char *, int, int, int, double, + SuperMatrix *, double *, int, double, + double *, int); +extern double dlamch_(char *); + + +/*! \brief Memory-related */ +extern int dLUMemInit (fact_t, void *, int, int, int, int, int, + double, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, double **); +extern void dSetRWork (int, int, double *, double **, double **); +extern void dLUWorkFree (int *, double *, GlobalLU_t *); +extern int dLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern double *doubleMalloc(int); +extern double *doubleCalloc(int); +extern int dmemory_usage(const int, const int, const int, const int); +extern int dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void dreadhb(int *, int *, int *, double **, int **, int **); +extern void dreadrb(int *, int *, int *, double **, int **, int **); +extern void dreadtriple(int *, int *, int *, double **, int **, int **); +extern void dCompRow_to_CompCol(int, int, int, double*, int*, int*, + double **, int **, int **); +extern void dfill (double *, int, double); +extern void dinf_norm_error (int, SuperMatrix *, double *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + double, double, double *, double *, char *); +extern double dqselect(int, double *, int); + + +/*! \brief Routines for debugging */ +extern void dPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void dPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void dPrint_Dense_Matrix(char *, SuperMatrix *); +extern void dprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, double *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_dSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_scomplex.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_scomplex.h new file mode 100644 index 0000000..c17490d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_scomplex.h @@ -0,0 +1,78 @@ + +/*! @file slu_scomplex.h + * \brief Header file for complex operations + *
     
    + *  -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Contains definitions for various complex operations.
    + * This header file is to be included in source files c*.c
    + * 
    + */ +#ifndef __SUPERLU_SCOMPLEX /* allow multiple inclusions */ +#define __SUPERLU_SCOMPLEX + + +#ifndef SCOMPLEX_INCLUDE +#define SCOMPLEX_INCLUDE + +typedef struct { float r, i; } complex; + + +/* Macro definitions */ + +/*! \brief Complex Addition c = a + b */ +#define c_add(c, a, b) { (c)->r = (a)->r + (b)->r; \ + (c)->i = (a)->i + (b)->i; } + +/*! \brief Complex Subtraction c = a - b */ +#define c_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \ + (c)->i = (a)->i - (b)->i; } + +/*! \brief Complex-Double Multiplication */ +#define cs_mult(c, a, b) { (c)->r = (a)->r * (b); \ + (c)->i = (a)->i * (b); } + +/*! \brief Complex-Complex Multiplication */ +#define cc_mult(c, a, b) { \ + float cr, ci; \ + cr = (a)->r * (b)->r - (a)->i * (b)->i; \ + ci = (a)->i * (b)->r + (a)->r * (b)->i; \ + (c)->r = cr; \ + (c)->i = ci; \ + } + +#define cc_conj(a, b) { \ + (a)->r = (b)->r; \ + (a)->i = -((b)->i); \ + } + +/*! \brief Complex equality testing */ +#define c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Prototypes for functions in scomplex.c */ +void c_div(complex *, complex *, complex *); +double c_abs(complex *); /* exact */ +double c_abs1(complex *); /* approximate */ +void c_exp(complex *, complex *); +void r_cnjg(complex *, complex *); +double r_imag(complex *); +complex c_sgn(complex *); +complex c_sqrt(complex *); + + + +#ifdef __cplusplus + } +#endif + +#endif + +#endif /* __SUPERLU_SCOMPLEX */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_sdefs.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_sdefs.h new file mode 100644 index 0000000..745d76f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_sdefs.h @@ -0,0 +1,281 @@ + +/*! @file slu_sdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_sSP_DEFS + +/* + * File name: ssp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + float *lusup; /* L supernodes */ + int *xlusup; + float *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + float *, float *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +sgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +sgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +sCreate_CompRow_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +sCopy_Dense_Matrix(int, int, float *, int, float *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void sallocateA (int, int, float **, int **, int **); +extern void sgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int ssnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int ssnode_bmod (const int, const int, const int, float *, + float *, GlobalLU_t *, SuperLUStat_t*); +extern void spanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, float *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void spanel_bmod (const int, const int, const int, const int, + float *, float *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int scolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int scolumn_bmod (const int, const int, float *, + float *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int scopy_to_ucol (int, int, int *, int *, int *, + float *, GlobalLU_t *); +extern int spivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void spruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void sreadmt (int *, int *, int *, float **, int **, int **); +extern void sGenXtrue (int, int, float *, int); +extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *, + SuperMatrix *); +extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void sgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int sldperm(int, int, int, int [], int [], float [], + int [], float [], float []); +extern int ilu_ssnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, float *, float *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_scolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_scopy_to_ucol (int, int, int *, int *, int *, + float *, int, milu_t, double, int, + float *, int *, GlobalLU_t *, float *); +extern int ilu_spivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + float, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_sdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + float *, float *, int); + + +/*! \brief Driver related */ + +extern void sgsequ (SuperMatrix *, float *, float *, float *, + float *, float *, int *); +extern void slaqgs (SuperMatrix *, float *, float *, float, + float, float, char *); +extern void sgscon (char *, SuperMatrix *, SuperMatrix *, + float, float *, SuperLUStat_t*, int *); +extern float sPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, float *, + float *, SuperMatrix *, SuperMatrix *, + float *, float *, SuperLUStat_t*, int *); + +extern int sp_strsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, float *, SuperLUStat_t*, int *); +extern int sp_sgemv (char *, float, SuperMatrix *, float *, + int, float, float *, int); + +extern int sp_sgemm (char *, char *, int, int, int, float, + SuperMatrix *, float *, int, float, + float *, int); +extern float slamch_(char *); + + +/*! \brief Memory-related */ +extern int sLUMemInit (fact_t, void *, int, int, int, int, int, + float, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, float **); +extern void sSetRWork (int, int, float *, float **, float **); +extern void sLUWorkFree (int *, float *, GlobalLU_t *); +extern int sLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern float *floatMalloc(int); +extern float *floatCalloc(int); +extern int smemory_usage(const int, const int, const int, const int); +extern int sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void sreadhb(int *, int *, int *, float **, int **, int **); +extern void sreadrb(int *, int *, int *, float **, int **, int **); +extern void sreadtriple(int *, int *, int *, float **, int **, int **); +extern void sCompRow_to_CompCol(int, int, int, float*, int*, int*, + float **, int **, int **); +extern void sfill (float *, int, float); +extern void sinf_norm_error (int, SuperMatrix *, float *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + float, float, float *, float *, char *); +extern float sqselect(int, float *, int); + + +/*! \brief Routines for debugging */ +extern void sPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void sPrint_Dense_Matrix(char *, SuperMatrix *); +extern void sprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, float *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_sSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_util.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_util.h new file mode 100644 index 0000000..82ac01c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_util.h @@ -0,0 +1,362 @@ +/** @file slu_util.h + * \brief Utility header file + * + * -- SuperLU routine (version 4.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November, 2010 + * + */ + +#ifndef __SUPERLU_UTIL /* allow multiple inclusions */ +#define __SUPERLU_UTIL + +#include +#include +#include +/* +#ifndef __STDC__ +#include +#endif +*/ +#include +#include "superlu_enum_consts.h" + +/*********************************************************************** + * Macros + ***********************************************************************/ +#define FIRSTCOL_OF_SNODE(i) (xsup[i]) +/* No of marker arrays used in the symbolic factorization, + each of size n */ +#define NO_MARKER 3 +#define NUM_TEMPV(m,w,t,b) ( SUPERLU_MAX(m, (t + b)*w) ) + +#ifndef USER_ABORT +#define USER_ABORT(msg) superlu_abort_and_exit(msg) +#endif + +#define ABORT(err_msg) \ + { char msg[256];\ + sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\ + USER_ABORT(msg); } + + +#ifndef USER_MALLOC +#if 1 +#define USER_MALLOC(size) superlu_malloc(size) +#else +/* The following may check out some uninitialized data */ +#define USER_MALLOC(size) memset (superlu_malloc(size), '\x0F', size) +#endif +#endif + +#define SUPERLU_MALLOC(size) USER_MALLOC(size) + +#ifndef USER_FREE +#define USER_FREE(addr) superlu_free(addr) +#endif + +#define SUPERLU_FREE(addr) USER_FREE(addr) + +#define CHECK_MALLOC(where) { \ + extern int superlu_malloc_total; \ + printf("%s: malloc_total %d Bytes\n", \ + where, superlu_malloc_total); \ +} + +#define SUPERLU_MAX(x, y) ( (x) > (y) ? (x) : (y) ) +#define SUPERLU_MIN(x, y) ( (x) < (y) ? (x) : (y) ) + +/********************************************************* + * Macros used for easy access of sparse matrix entries. * + *********************************************************/ +#define L_SUB_START(col) ( Lstore->rowind_colptr[col] ) +#define L_SUB(ptr) ( Lstore->rowind[ptr] ) +#define L_NZ_START(col) ( Lstore->nzval_colptr[col] ) +#define L_FST_SUPC(superno) ( Lstore->sup_to_col[superno] ) +#define U_NZ_START(col) ( Ustore->colptr[col] ) +#define U_SUB(ptr) ( Ustore->rowind[ptr] ) + + +/*********************************************************************** + * Constants + ***********************************************************************/ +#define EMPTY (-1) +/*#define NO (-1)*/ +#define FALSE 0 +#define TRUE 1 + +#define NO_MEMTYPE 4 /* 0: lusup; + 1: ucol; + 2: lsub; + 3: usub */ + +#define GluIntArray(n) (5 * (n) + 5) + +/* Dropping rules */ +#define NODROP ( 0x0000 ) +#define DROP_BASIC ( 0x0001 ) /* ILU(tau) */ +#define DROP_PROWS ( 0x0002 ) /* ILUTP: keep p maximum rows */ +#define DROP_COLUMN ( 0x0004 ) /* ILUTP: for j-th column, + p = gamma * nnz(A(:,j)) */ +#define DROP_AREA ( 0x0008 ) /* ILUTP: for j-th column, use + nnz(F(:,1:j)) / nnz(A(:,1:j)) + to limit memory growth */ +#define DROP_SECONDARY ( 0x000E ) /* PROWS | COLUMN | AREA */ +#define DROP_DYNAMIC ( 0x0010 ) /* adaptive tau */ +#define DROP_INTERP ( 0x0100 ) /* use interpolation */ + + +#if 1 +#define MILU_ALPHA (1.0e-2) /* multiple of drop_sum to be added to diagonal */ +#else +#define MILU_ALPHA 1.0 /* multiple of drop_sum to be added to diagonal */ +#endif + + +/*********************************************************************** + * Type definitions + ***********************************************************************/ +typedef float flops_t; +typedef unsigned char Logical; + +/* + *-- This contains the options used to control the solution process. + * + * Fact (fact_t) + * Specifies whether or not the factored form of the matrix + * A is supplied on entry, and if not, how the matrix A should + * be factorizaed. + * = DOFACT: The matrix A will be factorized from scratch, and the + * factors will be stored in L and U. + * = SamePattern: The matrix A will be factorized assuming + * that a factorization of a matrix with the same sparsity + * pattern was performed prior to this one. Therefore, this + * factorization will reuse column permutation vector + * ScalePermstruct->perm_c and the column elimination tree + * LUstruct->etree. + * = SamePattern_SameRowPerm: The matrix A will be factorized + * assuming that a factorization of a matrix with the same + * sparsity pattern and similar numerical values was performed + * prior to this one. Therefore, this factorization will reuse + * both row and column scaling factors R and C, both row and + * column permutation vectors perm_r and perm_c, and the + * data structure set up from the previous symbolic factorization. + * = FACTORED: On entry, L, U, perm_r and perm_c contain the + * factored form of A. If DiagScale is not NOEQUIL, the matrix + * A has been equilibrated with scaling factors R and C. + * + * Equil (yes_no_t) + * Specifies whether to equilibrate the system (scale A's row and + * columns to have unit norm). + * + * ColPerm (colperm_t) + * Specifies what type of column permutation to use to reduce fill. + * = NATURAL: use the natural ordering + * = MMD_ATA: use minimum degree ordering on structure of A'*A + * = MMD_AT_PLUS_A: use minimum degree ordering on structure of A'+A + * = COLAMD: use approximate minimum degree column ordering + * = MY_PERMC: use the ordering specified by the user + * + * Trans (trans_t) + * Specifies the form of the system of equations: + * = NOTRANS: A * X = B (No transpose) + * = TRANS: A**T * X = B (Transpose) + * = CONJ: A**H * X = B (Transpose) + * + * IterRefine (IterRefine_t) + * Specifies whether to perform iterative refinement. + * = NO: no iterative refinement + * = SINGLE: perform iterative refinement in single precision + * = DOUBLE: perform iterative refinement in double precision + * = EXTRA: perform iterative refinement in extra precision + * + * DiagPivotThresh (double, in [0.0, 1.0]) (only for sequential SuperLU) + * Specifies the threshold used for a diagonal entry to be an + * acceptable pivot. + * + * SymmetricMode (yest_no_t) + * Specifies whether to use symmetric mode. Symmetric mode gives + * preference to diagonal pivots, and uses an (A'+A)-based column + * permutation algorithm. + * + * PivotGrowth (yes_no_t) + * Specifies whether to compute the reciprocal pivot growth. + * + * ConditionNumber (ues_no_t) + * Specifies whether to compute the reciprocal condition number. + * + * RowPerm (rowperm_t) (only for SuperLU_DIST or ILU) + * Specifies whether to permute rows of the original matrix. + * = NO: not to permute the rows + * = LargeDiag: make the diagonal large relative to the off-diagonal + * = MY_PERMR: use the permutation given by the user + * + * ILU_DropRule (int) + * Specifies the dropping rule: + * = DROP_BASIC: Basic dropping rule, supernodal based ILUTP(tau). + * = DROP_PROWS: Supernodal based ILUTP(p,tau), p = gamma * nnz(A)/n. + * = DROP_COLUMN: Variant of ILUTP(p,tau), for j-th column, + * p = gamma * nnz(A(:,j)). + * = DROP_AREA: Variation of ILUTP, for j-th column, use + * nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory. + * = DROP_DYNAMIC: Modify the threshold tau during factorizaion: + * If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma + * tau_L(j) := MIN(tau_0, tau_L(j-1) * 2); + * Otherwise + * tau_L(j) := MAX(tau_0, tau_L(j-1) / 2); + * tau_U(j) uses the similar rule. + * NOTE: the thresholds used by L and U are separate. + * = DROP_INTERP: Compute the second dropping threshold by + * interpolation instead of sorting (default). + * In this case, the actual fill ratio is not + * guaranteed to be smaller than gamma. + * Note: DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive. + * ( Default: DROP_BASIC | DROP_AREA ) + * + * ILU_DropTol (double) + * numerical threshold for dropping. + * + * ILU_FillFactor (double) + * Gamma in the secondary dropping. + * + * ILU_Norm (norm_t) + * Specify which norm to use to measure the row size in a + * supernode: infinity-norm, 1-norm, or 2-norm. + * + * ILU_FillTol (double) + * numerical threshold for zero pivot perturbation. + * + * ILU_MILU (milu_t) + * Specifies which version of MILU to use. + * + * ILU_MILU_Dim (double) + * Dimension of the PDE if available. + * + * ReplaceTinyPivot (yes_no_t) (only for SuperLU_DIST) + * Specifies whether to replace the tiny diagonals by + * sqrt(epsilon)*||A|| during LU factorization. + * + * SolveInitialized (yes_no_t) (only for SuperLU_DIST) + * Specifies whether the initialization has been performed to the + * triangular solve. + * + * RefineInitialized (yes_no_t) (only for SuperLU_DIST) + * Specifies whether the initialization has been performed to the + * sparse matrix-vector multiplication routine needed in iterative + * refinement. + * + * PrintStat (yes_no_t) + * Specifies whether to print the solver's statistics. + */ +typedef struct { + fact_t Fact; + yes_no_t Equil; + colperm_t ColPerm; + trans_t Trans; + IterRefine_t IterRefine; + double DiagPivotThresh; + yes_no_t SymmetricMode; + yes_no_t PivotGrowth; + yes_no_t ConditionNumber; + rowperm_t RowPerm; + int ILU_DropRule; + double ILU_DropTol; /* threshold for dropping */ + double ILU_FillFactor; /* gamma in the secondary dropping */ + norm_t ILU_Norm; /* infinity-norm, 1-norm, or 2-norm */ + double ILU_FillTol; /* threshold for zero pivot perturbation */ + milu_t ILU_MILU; + double ILU_MILU_Dim; /* Dimension of PDE (if available) */ + yes_no_t ParSymbFact; + yes_no_t ReplaceTinyPivot; /* used in SuperLU_DIST */ + yes_no_t SolveInitialized; + yes_no_t RefineInitialized; + yes_no_t PrintStat; +} superlu_options_t; + +/*! \brief Headers for 4 types of dynamatically managed memory */ +typedef struct e_node { + int size; /* length of the memory that has been used */ + void *mem; /* pointer to the new malloc'd store */ +} ExpHeader; + +typedef struct { + int size; + int used; + int top1; /* grow upward, relative to &array[0] */ + int top2; /* grow downward */ + void *array; +} LU_stack_t; + +typedef struct { + int *panel_histo; /* histogram of panel size distribution */ + double *utime; /* running time at various phases */ + flops_t *ops; /* operation count at various phases */ + int TinyPivots; /* number of tiny pivots */ + int RefineSteps; /* number of iterative refinement steps */ + int expansions; /* number of memory expansions */ +} SuperLUStat_t; + +typedef struct { + float for_lu; + float total_needed; +} mem_usage_t; + + +/*********************************************************************** + * Prototypes + ***********************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +extern void Destroy_SuperMatrix_Store(SuperMatrix *); +extern void Destroy_CompCol_Matrix(SuperMatrix *); +extern void Destroy_CompRow_Matrix(SuperMatrix *); +extern void Destroy_SuperNode_Matrix(SuperMatrix *); +extern void Destroy_CompCol_Permuted(SuperMatrix *); +extern void Destroy_Dense_Matrix(SuperMatrix *); +extern void get_perm_c(int, SuperMatrix *, int *); +extern void set_default_options(superlu_options_t *options); +extern void ilu_set_default_options(superlu_options_t *options); +extern void sp_preorder (superlu_options_t *, SuperMatrix*, int*, int*, + SuperMatrix*); +extern void superlu_abort_and_exit(char*); +extern void *superlu_malloc (size_t); +extern int *intMalloc (int); +extern int *intCalloc (int); +extern void superlu_free (void*); +extern void SetIWork (int, int, int, int *, int **, int **, int **, + int **, int **, int **, int **); +extern int sp_coletree (int *, int *, int *, int, int, int *); +extern void relax_snode (const int, int *, const int, int *, int *); +extern void heap_relax_snode (const int, int *, const int, int *, int *); +extern int mark_relax(int, int *, int *, int *, int *, int *, int *); +extern void ilu_relax_snode (const int, int *, const int, int *, + int *, int *); +extern void ilu_heap_relax_snode (const int, int *, const int, int *, + int *, int*); +extern void resetrep_col (const int, const int *, int *); +extern int spcoletree (int *, int *, int *, int, int, int *); +extern int *TreePostorder (int, int *); +extern double SuperLU_timer_ (); +extern int sp_ienv (int); +extern int lsame_ (char *, char *); +extern int xerbla_ (char *, int *); +extern void ifill (int *, int, int); +extern void snode_profile (int, int *); +extern void super_stats (int, int *); +extern void check_repfnz(int, int, int, int *); +extern void PrintSumm (char *, int, int, int); +extern void StatInit(SuperLUStat_t *); +extern void StatPrint (SuperLUStat_t *); +extern void StatFree(SuperLUStat_t *); +extern void print_panel_seg(int, int, int, int, int *, int *); +extern int print_int_vec(char *,int, int *); +extern int slu_PrintInt10(char *, int, int *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_UTIL */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/slu_zdefs.h b/thirdparty/superlu/SuperLU_4.1/SRC/slu_zdefs.h new file mode 100644 index 0000000..f7ccf87 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/slu_zdefs.h @@ -0,0 +1,284 @@ + +/*! @file slu_zdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_zSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_zSP_DEFS + +/* + * File name: zsp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" +#include "slu_dcomplex.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + doublecomplex *lusup; /* L supernodes */ + int *xlusup; + doublecomplex *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +zgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +zgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + double *, double *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +zgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +zgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +zCreate_CompCol_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +zCreate_CompRow_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +zCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +zCreate_Dense_Matrix(SuperMatrix *, int, int, doublecomplex *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +zCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +zCopy_Dense_Matrix(int, int, doublecomplex *, int, doublecomplex *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void zallocateA (int, int, doublecomplex **, int **, int **); +extern void zgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int zsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int zsnode_bmod (const int, const int, const int, doublecomplex *, + doublecomplex *, GlobalLU_t *, SuperLUStat_t*); +extern void zpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, doublecomplex *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void zpanel_bmod (const int, const int, const int, const int, + doublecomplex *, doublecomplex *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int zcolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int zcolumn_bmod (const int, const int, doublecomplex *, + doublecomplex *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int zcopy_to_ucol (int, int, int *, int *, int *, + doublecomplex *, GlobalLU_t *); +extern int zpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void zpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void zreadmt (int *, int *, int *, doublecomplex **, int **, int **); +extern void zGenXtrue (int, int, doublecomplex *, int); +extern void zFillRHS (trans_t, int, doublecomplex *, int, SuperMatrix *, + SuperMatrix *); +extern void zgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void zgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int zldperm(int, int, int, int [], int [], doublecomplex [], + int [], double [], double []); +extern int ilu_zsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_zpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, doublecomplex *, double *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_zcolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_zcopy_to_ucol (int, int, int *, int *, int *, + doublecomplex *, int, milu_t, double, int, + doublecomplex *, int *, GlobalLU_t *, double *); +extern int ilu_zpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + doublecomplex, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_zdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + double *, double *, int); + + +/*! \brief Driver related */ + +extern void zgsequ (SuperMatrix *, double *, double *, double *, + double *, double *, int *); +extern void zlaqgs (SuperMatrix *, double *, double *, double, + double, double, char *); +extern void zgscon (char *, SuperMatrix *, SuperMatrix *, + double, double *, SuperLUStat_t*, int *); +extern double zPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void zgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, double *, + double *, SuperMatrix *, SuperMatrix *, + double *, double *, SuperLUStat_t*, int *); + +extern int sp_ztrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, doublecomplex *, SuperLUStat_t*, int *); +extern int sp_zgemv (char *, doublecomplex, SuperMatrix *, doublecomplex *, + int, doublecomplex, doublecomplex *, int); + +extern int sp_zgemm (char *, char *, int, int, int, doublecomplex, + SuperMatrix *, doublecomplex *, int, doublecomplex, + doublecomplex *, int); +extern double dlamch_(char *); + + +/*! \brief Memory-related */ +extern int zLUMemInit (fact_t, void *, int, int, int, int, int, + double, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, doublecomplex **); +extern void zSetRWork (int, int, doublecomplex *, doublecomplex **, doublecomplex **); +extern void zLUWorkFree (int *, doublecomplex *, GlobalLU_t *); +extern int zLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern doublecomplex *doublecomplexMalloc(int); +extern doublecomplex *doublecomplexCalloc(int); +extern double *doubleMalloc(int); +extern double *doubleCalloc(int); +extern int zmemory_usage(const int, const int, const int, const int); +extern int zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void zreadhb(int *, int *, int *, doublecomplex **, int **, int **); +extern void zreadrb(int *, int *, int *, doublecomplex **, int **, int **); +extern void zreadtriple(int *, int *, int *, doublecomplex **, int **, int **); +extern void zCompRow_to_CompCol(int, int, int, doublecomplex*, int*, int*, + doublecomplex **, int **, int **); +extern void zfill (doublecomplex *, int, doublecomplex); +extern void zinf_norm_error (int, SuperMatrix *, doublecomplex *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + doublecomplex, doublecomplex, doublecomplex *, doublecomplex *, char *); +extern double dqselect(int, double *, int); + + +/*! \brief Routines for debugging */ +extern void zPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void zPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void zPrint_Dense_Matrix(char *, SuperMatrix *); +extern void zprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, doublecomplex *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_zSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/smemory.c b/thirdparty/superlu/SuperLU_4.1/SRC/smemory.c new file mode 100644 index 0000000..17cedfd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/smemory.c @@ -0,0 +1,701 @@ + +/*! @file smemory.c + * \brief Memory details + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ +#include "slu_sdefs.h" + + +/* Internal prototypes */ +void *sexpand (int *, MemType,int, int, GlobalLU_t *); +int sLUWorkInit (int, int, int, int **, float **, GlobalLU_t *); +void copy_mem_float (int, void *, void *); +void sStackCompress (GlobalLU_t *); +void sSetupSpace (void *, int, GlobalLU_t *); +void *suser_malloc (int, int, GlobalLU_t *); +void suser_free (int, int, GlobalLU_t *); + +/* External prototypes (in memory.c - prec-independent) */ +extern void copy_mem_int (int, void *, void *); +extern void user_bcopy (char *, char *, int); + + +/* Macros to manipulate stack */ +#define StackFull(x) ( x + Glu->stack.used >= Glu->stack.size ) +#define NotDoubleAlign(addr) ( (long int)addr & 7 ) +#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) +#define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \ + (w + 1) * m * sizeof(float) ) +#define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */ + + + + +/*! \brief Setup the memory model to be used for factorization. + * + * lwork = 0: use system malloc; + * lwork > 0: use user-supplied work[] space. + */ +void sSetupSpace(void *work, int lwork, GlobalLU_t *Glu) +{ + if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; /* malloc/free */ + } else if ( lwork > 0 ) { + Glu->MemModel = USER; /* user provided space */ + Glu->stack.used = 0; + Glu->stack.top1 = 0; + Glu->stack.top2 = (lwork/4)*4; /* must be word addressable */ + Glu->stack.size = Glu->stack.top2; + Glu->stack.array = (void *) work; + } +} + + + +void *suser_malloc(int bytes, int which_end, GlobalLU_t *Glu) +{ + void *buf; + + if ( StackFull(bytes) ) return (NULL); + + if ( which_end == HEAD ) { + buf = (char*) Glu->stack.array + Glu->stack.top1; + Glu->stack.top1 += bytes; + } else { + Glu->stack.top2 -= bytes; + buf = (char*) Glu->stack.array + Glu->stack.top2; + } + + Glu->stack.used += bytes; + return buf; +} + + +void suser_free(int bytes, int which_end, GlobalLU_t *Glu) +{ + if ( which_end == HEAD ) { + Glu->stack.top1 -= bytes; + } else { + Glu->stack.top2 += bytes; + } + Glu->stack.used -= bytes; +} + + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int sQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, iword, dword, panel_size = sp_ienv(1); + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(float); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0*n + 3.0) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0 * panel_size + 4.0 + NO_MARKER) * n * iword + + (panel_size + 1.0) * n * dword ); + + return 0; +} /* sQuerySpace */ + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int ilu_sQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, panel_size = sp_ienv(1); + register float iword, dword; + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(double); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0f * n + 3.0f) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0f) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization. + ILU needs 5*n more integers than LU */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0f * panel_size + 9.0f + NO_MARKER) * n * iword + + (panel_size + 1.0f) * n * dword ); + + return 0; +} /* ilu_sQuerySpace */ + + +/*! \brief Allocate storage for the data structures common to all factor routines. + * + *
    + * For those unpredictable size, estimate as fill_ratio * nnz(A).
    + * Return value:
    + *     If lwork = -1, return the estimated amount of space required, plus n;
    + *     otherwise, return the amount of space actually allocated when
    + *     memory allocation failure occurred.
    + * 
    + */ +int +sLUMemInit(fact_t fact, void *work, int lwork, int m, int n, int annz, + int panel_size, float fill_ratio, SuperMatrix *L, SuperMatrix *U, + GlobalLU_t *Glu, int **iwork, float **dwork) +{ + int info, iword, dword; + SCformat *Lstore; + NCformat *Ustore; + int *xsup, *supno; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + float *ucol; + int *usub, *xusub; + int nzlmax, nzumax, nzlumax; + + iword = sizeof(int); + dword = sizeof(float); + Glu->n = n; + Glu->num_expansions = 0; + + if ( !Glu->expanders ) + Glu->expanders = (ExpHeader*)SUPERLU_MALLOC( NO_MEMTYPE * + sizeof(ExpHeader) ); + if ( !Glu->expanders ) ABORT("SUPERLU_MALLOC fails for expanders"); + + if ( fact != SamePattern_SameRowPerm ) { + /* Guess for L\U factors */ + nzumax = nzlumax = fill_ratio * annz; + nzlmax = SUPERLU_MAX(1, fill_ratio/4.) * annz; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else { + sSetupSpace(work, lwork, Glu); + } + +#if ( PRNTlevel >= 1 ) + printf("sLUMemInit() called: fill_ratio %.0f, nzlmax %ld, nzumax %ld\n", + fill_ratio, nzlmax, nzumax); + fflush(stdout); +#endif + + /* Integer pointers for L\U factors */ + if ( Glu->MemModel == SYSTEM ) { + xsup = intMalloc(n+1); + supno = intMalloc(n+1); + xlsub = intMalloc(n+1); + xlusup = intMalloc(n+1); + xusub = intMalloc(n+1); + } else { + xsup = (int *)suser_malloc((n+1) * iword, HEAD, Glu); + supno = (int *)suser_malloc((n+1) * iword, HEAD, Glu); + xlsub = (int *)suser_malloc((n+1) * iword, HEAD, Glu); + xlusup = (int *)suser_malloc((n+1) * iword, HEAD, Glu); + xusub = (int *)suser_malloc((n+1) * iword, HEAD, Glu); + } + + lusup = (float *) sexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (float *) sexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) sexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) sexpand( &nzumax, USUB, 0, 1, Glu ); + + while ( !lusup || !ucol || !lsub || !usub ) { + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE(lusup); + SUPERLU_FREE(ucol); + SUPERLU_FREE(lsub); + SUPERLU_FREE(usub); + } else { + suser_free((nzlumax+nzumax)*dword+(nzlmax+nzumax)*iword, + HEAD, Glu); + } + nzlumax /= 2; + nzumax /= 2; + nzlmax /= 2; + if ( nzlumax < annz ) { + printf("Not enough memory to perform factorization.\n"); + return (smemory_usage(nzlmax, nzumax, nzlumax, n) + n); + } +#if ( PRNTlevel >= 1) + printf("sLUMemInit() reduce size: nzlmax %ld, nzumax %ld\n", + nzlmax, nzumax); + fflush(stdout); +#endif + lusup = (float *) sexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (float *) sexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) sexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) sexpand( &nzumax, USUB, 0, 1, Glu ); + } + + } else { + /* fact == SamePattern_SameRowPerm */ + Lstore = L->Store; + Ustore = U->Store; + xsup = Lstore->sup_to_col; + supno = Lstore->col_to_sup; + xlsub = Lstore->rowind_colptr; + xlusup = Lstore->nzval_colptr; + xusub = Ustore->colptr; + nzlmax = Glu->nzlmax; /* max from previous factorization */ + nzumax = Glu->nzumax; + nzlumax = Glu->nzlumax; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; + } else { + Glu->MemModel = USER; + Glu->stack.top2 = (lwork/4)*4; /* must be word-addressable */ + Glu->stack.size = Glu->stack.top2; + } + + lsub = Glu->expanders[LSUB].mem = Lstore->rowind; + lusup = Glu->expanders[LUSUP].mem = Lstore->nzval; + usub = Glu->expanders[USUB].mem = Ustore->rowind; + ucol = Glu->expanders[UCOL].mem = Ustore->nzval;; + Glu->expanders[LSUB].size = nzlmax; + Glu->expanders[LUSUP].size = nzlumax; + Glu->expanders[USUB].size = nzumax; + Glu->expanders[UCOL].size = nzumax; + } + + Glu->xsup = xsup; + Glu->supno = supno; + Glu->lsub = lsub; + Glu->xlsub = xlsub; + Glu->lusup = lusup; + Glu->xlusup = xlusup; + Glu->ucol = ucol; + Glu->usub = usub; + Glu->xusub = xusub; + Glu->nzlmax = nzlmax; + Glu->nzumax = nzumax; + Glu->nzlumax = nzlumax; + + info = sLUWorkInit(m, n, panel_size, iwork, dwork, Glu); + if ( info ) + return ( info + smemory_usage(nzlmax, nzumax, nzlumax, n) + n); + + ++Glu->num_expansions; + return 0; + +} /* sLUMemInit */ + +/*! \brief Allocate known working storage. Returns 0 if success, otherwise + returns the number of bytes allocated so far when failure occurred. */ +int +sLUWorkInit(int m, int n, int panel_size, int **iworkptr, + float **dworkptr, GlobalLU_t *Glu) +{ + int isize, dsize, extra; + float *old_ptr; + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + + isize = ( (2 * panel_size + 3 + NO_MARKER ) * m + n ) * sizeof(int); + dsize = (m * panel_size + + NUM_TEMPV(m,panel_size,maxsuper,rowblk)) * sizeof(float); + + if ( Glu->MemModel == SYSTEM ) + *iworkptr = (int *) intCalloc(isize/sizeof(int)); + else + *iworkptr = (int *) suser_malloc(isize, TAIL, Glu); + if ( ! *iworkptr ) { + fprintf(stderr, "sLUWorkInit: malloc fails for local iworkptr[]\n"); + return (isize + n); + } + + if ( Glu->MemModel == SYSTEM ) + *dworkptr = (float *) SUPERLU_MALLOC(dsize); + else { + *dworkptr = (float *) suser_malloc(dsize, TAIL, Glu); + if ( NotDoubleAlign(*dworkptr) ) { + old_ptr = *dworkptr; + *dworkptr = (float*) DoubleAlign(*dworkptr); + *dworkptr = (float*) ((double*)*dworkptr - 1); + extra = (char*)old_ptr - (char*)*dworkptr; +#ifdef DEBUG + printf("sLUWorkInit: not aligned, extra %d\n", extra); +#endif + Glu->stack.top2 -= extra; + Glu->stack.used += extra; + } + } + if ( ! *dworkptr ) { + fprintf(stderr, "malloc fails for local dworkptr[]."); + return (isize + dsize + n); + } + + return 0; +} + + +/*! \brief Set up pointers for real working arrays. + */ +void +sSetRWork(int m, int panel_size, float *dworkptr, + float **dense, float **tempv) +{ + float zero = 0.0; + + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + *dense = dworkptr; + *tempv = *dense + panel_size*m; + sfill (*dense, m * panel_size, zero); + sfill (*tempv, NUM_TEMPV(m,panel_size,maxsuper,rowblk), zero); +} + +/*! \brief Free the working storage used by factor routines. + */ +void sLUWorkFree(int *iwork, float *dwork, GlobalLU_t *Glu) +{ + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE (iwork); + SUPERLU_FREE (dwork); + } else { + Glu->stack.used -= (Glu->stack.size - Glu->stack.top2); + Glu->stack.top2 = Glu->stack.size; +/* sStackCompress(Glu); */ + } + + SUPERLU_FREE (Glu->expanders); + Glu->expanders = NULL; +} + +/*! \brief Expand the data structures for L and U during the factorization. + * + *
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +sLUMemXpand(int jcol, + int next, /* number of elements currently in the factors */ + MemType mem_type, /* which type of memory to expand */ + int *maxlen, /* modified - maximum length of a data structure */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + void *new_mem; + +#ifdef DEBUG + printf("sLUMemXpand(): jcol %d, next %d, maxlen %d, MemType %d\n", + jcol, next, *maxlen, mem_type); +#endif + + if (mem_type == USUB) + new_mem = sexpand(maxlen, mem_type, next, 1, Glu); + else + new_mem = sexpand(maxlen, mem_type, next, 0, Glu); + + if ( !new_mem ) { + int nzlmax = Glu->nzlmax; + int nzumax = Glu->nzumax; + int nzlumax = Glu->nzlumax; + fprintf(stderr, "Can't expand MemType %d: jcol %d\n", mem_type, jcol); + return (smemory_usage(nzlmax, nzumax, nzlumax, Glu->n) + Glu->n); + } + + switch ( mem_type ) { + case LUSUP: + Glu->lusup = (float *) new_mem; + Glu->nzlumax = *maxlen; + break; + case UCOL: + Glu->ucol = (float *) new_mem; + Glu->nzumax = *maxlen; + break; + case LSUB: + Glu->lsub = (int *) new_mem; + Glu->nzlmax = *maxlen; + break; + case USUB: + Glu->usub = (int *) new_mem; + Glu->nzumax = *maxlen; + break; + } + + return 0; + +} + + + +void +copy_mem_float(int howmany, void *old, void *new) +{ + register int i; + float *dold = old; + float *dnew = new; + for (i = 0; i < howmany; i++) dnew[i] = dold[i]; +} + +/*! \brief Expand the existing storage to accommodate more fill-ins. + */ +void +*sexpand ( + int *prev_len, /* length used from previous call */ + MemType type, /* which part of the memory to expand */ + int len_to_copy, /* size of the memory to be copied to new store */ + int keep_prev, /* = 1: use prev_len; + = 0: compute new_len to expand */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + float EXPAND = 1.5; + float alpha; + void *new_mem, *old_mem; + int new_len, tries, lword, extra, bytes_to_copy; + ExpHeader *expanders = Glu->expanders; /* Array of 4 types of memory */ + + alpha = EXPAND; + + if ( Glu->num_expansions == 0 || keep_prev ) { + /* First time allocate requested */ + new_len = *prev_len; + } else { + new_len = alpha * *prev_len; + } + + if ( type == LSUB || type == USUB ) lword = sizeof(int); + else lword = sizeof(float); + + if ( Glu->MemModel == SYSTEM ) { + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + if ( Glu->num_expansions != 0 ) { + tries = 0; + if ( keep_prev ) { + if ( !new_mem ) return (NULL); + } else { + while ( !new_mem ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + } + } + if ( type == LSUB || type == USUB ) { + copy_mem_int(len_to_copy, expanders[type].mem, new_mem); + } else { + copy_mem_float(len_to_copy, expanders[type].mem, new_mem); + } + SUPERLU_FREE (expanders[type].mem); + } + expanders[type].mem = (void *) new_mem; + + } else { /* MemModel == USER */ + if ( Glu->num_expansions == 0 ) { + new_mem = suser_malloc(new_len * lword, HEAD, Glu); + if ( NotDoubleAlign(new_mem) && + (type == LUSUP || type == UCOL) ) { + old_mem = new_mem; + new_mem = (void *)DoubleAlign(new_mem); + extra = (char*)new_mem - (char*)old_mem; +#ifdef DEBUG + printf("expand(): not aligned, extra %d\n", extra); +#endif + Glu->stack.top1 += extra; + Glu->stack.used += extra; + } + expanders[type].mem = (void *) new_mem; + } else { + tries = 0; + extra = (new_len - *prev_len) * lword; + if ( keep_prev ) { + if ( StackFull(extra) ) return (NULL); + } else { + while ( StackFull(extra) ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + extra = (new_len - *prev_len) * lword; + } + } + + if ( type != USUB ) { + new_mem = (void*)((char*)expanders[type + 1].mem + extra); + bytes_to_copy = (char*)Glu->stack.array + Glu->stack.top1 + - (char*)expanders[type + 1].mem; + user_bcopy(expanders[type+1].mem, new_mem, bytes_to_copy); + + if ( type < USUB ) { + Glu->usub = expanders[USUB].mem = + (void*)((char*)expanders[USUB].mem + extra); + } + if ( type < LSUB ) { + Glu->lsub = expanders[LSUB].mem = + (void*)((char*)expanders[LSUB].mem + extra); + } + if ( type < UCOL ) { + Glu->ucol = expanders[UCOL].mem = + (void*)((char*)expanders[UCOL].mem + extra); + } + Glu->stack.top1 += extra; + Glu->stack.used += extra; + if ( type == UCOL ) { + Glu->stack.top1 += extra; /* Add same amount for USUB */ + Glu->stack.used += extra; + } + + } /* if ... */ + + } /* else ... */ + } + + expanders[type].size = new_len; + *prev_len = new_len; + if ( Glu->num_expansions ) ++Glu->num_expansions; + + return (void *) expanders[type].mem; + +} /* sexpand */ + + +/*! \brief Compress the work[] array to remove fragmentation. + */ +void +sStackCompress(GlobalLU_t *Glu) +{ + register int iword, dword, ndim; + char *last, *fragment; + int *ifrom, *ito; + float *dfrom, *dto; + int *xlsub, *lsub, *xusub, *usub, *xlusup; + float *ucol, *lusup; + + iword = sizeof(int); + dword = sizeof(float); + ndim = Glu->n; + + xlsub = Glu->xlsub; + lsub = Glu->lsub; + xusub = Glu->xusub; + usub = Glu->usub; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + lusup = Glu->lusup; + + dfrom = ucol; + dto = (float *)((char*)lusup + xlusup[ndim] * dword); + copy_mem_float(xusub[ndim], dfrom, dto); + ucol = dto; + + ifrom = lsub; + ito = (int *) ((char*)ucol + xusub[ndim] * iword); + copy_mem_int(xlsub[ndim], ifrom, ito); + lsub = ito; + + ifrom = usub; + ito = (int *) ((char*)lsub + xlsub[ndim] * iword); + copy_mem_int(xusub[ndim], ifrom, ito); + usub = ito; + + last = (char*)usub + xusub[ndim] * iword; + fragment = (char*) (((char*)Glu->stack.array + Glu->stack.top1) - last); + Glu->stack.used -= (long int) fragment; + Glu->stack.top1 -= (long int) fragment; + + Glu->ucol = ucol; + Glu->lsub = lsub; + Glu->usub = usub; + +#ifdef DEBUG + printf("sStackCompress: fragment %d\n", fragment); + /* for (last = 0; last < ndim; ++last) + print_lu_col("After compress:", last, 0);*/ +#endif + +} + +/*! \brief Allocate storage for original matrix A + */ +void +sallocateA(int n, int nnz, float **a, int **asub, int **xa) +{ + *a = (float *) floatMalloc(nnz); + *asub = (int *) intMalloc(nnz); + *xa = (int *) intMalloc(n+1); +} + + +float *floatMalloc(int n) +{ + float *buf; + buf = (float *) SUPERLU_MALLOC((size_t)n * sizeof(float)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in floatMalloc()\n"); + } + return (buf); +} + +float *floatCalloc(int n) +{ + float *buf; + register int i; + float zero = 0.0; + buf = (float *) SUPERLU_MALLOC((size_t)n * sizeof(float)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in floatCalloc()\n"); + } + for (i = 0; i < n; ++i) buf[i] = zero; + return (buf); +} + + +int smemory_usage(const int nzlmax, const int nzumax, + const int nzlumax, const int n) +{ + register int iword, dword; + + iword = sizeof(int); + dword = sizeof(float); + + return (10 * n * iword + + nzlmax * iword + nzumax * (iword + dword) + nzlumax * dword); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/smyblas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/smyblas2.c new file mode 100644 index 0000000..3fd7e5a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/smyblas2.c @@ -0,0 +1,230 @@ + +/*! @file smyblas2.c + * \brief Level 2 Blas operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Purpose: + * Level 2 BLAS operations: solves and matvec, written in C. + * Note: + * This is only used when the system lacks an efficient BLAS library. + *
    + */ +/* + * File name: smyblas2.c + */ + +/*! \brief Solves a dense UNIT lower triangular system + * + * The unit lower + * triangular matrix is stored in a 2D array M(1:nrow,1:ncol). + * The solution will be returned in the rhs vector. + */ +void slsolve ( int ldm, int ncol, float *M, float *rhs ) +{ + int k; + float x0, x1, x2, x3, x4, x5, x6, x7; + float *M0; + register float *Mki0, *Mki1, *Mki2, *Mki3, *Mki4, *Mki5, *Mki6, *Mki7; + register int firstcol = 0; + + M0 = &M[0]; + + while ( firstcol < ncol - 7 ) { /* Do 8 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + Mki4 = Mki3 + ldm + 1; + Mki5 = Mki4 + ldm + 1; + Mki6 = Mki5 + ldm + 1; + Mki7 = Mki6 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + x2 = rhs[firstcol+2] - x0 * *Mki0++ - x1 * *Mki1++; + x3 = rhs[firstcol+3] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++; + x4 = rhs[firstcol+4] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++; + x5 = rhs[firstcol+5] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++; + x6 = rhs[firstcol+6] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++ - x5 * *Mki5++; + x7 = rhs[firstcol+7] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++ + - x3 * *Mki3++ - x4 * *Mki4++ - x5 * *Mki5++ + - x6 * *Mki6++; + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + rhs[++firstcol] = x4; + rhs[++firstcol] = x5; + rhs[++firstcol] = x6; + rhs[++firstcol] = x7; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++ + - x2 * *Mki2++ - x3 * *Mki3++ + - x4 * *Mki4++ - x5 * *Mki5++ + - x6 * *Mki6++ - x7 * *Mki7++; + + M0 += 8 * ldm + 8; + } + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + x2 = rhs[firstcol+2] - x0 * *Mki0++ - x1 * *Mki1++; + x3 = rhs[firstcol+3] - x0 * *Mki0++ - x1 * *Mki1++ - x2 * *Mki2++; + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++ + - x2 * *Mki2++ - x3 * *Mki3++; + + M0 += 4 * ldm + 4; + } + + if ( firstcol < ncol - 1 ) { /* Do 2 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + + x0 = rhs[firstcol]; + x1 = rhs[firstcol+1] - x0 * *Mki0++; + + rhs[++firstcol] = x1; + ++firstcol; + + for (k = firstcol; k < ncol; k++) + rhs[k] = rhs[k] - x0 * *Mki0++ - x1 * *Mki1++; + + } + +} + +/*! \brief Solves a dense upper triangular system + * + * The upper triangular matrix is + * stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned + * in the rhs vector. + */ +void +susolve ( ldm, ncol, M, rhs ) +int ldm; /* in */ +int ncol; /* in */ +float *M; /* in */ +float *rhs; /* modified */ +{ + float xj; + int jcol, j, irow; + + jcol = ncol - 1; + + for (j = 0; j < ncol; j++) { + + xj = rhs[jcol] / M[jcol + jcol*ldm]; /* M(jcol, jcol) */ + rhs[jcol] = xj; + + for (irow = 0; irow < jcol; irow++) + rhs[irow] -= xj * M[irow + jcol*ldm]; /* M(irow, jcol) */ + + jcol--; + + } +} + + +/*! \brief Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec. + * + * The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. + */ +void smatvec ( ldm, nrow, ncol, M, vec, Mxvec ) + +int ldm; /* in -- leading dimension of M */ +int nrow; /* in */ +int ncol; /* in */ +float *M; /* in */ +float *vec; /* in */ +float *Mxvec; /* in/out */ + +{ + float vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7; + float *M0; + register float *Mki0, *Mki1, *Mki2, *Mki3, *Mki4, *Mki5, *Mki6, *Mki7; + register int firstcol = 0; + int k; + + M0 = &M[0]; + while ( firstcol < ncol - 7 ) { /* Do 8 columns */ + + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + Mki4 = Mki3 + ldm; + Mki5 = Mki4 + ldm; + Mki6 = Mki5 + ldm; + Mki7 = Mki6 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + vi4 = vec[firstcol++]; + vi5 = vec[firstcol++]; + vi6 = vec[firstcol++]; + vi7 = vec[firstcol++]; + + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++ + vi1 * *Mki1++ + + vi2 * *Mki2++ + vi3 * *Mki3++ + + vi4 * *Mki4++ + vi5 * *Mki5++ + + vi6 * *Mki6++ + vi7 * *Mki7++; + + M0 += 8 * ldm; + } + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++ + vi1 * *Mki1++ + + vi2 * *Mki2++ + vi3 * *Mki3++ ; + + M0 += 4 * ldm; + } + + while ( firstcol < ncol ) { /* Do 1 column */ + + Mki0 = M0; + vi0 = vec[firstcol++]; + for (k = 0; k < nrow; k++) + Mxvec[k] += vi0 * *Mki0++; + + M0 += ldm; + } + +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sp_coletree.c b/thirdparty/superlu/SuperLU_4.1/SRC/sp_coletree.c new file mode 100644 index 0000000..5d845b0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sp_coletree.c @@ -0,0 +1,419 @@ +/*! @file sp_coletree.c + * \brief Tree layout and computation routines + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    +*/ + +/* Elimination tree computation and layout routines */ + +#include +#include +#include "slu_ddefs.h" + +/* + * Implementation of disjoint set union routines. + * Elements are integers in 0..n-1, and the + * names of the sets themselves are of type int. + * + * Calls are: + * initialize_disjoint_sets (n) initial call. + * s = make_set (i) returns a set containing only i. + * s = link (t, u) returns s = t union u, destroying t and u. + * s = find (i) return name of set containing i. + * finalize_disjoint_sets final call. + * + * This implementation uses path compression but not weighted union. + * See Tarjan's book for details. + * John Gilbert, CMI, 1987. + * + * Implemented path-halving by XSL 07/05/95. + */ + + +static +int *mxCallocInt(int n) +{ + register int i; + int *buf; + + buf = (int *) SUPERLU_MALLOC( n * sizeof(int) ); + if ( !buf ) { + ABORT("SUPERLU_MALLOC fails for buf in mxCallocInt()"); + } + for (i = 0; i < n; i++) buf[i] = 0; + return (buf); +} + +static +void initialize_disjoint_sets ( + int n, + int **pp + ) +{ + (*pp) = mxCallocInt(n); +} + + +static +int make_set ( + int i, + int *pp + ) +{ + pp[i] = i; + return i; +} + + +static +int link ( + int s, + int t, + int *pp + ) +{ + pp[s] = t; + return t; +} + + +/* PATH HALVING */ +static +int find ( + int i, + int *pp + ) +{ + register int p, gp; + + p = pp[i]; + gp = pp[p]; + while (gp != p) { + pp[i] = gp; + i = gp; + p = pp[i]; + gp = pp[p]; + } + return (p); +} + +#if 0 +/* PATH COMPRESSION */ +static +int find ( + int i + ) +{ + if (pp[i] != i) + pp[i] = find (pp[i]); + return pp[i]; +} +#endif + +static +void finalize_disjoint_sets ( + int *pp + ) +{ + SUPERLU_FREE(pp); +} + + +/* + * Find the elimination tree for A'*A. + * This uses something similar to Liu's algorithm. + * It runs in time O(nz(A)*log n) and does not form A'*A. + * + * Input: + * Sparse matrix A. Numeric values are ignored, so any + * explicit zeros are treated as nonzero. + * Output: + * Integer array of parents representing the elimination + * tree of the symbolic product A'*A. Each vertex is a + * column of A, and nc means a root of the elimination forest. + * + * John R. Gilbert, Xerox, 10 Dec 1990 + * Based on code by JRG dated 1987, 1988, and 1990. + */ + +/* + * Nonsymmetric elimination tree + */ +int +sp_coletree( + int *acolst, int *acolend, /* column start and end past 1 */ + int *arow, /* row indices of A */ + int nr, int nc, /* dimension of A */ + int *parent /* parent in elim tree */ + ) +{ + int *root; /* root of subtee of etree */ + int *firstcol; /* first nonzero col in each row*/ + int rset, cset; + int row, col; + int rroot; + int p; + int *pp; + + root = mxCallocInt (nc); + initialize_disjoint_sets (nc, &pp); + + /* Compute firstcol[row] = first nonzero column in row */ + + firstcol = mxCallocInt (nr); + for (row = 0; row < nr; firstcol[row++] = nc); + for (col = 0; col < nc; col++) + for (p = acolst[col]; p < acolend[col]; p++) { + row = arow[p]; + firstcol[row] = SUPERLU_MIN(firstcol[row], col); + } + + /* Compute etree by Liu's algorithm for symmetric matrices, + except use (firstcol[r],c) in place of an edge (r,c) of A. + Thus each row clique in A'*A is replaced by a star + centered at its first vertex, which has the same fill. */ + + for (col = 0; col < nc; col++) { + cset = make_set (col, pp); + root[cset] = col; + parent[col] = nc; /* Matlab */ + for (p = acolst[col]; p < acolend[col]; p++) { + row = firstcol[arow[p]]; + if (row >= col) continue; + rset = find (row, pp); + rroot = root[rset]; + if (rroot != col) { + parent[rroot] = col; + cset = link (cset, rset, pp); + root[cset] = col; + } + } + } + + SUPERLU_FREE (root); + SUPERLU_FREE (firstcol); + finalize_disjoint_sets (pp); + return 0; +} + +/* + * q = TreePostorder (n, p); + * + * Postorder a tree. + * Input: + * p is a vector of parent pointers for a forest whose + * vertices are the integers 0 to n-1; p[root]==n. + * Output: + * q is a vector indexed by 0..n-1 such that q[i] is the + * i-th vertex in a postorder numbering of the tree. + * + * ( 2/7/95 modified by X.Li: + * q is a vector indexed by 0:n-1 such that vertex i is the + * q[i]-th vertex in a postorder numbering of the tree. + * That is, this is the inverse of the previous q. ) + * + * In the child structure, lower-numbered children are represented + * first, so that a tree which is already numbered in postorder + * will not have its order changed. + * + * Written by John Gilbert, Xerox, 10 Dec 1990. + * Based on code written by John Gilbert at CMI in 1987. + */ + +static +/* + * Depth-first search from vertex v. + */ +void etdfs ( + int v, + int first_kid[], + int next_kid[], + int post[], + int *postnum + ) +{ + int w; + + for (w = first_kid[v]; w != -1; w = next_kid[w]) { + etdfs (w, first_kid, next_kid, post, postnum); + } + /* post[postnum++] = v; in Matlab */ + post[v] = (*postnum)++; /* Modified by X. Li on 08/10/07 */ +} + + +static +/* + * Depth-first search from vertex n. No recursion. + * This routine was contributed by Cédric Doucet, CEDRAT Group, Meylan, France. + */ +void nr_etdfs (int n, int *parent, + int *first_kid, int *next_kid, + int *post, int postnum) +{ + int current = n, first, next; + + while (postnum != n){ + + /* no kid for the current node */ + first = first_kid[current]; + + /* no first kid for the current node */ + if (first == -1){ + + /* numbering this node because it has no kid */ + post[current] = postnum++; + + /* looking for the next kid */ + next = next_kid[current]; + + while (next == -1){ + + /* no more kids : back to the parent node */ + current = parent[current]; + + /* numbering the parent node */ + post[current] = postnum++; + + /* get the next kid */ + next = next_kid[current]; + } + + /* stopping criterion */ + if (postnum==n+1) return; + + /* updating current node */ + current = next; + } + /* updating current node */ + else { + current = first; + } + } +} + +/* + * Post order a tree + */ +int *TreePostorder( + int n, + int *parent + ) +{ + int *first_kid, *next_kid; /* Linked list of children. */ + int *post, postnum; + int v, dad; + + /* Allocate storage for working arrays and results */ + first_kid = mxCallocInt (n+1); + next_kid = mxCallocInt (n+1); + post = mxCallocInt (n+1); + + /* Set up structure describing children */ + for (v = 0; v <= n; first_kid[v++] = -1); + for (v = n-1; v >= 0; v--) { + dad = parent[v]; + next_kid[v] = first_kid[dad]; + first_kid[dad] = v; + } + + /* Depth-first search from dummy root vertex #n */ + postnum = 0; +#if 0 + /* recursion */ + etdfs (n, first_kid, next_kid, post, &postnum); +#else + /* no recursion */ + nr_etdfs(n, parent, first_kid, next_kid, post, postnum); +#endif + + SUPERLU_FREE (first_kid); + SUPERLU_FREE (next_kid); + return post; +} + + +/* + * p = spsymetree (A); + * + * Find the elimination tree for symmetric matrix A. + * This uses Liu's algorithm, and runs in time O(nz*log n). + * + * Input: + * Square sparse matrix A. No check is made for symmetry; + * elements below and on the diagonal are ignored. + * Numeric values are ignored, so any explicit zeros are + * treated as nonzero. + * Output: + * Integer array of parents representing the etree, with n + * meaning a root of the elimination forest. + * Note: + * This routine uses only the upper triangle, while sparse + * Cholesky (as in spchol.c) uses only the lower. Matlab's + * dense Cholesky uses only the upper. This routine could + * be modified to use the lower triangle either by transposing + * the matrix or by traversing it by rows with auxiliary + * pointer and link arrays. + * + * John R. Gilbert, Xerox, 10 Dec 1990 + * Based on code by JRG dated 1987, 1988, and 1990. + * Modified by X.S. Li, November 1999. + */ + +/* + * Symmetric elimination tree + */ +int +sp_symetree( + int *acolst, int *acolend, /* column starts and ends past 1 */ + int *arow, /* row indices of A */ + int n, /* dimension of A */ + int *parent /* parent in elim tree */ + ) +{ + int *root; /* root of subtree of etree */ + int rset, cset; + int row, col; + int rroot; + int p; + int *pp; + + root = mxCallocInt (n); + initialize_disjoint_sets (n, &pp); + + for (col = 0; col < n; col++) { + cset = make_set (col, pp); + root[cset] = col; + parent[col] = n; /* Matlab */ + for (p = acolst[col]; p < acolend[col]; p++) { + row = arow[p]; + if (row >= col) continue; + rset = find (row, pp); + rroot = root[rset]; + if (rroot != col) { + parent[rroot] = col; + cset = link (cset, rset, pp); + root[cset] = col; + } + } + } + SUPERLU_FREE (root); + finalize_disjoint_sets (pp); + return 0; +} /* SP_SYMETREE */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sp_ienv.c b/thirdparty/superlu/SuperLU_4.1/SRC/sp_ienv.c new file mode 100644 index 0000000..7b4810c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sp_ienv.c @@ -0,0 +1,80 @@ +/*! @file sp_ienv.c + * \brief Chooses machine-dependent parameters for the local + * environment. + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    +*/ + +/* + * File name: sp_ienv.c + * History: Modified from lapack routine ILAENV + */ +#include "slu_Cnames.h" + +/*! \brief + +
    +    Purpose   
    +    =======   
    +
    +    sp_ienv() is inquired to choose machine-dependent parameters for the
    +    local environment. See ISPEC for a description of the parameters.   
    +
    +    This version provides a set of parameters which should give good,   
    +    but not optimal, performance on many of the currently available   
    +    computers.  Users are encouraged to modify this subroutine to set   
    +    the tuning parameters for their particular machine using the option   
    +    and problem size information in the arguments.   
    +
    +    Arguments   
    +    =========   
    +
    +    ISPEC   (input) int
    +            Specifies the parameter to be returned as the value of SP_IENV.   
    +            = 1: the panel size w; a panel consists of w consecutive
    +	         columns of matrix A in the process of Gaussian elimination.
    +		 The best value depends on machine's cache characters.
    +            = 2: the relaxation parameter relax; if the number of
    +	         nodes (columns) in a subtree of the elimination tree is less
    +		 than relax, this subtree is considered as one supernode,
    +		 regardless of their row structures.
    +            = 3: the maximum size for a supernode in complete LU;
    +	    = 4: the minimum row dimension for 2-D blocking to be used;
    +	    = 5: the minimum column dimension for 2-D blocking to be used;
    +	    = 6: the estimated fills factor for L and U, compared with A;
    +	    = 7: the maximum size for a supernode in ILU.
    +	    
    +   (SP_IENV) (output) int
    +            >= 0: the value of the parameter specified by ISPEC   
    +            < 0:  if SP_IENV = -k, the k-th argument had an illegal value. 
    +  
    +    ===================================================================== 
    +
    +*/ +int +sp_ienv(int ispec) +{ + int i; + + switch (ispec) { + case 1: return (12); + case 2: return (6); + case 3: return (100); + case 4: return (200); + case 5: return (60); + case 6: return (20); + case 7: return (10); + } + + /* Invalid value for ISPEC */ + i = 1; + xerbla_("sp_ienv", &i); + return 0; + +} /* sp_ienv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sp_preorder.c b/thirdparty/superlu/SuperLU_4.1/SRC/sp_preorder.c new file mode 100644 index 0000000..abee619 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sp_preorder.c @@ -0,0 +1,208 @@ +/*! @file sp_preorder.c + * \brief Permute and performs functions on columns of orginal matrix + */ +#include "slu_ddefs.h" + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * sp_preorder() permutes the columns of the original matrix. It performs
    + * the following steps:
    + *
    + *    1. Apply column permutation perm_c[] to A's column pointers to form AC;
    + *
    + *    2. If options->Fact = DOFACT, then
    + *       (1) Compute column elimination tree etree[] of AC'AC;
    + *       (2) Post order etree[] to get a postordered elimination tree etree[],
    + *           and a postorder permutation post[];
    + *       (3) Apply post[] permutation to columns of AC;
    + *       (4) Overwrite perm_c[] with the product perm_c * post.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         Specifies whether or not the elimination tree will be re-used.
    + *         If options->Fact == DOFACT, this means first time factor A, 
    + *         etree is computed, postered, and output.
    + *         Otherwise, re-factor A, etree is input, unchanged on exit.
    + *
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = NC or SLU_NCP; Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + * perm_c  (input/output) int*
    + *	   Column permutation vector of size A->ncol, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + *         If options->Fact == DOFACT, perm_c is both input and output.
    + *         On output, it is changed according to a postorder of etree.
    + *         Otherwise, perm_c is input.
    + *
    + * etree   (input/output) int*
    + *         Elimination tree of Pc'*A'*A*Pc, dimension A->ncol.
    + *         If options->Fact == DOFACT, etree is an output argument,
    + *         otherwise it is an input argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * AC      (output) SuperMatrix*
    + *         The resulting matrix after applied the column permutation
    + *         perm_c[] to matrix A. The type of AC can be:
    + *         Stype = SLU_NCP; Dtype = A->Dtype; Mtype = SLU_GE.
    + * 
    + */ +void +sp_preorder(superlu_options_t *options, SuperMatrix *A, int *perm_c, + int *etree, SuperMatrix *AC) +{ + NCformat *Astore; + NCPformat *ACstore; + int *iwork, *post; + register int n, i; + + n = A->ncol; + + /* Apply column permutation perm_c to A's column pointers so to + obtain NCP format in AC = A*Pc. */ + AC->Stype = SLU_NCP; + AC->Dtype = A->Dtype; + AC->Mtype = A->Mtype; + AC->nrow = A->nrow; + AC->ncol = A->ncol; + Astore = A->Store; + ACstore = AC->Store = (void *) SUPERLU_MALLOC( sizeof(NCPformat) ); + if ( !ACstore ) ABORT("SUPERLU_MALLOC fails for ACstore"); + ACstore->nnz = Astore->nnz; + ACstore->nzval = Astore->nzval; + ACstore->rowind = Astore->rowind; + ACstore->colbeg = (int*) SUPERLU_MALLOC(n*sizeof(int)); + if ( !(ACstore->colbeg) ) ABORT("SUPERLU_MALLOC fails for ACstore->colbeg"); + ACstore->colend = (int*) SUPERLU_MALLOC(n*sizeof(int)); + if ( !(ACstore->colend) ) ABORT("SUPERLU_MALLOC fails for ACstore->colend"); + +#ifdef DEBUG + print_int_vec("pre_order:", n, perm_c); + check_perm("Initial perm_c", n, perm_c); +#endif + + for (i = 0; i < n; i++) { + ACstore->colbeg[perm_c[i]] = Astore->colptr[i]; + ACstore->colend[perm_c[i]] = Astore->colptr[i+1]; + } + + if ( options->Fact == DOFACT ) { +#undef ETREE_ATplusA +#ifdef ETREE_ATplusA + /*-------------------------------------------- + COMPUTE THE ETREE OF Pc*(A'+A)*Pc'. + --------------------------------------------*/ + int *b_colptr, *b_rowind, bnz, j; + int *c_colbeg, *c_colend; + + /*printf("Use etree(A'+A)\n");*/ + + /* Form B = A + A'. */ + at_plus_a(n, Astore->nnz, Astore->colptr, Astore->rowind, + &bnz, &b_colptr, &b_rowind); + + /* Form C = Pc*B*Pc'. */ + c_colbeg = (int*) SUPERLU_MALLOC(2*n*sizeof(int)); + c_colend = c_colbeg + n; + if (!c_colbeg ) ABORT("SUPERLU_MALLOC fails for c_colbeg/c_colend"); + for (i = 0; i < n; i++) { + c_colbeg[perm_c[i]] = b_colptr[i]; + c_colend[perm_c[i]] = b_colptr[i+1]; + } + for (j = 0; j < n; ++j) { + for (i = c_colbeg[j]; i < c_colend[j]; ++i) { + b_rowind[i] = perm_c[b_rowind[i]]; + } + } + + /* Compute etree of C. */ + sp_symetree(c_colbeg, c_colend, b_rowind, n, etree); + + SUPERLU_FREE(b_colptr); + if ( bnz ) SUPERLU_FREE(b_rowind); + SUPERLU_FREE(c_colbeg); + +#else + /*-------------------------------------------- + COMPUTE THE COLUMN ELIMINATION TREE. + --------------------------------------------*/ + sp_coletree(ACstore->colbeg, ACstore->colend, ACstore->rowind, + A->nrow, A->ncol, etree); +#endif +#ifdef DEBUG + print_int_vec("etree:", n, etree); +#endif + + /* In symmetric mode, do not do postorder here. */ + if ( options->SymmetricMode == NO ) { + /* Post order etree */ + post = (int *) TreePostorder(n, etree); + /* for (i = 0; i < n+1; ++i) inv_post[post[i]] = i; + iwork = post; */ + +#ifdef DEBUG + print_int_vec("post:", n+1, post); + check_perm("post", n, post); +#endif + iwork = (int*) SUPERLU_MALLOC((n+1)*sizeof(int)); + if ( !iwork ) ABORT("SUPERLU_MALLOC fails for iwork[]"); + + /* Renumber etree in postorder */ + for (i = 0; i < n; ++i) iwork[post[i]] = post[etree[i]]; + for (i = 0; i < n; ++i) etree[i] = iwork[i]; + +#ifdef DEBUG + print_int_vec("postorder etree:", n, etree); +#endif + + /* Postmultiply A*Pc by post[] */ + for (i = 0; i < n; ++i) iwork[post[i]] = ACstore->colbeg[i]; + for (i = 0; i < n; ++i) ACstore->colbeg[i] = iwork[i]; + for (i = 0; i < n; ++i) iwork[post[i]] = ACstore->colend[i]; + for (i = 0; i < n; ++i) ACstore->colend[i] = iwork[i]; + + for (i = 0; i < n; ++i) + iwork[i] = post[perm_c[i]]; /* product of perm_c and post */ + for (i = 0; i < n; ++i) perm_c[i] = iwork[i]; + +#ifdef DEBUG + print_int_vec("Pc*post:", n, perm_c); + check_perm("final perm_c", n, perm_c); +#endif + SUPERLU_FREE (post); + SUPERLU_FREE (iwork); + } /* end postordering */ + + } /* if options->Fact == DOFACT ... */ + +} + +int check_perm(char *what, int n, int *perm) +{ + register int i; + int *marker; + marker = (int *) calloc(n, sizeof(int)); + + for (i = 0; i < n; ++i) { + if ( marker[perm[i]] == 1 || perm[i] >= n ) { + printf("%s: Not a valid PERM[%d] = %d\n", what, i, perm[i]); + ABORT("check_perm"); + } else { + marker[perm[i]] = 1; + } + } + + SUPERLU_FREE(marker); + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/spanel_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/spanel_bmod.c new file mode 100644 index 0000000..846cf0f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/spanel_bmod.c @@ -0,0 +1,459 @@ + +/*! @file spanel_bmod.c + * \brief Performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ +/* + +*/ + +#include +#include +#include "slu_sdefs.h" + +/* + * Function prototypes + */ +void slsolve(int, int, float *, float *); +void smatvec(int, int, int, float *, float *, float *); +extern void scheck_tempv(); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *    Performs numeric block updates (sup-panel) in topological order.
    + *    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + *    Special processing on the supernodal portion of L\U[*,j]
    + *
    + *    Before entering this routine, the original nonzeros in the panel 
    + *    were already copied into the spa[m,w].
    + *
    + *    Updated/Output parameters-
    + *    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    + *    collectively in the m-by-w vector dense[*]. 
    + * 
    + */ + +void +spanel_bmod ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + const int nseg, /* in */ + float *dense, /* out, of size n by w */ + float *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in, of size n by w */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + float alpha, beta; +#endif + + register int k, ksub; + int fsupc, nsupc, nsupr, nrow; + int krep, krep_ind; + float ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int segsze; + int block_nrow; /* no of rows in a block row */ + register int lptr; /* Points to the row subscripts of a supernode */ + int kfnz, irow, no_zeros; + register int isub, isub1, i; + register int jj; /* Index through each column in the panel */ + int *xsup, *supno; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + int *repfnz_col; /* repfnz[] for a column in the panel */ + float *dense_col; /* dense[] for a column in the panel */ + float *tempv1; /* Used in 1-D update */ + float *TriTmp, *MatvecTmp; /* used in 2-D update */ + float zero = 0.0; + float one = 1.0; + register int ldaTmp; + register int r_ind, r_hi; + static int first = 1, maxsuper, rowblk, colblk; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + if ( first ) { + maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ); + rowblk = sp_ienv(4); + colblk = sp_ienv(5); + first = 0; + } + ldaTmp = maxsuper + rowblk; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { /* for each updating supernode */ + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in a supernode + * nsupr = no of rows in a supernode + */ + krep = segrep[k--]; + fsupc = xsup[supno[krep]]; + nsupc = krep - fsupc + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nrow = nsupr - nsupc; + lptr = xlsub[fsupc]; + krep_ind = lptr + nsupc - 1; + + repfnz_col = repfnz; + dense_col = dense; + + if ( nsupc >= colblk && nrow > rowblk ) { /* 2-D block update */ + + TriTmp = tempv; + + /* Sequence through each column in panel -- triangular solves */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp ) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + dense_col[irow] -= ukj * lusup[luptr]; + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + ukj -= ukj1 * lusup[luptr1]; + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; + dense_col[irow] -= (ukj*lusup[luptr] + + ukj1*lusup[luptr1]); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; luptr2++; + dense_col[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + } else { /* segsze >= 4 */ + + /* Copy U[*,j] segment from dense[*] to TriTmp[*], which + holds the result of triangular solves. */ + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + TriTmp[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#else + strsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#endif +#else + slsolve ( nsupr, segsze, &lusup[luptr], TriTmp ); +#endif + + + } /* else ... */ + + } /* for jj ... end tri-solves */ + + /* Block row updates; push all the way into dense[*] block */ + for ( r_ind = 0; r_ind < nrow; r_ind += rowblk ) { + + r_hi = SUPERLU_MIN(nrow, r_ind + rowblk); + block_nrow = SUPERLU_MIN(rowblk, r_hi - r_ind); + luptr = xlusup[fsupc] + nsupc + r_ind; + isub1 = lptr + nsupc + r_ind; + + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + /* Sequence through each column in panel -- matrix-vector */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + /* Perform a block update, and scatter the result of + matrix-vector to dense[]. */ + no_zeros = kfnz - fsupc; + luptr1 = luptr + nsupr * no_zeros; + MatvecTmp = &TriTmp[maxsuper]; + +#ifdef USE_VENDOR_BLAS + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV(ftcs2, &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#else + sgemv_("N", &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#endif +#else + smatvec(nsupr, block_nrow, segsze, &lusup[luptr1], + TriTmp, MatvecTmp); +#endif + + /* Scatter MatvecTmp[*] into SPA dense[*] temporarily + * such that MatvecTmp[*] can be re-used for the + * the next blok row update. dense[] will be copied into + * global store after the whole panel has been finished. + */ + isub = isub1; + for (i = 0; i < block_nrow; i++) { + irow = lsub[isub]; + dense_col[irow] -= MatvecTmp[i]; + MatvecTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } /* for each block row ... */ + + /* Scatter the triangular solves into SPA dense[*] */ + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = TriTmp[i]; + TriTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } else { /* 1-D block modification */ + + + /* Sequence through each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += segsze * (segsze - 1); + ops[GEMV] += 2 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + dense_col[irow] -= ukj * lusup[luptr]; + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + ukj -= ukj1 * lusup[luptr1]; + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; + dense_col[irow] -= (ukj*lusup[luptr] + + ukj1*lusup[luptr1]); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + ukj1 -= ukj2 * lusup[luptr2-1]; + ukj = ukj - ukj1*lusup[luptr1] - ukj2*lusup[luptr2]; + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; ++luptr2; + dense_col[irow] -= ( ukj*lusup[luptr] + + ukj1*lusup[luptr1] + ukj2*lusup[luptr2] ); + } + } + + } else { /* segsze >= 4 */ + /* + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense[]. + */ + no_zeros = kfnz - fsupc; + + /* Copy U[*,j] segment from dense[*] to tempv[*]: + * The result of triangular solve is in tempv[*]; + * The result of matrix vector update is in dense_col[*] + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + tempv[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + strsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + SGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + sgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + slsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + smatvec (nsupr, nrow, segsze, &lusup[luptr], tempv, tempv1); +#endif + + /* Scatter tempv[*] into SPA dense[*] temporarily, such + * that tempv[*] can be used for the triangular solve of + * the next column of the panel. They will be copied into + * ucol[*] after the whole panel has been finished. + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = tempv[i]; + tempv[i] = zero; + isub++; + } + + /* Scatter the update from tempv1[*] into SPA dense[*] */ + /* Start dense rectangular L */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + dense_col[irow] -= tempv1[i]; + tempv1[i] = zero; + ++isub; + } + + } /* else segsze>=4 ... */ + + } /* for each column in the panel... */ + + } /* else 1-D update ... */ + + } /* for each updating supernode ... */ + +} + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/spanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/spanel_dfs.c new file mode 100644 index 0000000..3f5bb46 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/spanel_dfs.c @@ -0,0 +1,254 @@ + +/*! @file spanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel. 
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a 
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ + +void +spanel_dfs ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + float *dense, /* out */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *xprune, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + NCPformat *Astore; + float *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + float *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/spivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/spivotL.c new file mode 100644 index 0000000..2a6950c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/spivotL.c @@ -0,0 +1,184 @@ + +/*! @file spivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include +#include "slu_sdefs.h" + +#undef DEBUG + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *           pivot row = k;
    + *       ELSE IF abs(A_jj) >= thresh THEN
    + *           pivot row = j;
    + *       ELSE
    + *           pivot row = m;
    + * 
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0      success;
    + *                 i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +spivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int *iperm_r, /* in - inverse of perm_r */ + int *iperm_c, /* in - used to find diagonal of Pc*A*Pc' */ + int *pivrow, /* out */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + int pivptr, old_pivptr, diag, diagind; + float pivmax, rtemp, thresh; + float temp; + float *lu_sup_ptr; + float *lu_col_ptr; + int *lsub_ptr; + int isub, icol, k, itemp; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + /* Initialize pointers */ + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + +#ifdef DEBUG +if ( jcol == MIN_COL ) { + printf("Before cdiv: col %d\n", jcol); + for (k = nsupc; k < nsupr; k++) + printf(" lu[%d] %f\n", lsub_ptr[k], lu_col_ptr[k]); +} +#endif + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + if ( *usepr ) *pivrow = iperm_r[jcol]; + diagind = iperm_c[jcol]; + pivmax = 0.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + for (isub = nsupc; isub < nsupr; ++isub) { + rtemp = fabs (lu_col_ptr[isub]); + if ( rtemp > pivmax ) { + pivmax = rtemp; + pivptr = isub; + } + if ( *usepr && lsub_ptr[isub] == *pivrow ) old_pivptr = isub; + if ( lsub_ptr[isub] == diagind ) diag = isub; + } + + /* Test for singularity */ + if ( pivmax == 0.0 ) { +#if 1 + *pivrow = lsub_ptr[pivptr]; + perm_r[*pivrow] = jcol; +#else + perm_r[diagind] = jcol; +#endif + *usepr = 0; + return (jcol+1); + } + + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + rtemp = fabs (lu_col_ptr[old_pivptr]); + if ( rtemp != 0.0 && rtemp >= thresh ) + pivptr = old_pivptr; + else + *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + rtemp = fabs (lu_col_ptr[diag]); + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += nsupr - nsupc; + + temp = 1.0 / lu_col_ptr[nsupc]; + for (k = nsupc+1; k < nsupr; k++) + lu_col_ptr[k] *= temp; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/spivotgrowth.c b/thirdparty/superlu/SuperLU_4.1/SRC/spivotgrowth.c new file mode 100644 index 0000000..a6e65ec --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/spivotgrowth.c @@ -0,0 +1,113 @@ + +/*! @file spivotgrowth.c + * \brief Computes the reciprocal pivot growth factor + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Compute the reciprocal pivot growth factor of the leading ncols columns
    + * of the matrix, using the formula:
    + *     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )
    + *
    + * Arguments
    + * =========
    + *
    + * ncols    (input) int
    + *          The number of columns of matrices A, L and U.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = NC; Dtype = SLU_S; Mtype = GE.
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SC; Dtype = SLU_S; Mtype = TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = NC;
    + *          Dtype = SLU_S; Mtype = TRU.
    + * 
    + */ + +float +sPivotGrowth(int ncols, SuperMatrix *A, int *perm_c, + SuperMatrix *L, SuperMatrix *U) +{ + + NCformat *Astore; + SCformat *Lstore; + NCformat *Ustore; + float *Aval, *Lval, *Uval; + int fsupc, nsupr, luptr, nz_in_U; + int i, j, k, oldcol; + int *inv_perm_c; + float rpg, maxaj, maxuj; + float smlnum; + float *luval; + + /* Get machine constants. */ + smlnum = slamch_("S"); + rpg = 1. / smlnum; + + Astore = A->Store; + Lstore = L->Store; + Ustore = U->Store; + Aval = Astore->nzval; + Lval = Lstore->nzval; + Uval = Ustore->nzval; + + inv_perm_c = (int *) SUPERLU_MALLOC(A->ncol*sizeof(int)); + for (j = 0; j < A->ncol; ++j) inv_perm_c[perm_c[j]] = j; + + for (k = 0; k <= Lstore->nsuper; ++k) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + luptr = L_NZ_START(fsupc); + luval = &Lval[luptr]; + nz_in_U = 1; + + for (j = fsupc; j < L_FST_SUPC(k+1) && j < ncols; ++j) { + maxaj = 0.; + oldcol = inv_perm_c[j]; + for (i = Astore->colptr[oldcol]; i < Astore->colptr[oldcol+1]; ++i) + maxaj = SUPERLU_MAX( maxaj, fabs(Aval[i]) ); + + maxuj = 0.; + for (i = Ustore->colptr[j]; i < Ustore->colptr[j+1]; i++) + maxuj = SUPERLU_MAX( maxuj, fabs(Uval[i]) ); + + /* Supernode */ + for (i = 0; i < nz_in_U; ++i) + maxuj = SUPERLU_MAX( maxuj, fabs(luval[i]) ); + + ++nz_in_U; + luval += nsupr; + + if ( maxuj == 0. ) + rpg = SUPERLU_MIN( rpg, 1.); + else + rpg = SUPERLU_MIN( rpg, maxaj / maxuj ); + } + + if ( j >= ncols ) break; + } + + SUPERLU_FREE(inv_perm_c); + return (rpg); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/spruneL.c b/thirdparty/superlu/SuperLU_4.1/SRC/spruneL.c new file mode 100644 index 0000000..3301bfa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/spruneL.c @@ -0,0 +1,154 @@ + +/*! @file spruneL.c + * \brief Prunes the L-structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + *
    + */ + + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Prunes the L-structure of supernodes whose L-structure
    + *   contains the current pivot row "pivrow"
    + * 
    + */ + +void +spruneL( + const int jcol, /* in */ + const int *perm_r, /* in */ + const int pivrow, /* in */ + const int nseg, /* in */ + const int *segrep, /* in */ + const int *repfnz, /* in */ + int *xprune, /* out */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + + float utemp; + int jsupno, irep, irep1, kmin, kmax, krow, movnum; + int i, ktemp, minloc, maxloc; + int do_prune; /* logical variable */ + int *xsup, *supno; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + /* + * For each supernode-rep irep in U[*,j] + */ + jsupno = supno[jcol]; + for (i = 0; i < nseg; i++) { + + irep = segrep[i]; + irep1 = irep + 1; + do_prune = FALSE; + + /* Don't prune with a zero U-segment */ + if ( repfnz[irep] == EMPTY ) + continue; + + /* If a snode overlaps with the next panel, then the U-segment + * is fragmented into two parts -- irep and irep1. We should let + * pruning occur at the rep-column in irep1's snode. + */ + if ( supno[irep] == supno[irep1] ) /* Don't prune */ + continue; + + /* + * If it has not been pruned & it has a nonz in row L[pivrow,i] + */ + if ( supno[irep] != jsupno ) { + if ( xprune[irep] >= xlsub[irep1] ) { + kmin = xlsub[irep]; + kmax = xlsub[irep1] - 1; + for (krow = kmin; krow <= kmax; krow++) + if ( lsub[krow] == pivrow ) { + do_prune = TRUE; + break; + } + } + + if ( do_prune ) { + + /* Do a quicksort-type partition + * movnum=TRUE means that the num values have to be exchanged. + */ + movnum = FALSE; + if ( irep == xsup[supno[irep]] ) /* Snode of size 1 */ + movnum = TRUE; + + while ( kmin <= kmax ) { + + if ( perm_r[lsub[kmax]] == EMPTY ) + kmax--; + else if ( perm_r[lsub[kmin]] != EMPTY ) + kmin++; + else { /* kmin below pivrow (not yet pivoted), and kmax + * above pivrow: interchange the two subscripts + */ + ktemp = lsub[kmin]; + lsub[kmin] = lsub[kmax]; + lsub[kmax] = ktemp; + + /* If the supernode has only one column, then we + * only keep one set of subscripts. For any subscript + * interchange performed, similar interchange must be + * done on the numerical values. + */ + if ( movnum ) { + minloc = xlusup[irep] + (kmin - xlsub[irep]); + maxloc = xlusup[irep] + (kmax - xlsub[irep]); + utemp = lusup[minloc]; + lusup[minloc] = lusup[maxloc]; + lusup[maxloc] = utemp; + } + + kmin++; + kmax--; + + } + + } /* while */ + + xprune[irep] = kmin; /* Pruning */ + +#ifdef CHK_PRUNE + printf(" After spruneL(),using col %d: xprune[%d] = %d\n", + jcol, irep, kmin); +#endif + } /* if do_prune */ + + } /* if */ + + } /* for each U-segment... */ +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sreadhb.c b/thirdparty/superlu/SuperLU_4.1/SRC/sreadhb.c new file mode 100644 index 0000000..77f6f19 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sreadhb.c @@ -0,0 +1,257 @@ + +/*! @file sreadhb.c + * \brief Read a matrix stored in Harwell-Boeing format + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Purpose
    + * =======
    + * 
    + * Read a FLOAT PRECISION matrix stored in Harwell-Boeing format 
    + * as described below.
    + * 
    + * Line 1 (A72,A8) 
    + *  	Col. 1 - 72   Title (TITLE) 
    + *	Col. 73 - 80  Key (KEY) 
    + * 
    + * Line 2 (5I14) 
    + * 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + * 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + * 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + * 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    + *	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    + *                    (including starting guesses and solution vectors 
    + *		       if present) 
    + *           	      (zero indicates no right-hand side data is present) 
    + *
    + * Line 3 (A3, 11X, 4I14) 
    + *   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + * 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + * 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    + *	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    + *	              (equal to number of entries for assembled matrices) 
    + * 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    + *	              (zero in the case of assembled matrices) 
    + * Line 4 (2A16, 2A20) 
    + * 	Col. 1 - 16   Format for pointers (PTRFMT) 
    + *	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    + *	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + * 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT) 
    + *
    + * Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    + *    	Col. 1 	      Right-hand side type: 
    + *	         	  F for full storage or M for same format as matrix 
    + *    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    + *    	Col. 3        X if an exact solution vector(s) is supplied. 
    + *	Col. 15 - 28  Number of right-hand sides (NRHS) 
    + *	Col. 29 - 42  Number of row indices (NRHSIX) 
    + *          	      (ignored in case of unassembled matrices) 
    + *
    + * The three character type field on line 3 describes the matrix type. 
    + * The following table lists the permitted values for each of the three 
    + * characters. As an example of the type field, RSA denotes that the matrix 
    + * is real, symmetric, and assembled. 
    + *
    + * First Character: 
    + *	R Real matrix 
    + *	C Complex matrix 
    + *	P Pattern only (no numerical values supplied) 
    + *
    + * Second Character: 
    + *	S Symmetric 
    + *	U Unsymmetric 
    + *	H Hermitian 
    + *	Z Skew symmetric 
    + *	R Rectangular 
    + *
    + * Third Character: 
    + *	A Assembled 
    + *	E Elemental matrices (unassembled) 
    + *
    + * 
    + */ +#include +#include +#include "slu_sdefs.h" + + +/*! \brief Eat up the rest of the current line */ +int sDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +int sParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +int sParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + *
    + * + * Purpose + * ======= + * + * Read a FLOAT PRECISION matrix stored in Rutherford-Boeing format + * as described below. + * + * Line 1 (A72, A8) + * Col. 1 - 72 Title (TITLE) + * Col. 73 - 80 Matrix name / identifier (MTRXID) + * + * Line 2 (I14, 3(1X, I13)) + * Col. 1 - 14 Total number of lines excluding header (TOTCRD) + * Col. 16 - 28 Number of lines for pointers (PTRCRD) + * Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) + * Col. 44 - 56 Number of lines for numerical values (VALCRD) + * + * Line 3 (A3, 11X, 4(1X, I13)) + * Col. 1 - 3 Matrix type (see below) (MXTYPE) + * Col. 15 - 28 Compressed Column: Number of rows (NROW) + * Elemental: Largest integer used to index variable (MVAR) + * Col. 30 - 42 Compressed Column: Number of columns (NCOL) + * Elemental: Number of element matrices (NELT) + * Col. 44 - 56 Compressed Column: Number of entries (NNZERO) + * Elemental: Number of variable indeces (NVARIX) + * Col. 58 - 70 Compressed Column: Unused, explicitly zero + * Elemental: Number of elemental matrix entries (NELTVL) + * + * Line 4 (2A16, A20) + * Col. 1 - 16 Fortran format for pointers (PTRFMT) + * Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) + * Col. 33 - 52 Fortran format for numerical values of coefficient matrix + * (VALFMT) + * (blank in the case of matrix patterns) + * + * The three character type field on line 3 describes the matrix type. + * The following table lists the permitted values for each of the three + * characters. As an example of the type field, RSA denotes that the matrix + * is real, symmetric, and assembled. + * + * First Character: + * R Real matrix + * C Complex matrix + * I integer matrix + * P Pattern only (no numerical values supplied) + * Q Pattern only (numerical values supplied in associated auxiliary value + * file) + * + * Second Character: + * S Symmetric + * U Unsymmetric + * H Hermitian + * Z Skew symmetric + * R Rectangular + * + * Third Character: + * A Compressed column form + * E Elemental form + * + * + */ + +#include "slu_sdefs.h" + + +/*! \brief Eat up the rest of the current line */ +static int sDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +static int sParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +static int sParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + */ + +#include "slu_sdefs.h" + + +void +sreadtriple(int *m, int *n, int *nonz, + float **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int j, k, jsize, nnz, nz; + float *a, *val; + int *asub, *xa, *row, *col; + int zero_base = 0; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d", n, nonz); + *m = *n; + printf("m %d, n %d, nonz %d\n", *m, *n, *nonz); + sallocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (float *) SUPERLU_MALLOC(*nonz * sizeof(float)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + for (j = 0; j < *n; ++j) xa[j] = 0; + + /* Read into the triplet array from a file */ + for (nnz = 0, nz = 0; nnz < *nonz; ++nnz) { + scanf("%d%d%f\n", &row[nz], &col[nz], &val[nz]); + + if ( nnz == 0 ) { /* first nonzero */ + if ( row[0] == 0 || col[0] == 0 ) { + zero_base = 1; + printf("triplet file: row/col indices are zero-based.\n"); + } else + printf("triplet file: row/col indices are one-based.\n"); + } + + if ( !zero_base ) { + /* Change to 0-based indexing. */ + --row[nz]; + --col[nz]; + } + + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n + /*|| val[nz] == 0.*/) { + fprintf(stderr, "nz %d, (%d, %d) = %e out of bound, removed\n", + nz, row[nz], col[nz], val[nz]); + exit(-1); + } else { + ++xa[col[nz]]; + ++nz; + } + } + + *nonz = nz; + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + { + int i; + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } + } +#endif + +} + + +void sreadrhs(int m, float *b) +{ + FILE *fp, *fopen(); + int i; + /*int j;*/ + + if ( !(fp = fopen("b.dat", "r")) ) { + fprintf(stderr, "dreadrhs: file does not exist\n"); + exit(-1); + } + for (i = 0; i < m; ++i) + fscanf(fp, "%f\n", &b[i]); + + /* readpair_(j, &b[i]);*/ + fclose(fp); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_bmod.c new file mode 100644 index 0000000..c6813dd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_bmod.c @@ -0,0 +1,118 @@ + +/*! @file ssnode_bmod.c + * \brief Performs numeric block updates within the relaxed snode. + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_sdefs.h" + + +/*! \brief Performs numeric block updates within the relaxed snode. + */ +int +ssnode_bmod ( + const int jcol, /* in */ + const int jsupno, /* in */ + const int fsupc, /* in */ + float *dense, /* in */ + float *tempv, /* working array */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + float alpha = -1.0, beta = 1.0; +#endif + + int luptr, nsupc, nsupr, nrow; + int isub, irow, i, iptr; + register int ufirst, nextlu; + int *lsub, *xlsub; + float *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + nextlu = xlusup[jcol]; + + /* + * Process the supernodal portion of L\U[*,j] + */ + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = 0; + ++nextlu; + } + + xlusup[jcol + 1] = nextlu; /* Initialize xlusup for next column */ + + if ( fsupc < jcol ) { + + luptr = xlusup[fsupc]; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nsupc = jcol - fsupc; /* Excluding jcol */ + ufirst = xlusup[jcol]; /* Points to the beginning of column + jcol in supernode L\U(jsupno). */ + nrow = nsupr - nsupc; + + ops[TRSV] += nsupc * (nsupc - 1); + ops[GEMV] += 2 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + SGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + strsv_( "L", "N", "U", &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + sgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + slsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + smatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], &tempv[0] ); + + /* Scatter tempv[*] into lusup[*] */ + iptr = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + lusup[iptr++] -= tempv[i]; + tempv[i] = 0.0; + } +#endif + + } + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_dfs.c new file mode 100644 index 0000000..a191bc4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ssnode_dfs.c @@ -0,0 +1,112 @@ + +/*! @file ssnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    ssnode_dfs() - Determine the union of the row structures of those 
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +ssnode_dfs ( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *xprune, /* out */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, ifrom, ito, nextl, new_next; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) { + if ( mem_error = sLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1, then make a copy of the subscripts for pruning */ + if ( jcol < kcol ) { + new_next = nextl + (nextl - xlsub[jcol]); + while ( new_next > nzlmax ) { + if ( mem_error = sLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + ito = nextl; + for (ifrom = xlsub[jcol]; ifrom < nextl; ) + lsub[ito++] = lsub[ifrom++]; + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + nextl = ito; + } + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xprune[kcol] = nextl; + xlsub[kcol+1] = nextl; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas2.c new file mode 100644 index 0000000..7824be6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas2.c @@ -0,0 +1,477 @@ + +/*! @file ssp_blas2.c + * \brief Sparse BLAS 2, using some dense BLAS 2 operations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +/* + * File name: ssp_blas2.c + * Purpose: Sparse BLAS 2, using some dense BLAS 2 operations. + */ + +#include "slu_sdefs.h" + +/* + * Function prototypes + */ +void susolve(int, int, float*, float*); +void slsolve(int, int, float*, float*); +void smatvec(int, int, int, float*, float*, float*); + +/*! \brief Solves one of the systems of equations A*x = b, or A'*x = b + * + *
    + *   Purpose
    + *   =======
    + *
    + *   sp_strsv() solves one of the systems of equations   
    + *       A*x = b,   or   A'*x = b,
    + *   where b and x are n element vectors and A is a sparse unit , or   
    + *   non-unit, upper or lower triangular matrix.   
    + *   No test for singularity or near-singularity is included in this   
    + *   routine. Such tests must be performed before calling this routine.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   uplo   - (input) char*
    + *            On entry, uplo specifies whether the matrix is an upper or   
    + *             lower triangular matrix as follows:   
    + *                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    + *                uplo = 'L' or 'l'   A is a lower triangular matrix.   
    + *
    + *   trans  - (input) char*
    + *             On entry, trans specifies the equations to be solved as   
    + *             follows:   
    + *                trans = 'N' or 'n'   A*x = b.   
    + *                trans = 'T' or 't'   A'*x = b.
    + *                trans = 'C' or 'c'   A'*x = b.   
    + *
    + *   diag   - (input) char*
    + *             On entry, diag specifies whether or not A is unit   
    + *             triangular as follows:   
    + *                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    + *                diag = 'N' or 'n'   A is not assumed to be unit   
    + *                                    triangular.   
    + *	     
    + *   L       - (input) SuperMatrix*
    + *	       The factor L from the factorization Pr*A*Pc=L*U. Use
    + *             compressed row subscripts storage for supernodes,
    + *             i.e., L has types: Stype = SC, Dtype = SLU_S, Mtype = TRLU.
    + *
    + *   U       - (input) SuperMatrix*
    + *	        The factor U from the factorization Pr*A*Pc=L*U.
    + *	        U has types: Stype = NC, Dtype = SLU_S, Mtype = TRU.
    + *    
    + *   x       - (input/output) float*
    + *             Before entry, the incremented array X must contain the n   
    + *             element right-hand side vector b. On exit, X is overwritten 
    + *             with the solution vector x.
    + *
    + *   info    - (output) int*
    + *             If *info = -i, the i-th argument had an illegal value.
    + * 
    + */ +int +sp_strsv(char *uplo, char *trans, char *diag, SuperMatrix *L, + SuperMatrix *U, float *x, SuperLUStat_t *stat, int *info) +{ +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + SCformat *Lstore; + NCformat *Ustore; + float *Lval, *Uval; + int incx = 1, incy = 1; + float alpha = 1.0, beta = 1.0; + int nrow; + int fsupc, nsupr, nsupc, luptr, istart, irow; + int i, k, iptr, jcol; + float *work; + flops_t solve_ops; + + /* Test the input parameters */ + *info = 0; + if ( !lsame_(uplo,"L") && !lsame_(uplo, "U") ) *info = -1; + else if ( !lsame_(trans, "N") && !lsame_(trans, "T") && + !lsame_(trans, "C")) *info = -2; + else if ( !lsame_(diag, "U") && !lsame_(diag, "N") ) *info = -3; + else if ( L->nrow != L->ncol || L->nrow < 0 ) *info = -4; + else if ( U->nrow != U->ncol || U->nrow < 0 ) *info = -5; + if ( *info ) { + i = -(*info); + xerbla_("sp_strsv", &i); + return 0; + } + + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( !(work = floatCalloc(L->nrow)) ) + ABORT("Malloc fails for work in sp_strsv()."); + + if ( lsame_(trans, "N") ) { /* Form x := inv(A)*x. */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L)*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + nrow = nsupr - nsupc; + + solve_ops += nsupc * (nsupc - 1); + solve_ops += 2 * nrow * nsupc; + + if ( nsupc == 1 ) { + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); ++iptr) { + irow = L_SUB(iptr); + ++luptr; + x[irow] -= x[fsupc] * Lval[luptr]; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + SGEMV(ftcs2, &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#else + strsv_("L", "N", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + sgemv_("N", &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#endif +#else + slsolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc]); + + smatvec ( nsupr, nsupr-nsupc, nsupc, &Lval[luptr+nsupc], + &x[fsupc], &work[0] ); +#endif + + iptr = istart + nsupc; + for (i = 0; i < nrow; ++i, ++iptr) { + irow = L_SUB(iptr); + x[irow] -= work[i]; /* Scatter */ + work[i] = 0.0; + + } + } + } /* for k ... */ + + } else { + /* Form x := inv(U)*x */ + + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += nsupc * (nsupc + 1); + + if ( nsupc == 1 ) { + x[fsupc] /= Lval[luptr]; + for (i = U_NZ_START(fsupc); i < U_NZ_START(fsupc+1); ++i) { + irow = U_SUB(i); + x[irow] -= x[fsupc] * Uval[i]; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + STRSV(ftcs3, ftcs2, ftcs2, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + strsv_("U", "N", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif +#else + susolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc] ); +#endif + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); + i++) { + irow = U_SUB(i); + x[irow] -= x[jcol] * Uval[i]; + } + } + } + } /* for k ... */ + + } + } else { /* Form x := inv(A')*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L')*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 2 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + x[jcol] -= x[irow] * Lval[i]; + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + STRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + strsv_("L", "T", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := inv(U')*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 2*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + x[jcol] -= x[irow] * Uval[i]; + } + } + + solve_ops += nsupc * (nsupc + 1); + + if ( nsupc == 1 ) { + x[fsupc] /= Lval[luptr]; + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + STRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + strsv_("U", "T", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } + + stat->ops[SOLVE] += solve_ops; + SUPERLU_FREE(work); + return 0; +} + + + +/*! \brief Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   sp_sgemv()  performs one of the matrix-vector operations   
    + *      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    + *   where alpha and beta are scalars, x and y are vectors and A is a
    + *   sparse A->nrow by A->ncol matrix.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   TRANS  - (input) char*
    + *            On entry, TRANS specifies the operation to be performed as   
    + *            follows:   
    + *               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    + *               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    + *               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.   
    + *
    + *   ALPHA  - (input) float
    + *            On entry, ALPHA specifies the scalar alpha.   
    + *
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + *
    + *   X      - (input) float*, array of DIMENSION at least   
    + *            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    + *            Before entry, the incremented array X must contain the   
    + *            vector x.   
    + *
    + *   INCX   - (input) int
    + *            On entry, INCX specifies the increment for the elements of   
    + *            X. INCX must not be zero.   
    + *
    + *   BETA   - (input) float
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then Y need not be set on input.   
    + *
    + *   Y      - (output) float*,  array of DIMENSION at least   
    + *            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    + *            Before entry with BETA non-zero, the incremented array Y   
    + *            must contain the vector y. On exit, Y is overwritten by the 
    + *            updated vector y.
    + *	     
    + *   INCY   - (input) int
    + *            On entry, INCY specifies the increment for the elements of   
    + *            Y. INCY must not be zero.   
    + *
    + *   ==== Sparse Level 2 Blas routine.   
    + * 
    + */ + +int +sp_sgemv(char *trans, float alpha, SuperMatrix *A, float *x, + int incx, float beta, float *y, int incy) +{ + /* Local variables */ + NCformat *Astore; + float *Aval; + int info; + float temp; + int lenx, leny, i, j, irow; + int iy, jx, jy, kx, ky; + int notran; + + notran = lsame_(trans, "N"); + Astore = A->Store; + Aval = Astore->nzval; + + /* Test the input parameters */ + info = 0; + if ( !notran && !lsame_(trans, "T") && !lsame_(trans, "C")) info = 1; + else if ( A->nrow < 0 || A->ncol < 0 ) info = 3; + else if (incx == 0) info = 5; + else if (incy == 0) info = 8; + if (info != 0) { + xerbla_("sp_sgemv ", &info); + return 0; + } + + /* Quick return if possible. */ + if (A->nrow == 0 || A->ncol == 0 || (alpha == 0. && beta == 1.)) + return 0; + + /* Set LENX and LENY, the lengths of the vectors x and y, and set + up the start points in X and Y. */ + if (lsame_(trans, "N")) { + lenx = A->ncol; + leny = A->nrow; + } else { + lenx = A->nrow; + leny = A->ncol; + } + if (incx > 0) kx = 0; + else kx = - (lenx - 1) * incx; + if (incy > 0) ky = 0; + else ky = - (leny - 1) * incy; + + /* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + /* First form y := beta*y. */ + if (beta != 1.) { + if (incy == 1) { + if (beta == 0.) + for (i = 0; i < leny; ++i) y[i] = 0.; + else + for (i = 0; i < leny; ++i) y[i] = beta * y[i]; + } else { + iy = ky; + if (beta == 0.) + for (i = 0; i < leny; ++i) { + y[iy] = 0.; + iy += incy; + } + else + for (i = 0; i < leny; ++i) { + y[iy] = beta * y[iy]; + iy += incy; + } + } + } + + if (alpha == 0.) return 0; + + if ( notran ) { + /* Form y := alpha*A*x + y. */ + jx = kx; + if (incy == 1) { + for (j = 0; j < A->ncol; ++j) { + if (x[jx] != 0.) { + temp = alpha * x[jx]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + y[irow] += temp * Aval[i]; + } + } + jx += incx; + } + } else { + ABORT("Not implemented."); + } + } else { + /* Form y := alpha*A'*x + y. */ + jy = ky; + if (incx == 1) { + for (j = 0; j < A->ncol; ++j) { + temp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + temp += Aval[i] * x[irow]; + } + y[jy] += alpha * temp; + jy += incy; + } + } else { + ABORT("Not implemented."); + } + } + return 0; +} /* sp_sgemv */ + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas3.c b/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas3.c new file mode 100644 index 0000000..be3148b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/ssp_blas3.c @@ -0,0 +1,127 @@ + +/*! @file ssp_blas3.c + * \brief Sparse BLAS3, using some dense BLAS3 operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +/* + * File name: sp_blas3.c + * Purpose: Sparse BLAS3, using some dense BLAS3 operations. + */ + +#include "slu_sdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + * 
    + *   sp_s performs one of the matrix-matrix operations   
    + * 
    + *      C := alpha*op( A )*op( B ) + beta*C,   
    + * 
    + *   where  op( X ) is one of 
    + * 
    + *      op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),
    + * 
    + *   alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    + *   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix. 
    + *   
    + * 
    + *   Parameters   
    + *   ==========   
    + * 
    + *   TRANSA - (input) char*
    + *            On entry, TRANSA specifies the form of op( A ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSA = 'N' or 'n',  op( A ) = A.   
    + *               TRANSA = 'T' or 't',  op( A ) = A'.   
    + *               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    + *            Unchanged on exit.   
    + * 
    + *   TRANSB - (input) char*
    + *            On entry, TRANSB specifies the form of op( B ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSB = 'N' or 'n',  op( B ) = B.   
    + *               TRANSB = 'T' or 't',  op( B ) = B'.   
    + *               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    + *            Unchanged on exit.   
    + * 
    + *   M      - (input) int   
    + *            On entry,  M  specifies  the number of rows of the matrix 
    + *	     op( A ) and of the matrix C.  M must be at least zero. 
    + *	     Unchanged on exit.   
    + * 
    + *   N      - (input) int
    + *            On entry,  N specifies the number of columns of the matrix 
    + *	     op( B ) and the number of columns of the matrix C. N must be 
    + *	     at least zero.
    + *	     Unchanged on exit.   
    + * 
    + *   K      - (input) int
    + *            On entry, K specifies the number of columns of the matrix 
    + *	     op( A ) and the number of rows of the matrix op( B ). K must 
    + *	     be at least  zero.   
    + *           Unchanged on exit.
    + *      
    + *   ALPHA  - (input) float
    + *            On entry, ALPHA specifies the scalar alpha.   
    + * 
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_S; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + * 
    + *   B      - FLOAT PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    + *            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    + *            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    + *            part of the array B must contain the matrix B, otherwise 
    + *            the leading n by k part of the array B must contain the 
    + *            matrix B.   
    + *            Unchanged on exit.   
    + * 
    + *   LDB    - (input) int
    + *            On entry, LDB specifies the first dimension of B as declared 
    + *            in the calling (sub) program. LDB must be at least max( 1, n ).  
    + *            Unchanged on exit.   
    + * 
    + *   BETA   - (input) float
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then C need not be set on input.   
    + *  
    + *   C      - FLOAT PRECISION array of DIMENSION ( LDC, n ).   
    + *            Before entry, the leading m by n part of the array C must 
    + *            contain the matrix C,  except when beta is zero, in which 
    + *            case C need not be set on entry.   
    + *            On exit, the array C is overwritten by the m by n matrix 
    + *	     ( alpha*op( A )*B + beta*C ).   
    + *  
    + *   LDC    - (input) int
    + *            On entry, LDC specifies the first dimension of C as declared 
    + *            in the calling (sub)program. LDC must be at least max(1,m).   
    + *            Unchanged on exit.   
    + *  
    + *   ==== Sparse Level 3 Blas routine.   
    + * 
    + */ + +int +sp_sgemm(char *transa, char *transb, int m, int n, int k, + float alpha, SuperMatrix *A, float *b, int ldb, + float beta, float *c, int ldc) +{ + int incx = 1, incy = 1; + int j; + + for (j = 0; j < n; ++j) { + sp_sgemv(transa, alpha, A, &b[ldb*j], incx, beta, &c[ldc*j], incy); + } + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/superlu_enum_consts.h b/thirdparty/superlu/SuperLU_4.1/SRC/superlu_enum_consts.h new file mode 100644 index 0000000..63f43f1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/superlu_enum_consts.h @@ -0,0 +1,72 @@ +/** @file superlu_enum_consts.h + * \brief enum constants header file + * + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Lab, Univ. of California Berkeley, + * October 1, 2010 + * + */ + +#ifndef __SUPERLU_ENUM_CONSTS /* allow multiple inclusions */ +#define __SUPERLU_ENUM_CONSTS + +/*********************************************************************** + * Enumerate types + ***********************************************************************/ +typedef enum {NO, YES} yes_no_t; +typedef enum {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED} fact_t; +typedef enum {NOROWPERM, LargeDiag, MY_PERMR} rowperm_t; +typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD, + METIS_AT_PLUS_A, PARMETIS, ZOLTAN, MY_PERMC} colperm_t; +typedef enum {NOTRANS, TRANS, CONJ} trans_t; +typedef enum {NOEQUIL, ROW, COL, BOTH} DiagScale_t; +typedef enum {NOREFINE, SINGLE=1, DOUBLE, EXTRA} IterRefine_t; +typedef enum {LUSUP, UCOL, LSUB, USUB, LLVL, ULVL} MemType; +typedef enum {HEAD, TAIL} stack_end_t; +typedef enum {SYSTEM, USER} LU_space_t; +typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t; +typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t; +#if 0 +typedef enum {NODROP = 0x0000, + DROP_BASIC = 0x0001, /* ILU(tau) */ + DROP_PROWS = 0x0002, /* ILUTP: keep p maximum rows */ + DROP_COLUMN = 0x0004, /* ILUTP: for j-th column, + p = gamma * nnz(A(:,j)) */ + DROP_AREA = 0x0008, /* ILUTP: for j-th column, use + nnz(F(:,1:j)) / nnz(A(:,1:j)) + to limit memory growth */ + DROP_SECONDARY = 0x000E, /* PROWS | COLUMN | AREA */ + DROP_DYNAMIC = 0x0010, + DROP_INTERP = 0x0100} rule_t; +#endif + + +/* + * The following enumerate type is used by the statistics variable + * to keep track of flop count and time spent at various stages. + * + * Note that not all of the fields are disjoint. + */ +typedef enum { + COLPERM, /* find a column ordering that minimizes fills */ + ROWPERM, /* find a row ordering maximizes diagonal. */ + RELAX, /* find artificial supernodes */ + ETREE, /* compute column etree */ + EQUIL, /* equilibrate the original matrix */ + SYMBFAC, /* symbolic factorization. */ + DIST, /* distribute matrix. */ + FACT, /* perform LU factorization */ + COMM, /* communication for factorization */ + SOL_COMM,/* communication for solve */ + RCOND, /* estimate reciprocal condition number */ + SOLVE, /* forward and back solves */ + REFINE, /* perform iterative refinement */ + FLOAT, /* time spent in floating-point operations */ + TRSV, /* fraction of FACT spent in xTRSV */ + GEMV, /* fraction of FACT spent in xGEMV */ + FERR, /* estimate error bounds after iterative refinement */ + NPHASES /* total number of phases */ +} PhaseType; + + +#endif /* __SUPERLU_ENUM_CONSTS */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/superlu_timer.c b/thirdparty/superlu/SuperLU_4.1/SRC/superlu_timer.c new file mode 100644 index 0000000..5820bdb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/superlu_timer.c @@ -0,0 +1,70 @@ +/*! @file superlu_timer.c + * \brief Returns the time used + * + *
    + * Purpose
    + * ======= 
    + * 
    + * Returns the time in seconds used by the process.
    + *
    + * Note: the timer function call is machine dependent. Use conditional
    + *       compilation to choose the appropriate function.
    + * 
    + */ + + +#ifdef SUN +/* + * It uses the system call gethrtime(3C), which is accurate to + * nanoseconds. +*/ +#include + +double SuperLU_timer_() { + return ( (double)gethrtime() / 1e9 ); +} + +#elif _WIN32 + +#include + +double SuperLU_timer_() +{ + clock_t t; + t=clock(); + + return ((double)t)/CLOCKS_PER_SEC; +} + +#else + +#ifndef NO_TIMER +#include +#include +#include +#include +#endif + +#ifndef CLK_TCK +#define CLK_TCK 60 +#endif +/*! \brief Timer function + */ +double SuperLU_timer_() +{ +#ifdef NO_TIMER + /* no sys/times.h on WIN32 */ + double tmp; + tmp = 0.0; +#else + struct tms use; + double tmp; + times(&use); + tmp = use.tms_utime; + tmp += use.tms_stime; +#endif + return (double)(tmp) / CLK_TCK; +} + +#endif + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/supermatrix.h b/thirdparty/superlu/SuperLU_4.1/SRC/supermatrix.h new file mode 100644 index 0000000..8b8e388 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/supermatrix.h @@ -0,0 +1,180 @@ +/*! @file supermatrix.h + * \brief Defines matrix types + */ +#ifndef __SUPERLU_SUPERMATRIX /* allow multiple inclusions */ +#define __SUPERLU_SUPERMATRIX + + +/******************************************** + * The matrix types are defined as follows. * + ********************************************/ +typedef enum { + SLU_NC, /* column-wise, no supernode */ + SLU_NCP, /* column-wise, column-permuted, no supernode + (The consecutive columns of nonzeros, after permutation, + may not be stored contiguously.) */ + SLU_NR, /* row-wize, no supernode */ + SLU_SC, /* column-wise, supernode */ + SLU_SCP, /* supernode, column-wise, permuted */ + SLU_SR, /* row-wise, supernode */ + SLU_DN, /* Fortran style column-wise storage for dense matrix */ + SLU_NR_loc /* distributed compressed row format */ +} Stype_t; + +typedef enum { + SLU_S, /* single */ + SLU_D, /* double */ + SLU_C, /* single complex */ + SLU_Z /* double complex */ +} Dtype_t; + +typedef enum { + SLU_GE, /* general */ + SLU_TRLU, /* lower triangular, unit diagonal */ + SLU_TRUU, /* upper triangular, unit diagonal */ + SLU_TRL, /* lower triangular */ + SLU_TRU, /* upper triangular */ + SLU_SYL, /* symmetric, store lower half */ + SLU_SYU, /* symmetric, store upper half */ + SLU_HEL, /* Hermitian, store lower half */ + SLU_HEU /* Hermitian, store upper half */ +} Mtype_t; + +typedef struct { + Stype_t Stype; /* Storage type: interprets the storage structure + pointed to by *Store. */ + Dtype_t Dtype; /* Data type. */ + Mtype_t Mtype; /* Matrix type: describes the mathematical property of + the matrix. */ + int_t nrow; /* number of rows */ + int_t ncol; /* number of columns */ + void *Store; /* pointer to the actual storage of the matrix */ +} SuperMatrix; + +/*********************************************** + * The storage schemes are defined as follows. * + ***********************************************/ + +/* Stype == SLU_NC (Also known as Harwell-Boeing sparse matrix format) */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *rowind; /* pointer to array of row indices of the nonzeros */ + int_t *colptr; /* pointer to array of beginning of columns in nzval[] + and rowind[] */ + /* Note: + Zero-based indexing is used; + colptr[] has ncol+1 entries, the last one pointing + beyond the last column, so that colptr[ncol] = nnz. */ +} NCformat; + +/* Stype == SLU_NR */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by raw */ + int_t *colind; /* pointer to array of columns indices of the nonzeros */ + int_t *rowptr; /* pointer to array of beginning of rows in nzval[] + and colind[] */ + /* Note: + Zero-based indexing is used; + rowptr[] has nrow+1 entries, the last one pointing + beyond the last row, so that rowptr[nrow] = nnz. */ +} NRformat; + +/* Stype == SLU_SC */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + int_t nsuper; /* number of supernodes, minus 1 */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *nzval_colptr;/* pointer to array of beginning of columns in nzval[] */ + int_t *rowind; /* pointer to array of compressed row indices of + rectangular supernodes */ + int_t *rowind_colptr;/* pointer to array of beginning of columns in rowind[] */ + int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column + j belongs; mapping from column to supernode number. */ + int_t *sup_to_col; /* sup_to_col[s] points to the start of the s-th + supernode; mapping from supernode number to column. + e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12) + sup_to_col: 0 1 2 4 7 12 (nsuper=4) */ + /* Note: + Zero-based indexing is used; + nzval_colptr[], rowind_colptr[], col_to_sup and + sup_to_col[] have ncol+1 entries, the last one + pointing beyond the last column. + For col_to_sup[], only the first ncol entries are + defined. For sup_to_col[], only the first nsuper+2 + entries are defined. */ +} SCformat; + +/* Stype == SLU_SCP */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + int_t nsuper; /* number of supernodes */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *nzval_colbeg;/* nzval_colbeg[j] points to beginning of column j + in nzval[] */ + int_t *nzval_colend;/* nzval_colend[j] points to one past the last element + of column j in nzval[] */ + int_t *rowind; /* pointer to array of compressed row indices of + rectangular supernodes */ + int_t *rowind_colbeg;/* rowind_colbeg[j] points to beginning of column j + in rowind[] */ + int_t *rowind_colend;/* rowind_colend[j] points to one past the last element + of column j in rowind[] */ + int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column + j belongs; mapping from column to supernode. */ + int_t *sup_to_colbeg; /* sup_to_colbeg[s] points to the start of the s-th + supernode; mapping from supernode to column.*/ + int_t *sup_to_colend; /* sup_to_colend[s] points to one past the end of the + s-th supernode; mapping from supernode number to + column. + e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12) + sup_to_colbeg: 0 1 2 4 7 (nsuper=4) + sup_to_colend: 1 2 4 7 12 */ + /* Note: + Zero-based indexing is used; + nzval_colptr[], rowind_colptr[], col_to_sup and + sup_to_col[] have ncol+1 entries, the last one + pointing beyond the last column. */ +} SCPformat; + +/* Stype == SLU_NCP */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *rowind;/* pointer to array of row indices of the nonzeros */ + /* Note: nzval[]/rowind[] always have the same length */ + int_t *colbeg;/* colbeg[j] points to the beginning of column j in nzval[] + and rowind[] */ + int_t *colend;/* colend[j] points to one past the last element of column + j in nzval[] and rowind[] */ + /* Note: + Zero-based indexing is used; + The consecutive columns of the nonzeros may not be + contiguous in storage, because the matrix has been + postmultiplied by a column permutation matrix. */ +} NCPformat; + +/* Stype == SLU_DN */ +typedef struct { + int_t lda; /* leading dimension */ + void *nzval; /* array of size lda*ncol to represent a dense matrix */ +} DNformat; + +/* Stype == SLU_NR_loc (Distributed Compressed Row Format) */ +typedef struct { + int_t nnz_loc; /* number of nonzeros in the local submatrix */ + int_t m_loc; /* number of rows local to this processor */ + int_t fst_row; /* global index of the first row */ + void *nzval; /* pointer to array of nonzero values, packed by row */ + int_t *rowptr; /* pointer to array of beginning of rows in nzval[] + and colind[] */ + int_t *colind; /* pointer to array of column indices of the nonzeros */ + /* Note: + Zero-based indexing is used; + rowptr[] has n_loc + 1 entries, the last one pointing + beyond the last row, so that rowptr[n_loc] = nnz_loc.*/ +} NRformat_loc; + + +#endif /* __SUPERLU_SUPERMATRIX */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/sutil.c b/thirdparty/superlu/SuperLU_4.1/SRC/sutil.c new file mode 100644 index 0000000..aab65ad --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/sutil.c @@ -0,0 +1,471 @@ + +/*! @file sutil.c + * \brief Matrix utility functions + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include "slu_sdefs.h" + +void +sCreate_CompCol_Matrix(SuperMatrix *A, int m, int n, int nnz, + float *nzval, int *rowind, int *colptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NCformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NCformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->rowind = rowind; + Astore->colptr = colptr; +} + +void +sCreate_CompRow_Matrix(SuperMatrix *A, int m, int n, int nnz, + float *nzval, int *colind, int *rowptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NRformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NRformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->colind = colind; + Astore->rowptr = rowptr; +} + +/*! \brief Copy matrix A into matrix B. */ +void +sCopy_CompCol_Matrix(SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore, *Bstore; + int ncol, nnz, i; + + B->Stype = A->Stype; + B->Dtype = A->Dtype; + B->Mtype = A->Mtype; + B->nrow = A->nrow;; + B->ncol = ncol = A->ncol; + Astore = (NCformat *) A->Store; + Bstore = (NCformat *) B->Store; + Bstore->nnz = nnz = Astore->nnz; + for (i = 0; i < nnz; ++i) + ((float *)Bstore->nzval)[i] = ((float *)Astore->nzval)[i]; + for (i = 0; i < nnz; ++i) Bstore->rowind[i] = Astore->rowind[i]; + for (i = 0; i <= ncol; ++i) Bstore->colptr[i] = Astore->colptr[i]; +} + + +void +sCreate_Dense_Matrix(SuperMatrix *X, int m, int n, float *x, int ldx, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + DNformat *Xstore; + + X->Stype = stype; + X->Dtype = dtype; + X->Mtype = mtype; + X->nrow = m; + X->ncol = n; + X->Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !(X->Store) ) ABORT("SUPERLU_MALLOC fails for X->Store"); + Xstore = (DNformat *) X->Store; + Xstore->lda = ldx; + Xstore->nzval = (float *) x; +} + +void +sCopy_Dense_Matrix(int M, int N, float *X, int ldx, + float *Y, int ldy) +{ +/*! \brief Copies a two-dimensional matrix X to another matrix Y. + */ + int i, j; + + for (j = 0; j < N; ++j) + for (i = 0; i < M; ++i) + Y[i + j*ldy] = X[i + j*ldx]; +} + +void +sCreate_SuperNode_Matrix(SuperMatrix *L, int m, int n, int nnz, + float *nzval, int *nzval_colptr, int *rowind, + int *rowind_colptr, int *col_to_sup, int *sup_to_col, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + SCformat *Lstore; + + L->Stype = stype; + L->Dtype = dtype; + L->Mtype = mtype; + L->nrow = m; + L->ncol = n; + L->Store = (void *) SUPERLU_MALLOC( sizeof(SCformat) ); + if ( !(L->Store) ) ABORT("SUPERLU_MALLOC fails for L->Store"); + Lstore = L->Store; + Lstore->nnz = nnz; + Lstore->nsuper = col_to_sup[n]; + Lstore->nzval = nzval; + Lstore->nzval_colptr = nzval_colptr; + Lstore->rowind = rowind; + Lstore->rowind_colptr = rowind_colptr; + Lstore->col_to_sup = col_to_sup; + Lstore->sup_to_col = sup_to_col; + +} + + +/*! \brief Convert a row compressed storage into a column compressed storage. + */ +void +sCompRow_to_CompCol(int m, int n, int nnz, + float *a, int *colind, int *rowptr, + float **at, int **rowind, int **colptr) +{ + register int i, j, col, relpos; + int *marker; + + /* Allocate storage for another copy of the matrix. */ + *at = (float *) floatMalloc(nnz); + *rowind = (int *) intMalloc(nnz); + *colptr = (int *) intMalloc(n+1); + marker = (int *) intCalloc(n); + + /* Get counts of each column of A, and set up column pointers */ + for (i = 0; i < m; ++i) + for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; + (*colptr)[0] = 0; + for (j = 0; j < n; ++j) { + (*colptr)[j+1] = (*colptr)[j] + marker[j]; + marker[j] = (*colptr)[j]; + } + + /* Transfer the matrix into the compressed column storage. */ + for (i = 0; i < m; ++i) { + for (j = rowptr[i]; j < rowptr[i+1]; ++j) { + col = colind[j]; + relpos = marker[col]; + (*rowind)[relpos] = i; + (*at)[relpos] = a[j]; + ++marker[col]; + } + } + + SUPERLU_FREE(marker); +} + + +void +sPrint_CompCol_Matrix(char *what, SuperMatrix *A) +{ + NCformat *Astore; + register int i,n; + float *dp; + + printf("\nCompCol matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (NCformat *) A->Store; + dp = (float *) Astore->nzval; + printf("nrow %d, ncol %d, nnz %d\n", A->nrow,A->ncol,Astore->nnz); + printf("nzval: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%f ", dp[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%d ", Astore->rowind[i]); + printf("\ncolptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->colptr[i]); + printf("\n"); + fflush(stdout); +} + +void +sPrint_SuperNode_Matrix(char *what, SuperMatrix *A) +{ + SCformat *Astore; + register int i, j, k, c, d, n, nsup; + float *dp; + int *col_to_sup, *sup_to_col, *rowind, *rowind_colptr; + + printf("\nSuperNode matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (SCformat *) A->Store; + dp = (float *) Astore->nzval; + col_to_sup = Astore->col_to_sup; + sup_to_col = Astore->sup_to_col; + rowind_colptr = Astore->rowind_colptr; + rowind = Astore->rowind; + printf("nrow %d, ncol %d, nnz %d, nsuper %d\n", + A->nrow,A->ncol,Astore->nnz,Astore->nsuper); + printf("nzval:\n"); + for (k = 0; k <= Astore->nsuper; ++k) { + c = sup_to_col[k]; + nsup = sup_to_col[k+1] - c; + for (j = c; j < c + nsup; ++j) { + d = Astore->nzval_colptr[j]; + for (i = rowind_colptr[c]; i < rowind_colptr[c+1]; ++i) { + printf("%d\t%d\t%e\n", rowind[i], j, dp[d++]); + } + } + } +#if 0 + for (i = 0; i < Astore->nzval_colptr[n]; ++i) printf("%f ", dp[i]); +#endif + printf("\nnzval_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->nzval_colptr[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->rowind_colptr[n]; ++i) + printf("%d ", Astore->rowind[i]); + printf("\nrowind_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->rowind_colptr[i]); + printf("\ncol_to_sup: "); + for (i = 0; i < n; ++i) printf("%d ", col_to_sup[i]); + printf("\nsup_to_col: "); + for (i = 0; i <= Astore->nsuper+1; ++i) + printf("%d ", sup_to_col[i]); + printf("\n"); + fflush(stdout); +} + +void +sPrint_Dense_Matrix(char *what, SuperMatrix *A) +{ + DNformat *Astore = (DNformat *) A->Store; + register int i, j, lda = Astore->lda; + float *dp; + + printf("\nDense matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + dp = (float *) Astore->nzval; + printf("nrow %d, ncol %d, lda %d\n", A->nrow,A->ncol,lda); + printf("\nnzval: "); + for (j = 0; j < A->ncol; ++j) { + for (i = 0; i < A->nrow; ++i) printf("%f ", dp[i + j*lda]); + printf("\n"); + } + printf("\n"); + fflush(stdout); +} + +/*! \brief Diagnostic print of column "jcol" in the U/L factor. + */ +void +sprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu) +{ + int i, k, fsupc; + int *xsup, *supno; + int *xlsub, *lsub; + float *lusup; + int *xlusup; + float *ucol; + int *usub, *xusub; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + + printf("%s", msg); + printf("col %d: pivrow %d, supno %d, xprune %d\n", + jcol, pivrow, supno[jcol], xprune[jcol]); + + printf("\tU-col:\n"); + for (i = xusub[jcol]; i < xusub[jcol+1]; i++) + printf("\t%d%10.4f\n", usub[i], ucol[i]); + printf("\tL-col in rectangular snode:\n"); + fsupc = xsup[supno[jcol]]; /* first col of the snode */ + i = xlsub[fsupc]; + k = xlusup[jcol]; + while ( i < xlsub[fsupc+1] && k < xlusup[jcol+1] ) { + printf("\t%d\t%10.4f\n", lsub[i], lusup[k]); + i++; k++; + } + fflush(stdout); +} + + +/*! \brief Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod". + */ +void scheck_tempv(int n, float *tempv) +{ + int i; + + for (i = 0; i < n; i++) { + if (tempv[i] != 0.0) + { + fprintf(stderr,"tempv[%d] = %f\n", i,tempv[i]); + ABORT("scheck_tempv"); + } + } +} + + +void +sGenXtrue(int n, int nrhs, float *x, int ldx) +{ + int i, j; + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + x[i + j*ldx] = 1.0;/* + (float)(i+1.)/n;*/ + } +} + +/*! \brief Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's + */ +void +sFillRHS(trans_t trans, int nrhs, float *x, int ldx, + SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore; + float *Aval; + DNformat *Bstore; + float *rhs; + float one = 1.0; + float zero = 0.0; + int ldc; + char transc[1]; + + Astore = A->Store; + Aval = (float *) Astore->nzval; + Bstore = B->Store; + rhs = Bstore->nzval; + ldc = Bstore->lda; + + if ( trans == NOTRANS ) *(unsigned char *)transc = 'N'; + else *(unsigned char *)transc = 'T'; + + sp_sgemm(transc, "N", A->nrow, nrhs, A->ncol, one, A, + x, ldx, zero, rhs, ldc); + +} + +/*! \brief Fills a float precision array with a given value. + */ +void +sfill(float *a, int alen, float dval) +{ + register int i; + for (i = 0; i < alen; i++) a[i] = dval; +} + + + +/*! \brief Check the inf-norm of the error vector + */ +void sinf_norm_error(int nrhs, SuperMatrix *X, float *xtrue) +{ + DNformat *Xstore; + float err, xnorm; + float *Xmat, *soln_work; + int i, j; + + Xstore = X->Store; + Xmat = Xstore->nzval; + + for (j = 0; j < nrhs; j++) { + soln_work = &Xmat[j*Xstore->lda]; + err = xnorm = 0.0; + for (i = 0; i < X->nrow; i++) { + err = SUPERLU_MAX(err, fabs(soln_work[i] - xtrue[i])); + xnorm = SUPERLU_MAX(xnorm, fabs(soln_work[i])); + } + err = err / xnorm; + printf("||X - Xtrue||/||X|| = %e\n", err); + } +} + + + +/*! \brief Print performance of the code. */ +void +sPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, + float rpg, float rcond, float *ferr, + float *berr, char *equed, SuperLUStat_t *stat) +{ + SCformat *Lstore; + NCformat *Ustore; + double *utime; + flops_t *ops; + + utime = stat->utime; + ops = stat->ops; + + if ( utime[FACT] != 0. ) + printf("Factor flops = %e\tMflops = %8.2f\n", ops[FACT], + ops[FACT]*1e-6/utime[FACT]); + printf("Identify relaxed snodes = %8.2f\n", utime[RELAX]); + if ( utime[SOLVE] != 0. ) + printf("Solve flops = %.0f, Mflops = %8.2f\n", ops[SOLVE], + ops[SOLVE]*1e-6/utime[SOLVE]); + + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("\tNo of nonzeros in factor L = %d\n", Lstore->nnz); + printf("\tNo of nonzeros in factor U = %d\n", Ustore->nnz); + printf("\tNo of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage->for_lu/1e6, mem_usage->total_needed/1e6); + printf("Number of memory expansions: %d\n", stat->expansions); + + printf("\tFactor\tMflops\tSolve\tMflops\tEtree\tEquil\tRcond\tRefine\n"); + printf("PERF:%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f\n", + utime[FACT], ops[FACT]*1e-6/utime[FACT], + utime[SOLVE], ops[SOLVE]*1e-6/utime[SOLVE], + utime[ETREE], utime[EQUIL], utime[RCOND], utime[REFINE]); + + printf("\tRpg\t\tRcond\t\tFerr\t\tBerr\t\tEquil?\n"); + printf("NUM:\t%e\t%e\t%e\t%e\t%s\n", + rpg, rcond, ferr[0], berr[0], equed); + +} + + + + +print_float_vec(char *what, int n, float *vec) +{ + int i; + printf("%s: n %d\n", what, n); + for (i = 0; i < n; ++i) printf("%d\t%f\n", i, vec[i]); + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/temp b/thirdparty/superlu/SuperLU_4.1/SRC/temp new file mode 100644 index 0000000..0a71ec1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/temp @@ -0,0 +1,445 @@ +1c1 +< /* mc64ad.f -- translated by f2c (version 20100827). +--- +> /* mc64ad.f -- translated by f2c (version 20061008). +13c13 +< #include "slu_ddefs.h" +--- +> #include "superlu_ddefs.h" +15,16d14 +< #define abs(a) ((a) > 0) ? (a) : -(a) +< #define min(a,b) ((a) < (b)) ? (a) : (b) +22c20,22 +< +--- +> /* extern double dlamch_(char *, int); */ +> #define abs(a) ((a) > 0) ? (a) : -(a) +> #define min(a,b) ((a) < (b)) ? (a) : (b) +51c51 +< /* Subroutine */ int mc64id_(int_t *icntl) +--- +> /* Subroutine */ int_t mc64id(int_t *icntl) +53c53 +< int_t i__; +--- +> static int_t i__; +115c115 +< /* Subroutine */ int mc64ad_(int_t *job, int_t *n, int_t *ne, int_t * +--- +> /* Subroutine */ int_t mc64ad(int_t *job, int_t *n, int_t *ne, int_t * +128,131c128,131 +< int_t i__, j, k; +< double fact, rinf; +< extern /* Subroutine */ int_t mc21ad_(int_t *, int_t *, int_t *, +< int_t *, int_t *, int_t *, int_t *, int_t *), mc64bd_( +--- +> static int_t i__, j, k; +> static double fact, rinf; +> extern /* Subroutine */ int_t mc21ad(int_t *, int_t *, int_t *, +> int_t *, int_t *, int_t *, int_t *, int_t *), mc64bd( +133,140c133,140 +< *, int_t *, int_t *, int_t *, int_t *, int_t *, double *), +< mc64rd_(int_t *, int_t *, int_t *, int_t *, double *), +< mc64sd_(int_t *, int_t *, int_t *, int_t *, double *, int_t *, +< int_t *, int_t *, int_t *, +< int_t *, int_t *, int_t *, int_t *, int_t *), +< mc64wd_(int_t *, int_t *, int_t *, int_t *, double *, int_t *, +< int_t *, int_t *, int_t *, int_t *, int_t *, int_t *, +< double *, double *); +--- +> *, int_t *, int_t *, int_t *, int_t *, int_t *, +> double *), mc64rd(int_t *, int_t *, int_t *, int_t *, +> double *), mc64sd(int_t *, int_t *, int_t *, int_t * +> , double *, int_t *, int_t *, int_t *, int_t *, +> int_t *, int_t *, int_t *, int_t *, int_t *), mc64wd( +> int_t *, int_t *, int_t *, int_t *, double *, int_t +> *, int_t *, int_t *, int_t *, int_t *, int_t *, int_t +> *, double *, double *); +341,344c341 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " because JOB = %d\n", *job); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'JOB',JOB */ +351,354c348 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " because N = %d\n", *job); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'N',N */ +361,364c355 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " because NE = %d\n", *job); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9001) INFO(1),'NE',NE */ +386,389c377 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " LIW too small, must be at least %8d\n", k); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9004) INFO(1),K */ +410,413c398 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " LDW too small, must be at least %8d\n", k); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9005) INFO(1),K */ +433,437c418 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", +< info[1], " Column %8d", j, +< " contains an entry with invalid row index %8d\n", i__); +< } +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9006) INFO(1),J,I */ +444,447c425 +< if (icntl[1] >= 0) { +< printf(" ****** Error in MC64A/AD. INFO(1) = %2d", info[1], +< " Column %8d", j, +< " contains two or more entries with row index %8d\n", i__); +--- +> /* IF (ICNTL(1).GE.0) WRITE(ICNTL(1),9007) INFO(1),J,I */ +459,480c437,440 +< printf(" ****** Input parameters for MC64A/AD: JOB = %8d," +< " N = %d, NE = %8d\n", *job, *n, *ne); +< printf(" IP(1:N+1) = "); +< for (j=1; j<=(*n+1); ++j) { +< printf("%8d", ip[j]); +< if (j%8 == 0) printf("\n"); +< } +< printf("\n IRN(1:NE) = "); +< for (j=1; j<=(*ne); ++j) { +< printf("%8d", irn[j]); +< if (j%8 == 0) printf("\n"); +< } +< printf("\n"); +< +< if (*job > 1) { +< printf(" A(1:NE) = "); +< for (j=1; j<=(*ne); ++j) { +< printf("%f14.4", a[j]); +< if (j%4 == 0) printf("\n"); +< } +< printf("\n"); +< } +--- +> /* WRITE(ICNTL(3),9020) JOB,N,NE */ +> /* WRITE(ICNTL(3),9021) (IP(J),J=1,N+1) */ +> /* WRITE(ICNTL(3),9022) (IRN(J),J=1,NE) */ +> /* IF (JOB.GT.1) WRITE(ICNTL(3),9023) (A(J),J=1,NE) */ +496c456 +< mc21ad_(n, &irn[1], ne, &ip[1], &iw[1], &cperm[1], num, &iw[*n + 1]); +--- +> mc21ad(n, &irn[1], ne, &ip[1], &iw[1], &cperm[1], num, &iw[*n + 1]); +502c462 +< mc64bd_(n, ne, &ip[1], &irn[1], &a[1], &cperm[1], num, &iw[1], &iw[*n +--- +> mc64bd(n, ne, &ip[1], &irn[1], &a[1], &cperm[1], num, &iw[1], &iw[*n +516c476 +< mc64rd_(n, ne, &ip[1], &iw[1], &dw[1]); +--- +> mc64rd(n, ne, &ip[1], &iw[1], &dw[1]); +518c478 +< mc64sd_(n, ne, &ip[1], &iw[1], &dw[1], &cperm[1], num, &iw[*ne + 1], & +--- +> mc64sd(n, ne, &ip[1], &iw[1], &dw[1], &cperm[1], num, &iw[*ne + 1], & +543c503 +< mc64wd_(n, ne, &ip[1], &irn[1], &dw[(*n << 1) + 1], &cperm[1], num, & +--- +> mc64wd(n, ne, &ip[1], &irn[1], &dw[(*n << 1) + 1], &cperm[1], num, & +578c538 +< mc64wd_(n, ne, &ip[1], &irn[1], &dw[*n * 3 + 1], &cperm[1], num, &iw[ +--- +> mc64wd(n, ne, &ip[1], &irn[1], &dw[*n * 3 + 1], &cperm[1], num, &iw[ +610,613c570 +< if (icntl[2] >= 0) { +< printf(" ****** Warning from MC64A/AD. INFO(1) = %2d", info[1], +< " The matrix is structurally singular.\n"); +< } +--- +> /* IF (ICNTL(2).GE.0) WRITE(ICNTL(2),9011) INFO(1) */ +617,620c574 +< if (icntl[2] >= 0) { +< printf(" ****** Warning from MC64A/AD. INFO(1) = %2d\n", info[1], +< " Some scaling factors may be too large.\n"); +< } +--- +> /* IF (ICNTL(2).GE.0) WRITE(ICNTL(2),9012) INFO(1) */ +624,644c578,584 +< printf(" ****** Output parameters for MC64A/AD: INFO(1:2) = %8d%8d\n", +< info[1], info[2]); +< printf(" NUM = ", *num); +< printf(" CPERM(1:N) = "); +< for (j=1; j<=*n; ++j) { +< printf("%8d", cperm[j]); +< if (j%8 == 0) printf("\n"); +< } +< if (*job == 5) { +< printf("\n DW(1:N) = "); +< for (j=1; j<=*n; ++j) { +< printf("%11.3f", dw[j]); +< if (j%5 == 0) printf("\n"); +< } +< printf("\n DW(N+1:2N) = "); +< for (j=1; j<=*n; ++j) { +< printf("%11.3f", dw[*n+j]); +< if (j%5 == 0) printf("\n"); +< } +< printf("\n"); +< } +--- +> /* WRITE(ICNTL(3),9030) (INFO(J),J=1,2) */ +> /* WRITE(ICNTL(3),9031) NUM */ +> /* WRITE(ICNTL(3),9032) (CPERM(J),J=1,N) */ +> /* IF (JOB.EQ.5) THEN */ +> /* WRITE(ICNTL(3),9033) (DW(J),J=1,N) */ +> /* WRITE(ICNTL(3),9034) (DW(N+J),J=1,N) */ +> /* ENDIF */ +648a589,604 +> /* L9001: */ +> /* L9004: */ +> /* L9005: */ +> /* L9006: */ +> /* L9007: */ +> /* L9011: */ +> /* L9012: */ +> /* L9020: */ +> /* L9021: */ +> /* L9022: */ +> /* L9023: */ +> /* L9030: */ +> /* L9031: */ +> /* L9032: */ +> /* L9033: */ +> /* L9034: */ +652c608 +< /* Subroutine */ int_t mc64bd_(int_t *n, int_t *ne, int_t *ip, int_t * +--- +> /* Subroutine */ int_t mc64bd(int_t *n, int_t *ne, int_t *ip, int_t * +661,678c617,635 +< int_t i__, j, k; +< double a0; +< int_t i0, q0; +< double ai, di; +< int_t ii, jj, kk; +< double bv; +< int_t up; +< double dq0; +< int_t kk1, kk2; +< double csp; +< int_t isp, jsp, low; +< double dnew; +< int_t jord, qlen, idum, jdum; +< double rinf; +< extern /* Subroutine */ int mc64dd_(int_t *, int_t *, int_t *, +< double *, int_t *, int_t *), mc64ed_(int_t *, int_t *, +< int_t *, double *, int_t *, int_t *), mc64fd_(int_t * +< , int_t *, int_t *, int_t *, double *, int_t *, int_t *); +--- +> static int_t i__, j, k; +> static double a0; +> static int_t i0, q0; +> static double ai, di; +> static int_t ii, jj, kk; +> static double bv; +> static int_t up; +> static double dq0; +> static int_t kk1, kk2; +> static double csp; +> static int_t isp, jsp, low; +> static double dnew; +> static int_t jord, qlen, idum, jdum; +> static double rinf; +> extern /* Subroutine */ int_t mc64dd(int_t *, int_t *, int_t *, +> double *, int_t *, int_t *), mc64ed(int_t *, int_t *, +> int_t *, double *, int_t *, int_t *), mc64fd(int_t * +> , int_t *, int_t *, int_t *, double *, int_t *, +> int_t *); +892c849 +< mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__1); +--- +> mc64dd(&i__, n, &q[1], &d__[1], &l[1], &c__1); +914c871 +< mc64ed_(&qlen, n, &q[1], &d__[1], &l[1], &c__1); +--- +> mc64ed(&qlen, n, &q[1], &d__[1], &l[1], &c__1); +967c924 +< mc64fd_(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], +--- +> mc64fd(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], +979c936 +< mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__1); +--- +> mc64dd(&i__, n, &q[1], &d__[1], &l[1], &c__1); +1079c1036 +< /* Subroutine */ int_t mc64dd_(int_t *i__, int_t *n, int_t *q, double +--- +> /* Subroutine */ int_t mc64dd(int_t *i__, int_t *n, int_t *q, double +1086,1087c1043,1044 +< double di; +< int_t qk, pos, idum, posk; +--- +> static double di; +> static int_t qk, pos, idum, posk; +1157c1114 +< /* Subroutine */ int_t mc64ed_(int_t *qlen, int_t *n, int_t *q, +--- +> /* Subroutine */ int_t mc64ed(int_t *qlen, int_t *n, int_t *q, +1164,1166c1121,1123 +< int_t i__; +< double di, dk, dr; +< int_t pos, idum, posk; +--- +> static int_t i__; +> static double di, dk, dr; +> static int_t pos, idum, posk; +1252c1209 +< /* Subroutine */ int_t mc64fd_(int_t *pos0, int_t *qlen, int_t *n, +--- +> /* Subroutine */ int_t mc64fd(int_t *pos0, int_t *qlen, int_t *n, +1259,1261c1216,1218 +< int_t i__; +< double di, dk, dr; +< int_t qk, pos, idum, posk; +--- +> static int_t i__; +> static double di, dk, dr; +> static int_t qk, pos, idum, posk; +1390c1347 +< /* Subroutine */ int_t mc64rd_(int_t *n, int_t *ne, int_t *ip, int_t * +--- +> /* Subroutine */ int_t mc64rd(int_t *n, int_t *ne, int_t *ip, int_t * +1397,1401c1354,1358 +< int_t j, k, r__, s; +< double ha; +< int_t hi, td, mid, len, ipj; +< double key; +< int_t last, todo[50], first; +--- +> static int_t j, k, r__, s; +> static double ha; +> static int_t hi, td, mid, len, ipj; +> static double key; +> static int_t last, todo[50], first; +1538c1495 +< /* Subroutine */ int_t mc64sd_(int_t *n, int_t *ne, int_t *ip, int_t * +--- +> /* Subroutine */ int_t mc64sd(int_t *n, int_t *ne, int_t *ip, int_t * +1547,1550c1504,1507 +< int_t i__, j, k, l, ii, mod, cnt, num; +< double bval, bmin, bmax, rinf; +< int_t nval, wlen, idum1, idum2, idum3; +< extern /* Subroutine */ int_t mc64qd_(int_t *, int_t *, int_t *, +--- +> static int_t i__, j, k, l, ii, mod, cnt, num; +> static double bval, bmin, bmax, rinf; +> static int_t nval, wlen, idum1, idum2, idum3; +> extern /* Subroutine */ int_t mc64qd(int_t *, int_t *, int_t *, +1552c1509 +< mc64ud_(int_t *, int_t *, int_t *, int_t *, int_t *, +--- +> mc64ud(int_t *, int_t *, int_t *, int_t *, int_t *, +1555a1513 +> +1627c1585 +< mc64ud_(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], numx, +--- +> mc64ud(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], numx, +1706c1664 +< mc64qd_(&ip[1], &lenl[1], &len[1], &w[1], &wlen, &a[1], &nval, +--- +> mc64qd(&ip[1], &lenl[1], &len[1], &w[1], &wlen, &a[1], &nval, +1767c1725 +< mc64qd_(&ip[1], &len[1], &lenh[1], &w[1], &wlen, &a[1], &nval, & +--- +> mc64qd(&ip[1], &len[1], &lenh[1], &w[1], &wlen, &a[1], &nval, & +1806c1764 +< mc64ud_(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], & +--- +> mc64ud(&cnt, &mod, n, &irn[1], ne, &ip[1], &len[1], &fc[1], &iw[1], & +1854c1812 +< /* Subroutine */ int_t mc64qd_(int_t *ip, int_t *lenl, int_t *lenh, +--- +> /* Subroutine */ int_t mc64qd(int_t *ip, int_t *lenl, int_t *lenh, +1862,1865c1820,1823 +< int_t j, k, s; +< double ha; +< int_t ii, pos; +< double split[10]; +--- +> static int_t j, k, s; +> static double ha; +> static int_t ii, pos; +> static double split[10]; +1949c1907 +< /* Subroutine */ int mc64ud_(int_t *id, int_t *mod, int_t *n, int_t * +--- +> /* Subroutine */ int_t mc64ud(int_t *id, int_t *mod, int_t *n, int_t * +1958,1959c1916,1917 +< int_t i__, j, k, j1, ii, kk, id0, id1, in1, in2, nfc, num0, num1, num2, +< jord, last; +--- +> static int_t i__, j, k, j1, ii, kk, id0, id1, in1, in2, nfc, num0, num1, +> num2, jord, last; +2028c1986 +< /* Integers ID0+1 to ID0+N are unique numbers for call ID to MC64U/UD, */ +--- +> /* Ints ID0+1 to ID0+N are unique numbers for call ID to MC64U/UD, */ +2152c2110 +< /* Subroutine */ int_t mc64wd_(int_t *n, int_t *ne, int_t *ip, int_t * +--- +> /* Subroutine */ int_t mc64wd(int_t *n, int_t *ne, int_t *ip, int_t * +2161,2175c2119,2133 +< int_t i__, j, k, i0, k0, k1, k2, q0; +< double di; +< int_t ii, jj, kk; +< double vj; +< int_t up; +< double dq0; +< int_t kk1, kk2; +< double csp; +< int_t isp, jsp, low; +< double dmin__, dnew; +< int_t jord, qlen, jdum; +< double rinf; +< extern /* Subroutine */ int_t mc64dd_(int_t *, int_t *, int_t *, +< double *, int_t *, int_t *), mc64ed_(int_t *, int_t *, +< int_t *, double *, int_t *, int_t *), mc64fd_(int_t * +--- +> static int_t i__, j, k, i0, k0, k1, k2, q0; +> static double di; +> static int_t ii, jj, kk; +> static double vj; +> static int_t up; +> static double dq0; +> static int_t kk1, kk2; +> static double csp; +> static int_t isp, jsp, low; +> static double dmin__, dnew; +> static int_t jord, qlen, jdum; +> static double rinf; +> extern /* Subroutine */ int_t mc64dd(int_t *, int_t *, int_t *, +> double *, int_t *, int_t *), mc64ed(int_t *, int_t *, +> int_t *, double *, int_t *, int_t *), mc64fd(int_t * +2432c2390 +< mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__2); +--- +> mc64dd(&i__, n, &q[1], &d__[1], &l[1], &c__2); +2454c2412 +< mc64ed_(&qlen, n, &q[1], &d__[1], &l[1], &c__2); +--- +> mc64ed(&qlen, n, &q[1], &d__[1], &l[1], &c__2); +2508c2466 +< mc64fd_(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], +--- +> mc64fd(&l[i__], &qlen, n, &q[1], &d__[1], &l[1], +2519c2477 +< mc64dd_(&i__, n, &q[1], &d__[1], &l[1], &c__2); +--- +> mc64dd(&i__, n, &q[1], &d__[1], &l[1], &c__2); diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/util.c b/thirdparty/superlu/SuperLU_4.1/SRC/util.c new file mode 100644 index 0000000..858fbbc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/util.c @@ -0,0 +1,495 @@ +/*! @file util.c + * \brief Utility functions + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include "slu_ddefs.h" + +/*! \brief Global statistics variale + */ + +void superlu_abort_and_exit(char* msg) +{ + fprintf(stderr, msg); + exit (-1); +} + +/*! \brief Set the default values for the options argument. + */ +void set_default_options(superlu_options_t *options) +{ + options->Fact = DOFACT; + options->Equil = YES; + options->ColPerm = COLAMD; + options->Trans = NOTRANS; + options->IterRefine = NOREFINE; + options->DiagPivotThresh = 1.0; + options->SymmetricMode = NO; + options->PivotGrowth = NO; + options->ConditionNumber = NO; + options->PrintStat = YES; +} + +/*! \brief Set the default values for the options argument for ILU. + */ +void ilu_set_default_options(superlu_options_t *options) +{ + set_default_options(options); + + /* further options for incomplete factorization */ + options->DiagPivotThresh = 0.1; + options->RowPerm = LargeDiag; + options->ILU_DropRule = DROP_BASIC | DROP_AREA; + options->ILU_DropTol = 1e-4; + options->ILU_FillFactor = 10.0; + options->ILU_Norm = INF_NORM; + options->ILU_MILU = SILU; + options->ILU_MILU_Dim = 3.0; /* -log(n)/log(h) is perfect */ + options->ILU_FillTol = 1e-2; +} + +/*! \brief Print the options setting. + */ +void print_options(superlu_options_t *options) +{ + printf(".. options:\n"); + printf("\tFact\t %8d\n", options->Fact); + printf("\tEquil\t %8d\n", options->Equil); + printf("\tColPerm\t %8d\n", options->ColPerm); + printf("\tDiagPivotThresh %8.4f\n", options->DiagPivotThresh); + printf("\tTrans\t %8d\n", options->Trans); + printf("\tIterRefine\t%4d\n", options->IterRefine); + printf("\tSymmetricMode\t%4d\n", options->SymmetricMode); + printf("\tPivotGrowth\t%4d\n", options->PivotGrowth); + printf("\tConditionNumber\t%4d\n", options->ConditionNumber); + printf("..\n"); +} + +/*! \brief Print the options setting. + */ +void print_ilu_options(superlu_options_t *options) +{ + printf(".. ILU options:\n"); + printf("\tDiagPivotThresh\t%6.2e\n", options->DiagPivotThresh); + printf("\ttau\t%6.2e\n", options->ILU_DropTol); + printf("\tgamma\t%6.2f\n", options->ILU_FillFactor); + printf("\tDropRule\t%0x\n", options->ILU_DropRule); + printf("\tMILU\t%d\n", options->ILU_MILU); + printf("\tMILU_ALPHA\t%6.2e\n", MILU_ALPHA); + printf("\tDiagFillTol\t%6.2e\n", options->ILU_FillTol); + printf("..\n"); +} + +/*! \brief Deallocate the structure pointing to the actual storage of the matrix. */ +void +Destroy_SuperMatrix_Store(SuperMatrix *A) +{ + SUPERLU_FREE ( A->Store ); +} + +void +Destroy_CompCol_Matrix(SuperMatrix *A) +{ + SUPERLU_FREE( ((NCformat *)A->Store)->rowind ); + SUPERLU_FREE( ((NCformat *)A->Store)->colptr ); + SUPERLU_FREE( ((NCformat *)A->Store)->nzval ); + SUPERLU_FREE( A->Store ); +} + +void +Destroy_CompRow_Matrix(SuperMatrix *A) +{ + SUPERLU_FREE( ((NRformat *)A->Store)->colind ); + SUPERLU_FREE( ((NRformat *)A->Store)->rowptr ); + SUPERLU_FREE( ((NRformat *)A->Store)->nzval ); + SUPERLU_FREE( A->Store ); +} + +void +Destroy_SuperNode_Matrix(SuperMatrix *A) +{ + SUPERLU_FREE ( ((SCformat *)A->Store)->rowind ); + SUPERLU_FREE ( ((SCformat *)A->Store)->rowind_colptr ); + SUPERLU_FREE ( ((SCformat *)A->Store)->nzval ); + SUPERLU_FREE ( ((SCformat *)A->Store)->nzval_colptr ); + SUPERLU_FREE ( ((SCformat *)A->Store)->col_to_sup ); + SUPERLU_FREE ( ((SCformat *)A->Store)->sup_to_col ); + SUPERLU_FREE ( A->Store ); +} + +/*! \brief A is of type Stype==NCP */ +void +Destroy_CompCol_Permuted(SuperMatrix *A) +{ + SUPERLU_FREE ( ((NCPformat *)A->Store)->colbeg ); + SUPERLU_FREE ( ((NCPformat *)A->Store)->colend ); + SUPERLU_FREE ( A->Store ); +} + +/*! \brief A is of type Stype==DN */ +void +Destroy_Dense_Matrix(SuperMatrix *A) +{ + DNformat* Astore = A->Store; + SUPERLU_FREE (Astore->nzval); + SUPERLU_FREE ( A->Store ); +} + +/*! \brief Reset repfnz[] for the current column + */ +void +resetrep_col (const int nseg, const int *segrep, int *repfnz) +{ + int i, irep; + + for (i = 0; i < nseg; i++) { + irep = segrep[i]; + repfnz[irep] = EMPTY; + } +} + + +/*! \brief Count the total number of nonzeros in factors L and U, and in the symmetrically reduced L. + */ +void +countnz(const int n, int *xprune, int *nnzL, int *nnzU, GlobalLU_t *Glu) +{ + int nsuper, fsupc, i, j; + int nnzL0, jlen, irep; + int *xsup, *xlsub; + + xsup = Glu->xsup; + xlsub = Glu->xlsub; + *nnzL = 0; + *nnzU = (Glu->xusub)[n]; + nnzL0 = 0; + nsuper = (Glu->supno)[n]; + + if ( n <= 0 ) return; + + /* + * For each supernode + */ + for (i = 0; i <= nsuper; i++) { + fsupc = xsup[i]; + jlen = xlsub[fsupc+1] - xlsub[fsupc]; + + for (j = fsupc; j < xsup[i+1]; j++) { + *nnzL += jlen; + *nnzU += j - fsupc + 1; + jlen--; + } + irep = xsup[i+1] - 1; + nnzL0 += xprune[irep] - xlsub[irep]; + } + + /* printf("\tNo of nonzeros in symm-reduced L = %d\n", nnzL0);*/ +} + +/*! \brief Count the total number of nonzeros in factors L and U. + */ +void +ilu_countnz(const int n, int *nnzL, int *nnzU, GlobalLU_t *Glu) +{ + int nsuper, fsupc, i, j; + int jlen, irep; + int *xsup, *xlsub; + + xsup = Glu->xsup; + xlsub = Glu->xlsub; + *nnzL = 0; + *nnzU = (Glu->xusub)[n]; + nsuper = (Glu->supno)[n]; + + if ( n <= 0 ) return; + + /* + * For each supernode + */ + for (i = 0; i <= nsuper; i++) { + fsupc = xsup[i]; + jlen = xlsub[fsupc+1] - xlsub[fsupc]; + + for (j = fsupc; j < xsup[i+1]; j++) { + *nnzL += jlen; + *nnzU += j - fsupc + 1; + jlen--; + } + irep = xsup[i+1] - 1; + } +} + + +/*! \brief Fix up the data storage lsub for L-subscripts. It removes the subscript sets for structural pruning, and applies permuation to the remaining subscripts. + */ +void +fixupL(const int n, const int *perm_r, GlobalLU_t *Glu) +{ + register int nsuper, fsupc, nextl, i, j, k, jstrt; + int *xsup, *lsub, *xlsub; + + if ( n <= 1 ) return; + + xsup = Glu->xsup; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nextl = 0; + nsuper = (Glu->supno)[n]; + + /* + * For each supernode ... + */ + for (i = 0; i <= nsuper; i++) { + fsupc = xsup[i]; + jstrt = xlsub[fsupc]; + xlsub[fsupc] = nextl; + for (j = jstrt; j < xlsub[fsupc+1]; j++) { + lsub[nextl] = perm_r[lsub[j]]; /* Now indexed into P*A */ + nextl++; + } + for (k = fsupc+1; k < xsup[i+1]; k++) + xlsub[k] = nextl; /* Other columns in supernode i */ + + } + + xlsub[n] = nextl; +} + + +/*! \brief Diagnostic print of segment info after panel_dfs(). + */ +void print_panel_seg(int n, int w, int jcol, int nseg, + int *segrep, int *repfnz) +{ + int j, k; + + for (j = jcol; j < jcol+w; j++) { + printf("\tcol %d:\n", j); + for (k = 0; k < nseg; k++) + printf("\t\tseg %d, segrep %d, repfnz %d\n", k, + segrep[k], repfnz[(j-jcol)*n + segrep[k]]); + } + +} + + +void +StatInit(SuperLUStat_t *stat) +{ + register int i, w, panel_size, relax; + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + w = SUPERLU_MAX(panel_size, relax); + stat->panel_histo = intCalloc(w+1); + stat->utime = (double *) SUPERLU_MALLOC(NPHASES * sizeof(double)); + if (!stat->utime) ABORT("SUPERLU_MALLOC fails for stat->utime"); + stat->ops = (flops_t *) SUPERLU_MALLOC(NPHASES * sizeof(flops_t)); + if (!stat->ops) ABORT("SUPERLU_MALLOC fails for stat->ops"); + for (i = 0; i < NPHASES; ++i) { + stat->utime[i] = 0.; + stat->ops[i] = 0.; + } + stat->TinyPivots = 0; + stat->RefineSteps = 0; + stat->expansions = 0; +#if ( PRNTlevel >= 1 ) + printf(".. parameters in sp_ienv():\n"); + printf("\t 1: panel size \t %4d \n" + "\t 2: relax \t %4d \n" + "\t 3: max. super \t %4d \n" + "\t 4: row-dim 2D \t %4d \n" + "\t 5: col-dim 2D \t %4d \n" + "\t 6: fill ratio \t %4d \n", + sp_ienv(1), sp_ienv(2), sp_ienv(3), + sp_ienv(4), sp_ienv(5), sp_ienv(6)); +#endif +} + + +void +StatPrint(SuperLUStat_t *stat) +{ + double *utime; + flops_t *ops; + + utime = stat->utime; + ops = stat->ops; + printf("Factor time = %8.2f\n", utime[FACT]); + if ( utime[FACT] != 0.0 ) + printf("Factor flops = %e\tMflops = %8.2f\n", ops[FACT], + ops[FACT]*1e-6/utime[FACT]); + + printf("Solve time = %8.2f\n", utime[SOLVE]); + if ( utime[SOLVE] != 0.0 ) + printf("Solve flops = %e\tMflops = %8.2f\n", ops[SOLVE], + ops[SOLVE]*1e-6/utime[SOLVE]); + + printf("Number of memory expansions: %d\n", stat->expansions); + +} + + +void +StatFree(SuperLUStat_t *stat) +{ + SUPERLU_FREE(stat->panel_histo); + SUPERLU_FREE(stat->utime); + SUPERLU_FREE(stat->ops); +} + + +flops_t +LUFactFlops(SuperLUStat_t *stat) +{ + return (stat->ops[FACT]); +} + +flops_t +LUSolveFlops(SuperLUStat_t *stat) +{ + return (stat->ops[SOLVE]); +} + + + + + +/*! \brief Fills an integer array with a given value. + */ +void ifill(int *a, int alen, int ival) +{ + register int i; + for (i = 0; i < alen; i++) a[i] = ival; +} + + + +/*! \brief Get the statistics of the supernodes + */ +#define NBUCKS 10 +static int max_sup_size; + +void super_stats(int nsuper, int *xsup) +{ + register int nsup1 = 0; + int i, isize, whichb, bl, bh; + int bucket[NBUCKS]; + + max_sup_size = 0; + + for (i = 0; i <= nsuper; i++) { + isize = xsup[i+1] - xsup[i]; + if ( isize == 1 ) nsup1++; + if ( max_sup_size < isize ) max_sup_size = isize; + } + + printf(" Supernode statistics:\n\tno of super = %d\n", nsuper+1); + printf("\tmax supernode size = %d\n", max_sup_size); + printf("\tno of size 1 supernodes = %d\n", nsup1); + + /* Histogram of the supernode sizes */ + ifill (bucket, NBUCKS, 0); + + for (i = 0; i <= nsuper; i++) { + isize = xsup[i+1] - xsup[i]; + whichb = (float) isize / max_sup_size * NBUCKS; + if (whichb >= NBUCKS) whichb = NBUCKS - 1; + bucket[whichb]++; + } + + printf("\tHistogram of supernode sizes:\n"); + for (i = 0; i < NBUCKS; i++) { + bl = (float) i * max_sup_size / NBUCKS; + bh = (float) (i+1) * max_sup_size / NBUCKS; + printf("\tsnode: %d-%d\t\t%d\n", bl+1, bh, bucket[i]); + } + +} + + +float SpaSize(int n, int np, float sum_npw) +{ + return (sum_npw*8 + np*8 + n*4)/1024.; +} + +float DenseSize(int n, float sum_nw) +{ + return (sum_nw*8 + n*8)/1024.;; +} + + + +/*! \brief Check whether repfnz[] == EMPTY after reset. + */ +void check_repfnz(int n, int w, int jcol, int *repfnz) +{ + int jj, k; + + for (jj = jcol; jj < jcol+w; jj++) + for (k = 0; k < n; k++) + if ( repfnz[(jj-jcol)*n + k] != EMPTY ) { + fprintf(stderr, "col %d, repfnz_col[%d] = %d\n", jj, + k, repfnz[(jj-jcol)*n + k]); + ABORT("check_repfnz"); + } +} + + +/*! \brief Print a summary of the testing results. */ +void +PrintSumm(char *type, int nfail, int nrun, int nerrs) +{ + if ( nfail > 0 ) + printf("%3s driver: %d out of %d tests failed to pass the threshold\n", + type, nfail, nrun); + else + printf("All tests for %3s driver passed the threshold (%6d tests run)\n", type, nrun); + + if ( nerrs > 0 ) + printf("%6d error messages recorded\n", nerrs); +} + + +int print_int_vec(char *what, int n, int *vec) +{ + int i; + printf("%s\n", what); + for (i = 0; i < n; ++i) printf("%d\t%d\n", i, vec[i]); + return 0; +} + +int slu_PrintInt10(char *name, int len, int *x) +{ + register int i; + + printf("%10s:", name); + for (i = 0; i < len; ++i) + { + if ( i % 10 == 0 ) printf("\n\t[%2d-%2d]", i, i + 9); + printf("%6d", x[i]); + } + printf("\n"); + return 0; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/xerbla.c b/thirdparty/superlu/SuperLU_4.1/SRC/xerbla.c new file mode 100644 index 0000000..bffd66b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/xerbla.c @@ -0,0 +1,43 @@ +#include +#include "slu_Cnames.h" + +/* Subroutine */ int xerbla_(char *srname, int *info) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + XERBLA is an error handler for the LAPACK routines. + It is called by an LAPACK routine if an input parameter has an + invalid value. A message is printed and execution stops. + + Installers may consider modifying the STOP statement in order to + call system-specific exception-handling facilities. + + Arguments + ========= + + SRNAME (input) CHARACTER*6 + The name of the routine which called XERBLA. + + INFO (input) INT + The position of the invalid parameter in the parameter list + + of the calling routine. + + ===================================================================== +*/ + + printf("** On entry to %6s, parameter number %2d had an illegal value\n", + srname, *info); + +/* End of XERBLA */ + + return 0; +} /* xerbla_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_bmod.c new file mode 100644 index 0000000..c50e761 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_bmod.c @@ -0,0 +1,367 @@ + +/*! @file zcolumn_bmod.c + * \brief performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + *  Permission is hereby granted to use or copy this program for any
    + *  purpose, provided the above notices are retained on all copies.
    + *  Permission to modify the code and to distribute modified code is
    + *  granted, provided the above notices are retained, and a notice that
    + *  the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include +#include +#include "slu_zdefs.h" + +/* + * Function prototypes + */ +void zusolve(int, int, doublecomplex*, doublecomplex*); +void zlsolve(int, int, doublecomplex*, doublecomplex*); +void zmatvec(int, int, int, doublecomplex*, doublecomplex*, doublecomplex*); + + + +/*! \brief + * + *
    + * Purpose:
    + * ========
    + * Performs numeric block updates (sup-col) in topological order.
    + * It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + * Special processing on the supernodal portion of L\U[*,j]
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +zcolumn_bmod ( + const int jcol, /* in */ + const int nseg, /* in */ + doublecomplex *dense, /* in */ + doublecomplex *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in */ + int fpanelc, /* in -- first column in the current panel */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + doublecomplex alpha, beta; + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in supernode + * nsupr = no of rows in supernode (used as leading dimension) + * luptr = location of supernodal LU-block in storage + * kfnz = first nonz in the k-th supernodal segment + * no_zeros = no of leading zeros in a supernodal U-segment + */ + doublecomplex ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int fsupc, nsupc, nsupr, segsze; + int nrow; /* No of rows in the matrix of matrix-vector */ + int jcolp1, jsupno, k, ksub, krep, krep_ind, ksupno; + register int lptr, kfnz, isub, irow, i; + register int no_zeros, new_next; + int ufirst, nextlu; + int fst_col; /* First column within small LU update */ + int d_fsupc; /* Distance between the first column of the current + panel and the first column of the current snode. */ + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + int nzlumax; + doublecomplex *tempv1; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + doublecomplex none = {-1.0, 0.0}; + doublecomplex comp_temp, comp_temp1; + int mem_error; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + nzlumax = Glu->nzlumax; + jcolp1 = jcol + 1; + jsupno = supno[jcol]; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + + krep = segrep[k]; + k--; + ksupno = supno[krep]; + if ( jsupno != ksupno ) { /* Outside the rectangular supernode */ + + fsupc = xsup[ksupno]; + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + /* Distance from the current supernode to the current panel; + d_fsupc=0 if fsupc > fpanelc. */ + d_fsupc = fst_col - fsupc; + + luptr = xlusup[fst_col] + d_fsupc; + lptr = xlsub[fsupc] + d_fsupc; + + kfnz = repfnz[krep]; + kfnz = SUPERLU_MAX ( kfnz, fpanelc ); + + segsze = krep - kfnz + 1; + nsupc = krep - fst_col + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nrow = nsupr - d_fsupc - nsupc; + krep_ind = lptr + nsupc - 1; + + ops[TRSV] += 4 * segsze * (segsze - 1); + ops[GEMV] += 8 * nrow * segsze; + + + + /* + * Case 1: Update U-segment of size 1 -- col-col update + */ + if ( segsze == 1 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + z_sub(&dense[irow], &dense[irow], &comp_temp); + luptr++; + } + + } else if ( segsze <= 3 ) { + ukj = dense[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { /* Case 2: 2cols-col update */ + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + z_sub(&ukj, &ukj, &comp_temp); + dense[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense[irow], &dense[irow], &comp_temp); + } + } else { /* Case 3: 3cols-col update */ + ukj2 = dense[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + zz_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + z_sub(&ukj1, &ukj1, &comp_temp); + + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&ukj, &ukj, &comp_temp); + + dense[lsub[krep_ind]] = ukj; + dense[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; + luptr1++; + luptr2++; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense[irow], &dense[irow], &comp_temp); + } + } + + + } else { + /* + * Case: sup-col update + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense + */ + + no_zeros = kfnz - fst_col; + + /* Copy U[*,j] segment from dense[*] to tempv[*] */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + tempv[i] = dense[irow]; + ++isub; + } + + /* Dense triangular solve -- start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + ztrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + zgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + zlsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + zmatvec (nsupr, nrow , segsze, &lusup[luptr], tempv, tempv1); +#endif + + + /* Scatter tempv[] into SPA dense[] as a temporary storage */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense[irow] = tempv[i]; + tempv[i] = zero; + ++isub; + } + + /* Scatter tempv1[] into SPA dense[] */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + z_sub(&dense[irow], &dense[irow], &tempv1[i]); + tempv1[i] = zero; + ++isub; + } + } + + } /* if jsupno ... */ + + } /* for each segment... */ + + /* + * Process the supernodal portion of L\U[*,j] + */ + nextlu = xlusup[jcol]; + fsupc = xsup[jsupno]; + + /* Copy the SPA dense into L\U[*,j] */ + new_next = nextlu + xlsub[fsupc+1] - xlsub[fsupc]; + while ( new_next > nzlumax ) { + if (mem_error = zLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, Glu)) + return (mem_error); + lusup = Glu->lusup; + lsub = Glu->lsub; + } + + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = zero; + ++nextlu; + } + + xlusup[jcolp1] = nextlu; /* Close L\U[*,jcol] */ + + /* For more updates within the panel (also within the current supernode), + * should start from the first column of the panel, or the first column + * of the supernode, whichever is bigger. There are 2 cases: + * 1) fsupc < fpanelc, then fst_col := fpanelc + * 2) fsupc >= fpanelc, then fst_col := fsupc + */ + fst_col = SUPERLU_MAX ( fsupc, fpanelc ); + + if ( fst_col < jcol ) { + + /* Distance between the current supernode and the current panel. + d_fsupc=0 if fsupc >= fpanelc. */ + d_fsupc = fst_col - fsupc; + + lptr = xlsub[fsupc] + d_fsupc; + luptr = xlusup[fst_col] + d_fsupc; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */ + nsupc = jcol - fst_col; /* Excluding jcol */ + nrow = nsupr - d_fsupc - nsupc; + + /* Points to the beginning of jcol in snode L\U(jsupno) */ + ufirst = xlusup[jcol] + d_fsupc; + + ops[TRSV] += 4 * nsupc * (nsupc - 1); + ops[GEMV] += 8 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#else + ztrsv_( "L", "N", "U", &nsupc, &lusup[luptr], + &nsupr, &lusup[ufirst], &incx ); +#endif + + alpha = none; beta = one; /* y := beta*y + alpha*A*x */ + +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + zgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + zlsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + + zmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], tempv ); + + /* Copy updates from tempv[*] into lusup[*] */ + isub = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + z_sub(&lusup[isub], &lusup[isub], &tempv[i]); + tempv[i] = zero; + ++isub; + } + +#endif + + + } /* if fst_col < jcol ... */ + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_dfs.c new file mode 100644 index 0000000..0f8c6ed --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zcolumn_dfs.c @@ -0,0 +1,275 @@ + +/*! @file zcolumn_dfs.c + * \brief Performs a symbolic factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    +*/ + +#include "slu_zdefs.h" + +/*! \brief What type of supernodes we want */ +#define T2_SUPER + + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   ZCOLUMN_DFS performs a symbolic factorization on column jcol, and
    + *   decide the supernode boundary.
    + *
    + *   This routine does not use numeric values, but only use the RHS 
    + *   row indices to start the dfs.
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives. The routine returns a list of such supernodal 
    + *   representatives in topological order of the dfs that generates them.
    + *   The location of the first nonzero in each such supernodal segment
    + *   (supernodal entry location) is also returned.
    + *
    + * Local parameters
    + * ================
    + *   nseg: no of segments in current U[*,j]
    + *   jsuper: jsuper=EMPTY if column j does not belong to the same
    + *	supernode as j-1. Otherwise, jsuper=nsuper.
    + *
    + *   marker2: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + *
    + * Return value
    + * ============
    + *     0  success;
    + *   > 0  number of bytes allocated when run out of space.
    + * 
    + */ +int +zcolumn_dfs( + const int m, /* in - number of rows in the matrix */ + const int jcol, /* in */ + int *perm_r, /* in */ + int *nseg, /* modified - with new segments appended */ + int *lsub_col, /* in - defines the RHS vector to start the dfs */ + int *segrep, /* modified - with new segments appended */ + int *repfnz, /* modified */ + int *xprune, /* modified */ + int *marker, /* modified */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + int jcolp1, jcolm1, jsuper, nsuper, nextl; + int k, krep, krow, kmark, kperm; + int *marker2; /* Used for small panel LU */ + int fsupc; /* First column of a snode */ + int myfnz; /* First nonz column of a U-segment */ + int chperm, chmark, chrep, kchild; + int xdfs, maxdfs, kpar, oldrep; + int jptr, jm1ptr; + int ito, ifrom, istop; /* Used to compress row subscripts */ + int mem_error; + int *xsup, *supno, *lsub, *xlsub; + int nzlmax; + static int first = 1, maxsuper; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + if ( first ) { + maxsuper = sp_ienv(3); + first = 0; + } + jcolp1 = jcol + 1; + jcolm1 = jcol - 1; + nsuper = supno[jcol]; + jsuper = nsuper; + nextl = xlsub[jcol]; + marker2 = &marker[2*m]; + + + /* For each nonzero in A[*,jcol] do dfs */ + for (k = 0; lsub_col[k] != EMPTY; k++) { + + krow = lsub_col[k]; + lsub_col[k] = EMPTY; + kmark = marker2[krow]; + + /* krow was visited before, go to the next nonz */ + if ( kmark == jcol ) continue; + + /* For each unmarked nbr krow of jcol + * krow is in L: place it in structure of L[*,jcol] + */ + marker2[krow] = jcol; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + lsub[nextl++] = krow; /* krow is indexed into A */ + if ( nextl >= nzlmax ) { + if ( mem_error = zLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( kmark != jcolm1 ) jsuper = EMPTY;/* Row index subset testing */ + } else { + /* krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz[krep]; + + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > kperm ) repfnz[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker2[kchild]; + + if ( chmark != jcol ) { /* Not reached yet */ + marker2[kchild] = jcol; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,k] */ + if ( chperm == EMPTY ) { + lsub[nextl++] = kchild; + if ( nextl >= nzlmax ) { + if ( mem_error = + zLUMemXpand(jcol,nextl,LSUB,&nzlmax,Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + if ( chmark != jcolm1 ) jsuper = EMPTY; + } else { + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz[chrep]; + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz[chrep] = chperm; + } else { + /* Continue dfs at super-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L^t) */ + parent[krep] = oldrep; + repfnz[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + } /* else */ + + } /* else */ + + } /* if */ + + } /* while */ + + /* krow has no more unexplored nbrs; + * place supernode-rep krep in postorder DFS. + * backtrack dfs to its parent + */ + segrep[*nseg] = krep; + ++(*nseg); + kpar = parent[krep]; /* Pop from stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + + } while ( kpar != EMPTY ); /* Until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonzero ... */ + + /* Check to see if j belongs in the same supernode as j-1 */ + if ( jcol == 0 ) { /* Do nothing for column 0 */ + nsuper = supno[0] = 0; + } else { + fsupc = xsup[nsuper]; + jptr = xlsub[jcol]; /* Not compressed yet */ + jm1ptr = xlsub[jcolm1]; + +#ifdef T2_SUPER + if ( (nextl-jptr != jptr-jm1ptr-1) ) jsuper = EMPTY; +#endif + /* Make sure the number of columns in a supernode doesn't + exceed threshold. */ + if ( jcol - fsupc >= maxsuper ) jsuper = EMPTY; + + /* If jcol starts a new supernode, reclaim storage space in + * lsub from the previous supernode. Note we only store + * the subscript set of the first and last columns of + * a supernode. (first for num values, last for pruning) + */ + if ( jsuper == EMPTY ) { /* starts a new supernode */ + if ( (fsupc < jcolm1-1) ) { /* >= 3 columns in nsuper */ +#ifdef CHK_COMPRESS + printf(" Compress lsub[] at super %d-%d\n", fsupc, jcolm1); +#endif + ito = xlsub[fsupc+1]; + xlsub[jcolm1] = ito; + istop = ito + jptr - jm1ptr; + xprune[jcolm1] = istop; /* Initialize xprune[jcol-1] */ + xlsub[jcol] = istop; + for (ifrom = jm1ptr; ifrom < nextl; ++ifrom, ++ito) + lsub[ito] = lsub[ifrom]; + nextl = ito; /* = istop + length(jcol) */ + } + nsuper++; + supno[jcol] = nsuper; + } /* if a new supernode */ + + } /* else: jcol > 0 */ + + /* Tidy up the pointers before exit */ + xsup[nsuper+1] = jcolp1; + supno[jcolp1] = nsuper; + xprune[jcol] = nextl; /* Initialize upper bound for pruning */ + xlsub[jcolp1] = nextl; + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zcopy_to_ucol.c b/thirdparty/superlu/SuperLU_4.1/SRC/zcopy_to_ucol.c new file mode 100644 index 0000000..8f5a051 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zcopy_to_ucol.c @@ -0,0 +1,103 @@ + +/*! @file zcopy_to_ucol.c + * \brief Copy a computed column of U to the compressed data structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_zdefs.h" + +int +zcopy_to_ucol( + int jcol, /* in */ + int nseg, /* in */ + int *segrep, /* in */ + int *repfnz, /* in */ + int *perm_r, /* in */ + doublecomplex *dense, /* modified - reset to zero on return */ + GlobalLU_t *Glu /* modified */ + ) +{ +/* + * Gather from SPA dense[*] to global ucol[*]. + */ + int ksub, krep, ksupno; + int i, k, kfnz, segsze; + int fsupc, isub, irow; + int jsupno, nextu; + int new_next, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *ucol; + int *usub, *xusub; + int nzumax; + doublecomplex zero = {0.0, 0.0}; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + nzumax = Glu->nzumax; + + jsupno = supno[jcol]; + nextu = xusub[jcol]; + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { + krep = segrep[k--]; + ksupno = supno[krep]; + + if ( ksupno != jsupno ) { /* Should go into ucol[] */ + kfnz = repfnz[krep]; + if ( kfnz != EMPTY ) { /* Nonzero U-segment */ + + fsupc = xsup[ksupno]; + isub = xlsub[fsupc] + kfnz - fsupc; + segsze = krep - kfnz + 1; + + new_next = nextu + segsze; + while ( new_next > nzumax ) { + if (mem_error = zLUMemXpand(jcol, nextu, UCOL, &nzumax, Glu)) + return (mem_error); + ucol = Glu->ucol; + if (mem_error = zLUMemXpand(jcol, nextu, USUB, &nzumax, Glu)) + return (mem_error); + usub = Glu->usub; + lsub = Glu->lsub; + } + + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + usub[nextu] = perm_r[irow]; + ucol[nextu] = dense[irow]; + dense[irow] = zero; + nextu++; + isub++; + } + + } + + } + + } /* for each segment... */ + + xusub[jcol + 1] = nextu; /* Close U[*,jcol] */ + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zdiagonal.c b/thirdparty/superlu/SuperLU_4.1/SRC/zdiagonal.c new file mode 100644 index 0000000..ddd9c32 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zdiagonal.c @@ -0,0 +1,133 @@ + +/*! @file zdiagonal.c + * \brief Auxiliary routines to work with diagonal elements + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +int zfill_diag(int n, NCformat *Astore) +/* fill explicit zeros on the diagonal entries, so that the matrix is not + structurally singular. */ +{ + doublecomplex *nzval = (doublecomplex *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + doublecomplex *nzval_new; + doublecomplex zero = {1.0, 0.0}; + int *rowind_new; + int i, j, diag; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = doublecomplexMalloc(nnz + fill); + rowind_new = intMalloc(nnz + fill); + fill = 0; + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + } + if (diag < 0) + { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill] = zero; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + Astore->nnz += fill; + return fill; +} + +int zdominate(int n, NCformat *Astore) +/* make the matrix diagonally dominant */ +{ + doublecomplex *nzval = (doublecomplex *)Astore->nzval; + int *rowind = Astore->rowind; + int *colptr = Astore->colptr; + int nnz = colptr[n]; + int fill = 0; + doublecomplex *nzval_new; + int *rowind_new; + int i, j, diag; + double s; + + for (i = 0; i < n; i++) + { + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + if (rowind[j] == i) diag = j; + if (diag < 0) fill++; + } + if (fill) + { + nzval_new = doublecomplexMalloc(nnz + fill); + rowind_new = intMalloc(nnz+ fill); + fill = 0; + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i] - fill; j < colptr[i + 1]; j++) + { + if ((rowind_new[j + fill] = rowind[j]) == i) diag = j; + nzval_new[j + fill] = nzval[j]; + s += z_abs1(&nzval_new[j + fill]); + } + if (diag >= 0) { + nzval_new[diag+fill].r = s * 3.0; + nzval_new[diag+fill].i = 0.0; + } else { + rowind_new[colptr[i + 1] + fill] = i; + nzval_new[colptr[i + 1] + fill].r = s * 3.0; + nzval_new[colptr[i + 1] + fill].i = 0.0; + fill++; + } + colptr[i + 1] += fill; + } + Astore->nzval = nzval_new; + Astore->rowind = rowind_new; + SUPERLU_FREE(nzval); + SUPERLU_FREE(rowind); + } + else + { + for (i = 0; i < n; i++) + { + s = 1e-6; + diag = -1; + for (j = colptr[i]; j < colptr[i + 1]; j++) + { + if (rowind[j] == i) diag = j; + s += z_abs1(&nzval[j]); + } + nzval[diag].r = s * 3.0; + nzval[diag].i = 0.0; + } + } + Astore->nnz += fill; + return fill; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgscon.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgscon.c new file mode 100644 index 0000000..8bb95aa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgscon.c @@ -0,0 +1,154 @@ + +/*! @file zgscon.c + * \brief Estimates reciprocal of the condition number of a general matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routines ZGECON.
    + * 
    + */ + +/* + * File name: zgscon.c + * History: Modified from lapack routines ZGECON. + */ +#include +#include "slu_zdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   ZGSCON estimates the reciprocal of the condition number of a general 
    + *   real matrix A, in either the 1-norm or the infinity-norm, using   
    + *   the LU factorization computed by ZGETRF.   *
    + *
    + *   An estimate is obtained for norm(inv(A)), and the reciprocal of the   
    + *   condition number is computed as   
    + *      RCOND = 1 / ( norm(A) * norm(inv(A)) ).   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + *   Arguments   
    + *   =========   
    + *
    + *    NORM    (input) char*
    + *            Specifies whether the 1-norm condition number or the   
    + *            infinity-norm condition number is required:   
    + *            = '1' or 'O':  1-norm;   
    + *            = 'I':         Infinity-norm.
    + *	    
    + *    L       (input) SuperMatrix*
    + *            The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *            zgstrf(). Use compressed row subscripts storage for supernodes,
    + *            i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + * 
    + *    U       (input) SuperMatrix*
    + *            The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *            zgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *            Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *	    
    + *    ANORM   (input) double
    + *            If NORM = '1' or 'O', the 1-norm of the original matrix A.   
    + *            If NORM = 'I', the infinity-norm of the original matrix A.
    + *	    
    + *    RCOND   (output) double*
    + *           The reciprocal of the condition number of the matrix A,   
    + *           computed as RCOND = 1/(norm(A) * norm(inv(A))).
    + *	    
    + *    INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    ===================================================================== 
    + * 
    + */ + +void +zgscon(char *norm, SuperMatrix *L, SuperMatrix *U, + double anorm, double *rcond, SuperLUStat_t *stat, int *info) +{ + + + /* Local variables */ + int kase, kase1, onenrm, i; + double ainvnm; + doublecomplex *work; + extern int zrscl_(int *, doublecomplex *, doublecomplex *, int *); + + extern int zlacon_(int *, doublecomplex *, doublecomplex *, double *, int *); + + + /* Test the input parameters. */ + *info = 0; + onenrm = *(unsigned char *)norm == '1' || lsame_(norm, "O"); + if (! onenrm && ! lsame_(norm, "I")) *info = -1; + else if (L->nrow < 0 || L->nrow != L->ncol || + L->Stype != SLU_SC || L->Dtype != SLU_Z || L->Mtype != SLU_TRLU) + *info = -2; + else if (U->nrow < 0 || U->nrow != U->ncol || + U->Stype != SLU_NC || U->Dtype != SLU_Z || U->Mtype != SLU_TRU) + *info = -3; + if (*info != 0) { + i = -(*info); + xerbla_("zgscon", &i); + return; + } + + /* Quick return if possible */ + *rcond = 0.; + if ( L->nrow == 0 || U->nrow == 0) { + *rcond = 1.; + return; + } + + work = doublecomplexCalloc( 3*L->nrow ); + + + if ( !work ) + ABORT("Malloc fails for work arrays in zgscon."); + + /* Estimate the norm of inv(A). */ + ainvnm = 0.; + if ( onenrm ) kase1 = 1; + else kase1 = 2; + kase = 0; + + do { + zlacon_(&L->nrow, &work[L->nrow], &work[0], &ainvnm, &kase); + + if (kase == 0) break; + + if (kase == kase1) { + /* Multiply by inv(L). */ + sp_ztrsv("L", "No trans", "Unit", L, U, &work[0], stat, info); + + /* Multiply by inv(U). */ + sp_ztrsv("U", "No trans", "Non-unit", L, U, &work[0], stat, info); + + } else { + + /* Multiply by inv(U'). */ + sp_ztrsv("U", "Transpose", "Non-unit", L, U, &work[0], stat, info); + + /* Multiply by inv(L'). */ + sp_ztrsv("L", "Transpose", "Unit", L, U, &work[0], stat, info); + + } + + } while ( kase != 0 ); + + /* Compute the estimate of the reciprocal condition number. */ + if (ainvnm != 0.) *rcond = (1. / ainvnm) / anorm; + + SUPERLU_FREE (work); + return; + +} /* zgscon */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgsequ.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgsequ.c new file mode 100644 index 0000000..657637d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgsequ.c @@ -0,0 +1,195 @@ + +/*! @file zgsequ.c + * \brief Computes row and column scalings + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from LAPACK routine ZGEEQU
    + * 
    + */ +/* + * File name: zgsequ.c + * History: Modified from LAPACK routine ZGEEQU + */ +#include +#include "slu_zdefs.h" + + + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   ZGSEQU computes row and column scalings intended to equilibrate an   
    + *   M-by-N sparse matrix A and reduce its condition number. R returns the row
    + *   scale factors and C the column scale factors, chosen to try to make   
    + *   the largest element in each row and column of the matrix B with   
    + *   elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.   
    + *
    + *   R(i) and C(j) are restricted to be between SMLNUM = smallest safe   
    + *   number and BIGNUM = largest safe number.  Use of these scaling   
    + *   factors is not guaranteed to reduce the condition number of A but   
    + *   works well in practice.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input) SuperMatrix*
    + *           The matrix of dimension (A->nrow, A->ncol) whose equilibration
    + *           factors are to be computed. The type of A can be:
    + *           Stype = SLU_NC; Dtype = SLU_Z; Mtype = SLU_GE.
    + *	    
    + *   R       (output) double*, size A->nrow
    + *           If INFO = 0 or INFO > M, R contains the row scale factors   
    + *           for A.
    + *	    
    + *   C       (output) double*, size A->ncol
    + *           If INFO = 0,  C contains the column scale factors for A.
    + *	    
    + *   ROWCND  (output) double*
    + *           If INFO = 0 or INFO > M, ROWCND contains the ratio of the   
    + *           smallest R(i) to the largest R(i).  If ROWCND >= 0.1 and   
    + *           AMAX is neither too large nor too small, it is not worth   
    + *           scaling by R.
    + *	    
    + *   COLCND  (output) double*
    + *           If INFO = 0, COLCND contains the ratio of the smallest   
    + *           C(i) to the largest C(i).  If COLCND >= 0.1, it is not   
    + *           worth scaling by C.
    + *	    
    + *   AMAX    (output) double*
    + *           Absolute value of largest matrix element.  If AMAX is very   
    + *           close to overflow or very close to underflow, the matrix   
    + *           should be scaled.
    + *	    
    + *   INFO    (output) int*
    + *           = 0:  successful exit   
    + *           < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *           > 0:  if INFO = i,  and i is   
    + *                 <= A->nrow:  the i-th row of A is exactly zero   
    + *                 >  A->ncol:  the (i-M)-th column of A is exactly zero   
    + *
    + *   ===================================================================== 
    + * 
    + */ +void +zgsequ(SuperMatrix *A, double *r, double *c, double *rowcnd, + double *colcnd, double *amax, int *info) +{ + + + /* Local variables */ + NCformat *Astore; + doublecomplex *Aval; + int i, j, irow; + double rcmin, rcmax; + double bignum, smlnum; + extern double dlamch_(char *); + + /* Test the input parameters. */ + *info = 0; + if ( A->nrow < 0 || A->ncol < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_Z || A->Mtype != SLU_GE ) + *info = -1; + if (*info != 0) { + i = -(*info); + xerbla_("zgsequ", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || A->ncol == 0 ) { + *rowcnd = 1.; + *colcnd = 1.; + *amax = 0.; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Get machine constants. */ + smlnum = dlamch_("S"); + bignum = 1. / smlnum; + + /* Compute row scale factors. */ + for (i = 0; i < A->nrow; ++i) r[i] = 0.; + + /* Find the maximum element in each row. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + r[irow] = SUPERLU_MAX( r[irow], z_abs1(&Aval[i]) ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (i = 0; i < A->nrow; ++i) { + rcmax = SUPERLU_MAX(rcmax, r[i]); + rcmin = SUPERLU_MIN(rcmin, r[i]); + } + *amax = rcmax; + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (i = 0; i < A->nrow; ++i) + if (r[i] == 0.) { + *info = i + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (i = 0; i < A->nrow; ++i) + r[i] = 1. / SUPERLU_MIN( SUPERLU_MAX( r[i], smlnum ), bignum ); + /* Compute ROWCND = min(R(I)) / max(R(I)) */ + *rowcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + /* Compute column scale factors */ + for (j = 0; j < A->ncol; ++j) c[j] = 0.; + + /* Find the maximum element in each column, assuming the row + scalings computed above. */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + c[j] = SUPERLU_MAX( c[j], z_abs1(&Aval[i]) * r[irow] ); + } + + /* Find the maximum and minimum scale factors. */ + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->ncol; ++j) { + rcmax = SUPERLU_MAX(rcmax, c[j]); + rcmin = SUPERLU_MIN(rcmin, c[j]); + } + + if (rcmin == 0.) { + /* Find the first zero scale factor and return an error code. */ + for (j = 0; j < A->ncol; ++j) + if ( c[j] == 0. ) { + *info = A->nrow + j + 1; + return; + } + } else { + /* Invert the scale factors. */ + for (j = 0; j < A->ncol; ++j) + c[j] = 1. / SUPERLU_MIN( SUPERLU_MAX( c[j], smlnum ), bignum); + /* Compute COLCND = min(C(J)) / max(C(J)) */ + *colcnd = SUPERLU_MAX( rcmin, smlnum ) / SUPERLU_MIN( rcmax, bignum ); + } + + return; + +} /* zgsequ */ + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgsisx.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgsisx.c new file mode 100644 index 0000000..a5039ac --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgsisx.c @@ -0,0 +1,723 @@ + +/*! @file zgsisx.c + * \brief Computes an approximate solutions of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * November, 2010
    + * 
    + */ +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSISX computes an approximate solutions of linear equations
    + * A*X=B or A'*X=B, using the ILU factorization from zgsitrf().
    + * An estimation of the condition number is provided. 
    + * The routine performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *	1.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A is
    + *	     overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *	     (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *	     = TRANS or CONJ).
    + *
    + *	1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *	     matrix that usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the matrix A (after equilibration if options->Equil = YES)
    + *	     as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *	1.4. Compute the reciprocal pivot growth factor.
    + *
    + *	1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n),
    + *	     and info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	1.6. The system of equations is solved for X using the factored form
    + *	     of A.
    + *
    + *	1.7. options->IterRefine is not used
    + *
    + *	1.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *	1.9. options for ILU only
    + *	     1) If options->RowPerm = LargeDiag, MC64 is used to scale and
    + *		permute the matrix to an I-matrix, that is Pr*Dr*A*Dc has
    + *		entries of modulus 1 on the diagonal and off-diagonal entries
    + *		of modulus at most 1. If MC64 fails, dgsequ() is used to
    + *		equilibrate the system.
    + *              ( Default: LargeDiag )
    + *	     2) options->ILU_DropTol = tau is the threshold for dropping.
    + *		For L, it is used directly (for the whole row in a supernode);
    + *		For U, ||A(:,i)||_oo * tau is used as the threshold
    + *	        for the	i-th column.
    + *		If a secondary dropping rule is required, tau will
    + *	        also be used to compute the second threshold.
    + *              ( Default: 1e-4 )
    + *	     3) options->ILU_FillFactor = gamma, used as the initial guess
    + *		of memory growth.
    + *		If a secondary dropping rule is required, it will also
    + *              be used as an upper bound of the memory.
    + *              ( Default: 10 )
    + *	     4) options->ILU_DropRule specifies the dropping rule.
    + *		Option	      Meaning
    + *		======	      ===========
    + *		DROP_BASIC:   Basic dropping rule, supernodal based ILUTP(tau).
    + *		DROP_PROWS:   Supernodal based ILUTP(p,tau), p = gamma*nnz(A)/n.
    + *		DROP_COLUMN:  Variant of ILUTP(p,tau), for j-th column,
    + *			      p = gamma * nnz(A(:,j)).
    + *		DROP_AREA:    Variation of ILUTP, for j-th column, use
    + *			      nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory.
    + *		DROP_DYNAMIC: Modify the threshold tau during factorizaion:
    + *			      If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma
    + *				  tau_L(j) := MIN(tau_0, tau_L(j-1) * 2);
    + *			      Otherwise
    + *				  tau_L(j) := MAX(tau_0, tau_L(j-1) / 2);
    + *			      tau_U(j) uses the similar rule.
    + *			      NOTE: the thresholds used by L and U are separate.
    + *		DROP_INTERP:  Compute the second dropping threshold by
    + *			      interpolation instead of sorting (default).
    + *			      In this case, the actual fill ratio is not
    + *			      guaranteed smaller than gamma.
    + *		DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive.
    + *		( Default: DROP_BASIC | DROP_AREA )
    + *	     5) options->ILU_Norm is the criterion of measuring the magnitude
    + *		of a row in a supernode of L. ( Default is INF_NORM )
    + *		options->ILU_Norm	RowSize(x[1:n])
    + *		=================	===============
    + *		ONE_NORM		||x||_1 / n
    + *		TWO_NORM		||x||_2 / sqrt(n)
    + *		INF_NORM		max{|x[i]|}
    + *	     6) options->ILU_MILU specifies the type of MILU's variation.
    + *		= SILU: do not perform Modified ILU;
    + *		= SMILU_1 (not recommended):
    + *		    U(i,i) := U(i,i) + sum(dropped entries);
    + *		= SMILU_2:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(dropped entries);
    + *		= SMILU_3:
    + *		    U(i,i) := U(i,i) + SGN(U(i,i)) * sum(|dropped entries|);
    + *		NOTE: Even SMILU_1 does not preserve the column sum because of
    + *		late dropping.
    + *              ( Default: SILU )
    + *	     7) options->ILU_FillTol is used as the perturbation when
    + *		encountering zero pivots. If some U(i,i) = 0, so that U is
    + *		exactly singular, then
    + *		   U(i,i) := ||A(:,i)|| * options->ILU_FillTol ** (1 - i / n).
    + *              ( Default: 1e-2 )
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *	to the transpose of A:
    + *
    + *	2.1. If options->Equil = YES or options->RowPerm = LargeDiag, scaling
    + *	     factors are computed to equilibrate the system:
    + *	     options->Trans = NOTRANS:
    + *		 diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *	     options->Trans = TRANS:
    + *		 (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *	     options->Trans = CONJ:
    + *		 (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *	     Whether or not the system will be equilibrated depends on the
    + *	     scaling of the matrix A, but if equilibration is used, A' is
    + *	     overwritten by diag(R)*A'*diag(C) and B by diag(R)*B
    + *	     (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *	2.2. Permute columns of transpose(A) (rows of A),
    + *	     forming transpose(A)*Pc, where Pc is a permutation matrix that
    + *	     usually preserves sparsity.
    + *	     For more details of this step, see sp_preorder.c.
    + *
    + *	2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *	     factor the transpose(A) (after equilibration if
    + *	     options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *	     permutation Pr determined by partial pivoting.
    + *
    + *	2.4. Compute the reciprocal pivot growth factor.
    + *
    + *	2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *	     routine fills a small number on the diagonal entry, that is
    + *		 U(i,i) = ||A(:,i)||_oo * options->ILU_FillTol ** (1 - i / n).
    + *	     And info will be increased by 1. The factored form of A is used
    + *	     to estimate the condition number of the preconditioner. If the
    + *	     reciprocal of the condition number is less than machine precision,
    + *	     info = A->ncol+1 is returned as a warning, but the routine still
    + *	     goes on to solve for X.
    + *
    + *	2.6. The system of equations is solved for X using the factored form
    + *	     of transpose(A).
    + *
    + *	2.7. If options->IterRefine is not used.
    + *
    + *	2.8. If equilibration was used, the matrix X is premultiplied by
    + *	     diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *	     (if options->Trans = TRANS or CONJ) so that it solves the
    + *	     original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the LU decomposition will be performed and how the
    + *	   system will be solved.
    + *
    + * A	   (input/output) SuperMatrix*
    + *	   Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *	   of the linear equations is A->nrow. Currently, the type of A can be:
    + *	   Stype = SLU_NC or SLU_NR, Dtype = SLU_Z, Mtype = SLU_GE.
    + *	   In the future, more general A may be handled.
    + *
    + *	   On entry, If options->Fact = FACTORED and equed is not 'N',
    + *	   then A must have been equilibrated by the scaling factors in
    + *	   R and/or C.
    + *	   On exit, A is not modified
    + *         if options->Equil = NO, or
    + *         if options->Equil = YES but equed = 'N' on exit, or
    + *         if options->RowPerm = NO.
    + *
    + *	   Otherwise, if options->Equil = YES and equed is not 'N',
    + *	   A is scaled as follows:
    + *	   If A->Stype = SLU_NC:
    + *	     equed = 'R':  A := diag(R) * A
    + *	     equed = 'C':  A := A * diag(C)
    + *	     equed = 'B':  A := diag(R) * A * diag(C).
    + *	   If A->Stype = SLU_NR:
    + *	     equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *	     equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *	     equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix to an I-matrix, that is A is modified as follows:
    + *            P*Dr*A*Dc has entries of modulus 1 on the diagonal and 
    + *            off-diagonal entries of modulus at most 1. P is a permutation
    + *            obtained from MC64.
    + *            If MC64 fails, zgsequ() is used to equilibrate the system,
    + *            and A is scaled as above, there is no permutation involved.
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *	   which defines the permutation matrix Pc; perm_c[i] = j means
    + *	   column i of A is in position j in A*Pc.
    + *	   On exit, perm_c may be overwritten by the product of the input
    + *	   perm_c and a permutation that postorders the elimination tree
    + *	   of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *	   is already in postorder.
    + *
    + *	   If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *	   which describes permutation of columns of transpose(A) 
    + *	   (rows of A) as described above.
    + *
    + * perm_r  (input/output) int*
    + *	   If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *	   which defines the permutation matrix Pr, and is determined
    + *	   by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *	   position j in Pr*A.
    + *
    + *	   If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *	   determines permutation of rows of transpose(A)
    + *	   (columns of A) as described above.
    + *
    + *	   If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	   will try to use the input perm_r, unless a certain threshold
    + *	   criterion is violated. In that case, perm_r is overwritten by a
    + *	   new permutation determined by partial pivoting or diagonal
    + *	   threshold pivoting.
    + *	   Otherwise, perm_r is output argument.
    + *
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *	   Elimination tree of Pc'*A'*A*Pc.
    + *	   If options->Fact != FACTORED and options->Fact != DOFACT,
    + *	   etree is an input argument, otherwise it is an output argument.
    + *	   Note: etree is a vector of parent pointers for a forest whose
    + *	   vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *	   Specifies the form of equilibration that was done.
    + *	   = 'N': No equilibration.
    + *	   = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *	   = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *	   = 'B': Both row and column equilibration, i.e., A was replaced 
    + *		  by diag(R)*A*diag(C).
    + *	   If options->Fact = FACTORED, equed is an input argument,
    + *	   otherwise it is an output argument.
    + *
    + * R	   (input/output) double*, dimension (A->nrow)
    + *	   The row scale factors for A or transpose(A).
    + *	   If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *	   If equed = 'N' or 'C', R is not accessed.
    + *	   If options->Fact = FACTORED, R is an input argument,
    + *	       otherwise, R is output.
    + *	   If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *	       of R must be positive.
    + *
    + * C	   (input/output) double*, dimension (A->ncol)
    + *	   The column scale factors for A or transpose(A).
    + *	   If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *	       (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *	   If equed = 'N' or 'R', C is not accessed.
    + *	   If options->Fact = FACTORED, C is an input argument,
    + *	       otherwise, C is output.
    + *	   If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *	       of C must be positive.
    + *
    + * L	   (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype SLU_= NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses compressed row subscripts storage for supernodes, i.e.,
    + *	   L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U	   (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *	       Pr*A*Pc=L*U		(if A->Stype = SLU_NC) or
    + *	       Pr*transpose(A)*Pc=L*U	(if A->Stype = SLU_NR).
    + *	   Uses column-wise storage scheme, i.e., U has types:
    + *	   Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *	   User supplied workspace, should be large enough
    + *	   to hold data structures for factors L and U.
    + *	   On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 mem_usage->total_needed; no other side effects.
    + *
    + *	   See argument 'mem_usage' for memory usage statistics.
    + *
    + * B	   (input/output) SuperMatrix*
    + *	   B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *	   On entry, the right hand side matrix.
    + *	   If B->ncol = 0, only LU decomposition is performed, the triangular
    + *			   solve is skipped.
    + *	   On exit,
    + *	      if equed = 'N', B is not modified; otherwise
    + *	      if A->Stype = SLU_NC:
    + *		 if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *		    B is overwritten by diag(R)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *		    B is overwritten by diag(C)*B;
    + *	      if A->Stype = SLU_NR:
    + *		 if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *		    B is overwritten by diag(C)*B;
    + *		 if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *		    B is overwritten by diag(R)*B.
    + *
    + *         If options->RowPerm = LargeDiag, MC64 is used to scale and permute
    + *            the matrix A to an I-matrix. Then, in addition to the scaling
    + *            above, B is further permuted by P*B if options->Trans = NOTRANS,
    + *            where P is obtained from MC64.
    + *
    + * X	   (output) SuperMatrix*
    + *	   X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *	   If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *	   to the original system of equations. Note that A and B are modified
    + *	   on exit if equed is not 'N', and the solution to the equilibrated
    + *	   system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *	   equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *	   and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) double*
    + *	   The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *	   The infinity norm is used. If recip_pivot_growth is much less
    + *	   than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) double*
    + *	   The estimate of the reciprocal condition number of the matrix A
    + *	   after equilibration (if done). If rcond is less than the machine
    + *	   precision (in particular, if rcond = 0), the matrix is singular
    + *	   to working precision. This condition is indicated by a return
    + *	   code of info > 0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *	   Record the memory usage statistics, consisting of following fields:
    + *	   - for_lu (float)
    + *	     The amount of space used in bytes for L\U data structures.
    + *	   - total_needed (float)
    + *	     The amount of space needed in bytes to perform factorization.
    + *	   - expansions (int)
    + *	     The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *	  Record the statistics on runtime and floating-point operation count.
    + *	  See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + *	   > 0: if info = i, and i is
    + *		<= A->ncol: number of zero pivots. They are replaced by small
    + *		      entries due to options->ILU_FillTol.
    + *		= A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *		      precision, meaning that the matrix is singular to
    + *		      working precision. Nevertheless, the solution and
    + *		      error bounds are computed because there are a number
    + *		      of situations where the computed solution can be more
    + *		      accurate than the value of RCOND would suggest.
    + *		> A->ncol+1: number of bytes allocated when memory allocation
    + *		      failure occurred, plus A->ncol.
    + * 
    + */ + +void +zgsisx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, double *R, double *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, + double *recip_pivot_growth, double *rcond, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info) +{ + + DNformat *Bstore, *Xstore; + doublecomplex *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec, mc64; + trans_t trant; + char norm[1]; + int i, j, info1; + double amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + double diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + int *perm = NULL; + + /* External functions */ + extern double zlangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + mc64 = (options->RowPerm == LargeDiag); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = dlamch_("Safe minimum"); + bignum = 1. / smlnum; + } + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_Z || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_Z || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_Z || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("zgsisx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + zCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact ) { + register int i, j; + NCformat *Astore = AA->Store; + int nnz = Astore->nnz; + int *colptr = Astore->colptr; + int *rowind = Astore->rowind; + doublecomplex *nzval = (doublecomplex *)Astore->nzval; + int n = AA->nrow; + + if ( mc64 ) { + *equed = 'B'; + /*rowequ = colequ = 1;*/ + t0 = SuperLU_timer_(); + if ((perm = intMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for perm[]"); + + info1 = zldperm(5, n, nnz, colptr, rowind, nzval, perm, R, C); + + if (info1 > 0) { /* MC64 fails, call zgsequ() later */ + mc64 = 0; + SUPERLU_FREE(perm); + perm = NULL; + } else { + rowequ = colequ = 1; + for (i = 0; i < n; i++) { + R[i] = exp(R[i]); + C[i] = exp(C[i]); + } + /* permute and scale the matrix */ + for (j = 0; j < n; j++) { + for (i = colptr[j]; i < colptr[j + 1]; i++) { + zd_mult(&nzval[i], &nzval[i], R[rowind[i]] * C[j]); + rowind[i] = perm[rowind[i]]; + } + } + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + if ( !mc64 & equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + zgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + zlaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + zgsitrf(options, &AC, relax, panel_size, etree, work, lwork, + perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) return; + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = zPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = zlangs(norm, AA); + zgscon(norm, L, U, anorm, rcond, stat, &info1); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { /* Solve the system */ + doublecomplex *tmp, *rhs_work; + int n = A->nrow; + if ( mc64 ) { + if ((tmp = doublecomplexMalloc(n)) == NULL) + ABORT("SUPERLU_MALLOC fails for tmp[]"); + } + + /* Scale and permute the right-hand side if equilibration + and permutation from MC64 were performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) + zd_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], R[i]); + } + if ( mc64 ) { + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (i = 0; i < n; i++) tmp[perm[i]] = rhs_work[i]; + for (i = 0; i < n; i++) rhs_work[i] = tmp[i]; + } + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + zd_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], C[i]); + } + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + zgstrs (trant, L, U, perm_c, perm_r, X, stat, &info1); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original + system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + zd_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], C[i]); + } + } + } else { /* transposed system */ + if ( rowequ ) { + if ( mc64 ) { + for (j = 0; j < nrhs; j++) { + for (i = 0; i < n; i++) + tmp[i] = Xmat[i + j * ldx]; /*dcopy*/ + for (i = 0; i < n; i++) + zd_mult(&Xmat[i+j*ldx], &tmp[perm[i]], R[i]); + } + } else { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) { + zd_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], R[i]); + } + } + } + } + + if ( mc64 ) SUPERLU_FREE(tmp); + + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < dlamch_("E") && *info == 0) *info = A->ncol + 1; + } + + if (perm) SUPERLU_FREE(perm); + + if ( nofact ) { + ilu_zQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c new file mode 100644 index 0000000..298d598 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c @@ -0,0 +1,636 @@ + +/*! @file zgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.1) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +zgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + doublecomplex *zwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + doublecomplex *dense, *tempv; + double *dtempv; + int *relax_end, *relax_fsupc; + doublecomplex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double *amax; + doublecomplex drop_sum; + double alpha, omega; /* used in MILU, mimicing DRIC */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + double *dwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + doublecomplex zero = {0.0, 0.0}; + double one = 1.0; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = zLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &zwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + zSetRWork(m, panel_size, zwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (double *) doubleMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + dwork2 = (double *)doubleMalloc(n); + else + dwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + alpha = pow((double)n, -1.0 / options->ILU_MILU_Dim); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + dtempv = (double *) tempv; + i = ilu_zdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, dtempv, dwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_zsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = zLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register double tmp = z_abs1 (&a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + zsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_zpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_zpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + zpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_zcolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = zcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = zLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_zcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + dwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + if (drop_sum.r != 0.0 && drop_sum.i != 0.0) + { + omega = SUPERLU_MIN(2.0*(1.0-alpha)/z_abs1(&drop_sum), 1.0); + zd_mult(&drop_sum, &drop_sum, omega); + } + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_zpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + dtempv = (double *) tempv; + i = ilu_zdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, dtempv, dwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + zLUWorkFree(iwork, zwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + zCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_Z, SLU_TRLU); + zCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_Z, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( dwork2 ) SUPERLU_FREE (dwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c.bak new file mode 100644 index 0000000..a763c98 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgsitrf.c.bak @@ -0,0 +1,629 @@ + +/*! @file zgsitf.c + * \brief Computes an ILU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +#ifdef DEBUG +int num_drop_L; +#endif + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSITRF computes an ILU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *	   The structure defines the input parameters to control
    + *	   how the ILU decomposition will be performed.
    + *
    + * A	    (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *	    (A->nrow, A->ncol). The type of A can be:
    + *	    Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *	    To control degree of relaxing supernodes. If the number
    + *	    of nodes (columns) in a subtree of the elimination tree is less
    + *	    than relax, this subtree is considered as one supernode,
    + *	    regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *	    A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *	    Elimination tree of A'*A.
    + *	    Note: etree is a vector of parent pointers for a forest whose
    + *	    vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *	    On input, the columns of A should be permuted so that the
    + *	    etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *	    User-supplied work space and space for the output data structures.
    + *	    Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *	   Specifies the size of work array in bytes.
    + *	   = 0:  allocate space internally by system malloc;
    + *	   > 0:  use user-supplied work array of length lwork in bytes,
    + *		 returns error if space runs out.
    + *	   = -1: the routine guesses the amount of space needed without
    + *		 performing the factorization, and returns it in
    + *		 *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the
    + *	    permutation matrix Pc; perm_c[i] = j means column i of A is
    + *	    in position j in A*Pc.
    + *	    When searching for diagonal, perm_c[*] is applied to the
    + *	    row subscripts of A, so that diagonal threshold pivoting
    + *	    can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *	    Row permutation vector which defines the permutation matrix Pr,
    + *	    perm_r[i] = j means row i of A is in position j in Pr*A.
    + *	    If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *	       will try to use the input perm_r, unless a certain threshold
    + *	       criterion is violated. In that case, perm_r is overwritten by
    + *	       a new permutation determined by partial pivoting or diagonal
    + *	       threshold pivoting.
    + *	    Otherwise, perm_r is output argument;
    + *
    + * L	    (output) SuperMatrix*
    + *	    The factor L from the factorization Pr*A=L*U; use compressed row
    + *	    subscripts storage for supernodes, i.e., L has type:
    + *	    Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U	    (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *	    storage scheme, i.e., U has types: Stype = SLU_NC,
    + *	    Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *	    Record the statistics on runtime and floating-point operation count.
    + *	    See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *	    = 0: successful exit
    + *	    < 0: if info = -i, the i-th argument had an illegal value
    + *	    > 0: if info = i, and i is
    + *	       <= A->ncol: number of zero pivots. They are replaced by small
    + *		  entries according to options->ILU_FillTol.
    + *	       > A->ncol: number of bytes allocated when memory allocation
    + *		  failure occurred, plus A->ncol. If lwork = -1, it is
    + *		  the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays:
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 4 of them:
    + *	      marker/marker1 are used for panel dfs, see (ilu_)dpanel_dfs.c;
    + *	      marker2 is used for inner-factorization, see (ilu)_dcolumn_dfs.c;
    + *	      marker_relax(has its own space) is used for relaxed supernodes.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *	Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs)
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the
    + *	last column of a supernode.
    + *	The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a
    + *	supernodal representative r, repfnz[r] is the location of the first
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel.
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below
    + *	the panel diagonal. These are filled in during dpanel_dfs(), and are
    + *	used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *		   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_util.h.
    + *	It is also used by the dropping routine ilu_ddrop_row().
    + * 
    + */ + +void +zgsitrf(superlu_options_t *options, SuperMatrix *A, int relax, int panel_size, + int *etree, void *work, int lwork, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *swap, *iswap; /* swap is used to store the row permutation + during the factorization. Initially, it is set + to iperm_c (row indeces of Pc*A*Pc'). + iswap is the inverse of swap. After the + factorization, it is equal to perm_r. */ + int *iwork; + doublecomplex *zwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *marker, *marker_relax; + doublecomplex *dense, *tempv; + double *dtempv; + int *relax_end, *relax_fsupc; + doublecomplex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double *amax; + doublecomplex drop_sum; + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + int *iwork2; /* used by the second dropping rule */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + double drop_tol = options->ILU_DropTol; /* tau */ + double fill_ini = options->ILU_FillTol; /* tau^hat */ + double gamma = options->ILU_FillFactor; + int drop_rule = options->ILU_DropRule; + milu_t milu = options->ILU_MILU; + double fill_tol; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + int last_drop;/* the last column which the dropping rules applied */ + int quota; + int nnzAj; /* number of nonzeros in A(:,1:j) */ + int nnzLj, nnzUj; + double tol_L = drop_tol, tol_U = drop_tol; + doublecomplex zero = {0.0, 0.0}; + + /* Executable */ + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = zLUMemInit(fact, work, lwork, m, n, Astore->nnz, panel_size, + gamma, L, U, &Glu, &iwork, &zwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &marker_relax, &marker); + zSetRWork(m, panel_size, zwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + swap = (int *)intMalloc(n); + for (k = 0; k < n; k++) swap[k] = iperm_c[k]; + iswap = (int *)intMalloc(n); + for (k = 0; k < n; k++) iswap[k] = perm_c[k]; + amax = (double *) doubleMalloc(panel_size); + if (drop_rule & DROP_SECONDARY) + iwork2 = (int *)intMalloc(n); + else + iwork2 = NULL; + + nnzAj = 0; + nnzLj = 0; + nnzUj = 0; + last_drop = SUPERLU_MAX(min_mn - 2 * sp_ienv(7), (int)(min_mn * 0.95)); + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + relax_fsupc = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) + ilu_heap_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + else + ilu_relax_snode(n, etree, relax, marker, relax_end, relax_fsupc); + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* Mark the rows used by relaxed supernodes */ + ifill (marker_relax, m, EMPTY); + i = mark_relax(m, relax_end, relax_fsupc, xa_begin, xa_end, + asub, marker_relax); +#if ( PRNTlevel >= 1) + printf("%d relaxed supernodes.\n", i); +#endif + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* Drop small rows in the previous supernode. */ + if (jcol > 0 && jcol < last_drop) { + int first = xsup[supno[jcol - 1]]; + int last = jcol - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / min_mn); + + /* Drop small rows */ + dtempv = (double *) tempv; + i = ilu_zdrop_row(options, first, last, tol_L, quota, &nnzLj, + &fill_tol, &Glu, dtempv, iwork2, 0); + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = ilu_zsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ((*info = zLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu))) + return; + } + + for (icol = jcol; icol <= kcol; icol++) { + xusub[icol+1] = nextu; + + amax[0] = 0.0; + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) { + register double tmp = z_abs1 (&a[k]); + if (tmp > amax[0]) amax[0] = tmp; + dense[asub[k]] = a[k]; + } + nnzAj += xa_end[icol] - xa_begin[icol]; + if (amax[0] == 0.0) { + amax[0] = fill_ini; +#if ( PRNTlevel >= 1) + printf("Column %d is entirely zero!\n", icol); + fflush(stdout); +#endif + } + + /* Numeric update within the snode */ + zsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if (usepr) pivrow = iperm_r[icol]; + fill_tol = pow(fill_ini, 1.0 - (double)icol / (double)min_mn); + if ( (*info = ilu_zpivotL(icol, diag_pivot_thresh, &usepr, + perm_r, iperm_c[icol], swap, iswap, + marker_relax, &pivrow, + amax[0] * fill_tol, milu, zero, + &Glu, stat)) ) { + iinfo++; + marker[pivrow] = kcol; + } + + } + + jcol = kcol + 1; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + ilu_zpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, amax, panel_lsub, segrep, repfnz, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + zpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for (jj = jcol; jj < jcol + panel_size; jj++) { + + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + nnzAj += xa_end[jj] - xa_begin[jj]; + + if ((*info = ilu_zcolumn_dfs(m, jj, perm_r, &nseg, + &panel_lsub[k], segrep, &repfnz[k], + marker, parent, xplore, &Glu))) + return; + + /* Numeric updates */ + if ((*info = zcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Make a fill-in position if the column is entirely zero */ + if (xlsub[jj + 1] == xlsub[jj]) { + register int i, row; + int nextl; + int nzlmax = Glu.nzlmax; + int *lsub = Glu.lsub; + int *marker2 = marker + 2 * m; + + /* Allocate memory */ + nextl = xlsub[jj] + 1; + if (nextl >= nzlmax) { + int error = zLUMemXpand(jj, nextl, LSUB, &nzlmax, &Glu); + if (error) { *info = error; return; } + lsub = Glu.lsub; + } + xlsub[jj + 1]++; + assert(xlusup[jj]==xlusup[jj+1]); + xlusup[jj + 1]++; + Glu.lusup[xlusup[jj]] = zero; + + /* Choose a row index (pivrow) for fill-in */ + for (i = jj; i < n; i++) + if (marker_relax[swap[i]] <= jj) break; + row = swap[i]; + marker2[row] = jj; + lsub[xlsub[jj]] = row; +#ifdef DEBUG + printf("Fill col %d.\n", jj); + fflush(stdout); +#endif + } + + /* Computer the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * jj / m; + else if (drop_rule & DROP_COLUMN) + quota = gamma * (xa_end[jj] - xa_begin[jj]) * + (jj + 1) / m; + else if (drop_rule & DROP_AREA) + quota = gamma * 0.9 * nnzAj * 0.5 - nnzUj; + else + quota = m; + + /* Copy the U-segments to ucol[*] and drop small entries */ + if ((*info = ilu_zcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], drop_rule, + milu, amax[jj - jcol] * tol_U, + quota, &drop_sum, &nnzUj, &Glu, + iwork2)) != 0) + return; + + /* Reset the dropping threshold if required */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * 0.9 * nnzAj * 0.5 < nnzLj) + tol_U = SUPERLU_MIN(1.0, tol_U * 2.0); + else + tol_U = SUPERLU_MAX(drop_tol, tol_U * 0.5); + } + + zd_mult(&drop_sum, &drop_sum, MILU_ALPHA); + if (usepr) pivrow = iperm_r[jj]; + fill_tol = pow(fill_ini, 1.0 - (double)jj / (double)min_mn); + if ( (*info = ilu_zpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_c[jj], swap, iswap, + marker_relax, &pivrow, + amax[jj - jcol] * fill_tol, milu, + drop_sum, &Glu, stat)) ) { + iinfo++; + marker[m + pivrow] = jj; + marker[2 * m + pivrow] = jj; + } + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + + /* Start a new supernode, drop the previous one */ + if (jj > 0 && supno[jj] > supno[jj - 1] && jj < last_drop) { + int first = xsup[supno[jj - 1]]; + int last = jj - 1; + int quota; + + /* Compute the quota */ + if (drop_rule & DROP_PROWS) + quota = gamma * Astore->nnz / m * (m - first) / m + * (last - first + 1); + else if (drop_rule & DROP_COLUMN) { + int i; + quota = 0; + for (i = first; i <= last; i++) + quota += xa_end[i] - xa_begin[i]; + quota = gamma * quota * (m - first) / m; + } else if (drop_rule & DROP_AREA) + quota = gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) + / m) - nnzLj; + else + quota = m * n; + fill_tol = pow(fill_ini, 1.0 - 0.5 * (first + last) / + (double)min_mn); + + /* Drop small rows */ + dtempv = (double *) tempv; + i = ilu_zdrop_row(options, first, last, tol_L, quota, + &nnzLj, &fill_tol, &Glu, dtempv, iwork2, + 1); + + /* Reset the parameters */ + if (drop_rule & DROP_DYNAMIC) { + if (gamma * nnzAj * (1.0 - 0.5 * (last + 1.0) / m) + < nnzLj) + tol_L = SUPERLU_MIN(1.0, tol_L * 2.0); + else + tol_L = SUPERLU_MAX(drop_tol, tol_L * 0.5); + } + if (fill_tol < 0) iinfo -= (int)fill_tol; +#ifdef DEBUG + num_drop_L += i * (last - first + 1); +#endif + } /* if start a new supernode */ + + } /* for */ + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + ilu_countnz(min_mn, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + zLUWorkFree(iwork, zwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + zCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_Z, SLU_TRLU); + zCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_Z, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + SUPERLU_FREE (swap); + SUPERLU_FREE (iswap); + SUPERLU_FREE (relax_fsupc); + SUPERLU_FREE (amax); + if ( iwork2 ) SUPERLU_FREE (iwork2); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgsrfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgsrfs.c new file mode 100644 index 0000000..2ed0481 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgsrfs.c @@ -0,0 +1,460 @@ + +/*! @file zgsrfs.c + * \brief Improves computed solution to a system of inear equations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Modified from lapack routine ZGERFS
    + * 
    + */ +/* + * File name: zgsrfs.c + * History: Modified from lapack routine ZGERFS + */ +#include +#include "slu_zdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   ZGSRFS improves the computed solution to a system of linear   
    + *   equations and provides error bounds and backward error estimates for 
    + *   the solution.   
    + *
    + *   If equilibration was performed, the system becomes:
    + *           (diag(R)*A_original*diag(C)) * X = diag(R)*B_original.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *   
    + *   A       (input) SuperMatrix*
    + *           The original matrix A in the system, or the scaled A if
    + *           equilibration was done. The type of A can be:
    + *           Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_GE.
    + *    
    + *   L       (input) SuperMatrix*
    + *	     The factor L from the factorization Pr*A*Pc=L*U. Use
    + *           compressed row subscripts storage for supernodes, 
    + *           i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + * 
    + *   U       (input) SuperMatrix*
    + *           The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *           zgstrf(). Use column-wise storage scheme, 
    + *           i.e., U has types: Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + *   perm_c  (input) int*, dimension (A->ncol)
    + *	     Column permutation vector, which defines the 
    + *           permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *           in position j in A*Pc.
    + *
    + *   perm_r  (input) int*, dimension (A->nrow)
    + *           Row permutation vector, which defines the permutation matrix Pr;
    + *           perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + *   equed   (input) Specifies the form of equilibration that was done.
    + *           = 'N': No equilibration.
    + *           = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *           = 'C': Column equilibration, i.e., A was postmultiplied by
    + *                  diag(C).
    + *           = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                  by diag(R)*A*diag(C).
    + *
    + *   R       (input) double*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *           If equed = 'R' or 'B', A is premultiplied by diag(R).
    + *           If equed = 'N' or 'C', R is not accessed.
    + * 
    + *   C       (input) double*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *           If equed = 'C' or 'B', A is postmultiplied by diag(C).
    + *           If equed = 'N' or 'R', C is not accessed.
    + *
    + *   B       (input) SuperMatrix*
    + *           B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *           The right hand side matrix B.
    + *           if equed = 'R' or 'B', B is premultiplied by diag(R).
    + *
    + *   X       (input/output) SuperMatrix*
    + *           X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *           On entry, the solution matrix X, as computed by zgstrs().
    + *           On exit, the improved solution matrix X.
    + *           if *equed = 'C' or 'B', X should be premultiplied by diag(C)
    + *               in order to obtain the solution to the original system.
    + *
    + *   FERR    (output) double*, dimension (B->ncol)   
    + *           The estimated forward error bound for each solution vector   
    + *           X(j) (the j-th column of the solution matrix X).   
    + *           If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *           is an estimated upper bound for the magnitude of the largest 
    + *           element in (X(j) - XTRUE) divided by the magnitude of the   
    + *           largest element in X(j).  The estimate is as reliable as   
    + *           the estimate for RCOND, and is almost always a slight   
    + *           overestimate of the true error.
    + *
    + *   BERR    (output) double*, dimension (B->ncol)   
    + *           The componentwise relative backward error of each solution   
    + *           vector X(j) (i.e., the smallest relative change in   
    + *           any element of A or B that makes X(j) an exact solution).
    + *
    + *   stat     (output) SuperLUStat_t*
    + *            Record the statistics on runtime and floating-point operation count.
    + *            See util.h for the definition of 'SuperLUStat_t'.
    + *
    + *   info    (output) int*   
    + *           = 0:  successful exit   
    + *            < 0:  if INFO = -i, the i-th argument had an illegal value   
    + *
    + *    Internal Parameters   
    + *    ===================   
    + *
    + *    ITMAX is the maximum number of steps of iterative refinement.   
    + *
    + * 
    + */ +void +zgsrfs(trans_t trans, SuperMatrix *A, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, char *equed, double *R, double *C, + SuperMatrix *B, SuperMatrix *X, double *ferr, double *berr, + SuperLUStat_t *stat, int *info) +{ + + +#define ITMAX 5 + + /* Table of constant values */ + int ione = 1; + doublecomplex ndone = {-1., 0.}; + doublecomplex done = {1., 0.}; + + /* Local variables */ + NCformat *Astore; + doublecomplex *Aval; + SuperMatrix Bjcol; + DNformat *Bstore, *Xstore, *Bjcol_store; + doublecomplex *Bmat, *Xmat, *Bptr, *Xptr; + int kase; + double safe1, safe2; + int i, j, k, irow, nz, count, notran, rowequ, colequ; + int ldb, ldx, nrhs; + double s, xk, lstres, eps, safmin; + char transc[1]; + trans_t transt; + doublecomplex *work; + double *rwork; + int *iwork; + + extern int zlacon_(int *, doublecomplex *, doublecomplex *, double *, int *); +#ifdef _CRAY + extern int CCOPY(int *, doublecomplex *, int *, doublecomplex *, int *); + extern int CSAXPY(int *, doublecomplex *, doublecomplex *, int *, doublecomplex *, int *); +#else + extern int zcopy_(int *, doublecomplex *, int *, doublecomplex *, int *); + extern int zaxpy_(int *, doublecomplex *, doublecomplex *, int *, doublecomplex *, int *); +#endif + + Astore = A->Store; + Aval = Astore->nzval; + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + /* Test the input parameters */ + *info = 0; + notran = (trans == NOTRANS); + if ( !notran && trans != TRANS && trans != CONJ ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + A->Stype != SLU_NC || A->Dtype != SLU_Z || A->Mtype != SLU_GE ) + *info = -2; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_Z || L->Mtype != SLU_TRLU ) + *info = -3; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_Z || U->Mtype != SLU_TRU ) + *info = -4; + else if ( ldb < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_Z || B->Mtype != SLU_GE ) + *info = -10; + else if ( ldx < SUPERLU_MAX(0, A->nrow) || + X->Stype != SLU_DN || X->Dtype != SLU_Z || X->Mtype != SLU_GE ) + *info = -11; + if (*info != 0) { + i = -(*info); + xerbla_("zgsrfs", &i); + return; + } + + /* Quick return if possible */ + if ( A->nrow == 0 || nrhs == 0) { + for (j = 0; j < nrhs; ++j) { + ferr[j] = 0.; + berr[j] = 0.; + } + return; + } + + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + + /* Allocate working space */ + work = doublecomplexMalloc(2*A->nrow); + rwork = (double *) SUPERLU_MALLOC( A->nrow * sizeof(double) ); + iwork = intMalloc(A->nrow); + if ( !work || !rwork || !iwork ) + ABORT("Malloc fails for work/rwork/iwork."); + + if ( notran ) { + *(unsigned char *)transc = 'N'; + transt = TRANS; + } else { + *(unsigned char *)transc = 'T'; + transt = NOTRANS; + } + + /* NZ = maximum number of nonzero elements in each row of A, plus 1 */ + nz = A->ncol + 1; + eps = dlamch_("Epsilon"); + safmin = dlamch_("Safe minimum"); + /* Set SAFE1 essentially to be the underflow threshold times the + number of additions in each row. */ + safe1 = nz * safmin; + safe2 = safe1 / eps; + + /* Compute the number of nonzeros in each row (or column) of A */ + for (i = 0; i < A->nrow; ++i) iwork[i] = 0; + if ( notran ) { + for (k = 0; k < A->ncol; ++k) + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + ++iwork[Astore->rowind[i]]; + } else { + for (k = 0; k < A->ncol; ++k) + iwork[k] = Astore->colptr[k+1] - Astore->colptr[k]; + } + + /* Copy one column of RHS B into Bjcol. */ + Bjcol.Stype = B->Stype; + Bjcol.Dtype = B->Dtype; + Bjcol.Mtype = B->Mtype; + Bjcol.nrow = B->nrow; + Bjcol.ncol = 1; + Bjcol.Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !Bjcol.Store ) ABORT("SUPERLU_MALLOC fails for Bjcol.Store"); + Bjcol_store = Bjcol.Store; + Bjcol_store->lda = ldb; + Bjcol_store->nzval = work; /* address aliasing */ + + /* Do for each right hand side ... */ + for (j = 0; j < nrhs; ++j) { + count = 0; + lstres = 3.; + Bptr = &Bmat[j*ldb]; + Xptr = &Xmat[j*ldx]; + + while (1) { /* Loop until stopping criterion is satisfied. */ + + /* Compute residual R = B - op(A) * X, + where op(A) = A, A**T, or A**H, depending on TRANS. */ + +#ifdef _CRAY + CCOPY(&A->nrow, Bptr, &ione, work, &ione); +#else + zcopy_(&A->nrow, Bptr, &ione, work, &ione); +#endif + sp_zgemv(transc, ndone, A, Xptr, ione, done, work, ione); + + /* Compute componentwise relative backward error from formula + max(i) ( abs(R(i)) / ( abs(op(A))*abs(X) + abs(B) )(i) ) + where abs(Z) is the componentwise absolute value of the matrix + or vector Z. If the i-th component of the denominator is less + than SAFE2, then SAFE1 is added to the i-th component of the + numerator before dividing. */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = z_abs1( &Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if (notran) { + for (k = 0; k < A->ncol; ++k) { + xk = z_abs1( &Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += z_abs1(&Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + s += z_abs1(&Aval[i]) * z_abs1(&Xptr[irow]); + } + rwork[k] += s; + } + } + s = 0.; + for (i = 0; i < A->nrow; ++i) { + if (rwork[i] > safe2) { + s = SUPERLU_MAX( s, z_abs1(&work[i]) / rwork[i] ); + } else if ( rwork[i] != 0.0 ) { + s = SUPERLU_MAX( s, (z_abs1(&work[i]) + safe1) / rwork[i] ); + } + /* If rwork[i] is exactly 0.0, then we know the true + residual also must be exactly 0.0. */ + } + berr[j] = s; + + /* Test stopping criterion. Continue iterating if + 1) The residual BERR(J) is larger than machine epsilon, and + 2) BERR(J) decreased by at least a factor of 2 during the + last iteration, and + 3) At most ITMAX iterations tried. */ + + if (berr[j] > eps && berr[j] * 2. <= lstres && count < ITMAX) { + /* Update solution and try again. */ + zgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + +#ifdef _CRAY + CAXPY(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#else + zaxpy_(&A->nrow, &done, work, &ione, + &Xmat[j*ldx], &ione); +#endif + lstres = berr[j]; + ++count; + } else { + break; + } + + } /* end while */ + + stat->RefineSteps = count; + + /* Bound error from formula: + norm(X - XTRUE) / norm(X) .le. FERR = norm( abs(inv(op(A)))* + ( abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) / norm(X) + where + norm(Z) is the magnitude of the largest component of Z + inv(op(A)) is the inverse of op(A) + abs(Z) is the componentwise absolute value of the matrix or + vector Z + NZ is the maximum number of nonzeros in any row of A, plus 1 + EPS is machine epsilon + + The i-th component of abs(R)+NZ*EPS*(abs(op(A))*abs(X)+abs(B)) + is incremented by SAFE1 if the i-th component of + abs(op(A))*abs(X) + abs(B) is less than SAFE2. + + Use ZLACON to estimate the infinity-norm of the matrix + inv(op(A)) * diag(W), + where W = abs(R) + NZ*EPS*( abs(op(A))*abs(X)+abs(B) ))) */ + + for (i = 0; i < A->nrow; ++i) rwork[i] = z_abs1( &Bptr[i] ); + + /* Compute abs(op(A))*abs(X) + abs(B). */ + if ( notran ) { + for (k = 0; k < A->ncol; ++k) { + xk = z_abs1( &Xptr[k] ); + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) + rwork[Astore->rowind[i]] += z_abs1(&Aval[i]) * xk; + } + } else { + for (k = 0; k < A->ncol; ++k) { + s = 0.; + for (i = Astore->colptr[k]; i < Astore->colptr[k+1]; ++i) { + irow = Astore->rowind[i]; + xk = z_abs1( &Xptr[irow] ); + s += z_abs1(&Aval[i]) * xk; + } + rwork[k] += s; + } + } + + for (i = 0; i < A->nrow; ++i) + if (rwork[i] > safe2) + rwork[i] = z_abs(&work[i]) + (iwork[i]+1)*eps*rwork[i]; + else + rwork[i] = z_abs(&work[i])+(iwork[i]+1)*eps*rwork[i]+safe1; + kase = 0; + + do { + zlacon_(&A->nrow, &work[A->nrow], work, + &ferr[j], &kase); + if (kase == 0) break; + + if (kase == 1) { + /* Multiply by diag(W)*inv(op(A)**T)*(diag(C) or diag(R)). */ + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) { + zd_mult(&work[i], &work[i], C[i]); + } + else if ( !notran && rowequ ) + for (i = 0; i < A->nrow; ++i) { + zd_mult(&work[i], &work[i], R[i]); + } + + zgstrs (transt, L, U, perm_c, perm_r, &Bjcol, stat, info); + + for (i = 0; i < A->nrow; ++i) { + zd_mult(&work[i], &work[i], rwork[i]); + } + } else { + /* Multiply by (diag(C) or diag(R))*inv(op(A))*diag(W). */ + for (i = 0; i < A->nrow; ++i) { + zd_mult(&work[i], &work[i], rwork[i]); + } + + zgstrs (trans, L, U, perm_c, perm_r, &Bjcol, stat, info); + + if ( notran && colequ ) + for (i = 0; i < A->ncol; ++i) { + zd_mult(&work[i], &work[i], C[i]); + } + else if ( !notran && rowequ ) + for (i = 0; i < A->ncol; ++i) { + zd_mult(&work[i], &work[i], R[i]); + } + } + + } while ( kase != 0 ); + + /* Normalize error. */ + lstres = 0.; + if ( notran && colequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, C[i] * z_abs1( &Xptr[i]) ); + } else if ( !notran && rowequ ) { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, R[i] * z_abs1( &Xptr[i]) ); + } else { + for (i = 0; i < A->nrow; ++i) + lstres = SUPERLU_MAX( lstres, z_abs1( &Xptr[i]) ); + } + if ( lstres != 0. ) + ferr[j] /= lstres; + + } /* for each RHS j ... */ + + SUPERLU_FREE(work); + SUPERLU_FREE(rwork); + SUPERLU_FREE(iwork); + SUPERLU_FREE(Bjcol.Store); + + return; + +} /* zgsrfs */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgssv.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgssv.c new file mode 100644 index 0000000..aceb10d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgssv.c @@ -0,0 +1,227 @@ + +/*! @file zgssv.c + * \brief Solves the system of linear equations A*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSSV solves the system of linear equations A*X=B, using the
    + * LU factorization from ZGSTRF. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *
    + *      1.1. Permute the columns of A, forming A*Pc, where Pc
    + *           is a permutation matrix. For more details of this step, 
    + *           see sp_preorder.c.
    + *
    + *      1.2. Factor A as Pr*A*Pc=L*U with the permutation Pr determined
    + *           by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      1.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the
    + *      above algorithm to the transpose of A:
    + *
    + *      2.1. Permute columns of transpose(A) (rows of A),
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix. 
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.2. Factor A as Pr*transpose(A)*Pc=L*U with the permutation Pr
    + *           determined by Gaussian elimination with partial pivoting.
    + *           L is unit lower triangular with offdiagonal entries
    + *           bounded by 1 in magnitude, and U is upper triangular.
    + *
    + *      2.3. Solve the system of equations A*X=B using the factored
    + *           form of A.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + * 
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR; Dtype = SLU_Z; Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + * perm_c  (input/output) int*
    + *         If A->Stype = SLU_NC, column permutation vector of size A->ncol
    + *         which defines the permutation matrix Pc; perm_c[i] = j means 
    + *         column i of A is in position j in A*Pc.
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + *         If options->ColPerm = MY_PERMC or options->Fact = SamePattern or
    + *            options->Fact = SamePattern_SameRowPerm, it is an input argument.
    + *            On exit, perm_c may be overwritten by the product of the input
    + *            perm_c and a permutation that postorders the elimination tree
    + *            of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *            is already in postorder.
    + *         Otherwise, it is an output argument.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined 
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->RowPerm = MY_PERMR or
    + *            options->Fact = SamePattern_SameRowPerm, perm_r is an
    + *            input argument.
    + *         otherwise it is an output argument.
    + *
    + * L       (output) SuperMatrix*
    + *         The factor L from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *         
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization 
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *	   = 0: successful exit
    + *         > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                so the solution could not be computed.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol.
    + * 
    + */ + +void +zgssv(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + SuperMatrix *L, SuperMatrix *U, SuperMatrix *B, + SuperLUStat_t *stat, int *info ) +{ + + DNformat *Bstore; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int lwork = 0, *etree, i; + + /* Set default values for some parameters */ + int panel_size; /* panel size */ + int relax; /* no of columns in a relaxed snodes */ + int permc_spec; + trans_t trans = NOTRANS; + double *utime; + double t; /* Temporary time */ + + /* Test the input parameters ... */ + *info = 0; + Bstore = B->Store; + if ( options->Fact != DOFACT ) *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_Z || A->Mtype != SLU_GE ) + *info = -2; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_Z || B->Mtype != SLU_GE ) + *info = -7; + if ( *info != 0 ) { + i = -(*info); + xerbla_("zgssv", &i); + return; + } + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + zCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + trans = TRANS; + } else { + if ( A->Stype == SLU_NC ) AA = A; + } + + t = SuperLU_timer_(); + /* + * Get column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t; + + etree = intMalloc(A->ncol); + + t = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t; + + panel_size = sp_ienv(1); + relax = sp_ienv(2); + + /*printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4));*/ + t = SuperLU_timer_(); + /* Compute the LU factorization of A. */ + zgstrf(options, &AC, relax, panel_size, etree, + NULL, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t; + + t = SuperLU_timer_(); + if ( *info == 0 ) { + /* Solve the system A*X=B, overwriting B with X. */ + zgstrs (trans, L, U, perm_c, perm_r, B, stat, info); + } + utime[SOLVE] = SuperLU_timer_() - t; + + SUPERLU_FREE (etree); + Destroy_CompCol_Permuted(&AC); + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgssvx.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgssvx.c new file mode 100644 index 0000000..55be900 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgssvx.c @@ -0,0 +1,614 @@ + +/*! @file zgssvx.c + * \brief Solves the system of linear equations A*X=B or A'*X=B + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSSVX solves the system of linear equations A*X=B or A'*X=B, using
    + * the LU factorization from zgstrf(). Error bounds on the solution and
    + * a condition estimate are also provided. It performs the following steps:
    + *
    + *   1. If A is stored column-wise (A->Stype = SLU_NC):
    + *  
    + *      1.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A is
    + *           overwritten by diag(R)*A*diag(C) and B by diag(R)*B
    + *           (if options->Trans=NOTRANS) or diag(C)*B (if options->Trans
    + *           = TRANS or CONJ).
    + *
    + *      1.2. Permute columns of A, forming A*Pc, where Pc is a permutation
    + *           matrix that usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      1.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the matrix A (after equilibration if options->Equil = YES)
    + *           as Pr*A*Pc = L*U, with Pr determined by partial pivoting.
    + *
    + *      1.4. Compute the reciprocal pivot growth factor.
    + *
    + *      1.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form of 
    + *           A is used to estimate the condition number of the matrix A. If
    + *           the reciprocal of the condition number is less than machine
    + *           precision, info = A->ncol+1 is returned as a warning, but the
    + *           routine still goes on to solve for X and computes error bounds
    + *           as described below.
    + *
    + *      1.6. The system of equations is solved for X using the factored form
    + *           of A.
    + *
    + *      1.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      1.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R)
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   2. If A is stored row-wise (A->Stype = SLU_NR), apply the above algorithm
    + *      to the transpose of A:
    + *
    + *      2.1. If options->Equil = YES, scaling factors are computed to
    + *           equilibrate the system:
    + *           options->Trans = NOTRANS:
    + *               diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B
    + *           options->Trans = TRANS:
    + *               (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
    + *           options->Trans = CONJ:
    + *               (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
    + *           Whether or not the system will be equilibrated depends on the
    + *           scaling of the matrix A, but if equilibration is used, A' is
    + *           overwritten by diag(R)*A'*diag(C) and B by diag(R)*B 
    + *           (if trans='N') or diag(C)*B (if trans = 'T' or 'C').
    + *
    + *      2.2. Permute columns of transpose(A) (rows of A), 
    + *           forming transpose(A)*Pc, where Pc is a permutation matrix that 
    + *           usually preserves sparsity.
    + *           For more details of this step, see sp_preorder.c.
    + *
    + *      2.3. If options->Fact != FACTORED, the LU decomposition is used to
    + *           factor the transpose(A) (after equilibration if 
    + *           options->Fact = YES) as Pr*transpose(A)*Pc = L*U with the
    + *           permutation Pr determined by partial pivoting.
    + *
    + *      2.4. Compute the reciprocal pivot growth factor.
    + *
    + *      2.5. If some U(i,i) = 0, so that U is exactly singular, then the
    + *           routine returns with info = i. Otherwise, the factored form 
    + *           of transpose(A) is used to estimate the condition number of the
    + *           matrix A. If the reciprocal of the condition number
    + *           is less than machine precision, info = A->nrow+1 is returned as
    + *           a warning, but the routine still goes on to solve for X and
    + *           computes error bounds as described below.
    + *
    + *      2.6. The system of equations is solved for X using the factored form
    + *           of transpose(A).
    + *
    + *      2.7. If options->IterRefine != NOREFINE, iterative refinement is
    + *           applied to improve the computed solution matrix and calculate
    + *           error bounds and backward error estimates for it.
    + *
    + *      2.8. If equilibration was used, the matrix X is premultiplied by
    + *           diag(C) (if options->Trans = NOTRANS) or diag(R) 
    + *           (if options->Trans = TRANS or CONJ) so that it solves the
    + *           original system before equilibration.
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed and how the
    + *         system will be solved.
    + *
    + * A       (input/output) SuperMatrix*
    + *         Matrix A in A*X=B, of dimension (A->nrow, A->ncol). The number
    + *         of the linear equations is A->nrow. Currently, the type of A can be:
    + *         Stype = SLU_NC or SLU_NR, Dtype = SLU_D, Mtype = SLU_GE.
    + *         In the future, more general A may be handled.
    + *
    + *         On entry, If options->Fact = FACTORED and equed is not 'N', 
    + *         then A must have been equilibrated by the scaling factors in
    + *         R and/or C.  
    + *         On exit, A is not modified if options->Equil = NO, or if 
    + *         options->Equil = YES but equed = 'N' on exit.
    + *         Otherwise, if options->Equil = YES and equed is not 'N',
    + *         A is scaled as follows:
    + *         If A->Stype = SLU_NC:
    + *           equed = 'R':  A := diag(R) * A
    + *           equed = 'C':  A := A * diag(C)
    + *           equed = 'B':  A := diag(R) * A * diag(C).
    + *         If A->Stype = SLU_NR:
    + *           equed = 'R':  transpose(A) := diag(R) * transpose(A)
    + *           equed = 'C':  transpose(A) := transpose(A) * diag(C)
    + *           equed = 'B':  transpose(A) := diag(R) * transpose(A) * diag(C).
    + *
    + * perm_c  (input/output) int*
    + *	   If A->Stype = SLU_NC, Column permutation vector of size A->ncol,
    + *         which defines the permutation matrix Pc; perm_c[i] = j means
    + *         column i of A is in position j in A*Pc.
    + *         On exit, perm_c may be overwritten by the product of the input
    + *         perm_c and a permutation that postorders the elimination tree
    + *         of Pc'*A'*A*Pc; perm_c is not changed if the elimination tree
    + *         is already in postorder.
    + *
    + *         If A->Stype = SLU_NR, column permutation vector of size A->nrow,
    + *         which describes permutation of columns of transpose(A) 
    + *         (rows of A) as described above.
    + * 
    + * perm_r  (input/output) int*
    + *         If A->Stype = SLU_NC, row permutation vector of size A->nrow, 
    + *         which defines the permutation matrix Pr, and is determined
    + *         by partial pivoting.  perm_r[i] = j means row i of A is in 
    + *         position j in Pr*A.
    + *
    + *         If A->Stype = SLU_NR, permutation vector of size A->ncol, which
    + *         determines permutation of rows of transpose(A)
    + *         (columns of A) as described above.
    + *
    + *         If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *         will try to use the input perm_r, unless a certain threshold
    + *         criterion is violated. In that case, perm_r is overwritten by a
    + *         new permutation determined by partial pivoting or diagonal
    + *         threshold pivoting.
    + *         Otherwise, perm_r is output argument.
    + * 
    + * etree   (input/output) int*,  dimension (A->ncol)
    + *         Elimination tree of Pc'*A'*A*Pc.
    + *         If options->Fact != FACTORED and options->Fact != DOFACT,
    + *         etree is an input argument, otherwise it is an output argument.
    + *         Note: etree is a vector of parent pointers for a forest whose
    + *         vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *
    + * equed   (input/output) char*
    + *         Specifies the form of equilibration that was done.
    + *         = 'N': No equilibration.
    + *         = 'R': Row equilibration, i.e., A was premultiplied by diag(R).
    + *         = 'C': Column equilibration, i.e., A was postmultiplied by diag(C).
    + *         = 'B': Both row and column equilibration, i.e., A was replaced 
    + *                by diag(R)*A*diag(C).
    + *         If options->Fact = FACTORED, equed is an input argument,
    + *         otherwise it is an output argument.
    + *
    + * R       (input/output) double*, dimension (A->nrow)
    + *         The row scale factors for A or transpose(A).
    + *         If equed = 'R' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the left by diag(R).
    + *         If equed = 'N' or 'C', R is not accessed.
    + *         If options->Fact = FACTORED, R is an input argument,
    + *             otherwise, R is output.
    + *         If options->zFact = FACTORED and equed = 'R' or 'B', each element
    + *             of R must be positive.
    + * 
    + * C       (input/output) double*, dimension (A->ncol)
    + *         The column scale factors for A or transpose(A).
    + *         If equed = 'C' or 'B', A (if A->Stype = SLU_NC) or transpose(A)
    + *             (if A->Stype = SLU_NR) is multiplied on the right by diag(C).
    + *         If equed = 'N' or 'R', C is not accessed.
    + *         If options->Fact = FACTORED, C is an input argument,
    + *             otherwise, C is output.
    + *         If options->Fact = FACTORED and equed = 'C' or 'B', each element
    + *             of C must be positive.
    + *         
    + * L       (output) SuperMatrix*
    + *	   The factor L from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype SLU_= NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses compressed row subscripts storage for supernodes, i.e.,
    + *         L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U       (output) SuperMatrix*
    + *	   The factor U from the factorization
    + *             Pr*A*Pc=L*U              (if A->Stype = SLU_NC) or
    + *             Pr*transpose(A)*Pc=L*U   (if A->Stype = SLU_NR).
    + *         Uses column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * work    (workspace/output) void*, size (lwork) (in bytes)
    + *         User supplied workspace, should be large enough
    + *         to hold data structures for factors L and U.
    + *         On exit, if fact is not 'F', L and U point to this array.
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               mem_usage->total_needed; no other side effects.
    + *
    + *         See argument 'mem_usage' for memory usage statistics.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         If B->ncol = 0, only LU decomposition is performed, the triangular
    + *                         solve is skipped.
    + *         On exit,
    + *            if equed = 'N', B is not modified; otherwise
    + *            if A->Stype = SLU_NC:
    + *               if options->Trans = NOTRANS and equed = 'R' or 'B',
    + *                  B is overwritten by diag(R)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'C' of 'B',
    + *                  B is overwritten by diag(C)*B;
    + *            if A->Stype = SLU_NR:
    + *               if options->Trans = NOTRANS and equed = 'C' or 'B',
    + *                  B is overwritten by diag(C)*B;
    + *               if options->Trans = TRANS or CONJ and equed = 'R' of 'B',
    + *                  B is overwritten by diag(R)*B.
    + *
    + * X       (output) SuperMatrix*
    + *         X has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE. 
    + *         If info = 0 or info = A->ncol+1, X contains the solution matrix
    + *         to the original system of equations. Note that A and B are modified
    + *         on exit if equed is not 'N', and the solution to the equilibrated
    + *         system is inv(diag(C))*X if options->Trans = NOTRANS and
    + *         equed = 'C' or 'B', or inv(diag(R))*X if options->Trans = 'T' or 'C'
    + *         and equed = 'R' or 'B'.
    + *
    + * recip_pivot_growth (output) double*
    + *         The reciprocal pivot growth factor max_j( norm(A_j)/norm(U_j) ).
    + *         The infinity norm is used. If recip_pivot_growth is much less
    + *         than 1, the stability of the LU factorization could be poor.
    + *
    + * rcond   (output) double*
    + *         The estimate of the reciprocal condition number of the matrix A
    + *         after equilibration (if done). If rcond is less than the machine
    + *         precision (in particular, if rcond = 0), the matrix is singular
    + *         to working precision. This condition is indicated by a return
    + *         code of info > 0.
    + *
    + * FERR    (output) double*, dimension (B->ncol)   
    + *         The estimated forward error bound for each solution vector   
    + *         X(j) (the j-th column of the solution matrix X).   
    + *         If XTRUE is the true solution corresponding to X(j), FERR(j) 
    + *         is an estimated upper bound for the magnitude of the largest 
    + *         element in (X(j) - XTRUE) divided by the magnitude of the   
    + *         largest element in X(j).  The estimate is as reliable as   
    + *         the estimate for RCOND, and is almost always a slight   
    + *         overestimate of the true error.
    + *         If options->IterRefine = NOREFINE, ferr = 1.0.
    + *
    + * BERR    (output) double*, dimension (B->ncol)
    + *         The componentwise relative backward error of each solution   
    + *         vector X(j) (i.e., the smallest relative change in   
    + *         any element of A or B that makes X(j) an exact solution).
    + *         If options->IterRefine = NOREFINE, berr = 1.0.
    + *
    + * mem_usage (output) mem_usage_t*
    + *         Record the memory usage statistics, consisting of following fields:
    + *         - for_lu (float)
    + *           The amount of space used in bytes for L\U data structures.
    + *         - total_needed (float)
    + *           The amount of space needed in bytes to perform factorization.
    + *         - expansions (int)
    + *           The number of memory expansions during the LU factorization.
    + *
    + * stat   (output) SuperLUStat_t*
    + *        Record the statistics on runtime and floating-point operation count.
    + *        See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + *         = 0: successful exit   
    + *         < 0: if info = -i, the i-th argument had an illegal value   
    + *         > 0: if info = i, and i is   
    + *              <= A->ncol: U(i,i) is exactly zero. The factorization has   
    + *                    been completed, but the factor U is exactly   
    + *                    singular, so the solution and error bounds   
    + *                    could not be computed.   
    + *              = A->ncol+1: U is nonsingular, but RCOND is less than machine
    + *                    precision, meaning that the matrix is singular to
    + *                    working precision. Nevertheless, the solution and
    + *                    error bounds are computed because there are a number
    + *                    of situations where the computed solution can be more
    + *                    accurate than the value of RCOND would suggest.   
    + *              > A->ncol+1: number of bytes allocated when memory allocation
    + *                    failure occurred, plus A->ncol.
    + * 
    + */ + +void +zgssvx(superlu_options_t *options, SuperMatrix *A, int *perm_c, int *perm_r, + int *etree, char *equed, double *R, double *C, + SuperMatrix *L, SuperMatrix *U, void *work, int lwork, + SuperMatrix *B, SuperMatrix *X, double *recip_pivot_growth, + double *rcond, double *ferr, double *berr, + mem_usage_t *mem_usage, SuperLUStat_t *stat, int *info ) +{ + + + DNformat *Bstore, *Xstore; + doublecomplex *Bmat, *Xmat; + int ldb, ldx, nrhs; + SuperMatrix *AA;/* A in SLU_NC format used by the factorization routine.*/ + SuperMatrix AC; /* Matrix postmultiplied by Pc */ + int colequ, equil, nofact, notran, rowequ, permc_spec; + trans_t trant; + char norm[1]; + int i, j, info1; + double amax, anorm, bignum, smlnum, colcnd, rowcnd, rcmax, rcmin; + int relax, panel_size; + double diag_pivot_thresh; + double t0; /* temporary time */ + double *utime; + + /* External functions */ + extern double zlangs(char *, SuperMatrix *); + + Bstore = B->Store; + Xstore = X->Store; + Bmat = Bstore->nzval; + Xmat = Xstore->nzval; + ldb = Bstore->lda; + ldx = Xstore->lda; + nrhs = B->ncol; + + *info = 0; + nofact = (options->Fact != FACTORED); + equil = (options->Equil == YES); + notran = (options->Trans == NOTRANS); + if ( nofact ) { + *(unsigned char *)equed = 'N'; + rowequ = FALSE; + colequ = FALSE; + } else { + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + smlnum = dlamch_("Safe minimum"); + bignum = 1. / smlnum; + } + +#if 0 +printf("dgssvx: Fact=%4d, Trans=%4d, equed=%c\n", + options->Fact, options->Trans, *equed); +#endif + + /* Test the input parameters */ + if (!nofact && options->Fact != DOFACT && options->Fact != SamePattern && + options->Fact != SamePattern_SameRowPerm && + !notran && options->Trans != TRANS && options->Trans != CONJ && + !equil && options->Equil != NO) + *info = -1; + else if ( A->nrow != A->ncol || A->nrow < 0 || + (A->Stype != SLU_NC && A->Stype != SLU_NR) || + A->Dtype != SLU_Z || A->Mtype != SLU_GE ) + *info = -2; + else if (options->Fact == FACTORED && + !(rowequ || colequ || lsame_(equed, "N"))) + *info = -6; + else { + if (rowequ) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, R[j]); + rcmax = SUPERLU_MAX(rcmax, R[j]); + } + if (rcmin <= 0.) *info = -7; + else if ( A->nrow > 0) + rowcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else rowcnd = 1.; + } + if (colequ && *info == 0) { + rcmin = bignum; + rcmax = 0.; + for (j = 0; j < A->nrow; ++j) { + rcmin = SUPERLU_MIN(rcmin, C[j]); + rcmax = SUPERLU_MAX(rcmax, C[j]); + } + if (rcmin <= 0.) *info = -8; + else if (A->nrow > 0) + colcnd = SUPERLU_MAX(rcmin,smlnum) / SUPERLU_MIN(rcmax,bignum); + else colcnd = 1.; + } + if (*info == 0) { + if ( lwork < -1 ) *info = -12; + else if ( B->ncol < 0 || Bstore->lda < SUPERLU_MAX(0, A->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_Z || + B->Mtype != SLU_GE ) + *info = -13; + else if ( X->ncol < 0 || Xstore->lda < SUPERLU_MAX(0, A->nrow) || + (B->ncol != 0 && B->ncol != X->ncol) || + X->Stype != SLU_DN || + X->Dtype != SLU_Z || X->Mtype != SLU_GE ) + *info = -14; + } + } + if (*info != 0) { + i = -(*info); + xerbla_("zgssvx", &i); + return; + } + + /* Initialization for factor parameters */ + panel_size = sp_ienv(1); + relax = sp_ienv(2); + diag_pivot_thresh = options->DiagPivotThresh; + + utime = stat->utime; + + /* Convert A to SLU_NC format when necessary. */ + if ( A->Stype == SLU_NR ) { + NRformat *Astore = A->Store; + AA = (SuperMatrix *) SUPERLU_MALLOC( sizeof(SuperMatrix) ); + zCreate_CompCol_Matrix(AA, A->ncol, A->nrow, Astore->nnz, + Astore->nzval, Astore->colind, Astore->rowptr, + SLU_NC, A->Dtype, A->Mtype); + if ( notran ) { /* Reverse the transpose argument. */ + trant = TRANS; + notran = 0; + } else { + trant = NOTRANS; + notran = 1; + } + } else { /* A->Stype == SLU_NC */ + trant = options->Trans; + AA = A; + } + + if ( nofact && equil ) { + t0 = SuperLU_timer_(); + /* Compute row and column scalings to equilibrate the matrix A. */ + zgsequ(AA, R, C, &rowcnd, &colcnd, &amax, &info1); + + if ( info1 == 0 ) { + /* Equilibrate matrix A. */ + zlaqgs(AA, R, C, rowcnd, colcnd, amax, equed); + rowequ = lsame_(equed, "R") || lsame_(equed, "B"); + colequ = lsame_(equed, "C") || lsame_(equed, "B"); + } + utime[EQUIL] = SuperLU_timer_() - t0; + } + + + if ( nofact ) { + + t0 = SuperLU_timer_(); + /* + * Gnet column permutation vector perm_c[], according to permc_spec: + * permc_spec = NATURAL: natural ordering + * permc_spec = MMD_AT_PLUS_A: minimum degree on structure of A'+A + * permc_spec = MMD_ATA: minimum degree on structure of A'*A + * permc_spec = COLAMD: approximate minimum degree column ordering + * permc_spec = MY_PERMC: the ordering already supplied in perm_c[] + */ + permc_spec = options->ColPerm; + if ( permc_spec != MY_PERMC && options->Fact == DOFACT ) + get_perm_c(permc_spec, AA, perm_c); + utime[COLPERM] = SuperLU_timer_() - t0; + + t0 = SuperLU_timer_(); + sp_preorder(options, AA, perm_c, etree, &AC); + utime[ETREE] = SuperLU_timer_() - t0; + +/* printf("Factor PA = LU ... relax %d\tw %d\tmaxsuper %d\trowblk %d\n", + relax, panel_size, sp_ienv(3), sp_ienv(4)); + fflush(stdout); */ + + /* Compute the LU factorization of A*Pc. */ + t0 = SuperLU_timer_(); + zgstrf(options, &AC, relax, panel_size, etree, + work, lwork, perm_c, perm_r, L, U, stat, info); + utime[FACT] = SuperLU_timer_() - t0; + + if ( lwork == -1 ) { + mem_usage->total_needed = *info - A->ncol; + return; + } + } + + if ( options->PivotGrowth ) { + if ( *info > 0 ) { + if ( *info <= A->ncol ) { + /* Compute the reciprocal pivot growth factor of the leading + rank-deficient *info columns of A. */ + *recip_pivot_growth = zPivotGrowth(*info, AA, perm_c, L, U); + } + return; + } + + /* Compute the reciprocal pivot growth factor *recip_pivot_growth. */ + *recip_pivot_growth = zPivotGrowth(A->ncol, AA, perm_c, L, U); + } + + if ( options->ConditionNumber ) { + /* Estimate the reciprocal of the condition number of A. */ + t0 = SuperLU_timer_(); + if ( notran ) { + *(unsigned char *)norm = '1'; + } else { + *(unsigned char *)norm = 'I'; + } + anorm = zlangs(norm, AA); + zgscon(norm, L, U, anorm, rcond, stat, info); + utime[RCOND] = SuperLU_timer_() - t0; + } + + if ( nrhs > 0 ) { + /* Scale the right hand side if equilibration was performed. */ + if ( notran ) { + if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + zd_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], R[i]); + } + } else if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + zd_mult(&Bmat[i+j*ldb], &Bmat[i+j*ldb], C[i]); + } + + /* Compute the solution matrix X. */ + for (j = 0; j < nrhs; j++) /* Save a copy of the right hand sides */ + for (i = 0; i < B->nrow; i++) + Xmat[i + j*ldx] = Bmat[i + j*ldb]; + + t0 = SuperLU_timer_(); + zgstrs (trant, L, U, perm_c, perm_r, X, stat, info); + utime[SOLVE] = SuperLU_timer_() - t0; + + /* Use iterative refinement to improve the computed solution and compute + error bounds and backward error estimates for it. */ + t0 = SuperLU_timer_(); + if ( options->IterRefine != NOREFINE ) { + zgsrfs(trant, AA, L, U, perm_c, perm_r, equed, R, C, B, + X, ferr, berr, stat, info); + } else { + for (j = 0; j < nrhs; ++j) ferr[j] = berr[j] = 1.0; + } + utime[REFINE] = SuperLU_timer_() - t0; + + /* Transform the solution matrix X to a solution of the original system. */ + if ( notran ) { + if ( colequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + zd_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], C[i]); + } + } else if ( rowequ ) { + for (j = 0; j < nrhs; ++j) + for (i = 0; i < A->nrow; ++i) + zd_mult(&Xmat[i+j*ldx], &Xmat[i+j*ldx], R[i]); + } + } /* end if nrhs > 0 */ + + if ( options->ConditionNumber ) { + /* Set INFO = A->ncol+1 if the matrix is singular to working precision. */ + if ( *rcond < dlamch_("E") ) *info = A->ncol + 1; + } + + if ( nofact ) { + zQuerySpace(L, U, mem_usage); + Destroy_CompCol_Permuted(&AC); + } + if ( A->Stype == SLU_NR ) { + Destroy_SuperMatrix_Store(AA); + SUPERLU_FREE(AA); + } + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgstrf.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgstrf.c new file mode 100644 index 0000000..e3c22f0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgstrf.c @@ -0,0 +1,436 @@ + +/*! @file zgstrf.c + * \brief Computes an LU factorization of a general sparse matrix + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSTRF computes an LU factorization of a general sparse m-by-n
    + * matrix A using partial pivoting with row interchanges.
    + * The factorization has the form
    + *     Pr * A = L * U
    + * where Pr is a row permutation matrix, L is lower triangular with unit
    + * diagonal elements (lower trapezoidal if A->nrow > A->ncol), and U is upper 
    + * triangular (upper trapezoidal if A->nrow < A->ncol).
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * options (input) superlu_options_t*
    + *         The structure defines the input parameters to control
    + *         how the LU decomposition will be performed.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = SLU_NCP; Dtype = SLU_Z; Mtype = SLU_GE.
    + *
    + * relax    (input) int
    + *          To control degree of relaxing supernodes. If the number
    + *          of nodes (columns) in a subtree of the elimination tree is less
    + *          than relax, this subtree is considered as one supernode,
    + *          regardless of the row structures of those columns.
    + *
    + * panel_size (input) int
    + *          A panel consists of at most panel_size consecutive columns.
    + *
    + * etree    (input) int*, dimension (A->ncol)
    + *          Elimination tree of A'*A.
    + *          Note: etree is a vector of parent pointers for a forest whose
    + *          vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
    + *          On input, the columns of A should be permuted so that the
    + *          etree is in a certain postorder.
    + *
    + * work     (input/output) void*, size (lwork) (in bytes)
    + *          User-supplied work space and space for the output data structures.
    + *          Not referenced if lwork = 0;
    + *
    + * lwork   (input) int
    + *         Specifies the size of work array in bytes.
    + *         = 0:  allocate space internally by system malloc;
    + *         > 0:  use user-supplied work array of length lwork in bytes,
    + *               returns error if space runs out.
    + *         = -1: the routine guesses the amount of space needed without
    + *               performing the factorization, and returns it in
    + *               *info; no other side effects.
    + *
    + * perm_c   (input) int*, dimension (A->ncol)
    + *	    Column permutation vector, which defines the 
    + *          permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *          in position j in A*Pc.
    + *          When searching for diagonal, perm_c[*] is applied to the
    + *          row subscripts of A, so that diagonal threshold pivoting
    + *          can find the diagonal of A, rather than that of A*Pc.
    + *
    + * perm_r   (input/output) int*, dimension (A->nrow)
    + *          Row permutation vector which defines the permutation matrix Pr,
    + *          perm_r[i] = j means row i of A is in position j in Pr*A.
    + *          If options->Fact = SamePattern_SameRowPerm, the pivoting routine
    + *             will try to use the input perm_r, unless a certain threshold
    + *             criterion is violated. In that case, perm_r is overwritten by
    + *             a new permutation determined by partial pivoting or diagonal
    + *             threshold pivoting.
    + *          Otherwise, perm_r is output argument;
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = SLU_NC, 
    + *          Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See slu_util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info     (output) int*
    + *          = 0: successful exit
    + *          < 0: if info = -i, the i-th argument had an illegal value
    + *          > 0: if info = i, and i is
    + *             <= A->ncol: U(i,i) is exactly zero. The factorization has
    + *                been completed, but the factor U is exactly singular,
    + *                and division by zero will occur if it is used to solve a
    + *                system of equations.
    + *             > A->ncol: number of bytes allocated when memory allocation
    + *                failure occurred, plus A->ncol. If lwork = -1, it is
    + *                the estimated amount of space needed, plus A->ncol.
    + *
    + * ======================================================================
    + *
    + * Local Working Arrays: 
    + * ======================
    + *   m = number of rows in the matrix
    + *   n = number of columns in the matrix
    + *
    + *   xprune[0:n-1]: xprune[*] points to locations in subscript 
    + *	vector lsub[*]. For column i, xprune[i] denotes the point where 
    + *	structural pruning begins. I.e. only xlsub[i],..,xprune[i]-1 need 
    + *	to be traversed for symbolic factorization.
    + *
    + *   marker[0:3*m-1]: marker[i] = j means that node i has been 
    + *	reached when working on column j.
    + *	Storage: relative to original row subscripts
    + *	NOTE: There are 3 of them: marker/marker1 are used for panel dfs, 
    + *	      see zpanel_dfs.c; marker2 is used for inner-factorization,
    + *            see zcolumn_dfs.c.
    + *
    + *   parent[0:m-1]: parent vector used during dfs
    + *      Storage: relative to new row subscripts
    + *
    + *   xplore[0:m-1]: xplore[i] gives the location of the next (dfs) 
    + *	unexplored neighbor of i in lsub[*]
    + *
    + *   segrep[0:nseg-1]: contains the list of supernodal representatives
    + *	in topological order of the dfs. A supernode representative is the 
    + *	last column of a supernode.
    + *      The maximum size of segrep[] is n.
    + *
    + *   repfnz[0:W*m-1]: for a nonzero segment U[*,j] that ends at a 
    + *	supernodal representative r, repfnz[r] is the location of the first 
    + *	nonzero in this segment.  It is also used during the dfs: repfnz[r]>0
    + *	indicates the supernode r has been explored.
    + *	NOTE: There are W of them, each used for one column of a panel. 
    + *
    + *   panel_lsub[0:W*m-1]: temporary for the nonzeros row indices below 
    + *      the panel diagonal. These are filled in during zpanel_dfs(), and are
    + *      used later in the inner LU factorization within the panel.
    + *	panel_lsub[]/dense[] pair forms the SPA data structure.
    + *	NOTE: There are W of them.
    + *
    + *   dense[0:W*m-1]: sparse accumulating (SPA) vector for intermediate values;
    + *	    	   NOTE: there are W of them.
    + *
    + *   tempv[0:*]: real temporary used for dense numeric kernels;
    + *	The size of this array is defined by NUM_TEMPV() in slu_zdefs.h.
    + * 
    + */ + +void +zgstrf (superlu_options_t *options, SuperMatrix *A, + int relax, int panel_size, int *etree, void *work, int lwork, + int *perm_c, int *perm_r, SuperMatrix *L, SuperMatrix *U, + SuperLUStat_t *stat, int *info) +{ + /* Local working arrays */ + NCPformat *Astore; + int *iperm_r = NULL; /* inverse of perm_r; used when + options->Fact == SamePattern_SameRowPerm */ + int *iperm_c; /* inverse of perm_c */ + int *iwork; + doublecomplex *zwork; + int *segrep, *repfnz, *parent, *xplore; + int *panel_lsub; /* dense[]/panel_lsub[] pair forms a w-wide SPA */ + int *xprune; + int *marker; + doublecomplex *dense, *tempv; + int *relax_end; + doublecomplex *a; + int *asub; + int *xa_begin, *xa_end; + int *xsup, *supno; + int *xlsub, *xlusup, *xusub; + int nzlumax; + double fill_ratio = sp_ienv(6); /* estimated fill ratio */ + static GlobalLU_t Glu; /* persistent to facilitate multiple factors. */ + + /* Local scalars */ + fact_t fact = options->Fact; + double diag_pivot_thresh = options->DiagPivotThresh; + int pivrow; /* pivotal row number in the original matrix A */ + int nseg1; /* no of segments in U-column above panel row jcol */ + int nseg; /* no of segments in each U-column */ + register int jcol; + register int kcol; /* end column of a relaxed snode */ + register int icol; + register int i, k, jj, new_next, iinfo; + int m, n, min_mn, jsupno, fsupc, nextlu, nextu; + int w_def; /* upper bound on panel width */ + int usepr, iperm_r_allocated = 0; + int nnzL, nnzU; + int *panel_histo = stat->panel_histo; + flops_t *ops = stat->ops; + + iinfo = 0; + m = A->nrow; + n = A->ncol; + min_mn = SUPERLU_MIN(m, n); + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + + /* Allocate storage common to the factor routines */ + *info = zLUMemInit(fact, work, lwork, m, n, Astore->nnz, + panel_size, fill_ratio, L, U, &Glu, &iwork, &zwork); + if ( *info ) return; + + xsup = Glu.xsup; + supno = Glu.supno; + xlsub = Glu.xlsub; + xlusup = Glu.xlusup; + xusub = Glu.xusub; + + SetIWork(m, n, panel_size, iwork, &segrep, &parent, &xplore, + &repfnz, &panel_lsub, &xprune, &marker); + zSetRWork(m, panel_size, zwork, &dense, &tempv); + + usepr = (fact == SamePattern_SameRowPerm); + if ( usepr ) { + /* Compute the inverse of perm_r */ + iperm_r = (int *) intMalloc(m); + for (k = 0; k < m; ++k) iperm_r[perm_r[k]] = k; + iperm_r_allocated = 1; + } + iperm_c = (int *) intMalloc(n); + for (k = 0; k < n; ++k) iperm_c[perm_c[k]] = k; + + /* Identify relaxed snodes */ + relax_end = (int *) intMalloc(n); + if ( options->SymmetricMode == YES ) { + heap_relax_snode(n, etree, relax, marker, relax_end); + } else { + relax_snode(n, etree, relax, marker, relax_end); + } + + ifill (perm_r, m, EMPTY); + ifill (marker, m * NO_MARKER, EMPTY); + supno[0] = -1; + xsup[0] = xlsub[0] = xusub[0] = xlusup[0] = 0; + w_def = panel_size; + + /* + * Work on one "panel" at a time. A panel is one of the following: + * (a) a relaxed supernode at the bottom of the etree, or + * (b) panel_size contiguous columns, defined by the user + */ + for (jcol = 0; jcol < min_mn; ) { + + if ( relax_end[jcol] != EMPTY ) { /* start of a relaxed snode */ + kcol = relax_end[jcol]; /* end of the relaxed snode */ + panel_histo[kcol-jcol+1]++; + + /* -------------------------------------- + * Factorize the relaxed supernode(jcol:kcol) + * -------------------------------------- */ + /* Determine the union of the row structure of the snode */ + if ( (*info = zsnode_dfs(jcol, kcol, asub, xa_begin, xa_end, + xprune, marker, &Glu)) != 0 ) + return; + + nextu = xusub[jcol]; + nextlu = xlusup[jcol]; + jsupno = supno[jcol]; + fsupc = xsup[jsupno]; + new_next = nextlu + (xlsub[fsupc+1]-xlsub[fsupc])*(kcol-jcol+1); + nzlumax = Glu.nzlumax; + while ( new_next > nzlumax ) { + if ( (*info = zLUMemXpand(jcol, nextlu, LUSUP, &nzlumax, &Glu)) ) + return; + } + + for (icol = jcol; icol<= kcol; icol++) { + xusub[icol+1] = nextu; + + /* Scatter into SPA dense[*] */ + for (k = xa_begin[icol]; k < xa_end[icol]; k++) + dense[asub[k]] = a[k]; + + /* Numeric update within the snode */ + zsnode_bmod(icol, jsupno, fsupc, dense, tempv, &Glu, stat); + + if ( (*info = zpivotL(icol, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + +#ifdef DEBUG + zprint_lu_col("[1]: ", icol, pivrow, xprune, &Glu); +#endif + + } + + jcol = icol; + + } else { /* Work on one panel of panel_size columns */ + + /* Adjust panel_size so that a panel won't overlap with the next + * relaxed snode. + */ + panel_size = w_def; + for (k = jcol + 1; k < SUPERLU_MIN(jcol+panel_size, min_mn); k++) + if ( relax_end[k] != EMPTY ) { + panel_size = k - jcol; + break; + } + if ( k == min_mn ) panel_size = min_mn - jcol; + panel_histo[panel_size]++; + + /* symbolic factor on a panel of columns */ + zpanel_dfs(m, panel_size, jcol, A, perm_r, &nseg1, + dense, panel_lsub, segrep, repfnz, xprune, + marker, parent, xplore, &Glu); + + /* numeric sup-panel updates in topological order */ + zpanel_bmod(m, panel_size, jcol, nseg1, dense, + tempv, segrep, repfnz, &Glu, stat); + + /* Sparse LU within the panel, and below panel diagonal */ + for ( jj = jcol; jj < jcol + panel_size; jj++) { + k = (jj - jcol) * m; /* column index for w-wide arrays */ + + nseg = nseg1; /* Begin after all the panel segments */ + + if ((*info = zcolumn_dfs(m, jj, perm_r, &nseg, &panel_lsub[k], + segrep, &repfnz[k], xprune, marker, + parent, xplore, &Glu)) != 0) return; + + /* Numeric updates */ + if ((*info = zcolumn_bmod(jj, (nseg - nseg1), &dense[k], + tempv, &segrep[nseg1], &repfnz[k], + jcol, &Glu, stat)) != 0) return; + + /* Copy the U-segments to ucol[*] */ + if ((*info = zcopy_to_ucol(jj, nseg, segrep, &repfnz[k], + perm_r, &dense[k], &Glu)) != 0) + return; + + if ( (*info = zpivotL(jj, diag_pivot_thresh, &usepr, perm_r, + iperm_r, iperm_c, &pivrow, &Glu, stat)) ) + if ( iinfo == 0 ) iinfo = *info; + + /* Prune columns (0:jj-1) using column jj */ + zpruneL(jj, perm_r, pivrow, nseg, segrep, + &repfnz[k], xprune, &Glu); + + /* Reset repfnz[] for this column */ + resetrep_col (nseg, segrep, &repfnz[k]); + +#ifdef DEBUG + zprint_lu_col("[2]: ", jj, pivrow, xprune, &Glu); +#endif + + } + + jcol += panel_size; /* Move to the next panel */ + + } /* else */ + + } /* for */ + + *info = iinfo; + + if ( m > n ) { + k = 0; + for (i = 0; i < m; ++i) + if ( perm_r[i] == EMPTY ) { + perm_r[i] = n + k; + ++k; + } + } + + countnz(min_mn, xprune, &nnzL, &nnzU, &Glu); + fixupL(min_mn, perm_r, &Glu); + + zLUWorkFree(iwork, zwork, &Glu); /* Free work space and compress storage */ + + if ( fact == SamePattern_SameRowPerm ) { + /* L and U structures may have changed due to possibly different + pivoting, even though the storage is available. + There could also be memory expansions, so the array locations + may have changed, */ + ((SCformat *)L->Store)->nnz = nnzL; + ((SCformat *)L->Store)->nsuper = Glu.supno[n]; + ((SCformat *)L->Store)->nzval = Glu.lusup; + ((SCformat *)L->Store)->nzval_colptr = Glu.xlusup; + ((SCformat *)L->Store)->rowind = Glu.lsub; + ((SCformat *)L->Store)->rowind_colptr = Glu.xlsub; + ((NCformat *)U->Store)->nnz = nnzU; + ((NCformat *)U->Store)->nzval = Glu.ucol; + ((NCformat *)U->Store)->rowind = Glu.usub; + ((NCformat *)U->Store)->colptr = Glu.xusub; + } else { + zCreate_SuperNode_Matrix(L, A->nrow, min_mn, nnzL, Glu.lusup, + Glu.xlusup, Glu.lsub, Glu.xlsub, Glu.supno, + Glu.xsup, SLU_SC, SLU_Z, SLU_TRLU); + zCreate_CompCol_Matrix(U, min_mn, min_mn, nnzU, Glu.ucol, + Glu.usub, Glu.xusub, SLU_NC, SLU_Z, SLU_TRU); + } + + ops[FACT] += ops[TRSV] + ops[GEMV]; + stat->expansions = --(Glu.num_expansions); + + if ( iperm_r_allocated ) SUPERLU_FREE (iperm_r); + SUPERLU_FREE (iperm_c); + SUPERLU_FREE (relax_end); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zgstrs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zgstrs.c new file mode 100644 index 0000000..0a86e60 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zgstrs.c @@ -0,0 +1,350 @@ + +/*! @file zgstrs.c + * \brief Solves a system using LU factorization + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + *
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + +#include "slu_zdefs.h" + + +/* + * Function prototypes + */ +void zusolve(int, int, doublecomplex*, doublecomplex*); +void zlsolve(int, int, doublecomplex*, doublecomplex*); +void zmatvec(int, int, int, doublecomplex*, doublecomplex*, doublecomplex*); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * ZGSTRS solves a system of linear equations A*X=B or A'*X=B
    + * with A sparse and B dense, using the LU factorization computed by
    + * ZGSTRF.
    + *
    + * See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + * Arguments
    + * =========
    + *
    + * trans   (input) trans_t
    + *          Specifies the form of the system of equations:
    + *          = NOTRANS: A * X = B  (No transpose)
    + *          = TRANS:   A'* X = B  (Transpose)
    + *          = CONJ:    A**H * X = B  (Conjugate transpose)
    + *
    + * L       (input) SuperMatrix*
    + *         The factor L from the factorization Pr*A*Pc=L*U as computed by
    + *         zgstrf(). Use compressed row subscripts storage for supernodes,
    + *         i.e., L has types: Stype = SLU_SC, Dtype = SLU_Z, Mtype = SLU_TRLU.
    + *
    + * U       (input) SuperMatrix*
    + *         The factor U from the factorization Pr*A*Pc=L*U as computed by
    + *         zgstrf(). Use column-wise storage scheme, i.e., U has types:
    + *         Stype = SLU_NC, Dtype = SLU_Z, Mtype = SLU_TRU.
    + *
    + * perm_c  (input) int*, dimension (L->ncol)
    + *	   Column permutation vector, which defines the 
    + *         permutation matrix Pc; perm_c[i] = j means column i of A is 
    + *         in position j in A*Pc.
    + *
    + * perm_r  (input) int*, dimension (L->nrow)
    + *         Row permutation vector, which defines the permutation matrix Pr; 
    + *         perm_r[i] = j means row i of A is in position j in Pr*A.
    + *
    + * B       (input/output) SuperMatrix*
    + *         B has types: Stype = SLU_DN, Dtype = SLU_Z, Mtype = SLU_GE.
    + *         On entry, the right hand side matrix.
    + *         On exit, the solution matrix if info = 0;
    + *
    + * stat     (output) SuperLUStat_t*
    + *          Record the statistics on runtime and floating-point operation count.
    + *          See util.h for the definition of 'SuperLUStat_t'.
    + *
    + * info    (output) int*
    + * 	   = 0: successful exit
    + *	   < 0: if info = -i, the i-th argument had an illegal value
    + * 
    + */ + +void +zgstrs (trans_t trans, SuperMatrix *L, SuperMatrix *U, + int *perm_c, int *perm_r, SuperMatrix *B, + SuperLUStat_t *stat, int *info) +{ + +#ifdef _CRAY + _fcd ftcs1, ftcs2, ftcs3, ftcs4; +#endif + int incx = 1, incy = 1; +#ifdef USE_VENDOR_BLAS + doublecomplex alpha = {1.0, 0.0}, beta = {1.0, 0.0}; + doublecomplex *work_col; +#endif + doublecomplex temp_comp; + DNformat *Bstore; + doublecomplex *Bmat; + SCformat *Lstore; + NCformat *Ustore; + doublecomplex *Lval, *Uval; + int fsupc, nrow, nsupr, nsupc, luptr, istart, irow; + int i, j, k, iptr, jcol, n, ldb, nrhs; + doublecomplex *work, *rhs_work, *soln; + flops_t solve_ops; + void zprint_soln(); + + /* Test input parameters ... */ + *info = 0; + Bstore = B->Store; + ldb = Bstore->lda; + nrhs = B->ncol; + if ( trans != NOTRANS && trans != TRANS && trans != CONJ ) *info = -1; + else if ( L->nrow != L->ncol || L->nrow < 0 || + L->Stype != SLU_SC || L->Dtype != SLU_Z || L->Mtype != SLU_TRLU ) + *info = -2; + else if ( U->nrow != U->ncol || U->nrow < 0 || + U->Stype != SLU_NC || U->Dtype != SLU_Z || U->Mtype != SLU_TRU ) + *info = -3; + else if ( ldb < SUPERLU_MAX(0, L->nrow) || + B->Stype != SLU_DN || B->Dtype != SLU_Z || B->Mtype != SLU_GE ) + *info = -6; + if ( *info ) { + i = -(*info); + xerbla_("zgstrs", &i); + return; + } + + n = L->nrow; + work = doublecomplexCalloc(n * nrhs); + if ( !work ) ABORT("Malloc fails for local work[]."); + soln = doublecomplexMalloc(n); + if ( !soln ) ABORT("Malloc fails for local soln[]."); + + Bmat = Bstore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( trans == NOTRANS ) { + /* Permute right hand sides to form Pr*B */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_r[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + /* Forward solve PLy=Pb. */ + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + nrow = nsupr - nsupc; + + solve_ops += 4 * nsupc * (nsupc - 1) * nrhs; + solve_ops += 8 * nrow * nsupc * nrhs; + + if ( nsupc == 1 ) { + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + luptr = L_NZ_START(fsupc); + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); iptr++){ + irow = L_SUB(iptr); + ++luptr; + zz_mult(&temp_comp, &rhs_work[fsupc], &Lval[luptr]); + z_sub(&rhs_work[irow], &rhs_work[irow], &temp_comp); + } + } + } else { + luptr = L_NZ_START(fsupc); +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("N", strlen("N")); + ftcs3 = _cptofcd("U", strlen("U")); + CTRSM( ftcs1, ftcs1, ftcs2, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + CGEMM( ftcs2, ftcs2, &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#else + ztrsm_("L", "L", "N", "U", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); + + zgemm_( "N", "N", &nrow, &nrhs, &nsupc, &alpha, + &Lval[luptr+nsupc], &nsupr, &Bmat[fsupc], &ldb, + &beta, &work[0], &n ); +#endif + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + work_col = &work[j*n]; + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + z_sub(&rhs_work[irow], &rhs_work[irow], &work_col[i]); + work_col[i].r = 0.0; + work_col[i].i = 0.0; + iptr++; + } + } +#else + for (j = 0; j < nrhs; j++) { + rhs_work = &Bmat[j*ldb]; + zlsolve (nsupr, nsupc, &Lval[luptr], &rhs_work[fsupc]); + zmatvec (nsupr, nrow, nsupc, &Lval[luptr+nsupc], + &rhs_work[fsupc], &work[0] ); + + iptr = istart + nsupc; + for (i = 0; i < nrow; i++) { + irow = L_SUB(iptr); + z_sub(&rhs_work[irow], &rhs_work[irow], &work[i]); + work[i].r = 0.; + work[i].i = 0.; + iptr++; + } + } +#endif + } /* else ... */ + } /* for L-solve */ + +#ifdef DEBUG + printf("After L-solve: y=\n"); + zprint_soln(n, nrhs, Bmat); +#endif + + /* + * Back solve Ux=y. + */ + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 4 * nsupc * (nsupc + 1) * nrhs; + + if ( nsupc == 1 ) { + rhs_work = &Bmat[0]; + for (j = 0; j < nrhs; j++) { + z_div(&rhs_work[fsupc], &rhs_work[fsupc], &Lval[luptr]); + rhs_work += ldb; + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("U", strlen("U")); + ftcs3 = _cptofcd("N", strlen("N")); + CTRSM( ftcs1, ftcs2, ftcs3, ftcs3, &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#else + ztrsm_("L", "U", "N", "N", &nsupc, &nrhs, &alpha, + &Lval[luptr], &nsupr, &Bmat[fsupc], &ldb); +#endif +#else + for (j = 0; j < nrhs; j++) + zusolve ( nsupr, nsupc, &Lval[luptr], &Bmat[fsupc+j*ldb] ); +#endif + } + + for (j = 0; j < nrhs; ++j) { + rhs_work = &Bmat[j*ldb]; + for (jcol = fsupc; jcol < fsupc + nsupc; jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++ ){ + irow = U_SUB(i); + zz_mult(&temp_comp, &rhs_work[jcol], &Uval[i]); + z_sub(&rhs_work[irow], &rhs_work[irow], &temp_comp); + } + } + } + + } /* for U-solve */ + +#ifdef DEBUG + printf("After U-solve: x=\n"); + zprint_soln(n, nrhs, Bmat); +#endif + + /* Compute the final solution X := Pc*X. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_c[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = solve_ops; + + } else { /* Solve A'*X=B or CONJ(A)*X=B */ + /* Permute right hand sides to form Pc'*B. */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[perm_c[k]] = rhs_work[k]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + stat->ops[SOLVE] = 0; + if (trans == TRANS) { + for (k = 0; k < nrhs; ++k) { + /* Multiply by inv(U'). */ + sp_ztrsv("U", "T", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by inv(L'). */ + sp_ztrsv("L", "T", "U", L, U, &Bmat[k*ldb], stat, info); + } + } else { /* trans == CONJ */ + for (k = 0; k < nrhs; ++k) { + /* Multiply by conj(inv(U')). */ + sp_ztrsv("U", "C", "N", L, U, &Bmat[k*ldb], stat, info); + + /* Multiply by conj(inv(L')). */ + sp_ztrsv("L", "C", "U", L, U, &Bmat[k*ldb], stat, info); + } + } + /* Compute the final solution X := Pr'*X (=inv(Pr)*X) */ + for (i = 0; i < nrhs; i++) { + rhs_work = &Bmat[i*ldb]; + for (k = 0; k < n; k++) soln[k] = rhs_work[perm_r[k]]; + for (k = 0; k < n; k++) rhs_work[k] = soln[k]; + } + + } + + SUPERLU_FREE(work); + SUPERLU_FREE(soln); +} + +/* + * Diagnostic print of the solution vector + */ +void +zprint_soln(int n, int nrhs, doublecomplex *soln) +{ + int i; + + for (i = 0; i < n; i++) + printf("\t%d: %.4f\n", i, soln[i]); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c b/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c new file mode 100644 index 0000000..b2cd1ed --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c @@ -0,0 +1,221 @@ + +/*! @file zlacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" +#include "slu_dcomplex.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   ZLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) DOUBLE COMPLEX PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) DOUBLE COMPLEX PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *          where A' is the conjugate transpose of A,
    + *         and ZLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *
    + *   EST    (output) DOUBLE PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to ZLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from ZLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +zlacon_(int *n, doublecomplex *v, doublecomplex *x, double *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + + /* System generated locals */ + double d__1; + + /* Local variables */ + static int iter; + static int jump, jlast; + static double altsgn, estold; + static int i, j; + double temp; + double safmin; + extern double dlamch_(char *); + extern int izmax1_(int *, doublecomplex *, int *); + extern double dzsum1_(int *, doublecomplex *, int *); + + safmin = dlamch_("Safe minimum"); + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i].r = 1. / (double) (*n); + x[i].i = 0.; + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = z_abs(&v[0]); + /* ... QUIT */ + goto L150; + } + *est = dzsum1_(n, x, &c__1); + + for (i = 0; i < *n; ++i) { + d__1 = z_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: + j = izmax1_(n, &x[0], &c__1); + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + CCOPY(n, x, &c__1, v, &c__1); +#else + zcopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; + *est = dzsum1_(n, v, &c__1); + + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + d__1 = z_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; + j = izmax1_(n, &x[0], &c__1); + --j; + if (x[jlast].r != (d__1 = x[j].r, fabs(d__1)) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1].r = altsgn * ((double)(i - 1) / (double)(*n - 1) + 1.); + x[i-1].i = 0.; + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: + temp = dzsum1_(n, x, &c__1) / (double)(*n * 3) * 2.; + if (temp > *est) { +#ifdef _CRAY + CCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + zcopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* zlacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c.bak b/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c.bak new file mode 100644 index 0000000..b2cd1ed --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zlacon.c.bak @@ -0,0 +1,221 @@ + +/*! @file zlacon.c + * \brief Estimates the 1-norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_Cnames.h" +#include "slu_dcomplex.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   ZLACON estimates the 1-norm of a square matrix A.   
    + *   Reverse communication is used for evaluating matrix-vector products. 
    + * 
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   N      (input) INT
    + *          The order of the matrix.  N >= 1.   
    + *
    + *   V      (workspace) DOUBLE COMPLEX PRECISION array, dimension (N)   
    + *          On the final return, V = A*W,  where  EST = norm(V)/norm(W)   
    + *          (W is not returned).   
    + *
    + *   X      (input/output) DOUBLE COMPLEX PRECISION array, dimension (N)   
    + *          On an intermediate return, X should be overwritten by   
    + *                A * X,   if KASE=1,   
    + *                A' * X,  if KASE=2,
    + *          where A' is the conjugate transpose of A,
    + *         and ZLACON must be re-called with all the other parameters   
    + *          unchanged.   
    + *
    + *
    + *   EST    (output) DOUBLE PRECISION   
    + *          An estimate (a lower bound) for norm(A).   
    + *
    + *   KASE   (input/output) INT
    + *          On the initial call to ZLACON, KASE should be 0.   
    + *          On an intermediate return, KASE will be 1 or 2, indicating   
    + *          whether X should be overwritten by A * X  or A' * X.   
    + *          On the final return from ZLACON, KASE will again be 0.   
    + *
    + *   Further Details   
    + *   ======= =======   
    + *
    + *   Contributed by Nick Higham, University of Manchester.   
    + *   Originally named CONEST, dated March 16, 1988.   
    + *
    + *   Reference: N.J. Higham, "FORTRAN codes for estimating the one-norm of 
    + *   a real or complex matrix, with applications to condition estimation", 
    + *   ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.   
    + *   ===================================================================== 
    + * 
    + */ + +int +zlacon_(int *n, doublecomplex *v, doublecomplex *x, double *est, int *kase) + +{ + + + /* Table of constant values */ + int c__1 = 1; + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + + /* System generated locals */ + double d__1; + + /* Local variables */ + static int iter; + static int jump, jlast; + static double altsgn, estold; + static int i, j; + double temp; + double safmin; + extern double dlamch_(char *); + extern int izmax1_(int *, doublecomplex *, int *); + extern double dzsum1_(int *, doublecomplex *, int *); + + safmin = dlamch_("Safe minimum"); + if ( *kase == 0 ) { + for (i = 0; i < *n; ++i) { + x[i].r = 1. / (double) (*n); + x[i].i = 0.; + } + *kase = 1; + jump = 1; + return 0; + } + + switch (jump) { + case 1: goto L20; + case 2: goto L40; + case 3: goto L70; + case 4: goto L110; + case 5: goto L140; + } + + /* ................ ENTRY (JUMP = 1) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X. */ + L20: + if (*n == 1) { + v[0] = x[0]; + *est = z_abs(&v[0]); + /* ... QUIT */ + goto L150; + } + *est = dzsum1_(n, x, &c__1); + + for (i = 0; i < *n; ++i) { + d__1 = z_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 2; + return 0; + + /* ................ ENTRY (JUMP = 2) + FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X. */ +L40: + j = izmax1_(n, &x[0], &c__1); + --j; + iter = 2; + + /* MAIN LOOP - ITERATIONS 2,3,...,ITMAX. */ +L50: + for (i = 0; i < *n; ++i) x[i] = zero; + x[j] = one; + *kase = 1; + jump = 3; + return 0; + + /* ................ ENTRY (JUMP = 3) + X HAS BEEN OVERWRITTEN BY A*X. */ +L70: +#ifdef _CRAY + CCOPY(n, x, &c__1, v, &c__1); +#else + zcopy_(n, x, &c__1, v, &c__1); +#endif + estold = *est; + *est = dzsum1_(n, v, &c__1); + + +L90: + /* TEST FOR CYCLING. */ + if (*est <= estold) goto L120; + + for (i = 0; i < *n; ++i) { + d__1 = z_abs(&x[i]); + if (d__1 > safmin) { + d__1 = 1 / d__1; + x[i].r *= d__1; + x[i].i *= d__1; + } else { + x[i] = one; + } + } + *kase = 2; + jump = 4; + return 0; + + /* ................ ENTRY (JUMP = 4) + X HAS BEEN OVERWRITTEN BY TRANDPOSE(A)*X. */ +L110: + jlast = j; + j = izmax1_(n, &x[0], &c__1); + --j; + if (x[jlast].r != (d__1 = x[j].r, fabs(d__1)) && iter < 5) { + ++iter; + goto L50; + } + + /* ITERATION COMPLETE. FINAL STAGE. */ +L120: + altsgn = 1.; + for (i = 1; i <= *n; ++i) { + x[i-1].r = altsgn * ((double)(i - 1) / (double)(*n - 1) + 1.); + x[i-1].i = 0.; + altsgn = -altsgn; + } + *kase = 1; + jump = 5; + return 0; + + /* ................ ENTRY (JUMP = 5) + X HAS BEEN OVERWRITTEN BY A*X. */ +L140: + temp = dzsum1_(n, x, &c__1) / (double)(*n * 3) * 2.; + if (temp > *est) { +#ifdef _CRAY + CCOPY(n, &x[0], &c__1, &v[0], &c__1); +#else + zcopy_(n, &x[0], &c__1, &v[0], &c__1); +#endif + *est = temp; + } + +L150: + *kase = 0; + return 0; + +} /* zlacon_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zlangs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zlangs.c new file mode 100644 index 0000000..b86ddaa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zlangs.c @@ -0,0 +1,119 @@ + +/*! @file zlangs.c + * \brief Returns the value of the one norm + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Modified from lapack routine ZLANGE 
    + * 
    + */ +/* + * File name: zlangs.c + * History: Modified from lapack routine ZLANGE + */ +#include +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + *
    + *   ZLANGS returns the value of the one norm, or the Frobenius norm, or 
    + *   the infinity norm, or the element of largest absolute value of a 
    + *   real matrix A.   
    + *
    + *   Description   
    + *   ===========   
    + *
    + *   ZLANGE returns the value   
    + *
    + *      ZLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'   
    + *               (   
    + *               ( norm1(A),         NORM = '1', 'O' or 'o'   
    + *               (   
    + *               ( normI(A),         NORM = 'I' or 'i'   
    + *               (   
    + *               ( normF(A),         NORM = 'F', 'f', 'E' or 'e'   
    + *
    + *   where  norm1  denotes the  one norm of a matrix (maximum column sum), 
    + *   normI  denotes the  infinity norm  of a matrix  (maximum row sum) and 
    + *   normF  denotes the  Frobenius norm of a matrix (square root of sum of 
    + *   squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.   
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   NORM    (input) CHARACTER*1   
    + *           Specifies the value to be returned in ZLANGE as described above.   
    + *   A       (input) SuperMatrix*
    + *           The M by N sparse matrix A. 
    + *
    + *  =====================================================================
    + * 
    + */ + +double zlangs(char *norm, SuperMatrix *A) +{ + + /* Local variables */ + NCformat *Astore; + doublecomplex *Aval; + int i, j, irow; + double value, sum; + double *rwork; + + Astore = A->Store; + Aval = Astore->nzval; + + if ( SUPERLU_MIN(A->nrow, A->ncol) == 0) { + value = 0.; + + } else if (lsame_(norm, "M")) { + /* Find max(abs(A(i,j))). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + value = SUPERLU_MAX( value, z_abs( &Aval[i]) ); + + } else if (lsame_(norm, "O") || *(unsigned char *)norm == '1') { + /* Find norm1(A). */ + value = 0.; + for (j = 0; j < A->ncol; ++j) { + sum = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) + sum += z_abs( &Aval[i] ); + value = SUPERLU_MAX(value,sum); + } + + } else if (lsame_(norm, "I")) { + /* Find normI(A). */ + if ( !(rwork = (double *) SUPERLU_MALLOC(A->nrow * sizeof(double))) ) + ABORT("SUPERLU_MALLOC fails for rwork."); + for (i = 0; i < A->nrow; ++i) rwork[i] = 0.; + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; i++) { + irow = Astore->rowind[i]; + rwork[irow] += z_abs( &Aval[i] ); + } + value = 0.; + for (i = 0; i < A->nrow; ++i) + value = SUPERLU_MAX(value, rwork[i]); + + SUPERLU_FREE (rwork); + + } else if (lsame_(norm, "F") || lsame_(norm, "E")) { + /* Find normF(A). */ + ABORT("Not implemented."); + } else + ABORT("Illegal norm specified."); + + return (value); + +} /* zlangs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zlaqgs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zlaqgs.c new file mode 100644 index 0000000..781c28b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zlaqgs.c @@ -0,0 +1,147 @@ + +/*! @file zlaqgs.c + * \brief Equlibrates a general sprase matrix + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Modified from LAPACK routine ZLAQGE
    + * 
    + */ +/* + * File name: zlaqgs.c + * History: Modified from LAPACK routine ZLAQGE + */ +#include +#include "slu_zdefs.h" + +/*! \brief + * + *
    + *   Purpose   
    + *   =======   
    + *
    + *   ZLAQGS equilibrates a general sparse M by N matrix A using the row and   
    + *   scaling factors in the vectors R and C.   
    + *
    + *   See supermatrix.h for the definition of 'SuperMatrix' structure.
    + *
    + *   Arguments   
    + *   =========   
    + *
    + *   A       (input/output) SuperMatrix*
    + *           On exit, the equilibrated matrix.  See EQUED for the form of 
    + *           the equilibrated matrix. The type of A can be:
    + *	    Stype = NC; Dtype = SLU_Z; Mtype = GE.
    + *	    
    + *   R       (input) double*, dimension (A->nrow)
    + *           The row scale factors for A.
    + *	    
    + *   C       (input) double*, dimension (A->ncol)
    + *           The column scale factors for A.
    + *	    
    + *   ROWCND  (input) double
    + *           Ratio of the smallest R(i) to the largest R(i).
    + *	    
    + *   COLCND  (input) double
    + *           Ratio of the smallest C(i) to the largest C(i).
    + *	    
    + *   AMAX    (input) double
    + *           Absolute value of largest matrix entry.
    + *	    
    + *   EQUED   (output) char*
    + *           Specifies the form of equilibration that was done.   
    + *           = 'N':  No equilibration   
    + *           = 'R':  Row equilibration, i.e., A has been premultiplied by  
    + *                   diag(R).   
    + *           = 'C':  Column equilibration, i.e., A has been postmultiplied  
    + *                   by diag(C).   
    + *           = 'B':  Both row and column equilibration, i.e., A has been
    + *                   replaced by diag(R) * A * diag(C).   
    + *
    + *   Internal Parameters   
    + *   ===================   
    + *
    + *   THRESH is a threshold value used to decide if row or column scaling   
    + *   should be done based on the ratio of the row or column scaling   
    + *   factors.  If ROWCND < THRESH, row scaling is done, and if   
    + *   COLCND < THRESH, column scaling is done.   
    + *
    + *   LARGE and SMALL are threshold values used to decide if row scaling   
    + *   should be done based on the absolute size of the largest matrix   
    + *   element.  If AMAX > LARGE or AMAX < SMALL, row scaling is done.   
    + *
    + *   ===================================================================== 
    + * 
    + */ + +void +zlaqgs(SuperMatrix *A, double *r, double *c, + double rowcnd, double colcnd, double amax, char *equed) +{ + + +#define THRESH (0.1) + + /* Local variables */ + NCformat *Astore; + doublecomplex *Aval; + int i, j, irow; + double large, small, cj; + double temp; + + + /* Quick return if possible */ + if (A->nrow <= 0 || A->ncol <= 0) { + *(unsigned char *)equed = 'N'; + return; + } + + Astore = A->Store; + Aval = Astore->nzval; + + /* Initialize LARGE and SMALL. */ + small = dlamch_("Safe minimum") / dlamch_("Precision"); + large = 1. / small; + + if (rowcnd >= THRESH && amax >= small && amax <= large) { + if (colcnd >= THRESH) + *(unsigned char *)equed = 'N'; + else { + /* Column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + zd_mult(&Aval[i], &Aval[i], cj); + } + } + *(unsigned char *)equed = 'C'; + } + } else if (colcnd >= THRESH) { + /* Row scaling, no column scaling */ + for (j = 0; j < A->ncol; ++j) + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + zd_mult(&Aval[i], &Aval[i], r[irow]); + } + *(unsigned char *)equed = 'R'; + } else { + /* Row and column scaling */ + for (j = 0; j < A->ncol; ++j) { + cj = c[j]; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + temp = cj * r[irow]; + zd_mult(&Aval[i], &Aval[i], temp); + } + } + *(unsigned char *)equed = 'B'; + } + + return; + +} /* zlaqgs */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zldperm.c b/thirdparty/superlu/SuperLU_4.1/SRC/zldperm.c new file mode 100644 index 0000000..7abd869 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zldperm.c @@ -0,0 +1,168 @@ + +/*! @file + * \brief Finds a row permutation so that the matrix has large entries on the diagonal + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ + +#include "slu_zdefs.h" + +extern int_t mc64id_(int_t*); +extern int_t mc64ad_(int_t*, int_t*, int_t*, int_t [], int_t [], double [], + int_t*, int_t [], int_t*, int_t[], int_t*, double [], + int_t [], int_t []); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   ZLDPERM finds a row permutation so that the matrix has large
    + *   entries on the diagonal.
    + *
    + * Arguments
    + * =========
    + *
    + * job    (input) int
    + *        Control the action. Possible values for JOB are:
    + *        = 1 : Compute a row permutation of the matrix so that the
    + *              permuted matrix has as many entries on its diagonal as
    + *              possible. The values on the diagonal are of arbitrary size.
    + *              HSL subroutine MC21A/AD is used for this.
    + *        = 2 : Compute a row permutation of the matrix so that the smallest 
    + *              value on the diagonal of the permuted matrix is maximized.
    + *        = 3 : Compute a row permutation of the matrix so that the smallest
    + *              value on the diagonal of the permuted matrix is maximized.
    + *              The algorithm differs from the one used for JOB = 2 and may
    + *              have quite a different performance.
    + *        = 4 : Compute a row permutation of the matrix so that the sum
    + *              of the diagonal entries of the permuted matrix is maximized.
    + *        = 5 : Compute a row permutation of the matrix so that the product
    + *              of the diagonal entries of the permuted matrix is maximized
    + *              and vectors to scale the matrix so that the nonzero diagonal 
    + *              entries of the permuted matrix are one in absolute value and 
    + *              all the off-diagonal entries are less than or equal to one in 
    + *              absolute value.
    + *        Restriction: 1 <= JOB <= 5.
    + *
    + * n      (input) int
    + *        The order of the matrix.
    + *
    + * nnz    (input) int
    + *        The number of nonzeros in the matrix.
    + *
    + * adjncy (input) int*, of size nnz
    + *        The adjacency structure of the matrix, which contains the row
    + *        indices of the nonzeros.
    + *
    + * colptr (input) int*, of size n+1
    + *        The pointers to the beginning of each column in ADJNCY.
    + *
    + * nzval  (input) doublecomplex*, of size nnz
    + *        The nonzero values of the matrix. nzval[k] is the value of
    + *        the entry corresponding to adjncy[k].
    + *        It is not used if job = 1.
    + *
    + * perm   (output) int*, of size n
    + *        The permutation vector. perm[i] = j means row i in the
    + *        original matrix is in row j of the permuted matrix.
    + *
    + * u      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the row scaling factors. 
    + *
    + * v      (output) double*, of size n
    + *        If job = 5, the natural logarithms of the column scaling factors. 
    + *        The scaled matrix B has entries b_ij = a_ij * exp(u_i + v_j).
    + * 
    + */ + +int +zldperm(int_t job, int_t n, int_t nnz, int_t colptr[], int_t adjncy[], + doublecomplex nzval[], int_t *perm, double u[], double v[]) +{ + int_t i, liw, ldw, num; + int_t *iw, icntl[10], info[10]; + double *dw; + double *nzval_d = (double *) SUPERLU_MALLOC(nnz * sizeof(double)); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Enter zldperm()"); +#endif + liw = 5*n; + if ( job == 3 ) liw = 10*n + nnz; + if ( !(iw = intMalloc(liw)) ) ABORT("Malloc fails for iw[]"); + ldw = 3*n + nnz; + if ( !(dw = (double*) SUPERLU_MALLOC(ldw * sizeof(double))) ) + ABORT("Malloc fails for dw[]"); + + /* Increment one to get 1-based indexing. */ + for (i = 0; i <= n; ++i) ++colptr[i]; + for (i = 0; i < nnz; ++i) ++adjncy[i]; +#if ( DEBUGlevel>=2 ) + printf("LDPERM(): n %d, nnz %d\n", n, nnz); + slu_PrintInt10("colptr", n+1, colptr); + slu_PrintInt10("adjncy", nnz, adjncy); +#endif + + /* + * NOTE: + * ===== + * + * MC64AD assumes that column permutation vector is defined as: + * perm(i) = j means column i of permuted A is in column j of original A. + * + * Since a symmetric permutation preserves the diagonal entries. Then + * by the following relation: + * P'(A*P')P = P'A + * we can apply inverse(perm) to rows of A to get large diagonal entries. + * But, since 'perm' defined in MC64AD happens to be the reverse of + * SuperLU's definition of permutation vector, therefore, it is already + * an inverse for our purpose. We will thus use it directly. + * + */ + mc64id_(icntl); +#if 0 + /* Suppress error and warning messages. */ + icntl[0] = -1; + icntl[1] = -1; +#endif + + for (i = 0; i < nnz; ++i) nzval_d[i] = z_abs1(&nzval[i]); + mc64ad_(&job, &n, &nnz, colptr, adjncy, nzval_d, &num, perm, + &liw, iw, &ldw, dw, icntl, info); + +#if ( DEBUGlevel>=2 ) + slu_PrintInt10("perm", n, perm); + printf(".. After MC64AD info %d\tsize of matching %d\n", info[0], num); +#endif + if ( info[0] == 1 ) { /* Structurally singular */ + printf(".. The last %d permutations:\n", n-num); + slu_PrintInt10("perm", n-num, &perm[num]); + } + + /* Restore to 0-based indexing. */ + for (i = 0; i <= n; ++i) --colptr[i]; + for (i = 0; i < nnz; ++i) --adjncy[i]; + for (i = 0; i < n; ++i) --perm[i]; + + if ( job == 5 ) + for (i = 0; i < n; ++i) { + u[i] = dw[i]; + v[i] = dw[n+i]; + } + + SUPERLU_FREE(iw); + SUPERLU_FREE(dw); + SUPERLU_FREE(nzval_d); + +#if ( DEBUGlevel>=1 ) + CHECK_MALLOC(0, "Exit zldperm()"); +#endif + + return info[0]; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zmemory.c b/thirdparty/superlu/SuperLU_4.1/SRC/zmemory.c new file mode 100644 index 0000000..c14a910 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zmemory.c @@ -0,0 +1,701 @@ + +/*! @file zmemory.c + * \brief Memory details + * + *
    + * -- SuperLU routine (version 4.0) --
    + * Lawrence Berkeley National Laboratory.
    + * June 30, 2009
    + * 
    + */ +#include "slu_zdefs.h" + + +/* Internal prototypes */ +void *zexpand (int *, MemType,int, int, GlobalLU_t *); +int zLUWorkInit (int, int, int, int **, doublecomplex **, GlobalLU_t *); +void copy_mem_doublecomplex (int, void *, void *); +void zStackCompress (GlobalLU_t *); +void zSetupSpace (void *, int, GlobalLU_t *); +void *zuser_malloc (int, int, GlobalLU_t *); +void zuser_free (int, int, GlobalLU_t *); + +/* External prototypes (in memory.c - prec-independent) */ +extern void copy_mem_int (int, void *, void *); +extern void user_bcopy (char *, char *, int); + + +/* Macros to manipulate stack */ +#define StackFull(x) ( x + Glu->stack.used >= Glu->stack.size ) +#define NotDoubleAlign(addr) ( (long int)addr & 7 ) +#define DoubleAlign(addr) ( ((long int)addr + 7) & ~7L ) +#define TempSpace(m, w) ( (2*w + 4 + NO_MARKER) * m * sizeof(int) + \ + (w + 1) * m * sizeof(doublecomplex) ) +#define Reduce(alpha) ((alpha + 1) / 2) /* i.e. (alpha-1)/2 + 1 */ + + + + +/*! \brief Setup the memory model to be used for factorization. + * + * lwork = 0: use system malloc; + * lwork > 0: use user-supplied work[] space. + */ +void zSetupSpace(void *work, int lwork, GlobalLU_t *Glu) +{ + if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; /* malloc/free */ + } else if ( lwork > 0 ) { + Glu->MemModel = USER; /* user provided space */ + Glu->stack.used = 0; + Glu->stack.top1 = 0; + Glu->stack.top2 = (lwork/4)*4; /* must be word addressable */ + Glu->stack.size = Glu->stack.top2; + Glu->stack.array = (void *) work; + } +} + + + +void *zuser_malloc(int bytes, int which_end, GlobalLU_t *Glu) +{ + void *buf; + + if ( StackFull(bytes) ) return (NULL); + + if ( which_end == HEAD ) { + buf = (char*) Glu->stack.array + Glu->stack.top1; + Glu->stack.top1 += bytes; + } else { + Glu->stack.top2 -= bytes; + buf = (char*) Glu->stack.array + Glu->stack.top2; + } + + Glu->stack.used += bytes; + return buf; +} + + +void zuser_free(int bytes, int which_end, GlobalLU_t *Glu) +{ + if ( which_end == HEAD ) { + Glu->stack.top1 -= bytes; + } else { + Glu->stack.top2 += bytes; + } + Glu->stack.used -= bytes; +} + + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int zQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, iword, dword, panel_size = sp_ienv(1); + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(doublecomplex); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0*n + 3.0) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0 * panel_size + 4.0 + NO_MARKER) * n * iword + + (panel_size + 1.0) * n * dword ); + + return 0; +} /* zQuerySpace */ + + +/*! \brief + * + *
    + * mem_usage consists of the following fields:
    + *    - for_lu (float)
    + *      The amount of space used in bytes for the L\U data structures.
    + *    - total_needed (float)
    + *      The amount of space needed in bytes to perform factorization.
    + * 
    + */ +int ilu_zQuerySpace(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage) +{ + SCformat *Lstore; + NCformat *Ustore; + register int n, panel_size = sp_ienv(1); + register float iword, dword; + + Lstore = L->Store; + Ustore = U->Store; + n = L->ncol; + iword = sizeof(int); + dword = sizeof(double); + + /* For LU factors */ + mem_usage->for_lu = (float)( (4.0f * n + 3.0f) * iword + + Lstore->nzval_colptr[n] * dword + + Lstore->rowind_colptr[n] * iword ); + mem_usage->for_lu += (float)( (n + 1.0f) * iword + + Ustore->colptr[n] * (dword + iword) ); + + /* Working storage to support factorization. + ILU needs 5*n more integers than LU */ + mem_usage->total_needed = mem_usage->for_lu + + (float)( (2.0f * panel_size + 9.0f + NO_MARKER) * n * iword + + (panel_size + 1.0f) * n * dword ); + + return 0; +} /* ilu_zQuerySpace */ + + +/*! \brief Allocate storage for the data structures common to all factor routines. + * + *
    + * For those unpredictable size, estimate as fill_ratio * nnz(A).
    + * Return value:
    + *     If lwork = -1, return the estimated amount of space required, plus n;
    + *     otherwise, return the amount of space actually allocated when
    + *     memory allocation failure occurred.
    + * 
    + */ +int +zLUMemInit(fact_t fact, void *work, int lwork, int m, int n, int annz, + int panel_size, double fill_ratio, SuperMatrix *L, SuperMatrix *U, + GlobalLU_t *Glu, int **iwork, doublecomplex **dwork) +{ + int info, iword, dword; + SCformat *Lstore; + NCformat *Ustore; + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + doublecomplex *ucol; + int *usub, *xusub; + int nzlmax, nzumax, nzlumax; + + iword = sizeof(int); + dword = sizeof(doublecomplex); + Glu->n = n; + Glu->num_expansions = 0; + + if ( !Glu->expanders ) + Glu->expanders = (ExpHeader*)SUPERLU_MALLOC( NO_MEMTYPE * + sizeof(ExpHeader) ); + if ( !Glu->expanders ) ABORT("SUPERLU_MALLOC fails for expanders"); + + if ( fact != SamePattern_SameRowPerm ) { + /* Guess for L\U factors */ + nzumax = nzlumax = fill_ratio * annz; + nzlmax = SUPERLU_MAX(1, fill_ratio/4.) * annz; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else { + zSetupSpace(work, lwork, Glu); + } + +#if ( PRNTlevel >= 1 ) + printf("zLUMemInit() called: fill_ratio %.0f, nzlmax %ld, nzumax %ld\n", + fill_ratio, nzlmax, nzumax); + fflush(stdout); +#endif + + /* Integer pointers for L\U factors */ + if ( Glu->MemModel == SYSTEM ) { + xsup = intMalloc(n+1); + supno = intMalloc(n+1); + xlsub = intMalloc(n+1); + xlusup = intMalloc(n+1); + xusub = intMalloc(n+1); + } else { + xsup = (int *)zuser_malloc((n+1) * iword, HEAD, Glu); + supno = (int *)zuser_malloc((n+1) * iword, HEAD, Glu); + xlsub = (int *)zuser_malloc((n+1) * iword, HEAD, Glu); + xlusup = (int *)zuser_malloc((n+1) * iword, HEAD, Glu); + xusub = (int *)zuser_malloc((n+1) * iword, HEAD, Glu); + } + + lusup = (doublecomplex *) zexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (doublecomplex *) zexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) zexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) zexpand( &nzumax, USUB, 0, 1, Glu ); + + while ( !lusup || !ucol || !lsub || !usub ) { + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE(lusup); + SUPERLU_FREE(ucol); + SUPERLU_FREE(lsub); + SUPERLU_FREE(usub); + } else { + zuser_free((nzlumax+nzumax)*dword+(nzlmax+nzumax)*iword, + HEAD, Glu); + } + nzlumax /= 2; + nzumax /= 2; + nzlmax /= 2; + if ( nzlumax < annz ) { + printf("Not enough memory to perform factorization.\n"); + return (zmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + } +#if ( PRNTlevel >= 1) + printf("zLUMemInit() reduce size: nzlmax %ld, nzumax %ld\n", + nzlmax, nzumax); + fflush(stdout); +#endif + lusup = (doublecomplex *) zexpand( &nzlumax, LUSUP, 0, 0, Glu ); + ucol = (doublecomplex *) zexpand( &nzumax, UCOL, 0, 0, Glu ); + lsub = (int *) zexpand( &nzlmax, LSUB, 0, 0, Glu ); + usub = (int *) zexpand( &nzumax, USUB, 0, 1, Glu ); + } + + } else { + /* fact == SamePattern_SameRowPerm */ + Lstore = L->Store; + Ustore = U->Store; + xsup = Lstore->sup_to_col; + supno = Lstore->col_to_sup; + xlsub = Lstore->rowind_colptr; + xlusup = Lstore->nzval_colptr; + xusub = Ustore->colptr; + nzlmax = Glu->nzlmax; /* max from previous factorization */ + nzumax = Glu->nzumax; + nzlumax = Glu->nzlumax; + + if ( lwork == -1 ) { + return ( GluIntArray(n) * iword + TempSpace(m, panel_size) + + (nzlmax+nzumax)*iword + (nzlumax+nzumax)*dword + n ); + } else if ( lwork == 0 ) { + Glu->MemModel = SYSTEM; + } else { + Glu->MemModel = USER; + Glu->stack.top2 = (lwork/4)*4; /* must be word-addressable */ + Glu->stack.size = Glu->stack.top2; + } + + lsub = Glu->expanders[LSUB].mem = Lstore->rowind; + lusup = Glu->expanders[LUSUP].mem = Lstore->nzval; + usub = Glu->expanders[USUB].mem = Ustore->rowind; + ucol = Glu->expanders[UCOL].mem = Ustore->nzval;; + Glu->expanders[LSUB].size = nzlmax; + Glu->expanders[LUSUP].size = nzlumax; + Glu->expanders[USUB].size = nzumax; + Glu->expanders[UCOL].size = nzumax; + } + + Glu->xsup = xsup; + Glu->supno = supno; + Glu->lsub = lsub; + Glu->xlsub = xlsub; + Glu->lusup = lusup; + Glu->xlusup = xlusup; + Glu->ucol = ucol; + Glu->usub = usub; + Glu->xusub = xusub; + Glu->nzlmax = nzlmax; + Glu->nzumax = nzumax; + Glu->nzlumax = nzlumax; + + info = zLUWorkInit(m, n, panel_size, iwork, dwork, Glu); + if ( info ) + return ( info + zmemory_usage(nzlmax, nzumax, nzlumax, n) + n); + + ++Glu->num_expansions; + return 0; + +} /* zLUMemInit */ + +/*! \brief Allocate known working storage. Returns 0 if success, otherwise + returns the number of bytes allocated so far when failure occurred. */ +int +zLUWorkInit(int m, int n, int panel_size, int **iworkptr, + doublecomplex **dworkptr, GlobalLU_t *Glu) +{ + int isize, dsize, extra; + doublecomplex *old_ptr; + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + + isize = ( (2 * panel_size + 3 + NO_MARKER ) * m + n ) * sizeof(int); + dsize = (m * panel_size + + NUM_TEMPV(m,panel_size,maxsuper,rowblk)) * sizeof(doublecomplex); + + if ( Glu->MemModel == SYSTEM ) + *iworkptr = (int *) intCalloc(isize/sizeof(int)); + else + *iworkptr = (int *) zuser_malloc(isize, TAIL, Glu); + if ( ! *iworkptr ) { + fprintf(stderr, "zLUWorkInit: malloc fails for local iworkptr[]\n"); + return (isize + n); + } + + if ( Glu->MemModel == SYSTEM ) + *dworkptr = (doublecomplex *) SUPERLU_MALLOC(dsize); + else { + *dworkptr = (doublecomplex *) zuser_malloc(dsize, TAIL, Glu); + if ( NotDoubleAlign(*dworkptr) ) { + old_ptr = *dworkptr; + *dworkptr = (doublecomplex*) DoubleAlign(*dworkptr); + *dworkptr = (doublecomplex*) ((double*)*dworkptr - 1); + extra = (char*)old_ptr - (char*)*dworkptr; +#ifdef DEBUG + printf("zLUWorkInit: not aligned, extra %d\n", extra); +#endif + Glu->stack.top2 -= extra; + Glu->stack.used += extra; + } + } + if ( ! *dworkptr ) { + fprintf(stderr, "malloc fails for local dworkptr[]."); + return (isize + dsize + n); + } + + return 0; +} + + +/*! \brief Set up pointers for real working arrays. + */ +void +zSetRWork(int m, int panel_size, doublecomplex *dworkptr, + doublecomplex **dense, doublecomplex **tempv) +{ + doublecomplex zero = {0.0, 0.0}; + + int maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ), + rowblk = sp_ienv(4); + *dense = dworkptr; + *tempv = *dense + panel_size*m; + zfill (*dense, m * panel_size, zero); + zfill (*tempv, NUM_TEMPV(m,panel_size,maxsuper,rowblk), zero); +} + +/*! \brief Free the working storage used by factor routines. + */ +void zLUWorkFree(int *iwork, doublecomplex *dwork, GlobalLU_t *Glu) +{ + if ( Glu->MemModel == SYSTEM ) { + SUPERLU_FREE (iwork); + SUPERLU_FREE (dwork); + } else { + Glu->stack.used -= (Glu->stack.size - Glu->stack.top2); + Glu->stack.top2 = Glu->stack.size; +/* zStackCompress(Glu); */ + } + + SUPERLU_FREE (Glu->expanders); + Glu->expanders = NULL; +} + +/*! \brief Expand the data structures for L and U during the factorization. + * + *
    + * Return value:   0 - successful return
    + *               > 0 - number of bytes allocated when run out of space
    + * 
    + */ +int +zLUMemXpand(int jcol, + int next, /* number of elements currently in the factors */ + MemType mem_type, /* which type of memory to expand */ + int *maxlen, /* modified - maximum length of a data structure */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + void *new_mem; + +#ifdef DEBUG + printf("zLUMemXpand(): jcol %d, next %d, maxlen %d, MemType %d\n", + jcol, next, *maxlen, mem_type); +#endif + + if (mem_type == USUB) + new_mem = zexpand(maxlen, mem_type, next, 1, Glu); + else + new_mem = zexpand(maxlen, mem_type, next, 0, Glu); + + if ( !new_mem ) { + int nzlmax = Glu->nzlmax; + int nzumax = Glu->nzumax; + int nzlumax = Glu->nzlumax; + fprintf(stderr, "Can't expand MemType %d: jcol %d\n", mem_type, jcol); + return (zmemory_usage(nzlmax, nzumax, nzlumax, Glu->n) + Glu->n); + } + + switch ( mem_type ) { + case LUSUP: + Glu->lusup = (doublecomplex *) new_mem; + Glu->nzlumax = *maxlen; + break; + case UCOL: + Glu->ucol = (doublecomplex *) new_mem; + Glu->nzumax = *maxlen; + break; + case LSUB: + Glu->lsub = (int *) new_mem; + Glu->nzlmax = *maxlen; + break; + case USUB: + Glu->usub = (int *) new_mem; + Glu->nzumax = *maxlen; + break; + } + + return 0; + +} + + + +void +copy_mem_doublecomplex(int howmany, void *old, void *new) +{ + register int i; + doublecomplex *dold = old; + doublecomplex *dnew = new; + for (i = 0; i < howmany; i++) dnew[i] = dold[i]; +} + +/*! \brief Expand the existing storage to accommodate more fill-ins. + */ +void +*zexpand ( + int *prev_len, /* length used from previous call */ + MemType type, /* which part of the memory to expand */ + int len_to_copy, /* size of the memory to be copied to new store */ + int keep_prev, /* = 1: use prev_len; + = 0: compute new_len to expand */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + float EXPAND = 1.5; + float alpha; + void *new_mem, *old_mem; + int new_len, tries, lword, extra, bytes_to_copy; + ExpHeader *expanders = Glu->expanders; /* Array of 4 types of memory */ + + alpha = EXPAND; + + if ( Glu->num_expansions == 0 || keep_prev ) { + /* First time allocate requested */ + new_len = *prev_len; + } else { + new_len = alpha * *prev_len; + } + + if ( type == LSUB || type == USUB ) lword = sizeof(int); + else lword = sizeof(doublecomplex); + + if ( Glu->MemModel == SYSTEM ) { + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + if ( Glu->num_expansions != 0 ) { + tries = 0; + if ( keep_prev ) { + if ( !new_mem ) return (NULL); + } else { + while ( !new_mem ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + new_mem = (void *) SUPERLU_MALLOC((size_t)new_len * lword); + } + } + if ( type == LSUB || type == USUB ) { + copy_mem_int(len_to_copy, expanders[type].mem, new_mem); + } else { + copy_mem_doublecomplex(len_to_copy, expanders[type].mem, new_mem); + } + SUPERLU_FREE (expanders[type].mem); + } + expanders[type].mem = (void *) new_mem; + + } else { /* MemModel == USER */ + if ( Glu->num_expansions == 0 ) { + new_mem = zuser_malloc(new_len * lword, HEAD, Glu); + if ( NotDoubleAlign(new_mem) && + (type == LUSUP || type == UCOL) ) { + old_mem = new_mem; + new_mem = (void *)DoubleAlign(new_mem); + extra = (char*)new_mem - (char*)old_mem; +#ifdef DEBUG + printf("expand(): not aligned, extra %d\n", extra); +#endif + Glu->stack.top1 += extra; + Glu->stack.used += extra; + } + expanders[type].mem = (void *) new_mem; + } else { + tries = 0; + extra = (new_len - *prev_len) * lword; + if ( keep_prev ) { + if ( StackFull(extra) ) return (NULL); + } else { + while ( StackFull(extra) ) { + if ( ++tries > 10 ) return (NULL); + alpha = Reduce(alpha); + new_len = alpha * *prev_len; + extra = (new_len - *prev_len) * lword; + } + } + + if ( type != USUB ) { + new_mem = (void*)((char*)expanders[type + 1].mem + extra); + bytes_to_copy = (char*)Glu->stack.array + Glu->stack.top1 + - (char*)expanders[type + 1].mem; + user_bcopy(expanders[type+1].mem, new_mem, bytes_to_copy); + + if ( type < USUB ) { + Glu->usub = expanders[USUB].mem = + (void*)((char*)expanders[USUB].mem + extra); + } + if ( type < LSUB ) { + Glu->lsub = expanders[LSUB].mem = + (void*)((char*)expanders[LSUB].mem + extra); + } + if ( type < UCOL ) { + Glu->ucol = expanders[UCOL].mem = + (void*)((char*)expanders[UCOL].mem + extra); + } + Glu->stack.top1 += extra; + Glu->stack.used += extra; + if ( type == UCOL ) { + Glu->stack.top1 += extra; /* Add same amount for USUB */ + Glu->stack.used += extra; + } + + } /* if ... */ + + } /* else ... */ + } + + expanders[type].size = new_len; + *prev_len = new_len; + if ( Glu->num_expansions ) ++Glu->num_expansions; + + return (void *) expanders[type].mem; + +} /* zexpand */ + + +/*! \brief Compress the work[] array to remove fragmentation. + */ +void +zStackCompress(GlobalLU_t *Glu) +{ + register int iword, dword, ndim; + char *last, *fragment; + int *ifrom, *ito; + doublecomplex *dfrom, *dto; + int *xlsub, *lsub, *xusub, *usub, *xlusup; + doublecomplex *ucol, *lusup; + + iword = sizeof(int); + dword = sizeof(doublecomplex); + ndim = Glu->n; + + xlsub = Glu->xlsub; + lsub = Glu->lsub; + xusub = Glu->xusub; + usub = Glu->usub; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + lusup = Glu->lusup; + + dfrom = ucol; + dto = (doublecomplex *)((char*)lusup + xlusup[ndim] * dword); + copy_mem_doublecomplex(xusub[ndim], dfrom, dto); + ucol = dto; + + ifrom = lsub; + ito = (int *) ((char*)ucol + xusub[ndim] * iword); + copy_mem_int(xlsub[ndim], ifrom, ito); + lsub = ito; + + ifrom = usub; + ito = (int *) ((char*)lsub + xlsub[ndim] * iword); + copy_mem_int(xusub[ndim], ifrom, ito); + usub = ito; + + last = (char*)usub + xusub[ndim] * iword; + fragment = (char*) (((char*)Glu->stack.array + Glu->stack.top1) - last); + Glu->stack.used -= (long int) fragment; + Glu->stack.top1 -= (long int) fragment; + + Glu->ucol = ucol; + Glu->lsub = lsub; + Glu->usub = usub; + +#ifdef DEBUG + printf("zStackCompress: fragment %d\n", fragment); + /* for (last = 0; last < ndim; ++last) + print_lu_col("After compress:", last, 0);*/ +#endif + +} + +/*! \brief Allocate storage for original matrix A + */ +void +zallocateA(int n, int nnz, doublecomplex **a, int **asub, int **xa) +{ + *a = (doublecomplex *) doublecomplexMalloc(nnz); + *asub = (int *) intMalloc(nnz); + *xa = (int *) intMalloc(n+1); +} + + +doublecomplex *doublecomplexMalloc(int n) +{ + doublecomplex *buf; + buf = (doublecomplex *) SUPERLU_MALLOC((size_t)n * sizeof(doublecomplex)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in doublecomplexMalloc()\n"); + } + return (buf); +} + +doublecomplex *doublecomplexCalloc(int n) +{ + doublecomplex *buf; + register int i; + doublecomplex zero = {0.0, 0.0}; + buf = (doublecomplex *) SUPERLU_MALLOC((size_t)n * sizeof(doublecomplex)); + if ( !buf ) { + ABORT("SUPERLU_MALLOC failed for buf in doublecomplexCalloc()\n"); + } + for (i = 0; i < n; ++i) buf[i] = zero; + return (buf); +} + + +int zmemory_usage(const int nzlmax, const int nzumax, + const int nzlumax, const int n) +{ + register int iword, dword; + + iword = sizeof(int); + dword = sizeof(doublecomplex); + + return (10 * n * iword + + nzlmax * iword + nzumax * (iword + dword) + nzlumax * dword); + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zmyblas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/zmyblas2.c new file mode 100644 index 0000000..eae1c5a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zmyblas2.c @@ -0,0 +1,188 @@ + +/*! @file zmyblas2.c + * \brief Level 2 Blas operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + * Purpose: + * Level 2 BLAS operations: solves and matvec, written in C. + * Note: + * This is only used when the system lacks an efficient BLAS library. + * + */ +/* + * File name: zmyblas2.c + */ +#include "slu_dcomplex.h" + +/*! \brief Solves a dense UNIT lower triangular system + * + * The unit lower + * triangular matrix is stored in a 2D array M(1:nrow,1:ncol). + * The solution will be returned in the rhs vector. + */ +void zlsolve ( int ldm, int ncol, doublecomplex *M, doublecomplex *rhs ) +{ + int k; + doublecomplex x0, x1, x2, x3, temp; + doublecomplex *M0; + doublecomplex *Mki0, *Mki1, *Mki2, *Mki3; + register int firstcol = 0; + + M0 = &M[0]; + + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + Mki2 = Mki1 + ldm + 1; + Mki3 = Mki2 + ldm + 1; + + x0 = rhs[firstcol]; + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&x1, &rhs[firstcol+1], &temp); + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&x2, &rhs[firstcol+2], &temp); + zz_mult(&temp, &x1, Mki1); Mki1++; + z_sub(&x2, &x2, &temp); + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&x3, &rhs[firstcol+3], &temp); + zz_mult(&temp, &x1, Mki1); Mki1++; + z_sub(&x3, &x3, &temp); + zz_mult(&temp, &x2, Mki2); Mki2++; + z_sub(&x3, &x3, &temp); + + rhs[++firstcol] = x1; + rhs[++firstcol] = x2; + rhs[++firstcol] = x3; + ++firstcol; + + for (k = firstcol; k < ncol; k++) { + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&rhs[k], &rhs[k], &temp); + zz_mult(&temp, &x1, Mki1); Mki1++; + z_sub(&rhs[k], &rhs[k], &temp); + zz_mult(&temp, &x2, Mki2); Mki2++; + z_sub(&rhs[k], &rhs[k], &temp); + zz_mult(&temp, &x3, Mki3); Mki3++; + z_sub(&rhs[k], &rhs[k], &temp); + } + + M0 += 4 * ldm + 4; + } + + if ( firstcol < ncol - 1 ) { /* Do 2 columns */ + Mki0 = M0 + 1; + Mki1 = Mki0 + ldm + 1; + + x0 = rhs[firstcol]; + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&x1, &rhs[firstcol+1], &temp); + + rhs[++firstcol] = x1; + ++firstcol; + + for (k = firstcol; k < ncol; k++) { + zz_mult(&temp, &x0, Mki0); Mki0++; + z_sub(&rhs[k], &rhs[k], &temp); + zz_mult(&temp, &x1, Mki1); Mki1++; + z_sub(&rhs[k], &rhs[k], &temp); + } + } + +} + +/*! \brief Solves a dense upper triangular system. + * + * The upper triangular matrix is + * stored in a 2-dim array M(1:ldm,1:ncol). The solution will be returned + * in the rhs vector. + */ +void +zusolve ( ldm, ncol, M, rhs ) +int ldm; /* in */ +int ncol; /* in */ +doublecomplex *M; /* in */ +doublecomplex *rhs; /* modified */ +{ + doublecomplex xj, temp; + int jcol, j, irow; + + jcol = ncol - 1; + + for (j = 0; j < ncol; j++) { + + z_div(&xj, &rhs[jcol], &M[jcol + jcol*ldm]); /* M(jcol, jcol) */ + rhs[jcol] = xj; + + for (irow = 0; irow < jcol; irow++) { + zz_mult(&temp, &xj, &M[irow+jcol*ldm]); /* M(irow, jcol) */ + z_sub(&rhs[irow], &rhs[irow], &temp); + } + + jcol--; + + } +} + + +/*! \brief Performs a dense matrix-vector multiply: Mxvec = Mxvec + M * vec. + * + * The input matrix is M(1:nrow,1:ncol); The product is returned in Mxvec[]. + */ +void zmatvec ( ldm, nrow, ncol, M, vec, Mxvec ) +int ldm; /* in -- leading dimension of M */ +int nrow; /* in */ +int ncol; /* in */ +doublecomplex *M; /* in */ +doublecomplex *vec; /* in */ +doublecomplex *Mxvec; /* in/out */ +{ + doublecomplex vi0, vi1, vi2, vi3; + doublecomplex *M0, temp; + doublecomplex *Mki0, *Mki1, *Mki2, *Mki3; + register int firstcol = 0; + int k; + + M0 = &M[0]; + + while ( firstcol < ncol - 3 ) { /* Do 4 columns */ + Mki0 = M0; + Mki1 = Mki0 + ldm; + Mki2 = Mki1 + ldm; + Mki3 = Mki2 + ldm; + + vi0 = vec[firstcol++]; + vi1 = vec[firstcol++]; + vi2 = vec[firstcol++]; + vi3 = vec[firstcol++]; + for (k = 0; k < nrow; k++) { + zz_mult(&temp, &vi0, Mki0); Mki0++; + z_add(&Mxvec[k], &Mxvec[k], &temp); + zz_mult(&temp, &vi1, Mki1); Mki1++; + z_add(&Mxvec[k], &Mxvec[k], &temp); + zz_mult(&temp, &vi2, Mki2); Mki2++; + z_add(&Mxvec[k], &Mxvec[k], &temp); + zz_mult(&temp, &vi3, Mki3); Mki3++; + z_add(&Mxvec[k], &Mxvec[k], &temp); + } + + M0 += 4 * ldm; + } + + while ( firstcol < ncol ) { /* Do 1 column */ + Mki0 = M0; + vi0 = vec[firstcol++]; + for (k = 0; k < nrow; k++) { + zz_mult(&temp, &vi0, Mki0); Mki0++; + z_add(&Mxvec[k], &Mxvec[k], &temp); + } + M0 += ldm; + } + +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_bmod.c new file mode 100644 index 0000000..7893277 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_bmod.c @@ -0,0 +1,487 @@ + +/*! @file zpanel_bmod.c + * \brief Performs numeric block updates + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ +/* + +*/ + +#include +#include +#include "slu_zdefs.h" + +/* + * Function prototypes + */ +void zlsolve(int, int, doublecomplex *, doublecomplex *); +void zmatvec(int, int, int, doublecomplex *, doublecomplex *, doublecomplex *); +extern void zcheck_tempv(); + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *    Performs numeric block updates (sup-panel) in topological order.
    + *    It features: col-col, 2cols-col, 3cols-col, and sup-col updates.
    + *    Special processing on the supernodal portion of L\U[*,j]
    + *
    + *    Before entering this routine, the original nonzeros in the panel 
    + *    were already copied into the spa[m,w].
    + *
    + *    Updated/Output parameters-
    + *    dense[0:m-1,w]: L[*,j:j+w-1] and U[*,j:j+w-1] are returned 
    + *    collectively in the m-by-w vector dense[*]. 
    + * 
    + */ + +void +zpanel_bmod ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + const int nseg, /* in */ + doublecomplex *dense, /* out, of size n by w */ + doublecomplex *tempv, /* working array */ + int *segrep, /* in */ + int *repfnz, /* in, of size n by w */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ + + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + doublecomplex alpha, beta; +#endif + + register int k, ksub; + int fsupc, nsupc, nsupr, nrow; + int krep, krep_ind; + doublecomplex ukj, ukj1, ukj2; + int luptr, luptr1, luptr2; + int segsze; + int block_nrow; /* no of rows in a block row */ + register int lptr; /* Points to the row subscripts of a supernode */ + int kfnz, irow, no_zeros; + register int isub, isub1, i; + register int jj; /* Index through each column in the panel */ + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + int *repfnz_col; /* repfnz[] for a column in the panel */ + doublecomplex *dense_col; /* dense[] for a column in the panel */ + doublecomplex *tempv1; /* Used in 1-D update */ + doublecomplex *TriTmp, *MatvecTmp; /* used in 2-D update */ + doublecomplex zero = {0.0, 0.0}; + doublecomplex one = {1.0, 0.0}; + doublecomplex comp_temp, comp_temp1; + register int ldaTmp; + register int r_ind, r_hi; + static int first = 1, maxsuper, rowblk, colblk; + flops_t *ops = stat->ops; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + if ( first ) { + maxsuper = SUPERLU_MAX( sp_ienv(3), sp_ienv(7) ); + rowblk = sp_ienv(4); + colblk = sp_ienv(5); + first = 0; + } + ldaTmp = maxsuper + rowblk; + + /* + * For each nonz supernode segment of U[*,j] in topological order + */ + k = nseg - 1; + for (ksub = 0; ksub < nseg; ksub++) { /* for each updating supernode */ + + /* krep = representative of current k-th supernode + * fsupc = first supernodal column + * nsupc = no of columns in a supernode + * nsupr = no of rows in a supernode + */ + krep = segrep[k--]; + fsupc = xsup[supno[krep]]; + nsupc = krep - fsupc + 1; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nrow = nsupr - nsupc; + lptr = xlsub[fsupc]; + krep_ind = lptr + nsupc - 1; + + repfnz_col = repfnz; + dense_col = dense; + + if ( nsupc >= colblk && nrow > rowblk ) { /* 2-D block update */ + + TriTmp = tempv; + + /* Sequence through each column in panel -- triangular solves */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp ) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += 4 * segsze * (segsze - 1); + ops[GEMV] += 8 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + z_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + zz_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + z_sub(&ukj1, &ukj1, &comp_temp); + + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + luptr++; luptr1++; luptr2++; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } + + } else { /* segsze >= 4 */ + + /* Copy U[*,j] segment from dense[*] to TriTmp[*], which + holds the result of triangular solves. */ + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + TriTmp[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#else + ztrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, TriTmp, &incx ); +#endif +#else + zlsolve ( nsupr, segsze, &lusup[luptr], TriTmp ); +#endif + + + } /* else ... */ + + } /* for jj ... end tri-solves */ + + /* Block row updates; push all the way into dense[*] block */ + for ( r_ind = 0; r_ind < nrow; r_ind += rowblk ) { + + r_hi = SUPERLU_MIN(nrow, r_ind + rowblk); + block_nrow = SUPERLU_MIN(rowblk, r_hi - r_ind); + luptr = xlusup[fsupc] + nsupc + r_ind; + isub1 = lptr + nsupc + r_ind; + + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + /* Sequence through each column in panel -- matrix-vector */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + /* Perform a block update, and scatter the result of + matrix-vector to dense[]. */ + no_zeros = kfnz - fsupc; + luptr1 = luptr + nsupr * no_zeros; + MatvecTmp = &TriTmp[maxsuper]; + +#ifdef USE_VENDOR_BLAS + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV(ftcs2, &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#else + zgemv_("N", &block_nrow, &segsze, &alpha, &lusup[luptr1], + &nsupr, TriTmp, &incx, &beta, MatvecTmp, &incy); +#endif +#else + zmatvec(nsupr, block_nrow, segsze, &lusup[luptr1], + TriTmp, MatvecTmp); +#endif + + /* Scatter MatvecTmp[*] into SPA dense[*] temporarily + * such that MatvecTmp[*] can be re-used for the + * the next blok row update. dense[] will be copied into + * global store after the whole panel has been finished. + */ + isub = isub1; + for (i = 0; i < block_nrow; i++) { + irow = lsub[isub]; + z_sub(&dense_col[irow], &dense_col[irow], + &MatvecTmp[i]); + MatvecTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } /* for each block row ... */ + + /* Scatter the triangular solves into SPA dense[*] */ + repfnz_col = repfnz; + TriTmp = tempv; + dense_col = dense; + + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m, TriTmp += ldaTmp) { + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + if ( segsze <= 3 ) continue; /* skip unrolled cases */ + + no_zeros = kfnz - fsupc; + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = TriTmp[i]; + TriTmp[i] = zero; + ++isub; + } + + } /* for jj ... */ + + } else { /* 1-D block modification */ + + + /* Sequence through each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++, + repfnz_col += m, dense_col += m) { + + kfnz = repfnz_col[krep]; + if ( kfnz == EMPTY ) continue; /* Skip any zero segment */ + + segsze = krep - kfnz + 1; + luptr = xlusup[fsupc]; + + ops[TRSV] += 4 * segsze * (segsze - 1); + ops[GEMV] += 8 * nrow * segsze; + + /* Case 1: Update U-segment of size 1 -- col-col update */ + if ( segsze == 1 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc; + + for (i = lptr + nsupc; i < xlsub[fsupc+1]; i++) { + irow = lsub[i]; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + ++luptr; + } + + } else if ( segsze <= 3 ) { + ukj = dense_col[lsub[krep_ind]]; + luptr += nsupr*(nsupc-1) + nsupc-1; + ukj1 = dense_col[lsub[krep_ind - 1]]; + luptr1 = luptr - nsupr; + + if ( segsze == 2 ) { + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + z_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } else { + ukj2 = dense_col[lsub[krep_ind - 2]]; + luptr2 = luptr1 - nsupr; + zz_mult(&comp_temp, &ukj2, &lusup[luptr2-1]); + z_sub(&ukj1, &ukj1, &comp_temp); + + zz_mult(&comp_temp, &ukj1, &lusup[luptr1]); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&ukj, &ukj, &comp_temp); + dense_col[lsub[krep_ind]] = ukj; + dense_col[lsub[krep_ind-1]] = ukj1; + for (i = lptr + nsupc; i < xlsub[fsupc+1]; ++i) { + irow = lsub[i]; + ++luptr; ++luptr1; ++luptr2; + zz_mult(&comp_temp, &ukj, &lusup[luptr]); + zz_mult(&comp_temp1, &ukj1, &lusup[luptr1]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + zz_mult(&comp_temp1, &ukj2, &lusup[luptr2]); + z_add(&comp_temp, &comp_temp, &comp_temp1); + z_sub(&dense_col[irow], &dense_col[irow], &comp_temp); + } + } + + } else { /* segsze >= 4 */ + /* + * Perform a triangular solve and block update, + * then scatter the result of sup-col update to dense[]. + */ + no_zeros = kfnz - fsupc; + + /* Copy U[*,j] segment from dense[*] to tempv[*]: + * The result of triangular solve is in tempv[*]; + * The result of matrix vector update is in dense_col[*] + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; ++i) { + irow = lsub[isub]; + tempv[i] = dense_col[irow]; /* Gather */ + ++isub; + } + + /* start effective triangle */ + luptr += nsupr * no_zeros + no_zeros; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#else + ztrsv_( "L", "N", "U", &segsze, &lusup[luptr], + &nsupr, tempv, &incx ); +#endif + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + alpha = one; + beta = zero; +#ifdef _CRAY + CGEMV( ftcs2, &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#else + zgemv_( "N", &nrow, &segsze, &alpha, &lusup[luptr], + &nsupr, tempv, &incx, &beta, tempv1, &incy ); +#endif +#else + zlsolve ( nsupr, segsze, &lusup[luptr], tempv ); + + luptr += segsze; /* Dense matrix-vector */ + tempv1 = &tempv[segsze]; + zmatvec (nsupr, nrow, segsze, &lusup[luptr], tempv, tempv1); +#endif + + /* Scatter tempv[*] into SPA dense[*] temporarily, such + * that tempv[*] can be used for the triangular solve of + * the next column of the panel. They will be copied into + * ucol[*] after the whole panel has been finished. + */ + isub = lptr + no_zeros; + for (i = 0; i < segsze; i++) { + irow = lsub[isub]; + dense_col[irow] = tempv[i]; + tempv[i] = zero; + isub++; + } + + /* Scatter the update from tempv1[*] into SPA dense[*] */ + /* Start dense rectangular L */ + for (i = 0; i < nrow; i++) { + irow = lsub[isub]; + z_sub(&dense_col[irow], &dense_col[irow], &tempv1[i]); + tempv1[i] = zero; + ++isub; + } + + } /* else segsze>=4 ... */ + + } /* for each column in the panel... */ + + } /* else 1-D update ... */ + + } /* for each updating supernode ... */ + +} + + + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_dfs.c new file mode 100644 index 0000000..e05766f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zpanel_dfs.c @@ -0,0 +1,254 @@ + +/*! @file zpanel_dfs.c + * \brief Peforms a symbolic factorization on a panel of symbols + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + *   Performs a symbolic factorization on a panel of columns [jcol, jcol+w).
    + *
    + *   A supernode representative is the last column of a supernode.
    + *   The nonzeros in U[*,j] are segments that end at supernodal
    + *   representatives.
    + *
    + *   The routine returns one list of the supernodal representatives
    + *   in topological order of the dfs that generates them. This list is
    + *   a superset of the topological order of each individual column within
    + *   the panel. 
    + *   The location of the first nonzero in each supernodal segment
    + *   (supernodal entry location) is also returned. Each column has a 
    + *   separate list for this purpose.
    + *
    + *   Two marker arrays are used for dfs:
    + *     marker[i] == jj, if i was visited during dfs of current column jj;
    + *     marker1[i] >= jcol, if i was visited by earlier columns in this panel;
    + *
    + *   marker: A-row --> A-row/col (0/1)
    + *   repfnz: SuperA-col --> PA-row
    + *   parent: SuperA-col --> SuperA-col
    + *   xplore: SuperA-col --> index to L-structure
    + * 
    + */ + +void +zpanel_dfs ( + const int m, /* in - number of rows in the matrix */ + const int w, /* in */ + const int jcol, /* in */ + SuperMatrix *A, /* in - original matrix */ + int *perm_r, /* in */ + int *nseg, /* out */ + doublecomplex *dense, /* out */ + int *panel_lsub, /* out */ + int *segrep, /* out */ + int *repfnz, /* out */ + int *xprune, /* out */ + int *marker, /* out */ + int *parent, /* working array */ + int *xplore, /* working array */ + GlobalLU_t *Glu /* modified */ + ) +{ + + NCPformat *Astore; + doublecomplex *a; + int *asub; + int *xa_begin, *xa_end; + int krep, chperm, chmark, chrep, oldrep, kchild, myfnz; + int k, krow, kmark, kperm; + int xdfs, maxdfs, kpar; + int jj; /* index through each column in the panel */ + int *marker1; /* marker1[jj] >= jcol if vertex jj was visited + by a previous column within this panel. */ + int *repfnz_col; /* start of each column in the panel */ + doublecomplex *dense_col; /* start of each column in the panel */ + int nextl_col; /* next available position in panel_lsub[*,jj] */ + int *xsup, *supno; + int *lsub, *xlsub; + + /* Initialize pointers */ + Astore = A->Store; + a = Astore->nzval; + asub = Astore->rowind; + xa_begin = Astore->colbeg; + xa_end = Astore->colend; + marker1 = marker + m; + repfnz_col = repfnz; + dense_col = dense; + *nseg = 0; + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + + /* For each column in the panel */ + for (jj = jcol; jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; + +#ifdef CHK_DFS + printf("\npanel col %d: ", jj); +#endif + + /* For each nonz in A[*,jj] do dfs */ + for (k = xa_begin[jj]; k < xa_end[jj]; k++) { + krow = asub[k]; + dense_col[krow] = a[k]; + kmark = marker[krow]; + if ( kmark == jj ) + continue; /* krow visited before, go to the next nonzero */ + + /* For each unmarked nbr krow of jj + * krow is in L: place it in structure of L[*,jj] + */ + marker[krow] = jj; + kperm = perm_r[krow]; + + if ( kperm == EMPTY ) { + panel_lsub[nextl_col++] = krow; /* krow is indexed into A */ + } + /* + * krow is in U: if its supernode-rep krep + * has been explored, update repfnz[*] + */ + else { + + krep = xsup[supno[kperm]+1] - 1; + myfnz = repfnz_col[krep]; + +#ifdef CHK_DFS + printf("krep %d, myfnz %d, perm_r[%d] %d\n", krep, myfnz, krow, kperm); +#endif + if ( myfnz != EMPTY ) { /* Representative visited before */ + if ( myfnz > kperm ) repfnz_col[krep] = kperm; + /* continue; */ + } + else { + /* Otherwise, perform dfs starting at krep */ + oldrep = EMPTY; + parent[krep] = oldrep; + repfnz_col[krep] = kperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + do { + /* + * For each unmarked kchild of krep + */ + while ( xdfs < maxdfs ) { + + kchild = lsub[xdfs]; + xdfs++; + chmark = marker[kchild]; + + if ( chmark != jj ) { /* Not reached yet */ + marker[kchild] = jj; + chperm = perm_r[kchild]; + + /* Case kchild is in L: place it in L[*,j] */ + if ( chperm == EMPTY ) { + panel_lsub[nextl_col++] = kchild; + } + /* Case kchild is in U: + * chrep = its supernode-rep. If its rep has + * been explored, update its repfnz[*] + */ + else { + + chrep = xsup[supno[chperm]+1] - 1; + myfnz = repfnz_col[chrep]; +#ifdef CHK_DFS + printf("chrep %d,myfnz %d,perm_r[%d] %d\n",chrep,myfnz,kchild,chperm); +#endif + if ( myfnz != EMPTY ) { /* Visited before */ + if ( myfnz > chperm ) + repfnz_col[chrep] = chperm; + } + else { + /* Cont. dfs at snode-rep of kchild */ + xplore[krep] = xdfs; + oldrep = krep; + krep = chrep; /* Go deeper down G(L) */ + parent[krep] = oldrep; + repfnz_col[krep] = chperm; + xdfs = xlsub[krep]; + maxdfs = xprune[krep]; +#ifdef CHK_DFS + printf(" xdfs %d, maxdfs %d: ", xdfs, maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } /* else */ + + } /* else */ + + } /* if... */ + + } /* while xdfs < maxdfs */ + + /* krow has no more unexplored nbrs: + * Place snode-rep krep in postorder DFS, if this + * segment is seen for the first time. (Note that + * "repfnz[krep]" may change later.) + * Backtrack dfs to its parent. + */ + if ( marker1[krep] < jcol ) { + segrep[*nseg] = krep; + ++(*nseg); + marker1[krep] = jj; + } + + kpar = parent[krep]; /* Pop stack, mimic recursion */ + if ( kpar == EMPTY ) break; /* dfs done */ + krep = kpar; + xdfs = xplore[krep]; + maxdfs = xprune[krep]; + +#ifdef CHK_DFS + printf(" pop stack: krep %d,xdfs %d,maxdfs %d: ", krep,xdfs,maxdfs); + for (i = xdfs; i < maxdfs; i++) printf(" %d", lsub[i]); + printf("\n"); +#endif + } while ( kpar != EMPTY ); /* do-while - until empty stack */ + + } /* else */ + + } /* else */ + + } /* for each nonz in A[*,jj] */ + + repfnz_col += m; /* Move to next column */ + dense_col += m; + + } /* for jj ... */ + +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zpivotL.c b/thirdparty/superlu/SuperLU_4.1/SRC/zpivotL.c new file mode 100644 index 0000000..ce4f513 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zpivotL.c @@ -0,0 +1,185 @@ + +/*! @file zpivotL.c + * \brief Performs numerical pivoting + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include +#include "slu_zdefs.h" + +#undef DEBUG + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Performs the numerical pivoting on the current column of L,
    + *   and the CDIV operation.
    + *
    + *   Pivot policy:
    + *   (1) Compute thresh = u * max_(i>=j) abs(A_ij);
    + *   (2) IF user specifies pivot row k and abs(A_kj) >= thresh THEN
    + *           pivot row = k;
    + *       ELSE IF abs(A_jj) >= thresh THEN
    + *           pivot row = j;
    + *       ELSE
    + *           pivot row = m;
    + * 
    + *   Note: If you absolutely want to use a given pivot order, then set u=0.0.
    + *
    + *   Return value: 0      success;
    + *                 i > 0  U(i,i) is exactly zero.
    + * 
    + */ + +int +zpivotL( + const int jcol, /* in */ + const double u, /* in - diagonal pivoting threshold */ + int *usepr, /* re-use the pivot sequence given by perm_r/iperm_r */ + int *perm_r, /* may be modified */ + int *iperm_r, /* in - inverse of perm_r */ + int *iperm_c, /* in - used to find diagonal of Pc*A*Pc' */ + int *pivrow, /* out */ + GlobalLU_t *Glu, /* modified - global LU data structures */ + SuperLUStat_t *stat /* output */ + ) +{ + + doublecomplex one = {1.0, 0.0}; + int fsupc; /* first column in the supernode */ + int nsupc; /* no of columns in the supernode */ + int nsupr; /* no of rows in the supernode */ + int lptr; /* points to the starting subscript of the supernode */ + int pivptr, old_pivptr, diag, diagind; + double pivmax, rtemp, thresh; + doublecomplex temp; + doublecomplex *lu_sup_ptr; + doublecomplex *lu_col_ptr; + int *lsub_ptr; + int isub, icol, k, itemp; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + /* Initialize pointers */ + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + fsupc = (Glu->xsup)[(Glu->supno)[jcol]]; + nsupc = jcol - fsupc; /* excluding jcol; nsupc >= 0 */ + lptr = xlsub[fsupc]; + nsupr = xlsub[fsupc+1] - lptr; + lu_sup_ptr = &lusup[xlusup[fsupc]]; /* start of the current supernode */ + lu_col_ptr = &lusup[xlusup[jcol]]; /* start of jcol in the supernode */ + lsub_ptr = &lsub[lptr]; /* start of row indices of the supernode */ + +#ifdef DEBUG +if ( jcol == MIN_COL ) { + printf("Before cdiv: col %d\n", jcol); + for (k = nsupc; k < nsupr; k++) + printf(" lu[%d] %f\n", lsub_ptr[k], lu_col_ptr[k]); +} +#endif + + /* Determine the largest abs numerical value for partial pivoting; + Also search for user-specified pivot, and diagonal element. */ + if ( *usepr ) *pivrow = iperm_r[jcol]; + diagind = iperm_c[jcol]; + pivmax = 0.0; + pivptr = nsupc; + diag = EMPTY; + old_pivptr = nsupc; + for (isub = nsupc; isub < nsupr; ++isub) { + rtemp = z_abs1 (&lu_col_ptr[isub]); + if ( rtemp > pivmax ) { + pivmax = rtemp; + pivptr = isub; + } + if ( *usepr && lsub_ptr[isub] == *pivrow ) old_pivptr = isub; + if ( lsub_ptr[isub] == diagind ) diag = isub; + } + + /* Test for singularity */ + if ( pivmax == 0.0 ) { +#if 1 + *pivrow = lsub_ptr[pivptr]; + perm_r[*pivrow] = jcol; +#else + perm_r[diagind] = jcol; +#endif + *usepr = 0; + return (jcol+1); + } + + thresh = u * pivmax; + + /* Choose appropriate pivotal element by our policy. */ + if ( *usepr ) { + rtemp = z_abs1 (&lu_col_ptr[old_pivptr]); + if ( rtemp != 0.0 && rtemp >= thresh ) + pivptr = old_pivptr; + else + *usepr = 0; + } + if ( *usepr == 0 ) { + /* Use diagonal pivot? */ + if ( diag >= 0 ) { /* diagonal exists */ + rtemp = z_abs1 (&lu_col_ptr[diag]); + if ( rtemp != 0.0 && rtemp >= thresh ) pivptr = diag; + } + *pivrow = lsub_ptr[pivptr]; + } + + /* Record pivot row */ + perm_r[*pivrow] = jcol; + + /* Interchange row subscripts */ + if ( pivptr != nsupc ) { + itemp = lsub_ptr[pivptr]; + lsub_ptr[pivptr] = lsub_ptr[nsupc]; + lsub_ptr[nsupc] = itemp; + + /* Interchange numerical values as well, for the whole snode, such + * that L is indexed the same way as A. + */ + for (icol = 0; icol <= nsupc; icol++) { + itemp = pivptr + icol * nsupr; + temp = lu_sup_ptr[itemp]; + lu_sup_ptr[itemp] = lu_sup_ptr[nsupc + icol*nsupr]; + lu_sup_ptr[nsupc + icol*nsupr] = temp; + } + } /* if */ + + /* cdiv operation */ + ops[FACT] += 10 * (nsupr - nsupc); + + z_div(&temp, &one, &lu_col_ptr[nsupc]); + for (k = nsupc+1; k < nsupr; k++) + zz_mult(&lu_col_ptr[k], &lu_col_ptr[k], &temp); + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zpivotgrowth.c b/thirdparty/superlu/SuperLU_4.1/SRC/zpivotgrowth.c new file mode 100644 index 0000000..1b3ebed --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zpivotgrowth.c @@ -0,0 +1,114 @@ + +/*! @file zpivotgrowth.c + * \brief Computes the reciprocal pivot growth factor + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +#include +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *
    + * Compute the reciprocal pivot growth factor of the leading ncols columns
    + * of the matrix, using the formula:
    + *     min_j ( max_i(abs(A_ij)) / max_i(abs(U_ij)) )
    + *
    + * Arguments
    + * =========
    + *
    + * ncols    (input) int
    + *          The number of columns of matrices A, L and U.
    + *
    + * A        (input) SuperMatrix*
    + *	    Original matrix A, permuted by columns, of dimension
    + *          (A->nrow, A->ncol). The type of A can be:
    + *          Stype = NC; Dtype = SLU_Z; Mtype = GE.
    + *
    + * L        (output) SuperMatrix*
    + *          The factor L from the factorization Pr*A=L*U; use compressed row 
    + *          subscripts storage for supernodes, i.e., L has type: 
    + *          Stype = SC; Dtype = SLU_Z; Mtype = TRLU.
    + *
    + * U        (output) SuperMatrix*
    + *	    The factor U from the factorization Pr*A*Pc=L*U. Use column-wise
    + *          storage scheme, i.e., U has types: Stype = NC;
    + *          Dtype = SLU_Z; Mtype = TRU.
    + * 
    + */ + +double +zPivotGrowth(int ncols, SuperMatrix *A, int *perm_c, + SuperMatrix *L, SuperMatrix *U) +{ + + NCformat *Astore; + SCformat *Lstore; + NCformat *Ustore; + doublecomplex *Aval, *Lval, *Uval; + int fsupc, nsupr, luptr, nz_in_U; + int i, j, k, oldcol; + int *inv_perm_c; + double rpg, maxaj, maxuj; + double smlnum; + doublecomplex *luval; + doublecomplex temp_comp; + + /* Get machine constants. */ + smlnum = dlamch_("S"); + rpg = 1. / smlnum; + + Astore = A->Store; + Lstore = L->Store; + Ustore = U->Store; + Aval = Astore->nzval; + Lval = Lstore->nzval; + Uval = Ustore->nzval; + + inv_perm_c = (int *) SUPERLU_MALLOC(A->ncol*sizeof(int)); + for (j = 0; j < A->ncol; ++j) inv_perm_c[perm_c[j]] = j; + + for (k = 0; k <= Lstore->nsuper; ++k) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + luptr = L_NZ_START(fsupc); + luval = &Lval[luptr]; + nz_in_U = 1; + + for (j = fsupc; j < L_FST_SUPC(k+1) && j < ncols; ++j) { + maxaj = 0.; + oldcol = inv_perm_c[j]; + for (i = Astore->colptr[oldcol]; i < Astore->colptr[oldcol+1]; ++i) + maxaj = SUPERLU_MAX( maxaj, z_abs1( &Aval[i]) ); + + maxuj = 0.; + for (i = Ustore->colptr[j]; i < Ustore->colptr[j+1]; i++) + maxuj = SUPERLU_MAX( maxuj, z_abs1( &Uval[i]) ); + + /* Supernode */ + for (i = 0; i < nz_in_U; ++i) + maxuj = SUPERLU_MAX( maxuj, z_abs1( &luval[i]) ); + + ++nz_in_U; + luval += nsupr; + + if ( maxuj == 0. ) + rpg = SUPERLU_MIN( rpg, 1.); + else + rpg = SUPERLU_MIN( rpg, maxaj / maxuj ); + } + + if ( j >= ncols ) break; + } + + SUPERLU_FREE(inv_perm_c); + return (rpg); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zpruneL.c b/thirdparty/superlu/SuperLU_4.1/SRC/zpruneL.c new file mode 100644 index 0000000..8aa7081 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zpruneL.c @@ -0,0 +1,154 @@ + +/*! @file zpruneL.c + * \brief Prunes the L-structure + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + *
    + */ + + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *   Prunes the L-structure of supernodes whose L-structure
    + *   contains the current pivot row "pivrow"
    + * 
    + */ + +void +zpruneL( + const int jcol, /* in */ + const int *perm_r, /* in */ + const int pivrow, /* in */ + const int nseg, /* in */ + const int *segrep, /* in */ + const int *repfnz, /* in */ + int *xprune, /* out */ + GlobalLU_t *Glu /* modified - global LU data structures */ + ) +{ + + doublecomplex utemp; + int jsupno, irep, irep1, kmin, kmax, krow, movnum; + int i, ktemp, minloc, maxloc; + int do_prune; /* logical variable */ + int *xsup, *supno; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + /* + * For each supernode-rep irep in U[*,j] + */ + jsupno = supno[jcol]; + for (i = 0; i < nseg; i++) { + + irep = segrep[i]; + irep1 = irep + 1; + do_prune = FALSE; + + /* Don't prune with a zero U-segment */ + if ( repfnz[irep] == EMPTY ) + continue; + + /* If a snode overlaps with the next panel, then the U-segment + * is fragmented into two parts -- irep and irep1. We should let + * pruning occur at the rep-column in irep1's snode. + */ + if ( supno[irep] == supno[irep1] ) /* Don't prune */ + continue; + + /* + * If it has not been pruned & it has a nonz in row L[pivrow,i] + */ + if ( supno[irep] != jsupno ) { + if ( xprune[irep] >= xlsub[irep1] ) { + kmin = xlsub[irep]; + kmax = xlsub[irep1] - 1; + for (krow = kmin; krow <= kmax; krow++) + if ( lsub[krow] == pivrow ) { + do_prune = TRUE; + break; + } + } + + if ( do_prune ) { + + /* Do a quicksort-type partition + * movnum=TRUE means that the num values have to be exchanged. + */ + movnum = FALSE; + if ( irep == xsup[supno[irep]] ) /* Snode of size 1 */ + movnum = TRUE; + + while ( kmin <= kmax ) { + + if ( perm_r[lsub[kmax]] == EMPTY ) + kmax--; + else if ( perm_r[lsub[kmin]] != EMPTY ) + kmin++; + else { /* kmin below pivrow (not yet pivoted), and kmax + * above pivrow: interchange the two subscripts + */ + ktemp = lsub[kmin]; + lsub[kmin] = lsub[kmax]; + lsub[kmax] = ktemp; + + /* If the supernode has only one column, then we + * only keep one set of subscripts. For any subscript + * interchange performed, similar interchange must be + * done on the numerical values. + */ + if ( movnum ) { + minloc = xlusup[irep] + (kmin - xlsub[irep]); + maxloc = xlusup[irep] + (kmax - xlsub[irep]); + utemp = lusup[minloc]; + lusup[minloc] = lusup[maxloc]; + lusup[maxloc] = utemp; + } + + kmin++; + kmax--; + + } + + } /* while */ + + xprune[irep] = kmin; /* Pruning */ + +#ifdef CHK_PRUNE + printf(" After zpruneL(),using col %d: xprune[%d] = %d\n", + jcol, irep, kmin); +#endif + } /* if do_prune */ + + } /* if */ + + } /* for each U-segment... */ +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zreadhb.c b/thirdparty/superlu/SuperLU_4.1/SRC/zreadhb.c new file mode 100644 index 0000000..3128228 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zreadhb.c @@ -0,0 +1,267 @@ + +/*! @file zreadhb.c + * \brief Read a matrix stored in Harwell-Boeing format + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Purpose
    + * =======
    + * 
    + * Read a DOUBLE COMPLEX PRECISION matrix stored in Harwell-Boeing format 
    + * as described below.
    + * 
    + * Line 1 (A72,A8) 
    + *  	Col. 1 - 72   Title (TITLE) 
    + *	Col. 73 - 80  Key (KEY) 
    + * 
    + * Line 2 (5I14) 
    + * 	Col. 1 - 14   Total number of lines excluding header (TOTCRD) 
    + * 	Col. 15 - 28  Number of lines for pointers (PTRCRD) 
    + * 	Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD) 
    + * 	Col. 43 - 56  Number of lines for numerical values (VALCRD) 
    + *	Col. 57 - 70  Number of lines for right-hand sides (RHSCRD) 
    + *                    (including starting guesses and solution vectors 
    + *		       if present) 
    + *           	      (zero indicates no right-hand side data is present) 
    + *
    + * Line 3 (A3, 11X, 4I14) 
    + *   	Col. 1 - 3    Matrix type (see below) (MXTYPE) 
    + * 	Col. 15 - 28  Number of rows (or variables) (NROW) 
    + * 	Col. 29 - 42  Number of columns (or elements) (NCOL) 
    + *	Col. 43 - 56  Number of row (or variable) indices (NNZERO) 
    + *	              (equal to number of entries for assembled matrices) 
    + * 	Col. 57 - 70  Number of elemental matrix entries (NELTVL) 
    + *	              (zero in the case of assembled matrices) 
    + * Line 4 (2A16, 2A20) 
    + * 	Col. 1 - 16   Format for pointers (PTRFMT) 
    + *	Col. 17 - 32  Format for row (or variable) indices (INDFMT) 
    + *	Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT) 
    + * 	Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT) 
    + *
    + * Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present 
    + *    	Col. 1 	      Right-hand side type: 
    + *	         	  F for full storage or M for same format as matrix 
    + *    	Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP) 
    + *    	Col. 3        X if an exact solution vector(s) is supplied. 
    + *	Col. 15 - 28  Number of right-hand sides (NRHS) 
    + *	Col. 29 - 42  Number of row indices (NRHSIX) 
    + *          	      (ignored in case of unassembled matrices) 
    + *
    + * The three character type field on line 3 describes the matrix type. 
    + * The following table lists the permitted values for each of the three 
    + * characters. As an example of the type field, RSA denotes that the matrix 
    + * is real, symmetric, and assembled. 
    + *
    + * First Character: 
    + *	R Real matrix 
    + *	C Complex matrix 
    + *	P Pattern only (no numerical values supplied) 
    + *
    + * Second Character: 
    + *	S Symmetric 
    + *	U Unsymmetric 
    + *	H Hermitian 
    + *	Z Skew symmetric 
    + *	R Rectangular 
    + *
    + * Third Character: 
    + *	A Assembled 
    + *	E Elemental matrices (unassembled) 
    + *
    + * 
    + */ +#include +#include +#include "slu_zdefs.h" + + +/*! \brief Eat up the rest of the current line */ +int zDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +int zParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +int zParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + * + * Purpose + * ======= + * + * Read a DOUBLE COMPLEX PRECISION matrix stored in Rutherford-Boeing format + * as described below. + * + * Line 1 (A72, A8) + * Col. 1 - 72 Title (TITLE) + * Col. 73 - 80 Matrix name / identifier (MTRXID) + * + * Line 2 (I14, 3(1X, I13)) + * Col. 1 - 14 Total number of lines excluding header (TOTCRD) + * Col. 16 - 28 Number of lines for pointers (PTRCRD) + * Col. 30 - 42 Number of lines for row (or variable) indices (INDCRD) + * Col. 44 - 56 Number of lines for numerical values (VALCRD) + * + * Line 3 (A3, 11X, 4(1X, I13)) + * Col. 1 - 3 Matrix type (see below) (MXTYPE) + * Col. 15 - 28 Compressed Column: Number of rows (NROW) + * Elemental: Largest integer used to index variable (MVAR) + * Col. 30 - 42 Compressed Column: Number of columns (NCOL) + * Elemental: Number of element matrices (NELT) + * Col. 44 - 56 Compressed Column: Number of entries (NNZERO) + * Elemental: Number of variable indeces (NVARIX) + * Col. 58 - 70 Compressed Column: Unused, explicitly zero + * Elemental: Number of elemental matrix entries (NELTVL) + * + * Line 4 (2A16, A20) + * Col. 1 - 16 Fortran format for pointers (PTRFMT) + * Col. 17 - 32 Fortran format for row (or variable) indices (INDFMT) + * Col. 33 - 52 Fortran format for numerical values of coefficient matrix + * (VALFMT) + * (blank in the case of matrix patterns) + * + * The three character type field on line 3 describes the matrix type. + * The following table lists the permitted values for each of the three + * characters. As an example of the type field, RSA denotes that the matrix + * is real, symmetric, and assembled. + * + * First Character: + * R Real matrix + * C Complex matrix + * I integer matrix + * P Pattern only (no numerical values supplied) + * Q Pattern only (numerical values supplied in associated auxiliary value + * file) + * + * Second Character: + * S Symmetric + * U Unsymmetric + * H Hermitian + * Z Skew symmetric + * R Rectangular + * + * Third Character: + * A Compressed column form + * E Elemental form + * + * + */ + +#include "slu_zdefs.h" + + +/*! \brief Eat up the rest of the current line */ +static int zDumpLine(FILE *fp) +{ + register int c; + while ((c = fgetc(fp)) != '\n') ; + return 0; +} + +static int zParseIntFormat(char *buf, int *num, int *size) +{ + char *tmp; + + tmp = buf; + while (*tmp++ != '(') ; + sscanf(tmp, "%d", num); + while (*tmp != 'I' && *tmp != 'i') ++tmp; + ++tmp; + sscanf(tmp, "%d", size); + return 0; +} + +static int zParseFloatFormat(char *buf, int *num, int *size) +{ + char *tmp, *period; + + tmp = buf; + while (*tmp++ != '(') ; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + while (*tmp != 'E' && *tmp != 'e' && *tmp != 'D' && *tmp != 'd' + && *tmp != 'F' && *tmp != 'f') { + /* May find kP before nE/nD/nF, like (1P6F13.6). In this case the + num picked up refers to P, which should be skipped. */ + if (*tmp=='p' || *tmp=='P') { + ++tmp; + *num = atoi(tmp); /*sscanf(tmp, "%d", num);*/ + } else { + ++tmp; + } + } + ++tmp; + period = tmp; + while (*period != '.' && *period != ')') ++period ; + *period = '\0'; + *size = atoi(tmp); /*sscanf(tmp, "%2d", size);*/ + + return 0; +} + +static int ReadVector(FILE *fp, int n, int *where, int perline, int persize) +{ + register int i, j, item; + char tmp, buf[100]; + + i = 0; + while (i < n) { + fgets(buf, 100, fp); /* read a line at a time */ + for (j=0; j + * -- SuperLU routine (version 4.0) -- + * Lawrence Berkeley National Laboratory. + * June 30, 2009 + * + */ + +#include "slu_zdefs.h" + + +void +zreadtriple(int *m, int *n, int *nonz, + doublecomplex **nzval, int **rowind, int **colptr) +{ +/* + * Output parameters + * ================= + * (a,asub,xa): asub[*] contains the row subscripts of nonzeros + * in columns of matrix A; a[*] the numerical values; + * row i of A is given by a[k],k=xa[i],...,xa[i+1]-1. + * + */ + int j, k, jsize, nnz, nz; + doublecomplex *a, *val; + int *asub, *xa, *row, *col; + int zero_base = 0; + + /* Matrix format: + * First line: #rows, #cols, #non-zero + * Triplet in the rest of lines: + * row, col, value + */ + + scanf("%d%d", n, nonz); + *m = *n; + printf("m %d, n %d, nonz %d\n", *m, *n, *nonz); + zallocateA(*n, *nonz, nzval, rowind, colptr); /* Allocate storage */ + a = *nzval; + asub = *rowind; + xa = *colptr; + + val = (doublecomplex *) SUPERLU_MALLOC(*nonz * sizeof(doublecomplex)); + row = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + col = (int *) SUPERLU_MALLOC(*nonz * sizeof(int)); + + for (j = 0; j < *n; ++j) xa[j] = 0; + + /* Read into the triplet array from a file */ + for (nnz = 0, nz = 0; nnz < *nonz; ++nnz) { + scanf("%d%d%lf%lf\n", &row[nz], &col[nz], &val[nz].r, &val[nz].i); + + if ( nnz == 0 ) { /* first nonzero */ + if ( row[0] == 0 || col[0] == 0 ) { + zero_base = 1; + printf("triplet file: row/col indices are zero-based.\n"); + } else + printf("triplet file: row/col indices are one-based.\n"); + } + + if ( !zero_base ) { + /* Change to 0-based indexing. */ + --row[nz]; + --col[nz]; + } + + if (row[nz] < 0 || row[nz] >= *m || col[nz] < 0 || col[nz] >= *n + /*|| val[nz] == 0.*/) { + fprintf(stderr, "nz %d, (%d, %d) = (%e,%e) out of bound, removed\n", + nz, row[nz], col[nz], val[nz].r, val[nz].i); + exit(-1); + } else { + ++xa[col[nz]]; + ++nz; + } + } + + *nonz = nz; + + /* Initialize the array of column pointers */ + k = 0; + jsize = xa[0]; + xa[0] = 0; + for (j = 1; j < *n; ++j) { + k += jsize; + jsize = xa[j]; + xa[j] = k; + } + + /* Copy the triplets into the column oriented storage */ + for (nz = 0; nz < *nonz; ++nz) { + j = col[nz]; + k = xa[j]; + asub[k] = row[nz]; + a[k] = val[nz]; + ++xa[j]; + } + + /* Reset the column pointers to the beginning of each column */ + for (j = *n; j > 0; --j) + xa[j] = xa[j-1]; + xa[0] = 0; + + SUPERLU_FREE(val); + SUPERLU_FREE(row); + SUPERLU_FREE(col); + +#ifdef CHK_INPUT + { + int i; + for (i = 0; i < *n; i++) { + printf("Col %d, xa %d\n", i, xa[i]); + for (k = xa[i]; k < xa[i+1]; k++) + printf("%d\t%16.10f\n", asub[k], a[k]); + } + } +#endif + +} + + +void zreadrhs(int m, doublecomplex *b) +{ + FILE *fp, *fopen(); + int i; + /*int j;*/ + + if ( !(fp = fopen("b.dat", "r")) ) { + fprintf(stderr, "dreadrhs: file does not exist\n"); + exit(-1); + } + for (i = 0; i < m; ++i) + fscanf(fp, "%lf%lf\n", &b[i].r, &b[i].i); + + /* readpair_(j, &b[i]);*/ + fclose(fp); +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_bmod.c b/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_bmod.c new file mode 100644 index 0000000..f760517 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_bmod.c @@ -0,0 +1,120 @@ + +/*! @file zsnode_bmod.c + * \brief Performs numeric block updates within the relaxed snode. + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_zdefs.h" + + +/*! \brief Performs numeric block updates within the relaxed snode. + */ +int +zsnode_bmod ( + const int jcol, /* in */ + const int jsupno, /* in */ + const int fsupc, /* in */ + doublecomplex *dense, /* in */ + doublecomplex *tempv, /* working array */ + GlobalLU_t *Glu, /* modified */ + SuperLUStat_t *stat /* output */ + ) +{ +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + int incx = 1, incy = 1; + doublecomplex alpha = {-1.0, 0.0}, beta = {1.0, 0.0}; +#endif + + doublecomplex comp_zero = {0.0, 0.0}; + int luptr, nsupc, nsupr, nrow; + int isub, irow, i, iptr; + register int ufirst, nextlu; + int *lsub, *xlsub; + doublecomplex *lusup; + int *xlusup; + flops_t *ops = stat->ops; + + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + + nextlu = xlusup[jcol]; + + /* + * Process the supernodal portion of L\U[*,j] + */ + for (isub = xlsub[fsupc]; isub < xlsub[fsupc+1]; isub++) { + irow = lsub[isub]; + lusup[nextlu] = dense[irow]; + dense[irow] = comp_zero; + ++nextlu; + } + + xlusup[jcol + 1] = nextlu; /* Initialize xlusup for next column */ + + if ( fsupc < jcol ) { + + luptr = xlusup[fsupc]; + nsupr = xlsub[fsupc+1] - xlsub[fsupc]; + nsupc = jcol - fsupc; /* Excluding jcol */ + ufirst = xlusup[jcol]; /* Points to the beginning of column + jcol in supernode L\U(jsupno). */ + nrow = nsupr - nsupc; + + ops[TRSV] += 4 * nsupc * (nsupc - 1); + ops[GEMV] += 8 * nrow * nsupc; + +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + CGEMV( ftcs2, &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#else + ztrsv_( "L", "N", "U", &nsupc, &lusup[luptr], &nsupr, + &lusup[ufirst], &incx ); + zgemv_( "N", &nrow, &nsupc, &alpha, &lusup[luptr+nsupc], &nsupr, + &lusup[ufirst], &incx, &beta, &lusup[ufirst+nsupc], &incy ); +#endif +#else + zlsolve ( nsupr, nsupc, &lusup[luptr], &lusup[ufirst] ); + zmatvec ( nsupr, nrow, nsupc, &lusup[luptr+nsupc], + &lusup[ufirst], &tempv[0] ); + + /* Scatter tempv[*] into lusup[*] */ + iptr = ufirst + nsupc; + for (i = 0; i < nrow; i++) { + z_sub(&lusup[iptr], &lusup[iptr], &tempv[i]); + ++iptr; + tempv[i] = comp_zero; + } +#endif + + } + + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_dfs.c b/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_dfs.c new file mode 100644 index 0000000..247b1a4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zsnode_dfs.c @@ -0,0 +1,112 @@ + +/*! @file zsnode_dfs.c + * \brief Determines the union of row structures of columns within the relaxed node + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose
    + * =======
    + *    zsnode_dfs() - Determine the union of the row structures of those 
    + *    columns within the relaxed snode.
    + *    Note: The relaxed snodes are leaves of the supernodal etree, therefore, 
    + *    the portion outside the rectangular supernode must be zero.
    + *
    + * Return value
    + * ============
    + *     0   success;
    + *    >0   number of bytes allocated when run out of memory.
    + * 
    + */ + +int +zsnode_dfs ( + const int jcol, /* in - start of the supernode */ + const int kcol, /* in - end of the supernode */ + const int *asub, /* in */ + const int *xa_begin, /* in */ + const int *xa_end, /* in */ + int *xprune, /* out */ + int *marker, /* modified */ + GlobalLU_t *Glu /* modified */ + ) +{ + + register int i, k, ifrom, ito, nextl, new_next; + int nsuper, krow, kmark, mem_error; + int *xsup, *supno; + int *lsub, *xlsub; + int nzlmax; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + nzlmax = Glu->nzlmax; + + nsuper = ++supno[jcol]; /* Next available supernode number */ + nextl = xlsub[jcol]; + + for (i = jcol; i <= kcol; i++) { + /* For each nonzero in A[*,i] */ + for (k = xa_begin[i]; k < xa_end[i]; k++) { + krow = asub[k]; + kmark = marker[krow]; + if ( kmark != kcol ) { /* First time visit krow */ + marker[krow] = kcol; + lsub[nextl++] = krow; + if ( nextl >= nzlmax ) { + if ( mem_error = zLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + } + } + supno[i] = nsuper; + } + + /* Supernode > 1, then make a copy of the subscripts for pruning */ + if ( jcol < kcol ) { + new_next = nextl + (nextl - xlsub[jcol]); + while ( new_next > nzlmax ) { + if ( mem_error = zLUMemXpand(jcol, nextl, LSUB, &nzlmax, Glu) ) + return (mem_error); + lsub = Glu->lsub; + } + ito = nextl; + for (ifrom = xlsub[jcol]; ifrom < nextl; ) + lsub[ito++] = lsub[ifrom++]; + for (i = jcol+1; i <= kcol; i++) xlsub[i] = nextl; + nextl = ito; + } + + xsup[nsuper+1] = kcol + 1; + supno[kcol+1] = nsuper; + xprune[kcol] = nextl; + xlsub[kcol+1] = nextl; + + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas2.c b/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas2.c new file mode 100644 index 0000000..58500fd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas2.c @@ -0,0 +1,573 @@ + +/*! @file zsp_blas2.c + * \brief Sparse BLAS 2, using some dense BLAS 2 operations + * + *
    + * -- SuperLU routine (version 3.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * October 15, 2003
    + * 
    + */ +/* + * File name: zsp_blas2.c + * Purpose: Sparse BLAS 2, using some dense BLAS 2 operations. + */ + +#include "slu_zdefs.h" + +/* + * Function prototypes + */ +void zusolve(int, int, doublecomplex*, doublecomplex*); +void zlsolve(int, int, doublecomplex*, doublecomplex*); +void zmatvec(int, int, int, doublecomplex*, doublecomplex*, doublecomplex*); + +/*! \brief Solves one of the systems of equations A*x = b, or A'*x = b + * + *
    + *   Purpose
    + *   =======
    + *
    + *   sp_ztrsv() solves one of the systems of equations   
    + *       A*x = b,   or   A'*x = b,
    + *   where b and x are n element vectors and A is a sparse unit , or   
    + *   non-unit, upper or lower triangular matrix.   
    + *   No test for singularity or near-singularity is included in this   
    + *   routine. Such tests must be performed before calling this routine.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   uplo   - (input) char*
    + *            On entry, uplo specifies whether the matrix is an upper or   
    + *             lower triangular matrix as follows:   
    + *                uplo = 'U' or 'u'   A is an upper triangular matrix.   
    + *                uplo = 'L' or 'l'   A is a lower triangular matrix.   
    + *
    + *   trans  - (input) char*
    + *             On entry, trans specifies the equations to be solved as   
    + *             follows:   
    + *                trans = 'N' or 'n'   A*x = b.   
    + *                trans = 'T' or 't'   A'*x = b.
    + *                trans = 'C' or 'c'   A^H*x = b.   
    + *
    + *   diag   - (input) char*
    + *             On entry, diag specifies whether or not A is unit   
    + *             triangular as follows:   
    + *                diag = 'U' or 'u'   A is assumed to be unit triangular.   
    + *                diag = 'N' or 'n'   A is not assumed to be unit   
    + *                                    triangular.   
    + *	     
    + *   L       - (input) SuperMatrix*
    + *	       The factor L from the factorization Pr*A*Pc=L*U. Use
    + *             compressed row subscripts storage for supernodes,
    + *             i.e., L has types: Stype = SC, Dtype = SLU_Z, Mtype = TRLU.
    + *
    + *   U       - (input) SuperMatrix*
    + *	        The factor U from the factorization Pr*A*Pc=L*U.
    + *	        U has types: Stype = NC, Dtype = SLU_Z, Mtype = TRU.
    + *    
    + *   x       - (input/output) doublecomplex*
    + *             Before entry, the incremented array X must contain the n   
    + *             element right-hand side vector b. On exit, X is overwritten 
    + *             with the solution vector x.
    + *
    + *   info    - (output) int*
    + *             If *info = -i, the i-th argument had an illegal value.
    + * 
    + */ +int +sp_ztrsv(char *uplo, char *trans, char *diag, SuperMatrix *L, + SuperMatrix *U, doublecomplex *x, SuperLUStat_t *stat, int *info) +{ +#ifdef _CRAY + _fcd ftcs1 = _cptofcd("L", strlen("L")), + ftcs2 = _cptofcd("N", strlen("N")), + ftcs3 = _cptofcd("U", strlen("U")); +#endif + SCformat *Lstore; + NCformat *Ustore; + doublecomplex *Lval, *Uval; + int incx = 1, incy = 1; + doublecomplex temp; + doublecomplex alpha = {1.0, 0.0}, beta = {1.0, 0.0}; + doublecomplex comp_zero = {0.0, 0.0}; + int nrow; + int fsupc, nsupr, nsupc, luptr, istart, irow; + int i, k, iptr, jcol; + doublecomplex *work; + flops_t solve_ops; + + /* Test the input parameters */ + *info = 0; + if ( !lsame_(uplo,"L") && !lsame_(uplo, "U") ) *info = -1; + else if ( !lsame_(trans, "N") && !lsame_(trans, "T") && + !lsame_(trans, "C")) *info = -2; + else if ( !lsame_(diag, "U") && !lsame_(diag, "N") ) *info = -3; + else if ( L->nrow != L->ncol || L->nrow < 0 ) *info = -4; + else if ( U->nrow != U->ncol || U->nrow < 0 ) *info = -5; + if ( *info ) { + i = -(*info); + xerbla_("sp_ztrsv", &i); + return 0; + } + + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + solve_ops = 0; + + if ( !(work = doublecomplexCalloc(L->nrow)) ) + ABORT("Malloc fails for work in sp_ztrsv()."); + + if ( lsame_(trans, "N") ) { /* Form x := inv(A)*x. */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L)*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + nrow = nsupr - nsupc; + + /* 1 z_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc - 1) + 10 * nsupc; + solve_ops += 8 * nrow * nsupc; + + if ( nsupc == 1 ) { + for (iptr=istart+1; iptr < L_SUB_START(fsupc+1); ++iptr) { + irow = L_SUB(iptr); + ++luptr; + zz_mult(&comp_zero, &x[fsupc], &Lval[luptr]); + z_sub(&x[irow], &x[irow], &comp_zero); + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + CGEMV(ftcs2, &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#else + ztrsv_("L", "N", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); + + zgemv_("N", &nrow, &nsupc, &alpha, &Lval[luptr+nsupc], + &nsupr, &x[fsupc], &incx, &beta, &work[0], &incy); +#endif +#else + zlsolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc]); + + zmatvec ( nsupr, nsupr-nsupc, nsupc, &Lval[luptr+nsupc], + &x[fsupc], &work[0] ); +#endif + + iptr = istart + nsupc; + for (i = 0; i < nrow; ++i, ++iptr) { + irow = L_SUB(iptr); + z_sub(&x[irow], &x[irow], &work[i]); /* Scatter */ + work[i] = comp_zero; + + } + } + } /* for k ... */ + + } else { + /* Form x := inv(U)*x */ + + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; k--) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + /* 1 z_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + z_div(&x[fsupc], &x[fsupc], &Lval[luptr]); + for (i = U_NZ_START(fsupc); i < U_NZ_START(fsupc+1); ++i) { + irow = U_SUB(i); + zz_mult(&comp_zero, &x[fsupc], &Uval[i]); + z_sub(&x[irow], &x[irow], &comp_zero); + } + } else { +#ifdef USE_VENDOR_BLAS +#ifdef _CRAY + CTRSV(ftcs3, ftcs2, ftcs2, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ztrsv_("U", "N", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif +#else + zusolve ( nsupr, nsupc, &Lval[luptr], &x[fsupc] ); +#endif + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); + i++) { + irow = U_SUB(i); + zz_mult(&comp_zero, &x[jcol], &Uval[i]); + z_sub(&x[irow], &x[irow], &comp_zero); + } + } + } + } /* for k ... */ + + } + } else if ( lsame_(trans, "T") ) { /* Form x := inv(A')*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := inv(L')*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 8 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + zz_mult(&comp_zero, &x[irow], &Lval[i]); + z_sub(&x[jcol], &x[jcol], &comp_zero); + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += 4 * nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + CTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ztrsv_("L", "T", "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := inv(U')*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + zz_mult(&comp_zero, &x[irow], &Uval[i]); + z_sub(&x[jcol], &x[jcol], &comp_zero); + } + } + + /* 1 z_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + z_div(&x[fsupc], &x[fsupc], &Lval[luptr]); + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd("T", strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + CTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ztrsv_("U", "T", "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } else { /* Form x := conj(inv(A'))*x */ + + if ( lsame_(uplo, "L") ) { + /* Form x := conj(inv(L'))*x */ + if ( L->nrow == 0 ) return 0; /* Quick return */ + + for (k = Lstore->nsuper; k >= 0; --k) { + fsupc = L_FST_SUPC(k); + istart = L_SUB_START(fsupc); + nsupr = L_SUB_START(fsupc+1) - istart; + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + solve_ops += 8 * (nsupr - nsupc) * nsupc; + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + iptr = istart + nsupc; + for (i = L_NZ_START(jcol) + nsupc; + i < L_NZ_START(jcol+1); i++) { + irow = L_SUB(iptr); + zz_conj(&temp, &Lval[i]); + zz_mult(&comp_zero, &x[irow], &temp); + z_sub(&x[jcol], &x[jcol], &comp_zero); + iptr++; + } + } + + if ( nsupc > 1 ) { + solve_ops += 4 * nsupc * (nsupc - 1); +#ifdef _CRAY + ftcs1 = _cptofcd("L", strlen("L")); + ftcs2 = _cptofcd(trans, strlen("T")); + ftcs3 = _cptofcd("U", strlen("U")); + ZTRSV(ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ztrsv_("L", trans, "U", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } + } else { + /* Form x := conj(inv(U'))*x */ + if ( U->nrow == 0 ) return 0; /* Quick return */ + + for (k = 0; k <= Lstore->nsuper; k++) { + fsupc = L_FST_SUPC(k); + nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc); + nsupc = L_FST_SUPC(k+1) - fsupc; + luptr = L_NZ_START(fsupc); + + for (jcol = fsupc; jcol < L_FST_SUPC(k+1); jcol++) { + solve_ops += 8*(U_NZ_START(jcol+1) - U_NZ_START(jcol)); + for (i = U_NZ_START(jcol); i < U_NZ_START(jcol+1); i++) { + irow = U_SUB(i); + zz_conj(&temp, &Uval[i]); + zz_mult(&comp_zero, &x[irow], &temp); + z_sub(&x[jcol], &x[jcol], &comp_zero); + } + } + + /* 1 z_div costs 10 flops */ + solve_ops += 4 * nsupc * (nsupc + 1) + 10 * nsupc; + + if ( nsupc == 1 ) { + zz_conj(&temp, &Lval[luptr]); + z_div(&x[fsupc], &x[fsupc], &temp); + } else { +#ifdef _CRAY + ftcs1 = _cptofcd("U", strlen("U")); + ftcs2 = _cptofcd(trans, strlen("T")); + ftcs3 = _cptofcd("N", strlen("N")); + ZTRSV( ftcs1, ftcs2, ftcs3, &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#else + ztrsv_("U", trans, "N", &nsupc, &Lval[luptr], &nsupr, + &x[fsupc], &incx); +#endif + } + } /* for k ... */ + } + } + + stat->ops[SOLVE] += solve_ops; + SUPERLU_FREE(work); + return 0; +} + + + +/*! \brief Performs one of the matrix-vector operations y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y + * + *
      
    + *   Purpose   
    + *   =======   
    + *
    + *   sp_zgemv()  performs one of the matrix-vector operations   
    + *      y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   
    + *   where alpha and beta are scalars, x and y are vectors and A is a
    + *   sparse A->nrow by A->ncol matrix.   
    + *
    + *   Parameters   
    + *   ==========   
    + *
    + *   TRANS  - (input) char*
    + *            On entry, TRANS specifies the operation to be performed as   
    + *            follows:   
    + *               TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.   
    + *               TRANS = 'T' or 't'   y := alpha*A'*x + beta*y.   
    + *               TRANS = 'C' or 'c'   y := alpha*A'*x + beta*y.   
    + *
    + *   ALPHA  - (input) doublecomplex
    + *            On entry, ALPHA specifies the scalar alpha.   
    + *
    + *   A      - (input) SuperMatrix*
    + *            Before entry, the leading m by n part of the array A must   
    + *            contain the matrix of coefficients.   
    + *
    + *   X      - (input) doublecomplex*, array of DIMENSION at least   
    + *            ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'   
    + *           and at least   
    + *            ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.   
    + *            Before entry, the incremented array X must contain the   
    + *            vector x.   
    + * 
    + *   INCX   - (input) int
    + *            On entry, INCX specifies the increment for the elements of   
    + *            X. INCX must not be zero.   
    + *
    + *   BETA   - (input) doublecomplex
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then Y need not be set on input.   
    + *
    + *   Y      - (output) doublecomplex*,  array of DIMENSION at least   
    + *            ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'   
    + *            and at least   
    + *            ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.   
    + *            Before entry with BETA non-zero, the incremented array Y   
    + *            must contain the vector y. On exit, Y is overwritten by the 
    + *            updated vector y.
    + *	      
    + *   INCY   - (input) int
    + *            On entry, INCY specifies the increment for the elements of   
    + *            Y. INCY must not be zero.   
    + *
    + *    ==== Sparse Level 2 Blas routine.   
    + * 
    +*/ +int +sp_zgemv(char *trans, doublecomplex alpha, SuperMatrix *A, doublecomplex *x, + int incx, doublecomplex beta, doublecomplex *y, int incy) +{ + + /* Local variables */ + NCformat *Astore; + doublecomplex *Aval; + int info; + doublecomplex temp, temp1; + int lenx, leny, i, j, irow; + int iy, jx, jy, kx, ky; + int notran; + doublecomplex comp_zero = {0.0, 0.0}; + doublecomplex comp_one = {1.0, 0.0}; + + notran = lsame_(trans, "N"); + Astore = A->Store; + Aval = Astore->nzval; + + /* Test the input parameters */ + info = 0; + if ( !notran && !lsame_(trans, "T") && !lsame_(trans, "C")) info = 1; + else if ( A->nrow < 0 || A->ncol < 0 ) info = 3; + else if (incx == 0) info = 5; + else if (incy == 0) info = 8; + if (info != 0) { + xerbla_("sp_zgemv ", &info); + return 0; + } + + /* Quick return if possible. */ + if (A->nrow == 0 || A->ncol == 0 || + z_eq(&alpha, &comp_zero) && + z_eq(&beta, &comp_one)) + return 0; + + + /* Set LENX and LENY, the lengths of the vectors x and y, and set + up the start points in X and Y. */ + if (lsame_(trans, "N")) { + lenx = A->ncol; + leny = A->nrow; + } else { + lenx = A->nrow; + leny = A->ncol; + } + if (incx > 0) kx = 0; + else kx = - (lenx - 1) * incx; + if (incy > 0) ky = 0; + else ky = - (leny - 1) * incy; + + /* Start the operations. In this version the elements of A are + accessed sequentially with one pass through A. */ + /* First form y := beta*y. */ + if ( !z_eq(&beta, &comp_one) ) { + if (incy == 1) { + if ( z_eq(&beta, &comp_zero) ) + for (i = 0; i < leny; ++i) y[i] = comp_zero; + else + for (i = 0; i < leny; ++i) + zz_mult(&y[i], &beta, &y[i]); + } else { + iy = ky; + if ( z_eq(&beta, &comp_zero) ) + for (i = 0; i < leny; ++i) { + y[iy] = comp_zero; + iy += incy; + } + else + for (i = 0; i < leny; ++i) { + zz_mult(&y[iy], &beta, &y[iy]); + iy += incy; + } + } + } + + if ( z_eq(&alpha, &comp_zero) ) return 0; + + if ( notran ) { + /* Form y := alpha*A*x + y. */ + jx = kx; + if (incy == 1) { + for (j = 0; j < A->ncol; ++j) { + if ( !z_eq(&x[jx], &comp_zero) ) { + zz_mult(&temp, &alpha, &x[jx]); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + zz_mult(&temp1, &temp, &Aval[i]); + z_add(&y[irow], &y[irow], &temp1); + } + } + jx += incx; + } + } else { + ABORT("Not implemented."); + } + } else { + /* Form y := alpha*A'*x + y. */ + jy = ky; + if (incx == 1) { + for (j = 0; j < A->ncol; ++j) { + temp = comp_zero; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + zz_mult(&temp1, &Aval[i], &x[irow]); + z_add(&temp, &temp, &temp1); + } + zz_mult(&temp1, &alpha, &temp); + z_add(&y[jy], &y[jy], &temp1); + jy += incy; + } + } else { + ABORT("Not implemented."); + } + } + return 0; +} /* sp_zgemv */ + diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas3.c b/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas3.c new file mode 100644 index 0000000..0e1a5c2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zsp_blas3.c @@ -0,0 +1,127 @@ + +/*! @file zsp_blas3.c + * \brief Sparse BLAS3, using some dense BLAS3 operations + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + * 
    + */ +/* + * File name: sp_blas3.c + * Purpose: Sparse BLAS3, using some dense BLAS3 operations. + */ + +#include "slu_zdefs.h" + +/*! \brief + * + *
    + * Purpose   
    + *   =======   
    + * 
    + *   sp_z performs one of the matrix-matrix operations   
    + * 
    + *      C := alpha*op( A )*op( B ) + beta*C,   
    + * 
    + *   where  op( X ) is one of 
    + * 
    + *      op( X ) = X   or   op( X ) = X'   or   op( X ) = conjg( X' ),
    + * 
    + *   alpha and beta are scalars, and A, B and C are matrices, with op( A ) 
    + *   an m by k matrix,  op( B )  a  k by n matrix and  C an m by n matrix. 
    + *   
    + * 
    + *   Parameters   
    + *   ==========   
    + * 
    + *   TRANSA - (input) char*
    + *            On entry, TRANSA specifies the form of op( A ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSA = 'N' or 'n',  op( A ) = A.   
    + *               TRANSA = 'T' or 't',  op( A ) = A'.   
    + *               TRANSA = 'C' or 'c',  op( A ) = conjg( A' ).   
    + *            Unchanged on exit.   
    + * 
    + *   TRANSB - (input) char*
    + *            On entry, TRANSB specifies the form of op( B ) to be used in 
    + *            the matrix multiplication as follows:   
    + *               TRANSB = 'N' or 'n',  op( B ) = B.   
    + *               TRANSB = 'T' or 't',  op( B ) = B'.   
    + *               TRANSB = 'C' or 'c',  op( B ) = conjg( B' ).   
    + *            Unchanged on exit.   
    + * 
    + *   M      - (input) int   
    + *            On entry,  M  specifies  the number of rows of the matrix 
    + *	     op( A ) and of the matrix C.  M must be at least zero. 
    + *	     Unchanged on exit.   
    + * 
    + *   N      - (input) int
    + *            On entry,  N specifies the number of columns of the matrix 
    + *	     op( B ) and the number of columns of the matrix C. N must be 
    + *	     at least zero.
    + *	     Unchanged on exit.   
    + * 
    + *   K      - (input) int
    + *            On entry, K specifies the number of columns of the matrix 
    + *	     op( A ) and the number of rows of the matrix op( B ). K must 
    + *	     be at least  zero.   
    + *           Unchanged on exit.
    + *      
    + *   ALPHA  - (input) doublecomplex
    + *            On entry, ALPHA specifies the scalar alpha.   
    + * 
    + *   A      - (input) SuperMatrix*
    + *            Matrix A with a sparse format, of dimension (A->nrow, A->ncol).
    + *            Currently, the type of A can be:
    + *                Stype = NC or NCP; Dtype = SLU_Z; Mtype = GE. 
    + *            In the future, more general A can be handled.
    + * 
    + *   B      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDB, kb ), where kb is 
    + *            n when TRANSB = 'N' or 'n',  and is  k otherwise.   
    + *            Before entry with  TRANSB = 'N' or 'n',  the leading k by n 
    + *            part of the array B must contain the matrix B, otherwise 
    + *            the leading n by k part of the array B must contain the 
    + *            matrix B.   
    + *            Unchanged on exit.   
    + * 
    + *   LDB    - (input) int
    + *            On entry, LDB specifies the first dimension of B as declared 
    + *            in the calling (sub) program. LDB must be at least max( 1, n ).  
    + *            Unchanged on exit.   
    + * 
    + *   BETA   - (input) doublecomplex
    + *            On entry, BETA specifies the scalar beta. When BETA is   
    + *            supplied as zero then C need not be set on input.   
    + *  
    + *   C      - DOUBLE COMPLEX PRECISION array of DIMENSION ( LDC, n ).   
    + *            Before entry, the leading m by n part of the array C must 
    + *            contain the matrix C,  except when beta is zero, in which 
    + *            case C need not be set on entry.   
    + *            On exit, the array C is overwritten by the m by n matrix 
    + *	     ( alpha*op( A )*B + beta*C ).   
    + *  
    + *   LDC    - (input) int
    + *            On entry, LDC specifies the first dimension of C as declared 
    + *            in the calling (sub)program. LDC must be at least max(1,m).   
    + *            Unchanged on exit.   
    + *  
    + *   ==== Sparse Level 3 Blas routine.   
    + * 
    + */ + +int +sp_zgemm(char *transa, char *transb, int m, int n, int k, + doublecomplex alpha, SuperMatrix *A, doublecomplex *b, int ldb, + doublecomplex beta, doublecomplex *c, int ldc) +{ + int incx = 1, incy = 1; + int j; + + for (j = 0; j < n; ++j) { + sp_zgemv(transa, alpha, A, &b[ldb*j], incx, beta, &c[ldc*j], incy); + } + return 0; +} diff --git a/thirdparty/superlu/SuperLU_4.1/SRC/zutil.c b/thirdparty/superlu/SuperLU_4.1/SRC/zutil.c new file mode 100644 index 0000000..f3c06cb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/SRC/zutil.c @@ -0,0 +1,475 @@ + +/*! @file zutil.c + * \brief Matrix utility functions + * + *
    + * -- SuperLU routine (version 3.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * August 1, 2008
    + *
    + * Copyright (c) 1994 by Xerox Corporation.  All rights reserved.
    + *
    + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    + * EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    + * 
    + * Permission is hereby granted to use or copy this program for any
    + * purpose, provided the above notices are retained on all copies.
    + * Permission to modify the code and to distribute modified code is
    + * granted, provided the above notices are retained, and a notice that
    + * the code was modified is included with the above copyright notice.
    + * 
    + */ + + +#include +#include "slu_zdefs.h" + +void +zCreate_CompCol_Matrix(SuperMatrix *A, int m, int n, int nnz, + doublecomplex *nzval, int *rowind, int *colptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NCformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NCformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->rowind = rowind; + Astore->colptr = colptr; +} + +void +zCreate_CompRow_Matrix(SuperMatrix *A, int m, int n, int nnz, + doublecomplex *nzval, int *colind, int *rowptr, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + NRformat *Astore; + + A->Stype = stype; + A->Dtype = dtype; + A->Mtype = mtype; + A->nrow = m; + A->ncol = n; + A->Store = (void *) SUPERLU_MALLOC( sizeof(NRformat) ); + if ( !(A->Store) ) ABORT("SUPERLU_MALLOC fails for A->Store"); + Astore = A->Store; + Astore->nnz = nnz; + Astore->nzval = nzval; + Astore->colind = colind; + Astore->rowptr = rowptr; +} + +/*! \brief Copy matrix A into matrix B. */ +void +zCopy_CompCol_Matrix(SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore, *Bstore; + int ncol, nnz, i; + + B->Stype = A->Stype; + B->Dtype = A->Dtype; + B->Mtype = A->Mtype; + B->nrow = A->nrow;; + B->ncol = ncol = A->ncol; + Astore = (NCformat *) A->Store; + Bstore = (NCformat *) B->Store; + Bstore->nnz = nnz = Astore->nnz; + for (i = 0; i < nnz; ++i) + ((doublecomplex *)Bstore->nzval)[i] = ((doublecomplex *)Astore->nzval)[i]; + for (i = 0; i < nnz; ++i) Bstore->rowind[i] = Astore->rowind[i]; + for (i = 0; i <= ncol; ++i) Bstore->colptr[i] = Astore->colptr[i]; +} + + +void +zCreate_Dense_Matrix(SuperMatrix *X, int m, int n, doublecomplex *x, int ldx, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + DNformat *Xstore; + + X->Stype = stype; + X->Dtype = dtype; + X->Mtype = mtype; + X->nrow = m; + X->ncol = n; + X->Store = (void *) SUPERLU_MALLOC( sizeof(DNformat) ); + if ( !(X->Store) ) ABORT("SUPERLU_MALLOC fails for X->Store"); + Xstore = (DNformat *) X->Store; + Xstore->lda = ldx; + Xstore->nzval = (doublecomplex *) x; +} + +void +zCopy_Dense_Matrix(int M, int N, doublecomplex *X, int ldx, + doublecomplex *Y, int ldy) +{ +/*! \brief Copies a two-dimensional matrix X to another matrix Y. + */ + int i, j; + + for (j = 0; j < N; ++j) + for (i = 0; i < M; ++i) + Y[i + j*ldy] = X[i + j*ldx]; +} + +void +zCreate_SuperNode_Matrix(SuperMatrix *L, int m, int n, int nnz, + doublecomplex *nzval, int *nzval_colptr, int *rowind, + int *rowind_colptr, int *col_to_sup, int *sup_to_col, + Stype_t stype, Dtype_t dtype, Mtype_t mtype) +{ + SCformat *Lstore; + + L->Stype = stype; + L->Dtype = dtype; + L->Mtype = mtype; + L->nrow = m; + L->ncol = n; + L->Store = (void *) SUPERLU_MALLOC( sizeof(SCformat) ); + if ( !(L->Store) ) ABORT("SUPERLU_MALLOC fails for L->Store"); + Lstore = L->Store; + Lstore->nnz = nnz; + Lstore->nsuper = col_to_sup[n]; + Lstore->nzval = nzval; + Lstore->nzval_colptr = nzval_colptr; + Lstore->rowind = rowind; + Lstore->rowind_colptr = rowind_colptr; + Lstore->col_to_sup = col_to_sup; + Lstore->sup_to_col = sup_to_col; + +} + + +/*! \brief Convert a row compressed storage into a column compressed storage. + */ +void +zCompRow_to_CompCol(int m, int n, int nnz, + doublecomplex *a, int *colind, int *rowptr, + doublecomplex **at, int **rowind, int **colptr) +{ + register int i, j, col, relpos; + int *marker; + + /* Allocate storage for another copy of the matrix. */ + *at = (doublecomplex *) doublecomplexMalloc(nnz); + *rowind = (int *) intMalloc(nnz); + *colptr = (int *) intMalloc(n+1); + marker = (int *) intCalloc(n); + + /* Get counts of each column of A, and set up column pointers */ + for (i = 0; i < m; ++i) + for (j = rowptr[i]; j < rowptr[i+1]; ++j) ++marker[colind[j]]; + (*colptr)[0] = 0; + for (j = 0; j < n; ++j) { + (*colptr)[j+1] = (*colptr)[j] + marker[j]; + marker[j] = (*colptr)[j]; + } + + /* Transfer the matrix into the compressed column storage. */ + for (i = 0; i < m; ++i) { + for (j = rowptr[i]; j < rowptr[i+1]; ++j) { + col = colind[j]; + relpos = marker[col]; + (*rowind)[relpos] = i; + (*at)[relpos] = a[j]; + ++marker[col]; + } + } + + SUPERLU_FREE(marker); +} + + +void +zPrint_CompCol_Matrix(char *what, SuperMatrix *A) +{ + NCformat *Astore; + register int i,n; + double *dp; + + printf("\nCompCol matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (NCformat *) A->Store; + dp = (double *) Astore->nzval; + printf("nrow %d, ncol %d, nnz %d\n", A->nrow,A->ncol,Astore->nnz); + printf("nzval: "); + for (i = 0; i < 2*Astore->colptr[n]; ++i) printf("%f ", dp[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->colptr[n]; ++i) printf("%d ", Astore->rowind[i]); + printf("\ncolptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->colptr[i]); + printf("\n"); + fflush(stdout); +} + +void +zPrint_SuperNode_Matrix(char *what, SuperMatrix *A) +{ + SCformat *Astore; + register int i, j, k, c, d, n, nsup; + double *dp; + int *col_to_sup, *sup_to_col, *rowind, *rowind_colptr; + + printf("\nSuperNode matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + n = A->ncol; + Astore = (SCformat *) A->Store; + dp = (double *) Astore->nzval; + col_to_sup = Astore->col_to_sup; + sup_to_col = Astore->sup_to_col; + rowind_colptr = Astore->rowind_colptr; + rowind = Astore->rowind; + printf("nrow %d, ncol %d, nnz %d, nsuper %d\n", + A->nrow,A->ncol,Astore->nnz,Astore->nsuper); + printf("nzval:\n"); + for (k = 0; k <= Astore->nsuper; ++k) { + c = sup_to_col[k]; + nsup = sup_to_col[k+1] - c; + for (j = c; j < c + nsup; ++j) { + d = Astore->nzval_colptr[j]; + for (i = rowind_colptr[c]; i < rowind_colptr[c+1]; ++i) { + printf("%d\t%d\t%e\t%e\n", rowind[i], j, dp[d], dp[d+1]); + d += 2; + } + } + } +#if 0 + for (i = 0; i < 2*Astore->nzval_colptr[n]; ++i) printf("%f ", dp[i]); +#endif + printf("\nnzval_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->nzval_colptr[i]); + printf("\nrowind: "); + for (i = 0; i < Astore->rowind_colptr[n]; ++i) + printf("%d ", Astore->rowind[i]); + printf("\nrowind_colptr: "); + for (i = 0; i <= n; ++i) printf("%d ", Astore->rowind_colptr[i]); + printf("\ncol_to_sup: "); + for (i = 0; i < n; ++i) printf("%d ", col_to_sup[i]); + printf("\nsup_to_col: "); + for (i = 0; i <= Astore->nsuper+1; ++i) + printf("%d ", sup_to_col[i]); + printf("\n"); + fflush(stdout); +} + +void +zPrint_Dense_Matrix(char *what, SuperMatrix *A) +{ + DNformat *Astore = (DNformat *) A->Store; + register int i, j, lda = Astore->lda; + double *dp; + + printf("\nDense matrix %s:\n", what); + printf("Stype %d, Dtype %d, Mtype %d\n", A->Stype,A->Dtype,A->Mtype); + dp = (double *) Astore->nzval; + printf("nrow %d, ncol %d, lda %d\n", A->nrow,A->ncol,lda); + printf("\nnzval: "); + for (j = 0; j < A->ncol; ++j) { + for (i = 0; i < 2*A->nrow; ++i) printf("%f ", dp[i + j*2*lda]); + printf("\n"); + } + printf("\n"); + fflush(stdout); +} + +/*! \brief Diagnostic print of column "jcol" in the U/L factor. + */ +void +zprint_lu_col(char *msg, int jcol, int pivrow, int *xprune, GlobalLU_t *Glu) +{ + int i, k, fsupc; + int *xsup, *supno; + int *xlsub, *lsub; + doublecomplex *lusup; + int *xlusup; + doublecomplex *ucol; + int *usub, *xusub; + + xsup = Glu->xsup; + supno = Glu->supno; + lsub = Glu->lsub; + xlsub = Glu->xlsub; + lusup = Glu->lusup; + xlusup = Glu->xlusup; + ucol = Glu->ucol; + usub = Glu->usub; + xusub = Glu->xusub; + + printf("%s", msg); + printf("col %d: pivrow %d, supno %d, xprune %d\n", + jcol, pivrow, supno[jcol], xprune[jcol]); + + printf("\tU-col:\n"); + for (i = xusub[jcol]; i < xusub[jcol+1]; i++) + printf("\t%d%10.4f, %10.4f\n", usub[i], ucol[i].r, ucol[i].i); + printf("\tL-col in rectangular snode:\n"); + fsupc = xsup[supno[jcol]]; /* first col of the snode */ + i = xlsub[fsupc]; + k = xlusup[jcol]; + while ( i < xlsub[fsupc+1] && k < xlusup[jcol+1] ) { + printf("\t%d\t%10.4f, %10.4f\n", lsub[i], lusup[k].r, lusup[k].i); + i++; k++; + } + fflush(stdout); +} + + +/*! \brief Check whether tempv[] == 0. This should be true before and after calling any numeric routines, i.e., "panel_bmod" and "column_bmod". + */ +void zcheck_tempv(int n, doublecomplex *tempv) +{ + int i; + + for (i = 0; i < n; i++) { + if ((tempv[i].r != 0.0) || (tempv[i].i != 0.0)) + { + fprintf(stderr,"tempv[%d] = {%f, %f}\n", i, tempv[i].r, tempv[i].i); + ABORT("zcheck_tempv"); + } + } +} + + +void +zGenXtrue(int n, int nrhs, doublecomplex *x, int ldx) +{ + int i, j; + for (j = 0; j < nrhs; ++j) + for (i = 0; i < n; ++i) { + x[i + j*ldx].r = 1.0; + x[i + j*ldx].i = 0.0; + } +} + +/*! \brief Let rhs[i] = sum of i-th row of A, so the solution vector is all 1's + */ +void +zFillRHS(trans_t trans, int nrhs, doublecomplex *x, int ldx, + SuperMatrix *A, SuperMatrix *B) +{ + NCformat *Astore; + doublecomplex *Aval; + DNformat *Bstore; + doublecomplex *rhs; + doublecomplex one = {1.0, 0.0}; + doublecomplex zero = {0.0, 0.0}; + int ldc; + char transc[1]; + + Astore = A->Store; + Aval = (doublecomplex *) Astore->nzval; + Bstore = B->Store; + rhs = Bstore->nzval; + ldc = Bstore->lda; + + if ( trans == NOTRANS ) *(unsigned char *)transc = 'N'; + else *(unsigned char *)transc = 'T'; + + sp_zgemm(transc, "N", A->nrow, nrhs, A->ncol, one, A, + x, ldx, zero, rhs, ldc); + +} + +/*! \brief Fills a doublecomplex precision array with a given value. + */ +void +zfill(doublecomplex *a, int alen, doublecomplex dval) +{ + register int i; + for (i = 0; i < alen; i++) a[i] = dval; +} + + + +/*! \brief Check the inf-norm of the error vector + */ +void zinf_norm_error(int nrhs, SuperMatrix *X, doublecomplex *xtrue) +{ + DNformat *Xstore; + double err, xnorm; + doublecomplex *Xmat, *soln_work; + doublecomplex temp; + int i, j; + + Xstore = X->Store; + Xmat = Xstore->nzval; + + for (j = 0; j < nrhs; j++) { + soln_work = &Xmat[j*Xstore->lda]; + err = xnorm = 0.0; + for (i = 0; i < X->nrow; i++) { + z_sub(&temp, &soln_work[i], &xtrue[i]); + err = SUPERLU_MAX(err, z_abs(&temp)); + xnorm = SUPERLU_MAX(xnorm, z_abs(&soln_work[i])); + } + err = err / xnorm; + printf("||X - Xtrue||/||X|| = %e\n", err); + } +} + + + +/*! \brief Print performance of the code. */ +void +zPrintPerf(SuperMatrix *L, SuperMatrix *U, mem_usage_t *mem_usage, + double rpg, double rcond, double *ferr, + double *berr, char *equed, SuperLUStat_t *stat) +{ + SCformat *Lstore; + NCformat *Ustore; + double *utime; + flops_t *ops; + + utime = stat->utime; + ops = stat->ops; + + if ( utime[FACT] != 0. ) + printf("Factor flops = %e\tMflops = %8.2f\n", ops[FACT], + ops[FACT]*1e-6/utime[FACT]); + printf("Identify relaxed snodes = %8.2f\n", utime[RELAX]); + if ( utime[SOLVE] != 0. ) + printf("Solve flops = %.0f, Mflops = %8.2f\n", ops[SOLVE], + ops[SOLVE]*1e-6/utime[SOLVE]); + + Lstore = (SCformat *) L->Store; + Ustore = (NCformat *) U->Store; + printf("\tNo of nonzeros in factor L = %d\n", Lstore->nnz); + printf("\tNo of nonzeros in factor U = %d\n", Ustore->nnz); + printf("\tNo of nonzeros in L+U = %d\n", Lstore->nnz + Ustore->nnz); + + printf("L\\U MB %.3f\ttotal MB needed %.3f\n", + mem_usage->for_lu/1e6, mem_usage->total_needed/1e6); + printf("Number of memory expansions: %d\n", stat->expansions); + + printf("\tFactor\tMflops\tSolve\tMflops\tEtree\tEquil\tRcond\tRefine\n"); + printf("PERF:%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f%8.2f\n", + utime[FACT], ops[FACT]*1e-6/utime[FACT], + utime[SOLVE], ops[SOLVE]*1e-6/utime[SOLVE], + utime[ETREE], utime[EQUIL], utime[RCOND], utime[REFINE]); + + printf("\tRpg\t\tRcond\t\tFerr\t\tBerr\t\tEquil?\n"); + printf("NUM:\t%e\t%e\t%e\t%e\t%s\n", + rpg, rcond, ferr[0], berr[0], equed); + +} + + + + +print_doublecomplex_vec(char *what, int n, doublecomplex *vec) +{ + int i; + printf("%s: n %d\n", what, n); + for (i = 0; i < n; ++i) printf("%d\t%f%f\n", i, vec[i].r, vec[i].i); + return 0; +} + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Cnames.h.bak b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Cnames.h.bak new file mode 100644 index 0000000..28eecfa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Cnames.h.bak @@ -0,0 +1,197 @@ +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 1, 1997 + * + */ +#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */ +#define __SUPERLU_CNAMES + +/* + * These macros define how C routines will be called. ADD_ assumes that + * they will be called by fortran, which expects C routines to have an + * underscore postfixed to the name (Suns, and the Intel expect this). + * NOCHANGE indicates that fortran will be calling, and that it expects + * the name called by fortran to be identical to that compiled by the C + * (RS6K's do this). UPCASE says it expects C routines called by fortran + * to be in all upcase (CRAY wants this). + */ + +#define ADD_ 0 +#define NOCHANGE 1 +#define UPCASE 2 +#define C_CALL 3 + +#ifdef UpCase +#define F77_CALL_C UPCASE +#endif + +#ifdef NoChange +#define F77_CALL_C NOCHANGE +#endif + +#ifdef Add_ +#define F77_CALL_C ADD_ +#endif + +#ifndef F77_CALL_C +#define F77_CALL_C ADD_ +#endif + +#if (F77_CALL_C == ADD_) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * No redefinition necessary to have following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm_(...) + * + * This is the default. + */ + +#endif + +#if (F77_CALL_C == UPCASE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void DGEMM(...) + */ +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define saxpy_ SAXPY +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dasum_ SASUM +#define idamax_ ISAMAX +#define dcopy_ SCOPY +#define dscal_ SSCAL +#define dger_ SGER +#define dnrm2_ SNRM2 +#define dsymv_ SSYMV +#define ddot_ SDOT +#define daxpy_ SAXPY +#define dsyr2_ SSYR2 +#define drot_ SROT +#define dgemv_ SGEMV +#define dtrsv_ STRSV +#define dgemm_ SGEMM +#define dtrsm_ STRSM + +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define caxpy_ CAXPY +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define dzasum_ SCASUM +#define izamax_ ICAMAX +#define zcopy_ CCOPY +#define zscal_ CSCAL +#define dznrm2_ SCNRM2 +#define zaxpy_ CAXPY +#define zgemv_ CGEMV +#define ztrsv_ CTRSV +#define zgemm_ CGEMM +#define ztrsm_ CTRSM +#define zgerc_ CGERC +#define zhemv_ CHEMV +#define zher2_ CHER2 + +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#endif + +#if (F77_CALL_C == NOCHANGE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm(...) + */ +#define sasum_ sasum +#define isamax_ isamax +#define scopy_ scopy +#define sscal_ sscal +#define sger_ sger +#define snrm2_ snrm2 +#define ssymv_ ssymv +#define sdot_ sdot +#define saxpy_ saxpy +#define ssyr2_ ssyr2 +#define srot_ srot +#define sgemv_ sgemv +#define strsv_ strsv +#define sgemm_ sgemm +#define strsm_ strsm + +#define dasum_ dasum +#define idamax_ idamax +#define dcopy_ dcopy +#define dscal_ dscal +#define dger_ dger +#define dnrm2_ dnrm2 +#define dsymv_ dsymv +#define ddot_ ddot +#define daxpy_ daxpy +#define dsyr2_ dsyr2 +#define drot_ drot +#define dgemv_ dgemv +#define dtrsv_ dtrsv +#define dgemm_ dgemm +#define dtrsm_ dtrsm + +#define scasum_ scasum +#define icamax_ icamax +#define ccopy_ ccopy +#define cscal_ cscal +#define scnrm2_ scnrm2 +#define caxpy_ caxpy +#define cgemv_ cgemv +#define ctrsv_ ctrsv +#define cgemm_ cgemm +#define ctrsm_ ctrsm +#define cgerc_ cgerc +#define chemv_ chemv +#define cher2_ cher2 + +#define dzasum_ dzasum +#define izamax_ izamax +#define zcopy_ zcopy +#define zscal_ zscal +#define dznrm2_ dznrm2 +#define zaxpy_ zaxpy +#define zgemv_ zgemv +#define ztrsv_ ztrsv +#define zgemm_ zgemm +#define ztrsm_ ztrsm +#define zgerc_ zgerc +#define zhemv_ zhemv +#define zher2_ zher2 + +#define c_bridge_dgssv_ c_bridge_dgssv +#endif + +#endif /* __SUPERLU_CNAMES */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Makefile b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Makefile new file mode 100644 index 0000000..14e5f2f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/Makefile @@ -0,0 +1,81 @@ +include ../../make.inc + +####################################################################### +# This is the makefile to create a library of the test matrix +# generators used in LAPACK. The files are organized as follows: +# +# SCATGEN -- Auxiliary routines called from both REAL and COMPLEX +# DZATGEN -- Auxiliary routines called from both DOUBLE PRECISION +# and COMPLEX*16 +# SMATGEN -- Single precision real matrix generation routines +# CMATGEN -- Single precision complex matrix generation routines +# DMATGEN -- Double precision real matrix generation routines +# ZMATGEN -- Double precision complex matrix generation routines +# +# The library can be set up to include routines for any combination +# of the four precisions. To create or add to the library, enter make +# followed by one or more of the precisions desired. Some examples: +# make single +# make single complex +# make single double complex complex16 +# Alternatively, the command +# make +# without any arguments creates a library of all four precisions. +# The library is called +# libtmglib.a +# and is created at the LAPACK directory level. +# +# To remove the object files after the library is created, enter +# make clean +# +####################################################################### +ALLAUX = lsamen.o + +SCATGEN = slatm1.o slaran.o slarnd.o slaruv.o slabad.o slarnv.o +SLASRC = slatb4.o slaset.o slartg.o +SMATGEN = slatms.o slatme.o slatmr.o \ + slagge.o slagsy.o slarge.o slaror.o slarot.o slatm2.o slatm3.o +SINTRINSIC = r_lg10.o r_sign.o pow_dd.o + +DZATGEN = dlatm1.o dlaran.o dlarnd.o dlaruv.o dlabad.o dlarnv.o +DLASRC = dlatb4.o dlaset.o dlartg.o +DMATGEN = dlatms.o dlatme.o dlatmr.o \ + dlagge.o dlagsy.o dlarge.o dlaror.o dlarot.o dlatm2.o dlatm3.o +DINTRINSIC = d_lg10.o d_sign.o pow_dd.o + +CLASRC = clatb4.o claset.o clartg.o clarnv.o clacgv.o csymv.o +CMATGEN = clatms.o clatme.o clatmr.o \ + clagge.o clagsy.o clarge.o claror.o clarot.o clatm2.o clatm3.o \ + claghe.o clarnd.o cdotc.o + +ZLASRC = zlatb4.o zlaset.o zlartg.o zlarnv.o zlacgv.o zsymv.o +ZMATGEN = zlatms.o zlatme.o zlatmr.o \ + zlagge.o zlagsy.o zlarge.o zlaror.o zlarot.o zlatm2.o zlatm3.o \ + zlaghe.o zlarnd.o zdotc.o + +all: single double complex complex16 + +single: $(SMATGEN) $(SCATGEN) $(SLASRC) $(SINTRINSIC) $(ALLAUX) + $(ARCH) $(ARCHFLAGS) ../$(TMGLIB) $(SMATGEN) $(SCATGEN) \ + $(SLASRC) $(SINTRINSIC) $(ALLAUX) + $(RANLIB) ../$(TMGLIB) + +double: $(DMATGEN) $(DZATGEN) $(DLASRC) $(DINTRINSIC) $(ALLAUX) + $(ARCH) $(ARCHFLAGS) ../$(TMGLIB) $(DMATGEN) $(DZATGEN) \ + $(DLASRC) $(DINTRINSIC) $(ALLAUX) + $(RANLIB) ../$(TMGLIB) + +complex: $(CMATGEN) $(SCATGEN) $(CLASRC) $(SINTRINSIC) $(ALLAUX) + $(ARCH) $(ARCHFLAGS) ../$(TMGLIB) $(CMATGEN) $(SCATGEN) \ + $(CLASRC) $(SINTRINSIC) $(ALLAUX) + $(RANLIB) ../$(TMGLIB) + +complex16: $(ZMATGEN) $(DZATGEN) $(ZLASRC) $(DINSTRINSIC) $(ALLAUX) + $(ARCH) $(ARCHFLAGS) ../$(TMGLIB) $(ZMATGEN) $(DZATGEN) \ + $(ZLASRC) $(DINTRINSIC) $(ALLAUX) + $(RANLIB) ../$(TMGLIB) + +clean: + rm -f *.o ../$(TMGLIB) + +.c.o: ; $(CC) $(CFLAGS) $(CDEFS) -c $< diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/cdotc.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/cdotc.c new file mode 100644 index 0000000..c7a153f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/cdotc.c @@ -0,0 +1,87 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Complex */ VOID cdotc_(complex * ret_val, integer *n, complex *cx, integer + *incx, complex *cy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer i; + static complex ctemp; + static integer ix, iy; + + +/* forms the dot product of two vectors, conjugating the first + vector. + jack dongarra, linpack, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + + Parameter adjustments */ + --cy; + --cx; + + /* Function Body */ + ctemp.r = 0.f, ctemp.i = 0.f; + ret_val->r = 0.f, ret_val->i = 0.f; + if (*n <= 0) { + return ; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + r_cnjg(&q__3, &cx[ix]); + i__2 = iy; + q__2.r = q__3.r * cy[iy].r - q__3.i * cy[iy].i, q__2.i = q__3.r * + cy[iy].i + q__3.i * cy[iy].r; + q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i; + ctemp.r = q__1.r, ctemp.i = q__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + r_cnjg(&q__3, &cx[i]); + i__2 = i; + q__2.r = q__3.r * cy[i].r - q__3.i * cy[i].i, q__2.i = q__3.r * + cy[i].i + q__3.i * cy[i].r; + q__1.r = ctemp.r + q__2.r, q__1.i = ctemp.i + q__2.i; + ctemp.r = q__1.r, ctemp.i = q__1.i; +/* L30: */ + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; +} /* cdotc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clacgv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clacgv.c new file mode 100644 index 0000000..4525fd4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clacgv.c @@ -0,0 +1,76 @@ +#include "f2c.h" + +/* Subroutine */ int clacgv_(integer *n, complex *x, integer *incx) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + CLACGV conjugates a complex vector of length N. + + Arguments + ========= + + N (input) INTEGER + The length of the vector X. N >= 0. + + X (input/output) COMPLEX array, dimension + (1+(N-1)*abs(INCX)) + On entry, the vector of length N to be conjugated. + On exit, X is overwritten with conjg(X). + + INCX (input) INTEGER + The spacing between successive elements of X. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2; + complex q__1; + /* Builtin functions */ + void r_cnjg(complex *, complex *); + /* Local variables */ + static integer ioff, i; + + +#define X(I) x[(I)-1] + + + if (*incx == 1) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + r_cnjg(&q__1, &X(i)); + X(i).r = q__1.r, X(i).i = q__1.i; +/* L10: */ + } + } else { + ioff = 1; + if (*incx < 0) { + ioff = 1 - (*n - 1) * *incx; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = ioff; + r_cnjg(&q__1, &X(ioff)); + X(ioff).r = q__1.r, X(ioff).i = q__1.i; + ioff += *incx; +/* L20: */ + } + } + return 0; + +/* End of CLACGV */ + +} /* clacgv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagge.c new file mode 100644 index 0000000..898a234 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagge.c @@ -0,0 +1,464 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int clagge_(integer *m, integer *n, integer *kl, integer *ku, + real *d, complex *a, integer *lda, integer *iseed, complex *work, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + complex q__1; + + /* Builtin functions */ + double c_abs(complex *); + void c_div(complex *, complex *, complex *); + + /* Local variables */ + static integer i, j; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *), + cscal_(integer *, complex *, complex *, integer *), cgemv_(char * + , integer *, integer *, complex *, complex *, integer *, complex * + , integer *, complex *, complex *, integer *); + extern real scnrm2_(integer *, complex *, integer *); + static complex wa, wb; + extern /* Subroutine */ int clacgv_(integer *, complex *, integer *); + static real wn; + extern /* Subroutine */ int xerbla_(char *, integer *), clarnv_( + integer *, integer *, integer *, complex *); + static complex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLAGGE generates a complex general m by n matrix A, by pre- and post- + + multiplying a real diagonal matrix D with random unitary matrices: + A = U*D*V. The lower and upper bandwidths may then be reduced to + kl and ku by additional unitary transformations. + + Arguments + ========= + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + KL (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= KL <= M-1. + + KU (input) INTEGER + The number of nonzero superdiagonals within the band of A. + 0 <= KU <= N-1. + + D (input) REAL array, dimension (min(M,N)) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX array, dimension (LDA,N) + The generated m by n matrix A. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= M. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX array, dimension (M+N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*m < 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (*kl < 0 || *kl > *m - 1) { + *info = -3; + } else if (*ku < 0 || *ku > *n - 1) { + *info = -4; + } else if (*lda < max(1,*m)) { + *info = -7; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("CLAGGE", &i__1); + return 0; + } + +/* initialize A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.f; +/* L30: */ + } + +/* pre- and post-multiply A by random unitary matrices */ + + for (i = min(*m,*n); i >= 1; --i) { + if (i < *m) { + +/* generate random reflection */ + + i__1 = *m - i + 1; + clarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *m - i + 1; + wn = scnrm2_(&i__1, &work[1], &c__1); + d__1 = wn / c_abs(&work[1]); + q__1.r = d__1 * work[1].r, q__1.i = d__1 * work[1].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + q__1.r = work[1].r + wa.r, q__1.i = work[1].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__1 = *m - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__1, &q__1, &work[2], &c__1); + work[1].r = 1.f, work[1].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* multiply A(i:m,i:n) by random reflection from the lef +t */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + cgemv_("Conjugate transpose", &i__1, &i__2, &c_b2, &a[i + i * + a_dim1], lda, &work[1], &c__1, &c_b1, &work[*m + 1], & + c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__1, &i__2, &q__1, &work[1], &c__1, &work[*m + 1], &c__1, + &a[i + i * a_dim1], lda); + } + if (i < *n) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + clarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = scnrm2_(&i__1, &work[1], &c__1); + d__1 = wn / c_abs(&work[1]); + q__1.r = d__1 * work[1].r, q__1.i = d__1 * work[1].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + q__1.r = work[1].r + wa.r, q__1.i = work[1].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__1 = *n - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__1, &q__1, &work[2], &c__1); + work[1].r = 1.f, work[1].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* multiply A(i:m,i:n) by random reflection from the rig +ht */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + cgemv_("No transpose", &i__1, &i__2, &c_b2, &a[i + i * a_dim1], + lda, &work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__1, &i__2, &q__1, &work[*n + 1], &c__1, &work[1], &c__1, + &a[i + i * a_dim1], lda); + } +/* L40: */ + } + +/* Reduce number of subdiagonals to KL and number of superdiagonals + to KU + + Computing MAX */ + i__2 = *m - 1 - *kl, i__3 = *n - 1 - *ku; + i__1 = max(i__2,i__3); + for (i = 1; i <= i__1; ++i) { + if (*kl <= *ku) { + +/* annihilate subdiagonal elements first (necessary if K +L = 0) + + Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = scnrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + d__1 = wn / c_abs(&a[*kl + i + i * a_dim1]); + i__2 = *kl + i + i * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = *kl + i + i * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *m - *kl - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + i__2 = *kl + i + i * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + cgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*kl + i + + (i + 1) * a_dim1], lda, &a[*kl + i + i * a_dim1], & + c__1, &c_b1, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + i__2 = *kl + i + i * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + } + +/* Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = scnrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + d__1 = wn / c_abs(&a[i + (*ku + i) * a_dim1]); + i__2 = i + (*ku + i) * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = i + (*ku + i) * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *n - *ku - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[i + (*ku + i + 1) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *n - *ku - i + 1; + clacgv_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + cgemv_("No transpose", &i__2, &i__3, &c_b2, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, & + c_b1, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &work[1], &c__1, &a[i + (*ku + i) + * a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + } + } else { + +/* annihilate superdiagonal elements first (necessary if + + KU = 0) + + Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = scnrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + d__1 = wn / c_abs(&a[i + (*ku + i) * a_dim1]); + i__2 = i + (*ku + i) * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = i + (*ku + i) * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *n - *ku - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[i + (*ku + i + 1) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *n - *ku - i + 1; + clacgv_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + cgemv_("No transpose", &i__2, &i__3, &c_b2, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, & + c_b1, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &work[1], &c__1, &a[i + (*ku + i) + * a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + } + +/* Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = scnrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + d__1 = wn / c_abs(&a[*kl + i + i * a_dim1]); + i__2 = *kl + i + i * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = *kl + i + i * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *m - *kl - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + i__2 = *kl + i + i * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + cgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*kl + i + + (i + 1) * a_dim1], lda, &a[*kl + i + i * a_dim1], & + c__1, &c_b1, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + i__2 = *kl + i + i * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + } + } + + i__2 = *m; + for (j = *kl + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L50: */ + } + + i__2 = *n; + for (j = *ku + i + 1; j <= i__2; ++j) { + i__3 = i + j * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L60: */ + } +/* L70: */ + } + return 0; + +/* End of CLAGGE */ + +} /* clagge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claghe.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claghe.c new file mode 100644 index 0000000..7a8835e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claghe.c @@ -0,0 +1,309 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int claghe_(integer *n, integer *k, real *d, complex *a, + integer *lda, integer *iseed, complex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + complex q__1, q__2, q__3, q__4; + + /* Builtin functions */ + double c_abs(complex *); + void c_div(complex *, complex *, complex *), r_cnjg(complex *, complex *); + + /* Local variables */ + extern /* Subroutine */ int cher2_(char *, integer *, complex *, complex * + , integer *, complex *, integer *, complex *, integer *); + static integer i, j; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *); + static complex alpha; + extern /* Subroutine */ int cscal_(integer *, complex *, complex *, + integer *); + extern /* Complex */ VOID cdotc_(complex *, integer *, complex *, integer + *, complex *, integer *); + extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex * + , complex *, integer *, complex *, integer *, complex *, complex * + , integer *), chemv_(char *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, complex *, + integer *), caxpy_(integer *, complex *, complex *, + integer *, complex *, integer *); + extern real scnrm2_(integer *, complex *, integer *); + static complex wa, wb; + static real wn; + extern /* Subroutine */ int xerbla_(char *, integer *), clarnv_( + integer *, integer *, integer *, complex *); + static complex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLAGHE generates a complex hermitian matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random unitary matrix: + A = U*D*U'. The semi-bandwidth may then be reduced to k by additional + + unitary transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) REAL array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX array, dimension (LDA,N) + The generated n by n hermitian matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("CLAGHE", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.f; +/* L30: */ + } + +/* Generate lower triangle of hermitian matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + clarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = scnrm2_(&i__1, &work[1], &c__1); + d__1 = wn / c_abs(&work[1]); + q__1.r = d__1 * work[1].r, q__1.i = d__1 * work[1].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + q__1.r = work[1].r + wa.r, q__1.i = work[1].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__1 = *n - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__1, &q__1, &work[2], &c__1); + work[1].r = 1.f, work[1].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * u */ + + i__1 = *n - i + 1; + chemv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b1, &work[*n + 1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + q__3.r = -.5f, q__3.i = 0.f; + q__2.r = q__3.r * tau.r - q__3.i * tau.i, q__2.i = q__3.r * tau.i + + q__3.i * tau.r; + i__1 = *n - i + 1; + cdotc_(&q__4, &i__1, &work[*n + 1], &c__1, &work[1], &c__1); + q__1.r = q__2.r * q__4.r - q__2.i * q__4.i, q__1.i = q__2.r * q__4.i + + q__2.i * q__4.r; + alpha.r = q__1.r, alpha.i = q__1.i; + i__1 = *n - i + 1; + caxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) */ + + i__1 = *n - i + 1; + q__1.r = -1.f, q__1.i = 0.f; + cher2_("Lower", &i__1, &q__1, &work[1], &c__1, &work[*n + 1], &c__1, & + a[i + i * a_dim1], lda); +/* L40: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = scnrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + d__1 = wn / c_abs(&a[*k + i + i * a_dim1]); + i__2 = *k + i + i * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = *k + i + i * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *n - *k - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[*k + i + 1 + i * a_dim1], &c__1); + i__2 = *k + i + i * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + cgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i + (i + 1) + * a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b1, &work[ + 1], &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &a[*k + i + i * a_dim1], &c__1, &work[1], + &c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * u */ + + i__2 = *n - *k - i + 1; + chemv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b1, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + q__3.r = -.5f, q__3.i = 0.f; + q__2.r = q__3.r * tau.r - q__3.i * tau.i, q__2.i = q__3.r * tau.i + + q__3.i * tau.r; + i__2 = *n - *k - i + 1; + cdotc_(&q__4, &i__2, &work[1], &c__1, &a[*k + i + i * a_dim1], &c__1); + q__1.r = q__2.r * q__4.r - q__2.i * q__4.i, q__1.i = q__2.r * q__4.i + + q__2.i * q__4.r; + alpha.r = q__1.r, alpha.i = q__1.i; + i__2 = *n - *k - i + 1; + caxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply hermitian rank-2 update to A(k+i:n,k+i:n) */ + + i__2 = *n - *k - i + 1; + q__1.r = -1.f, q__1.i = 0.f; + cher2_("Lower", &i__2, &q__1, &a[*k + i + i * a_dim1], &c__1, &work[1] + , &c__1, &a[*k + i + (*k + i) * a_dim1], lda); + + i__2 = *k + i + i * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L50: */ + } +/* L60: */ + } + +/* Store full hermitian matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = j + i * a_dim1; + r_cnjg(&q__1, &a[i + j * a_dim1]); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L70: */ + } +/* L80: */ + } + return 0; + +/* End of CLAGHE */ + +} /* claghe_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagsy.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagsy.c new file mode 100644 index 0000000..92ac859 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clagsy.c @@ -0,0 +1,363 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int clagsy_(integer *n, integer *k, real *d, complex *a, + integer *lda, integer *iseed, complex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8, + i__9; + doublereal d__1; + complex q__1, q__2, q__3, q__4; + + /* Builtin functions */ + double c_abs(complex *); + void c_div(complex *, complex *, complex *); + + /* Local variables */ + static integer i, j; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *); + static complex alpha; + extern /* Subroutine */ int cscal_(integer *, complex *, complex *, + integer *); + extern /* Complex */ VOID cdotc_(complex *, integer *, complex *, integer + *, complex *, integer *); + extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex * + , complex *, integer *, complex *, integer *, complex *, complex * + , integer *), caxpy_(integer *, complex *, complex *, + integer *, complex *, integer *), csymv_(char *, integer *, + complex *, complex *, integer *, complex *, integer *, complex *, + complex *, integer *); + extern real scnrm2_(integer *, complex *, integer *); + static integer ii, jj; + static complex wa, wb; + extern /* Subroutine */ int clacgv_(integer *, complex *, integer *); + static real wn; + extern /* Subroutine */ int xerbla_(char *, integer *), clarnv_( + integer *, integer *, integer *, complex *); + static complex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLAGSY generates a complex symmetric matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random unitary matrix: + A = U*D*U**T. The semi-bandwidth may then be reduced to k by + additional unitary transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) REAL array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX array, dimension (LDA,N) + The generated n by n symmetric matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("CLAGSY", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.f; +/* L30: */ + } + +/* Generate lower triangle of symmetric matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + clarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = scnrm2_(&i__1, &work[1], &c__1); + d__1 = wn / c_abs(&work[1]); + q__1.r = d__1 * work[1].r, q__1.i = d__1 * work[1].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + q__1.r = work[1].r + wa.r, q__1.i = work[1].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__1 = *n - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__1, &q__1, &work[2], &c__1); + work[1].r = 1.f, work[1].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * conjg(u) */ + + i__1 = *n - i + 1; + clacgv_(&i__1, &work[1], &c__1); + i__1 = *n - i + 1; + csymv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + clacgv_(&i__1, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( u, y ) * u */ + + q__3.r = -.5f, q__3.i = 0.f; + q__2.r = q__3.r * tau.r - q__3.i * tau.i, q__2.i = q__3.r * tau.i + + q__3.i * tau.r; + i__1 = *n - i + 1; + cdotc_(&q__4, &i__1, &work[1], &c__1, &work[*n + 1], &c__1); + q__1.r = q__2.r * q__4.r - q__2.i * q__4.i, q__1.i = q__2.r * q__4.i + + q__2.i * q__4.r; + alpha.r = q__1.r, alpha.i = q__1.i; + i__1 = *n - i + 1; + caxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) + + CALL CSYR2( 'Lower', N-I+1, -ONE, WORK, 1, WORK( N+1 ), 1, + + $ A( I, I ), LDA ) */ + + i__1 = *n; + for (jj = i; jj <= i__1; ++jj) { + i__2 = *n; + for (ii = jj; ii <= i__2; ++ii) { + i__3 = ii + jj * a_dim1; + i__4 = ii + jj * a_dim1; + i__5 = ii - i + 1; + i__6 = *n + jj - i + 1; + q__3.r = work[i__5].r * work[i__6].r - work[i__5].i * work[ + i__6].i, q__3.i = work[i__5].r * work[i__6].i + work[ + i__5].i * work[i__6].r; + q__2.r = a[i__4].r - q__3.r, q__2.i = a[i__4].i - q__3.i; + i__7 = *n + ii - i + 1; + i__8 = jj - i + 1; + q__4.r = work[i__7].r * work[i__8].r - work[i__7].i * work[ + i__8].i, q__4.i = work[i__7].r * work[i__8].i + work[ + i__7].i * work[i__8].r; + q__1.r = q__2.r - q__4.r, q__1.i = q__2.i - q__4.i; + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L40: */ + } +/* L50: */ + } +/* L60: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = scnrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + d__1 = wn / c_abs(&a[*k + i + i * a_dim1]); + i__2 = *k + i + i * a_dim1; + q__1.r = d__1 * a[i__2].r, q__1.i = d__1 * a[i__2].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + i__2 = *k + i + i * a_dim1; + q__1.r = a[i__2].r + wa.r, q__1.i = a[i__2].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__2 = *n - *k - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__2, &q__1, &a[*k + i + 1 + i * a_dim1], &c__1); + i__2 = *k + i + i * a_dim1; + a[i__2].r = 1.f, a[i__2].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + cgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i + (i + 1) + * a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b1, &work[ + 1], &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__2, &i__3, &q__1, &a[*k + i + i * a_dim1], &c__1, &work[1], + &c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * conjg(u) */ + + i__2 = *n - *k - i + 1; + clacgv_(&i__2, &a[*k + i + i * a_dim1], &c__1); + i__2 = *n - *k - i + 1; + csymv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b1, &work[1], &c__1); + i__2 = *n - *k - i + 1; + clacgv_(&i__2, &a[*k + i + i * a_dim1], &c__1); + +/* compute v := y - 1/2 * tau * ( u, y ) * u */ + + q__3.r = -.5f, q__3.i = 0.f; + q__2.r = q__3.r * tau.r - q__3.i * tau.i, q__2.i = q__3.r * tau.i + + q__3.i * tau.r; + i__2 = *n - *k - i + 1; + cdotc_(&q__4, &i__2, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1); + q__1.r = q__2.r * q__4.r - q__2.i * q__4.i, q__1.i = q__2.r * q__4.i + + q__2.i * q__4.r; + alpha.r = q__1.r, alpha.i = q__1.i; + i__2 = *n - *k - i + 1; + caxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply symmetric rank-2 update to A(k+i:n,k+i:n) + + CALL CSYR2( 'Lower', N-K-I+1, -ONE, A( K+I, I ), 1, WORK, 1, + + $ A( K+I, K+I ), LDA ) */ + + i__2 = *n; + for (jj = *k + i; jj <= i__2; ++jj) { + i__3 = *n; + for (ii = jj; ii <= i__3; ++ii) { + i__4 = ii + jj * a_dim1; + i__5 = ii + jj * a_dim1; + i__6 = ii + i * a_dim1; + i__7 = jj - *k - i + 1; + q__3.r = a[i__6].r * work[i__7].r - a[i__6].i * work[i__7].i, + q__3.i = a[i__6].r * work[i__7].i + a[i__6].i * work[ + i__7].r; + q__2.r = a[i__5].r - q__3.r, q__2.i = a[i__5].i - q__3.i; + i__8 = ii - *k - i + 1; + i__9 = jj + i * a_dim1; + q__4.r = work[i__8].r * a[i__9].r - work[i__8].i * a[i__9].i, + q__4.i = work[i__8].r * a[i__9].i + work[i__8].i * a[ + i__9].r; + q__1.r = q__2.r - q__4.r, q__1.i = q__2.i - q__4.i; + a[i__4].r = q__1.r, a[i__4].i = q__1.i; +/* L70: */ + } +/* L80: */ + } + + i__2 = *k + i + i * a_dim1; + q__1.r = -(doublereal)wa.r, q__1.i = -(doublereal)wa.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; +/* L90: */ + } +/* L100: */ + } + +/* Store full symmetric matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = j + i * a_dim1; + i__4 = i + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; +/* L110: */ + } +/* L120: */ + } + return 0; + +/* End of CLAGSY */ + +} /* clagsy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarge.c new file mode 100644 index 0000000..7924697 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarge.c @@ -0,0 +1,160 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int clarge_(integer *n, complex *a, integer *lda, integer * + iseed, complex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1; + doublereal d__1; + complex q__1; + + /* Builtin functions */ + double c_abs(complex *); + void c_div(complex *, complex *, complex *); + + /* Local variables */ + static integer i; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *), + cscal_(integer *, complex *, complex *, integer *), cgemv_(char * + , integer *, integer *, complex *, complex *, integer *, complex * + , integer *, complex *, complex *, integer *); + extern real scnrm2_(integer *, complex *, integer *); + static complex wa, wb; + static real wn; + extern /* Subroutine */ int xerbla_(char *, integer *), clarnv_( + integer *, integer *, integer *, complex *); + static complex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLARGE pre- and post-multiplies a complex general n by n matrix A + with a random unitary matrix: A = U*D*U'. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + A (input/output) COMPLEX array, dimension (LDA,N) + On entry, the original n by n matrix A. + On exit, A is overwritten by U*A*U' for some random + unitary matrix U. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*lda < max(1,*n)) { + *info = -3; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("CLARGE", &i__1); + return 0; + } + +/* pre- and post-multiply A by random unitary matrix */ + + for (i = *n; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + clarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = scnrm2_(&i__1, &work[1], &c__1); + d__1 = wn / c_abs(&work[1]); + q__1.r = d__1 * work[1].r, q__1.i = d__1 * work[1].i; + wa.r = q__1.r, wa.i = q__1.i; + if (wn == 0.f) { + tau.r = 0.f, tau.i = 0.f; + } else { + q__1.r = work[1].r + wa.r, q__1.i = work[1].i + wa.i; + wb.r = q__1.r, wb.i = q__1.i; + i__1 = *n - i; + c_div(&q__1, &c_b2, &wb); + cscal_(&i__1, &q__1, &work[2], &c__1); + work[1].r = 1.f, work[1].i = 0.f; + c_div(&q__1, &wb, &wa); + d__1 = q__1.r; + tau.r = d__1, tau.i = 0.f; + } + +/* multiply A(i:n,1:n) by random reflection from the left */ + + i__1 = *n - i + 1; + cgemv_("Conjugate transpose", &i__1, n, &c_b2, &a[i + a_dim1], lda, & + work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&i__1, n, &q__1, &work[1], &c__1, &work[*n + 1], &c__1, &a[i + + a_dim1], lda); + +/* multiply A(1:n,i:n) by random reflection from the right */ + + i__1 = *n - i + 1; + cgemv_("No transpose", n, &i__1, &c_b2, &a[i * a_dim1 + 1], lda, & + work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(n, &i__1, &q__1, &work[*n + 1], &c__1, &work[1], &c__1, &a[i * + a_dim1 + 1], lda); +/* L10: */ + } + return 0; + +/* End of CLARGE */ + +} /* clarge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnd.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnd.c new file mode 100644 index 0000000..a450c11 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnd.c @@ -0,0 +1,125 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Complex */ VOID clarnd_(complex * ret_val, integer *idist, integer *iseed) +{ + /* System generated locals */ + doublereal d__1, d__2; + complex q__1, q__2, q__3; + + /* Builtin functions */ + double log(doublereal), sqrt(doublereal); + void c_exp(complex *, complex *); + + /* Local variables */ + static real t1, t2; + extern doublereal slaran_(integer *); + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLARND returns a random complex number from a uniform or normal + distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: real and imaginary parts each uniform (0,1) + = 2: real and imaginary parts each uniform (-1,1) + = 3: real and imaginary parts each normal (0,1) + = 4: uniformly distributed on the disc abs(z) <= 1 + = 5: uniformly distributed on the circle abs(z) = 1 + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine calls the auxiliary routine SLARAN to generate a random + + real number from a uniform (0,1) distribution. The Box-Muller method + + is used to transform numbers from a uniform to a normal distribution. + + + ===================================================================== + + + + Generate a pair of real random numbers from a uniform (0,1) + distribution + + Parameter adjustments */ + --iseed; + + /* Function Body */ + t1 = slaran_(&iseed[1]); + t2 = slaran_(&iseed[1]); + + if (*idist == 1) { + +/* real and imaginary parts each uniform (0,1) */ + + q__1.r = t1, q__1.i = t2; + ret_val->r = q__1.r, ret_val->i = q__1.i; + } else if (*idist == 2) { + +/* real and imaginary parts each uniform (-1,1) */ + + d__1 = t1 * 2.f - 1.f; + d__2 = t2 * 2.f - 1.f; + q__1.r = d__1, q__1.i = d__2; + ret_val->r = q__1.r, ret_val->i = q__1.i; + } else if (*idist == 3) { + +/* real and imaginary parts each normal (0,1) */ + + d__1 = sqrt(log(t1) * -2.f); + d__2 = t2 * 6.2831853071795864769252867663f; + q__3.r = 0.f, q__3.i = d__2; + c_exp(&q__2, &q__3); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + ret_val->r = q__1.r, ret_val->i = q__1.i; + } else if (*idist == 4) { + +/* uniform distribution on the unit disc abs(z) <= 1 */ + + d__1 = sqrt(t1); + d__2 = t2 * 6.2831853071795864769252867663f; + q__3.r = 0.f, q__3.i = d__2; + c_exp(&q__2, &q__3); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + ret_val->r = q__1.r, ret_val->i = q__1.i; + } else if (*idist == 5) { + +/* uniform distribution on the unit circle abs(z) = 1 */ + + d__1 = t2 * 6.2831853071795864769252867663f; + q__2.r = 0.f, q__2.i = d__1; + c_exp(&q__1, &q__2); + ret_val->r = q__1.r, ret_val->i = q__1.i; + } + return ; + +/* End of CLARND */ + +} /* clarnd_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnv.c new file mode 100644 index 0000000..45b1570 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarnv.c @@ -0,0 +1,172 @@ +#include "f2c.h" + +/* Subroutine */ int clarnv_(integer *idist, integer *iseed, integer *n, + complex *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLARNV returns a vector of n random complex numbers from a uniform or + + normal distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: real and imaginary parts each uniform (0,1) + = 2: real and imaginary parts each uniform (-1,1) + = 3: real and imaginary parts each normal (0,1) + = 4: uniformly distributed on the disc abs(z) < 1 + = 5: uniformly distributed on the circle abs(z) = 1 + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. + + X (output) COMPLEX array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine calls the auxiliary routine SLARUV to generate random + real numbers from a uniform (0,1) distribution, in batches of up to + 128 using vectorisable code. The Box-Muller method is used to + transform numbers from a uniform to a normal distribution. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2, i__3, i__4, i__5; + doublereal d__1, d__2; + complex q__1, q__2, q__3; + /* Builtin functions */ + double log(doublereal), sqrt(doublereal); + void c_exp(complex *, complex *); + /* Local variables */ + static integer i; + static real u[128]; + static integer il, iv; + extern /* Subroutine */ int slaruv_(integer *, integer *, real *); + + +#define X(I) x[(I)-1] +#define ISEED(I) iseed[(I)-1] + + + i__1 = *n; + for (iv = 1; iv <= *n; iv += 64) { +/* Computing MIN */ + i__2 = 64, i__3 = *n - iv + 1; + il = min(i__2,i__3); + +/* Call SLARUV to generate 2*IL real numbers from a uniform (0, +1) + distribution (2*IL <= LV) */ + + i__2 = il << 1; + slaruv_(&ISEED(1), &i__2, u); + + if (*idist == 1) { + +/* Copy generated numbers */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + i__4 = (i << 1) - 2; + i__5 = (i << 1) - 1; + q__1.r = u[(i<<1)-2], q__1.i = u[(i<<1)-1]; + X(iv+i-1).r = q__1.r, X(iv+i-1).i = q__1.i; +/* L10: */ + } + } else if (*idist == 2) { + +/* Convert generated numbers to uniform (-1,1) distribut +ion */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = u[(i << 1) - 2] * 2.f - 1.f; + d__2 = u[(i << 1) - 1] * 2.f - 1.f; + q__1.r = d__1, q__1.i = d__2; + X(iv+i-1).r = q__1.r, X(iv+i-1).i = q__1.i; +/* L20: */ + } + } else if (*idist == 3) { + +/* Convert generated numbers to normal (0,1) distributio +n */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = sqrt(log(u[(i << 1) - 2]) * -2.f); + d__2 = u[(i << 1) - 1] * 6.2831853071795864769252867663f; + q__3.r = 0.f, q__3.i = d__2; + c_exp(&q__2, &q__3); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + X(iv+i-1).r = q__1.r, X(iv+i-1).i = q__1.i; +/* L30: */ + } + } else if (*idist == 4) { + +/* Convert generated numbers to complex numbers uniforml +y + distributed on the unit disk */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = sqrt(u[(i << 1) - 2]); + d__2 = u[(i << 1) - 1] * 6.2831853071795864769252867663f; + q__3.r = 0.f, q__3.i = d__2; + c_exp(&q__2, &q__3); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + X(iv+i-1).r = q__1.r, X(iv+i-1).i = q__1.i; +/* L40: */ + } + } else if (*idist == 5) { + +/* Convert generated numbers to complex numbers uniforml +y + distributed on the unit circle */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = u[(i << 1) - 1] * 6.2831853071795864769252867663f; + q__2.r = 0.f, q__2.i = d__1; + c_exp(&q__1, &q__2); + X(iv+i-1).r = q__1.r, X(iv+i-1).i = q__1.i; +/* L50: */ + } + } +/* L60: */ + } + return 0; + +/* End of CLARNV */ + +} /* clarnv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claror.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claror.c new file mode 100644 index 0000000..8b18c21 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claror.c @@ -0,0 +1,351 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int claror_(char *side, char *init, integer *m, integer *n, + complex *a, integer *lda, integer *iseed, complex *x, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + complex q__1, q__2; + + /* Builtin functions */ + double c_abs(complex *); + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer kbeg, jcol; + static real xabs; + static integer irow, j; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *), + cscal_(integer *, complex *, complex *, integer *); + extern logical lsame_(char *, char *); + extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex * + , complex *, integer *, complex *, integer *, complex *, complex * + , integer *); + static complex csign; + static integer ixfrm, itype, nxfrm; + static real xnorm; + extern real scnrm2_(integer *, complex *, integer *); + extern /* Subroutine */ int clacgv_(integer *, complex *, integer *); + extern /* Complex */ VOID clarnd_(complex *, integer *, integer *); + extern /* Subroutine */ int claset_(char *, integer *, integer *, complex + *, complex *, complex *, integer *), xerbla_(char *, + integer *); + static real factor; + static complex xnorms; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLAROR pre- or post-multiplies an M by N matrix A by a random + unitary matrix U, overwriting A. A may optionally be + initialized to the identity matrix before multiplying by U. + U is generated using the method of G.W. Stewart + ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ). + (BLAS-2 version) + + Arguments + ========= + + SIDE - CHARACTER*1 + SIDE specifies whether A is multiplied on the left or right + + by U. + SIDE = 'L' Multiply A on the left (premultiply) by U + SIDE = 'R' Multiply A on the right (postmultiply) by U* + SIDE = 'C' Multiply A on the left by U and the right by U* + SIDE = 'T' Multiply A on the left by U and the right by U' + Not modified. + + INIT - CHARACTER*1 + INIT specifies whether or not A should be initialized to + the identity matrix. + INIT = 'I' Initialize A to (a section of) the + identity matrix before applying U. + INIT = 'N' No initialization. Apply U to the + input matrix A. + + INIT = 'I' may be used to generate square (i.e., unitary) + or rectangular orthogonal matrices (orthogonality being + in the sense of CDOTC): + + For square matrices, M=N, and SIDE many be either 'L' or + 'R'; the rows will be orthogonal to each other, as will the + + columns. + For rectangular matrices where M < N, SIDE = 'R' will + produce a dense matrix whose rows will be orthogonal and + whose columns will not, while SIDE = 'L' will produce a + matrix whose rows will be orthogonal, and whose first M + columns will be orthogonal, the remaining columns being + zero. + For matrices where M > N, just use the previous + explaination, interchanging 'L' and 'R' and "rows" and + "columns". + + Not modified. + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + A - COMPLEX array, dimension ( LDA, N ) + Input and output array. Overwritten by U A ( if SIDE = 'L' ) + + or by A U ( if SIDE = 'R' ) + or by U A U* ( if SIDE = 'C') + or by U A U' ( if SIDE = 'T') on exit. + + LDA - INTEGER + Leading dimension of A. Must be at least MAX ( 1, M ). + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. The array elements should be between 0 and 4095; + + if not they will be reduced mod 4096. Also, ISEED(4) must + be odd. The random number generator uses a linear + congruential sequence limited to small integers, and so + should produce machine independent random numbers. The + values of ISEED are changed on exit, and can be used in the + + next call to CLAROR to continue the same random number + sequence. + Modified. + + X - COMPLEX array, dimension ( 3*MAX( M, N ) ) + Workspace. Of length: + 2*M + N if SIDE = 'L', + 2*N + M if SIDE = 'R', + 3*N if SIDE = 'C' or 'T'. + Modified. + + INFO - INTEGER + An error flag. It is set to: + 0 if no error. + 1 if CLARND returned a bad random number (installation + problem) + -1 if SIDE is not L, R, C, or T. + -3 if M is negative. + -4 if N is negative or if SIDE is C or T and N is not equal + + to M. + -6 if LDA is less than M. + + ===================================================================== + + + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --x; + + /* Function Body */ + if (*n == 0 || *m == 0) { + return 0; + } + + itype = 0; + if (lsame_(side, "L")) { + itype = 1; + } else if (lsame_(side, "R")) { + itype = 2; + } else if (lsame_(side, "C")) { + itype = 3; + } else if (lsame_(side, "T")) { + itype = 4; + } + +/* Check for argument errors. */ + + *info = 0; + if (itype == 0) { + *info = -1; + } else if (*m < 0) { + *info = -3; + } else if (*n < 0 || itype == 3 && *n != *m) { + *info = -4; + } else if (*lda < *m) { + *info = -6; + } + if (*info != 0) { + i__1 = -(*info); + xerbla_("CLAROR", &i__1); + return 0; + } + + if (itype == 1) { + nxfrm = *m; + } else { + nxfrm = *n; + } + +/* Initialize A to the identity matrix if desired */ + + if (lsame_(init, "I")) { + claset_("Full", m, n, &c_b1, &c_b2, &a[a_offset], lda); + } + +/* If no rotation possible, still multiply by + a random complex number from the circle |x| = 1 + + 2) Compute Rotation by computing Householder + Transformations H(2), H(3), ..., H(n). Note that the + order in which they are computed is irrelevant. */ + + i__1 = nxfrm; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + x[i__2].r = 0.f, x[i__2].i = 0.f; +/* L40: */ + } + + i__1 = nxfrm; + for (ixfrm = 2; ixfrm <= i__1; ++ixfrm) { + kbeg = nxfrm - ixfrm + 1; + +/* Generate independent normal( 0, 1 ) random numbers */ + + i__2 = nxfrm; + for (j = kbeg; j <= i__2; ++j) { + i__3 = j; + clarnd_(&q__1, &c__3, &iseed[1]); + x[i__3].r = q__1.r, x[i__3].i = q__1.i; +/* L50: */ + } + +/* Generate a Householder transformation from the random vector + X */ + + xnorm = scnrm2_(&ixfrm, &x[kbeg], &c__1); + xabs = c_abs(&x[kbeg]); + if (xabs != 0.f) { + i__2 = kbeg; + q__1.r = x[i__2].r / xabs, q__1.i = x[i__2].i / xabs; + csign.r = q__1.r, csign.i = q__1.i; + } else { + csign.r = 1.f, csign.i = 0.f; + } + q__1.r = xnorm * csign.r, q__1.i = xnorm * csign.i; + xnorms.r = q__1.r, xnorms.i = q__1.i; + i__2 = nxfrm + kbeg; + q__1.r = -(doublereal)csign.r, q__1.i = -(doublereal)csign.i; + x[i__2].r = q__1.r, x[i__2].i = q__1.i; + factor = xnorm * (xnorm + xabs); + if (dabs(factor) < 1e-20f) { + *info = 1; + i__2 = -(*info); + xerbla_("CLAROR", &i__2); + return 0; + } else { + factor = 1.f / factor; + } + i__2 = kbeg; + i__3 = kbeg; + q__1.r = x[i__3].r + xnorms.r, q__1.i = x[i__3].i + xnorms.i; + x[i__2].r = q__1.r, x[i__2].i = q__1.i; + +/* Apply Householder transformation to A */ + + if (itype == 1 || itype == 3 || itype == 4) { + +/* Apply H(k) on the left of A */ + + cgemv_("C", &ixfrm, n, &c_b2, &a[kbeg + a_dim1], lda, &x[kbeg], & + c__1, &c_b1, &x[(nxfrm << 1) + 1], &c__1); + q__2.r = factor, q__2.i = 0.f; + q__1.r = -(doublereal)q__2.r, q__1.i = -(doublereal)q__2.i; + cgerc_(&ixfrm, n, &q__1, &x[kbeg], &c__1, &x[(nxfrm << 1) + 1], & + c__1, &a[kbeg + a_dim1], lda); + + } + + if (itype >= 2 && itype <= 4) { + +/* Apply H(k)* (or H(k)') on the right of A */ + + if (itype == 4) { + clacgv_(&ixfrm, &x[kbeg], &c__1); + } + + cgemv_("N", m, &ixfrm, &c_b2, &a[kbeg * a_dim1 + 1], lda, &x[kbeg] + , &c__1, &c_b1, &x[(nxfrm << 1) + 1], &c__1); + q__2.r = factor, q__2.i = 0.f; + q__1.r = -(doublereal)q__2.r, q__1.i = -(doublereal)q__2.i; + cgerc_(m, &ixfrm, &q__1, &x[(nxfrm << 1) + 1], &c__1, &x[kbeg], & + c__1, &a[kbeg * a_dim1 + 1], lda); + + } +/* L60: */ + } + + clarnd_(&q__1, &c__3, &iseed[1]); + x[1].r = q__1.r, x[1].i = q__1.i; + xabs = c_abs(&x[1]); + if (xabs != 0.f) { + q__1.r = x[1].r / xabs, q__1.i = x[1].i / xabs; + csign.r = q__1.r, csign.i = q__1.i; + } else { + csign.r = 1.f, csign.i = 0.f; + } + i__1 = nxfrm << 1; + x[i__1].r = csign.r, x[i__1].i = csign.i; + +/* Scale the matrix A by D. */ + + if (itype == 1 || itype == 3 || itype == 4) { + i__1 = *m; + for (irow = 1; irow <= i__1; ++irow) { + r_cnjg(&q__1, &x[nxfrm + irow]); + cscal_(n, &q__1, &a[irow + a_dim1], lda); +/* L70: */ + } + } + + if (itype == 2 || itype == 3) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + cscal_(m, &x[nxfrm + jcol], &a[jcol * a_dim1 + 1], &c__1); +/* L80: */ + } + } + + if (itype == 4) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + r_cnjg(&q__1, &x[nxfrm + jcol]); + cscal_(m, &q__1, &a[jcol * a_dim1 + 1], &c__1); +/* L90: */ + } + } + return 0; + +/* End of CLAROR */ + +} /* claror_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarot.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarot.c new file mode 100644 index 0000000..8d33b2a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clarot.c @@ -0,0 +1,365 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__4 = 4; +static integer c__8 = 8; + +/* Subroutine */ int clarot_(logical *lrows, logical *lleft, logical *lright, + integer *nl, complex *c, complex *s, complex *a, integer *lda, + complex *xleft, complex *xright) +{ + /* System generated locals */ + integer i__1, i__2, i__3, i__4; + complex q__1, q__2, q__3, q__4, q__5, q__6; + + /* Builtin functions */ + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer iinc, j, inext; + static complex tempx; + static integer ix, iy, nt; + static complex xt[2], yt[2]; + extern /* Subroutine */ int xerbla_(char *, integer *); + static integer iyt; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + CLAROT applies a (Givens) rotation to two adjacent rows or + columns, where one element of the first and/or last column/row + may be a separate variable. This is specifically indended + for use on matrices stored in some format other than GE, so + that elements of the matrix may be used or modified for which + no array element is provided. + + One example is a symmetric matrix in SB format (bandwidth=4), for + + which UPLO='L': Two adjacent rows will have the format: + + row j: * * * * * . . . . + row j+1: * * * * * . . . . + + '*' indicates elements for which storage is provided, + '.' indicates elements for which no storage is provided, but + are not necessarily zero; their values are determined by + symmetry. ' ' indicates elements which are necessarily zero, + and have no storage provided. + + Those columns which have two '*'s can be handled by SROT. + Those columns which have no '*'s can be ignored, since as long + as the Givens rotations are carefully applied to preserve + symmetry, their values are determined. + Those columns which have one '*' have to be handled separately, + by using separate variables "p" and "q": + + row j: * * * * * p . . . + row j+1: q * * * * * . . . . + + The element p would have to be set correctly, then that column + is rotated, setting p to its new value. The next call to + CLAROT would rotate columns j and j+1, using p, and restore + symmetry. The element q would start out being zero, and be + made non-zero by the rotation. Later, rotations would presumably + + be chosen to zero q out. + + Typical Calling Sequences: rotating the i-th and (i+1)-st rows. + ------- ------- --------- + + General dense matrix: + + CALL CLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S, + A(i,1),LDA, DUMMY, DUMMY) + + General banded matrix in GB format: + + j = MAX(1, i-KL ) + NL = MIN( N, i+KU+1 ) + 1-j + CALL CLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S, + A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,KL+1) ] + + Symmetric banded matrix in SY format, bandwidth K, + lower triangle only: + + j = MAX(1, i-K ) + NL = MIN( K+1, i ) + 1 + CALL CLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S, + A(i,j), LDA, XLEFT, XRIGHT ) + + Same, but upper triangle only: + + NL = MIN( K+1, N-i ) + 1 + CALL CLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S, + A(i,i), LDA, XLEFT, XRIGHT ) + + Symmetric banded matrix in SB format, bandwidth K, + lower triangle only: + + [ same as for SY, except:] + . . . . + A(i+1-j,j), LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,K+1) ] + + Same, but upper triangle only: + . . . + A(K+1,i), LDA-1, XLEFT, XRIGHT ) + + Rotating columns is just the transpose of rotating rows, except + + for GB and SB: (rotating columns i and i+1) + + GB: + j = MAX(1, i-KU ) + NL = MIN( N, i+KL+1 ) + 1-j + CALL CLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S, + A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + [note that KU+j+1-i is just MAX(1,KU+2-i)] + + SB: (upper triangle) + + . . . . . . + A(K+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + SB: (lower triangle) + + . . . . . . + A(1,i),LDA-1, XTOP, XBOTTM ) + + Arguments + ========= + + LROWS - LOGICAL + If .TRUE., then CLAROT will rotate two rows. If .FALSE., + then it will rotate two columns. + Not modified. + + LLEFT - LOGICAL + If .TRUE., then XLEFT will be used instead of the + corresponding element of A for the first element in the + second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) + If .FALSE., then the corresponding element of A will be + used. + Not modified. + + LRIGHT - LOGICAL + If .TRUE., then XRIGHT will be used instead of the + corresponding element of A for the last element in the + first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If + + .FALSE., then the corresponding element of A will be used. + Not modified. + + NL - INTEGER + The length of the rows (if LROWS=.TRUE.) or columns (if + LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are + used, the columns/rows they are in should be included in + NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at + least 2. The number of rows/columns to be rotated + exclusive of those involving XLEFT and/or XRIGHT may + not be negative, i.e., NL minus how many of LLEFT and + LRIGHT are .TRUE. must be at least zero; if not, XERBLA + will be called. + Not modified. + + C, S - COMPLEX + Specify the Givens rotation to be applied. If LROWS is + true, then the matrix ( c s ) + ( _ _ ) + (-s c ) is applied from the left; + if false, then the transpose (not conjugated) thereof is + applied from the right. Note that in contrast to the + output of CROTG or to most versions of CROT, both C and S + are complex. For a Givens rotation, |C|**2 + |S|**2 should + + be 1, but this is not checked. + Not modified. + + A - COMPLEX array. + The array containing the rows/columns to be rotated. The + first element of A should be the upper left element to + be rotated. + Read and modified. + + LDA - INTEGER + The "effective" leading dimension of A. If A contains + a matrix stored in GE, HE, or SY format, then this is just + the leading dimension of A as dimensioned in the calling + routine. If A contains a matrix stored in band (GB, HB, or + + SB) format, then this should be *one less* than the leading + + dimension used in the calling routine. Thus, if A were + dimensioned A(LDA,*) in CLAROT, then A(1,j) would be the + j-th element in the first of the two rows to be rotated, + and A(2,j) would be the j-th in the second, regardless of + how the array may be stored in the calling routine. [A + cannot, however, actually be dimensioned thus, since for + band format, the row number may exceed LDA, which is not + legal FORTRAN.] + If LROWS=.TRUE., then LDA must be at least 1, otherwise + it must be at least NL minus the number of .TRUE. values + in XLEFT and XRIGHT. + Not modified. + + XLEFT - COMPLEX + If LLEFT is .TRUE., then XLEFT will be used and modified + instead of A(2,1) (if LROWS=.TRUE.) or A(1,2) + (if LROWS=.FALSE.). + Read and modified. + + XRIGHT - COMPLEX + If LRIGHT is .TRUE., then XRIGHT will be used and modified + instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1) + (if LROWS=.FALSE.). + Read and modified. + + ===================================================================== + + + + Set up indices, arrays for ends + + Parameter adjustments */ + --a; + + /* Function Body */ + if (*lrows) { + iinc = *lda; + inext = 1; + } else { + iinc = 1; + inext = *lda; + } + + if (*lleft) { + nt = 1; + ix = iinc + 1; + iy = *lda + 2; + xt[0].r = a[1].r, xt[0].i = a[1].i; + yt[0].r = xleft->r, yt[0].i = xleft->i; + } else { + nt = 0; + ix = 1; + iy = inext + 1; + } + + if (*lright) { + iyt = inext + 1 + (*nl - 1) * iinc; + ++nt; + i__1 = nt - 1; + xt[i__1].r = xright->r, xt[i__1].i = xright->i; + i__1 = nt - 1; + i__2 = iyt; + yt[i__1].r = a[i__2].r, yt[i__1].i = a[i__2].i; + } + +/* Check for errors */ + + if (*nl < nt) { + xerbla_("CLAROT", &c__4); + return 0; + } + if (*lda <= 0 || ! (*lrows) && *lda < *nl - nt) { + xerbla_("CLAROT", &c__8); + return 0; + } + +/* Rotate + + CROT( NL-NT, A(IX),IINC, A(IY),IINC, C, S ) with complex C, S */ + + i__1 = *nl - nt - 1; + for (j = 0; j <= i__1; ++j) { + i__2 = ix + j * iinc; + q__2.r = c->r * a[i__2].r - c->i * a[i__2].i, q__2.i = c->r * a[i__2] + .i + c->i * a[i__2].r; + i__3 = iy + j * iinc; + q__3.r = s->r * a[i__3].r - s->i * a[i__3].i, q__3.i = s->r * a[i__3] + .i + s->i * a[i__3].r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + tempx.r = q__1.r, tempx.i = q__1.i; + i__2 = iy + j * iinc; + r_cnjg(&q__4, s); + q__3.r = -(doublereal)q__4.r, q__3.i = -(doublereal)q__4.i; + i__3 = ix + j * iinc; + q__2.r = q__3.r * a[i__3].r - q__3.i * a[i__3].i, q__2.i = q__3.r * a[ + i__3].i + q__3.i * a[i__3].r; + r_cnjg(&q__6, c); + i__4 = iy + j * iinc; + q__5.r = q__6.r * a[i__4].r - q__6.i * a[i__4].i, q__5.i = q__6.r * a[ + i__4].i + q__6.i * a[i__4].r; + q__1.r = q__2.r + q__5.r, q__1.i = q__2.i + q__5.i; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; + i__2 = ix + j * iinc; + a[i__2].r = tempx.r, a[i__2].i = tempx.i; +/* L10: */ + } + +/* CROT( NT, XT,1, YT,1, C, S ) with complex C, S */ + + i__1 = nt; + for (j = 1; j <= i__1; ++j) { + i__2 = j - 1; + q__2.r = c->r * xt[i__2].r - c->i * xt[i__2].i, q__2.i = c->r * xt[ + i__2].i + c->i * xt[i__2].r; + i__3 = j - 1; + q__3.r = s->r * yt[i__3].r - s->i * yt[i__3].i, q__3.i = s->r * yt[ + i__3].i + s->i * yt[i__3].r; + q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; + tempx.r = q__1.r, tempx.i = q__1.i; + i__2 = j - 1; + r_cnjg(&q__4, s); + q__3.r = -(doublereal)q__4.r, q__3.i = -(doublereal)q__4.i; + i__3 = j - 1; + q__2.r = q__3.r * xt[i__3].r - q__3.i * xt[i__3].i, q__2.i = q__3.r * + xt[i__3].i + q__3.i * xt[i__3].r; + r_cnjg(&q__6, c); + i__4 = j - 1; + q__5.r = q__6.r * yt[i__4].r - q__6.i * yt[i__4].i, q__5.i = q__6.r * + yt[i__4].i + q__6.i * yt[i__4].r; + q__1.r = q__2.r + q__5.r, q__1.i = q__2.i + q__5.i; + yt[i__2].r = q__1.r, yt[i__2].i = q__1.i; + i__2 = j - 1; + xt[i__2].r = tempx.r, xt[i__2].i = tempx.i; +/* L20: */ + } + +/* Stuff values back into XLEFT, XRIGHT, etc. */ + + if (*lleft) { + a[1].r = xt[0].r, a[1].i = xt[0].i; + xleft->r = yt[0].r, xleft->i = yt[0].i; + } + + if (*lright) { + i__1 = nt - 1; + xright->r = xt[i__1].r, xright->i = xt[i__1].i; + i__1 = iyt; + i__2 = nt - 1; + a[i__1].r = yt[i__2].r, a[i__1].i = yt[i__2].i; + } + + return 0; + +/* End of CLAROT */ + +} /* clarot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clartg.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clartg.c new file mode 100644 index 0000000..c290985 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clartg.c @@ -0,0 +1,147 @@ +#include "f2c.h" + +/* Subroutine */ int clartg_(complex *f, complex *g, real *cs, complex *sn, + complex *r) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLARTG generates a plane rotation so that + + [ CS SN ] [ F ] [ R ] + [ __ ] . [ ] = [ ] where CS**2 + |SN|**2 = 1. + [ -SN CS ] [ G ] [ 0 ] + + This is a faster version of the BLAS1 routine CROTG, except for + the following differences: + F and G are unchanged on return. + If G=0, then CS=1 and SN=0. + If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any + floating point operations. + + Arguments + ========= + + F (input) COMPLEX + The first component of vector to be rotated. + + G (input) COMPLEX + The second component of vector to be rotated. + + CS (output) REAL + The cosine of the rotation. + + SN (output) COMPLEX + The sine of the rotation. + + R (output) COMPLEX + The nonzero component of the rotated vector. + + ===================================================================== + + + + [ 25 or 38 ops for main paths ] */ + /* System generated locals */ + real r__1, r__2; + doublereal d__1; + complex q__1, q__2, q__3; + /* Builtin functions */ + void r_cnjg(complex *, complex *); + double c_abs(complex *), r_imag(complex *), sqrt(doublereal); + /* Local variables */ + static real d, f1, f2, g1, g2, fa, ga, di; + static complex fs, gs, ss; + + + if (g->r == 0.f && g->i == 0.f) { + *cs = 1.f; + sn->r = 0.f, sn->i = 0.f; + r->r = f->r, r->i = f->i; + } else if (f->r == 0.f && f->i == 0.f) { + *cs = 0.f; + + r_cnjg(&q__2, g); + d__1 = c_abs(g); + q__1.r = q__2.r / d__1, q__1.i = q__2.i / d__1; + sn->r = q__1.r, sn->i = q__1.i; + d__1 = c_abs(g); + r->r = d__1, r->i = 0.f; + +/* SN = ONE + R = G */ + + } else { + f1 = (r__1 = f->r, dabs(r__1)) + (r__2 = r_imag(f), dabs(r__2)); + g1 = (r__1 = g->r, dabs(r__1)) + (r__2 = r_imag(g), dabs(r__2)); + if (f1 >= g1) { + q__1.r = g->r / f1, q__1.i = g->i / f1; + gs.r = q__1.r, gs.i = q__1.i; +/* Computing 2nd power */ + r__1 = gs.r; +/* Computing 2nd power */ + r__2 = r_imag(&gs); + g2 = r__1 * r__1 + r__2 * r__2; + q__1.r = f->r / f1, q__1.i = f->i / f1; + fs.r = q__1.r, fs.i = q__1.i; +/* Computing 2nd power */ + r__1 = fs.r; +/* Computing 2nd power */ + r__2 = r_imag(&fs); + f2 = r__1 * r__1 + r__2 * r__2; + d = sqrt(g2 / f2 + 1.f); + *cs = 1.f / d; + r_cnjg(&q__3, &gs); + q__2.r = q__3.r * fs.r - q__3.i * fs.i, q__2.i = q__3.r * fs.i + + q__3.i * fs.r; + d__1 = *cs / f2; + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + sn->r = q__1.r, sn->i = q__1.i; + q__1.r = d * f->r, q__1.i = d * f->i; + r->r = q__1.r, r->i = q__1.i; + } else { + q__1.r = f->r / g1, q__1.i = f->i / g1; + fs.r = q__1.r, fs.i = q__1.i; +/* Computing 2nd power */ + r__1 = fs.r; +/* Computing 2nd power */ + r__2 = r_imag(&fs); + f2 = r__1 * r__1 + r__2 * r__2; + fa = sqrt(f2); + q__1.r = g->r / g1, q__1.i = g->i / g1; + gs.r = q__1.r, gs.i = q__1.i; +/* Computing 2nd power */ + r__1 = gs.r; +/* Computing 2nd power */ + r__2 = r_imag(&gs); + g2 = r__1 * r__1 + r__2 * r__2; + ga = sqrt(g2); + d = sqrt(f2 / g2 + 1.f); + di = 1.f / d; + *cs = fa / ga * di; + r_cnjg(&q__3, &gs); + q__2.r = q__3.r * fs.r - q__3.i * fs.i, q__2.i = q__3.r * fs.i + + q__3.i * fs.r; + d__1 = fa * ga; + q__1.r = q__2.r / d__1, q__1.i = q__2.i / d__1; + ss.r = q__1.r, ss.i = q__1.i; + q__1.r = di * ss.r, q__1.i = di * ss.i; + sn->r = q__1.r, sn->i = q__1.i; + q__2.r = g->r * ss.r - g->i * ss.i, q__2.i = g->r * ss.i + g->i * + ss.r; + q__1.r = d * q__2.r, q__1.i = d * q__2.i; + r->r = q__1.r, r->i = q__1.i; + } + } + return 0; + +/* End of CLARTG */ + +} /* clartg_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claset.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claset.c new file mode 100644 index 0000000..6d98ba2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/claset.c @@ -0,0 +1,144 @@ +#include "f2c.h" + +/* Subroutine */ int claset_(char *uplo, integer *m, integer *n, complex * + alpha, complex *beta, complex *a, integer *lda) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + CLASET initializes a 2-D array A to BETA on the diagonal and + ALPHA on the offdiagonals. + + Arguments + ========= + + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be set. + = 'U': Upper triangular part is set. The lower triangle + + is unchanged. + = 'L': Lower triangular part is set. The upper triangle + + is unchanged. + Otherwise: All of the matrix A is set. + + M (input) INTEGER + On entry, M specifies the number of rows of A. + + N (input) INTEGER + On entry, N specifies the number of columns of A. + + ALPHA (input) COMPLEX + All the offdiagonal array elements are set to ALPHA. + + BETA (input) COMPLEX + All the diagonal array elements are set to BETA. + + A (input/output) COMPLEX array, dimension (LDA,N) + On entry, the m by n matrix A. + On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j; + A(i,i) = BETA , 1 <= i <= min(m,n) + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + /* Local variables */ + static integer i, j; + extern logical lsame_(char *, char *); + + + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + if (lsame_(uplo, "U")) { + +/* Set the diagonal to BETA and the strictly upper triangular + + part of the array to ALPHA. */ + + i__1 = *n; + for (j = 2; j <= *n; ++j) { +/* Computing MIN */ + i__3 = j - 1; + i__2 = min(i__3,*m); + for (i = 1; i <= min(j-1,*m); ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*n,*m); + for (i = 1; i <= min(*n,*m); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L30: */ + } + + } else if (lsame_(uplo, "L")) { + +/* Set the diagonal to BETA and the strictly lower triangular + + part of the array to ALPHA. */ + + i__1 = min(*m,*n); + for (j = 1; j <= min(*m,*n); ++j) { + i__2 = *m; + for (i = j + 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L40: */ + } +/* L50: */ + } + i__1 = min(*n,*m); + for (i = 1; i <= min(*n,*m); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L60: */ + } + + } else { + +/* Set the array to BETA on the diagonal and ALPHA on the + offdiagonal. */ + + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L70: */ + } +/* L80: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= min(*m,*n); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L90: */ + } + } + + return 0; + +/* End of CLASET */ + +} /* claset_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatb4.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatb4.c new file mode 100644 index 0000000..cdd3a9d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatb4.c @@ -0,0 +1,467 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include +#include "f2c.h" + +/* Table of constant values */ + +static integer c__2 = 2; + +/* Subroutine */ int clatb4_(char *path, integer *imat, integer *m, integer * + n, char *type, integer *kl, integer *ku, real *anorm, integer *mode, + real *cndnum, char *dist) +{ + /* Initialized data */ + + static logical first = TRUE_; + + /* System generated locals */ + integer i__1; + + /* Builtin functions */ + double sqrt(doublereal); + + /* Local variables */ + static real badc1, badc2, large, small; + static char c2[2]; + extern /* Subroutine */ int slabad_(real *, real *); + extern float slamch_(char *); + extern logical lsamen_(integer *, char *, char *); + static integer mat; + static real eps; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + CLATB4 sets parameters for the matrix generator based on the type of + + matrix to be generated. + + Arguments + ========= + + PATH (input) CHARACTER*3 + The LAPACK path name. + + IMAT (input) INTEGER + An integer key describing which matrix to generate for this + path. + + M (input) INTEGER + The number of rows in the matrix to be generated. + + N (input) INTEGER + The number of columns in the matrix to be generated. + + TYPE (output) CHARACTER*1 + The type of the matrix to be generated: + = 'S': symmetric matrix + = 'P': symmetric positive (semi)definite matrix + = 'N': nonsymmetric matrix + + KL (output) INTEGER + The lower band width of the matrix to be generated. + + KU (output) INTEGER + The upper band width of the matrix to be generated. + + ANORM (output) REAL + The desired norm of the matrix to be generated. The diagonal + + matrix of singular values or eigenvalues is scaled by this + value. + + MODE (output) INTEGER + A key indicating how to choose the vector of eigenvalues. + + CNDNUM (output) REAL + The desired condition number. + + DIST (output) CHARACTER*1 + The type of distribution to be used by the random number + generator. + + ===================================================================== + + + + Set some constants for use in the subroutine. */ + + if (first) { + first = FALSE_; + eps = slamch_("Precision"); + badc2 = .1f / eps; + badc1 = sqrt(badc2); + small = slamch_("Safe minimum"); + large = 1.f / small; + +/* If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + + slabad_(&small, &large); + small = small / eps * .25f; + large = 1.f / small; + } + + /* s_copy(c2, path + 1, 2L, 2L);*/ + strncpy(c2, path + 1, 2); + +/* Set some parameters we don't plan to change. */ + + *(unsigned char *)dist = 'S'; + *mode = 3; + +/* xQR, xLQ, xQL, xRQ: Set parameters to generate a general + M x N matrix. */ + + if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2, "LQ") + || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) { + +/* Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GE")) { + +/* xGE: Set parameters to generate a general M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 8) { + *cndnum = badc1; + } else if (*imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 10) { + *anorm = small; + } else if (*imat == 11) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GB")) { + +/* xGB: Set parameters to generate a general banded matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2 * .1f; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GT")) { + +/* xGT: Set parameters to generate a general tridiagonal matri +x. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&c__2, c2, "PP") || lsamen_(&c__2, c2, "HE") || lsamen_(&c__2, c2, + "HP") || lsamen_(&c__2, c2, "SY") || lsamen_(& + c__2, c2, "SP")) { + +/* xPO, xPP, xHE, xHP, xSY, xSP: Set parameters to generate a + + symmetric or Hermitian matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = *(unsigned char *)c2; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 6) { + *cndnum = badc1; + } else if (*imat == 7) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 8) { + *anorm = small; + } else if (*imat == 9) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PB")) { + +/* xPB: Set parameters to generate a symmetric band matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'P'; + +/* Set the norm and condition number. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PT")) { + +/* xPT: Set parameters to generate a symmetric positive defini +te + tridiagonal matrix. */ + + *(unsigned char *)type = 'P'; + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&c__2, c2, "TP")) { + +/* xTR, xTP: Set parameters to generate a triangular matrix + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + mat = abs(*imat); + if (mat == 1 || mat == 7) { + *kl = 0; + *ku = 0; + } else if (*imat < 0) { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + *ku = 0; + } else { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (mat == 3 || mat == 9) { + *cndnum = badc1; + } else if (mat == 4 || mat == 10) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (mat == 5) { + *anorm = small; + } else if (mat == 6) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "TB")) { + +/* xTB: Set parameters to generate a triangular band matrix. + + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the norm and condition number. */ + + if (*imat == 2 || *imat == 8) { + *cndnum = badc1; + } else if (*imat == 3 || *imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 4) { + *anorm = small; + } else if (*imat == 5) { + *anorm = large; + } else { + *anorm = 1.f; + } + } + if (*n <= 1) { + *cndnum = 1.f; + } + + return 0; + +/* End of CLATB4 */ + +} /* clatb4_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm2.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm2.c new file mode 100644 index 0000000..5faccf1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm2.c @@ -0,0 +1,283 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Complex */ VOID clatm2_(complex * ret_val, integer *m, integer *n, integer + *i, integer *j, integer *kl, integer *ku, integer *idist, integer * + iseed, complex *d, integer *igrade, complex *dl, complex *dr, integer + *ipvtng, integer *iwork, real *sparse) +{ + /* System generated locals */ + integer i__1, i__2; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void c_div(complex *, complex *, complex *), r_cnjg(complex *, complex *); + + /* Local variables */ + static integer isub, jsub; + static complex ctemp; + extern /* Complex */ VOID clarnd_(complex *, integer *, integer *); + extern doublereal slaran_(integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + CLATM2 returns the (I,J) entry of a random matrix of dimension + (M, N) described by the other paramters. It is called by the + CLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by CLATMR which has already checked the parameters. + + Use of CLATM2 differs from CLATM3 in the order in which the random + + number generator is called to fill in random matrix entries. + With CLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With CLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, CLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. CLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + + The matrix whose (I,J) entry is returned is constructed as + follows (this routine only computes one entry): + + If I is outside (1..M) or J is outside (1..N), return zero + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of entry to be returned. Not modified. + + J - INTEGER + Column of entry to be returned. Not modified. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => real and imaginary parts each UNIFORM( 0, 1 ) + 2 => real and imaginary parts each UNIFORM( -1, 1 ) + 3 => real and imaginary parts each NORMAL( 0, 1 ) + 4 => complex number uniform in DISK( 0 , 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - COMPLEX array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + 6 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - COMPLEX array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - COMPLEX array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) in position K was originally in + position IWORK( K ). + This differs from IWORK for CLATM3. Not modified. + + SPARSE - REAL between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + +/* Check for banding */ + + if (*j > *i + *ku || *j < *i - *kl) { + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + +/* Check for sparsity */ + + if (*sparse > 0.f) { + if (slaran_(&iseed[1]) < *sparse) { + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + isub = *i; + jsub = *j; + } else if (*ipvtng == 1) { + isub = iwork[*i]; + jsub = *j; + } else if (*ipvtng == 2) { + isub = *i; + jsub = iwork[*j]; + } else if (*ipvtng == 3) { + isub = iwork[*i]; + jsub = iwork[*j]; + } + +/* Compute entry and grade it according to IGRADE */ + + if (isub == jsub) { + i__1 = isub; + ctemp.r = d[i__1].r, ctemp.i = d[i__1].i; + } else { + clarnd_(&q__1, idist, &iseed[1]); + ctemp.r = q__1.r, ctemp.i = q__1.i; + } + if (*igrade == 1) { + i__1 = isub; + q__1.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__1.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 2) { + i__1 = jsub; + q__1.r = ctemp.r * dr[i__1].r - ctemp.i * dr[i__1].i, q__1.i = + ctemp.r * dr[i__1].i + ctemp.i * dr[i__1].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 3) { + i__1 = isub; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = jsub; + q__1.r = q__2.r * dr[i__2].r - q__2.i * dr[i__2].i, q__1.i = q__2.r * + dr[i__2].i + q__2.i * dr[i__2].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 4 && isub != jsub) { + i__1 = isub; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + c_div(&q__1, &q__2, &dl[jsub]); + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 5) { + i__1 = isub; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + r_cnjg(&q__3, &dl[jsub]); + q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i = q__2.r * q__3.i + + q__2.i * q__3.r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 6) { + i__1 = isub; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = jsub; + q__1.r = q__2.r * dl[i__2].r - q__2.i * dl[i__2].i, q__1.i = q__2.r * + dl[i__2].i + q__2.i * dl[i__2].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* End of CLATM2 */ + +} /* clatm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm3.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm3.c new file mode 100644 index 0000000..a582ad6 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatm3.c @@ -0,0 +1,295 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Complex */ VOID clatm3_(complex * ret_val, integer *m, integer *n, integer + *i, integer *j, integer *isub, integer *jsub, integer *kl, integer * + ku, integer *idist, integer *iseed, complex *d, integer *igrade, + complex *dl, complex *dr, integer *ipvtng, integer *iwork, real * + sparse) +{ + /* System generated locals */ + integer i__1, i__2; + complex q__1, q__2, q__3; + + /* Builtin functions */ + void c_div(complex *, complex *, complex *), r_cnjg(complex *, complex *); + + /* Local variables */ + static complex ctemp; + extern /* Complex */ VOID clarnd_(complex *, integer *, integer *); + extern doublereal slaran_(integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + CLATM3 returns the (ISUB,JSUB) entry of a random matrix of + dimension (M, N) described by the other paramters. (ISUB,JSUB) + is the final position of the (I,J) entry after pivoting + according to IPVTNG and IWORK. CLATM3 is called by the + CLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by CLATMR which has already checked the parameters. + + Use of CLATM3 differs from CLATM2 in the order in which the random + + number generator is called to fill in random matrix entries. + With CLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With CLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, CLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. CLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + in different orders for different pivot orders). + + The matrix whose (ISUB,JSUB) entry is returned is constructed as + follows (this routine only computes one entry): + + If ISUB is outside (1..M) or JSUB is outside (1..N), return zero + + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of unpivoted entry to be returned. Not modified. + + J - INTEGER + Column of unpivoted entry to be returned. Not modified. + + ISUB - INTEGER + Row of pivoted entry to be returned. Changed on exit. + + JSUB - INTEGER + Column of pivoted entry to be returned. Changed on exit. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => real and imaginary parts each UNIFORM( 0, 1 ) + 2 => real and imaginary parts each UNIFORM( -1, 1 ) + 3 => real and imaginary parts each NORMAL( 0, 1 ) + 4 => complex number uniform in DISK( 0 , 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - COMPLEX array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + 6 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - COMPLEX array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - COMPLEX array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) originally in position K is in + position IWORK( K ) after pivoting. + This differs from IWORK for CLATM2. Not modified. + + SPARSE - REAL between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + *isub = *i; + *jsub = *j; + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + *isub = *i; + *jsub = *j; + } else if (*ipvtng == 1) { + *isub = iwork[*i]; + *jsub = *j; + } else if (*ipvtng == 2) { + *isub = *i; + *jsub = iwork[*j]; + } else if (*ipvtng == 3) { + *isub = iwork[*i]; + *jsub = iwork[*j]; + } + +/* Check for banding */ + + if (*jsub > *isub + *ku || *jsub < *isub - *kl) { + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + +/* Check for sparsity */ + + if (*sparse > 0.f) { + if (slaran_(&iseed[1]) < *sparse) { + ret_val->r = 0.f, ret_val->i = 0.f; + return ; + } + } + +/* Compute entry and grade it according to IGRADE */ + + if (*i == *j) { + i__1 = *i; + ctemp.r = d[i__1].r, ctemp.i = d[i__1].i; + } else { + clarnd_(&q__1, idist, &iseed[1]); + ctemp.r = q__1.r, ctemp.i = q__1.i; + } + if (*igrade == 1) { + i__1 = *i; + q__1.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__1.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 2) { + i__1 = *j; + q__1.r = ctemp.r * dr[i__1].r - ctemp.i * dr[i__1].i, q__1.i = + ctemp.r * dr[i__1].i + ctemp.i * dr[i__1].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 3) { + i__1 = *i; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = *j; + q__1.r = q__2.r * dr[i__2].r - q__2.i * dr[i__2].i, q__1.i = q__2.r * + dr[i__2].i + q__2.i * dr[i__2].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 4 && *i != *j) { + i__1 = *i; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + c_div(&q__1, &q__2, &dl[*j]); + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 5) { + i__1 = *i; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + r_cnjg(&q__3, &dl[*j]); + q__1.r = q__2.r * q__3.r - q__2.i * q__3.i, q__1.i = q__2.r * q__3.i + + q__2.i * q__3.r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } else if (*igrade == 6) { + i__1 = *i; + q__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, q__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = *j; + q__1.r = q__2.r * dl[i__2].r - q__2.i * dl[i__2].i, q__1.i = q__2.r * + dl[i__2].i + q__2.i * dl[i__2].r; + ctemp.r = q__1.r, ctemp.i = q__1.i; + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* End of CLATM3 */ + +} /* clatm3_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatme.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatme.c new file mode 100644 index 0000000..7f4363b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatme.c @@ -0,0 +1,623 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static complex c_b2 = {1.f,0.f}; +static integer c__1 = 1; +static integer c__0 = 0; +static integer c__5 = 5; + +/* Subroutine */ int clatme_(integer *n, char *dist, integer *iseed, complex * + d, integer *mode, real *cond, complex *dmax__, char *ei, char *rsign, + char *upper, char *sim, real *ds, integer *modes, real *conds, + integer *kl, integer *ku, real *anorm, complex *a, integer *lda, + complex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + real r__1, r__2; + complex q__1, q__2; + + /* Builtin functions */ + double c_abs(complex *); + void r_cnjg(complex *, complex *); + + /* Local variables */ + static logical bads; + static integer isim; + static real temp; + static integer i, j; + extern /* Subroutine */ int cgerc_(integer *, integer *, complex *, + complex *, integer *, complex *, integer *, complex *, integer *); + static complex alpha; + extern /* Subroutine */ int cscal_(integer *, complex *, complex *, + integer *); + extern logical lsame_(char *, char *); + extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex * + , complex *, integer *, complex *, integer *, complex *, complex * + , integer *); + static integer iinfo; + static real tempa[1]; + static integer icols, idist; + extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, + complex *, integer *); + static integer irows; + extern /* Subroutine */ int clatm1_(integer *, real *, integer *, integer + *, integer *, complex *, integer *, integer *), slatm1_(integer *, + real *, integer *, integer *, integer *, real *, integer *, + integer *); + static integer ic, jc; + extern doublereal clange_(char *, integer *, integer *, complex *, + integer *, real *); + static integer ir; + extern /* Subroutine */ int clarge_(integer *, complex *, integer *, + integer *, complex *, integer *), clarfg_(integer *, complex *, + complex *, integer *, complex *), clacgv_(integer *, complex *, + integer *); + extern /* Complex */ VOID clarnd_(complex *, integer *, integer *); + static real ralpha; + extern /* Subroutine */ int csscal_(integer *, real *, complex *, integer + *), claset_(char *, integer *, integer *, complex *, complex *, + complex *, integer *), xerbla_(char *, integer *), + clarnv_(integer *, integer *, integer *, complex *); + static integer irsign, iupper; + static complex xnorms; + static integer jcr; + static complex tau; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLATME generates random non-symmetric square matrices with + specified eigenvalues for testing LAPACK programs. + + CLATME operates by applying the following sequence of + operations: + + 1. Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and RSIGN + as described below. + + 2. If UPPER='T', the upper triangle of A is set to random values + out of distribution DIST. + + 3. If SIM='T', A is multiplied on the left by a random matrix + X, whose singular values are specified by DS, MODES, and + CONDS, and on the right by X inverse. + + 4. If KL < N-1, the lower bandwidth is reduced to KL using + Householder transformations. If KU < N-1, the upper + bandwidth is reduced to KU. + + 5. If ANORM is not negative, the matrix is scaled to have + maximum-element-norm ANORM. + + (Note: since the matrix cannot be reduced beyond Hessenberg form, + + no packing options are available.) + + Arguments + ========= + + N - INTEGER + The number of columns (or rows) of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values, and on the + upper triangle (see UPPER). + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + 'D' => uniform on the complex disc |z| < 1. + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to CLATME + to continue the same random number sequence. + Changed on exit. + + D - COMPLEX array, dimension ( N ) + This array is used to specify the eigenvalues of A. If + MODE=0, then D is assumed to contain the eigenvalues + otherwise they will be computed according to MODE, COND, + DMAX, and RSIGN and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the eigenvalues are to + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is between 1 and 4, D has entries ranging + from 1 to 1/COND, if between -1 and -4, D has entries + ranging from 1/COND to 1, + Not modified. + + COND - REAL + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - COMPLEX + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))). Note that DMAX need not be + positive or real: if DMAX is negative or complex (or zero), + + D will be scaled by a negative or complex number (or zero). + + If RSIGN='F' then the largest (absolute) eigenvalue will be + + equal to DMAX. + Not modified. + + EI - CHARACTER*1 (ignored) + Not modified. + + RSIGN - CHARACTER*1 + If MODE is not 0, 6, or -6, and RSIGN='T', then the + elements of D, as computed according to MODE and COND, will + + be multiplied by a random complex number from the unit + circle |z| = 1. If RSIGN='F', they will not be. RSIGN may + + only have the values 'T' or 'F'. + Not modified. + + UPPER - CHARACTER*1 + If UPPER='T', then the elements of A above the diagonal + will be set to random numbers out of DIST. If UPPER='F', + they will not. UPPER may only have the values 'T' or 'F'. + Not modified. + + SIM - CHARACTER*1 + If SIM='T', then A will be operated on by a "similarity + transform", i.e., multiplied on the left by a matrix X and + on the right by X inverse. X = U S V, where U and V are + random unitary matrices and S is a (diagonal) matrix of + singular values specified by DS, MODES, and CONDS. If + SIM='F', then A will not be transformed. + Not modified. + + DS - REAL array, dimension ( N ) + This array is used to specify the singular values of X, + in the same way that D specifies the eigenvalues of A. + If MODE=0, the DS contains the singular values, which + may not be zero. + Modified if MODE is nonzero. + + MODES - INTEGER + CONDS - REAL + Similar to MODE and COND, but for specifying the diagonal + of S. MODES=-6 and +6 are not allowed (since they would + result in randomly ill-conditioned eigenvalues.) + + KL - INTEGER + This specifies the lower bandwidth of the matrix. KL=1 + specifies upper Hessenberg form. If KL is at least N-1, + then A will have full lower bandwidth. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. KU=1 + specifies lower Hessenberg form. If KU is at least N-1, + then A will have full upper bandwidth; if KU and KL + are both at least N-1, then A will be dense. Only one of + KU and KL may be less than N-1. + Not modified. + + ANORM - REAL + If ANORM is not negative, then A will be scaled by a non- + negative real number to make the maximum-element-norm of A + to be ANORM. + Not modified. + + A - COMPLEX array, dimension ( LDA, N ) + On exit A is the desired test matrix. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. LDA must be at least M. + Not modified. + + WORK - COMPLEX array, dimension ( 3*N ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => N negative + -2 => DIST illegal string + -5 => MODE not in range -6 to 6 + -6 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -9 => RSIGN is not 'T' or 'F' + -10 => UPPER is not 'T' or 'F' + -11 => SIM is not 'T' or 'F' + -12 => MODES=0 and DS has a zero singular value. + -13 => MODES is not in the range -5 to 5. + -14 => MODES is nonzero and CONDS is less than 1. + -15 => KL is less than 1. + -16 => KU is less than 1, or KL and KU are both less than + N-1. + -19 => LDA is less than M. + 1 => Error return from CLATM1 (computing D) + 2 => Cannot scale to DMAX (max. eigenvalue is 0) + 3 => Error return from SLATM1 (computing DS) + 4 => Error return from CLARGE + 5 => Zero singular value from SLATM1. + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --ds; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else if (lsame_(dist, "D")) { + idist = 4; + } else { + idist = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "T")) { + irsign = 1; + } else if (lsame_(rsign, "F")) { + irsign = 0; + } else { + irsign = -1; + } + +/* Decode UPPER */ + + if (lsame_(upper, "T")) { + iupper = 1; + } else if (lsame_(upper, "F")) { + iupper = 0; + } else { + iupper = -1; + } + +/* Decode SIM */ + + if (lsame_(sim, "T")) { + isim = 1; + } else if (lsame_(sim, "F")) { + isim = 0; + } else { + isim = -1; + } + +/* Check DS, if MODES=0 and ISIM=1 */ + + bads = FALSE_; + if (*modes == 0 && isim == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (ds[j] == 0.f) { + bads = TRUE_; + } +/* L10: */ + } + } + +/* Set INFO if an error */ + + if (*n < 0) { + *info = -1; + } else if (idist == -1) { + *info = -2; + } else if (abs(*mode) > 6) { + *info = -5; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.f) { + *info = -6; + } else if (irsign == -1) { + *info = -9; + } else if (iupper == -1) { + *info = -10; + } else if (isim == -1) { + *info = -11; + } else if (bads) { + *info = -12; + } else if (isim == 1 && abs(*modes) > 5) { + *info = -13; + } else if (isim == 1 && *modes != 0 && *conds < 1.f) { + *info = -14; + } else if (*kl < 1) { + *info = -15; + } else if (*ku < 1 || *ku < *n - 1 && *kl < *n - 1) { + *info = -16; + } else if (*lda < max(1,*n)) { + *info = -19; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("CLATME", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L20: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up diagonal of A + + Compute D according to COND and MODE */ + + clatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], n, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = c_abs(&d[1]); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__1 = temp, r__2 = c_abs(&d[i]); + temp = dmax(r__1,r__2); +/* L30: */ + } + + if (temp > 0.f) { + q__1.r = dmax__->r / temp, q__1.i = dmax__->i / temp; + alpha.r = q__1.r, alpha.i = q__1.i; + } else { + *info = 2; + return 0; + } + + cscal_(n, &alpha, &d[1], &c__1); + + } + + claset_("Full", n, n, &c_b1, &c_b1, &a[a_offset], lda); + i__1 = *lda + 1; + ccopy_(n, &d[1], &c__1, &a[a_offset], &i__1); + +/* 3) If UPPER='T', set upper triangle of A to random numbers. */ + + if (iupper != 0) { + i__1 = *n; + for (jc = 2; jc <= i__1; ++jc) { + i__2 = jc - 1; + clarnv_(&idist, &iseed[1], &i__2, &a[jc * a_dim1 + 1]); +/* L40: */ + } + } + +/* 4) If SIM='T', apply similarity transformation. + + -1 + Transform is X A X , where X = U S V, thus + + it is U S V A V' (1/S) U' */ + + if (isim != 0) { + +/* Compute S (singular values of the eigenvector matrix) + according to CONDS and MODES */ + + slatm1_(modes, conds, &c__0, &c__0, &iseed[1], &ds[1], n, &iinfo); + if (iinfo != 0) { + *info = 3; + return 0; + } + +/* Multiply by V and V' */ + + clarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + +/* Multiply by S and (1/S) */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + csscal_(n, &ds[j], &a[j + a_dim1], lda); + if (ds[j] != 0.f) { + r__1 = 1.f / ds[j]; + csscal_(n, &r__1, &a[j * a_dim1 + 1], &c__1); + } else { + *info = 5; + return 0; + } +/* L50: */ + } + +/* Multiply by U and U' */ + + clarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + } + +/* 5) Reduce the bandwidth. */ + + if (*kl < *n - 1) { + +/* Reduce bandwidth -- kill column */ + + i__1 = *n - 1; + for (jcr = *kl + 1; jcr <= i__1; ++jcr) { + ic = jcr - *kl; + irows = *n + 1 - jcr; + icols = *n + *kl - jcr; + + ccopy_(&irows, &a[jcr + ic * a_dim1], &c__1, &work[1], &c__1); + xnorms.r = work[1].r, xnorms.i = work[1].i; + clarfg_(&irows, &xnorms, &work[2], &c__1, &tau); + r_cnjg(&q__1, &tau); + tau.r = q__1.r, tau.i = q__1.i; + work[1].r = 1.f, work[1].i = 0.f; + clarnd_(&q__1, &c__5, &iseed[1]); + alpha.r = q__1.r, alpha.i = q__1.i; + + cgemv_("C", &irows, &icols, &c_b2, &a[jcr + (ic + 1) * a_dim1], + lda, &work[1], &c__1, &c_b1, &work[irows + 1], &c__1); + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&irows, &icols, &q__1, &work[1], &c__1, &work[irows + 1], & + c__1, &a[jcr + (ic + 1) * a_dim1], lda); + + cgemv_("N", n, &irows, &c_b2, &a[jcr * a_dim1 + 1], lda, &work[1], + &c__1, &c_b1, &work[irows + 1], &c__1); + r_cnjg(&q__2, &tau); + q__1.r = -(doublereal)q__2.r, q__1.i = -(doublereal)q__2.i; + cgerc_(n, &irows, &q__1, &work[irows + 1], &c__1, &work[1], &c__1, + &a[jcr * a_dim1 + 1], lda); + + i__2 = jcr + ic * a_dim1; + a[i__2].r = xnorms.r, a[i__2].i = xnorms.i; + i__2 = irows - 1; + claset_("Full", &i__2, &c__1, &c_b1, &c_b1, &a[jcr + 1 + ic * + a_dim1], lda); + + i__2 = icols + 1; + cscal_(&i__2, &alpha, &a[jcr + ic * a_dim1], lda); + r_cnjg(&q__1, &alpha); + cscal_(n, &q__1, &a[jcr * a_dim1 + 1], &c__1); +/* L60: */ + } + } else if (*ku < *n - 1) { + +/* Reduce upper bandwidth -- kill a row at a time. */ + + i__1 = *n - 1; + for (jcr = *ku + 1; jcr <= i__1; ++jcr) { + ir = jcr - *ku; + irows = *n + *ku - jcr; + icols = *n + 1 - jcr; + + ccopy_(&icols, &a[ir + jcr * a_dim1], lda, &work[1], &c__1); + xnorms.r = work[1].r, xnorms.i = work[1].i; + clarfg_(&icols, &xnorms, &work[2], &c__1, &tau); + r_cnjg(&q__1, &tau); + tau.r = q__1.r, tau.i = q__1.i; + work[1].r = 1.f, work[1].i = 0.f; + i__2 = icols - 1; + clacgv_(&i__2, &work[2], &c__1); + clarnd_(&q__1, &c__5, &iseed[1]); + alpha.r = q__1.r, alpha.i = q__1.i; + + cgemv_("N", &irows, &icols, &c_b2, &a[ir + 1 + jcr * a_dim1], lda, + &work[1], &c__1, &c_b1, &work[icols + 1], &c__1); + q__1.r = -(doublereal)tau.r, q__1.i = -(doublereal)tau.i; + cgerc_(&irows, &icols, &q__1, &work[icols + 1], &c__1, &work[1], & + c__1, &a[ir + 1 + jcr * a_dim1], lda); + + cgemv_("C", &icols, n, &c_b2, &a[jcr + a_dim1], lda, &work[1], & + c__1, &c_b1, &work[icols + 1], &c__1); + r_cnjg(&q__2, &tau); + q__1.r = -(doublereal)q__2.r, q__1.i = -(doublereal)q__2.i; + cgerc_(&icols, n, &q__1, &work[1], &c__1, &work[icols + 1], &c__1, + &a[jcr + a_dim1], lda); + + i__2 = ir + jcr * a_dim1; + a[i__2].r = xnorms.r, a[i__2].i = xnorms.i; + i__2 = icols - 1; + claset_("Full", &c__1, &i__2, &c_b1, &c_b1, &a[ir + (jcr + 1) * + a_dim1], lda); + + i__2 = irows + 1; + cscal_(&i__2, &alpha, &a[ir + jcr * a_dim1], &c__1); + r_cnjg(&q__1, &alpha); + cscal_(n, &q__1, &a[jcr + a_dim1], lda); +/* L70: */ + } + } + +/* Scale the matrix to have norm ANORM */ + + if (*anorm >= 0.f) { + temp = clange_("M", n, n, &a[a_offset], lda, tempa); + if (temp > 0.f) { + ralpha = *anorm / temp; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + csscal_(n, &ralpha, &a[j * a_dim1 + 1], &c__1); +/* L80: */ + } + } + } + + return 0; + +/* End of CLATME */ + +} /* clatme_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatmr.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatmr.c new file mode 100644 index 0000000..c16c48e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatmr.c @@ -0,0 +1,1507 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__0 = 0; +static integer c__1 = 1; + +/* Subroutine */ int clatmr_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, complex *d, integer *mode, real *cond, complex * + dmax__, char *rsign, char *grade, complex *dl, integer *model, real * + condl, complex *dr, integer *moder, real *condr, char *pivtng, + integer *ipivot, integer *kl, integer *ku, real *sparse, real *anorm, + char *pack, complex *a, integer *lda, integer *iwork, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4; + real r__1, r__2; + doublereal d__1; + complex q__1, q__2; + + /* Builtin functions */ + double c_abs(complex *); + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer isub, jsub; + static real temp; + static integer isym, i, j, k, ipack; + extern logical lsame_(char *, char *); + static real tempa[1]; + static complex ctemp; + static integer iisub, idist, jjsub, mnmin; + static logical dzero; + static integer mnsub; + static real onorm; + static integer mxsub, npvts; + extern /* Subroutine */ int clatm1_(integer *, real *, integer *, integer + *, integer *, complex *, integer *, integer *); + extern /* Complex */ VOID clatm2_(complex *, integer *, integer *, + integer *, integer *, integer *, integer *, integer *, integer *, + complex *, integer *, complex *, complex *, integer *, integer *, + real *), clatm3_(complex *, integer *, integer *, integer *, + integer *, integer *, integer *, integer *, integer *, integer *, + integer *, complex *, integer *, complex *, complex *, integer *, + integer *, real *); + static complex calpha; + extern doublereal clangb_(char *, integer *, integer *, integer *, + complex *, integer *, real *), clange_(char *, integer *, + integer *, complex *, integer *, real *); + static integer igrade; + extern doublereal clansb_(char *, char *, integer *, integer *, complex *, + integer *, real *); + extern /* Subroutine */ int csscal_(integer *, real *, complex *, integer + *); + static logical fulbnd; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical badpvt; + extern doublereal clansp_(char *, char *, integer *, complex *, real *), clansy_(char *, char *, integer *, complex *, + integer *, real *); + static integer irsign, ipvtng, kll, kuu; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + CLATMR generates random matrices of various types for testing + LAPACK programs. + + CLATMR operates by applying the following sequence of + operations: + + Generate a matrix A with random entries of distribution DIST + which is symmetric if SYM='S', Hermitian if SYM='H', and + nonsymmetric if SYM='N'. + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX and RSIGN + as described below. + + Grade the matrix, if desired, from the left and/or right + as specified by GRADE. The inputs DL, MODEL, CONDL, DR, + MODER and CONDR also determine the grading as described + below. + + Permute, if desired, the rows and/or columns as specified by + PIVTNG and IPIVOT. + + Set random entries to zero, if desired, to get a random sparse + matrix as specified by SPARSE. + + Make A a band matrix, if desired, by zeroing out the matrix + outside a band of lower bandwidth KL and upper bandwidth KU. + + + Scale A, if desired, to have maximum entry ANORM. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric or Hermitian) + zero out lower half (if symmetric or Hermitian) + store the upper half columnwise (if symmetric or Hermitian + or square upper triangular) + store the lower half columnwise (if symmetric or Hermitian + or square lower triangular) + same as upper half rowwise if symmetric + same as conjugate upper half rowwise if Hermitian + store the lower triangle in banded format + (if symmetric or Hermitian) + store the upper triangle in banded format + (if symmetric or Hermitian) + store the entire matrix in banded format + + Note: If two calls to CLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + + If two calls to CLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be and + is not maintained with less than full bandwidth. + + Arguments + ========= + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate a random matrix . + 'U' => real and imaginary parts are independent + UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => real and imaginary parts are independent + UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => real and imaginary parts are independent + NORMAL( 0, 1 ) ( 'N' for normal ) + 'D' => uniform on interior of unit disk ( 'D' for disk ) + Not modified. + + ISEED - INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to CLATMR + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S', generated matrix is symmetric. + If SYM='H', generated matrix is Hermitian. + If SYM='N', generated matrix is nonsymmetric. + Not modified. + + D - COMPLEX array, dimension (min(M,N)) + On entry this array specifies the diagonal entries + of the diagonal of A. D may either be specified + on entry, or set according to MODE and COND as described + below. If the matrix is Hermitian, the real part of D + will be taken. May be changed on exit if MODE is nonzero. + + MODE - INTEGER + On entry describes how D is to be used: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - REAL + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - COMPLEX + If MODE neither -6, 0 nor 6, the diagonal is scaled by + DMAX / max(abs(D(i))), so that maximum absolute entry + of diagonal is abs(DMAX). If DMAX is complex (or zero), + diagonal will be scaled by a complex number (or zero). + + RSIGN - CHARACTER*1 + If MODE neither -6, 0 nor 6, specifies sign of diagonal + as follows: + 'T' => diagonal entries are multiplied by a random complex + number uniformly distributed with absolute value 1 + 'F' => diagonal unchanged + Not modified. + + GRADE - CHARACTER*1 + Specifies grading of matrix as follows: + 'N' => no grading + 'L' => matrix premultiplied by diag( DL ) + (only if matrix nonsymmetric) + 'R' => matrix postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'B' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'H' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + (only if matrix Hermitian or nonsymmetric) + 'S' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + (only if matrix symmetric or nonsymmetric) + 'E' => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + ( 'S' for similarity ) + (only if matrix nonsymmetric) + Note: if GRADE='S', then M must equal N. + Not modified. + + DL - COMPLEX array, dimension (M) + If MODEL=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODEL is not zero, then DL will be set according + to MODEL and CONDL, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DL). + + If GRADE='E', then DL cannot have zero entries. + Not referenced if GRADE = 'N' or 'R'. Changed on exit. + + MODEL - INTEGER + This specifies how the diagonal array DL is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDL - REAL + When MODEL is not zero, this specifies the condition number + + of the computed DL. Not modified. + + DR - COMPLEX array, dimension (N) + If MODER=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODER is not zero, then DR will be set according + to MODER and CONDR, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DR). + + Not referenced if GRADE = 'N', 'L', 'H' or 'S'. + Changed on exit. + + MODER - INTEGER + This specifies how the diagonal array DR is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDR - REAL + When MODER is not zero, this specifies the condition number + + of the computed DR. Not modified. + + PIVTNG - CHARACTER*1 + On entry specifies pivoting permutations as follows: + 'N' or ' ' => none. + 'L' => left or row pivoting (matrix must be nonsymmetric). + 'R' => right or column pivoting (matrix must be + nonsymmetric). + 'B' or 'F' => both or full pivoting, i.e., on both sides. + In this case, M must equal N + + If two calls to CLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be + maintained with less than full bandwidth. + + IPIVOT - INTEGER array, dimension (N or M) + This array specifies the permutation used. After the + basic matrix is generated, the rows, columns, or both + are permuted. If, say, row pivoting is selected, CLATMR + starts with the *last* row and interchanges the M-th and + IPIVOT(M)-th rows, then moves to the next-to-last row, + interchanging the (M-1)-th and the IPIVOT(M-1)-th rows, + and so on. In terms of "2-cycles", the permutation is + (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M)) + where the rightmost cycle is applied first. This is the + *inverse* of the effect of pivoting in LINPACK. The idea + is that factoring (with pivoting) an identity matrix + which has been inverse-pivoted in this way should + result in a pivot vector identical to IPIVOT. + Not referenced if PIVTNG = 'N'. Not modified. + + SPARSE - REAL + On entry specifies the sparsity of the matrix if a sparse + matrix is to be generated. SPARSE should lie between + 0 and 1. To generate a sparse matrix, for each matrix entry + + a uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + KL - INTEGER + On entry specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL at least M-1 implies the matrix is not + banded. Must equal KU if matrix is symmetric or Hermitian. + Not modified. + + KU - INTEGER + On entry specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU at least N-1 implies the matrix is not + banded. Must equal KL if matrix is symmetric or Hermitian. + Not modified. + + ANORM - REAL + On entry specifies maximum entry of output matrix + (output matrix will by multiplied by a constant so that + its largest absolute entry equal ANORM) + if ANORM is nonnegative. If ANORM is negative no scaling + is done. Not modified. + + PACK - CHARACTER*1 + On entry specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries + (if symmetric or Hermitian) + 'L' => zero out all superdiagonal entries + (if symmetric or Hermitian) + 'C' => store the upper triangle columnwise + (only if matrix symmetric or Hermitian or + square upper triangular) + 'R' => store the lower triangle columnwise + (only if matrix symmetric or Hermitian or + square lower triangular) + (same as upper half rowwise if symmetric) + (same as conjugate upper half rowwise if Hermitian) + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric or Hermitian) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric or Hermitian) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, HB or TB - use 'B' or 'Q' + PP, HP or TP - use 'C' or 'R' + + If two calls to CLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - COMPLEX array, dimension (LDA,N) + On exit A is the desired test matrix. Only those + entries of A which are significant on output + will be referenced (even if A is in packed or band + storage format). The 'unoccupied corners' of A in + band format will be zeroed out. + + LDA - INTEGER + on entry LDA specifies the first dimension of A as + declared in the calling program. + If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ). + + If PACK='C' or 'R', LDA must be at least 1. + If PACK='B', or 'Q', LDA must be MIN ( KU+1, N ) + If PACK='Z', LDA must be at least KUU+KLL+1, where + KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 ) + Not modified. + + IWORK - INTEGER array, dimension (N or M) + Workspace. Not referenced if PIVTNG = 'N'. Changed on exit. + + + INFO - INTEGER + Error parameter on exit: + 0 => normal return + -1 => M negative or unequal to N and SYM='S' or 'H' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string + -11 => GRADE illegal string, or GRADE='E' and + M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E' + + and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E' + and SYM = 'S' + -12 => GRADE = 'E' and DL contains zero + -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H', + + 'S' or 'E' + -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E', + + and MODEL neither -6, 0 nor 6 + -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B' + -17 => CONDR less than 1.0, GRADE='R' or 'B', and + MODER neither -6, 0 nor 6 + -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and + M not equal to N, or PIVTNG='L' or 'R' and SYM='S' + or 'H' + -19 => IPIVOT contains out of range number and + PIVTNG not equal to 'N' + -20 => KL negative + -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -22 => SPARSE not in range 0. to 1. + -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q' + and SYM='N', or PACK='C' and SYM='N' and either KL + not equal to 0 or N not equal to M, or PACK='R' and + SYM='N', and either KU not equal to 0 or N not equal + + to M + -26 => LDA too small + 1 => Error return from CLATM1 (computing D) + 2 => Cannot scale diagonal to DMAX (max. entry is 0) + 3 => Error return from CLATM1 (computing DL) + 4 => Error return from CLATM1 (computing DR) + 5 => ANORM is positive, but matrix constructed prior to + attempting to scale it to have norm ANORM, is zero + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --dl; + --dr; + --ipivot; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iwork; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else if (lsame_(dist, "D")) { + idist = 4; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "H")) { + isym = 0; + } else if (lsame_(sym, "N")) { + isym = 1; + } else if (lsame_(sym, "S")) { + isym = 2; + } else { + isym = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "F")) { + irsign = 0; + } else if (lsame_(rsign, "T")) { + irsign = 1; + } else { + irsign = -1; + } + +/* Decode PIVTNG */ + + if (lsame_(pivtng, "N")) { + ipvtng = 0; + } else if (lsame_(pivtng, " ")) { + ipvtng = 0; + } else if (lsame_(pivtng, "L")) { + ipvtng = 1; + npvts = *m; + } else if (lsame_(pivtng, "R")) { + ipvtng = 2; + npvts = *n; + } else if (lsame_(pivtng, "B")) { + ipvtng = 3; + npvts = min(*n,*m); + } else if (lsame_(pivtng, "F")) { + ipvtng = 3; + npvts = min(*n,*m); + } else { + ipvtng = -1; + } + +/* Decode GRADE */ + + if (lsame_(grade, "N")) { + igrade = 0; + } else if (lsame_(grade, "L")) { + igrade = 1; + } else if (lsame_(grade, "R")) { + igrade = 2; + } else if (lsame_(grade, "B")) { + igrade = 3; + } else if (lsame_(grade, "E")) { + igrade = 4; + } else if (lsame_(grade, "H")) { + igrade = 5; + } else if (lsame_(grade, "S")) { + igrade = 6; + } else { + igrade = -1; + } + +/* Decode PACK */ + + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + } else if (lsame_(pack, "C")) { + ipack = 3; + } else if (lsame_(pack, "R")) { + ipack = 4; + } else if (lsame_(pack, "B")) { + ipack = 5; + } else if (lsame_(pack, "Q")) { + ipack = 6; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + kll = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + kuu = min(i__1,i__2); + +/* If inv(DL) is used, check to see if DL has a zero entry. */ + + dzero = FALSE_; + if (igrade == 4 && *model == 0) { + i__1 = *m; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + if (dl[i__2].r == 0.f && dl[i__2].i == 0.f) { + dzero = TRUE_; + } +/* L10: */ + } + } + +/* Check values in IPIVOT */ + + badpvt = FALSE_; + if (ipvtng > 0) { + i__1 = npvts; + for (j = 1; j <= i__1; ++j) { + if (ipivot[j] <= 0 || ipivot[j] > npvts) { + badpvt = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && (isym == 0 || isym == 2)) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (*mode < -6 || *mode > 6) { + *info = -7; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.f) { + *info = -8; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && irsign == -1) { + *info = -10; + } else if (igrade == -1 || igrade == 4 && *m != *n || (igrade == 1 || + igrade == 2 || igrade == 3 || igrade == 4 || igrade == 6) && isym + == 0 || (igrade == 1 || igrade == 2 || igrade == 3 || igrade == 4 + || igrade == 5) && isym == 2) { + *info = -11; + } else if (igrade == 4 && dzero) { + *info = -12; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || + igrade == 6) && (*model < -6 || *model > 6)) { + *info = -13; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || + igrade == 6) && (*model != -6 && *model != 0 && *model != 6) && * + condl < 1.f) { + *info = -14; + } else if ((igrade == 2 || igrade == 3) && (*moder < -6 || *moder > 6)) { + *info = -16; + } else if ((igrade == 2 || igrade == 3) && (*moder != -6 && *moder != 0 && + *moder != 6) && *condr < 1.f) { + *info = -17; + } else if (ipvtng == -1 || ipvtng == 3 && *m != *n || (ipvtng == 1 || + ipvtng == 2) && (isym == 0 || isym == 2)) { + *info = -18; + } else if (ipvtng != 0 && badpvt) { + *info = -19; + } else if (*kl < 0) { + *info = -20; + } else if (*ku < 0 || (isym == 0 || isym == 2) && *kl != *ku) { + *info = -21; + } else if (*sparse < 0.f || *sparse > 1.f) { + *info = -22; + } else if (ipack == -1 || (ipack == 1 || ipack == 2 || ipack == 5 || + ipack == 6) && isym == 1 || ipack == 3 && isym == 1 && (*kl != 0 + || *m != *n) || ipack == 4 && isym == 1 && (*ku != 0 || *m != *n)) + { + *info = -24; + } else if ((ipack == 0 || ipack == 1 || ipack == 2) && *lda < max(1,*m) || + (ipack == 3 || ipack == 4) && *lda < 1 || (ipack == 5 || ipack == + 6) && *lda < kuu + 1 || ipack == 7 && *lda < kll + kuu + 1) { + *info = -26; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("CLATMR", &i__1); + return 0; + } + +/* Decide if we can pivot consistently */ + + fulbnd = FALSE_; + if (kuu == *n - 1 && kll == *m - 1) { + fulbnd = TRUE_; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + iseed[4] = (iseed[4] / 2 << 1) + 1; + +/* 2) Set up D, DL, and DR, if indicated. + + Compute D according to COND and MODE */ + + clatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, info); + if (*info != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && *mode != -6 && *mode != 6) { + +/* Scale by DMAX */ + + temp = c_abs(&d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__1 = temp, r__2 = c_abs(&d[i]); + temp = dmax(r__1,r__2); +/* L40: */ + } + if (temp == 0.f && (dmax__->r != 0.f || dmax__->i != 0.f)) { + *info = 2; + return 0; + } + if (temp != 0.f) { + q__1.r = dmax__->r / temp, q__1.i = dmax__->i / temp; + calpha.r = q__1.r, calpha.i = q__1.i; + } else { + calpha.r = 1.f, calpha.i = 0.f; + } + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + i__3 = i; + q__1.r = calpha.r * d[i__3].r - calpha.i * d[i__3].i, q__1.i = + calpha.r * d[i__3].i + calpha.i * d[i__3].r; + d[i__2].r = q__1.r, d[i__2].i = q__1.i; +/* L50: */ + } + + } + +/* If matrix Hermitian, make D real */ + + if (isym == 0) { + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + i__3 = i; + d__1 = d[i__3].r; + d[i__2].r = d__1, d[i__2].i = 0.f; +/* L60: */ + } + } + +/* Compute DL if grading set */ + + if (igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || igrade == + 6) { + clatm1_(model, condl, &c__0, &idist, &iseed[1], &dl[1], m, info); + if (*info != 0) { + *info = 3; + return 0; + } + } + +/* Compute DR if grading set */ + + if (igrade == 2 || igrade == 3) { + clatm1_(moder, condr, &c__0, &idist, &iseed[1], &dr[1], n, info); + if (*info != 0) { + *info = 4; + return 0; + } + } + +/* 3) Generate IWORK if pivoting */ + + if (ipvtng > 0) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + iwork[i] = i; +/* L70: */ + } + if (fulbnd) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L80: */ + } + } else { + for (i = npvts; i >= 1; --i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L90: */ + } + } + } + +/* 4) Generate matrices for each kind of PACKing + Always sweep matrix columnwise (if symmetric, upper + half only) so that matrix generated does not depend + on PACK */ + + if (fulbnd) { + +/* Use CLATM3 so matrices generated with differing PIVOTing onl +y + differ only in the order of their rows and/or columns. */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + i__3 = jsub + isub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L100: */ + } +/* L110: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L120: */ + } +/* L130: */ + } + } else if (isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + i__3 = jsub + isub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L140: */ + } +/* L150: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == isub && isym == 0) { + i__3 = mnsub + mxsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mnsub + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (mnsub != mxsub) { + i__3 = mxsub + mnsub * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } +/* L160: */ + } +/* L170: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == jsub && isym == 0) { + i__3 = mxsub + mnsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mxsub + mnsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (mnsub != mxsub) { + i__3 = mnsub + mxsub * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } +/* L180: */ + } +/* L190: */ + } + + } else if (ipack == 3) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + +/* Compute K = location of (ISUB,JSUB) ent +ry in packed + array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + k = mxsub * (mxsub - 1) / 2 + mnsub; + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + if (mxsub == isub && isym == 0) { + i__3 = iisub + jjsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = iisub + jjsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L200: */ + } +/* L210: */ + } + + } else if (ipack == 4) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + +/* Compute K = location of (I,J) entry in +packed array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mnsub == 1) { + k = mxsub; + } else { + k = *n * (*n + 1) / 2 - (*n - mnsub + 1) * (*n - + mnsub + 2) / 2 + mxsub - mnsub + 1; + } + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + if (mxsub == jsub && isym == 0) { + i__3 = iisub + jjsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = iisub + jjsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L220: */ + } +/* L230: */ + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + i__3 = j - i + 1 + (i + *n) * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } else { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == jsub && isym == 0) { + i__3 = mxsub - mnsub + 1 + mnsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mxsub - mnsub + 1 + mnsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + } +/* L240: */ + } +/* L250: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == isub && isym == 0) { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L260: */ + } +/* L270: */ + } + + } else if (ipack == 7) { + + if (isym != 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (i < 1) { + i__3 = j - i + 1 + kuu + (i + *n) * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } + if (mxsub == isub && isym == 0) { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (i >= 1 && mnsub != mxsub) { + if (mnsub == isub && isym == 0) { + i__3 = mxsub - mnsub + 1 + kuu + mnsub * + a_dim1; + r_cnjg(&q__1, &ctemp); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = mxsub - mnsub + 1 + kuu + mnsub * + a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + } +/* L280: */ + } +/* L290: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + clatm3_(&q__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = q__1.r, ctemp.i = q__1.i; + i__3 = isub - jsub + kuu + 1 + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L300: */ + } +/* L310: */ + } + } + + } + + } else { + +/* Use CLATM2 */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + i__3 = j + i * a_dim1; + r_cnjg(&q__1, &a[i + j * a_dim1]); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L320: */ + } +/* L330: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L340: */ + } +/* L350: */ + } + } else if (isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + i__3 = j + i * a_dim1; + i__4 = i + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; +/* L360: */ + } +/* L370: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + if (i != j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } +/* L380: */ + } +/* L390: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + if (isym == 0) { + i__3 = j + i * a_dim1; + clatm2_(&q__2, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + r_cnjg(&q__1, &q__2); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = j + i * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } + if (i != j) { + i__3 = i + j * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } +/* L400: */ + } +/* L410: */ + } + + } else if (ipack == 3) { + + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + i__3 = isub + jsub * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L420: */ + } +/* L430: */ + } + + } else if (ipack == 4) { + + if (isym == 0 || isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + +/* Compute K = location of (I,J) en +try in packed array */ + + if (i == 1) { + k = j; + } else { + k = *n * (*n + 1) / 2 - (*n - i + 1) * (*n - i + + 2) / 2 + j - i + 1; + } + +/* Convert K to (ISUB,JSUB) locatio +n */ + + jsub = (k - 1) / *lda + 1; + isub = k - *lda * (jsub - 1); + + i__3 = isub + jsub * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + if (isym == 0) { + i__3 = isub + jsub * a_dim1; + r_cnjg(&q__1, &a[isub + jsub * a_dim1]); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } +/* L440: */ + } +/* L450: */ + } + } else { + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + i__3 = isub + jsub * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L460: */ + } +/* L470: */ + } + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + i__3 = j - i + 1 + (i + *n) * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } else { + if (isym == 0) { + i__3 = j - i + 1 + i * a_dim1; + clatm2_(&q__2, m, n, &i, &j, kl, ku, &idist, & + iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); + r_cnjg(&q__1, &q__2); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = j - i + 1 + i * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, & + iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } + } +/* L480: */ + } +/* L490: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L500: */ + } +/* L510: */ + } + + } else if (ipack == 7) { + + if (isym != 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + if (i < 1) { + i__3 = j - i + 1 + kuu + (i + *n) * a_dim1; + a[i__3].r = 0.f, a[i__3].i = 0.f; + } + if (i >= 1 && i != j) { + if (isym == 0) { + i__3 = j - i + 1 + kuu + i * a_dim1; + r_cnjg(&q__1, &a[i - j + kuu + 1 + j * a_dim1] + ); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; + } else { + i__3 = j - i + 1 + kuu + i * a_dim1; + i__4 = i - j + kuu + 1 + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; + } + } +/* L520: */ + } +/* L530: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + clatm2_(&q__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = q__1.r, a[i__3].i = q__1.i; +/* L540: */ + } +/* L550: */ + } + } + + } + + } + +/* 5) Scaling the norm */ + + if (ipack == 0) { + onorm = clange_("M", m, n, &a[a_offset], lda, tempa); + } else if (ipack == 1) { + onorm = clansy_("M", "U", n, &a[a_offset], lda, tempa); + } else if (ipack == 2) { + onorm = clansy_("M", "L", n, &a[a_offset], lda, tempa); + } else if (ipack == 3) { + onorm = clansp_("M", "U", n, &a[a_offset], tempa); + } else if (ipack == 4) { + onorm = clansp_("M", "L", n, &a[a_offset], tempa); + } else if (ipack == 5) { + onorm = clansb_("M", "L", n, &kll, &a[a_offset], lda, tempa); + } else if (ipack == 6) { + onorm = clansb_("M", "U", n, &kuu, &a[a_offset], lda, tempa); + } else if (ipack == 7) { + onorm = clangb_("M", n, &kll, &kuu, &a[a_offset], lda, tempa); + } + + if (*anorm >= 0.f) { + + if (*anorm > 0.f && onorm == 0.f) { + +/* Desired scaling impossible */ + + *info = 5; + return 0; + + } else if (*anorm > 1.f && onorm < 1.f || *anorm < 1.f && onorm > 1.f) + { + +/* Scale carefully to avoid over / underflow */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + r__1 = 1.f / onorm; + csscal_(m, &r__1, &a[j * a_dim1 + 1], &c__1); + csscal_(m, anorm, &a[j * a_dim1 + 1], &c__1); +/* L560: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + r__1 = 1.f / onorm; + csscal_(&i__1, &r__1, &a[a_offset], &c__1); + i__1 = *n * (*n + 1) / 2; + csscal_(&i__1, anorm, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + r__1 = 1.f / onorm; + csscal_(&i__2, &r__1, &a[j * a_dim1 + 1], &c__1); + i__2 = kll + kuu + 1; + csscal_(&i__2, anorm, &a[j * a_dim1 + 1], &c__1); +/* L570: */ + } + + } + + } else { + +/* Scale straightforwardly */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + r__1 = *anorm / onorm; + csscal_(m, &r__1, &a[j * a_dim1 + 1], &c__1); +/* L580: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + r__1 = *anorm / onorm; + csscal_(&i__1, &r__1, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + r__1 = *anorm / onorm; + csscal_(&i__2, &r__1, &a[j * a_dim1 + 1], &c__1); +/* L590: */ + } + } + + } + + } + +/* End of CLATMR */ + + return 0; +} /* clatmr_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatms.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatms.c new file mode 100644 index 0000000..bb5462a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/clatms.c @@ -0,0 +1,1650 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static complex c_b1 = {0.f,0.f}; +static integer c__1 = 1; +static integer c__5 = 5; +static logical c_true = TRUE_; +static logical c_false = FALSE_; + +/* Subroutine */ int clatms_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, real *d, integer *mode, real *cond, real *dmax__, + integer *kl, integer *ku, char *pack, complex *a, integer *lda, + complex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + real r__1, r__2, r__3; + doublereal d__1; + complex q__1, q__2, q__3; + logical L__1; + + /* Builtin functions */ + double cos(doublereal), sin(doublereal); + void r_cnjg(complex *, complex *); + + /* Local variables */ + static integer ilda, icol; + static real temp; + static logical csym; + static integer irow, isym; + static complex c; + static integer i, j, k; + static complex s; + static real alpha, angle; + static integer ipack; + static real realc; + static integer ioffg; + extern logical lsame_(char *, char *); + static integer iinfo; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *); + static complex ctemp; + static integer idist, mnmin, iskew; + static complex extra, dummy; + extern /* Subroutine */ int slatm1_(integer *, real *, integer *, integer + *, integer *, real *, integer *, integer *); + static integer ic, jc, nc; + extern /* Subroutine */ int clagge_(integer *, integer *, integer *, + integer *, real *, complex *, integer *, integer *, complex *, + integer *), claghe_(integer *, integer *, real *, complex *, + integer *, integer *, complex *, integer *); + static integer il; + static complex ct; + static integer iendch, ir, jr, ipackg, mr; + extern /* Complex */ VOID clarnd_(complex *, integer *, integer *); + static integer minlda; + static complex st; + extern /* Subroutine */ int claset_(char *, integer *, integer *, complex + *, complex *, complex *, integer *), clartg_(complex *, + complex *, real *, complex *, complex *), xerbla_(char *, integer + *), clagsy_(integer *, integer *, real *, complex *, + integer *, integer *, complex *, integer *); + extern doublereal slarnd_(integer *, integer *); + extern /* Subroutine */ int clarot_(logical *, logical *, logical *, + integer *, complex *, complex *, complex *, integer *, complex *, + complex *); + static logical iltemp, givens; + static integer ioffst, irsign; + static logical ilextr, topdwn; + static integer ir1, ir2, isympk, jch, llb, jkl, jku, uub; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + CLATMS generates random matrices with specified singular values + (or hermitian with specified eigenvalues) + for testing LAPACK programs. + + CLATMS operates by applying the following sequence of + operations: + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and SYM + as described below. + + Generate a matrix with the appropriate band structure, by one + of two methods: + + Method A: + Generate a dense M x N matrix by multiplying D on the left + and the right by random unitary matrices, then: + + Reduce the bandwidth according to KL and KU, using + Householder transformations. + + Method B: + Convert the bandwidth-0 (i.e., diagonal) matrix to a + bandwidth-1 matrix using Givens rotations, "chasing" + out-of-band elements back, much as in QR; then convert + the bandwidth-1 to a bandwidth-2 matrix, etc. Note + that for reasonably small bandwidths (relative to M and + + N) this requires less storage, as a dense matrix is not + + generated. Also, for hermitian or symmetric matrices, + only one triangle is generated. + + Method A is chosen if the bandwidth is a large fraction of the + order of the matrix, and LDA is at least M (so a dense + matrix can be stored.) Method B is chosen if the bandwidth + + is small (< 1/2 N for hermitian or symmetric, < .3 N+M for + non-symmetric), or LDA is less than M and not less than the + + bandwidth. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if hermitian) + zero out lower half (if hermitian) + store the upper half columnwise (if hermitian or upper + triangular) + store the lower half columnwise (if hermitian or lower + triangular) + store the lower triangle in banded format (if hermitian or + lower triangular) + store the upper triangle in banded format (if hermitian or + upper triangular) + store the entire matrix in banded format + If Method B is chosen, and band format is specified, then the + matrix will be generated in the band format, so no repacking + + will be necessary. + + Arguments + ========= + + M - INTEGER + The number of rows of A. Not modified. + + N - INTEGER + The number of columns of A. N must equal M if the matrix + is symmetric or hermitian (i.e., if SYM is not 'N') + Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values. + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to CLATMS + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='H', the generated matrix is hermitian, with + eigenvalues specified by D, COND, MODE, and DMAX; they + may be positive, negative, or zero. + If SYM='P', the generated matrix is hermitian, with + eigenvalues (= singular values) specified by D, COND, + MODE, and DMAX; they will not be negative. + If SYM='N', the generated matrix is nonsymmetric, with + singular values specified by D, COND, MODE, and DMAX; + they will not be negative. + If SYM='S', the generated matrix is (complex) symmetric, + with singular values specified by D, COND, MODE, and + DMAX; they will not be negative. + Not modified. + + D - REAL array, dimension ( MIN( M, N ) ) + This array is used to specify the singular values or + eigenvalues of A (see SYM, above.) If MODE=0, then D is + assumed to contain the singular/eigenvalues, otherwise + they will be computed according to MODE, COND, and DMAX, + and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the singular/eigenvalues are to + + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + If SYM='H', and MODE is neither 0, 6, nor -6, then + the elements of D will also be multiplied by a random + sign (i.e., +1 or -1.) + Not modified. + + COND - REAL + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - REAL + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or + + singular value (which is to say the norm) will be abs(DMAX). + + Note that DMAX need not be positive: if DMAX is negative + (or zero), D will be scaled by a negative number (or zero). + + Not modified. + + KL - INTEGER + This specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL being at least M-1 means that the matrix + + has full lower bandwidth. KL must equal KU if the matrix + is symmetric or hermitian. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU being at least N-1 means that the matrix + + has full upper bandwidth. KL must equal KU if the matrix + is symmetric or hermitian. + Not modified. + + PACK - CHARACTER*1 + This specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric + or hermitian) + 'L' => zero out all superdiagonal entries (if symmetric + or hermitian) + 'C' => store the upper triangle columnwise (only if the + matrix is symmetric, hermitian, or upper triangular) + + 'R' => store the lower triangle columnwise (only if the + matrix is symmetric, hermitian, or lower triangular) + + 'B' => store the lower triangle in band storage scheme + (only if the matrix is symmetric, hermitian, or + lower triangular) + 'Q' => store the upper triangle in band storage scheme + (only if the matrix is symmetric, hermitian, or + upper triangular) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB, HB, or TB - use 'B' or 'Q' + PP, SP, HB, or TP - use 'C' or 'R' + + If two calls to CLATMS differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - COMPLEX array, dimension ( LDA, N ) + On exit A is the desired test matrix. A is first generated + + in full (unpacked) form, and then packed, if so specified + by PACK. Thus, the first M elements of the first N + columns will always be modified. If PACK specifies a + packed or banded storage scheme, all LDA elements of the + first N columns will be modified; the elements of the + array which do not correspond to elements of the generated + matrix are set to zero. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. If PACK='N', 'U', 'L', 'C', or 'R', then + LDA must be at least M. If PACK='B' or 'Q', then LDA must + be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)). + If PACK='Z', LDA must be large enough to hold the packed + array: MIN( KU, N-1) + MIN( KL, M-1) + 1. + Not modified. + + WORK - COMPLEX array, dimension ( 3*MAX( N, M ) ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => M negative or unequal to N and SYM='S', 'H', or 'P' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => KL negative + -11 => KU negative, or SYM is not 'N' and KU is not equal to + + KL + -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N'; + + or PACK='C' or 'Q' and SYM='N' and KL is not zero; + or PACK='R' or 'B' and SYM='N' and KU is not zero; + or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not + + N. + -14 => LDA is less than M, or PACK='Z' and LDA is less than + + MIN(KU,N-1) + MIN(KL,M-1) + 1. + 1 => Error return from SLATM1 + 2 => Cannot scale to DMAX (max. sing. value is 0) + 3 => Error return from CLAGGE, CLAGHE or CLAGSY + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "N")) { + isym = 1; + irsign = 0; + csym = FALSE_; + } else if (lsame_(sym, "P")) { + isym = 2; + irsign = 0; + csym = FALSE_; + } else if (lsame_(sym, "S")) { + isym = 2; + irsign = 0; + csym = TRUE_; + } else if (lsame_(sym, "H")) { + isym = 2; + irsign = 1; + csym = FALSE_; + } else { + isym = -1; + } + +/* Decode PACK */ + + isympk = 0; + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + isympk = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + isympk = 1; + } else if (lsame_(pack, "C")) { + ipack = 3; + isympk = 2; + } else if (lsame_(pack, "R")) { + ipack = 4; + isympk = 3; + } else if (lsame_(pack, "B")) { + ipack = 5; + isympk = 3; + } else if (lsame_(pack, "Q")) { + ipack = 6; + isympk = 2; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + llb = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + uub = min(i__1,i__2); +/* Computing MIN */ + i__1 = *m, i__2 = *n + llb; + mr = min(i__1,i__2); +/* Computing MIN */ + i__1 = *n, i__2 = *m + uub; + nc = min(i__1,i__2); + + if (ipack == 5 || ipack == 6) { + minlda = uub + 1; + } else if (ipack == 7) { + minlda = llb + uub + 1; + } else { + minlda = *m; + } + +/* Use Givens rotation method if bandwidth small enough, + or if LDA is too small to store the matrix unpacked. */ + + givens = FALSE_; + if (isym == 1) { +/* Computing MAX */ + i__1 = 1, i__2 = mr + nc; + if ((real) (llb + uub) < (real) max(i__1,i__2) * .3f) { + givens = TRUE_; + } + } else { + if (llb << 1 < *m) { + givens = TRUE_; + } + } + if (*lda < *m && *lda >= minlda) { + givens = TRUE_; + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym != 1) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (abs(*mode) > 6) { + *info = -7; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.f) { + *info = -8; + } else if (*kl < 0) { + *info = -10; + } else if (*ku < 0 || isym != 1 && *kl != *ku) { + *info = -11; + } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym + == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk + != 0 && *m != *n) { + *info = -12; + } else if (*lda < max(1,minlda)) { + *info = -14; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("CLATMS", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L10: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up D if indicated. + + Compute D according to COND and MODE */ + + slatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + +/* Choose Top-Down if D is (apparently) increasing, + Bottom-Up if D is (apparently) decreasing. */ + + if (dabs(d[1]) <= (r__1 = d[mnmin], dabs(r__1))) { + topdwn = TRUE_; + } else { + topdwn = FALSE_; + } + + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = dabs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__2 = temp, r__3 = (r__1 = d[i], dabs(r__1)); + temp = dmax(r__2,r__3); +/* L20: */ + } + + if (temp > 0.f) { + alpha = *dmax__ / temp; + } else { + *info = 2; + return 0; + } + + sscal_(&mnmin, &alpha, &d[1], &c__1); + + } + + claset_("Full", lda, n, &c_b1, &c_b1, &a[a_offset], lda); + +/* 3) Generate Banded Matrix using Givens rotations. + Also the special case of UUB=LLB=0 + + Compute Addressing constants to cover all + storage formats. Whether GE, HE, SY, GB, HB, or SB, + upper or lower triangle or both, + the (i,j)-th element is in + A( i - ISKEW*j + IOFFST, j ) */ + + if (ipack > 4) { + ilda = *lda - 1; + iskew = 1; + if (ipack > 5) { + ioffst = uub + 1; + } else { + ioffst = 1; + } + } else { + ilda = *lda; + iskew = 0; + ioffst = 0; + } + +/* IPACKG is the format that the matrix is generated in. If this is + different from IPACK, then the matrix must be repacked at the + end. It also signals how to compute the norm, for scaling. */ + + ipackg = 0; + +/* Diagonal Matrix -- We are done, unless it + is to be stored HP/SP/PP/TP (PACK='R' or 'C') */ + + if (llb == 0 && uub == 0) { + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__2 = (1 - iskew) * j + ioffst + j * a_dim1; + i__3 = j; + q__1.r = d[i__3], q__1.i = 0.f; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; +/* L30: */ + } + + if (ipack <= 2 || ipack >= 5) { + ipackg = ipack; + } + + } else if (givens) { + +/* Check whether to use Givens rotations, + Householder transformations, or nothing. */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + if (ipack > 4) { + ipackg = ipack; + } else { + ipackg = 0; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__2 = (1 - iskew) * j + ioffst + j * a_dim1; + i__3 = j; + q__1.r = d[i__3], q__1.i = 0.f; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; +/* L40: */ + } + + if (topdwn) { + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + Last row actually rotated is M + Last column actually rotated is MIN( M+ +JKU, N ) + + Computing MIN */ + i__3 = *m + jku; + i__2 = min(i__3,*n) + jkl - 1; + for (jr = 1; jr <= i__2; ++jr) { + extra.r = 0.f, extra.i = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; +/* Computing MAX */ + i__3 = 1, i__4 = jr - jkl; + icol = max(i__3,i__4); + if (jr < *m) { +/* Computing MIN */ + i__3 = *n, i__4 = jr + jku; + il = min(i__3,i__4) + 1 - icol; + L__1 = jr > jkl; + clarot_(&c_true, &L__1, &c_false, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ir = jr; + ic = icol; + i__3 = -jkl - jku; + for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ir < *m) { + clartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &realc, + &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__2.r = realc * dummy.r, q__2.i = realc * + dummy.i; + r_cnjg(&q__1, &q__2); + c.r = q__1.r, c.i = q__1.i; + q__3.r = -(doublereal)s.r, q__3.i = -( + doublereal)s.i; + q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, + q__2.i = q__3.r * dummy.i + q__3.i * + dummy.r; + r_cnjg(&q__1, &q__2); + s.r = q__1.r, s.i = q__1.i; + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + ctemp.r = 0.f, ctemp.i = 0.f; + iltemp = jch > jku; + clarot_(&c_false, &iltemp, &c_true, &il, &c, &s, & + a[irow - iskew * ic + ioffst + ic * + a_dim1], &ilda, &ctemp, &extra); + if (iltemp) { + clartg_(&a[irow + 1 - iskew * (ic + 1) + + ioffst + (ic + 1) * a_dim1], &ctemp, & + realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__2.r = realc * dummy.r, q__2.i = realc * + dummy.i; + r_cnjg(&q__1, &q__2); + c.r = q__1.r, c.i = q__1.i; + q__3.r = -(doublereal)s.r, q__3.i = -( + doublereal)s.i; + q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, + q__2.i = q__3.r * dummy.i + q__3.i * + dummy.r; + r_cnjg(&q__1, &q__2); + s.r = q__1.r, s.i = q__1.i; + +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + extra.r = 0.f, extra.i = 0.f; + L__1 = jch > jku + jkl; + clarot_(&c_true, &L__1, &c_true, &il, &c, &s, + &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, &ctemp) + ; + ic = icol; + ir = irow; + } +/* L50: */ + } +/* L60: */ + } +/* L70: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + Computing MIN */ + i__3 = *n + jkl; + i__2 = min(i__3,*m) + jku - 1; + for (jc = 1; jc <= i__2; ++jc) { + extra.r = 0.f, extra.i = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; +/* Computing MAX */ + i__3 = 1, i__4 = jc - jku; + irow = max(i__3,i__4); + if (jc < *n) { +/* Computing MIN */ + i__3 = *m, i__4 = jc + jkl; + il = min(i__3,i__4) + 1 - irow; + L__1 = jc > jku; + clarot_(&c_false, &L__1, &c_false, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ic = jc; + ir = irow; + i__3 = -jkl - jku; + for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ic < *n) { + clartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &realc, + &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__2.r = realc * dummy.r, q__2.i = realc * + dummy.i; + r_cnjg(&q__1, &q__2); + c.r = q__1.r, c.i = q__1.i; + q__3.r = -(doublereal)s.r, q__3.i = -( + doublereal)s.i; + q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, + q__2.i = q__3.r * dummy.i + q__3.i * + dummy.r; + r_cnjg(&q__1, &q__2); + s.r = q__1.r, s.i = q__1.i; + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + ctemp.r = 0.f, ctemp.i = 0.f; + iltemp = jch > jkl; + clarot_(&c_true, &iltemp, &c_true, &il, &c, &s, & + a[ir - iskew * icol + ioffst + icol * + a_dim1], &ilda, &ctemp, &extra); + if (iltemp) { + clartg_(&a[ir + 1 - iskew * (icol + 1) + + ioffst + (icol + 1) * a_dim1], &ctemp, + &realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__2.r = realc * dummy.r, q__2.i = realc * + dummy.i; + r_cnjg(&q__1, &q__2); + c.r = q__1.r, c.i = q__1.i; + q__3.r = -(doublereal)s.r, q__3.i = -( + doublereal)s.i; + q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, + q__2.i = q__3.r * dummy.i + q__3.i * + dummy.r; + r_cnjg(&q__1, &q__2); + s.r = q__1.r, s.i = q__1.i; +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + extra.r = 0.f, extra.i = 0.f; + L__1 = jch > jkl + jku; + clarot_(&c_false, &L__1, &c_true, &il, &c, &s, + &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, &ctemp) + ; + ic = icol; + ir = irow; + } +/* L80: */ + } +/* L90: */ + } +/* L100: */ + } + + } else { + +/* Bottom-Up -- Start at the bottom right. */ + + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + First row actually rotated is M + First column actually rotated is MIN( M ++JKU, N ) + + Computing MIN */ + i__2 = *m, i__3 = *n + jkl; + iendch = min(i__2,i__3) - 1; +/* Computing MIN */ + i__2 = *m + jku; + i__3 = 1 - jkl; + for (jc = min(i__2,*n) - 1; jc >= i__3; --jc) { + extra.r = 0.f, extra.i = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; +/* Computing MAX */ + i__2 = 1, i__4 = jc - jku + 1; + irow = max(i__2,i__4); + if (jc > 0) { +/* Computing MIN */ + i__2 = *m, i__4 = jc + jkl + 1; + il = min(i__2,i__4) + 1 - irow; + L__1 = jc + jkl < *m; + clarot_(&c_false, &c_false, &L__1, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ic = jc; + i__2 = iendch; + i__4 = jkl + jku; + for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <= + i__2; jch += i__4) { + ilextr = ic > 0; + if (ilextr) { + clartg_(&a[jch - iskew * ic + ioffst + ic * + a_dim1], &extra, &realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__1.r = realc * dummy.r, q__1.i = realc * + dummy.i; + c.r = q__1.r, c.i = q__1.i; + q__1.r = s.r * dummy.r - s.i * dummy.i, + q__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = q__1.r, s.i = q__1.i; + } + ic = max(1,ic); +/* Computing MIN */ + i__5 = *n - 1, i__6 = jch + jku; + icol = min(i__5,i__6); + iltemp = jch + jku < *n; + ctemp.r = 0.f, ctemp.i = 0.f; + i__5 = icol + 2 - ic; + clarot_(&c_true, &ilextr, &iltemp, &i__5, &c, &s, + &a[jch - iskew * ic + ioffst + ic * + a_dim1], &ilda, &extra, &ctemp); + if (iltemp) { + clartg_(&a[jch - iskew * icol + ioffst + icol + * a_dim1], &ctemp, &realc, &s, &dummy) + ; + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__1.r = realc * dummy.r, q__1.i = realc * + dummy.i; + c.r = q__1.r, c.i = q__1.i; + q__1.r = s.r * dummy.r - s.i * dummy.i, + q__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = q__1.r, s.i = q__1.i; +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra.r = 0.f, extra.i = 0.f; + L__1 = jch + jkl + jku <= iendch; + clarot_(&c_false, &c_true, &L__1, &il, &c, &s, + &a[jch - iskew * icol + ioffst + + icol * a_dim1], &ilda, &ctemp, &extra) + ; + ic = icol; + } +/* L110: */ + } +/* L120: */ + } +/* L130: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + First row actually rotated is MIN( N+JK +L, M ) + First column actually rotated is N + + Computing MIN */ + i__3 = *n, i__4 = *m + jku; + iendch = min(i__3,i__4) - 1; +/* Computing MIN */ + i__3 = *n + jkl; + i__4 = 1 - jku; + for (jr = min(i__3,*m) - 1; jr >= i__4; --jr) { + extra.r = 0.f, extra.i = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; +/* Computing MAX */ + i__3 = 1, i__2 = jr - jkl + 1; + icol = max(i__3,i__2); + if (jr > 0) { +/* Computing MIN */ + i__3 = *n, i__2 = jr + jku + 1; + il = min(i__3,i__2) + 1 - icol; + L__1 = jr + jku < *n; + clarot_(&c_true, &c_false, &L__1, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ir = jr; + i__3 = iendch; + i__2 = jkl + jku; + for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <= + i__3; jch += i__2) { + ilextr = ir > 0; + if (ilextr) { + clartg_(&a[ir - iskew * jch + ioffst + jch * + a_dim1], &extra, &realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__1.r = realc * dummy.r, q__1.i = realc * + dummy.i; + c.r = q__1.r, c.i = q__1.i; + q__1.r = s.r * dummy.r - s.i * dummy.i, + q__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = q__1.r, s.i = q__1.i; + } + ir = max(1,ir); +/* Computing MIN */ + i__5 = *m - 1, i__6 = jch + jkl; + irow = min(i__5,i__6); + iltemp = jch + jkl < *m; + ctemp.r = 0.f, ctemp.i = 0.f; + i__5 = irow + 2 - ir; + clarot_(&c_false, &ilextr, &iltemp, &i__5, &c, &s, + &a[ir - iskew * jch + ioffst + jch * + a_dim1], &ilda, &extra, &ctemp); + if (iltemp) { + clartg_(&a[irow - iskew * jch + ioffst + jch * + a_dim1], &ctemp, &realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__1.r = realc * dummy.r, q__1.i = realc * + dummy.i; + c.r = q__1.r, c.i = q__1.i; + q__1.r = s.r * dummy.r - s.i * dummy.i, + q__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = q__1.r, s.i = q__1.i; +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra.r = 0.f, extra.i = 0.f; + L__1 = jch + jkl + jku <= iendch; + clarot_(&c_true, &c_true, &L__1, &il, &c, &s, + &a[irow - iskew * jch + ioffst + jch * + a_dim1], &ilda, &ctemp, &extra); + ir = irow; + } +/* L140: */ + } +/* L150: */ + } +/* L160: */ + } + + } + + } else { + +/* Symmetric -- A = U D U' + Hermitian -- A = U D U* */ + + ipackg = ipack; + ioffg = ioffst; + + if (topdwn) { + +/* Top-Down -- Generate Upper triangle only */ + + if (ipack >= 5) { + ipackg = 6; + ioffg = uub + 1; + } else { + ipackg = 1; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__4 = (1 - iskew) * j + ioffg + j * a_dim1; + i__2 = j; + q__1.r = d[i__2], q__1.i = 0.f; + a[i__4].r = q__1.r, a[i__4].i = q__1.i; +/* L170: */ + } + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + i__4 = *n - 1; + for (jc = 1; jc <= i__4; ++jc) { +/* Computing MAX */ + i__2 = 1, i__3 = jc - k; + irow = max(i__2,i__3); +/* Computing MIN */ + i__2 = jc + 1, i__3 = k + 2; + il = min(i__2,i__3); + extra.r = 0.f, extra.i = 0.f; + i__2 = jc - iskew * (jc + 1) + ioffg + (jc + 1) * + a_dim1; + ctemp.r = a[i__2].r, ctemp.i = a[i__2].i; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; + if (csym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + r_cnjg(&q__1, &ctemp); + ctemp.r = q__1.r, ctemp.i = q__1.i; + r_cnjg(&q__1, &c); + ct.r = q__1.r, ct.i = q__1.i; + r_cnjg(&q__1, &s); + st.r = q__1.r, st.i = q__1.i; + } + L__1 = jc > k; + clarot_(&c_false, &L__1, &c_true, &il, &c, &s, &a[ + irow - iskew * jc + ioffg + jc * a_dim1], & + ilda, &extra, &ctemp); +/* Computing MIN */ + i__3 = k, i__5 = *n - jc; + i__2 = min(i__3,i__5) + 1; + clarot_(&c_true, &c_true, &c_false, &i__2, &ct, &st, & + a[(1 - iskew) * jc + ioffg + jc * a_dim1], & + ilda, &ctemp, &dummy); + +/* Chase EXTRA back up the matrix +*/ + + icol = jc; + i__2 = -k; + for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1; + jch += i__2) { + clartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg + + (icol + 1) * a_dim1], &extra, &realc, &s, + &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__2.r = realc * dummy.r, q__2.i = realc * + dummy.i; + r_cnjg(&q__1, &q__2); + c.r = q__1.r, c.i = q__1.i; + q__3.r = -(doublereal)s.r, q__3.i = -(doublereal) + s.i; + q__2.r = q__3.r * dummy.r - q__3.i * dummy.i, + q__2.i = q__3.r * dummy.i + q__3.i * + dummy.r; + r_cnjg(&q__1, &q__2); + s.r = q__1.r, s.i = q__1.i; + i__3 = jch - iskew * (jch + 1) + ioffg + (jch + 1) + * a_dim1; + ctemp.r = a[i__3].r, ctemp.i = a[i__3].i; + if (csym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + r_cnjg(&q__1, &ctemp); + ctemp.r = q__1.r, ctemp.i = q__1.i; + r_cnjg(&q__1, &c); + ct.r = q__1.r, ct.i = q__1.i; + r_cnjg(&q__1, &s); + st.r = q__1.r, st.i = q__1.i; + } + i__3 = k + 2; + clarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &ctemp, &extra); +/* Computing MAX */ + i__3 = 1, i__5 = jch - k; + irow = max(i__3,i__5); +/* Computing MIN */ + i__3 = jch + 1, i__5 = k + 2; + il = min(i__3,i__5); + extra.r = 0.f, extra.i = 0.f; + L__1 = jch > k; + clarot_(&c_false, &L__1, &c_true, &il, &ct, &st, & + a[irow - iskew * jch + ioffg + jch * + a_dim1], &ilda, &extra, &ctemp); + icol = jch; +/* L180: */ + } +/* L190: */ + } +/* L200: */ + } + +/* If we need lower triangle, copy from upper. No +te that + the order of copying is chosen to work for 'q' + -> 'b' */ + + if (ipack != ipackg && ipack != 3) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst - iskew * jc; + if (csym) { +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + i__2 = jr + irow + jc * a_dim1; + i__3 = jc - iskew * jr + ioffg + jr * a_dim1; + a[i__2].r = a[i__3].r, a[i__2].i = a[i__3].i; +/* L210: */ + } + } else { +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + i__2 = jr + irow + jc * a_dim1; + r_cnjg(&q__1, &a[jc - iskew * jr + ioffg + jr + * a_dim1]); + a[i__2].r = q__1.r, a[i__2].i = q__1.i; +/* L220: */ + } + } +/* L230: */ + } + if (ipack == 5) { + i__1 = *n; + for (jc = *n - uub + 1; jc <= i__1; ++jc) { + i__4 = uub + 1; + for (jr = *n + 2 - jc; jr <= i__4; ++jr) { + i__2 = jr + jc * a_dim1; + a[i__2].r = 0.f, a[i__2].i = 0.f; +/* L240: */ + } +/* L250: */ + } + } + if (ipackg == 6) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } else { + +/* Bottom-Up -- Generate Lower triangle only */ + + if (ipack >= 5) { + ipackg = 5; + if (ipack == 6) { + ioffg = 1; + } + } else { + ipackg = 2; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__4 = (1 - iskew) * j + ioffg + j * a_dim1; + i__2 = j; + q__1.r = d[i__2], q__1.i = 0.f; + a[i__4].r = q__1.r, a[i__4].i = q__1.i; +/* L260: */ + } + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + for (jc = *n - 1; jc >= 1; --jc) { +/* Computing MIN */ + i__4 = *n + 1 - jc, i__2 = k + 2; + il = min(i__4,i__2); + extra.r = 0.f, extra.i = 0.f; + i__4 = (1 - iskew) * jc + 1 + ioffg + jc * a_dim1; + ctemp.r = a[i__4].r, ctemp.i = a[i__4].i; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + d__1 = cos(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + c.r = q__1.r, c.i = q__1.i; + d__1 = sin(angle); + clarnd_(&q__2, &c__5, &iseed[1]); + q__1.r = d__1 * q__2.r, q__1.i = d__1 * q__2.i; + s.r = q__1.r, s.i = q__1.i; + if (csym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + r_cnjg(&q__1, &ctemp); + ctemp.r = q__1.r, ctemp.i = q__1.i; + r_cnjg(&q__1, &c); + ct.r = q__1.r, ct.i = q__1.i; + r_cnjg(&q__1, &s); + st.r = q__1.r, st.i = q__1.i; + } + L__1 = *n - jc > k; + clarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[(1 + - iskew) * jc + ioffg + jc * a_dim1], &ilda, & + ctemp, &extra); +/* Computing MAX */ + i__4 = 1, i__2 = jc - k + 1; + icol = max(i__4,i__2); + i__4 = jc + 2 - icol; + clarot_(&c_true, &c_false, &c_true, &i__4, &ct, &st, & + a[jc - iskew * icol + ioffg + icol * a_dim1], + &ilda, &dummy, &ctemp); + +/* Chase EXTRA back down the matrix + */ + + icol = jc; + i__4 = *n - 1; + i__2 = k; + for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <= + i__4; jch += i__2) { + clartg_(&a[jch - iskew * icol + ioffg + icol * + a_dim1], &extra, &realc, &s, &dummy); + clarnd_(&q__1, &c__5, &iseed[1]); + dummy.r = q__1.r, dummy.i = q__1.i; + q__1.r = realc * dummy.r, q__1.i = realc * + dummy.i; + c.r = q__1.r, c.i = q__1.i; + q__1.r = s.r * dummy.r - s.i * dummy.i, q__1.i = + s.r * dummy.i + s.i * dummy.r; + s.r = q__1.r, s.i = q__1.i; + i__3 = (1 - iskew) * jch + 1 + ioffg + jch * + a_dim1; + ctemp.r = a[i__3].r, ctemp.i = a[i__3].i; + if (csym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + r_cnjg(&q__1, &ctemp); + ctemp.r = q__1.r, ctemp.i = q__1.i; + r_cnjg(&q__1, &c); + ct.r = q__1.r, ct.i = q__1.i; + r_cnjg(&q__1, &s); + st.r = q__1.r, st.i = q__1.i; + } + i__3 = k + 2; + clarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[jch - iskew * icol + ioffg + icol * + a_dim1], &ilda, &extra, &ctemp); +/* Computing MIN */ + i__3 = *n + 1 - jch, i__5 = k + 2; + il = min(i__3,i__5); + extra.r = 0.f, extra.i = 0.f; + L__1 = *n - jch > k; + clarot_(&c_false, &c_true, &L__1, &il, &ct, &st, & + a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &ctemp, &extra); + icol = jch; +/* L270: */ + } +/* L280: */ + } +/* L290: */ + } + +/* If we need upper triangle, copy from lower. No +te that + the order of copying is chosen to work for 'b' + -> 'q' */ + + if (ipack != ipackg && ipack != 4) { + for (jc = *n; jc >= 1; --jc) { + irow = ioffst - iskew * jc; + if (csym) { +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + i__2 = jr + irow + jc * a_dim1; + i__4 = jc - iskew * jr + ioffg + jr * a_dim1; + a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i; +/* L300: */ + } + } else { +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + i__2 = jr + irow + jc * a_dim1; + r_cnjg(&q__1, &a[jc - iskew * jr + ioffg + jr + * a_dim1]); + a[i__2].r = q__1.r, a[i__2].i = q__1.i; +/* L310: */ + } + } +/* L320: */ + } + if (ipack == 6) { + i__1 = uub; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0.f, a[i__4].i = 0.f; +/* L330: */ + } +/* L340: */ + } + } + if (ipackg == 5) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } + +/* Ensure that the diagonal is real if Hermitian */ + + if (! csym) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst + (1 - iskew) * jc; + i__2 = irow + jc * a_dim1; + i__4 = irow + jc * a_dim1; + d__1 = a[i__4].r; + q__1.r = d__1, q__1.i = 0.f; + a[i__2].r = q__1.r, a[i__2].i = q__1.i; +/* L350: */ + } + } + + } + + } else { + +/* 4) Generate Banded Matrix by first + Rotating by random Unitary matrices, + then reducing the bandwidth using Householder + transformations. + + Note: we should get here only if LDA .ge. N */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + clagge_(&mr, &nc, &llb, &uub, &d[1], &a[a_offset], lda, &iseed[1], + &work[1], &iinfo); + } else { + +/* Symmetric -- A = U D U' or + Hermitian -- A = U D U* */ + + if (csym) { + clagsy_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1] + , &iinfo); + } else { + claghe_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1] + , &iinfo); + } + } + + if (iinfo != 0) { + *info = 3; + return 0; + } + } + +/* 5) Pack the matrix */ + + if (ipack != ipackg) { + if (ipack == 1) { + +/* 'U' -- Upper triangular, not packed */ + + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j + 1; i <= i__2; ++i) { + i__4 = i + j * a_dim1; + a[i__4].r = 0.f, a[i__4].i = 0.f; +/* L360: */ + } +/* L370: */ + } + + } else if (ipack == 2) { + +/* 'L' -- Lower triangular, not packed */ + + i__1 = *m; + for (j = 2; j <= i__1; ++j) { + i__2 = j - 1; + for (i = 1; i <= i__2; ++i) { + i__4 = i + j * a_dim1; + a[i__4].r = 0.f, a[i__4].i = 0.f; +/* L380: */ + } +/* L390: */ + } + + } else if (ipack == 3) { + +/* 'C' -- Upper triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + i__4 = irow + icol * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L400: */ + } +/* L410: */ + } + + } else if (ipack == 4) { + +/* 'R' -- Lower triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + i__4 = irow + icol * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L420: */ + } +/* L430: */ + } + + } else if (ipack >= 5) { + +/* 'B' -- The lower triangle is packed as a band matrix. + + 'Q' -- The upper triangle is packed as a band matrix. + + 'Z' -- The whole matrix is packed as a band matrix. +*/ + + if (ipack == 5) { + uub = 0; + } + if (ipack == 6) { + llb = 0; + } + + i__1 = uub; + for (j = 1; j <= i__1; ++j) { +/* Computing MIN */ + i__2 = j + llb; + for (i = min(i__2,*m); i >= 1; --i) { + i__2 = i - j + uub + 1 + j * a_dim1; + i__4 = i + j * a_dim1; + a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i; +/* L440: */ + } +/* L450: */ + } + + i__1 = *n; + for (j = uub + 2; j <= i__1; ++j) { +/* Computing MIN */ + i__4 = j + llb; + i__2 = min(i__4,*m); + for (i = j - uub; i <= i__2; ++i) { + i__4 = i - j + uub + 1 + j * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L460: */ + } +/* L470: */ + } + } + +/* If packed, zero out extraneous elements. + + Symmetric/Triangular Packed -- + zero out everything after A(IROW,ICOL) */ + + if (ipack == 3 || ipack == 4) { + i__1 = *m; + for (jc = icol; jc <= i__1; ++jc) { + i__2 = *lda; + for (jr = irow + 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0.f, a[i__4].i = 0.f; +/* L480: */ + } + irow = 0; +/* L490: */ + } + + } else if (ipack >= 5) { + +/* Packed Band -- + 1st row is now in A( UUB+2-j, j), zero above it + m-th row is now in A( M+UUB-j,j), zero below it + last non-zero diagonal is now in A( UUB+LLB+1,j ), + + zero below it, too. */ + + ir1 = uub + llb + 2; + ir2 = uub + *m + 2; + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0.f, a[i__4].i = 0.f; +/* L500: */ + } +/* Computing MAX + Computing MIN */ + i__3 = ir1, i__5 = ir2 - jc; + i__2 = 1, i__4 = min(i__3,i__5); + i__6 = *lda; + for (jr = max(i__2,i__4); jr <= i__6; ++jr) { + i__2 = jr + jc * a_dim1; + a[i__2].r = 0.f, a[i__2].i = 0.f; +/* L510: */ + } +/* L520: */ + } + } + } + + return 0; + +/* End of CLATMS */ + +} /* clatms_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/csymv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/csymv.c new file mode 100644 index 0000000..94470c2 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/csymv.c @@ -0,0 +1,408 @@ +#include "f2c.h" + +/* Subroutine */ int csymv_(char *uplo, integer *n, complex *alpha, complex * + a, integer *lda, complex *x, integer *incx, complex *beta, complex *y, + integer *incy) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + CSYMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n symmetric matrix. + + Arguments + ========== + + UPLO - CHARACTER*1 + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX array, dimension ( LDA, N ) + Before entry, with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. + Before entry, with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. + Unchanged on exit. + + LDA - INTEGER + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, N ). + Unchanged on exit. + + X - COMPLEX array, dimension at least + ( 1 + ( N - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the N- + element vector x. + Unchanged on exit. + + INCX - INTEGER + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX array, dimension at least + ( 1 + ( N - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + ===================================================================== + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + complex q__1, q__2, q__3, q__4; + /* Local variables */ + static integer info; + static complex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("CSYMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0.f && alpha->i == 0.f && (beta->r == 1.f && + beta->i == 0.f)) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (beta->r != 1.f || beta->i != 0.f) { + if (*incy == 1) { + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + Y(i).r = 0.f, Y(i).i = 0.f; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + q__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + q__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = q__1.r, Y(i).i = q__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0.f && beta->i == 0.f) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + Y(iy).r = 0.f, Y(iy).i = 0.f; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + q__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + q__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0.f && alpha->i == 0.f) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + q__1.r = alpha->r * X(j).r - alpha->i * X(j).i, q__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(i).r + q__2.r, q__1.i = Y(i).i + q__2.i; + Y(i).r = q__1.r, Y(i).i = q__1.i; + i__3 = i + j * a_dim1; + i__4 = i; + q__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i).i, + q__2.i = A(i,j).r * X(i).i + A(i,j).i * X( + i).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L50: */ + } + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + q__3.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, q__3.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + q__2.r = Y(j).r + q__3.r, q__2.i = Y(j).i + q__3.i; + q__4.r = alpha->r * temp2.r - alpha->i * temp2.i, q__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, q__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(iy).r + q__2.r, q__1.i = Y(iy).i + q__2.i; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + i__3 = i + j * a_dim1; + i__4 = ix; + q__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix).i, + q__2.i = A(i,j).r * X(ix).i + A(i,j).i * X( + ix).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; + ix += *incx; + iy += *incy; +/* L70: */ + } + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + q__3.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, q__3.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + q__2.r = Y(jy).r + q__3.r, q__2.i = Y(jy).i + q__3.i; + q__4.r = alpha->r * temp2.r - alpha->i * temp2.i, q__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = q__2.r + q__4.r, q__1.i = q__2.i + q__4.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + q__1.r = alpha->r * X(j).r - alpha->i * X(j).i, q__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + q__2.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, q__2.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + q__1.r = Y(j).r + q__2.r, q__1.i = Y(j).i + q__2.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(i).r + q__2.r, q__1.i = Y(i).i + q__2.i; + Y(i).r = q__1.r, Y(i).i = q__1.i; + i__3 = i + j * a_dim1; + i__4 = i; + q__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i).i, + q__2.i = A(i,j).r * X(i).i + A(i,j).i * X( + i).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L90: */ + } + i__2 = j; + i__3 = j; + q__2.r = alpha->r * temp2.r - alpha->i * temp2.i, q__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = Y(j).r + q__2.r, q__1.i = Y(j).i + q__2.i; + Y(j).r = q__1.r, Y(j).i = q__1.i; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + q__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, q__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = q__1.r, temp1.i = q__1.i; + temp2.r = 0.f, temp2.i = 0.f; + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + q__2.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, q__2.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + q__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + q__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + q__1.r = Y(iy).r + q__2.r, q__1.i = Y(iy).i + q__2.i; + Y(iy).r = q__1.r, Y(iy).i = q__1.i; + i__3 = i + j * a_dim1; + i__4 = ix; + q__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix).i, + q__2.i = A(i,j).r * X(ix).i + A(i,j).i * X( + ix).r; + q__1.r = temp2.r + q__2.r, q__1.i = temp2.i + q__2.i; + temp2.r = q__1.r, temp2.i = q__1.i; +/* L110: */ + } + i__2 = jy; + i__3 = jy; + q__2.r = alpha->r * temp2.r - alpha->i * temp2.i, q__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + q__1.r = Y(jy).r + q__2.r, q__1.i = Y(jy).i + q__2.i; + Y(jy).r = q__1.r, Y(jy).i = q__1.i; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of CSYMV */ + +} /* csymv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_lg10.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_lg10.c new file mode 100644 index 0000000..f03ff00 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_lg10.c @@ -0,0 +1,15 @@ +#include "f2c.h" + +#define log10e 0.43429448190325182765 + +#ifdef KR_headers +double log(); +double d_lg10(x) doublereal *x; +#else +#undef abs +#include "math.h" +double d_lg10(doublereal *x) +#endif +{ +return( log10e * log(*x) ); +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_sign.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_sign.c new file mode 100644 index 0000000..514ff0b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/d_sign.c @@ -0,0 +1,12 @@ +#include "f2c.h" + +#ifdef KR_headers +double d_sign(a,b) doublereal *a, *b; +#else +double d_sign(doublereal *a, doublereal *b) +#endif +{ +double x; +x = (*a >= 0 ? *a : - *a); +return( *b >= 0 ? x : -x); +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlabad.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlabad.c new file mode 100644 index 0000000..03fa9fd --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlabad.c @@ -0,0 +1,60 @@ +#include "f2c.h" + +/* Subroutine */ int dlabad_(doublereal *small, doublereal *large) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLABAD takes as input the values computed by SLAMCH for underflow and + + overflow, and returns the square root of each of these values if the + + log of LARGE is sufficiently large. This subroutine is intended to + identify machines with a large exponent range, such as the Crays, and + + redefine the underflow and overflow limits to be the square roots of + + the values computed by DLAMCH. This subroutine is needed because + DLAMCH does not compensate for poor arithmetic in the upper half of + the exponent range, as is found on a Cray. + + Arguments + ========= + + SMALL (input/output) DOUBLE PRECISION + On entry, the underflow threshold as computed by DLAMCH. + On exit, if LOG10(LARGE) is sufficiently large, the square + root of SMALL, otherwise unchanged. + + LARGE (input/output) DOUBLE PRECISION + On entry, the overflow threshold as computed by DLAMCH. + On exit, if LOG10(LARGE) is sufficiently large, the square + root of LARGE, otherwise unchanged. + + ===================================================================== + + + + If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + /* Builtin functions */ + double d_lg10(doublereal *), sqrt(doublereal); + + + if (d_lg10(large) > 2e3) { + *small = sqrt(*small); + *large = sqrt(*large); + } + + return 0; + +/* End of DLABAD */ + +} /* dlabad_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagge.c new file mode 100644 index 0000000..8d4e4ba --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagge.c @@ -0,0 +1,402 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static doublereal c_b11 = 1.; +static doublereal c_b13 = 0.; + +/* Subroutine */ int dlagge_(integer *m, integer *n, integer *kl, integer *ku, + doublereal *d, doublereal *a, integer *lda, integer *iseed, + doublereal *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + + /* Builtin functions */ + double d_sign(doublereal *, doublereal *); + + /* Local variables */ + extern /* Subroutine */ int dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + extern doublereal dnrm2_(integer *, doublereal *, integer *); + static integer i, j; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *), dgemv_(char *, integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + doublereal *, integer *); + static doublereal wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), dlarnv_( + integer *, integer *, integer *, doublereal *); + static doublereal tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLAGGE generates a real general m by n matrix A, by pre- and post- + multiplying a real diagonal matrix D with random orthogonal matrices: + + A = U*D*V. The lower and upper bandwidths may then be reduced to + kl and ku by additional orthogonal transformations. + + Arguments + ========= + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + KL (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= KL <= M-1. + + KU (input) INTEGER + The number of nonzero superdiagonals within the band of A. + 0 <= KU <= N-1. + + D (input) DOUBLE PRECISION array, dimension (min(M,N)) + The diagonal elements of the diagonal matrix D. + + A (output) DOUBLE PRECISION array, dimension (LDA,N) + The generated m by n matrix A. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= M. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) DOUBLE PRECISION array, dimension (M+N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*m < 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (*kl < 0 || *kl > *m - 1) { + *info = -3; + } else if (*ku < 0 || *ku > *n - 1) { + *info = -4; + } else if (*lda < max(1,*m)) { + *info = -7; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("DLAGGE", &i__1); + return 0; + } + +/* initialize A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= i__1; ++i) { + a[i + i * a_dim1] = d[i]; +/* L30: */ + } + +/* pre- and post-multiply A by random orthogonal matrices */ + + for (i = min(*m,*n); i >= 1; --i) { + if (i < *m) { + +/* generate random reflection */ + + i__1 = *m - i + 1; + dlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *m - i + 1; + wn = dnrm2_(&i__1, &work[1], &c__1); + wa = d_sign(&wn, &work[1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = work[1] + wa; + i__1 = *m - i; + d__1 = 1. / wb; + dscal_(&i__1, &d__1, &work[2], &c__1); + work[1] = 1.; + tau = wb / wa; + } + +/* multiply A(i:m,i:n) by random reflection from the lef +t */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + dgemv_("Transpose", &i__1, &i__2, &c_b11, &a[i + i * a_dim1], lda, + &work[1], &c__1, &c_b13, &work[*m + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + d__1 = -tau; + dger_(&i__1, &i__2, &d__1, &work[1], &c__1, &work[*m + 1], &c__1, + &a[i + i * a_dim1], lda); + } + if (i < *n) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + dlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dnrm2_(&i__1, &work[1], &c__1); + wa = d_sign(&wn, &work[1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = work[1] + wa; + i__1 = *n - i; + d__1 = 1. / wb; + dscal_(&i__1, &d__1, &work[2], &c__1); + work[1] = 1.; + tau = wb / wa; + } + +/* multiply A(i:m,i:n) by random reflection from the rig +ht */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + dgemv_("No transpose", &i__1, &i__2, &c_b11, &a[i + i * a_dim1], + lda, &work[1], &c__1, &c_b13, &work[*n + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + d__1 = -tau; + dger_(&i__1, &i__2, &d__1, &work[*n + 1], &c__1, &work[1], &c__1, + &a[i + i * a_dim1], lda); + } +/* L40: */ + } + +/* Reduce number of subdiagonals to KL and number of superdiagonals + to KU + + Computing MAX */ + i__2 = *m - 1 - *kl, i__3 = *n - 1 - *ku; + i__1 = max(i__2,i__3); + for (i = 1; i <= i__1; ++i) { + if (*kl <= *ku) { + +/* annihilate subdiagonal elements first (necessary if K +L = 0) + + Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = dnrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + wa = d_sign(&wn, &a[*kl + i + i * a_dim1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = a[*kl + i + i * a_dim1] + wa; + i__2 = *m - *kl - i; + d__1 = 1. / wb; + dscal_(&i__2, &d__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + a[*kl + i + i * a_dim1] = 1.; + tau = wb / wa; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + dgemv_("Transpose", &i__2, &i__3, &c_b11, &a[*kl + i + (i + 1) + * a_dim1], lda, &a[*kl + i + i * a_dim1], &c__1, & + c_b13, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + d__1 = -tau; + dger_(&i__2, &i__3, &d__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + a[*kl + i + i * a_dim1] = -wa; + } + +/* Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = dnrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + wa = d_sign(&wn, &a[i + (*ku + i) * a_dim1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = a[i + (*ku + i) * a_dim1] + wa; + i__2 = *n - *ku - i; + d__1 = 1. / wb; + dscal_(&i__2, &d__1, &a[i + (*ku + i + 1) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = 1.; + tau = wb / wa; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + dgemv_("No transpose", &i__2, &i__3, &c_b11, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, + &c_b13, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + d__1 = -tau; + dger_(&i__2, &i__3, &d__1, &work[1], &c__1, &a[i + (*ku + i) * + a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = -wa; + } + } else { + +/* annihilate superdiagonal elements first (necessary if + + KU = 0) + + Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = dnrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + wa = d_sign(&wn, &a[i + (*ku + i) * a_dim1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = a[i + (*ku + i) * a_dim1] + wa; + i__2 = *n - *ku - i; + d__1 = 1. / wb; + dscal_(&i__2, &d__1, &a[i + (*ku + i + 1) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = 1.; + tau = wb / wa; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + dgemv_("No transpose", &i__2, &i__3, &c_b11, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, + &c_b13, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + d__1 = -tau; + dger_(&i__2, &i__3, &d__1, &work[1], &c__1, &a[i + (*ku + i) * + a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = -wa; + } + +/* Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = dnrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + wa = d_sign(&wn, &a[*kl + i + i * a_dim1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = a[*kl + i + i * a_dim1] + wa; + i__2 = *m - *kl - i; + d__1 = 1. / wb; + dscal_(&i__2, &d__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + a[*kl + i + i * a_dim1] = 1.; + tau = wb / wa; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + dgemv_("Transpose", &i__2, &i__3, &c_b11, &a[*kl + i + (i + 1) + * a_dim1], lda, &a[*kl + i + i * a_dim1], &c__1, & + c_b13, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + d__1 = -tau; + dger_(&i__2, &i__3, &d__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + a[*kl + i + i * a_dim1] = -wa; + } + } + + i__2 = *m; + for (j = *kl + i + 1; j <= i__2; ++j) { + a[j + i * a_dim1] = 0.; +/* L50: */ + } + + i__2 = *n; + for (j = *ku + i + 1; j <= i__2; ++j) { + a[i + j * a_dim1] = 0.; +/* L60: */ + } +/* L70: */ + } + return 0; + +/* End of DLAGGE */ + +} /* dlagge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagsy.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagsy.c new file mode 100644 index 0000000..46c837a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlagsy.c @@ -0,0 +1,276 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static doublereal c_b12 = 0.; +static doublereal c_b19 = -1.; +static doublereal c_b26 = 1.; + +/* Subroutine */ int dlagsy_(integer *n, integer *k, doublereal *d, + doublereal *a, integer *lda, integer *iseed, doublereal *work, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + + /* Builtin functions */ + double d_sign(doublereal *, doublereal *); + + /* Local variables */ + extern /* Subroutine */ int dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + extern doublereal ddot_(integer *, doublereal *, integer *, doublereal *, + integer *), dnrm2_(integer *, doublereal *, integer *); + extern /* Subroutine */ int dsyr2_(char *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + static integer i, j; + static doublereal alpha; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *), dgemv_(char *, integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + doublereal *, integer *), daxpy_(integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *), dsymv_(char *, + integer *, doublereal *, doublereal *, integer *, doublereal *, + integer *, doublereal *, doublereal *, integer *); + static doublereal wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), dlarnv_( + integer *, integer *, integer *, doublereal *); + static doublereal tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLAGSY generates a real symmetric matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random orthogonal matrix: + + A = U*D*U'. The semi-bandwidth may then be reduced to k by additional + + orthogonal transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) DOUBLE PRECISION array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) DOUBLE PRECISION array, dimension (LDA,N) + The generated n by n symmetric matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) DOUBLE PRECISION array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("DLAGSY", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + a[i + i * a_dim1] = d[i]; +/* L30: */ + } + +/* Generate lower triangle of symmetric matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + dlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dnrm2_(&i__1, &work[1], &c__1); + wa = d_sign(&wn, &work[1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = work[1] + wa; + i__1 = *n - i; + d__1 = 1. / wb; + dscal_(&i__1, &d__1, &work[2], &c__1); + work[1] = 1.; + tau = wb / wa; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * u */ + + i__1 = *n - i + 1; + dsymv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b12, &work[*n + 1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + i__1 = *n - i + 1; + alpha = tau * -.5 * ddot_(&i__1, &work[*n + 1], &c__1, &work[1], & + c__1); + i__1 = *n - i + 1; + daxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) */ + + i__1 = *n - i + 1; + dsyr2_("Lower", &i__1, &c_b19, &work[1], &c__1, &work[*n + 1], &c__1, + &a[i + i * a_dim1], lda); +/* L40: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = dnrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + wa = d_sign(&wn, &a[*k + i + i * a_dim1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = a[*k + i + i * a_dim1] + wa; + i__2 = *n - *k - i; + d__1 = 1. / wb; + dscal_(&i__2, &d__1, &a[*k + i + 1 + i * a_dim1], &c__1); + a[*k + i + i * a_dim1] = 1.; + tau = wb / wa; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + dgemv_("Transpose", &i__2, &i__3, &c_b26, &a[*k + i + (i + 1) * + a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b12, &work[1] + , &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + d__1 = -tau; + dger_(&i__2, &i__3, &d__1, &a[*k + i + i * a_dim1], &c__1, &work[1], & + c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * u */ + + i__2 = *n - *k - i + 1; + dsymv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b12, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + i__2 = *n - *k - i + 1; + alpha = tau * -.5 * ddot_(&i__2, &work[1], &c__1, &a[*k + i + i * + a_dim1], &c__1); + i__2 = *n - *k - i + 1; + daxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply symmetric rank-2 update to A(k+i:n,k+i:n) */ + + i__2 = *n - *k - i + 1; + dsyr2_("Lower", &i__2, &c_b19, &a[*k + i + i * a_dim1], &c__1, &work[ + 1], &c__1, &a[*k + i + (*k + i) * a_dim1], lda); + + a[*k + i + i * a_dim1] = -wa; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + a[j + i * a_dim1] = 0.; +/* L50: */ + } +/* L60: */ + } + +/* Store full symmetric matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + a[j + i * a_dim1] = a[i + j * a_dim1]; +/* L70: */ + } +/* L80: */ + } + return 0; + +/* End of DLAGSY */ + +} /* dlagsy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaran.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaran.c new file mode 100644 index 0000000..c4101b8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaran.c @@ -0,0 +1,92 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dlaran_(integer *iseed) +{ + /* System generated locals */ + doublereal ret_val; + + /* Local variables */ + static integer it1, it2, it3, it4; + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLARAN returns a random real number from a uniform (0,1) + distribution. + + Arguments + ========= + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine uses a multiplicative congruential method with modulus + 2**48 and multiplier 33952834046453 (see G.S.Fishman, + 'Multiplicative congruential random number generators with modulus + 2**b: an exhaustive analysis for b = 32 and a partial analysis for + b = 48', Math. Comp. 189, pp 331-344, 1990). + + 48-bit integers are stored in 4 integer array elements with 12 bits + per element. Hence the routine is portable across machines with + integers of 32 bits or more. + + ===================================================================== + + + + multiply the seed by the multiplier modulo 2**48 + + Parameter adjustments */ + --iseed; + + /* Function Body */ + it4 = iseed[4] * 2549; + it3 = it4 / 4096; + it4 -= it3 << 12; + it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508; + it2 = it3 / 4096; + it3 -= it2 << 12; + it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322; + it1 = it2 / 4096; + it2 -= it1 << 12; + it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4] + * 494; + it1 %= 4096; + +/* return updated seed */ + + iseed[1] = it1; + iseed[2] = it2; + iseed[3] = it3; + iseed[4] = it4; + +/* convert 48-bit integer to a real number in the interval (0,1) */ + + ret_val = ((doublereal) it1 + ((doublereal) it2 + ((doublereal) it3 + ( + doublereal) it4 * 2.44140625e-4) * 2.44140625e-4) * 2.44140625e-4) + * 2.44140625e-4; + return ret_val; + +/* End of DLARAN */ + +} /* dlaran_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarge.c new file mode 100644 index 0000000..86840c4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarge.c @@ -0,0 +1,154 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static doublereal c_b8 = 1.; +static doublereal c_b10 = 0.; + +/* Subroutine */ int dlarge_(integer *n, doublereal *a, integer *lda, integer + *iseed, doublereal *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1; + doublereal d__1; + + /* Builtin functions */ + double d_sign(doublereal *, doublereal *); + + /* Local variables */ + extern /* Subroutine */ int dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + extern doublereal dnrm2_(integer *, doublereal *, integer *); + static integer i; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *), dgemv_(char *, integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + doublereal *, integer *); + static doublereal wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), dlarnv_( + integer *, integer *, integer *, doublereal *); + static doublereal tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLARGE pre- and post-multiplies a real general n by n matrix A + with a random orthogonal matrix: A = U*D*U'. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the original n by n matrix A. + On exit, A is overwritten by U*A*U' for some random + orthogonal matrix U. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) DOUBLE PRECISION array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*lda < max(1,*n)) { + *info = -3; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("DLARGE", &i__1); + return 0; + } + +/* pre- and post-multiply A by random orthogonal matrix */ + + for (i = *n; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + dlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dnrm2_(&i__1, &work[1], &c__1); + wa = d_sign(&wn, &work[1]); + if (wn == 0.) { + tau = 0.; + } else { + wb = work[1] + wa; + i__1 = *n - i; + d__1 = 1. / wb; + dscal_(&i__1, &d__1, &work[2], &c__1); + work[1] = 1.; + tau = wb / wa; + } + +/* multiply A(i:n,1:n) by random reflection from the left */ + + i__1 = *n - i + 1; + dgemv_("Transpose", &i__1, n, &c_b8, &a[i + a_dim1], lda, &work[1], & + c__1, &c_b10, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + d__1 = -tau; + dger_(&i__1, n, &d__1, &work[1], &c__1, &work[*n + 1], &c__1, &a[i + + a_dim1], lda); + +/* multiply A(1:n,i:n) by random reflection from the right */ + + i__1 = *n - i + 1; + dgemv_("No transpose", n, &i__1, &c_b8, &a[i * a_dim1 + 1], lda, & + work[1], &c__1, &c_b10, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + d__1 = -tau; + dger_(n, &i__1, &d__1, &work[*n + 1], &c__1, &work[1], &c__1, &a[i * + a_dim1 + 1], lda); +/* L10: */ + } + return 0; + +/* End of DLARGE */ + +} /* dlarge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnd.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnd.c new file mode 100644 index 0000000..20ec813 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnd.c @@ -0,0 +1,94 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dlarnd_(integer *idist, integer *iseed) +{ + /* System generated locals */ + doublereal ret_val; + + /* Builtin functions */ + double log(doublereal), sqrt(doublereal), cos(doublereal); + + /* Local variables */ + static doublereal t1, t2; + extern doublereal dlaran_(integer *); + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLARND returns a random real number from a uniform or normal + distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: uniform (0,1) + = 2: uniform (-1,1) + = 3: normal (0,1) + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine calls the auxiliary routine DLARAN to generate a random + + real number from a uniform (0,1) distribution. The Box-Muller method + + is used to transform numbers from a uniform to a normal distribution. + + + ===================================================================== + + + + Generate a real random number from a uniform (0,1) distribution + + Parameter adjustments */ + --iseed; + + /* Function Body */ + t1 = dlaran_(&iseed[1]); + + if (*idist == 1) { + +/* uniform (0,1) */ + + ret_val = t1; + } else if (*idist == 2) { + +/* uniform (-1,1) */ + + ret_val = t1 * 2. - 1.; + } else if (*idist == 3) { + +/* normal (0,1) */ + + t2 = dlaran_(&iseed[1]); + ret_val = sqrt(log(t1) * -2.) * cos(t2 * + 6.2831853071795864769252867663); + } + return ret_val; + +/* End of DLARND */ + +} /* dlarnd_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnv.c new file mode 100644 index 0000000..c0b3f3e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarnv.c @@ -0,0 +1,126 @@ +#include "f2c.h" + +/* Subroutine */ int dlarnv_(integer *idist, integer *iseed, integer *n, + doublereal *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLARNV returns a vector of n random real numbers from a uniform or + normal distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: uniform (0,1) + = 2: uniform (-1,1) + = 3: normal (0,1) + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. + + X (output) DOUBLE PRECISION array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine calls the auxiliary routine DLARUV to generate random + real numbers from a uniform (0,1) distribution, in batches of up to + 128 using vectorisable code. The Box-Muller method is used to + transform numbers from a uniform to a normal distribution. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2, i__3; + /* Builtin functions */ + double log(doublereal), sqrt(doublereal), cos(doublereal); + /* Local variables */ + static integer i; + static doublereal u[128]; + static integer il, iv; + extern /* Subroutine */ int dlaruv_(integer *, integer *, doublereal *); + static integer il2; + + +#define U(I) u[(I)] +#define X(I) x[(I)-1] +#define ISEED(I) iseed[(I)-1] + + + i__1 = *n; + for (iv = 1; iv <= *n; iv += 64) { +/* Computing MIN */ + i__2 = 64, i__3 = *n - iv + 1; + il = min(i__2,i__3); + if (*idist == 3) { + il2 = il << 1; + } else { + il2 = il; + } + +/* Call DLARUV to generate IL2 numbers from a uniform (0,1) + distribution (IL2 <= LV) */ + + dlaruv_(&ISEED(1), &il2, u); + + if (*idist == 1) { + +/* Copy generated numbers */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = U(i - 1); +/* L10: */ + } + } else if (*idist == 2) { + +/* Convert generated numbers to uniform (-1,1) distribut +ion */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = U(i - 1) * 2. - 1.; +/* L20: */ + } + } else if (*idist == 3) { + +/* Convert generated numbers to normal (0,1) distributio +n */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = sqrt(log(U((i << 1) - 2)) * -2.) * cos(U((i << + 1) - 1) * 6.2831853071795864769252867663); +/* L30: */ + } + } +/* L40: */ + } + return 0; + +/* End of DLARNV */ + +} /* dlarnv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaror.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaror.c new file mode 100644 index 0000000..17b12d4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaror.c @@ -0,0 +1,291 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublereal c_b9 = 0.; +static doublereal c_b10 = 1.; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int dlaror_(char *side, char *init, integer *m, integer *n, + doublereal *a, integer *lda, integer *iseed, doublereal *x, integer * + info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + doublereal d__1; + + /* Builtin functions */ + double d_sign(doublereal *, doublereal *); + + /* Local variables */ + static integer kbeg; + extern /* Subroutine */ int dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + static integer jcol, irow; + extern doublereal dnrm2_(integer *, doublereal *, integer *); + static integer j; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *); + extern logical lsame_(char *, char *); + extern /* Subroutine */ int dgemv_(char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, + doublereal *, doublereal *, integer *); + static integer ixfrm, itype, nxfrm; + static doublereal xnorm; + extern doublereal dlarnd_(integer *, integer *); + extern /* Subroutine */ int dlaset_(char *, integer *, integer *, + doublereal *, doublereal *, doublereal *, integer *), + xerbla_(char *, integer *); + static doublereal factor, xnorms; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLAROR pre- or post-multiplies an M by N matrix A by a random + orthogonal matrix U, overwriting A. A may optionally be initialized + + to the identity matrix before multiplying by U. U is generated using + + the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409). + + + Arguments + ========= + + SIDE (input) CHARACTER*1 + Specifies whether A is multiplied on the left or right by U. + + = 'L': Multiply A on the left (premultiply) by U + = 'R': Multiply A on the right (postmultiply) by U' + = 'C' or 'T': Multiply A on the left by U and the right + by U' (Here, U' means U-transpose.) + + INIT (input) CHARACTER*1 + Specifies whether or not A should be initialized to the + identity matrix. + = 'I': Initialize A to (a section of) the identity matrix + before applying U. + = 'N': No initialization. Apply U to the input matrix A. + + INIT = 'I' may be used to generate square or rectangular + orthogonal matrices: + + For M = N and SIDE = 'L' or 'R', the rows will be orthogonal + + to each other, as will the columns. + + If M < N, SIDE = 'R' produces a dense matrix whose rows are + orthogonal and whose columns are not, while SIDE = 'L' + produces a matrix whose rows are orthogonal, and whose first + + M columns are orthogonal, and whose remaining columns are + zero. + + If M > N, SIDE = 'L' produces a dense matrix whose columns + are orthogonal and whose rows are not, while SIDE = 'R' + produces a matrix whose columns are orthogonal, and whose + first M rows are orthogonal, and whose remaining rows are + zero. + + M (input) INTEGER + The number of rows of A. + + N (input) INTEGER + The number of columns of A. + + A (input/output) DOUBLE PRECISION array, dimension (LDA, N) + On entry, the array A. + On exit, overwritten by U A ( if SIDE = 'L' ), + or by A U ( if SIDE = 'R' ), + or by U A U' ( if SIDE = 'C' or 'T'). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ISEED (input/output) INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. The array elements should be between 0 and 4095; + if not they will be reduced mod 4096. Also, ISEED(4) must + be odd. The random number generator uses a linear + congruential sequence limited to small integers, and so + should produce machine independent random numbers. The + values of ISEED are changed on exit, and can be used in the + next call to DLAROR to continue the same random number + sequence. + + X (workspace) DOUBLE PRECISION array, dimension (3*MAX( M, N )) + + Workspace of length + 2*M + N if SIDE = 'L', + 2*N + M if SIDE = 'R', + 3*N if SIDE = 'C' or 'T'. + + INFO (output) INTEGER + An error flag. It is set to: + = 0: normal return + < 0: if INFO = -k, the k-th argument had an illegal value + = 1: if the random numbers generated by DLARND are bad. + + ===================================================================== + + + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --x; + + /* Function Body */ + if (*n == 0 || *m == 0) { + return 0; + } + + itype = 0; + if (lsame_(side, "L")) { + itype = 1; + } else if (lsame_(side, "R")) { + itype = 2; + } else if (lsame_(side, "C") || lsame_(side, "T")) { + itype = 3; + } + +/* Check for argument errors. */ + + *info = 0; + if (itype == 0) { + *info = -1; + } else if (*m < 0) { + *info = -3; + } else if (*n < 0 || itype == 3 && *n != *m) { + *info = -4; + } else if (*lda < *m) { + *info = -6; + } + if (*info != 0) { + i__1 = -(*info); + xerbla_("DLAROR", &i__1); + return 0; + } + + if (itype == 1) { + nxfrm = *m; + } else { + nxfrm = *n; + } + +/* Initialize A to the identity matrix if desired */ + + if (lsame_(init, "I")) { + dlaset_("Full", m, n, &c_b9, &c_b10, &a[a_offset], lda); + } + +/* If no rotation possible, multiply by random +/-1 + + Compute rotation by computing Householder transformations + H(2), H(3), ..., H(nhouse) */ + + i__1 = nxfrm; + for (j = 1; j <= i__1; ++j) { + x[j] = 0.; +/* L10: */ + } + + i__1 = nxfrm; + for (ixfrm = 2; ixfrm <= i__1; ++ixfrm) { + kbeg = nxfrm - ixfrm + 1; + +/* Generate independent normal( 0, 1 ) random numbers */ + + i__2 = nxfrm; + for (j = kbeg; j <= i__2; ++j) { + x[j] = dlarnd_(&c__3, &iseed[1]); +/* L20: */ + } + +/* Generate a Householder transformation from the random vector + X */ + + xnorm = dnrm2_(&ixfrm, &x[kbeg], &c__1); + xnorms = d_sign(&xnorm, &x[kbeg]); + d__1 = -x[kbeg]; + x[kbeg + nxfrm] = d_sign(&c_b10, &d__1); + factor = xnorms * (xnorms + x[kbeg]); + if (abs(factor) < 1e-20) { + *info = 1; + xerbla_("DLAROR", info); + return 0; + } else { + factor = 1. / factor; + } + x[kbeg] += xnorms; + +/* Apply Householder transformation to A */ + + if (itype == 1 || itype == 3) { + +/* Apply H(k) from the left. */ + + dgemv_("T", &ixfrm, n, &c_b10, &a[kbeg + a_dim1], lda, &x[kbeg], & + c__1, &c_b9, &x[(nxfrm << 1) + 1], &c__1); + d__1 = -factor; + dger_(&ixfrm, n, &d__1, &x[kbeg], &c__1, &x[(nxfrm << 1) + 1], & + c__1, &a[kbeg + a_dim1], lda); + + } + + if (itype == 2 || itype == 3) { + +/* Apply H(k) from the right. */ + + dgemv_("N", m, &ixfrm, &c_b10, &a[kbeg * a_dim1 + 1], lda, &x[ + kbeg], &c__1, &c_b9, &x[(nxfrm << 1) + 1], &c__1); + d__1 = -factor; + dger_(m, &ixfrm, &d__1, &x[(nxfrm << 1) + 1], &c__1, &x[kbeg], & + c__1, &a[kbeg * a_dim1 + 1], lda); + + } +/* L30: */ + } + + d__1 = dlarnd_(&c__3, &iseed[1]); + x[nxfrm * 2] = d_sign(&c_b10, &d__1); + +/* Scale the matrix A by D. */ + + if (itype == 1 || itype == 3) { + i__1 = *m; + for (irow = 1; irow <= i__1; ++irow) { + dscal_(n, &x[nxfrm + irow], &a[irow + a_dim1], lda); +/* L40: */ + } + } + + if (itype == 2 || itype == 3) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + dscal_(m, &x[nxfrm + jcol], &a[jcol * a_dim1 + 1], &c__1); +/* L50: */ + } + } + return 0; + +/* End of DLAROR */ + +} /* dlaror_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarot.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarot.c new file mode 100644 index 0000000..9fcad67 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlarot.c @@ -0,0 +1,299 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__4 = 4; +static integer c__8 = 8; +static integer c__1 = 1; + +/* Subroutine */ int dlarot_(logical *lrows, logical *lleft, logical *lright, + integer *nl, doublereal *c, doublereal *s, doublereal *a, integer * + lda, doublereal *xleft, doublereal *xright) +{ + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer iinc; + extern /* Subroutine */ int drot_(integer *, doublereal *, integer *, + doublereal *, integer *, doublereal *, doublereal *); + static integer inext, ix, iy, nt; + static doublereal xt[2], yt[2]; + extern /* Subroutine */ int xerbla_(char *, integer *); + static integer iyt; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLAROT applies a (Givens) rotation to two adjacent rows or + columns, where one element of the first and/or last column/row + may be a separate variable. This is specifically indended + for use on matrices stored in some format other than GE, so + that elements of the matrix may be used or modified for which + no array element is provided. + + One example is a symmetric matrix in SB format (bandwidth=4), for + + which UPLO='L': Two adjacent rows will have the format: + + row j: * * * * * . . . . + row j+1: * * * * * . . . . + + '*' indicates elements for which storage is provided, + '.' indicates elements for which no storage is provided, but + are not necessarily zero; their values are determined by + symmetry. ' ' indicates elements which are necessarily zero, + and have no storage provided. + + Those columns which have two '*'s can be handled by DROT. + Those columns which have no '*'s can be ignored, since as long + as the Givens rotations are carefully applied to preserve + symmetry, their values are determined. + Those columns which have one '*' have to be handled separately, + by using separate variables "p" and "q": + + row j: * * * * * p . . . + row j+1: q * * * * * . . . . + + The element p would have to be set correctly, then that column + is rotated, setting p to its new value. The next call to + DLAROT would rotate columns j and j+1, using p, and restore + symmetry. The element q would start out being zero, and be + made non-zero by the rotation. Later, rotations would presumably + + be chosen to zero q out. + + Typical Calling Sequences: rotating the i-th and (i+1)-st rows. + ------- ------- --------- + + General dense matrix: + + CALL DLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S, + A(i,1),LDA, DUMMY, DUMMY) + + General banded matrix in GB format: + + j = MAX(1, i-KL ) + NL = MIN( N, i+KU+1 ) + 1-j + CALL DLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S, + A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,KL+1) ] + + Symmetric banded matrix in SY format, bandwidth K, + lower triangle only: + + j = MAX(1, i-K ) + NL = MIN( K+1, i ) + 1 + CALL DLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S, + A(i,j), LDA, XLEFT, XRIGHT ) + + Same, but upper triangle only: + + NL = MIN( K+1, N-i ) + 1 + CALL DLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S, + A(i,i), LDA, XLEFT, XRIGHT ) + + Symmetric banded matrix in SB format, bandwidth K, + lower triangle only: + + [ same as for SY, except:] + . . . . + A(i+1-j,j), LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,K+1) ] + + Same, but upper triangle only: + . . . + A(K+1,i), LDA-1, XLEFT, XRIGHT ) + + Rotating columns is just the transpose of rotating rows, except + + for GB and SB: (rotating columns i and i+1) + + GB: + j = MAX(1, i-KU ) + NL = MIN( N, i+KL+1 ) + 1-j + CALL DLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S, + A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + [note that KU+j+1-i is just MAX(1,KU+2-i)] + + SB: (upper triangle) + + . . . . . . + A(K+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + SB: (lower triangle) + + . . . . . . + A(1,i),LDA-1, XTOP, XBOTTM ) + + Arguments + ========= + + LROWS - LOGICAL + If .TRUE., then DLAROT will rotate two rows. If .FALSE., + then it will rotate two columns. + Not modified. + + LLEFT - LOGICAL + If .TRUE., then XLEFT will be used instead of the + corresponding element of A for the first element in the + second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) + If .FALSE., then the corresponding element of A will be + used. + Not modified. + + LRIGHT - LOGICAL + If .TRUE., then XRIGHT will be used instead of the + corresponding element of A for the last element in the + first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If + + .FALSE., then the corresponding element of A will be used. + Not modified. + + NL - INTEGER + The length of the rows (if LROWS=.TRUE.) or columns (if + LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are + used, the columns/rows they are in should be included in + NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at + least 2. The number of rows/columns to be rotated + exclusive of those involving XLEFT and/or XRIGHT may + not be negative, i.e., NL minus how many of LLEFT and + LRIGHT are .TRUE. must be at least zero; if not, XERBLA + will be called. + Not modified. + + C, S - DOUBLE PRECISION + Specify the Givens rotation to be applied. If LROWS is + true, then the matrix ( c s ) + (-s c ) is applied from the left; + if false, then the transpose thereof is applied from the + right. For a Givens rotation, C**2 + S**2 should be 1, + but this is not checked. + Not modified. + + A - DOUBLE PRECISION array. + The array containing the rows/columns to be rotated. The + first element of A should be the upper left element to + be rotated. + Read and modified. + + LDA - INTEGER + The "effective" leading dimension of A. If A contains + a matrix stored in GE or SY format, then this is just + the leading dimension of A as dimensioned in the calling + routine. If A contains a matrix stored in band (GB or SB) + format, then this should be *one less* than the leading + dimension used in the calling routine. Thus, if + A were dimensioned A(LDA,*) in DLAROT, then A(1,j) would + be the j-th element in the first of the two rows + to be rotated, and A(2,j) would be the j-th in the second, + regardless of how the array may be stored in the calling + routine. [A cannot, however, actually be dimensioned thus, + + since for band format, the row number may exceed LDA, which + + is not legal FORTRAN.] + If LROWS=.TRUE., then LDA must be at least 1, otherwise + it must be at least NL minus the number of .TRUE. values + in XLEFT and XRIGHT. + Not modified. + + XLEFT - DOUBLE PRECISION + If LLEFT is .TRUE., then XLEFT will be used and modified + instead of A(2,1) (if LROWS=.TRUE.) or A(1,2) + (if LROWS=.FALSE.). + Read and modified. + + XRIGHT - DOUBLE PRECISION + If LRIGHT is .TRUE., then XRIGHT will be used and modified + instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1) + (if LROWS=.FALSE.). + Read and modified. + + ===================================================================== + + + + Set up indices, arrays for ends + + Parameter adjustments */ + --a; + + /* Function Body */ + if (*lrows) { + iinc = *lda; + inext = 1; + } else { + iinc = 1; + inext = *lda; + } + + if (*lleft) { + nt = 1; + ix = iinc + 1; + iy = *lda + 2; + xt[0] = a[1]; + yt[0] = *xleft; + } else { + nt = 0; + ix = 1; + iy = inext + 1; + } + + if (*lright) { + iyt = inext + 1 + (*nl - 1) * iinc; + ++nt; + xt[nt - 1] = *xright; + yt[nt - 1] = a[iyt]; + } + +/* Check for errors */ + + if (*nl < nt) { + xerbla_("DLAROT", &c__4); + return 0; + } + if (*lda <= 0 || ! (*lrows) && *lda < *nl - nt) { + xerbla_("DLAROT", &c__8); + return 0; + } + +/* Rotate */ + + i__1 = *nl - nt; + drot_(&i__1, &a[ix], &iinc, &a[iy], &iinc, c, s); + drot_(&nt, xt, &c__1, yt, &c__1, c, s); + +/* Stuff values back into XLEFT, XRIGHT, etc. */ + + if (*lleft) { + a[1] = xt[0]; + *xleft = yt[0]; + } + + if (*lright) { + *xright = xt[nt - 1]; + a[iyt] = yt[nt - 1]; + } + + return 0; + +/* End of DLAROT */ + +} /* dlarot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlartg.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlartg.c new file mode 100644 index 0000000..5763969 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlartg.c @@ -0,0 +1,158 @@ +#include "f2c.h" + +/* Subroutine */ int dlartg_(doublereal *f, doublereal *g, doublereal *cs, + doublereal *sn, doublereal *r) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLARTG generate a plane rotation so that + + [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. + [ -SN CS ] [ G ] [ 0 ] + + This is a slower, more accurate version of the BLAS1 routine DROTG, + with the following other differences: + F and G are unchanged on return. + If G=0, then CS=1 and SN=0. + If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any + floating point operations (saves work in DBDSQR when + there are zeros on the diagonal). + + If F exceeds G in magnitude, CS will be positive. + + Arguments + ========= + + F (input) DOUBLE PRECISION + The first component of vector to be rotated. + + G (input) DOUBLE PRECISION + The second component of vector to be rotated. + + CS (output) DOUBLE PRECISION + The cosine of the rotation. + + SN (output) DOUBLE PRECISION + The sine of the rotation. + + R (output) DOUBLE PRECISION + The nonzero component of the rotated vector. + + ===================================================================== +*/ + /* Initialized data */ + static logical first = TRUE_; + /* System generated locals */ + integer i__1; + doublereal d__1, d__2; + /* Builtin functions */ + double log(doublereal), pow_di(doublereal *, integer *), sqrt(doublereal); + /* Local variables */ + static integer i; + static doublereal scale; + static integer count; + static doublereal f1, g1, safmn2, safmx2; + extern doublereal dlamch_(char *); + static doublereal safmin, eps; + + + + if (first) { + first = FALSE_; + safmin = dlamch_("S"); + eps = dlamch_("E"); + d__1 = dlamch_("B"); + i__1 = (integer) (log(safmin / eps) / log(dlamch_("B")) / 2.); + safmn2 = pow_di(&d__1, &i__1); + safmx2 = 1. / safmn2; + } + if (*g == 0.) { + *cs = 1.; + *sn = 0.; + *r = *f; + } else if (*f == 0.) { + *cs = 0.; + *sn = 1.; + *r = *g; + } else { + f1 = *f; + g1 = *g; +/* Computing MAX */ + d__1 = abs(f1), d__2 = abs(g1); + scale = max(d__1,d__2); + if (scale >= safmx2) { + count = 0; +L10: + ++count; + f1 *= safmn2; + g1 *= safmn2; +/* Computing MAX */ + d__1 = abs(f1), d__2 = abs(g1); + scale = max(d__1,d__2); + if (scale >= safmx2) { + goto L10; + } +/* Computing 2nd power */ + d__1 = f1; +/* Computing 2nd power */ + d__2 = g1; + *r = sqrt(d__1 * d__1 + d__2 * d__2); + *cs = f1 / *r; + *sn = g1 / *r; + i__1 = count; + for (i = 1; i <= count; ++i) { + *r *= safmx2; +/* L20: */ + } + } else if (scale <= safmn2) { + count = 0; +L30: + ++count; + f1 *= safmx2; + g1 *= safmx2; +/* Computing MAX */ + d__1 = abs(f1), d__2 = abs(g1); + scale = max(d__1,d__2); + if (scale <= safmn2) { + goto L30; + } +/* Computing 2nd power */ + d__1 = f1; +/* Computing 2nd power */ + d__2 = g1; + *r = sqrt(d__1 * d__1 + d__2 * d__2); + *cs = f1 / *r; + *sn = g1 / *r; + i__1 = count; + for (i = 1; i <= count; ++i) { + *r *= safmn2; +/* L40: */ + } + } else { +/* Computing 2nd power */ + d__1 = f1; +/* Computing 2nd power */ + d__2 = g1; + *r = sqrt(d__1 * d__1 + d__2 * d__2); + *cs = f1 / *r; + *sn = g1 / *r; + } + if (abs(*f) > abs(*g) && *cs < 0.) { + *cs = -(*cs); + *sn = -(*sn); + *r = -(*r); + } + } + return 0; + +/* End of DLARTG */ + +} /* dlartg_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaruv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaruv.c new file mode 100644 index 0000000..41b4a01 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaruv.c @@ -0,0 +1,152 @@ +#include "f2c.h" + +/* Subroutine */ int dlaruv_(integer *iseed, integer *n, doublereal *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLARUV returns a vector of n random real numbers from a uniform (0,1) + + distribution (n <= 128). + + This is an auxiliary routine called by DLARNV and ZLARNV. + + Arguments + ========= + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. N <= 128. + + X (output) DOUBLE PRECISION array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine uses a multiplicative congruential method with modulus + 2**48 and multiplier 33952834046453 (see G.S.Fishman, + 'Multiplicative congruential random number generators with modulus + 2**b: an exhaustive analysis for b = 32 and a partial analysis for + b = 48', Math. Comp. 189, pp 331-344, 1990). + + 48-bit integers are stored in 4 integer array elements with 12 bits + per element. Hence the routine is portable across machines with + integers of 32 bits or more. + + ===================================================================== + + + + Parameter adjustments + Function Body */ + /* Initialized data */ + static integer mm[512] /* was [128][4] */ = { 494,2637,255,2008,1253, + 3344,4084,1739,3143,3468,688,1657,1238,3166,1292,3422,1270,2016, + 154,2862,697,1706,491,931,1444,444,3577,3944,2184,1661,3482,657, + 3023,3618,1267,1828,164,3798,3087,2400,2870,3876,1905,1593,1797, + 1234,3460,328,2861,1950,617,2070,3331,769,1558,2412,2800,189,287, + 2045,1227,2838,209,2770,3654,3993,192,2253,3491,2889,2857,2094, + 1818,688,1407,634,3231,815,3524,1914,516,164,303,2144,3480,119, + 3357,837,2826,2332,2089,3780,1700,3712,150,2000,3375,1621,3090, + 3765,1149,3146,33,3082,2741,359,3316,1749,185,2784,2202,2199,1364, + 1244,2020,3160,2785,2772,1217,1822,1245,2252,3904,2774,997,2573, + 1148,545,322,789,1440,752,2859,123,1848,643,2405,2638,2344,46, + 3814,913,3649,339,3808,822,2832,3078,3633,2970,637,2249,2081,4019, + 1478,242,481,2075,4058,622,3376,812,234,641,4005,1122,3135,2640, + 2302,40,1832,2247,2034,2637,1287,1691,496,1597,2394,2584,1843,336, + 1472,2407,433,2096,1761,2810,566,442,41,1238,1086,603,840,3168, + 1499,1084,3438,2408,1589,2391,288,26,512,1456,171,1677,2657,2270, + 2587,2961,1970,1817,676,1410,3723,2803,3185,184,663,499,3784,1631, + 1925,3912,1398,1349,1441,2224,2411,1907,3192,2786,382,37,759,2948, + 1862,3802,2423,2051,2295,1332,1832,2405,3638,3661,327,3660,716, + 1842,3987,1368,1848,2366,2508,3754,1766,3572,2893,307,1297,3966, + 758,2598,3406,2922,1038,2934,2091,2451,1580,1958,2055,1507,1078, + 3273,17,854,2916,3971,2889,3831,2621,1541,893,736,3992,787,2125, + 2364,2460,257,1574,3912,1216,3248,3401,2124,2762,149,2245,166,466, + 4018,1399,190,2879,153,2320,18,712,2159,2318,2091,3443,1510,449, + 1956,2201,3137,3399,1321,2271,3667,2703,629,2365,2431,1113,3922, + 2554,184,2099,3228,4012,1921,3452,3901,572,3309,3171,817,3039, + 1696,1256,3715,2077,3019,1497,1101,717,51,981,1978,1813,3881,76, + 3846,3694,1682,124,1660,3997,479,1141,886,3514,1301,3604,1888, + 1836,1990,2058,692,1194,20,3285,2046,2107,3508,3525,3801,2549, + 1145,2253,305,3301,1065,3133,2913,3285,1241,1197,3729,2501,1673, + 541,2753,949,2361,1165,4081,2725,3305,3069,3617,3733,409,2157, + 1361,3973,1865,2525,1409,3445,3577,77,3761,2149,1449,3005,225,85, + 3673,3117,3089,1349,2057,413,65,1845,697,3085,3441,1573,3689,2941, + 929,533,2841,4077,721,2821,2249,2397,2817,245,1913,1997,3121,997, + 1833,2877,1633,981,2009,941,2449,197,2441,285,1473,2741,3129,909, + 2801,421,4073,2813,2337,1429,1177,1901,81,1669,2633,2269,129,1141, + 249,3917,2481,3941,2217,2749,3041,1877,345,2861,1809,3141,2825, + 157,2881,3637,1465,2829,2161,3365,361,2685,3745,2325,3609,3821, + 3537,517,3017,2141,1537 }; + /* System generated locals */ + integer i__1; + /* Local variables */ + static integer i, i1, i2, i3, i4, it1, it2, it3, it4; + + +#define MM(I) mm[(I)] +#define WAS(I) was[(I)] +#define ISEED(I) iseed[(I)-1] +#define X(I) x[(I)-1] + + + + i1 = ISEED(1); + i2 = ISEED(2); + i3 = ISEED(3); + i4 = ISEED(4); + + i__1 = min(*n,128); + for (i = 1; i <= min(*n,128); ++i) { + +/* Multiply the seed by i-th power of the multiplier modulo 2** +48 */ + + it4 = i4 * MM(i + 383); + it3 = it4 / 4096; + it4 -= it3 << 12; + it3 = it3 + i3 * MM(i + 383) + i4 * MM(i + 255); + it2 = it3 / 4096; + it3 -= it2 << 12; + it2 = it2 + i2 * MM(i + 383) + i3 * MM(i + 255) + i4 * MM(i + 127); + it1 = it2 / 4096; + it2 -= it1 << 12; + it1 = it1 + i1 * MM(i + 383) + i2 * MM(i + 255) + i3 * MM(i + 127) + + i4 * MM(i - 1); + it1 %= 4096; + +/* Convert 48-bit integer to a real number in the interval (0,1 +) */ + + X(i) = ((doublereal) it1 + ((doublereal) it2 + ((doublereal) it3 + ( + doublereal) it4 * 2.44140625e-4) * 2.44140625e-4) * + 2.44140625e-4) * 2.44140625e-4; +/* L10: */ + } + +/* Return final value of seed */ + + ISEED(1) = it1; + ISEED(2) = it2; + ISEED(3) = it3; + ISEED(4) = it4; + return 0; + +/* End of DLARUV */ + +} /* dlaruv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaset.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaset.c new file mode 100644 index 0000000..064a99d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlaset.c @@ -0,0 +1,131 @@ +#include "f2c.h" + +/* Subroutine */ int dlaset_(char *uplo, integer *m, integer *n, doublereal * + alpha, doublereal *beta, doublereal *a, integer *lda) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + DLASET initializes an m-by-n matrix A to BETA on the diagonal and + ALPHA on the offdiagonals. + + Arguments + ========= + + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be set. + = 'U': Upper triangular part is set; the strictly lower + + triangular part of A is not changed. + = 'L': Lower triangular part is set; the strictly upper + + triangular part of A is not changed. + Otherwise: All of the matrix A is set. + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + ALPHA (input) DOUBLE PRECISION + The constant to which the offdiagonal elements are to be set. + + + BETA (input) DOUBLE PRECISION + The constant to which the diagonal elements are to be set. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On exit, the leading m-by-n submatrix of A is set as follows: + + + if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, + if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, + otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, + + and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ===================================================================== + + Function Body */ + /* System generated locals */ + integer i__1, i__2, i__3; + /* Local variables */ + static integer i, j; + extern logical lsame_(char *, char *); + + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + if (lsame_(uplo, "U")) { + +/* Set the strictly upper triangular or trapezoidal part of the + + array to ALPHA. */ + + i__1 = *n; + for (j = 2; j <= *n; ++j) { +/* Computing MIN */ + i__3 = j - 1; + i__2 = min(i__3,*m); + for (i = 1; i <= min(j-1,*m); ++i) { + A(i,j) = *alpha; +/* L10: */ + } +/* L20: */ + } + + } else if (lsame_(uplo, "L")) { + +/* Set the strictly lower triangular or trapezoidal part of the + + array to ALPHA. */ + + i__1 = min(*m,*n); + for (j = 1; j <= min(*m,*n); ++j) { + i__2 = *m; + for (i = j + 1; i <= *m; ++i) { + A(i,j) = *alpha; +/* L30: */ + } +/* L40: */ + } + + } else { + +/* Set the leading m-by-n submatrix to ALPHA. */ + + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) = *alpha; +/* L50: */ + } +/* L60: */ + } + } + +/* Set the first min(M,N) diagonal elements to BETA. */ + + i__1 = min(*m,*n); + for (i = 1; i <= min(*m,*n); ++i) { + A(i,i) = *beta; +/* L70: */ + } + + return 0; + +/* End of DLASET */ + +} /* dlaset_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatb4.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatb4.c new file mode 100644 index 0000000..a1f4399 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatb4.c @@ -0,0 +1,464 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include +#include "f2c.h" + +/* Table of constant values */ + +static integer c__2 = 2; + +/* Subroutine */ int dlatb4_(char *path, integer *imat, integer *m, integer * + n, char *type, integer *kl, integer *ku, doublereal *anorm, integer * + mode, doublereal *cndnum, char *dist) +{ + /* Initialized data */ + + static logical first = TRUE_; + + /* System generated locals */ + integer i__1; + + /* Builtin functions */ + double sqrt(doublereal); + + /* Local variables */ + static doublereal badc1, badc2, large, small; + static char c2[2]; + extern /* Subroutine */ int dlabad_(doublereal *, doublereal *); + extern doublereal dlamch_(char *); + extern logical lsamen_(integer *, char *, char *); + static integer mat; + static doublereal eps; + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + Purpose + ======= + + DLATB4 sets parameters for the matrix generator based on the type of + + matrix to be generated. + + Arguments + ========= + + PATH (input) CHARACTER*3 + The LAPACK path name. + + IMAT (input) INTEGER + An integer key describing which matrix to generate for this + path. + + M (input) INTEGER + The number of rows in the matrix to be generated. + + N (input) INTEGER + The number of columns in the matrix to be generated. + + TYPE (output) CHARACTER*1 + The type of the matrix to be generated: + = 'S': symmetric matrix + = 'P': symmetric positive (semi)definite matrix + = 'N': nonsymmetric matrix + + KL (output) INTEGER + The lower band width of the matrix to be generated. + + KU (output) INTEGER + The upper band width of the matrix to be generated. + + ANORM (output) DOUBLE PRECISION + The desired norm of the matrix to be generated. The diagonal + + matrix of singular values or eigenvalues is scaled by this + value. + + MODE (output) INTEGER + A key indicating how to choose the vector of eigenvalues. + + CNDNUM (output) DOUBLE PRECISION + The desired condition number. + + DIST (output) CHARACTER*1 + The type of distribution to be used by the random number + generator. + + ===================================================================== + + + + Set some constants for use in the subroutine. */ + + if (first) { + first = FALSE_; + eps = dlamch_("Precision"); + badc2 = .1 / eps; + badc1 = sqrt(badc2); + small = dlamch_("Safe minimum"); + large = 1. / small; + +/* If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + + dlabad_(&small, &large); + small = small / eps * .25; + large = 1. / small; + } + + strncpy(c2, path + 1, 2); + +/* Set some parameters we don't plan to change. */ + + *(unsigned char *)dist = 'S'; + *mode = 3; + + if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2, "LQ") + || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) { + +/* xQR, xLQ, xQL, xRQ: Set parameters to generate a general + M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GE")) { + +/* xGE: Set parameters to generate a general M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 8) { + *cndnum = badc1; + } else if (*imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 10) { + *anorm = small; + } else if (*imat == 11) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GB")) { + +/* xGB: Set parameters to generate a general banded matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2 * .1; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GT")) { + +/* xGT: Set parameters to generate a general tridiagonal matri +x. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&c__2, c2, "PP") || lsamen_(&c__2, c2, "SY") || lsamen_(&c__2, c2, + "SP")) { + +/* xPO, xPP, xSY, xSP: Set parameters to generate a + symmetric matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = *(unsigned char *)c2; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 6) { + *cndnum = badc1; + } else if (*imat == 7) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 8) { + *anorm = small; + } else if (*imat == 9) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PB")) { + +/* xPB: Set parameters to generate a symmetric band matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'P'; + +/* Set the norm and condition number. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PT")) { + +/* xPT: Set parameters to generate a symmetric positive defini +te + tridiagonal matrix. */ + + *(unsigned char *)type = 'P'; + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&c__2, c2, "TP")) { + +/* xTR, xTP: Set parameters to generate a triangular matrix + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + mat = abs(*imat); + if (mat == 1 || mat == 7) { + *kl = 0; + *ku = 0; + } else if (*imat < 0) { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + *ku = 0; + } else { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (mat == 3 || mat == 9) { + *cndnum = badc1; + } else if (mat == 4) { + *cndnum = badc2; + } else if (mat == 10) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (mat == 5) { + *anorm = small; + } else if (mat == 6) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "TB")) { + +/* xTB: Set parameters to generate a triangular band matrix. + + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the norm and condition number. */ + + if (*imat == 2 || *imat == 8) { + *cndnum = badc1; + } else if (*imat == 3 || *imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 4) { + *anorm = small; + } else if (*imat == 5) { + *anorm = large; + } else { + *anorm = 1.; + } + } + if (*n <= 1) { + *cndnum = 1.; + } + + return 0; + +/* End of DLATB4 */ + +} /* dlatb4_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm1.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm1.c new file mode 100644 index 0000000..bbd69fb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm1.c @@ -0,0 +1,266 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int dlatm1_(integer *mode, doublereal *cond, integer *irsign, + integer *idist, integer *iseed, doublereal *d, integer *n, integer * + info) +{ + /* System generated locals */ + integer i__1, i__2; + doublereal d__1; + + /* Builtin functions */ + double pow_dd(doublereal *, doublereal *), pow_di(doublereal *, integer *) + , log(doublereal), exp(doublereal); + + /* Local variables */ + static doublereal temp; + static integer i; + static doublereal alpha; + extern doublereal dlaran_(integer *); + extern /* Subroutine */ int xerbla_(char *, integer *), dlarnv_( + integer *, integer *, integer *, doublereal *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLATM1 computes the entries of D(1..N) as specified by + MODE, COND and IRSIGN. IDIST and ISEED determine the generation + of random numbers. DLATM1 is called by SLATMR to generate + random test matrices for LAPACK programs. + + Arguments + ========= + + MODE - INTEGER + On entry describes how D is to be computed: + MODE = 0 means do not change D. + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - DOUBLE PRECISION + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + IRSIGN - INTEGER + On entry, if MODE neither -6, 0 nor 6, determines sign of + entries of D + 0 => leave entries of D unchanged + 1 => multiply each entry of D by 1 or -1 with probability .5 + + + IDIST - CHARACTER*1 + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. The random number generator uses a + linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to DLATM1 + to continue the same random number sequence. + Changed on exit. + + D - DOUBLE PRECISION array, dimension ( MIN( M , N ) ) + Array to be computed according to MODE, COND and IRSIGN. + May be changed on exit if MODE is nonzero. + + N - INTEGER + Number of entries of D. Not modified. + + INFO - INTEGER + 0 => normal termination + -1 => if MODE not in range -6 to 6 + -2 => if MODE neither -6, 0 nor 6, and + IRSIGN neither 0 nor 1 + -3 => if MODE neither -6, 0 nor 6 and COND less than 1 + -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3 + + -7 => if N negative + + ===================================================================== + + + + Decode and Test the input parameters. Initialize flags & seed. + + Parameter adjustments */ + --d; + --iseed; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Set INFO if an error */ + + if (*mode < -6 || *mode > 6) { + *info = -1; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && (*irsign != 0 && * + irsign != 1)) { + *info = -2; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.) { + *info = -3; + } else if ((*mode == 6 || *mode == -6) && (*idist < 1 || *idist > 3)) { + *info = -4; + } else if (*n < 0) { + *info = -7; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("DLATM1", &i__1); + return 0; + } + +/* Compute D according to COND and MODE */ + + if (*mode != 0) { + switch (abs(*mode)) { + case 1: goto L10; + case 2: goto L30; + case 3: goto L50; + case 4: goto L70; + case 5: goto L90; + case 6: goto L110; + } + +/* One large D value: */ + +L10: + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = 1. / *cond; +/* L20: */ + } + d[1] = 1.; + goto L120; + +/* One small D value: */ + +L30: + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = 1.; +/* L40: */ + } + d[*n] = 1. / *cond; + goto L120; + +/* Exponentially distributed D values: */ + +L50: + d[1] = 1.; + if (*n > 1) { + d__1 = -1. / (doublereal) (*n - 1); + alpha = pow_dd(cond, &d__1); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { + i__2 = i - 1; + d[i] = pow_di(&alpha, &i__2); +/* L60: */ + } + } + goto L120; + +/* Arithmetically distributed D values: */ + +L70: + d[1] = 1.; + if (*n > 1) { + temp = 1. / *cond; + alpha = (1. - temp) / (doublereal) (*n - 1); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { + d[i] = (doublereal) (*n - i) * alpha + temp; +/* L80: */ + } + } + goto L120; + +/* Randomly distributed D values on ( 1/COND , 1): */ + +L90: + alpha = log(1. / *cond); + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = exp(alpha * dlaran_(&iseed[1])); +/* L100: */ + } + goto L120; + +/* Randomly distributed D values from IDIST */ + +L110: + dlarnv_(idist, &iseed[1], n, &d[1]); + +L120: + +/* If MODE neither -6 nor 0 nor 6, and IRSIGN = 1, assign + random signs to D */ + + if (*mode != -6 && *mode != 0 && *mode != 6 && *irsign == 1) { + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + temp = dlaran_(&iseed[1]); + if (temp > .5) { + d[i] = -d[i]; + } +/* L130: */ + } + } + +/* Reverse if MODE < 0 */ + + if (*mode < 0) { + i__1 = *n / 2; + for (i = 1; i <= i__1; ++i) { + temp = d[i]; + d[i] = d[*n + 1 - i]; + d[*n + 1 - i] = temp; +/* L140: */ + } + } + + } + + return 0; + +/* End of DLATM1 */ + +} /* dlatm1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm2.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm2.c new file mode 100644 index 0000000..b4f2b28 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm2.c @@ -0,0 +1,241 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dlatm2_(integer *m, integer *n, integer *i, integer *j, integer * + kl, integer *ku, integer *idist, integer *iseed, doublereal *d, + integer *igrade, doublereal *dl, doublereal *dr, integer *ipvtng, + integer *iwork, doublereal *sparse) +{ + /* System generated locals */ + doublereal ret_val; + + /* Local variables */ + static integer isub, jsub; + static doublereal temp; + extern doublereal dlaran_(integer *), dlarnd_(integer *, integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + DLATM2 returns the (I,J) entry of a random matrix of dimension + (M, N) described by the other paramters. It is called by the + DLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by DLATMR which has already checked the parameters. + + Use of DLATM2 differs from SLATM3 in the order in which the random + + number generator is called to fill in random matrix entries. + With DLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With DLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, DLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. DLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + + The matrix whose (I,J) entry is returned is constructed as + follows (this routine only computes one entry): + + If I is outside (1..M) or J is outside (1..N), return zero + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of entry to be returned. Not modified. + + J - INTEGER + Column of entry to be returned. Not modified. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - DOUBLE PRECISION array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - DOUBLE PRECISION array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - DOUBLE PRECISION array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) in position K was originally in + position IWORK( K ). + This differs from IWORK for DLATM3. Not modified. + + SPARSE - DOUBLE PRECISION between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + ret_val = 0.; + return ret_val; + } + +/* Check for banding */ + + if (*j > *i + *ku || *j < *i - *kl) { + ret_val = 0.; + return ret_val; + } + +/* Check for sparsity */ + + if (*sparse > 0.) { + if (dlaran_(&iseed[1]) < *sparse) { + ret_val = 0.; + return ret_val; + } + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + isub = *i; + jsub = *j; + } else if (*ipvtng == 1) { + isub = iwork[*i]; + jsub = *j; + } else if (*ipvtng == 2) { + isub = *i; + jsub = iwork[*j]; + } else if (*ipvtng == 3) { + isub = iwork[*i]; + jsub = iwork[*j]; + } + +/* Compute entry and grade it according to IGRADE */ + + if (isub == jsub) { + temp = d[isub]; + } else { + temp = dlarnd_(idist, &iseed[1]); + } + if (*igrade == 1) { + temp *= dl[isub]; + } else if (*igrade == 2) { + temp *= dr[jsub]; + } else if (*igrade == 3) { + temp = temp * dl[isub] * dr[jsub]; + } else if (*igrade == 4 && isub != jsub) { + temp = temp * dl[isub] / dl[jsub]; + } else if (*igrade == 5) { + temp = temp * dl[isub] * dl[jsub]; + } + ret_val = temp; + return ret_val; + +/* End of DLATM2 */ + +} /* dlatm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm3.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm3.c new file mode 100644 index 0000000..1302755 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatm3.c @@ -0,0 +1,252 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal dlatm3_(integer *m, integer *n, integer *i, integer *j, integer * + isub, integer *jsub, integer *kl, integer *ku, integer *idist, + integer *iseed, doublereal *d, integer *igrade, doublereal *dl, + doublereal *dr, integer *ipvtng, integer *iwork, doublereal *sparse) +{ + /* System generated locals */ + doublereal ret_val; + + /* Local variables */ + static doublereal temp; + extern doublereal dlaran_(integer *), dlarnd_(integer *, integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + DLATM3 returns the (ISUB,JSUB) entry of a random matrix of + dimension (M, N) described by the other paramters. (ISUB,JSUB) + is the final position of the (I,J) entry after pivoting + according to IPVTNG and IWORK. DLATM3 is called by the + DLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by DLATMR which has already checked the parameters. + + Use of DLATM3 differs from SLATM2 in the order in which the random + + number generator is called to fill in random matrix entries. + With DLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With DLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, DLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. DLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + in different orders for different pivot orders). + + The matrix whose (ISUB,JSUB) entry is returned is constructed as + follows (this routine only computes one entry): + + If ISUB is outside (1..M) or JSUB is outside (1..N), return zero + + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of unpivoted entry to be returned. Not modified. + + J - INTEGER + Column of unpivoted entry to be returned. Not modified. + + ISUB - INTEGER + Row of pivoted entry to be returned. Changed on exit. + + JSUB - INTEGER + Column of pivoted entry to be returned. Changed on exit. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - DOUBLE PRECISION array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - DOUBLE PRECISION array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - DOUBLE PRECISION array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) originally in position K is in + position IWORK( K ) after pivoting. + This differs from IWORK for DLATM2. Not modified. + + SPARSE - DOUBLE PRECISION between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + *isub = *i; + *jsub = *j; + ret_val = 0.; + return ret_val; + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + *isub = *i; + *jsub = *j; + } else if (*ipvtng == 1) { + *isub = iwork[*i]; + *jsub = *j; + } else if (*ipvtng == 2) { + *isub = *i; + *jsub = iwork[*j]; + } else if (*ipvtng == 3) { + *isub = iwork[*i]; + *jsub = iwork[*j]; + } + +/* Check for banding */ + + if (*jsub > *isub + *ku || *jsub < *isub - *kl) { + ret_val = 0.; + return ret_val; + } + +/* Check for sparsity */ + + if (*sparse > 0.) { + if (dlaran_(&iseed[1]) < *sparse) { + ret_val = 0.; + return ret_val; + } + } + +/* Compute entry and grade it according to IGRADE */ + + if (*i == *j) { + temp = d[*i]; + } else { + temp = dlarnd_(idist, &iseed[1]); + } + if (*igrade == 1) { + temp *= dl[*i]; + } else if (*igrade == 2) { + temp *= dr[*j]; + } else if (*igrade == 3) { + temp = temp * dl[*i] * dr[*j]; + } else if (*igrade == 4 && *i != *j) { + temp = temp * dl[*i] / dl[*j]; + } else if (*igrade == 5) { + temp = temp * dl[*i] * dl[*j]; + } + ret_val = temp; + return ret_val; + +/* End of DLATM3 */ + +} /* dlatm3_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatme.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatme.c new file mode 100644 index 0000000..33a15b4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatme.c @@ -0,0 +1,682 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__1 = 1; +static doublereal c_b23 = 0.; +static integer c__0 = 0; +static doublereal c_b39 = 1.; + +/* Subroutine */ int dlatme_(integer *n, char *dist, integer *iseed, + doublereal *d, integer *mode, doublereal *cond, doublereal *dmax__, + char *ei, char *rsign, char *upper, char *sim, doublereal *ds, + integer *modes, doublereal *conds, integer *kl, integer *ku, + doublereal *anorm, doublereal *a, integer *lda, doublereal *work, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + doublereal d__1, d__2, d__3; + + /* Local variables */ + static logical bads; + extern /* Subroutine */ int dger_(integer *, integer *, doublereal *, + doublereal *, integer *, doublereal *, integer *, doublereal *, + integer *); + static integer isim; + static doublereal temp; + static logical badei; + static integer i, j; + static doublereal alpha; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *); + extern logical lsame_(char *, char *); + extern /* Subroutine */ int dgemv_(char *, integer *, integer *, + doublereal *, doublereal *, integer *, doublereal *, integer *, + doublereal *, doublereal *, integer *); + static integer iinfo; + static doublereal tempa[1]; + static integer icols; + static logical useei; + static integer idist; + extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *, + doublereal *, integer *); + static integer irows; + extern /* Subroutine */ int dlatm1_(integer *, doublereal *, integer *, + integer *, integer *, doublereal *, integer *, integer *); + static integer ic, jc; + extern doublereal dlange_(char *, integer *, integer *, doublereal *, + integer *, doublereal *); + static integer ir, jr; + extern /* Subroutine */ int dlarge_(integer *, doublereal *, integer *, + integer *, doublereal *, integer *), dlarfg_(integer *, + doublereal *, doublereal *, integer *, doublereal *); + extern doublereal dlaran_(integer *); + extern /* Subroutine */ int dlaset_(char *, integer *, integer *, + doublereal *, doublereal *, doublereal *, integer *), + xerbla_(char *, integer *), dlarnv_(integer *, integer *, + integer *, doublereal *); + static integer irsign, iupper; + static doublereal xnorms; + static integer jcr; + static doublereal tau; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLATME generates random non-symmetric square matrices with + specified eigenvalues for testing LAPACK programs. + + DLATME operates by applying the following sequence of + operations: + + 1. Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and RSIGN + as described below. + + 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R', + or MODE=5), certain pairs of adjacent elements of D are + interpreted as the real and complex parts of a complex + conjugate pair; A thus becomes block diagonal, with 1x1 + and 2x2 blocks. + + 3. If UPPER='T', the upper triangle of A is set to random values + out of distribution DIST. + + 4. If SIM='T', A is multiplied on the left by a random matrix + X, whose singular values are specified by DS, MODES, and + CONDS, and on the right by X inverse. + + 5. If KL < N-1, the lower bandwidth is reduced to KL using + Householder transformations. If KU < N-1, the upper + bandwidth is reduced to KU. + + 6. If ANORM is not negative, the matrix is scaled to have + maximum-element-norm ANORM. + + (Note: since the matrix cannot be reduced beyond Hessenberg form, + + no packing options are available.) + + Arguments + ========= + + N - INTEGER + The number of columns (or rows) of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values, and for the + upper triangle (see UPPER). + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to DLATME + to continue the same random number sequence. + Changed on exit. + + D - DOUBLE PRECISION array, dimension ( N ) + This array is used to specify the eigenvalues of A. If + MODE=0, then D is assumed to contain the eigenvalues (but + see the description of EI), otherwise they will be + computed according to MODE, COND, DMAX, and RSIGN and + placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the eigenvalues are to + be specified: + MODE = 0 means use D (with EI) as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. Each odd-even pair + of elements will be either used as two real + eigenvalues or as the real and imaginary part + of a complex conjugate pair of eigenvalues; + the choice of which is done is random, with + 50-50 probability, for each pair. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is between 1 and 4, D has entries ranging + from 1 to 1/COND, if between -1 and -4, D has entries + ranging from 1/COND to 1, + Not modified. + + COND - DOUBLE PRECISION + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - DOUBLE PRECISION + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))). Note that DMAX need not be + positive: if DMAX is negative (or zero), D will be + scaled by a negative number (or zero). + Not modified. + + EI - CHARACTER*1 array, dimension ( N ) + If MODE is 0, and EI(1) is not ' ' (space character), + this array specifies which elements of D (on input) are + real eigenvalues and which are the real and imaginary parts + + of a complex conjugate pair of eigenvalues. The elements + of EI may then only have the values 'R' and 'I'. If + EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is + CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex + conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th + eigenvalue is D(j) (i.e., real). EI(1) may not be 'I', + nor may two adjacent elements of EI both have the value 'I'. + + If MODE is not 0, then EI is ignored. If MODE is 0 and + EI(1)=' ', then the eigenvalues will all be real. + Not modified. + + RSIGN - CHARACTER*1 + If MODE is not 0, 6, or -6, and RSIGN='T', then the + elements of D, as computed according to MODE and COND, will + + be multiplied by a random sign (+1 or -1). If RSIGN='F', + they will not be. RSIGN may only have the values 'T' or + 'F'. + Not modified. + + UPPER - CHARACTER*1 + If UPPER='T', then the elements of A above the diagonal + (and above the 2x2 diagonal blocks, if A has complex + eigenvalues) will be set to random numbers out of DIST. + If UPPER='F', they will not. UPPER may only have the + values 'T' or 'F'. + Not modified. + + SIM - CHARACTER*1 + If SIM='T', then A will be operated on by a "similarity + transform", i.e., multiplied on the left by a matrix X and + on the right by X inverse. X = U S V, where U and V are + random unitary matrices and S is a (diagonal) matrix of + singular values specified by DS, MODES, and CONDS. If + SIM='F', then A will not be transformed. + Not modified. + + DS - DOUBLE PRECISION array, dimension ( N ) + This array is used to specify the singular values of X, + in the same way that D specifies the eigenvalues of A. + If MODE=0, the DS contains the singular values, which + may not be zero. + Modified if MODE is nonzero. + + MODES - INTEGER + CONDS - DOUBLE PRECISION + Same as MODE and COND, but for specifying the diagonal + of S. MODES=-6 and +6 are not allowed (since they would + result in randomly ill-conditioned eigenvalues.) + + KL - INTEGER + This specifies the lower bandwidth of the matrix. KL=1 + specifies upper Hessenberg form. If KL is at least N-1, + then A will have full lower bandwidth. KL must be at + least 1. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. KU=1 + specifies lower Hessenberg form. If KU is at least N-1, + then A will have full upper bandwidth; if KU and KL + are both at least N-1, then A will be dense. Only one of + KU and KL may be less than N-1. KU must be at least 1. + Not modified. + + ANORM - DOUBLE PRECISION + If ANORM is not negative, then A will be scaled by a non- + negative real number to make the maximum-element-norm of A + to be ANORM. + Not modified. + + A - DOUBLE PRECISION array, dimension ( LDA, N ) + On exit A is the desired test matrix. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. LDA must be at least N. + Not modified. + + WORK - DOUBLE PRECISION array, dimension ( 3*N ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => N negative + -2 => DIST illegal string + -5 => MODE not in range -6 to 6 + -6 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or + + two adjacent elements of EI are 'I'. + -9 => RSIGN is not 'T' or 'F' + -10 => UPPER is not 'T' or 'F' + -11 => SIM is not 'T' or 'F' + -12 => MODES=0 and DS has a zero singular value. + -13 => MODES is not in the range -5 to 5. + -14 => MODES is nonzero and CONDS is less than 1. + -15 => KL is less than 1. + -16 => KU is less than 1, or KL and KU are both less than + N-1. + -19 => LDA is less than N. + 1 => Error return from DLATM1 (computing D) + 2 => Cannot scale to DMAX (max. eigenvalue is 0) + 3 => Error return from DLATM1 (computing DS) + 4 => Error return from DLARGE + 5 => Zero singular value from DLATM1. + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --ei; + --ds; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Check EI */ + + useei = TRUE_; + badei = FALSE_; + if (lsame_(ei + 1, " ") || *mode != 0) { + useei = FALSE_; + } else { + if (lsame_(ei + 1, "R")) { + i__1 = *n; + for (j = 2; j <= i__1; ++j) { + if (lsame_(ei + j, "I")) { + if (lsame_(ei + (j - 1), "I")) { + badei = TRUE_; + } + } else { + if (! lsame_(ei + j, "R")) { + badei = TRUE_; + } + } +/* L10: */ + } + } else { + badei = TRUE_; + } + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "T")) { + irsign = 1; + } else if (lsame_(rsign, "F")) { + irsign = 0; + } else { + irsign = -1; + } + +/* Decode UPPER */ + + if (lsame_(upper, "T")) { + iupper = 1; + } else if (lsame_(upper, "F")) { + iupper = 0; + } else { + iupper = -1; + } + +/* Decode SIM */ + + if (lsame_(sim, "T")) { + isim = 1; + } else if (lsame_(sim, "F")) { + isim = 0; + } else { + isim = -1; + } + +/* Check DS, if MODES=0 and ISIM=1 */ + + bads = FALSE_; + if (*modes == 0 && isim == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (ds[j] == 0.) { + bads = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*n < 0) { + *info = -1; + } else if (idist == -1) { + *info = -2; + } else if (abs(*mode) > 6) { + *info = -5; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.) { + *info = -6; + } else if (badei) { + *info = -8; + } else if (irsign == -1) { + *info = -9; + } else if (iupper == -1) { + *info = -10; + } else if (isim == -1) { + *info = -11; + } else if (bads) { + *info = -12; + } else if (isim == 1 && abs(*modes) > 5) { + *info = -13; + } else if (isim == 1 && *modes != 0 && *conds < 1.) { + *info = -14; + } else if (*kl < 1) { + *info = -15; + } else if (*ku < 1 || *ku < *n - 1 && *kl < *n - 1) { + *info = -16; + } else if (*lda < max(1,*n)) { + *info = -19; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("DLATME", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up diagonal of A + + Compute D according to COND and MODE */ + + dlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], n, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = abs(d[1]); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__2 = temp, d__3 = (d__1 = d[i], abs(d__1)); + temp = max(d__2,d__3); +/* L40: */ + } + + if (temp > 0.) { + alpha = *dmax__ / temp; + } else if (*dmax__ != 0.) { + *info = 2; + return 0; + } else { + alpha = 0.; + } + + dscal_(n, &alpha, &d[1], &c__1); + + } + + dlaset_("Full", n, n, &c_b23, &c_b23, &a[a_offset], lda); + i__1 = *lda + 1; + dcopy_(n, &d[1], &c__1, &a[a_offset], &i__1); + +/* Set up complex conjugate pairs */ + + if (*mode == 0) { + if (useei) { + i__1 = *n; + for (j = 2; j <= i__1; ++j) { + if (lsame_(ei + j, "I")) { + a[j - 1 + j * a_dim1] = a[j + j * a_dim1]; + a[j + (j - 1) * a_dim1] = -a[j + j * a_dim1]; + a[j + j * a_dim1] = a[j - 1 + (j - 1) * a_dim1]; + } +/* L50: */ + } + } + + } else if (abs(*mode) == 5) { + + i__1 = *n; + for (j = 2; j <= i__1; j += 2) { + if (dlaran_(&iseed[1]) > .5) { + a[j - 1 + j * a_dim1] = a[j + j * a_dim1]; + a[j + (j - 1) * a_dim1] = -a[j + j * a_dim1]; + a[j + j * a_dim1] = a[j - 1 + (j - 1) * a_dim1]; + } +/* L60: */ + } + } + +/* 3) If UPPER='T', set upper triangle of A to random numbers. + (but don't modify the corners of 2x2 blocks.) */ + + if (iupper != 0) { + i__1 = *n; + for (jc = 2; jc <= i__1; ++jc) { + if (a[jc - 1 + jc * a_dim1] != 0.) { + jr = jc - 2; + } else { + jr = jc - 1; + } + dlarnv_(&idist, &iseed[1], &jr, &a[jc * a_dim1 + 1]); +/* L70: */ + } + } + +/* 4) If SIM='T', apply similarity transformation. + + -1 + Transform is X A X , where X = U S V, thus + + it is U S V A V' (1/S) U' */ + + if (isim != 0) { + +/* Compute S (singular values of the eigenvector matrix) + according to CONDS and MODES */ + + dlatm1_(modes, conds, &c__0, &c__0, &iseed[1], &ds[1], n, &iinfo); + if (iinfo != 0) { + *info = 3; + return 0; + } + +/* Multiply by V and V' */ + + dlarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + +/* Multiply by S and (1/S) */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + dscal_(n, &ds[j], &a[j + a_dim1], lda); + if (ds[j] != 0.) { + d__1 = 1. / ds[j]; + dscal_(n, &d__1, &a[j * a_dim1 + 1], &c__1); + } else { + *info = 5; + return 0; + } +/* L80: */ + } + +/* Multiply by U and U' */ + + dlarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + } + +/* 5) Reduce the bandwidth. */ + + if (*kl < *n - 1) { + +/* Reduce bandwidth -- kill column */ + + i__1 = *n - 1; + for (jcr = *kl + 1; jcr <= i__1; ++jcr) { + ic = jcr - *kl; + irows = *n + 1 - jcr; + icols = *n + *kl - jcr; + + dcopy_(&irows, &a[jcr + ic * a_dim1], &c__1, &work[1], &c__1); + xnorms = work[1]; + dlarfg_(&irows, &xnorms, &work[2], &c__1, &tau); + work[1] = 1.; + + dgemv_("T", &irows, &icols, &c_b39, &a[jcr + (ic + 1) * a_dim1], + lda, &work[1], &c__1, &c_b23, &work[irows + 1], &c__1) + ; + d__1 = -tau; + dger_(&irows, &icols, &d__1, &work[1], &c__1, &work[irows + 1], & + c__1, &a[jcr + (ic + 1) * a_dim1], lda); + + dgemv_("N", n, &irows, &c_b39, &a[jcr * a_dim1 + 1], lda, &work[1] + , &c__1, &c_b23, &work[irows + 1], &c__1); + d__1 = -tau; + dger_(n, &irows, &d__1, &work[irows + 1], &c__1, &work[1], &c__1, + &a[jcr * a_dim1 + 1], lda); + + a[jcr + ic * a_dim1] = xnorms; + i__2 = irows - 1; + dlaset_("Full", &i__2, &c__1, &c_b23, &c_b23, &a[jcr + 1 + ic * + a_dim1], lda); +/* L90: */ + } + } else if (*ku < *n - 1) { + +/* Reduce upper bandwidth -- kill a row at a time. */ + + i__1 = *n - 1; + for (jcr = *ku + 1; jcr <= i__1; ++jcr) { + ir = jcr - *ku; + irows = *n + *ku - jcr; + icols = *n + 1 - jcr; + + dcopy_(&icols, &a[ir + jcr * a_dim1], lda, &work[1], &c__1); + xnorms = work[1]; + dlarfg_(&icols, &xnorms, &work[2], &c__1, &tau); + work[1] = 1.; + + dgemv_("N", &irows, &icols, &c_b39, &a[ir + 1 + jcr * a_dim1], + lda, &work[1], &c__1, &c_b23, &work[icols + 1], &c__1) + ; + d__1 = -tau; + dger_(&irows, &icols, &d__1, &work[icols + 1], &c__1, &work[1], & + c__1, &a[ir + 1 + jcr * a_dim1], lda); + + dgemv_("C", &icols, n, &c_b39, &a[jcr + a_dim1], lda, &work[1], & + c__1, &c_b23, &work[icols + 1], &c__1); + d__1 = -tau; + dger_(&icols, n, &d__1, &work[1], &c__1, &work[icols + 1], &c__1, + &a[jcr + a_dim1], lda); + + a[ir + jcr * a_dim1] = xnorms; + i__2 = icols - 1; + dlaset_("Full", &c__1, &i__2, &c_b23, &c_b23, &a[ir + (jcr + 1) * + a_dim1], lda); +/* L100: */ + } + } + +/* Scale the matrix to have norm ANORM */ + + if (*anorm >= 0.) { + temp = dlange_("M", n, n, &a[a_offset], lda, tempa); + if (temp > 0.) { + alpha = *anorm / temp; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + dscal_(n, &alpha, &a[j * a_dim1 + 1], &c__1); +/* L110: */ + } + } + } + + return 0; + +/* End of DLATME */ + +} /* dlatme_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatmr.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatmr.c new file mode 100644 index 0000000..7998df1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatmr.c @@ -0,0 +1,1288 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__0 = 0; +static integer c__1 = 1; + +/* Subroutine */ int dlatmr_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, doublereal *d, integer *mode, doublereal *cond, + doublereal *dmax__, char *rsign, char *grade, doublereal *dl, integer + *model, doublereal *condl, doublereal *dr, integer *moder, doublereal + *condr, char *pivtng, integer *ipivot, integer *kl, integer *ku, + doublereal *sparse, doublereal *anorm, char *pack, doublereal *a, + integer *lda, integer *iwork, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + doublereal d__1, d__2, d__3; + + /* Local variables */ + static integer isub, jsub; + static doublereal temp; + static integer isym, i, j, k; + static doublereal alpha; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *); + static integer ipack; + extern logical lsame_(char *, char *); + static doublereal tempa[1]; + static integer iisub, idist, jjsub, mnmin; + static logical dzero; + static integer mnsub; + static doublereal onorm; + static integer mxsub, npvts; + extern /* Subroutine */ int dlatm1_(integer *, doublereal *, integer *, + integer *, integer *, doublereal *, integer *, integer *); + extern doublereal dlatm2_(integer *, integer *, integer *, integer *, + integer *, integer *, integer *, integer *, doublereal *, integer + *, doublereal *, doublereal *, integer *, integer *, doublereal *) + , dlatm3_(integer *, integer *, integer *, integer *, integer *, + integer *, integer *, integer *, integer *, integer *, doublereal + *, integer *, doublereal *, doublereal *, integer *, integer *, + doublereal *), dlangb_(char *, integer *, integer *, integer *, + doublereal *, integer *, doublereal *), dlange_(char *, + integer *, integer *, doublereal *, integer *, doublereal *); + static integer igrade; + extern doublereal dlansb_(char *, char *, integer *, integer *, + doublereal *, integer *, doublereal *); + static logical fulbnd; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical badpvt; + extern doublereal dlansp_(char *, char *, integer *, doublereal *, + doublereal *), dlansy_(char *, char *, integer *, + doublereal *, integer *, doublereal *); + static integer irsign, ipvtng, kll, kuu; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + DLATMR generates random matrices of various types for testing + LAPACK programs. + + DLATMR operates by applying the following sequence of + operations: + + Generate a matrix A with random entries of distribution DIST + which is symmetric if SYM='S', and nonsymmetric + if SYM='N'. + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX and RSIGN + as described below. + + Grade the matrix, if desired, from the left and/or right + as specified by GRADE. The inputs DL, MODEL, CONDL, DR, + MODER and CONDR also determine the grading as described + below. + + Permute, if desired, the rows and/or columns as specified by + PIVTNG and IPIVOT. + + Set random entries to zero, if desired, to get a random sparse + matrix as specified by SPARSE. + + Make A a band matrix, if desired, by zeroing out the matrix + outside a band of lower bandwidth KL and upper bandwidth KU. + + + Scale A, if desired, to have maximum entry ANORM. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric) + zero out lower half (if symmetric) + store the upper half columnwise (if symmetric or + square upper triangular) + store the lower half columnwise (if symmetric or + square lower triangular) + same as upper half rowwise if symmetric + store the lower triangle in banded format (if symmetric) + store the upper triangle in banded format (if symmetric) + store the entire matrix in banded format + + Note: If two calls to DLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + + If two calls to DLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be and + is not maintained with less than full bandwidth. + + Arguments + ========= + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate a random matrix . + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to DLATMR + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S' or 'H', generated matrix is symmetric. + If SYM='N', generated matrix is nonsymmetric. + Not modified. + + D - DOUBLE PRECISION array, dimension (min(M,N)) + On entry this array specifies the diagonal entries + of the diagonal of A. D may either be specified + on entry, or set according to MODE and COND as described + below. May be changed on exit if MODE is nonzero. + + MODE - INTEGER + On entry describes how D is to be used: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - DOUBLE PRECISION + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - DOUBLE PRECISION + If MODE neither -6, 0 nor 6, the diagonal is scaled by + DMAX / max(abs(D(i))), so that maximum absolute entry + of diagonal is abs(DMAX). If DMAX is negative (or zero), + diagonal will be scaled by a negative number (or zero). + + RSIGN - CHARACTER*1 + If MODE neither -6, 0 nor 6, specifies sign of diagonal + as follows: + 'T' => diagonal entries are multiplied by 1 or -1 + with probability .5 + 'F' => diagonal unchanged + Not modified. + + GRADE - CHARACTER*1 + Specifies grading of matrix as follows: + 'N' => no grading + 'L' => matrix premultiplied by diag( DL ) + (only if matrix nonsymmetric) + 'R' => matrix postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'B' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'S' or 'H' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + ('S' for symmetric, or 'H' for Hermitian) + 'E' => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + ( 'E' for eigenvalue invariance) + (only if matrix nonsymmetric) + Note: if GRADE='E', then M must equal N. + Not modified. + + DL - DOUBLE PRECISION array, dimension (M) + If MODEL=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODEL is not zero, then DL will be set according + to MODEL and CONDL, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DL). + + If GRADE='E', then DL cannot have zero entries. + Not referenced if GRADE = 'N' or 'R'. Changed on exit. + + MODEL - INTEGER + This specifies how the diagonal array DL is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDL - DOUBLE PRECISION + When MODEL is not zero, this specifies the condition number + + of the computed DL. Not modified. + + DR - DOUBLE PRECISION array, dimension (N) + If MODER=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODER is not zero, then DR will be set according + to MODER and CONDR, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DR). + + Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'. + Changed on exit. + + MODER - INTEGER + This specifies how the diagonal array DR is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDR - DOUBLE PRECISION + When MODER is not zero, this specifies the condition number + + of the computed DR. Not modified. + + PIVTNG - CHARACTER*1 + On entry specifies pivoting permutations as follows: + 'N' or ' ' => none. + 'L' => left or row pivoting (matrix must be nonsymmetric). + 'R' => right or column pivoting (matrix must be + nonsymmetric). + 'B' or 'F' => both or full pivoting, i.e., on both sides. + In this case, M must equal N + + If two calls to DLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be + maintained with less than full bandwidth. + + IPIVOT - INTEGER array, dimension (N or M) + This array specifies the permutation used. After the + basic matrix is generated, the rows, columns, or both + are permuted. If, say, row pivoting is selected, DLATMR + starts with the *last* row and interchanges the M-th and + IPIVOT(M)-th rows, then moves to the next-to-last row, + interchanging the (M-1)-th and the IPIVOT(M-1)-th rows, + and so on. In terms of "2-cycles", the permutation is + (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M)) + where the rightmost cycle is applied first. This is the + *inverse* of the effect of pivoting in LINPACK. The idea + is that factoring (with pivoting) an identity matrix + which has been inverse-pivoted in this way should + result in a pivot vector identical to IPIVOT. + Not referenced if PIVTNG = 'N'. Not modified. + + SPARSE - DOUBLE PRECISION + On entry specifies the sparsity of the matrix if a sparse + matrix is to be generated. SPARSE should lie between + 0 and 1. To generate a sparse matrix, for each matrix entry + + a uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + KL - INTEGER + On entry specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL at least M-1 implies the matrix is not + banded. Must equal KU if matrix is symmetric. + Not modified. + + KU - INTEGER + On entry specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU at least N-1 implies the matrix is not + banded. Must equal KL if matrix is symmetric. + Not modified. + + ANORM - DOUBLE PRECISION + On entry specifies maximum entry of output matrix + (output matrix will by multiplied by a constant so that + its largest absolute entry equal ANORM) + if ANORM is nonnegative. If ANORM is negative no scaling + is done. Not modified. + + PACK - CHARACTER*1 + On entry specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric) + 'L' => zero out all superdiagonal entries (if symmetric) + 'C' => store the upper triangle columnwise + (only if matrix symmetric or square upper triangular) + + 'R' => store the lower triangle columnwise + (only if matrix symmetric or square lower triangular) + + (same as upper half rowwise if symmetric) + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB or TB - use 'B' or 'Q' + PP, SP or TP - use 'C' or 'R' + + If two calls to DLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - DOUBLE PRECISION array, dimension (LDA,N) + On exit A is the desired test matrix. Only those + entries of A which are significant on output + will be referenced (even if A is in packed or band + storage format). The 'unoccupied corners' of A in + band format will be zeroed out. + + LDA - INTEGER + on entry LDA specifies the first dimension of A as + declared in the calling program. + If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ). + + If PACK='C' or 'R', LDA must be at least 1. + If PACK='B', or 'Q', LDA must be MIN ( KU+1, N ) + If PACK='Z', LDA must be at least KUU+KLL+1, where + KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 ) + Not modified. + + IWORK - INTEGER array, dimension ( N or M) + Workspace. Not referenced if PIVTNG = 'N'. Changed on exit. + + + INFO - INTEGER + Error parameter on exit: + 0 => normal return + -1 => M negative or unequal to N and SYM='S' or 'H' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string + -11 => GRADE illegal string, or GRADE='E' and + M not equal to N, or GRADE='L', 'R', 'B' or 'E' and + SYM = 'S' or 'H' + -12 => GRADE = 'E' and DL contains zero + -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H', + + 'S' or 'E' + -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E', + + and MODEL neither -6, 0 nor 6 + -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B' + -17 => CONDR less than 1.0, GRADE='R' or 'B', and + MODER neither -6, 0 nor 6 + -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and + M not equal to N, or PIVTNG='L' or 'R' and SYM='S' + or 'H' + -19 => IPIVOT contains out of range number and + PIVTNG not equal to 'N' + -20 => KL negative + -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -22 => SPARSE not in range 0. to 1. + -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q' + and SYM='N', or PACK='C' and SYM='N' and either KL + not equal to 0 or N not equal to M, or PACK='R' and + SYM='N', and either KU not equal to 0 or N not equal + + to M + -26 => LDA too small + 1 => Error return from DLATM1 (computing D) + 2 => Cannot scale diagonal to DMAX (max. entry is 0) + 3 => Error return from DLATM1 (computing DL) + 4 => Error return from DLATM1 (computing DR) + 5 => ANORM is positive, but matrix constructed prior to + attempting to scale it to have norm ANORM, is zero + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --dl; + --dr; + --ipivot; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iwork; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "S")) { + isym = 0; + } else if (lsame_(sym, "N")) { + isym = 1; + } else if (lsame_(sym, "H")) { + isym = 0; + } else { + isym = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "F")) { + irsign = 0; + } else if (lsame_(rsign, "T")) { + irsign = 1; + } else { + irsign = -1; + } + +/* Decode PIVTNG */ + + if (lsame_(pivtng, "N")) { + ipvtng = 0; + } else if (lsame_(pivtng, " ")) { + ipvtng = 0; + } else if (lsame_(pivtng, "L")) { + ipvtng = 1; + npvts = *m; + } else if (lsame_(pivtng, "R")) { + ipvtng = 2; + npvts = *n; + } else if (lsame_(pivtng, "B")) { + ipvtng = 3; + npvts = min(*n,*m); + } else if (lsame_(pivtng, "F")) { + ipvtng = 3; + npvts = min(*n,*m); + } else { + ipvtng = -1; + } + +/* Decode GRADE */ + + if (lsame_(grade, "N")) { + igrade = 0; + } else if (lsame_(grade, "L")) { + igrade = 1; + } else if (lsame_(grade, "R")) { + igrade = 2; + } else if (lsame_(grade, "B")) { + igrade = 3; + } else if (lsame_(grade, "E")) { + igrade = 4; + } else if (lsame_(grade, "H") || lsame_(grade, "S")) { + igrade = 5; + } else { + igrade = -1; + } + +/* Decode PACK */ + + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + } else if (lsame_(pack, "C")) { + ipack = 3; + } else if (lsame_(pack, "R")) { + ipack = 4; + } else if (lsame_(pack, "B")) { + ipack = 5; + } else if (lsame_(pack, "Q")) { + ipack = 6; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + kll = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + kuu = min(i__1,i__2); + +/* If inv(DL) is used, check to see if DL has a zero entry. */ + + dzero = FALSE_; + if (igrade == 4 && *model == 0) { + i__1 = *m; + for (i = 1; i <= i__1; ++i) { + if (dl[i] == 0.) { + dzero = TRUE_; + } +/* L10: */ + } + } + +/* Check values in IPIVOT */ + + badpvt = FALSE_; + if (ipvtng > 0) { + i__1 = npvts; + for (j = 1; j <= i__1; ++j) { + if (ipivot[j] <= 0 || ipivot[j] > npvts) { + badpvt = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym == 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (*mode < -6 || *mode > 6) { + *info = -7; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.) { + *info = -8; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && irsign == -1) { + *info = -10; + } else if (igrade == -1 || igrade == 4 && *m != *n || igrade >= 1 && + igrade <= 4 && isym == 0) { + *info = -11; + } else if (igrade == 4 && dzero) { + *info = -12; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) && ( + *model < -6 || *model > 6)) { + *info = -13; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) && ( + *model != -6 && *model != 0 && *model != 6) && *condl < 1.) { + *info = -14; + } else if ((igrade == 2 || igrade == 3) && (*moder < -6 || *moder > 6)) { + *info = -16; + } else if ((igrade == 2 || igrade == 3) && (*moder != -6 && *moder != 0 && + *moder != 6) && *condr < 1.) { + *info = -17; + } else if (ipvtng == -1 || ipvtng == 3 && *m != *n || (ipvtng == 1 || + ipvtng == 2) && isym == 0) { + *info = -18; + } else if (ipvtng != 0 && badpvt) { + *info = -19; + } else if (*kl < 0) { + *info = -20; + } else if (*ku < 0 || isym == 0 && *kl != *ku) { + *info = -21; + } else if (*sparse < 0. || *sparse > 1.) { + *info = -22; + } else if (ipack == -1 || (ipack == 1 || ipack == 2 || ipack == 5 || + ipack == 6) && isym == 1 || ipack == 3 && isym == 1 && (*kl != 0 + || *m != *n) || ipack == 4 && isym == 1 && (*ku != 0 || *m != *n)) + { + *info = -24; + } else if ((ipack == 0 || ipack == 1 || ipack == 2) && *lda < max(1,*m) || + (ipack == 3 || ipack == 4) && *lda < 1 || (ipack == 5 || ipack == + 6) && *lda < kuu + 1 || ipack == 7 && *lda < kll + kuu + 1) { + *info = -26; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("DLATMR", &i__1); + return 0; + } + +/* Decide if we can pivot consistently */ + + fulbnd = FALSE_; + if (kuu == *n - 1 && kll == *m - 1) { + fulbnd = TRUE_; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + iseed[4] = (iseed[4] / 2 << 1) + 1; + +/* 2) Set up D, DL, and DR, if indicated. + + Compute D according to COND and MODE */ + + dlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, info); + if (*info != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && *mode != -6 && *mode != 6) { + +/* Scale by DMAX */ + + temp = abs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__2 = temp, d__3 = (d__1 = d[i], abs(d__1)); + temp = max(d__2,d__3); +/* L40: */ + } + if (temp == 0. && *dmax__ != 0.) { + *info = 2; + return 0; + } + if (temp != 0.) { + alpha = *dmax__ / temp; + } else { + alpha = 1.; + } + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + d[i] = alpha * d[i]; +/* L50: */ + } + + } + +/* Compute DL if grading set */ + + if (igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) { + dlatm1_(model, condl, &c__0, &idist, &iseed[1], &dl[1], m, info); + if (*info != 0) { + *info = 3; + return 0; + } + } + +/* Compute DR if grading set */ + + if (igrade == 2 || igrade == 3) { + dlatm1_(moder, condr, &c__0, &idist, &iseed[1], &dr[1], n, info); + if (*info != 0) { + *info = 4; + return 0; + } + } + +/* 3) Generate IWORK if pivoting */ + + if (ipvtng > 0) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + iwork[i] = i; +/* L60: */ + } + if (fulbnd) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L70: */ + } + } else { + for (i = npvts; i >= 1; --i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L80: */ + } + } + } + +/* 4) Generate matrices for each kind of PACKing + Always sweep matrix columnwise (if symmetric, upper + half only) so that matrix generated does not depend + on PACK */ + + if (fulbnd) { + +/* Use DLATM3 so matrices generated with differing PIVOTing onl +y + differ only in the order of their rows and/or columns. */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub + jsub * a_dim1] = temp; + a[jsub + isub * a_dim1] = temp; +/* L90: */ + } +/* L100: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub + jsub * a_dim1] = temp; +/* L110: */ + } +/* L120: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub + mxsub * a_dim1] = temp; + if (mnsub != mxsub) { + a[mxsub + mnsub * a_dim1] = 0.; + } +/* L130: */ + } +/* L140: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mxsub + mnsub * a_dim1] = temp; + if (mnsub != mxsub) { + a[mnsub + mxsub * a_dim1] = 0.; + } +/* L150: */ + } +/* L160: */ + } + + } else if (ipack == 3) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + +/* Compute K = location of (ISUB,JSUB) ent +ry in packed + array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + k = mxsub * (mxsub - 1) / 2 + mnsub; + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + a[iisub + jjsub * a_dim1] = temp; +/* L170: */ + } +/* L180: */ + } + + } else if (ipack == 4) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + +/* Compute K = location of (I,J) entry in +packed array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mnsub == 1) { + k = mxsub; + } else { + k = *n * (*n + 1) / 2 - (*n - mnsub + 1) * (*n - + mnsub + 2) / 2 + mxsub - mnsub + 1; + } + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + a[iisub + jjsub * a_dim1] = temp; +/* L190: */ + } +/* L200: */ + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + a[j - i + 1 + (i + *n) * a_dim1] = 0.; + } else { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mxsub - mnsub + 1 + mnsub * a_dim1] = temp; + } +/* L210: */ + } +/* L220: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub - mxsub + kuu + 1 + mxsub * a_dim1] = temp; +/* L230: */ + } +/* L240: */ + } + + } else if (ipack == 7) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub - mxsub + kuu + 1 + mxsub * a_dim1] = temp; + if (i < 1) { + a[j - i + 1 + kuu + (i + *n) * a_dim1] = 0.; + } + if (i >= 1 && mnsub != mxsub) { + a[mxsub - mnsub + 1 + kuu + mnsub * a_dim1] = + temp; + } +/* L250: */ + } +/* L260: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + temp = dlatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub - jsub + kuu + 1 + jsub * a_dim1] = temp; +/* L270: */ + } +/* L280: */ + } + } + + } + + } else { + +/* Use DLATM2 */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = dlatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[j + i * a_dim1] = a[i + j * a_dim1]; +/* L290: */ + } +/* L300: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = dlatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); +/* L310: */ + } +/* L320: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = dlatm2_(m, n, &i, &j, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + if (i != j) { + a[j + i * a_dim1] = 0.; + } +/* L330: */ + } +/* L340: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[j + i * a_dim1] = dlatm2_(m, n, &i, &j, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + if (i != j) { + a[i + j * a_dim1] = 0.; + } +/* L350: */ + } +/* L360: */ + } + + } else if (ipack == 3) { + + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + a[isub + jsub * a_dim1] = dlatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); +/* L370: */ + } +/* L380: */ + } + + } else if (ipack == 4) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + +/* Compute K = location of (I,J) en +try in packed array */ + + if (i == 1) { + k = j; + } else { + k = *n * (*n + 1) / 2 - (*n - i + 1) * (*n - i + + 2) / 2 + j - i + 1; + } + +/* Convert K to (ISUB,JSUB) locatio +n */ + + jsub = (k - 1) / *lda + 1; + isub = k - *lda * (jsub - 1); + + a[isub + jsub * a_dim1] = dlatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L390: */ + } +/* L400: */ + } + } else { + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + a[isub + jsub * a_dim1] = dlatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L410: */ + } +/* L420: */ + } + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + a[j - i + 1 + (i + *n) * a_dim1] = 0.; + } else { + a[j - i + 1 + i * a_dim1] = dlatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); + } +/* L430: */ + } +/* L440: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = dlatm2_(m, n, &i, &j, + kl, ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L450: */ + } +/* L460: */ + } + + } else if (ipack == 7) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = dlatm2_(m, n, &i, & + j, kl, ku, &idist, &iseed[1], &d[1], &igrade, + &dl[1], &dr[1], &ipvtng, &iwork[1], sparse); + if (i < 1) { + a[j - i + 1 + kuu + (i + *n) * a_dim1] = 0.; + } + if (i >= 1 && i != j) { + a[j - i + 1 + kuu + i * a_dim1] = a[i - j + kuu + + 1 + j * a_dim1]; + } +/* L470: */ + } +/* L480: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = dlatm2_(m, n, &i, & + j, kl, ku, &idist, &iseed[1], &d[1], &igrade, + &dl[1], &dr[1], &ipvtng, &iwork[1], sparse); +/* L490: */ + } +/* L500: */ + } + } + + } + + } + +/* 5) Scaling the norm */ + + if (ipack == 0) { + onorm = dlange_("M", m, n, &a[a_offset], lda, tempa); + } else if (ipack == 1) { + onorm = dlansy_("M", "U", n, &a[a_offset], lda, tempa); + } else if (ipack == 2) { + onorm = dlansy_("M", "L", n, &a[a_offset], lda, tempa); + } else if (ipack == 3) { + onorm = dlansp_("M", "U", n, &a[a_offset], tempa); + } else if (ipack == 4) { + onorm = dlansp_("M", "L", n, &a[a_offset], tempa); + } else if (ipack == 5) { + onorm = dlansb_("M", "L", n, &kll, &a[a_offset], lda, tempa); + } else if (ipack == 6) { + onorm = dlansb_("M", "U", n, &kuu, &a[a_offset], lda, tempa); + } else if (ipack == 7) { + onorm = dlangb_("M", n, &kll, &kuu, &a[a_offset], lda, tempa); + } + + if (*anorm >= 0.) { + + if (*anorm > 0. && onorm == 0.) { + +/* Desired scaling impossible */ + + *info = 5; + return 0; + + } else if (*anorm > 1. && onorm < 1. || *anorm < 1. && onorm > 1.) { + +/* Scale carefully to avoid over / underflow */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + d__1 = 1. / onorm; + dscal_(m, &d__1, &a[j * a_dim1 + 1], &c__1); + dscal_(m, anorm, &a[j * a_dim1 + 1], &c__1); +/* L510: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + d__1 = 1. / onorm; + dscal_(&i__1, &d__1, &a[a_offset], &c__1); + i__1 = *n * (*n + 1) / 2; + dscal_(&i__1, anorm, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + d__1 = 1. / onorm; + dscal_(&i__2, &d__1, &a[j * a_dim1 + 1], &c__1); + i__2 = kll + kuu + 1; + dscal_(&i__2, anorm, &a[j * a_dim1 + 1], &c__1); +/* L520: */ + } + + } + + } else { + +/* Scale straightforwardly */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + d__1 = *anorm / onorm; + dscal_(m, &d__1, &a[j * a_dim1 + 1], &c__1); +/* L530: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + d__1 = *anorm / onorm; + dscal_(&i__1, &d__1, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + d__1 = *anorm / onorm; + dscal_(&i__2, &d__1, &a[j * a_dim1 + 1], &c__1); +/* L540: */ + } + } + + } + + } + +/* End of DLATMR */ + + return 0; +} /* dlatmr_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatms.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatms.c new file mode 100644 index 0000000..2426951 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/dlatms.c @@ -0,0 +1,1341 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__1 = 1; +static doublereal c_b22 = 0.; +static logical c_true = TRUE_; +static logical c_false = FALSE_; + +int +dlatms_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, doublereal *d, integer *mode, doublereal *cond, + doublereal *dmax__, integer *kl, integer *ku, char *pack, + doublereal *a, integer *lda, doublereal *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + doublereal d__1, d__2, d__3; + logical L__1; + + /* Builtin functions */ + double cos(doublereal), sin(doublereal); + + /* Local variables */ + static integer ilda, icol; + static doublereal temp; + static integer irow, isym; + static doublereal c; + static integer i, j, k; + static doublereal s, alpha, angle; + static integer ipack; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *); + static integer ioffg; + extern logical lsame_(char *, char *); + static integer iinfo, idist, mnmin; + extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *, + doublereal *, integer *); + static integer iskew; + static doublereal extra, dummy; + extern /* Subroutine */ int dlatm1_(integer *, doublereal *, integer *, + integer *, integer *, doublereal *, integer *, integer *); + static integer ic, jc, nc; + extern /* Subroutine */ int dlagge_(integer *, integer *, integer *, + integer *, doublereal *, doublereal *, integer *, integer *, + doublereal *, integer *); + static integer il, iendch, ir, jr, ipackg, mr, minlda; + extern doublereal dlarnd_(integer *, integer *); + extern /* Subroutine */ int dlaset_(char *, integer *, integer *, + doublereal *, doublereal *, doublereal *, integer *), + dlartg_(doublereal *, doublereal *, doublereal *, doublereal *, + doublereal *), xerbla_(char *, integer *), dlagsy_( + integer *, integer *, doublereal *, doublereal *, integer *, + integer *, doublereal *, integer *), dlarot_(logical *, logical *, + logical *, integer *, doublereal *, doublereal *, doublereal *, + integer *, doublereal *, doublereal *); + static logical iltemp, givens; + static integer ioffst, irsign; + static logical ilextr, topdwn; + static integer ir1, ir2, isympk, jch, llb, jkl, jku, uub; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + DLATMS generates random matrices with specified singular values + (or symmetric/hermitian with specified eigenvalues) + for testing LAPACK programs. + + DLATMS operates by applying the following sequence of + operations: + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and SYM + as described below. + + Generate a matrix with the appropriate band structure, by one + of two methods: + + Method A: + Generate a dense M x N matrix by multiplying D on the left + and the right by random unitary matrices, then: + + Reduce the bandwidth according to KL and KU, using + Householder transformations. + + Method B: + Convert the bandwidth-0 (i.e., diagonal) matrix to a + bandwidth-1 matrix using Givens rotations, "chasing" + out-of-band elements back, much as in QR; then + convert the bandwidth-1 to a bandwidth-2 matrix, etc. + Note that for reasonably small bandwidths (relative to + M and N) this requires less storage, as a dense matrix + is not generated. Also, for symmetric matrices, only + one triangle is generated. + + Method A is chosen if the bandwidth is a large fraction of the + order of the matrix, and LDA is at least M (so a dense + matrix can be stored.) Method B is chosen if the bandwidth + + is small (< 1/2 N for symmetric, < .3 N+M for + non-symmetric), or LDA is less than M and not less than the + + bandwidth. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric) + zero out lower half (if symmetric) + store the upper half columnwise (if symmetric or upper + triangular) + store the lower half columnwise (if symmetric or lower + triangular) + store the lower triangle in banded format (if symmetric + or lower triangular) + store the upper triangle in banded format (if symmetric + or upper triangular) + store the entire matrix in banded format + If Method B is chosen, and band format is specified, then the + matrix will be generated in the band format, so no repacking + + will be necessary. + + Arguments + ========= + + M - INTEGER + The number of rows of A. Not modified. + + N - INTEGER + The number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values. + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to DLATMS + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S' or 'H', the generated matrix is symmetric, with + eigenvalues specified by D, COND, MODE, and DMAX; they + may be positive, negative, or zero. + If SYM='P', the generated matrix is symmetric, with + eigenvalues (= singular values) specified by D, COND, + MODE, and DMAX; they will not be negative. + If SYM='N', the generated matrix is nonsymmetric, with + singular values specified by D, COND, MODE, and DMAX; + they will not be negative. + Not modified. + + D - DOUBLE PRECISION array, dimension ( MIN( M , N ) ) + This array is used to specify the singular values or + eigenvalues of A (see SYM, above.) If MODE=0, then D is + assumed to contain the singular/eigenvalues, otherwise + they will be computed according to MODE, COND, and DMAX, + and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the singular/eigenvalues are to + + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then + the elements of D will also be multiplied by a random + sign (i.e., +1 or -1.) + Not modified. + + COND - DOUBLE PRECISION + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - DOUBLE PRECISION + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or + + singular value (which is to say the norm) will be abs(DMAX). + + Note that DMAX need not be positive: if DMAX is negative + (or zero), D will be scaled by a negative number (or zero). + + Not modified. + + KL - INTEGER + This specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL being at least M-1 means that the matrix + + has full lower bandwidth. KL must equal KU if the matrix + is symmetric. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU being at least N-1 means that the matrix + + has full upper bandwidth. KL must equal KU if the matrix + is symmetric. + Not modified. + + PACK - CHARACTER*1 + This specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric) + 'L' => zero out all superdiagonal entries (if symmetric) + 'C' => store the upper triangle columnwise + (only if the matrix is symmetric or upper triangular) + + 'R' => store the lower triangle columnwise + (only if the matrix is symmetric or lower triangular) + + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric or lower triangular) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric or upper triangular) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB or TB - use 'B' or 'Q' + PP, SP or TP - use 'C' or 'R' + + If two calls to DLATMS differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - DOUBLE PRECISION array, dimension ( LDA, N ) + On exit A is the desired test matrix. A is first generated + in full (unpacked) form, and then packed, if so specified + by PACK. Thus, the first M elements of the first N + columns will always be modified. If PACK specifies a + packed or banded storage scheme, all LDA elements of the + first N columns will be modified; the elements of the + array which do not correspond to elements of the generated + matrix are set to zero. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. If PACK='N', 'U', 'L', 'C', or 'R', then + LDA must be at least M. If PACK='B' or 'Q', then LDA must + be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)). + If PACK='Z', LDA must be large enough to hold the packed + array: MIN( KU, N-1) + MIN( KL, M-1) + 1. + Not modified. + + WORK - DOUBLE PRECISION array, dimension ( 3*MAX( N , M ) ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => M negative or unequal to N and SYM='S', 'H', or 'P' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => KL negative + -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N'; + + or PACK='C' or 'Q' and SYM='N' and KL is not zero; + or PACK='R' or 'B' and SYM='N' and KU is not zero; + or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not + + N. + -14 => LDA is less than M, or PACK='Z' and LDA is less than + + MIN(KU,N-1) + MIN(KL,M-1) + 1. + 1 => Error return from DLATM1 + 2 => Cannot scale to DMAX (max. sing. value is 0) + 3 => Error return from DLAGGE or SLAGSY + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "N")) { + isym = 1; + irsign = 0; + } else if (lsame_(sym, "P")) { + isym = 2; + irsign = 0; + } else if (lsame_(sym, "S")) { + isym = 2; + irsign = 1; + } else if (lsame_(sym, "H")) { + isym = 2; + irsign = 1; + } else { + isym = -1; + } + +/* Decode PACK */ + + isympk = 0; + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + isympk = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + isympk = 1; + } else if (lsame_(pack, "C")) { + ipack = 3; + isympk = 2; + } else if (lsame_(pack, "R")) { + ipack = 4; + isympk = 3; + } else if (lsame_(pack, "B")) { + ipack = 5; + isympk = 3; + } else if (lsame_(pack, "Q")) { + ipack = 6; + isympk = 2; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + llb = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + uub = min(i__1,i__2); +/* Computing MIN */ + i__1 = *m, i__2 = *n + llb; + mr = min(i__1,i__2); +/* Computing MIN */ + i__1 = *n, i__2 = *m + uub; + nc = min(i__1,i__2); + + if (ipack == 5 || ipack == 6) { + minlda = uub + 1; + } else if (ipack == 7) { + minlda = llb + uub + 1; + } else { + minlda = *m; + } + +/* Use Givens rotation method if bandwidth small enough, + or if LDA is too small to store the matrix unpacked. */ + + givens = FALSE_; + if (isym == 1) { +/* Computing MAX */ + i__1 = 1, i__2 = mr + nc; + if ((doublereal) (llb + uub) < (doublereal) max(i__1,i__2) * .3) { + givens = TRUE_; + } + } else { + if (llb << 1 < *m) { + givens = TRUE_; + } + } + if (*lda < *m && *lda >= minlda) { + givens = TRUE_; + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym != 1) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (abs(*mode) > 6) { + *info = -7; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.) { + *info = -8; + } else if (*kl < 0) { + *info = -10; + } else if (*ku < 0 || isym != 1 && *kl != *ku) { + *info = -11; + } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym + == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk + != 0 && *m != *n) { + *info = -12; + } else if (*lda < max(1,minlda)) { + *info = -14; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("DLATMS", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L10: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up D if indicated. + + Compute D according to COND and MODE */ + + dlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + +/* Choose Top-Down if D is (apparently) increasing, + Bottom-Up if D is (apparently) decreasing. */ + + if (abs(d[1]) <= (d__1 = d[mnmin], abs(d__1))) { + topdwn = TRUE_; + } else { + topdwn = FALSE_; + } + + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = abs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__2 = temp, d__3 = (d__1 = d[i], abs(d__1)); + temp = max(d__2,d__3); +/* L20: */ + } + + if (temp > 0.) { + alpha = *dmax__ / temp; + } else { + *info = 2; + return 0; + } + + dscal_(&mnmin, &alpha, &d[1], &c__1); + + } + +/* 3) Generate Banded Matrix using Givens rotations. + Also the special case of UUB=LLB=0 + + Compute Addressing constants to cover all + storage formats. Whether GE, SY, GB, or SB, + upper or lower triangle or both, + the (i,j)-th element is in + A( i - ISKEW*j + IOFFST, j ) */ + + if (ipack > 4) { + ilda = *lda - 1; + iskew = 1; + if (ipack > 5) { + ioffst = uub + 1; + } else { + ioffst = 1; + } + } else { + ilda = *lda; + iskew = 0; + ioffst = 0; + } + +/* IPACKG is the format that the matrix is generated in. If this is + different from IPACK, then the matrix must be repacked at the + end. It also signals how to compute the norm, for scaling. */ + + ipackg = 0; + dlaset_("Full", lda, n, &c_b22, &c_b22, &a[a_offset], lda); + +/* Diagonal Matrix -- We are done, unless it + is to be stored SP/PP/TP (PACK='R' or 'C') */ + + if (llb == 0 && uub == 0) { + i__1 = ilda + 1; + dcopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffst + a_dim1], &i__1); + if (ipack <= 2 || ipack >= 5) { + ipackg = ipack; + } + + } else if (givens) { + +/* Check whether to use Givens rotations, + Householder transformations, or nothing. */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + if (ipack > 4) { + ipackg = ipack; + } else { + ipackg = 0; + } + + i__1 = ilda + 1; + dcopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffst + a_dim1], & + i__1); + + if (topdwn) { + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + Last row actually rotated is M + Last column actually rotated is MIN( M+ +JKU, N ) + + Computing MIN */ + i__3 = *m + jku; + i__2 = min(i__3,*n) + jkl - 1; + for (jr = 1; jr <= i__2; ++jr) { + extra = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__4 = jr - jkl; + icol = max(i__3,i__4); + if (jr < *m) { +/* Computing MIN */ + i__3 = *n, i__4 = jr + jku; + il = min(i__3,i__4) + 1 - icol; + L__1 = jr > jkl; + dlarot_(&c_true, &L__1, &c_false, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ir = jr; + ic = icol; + i__3 = -jkl - jku; + for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ir < *m) { + dlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &c, &s, + &dummy); + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + temp = 0.; + iltemp = jch > jku; + d__1 = -s; + dlarot_(&c_false, &iltemp, &c_true, &il, &c, & + d__1, &a[irow - iskew * ic + ioffst + ic * + a_dim1], &ilda, &temp, &extra); + if (iltemp) { + dlartg_(&a[irow + 1 - iskew * (ic + 1) + + ioffst + (ic + 1) * a_dim1], &temp, & + c, &s, &dummy); +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + extra = 0.; + L__1 = jch > jku + jkl; + d__1 = -s; + dlarot_(&c_true, &L__1, &c_true, &il, &c, & + d__1, &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, & + temp); + ic = icol; + ir = irow; + } +/* L30: */ + } +/* L40: */ + } +/* L50: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + Computing MIN */ + i__3 = *n + jkl; + i__2 = min(i__3,*m) + jku - 1; + for (jc = 1; jc <= i__2; ++jc) { + extra = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__4 = jc - jku; + irow = max(i__3,i__4); + if (jc < *n) { +/* Computing MIN */ + i__3 = *m, i__4 = jc + jkl; + il = min(i__3,i__4) + 1 - irow; + L__1 = jc > jku; + dlarot_(&c_false, &L__1, &c_false, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ic = jc; + ir = irow; + i__3 = -jkl - jku; + for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ic < *n) { + dlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &c, &s, + &dummy); + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + temp = 0.; + iltemp = jch > jkl; + d__1 = -s; + dlarot_(&c_true, &iltemp, &c_true, &il, &c, &d__1, + &a[ir - iskew * icol + ioffst + icol * + a_dim1], &ilda, &temp, &extra); + if (iltemp) { + dlartg_(&a[ir + 1 - iskew * (icol + 1) + + ioffst + (icol + 1) * a_dim1], &temp, + &c, &s, &dummy); +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + extra = 0.; + L__1 = jch > jkl + jku; + d__1 = -s; + dlarot_(&c_false, &L__1, &c_true, &il, &c, & + d__1, &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, & + temp); + ic = icol; + ir = irow; + } +/* L60: */ + } +/* L70: */ + } +/* L80: */ + } + + } else { + +/* Bottom-Up -- Start at the bottom right. */ + + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + First row actually rotated is M + First column actually rotated is MIN( M ++JKU, N ) + + Computing MIN */ + i__2 = *m, i__3 = *n + jkl; + iendch = min(i__2,i__3) - 1; +/* Computing MIN */ + i__2 = *m + jku; + i__3 = 1 - jkl; + for (jc = min(i__2,*n) - 1; jc >= i__3; --jc) { + extra = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__2 = 1, i__4 = jc - jku + 1; + irow = max(i__2,i__4); + if (jc > 0) { +/* Computing MIN */ + i__2 = *m, i__4 = jc + jkl + 1; + il = min(i__2,i__4) + 1 - irow; + L__1 = jc + jkl < *m; + dlarot_(&c_false, &c_false, &L__1, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ic = jc; + i__2 = iendch; + i__4 = jkl + jku; + for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <= + i__2; jch += i__4) { + ilextr = ic > 0; + if (ilextr) { + dlartg_(&a[jch - iskew * ic + ioffst + ic * + a_dim1], &extra, &c, &s, &dummy); + } + ic = max(1,ic); +/* Computing MIN */ + i__5 = *n - 1, i__6 = jch + jku; + icol = min(i__5,i__6); + iltemp = jch + jku < *n; + temp = 0.; + i__5 = icol + 2 - ic; + dlarot_(&c_true, &ilextr, &iltemp, &i__5, &c, &s, + &a[jch - iskew * ic + ioffst + ic * + a_dim1], &ilda, &extra, &temp); + if (iltemp) { + dlartg_(&a[jch - iskew * icol + ioffst + icol + * a_dim1], &temp, &c, &s, &dummy); +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra = 0.; + L__1 = jch + jkl + jku <= iendch; + dlarot_(&c_false, &c_true, &L__1, &il, &c, &s, + &a[jch - iskew * icol + ioffst + + icol * a_dim1], &ilda, &temp, &extra); + ic = icol; + } +/* L90: */ + } +/* L100: */ + } +/* L110: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + First row actually rotated is MIN( N+JK +L, M ) + First column actually rotated is N + + Computing MIN */ + i__3 = *n, i__4 = *m + jku; + iendch = min(i__3,i__4) - 1; +/* Computing MIN */ + i__3 = *n + jkl; + i__4 = 1 - jku; + for (jr = min(i__3,*m) - 1; jr >= i__4; --jr) { + extra = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__2 = jr - jkl + 1; + icol = max(i__3,i__2); + if (jr > 0) { +/* Computing MIN */ + i__3 = *n, i__2 = jr + jku + 1; + il = min(i__3,i__2) + 1 - icol; + L__1 = jr + jku < *n; + dlarot_(&c_true, &c_false, &L__1, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ir = jr; + i__3 = iendch; + i__2 = jkl + jku; + for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <= + i__3; jch += i__2) { + ilextr = ir > 0; + if (ilextr) { + dlartg_(&a[ir - iskew * jch + ioffst + jch * + a_dim1], &extra, &c, &s, &dummy); + } + ir = max(1,ir); +/* Computing MIN */ + i__5 = *m - 1, i__6 = jch + jkl; + irow = min(i__5,i__6); + iltemp = jch + jkl < *m; + temp = 0.; + i__5 = irow + 2 - ir; + dlarot_(&c_false, &ilextr, &iltemp, &i__5, &c, &s, + &a[ir - iskew * jch + ioffst + jch * + a_dim1], &ilda, &extra, &temp); + if (iltemp) { + dlartg_(&a[irow - iskew * jch + ioffst + jch * + a_dim1], &temp, &c, &s, &dummy); +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra = 0.; + L__1 = jch + jkl + jku <= iendch; + dlarot_(&c_true, &c_true, &L__1, &il, &c, &s, + &a[irow - iskew * jch + ioffst + jch * + a_dim1], &ilda, &temp, &extra); + ir = irow; + } +/* L120: */ + } +/* L130: */ + } +/* L140: */ + } + } + + } else { + +/* Symmetric -- A = U D U' */ + + ipackg = ipack; + ioffg = ioffst; + + if (topdwn) { + +/* Top-Down -- Generate Upper triangle only */ + + if (ipack >= 5) { + ipackg = 6; + ioffg = uub + 1; + } else { + ipackg = 1; + } + i__1 = ilda + 1; + dcopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffg + a_dim1], & + i__1); + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + i__4 = *n - 1; + for (jc = 1; jc <= i__4; ++jc) { +/* Computing MAX */ + i__2 = 1, i__3 = jc - k; + irow = max(i__2,i__3); +/* Computing MIN */ + i__2 = jc + 1, i__3 = k + 2; + il = min(i__2,i__3); + extra = 0.; + temp = a[jc - iskew * (jc + 1) + ioffg + (jc + 1) * + a_dim1]; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = sin(angle); + L__1 = jc > k; + dlarot_(&c_false, &L__1, &c_true, &il, &c, &s, &a[ + irow - iskew * jc + ioffg + jc * a_dim1], & + ilda, &extra, &temp); +/* Computing MIN */ + i__3 = k, i__5 = *n - jc; + i__2 = min(i__3,i__5) + 1; + dlarot_(&c_true, &c_true, &c_false, &i__2, &c, &s, &a[ + (1 - iskew) * jc + ioffg + jc * a_dim1], & + ilda, &temp, &dummy); + +/* Chase EXTRA back up the matrix +*/ + + icol = jc; + i__2 = -k; + for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1; + jch += i__2) { + dlartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg + + (icol + 1) * a_dim1], &extra, &c, &s, & + dummy); + temp = a[jch - iskew * (jch + 1) + ioffg + (jch + + 1) * a_dim1]; + i__3 = k + 2; + d__1 = -s; + dlarot_(&c_true, &c_true, &c_true, &i__3, &c, & + d__1, &a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &temp, &extra); +/* Computing MAX */ + i__3 = 1, i__5 = jch - k; + irow = max(i__3,i__5); +/* Computing MIN */ + i__3 = jch + 1, i__5 = k + 2; + il = min(i__3,i__5); + extra = 0.; + L__1 = jch > k; + d__1 = -s; + dlarot_(&c_false, &L__1, &c_true, &il, &c, &d__1, + &a[irow - iskew * jch + ioffg + jch * + a_dim1], &ilda, &extra, &temp); + icol = jch; +/* L150: */ + } +/* L160: */ + } +/* L170: */ + } + +/* If we need lower triangle, copy from upper. No +te that + the order of copying is chosen to work for 'q' + -> 'b' */ + + if (ipack != ipackg && ipack != 3) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst - iskew * jc; +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + a[jr + irow + jc * a_dim1] = a[jc - iskew * jr + + ioffg + jr * a_dim1]; +/* L180: */ + } +/* L190: */ + } + if (ipack == 5) { + i__1 = *n; + for (jc = *n - uub + 1; jc <= i__1; ++jc) { + i__4 = uub + 1; + for (jr = *n + 2 - jc; jr <= i__4; ++jr) { + a[jr + jc * a_dim1] = 0.; +/* L200: */ + } +/* L210: */ + } + } + if (ipackg == 6) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } else { + +/* Bottom-Up -- Generate Lower triangle only */ + + if (ipack >= 5) { + ipackg = 5; + if (ipack == 6) { + ioffg = 1; + } + } else { + ipackg = 2; + } + i__1 = ilda + 1; + dcopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffg + a_dim1], & + i__1); + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + for (jc = *n - 1; jc >= 1; --jc) { +/* Computing MIN */ + i__4 = *n + 1 - jc, i__2 = k + 2; + il = min(i__4,i__2); + extra = 0.; + temp = a[(1 - iskew) * jc + 1 + ioffg + jc * a_dim1]; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + c = cos(angle); + s = -sin(angle); + L__1 = *n - jc > k; + dlarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[(1 + - iskew) * jc + ioffg + jc * a_dim1], &ilda, & + temp, &extra); +/* Computing MAX */ + i__4 = 1, i__2 = jc - k + 1; + icol = max(i__4,i__2); + i__4 = jc + 2 - icol; + dlarot_(&c_true, &c_false, &c_true, &i__4, &c, &s, &a[ + jc - iskew * icol + ioffg + icol * a_dim1], & + ilda, &dummy, &temp); + +/* Chase EXTRA back down the matrix + */ + + icol = jc; + i__4 = *n - 1; + i__2 = k; + for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <= + i__4; jch += i__2) { + dlartg_(&a[jch - iskew * icol + ioffg + icol * + a_dim1], &extra, &c, &s, &dummy); + temp = a[(1 - iskew) * jch + 1 + ioffg + jch * + a_dim1]; + i__3 = k + 2; + dlarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[jch - iskew * icol + ioffg + icol * + a_dim1], &ilda, &extra, &temp); +/* Computing MIN */ + i__3 = *n + 1 - jch, i__5 = k + 2; + il = min(i__3,i__5); + extra = 0.; + L__1 = *n - jch > k; + dlarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[ + (1 - iskew) * jch + ioffg + jch * a_dim1], + &ilda, &temp, &extra); + icol = jch; +/* L220: */ + } +/* L230: */ + } +/* L240: */ + } + +/* If we need upper triangle, copy from lower. No +te that + the order of copying is chosen to work for 'b' + -> 'q' */ + + if (ipack != ipackg && ipack != 4) { + for (jc = *n; jc >= 1; --jc) { + irow = ioffst - iskew * jc; +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + a[jr + irow + jc * a_dim1] = a[jc - iskew * jr + + ioffg + jr * a_dim1]; +/* L250: */ + } +/* L260: */ + } + if (ipack == 6) { + i__1 = uub; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.; +/* L270: */ + } +/* L280: */ + } + } + if (ipackg == 5) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } + } + + } else { + +/* 4) Generate Banded Matrix by first + Rotating by random Unitary matrices, + then reducing the bandwidth using Householder + transformations. + + Note: we should get here only if LDA .ge. N */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + dlagge_(&mr, &nc, &llb, &uub, &d[1], &a[a_offset], lda, &iseed[1], + &work[1], &iinfo); + } else { + +/* Symmetric -- A = U D U' */ + + dlagsy_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1], & + iinfo); + + } + if (iinfo != 0) { + *info = 3; + return 0; + } + } + +/* 5) Pack the matrix */ + + if (ipack != ipackg) { + if (ipack == 1) { + +/* 'U' -- Upper triangular, not packed */ + + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j + 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.; +/* L290: */ + } +/* L300: */ + } + + } else if (ipack == 2) { + +/* 'L' -- Lower triangular, not packed */ + + i__1 = *m; + for (j = 2; j <= i__1; ++j) { + i__2 = j - 1; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.; +/* L310: */ + } +/* L320: */ + } + + } else if (ipack == 3) { + +/* 'C' -- Upper triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + a[irow + icol * a_dim1] = a[i + j * a_dim1]; +/* L330: */ + } +/* L340: */ + } + + } else if (ipack == 4) { + +/* 'R' -- Lower triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + a[irow + icol * a_dim1] = a[i + j * a_dim1]; +/* L350: */ + } +/* L360: */ + } + + } else if (ipack >= 5) { + +/* 'B' -- The lower triangle is packed as a band matrix. + + 'Q' -- The upper triangle is packed as a band matrix. + + 'Z' -- The whole matrix is packed as a band matrix. +*/ + + if (ipack == 5) { + uub = 0; + } + if (ipack == 6) { + llb = 0; + } + + i__1 = uub; + for (j = 1; j <= i__1; ++j) { +/* Computing MIN */ + i__2 = j + llb; + for (i = min(i__2,*m); i >= 1; --i) { + a[i - j + uub + 1 + j * a_dim1] = a[i + j * a_dim1]; +/* L370: */ + } +/* L380: */ + } + + i__1 = *n; + for (j = uub + 2; j <= i__1; ++j) { +/* Computing MIN */ + i__4 = j + llb; + i__2 = min(i__4,*m); + for (i = j - uub; i <= i__2; ++i) { + a[i - j + uub + 1 + j * a_dim1] = a[i + j * a_dim1]; +/* L390: */ + } +/* L400: */ + } + } + +/* If packed, zero out extraneous elements. + + Symmetric/Triangular Packed -- + zero out everything after A(IROW,ICOL) */ + + if (ipack == 3 || ipack == 4) { + i__1 = *m; + for (jc = icol; jc <= i__1; ++jc) { + i__2 = *lda; + for (jr = irow + 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.; +/* L410: */ + } + irow = 0; +/* L420: */ + } + + } else if (ipack >= 5) { + +/* Packed Band -- + 1st row is now in A( UUB+2-j, j), zero above it + m-th row is now in A( M+UUB-j,j), zero below it + last non-zero diagonal is now in A( UUB+LLB+1,j ), + + zero below it, too. */ + + ir1 = uub + llb + 2; + ir2 = uub + *m + 2; + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.; +/* L430: */ + } +/* Computing MAX + Computing MIN */ + i__3 = ir1, i__5 = ir2 - jc; + i__2 = 1, i__4 = min(i__3,i__5); + i__6 = *lda; + for (jr = max(i__2,i__4); jr <= i__6; ++jr) { + a[jr + jc * a_dim1] = 0.; +/* L440: */ + } +/* L450: */ + } + } + } + + return 0; + +/* End of DLATMS */ + +} /* dlatms_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/f2c.h b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/f2c.h new file mode 100644 index 0000000..3116864 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/f2c.h @@ -0,0 +1,48 @@ +/* f2c.h -- Standard Fortran to C header file */ + +/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." + + - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ + +#include "slu_Cnames.h" + +#ifndef F2C_INCLUDE +#define F2C_INCLUDE + +#if 0 +typedef long int integer; /* 64 on 64-bit machine */ +typedef long int logical; +#endif + +typedef int integer; +typedef int logical; + +typedef char *address; +typedef short int shortint; +typedef float real; +typedef double doublereal; +typedef struct { real r, i; } complex; +typedef struct { doublereal r, i; } doublecomplex; +typedef short int shortlogical; +typedef char logical1; +typedef char integer1; +/* typedef long long longint; */ /* system-dependent */ + +#define TRUE_ (1) +#define FALSE_ (0) + +/* Extern is for use with -E */ +#ifndef Extern +#define Extern extern +#endif + +#define abs(x) ((x) >= 0 ? (x) : -(x)) +#define dabs(x) (doublereal)abs(x) +#define min(a,b) ((a) <= (b) ? (a) : (b)) +#define max(a,b) ((a) >= (b) ? (a) : (b)) +#define dmin(a,b) (doublereal)min(a,b) +#define dmax(a,b) (doublereal)max(a,b) + +#define VOID void + +#endif diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/lsamen.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/lsamen.c new file mode 100644 index 0000000..82a5d18 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/lsamen.c @@ -0,0 +1,70 @@ +#include +#include "f2c.h" + +logical lsamen_(integer *n, char *ca, char *cb) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + LSAMEN tests if the first N letters of CA are the same as the + first N letters of CB, regardless of case. + LSAMEN returns .TRUE. if CA and CB are equivalent except for case + and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA ) + or LEN( CB ) is less than N. + + Arguments + ========= + + N (input) INTEGER + The number of characters in CA and CB to be compared. + + CA (input) CHARACTER*(*) + CB (input) CHARACTER*(*) + CA and CB specify two character strings of length at least N. + + Only the first N characters of each string will be accessed. + + + ===================================================================== +*/ + /* System generated locals */ + integer i__1; + logical ret_val; + /* Local variables */ + static integer i; + extern logical lsame_(char *, char *); + + + ret_val = FALSE_; + if (strlen(ca) < *n || strlen(cb) < *n) { + goto L20; + } + +/* Do for each character in the two strings. */ + + i__1 = *n; + for (i = 1; i <= *n; ++i) { + +/* Test if the characters are equal using LSAME. */ + + if (! lsame_(ca + (i - 1), cb + (i - 1))) { + goto L20; + } + +/* L10: */ + } + ret_val = TRUE_; + +L20: + return ret_val; + +/* End of LSAMEN */ + +} /* lsamen_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/pow_dd.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/pow_dd.c new file mode 100644 index 0000000..d2bb0e3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/pow_dd.c @@ -0,0 +1,13 @@ +#include "f2c.h" + +#ifdef KR_headers +double pow(); +double pow_dd(ap, bp) doublereal *ap, *bp; +#else +#undef abs +#include "math.h" +double pow_dd(doublereal *ap, doublereal *bp) +#endif +{ +return(pow(*ap, *bp) ); +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_lg10.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_lg10.c new file mode 100644 index 0000000..4ea02f4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_lg10.c @@ -0,0 +1,15 @@ +#include "f2c.h" + +#define log10e 0.43429448190325182765 + +#ifdef KR_headers +double log(); +double r_lg10(x) real *x; +#else +#undef abs +#include "math.h" +double r_lg10(real *x) +#endif +{ +return( log10e * log(*x) ); +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_sign.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_sign.c new file mode 100644 index 0000000..df6d02a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/r_sign.c @@ -0,0 +1,12 @@ +#include "f2c.h" + +#ifdef KR_headers +double r_sign(a,b) real *a, *b; +#else +double r_sign(real *a, real *b) +#endif +{ +double x; +x = (*a >= 0 ? *a : - *a); +return( *b >= 0 ? x : -x); +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slabad.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slabad.c new file mode 100644 index 0000000..9294196 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slabad.c @@ -0,0 +1,60 @@ +#include "f2c.h" + +/* Subroutine */ int slabad_(real *small, real *large) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLABAD takes as input the values computed by SLAMCH for underflow and + + overflow, and returns the square root of each of these values if the + + log of LARGE is sufficiently large. This subroutine is intended to + identify machines with a large exponent range, such as the Crays, and + + redefine the underflow and overflow limits to be the square roots of + + the values computed by SLAMCH. This subroutine is needed because + SLAMCH does not compensate for poor arithmetic in the upper half of + the exponent range, as is found on a Cray. + + Arguments + ========= + + SMALL (input/output) REAL + On entry, the underflow threshold as computed by SLAMCH. + On exit, if LOG10(LARGE) is sufficiently large, the square + root of SMALL, otherwise unchanged. + + LARGE (input/output) REAL + On entry, the overflow threshold as computed by SLAMCH. + On exit, if LOG10(LARGE) is sufficiently large, the square + root of LARGE, otherwise unchanged. + + ===================================================================== + + + + If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + /* Builtin functions */ + double r_lg10(real *), sqrt(doublereal); + + + if (r_lg10(large) > 2e3f) { + *small = sqrt(*small); + *large = sqrt(*large); + } + + return 0; + +/* End of SLABAD */ + +} /* slabad_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagge.c new file mode 100644 index 0000000..7844658 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagge.c @@ -0,0 +1,400 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static real c_b11 = 1.f; +static real c_b13 = 0.f; + +/* Subroutine */ int slagge_(integer *m, integer *n, integer *kl, integer *ku, + real *d, real *a, integer *lda, integer *iseed, real *work, integer * + info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + real r__1; + + /* Builtin functions */ + double r_sign(real *, real *); + + /* Local variables */ + extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + extern real snrm2_(integer *, real *, integer *); + static integer i, j; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *), + sgemv_(char *, integer *, integer *, real *, real *, integer *, + real *, integer *, real *, real *, integer *); + static real wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), slarnv_( + integer *, integer *, integer *, real *); + static real tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLAGGE generates a real general m by n matrix A, by pre- and post- + multiplying a real diagonal matrix D with random orthogonal matrices: + + A = U*D*V. The lower and upper bandwidths may then be reduced to + kl and ku by additional orthogonal transformations. + + Arguments + ========= + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + KL (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= KL <= M-1. + + KU (input) INTEGER + The number of nonzero superdiagonals within the band of A. + 0 <= KU <= N-1. + + D (input) REAL array, dimension (min(M,N)) + The diagonal elements of the diagonal matrix D. + + A (output) REAL array, dimension (LDA,N) + The generated m by n matrix A. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= M. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) REAL array, dimension (M+N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*m < 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (*kl < 0 || *kl > *m - 1) { + *info = -3; + } else if (*ku < 0 || *ku > *n - 1) { + *info = -4; + } else if (*lda < max(1,*m)) { + *info = -7; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("SLAGGE", &i__1); + return 0; + } + +/* initialize A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.f; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= i__1; ++i) { + a[i + i * a_dim1] = d[i]; +/* L30: */ + } + +/* pre- and post-multiply A by random orthogonal matrices */ + + for (i = min(*m,*n); i >= 1; --i) { + if (i < *m) { + +/* generate random reflection */ + + i__1 = *m - i + 1; + slarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *m - i + 1; + wn = snrm2_(&i__1, &work[1], &c__1); + wa = r_sign(&wn, &work[1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = work[1] + wa; + i__1 = *m - i; + r__1 = 1.f / wb; + sscal_(&i__1, &r__1, &work[2], &c__1); + work[1] = 1.f; + tau = wb / wa; + } + +/* multiply A(i:m,i:n) by random reflection from the lef +t */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + sgemv_("Transpose", &i__1, &i__2, &c_b11, &a[i + i * a_dim1], lda, + &work[1], &c__1, &c_b13, &work[*m + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + r__1 = -(doublereal)tau; + sger_(&i__1, &i__2, &r__1, &work[1], &c__1, &work[*m + 1], &c__1, + &a[i + i * a_dim1], lda); + } + if (i < *n) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + slarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = snrm2_(&i__1, &work[1], &c__1); + wa = r_sign(&wn, &work[1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = work[1] + wa; + i__1 = *n - i; + r__1 = 1.f / wb; + sscal_(&i__1, &r__1, &work[2], &c__1); + work[1] = 1.f; + tau = wb / wa; + } + +/* multiply A(i:m,i:n) by random reflection from the rig +ht */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + sgemv_("No transpose", &i__1, &i__2, &c_b11, &a[i + i * a_dim1], + lda, &work[1], &c__1, &c_b13, &work[*n + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + r__1 = -(doublereal)tau; + sger_(&i__1, &i__2, &r__1, &work[*n + 1], &c__1, &work[1], &c__1, + &a[i + i * a_dim1], lda); + } +/* L40: */ + } + +/* Reduce number of subdiagonals to KL and number of superdiagonals + to KU + + Computing MAX */ + i__2 = *m - 1 - *kl, i__3 = *n - 1 - *ku; + i__1 = max(i__2,i__3); + for (i = 1; i <= i__1; ++i) { + if (*kl <= *ku) { + +/* annihilate subdiagonal elements first (necessary if K +L = 0) + + Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = snrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + wa = r_sign(&wn, &a[*kl + i + i * a_dim1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = a[*kl + i + i * a_dim1] + wa; + i__2 = *m - *kl - i; + r__1 = 1.f / wb; + sscal_(&i__2, &r__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + a[*kl + i + i * a_dim1] = 1.f; + tau = wb / wa; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + sgemv_("Transpose", &i__2, &i__3, &c_b11, &a[*kl + i + (i + 1) + * a_dim1], lda, &a[*kl + i + i * a_dim1], &c__1, & + c_b13, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + r__1 = -(doublereal)tau; + sger_(&i__2, &i__3, &r__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + a[*kl + i + i * a_dim1] = -(doublereal)wa; + } + +/* Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = snrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + wa = r_sign(&wn, &a[i + (*ku + i) * a_dim1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = a[i + (*ku + i) * a_dim1] + wa; + i__2 = *n - *ku - i; + r__1 = 1.f / wb; + sscal_(&i__2, &r__1, &a[i + (*ku + i + 1) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = 1.f; + tau = wb / wa; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + sgemv_("No transpose", &i__2, &i__3, &c_b11, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, + &c_b13, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + r__1 = -(doublereal)tau; + sger_(&i__2, &i__3, &r__1, &work[1], &c__1, &a[i + (*ku + i) * + a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = -(doublereal)wa; + } + } else { + +/* annihilate superdiagonal elements first (necessary if + + KU = 0) + + Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = snrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + wa = r_sign(&wn, &a[i + (*ku + i) * a_dim1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = a[i + (*ku + i) * a_dim1] + wa; + i__2 = *n - *ku - i; + r__1 = 1.f / wb; + sscal_(&i__2, &r__1, &a[i + (*ku + i + 1) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = 1.f; + tau = wb / wa; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + sgemv_("No transpose", &i__2, &i__3, &c_b11, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, + &c_b13, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + r__1 = -(doublereal)tau; + sger_(&i__2, &i__3, &r__1, &work[1], &c__1, &a[i + (*ku + i) * + a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + a[i + (*ku + i) * a_dim1] = -(doublereal)wa; + } + +/* Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = snrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + wa = r_sign(&wn, &a[*kl + i + i * a_dim1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = a[*kl + i + i * a_dim1] + wa; + i__2 = *m - *kl - i; + r__1 = 1.f / wb; + sscal_(&i__2, &r__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + a[*kl + i + i * a_dim1] = 1.f; + tau = wb / wa; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + sgemv_("Transpose", &i__2, &i__3, &c_b11, &a[*kl + i + (i + 1) + * a_dim1], lda, &a[*kl + i + i * a_dim1], &c__1, & + c_b13, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + r__1 = -(doublereal)tau; + sger_(&i__2, &i__3, &r__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + a[*kl + i + i * a_dim1] = -(doublereal)wa; + } + } + + i__2 = *m; + for (j = *kl + i + 1; j <= i__2; ++j) { + a[j + i * a_dim1] = 0.f; +/* L50: */ + } + + i__2 = *n; + for (j = *ku + i + 1; j <= i__2; ++j) { + a[i + j * a_dim1] = 0.f; +/* L60: */ + } +/* L70: */ + } + return 0; + +/* End of SLAGGE */ + +} /* slagge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagsy.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagsy.c new file mode 100644 index 0000000..0471b82 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slagsy.c @@ -0,0 +1,272 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static real c_b12 = 0.f; +static real c_b19 = -1.f; +static real c_b26 = 1.f; + +/* Subroutine */ int slagsy_(integer *n, integer *k, real *d, real *a, + integer *lda, integer *iseed, real *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + real r__1; + + /* Builtin functions */ + double r_sign(real *, real *); + + /* Local variables */ + extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + extern real sdot_(integer *, real *, integer *, real *, integer *), + snrm2_(integer *, real *, integer *); + static integer i, j; + extern /* Subroutine */ int ssyr2_(char *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + static real alpha; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *), + sgemv_(char *, integer *, integer *, real *, real *, integer *, + real *, integer *, real *, real *, integer *), saxpy_( + integer *, real *, real *, integer *, real *, integer *), ssymv_( + char *, integer *, real *, real *, integer *, real *, integer *, + real *, real *, integer *); + static real wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), slarnv_( + integer *, integer *, integer *, real *); + static real tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLAGSY generates a real symmetric matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random orthogonal matrix: + + A = U*D*U'. The semi-bandwidth may then be reduced to k by additional + + orthogonal transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) REAL array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) REAL array, dimension (LDA,N) + The generated n by n symmetric matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) REAL array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("SLAGSY", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.f; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + a[i + i * a_dim1] = d[i]; +/* L30: */ + } + +/* Generate lower triangle of symmetric matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + slarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = snrm2_(&i__1, &work[1], &c__1); + wa = r_sign(&wn, &work[1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = work[1] + wa; + i__1 = *n - i; + r__1 = 1.f / wb; + sscal_(&i__1, &r__1, &work[2], &c__1); + work[1] = 1.f; + tau = wb / wa; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * u */ + + i__1 = *n - i + 1; + ssymv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b12, &work[*n + 1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + i__1 = *n - i + 1; + alpha = tau * -.5f * sdot_(&i__1, &work[*n + 1], &c__1, &work[1], & + c__1); + i__1 = *n - i + 1; + saxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) */ + + i__1 = *n - i + 1; + ssyr2_("Lower", &i__1, &c_b19, &work[1], &c__1, &work[*n + 1], &c__1, + &a[i + i * a_dim1], lda); +/* L40: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = snrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + wa = r_sign(&wn, &a[*k + i + i * a_dim1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = a[*k + i + i * a_dim1] + wa; + i__2 = *n - *k - i; + r__1 = 1.f / wb; + sscal_(&i__2, &r__1, &a[*k + i + 1 + i * a_dim1], &c__1); + a[*k + i + i * a_dim1] = 1.f; + tau = wb / wa; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + sgemv_("Transpose", &i__2, &i__3, &c_b26, &a[*k + i + (i + 1) * + a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b12, &work[1] + , &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + r__1 = -(doublereal)tau; + sger_(&i__2, &i__3, &r__1, &a[*k + i + i * a_dim1], &c__1, &work[1], & + c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * u */ + + i__2 = *n - *k - i + 1; + ssymv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b12, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + i__2 = *n - *k - i + 1; + alpha = tau * -.5f * sdot_(&i__2, &work[1], &c__1, &a[*k + i + i * + a_dim1], &c__1); + i__2 = *n - *k - i + 1; + saxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply symmetric rank-2 update to A(k+i:n,k+i:n) */ + + i__2 = *n - *k - i + 1; + ssyr2_("Lower", &i__2, &c_b19, &a[*k + i + i * a_dim1], &c__1, &work[ + 1], &c__1, &a[*k + i + (*k + i) * a_dim1], lda); + + a[*k + i + i * a_dim1] = -(doublereal)wa; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + a[j + i * a_dim1] = 0.f; +/* L50: */ + } +/* L60: */ + } + +/* Store full symmetric matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + a[j + i * a_dim1] = a[i + j * a_dim1]; +/* L70: */ + } +/* L80: */ + } + return 0; + +/* End of SLAGSY */ + +} /* slagsy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaran.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaran.c new file mode 100644 index 0000000..d4723ea --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaran.c @@ -0,0 +1,92 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal slaran_(integer *iseed) +{ + /* System generated locals */ + real ret_val; + + /* Local variables */ + static integer it1, it2, it3, it4; + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLARAN returns a random real number from a uniform (0,1) + distribution. + + Arguments + ========= + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine uses a multiplicative congruential method with modulus + 2**48 and multiplier 33952834046453 (see G.S.Fishman, + 'Multiplicative congruential random number generators with modulus + 2**b: an exhaustive analysis for b = 32 and a partial analysis for + b = 48', Math. Comp. 189, pp 331-344, 1990). + + 48-bit integers are stored in 4 integer array elements with 12 bits + per element. Hence the routine is portable across machines with + integers of 32 bits or more. + + ===================================================================== + + + + multiply the seed by the multiplier modulo 2**48 + + Parameter adjustments */ + --iseed; + + /* Function Body */ + it4 = iseed[4] * 2549; + it3 = it4 / 4096; + it4 -= it3 << 12; + it3 = it3 + iseed[3] * 2549 + iseed[4] * 2508; + it2 = it3 / 4096; + it3 -= it2 << 12; + it2 = it2 + iseed[2] * 2549 + iseed[3] * 2508 + iseed[4] * 322; + it1 = it2 / 4096; + it2 -= it1 << 12; + it1 = it1 + iseed[1] * 2549 + iseed[2] * 2508 + iseed[3] * 322 + iseed[4] + * 494; + it1 %= 4096; + +/* return updated seed */ + + iseed[1] = it1; + iseed[2] = it2; + iseed[3] = it3; + iseed[4] = it4; + +/* convert 48-bit integer to a real number in the interval (0,1) */ + + ret_val = ((real) it1 + ((real) it2 + ((real) it3 + (real) it4 * + 2.44140625e-4f) * 2.44140625e-4f) * 2.44140625e-4f) * + 2.44140625e-4f; + return ret_val; + +/* End of SLARAN */ + +} /* slaran_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarge.c new file mode 100644 index 0000000..557f474 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarge.c @@ -0,0 +1,152 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__3 = 3; +static integer c__1 = 1; +static real c_b8 = 1.f; +static real c_b10 = 0.f; + +/* Subroutine */ int slarge_(integer *n, real *a, integer *lda, integer * + iseed, real *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1; + real r__1; + + /* Builtin functions */ + double r_sign(real *, real *); + + /* Local variables */ + extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + extern real snrm2_(integer *, real *, integer *); + static integer i; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *), + sgemv_(char *, integer *, integer *, real *, real *, integer *, + real *, integer *, real *, real *, integer *); + static real wa, wb, wn; + extern /* Subroutine */ int xerbla_(char *, integer *), slarnv_( + integer *, integer *, integer *, real *); + static real tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLARGE pre- and post-multiplies a real general n by n matrix A + with a random orthogonal matrix: A = U*D*U'. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + A (input/output) REAL array, dimension (LDA,N) + On entry, the original n by n matrix A. + On exit, A is overwritten by U*A*U' for some random + orthogonal matrix U. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) REAL array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*lda < max(1,*n)) { + *info = -3; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("SLARGE", &i__1); + return 0; + } + +/* pre- and post-multiply A by random orthogonal matrix */ + + for (i = *n; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + slarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = snrm2_(&i__1, &work[1], &c__1); + wa = r_sign(&wn, &work[1]); + if (wn == 0.f) { + tau = 0.f; + } else { + wb = work[1] + wa; + i__1 = *n - i; + r__1 = 1.f / wb; + sscal_(&i__1, &r__1, &work[2], &c__1); + work[1] = 1.f; + tau = wb / wa; + } + +/* multiply A(i:n,1:n) by random reflection from the left */ + + i__1 = *n - i + 1; + sgemv_("Transpose", &i__1, n, &c_b8, &a[i + a_dim1], lda, &work[1], & + c__1, &c_b10, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + r__1 = -(doublereal)tau; + sger_(&i__1, n, &r__1, &work[1], &c__1, &work[*n + 1], &c__1, &a[i + + a_dim1], lda); + +/* multiply A(1:n,i:n) by random reflection from the right */ + + i__1 = *n - i + 1; + sgemv_("No transpose", n, &i__1, &c_b8, &a[i * a_dim1 + 1], lda, & + work[1], &c__1, &c_b10, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + r__1 = -(doublereal)tau; + sger_(n, &i__1, &r__1, &work[*n + 1], &c__1, &work[1], &c__1, &a[i * + a_dim1 + 1], lda); +/* L10: */ + } + return 0; + +/* End of SLARGE */ + +} /* slarge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnd.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnd.c new file mode 100644 index 0000000..e3fcc0e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnd.c @@ -0,0 +1,94 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal slarnd_(integer *idist, integer *iseed) +{ + /* System generated locals */ + real ret_val; + + /* Builtin functions */ + double log(doublereal), sqrt(doublereal), cos(doublereal); + + /* Local variables */ + static real t1, t2; + extern doublereal slaran_(integer *); + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLARND returns a random real number from a uniform or normal + distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: uniform (0,1) + = 2: uniform (-1,1) + = 3: normal (0,1) + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine calls the auxiliary routine SLARAN to generate a random + + real number from a uniform (0,1) distribution. The Box-Muller method + + is used to transform numbers from a uniform to a normal distribution. + + + ===================================================================== + + + + Generate a real random number from a uniform (0,1) distribution + + Parameter adjustments */ + --iseed; + + /* Function Body */ + t1 = slaran_(&iseed[1]); + + if (*idist == 1) { + +/* uniform (0,1) */ + + ret_val = t1; + } else if (*idist == 2) { + +/* uniform (-1,1) */ + + ret_val = t1 * 2.f - 1.f; + } else if (*idist == 3) { + +/* normal (0,1) */ + + t2 = slaran_(&iseed[1]); + ret_val = sqrt(log(t1) * -2.f) * cos(t2 * + 6.2831853071795864769252867663f); + } + return ret_val; + +/* End of SLARND */ + +} /* slarnd_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnv.c new file mode 100644 index 0000000..ee41fa8 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarnv.c @@ -0,0 +1,124 @@ +#include "f2c.h" + +/* Subroutine */ int slarnv_(integer *idist, integer *iseed, integer *n, real + *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLARNV returns a vector of n random real numbers from a uniform or + normal distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: uniform (0,1) + = 2: uniform (-1,1) + = 3: normal (0,1) + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. + + X (output) REAL array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine calls the auxiliary routine SLARUV to generate random + real numbers from a uniform (0,1) distribution, in batches of up to + 128 using vectorisable code. The Box-Muller method is used to + transform numbers from a uniform to a normal distribution. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2, i__3; + /* Builtin functions */ + double log(doublereal), sqrt(doublereal), cos(doublereal); + /* Local variables */ + static integer i; + static real u[128]; + static integer il, iv, il2; + extern /* Subroutine */ int slaruv_(integer *, integer *, real *); + + +#define X(I) x[(I)-1] +#define ISEED(I) iseed[(I)-1] + + + i__1 = *n; + for (iv = 1; iv <= *n; iv += 64) { +/* Computing MIN */ + i__2 = 64, i__3 = *n - iv + 1; + il = min(i__2,i__3); + if (*idist == 3) { + il2 = il << 1; + } else { + il2 = il; + } + +/* Call SLARUV to generate IL2 numbers from a uniform (0,1) + distribution (IL2 <= LV) */ + + slaruv_(&ISEED(1), &il2, u); + + if (*idist == 1) { + +/* Copy generated numbers */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = u[i - 1]; +/* L10: */ + } + } else if (*idist == 2) { + +/* Convert generated numbers to uniform (-1,1) distribut +ion */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = u[i - 1] * 2.f - 1.f; +/* L20: */ + } + } else if (*idist == 3) { + +/* Convert generated numbers to normal (0,1) distributio +n */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + X(iv + i - 1) = sqrt(log(u[(i << 1) - 2]) * -2.f) * cos(u[(i + << 1) - 1] * 6.2831853071795864769252867663f); +/* L30: */ + } + } +/* L40: */ + } + return 0; + +/* End of SLARNV */ + +} /* slarnv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaror.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaror.c new file mode 100644 index 0000000..e33c902 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaror.c @@ -0,0 +1,287 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static real c_b9 = 0.f; +static real c_b10 = 1.f; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int slaror_(char *side, char *init, integer *m, integer *n, + real *a, integer *lda, integer *iseed, real *x, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + real r__1; + + /* Builtin functions */ + double r_sign(real *, real *); + + /* Local variables */ + static integer kbeg, jcol; + extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + static integer irow; + extern real snrm2_(integer *, real *, integer *); + static integer j; + extern logical lsame_(char *, char *); + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *), + sgemv_(char *, integer *, integer *, real *, real *, integer *, + real *, integer *, real *, real *, integer *); + static integer ixfrm, itype, nxfrm; + static real xnorm; + extern /* Subroutine */ int xerbla_(char *, integer *); + static real factor; + extern doublereal slarnd_(integer *, integer *); + extern /* Subroutine */ int slaset_(char *, integer *, integer *, real *, + real *, real *, integer *); + static real xnorms; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLAROR pre- or post-multiplies an M by N matrix A by a random + orthogonal matrix U, overwriting A. A may optionally be initialized + + to the identity matrix before multiplying by U. U is generated using + + the method of G.W. Stewart (SIAM J. Numer. Anal. 17, 1980, 403-409). + + + Arguments + ========= + + SIDE (input) CHARACTER*1 + Specifies whether A is multiplied on the left or right by U. + + = 'L': Multiply A on the left (premultiply) by U + = 'R': Multiply A on the right (postmultiply) by U' + = 'C' or 'T': Multiply A on the left by U and the right + by U' (Here, U' means U-transpose.) + + INIT (input) CHARACTER*1 + Specifies whether or not A should be initialized to the + identity matrix. + = 'I': Initialize A to (a section of) the identity matrix + before applying U. + = 'N': No initialization. Apply U to the input matrix A. + + INIT = 'I' may be used to generate square or rectangular + orthogonal matrices: + + For M = N and SIDE = 'L' or 'R', the rows will be orthogonal + + to each other, as will the columns. + + If M < N, SIDE = 'R' produces a dense matrix whose rows are + orthogonal and whose columns are not, while SIDE = 'L' + produces a matrix whose rows are orthogonal, and whose first + + M columns are orthogonal, and whose remaining columns are + zero. + + If M > N, SIDE = 'L' produces a dense matrix whose columns + are orthogonal and whose rows are not, while SIDE = 'R' + produces a matrix whose columns are orthogonal, and whose + first M rows are orthogonal, and whose remaining rows are + zero. + + M (input) INTEGER + The number of rows of A. + + N (input) INTEGER + The number of columns of A. + + A (input/output) REAL array, dimension (LDA, N) + On entry, the array A. + On exit, overwritten by U A ( if SIDE = 'L' ), + or by A U ( if SIDE = 'R' ), + or by U A U' ( if SIDE = 'C' or 'T'). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ISEED (input/output) INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. The array elements should be between 0 and 4095; + if not they will be reduced mod 4096. Also, ISEED(4) must + be odd. The random number generator uses a linear + congruential sequence limited to small integers, and so + should produce machine independent random numbers. The + values of ISEED are changed on exit, and can be used in the + next call to SLAROR to continue the same random number + sequence. + + X (workspace) REAL array, dimension (3*MAX( M, N )) + Workspace of length + 2*M + N if SIDE = 'L', + 2*N + M if SIDE = 'R', + 3*N if SIDE = 'C' or 'T'. + + INFO (output) INTEGER + An error flag. It is set to: + = 0: normal return + < 0: if INFO = -k, the k-th argument had an illegal value + = 1: if the random numbers generated by SLARND are bad. + + ===================================================================== + + + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --x; + + /* Function Body */ + if (*n == 0 || *m == 0) { + return 0; + } + + itype = 0; + if (lsame_(side, "L")) { + itype = 1; + } else if (lsame_(side, "R")) { + itype = 2; + } else if (lsame_(side, "C") || lsame_(side, "T")) { + itype = 3; + } + +/* Check for argument errors. */ + + *info = 0; + if (itype == 0) { + *info = -1; + } else if (*m < 0) { + *info = -3; + } else if (*n < 0 || itype == 3 && *n != *m) { + *info = -4; + } else if (*lda < *m) { + *info = -6; + } + if (*info != 0) { + i__1 = -(*info); + xerbla_("SLAROR", &i__1); + return 0; + } + + if (itype == 1) { + nxfrm = *m; + } else { + nxfrm = *n; + } + +/* Initialize A to the identity matrix if desired */ + + if (lsame_(init, "I")) { + slaset_("Full", m, n, &c_b9, &c_b10, &a[a_offset], lda); + } + +/* If no rotation possible, multiply by random +/-1 + + Compute rotation by computing Householder transformations + H(2), H(3), ..., H(nhouse) */ + + i__1 = nxfrm; + for (j = 1; j <= i__1; ++j) { + x[j] = 0.f; +/* L10: */ + } + + i__1 = nxfrm; + for (ixfrm = 2; ixfrm <= i__1; ++ixfrm) { + kbeg = nxfrm - ixfrm + 1; + +/* Generate independent normal( 0, 1 ) random numbers */ + + i__2 = nxfrm; + for (j = kbeg; j <= i__2; ++j) { + x[j] = slarnd_(&c__3, &iseed[1]); +/* L20: */ + } + +/* Generate a Householder transformation from the random vector + X */ + + xnorm = snrm2_(&ixfrm, &x[kbeg], &c__1); + xnorms = r_sign(&xnorm, &x[kbeg]); + r__1 = -(doublereal)x[kbeg]; + x[kbeg + nxfrm] = r_sign(&c_b10, &r__1); + factor = xnorms * (xnorms + x[kbeg]); + if (dabs(factor) < 1e-20f) { + *info = 1; + xerbla_("SLAROR", info); + return 0; + } else { + factor = 1.f / factor; + } + x[kbeg] += xnorms; + +/* Apply Householder transformation to A */ + + if (itype == 1 || itype == 3) { + +/* Apply H(k) from the left. */ + + sgemv_("T", &ixfrm, n, &c_b10, &a[kbeg + a_dim1], lda, &x[kbeg], & + c__1, &c_b9, &x[(nxfrm << 1) + 1], &c__1); + r__1 = -(doublereal)factor; + sger_(&ixfrm, n, &r__1, &x[kbeg], &c__1, &x[(nxfrm << 1) + 1], & + c__1, &a[kbeg + a_dim1], lda); + + } + + if (itype == 2 || itype == 3) { + +/* Apply H(k) from the right. */ + + sgemv_("N", m, &ixfrm, &c_b10, &a[kbeg * a_dim1 + 1], lda, &x[ + kbeg], &c__1, &c_b9, &x[(nxfrm << 1) + 1], &c__1); + r__1 = -(doublereal)factor; + sger_(m, &ixfrm, &r__1, &x[(nxfrm << 1) + 1], &c__1, &x[kbeg], & + c__1, &a[kbeg * a_dim1 + 1], lda); + + } +/* L30: */ + } + + r__1 = slarnd_(&c__3, &iseed[1]); + x[nxfrm * 2] = r_sign(&c_b10, &r__1); + +/* Scale the matrix A by D. */ + + if (itype == 1 || itype == 3) { + i__1 = *m; + for (irow = 1; irow <= i__1; ++irow) { + sscal_(n, &x[nxfrm + irow], &a[irow + a_dim1], lda); +/* L40: */ + } + } + + if (itype == 2 || itype == 3) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + sscal_(m, &x[nxfrm + jcol], &a[jcol * a_dim1 + 1], &c__1); +/* L50: */ + } + } + return 0; + +/* End of SLAROR */ + +} /* slaror_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarot.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarot.c new file mode 100644 index 0000000..0ec97fa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slarot.c @@ -0,0 +1,299 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__4 = 4; +static integer c__8 = 8; +static integer c__1 = 1; + +/* Subroutine */ int slarot_(logical *lrows, logical *lleft, logical *lright, + integer *nl, real *c, real *s, real *a, integer *lda, real *xleft, + real *xright) +{ + /* System generated locals */ + integer i__1; + + /* Local variables */ + static integer iinc; + extern /* Subroutine */ int srot_(integer *, real *, integer *, real *, + integer *, real *, real *); + static integer inext, ix, iy, nt; + static real xt[2], yt[2]; + extern /* Subroutine */ int xerbla_(char *, integer *); + static integer iyt; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLAROT applies a (Givens) rotation to two adjacent rows or + columns, where one element of the first and/or last column/row + may be a separate variable. This is specifically indended + for use on matrices stored in some format other than GE, so + that elements of the matrix may be used or modified for which + no array element is provided. + + One example is a symmetric matrix in SB format (bandwidth=4), for + + which UPLO='L': Two adjacent rows will have the format: + + row j: * * * * * . . . . + row j+1: * * * * * . . . . + + '*' indicates elements for which storage is provided, + '.' indicates elements for which no storage is provided, but + are not necessarily zero; their values are determined by + symmetry. ' ' indicates elements which are necessarily zero, + and have no storage provided. + + Those columns which have two '*'s can be handled by SROT. + Those columns which have no '*'s can be ignored, since as long + as the Givens rotations are carefully applied to preserve + symmetry, their values are determined. + Those columns which have one '*' have to be handled separately, + by using separate variables "p" and "q": + + row j: * * * * * p . . . + row j+1: q * * * * * . . . . + + The element p would have to be set correctly, then that column + is rotated, setting p to its new value. The next call to + SLAROT would rotate columns j and j+1, using p, and restore + symmetry. The element q would start out being zero, and be + made non-zero by the rotation. Later, rotations would presumably + + be chosen to zero q out. + + Typical Calling Sequences: rotating the i-th and (i+1)-st rows. + ------- ------- --------- + + General dense matrix: + + CALL SLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S, + A(i,1),LDA, DUMMY, DUMMY) + + General banded matrix in GB format: + + j = MAX(1, i-KL ) + NL = MIN( N, i+KU+1 ) + 1-j + CALL SLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S, + A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,KL+1) ] + + Symmetric banded matrix in SY format, bandwidth K, + lower triangle only: + + j = MAX(1, i-K ) + NL = MIN( K+1, i ) + 1 + CALL SLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S, + A(i,j), LDA, XLEFT, XRIGHT ) + + Same, but upper triangle only: + + NL = MIN( K+1, N-i ) + 1 + CALL SLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S, + A(i,i), LDA, XLEFT, XRIGHT ) + + Symmetric banded matrix in SB format, bandwidth K, + lower triangle only: + + [ same as for SY, except:] + . . . . + A(i+1-j,j), LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,K+1) ] + + Same, but upper triangle only: + . . . + A(K+1,i), LDA-1, XLEFT, XRIGHT ) + + Rotating columns is just the transpose of rotating rows, except + + for GB and SB: (rotating columns i and i+1) + + GB: + j = MAX(1, i-KU ) + NL = MIN( N, i+KL+1 ) + 1-j + CALL SLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S, + A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + [note that KU+j+1-i is just MAX(1,KU+2-i)] + + SB: (upper triangle) + + . . . . . . + A(K+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + SB: (lower triangle) + + . . . . . . + A(1,i),LDA-1, XTOP, XBOTTM ) + + Arguments + ========= + + LROWS - LOGICAL + If .TRUE., then SLAROT will rotate two rows. If .FALSE., + then it will rotate two columns. + Not modified. + + LLEFT - LOGICAL + If .TRUE., then XLEFT will be used instead of the + corresponding element of A for the first element in the + second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) + If .FALSE., then the corresponding element of A will be + used. + Not modified. + + LRIGHT - LOGICAL + If .TRUE., then XRIGHT will be used instead of the + corresponding element of A for the last element in the + first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If + + .FALSE., then the corresponding element of A will be used. + Not modified. + + NL - INTEGER + The length of the rows (if LROWS=.TRUE.) or columns (if + LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are + used, the columns/rows they are in should be included in + NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at + least 2. The number of rows/columns to be rotated + exclusive of those involving XLEFT and/or XRIGHT may + not be negative, i.e., NL minus how many of LLEFT and + LRIGHT are .TRUE. must be at least zero; if not, XERBLA + will be called. + Not modified. + + C, S - REAL + Specify the Givens rotation to be applied. If LROWS is + true, then the matrix ( c s ) + (-s c ) is applied from the left; + if false, then the transpose thereof is applied from the + right. For a Givens rotation, C**2 + S**2 should be 1, + but this is not checked. + Not modified. + + A - REAL array. + The array containing the rows/columns to be rotated. The + first element of A should be the upper left element to + be rotated. + Read and modified. + + LDA - INTEGER + The "effective" leading dimension of A. If A contains + a matrix stored in GE or SY format, then this is just + the leading dimension of A as dimensioned in the calling + routine. If A contains a matrix stored in band (GB or SB) + format, then this should be *one less* than the leading + dimension used in the calling routine. Thus, if + A were dimensioned A(LDA,*) in SLAROT, then A(1,j) would + be the j-th element in the first of the two rows + to be rotated, and A(2,j) would be the j-th in the second, + regardless of how the array may be stored in the calling + routine. [A cannot, however, actually be dimensioned thus, + + since for band format, the row number may exceed LDA, which + + is not legal FORTRAN.] + If LROWS=.TRUE., then LDA must be at least 1, otherwise + it must be at least NL minus the number of .TRUE. values + in XLEFT and XRIGHT. + Not modified. + + XLEFT - REAL + If LLEFT is .TRUE., then XLEFT will be used and modified + instead of A(2,1) (if LROWS=.TRUE.) or A(1,2) + (if LROWS=.FALSE.). + Read and modified. + + XRIGHT - REAL + If LRIGHT is .TRUE., then XRIGHT will be used and modified + instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1) + (if LROWS=.FALSE.). + Read and modified. + + ===================================================================== + + + + Set up indices, arrays for ends + + Parameter adjustments */ + --a; + + /* Function Body */ + if (*lrows) { + iinc = *lda; + inext = 1; + } else { + iinc = 1; + inext = *lda; + } + + if (*lleft) { + nt = 1; + ix = iinc + 1; + iy = *lda + 2; + xt[0] = a[1]; + yt[0] = *xleft; + } else { + nt = 0; + ix = 1; + iy = inext + 1; + } + + if (*lright) { + iyt = inext + 1 + (*nl - 1) * iinc; + ++nt; + xt[nt - 1] = *xright; + yt[nt - 1] = a[iyt]; + } + +/* Check for errors */ + + if (*nl < nt) { + xerbla_("SLAROT", &c__4); + return 0; + } + if (*lda <= 0 || ! (*lrows) && *lda < *nl - nt) { + xerbla_("SLAROT", &c__8); + return 0; + } + +/* Rotate */ + + i__1 = *nl - nt; + srot_(&i__1, &a[ix], &iinc, &a[iy], &iinc, c, s); + srot_(&nt, xt, &c__1, yt, &c__1, c, s); + +/* Stuff values back into XLEFT, XRIGHT, etc. */ + + if (*lleft) { + a[1] = xt[0]; + *xleft = yt[0]; + } + + if (*lright) { + *xright = xt[nt - 1]; + a[iyt] = yt[nt - 1]; + } + + return 0; + +/* End of SLAROT */ + +} /* slarot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slartg.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slartg.c new file mode 100644 index 0000000..bd44870 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slartg.c @@ -0,0 +1,156 @@ +#include "f2c.h" + +/* Subroutine */ int slartg_(real *f, real *g, real *cs, real *sn, real *r) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLARTG generate a plane rotation so that + + [ CS SN ] . [ F ] = [ R ] where CS**2 + SN**2 = 1. + [ -SN CS ] [ G ] [ 0 ] + + This is a slower, more accurate version of the BLAS1 routine SROTG, + with the following other differences: + F and G are unchanged on return. + If G=0, then CS=1 and SN=0. + If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any + floating point operations (saves work in SBDSQR when + there are zeros on the diagonal). + + If F exceeds G in magnitude, CS will be positive. + + Arguments + ========= + + F (input) REAL + The first component of vector to be rotated. + + G (input) REAL + The second component of vector to be rotated. + + CS (output) REAL + The cosine of the rotation. + + SN (output) REAL + The sine of the rotation. + + R (output) REAL + The nonzero component of the rotated vector. + + ===================================================================== +*/ + /* Initialized data */ + static logical first = TRUE_; + /* System generated locals */ + integer i__1; + real r__1, r__2; + /* Builtin functions */ + double log(doublereal), pow_ri(real *, integer *), sqrt(doublereal); + /* Local variables */ + static integer i; + static real scale; + static integer count; + static real f1, g1, safmn2, safmx2; + extern float slamch_(char *); + static real safmin, eps; + + + if (first) { + first = FALSE_; + safmin = slamch_("S"); + eps = slamch_("E"); + r__1 = slamch_("B"); + i__1 = (integer) (log(safmin / eps) / log(slamch_("B")) / 2.f); + safmn2 = pow_ri(&r__1, &i__1); + safmx2 = 1.f / safmn2; + } + if (*g == 0.f) { + *cs = 1.f; + *sn = 0.f; + *r = *f; + } else if (*f == 0.f) { + *cs = 0.f; + *sn = 1.f; + *r = *g; + } else { + f1 = *f; + g1 = *g; +/* Computing MAX */ + r__1 = dabs(f1), r__2 = dabs(g1); + scale = dmax(r__1,r__2); + if (scale >= safmx2) { + count = 0; +L10: + ++count; + f1 *= safmn2; + g1 *= safmn2; +/* Computing MAX */ + r__1 = dabs(f1), r__2 = dabs(g1); + scale = dmax(r__1,r__2); + if (scale >= safmx2) { + goto L10; + } +/* Computing 2nd power */ + r__1 = f1; +/* Computing 2nd power */ + r__2 = g1; + *r = sqrt(r__1 * r__1 + r__2 * r__2); + *cs = f1 / *r; + *sn = g1 / *r; + i__1 = count; + for (i = 1; i <= count; ++i) { + *r *= safmx2; +/* L20: */ + } + } else if (scale <= safmn2) { + count = 0; +L30: + ++count; + f1 *= safmx2; + g1 *= safmx2; +/* Computing MAX */ + r__1 = dabs(f1), r__2 = dabs(g1); + scale = dmax(r__1,r__2); + if (scale <= safmn2) { + goto L30; + } +/* Computing 2nd power */ + r__1 = f1; +/* Computing 2nd power */ + r__2 = g1; + *r = sqrt(r__1 * r__1 + r__2 * r__2); + *cs = f1 / *r; + *sn = g1 / *r; + i__1 = count; + for (i = 1; i <= count; ++i) { + *r *= safmn2; +/* L40: */ + } + } else { +/* Computing 2nd power */ + r__1 = f1; +/* Computing 2nd power */ + r__2 = g1; + *r = sqrt(r__1 * r__1 + r__2 * r__2); + *cs = f1 / *r; + *sn = g1 / *r; + } + if (dabs(*f) > dabs(*g) && *cs < 0.f) { + *cs = -(doublereal)(*cs); + *sn = -(doublereal)(*sn); + *r = -(doublereal)(*r); + } + } + return 0; + +/* End of SLARTG */ + +} /* slartg_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaruv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaruv.c new file mode 100644 index 0000000..b2fd4b7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaruv.c @@ -0,0 +1,152 @@ +#include "f2c.h" + +/* Subroutine */ int slaruv_(integer *iseed, integer *n, real *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLARUV returns a vector of n random real numbers from a uniform (0,1) + + distribution (n <= 128). + + This is an auxiliary routine called by SLARNV and CLARNV. + + Arguments + ========= + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. N <= 128. + + X (output) REAL array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine uses a multiplicative congruential method with modulus + 2**48 and multiplier 33952834046453 (see G.S.Fishman, + 'Multiplicative congruential random number generators with modulus + 2**b: an exhaustive analysis for b = 32 and a partial analysis for + b = 48', Math. Comp. 189, pp 331-344, 1990). + + 48-bit integers are stored in 4 integer array elements with 12 bits + per element. Hence the routine is portable across machines with + integers of 32 bits or more. + + ===================================================================== + + + + Parameter adjustments + Function Body */ + /* Initialized data */ + static integer mm[512] /* was [128][4] */ = { 494,2637,255,2008,1253, + 3344,4084,1739,3143,3468,688,1657,1238,3166,1292,3422,1270,2016, + 154,2862,697,1706,491,931,1444,444,3577,3944,2184,1661,3482,657, + 3023,3618,1267,1828,164,3798,3087,2400,2870,3876,1905,1593,1797, + 1234,3460,328,2861,1950,617,2070,3331,769,1558,2412,2800,189,287, + 2045,1227,2838,209,2770,3654,3993,192,2253,3491,2889,2857,2094, + 1818,688,1407,634,3231,815,3524,1914,516,164,303,2144,3480,119, + 3357,837,2826,2332,2089,3780,1700,3712,150,2000,3375,1621,3090, + 3765,1149,3146,33,3082,2741,359,3316,1749,185,2784,2202,2199,1364, + 1244,2020,3160,2785,2772,1217,1822,1245,2252,3904,2774,997,2573, + 1148,545,322,789,1440,752,2859,123,1848,643,2405,2638,2344,46, + 3814,913,3649,339,3808,822,2832,3078,3633,2970,637,2249,2081,4019, + 1478,242,481,2075,4058,622,3376,812,234,641,4005,1122,3135,2640, + 2302,40,1832,2247,2034,2637,1287,1691,496,1597,2394,2584,1843,336, + 1472,2407,433,2096,1761,2810,566,442,41,1238,1086,603,840,3168, + 1499,1084,3438,2408,1589,2391,288,26,512,1456,171,1677,2657,2270, + 2587,2961,1970,1817,676,1410,3723,2803,3185,184,663,499,3784,1631, + 1925,3912,1398,1349,1441,2224,2411,1907,3192,2786,382,37,759,2948, + 1862,3802,2423,2051,2295,1332,1832,2405,3638,3661,327,3660,716, + 1842,3987,1368,1848,2366,2508,3754,1766,3572,2893,307,1297,3966, + 758,2598,3406,2922,1038,2934,2091,2451,1580,1958,2055,1507,1078, + 3273,17,854,2916,3971,2889,3831,2621,1541,893,736,3992,787,2125, + 2364,2460,257,1574,3912,1216,3248,3401,2124,2762,149,2245,166,466, + 4018,1399,190,2879,153,2320,18,712,2159,2318,2091,3443,1510,449, + 1956,2201,3137,3399,1321,2271,3667,2703,629,2365,2431,1113,3922, + 2554,184,2099,3228,4012,1921,3452,3901,572,3309,3171,817,3039, + 1696,1256,3715,2077,3019,1497,1101,717,51,981,1978,1813,3881,76, + 3846,3694,1682,124,1660,3997,479,1141,886,3514,1301,3604,1888, + 1836,1990,2058,692,1194,20,3285,2046,2107,3508,3525,3801,2549, + 1145,2253,305,3301,1065,3133,2913,3285,1241,1197,3729,2501,1673, + 541,2753,949,2361,1165,4081,2725,3305,3069,3617,3733,409,2157, + 1361,3973,1865,2525,1409,3445,3577,77,3761,2149,1449,3005,225,85, + 3673,3117,3089,1349,2057,413,65,1845,697,3085,3441,1573,3689,2941, + 929,533,2841,4077,721,2821,2249,2397,2817,245,1913,1997,3121,997, + 1833,2877,1633,981,2009,941,2449,197,2441,285,1473,2741,3129,909, + 2801,421,4073,2813,2337,1429,1177,1901,81,1669,2633,2269,129,1141, + 249,3917,2481,3941,2217,2749,3041,1877,345,2861,1809,3141,2825, + 157,2881,3637,1465,2829,2161,3365,361,2685,3745,2325,3609,3821, + 3537,517,3017,2141,1537 }; + /* System generated locals */ + integer i__1; + /* Local variables */ + static integer i, i1, i2, i3, i4, it1, it2, it3, it4; + + +#define MM(I) mm[(I)] +#define WAS(I) was[(I)] +#define ISEED(I) iseed[(I)-1] +#define X(I) x[(I)-1] + + + + i1 = ISEED(1); + i2 = ISEED(2); + i3 = ISEED(3); + i4 = ISEED(4); + + i__1 = min(*n,128); + for (i = 1; i <= min(*n,128); ++i) { + +/* Multiply the seed by i-th power of the multiplier modulo 2** +48 */ + + it4 = i4 * MM(i + 383); + it3 = it4 / 4096; + it4 -= it3 << 12; + it3 = it3 + i3 * MM(i + 383) + i4 * MM(i + 255); + it2 = it3 / 4096; + it3 -= it2 << 12; + it2 = it2 + i2 * MM(i + 383) + i3 * MM(i + 255) + i4 * MM(i + 127); + it1 = it2 / 4096; + it2 -= it1 << 12; + it1 = it1 + i1 * MM(i + 383) + i2 * MM(i + 255) + i3 * MM(i + 127) + + i4 * MM(i - 1); + it1 %= 4096; + +/* Convert 48-bit integer to a real number in the interval (0,1 +) */ + + X(i) = ((real) it1 + ((real) it2 + ((real) it3 + (real) it4 * + 2.44140625e-4f) * 2.44140625e-4f) * 2.44140625e-4f) * + 2.44140625e-4f; +/* L10: */ + } + +/* Return final value of seed */ + + ISEED(1) = it1; + ISEED(2) = it2; + ISEED(3) = it3; + ISEED(4) = it4; + return 0; + +/* End of SLARUV */ + +} /* slaruv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaset.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaset.c new file mode 100644 index 0000000..9ea5eee --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slaset.c @@ -0,0 +1,136 @@ +#include "f2c.h" + +/* Subroutine */ int slaset_(char *uplo, integer *m, integer *n, real *alpha, + real *beta, real *a, integer *lda) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + SLASET initializes an m-by-n matrix A to BETA on the diagonal and + ALPHA on the offdiagonals. + + Arguments + ========= + + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be set. + = 'U': Upper triangular part is set; the strictly lower + + triangular part of A is not changed. + = 'L': Lower triangular part is set; the strictly upper + + triangular part of A is not changed. + Otherwise: All of the matrix A is set. + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + ALPHA (input) REAL + The constant to which the offdiagonal elements are to be set. + + + BETA (input) REAL + The constant to which the diagonal elements are to be set. + + A (input/output) REAL array, dimension (LDA,N) + On exit, the leading m-by-n submatrix of A is set as follows: + + + if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, + if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, + otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, + + and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + /* Local variables */ + static integer i, j; + extern logical lsame_(char *, char *); + + + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + if (lsame_(uplo, "U")) { + +/* Set the strictly upper triangular or trapezoidal part of the + + array to ALPHA. */ + + i__1 = *n; + for (j = 2; j <= *n; ++j) { +/* Computing MIN */ + i__3 = j - 1; + i__2 = min(i__3,*m); + for (i = 1; i <= min(j-1,*m); ++i) { + A(i,j) = *alpha; +/* L10: */ + } +/* L20: */ + } + + } else if (lsame_(uplo, "L")) { + +/* Set the strictly lower triangular or trapezoidal part of the + + array to ALPHA. */ + + i__1 = min(*m,*n); + for (j = 1; j <= min(*m,*n); ++j) { + i__2 = *m; + for (i = j + 1; i <= *m; ++i) { + A(i,j) = *alpha; +/* L30: */ + } +/* L40: */ + } + + } else { + +/* Set the leading m-by-n submatrix to ALPHA. */ + + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + A(i,j) = *alpha; +/* L50: */ + } +/* L60: */ + } + } + +/* Set the first min(M,N) diagonal elements to BETA. */ + + i__1 = min(*m,*n); + for (i = 1; i <= min(*m,*n); ++i) { + A(i,i) = *beta; +/* L70: */ + } + + return 0; + +/* End of SLASET */ + +} /* slaset_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatb4.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatb4.c new file mode 100644 index 0000000..793592a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatb4.c @@ -0,0 +1,466 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include +#include "f2c.h" + +/* Table of constant values */ + +static integer c__2 = 2; + +/* Subroutine */ int slatb4_(char *path, integer *imat, integer *m, integer * + n, char *type, integer *kl, integer *ku, real *anorm, integer *mode, + real *cndnum, char *dist) +{ + /* Initialized data */ + + static logical first = TRUE_; + + /* System generated locals */ + integer i__1; + + /* Builtin functions */ + double sqrt(doublereal); + + /* Local variables */ + static real badc1, badc2, large, small; + static char c2[2]; + extern /* Subroutine */ int slabad_(real *, real *); + extern float slamch_(char *); + extern logical lsamen_(integer *, char *, char *); + static integer mat; + static real eps; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLATB4 sets parameters for the matrix generator based on the type of + + matrix to be generated. + + Arguments + ========= + + PATH (input) CHARACTER*3 + The LAPACK path name. + + IMAT (input) INTEGER + An integer key describing which matrix to generate for this + path. + + M (input) INTEGER + The number of rows in the matrix to be generated. + + N (input) INTEGER + The number of columns in the matrix to be generated. + + TYPE (output) CHARACTER*1 + The type of the matrix to be generated: + = 'S': symmetric matrix + = 'P': symmetric positive (semi)definite matrix + = 'N': nonsymmetric matrix + + KL (output) INTEGER + The lower band width of the matrix to be generated. + + KU (output) INTEGER + The upper band width of the matrix to be generated. + + ANORM (output) REAL + The desired norm of the matrix to be generated. The diagonal + + matrix of singular values or eigenvalues is scaled by this + value. + + MODE (output) INTEGER + A key indicating how to choose the vector of eigenvalues. + + CNDNUM (output) REAL + The desired condition number. + + DIST (output) CHARACTER*1 + The type of distribution to be used by the random number + generator. + + ===================================================================== + + + + Set some constants for use in the subroutine. */ + + if (first) { + first = FALSE_; + eps = slamch_("Precision"); + badc2 = .1f / eps; + badc1 = sqrt(badc2); + small = slamch_("Safe minimum"); + large = 1.f / small; + +/* If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + + slabad_(&small, &large); + small = small / eps * .25f; + large = 1.f / small; + } + + strncpy(c2, path + 1, 2); + +/* Set some parameters we don't plan to change. */ + + *(unsigned char *)dist = 'S'; + *mode = 3; + + if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2, "LQ") + || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) { + +/* xQR, xLQ, xQL, xRQ: Set parameters to generate a general + M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GE")) { + +/* xGE: Set parameters to generate a general M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 8) { + *cndnum = badc1; + } else if (*imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 10) { + *anorm = small; + } else if (*imat == 11) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GB")) { + +/* xGB: Set parameters to generate a general banded matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2 * .1f; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "GT")) { + +/* xGT: Set parameters to generate a general tridiagonal matri +x. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&c__2, c2, "PP") || lsamen_(&c__2, c2, "SY") || lsamen_(&c__2, c2, + "SP")) { + +/* xPO, xPP, xSY, xSP: Set parameters to generate a + symmetric matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = *(unsigned char *)c2; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 6) { + *cndnum = badc1; + } else if (*imat == 7) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 8) { + *anorm = small; + } else if (*imat == 9) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PB")) { + +/* xPB: Set parameters to generate a symmetric band matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'P'; + +/* Set the norm and condition number. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "PT")) { + +/* xPT: Set parameters to generate a symmetric positive defini +te + tridiagonal matrix. */ + + *(unsigned char *)type = 'P'; + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&c__2, c2, "TP")) { + +/* xTR, xTP: Set parameters to generate a triangular matrix + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + mat = abs(*imat); + if (mat == 1 || mat == 7) { + *kl = 0; + *ku = 0; + } else if (*imat < 0) { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + *ku = 0; + } else { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (mat == 3 || mat == 9) { + *cndnum = badc1; + } else if (mat == 4) { + *cndnum = badc2; + } else if (mat == 10) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (mat == 5) { + *anorm = small; + } else if (mat == 6) { + *anorm = large; + } else { + *anorm = 1.f; + } + + } else if (lsamen_(&c__2, c2, "TB")) { + +/* xTB: Set parameters to generate a triangular band matrix. + + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the norm and condition number. */ + + if (*imat == 2 || *imat == 8) { + *cndnum = badc1; + } else if (*imat == 3 || *imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.f; + } + + if (*imat == 4) { + *anorm = small; + } else if (*imat == 5) { + *anorm = large; + } else { + *anorm = 1.f; + } + } + if (*n <= 1) { + *cndnum = 1.f; + } + + return 0; + +/* End of SLATB4 */ + +} /* slatb4_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm1.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm1.c new file mode 100644 index 0000000..0a648b5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm1.c @@ -0,0 +1,267 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Subroutine */ int slatm1_(integer *mode, real *cond, integer *irsign, + integer *idist, integer *iseed, real *d, integer *n, integer *info) +{ + /* System generated locals */ + integer i__1, i__2; + doublereal d__1, d__2; + + /* Builtin functions */ + double pow_dd(doublereal *, doublereal *), pow_ri(real *, integer *), log( + doublereal), exp(doublereal); + + /* Local variables */ + static real temp; + static integer i; + static real alpha; + extern /* Subroutine */ int xerbla_(char *, integer *); + extern doublereal slaran_(integer *); + extern /* Subroutine */ int slarnv_(integer *, integer *, integer *, real + *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLATM1 computes the entries of D(1..N) as specified by + MODE, COND and IRSIGN. IDIST and ISEED determine the generation + of random numbers. SLATM1 is called by SLATMR to generate + random test matrices for LAPACK programs. + + Arguments + ========= + + MODE - INTEGER + On entry describes how D is to be computed: + MODE = 0 means do not change D. + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - REAL + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + IRSIGN - INTEGER + On entry, if MODE neither -6, 0 nor 6, determines sign of + entries of D + 0 => leave entries of D unchanged + 1 => multiply each entry of D by 1 or -1 with probability .5 + + + IDIST - CHARACTER*1 + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. The random number generator uses a + linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to SLATM1 + to continue the same random number sequence. + Changed on exit. + + D - REAL array, dimension ( MIN( M , N ) ) + Array to be computed according to MODE, COND and IRSIGN. + May be changed on exit if MODE is nonzero. + + N - INTEGER + Number of entries of D. Not modified. + + INFO - INTEGER + 0 => normal termination + -1 => if MODE not in range -6 to 6 + -2 => if MODE neither -6, 0 nor 6, and + IRSIGN neither 0 nor 1 + -3 => if MODE neither -6, 0 nor 6 and COND less than 1 + -4 => if MODE equals 6 or -6 and IDIST not in range 1 to 3 + + -7 => if N negative + + ===================================================================== + + + + Decode and Test the input parameters. Initialize flags & seed. + + Parameter adjustments */ + --d; + --iseed; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Set INFO if an error */ + + if (*mode < -6 || *mode > 6) { + *info = -1; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && (*irsign != 0 && * + irsign != 1)) { + *info = -2; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.f) { + *info = -3; + } else if ((*mode == 6 || *mode == -6) && (*idist < 1 || *idist > 3)) { + *info = -4; + } else if (*n < 0) { + *info = -7; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("SLATM1", &i__1); + return 0; + } + +/* Compute D according to COND and MODE */ + + if (*mode != 0) { + switch (abs(*mode)) { + case 1: goto L10; + case 2: goto L30; + case 3: goto L50; + case 4: goto L70; + case 5: goto L90; + case 6: goto L110; + } + +/* One large D value: */ + +L10: + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = 1.f / *cond; +/* L20: */ + } + d[1] = 1.f; + goto L120; + +/* One small D value: */ + +L30: + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = 1.f; +/* L40: */ + } + d[*n] = 1.f / *cond; + goto L120; + +/* Exponentially distributed D values: */ + +L50: + d[1] = 1.f; + if (*n > 1) { + d__1 = (doublereal) (*cond); + d__2 = (doublereal) (-1.f / (real) (*n - 1)); + alpha = pow_dd(&d__1, &d__2); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { + i__2 = i - 1; + d[i] = pow_ri(&alpha, &i__2); +/* L60: */ + } + } + goto L120; + +/* Arithmetically distributed D values: */ + +L70: + d[1] = 1.f; + if (*n > 1) { + temp = 1.f / *cond; + alpha = (1.f - temp) / (real) (*n - 1); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { + d[i] = (real) (*n - i) * alpha + temp; +/* L80: */ + } + } + goto L120; + +/* Randomly distributed D values on ( 1/COND , 1): */ + +L90: + alpha = log(1.f / *cond); + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + d[i] = exp(alpha * slaran_(&iseed[1])); +/* L100: */ + } + goto L120; + +/* Randomly distributed D values from IDIST */ + +L110: + slarnv_(idist, &iseed[1], n, &d[1]); + +L120: + +/* If MODE neither -6 nor 0 nor 6, and IRSIGN = 1, assign + random signs to D */ + + if (*mode != -6 && *mode != 0 && *mode != 6 && *irsign == 1) { + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + temp = slaran_(&iseed[1]); + if (temp > .5f) { + d[i] = -(doublereal)d[i]; + } +/* L130: */ + } + } + +/* Reverse if MODE < 0 */ + + if (*mode < 0) { + i__1 = *n / 2; + for (i = 1; i <= i__1; ++i) { + temp = d[i]; + d[i] = d[*n + 1 - i]; + d[*n + 1 - i] = temp; +/* L140: */ + } + } + + } + + return 0; + +/* End of SLATM1 */ + +} /* slatm1_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm2.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm2.c new file mode 100644 index 0000000..e81bb47 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm2.c @@ -0,0 +1,241 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal slatm2_(integer *m, integer *n, integer *i, integer *j, integer * + kl, integer *ku, integer *idist, integer *iseed, real *d, integer * + igrade, real *dl, real *dr, integer *ipvtng, integer *iwork, real * + sparse) +{ + /* System generated locals */ + real ret_val; + + /* Local variables */ + static integer isub, jsub; + static real temp; + extern doublereal slaran_(integer *), slarnd_(integer *, integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + SLATM2 returns the (I,J) entry of a random matrix of dimension + (M, N) described by the other paramters. It is called by the + SLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by SLATMR which has already checked the parameters. + + Use of SLATM2 differs from SLATM3 in the order in which the random + + number generator is called to fill in random matrix entries. + With SLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With SLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, SLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. SLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + + The matrix whose (I,J) entry is returned is constructed as + follows (this routine only computes one entry): + + If I is outside (1..M) or J is outside (1..N), return zero + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of entry to be returned. Not modified. + + J - INTEGER + Column of entry to be returned. Not modified. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - REAL array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - REAL array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - REAL array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) in position K was originally in + position IWORK( K ). + This differs from IWORK for SLATM3. Not modified. + + SPARSE - REAL between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + ret_val = 0.f; + return ret_val; + } + +/* Check for banding */ + + if (*j > *i + *ku || *j < *i - *kl) { + ret_val = 0.f; + return ret_val; + } + +/* Check for sparsity */ + + if (*sparse > 0.f) { + if (slaran_(&iseed[1]) < *sparse) { + ret_val = 0.f; + return ret_val; + } + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + isub = *i; + jsub = *j; + } else if (*ipvtng == 1) { + isub = iwork[*i]; + jsub = *j; + } else if (*ipvtng == 2) { + isub = *i; + jsub = iwork[*j]; + } else if (*ipvtng == 3) { + isub = iwork[*i]; + jsub = iwork[*j]; + } + +/* Compute entry and grade it according to IGRADE */ + + if (isub == jsub) { + temp = d[isub]; + } else { + temp = slarnd_(idist, &iseed[1]); + } + if (*igrade == 1) { + temp *= dl[isub]; + } else if (*igrade == 2) { + temp *= dr[jsub]; + } else if (*igrade == 3) { + temp = temp * dl[isub] * dr[jsub]; + } else if (*igrade == 4 && isub != jsub) { + temp = temp * dl[isub] / dl[jsub]; + } else if (*igrade == 5) { + temp = temp * dl[isub] * dl[jsub]; + } + ret_val = temp; + return ret_val; + +/* End of SLATM2 */ + +} /* slatm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm3.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm3.c new file mode 100644 index 0000000..be6f4ec --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatm3.c @@ -0,0 +1,252 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +doublereal slatm3_(integer *m, integer *n, integer *i, integer *j, integer * + isub, integer *jsub, integer *kl, integer *ku, integer *idist, + integer *iseed, real *d, integer *igrade, real *dl, real *dr, integer + *ipvtng, integer *iwork, real *sparse) +{ + /* System generated locals */ + real ret_val; + + /* Local variables */ + static real temp; + extern doublereal slaran_(integer *), slarnd_(integer *, integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + SLATM3 returns the (ISUB,JSUB) entry of a random matrix of + dimension (M, N) described by the other paramters. (ISUB,JSUB) + is the final position of the (I,J) entry after pivoting + according to IPVTNG and IWORK. SLATM3 is called by the + SLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by SLATMR which has already checked the parameters. + + Use of SLATM3 differs from SLATM2 in the order in which the random + + number generator is called to fill in random matrix entries. + With SLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With SLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, SLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. SLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + in different orders for different pivot orders). + + The matrix whose (ISUB,JSUB) entry is returned is constructed as + follows (this routine only computes one entry): + + If ISUB is outside (1..M) or JSUB is outside (1..N), return zero + + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of unpivoted entry to be returned. Not modified. + + J - INTEGER + Column of unpivoted entry to be returned. Not modified. + + ISUB - INTEGER + Row of pivoted entry to be returned. Changed on exit. + + JSUB - INTEGER + Column of pivoted entry to be returned. Changed on exit. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => UNIFORM( 0, 1 ) + 2 => UNIFORM( -1, 1 ) + 3 => NORMAL( 0, 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - REAL array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - REAL array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - REAL array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) originally in position K is in + position IWORK( K ) after pivoting. + This differs from IWORK for SLATM2. Not modified. + + SPARSE - REAL between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + *isub = *i; + *jsub = *j; + ret_val = 0.f; + return ret_val; + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + *isub = *i; + *jsub = *j; + } else if (*ipvtng == 1) { + *isub = iwork[*i]; + *jsub = *j; + } else if (*ipvtng == 2) { + *isub = *i; + *jsub = iwork[*j]; + } else if (*ipvtng == 3) { + *isub = iwork[*i]; + *jsub = iwork[*j]; + } + +/* Check for banding */ + + if (*jsub > *isub + *ku || *jsub < *isub - *kl) { + ret_val = 0.f; + return ret_val; + } + +/* Check for sparsity */ + + if (*sparse > 0.f) { + if (slaran_(&iseed[1]) < *sparse) { + ret_val = 0.f; + return ret_val; + } + } + +/* Compute entry and grade it according to IGRADE */ + + if (*i == *j) { + temp = d[*i]; + } else { + temp = slarnd_(idist, &iseed[1]); + } + if (*igrade == 1) { + temp *= dl[*i]; + } else if (*igrade == 2) { + temp *= dr[*j]; + } else if (*igrade == 3) { + temp = temp * dl[*i] * dr[*j]; + } else if (*igrade == 4 && *i != *j) { + temp = temp * dl[*i] / dl[*j]; + } else if (*igrade == 5) { + temp = temp * dl[*i] * dl[*j]; + } + ret_val = temp; + return ret_val; + +/* End of SLATM3 */ + +} /* slatm3_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatme.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatme.c new file mode 100644 index 0000000..929c5e0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatme.c @@ -0,0 +1,676 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__1 = 1; +static real c_b23 = 0.f; +static integer c__0 = 0; +static real c_b39 = 1.f; + +/* Subroutine */ int slatme_(integer *n, char *dist, integer *iseed, real *d, + integer *mode, real *cond, real *dmax__, char *ei, char *rsign, char * + upper, char *sim, real *ds, integer *modes, real *conds, integer *kl, + integer *ku, real *anorm, real *a, integer *lda, real *work, integer * + info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + real r__1, r__2, r__3; + + /* Local variables */ + static logical bads; + extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, + integer *, real *, integer *, real *, integer *); + static integer isim; + static real temp; + static logical badei; + static integer i, j; + static real alpha; + extern logical lsame_(char *, char *); + static integer iinfo; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *); + static real tempa[1]; + static integer icols; + static logical useei; + static integer idist; + extern /* Subroutine */ int sgemv_(char *, integer *, integer *, real *, + real *, integer *, real *, integer *, real *, real *, integer *), scopy_(integer *, real *, integer *, real *, integer *); + static integer irows; + extern /* Subroutine */ int slatm1_(integer *, real *, integer *, integer + *, integer *, real *, integer *, integer *); + static integer ic, jc, ir, jr; + extern doublereal slange_(char *, integer *, integer *, real *, integer *, + real *); + extern /* Subroutine */ int slarge_(integer *, real *, integer *, integer + *, real *, integer *), slarfg_(integer *, real *, real *, integer + *, real *), xerbla_(char *, integer *); + extern doublereal slaran_(integer *); + static integer irsign; + extern /* Subroutine */ int slaset_(char *, integer *, integer *, real *, + real *, real *, integer *); + static integer iupper; + extern /* Subroutine */ int slarnv_(integer *, integer *, integer *, real + *); + static real xnorms; + static integer jcr; + static real tau; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLATME generates random non-symmetric square matrices with + specified eigenvalues for testing LAPACK programs. + + SLATME operates by applying the following sequence of + operations: + + 1. Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and RSIGN + as described below. + + 2. If complex conjugate pairs are desired (MODE=0 and EI(1)='R', + or MODE=5), certain pairs of adjacent elements of D are + interpreted as the real and complex parts of a complex + conjugate pair; A thus becomes block diagonal, with 1x1 + and 2x2 blocks. + + 3. If UPPER='T', the upper triangle of A is set to random values + out of distribution DIST. + + 4. If SIM='T', A is multiplied on the left by a random matrix + X, whose singular values are specified by DS, MODES, and + CONDS, and on the right by X inverse. + + 5. If KL < N-1, the lower bandwidth is reduced to KL using + Householder transformations. If KU < N-1, the upper + bandwidth is reduced to KU. + + 6. If ANORM is not negative, the matrix is scaled to have + maximum-element-norm ANORM. + + (Note: since the matrix cannot be reduced beyond Hessenberg form, + + no packing options are available.) + + Arguments + ========= + + N - INTEGER + The number of columns (or rows) of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values, and for the + upper triangle (see UPPER). + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to SLATME + to continue the same random number sequence. + Changed on exit. + + D - REAL array, dimension ( N ) + This array is used to specify the eigenvalues of A. If + MODE=0, then D is assumed to contain the eigenvalues (but + see the description of EI), otherwise they will be + computed according to MODE, COND, DMAX, and RSIGN and + placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the eigenvalues are to + be specified: + MODE = 0 means use D (with EI) as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. Each odd-even pair + of elements will be either used as two real + eigenvalues or as the real and imaginary part + of a complex conjugate pair of eigenvalues; + the choice of which is done is random, with + 50-50 probability, for each pair. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is between 1 and 4, D has entries ranging + from 1 to 1/COND, if between -1 and -4, D has entries + ranging from 1/COND to 1, + Not modified. + + COND - REAL + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - REAL + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))). Note that DMAX need not be + positive: if DMAX is negative (or zero), D will be + scaled by a negative number (or zero). + Not modified. + + EI - CHARACTER*1 array, dimension ( N ) + If MODE is 0, and EI(1) is not ' ' (space character), + this array specifies which elements of D (on input) are + real eigenvalues and which are the real and imaginary parts + + of a complex conjugate pair of eigenvalues. The elements + of EI may then only have the values 'R' and 'I'. If + EI(j)='R' and EI(j+1)='I', then the j-th eigenvalue is + CMPLX( D(j) , D(j+1) ), and the (j+1)-th is the complex + conjugate thereof. If EI(j)=EI(j+1)='R', then the j-th + eigenvalue is D(j) (i.e., real). EI(1) may not be 'I', + nor may two adjacent elements of EI both have the value 'I'. + + If MODE is not 0, then EI is ignored. If MODE is 0 and + EI(1)=' ', then the eigenvalues will all be real. + Not modified. + + RSIGN - CHARACTER*1 + If MODE is not 0, 6, or -6, and RSIGN='T', then the + elements of D, as computed according to MODE and COND, will + + be multiplied by a random sign (+1 or -1). If RSIGN='F', + they will not be. RSIGN may only have the values 'T' or + 'F'. + Not modified. + + UPPER - CHARACTER*1 + If UPPER='T', then the elements of A above the diagonal + (and above the 2x2 diagonal blocks, if A has complex + eigenvalues) will be set to random numbers out of DIST. + If UPPER='F', they will not. UPPER may only have the + values 'T' or 'F'. + Not modified. + + SIM - CHARACTER*1 + If SIM='T', then A will be operated on by a "similarity + transform", i.e., multiplied on the left by a matrix X and + on the right by X inverse. X = U S V, where U and V are + random unitary matrices and S is a (diagonal) matrix of + singular values specified by DS, MODES, and CONDS. If + SIM='F', then A will not be transformed. + Not modified. + + DS - REAL array, dimension ( N ) + This array is used to specify the singular values of X, + in the same way that D specifies the eigenvalues of A. + If MODE=0, the DS contains the singular values, which + may not be zero. + Modified if MODE is nonzero. + + MODES - INTEGER + CONDS - REAL + Same as MODE and COND, but for specifying the diagonal + of S. MODES=-6 and +6 are not allowed (since they would + result in randomly ill-conditioned eigenvalues.) + + KL - INTEGER + This specifies the lower bandwidth of the matrix. KL=1 + specifies upper Hessenberg form. If KL is at least N-1, + then A will have full lower bandwidth. KL must be at + least 1. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. KU=1 + specifies lower Hessenberg form. If KU is at least N-1, + then A will have full upper bandwidth; if KU and KL + are both at least N-1, then A will be dense. Only one of + KU and KL may be less than N-1. KU must be at least 1. + Not modified. + + ANORM - REAL + If ANORM is not negative, then A will be scaled by a non- + negative real number to make the maximum-element-norm of A + to be ANORM. + Not modified. + + A - REAL array, dimension ( LDA, N ) + On exit A is the desired test matrix. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. LDA must be at least N. + Not modified. + + WORK - REAL array, dimension ( 3*N ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => N negative + -2 => DIST illegal string + -5 => MODE not in range -6 to 6 + -6 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -8 => EI(1) is not ' ' or 'R', EI(j) is not 'R' or 'I', or + + two adjacent elements of EI are 'I'. + -9 => RSIGN is not 'T' or 'F' + -10 => UPPER is not 'T' or 'F' + -11 => SIM is not 'T' or 'F' + -12 => MODES=0 and DS has a zero singular value. + -13 => MODES is not in the range -5 to 5. + -14 => MODES is nonzero and CONDS is less than 1. + -15 => KL is less than 1. + -16 => KU is less than 1, or KL and KU are both less than + N-1. + -19 => LDA is less than N. + 1 => Error return from SLATM1 (computing D) + 2 => Cannot scale to DMAX (max. eigenvalue is 0) + 3 => Error return from SLATM1 (computing DS) + 4 => Error return from SLARGE + 5 => Zero singular value from SLATM1. + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --ei; + --ds; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Check EI */ + + useei = TRUE_; + badei = FALSE_; + if (lsame_(ei + 1, " ") || *mode != 0) { + useei = FALSE_; + } else { + if (lsame_(ei + 1, "R")) { + i__1 = *n; + for (j = 2; j <= i__1; ++j) { + if (lsame_(ei + j, "I")) { + if (lsame_(ei + (j - 1), "I")) { + badei = TRUE_; + } + } else { + if (! lsame_(ei + j, "R")) { + badei = TRUE_; + } + } +/* L10: */ + } + } else { + badei = TRUE_; + } + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "T")) { + irsign = 1; + } else if (lsame_(rsign, "F")) { + irsign = 0; + } else { + irsign = -1; + } + +/* Decode UPPER */ + + if (lsame_(upper, "T")) { + iupper = 1; + } else if (lsame_(upper, "F")) { + iupper = 0; + } else { + iupper = -1; + } + +/* Decode SIM */ + + if (lsame_(sim, "T")) { + isim = 1; + } else if (lsame_(sim, "F")) { + isim = 0; + } else { + isim = -1; + } + +/* Check DS, if MODES=0 and ISIM=1 */ + + bads = FALSE_; + if (*modes == 0 && isim == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (ds[j] == 0.f) { + bads = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*n < 0) { + *info = -1; + } else if (idist == -1) { + *info = -2; + } else if (abs(*mode) > 6) { + *info = -5; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.f) { + *info = -6; + } else if (badei) { + *info = -8; + } else if (irsign == -1) { + *info = -9; + } else if (iupper == -1) { + *info = -10; + } else if (isim == -1) { + *info = -11; + } else if (bads) { + *info = -12; + } else if (isim == 1 && abs(*modes) > 5) { + *info = -13; + } else if (isim == 1 && *modes != 0 && *conds < 1.f) { + *info = -14; + } else if (*kl < 1) { + *info = -15; + } else if (*ku < 1 || *ku < *n - 1 && *kl < *n - 1) { + *info = -16; + } else if (*lda < max(1,*n)) { + *info = -19; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("SLATME", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up diagonal of A + + Compute D according to COND and MODE */ + + slatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], n, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = dabs(d[1]); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__2 = temp, r__3 = (r__1 = d[i], dabs(r__1)); + temp = dmax(r__2,r__3); +/* L40: */ + } + + if (temp > 0.f) { + alpha = *dmax__ / temp; + } else if (*dmax__ != 0.f) { + *info = 2; + return 0; + } else { + alpha = 0.f; + } + + sscal_(n, &alpha, &d[1], &c__1); + + } + + slaset_("Full", n, n, &c_b23, &c_b23, &a[a_offset], lda); + i__1 = *lda + 1; + scopy_(n, &d[1], &c__1, &a[a_offset], &i__1); + +/* Set up complex conjugate pairs */ + + if (*mode == 0) { + if (useei) { + i__1 = *n; + for (j = 2; j <= i__1; ++j) { + if (lsame_(ei + j, "I")) { + a[j - 1 + j * a_dim1] = a[j + j * a_dim1]; + a[j + (j - 1) * a_dim1] = -(doublereal)a[j + j * a_dim1]; + a[j + j * a_dim1] = a[j - 1 + (j - 1) * a_dim1]; + } +/* L50: */ + } + } + + } else if (abs(*mode) == 5) { + + i__1 = *n; + for (j = 2; j <= i__1; j += 2) { + if (slaran_(&iseed[1]) > .5f) { + a[j - 1 + j * a_dim1] = a[j + j * a_dim1]; + a[j + (j - 1) * a_dim1] = -(doublereal)a[j + j * a_dim1]; + a[j + j * a_dim1] = a[j - 1 + (j - 1) * a_dim1]; + } +/* L60: */ + } + } + +/* 3) If UPPER='T', set upper triangle of A to random numbers. + (but don't modify the corners of 2x2 blocks.) */ + + if (iupper != 0) { + i__1 = *n; + for (jc = 2; jc <= i__1; ++jc) { + if (a[jc - 1 + jc * a_dim1] != 0.f) { + jr = jc - 2; + } else { + jr = jc - 1; + } + slarnv_(&idist, &iseed[1], &jr, &a[jc * a_dim1 + 1]); +/* L70: */ + } + } + +/* 4) If SIM='T', apply similarity transformation. + + -1 + Transform is X A X , where X = U S V, thus + + it is U S V A V' (1/S) U' */ + + if (isim != 0) { + +/* Compute S (singular values of the eigenvector matrix) + according to CONDS and MODES */ + + slatm1_(modes, conds, &c__0, &c__0, &iseed[1], &ds[1], n, &iinfo); + if (iinfo != 0) { + *info = 3; + return 0; + } + +/* Multiply by V and V' */ + + slarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + +/* Multiply by S and (1/S) */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + sscal_(n, &ds[j], &a[j + a_dim1], lda); + if (ds[j] != 0.f) { + r__1 = 1.f / ds[j]; + sscal_(n, &r__1, &a[j * a_dim1 + 1], &c__1); + } else { + *info = 5; + return 0; + } +/* L80: */ + } + +/* Multiply by U and U' */ + + slarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + } + +/* 5) Reduce the bandwidth. */ + + if (*kl < *n - 1) { + +/* Reduce bandwidth -- kill column */ + + i__1 = *n - 1; + for (jcr = *kl + 1; jcr <= i__1; ++jcr) { + ic = jcr - *kl; + irows = *n + 1 - jcr; + icols = *n + *kl - jcr; + + scopy_(&irows, &a[jcr + ic * a_dim1], &c__1, &work[1], &c__1); + xnorms = work[1]; + slarfg_(&irows, &xnorms, &work[2], &c__1, &tau); + work[1] = 1.f; + + sgemv_("T", &irows, &icols, &c_b39, &a[jcr + (ic + 1) * a_dim1], + lda, &work[1], &c__1, &c_b23, &work[irows + 1], &c__1) + ; + r__1 = -(doublereal)tau; + sger_(&irows, &icols, &r__1, &work[1], &c__1, &work[irows + 1], & + c__1, &a[jcr + (ic + 1) * a_dim1], lda); + + sgemv_("N", n, &irows, &c_b39, &a[jcr * a_dim1 + 1], lda, &work[1] + , &c__1, &c_b23, &work[irows + 1], &c__1); + r__1 = -(doublereal)tau; + sger_(n, &irows, &r__1, &work[irows + 1], &c__1, &work[1], &c__1, + &a[jcr * a_dim1 + 1], lda); + + a[jcr + ic * a_dim1] = xnorms; + i__2 = irows - 1; + slaset_("Full", &i__2, &c__1, &c_b23, &c_b23, &a[jcr + 1 + ic * + a_dim1], lda); +/* L90: */ + } + } else if (*ku < *n - 1) { + +/* Reduce upper bandwidth -- kill a row at a time. */ + + i__1 = *n - 1; + for (jcr = *ku + 1; jcr <= i__1; ++jcr) { + ir = jcr - *ku; + irows = *n + *ku - jcr; + icols = *n + 1 - jcr; + + scopy_(&icols, &a[ir + jcr * a_dim1], lda, &work[1], &c__1); + xnorms = work[1]; + slarfg_(&icols, &xnorms, &work[2], &c__1, &tau); + work[1] = 1.f; + + sgemv_("N", &irows, &icols, &c_b39, &a[ir + 1 + jcr * a_dim1], + lda, &work[1], &c__1, &c_b23, &work[icols + 1], &c__1) + ; + r__1 = -(doublereal)tau; + sger_(&irows, &icols, &r__1, &work[icols + 1], &c__1, &work[1], & + c__1, &a[ir + 1 + jcr * a_dim1], lda); + + sgemv_("C", &icols, n, &c_b39, &a[jcr + a_dim1], lda, &work[1], & + c__1, &c_b23, &work[icols + 1], &c__1); + r__1 = -(doublereal)tau; + sger_(&icols, n, &r__1, &work[1], &c__1, &work[icols + 1], &c__1, + &a[jcr + a_dim1], lda); + + a[ir + jcr * a_dim1] = xnorms; + i__2 = icols - 1; + slaset_("Full", &c__1, &i__2, &c_b23, &c_b23, &a[ir + (jcr + 1) * + a_dim1], lda); +/* L100: */ + } + } + +/* Scale the matrix to have norm ANORM */ + + if (*anorm >= 0.f) { + temp = slange_("M", n, n, &a[a_offset], lda, tempa); + if (temp > 0.f) { + alpha = *anorm / temp; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + sscal_(n, &alpha, &a[j * a_dim1 + 1], &c__1); +/* L110: */ + } + } + } + + return 0; + +/* End of SLATME */ + +} /* slatme_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatmr.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatmr.c new file mode 100644 index 0000000..31c39fe --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatmr.c @@ -0,0 +1,1289 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__0 = 0; +static integer c__1 = 1; + +/* Subroutine */ int slatmr_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, real *d, integer *mode, real *cond, real *dmax__, + char *rsign, char *grade, real *dl, integer *model, real *condl, real + *dr, integer *moder, real *condr, char *pivtng, integer *ipivot, + integer *kl, integer *ku, real *sparse, real *anorm, char *pack, real + *a, integer *lda, integer *iwork, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + real r__1, r__2, r__3; + + /* Local variables */ + static integer isub, jsub; + static real temp; + static integer isym, i, j, k; + static real alpha; + static integer ipack; + extern logical lsame_(char *, char *); + static real tempa[1]; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *); + static integer iisub, idist, jjsub, mnmin; + static logical dzero; + static integer mnsub; + static real onorm; + static integer mxsub, npvts; + extern /* Subroutine */ int slatm1_(integer *, real *, integer *, integer + *, integer *, real *, integer *, integer *); + extern doublereal slatm2_(integer *, integer *, integer *, integer *, + integer *, integer *, integer *, integer *, real *, integer *, + real *, real *, integer *, integer *, real *), slatm3_(integer *, + integer *, integer *, integer *, integer *, integer *, integer *, + integer *, integer *, integer *, real *, integer *, real *, real * + , integer *, integer *, real *); + static integer igrade; + extern doublereal slangb_(char *, integer *, integer *, integer *, real *, + integer *, real *), slange_(char *, integer *, integer *, + real *, integer *, real *); + static logical fulbnd; + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical badpvt; + extern doublereal slansb_(char *, char *, integer *, integer *, real *, + integer *, real *); + static integer irsign; + extern doublereal slansp_(char *, char *, integer *, real *, real *); + static integer ipvtng; + extern doublereal slansy_(char *, char *, integer *, real *, integer *, + real *); + static integer kll, kuu; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + SLATMR generates random matrices of various types for testing + LAPACK programs. + + SLATMR operates by applying the following sequence of + operations: + + Generate a matrix A with random entries of distribution DIST + which is symmetric if SYM='S', and nonsymmetric + if SYM='N'. + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX and RSIGN + as described below. + + Grade the matrix, if desired, from the left and/or right + as specified by GRADE. The inputs DL, MODEL, CONDL, DR, + MODER and CONDR also determine the grading as described + below. + + Permute, if desired, the rows and/or columns as specified by + PIVTNG and IPIVOT. + + Set random entries to zero, if desired, to get a random sparse + matrix as specified by SPARSE. + + Make A a band matrix, if desired, by zeroing out the matrix + outside a band of lower bandwidth KL and upper bandwidth KU. + + + Scale A, if desired, to have maximum entry ANORM. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric) + zero out lower half (if symmetric) + store the upper half columnwise (if symmetric or + square upper triangular) + store the lower half columnwise (if symmetric or + square lower triangular) + same as upper half rowwise if symmetric + store the lower triangle in banded format (if symmetric) + store the upper triangle in banded format (if symmetric) + store the entire matrix in banded format + + Note: If two calls to SLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + + If two calls to SLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be and + is not maintained with less than full bandwidth. + + Arguments + ========= + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate a random matrix . + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to SLATMR + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S' or 'H', generated matrix is symmetric. + If SYM='N', generated matrix is nonsymmetric. + Not modified. + + D - REAL array, dimension (min(M,N)) + On entry this array specifies the diagonal entries + of the diagonal of A. D may either be specified + on entry, or set according to MODE and COND as described + below. May be changed on exit if MODE is nonzero. + + MODE - INTEGER + On entry describes how D is to be used: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - REAL + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - REAL + If MODE neither -6, 0 nor 6, the diagonal is scaled by + DMAX / max(abs(D(i))), so that maximum absolute entry + of diagonal is abs(DMAX). If DMAX is negative (or zero), + diagonal will be scaled by a negative number (or zero). + + RSIGN - CHARACTER*1 + If MODE neither -6, 0 nor 6, specifies sign of diagonal + as follows: + 'T' => diagonal entries are multiplied by 1 or -1 + with probability .5 + 'F' => diagonal unchanged + Not modified. + + GRADE - CHARACTER*1 + Specifies grading of matrix as follows: + 'N' => no grading + 'L' => matrix premultiplied by diag( DL ) + (only if matrix nonsymmetric) + 'R' => matrix postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'B' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'S' or 'H' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + ('S' for symmetric, or 'H' for Hermitian) + 'E' => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + ( 'E' for eigenvalue invariance) + (only if matrix nonsymmetric) + Note: if GRADE='E', then M must equal N. + Not modified. + + DL - REAL array, dimension (M) + If MODEL=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODEL is not zero, then DL will be set according + to MODEL and CONDL, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DL). + + If GRADE='E', then DL cannot have zero entries. + Not referenced if GRADE = 'N' or 'R'. Changed on exit. + + MODEL - INTEGER + This specifies how the diagonal array DL is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDL - REAL + When MODEL is not zero, this specifies the condition number + + of the computed DL. Not modified. + + DR - REAL array, dimension (N) + If MODER=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODER is not zero, then DR will be set according + to MODER and CONDR, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DR). + + Not referenced if GRADE = 'N', 'L', 'H', 'S' or 'E'. + Changed on exit. + + MODER - INTEGER + This specifies how the diagonal array DR is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDR - REAL + When MODER is not zero, this specifies the condition number + + of the computed DR. Not modified. + + PIVTNG - CHARACTER*1 + On entry specifies pivoting permutations as follows: + 'N' or ' ' => none. + 'L' => left or row pivoting (matrix must be nonsymmetric). + 'R' => right or column pivoting (matrix must be + nonsymmetric). + 'B' or 'F' => both or full pivoting, i.e., on both sides. + In this case, M must equal N + + If two calls to SLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be + maintained with less than full bandwidth. + + IPIVOT - INTEGER array, dimension (N or M) + This array specifies the permutation used. After the + basic matrix is generated, the rows, columns, or both + are permuted. If, say, row pivoting is selected, SLATMR + starts with the *last* row and interchanges the M-th and + IPIVOT(M)-th rows, then moves to the next-to-last row, + interchanging the (M-1)-th and the IPIVOT(M-1)-th rows, + and so on. In terms of "2-cycles", the permutation is + (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M)) + where the rightmost cycle is applied first. This is the + *inverse* of the effect of pivoting in LINPACK. The idea + is that factoring (with pivoting) an identity matrix + which has been inverse-pivoted in this way should + result in a pivot vector identical to IPIVOT. + Not referenced if PIVTNG = 'N'. Not modified. + + SPARSE - REAL + On entry specifies the sparsity of the matrix if a sparse + matrix is to be generated. SPARSE should lie between + 0 and 1. To generate a sparse matrix, for each matrix entry + + a uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + KL - INTEGER + On entry specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL at least M-1 implies the matrix is not + banded. Must equal KU if matrix is symmetric. + Not modified. + + KU - INTEGER + On entry specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU at least N-1 implies the matrix is not + banded. Must equal KL if matrix is symmetric. + Not modified. + + ANORM - REAL + On entry specifies maximum entry of output matrix + (output matrix will by multiplied by a constant so that + its largest absolute entry equal ANORM) + if ANORM is nonnegative. If ANORM is negative no scaling + is done. Not modified. + + PACK - CHARACTER*1 + On entry specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric) + 'L' => zero out all superdiagonal entries (if symmetric) + 'C' => store the upper triangle columnwise + (only if matrix symmetric or square upper triangular) + + 'R' => store the lower triangle columnwise + (only if matrix symmetric or square lower triangular) + + (same as upper half rowwise if symmetric) + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB or TB - use 'B' or 'Q' + PP, SP or TP - use 'C' or 'R' + + If two calls to SLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - REAL array, dimension (LDA,N) + On exit A is the desired test matrix. Only those + entries of A which are significant on output + will be referenced (even if A is in packed or band + storage format). The 'unoccupied corners' of A in + band format will be zeroed out. + + LDA - INTEGER + on entry LDA specifies the first dimension of A as + declared in the calling program. + If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ). + + If PACK='C' or 'R', LDA must be at least 1. + If PACK='B', or 'Q', LDA must be MIN ( KU+1, N ) + If PACK='Z', LDA must be at least KUU+KLL+1, where + KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 ) + Not modified. + + IWORK - INTEGER array, dimension ( N or M) + Workspace. Not referenced if PIVTNG = 'N'. Changed on exit. + + + INFO - INTEGER + Error parameter on exit: + 0 => normal return + -1 => M negative or unequal to N and SYM='S' or 'H' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string + -11 => GRADE illegal string, or GRADE='E' and + M not equal to N, or GRADE='L', 'R', 'B' or 'E' and + SYM = 'S' or 'H' + -12 => GRADE = 'E' and DL contains zero + -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H', + + 'S' or 'E' + -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E', + + and MODEL neither -6, 0 nor 6 + -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B' + -17 => CONDR less than 1.0, GRADE='R' or 'B', and + MODER neither -6, 0 nor 6 + -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and + M not equal to N, or PIVTNG='L' or 'R' and SYM='S' + or 'H' + -19 => IPIVOT contains out of range number and + PIVTNG not equal to 'N' + -20 => KL negative + -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -22 => SPARSE not in range 0. to 1. + -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q' + and SYM='N', or PACK='C' and SYM='N' and either KL + not equal to 0 or N not equal to M, or PACK='R' and + SYM='N', and either KU not equal to 0 or N not equal + + to M + -26 => LDA too small + 1 => Error return from SLATM1 (computing D) + 2 => Cannot scale diagonal to DMAX (max. entry is 0) + 3 => Error return from SLATM1 (computing DL) + 4 => Error return from SLATM1 (computing DR) + 5 => ANORM is positive, but matrix constructed prior to + attempting to scale it to have norm ANORM, is zero + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --dl; + --dr; + --ipivot; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iwork; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "S")) { + isym = 0; + } else if (lsame_(sym, "N")) { + isym = 1; + } else if (lsame_(sym, "H")) { + isym = 0; + } else { + isym = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "F")) { + irsign = 0; + } else if (lsame_(rsign, "T")) { + irsign = 1; + } else { + irsign = -1; + } + +/* Decode PIVTNG */ + + if (lsame_(pivtng, "N")) { + ipvtng = 0; + } else if (lsame_(pivtng, " ")) { + ipvtng = 0; + } else if (lsame_(pivtng, "L")) { + ipvtng = 1; + npvts = *m; + } else if (lsame_(pivtng, "R")) { + ipvtng = 2; + npvts = *n; + } else if (lsame_(pivtng, "B")) { + ipvtng = 3; + npvts = min(*n,*m); + } else if (lsame_(pivtng, "F")) { + ipvtng = 3; + npvts = min(*n,*m); + } else { + ipvtng = -1; + } + +/* Decode GRADE */ + + if (lsame_(grade, "N")) { + igrade = 0; + } else if (lsame_(grade, "L")) { + igrade = 1; + } else if (lsame_(grade, "R")) { + igrade = 2; + } else if (lsame_(grade, "B")) { + igrade = 3; + } else if (lsame_(grade, "E")) { + igrade = 4; + } else if (lsame_(grade, "H") || lsame_(grade, "S")) { + igrade = 5; + } else { + igrade = -1; + } + +/* Decode PACK */ + + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + } else if (lsame_(pack, "C")) { + ipack = 3; + } else if (lsame_(pack, "R")) { + ipack = 4; + } else if (lsame_(pack, "B")) { + ipack = 5; + } else if (lsame_(pack, "Q")) { + ipack = 6; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + kll = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + kuu = min(i__1,i__2); + +/* If inv(DL) is used, check to see if DL has a zero entry. */ + + dzero = FALSE_; + if (igrade == 4 && *model == 0) { + i__1 = *m; + for (i = 1; i <= i__1; ++i) { + if (dl[i] == 0.f) { + dzero = TRUE_; + } +/* L10: */ + } + } + +/* Check values in IPIVOT */ + + badpvt = FALSE_; + if (ipvtng > 0) { + i__1 = npvts; + for (j = 1; j <= i__1; ++j) { + if (ipivot[j] <= 0 || ipivot[j] > npvts) { + badpvt = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym == 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (*mode < -6 || *mode > 6) { + *info = -7; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.f) { + *info = -8; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && irsign == -1) { + *info = -10; + } else if (igrade == -1 || igrade == 4 && *m != *n || igrade >= 1 && + igrade <= 4 && isym == 0) { + *info = -11; + } else if (igrade == 4 && dzero) { + *info = -12; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) && ( + *model < -6 || *model > 6)) { + *info = -13; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) && ( + *model != -6 && *model != 0 && *model != 6) && *condl < 1.f) { + *info = -14; + } else if ((igrade == 2 || igrade == 3) && (*moder < -6 || *moder > 6)) { + *info = -16; + } else if ((igrade == 2 || igrade == 3) && (*moder != -6 && *moder != 0 && + *moder != 6) && *condr < 1.f) { + *info = -17; + } else if (ipvtng == -1 || ipvtng == 3 && *m != *n || (ipvtng == 1 || + ipvtng == 2) && isym == 0) { + *info = -18; + } else if (ipvtng != 0 && badpvt) { + *info = -19; + } else if (*kl < 0) { + *info = -20; + } else if (*ku < 0 || isym == 0 && *kl != *ku) { + *info = -21; + } else if (*sparse < 0.f || *sparse > 1.f) { + *info = -22; + } else if (ipack == -1 || (ipack == 1 || ipack == 2 || ipack == 5 || + ipack == 6) && isym == 1 || ipack == 3 && isym == 1 && (*kl != 0 + || *m != *n) || ipack == 4 && isym == 1 && (*ku != 0 || *m != *n)) + { + *info = -24; + } else if ((ipack == 0 || ipack == 1 || ipack == 2) && *lda < max(1,*m) || + (ipack == 3 || ipack == 4) && *lda < 1 || (ipack == 5 || ipack == + 6) && *lda < kuu + 1 || ipack == 7 && *lda < kll + kuu + 1) { + *info = -26; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("SLATMR", &i__1); + return 0; + } + +/* Decide if we can pivot consistently */ + + fulbnd = FALSE_; + if (kuu == *n - 1 && kll == *m - 1) { + fulbnd = TRUE_; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + iseed[4] = (iseed[4] / 2 << 1) + 1; + +/* 2) Set up D, DL, and DR, if indicated. + + Compute D according to COND and MODE */ + + slatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, info); + if (*info != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && *mode != -6 && *mode != 6) { + +/* Scale by DMAX */ + + temp = dabs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__2 = temp, r__3 = (r__1 = d[i], dabs(r__1)); + temp = dmax(r__2,r__3); +/* L40: */ + } + if (temp == 0.f && *dmax__ != 0.f) { + *info = 2; + return 0; + } + if (temp != 0.f) { + alpha = *dmax__ / temp; + } else { + alpha = 1.f; + } + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + d[i] = alpha * d[i]; +/* L50: */ + } + + } + +/* Compute DL if grading set */ + + if (igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5) { + slatm1_(model, condl, &c__0, &idist, &iseed[1], &dl[1], m, info); + if (*info != 0) { + *info = 3; + return 0; + } + } + +/* Compute DR if grading set */ + + if (igrade == 2 || igrade == 3) { + slatm1_(moder, condr, &c__0, &idist, &iseed[1], &dr[1], n, info); + if (*info != 0) { + *info = 4; + return 0; + } + } + +/* 3) Generate IWORK if pivoting */ + + if (ipvtng > 0) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + iwork[i] = i; +/* L60: */ + } + if (fulbnd) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L70: */ + } + } else { + for (i = npvts; i >= 1; --i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L80: */ + } + } + } + +/* 4) Generate matrices for each kind of PACKing + Always sweep matrix columnwise (if symmetric, upper + half only) so that matrix generated does not depend + on PACK */ + + if (fulbnd) { + +/* Use SLATM3 so matrices generated with differing PIVOTing onl +y + differ only in the order of their rows and/or columns. */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub + jsub * a_dim1] = temp; + a[jsub + isub * a_dim1] = temp; +/* L90: */ + } +/* L100: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub + jsub * a_dim1] = temp; +/* L110: */ + } +/* L120: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub + mxsub * a_dim1] = temp; + if (mnsub != mxsub) { + a[mxsub + mnsub * a_dim1] = 0.f; + } +/* L130: */ + } +/* L140: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mxsub + mnsub * a_dim1] = temp; + if (mnsub != mxsub) { + a[mnsub + mxsub * a_dim1] = 0.f; + } +/* L150: */ + } +/* L160: */ + } + + } else if (ipack == 3) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + +/* Compute K = location of (ISUB,JSUB) ent +ry in packed + array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + k = mxsub * (mxsub - 1) / 2 + mnsub; + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + a[iisub + jjsub * a_dim1] = temp; +/* L170: */ + } +/* L180: */ + } + + } else if (ipack == 4) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + +/* Compute K = location of (I,J) entry in +packed array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mnsub == 1) { + k = mxsub; + } else { + k = *n * (*n + 1) / 2 - (*n - mnsub + 1) * (*n - + mnsub + 2) / 2 + mxsub - mnsub + 1; + } + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + a[iisub + jjsub * a_dim1] = temp; +/* L190: */ + } +/* L200: */ + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + a[j - i + 1 + (i + *n) * a_dim1] = 0.f; + } else { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mxsub - mnsub + 1 + mnsub * a_dim1] = temp; + } +/* L210: */ + } +/* L220: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub - mxsub + kuu + 1 + mxsub * a_dim1] = temp; +/* L230: */ + } +/* L240: */ + } + + } else if (ipack == 7) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + a[mnsub - mxsub + kuu + 1 + mxsub * a_dim1] = temp; + if (i < 1) { + a[j - i + 1 + kuu + (i + *n) * a_dim1] = 0.f; + } + if (i >= 1 && mnsub != mxsub) { + a[mxsub - mnsub + 1 + kuu + mnsub * a_dim1] = + temp; + } +/* L250: */ + } +/* L260: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + temp = slatm3_(m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[isub - jsub + kuu + 1 + jsub * a_dim1] = temp; +/* L270: */ + } +/* L280: */ + } + } + + } + + } else { + +/* Use SLATM2 */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = slatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + a[j + i * a_dim1] = a[i + j * a_dim1]; +/* L290: */ + } +/* L300: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = slatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); +/* L310: */ + } +/* L320: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = slatm2_(m, n, &i, &j, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + if (i != j) { + a[j + i * a_dim1] = 0.f; + } +/* L330: */ + } +/* L340: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + a[j + i * a_dim1] = slatm2_(m, n, &i, &j, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + if (i != j) { + a[i + j * a_dim1] = 0.f; + } +/* L350: */ + } +/* L360: */ + } + + } else if (ipack == 3) { + + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + a[isub + jsub * a_dim1] = slatm2_(m, n, &i, &j, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); +/* L370: */ + } +/* L380: */ + } + + } else if (ipack == 4) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + +/* Compute K = location of (I,J) en +try in packed array */ + + if (i == 1) { + k = j; + } else { + k = *n * (*n + 1) / 2 - (*n - i + 1) * (*n - i + + 2) / 2 + j - i + 1; + } + +/* Convert K to (ISUB,JSUB) locatio +n */ + + jsub = (k - 1) / *lda + 1; + isub = k - *lda * (jsub - 1); + + a[isub + jsub * a_dim1] = slatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L390: */ + } +/* L400: */ + } + } else { + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + a[isub + jsub * a_dim1] = slatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L410: */ + } +/* L420: */ + } + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + a[j - i + 1 + (i + *n) * a_dim1] = 0.f; + } else { + a[j - i + 1 + i * a_dim1] = slatm2_(m, n, &i, &j, kl, + ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); + } +/* L430: */ + } +/* L440: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = slatm2_(m, n, &i, &j, + kl, ku, &idist, &iseed[1], &d[1], &igrade, &dl[1], + &dr[1], &ipvtng, &iwork[1], sparse); +/* L450: */ + } +/* L460: */ + } + + } else if (ipack == 7) { + + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = slatm2_(m, n, &i, & + j, kl, ku, &idist, &iseed[1], &d[1], &igrade, + &dl[1], &dr[1], &ipvtng, &iwork[1], sparse); + if (i < 1) { + a[j - i + 1 + kuu + (i + *n) * a_dim1] = 0.f; + } + if (i >= 1 && i != j) { + a[j - i + 1 + kuu + i * a_dim1] = a[i - j + kuu + + 1 + j * a_dim1]; + } +/* L470: */ + } +/* L480: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + a[i - j + kuu + 1 + j * a_dim1] = slatm2_(m, n, &i, & + j, kl, ku, &idist, &iseed[1], &d[1], &igrade, + &dl[1], &dr[1], &ipvtng, &iwork[1], sparse); +/* L490: */ + } +/* L500: */ + } + } + + } + + } + +/* 5) Scaling the norm */ + + if (ipack == 0) { + onorm = slange_("M", m, n, &a[a_offset], lda, tempa); + } else if (ipack == 1) { + onorm = slansy_("M", "U", n, &a[a_offset], lda, tempa); + } else if (ipack == 2) { + onorm = slansy_("M", "L", n, &a[a_offset], lda, tempa); + } else if (ipack == 3) { + onorm = slansp_("M", "U", n, &a[a_offset], tempa); + } else if (ipack == 4) { + onorm = slansp_("M", "L", n, &a[a_offset], tempa); + } else if (ipack == 5) { + onorm = slansb_("M", "L", n, &kll, &a[a_offset], lda, tempa); + } else if (ipack == 6) { + onorm = slansb_("M", "U", n, &kuu, &a[a_offset], lda, tempa); + } else if (ipack == 7) { + onorm = slangb_("M", n, &kll, &kuu, &a[a_offset], lda, tempa); + } + + if (*anorm >= 0.f) { + + if (*anorm > 0.f && onorm == 0.f) { + +/* Desired scaling impossible */ + + *info = 5; + return 0; + + } else if (*anorm > 1.f && onorm < 1.f || *anorm < 1.f && onorm > 1.f) + { + +/* Scale carefully to avoid over / underflow */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + r__1 = 1.f / onorm; + sscal_(m, &r__1, &a[j * a_dim1 + 1], &c__1); + sscal_(m, anorm, &a[j * a_dim1 + 1], &c__1); +/* L510: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + r__1 = 1.f / onorm; + sscal_(&i__1, &r__1, &a[a_offset], &c__1); + i__1 = *n * (*n + 1) / 2; + sscal_(&i__1, anorm, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + r__1 = 1.f / onorm; + sscal_(&i__2, &r__1, &a[j * a_dim1 + 1], &c__1); + i__2 = kll + kuu + 1; + sscal_(&i__2, anorm, &a[j * a_dim1 + 1], &c__1); +/* L520: */ + } + + } + + } else { + +/* Scale straightforwardly */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + r__1 = *anorm / onorm; + sscal_(m, &r__1, &a[j * a_dim1 + 1], &c__1); +/* L530: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + r__1 = *anorm / onorm; + sscal_(&i__1, &r__1, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + r__1 = *anorm / onorm; + sscal_(&i__2, &r__1, &a[j * a_dim1 + 1], &c__1); +/* L540: */ + } + } + + } + + } + +/* End of SLATMR */ + + return 0; +} /* slatmr_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatms.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatms.c new file mode 100644 index 0000000..2bf2342 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slatms.c @@ -0,0 +1,1337 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__1 = 1; +static real c_b22 = 0.f; +static logical c_true = TRUE_; +static logical c_false = FALSE_; + +/* Subroutine */ int slatms_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, real *d, integer *mode, real *cond, real *dmax__, + integer *kl, integer *ku, char *pack, real *a, integer *lda, real * + work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + real r__1, r__2, r__3; + logical L__1; + + /* Builtin functions */ + double cos(doublereal), sin(doublereal); + + /* Local variables */ + static integer ilda, icol; + static real temp; + static integer irow, isym; + static real c; + static integer i, j, k; + static real s, alpha, angle; + static integer ipack, ioffg; + extern logical lsame_(char *, char *); + static integer iinfo; + extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *); + static integer idist, mnmin, iskew; + static real extra, dummy; + extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *, + integer *), slatm1_(integer *, real *, integer *, integer *, + integer *, real *, integer *, integer *); + static integer ic, jc, nc, il, iendch, ir, jr, ipackg, mr; + extern /* Subroutine */ int slagge_(integer *, integer *, integer *, + integer *, real *, real *, integer *, integer *, real *, integer * + ); + static integer minlda; + extern /* Subroutine */ int xerbla_(char *, integer *); + extern doublereal slarnd_(integer *, integer *); + static logical iltemp, givens; + static integer ioffst, irsign; + extern /* Subroutine */ int slartg_(real *, real *, real *, real *, real * + ), slaset_(char *, integer *, integer *, real *, real *, real *, + integer *), slagsy_(integer *, integer *, real *, real *, + integer *, integer *, real *, integer *), slarot_(logical *, + logical *, logical *, integer *, real *, real *, real *, integer * + , real *, real *); + static logical ilextr, topdwn; + static integer ir1, ir2, isympk, jch, llb, jkl, jku, uub; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + SLATMS generates random matrices with specified singular values + (or symmetric/hermitian with specified eigenvalues) + for testing LAPACK programs. + + SLATMS operates by applying the following sequence of + operations: + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and SYM + as described below. + + Generate a matrix with the appropriate band structure, by one + of two methods: + + Method A: + Generate a dense M x N matrix by multiplying D on the left + and the right by random unitary matrices, then: + + Reduce the bandwidth according to KL and KU, using + Householder transformations. + + Method B: + Convert the bandwidth-0 (i.e., diagonal) matrix to a + bandwidth-1 matrix using Givens rotations, "chasing" + out-of-band elements back, much as in QR; then + convert the bandwidth-1 to a bandwidth-2 matrix, etc. + Note that for reasonably small bandwidths (relative to + M and N) this requires less storage, as a dense matrix + is not generated. Also, for symmetric matrices, only + one triangle is generated. + + Method A is chosen if the bandwidth is a large fraction of the + order of the matrix, and LDA is at least M (so a dense + matrix can be stored.) Method B is chosen if the bandwidth + + is small (< 1/2 N for symmetric, < .3 N+M for + non-symmetric), or LDA is less than M and not less than the + + bandwidth. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric) + zero out lower half (if symmetric) + store the upper half columnwise (if symmetric or upper + triangular) + store the lower half columnwise (if symmetric or lower + triangular) + store the lower triangle in banded format (if symmetric + or lower triangular) + store the upper triangle in banded format (if symmetric + or upper triangular) + store the entire matrix in banded format + If Method B is chosen, and band format is specified, then the + matrix will be generated in the band format, so no repacking + + will be necessary. + + Arguments + ========= + + M - INTEGER + The number of rows of A. Not modified. + + N - INTEGER + The number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values. + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to SLATMS + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S' or 'H', the generated matrix is symmetric, with + eigenvalues specified by D, COND, MODE, and DMAX; they + may be positive, negative, or zero. + If SYM='P', the generated matrix is symmetric, with + eigenvalues (= singular values) specified by D, COND, + MODE, and DMAX; they will not be negative. + If SYM='N', the generated matrix is nonsymmetric, with + singular values specified by D, COND, MODE, and DMAX; + they will not be negative. + Not modified. + + D - REAL array, dimension ( MIN( M , N ) ) + This array is used to specify the singular values or + eigenvalues of A (see SYM, above.) If MODE=0, then D is + assumed to contain the singular/eigenvalues, otherwise + they will be computed according to MODE, COND, and DMAX, + and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the singular/eigenvalues are to + + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + If SYM='S' or 'H', and MODE is neither 0, 6, nor -6, then + the elements of D will also be multiplied by a random + sign (i.e., +1 or -1.) + Not modified. + + COND - REAL + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - REAL + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or + + singular value (which is to say the norm) will be abs(DMAX). + + Note that DMAX need not be positive: if DMAX is negative + (or zero), D will be scaled by a negative number (or zero). + + Not modified. + + KL - INTEGER + This specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL being at least M-1 means that the matrix + + has full lower bandwidth. KL must equal KU if the matrix + is symmetric. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU being at least N-1 means that the matrix + + has full upper bandwidth. KL must equal KU if the matrix + is symmetric. + Not modified. + + PACK - CHARACTER*1 + This specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric) + 'L' => zero out all superdiagonal entries (if symmetric) + 'C' => store the upper triangle columnwise + (only if the matrix is symmetric or upper triangular) + + 'R' => store the lower triangle columnwise + (only if the matrix is symmetric or lower triangular) + + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric or lower triangular) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric or upper triangular) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB or TB - use 'B' or 'Q' + PP, SP or TP - use 'C' or 'R' + + If two calls to SLATMS differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - REAL array, dimension ( LDA, N ) + On exit A is the desired test matrix. A is first generated + + in full (unpacked) form, and then packed, if so specified + by PACK. Thus, the first M elements of the first N + columns will always be modified. If PACK specifies a + packed or banded storage scheme, all LDA elements of the + first N columns will be modified; the elements of the + array which do not correspond to elements of the generated + matrix are set to zero. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. If PACK='N', 'U', 'L', 'C', or 'R', then + LDA must be at least M. If PACK='B' or 'Q', then LDA must + be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)). + If PACK='Z', LDA must be large enough to hold the packed + array: MIN( KU, N-1) + MIN( KL, M-1) + 1. + Not modified. + + WORK - REAL array, dimension ( 3*MAX( N , M ) ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => M negative or unequal to N and SYM='S', 'H', or 'P' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => KL negative + -11 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N'; + + or PACK='C' or 'Q' and SYM='N' and KL is not zero; + or PACK='R' or 'B' and SYM='N' and KU is not zero; + or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not + + N. + -14 => LDA is less than M, or PACK='Z' and LDA is less than + + MIN(KU,N-1) + MIN(KL,M-1) + 1. + 1 => Error return from SLATM1 + 2 => Cannot scale to DMAX (max. sing. value is 0) + 3 => Error return from SLAGGE or SLAGSY + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "N")) { + isym = 1; + irsign = 0; + } else if (lsame_(sym, "P")) { + isym = 2; + irsign = 0; + } else if (lsame_(sym, "S")) { + isym = 2; + irsign = 1; + } else if (lsame_(sym, "H")) { + isym = 2; + irsign = 1; + } else { + isym = -1; + } + +/* Decode PACK */ + + isympk = 0; + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + isympk = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + isympk = 1; + } else if (lsame_(pack, "C")) { + ipack = 3; + isympk = 2; + } else if (lsame_(pack, "R")) { + ipack = 4; + isympk = 3; + } else if (lsame_(pack, "B")) { + ipack = 5; + isympk = 3; + } else if (lsame_(pack, "Q")) { + ipack = 6; + isympk = 2; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + llb = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + uub = min(i__1,i__2); +/* Computing MIN */ + i__1 = *m, i__2 = *n + llb; + mr = min(i__1,i__2); +/* Computing MIN */ + i__1 = *n, i__2 = *m + uub; + nc = min(i__1,i__2); + + if (ipack == 5 || ipack == 6) { + minlda = uub + 1; + } else if (ipack == 7) { + minlda = llb + uub + 1; + } else { + minlda = *m; + } + +/* Use Givens rotation method if bandwidth small enough, + or if LDA is too small to store the matrix unpacked. */ + + givens = FALSE_; + if (isym == 1) { +/* Computing MAX */ + i__1 = 1, i__2 = mr + nc; + if ((real) (llb + uub) < (real) max(i__1,i__2) * .3f) { + givens = TRUE_; + } + } else { + if (llb << 1 < *m) { + givens = TRUE_; + } + } + if (*lda < *m && *lda >= minlda) { + givens = TRUE_; + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym != 1) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (abs(*mode) > 6) { + *info = -7; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.f) { + *info = -8; + } else if (*kl < 0) { + *info = -10; + } else if (*ku < 0 || isym != 1 && *kl != *ku) { + *info = -11; + } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym + == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk + != 0 && *m != *n) { + *info = -12; + } else if (*lda < max(1,minlda)) { + *info = -14; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("SLATMS", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L10: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up D if indicated. + + Compute D according to COND and MODE */ + + slatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + +/* Choose Top-Down if D is (apparently) increasing, + Bottom-Up if D is (apparently) decreasing. */ + + if (dabs(d[1]) <= (r__1 = d[mnmin], dabs(r__1))) { + topdwn = TRUE_; + } else { + topdwn = FALSE_; + } + + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = dabs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + r__2 = temp, r__3 = (r__1 = d[i], dabs(r__1)); + temp = dmax(r__2,r__3); +/* L20: */ + } + + if (temp > 0.f) { + alpha = *dmax__ / temp; + } else { + *info = 2; + return 0; + } + + sscal_(&mnmin, &alpha, &d[1], &c__1); + + } + +/* 3) Generate Banded Matrix using Givens rotations. + Also the special case of UUB=LLB=0 + + Compute Addressing constants to cover all + storage formats. Whether GE, SY, GB, or SB, + upper or lower triangle or both, + the (i,j)-th element is in + A( i - ISKEW*j + IOFFST, j ) */ + + if (ipack > 4) { + ilda = *lda - 1; + iskew = 1; + if (ipack > 5) { + ioffst = uub + 1; + } else { + ioffst = 1; + } + } else { + ilda = *lda; + iskew = 0; + ioffst = 0; + } + +/* IPACKG is the format that the matrix is generated in. If this is + different from IPACK, then the matrix must be repacked at the + end. It also signals how to compute the norm, for scaling. */ + + ipackg = 0; + slaset_("Full", lda, n, &c_b22, &c_b22, &a[a_offset], lda); + +/* Diagonal Matrix -- We are done, unless it + is to be stored SP/PP/TP (PACK='R' or 'C') */ + + if (llb == 0 && uub == 0) { + i__1 = ilda + 1; + scopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffst + a_dim1], &i__1); + if (ipack <= 2 || ipack >= 5) { + ipackg = ipack; + } + + } else if (givens) { + +/* Check whether to use Givens rotations, + Householder transformations, or nothing. */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + if (ipack > 4) { + ipackg = ipack; + } else { + ipackg = 0; + } + + i__1 = ilda + 1; + scopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffst + a_dim1], & + i__1); + + if (topdwn) { + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + Last row actually rotated is M + Last column actually rotated is MIN( M+ +JKU, N ) + + Computing MIN */ + i__3 = *m + jku; + i__2 = min(i__3,*n) + jkl - 1; + for (jr = 1; jr <= i__2; ++jr) { + extra = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__4 = jr - jkl; + icol = max(i__3,i__4); + if (jr < *m) { +/* Computing MIN */ + i__3 = *n, i__4 = jr + jku; + il = min(i__3,i__4) + 1 - icol; + L__1 = jr > jkl; + slarot_(&c_true, &L__1, &c_false, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ir = jr; + ic = icol; + i__3 = -jkl - jku; + for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ir < *m) { + slartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &c, &s, + &dummy); + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + temp = 0.f; + iltemp = jch > jku; + r__1 = -(doublereal)s; + slarot_(&c_false, &iltemp, &c_true, &il, &c, & + r__1, &a[irow - iskew * ic + ioffst + ic * + a_dim1], &ilda, &temp, &extra); + if (iltemp) { + slartg_(&a[irow + 1 - iskew * (ic + 1) + + ioffst + (ic + 1) * a_dim1], &temp, & + c, &s, &dummy); +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + extra = 0.f; + L__1 = jch > jku + jkl; + r__1 = -(doublereal)s; + slarot_(&c_true, &L__1, &c_true, &il, &c, & + r__1, &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, & + temp); + ic = icol; + ir = irow; + } +/* L30: */ + } +/* L40: */ + } +/* L50: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + Computing MIN */ + i__3 = *n + jkl; + i__2 = min(i__3,*m) + jku - 1; + for (jc = 1; jc <= i__2; ++jc) { + extra = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__4 = jc - jku; + irow = max(i__3,i__4); + if (jc < *n) { +/* Computing MIN */ + i__3 = *m, i__4 = jc + jkl; + il = min(i__3,i__4) + 1 - irow; + L__1 = jc > jku; + slarot_(&c_false, &L__1, &c_false, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ic = jc; + ir = irow; + i__3 = -jkl - jku; + for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ic < *n) { + slartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &c, &s, + &dummy); + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + temp = 0.f; + iltemp = jch > jkl; + r__1 = -(doublereal)s; + slarot_(&c_true, &iltemp, &c_true, &il, &c, &r__1, + &a[ir - iskew * icol + ioffst + icol * + a_dim1], &ilda, &temp, &extra); + if (iltemp) { + slartg_(&a[ir + 1 - iskew * (icol + 1) + + ioffst + (icol + 1) * a_dim1], &temp, + &c, &s, &dummy); +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + extra = 0.f; + L__1 = jch > jkl + jku; + r__1 = -(doublereal)s; + slarot_(&c_false, &L__1, &c_true, &il, &c, & + r__1, &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, & + temp); + ic = icol; + ir = irow; + } +/* L60: */ + } +/* L70: */ + } +/* L80: */ + } + + } else { + +/* Bottom-Up -- Start at the bottom right. */ + + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + First row actually rotated is M + First column actually rotated is MIN( M ++JKU, N ) + + Computing MIN */ + i__2 = *m, i__3 = *n + jkl; + iendch = min(i__2,i__3) - 1; +/* Computing MIN */ + i__2 = *m + jku; + i__3 = 1 - jkl; + for (jc = min(i__2,*n) - 1; jc >= i__3; --jc) { + extra = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__2 = 1, i__4 = jc - jku + 1; + irow = max(i__2,i__4); + if (jc > 0) { +/* Computing MIN */ + i__2 = *m, i__4 = jc + jkl + 1; + il = min(i__2,i__4) + 1 - irow; + L__1 = jc + jkl < *m; + slarot_(&c_false, &c_false, &L__1, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ic = jc; + i__2 = iendch; + i__4 = jkl + jku; + for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <= + i__2; jch += i__4) { + ilextr = ic > 0; + if (ilextr) { + slartg_(&a[jch - iskew * ic + ioffst + ic * + a_dim1], &extra, &c, &s, &dummy); + } + ic = max(1,ic); +/* Computing MIN */ + i__5 = *n - 1, i__6 = jch + jku; + icol = min(i__5,i__6); + iltemp = jch + jku < *n; + temp = 0.f; + i__5 = icol + 2 - ic; + slarot_(&c_true, &ilextr, &iltemp, &i__5, &c, &s, + &a[jch - iskew * ic + ioffst + ic * + a_dim1], &ilda, &extra, &temp); + if (iltemp) { + slartg_(&a[jch - iskew * icol + ioffst + icol + * a_dim1], &temp, &c, &s, &dummy); +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra = 0.f; + L__1 = jch + jkl + jku <= iendch; + slarot_(&c_false, &c_true, &L__1, &il, &c, &s, + &a[jch - iskew * icol + ioffst + + icol * a_dim1], &ilda, &temp, &extra); + ic = icol; + } +/* L90: */ + } +/* L100: */ + } +/* L110: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + First row actually rotated is MIN( N+JK +L, M ) + First column actually rotated is N + + Computing MIN */ + i__3 = *n, i__4 = *m + jku; + iendch = min(i__3,i__4) - 1; +/* Computing MIN */ + i__3 = *n + jkl; + i__4 = 1 - jku; + for (jr = min(i__3,*m) - 1; jr >= i__4; --jr) { + extra = 0.f; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = sin(angle); +/* Computing MAX */ + i__3 = 1, i__2 = jr - jkl + 1; + icol = max(i__3,i__2); + if (jr > 0) { +/* Computing MIN */ + i__3 = *n, i__2 = jr + jku + 1; + il = min(i__3,i__2) + 1 - icol; + L__1 = jr + jku < *n; + slarot_(&c_true, &c_false, &L__1, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ir = jr; + i__3 = iendch; + i__2 = jkl + jku; + for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <= + i__3; jch += i__2) { + ilextr = ir > 0; + if (ilextr) { + slartg_(&a[ir - iskew * jch + ioffst + jch * + a_dim1], &extra, &c, &s, &dummy); + } + ir = max(1,ir); +/* Computing MIN */ + i__5 = *m - 1, i__6 = jch + jkl; + irow = min(i__5,i__6); + iltemp = jch + jkl < *m; + temp = 0.f; + i__5 = irow + 2 - ir; + slarot_(&c_false, &ilextr, &iltemp, &i__5, &c, &s, + &a[ir - iskew * jch + ioffst + jch * + a_dim1], &ilda, &extra, &temp); + if (iltemp) { + slartg_(&a[irow - iskew * jch + ioffst + jch * + a_dim1], &temp, &c, &s, &dummy); +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra = 0.f; + L__1 = jch + jkl + jku <= iendch; + slarot_(&c_true, &c_true, &L__1, &il, &c, &s, + &a[irow - iskew * jch + ioffst + jch * + a_dim1], &ilda, &temp, &extra); + ir = irow; + } +/* L120: */ + } +/* L130: */ + } +/* L140: */ + } + } + + } else { + +/* Symmetric -- A = U D U' */ + + ipackg = ipack; + ioffg = ioffst; + + if (topdwn) { + +/* Top-Down -- Generate Upper triangle only */ + + if (ipack >= 5) { + ipackg = 6; + ioffg = uub + 1; + } else { + ipackg = 1; + } + i__1 = ilda + 1; + scopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffg + a_dim1], & + i__1); + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + i__4 = *n - 1; + for (jc = 1; jc <= i__4; ++jc) { +/* Computing MAX */ + i__2 = 1, i__3 = jc - k; + irow = max(i__2,i__3); +/* Computing MIN */ + i__2 = jc + 1, i__3 = k + 2; + il = min(i__2,i__3); + extra = 0.f; + temp = a[jc - iskew * (jc + 1) + ioffg + (jc + 1) * + a_dim1]; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = sin(angle); + L__1 = jc > k; + slarot_(&c_false, &L__1, &c_true, &il, &c, &s, &a[ + irow - iskew * jc + ioffg + jc * a_dim1], & + ilda, &extra, &temp); +/* Computing MIN */ + i__3 = k, i__5 = *n - jc; + i__2 = min(i__3,i__5) + 1; + slarot_(&c_true, &c_true, &c_false, &i__2, &c, &s, &a[ + (1 - iskew) * jc + ioffg + jc * a_dim1], & + ilda, &temp, &dummy); + +/* Chase EXTRA back up the matrix +*/ + + icol = jc; + i__2 = -k; + for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1; + jch += i__2) { + slartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg + + (icol + 1) * a_dim1], &extra, &c, &s, & + dummy); + temp = a[jch - iskew * (jch + 1) + ioffg + (jch + + 1) * a_dim1]; + i__3 = k + 2; + r__1 = -(doublereal)s; + slarot_(&c_true, &c_true, &c_true, &i__3, &c, & + r__1, &a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &temp, &extra); +/* Computing MAX */ + i__3 = 1, i__5 = jch - k; + irow = max(i__3,i__5); +/* Computing MIN */ + i__3 = jch + 1, i__5 = k + 2; + il = min(i__3,i__5); + extra = 0.f; + L__1 = jch > k; + r__1 = -(doublereal)s; + slarot_(&c_false, &L__1, &c_true, &il, &c, &r__1, + &a[irow - iskew * jch + ioffg + jch * + a_dim1], &ilda, &extra, &temp); + icol = jch; +/* L150: */ + } +/* L160: */ + } +/* L170: */ + } + +/* If we need lower triangle, copy from upper. No +te that + the order of copying is chosen to work for 'q' + -> 'b' */ + + if (ipack != ipackg && ipack != 3) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst - iskew * jc; +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + a[jr + irow + jc * a_dim1] = a[jc - iskew * jr + + ioffg + jr * a_dim1]; +/* L180: */ + } +/* L190: */ + } + if (ipack == 5) { + i__1 = *n; + for (jc = *n - uub + 1; jc <= i__1; ++jc) { + i__4 = uub + 1; + for (jr = *n + 2 - jc; jr <= i__4; ++jr) { + a[jr + jc * a_dim1] = 0.f; +/* L200: */ + } +/* L210: */ + } + } + if (ipackg == 6) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } else { + +/* Bottom-Up -- Generate Lower triangle only */ + + if (ipack >= 5) { + ipackg = 5; + if (ipack == 6) { + ioffg = 1; + } + } else { + ipackg = 2; + } + i__1 = ilda + 1; + scopy_(&mnmin, &d[1], &c__1, &a[1 - iskew + ioffg + a_dim1], & + i__1); + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + for (jc = *n - 1; jc >= 1; --jc) { +/* Computing MIN */ + i__4 = *n + 1 - jc, i__2 = k + 2; + il = min(i__4,i__2); + extra = 0.f; + temp = a[(1 - iskew) * jc + 1 + ioffg + jc * a_dim1]; + angle = slarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663f; + c = cos(angle); + s = -(doublereal)sin(angle); + L__1 = *n - jc > k; + slarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[(1 + - iskew) * jc + ioffg + jc * a_dim1], &ilda, & + temp, &extra); +/* Computing MAX */ + i__4 = 1, i__2 = jc - k + 1; + icol = max(i__4,i__2); + i__4 = jc + 2 - icol; + slarot_(&c_true, &c_false, &c_true, &i__4, &c, &s, &a[ + jc - iskew * icol + ioffg + icol * a_dim1], & + ilda, &dummy, &temp); + +/* Chase EXTRA back down the matrix + */ + + icol = jc; + i__4 = *n - 1; + i__2 = k; + for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <= + i__4; jch += i__2) { + slartg_(&a[jch - iskew * icol + ioffg + icol * + a_dim1], &extra, &c, &s, &dummy); + temp = a[(1 - iskew) * jch + 1 + ioffg + jch * + a_dim1]; + i__3 = k + 2; + slarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[jch - iskew * icol + ioffg + icol * + a_dim1], &ilda, &extra, &temp); +/* Computing MIN */ + i__3 = *n + 1 - jch, i__5 = k + 2; + il = min(i__3,i__5); + extra = 0.f; + L__1 = *n - jch > k; + slarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[ + (1 - iskew) * jch + ioffg + jch * a_dim1], + &ilda, &temp, &extra); + icol = jch; +/* L220: */ + } +/* L230: */ + } +/* L240: */ + } + +/* If we need upper triangle, copy from lower. No +te that + the order of copying is chosen to work for 'b' + -> 'q' */ + + if (ipack != ipackg && ipack != 4) { + for (jc = *n; jc >= 1; --jc) { + irow = ioffst - iskew * jc; +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + a[jr + irow + jc * a_dim1] = a[jc - iskew * jr + + ioffg + jr * a_dim1]; +/* L250: */ + } +/* L260: */ + } + if (ipack == 6) { + i__1 = uub; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.f; +/* L270: */ + } +/* L280: */ + } + } + if (ipackg == 5) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } + } + + } else { + +/* 4) Generate Banded Matrix by first + Rotating by random Unitary matrices, + then reducing the bandwidth using Householder + transformations. + + Note: we should get here only if LDA .ge. N */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + slagge_(&mr, &nc, &llb, &uub, &d[1], &a[a_offset], lda, &iseed[1], + &work[1], &iinfo); + } else { + +/* Symmetric -- A = U D U' */ + + slagsy_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1], & + iinfo); + + } + if (iinfo != 0) { + *info = 3; + return 0; + } + } + +/* 5) Pack the matrix */ + + if (ipack != ipackg) { + if (ipack == 1) { + +/* 'U' -- Upper triangular, not packed */ + + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j + 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.f; +/* L290: */ + } +/* L300: */ + } + + } else if (ipack == 2) { + +/* 'L' -- Lower triangular, not packed */ + + i__1 = *m; + for (j = 2; j <= i__1; ++j) { + i__2 = j - 1; + for (i = 1; i <= i__2; ++i) { + a[i + j * a_dim1] = 0.f; +/* L310: */ + } +/* L320: */ + } + + } else if (ipack == 3) { + +/* 'C' -- Upper triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + a[irow + icol * a_dim1] = a[i + j * a_dim1]; +/* L330: */ + } +/* L340: */ + } + + } else if (ipack == 4) { + +/* 'R' -- Lower triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + a[irow + icol * a_dim1] = a[i + j * a_dim1]; +/* L350: */ + } +/* L360: */ + } + + } else if (ipack >= 5) { + +/* 'B' -- The lower triangle is packed as a band matrix. + + 'Q' -- The upper triangle is packed as a band matrix. + + 'Z' -- The whole matrix is packed as a band matrix. +*/ + + if (ipack == 5) { + uub = 0; + } + if (ipack == 6) { + llb = 0; + } + + i__1 = uub; + for (j = 1; j <= i__1; ++j) { +/* Computing MIN */ + i__2 = j + llb; + for (i = min(i__2,*m); i >= 1; --i) { + a[i - j + uub + 1 + j * a_dim1] = a[i + j * a_dim1]; +/* L370: */ + } +/* L380: */ + } + + i__1 = *n; + for (j = uub + 2; j <= i__1; ++j) { +/* Computing MIN */ + i__4 = j + llb; + i__2 = min(i__4,*m); + for (i = j - uub; i <= i__2; ++i) { + a[i - j + uub + 1 + j * a_dim1] = a[i + j * a_dim1]; +/* L390: */ + } +/* L400: */ + } + } + +/* If packed, zero out extraneous elements. + + Symmetric/Triangular Packed -- + zero out everything after A(IROW,ICOL) */ + + if (ipack == 3 || ipack == 4) { + i__1 = *m; + for (jc = icol; jc <= i__1; ++jc) { + i__2 = *lda; + for (jr = irow + 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.f; +/* L410: */ + } + irow = 0; +/* L420: */ + } + + } else if (ipack >= 5) { + +/* Packed Band -- + 1st row is now in A( UUB+2-j, j), zero above it + m-th row is now in A( M+UUB-j,j), zero below it + last non-zero diagonal is now in A( UUB+LLB+1,j ), + + zero below it, too. */ + + ir1 = uub + llb + 2; + ir2 = uub + *m + 2; + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + a[jr + jc * a_dim1] = 0.f; +/* L430: */ + } +/* Computing MAX + Computing MIN */ + i__3 = ir1, i__5 = ir2 - jc; + i__2 = 1, i__4 = min(i__3,i__5); + i__6 = *lda; + for (jr = max(i__2,i__4); jr <= i__6; ++jr) { + a[jr + jc * a_dim1] = 0.f; +/* L440: */ + } +/* L450: */ + } + } + } + + return 0; + +/* End of SLATMS */ + +} /* slatms_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slu_Cnames.h b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slu_Cnames.h new file mode 100644 index 0000000..7bcd1bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/slu_Cnames.h @@ -0,0 +1,458 @@ +/*! @file slu_Cnames.h + * \brief Macros defining how C routines will be called + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 1, 1997
    + *
    + * These macros define how C routines will be called.  ADD_ assumes that
    + * they will be called by fortran, which expects C routines to have an
    + * underscore postfixed to the name (Suns, and the Intel expect this).
    + * NOCHANGE indicates that fortran will be calling, and that it expects
    + * the name called by fortran to be identical to that compiled by the C
    + * (RS6K's do this).  UPCASE says it expects C routines called by fortran
    + * to be in all upcase (CRAY wants this). 
    + * 
    + */ +#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */ +#define __SUPERLU_CNAMES + + +#define ADD_ 0 +#define ADD__ 1 +#define NOCHANGE 2 +#define UPCASE 3 +#define OLD_CRAY 4 +#define C_CALL 5 + +#ifdef UpCase +#define F77_CALL_C UPCASE +#endif + +#ifdef NoChange +#define F77_CALL_C NOCHANGE +#endif + +#ifdef Add_ +#define F77_CALL_C ADD_ +#endif + +#ifdef Add__ +#define F77_CALL_C ADD__ +#endif + +#ifdef _CRAY +#define F77_CALL_C OLD_CRAY +#endif + +/* Default */ +#ifndef F77_CALL_C +#define F77_CALL_C ADD_ +#endif + + +#if (F77_CALL_C == ADD_) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * No redefinition necessary to have following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm_(...) + * + * This is the default. + */ + +#endif + +#if (F77_CALL_C == ADD__) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm__(...) + */ +/* BLAS */ +#define sswap_ sswap__ +#define saxpy_ saxpy__ +#define sasum_ sasum__ +#define isamax_ isamax__ +#define scopy_ scopy__ +#define sscal_ sscal__ +#define sger_ sger__ +#define snrm2_ snrm2__ +#define ssymv_ ssymv__ +#define sdot_ sdot__ +#define saxpy_ saxpy__ +#define ssyr2_ ssyr2__ +#define srot_ srot__ +#define sgemv_ sgemv__ +#define strsv_ strsv__ +#define sgemm_ sgemm__ +#define strsm_ strsm__ + +#define dswap_ dswap__ +#define daxpy_ daxpy__ +#define dasum_ dasum__ +#define idamax_ idamax__ +#define dcopy_ dcopy__ +#define dscal_ dscal__ +#define dger_ dger__ +#define dnrm2_ dnrm2__ +#define dsymv_ dsymv__ +#define ddot_ ddot__ +#define dsyr2_ dsyr2__ +#define drot_ drot__ +#define dgemv_ dgemv__ +#define dtrsv_ dtrsv__ +#define dgemm_ dgemm__ +#define dtrsm_ dtrsm__ + +#define cswap_ cswap__ +#define caxpy_ caxpy__ +#define scasum_ scasum__ +#define icamax_ icamax__ +#define ccopy_ ccopy__ +#define cscal_ cscal__ +#define scnrm2_ scnrm2__ +#define caxpy_ caxpy__ +#define cgemv_ cgemv__ +#define ctrsv_ ctrsv__ +#define cgemm_ cgemm__ +#define ctrsm_ ctrsm__ +#define cgerc_ cgerc__ +#define chemv_ chemv__ +#define cher2_ cher2__ + +#define zswap_ zswap__ +#define zaxpy_ zaxpy__ +#define dzasum_ dzasum__ +#define izamax_ izamax__ +#define zcopy_ zcopy__ +#define zscal_ zscal__ +#define dznrm2_ dznrm2__ +#define zaxpy_ zaxpy__ +#define zgemv_ zgemv__ +#define ztrsv_ ztrsv__ +#define zgemm_ zgemm__ +#define ztrsm_ ztrsm__ +#define zgerc_ zgerc__ +#define zhemv_ zhemv__ +#define zher2_ zher2__ + +/* LAPACK */ +#define dlamch_ dlamch__ +#define slamch_ slamch__ +#define xerbla_ xerbla__ +#define lsame_ lsame__ +#define dlacon_ dlacon__ +#define slacon_ slacon__ +#define icmax1_ icmax1__ +#define scsum1_ scsum1__ +#define clacon_ clacon__ +#define dzsum1_ dzsum1__ +#define izmax1_ izmax1__ +#define zlacon_ zlacon__ + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv__ +#define c_fortran_sgssv_ c_fortran_sgssv__ +#define c_fortran_dgssv_ c_fortran_dgssv__ +#define c_fortran_cgssv_ c_fortran_cgssv__ +#define c_fortran_zgssv_ c_fortran_zgssv__ +#endif + +#if (F77_CALL_C == UPCASE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void DGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define saxpy_ SAXPY +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ DSWAP +#define daxpy_ DAXPY +#define dasum_ DASUM +#define idamax_ IDAMAX +#define dcopy_ DCOPY +#define dscal_ DSCAL +#define dger_ DGER +#define dnrm2_ DNRM2 +#define dsymv_ DSYMV +#define ddot_ DDOT +#define dsyr2_ DSYR2 +#define drot_ DROT +#define dgemv_ DGEMV +#define dtrsv_ DTRSV +#define dgemm_ DGEMM +#define dtrsm_ DTRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == OLD_CRAY) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void SGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ SSWAP +#define daxpy_ SAXPY +#define dasum_ SASUM +#define idamax_ ISAMAX +#define dcopy_ SCOPY +#define dscal_ SSCAL +#define dger_ SGER +#define dnrm2_ SNRM2 +#define dsymv_ SSYMV +#define ddot_ SDOT +#define dsyr2_ SSYR2 +#define drot_ SROT +#define dgemv_ SGEMV +#define dtrsv_ STRSV +#define dgemm_ SGEMM +#define dtrsm_ STRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define caxpy_ CAXPY +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == NOCHANGE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm(...) + */ +/* BLAS */ +#define sswap_ sswap +#define saxpy_ saxpy +#define sasum_ sasum +#define isamax_ isamax +#define scopy_ scopy +#define sscal_ sscal +#define sger_ sger +#define snrm2_ snrm2 +#define ssymv_ ssymv +#define sdot_ sdot +#define saxpy_ saxpy +#define ssyr2_ ssyr2 +#define srot_ srot +#define sgemv_ sgemv +#define strsv_ strsv +#define sgemm_ sgemm +#define strsm_ strsm + +#define dswap_ dswap +#define daxpy_ daxpy +#define dasum_ dasum +#define idamax_ idamax +#define dcopy_ dcopy +#define dscal_ dscal +#define dger_ dger +#define dnrm2_ dnrm2 +#define dsymv_ dsymv +#define ddot_ ddot +#define dsyr2_ dsyr2 +#define drot_ drot +#define dgemv_ dgemv +#define dtrsv_ dtrsv +#define dgemm_ dgemm +#define dtrsm_ dtrsm + +#define cswap_ cswap +#define caxpy_ caxpy +#define scasum_ scasum +#define icamax_ icamax +#define ccopy_ ccopy +#define cscal_ cscal +#define scnrm2_ scnrm2 +#define cgemv_ cgemv +#define ctrsv_ ctrsv +#define cgemm_ cgemm +#define ctrsm_ ctrsm +#define cgerc_ cgerc +#define chemv_ chemv +#define cher2_ cher2 + +#define zswap_ zswap +#define zaxpy_ zaxpy +#define dzasum_ dzasum +#define izamax_ izamax +#define zcopy_ zcopy +#define zscal_ zscal +#define dznrm2_ dznrm2 +#define zgemv_ zgemv +#define ztrsv_ ztrsv +#define zgemm_ zgemm +#define ztrsm_ ztrsm +#define zgerc_ zgerc +#define zhemv_ zhemv +#define zher2_ zher2 + +/* LAPACK */ +#define dlamch_ dlamch +#define slamch_ slamch +#define xerbla_ xerbla +#define lsame_ lsame +#define dlacon_ dlacon +#define slacon_ slacon +#define icmax1_ icmax1 +#define scsum1_ scsum1 +#define clacon_ clacon +#define dzsum1_ dzsum1 +#define izmax1_ izmax1 +#define zlacon_ zlacon + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv +#define c_fortran_sgssv_ c_fortran_sgssv +#define c_fortran_dgssv_ c_fortran_dgssv +#define c_fortran_cgssv_ c_fortran_cgssv +#define c_fortran_zgssv_ c_fortran_zgssv +#endif + + +#endif /* __SUPERLU_CNAMES */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zdotc.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zdotc.c new file mode 100644 index 0000000..63ba4fb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zdotc.c @@ -0,0 +1,85 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Double Complex */ VOID zdotc_(doublecomplex * ret_val, integer *n, + doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy) +{ + /* System generated locals */ + integer i__1, i__2; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer i; + static doublecomplex ztemp; + static integer ix, iy; + + +/* forms the dot product of a vector. + jack dongarra, 3/11/78. + modified 12/3/93, array(1) declarations changed to array(*) + + + Parameter adjustments */ + --zy; + --zx; + + /* Function Body */ + ztemp.r = 0., ztemp.i = 0.; + ret_val->r = 0., ret_val->i = 0.; + if (*n <= 0) { + return ; + } + if (*incx == 1 && *incy == 1) { + goto L20; + } + +/* code for unequal increments or equal increments + not equal to 1 */ + + ix = 1; + iy = 1; + if (*incx < 0) { + ix = (-(*n) + 1) * *incx + 1; + } + if (*incy < 0) { + iy = (-(*n) + 1) * *incy + 1; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + d_cnjg(&z__3, &zx[ix]); + i__2 = iy; + z__2.r = z__3.r * zy[iy].r - z__3.i * zy[iy].i, z__2.i = z__3.r * + zy[iy].i + z__3.i * zy[iy].r; + z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i; + ztemp.r = z__1.r, ztemp.i = z__1.i; + ix += *incx; + iy += *incy; +/* L10: */ + } + ret_val->r = ztemp.r, ret_val->i = ztemp.i; + return ; + +/* code for both increments equal to 1 */ + +L20: + i__1 = *n; + for (i = 1; i <= *n; ++i) { + d_cnjg(&z__3, &zx[i]); + i__2 = i; + z__2.r = z__3.r * zy[i].r - z__3.i * zy[i].i, z__2.i = z__3.r * + zy[i].i + z__3.i * zy[i].r; + z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i; + ztemp.r = z__1.r, ztemp.i = z__1.i; +/* L30: */ + } + ret_val->r = ztemp.r, ret_val->i = ztemp.i; + return ; +} /* zdotc_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlacgv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlacgv.c new file mode 100644 index 0000000..ba1df58 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlacgv.c @@ -0,0 +1,76 @@ +#include "f2c.h" + +/* Subroutine */ int zlacgv_(integer *n, doublecomplex *x, integer *incx) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + ZLACGV conjugates a complex vector of length N. + + Arguments + ========= + + N (input) INTEGER + The length of the vector X. N >= 0. + + X (input/output) COMPLEX*16 array, dimension + (1+(N-1)*abs(INCX)) + On entry, the vector of length N to be conjugated. + On exit, X is overwritten with conjg(X). + + INCX (input) INTEGER + The spacing between successive elements of X. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2; + doublecomplex z__1; + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + /* Local variables */ + static integer ioff, i; + + +#define X(I) x[(I)-1] + + + if (*incx == 1) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + d_cnjg(&z__1, &X(i)); + X(i).r = z__1.r, X(i).i = z__1.i; +/* L10: */ + } + } else { + ioff = 1; + if (*incx < 0) { + ioff = 1 - (*n - 1) * *incx; + } + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = ioff; + d_cnjg(&z__1, &X(ioff)); + X(ioff).r = z__1.r, X(ioff).i = z__1.i; + ioff += *incx; +/* L20: */ + } + } + return 0; + +/* End of ZLACGV */ + +} /* zlacgv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagge.c new file mode 100644 index 0000000..0129749 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagge.c @@ -0,0 +1,465 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int zlagge_(integer *m, integer *n, integer *kl, integer *ku, + doublereal *d, doublecomplex *a, integer *lda, integer *iseed, + doublecomplex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + doublecomplex z__1; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void z_div(doublecomplex *, doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer i, j; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *), zscal_(integer *, doublecomplex *, + doublecomplex *, integer *), zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *); + extern doublereal dznrm2_(integer *, doublecomplex *, integer *); + static doublecomplex wa, wb; + static doublereal wn; + extern /* Subroutine */ int xerbla_(char *, integer *), zlacgv_( + integer *, doublecomplex *, integer *), zlarnv_(integer *, + integer *, integer *, doublecomplex *); + static doublecomplex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLAGGE generates a complex general m by n matrix A, by pre- and post- + + multiplying a real diagonal matrix D with random unitary matrices: + A = U*D*V. The lower and upper bandwidths may then be reduced to + kl and ku by additional unitary transformations. + + Arguments + ========= + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + KL (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= KL <= M-1. + + KU (input) INTEGER + The number of nonzero superdiagonals within the band of A. + 0 <= KU <= N-1. + + D (input) DOUBLE PRECISION array, dimension (min(M,N)) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX*16 array, dimension (LDA,N) + The generated m by n matrix A. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= M. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX*16 array, dimension (M+N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*m < 0) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (*kl < 0 || *kl > *m - 1) { + *info = -3; + } else if (*ku < 0 || *ku > *n - 1) { + *info = -4; + } else if (*lda < max(1,*m)) { + *info = -7; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("ZLAGGE", &i__1); + return 0; + } + +/* initialize A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.; +/* L30: */ + } + +/* pre- and post-multiply A by random unitary matrices */ + + for (i = min(*m,*n); i >= 1; --i) { + if (i < *m) { + +/* generate random reflection */ + + i__1 = *m - i + 1; + zlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *m - i + 1; + wn = dznrm2_(&i__1, &work[1], &c__1); + d__1 = wn / z_abs(&work[1]); + z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__1 = *m - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__1, &z__1, &work[2], &c__1); + work[1].r = 1., work[1].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* multiply A(i:m,i:n) by random reflection from the lef +t */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + zgemv_("Conjugate transpose", &i__1, &i__2, &c_b2, &a[i + i * + a_dim1], lda, &work[1], &c__1, &c_b1, &work[*m + 1], & + c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__1, &i__2, &z__1, &work[1], &c__1, &work[*m + 1], &c__1, + &a[i + i * a_dim1], lda); + } + if (i < *n) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + zlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dznrm2_(&i__1, &work[1], &c__1); + d__1 = wn / z_abs(&work[1]); + z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__1 = *n - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__1, &z__1, &work[2], &c__1); + work[1].r = 1., work[1].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* multiply A(i:m,i:n) by random reflection from the rig +ht */ + + i__1 = *m - i + 1; + i__2 = *n - i + 1; + zgemv_("No transpose", &i__1, &i__2, &c_b2, &a[i + i * a_dim1], + lda, &work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *m - i + 1; + i__2 = *n - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__1, &i__2, &z__1, &work[*n + 1], &c__1, &work[1], &c__1, + &a[i + i * a_dim1], lda); + } +/* L40: */ + } + +/* Reduce number of subdiagonals to KL and number of superdiagonals + to KU + + Computing MAX */ + i__2 = *m - 1 - *kl, i__3 = *n - 1 - *ku; + i__1 = max(i__2,i__3); + for (i = 1; i <= i__1; ++i) { + if (*kl <= *ku) { + +/* annihilate subdiagonal elements first (necessary if K +L = 0) + + Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = dznrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + d__1 = wn / z_abs(&a[*kl + i + i * a_dim1]); + i__2 = *kl + i + i * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = *kl + i + i * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *m - *kl - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + i__2 = *kl + i + i * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*kl + i + + (i + 1) * a_dim1], lda, &a[*kl + i + i * a_dim1], & + c__1, &c_b1, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + i__2 = *kl + i + i * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + } + +/* Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = dznrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + d__1 = wn / z_abs(&a[i + (*ku + i) * a_dim1]); + i__2 = i + (*ku + i) * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = i + (*ku + i) * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *n - *ku - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[i + (*ku + i + 1) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *n - *ku - i + 1; + zlacgv_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + zgemv_("No transpose", &i__2, &i__3, &c_b2, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, & + c_b1, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &work[1], &c__1, &a[i + (*ku + i) + * a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + } + } else { + +/* annihilate superdiagonal elements first (necessary if + + KU = 0) + + Computing MIN */ + i__2 = *n - 1 - *ku; + if (i <= min(i__2,*m)) { + +/* generate reflection to annihilate A(i,ku+i+1:n +) */ + + i__2 = *n - *ku - i + 1; + wn = dznrm2_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + d__1 = wn / z_abs(&a[i + (*ku + i) * a_dim1]); + i__2 = i + (*ku + i) * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = i + (*ku + i) * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *n - *ku - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[i + (*ku + i + 1) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(i+1:m,ku+i:n) from the r +ight */ + + i__2 = *n - *ku - i + 1; + zlacgv_(&i__2, &a[i + (*ku + i) * a_dim1], lda); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + zgemv_("No transpose", &i__2, &i__3, &c_b2, &a[i + 1 + (*ku + + i) * a_dim1], lda, &a[i + (*ku + i) * a_dim1], lda, & + c_b1, &work[1], &c__1); + i__2 = *m - i; + i__3 = *n - *ku - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &work[1], &c__1, &a[i + (*ku + i) + * a_dim1], lda, &a[i + 1 + (*ku + i) * a_dim1], lda); + i__2 = i + (*ku + i) * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + } + +/* Computing MIN */ + i__2 = *m - 1 - *kl; + if (i <= min(i__2,*n)) { + +/* generate reflection to annihilate A(kl+i+1:m,i +) */ + + i__2 = *m - *kl - i + 1; + wn = dznrm2_(&i__2, &a[*kl + i + i * a_dim1], &c__1); + d__1 = wn / z_abs(&a[*kl + i + i * a_dim1]); + i__2 = *kl + i + i * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = *kl + i + i * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *m - *kl - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[*kl + i + 1 + i * a_dim1], &c__1); + i__2 = *kl + i + i * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(kl+i:m,i+1:n) from the l +eft */ + + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*kl + i + + (i + 1) * a_dim1], lda, &a[*kl + i + i * a_dim1], & + c__1, &c_b1, &work[1], &c__1); + i__2 = *m - *kl - i + 1; + i__3 = *n - i; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &a[*kl + i + i * a_dim1], &c__1, & + work[1], &c__1, &a[*kl + i + (i + 1) * a_dim1], lda); + i__2 = *kl + i + i * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + } + } + + i__2 = *m; + for (j = *kl + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L50: */ + } + + i__2 = *n; + for (j = *ku + i + 1; j <= i__2; ++j) { + i__3 = i + j * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L60: */ + } +/* L70: */ + } + return 0; + +/* End of ZLAGGE */ + +} /* zlagge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaghe.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaghe.c new file mode 100644 index 0000000..4cad7aa --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaghe.c @@ -0,0 +1,314 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int zlaghe_(integer *n, integer *k, doublereal *d, + doublecomplex *a, integer *lda, integer *iseed, doublecomplex *work, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublereal d__1; + doublecomplex z__1, z__2, z__3, z__4; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg( + doublecomplex *, doublecomplex *); + + /* Local variables */ + extern /* Subroutine */ int zher2_(char *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *); + static integer i, j; + static doublecomplex alpha; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *), zscal_(integer *, doublecomplex *, + doublecomplex *, integer *); + extern /* Double Complex */ VOID zdotc_(doublecomplex *, integer *, + doublecomplex *, integer *, doublecomplex *, integer *); + extern /* Subroutine */ int zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *), + zhemv_(char *, integer *, doublecomplex *, doublecomplex *, + integer *, doublecomplex *, integer *, doublecomplex *, + doublecomplex *, integer *), zaxpy_(integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *); + extern doublereal dznrm2_(integer *, doublecomplex *, integer *); + static doublecomplex wa, wb; + static doublereal wn; + extern /* Subroutine */ int xerbla_(char *, integer *), zlarnv_( + integer *, integer *, integer *, doublecomplex *); + static doublecomplex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLAGHE generates a complex hermitian matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random unitary matrix: + A = U*D*U'. The semi-bandwidth may then be reduced to k by additional + + unitary transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) DOUBLE PRECISION array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX*16 array, dimension (LDA,N) + The generated n by n hermitian matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX*16 array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("ZLAGHE", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.; +/* L30: */ + } + +/* Generate lower triangle of hermitian matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + zlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dznrm2_(&i__1, &work[1], &c__1); + d__1 = wn / z_abs(&work[1]); + z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__1 = *n - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__1, &z__1, &work[2], &c__1); + work[1].r = 1., work[1].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * u */ + + i__1 = *n - i + 1; + zhemv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b1, &work[*n + 1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + z__3.r = -.5, z__3.i = 0.; + z__2.r = z__3.r * tau.r - z__3.i * tau.i, z__2.i = z__3.r * tau.i + + z__3.i * tau.r; + i__1 = *n - i + 1; + zdotc_(&z__4, &i__1, &work[*n + 1], &c__1, &work[1], &c__1); + z__1.r = z__2.r * z__4.r - z__2.i * z__4.i, z__1.i = z__2.r * z__4.i + + z__2.i * z__4.r; + alpha.r = z__1.r, alpha.i = z__1.i; + i__1 = *n - i + 1; + zaxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) */ + + i__1 = *n - i + 1; + z__1.r = -1., z__1.i = 0.; + zher2_("Lower", &i__1, &z__1, &work[1], &c__1, &work[*n + 1], &c__1, & + a[i + i * a_dim1], lda); +/* L40: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = dznrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + d__1 = wn / z_abs(&a[*k + i + i * a_dim1]); + i__2 = *k + i + i * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = *k + i + i * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *n - *k - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[*k + i + 1 + i * a_dim1], &c__1); + i__2 = *k + i + i * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i + (i + 1) + * a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b1, &work[ + 1], &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &a[*k + i + i * a_dim1], &c__1, &work[1], + &c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * u */ + + i__2 = *n - *k - i + 1; + zhemv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b1, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( y, u ) * u */ + + z__3.r = -.5, z__3.i = 0.; + z__2.r = z__3.r * tau.r - z__3.i * tau.i, z__2.i = z__3.r * tau.i + + z__3.i * tau.r; + i__2 = *n - *k - i + 1; + zdotc_(&z__4, &i__2, &work[1], &c__1, &a[*k + i + i * a_dim1], &c__1); + z__1.r = z__2.r * z__4.r - z__2.i * z__4.i, z__1.i = z__2.r * z__4.i + + z__2.i * z__4.r; + alpha.r = z__1.r, alpha.i = z__1.i; + i__2 = *n - *k - i + 1; + zaxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply hermitian rank-2 update to A(k+i:n,k+i:n) */ + + i__2 = *n - *k - i + 1; + z__1.r = -1., z__1.i = 0.; + zher2_("Lower", &i__2, &z__1, &a[*k + i + i * a_dim1], &c__1, &work[1] + , &c__1, &a[*k + i + (*k + i) * a_dim1], lda); + + i__2 = *k + i + i * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L50: */ + } +/* L60: */ + } + +/* Store full hermitian matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = j + i * a_dim1; + d_cnjg(&z__1, &a[i + j * a_dim1]); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L70: */ + } +/* L80: */ + } + return 0; + +/* End of ZLAGHE */ + +} /* zlaghe_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagsy.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagsy.c new file mode 100644 index 0000000..fb6da0d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlagsy.c @@ -0,0 +1,365 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int zlagsy_(integer *n, integer *k, doublereal *d, + doublecomplex *a, integer *lda, integer *iseed, doublecomplex *work, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8, + i__9; + doublereal d__1; + doublecomplex z__1, z__2, z__3, z__4; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void z_div(doublecomplex *, doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer i, j; + static doublecomplex alpha; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *), zscal_(integer *, doublecomplex *, + doublecomplex *, integer *); + extern /* Double Complex */ VOID zdotc_(doublecomplex *, integer *, + doublecomplex *, integer *, doublecomplex *, integer *); + extern /* Subroutine */ int zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *), + zaxpy_(integer *, doublecomplex *, doublecomplex *, integer *, + doublecomplex *, integer *), zsymv_(char *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *); + extern doublereal dznrm2_(integer *, doublecomplex *, integer *); + static integer ii, jj; + static doublecomplex wa, wb; + static doublereal wn; + extern /* Subroutine */ int xerbla_(char *, integer *), zlacgv_( + integer *, doublecomplex *, integer *), zlarnv_(integer *, + integer *, integer *, doublecomplex *); + static doublecomplex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLAGSY generates a complex symmetric matrix A, by pre- and post- + multiplying a real diagonal matrix D with a random unitary matrix: + A = U*D*U**T. The semi-bandwidth may then be reduced to k by + additional unitary transformations. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + K (input) INTEGER + The number of nonzero subdiagonals within the band of A. + 0 <= K <= N-1. + + D (input) DOUBLE PRECISION array, dimension (N) + The diagonal elements of the diagonal matrix D. + + A (output) COMPLEX*16 array, dimension (LDA,N) + The generated n by n symmetric matrix A (the full matrix is + stored). + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX*16 array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*k < 0 || *k > *n - 1) { + *info = -2; + } else if (*lda < max(1,*n)) { + *info = -5; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("ZLAGSY", &i__1); + return 0; + } + +/* initialize lower triangle of A to diagonal matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L10: */ + } +/* L20: */ + } + i__1 = *n; + for (i = 1; i <= i__1; ++i) { + i__2 = i + i * a_dim1; + i__3 = i; + a[i__2].r = d[i__3], a[i__2].i = 0.; +/* L30: */ + } + +/* Generate lower triangle of symmetric matrix */ + + for (i = *n - 1; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + zlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dznrm2_(&i__1, &work[1], &c__1); + d__1 = wn / z_abs(&work[1]); + z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__1 = *n - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__1, &z__1, &work[2], &c__1); + work[1].r = 1., work[1].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply random reflection to A(i:n,i:n) from the left + and the right + + compute y := tau * A * conjg(u) */ + + i__1 = *n - i + 1; + zlacgv_(&i__1, &work[1], &c__1); + i__1 = *n - i + 1; + zsymv_("Lower", &i__1, &tau, &a[i + i * a_dim1], lda, &work[1], &c__1, + &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + zlacgv_(&i__1, &work[1], &c__1); + +/* compute v := y - 1/2 * tau * ( u, y ) * u */ + + z__3.r = -.5, z__3.i = 0.; + z__2.r = z__3.r * tau.r - z__3.i * tau.i, z__2.i = z__3.r * tau.i + + z__3.i * tau.r; + i__1 = *n - i + 1; + zdotc_(&z__4, &i__1, &work[1], &c__1, &work[*n + 1], &c__1); + z__1.r = z__2.r * z__4.r - z__2.i * z__4.i, z__1.i = z__2.r * z__4.i + + z__2.i * z__4.r; + alpha.r = z__1.r, alpha.i = z__1.i; + i__1 = *n - i + 1; + zaxpy_(&i__1, &alpha, &work[1], &c__1, &work[*n + 1], &c__1); + +/* apply the transformation as a rank-2 update to A(i:n,i:n) + + CALL ZSYR2( 'Lower', N-I+1, -ONE, WORK, 1, WORK( N+1 ), 1, + + $ A( I, I ), LDA ) */ + + i__1 = *n; + for (jj = i; jj <= i__1; ++jj) { + i__2 = *n; + for (ii = jj; ii <= i__2; ++ii) { + i__3 = ii + jj * a_dim1; + i__4 = ii + jj * a_dim1; + i__5 = ii - i + 1; + i__6 = *n + jj - i + 1; + z__3.r = work[i__5].r * work[i__6].r - work[i__5].i * work[ + i__6].i, z__3.i = work[i__5].r * work[i__6].i + work[ + i__5].i * work[i__6].r; + z__2.r = a[i__4].r - z__3.r, z__2.i = a[i__4].i - z__3.i; + i__7 = *n + ii - i + 1; + i__8 = jj - i + 1; + z__4.r = work[i__7].r * work[i__8].r - work[i__7].i * work[ + i__8].i, z__4.i = work[i__7].r * work[i__8].i + work[ + i__7].i * work[i__8].r; + z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i; + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L40: */ + } +/* L50: */ + } +/* L60: */ + } + +/* Reduce number of subdiagonals to K */ + + i__1 = *n - 1 - *k; + for (i = 1; i <= i__1; ++i) { + +/* generate reflection to annihilate A(k+i+1:n,i) */ + + i__2 = *n - *k - i + 1; + wn = dznrm2_(&i__2, &a[*k + i + i * a_dim1], &c__1); + d__1 = wn / z_abs(&a[*k + i + i * a_dim1]); + i__2 = *k + i + i * a_dim1; + z__1.r = d__1 * a[i__2].r, z__1.i = d__1 * a[i__2].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + i__2 = *k + i + i * a_dim1; + z__1.r = a[i__2].r + wa.r, z__1.i = a[i__2].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__2 = *n - *k - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__2, &z__1, &a[*k + i + 1 + i * a_dim1], &c__1); + i__2 = *k + i + i * a_dim1; + a[i__2].r = 1., a[i__2].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* apply reflection to A(k+i:n,i+1:k+i-1) from the left */ + + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + zgemv_("Conjugate transpose", &i__2, &i__3, &c_b2, &a[*k + i + (i + 1) + * a_dim1], lda, &a[*k + i + i * a_dim1], &c__1, &c_b1, &work[ + 1], &c__1); + i__2 = *n - *k - i + 1; + i__3 = *k - 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__2, &i__3, &z__1, &a[*k + i + i * a_dim1], &c__1, &work[1], + &c__1, &a[*k + i + (i + 1) * a_dim1], lda); + +/* apply reflection to A(k+i:n,k+i:n) from the left and the rig +ht + + compute y := tau * A * conjg(u) */ + + i__2 = *n - *k - i + 1; + zlacgv_(&i__2, &a[*k + i + i * a_dim1], &c__1); + i__2 = *n - *k - i + 1; + zsymv_("Lower", &i__2, &tau, &a[*k + i + (*k + i) * a_dim1], lda, &a[* + k + i + i * a_dim1], &c__1, &c_b1, &work[1], &c__1); + i__2 = *n - *k - i + 1; + zlacgv_(&i__2, &a[*k + i + i * a_dim1], &c__1); + +/* compute v := y - 1/2 * tau * ( u, y ) * u */ + + z__3.r = -.5, z__3.i = 0.; + z__2.r = z__3.r * tau.r - z__3.i * tau.i, z__2.i = z__3.r * tau.i + + z__3.i * tau.r; + i__2 = *n - *k - i + 1; + zdotc_(&z__4, &i__2, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1); + z__1.r = z__2.r * z__4.r - z__2.i * z__4.i, z__1.i = z__2.r * z__4.i + + z__2.i * z__4.r; + alpha.r = z__1.r, alpha.i = z__1.i; + i__2 = *n - *k - i + 1; + zaxpy_(&i__2, &alpha, &a[*k + i + i * a_dim1], &c__1, &work[1], &c__1) + ; + +/* apply symmetric rank-2 update to A(k+i:n,k+i:n) + + CALL ZSYR2( 'Lower', N-K-I+1, -ONE, A( K+I, I ), 1, WORK, 1, + + $ A( K+I, K+I ), LDA ) */ + + i__2 = *n; + for (jj = *k + i; jj <= i__2; ++jj) { + i__3 = *n; + for (ii = jj; ii <= i__3; ++ii) { + i__4 = ii + jj * a_dim1; + i__5 = ii + jj * a_dim1; + i__6 = ii + i * a_dim1; + i__7 = jj - *k - i + 1; + z__3.r = a[i__6].r * work[i__7].r - a[i__6].i * work[i__7].i, + z__3.i = a[i__6].r * work[i__7].i + a[i__6].i * work[ + i__7].r; + z__2.r = a[i__5].r - z__3.r, z__2.i = a[i__5].i - z__3.i; + i__8 = ii - *k - i + 1; + i__9 = jj + i * a_dim1; + z__4.r = work[i__8].r * a[i__9].r - work[i__8].i * a[i__9].i, + z__4.i = work[i__8].r * a[i__9].i + work[i__8].i * a[ + i__9].r; + z__1.r = z__2.r - z__4.r, z__1.i = z__2.i - z__4.i; + a[i__4].r = z__1.r, a[i__4].i = z__1.i; +/* L70: */ + } +/* L80: */ + } + + i__2 = *k + i + i * a_dim1; + z__1.r = -wa.r, z__1.i = -wa.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + i__2 = *n; + for (j = *k + i + 1; j <= i__2; ++j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; +/* L90: */ + } +/* L100: */ + } + +/* Store full symmetric matrix */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *n; + for (i = j + 1; i <= i__2; ++i) { + i__3 = j + i * a_dim1; + i__4 = i + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; +/* L110: */ + } +/* L120: */ + } + return 0; + +/* End of ZLAGSY */ + +} /* zlagsy_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarge.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarge.c new file mode 100644 index 0000000..a7d6300 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarge.c @@ -0,0 +1,161 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int zlarge_(integer *n, doublecomplex *a, integer *lda, + integer *iseed, doublecomplex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1; + doublereal d__1; + doublecomplex z__1; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void z_div(doublecomplex *, doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer i; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *), zscal_(integer *, doublecomplex *, + doublecomplex *, integer *), zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *); + extern doublereal dznrm2_(integer *, doublecomplex *, integer *); + static doublecomplex wa, wb; + static doublereal wn; + extern /* Subroutine */ int xerbla_(char *, integer *), zlarnv_( + integer *, integer *, integer *, doublecomplex *); + static doublecomplex tau; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLARGE pre- and post-multiplies a complex general n by n matrix A + with a random unitary matrix: A = U*D*U'. + + Arguments + ========= + + N (input) INTEGER + The order of the matrix A. N >= 0. + + A (input/output) COMPLEX*16 array, dimension (LDA,N) + On entry, the original n by n matrix A. + On exit, A is overwritten by U*A*U' for some random + unitary matrix U. + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= N. + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + WORK (workspace) COMPLEX*16 array, dimension (2*N) + + INFO (output) INTEGER + = 0: successful exit + < 0: if INFO = -i, the i-th argument had an illegal value + + ===================================================================== + + + + Test the input arguments + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --work; + + /* Function Body */ + *info = 0; + if (*n < 0) { + *info = -1; + } else if (*lda < max(1,*n)) { + *info = -3; + } + if (*info < 0) { + i__1 = -(*info); + xerbla_("ZLARGE", &i__1); + return 0; + } + +/* pre- and post-multiply A by random unitary matrix */ + + for (i = *n; i >= 1; --i) { + +/* generate random reflection */ + + i__1 = *n - i + 1; + zlarnv_(&c__3, &iseed[1], &i__1, &work[1]); + i__1 = *n - i + 1; + wn = dznrm2_(&i__1, &work[1], &c__1); + d__1 = wn / z_abs(&work[1]); + z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i; + wa.r = z__1.r, wa.i = z__1.i; + if (wn == 0.) { + tau.r = 0., tau.i = 0.; + } else { + z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i; + wb.r = z__1.r, wb.i = z__1.i; + i__1 = *n - i; + z_div(&z__1, &c_b2, &wb); + zscal_(&i__1, &z__1, &work[2], &c__1); + work[1].r = 1., work[1].i = 0.; + z_div(&z__1, &wb, &wa); + d__1 = z__1.r; + tau.r = d__1, tau.i = 0.; + } + +/* multiply A(i:n,1:n) by random reflection from the left */ + + i__1 = *n - i + 1; + zgemv_("Conjugate transpose", &i__1, n, &c_b2, &a[i + a_dim1], lda, & + work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&i__1, n, &z__1, &work[1], &c__1, &work[*n + 1], &c__1, &a[i + + a_dim1], lda); + +/* multiply A(1:n,i:n) by random reflection from the right */ + + i__1 = *n - i + 1; + zgemv_("No transpose", n, &i__1, &c_b2, &a[i * a_dim1 + 1], lda, & + work[1], &c__1, &c_b1, &work[*n + 1], &c__1); + i__1 = *n - i + 1; + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(n, &i__1, &z__1, &work[*n + 1], &c__1, &work[1], &c__1, &a[i * + a_dim1 + 1], lda); +/* L10: */ + } + return 0; + +/* End of ZLARGE */ + +} /* zlarge_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnd.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnd.c new file mode 100644 index 0000000..20a782d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnd.c @@ -0,0 +1,126 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Double Complex */ VOID zlarnd_(doublecomplex * ret_val, integer *idist, + integer *iseed) +{ + /* System generated locals */ + doublereal d__1, d__2; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + double log(doublereal), sqrt(doublereal); + void z_exp(doublecomplex *, doublecomplex *); + + /* Local variables */ + static doublereal t1, t2; + extern doublereal dlaran_(integer *); + + +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLARND returns a random complex number from a uniform or normal + distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: real and imaginary parts each uniform (0,1) + = 2: real and imaginary parts each uniform (-1,1) + = 3: real and imaginary parts each normal (0,1) + = 4: uniformly distributed on the disc abs(z) <= 1 + = 5: uniformly distributed on the circle abs(z) = 1 + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + Further Details + =============== + + This routine calls the auxiliary routine DLARAN to generate a random + + real number from a uniform (0,1) distribution. The Box-Muller method + + is used to transform numbers from a uniform to a normal distribution. + + + ===================================================================== + + + + Generate a pair of real random numbers from a uniform (0,1) + distribution + + Parameter adjustments */ + --iseed; + + /* Function Body */ + t1 = dlaran_(&iseed[1]); + t2 = dlaran_(&iseed[1]); + + if (*idist == 1) { + +/* real and imaginary parts each uniform (0,1) */ + + z__1.r = t1, z__1.i = t2; + ret_val->r = z__1.r, ret_val->i = z__1.i; + } else if (*idist == 2) { + +/* real and imaginary parts each uniform (-1,1) */ + + d__1 = t1 * 2. - 1.; + d__2 = t2 * 2. - 1.; + z__1.r = d__1, z__1.i = d__2; + ret_val->r = z__1.r, ret_val->i = z__1.i; + } else if (*idist == 3) { + +/* real and imaginary parts each normal (0,1) */ + + d__1 = sqrt(log(t1) * -2.); + d__2 = t2 * 6.2831853071795864769252867663; + z__3.r = 0., z__3.i = d__2; + z_exp(&z__2, &z__3); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + ret_val->r = z__1.r, ret_val->i = z__1.i; + } else if (*idist == 4) { + +/* uniform distribution on the unit disc abs(z) <= 1 */ + + d__1 = sqrt(t1); + d__2 = t2 * 6.2831853071795864769252867663; + z__3.r = 0., z__3.i = d__2; + z_exp(&z__2, &z__3); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + ret_val->r = z__1.r, ret_val->i = z__1.i; + } else if (*idist == 5) { + +/* uniform distribution on the unit circle abs(z) = 1 */ + + d__1 = t2 * 6.2831853071795864769252867663; + z__2.r = 0., z__2.i = d__1; + z_exp(&z__1, &z__2); + ret_val->r = z__1.r, ret_val->i = z__1.i; + } + return ; + +/* End of ZLARND */ + +} /* zlarnd_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnv.c new file mode 100644 index 0000000..cd2798f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarnv.c @@ -0,0 +1,173 @@ +#include "f2c.h" + +/* Subroutine */ int zlarnv_(integer *idist, integer *iseed, integer *n, + doublecomplex *x) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLARNV returns a vector of n random complex numbers from a uniform or + + normal distribution. + + Arguments + ========= + + IDIST (input) INTEGER + Specifies the distribution of the random numbers: + = 1: real and imaginary parts each uniform (0,1) + = 2: real and imaginary parts each uniform (-1,1) + = 3: real and imaginary parts each normal (0,1) + = 4: uniformly distributed on the disc abs(z) < 1 + = 5: uniformly distributed on the circle abs(z) = 1 + + ISEED (input/output) INTEGER array, dimension (4) + On entry, the seed of the random number generator; the array + + elements must be between 0 and 4095, and ISEED(4) must be + odd. + On exit, the seed is updated. + + N (input) INTEGER + The number of random numbers to be generated. + + X (output) COMPLEX*16 array, dimension (N) + The generated random numbers. + + Further Details + =============== + + This routine calls the auxiliary routine DLARUV to generate random + real numbers from a uniform (0,1) distribution, in batches of up to + 128 using vectorisable code. The Box-Muller method is used to + transform numbers from a uniform to a normal distribution. + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer i__1, i__2, i__3, i__4, i__5; + doublereal d__1, d__2; + doublecomplex z__1, z__2, z__3; + /* Builtin functions */ + double log(doublereal), sqrt(doublereal); + void z_exp(doublecomplex *, doublecomplex *); + /* Local variables */ + static integer i; + static doublereal u[128]; + static integer il, iv; + extern /* Subroutine */ int dlaruv_(integer *, integer *, doublereal *); + + +#define U(I) u[(I)] +#define X(I) x[(I)-1] +#define ISEED(I) iseed[(I)-1] + + + i__1 = *n; + for (iv = 1; iv <= *n; iv += 64) { +/* Computing MIN */ + i__2 = 64, i__3 = *n - iv + 1; + il = min(i__2,i__3); + +/* Call DLARUV to generate 2*IL real numbers from a uniform (0, +1) + distribution (2*IL <= LV) */ + + i__2 = il << 1; + dlaruv_(&ISEED(1), &i__2, u); + + if (*idist == 1) { + +/* Copy generated numbers */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + i__4 = (i << 1) - 2; + i__5 = (i << 1) - 1; + z__1.r = U((i<<1)-2), z__1.i = U((i<<1)-1); + X(iv+i-1).r = z__1.r, X(iv+i-1).i = z__1.i; +/* L10: */ + } + } else if (*idist == 2) { + +/* Convert generated numbers to uniform (-1,1) distribut +ion */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = U((i << 1) - 2) * 2. - 1.; + d__2 = U((i << 1) - 1) * 2. - 1.; + z__1.r = d__1, z__1.i = d__2; + X(iv+i-1).r = z__1.r, X(iv+i-1).i = z__1.i; +/* L20: */ + } + } else if (*idist == 3) { + +/* Convert generated numbers to normal (0,1) distributio +n */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = sqrt(log(U((i << 1) - 2)) * -2.); + d__2 = U((i << 1) - 1) * 6.2831853071795864769252867663; + z__3.r = 0., z__3.i = d__2; + z_exp(&z__2, &z__3); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + X(iv+i-1).r = z__1.r, X(iv+i-1).i = z__1.i; +/* L30: */ + } + } else if (*idist == 4) { + +/* Convert generated numbers to complex numbers uniforml +y + distributed on the unit disk */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = sqrt(U((i << 1) - 2)); + d__2 = U((i << 1) - 1) * 6.2831853071795864769252867663; + z__3.r = 0., z__3.i = d__2; + z_exp(&z__2, &z__3); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + X(iv+i-1).r = z__1.r, X(iv+i-1).i = z__1.i; +/* L40: */ + } + } else if (*idist == 5) { + +/* Convert generated numbers to complex numbers uniforml +y + distributed on the unit circle */ + + i__2 = il; + for (i = 1; i <= il; ++i) { + i__3 = iv + i - 1; + d__1 = U((i << 1) - 1) * 6.2831853071795864769252867663; + z__2.r = 0., z__2.i = d__1; + z_exp(&z__1, &z__2); + X(iv+i-1).r = z__1.r, X(iv+i-1).i = z__1.i; +/* L50: */ + } + } +/* L60: */ + } + return 0; + +/* End of ZLARNV */ + +} /* zlarnv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaror.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaror.c new file mode 100644 index 0000000..26658a1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaror.c @@ -0,0 +1,356 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__3 = 3; +static integer c__1 = 1; + +/* Subroutine */ int zlaror_(char *side, char *init, integer *m, integer *n, + doublecomplex *a, integer *lda, integer *iseed, doublecomplex *x, + integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + doublecomplex z__1, z__2; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer kbeg, jcol; + static doublereal xabs; + static integer irow, j; + extern logical lsame_(char *, char *); + static doublecomplex csign; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *), zscal_(integer *, doublecomplex *, + doublecomplex *, integer *); + static integer ixfrm; + extern /* Subroutine */ int zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *); + static integer itype, nxfrm; + static doublereal xnorm; + extern doublereal dznrm2_(integer *, doublecomplex *, integer *); + extern /* Subroutine */ int xerbla_(char *, integer *); + static doublereal factor; + extern /* Subroutine */ int zlacgv_(integer *, doublecomplex *, integer *) + ; + extern /* Double Complex */ VOID zlarnd_(doublecomplex *, integer *, + integer *); + extern /* Subroutine */ int zlaset_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, doublecomplex *, integer *); + static doublecomplex xnorms; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLAROR pre- or post-multiplies an M by N matrix A by a random + unitary matrix U, overwriting A. A may optionally be + initialized to the identity matrix before multiplying by U. + U is generated using the method of G.W. Stewart + ( SIAM J. Numer. Anal. 17, 1980, pp. 403-409 ). + (BLAS-2 version) + + Arguments + ========= + + SIDE - CHARACTER*1 + SIDE specifies whether A is multiplied on the left or right + + by U. + SIDE = 'L' Multiply A on the left (premultiply) by U + SIDE = 'R' Multiply A on the right (postmultiply) by U* + SIDE = 'C' Multiply A on the left by U and the right by U* + SIDE = 'T' Multiply A on the left by U and the right by U' + Not modified. + + INIT - CHARACTER*1 + INIT specifies whether or not A should be initialized to + the identity matrix. + INIT = 'I' Initialize A to (a section of) the + identity matrix before applying U. + INIT = 'N' No initialization. Apply U to the + input matrix A. + + INIT = 'I' may be used to generate square (i.e., unitary) + or rectangular orthogonal matrices (orthogonality being + in the sense of ZDOTC): + + For square matrices, M=N, and SIDE many be either 'L' or + 'R'; the rows will be orthogonal to each other, as will the + + columns. + For rectangular matrices where M < N, SIDE = 'R' will + produce a dense matrix whose rows will be orthogonal and + whose columns will not, while SIDE = 'L' will produce a + matrix whose rows will be orthogonal, and whose first M + columns will be orthogonal, the remaining columns being + zero. + For matrices where M > N, just use the previous + explaination, interchanging 'L' and 'R' and "rows" and + "columns". + + Not modified. + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + A - COMPLEX*16 array, dimension ( LDA, N ) + Input and output array. Overwritten by U A ( if SIDE = 'L' ) + + or by A U ( if SIDE = 'R' ) + or by U A U* ( if SIDE = 'C') + or by U A U' ( if SIDE = 'T') on exit. + + LDA - INTEGER + Leading dimension of A. Must be at least MAX ( 1, M ). + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. The array elements should be between 0 and 4095; + + if not they will be reduced mod 4096. Also, ISEED(4) must + be odd. The random number generator uses a linear + congruential sequence limited to small integers, and so + should produce machine independent random numbers. The + values of ISEED are changed on exit, and can be used in the + + next call to ZLAROR to continue the same random number + sequence. + Modified. + + X - COMPLEX*16 array, dimension ( 3*MAX( M, N ) ) + Workspace. Of length: + 2*M + N if SIDE = 'L', + 2*N + M if SIDE = 'R', + 3*N if SIDE = 'C' or 'T'. + Modified. + + INFO - INTEGER + An error flag. It is set to: + 0 if no error. + 1 if ZLARND returned a bad random number (installation + problem) + -1 if SIDE is not L, R, C, or T. + -3 if M is negative. + -4 if N is negative or if SIDE is C or T and N is not equal + + to M. + -6 if LDA is less than M. + + ===================================================================== + + + + Parameter adjustments */ + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iseed; + --x; + + /* Function Body */ + if (*n == 0 || *m == 0) { + return 0; + } + + itype = 0; + if (lsame_(side, "L")) { + itype = 1; + } else if (lsame_(side, "R")) { + itype = 2; + } else if (lsame_(side, "C")) { + itype = 3; + } else if (lsame_(side, "T")) { + itype = 4; + } + +/* Check for argument errors. */ + + *info = 0; + if (itype == 0) { + *info = -1; + } else if (*m < 0) { + *info = -3; + } else if (*n < 0 || itype == 3 && *n != *m) { + *info = -4; + } else if (*lda < *m) { + *info = -6; + } + if (*info != 0) { + i__1 = -(*info); + xerbla_("ZLAROR", &i__1); + return 0; + } + + if (itype == 1) { + nxfrm = *m; + } else { + nxfrm = *n; + } + +/* Initialize A to the identity matrix if desired */ + + if (lsame_(init, "I")) { + zlaset_("Full", m, n, &c_b1, &c_b2, &a[a_offset], lda); + } + +/* If no rotation possible, still multiply by + a random complex number from the circle |x| = 1 + + 2) Compute Rotation by computing Householder + Transformations H(2), H(3), ..., H(n). Note that the + order in which they are computed is irrelevant. */ + + i__1 = nxfrm; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + x[i__2].r = 0., x[i__2].i = 0.; +/* L10: */ + } + + i__1 = nxfrm; + for (ixfrm = 2; ixfrm <= i__1; ++ixfrm) { + kbeg = nxfrm - ixfrm + 1; + +/* Generate independent normal( 0, 1 ) random numbers */ + + i__2 = nxfrm; + for (j = kbeg; j <= i__2; ++j) { + i__3 = j; + zlarnd_(&z__1, &c__3, &iseed[1]); + x[i__3].r = z__1.r, x[i__3].i = z__1.i; +/* L20: */ + } + +/* Generate a Householder transformation from the random vector + X */ + + xnorm = dznrm2_(&ixfrm, &x[kbeg], &c__1); + xabs = z_abs(&x[kbeg]); + if (xabs != 0.) { + i__2 = kbeg; + z__1.r = x[i__2].r / xabs, z__1.i = x[i__2].i / xabs; + csign.r = z__1.r, csign.i = z__1.i; + } else { + csign.r = 1., csign.i = 0.; + } + z__1.r = xnorm * csign.r, z__1.i = xnorm * csign.i; + xnorms.r = z__1.r, xnorms.i = z__1.i; + i__2 = nxfrm + kbeg; + z__1.r = -csign.r, z__1.i = -csign.i; + x[i__2].r = z__1.r, x[i__2].i = z__1.i; + factor = xnorm * (xnorm + xabs); + if (abs(factor) < 1e-20) { + *info = 1; + i__2 = -(*info); + xerbla_("ZLAROR", &i__2); + return 0; + } else { + factor = 1. / factor; + } + i__2 = kbeg; + i__3 = kbeg; + z__1.r = x[i__3].r + xnorms.r, z__1.i = x[i__3].i + xnorms.i; + x[i__2].r = z__1.r, x[i__2].i = z__1.i; + +/* Apply Householder transformation to A */ + + if (itype == 1 || itype == 3 || itype == 4) { + +/* Apply H(k) on the left of A */ + + zgemv_("C", &ixfrm, n, &c_b2, &a[kbeg + a_dim1], lda, &x[kbeg], & + c__1, &c_b1, &x[(nxfrm << 1) + 1], &c__1); + z__2.r = factor, z__2.i = 0.; + z__1.r = -z__2.r, z__1.i = -z__2.i; + zgerc_(&ixfrm, n, &z__1, &x[kbeg], &c__1, &x[(nxfrm << 1) + 1], & + c__1, &a[kbeg + a_dim1], lda); + + } + + if (itype >= 2 && itype <= 4) { + +/* Apply H(k)* (or H(k)') on the right of A */ + + if (itype == 4) { + zlacgv_(&ixfrm, &x[kbeg], &c__1); + } + + zgemv_("N", m, &ixfrm, &c_b2, &a[kbeg * a_dim1 + 1], lda, &x[kbeg] + , &c__1, &c_b1, &x[(nxfrm << 1) + 1], &c__1); + z__2.r = factor, z__2.i = 0.; + z__1.r = -z__2.r, z__1.i = -z__2.i; + zgerc_(m, &ixfrm, &z__1, &x[(nxfrm << 1) + 1], &c__1, &x[kbeg], & + c__1, &a[kbeg * a_dim1 + 1], lda); + + } +/* L30: */ + } + + zlarnd_(&z__1, &c__3, &iseed[1]); + x[1].r = z__1.r, x[1].i = z__1.i; + xabs = z_abs(&x[1]); + if (xabs != 0.) { + z__1.r = x[1].r / xabs, z__1.i = x[1].i / xabs; + csign.r = z__1.r, csign.i = z__1.i; + } else { + csign.r = 1., csign.i = 0.; + } + i__1 = nxfrm << 1; + x[i__1].r = csign.r, x[i__1].i = csign.i; + +/* Scale the matrix A by D. */ + + if (itype == 1 || itype == 3 || itype == 4) { + i__1 = *m; + for (irow = 1; irow <= i__1; ++irow) { + d_cnjg(&z__1, &x[nxfrm + irow]); + zscal_(n, &z__1, &a[irow + a_dim1], lda); +/* L40: */ + } + } + + if (itype == 2 || itype == 3) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + zscal_(m, &x[nxfrm + jcol], &a[jcol * a_dim1 + 1], &c__1); +/* L50: */ + } + } + + if (itype == 4) { + i__1 = *n; + for (jcol = 1; jcol <= i__1; ++jcol) { + d_cnjg(&z__1, &x[nxfrm + jcol]); + zscal_(m, &z__1, &a[jcol * a_dim1 + 1], &c__1); +/* L60: */ + } + } + return 0; + +/* End of ZLAROR */ + +} /* zlaror_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarot.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarot.c new file mode 100644 index 0000000..26a5b97 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlarot.c @@ -0,0 +1,365 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__4 = 4; +static integer c__8 = 8; + +/* Subroutine */ int zlarot_(logical *lrows, logical *lleft, logical *lright, + integer *nl, doublecomplex *c, doublecomplex *s, doublecomplex *a, + integer *lda, doublecomplex *xleft, doublecomplex *xright) +{ + /* System generated locals */ + integer i__1, i__2, i__3, i__4; + doublecomplex z__1, z__2, z__3, z__4, z__5, z__6; + + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer iinc, j, inext; + static doublecomplex tempx; + static integer ix, iy, nt; + static doublecomplex xt[2], yt[2]; + extern /* Subroutine */ int xerbla_(char *, integer *); + static integer iyt; + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + ZLAROT applies a (Givens) rotation to two adjacent rows or + columns, where one element of the first and/or last column/row + may be a separate variable. This is specifically indended + for use on matrices stored in some format other than GE, so + that elements of the matrix may be used or modified for which + no array element is provided. + + One example is a symmetric matrix in SB format (bandwidth=4), for + + which UPLO='L': Two adjacent rows will have the format: + + row j: * * * * * . . . . + row j+1: * * * * * . . . . + + '*' indicates elements for which storage is provided, + '.' indicates elements for which no storage is provided, but + are not necessarily zero; their values are determined by + symmetry. ' ' indicates elements which are necessarily zero, + and have no storage provided. + + Those columns which have two '*'s can be handled by DROT. + Those columns which have no '*'s can be ignored, since as long + as the Givens rotations are carefully applied to preserve + symmetry, their values are determined. + Those columns which have one '*' have to be handled separately, + by using separate variables "p" and "q": + + row j: * * * * * p . . . + row j+1: q * * * * * . . . . + + The element p would have to be set correctly, then that column + is rotated, setting p to its new value. The next call to + ZLAROT would rotate columns j and j+1, using p, and restore + symmetry. The element q would start out being zero, and be + made non-zero by the rotation. Later, rotations would presumably + + be chosen to zero q out. + + Typical Calling Sequences: rotating the i-th and (i+1)-st rows. + ------- ------- --------- + + General dense matrix: + + CALL ZLAROT(.TRUE.,.FALSE.,.FALSE., N, C,S, + A(i,1),LDA, DUMMY, DUMMY) + + General banded matrix in GB format: + + j = MAX(1, i-KL ) + NL = MIN( N, i+KU+1 ) + 1-j + CALL ZLAROT( .TRUE., i-KL.GE.1, i+KU.LT.N, NL, C,S, + A(KU+i+1-j,j),LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,KL+1) ] + + Symmetric banded matrix in SY format, bandwidth K, + lower triangle only: + + j = MAX(1, i-K ) + NL = MIN( K+1, i ) + 1 + CALL ZLAROT( .TRUE., i-K.GE.1, .TRUE., NL, C,S, + A(i,j), LDA, XLEFT, XRIGHT ) + + Same, but upper triangle only: + + NL = MIN( K+1, N-i ) + 1 + CALL ZLAROT( .TRUE., .TRUE., i+K.LT.N, NL, C,S, + A(i,i), LDA, XLEFT, XRIGHT ) + + Symmetric banded matrix in SB format, bandwidth K, + lower triangle only: + + [ same as for SY, except:] + . . . . + A(i+1-j,j), LDA-1, XLEFT, XRIGHT ) + + [ note that i+1-j is just MIN(i,K+1) ] + + Same, but upper triangle only: + . . . + A(K+1,i), LDA-1, XLEFT, XRIGHT ) + + Rotating columns is just the transpose of rotating rows, except + + for GB and SB: (rotating columns i and i+1) + + GB: + j = MAX(1, i-KU ) + NL = MIN( N, i+KL+1 ) + 1-j + CALL ZLAROT( .TRUE., i-KU.GE.1, i+KL.LT.N, NL, C,S, + A(KU+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + [note that KU+j+1-i is just MAX(1,KU+2-i)] + + SB: (upper triangle) + + . . . . . . + A(K+j+1-i,i),LDA-1, XTOP, XBOTTM ) + + SB: (lower triangle) + + . . . . . . + A(1,i),LDA-1, XTOP, XBOTTM ) + + Arguments + ========= + + LROWS - LOGICAL + If .TRUE., then ZLAROT will rotate two rows. If .FALSE., + then it will rotate two columns. + Not modified. + + LLEFT - LOGICAL + If .TRUE., then XLEFT will be used instead of the + corresponding element of A for the first element in the + second row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) + If .FALSE., then the corresponding element of A will be + used. + Not modified. + + LRIGHT - LOGICAL + If .TRUE., then XRIGHT will be used instead of the + corresponding element of A for the last element in the + first row (if LROWS=.FALSE.) or column (if LROWS=.TRUE.) If + + .FALSE., then the corresponding element of A will be used. + Not modified. + + NL - INTEGER + The length of the rows (if LROWS=.TRUE.) or columns (if + LROWS=.FALSE.) to be rotated. If XLEFT and/or XRIGHT are + used, the columns/rows they are in should be included in + NL, e.g., if LLEFT = LRIGHT = .TRUE., then NL must be at + least 2. The number of rows/columns to be rotated + exclusive of those involving XLEFT and/or XRIGHT may + not be negative, i.e., NL minus how many of LLEFT and + LRIGHT are .TRUE. must be at least zero; if not, XERBLA + will be called. + Not modified. + + C, S - COMPLEX*16 + Specify the Givens rotation to be applied. If LROWS is + true, then the matrix ( c s ) + ( _ _ ) + (-s c ) is applied from the left; + if false, then the transpose (not conjugated) thereof is + applied from the right. Note that in contrast to the + output of ZROTG or to most versions of ZROT, both C and S + are complex. For a Givens rotation, |C|**2 + |S|**2 should + + be 1, but this is not checked. + Not modified. + + A - COMPLEX*16 array. + The array containing the rows/columns to be rotated. The + first element of A should be the upper left element to + be rotated. + Read and modified. + + LDA - INTEGER + The "effective" leading dimension of A. If A contains + a matrix stored in GE, HE, or SY format, then this is just + the leading dimension of A as dimensioned in the calling + routine. If A contains a matrix stored in band (GB, HB, or + + SB) format, then this should be *one less* than the leading + + dimension used in the calling routine. Thus, if A were + dimensioned A(LDA,*) in ZLAROT, then A(1,j) would be the + j-th element in the first of the two rows to be rotated, + and A(2,j) would be the j-th in the second, regardless of + how the array may be stored in the calling routine. [A + cannot, however, actually be dimensioned thus, since for + band format, the row number may exceed LDA, which is not + legal FORTRAN.] + If LROWS=.TRUE., then LDA must be at least 1, otherwise + it must be at least NL minus the number of .TRUE. values + in XLEFT and XRIGHT. + Not modified. + + XLEFT - COMPLEX*16 + If LLEFT is .TRUE., then XLEFT will be used and modified + instead of A(2,1) (if LROWS=.TRUE.) or A(1,2) + (if LROWS=.FALSE.). + Read and modified. + + XRIGHT - COMPLEX*16 + If LRIGHT is .TRUE., then XRIGHT will be used and modified + instead of A(1,NL) (if LROWS=.TRUE.) or A(NL,1) + (if LROWS=.FALSE.). + Read and modified. + + ===================================================================== + + + + Set up indices, arrays for ends + + Parameter adjustments */ + --a; + + /* Function Body */ + if (*lrows) { + iinc = *lda; + inext = 1; + } else { + iinc = 1; + inext = *lda; + } + + if (*lleft) { + nt = 1; + ix = iinc + 1; + iy = *lda + 2; + xt[0].r = a[1].r, xt[0].i = a[1].i; + yt[0].r = xleft->r, yt[0].i = xleft->i; + } else { + nt = 0; + ix = 1; + iy = inext + 1; + } + + if (*lright) { + iyt = inext + 1 + (*nl - 1) * iinc; + ++nt; + i__1 = nt - 1; + xt[i__1].r = xright->r, xt[i__1].i = xright->i; + i__1 = nt - 1; + i__2 = iyt; + yt[i__1].r = a[i__2].r, yt[i__1].i = a[i__2].i; + } + +/* Check for errors */ + + if (*nl < nt) { + xerbla_("ZLAROT", &c__4); + return 0; + } + if (*lda <= 0 || ! (*lrows) && *lda < *nl - nt) { + xerbla_("ZLAROT", &c__8); + return 0; + } + +/* Rotate + + ZROT( NL-NT, A(IX),IINC, A(IY),IINC, C, S ) with complex C, S */ + + i__1 = *nl - nt - 1; + for (j = 0; j <= i__1; ++j) { + i__2 = ix + j * iinc; + z__2.r = c->r * a[i__2].r - c->i * a[i__2].i, z__2.i = c->r * a[i__2] + .i + c->i * a[i__2].r; + i__3 = iy + j * iinc; + z__3.r = s->r * a[i__3].r - s->i * a[i__3].i, z__3.i = s->r * a[i__3] + .i + s->i * a[i__3].r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + tempx.r = z__1.r, tempx.i = z__1.i; + i__2 = iy + j * iinc; + d_cnjg(&z__4, s); + z__3.r = -z__4.r, z__3.i = -z__4.i; + i__3 = ix + j * iinc; + z__2.r = z__3.r * a[i__3].r - z__3.i * a[i__3].i, z__2.i = z__3.r * a[ + i__3].i + z__3.i * a[i__3].r; + d_cnjg(&z__6, c); + i__4 = iy + j * iinc; + z__5.r = z__6.r * a[i__4].r - z__6.i * a[i__4].i, z__5.i = z__6.r * a[ + i__4].i + z__6.i * a[i__4].r; + z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; + i__2 = ix + j * iinc; + a[i__2].r = tempx.r, a[i__2].i = tempx.i; +/* L10: */ + } + +/* ZROT( NT, XT,1, YT,1, C, S ) with complex C, S */ + + i__1 = nt; + for (j = 1; j <= i__1; ++j) { + i__2 = j - 1; + z__2.r = c->r * xt[i__2].r - c->i * xt[i__2].i, z__2.i = c->r * xt[ + i__2].i + c->i * xt[i__2].r; + i__3 = j - 1; + z__3.r = s->r * yt[i__3].r - s->i * yt[i__3].i, z__3.i = s->r * yt[ + i__3].i + s->i * yt[i__3].r; + z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i; + tempx.r = z__1.r, tempx.i = z__1.i; + i__2 = j - 1; + d_cnjg(&z__4, s); + z__3.r = -z__4.r, z__3.i = -z__4.i; + i__3 = j - 1; + z__2.r = z__3.r * xt[i__3].r - z__3.i * xt[i__3].i, z__2.i = z__3.r * + xt[i__3].i + z__3.i * xt[i__3].r; + d_cnjg(&z__6, c); + i__4 = j - 1; + z__5.r = z__6.r * yt[i__4].r - z__6.i * yt[i__4].i, z__5.i = z__6.r * + yt[i__4].i + z__6.i * yt[i__4].r; + z__1.r = z__2.r + z__5.r, z__1.i = z__2.i + z__5.i; + yt[i__2].r = z__1.r, yt[i__2].i = z__1.i; + i__2 = j - 1; + xt[i__2].r = tempx.r, xt[i__2].i = tempx.i; +/* L20: */ + } + +/* Stuff values back into XLEFT, XRIGHT, etc. */ + + if (*lleft) { + a[1].r = xt[0].r, a[1].i = xt[0].i; + xleft->r = yt[0].r, xleft->i = yt[0].i; + } + + if (*lright) { + i__1 = nt - 1; + xright->r = xt[i__1].r, xright->i = xt[i__1].i; + i__1 = iyt; + i__2 = nt - 1; + a[i__1].r = yt[i__2].r, a[i__1].i = yt[i__2].i; + } + + return 0; + +/* End of ZLAROT */ + +} /* zlarot_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlartg.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlartg.c new file mode 100644 index 0000000..5107870 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlartg.c @@ -0,0 +1,146 @@ +#include "f2c.h" + +/* Subroutine */ int zlartg_(doublecomplex *f, doublecomplex *g, doublereal * + cs, doublecomplex *sn, doublecomplex *r) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLARTG generates a plane rotation so that + + [ CS SN ] [ F ] [ R ] + [ __ ] . [ ] = [ ] where CS**2 + |SN|**2 = 1. + [ -SN CS ] [ G ] [ 0 ] + + This is a faster version of the BLAS1 routine ZROTG, except for + the following differences: + F and G are unchanged on return. + If G=0, then CS=1 and SN=0. + If F=0 and (G .ne. 0), then CS=0 and SN=1 without doing any + floating point operations. + + Arguments + ========= + + F (input) COMPLEX*16 + The first component of vector to be rotated. + + G (input) COMPLEX*16 + The second component of vector to be rotated. + + CS (output) DOUBLE PRECISION + The cosine of the rotation. + + SN (output) COMPLEX*16 + The sine of the rotation. + + R (output) COMPLEX*16 + The nonzero component of the rotated vector. + + ===================================================================== + + + + [ 25 or 38 ops for main paths ] */ + /* System generated locals */ + doublereal d__1, d__2; + doublecomplex z__1, z__2, z__3; + /* Builtin functions */ + void d_cnjg(doublecomplex *, doublecomplex *); + double z_abs(doublecomplex *), d_imag(doublecomplex *), sqrt(doublereal); + /* Local variables */ + static doublereal d, f1, f2, g1, g2, fa, ga, di; + static doublecomplex fs, gs, ss; + + + if (g->r == 0. && g->i == 0.) { + *cs = 1.; + sn->r = 0., sn->i = 0.; + r->r = f->r, r->i = f->i; + } else if (f->r == 0. && f->i == 0.) { + *cs = 0.; + + d_cnjg(&z__2, g); + d__1 = z_abs(g); + z__1.r = z__2.r / d__1, z__1.i = z__2.i / d__1; + sn->r = z__1.r, sn->i = z__1.i; + d__1 = z_abs(g); + r->r = d__1, r->i = 0.; + +/* SN = ONE + R = G */ + + } else { + f1 = (d__1 = f->r, abs(d__1)) + (d__2 = d_imag(f), abs(d__2)); + g1 = (d__1 = g->r, abs(d__1)) + (d__2 = d_imag(g), abs(d__2)); + if (f1 >= g1) { + z__1.r = g->r / f1, z__1.i = g->i / f1; + gs.r = z__1.r, gs.i = z__1.i; +/* Computing 2nd power */ + d__1 = gs.r; +/* Computing 2nd power */ + d__2 = d_imag(&gs); + g2 = d__1 * d__1 + d__2 * d__2; + z__1.r = f->r / f1, z__1.i = f->i / f1; + fs.r = z__1.r, fs.i = z__1.i; +/* Computing 2nd power */ + d__1 = fs.r; +/* Computing 2nd power */ + d__2 = d_imag(&fs); + f2 = d__1 * d__1 + d__2 * d__2; + d = sqrt(g2 / f2 + 1.); + *cs = 1. / d; + d_cnjg(&z__3, &gs); + z__2.r = z__3.r * fs.r - z__3.i * fs.i, z__2.i = z__3.r * fs.i + + z__3.i * fs.r; + d__1 = *cs / f2; + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + sn->r = z__1.r, sn->i = z__1.i; + z__1.r = d * f->r, z__1.i = d * f->i; + r->r = z__1.r, r->i = z__1.i; + } else { + z__1.r = f->r / g1, z__1.i = f->i / g1; + fs.r = z__1.r, fs.i = z__1.i; +/* Computing 2nd power */ + d__1 = fs.r; +/* Computing 2nd power */ + d__2 = d_imag(&fs); + f2 = d__1 * d__1 + d__2 * d__2; + fa = sqrt(f2); + z__1.r = g->r / g1, z__1.i = g->i / g1; + gs.r = z__1.r, gs.i = z__1.i; +/* Computing 2nd power */ + d__1 = gs.r; +/* Computing 2nd power */ + d__2 = d_imag(&gs); + g2 = d__1 * d__1 + d__2 * d__2; + ga = sqrt(g2); + d = sqrt(f2 / g2 + 1.); + di = 1. / d; + *cs = fa / ga * di; + d_cnjg(&z__3, &gs); + z__2.r = z__3.r * fs.r - z__3.i * fs.i, z__2.i = z__3.r * fs.i + + z__3.i * fs.r; + d__1 = fa * ga; + z__1.r = z__2.r / d__1, z__1.i = z__2.i / d__1; + ss.r = z__1.r, ss.i = z__1.i; + z__1.r = di * ss.r, z__1.i = di * ss.i; + sn->r = z__1.r, sn->i = z__1.i; + z__2.r = g->r * ss.r - g->i * ss.i, z__2.i = g->r * ss.i + g->i * + ss.r; + z__1.r = d * z__2.r, z__1.i = d * z__2.i; + r->r = z__1.r, r->i = z__1.i; + } + } + return 0; + +/* End of ZLARTG */ + +} /* zlartg_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaset.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaset.c new file mode 100644 index 0000000..6ddfc9c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlaset.c @@ -0,0 +1,145 @@ +#include "f2c.h" + +/* Subroutine */ int zlaset_(char *uplo, integer *m, integer *n, + doublecomplex *alpha, doublecomplex *beta, doublecomplex *a, integer * + lda) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + ZLASET initializes a 2-D array A to BETA on the diagonal and + ALPHA on the offdiagonals. + + Arguments + ========= + + UPLO (input) CHARACTER*1 + Specifies the part of the matrix A to be set. + = 'U': Upper triangular part is set. The lower triangle + + is unchanged. + = 'L': Lower triangular part is set. The upper triangle + + is unchanged. + Otherwise: All of the matrix A is set. + + M (input) INTEGER + On entry, M specifies the number of rows of A. + + N (input) INTEGER + On entry, N specifies the number of columns of A. + + ALPHA (input) COMPLEX*16 + All the offdiagonal array elements are set to ALPHA. + + BETA (input) COMPLEX*16 + All the diagonal array elements are set to BETA. + + A (input/output) COMPLEX*16 array, dimension (LDA,N) + On entry, the m by n matrix A. + On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j; + A(i,i) = BETA , 1 <= i <= min(m,n) + + LDA (input) INTEGER + The leading dimension of the array A. LDA >= max(1,M). + + ===================================================================== + + + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3; + /* Local variables */ + static integer i, j; + extern logical lsame_(char *, char *); + + + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + if (lsame_(uplo, "U")) { + +/* Set the diagonal to BETA and the strictly upper triangular + + part of the array to ALPHA. */ + + i__1 = *n; + for (j = 2; j <= *n; ++j) { +/* Computing MIN */ + i__3 = j - 1; + i__2 = min(i__3,*m); + for (i = 1; i <= min(j-1,*m); ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L10: */ + } +/* L20: */ + } + i__1 = min(*n,*m); + for (i = 1; i <= min(*n,*m); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L30: */ + } + + } else if (lsame_(uplo, "L")) { + +/* Set the diagonal to BETA and the strictly lower triangular + + part of the array to ALPHA. */ + + i__1 = min(*m,*n); + for (j = 1; j <= min(*m,*n); ++j) { + i__2 = *m; + for (i = j + 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L40: */ + } +/* L50: */ + } + i__1 = min(*n,*m); + for (i = 1; i <= min(*n,*m); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L60: */ + } + + } else { + +/* Set the array to BETA on the diagonal and ALPHA on the + offdiagonal. */ + + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = *m; + for (i = 1; i <= *m; ++i) { + i__3 = i + j * a_dim1; + A(i,j).r = alpha->r, A(i,j).i = alpha->i; +/* L70: */ + } +/* L80: */ + } + i__1 = min(*m,*n); + for (i = 1; i <= min(*m,*n); ++i) { + i__2 = i + i * a_dim1; + A(i,i).r = beta->r, A(i,i).i = beta->i; +/* L90: */ + } + } + + return 0; + +/* End of ZLASET */ + +} /* zlaset_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatb4.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatb4.c new file mode 100644 index 0000000..4bfba46 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatb4.c @@ -0,0 +1,468 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include +#include "f2c.h" + +/* Table of constant values */ + +static integer c__2 = 2; + +/* Subroutine */ int zlatb4_(char *path, integer *imat, integer *m, integer * + n, char *type, integer *kl, integer *ku, doublereal *anorm, integer * + mode, doublereal *cndnum, char *dist) +{ + /* Initialized data */ + + static logical first = TRUE_; + + /* System generated locals */ + integer i__1; + + /* Builtin functions */ + double sqrt(doublereal); + + + /* Local variables */ + static doublereal badc1, badc2, large, small; + static char c2[2]; + extern /* Subroutine */ int dlabad_(doublereal *, doublereal *); + extern doublereal dlamch_(char *); + extern logical lsamen_(integer *, char *, char *); + static integer mat; + static doublereal eps; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + ZLATB4 sets parameters for the matrix generator based on the type of + + matrix to be generated. + + Arguments + ========= + + PATH (input) CHARACTER*3 + The LAPACK path name. + + IMAT (input) INTEGER + An integer key describing which matrix to generate for this + path. + + M (input) INTEGER + The number of rows in the matrix to be generated. + + N (input) INTEGER + The number of columns in the matrix to be generated. + + TYPE (output) CHARACTER*1 + The type of the matrix to be generated: + = 'S': symmetric matrix + = 'P': symmetric positive (semi)definite matrix + = 'N': nonsymmetric matrix + + KL (output) INTEGER + The lower band width of the matrix to be generated. + + KU (output) INTEGER + The upper band width of the matrix to be generated. + + ANORM (output) DOUBLE PRECISION + The desired norm of the matrix to be generated. The diagonal + + matrix of singular values or eigenvalues is scaled by this + value. + + MODE (output) INTEGER + A key indicating how to choose the vector of eigenvalues. + + CNDNUM (output) DOUBLE PRECISION + The desired condition number. + + DIST (output) CHARACTER*1 + The type of distribution to be used by the random number + generator. + + ===================================================================== + + + + Set some constants for use in the subroutine. */ + + if (first) { + first = FALSE_; + eps = dlamch_("Precision"); + badc2 = .1 / eps; + badc1 = sqrt(badc2); + small = dlamch_("Safe minimum"); + large = 1. / small; + +/* If it looks like we're on a Cray, take the square root of + SMALL and LARGE to avoid overflow and underflow problems. */ + + dlabad_(&small, &large); + small = small / eps * .25; + large = 1. / small; + } + +/* s_copy(c2, path + 1, 2L, 2L);*/ + strncpy(c2, path + 1, 2); + +/* Set some parameters we don't plan to change. */ + + *(unsigned char *)dist = 'S'; + *mode = 3; + +/* xQR, xLQ, xQL, xRQ: Set parameters to generate a general + M x N matrix. */ + + if (lsamen_(&c__2, c2, "QR") || lsamen_(&c__2, c2, "LQ") + || lsamen_(&c__2, c2, "QL") || lsamen_(&c__2, c2, "RQ")) { + +/* Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GE")) { + +/* xGE: Set parameters to generate a general M x N matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + *ku = 0; + } else if (*imat == 2) { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } else if (*imat == 3) { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); + *ku = 0; + } else { +/* Computing MAX */ + i__1 = *m - 1; + *kl = max(i__1,0); +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (*imat == 8) { + *cndnum = badc1; + } else if (*imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 10) { + *anorm = small; + } else if (*imat == 11) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GB")) { + +/* xGB: Set parameters to generate a general banded matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the condition number and norm. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2 * .1; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "GT")) { + +/* xGT: Set parameters to generate a general tridiagonal matri +x. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PO") || lsamen_(&c__2, c2, "PP") || lsamen_(&c__2, c2, "HE") || lsamen_(&c__2, c2, + "HP") || lsamen_(&c__2, c2, "SY") || lsamen_(& + c__2, c2, "SP")) { + +/* xPO, xPP, xHE, xHP, xSY, xSP: Set parameters to generate a + + symmetric or Hermitian matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = *(unsigned char *)c2; + +/* Set the lower and upper bandwidths. */ + + if (*imat == 1) { + *kl = 0; + } else { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 6) { + *cndnum = badc1; + } else if (*imat == 7) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 8) { + *anorm = small; + } else if (*imat == 9) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PB")) { + +/* xPB: Set parameters to generate a symmetric band matrix. + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'P'; + +/* Set the norm and condition number. */ + + if (*imat == 5) { + *cndnum = badc1; + } else if (*imat == 6) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 7) { + *anorm = small; + } else if (*imat == 8) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "PT")) { + +/* xPT: Set parameters to generate a symmetric positive defini +te + tridiagonal matrix. */ + + *(unsigned char *)type = 'P'; + if (*imat == 1) { + *kl = 0; + } else { + *kl = 1; + } + *ku = *kl; + +/* Set the condition number and norm. */ + + if (*imat == 3) { + *cndnum = badc1; + } else if (*imat == 4) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 5 || *imat == 11) { + *anorm = small; + } else if (*imat == 6 || *imat == 12) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "TR") || lsamen_(&c__2, c2, "TP")) { + +/* xTR, xTP: Set parameters to generate a triangular matrix + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the lower and upper bandwidths. */ + + mat = abs(*imat); + if (mat == 1 || mat == 7) { + *kl = 0; + *ku = 0; + } else if (*imat < 0) { +/* Computing MAX */ + i__1 = *n - 1; + *kl = max(i__1,0); + *ku = 0; + } else { + *kl = 0; +/* Computing MAX */ + i__1 = *n - 1; + *ku = max(i__1,0); + } + +/* Set the condition number and norm. */ + + if (mat == 3 || mat == 9) { + *cndnum = badc1; + } else if (mat == 4 || mat == 10) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (mat == 5) { + *anorm = small; + } else if (mat == 6) { + *anorm = large; + } else { + *anorm = 1.; + } + + } else if (lsamen_(&c__2, c2, "TB")) { + +/* xTB: Set parameters to generate a triangular band matrix. + + + Set TYPE, the type of matrix to be generated. */ + + *(unsigned char *)type = 'N'; + +/* Set the norm and condition number. */ + + if (*imat == 2 || *imat == 8) { + *cndnum = badc1; + } else if (*imat == 3 || *imat == 9) { + *cndnum = badc2; + } else { + *cndnum = 2.; + } + + if (*imat == 4) { + *anorm = small; + } else if (*imat == 5) { + *anorm = large; + } else { + *anorm = 1.; + } + } + if (*n <= 1) { + *cndnum = 1.; + } + + return 0; + +/* End of ZLATB4 */ + +} /* zlatb4_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm2.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm2.c new file mode 100644 index 0000000..e4d2d42 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm2.c @@ -0,0 +1,286 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Double Complex */ VOID zlatm2_(doublecomplex * ret_val, integer *m, + integer *n, integer *i, integer *j, integer *kl, integer *ku, integer + *idist, integer *iseed, doublecomplex *d, integer *igrade, + doublecomplex *dl, doublecomplex *dr, integer *ipvtng, integer *iwork, + doublereal *sparse) +{ + /* System generated locals */ + integer i__1, i__2; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg( + doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer isub, jsub; + static doublecomplex ctemp; + extern doublereal dlaran_(integer *); + extern /* Double Complex */ VOID zlarnd_(doublecomplex *, integer *, + integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + ZLATM2 returns the (I,J) entry of a random matrix of dimension + (M, N) described by the other paramters. It is called by the + ZLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by ZLATMR which has already checked the parameters. + + Use of ZLATM2 differs from CLATM3 in the order in which the random + + number generator is called to fill in random matrix entries. + With ZLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With ZLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, ZLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. ZLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + + The matrix whose (I,J) entry is returned is constructed as + follows (this routine only computes one entry): + + If I is outside (1..M) or J is outside (1..N), return zero + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of entry to be returned. Not modified. + + J - INTEGER + Column of entry to be returned. Not modified. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => real and imaginary parts each UNIFORM( 0, 1 ) + 2 => real and imaginary parts each UNIFORM( -1, 1 ) + 3 => real and imaginary parts each NORMAL( 0, 1 ) + 4 => complex number uniform in DISK( 0 , 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - COMPLEX*16 array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + 6 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - COMPLEX*16 array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - COMPLEX*16 array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) in position K was originally in + position IWORK( K ). + This differs from IWORK for ZLATM3. Not modified. + + SPARSE - DOUBLE PRECISION between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + ret_val->r = 0., ret_val->i = 0.; + return ; + } + +/* Check for banding */ + + if (*j > *i + *ku || *j < *i - *kl) { + ret_val->r = 0., ret_val->i = 0.; + return ; + } + +/* Check for sparsity */ + + if (*sparse > 0.) { + if (dlaran_(&iseed[1]) < *sparse) { + ret_val->r = 0., ret_val->i = 0.; + return ; + } + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + isub = *i; + jsub = *j; + } else if (*ipvtng == 1) { + isub = iwork[*i]; + jsub = *j; + } else if (*ipvtng == 2) { + isub = *i; + jsub = iwork[*j]; + } else if (*ipvtng == 3) { + isub = iwork[*i]; + jsub = iwork[*j]; + } + +/* Compute entry and grade it according to IGRADE */ + + if (isub == jsub) { + i__1 = isub; + ctemp.r = d[i__1].r, ctemp.i = d[i__1].i; + } else { + zlarnd_(&z__1, idist, &iseed[1]); + ctemp.r = z__1.r, ctemp.i = z__1.i; + } + if (*igrade == 1) { + i__1 = isub; + z__1.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__1.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 2) { + i__1 = jsub; + z__1.r = ctemp.r * dr[i__1].r - ctemp.i * dr[i__1].i, z__1.i = + ctemp.r * dr[i__1].i + ctemp.i * dr[i__1].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 3) { + i__1 = isub; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = jsub; + z__1.r = z__2.r * dr[i__2].r - z__2.i * dr[i__2].i, z__1.i = z__2.r * + dr[i__2].i + z__2.i * dr[i__2].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 4 && isub != jsub) { + i__1 = isub; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + z_div(&z__1, &z__2, &dl[jsub]); + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 5) { + i__1 = isub; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + d_cnjg(&z__3, &dl[jsub]); + z__1.r = z__2.r * z__3.r - z__2.i * z__3.i, z__1.i = z__2.r * z__3.i + + z__2.i * z__3.r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 6) { + i__1 = isub; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = jsub; + z__1.r = z__2.r * dl[i__2].r - z__2.i * dl[i__2].i, z__1.i = z__2.r * + dl[i__2].i + z__2.i * dl[i__2].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* End of ZLATM2 */ + +} /* zlatm2_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm3.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm3.c new file mode 100644 index 0000000..5ed30b7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatm3.c @@ -0,0 +1,297 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Double Complex */ VOID zlatm3_(doublecomplex * ret_val, integer *m, + integer *n, integer *i, integer *j, integer *isub, integer *jsub, + integer *kl, integer *ku, integer *idist, integer *iseed, + doublecomplex *d, integer *igrade, doublecomplex *dl, doublecomplex * + dr, integer *ipvtng, integer *iwork, doublereal *sparse) +{ + /* System generated locals */ + integer i__1, i__2; + doublecomplex z__1, z__2, z__3; + + /* Builtin functions */ + void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg( + doublecomplex *, doublecomplex *); + + /* Local variables */ + static doublecomplex ctemp; + extern doublereal dlaran_(integer *); + extern /* Double Complex */ VOID zlarnd_(doublecomplex *, integer *, + integer *); + + +/* -- LAPACK auxiliary test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + + + + Purpose + ======= + + ZLATM3 returns the (ISUB,JSUB) entry of a random matrix of + dimension (M, N) described by the other paramters. (ISUB,JSUB) + is the final position of the (I,J) entry after pivoting + according to IPVTNG and IWORK. ZLATM3 is called by the + ZLATMR routine in order to build random test matrices. No error + checking on parameters is done, because this routine is called in + + a tight loop by ZLATMR which has already checked the parameters. + + Use of ZLATM3 differs from CLATM2 in the order in which the random + + number generator is called to fill in random matrix entries. + With ZLATM2, the generator is called to fill in the pivoted matrix + + columnwise. With ZLATM3, the generator is called to fill in the + matrix columnwise, after which it is pivoted. Thus, ZLATM3 can + be used to construct random matrices which differ only in their + order of rows and/or columns. ZLATM2 is used to construct band + matrices while avoiding calling the random number generator for + entries outside the band (and therefore generating random numbers + + in different orders for different pivot orders). + + The matrix whose (ISUB,JSUB) entry is returned is constructed as + follows (this routine only computes one entry): + + If ISUB is outside (1..M) or JSUB is outside (1..N), return zero + + (this is convenient for generating matrices in band format). + + + Generate a matrix A with random entries of distribution IDIST. + + Set the diagonal to D. + + Grade the matrix, if desired, from the left (by DL) and/or + from the right (by DR or DL) as specified by IGRADE. + + Permute, if desired, the rows and/or columns as specified by + IPVTNG and IWORK. + + Band the matrix to have lower bandwidth KL and upper + bandwidth KU. + + Set random entries to zero as specified by SPARSE. + + Arguments + ========= + + M - INTEGER + Number of rows of matrix. Not modified. + + N - INTEGER + Number of columns of matrix. Not modified. + + I - INTEGER + Row of unpivoted entry to be returned. Not modified. + + J - INTEGER + Column of unpivoted entry to be returned. Not modified. + + ISUB - INTEGER + Row of pivoted entry to be returned. Changed on exit. + + JSUB - INTEGER + Column of pivoted entry to be returned. Changed on exit. + + KL - INTEGER + Lower bandwidth. Not modified. + + KU - INTEGER + Upper bandwidth. Not modified. + + IDIST - INTEGER + On entry, IDIST specifies the type of distribution to be + used to generate a random matrix . + 1 => real and imaginary parts each UNIFORM( 0, 1 ) + 2 => real and imaginary parts each UNIFORM( -1, 1 ) + 3 => real and imaginary parts each NORMAL( 0, 1 ) + 4 => complex number uniform in DISK( 0 , 1 ) + Not modified. + + ISEED - INTEGER array of dimension ( 4 ) + Seed for random number generator. + Changed on exit. + + D - COMPLEX*16 array of dimension ( MIN( I , J ) ) + Diagonal entries of matrix. Not modified. + + IGRADE - INTEGER + Specifies grading of matrix as follows: + 0 => no grading + 1 => matrix premultiplied by diag( DL ) + 2 => matrix postmultiplied by diag( DR ) + 3 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + 4 => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + 5 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + 6 => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + Not modified. + + DL - COMPLEX*16 array ( I or J, as appropriate ) + Left scale factors for grading matrix. Not modified. + + DR - COMPLEX*16 array ( I or J, as appropriate ) + Right scale factors for grading matrix. Not modified. + + IPVTNG - INTEGER + On entry specifies pivoting permutations as follows: + 0 => none. + 1 => row pivoting. + 2 => column pivoting. + 3 => full pivoting, i.e., on both sides. + Not modified. + + IWORK - INTEGER array ( I or J, as appropriate ) + This array specifies the permutation used. The + row (or column) originally in position K is in + position IWORK( K ) after pivoting. + This differs from IWORK for ZLATM2. Not modified. + + SPARSE - DOUBLE PRECISION between 0. and 1. + On entry specifies the sparsity of the matrix + if sparse matix is to be generated. + SPARSE should lie between 0 and 1. + A uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + ===================================================================== + + + + + + + + + + + ----------------------------------------------------------------------- + + + + + Check for I and J in range + + Parameter adjustments */ + --iwork; + --dr; + --dl; + --d; + --iseed; + + /* Function Body */ + if (*i < 1 || *i > *m || *j < 1 || *j > *n) { + *isub = *i; + *jsub = *j; + ret_val->r = 0., ret_val->i = 0.; + return ; + } + +/* Compute subscripts depending on IPVTNG */ + + if (*ipvtng == 0) { + *isub = *i; + *jsub = *j; + } else if (*ipvtng == 1) { + *isub = iwork[*i]; + *jsub = *j; + } else if (*ipvtng == 2) { + *isub = *i; + *jsub = iwork[*j]; + } else if (*ipvtng == 3) { + *isub = iwork[*i]; + *jsub = iwork[*j]; + } + +/* Check for banding */ + + if (*jsub > *isub + *ku || *jsub < *isub - *kl) { + ret_val->r = 0., ret_val->i = 0.; + return ; + } + +/* Check for sparsity */ + + if (*sparse > 0.) { + if (dlaran_(&iseed[1]) < *sparse) { + ret_val->r = 0., ret_val->i = 0.; + return ; + } + } + +/* Compute entry and grade it according to IGRADE */ + + if (*i == *j) { + i__1 = *i; + ctemp.r = d[i__1].r, ctemp.i = d[i__1].i; + } else { + zlarnd_(&z__1, idist, &iseed[1]); + ctemp.r = z__1.r, ctemp.i = z__1.i; + } + if (*igrade == 1) { + i__1 = *i; + z__1.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__1.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 2) { + i__1 = *j; + z__1.r = ctemp.r * dr[i__1].r - ctemp.i * dr[i__1].i, z__1.i = + ctemp.r * dr[i__1].i + ctemp.i * dr[i__1].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 3) { + i__1 = *i; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = *j; + z__1.r = z__2.r * dr[i__2].r - z__2.i * dr[i__2].i, z__1.i = z__2.r * + dr[i__2].i + z__2.i * dr[i__2].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 4 && *i != *j) { + i__1 = *i; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + z_div(&z__1, &z__2, &dl[*j]); + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 5) { + i__1 = *i; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + d_cnjg(&z__3, &dl[*j]); + z__1.r = z__2.r * z__3.r - z__2.i * z__3.i, z__1.i = z__2.r * z__3.i + + z__2.i * z__3.r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } else if (*igrade == 6) { + i__1 = *i; + z__2.r = ctemp.r * dl[i__1].r - ctemp.i * dl[i__1].i, z__2.i = + ctemp.r * dl[i__1].i + ctemp.i * dl[i__1].r; + i__2 = *j; + z__1.r = z__2.r * dl[i__2].r - z__2.i * dl[i__2].i, z__1.i = z__2.r * + dl[i__2].i + z__2.i * dl[i__2].r; + ctemp.r = z__1.r, ctemp.i = z__1.i; + } + ret_val->r = ctemp.r, ret_val->i = ctemp.i; + return ; + +/* End of ZLATM3 */ + +} /* zlatm3_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatme.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatme.c new file mode 100644 index 0000000..5cab7ce --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatme.c @@ -0,0 +1,627 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static doublecomplex c_b2 = {1.,0.}; +static integer c__1 = 1; +static integer c__0 = 0; +static integer c__5 = 5; + +/* Subroutine */ int zlatme_(integer *n, char *dist, integer *iseed, + doublecomplex *d, integer *mode, doublereal *cond, doublecomplex * + dmax__, char *ei, char *rsign, char *upper, char *sim, doublereal *ds, + integer *modes, doublereal *conds, integer *kl, integer *ku, + doublereal *anorm, doublecomplex *a, integer *lda, doublecomplex * + work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2; + doublereal d__1, d__2; + doublecomplex z__1, z__2; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static logical bads; + static integer isim; + static doublereal temp; + static integer i, j; + static doublecomplex alpha; + extern logical lsame_(char *, char *); + static integer iinfo; + static doublereal tempa[1]; + static integer icols; + extern /* Subroutine */ int zgerc_(integer *, integer *, doublecomplex *, + doublecomplex *, integer *, doublecomplex *, integer *, + doublecomplex *, integer *); + static integer idist; + extern /* Subroutine */ int zscal_(integer *, doublecomplex *, + doublecomplex *, integer *), zgemv_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, integer *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *, integer *); + static integer irows; + extern /* Subroutine */ int zcopy_(integer *, doublecomplex *, integer *, + doublecomplex *, integer *), dlatm1_(integer *, doublereal *, + integer *, integer *, integer *, doublereal *, integer *, integer + *), zlatm1_(integer *, doublereal *, integer *, integer *, + integer *, doublecomplex *, integer *, integer *); + static integer ic, jc, ir; + static doublereal ralpha; + extern /* Subroutine */ int xerbla_(char *, integer *); + extern doublereal zlange_(char *, integer *, integer *, doublecomplex *, + integer *, doublereal *); + extern /* Subroutine */ int zdscal_(integer *, doublereal *, + doublecomplex *, integer *), zlarge_(integer *, doublecomplex *, + integer *, integer *, doublecomplex *, integer *), zlarfg_( + integer *, doublecomplex *, doublecomplex *, integer *, + doublecomplex *), zlacgv_(integer *, doublecomplex *, integer *); + extern /* Double Complex */ void zlarnd_(doublecomplex *, integer *, + integer *); + static integer irsign; + extern /* Subroutine */ int zlaset_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, doublecomplex *, integer *); + static integer iupper; + extern /* Subroutine */ int zlarnv_(integer *, integer *, integer *, + doublecomplex *); + static doublecomplex xnorms; + static integer jcr; + static doublecomplex tau; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLATME generates random non-symmetric square matrices with + specified eigenvalues for testing LAPACK programs. + + ZLATME operates by applying the following sequence of + operations: + + 1. Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and RSIGN + as described below. + + 2. If UPPER='T', the upper triangle of A is set to random values + out of distribution DIST. + + 3. If SIM='T', A is multiplied on the left by a random matrix + X, whose singular values are specified by DS, MODES, and + CONDS, and on the right by X inverse. + + 4. If KL < N-1, the lower bandwidth is reduced to KL using + Householder transformations. If KU < N-1, the upper + bandwidth is reduced to KU. + + 5. If ANORM is not negative, the matrix is scaled to have + maximum-element-norm ANORM. + + (Note: since the matrix cannot be reduced beyond Hessenberg form, + + no packing options are available.) + + Arguments + ========= + + N - INTEGER + The number of columns (or rows) of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values, and on the + upper triangle (see UPPER). + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + 'D' => uniform on the complex disc |z| < 1. + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to ZLATME + to continue the same random number sequence. + Changed on exit. + + D - COMPLEX*16 array, dimension ( N ) + This array is used to specify the eigenvalues of A. If + MODE=0, then D is assumed to contain the eigenvalues + otherwise they will be computed according to MODE, COND, + DMAX, and RSIGN and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the eigenvalues are to + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is between 1 and 4, D has entries ranging + from 1 to 1/COND, if between -1 and -4, D has entries + ranging from 1/COND to 1, + Not modified. + + COND - DOUBLE PRECISION + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - COMPLEX*16 + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))). Note that DMAX need not be + positive or real: if DMAX is negative or complex (or zero), + + D will be scaled by a negative or complex number (or zero). + + If RSIGN='F' then the largest (absolute) eigenvalue will be + + equal to DMAX. + Not modified. + + EI - CHARACTER*1 (ignored) + Not modified. + + RSIGN - CHARACTER*1 + If MODE is not 0, 6, or -6, and RSIGN='T', then the + elements of D, as computed according to MODE and COND, will + + be multiplied by a random complex number from the unit + circle |z| = 1. If RSIGN='F', they will not be. RSIGN may + + only have the values 'T' or 'F'. + Not modified. + + UPPER - CHARACTER*1 + If UPPER='T', then the elements of A above the diagonal + will be set to random numbers out of DIST. If UPPER='F', + they will not. UPPER may only have the values 'T' or 'F'. + Not modified. + + SIM - CHARACTER*1 + If SIM='T', then A will be operated on by a "similarity + transform", i.e., multiplied on the left by a matrix X and + on the right by X inverse. X = U S V, where U and V are + random unitary matrices and S is a (diagonal) matrix of + singular values specified by DS, MODES, and CONDS. If + SIM='F', then A will not be transformed. + Not modified. + + DS - DOUBLE PRECISION array, dimension ( N ) + This array is used to specify the singular values of X, + in the same way that D specifies the eigenvalues of A. + If MODE=0, the DS contains the singular values, which + may not be zero. + Modified if MODE is nonzero. + + MODES - INTEGER + CONDS - DOUBLE PRECISION + Similar to MODE and COND, but for specifying the diagonal + of S. MODES=-6 and +6 are not allowed (since they would + result in randomly ill-conditioned eigenvalues.) + + KL - INTEGER + This specifies the lower bandwidth of the matrix. KL=1 + specifies upper Hessenberg form. If KL is at least N-1, + then A will have full lower bandwidth. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. KU=1 + specifies lower Hessenberg form. If KU is at least N-1, + then A will have full upper bandwidth; if KU and KL + are both at least N-1, then A will be dense. Only one of + KU and KL may be less than N-1. + Not modified. + + ANORM - DOUBLE PRECISION + If ANORM is not negative, then A will be scaled by a non- + negative real number to make the maximum-element-norm of A + to be ANORM. + Not modified. + + A - COMPLEX*16 array, dimension ( LDA, N ) + On exit A is the desired test matrix. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. LDA must be at least M. + Not modified. + + WORK - COMPLEX*16 array, dimension ( 3*N ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => N negative + -2 => DIST illegal string + -5 => MODE not in range -6 to 6 + -6 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -9 => RSIGN is not 'T' or 'F' + -10 => UPPER is not 'T' or 'F' + -11 => SIM is not 'T' or 'F' + -12 => MODES=0 and DS has a zero singular value. + -13 => MODES is not in the range -5 to 5. + -14 => MODES is nonzero and CONDS is less than 1. + -15 => KL is less than 1. + -16 => KU is less than 1, or KL and KU are both less than + N-1. + -19 => LDA is less than M. + 1 => Error return from ZLATM1 (computing D) + 2 => Cannot scale to DMAX (max. eigenvalue is 0) + 3 => Error return from DLATM1 (computing DS) + 4 => Error return from ZLARGE + 5 => Zero singular value from DLATM1. + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --ds; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else if (lsame_(dist, "D")) { + idist = 4; + } else { + idist = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "T")) { + irsign = 1; + } else if (lsame_(rsign, "F")) { + irsign = 0; + } else { + irsign = -1; + } + +/* Decode UPPER */ + + if (lsame_(upper, "T")) { + iupper = 1; + } else if (lsame_(upper, "F")) { + iupper = 0; + } else { + iupper = -1; + } + +/* Decode SIM */ + + if (lsame_(sim, "T")) { + isim = 1; + } else if (lsame_(sim, "F")) { + isim = 0; + } else { + isim = -1; + } + +/* Check DS, if MODES=0 and ISIM=1 */ + + bads = FALSE_; + if (*modes == 0 && isim == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + if (ds[j] == 0.) { + bads = TRUE_; + } +/* L10: */ + } + } + +/* Set INFO if an error */ + + if (*n < 0) { + *info = -1; + } else if (idist == -1) { + *info = -2; + } else if (abs(*mode) > 6) { + *info = -5; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.) { + *info = -6; + } else if (irsign == -1) { + *info = -9; + } else if (iupper == -1) { + *info = -10; + } else if (isim == -1) { + *info = -11; + } else if (bads) { + *info = -12; + } else if (isim == 1 && abs(*modes) > 5) { + *info = -13; + } else if (isim == 1 && *modes != 0 && *conds < 1.) { + *info = -14; + } else if (*kl < 1) { + *info = -15; + } else if (*ku < 1 || *ku < *n - 1 && *kl < *n - 1) { + *info = -16; + } else if (*lda < max(1,*n)) { + *info = -19; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("ZLATME", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L20: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up diagonal of A + + Compute D according to COND and MODE */ + + zlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], n, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = z_abs(&d[1]); + i__1 = *n; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__1 = temp, d__2 = z_abs(&d[i]); + temp = max(d__1,d__2); +/* L30: */ + } + + if (temp > 0.) { + z__1.r = dmax__->r / temp, z__1.i = dmax__->i / temp; + alpha.r = z__1.r, alpha.i = z__1.i; + } else { + *info = 2; + return 0; + } + + zscal_(n, &alpha, &d[1], &c__1); + + } + + zlaset_("Full", n, n, &c_b1, &c_b1, &a[a_offset], lda); + i__1 = *lda + 1; + zcopy_(n, &d[1], &c__1, &a[a_offset], &i__1); + +/* 3) If UPPER='T', set upper triangle of A to random numbers. */ + + if (iupper != 0) { + i__1 = *n; + for (jc = 2; jc <= i__1; ++jc) { + i__2 = jc - 1; + zlarnv_(&idist, &iseed[1], &i__2, &a[jc * a_dim1 + 1]); +/* L40: */ + } + } + +/* 4) If SIM='T', apply similarity transformation. + + -1 + Transform is X A X , where X = U S V, thus + + it is U S V A V' (1/S) U' */ + + if (isim != 0) { + +/* Compute S (singular values of the eigenvector matrix) + according to CONDS and MODES */ + + dlatm1_(modes, conds, &c__0, &c__0, &iseed[1], &ds[1], n, &iinfo); + if (iinfo != 0) { + *info = 3; + return 0; + } + +/* Multiply by V and V' */ + + zlarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + +/* Multiply by S and (1/S) */ + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + zdscal_(n, &ds[j], &a[j + a_dim1], lda); + if (ds[j] != 0.) { + d__1 = 1. / ds[j]; + zdscal_(n, &d__1, &a[j * a_dim1 + 1], &c__1); + } else { + *info = 5; + return 0; + } +/* L50: */ + } + +/* Multiply by U and U' */ + + zlarge_(n, &a[a_offset], lda, &iseed[1], &work[1], &iinfo); + if (iinfo != 0) { + *info = 4; + return 0; + } + } + +/* 5) Reduce the bandwidth. */ + + if (*kl < *n - 1) { + +/* Reduce bandwidth -- kill column */ + + i__1 = *n - 1; + for (jcr = *kl + 1; jcr <= i__1; ++jcr) { + ic = jcr - *kl; + irows = *n + 1 - jcr; + icols = *n + *kl - jcr; + + zcopy_(&irows, &a[jcr + ic * a_dim1], &c__1, &work[1], &c__1); + xnorms.r = work[1].r, xnorms.i = work[1].i; + zlarfg_(&irows, &xnorms, &work[2], &c__1, &tau); + d_cnjg(&z__1, &tau); + tau.r = z__1.r, tau.i = z__1.i; + work[1].r = 1., work[1].i = 0.; + zlarnd_(&z__1, &c__5, &iseed[1]); + alpha.r = z__1.r, alpha.i = z__1.i; + + zgemv_("C", &irows, &icols, &c_b2, &a[jcr + (ic + 1) * a_dim1], + lda, &work[1], &c__1, &c_b1, &work[irows + 1], &c__1); + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&irows, &icols, &z__1, &work[1], &c__1, &work[irows + 1], & + c__1, &a[jcr + (ic + 1) * a_dim1], lda); + + zgemv_("N", n, &irows, &c_b2, &a[jcr * a_dim1 + 1], lda, &work[1], + &c__1, &c_b1, &work[irows + 1], &c__1); + d_cnjg(&z__2, &tau); + z__1.r = -z__2.r, z__1.i = -z__2.i; + zgerc_(n, &irows, &z__1, &work[irows + 1], &c__1, &work[1], &c__1, + &a[jcr * a_dim1 + 1], lda); + + i__2 = jcr + ic * a_dim1; + a[i__2].r = xnorms.r, a[i__2].i = xnorms.i; + i__2 = irows - 1; + zlaset_("Full", &i__2, &c__1, &c_b1, &c_b1, &a[jcr + 1 + ic * + a_dim1], lda); + + i__2 = icols + 1; + zscal_(&i__2, &alpha, &a[jcr + ic * a_dim1], lda); + d_cnjg(&z__1, &alpha); + zscal_(n, &z__1, &a[jcr * a_dim1 + 1], &c__1); +/* L60: */ + } + } else if (*ku < *n - 1) { + +/* Reduce upper bandwidth -- kill a row at a time. */ + + i__1 = *n - 1; + for (jcr = *ku + 1; jcr <= i__1; ++jcr) { + ir = jcr - *ku; + irows = *n + *ku - jcr; + icols = *n + 1 - jcr; + + zcopy_(&icols, &a[ir + jcr * a_dim1], lda, &work[1], &c__1); + xnorms.r = work[1].r, xnorms.i = work[1].i; + zlarfg_(&icols, &xnorms, &work[2], &c__1, &tau); + d_cnjg(&z__1, &tau); + tau.r = z__1.r, tau.i = z__1.i; + work[1].r = 1., work[1].i = 0.; + i__2 = icols - 1; + zlacgv_(&i__2, &work[2], &c__1); + zlarnd_(&z__1, &c__5, &iseed[1]); + alpha.r = z__1.r, alpha.i = z__1.i; + + zgemv_("N", &irows, &icols, &c_b2, &a[ir + 1 + jcr * a_dim1], lda, + &work[1], &c__1, &c_b1, &work[icols + 1], &c__1); + z__1.r = -tau.r, z__1.i = -tau.i; + zgerc_(&irows, &icols, &z__1, &work[icols + 1], &c__1, &work[1], & + c__1, &a[ir + 1 + jcr * a_dim1], lda); + + zgemv_("C", &icols, n, &c_b2, &a[jcr + a_dim1], lda, &work[1], & + c__1, &c_b1, &work[icols + 1], &c__1); + d_cnjg(&z__2, &tau); + z__1.r = -z__2.r, z__1.i = -z__2.i; + zgerc_(&icols, n, &z__1, &work[1], &c__1, &work[icols + 1], &c__1, + &a[jcr + a_dim1], lda); + + i__2 = ir + jcr * a_dim1; + a[i__2].r = xnorms.r, a[i__2].i = xnorms.i; + i__2 = icols - 1; + zlaset_("Full", &c__1, &i__2, &c_b1, &c_b1, &a[ir + (jcr + 1) * + a_dim1], lda); + + i__2 = irows + 1; + zscal_(&i__2, &alpha, &a[ir + jcr * a_dim1], &c__1); + d_cnjg(&z__1, &alpha); + zscal_(n, &z__1, &a[jcr + a_dim1], lda); +/* L70: */ + } + } + +/* Scale the matrix to have norm ANORM */ + + if (*anorm >= 0.) { + temp = zlange_("M", n, n, &a[a_offset], lda, tempa); + if (temp > 0.) { + ralpha = *anorm / temp; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + zdscal_(n, &ralpha, &a[j * a_dim1 + 1], &c__1); +/* L80: */ + } + } + } + + return 0; + +/* End of ZLATME */ + +} /* zlatme_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatmr.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatmr.c new file mode 100644 index 0000000..88a0be1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatmr.c @@ -0,0 +1,1510 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__0 = 0; +static integer c__1 = 1; + +/* Subroutine */ int zlatmr_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, doublecomplex *d, integer *mode, doublereal *cond, + doublecomplex *dmax__, char *rsign, char *grade, doublecomplex *dl, + integer *model, doublereal *condl, doublecomplex *dr, integer *moder, + doublereal *condr, char *pivtng, integer *ipivot, integer *kl, + integer *ku, doublereal *sparse, doublereal *anorm, char *pack, + doublecomplex *a, integer *lda, integer *iwork, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4; + doublereal d__1, d__2; + doublecomplex z__1, z__2; + + /* Builtin functions */ + double z_abs(doublecomplex *); + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer isub, jsub; + static doublereal temp; + static integer isym, i, j, k, ipack; + extern logical lsame_(char *, char *); + static doublereal tempa[1]; + static doublecomplex ctemp; + static integer iisub, idist, jjsub, mnmin; + static logical dzero; + static integer mnsub; + static doublereal onorm; + static integer mxsub, npvts; + extern /* Subroutine */ int zlatm1_(integer *, doublereal *, integer *, + integer *, integer *, doublecomplex *, integer *, integer *); + extern /* Double Complex */ VOID zlatm2_(doublecomplex *, integer *, + integer *, integer *, integer *, integer *, integer *, integer *, + integer *, doublecomplex *, integer *, doublecomplex *, + doublecomplex *, integer *, integer *, doublereal *), zlatm3_( + doublecomplex *, integer *, integer *, integer *, integer *, + integer *, integer *, integer *, integer *, integer *, integer *, + doublecomplex *, integer *, doublecomplex *, doublecomplex *, + integer *, integer *, doublereal *); + static doublecomplex calpha; + static integer igrade; + static logical fulbnd; + extern doublereal zlangb_(char *, integer *, integer *, integer *, + doublecomplex *, integer *, doublereal *); + extern /* Subroutine */ int xerbla_(char *, integer *); + static logical badpvt; + extern doublereal zlange_(char *, integer *, integer *, doublecomplex *, + integer *, doublereal *); + extern /* Subroutine */ int zdscal_(integer *, doublereal *, + doublecomplex *, integer *); + extern doublereal zlansb_(char *, char *, integer *, integer *, + doublecomplex *, integer *, doublereal *); + static integer irsign, ipvtng; + extern doublereal zlansp_(char *, char *, integer *, doublecomplex *, + doublereal *), zlansy_(char *, char *, integer *, + doublecomplex *, integer *, doublereal *); + static integer kll, kuu; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + February 29, 1992 + + + Purpose + ======= + + ZLATMR generates random matrices of various types for testing + LAPACK programs. + + ZLATMR operates by applying the following sequence of + operations: + + Generate a matrix A with random entries of distribution DIST + which is symmetric if SYM='S', Hermitian if SYM='H', and + nonsymmetric if SYM='N'. + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX and RSIGN + as described below. + + Grade the matrix, if desired, from the left and/or right + as specified by GRADE. The inputs DL, MODEL, CONDL, DR, + MODER and CONDR also determine the grading as described + below. + + Permute, if desired, the rows and/or columns as specified by + PIVTNG and IPIVOT. + + Set random entries to zero, if desired, to get a random sparse + matrix as specified by SPARSE. + + Make A a band matrix, if desired, by zeroing out the matrix + outside a band of lower bandwidth KL and upper bandwidth KU. + + + Scale A, if desired, to have maximum entry ANORM. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if symmetric or Hermitian) + zero out lower half (if symmetric or Hermitian) + store the upper half columnwise (if symmetric or Hermitian + or square upper triangular) + store the lower half columnwise (if symmetric or Hermitian + or square lower triangular) + same as upper half rowwise if symmetric + same as conjugate upper half rowwise if Hermitian + store the lower triangle in banded format + (if symmetric or Hermitian) + store the upper triangle in banded format + (if symmetric or Hermitian) + store the entire matrix in banded format + + Note: If two calls to ZLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + + If two calls to ZLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be and + is not maintained with less than full bandwidth. + + Arguments + ========= + + M - INTEGER + Number of rows of A. Not modified. + + N - INTEGER + Number of columns of A. Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate a random matrix . + 'U' => real and imaginary parts are independent + UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => real and imaginary parts are independent + UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => real and imaginary parts are independent + NORMAL( 0, 1 ) ( 'N' for normal ) + 'D' => uniform on interior of unit disk ( 'D' for disk ) + Not modified. + + ISEED - INTEGER array, dimension (4) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to ZLATMR + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='S', generated matrix is symmetric. + If SYM='H', generated matrix is Hermitian. + If SYM='N', generated matrix is nonsymmetric. + Not modified. + + D - COMPLEX*16 array, dimension (min(M,N)) + On entry this array specifies the diagonal entries + of the diagonal of A. D may either be specified + on entry, or set according to MODE and COND as described + below. If the matrix is Hermitian, the real part of D + will be taken. May be changed on exit if MODE is nonzero. + + MODE - INTEGER + On entry describes how D is to be used: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + Not modified. + + COND - DOUBLE PRECISION + On entry, used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - COMPLEX*16 + If MODE neither -6, 0 nor 6, the diagonal is scaled by + DMAX / max(abs(D(i))), so that maximum absolute entry + of diagonal is abs(DMAX). If DMAX is complex (or zero), + diagonal will be scaled by a complex number (or zero). + + RSIGN - CHARACTER*1 + If MODE neither -6, 0 nor 6, specifies sign of diagonal + as follows: + 'T' => diagonal entries are multiplied by a random complex + number uniformly distributed with absolute value 1 + 'F' => diagonal unchanged + Not modified. + + GRADE - CHARACTER*1 + Specifies grading of matrix as follows: + 'N' => no grading + 'L' => matrix premultiplied by diag( DL ) + (only if matrix nonsymmetric) + 'R' => matrix postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'B' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DR ) + (only if matrix nonsymmetric) + 'H' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( CONJG(DL) ) + (only if matrix Hermitian or nonsymmetric) + 'S' => matrix premultiplied by diag( DL ) and + postmultiplied by diag( DL ) + (only if matrix symmetric or nonsymmetric) + 'E' => matrix premultiplied by diag( DL ) and + postmultiplied by inv( diag( DL ) ) + ( 'S' for similarity ) + (only if matrix nonsymmetric) + Note: if GRADE='S', then M must equal N. + Not modified. + + DL - COMPLEX*16 array, dimension (M) + If MODEL=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODEL is not zero, then DL will be set according + to MODEL and CONDL, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DL). + + If GRADE='E', then DL cannot have zero entries. + Not referenced if GRADE = 'N' or 'R'. Changed on exit. + + MODEL - INTEGER + This specifies how the diagonal array DL is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDL - DOUBLE PRECISION + When MODEL is not zero, this specifies the condition number + + of the computed DL. Not modified. + + DR - COMPLEX*16 array, dimension (N) + If MODER=0, then on entry this array specifies the diagonal + + entries of a diagonal matrix used as described under GRADE + above. If MODER is not zero, then DR will be set according + to MODER and CONDR, analogous to the way D is set according + + to MODE and COND (except there is no DMAX parameter for DR). + + Not referenced if GRADE = 'N', 'L', 'H' or 'S'. + Changed on exit. + + MODER - INTEGER + This specifies how the diagonal array DR is to be computed, + + just as MODE specifies how D is to be computed. + Not modified. + + CONDR - DOUBLE PRECISION + When MODER is not zero, this specifies the condition number + + of the computed DR. Not modified. + + PIVTNG - CHARACTER*1 + On entry specifies pivoting permutations as follows: + 'N' or ' ' => none. + 'L' => left or row pivoting (matrix must be nonsymmetric). + 'R' => right or column pivoting (matrix must be + nonsymmetric). + 'B' or 'F' => both or full pivoting, i.e., on both sides. + In this case, M must equal N + + If two calls to ZLATMR both have full bandwidth (KL = M-1 + and KU = N-1), and differ only in the PIVTNG and PACK + parameters, then the matrices generated will differ only + in the order of the rows and/or columns, and otherwise + contain the same data. This consistency cannot be + maintained with less than full bandwidth. + + IPIVOT - INTEGER array, dimension (N or M) + This array specifies the permutation used. After the + basic matrix is generated, the rows, columns, or both + are permuted. If, say, row pivoting is selected, ZLATMR + starts with the *last* row and interchanges the M-th and + IPIVOT(M)-th rows, then moves to the next-to-last row, + interchanging the (M-1)-th and the IPIVOT(M-1)-th rows, + and so on. In terms of "2-cycles", the permutation is + (1 IPIVOT(1)) (2 IPIVOT(2)) ... (M IPIVOT(M)) + where the rightmost cycle is applied first. This is the + *inverse* of the effect of pivoting in LINPACK. The idea + is that factoring (with pivoting) an identity matrix + which has been inverse-pivoted in this way should + result in a pivot vector identical to IPIVOT. + Not referenced if PIVTNG = 'N'. Not modified. + + SPARSE - DOUBLE PRECISION + On entry specifies the sparsity of the matrix if a sparse + matrix is to be generated. SPARSE should lie between + 0 and 1. To generate a sparse matrix, for each matrix entry + + a uniform ( 0, 1 ) random number x is generated and + compared to SPARSE; if x is larger the matrix entry + is unchanged and if x is smaller the entry is set + to zero. Thus on the average a fraction SPARSE of the + entries will be set to zero. + Not modified. + + KL - INTEGER + On entry specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL at least M-1 implies the matrix is not + banded. Must equal KU if matrix is symmetric or Hermitian. + Not modified. + + KU - INTEGER + On entry specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU at least N-1 implies the matrix is not + banded. Must equal KL if matrix is symmetric or Hermitian. + Not modified. + + ANORM - DOUBLE PRECISION + On entry specifies maximum entry of output matrix + (output matrix will by multiplied by a constant so that + its largest absolute entry equal ANORM) + if ANORM is nonnegative. If ANORM is negative no scaling + is done. Not modified. + + PACK - CHARACTER*1 + On entry specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries + (if symmetric or Hermitian) + 'L' => zero out all superdiagonal entries + (if symmetric or Hermitian) + 'C' => store the upper triangle columnwise + (only if matrix symmetric or Hermitian or + square upper triangular) + 'R' => store the lower triangle columnwise + (only if matrix symmetric or Hermitian or + square lower triangular) + (same as upper half rowwise if symmetric) + (same as conjugate upper half rowwise if Hermitian) + 'B' => store the lower triangle in band storage scheme + (only if matrix symmetric or Hermitian) + 'Q' => store the upper triangle in band storage scheme + (only if matrix symmetric or Hermitian) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, HB or TB - use 'B' or 'Q' + PP, HP or TP - use 'C' or 'R' + + If two calls to ZLATMR differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - COMPLEX*16 array, dimension (LDA,N) + On exit A is the desired test matrix. Only those + entries of A which are significant on output + will be referenced (even if A is in packed or band + storage format). The 'unoccupied corners' of A in + band format will be zeroed out. + + LDA - INTEGER + on entry LDA specifies the first dimension of A as + declared in the calling program. + If PACK='N', 'U' or 'L', LDA must be at least max ( 1, M ). + + If PACK='C' or 'R', LDA must be at least 1. + If PACK='B', or 'Q', LDA must be MIN ( KU+1, N ) + If PACK='Z', LDA must be at least KUU+KLL+1, where + KUU = MIN ( KU, N-1 ) and KLL = MIN ( KL, N-1 ) + Not modified. + + IWORK - INTEGER array, dimension (N or M) + Workspace. Not referenced if PIVTNG = 'N'. Changed on exit. + + + INFO - INTEGER + Error parameter on exit: + 0 => normal return + -1 => M negative or unequal to N and SYM='S' or 'H' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => MODE neither -6, 0 nor 6 and RSIGN illegal string + -11 => GRADE illegal string, or GRADE='E' and + M not equal to N, or GRADE='L', 'R', 'B', 'S' or 'E' + + and SYM = 'H', or GRADE='L', 'R', 'B', 'H' or 'E' + and SYM = 'S' + -12 => GRADE = 'E' and DL contains zero + -13 => MODEL not in range -6 to 6 and GRADE= 'L', 'B', 'H', + + 'S' or 'E' + -14 => CONDL less than 1.0, GRADE='L', 'B', 'H', 'S' or 'E', + + and MODEL neither -6, 0 nor 6 + -16 => MODER not in range -6 to 6 and GRADE= 'R' or 'B' + -17 => CONDR less than 1.0, GRADE='R' or 'B', and + MODER neither -6, 0 nor 6 + -18 => PIVTNG illegal string, or PIVTNG='B' or 'F' and + M not equal to N, or PIVTNG='L' or 'R' and SYM='S' + or 'H' + -19 => IPIVOT contains out of range number and + PIVTNG not equal to 'N' + -20 => KL negative + -21 => KU negative, or SYM='S' or 'H' and KU not equal to KL + + -22 => SPARSE not in range 0. to 1. + -24 => PACK illegal string, or PACK='U', 'L', 'B' or 'Q' + and SYM='N', or PACK='C' and SYM='N' and either KL + not equal to 0 or N not equal to M, or PACK='R' and + SYM='N', and either KU not equal to 0 or N not equal + + to M + -26 => LDA too small + 1 => Error return from ZLATM1 (computing D) + 2 => Cannot scale diagonal to DMAX (max. entry is 0) + 3 => Error return from ZLATM1 (computing DL) + 4 => Error return from ZLATM1 (computing DR) + 5 => ANORM is positive, but matrix constructed prior to + attempting to scale it to have norm ANORM, is zero + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + --dl; + --dr; + --ipivot; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --iwork; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else if (lsame_(dist, "D")) { + idist = 4; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "H")) { + isym = 0; + } else if (lsame_(sym, "N")) { + isym = 1; + } else if (lsame_(sym, "S")) { + isym = 2; + } else { + isym = -1; + } + +/* Decode RSIGN */ + + if (lsame_(rsign, "F")) { + irsign = 0; + } else if (lsame_(rsign, "T")) { + irsign = 1; + } else { + irsign = -1; + } + +/* Decode PIVTNG */ + + if (lsame_(pivtng, "N")) { + ipvtng = 0; + } else if (lsame_(pivtng, " ")) { + ipvtng = 0; + } else if (lsame_(pivtng, "L")) { + ipvtng = 1; + npvts = *m; + } else if (lsame_(pivtng, "R")) { + ipvtng = 2; + npvts = *n; + } else if (lsame_(pivtng, "B")) { + ipvtng = 3; + npvts = min(*n,*m); + } else if (lsame_(pivtng, "F")) { + ipvtng = 3; + npvts = min(*n,*m); + } else { + ipvtng = -1; + } + +/* Decode GRADE */ + + if (lsame_(grade, "N")) { + igrade = 0; + } else if (lsame_(grade, "L")) { + igrade = 1; + } else if (lsame_(grade, "R")) { + igrade = 2; + } else if (lsame_(grade, "B")) { + igrade = 3; + } else if (lsame_(grade, "E")) { + igrade = 4; + } else if (lsame_(grade, "H")) { + igrade = 5; + } else if (lsame_(grade, "S")) { + igrade = 6; + } else { + igrade = -1; + } + +/* Decode PACK */ + + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + } else if (lsame_(pack, "C")) { + ipack = 3; + } else if (lsame_(pack, "R")) { + ipack = 4; + } else if (lsame_(pack, "B")) { + ipack = 5; + } else if (lsame_(pack, "Q")) { + ipack = 6; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + kll = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + kuu = min(i__1,i__2); + +/* If inv(DL) is used, check to see if DL has a zero entry. */ + + dzero = FALSE_; + if (igrade == 4 && *model == 0) { + i__1 = *m; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + if (dl[i__2].r == 0. && dl[i__2].i == 0.) { + dzero = TRUE_; + } +/* L10: */ + } + } + +/* Check values in IPIVOT */ + + badpvt = FALSE_; + if (ipvtng > 0) { + i__1 = npvts; + for (j = 1; j <= i__1; ++j) { + if (ipivot[j] <= 0 || ipivot[j] > npvts) { + badpvt = TRUE_; + } +/* L20: */ + } + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && (isym == 0 || isym == 2)) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (*mode < -6 || *mode > 6) { + *info = -7; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && *cond < 1.) { + *info = -8; + } else if (*mode != -6 && *mode != 0 && *mode != 6 && irsign == -1) { + *info = -10; + } else if (igrade == -1 || igrade == 4 && *m != *n || (igrade == 1 || + igrade == 2 || igrade == 3 || igrade == 4 || igrade == 6) && isym + == 0 || (igrade == 1 || igrade == 2 || igrade == 3 || igrade == 4 + || igrade == 5) && isym == 2) { + *info = -11; + } else if (igrade == 4 && dzero) { + *info = -12; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || + igrade == 6) && (*model < -6 || *model > 6)) { + *info = -13; + } else if ((igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || + igrade == 6) && (*model != -6 && *model != 0 && *model != 6) && * + condl < 1.) { + *info = -14; + } else if ((igrade == 2 || igrade == 3) && (*moder < -6 || *moder > 6)) { + *info = -16; + } else if ((igrade == 2 || igrade == 3) && (*moder != -6 && *moder != 0 && + *moder != 6) && *condr < 1.) { + *info = -17; + } else if (ipvtng == -1 || ipvtng == 3 && *m != *n || (ipvtng == 1 || + ipvtng == 2) && (isym == 0 || isym == 2)) { + *info = -18; + } else if (ipvtng != 0 && badpvt) { + *info = -19; + } else if (*kl < 0) { + *info = -20; + } else if (*ku < 0 || (isym == 0 || isym == 2) && *kl != *ku) { + *info = -21; + } else if (*sparse < 0. || *sparse > 1.) { + *info = -22; + } else if (ipack == -1 || (ipack == 1 || ipack == 2 || ipack == 5 || + ipack == 6) && isym == 1 || ipack == 3 && isym == 1 && (*kl != 0 + || *m != *n) || ipack == 4 && isym == 1 && (*ku != 0 || *m != *n)) + { + *info = -24; + } else if ((ipack == 0 || ipack == 1 || ipack == 2) && *lda < max(1,*m) || + (ipack == 3 || ipack == 4) && *lda < 1 || (ipack == 5 || ipack == + 6) && *lda < kuu + 1 || ipack == 7 && *lda < kll + kuu + 1) { + *info = -26; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("ZLATMR", &i__1); + return 0; + } + +/* Decide if we can pivot consistently */ + + fulbnd = FALSE_; + if (kuu == *n - 1 && kll == *m - 1) { + fulbnd = TRUE_; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L30: */ + } + + iseed[4] = (iseed[4] / 2 << 1) + 1; + +/* 2) Set up D, DL, and DR, if indicated. + + Compute D according to COND and MODE */ + + zlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, info); + if (*info != 0) { + *info = 1; + return 0; + } + if (*mode != 0 && *mode != -6 && *mode != 6) { + +/* Scale by DMAX */ + + temp = z_abs(&d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__1 = temp, d__2 = z_abs(&d[i]); + temp = max(d__1,d__2); +/* L40: */ + } + if (temp == 0. && (dmax__->r != 0. || dmax__->i != 0.)) { + *info = 2; + return 0; + } + if (temp != 0.) { + z__1.r = dmax__->r / temp, z__1.i = dmax__->i / temp; + calpha.r = z__1.r, calpha.i = z__1.i; + } else { + calpha.r = 1., calpha.i = 0.; + } + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + i__3 = i; + z__1.r = calpha.r * d[i__3].r - calpha.i * d[i__3].i, z__1.i = + calpha.r * d[i__3].i + calpha.i * d[i__3].r; + d[i__2].r = z__1.r, d[i__2].i = z__1.i; +/* L50: */ + } + + } + +/* If matrix Hermitian, make D real */ + + if (isym == 0) { + i__1 = mnmin; + for (i = 1; i <= i__1; ++i) { + i__2 = i; + i__3 = i; + d__1 = d[i__3].r; + d[i__2].r = d__1, d[i__2].i = 0.; +/* L60: */ + } + } + +/* Compute DL if grading set */ + + if (igrade == 1 || igrade == 3 || igrade == 4 || igrade == 5 || igrade == + 6) { + zlatm1_(model, condl, &c__0, &idist, &iseed[1], &dl[1], m, info); + if (*info != 0) { + *info = 3; + return 0; + } + } + +/* Compute DR if grading set */ + + if (igrade == 2 || igrade == 3) { + zlatm1_(moder, condr, &c__0, &idist, &iseed[1], &dr[1], n, info); + if (*info != 0) { + *info = 4; + return 0; + } + } + +/* 3) Generate IWORK if pivoting */ + + if (ipvtng > 0) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + iwork[i] = i; +/* L70: */ + } + if (fulbnd) { + i__1 = npvts; + for (i = 1; i <= i__1; ++i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L80: */ + } + } else { + for (i = npvts; i >= 1; --i) { + k = ipivot[i]; + j = iwork[i]; + iwork[i] = iwork[k]; + iwork[k] = j; +/* L90: */ + } + } + } + +/* 4) Generate matrices for each kind of PACKing + Always sweep matrix columnwise (if symmetric, upper + half only) so that matrix generated does not depend + on PACK */ + + if (fulbnd) { + +/* Use ZLATM3 so matrices generated with differing PIVOTing onl +y + differ only in the order of their rows and/or columns. */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + i__3 = jsub + isub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L100: */ + } +/* L110: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L120: */ + } +/* L130: */ + } + } else if (isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + i__3 = isub + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + i__3 = jsub + isub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L140: */ + } +/* L150: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == isub && isym == 0) { + i__3 = mnsub + mxsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mnsub + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (mnsub != mxsub) { + i__3 = mxsub + mnsub * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } +/* L160: */ + } +/* L170: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == jsub && isym == 0) { + i__3 = mxsub + mnsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mxsub + mnsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (mnsub != mxsub) { + i__3 = mnsub + mxsub * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } +/* L180: */ + } +/* L190: */ + } + + } else if (ipack == 3) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + +/* Compute K = location of (ISUB,JSUB) ent +ry in packed + array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + k = mxsub * (mxsub - 1) / 2 + mnsub; + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + if (mxsub == isub && isym == 0) { + i__3 = iisub + jjsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = iisub + jjsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L200: */ + } +/* L210: */ + } + + } else if (ipack == 4) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + +/* Compute K = location of (I,J) entry in +packed array */ + + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mnsub == 1) { + k = mxsub; + } else { + k = *n * (*n + 1) / 2 - (*n - mnsub + 1) * (*n - + mnsub + 2) / 2 + mxsub - mnsub + 1; + } + +/* Convert K to (IISUB,JJSUB) location */ + + jjsub = (k - 1) / *lda + 1; + iisub = k - *lda * (jjsub - 1); + + if (mxsub == jsub && isym == 0) { + i__3 = iisub + jjsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = iisub + jjsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L220: */ + } +/* L230: */ + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + i__3 = j - i + 1 + (i + *n) * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } else { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == jsub && isym == 0) { + i__3 = mxsub - mnsub + 1 + mnsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mxsub - mnsub + 1 + mnsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + } +/* L240: */ + } +/* L250: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, &idist, + &iseed[1], &d[1], &igrade, &dl[1], &dr[1], & + ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (mxsub == isub && isym == 0) { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } +/* L260: */ + } +/* L270: */ + } + + } else if (ipack == 7) { + + if (isym != 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + mnsub = min(isub,jsub); + mxsub = max(isub,jsub); + if (i < 1) { + i__3 = j - i + 1 + kuu + (i + *n) * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } + if (mxsub == isub && isym == 0) { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mnsub - mxsub + kuu + 1 + mxsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + if (i >= 1 && mnsub != mxsub) { + if (mnsub == isub && isym == 0) { + i__3 = mxsub - mnsub + 1 + kuu + mnsub * + a_dim1; + d_cnjg(&z__1, &ctemp); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = mxsub - mnsub + 1 + kuu + mnsub * + a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; + } + } +/* L280: */ + } +/* L290: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + zlatm3_(&z__1, m, n, &i, &j, &isub, &jsub, kl, ku, & + idist, &iseed[1], &d[1], &igrade, &dl[1], &dr[ + 1], &ipvtng, &iwork[1], sparse); + ctemp.r = z__1.r, ctemp.i = z__1.i; + i__3 = isub - jsub + kuu + 1 + jsub * a_dim1; + a[i__3].r = ctemp.r, a[i__3].i = ctemp.i; +/* L300: */ + } +/* L310: */ + } + } + + } + + } else { + +/* Use ZLATM2 */ + + if (ipack == 0) { + if (isym == 0) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + i__3 = j + i * a_dim1; + d_cnjg(&z__1, &a[i + j * a_dim1]); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L320: */ + } +/* L330: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L340: */ + } +/* L350: */ + } + } else if (isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + i__3 = j + i * a_dim1; + i__4 = i + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; +/* L360: */ + } +/* L370: */ + } + } + + } else if (ipack == 1) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + i__3 = i + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + if (i != j) { + i__3 = j + i * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } +/* L380: */ + } +/* L390: */ + } + + } else if (ipack == 2) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + if (isym == 0) { + i__3 = j + i * a_dim1; + zlatm2_(&z__2, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + d_cnjg(&z__1, &z__2); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = j + i * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } + if (i != j) { + i__3 = i + j * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } +/* L400: */ + } +/* L410: */ + } + + } else if (ipack == 3) { + + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + i__3 = isub + jsub * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L420: */ + } +/* L430: */ + } + + } else if (ipack == 4) { + + if (isym == 0 || isym == 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + +/* Compute K = location of (I,J) en +try in packed array */ + + if (i == 1) { + k = j; + } else { + k = *n * (*n + 1) / 2 - (*n - i + 1) * (*n - i + + 2) / 2 + j - i + 1; + } + +/* Convert K to (ISUB,JSUB) locatio +n */ + + jsub = (k - 1) / *lda + 1; + isub = k - *lda * (jsub - 1); + + i__3 = isub + jsub * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + if (isym == 0) { + i__3 = isub + jsub * a_dim1; + d_cnjg(&z__1, &a[isub + jsub * a_dim1]); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } +/* L440: */ + } +/* L450: */ + } + } else { + isub = 0; + jsub = 1; + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++isub; + if (isub > *lda) { + isub = 1; + ++jsub; + } + i__3 = isub + jsub * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L460: */ + } +/* L470: */ + } + } + + } else if (ipack == 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + if (i < 1) { + i__3 = j - i + 1 + (i + *n) * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } else { + if (isym == 0) { + i__3 = j - i + 1 + i * a_dim1; + zlatm2_(&z__2, m, n, &i, &j, kl, ku, &idist, & + iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); + d_cnjg(&z__1, &z__2); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = j - i + 1 + i * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, & + iseed[1], &d[1], &igrade, &dl[1], &dr[1], + &ipvtng, &iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } + } +/* L480: */ + } +/* L490: */ + } + + } else if (ipack == 6) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1], & + d[1], &igrade, &dl[1], &dr[1], &ipvtng, &iwork[1], + sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L500: */ + } +/* L510: */ + } + + } else if (ipack == 7) { + + if (isym != 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + if (i < 1) { + i__3 = j - i + 1 + kuu + (i + *n) * a_dim1; + a[i__3].r = 0., a[i__3].i = 0.; + } + if (i >= 1 && i != j) { + if (isym == 0) { + i__3 = j - i + 1 + kuu + i * a_dim1; + d_cnjg(&z__1, &a[i - j + kuu + 1 + j * a_dim1] + ); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; + } else { + i__3 = j - i + 1 + kuu + i * a_dim1; + i__4 = i - j + kuu + 1 + j * a_dim1; + a[i__3].r = a[i__4].r, a[i__3].i = a[i__4].i; + } + } +/* L520: */ + } +/* L530: */ + } + } else if (isym == 1) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = j + kll; + for (i = j - kuu; i <= i__2; ++i) { + i__3 = i - j + kuu + 1 + j * a_dim1; + zlatm2_(&z__1, m, n, &i, &j, kl, ku, &idist, &iseed[1] + , &d[1], &igrade, &dl[1], &dr[1], &ipvtng, & + iwork[1], sparse); + a[i__3].r = z__1.r, a[i__3].i = z__1.i; +/* L540: */ + } +/* L550: */ + } + } + + } + + } + +/* 5) Scaling the norm */ + + if (ipack == 0) { + onorm = zlange_("M", m, n, &a[a_offset], lda, tempa); + } else if (ipack == 1) { + onorm = zlansy_("M", "U", n, &a[a_offset], lda, tempa); + } else if (ipack == 2) { + onorm = zlansy_("M", "L", n, &a[a_offset], lda, tempa); + } else if (ipack == 3) { + onorm = zlansp_("M", "U", n, &a[a_offset], tempa); + } else if (ipack == 4) { + onorm = zlansp_("M", "L", n, &a[a_offset], tempa); + } else if (ipack == 5) { + onorm = zlansb_("M", "L", n, &kll, &a[a_offset], lda, tempa); + } else if (ipack == 6) { + onorm = zlansb_("M", "U", n, &kuu, &a[a_offset], lda, tempa); + } else if (ipack == 7) { + onorm = zlangb_("M", n, &kll, &kuu, &a[a_offset], lda, tempa); + } + + if (*anorm >= 0.) { + + if (*anorm > 0. && onorm == 0.) { + +/* Desired scaling impossible */ + + *info = 5; + return 0; + + } else if (*anorm > 1. && onorm < 1. || *anorm < 1. && onorm > 1.) { + +/* Scale carefully to avoid over / underflow */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + d__1 = 1. / onorm; + zdscal_(m, &d__1, &a[j * a_dim1 + 1], &c__1); + zdscal_(m, anorm, &a[j * a_dim1 + 1], &c__1); +/* L560: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + d__1 = 1. / onorm; + zdscal_(&i__1, &d__1, &a[a_offset], &c__1); + i__1 = *n * (*n + 1) / 2; + zdscal_(&i__1, anorm, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + d__1 = 1. / onorm; + zdscal_(&i__2, &d__1, &a[j * a_dim1 + 1], &c__1); + i__2 = kll + kuu + 1; + zdscal_(&i__2, anorm, &a[j * a_dim1 + 1], &c__1); +/* L570: */ + } + + } + + } else { + +/* Scale straightforwardly */ + + if (ipack <= 2) { + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + d__1 = *anorm / onorm; + zdscal_(m, &d__1, &a[j * a_dim1 + 1], &c__1); +/* L580: */ + } + + } else if (ipack == 3 || ipack == 4) { + + i__1 = *n * (*n + 1) / 2; + d__1 = *anorm / onorm; + zdscal_(&i__1, &d__1, &a[a_offset], &c__1); + + } else if (ipack >= 5) { + + i__1 = *n; + for (j = 1; j <= i__1; ++j) { + i__2 = kll + kuu + 1; + d__1 = *anorm / onorm; + zdscal_(&i__2, &d__1, &a[j * a_dim1 + 1], &c__1); +/* L590: */ + } + } + + } + + } + +/* End of ZLATMR */ + + return 0; +} /* zlatmr_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatms.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatms.c new file mode 100644 index 0000000..9d5cfa9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zlatms.c @@ -0,0 +1,1648 @@ +/* -- translated by f2c (version 19940927). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static doublecomplex c_b1 = {0.,0.}; +static integer c__1 = 1; +static integer c__5 = 5; +static logical c_true = TRUE_; +static logical c_false = FALSE_; + +/* Subroutine */ int zlatms_(integer *m, integer *n, char *dist, integer * + iseed, char *sym, doublereal *d, integer *mode, doublereal *cond, + doublereal *dmax__, integer *kl, integer *ku, char *pack, + doublecomplex *a, integer *lda, doublecomplex *work, integer *info) +{ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6; + doublereal d__1, d__2, d__3; + doublecomplex z__1, z__2, z__3; + logical L__1; + + /* Builtin functions */ + double cos(doublereal), sin(doublereal); + void d_cnjg(doublecomplex *, doublecomplex *); + + /* Local variables */ + static integer ilda, icol; + static doublereal temp; + static integer irow, isym; + static logical zsym; + static doublecomplex c; + static integer i, j, k; + static doublecomplex s; + static doublereal alpha, angle; + static integer ipack; + static doublereal realc; + static integer ioffg; + extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, + integer *); + extern logical lsame_(char *, char *); + static integer iinfo; + static doublecomplex ctemp; + static integer idist, mnmin, iskew; + static doublecomplex extra, dummy; + extern /* Subroutine */ int dlatm1_(integer *, doublereal *, integer *, + integer *, integer *, doublereal *, integer *, integer *); + static integer ic, jc, nc, il; + static doublecomplex ct; + static integer iendch, ir, jr, ipackg, mr, minlda; + extern doublereal dlarnd_(integer *, integer *); + static doublecomplex st; + extern /* Subroutine */ int zlagge_(integer *, integer *, integer *, + integer *, doublereal *, doublecomplex *, integer *, integer *, + doublecomplex *, integer *), zlaghe_(integer *, integer *, + doublereal *, doublecomplex *, integer *, integer *, + doublecomplex *, integer *), xerbla_(char *, integer *); + static logical iltemp, givens; + static integer ioffst, irsign; + extern /* Double Complex */ void zlarnd_(doublecomplex *, integer *, + integer *); + extern /* Subroutine */ int zlaset_(char *, integer *, integer *, + doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlartg_(doublecomplex *, doublecomplex *, doublereal *, + doublecomplex *, doublecomplex *); + static logical ilextr; + extern /* Subroutine */ int zlagsy_(integer *, integer *, doublereal *, + doublecomplex *, integer *, integer *, doublecomplex *, integer *) + ; + static logical topdwn; + static integer ir1, ir2, isympk; + extern /* Subroutine */ int zlarot_(logical *, logical *, logical *, + integer *, doublecomplex *, doublecomplex *, doublecomplex *, + integer *, doublecomplex *, doublecomplex *); + static integer jch, llb, jkl, jku, uub; + + +/* -- LAPACK test routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + September 30, 1994 + + + Purpose + ======= + + ZLATMS generates random matrices with specified singular values + (or hermitian with specified eigenvalues) + for testing LAPACK programs. + + ZLATMS operates by applying the following sequence of + operations: + + Set the diagonal to D, where D may be input or + computed according to MODE, COND, DMAX, and SYM + as described below. + + Generate a matrix with the appropriate band structure, by one + of two methods: + + Method A: + Generate a dense M x N matrix by multiplying D on the left + and the right by random unitary matrices, then: + + Reduce the bandwidth according to KL and KU, using + Householder transformations. + + Method B: + Convert the bandwidth-0 (i.e., diagonal) matrix to a + bandwidth-1 matrix using Givens rotations, "chasing" + out-of-band elements back, much as in QR; then convert + the bandwidth-1 to a bandwidth-2 matrix, etc. Note + that for reasonably small bandwidths (relative to M and + + N) this requires less storage, as a dense matrix is not + + generated. Also, for hermitian or symmetric matrices, + only one triangle is generated. + + Method A is chosen if the bandwidth is a large fraction of the + order of the matrix, and LDA is at least M (so a dense + matrix can be stored.) Method B is chosen if the bandwidth + + is small (< 1/2 N for hermitian or symmetric, < .3 N+M for + non-symmetric), or LDA is less than M and not less than the + + bandwidth. + + Pack the matrix if desired. Options specified by PACK are: + no packing + zero out upper half (if hermitian) + zero out lower half (if hermitian) + store the upper half columnwise (if hermitian or upper + triangular) + store the lower half columnwise (if hermitian or lower + triangular) + store the lower triangle in banded format (if hermitian or + lower triangular) + store the upper triangle in banded format (if hermitian or + upper triangular) + store the entire matrix in banded format + If Method B is chosen, and band format is specified, then the + matrix will be generated in the band format, so no repacking + + will be necessary. + + Arguments + ========= + + M - INTEGER + The number of rows of A. Not modified. + + N - INTEGER + The number of columns of A. N must equal M if the matrix + is symmetric or hermitian (i.e., if SYM is not 'N') + Not modified. + + DIST - CHARACTER*1 + On entry, DIST specifies the type of distribution to be used + + to generate the random eigen-/singular values. + 'U' => UNIFORM( 0, 1 ) ( 'U' for uniform ) + 'S' => UNIFORM( -1, 1 ) ( 'S' for symmetric ) + 'N' => NORMAL( 0, 1 ) ( 'N' for normal ) + Not modified. + + ISEED - INTEGER array, dimension ( 4 ) + On entry ISEED specifies the seed of the random number + generator. They should lie between 0 and 4095 inclusive, + and ISEED(4) should be odd. The random number generator + uses a linear congruential sequence limited to small + integers, and so should produce machine independent + random numbers. The values of ISEED are changed on + exit, and can be used in the next call to ZLATMS + to continue the same random number sequence. + Changed on exit. + + SYM - CHARACTER*1 + If SYM='H', the generated matrix is hermitian, with + eigenvalues specified by D, COND, MODE, and DMAX; they + may be positive, negative, or zero. + If SYM='P', the generated matrix is hermitian, with + eigenvalues (= singular values) specified by D, COND, + MODE, and DMAX; they will not be negative. + If SYM='N', the generated matrix is nonsymmetric, with + singular values specified by D, COND, MODE, and DMAX; + they will not be negative. + If SYM='S', the generated matrix is (complex) symmetric, + with singular values specified by D, COND, MODE, and + DMAX; they will not be negative. + Not modified. + + D - DOUBLE PRECISION array, dimension ( MIN( M, N ) ) + This array is used to specify the singular values or + eigenvalues of A (see SYM, above.) If MODE=0, then D is + assumed to contain the singular/eigenvalues, otherwise + they will be computed according to MODE, COND, and DMAX, + and placed in D. + Modified if MODE is nonzero. + + MODE - INTEGER + On entry this describes how the singular/eigenvalues are to + + be specified: + MODE = 0 means use D as input + MODE = 1 sets D(1)=1 and D(2:N)=1.0/COND + MODE = 2 sets D(1:N-1)=1 and D(N)=1.0/COND + MODE = 3 sets D(I)=COND**(-(I-1)/(N-1)) + MODE = 4 sets D(i)=1 - (i-1)/(N-1)*(1 - 1/COND) + MODE = 5 sets D to random numbers in the range + ( 1/COND , 1 ) such that their logarithms + are uniformly distributed. + MODE = 6 set D to random numbers from same distribution + as the rest of the matrix. + MODE < 0 has the same meaning as ABS(MODE), except that + the order of the elements of D is reversed. + Thus if MODE is positive, D has entries ranging from + 1 to 1/COND, if negative, from 1/COND to 1, + If SYM='H', and MODE is neither 0, 6, nor -6, then + the elements of D will also be multiplied by a random + sign (i.e., +1 or -1.) + Not modified. + + COND - DOUBLE PRECISION + On entry, this is used as described under MODE above. + If used, it must be >= 1. Not modified. + + DMAX - DOUBLE PRECISION + If MODE is neither -6, 0 nor 6, the contents of D, as + computed according to MODE and COND, will be scaled by + DMAX / max(abs(D(i))); thus, the maximum absolute eigen- or + + singular value (which is to say the norm) will be abs(DMAX). + + Note that DMAX need not be positive: if DMAX is negative + (or zero), D will be scaled by a negative number (or zero). + + Not modified. + + KL - INTEGER + This specifies the lower bandwidth of the matrix. For + example, KL=0 implies upper triangular, KL=1 implies upper + Hessenberg, and KL being at least M-1 means that the matrix + + has full lower bandwidth. KL must equal KU if the matrix + is symmetric or hermitian. + Not modified. + + KU - INTEGER + This specifies the upper bandwidth of the matrix. For + example, KU=0 implies lower triangular, KU=1 implies lower + Hessenberg, and KU being at least N-1 means that the matrix + + has full upper bandwidth. KL must equal KU if the matrix + is symmetric or hermitian. + Not modified. + + PACK - CHARACTER*1 + This specifies packing of matrix as follows: + 'N' => no packing + 'U' => zero out all subdiagonal entries (if symmetric + or hermitian) + 'L' => zero out all superdiagonal entries (if symmetric + or hermitian) + 'C' => store the upper triangle columnwise (only if the + matrix is symmetric, hermitian, or upper triangular) + + 'R' => store the lower triangle columnwise (only if the + matrix is symmetric, hermitian, or lower triangular) + + 'B' => store the lower triangle in band storage scheme + (only if the matrix is symmetric, hermitian, or + lower triangular) + 'Q' => store the upper triangle in band storage scheme + (only if the matrix is symmetric, hermitian, or + upper triangular) + 'Z' => store the entire matrix in band storage scheme + (pivoting can be provided for by using this + option to store A in the trailing rows of + the allocated storage) + + Using these options, the various LAPACK packed and banded + storage schemes can be obtained: + GB - use 'Z' + PB, SB, HB, or TB - use 'B' or 'Q' + PP, SP, HB, or TP - use 'C' or 'R' + + If two calls to ZLATMS differ only in the PACK parameter, + they will generate mathematically equivalent matrices. + Not modified. + + A - COMPLEX*16 array, dimension ( LDA, N ) + On exit A is the desired test matrix. A is first generated + + in full (unpacked) form, and then packed, if so specified + by PACK. Thus, the first M elements of the first N + columns will always be modified. If PACK specifies a + packed or banded storage scheme, all LDA elements of the + first N columns will be modified; the elements of the + array which do not correspond to elements of the generated + matrix are set to zero. + Modified. + + LDA - INTEGER + LDA specifies the first dimension of A as declared in the + calling program. If PACK='N', 'U', 'L', 'C', or 'R', then + LDA must be at least M. If PACK='B' or 'Q', then LDA must + be at least MIN( KL, M-1) (which is equal to MIN(KU,N-1)). + If PACK='Z', LDA must be large enough to hold the packed + array: MIN( KU, N-1) + MIN( KL, M-1) + 1. + Not modified. + + WORK - COMPLEX*16 array, dimension ( 3*MAX( N, M ) ) + Workspace. + Modified. + + INFO - INTEGER + Error code. On exit, INFO will be set to one of the + following values: + 0 => normal return + -1 => M negative or unequal to N and SYM='S', 'H', or 'P' + -2 => N negative + -3 => DIST illegal string + -5 => SYM illegal string + -7 => MODE not in range -6 to 6 + -8 => COND less than 1.0, and MODE neither -6, 0 nor 6 + -10 => KL negative + -11 => KU negative, or SYM is not 'N' and KU is not equal to + + KL + -12 => PACK illegal string, or PACK='U' or 'L', and SYM='N'; + + or PACK='C' or 'Q' and SYM='N' and KL is not zero; + or PACK='R' or 'B' and SYM='N' and KU is not zero; + or PACK='U', 'L', 'C', 'R', 'B', or 'Q', and M is not + + N. + -14 => LDA is less than M, or PACK='Z' and LDA is less than + + MIN(KU,N-1) + MIN(KL,M-1) + 1. + 1 => Error return from DLATM1 + 2 => Cannot scale to DMAX (max. sing. value is 0) + 3 => Error return from ZLAGGE, CLAGHE or CLAGSY + + ===================================================================== + + + + 1) Decode and Test the input parameters. + Initialize flags & seed. + + Parameter adjustments */ + --iseed; + --d; + a_dim1 = *lda; + a_offset = a_dim1 + 1; + a -= a_offset; + --work; + + /* Function Body */ + *info = 0; + +/* Quick return if possible */ + + if (*m == 0 || *n == 0) { + return 0; + } + +/* Decode DIST */ + + if (lsame_(dist, "U")) { + idist = 1; + } else if (lsame_(dist, "S")) { + idist = 2; + } else if (lsame_(dist, "N")) { + idist = 3; + } else { + idist = -1; + } + +/* Decode SYM */ + + if (lsame_(sym, "N")) { + isym = 1; + irsign = 0; + zsym = FALSE_; + } else if (lsame_(sym, "P")) { + isym = 2; + irsign = 0; + zsym = FALSE_; + } else if (lsame_(sym, "S")) { + isym = 2; + irsign = 0; + zsym = TRUE_; + } else if (lsame_(sym, "H")) { + isym = 2; + irsign = 1; + zsym = FALSE_; + } else { + isym = -1; + } + +/* Decode PACK */ + + isympk = 0; + if (lsame_(pack, "N")) { + ipack = 0; + } else if (lsame_(pack, "U")) { + ipack = 1; + isympk = 1; + } else if (lsame_(pack, "L")) { + ipack = 2; + isympk = 1; + } else if (lsame_(pack, "C")) { + ipack = 3; + isympk = 2; + } else if (lsame_(pack, "R")) { + ipack = 4; + isympk = 3; + } else if (lsame_(pack, "B")) { + ipack = 5; + isympk = 3; + } else if (lsame_(pack, "Q")) { + ipack = 6; + isympk = 2; + } else if (lsame_(pack, "Z")) { + ipack = 7; + } else { + ipack = -1; + } + +/* Set certain internal parameters */ + + mnmin = min(*m,*n); +/* Computing MIN */ + i__1 = *kl, i__2 = *m - 1; + llb = min(i__1,i__2); +/* Computing MIN */ + i__1 = *ku, i__2 = *n - 1; + uub = min(i__1,i__2); +/* Computing MIN */ + i__1 = *m, i__2 = *n + llb; + mr = min(i__1,i__2); +/* Computing MIN */ + i__1 = *n, i__2 = *m + uub; + nc = min(i__1,i__2); + + if (ipack == 5 || ipack == 6) { + minlda = uub + 1; + } else if (ipack == 7) { + minlda = llb + uub + 1; + } else { + minlda = *m; + } + +/* Use Givens rotation method if bandwidth small enough, + or if LDA is too small to store the matrix unpacked. */ + + givens = FALSE_; + if (isym == 1) { +/* Computing MAX */ + i__1 = 1, i__2 = mr + nc; + if ((doublereal) (llb + uub) < (doublereal) max(i__1,i__2) * .3) { + givens = TRUE_; + } + } else { + if (llb << 1 < *m) { + givens = TRUE_; + } + } + if (*lda < *m && *lda >= minlda) { + givens = TRUE_; + } + +/* Set INFO if an error */ + + if (*m < 0) { + *info = -1; + } else if (*m != *n && isym != 1) { + *info = -1; + } else if (*n < 0) { + *info = -2; + } else if (idist == -1) { + *info = -3; + } else if (isym == -1) { + *info = -5; + } else if (abs(*mode) > 6) { + *info = -7; + } else if (*mode != 0 && abs(*mode) != 6 && *cond < 1.) { + *info = -8; + } else if (*kl < 0) { + *info = -10; + } else if (*ku < 0 || isym != 1 && *kl != *ku) { + *info = -11; + } else if (ipack == -1 || isympk == 1 && isym == 1 || isympk == 2 && isym + == 1 && *kl > 0 || isympk == 3 && isym == 1 && *ku > 0 || isympk + != 0 && *m != *n) { + *info = -12; + } else if (*lda < max(1,minlda)) { + *info = -14; + } + + if (*info != 0) { + i__1 = -(*info); + xerbla_("ZLATMS", &i__1); + return 0; + } + +/* Initialize random number generator */ + + for (i = 1; i <= 4; ++i) { + iseed[i] = (i__1 = iseed[i], abs(i__1)) % 4096; +/* L10: */ + } + + if (iseed[4] % 2 != 1) { + ++iseed[4]; + } + +/* 2) Set up D if indicated. + + Compute D according to COND and MODE */ + + dlatm1_(mode, cond, &irsign, &idist, &iseed[1], &d[1], &mnmin, &iinfo); + if (iinfo != 0) { + *info = 1; + return 0; + } + +/* Choose Top-Down if D is (apparently) increasing, + Bottom-Up if D is (apparently) decreasing. */ + + if (abs(d[1]) <= (d__1 = d[mnmin], abs(d__1))) { + topdwn = TRUE_; + } else { + topdwn = FALSE_; + } + + if (*mode != 0 && abs(*mode) != 6) { + +/* Scale by DMAX */ + + temp = abs(d[1]); + i__1 = mnmin; + for (i = 2; i <= i__1; ++i) { +/* Computing MAX */ + d__2 = temp, d__3 = (d__1 = d[i], abs(d__1)); + temp = max(d__2,d__3); +/* L20: */ + } + + if (temp > 0.) { + alpha = *dmax__ / temp; + } else { + *info = 2; + return 0; + } + + dscal_(&mnmin, &alpha, &d[1], &c__1); + + } + + zlaset_("Full", lda, n, &c_b1, &c_b1, &a[a_offset], lda); + +/* 3) Generate Banded Matrix using Givens rotations. + Also the special case of UUB=LLB=0 + + Compute Addressing constants to cover all + storage formats. Whether GE, HE, SY, GB, HB, or SB, + upper or lower triangle or both, + the (i,j)-th element is in + A( i - ISKEW*j + IOFFST, j ) */ + + if (ipack > 4) { + ilda = *lda - 1; + iskew = 1; + if (ipack > 5) { + ioffst = uub + 1; + } else { + ioffst = 1; + } + } else { + ilda = *lda; + iskew = 0; + ioffst = 0; + } + +/* IPACKG is the format that the matrix is generated in. If this is + different from IPACK, then the matrix must be repacked at the + end. It also signals how to compute the norm, for scaling. */ + + ipackg = 0; + +/* Diagonal Matrix -- We are done, unless it + is to be stored HP/SP/PP/TP (PACK='R' or 'C') */ + + if (llb == 0 && uub == 0) { + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__2 = (1 - iskew) * j + ioffst + j * a_dim1; + i__3 = j; + z__1.r = d[i__3], z__1.i = 0.; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; +/* L30: */ + } + + if (ipack <= 2 || ipack >= 5) { + ipackg = ipack; + } + + } else if (givens) { + +/* Check whether to use Givens rotations, + Householder transformations, or nothing. */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + if (ipack > 4) { + ipackg = ipack; + } else { + ipackg = 0; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__2 = (1 - iskew) * j + ioffst + j * a_dim1; + i__3 = j; + z__1.r = d[i__3], z__1.i = 0.; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; +/* L40: */ + } + + if (topdwn) { + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + Last row actually rotated is M + Last column actually rotated is MIN( M+ +JKU, N ) + + Computing MIN */ + i__3 = *m + jku; + i__2 = min(i__3,*n) + jkl - 1; + for (jr = 1; jr <= i__2; ++jr) { + extra.r = 0., extra.i = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; +/* Computing MAX */ + i__3 = 1, i__4 = jr - jkl; + icol = max(i__3,i__4); + if (jr < *m) { +/* Computing MIN */ + i__3 = *n, i__4 = jr + jku; + il = min(i__3,i__4) + 1 - icol; + L__1 = jr > jkl; + zlarot_(&c_true, &L__1, &c_false, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ir = jr; + ic = icol; + i__3 = -jkl - jku; + for (jch = jr - jkl; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ir < *m) { + zlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &realc, + &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__2.r = realc * dummy.r, z__2.i = realc * + dummy.i; + d_cnjg(&z__1, &z__2); + c.r = z__1.r, c.i = z__1.i; + z__3.r = -s.r, z__3.i = -s.i; + z__2.r = z__3.r * dummy.r - z__3.i * dummy.i, + z__2.i = z__3.r * dummy.i + z__3.i * + dummy.r; + d_cnjg(&z__1, &z__2); + s.r = z__1.r, s.i = z__1.i; + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + ctemp.r = 0., ctemp.i = 0.; + iltemp = jch > jku; + zlarot_(&c_false, &iltemp, &c_true, &il, &c, &s, & + a[irow - iskew * ic + ioffst + ic * + a_dim1], &ilda, &ctemp, &extra); + if (iltemp) { + zlartg_(&a[irow + 1 - iskew * (ic + 1) + + ioffst + (ic + 1) * a_dim1], &ctemp, & + realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__2.r = realc * dummy.r, z__2.i = realc * + dummy.i; + d_cnjg(&z__1, &z__2); + c.r = z__1.r, c.i = z__1.i; + z__3.r = -s.r, z__3.i = -s.i; + z__2.r = z__3.r * dummy.r - z__3.i * dummy.i, + z__2.i = z__3.r * dummy.i + z__3.i * + dummy.r; + d_cnjg(&z__1, &z__2); + s.r = z__1.r, s.i = z__1.i; + +/* Computing MAX */ + i__4 = 1, i__5 = jch - jku - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + extra.r = 0., extra.i = 0.; + L__1 = jch > jku + jkl; + zlarot_(&c_true, &L__1, &c_true, &il, &c, &s, + &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, &ctemp) + ; + ic = icol; + ir = irow; + } +/* L50: */ + } +/* L60: */ + } +/* L70: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + Computing MIN */ + i__3 = *n + jkl; + i__2 = min(i__3,*m) + jku - 1; + for (jc = 1; jc <= i__2; ++jc) { + extra.r = 0., extra.i = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; +/* Computing MAX */ + i__3 = 1, i__4 = jc - jku; + irow = max(i__3,i__4); + if (jc < *n) { +/* Computing MIN */ + i__3 = *m, i__4 = jc + jkl; + il = min(i__3,i__4) + 1 - irow; + L__1 = jc > jku; + zlarot_(&c_false, &L__1, &c_false, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &extra, &dummy); + } + +/* Chase "EXTRA" back up */ + + ic = jc; + ir = irow; + i__3 = -jkl - jku; + for (jch = jc - jku; i__3 < 0 ? jch >= 1 : jch <= 1; + jch += i__3) { + if (ic < *n) { + zlartg_(&a[ir + 1 - iskew * (ic + 1) + ioffst + + (ic + 1) * a_dim1], &extra, &realc, + &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__2.r = realc * dummy.r, z__2.i = realc * + dummy.i; + d_cnjg(&z__1, &z__2); + c.r = z__1.r, c.i = z__1.i; + z__3.r = -s.r, z__3.i = -s.i; + z__2.r = z__3.r * dummy.r - z__3.i * dummy.i, + z__2.i = z__3.r * dummy.i + z__3.i * + dummy.r; + d_cnjg(&z__1, &z__2); + s.r = z__1.r, s.i = z__1.i; + } +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl; + icol = max(i__4,i__5); + il = ic + 2 - icol; + ctemp.r = 0., ctemp.i = 0.; + iltemp = jch > jkl; + zlarot_(&c_true, &iltemp, &c_true, &il, &c, &s, & + a[ir - iskew * icol + ioffst + icol * + a_dim1], &ilda, &ctemp, &extra); + if (iltemp) { + zlartg_(&a[ir + 1 - iskew * (icol + 1) + + ioffst + (icol + 1) * a_dim1], &ctemp, + &realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__2.r = realc * dummy.r, z__2.i = realc * + dummy.i; + d_cnjg(&z__1, &z__2); + c.r = z__1.r, c.i = z__1.i; + z__3.r = -s.r, z__3.i = -s.i; + z__2.r = z__3.r * dummy.r - z__3.i * dummy.i, + z__2.i = z__3.r * dummy.i + z__3.i * + dummy.r; + d_cnjg(&z__1, &z__2); + s.r = z__1.r, s.i = z__1.i; +/* Computing MAX */ + i__4 = 1, i__5 = jch - jkl - jku; + irow = max(i__4,i__5); + il = ir + 2 - irow; + extra.r = 0., extra.i = 0.; + L__1 = jch > jkl + jku; + zlarot_(&c_false, &L__1, &c_true, &il, &c, &s, + &a[irow - iskew * icol + ioffst + + icol * a_dim1], &ilda, &extra, &ctemp) + ; + ic = icol; + ir = irow; + } +/* L80: */ + } +/* L90: */ + } +/* L100: */ + } + + } else { + +/* Bottom-Up -- Start at the bottom right. */ + + jkl = 0; + i__1 = uub; + for (jku = 1; jku <= i__1; ++jku) { + +/* Transform from bandwidth JKL, JKU-1 to +JKL, JKU + + First row actually rotated is M + First column actually rotated is MIN( M ++JKU, N ) + + Computing MIN */ + i__2 = *m, i__3 = *n + jkl; + iendch = min(i__2,i__3) - 1; +/* Computing MIN */ + i__2 = *m + jku; + i__3 = 1 - jkl; + for (jc = min(i__2,*n) - 1; jc >= i__3; --jc) { + extra.r = 0., extra.i = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; +/* Computing MAX */ + i__2 = 1, i__4 = jc - jku + 1; + irow = max(i__2,i__4); + if (jc > 0) { +/* Computing MIN */ + i__2 = *m, i__4 = jc + jkl + 1; + il = min(i__2,i__4) + 1 - irow; + L__1 = jc + jkl < *m; + zlarot_(&c_false, &c_false, &L__1, &il, &c, &s, & + a[irow - iskew * jc + ioffst + jc * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ic = jc; + i__2 = iendch; + i__4 = jkl + jku; + for (jch = jc + jkl; i__4 < 0 ? jch >= i__2 : jch <= + i__2; jch += i__4) { + ilextr = ic > 0; + if (ilextr) { + zlartg_(&a[jch - iskew * ic + ioffst + ic * + a_dim1], &extra, &realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__1.r = realc * dummy.r, z__1.i = realc * + dummy.i; + c.r = z__1.r, c.i = z__1.i; + z__1.r = s.r * dummy.r - s.i * dummy.i, + z__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = z__1.r, s.i = z__1.i; + } + ic = max(1,ic); +/* Computing MIN */ + i__5 = *n - 1, i__6 = jch + jku; + icol = min(i__5,i__6); + iltemp = jch + jku < *n; + ctemp.r = 0., ctemp.i = 0.; + i__5 = icol + 2 - ic; + zlarot_(&c_true, &ilextr, &iltemp, &i__5, &c, &s, + &a[jch - iskew * ic + ioffst + ic * + a_dim1], &ilda, &extra, &ctemp); + if (iltemp) { + zlartg_(&a[jch - iskew * icol + ioffst + icol + * a_dim1], &ctemp, &realc, &s, &dummy) + ; + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__1.r = realc * dummy.r, z__1.i = realc * + dummy.i; + c.r = z__1.r, c.i = z__1.i; + z__1.r = s.r * dummy.r - s.i * dummy.i, + z__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = z__1.r, s.i = z__1.i; +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra.r = 0., extra.i = 0.; + L__1 = jch + jkl + jku <= iendch; + zlarot_(&c_false, &c_true, &L__1, &il, &c, &s, + &a[jch - iskew * icol + ioffst + + icol * a_dim1], &ilda, &ctemp, &extra) + ; + ic = icol; + } +/* L110: */ + } +/* L120: */ + } +/* L130: */ + } + + jku = uub; + i__1 = llb; + for (jkl = 1; jkl <= i__1; ++jkl) { + +/* Transform from bandwidth JKL-1, JKU to +JKL, JKU + + First row actually rotated is MIN( N+JK +L, M ) + First column actually rotated is N + + Computing MIN */ + i__3 = *n, i__4 = *m + jku; + iendch = min(i__3,i__4) - 1; +/* Computing MIN */ + i__3 = *n + jkl; + i__4 = 1 - jku; + for (jr = min(i__3,*m) - 1; jr >= i__4; --jr) { + extra.r = 0., extra.i = 0.; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; +/* Computing MAX */ + i__3 = 1, i__2 = jr - jkl + 1; + icol = max(i__3,i__2); + if (jr > 0) { +/* Computing MIN */ + i__3 = *n, i__2 = jr + jku + 1; + il = min(i__3,i__2) + 1 - icol; + L__1 = jr + jku < *n; + zlarot_(&c_true, &c_false, &L__1, &il, &c, &s, &a[ + jr - iskew * icol + ioffst + icol * + a_dim1], &ilda, &dummy, &extra); + } + +/* Chase "EXTRA" back down */ + + ir = jr; + i__3 = iendch; + i__2 = jkl + jku; + for (jch = jr + jku; i__2 < 0 ? jch >= i__3 : jch <= + i__3; jch += i__2) { + ilextr = ir > 0; + if (ilextr) { + zlartg_(&a[ir - iskew * jch + ioffst + jch * + a_dim1], &extra, &realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__1.r = realc * dummy.r, z__1.i = realc * + dummy.i; + c.r = z__1.r, c.i = z__1.i; + z__1.r = s.r * dummy.r - s.i * dummy.i, + z__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = z__1.r, s.i = z__1.i; + } + ir = max(1,ir); +/* Computing MIN */ + i__5 = *m - 1, i__6 = jch + jkl; + irow = min(i__5,i__6); + iltemp = jch + jkl < *m; + ctemp.r = 0., ctemp.i = 0.; + i__5 = irow + 2 - ir; + zlarot_(&c_false, &ilextr, &iltemp, &i__5, &c, &s, + &a[ir - iskew * jch + ioffst + jch * + a_dim1], &ilda, &extra, &ctemp); + if (iltemp) { + zlartg_(&a[irow - iskew * jch + ioffst + jch * + a_dim1], &ctemp, &realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__1.r = realc * dummy.r, z__1.i = realc * + dummy.i; + c.r = z__1.r, c.i = z__1.i; + z__1.r = s.r * dummy.r - s.i * dummy.i, + z__1.i = s.r * dummy.i + s.i * + dummy.r; + s.r = z__1.r, s.i = z__1.i; +/* Computing MIN */ + i__5 = iendch, i__6 = jch + jkl + jku; + il = min(i__5,i__6) + 2 - jch; + extra.r = 0., extra.i = 0.; + L__1 = jch + jkl + jku <= iendch; + zlarot_(&c_true, &c_true, &L__1, &il, &c, &s, + &a[irow - iskew * jch + ioffst + jch * + a_dim1], &ilda, &ctemp, &extra); + ir = irow; + } +/* L140: */ + } +/* L150: */ + } +/* L160: */ + } + + } + + } else { + +/* Symmetric -- A = U D U' + Hermitian -- A = U D U* */ + + ipackg = ipack; + ioffg = ioffst; + + if (topdwn) { + +/* Top-Down -- Generate Upper triangle only */ + + if (ipack >= 5) { + ipackg = 6; + ioffg = uub + 1; + } else { + ipackg = 1; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__4 = (1 - iskew) * j + ioffg + j * a_dim1; + i__2 = j; + z__1.r = d[i__2], z__1.i = 0.; + a[i__4].r = z__1.r, a[i__4].i = z__1.i; +/* L170: */ + } + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + i__4 = *n - 1; + for (jc = 1; jc <= i__4; ++jc) { +/* Computing MAX */ + i__2 = 1, i__3 = jc - k; + irow = max(i__2,i__3); +/* Computing MIN */ + i__2 = jc + 1, i__3 = k + 2; + il = min(i__2,i__3); + extra.r = 0., extra.i = 0.; + i__2 = jc - iskew * (jc + 1) + ioffg + (jc + 1) * + a_dim1; + ctemp.r = a[i__2].r, ctemp.i = a[i__2].i; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; + if (zsym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + d_cnjg(&z__1, &ctemp); + ctemp.r = z__1.r, ctemp.i = z__1.i; + d_cnjg(&z__1, &c); + ct.r = z__1.r, ct.i = z__1.i; + d_cnjg(&z__1, &s); + st.r = z__1.r, st.i = z__1.i; + } + L__1 = jc > k; + zlarot_(&c_false, &L__1, &c_true, &il, &c, &s, &a[ + irow - iskew * jc + ioffg + jc * a_dim1], & + ilda, &extra, &ctemp); +/* Computing MIN */ + i__3 = k, i__5 = *n - jc; + i__2 = min(i__3,i__5) + 1; + zlarot_(&c_true, &c_true, &c_false, &i__2, &ct, &st, & + a[(1 - iskew) * jc + ioffg + jc * a_dim1], & + ilda, &ctemp, &dummy); + +/* Chase EXTRA back up the matrix +*/ + + icol = jc; + i__2 = -k; + for (jch = jc - k; i__2 < 0 ? jch >= 1 : jch <= 1; + jch += i__2) { + zlartg_(&a[jch + 1 - iskew * (icol + 1) + ioffg + + (icol + 1) * a_dim1], &extra, &realc, &s, + &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__2.r = realc * dummy.r, z__2.i = realc * + dummy.i; + d_cnjg(&z__1, &z__2); + c.r = z__1.r, c.i = z__1.i; + z__3.r = -s.r, z__3.i = -s.i; + z__2.r = z__3.r * dummy.r - z__3.i * dummy.i, + z__2.i = z__3.r * dummy.i + z__3.i * + dummy.r; + d_cnjg(&z__1, &z__2); + s.r = z__1.r, s.i = z__1.i; + i__3 = jch - iskew * (jch + 1) + ioffg + (jch + 1) + * a_dim1; + ctemp.r = a[i__3].r, ctemp.i = a[i__3].i; + if (zsym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + d_cnjg(&z__1, &ctemp); + ctemp.r = z__1.r, ctemp.i = z__1.i; + d_cnjg(&z__1, &c); + ct.r = z__1.r, ct.i = z__1.i; + d_cnjg(&z__1, &s); + st.r = z__1.r, st.i = z__1.i; + } + i__3 = k + 2; + zlarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &ctemp, &extra); +/* Computing MAX */ + i__3 = 1, i__5 = jch - k; + irow = max(i__3,i__5); +/* Computing MIN */ + i__3 = jch + 1, i__5 = k + 2; + il = min(i__3,i__5); + extra.r = 0., extra.i = 0.; + L__1 = jch > k; + zlarot_(&c_false, &L__1, &c_true, &il, &ct, &st, & + a[irow - iskew * jch + ioffg + jch * + a_dim1], &ilda, &extra, &ctemp); + icol = jch; +/* L180: */ + } +/* L190: */ + } +/* L200: */ + } + +/* If we need lower triangle, copy from upper. No +te that + the order of copying is chosen to work for 'q' + -> 'b' */ + + if (ipack != ipackg && ipack != 3) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst - iskew * jc; + if (zsym) { +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + i__2 = jr + irow + jc * a_dim1; + i__3 = jc - iskew * jr + ioffg + jr * a_dim1; + a[i__2].r = a[i__3].r, a[i__2].i = a[i__3].i; +/* L210: */ + } + } else { +/* Computing MIN */ + i__2 = *n, i__3 = jc + uub; + i__4 = min(i__2,i__3); + for (jr = jc; jr <= i__4; ++jr) { + i__2 = jr + irow + jc * a_dim1; + d_cnjg(&z__1, &a[jc - iskew * jr + ioffg + jr + * a_dim1]); + a[i__2].r = z__1.r, a[i__2].i = z__1.i; +/* L220: */ + } + } +/* L230: */ + } + if (ipack == 5) { + i__1 = *n; + for (jc = *n - uub + 1; jc <= i__1; ++jc) { + i__4 = uub + 1; + for (jr = *n + 2 - jc; jr <= i__4; ++jr) { + i__2 = jr + jc * a_dim1; + a[i__2].r = 0., a[i__2].i = 0.; +/* L240: */ + } +/* L250: */ + } + } + if (ipackg == 6) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } else { + +/* Bottom-Up -- Generate Lower triangle only */ + + if (ipack >= 5) { + ipackg = 5; + if (ipack == 6) { + ioffg = 1; + } + } else { + ipackg = 2; + } + + i__1 = mnmin; + for (j = 1; j <= i__1; ++j) { + i__4 = (1 - iskew) * j + ioffg + j * a_dim1; + i__2 = j; + z__1.r = d[i__2], z__1.i = 0.; + a[i__4].r = z__1.r, a[i__4].i = z__1.i; +/* L260: */ + } + + i__1 = uub; + for (k = 1; k <= i__1; ++k) { + for (jc = *n - 1; jc >= 1; --jc) { +/* Computing MIN */ + i__4 = *n + 1 - jc, i__2 = k + 2; + il = min(i__4,i__2); + extra.r = 0., extra.i = 0.; + i__4 = (1 - iskew) * jc + 1 + ioffg + jc * a_dim1; + ctemp.r = a[i__4].r, ctemp.i = a[i__4].i; + angle = dlarnd_(&c__1, &iseed[1]) * + 6.2831853071795864769252867663; + d__1 = cos(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + c.r = z__1.r, c.i = z__1.i; + d__1 = sin(angle); + zlarnd_(&z__2, &c__5, &iseed[1]); + z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i; + s.r = z__1.r, s.i = z__1.i; + if (zsym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + d_cnjg(&z__1, &ctemp); + ctemp.r = z__1.r, ctemp.i = z__1.i; + d_cnjg(&z__1, &c); + ct.r = z__1.r, ct.i = z__1.i; + d_cnjg(&z__1, &s); + st.r = z__1.r, st.i = z__1.i; + } + L__1 = *n - jc > k; + zlarot_(&c_false, &c_true, &L__1, &il, &c, &s, &a[(1 + - iskew) * jc + ioffg + jc * a_dim1], &ilda, & + ctemp, &extra); +/* Computing MAX */ + i__4 = 1, i__2 = jc - k + 1; + icol = max(i__4,i__2); + i__4 = jc + 2 - icol; + zlarot_(&c_true, &c_false, &c_true, &i__4, &ct, &st, & + a[jc - iskew * icol + ioffg + icol * a_dim1], + &ilda, &dummy, &ctemp); + +/* Chase EXTRA back down the matrix + */ + + icol = jc; + i__4 = *n - 1; + i__2 = k; + for (jch = jc + k; i__2 < 0 ? jch >= i__4 : jch <= + i__4; jch += i__2) { + zlartg_(&a[jch - iskew * icol + ioffg + icol * + a_dim1], &extra, &realc, &s, &dummy); + zlarnd_(&z__1, &c__5, &iseed[1]); + dummy.r = z__1.r, dummy.i = z__1.i; + z__1.r = realc * dummy.r, z__1.i = realc * + dummy.i; + c.r = z__1.r, c.i = z__1.i; + z__1.r = s.r * dummy.r - s.i * dummy.i, z__1.i = + s.r * dummy.i + s.i * dummy.r; + s.r = z__1.r, s.i = z__1.i; + i__3 = (1 - iskew) * jch + 1 + ioffg + jch * + a_dim1; + ctemp.r = a[i__3].r, ctemp.i = a[i__3].i; + if (zsym) { + ct.r = c.r, ct.i = c.i; + st.r = s.r, st.i = s.i; + } else { + d_cnjg(&z__1, &ctemp); + ctemp.r = z__1.r, ctemp.i = z__1.i; + d_cnjg(&z__1, &c); + ct.r = z__1.r, ct.i = z__1.i; + d_cnjg(&z__1, &s); + st.r = z__1.r, st.i = z__1.i; + } + i__3 = k + 2; + zlarot_(&c_true, &c_true, &c_true, &i__3, &c, &s, + &a[jch - iskew * icol + ioffg + icol * + a_dim1], &ilda, &extra, &ctemp); +/* Computing MIN */ + i__3 = *n + 1 - jch, i__5 = k + 2; + il = min(i__3,i__5); + extra.r = 0., extra.i = 0.; + L__1 = *n - jch > k; + zlarot_(&c_false, &c_true, &L__1, &il, &ct, &st, & + a[(1 - iskew) * jch + ioffg + jch * + a_dim1], &ilda, &ctemp, &extra); + icol = jch; +/* L270: */ + } +/* L280: */ + } +/* L290: */ + } + +/* If we need upper triangle, copy from lower. No +te that + the order of copying is chosen to work for 'b' + -> 'q' */ + + if (ipack != ipackg && ipack != 4) { + for (jc = *n; jc >= 1; --jc) { + irow = ioffst - iskew * jc; + if (zsym) { +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + i__2 = jr + irow + jc * a_dim1; + i__4 = jc - iskew * jr + ioffg + jr * a_dim1; + a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i; +/* L300: */ + } + } else { +/* Computing MAX */ + i__2 = 1, i__4 = jc - uub; + i__1 = max(i__2,i__4); + for (jr = jc; jr >= i__1; --jr) { + i__2 = jr + irow + jc * a_dim1; + d_cnjg(&z__1, &a[jc - iskew * jr + ioffg + jr + * a_dim1]); + a[i__2].r = z__1.r, a[i__2].i = z__1.i; +/* L310: */ + } + } +/* L320: */ + } + if (ipack == 6) { + i__1 = uub; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0., a[i__4].i = 0.; +/* L330: */ + } +/* L340: */ + } + } + if (ipackg == 5) { + ipackg = ipack; + } else { + ipackg = 0; + } + } + } + +/* Ensure that the diagonal is real if Hermitian */ + + if (! zsym) { + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + irow = ioffst + (1 - iskew) * jc; + i__2 = irow + jc * a_dim1; + i__4 = irow + jc * a_dim1; + d__1 = a[i__4].r; + z__1.r = d__1, z__1.i = 0.; + a[i__2].r = z__1.r, a[i__2].i = z__1.i; +/* L350: */ + } + } + + } + + } else { + +/* 4) Generate Banded Matrix by first + Rotating by random Unitary matrices, + then reducing the bandwidth using Householder + transformations. + + Note: we should get here only if LDA .ge. N */ + + if (isym == 1) { + +/* Non-symmetric -- A = U D V */ + + zlagge_(&mr, &nc, &llb, &uub, &d[1], &a[a_offset], lda, &iseed[1], + &work[1], &iinfo); + } else { + +/* Symmetric -- A = U D U' or + Hermitian -- A = U D U* */ + + if (zsym) { + zlagsy_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1] + , &iinfo); + } else { + zlaghe_(m, &llb, &d[1], &a[a_offset], lda, &iseed[1], &work[1] + , &iinfo); + } + } + + if (iinfo != 0) { + *info = 3; + return 0; + } + } + +/* 5) Pack the matrix */ + + if (ipack != ipackg) { + if (ipack == 1) { + +/* 'U' -- Upper triangular, not packed */ + + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j + 1; i <= i__2; ++i) { + i__4 = i + j * a_dim1; + a[i__4].r = 0., a[i__4].i = 0.; +/* L360: */ + } +/* L370: */ + } + + } else if (ipack == 2) { + +/* 'L' -- Lower triangular, not packed */ + + i__1 = *m; + for (j = 2; j <= i__1; ++j) { + i__2 = j - 1; + for (i = 1; i <= i__2; ++i) { + i__4 = i + j * a_dim1; + a[i__4].r = 0., a[i__4].i = 0.; +/* L380: */ + } +/* L390: */ + } + + } else if (ipack == 3) { + +/* 'C' -- Upper triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = j; + for (i = 1; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + i__4 = irow + icol * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L400: */ + } +/* L410: */ + } + + } else if (ipack == 4) { + +/* 'R' -- Lower triangle packed Columnwise. */ + + icol = 1; + irow = 0; + i__1 = *m; + for (j = 1; j <= i__1; ++j) { + i__2 = *m; + for (i = j; i <= i__2; ++i) { + ++irow; + if (irow > *lda) { + irow = 1; + ++icol; + } + i__4 = irow + icol * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L420: */ + } +/* L430: */ + } + + } else if (ipack >= 5) { + +/* 'B' -- The lower triangle is packed as a band matrix. + + 'Q' -- The upper triangle is packed as a band matrix. + + 'Z' -- The whole matrix is packed as a band matrix. +*/ + + if (ipack == 5) { + uub = 0; + } + if (ipack == 6) { + llb = 0; + } + + i__1 = uub; + for (j = 1; j <= i__1; ++j) { +/* Computing MIN */ + i__2 = j + llb; + for (i = min(i__2,*m); i >= 1; --i) { + i__2 = i - j + uub + 1 + j * a_dim1; + i__4 = i + j * a_dim1; + a[i__2].r = a[i__4].r, a[i__2].i = a[i__4].i; +/* L440: */ + } +/* L450: */ + } + + i__1 = *n; + for (j = uub + 2; j <= i__1; ++j) { +/* Computing MIN */ + i__4 = j + llb; + i__2 = min(i__4,*m); + for (i = j - uub; i <= i__2; ++i) { + i__4 = i - j + uub + 1 + j * a_dim1; + i__3 = i + j * a_dim1; + a[i__4].r = a[i__3].r, a[i__4].i = a[i__3].i; +/* L460: */ + } +/* L470: */ + } + } + +/* If packed, zero out extraneous elements. + + Symmetric/Triangular Packed -- + zero out everything after A(IROW,ICOL) */ + + if (ipack == 3 || ipack == 4) { + i__1 = *m; + for (jc = icol; jc <= i__1; ++jc) { + i__2 = *lda; + for (jr = irow + 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0., a[i__4].i = 0.; +/* L480: */ + } + irow = 0; +/* L490: */ + } + + } else if (ipack >= 5) { + +/* Packed Band -- + 1st row is now in A( UUB+2-j, j), zero above it + m-th row is now in A( M+UUB-j,j), zero below it + last non-zero diagonal is now in A( UUB+LLB+1,j ), + + zero below it, too. */ + + ir1 = uub + llb + 2; + ir2 = uub + *m + 2; + i__1 = *n; + for (jc = 1; jc <= i__1; ++jc) { + i__2 = uub + 1 - jc; + for (jr = 1; jr <= i__2; ++jr) { + i__4 = jr + jc * a_dim1; + a[i__4].r = 0., a[i__4].i = 0.; +/* L500: */ + } +/* Computing MAX + Computing MIN */ + i__3 = ir1, i__5 = ir2 - jc; + i__2 = 1, i__4 = min(i__3,i__5); + i__6 = *lda; + for (jr = max(i__2,i__4); jr <= i__6; ++jr) { + i__2 = jr + jc * a_dim1; + a[i__2].r = 0., a[i__2].i = 0.; +/* L510: */ + } +/* L520: */ + } + } + } + + return 0; + +/* End of ZLATMS */ + +} /* zlatms_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zsymv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zsymv.c new file mode 100644 index 0000000..49c1b34 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/MATGEN/zsymv.c @@ -0,0 +1,408 @@ +#include "f2c.h" + +/* Subroutine */ int zsymv_(char *uplo, integer *n, doublecomplex *alpha, + doublecomplex *a, integer *lda, doublecomplex *x, integer *incx, + doublecomplex *beta, doublecomplex *y, integer *incy) +{ +/* -- LAPACK auxiliary routine (version 2.0) -- + Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., + Courant Institute, Argonne National Lab, and Rice University + October 31, 1992 + + + Purpose + ======= + + ZSYMV performs the matrix-vector operation + + y := alpha*A*x + beta*y, + + where alpha and beta are scalars, x and y are n element vectors and + A is an n by n symmetric matrix. + + Arguments + ========== + + UPLO - CHARACTER*1 + On entry, UPLO specifies whether the upper or lower + triangular part of the array A is to be referenced as + follows: + + UPLO = 'U' or 'u' Only the upper triangular part of A + is to be referenced. + + UPLO = 'L' or 'l' Only the lower triangular part of A + is to be referenced. + + Unchanged on exit. + + N - INTEGER + On entry, N specifies the order of the matrix A. + N must be at least zero. + Unchanged on exit. + + ALPHA - COMPLEX*16 + On entry, ALPHA specifies the scalar alpha. + Unchanged on exit. + + A - COMPLEX*16 array, dimension ( LDA, N ) + Before entry, with UPLO = 'U' or 'u', the leading n by n + upper triangular part of the array A must contain the upper + + triangular part of the symmetric matrix and the strictly + lower triangular part of A is not referenced. + Before entry, with UPLO = 'L' or 'l', the leading n by n + lower triangular part of the array A must contain the lower + + triangular part of the symmetric matrix and the strictly + upper triangular part of A is not referenced. + Unchanged on exit. + + LDA - INTEGER + On entry, LDA specifies the first dimension of A as declared + + in the calling (sub) program. LDA must be at least + max( 1, N ). + Unchanged on exit. + + X - COMPLEX*16 array, dimension at least + ( 1 + ( N - 1 )*abs( INCX ) ). + Before entry, the incremented array X must contain the N- + element vector x. + Unchanged on exit. + + INCX - INTEGER + On entry, INCX specifies the increment for the elements of + X. INCX must not be zero. + Unchanged on exit. + + BETA - COMPLEX*16 + On entry, BETA specifies the scalar beta. When BETA is + supplied as zero then Y need not be set on input. + Unchanged on exit. + + Y - COMPLEX*16 array, dimension at least + ( 1 + ( N - 1 )*abs( INCY ) ). + Before entry, the incremented array Y must contain the n + element vector y. On exit, Y is overwritten by the updated + vector y. + + INCY - INTEGER + On entry, INCY specifies the increment for the elements of + Y. INCY must not be zero. + Unchanged on exit. + + ===================================================================== + + + + Test the input parameters. + + + Parameter adjustments + Function Body */ + /* System generated locals */ + integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; + doublecomplex z__1, z__2, z__3, z__4; + /* Local variables */ + static integer info; + static doublecomplex temp1, temp2; + static integer i, j; + extern logical lsame_(char *, char *); + static integer ix, iy, jx, jy, kx, ky; + extern /* Subroutine */ int xerbla_(char *, integer *); + + +#define X(I) x[(I)-1] +#define Y(I) y[(I)-1] + +#define A(I,J) a[(I)-1 + ((J)-1)* ( *lda)] + + info = 0; + if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { + info = 1; + } else if (*n < 0) { + info = 2; + } else if (*lda < max(1,*n)) { + info = 5; + } else if (*incx == 0) { + info = 7; + } else if (*incy == 0) { + info = 10; + } + if (info != 0) { + xerbla_("ZSYMV ", &info); + return 0; + } + +/* Quick return if possible. */ + + if (*n == 0 || alpha->r == 0. && alpha->i == 0. && (beta->r == 1. && + beta->i == 0.)) { + return 0; + } + +/* Set up the start points in X and Y. */ + + if (*incx > 0) { + kx = 1; + } else { + kx = 1 - (*n - 1) * *incx; + } + if (*incy > 0) { + ky = 1; + } else { + ky = 1 - (*n - 1) * *incy; + } + +/* Start the operations. In this version the elements of A are + accessed sequentially with one pass through the triangular part + of A. + + First form y := beta*y. */ + + if (beta->r != 1. || beta->i != 0.) { + if (*incy == 1) { + if (beta->r == 0. && beta->i == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + Y(i).r = 0., Y(i).i = 0.; +/* L10: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = i; + i__3 = i; + z__1.r = beta->r * Y(i).r - beta->i * Y(i).i, + z__1.i = beta->r * Y(i).i + beta->i * Y(i) + .r; + Y(i).r = z__1.r, Y(i).i = z__1.i; +/* L20: */ + } + } + } else { + iy = ky; + if (beta->r == 0. && beta->i == 0.) { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + Y(iy).r = 0., Y(iy).i = 0.; + iy += *incy; +/* L30: */ + } + } else { + i__1 = *n; + for (i = 1; i <= *n; ++i) { + i__2 = iy; + i__3 = iy; + z__1.r = beta->r * Y(iy).r - beta->i * Y(iy).i, + z__1.i = beta->r * Y(iy).i + beta->i * Y(iy) + .r; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + iy += *incy; +/* L40: */ + } + } + } + } + if (alpha->r == 0. && alpha->i == 0.) { + return 0; + } + if (lsame_(uplo, "U")) { + +/* Form y when A is stored in upper triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + z__1.r = alpha->r * X(j).r - alpha->i * X(j).i, z__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(i).r + z__2.r, z__1.i = Y(i).i + z__2.i; + Y(i).r = z__1.r, Y(i).i = z__1.i; + i__3 = i + j * a_dim1; + i__4 = i; + z__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i).i, + z__2.i = A(i,j).r * X(i).i + A(i,j).i * X( + i).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L50: */ + } + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + z__3.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, z__3.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + z__2.r = Y(j).r + z__3.r, z__2.i = Y(j).i + z__3.i; + z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; +/* L60: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, z__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + ix = kx; + iy = ky; + i__2 = j - 1; + for (i = 1; i <= j-1; ++i) { + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(iy).r + z__2.r, z__1.i = Y(iy).i + z__2.i; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + i__3 = i + j * a_dim1; + i__4 = ix; + z__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix).i, + z__2.i = A(i,j).r * X(ix).i + A(i,j).i * X( + ix).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; + ix += *incx; + iy += *incy; +/* L70: */ + } + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + z__3.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, z__3.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + z__2.r = Y(jy).r + z__3.r, z__2.i = Y(jy).i + z__3.i; + z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jx += *incx; + jy += *incy; +/* L80: */ + } + } + } else { + +/* Form y when A is stored in lower triangle. */ + + if (*incx == 1 && *incy == 1) { + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = j; + z__1.r = alpha->r * X(j).r - alpha->i * X(j).i, z__1.i = + alpha->r * X(j).i + alpha->i * X(j).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = j; + i__3 = j; + i__4 = j + j * a_dim1; + z__2.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, z__2.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + z__1.r = Y(j).r + z__2.r, z__1.i = Y(j).i + z__2.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + i__3 = i; + i__4 = i; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(i).r + z__2.r, z__1.i = Y(i).i + z__2.i; + Y(i).r = z__1.r, Y(i).i = z__1.i; + i__3 = i + j * a_dim1; + i__4 = i; + z__2.r = A(i,j).r * X(i).r - A(i,j).i * X(i).i, + z__2.i = A(i,j).r * X(i).i + A(i,j).i * X( + i).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L90: */ + } + i__2 = j; + i__3 = j; + z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = Y(j).r + z__2.r, z__1.i = Y(j).i + z__2.i; + Y(j).r = z__1.r, Y(j).i = z__1.i; +/* L100: */ + } + } else { + jx = kx; + jy = ky; + i__1 = *n; + for (j = 1; j <= *n; ++j) { + i__2 = jx; + z__1.r = alpha->r * X(jx).r - alpha->i * X(jx).i, z__1.i = + alpha->r * X(jx).i + alpha->i * X(jx).r; + temp1.r = z__1.r, temp1.i = z__1.i; + temp2.r = 0., temp2.i = 0.; + i__2 = jy; + i__3 = jy; + i__4 = j + j * a_dim1; + z__2.r = temp1.r * A(j,j).r - temp1.i * A(j,j).i, z__2.i = + temp1.r * A(j,j).i + temp1.i * A(j,j).r; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + ix = jx; + iy = jy; + i__2 = *n; + for (i = j + 1; i <= *n; ++i) { + ix += *incx; + iy += *incy; + i__3 = iy; + i__4 = iy; + i__5 = i + j * a_dim1; + z__2.r = temp1.r * A(i,j).r - temp1.i * A(i,j).i, + z__2.i = temp1.r * A(i,j).i + temp1.i * A(i,j) + .r; + z__1.r = Y(iy).r + z__2.r, z__1.i = Y(iy).i + z__2.i; + Y(iy).r = z__1.r, Y(iy).i = z__1.i; + i__3 = i + j * a_dim1; + i__4 = ix; + z__2.r = A(i,j).r * X(ix).r - A(i,j).i * X(ix).i, + z__2.i = A(i,j).r * X(ix).i + A(i,j).i * X( + ix).r; + z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i; + temp2.r = z__1.r, temp2.i = z__1.i; +/* L110: */ + } + i__2 = jy; + i__3 = jy; + z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i = + alpha->r * temp2.i + alpha->i * temp2.r; + z__1.r = Y(jy).r + z__2.r, z__1.i = Y(jy).i + z__2.i; + Y(jy).r = z__1.r, Y(jy).i = z__1.i; + jx += *incx; + jy += *incy; +/* L120: */ + } + } + } + + return 0; + +/* End of ZSYMV */ + +} /* zsymv_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/Makefile b/thirdparty/superlu/SuperLU_4.1/TESTING/Makefile new file mode 100644 index 0000000..f6c4d15 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/Makefile @@ -0,0 +1,105 @@ +include ../make.inc + +####################################################################### +# This makefile creates the test programs for the linear equation +# routines in SuperLU. The test files are grouped as follows: +# +# ALINTST -- Auxiliary test routines +# SLINTST -- Single precision real test routines +# DLINTST -- Double precision real test routines +# CLINTST -- Double precision complex test routines +# ZLINTST -- Double precision complex test routines +# +# Test programs can be generated for all or some of the four different +# precisions. Enter make followed by one or more of the data types +# desired. Some examples: +# make single +# make single double +# Alternatively, the command +# make +# without any arguments creates all four test programs. +# The executable files are called +# stest +# dtest +# ctest +# ztest +# +# To remove the object files after the executable files have been +# created, enter +# make clean +# On some systems, you can force the source files to be recompiled by +# entering (for example) +# make single FRC=FRC +# +####################################################################### + +HEADER = ../SRC + +ALINTST = sp_ienv.o + +SLINTST = sdrive.o sp_sconvert.o sgst01.o sgst02.o sgst04.o sgst07.o + +DLINTST = ddrive.o sp_dconvert.o dgst01.o dgst02.o dgst04.o dgst07.o + +CLINTST = cdrive.o sp_cconvert.o cgst01.o cgst02.o cgst04.o cgst07.o + +ZLINTST = zdrive.o sp_zconvert.o zgst01.o zgst02.o zgst04.o zgst07.o + +all: testmat single double complex complex16 + +testmat: + (cd MATGEN; $(MAKE)) + +single: ./stest stest.out + +./stest: $(SLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(SLINTST) $(ALINTST) \ + $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ + +stest.out: stest stest.csh + @echo Testing SINGLE PRECISION linear equation routines + csh stest.csh + +double: ./dtest dtest.out + +./dtest: $(DLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(DLINTST) $(ALINTST) \ + $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ + +dtest.out: dtest dtest.csh + @echo Testing DOUBLE PRECISION linear equation routines + csh dtest.csh + +complex: ./ctest ctest.out + +./ctest: $(CLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(CLINTST) $(ALINTST) \ + $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ + +ctest.out: ctest ctest.csh + @echo Testing SINGLE COMPLEX linear equation routines + csh ctest.csh + +complex16: ./ztest ztest.out + +./ztest: $(ZLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(ZLINTST) $(ALINTST) \ + $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ + +ztest.out: ztest ztest.csh + @echo Testing DOUBLE COMPLEX linear equation routines + csh ztest.csh + +################################## +# Do not optimize this routine # +################################## +dlamch.o: dlamch.c ; $(CC) -c $< + +timer.o: timer.c ; $(CC) -O -c $< + +.c.o: + $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE) + +clean: + rm -f *.o *test *.out + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/cdrive.c b/thirdparty/superlu/SuperLU_4.1/TESTING/cdrive.c new file mode 100644 index 0000000..6c5cd36 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/cdrive.c @@ -0,0 +1,544 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +/* + * File name: cdrive.c + * Purpose: MAIN test program + */ +#include +#include "slu_cdefs.h" + +#define NTESTS 5 /* Number of test types */ +#define NTYPES 11 /* Number of matrix types */ +#define NTRAN 2 +#define THRESH 20.0 +#define FMT1 "%10s:n=%d, test(%d)=%12.5g\n" +#define FMT2 "%10s:fact=%4d, trans=%4d, equed=%c, n=%d, imat=%d, test(%d)=%12.5g\n" +#define FMT3 "%10s:info=%d, izero=%d, n=%d, nrhs=%d, imat=%d, nfail=%d\n" + +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u); + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * CDRIVE is the main test program for the COMPLEX linear + * equation driver routines CGSSV and CGSSVX. + * + * The program is invoked by a shell script file -- ctest.csh. + * The output from the tests are written into a file -- ctest.out. + * + * ===================================================================== + */ + complex *a, *a_save; + int *asub, *asub_save; + int *xa, *xa_save; + SuperMatrix A, B, X, L, U; + SuperMatrix ASAV, AC; + mem_usage_t mem_usage; + int *perm_r; /* row permutation from partial pivoting */ + int *perm_c, *pc_save; /* column permutation */ + int *etree; + complex zero = {0.0, 0.0}; + float *R, *C; + float *ferr, *berr; + float *rwork; + complex *wwork; + void *work; + int info, lwork, nrhs, panel_size, relax; + int m, n, nnz; + complex *xact; + complex *rhsb, *solx, *bsav; + int ldb, ldx; + float rpg, rcond; + int i, j, k1; + float rowcnd, colcnd, amax; + int maxsuper, rowblk, colblk; + int prefact, nofact, equil, iequed; + int nt, nrun, nfail, nerrs, imat, fimat, nimat; + int nfact, ifact, itran; + int kl, ku, mode, lda; + int zerot, izero, ioff; + double u; + float anorm, cndnum; + complex *Afull; + float result[NTESTS]; + superlu_options_t options; + fact_t fact; + trans_t trans; + SuperLUStat_t stat; + static char matrix_type[8]; + static char equed[1], path[4], sym[1], dist[1]; + + /* Fixed set of parameters */ + int iseed[] = {1988, 1989, 1990, 1991}; + static char equeds[] = {'N', 'R', 'C', 'B'}; + static fact_t facts[] = {FACTORED, DOFACT, SamePattern, + SamePattern_SameRowPerm}; + static trans_t transs[] = {NOTRANS, TRANS, CONJ}; + + /* Some function prototypes */ + extern int cgst01(int, int, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, float *); + extern int cgst02(trans_t, int, int, int, SuperMatrix *, complex *, + int, complex *, int, float *resid); + extern int cgst04(int, int, complex *, int, + complex *, int, float rcond, float *resid); + extern int cgst07(trans_t, int, int, SuperMatrix *, complex *, int, + complex *, int, complex *, int, + float *, float *, float *); + extern int clatb4_(char *, int *, int *, int *, char *, int *, int *, + float *, int *, float *, char *); + extern int clatms_(int *, int *, char *, int *, char *, float *d, + int *, float *, float *, int *, int *, + char *, complex *, int *, complex *, int *); + extern int sp_cconvert(int, int, complex *, int, int, int, + complex *a, int *, int *, int *); + + + /* Executable statements */ + + strcpy(path, "CGE"); + nrun = 0; + nfail = 0; + nerrs = 0; + + /* Defaults */ + lwork = 0; + n = 1; + nrhs = 1; + panel_size = sp_ienv(1); + relax = sp_ienv(2); + u = 1.0; + strcpy(matrix_type, "LA"); + parse_command_line(argc, argv, matrix_type, &n, + &panel_size, &relax, &nrhs, &maxsuper, + &rowblk, &colblk, &lwork, &u); + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + fprintf(stderr, "expert: cannot allocate %d bytes\n", lwork); + exit (-1); + } + } + + /* Set the default input options. */ + set_default_options(&options); + options.DiagPivotThresh = u; + options.PrintStat = NO; + options.PivotGrowth = YES; + options.ConditionNumber = YES; + options.IterRefine = SINGLE; + + if ( strcmp(matrix_type, "LA") == 0 ) { + /* Test LAPACK matrix suite. */ + m = n; + lda = SUPERLU_MAX(n, 1); + nnz = n * n; /* upper bound */ + fimat = 1; + nimat = NTYPES; + Afull = complexCalloc(lda * n); + callocateA(n, nnz, &a, &asub, &xa); + } else { + /* Read a sparse matrix */ + fimat = nimat = 0; + creadhb(&m, &n, &nnz, &a, &asub, &xa); + } + + callocateA(n, nnz, &a_save, &asub_save, &xa_save); + rhsb = complexMalloc(m * nrhs); + bsav = complexMalloc(m * nrhs); + solx = complexMalloc(n * nrhs); + ldb = m; + ldx = n; + cCreate_Dense_Matrix(&B, m, nrhs, rhsb, ldb, SLU_DN, SLU_C, SLU_GE); + cCreate_Dense_Matrix(&X, n, nrhs, solx, ldx, SLU_DN, SLU_C, SLU_GE); + xact = complexMalloc(n * nrhs); + etree = intMalloc(n); + perm_r = intMalloc(n); + perm_c = intMalloc(n); + pc_save = intMalloc(n); + R = (float *) SUPERLU_MALLOC(m*sizeof(float)); + C = (float *) SUPERLU_MALLOC(n*sizeof(float)); + ferr = (float *) SUPERLU_MALLOC(nrhs*sizeof(float)); + berr = (float *) SUPERLU_MALLOC(nrhs*sizeof(float)); + j = SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs); + rwork = (float *) SUPERLU_MALLOC(j*sizeof(float)); + for (i = 0; i < j; ++i) rwork[i] = 0.; + if ( !R ) ABORT("SUPERLU_MALLOC fails for R"); + if ( !C ) ABORT("SUPERLU_MALLOC fails for C"); + if ( !ferr ) ABORT("SUPERLU_MALLOC fails for ferr"); + if ( !berr ) ABORT("SUPERLU_MALLOC fails for berr"); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + wwork = complexCalloc( SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs) ); + + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i] = i; + options.ColPerm = MY_PERMC; + + for (imat = fimat; imat <= nimat; ++imat) { /* All matrix types */ + + if ( imat ) { + + /* Skip types 5, 6, or 7 if the matrix size is too small. */ + zerot = (imat >= 5 && imat <= 7); + if ( zerot && n < imat-4 ) + continue; + + /* Set up parameters with CLATB4 and generate a test matrix + with CLATMS. */ + clatb4_(path, &imat, &n, &n, sym, &kl, &ku, &anorm, &mode, + &cndnum, dist); + + clatms_(&n, &n, dist, iseed, sym, &rwork[0], &mode, &cndnum, + &anorm, &kl, &ku, "No packing", Afull, &lda, + &wwork[0], &info); + + if ( info ) { + printf(FMT3, "CLATMS", info, izero, n, nrhs, imat, nfail); + continue; + } + + /* For types 5-7, zero one or more columns of the matrix + to test that INFO is returned correctly. */ + if ( zerot ) { + if ( imat == 5 ) izero = 1; + else if ( imat == 6 ) izero = n; + else izero = n / 2 + 1; + ioff = (izero - 1) * lda; + if ( imat < 7 ) { + for (i = 0; i < n; ++i) Afull[ioff + i] = zero; + } else { + for (j = 0; j < n - izero + 1; ++j) + for (i = 0; i < n; ++i) + Afull[ioff + i + j*lda] = zero; + } + } else { + izero = 0; + } + + /* Convert to sparse representation. */ + sp_cconvert(n, n, Afull, lda, kl, ku, a, asub, xa, &nnz); + + } else { + izero = 0; + zerot = 0; + } + + cCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_C, SLU_GE); + + /* Save a copy of matrix A in ASAV */ + cCreate_CompCol_Matrix(&ASAV, m, n, nnz, a_save, asub_save, xa_save, + SLU_NC, SLU_C, SLU_GE); + cCopy_CompCol_Matrix(&A, &ASAV); + + /* Form exact solution. */ + cGenXtrue(n, nrhs, xact, ldx); + + StatInit(&stat); + + for (iequed = 0; iequed < 4; ++iequed) { + *equed = equeds[iequed]; + if (iequed == 0) nfact = 4; + else nfact = 1; /* Only test factored, pre-equilibrated matrix */ + + for (ifact = 0; ifact < nfact; ++ifact) { + fact = facts[ifact]; + options.Fact = fact; + + for (equil = 0; equil < 2; ++equil) { + options.Equil = equil; + prefact = ( options.Fact == FACTORED || + options.Fact == SamePattern_SameRowPerm ); + /* Need a first factor */ + nofact = (options.Fact != FACTORED); /* Not factored */ + + /* Restore the matrix A. */ + cCopy_CompCol_Matrix(&ASAV, &A); + + if ( zerot ) { + if ( prefact ) continue; + } else if ( options.Fact == FACTORED ) { + if ( equil || iequed ) { + /* Compute row and column scale factors to + equilibrate matrix A. */ + cgsequ(&A, R, C, &rowcnd, &colcnd, &amax, &info); + + /* Force equilibration. */ + if ( !info && n > 0 ) { + if ( lsame_(equed, "R") ) { + rowcnd = 0.; + colcnd = 1.; + } else if ( lsame_(equed, "C") ) { + rowcnd = 1.; + colcnd = 0.; + } else if ( lsame_(equed, "B") ) { + rowcnd = 0.; + colcnd = 0.; + } + } + + /* Equilibrate the matrix. */ + claqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + } + + if ( prefact ) { /* Need a factor for the first time */ + + /* Save Fact option. */ + fact = options.Fact; + options.Fact = DOFACT; + + /* Preorder the matrix, obtain the column etree. */ + sp_preorder(&options, &A, perm_c, etree, &AC); + + /* Factor the matrix AC. */ + cgstrf(&options, &AC, relax, panel_size, + etree, work, lwork, perm_c, perm_r, &L, &U, + &stat, &info); + + if ( info ) { + printf("** First factor: info %d, equed %c\n", + info, *equed); + if ( lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", + info - n); + exit(0); + } + } + + Destroy_CompCol_Permuted(&AC); + + /* Restore Fact option. */ + options.Fact = fact; + } /* if .. first time factor */ + + for (itran = 0; itran < NTRAN; ++itran) { + trans = transs[itran]; + options.Trans = trans; + + /* Restore the matrix A. */ + cCopy_CompCol_Matrix(&ASAV, &A); + + /* Set the right hand side. */ + cFillRHS(trans, nrhs, xact, ldx, &A, &B); + cCopy_Dense_Matrix(m, nrhs, rhsb, ldb, bsav, ldb); + + /*---------------- + * Test cgssv + *----------------*/ + if ( options.Fact == DOFACT && itran == 0) { + /* Not yet factored, and untransposed */ + + cCopy_Dense_Matrix(m, nrhs, rhsb, ldb, solx, ldx); + cgssv(&options, &A, perm_c, perm_r, &L, &U, &X, + &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "cgssv", + info, izero, n, nrhs, imat, nfail); + } else { + /* Reconstruct matrix from factors and + compute residual. */ + cgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + nt = 1; + if ( izero == 0 ) { + /* Compute residual of the computed + solution. */ + cCopy_Dense_Matrix(m, nrhs, rhsb, ldb, + wwork, ldb); + cgst02(trans, m, n, nrhs, &A, solx, + ldx, wwork,ldb, &result[1]); + nt = 2; + } + + /* Print information about the tests that + did not pass the threshold. */ + for (i = 0; i < nt; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT1, "cgssv", n, i, + result[i]); + ++nfail; + } + } + nrun += nt; + } /* else .. info == 0 */ + + /* Restore perm_c. */ + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i]; + + if (lwork == 0) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + } /* if .. end of testing cgssv */ + + /*---------------- + * Test cgssvx + *----------------*/ + + /* Equilibrate the matrix if fact = FACTORED and + equed = 'R', 'C', or 'B'. */ + if ( options.Fact == FACTORED && + (equil || iequed) && n > 0 ) { + claqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + + /* Solve the system and compute the condition number + and error bounds using cgssvx. */ + cgssvx(&options, &A, perm_c, perm_r, etree, + equed, R, C, &L, &U, work, lwork, &B, &X, &rpg, + &rcond, ferr, berr, &mem_usage, &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "cgssvx", + info, izero, n, nrhs, imat, nfail); + if ( lwork == -1 ) { + printf("** Estimated memory: %.0f bytes\n", + mem_usage.total_needed); + exit(0); + } + } else { + if ( !prefact ) { + /* Reconstruct matrix from factors and + compute residual. */ + cgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + k1 = 0; + } else { + k1 = 1; + } + + if ( !info ) { + /* Compute residual of the computed solution.*/ + cCopy_Dense_Matrix(m, nrhs, bsav, ldb, + wwork, ldb); + cgst02(trans, m, n, nrhs, &ASAV, solx, ldx, + wwork, ldb, &result[1]); + + /* Check solution from generated exact + solution. */ + cgst04(n, nrhs, solx, ldx, xact, ldx, rcond, + &result[2]); + + /* Check the error bounds from iterative + refinement. */ + cgst07(trans, n, nrhs, &ASAV, bsav, ldb, + solx, ldx, xact, ldx, ferr, berr, + &result[3]); + + /* Print information about the tests that did + not pass the threshold. */ + for (i = k1; i < NTESTS; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT2, "cgssvx", + options.Fact, trans, *equed, + n, imat, i, result[i]); + ++nfail; + } + } + nrun += NTESTS; + } /* if .. info == 0 */ + } /* else .. end of testing cgssvx */ + + } /* for itran ... */ + + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + } /* for equil ... */ + } /* for ifact ... */ + } /* for iequed ... */ +#if 0 + if ( !info ) { + PrintPerf(&L, &U, &mem_usage, rpg, rcond, ferr, berr, equed); + } +#endif + + } /* for imat ... */ + + /* Print a summary of the results. */ + PrintSumm("CGE", nfail, nrun, nerrs); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (bsav); + SUPERLU_FREE (solx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (pc_save); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + SUPERLU_FREE (rwork); + SUPERLU_FREE (wwork); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + Destroy_CompCol_Matrix(&A); + Destroy_CompCol_Matrix(&ASAV); + if ( lwork > 0 ) { + SUPERLU_FREE (work); + Destroy_SuperMatrix_Store(&L); + Destroy_SuperMatrix_Store(&U); + } + StatFree(&stat); + + return 0; +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "ht:n:w:r:s:m:b:c:l:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-w - panel size\n"); + printf("\t-r - granularity of relaxed supernodes\n"); + exit(1); + break; + case 't': strcpy(matrix_type, optarg); + break; + case 'n': *n = atoi(optarg); + break; + case 'w': *w = atoi(optarg); + break; + case 'r': *relax = atoi(optarg); + break; + case 's': *nrhs = atoi(optarg); + break; + case 'm': *maxsuper = atoi(optarg); + break; + case 'b': *rowblk = atoi(optarg); + break; + case 'c': *colblk = atoi(optarg); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/cgst01.c b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst01.c new file mode 100644 index 0000000..e6698f1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst01.c @@ -0,0 +1,171 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_cdefs.h" + +int cgst01(int m, int n, SuperMatrix *A, SuperMatrix *L, + SuperMatrix *U, int *perm_c, int *perm_r, float *resid) +{ +/* + Purpose + ======= + + CGST01 reconstructs a matrix A from its L*U factorization and + computes the residual + norm(L*U - A) / ( N * norm(A) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========== + + M (input) INT + The number of rows of the matrix A. M >= 0. + + N (input) INT + The number of columns of the matrix A. N >= 0. + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original M x N matrix A. + + L (input) SuperMatrix *, dimension (L->nrow, L->ncol) + The factor matrix L. + + U (input) SuperMatrix *, dimension (U->nrow, U->ncol) + The factor matrix U. + + perm_c (input) INT array, dimension (N) + The column permutation from CGSTRF. + + perm_r (input) INT array, dimension (M) + The pivot indices from CGSTRF. + + RESID (output) FLOAT* + norm(L*U - A) / ( N * norm(A) * EPS ) + + ===================================================================== +*/ + + /* Local variables */ + complex zero = {0.0, 0.0}; + int i, j, k, arow, lptr,isub, urow, superno, fsupc, u_part; + complex utemp, comp_temp; + float anorm, tnorm, cnorm; + float eps; + complex *work; + SCformat *Lstore; + NCformat *Astore, *Ustore; + complex *Aval, *Lval, *Uval; + int *colbeg, *colend; + + /* Function prototypes */ + extern float clangs(char *, SuperMatrix *); + + /* Quick exit if M = 0 or N = 0. */ + + if (m <= 0 || n <= 0) { + *resid = 0.f; + return 0; + } + + work = (complex *)complexCalloc(m); + + Astore = A->Store; + Aval = Astore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + + /* Determine EPS and the norm of A. */ + eps = slamch_("Epsilon"); + anorm = clangs("1", A); + cnorm = 0.; + + /* Compute the product L*U, one column at a time */ + for (k = 0; k < n; ++k) { + + /* The U part outside the rectangular supernode */ + for (i = U_NZ_START(k); i < U_NZ_START(k+1); ++i) { + urow = U_SUB(i); + utemp = Uval[i]; + superno = Lstore->col_to_sup[urow]; + fsupc = L_FST_SUPC(superno); + u_part = urow - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)].r -= utemp.r; + work[L_SUB(lptr-1)].i -= utemp.i; + for (j = L_NZ_START(urow) + u_part; j < L_NZ_START(urow+1); ++j) { + isub = L_SUB(lptr); + cc_mult(&comp_temp, &utemp, &Lval[j]); + c_sub(&work[isub], &work[isub], &comp_temp); + ++lptr; + } + } + + /* The U part inside the rectangular supernode */ + superno = Lstore->col_to_sup[k]; + fsupc = L_FST_SUPC(superno); + urow = L_NZ_START(k); + for (i = fsupc; i <= k; ++i) { + utemp = Lval[urow++]; + u_part = i - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)].r -= utemp.r; + work[L_SUB(lptr-1)].i -= utemp.i; + for (j = L_NZ_START(i)+u_part; j < L_NZ_START(i+1); ++j) { + isub = L_SUB(lptr); + cc_mult(&comp_temp, &utemp, &Lval[j]); + c_sub(&work[isub], &work[isub], &comp_temp); + ++lptr; + } + } + + /* Now compute A[k] - (L*U)[k] (Both matrices may be permuted.) */ + + colbeg = intMalloc(n); + colend = intMalloc(n); + for (i = 0; i < n; i++) { + colbeg[perm_c[i]] = Astore->colptr[i]; + colend[perm_c[i]] = Astore->colptr[i+1]; + } + + for (i = colbeg[k]; i < colend[k]; ++i) { + arow = Astore->rowind[i]; + work[perm_r[arow]].r += Aval[i].r; + work[perm_r[arow]].i += Aval[i].i; + } + + /* Now compute the 1-norm of the column vector work */ + tnorm = 0.; + for (i = 0; i < m; ++i) { + tnorm += fabs(work[i].r) + fabs(work[i].i); + work[i] = zero; + } + cnorm = SUPERLU_MAX(tnorm, cnorm); + } + + *resid = cnorm; + + if (anorm <= 0.f) { + if (*resid != 0.f) { + *resid = 1.f / eps; + } + } else { + *resid = *resid / (float) n / anorm / eps; + } + + SUPERLU_FREE(work); + SUPERLU_FREE(colbeg); + SUPERLU_FREE(colend); + return 0; + +/* End of CGST01 */ + +} /* cgst01_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/cgst02.c b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst02.c new file mode 100644 index 0000000..26128ce --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst02.c @@ -0,0 +1,138 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_cdefs.h" + +int cgst02(trans_t trans, int m, int n, int nrhs, SuperMatrix *A, + complex *x, int ldx, complex *b, int ldb, float *resid) +{ +/* + Purpose + ======= + + CGST02 computes the residual for a solution of a system of linear + equations A*x = b or A'*x = b: + RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations: + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + NRHS (input) INTEGER + The number of columns of B, the matrix of right hand sides. + NRHS >= 0. + + A (input) SuperMatrix*, dimension (LDA,N) + The original M x N sparse matrix A. + + X (input) COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors for the system of linear + equations. + + LDX (input) INTEGER + The leading dimension of the array X. If TRANS = NOTRANS, + LDX >= max(1,N); if TRANS = TRANS or CONJ, LDX >= max(1,M). + + B (input/output) COMPLEX PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side vectors for the system of + linear equations. + On exit, B is overwritten with the difference B - A*X. + + LDB (input) INTEGER + The leading dimension of the array B. IF TRANS = NOTRANS, + LDB >= max(1,M); if TRANS = TRANS or CONJ, LDB >= max(1,N). + + RESID (output) FLOAT PRECISION + The maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ). + + ===================================================================== +*/ + + /* Table of constant values */ + complex alpha = {-1., 0.0}; + complex beta = {1., 0.0}; + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2; + + /* Local variables */ + int j; + int n1, n2; + float anorm, bnorm; + float xnorm; + float eps; + char transc[1]; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern float clangs(char *, SuperMatrix *); + extern float scasum_(int *, complex *, int *); + + /* Function Body */ + if ( m <= 0 || n <= 0 || nrhs == 0) { + *resid = 0.; + return 0; + } + + if ( (trans == TRANS) || (trans == CONJ) ) { + n1 = n; + n2 = m; + *transc = 'T'; + } else { + n1 = m; + n2 = n; + *transc = 'N'; + } + + /* Exit with RESID = 1/EPS if ANORM = 0. */ + + eps = slamch_("Epsilon"); + anorm = clangs("1", A); + if (anorm <= 0.) { + *resid = 1. / eps; + return 0; + } + + /* Compute B - A*X (or B - A'*X ) and store in B. */ + + sp_cgemm(transc, "N", n1, nrhs, n2, alpha, A, x, ldx, beta, b, ldb); + + /* Compute the maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ) . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + bnorm = scasum_(&n1, &b[j*ldb], &c__1); + xnorm = scasum_(&n2, &x[j*ldx], &c__1); + if (xnorm <= 0.) { + *resid = 1. / eps; + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps; + *resid = SUPERLU_MAX(d__1, d__2); + } + } + + return 0; + +} /* cgst02 */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/cgst04.c b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst04.c new file mode 100644 index 0000000..5ab19a4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst04.c @@ -0,0 +1,122 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_cdefs.h" + +int cgst04(int n, int nrhs, complex *x, int ldx, complex *xact, + int ldxact, float rcond, float *resid) +{ +/* + Purpose + ======= + + CGST04 computes the difference between a computed solution and the + true solution to a system of linear equations. + RESID = ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ), + where RCOND is the reciprocal of the condition number and EPS is the + machine epsilon. + + Arguments + ========= + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + X (input) COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) COMPLEX PRECISION array, dimension( LDX, NRHS ) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + RCOND (input) COMPLEX PRECISION + The reciprocal of the condition number of the coefficient + matrix in the system of equations. + + RESID (output) FLOAT PRECISION + The maximum over the NRHS solution vectors of + ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ) + + ===================================================================== +*/ + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2, d__3, d__4; + + /* Local variables */ + int i, j, n__1; + int ix; + float xnorm; + float eps; + float diffnm; + + /* Function prototypes */ + extern int icamax_(int *, complex *, int *); + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + *resid = 0.; + return 0; + } + + /* Exit with RESID = 1/EPS if RCOND is invalid. */ + + eps = slamch_("Epsilon"); + if ( rcond < 0. ) { + *resid = 1. / eps; + return 0; + } + + /* Compute the maximum of norm(X - XACT) / ( norm(XACT) * EPS ) + over all the vectors X and XACT . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + ix = icamax_(&n__1, &xact[j*ldxact], &c__1); + xnorm = (d__1 = xact[ix-1 + j*ldxact].r, fabs(d__1)) + + (d__2 = xact[ix-1 + j*ldxact].i, fabs(d__2)); + + diffnm = 0.; + for (i = 0; i < n; ++i) { + /* Computing MAX */ + d__3 = diffnm; + d__4 = (d__1 = x[i+j*ldx].r-xact[i+j*ldxact].r, fabs(d__1)) + + (d__2 = x[i+j*ldx].i-xact[i+j*ldxact].i, fabs(d__2)); + diffnm = SUPERLU_MAX(d__3,d__4); + } + if (xnorm <= 0.) { + if (diffnm > 0.) { + *resid = 1. / eps; + } + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = diffnm / xnorm * rcond; + *resid = SUPERLU_MAX(d__1,d__2); + } + } + if (*resid * eps < 1.) { + *resid /= eps; + } + + return 0; + +} /* cgst04_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/cgst07.c b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst07.c new file mode 100644 index 0000000..b7f3079 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/cgst07.c @@ -0,0 +1,228 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include +#include "slu_cdefs.h" + +int cgst07(trans_t trans, int n, int nrhs, SuperMatrix *A, complex *b, + int ldb, complex *x, int ldx, complex *xact, + int ldxact, float *ferr, float *berr, float *reslts) +{ +/* + Purpose + ======= + + CGST07 tests the error bounds from iterative refinement for the + computed solution to a system of equations op(A)*X = B, where A is a + general n by n matrix and op(A) = A or A**T, depending on TRANS. + + RESLTS(1) = test of the error bound + = norm(X - XACT) / ( norm(X) * FERR ) + A large value is returned if this ratio is not less than one. + + RESLTS(2) = residual from the iterative refinement routine + = the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i ) + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations. + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original n by n matrix A. + + B (input) COMPLEX PRECISION array, dimension (LDB,NRHS) + The right hand side vectors for the system of linear + equations. + + LDB (input) INT + The leading dimension of the array B. LDB >= max(1,N). + + X (input) COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) COMPLEX PRECISION array, dimension (LDX,NRHS) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + + FERR (input) COMPLEX PRECISION array, dimension (NRHS) + The estimated forward error bounds for each solution vector + X. If XTRUE is the true solution, FERR bounds the magnitude + of the largest entry in (X - XTRUE) divided by the magnitude + of the largest entry in X. + + BERR (input) COMPLEX PRECISION array, dimension (NRHS) + The componentwise relative backward error of each solution + vector (i.e., the smallest relative change in any entry of A + + or B that makes X an exact solution). + + RESLTS (output) FLOAT PRECISION array, dimension (2) + The maximum over the NRHS solution vectors of the ratios: + RESLTS(1) = norm(X - XACT) / ( norm(X) * FERR ) + RESLTS(2) = BERR / ( (n+1)*EPS + (*) ) + + ===================================================================== +*/ + + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2; + float d__3, d__4; + + /* Local variables */ + float diff, axbi; + int imax, irow, n__1; + int i, j, k; + float unfl, ovfl; + float xnorm; + float errbnd; + int notran; + float eps, tmp; + float *rwork; + complex *Aval; + NCformat *Astore; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern int icamax_(int *, complex *, int *); + + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + reslts[0] = 0.; + reslts[1] = 0.; + return 0; + } + + eps = slamch_("Epsilon"); + unfl = slamch_("Safe minimum"); + ovfl = 1. / unfl; + notran = (trans == NOTRANS); + + rwork = (float *) SUPERLU_MALLOC(n*sizeof(float)); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + Astore = A->Store; + Aval = (complex *) Astore->nzval; + + /* Test 1: Compute the maximum of + norm(X - XACT) / ( norm(X) * FERR ) + over all the vectors X and XACT using the infinity-norm. */ + + errbnd = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + imax = icamax_(&n__1, &x[j*ldx], &c__1); + d__1 = (d__2 = x[imax-1 + j*ldx].r, fabs(d__2)) + + (d__3 = x[imax-1 + j*ldx].i, fabs(d__3)); + xnorm = SUPERLU_MAX(d__1,unfl); + diff = 0.; + for (i = 0; i < n; ++i) { + d__1 = (d__2 = x[i+j*ldx].r - xact[i+j*ldxact].r, fabs(d__2)) + + (d__3 = x[i+j*ldx].i - xact[i+j*ldxact].i, fabs(d__3)); + diff = SUPERLU_MAX(diff, d__1); + } + + if (xnorm > 1.) { + goto L20; + } else if (diff <= ovfl * xnorm) { + goto L20; + } else { + errbnd = 1. / eps; + goto L30; + } + +L20: +#if 0 + if (diff / xnorm <= ferr[j]) { + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + } else { + errbnd = 1. / eps; + } +#endif + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + /*printf("Ferr: %f\n", errbnd);*/ +L30: + ; + } + reslts[0] = errbnd; + + /* Test 2: Compute the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) + abs(b))_i ) */ + + for (k = 0; k < nrhs; ++k) { + for (i = 0; i < n; ++i) + rwork[i] = (d__1 = b[i + k*ldb].r, fabs(d__1)) + + (d__2 = b[i + k*ldb].i, fabs(d__2)); + if ( notran ) { + for (j = 0; j < n; ++j) { + tmp = (d__1 = x[j + k*ldx].r, fabs(d__1)) + + (d__2 = x[j + k*ldx].i, fabs(d__2)); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + d__1 = (d__2 = Aval[i].r, fabs(d__2)) + + (d__3 = Aval[i].i, fabs(d__3)); + rwork[Astore->rowind[i]] += d__1 * tmp; + } + } + } else { + for (j = 0; j < n; ++j) { + tmp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + d__1 = (d__2 = x[irow + k*ldx].r, fabs(d__2)) + + (d__3 = x[irow + k*ldx].i, fabs(d__3)); + d__2 = (d__3 = Aval[i].r, fabs(d__3)) + + (d__4 = Aval[i].i, fabs(d__4)); + tmp += d__2 * d__1; + } + rwork[j] += tmp; + } + } + + axbi = rwork[0]; + for (i = 1; i < n; ++i) axbi = SUPERLU_MIN(axbi, rwork[i]); + + /* Computing MAX */ + d__1 = axbi, d__2 = (n + 1) * unfl; + tmp = berr[k] / ((n + 1) * eps + (n + 1) * unfl / SUPERLU_MAX(d__1,d__2)); + + if (k == 0) { + reslts[1] = tmp; + } else { + reslts[1] = SUPERLU_MAX(reslts[1],tmp); + } + } + + SUPERLU_FREE(rwork); + return 0; + +} /* cgst07 */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/ctest.csh b/thirdparty/superlu/SuperLU_4.1/TESTING/ctest.csh new file mode 100644 index 0000000..2f5feba --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/ctest.csh @@ -0,0 +1,50 @@ +#!/bin/csh + +set ofile = ctest.out # output file +if ( -e $ofile ) then + rm -f $ofile +endif +echo "Single-precision complex testing output" > $ofile + +set MATRICES = (LAPACK cg20.cua) +set NVAL = (9 19) +set NRHS = (5) +set LWORK = (0 10000000) + +# +# Loop through all matrices ... +# +foreach m ($MATRICES) + + #-------------------------------------------- + # Test matrix types generated in LAPACK-style + #-------------------------------------------- + if ($m == 'LAPACK') then + echo '== LAPACK test matrices' >> $ofile + foreach n ($NVAL) + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'n='$n 'nrhs='$s 'lwork='$l >> $ofile + ./ctest -t "LA" -l $l -n $n -s $s >> $ofile + end + end + end + #-------------------------------------------- + # Test a specified sparse matrix + #-------------------------------------------- + else + echo '' >> $ofile + echo '== sparse matrix:' $m >> $ofile + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'nrhs='$s 'lwork='$l >> $ofile + ./ctest -t "SP" -s $s -l $l < ../EXAMPLE/$m >> $ofile + end + end + endif + +end + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/ddrive.c b/thirdparty/superlu/SuperLU_4.1/TESTING/ddrive.c new file mode 100644 index 0000000..d2b12f3 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/ddrive.c @@ -0,0 +1,544 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +/* + * File name: ddrive.c + * Purpose: MAIN test program + */ +#include +#include "slu_ddefs.h" + +#define NTESTS 5 /* Number of test types */ +#define NTYPES 11 /* Number of matrix types */ +#define NTRAN 2 +#define THRESH 20.0 +#define FMT1 "%10s:n=%d, test(%d)=%12.5g\n" +#define FMT2 "%10s:fact=%4d, trans=%4d, equed=%c, n=%d, imat=%d, test(%d)=%12.5g\n" +#define FMT3 "%10s:info=%d, izero=%d, n=%d, nrhs=%d, imat=%d, nfail=%d\n" + +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u); + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * DDRIVE is the main test program for the DOUBLE linear + * equation driver routines DGSSV and DGSSVX. + * + * The program is invoked by a shell script file -- dtest.csh. + * The output from the tests are written into a file -- dtest.out. + * + * ===================================================================== + */ + double *a, *a_save; + int *asub, *asub_save; + int *xa, *xa_save; + SuperMatrix A, B, X, L, U; + SuperMatrix ASAV, AC; + mem_usage_t mem_usage; + int *perm_r; /* row permutation from partial pivoting */ + int *perm_c, *pc_save; /* column permutation */ + int *etree; + double zero = 0.0; + double *R, *C; + double *ferr, *berr; + double *rwork; + double *wwork; + void *work; + int info, lwork, nrhs, panel_size, relax; + int m, n, nnz; + double *xact; + double *rhsb, *solx, *bsav; + int ldb, ldx; + double rpg, rcond; + int i, j, k1; + double rowcnd, colcnd, amax; + int maxsuper, rowblk, colblk; + int prefact, nofact, equil, iequed; + int nt, nrun, nfail, nerrs, imat, fimat, nimat; + int nfact, ifact, itran; + int kl, ku, mode, lda; + int zerot, izero, ioff; + double u; + double anorm, cndnum; + double *Afull; + double result[NTESTS]; + superlu_options_t options; + fact_t fact; + trans_t trans; + SuperLUStat_t stat; + static char matrix_type[8]; + static char equed[1], path[4], sym[1], dist[1]; + + /* Fixed set of parameters */ + int iseed[] = {1988, 1989, 1990, 1991}; + static char equeds[] = {'N', 'R', 'C', 'B'}; + static fact_t facts[] = {FACTORED, DOFACT, SamePattern, + SamePattern_SameRowPerm}; + static trans_t transs[] = {NOTRANS, TRANS, CONJ}; + + /* Some function prototypes */ + extern int dgst01(int, int, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, double *); + extern int dgst02(trans_t, int, int, int, SuperMatrix *, double *, + int, double *, int, double *resid); + extern int dgst04(int, int, double *, int, + double *, int, double rcond, double *resid); + extern int dgst07(trans_t, int, int, SuperMatrix *, double *, int, + double *, int, double *, int, + double *, double *, double *); + extern int dlatb4_(char *, int *, int *, int *, char *, int *, int *, + double *, int *, double *, char *); + extern int dlatms_(int *, int *, char *, int *, char *, double *d, + int *, double *, double *, int *, int *, + char *, double *, int *, double *, int *); + extern int sp_dconvert(int, int, double *, int, int, int, + double *a, int *, int *, int *); + + + /* Executable statements */ + + strcpy(path, "DGE"); + nrun = 0; + nfail = 0; + nerrs = 0; + + /* Defaults */ + lwork = 0; + n = 1; + nrhs = 1; + panel_size = sp_ienv(1); + relax = sp_ienv(2); + u = 1.0; + strcpy(matrix_type, "LA"); + parse_command_line(argc, argv, matrix_type, &n, + &panel_size, &relax, &nrhs, &maxsuper, + &rowblk, &colblk, &lwork, &u); + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + fprintf(stderr, "expert: cannot allocate %d bytes\n", lwork); + exit (-1); + } + } + + /* Set the default input options. */ + set_default_options(&options); + options.DiagPivotThresh = u; + options.PrintStat = NO; + options.PivotGrowth = YES; + options.ConditionNumber = YES; + options.IterRefine = DOUBLE; + + if ( strcmp(matrix_type, "LA") == 0 ) { + /* Test LAPACK matrix suite. */ + m = n; + lda = SUPERLU_MAX(n, 1); + nnz = n * n; /* upper bound */ + fimat = 1; + nimat = NTYPES; + Afull = doubleCalloc(lda * n); + dallocateA(n, nnz, &a, &asub, &xa); + } else { + /* Read a sparse matrix */ + fimat = nimat = 0; + dreadhb(&m, &n, &nnz, &a, &asub, &xa); + } + + dallocateA(n, nnz, &a_save, &asub_save, &xa_save); + rhsb = doubleMalloc(m * nrhs); + bsav = doubleMalloc(m * nrhs); + solx = doubleMalloc(n * nrhs); + ldb = m; + ldx = n; + dCreate_Dense_Matrix(&B, m, nrhs, rhsb, ldb, SLU_DN, SLU_D, SLU_GE); + dCreate_Dense_Matrix(&X, n, nrhs, solx, ldx, SLU_DN, SLU_D, SLU_GE); + xact = doubleMalloc(n * nrhs); + etree = intMalloc(n); + perm_r = intMalloc(n); + perm_c = intMalloc(n); + pc_save = intMalloc(n); + R = (double *) SUPERLU_MALLOC(m*sizeof(double)); + C = (double *) SUPERLU_MALLOC(n*sizeof(double)); + ferr = (double *) SUPERLU_MALLOC(nrhs*sizeof(double)); + berr = (double *) SUPERLU_MALLOC(nrhs*sizeof(double)); + j = SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs); + rwork = (double *) SUPERLU_MALLOC(j*sizeof(double)); + for (i = 0; i < j; ++i) rwork[i] = 0.; + if ( !R ) ABORT("SUPERLU_MALLOC fails for R"); + if ( !C ) ABORT("SUPERLU_MALLOC fails for C"); + if ( !ferr ) ABORT("SUPERLU_MALLOC fails for ferr"); + if ( !berr ) ABORT("SUPERLU_MALLOC fails for berr"); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + wwork = doubleCalloc( SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs) ); + + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i] = i; + options.ColPerm = MY_PERMC; + + for (imat = fimat; imat <= nimat; ++imat) { /* All matrix types */ + + if ( imat ) { + + /* Skip types 5, 6, or 7 if the matrix size is too small. */ + zerot = (imat >= 5 && imat <= 7); + if ( zerot && n < imat-4 ) + continue; + + /* Set up parameters with DLATB4 and generate a test matrix + with DLATMS. */ + dlatb4_(path, &imat, &n, &n, sym, &kl, &ku, &anorm, &mode, + &cndnum, dist); + + dlatms_(&n, &n, dist, iseed, sym, &rwork[0], &mode, &cndnum, + &anorm, &kl, &ku, "No packing", Afull, &lda, + &wwork[0], &info); + + if ( info ) { + printf(FMT3, "DLATMS", info, izero, n, nrhs, imat, nfail); + continue; + } + + /* For types 5-7, zero one or more columns of the matrix + to test that INFO is returned correctly. */ + if ( zerot ) { + if ( imat == 5 ) izero = 1; + else if ( imat == 6 ) izero = n; + else izero = n / 2 + 1; + ioff = (izero - 1) * lda; + if ( imat < 7 ) { + for (i = 0; i < n; ++i) Afull[ioff + i] = zero; + } else { + for (j = 0; j < n - izero + 1; ++j) + for (i = 0; i < n; ++i) + Afull[ioff + i + j*lda] = zero; + } + } else { + izero = 0; + } + + /* Convert to sparse representation. */ + sp_dconvert(n, n, Afull, lda, kl, ku, a, asub, xa, &nnz); + + } else { + izero = 0; + zerot = 0; + } + + dCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_D, SLU_GE); + + /* Save a copy of matrix A in ASAV */ + dCreate_CompCol_Matrix(&ASAV, m, n, nnz, a_save, asub_save, xa_save, + SLU_NC, SLU_D, SLU_GE); + dCopy_CompCol_Matrix(&A, &ASAV); + + /* Form exact solution. */ + dGenXtrue(n, nrhs, xact, ldx); + + StatInit(&stat); + + for (iequed = 0; iequed < 4; ++iequed) { + *equed = equeds[iequed]; + if (iequed == 0) nfact = 4; + else nfact = 1; /* Only test factored, pre-equilibrated matrix */ + + for (ifact = 0; ifact < nfact; ++ifact) { + fact = facts[ifact]; + options.Fact = fact; + + for (equil = 0; equil < 2; ++equil) { + options.Equil = equil; + prefact = ( options.Fact == FACTORED || + options.Fact == SamePattern_SameRowPerm ); + /* Need a first factor */ + nofact = (options.Fact != FACTORED); /* Not factored */ + + /* Restore the matrix A. */ + dCopy_CompCol_Matrix(&ASAV, &A); + + if ( zerot ) { + if ( prefact ) continue; + } else if ( options.Fact == FACTORED ) { + if ( equil || iequed ) { + /* Compute row and column scale factors to + equilibrate matrix A. */ + dgsequ(&A, R, C, &rowcnd, &colcnd, &amax, &info); + + /* Force equilibration. */ + if ( !info && n > 0 ) { + if ( lsame_(equed, "R") ) { + rowcnd = 0.; + colcnd = 1.; + } else if ( lsame_(equed, "C") ) { + rowcnd = 1.; + colcnd = 0.; + } else if ( lsame_(equed, "B") ) { + rowcnd = 0.; + colcnd = 0.; + } + } + + /* Equilibrate the matrix. */ + dlaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + } + + if ( prefact ) { /* Need a factor for the first time */ + + /* Save Fact option. */ + fact = options.Fact; + options.Fact = DOFACT; + + /* Preorder the matrix, obtain the column etree. */ + sp_preorder(&options, &A, perm_c, etree, &AC); + + /* Factor the matrix AC. */ + dgstrf(&options, &AC, relax, panel_size, + etree, work, lwork, perm_c, perm_r, &L, &U, + &stat, &info); + + if ( info ) { + printf("** First factor: info %d, equed %c\n", + info, *equed); + if ( lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", + info - n); + exit(0); + } + } + + Destroy_CompCol_Permuted(&AC); + + /* Restore Fact option. */ + options.Fact = fact; + } /* if .. first time factor */ + + for (itran = 0; itran < NTRAN; ++itran) { + trans = transs[itran]; + options.Trans = trans; + + /* Restore the matrix A. */ + dCopy_CompCol_Matrix(&ASAV, &A); + + /* Set the right hand side. */ + dFillRHS(trans, nrhs, xact, ldx, &A, &B); + dCopy_Dense_Matrix(m, nrhs, rhsb, ldb, bsav, ldb); + + /*---------------- + * Test dgssv + *----------------*/ + if ( options.Fact == DOFACT && itran == 0) { + /* Not yet factored, and untransposed */ + + dCopy_Dense_Matrix(m, nrhs, rhsb, ldb, solx, ldx); + dgssv(&options, &A, perm_c, perm_r, &L, &U, &X, + &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "dgssv", + info, izero, n, nrhs, imat, nfail); + } else { + /* Reconstruct matrix from factors and + compute residual. */ + dgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + nt = 1; + if ( izero == 0 ) { + /* Compute residual of the computed + solution. */ + dCopy_Dense_Matrix(m, nrhs, rhsb, ldb, + wwork, ldb); + dgst02(trans, m, n, nrhs, &A, solx, + ldx, wwork,ldb, &result[1]); + nt = 2; + } + + /* Print information about the tests that + did not pass the threshold. */ + for (i = 0; i < nt; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT1, "dgssv", n, i, + result[i]); + ++nfail; + } + } + nrun += nt; + } /* else .. info == 0 */ + + /* Restore perm_c. */ + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i]; + + if (lwork == 0) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + } /* if .. end of testing dgssv */ + + /*---------------- + * Test dgssvx + *----------------*/ + + /* Equilibrate the matrix if fact = FACTORED and + equed = 'R', 'C', or 'B'. */ + if ( options.Fact == FACTORED && + (equil || iequed) && n > 0 ) { + dlaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + + /* Solve the system and compute the condition number + and error bounds using dgssvx. */ + dgssvx(&options, &A, perm_c, perm_r, etree, + equed, R, C, &L, &U, work, lwork, &B, &X, &rpg, + &rcond, ferr, berr, &mem_usage, &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "dgssvx", + info, izero, n, nrhs, imat, nfail); + if ( lwork == -1 ) { + printf("** Estimated memory: %.0f bytes\n", + mem_usage.total_needed); + exit(0); + } + } else { + if ( !prefact ) { + /* Reconstruct matrix from factors and + compute residual. */ + dgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + k1 = 0; + } else { + k1 = 1; + } + + if ( !info ) { + /* Compute residual of the computed solution.*/ + dCopy_Dense_Matrix(m, nrhs, bsav, ldb, + wwork, ldb); + dgst02(trans, m, n, nrhs, &ASAV, solx, ldx, + wwork, ldb, &result[1]); + + /* Check solution from generated exact + solution. */ + dgst04(n, nrhs, solx, ldx, xact, ldx, rcond, + &result[2]); + + /* Check the error bounds from iterative + refinement. */ + dgst07(trans, n, nrhs, &ASAV, bsav, ldb, + solx, ldx, xact, ldx, ferr, berr, + &result[3]); + + /* Print information about the tests that did + not pass the threshold. */ + for (i = k1; i < NTESTS; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT2, "dgssvx", + options.Fact, trans, *equed, + n, imat, i, result[i]); + ++nfail; + } + } + nrun += NTESTS; + } /* if .. info == 0 */ + } /* else .. end of testing dgssvx */ + + } /* for itran ... */ + + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + } /* for equil ... */ + } /* for ifact ... */ + } /* for iequed ... */ +#if 0 + if ( !info ) { + PrintPerf(&L, &U, &mem_usage, rpg, rcond, ferr, berr, equed); + } +#endif + + } /* for imat ... */ + + /* Print a summary of the results. */ + PrintSumm("DGE", nfail, nrun, nerrs); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (bsav); + SUPERLU_FREE (solx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (pc_save); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + SUPERLU_FREE (rwork); + SUPERLU_FREE (wwork); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + Destroy_CompCol_Matrix(&A); + Destroy_CompCol_Matrix(&ASAV); + if ( lwork > 0 ) { + SUPERLU_FREE (work); + Destroy_SuperMatrix_Store(&L); + Destroy_SuperMatrix_Store(&U); + } + StatFree(&stat); + + return 0; +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "ht:n:w:r:s:m:b:c:l:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-w - panel size\n"); + printf("\t-r - granularity of relaxed supernodes\n"); + exit(1); + break; + case 't': strcpy(matrix_type, optarg); + break; + case 'n': *n = atoi(optarg); + break; + case 'w': *w = atoi(optarg); + break; + case 'r': *relax = atoi(optarg); + break; + case 's': *nrhs = atoi(optarg); + break; + case 'm': *maxsuper = atoi(optarg); + break; + case 'b': *rowblk = atoi(optarg); + break; + case 'c': *colblk = atoi(optarg); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/dgst01.c b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst01.c new file mode 100644 index 0000000..a1477e0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst01.c @@ -0,0 +1,166 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_ddefs.h" + +int dgst01(int m, int n, SuperMatrix *A, SuperMatrix *L, + SuperMatrix *U, int *perm_c, int *perm_r, double *resid) +{ +/* + Purpose + ======= + + DGST01 reconstructs a matrix A from its L*U factorization and + computes the residual + norm(L*U - A) / ( N * norm(A) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========== + + M (input) INT + The number of rows of the matrix A. M >= 0. + + N (input) INT + The number of columns of the matrix A. N >= 0. + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original M x N matrix A. + + L (input) SuperMatrix *, dimension (L->nrow, L->ncol) + The factor matrix L. + + U (input) SuperMatrix *, dimension (U->nrow, U->ncol) + The factor matrix U. + + perm_c (input) INT array, dimension (N) + The column permutation from DGSTRF. + + perm_r (input) INT array, dimension (M) + The pivot indices from DGSTRF. + + RESID (output) DOUBLE* + norm(L*U - A) / ( N * norm(A) * EPS ) + + ===================================================================== +*/ + + /* Local variables */ + double zero = 0.0; + int i, j, k, arow, lptr,isub, urow, superno, fsupc, u_part; + double utemp, comp_temp; + double anorm, tnorm, cnorm; + double eps; + double *work; + SCformat *Lstore; + NCformat *Astore, *Ustore; + double *Aval, *Lval, *Uval; + int *colbeg, *colend; + + /* Function prototypes */ + extern double dlangs(char *, SuperMatrix *); + + /* Quick exit if M = 0 or N = 0. */ + + if (m <= 0 || n <= 0) { + *resid = 0.f; + return 0; + } + + work = (double *)doubleCalloc(m); + + Astore = A->Store; + Aval = Astore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + + /* Determine EPS and the norm of A. */ + eps = dlamch_("Epsilon"); + anorm = dlangs("1", A); + cnorm = 0.; + + /* Compute the product L*U, one column at a time */ + for (k = 0; k < n; ++k) { + + /* The U part outside the rectangular supernode */ + for (i = U_NZ_START(k); i < U_NZ_START(k+1); ++i) { + urow = U_SUB(i); + utemp = Uval[i]; + superno = Lstore->col_to_sup[urow]; + fsupc = L_FST_SUPC(superno); + u_part = urow - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)] -= utemp; /* L_ii = 1 */ + for (j = L_NZ_START(urow) + u_part; j < L_NZ_START(urow+1); ++j) { + isub = L_SUB(lptr); + work[isub] -= Lval[j] * utemp; + ++lptr; + } + } + + /* The U part inside the rectangular supernode */ + superno = Lstore->col_to_sup[k]; + fsupc = L_FST_SUPC(superno); + urow = L_NZ_START(k); + for (i = fsupc; i <= k; ++i) { + utemp = Lval[urow++]; + u_part = i - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)] -= utemp; /* L_ii = 1 */ + for (j = L_NZ_START(i)+u_part; j < L_NZ_START(i+1); ++j) { + isub = L_SUB(lptr); + work[isub] -= Lval[j] * utemp; + ++lptr; + } + } + + /* Now compute A[k] - (L*U)[k] (Both matrices may be permuted.) */ + + colbeg = intMalloc(n); + colend = intMalloc(n); + for (i = 0; i < n; i++) { + colbeg[perm_c[i]] = Astore->colptr[i]; + colend[perm_c[i]] = Astore->colptr[i+1]; + } + + for (i = colbeg[k]; i < colend[k]; ++i) { + arow = Astore->rowind[i]; + work[perm_r[arow]] += Aval[i]; + } + + /* Now compute the 1-norm of the column vector work */ + tnorm = 0.; + for (i = 0; i < m; ++i) { + tnorm += fabs(work[i]); + work[i] = zero; + } + cnorm = SUPERLU_MAX(tnorm, cnorm); + } + + *resid = cnorm; + + if (anorm <= 0.f) { + if (*resid != 0.f) { + *resid = 1.f / eps; + } + } else { + *resid = *resid / (float) n / anorm / eps; + } + + SUPERLU_FREE(work); + SUPERLU_FREE(colbeg); + SUPERLU_FREE(colend); + return 0; + +/* End of DGST01 */ + +} /* dgst01_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/dgst02.c b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst02.c new file mode 100644 index 0000000..2275fef --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst02.c @@ -0,0 +1,138 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_ddefs.h" + +int dgst02(trans_t trans, int m, int n, int nrhs, SuperMatrix *A, + double *x, int ldx, double *b, int ldb, double *resid) +{ +/* + Purpose + ======= + + DGST02 computes the residual for a solution of a system of linear + equations A*x = b or A'*x = b: + RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations: + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + NRHS (input) INTEGER + The number of columns of B, the matrix of right hand sides. + NRHS >= 0. + + A (input) SuperMatrix*, dimension (LDA,N) + The original M x N sparse matrix A. + + X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) + The computed solution vectors for the system of linear + equations. + + LDX (input) INTEGER + The leading dimension of the array X. If TRANS = NOTRANS, + LDX >= max(1,N); if TRANS = TRANS or CONJ, LDX >= max(1,M). + + B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side vectors for the system of + linear equations. + On exit, B is overwritten with the difference B - A*X. + + LDB (input) INTEGER + The leading dimension of the array B. IF TRANS = NOTRANS, + LDB >= max(1,M); if TRANS = TRANS or CONJ, LDB >= max(1,N). + + RESID (output) DOUBLE PRECISION + The maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ). + + ===================================================================== +*/ + + /* Table of constant values */ + double alpha = -1.; + double beta = 1.; + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2; + + /* Local variables */ + int j; + int n1, n2; + double anorm, bnorm; + double xnorm; + double eps; + char transc[1]; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern double dlangs(char *, SuperMatrix *); + extern double dasum_(int *, double *, int *); + + /* Function Body */ + if ( m <= 0 || n <= 0 || nrhs == 0) { + *resid = 0.; + return 0; + } + + if ( (trans == TRANS) || (trans == CONJ) ) { + n1 = n; + n2 = m; + *transc = 'T'; + } else { + n1 = m; + n2 = n; + *transc = 'N'; + } + + /* Exit with RESID = 1/EPS if ANORM = 0. */ + + eps = dlamch_("Epsilon"); + anorm = dlangs("1", A); + if (anorm <= 0.) { + *resid = 1. / eps; + return 0; + } + + /* Compute B - A*X (or B - A'*X ) and store in B. */ + + sp_dgemm(transc, "N", n1, nrhs, n2, alpha, A, x, ldx, beta, b, ldb); + + /* Compute the maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ) . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + bnorm = dasum_(&n1, &b[j*ldb], &c__1); + xnorm = dasum_(&n2, &x[j*ldx], &c__1); + if (xnorm <= 0.) { + *resid = 1. / eps; + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps; + *resid = SUPERLU_MAX(d__1, d__2); + } + } + + return 0; + +} /* dgst02 */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/dgst04.c b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst04.c new file mode 100644 index 0000000..11d2044 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst04.c @@ -0,0 +1,120 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_ddefs.h" + +int dgst04(int n, int nrhs, double *x, int ldx, double *xact, + int ldxact, double rcond, double *resid) +{ +/* + Purpose + ======= + + DGST04 computes the difference between a computed solution and the + true solution to a system of linear equations. + RESID = ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ), + where RCOND is the reciprocal of the condition number and EPS is the + machine epsilon. + + Arguments + ========= + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) DOUBLE PRECISION array, dimension( LDX, NRHS ) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + RCOND (input) DOUBLE PRECISION + The reciprocal of the condition number of the coefficient + matrix in the system of equations. + + RESID (output) DOUBLE PRECISION + The maximum over the NRHS solution vectors of + ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ) + + ===================================================================== +*/ + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2, d__3, d__4; + + /* Local variables */ + int i, j, n__1; + int ix; + double xnorm; + double eps; + double diffnm; + + /* Function prototypes */ + extern int idamax_(int *, double *, int *); + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + *resid = 0.; + return 0; + } + + /* Exit with RESID = 1/EPS if RCOND is invalid. */ + + eps = dlamch_("Epsilon"); + if ( rcond < 0. ) { + *resid = 1. / eps; + return 0; + } + + /* Compute the maximum of norm(X - XACT) / ( norm(XACT) * EPS ) + over all the vectors X and XACT . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + ix = idamax_(&n__1, &xact[j*ldxact], &c__1); + xnorm = (d__1 = xact[ix-1 + j*ldxact], fabs(d__1)); + + diffnm = 0.; + for (i = 0; i < n; ++i) { + /* Computing MAX */ + d__3 = diffnm; + d__4 = (d__1 = x[i+j*ldx]-xact[i+j*ldxact], fabs(d__1)); + diffnm = SUPERLU_MAX(d__3,d__4); + } + if (xnorm <= 0.) { + if (diffnm > 0.) { + *resid = 1. / eps; + } + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = diffnm / xnorm * rcond; + *resid = SUPERLU_MAX(d__1,d__2); + } + } + if (*resid * eps < 1.) { + *resid /= eps; + } + + return 0; + +} /* dgst04_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/dgst07.c b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst07.c new file mode 100644 index 0000000..0aa300d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/dgst07.c @@ -0,0 +1,218 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include +#include "slu_ddefs.h" + +int dgst07(trans_t trans, int n, int nrhs, SuperMatrix *A, double *b, + int ldb, double *x, int ldx, double *xact, + int ldxact, double *ferr, double *berr, double *reslts) +{ +/* + Purpose + ======= + + DGST07 tests the error bounds from iterative refinement for the + computed solution to a system of equations op(A)*X = B, where A is a + general n by n matrix and op(A) = A or A**T, depending on TRANS. + + RESLTS(1) = test of the error bound + = norm(X - XACT) / ( norm(X) * FERR ) + A large value is returned if this ratio is not less than one. + + RESLTS(2) = residual from the iterative refinement routine + = the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i ) + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations. + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original n by n matrix A. + + B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) + The right hand side vectors for the system of linear + equations. + + LDB (input) INT + The leading dimension of the array B. LDB >= max(1,N). + + X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) DOUBLE PRECISION array, dimension (LDX,NRHS) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + + FERR (input) DOUBLE PRECISION array, dimension (NRHS) + The estimated forward error bounds for each solution vector + X. If XTRUE is the true solution, FERR bounds the magnitude + of the largest entry in (X - XTRUE) divided by the magnitude + of the largest entry in X. + + BERR (input) DOUBLE PRECISION array, dimension (NRHS) + The componentwise relative backward error of each solution + vector (i.e., the smallest relative change in any entry of A + + or B that makes X an exact solution). + + RESLTS (output) DOUBLE PRECISION array, dimension (2) + The maximum over the NRHS solution vectors of the ratios: + RESLTS(1) = norm(X - XACT) / ( norm(X) * FERR ) + RESLTS(2) = BERR / ( (n+1)*EPS + (*) ) + + ===================================================================== +*/ + + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2; + + /* Local variables */ + double diff, axbi; + int imax, irow, n__1; + int i, j, k; + double unfl, ovfl; + double xnorm; + double errbnd; + int notran; + double eps, tmp; + double *rwork; + double *Aval; + NCformat *Astore; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern int idamax_(int *, double *, int *); + + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + reslts[0] = 0.; + reslts[1] = 0.; + return 0; + } + + eps = dlamch_("Epsilon"); + unfl = dlamch_("Safe minimum"); + ovfl = 1. / unfl; + notran = (trans == NOTRANS); + + rwork = (double *) SUPERLU_MALLOC(n*sizeof(double)); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + Astore = A->Store; + Aval = (double *) Astore->nzval; + + /* Test 1: Compute the maximum of + norm(X - XACT) / ( norm(X) * FERR ) + over all the vectors X and XACT using the infinity-norm. */ + + errbnd = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + imax = idamax_(&n__1, &x[j*ldx], &c__1); + d__1 = fabs(x[imax-1 + j*ldx]); + xnorm = SUPERLU_MAX(d__1,unfl); + diff = 0.; + for (i = 0; i < n; ++i) { + d__1 = fabs(x[i+j*ldx] - xact[i+j*ldxact]); + diff = SUPERLU_MAX(diff, d__1); + } + + if (xnorm > 1.) { + goto L20; + } else if (diff <= ovfl * xnorm) { + goto L20; + } else { + errbnd = 1. / eps; + goto L30; + } + +L20: +#if 0 + if (diff / xnorm <= ferr[j]) { + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + } else { + errbnd = 1. / eps; + } +#endif + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + /*printf("Ferr: %f\n", errbnd);*/ +L30: + ; + } + reslts[0] = errbnd; + + /* Test 2: Compute the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) + abs(b))_i ) */ + + for (k = 0; k < nrhs; ++k) { + for (i = 0; i < n; ++i) + rwork[i] = fabs( b[i + k*ldb] ); + if ( notran ) { + for (j = 0; j < n; ++j) { + tmp = fabs( x[j + k*ldx] ); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + rwork[Astore->rowind[i]] += fabs(Aval[i]) * tmp; + } + } + } else { + for (j = 0; j < n; ++j) { + tmp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + d__1 = fabs( x[irow + k*ldx] ); + tmp += fabs(Aval[i]) * d__1; + } + rwork[j] += tmp; + } + } + + axbi = rwork[0]; + for (i = 1; i < n; ++i) axbi = SUPERLU_MIN(axbi, rwork[i]); + + /* Computing MAX */ + d__1 = axbi, d__2 = (n + 1) * unfl; + tmp = berr[k] / ((n + 1) * eps + (n + 1) * unfl / SUPERLU_MAX(d__1,d__2)); + + if (k == 0) { + reslts[1] = tmp; + } else { + reslts[1] = SUPERLU_MAX(reslts[1],tmp); + } + } + + SUPERLU_FREE(rwork); + return 0; + +} /* dgst07 */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/dtest.csh b/thirdparty/superlu/SuperLU_4.1/TESTING/dtest.csh new file mode 100644 index 0000000..085ca43 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/dtest.csh @@ -0,0 +1,49 @@ +#!/bin/csh + +set ofile = dtest.out # output file +if ( -e $ofile ) then + rm -f $ofile +endif +echo "Double-precision testing output" > $ofile + +set MATRICES = (LAPACK g10) +set NVAL = (9 19) +set NRHS = (5) +set LWORK = (0 10000000) + +# +# Loop through all matrices ... +# +foreach m ($MATRICES) + + #-------------------------------------------- + # Test matrix types generated in LAPACK-style + #-------------------------------------------- + if ($m == 'LAPACK') then + echo '== LAPACK test matrices' >> $ofile + foreach n ($NVAL) + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'n='$n 'nrhs='$s 'lwork='$l >> $ofile + ./dtest -t "LA" -l $l -n $n -s $s >> $ofile + end + end + end + #-------------------------------------------- + # Test a specified sparse matrix + #-------------------------------------------- + else + echo '' >> $ofile + echo '== sparse matrix:' $m >> $ofile + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'nrhs='$s 'lwork='$l >> $ofile + ./dtest -t "SP" -s $s -l $l < ../EXAMPLE/$m >> $ofile + end + end + endif + +end + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sdrive.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sdrive.c new file mode 100644 index 0000000..d44ff4b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sdrive.c @@ -0,0 +1,544 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +/* + * File name: sdrive.c + * Purpose: MAIN test program + */ +#include +#include "slu_sdefs.h" + +#define NTESTS 5 /* Number of test types */ +#define NTYPES 11 /* Number of matrix types */ +#define NTRAN 2 +#define THRESH 20.0 +#define FMT1 "%10s:n=%d, test(%d)=%12.5g\n" +#define FMT2 "%10s:fact=%4d, trans=%4d, equed=%c, n=%d, imat=%d, test(%d)=%12.5g\n" +#define FMT3 "%10s:info=%d, izero=%d, n=%d, nrhs=%d, imat=%d, nfail=%d\n" + +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u); + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * SDRIVE is the main test program for the FLOAT linear + * equation driver routines SGSSV and SGSSVX. + * + * The program is invoked by a shell script file -- stest.csh. + * The output from the tests are written into a file -- stest.out. + * + * ===================================================================== + */ + float *a, *a_save; + int *asub, *asub_save; + int *xa, *xa_save; + SuperMatrix A, B, X, L, U; + SuperMatrix ASAV, AC; + mem_usage_t mem_usage; + int *perm_r; /* row permutation from partial pivoting */ + int *perm_c, *pc_save; /* column permutation */ + int *etree; + float zero = 0.0; + float *R, *C; + float *ferr, *berr; + float *rwork; + float *wwork; + void *work; + int info, lwork, nrhs, panel_size, relax; + int m, n, nnz; + float *xact; + float *rhsb, *solx, *bsav; + int ldb, ldx; + float rpg, rcond; + int i, j, k1; + float rowcnd, colcnd, amax; + int maxsuper, rowblk, colblk; + int prefact, nofact, equil, iequed; + int nt, nrun, nfail, nerrs, imat, fimat, nimat; + int nfact, ifact, itran; + int kl, ku, mode, lda; + int zerot, izero, ioff; + double u; + float anorm, cndnum; + float *Afull; + float result[NTESTS]; + superlu_options_t options; + fact_t fact; + trans_t trans; + SuperLUStat_t stat; + static char matrix_type[8]; + static char equed[1], path[4], sym[1], dist[1]; + + /* Fixed set of parameters */ + int iseed[] = {1988, 1989, 1990, 1991}; + static char equeds[] = {'N', 'R', 'C', 'B'}; + static fact_t facts[] = {FACTORED, DOFACT, SamePattern, + SamePattern_SameRowPerm}; + static trans_t transs[] = {NOTRANS, TRANS, CONJ}; + + /* Some function prototypes */ + extern int sgst01(int, int, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, float *); + extern int sgst02(trans_t, int, int, int, SuperMatrix *, float *, + int, float *, int, float *resid); + extern int sgst04(int, int, float *, int, + float *, int, float rcond, float *resid); + extern int sgst07(trans_t, int, int, SuperMatrix *, float *, int, + float *, int, float *, int, + float *, float *, float *); + extern int slatb4_(char *, int *, int *, int *, char *, int *, int *, + float *, int *, float *, char *); + extern int slatms_(int *, int *, char *, int *, char *, float *d, + int *, float *, float *, int *, int *, + char *, float *, int *, float *, int *); + extern int sp_sconvert(int, int, float *, int, int, int, + float *a, int *, int *, int *); + + + /* Executable statements */ + + strcpy(path, "SGE"); + nrun = 0; + nfail = 0; + nerrs = 0; + + /* Defaults */ + lwork = 0; + n = 1; + nrhs = 1; + panel_size = sp_ienv(1); + relax = sp_ienv(2); + u = 1.0; + strcpy(matrix_type, "LA"); + parse_command_line(argc, argv, matrix_type, &n, + &panel_size, &relax, &nrhs, &maxsuper, + &rowblk, &colblk, &lwork, &u); + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + fprintf(stderr, "expert: cannot allocate %d bytes\n", lwork); + exit (-1); + } + } + + /* Set the default input options. */ + set_default_options(&options); + options.DiagPivotThresh = u; + options.PrintStat = NO; + options.PivotGrowth = YES; + options.ConditionNumber = YES; + options.IterRefine = SINGLE; + + if ( strcmp(matrix_type, "LA") == 0 ) { + /* Test LAPACK matrix suite. */ + m = n; + lda = SUPERLU_MAX(n, 1); + nnz = n * n; /* upper bound */ + fimat = 1; + nimat = NTYPES; + Afull = floatCalloc(lda * n); + sallocateA(n, nnz, &a, &asub, &xa); + } else { + /* Read a sparse matrix */ + fimat = nimat = 0; + sreadhb(&m, &n, &nnz, &a, &asub, &xa); + } + + sallocateA(n, nnz, &a_save, &asub_save, &xa_save); + rhsb = floatMalloc(m * nrhs); + bsav = floatMalloc(m * nrhs); + solx = floatMalloc(n * nrhs); + ldb = m; + ldx = n; + sCreate_Dense_Matrix(&B, m, nrhs, rhsb, ldb, SLU_DN, SLU_S, SLU_GE); + sCreate_Dense_Matrix(&X, n, nrhs, solx, ldx, SLU_DN, SLU_S, SLU_GE); + xact = floatMalloc(n * nrhs); + etree = intMalloc(n); + perm_r = intMalloc(n); + perm_c = intMalloc(n); + pc_save = intMalloc(n); + R = (float *) SUPERLU_MALLOC(m*sizeof(float)); + C = (float *) SUPERLU_MALLOC(n*sizeof(float)); + ferr = (float *) SUPERLU_MALLOC(nrhs*sizeof(float)); + berr = (float *) SUPERLU_MALLOC(nrhs*sizeof(float)); + j = SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs); + rwork = (float *) SUPERLU_MALLOC(j*sizeof(float)); + for (i = 0; i < j; ++i) rwork[i] = 0.; + if ( !R ) ABORT("SUPERLU_MALLOC fails for R"); + if ( !C ) ABORT("SUPERLU_MALLOC fails for C"); + if ( !ferr ) ABORT("SUPERLU_MALLOC fails for ferr"); + if ( !berr ) ABORT("SUPERLU_MALLOC fails for berr"); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + wwork = floatCalloc( SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs) ); + + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i] = i; + options.ColPerm = MY_PERMC; + + for (imat = fimat; imat <= nimat; ++imat) { /* All matrix types */ + + if ( imat ) { + + /* Skip types 5, 6, or 7 if the matrix size is too small. */ + zerot = (imat >= 5 && imat <= 7); + if ( zerot && n < imat-4 ) + continue; + + /* Set up parameters with SLATB4 and generate a test matrix + with SLATMS. */ + slatb4_(path, &imat, &n, &n, sym, &kl, &ku, &anorm, &mode, + &cndnum, dist); + + slatms_(&n, &n, dist, iseed, sym, &rwork[0], &mode, &cndnum, + &anorm, &kl, &ku, "No packing", Afull, &lda, + &wwork[0], &info); + + if ( info ) { + printf(FMT3, "SLATMS", info, izero, n, nrhs, imat, nfail); + continue; + } + + /* For types 5-7, zero one or more columns of the matrix + to test that INFO is returned correctly. */ + if ( zerot ) { + if ( imat == 5 ) izero = 1; + else if ( imat == 6 ) izero = n; + else izero = n / 2 + 1; + ioff = (izero - 1) * lda; + if ( imat < 7 ) { + for (i = 0; i < n; ++i) Afull[ioff + i] = zero; + } else { + for (j = 0; j < n - izero + 1; ++j) + for (i = 0; i < n; ++i) + Afull[ioff + i + j*lda] = zero; + } + } else { + izero = 0; + } + + /* Convert to sparse representation. */ + sp_sconvert(n, n, Afull, lda, kl, ku, a, asub, xa, &nnz); + + } else { + izero = 0; + zerot = 0; + } + + sCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_S, SLU_GE); + + /* Save a copy of matrix A in ASAV */ + sCreate_CompCol_Matrix(&ASAV, m, n, nnz, a_save, asub_save, xa_save, + SLU_NC, SLU_S, SLU_GE); + sCopy_CompCol_Matrix(&A, &ASAV); + + /* Form exact solution. */ + sGenXtrue(n, nrhs, xact, ldx); + + StatInit(&stat); + + for (iequed = 0; iequed < 4; ++iequed) { + *equed = equeds[iequed]; + if (iequed == 0) nfact = 4; + else nfact = 1; /* Only test factored, pre-equilibrated matrix */ + + for (ifact = 0; ifact < nfact; ++ifact) { + fact = facts[ifact]; + options.Fact = fact; + + for (equil = 0; equil < 2; ++equil) { + options.Equil = equil; + prefact = ( options.Fact == FACTORED || + options.Fact == SamePattern_SameRowPerm ); + /* Need a first factor */ + nofact = (options.Fact != FACTORED); /* Not factored */ + + /* Restore the matrix A. */ + sCopy_CompCol_Matrix(&ASAV, &A); + + if ( zerot ) { + if ( prefact ) continue; + } else if ( options.Fact == FACTORED ) { + if ( equil || iequed ) { + /* Compute row and column scale factors to + equilibrate matrix A. */ + sgsequ(&A, R, C, &rowcnd, &colcnd, &amax, &info); + + /* Force equilibration. */ + if ( !info && n > 0 ) { + if ( lsame_(equed, "R") ) { + rowcnd = 0.; + colcnd = 1.; + } else if ( lsame_(equed, "C") ) { + rowcnd = 1.; + colcnd = 0.; + } else if ( lsame_(equed, "B") ) { + rowcnd = 0.; + colcnd = 0.; + } + } + + /* Equilibrate the matrix. */ + slaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + } + + if ( prefact ) { /* Need a factor for the first time */ + + /* Save Fact option. */ + fact = options.Fact; + options.Fact = DOFACT; + + /* Preorder the matrix, obtain the column etree. */ + sp_preorder(&options, &A, perm_c, etree, &AC); + + /* Factor the matrix AC. */ + sgstrf(&options, &AC, relax, panel_size, + etree, work, lwork, perm_c, perm_r, &L, &U, + &stat, &info); + + if ( info ) { + printf("** First factor: info %d, equed %c\n", + info, *equed); + if ( lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", + info - n); + exit(0); + } + } + + Destroy_CompCol_Permuted(&AC); + + /* Restore Fact option. */ + options.Fact = fact; + } /* if .. first time factor */ + + for (itran = 0; itran < NTRAN; ++itran) { + trans = transs[itran]; + options.Trans = trans; + + /* Restore the matrix A. */ + sCopy_CompCol_Matrix(&ASAV, &A); + + /* Set the right hand side. */ + sFillRHS(trans, nrhs, xact, ldx, &A, &B); + sCopy_Dense_Matrix(m, nrhs, rhsb, ldb, bsav, ldb); + + /*---------------- + * Test sgssv + *----------------*/ + if ( options.Fact == DOFACT && itran == 0) { + /* Not yet factored, and untransposed */ + + sCopy_Dense_Matrix(m, nrhs, rhsb, ldb, solx, ldx); + sgssv(&options, &A, perm_c, perm_r, &L, &U, &X, + &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "sgssv", + info, izero, n, nrhs, imat, nfail); + } else { + /* Reconstruct matrix from factors and + compute residual. */ + sgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + nt = 1; + if ( izero == 0 ) { + /* Compute residual of the computed + solution. */ + sCopy_Dense_Matrix(m, nrhs, rhsb, ldb, + wwork, ldb); + sgst02(trans, m, n, nrhs, &A, solx, + ldx, wwork,ldb, &result[1]); + nt = 2; + } + + /* Print information about the tests that + did not pass the threshold. */ + for (i = 0; i < nt; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT1, "sgssv", n, i, + result[i]); + ++nfail; + } + } + nrun += nt; + } /* else .. info == 0 */ + + /* Restore perm_c. */ + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i]; + + if (lwork == 0) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + } /* if .. end of testing sgssv */ + + /*---------------- + * Test sgssvx + *----------------*/ + + /* Equilibrate the matrix if fact = FACTORED and + equed = 'R', 'C', or 'B'. */ + if ( options.Fact == FACTORED && + (equil || iequed) && n > 0 ) { + slaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + + /* Solve the system and compute the condition number + and error bounds using sgssvx. */ + sgssvx(&options, &A, perm_c, perm_r, etree, + equed, R, C, &L, &U, work, lwork, &B, &X, &rpg, + &rcond, ferr, berr, &mem_usage, &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "sgssvx", + info, izero, n, nrhs, imat, nfail); + if ( lwork == -1 ) { + printf("** Estimated memory: %.0f bytes\n", + mem_usage.total_needed); + exit(0); + } + } else { + if ( !prefact ) { + /* Reconstruct matrix from factors and + compute residual. */ + sgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + k1 = 0; + } else { + k1 = 1; + } + + if ( !info ) { + /* Compute residual of the computed solution.*/ + sCopy_Dense_Matrix(m, nrhs, bsav, ldb, + wwork, ldb); + sgst02(trans, m, n, nrhs, &ASAV, solx, ldx, + wwork, ldb, &result[1]); + + /* Check solution from generated exact + solution. */ + sgst04(n, nrhs, solx, ldx, xact, ldx, rcond, + &result[2]); + + /* Check the error bounds from iterative + refinement. */ + sgst07(trans, n, nrhs, &ASAV, bsav, ldb, + solx, ldx, xact, ldx, ferr, berr, + &result[3]); + + /* Print information about the tests that did + not pass the threshold. */ + for (i = k1; i < NTESTS; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT2, "sgssvx", + options.Fact, trans, *equed, + n, imat, i, result[i]); + ++nfail; + } + } + nrun += NTESTS; + } /* if .. info == 0 */ + } /* else .. end of testing sgssvx */ + + } /* for itran ... */ + + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + } /* for equil ... */ + } /* for ifact ... */ + } /* for iequed ... */ +#if 0 + if ( !info ) { + PrintPerf(&L, &U, &mem_usage, rpg, rcond, ferr, berr, equed); + } +#endif + + } /* for imat ... */ + + /* Print a summary of the results. */ + PrintSumm("SGE", nfail, nrun, nerrs); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (bsav); + SUPERLU_FREE (solx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (pc_save); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + SUPERLU_FREE (rwork); + SUPERLU_FREE (wwork); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + Destroy_CompCol_Matrix(&A); + Destroy_CompCol_Matrix(&ASAV); + if ( lwork > 0 ) { + SUPERLU_FREE (work); + Destroy_SuperMatrix_Store(&L); + Destroy_SuperMatrix_Store(&U); + } + StatFree(&stat); + + return 0; +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "ht:n:w:r:s:m:b:c:l:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-w - panel size\n"); + printf("\t-r - granularity of relaxed supernodes\n"); + exit(1); + break; + case 't': strcpy(matrix_type, optarg); + break; + case 'n': *n = atoi(optarg); + break; + case 'w': *w = atoi(optarg); + break; + case 'r': *relax = atoi(optarg); + break; + case 's': *nrhs = atoi(optarg); + break; + case 'm': *maxsuper = atoi(optarg); + break; + case 'b': *rowblk = atoi(optarg); + break; + case 'c': *colblk = atoi(optarg); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sgst01.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst01.c new file mode 100644 index 0000000..1930d01 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst01.c @@ -0,0 +1,166 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_sdefs.h" + +int sgst01(int m, int n, SuperMatrix *A, SuperMatrix *L, + SuperMatrix *U, int *perm_c, int *perm_r, float *resid) +{ +/* + Purpose + ======= + + SGST01 reconstructs a matrix A from its L*U factorization and + computes the residual + norm(L*U - A) / ( N * norm(A) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========== + + M (input) INT + The number of rows of the matrix A. M >= 0. + + N (input) INT + The number of columns of the matrix A. N >= 0. + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original M x N matrix A. + + L (input) SuperMatrix *, dimension (L->nrow, L->ncol) + The factor matrix L. + + U (input) SuperMatrix *, dimension (U->nrow, U->ncol) + The factor matrix U. + + perm_c (input) INT array, dimension (N) + The column permutation from SGSTRF. + + perm_r (input) INT array, dimension (M) + The pivot indices from SGSTRF. + + RESID (output) FLOAT* + norm(L*U - A) / ( N * norm(A) * EPS ) + + ===================================================================== +*/ + + /* Local variables */ + float zero = 0.0; + int i, j, k, arow, lptr,isub, urow, superno, fsupc, u_part; + float utemp, comp_temp; + float anorm, tnorm, cnorm; + float eps; + float *work; + SCformat *Lstore; + NCformat *Astore, *Ustore; + float *Aval, *Lval, *Uval; + int *colbeg, *colend; + + /* Function prototypes */ + extern float slangs(char *, SuperMatrix *); + + /* Quick exit if M = 0 or N = 0. */ + + if (m <= 0 || n <= 0) { + *resid = 0.f; + return 0; + } + + work = (float *)floatCalloc(m); + + Astore = A->Store; + Aval = Astore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + + /* Determine EPS and the norm of A. */ + eps = slamch_("Epsilon"); + anorm = slangs("1", A); + cnorm = 0.; + + /* Compute the product L*U, one column at a time */ + for (k = 0; k < n; ++k) { + + /* The U part outside the rectangular supernode */ + for (i = U_NZ_START(k); i < U_NZ_START(k+1); ++i) { + urow = U_SUB(i); + utemp = Uval[i]; + superno = Lstore->col_to_sup[urow]; + fsupc = L_FST_SUPC(superno); + u_part = urow - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)] -= utemp; /* L_ii = 1 */ + for (j = L_NZ_START(urow) + u_part; j < L_NZ_START(urow+1); ++j) { + isub = L_SUB(lptr); + work[isub] -= Lval[j] * utemp; + ++lptr; + } + } + + /* The U part inside the rectangular supernode */ + superno = Lstore->col_to_sup[k]; + fsupc = L_FST_SUPC(superno); + urow = L_NZ_START(k); + for (i = fsupc; i <= k; ++i) { + utemp = Lval[urow++]; + u_part = i - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)] -= utemp; /* L_ii = 1 */ + for (j = L_NZ_START(i)+u_part; j < L_NZ_START(i+1); ++j) { + isub = L_SUB(lptr); + work[isub] -= Lval[j] * utemp; + ++lptr; + } + } + + /* Now compute A[k] - (L*U)[k] (Both matrices may be permuted.) */ + + colbeg = intMalloc(n); + colend = intMalloc(n); + for (i = 0; i < n; i++) { + colbeg[perm_c[i]] = Astore->colptr[i]; + colend[perm_c[i]] = Astore->colptr[i+1]; + } + + for (i = colbeg[k]; i < colend[k]; ++i) { + arow = Astore->rowind[i]; + work[perm_r[arow]] += Aval[i]; + } + + /* Now compute the 1-norm of the column vector work */ + tnorm = 0.; + for (i = 0; i < m; ++i) { + tnorm += fabs(work[i]); + work[i] = zero; + } + cnorm = SUPERLU_MAX(tnorm, cnorm); + } + + *resid = cnorm; + + if (anorm <= 0.f) { + if (*resid != 0.f) { + *resid = 1.f / eps; + } + } else { + *resid = *resid / (float) n / anorm / eps; + } + + SUPERLU_FREE(work); + SUPERLU_FREE(colbeg); + SUPERLU_FREE(colend); + return 0; + +/* End of SGST01 */ + +} /* sgst01_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sgst02.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst02.c new file mode 100644 index 0000000..f518e21 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst02.c @@ -0,0 +1,138 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_sdefs.h" + +int sgst02(trans_t trans, int m, int n, int nrhs, SuperMatrix *A, + float *x, int ldx, float *b, int ldb, float *resid) +{ +/* + Purpose + ======= + + SGST02 computes the residual for a solution of a system of linear + equations A*x = b or A'*x = b: + RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations: + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + NRHS (input) INTEGER + The number of columns of B, the matrix of right hand sides. + NRHS >= 0. + + A (input) SuperMatrix*, dimension (LDA,N) + The original M x N sparse matrix A. + + X (input) FLOAT PRECISION array, dimension (LDX,NRHS) + The computed solution vectors for the system of linear + equations. + + LDX (input) INTEGER + The leading dimension of the array X. If TRANS = NOTRANS, + LDX >= max(1,N); if TRANS = TRANS or CONJ, LDX >= max(1,M). + + B (input/output) FLOAT PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side vectors for the system of + linear equations. + On exit, B is overwritten with the difference B - A*X. + + LDB (input) INTEGER + The leading dimension of the array B. IF TRANS = NOTRANS, + LDB >= max(1,M); if TRANS = TRANS or CONJ, LDB >= max(1,N). + + RESID (output) FLOAT PRECISION + The maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ). + + ===================================================================== +*/ + + /* Table of constant values */ + float alpha = -1.; + float beta = 1.; + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2; + + /* Local variables */ + int j; + int n1, n2; + float anorm, bnorm; + float xnorm; + float eps; + char transc[1]; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern float slangs(char *, SuperMatrix *); + extern float sasum_(int *, float *, int *); + + /* Function Body */ + if ( m <= 0 || n <= 0 || nrhs == 0) { + *resid = 0.; + return 0; + } + + if ( (trans == TRANS) || (trans == CONJ) ) { + n1 = n; + n2 = m; + *transc = 'T'; + } else { + n1 = m; + n2 = n; + *transc = 'N'; + } + + /* Exit with RESID = 1/EPS if ANORM = 0. */ + + eps = slamch_("Epsilon"); + anorm = slangs("1", A); + if (anorm <= 0.) { + *resid = 1. / eps; + return 0; + } + + /* Compute B - A*X (or B - A'*X ) and store in B. */ + + sp_sgemm(transc, "N", n1, nrhs, n2, alpha, A, x, ldx, beta, b, ldb); + + /* Compute the maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ) . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + bnorm = sasum_(&n1, &b[j*ldb], &c__1); + xnorm = sasum_(&n2, &x[j*ldx], &c__1); + if (xnorm <= 0.) { + *resid = 1. / eps; + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps; + *resid = SUPERLU_MAX(d__1, d__2); + } + } + + return 0; + +} /* sgst02 */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sgst04.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst04.c new file mode 100644 index 0000000..d7c46c7 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst04.c @@ -0,0 +1,120 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_sdefs.h" + +int sgst04(int n, int nrhs, float *x, int ldx, float *xact, + int ldxact, float rcond, float *resid) +{ +/* + Purpose + ======= + + SGST04 computes the difference between a computed solution and the + true solution to a system of linear equations. + RESID = ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ), + where RCOND is the reciprocal of the condition number and EPS is the + machine epsilon. + + Arguments + ========= + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + X (input) FLOAT PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) FLOAT PRECISION array, dimension( LDX, NRHS ) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + RCOND (input) FLOAT PRECISION + The reciprocal of the condition number of the coefficient + matrix in the system of equations. + + RESID (output) FLOAT PRECISION + The maximum over the NRHS solution vectors of + ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ) + + ===================================================================== +*/ + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2, d__3, d__4; + + /* Local variables */ + int i, j, n__1; + int ix; + float xnorm; + float eps; + float diffnm; + + /* Function prototypes */ + extern int isamax_(int *, float *, int *); + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + *resid = 0.; + return 0; + } + + /* Exit with RESID = 1/EPS if RCOND is invalid. */ + + eps = slamch_("Epsilon"); + if ( rcond < 0. ) { + *resid = 1. / eps; + return 0; + } + + /* Compute the maximum of norm(X - XACT) / ( norm(XACT) * EPS ) + over all the vectors X and XACT . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + ix = isamax_(&n__1, &xact[j*ldxact], &c__1); + xnorm = (d__1 = xact[ix-1 + j*ldxact], fabs(d__1)); + + diffnm = 0.; + for (i = 0; i < n; ++i) { + /* Computing MAX */ + d__3 = diffnm; + d__4 = (d__1 = x[i+j*ldx]-xact[i+j*ldxact], fabs(d__1)); + diffnm = SUPERLU_MAX(d__3,d__4); + } + if (xnorm <= 0.) { + if (diffnm > 0.) { + *resid = 1. / eps; + } + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = diffnm / xnorm * rcond; + *resid = SUPERLU_MAX(d__1,d__2); + } + } + if (*resid * eps < 1.) { + *resid /= eps; + } + + return 0; + +} /* sgst04_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sgst07.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst07.c new file mode 100644 index 0000000..8317999 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sgst07.c @@ -0,0 +1,218 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include +#include "slu_sdefs.h" + +int sgst07(trans_t trans, int n, int nrhs, SuperMatrix *A, float *b, + int ldb, float *x, int ldx, float *xact, + int ldxact, float *ferr, float *berr, float *reslts) +{ +/* + Purpose + ======= + + SGST07 tests the error bounds from iterative refinement for the + computed solution to a system of equations op(A)*X = B, where A is a + general n by n matrix and op(A) = A or A**T, depending on TRANS. + + RESLTS(1) = test of the error bound + = norm(X - XACT) / ( norm(X) * FERR ) + A large value is returned if this ratio is not less than one. + + RESLTS(2) = residual from the iterative refinement routine + = the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i ) + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations. + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original n by n matrix A. + + B (input) FLOAT PRECISION array, dimension (LDB,NRHS) + The right hand side vectors for the system of linear + equations. + + LDB (input) INT + The leading dimension of the array B. LDB >= max(1,N). + + X (input) FLOAT PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) FLOAT PRECISION array, dimension (LDX,NRHS) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + + FERR (input) FLOAT PRECISION array, dimension (NRHS) + The estimated forward error bounds for each solution vector + X. If XTRUE is the true solution, FERR bounds the magnitude + of the largest entry in (X - XTRUE) divided by the magnitude + of the largest entry in X. + + BERR (input) FLOAT PRECISION array, dimension (NRHS) + The componentwise relative backward error of each solution + vector (i.e., the smallest relative change in any entry of A + + or B that makes X an exact solution). + + RESLTS (output) FLOAT PRECISION array, dimension (2) + The maximum over the NRHS solution vectors of the ratios: + RESLTS(1) = norm(X - XACT) / ( norm(X) * FERR ) + RESLTS(2) = BERR / ( (n+1)*EPS + (*) ) + + ===================================================================== +*/ + + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + float d__1, d__2; + + /* Local variables */ + float diff, axbi; + int imax, irow, n__1; + int i, j, k; + float unfl, ovfl; + float xnorm; + float errbnd; + int notran; + float eps, tmp; + float *rwork; + float *Aval; + NCformat *Astore; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern int isamax_(int *, float *, int *); + + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + reslts[0] = 0.; + reslts[1] = 0.; + return 0; + } + + eps = slamch_("Epsilon"); + unfl = slamch_("Safe minimum"); + ovfl = 1. / unfl; + notran = (trans == NOTRANS); + + rwork = (float *) SUPERLU_MALLOC(n*sizeof(float)); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + Astore = A->Store; + Aval = (float *) Astore->nzval; + + /* Test 1: Compute the maximum of + norm(X - XACT) / ( norm(X) * FERR ) + over all the vectors X and XACT using the infinity-norm. */ + + errbnd = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + imax = isamax_(&n__1, &x[j*ldx], &c__1); + d__1 = fabs(x[imax-1 + j*ldx]); + xnorm = SUPERLU_MAX(d__1,unfl); + diff = 0.; + for (i = 0; i < n; ++i) { + d__1 = fabs(x[i+j*ldx] - xact[i+j*ldxact]); + diff = SUPERLU_MAX(diff, d__1); + } + + if (xnorm > 1.) { + goto L20; + } else if (diff <= ovfl * xnorm) { + goto L20; + } else { + errbnd = 1. / eps; + goto L30; + } + +L20: +#if 0 + if (diff / xnorm <= ferr[j]) { + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + } else { + errbnd = 1. / eps; + } +#endif + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + /*printf("Ferr: %f\n", errbnd);*/ +L30: + ; + } + reslts[0] = errbnd; + + /* Test 2: Compute the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) + abs(b))_i ) */ + + for (k = 0; k < nrhs; ++k) { + for (i = 0; i < n; ++i) + rwork[i] = fabs( b[i + k*ldb] ); + if ( notran ) { + for (j = 0; j < n; ++j) { + tmp = fabs( x[j + k*ldx] ); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + rwork[Astore->rowind[i]] += fabs(Aval[i]) * tmp; + } + } + } else { + for (j = 0; j < n; ++j) { + tmp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + d__1 = fabs( x[irow + k*ldx] ); + tmp += fabs(Aval[i]) * d__1; + } + rwork[j] += tmp; + } + } + + axbi = rwork[0]; + for (i = 1; i < n; ++i) axbi = SUPERLU_MIN(axbi, rwork[i]); + + /* Computing MAX */ + d__1 = axbi, d__2 = (n + 1) * unfl; + tmp = berr[k] / ((n + 1) * eps + (n + 1) * unfl / SUPERLU_MAX(d__1,d__2)); + + if (k == 0) { + reslts[1] = tmp; + } else { + reslts[1] = SUPERLU_MAX(reslts[1],tmp); + } + } + + SUPERLU_FREE(rwork); + return 0; + +} /* sgst07 */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sp_cconvert.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_cconvert.c new file mode 100644 index 0000000..243400d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_cconvert.c @@ -0,0 +1,42 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ + +#include "slu_cdefs.h" + +/* + * Convert a full matrix into a sparse matrix format. + */ +int +sp_cconvert(int m, int n, complex *A, int lda, int kl, int ku, + complex *a, int *asub, int *xa, int *nnz) +{ + int lasta = 0; + int i, j, ilow, ihigh; + int *row; + complex *val; + + for (j = 0; j < n; ++j) { + xa[j] = lasta; + val = &a[xa[j]]; + row = &asub[xa[j]]; + + ilow = SUPERLU_MAX(0, j - ku); + ihigh = SUPERLU_MIN(n-1, j + kl); + for (i = ilow; i <= ihigh; ++i) { + val[i-ilow] = A[i + j*lda]; + row[i-ilow] = i; + } + lasta += ihigh - ilow + 1; + } + + xa[n] = *nnz = lasta; + return 0; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sp_dconvert.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_dconvert.c new file mode 100644 index 0000000..dec3b32 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_dconvert.c @@ -0,0 +1,42 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ + +#include "slu_ddefs.h" + +/* + * Convert a full matrix into a sparse matrix format. + */ +int +sp_dconvert(int m, int n, double *A, int lda, int kl, int ku, + double *a, int *asub, int *xa, int *nnz) +{ + int lasta = 0; + int i, j, ilow, ihigh; + int *row; + double *val; + + for (j = 0; j < n; ++j) { + xa[j] = lasta; + val = &a[xa[j]]; + row = &asub[xa[j]]; + + ilow = SUPERLU_MAX(0, j - ku); + ihigh = SUPERLU_MIN(n-1, j + kl); + for (i = ilow; i <= ihigh; ++i) { + val[i-ilow] = A[i + j*lda]; + row[i-ilow] = i; + } + lasta += ihigh - ilow + 1; + } + + xa[n] = *nnz = lasta; + return 0; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sp_ienv.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_ienv.c new file mode 100644 index 0000000..4366812 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_ienv.c @@ -0,0 +1,59 @@ +/* + * File name: sp_ienv.c + * History: Modified from lapack routine ILAENV + */ +#include "slu_Cnames.h" + +int +sp_ienv(int ispec) +{ +/* + Purpose + ======= + + sp_ienv() is inquired to choose machine-dependent parameters for the + local environment. See ISPEC for a description of the parameters. + + This version provides a set of parameters which should give good, + but not optimal, performance on many of the currently available + computers. Users are encouraged to modify this subroutine to set + the tuning parameters for their particular machine using the option + and problem size information in the arguments. + + Arguments + ========= + + ISPEC (input) int + Specifies the parameter to be returned as the value of SP_IENV. + = 1: the panel size w; a panel consists of w consecutive + columns of matrix A in the process of Gaussian elimination. + The best value depends on machine's cache characters. + = 2: the relaxation parameter relax; if the number of + nodes (columns) in a subtree of the elimination tree is less + than relax, this subtree is considered as one supernode, + regardless of the their row structures. + = 3: the maximum size for a supernode; + = 4: the minimum row dimension for 2-D blocking to be used; + = 5: the minimum column dimension for 2-D blocking to be used; + = 6: the estimated fills factor for L and U, compared with A; + + (SP_IENV) (output) int + >= 0: the value of the parameter specified by ISPEC + < 0: if SP_IENV = -k, the k-th argument had an illegal value. + + ===================================================================== +*/ + + switch (ispec) { + case 1: return (3); + case 2: return (2); + case 3: return (10); + case 4: return (20); + case 5: return (10); + case 6: return (2); + } + + /* Invalid value for ISPEC */ + return (-1); + +} /* sp_ienv_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sp_sconvert.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_sconvert.c new file mode 100644 index 0000000..0b35d78 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_sconvert.c @@ -0,0 +1,42 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ + +#include "slu_sdefs.h" + +/* + * Convert a full matrix into a sparse matrix format. + */ +int +sp_sconvert(int m, int n, float *A, int lda, int kl, int ku, + float *a, int *asub, int *xa, int *nnz) +{ + int lasta = 0; + int i, j, ilow, ihigh; + int *row; + float *val; + + for (j = 0; j < n; ++j) { + xa[j] = lasta; + val = &a[xa[j]]; + row = &asub[xa[j]]; + + ilow = SUPERLU_MAX(0, j - ku); + ihigh = SUPERLU_MIN(n-1, j + kl); + for (i = ilow; i <= ihigh; ++i) { + val[i-ilow] = A[i + j*lda]; + row[i-ilow] = i; + } + lasta += ihigh - ilow + 1; + } + + xa[n] = *nnz = lasta; + return 0; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/sp_zconvert.c b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_zconvert.c new file mode 100644 index 0000000..4e1d17e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/sp_zconvert.c @@ -0,0 +1,42 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ + +#include "slu_zdefs.h" + +/* + * Convert a full matrix into a sparse matrix format. + */ +int +sp_zconvert(int m, int n, doublecomplex *A, int lda, int kl, int ku, + doublecomplex *a, int *asub, int *xa, int *nnz) +{ + int lasta = 0; + int i, j, ilow, ihigh; + int *row; + doublecomplex *val; + + for (j = 0; j < n; ++j) { + xa[j] = lasta; + val = &a[xa[j]]; + row = &asub[xa[j]]; + + ilow = SUPERLU_MAX(0, j - ku); + ihigh = SUPERLU_MIN(n-1, j + kl); + for (i = ilow; i <= ihigh; ++i) { + val[i-ilow] = A[i + j*lda]; + row[i-ilow] = i; + } + lasta += ihigh - ilow + 1; + } + + xa[n] = *nnz = lasta; + return 0; +} + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/stest.csh b/thirdparty/superlu/SuperLU_4.1/TESTING/stest.csh new file mode 100644 index 0000000..c8577a0 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/stest.csh @@ -0,0 +1,50 @@ +#!/bin/csh + +set ofile = stest.out # output file +if ( -e $ofile ) then + rm -f $ofile +endif +echo "Single-precision testing output" > $ofile + +set MATRICES = (LAPACK g10) +set NVAL = (9 19) +set NRHS = (5) +set LWORK = (0 10000000) + +# +# Loop through all matrices ... +# +foreach m ($MATRICES) + + #-------------------------------------------- + # Test matrix types generated in LAPACK-style + #-------------------------------------------- + if ($m == 'LAPACK') then + echo '== LAPACK test matrices' >> $ofile + foreach n ($NVAL) + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'n='$n 'nrhs='$s 'lwork='$l >> $ofile + ./stest -t "LA" -l $l -n $n -s $s >> $ofile + end + end + end + #-------------------------------------------- + # Test a specified sparse matrix + #-------------------------------------------- + else + echo '' >> $ofile + echo '== sparse matrix:' $m >> $ofile + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'nrhs='$s 'lwork='$l >> $ofile + ./stest -t "SP" -s $s -l $l < ../EXAMPLE/$m >> $ofile + end + end + endif + +end + + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/zdrive.c b/thirdparty/superlu/SuperLU_4.1/TESTING/zdrive.c new file mode 100644 index 0000000..33bd22e --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/zdrive.c @@ -0,0 +1,544 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +/* + * File name: zdrive.c + * Purpose: MAIN test program + */ +#include +#include "slu_zdefs.h" + +#define NTESTS 5 /* Number of test types */ +#define NTYPES 11 /* Number of matrix types */ +#define NTRAN 2 +#define THRESH 20.0 +#define FMT1 "%10s:n=%d, test(%d)=%12.5g\n" +#define FMT2 "%10s:fact=%4d, trans=%4d, equed=%c, n=%d, imat=%d, test(%d)=%12.5g\n" +#define FMT3 "%10s:info=%d, izero=%d, n=%d, nrhs=%d, imat=%d, nfail=%d\n" + +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u); + +main(int argc, char *argv[]) +{ +/* + * Purpose + * ======= + * + * ZDRIVE is the main test program for the DOUBLE COMPLEX linear + * equation driver routines ZGSSV and ZGSSVX. + * + * The program is invoked by a shell script file -- ztest.csh. + * The output from the tests are written into a file -- ztest.out. + * + * ===================================================================== + */ + doublecomplex *a, *a_save; + int *asub, *asub_save; + int *xa, *xa_save; + SuperMatrix A, B, X, L, U; + SuperMatrix ASAV, AC; + mem_usage_t mem_usage; + int *perm_r; /* row permutation from partial pivoting */ + int *perm_c, *pc_save; /* column permutation */ + int *etree; + doublecomplex zero = {0.0, 0.0}; + double *R, *C; + double *ferr, *berr; + double *rwork; + doublecomplex *wwork; + void *work; + int info, lwork, nrhs, panel_size, relax; + int m, n, nnz; + doublecomplex *xact; + doublecomplex *rhsb, *solx, *bsav; + int ldb, ldx; + double rpg, rcond; + int i, j, k1; + double rowcnd, colcnd, amax; + int maxsuper, rowblk, colblk; + int prefact, nofact, equil, iequed; + int nt, nrun, nfail, nerrs, imat, fimat, nimat; + int nfact, ifact, itran; + int kl, ku, mode, lda; + int zerot, izero, ioff; + double u; + double anorm, cndnum; + doublecomplex *Afull; + double result[NTESTS]; + superlu_options_t options; + fact_t fact; + trans_t trans; + SuperLUStat_t stat; + static char matrix_type[8]; + static char equed[1], path[4], sym[1], dist[1]; + + /* Fixed set of parameters */ + int iseed[] = {1988, 1989, 1990, 1991}; + static char equeds[] = {'N', 'R', 'C', 'B'}; + static fact_t facts[] = {FACTORED, DOFACT, SamePattern, + SamePattern_SameRowPerm}; + static trans_t transs[] = {NOTRANS, TRANS, CONJ}; + + /* Some function prototypes */ + extern int zgst01(int, int, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, double *); + extern int zgst02(trans_t, int, int, int, SuperMatrix *, doublecomplex *, + int, doublecomplex *, int, double *resid); + extern int zgst04(int, int, doublecomplex *, int, + doublecomplex *, int, double rcond, double *resid); + extern int zgst07(trans_t, int, int, SuperMatrix *, doublecomplex *, int, + doublecomplex *, int, doublecomplex *, int, + double *, double *, double *); + extern int zlatb4_(char *, int *, int *, int *, char *, int *, int *, + double *, int *, double *, char *); + extern int zlatms_(int *, int *, char *, int *, char *, double *d, + int *, double *, double *, int *, int *, + char *, doublecomplex *, int *, doublecomplex *, int *); + extern int sp_zconvert(int, int, doublecomplex *, int, int, int, + doublecomplex *a, int *, int *, int *); + + + /* Executable statements */ + + strcpy(path, "ZGE"); + nrun = 0; + nfail = 0; + nerrs = 0; + + /* Defaults */ + lwork = 0; + n = 1; + nrhs = 1; + panel_size = sp_ienv(1); + relax = sp_ienv(2); + u = 1.0; + strcpy(matrix_type, "LA"); + parse_command_line(argc, argv, matrix_type, &n, + &panel_size, &relax, &nrhs, &maxsuper, + &rowblk, &colblk, &lwork, &u); + if ( lwork > 0 ) { + work = SUPERLU_MALLOC(lwork); + if ( !work ) { + fprintf(stderr, "expert: cannot allocate %d bytes\n", lwork); + exit (-1); + } + } + + /* Set the default input options. */ + set_default_options(&options); + options.DiagPivotThresh = u; + options.PrintStat = NO; + options.PivotGrowth = YES; + options.ConditionNumber = YES; + options.IterRefine = DOUBLE; + + if ( strcmp(matrix_type, "LA") == 0 ) { + /* Test LAPACK matrix suite. */ + m = n; + lda = SUPERLU_MAX(n, 1); + nnz = n * n; /* upper bound */ + fimat = 1; + nimat = NTYPES; + Afull = doublecomplexCalloc(lda * n); + zallocateA(n, nnz, &a, &asub, &xa); + } else { + /* Read a sparse matrix */ + fimat = nimat = 0; + zreadhb(&m, &n, &nnz, &a, &asub, &xa); + } + + zallocateA(n, nnz, &a_save, &asub_save, &xa_save); + rhsb = doublecomplexMalloc(m * nrhs); + bsav = doublecomplexMalloc(m * nrhs); + solx = doublecomplexMalloc(n * nrhs); + ldb = m; + ldx = n; + zCreate_Dense_Matrix(&B, m, nrhs, rhsb, ldb, SLU_DN, SLU_Z, SLU_GE); + zCreate_Dense_Matrix(&X, n, nrhs, solx, ldx, SLU_DN, SLU_Z, SLU_GE); + xact = doublecomplexMalloc(n * nrhs); + etree = intMalloc(n); + perm_r = intMalloc(n); + perm_c = intMalloc(n); + pc_save = intMalloc(n); + R = (double *) SUPERLU_MALLOC(m*sizeof(double)); + C = (double *) SUPERLU_MALLOC(n*sizeof(double)); + ferr = (double *) SUPERLU_MALLOC(nrhs*sizeof(double)); + berr = (double *) SUPERLU_MALLOC(nrhs*sizeof(double)); + j = SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs); + rwork = (double *) SUPERLU_MALLOC(j*sizeof(double)); + for (i = 0; i < j; ++i) rwork[i] = 0.; + if ( !R ) ABORT("SUPERLU_MALLOC fails for R"); + if ( !C ) ABORT("SUPERLU_MALLOC fails for C"); + if ( !ferr ) ABORT("SUPERLU_MALLOC fails for ferr"); + if ( !berr ) ABORT("SUPERLU_MALLOC fails for berr"); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + wwork = doublecomplexCalloc( SUPERLU_MAX(m,n) * SUPERLU_MAX(4,nrhs) ); + + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i] = i; + options.ColPerm = MY_PERMC; + + for (imat = fimat; imat <= nimat; ++imat) { /* All matrix types */ + + if ( imat ) { + + /* Skip types 5, 6, or 7 if the matrix size is too small. */ + zerot = (imat >= 5 && imat <= 7); + if ( zerot && n < imat-4 ) + continue; + + /* Set up parameters with ZLATB4 and generate a test matrix + with ZLATMS. */ + zlatb4_(path, &imat, &n, &n, sym, &kl, &ku, &anorm, &mode, + &cndnum, dist); + + zlatms_(&n, &n, dist, iseed, sym, &rwork[0], &mode, &cndnum, + &anorm, &kl, &ku, "No packing", Afull, &lda, + &wwork[0], &info); + + if ( info ) { + printf(FMT3, "ZLATMS", info, izero, n, nrhs, imat, nfail); + continue; + } + + /* For types 5-7, zero one or more columns of the matrix + to test that INFO is returned correctly. */ + if ( zerot ) { + if ( imat == 5 ) izero = 1; + else if ( imat == 6 ) izero = n; + else izero = n / 2 + 1; + ioff = (izero - 1) * lda; + if ( imat < 7 ) { + for (i = 0; i < n; ++i) Afull[ioff + i] = zero; + } else { + for (j = 0; j < n - izero + 1; ++j) + for (i = 0; i < n; ++i) + Afull[ioff + i + j*lda] = zero; + } + } else { + izero = 0; + } + + /* Convert to sparse representation. */ + sp_zconvert(n, n, Afull, lda, kl, ku, a, asub, xa, &nnz); + + } else { + izero = 0; + zerot = 0; + } + + zCreate_CompCol_Matrix(&A, m, n, nnz, a, asub, xa, SLU_NC, SLU_Z, SLU_GE); + + /* Save a copy of matrix A in ASAV */ + zCreate_CompCol_Matrix(&ASAV, m, n, nnz, a_save, asub_save, xa_save, + SLU_NC, SLU_Z, SLU_GE); + zCopy_CompCol_Matrix(&A, &ASAV); + + /* Form exact solution. */ + zGenXtrue(n, nrhs, xact, ldx); + + StatInit(&stat); + + for (iequed = 0; iequed < 4; ++iequed) { + *equed = equeds[iequed]; + if (iequed == 0) nfact = 4; + else nfact = 1; /* Only test factored, pre-equilibrated matrix */ + + for (ifact = 0; ifact < nfact; ++ifact) { + fact = facts[ifact]; + options.Fact = fact; + + for (equil = 0; equil < 2; ++equil) { + options.Equil = equil; + prefact = ( options.Fact == FACTORED || + options.Fact == SamePattern_SameRowPerm ); + /* Need a first factor */ + nofact = (options.Fact != FACTORED); /* Not factored */ + + /* Restore the matrix A. */ + zCopy_CompCol_Matrix(&ASAV, &A); + + if ( zerot ) { + if ( prefact ) continue; + } else if ( options.Fact == FACTORED ) { + if ( equil || iequed ) { + /* Compute row and column scale factors to + equilibrate matrix A. */ + zgsequ(&A, R, C, &rowcnd, &colcnd, &amax, &info); + + /* Force equilibration. */ + if ( !info && n > 0 ) { + if ( lsame_(equed, "R") ) { + rowcnd = 0.; + colcnd = 1.; + } else if ( lsame_(equed, "C") ) { + rowcnd = 1.; + colcnd = 0.; + } else if ( lsame_(equed, "B") ) { + rowcnd = 0.; + colcnd = 0.; + } + } + + /* Equilibrate the matrix. */ + zlaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + } + + if ( prefact ) { /* Need a factor for the first time */ + + /* Save Fact option. */ + fact = options.Fact; + options.Fact = DOFACT; + + /* Preorder the matrix, obtain the column etree. */ + sp_preorder(&options, &A, perm_c, etree, &AC); + + /* Factor the matrix AC. */ + zgstrf(&options, &AC, relax, panel_size, + etree, work, lwork, perm_c, perm_r, &L, &U, + &stat, &info); + + if ( info ) { + printf("** First factor: info %d, equed %c\n", + info, *equed); + if ( lwork == -1 ) { + printf("** Estimated memory: %d bytes\n", + info - n); + exit(0); + } + } + + Destroy_CompCol_Permuted(&AC); + + /* Restore Fact option. */ + options.Fact = fact; + } /* if .. first time factor */ + + for (itran = 0; itran < NTRAN; ++itran) { + trans = transs[itran]; + options.Trans = trans; + + /* Restore the matrix A. */ + zCopy_CompCol_Matrix(&ASAV, &A); + + /* Set the right hand side. */ + zFillRHS(trans, nrhs, xact, ldx, &A, &B); + zCopy_Dense_Matrix(m, nrhs, rhsb, ldb, bsav, ldb); + + /*---------------- + * Test zgssv + *----------------*/ + if ( options.Fact == DOFACT && itran == 0) { + /* Not yet factored, and untransposed */ + + zCopy_Dense_Matrix(m, nrhs, rhsb, ldb, solx, ldx); + zgssv(&options, &A, perm_c, perm_r, &L, &U, &X, + &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "zgssv", + info, izero, n, nrhs, imat, nfail); + } else { + /* Reconstruct matrix from factors and + compute residual. */ + zgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + nt = 1; + if ( izero == 0 ) { + /* Compute residual of the computed + solution. */ + zCopy_Dense_Matrix(m, nrhs, rhsb, ldb, + wwork, ldb); + zgst02(trans, m, n, nrhs, &A, solx, + ldx, wwork,ldb, &result[1]); + nt = 2; + } + + /* Print information about the tests that + did not pass the threshold. */ + for (i = 0; i < nt; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT1, "zgssv", n, i, + result[i]); + ++nfail; + } + } + nrun += nt; + } /* else .. info == 0 */ + + /* Restore perm_c. */ + for (i = 0; i < n; ++i) perm_c[i] = pc_save[i]; + + if (lwork == 0) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + } /* if .. end of testing zgssv */ + + /*---------------- + * Test zgssvx + *----------------*/ + + /* Equilibrate the matrix if fact = FACTORED and + equed = 'R', 'C', or 'B'. */ + if ( options.Fact == FACTORED && + (equil || iequed) && n > 0 ) { + zlaqgs(&A, R, C, rowcnd, colcnd, amax, equed); + } + + /* Solve the system and compute the condition number + and error bounds using zgssvx. */ + zgssvx(&options, &A, perm_c, perm_r, etree, + equed, R, C, &L, &U, work, lwork, &B, &X, &rpg, + &rcond, ferr, berr, &mem_usage, &stat, &info); + + if ( info && info != izero ) { + printf(FMT3, "zgssvx", + info, izero, n, nrhs, imat, nfail); + if ( lwork == -1 ) { + printf("** Estimated memory: %.0f bytes\n", + mem_usage.total_needed); + exit(0); + } + } else { + if ( !prefact ) { + /* Reconstruct matrix from factors and + compute residual. */ + zgst01(m, n, &A, &L, &U, perm_c, perm_r, + &result[0]); + k1 = 0; + } else { + k1 = 1; + } + + if ( !info ) { + /* Compute residual of the computed solution.*/ + zCopy_Dense_Matrix(m, nrhs, bsav, ldb, + wwork, ldb); + zgst02(trans, m, n, nrhs, &ASAV, solx, ldx, + wwork, ldb, &result[1]); + + /* Check solution from generated exact + solution. */ + zgst04(n, nrhs, solx, ldx, xact, ldx, rcond, + &result[2]); + + /* Check the error bounds from iterative + refinement. */ + zgst07(trans, n, nrhs, &ASAV, bsav, ldb, + solx, ldx, xact, ldx, ferr, berr, + &result[3]); + + /* Print information about the tests that did + not pass the threshold. */ + for (i = k1; i < NTESTS; ++i) { + if ( result[i] >= THRESH ) { + printf(FMT2, "zgssvx", + options.Fact, trans, *equed, + n, imat, i, result[i]); + ++nfail; + } + } + nrun += NTESTS; + } /* if .. info == 0 */ + } /* else .. end of testing zgssvx */ + + } /* for itran ... */ + + if ( lwork == 0 ) { + Destroy_SuperNode_Matrix(&L); + Destroy_CompCol_Matrix(&U); + } + + } /* for equil ... */ + } /* for ifact ... */ + } /* for iequed ... */ +#if 0 + if ( !info ) { + PrintPerf(&L, &U, &mem_usage, rpg, rcond, ferr, berr, equed); + } +#endif + + } /* for imat ... */ + + /* Print a summary of the results. */ + PrintSumm("ZGE", nfail, nrun, nerrs); + + SUPERLU_FREE (rhsb); + SUPERLU_FREE (bsav); + SUPERLU_FREE (solx); + SUPERLU_FREE (xact); + SUPERLU_FREE (etree); + SUPERLU_FREE (perm_r); + SUPERLU_FREE (perm_c); + SUPERLU_FREE (pc_save); + SUPERLU_FREE (R); + SUPERLU_FREE (C); + SUPERLU_FREE (ferr); + SUPERLU_FREE (berr); + SUPERLU_FREE (rwork); + SUPERLU_FREE (wwork); + Destroy_SuperMatrix_Store(&B); + Destroy_SuperMatrix_Store(&X); + Destroy_CompCol_Matrix(&A); + Destroy_CompCol_Matrix(&ASAV); + if ( lwork > 0 ) { + SUPERLU_FREE (work); + Destroy_SuperMatrix_Store(&L); + Destroy_SuperMatrix_Store(&U); + } + StatFree(&stat); + + return 0; +} + +/* + * Parse command line options to get relaxed snode size, panel size, etc. + */ +static void +parse_command_line(int argc, char *argv[], char *matrix_type, + int *n, int *w, int *relax, int *nrhs, int *maxsuper, + int *rowblk, int *colblk, int *lwork, double *u) +{ + int c; + extern char *optarg; + + while ( (c = getopt(argc, argv, "ht:n:w:r:s:m:b:c:l:")) != EOF ) { + switch (c) { + case 'h': + printf("Options:\n"); + printf("\t-w - panel size\n"); + printf("\t-r - granularity of relaxed supernodes\n"); + exit(1); + break; + case 't': strcpy(matrix_type, optarg); + break; + case 'n': *n = atoi(optarg); + break; + case 'w': *w = atoi(optarg); + break; + case 'r': *relax = atoi(optarg); + break; + case 's': *nrhs = atoi(optarg); + break; + case 'm': *maxsuper = atoi(optarg); + break; + case 'b': *rowblk = atoi(optarg); + break; + case 'c': *colblk = atoi(optarg); + break; + case 'l': *lwork = atoi(optarg); + break; + case 'u': *u = atof(optarg); + break; + } + } +} diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/zgst01.c b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst01.c new file mode 100644 index 0000000..7f8ba8a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst01.c @@ -0,0 +1,171 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_zdefs.h" + +int zgst01(int m, int n, SuperMatrix *A, SuperMatrix *L, + SuperMatrix *U, int *perm_c, int *perm_r, double *resid) +{ +/* + Purpose + ======= + + ZGST01 reconstructs a matrix A from its L*U factorization and + computes the residual + norm(L*U - A) / ( N * norm(A) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========== + + M (input) INT + The number of rows of the matrix A. M >= 0. + + N (input) INT + The number of columns of the matrix A. N >= 0. + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original M x N matrix A. + + L (input) SuperMatrix *, dimension (L->nrow, L->ncol) + The factor matrix L. + + U (input) SuperMatrix *, dimension (U->nrow, U->ncol) + The factor matrix U. + + perm_c (input) INT array, dimension (N) + The column permutation from ZGSTRF. + + perm_r (input) INT array, dimension (M) + The pivot indices from ZGSTRF. + + RESID (output) DOUBLE* + norm(L*U - A) / ( N * norm(A) * EPS ) + + ===================================================================== +*/ + + /* Local variables */ + doublecomplex zero = {0.0, 0.0}; + int i, j, k, arow, lptr,isub, urow, superno, fsupc, u_part; + doublecomplex utemp, comp_temp; + double anorm, tnorm, cnorm; + double eps; + doublecomplex *work; + SCformat *Lstore; + NCformat *Astore, *Ustore; + doublecomplex *Aval, *Lval, *Uval; + int *colbeg, *colend; + + /* Function prototypes */ + extern double zlangs(char *, SuperMatrix *); + + /* Quick exit if M = 0 or N = 0. */ + + if (m <= 0 || n <= 0) { + *resid = 0.f; + return 0; + } + + work = (doublecomplex *)doublecomplexCalloc(m); + + Astore = A->Store; + Aval = Astore->nzval; + Lstore = L->Store; + Lval = Lstore->nzval; + Ustore = U->Store; + Uval = Ustore->nzval; + + /* Determine EPS and the norm of A. */ + eps = dlamch_("Epsilon"); + anorm = zlangs("1", A); + cnorm = 0.; + + /* Compute the product L*U, one column at a time */ + for (k = 0; k < n; ++k) { + + /* The U part outside the rectangular supernode */ + for (i = U_NZ_START(k); i < U_NZ_START(k+1); ++i) { + urow = U_SUB(i); + utemp = Uval[i]; + superno = Lstore->col_to_sup[urow]; + fsupc = L_FST_SUPC(superno); + u_part = urow - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)].r -= utemp.r; + work[L_SUB(lptr-1)].i -= utemp.i; + for (j = L_NZ_START(urow) + u_part; j < L_NZ_START(urow+1); ++j) { + isub = L_SUB(lptr); + zz_mult(&comp_temp, &utemp, &Lval[j]); + z_sub(&work[isub], &work[isub], &comp_temp); + ++lptr; + } + } + + /* The U part inside the rectangular supernode */ + superno = Lstore->col_to_sup[k]; + fsupc = L_FST_SUPC(superno); + urow = L_NZ_START(k); + for (i = fsupc; i <= k; ++i) { + utemp = Lval[urow++]; + u_part = i - fsupc + 1; + lptr = L_SUB_START(fsupc) + u_part; + work[L_SUB(lptr-1)].r -= utemp.r; + work[L_SUB(lptr-1)].i -= utemp.i; + for (j = L_NZ_START(i)+u_part; j < L_NZ_START(i+1); ++j) { + isub = L_SUB(lptr); + zz_mult(&comp_temp, &utemp, &Lval[j]); + z_sub(&work[isub], &work[isub], &comp_temp); + ++lptr; + } + } + + /* Now compute A[k] - (L*U)[k] (Both matrices may be permuted.) */ + + colbeg = intMalloc(n); + colend = intMalloc(n); + for (i = 0; i < n; i++) { + colbeg[perm_c[i]] = Astore->colptr[i]; + colend[perm_c[i]] = Astore->colptr[i+1]; + } + + for (i = colbeg[k]; i < colend[k]; ++i) { + arow = Astore->rowind[i]; + work[perm_r[arow]].r += Aval[i].r; + work[perm_r[arow]].i += Aval[i].i; + } + + /* Now compute the 1-norm of the column vector work */ + tnorm = 0.; + for (i = 0; i < m; ++i) { + tnorm += fabs(work[i].r) + fabs(work[i].i); + work[i] = zero; + } + cnorm = SUPERLU_MAX(tnorm, cnorm); + } + + *resid = cnorm; + + if (anorm <= 0.f) { + if (*resid != 0.f) { + *resid = 1.f / eps; + } + } else { + *resid = *resid / (float) n / anorm / eps; + } + + SUPERLU_FREE(work); + SUPERLU_FREE(colbeg); + SUPERLU_FREE(colend); + return 0; + +/* End of ZGST01 */ + +} /* zgst01_ */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/zgst02.c b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst02.c new file mode 100644 index 0000000..fc048e4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst02.c @@ -0,0 +1,138 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include "slu_zdefs.h" + +int zgst02(trans_t trans, int m, int n, int nrhs, SuperMatrix *A, + doublecomplex *x, int ldx, doublecomplex *b, int ldb, double *resid) +{ +/* + Purpose + ======= + + ZGST02 computes the residual for a solution of a system of linear + equations A*x = b or A'*x = b: + RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ), + where EPS is the machine epsilon. + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations: + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + M (input) INTEGER + The number of rows of the matrix A. M >= 0. + + N (input) INTEGER + The number of columns of the matrix A. N >= 0. + + NRHS (input) INTEGER + The number of columns of B, the matrix of right hand sides. + NRHS >= 0. + + A (input) SuperMatrix*, dimension (LDA,N) + The original M x N sparse matrix A. + + X (input) DOUBLE COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors for the system of linear + equations. + + LDX (input) INTEGER + The leading dimension of the array X. If TRANS = NOTRANS, + LDX >= max(1,N); if TRANS = TRANS or CONJ, LDX >= max(1,M). + + B (input/output) DOUBLE COMPLEX PRECISION array, dimension (LDB,NRHS) + On entry, the right hand side vectors for the system of + linear equations. + On exit, B is overwritten with the difference B - A*X. + + LDB (input) INTEGER + The leading dimension of the array B. IF TRANS = NOTRANS, + LDB >= max(1,M); if TRANS = TRANS or CONJ, LDB >= max(1,N). + + RESID (output) DOUBLE PRECISION + The maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ). + + ===================================================================== +*/ + + /* Table of constant values */ + doublecomplex alpha = {-1., 0.0}; + doublecomplex beta = {1., 0.0}; + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2; + + /* Local variables */ + int j; + int n1, n2; + double anorm, bnorm; + double xnorm; + double eps; + char transc[1]; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern double zlangs(char *, SuperMatrix *); + extern double dzasum_(int *, doublecomplex *, int *); + + /* Function Body */ + if ( m <= 0 || n <= 0 || nrhs == 0) { + *resid = 0.; + return 0; + } + + if ( (trans == TRANS) || (trans == CONJ) ) { + n1 = n; + n2 = m; + *transc = 'T'; + } else { + n1 = m; + n2 = n; + *transc = 'N'; + } + + /* Exit with RESID = 1/EPS if ANORM = 0. */ + + eps = dlamch_("Epsilon"); + anorm = zlangs("1", A); + if (anorm <= 0.) { + *resid = 1. / eps; + return 0; + } + + /* Compute B - A*X (or B - A'*X ) and store in B. */ + + sp_zgemm(transc, "N", n1, nrhs, n2, alpha, A, x, ldx, beta, b, ldb); + + /* Compute the maximum over the number of right hand sides of + norm(B - A*X) / ( norm(A) * norm(X) * EPS ) . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + bnorm = dzasum_(&n1, &b[j*ldb], &c__1); + xnorm = dzasum_(&n2, &x[j*ldx], &c__1); + if (xnorm <= 0.) { + *resid = 1. / eps; + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = bnorm / anorm / xnorm / eps; + *resid = SUPERLU_MAX(d__1, d__2); + } + } + + return 0; + +} /* zgst02 */ + diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/zgst04.c b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst04.c new file mode 100644 index 0000000..0c00db4 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst04.c @@ -0,0 +1,122 @@ + +/* + * -- SuperLU routine (version 2.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November 15, 1997 + * + */ +#include +#include "slu_zdefs.h" + +int zgst04(int n, int nrhs, doublecomplex *x, int ldx, doublecomplex *xact, + int ldxact, double rcond, double *resid) +{ +/* + Purpose + ======= + + ZGST04 computes the difference between a computed solution and the + true solution to a system of linear equations. + RESID = ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ), + where RCOND is the reciprocal of the condition number and EPS is the + machine epsilon. + + Arguments + ========= + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + X (input) DOUBLE COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) DOUBLE COMPLEX PRECISION array, dimension( LDX, NRHS ) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + RCOND (input) DOUBLE COMPLEX PRECISION + The reciprocal of the condition number of the coefficient + matrix in the system of equations. + + RESID (output) DOUBLE PRECISION + The maximum over the NRHS solution vectors of + ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ) + + ===================================================================== +*/ + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2, d__3, d__4; + + /* Local variables */ + int i, j, n__1; + int ix; + double xnorm; + double eps; + double diffnm; + + /* Function prototypes */ + extern int izamax_(int *, doublecomplex *, int *); + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + *resid = 0.; + return 0; + } + + /* Exit with RESID = 1/EPS if RCOND is invalid. */ + + eps = dlamch_("Epsilon"); + if ( rcond < 0. ) { + *resid = 1. / eps; + return 0; + } + + /* Compute the maximum of norm(X - XACT) / ( norm(XACT) * EPS ) + over all the vectors X and XACT . */ + + *resid = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + ix = izamax_(&n__1, &xact[j*ldxact], &c__1); + xnorm = (d__1 = xact[ix-1 + j*ldxact].r, fabs(d__1)) + + (d__2 = xact[ix-1 + j*ldxact].i, fabs(d__2)); + + diffnm = 0.; + for (i = 0; i < n; ++i) { + /* Computing MAX */ + d__3 = diffnm; + d__4 = (d__1 = x[i+j*ldx].r-xact[i+j*ldxact].r, fabs(d__1)) + + (d__2 = x[i+j*ldx].i-xact[i+j*ldxact].i, fabs(d__2)); + diffnm = SUPERLU_MAX(d__3,d__4); + } + if (xnorm <= 0.) { + if (diffnm > 0.) { + *resid = 1. / eps; + } + } else { + /* Computing MAX */ + d__1 = *resid, d__2 = diffnm / xnorm * rcond; + *resid = SUPERLU_MAX(d__1,d__2); + } + } + if (*resid * eps < 1.) { + *resid /= eps; + } + + return 0; + +} /* zgst04_ */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/zgst07.c b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst07.c new file mode 100644 index 0000000..cdc5d7a --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/zgst07.c @@ -0,0 +1,228 @@ + +/* + * -- SuperLU routine (version 3.0) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * October 15, 2003 + * + */ +#include +#include "slu_zdefs.h" + +int zgst07(trans_t trans, int n, int nrhs, SuperMatrix *A, doublecomplex *b, + int ldb, doublecomplex *x, int ldx, doublecomplex *xact, + int ldxact, double *ferr, double *berr, double *reslts) +{ +/* + Purpose + ======= + + ZGST07 tests the error bounds from iterative refinement for the + computed solution to a system of equations op(A)*X = B, where A is a + general n by n matrix and op(A) = A or A**T, depending on TRANS. + + RESLTS(1) = test of the error bound + = norm(X - XACT) / ( norm(X) * FERR ) + A large value is returned if this ratio is not less than one. + + RESLTS(2) = residual from the iterative refinement routine + = the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i ) + + Arguments + ========= + + TRANS (input) trans_t + Specifies the form of the system of equations. + = NOTRANS: A *x = b + = TRANS : A'*x = b, where A' is the transpose of A + = CONJ : A'*x = b, where A' is the transpose of A + + N (input) INT + The number of rows of the matrices X and XACT. N >= 0. + + NRHS (input) INT + The number of columns of the matrices X and XACT. NRHS >= 0. + + + A (input) SuperMatrix *, dimension (A->nrow, A->ncol) + The original n by n matrix A. + + B (input) DOUBLE COMPLEX PRECISION array, dimension (LDB,NRHS) + The right hand side vectors for the system of linear + equations. + + LDB (input) INT + The leading dimension of the array B. LDB >= max(1,N). + + X (input) DOUBLE COMPLEX PRECISION array, dimension (LDX,NRHS) + The computed solution vectors. Each vector is stored as a + column of the matrix X. + + LDX (input) INT + The leading dimension of the array X. LDX >= max(1,N). + + XACT (input) DOUBLE COMPLEX PRECISION array, dimension (LDX,NRHS) + The exact solution vectors. Each vector is stored as a + column of the matrix XACT. + + LDXACT (input) INT + The leading dimension of the array XACT. LDXACT >= max(1,N). + + + FERR (input) DOUBLE COMPLEX PRECISION array, dimension (NRHS) + The estimated forward error bounds for each solution vector + X. If XTRUE is the true solution, FERR bounds the magnitude + of the largest entry in (X - XTRUE) divided by the magnitude + of the largest entry in X. + + BERR (input) DOUBLE COMPLEX PRECISION array, dimension (NRHS) + The componentwise relative backward error of each solution + vector (i.e., the smallest relative change in any entry of A + + or B that makes X an exact solution). + + RESLTS (output) DOUBLE PRECISION array, dimension (2) + The maximum over the NRHS solution vectors of the ratios: + RESLTS(1) = norm(X - XACT) / ( norm(X) * FERR ) + RESLTS(2) = BERR / ( (n+1)*EPS + (*) ) + + ===================================================================== +*/ + + /* Table of constant values */ + int c__1 = 1; + + /* System generated locals */ + double d__1, d__2; + double d__3, d__4; + + /* Local variables */ + double diff, axbi; + int imax, irow, n__1; + int i, j, k; + double unfl, ovfl; + double xnorm; + double errbnd; + int notran; + double eps, tmp; + double *rwork; + doublecomplex *Aval; + NCformat *Astore; + + /* Function prototypes */ + extern int lsame_(char *, char *); + extern int izamax_(int *, doublecomplex *, int *); + + + /* Quick exit if N = 0 or NRHS = 0. */ + if ( n <= 0 || nrhs <= 0 ) { + reslts[0] = 0.; + reslts[1] = 0.; + return 0; + } + + eps = dlamch_("Epsilon"); + unfl = dlamch_("Safe minimum"); + ovfl = 1. / unfl; + notran = (trans == NOTRANS); + + rwork = (double *) SUPERLU_MALLOC(n*sizeof(double)); + if ( !rwork ) ABORT("SUPERLU_MALLOC fails for rwork"); + Astore = A->Store; + Aval = (doublecomplex *) Astore->nzval; + + /* Test 1: Compute the maximum of + norm(X - XACT) / ( norm(X) * FERR ) + over all the vectors X and XACT using the infinity-norm. */ + + errbnd = 0.; + for (j = 0; j < nrhs; ++j) { + n__1 = n; + imax = izamax_(&n__1, &x[j*ldx], &c__1); + d__1 = (d__2 = x[imax-1 + j*ldx].r, fabs(d__2)) + + (d__3 = x[imax-1 + j*ldx].i, fabs(d__3)); + xnorm = SUPERLU_MAX(d__1,unfl); + diff = 0.; + for (i = 0; i < n; ++i) { + d__1 = (d__2 = x[i+j*ldx].r - xact[i+j*ldxact].r, fabs(d__2)) + + (d__3 = x[i+j*ldx].i - xact[i+j*ldxact].i, fabs(d__3)); + diff = SUPERLU_MAX(diff, d__1); + } + + if (xnorm > 1.) { + goto L20; + } else if (diff <= ovfl * xnorm) { + goto L20; + } else { + errbnd = 1. / eps; + goto L30; + } + +L20: +#if 0 + if (diff / xnorm <= ferr[j]) { + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + } else { + errbnd = 1. / eps; + } +#endif + d__1 = diff / xnorm / ferr[j]; + errbnd = SUPERLU_MAX(errbnd,d__1); + /*printf("Ferr: %f\n", errbnd);*/ +L30: + ; + } + reslts[0] = errbnd; + + /* Test 2: Compute the maximum of BERR / ( (n+1)*EPS + (*) ), where + (*) = (n+1)*UNFL / (min_i (abs(op(A))*abs(X) + abs(b))_i ) */ + + for (k = 0; k < nrhs; ++k) { + for (i = 0; i < n; ++i) + rwork[i] = (d__1 = b[i + k*ldb].r, fabs(d__1)) + + (d__2 = b[i + k*ldb].i, fabs(d__2)); + if ( notran ) { + for (j = 0; j < n; ++j) { + tmp = (d__1 = x[j + k*ldx].r, fabs(d__1)) + + (d__2 = x[j + k*ldx].i, fabs(d__2)); + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + d__1 = (d__2 = Aval[i].r, fabs(d__2)) + + (d__3 = Aval[i].i, fabs(d__3)); + rwork[Astore->rowind[i]] += d__1 * tmp; + } + } + } else { + for (j = 0; j < n; ++j) { + tmp = 0.; + for (i = Astore->colptr[j]; i < Astore->colptr[j+1]; ++i) { + irow = Astore->rowind[i]; + d__1 = (d__2 = x[irow + k*ldx].r, fabs(d__2)) + + (d__3 = x[irow + k*ldx].i, fabs(d__3)); + d__2 = (d__3 = Aval[i].r, fabs(d__3)) + + (d__4 = Aval[i].i, fabs(d__4)); + tmp += d__2 * d__1; + } + rwork[j] += tmp; + } + } + + axbi = rwork[0]; + for (i = 1; i < n; ++i) axbi = SUPERLU_MIN(axbi, rwork[i]); + + /* Computing MAX */ + d__1 = axbi, d__2 = (n + 1) * unfl; + tmp = berr[k] / ((n + 1) * eps + (n + 1) * unfl / SUPERLU_MAX(d__1,d__2)); + + if (k == 0) { + reslts[1] = tmp; + } else { + reslts[1] = SUPERLU_MAX(reslts[1],tmp); + } + } + + SUPERLU_FREE(rwork); + return 0; + +} /* zgst07 */ diff --git a/thirdparty/superlu/SuperLU_4.1/TESTING/ztest.csh b/thirdparty/superlu/SuperLU_4.1/TESTING/ztest.csh new file mode 100644 index 0000000..32a8a3f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/TESTING/ztest.csh @@ -0,0 +1,49 @@ +#!/bin/csh + +set ofile = ztest.out # output file +if ( -e $ofile ) then + rm -f $ofile +endif +echo "Double-precision complex testing output" > $ofile + +set MATRICES = (LAPACK cg20.cua) +set NVAL = (9 19) +set NRHS = (5) +set LWORK = (0 10000000) + +# +# Loop through all matrices ... +# +foreach m ($MATRICES) + + #-------------------------------------------- + # Test matrix types generated in LAPACK-style + #-------------------------------------------- + if ($m == 'LAPACK') then + echo '== LAPACK test matrices' >> $ofile + foreach n ($NVAL) + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'n='$n 'nrhs='$s 'lwork='$l >> $ofile + ./ztest -t "LA" -l $l -n $n -s $s >> $ofile + end + end + end + #-------------------------------------------- + # Test a specified sparse matrix + #-------------------------------------------- + else + echo '' >> $ofile + echo '== sparse matrix:' $m >> $ofile + foreach s ($NRHS) + foreach l ($LWORK) + echo '' >> $ofile + echo 'nrhs='$s 'lwork='$l >> $ofile + ./ztest -t "SP" -s $s -l $l < ../EXAMPLE/$m >> $ofile + end + end + endif + +end + diff --git a/thirdparty/superlu/SuperLU_4.1/include/colamd.h b/thirdparty/superlu/SuperLU_4.1/include/colamd.h new file mode 100644 index 0000000..aacbd3f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/colamd.h @@ -0,0 +1,249 @@ +/*! @file colamd.h + \brief Colamd prototypes and definitions + +
     
    +    ==========================================================================
    +    === colamd/symamd prototypes and definitions =============================
    +    ==========================================================================
    +
    +    You must include this file (colamd.h) in any routine that uses colamd,
    +    symamd, or the related macros and definitions.
    +
    +    Authors:
    +
    +	The authors of the code itself are Stefan I. Larimore and Timothy A.
    +	Davis (davis@cise.ufl.edu), University of Florida.  The algorithm was
    +	developed in collaboration with John Gilbert, Xerox PARC, and Esmond
    +	Ng, Oak Ridge National Laboratory.
    +
    +    Date:
    +
    +	September 8, 2003.  Version 2.3.
    +
    +    Acknowledgements:
    +
    +	This work was supported by the National Science Foundation, under
    +	grants DMS-9504974 and DMS-9803599.
    +
    +    Notice:
    +
    +	Copyright (c) 1998-2003 by the University of Florida.
    +	All Rights Reserved.
    +
    +	THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY
    +	EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
    +
    +	Permission is hereby granted to use, copy, modify, and/or distribute
    +	this program, provided that the Copyright, this License, and the
    +	Availability of the original version is retained on all copies and made
    +	accessible to the end-user of any code or package that includes COLAMD
    +	or any modified version of COLAMD. 
    +
    +    Availability:
    +
    +	The colamd/symamd library is available at
    +
    +	    http://www.cise.ufl.edu/research/sparse/colamd/
    +
    +	This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.h
    +	file.  It is required by the colamd.c, colamdmex.c, and symamdmex.c
    +	files, and by any C code that calls the routines whose prototypes are
    +	listed below, or that uses the colamd/symamd definitions listed below.
    + 
    +*/ + +#ifndef COLAMD_H +#define COLAMD_H + +/* ========================================================================== */ +/* === Include files ======================================================== */ +/* ========================================================================== */ + +#include + +/* ========================================================================== */ +/* === Knob and statistics definitions ====================================== */ +/* ========================================================================== */ + +/* size of the knobs [ ] array. Only knobs [0..1] are currently used. */ +#define COLAMD_KNOBS 20 + +/* number of output statistics. Only stats [0..6] are currently used. */ +#define COLAMD_STATS 20 + +/* knobs [0] and stats [0]: dense row knob and output statistic. */ +#define COLAMD_DENSE_ROW 0 + +/* knobs [1] and stats [1]: dense column knob and output statistic. */ +#define COLAMD_DENSE_COL 1 + +/* stats [2]: memory defragmentation count output statistic */ +#define COLAMD_DEFRAG_COUNT 2 + +/* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */ +#define COLAMD_STATUS 3 + +/* stats [4..6]: error info, or info on jumbled columns */ +#define COLAMD_INFO1 4 +#define COLAMD_INFO2 5 +#define COLAMD_INFO3 6 + +/* error codes returned in stats [3]: */ +#define COLAMD_OK (0) +#define COLAMD_OK_BUT_JUMBLED (1) +#define COLAMD_ERROR_A_not_present (-1) +#define COLAMD_ERROR_p_not_present (-2) +#define COLAMD_ERROR_nrow_negative (-3) +#define COLAMD_ERROR_ncol_negative (-4) +#define COLAMD_ERROR_nnz_negative (-5) +#define COLAMD_ERROR_p0_nonzero (-6) +#define COLAMD_ERROR_A_too_small (-7) +#define COLAMD_ERROR_col_length_negative (-8) +#define COLAMD_ERROR_row_index_out_of_bounds (-9) +#define COLAMD_ERROR_out_of_memory (-10) +#define COLAMD_ERROR_internal_error (-999) + +/* ========================================================================== */ +/* === Row and Column structures ============================================ */ +/* ========================================================================== */ + +/* User code that makes use of the colamd/symamd routines need not directly */ +/* reference these structures. They are used only for the COLAMD_RECOMMENDED */ +/* macro. */ + +typedef struct Colamd_Col_struct +{ + int start ; /* index for A of first row in this column, or DEAD */ + /* if column is dead */ + int length ; /* number of rows in this column */ + union + { + int thickness ; /* number of original columns represented by this */ + /* col, if the column is alive */ + int parent ; /* parent in parent tree super-column structure, if */ + /* the column is dead */ + } shared1 ; + union + { + int score ; /* the score used to maintain heap, if col is alive */ + int order ; /* pivot ordering of this column, if col is dead */ + } shared2 ; + union + { + int headhash ; /* head of a hash bucket, if col is at the head of */ + /* a degree list */ + int hash ; /* hash value, if col is not in a degree list */ + int prev ; /* previous column in degree list, if col is in a */ + /* degree list (but not at the head of a degree list) */ + } shared3 ; + union + { + int degree_next ; /* next column, if col is in a degree list */ + int hash_next ; /* next column, if col is in a hash list */ + } shared4 ; + +} Colamd_Col ; + +typedef struct Colamd_Row_struct +{ + int start ; /* index for A of first col in this row */ + int length ; /* number of principal columns in this row */ + union + { + int degree ; /* number of principal & non-principal columns in row */ + int p ; /* used as a row pointer in init_rows_cols () */ + } shared1 ; + union + { + int mark ; /* for computing set differences and marking dead rows*/ + int first_column ;/* first column in row (used in garbage collection) */ + } shared2 ; + +} Colamd_Row ; + +/* ========================================================================== */ +/* === Colamd recommended memory size ======================================= */ +/* ========================================================================== */ + +/* + The recommended length Alen of the array A passed to colamd is given by + the COLAMD_RECOMMENDED (nnz, n_row, n_col) macro. It returns -1 if any + argument is negative. 2*nnz space is required for the row and column + indices of the matrix. COLAMD_C (n_col) + COLAMD_R (n_row) space is + required for the Col and Row arrays, respectively, which are internal to + colamd. An additional n_col space is the minimal amount of "elbow room", + and nnz/5 more space is recommended for run time efficiency. + + This macro is not needed when using symamd. + + Explicit typecast to int added Sept. 23, 2002, COLAMD version 2.2, to avoid + gcc -pedantic warning messages. +*/ + +#define COLAMD_C(n_col) ((int) (((n_col) + 1) * sizeof (Colamd_Col) / sizeof (int))) +#define COLAMD_R(n_row) ((int) (((n_row) + 1) * sizeof (Colamd_Row) / sizeof (int))) + +#define COLAMD_RECOMMENDED(nnz, n_row, n_col) \ +( \ +((nnz) < 0 || (n_row) < 0 || (n_col) < 0) \ +? \ + (-1) \ +: \ + (2 * (nnz) + COLAMD_C (n_col) + COLAMD_R (n_row) + (n_col) + ((nnz) / 5)) \ +) + +/* ========================================================================== */ +/* === Prototypes of user-callable routines ================================= */ +/* ========================================================================== */ + +int colamd_recommended /* returns recommended value of Alen, */ + /* or (-1) if input arguments are erroneous */ +( + int nnz, /* nonzeros in A */ + int n_row, /* number of rows in A */ + int n_col /* number of columns in A */ +) ; + +void colamd_set_defaults /* sets default parameters */ +( /* knobs argument is modified on output */ + double knobs [COLAMD_KNOBS] /* parameter settings for colamd */ +) ; + +int colamd /* returns (1) if successful, (0) otherwise*/ +( /* A and p arguments are modified on output */ + int n_row, /* number of rows in A */ + int n_col, /* number of columns in A */ + int Alen, /* size of the array A */ + int A [], /* row indices of A, of size Alen */ + int p [], /* column pointers of A, of size n_col+1 */ + double knobs [COLAMD_KNOBS],/* parameter settings for colamd */ + int stats [COLAMD_STATS] /* colamd output statistics and error codes */ +) ; + +int symamd /* return (1) if OK, (0) otherwise */ +( + int n, /* number of rows and columns of A */ + int A [], /* row indices of A */ + int p [], /* column pointers of A */ + int perm [], /* output permutation, size n_col+1 */ + double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ + int stats [COLAMD_STATS], /* output statistics and error codes */ + void * (*allocate) (size_t, size_t), + /* pointer to calloc (ANSI C) or */ + /* mxCalloc (for MATLAB mexFunction) */ + void (*release) (void *) + /* pointer to free (ANSI C) or */ + /* mxFree (for MATLAB mexFunction) */ +) ; + +void colamd_report +( + int stats [COLAMD_STATS] +) ; + +void symamd_report +( + int stats [COLAMD_STATS] +) ; + +#endif /* COLAMD_H */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/html_mainpage.h b/thirdparty/superlu/SuperLU_4.1/include/html_mainpage.h new file mode 100644 index 0000000..0b789fb --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/html_mainpage.h @@ -0,0 +1,21 @@ +/*! \mainpage SuperLU Documentation + +SuperLU is a general purpose library for the direct solution of large, +sparse, nonsymmetric systems of linear equations on high performance +machines. The library is written in C and is callable from either C or +Fortran. The library routines perform an LU decomposition with +partial pivoting and triangular system solves through forward and back +substitution. The library also provides threshold-based ILU factorization +preconditioners. + +The factorization routines can handle non-square +matrices but the triangular solves are performed only for square +matrices. The matrix columns may be preordered (before factorization) +either through library or user supplied routines. This preordering for +sparsity is completely separate from the factorization. Working +precision iterative refinement subroutines are provided for improved +backward stability. Routines are also provided to equilibrate the +system, estimate the condition number, calculate the relative backward +error, and estimate error bounds for the refined solutions. + + */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_Cnames.h b/thirdparty/superlu/SuperLU_4.1/include/slu_Cnames.h new file mode 100644 index 0000000..7bcd1bc --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_Cnames.h @@ -0,0 +1,458 @@ +/*! @file slu_Cnames.h + * \brief Macros defining how C routines will be called + * + *
    + * -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 1, 1997
    + *
    + * These macros define how C routines will be called.  ADD_ assumes that
    + * they will be called by fortran, which expects C routines to have an
    + * underscore postfixed to the name (Suns, and the Intel expect this).
    + * NOCHANGE indicates that fortran will be calling, and that it expects
    + * the name called by fortran to be identical to that compiled by the C
    + * (RS6K's do this).  UPCASE says it expects C routines called by fortran
    + * to be in all upcase (CRAY wants this). 
    + * 
    + */ +#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */ +#define __SUPERLU_CNAMES + + +#define ADD_ 0 +#define ADD__ 1 +#define NOCHANGE 2 +#define UPCASE 3 +#define OLD_CRAY 4 +#define C_CALL 5 + +#ifdef UpCase +#define F77_CALL_C UPCASE +#endif + +#ifdef NoChange +#define F77_CALL_C NOCHANGE +#endif + +#ifdef Add_ +#define F77_CALL_C ADD_ +#endif + +#ifdef Add__ +#define F77_CALL_C ADD__ +#endif + +#ifdef _CRAY +#define F77_CALL_C OLD_CRAY +#endif + +/* Default */ +#ifndef F77_CALL_C +#define F77_CALL_C ADD_ +#endif + + +#if (F77_CALL_C == ADD_) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * No redefinition necessary to have following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm_(...) + * + * This is the default. + */ + +#endif + +#if (F77_CALL_C == ADD__) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm__(...) + */ +/* BLAS */ +#define sswap_ sswap__ +#define saxpy_ saxpy__ +#define sasum_ sasum__ +#define isamax_ isamax__ +#define scopy_ scopy__ +#define sscal_ sscal__ +#define sger_ sger__ +#define snrm2_ snrm2__ +#define ssymv_ ssymv__ +#define sdot_ sdot__ +#define saxpy_ saxpy__ +#define ssyr2_ ssyr2__ +#define srot_ srot__ +#define sgemv_ sgemv__ +#define strsv_ strsv__ +#define sgemm_ sgemm__ +#define strsm_ strsm__ + +#define dswap_ dswap__ +#define daxpy_ daxpy__ +#define dasum_ dasum__ +#define idamax_ idamax__ +#define dcopy_ dcopy__ +#define dscal_ dscal__ +#define dger_ dger__ +#define dnrm2_ dnrm2__ +#define dsymv_ dsymv__ +#define ddot_ ddot__ +#define dsyr2_ dsyr2__ +#define drot_ drot__ +#define dgemv_ dgemv__ +#define dtrsv_ dtrsv__ +#define dgemm_ dgemm__ +#define dtrsm_ dtrsm__ + +#define cswap_ cswap__ +#define caxpy_ caxpy__ +#define scasum_ scasum__ +#define icamax_ icamax__ +#define ccopy_ ccopy__ +#define cscal_ cscal__ +#define scnrm2_ scnrm2__ +#define caxpy_ caxpy__ +#define cgemv_ cgemv__ +#define ctrsv_ ctrsv__ +#define cgemm_ cgemm__ +#define ctrsm_ ctrsm__ +#define cgerc_ cgerc__ +#define chemv_ chemv__ +#define cher2_ cher2__ + +#define zswap_ zswap__ +#define zaxpy_ zaxpy__ +#define dzasum_ dzasum__ +#define izamax_ izamax__ +#define zcopy_ zcopy__ +#define zscal_ zscal__ +#define dznrm2_ dznrm2__ +#define zaxpy_ zaxpy__ +#define zgemv_ zgemv__ +#define ztrsv_ ztrsv__ +#define zgemm_ zgemm__ +#define ztrsm_ ztrsm__ +#define zgerc_ zgerc__ +#define zhemv_ zhemv__ +#define zher2_ zher2__ + +/* LAPACK */ +#define dlamch_ dlamch__ +#define slamch_ slamch__ +#define xerbla_ xerbla__ +#define lsame_ lsame__ +#define dlacon_ dlacon__ +#define slacon_ slacon__ +#define icmax1_ icmax1__ +#define scsum1_ scsum1__ +#define clacon_ clacon__ +#define dzsum1_ dzsum1__ +#define izmax1_ izmax1__ +#define zlacon_ zlacon__ + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv__ +#define c_fortran_sgssv_ c_fortran_sgssv__ +#define c_fortran_dgssv_ c_fortran_dgssv__ +#define c_fortran_cgssv_ c_fortran_cgssv__ +#define c_fortran_zgssv_ c_fortran_zgssv__ +#endif + +#if (F77_CALL_C == UPCASE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void DGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define saxpy_ SAXPY +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ DSWAP +#define daxpy_ DAXPY +#define dasum_ DASUM +#define idamax_ IDAMAX +#define dcopy_ DCOPY +#define dscal_ DSCAL +#define dger_ DGER +#define dnrm2_ DNRM2 +#define dsymv_ DSYMV +#define ddot_ DDOT +#define dsyr2_ DSYR2 +#define drot_ DROT +#define dgemv_ DGEMV +#define dtrsv_ DTRSV +#define dgemm_ DGEMM +#define dtrsm_ DTRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == OLD_CRAY) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void SGEMM(...) + */ +/* BLAS */ +#define sswap_ SSWAP +#define saxpy_ SAXPY +#define sasum_ SASUM +#define isamax_ ISAMAX +#define scopy_ SCOPY +#define sscal_ SSCAL +#define sger_ SGER +#define snrm2_ SNRM2 +#define ssymv_ SSYMV +#define sdot_ SDOT +#define ssyr2_ SSYR2 +#define srot_ SROT +#define sgemv_ SGEMV +#define strsv_ STRSV +#define sgemm_ SGEMM +#define strsm_ STRSM + +#define dswap_ SSWAP +#define daxpy_ SAXPY +#define dasum_ SASUM +#define idamax_ ISAMAX +#define dcopy_ SCOPY +#define dscal_ SSCAL +#define dger_ SGER +#define dnrm2_ SNRM2 +#define dsymv_ SSYMV +#define ddot_ SDOT +#define dsyr2_ SSYR2 +#define drot_ SROT +#define dgemv_ SGEMV +#define dtrsv_ STRSV +#define dgemm_ SGEMM +#define dtrsm_ STRSM + +#define cswap_ CSWAP +#define caxpy_ CAXPY +#define scasum_ SCASUM +#define icamax_ ICAMAX +#define ccopy_ CCOPY +#define cscal_ CSCAL +#define scnrm2_ SCNRM2 +#define caxpy_ CAXPY +#define cgemv_ CGEMV +#define ctrsv_ CTRSV +#define cgemm_ CGEMM +#define ctrsm_ CTRSM +#define cgerc_ CGERC +#define chemv_ CHEMV +#define cher2_ CHER2 + +#define zswap_ ZSWAP +#define zaxpy_ ZAXPY +#define dzasum_ DZASUM +#define izamax_ IZAMAX +#define zcopy_ ZCOPY +#define zscal_ ZSCAL +#define dznrm2_ DZNRM2 +#define zgemv_ ZGEMV +#define ztrsv_ ZTRSV +#define zgemm_ ZGEMM +#define ztrsm_ ZTRSM +#define zgerc_ ZGERC +#define zhemv_ ZHEMV +#define zher2_ ZHER2 + +/* LAPACK */ +#define dlamch_ DLAMCH +#define slamch_ SLAMCH +#define xerbla_ XERBLA +#define lsame_ LSAME +#define dlacon_ DLACON +#define slacon_ SLACON +#define icmax1_ ICMAX1 +#define scsum1_ SCSUM1 +#define clacon_ CLACON +#define dzsum1_ DZSUM1 +#define izmax1_ IZMAX1 +#define zlacon_ ZLACON + +/* Fortran interface */ +#define c_bridge_dgssv_ C_BRIDGE_DGSSV +#define c_fortran_sgssv_ C_FORTRAN_SGSSV +#define c_fortran_dgssv_ C_FORTRAN_DGSSV +#define c_fortran_cgssv_ C_FORTRAN_CGSSV +#define c_fortran_zgssv_ C_FORTRAN_ZGSSV +#endif + + +#if (F77_CALL_C == NOCHANGE) +/* + * These defines set up the naming scheme required to have a fortran 77 + * routine call a C routine + * for following Fortran to C interface: + * FORTRAN CALL C DECLARATION + * call dgemm(...) void dgemm(...) + */ +/* BLAS */ +#define sswap_ sswap +#define saxpy_ saxpy +#define sasum_ sasum +#define isamax_ isamax +#define scopy_ scopy +#define sscal_ sscal +#define sger_ sger +#define snrm2_ snrm2 +#define ssymv_ ssymv +#define sdot_ sdot +#define saxpy_ saxpy +#define ssyr2_ ssyr2 +#define srot_ srot +#define sgemv_ sgemv +#define strsv_ strsv +#define sgemm_ sgemm +#define strsm_ strsm + +#define dswap_ dswap +#define daxpy_ daxpy +#define dasum_ dasum +#define idamax_ idamax +#define dcopy_ dcopy +#define dscal_ dscal +#define dger_ dger +#define dnrm2_ dnrm2 +#define dsymv_ dsymv +#define ddot_ ddot +#define dsyr2_ dsyr2 +#define drot_ drot +#define dgemv_ dgemv +#define dtrsv_ dtrsv +#define dgemm_ dgemm +#define dtrsm_ dtrsm + +#define cswap_ cswap +#define caxpy_ caxpy +#define scasum_ scasum +#define icamax_ icamax +#define ccopy_ ccopy +#define cscal_ cscal +#define scnrm2_ scnrm2 +#define cgemv_ cgemv +#define ctrsv_ ctrsv +#define cgemm_ cgemm +#define ctrsm_ ctrsm +#define cgerc_ cgerc +#define chemv_ chemv +#define cher2_ cher2 + +#define zswap_ zswap +#define zaxpy_ zaxpy +#define dzasum_ dzasum +#define izamax_ izamax +#define zcopy_ zcopy +#define zscal_ zscal +#define dznrm2_ dznrm2 +#define zgemv_ zgemv +#define ztrsv_ ztrsv +#define zgemm_ zgemm +#define ztrsm_ ztrsm +#define zgerc_ zgerc +#define zhemv_ zhemv +#define zher2_ zher2 + +/* LAPACK */ +#define dlamch_ dlamch +#define slamch_ slamch +#define xerbla_ xerbla +#define lsame_ lsame +#define dlacon_ dlacon +#define slacon_ slacon +#define icmax1_ icmax1 +#define scsum1_ scsum1 +#define clacon_ clacon +#define dzsum1_ dzsum1 +#define izmax1_ izmax1 +#define zlacon_ zlacon + +/* Fortran interface */ +#define c_bridge_dgssv_ c_bridge_dgssv +#define c_fortran_sgssv_ c_fortran_sgssv +#define c_fortran_dgssv_ c_fortran_dgssv +#define c_fortran_cgssv_ c_fortran_cgssv +#define c_fortran_zgssv_ c_fortran_zgssv +#endif + + +#endif /* __SUPERLU_CNAMES */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_cdefs.h b/thirdparty/superlu/SuperLU_4.1/include/slu_cdefs.h new file mode 100644 index 0000000..24d1374 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_cdefs.h @@ -0,0 +1,284 @@ + +/*! @file slu_cdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_cSP_DEFS + +/* + * File name: csp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" +#include "slu_scomplex.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + complex *lusup; /* L supernodes */ + int *xlusup; + complex *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +cgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + float *, float *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +cgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +cgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +cCreate_CompRow_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, complex *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +cCopy_Dense_Matrix(int, int, complex *, int, complex *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void callocateA (int, int, complex **, int **, int **); +extern void cgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int csnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int csnode_bmod (const int, const int, const int, complex *, + complex *, GlobalLU_t *, SuperLUStat_t*); +extern void cpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, complex *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void cpanel_bmod (const int, const int, const int, const int, + complex *, complex *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int ccolumn_bmod (const int, const int, complex *, + complex *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int ccopy_to_ucol (int, int, int *, int *, int *, + complex *, GlobalLU_t *); +extern int cpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void cpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void creadmt (int *, int *, int *, complex **, int **, int **); +extern void cGenXtrue (int, int, complex *, int); +extern void cFillRHS (trans_t, int, complex *, int, SuperMatrix *, + SuperMatrix *); +extern void cgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void cgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int cldperm(int, int, int, int [], int [], complex [], + int [], float [], float []); +extern int ilu_csnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_cpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, complex *, float *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_ccolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_ccopy_to_ucol (int, int, int *, int *, int *, + complex *, int, milu_t, double, int, + complex *, int *, GlobalLU_t *, float *); +extern int ilu_cpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + complex, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_cdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + float *, float *, int); + + +/*! \brief Driver related */ + +extern void cgsequ (SuperMatrix *, float *, float *, float *, + float *, float *, int *); +extern void claqgs (SuperMatrix *, float *, float *, float, + float, float, char *); +extern void cgscon (char *, SuperMatrix *, SuperMatrix *, + float, float *, SuperLUStat_t*, int *); +extern float cPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void cgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, float *, + float *, SuperMatrix *, SuperMatrix *, + float *, float *, SuperLUStat_t*, int *); + +extern int sp_ctrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, complex *, SuperLUStat_t*, int *); +extern int sp_cgemv (char *, complex, SuperMatrix *, complex *, + int, complex, complex *, int); + +extern int sp_cgemm (char *, char *, int, int, int, complex, + SuperMatrix *, complex *, int, complex, + complex *, int); +extern float slamch_(char *); + + +/*! \brief Memory-related */ +extern int cLUMemInit (fact_t, void *, int, int, int, int, int, + float, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, complex **); +extern void cSetRWork (int, int, complex *, complex **, complex **); +extern void cLUWorkFree (int *, complex *, GlobalLU_t *); +extern int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern complex *complexMalloc(int); +extern complex *complexCalloc(int); +extern float *floatMalloc(int); +extern float *floatCalloc(int); +extern int cmemory_usage(const int, const int, const int, const int); +extern int cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void creadhb(int *, int *, int *, complex **, int **, int **); +extern void creadrb(int *, int *, int *, complex **, int **, int **); +extern void creadtriple(int *, int *, int *, complex **, int **, int **); +extern void cCompRow_to_CompCol(int, int, int, complex*, int*, int*, + complex **, int **, int **); +extern void cfill (complex *, int, complex); +extern void cinf_norm_error (int, SuperMatrix *, complex *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + complex, complex, complex *, complex *, char *); +extern float sqselect(int, float *, int); + + +/*! \brief Routines for debugging */ +extern void cPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void cPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void cPrint_Dense_Matrix(char *, SuperMatrix *); +extern void cprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, complex *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_cSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_dcomplex.h b/thirdparty/superlu/SuperLU_4.1/include/slu_dcomplex.h new file mode 100644 index 0000000..386ad68 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_dcomplex.h @@ -0,0 +1,78 @@ + +/*! @file slu_dcomplex.h + * \brief Header file for complex operations + *
     
    + *  -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Contains definitions for various complex operations.
    + * This header file is to be included in source files z*.c
    + * 
    + */ +#ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */ +#define __SUPERLU_DCOMPLEX + + +#ifndef DCOMPLEX_INCLUDE +#define DCOMPLEX_INCLUDE + +typedef struct { double r, i; } doublecomplex; + + +/* Macro definitions */ + +/*! \brief Complex Addition c = a + b */ +#define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \ + (c)->i = (a)->i + (b)->i; } + +/*! \brief Complex Subtraction c = a - b */ +#define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \ + (c)->i = (a)->i - (b)->i; } + +/*! \brief Complex-Double Multiplication */ +#define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \ + (c)->i = (a)->i * (b); } + +/*! \brief Complex-Complex Multiplication */ +#define zz_mult(c, a, b) { \ + double cr, ci; \ + cr = (a)->r * (b)->r - (a)->i * (b)->i; \ + ci = (a)->i * (b)->r + (a)->r * (b)->i; \ + (c)->r = cr; \ + (c)->i = ci; \ + } + +#define zz_conj(a, b) { \ + (a)->r = (b)->r; \ + (a)->i = -((b)->i); \ + } + +/*! \brief Complex equality testing */ +#define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Prototypes for functions in dcomplex.c */ +void z_div(doublecomplex *, doublecomplex *, doublecomplex *); +double z_abs(doublecomplex *); /* exact */ +double z_abs1(doublecomplex *); /* approximate */ +void z_exp(doublecomplex *, doublecomplex *); +void d_cnjg(doublecomplex *r, doublecomplex *z); +double d_imag(doublecomplex *); +doublecomplex z_sgn(doublecomplex *); +doublecomplex z_sqrt(doublecomplex *); + + + +#ifdef __cplusplus + } +#endif + +#endif + +#endif /* __SUPERLU_DCOMPLEX */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_ddefs.h b/thirdparty/superlu/SuperLU_4.1/include/slu_ddefs.h new file mode 100644 index 0000000..199fa96 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_ddefs.h @@ -0,0 +1,281 @@ + +/*! @file slu_ddefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_dSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_dSP_DEFS + +/* + * File name: dsp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + double *lusup; /* L supernodes */ + int *xlusup; + double *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +dgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +dgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + double *, double *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +dgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +dgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +dCreate_CompRow_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +dCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +dCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, double *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +dCopy_Dense_Matrix(int, int, double *, int, double *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void dallocateA (int, int, double **, int **, int **); +extern void dgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int dsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int dsnode_bmod (const int, const int, const int, double *, + double *, GlobalLU_t *, SuperLUStat_t*); +extern void dpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, double *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void dpanel_bmod (const int, const int, const int, const int, + double *, double *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int dcolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int dcolumn_bmod (const int, const int, double *, + double *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int dcopy_to_ucol (int, int, int *, int *, int *, + double *, GlobalLU_t *); +extern int dpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void dpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void dreadmt (int *, int *, int *, double **, int **, int **); +extern void dGenXtrue (int, int, double *, int); +extern void dFillRHS (trans_t, int, double *, int, SuperMatrix *, + SuperMatrix *); +extern void dgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void dgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int dldperm(int, int, int, int [], int [], double [], + int [], double [], double []); +extern int ilu_dsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_dpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, double *, double *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_dcolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_dcopy_to_ucol (int, int, int *, int *, int *, + double *, int, milu_t, double, int, + double *, int *, GlobalLU_t *, double *); +extern int ilu_dpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + double, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_ddrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + double *, double *, int); + + +/*! \brief Driver related */ + +extern void dgsequ (SuperMatrix *, double *, double *, double *, + double *, double *, int *); +extern void dlaqgs (SuperMatrix *, double *, double *, double, + double, double, char *); +extern void dgscon (char *, SuperMatrix *, SuperMatrix *, + double, double *, SuperLUStat_t*, int *); +extern double dPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void dgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, double *, + double *, SuperMatrix *, SuperMatrix *, + double *, double *, SuperLUStat_t*, int *); + +extern int sp_dtrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, double *, SuperLUStat_t*, int *); +extern int sp_dgemv (char *, double, SuperMatrix *, double *, + int, double, double *, int); + +extern int sp_dgemm (char *, char *, int, int, int, double, + SuperMatrix *, double *, int, double, + double *, int); +extern double dlamch_(char *); + + +/*! \brief Memory-related */ +extern int dLUMemInit (fact_t, void *, int, int, int, int, int, + double, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, double **); +extern void dSetRWork (int, int, double *, double **, double **); +extern void dLUWorkFree (int *, double *, GlobalLU_t *); +extern int dLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern double *doubleMalloc(int); +extern double *doubleCalloc(int); +extern int dmemory_usage(const int, const int, const int, const int); +extern int dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void dreadhb(int *, int *, int *, double **, int **, int **); +extern void dreadrb(int *, int *, int *, double **, int **, int **); +extern void dreadtriple(int *, int *, int *, double **, int **, int **); +extern void dCompRow_to_CompCol(int, int, int, double*, int*, int*, + double **, int **, int **); +extern void dfill (double *, int, double); +extern void dinf_norm_error (int, SuperMatrix *, double *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + double, double, double *, double *, char *); +extern double dqselect(int, double *, int); + + +/*! \brief Routines for debugging */ +extern void dPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void dPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void dPrint_Dense_Matrix(char *, SuperMatrix *); +extern void dprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, double *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_dSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_scomplex.h b/thirdparty/superlu/SuperLU_4.1/include/slu_scomplex.h new file mode 100644 index 0000000..c17490d --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_scomplex.h @@ -0,0 +1,78 @@ + +/*! @file slu_scomplex.h + * \brief Header file for complex operations + *
     
    + *  -- SuperLU routine (version 2.0) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November 15, 1997
    + *
    + * Contains definitions for various complex operations.
    + * This header file is to be included in source files c*.c
    + * 
    + */ +#ifndef __SUPERLU_SCOMPLEX /* allow multiple inclusions */ +#define __SUPERLU_SCOMPLEX + + +#ifndef SCOMPLEX_INCLUDE +#define SCOMPLEX_INCLUDE + +typedef struct { float r, i; } complex; + + +/* Macro definitions */ + +/*! \brief Complex Addition c = a + b */ +#define c_add(c, a, b) { (c)->r = (a)->r + (b)->r; \ + (c)->i = (a)->i + (b)->i; } + +/*! \brief Complex Subtraction c = a - b */ +#define c_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \ + (c)->i = (a)->i - (b)->i; } + +/*! \brief Complex-Double Multiplication */ +#define cs_mult(c, a, b) { (c)->r = (a)->r * (b); \ + (c)->i = (a)->i * (b); } + +/*! \brief Complex-Complex Multiplication */ +#define cc_mult(c, a, b) { \ + float cr, ci; \ + cr = (a)->r * (b)->r - (a)->i * (b)->i; \ + ci = (a)->i * (b)->r + (a)->r * (b)->i; \ + (c)->r = cr; \ + (c)->i = ci; \ + } + +#define cc_conj(a, b) { \ + (a)->r = (b)->r; \ + (a)->i = -((b)->i); \ + } + +/*! \brief Complex equality testing */ +#define c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Prototypes for functions in scomplex.c */ +void c_div(complex *, complex *, complex *); +double c_abs(complex *); /* exact */ +double c_abs1(complex *); /* approximate */ +void c_exp(complex *, complex *); +void r_cnjg(complex *, complex *); +double r_imag(complex *); +complex c_sgn(complex *); +complex c_sqrt(complex *); + + + +#ifdef __cplusplus + } +#endif + +#endif + +#endif /* __SUPERLU_SCOMPLEX */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_sdefs.h b/thirdparty/superlu/SuperLU_4.1/include/slu_sdefs.h new file mode 100644 index 0000000..745d76f --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_sdefs.h @@ -0,0 +1,281 @@ + +/*! @file slu_sdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_sSP_DEFS + +/* + * File name: ssp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + float *lusup; /* L supernodes */ + int *xlusup; + float *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +sgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + float *, float *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +sgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +sgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, float *, float *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, float *, float *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +sCreate_CompRow_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +sCopy_Dense_Matrix(int, int, float *, int, float *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void sallocateA (int, int, float **, int **, int **); +extern void sgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int ssnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int ssnode_bmod (const int, const int, const int, float *, + float *, GlobalLU_t *, SuperLUStat_t*); +extern void spanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, float *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void spanel_bmod (const int, const int, const int, const int, + float *, float *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int scolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int scolumn_bmod (const int, const int, float *, + float *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int scopy_to_ucol (int, int, int *, int *, int *, + float *, GlobalLU_t *); +extern int spivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void spruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void sreadmt (int *, int *, int *, float **, int **, int **); +extern void sGenXtrue (int, int, float *, int); +extern void sFillRHS (trans_t, int, float *, int, SuperMatrix *, + SuperMatrix *); +extern void sgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void sgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int sldperm(int, int, int, int [], int [], float [], + int [], float [], float []); +extern int ilu_ssnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_spanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, float *, float *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_scolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_scopy_to_ucol (int, int, int *, int *, int *, + float *, int, milu_t, double, int, + float *, int *, GlobalLU_t *, float *); +extern int ilu_spivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + float, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_sdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + float *, float *, int); + + +/*! \brief Driver related */ + +extern void sgsequ (SuperMatrix *, float *, float *, float *, + float *, float *, int *); +extern void slaqgs (SuperMatrix *, float *, float *, float, + float, float, char *); +extern void sgscon (char *, SuperMatrix *, SuperMatrix *, + float, float *, SuperLUStat_t*, int *); +extern float sPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void sgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, float *, + float *, SuperMatrix *, SuperMatrix *, + float *, float *, SuperLUStat_t*, int *); + +extern int sp_strsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, float *, SuperLUStat_t*, int *); +extern int sp_sgemv (char *, float, SuperMatrix *, float *, + int, float, float *, int); + +extern int sp_sgemm (char *, char *, int, int, int, float, + SuperMatrix *, float *, int, float, + float *, int); +extern float slamch_(char *); + + +/*! \brief Memory-related */ +extern int sLUMemInit (fact_t, void *, int, int, int, int, int, + float, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, float **); +extern void sSetRWork (int, int, float *, float **, float **); +extern void sLUWorkFree (int *, float *, GlobalLU_t *); +extern int sLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern float *floatMalloc(int); +extern float *floatCalloc(int); +extern int smemory_usage(const int, const int, const int, const int); +extern int sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void sreadhb(int *, int *, int *, float **, int **, int **); +extern void sreadrb(int *, int *, int *, float **, int **, int **); +extern void sreadtriple(int *, int *, int *, float **, int **, int **); +extern void sCompRow_to_CompCol(int, int, int, float*, int*, int*, + float **, int **, int **); +extern void sfill (float *, int, float); +extern void sinf_norm_error (int, SuperMatrix *, float *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + float, float, float *, float *, char *); +extern float sqselect(int, float *, int); + + +/*! \brief Routines for debugging */ +extern void sPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void sPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void sPrint_Dense_Matrix(char *, SuperMatrix *); +extern void sprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, float *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_sSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_util.h b/thirdparty/superlu/SuperLU_4.1/include/slu_util.h new file mode 100644 index 0000000..82ac01c --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_util.h @@ -0,0 +1,362 @@ +/** @file slu_util.h + * \brief Utility header file + * + * -- SuperLU routine (version 4.1) -- + * Univ. of California Berkeley, Xerox Palo Alto Research Center, + * and Lawrence Berkeley National Lab. + * November, 2010 + * + */ + +#ifndef __SUPERLU_UTIL /* allow multiple inclusions */ +#define __SUPERLU_UTIL + +#include +#include +#include +/* +#ifndef __STDC__ +#include +#endif +*/ +#include +#include "superlu_enum_consts.h" + +/*********************************************************************** + * Macros + ***********************************************************************/ +#define FIRSTCOL_OF_SNODE(i) (xsup[i]) +/* No of marker arrays used in the symbolic factorization, + each of size n */ +#define NO_MARKER 3 +#define NUM_TEMPV(m,w,t,b) ( SUPERLU_MAX(m, (t + b)*w) ) + +#ifndef USER_ABORT +#define USER_ABORT(msg) superlu_abort_and_exit(msg) +#endif + +#define ABORT(err_msg) \ + { char msg[256];\ + sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\ + USER_ABORT(msg); } + + +#ifndef USER_MALLOC +#if 1 +#define USER_MALLOC(size) superlu_malloc(size) +#else +/* The following may check out some uninitialized data */ +#define USER_MALLOC(size) memset (superlu_malloc(size), '\x0F', size) +#endif +#endif + +#define SUPERLU_MALLOC(size) USER_MALLOC(size) + +#ifndef USER_FREE +#define USER_FREE(addr) superlu_free(addr) +#endif + +#define SUPERLU_FREE(addr) USER_FREE(addr) + +#define CHECK_MALLOC(where) { \ + extern int superlu_malloc_total; \ + printf("%s: malloc_total %d Bytes\n", \ + where, superlu_malloc_total); \ +} + +#define SUPERLU_MAX(x, y) ( (x) > (y) ? (x) : (y) ) +#define SUPERLU_MIN(x, y) ( (x) < (y) ? (x) : (y) ) + +/********************************************************* + * Macros used for easy access of sparse matrix entries. * + *********************************************************/ +#define L_SUB_START(col) ( Lstore->rowind_colptr[col] ) +#define L_SUB(ptr) ( Lstore->rowind[ptr] ) +#define L_NZ_START(col) ( Lstore->nzval_colptr[col] ) +#define L_FST_SUPC(superno) ( Lstore->sup_to_col[superno] ) +#define U_NZ_START(col) ( Ustore->colptr[col] ) +#define U_SUB(ptr) ( Ustore->rowind[ptr] ) + + +/*********************************************************************** + * Constants + ***********************************************************************/ +#define EMPTY (-1) +/*#define NO (-1)*/ +#define FALSE 0 +#define TRUE 1 + +#define NO_MEMTYPE 4 /* 0: lusup; + 1: ucol; + 2: lsub; + 3: usub */ + +#define GluIntArray(n) (5 * (n) + 5) + +/* Dropping rules */ +#define NODROP ( 0x0000 ) +#define DROP_BASIC ( 0x0001 ) /* ILU(tau) */ +#define DROP_PROWS ( 0x0002 ) /* ILUTP: keep p maximum rows */ +#define DROP_COLUMN ( 0x0004 ) /* ILUTP: for j-th column, + p = gamma * nnz(A(:,j)) */ +#define DROP_AREA ( 0x0008 ) /* ILUTP: for j-th column, use + nnz(F(:,1:j)) / nnz(A(:,1:j)) + to limit memory growth */ +#define DROP_SECONDARY ( 0x000E ) /* PROWS | COLUMN | AREA */ +#define DROP_DYNAMIC ( 0x0010 ) /* adaptive tau */ +#define DROP_INTERP ( 0x0100 ) /* use interpolation */ + + +#if 1 +#define MILU_ALPHA (1.0e-2) /* multiple of drop_sum to be added to diagonal */ +#else +#define MILU_ALPHA 1.0 /* multiple of drop_sum to be added to diagonal */ +#endif + + +/*********************************************************************** + * Type definitions + ***********************************************************************/ +typedef float flops_t; +typedef unsigned char Logical; + +/* + *-- This contains the options used to control the solution process. + * + * Fact (fact_t) + * Specifies whether or not the factored form of the matrix + * A is supplied on entry, and if not, how the matrix A should + * be factorizaed. + * = DOFACT: The matrix A will be factorized from scratch, and the + * factors will be stored in L and U. + * = SamePattern: The matrix A will be factorized assuming + * that a factorization of a matrix with the same sparsity + * pattern was performed prior to this one. Therefore, this + * factorization will reuse column permutation vector + * ScalePermstruct->perm_c and the column elimination tree + * LUstruct->etree. + * = SamePattern_SameRowPerm: The matrix A will be factorized + * assuming that a factorization of a matrix with the same + * sparsity pattern and similar numerical values was performed + * prior to this one. Therefore, this factorization will reuse + * both row and column scaling factors R and C, both row and + * column permutation vectors perm_r and perm_c, and the + * data structure set up from the previous symbolic factorization. + * = FACTORED: On entry, L, U, perm_r and perm_c contain the + * factored form of A. If DiagScale is not NOEQUIL, the matrix + * A has been equilibrated with scaling factors R and C. + * + * Equil (yes_no_t) + * Specifies whether to equilibrate the system (scale A's row and + * columns to have unit norm). + * + * ColPerm (colperm_t) + * Specifies what type of column permutation to use to reduce fill. + * = NATURAL: use the natural ordering + * = MMD_ATA: use minimum degree ordering on structure of A'*A + * = MMD_AT_PLUS_A: use minimum degree ordering on structure of A'+A + * = COLAMD: use approximate minimum degree column ordering + * = MY_PERMC: use the ordering specified by the user + * + * Trans (trans_t) + * Specifies the form of the system of equations: + * = NOTRANS: A * X = B (No transpose) + * = TRANS: A**T * X = B (Transpose) + * = CONJ: A**H * X = B (Transpose) + * + * IterRefine (IterRefine_t) + * Specifies whether to perform iterative refinement. + * = NO: no iterative refinement + * = SINGLE: perform iterative refinement in single precision + * = DOUBLE: perform iterative refinement in double precision + * = EXTRA: perform iterative refinement in extra precision + * + * DiagPivotThresh (double, in [0.0, 1.0]) (only for sequential SuperLU) + * Specifies the threshold used for a diagonal entry to be an + * acceptable pivot. + * + * SymmetricMode (yest_no_t) + * Specifies whether to use symmetric mode. Symmetric mode gives + * preference to diagonal pivots, and uses an (A'+A)-based column + * permutation algorithm. + * + * PivotGrowth (yes_no_t) + * Specifies whether to compute the reciprocal pivot growth. + * + * ConditionNumber (ues_no_t) + * Specifies whether to compute the reciprocal condition number. + * + * RowPerm (rowperm_t) (only for SuperLU_DIST or ILU) + * Specifies whether to permute rows of the original matrix. + * = NO: not to permute the rows + * = LargeDiag: make the diagonal large relative to the off-diagonal + * = MY_PERMR: use the permutation given by the user + * + * ILU_DropRule (int) + * Specifies the dropping rule: + * = DROP_BASIC: Basic dropping rule, supernodal based ILUTP(tau). + * = DROP_PROWS: Supernodal based ILUTP(p,tau), p = gamma * nnz(A)/n. + * = DROP_COLUMN: Variant of ILUTP(p,tau), for j-th column, + * p = gamma * nnz(A(:,j)). + * = DROP_AREA: Variation of ILUTP, for j-th column, use + * nnz(F(:,1:j)) / nnz(A(:,1:j)) to control memory. + * = DROP_DYNAMIC: Modify the threshold tau during factorizaion: + * If nnz(L(:,1:j)) / nnz(A(:,1:j)) > gamma + * tau_L(j) := MIN(tau_0, tau_L(j-1) * 2); + * Otherwise + * tau_L(j) := MAX(tau_0, tau_L(j-1) / 2); + * tau_U(j) uses the similar rule. + * NOTE: the thresholds used by L and U are separate. + * = DROP_INTERP: Compute the second dropping threshold by + * interpolation instead of sorting (default). + * In this case, the actual fill ratio is not + * guaranteed to be smaller than gamma. + * Note: DROP_PROWS, DROP_COLUMN and DROP_AREA are mutually exclusive. + * ( Default: DROP_BASIC | DROP_AREA ) + * + * ILU_DropTol (double) + * numerical threshold for dropping. + * + * ILU_FillFactor (double) + * Gamma in the secondary dropping. + * + * ILU_Norm (norm_t) + * Specify which norm to use to measure the row size in a + * supernode: infinity-norm, 1-norm, or 2-norm. + * + * ILU_FillTol (double) + * numerical threshold for zero pivot perturbation. + * + * ILU_MILU (milu_t) + * Specifies which version of MILU to use. + * + * ILU_MILU_Dim (double) + * Dimension of the PDE if available. + * + * ReplaceTinyPivot (yes_no_t) (only for SuperLU_DIST) + * Specifies whether to replace the tiny diagonals by + * sqrt(epsilon)*||A|| during LU factorization. + * + * SolveInitialized (yes_no_t) (only for SuperLU_DIST) + * Specifies whether the initialization has been performed to the + * triangular solve. + * + * RefineInitialized (yes_no_t) (only for SuperLU_DIST) + * Specifies whether the initialization has been performed to the + * sparse matrix-vector multiplication routine needed in iterative + * refinement. + * + * PrintStat (yes_no_t) + * Specifies whether to print the solver's statistics. + */ +typedef struct { + fact_t Fact; + yes_no_t Equil; + colperm_t ColPerm; + trans_t Trans; + IterRefine_t IterRefine; + double DiagPivotThresh; + yes_no_t SymmetricMode; + yes_no_t PivotGrowth; + yes_no_t ConditionNumber; + rowperm_t RowPerm; + int ILU_DropRule; + double ILU_DropTol; /* threshold for dropping */ + double ILU_FillFactor; /* gamma in the secondary dropping */ + norm_t ILU_Norm; /* infinity-norm, 1-norm, or 2-norm */ + double ILU_FillTol; /* threshold for zero pivot perturbation */ + milu_t ILU_MILU; + double ILU_MILU_Dim; /* Dimension of PDE (if available) */ + yes_no_t ParSymbFact; + yes_no_t ReplaceTinyPivot; /* used in SuperLU_DIST */ + yes_no_t SolveInitialized; + yes_no_t RefineInitialized; + yes_no_t PrintStat; +} superlu_options_t; + +/*! \brief Headers for 4 types of dynamatically managed memory */ +typedef struct e_node { + int size; /* length of the memory that has been used */ + void *mem; /* pointer to the new malloc'd store */ +} ExpHeader; + +typedef struct { + int size; + int used; + int top1; /* grow upward, relative to &array[0] */ + int top2; /* grow downward */ + void *array; +} LU_stack_t; + +typedef struct { + int *panel_histo; /* histogram of panel size distribution */ + double *utime; /* running time at various phases */ + flops_t *ops; /* operation count at various phases */ + int TinyPivots; /* number of tiny pivots */ + int RefineSteps; /* number of iterative refinement steps */ + int expansions; /* number of memory expansions */ +} SuperLUStat_t; + +typedef struct { + float for_lu; + float total_needed; +} mem_usage_t; + + +/*********************************************************************** + * Prototypes + ***********************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + +extern void Destroy_SuperMatrix_Store(SuperMatrix *); +extern void Destroy_CompCol_Matrix(SuperMatrix *); +extern void Destroy_CompRow_Matrix(SuperMatrix *); +extern void Destroy_SuperNode_Matrix(SuperMatrix *); +extern void Destroy_CompCol_Permuted(SuperMatrix *); +extern void Destroy_Dense_Matrix(SuperMatrix *); +extern void get_perm_c(int, SuperMatrix *, int *); +extern void set_default_options(superlu_options_t *options); +extern void ilu_set_default_options(superlu_options_t *options); +extern void sp_preorder (superlu_options_t *, SuperMatrix*, int*, int*, + SuperMatrix*); +extern void superlu_abort_and_exit(char*); +extern void *superlu_malloc (size_t); +extern int *intMalloc (int); +extern int *intCalloc (int); +extern void superlu_free (void*); +extern void SetIWork (int, int, int, int *, int **, int **, int **, + int **, int **, int **, int **); +extern int sp_coletree (int *, int *, int *, int, int, int *); +extern void relax_snode (const int, int *, const int, int *, int *); +extern void heap_relax_snode (const int, int *, const int, int *, int *); +extern int mark_relax(int, int *, int *, int *, int *, int *, int *); +extern void ilu_relax_snode (const int, int *, const int, int *, + int *, int *); +extern void ilu_heap_relax_snode (const int, int *, const int, int *, + int *, int*); +extern void resetrep_col (const int, const int *, int *); +extern int spcoletree (int *, int *, int *, int, int, int *); +extern int *TreePostorder (int, int *); +extern double SuperLU_timer_ (); +extern int sp_ienv (int); +extern int lsame_ (char *, char *); +extern int xerbla_ (char *, int *); +extern void ifill (int *, int, int); +extern void snode_profile (int, int *); +extern void super_stats (int, int *); +extern void check_repfnz(int, int, int, int *); +extern void PrintSumm (char *, int, int, int); +extern void StatInit(SuperLUStat_t *); +extern void StatPrint (SuperLUStat_t *); +extern void StatFree(SuperLUStat_t *); +extern void print_panel_seg(int, int, int, int, int *, int *); +extern int print_int_vec(char *,int, int *); +extern int slu_PrintInt10(char *, int, int *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_UTIL */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/slu_zdefs.h b/thirdparty/superlu/SuperLU_4.1/include/slu_zdefs.h new file mode 100644 index 0000000..f7ccf87 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/slu_zdefs.h @@ -0,0 +1,284 @@ + +/*! @file slu_zdefs.h + * \brief Header file for real operations + * + *
     
    + * -- SuperLU routine (version 4.1) --
    + * Univ. of California Berkeley, Xerox Palo Alto Research Center,
    + * and Lawrence Berkeley National Lab.
    + * November, 2010
    + * 
    + * Global data structures used in LU factorization -
    + * 
    + *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
    + *   (xsup,supno): supno[i] is the supernode no to which i belongs;
    + *	xsup(s) points to the beginning of the s-th supernode.
    + *	e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
    + *	        xsup 0 1 2 4 7 12
    + *	Note: dfs will be performed on supernode rep. relative to the new 
    + *	      row pivoting ordering
    + *
    + *   (xlsub,lsub): lsub[*] contains the compressed subscript of
    + *	rectangular supernodes; xlsub[j] points to the starting
    + *	location of the j-th column in lsub[*]. Note that xlsub 
    + *	is indexed by column.
    + *	Storage: original row subscripts
    + *
    + *      During the course of sparse LU factorization, we also use
    + *	(xlsub,lsub) for the purpose of symmetric pruning. For each
    + *	supernode {s,s+1,...,t=s+r} with first column s and last
    + *	column t, the subscript set
    + *		lsub[j], j=xlsub[s], .., xlsub[s+1]-1
    + *	is the structure of column s (i.e. structure of this supernode).
    + *	It is used for the storage of numerical values.
    + *	Furthermore,
    + *		lsub[j], j=xlsub[t], .., xlsub[t+1]-1
    + *	is the structure of the last column t of this supernode.
    + *	It is for the purpose of symmetric pruning. Therefore, the
    + *	structural subscripts can be rearranged without making physical
    + *	interchanges among the numerical values.
    + *
    + *	However, if the supernode has only one column, then we
    + *	only keep one set of subscripts. For any subscript interchange
    + *	performed, similar interchange must be done on the numerical
    + *	values.
    + *
    + *	The last column structures (for pruning) will be removed
    + *	after the numercial LU factorization phase.
    + *
    + *   (xlusup,lusup): lusup[*] contains the numerical values of the
    + *	rectangular supernodes; xlusup[j] points to the starting
    + *	location of the j-th column in storage vector lusup[*]
    + *	Note: xlusup is indexed by column.
    + *	Each rectangular supernode is stored by column-major
    + *	scheme, consistent with Fortran 2-dim array storage.
    + *
    + *   (xusub,ucol,usub): ucol[*] stores the numerical values of
    + *	U-columns outside the rectangular supernodes. The row
    + *	subscript of nonzero ucol[k] is stored in usub[k].
    + *	xusub[i] points to the starting location of column i in ucol.
    + *	Storage: new row subscripts; that is subscripts of PA.
    + * 
    + */ +#ifndef __SUPERLU_zSP_DEFS /* allow multiple inclusions */ +#define __SUPERLU_zSP_DEFS + +/* + * File name: zsp_defs.h + * Purpose: Sparse matrix types and function prototypes + * History: + */ + +#ifdef _CRAY +#include +#include +#endif + +/* Define my integer type int_t */ +typedef int int_t; /* default */ + +#include +#include +#include "slu_Cnames.h" +#include "supermatrix.h" +#include "slu_util.h" +#include "slu_dcomplex.h" + + + +typedef struct { + int *xsup; /* supernode and column mapping */ + int *supno; + int *lsub; /* compressed L subscripts */ + int *xlsub; + doublecomplex *lusup; /* L supernodes */ + int *xlusup; + doublecomplex *ucol; /* U columns */ + int *usub; + int *xusub; + int nzlmax; /* current max size of lsub */ + int nzumax; /* " " " ucol */ + int nzlumax; /* " " " lusup */ + int n; /* number of columns in the matrix */ + LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */ + int num_expansions; + ExpHeader *expanders; /* Array of pointers to 4 types of memory */ + LU_stack_t stack; /* use user supplied memory */ +} GlobalLU_t; + + +/* -------- Prototypes -------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*! \brief Driver routines */ +extern void +zgssv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +zgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, + double *, double *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + /* ILU */ +extern void +zgsisv(superlu_options_t *, SuperMatrix *, int *, int *, SuperMatrix *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t *, int *); +extern void +zgsisx(superlu_options_t *, SuperMatrix *, int *, int *, int *, + char *, double *, double *, SuperMatrix *, SuperMatrix *, + void *, int, SuperMatrix *, SuperMatrix *, double *, double *, + mem_usage_t *, SuperLUStat_t *, int *); + + +/*! \brief Supernodal LU factor related */ +extern void +zCreate_CompCol_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +zCreate_CompRow_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, Stype_t, Dtype_t, Mtype_t); +extern void +zCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *); +extern void +zCreate_Dense_Matrix(SuperMatrix *, int, int, doublecomplex *, int, + Stype_t, Dtype_t, Mtype_t); +extern void +zCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, doublecomplex *, + int *, int *, int *, int *, int *, + Stype_t, Dtype_t, Mtype_t); +extern void +zCopy_Dense_Matrix(int, int, doublecomplex *, int, doublecomplex *, int); + +extern void countnz (const int, int *, int *, int *, GlobalLU_t *); +extern void ilu_countnz (const int, int *, int *, GlobalLU_t *); +extern void fixupL (const int, const int *, GlobalLU_t *); + +extern void zallocateA (int, int, doublecomplex **, int **, int **); +extern void zgstrf (superlu_options_t*, SuperMatrix*, + int, int, int*, void *, int, int *, int *, + SuperMatrix *, SuperMatrix *, SuperLUStat_t*, int *); +extern int zsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, int *, GlobalLU_t *); +extern int zsnode_bmod (const int, const int, const int, doublecomplex *, + doublecomplex *, GlobalLU_t *, SuperLUStat_t*); +extern void zpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, doublecomplex *, int *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern void zpanel_bmod (const int, const int, const int, const int, + doublecomplex *, doublecomplex *, int *, int *, + GlobalLU_t *, SuperLUStat_t*); +extern int zcolumn_dfs (const int, const int, int *, int *, int *, int *, + int *, int *, int *, int *, int *, GlobalLU_t *); +extern int zcolumn_bmod (const int, const int, doublecomplex *, + doublecomplex *, int *, int *, int, + GlobalLU_t *, SuperLUStat_t*); +extern int zcopy_to_ucol (int, int, int *, int *, int *, + doublecomplex *, GlobalLU_t *); +extern int zpivotL (const int, const double, int *, int *, + int *, int *, int *, GlobalLU_t *, SuperLUStat_t*); +extern void zpruneL (const int, const int *, const int, const int, + const int *, const int *, int *, GlobalLU_t *); +extern void zreadmt (int *, int *, int *, doublecomplex **, int **, int **); +extern void zGenXtrue (int, int, doublecomplex *, int); +extern void zFillRHS (trans_t, int, doublecomplex *, int, SuperMatrix *, + SuperMatrix *); +extern void zgstrs (trans_t, SuperMatrix *, SuperMatrix *, int *, int *, + SuperMatrix *, SuperLUStat_t*, int *); +/* ILU */ +extern void zgsitrf (superlu_options_t*, SuperMatrix*, int, int, int*, + void *, int, int *, int *, SuperMatrix *, SuperMatrix *, + SuperLUStat_t*, int *); +extern int zldperm(int, int, int, int [], int [], doublecomplex [], + int [], double [], double []); +extern int ilu_zsnode_dfs (const int, const int, const int *, const int *, + const int *, int *, GlobalLU_t *); +extern void ilu_zpanel_dfs (const int, const int, const int, SuperMatrix *, + int *, int *, doublecomplex *, double *, int *, int *, + int *, int *, int *, int *, GlobalLU_t *); +extern int ilu_zcolumn_dfs (const int, const int, int *, int *, int *, + int *, int *, int *, int *, int *, + GlobalLU_t *); +extern int ilu_zcopy_to_ucol (int, int, int *, int *, int *, + doublecomplex *, int, milu_t, double, int, + doublecomplex *, int *, GlobalLU_t *, double *); +extern int ilu_zpivotL (const int, const double, int *, int *, int, int *, + int *, int *, int *, double, milu_t, + doublecomplex, GlobalLU_t *, SuperLUStat_t*); +extern int ilu_zdrop_row (superlu_options_t *, int, int, double, + int, int *, double *, GlobalLU_t *, + double *, double *, int); + + +/*! \brief Driver related */ + +extern void zgsequ (SuperMatrix *, double *, double *, double *, + double *, double *, int *); +extern void zlaqgs (SuperMatrix *, double *, double *, double, + double, double, char *); +extern void zgscon (char *, SuperMatrix *, SuperMatrix *, + double, double *, SuperLUStat_t*, int *); +extern double zPivotGrowth(int, SuperMatrix *, int *, + SuperMatrix *, SuperMatrix *); +extern void zgsrfs (trans_t, SuperMatrix *, SuperMatrix *, + SuperMatrix *, int *, int *, char *, double *, + double *, SuperMatrix *, SuperMatrix *, + double *, double *, SuperLUStat_t*, int *); + +extern int sp_ztrsv (char *, char *, char *, SuperMatrix *, + SuperMatrix *, doublecomplex *, SuperLUStat_t*, int *); +extern int sp_zgemv (char *, doublecomplex, SuperMatrix *, doublecomplex *, + int, doublecomplex, doublecomplex *, int); + +extern int sp_zgemm (char *, char *, int, int, int, doublecomplex, + SuperMatrix *, doublecomplex *, int, doublecomplex, + doublecomplex *, int); +extern double dlamch_(char *); + + +/*! \brief Memory-related */ +extern int zLUMemInit (fact_t, void *, int, int, int, int, int, + double, SuperMatrix *, SuperMatrix *, + GlobalLU_t *, int **, doublecomplex **); +extern void zSetRWork (int, int, doublecomplex *, doublecomplex **, doublecomplex **); +extern void zLUWorkFree (int *, doublecomplex *, GlobalLU_t *); +extern int zLUMemXpand (int, int, MemType, int *, GlobalLU_t *); + +extern doublecomplex *doublecomplexMalloc(int); +extern doublecomplex *doublecomplexCalloc(int); +extern double *doubleMalloc(int); +extern double *doubleCalloc(int); +extern int zmemory_usage(const int, const int, const int, const int); +extern int zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); +extern int ilu_zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); + +/*! \brief Auxiliary routines */ +extern void zreadhb(int *, int *, int *, doublecomplex **, int **, int **); +extern void zreadrb(int *, int *, int *, doublecomplex **, int **, int **); +extern void zreadtriple(int *, int *, int *, doublecomplex **, int **, int **); +extern void zCompRow_to_CompCol(int, int, int, doublecomplex*, int*, int*, + doublecomplex **, int **, int **); +extern void zfill (doublecomplex *, int, doublecomplex); +extern void zinf_norm_error (int, SuperMatrix *, doublecomplex *); +extern void PrintPerf (SuperMatrix *, SuperMatrix *, mem_usage_t *, + doublecomplex, doublecomplex, doublecomplex *, doublecomplex *, char *); +extern double dqselect(int, double *, int); + + +/*! \brief Routines for debugging */ +extern void zPrint_CompCol_Matrix(char *, SuperMatrix *); +extern void zPrint_SuperNode_Matrix(char *, SuperMatrix *); +extern void zPrint_Dense_Matrix(char *, SuperMatrix *); +extern void zprint_lu_col(char *, int, int, int *, GlobalLU_t *); +extern int print_double_vec(char *, int, double *); +extern void check_tempv(int, doublecomplex *); + +#ifdef __cplusplus + } +#endif + +#endif /* __SUPERLU_zSP_DEFS */ + diff --git a/thirdparty/superlu/SuperLU_4.1/include/superlu_enum_consts.h b/thirdparty/superlu/SuperLU_4.1/include/superlu_enum_consts.h new file mode 100644 index 0000000..63f43f1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/superlu_enum_consts.h @@ -0,0 +1,72 @@ +/** @file superlu_enum_consts.h + * \brief enum constants header file + * + * -- SuperLU routine (version 4.1) -- + * Lawrence Berkeley National Lab, Univ. of California Berkeley, + * October 1, 2010 + * + */ + +#ifndef __SUPERLU_ENUM_CONSTS /* allow multiple inclusions */ +#define __SUPERLU_ENUM_CONSTS + +/*********************************************************************** + * Enumerate types + ***********************************************************************/ +typedef enum {NO, YES} yes_no_t; +typedef enum {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED} fact_t; +typedef enum {NOROWPERM, LargeDiag, MY_PERMR} rowperm_t; +typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD, + METIS_AT_PLUS_A, PARMETIS, ZOLTAN, MY_PERMC} colperm_t; +typedef enum {NOTRANS, TRANS, CONJ} trans_t; +typedef enum {NOEQUIL, ROW, COL, BOTH} DiagScale_t; +typedef enum {NOREFINE, SINGLE=1, DOUBLE, EXTRA} IterRefine_t; +typedef enum {LUSUP, UCOL, LSUB, USUB, LLVL, ULVL} MemType; +typedef enum {HEAD, TAIL} stack_end_t; +typedef enum {SYSTEM, USER} LU_space_t; +typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t; +typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t; +#if 0 +typedef enum {NODROP = 0x0000, + DROP_BASIC = 0x0001, /* ILU(tau) */ + DROP_PROWS = 0x0002, /* ILUTP: keep p maximum rows */ + DROP_COLUMN = 0x0004, /* ILUTP: for j-th column, + p = gamma * nnz(A(:,j)) */ + DROP_AREA = 0x0008, /* ILUTP: for j-th column, use + nnz(F(:,1:j)) / nnz(A(:,1:j)) + to limit memory growth */ + DROP_SECONDARY = 0x000E, /* PROWS | COLUMN | AREA */ + DROP_DYNAMIC = 0x0010, + DROP_INTERP = 0x0100} rule_t; +#endif + + +/* + * The following enumerate type is used by the statistics variable + * to keep track of flop count and time spent at various stages. + * + * Note that not all of the fields are disjoint. + */ +typedef enum { + COLPERM, /* find a column ordering that minimizes fills */ + ROWPERM, /* find a row ordering maximizes diagonal. */ + RELAX, /* find artificial supernodes */ + ETREE, /* compute column etree */ + EQUIL, /* equilibrate the original matrix */ + SYMBFAC, /* symbolic factorization. */ + DIST, /* distribute matrix. */ + FACT, /* perform LU factorization */ + COMM, /* communication for factorization */ + SOL_COMM,/* communication for solve */ + RCOND, /* estimate reciprocal condition number */ + SOLVE, /* forward and back solves */ + REFINE, /* perform iterative refinement */ + FLOAT, /* time spent in floating-point operations */ + TRSV, /* fraction of FACT spent in xTRSV */ + GEMV, /* fraction of FACT spent in xGEMV */ + FERR, /* estimate error bounds after iterative refinement */ + NPHASES /* total number of phases */ +} PhaseType; + + +#endif /* __SUPERLU_ENUM_CONSTS */ diff --git a/thirdparty/superlu/SuperLU_4.1/include/supermatrix.h b/thirdparty/superlu/SuperLU_4.1/include/supermatrix.h new file mode 100644 index 0000000..8b8e388 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/include/supermatrix.h @@ -0,0 +1,180 @@ +/*! @file supermatrix.h + * \brief Defines matrix types + */ +#ifndef __SUPERLU_SUPERMATRIX /* allow multiple inclusions */ +#define __SUPERLU_SUPERMATRIX + + +/******************************************** + * The matrix types are defined as follows. * + ********************************************/ +typedef enum { + SLU_NC, /* column-wise, no supernode */ + SLU_NCP, /* column-wise, column-permuted, no supernode + (The consecutive columns of nonzeros, after permutation, + may not be stored contiguously.) */ + SLU_NR, /* row-wize, no supernode */ + SLU_SC, /* column-wise, supernode */ + SLU_SCP, /* supernode, column-wise, permuted */ + SLU_SR, /* row-wise, supernode */ + SLU_DN, /* Fortran style column-wise storage for dense matrix */ + SLU_NR_loc /* distributed compressed row format */ +} Stype_t; + +typedef enum { + SLU_S, /* single */ + SLU_D, /* double */ + SLU_C, /* single complex */ + SLU_Z /* double complex */ +} Dtype_t; + +typedef enum { + SLU_GE, /* general */ + SLU_TRLU, /* lower triangular, unit diagonal */ + SLU_TRUU, /* upper triangular, unit diagonal */ + SLU_TRL, /* lower triangular */ + SLU_TRU, /* upper triangular */ + SLU_SYL, /* symmetric, store lower half */ + SLU_SYU, /* symmetric, store upper half */ + SLU_HEL, /* Hermitian, store lower half */ + SLU_HEU /* Hermitian, store upper half */ +} Mtype_t; + +typedef struct { + Stype_t Stype; /* Storage type: interprets the storage structure + pointed to by *Store. */ + Dtype_t Dtype; /* Data type. */ + Mtype_t Mtype; /* Matrix type: describes the mathematical property of + the matrix. */ + int_t nrow; /* number of rows */ + int_t ncol; /* number of columns */ + void *Store; /* pointer to the actual storage of the matrix */ +} SuperMatrix; + +/*********************************************** + * The storage schemes are defined as follows. * + ***********************************************/ + +/* Stype == SLU_NC (Also known as Harwell-Boeing sparse matrix format) */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *rowind; /* pointer to array of row indices of the nonzeros */ + int_t *colptr; /* pointer to array of beginning of columns in nzval[] + and rowind[] */ + /* Note: + Zero-based indexing is used; + colptr[] has ncol+1 entries, the last one pointing + beyond the last column, so that colptr[ncol] = nnz. */ +} NCformat; + +/* Stype == SLU_NR */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by raw */ + int_t *colind; /* pointer to array of columns indices of the nonzeros */ + int_t *rowptr; /* pointer to array of beginning of rows in nzval[] + and colind[] */ + /* Note: + Zero-based indexing is used; + rowptr[] has nrow+1 entries, the last one pointing + beyond the last row, so that rowptr[nrow] = nnz. */ +} NRformat; + +/* Stype == SLU_SC */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + int_t nsuper; /* number of supernodes, minus 1 */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *nzval_colptr;/* pointer to array of beginning of columns in nzval[] */ + int_t *rowind; /* pointer to array of compressed row indices of + rectangular supernodes */ + int_t *rowind_colptr;/* pointer to array of beginning of columns in rowind[] */ + int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column + j belongs; mapping from column to supernode number. */ + int_t *sup_to_col; /* sup_to_col[s] points to the start of the s-th + supernode; mapping from supernode number to column. + e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12) + sup_to_col: 0 1 2 4 7 12 (nsuper=4) */ + /* Note: + Zero-based indexing is used; + nzval_colptr[], rowind_colptr[], col_to_sup and + sup_to_col[] have ncol+1 entries, the last one + pointing beyond the last column. + For col_to_sup[], only the first ncol entries are + defined. For sup_to_col[], only the first nsuper+2 + entries are defined. */ +} SCformat; + +/* Stype == SLU_SCP */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + int_t nsuper; /* number of supernodes */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *nzval_colbeg;/* nzval_colbeg[j] points to beginning of column j + in nzval[] */ + int_t *nzval_colend;/* nzval_colend[j] points to one past the last element + of column j in nzval[] */ + int_t *rowind; /* pointer to array of compressed row indices of + rectangular supernodes */ + int_t *rowind_colbeg;/* rowind_colbeg[j] points to beginning of column j + in rowind[] */ + int_t *rowind_colend;/* rowind_colend[j] points to one past the last element + of column j in rowind[] */ + int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column + j belongs; mapping from column to supernode. */ + int_t *sup_to_colbeg; /* sup_to_colbeg[s] points to the start of the s-th + supernode; mapping from supernode to column.*/ + int_t *sup_to_colend; /* sup_to_colend[s] points to one past the end of the + s-th supernode; mapping from supernode number to + column. + e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12) + sup_to_colbeg: 0 1 2 4 7 (nsuper=4) + sup_to_colend: 1 2 4 7 12 */ + /* Note: + Zero-based indexing is used; + nzval_colptr[], rowind_colptr[], col_to_sup and + sup_to_col[] have ncol+1 entries, the last one + pointing beyond the last column. */ +} SCPformat; + +/* Stype == SLU_NCP */ +typedef struct { + int_t nnz; /* number of nonzeros in the matrix */ + void *nzval; /* pointer to array of nonzero values, packed by column */ + int_t *rowind;/* pointer to array of row indices of the nonzeros */ + /* Note: nzval[]/rowind[] always have the same length */ + int_t *colbeg;/* colbeg[j] points to the beginning of column j in nzval[] + and rowind[] */ + int_t *colend;/* colend[j] points to one past the last element of column + j in nzval[] and rowind[] */ + /* Note: + Zero-based indexing is used; + The consecutive columns of the nonzeros may not be + contiguous in storage, because the matrix has been + postmultiplied by a column permutation matrix. */ +} NCPformat; + +/* Stype == SLU_DN */ +typedef struct { + int_t lda; /* leading dimension */ + void *nzval; /* array of size lda*ncol to represent a dense matrix */ +} DNformat; + +/* Stype == SLU_NR_loc (Distributed Compressed Row Format) */ +typedef struct { + int_t nnz_loc; /* number of nonzeros in the local submatrix */ + int_t m_loc; /* number of rows local to this processor */ + int_t fst_row; /* global index of the first row */ + void *nzval; /* pointer to array of nonzero values, packed by row */ + int_t *rowptr; /* pointer to array of beginning of rows in nzval[] + and colind[] */ + int_t *colind; /* pointer to array of column indices of the nonzeros */ + /* Note: + Zero-based indexing is used; + rowptr[] has n_loc + 1 entries, the last one pointing + beyond the last row, so that rowptr[n_loc] = nnz_loc.*/ +} NRformat_loc; + + +#endif /* __SUPERLU_SUPERMATRIX */ diff --git a/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.a b/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.a new file mode 100644 index 0000000..0b6c97c Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.a differ diff --git a/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.lib b/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.lib new file mode 100644 index 0000000..8033b8b Binary files /dev/null and b/thirdparty/superlu/SuperLU_4.1/lib/libsuperlu_4.0.lib differ diff --git a/thirdparty/superlu/SuperLU_4.1/make.inc b/thirdparty/superlu/SuperLU_4.1/make.inc new file mode 100644 index 0000000..229cee1 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/make.inc @@ -0,0 +1,65 @@ +############################################################################ +# +# Program: SuperLU +# +# Module: make.inc +# +# Purpose: Top-level Definitions +# +# Creation date: October 2, 1995 +# +# Modified: February 4, 1997 Version 1.0 +# November 15, 1997 Version 1.1 +# September 1, 1999 Version 2.0 +# +############################################################################ +# +# The machine (platform) identifier to append to the library names +# +PLAT = _linux + +# +# The name of the libraries to be created/linked to +# +SuperLUroot = $(HOME)/Codes/SuperLU_4.1 +SUPERLULIB = $(SuperLUroot)/lib/libsuperlu_4.1.a +TMGLIB = libtmglib.a + +## BLASLIB = $(SuperLUroot)/lib/libblas.a + +BLASDEF = -DUSE_VENDOR_BLAS +BLASLIB = -L$(HOME)/lib/GotoBLAS -lgoto + +## ATLAS BLAS causes single-precision to fail +#BLASLIB = -L/usr/lib/atlas -lblas +## This BLAS causes single-precision to fail the test in SuperLU +#BLASLIB = -L/usr/lib -lblas + +LIBS = $(SUPERLULIB) $(BLASLIB) + +# +# The archiver and the flag(s) to use when building archive (library) +# If your system has no ranlib, set RANLIB = echo. +# +ARCH = ar +ARCHFLAGS = cr +RANLIB = ranlib + +CC = gcc +CFLAGS = -DPRNTlevel=0 -O3 +NOOPTS = +FORTRAN = g77 +FFLAGS = -O2 +LOADER = $(FORTRAN) +LOADOPTS = + +# +# C preprocessor defs for compilation for the Fortran interface +# (-DNoChange, -DAdd_, -DAdd__, or -DUpCase) +# +CDEFS = -DAdd_ +# +# The directory in which Matlab is installed +# +MATLAB = /usr/sww/matlab + diff --git a/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/README.txt b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/README.txt new file mode 100644 index 0000000..77216f5 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/README.txt @@ -0,0 +1,12 @@ + +Progetto x SUPERLU 4.1 + +L'ho fatto io semplicemente includendo tutti i sorgenti necessari, siccome e' tutto C non ci +sono stati problemi. Non ho idea del perche' non abbia utilizzato MINGW o che altro, ma cosi' +funziona quindi OK. + +Creato con MS VS 2008, credo non ci debbano essere problemi a compilarlo anche col 2010... +Dentro ha tutto, Debug/Release e Win32/Win64. + + +Daniele Pini \ No newline at end of file diff --git a/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.sln b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.sln new file mode 100644 index 0000000..d446da9 --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SuperLU", "SuperLU.vcproj", "{CE6D481F-D1A9-45D9-B1BC-31723CC03F82}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Debug|Win32.ActiveCfg = Debug|Win32 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Debug|Win32.Build.0 = Debug|Win32 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Debug|x64.ActiveCfg = Debug|x64 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Debug|x64.Build.0 = Debug|x64 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Release|Win32.ActiveCfg = Release|Win32 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Release|Win32.Build.0 = Release|Win32 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Release|x64.ActiveCfg = Release|x64 + {CE6D481F-D1A9-45D9-B1BC-31723CC03F82}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.vcproj b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.vcproj new file mode 100644 index 0000000..1be6c7b --- /dev/null +++ b/thirdparty/superlu/SuperLU_4.1/prj/SuperLU/SuperLU.vcproj @@ -0,0 +1,1056 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/superlu/SuperLU_64.d.lib b/thirdparty/superlu/SuperLU_64.d.lib new file mode 100644 index 0000000..7afc65d Binary files /dev/null and b/thirdparty/superlu/SuperLU_64.d.lib differ diff --git a/thirdparty/superlu/SuperLU_64.lib b/thirdparty/superlu/SuperLU_64.lib new file mode 100644 index 0000000..d2d2d60 Binary files /dev/null and b/thirdparty/superlu/SuperLU_64.lib differ diff --git a/thirdparty/superlu/libsuperlu_4.1.a b/thirdparty/superlu/libsuperlu_4.1.a new file mode 100644 index 0000000..8d535eb Binary files /dev/null and b/thirdparty/superlu/libsuperlu_4.1.a differ diff --git a/thirdparty/zlib/zlib-1.2.7/CMakeLists.txt b/thirdparty/zlib/zlib-1.2.7/CMakeLists.txt new file mode 100644 index 0000000..7ee3bc4 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/CMakeLists.txt @@ -0,0 +1,211 @@ +cmake_minimum_required(VERSION 2.4.4) +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) + +project(zlib C) + +set(VERSION "1.2.7") + +set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") +set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") +set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") +set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages") +set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") + +include(CheckTypeSize) +include(CheckFunctionExists) +include(CheckIncludeFile) +include(CheckCSourceCompiles) +enable_testing() + +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(stdint.h HAVE_STDINT_H) +check_include_file(stddef.h HAVE_STDDEF_H) + +# +# Check to see if we have large file support +# +set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1) +# We add these other definitions here because CheckTypeSize.cmake +# in CMake 2.4.x does not automatically do so and we want +# compatibility with CMake 2.4.x. +if(HAVE_SYS_TYPES_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H) +endif() +if(HAVE_STDINT_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H) +endif() +if(HAVE_STDDEF_H) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H) +endif() +check_type_size(off64_t OFF64_T) +if(HAVE_OFF64_T) + add_definitions(-D_LARGEFILE64_SOURCE=1) +endif() +set(CMAKE_REQUIRED_DEFINITIONS) # clear variable + +# +# Check for fseeko +# +check_function_exists(fseeko HAVE_FSEEKO) +if(NOT HAVE_FSEEKO) + add_definitions(-DNO_FSEEKO) +endif() + +# +# Check for unistd.h +# +check_include_file(unistd.h Z_HAVE_UNISTD_H) + +if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +endif() + +if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) + # If we're doing an out of source build and the user has a zconf.h + # in their source tree... + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h) + message(STATUS "Renaming") + message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h") + message(STATUS "to 'zconf.h.included' because this file is included with zlib") + message(STATUS "but CMake generates it automatically in the build directory.") + file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included) + endif() +endif() + +set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc) +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein + ${ZLIB_PC} @ONLY) +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) + + +#============================================================================ +# zlib +#============================================================================ + +set(ZLIB_PUBLIC_HDRS + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h + zlib.h +) +set(ZLIB_PRIVATE_HDRS + crc32.h + deflate.h + gzguts.h + inffast.h + inffixed.h + inflate.h + inftrees.h + trees.h + zutil.h +) +set(ZLIB_SRCS + adler32.c + compress.c + crc32.c + deflate.c + gzclose.c + gzlib.c + gzread.c + gzwrite.c + inflate.c + infback.c + inftrees.c + inffast.c + trees.c + uncompr.c + zutil.c +) + +if(NOT MINGW) + set(ZLIB_SRCS ${ZLIB_SRCS} + win32/zlib1.rc # If present will override custom build rule below. + ) +endif() + +# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) +string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +if(MINGW) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + SET(CMAKE_RC_COMPILER windres.exe) + endif() + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + COMMAND ${CMAKE_RC_COMPILER} + -D GCC_WINDRES + -I ${CMAKE_CURRENT_SOURCE_DIR} + -I ${CMAKE_CURRENT_BINARY_DIR} + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) + set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) +endif(MINGW) + +add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) +set_target_properties(zlib PROPERTIES SOVERSION 1) + +if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version + # encoded into their final filename. We disable this on Cygwin because + # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll + # seems to be the default. + # + # This has no effect with MSVC, on that platform the version info for + # the DLL comes from the resource file win32/zlib1.rc + set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) +endif() + +if(UNIX) + # On unix-like platforms the library is almost always called libz + set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/zlib.map") +elseif(BUILD_SHARED_LIBS AND WIN32) + # Creates zlib1.dll when building shared library version + set_target_properties(zlib PROPERTIES SUFFIX "1.dll") +endif() + +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) + install(TARGETS zlib zlibstatic + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +endif() +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}") +endif() +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) + install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") +endif() +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) + install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") +endif() + +#============================================================================ +# Example binaries +#============================================================================ + +add_executable(example test/example.c) +target_link_libraries(example zlib) +add_test(example example) + +add_executable(minigzip test/minigzip.c) +target_link_libraries(minigzip zlib) + +if(HAVE_OFF64_T) + add_executable(example64 test/example.c) + target_link_libraries(example64 zlib) + set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + add_test(example64 example64) + + add_executable(minigzip64 test/minigzip.c) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") +endif() diff --git a/thirdparty/zlib/zlib-1.2.7/ChangeLog b/thirdparty/zlib/zlib-1.2.7/ChangeLog new file mode 100644 index 0000000..c2c643a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/ChangeLog @@ -0,0 +1,1409 @@ + + ChangeLog file for zlib + +Changes in 1.2.7 (2 May 2012) +- Replace use of memmove() with a simple copy for portability +- Test for existence of strerror +- Restore gzgetc_ for backward compatibility with 1.2.6 +- Fix build with non-GNU make on Solaris +- Require gcc 4.0 or later on Mac OS X to use the hidden attribute +- Include unistd.h for Watcom C +- Use __WATCOMC__ instead of __WATCOM__ +- Do not use the visibility attribute if NO_VIZ defined +- Improve the detection of no hidden visibility attribute +- Avoid using __int64 for gcc or solo compilation +- Cast to char * in gzprintf to avoid warnings [Zinser] +- Fix make_vms.com for VAX [Zinser] +- Don't use library or built-in byte swaps +- Simplify test and use of gcc hidden attribute +- Fix bug in gzclose_w() when gzwrite() fails to allocate memory +- Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen() +- Fix bug in test/minigzip.c for configure --solo +- Fix contrib/vstudio project link errors [Mohanathas] +- Add ability to choose the builder in make_vms.com [Schweda] +- Add DESTDIR support to mingw32 win32/Makefile.gcc +- Fix comments in win32/Makefile.gcc for proper usage +- Allow overriding the default install locations for cmake +- Generate and install the pkg-config file with cmake +- Build both a static and a shared version of zlib with cmake +- Include version symbols for cmake builds +- If using cmake with MSVC, add the source directory to the includes +- Remove unneeded EXTRA_CFLAGS from win32/Makefile.gcc [Truta] +- Move obsolete emx makefile to old [Truta] +- Allow the use of -Wundef when compiling or using zlib +- Avoid the use of the -u option with mktemp +- Improve inflate() documentation on the use of Z_FINISH +- Recognize clang as gcc +- Add gzopen_w() in Windows for wide character path names +- Rename zconf.h in CMakeLists.txt to move it out of the way +- Add source directory in CMakeLists.txt for building examples +- Look in build directory for zlib.pc in CMakeLists.txt +- Remove gzflags from zlibvc.def in vc9 and vc10 +- Fix contrib/minizip compilation in the MinGW environment +- Update ./configure for Solaris, support --64 [Mooney] +- Remove -R. from Solaris shared build (possible security issue) +- Avoid race condition for parallel make (-j) running example +- Fix type mismatch between get_crc_table() and crc_table +- Fix parsing of version with "-" in CMakeLists.txt [Snider, Ziegler] +- Fix the path to zlib.map in CMakeLists.txt +- Force the native libtool in Mac OS X to avoid GNU libtool [Beebe] +- Add instructions to win32/Makefile.gcc for shared install [Torri] + +Changes in 1.2.6.1 (12 Feb 2012) +- Avoid the use of the Objective-C reserved name "id" +- Include io.h in gzguts.h for Microsoft compilers +- Fix problem with ./configure --prefix and gzgetc macro +- Include gz_header definition when compiling zlib solo +- Put gzflags() functionality back in zutil.c +- Avoid library header include in crc32.c for Z_SOLO +- Use name in GCC_CLASSIC as C compiler for coverage testing, if set +- Minor cleanup in contrib/minizip/zip.c [Vollant] +- Update make_vms.com [Zinser] +- Remove unnecessary gzgetc_ function +- Use optimized byte swap operations for Microsoft and GNU [Snyder] +- Fix minor typo in zlib.h comments [Rzesniowiecki] + +Changes in 1.2.6 (29 Jan 2012) +- Update the Pascal interface in contrib/pascal +- Fix function numbers for gzgetc_ in zlibvc.def files +- Fix configure.ac for contrib/minizip [Schiffer] +- Fix large-entry detection in minizip on 64-bit systems [Schiffer] +- Have ./configure use the compiler return code for error indication +- Fix CMakeLists.txt for cross compilation [McClure] +- Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes] +- Fix compilation of contrib/minizip on FreeBSD [Marquez] +- Correct suggested usages in win32/Makefile.msc [Shachar, Horvath] +- Include io.h for Turbo C / Borland C on all platforms [Truta] +- Make version explicit in contrib/minizip/configure.ac [Bosmans] +- Avoid warning for no encryption in contrib/minizip/zip.c [Vollant] +- Minor cleanup up contrib/minizip/unzip.c [Vollant] +- Fix bug when compiling minizip with C++ [Vollant] +- Protect for long name and extra fields in contrib/minizip [Vollant] +- Avoid some warnings in contrib/minizip [Vollant] +- Add -I../.. -L../.. to CFLAGS for minizip and miniunzip +- Add missing libs to minizip linker command +- Add support for VPATH builds in contrib/minizip +- Add an --enable-demos option to contrib/minizip/configure +- Add the generation of configure.log by ./configure +- Exit when required parameters not provided to win32/Makefile.gcc +- Have gzputc return the character written instead of the argument +- Use the -m option on ldconfig for BSD systems [Tobias] +- Correct in zlib.map when deflateResetKeep was added + +Changes in 1.2.5.3 (15 Jan 2012) +- Restore gzgetc function for binary compatibility +- Do not use _lseeki64 under Borland C++ [Truta] +- Update win32/Makefile.msc to build test/*.c [Truta] +- Remove old/visualc6 given CMakefile and other alternatives +- Update AS400 build files and documentation [Monnerat] +- Update win32/Makefile.gcc to build test/*.c [Truta] +- Permit stronger flushes after Z_BLOCK flushes +- Avoid extraneous empty blocks when doing empty flushes +- Permit Z_NULL arguments to deflatePending +- Allow deflatePrime() to insert bits in the middle of a stream +- Remove second empty static block for Z_PARTIAL_FLUSH +- Write out all of the available bits when using Z_BLOCK +- Insert the first two strings in the hash table after a flush + +Changes in 1.2.5.2 (17 Dec 2011) +- fix ld error: unable to find version dependency 'ZLIB_1.2.5' +- use relative symlinks for shared libs +- Avoid searching past window for Z_RLE strategy +- Assure that high-water mark initialization is always applied in deflate +- Add assertions to fill_window() in deflate.c to match comments +- Update python link in README +- Correct spelling error in gzread.c +- Fix bug in gzgets() for a concatenated empty gzip stream +- Correct error in comment for gz_make() +- Change gzread() and related to ignore junk after gzip streams +- Allow gzread() and related to continue after gzclearerr() +- Allow gzrewind() and gzseek() after a premature end-of-file +- Simplify gzseek() now that raw after gzip is ignored +- Change gzgetc() to a macro for speed (~40% speedup in testing) +- Fix gzclose() to return the actual error last encountered +- Always add large file support for windows +- Include zconf.h for windows large file support +- Include zconf.h.cmakein for windows large file support +- Update zconf.h.cmakein on make distclean +- Merge vestigial vsnprintf determination from zutil.h to gzguts.h +- Clarify how gzopen() appends in zlib.h comments +- Correct documentation of gzdirect() since junk at end now ignored +- Add a transparent write mode to gzopen() when 'T' is in the mode +- Update python link in zlib man page +- Get inffixed.h and MAKEFIXED result to match +- Add a ./config --solo option to make zlib subset with no libary use +- Add undocumented inflateResetKeep() function for CAB file decoding +- Add --cover option to ./configure for gcc coverage testing +- Add #define ZLIB_CONST option to use const in the z_stream interface +- Add comment to gzdopen() in zlib.h to use dup() when using fileno() +- Note behavior of uncompress() to provide as much data as it can +- Add files in contrib/minizip to aid in building libminizip +- Split off AR options in Makefile.in and configure +- Change ON macro to Z_ARG to avoid application conflicts +- Facilitate compilation with Borland C++ for pragmas and vsnprintf +- Include io.h for Turbo C / Borland C++ +- Move example.c and minigzip.c to test/ +- Simplify incomplete code table filling in inflate_table() +- Remove code from inflate.c and infback.c that is impossible to execute +- Test the inflate code with full coverage +- Allow deflateSetDictionary, inflateSetDictionary at any time (in raw) +- Add deflateResetKeep and fix inflateResetKeep to retain dictionary +- Fix gzwrite.c to accommodate reduced memory zlib compilation +- Have inflate() with Z_FINISH avoid the allocation of a window +- Do not set strm->adler when doing raw inflate +- Fix gzeof() to behave just like feof() when read is not past end of file +- Fix bug in gzread.c when end-of-file is reached +- Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF +- Document gzread() capability to read concurrently written files +- Remove hard-coding of resource compiler in CMakeLists.txt [Blammo] + +Changes in 1.2.5.1 (10 Sep 2011) +- Update FAQ entry on shared builds (#13) +- Avoid symbolic argument to chmod in Makefile.in +- Fix bug and add consts in contrib/puff [Oberhumer] +- Update contrib/puff/zeros.raw test file to have all block types +- Add full coverage test for puff in contrib/puff/Makefile +- Fix static-only-build install in Makefile.in +- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno] +- Add libz.a dependency to shared in Makefile.in for parallel builds +- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out +- Replace $(...) with `...` in configure for non-bash sh [Bowler] +- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen] +- Add solaris* to Linux* in configure to allow gcc use [Groffen] +- Add *bsd* to Linux* case in configure [Bar-Lev] +- Add inffast.obj to dependencies in win32/Makefile.msc +- Correct spelling error in deflate.h [Kohler] +- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc +- Add test to configure for GNU C looking for gcc in output of $cc -v +- Add zlib.pc generation to win32/Makefile.gcc [Weigelt] +- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not +- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense +- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser) +- Make stronger test in zconf.h to include unistd.h for LFS +- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack] +- Fix zlib.h LFS support when Z_PREFIX used +- Add updated as400 support (removed from old) [Monnerat] +- Avoid deflate sensitivity to volatile input data +- Avoid division in adler32_combine for NO_DIVIDE +- Clarify the use of Z_FINISH with deflateBound() amount of space +- Set binary for output file in puff.c +- Use u4 type for crc_table to avoid conversion warnings +- Apply casts in zlib.h to avoid conversion warnings +- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] +- Improve inflateSync() documentation to note indeterminancy +- Add deflatePending() function to return the amount of pending output +- Correct the spelling of "specification" in FAQ [Randers-Pehrson] +- Add a check in configure for stdarg.h, use for gzprintf() +- Check that pointers fit in ints when gzprint() compiled old style +- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] +- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] +- Add debug records in assmebler code [Londer] +- Update RFC references to use http://tools.ietf.org/html/... [Li] +- Add --archs option, use of libtool to configure for Mac OS X [Borstel] + +Changes in 1.2.5 (19 Apr 2010) +- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev] +- Default to libdir as sharedlibdir in configure [Nieder] +- Update copyright dates on modified source files +- Update trees.c to be able to generate modified trees.h +- Exit configure for MinGW, suggesting win32/Makefile.gcc +- Check for NULL path in gz_open [Homurlu] + +Changes in 1.2.4.5 (18 Apr 2010) +- Set sharedlibdir in configure [Torok] +- Set LDFLAGS in Makefile.in [Bar-Lev] +- Avoid mkdir objs race condition in Makefile.in [Bowler] +- Add ZLIB_INTERNAL in front of internal inter-module functions and arrays +- Define ZLIB_INTERNAL to hide internal functions and arrays for GNU C +- Don't use hidden attribute when it is a warning generator (e.g. Solaris) + +Changes in 1.2.4.4 (18 Apr 2010) +- Fix CROSS_PREFIX executable testing, CHOST extract, mingw* [Torok] +- Undefine _LARGEFILE64_SOURCE in zconf.h if it is zero, but not if empty +- Try to use bash or ksh regardless of functionality of /bin/sh +- Fix configure incompatibility with NetBSD sh +- Remove attempt to run under bash or ksh since have better NetBSD fix +- Fix win32/Makefile.gcc for MinGW [Bar-Lev] +- Add diagnostic messages when using CROSS_PREFIX in configure +- Added --sharedlibdir option to configure [Weigelt] +- Use hidden visibility attribute when available [Frysinger] + +Changes in 1.2.4.3 (10 Apr 2010) +- Only use CROSS_PREFIX in configure for ar and ranlib if they exist +- Use CROSS_PREFIX for nm [Bar-Lev] +- Assume _LARGEFILE64_SOURCE defined is equivalent to true +- Avoid use of undefined symbols in #if with && and || +- Make *64 prototypes in gzguts.h consistent with functions +- Add -shared load option for MinGW in configure [Bowler] +- Move z_off64_t to public interface, use instead of off64_t +- Remove ! from shell test in configure (not portable to Solaris) +- Change +0 macro tests to -0 for possibly increased portability + +Changes in 1.2.4.2 (9 Apr 2010) +- Add consistent carriage returns to readme.txt's in masmx86 and masmx64 +- Really provide prototypes for *64 functions when building without LFS +- Only define unlink() in minigzip.c if unistd.h not included +- Update README to point to contrib/vstudio project files +- Move projects/vc6 to old/ and remove projects/ +- Include stdlib.h in minigzip.c for setmode() definition under WinCE +- Clean up assembler builds in win32/Makefile.msc [Rowe] +- Include sys/types.h for Microsoft for off_t definition +- Fix memory leak on error in gz_open() +- Symbolize nm as $NM in configure [Weigelt] +- Use TEST_LDSHARED instead of LDSHARED to link test programs [Weigelt] +- Add +0 to _FILE_OFFSET_BITS and _LFS64_LARGEFILE in case not defined +- Fix bug in gzeof() to take into account unused input data +- Avoid initialization of structures with variables in puff.c +- Updated win32/README-WIN32.txt [Rowe] + +Changes in 1.2.4.1 (28 Mar 2010) +- Remove the use of [a-z] constructs for sed in configure [gentoo 310225] +- Remove $(SHAREDLIB) from LIBS in Makefile.in [Creech] +- Restore "for debugging" comment on sprintf() in gzlib.c +- Remove fdopen for MVS from gzguts.h +- Put new README-WIN32.txt in win32 [Rowe] +- Add check for shell to configure and invoke another shell if needed +- Fix big fat stinking bug in gzseek() on uncompressed files +- Remove vestigial F_OPEN64 define in zutil.h +- Set and check the value of _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE +- Avoid errors on non-LFS systems when applications define LFS macros +- Set EXE to ".exe" in configure for MINGW [Kahle] +- Match crc32() in crc32.c exactly to the prototype in zlib.h [Sherrill] +- Add prefix for cross-compilation in win32/makefile.gcc [Bar-Lev] +- Add DLL install in win32/makefile.gcc [Bar-Lev] +- Allow Linux* or linux* from uname in configure [Bar-Lev] +- Allow ldconfig to be redefined in configure and Makefile.in [Bar-Lev] +- Add cross-compilation prefixes to configure [Bar-Lev] +- Match type exactly in gz_load() invocation in gzread.c +- Match type exactly of zcalloc() in zutil.c to zlib.h alloc_func +- Provide prototypes for *64 functions when building zlib without LFS +- Don't use -lc when linking shared library on MinGW +- Remove errno.h check in configure and vestigial errno code in zutil.h + +Changes in 1.2.4 (14 Mar 2010) +- Fix VER3 extraction in configure for no fourth subversion +- Update zlib.3, add docs to Makefile.in to make .pdf out of it +- Add zlib.3.pdf to distribution +- Don't set error code in gzerror() if passed pointer is NULL +- Apply destination directory fixes to CMakeLists.txt [Lowman] +- Move #cmakedefine's to a new zconf.in.cmakein +- Restore zconf.h for builds that don't use configure or cmake +- Add distclean to dummy Makefile for convenience +- Update and improve INDEX, README, and FAQ +- Update CMakeLists.txt for the return of zconf.h [Lowman] +- Update contrib/vstudio/vc9 and vc10 [Vollant] +- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc +- Apply license and readme changes to contrib/asm686 [Raiter] +- Check file name lengths and add -c option in minigzip.c [Li] +- Update contrib/amd64 and contrib/masmx86/ [Vollant] +- Avoid use of "eof" parameter in trees.c to not shadow library variable +- Update make_vms.com for removal of zlibdefs.h [Zinser] +- Update assembler code and vstudio projects in contrib [Vollant] +- Remove outdated assembler code contrib/masm686 and contrib/asm586 +- Remove old vc7 and vc8 from contrib/vstudio +- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe] +- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open() +- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant] +- Remove *64 functions from win32/zlib.def (they're not 64-bit yet) +- Fix bug in void-returning vsprintf() case in gzwrite.c +- Fix name change from inflate.h in contrib/inflate86/inffas86.c +- Check if temporary file exists before removing in make_vms.com [Zinser] +- Fix make install and uninstall for --static option +- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta] +- Update readme.txt in contrib/masmx64 and masmx86 to assemble + +Changes in 1.2.3.9 (21 Feb 2010) +- Expunge gzio.c +- Move as400 build information to old +- Fix updates in contrib/minizip and contrib/vstudio +- Add const to vsnprintf test in configure to avoid warnings [Weigelt] +- Delete zconf.h (made by configure) [Weigelt] +- Change zconf.in.h to zconf.h.in per convention [Weigelt] +- Check for NULL buf in gzgets() +- Return empty string for gzgets() with len == 1 (like fgets()) +- Fix description of gzgets() in zlib.h for end-of-file, NULL return +- Update minizip to 1.1 [Vollant] +- Avoid MSVC loss of data warnings in gzread.c, gzwrite.c +- Note in zlib.h that gzerror() should be used to distinguish from EOF +- Remove use of snprintf() from gzlib.c +- Fix bug in gzseek() +- Update contrib/vstudio, adding vc9 and vc10 [Kuno, Vollant] +- Fix zconf.h generation in CMakeLists.txt [Lowman] +- Improve comments in zconf.h where modified by configure + +Changes in 1.2.3.8 (13 Feb 2010) +- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer] +- Use z_off64_t in gz_zero() and gz_skip() to match state->skip +- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t) +- Revert to Makefile.in from 1.2.3.6 (live with the clutter) +- Fix missing error return in gzflush(), add zlib.h note +- Add *64 functions to zlib.map [Levin] +- Fix signed/unsigned comparison in gz_comp() +- Use SFLAGS when testing shared linking in configure +- Add --64 option to ./configure to use -m64 with gcc +- Fix ./configure --help to correctly name options +- Have make fail if a test fails [Levin] +- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson] +- Remove assembler object files from contrib + +Changes in 1.2.3.7 (24 Jan 2010) +- Always gzopen() with O_LARGEFILE if available +- Fix gzdirect() to work immediately after gzopen() or gzdopen() +- Make gzdirect() more precise when the state changes while reading +- Improve zlib.h documentation in many places +- Catch memory allocation failure in gz_open() +- Complete close operation if seek forward in gzclose_w() fails +- Return Z_ERRNO from gzclose_r() if close() fails +- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL +- Return zero for gzwrite() errors to match zlib.h description +- Return -1 on gzputs() error to match zlib.h description +- Add zconf.in.h to allow recovery from configure modification [Weigelt] +- Fix static library permissions in Makefile.in [Weigelt] +- Avoid warnings in configure tests that hide functionality [Weigelt] +- Add *BSD and DragonFly to Linux case in configure [gentoo 123571] +- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212] +- Avoid access of uninitialized data for first inflateReset2 call [Gomes] +- Keep object files in subdirectories to reduce the clutter somewhat +- Remove default Makefile and zlibdefs.h, add dummy Makefile +- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_ +- Remove zlibdefs.h completely -- modify zconf.h instead + +Changes in 1.2.3.6 (17 Jan 2010) +- Avoid void * arithmetic in gzread.c and gzwrite.c +- Make compilers happier with const char * for gz_error message +- Avoid unused parameter warning in inflate.c +- Avoid signed-unsigned comparison warning in inflate.c +- Indent #pragma's for traditional C +- Fix usage of strwinerror() in glib.c, change to gz_strwinerror() +- Correct email address in configure for system options +- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser] +- Update zlib.map [Brown] +- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [Torok] +- Apply various fixes to CMakeLists.txt [Lowman] +- Add checks on len in gzread() and gzwrite() +- Add error message for no more room for gzungetc() +- Remove zlib version check in gzwrite() +- Defer compression of gzprintf() result until need to +- Use snprintf() in gzdopen() if available +- Remove USE_MMAP configuration determination (only used by minigzip) +- Remove examples/pigz.c (available separately) +- Update examples/gun.c to 1.6 + +Changes in 1.2.3.5 (8 Jan 2010) +- Add space after #if in zutil.h for some compilers +- Fix relatively harmless bug in deflate_fast() [Exarevsky] +- Fix same problem in deflate_slow() +- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown] +- Add deflate_rle() for faster Z_RLE strategy run-length encoding +- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding +- Change name of "write" variable in inffast.c to avoid library collisions +- Fix premature EOF from gzread() in gzio.c [Brown] +- Use zlib header window size if windowBits is 0 in inflateInit2() +- Remove compressBound() call in deflate.c to avoid linking compress.o +- Replace use of errno in gz* with functions, support WinCE [Alves] +- Provide alternative to perror() in minigzip.c for WinCE [Alves] +- Don't use _vsnprintf on later versions of MSVC [Lowman] +- Add CMake build script and input file [Lowman] +- Update contrib/minizip to 1.1 [Svensson, Vollant] +- Moved nintendods directory from contrib to . +- Replace gzio.c with a new set of routines with the same functionality +- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above +- Update contrib/minizip to 1.1b +- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h + +Changes in 1.2.3.4 (21 Dec 2009) +- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility +- Update comments in configure and Makefile.in for default --shared +- Fix test -z's in configure [Marquess] +- Build examplesh and minigzipsh when not testing +- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h +- Import LDFLAGS from the environment in configure +- Fix configure to populate SFLAGS with discovered CFLAGS options +- Adapt make_vms.com to the new Makefile.in [Zinser] +- Add zlib2ansi script for C++ compilation [Marquess] +- Add _FILE_OFFSET_BITS=64 test to make test (when applicable) +- Add AMD64 assembler code for longest match to contrib [Teterin] +- Include options from $SFLAGS when doing $LDSHARED +- Simplify 64-bit file support by introducing z_off64_t type +- Make shared object files in objs directory to work around old Sun cc +- Use only three-part version number for Darwin shared compiles +- Add rc option to ar in Makefile.in for when ./configure not run +- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4* +- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile +- Protect against _FILE_OFFSET_BITS being defined when compiling zlib +- Rename Makefile.in targets allstatic to static and allshared to shared +- Fix static and shared Makefile.in targets to be independent +- Correct error return bug in gz_open() by setting state [Brown] +- Put spaces before ;;'s in configure for better sh compatibility +- Add pigz.c (parallel implementation of gzip) to examples/ +- Correct constant in crc32.c to UL [Leventhal] +- Reject negative lengths in crc32_combine() +- Add inflateReset2() function to work like inflateEnd()/inflateInit2() +- Include sys/types.h for _LARGEFILE64_SOURCE [Brown] +- Correct typo in doc/algorithm.txt [Janik] +- Fix bug in adler32_combine() [Zhu] +- Catch missing-end-of-block-code error in all inflates and in puff + Assures that random input to inflate eventually results in an error +- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/ +- Update ENOUGH and its usage to reflect discovered bounds +- Fix gzerror() error report on empty input file [Brown] +- Add ush casts in trees.c to avoid pedantic runtime errors +- Fix typo in zlib.h uncompress() description [Reiss] +- Correct inflate() comments with regard to automatic header detection +- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays) +- Put new version of gzlog (2.0) in examples with interruption recovery +- Add puff compile option to permit invalid distance-too-far streams +- Add puff TEST command options, ability to read piped input +- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but + _LARGEFILE64_SOURCE not defined +- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart +- Fix deflateSetDictionary() to use all 32K for output consistency +- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h) +- Clear bytes after deflate lookahead to avoid use of uninitialized data +- Change a limit in inftrees.c to be more transparent to Coverity Prevent +- Update win32/zlib.def with exported symbols from zlib.h +- Correct spelling errors in zlib.h [Willem, Sobrado] +- Allow Z_BLOCK for deflate() to force a new block +- Allow negative bits in inflatePrime() to delete existing bit buffer +- Add Z_TREES flush option to inflate() to return at end of trees +- Add inflateMark() to return current state information for random access +- Add Makefile for NintendoDS to contrib [Costa] +- Add -w in configure compile tests to avoid spurious warnings [Beucler] +- Fix typos in zlib.h comments for deflateSetDictionary() +- Fix EOF detection in transparent gzread() [Maier] + +Changes in 1.2.3.3 (2 October 2006) +- Make --shared the default for configure, add a --static option +- Add compile option to permit invalid distance-too-far streams +- Add inflateUndermine() function which is required to enable above +- Remove use of "this" variable name for C++ compatibility [Marquess] +- Add testing of shared library in make test, if shared library built +- Use ftello() and fseeko() if available instead of ftell() and fseek() +- Provide two versions of all functions that use the z_off_t type for + binary compatibility -- a normal version and a 64-bit offset version, + per the Large File Support Extension when _LARGEFILE64_SOURCE is + defined; use the 64-bit versions by default when _FILE_OFFSET_BITS + is defined to be 64 +- Add a --uname= option to configure to perhaps help with cross-compiling + +Changes in 1.2.3.2 (3 September 2006) +- Turn off silly Borland warnings [Hay] +- Use off64_t and define _LARGEFILE64_SOURCE when present +- Fix missing dependency on inffixed.h in Makefile.in +- Rig configure --shared to build both shared and static [Teredesai, Truta] +- Remove zconf.in.h and instead create a new zlibdefs.h file +- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant] +- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt] + +Changes in 1.2.3.1 (16 August 2006) +- Add watcom directory with OpenWatcom make files [Daniel] +- Remove #undef of FAR in zconf.in.h for MVS [Fedtke] +- Update make_vms.com [Zinser] +- Use -fPIC for shared build in configure [Teredesai, Nicholson] +- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen] +- Use fdopen() (not _fdopen()) for Interix in zutil.h [B�ck] +- Add some FAQ entries about the contrib directory +- Update the MVS question in the FAQ +- Avoid extraneous reads after EOF in gzio.c [Brown] +- Correct spelling of "successfully" in gzio.c [Randers-Pehrson] +- Add comments to zlib.h about gzerror() usage [Brown] +- Set extra flags in gzip header in gzopen() like deflate() does +- Make configure options more compatible with double-dash conventions + [Weigelt] +- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen] +- Fix uninstall target in Makefile.in [Truta] +- Add pkgconfig support [Weigelt] +- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt] +- Replace set_data_type() with a more accurate detect_data_type() in + trees.c, according to the txtvsbin.txt document [Truta] +- Swap the order of #include and #include "zlib.h" in + gzio.c, example.c and minigzip.c [Truta] +- Shut up annoying VS2005 warnings about standard C deprecation [Rowe, + Truta] (where?) +- Fix target "clean" from win32/Makefile.bor [Truta] +- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe] +- Update zlib www home address in win32/DLL_FAQ.txt [Truta] +- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove] +- Enable browse info in the "Debug" and "ASM Debug" configurations in + the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta] +- Add pkgconfig support [Weigelt] +- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h, + for use in win32/zlib1.rc [Polushin, Rowe, Truta] +- Add a document that explains the new text detection scheme to + doc/txtvsbin.txt [Truta] +- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta] +- Move algorithm.txt into doc/ [Truta] +- Synchronize FAQ with website +- Fix compressBound(), was low for some pathological cases [Fearnley] +- Take into account wrapper variations in deflateBound() +- Set examples/zpipe.c input and output to binary mode for Windows +- Update examples/zlib_how.html with new zpipe.c (also web site) +- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems + that gcc became pickier in 4.0) +- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain + un-versioned, the patch adds versioning only for symbols introduced in + zlib-1.2.0 or later. It also declares as local those symbols which are + not designed to be exported." [Levin] +- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure +- Do not initialize global static by default in trees.c, add a response + NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess] +- Don't use strerror() in gzio.c under WinCE [Yakimov] +- Don't use errno.h in zutil.h under WinCE [Yakimov] +- Move arguments for AR to its usage to allow replacing ar [Marot] +- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson] +- Improve inflateInit() and inflateInit2() documentation +- Fix structure size comment in inflate.h +- Change configure help option from --h* to --help [Santos] + +Changes in 1.2.3 (18 July 2005) +- Apply security vulnerability fixes to contrib/infback9 as well +- Clean up some text files (carriage returns, trailing space) +- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant] + +Changes in 1.2.2.4 (11 July 2005) +- Add inflatePrime() function for starting inflation at bit boundary +- Avoid some Visual C warnings in deflate.c +- Avoid more silly Visual C warnings in inflate.c and inftrees.c for 64-bit + compile +- Fix some spelling errors in comments [Betts] +- Correct inflateInit2() error return documentation in zlib.h +- Add zran.c example of compressed data random access to examples + directory, shows use of inflatePrime() +- Fix cast for assignments to strm->state in inflate.c and infback.c +- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] +- Move declarations of gf2 functions to right place in crc32.c [Oberhumer] +- Add cast in trees.c t avoid a warning [Oberhumer] +- Avoid some warnings in fitblk.c, gun.c, gzjoin.c in examples [Oberhumer] +- Update make_vms.com [Zinser] +- Initialize state->write in inflateReset() since copied in inflate_fast() +- Be more strict on incomplete code sets in inflate_table() and increase + ENOUGH and MAXD -- this repairs a possible security vulnerability for + invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for + discovering the vulnerability and providing test cases. +- Add ia64 support to configure for HP-UX [Smith] +- Add error return to gzread() for format or i/o error [Levin] +- Use malloc.h for OS/2 [Necasek] + +Changes in 1.2.2.3 (27 May 2005) +- Replace 1U constants in inflate.c and inftrees.c for 64-bit compile +- Typecast fread() return values in gzio.c [Vollant] +- Remove trailing space in minigzip.c outmode (VC++ can't deal with it) +- Fix crc check bug in gzread() after gzungetc() [Heiner] +- Add the deflateTune() function to adjust internal compression parameters +- Add a fast gzip decompressor, gun.c, to examples (use of inflateBack) +- Remove an incorrect assertion in examples/zpipe.c +- Add C++ wrapper in infback9.h [Donais] +- Fix bug in inflateCopy() when decoding fixed codes +- Note in zlib.h how much deflateSetDictionary() actually uses +- Remove USE_DICT_HEAD in deflate.c (would mess up inflate if used) +- Add _WIN32_WCE to define WIN32 in zconf.in.h [Spencer] +- Don't include stderr.h or errno.h for _WIN32_WCE in zutil.h [Spencer] +- Add gzdirect() function to indicate transparent reads +- Update contrib/minizip [Vollant] +- Fix compilation of deflate.c when both ASMV and FASTEST [Oberhumer] +- Add casts in crc32.c to avoid warnings [Oberhumer] +- Add contrib/masmx64 [Vollant] +- Update contrib/asm586, asm686, masmx86, testzlib, vstudio [Vollant] + +Changes in 1.2.2.2 (30 December 2004) +- Replace structure assignments in deflate.c and inflate.c with zmemcpy to + avoid implicit memcpy calls (portability for no-library compilation) +- Increase sprintf() buffer size in gzdopen() to allow for large numbers +- Add INFLATE_STRICT to check distances against zlib header +- Improve WinCE errno handling and comments [Chang] +- Remove comment about no gzip header processing in FAQ +- Add Z_FIXED strategy option to deflateInit2() to force fixed trees +- Add updated make_vms.com [Coghlan], update README +- Create a new "examples" directory, move gzappend.c there, add zpipe.c, + fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html. +- Add FAQ entry and comments in deflate.c on uninitialized memory access +- Add Solaris 9 make options in configure [Gilbert] +- Allow strerror() usage in gzio.c for STDC +- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer] +- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant] +- Use z_off_t for adler32_combine() and crc32_combine() lengths +- Make adler32() much faster for small len +- Use OS_CODE in deflate() default gzip header + +Changes in 1.2.2.1 (31 October 2004) +- Allow inflateSetDictionary() call for raw inflate +- Fix inflate header crc check bug for file names and comments +- Add deflateSetHeader() and gz_header structure for custom gzip headers +- Add inflateGetheader() to retrieve gzip headers +- Add crc32_combine() and adler32_combine() functions +- Add alloc_func, free_func, in_func, out_func to Z_PREFIX list +- Use zstreamp consistently in zlib.h (inflate_back functions) +- Remove GUNZIP condition from definition of inflate_mode in inflate.h + and in contrib/inflate86/inffast.S [Truta, Anderson] +- Add support for AMD64 in contrib/inflate86/inffas86.c [Anderson] +- Update projects/README.projects and projects/visualc6 [Truta] +- Update win32/DLL_FAQ.txt [Truta] +- Avoid warning under NO_GZCOMPRESS in gzio.c; fix typo [Truta] +- Deprecate Z_ASCII; use Z_TEXT instead [Truta] +- Use a new algorithm for setting strm->data_type in trees.c [Truta] +- Do not define an exit() prototype in zutil.c unless DEBUG defined +- Remove prototype of exit() from zutil.c, example.c, minigzip.c [Truta] +- Add comment in zlib.h for Z_NO_FLUSH parameter to deflate() +- Fix Darwin build version identification [Peterson] + +Changes in 1.2.2 (3 October 2004) +- Update zlib.h comments on gzip in-memory processing +- Set adler to 1 in inflateReset() to support Java test suite [Walles] +- Add contrib/dotzlib [Ravn] +- Update win32/DLL_FAQ.txt [Truta] +- Update contrib/minizip [Vollant] +- Move contrib/visual-basic.txt to old/ [Truta] +- Fix assembler builds in projects/visualc6/ [Truta] + +Changes in 1.2.1.2 (9 September 2004) +- Update INDEX file +- Fix trees.c to update strm->data_type (no one ever noticed!) +- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] +- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) +- Add limited multitasking protection to DYNAMIC_CRC_TABLE +- Add NO_vsnprintf for VMS in zutil.h [Mozilla] +- Don't declare strerror() under VMS [Mozilla] +- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize +- Update contrib/ada [Anisimkov] +- Update contrib/minizip [Vollant] +- Fix configure to not hardcode directories for Darwin [Peterson] +- Fix gzio.c to not return error on empty files [Brown] +- Fix indentation; update version in contrib/delphi/ZLib.pas and + contrib/pascal/zlibpas.pas [Truta] +- Update mkasm.bat in contrib/masmx86 [Truta] +- Update contrib/untgz [Truta] +- Add projects/README.projects [Truta] +- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] +- Update win32/DLL_FAQ.txt [Truta] +- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] +- Remove an unnecessary assignment to curr in inftrees.c [Truta] +- Add OS/2 to exe builds in configure [Poltorak] +- Remove err dummy parameter in zlib.h [Kientzle] + +Changes in 1.2.1.1 (9 January 2004) +- Update email address in README +- Several FAQ updates +- Fix a big fat bug in inftrees.c that prevented decoding valid + dynamic blocks with only literals and no distance codes -- + Thanks to "Hot Emu" for the bug report and sample file +- Add a note to puff.c on no distance codes case. + +Changes in 1.2.1 (17 November 2003) +- Remove a tab in contrib/gzappend/gzappend.c +- Update some interfaces in contrib for new zlib functions +- Update zlib version number in some contrib entries +- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta] +- Support shared libraries on Hurd and KFreeBSD [Brown] +- Fix error in NO_DIVIDE option of adler32.c + +Changes in 1.2.0.8 (4 November 2003) +- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas +- Add experimental NO_DIVIDE #define in adler32.c + - Possibly faster on some processors (let me know if it is) +- Correct Z_BLOCK to not return on first inflate call if no wrap +- Fix strm->data_type on inflate() return to correctly indicate EOB +- Add deflatePrime() function for appending in the middle of a byte +- Add contrib/gzappend for an example of appending to a stream +- Update win32/DLL_FAQ.txt [Truta] +- Delete Turbo C comment in README [Truta] +- Improve some indentation in zconf.h [Truta] +- Fix infinite loop on bad input in configure script [Church] +- Fix gzeof() for concatenated gzip files [Johnson] +- Add example to contrib/visual-basic.txt [Michael B.] +- Add -p to mkdir's in Makefile.in [vda] +- Fix configure to properly detect presence or lack of printf functions +- Add AS400 support [Monnerat] +- Add a little Cygwin support [Wilson] + +Changes in 1.2.0.7 (21 September 2003) +- Correct some debug formats in contrib/infback9 +- Cast a type in a debug statement in trees.c +- Change search and replace delimiter in configure from % to # [Beebe] +- Update contrib/untgz to 0.2 with various fixes [Truta] +- Add build support for Amiga [Nikl] +- Remove some directories in old that have been updated to 1.2 +- Add dylib building for Mac OS X in configure and Makefile.in +- Remove old distribution stuff from Makefile +- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X +- Update links in README + +Changes in 1.2.0.6 (13 September 2003) +- Minor FAQ updates +- Update contrib/minizip to 1.00 [Vollant] +- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta] +- Update POSTINC comment for 68060 [Nikl] +- Add contrib/infback9 with deflate64 decoding (unsupported) +- For MVS define NO_vsnprintf and undefine FAR [van Burik] +- Add pragma for fdopen on MVS [van Burik] + +Changes in 1.2.0.5 (8 September 2003) +- Add OF to inflateBackEnd() declaration in zlib.h +- Remember start when using gzdopen in the middle of a file +- Use internal off_t counters in gz* functions to properly handle seeks +- Perform more rigorous check for distance-too-far in inffast.c +- Add Z_BLOCK flush option to return from inflate at block boundary +- Set strm->data_type on return from inflate + - Indicate bits unused, if at block boundary, and if in last block +- Replace size_t with ptrdiff_t in crc32.c, and check for correct size +- Add condition so old NO_DEFLATE define still works for compatibility +- FAQ update regarding the Windows DLL [Truta] +- INDEX update: add qnx entry, remove aix entry [Truta] +- Install zlib.3 into mandir [Wilson] +- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta] +- Adapt the zlib interface to the new DLL convention guidelines [Truta] +- Introduce ZLIB_WINAPI macro to allow the export of functions using + the WINAPI calling convention, for Visual Basic [Vollant, Truta] +- Update msdos and win32 scripts and makefiles [Truta] +- Export symbols by name, not by ordinal, in win32/zlib.def [Truta] +- Add contrib/ada [Anisimkov] +- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta] +- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant] +- Add contrib/masm686 [Truta] +- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm + [Truta, Vollant] +- Update contrib/delphi; rename to contrib/pascal; add example [Truta] +- Remove contrib/delphi2; add a new contrib/delphi [Truta] +- Avoid inclusion of the nonstandard in contrib/iostream, + and fix some method prototypes [Truta] +- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip + [Truta] +- Avoid the use of backslash (\) in contrib/minizip [Vollant] +- Fix file time handling in contrib/untgz; update makefiles [Truta] +- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines + [Vollant] +- Remove contrib/vstudio/vc15_16 [Vollant] +- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta] +- Update README.contrib [Truta] +- Invert the assignment order of match_head and s->prev[...] in + INSERT_STRING [Truta] +- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings + [Truta] +- Compare function pointers with 0, not with NULL or Z_NULL [Truta] +- Fix prototype of syncsearch in inflate.c [Truta] +- Introduce ASMINF macro to be enabled when using an ASM implementation + of inflate_fast [Truta] +- Change NO_DEFLATE to NO_GZCOMPRESS [Truta] +- Modify test_gzio in example.c to take a single file name as a + parameter [Truta] +- Exit the example.c program if gzopen fails [Truta] +- Add type casts around strlen in example.c [Truta] +- Remove casting to sizeof in minigzip.c; give a proper type + to the variable compared with SUFFIX_LEN [Truta] +- Update definitions of STDC and STDC99 in zconf.h [Truta] +- Synchronize zconf.h with the new Windows DLL interface [Truta] +- Use SYS16BIT instead of __32BIT__ to distinguish between + 16- and 32-bit platforms [Truta] +- Use far memory allocators in small 16-bit memory models for + Turbo C [Truta] +- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in + zlibCompileFlags [Truta] +- Cygwin has vsnprintf [Wilson] +- In Windows16, OS_CODE is 0, as in MSDOS [Truta] +- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson] + +Changes in 1.2.0.4 (10 August 2003) +- Minor FAQ updates +- Be more strict when checking inflateInit2's windowBits parameter +- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well +- Add gzip wrapper option to deflateInit2 using windowBits +- Add updated QNX rule in configure and qnx directory [Bonnefoy] +- Make inflate distance-too-far checks more rigorous +- Clean up FAR usage in inflate +- Add casting to sizeof() in gzio.c and minigzip.c + +Changes in 1.2.0.3 (19 July 2003) +- Fix silly error in gzungetc() implementation [Vollant] +- Update contrib/minizip and contrib/vstudio [Vollant] +- Fix printf format in example.c +- Correct cdecl support in zconf.in.h [Anisimkov] +- Minor FAQ updates + +Changes in 1.2.0.2 (13 July 2003) +- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons +- Attempt to avoid warnings in crc32.c for pointer-int conversion +- Add AIX to configure, remove aix directory [Bakker] +- Add some casts to minigzip.c +- Improve checking after insecure sprintf() or vsprintf() calls +- Remove #elif's from crc32.c +- Change leave label to inf_leave in inflate.c and infback.c to avoid + library conflicts +- Remove inflate gzip decoding by default--only enable gzip decoding by + special request for stricter backward compatibility +- Add zlibCompileFlags() function to return compilation information +- More typecasting in deflate.c to avoid warnings +- Remove leading underscore from _Capital #defines [Truta] +- Fix configure to link shared library when testing +- Add some Windows CE target adjustments [Mai] +- Remove #define ZLIB_DLL in zconf.h [Vollant] +- Add zlib.3 [Rodgers] +- Update RFC URL in deflate.c and algorithm.txt [Mai] +- Add zlib_dll_FAQ.txt to contrib [Truta] +- Add UL to some constants [Truta] +- Update minizip and vstudio [Vollant] +- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h +- Expand use of NO_DUMMY_DECL to avoid all dummy structures +- Added iostream3 to contrib [Schwardt] +- Replace rewind() with fseek() for WinCE [Truta] +- Improve setting of zlib format compression level flags + - Report 0 for huffman and rle strategies and for level == 0 or 1 + - Report 2 only for level == 6 +- Only deal with 64K limit when necessary at compile time [Truta] +- Allow TOO_FAR check to be turned off at compile time [Truta] +- Add gzclearerr() function [Souza] +- Add gzungetc() function + +Changes in 1.2.0.1 (17 March 2003) +- Add Z_RLE strategy for run-length encoding [Truta] + - When Z_RLE requested, restrict matches to distance one + - Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE +- Correct FASTEST compilation to allow level == 0 +- Clean up what gets compiled for FASTEST +- Incorporate changes to zconf.in.h [Vollant] + - Refine detection of Turbo C need for dummy returns + - Refine ZLIB_DLL compilation + - Include additional header file on VMS for off_t typedef +- Try to use _vsnprintf where it supplants vsprintf [Vollant] +- Add some casts in inffast.c +- Enchance comments in zlib.h on what happens if gzprintf() tries to + write more than 4095 bytes before compression +- Remove unused state from inflateBackEnd() +- Remove exit(0) from minigzip.c, example.c +- Get rid of all those darn tabs +- Add "check" target to Makefile.in that does the same thing as "test" +- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in +- Update contrib/inflate86 [Anderson] +- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant] +- Add msdos and win32 directories with makefiles [Truta] +- More additions and improvements to the FAQ + +Changes in 1.2.0 (9 March 2003) +- New and improved inflate code + - About 20% faster + - Does not allocate 32K window unless and until needed + - Automatically detects and decompresses gzip streams + - Raw inflate no longer needs an extra dummy byte at end + - Added inflateBack functions using a callback interface--even faster + than inflate, useful for file utilities (gzip, zip) + - Added inflateCopy() function to record state for random access on + externally generated deflate streams (e.g. in gzip files) + - More readable code (I hope) +- New and improved crc32() + - About 50% faster, thanks to suggestions from Rodney Brown +- Add deflateBound() and compressBound() functions +- Fix memory leak in deflateInit2() +- Permit setting dictionary for raw deflate (for parallel deflate) +- Fix const declaration for gzwrite() +- Check for some malloc() failures in gzio.c +- Fix bug in gzopen() on single-byte file 0x1f +- Fix bug in gzread() on concatenated file with 0x1f at end of buffer + and next buffer doesn't start with 0x8b +- Fix uncompress() to return Z_DATA_ERROR on truncated input +- Free memory at end of example.c +- Remove MAX #define in trees.c (conflicted with some libraries) +- Fix static const's in deflate.c, gzio.c, and zutil.[ch] +- Declare malloc() and free() in gzio.c if STDC not defined +- Use malloc() instead of calloc() in zutil.c if int big enough +- Define STDC for AIX +- Add aix/ with approach for compiling shared library on AIX +- Add HP-UX support for shared libraries in configure +- Add OpenUNIX support for shared libraries in configure +- Use $cc instead of gcc to build shared library +- Make prefix directory if needed when installing +- Correct Macintosh avoidance of typedef Byte in zconf.h +- Correct Turbo C memory allocation when under Linux +- Use libz.a instead of -lz in Makefile (assure use of compiled library) +- Update configure to check for snprintf or vsnprintf functions and their + return value, warn during make if using an insecure function +- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that + is lost when library is used--resolution is to build new zconf.h +- Documentation improvements (in zlib.h): + - Document raw deflate and inflate + - Update RFCs URL + - Point out that zlib and gzip formats are different + - Note that Z_BUF_ERROR is not fatal + - Document string limit for gzprintf() and possible buffer overflow + - Note requirement on avail_out when flushing + - Note permitted values of flush parameter of inflate() +- Add some FAQs (and even answers) to the FAQ +- Add contrib/inflate86/ for x86 faster inflate +- Add contrib/blast/ for PKWare Data Compression Library decompression +- Add contrib/puff/ simple inflate for deflate format description + +Changes in 1.1.4 (11 March 2002) +- ZFREE was repeated on same allocation on some error conditions. + This creates a security problem described in + http://www.zlib.org/advisory-2002-03-11.txt +- Returned incorrect error (Z_MEM_ERROR) on some invalid data +- Avoid accesses before window for invalid distances with inflate window + less than 32K. +- force windowBits > 8 to avoid a bug in the encoder for a window size + of 256 bytes. (A complete fix will be available in 1.1.5). + +Changes in 1.1.3 (9 July 1998) +- fix "an inflate input buffer bug that shows up on rare but persistent + occasions" (Mark) +- fix gzread and gztell for concatenated .gz files (Didier Le Botlan) +- fix gzseek(..., SEEK_SET) in write mode +- fix crc check after a gzeek (Frank Faubert) +- fix miniunzip when the last entry in a zip file is itself a zip file + (J Lillge) +- add contrib/asm586 and contrib/asm686 (Brian Raiter) + See http://www.muppetlabs.com/~breadbox/software/assembly.html +- add support for Delphi 3 in contrib/delphi (Bob Dellaca) +- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti) +- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren) +- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks) +- added a FAQ file + +- Support gzdopen on Mac with Metrowerks (Jason Linhart) +- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart) +- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young) +- avoid some warnings with Borland C (Tom Tanner) +- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant) +- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant) +- allow several arguments to configure (Tim Mooney, Frodo Looijaard) +- use libdir and includedir in Makefile.in (Tim Mooney) +- support shared libraries on OSF1 V4 (Tim Mooney) +- remove so_locations in "make clean" (Tim Mooney) +- fix maketree.c compilation error (Glenn, Mark) +- Python interface to zlib now in Python 1.5 (Jeremy Hylton) +- new Makefile.riscos (Rich Walker) +- initialize static descriptors in trees.c for embedded targets (Nick Smith) +- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith) +- add the OS/2 files in Makefile.in too (Andrew Zabolotny) +- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane) +- fix maketree.c to allow clean compilation of inffixed.h (Mark) +- fix parameter check in deflateCopy (Gunther Nikl) +- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler) +- Many portability patches by Christian Spieler: + . zutil.c, zutil.h: added "const" for zmem* + . Make_vms.com: fixed some typos + . Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists + . msdos/Makefile.msc: remove "default rtl link library" info from obj files + . msdos/Makefile.*: use model-dependent name for the built zlib library + . msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc: + new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT) +- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane) +- replace __far with _far for better portability (Christian Spieler, Tom Lane) +- fix test for errno.h in configure (Tim Newsham) + +Changes in 1.1.2 (19 March 98) +- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) + See http://www.winimage.com/zLibDll/unzip.html +- preinitialize the inflate tables for fixed codes, to make the code + completely thread safe (Mark) +- some simplifications and slight speed-up to the inflate code (Mark) +- fix gzeof on non-compressed files (Allan Schrum) +- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) +- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) +- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) +- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) +- do not wrap extern "C" around system includes (Tom Lane) +- mention zlib binding for TCL in README (Andreas Kupries) +- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) +- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) +- allow "configure --prefix $HOME" (Tim Mooney) +- remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) +- move Makefile.sas to amiga/Makefile.sas + +Changes in 1.1.1 (27 Feb 98) +- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson) +- remove block truncation heuristic which had very marginal effect for zlib + (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the + compression ratio on some files. This also allows inlining _tr_tally for + matches in deflate_slow. +- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier) + +Changes in 1.1.0 (24 Feb 98) +- do not return STREAM_END prematurely in inflate (John Bowler) +- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler) +- compile with -DFASTEST to get compression code optimized for speed only +- in minigzip, try mmap'ing the input file first (Miguel Albrecht) +- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain + on Sun but significant on HP) + +- add a pointer to experimental unzip library in README (Gilles Vollant) +- initialize variable gcc in configure (Chris Herborth) + +Changes in 1.0.9 (17 Feb 1998) +- added gzputs and gzgets functions +- do not clear eof flag in gzseek (Mark Diekhans) +- fix gzseek for files in transparent mode (Mark Diekhans) +- do not assume that vsprintf returns the number of bytes written (Jens Krinke) +- replace EXPORT with ZEXPORT to avoid conflict with other programs +- added compress2 in zconf.h, zlib.def, zlib.dnt +- new asm code from Gilles Vollant in contrib/asm386 +- simplify the inflate code (Mark): + . Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new() + . ZALLOC the length list in inflate_trees_fixed() instead of using stack + . ZALLOC the value area for huft_build() instead of using stack + . Simplify Z_FINISH check in inflate() + +- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 +- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) +- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with + the declaration of FAR (Gilles VOllant) +- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) +- read_buf buf parameter of type Bytef* instead of charf* +- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) +- do not redeclare unlink in minigzip.c for WIN32 (John Bowler) +- fix check for presence of directories in "make install" (Ian Willis) + +Changes in 1.0.8 (27 Jan 1998) +- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant) +- fix gzgetc and gzputc for big endian systems (Markus Oberhumer) +- added compress2() to allow setting the compression level +- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong) +- use constant arrays for the static trees in trees.c instead of computing + them at run time (thanks to Ken Raeburn for this suggestion). To create + trees.h, compile with GEN_TREES_H and run "make test". +- check return code of example in "make test" and display result +- pass minigzip command line options to file_compress +- simplifying code of inflateSync to avoid gcc 2.8 bug + +- support CC="gcc -Wall" in configure -s (QingLong) +- avoid a flush caused by ftell in gzopen for write mode (Ken Raeburn) +- fix test for shared library support to avoid compiler warnings +- zlib.lib -> zlib.dll in msdos/zlib.rc (Gilles Vollant) +- check for TARGET_OS_MAC in addition to MACOS (Brad Pettit) +- do not use fdopen for Metrowerks on Mac (Brad Pettit)) +- add checks for gzputc and gzputc in example.c +- avoid warnings in gzio.c and deflate.c (Andreas Kleinert) +- use const for the CRC table (Ken Raeburn) +- fixed "make uninstall" for shared libraries +- use Tracev instead of Trace in infblock.c +- in example.c use correct compressed length for test_sync +- suppress +vnocompatwarnings in configure for HPUX (not always supported) + +Changes in 1.0.7 (20 Jan 1998) +- fix gzseek which was broken in write mode +- return error for gzseek to negative absolute position +- fix configure for Linux (Chun-Chung Chen) +- increase stack space for MSC (Tim Wegner) +- get_crc_table and inflateSyncPoint are EXPORTed (Gilles Vollant) +- define EXPORTVA for gzprintf (Gilles Vollant) +- added man page zlib.3 (Rick Rodgers) +- for contrib/untgz, fix makedir() and improve Makefile + +- check gzseek in write mode in example.c +- allocate extra buffer for seeks only if gzseek is actually called +- avoid signed/unsigned comparisons (Tim Wegner, Gilles Vollant) +- add inflateSyncPoint in zconf.h +- fix list of exported functions in nt/zlib.dnt and mdsos/zlib.def + +Changes in 1.0.6 (19 Jan 1998) +- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and + gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code) +- Fix a deflate bug occurring only with compression level 0 (thanks to + Andy Buckler for finding this one). +- In minigzip, pass transparently also the first byte for .Z files. +- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress() +- check Z_FINISH in inflate (thanks to Marc Schluper) +- Implement deflateCopy (thanks to Adam Costello) +- make static libraries by default in configure, add --shared option. +- move MSDOS or Windows specific files to directory msdos +- suppress the notion of partial flush to simplify the interface + (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4) +- suppress history buffer provided by application to simplify the interface + (this feature was not implemented anyway in 1.0.4) +- next_in and avail_in must be initialized before calling inflateInit or + inflateInit2 +- add EXPORT in all exported functions (for Windows DLL) +- added Makefile.nt (thanks to Stephen Williams) +- added the unsupported "contrib" directory: + contrib/asm386/ by Gilles Vollant + 386 asm code replacing longest_match(). + contrib/iostream/ by Kevin Ruland + A C++ I/O streams interface to the zlib gz* functions + contrib/iostream2/ by Tyge L�vset + Another C++ I/O streams interface + contrib/untgz/ by "Pedro A. Aranda Guti\irrez" + A very simple tar.gz file extractor using zlib + contrib/visual-basic.txt by Carlos Rios + How to use compress(), uncompress() and the gz* functions from VB. +- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression + level) in minigzip (thanks to Tom Lane) + +- use const for rommable constants in deflate +- added test for gzseek and gztell in example.c +- add undocumented function inflateSyncPoint() (hack for Paul Mackerras) +- add undocumented function zError to convert error code to string + (for Tim Smithers) +- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code. +- Use default memcpy for Symantec MSDOS compiler. +- Add EXPORT keyword for check_func (needed for Windows DLL) +- add current directory to LD_LIBRARY_PATH for "make test" +- create also a link for libz.so.1 +- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura) +- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX) +- added -soname for Linux in configure (Chun-Chung Chen, +- assign numbers to the exported functions in zlib.def (for Windows DLL) +- add advice in zlib.h for best usage of deflateSetDictionary +- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn) +- allow compilation with ANSI keywords only enabled for TurboC in large model +- avoid "versionString"[0] (Borland bug) +- add NEED_DUMMY_RETURN for Borland +- use variable z_verbose for tracing in debug mode (L. Peter Deutsch). +- allow compilation with CC +- defined STDC for OS/2 (David Charlap) +- limit external names to 8 chars for MVS (Thomas Lund) +- in minigzip.c, use static buffers only for 16-bit systems +- fix suffix check for "minigzip -d foo.gz" +- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee) +- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) +- added makelcc.bat for lcc-win32 (Tom St Denis) +- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) +- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. +- check for unistd.h in configure (for off_t) +- remove useless check parameter in inflate_blocks_free +- avoid useless assignment of s->check to itself in inflate_blocks_new +- do not flush twice in gzclose (thanks to Ken Raeburn) +- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h +- use NO_ERRNO_H instead of enumeration of operating systems with errno.h +- work around buggy fclose on pipes for HP/UX +- support zlib DLL with BORLAND C++ 5.0 (thanks to Glenn Randers-Pehrson) +- fix configure if CC is already equal to gcc + +Changes in 1.0.5 (3 Jan 98) +- Fix inflate to terminate gracefully when fed corrupted or invalid data +- Use const for rommable constants in inflate +- Eliminate memory leaks on error conditions in inflate +- Removed some vestigial code in inflate +- Update web address in README + +Changes in 1.0.4 (24 Jul 96) +- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF + bit, so the decompressor could decompress all the correct data but went + on to attempt decompressing extra garbage data. This affected minigzip too. +- zlibVersion and gzerror return const char* (needed for DLL) +- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) +- use z_error only for DEBUG (avoid problem with DLLs) + +Changes in 1.0.3 (2 Jul 96) +- use z_streamp instead of z_stream *, which is now a far pointer in MSDOS + small and medium models; this makes the library incompatible with previous + versions for these models. (No effect in large model or on other systems.) +- return OK instead of BUF_ERROR if previous deflate call returned with + avail_out as zero but there is nothing to do +- added memcmp for non STDC compilers +- define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) +- define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) +- better check for 16-bit mode MSC (avoids problem with Symantec) + +Changes in 1.0.2 (23 May 96) +- added Windows DLL support +- added a function zlibVersion (for the DLL support) +- fixed declarations using Bytef in infutil.c (pb with MSDOS medium model) +- Bytef is define's instead of typedef'd only for Borland C +- avoid reading uninitialized memory in example.c +- mention in README that the zlib format is now RFC1950 +- updated Makefile.dj2 +- added algorithm.doc + +Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion] +- fix array overlay in deflate.c which sometimes caused bad compressed data +- fix inflate bug with empty stored block +- fix MSDOS medium model which was broken in 0.99 +- fix deflateParams() which could generated bad compressed data. +- Bytef is define'd instead of typedef'ed (work around Borland bug) +- added an INDEX file +- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), + Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) +- speed up adler32 for modern machines without auto-increment +- added -ansi for IRIX in configure +- static_init_done in trees.c is an int +- define unlink as delete for VMS +- fix configure for QNX +- add configure branch for SCO and HPUX +- avoid many warnings (unused variables, dead assignments, etc...) +- no fdopen for BeOS +- fix the Watcom fix for 32 bit mode (define FAR as empty) +- removed redefinition of Byte for MKWERKS +- work around an MWKERKS bug (incorrect merge of all .h files) + +Changes in 0.99 (27 Jan 96) +- allow preset dictionary shared between compressor and decompressor +- allow compression level 0 (no compression) +- add deflateParams in zlib.h: allow dynamic change of compression level + and compression strategy. +- test large buffers and deflateParams in example.c +- add optional "configure" to build zlib as a shared library +- suppress Makefile.qnx, use configure instead +- fixed deflate for 64-bit systems (detected on Cray) +- fixed inflate_blocks for 64-bit systems (detected on Alpha) +- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2) +- always return Z_BUF_ERROR when deflate() has nothing to do +- deflateInit and inflateInit are now macros to allow version checking +- prefix all global functions and types with z_ with -DZ_PREFIX +- make falloc completely reentrant (inftrees.c) +- fixed very unlikely race condition in ct_static_init +- free in reverse order of allocation to help memory manager +- use zlib-1.0/* instead of zlib/* inside the tar.gz +- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith + -Wconversion -Wstrict-prototypes -Wmissing-prototypes" +- allow gzread on concatenated .gz files +- deflateEnd now returns Z_DATA_ERROR if it was premature +- deflate is finally (?) fully deterministic (no matches beyond end of input) +- Document Z_SYNC_FLUSH +- add uninstall in Makefile +- Check for __cpluplus in zlib.h +- Better test in ct_align for partial flush +- avoid harmless warnings for Borland C++ +- initialize hash_head in deflate.c +- avoid warning on fdopen (gzio.c) for HP cc -Aa +- include stdlib.h for STDC compilers +- include errno.h for Cray +- ignore error if ranlib doesn't exist +- call ranlib twice for NeXTSTEP +- use exec_prefix instead of prefix for libz.a +- renamed ct_* as _tr_* to avoid conflict with applications +- clear z->msg in inflateInit2 before any error return +- initialize opaque in example.c, gzio.c, deflate.c and inflate.c +- fixed typo in zconf.h (_GNUC__ => __GNUC__) +- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode) +- fix typo in Make_vms.com (f$trnlnm -> f$getsyi) +- in fcalloc, normalize pointer if size > 65520 bytes +- don't use special fcalloc for 32 bit Borland C++ +- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc... +- use Z_BINARY instead of BINARY +- document that gzclose after gzdopen will close the file +- allow "a" as mode in gzopen. +- fix error checking in gzread +- allow skipping .gz extra-field on pipes +- added reference to Perl interface in README +- put the crc table in FAR data (I dislike more and more the medium model :) +- added get_crc_table +- added a dimension to all arrays (Borland C can't count). +- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast +- guard against multiple inclusion of *.h (for precompiled header on Mac) +- Watcom C pretends to be Microsoft C small model even in 32 bit mode. +- don't use unsized arrays to avoid silly warnings by Visual C++: + warning C4746: 'inflate_mask' : unsized array treated as '__far' + (what's wrong with far data in far model?). +- define enum out of inflate_blocks_state to allow compilation with C++ + +Changes in 0.95 (16 Aug 95) +- fix MSDOS small and medium model (now easier to adapt to any compiler) +- inlined send_bits +- fix the final (:-) bug for deflate with flush (output was correct but + not completely flushed in rare occasions). +- default window size is same for compression and decompression + (it's now sufficient to set MAX_WBITS in zconf.h). +- voidp -> voidpf and voidnp -> voidp (for consistency with other + typedefs and because voidnp was not near in large model). + +Changes in 0.94 (13 Aug 95) +- support MSDOS medium model +- fix deflate with flush (could sometimes generate bad output) +- fix deflateReset (zlib header was incorrectly suppressed) +- added support for VMS +- allow a compression level in gzopen() +- gzflush now calls fflush +- For deflate with flush, flush even if no more input is provided. +- rename libgz.a as libz.a +- avoid complex expression in infcodes.c triggering Turbo C bug +- work around a problem with gcc on Alpha (in INSERT_STRING) +- don't use inline functions (problem with some gcc versions) +- allow renaming of Byte, uInt, etc... with #define. +- avoid warning about (unused) pointer before start of array in deflate.c +- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c +- avoid reserved word 'new' in trees.c + +Changes in 0.93 (25 June 95) +- temporarily disable inline functions +- make deflate deterministic +- give enough lookahead for PARTIAL_FLUSH +- Set binary mode for stdin/stdout in minigzip.c for OS/2 +- don't even use signed char in inflate (not portable enough) +- fix inflate memory leak for segmented architectures + +Changes in 0.92 (3 May 95) +- don't assume that char is signed (problem on SGI) +- Clear bit buffer when starting a stored block +- no memcpy on Pyramid +- suppressed inftest.c +- optimized fill_window, put longest_match inline for gcc +- optimized inflate on stored blocks. +- untabify all sources to simplify patches + +Changes in 0.91 (2 May 95) +- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h +- Document the memory requirements in zconf.h +- added "make install" +- fix sync search logic in inflateSync +- deflate(Z_FULL_FLUSH) now works even if output buffer too short +- after inflateSync, don't scare people with just "lo world" +- added support for DJGPP + +Changes in 0.9 (1 May 95) +- don't assume that zalloc clears the allocated memory (the TurboC bug + was Mark's bug after all :) +- let again gzread copy uncompressed data unchanged (was working in 0.71) +- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented +- added a test of inflateSync in example.c +- moved MAX_WBITS to zconf.h because users might want to change that. +- document explicitly that zalloc(64K) on MSDOS must return a normalized + pointer (zero offset) +- added Makefiles for Microsoft C, Turbo C, Borland C++ +- faster crc32() + +Changes in 0.8 (29 April 95) +- added fast inflate (inffast.c) +- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this + is incompatible with previous versions of zlib which returned Z_OK. +- work around a TurboC compiler bug (bad code for b << 0, see infutil.h) + (actually that was not a compiler bug, see 0.81 above) +- gzread no longer reads one extra byte in certain cases +- In gzio destroy(), don't reference a freed structure +- avoid many warnings for MSDOS +- avoid the ERROR symbol which is used by MS Windows + +Changes in 0.71 (14 April 95) +- Fixed more MSDOS compilation problems :( There is still a bug with + TurboC large model. + +Changes in 0.7 (14 April 95) +- Added full inflate support. +- Simplified the crc32() interface. The pre- and post-conditioning + (one's complement) is now done inside crc32(). WARNING: this is + incompatible with previous versions; see zlib.h for the new usage. + +Changes in 0.61 (12 April 95) +- workaround for a bug in TurboC. example and minigzip now work on MSDOS. + +Changes in 0.6 (11 April 95) +- added minigzip.c +- added gzdopen to reopen a file descriptor as gzFile +- added transparent reading of non-gziped files in gzread. +- fixed bug in gzread (don't read crc as data) +- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose). +- don't allocate big arrays in the stack (for MSDOS) +- fix some MSDOS compilation problems + +Changes in 0.5: +- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but + not yet Z_FULL_FLUSH. +- support decompression but only in a single step (forced Z_FINISH) +- added opaque object for zalloc and zfree. +- added deflateReset and inflateReset +- added a variable zlib_version for consistency checking. +- renamed the 'filter' parameter of deflateInit2 as 'strategy'. + Added Z_FILTERED and Z_HUFFMAN_ONLY constants. + +Changes in 0.4: +- avoid "zip" everywhere, use zlib instead of ziplib. +- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush + if compression method == 8. +- added adler32 and crc32 +- renamed deflateOptions as deflateInit2, call one or the other but not both +- added the method parameter for deflateInit2. +- added inflateInit2 +- simplied considerably deflateInit and inflateInit by not supporting + user-provided history buffer. This is supported only in deflateInit2 + and inflateInit2. + +Changes in 0.3: +- prefix all macro names with Z_ +- use Z_FINISH instead of deflateEnd to finish compression. +- added Z_HUFFMAN_ONLY +- added gzerror() diff --git a/thirdparty/zlib/zlib-1.2.7/FAQ b/thirdparty/zlib/zlib-1.2.7/FAQ new file mode 100644 index 0000000..99b7cf9 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/FAQ @@ -0,0 +1,368 @@ + + Frequently Asked Questions about zlib + + +If your question is not there, please check the zlib home page +http://zlib.net/ which may have more recent information. +The lastest zlib FAQ is at http://zlib.net/zlib_faq.html + + + 1. Is zlib Y2K-compliant? + + Yes. zlib doesn't handle dates. + + 2. Where can I get a Windows DLL version? + + The zlib sources can be compiled without change to produce a DLL. See the + file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the + precompiled DLL are found in the zlib web site at http://zlib.net/ . + + 3. Where can I get a Visual Basic interface to zlib? + + See + * http://marknelson.us/1997/01/01/zlib-engine/ + * win32/DLL_FAQ.txt in the zlib distribution + + 4. compress() returns Z_BUF_ERROR. + + Make sure that before the call of compress(), the length of the compressed + buffer is equal to the available size of the compressed buffer and not + zero. For Visual Basic, check that this parameter is passed by reference + ("as any"), not by value ("as long"). + + 5. deflate() or inflate() returns Z_BUF_ERROR. + + Before making the call, make sure that avail_in and avail_out are not zero. + When setting the parameter flush equal to Z_FINISH, also make sure that + avail_out is big enough to allow processing all pending input. Note that a + Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be + made with more input or output space. A Z_BUF_ERROR may in fact be + unavoidable depending on how the functions are used, since it is not + possible to tell whether or not there is more output pending when + strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a + heavily annotated example. + + 6. Where's the zlib documentation (man pages, etc.)? + + It's in zlib.h . Examples of zlib usage are in the files test/example.c + and test/minigzip.c, with more in examples/ . + + 7. Why don't you use GNU autoconf or libtool or ...? + + Because we would like to keep zlib as a very small and simple package. + zlib is rather portable and doesn't need much configuration. + + 8. I found a bug in zlib. + + Most of the time, such problems are due to an incorrect usage of zlib. + Please try to reproduce the problem with a small program and send the + corresponding source to us at zlib@gzip.org . Do not send multi-megabyte + data files without prior agreement. + + 9. Why do I get "undefined reference to gzputc"? + + If "make test" produces something like + + example.o(.text+0x154): undefined reference to `gzputc' + + check that you don't have old files libz.* in /usr/lib, /usr/local/lib or + /usr/X11R6/lib. Remove any old versions, then do "make install". + +10. I need a Delphi interface to zlib. + + See the contrib/delphi directory in the zlib distribution. + +11. Can zlib handle .zip archives? + + Not by itself, no. See the directory contrib/minizip in the zlib + distribution. + +12. Can zlib handle .Z files? + + No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt + the code of uncompress on your own. + +13. How can I make a Unix shared library? + + By default a shared (and a static) library is built for Unix. So: + + make distclean + ./configure + make + +14. How do I install a shared zlib library on Unix? + + After the above, then: + + make install + + However, many flavors of Unix come with a shared zlib already installed. + Before going to the trouble of compiling a shared version of zlib and + trying to install it, you may want to check if it's already there! If you + can #include , it's there. The -lz option will probably link to + it. You can check the version at the top of zlib.h or with the + ZLIB_VERSION symbol defined in zlib.h . + +15. I have a question about OttoPDF. + + We are not the authors of OttoPDF. The real author is on the OttoPDF web + site: Joel Hainley, jhainley@myndkryme.com. + +16. Can zlib decode Flate data in an Adobe PDF file? + + Yes. See http://www.pdflib.com/ . To modify PDF forms, see + http://sourceforge.net/projects/acroformtool/ . + +17. Why am I getting this "register_frame_info not found" error on Solaris? + + After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib + generates an error such as: + + ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: + symbol __register_frame_info: referenced symbol not found + + The symbol __register_frame_info is not part of zlib, it is generated by + the C compiler (cc or gcc). You must recompile applications using zlib + which have this problem. This problem is specific to Solaris. See + http://www.sunfreeware.com for Solaris versions of zlib and applications + using zlib. + +18. Why does gzip give an error on a file I make with compress/deflate? + + The compress and deflate functions produce data in the zlib format, which + is different and incompatible with the gzip format. The gz* functions in + zlib on the other hand use the gzip format. Both the zlib and gzip formats + use the same compressed data format internally, but have different headers + and trailers around the compressed data. + +19. Ok, so why are there two different formats? + + The gzip format was designed to retain the directory information about a + single file, such as the name and last modification date. The zlib format + on the other hand was designed for in-memory and communication channel + applications, and has a much more compact header and trailer and uses a + faster integrity check than gzip. + +20. Well that's nice, but how do I make a gzip file in memory? + + You can request that deflate write the gzip format instead of the zlib + format using deflateInit2(). You can also request that inflate decode the + gzip format using inflateInit2(). Read zlib.h for more details. + +21. Is zlib thread-safe? + + Yes. However any library routines that zlib uses and any application- + provided memory allocation routines must also be thread-safe. zlib's gz* + functions use stdio library routines, and most of zlib's functions use the + library memory allocation routines by default. zlib's *Init* functions + allow for the application to provide custom memory allocation routines. + + Of course, you should only operate on any given zlib or gzip stream from a + single thread at a time. + +22. Can I use zlib in my commercial application? + + Yes. Please read the license in zlib.h. + +23. Is zlib under the GNU license? + + No. Please read the license in zlib.h. + +24. The license says that altered source versions must be "plainly marked". So + what exactly do I need to do to meet that requirement? + + You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In + particular, the final version number needs to be changed to "f", and an + identification string should be appended to ZLIB_VERSION. Version numbers + x.x.x.f are reserved for modifications to zlib by others than the zlib + maintainers. For example, if the version of the base zlib you are altering + is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and + ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also + update the version strings in deflate.c and inftrees.c. + + For altered source distributions, you should also note the origin and + nature of the changes in zlib.h, as well as in ChangeLog and README, along + with the dates of the alterations. The origin should include at least your + name (or your company's name), and an email address to contact for help or + issues with the library. + + Note that distributing a compiled zlib library along with zlib.h and + zconf.h is also a source distribution, and so you should change + ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes + in zlib.h as you would for a full source distribution. + +25. Will zlib work on a big-endian or little-endian architecture, and can I + exchange compressed data between them? + + Yes and yes. + +26. Will zlib work on a 64-bit machine? + + Yes. It has been tested on 64-bit machines, and has no dependence on any + data types being limited to 32-bits in length. If you have any + difficulties, please provide a complete problem report to zlib@gzip.org + +27. Will zlib decompress data from the PKWare Data Compression Library? + + No. The PKWare DCL uses a completely different compressed data format than + does PKZIP and zlib. However, you can look in zlib's contrib/blast + directory for a possible solution to your problem. + +28. Can I access data randomly in a compressed stream? + + No, not without some preparation. If when compressing you periodically use + Z_FULL_FLUSH, carefully write all the pending data at those points, and + keep an index of those locations, then you can start decompression at those + points. You have to be careful to not use Z_FULL_FLUSH too often, since it + can significantly degrade compression. Alternatively, you can scan a + deflate stream once to generate an index, and then use that index for + random access. See examples/zran.c . + +29. Does zlib work on MVS, OS/390, CICS, etc.? + + It has in the past, but we have not heard of any recent evidence. There + were working ports of zlib 1.1.4 to MVS, but those links no longer work. + If you know of recent, successful applications of zlib on these operating + systems, please let us know. Thanks. + +30. Is there some simpler, easier to read version of inflate I can look at to + understand the deflate format? + + First off, you should read RFC 1951. Second, yes. Look in zlib's + contrib/puff directory. + +31. Does zlib infringe on any patents? + + As far as we know, no. In fact, that was originally the whole point behind + zlib. Look here for some more information: + + http://www.gzip.org/#faq11 + +32. Can zlib work with greater than 4 GB of data? + + Yes. inflate() and deflate() will process any amount of data correctly. + Each call of inflate() or deflate() is limited to input and output chunks + of the maximum value that can be stored in the compiler's "unsigned int" + type, but there is no limit to the number of chunks. Note however that the + strm.total_in and strm_total_out counters may be limited to 4 GB. These + counters are provided as a convenience and are not used internally by + inflate() or deflate(). The application can easily set up its own counters + updated after each call of inflate() or deflate() to count beyond 4 GB. + compress() and uncompress() may be limited to 4 GB, since they operate in a + single call. gzseek() and gztell() may be limited to 4 GB depending on how + zlib is compiled. See the zlibCompileFlags() function in zlib.h. + + The word "may" appears several times above since there is a 4 GB limit only + if the compiler's "long" type is 32 bits. If the compiler's "long" type is + 64 bits, then the limit is 16 exabytes. + +33. Does zlib have any security vulnerabilities? + + The only one that we are aware of is potentially in gzprintf(). If zlib is + compiled to use sprintf() or vsprintf(), then there is no protection + against a buffer overflow of an 8K string space (or other value as set by + gzbuffer()), other than the caller of gzprintf() assuring that the output + will not exceed 8K. On the other hand, if zlib is compiled to use + snprintf() or vsnprintf(), which should normally be the case, then there is + no vulnerability. The ./configure script will display warnings if an + insecure variation of sprintf() will be used by gzprintf(). Also the + zlibCompileFlags() function will return information on what variant of + sprintf() is used by gzprintf(). + + If you don't have snprintf() or vsnprintf() and would like one, you can + find a portable implementation here: + + http://www.ijs.si/software/snprintf/ + + Note that you should be using the most recent version of zlib. Versions + 1.1.3 and before were subject to a double-free vulnerability, and versions + 1.2.1 and 1.2.2 were subject to an access exception when decompressing + invalid compressed data. + +34. Is there a Java version of zlib? + + Probably what you want is to use zlib in Java. zlib is already included + as part of the Java SDK in the java.util.zip package. If you really want + a version of zlib written in the Java language, look on the zlib home + page for links: http://zlib.net/ . + +35. I get this or that compiler or source-code scanner warning when I crank it + up to maximally-pedantic. Can't you guys write proper code? + + Many years ago, we gave up attempting to avoid warnings on every compiler + in the universe. It just got to be a waste of time, and some compilers + were downright silly as well as contradicted each other. So now, we simply + make sure that the code always works. + +36. Valgrind (or some similar memory access checker) says that deflate is + performing a conditional jump that depends on an uninitialized value. + Isn't that a bug? + + No. That is intentional for performance reasons, and the output of deflate + is not affected. This only started showing up recently since zlib 1.2.x + uses malloc() by default for allocations, whereas earlier versions used + calloc(), which zeros out the allocated memory. Even though the code was + correct, versions 1.2.4 and later was changed to not stimulate these + checkers. + +37. Will zlib read the (insert any ancient or arcane format here) compressed + data format? + + Probably not. Look in the comp.compression FAQ for pointers to various + formats and associated software. + +38. How can I encrypt/decrypt zip files with zlib? + + zlib doesn't support encryption. The original PKZIP encryption is very + weak and can be broken with freely available programs. To get strong + encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib + compression. For PKZIP compatible "encryption", look at + http://www.info-zip.org/ + +39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? + + "gzip" is the gzip format, and "deflate" is the zlib format. They should + probably have called the second one "zlib" instead to avoid confusion with + the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 + correctly points to the zlib specification in RFC 1950 for the "deflate" + transfer encoding, there have been reports of servers and browsers that + incorrectly produce or expect raw deflate data per the deflate + specification in RFC 1951, most notably Microsoft. So even though the + "deflate" transfer encoding using the zlib format would be the more + efficient approach (and in fact exactly what the zlib format was designed + for), using the "gzip" transfer encoding is probably more reliable due to + an unfortunate choice of name on the part of the HTTP 1.1 authors. + + Bottom line: use the gzip format for HTTP 1.1 encoding. + +40. Does zlib support the new "Deflate64" format introduced by PKWare? + + No. PKWare has apparently decided to keep that format proprietary, since + they have not documented it as they have previous compression formats. In + any case, the compression improvements are so modest compared to other more + modern approaches, that it's not worth the effort to implement. + +41. I'm having a problem with the zip functions in zlib, can you help? + + There are no zip functions in zlib. You are probably using minizip by + Giles Vollant, which is found in the contrib directory of zlib. It is not + part of zlib. In fact none of the stuff in contrib is part of zlib. The + files in there are not supported by the zlib authors. You need to contact + the authors of the respective contribution for help. + +42. The match.asm code in contrib is under the GNU General Public License. + Since it's part of zlib, doesn't that mean that all of zlib falls under the + GNU GPL? + + No. The files in contrib are not part of zlib. They were contributed by + other authors and are provided as a convenience to the user within the zlib + distribution. Each item in contrib has its own license. + +43. Is zlib subject to export controls? What is its ECCN? + + zlib is not subject to export controls, and so is classified as EAR99. + +44. Can you please sign these lengthy legal documents and fax them back to us + so that we can use your software in our product? + + No. Go away. Shoo. diff --git a/thirdparty/zlib/zlib-1.2.7/INDEX b/thirdparty/zlib/zlib-1.2.7/INDEX new file mode 100644 index 0000000..2ba0641 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/INDEX @@ -0,0 +1,68 @@ +CMakeLists.txt cmake build file +ChangeLog history of changes +FAQ Frequently Asked Questions about zlib +INDEX this file +Makefile dummy Makefile that tells you to ./configure +Makefile.in template for Unix Makefile +README guess what +configure configure script for Unix +make_vms.com makefile for VMS +test/example.c zlib usages examples for build testing +test/minigzip.c minimal gzip-like functionality for build testing +test/infcover.c inf*.c code coverage for build coverage testing +treebuild.xml XML description of source file dependencies +zconf.h.cmakein zconf.h template for cmake +zconf.h.in zconf.h template for configure +zlib.3 Man page for zlib +zlib.3.pdf Man page in PDF format +zlib.map Linux symbol information +zlib.pc.in Template for pkg-config descriptor +zlib.pc.cmakein zlib.pc template for cmake +zlib2ansi perl script to convert source files for C++ compilation + +amiga/ makefiles for Amiga SAS C +as400/ makefiles for AS/400 +doc/ documentation for formats and algorithms +msdos/ makefiles for MSDOS +nintendods/ makefile for Nintendo DS +old/ makefiles for various architectures and zlib documentation + files that have not yet been updated for zlib 1.2.x +qnx/ makefiles for QNX +watcom/ makefiles for OpenWatcom +win32/ makefiles for Windows + + zlib public header files (required for library use): +zconf.h +zlib.h + + private source files used to build the zlib library: +adler32.c +compress.c +crc32.c +crc32.h +deflate.c +deflate.h +gzclose.c +gzguts.h +gzlib.c +gzread.c +gzwrite.c +infback.c +inffast.c +inffast.h +inffixed.h +inflate.c +inflate.h +inftrees.c +inftrees.h +trees.c +trees.h +uncompr.c +zutil.c +zutil.h + + source files for sample programs +See examples/README.examples + + unsupported contributions by third parties +See contrib/README.contrib diff --git a/thirdparty/zlib/zlib-1.2.7/Makefile b/thirdparty/zlib/zlib-1.2.7/Makefile new file mode 100644 index 0000000..e6399bd --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/Makefile @@ -0,0 +1,288 @@ +# Makefile for zlib +# Copyright (C) 1995-2011 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile and test, type: +# ./configure; make test +# Normally configure builds both a static and a shared library. +# If you want to build just a static library, use: ./configure --static + +# To use the asm code, type: +# cp contrib/asm?86/match.S ./match.S +# make LOC=-DASMV OBJA=match.o + +# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: +# make install +# To install in $HOME instead of /usr/local, use: +# make install prefix=$HOME + +CC=gcc + +CFLAGS=-O3 -arch i386 -arch x86_64 -DHAVE_HIDDEN +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes + +SFLAGS=-O3 -arch i386 -arch x86_64 -fPIC -DHAVE_HIDDEN +LDFLAGS= -arch i386 -arch x86_64 +TEST_LDFLAGS=-L. libz.a +LDSHARED=gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +CPP=gcc -E + +STATICLIB=libz.a +SHAREDLIB=libz.dylib +SHAREDLIBV=libz.1.2.7.dylib +SHAREDLIBM=libz.1.dylib +LIBS=$(STATICLIB) $(SHAREDLIBV) + +AR=/usr/bin/libtool +ARFLAGS=-o +RANLIB=ranlib +LDCONFIG=ldconfig +LDSHAREDLIBC=-lc +TAR=tar +SHELL=/bin/sh +EXE= + +prefix =/usr/local +exec_prefix =${prefix} +libdir =${exec_prefix}/lib +sharedlibdir =${libdir} +includedir =${prefix}/include +mandir =${prefix}/share/man +man3dir = ${mandir}/man3 +pkgconfigdir = ${libdir}/pkgconfig + +OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o +OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o +OBJC = $(OBJZ) $(OBJG) + +PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo +PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) + +# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo +OBJA = +PIC_OBJA = + +OBJS = $(OBJC) $(OBJA) + +PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA) + +all: static shared + +static: example$(EXE) minigzip$(EXE) + +shared: examplesh$(EXE) minigzipsh$(EXE) + +all64: example64$(EXE) minigzip64$(EXE) + +check: test + +test: all teststatic testshared + +teststatic: static + @TMPST=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \ + echo ' *** zlib test OK ***'; \ + else \ + echo ' *** zlib test FAILED ***'; false; \ + fi; \ + rm -f $$TMPST + +testshared: shared + @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \ + DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ + SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \ + TMPSH=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \ + echo ' *** zlib shared test OK ***'; \ + else \ + echo ' *** zlib shared test FAILED ***'; false; \ + fi; \ + rm -f $$TMPSH + +test64: all64 + @TMP64=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ + echo ' *** zlib 64-bit test OK ***'; \ + else \ + echo ' *** zlib 64-bit test FAILED ***'; false; \ + fi; \ + rm -f $$TMP64 + +infcover.o: test/infcover.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c + +infcover: infcover.o libz.a + $(CC) $(CFLAGS) -o $@ infcover.o libz.a + +cover: infcover + rm -f *.gcda + ./infcover + gcov inf*.c + +libz.a: $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +match.o: match.S + $(CPP) match.S > _match.s + $(CC) -c _match.s + mv _match.o match.o + rm -f _match.s + +match.lo: match.S + $(CPP) match.S > _match.s + $(CC) -c -fPIC _match.s + mv _match.o match.lo + rm -f _match.s + +example.o: test/example.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/example.c + +minigzip.o: test/minigzip.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c + +example64.o: test/example.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c + +minigzip64.o: test/minigzip.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c + +.SUFFIXES: .lo + +.c.lo: + -@mkdir objs 2>/dev/null || test -d objs + $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< + -@mv objs/$*.o $@ + +placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a + $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS) + rm -f $(SHAREDLIB) $(SHAREDLIBM) + ln -s $@ $(SHAREDLIB) + ln -s $@ $(SHAREDLIBM) + -@rmdir objs + +example$(EXE): example.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) + +minigzip$(EXE): minigzip.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) + +examplesh$(EXE): example.o $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) + +minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) + +example64$(EXE): example64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) + +minigzip64$(EXE): minigzip64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) + +install-libs: $(LIBS) + -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi + -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi + -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi + -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi + cp $(STATICLIB) $(DESTDIR)$(libdir) + chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB) + -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1 + -@if test -n "$(SHAREDLIBV)"; then \ + cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \ + echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \ + chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ + echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \ + rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ($(LDCONFIG) || true) >/dev/null 2>&1; \ + fi + cp zlib.3 $(DESTDIR)$(man3dir) + chmod 644 $(DESTDIR)$(man3dir)/zlib.3 + cp zlib.pc $(DESTDIR)$(pkgconfigdir) + chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc +# The ranlib in install is needed on NeXTSTEP which checks file times +# ldconfig is for Linux + +install: install-libs + -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi + cp zlib.h zconf.h $(DESTDIR)$(includedir) + chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h + +uninstall: + cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h + cd $(DESTDIR)$(libdir); rm -f libz.a; \ + if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \ + rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ + fi + cd $(DESTDIR)$(man3dir); rm -f zlib.3 + cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc + +docs: zlib.3.pdf + +zlib.3.pdf: zlib.3 + groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf + +zconf.h.cmakein: zconf.h.in + -@ TEMPFILE=`mktemp __XXXXXX`; \ + echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\ + sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\ + touch -r zconf.h.in zconf.h.cmakein &&\ + rm $$TEMPFILE + +zconf: zconf.h.in + cp -p zconf.h.in zconf.h + +mostlyclean: clean +clean: + rm -f *.o *.lo *~ \ + example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ + example64$(EXE) minigzip64$(EXE) \ + infcover \ + libz.* foo.gz so_locations \ + _match.s maketree contrib/infback9/*.o + rm -rf objs + rm -f *.gcda *.gcno *.gcov + rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov + +maintainer-clean: distclean +distclean: clean zconf zconf.h.cmakein docs + rm -f Makefile zlib.pc configure.log + -@rm -f .DS_Store + -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile + -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile + -@touch -r Makefile.in Makefile + +tags: + etags *.[ch] + +depend: + makedepend -- $(CFLAGS) -- *.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o zutil.o: zutil.h zlib.h zconf.h +gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h +compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h +crc32.o: zutil.h zlib.h zconf.h crc32.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h + +adler32.lo zutil.lo: zutil.h zlib.h zconf.h +gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h +compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h +crc32.lo: zutil.h zlib.h zconf.h crc32.h +deflate.lo: deflate.h zutil.h zlib.h zconf.h +infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h +inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.lo: zutil.h zlib.h zconf.h inftrees.h +trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h diff --git a/thirdparty/zlib/zlib-1.2.7/Makefile.in b/thirdparty/zlib/zlib-1.2.7/Makefile.in new file mode 100644 index 0000000..241deed --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/Makefile.in @@ -0,0 +1,288 @@ +# Makefile for zlib +# Copyright (C) 1995-2011 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile and test, type: +# ./configure; make test +# Normally configure builds both a static and a shared library. +# If you want to build just a static library, use: ./configure --static + +# To use the asm code, type: +# cp contrib/asm?86/match.S ./match.S +# make LOC=-DASMV OBJA=match.o + +# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: +# make install +# To install in $HOME instead of /usr/local, use: +# make install prefix=$HOME + +CC=cc + +CFLAGS=-O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes + +SFLAGS=-O +LDFLAGS= +TEST_LDFLAGS=-L. libz.a +LDSHARED=$(CC) +CPP=$(CC) -E + +STATICLIB=libz.a +SHAREDLIB=libz.so +SHAREDLIBV=libz.so.1.2.7 +SHAREDLIBM=libz.so.1 +LIBS=$(STATICLIB) $(SHAREDLIBV) + +AR=ar +ARFLAGS=rc +RANLIB=ranlib +LDCONFIG=ldconfig +LDSHAREDLIBC=-lc +TAR=tar +SHELL=/bin/sh +EXE= + +prefix = /usr/local +exec_prefix = ${prefix} +libdir = ${exec_prefix}/lib +sharedlibdir = ${libdir} +includedir = ${prefix}/include +mandir = ${prefix}/share/man +man3dir = ${mandir}/man3 +pkgconfigdir = ${libdir}/pkgconfig + +OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o +OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o +OBJC = $(OBJZ) $(OBJG) + +PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo +PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) + +# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo +OBJA = +PIC_OBJA = + +OBJS = $(OBJC) $(OBJA) + +PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA) + +all: static shared + +static: example$(EXE) minigzip$(EXE) + +shared: examplesh$(EXE) minigzipsh$(EXE) + +all64: example64$(EXE) minigzip64$(EXE) + +check: test + +test: all teststatic testshared + +teststatic: static + @TMPST=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \ + echo ' *** zlib test OK ***'; \ + else \ + echo ' *** zlib test FAILED ***'; false; \ + fi; \ + rm -f $$TMPST + +testshared: shared + @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \ + DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ + SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \ + TMPSH=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \ + echo ' *** zlib shared test OK ***'; \ + else \ + echo ' *** zlib shared test FAILED ***'; false; \ + fi; \ + rm -f $$TMPSH + +test64: all64 + @TMP64=`mktemp fooXXXXXX`; \ + if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ + echo ' *** zlib 64-bit test OK ***'; \ + else \ + echo ' *** zlib 64-bit test FAILED ***'; false; \ + fi; \ + rm -f $$TMP64 + +infcover.o: test/infcover.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c + +infcover: infcover.o libz.a + $(CC) $(CFLAGS) -o $@ infcover.o libz.a + +cover: infcover + rm -f *.gcda + ./infcover + gcov inf*.c + +libz.a: $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +match.o: match.S + $(CPP) match.S > _match.s + $(CC) -c _match.s + mv _match.o match.o + rm -f _match.s + +match.lo: match.S + $(CPP) match.S > _match.s + $(CC) -c -fPIC _match.s + mv _match.o match.lo + rm -f _match.s + +example.o: test/example.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/example.c + +minigzip.o: test/minigzip.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c + +example64.o: test/example.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c + +minigzip64.o: test/minigzip.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c + +.SUFFIXES: .lo + +.c.lo: + -@mkdir objs 2>/dev/null || test -d objs + $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< + -@mv objs/$*.o $@ + +placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a + $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS) + rm -f $(SHAREDLIB) $(SHAREDLIBM) + ln -s $@ $(SHAREDLIB) + ln -s $@ $(SHAREDLIBM) + -@rmdir objs + +example$(EXE): example.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) + +minigzip$(EXE): minigzip.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) + +examplesh$(EXE): example.o $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) + +minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) + +example64$(EXE): example64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) + +minigzip64$(EXE): minigzip64.o $(STATICLIB) + $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) + +install-libs: $(LIBS) + -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi + -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi + -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi + -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi + cp $(STATICLIB) $(DESTDIR)$(libdir) + chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB) + -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1 + -@if test -n "$(SHAREDLIBV)"; then \ + cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \ + echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \ + chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \ + echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \ + rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \ + ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ + ($(LDCONFIG) || true) >/dev/null 2>&1; \ + fi + cp zlib.3 $(DESTDIR)$(man3dir) + chmod 644 $(DESTDIR)$(man3dir)/zlib.3 + cp zlib.pc $(DESTDIR)$(pkgconfigdir) + chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc +# The ranlib in install is needed on NeXTSTEP which checks file times +# ldconfig is for Linux + +install: install-libs + -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi + cp zlib.h zconf.h $(DESTDIR)$(includedir) + chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h + +uninstall: + cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h + cd $(DESTDIR)$(libdir); rm -f libz.a; \ + if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \ + rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ + fi + cd $(DESTDIR)$(man3dir); rm -f zlib.3 + cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc + +docs: zlib.3.pdf + +zlib.3.pdf: zlib.3 + groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf + +zconf.h.cmakein: zconf.h.in + -@ TEMPFILE=`mktemp __XXXXXX`; \ + echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\ + sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\ + touch -r zconf.h.in zconf.h.cmakein &&\ + rm $$TEMPFILE + +zconf: zconf.h.in + cp -p zconf.h.in zconf.h + +mostlyclean: clean +clean: + rm -f *.o *.lo *~ \ + example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ + example64$(EXE) minigzip64$(EXE) \ + infcover \ + libz.* foo.gz so_locations \ + _match.s maketree contrib/infback9/*.o + rm -rf objs + rm -f *.gcda *.gcno *.gcov + rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov + +maintainer-clean: distclean +distclean: clean zconf zconf.h.cmakein docs + rm -f Makefile zlib.pc configure.log + -@rm -f .DS_Store + -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile + -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile + -@touch -r Makefile.in Makefile + +tags: + etags *.[ch] + +depend: + makedepend -- $(CFLAGS) -- *.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o zutil.o: zutil.h zlib.h zconf.h +gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h +compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h +crc32.o: zutil.h zlib.h zconf.h crc32.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h + +adler32.lo zutil.lo: zutil.h zlib.h zconf.h +gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h +compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h +crc32.lo: zutil.h zlib.h zconf.h crc32.h +deflate.lo: deflate.h zutil.h zlib.h zconf.h +infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h +inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.lo: zutil.h zlib.h zconf.h inftrees.h +trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h diff --git a/thirdparty/zlib/zlib-1.2.7/README b/thirdparty/zlib/zlib-1.2.7/README new file mode 100644 index 0000000..6f1255f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/README @@ -0,0 +1,115 @@ +ZLIB DATA COMPRESSION LIBRARY + +zlib 1.2.7 is a general purpose data compression library. All the code is +thread safe. The data format used by the zlib library is described by RFCs +(Request for Comments) 1950 to 1952 in the files +http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and +rfc1952 (gzip format). + +All functions of the compression library are documented in the file zlib.h +(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example +of the library is given in the file test/example.c which also tests that +the library is working correctly. Another example is given in the file +test/minigzip.c. The compression library itself is composed of all source +files in the root directory. + +To compile all files and run the test program, follow the instructions given at +the top of Makefile.in. In short "./configure; make test", and if that goes +well, "make install" should work for most flavors of Unix. For Windows, use +one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use +make_vms.com. + +Questions about zlib should be sent to , or to Gilles Vollant + for the Windows DLL version. The zlib home page is +http://zlib.net/ . Before reporting a problem, please check this site to +verify that you have the latest version of zlib; otherwise get the latest +version and check whether the problem still exists or not. + +PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. + +Mark Nelson wrote an article about zlib for the Jan. 1997 +issue of Dr. Dobb's Journal; a copy of the article is available at +http://marknelson.us/1997/01/01/zlib-engine/ . + +The changes made in version 1.2.7 are documented in the file ChangeLog. + +Unsupported third party contributions are provided in directory contrib/ . + +zlib is available in Java using the java.util.zip package, documented at +http://java.sun.com/developer/technicalArticles/Programming/compression/ . + +A Perl interface to zlib written by Paul Marquess is available +at CPAN (Comprehensive Perl Archive Network) sites, including +http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . + +A Python interface to zlib written by A.M. Kuchling is +available in Python 1.5 and later versions, see +http://docs.python.org/library/zlib.html . + +zlib is built into tcl: http://wiki.tcl.tk/4610 . + +An experimental package to read and write files in .zip format, written on top +of zlib by Gilles Vollant , is available in the +contrib/minizip directory of zlib. + + +Notes for some targets: + +- For Windows DLL versions, please see win32/DLL_FAQ.txt + +- For 64-bit Irix, deflate.c must be compiled without any optimization. With + -O, one libpng test fails. The test works in 32 bit mode (with the -n32 + compiler flag). The compiler bug has been reported to SGI. + +- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works + when compiled with cc. + +- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is + necessary to get gzprintf working correctly. This is done by configure. + +- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with + other compilers. Use "make test" to check your compiler. + +- gzdopen is not supported on RISCOS or BEOS. + +- For PalmOs, see http://palmzlib.sourceforge.net/ + + +Acknowledgments: + + The deflate format used by zlib was defined by Phil Katz. The deflate and + zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; they + are too numerous to cite here. + +Copyright notice: + + (C) 1995-2012 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. diff --git a/thirdparty/zlib/zlib-1.2.7/adler32.c b/thirdparty/zlib/zlib-1.2.7/adler32.c new file mode 100644 index 0000000..a868f07 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/adler32.c @@ -0,0 +1,179 @@ +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2011 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zutil.h" + +#define local static + +local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); + +#define BASE 65521 /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* use NO_DIVIDE if your processor does not do division in hardware -- + try it both ways to see which is faster */ +#ifdef NO_DIVIDE +/* note that this assumes BASE is 65521, where 65536 % 65521 == 15 + (thank you to John Reiser for pointing this out) */ +# define CHOP(a) \ + do { \ + unsigned long tmp = a >> 16; \ + a &= 0xffffUL; \ + a += (tmp << 4) - tmp; \ + } while (0) +# define MOD28(a) \ + do { \ + CHOP(a); \ + if (a >= BASE) a -= BASE; \ + } while (0) +# define MOD(a) \ + do { \ + CHOP(a); \ + MOD28(a); \ + } while (0) +# define MOD63(a) \ + do { /* this assumes a is not negative */ \ + z_off64_t tmp = a >> 32; \ + a &= 0xffffffffL; \ + a += (tmp << 8) - (tmp << 5) + tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + tmp = a >> 16; \ + a &= 0xffffL; \ + a += (tmp << 4) - tmp; \ + if (a >= BASE) a -= BASE; \ + } while (0) +#else +# define MOD(a) a %= BASE +# define MOD28(a) a %= BASE +# define MOD63(a) a %= BASE +#endif + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD28(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +/* ========================================================================= */ +local uLong adler32_combine_(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off64_t len2; +{ + unsigned long sum1; + unsigned long sum2; + unsigned rem; + + /* for negative len, return invalid adler32 as a clue for debugging */ + if (len2 < 0) + return 0xffffffffUL; + + /* the derivation of this formula is left as an exercise for the reader */ + MOD63(len2); /* assumes len2 >= 0 */ + rem = (unsigned)len2; + sum1 = adler1 & 0xffff; + sum2 = rem * sum1; + MOD(sum2); + sum1 += (adler2 & 0xffff) + BASE - 1; + sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; + if (sum1 >= BASE) sum1 -= BASE; + if (sum1 >= BASE) sum1 -= BASE; + if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 >= BASE) sum2 -= BASE; + return sum1 | (sum2 << 16); +} + +/* ========================================================================= */ +uLong ZEXPORT adler32_combine(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off_t len2; +{ + return adler32_combine_(adler1, adler2, len2); +} + +uLong ZEXPORT adler32_combine64(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off64_t len2; +{ + return adler32_combine_(adler1, adler2, len2); +} diff --git a/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.pup b/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.pup new file mode 100644 index 0000000..8940c12 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.pup @@ -0,0 +1,69 @@ +# Amiga powerUP (TM) Makefile +# makefile for libpng and SAS C V6.58/7.00 PPC compiler +# Copyright (C) 1998 by Andreas R. Kleinert + +LIBNAME = libzip.a + +CC = scppc +CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \ + OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER +AR = ppc-amigaos-ar cr +RANLIB = ppc-amigaos-ranlib +LD = ppc-amigaos-ld -r +LDFLAGS = -o +LDLIBS = LIB:scppc.a LIB:end.o +RM = delete quiet + +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ + uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o + +TEST_OBJS = example.o minigzip.o + +all: example minigzip + +check: test +test: all + example + echo hello world | minigzip | minigzip -d + +$(LIBNAME): $(OBJS) + $(AR) $@ $(OBJS) + -$(RANLIB) $@ + +example: example.o $(LIBNAME) + $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) + +minigzip: minigzip.o $(LIBNAME) + $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS) + +mostlyclean: clean +clean: + $(RM) *.o example minigzip $(LIBNAME) foo.gz + +zip: + zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \ + descrip.mms *.[ch] + +tgz: + cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \ + zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o: zlib.h zconf.h +compress.o: zlib.h zconf.h +crc32.o: crc32.h zlib.h zconf.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +example.o: zlib.h zconf.h +gzclose.o: zlib.h zconf.h gzguts.h +gzlib.o: zlib.h zconf.h gzguts.h +gzread.o: zlib.h zconf.h gzguts.h +gzwrite.o: zlib.h zconf.h gzguts.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +minigzip.o: zlib.h zconf.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h +uncompr.o: zlib.h zconf.h +zutil.o: zutil.h zlib.h zconf.h diff --git a/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.sas b/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.sas new file mode 100644 index 0000000..749e291 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/amiga/Makefile.sas @@ -0,0 +1,68 @@ +# SMakefile for zlib +# Modified from the standard UNIX Makefile Copyright Jean-loup Gailly +# Osma Ahvenlampi +# Amiga, SAS/C 6.56 & Smake + +CC=sc +CFLAGS=OPT +#CFLAGS=OPT CPU=68030 +#CFLAGS=DEBUG=LINE +LDFLAGS=LIB z.lib + +SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ + NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \ + DEF=POSTINC + +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ + uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o + +TEST_OBJS = example.o minigzip.o + +all: SCOPTIONS example minigzip + +check: test +test: all + example + echo hello world | minigzip | minigzip -d + +install: z.lib + copy clone zlib.h zconf.h INCLUDE: + copy clone z.lib LIB: + +z.lib: $(OBJS) + oml z.lib r $(OBJS) + +example: example.o z.lib + $(CC) $(CFLAGS) LINK TO $@ example.o $(LDFLAGS) + +minigzip: minigzip.o z.lib + $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS) + +mostlyclean: clean +clean: + -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS + +SCOPTIONS: Makefile.sas + copy to $@ 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; +#endif + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + stream.opaque = (voidpf)0; + + err = deflateInit(&stream, level); + if (err != Z_OK) return err; + + err = deflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + deflateEnd(&stream); + return err == Z_OK ? Z_BUF_ERROR : err; + } + *destLen = stream.total_out; + + err = deflateEnd(&stream); + return err; +} + +/* =========================================================================== + */ +int ZEXPORT compress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); +} + +/* =========================================================================== + If the default memLevel or windowBits for deflateInit() is changed, then + this function needs to be updated. + */ +uLong ZEXPORT compressBound (sourceLen) + uLong sourceLen; +{ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + + (sourceLen >> 25) + 13; +} diff --git a/thirdparty/zlib/zlib-1.2.7/configure b/thirdparty/zlib/zlib-1.2.7/configure new file mode 100644 index 0000000..36c7d8e --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/configure @@ -0,0 +1,818 @@ +#!/bin/sh +# configure script for zlib. +# +# Normally configure builds both a static and a shared library. +# If you want to build just a static library, use: ./configure --static +# +# To impose specific compiler or flags or install directory, use for example: +# prefix=$HOME CC=cc CFLAGS="-O4" ./configure +# or for csh/tcsh users: +# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) + +# Incorrect settings of CC or CFLAGS may prevent creating a shared library. +# If you have problems, try without defining CC and CFLAGS before reporting +# an error. + +# start off configure.log +echo -------------------- >> configure.log +echo $0 $* >> configure.log +date >> configure.log + +# set command prefix for cross-compilation +if [ -n "${CHOST}" ]; then + uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`" + CROSS_PREFIX="${CHOST}-" +fi + +# destination name for static library +STATICLIB=libz.a + +# extract zlib version numbers from zlib.h +VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` +VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h` +VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` +VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` + +# establish commands for library building +if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then + AR=${AR-"${CROSS_PREFIX}ar"} + test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log +else + AR=${AR-"ar"} + test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log +fi +ARFLAGS=${ARFLAGS-"rc"} +if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then + RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} + test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log +else + RANLIB=${RANLIB-"ranlib"} +fi +if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then + NM=${NM-"${CROSS_PREFIX}nm"} + test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log +else + NM=${NM-"nm"} +fi + +# set defaults before processing command line options +LDCONFIG=${LDCONFIG-"ldconfig"} +LDSHAREDLIBC="${LDSHAREDLIBC--lc}" +ARCHS= +prefix=${prefix-/usr/local} +exec_prefix=${exec_prefix-'${prefix}'} +libdir=${libdir-'${exec_prefix}/lib'} +sharedlibdir=${sharedlibdir-'${libdir}'} +includedir=${includedir-'${prefix}/include'} +mandir=${mandir-'${prefix}/share/man'} +shared_ext='.so' +shared=1 +solo=0 +cover=0 +zprefix=0 +build64=0 +gcc=0 +old_cc="$CC" +old_cflags="$CFLAGS" +OBJC='$(OBJZ) $(OBJG)' +PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' + +# process command line options +while test $# -ge 1 +do +case "$1" in + -h* | --help) + echo 'usage:' | tee -a configure.log + echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log + echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log + echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log + exit 0 ;; + -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;; + -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;; + -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;; + --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;; + -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;; + -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;; + -p* | --prefix) prefix="$2"; shift; shift ;; + -e* | --eprefix) exec_prefix="$2"; shift; shift ;; + -l* | --libdir) libdir="$2"; shift; shift ;; + -i* | --includedir) includedir="$2"; shift; shift ;; + -s* | --shared | --enable-shared) shared=1; shift ;; + -t | --static) shared=0; shift ;; + --solo) solo=1; shift ;; + --cover) cover=1; shift ;; + -z* | --zprefix) zprefix=1; shift ;; + -6* | --64) build64=1; shift ;; + -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;; + --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;; + --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;; + *) echo "unknown option: $1"; echo "$0 --help for help" | tee -a configure.log; exit 1 ;; + esac +done + +# define functions for testing compiler and library characteristics and logging the results +test=ztest$$ + +show() +{ + case "$*" in + *$test.c*) + echo === $test.c === >> configure.log + cat $test.c >> configure.log + echo === >> configure.log;; + esac + echo $* >> configure.log +} + +cat > $test.c </dev/null; then + try() + { + show $* + test "`( $* ) 2>&1 | tee -a configure.log`" = "" + } + echo - using any output from compiler to indicate an error >> configure.log +else + try() + { + show $* + ( $* ) >> configure.log 2>&1 + ret=$? + if test $ret -ne 0; then + echo "(exit code "$ret")" >> configure.log + fi + return $ret + } +fi + +tryboth() +{ + show $* + got=`( $* ) 2>&1` + ret=$? + printf %s "$got" >> configure.log + if test $ret -ne 0; then + return $ret + fi + test "$got" = "" +} + +echo >> configure.log + +# check for gcc vs. cc and set compile and link flags based on the system identified by uname +cat > $test.c <&1` in + *gcc*) gcc=1 ;; +esac + +show $cc -c $cflags $test.c +if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then + echo ... using gcc >> configure.log + CC="$cc" + CFLAGS="${CFLAGS--O3} ${ARCHS}" + SFLAGS="${CFLAGS--O3} -fPIC" + LDFLAGS="${LDFLAGS} ${ARCHS}" + if test $build64 -eq 1; then + CFLAGS="${CFLAGS} -m64" + SFLAGS="${SFLAGS} -m64" + fi + if test "${ZLIBGCCWARN}" = "YES"; then + CFLAGS="${CFLAGS} -Wall -Wextra -pedantic" + fi + if test -z "$uname"; then + uname=`(uname -s || echo unknown) 2>/dev/null` + fi + case "$uname" in + Linux* | linux* | GNU | GNU/* | solaris*) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; + *BSD | *bsd* | DragonFly) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} + LDCONFIG="ldconfig -m" ;; + CYGWIN* | Cygwin* | cygwin* | OS/2*) + EXE='.exe' ;; + MINGW* | mingw*) +# temporary bypass + rm -f $test.[co] $test $test$shared_ext + echo "Please use win32/Makefile.gcc instead." | tee -a configure.log + exit 1 + LDSHARED=${LDSHARED-"$cc -shared"} + LDSHAREDLIBC="" + EXE='.exe' ;; + QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 + # (alain.bonnefoy@icbt.com) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;; + HP-UX*) + LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} + case `(uname -m || echo unknown) 2>/dev/null` in + ia64) + shared_ext='.so' + SHAREDLIB='libz.so' ;; + *) + shared_ext='.sl' + SHAREDLIB='libz.sl' ;; + esac ;; + Darwin* | darwin*) + shared_ext='.dylib' + SHAREDLIB=libz$shared_ext + SHAREDLIBV=libz.$VER$shared_ext + SHAREDLIBM=libz.$VER1$shared_ext + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} + AR="/usr/bin/libtool" + ARFLAGS="-o" ;; + *) LDSHARED=${LDSHARED-"$cc -shared"} ;; + esac +else + # find system name and corresponding cc options + CC=${CC-cc} + gcc=0 + echo ... using $CC >> configure.log + if test -z "$uname"; then + uname=`(uname -sr || echo unknown) 2>/dev/null` + fi + case "$uname" in + HP-UX*) SFLAGS=${CFLAGS-"-O +z"} + CFLAGS=${CFLAGS-"-O"} +# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} + LDSHARED=${LDSHARED-"ld -b"} + case `(uname -m || echo unknown) 2>/dev/null` in + ia64) + shared_ext='.so' + SHAREDLIB='libz.so' ;; + *) + shared_ext='.sl' + SHAREDLIB='libz.sl' ;; + esac ;; + IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} + CFLAGS=${CFLAGS-"-ansi -O2"} + LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;; + OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} + CFLAGS=${CFLAGS-"-O -std1"} + LDFLAGS="${LDFLAGS} -Wl,-rpath,." + LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;; + OSF1*) SFLAGS=${CFLAGS-"-O -std1"} + CFLAGS=${CFLAGS-"-O -std1"} + LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;; + QNX*) SFLAGS=${CFLAGS-"-4 -O"} + CFLAGS=${CFLAGS-"-4 -O"} + LDSHARED=${LDSHARED-"cc"} + RANLIB=${RANLIB-"true"} + AR="cc" + ARFLAGS="-A" ;; + SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} + CFLAGS=${CFLAGS-"-O3"} + LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;; + SunOS\ 5* | solaris*) + LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"} + SFLAGS=${CFLAGS-"-fast -KPIC"} + CFLAGS=${CFLAGS-"-fast"} + if test $build64 -eq 1; then + # old versions of SunPRO/Workshop/Studio don't support -m64, + # but newer ones do. Check for it. + flag64=`$CC -flags | egrep -- '^-m64'` + if test x"$flag64" != x"" ; then + CFLAGS="${CFLAGS} -m64" + SFLAGS="${SFLAGS} -m64" + else + case `(uname -m || echo unknown) 2>/dev/null` in + i86*) + SFLAGS="$SFLAGS -xarch=amd64" + CFLAGS="$CFLAGS -xarch=amd64" ;; + *) + SFLAGS="$SFLAGS -xarch=v9" + CFLAGS="$CFLAGS -xarch=v9" ;; + esac + fi + fi + ;; + SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} + CFLAGS=${CFLAGS-"-O2"} + LDSHARED=${LDSHARED-"ld"} ;; + SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"} + CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"} + LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;; + UNIX_System_V\ 4.2.0) + SFLAGS=${CFLAGS-"-KPIC -O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -G"} ;; + UNIX_SV\ 4.2MP) + SFLAGS=${CFLAGS-"-Kconform_pic -O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -G"} ;; + OpenUNIX\ 5) + SFLAGS=${CFLAGS-"-KPIC -O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -G"} ;; + AIX*) # Courtesy of dbakker@arrayasolutions.com + SFLAGS=${CFLAGS-"-O -qmaxmem=8192"} + CFLAGS=${CFLAGS-"-O -qmaxmem=8192"} + LDSHARED=${LDSHARED-"xlc -G"} ;; + # send working options for other systems to zlib@gzip.org + *) SFLAGS=${CFLAGS-"-O"} + CFLAGS=${CFLAGS-"-O"} + LDSHARED=${LDSHARED-"cc -shared"} ;; + esac +fi + +# destination names for shared library if not defined above +SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} +SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} +SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} + +echo >> configure.log + +# see if shared library build supported +if test $shared -eq 1; then + echo Checking for shared library support... | tee -a configure.log + # we must test in two steps (cc then ld), required at least on SunOS 4.x + if try $CC -w -c $SFLAGS $test.c && + try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then + echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log + elif test -z "$old_cc" -a -z "$old_cflags"; then + echo No shared library support. | tee -a configure.log + shared=0; + else + echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log + shared=0; + fi +fi +if test $shared -eq 0; then + LDSHARED="$CC" + ALL="static" + TEST="all teststatic" + SHAREDLIB="" + SHAREDLIBV="" + SHAREDLIBM="" + echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log +else + ALL="static shared" + TEST="all teststatic testshared" +fi + +echo >> configure.log + +# check for underscores in external names for use by assembler code +CPP=${CPP-"$CC -E"} +case $CFLAGS in + *ASMV*) + echo >> configure.log + show "$NM $test.o | grep _hello" + if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then + CPP="$CPP -DNO_UNDERLINE" + echo Checking for underline in external names... No. | tee -a configure.log + else + echo Checking for underline in external names... Yes. | tee -a configure.log + fi ;; +esac + +echo >> configure.log + +# check for large file support, and if none, check for fseeko() +cat > $test.c < +off64_t dummy = 0; +EOF +if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then + CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1" + SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1" + ALL="${ALL} all64" + TEST="${TEST} test64" + echo "Checking for off64_t... Yes." | tee -a configure.log + echo "Checking for fseeko... Yes." | tee -a configure.log +else + echo "Checking for off64_t... No." | tee -a configure.log + echo >> configure.log + cat > $test.c < +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +EOF + if try $CC $CFLAGS -o $test $test.c; then + echo "Checking for fseeko... Yes." | tee -a configure.log + else + CFLAGS="${CFLAGS} -DNO_FSEEKO" + SFLAGS="${SFLAGS} -DNO_FSEEKO" + echo "Checking for fseeko... No." | tee -a configure.log + fi +fi + +echo >> configure.log + +# check for strerror() for use by gz* functions +cat > $test.c < +#include +int main() { return strlen(strerror(errno)); } +EOF +if try $CC $CFLAGS -o $test $test.c; then + echo "Checking for strerror... Yes." | tee -a configure.log +else + CFLAGS="${CFLAGS} -DNO_STRERROR" + SFLAGS="${SFLAGS} -DNO_STRERROR" + echo "Checking for strerror... No." | tee -a configure.log +fi + +# copy clean zconf.h for subsequent edits +cp -p zconf.h.in zconf.h + +echo >> configure.log + +# check for unistd.h and save result in zconf.h +cat > $test.c < +int main() { return 0; } +EOF +if try $CC -c $CFLAGS $test.c; then + sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h + mv zconf.temp.h zconf.h + echo "Checking for unistd.h... Yes." | tee -a configure.log +else + echo "Checking for unistd.h... No." | tee -a configure.log +fi + +echo >> configure.log + +# check for stdarg.h and save result in zconf.h +cat > $test.c < +int main() { return 0; } +EOF +if try $CC -c $CFLAGS $test.c; then + sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h + mv zconf.temp.h zconf.h + echo "Checking for stdarg.h... Yes." | tee -a configure.log +else + echo "Checking for stdarg.h... No." | tee -a configure.log +fi + +# if the z_ prefix was requested, save that in zconf.h +if test $zprefix -eq 1; then + sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h + mv zconf.temp.h zconf.h + echo >> configure.log + echo "Using z_ prefix on all symbols." | tee -a configure.log +fi + +# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists +if test $solo -eq 1; then + sed '/#define ZCONF_H/a\ +#define Z_SOLO + +' < zconf.h > zconf.temp.h + mv zconf.temp.h zconf.h +OBJC='$(OBJZ)' +PIC_OBJC='$(PIC_OBJZ)' +fi + +# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X +if test $cover -eq 1; then + CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage" + if test -n "$GCC_CLASSIC"; then + CC=$GCC_CLASSIC + fi +fi + +echo >> configure.log + +# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions +# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a +# return value. The most secure result is vsnprintf() with a return value. snprintf() with a +# return value is secure as well, but then gzprintf() will be limited to 20 arguments. +cat > $test.c < +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +EOF +if try $CC -c $CFLAGS $test.c; then + echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log + + echo >> configure.log + cat > $test.c < +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +EOF + if try $CC $CFLAGS -o $test $test.c; then + echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log + cat >$test.c < +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +EOF + + if try $CC -c $CFLAGS $test.c; then + echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log + else + CFLAGS="$CFLAGS -DHAS_vsnprintf_void" + SFLAGS="$SFLAGS -DHAS_vsnprintf_void" + echo "Checking for return value of vsnprintf()... No." | tee -a configure.log + echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log + echo " can build but will be open to possible string-format security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + fi + else + CFLAGS="$CFLAGS -DNO_vsnprintf" + SFLAGS="$SFLAGS -DNO_vsnprintf" + echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log + echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log + echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + + echo >> configure.log + cat >$test.c < +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsprintf(buf, fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +EOF + + if try $CC -c $CFLAGS $test.c; then + echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log + else + CFLAGS="$CFLAGS -DHAS_vsprintf_void" + SFLAGS="$SFLAGS -DHAS_vsprintf_void" + echo "Checking for return value of vsprintf()... No." | tee -a configure.log + echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log + echo " can build but will be open to possible string-format security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + fi + fi +else + echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log + + echo >> configure.log + cat >$test.c < +int mytest() +{ + char buf[20]; + snprintf(buf, sizeof(buf), "%s", "foo"); + return 0; +} +int main() +{ + return (mytest()); +} +EOF + + if try $CC $CFLAGS -o $test $test.c; then + echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log + + echo >> configure.log + cat >$test.c < +int mytest() +{ + char buf[20]; + return snprintf(buf, sizeof(buf), "%s", "foo"); +} +int main() +{ + return (mytest()); +} +EOF + + if try $CC -c $CFLAGS $test.c; then + echo "Checking for return value of snprintf()... Yes." | tee -a configure.log + else + CFLAGS="$CFLAGS -DHAS_snprintf_void" + SFLAGS="$SFLAGS -DHAS_snprintf_void" + echo "Checking for return value of snprintf()... No." | tee -a configure.log + echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log + echo " can build but will be open to possible string-format security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + fi + else + CFLAGS="$CFLAGS -DNO_snprintf" + SFLAGS="$SFLAGS -DNO_snprintf" + echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log + echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log + echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + + echo >> configure.log + cat >$test.c < +int mytest() +{ + char buf[20]; + return sprintf(buf, "%s", "foo"); +} +int main() +{ + return (mytest()); +} +EOF + + if try $CC -c $CFLAGS $test.c; then + echo "Checking for return value of sprintf()... Yes." | tee -a configure.log + else + CFLAGS="$CFLAGS -DHAS_sprintf_void" + SFLAGS="$SFLAGS -DHAS_sprintf_void" + echo "Checking for return value of sprintf()... No." | tee -a configure.log + echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log + echo " can build but will be open to possible string-format security" | tee -a configure.log + echo " vulnerabilities." | tee -a configure.log + fi + fi +fi + +# see if we can hide zlib internal symbols that are linked between separate source files +if test "$gcc" -eq 1; then + echo >> configure.log + cat > $test.c <> configure.log + +# find a four-byte unsiged integer type for crc calculations +cat > $test.c < +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +EOF +Z_U4="" +if try $CC $CFLAGS $test.c -o $test && Z_U4=`./$test` && test -n "$Z_U4"; then + sed < zconf.h "/#define Z_U4/s/\/\* \.\/configure may/#define Z_U4 $Z_U4 \/* .\/configure put the/" > zconf.temp.h + mv zconf.temp.h zconf.h + echo "Looking for a four-byte integer type... Found." | tee -a configure.log +else + echo "Looking for a four-byte integer type... Not found." | tee -a configure.log +fi + +# clean up files produced by running the compiler and linker +rm -f $test.[co] $test $test$shared_ext $test.gcno + +# show the results in the log +echo >> configure.log +echo ALL = $ALL >> configure.log +echo AR = $AR >> configure.log +echo ARFLAGS = $ARFLAGS >> configure.log +echo CC = $CC >> configure.log +echo CFLAGS = $CFLAGS >> configure.log +echo CPP = $CPP >> configure.log +echo EXE = $EXE >> configure.log +echo LDCONFIG = $LDCONFIG >> configure.log +echo LDFLAGS = $LDFLAGS >> configure.log +echo LDSHARED = $LDSHARED >> configure.log +echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log +echo OBJC = $OBJC >> configure.log +echo PIC_OBJC = $PIC_OBJC >> configure.log +echo RANLIB = $RANLIB >> configure.log +echo SFLAGS = $SFLAGS >> configure.log +echo SHAREDLIB = $SHAREDLIB >> configure.log +echo SHAREDLIBM = $SHAREDLIBM >> configure.log +echo SHAREDLIBV = $SHAREDLIBV >> configure.log +echo STATICLIB = $STATICLIB >> configure.log +echo TEST = $TEST >> configure.log +echo VER = $VER >> configure.log +echo Z_U4 = $Z_U4 >> configure.log +echo exec_prefix = $exec_prefix >> configure.log +echo includedir = $includedir >> configure.log +echo libdir = $libdir >> configure.log +echo mandir = $mandir >> configure.log +echo prefix = $prefix >> configure.log +echo sharedlibdir = $sharedlibdir >> configure.log +echo uname = $uname >> configure.log +echo -------------------- >> configure.log +echo >> configure.log +echo >> configure.log + +# udpate Makefile with the configure results +sed < Makefile.in " +/^CC *=/s#=.*#=$CC# +/^CFLAGS *=/s#=.*#=$CFLAGS# +/^SFLAGS *=/s#=.*#=$SFLAGS# +/^LDFLAGS *=/s#=.*#=$LDFLAGS# +/^LDSHARED *=/s#=.*#=$LDSHARED# +/^CPP *=/s#=.*#=$CPP# +/^STATICLIB *=/s#=.*#=$STATICLIB# +/^SHAREDLIB *=/s#=.*#=$SHAREDLIB# +/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# +/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# +/^AR *=/s#=.*#=$AR# +/^ARFLAGS *=/s#=.*#=$ARFLAGS# +/^RANLIB *=/s#=.*#=$RANLIB# +/^LDCONFIG *=/s#=.*#=$LDCONFIG# +/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC# +/^EXE *=/s#=.*#=$EXE# +/^prefix *=/s#=.*#=$prefix# +/^exec_prefix *=/s#=.*#=$exec_prefix# +/^libdir *=/s#=.*#=$libdir# +/^sharedlibdir *=/s#=.*#=$sharedlibdir# +/^includedir *=/s#=.*#=$includedir# +/^mandir *=/s#=.*#=$mandir# +/^OBJC *=/s#=.*#= $OBJC# +/^PIC_OBJC *=/s#=.*#= $PIC_OBJC# +/^all: */s#:.*#: $ALL# +/^test: */s#:.*#: $TEST# +" > Makefile + +# create zlib.pc with the configure results +sed < zlib.pc.in " +/^CC *=/s#=.*#=$CC# +/^CFLAGS *=/s#=.*#=$CFLAGS# +/^CPP *=/s#=.*#=$CPP# +/^LDSHARED *=/s#=.*#=$LDSHARED# +/^STATICLIB *=/s#=.*#=$STATICLIB# +/^SHAREDLIB *=/s#=.*#=$SHAREDLIB# +/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# +/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# +/^AR *=/s#=.*#=$AR# +/^ARFLAGS *=/s#=.*#=$ARFLAGS# +/^RANLIB *=/s#=.*#=$RANLIB# +/^EXE *=/s#=.*#=$EXE# +/^prefix *=/s#=.*#=$prefix# +/^exec_prefix *=/s#=.*#=$exec_prefix# +/^libdir *=/s#=.*#=$libdir# +/^sharedlibdir *=/s#=.*#=$sharedlibdir# +/^includedir *=/s#=.*#=$includedir# +/^mandir *=/s#=.*#=$mandir# +/^LDFLAGS *=/s#=.*#=$LDFLAGS# +" | sed -e " +s/\@VERSION\@/$VER/g; +" > zlib.pc diff --git a/thirdparty/zlib/zlib-1.2.7/configure.log b/thirdparty/zlib/zlib-1.2.7/configure.log new file mode 100644 index 0000000..afe40bf --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/configure.log @@ -0,0 +1,924 @@ +-------------------- +./configure +Mon Feb 18 14:38:31 CET 2013 + +Checking for gcc... +=== ztest16867.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -c -O3 ztest16867.c +... using gcc + +Checking for shared library support... +=== ztest16867.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -w -c -O3 -fPIC ztest16867.c +gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 -O3 -fPIC -o ztest16867.dylib ztest16867.o +Building shared library libz.1.2.7.dylib with gcc. + + +=== ztest16867.c === +#include +off64_t dummy = 0; +=== +gcc -c -O3 -D_LARGEFILE64_SOURCE=1 ztest16867.c +ztest16867.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +(exit code 1) +Checking for off64_t... No. + +=== ztest16867.c === +#include +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +=== +gcc -O3 -o ztest16867 ztest16867.c +Checking for fseeko... Yes. + +=== ztest16867.c === +#include +#include +int main() { return strlen(strerror(errno)); } +=== +gcc -O3 -o ztest16867 ztest16867.c +Checking for strerror... Yes. + +=== ztest16867.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest16867.c +Checking for unistd.h... Yes. + +=== ztest16867.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest16867.c +Checking for stdarg.h... Yes. + +=== ztest16867.c === +#include +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +=== +gcc -c -O3 ztest16867.c +Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). + +=== ztest16867.c === +#include +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -O3 -o ztest16867 ztest16867.c +Checking for vsnprintf() in stdio.h... Yes. + +=== ztest16867.c === +#include +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -c -O3 ztest16867.c +Checking for return value of vsnprintf()... Yes. + +=== ztest16867.c === +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +int ZLIB_INTERNAL foo; +int main() +{ + return 0; +} +=== +gcc -c -O3 ztest16867.c +Checking for attribute(visibility) support... Yes. + +=== ztest16867.c === +#include +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +=== +gcc -O3 -DHAVE_HIDDEN ztest16867.c -o ztest16867 +Looking for a four-byte integer type... Found. + +ALL = static shared +AR = /usr/bin/libtool +ARFLAGS = -o +CC = gcc +CFLAGS = -O3 -DHAVE_HIDDEN +CPP = gcc -E +EXE = +LDCONFIG = ldconfig +LDFLAGS = +LDSHARED = gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +LDSHAREDLIBC = -lc +OBJC = $(OBJZ) $(OBJG) +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) +RANLIB = ranlib +SFLAGS = -O3 -fPIC -DHAVE_HIDDEN +SHAREDLIB = libz.dylib +SHAREDLIBM = libz.1.dylib +SHAREDLIBV = libz.1.2.7.dylib +STATICLIB = libz.a +TEST = all teststatic testshared +VER = 1.2.7 +Z_U4 = unsigned +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${exec_prefix}/lib +mandir = ${prefix}/share/man +prefix = /usr/local +sharedlibdir = ${libdir} +uname = Darwin +-------------------- + + +-------------------- +./configure +Tue Feb 19 17:43:24 CET 2013 + +Checking for gcc... +=== ztest99817.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -c -O3 ztest99817.c +... using gcc + +Checking for shared library support... +=== ztest99817.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -w -c -O3 -fPIC ztest99817.c +gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 -O3 -fPIC -o ztest99817.dylib ztest99817.o +Building shared library libz.1.2.7.dylib with gcc. + + +=== ztest99817.c === +#include +off64_t dummy = 0; +=== +gcc -c -O3 -D_LARGEFILE64_SOURCE=1 ztest99817.c +ztest99817.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +(exit code 1) +Checking for off64_t... No. + +=== ztest99817.c === +#include +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +=== +gcc -O3 -o ztest99817 ztest99817.c +Checking for fseeko... Yes. + +=== ztest99817.c === +#include +#include +int main() { return strlen(strerror(errno)); } +=== +gcc -O3 -o ztest99817 ztest99817.c +Checking for strerror... Yes. + +=== ztest99817.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest99817.c +Checking for unistd.h... Yes. + +=== ztest99817.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest99817.c +Checking for stdarg.h... Yes. + +=== ztest99817.c === +#include +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +=== +gcc -c -O3 ztest99817.c +Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). + +=== ztest99817.c === +#include +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -O3 -o ztest99817 ztest99817.c +Checking for vsnprintf() in stdio.h... Yes. + +=== ztest99817.c === +#include +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -c -O3 ztest99817.c +Checking for return value of vsnprintf()... Yes. + +=== ztest99817.c === +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +int ZLIB_INTERNAL foo; +int main() +{ + return 0; +} +=== +gcc -c -O3 ztest99817.c +Checking for attribute(visibility) support... Yes. + +=== ztest99817.c === +#include +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +=== +gcc -O3 -DHAVE_HIDDEN ztest99817.c -o ztest99817 +Looking for a four-byte integer type... Found. + +ALL = static shared +AR = /usr/bin/libtool +ARFLAGS = -o +CC = gcc +CFLAGS = -O3 -DHAVE_HIDDEN +CPP = gcc -E +EXE = +LDCONFIG = ldconfig +LDFLAGS = +LDSHARED = gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +LDSHAREDLIBC = -lc +OBJC = $(OBJZ) $(OBJG) +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) +RANLIB = ranlib +SFLAGS = -O3 -fPIC -DHAVE_HIDDEN +SHAREDLIB = libz.dylib +SHAREDLIBM = libz.1.dylib +SHAREDLIBV = libz.1.2.7.dylib +STATICLIB = libz.a +TEST = all teststatic testshared +VER = 1.2.7 +Z_U4 = unsigned +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${exec_prefix}/lib +mandir = ${prefix}/share/man +prefix = /usr/local +sharedlibdir = ${libdir} +uname = Darwin +-------------------- + + +-------------------- +./configure CFLAGS=-arch i386 +Tue Feb 19 17:44:31 CET 2013 +./configure --help for help +-------------------- +./configure --help +Tue Feb 19 17:44:46 CET 2013 +usage: + configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX] + [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR] + [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"] +-------------------- +./configure +Tue Feb 19 17:45:01 CET 2013 + +Checking for gcc... +=== ztest139.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -c -O3 ztest139.c +... using gcc + +Checking for shared library support... +=== ztest139.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -w -c -O3 -fPIC ztest139.c +gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 -O3 -fPIC -o ztest139.dylib ztest139.o +Building shared library libz.1.2.7.dylib with gcc. + + +=== ztest139.c === +#include +off64_t dummy = 0; +=== +gcc -c -O3 -D_LARGEFILE64_SOURCE=1 ztest139.c +ztest139.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +(exit code 1) +Checking for off64_t... No. + +=== ztest139.c === +#include +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +=== +gcc -O3 -o ztest139 ztest139.c +Checking for fseeko... Yes. + +=== ztest139.c === +#include +#include +int main() { return strlen(strerror(errno)); } +=== +gcc -O3 -o ztest139 ztest139.c +Checking for strerror... Yes. + +=== ztest139.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest139.c +Checking for unistd.h... Yes. + +=== ztest139.c === +#include +int main() { return 0; } +=== +gcc -c -O3 ztest139.c +Checking for stdarg.h... Yes. + +=== ztest139.c === +#include +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +=== +gcc -c -O3 ztest139.c +Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). + +=== ztest139.c === +#include +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -O3 -o ztest139 ztest139.c +Checking for vsnprintf() in stdio.h... Yes. + +=== ztest139.c === +#include +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -c -O3 ztest139.c +Checking for return value of vsnprintf()... Yes. + +=== ztest139.c === +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +int ZLIB_INTERNAL foo; +int main() +{ + return 0; +} +=== +gcc -c -O3 ztest139.c +Checking for attribute(visibility) support... Yes. + +=== ztest139.c === +#include +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +=== +gcc -O3 -DHAVE_HIDDEN ztest139.c -o ztest139 +Looking for a four-byte integer type... Found. + +ALL = static shared +AR = /usr/bin/libtool +ARFLAGS = -o +CC = gcc +CFLAGS = -O3 -DHAVE_HIDDEN +CPP = gcc -E +EXE = +LDCONFIG = ldconfig +LDFLAGS = +LDSHARED = gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +LDSHAREDLIBC = -lc +OBJC = $(OBJZ) $(OBJG) +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) +RANLIB = ranlib +SFLAGS = -O3 -fPIC -DHAVE_HIDDEN +SHAREDLIB = libz.dylib +SHAREDLIBM = libz.1.dylib +SHAREDLIBV = libz.1.2.7.dylib +STATICLIB = libz.a +TEST = all teststatic testshared +VER = 1.2.7 +Z_U4 = unsigned +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${exec_prefix}/lib +mandir = ${prefix}/share/man +prefix = /usr/local +sharedlibdir = ${libdir} +uname = Darwin +-------------------- + + +-------------------- +./configure --help +Tue Feb 19 17:45:35 CET 2013 +usage: + configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX] + [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR] + [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"] +-------------------- +./configure --archs=-arch i386 -arch x86_64 +Tue Feb 19 17:45:58 CET 2013 + +Checking for gcc... +=== ztest1078.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -c -O3 ztest1078.c +... using gcc + +Checking for shared library support... +=== ztest1078.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -w -c -O3 -arch i386 -arch x86_64 -fPIC ztest1078.c +gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 -O3 -arch i386 -arch x86_64 -fPIC -o ztest1078.dylib ztest1078.o +Building shared library libz.1.2.7.dylib with gcc. + + +=== ztest1078.c === +#include +off64_t dummy = 0; +=== +gcc -c -O3 -arch i386 -arch x86_64 -D_LARGEFILE64_SOURCE=1 ztest1078.c +ztest1078.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +ztest1078.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +lipo: can't figure out the architecture type of: /var/folders/my/rsjv5m457_j955p9gy3v3txc0000gs/T//ccqhj66X.out +(exit code 1) +Checking for off64_t... No. + +=== ztest1078.c === +#include +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest1078 ztest1078.c +Checking for fseeko... Yes. + +=== ztest1078.c === +#include +#include +int main() { return strlen(strerror(errno)); } +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest1078 ztest1078.c +Checking for strerror... Yes. + +=== ztest1078.c === +#include +int main() { return 0; } +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest1078.c +Checking for unistd.h... Yes. + +=== ztest1078.c === +#include +int main() { return 0; } +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest1078.c +Checking for stdarg.h... Yes. + +=== ztest1078.c === +#include +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest1078.c +Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). + +=== ztest1078.c === +#include +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest1078 ztest1078.c +Checking for vsnprintf() in stdio.h... Yes. + +=== ztest1078.c === +#include +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest1078.c +Checking for return value of vsnprintf()... Yes. + +=== ztest1078.c === +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +int ZLIB_INTERNAL foo; +int main() +{ + return 0; +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest1078.c +Checking for attribute(visibility) support... Yes. + +=== ztest1078.c === +#include +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +=== +gcc -O3 -arch i386 -arch x86_64 -DHAVE_HIDDEN ztest1078.c -o ztest1078 +Looking for a four-byte integer type... Found. + +ALL = static shared +AR = /usr/bin/libtool +ARFLAGS = -o +CC = gcc +CFLAGS = -O3 -arch i386 -arch x86_64 -DHAVE_HIDDEN +CPP = gcc -E +EXE = +LDCONFIG = ldconfig +LDFLAGS = -arch i386 -arch x86_64 +LDSHARED = gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +LDSHAREDLIBC = -lc +OBJC = $(OBJZ) $(OBJG) +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) +RANLIB = ranlib +SFLAGS = -O3 -arch i386 -arch x86_64 -fPIC -DHAVE_HIDDEN +SHAREDLIB = libz.dylib +SHAREDLIBM = libz.1.dylib +SHAREDLIBV = libz.1.2.7.dylib +STATICLIB = libz.a +TEST = all teststatic testshared +VER = 1.2.7 +Z_U4 = unsigned +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${exec_prefix}/lib +mandir = ${prefix}/share/man +prefix = /usr/local +sharedlibdir = ${libdir} +uname = Darwin +-------------------- + + +-------------------- +./configure --help +Wed Feb 20 09:25:51 CET 2013 +usage: + configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX] + [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR] + [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"] +-------------------- +./configure --archs=-arch i386 -arch x86_64 +Wed Feb 20 09:26:48 CET 2013 + +Checking for gcc... +=== ztest6523.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -c -O3 ztest6523.c +... using gcc + +Checking for shared library support... +=== ztest6523.c === +extern int getchar(); +int hello() {return getchar();} +=== +gcc -w -c -O3 -arch i386 -arch x86_64 -fPIC ztest6523.c +gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 -O3 -arch i386 -arch x86_64 -fPIC -o ztest6523.dylib ztest6523.o +Building shared library libz.1.2.7.dylib with gcc. + + +=== ztest6523.c === +#include +off64_t dummy = 0; +=== +gcc -c -O3 -arch i386 -arch x86_64 -D_LARGEFILE64_SOURCE=1 ztest6523.c +ztest6523.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +ztest6523.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dummy’ +lipo: can't figure out the architecture type of: /var/folders/my/rsjv5m457_j955p9gy3v3txc0000gs/T//ccm0B6he.out +(exit code 1) +Checking for off64_t... No. + +=== ztest6523.c === +#include +int main(void) { + fseeko(NULL, 0, 0); + return 0; +} +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest6523 ztest6523.c +Checking for fseeko... Yes. + +=== ztest6523.c === +#include +#include +int main() { return strlen(strerror(errno)); } +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest6523 ztest6523.c +Checking for strerror... Yes. + +=== ztest6523.c === +#include +int main() { return 0; } +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest6523.c +Checking for unistd.h... Yes. + +=== ztest6523.c === +#include +int main() { return 0; } +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest6523.c +Checking for stdarg.h... Yes. + +=== ztest6523.c === +#include +#include +#include "zconf.h" +int main() +{ +#ifndef STDC + choke me +#endif + return 0; +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest6523.c +Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). + +=== ztest6523.c === +#include +#include +int mytest(const char *fmt, ...) +{ + char buf[20]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return 0; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -O3 -arch i386 -arch x86_64 -o ztest6523 ztest6523.c +Checking for vsnprintf() in stdio.h... Yes. + +=== ztest6523.c === +#include +#include +int mytest(const char *fmt, ...) +{ + int n; + char buf[20]; + va_list ap; + va_start(ap, fmt); + n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return n; +} +int main() +{ + return (mytest("Hello%d\n", 1)); +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest6523.c +Checking for return value of vsnprintf()... Yes. + +=== ztest6523.c === +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +int ZLIB_INTERNAL foo; +int main() +{ + return 0; +} +=== +gcc -c -O3 -arch i386 -arch x86_64 ztest6523.c +Checking for attribute(visibility) support... Yes. + +=== ztest6523.c === +#include +#define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} +int main() { + int k; + unsigned i; + unsigned long l; + unsigned short s; + is32(i, "unsigned") + is32(l, "unsigned long") + is32(s, "unsigned short") + return 1; +} +=== +gcc -O3 -arch i386 -arch x86_64 -DHAVE_HIDDEN ztest6523.c -o ztest6523 +Looking for a four-byte integer type... Found. + +ALL = static shared +AR = /usr/bin/libtool +ARFLAGS = -o +CC = gcc +CFLAGS = -O3 -arch i386 -arch x86_64 -DHAVE_HIDDEN +CPP = gcc -E +EXE = +LDCONFIG = ldconfig +LDFLAGS = -arch i386 -arch x86_64 +LDSHARED = gcc -dynamiclib -install_name ${exec_prefix}/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.7 +LDSHAREDLIBC = -lc +OBJC = $(OBJZ) $(OBJG) +PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) +RANLIB = ranlib +SFLAGS = -O3 -arch i386 -arch x86_64 -fPIC -DHAVE_HIDDEN +SHAREDLIB = libz.dylib +SHAREDLIBM = libz.1.dylib +SHAREDLIBV = libz.1.2.7.dylib +STATICLIB = libz.a +TEST = all teststatic testshared +VER = 1.2.7 +Z_U4 = unsigned +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${exec_prefix}/lib +mandir = ${prefix}/share/man +prefix = /usr/local +sharedlibdir = ${libdir} +uname = Darwin +-------------------- + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/README.contrib b/thirdparty/zlib/zlib-1.2.7/contrib/README.contrib new file mode 100644 index 0000000..dd2285d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/README.contrib @@ -0,0 +1,77 @@ +All files under this contrib directory are UNSUPPORTED. There were +provided by users of zlib and were not tested by the authors of zlib. +Use at your own risk. Please contact the authors of the contributions +for help about these, not the zlib authors. Thanks. + + +ada/ by Dmitriy Anisimkov + Support for Ada + See http://zlib-ada.sourceforge.net/ + +amd64/ by Mikhail Teterin + asm code for AMD64 + See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393 + +asm686/ by Brian Raiter + asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax + See http://www.muppetlabs.com/~breadbox/software/assembly.html + +blast/ by Mark Adler + Decompressor for output of PKWare Data Compression Library (DCL) + +delphi/ by Cosmin Truta + Support for Delphi and C++ Builder + +dotzlib/ by Henrik Ravn + Support for Microsoft .Net and Visual C++ .Net + +gcc_gvmat64/by Gilles Vollant + GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64 + assembler to replace longest_match() and inflate_fast() + +infback9/ by Mark Adler + Unsupported diffs to infback to decode the deflate64 format + +inflate86/ by Chris Anderson + Tuned x86 gcc asm code to replace inflate_fast() + +iostream/ by Kevin Ruland + A C++ I/O streams interface to the zlib gz* functions + +iostream2/ by Tyge L�vset + Another C++ I/O streams interface + +iostream3/ by Ludwig Schwardt + and Kevin Ruland + Yet another C++ I/O streams interface + +masmx64/ by Gilles Vollant + x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to + replace longest_match() and inflate_fast(), also masm x86 + 64-bits translation of Chris Anderson inflate_fast() + +masmx86/ by Gilles Vollant + x86 asm code to replace longest_match() and inflate_fast(), + for Visual C++ and MASM (32 bits). + Based on Brian Raiter (asm686) and Chris Anderson (inflate86) + +minizip/ by Gilles Vollant + Mini zip and unzip based on zlib + Includes Zip64 support by Mathias Svensson + See http://www.winimage.com/zLibDll/unzip.html + +pascal/ by Bob Dellaca et al. + Support for Pascal + +puff/ by Mark Adler + Small, low memory usage inflate. Also serves to provide an + unambiguous description of the deflate format. + +testzlib/ by Gilles Vollant + Example of the use of zlib + +untgz/ by Pedro A. Aranda Gutierrez + A very simple tar.gz file extractor using zlib + +vstudio/ by Gilles Vollant + Building a minizip-enhanced zlib with Microsoft Visual Studio diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/buffer_demo.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/buffer_demo.adb new file mode 100644 index 0000000..46b8638 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/buffer_demo.adb @@ -0,0 +1,106 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2004 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- +-- +-- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $ + +-- This demo program provided by Dr Steve Sangwine +-- +-- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer +-- of exactly the correct size is used for decompressed data, and the last +-- few bytes passed in to Zlib are checksum bytes. + +-- This program compresses a string of text, and then decompresses the +-- compressed text into a buffer of the same size as the original text. + +with Ada.Streams; use Ada.Streams; +with Ada.Text_IO; + +with ZLib; use ZLib; + +procedure Buffer_Demo is + EOL : Character renames ASCII.LF; + Text : constant String + := "Four score and seven years ago our fathers brought forth," & EOL & + "upon this continent, a new nation, conceived in liberty," & EOL & + "and dedicated to the proposition that `all men are created equal'."; + + Source : Stream_Element_Array (1 .. Text'Length); + for Source'Address use Text'Address; + +begin + Ada.Text_IO.Put (Text); + Ada.Text_IO.New_Line; + Ada.Text_IO.Put_Line + ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes"); + + declare + Compressed_Data : Stream_Element_Array (1 .. Text'Length); + L : Stream_Element_Offset; + begin + Compress : declare + Compressor : Filter_Type; + I : Stream_Element_Offset; + begin + Deflate_Init (Compressor); + + -- Compress the whole of T at once. + + Translate (Compressor, Source, I, Compressed_Data, L, Finish); + pragma Assert (I = Source'Last); + + Close (Compressor); + + Ada.Text_IO.Put_Line + ("Compressed size : " + & Stream_Element_Offset'Image (L) & " bytes"); + end Compress; + + -- Now we decompress the data, passing short blocks of data to Zlib + -- (because this demonstrates the problem - the last block passed will + -- contain checksum information and there will be no output, only a + -- check inside Zlib that the checksum is correct). + + Decompress : declare + Decompressor : Filter_Type; + + Uncompressed_Data : Stream_Element_Array (1 .. Text'Length); + + Block_Size : constant := 4; + -- This makes sure that the last block contains + -- only Adler checksum data. + + P : Stream_Element_Offset := Compressed_Data'First - 1; + O : Stream_Element_Offset; + begin + Inflate_Init (Decompressor); + + loop + Translate + (Decompressor, + Compressed_Data + (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)), + P, + Uncompressed_Data + (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last), + O, + No_Flush); + + Ada.Text_IO.Put_Line + ("Total in : " & Count'Image (Total_In (Decompressor)) & + ", out : " & Count'Image (Total_Out (Decompressor))); + + exit when P = L; + end loop; + + Ada.Text_IO.New_Line; + Ada.Text_IO.Put_Line + ("Decompressed text matches original text : " + & Boolean'Image (Uncompressed_Data = Source)); + end Decompress; + end; +end Buffer_Demo; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/mtest.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/mtest.adb new file mode 100644 index 0000000..c4dfd08 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/mtest.adb @@ -0,0 +1,156 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- +-- Continuous test for ZLib multithreading. If the test would fail +-- we should provide thread safe allocation routines for the Z_Stream. +-- +-- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $ + +with ZLib; +with Ada.Streams; +with Ada.Numerics.Discrete_Random; +with Ada.Text_IO; +with Ada.Exceptions; +with Ada.Task_Identification; + +procedure MTest is + use Ada.Streams; + use ZLib; + + Stop : Boolean := False; + + pragma Atomic (Stop); + + subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#; + + package Random_Elements is + new Ada.Numerics.Discrete_Random (Visible_Symbols); + + task type Test_Task; + + task body Test_Task is + Buffer : Stream_Element_Array (1 .. 100_000); + Gen : Random_Elements.Generator; + + Buffer_First : Stream_Element_Offset; + Compare_First : Stream_Element_Offset; + + Deflate : Filter_Type; + Inflate : Filter_Type; + + procedure Further (Item : in Stream_Element_Array); + + procedure Read_Buffer + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + + ------------- + -- Further -- + ------------- + + procedure Further (Item : in Stream_Element_Array) is + + procedure Compare (Item : in Stream_Element_Array); + + ------------- + -- Compare -- + ------------- + + procedure Compare (Item : in Stream_Element_Array) is + Next_First : Stream_Element_Offset := Compare_First + Item'Length; + begin + if Buffer (Compare_First .. Next_First - 1) /= Item then + raise Program_Error; + end if; + + Compare_First := Next_First; + end Compare; + + procedure Compare_Write is new ZLib.Write (Write => Compare); + begin + Compare_Write (Inflate, Item, No_Flush); + end Further; + + ----------------- + -- Read_Buffer -- + ----------------- + + procedure Read_Buffer + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset) + is + Buff_Diff : Stream_Element_Offset := Buffer'Last - Buffer_First; + Next_First : Stream_Element_Offset; + begin + if Item'Length <= Buff_Diff then + Last := Item'Last; + + Next_First := Buffer_First + Item'Length; + + Item := Buffer (Buffer_First .. Next_First - 1); + + Buffer_First := Next_First; + else + Last := Item'First + Buff_Diff; + Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last); + Buffer_First := Buffer'Last + 1; + end if; + end Read_Buffer; + + procedure Translate is new Generic_Translate + (Data_In => Read_Buffer, + Data_Out => Further); + + begin + Random_Elements.Reset (Gen); + + Buffer := (others => 20); + + Main : loop + for J in Buffer'Range loop + Buffer (J) := Random_Elements.Random (Gen); + + Deflate_Init (Deflate); + Inflate_Init (Inflate); + + Buffer_First := Buffer'First; + Compare_First := Buffer'First; + + Translate (Deflate); + + if Compare_First /= Buffer'Last + 1 then + raise Program_Error; + end if; + + Ada.Text_IO.Put_Line + (Ada.Task_Identification.Image + (Ada.Task_Identification.Current_Task) + & Stream_Element_Offset'Image (J) + & ZLib.Count'Image (Total_Out (Deflate))); + + Close (Deflate); + Close (Inflate); + + exit Main when Stop; + end loop; + end loop Main; + exception + when E : others => + Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E)); + Stop := True; + end Test_Task; + + Test : array (1 .. 4) of Test_Task; + + pragma Unreferenced (Test); + + Dummy : Character; + +begin + Ada.Text_IO.Get_Immediate (Dummy); + Stop := True; +end MTest; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/read.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/read.adb new file mode 100644 index 0000000..1f2efbf --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/read.adb @@ -0,0 +1,156 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $ + +-- Test/demo program for the generic read interface. + +with Ada.Numerics.Discrete_Random; +with Ada.Streams; +with Ada.Text_IO; + +with ZLib; + +procedure Read is + + use Ada.Streams; + + ------------------------------------ + -- Test configuration parameters -- + ------------------------------------ + + File_Size : Stream_Element_Offset := 100_000; + + Continuous : constant Boolean := False; + -- If this constant is True, the test would be repeated again and again, + -- with increment File_Size for every iteration. + + Header : constant ZLib.Header_Type := ZLib.Default; + -- Do not use Header other than Default in ZLib versions 1.1.4 and older. + + Init_Random : constant := 8; + -- We are using the same random sequence, in case of we catch bug, + -- so we would be able to reproduce it. + + -- End -- + + Pack_Size : Stream_Element_Offset; + Offset : Stream_Element_Offset; + + Filter : ZLib.Filter_Type; + + subtype Visible_Symbols + is Stream_Element range 16#20# .. 16#7E#; + + package Random_Elements is new + Ada.Numerics.Discrete_Random (Visible_Symbols); + + Gen : Random_Elements.Generator; + Period : constant Stream_Element_Offset := 200; + -- Period constant variable for random generator not to be very random. + -- Bigger period, harder random. + + Read_Buffer : Stream_Element_Array (1 .. 2048); + Read_First : Stream_Element_Offset; + Read_Last : Stream_Element_Offset; + + procedure Reset; + + procedure Read + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset); + -- this procedure is for generic instantiation of + -- ZLib.Read + -- reading data from the File_In. + + procedure Read is new ZLib.Read + (Read, + Read_Buffer, + Rest_First => Read_First, + Rest_Last => Read_Last); + + ---------- + -- Read -- + ---------- + + procedure Read + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset) is + begin + Last := Stream_Element_Offset'Min + (Item'Last, + Item'First + File_Size - Offset); + + for J in Item'First .. Last loop + if J < Item'First + Period then + Item (J) := Random_Elements.Random (Gen); + else + Item (J) := Item (J - Period); + end if; + + Offset := Offset + 1; + end loop; + end Read; + + ----------- + -- Reset -- + ----------- + + procedure Reset is + begin + Random_Elements.Reset (Gen, Init_Random); + Pack_Size := 0; + Offset := 1; + Read_First := Read_Buffer'Last + 1; + Read_Last := Read_Buffer'Last; + end Reset; + +begin + Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version); + + loop + for Level in ZLib.Compression_Level'Range loop + + Ada.Text_IO.Put ("Level =" + & ZLib.Compression_Level'Image (Level)); + + -- Deflate using generic instantiation. + + ZLib.Deflate_Init + (Filter, + Level, + Header => Header); + + Reset; + + Ada.Text_IO.Put + (Stream_Element_Offset'Image (File_Size) & " ->"); + + loop + declare + Buffer : Stream_Element_Array (1 .. 1024); + Last : Stream_Element_Offset; + begin + Read (Filter, Buffer, Last); + + Pack_Size := Pack_Size + Last - Buffer'First + 1; + + exit when Last < Buffer'Last; + end; + end loop; + + Ada.Text_IO.Put_Line (Stream_Element_Offset'Image (Pack_Size)); + + ZLib.Close (Filter); + end loop; + + exit when not Continuous; + + File_Size := File_Size + 1; + end loop; +end Read; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/ada/readme.txt new file mode 100644 index 0000000..ce4d2ca --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/readme.txt @@ -0,0 +1,65 @@ + ZLib for Ada thick binding (ZLib.Ada) + Release 1.3 + +ZLib.Ada is a thick binding interface to the popular ZLib data +compression library, available at http://www.gzip.org/zlib/. +It provides Ada-style access to the ZLib C library. + + + Here are the main changes since ZLib.Ada 1.2: + +- Attension: ZLib.Read generic routine have a initialization requirement + for Read_Last parameter now. It is a bit incompartible with previous version, + but extends functionality, we could use new parameters Allow_Read_Some and + Flush now. + +- Added Is_Open routines to ZLib and ZLib.Streams packages. + +- Add pragma Assert to check Stream_Element is 8 bit. + +- Fix extraction to buffer with exact known decompressed size. Error reported by + Steve Sangwine. + +- Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits + computers. Patch provided by Pascal Obry. + +- Add Status_Error exception definition. + +- Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit. + + + How to build ZLib.Ada under GNAT + +You should have the ZLib library already build on your computer, before +building ZLib.Ada. Make the directory of ZLib.Ada sources current and +issue the command: + + gnatmake test -largs -L -lz + +Or use the GNAT project file build for GNAT 3.15 or later: + + gnatmake -Pzlib.gpr -L + + + How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 + +1. Make a project with all *.ads and *.adb files from the distribution. +2. Build the libz.a library from the ZLib C sources. +3. Rename libz.a to z.lib. +4. Add the library z.lib to the project. +5. Add the libc.lib library from the ObjectAda distribution to the project. +6. Build the executable using test.adb as a main procedure. + + + How to use ZLib.Ada + +The source files test.adb and read.adb are small demo programs that show +the main functionality of ZLib.Ada. + +The routines from the package specifications are commented. + + +Homepage: http://zlib-ada.sourceforge.net/ +Author: Dmitriy Anisimkov + +Contributors: Pascal Obry , Steve Sangwine diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/test.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/test.adb new file mode 100644 index 0000000..90773ac --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/test.adb @@ -0,0 +1,463 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: test.adb,v 1.17 2003/08/12 12:13:30 vagul Exp $ + +-- The program has a few aims. +-- 1. Test ZLib.Ada95 thick binding functionality. +-- 2. Show the example of use main functionality of the ZLib.Ada95 binding. +-- 3. Build this program automatically compile all ZLib.Ada95 packages under +-- GNAT Ada95 compiler. + +with ZLib.Streams; +with Ada.Streams.Stream_IO; +with Ada.Numerics.Discrete_Random; + +with Ada.Text_IO; + +with Ada.Calendar; + +procedure Test is + + use Ada.Streams; + use Stream_IO; + + ------------------------------------ + -- Test configuration parameters -- + ------------------------------------ + + File_Size : Count := 100_000; + Continuous : constant Boolean := False; + + Header : constant ZLib.Header_Type := ZLib.Default; + -- ZLib.None; + -- ZLib.Auto; + -- ZLib.GZip; + -- Do not use Header other then Default in ZLib versions 1.1.4 + -- and older. + + Strategy : constant ZLib.Strategy_Type := ZLib.Default_Strategy; + Init_Random : constant := 10; + + -- End -- + + In_File_Name : constant String := "testzlib.in"; + -- Name of the input file + + Z_File_Name : constant String := "testzlib.zlb"; + -- Name of the compressed file. + + Out_File_Name : constant String := "testzlib.out"; + -- Name of the decompressed file. + + File_In : File_Type; + File_Out : File_Type; + File_Back : File_Type; + File_Z : ZLib.Streams.Stream_Type; + + Filter : ZLib.Filter_Type; + + Time_Stamp : Ada.Calendar.Time; + + procedure Generate_File; + -- Generate file of spetsified size with some random data. + -- The random data is repeatable, for the good compression. + + procedure Compare_Streams + (Left, Right : in out Root_Stream_Type'Class); + -- The procedure compearing data in 2 streams. + -- It is for compare data before and after compression/decompression. + + procedure Compare_Files (Left, Right : String); + -- Compare files. Based on the Compare_Streams. + + procedure Copy_Streams + (Source, Target : in out Root_Stream_Type'Class; + Buffer_Size : in Stream_Element_Offset := 1024); + -- Copying data from one stream to another. It is for test stream + -- interface of the library. + + procedure Data_In + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset); + -- this procedure is for generic instantiation of + -- ZLib.Generic_Translate. + -- reading data from the File_In. + + procedure Data_Out (Item : in Stream_Element_Array); + -- this procedure is for generic instantiation of + -- ZLib.Generic_Translate. + -- writing data to the File_Out. + + procedure Stamp; + -- Store the timestamp to the local variable. + + procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count); + -- Print the time statistic with the message. + + procedure Translate is new ZLib.Generic_Translate + (Data_In => Data_In, + Data_Out => Data_Out); + -- This procedure is moving data from File_In to File_Out + -- with compression or decompression, depend on initialization of + -- Filter parameter. + + ------------------- + -- Compare_Files -- + ------------------- + + procedure Compare_Files (Left, Right : String) is + Left_File, Right_File : File_Type; + begin + Open (Left_File, In_File, Left); + Open (Right_File, In_File, Right); + Compare_Streams (Stream (Left_File).all, Stream (Right_File).all); + Close (Left_File); + Close (Right_File); + end Compare_Files; + + --------------------- + -- Compare_Streams -- + --------------------- + + procedure Compare_Streams + (Left, Right : in out Ada.Streams.Root_Stream_Type'Class) + is + Left_Buffer, Right_Buffer : Stream_Element_Array (0 .. 16#FFF#); + Left_Last, Right_Last : Stream_Element_Offset; + begin + loop + Read (Left, Left_Buffer, Left_Last); + Read (Right, Right_Buffer, Right_Last); + + if Left_Last /= Right_Last then + Ada.Text_IO.Put_Line ("Compare error :" + & Stream_Element_Offset'Image (Left_Last) + & " /= " + & Stream_Element_Offset'Image (Right_Last)); + + raise Constraint_Error; + + elsif Left_Buffer (0 .. Left_Last) + /= Right_Buffer (0 .. Right_Last) + then + Ada.Text_IO.Put_Line ("ERROR: IN and OUT files is not equal."); + raise Constraint_Error; + + end if; + + exit when Left_Last < Left_Buffer'Last; + end loop; + end Compare_Streams; + + ------------------ + -- Copy_Streams -- + ------------------ + + procedure Copy_Streams + (Source, Target : in out Ada.Streams.Root_Stream_Type'Class; + Buffer_Size : in Stream_Element_Offset := 1024) + is + Buffer : Stream_Element_Array (1 .. Buffer_Size); + Last : Stream_Element_Offset; + begin + loop + Read (Source, Buffer, Last); + Write (Target, Buffer (1 .. Last)); + + exit when Last < Buffer'Last; + end loop; + end Copy_Streams; + + ------------- + -- Data_In -- + ------------- + + procedure Data_In + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset) is + begin + Read (File_In, Item, Last); + end Data_In; + + -------------- + -- Data_Out -- + -------------- + + procedure Data_Out (Item : in Stream_Element_Array) is + begin + Write (File_Out, Item); + end Data_Out; + + ------------------- + -- Generate_File -- + ------------------- + + procedure Generate_File is + subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#; + + package Random_Elements is + new Ada.Numerics.Discrete_Random (Visible_Symbols); + + Gen : Random_Elements.Generator; + Buffer : Stream_Element_Array := (1 .. 77 => 16#20#) & 10; + + Buffer_Count : constant Count := File_Size / Buffer'Length; + -- Number of same buffers in the packet. + + Density : constant Count := 30; -- from 0 to Buffer'Length - 2; + + procedure Fill_Buffer (J, D : in Count); + -- Change the part of the buffer. + + ----------------- + -- Fill_Buffer -- + ----------------- + + procedure Fill_Buffer (J, D : in Count) is + begin + for K in 0 .. D loop + Buffer + (Stream_Element_Offset ((J + K) mod (Buffer'Length - 1) + 1)) + := Random_Elements.Random (Gen); + + end loop; + end Fill_Buffer; + + begin + Random_Elements.Reset (Gen, Init_Random); + + Create (File_In, Out_File, In_File_Name); + + Fill_Buffer (1, Buffer'Length - 2); + + for J in 1 .. Buffer_Count loop + Write (File_In, Buffer); + + Fill_Buffer (J, Density); + end loop; + + -- fill remain size. + + Write + (File_In, + Buffer + (1 .. Stream_Element_Offset + (File_Size - Buffer'Length * Buffer_Count))); + + Flush (File_In); + Close (File_In); + end Generate_File; + + --------------------- + -- Print_Statistic -- + --------------------- + + procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count) is + use Ada.Calendar; + use Ada.Text_IO; + + package Count_IO is new Integer_IO (ZLib.Count); + + Curr_Dur : Duration := Clock - Time_Stamp; + begin + Put (Msg); + + Set_Col (20); + Ada.Text_IO.Put ("size ="); + + Count_IO.Put + (Data_Size, + Width => Stream_IO.Count'Image (File_Size)'Length); + + Put_Line (" duration =" & Duration'Image (Curr_Dur)); + end Print_Statistic; + + ----------- + -- Stamp -- + ----------- + + procedure Stamp is + begin + Time_Stamp := Ada.Calendar.Clock; + end Stamp; + +begin + Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version); + + loop + Generate_File; + + for Level in ZLib.Compression_Level'Range loop + + Ada.Text_IO.Put_Line ("Level =" + & ZLib.Compression_Level'Image (Level)); + + -- Test generic interface. + Open (File_In, In_File, In_File_Name); + Create (File_Out, Out_File, Z_File_Name); + + Stamp; + + -- Deflate using generic instantiation. + + ZLib.Deflate_Init + (Filter => Filter, + Level => Level, + Strategy => Strategy, + Header => Header); + + Translate (Filter); + Print_Statistic ("Generic compress", ZLib.Total_Out (Filter)); + ZLib.Close (Filter); + + Close (File_In); + Close (File_Out); + + Open (File_In, In_File, Z_File_Name); + Create (File_Out, Out_File, Out_File_Name); + + Stamp; + + -- Inflate using generic instantiation. + + ZLib.Inflate_Init (Filter, Header => Header); + + Translate (Filter); + Print_Statistic ("Generic decompress", ZLib.Total_Out (Filter)); + + ZLib.Close (Filter); + + Close (File_In); + Close (File_Out); + + Compare_Files (In_File_Name, Out_File_Name); + + -- Test stream interface. + + -- Compress to the back stream. + + Open (File_In, In_File, In_File_Name); + Create (File_Back, Out_File, Z_File_Name); + + Stamp; + + ZLib.Streams.Create + (Stream => File_Z, + Mode => ZLib.Streams.Out_Stream, + Back => ZLib.Streams.Stream_Access + (Stream (File_Back)), + Back_Compressed => True, + Level => Level, + Strategy => Strategy, + Header => Header); + + Copy_Streams + (Source => Stream (File_In).all, + Target => File_Z); + + -- Flushing internal buffers to the back stream. + + ZLib.Streams.Flush (File_Z, ZLib.Finish); + + Print_Statistic ("Write compress", + ZLib.Streams.Write_Total_Out (File_Z)); + + ZLib.Streams.Close (File_Z); + + Close (File_In); + Close (File_Back); + + -- Compare reading from original file and from + -- decompression stream. + + Open (File_In, In_File, In_File_Name); + Open (File_Back, In_File, Z_File_Name); + + ZLib.Streams.Create + (Stream => File_Z, + Mode => ZLib.Streams.In_Stream, + Back => ZLib.Streams.Stream_Access + (Stream (File_Back)), + Back_Compressed => True, + Header => Header); + + Stamp; + Compare_Streams (Stream (File_In).all, File_Z); + + Print_Statistic ("Read decompress", + ZLib.Streams.Read_Total_Out (File_Z)); + + ZLib.Streams.Close (File_Z); + Close (File_In); + Close (File_Back); + + -- Compress by reading from compression stream. + + Open (File_Back, In_File, In_File_Name); + Create (File_Out, Out_File, Z_File_Name); + + ZLib.Streams.Create + (Stream => File_Z, + Mode => ZLib.Streams.In_Stream, + Back => ZLib.Streams.Stream_Access + (Stream (File_Back)), + Back_Compressed => False, + Level => Level, + Strategy => Strategy, + Header => Header); + + Stamp; + Copy_Streams + (Source => File_Z, + Target => Stream (File_Out).all); + + Print_Statistic ("Read compress", + ZLib.Streams.Read_Total_Out (File_Z)); + + ZLib.Streams.Close (File_Z); + + Close (File_Out); + Close (File_Back); + + -- Decompress to decompression stream. + + Open (File_In, In_File, Z_File_Name); + Create (File_Back, Out_File, Out_File_Name); + + ZLib.Streams.Create + (Stream => File_Z, + Mode => ZLib.Streams.Out_Stream, + Back => ZLib.Streams.Stream_Access + (Stream (File_Back)), + Back_Compressed => False, + Header => Header); + + Stamp; + + Copy_Streams + (Source => Stream (File_In).all, + Target => File_Z); + + Print_Statistic ("Write decompress", + ZLib.Streams.Write_Total_Out (File_Z)); + + ZLib.Streams.Close (File_Z); + Close (File_In); + Close (File_Back); + + Compare_Files (In_File_Name, Out_File_Name); + end loop; + + Ada.Text_IO.Put_Line (Count'Image (File_Size) & " Ok."); + + exit when not Continuous; + + File_Size := File_Size + 1; + end loop; +end Test; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.adb new file mode 100644 index 0000000..b6497ba --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.adb @@ -0,0 +1,225 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp $ + +with Ada.Unchecked_Deallocation; + +package body ZLib.Streams is + + ----------- + -- Close -- + ----------- + + procedure Close (Stream : in out Stream_Type) is + procedure Free is new Ada.Unchecked_Deallocation + (Stream_Element_Array, Buffer_Access); + begin + if Stream.Mode = Out_Stream or Stream.Mode = Duplex then + -- We should flush the data written by the writer. + + Flush (Stream, Finish); + + Close (Stream.Writer); + end if; + + if Stream.Mode = In_Stream or Stream.Mode = Duplex then + Close (Stream.Reader); + Free (Stream.Buffer); + end if; + end Close; + + ------------ + -- Create -- + ------------ + + procedure Create + (Stream : out Stream_Type; + Mode : in Stream_Mode; + Back : in Stream_Access; + Back_Compressed : in Boolean; + Level : in Compression_Level := Default_Compression; + Strategy : in Strategy_Type := Default_Strategy; + Header : in Header_Type := Default; + Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size; + Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size) + is + + subtype Buffer_Subtype is Stream_Element_Array (1 .. Read_Buffer_Size); + + procedure Init_Filter + (Filter : in out Filter_Type; + Compress : in Boolean); + + ----------------- + -- Init_Filter -- + ----------------- + + procedure Init_Filter + (Filter : in out Filter_Type; + Compress : in Boolean) is + begin + if Compress then + Deflate_Init + (Filter, Level, Strategy, Header => Header); + else + Inflate_Init (Filter, Header => Header); + end if; + end Init_Filter; + + begin + Stream.Back := Back; + Stream.Mode := Mode; + + if Mode = Out_Stream or Mode = Duplex then + Init_Filter (Stream.Writer, Back_Compressed); + Stream.Buffer_Size := Write_Buffer_Size; + else + Stream.Buffer_Size := 0; + end if; + + if Mode = In_Stream or Mode = Duplex then + Init_Filter (Stream.Reader, not Back_Compressed); + + Stream.Buffer := new Buffer_Subtype; + Stream.Rest_First := Stream.Buffer'Last + 1; + Stream.Rest_Last := Stream.Buffer'Last; + end if; + end Create; + + ----------- + -- Flush -- + ----------- + + procedure Flush + (Stream : in out Stream_Type; + Mode : in Flush_Mode := Sync_Flush) + is + Buffer : Stream_Element_Array (1 .. Stream.Buffer_Size); + Last : Stream_Element_Offset; + begin + loop + Flush (Stream.Writer, Buffer, Last, Mode); + + Ada.Streams.Write (Stream.Back.all, Buffer (1 .. Last)); + + exit when Last < Buffer'Last; + end loop; + end Flush; + + ------------- + -- Is_Open -- + ------------- + + function Is_Open (Stream : Stream_Type) return Boolean is + begin + return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer); + end Is_Open; + + ---------- + -- Read -- + ---------- + + procedure Read + (Stream : in out Stream_Type; + Item : out Stream_Element_Array; + Last : out Stream_Element_Offset) + is + + procedure Read + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset); + + ---------- + -- Read -- + ---------- + + procedure Read + (Item : out Stream_Element_Array; + Last : out Stream_Element_Offset) is + begin + Ada.Streams.Read (Stream.Back.all, Item, Last); + end Read; + + procedure Read is new ZLib.Read + (Read => Read, + Buffer => Stream.Buffer.all, + Rest_First => Stream.Rest_First, + Rest_Last => Stream.Rest_Last); + + begin + Read (Stream.Reader, Item, Last); + end Read; + + ------------------- + -- Read_Total_In -- + ------------------- + + function Read_Total_In (Stream : in Stream_Type) return Count is + begin + return Total_In (Stream.Reader); + end Read_Total_In; + + -------------------- + -- Read_Total_Out -- + -------------------- + + function Read_Total_Out (Stream : in Stream_Type) return Count is + begin + return Total_Out (Stream.Reader); + end Read_Total_Out; + + ----------- + -- Write -- + ----------- + + procedure Write + (Stream : in out Stream_Type; + Item : in Stream_Element_Array) + is + + procedure Write (Item : in Stream_Element_Array); + + ----------- + -- Write -- + ----------- + + procedure Write (Item : in Stream_Element_Array) is + begin + Ada.Streams.Write (Stream.Back.all, Item); + end Write; + + procedure Write is new ZLib.Write + (Write => Write, + Buffer_Size => Stream.Buffer_Size); + + begin + Write (Stream.Writer, Item, No_Flush); + end Write; + + -------------------- + -- Write_Total_In -- + -------------------- + + function Write_Total_In (Stream : in Stream_Type) return Count is + begin + return Total_In (Stream.Writer); + end Write_Total_In; + + --------------------- + -- Write_Total_Out -- + --------------------- + + function Write_Total_Out (Stream : in Stream_Type) return Count is + begin + return Total_Out (Stream.Writer); + end Write_Total_Out; + +end ZLib.Streams; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.ads b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.ads new file mode 100644 index 0000000..f0193c6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-streams.ads @@ -0,0 +1,114 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp $ + +package ZLib.Streams is + + type Stream_Mode is (In_Stream, Out_Stream, Duplex); + + type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; + + type Stream_Type is + new Ada.Streams.Root_Stream_Type with private; + + procedure Read + (Stream : in out Stream_Type; + Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + + procedure Write + (Stream : in out Stream_Type; + Item : in Ada.Streams.Stream_Element_Array); + + procedure Flush + (Stream : in out Stream_Type; + Mode : in Flush_Mode := Sync_Flush); + -- Flush the written data to the back stream, + -- all data placed to the compressor is flushing to the Back stream. + -- Should not be used untill necessary, becouse it is decreasing + -- compression. + + function Read_Total_In (Stream : in Stream_Type) return Count; + pragma Inline (Read_Total_In); + -- Return total number of bytes read from back stream so far. + + function Read_Total_Out (Stream : in Stream_Type) return Count; + pragma Inline (Read_Total_Out); + -- Return total number of bytes read so far. + + function Write_Total_In (Stream : in Stream_Type) return Count; + pragma Inline (Write_Total_In); + -- Return total number of bytes written so far. + + function Write_Total_Out (Stream : in Stream_Type) return Count; + pragma Inline (Write_Total_Out); + -- Return total number of bytes written to the back stream. + + procedure Create + (Stream : out Stream_Type; + Mode : in Stream_Mode; + Back : in Stream_Access; + Back_Compressed : in Boolean; + Level : in Compression_Level := Default_Compression; + Strategy : in Strategy_Type := Default_Strategy; + Header : in Header_Type := Default; + Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size; + Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size); + -- Create the Comression/Decompression stream. + -- If mode is In_Stream then Write operation is disabled. + -- If mode is Out_Stream then Read operation is disabled. + + -- If Back_Compressed is true then + -- Data written to the Stream is compressing to the Back stream + -- and data read from the Stream is decompressed data from the Back stream. + + -- If Back_Compressed is false then + -- Data written to the Stream is decompressing to the Back stream + -- and data read from the Stream is compressed data from the Back stream. + + -- !!! When the Need_Header is False ZLib-Ada is using undocumented + -- ZLib 1.1.4 functionality to do not create/wait for ZLib headers. + + function Is_Open (Stream : Stream_Type) return Boolean; + + procedure Close (Stream : in out Stream_Type); + +private + + use Ada.Streams; + + type Buffer_Access is access all Stream_Element_Array; + + type Stream_Type + is new Root_Stream_Type with + record + Mode : Stream_Mode; + + Buffer : Buffer_Access; + Rest_First : Stream_Element_Offset; + Rest_Last : Stream_Element_Offset; + -- Buffer for Read operation. + -- We need to have this buffer in the record + -- becouse not all read data from back stream + -- could be processed during the read operation. + + Buffer_Size : Stream_Element_Offset; + -- Buffer size for write operation. + -- We do not need to have this buffer + -- in the record becouse all data could be + -- processed in the write operation. + + Back : Stream_Access; + Reader : Filter_Type; + Writer : Filter_Type; + end record; + +end ZLib.Streams; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.adb new file mode 100644 index 0000000..0ca4a71 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.adb @@ -0,0 +1,141 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $ + +package body ZLib.Thin is + + ZLIB_VERSION : constant Chars_Ptr := zlibVersion; + + Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit; + + -------------- + -- Avail_In -- + -------------- + + function Avail_In (Strm : in Z_Stream) return UInt is + begin + return Strm.Avail_In; + end Avail_In; + + --------------- + -- Avail_Out -- + --------------- + + function Avail_Out (Strm : in Z_Stream) return UInt is + begin + return Strm.Avail_Out; + end Avail_Out; + + ------------------ + -- Deflate_Init -- + ------------------ + + function Deflate_Init + (strm : Z_Streamp; + level : Int; + method : Int; + windowBits : Int; + memLevel : Int; + strategy : Int) + return Int is + begin + return deflateInit2 + (strm, + level, + method, + windowBits, + memLevel, + strategy, + ZLIB_VERSION, + Z_Stream_Size); + end Deflate_Init; + + ------------------ + -- Inflate_Init -- + ------------------ + + function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is + begin + return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size); + end Inflate_Init; + + ------------------------ + -- Last_Error_Message -- + ------------------------ + + function Last_Error_Message (Strm : in Z_Stream) return String is + use Interfaces.C.Strings; + begin + if Strm.msg = Null_Ptr then + return ""; + else + return Value (Strm.msg); + end if; + end Last_Error_Message; + + ------------ + -- Set_In -- + ------------ + + procedure Set_In + (Strm : in out Z_Stream; + Buffer : in Voidp; + Size : in UInt) is + begin + Strm.Next_In := Buffer; + Strm.Avail_In := Size; + end Set_In; + + ------------------ + -- Set_Mem_Func -- + ------------------ + + procedure Set_Mem_Func + (Strm : in out Z_Stream; + Opaque : in Voidp; + Alloc : in alloc_func; + Free : in free_func) is + begin + Strm.opaque := Opaque; + Strm.zalloc := Alloc; + Strm.zfree := Free; + end Set_Mem_Func; + + ------------- + -- Set_Out -- + ------------- + + procedure Set_Out + (Strm : in out Z_Stream; + Buffer : in Voidp; + Size : in UInt) is + begin + Strm.Next_Out := Buffer; + Strm.Avail_Out := Size; + end Set_Out; + + -------------- + -- Total_In -- + -------------- + + function Total_In (Strm : in Z_Stream) return ULong is + begin + return Strm.Total_In; + end Total_In; + + --------------- + -- Total_Out -- + --------------- + + function Total_Out (Strm : in Z_Stream) return ULong is + begin + return Strm.Total_Out; + end Total_Out; + +end ZLib.Thin; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.ads b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.ads new file mode 100644 index 0000000..d4407eb --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib-thin.ads @@ -0,0 +1,450 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2003 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $ + +with Interfaces.C.Strings; + +with System; + +private package ZLib.Thin is + + -- From zconf.h + + MAX_MEM_LEVEL : constant := 9; -- zconf.h:105 + -- zconf.h:105 + MAX_WBITS : constant := 15; -- zconf.h:115 + -- 32K LZ77 window + -- zconf.h:115 + SEEK_SET : constant := 8#0000#; -- zconf.h:244 + -- Seek from beginning of file. + -- zconf.h:244 + SEEK_CUR : constant := 1; -- zconf.h:245 + -- Seek from current position. + -- zconf.h:245 + SEEK_END : constant := 2; -- zconf.h:246 + -- Set file pointer to EOF plus "offset" + -- zconf.h:246 + + type Byte is new Interfaces.C.unsigned_char; -- 8 bits + -- zconf.h:214 + type UInt is new Interfaces.C.unsigned; -- 16 bits or more + -- zconf.h:216 + type Int is new Interfaces.C.int; + + type ULong is new Interfaces.C.unsigned_long; -- 32 bits or more + -- zconf.h:217 + subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr; + + type ULong_Access is access ULong; + type Int_Access is access Int; + + subtype Voidp is System.Address; -- zconf.h:232 + + subtype Byte_Access is Voidp; + + Nul : constant Voidp := System.Null_Address; + -- end from zconf + + Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125 + -- zlib.h:125 + Z_PARTIAL_FLUSH : constant := 1; -- zlib.h:126 + -- will be removed, use + -- Z_SYNC_FLUSH instead + -- zlib.h:126 + Z_SYNC_FLUSH : constant := 2; -- zlib.h:127 + -- zlib.h:127 + Z_FULL_FLUSH : constant := 3; -- zlib.h:128 + -- zlib.h:128 + Z_FINISH : constant := 4; -- zlib.h:129 + -- zlib.h:129 + Z_OK : constant := 8#0000#; -- zlib.h:132 + -- zlib.h:132 + Z_STREAM_END : constant := 1; -- zlib.h:133 + -- zlib.h:133 + Z_NEED_DICT : constant := 2; -- zlib.h:134 + -- zlib.h:134 + Z_ERRNO : constant := -1; -- zlib.h:135 + -- zlib.h:135 + Z_STREAM_ERROR : constant := -2; -- zlib.h:136 + -- zlib.h:136 + Z_DATA_ERROR : constant := -3; -- zlib.h:137 + -- zlib.h:137 + Z_MEM_ERROR : constant := -4; -- zlib.h:138 + -- zlib.h:138 + Z_BUF_ERROR : constant := -5; -- zlib.h:139 + -- zlib.h:139 + Z_VERSION_ERROR : constant := -6; -- zlib.h:140 + -- zlib.h:140 + Z_NO_COMPRESSION : constant := 8#0000#; -- zlib.h:145 + -- zlib.h:145 + Z_BEST_SPEED : constant := 1; -- zlib.h:146 + -- zlib.h:146 + Z_BEST_COMPRESSION : constant := 9; -- zlib.h:147 + -- zlib.h:147 + Z_DEFAULT_COMPRESSION : constant := -1; -- zlib.h:148 + -- zlib.h:148 + Z_FILTERED : constant := 1; -- zlib.h:151 + -- zlib.h:151 + Z_HUFFMAN_ONLY : constant := 2; -- zlib.h:152 + -- zlib.h:152 + Z_DEFAULT_STRATEGY : constant := 8#0000#; -- zlib.h:153 + -- zlib.h:153 + Z_BINARY : constant := 8#0000#; -- zlib.h:156 + -- zlib.h:156 + Z_ASCII : constant := 1; -- zlib.h:157 + -- zlib.h:157 + Z_UNKNOWN : constant := 2; -- zlib.h:158 + -- zlib.h:158 + Z_DEFLATED : constant := 8; -- zlib.h:161 + -- zlib.h:161 + Z_NULL : constant := 8#0000#; -- zlib.h:164 + -- for initializing zalloc, zfree, opaque + -- zlib.h:164 + type gzFile is new Voidp; -- zlib.h:646 + + type Z_Stream is private; + + type Z_Streamp is access all Z_Stream; -- zlib.h:89 + + type alloc_func is access function + (Opaque : Voidp; + Items : UInt; + Size : UInt) + return Voidp; -- zlib.h:63 + + type free_func is access procedure (opaque : Voidp; address : Voidp); + + function zlibVersion return Chars_Ptr; + + function Deflate (strm : Z_Streamp; flush : Int) return Int; + + function DeflateEnd (strm : Z_Streamp) return Int; + + function Inflate (strm : Z_Streamp; flush : Int) return Int; + + function InflateEnd (strm : Z_Streamp) return Int; + + function deflateSetDictionary + (strm : Z_Streamp; + dictionary : Byte_Access; + dictLength : UInt) + return Int; + + function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int; + -- zlib.h:478 + + function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495 + + function deflateParams + (strm : Z_Streamp; + level : Int; + strategy : Int) + return Int; -- zlib.h:506 + + function inflateSetDictionary + (strm : Z_Streamp; + dictionary : Byte_Access; + dictLength : UInt) + return Int; -- zlib.h:548 + + function inflateSync (strm : Z_Streamp) return Int; -- zlib.h:565 + + function inflateReset (strm : Z_Streamp) return Int; -- zlib.h:580 + + function compress + (dest : Byte_Access; + destLen : ULong_Access; + source : Byte_Access; + sourceLen : ULong) + return Int; -- zlib.h:601 + + function compress2 + (dest : Byte_Access; + destLen : ULong_Access; + source : Byte_Access; + sourceLen : ULong; + level : Int) + return Int; -- zlib.h:615 + + function uncompress + (dest : Byte_Access; + destLen : ULong_Access; + source : Byte_Access; + sourceLen : ULong) + return Int; + + function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile; + + function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile; + + function gzsetparams + (file : gzFile; + level : Int; + strategy : Int) + return Int; + + function gzread + (file : gzFile; + buf : Voidp; + len : UInt) + return Int; + + function gzwrite + (file : in gzFile; + buf : in Voidp; + len : in UInt) + return Int; + + function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int; + + function gzputs (file : in gzFile; s : in Chars_Ptr) return Int; + + function gzgets + (file : gzFile; + buf : Chars_Ptr; + len : Int) + return Chars_Ptr; + + function gzputc (file : gzFile; char : Int) return Int; + + function gzgetc (file : gzFile) return Int; + + function gzflush (file : gzFile; flush : Int) return Int; + + function gzseek + (file : gzFile; + offset : Int; + whence : Int) + return Int; + + function gzrewind (file : gzFile) return Int; + + function gztell (file : gzFile) return Int; + + function gzeof (file : gzFile) return Int; + + function gzclose (file : gzFile) return Int; + + function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr; + + function adler32 + (adler : ULong; + buf : Byte_Access; + len : UInt) + return ULong; + + function crc32 + (crc : ULong; + buf : Byte_Access; + len : UInt) + return ULong; + + function deflateInit + (strm : Z_Streamp; + level : Int; + version : Chars_Ptr; + stream_size : Int) + return Int; + + function deflateInit2 + (strm : Z_Streamp; + level : Int; + method : Int; + windowBits : Int; + memLevel : Int; + strategy : Int; + version : Chars_Ptr; + stream_size : Int) + return Int; + + function Deflate_Init + (strm : Z_Streamp; + level : Int; + method : Int; + windowBits : Int; + memLevel : Int; + strategy : Int) + return Int; + pragma Inline (Deflate_Init); + + function inflateInit + (strm : Z_Streamp; + version : Chars_Ptr; + stream_size : Int) + return Int; + + function inflateInit2 + (strm : in Z_Streamp; + windowBits : in Int; + version : in Chars_Ptr; + stream_size : in Int) + return Int; + + function inflateBackInit + (strm : in Z_Streamp; + windowBits : in Int; + window : in Byte_Access; + version : in Chars_Ptr; + stream_size : in Int) + return Int; + -- Size of window have to be 2**windowBits. + + function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int; + pragma Inline (Inflate_Init); + + function zError (err : Int) return Chars_Ptr; + + function inflateSyncPoint (z : Z_Streamp) return Int; + + function get_crc_table return ULong_Access; + + -- Interface to the available fields of the z_stream structure. + -- The application must update next_in and avail_in when avail_in has + -- dropped to zero. It must update next_out and avail_out when avail_out + -- has dropped to zero. The application must initialize zalloc, zfree and + -- opaque before calling the init function. + + procedure Set_In + (Strm : in out Z_Stream; + Buffer : in Voidp; + Size : in UInt); + pragma Inline (Set_In); + + procedure Set_Out + (Strm : in out Z_Stream; + Buffer : in Voidp; + Size : in UInt); + pragma Inline (Set_Out); + + procedure Set_Mem_Func + (Strm : in out Z_Stream; + Opaque : in Voidp; + Alloc : in alloc_func; + Free : in free_func); + pragma Inline (Set_Mem_Func); + + function Last_Error_Message (Strm : in Z_Stream) return String; + pragma Inline (Last_Error_Message); + + function Avail_Out (Strm : in Z_Stream) return UInt; + pragma Inline (Avail_Out); + + function Avail_In (Strm : in Z_Stream) return UInt; + pragma Inline (Avail_In); + + function Total_In (Strm : in Z_Stream) return ULong; + pragma Inline (Total_In); + + function Total_Out (Strm : in Z_Stream) return ULong; + pragma Inline (Total_Out); + + function inflateCopy + (dest : in Z_Streamp; + Source : in Z_Streamp) + return Int; + + function compressBound (Source_Len : in ULong) return ULong; + + function deflateBound + (Strm : in Z_Streamp; + Source_Len : in ULong) + return ULong; + + function gzungetc (C : in Int; File : in gzFile) return Int; + + function zlibCompileFlags return ULong; + +private + + type Z_Stream is record -- zlib.h:68 + Next_In : Voidp := Nul; -- next input byte + Avail_In : UInt := 0; -- number of bytes available at next_in + Total_In : ULong := 0; -- total nb of input bytes read so far + Next_Out : Voidp := Nul; -- next output byte should be put there + Avail_Out : UInt := 0; -- remaining free space at next_out + Total_Out : ULong := 0; -- total nb of bytes output so far + msg : Chars_Ptr; -- last error message, NULL if no error + state : Voidp; -- not visible by applications + zalloc : alloc_func := null; -- used to allocate the internal state + zfree : free_func := null; -- used to free the internal state + opaque : Voidp; -- private data object passed to + -- zalloc and zfree + data_type : Int; -- best guess about the data type: + -- ascii or binary + adler : ULong; -- adler32 value of the uncompressed + -- data + reserved : ULong; -- reserved for future use + end record; + + pragma Convention (C, Z_Stream); + + pragma Import (C, zlibVersion, "zlibVersion"); + pragma Import (C, Deflate, "deflate"); + pragma Import (C, DeflateEnd, "deflateEnd"); + pragma Import (C, Inflate, "inflate"); + pragma Import (C, InflateEnd, "inflateEnd"); + pragma Import (C, deflateSetDictionary, "deflateSetDictionary"); + pragma Import (C, deflateCopy, "deflateCopy"); + pragma Import (C, deflateReset, "deflateReset"); + pragma Import (C, deflateParams, "deflateParams"); + pragma Import (C, inflateSetDictionary, "inflateSetDictionary"); + pragma Import (C, inflateSync, "inflateSync"); + pragma Import (C, inflateReset, "inflateReset"); + pragma Import (C, compress, "compress"); + pragma Import (C, compress2, "compress2"); + pragma Import (C, uncompress, "uncompress"); + pragma Import (C, gzopen, "gzopen"); + pragma Import (C, gzdopen, "gzdopen"); + pragma Import (C, gzsetparams, "gzsetparams"); + pragma Import (C, gzread, "gzread"); + pragma Import (C, gzwrite, "gzwrite"); + pragma Import (C, gzprintf, "gzprintf"); + pragma Import (C, gzputs, "gzputs"); + pragma Import (C, gzgets, "gzgets"); + pragma Import (C, gzputc, "gzputc"); + pragma Import (C, gzgetc, "gzgetc"); + pragma Import (C, gzflush, "gzflush"); + pragma Import (C, gzseek, "gzseek"); + pragma Import (C, gzrewind, "gzrewind"); + pragma Import (C, gztell, "gztell"); + pragma Import (C, gzeof, "gzeof"); + pragma Import (C, gzclose, "gzclose"); + pragma Import (C, gzerror, "gzerror"); + pragma Import (C, adler32, "adler32"); + pragma Import (C, crc32, "crc32"); + pragma Import (C, deflateInit, "deflateInit_"); + pragma Import (C, inflateInit, "inflateInit_"); + pragma Import (C, deflateInit2, "deflateInit2_"); + pragma Import (C, inflateInit2, "inflateInit2_"); + pragma Import (C, zError, "zError"); + pragma Import (C, inflateSyncPoint, "inflateSyncPoint"); + pragma Import (C, get_crc_table, "get_crc_table"); + + -- since zlib 1.2.0: + + pragma Import (C, inflateCopy, "inflateCopy"); + pragma Import (C, compressBound, "compressBound"); + pragma Import (C, deflateBound, "deflateBound"); + pragma Import (C, gzungetc, "gzungetc"); + pragma Import (C, zlibCompileFlags, "zlibCompileFlags"); + + pragma Import (C, inflateBackInit, "inflateBackInit_"); + + -- I stopped binding the inflateBack routines, becouse realize that + -- it does not support zlib and gzip headers for now, and have no + -- symmetric deflateBack routines. + -- ZLib-Ada is symmetric regarding deflate/inflate data transformation + -- and has a similar generic callback interface for the + -- deflate/inflate transformation based on the regular Deflate/Inflate + -- routines. + + -- pragma Import (C, inflateBack, "inflateBack"); + -- pragma Import (C, inflateBackEnd, "inflateBackEnd"); + +end ZLib.Thin; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.adb b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.adb new file mode 100644 index 0000000..8b6fd68 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.adb @@ -0,0 +1,701 @@ +---------------------------------------------------------------- +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2004 Dmitriy Anisimkov -- +-- -- +-- Open source license information is in the zlib.ads file. -- +---------------------------------------------------------------- + +-- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $ + +with Ada.Exceptions; +with Ada.Unchecked_Conversion; +with Ada.Unchecked_Deallocation; + +with Interfaces.C.Strings; + +with ZLib.Thin; + +package body ZLib is + + use type Thin.Int; + + type Z_Stream is new Thin.Z_Stream; + + type Return_Code_Enum is + (OK, + STREAM_END, + NEED_DICT, + ERRNO, + STREAM_ERROR, + DATA_ERROR, + MEM_ERROR, + BUF_ERROR, + VERSION_ERROR); + + type Flate_Step_Function is access + function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int; + pragma Convention (C, Flate_Step_Function); + + type Flate_End_Function is access + function (Ctrm : in Thin.Z_Streamp) return Thin.Int; + pragma Convention (C, Flate_End_Function); + + type Flate_Type is record + Step : Flate_Step_Function; + Done : Flate_End_Function; + end record; + + subtype Footer_Array is Stream_Element_Array (1 .. 8); + + Simple_GZip_Header : constant Stream_Element_Array (1 .. 10) + := (16#1f#, 16#8b#, -- Magic header + 16#08#, -- Z_DEFLATED + 16#00#, -- Flags + 16#00#, 16#00#, 16#00#, 16#00#, -- Time + 16#00#, -- XFlags + 16#03# -- OS code + ); + -- The simplest gzip header is not for informational, but just for + -- gzip format compatibility. + -- Note that some code below is using assumption + -- Simple_GZip_Header'Last > Footer_Array'Last, so do not make + -- Simple_GZip_Header'Last <= Footer_Array'Last. + + Return_Code : constant array (Thin.Int range <>) of Return_Code_Enum + := (0 => OK, + 1 => STREAM_END, + 2 => NEED_DICT, + -1 => ERRNO, + -2 => STREAM_ERROR, + -3 => DATA_ERROR, + -4 => MEM_ERROR, + -5 => BUF_ERROR, + -6 => VERSION_ERROR); + + Flate : constant array (Boolean) of Flate_Type + := (True => (Step => Thin.Deflate'Access, + Done => Thin.DeflateEnd'Access), + False => (Step => Thin.Inflate'Access, + Done => Thin.InflateEnd'Access)); + + Flush_Finish : constant array (Boolean) of Flush_Mode + := (True => Finish, False => No_Flush); + + procedure Raise_Error (Stream : in Z_Stream); + pragma Inline (Raise_Error); + + procedure Raise_Error (Message : in String); + pragma Inline (Raise_Error); + + procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int); + + procedure Free is new Ada.Unchecked_Deallocation + (Z_Stream, Z_Stream_Access); + + function To_Thin_Access is new Ada.Unchecked_Conversion + (Z_Stream_Access, Thin.Z_Streamp); + + procedure Translate_GZip + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + -- Separate translate routine for make gzip header. + + procedure Translate_Auto + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + -- translate routine without additional headers. + + ----------------- + -- Check_Error -- + ----------------- + + procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is + use type Thin.Int; + begin + if Code /= Thin.Z_OK then + Raise_Error + (Return_Code_Enum'Image (Return_Code (Code)) + & ": " & Last_Error_Message (Stream)); + end if; + end Check_Error; + + ----------- + -- Close -- + ----------- + + procedure Close + (Filter : in out Filter_Type; + Ignore_Error : in Boolean := False) + is + Code : Thin.Int; + begin + if not Ignore_Error and then not Is_Open (Filter) then + raise Status_Error; + end if; + + Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm)); + + if Ignore_Error or else Code = Thin.Z_OK then + Free (Filter.Strm); + else + declare + Error_Message : constant String + := Last_Error_Message (Filter.Strm.all); + begin + Free (Filter.Strm); + Ada.Exceptions.Raise_Exception + (ZLib_Error'Identity, + Return_Code_Enum'Image (Return_Code (Code)) + & ": " & Error_Message); + end; + end if; + end Close; + + ----------- + -- CRC32 -- + ----------- + + function CRC32 + (CRC : in Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array) + return Unsigned_32 + is + use Thin; + begin + return Unsigned_32 (crc32 (ULong (CRC), + Data'Address, + Data'Length)); + end CRC32; + + procedure CRC32 + (CRC : in out Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array) is + begin + CRC := CRC32 (CRC, Data); + end CRC32; + + ------------------ + -- Deflate_Init -- + ------------------ + + procedure Deflate_Init + (Filter : in out Filter_Type; + Level : in Compression_Level := Default_Compression; + Strategy : in Strategy_Type := Default_Strategy; + Method : in Compression_Method := Deflated; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Memory_Level : in Memory_Level_Type := Default_Memory_Level; + Header : in Header_Type := Default) + is + use type Thin.Int; + Win_Bits : Thin.Int := Thin.Int (Window_Bits); + begin + if Is_Open (Filter) then + raise Status_Error; + end if; + + -- We allow ZLib to make header only in case of default header type. + -- Otherwise we would either do header by ourselfs, or do not do + -- header at all. + + if Header = None or else Header = GZip then + Win_Bits := -Win_Bits; + end if; + + -- For the GZip CRC calculation and make headers. + + if Header = GZip then + Filter.CRC := 0; + Filter.Offset := Simple_GZip_Header'First; + else + Filter.Offset := Simple_GZip_Header'Last + 1; + end if; + + Filter.Strm := new Z_Stream; + Filter.Compression := True; + Filter.Stream_End := False; + Filter.Header := Header; + + if Thin.Deflate_Init + (To_Thin_Access (Filter.Strm), + Level => Thin.Int (Level), + method => Thin.Int (Method), + windowBits => Win_Bits, + memLevel => Thin.Int (Memory_Level), + strategy => Thin.Int (Strategy)) /= Thin.Z_OK + then + Raise_Error (Filter.Strm.all); + end if; + end Deflate_Init; + + ----------- + -- Flush -- + ----------- + + procedure Flush + (Filter : in out Filter_Type; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode) + is + No_Data : Stream_Element_Array := (1 .. 0 => 0); + Last : Stream_Element_Offset; + begin + Translate (Filter, No_Data, Last, Out_Data, Out_Last, Flush); + end Flush; + + ----------------------- + -- Generic_Translate -- + ----------------------- + + procedure Generic_Translate + (Filter : in out ZLib.Filter_Type; + In_Buffer_Size : in Integer := Default_Buffer_Size; + Out_Buffer_Size : in Integer := Default_Buffer_Size) + is + In_Buffer : Stream_Element_Array + (1 .. Stream_Element_Offset (In_Buffer_Size)); + Out_Buffer : Stream_Element_Array + (1 .. Stream_Element_Offset (Out_Buffer_Size)); + Last : Stream_Element_Offset; + In_Last : Stream_Element_Offset; + In_First : Stream_Element_Offset; + Out_Last : Stream_Element_Offset; + begin + Main : loop + Data_In (In_Buffer, Last); + + In_First := In_Buffer'First; + + loop + Translate + (Filter => Filter, + In_Data => In_Buffer (In_First .. Last), + In_Last => In_Last, + Out_Data => Out_Buffer, + Out_Last => Out_Last, + Flush => Flush_Finish (Last < In_Buffer'First)); + + if Out_Buffer'First <= Out_Last then + Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last)); + end if; + + exit Main when Stream_End (Filter); + + -- The end of in buffer. + + exit when In_Last = Last; + + In_First := In_Last + 1; + end loop; + end loop Main; + + end Generic_Translate; + + ------------------ + -- Inflate_Init -- + ------------------ + + procedure Inflate_Init + (Filter : in out Filter_Type; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Header : in Header_Type := Default) + is + use type Thin.Int; + Win_Bits : Thin.Int := Thin.Int (Window_Bits); + + procedure Check_Version; + -- Check the latest header types compatibility. + + procedure Check_Version is + begin + if Version <= "1.1.4" then + Raise_Error + ("Inflate header type " & Header_Type'Image (Header) + & " incompatible with ZLib version " & Version); + end if; + end Check_Version; + + begin + if Is_Open (Filter) then + raise Status_Error; + end if; + + case Header is + when None => + Check_Version; + + -- Inflate data without headers determined + -- by negative Win_Bits. + + Win_Bits := -Win_Bits; + when GZip => + Check_Version; + + -- Inflate gzip data defined by flag 16. + + Win_Bits := Win_Bits + 16; + when Auto => + Check_Version; + + -- Inflate with automatic detection + -- of gzip or native header defined by flag 32. + + Win_Bits := Win_Bits + 32; + when Default => null; + end case; + + Filter.Strm := new Z_Stream; + Filter.Compression := False; + Filter.Stream_End := False; + Filter.Header := Header; + + if Thin.Inflate_Init + (To_Thin_Access (Filter.Strm), Win_Bits) /= Thin.Z_OK + then + Raise_Error (Filter.Strm.all); + end if; + end Inflate_Init; + + ------------- + -- Is_Open -- + ------------- + + function Is_Open (Filter : in Filter_Type) return Boolean is + begin + return Filter.Strm /= null; + end Is_Open; + + ----------------- + -- Raise_Error -- + ----------------- + + procedure Raise_Error (Message : in String) is + begin + Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message); + end Raise_Error; + + procedure Raise_Error (Stream : in Z_Stream) is + begin + Raise_Error (Last_Error_Message (Stream)); + end Raise_Error; + + ---------- + -- Read -- + ---------- + + procedure Read + (Filter : in out Filter_Type; + Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode := No_Flush) + is + In_Last : Stream_Element_Offset; + Item_First : Ada.Streams.Stream_Element_Offset := Item'First; + V_Flush : Flush_Mode := Flush; + + begin + pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1); + pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last); + + loop + if Rest_Last = Buffer'First - 1 then + V_Flush := Finish; + + elsif Rest_First > Rest_Last then + Read (Buffer, Rest_Last); + Rest_First := Buffer'First; + + if Rest_Last < Buffer'First then + V_Flush := Finish; + end if; + end if; + + Translate + (Filter => Filter, + In_Data => Buffer (Rest_First .. Rest_Last), + In_Last => In_Last, + Out_Data => Item (Item_First .. Item'Last), + Out_Last => Last, + Flush => V_Flush); + + Rest_First := In_Last + 1; + + exit when Stream_End (Filter) + or else Last = Item'Last + or else (Last >= Item'First and then Allow_Read_Some); + + Item_First := Last + 1; + end loop; + end Read; + + ---------------- + -- Stream_End -- + ---------------- + + function Stream_End (Filter : in Filter_Type) return Boolean is + begin + if Filter.Header = GZip and Filter.Compression then + return Filter.Stream_End + and then Filter.Offset = Footer_Array'Last + 1; + else + return Filter.Stream_End; + end if; + end Stream_End; + + -------------- + -- Total_In -- + -------------- + + function Total_In (Filter : in Filter_Type) return Count is + begin + return Count (Thin.Total_In (To_Thin_Access (Filter.Strm).all)); + end Total_In; + + --------------- + -- Total_Out -- + --------------- + + function Total_Out (Filter : in Filter_Type) return Count is + begin + return Count (Thin.Total_Out (To_Thin_Access (Filter.Strm).all)); + end Total_Out; + + --------------- + -- Translate -- + --------------- + + procedure Translate + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode) is + begin + if Filter.Header = GZip and then Filter.Compression then + Translate_GZip + (Filter => Filter, + In_Data => In_Data, + In_Last => In_Last, + Out_Data => Out_Data, + Out_Last => Out_Last, + Flush => Flush); + else + Translate_Auto + (Filter => Filter, + In_Data => In_Data, + In_Last => In_Last, + Out_Data => Out_Data, + Out_Last => Out_Last, + Flush => Flush); + end if; + end Translate; + + -------------------- + -- Translate_Auto -- + -------------------- + + procedure Translate_Auto + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode) + is + use type Thin.Int; + Code : Thin.Int; + + begin + if not Is_Open (Filter) then + raise Status_Error; + end if; + + if Out_Data'Length = 0 and then In_Data'Length = 0 then + raise Constraint_Error; + end if; + + Set_Out (Filter.Strm.all, Out_Data'Address, Out_Data'Length); + Set_In (Filter.Strm.all, In_Data'Address, In_Data'Length); + + Code := Flate (Filter.Compression).Step + (To_Thin_Access (Filter.Strm), + Thin.Int (Flush)); + + if Code = Thin.Z_STREAM_END then + Filter.Stream_End := True; + else + Check_Error (Filter.Strm.all, Code); + end if; + + In_Last := In_Data'Last + - Stream_Element_Offset (Avail_In (Filter.Strm.all)); + Out_Last := Out_Data'Last + - Stream_Element_Offset (Avail_Out (Filter.Strm.all)); + end Translate_Auto; + + -------------------- + -- Translate_GZip -- + -------------------- + + procedure Translate_GZip + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode) + is + Out_First : Stream_Element_Offset; + + procedure Add_Data (Data : in Stream_Element_Array); + -- Add data to stream from the Filter.Offset till necessary, + -- used for add gzip headr/footer. + + procedure Put_32 + (Item : in out Stream_Element_Array; + Data : in Unsigned_32); + pragma Inline (Put_32); + + -------------- + -- Add_Data -- + -------------- + + procedure Add_Data (Data : in Stream_Element_Array) is + Data_First : Stream_Element_Offset renames Filter.Offset; + Data_Last : Stream_Element_Offset; + Data_Len : Stream_Element_Offset; -- -1 + Out_Len : Stream_Element_Offset; -- -1 + begin + Out_First := Out_Last + 1; + + if Data_First > Data'Last then + return; + end if; + + Data_Len := Data'Last - Data_First; + Out_Len := Out_Data'Last - Out_First; + + if Data_Len <= Out_Len then + Out_Last := Out_First + Data_Len; + Data_Last := Data'Last; + else + Out_Last := Out_Data'Last; + Data_Last := Data_First + Out_Len; + end if; + + Out_Data (Out_First .. Out_Last) := Data (Data_First .. Data_Last); + + Data_First := Data_Last + 1; + Out_First := Out_Last + 1; + end Add_Data; + + ------------ + -- Put_32 -- + ------------ + + procedure Put_32 + (Item : in out Stream_Element_Array; + Data : in Unsigned_32) + is + D : Unsigned_32 := Data; + begin + for J in Item'First .. Item'First + 3 loop + Item (J) := Stream_Element (D and 16#FF#); + D := Shift_Right (D, 8); + end loop; + end Put_32; + + begin + Out_Last := Out_Data'First - 1; + + if not Filter.Stream_End then + Add_Data (Simple_GZip_Header); + + Translate_Auto + (Filter => Filter, + In_Data => In_Data, + In_Last => In_Last, + Out_Data => Out_Data (Out_First .. Out_Data'Last), + Out_Last => Out_Last, + Flush => Flush); + + CRC32 (Filter.CRC, In_Data (In_Data'First .. In_Last)); + end if; + + if Filter.Stream_End and then Out_Last <= Out_Data'Last then + -- This detection method would work only when + -- Simple_GZip_Header'Last > Footer_Array'Last + + if Filter.Offset = Simple_GZip_Header'Last + 1 then + Filter.Offset := Footer_Array'First; + end if; + + declare + Footer : Footer_Array; + begin + Put_32 (Footer, Filter.CRC); + Put_32 (Footer (Footer'First + 4 .. Footer'Last), + Unsigned_32 (Total_In (Filter))); + Add_Data (Footer); + end; + end if; + end Translate_GZip; + + ------------- + -- Version -- + ------------- + + function Version return String is + begin + return Interfaces.C.Strings.Value (Thin.zlibVersion); + end Version; + + ----------- + -- Write -- + ----------- + + procedure Write + (Filter : in out Filter_Type; + Item : in Ada.Streams.Stream_Element_Array; + Flush : in Flush_Mode := No_Flush) + is + Buffer : Stream_Element_Array (1 .. Buffer_Size); + In_Last : Stream_Element_Offset; + Out_Last : Stream_Element_Offset; + In_First : Stream_Element_Offset := Item'First; + begin + if Item'Length = 0 and Flush = No_Flush then + return; + end if; + + loop + Translate + (Filter => Filter, + In_Data => Item (In_First .. Item'Last), + In_Last => In_Last, + Out_Data => Buffer, + Out_Last => Out_Last, + Flush => Flush); + + if Out_Last >= Buffer'First then + Write (Buffer (1 .. Out_Last)); + end if; + + exit when In_Last = Item'Last or Stream_End (Filter); + + In_First := In_Last + 1; + end loop; + end Write; + +end ZLib; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.ads b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.ads new file mode 100644 index 0000000..79ffc40 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.ads @@ -0,0 +1,328 @@ +------------------------------------------------------------------------------ +-- ZLib for Ada thick binding. -- +-- -- +-- Copyright (C) 2002-2004 Dmitriy Anisimkov -- +-- -- +-- This library is free software; you can redistribute it and/or modify -- +-- it under the terms of the GNU General Public License as published by -- +-- the Free Software Foundation; either version 2 of the License, or (at -- +-- your option) any later version. -- +-- -- +-- This library 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 library; if not, write to the Free Software Foundation, -- +-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +------------------------------------------------------------------------------ + +-- $Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp $ + +with Ada.Streams; + +with Interfaces; + +package ZLib is + + ZLib_Error : exception; + Status_Error : exception; + + type Compression_Level is new Integer range -1 .. 9; + + type Flush_Mode is private; + + type Compression_Method is private; + + type Window_Bits_Type is new Integer range 8 .. 15; + + type Memory_Level_Type is new Integer range 1 .. 9; + + type Unsigned_32 is new Interfaces.Unsigned_32; + + type Strategy_Type is private; + + type Header_Type is (None, Auto, Default, GZip); + -- Header type usage have a some limitation for inflate. + -- See comment for Inflate_Init. + + subtype Count is Ada.Streams.Stream_Element_Count; + + Default_Memory_Level : constant Memory_Level_Type := 8; + Default_Window_Bits : constant Window_Bits_Type := 15; + + ---------------------------------- + -- Compression method constants -- + ---------------------------------- + + Deflated : constant Compression_Method; + -- Only one method allowed in this ZLib version + + --------------------------------- + -- Compression level constants -- + --------------------------------- + + No_Compression : constant Compression_Level := 0; + Best_Speed : constant Compression_Level := 1; + Best_Compression : constant Compression_Level := 9; + Default_Compression : constant Compression_Level := -1; + + -------------------------- + -- Flush mode constants -- + -------------------------- + + No_Flush : constant Flush_Mode; + -- Regular way for compression, no flush + + Partial_Flush : constant Flush_Mode; + -- Will be removed, use Z_SYNC_FLUSH instead + + Sync_Flush : constant Flush_Mode; + -- All pending output is flushed to the output buffer and the output + -- is aligned on a byte boundary, so that the decompressor can get all + -- input data available so far. (In particular avail_in is zero after the + -- call if enough output space has been provided before the call.) + -- Flushing may degrade compression for some compression algorithms and so + -- it should be used only when necessary. + + Block_Flush : constant Flush_Mode; + -- Z_BLOCK requests that inflate() stop + -- if and when it get to the next deflate block boundary. When decoding the + -- zlib or gzip format, this will cause inflate() to return immediately + -- after the header and before the first block. When doing a raw inflate, + -- inflate() will go ahead and process the first block, and will return + -- when it gets to the end of that block, or when it runs out of data. + + Full_Flush : constant Flush_Mode; + -- All output is flushed as with SYNC_FLUSH, and the compression state + -- is reset so that decompression can restart from this point if previous + -- compressed data has been damaged or if random access is desired. Using + -- Full_Flush too often can seriously degrade the compression. + + Finish : constant Flush_Mode; + -- Just for tell the compressor that input data is complete. + + ------------------------------------ + -- Compression strategy constants -- + ------------------------------------ + + -- RLE stategy could be used only in version 1.2.0 and later. + + Filtered : constant Strategy_Type; + Huffman_Only : constant Strategy_Type; + RLE : constant Strategy_Type; + Default_Strategy : constant Strategy_Type; + + Default_Buffer_Size : constant := 4096; + + type Filter_Type is tagged limited private; + -- The filter is for compression and for decompression. + -- The usage of the type is depend of its initialization. + + function Version return String; + pragma Inline (Version); + -- Return string representation of the ZLib version. + + procedure Deflate_Init + (Filter : in out Filter_Type; + Level : in Compression_Level := Default_Compression; + Strategy : in Strategy_Type := Default_Strategy; + Method : in Compression_Method := Deflated; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Memory_Level : in Memory_Level_Type := Default_Memory_Level; + Header : in Header_Type := Default); + -- Compressor initialization. + -- When Header parameter is Auto or Default, then default zlib header + -- would be provided for compressed data. + -- When Header is GZip, then gzip header would be set instead of + -- default header. + -- When Header is None, no header would be set for compressed data. + + procedure Inflate_Init + (Filter : in out Filter_Type; + Window_Bits : in Window_Bits_Type := Default_Window_Bits; + Header : in Header_Type := Default); + -- Decompressor initialization. + -- Default header type mean that ZLib default header is expecting in the + -- input compressed stream. + -- Header type None mean that no header is expecting in the input stream. + -- GZip header type mean that GZip header is expecting in the + -- input compressed stream. + -- Auto header type mean that header type (GZip or Native) would be + -- detected automatically in the input stream. + -- Note that header types parameter values None, GZip and Auto are + -- supported for inflate routine only in ZLib versions 1.2.0.2 and later. + -- Deflate_Init is supporting all header types. + + function Is_Open (Filter : in Filter_Type) return Boolean; + pragma Inline (Is_Open); + -- Is the filter opened for compression or decompression. + + procedure Close + (Filter : in out Filter_Type; + Ignore_Error : in Boolean := False); + -- Closing the compression or decompressor. + -- If stream is closing before the complete and Ignore_Error is False, + -- The exception would be raised. + + generic + with procedure Data_In + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + with procedure Data_Out + (Item : in Ada.Streams.Stream_Element_Array); + procedure Generic_Translate + (Filter : in out Filter_Type; + In_Buffer_Size : in Integer := Default_Buffer_Size; + Out_Buffer_Size : in Integer := Default_Buffer_Size); + -- Compress/decompress data fetch from Data_In routine and pass the result + -- to the Data_Out routine. User should provide Data_In and Data_Out + -- for compression/decompression data flow. + -- Compression or decompression depend on Filter initialization. + + function Total_In (Filter : in Filter_Type) return Count; + pragma Inline (Total_In); + -- Returns total number of input bytes read so far + + function Total_Out (Filter : in Filter_Type) return Count; + pragma Inline (Total_Out); + -- Returns total number of bytes output so far + + function CRC32 + (CRC : in Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array) + return Unsigned_32; + pragma Inline (CRC32); + -- Compute CRC32, it could be necessary for make gzip format + + procedure CRC32 + (CRC : in out Unsigned_32; + Data : in Ada.Streams.Stream_Element_Array); + pragma Inline (CRC32); + -- Compute CRC32, it could be necessary for make gzip format + + ------------------------------------------------- + -- Below is more complex low level routines. -- + ------------------------------------------------- + + procedure Translate + (Filter : in out Filter_Type; + In_Data : in Ada.Streams.Stream_Element_Array; + In_Last : out Ada.Streams.Stream_Element_Offset; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + -- Compress/decompress the In_Data buffer and place the result into + -- Out_Data. In_Last is the index of last element from In_Data accepted by + -- the Filter. Out_Last is the last element of the received data from + -- Filter. To tell the filter that incoming data are complete put the + -- Flush parameter to Finish. + + function Stream_End (Filter : in Filter_Type) return Boolean; + pragma Inline (Stream_End); + -- Return the true when the stream is complete. + + procedure Flush + (Filter : in out Filter_Type; + Out_Data : out Ada.Streams.Stream_Element_Array; + Out_Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode); + pragma Inline (Flush); + -- Flushing the data from the compressor. + + generic + with procedure Write + (Item : in Ada.Streams.Stream_Element_Array); + -- User should provide this routine for accept + -- compressed/decompressed data. + + Buffer_Size : in Ada.Streams.Stream_Element_Offset + := Default_Buffer_Size; + -- Buffer size for Write user routine. + + procedure Write + (Filter : in out Filter_Type; + Item : in Ada.Streams.Stream_Element_Array; + Flush : in Flush_Mode := No_Flush); + -- Compress/Decompress data from Item to the generic parameter procedure + -- Write. Output buffer size could be set in Buffer_Size generic parameter. + + generic + with procedure Read + (Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset); + -- User should provide data for compression/decompression + -- thru this routine. + + Buffer : in out Ada.Streams.Stream_Element_Array; + -- Buffer for keep remaining data from the previous + -- back read. + + Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset; + -- Rest_First have to be initialized to Buffer'Last + 1 + -- Rest_Last have to be initialized to Buffer'Last + -- before usage. + + Allow_Read_Some : in Boolean := False; + -- Is it allowed to return Last < Item'Last before end of data. + + procedure Read + (Filter : in out Filter_Type; + Item : out Ada.Streams.Stream_Element_Array; + Last : out Ada.Streams.Stream_Element_Offset; + Flush : in Flush_Mode := No_Flush); + -- Compress/Decompress data from generic parameter procedure Read to the + -- Item. User should provide Buffer and initialized Rest_First, Rest_Last + -- indicators. If Allow_Read_Some is True, Read routines could return + -- Last < Item'Last only at end of stream. + +private + + use Ada.Streams; + + pragma Assert (Ada.Streams.Stream_Element'Size = 8); + pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8); + + type Flush_Mode is new Integer range 0 .. 5; + + type Compression_Method is new Integer range 8 .. 8; + + type Strategy_Type is new Integer range 0 .. 3; + + No_Flush : constant Flush_Mode := 0; + Partial_Flush : constant Flush_Mode := 1; + Sync_Flush : constant Flush_Mode := 2; + Full_Flush : constant Flush_Mode := 3; + Finish : constant Flush_Mode := 4; + Block_Flush : constant Flush_Mode := 5; + + Filtered : constant Strategy_Type := 1; + Huffman_Only : constant Strategy_Type := 2; + RLE : constant Strategy_Type := 3; + Default_Strategy : constant Strategy_Type := 0; + + Deflated : constant Compression_Method := 8; + + type Z_Stream; + + type Z_Stream_Access is access all Z_Stream; + + type Filter_Type is tagged limited record + Strm : Z_Stream_Access; + Compression : Boolean; + Stream_End : Boolean; + Header : Header_Type; + CRC : Unsigned_32; + Offset : Stream_Element_Offset; + -- Offset for gzip header/footer output. + end record; + +end ZLib; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.gpr b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.gpr new file mode 100644 index 0000000..296b22a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/ada/zlib.gpr @@ -0,0 +1,20 @@ +project Zlib is + + for Languages use ("Ada"); + for Source_Dirs use ("."); + for Object_Dir use "."; + for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); + + package Compiler is + for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); + end Compiler; + + package Linker is + for Default_Switches ("ada") use ("-lz"); + end Linker; + + package Builder is + for Default_Switches ("ada") use ("-s", "-gnatQ"); + end Builder; + +end Zlib; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/amd64/amd64-match.S b/thirdparty/zlib/zlib-1.2.7/contrib/amd64/amd64-match.S new file mode 100644 index 0000000..81d4a1c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/amd64/amd64-match.S @@ -0,0 +1,452 @@ +/* + * match.S -- optimized version of longest_match() + * based on the similar work by Gilles Vollant, and Brian Raiter, written 1998 + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the BSD License. Use by owners of Che Guevarra + * parafernalia is prohibited, where possible, and highly discouraged + * elsewhere. + */ + +#ifndef NO_UNDERLINE +# define match_init _match_init +# define longest_match _longest_match +#endif + +#define scanend ebx +#define scanendw bx +#define chainlenwmask edx /* high word: current chain len low word: s->wmask */ +#define curmatch rsi +#define curmatchd esi +#define windowbestlen r8 +#define scanalign r9 +#define scanalignd r9d +#define window r10 +#define bestlen r11 +#define bestlend r11d +#define scanstart r12d +#define scanstartw r12w +#define scan r13 +#define nicematch r14d +#define limit r15 +#define limitd r15d +#define prev rcx + +/* + * The 258 is a "magic number, not a parameter -- changing it + * breaks the hell loose + */ +#define MAX_MATCH (258) +#define MIN_MATCH (3) +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) +#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) + +/* stack frame offsets */ +#define LocalVarsSize (112) +#define _chainlenwmask ( 8-LocalVarsSize)(%rsp) +#define _windowbestlen (16-LocalVarsSize)(%rsp) +#define save_r14 (24-LocalVarsSize)(%rsp) +#define save_rsi (32-LocalVarsSize)(%rsp) +#define save_rbx (40-LocalVarsSize)(%rsp) +#define save_r12 (56-LocalVarsSize)(%rsp) +#define save_r13 (64-LocalVarsSize)(%rsp) +#define save_r15 (80-LocalVarsSize)(%rsp) + + +.globl match_init, longest_match + +/* + * On AMD64 the first argument of a function (in our case -- the pointer to + * deflate_state structure) is passed in %rdi, hence our offsets below are + * all off of that. + */ + +/* you can check the structure offset by running + +#include +#include +#include "deflate.h" + +void print_depl() +{ +deflate_state ds; +deflate_state *s=&ds; +printf("size pointer=%u\n",(int)sizeof(void*)); + +printf("#define dsWSize (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s))); +printf("#define dsWMask (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s))); +printf("#define dsWindow (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s))); +printf("#define dsPrev (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s))); +printf("#define dsMatchLen (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s))); +printf("#define dsPrevMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s))); +printf("#define dsStrStart (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s))); +printf("#define dsMatchStart (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s))); +printf("#define dsLookahead (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s))); +printf("#define dsPrevLen (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s))); +printf("#define dsMaxChainLen (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s))); +printf("#define dsGoodMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s))); +printf("#define dsNiceMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s))); +} + +*/ + + +/* + to compile for XCode 3.2 on MacOSX x86_64 + - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S" + */ + + +#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE +#define dsWSize ( 68)(%rdi) +#define dsWMask ( 76)(%rdi) +#define dsWindow ( 80)(%rdi) +#define dsPrev ( 96)(%rdi) +#define dsMatchLen (144)(%rdi) +#define dsPrevMatch (148)(%rdi) +#define dsStrStart (156)(%rdi) +#define dsMatchStart (160)(%rdi) +#define dsLookahead (164)(%rdi) +#define dsPrevLen (168)(%rdi) +#define dsMaxChainLen (172)(%rdi) +#define dsGoodMatch (188)(%rdi) +#define dsNiceMatch (192)(%rdi) + +#else + +#ifndef STRUCT_OFFSET +# define STRUCT_OFFSET (0) +#endif + + +#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi) +#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi) +#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi) +#define dsPrev ( 88 + STRUCT_OFFSET)(%rdi) +#define dsMatchLen (136 + STRUCT_OFFSET)(%rdi) +#define dsPrevMatch (140 + STRUCT_OFFSET)(%rdi) +#define dsStrStart (148 + STRUCT_OFFSET)(%rdi) +#define dsMatchStart (152 + STRUCT_OFFSET)(%rdi) +#define dsLookahead (156 + STRUCT_OFFSET)(%rdi) +#define dsPrevLen (160 + STRUCT_OFFSET)(%rdi) +#define dsMaxChainLen (164 + STRUCT_OFFSET)(%rdi) +#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi) +#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi) + +#endif + + + + +.text + +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ + +longest_match: +/* + * Retrieve the function arguments. %curmatch will hold cur_match + * throughout the entire function (passed via rsi on amd64). + * rdi will hold the pointer to the deflate_state (first arg on amd64) + */ + mov %rsi, save_rsi + mov %rbx, save_rbx + mov %r12, save_r12 + mov %r13, save_r13 + mov %r14, save_r14 + mov %r15, save_r15 + +/* uInt wmask = s->w_mask; */ +/* unsigned chain_length = s->max_chain_length; */ +/* if (s->prev_length >= s->good_match) { */ +/* chain_length >>= 2; */ +/* } */ + + movl dsPrevLen, %eax + movl dsGoodMatch, %ebx + cmpl %ebx, %eax + movl dsWMask, %eax + movl dsMaxChainLen, %chainlenwmask + jl LastMatchGood + shrl $2, %chainlenwmask +LastMatchGood: + +/* chainlen is decremented once beforehand so that the function can */ +/* use the sign flag instead of the zero flag for the exit test. */ +/* It is then shifted into the high word, to make room for the wmask */ +/* value, which it will always accompany. */ + + decl %chainlenwmask + shll $16, %chainlenwmask + orl %eax, %chainlenwmask + +/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ + + movl dsNiceMatch, %eax + movl dsLookahead, %ebx + cmpl %eax, %ebx + jl LookaheadLess + movl %eax, %ebx +LookaheadLess: movl %ebx, %nicematch + +/* register Bytef *scan = s->window + s->strstart; */ + + mov dsWindow, %window + movl dsStrStart, %limitd + lea (%limit, %window), %scan + +/* Determine how many bytes the scan ptr is off from being */ +/* dword-aligned. */ + + mov %scan, %scanalign + negl %scanalignd + andl $3, %scanalignd + +/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ +/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ + + movl dsWSize, %eax + subl $MIN_LOOKAHEAD, %eax + xorl %ecx, %ecx + subl %eax, %limitd + cmovng %ecx, %limitd + +/* int best_len = s->prev_length; */ + + movl dsPrevLen, %bestlend + +/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory. */ + + lea (%window, %bestlen), %windowbestlen + mov %windowbestlen, _windowbestlen + +/* register ush scan_start = *(ushf*)scan; */ +/* register ush scan_end = *(ushf*)(scan+best_len-1); */ +/* Posf *prev = s->prev; */ + + movzwl (%scan), %scanstart + movzwl -1(%scan, %bestlen), %scanend + mov dsPrev, %prev + +/* Jump into the main loop. */ + + movl %chainlenwmask, _chainlenwmask + jmp LoopEntry + +.balign 16 + +/* do { + * match = s->window + cur_match; + * if (*(ushf*)(match+best_len-1) != scan_end || + * *(ushf*)match != scan_start) continue; + * [...] + * } while ((cur_match = prev[cur_match & wmask]) > limit + * && --chain_length != 0); + * + * Here is the inner loop of the function. The function will spend the + * majority of its time in this loop, and majority of that time will + * be spent in the first ten instructions. + */ +LookupLoop: + andl %chainlenwmask, %curmatchd + movzwl (%prev, %curmatch, 2), %curmatchd + cmpl %limitd, %curmatchd + jbe LeaveNow + subl $0x00010000, %chainlenwmask + js LeaveNow +LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw + jne LookupLoop + cmpw %scanstartw, (%window, %curmatch) + jne LookupLoop + +/* Store the current value of chainlen. */ + movl %chainlenwmask, _chainlenwmask + +/* %scan is the string under scrutiny, and %prev to the string we */ +/* are hoping to match it up with. In actuality, %esi and %edi are */ +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ +/* initialized to -(MAX_MATCH_8 - scanalign). */ + + mov $(-MAX_MATCH_8), %rdx + lea (%curmatch, %window), %windowbestlen + lea MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen + lea MAX_MATCH_8(%scan, %scanalign), %prev + +/* the prefetching below makes very little difference... */ + prefetcht1 (%windowbestlen, %rdx) + prefetcht1 (%prev, %rdx) + +/* + * Test the strings for equality, 8 bytes at a time. At the end, + * adjust %rdx so that it is offset to the exact byte that mismatched. + * + * It should be confessed that this loop usually does not represent + * much of the total running time. Replacing it with a more + * straightforward "rep cmpsb" would not drastically degrade + * performance -- unrolling it, for example, makes no difference. + */ + +#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */ + +LoopCmps: +#ifdef USE_SSE + /* Preload the SSE registers */ + movdqu (%windowbestlen, %rdx), %xmm1 + movdqu (%prev, %rdx), %xmm2 + pcmpeqb %xmm2, %xmm1 + movdqu 16(%windowbestlen, %rdx), %xmm3 + movdqu 16(%prev, %rdx), %xmm4 + pcmpeqb %xmm4, %xmm3 + movdqu 32(%windowbestlen, %rdx), %xmm5 + movdqu 32(%prev, %rdx), %xmm6 + pcmpeqb %xmm6, %xmm5 + movdqu 48(%windowbestlen, %rdx), %xmm7 + movdqu 48(%prev, %rdx), %xmm8 + pcmpeqb %xmm8, %xmm7 + + /* Check the comparisions' results */ + pmovmskb %xmm1, %rax + notw %ax + bsfw %ax, %ax + jnz LeaveLoopCmps + + /* this is the only iteration of the loop with a possibility of having + incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40 + and (0x40*4)+8=0x108 */ + add $8, %rdx + jz LenMaximum + add $8, %rdx + + + pmovmskb %xmm3, %rax + notw %ax + bsfw %ax, %ax + jnz LeaveLoopCmps + + + add $16, %rdx + + + pmovmskb %xmm5, %rax + notw %ax + bsfw %ax, %ax + jnz LeaveLoopCmps + + add $16, %rdx + + + pmovmskb %xmm7, %rax + notw %ax + bsfw %ax, %ax + jnz LeaveLoopCmps + + add $16, %rdx + + jmp LoopCmps +LeaveLoopCmps: add %rax, %rdx +#else + mov (%windowbestlen, %rdx), %rax + xor (%prev, %rdx), %rax + jnz LeaveLoopCmps + + mov 8(%windowbestlen, %rdx), %rax + xor 8(%prev, %rdx), %rax + jnz LeaveLoopCmps8 + + mov 16(%windowbestlen, %rdx), %rax + xor 16(%prev, %rdx), %rax + jnz LeaveLoopCmps16 + + add $24, %rdx + jnz LoopCmps + jmp LenMaximum +# if 0 +/* + * This three-liner is tantalizingly simple, but bsf is a slow instruction, + * and the complicated alternative down below is quite a bit faster. Sad... + */ + +LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */ + shrl $3, %eax /* divide by 8 to get the byte */ + add %rax, %rdx +# else +LeaveLoopCmps16: + add $8, %rdx +LeaveLoopCmps8: + add $8, %rdx +LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */ + jnz Check16 + add $4, %rdx + shr $32, %rax +Check16: testw $0xFFFF, %ax + jnz LenLower + add $2, %rdx + shrl $16, %eax +LenLower: subb $1, %al + adc $0, %rdx +# endif +#endif + +/* Calculate the length of the match. If it is longer than MAX_MATCH, */ +/* then automatically accept it as the best possible match and leave. */ + + lea (%prev, %rdx), %rax + sub %scan, %rax + cmpl $MAX_MATCH, %eax + jge LenMaximum + +/* If the length of the match is not longer than the best match we */ +/* have so far, then forget it and return to the lookup loop. */ + + cmpl %bestlend, %eax + jg LongerMatch + mov _windowbestlen, %windowbestlen + mov dsPrev, %prev + movl _chainlenwmask, %edx + jmp LookupLoop + +/* s->match_start = cur_match; */ +/* best_len = len; */ +/* if (len >= nice_match) break; */ +/* scan_end = *(ushf*)(scan+best_len-1); */ + +LongerMatch: + movl %eax, %bestlend + movl %curmatchd, dsMatchStart + cmpl %nicematch, %eax + jge LeaveNow + + lea (%window, %bestlen), %windowbestlen + mov %windowbestlen, _windowbestlen + + movzwl -1(%scan, %rax), %scanend + mov dsPrev, %prev + movl _chainlenwmask, %chainlenwmask + jmp LookupLoop + +/* Accept the current string, with the maximum possible length. */ + +LenMaximum: + movl $MAX_MATCH, %bestlend + movl %curmatchd, dsMatchStart + +/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ +/* return s->lookahead; */ + +LeaveNow: + movl dsLookahead, %eax + cmpl %eax, %bestlend + cmovngl %bestlend, %eax +LookaheadRet: + +/* Restore the registers and return from whence we came. */ + + mov save_rsi, %rsi + mov save_rbx, %rbx + mov save_r12, %r12 + mov save_r13, %r13 + mov save_r14, %r14 + mov save_r15, %r15 + + ret + +match_init: ret diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/asm686/README.686 b/thirdparty/zlib/zlib-1.2.7/contrib/asm686/README.686 new file mode 100644 index 0000000..a0bf3be --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/asm686/README.686 @@ -0,0 +1,51 @@ +This is a patched version of zlib, modified to use +Pentium-Pro-optimized assembly code in the deflation algorithm. The +files changed/added by this patch are: + +README.686 +match.S + +The speedup that this patch provides varies, depending on whether the +compiler used to build the original version of zlib falls afoul of the +PPro's speed traps. My own tests show a speedup of around 10-20% at +the default compression level, and 20-30% using -9, against a version +compiled using gcc 2.7.2.3. Your mileage may vary. + +Note that this code has been tailored for the PPro/PII in particular, +and will not perform particuarly well on a Pentium. + +If you are using an assembler other than GNU as, you will have to +translate match.S to use your assembler's syntax. (Have fun.) + +Brian Raiter +breadbox@muppetlabs.com +April, 1998 + + +Added for zlib 1.1.3: + +The patches come from +http://www.muppetlabs.com/~breadbox/software/assembly.html + +To compile zlib with this asm file, copy match.S to the zlib directory +then do: + +CFLAGS="-O3 -DASMV" ./configure +make OBJA=match.o + + +Update: + +I've been ignoring these assembly routines for years, believing that +gcc's generated code had caught up with it sometime around gcc 2.95 +and the major rearchitecting of the Pentium 4. However, I recently +learned that, despite what I believed, this code still has some life +in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% +faster than the code produced by gcc 4.1. + +In acknowledgement of its continuing usefulness, I've altered the +license to match that of the rest of zlib. Share and Enjoy! + +Brian Raiter +breadbox@muppetlabs.com +April, 2007 diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/asm686/match.S b/thirdparty/zlib/zlib-1.2.7/contrib/asm686/match.S new file mode 100644 index 0000000..fa42109 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/asm686/match.S @@ -0,0 +1,357 @@ +/* match.S -- x86 assembly version of the zlib longest_match() function. + * Optimized for the Intel 686 chips (PPro and later). + * + * Copyright (C) 1998, 2007 Brian Raiter + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the author be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#ifndef NO_UNDERLINE +#define match_init _match_init +#define longest_match _longest_match +#endif + +#define MAX_MATCH (258) +#define MIN_MATCH (3) +#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) +#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) + +/* stack frame offsets */ + +#define chainlenwmask 0 /* high word: current chain len */ + /* low word: s->wmask */ +#define window 4 /* local copy of s->window */ +#define windowbestlen 8 /* s->window + bestlen */ +#define scanstart 16 /* first two bytes of string */ +#define scanend 12 /* last two bytes of string */ +#define scanalign 20 /* dword-misalignment of string */ +#define nicematch 24 /* a good enough match size */ +#define bestlen 28 /* size of best match so far */ +#define scan 32 /* ptr to string wanting match */ + +#define LocalVarsSize (36) +/* saved ebx 36 */ +/* saved edi 40 */ +/* saved esi 44 */ +/* saved ebp 48 */ +/* return address 52 */ +#define deflatestate 56 /* the function arguments */ +#define curmatch 60 + +/* All the +zlib1222add offsets are due to the addition of fields + * in zlib in the deflate_state structure since the asm code was first written + * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). + * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). + * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + */ + +#define zlib1222add (8) + +#define dsWSize (36+zlib1222add) +#define dsWMask (44+zlib1222add) +#define dsWindow (48+zlib1222add) +#define dsPrev (56+zlib1222add) +#define dsMatchLen (88+zlib1222add) +#define dsPrevMatch (92+zlib1222add) +#define dsStrStart (100+zlib1222add) +#define dsMatchStart (104+zlib1222add) +#define dsLookahead (108+zlib1222add) +#define dsPrevLen (112+zlib1222add) +#define dsMaxChainLen (116+zlib1222add) +#define dsGoodMatch (132+zlib1222add) +#define dsNiceMatch (136+zlib1222add) + + +.file "match.S" + +.globl match_init, longest_match + +.text + +/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ +.cfi_sections .debug_frame + +longest_match: + +.cfi_startproc +/* Save registers that the compiler may be using, and adjust %esp to */ +/* make room for our stack frame. */ + + pushl %ebp + .cfi_def_cfa_offset 8 + .cfi_offset ebp, -8 + pushl %edi + .cfi_def_cfa_offset 12 + pushl %esi + .cfi_def_cfa_offset 16 + pushl %ebx + .cfi_def_cfa_offset 20 + subl $LocalVarsSize, %esp + .cfi_def_cfa_offset LocalVarsSize+20 + +/* Retrieve the function arguments. %ecx will hold cur_match */ +/* throughout the entire function. %edx will hold the pointer to the */ +/* deflate_state structure during the function's setup (before */ +/* entering the main loop). */ + + movl deflatestate(%esp), %edx + movl curmatch(%esp), %ecx + +/* uInt wmask = s->w_mask; */ +/* unsigned chain_length = s->max_chain_length; */ +/* if (s->prev_length >= s->good_match) { */ +/* chain_length >>= 2; */ +/* } */ + + movl dsPrevLen(%edx), %eax + movl dsGoodMatch(%edx), %ebx + cmpl %ebx, %eax + movl dsWMask(%edx), %eax + movl dsMaxChainLen(%edx), %ebx + jl LastMatchGood + shrl $2, %ebx +LastMatchGood: + +/* chainlen is decremented once beforehand so that the function can */ +/* use the sign flag instead of the zero flag for the exit test. */ +/* It is then shifted into the high word, to make room for the wmask */ +/* value, which it will always accompany. */ + + decl %ebx + shll $16, %ebx + orl %eax, %ebx + movl %ebx, chainlenwmask(%esp) + +/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ + + movl dsNiceMatch(%edx), %eax + movl dsLookahead(%edx), %ebx + cmpl %eax, %ebx + jl LookaheadLess + movl %eax, %ebx +LookaheadLess: movl %ebx, nicematch(%esp) + +/* register Bytef *scan = s->window + s->strstart; */ + + movl dsWindow(%edx), %esi + movl %esi, window(%esp) + movl dsStrStart(%edx), %ebp + lea (%esi,%ebp), %edi + movl %edi, scan(%esp) + +/* Determine how many bytes the scan ptr is off from being */ +/* dword-aligned. */ + + movl %edi, %eax + negl %eax + andl $3, %eax + movl %eax, scanalign(%esp) + +/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ +/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ + + movl dsWSize(%edx), %eax + subl $MIN_LOOKAHEAD, %eax + subl %eax, %ebp + jg LimitPositive + xorl %ebp, %ebp +LimitPositive: + +/* int best_len = s->prev_length; */ + + movl dsPrevLen(%edx), %eax + movl %eax, bestlen(%esp) + +/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ + + addl %eax, %esi + movl %esi, windowbestlen(%esp) + +/* register ush scan_start = *(ushf*)scan; */ +/* register ush scan_end = *(ushf*)(scan+best_len-1); */ +/* Posf *prev = s->prev; */ + + movzwl (%edi), %ebx + movl %ebx, scanstart(%esp) + movzwl -1(%edi,%eax), %ebx + movl %ebx, scanend(%esp) + movl dsPrev(%edx), %edi + +/* Jump into the main loop. */ + + movl chainlenwmask(%esp), %edx + jmp LoopEntry + +.balign 16 + +/* do { + * match = s->window + cur_match; + * if (*(ushf*)(match+best_len-1) != scan_end || + * *(ushf*)match != scan_start) continue; + * [...] + * } while ((cur_match = prev[cur_match & wmask]) > limit + * && --chain_length != 0); + * + * Here is the inner loop of the function. The function will spend the + * majority of its time in this loop, and majority of that time will + * be spent in the first ten instructions. + * + * Within this loop: + * %ebx = scanend + * %ecx = curmatch + * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) + * %esi = windowbestlen - i.e., (window + bestlen) + * %edi = prev + * %ebp = limit + */ +LookupLoop: + andl %edx, %ecx + movzwl (%edi,%ecx,2), %ecx + cmpl %ebp, %ecx + jbe LeaveNow + subl $0x00010000, %edx + js LeaveNow +LoopEntry: movzwl -1(%esi,%ecx), %eax + cmpl %ebx, %eax + jnz LookupLoop + movl window(%esp), %eax + movzwl (%eax,%ecx), %eax + cmpl scanstart(%esp), %eax + jnz LookupLoop + +/* Store the current value of chainlen. */ + + movl %edx, chainlenwmask(%esp) + +/* Point %edi to the string under scrutiny, and %esi to the string we */ +/* are hoping to match it up with. In actuality, %esi and %edi are */ +/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ +/* initialized to -(MAX_MATCH_8 - scanalign). */ + + movl window(%esp), %esi + movl scan(%esp), %edi + addl %ecx, %esi + movl scanalign(%esp), %eax + movl $(-MAX_MATCH_8), %edx + lea MAX_MATCH_8(%edi,%eax), %edi + lea MAX_MATCH_8(%esi,%eax), %esi + +/* Test the strings for equality, 8 bytes at a time. At the end, + * adjust %edx so that it is offset to the exact byte that mismatched. + * + * We already know at this point that the first three bytes of the + * strings match each other, and they can be safely passed over before + * starting the compare loop. So what this code does is skip over 0-3 + * bytes, as much as necessary in order to dword-align the %edi + * pointer. (%esi will still be misaligned three times out of four.) + * + * It should be confessed that this loop usually does not represent + * much of the total running time. Replacing it with a more + * straightforward "rep cmpsb" would not drastically degrade + * performance. + */ +LoopCmps: + movl (%esi,%edx), %eax + xorl (%edi,%edx), %eax + jnz LeaveLoopCmps + movl 4(%esi,%edx), %eax + xorl 4(%edi,%edx), %eax + jnz LeaveLoopCmps4 + addl $8, %edx + jnz LoopCmps + jmp LenMaximum +LeaveLoopCmps4: addl $4, %edx +LeaveLoopCmps: testl $0x0000FFFF, %eax + jnz LenLower + addl $2, %edx + shrl $16, %eax +LenLower: subb $1, %al + adcl $0, %edx + +/* Calculate the length of the match. If it is longer than MAX_MATCH, */ +/* then automatically accept it as the best possible match and leave. */ + + lea (%edi,%edx), %eax + movl scan(%esp), %edi + subl %edi, %eax + cmpl $MAX_MATCH, %eax + jge LenMaximum + +/* If the length of the match is not longer than the best match we */ +/* have so far, then forget it and return to the lookup loop. */ + + movl deflatestate(%esp), %edx + movl bestlen(%esp), %ebx + cmpl %ebx, %eax + jg LongerMatch + movl windowbestlen(%esp), %esi + movl dsPrev(%edx), %edi + movl scanend(%esp), %ebx + movl chainlenwmask(%esp), %edx + jmp LookupLoop + +/* s->match_start = cur_match; */ +/* best_len = len; */ +/* if (len >= nice_match) break; */ +/* scan_end = *(ushf*)(scan+best_len-1); */ + +LongerMatch: movl nicematch(%esp), %ebx + movl %eax, bestlen(%esp) + movl %ecx, dsMatchStart(%edx) + cmpl %ebx, %eax + jge LeaveNow + movl window(%esp), %esi + addl %eax, %esi + movl %esi, windowbestlen(%esp) + movzwl -1(%edi,%eax), %ebx + movl dsPrev(%edx), %edi + movl %ebx, scanend(%esp) + movl chainlenwmask(%esp), %edx + jmp LookupLoop + +/* Accept the current string, with the maximum possible length. */ + +LenMaximum: movl deflatestate(%esp), %edx + movl $MAX_MATCH, bestlen(%esp) + movl %ecx, dsMatchStart(%edx) + +/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ +/* return s->lookahead; */ + +LeaveNow: + movl deflatestate(%esp), %edx + movl bestlen(%esp), %ebx + movl dsLookahead(%edx), %eax + cmpl %eax, %ebx + jg LookaheadRet + movl %ebx, %eax +LookaheadRet: + +/* Restore the stack and return from whence we came. */ + + addl $LocalVarsSize, %esp + .cfi_def_cfa_offset 20 + popl %ebx + .cfi_def_cfa_offset 16 + popl %esi + .cfi_def_cfa_offset 12 + popl %edi + .cfi_def_cfa_offset 8 + popl %ebp + .cfi_def_cfa_offset 4 +.cfi_endproc +match_init: ret diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/Makefile b/thirdparty/zlib/zlib-1.2.7/contrib/blast/Makefile new file mode 100644 index 0000000..9be80ba --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/blast/Makefile @@ -0,0 +1,8 @@ +blast: blast.c blast.h + cc -DTEST -o blast blast.c + +test: blast + blast < test.pk | cmp - test.txt + +clean: + rm -f blast blast.o diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/README b/thirdparty/zlib/zlib-1.2.7/contrib/blast/README new file mode 100644 index 0000000..e3a60b3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/blast/README @@ -0,0 +1,4 @@ +Read blast.h for purpose and usage. + +Mark Adler +madler@alumni.caltech.edu diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.c b/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.c new file mode 100644 index 0000000..4ce697a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.c @@ -0,0 +1,444 @@ +/* blast.c + * Copyright (C) 2003 Mark Adler + * For conditions of distribution and use, see copyright notice in blast.h + * version 1.1, 16 Feb 2003 + * + * blast.c decompresses data compressed by the PKWare Compression Library. + * This function provides functionality similar to the explode() function of + * the PKWare library, hence the name "blast". + * + * This decompressor is based on the excellent format description provided by + * Ben Rudiak-Gould in comp.compression on August 13, 2001. Interestingly, the + * example Ben provided in the post is incorrect. The distance 110001 should + * instead be 111000. When corrected, the example byte stream becomes: + * + * 00 04 82 24 25 8f 80 7f + * + * which decompresses to "AIAIAIAIAIAIA" (without the quotes). + */ + +/* + * Change history: + * + * 1.0 12 Feb 2003 - First version + * 1.1 16 Feb 2003 - Fixed distance check for > 4 GB uncompressed data + */ + +#include /* for setjmp(), longjmp(), and jmp_buf */ +#include "blast.h" /* prototype for blast() */ + +#define local static /* for local function definitions */ +#define MAXBITS 13 /* maximum code length */ +#define MAXWIN 4096 /* maximum window size */ + +/* input and output state */ +struct state { + /* input state */ + blast_in infun; /* input function provided by user */ + void *inhow; /* opaque information passed to infun() */ + unsigned char *in; /* next input location */ + unsigned left; /* available input at in */ + int bitbuf; /* bit buffer */ + int bitcnt; /* number of bits in bit buffer */ + + /* input limit error return state for bits() and decode() */ + jmp_buf env; + + /* output state */ + blast_out outfun; /* output function provided by user */ + void *outhow; /* opaque information passed to outfun() */ + unsigned next; /* index of next write location in out[] */ + int first; /* true to check distances (for first 4K) */ + unsigned char out[MAXWIN]; /* output buffer and sliding window */ +}; + +/* + * Return need bits from the input stream. This always leaves less than + * eight bits in the buffer. bits() works properly for need == 0. + * + * Format notes: + * + * - Bits are stored in bytes from the least significant bit to the most + * significant bit. Therefore bits are dropped from the bottom of the bit + * buffer, using shift right, and new bytes are appended to the top of the + * bit buffer, using shift left. + */ +local int bits(struct state *s, int need) +{ + int val; /* bit accumulator */ + + /* load at least need bits into val */ + val = s->bitbuf; + while (s->bitcnt < need) { + if (s->left == 0) { + s->left = s->infun(s->inhow, &(s->in)); + if (s->left == 0) longjmp(s->env, 1); /* out of input */ + } + val |= (int)(*(s->in)++) << s->bitcnt; /* load eight bits */ + s->left--; + s->bitcnt += 8; + } + + /* drop need bits and update buffer, always zero to seven bits left */ + s->bitbuf = val >> need; + s->bitcnt -= need; + + /* return need bits, zeroing the bits above that */ + return val & ((1 << need) - 1); +} + +/* + * Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of + * each length, which for a canonical code are stepped through in order. + * symbol[] are the symbol values in canonical order, where the number of + * entries is the sum of the counts in count[]. The decoding process can be + * seen in the function decode() below. + */ +struct huffman { + short *count; /* number of symbols of each length */ + short *symbol; /* canonically ordered symbols */ +}; + +/* + * Decode a code from the stream s using huffman table h. Return the symbol or + * a negative value if there is an error. If all of the lengths are zero, i.e. + * an empty code, or if the code is incomplete and an invalid code is received, + * then -9 is returned after reading MAXBITS bits. + * + * Format notes: + * + * - The codes as stored in the compressed data are bit-reversed relative to + * a simple integer ordering of codes of the same lengths. Hence below the + * bits are pulled from the compressed data one at a time and used to + * build the code value reversed from what is in the stream in order to + * permit simple integer comparisons for decoding. + * + * - The first code for the shortest length is all ones. Subsequent codes of + * the same length are simply integer decrements of the previous code. When + * moving up a length, a one bit is appended to the code. For a complete + * code, the last code of the longest length will be all zeros. To support + * this ordering, the bits pulled during decoding are inverted to apply the + * more "natural" ordering starting with all zeros and incrementing. + */ +local int decode(struct state *s, struct huffman *h) +{ + int len; /* current number of bits in code */ + int code; /* len bits being decoded */ + int first; /* first code of length len */ + int count; /* number of codes of length len */ + int index; /* index of first code of length len in symbol table */ + int bitbuf; /* bits from stream */ + int left; /* bits left in next or left to process */ + short *next; /* next number of codes */ + + bitbuf = s->bitbuf; + left = s->bitcnt; + code = first = index = 0; + len = 1; + next = h->count + 1; + while (1) { + while (left--) { + code |= (bitbuf & 1) ^ 1; /* invert code */ + bitbuf >>= 1; + count = *next++; + if (code < first + count) { /* if length len, return symbol */ + s->bitbuf = bitbuf; + s->bitcnt = (s->bitcnt - len) & 7; + return h->symbol[index + (code - first)]; + } + index += count; /* else update for next length */ + first += count; + first <<= 1; + code <<= 1; + len++; + } + left = (MAXBITS+1) - len; + if (left == 0) break; + if (s->left == 0) { + s->left = s->infun(s->inhow, &(s->in)); + if (s->left == 0) longjmp(s->env, 1); /* out of input */ + } + bitbuf = *(s->in)++; + s->left--; + if (left > 8) left = 8; + } + return -9; /* ran out of codes */ +} + +/* + * Given a list of repeated code lengths rep[0..n-1], where each byte is a + * count (high four bits + 1) and a code length (low four bits), generate the + * list of code lengths. This compaction reduces the size of the object code. + * Then given the list of code lengths length[0..n-1] representing a canonical + * Huffman code for n symbols, construct the tables required to decode those + * codes. Those tables are the number of codes of each length, and the symbols + * sorted by length, retaining their original order within each length. The + * return value is zero for a complete code set, negative for an over- + * subscribed code set, and positive for an incomplete code set. The tables + * can be used if the return value is zero or positive, but they cannot be used + * if the return value is negative. If the return value is zero, it is not + * possible for decode() using that table to return an error--any stream of + * enough bits will resolve to a symbol. If the return value is positive, then + * it is possible for decode() using that table to return an error for received + * codes past the end of the incomplete lengths. + */ +local int construct(struct huffman *h, const unsigned char *rep, int n) +{ + int symbol; /* current symbol when stepping through length[] */ + int len; /* current length when stepping through h->count[] */ + int left; /* number of possible codes left of current length */ + short offs[MAXBITS+1]; /* offsets in symbol table for each length */ + short length[256]; /* code lengths */ + + /* convert compact repeat counts into symbol bit length list */ + symbol = 0; + do { + len = *rep++; + left = (len >> 4) + 1; + len &= 15; + do { + length[symbol++] = len; + } while (--left); + } while (--n); + n = symbol; + + /* count number of codes of each length */ + for (len = 0; len <= MAXBITS; len++) + h->count[len] = 0; + for (symbol = 0; symbol < n; symbol++) + (h->count[length[symbol]])++; /* assumes lengths are within bounds */ + if (h->count[0] == n) /* no codes! */ + return 0; /* complete, but decode() will fail */ + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; /* one possible code of zero length */ + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; /* one more bit, double codes left */ + left -= h->count[len]; /* deduct count from possible codes */ + if (left < 0) return left; /* over-subscribed--return negative */ + } /* left > 0 means incomplete */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + h->count[len]; + + /* + * put symbols in table sorted by length, by symbol order within each + * length + */ + for (symbol = 0; symbol < n; symbol++) + if (length[symbol] != 0) + h->symbol[offs[length[symbol]]++] = symbol; + + /* return zero for complete set, positive for incomplete set */ + return left; +} + +/* + * Decode PKWare Compression Library stream. + * + * Format notes: + * + * - First byte is 0 if literals are uncoded or 1 if they are coded. Second + * byte is 4, 5, or 6 for the number of extra bits in the distance code. + * This is the base-2 logarithm of the dictionary size minus six. + * + * - Compressed data is a combination of literals and length/distance pairs + * terminated by an end code. Literals are either Huffman coded or + * uncoded bytes. A length/distance pair is a coded length followed by a + * coded distance to represent a string that occurs earlier in the + * uncompressed data that occurs again at the current location. + * + * - A bit preceding a literal or length/distance pair indicates which comes + * next, 0 for literals, 1 for length/distance. + * + * - If literals are uncoded, then the next eight bits are the literal, in the + * normal bit order in th stream, i.e. no bit-reversal is needed. Similarly, + * no bit reversal is needed for either the length extra bits or the distance + * extra bits. + * + * - Literal bytes are simply written to the output. A length/distance pair is + * an instruction to copy previously uncompressed bytes to the output. The + * copy is from distance bytes back in the output stream, copying for length + * bytes. + * + * - Distances pointing before the beginning of the output data are not + * permitted. + * + * - Overlapped copies, where the length is greater than the distance, are + * allowed and common. For example, a distance of one and a length of 518 + * simply copies the last byte 518 times. A distance of four and a length of + * twelve copies the last four bytes three times. A simple forward copy + * ignoring whether the length is greater than the distance or not implements + * this correctly. + */ +local int decomp(struct state *s) +{ + int lit; /* true if literals are coded */ + int dict; /* log2(dictionary size) - 6 */ + int symbol; /* decoded symbol, extra bits for distance */ + int len; /* length for copy */ + int dist; /* distance for copy */ + int copy; /* copy counter */ + unsigned char *from, *to; /* copy pointers */ + static int virgin = 1; /* build tables once */ + static short litcnt[MAXBITS+1], litsym[256]; /* litcode memory */ + static short lencnt[MAXBITS+1], lensym[16]; /* lencode memory */ + static short distcnt[MAXBITS+1], distsym[64]; /* distcode memory */ + static struct huffman litcode = {litcnt, litsym}; /* length code */ + static struct huffman lencode = {lencnt, lensym}; /* length code */ + static struct huffman distcode = {distcnt, distsym};/* distance code */ + /* bit lengths of literal codes */ + static const unsigned char litlen[] = { + 11, 124, 8, 7, 28, 7, 188, 13, 76, 4, 10, 8, 12, 10, 12, 10, 8, 23, 8, + 9, 7, 6, 7, 8, 7, 6, 55, 8, 23, 24, 12, 11, 7, 9, 11, 12, 6, 7, 22, 5, + 7, 24, 6, 11, 9, 6, 7, 22, 7, 11, 38, 7, 9, 8, 25, 11, 8, 11, 9, 12, + 8, 12, 5, 38, 5, 38, 5, 11, 7, 5, 6, 21, 6, 10, 53, 8, 7, 24, 10, 27, + 44, 253, 253, 253, 252, 252, 252, 13, 12, 45, 12, 45, 12, 61, 12, 45, + 44, 173}; + /* bit lengths of length codes 0..15 */ + static const unsigned char lenlen[] = {2, 35, 36, 53, 38, 23}; + /* bit lengths of distance codes 0..63 */ + static const unsigned char distlen[] = {2, 20, 53, 230, 247, 151, 248}; + static const short base[16] = { /* base for length codes */ + 3, 2, 4, 5, 6, 7, 8, 9, 10, 12, 16, 24, 40, 72, 136, 264}; + static const char extra[16] = { /* extra bits for length codes */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8}; + + /* set up decoding tables (once--might not be thread-safe) */ + if (virgin) { + construct(&litcode, litlen, sizeof(litlen)); + construct(&lencode, lenlen, sizeof(lenlen)); + construct(&distcode, distlen, sizeof(distlen)); + virgin = 0; + } + + /* read header */ + lit = bits(s, 8); + if (lit > 1) return -1; + dict = bits(s, 8); + if (dict < 4 || dict > 6) return -2; + + /* decode literals and length/distance pairs */ + do { + if (bits(s, 1)) { + /* get length */ + symbol = decode(s, &lencode); + len = base[symbol] + bits(s, extra[symbol]); + if (len == 519) break; /* end code */ + + /* get distance */ + symbol = len == 2 ? 2 : dict; + dist = decode(s, &distcode) << symbol; + dist += bits(s, symbol); + dist++; + if (s->first && dist > s->next) + return -3; /* distance too far back */ + + /* copy length bytes from distance bytes back */ + do { + to = s->out + s->next; + from = to - dist; + copy = MAXWIN; + if (s->next < dist) { + from += copy; + copy = dist; + } + copy -= s->next; + if (copy > len) copy = len; + len -= copy; + s->next += copy; + do { + *to++ = *from++; + } while (--copy); + if (s->next == MAXWIN) { + if (s->outfun(s->outhow, s->out, s->next)) return 1; + s->next = 0; + s->first = 0; + } + } while (len != 0); + } + else { + /* get literal and write it */ + symbol = lit ? decode(s, &litcode) : bits(s, 8); + s->out[s->next++] = symbol; + if (s->next == MAXWIN) { + if (s->outfun(s->outhow, s->out, s->next)) return 1; + s->next = 0; + s->first = 0; + } + } + } while (1); + return 0; +} + +/* See comments in blast.h */ +int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow) +{ + struct state s; /* input/output state */ + int err; /* return value */ + + /* initialize input state */ + s.infun = infun; + s.inhow = inhow; + s.left = 0; + s.bitbuf = 0; + s.bitcnt = 0; + + /* initialize output state */ + s.outfun = outfun; + s.outhow = outhow; + s.next = 0; + s.first = 1; + + /* return if bits() or decode() tries to read past available input */ + if (setjmp(s.env) != 0) /* if came back here via longjmp(), */ + err = 2; /* then skip decomp(), return error */ + else + err = decomp(&s); /* decompress */ + + /* write any leftover output and update the error code if needed */ + if (err != 1 && s.next && s.outfun(s.outhow, s.out, s.next) && err == 0) + err = 1; + return err; +} + +#ifdef TEST +/* Example of how to use blast() */ +#include +#include + +#define CHUNK 16384 + +local unsigned inf(void *how, unsigned char **buf) +{ + static unsigned char hold[CHUNK]; + + *buf = hold; + return fread(hold, 1, CHUNK, (FILE *)how); +} + +local int outf(void *how, unsigned char *buf, unsigned len) +{ + return fwrite(buf, 1, len, (FILE *)how) != len; +} + +/* Decompress a PKWare Compression Library stream from stdin to stdout */ +int main(void) +{ + int ret, n; + + /* decompress to stdout */ + ret = blast(inf, stdin, outf, stdout); + if (ret != 0) fprintf(stderr, "blast error: %d\n", ret); + + /* see if there are any leftover bytes */ + n = 0; + while (getchar() != EOF) n++; + if (n) fprintf(stderr, "blast warning: %d unused bytes of input\n", n); + + /* return blast() error code */ + return ret; +} +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.h b/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.h new file mode 100644 index 0000000..ce9e541 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/blast/blast.h @@ -0,0 +1,71 @@ +/* blast.h -- interface for blast.c + Copyright (C) 2003 Mark Adler + version 1.1, 16 Feb 2003 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + + +/* + * blast() decompresses the PKWare Data Compression Library (DCL) compressed + * format. It provides the same functionality as the explode() function in + * that library. (Note: PKWare overused the "implode" verb, and the format + * used by their library implode() function is completely different and + * incompatible with the implode compression method supported by PKZIP.) + */ + + +typedef unsigned (*blast_in)(void *how, unsigned char **buf); +typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len); +/* Definitions for input/output functions passed to blast(). See below for + * what the provided functions need to do. + */ + + +int blast(blast_in infun, void *inhow, blast_out outfun, void *outhow); +/* Decompress input to output using the provided infun() and outfun() calls. + * On success, the return value of blast() is zero. If there is an error in + * the source data, i.e. it is not in the proper format, then a negative value + * is returned. If there is not enough input available or there is not enough + * output space, then a positive error is returned. + * + * The input function is invoked: len = infun(how, &buf), where buf is set by + * infun() to point to the input buffer, and infun() returns the number of + * available bytes there. If infun() returns zero, then blast() returns with + * an input error. (blast() only asks for input if it needs it.) inhow is for + * use by the application to pass an input descriptor to infun(), if desired. + * + * The output function is invoked: err = outfun(how, buf, len), where the bytes + * to be written are buf[0..len-1]. If err is not zero, then blast() returns + * with an output error. outfun() is always called with len <= 4096. outhow + * is for use by the application to pass an output descriptor to outfun(), if + * desired. + * + * The return codes are: + * + * 2: ran out of input before completing decompression + * 1: output error before completing decompression + * 0: successful decompression + * -1: literal flag not zero or one + * -2: dictionary size not in 4..6 + * -3: distance is too far back + * + * At the bottom of blast.c is an example program that uses blast() that can be + * compiled to produce a command-line decompression filter by defining TEST. + */ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.pk b/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.pk new file mode 100644 index 0000000..be10b2b Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.pk differ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.txt b/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.txt new file mode 100644 index 0000000..bfdf1c5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/blast/test.txt @@ -0,0 +1 @@ +AIAIAIAIAIAIA \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLib.pas b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLib.pas new file mode 100644 index 0000000..f24bb3e --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLib.pas @@ -0,0 +1,557 @@ +{*******************************************************} +{ } +{ Borland Delphi Supplemental Components } +{ ZLIB Data Compression Interface Unit } +{ } +{ Copyright (c) 1997,99 Borland Corporation } +{ } +{*******************************************************} + +{ Updated for zlib 1.2.x by Cosmin Truta } + +unit ZLib; + +interface + +uses SysUtils, Classes; + +type + TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer; cdecl; + TFree = procedure (AppData, Block: Pointer); cdecl; + + // Internal structure. Ignore. + TZStreamRec = packed record + next_in: PChar; // next input byte + avail_in: Integer; // number of bytes available at next_in + total_in: Longint; // total nb of input bytes read so far + + next_out: PChar; // next output byte should be put here + avail_out: Integer; // remaining free space at next_out + total_out: Longint; // total nb of bytes output so far + + msg: PChar; // last error message, NULL if no error + internal: Pointer; // not visible by applications + + zalloc: TAlloc; // used to allocate the internal state + zfree: TFree; // used to free the internal state + AppData: Pointer; // private data object passed to zalloc and zfree + + data_type: Integer; // best guess about the data type: ascii or binary + adler: Longint; // adler32 value of the uncompressed data + reserved: Longint; // reserved for future use + end; + + // Abstract ancestor class + TCustomZlibStream = class(TStream) + private + FStrm: TStream; + FStrmPos: Integer; + FOnProgress: TNotifyEvent; + FZRec: TZStreamRec; + FBuffer: array [Word] of Char; + protected + procedure Progress(Sender: TObject); dynamic; + property OnProgress: TNotifyEvent read FOnProgress write FOnProgress; + constructor Create(Strm: TStream); + end; + +{ TCompressionStream compresses data on the fly as data is written to it, and + stores the compressed data to another stream. + + TCompressionStream is write-only and strictly sequential. Reading from the + stream will raise an exception. Using Seek to move the stream pointer + will raise an exception. + + Output data is cached internally, written to the output stream only when + the internal output buffer is full. All pending output data is flushed + when the stream is destroyed. + + The Position property returns the number of uncompressed bytes of + data that have been written to the stream so far. + + CompressionRate returns the on-the-fly percentage by which the original + data has been compressed: (1 - (CompressedBytes / UncompressedBytes)) * 100 + If raw data size = 100 and compressed data size = 25, the CompressionRate + is 75% + + The OnProgress event is called each time the output buffer is filled and + written to the output stream. This is useful for updating a progress + indicator when you are writing a large chunk of data to the compression + stream in a single call.} + + + TCompressionLevel = (clNone, clFastest, clDefault, clMax); + + TCompressionStream = class(TCustomZlibStream) + private + function GetCompressionRate: Single; + public + constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream); + destructor Destroy; override; + function Read(var Buffer; Count: Longint): Longint; override; + function Write(const Buffer; Count: Longint): Longint; override; + function Seek(Offset: Longint; Origin: Word): Longint; override; + property CompressionRate: Single read GetCompressionRate; + property OnProgress; + end; + +{ TDecompressionStream decompresses data on the fly as data is read from it. + + Compressed data comes from a separate source stream. TDecompressionStream + is read-only and unidirectional; you can seek forward in the stream, but not + backwards. The special case of setting the stream position to zero is + allowed. Seeking forward decompresses data until the requested position in + the uncompressed data has been reached. Seeking backwards, seeking relative + to the end of the stream, requesting the size of the stream, and writing to + the stream will raise an exception. + + The Position property returns the number of bytes of uncompressed data that + have been read from the stream so far. + + The OnProgress event is called each time the internal input buffer of + compressed data is exhausted and the next block is read from the input stream. + This is useful for updating a progress indicator when you are reading a + large chunk of data from the decompression stream in a single call.} + + TDecompressionStream = class(TCustomZlibStream) + public + constructor Create(Source: TStream); + destructor Destroy; override; + function Read(var Buffer; Count: Longint): Longint; override; + function Write(const Buffer; Count: Longint): Longint; override; + function Seek(Offset: Longint; Origin: Word): Longint; override; + property OnProgress; + end; + + + +{ CompressBuf compresses data, buffer to buffer, in one call. + In: InBuf = ptr to compressed data + InBytes = number of bytes in InBuf + Out: OutBuf = ptr to newly allocated buffer containing decompressed data + OutBytes = number of bytes in OutBuf } +procedure CompressBuf(const InBuf: Pointer; InBytes: Integer; + out OutBuf: Pointer; out OutBytes: Integer); + + +{ DecompressBuf decompresses data, buffer to buffer, in one call. + In: InBuf = ptr to compressed data + InBytes = number of bytes in InBuf + OutEstimate = zero, or est. size of the decompressed data + Out: OutBuf = ptr to newly allocated buffer containing decompressed data + OutBytes = number of bytes in OutBuf } +procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer; + OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer); + +{ DecompressToUserBuf decompresses data, buffer to buffer, in one call. + In: InBuf = ptr to compressed data + InBytes = number of bytes in InBuf + Out: OutBuf = ptr to user-allocated buffer to contain decompressed data + BufSize = number of bytes in OutBuf } +procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; + const OutBuf: Pointer; BufSize: Integer); + +const + zlib_version = '1.2.7'; + +type + EZlibError = class(Exception); + ECompressionError = class(EZlibError); + EDecompressionError = class(EZlibError); + +implementation + +uses ZLibConst; + +const + Z_NO_FLUSH = 0; + Z_PARTIAL_FLUSH = 1; + Z_SYNC_FLUSH = 2; + Z_FULL_FLUSH = 3; + Z_FINISH = 4; + + Z_OK = 0; + Z_STREAM_END = 1; + Z_NEED_DICT = 2; + Z_ERRNO = (-1); + Z_STREAM_ERROR = (-2); + Z_DATA_ERROR = (-3); + Z_MEM_ERROR = (-4); + Z_BUF_ERROR = (-5); + Z_VERSION_ERROR = (-6); + + Z_NO_COMPRESSION = 0; + Z_BEST_SPEED = 1; + Z_BEST_COMPRESSION = 9; + Z_DEFAULT_COMPRESSION = (-1); + + Z_FILTERED = 1; + Z_HUFFMAN_ONLY = 2; + Z_RLE = 3; + Z_DEFAULT_STRATEGY = 0; + + Z_BINARY = 0; + Z_ASCII = 1; + Z_UNKNOWN = 2; + + Z_DEFLATED = 8; + + +{$L adler32.obj} +{$L compress.obj} +{$L crc32.obj} +{$L deflate.obj} +{$L infback.obj} +{$L inffast.obj} +{$L inflate.obj} +{$L inftrees.obj} +{$L trees.obj} +{$L uncompr.obj} +{$L zutil.obj} + +procedure adler32; external; +procedure compressBound; external; +procedure crc32; external; +procedure deflateInit2_; external; +procedure deflateParams; external; + +function _malloc(Size: Integer): Pointer; cdecl; +begin + Result := AllocMem(Size); +end; + +procedure _free(Block: Pointer); cdecl; +begin + FreeMem(Block); +end; + +procedure _memset(P: Pointer; B: Byte; count: Integer); cdecl; +begin + FillChar(P^, count, B); +end; + +procedure _memcpy(dest, source: Pointer; count: Integer); cdecl; +begin + Move(source^, dest^, count); +end; + + + +// deflate compresses data +function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar; + recsize: Integer): Integer; external; +function deflate(var strm: TZStreamRec; flush: Integer): Integer; external; +function deflateEnd(var strm: TZStreamRec): Integer; external; + +// inflate decompresses data +function inflateInit_(var strm: TZStreamRec; version: PChar; + recsize: Integer): Integer; external; +function inflate(var strm: TZStreamRec; flush: Integer): Integer; external; +function inflateEnd(var strm: TZStreamRec): Integer; external; +function inflateReset(var strm: TZStreamRec): Integer; external; + + +function zlibAllocMem(AppData: Pointer; Items, Size: Integer): Pointer; cdecl; +begin +// GetMem(Result, Items*Size); + Result := AllocMem(Items * Size); +end; + +procedure zlibFreeMem(AppData, Block: Pointer); cdecl; +begin + FreeMem(Block); +end; + +{function zlibCheck(code: Integer): Integer; +begin + Result := code; + if code < 0 then + raise EZlibError.Create('error'); //!! +end;} + +function CCheck(code: Integer): Integer; +begin + Result := code; + if code < 0 then + raise ECompressionError.Create('error'); //!! +end; + +function DCheck(code: Integer): Integer; +begin + Result := code; + if code < 0 then + raise EDecompressionError.Create('error'); //!! +end; + +procedure CompressBuf(const InBuf: Pointer; InBytes: Integer; + out OutBuf: Pointer; out OutBytes: Integer); +var + strm: TZStreamRec; + P: Pointer; +begin + FillChar(strm, sizeof(strm), 0); + strm.zalloc := zlibAllocMem; + strm.zfree := zlibFreeMem; + OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255; + GetMem(OutBuf, OutBytes); + try + strm.next_in := InBuf; + strm.avail_in := InBytes; + strm.next_out := OutBuf; + strm.avail_out := OutBytes; + CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm))); + try + while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do + begin + P := OutBuf; + Inc(OutBytes, 256); + ReallocMem(OutBuf, OutBytes); + strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P))); + strm.avail_out := 256; + end; + finally + CCheck(deflateEnd(strm)); + end; + ReallocMem(OutBuf, strm.total_out); + OutBytes := strm.total_out; + except + FreeMem(OutBuf); + raise + end; +end; + + +procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer; + OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer); +var + strm: TZStreamRec; + P: Pointer; + BufInc: Integer; +begin + FillChar(strm, sizeof(strm), 0); + strm.zalloc := zlibAllocMem; + strm.zfree := zlibFreeMem; + BufInc := (InBytes + 255) and not 255; + if OutEstimate = 0 then + OutBytes := BufInc + else + OutBytes := OutEstimate; + GetMem(OutBuf, OutBytes); + try + strm.next_in := InBuf; + strm.avail_in := InBytes; + strm.next_out := OutBuf; + strm.avail_out := OutBytes; + DCheck(inflateInit_(strm, zlib_version, sizeof(strm))); + try + while DCheck(inflate(strm, Z_NO_FLUSH)) <> Z_STREAM_END do + begin + P := OutBuf; + Inc(OutBytes, BufInc); + ReallocMem(OutBuf, OutBytes); + strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P))); + strm.avail_out := BufInc; + end; + finally + DCheck(inflateEnd(strm)); + end; + ReallocMem(OutBuf, strm.total_out); + OutBytes := strm.total_out; + except + FreeMem(OutBuf); + raise + end; +end; + +procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; + const OutBuf: Pointer; BufSize: Integer); +var + strm: TZStreamRec; +begin + FillChar(strm, sizeof(strm), 0); + strm.zalloc := zlibAllocMem; + strm.zfree := zlibFreeMem; + strm.next_in := InBuf; + strm.avail_in := InBytes; + strm.next_out := OutBuf; + strm.avail_out := BufSize; + DCheck(inflateInit_(strm, zlib_version, sizeof(strm))); + try + if DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END then + raise EZlibError.CreateRes(@sTargetBufferTooSmall); + finally + DCheck(inflateEnd(strm)); + end; +end; + +// TCustomZlibStream + +constructor TCustomZLibStream.Create(Strm: TStream); +begin + inherited Create; + FStrm := Strm; + FStrmPos := Strm.Position; + FZRec.zalloc := zlibAllocMem; + FZRec.zfree := zlibFreeMem; +end; + +procedure TCustomZLibStream.Progress(Sender: TObject); +begin + if Assigned(FOnProgress) then FOnProgress(Sender); +end; + + +// TCompressionStream + +constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel; + Dest: TStream); +const + Levels: array [TCompressionLevel] of ShortInt = + (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION); +begin + inherited Create(Dest); + FZRec.next_out := FBuffer; + FZRec.avail_out := sizeof(FBuffer); + CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec))); +end; + +destructor TCompressionStream.Destroy; +begin + FZRec.next_in := nil; + FZRec.avail_in := 0; + try + if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos; + while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END) + and (FZRec.avail_out = 0) do + begin + FStrm.WriteBuffer(FBuffer, sizeof(FBuffer)); + FZRec.next_out := FBuffer; + FZRec.avail_out := sizeof(FBuffer); + end; + if FZRec.avail_out < sizeof(FBuffer) then + FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out); + finally + deflateEnd(FZRec); + end; + inherited Destroy; +end; + +function TCompressionStream.Read(var Buffer; Count: Longint): Longint; +begin + raise ECompressionError.CreateRes(@sInvalidStreamOp); +end; + +function TCompressionStream.Write(const Buffer; Count: Longint): Longint; +begin + FZRec.next_in := @Buffer; + FZRec.avail_in := Count; + if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos; + while (FZRec.avail_in > 0) do + begin + CCheck(deflate(FZRec, 0)); + if FZRec.avail_out = 0 then + begin + FStrm.WriteBuffer(FBuffer, sizeof(FBuffer)); + FZRec.next_out := FBuffer; + FZRec.avail_out := sizeof(FBuffer); + FStrmPos := FStrm.Position; + Progress(Self); + end; + end; + Result := Count; +end; + +function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint; +begin + if (Offset = 0) and (Origin = soFromCurrent) then + Result := FZRec.total_in + else + raise ECompressionError.CreateRes(@sInvalidStreamOp); +end; + +function TCompressionStream.GetCompressionRate: Single; +begin + if FZRec.total_in = 0 then + Result := 0 + else + Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0; +end; + + +// TDecompressionStream + +constructor TDecompressionStream.Create(Source: TStream); +begin + inherited Create(Source); + FZRec.next_in := FBuffer; + FZRec.avail_in := 0; + DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec))); +end; + +destructor TDecompressionStream.Destroy; +begin + FStrm.Seek(-FZRec.avail_in, 1); + inflateEnd(FZRec); + inherited Destroy; +end; + +function TDecompressionStream.Read(var Buffer; Count: Longint): Longint; +begin + FZRec.next_out := @Buffer; + FZRec.avail_out := Count; + if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos; + while (FZRec.avail_out > 0) do + begin + if FZRec.avail_in = 0 then + begin + FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer)); + if FZRec.avail_in = 0 then + begin + Result := Count - FZRec.avail_out; + Exit; + end; + FZRec.next_in := FBuffer; + FStrmPos := FStrm.Position; + Progress(Self); + end; + CCheck(inflate(FZRec, 0)); + end; + Result := Count; +end; + +function TDecompressionStream.Write(const Buffer; Count: Longint): Longint; +begin + raise EDecompressionError.CreateRes(@sInvalidStreamOp); +end; + +function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint; +var + I: Integer; + Buf: array [0..4095] of Char; +begin + if (Offset = 0) and (Origin = soFromBeginning) then + begin + DCheck(inflateReset(FZRec)); + FZRec.next_in := FBuffer; + FZRec.avail_in := 0; + FStrm.Position := 0; + FStrmPos := 0; + end + else if ( (Offset >= 0) and (Origin = soFromCurrent)) or + ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then + begin + if Origin = soFromBeginning then Dec(Offset, FZRec.total_out); + if Offset > 0 then + begin + for I := 1 to Offset div sizeof(Buf) do + ReadBuffer(Buf, sizeof(Buf)); + ReadBuffer(Buf, Offset mod sizeof(Buf)); + end; + end + else + raise EDecompressionError.CreateRes(@sInvalidStreamOp); + Result := FZRec.total_out; +end; + + +end. diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLibConst.pas b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLibConst.pas new file mode 100644 index 0000000..cdfe136 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/ZLibConst.pas @@ -0,0 +1,11 @@ +unit ZLibConst; + +interface + +resourcestring + sTargetBufferTooSmall = 'ZLib error: target buffer may be too small'; + sInvalidStreamOp = 'Invalid stream operation'; + +implementation + +end. diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/delphi/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/readme.txt new file mode 100644 index 0000000..2dc9a8b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/readme.txt @@ -0,0 +1,76 @@ + +Overview +======== + +This directory contains an update to the ZLib interface unit, +distributed by Borland as a Delphi supplemental component. + +The original ZLib unit is Copyright (c) 1997,99 Borland Corp., +and is based on zlib version 1.0.4. There are a series of bugs +and security problems associated with that old zlib version, and +we recommend the users to update their ZLib unit. + + +Summary of modifications +======================== + +- Improved makefile, adapted to zlib version 1.2.1. + +- Some field types from TZStreamRec are changed from Integer to + Longint, for consistency with the zlib.h header, and for 64-bit + readiness. + +- The zlib_version constant is updated. + +- The new Z_RLE strategy has its corresponding symbolic constant. + +- The allocation and deallocation functions and function types + (TAlloc, TFree, zlibAllocMem and zlibFreeMem) are now cdecl, + and _malloc and _free are added as C RTL stubs. As a result, + the original C sources of zlib can be compiled out of the box, + and linked to the ZLib unit. + + +Suggestions for improvements +============================ + +Currently, the ZLib unit provides only a limited wrapper around +the zlib library, and much of the original zlib functionality is +missing. Handling compressed file formats like ZIP/GZIP or PNG +cannot be implemented without having this functionality. +Applications that handle these formats are either using their own, +duplicated code, or not using the ZLib unit at all. + +Here are a few suggestions: + +- Checksum class wrappers around adler32() and crc32(), similar + to the Java classes that implement the java.util.zip.Checksum + interface. + +- The ability to read and write raw deflate streams, without the + zlib stream header and trailer. Raw deflate streams are used + in the ZIP file format. + +- The ability to read and write gzip streams, used in the GZIP + file format, and normally produced by the gzip program. + +- The ability to select a different compression strategy, useful + to PNG and MNG image compression, and to multimedia compression + in general. Besides the compression level + + TCompressionLevel = (clNone, clFastest, clDefault, clMax); + + which, in fact, could have used the 'z' prefix and avoided + TColor-like symbols + + TCompressionLevel = (zcNone, zcFastest, zcDefault, zcMax); + + there could be a compression strategy + + TCompressionStrategy = (zsDefault, zsFiltered, zsHuffmanOnly, zsRle); + +- ZIP and GZIP stream handling via TStreams. + + +-- +Cosmin Truta diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/delphi/zlibd32.mak b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/zlibd32.mak new file mode 100644 index 0000000..9bb00b7 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/delphi/zlibd32.mak @@ -0,0 +1,99 @@ +# Makefile for zlib +# For use with Delphi and C++ Builder under Win32 +# Updated for zlib 1.2.x by Cosmin Truta + +# ------------ Borland C++ ------------ + +# This project uses the Delphi (fastcall/register) calling convention: +LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl + +CC = bcc32 +LD = bcc32 +AR = tlib +# do not use "-pr" in CFLAGS +CFLAGS = -a -d -k- -O2 $(LOC) +LDFLAGS = + + +# variables +ZLIB_LIB = zlib.lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj +OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj +OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(CFLAGS) $*.c + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + + +# For the sake of the old Borland make, +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + $(AR) $(ZLIB_LIB) $(OBJP2) + + +# testing +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) + + +# cleanup +clean: + -del *.obj + -del *.exe + -del *.lib + -del *.tds + -del zlib.bak + -del foo.gz + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.build b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.build new file mode 100644 index 0000000..e69630c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.build @@ -0,0 +1,33 @@ + + + A .Net wrapper library around ZLib1.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.chm b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.chm new file mode 100644 index 0000000..f214a44 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.chm differ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.sln b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.sln new file mode 100644 index 0000000..5d533d6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotZLib", "DotZLib\DotZLib.csproj", "{BB1EE0B1-1808-46CB-B786-949D91117FC5}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.ActiveCfg = Debug|.NET + {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Debug.Build.0 = Debug|.NET + {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.ActiveCfg = Release|.NET + {BB1EE0B1-1808-46CB-B786-949D91117FC5}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/AssemblyInfo.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/AssemblyInfo.cs new file mode 100644 index 0000000..724c534 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/AssemblyInfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("DotZLib")] +[assembly: AssemblyDescription(".Net bindings for ZLib compression dll 1.2.x")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Henrik Ravn")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/ChecksumImpl.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/ChecksumImpl.cs new file mode 100644 index 0000000..b110dae --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/ChecksumImpl.cs @@ -0,0 +1,202 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Runtime.InteropServices; +using System.Text; + + +namespace DotZLib +{ + #region ChecksumGeneratorBase + /// + /// Implements the common functionality needed for all s + /// + /// + public abstract class ChecksumGeneratorBase : ChecksumGenerator + { + /// + /// The value of the current checksum + /// + protected uint _current; + + /// + /// Initializes a new instance of the checksum generator base - the current checksum is + /// set to zero + /// + public ChecksumGeneratorBase() + { + _current = 0; + } + + /// + /// Initializes a new instance of the checksum generator basewith a specified value + /// + /// The value to set the current checksum to + public ChecksumGeneratorBase(uint initialValue) + { + _current = initialValue; + } + + /// + /// Resets the current checksum to zero + /// + public void Reset() { _current = 0; } + + /// + /// Gets the current checksum value + /// + public uint Value { get { return _current; } } + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + /// All the other Update methods are implmeneted in terms of this one. + /// This is therefore the only method a derived class has to implement + public abstract void Update(byte[] data, int offset, int count); + + /// + /// Updates the current checksum with an array of bytes. + /// + /// The data to update the checksum with + public void Update(byte[] data) + { + Update(data, 0, data.Length); + } + + /// + /// Updates the current checksum with the data from a string + /// + /// The string to update the checksum with + /// The characters in the string are converted by the UTF-8 encoding + public void Update(string data) + { + Update(Encoding.UTF8.GetBytes(data)); + } + + /// + /// Updates the current checksum with the data from a string, using a specific encoding + /// + /// The string to update the checksum with + /// The encoding to use + public void Update(string data, Encoding encoding) + { + Update(encoding.GetBytes(data)); + } + + } + #endregion + + #region CRC32 + /// + /// Implements a CRC32 checksum generator + /// + public sealed class CRC32Checksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint crc32(uint crc, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the CRC32 checksum generator + /// + public CRC32Checksum() : base() {} + + /// + /// Initializes a new instance of the CRC32 checksum generator with a specified value + /// + /// The value to set the current checksum to + public CRC32Checksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = crc32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + + #region Adler + /// + /// Implements a checksum generator that computes the Adler checksum on data + /// + public sealed class AdlerChecksum : ChecksumGeneratorBase + { + #region DLL imports + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint adler32(uint adler, int data, uint length); + + #endregion + + /// + /// Initializes a new instance of the Adler checksum generator + /// + public AdlerChecksum() : base() {} + + /// + /// Initializes a new instance of the Adler checksum generator with a specified value + /// + /// The value to set the current checksum to + public AdlerChecksum(uint initialValue) : base(initialValue) {} + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + public override void Update(byte[] data, int offset, int count) + { + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned); + try + { + _current = adler32(_current, hData.AddrOfPinnedObject().ToInt32()+offset, (uint)count); + } + finally + { + hData.Free(); + } + } + + } + #endregion + +} \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CircularBuffer.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CircularBuffer.cs new file mode 100644 index 0000000..9c8d601 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CircularBuffer.cs @@ -0,0 +1,83 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; + +namespace DotZLib +{ + + /// + /// This class implements a circular buffer + /// + internal class CircularBuffer + { + #region Private data + private int _capacity; + private int _head; + private int _tail; + private int _size; + private byte[] _buffer; + #endregion + + public CircularBuffer(int capacity) + { + Debug.Assert( capacity > 0 ); + _buffer = new byte[capacity]; + _capacity = capacity; + _head = 0; + _tail = 0; + _size = 0; + } + + public int Size { get { return _size; } } + + public int Put(byte[] source, int offset, int count) + { + Debug.Assert( count > 0 ); + int trueCount = Math.Min(count, _capacity - Size); + for (int i = 0; i < trueCount; ++i) + _buffer[(_tail+i) % _capacity] = source[offset+i]; + _tail += trueCount; + _tail %= _capacity; + _size += trueCount; + return trueCount; + } + + public bool Put(byte b) + { + if (Size == _capacity) // no room + return false; + _buffer[_tail++] = b; + _tail %= _capacity; + ++_size; + return true; + } + + public int Get(byte[] destination, int offset, int count) + { + int trueCount = Math.Min(count,Size); + for (int i = 0; i < trueCount; ++i) + destination[offset + i] = _buffer[(_head+i) % _capacity]; + _head += trueCount; + _head %= _capacity; + _size -= trueCount; + return trueCount; + } + + public int Get() + { + if (Size == 0) + return -1; + + int result = (int)_buffer[_head++ % _capacity]; + --_size; + return result; + } + + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CodecBase.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CodecBase.cs new file mode 100644 index 0000000..b0eb78a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/CodecBase.cs @@ -0,0 +1,198 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + /// + /// Implements the common functionality needed for all s + /// + public abstract class CodecBase : Codec, IDisposable + { + + #region Data members + + /// + /// Instance of the internal zlib buffer structure that is + /// passed to all functions in the zlib dll + /// + internal ZStream _ztream = new ZStream(); + + /// + /// True if the object instance has been disposed, false otherwise + /// + protected bool _isDisposed = false; + + /// + /// The size of the internal buffers + /// + protected const int kBufferSize = 16384; + + private byte[] _outBuffer = new byte[kBufferSize]; + private byte[] _inBuffer = new byte[kBufferSize]; + + private GCHandle _hInput; + private GCHandle _hOutput; + + private uint _checksum = 0; + + #endregion + + /// + /// Initializes a new instance of the CodeBase class. + /// + public CodecBase() + { + try + { + _hInput = GCHandle.Alloc(_inBuffer, GCHandleType.Pinned); + _hOutput = GCHandle.Alloc(_outBuffer, GCHandleType.Pinned); + } + catch (Exception) + { + CleanUp(false); + throw; + } + } + + + #region Codec Members + + /// + /// Occurs when more processed data are available. + /// + public event DataAvailableHandler DataAvailable; + + /// + /// Fires the event + /// + protected void OnDataAvailable() + { + if (_ztream.total_out > 0) + { + if (DataAvailable != null) + DataAvailable( _outBuffer, 0, (int)_ztream.total_out); + resetOutput(); + } + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// Adding data may, or may not, raise the DataAvailable event + public void Add(byte[] data) + { + Add(data,0,data.Length); + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + /// This must be implemented by a derived class + public abstract void Add(byte[] data, int offset, int count); + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + /// This must be implemented by a derived class + public abstract void Finish(); + + /// + /// Gets the checksum of the data that has been added so far + /// + public uint Checksum { get { return _checksum; } } + + #endregion + + #region Destructor & IDisposable stuff + + /// + /// Destroys this instance + /// + ~CodecBase() + { + CleanUp(false); + } + + /// + /// Releases any unmanaged resources and calls the method of the derived class + /// + public void Dispose() + { + CleanUp(true); + } + + /// + /// Performs any codec specific cleanup + /// + /// This must be implemented by a derived class + protected abstract void CleanUp(); + + // performs the release of the handles and calls the dereived CleanUp() + private void CleanUp(bool isDisposing) + { + if (!_isDisposed) + { + CleanUp(); + if (_hInput.IsAllocated) + _hInput.Free(); + if (_hOutput.IsAllocated) + _hOutput.Free(); + + _isDisposed = true; + } + } + + + #endregion + + #region Helper methods + + /// + /// Copies a number of bytes to the internal codec buffer - ready for proccesing + /// + /// The byte array that contains the data to copy + /// The index of the first byte to copy + /// The number of bytes to copy from data + protected void copyInput(byte[] data, int startIndex, int count) + { + Array.Copy(data, startIndex, _inBuffer,0, count); + _ztream.next_in = _hInput.AddrOfPinnedObject(); + _ztream.total_in = 0; + _ztream.avail_in = (uint)count; + + } + + /// + /// Resets the internal output buffers to a known state - ready for processing + /// + protected void resetOutput() + { + _ztream.total_out = 0; + _ztream.avail_out = kBufferSize; + _ztream.next_out = _hOutput.AddrOfPinnedObject(); + } + + /// + /// Updates the running checksum property + /// + /// The new checksum value + protected void setChecksum(uint newSum) + { + _checksum = newSum; + } + #endregion + + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Deflater.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Deflater.cs new file mode 100644 index 0000000..9039f41 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Deflater.cs @@ -0,0 +1,106 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + + /// + /// Implements a data compressor, using the deflate algorithm in the ZLib dll + /// + public sealed class Deflater : CodecBase + { + #region Dll imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] + private static extern int deflateInit_(ref ZStream sz, int level, string vs, int size); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflate(ref ZStream sz, int flush); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflateReset(ref ZStream sz); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int deflateEnd(ref ZStream sz); + #endregion + + /// + /// Constructs an new instance of the Deflater + /// + /// The compression level to use for this Deflater + public Deflater(CompressLevel level) : base() + { + int retval = deflateInit_(ref _ztream, (int)level, Info.Version, Marshal.SizeOf(_ztream)); + if (retval != 0) + throw new ZLibException(retval, "Could not initialize deflater"); + + resetOutput(); + } + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + public override void Add(byte[] data, int offset, int count) + { + if (data == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + + int total = count; + int inputIndex = offset; + int err = 0; + + while (err >= 0 && inputIndex < total) + { + copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); + while (err >= 0 && _ztream.avail_in > 0) + { + err = deflate(ref _ztream, (int)FlushTypes.None); + if (err == 0) + while (_ztream.avail_out == 0) + { + OnDataAvailable(); + err = deflate(ref _ztream, (int)FlushTypes.None); + } + inputIndex += (int)_ztream.total_in; + } + } + setChecksum( _ztream.adler ); + } + + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + public override void Finish() + { + int err; + do + { + err = deflate(ref _ztream, (int)FlushTypes.Finish); + OnDataAvailable(); + } + while (err == 0); + setChecksum( _ztream.adler ); + deflateReset(ref _ztream); + resetOutput(); + } + + /// + /// Closes the internal zlib deflate stream + /// + protected override void CleanUp() { deflateEnd(ref _ztream); } + + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.cs new file mode 100644 index 0000000..90c7c3b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.cs @@ -0,0 +1,288 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + + +namespace DotZLib +{ + + #region Internal types + + /// + /// Defines constants for the various flush types used with zlib + /// + internal enum FlushTypes + { + None, Partial, Sync, Full, Finish, Block + } + + #region ZStream structure + // internal mapping of the zlib zstream structure for marshalling + [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Ansi)] + internal struct ZStream + { + public IntPtr next_in; + public uint avail_in; + public uint total_in; + + public IntPtr next_out; + public uint avail_out; + public uint total_out; + + [MarshalAs(UnmanagedType.LPStr)] + string msg; + uint state; + + uint zalloc; + uint zfree; + uint opaque; + + int data_type; + public uint adler; + uint reserved; + } + + #endregion + + #endregion + + #region Public enums + /// + /// Defines constants for the available compression levels in zlib + /// + public enum CompressLevel : int + { + /// + /// The default compression level with a reasonable compromise between compression and speed + /// + Default = -1, + /// + /// No compression at all. The data are passed straight through. + /// + None = 0, + /// + /// The maximum compression rate available. + /// + Best = 9, + /// + /// The fastest available compression level. + /// + Fastest = 1 + } + #endregion + + #region Exception classes + /// + /// The exception that is thrown when an error occurs on the zlib dll + /// + public class ZLibException : ApplicationException + { + /// + /// Initializes a new instance of the class with a specified + /// error message and error code + /// + /// The zlib error code that caused the exception + /// A message that (hopefully) describes the error + public ZLibException(int errorCode, string msg) : base(String.Format("ZLib error {0} {1}", errorCode, msg)) + { + } + + /// + /// Initializes a new instance of the class with a specified + /// error code + /// + /// The zlib error code that caused the exception + public ZLibException(int errorCode) : base(String.Format("ZLib error {0}", errorCode)) + { + } + } + #endregion + + #region Interfaces + + /// + /// Declares methods and properties that enables a running checksum to be calculated + /// + public interface ChecksumGenerator + { + /// + /// Gets the current value of the checksum + /// + uint Value { get; } + + /// + /// Clears the current checksum to 0 + /// + void Reset(); + + /// + /// Updates the current checksum with an array of bytes + /// + /// The data to update the checksum with + void Update(byte[] data); + + /// + /// Updates the current checksum with part of an array of bytes + /// + /// The data to update the checksum with + /// Where in data to start updating + /// The number of bytes from data to use + /// The sum of offset and count is larger than the length of data + /// data is a null reference + /// Offset or count is negative. + void Update(byte[] data, int offset, int count); + + /// + /// Updates the current checksum with the data from a string + /// + /// The string to update the checksum with + /// The characters in the string are converted by the UTF-8 encoding + void Update(string data); + + /// + /// Updates the current checksum with the data from a string, using a specific encoding + /// + /// The string to update the checksum with + /// The encoding to use + void Update(string data, Encoding encoding); + } + + + /// + /// Represents the method that will be called from a codec when new data + /// are available. + /// + /// The byte array containing the processed data + /// The index of the first processed byte in data + /// The number of processed bytes available + /// On return from this method, the data may be overwritten, so grab it while you can. + /// You cannot assume that startIndex will be zero. + /// + public delegate void DataAvailableHandler(byte[] data, int startIndex, int count); + + /// + /// Declares methods and events for implementing compressors/decompressors + /// + public interface Codec + { + /// + /// Occurs when more processed data are available. + /// + event DataAvailableHandler DataAvailable; + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// Adding data may, or may not, raise the DataAvailable event + void Add(byte[] data); + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + void Add(byte[] data, int offset, int count); + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + void Finish(); + + /// + /// Gets the checksum of the data that has been added so far + /// + uint Checksum { get; } + + + } + + #endregion + + #region Classes + /// + /// Encapsulates general information about the ZLib library + /// + public class Info + { + #region DLL imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern uint zlibCompileFlags(); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern string zlibVersion(); + #endregion + + #region Private stuff + private uint _flags; + + // helper function that unpacks a bitsize mask + private static int bitSize(uint bits) + { + switch (bits) + { + case 0: return 16; + case 1: return 32; + case 2: return 64; + } + return -1; + } + #endregion + + /// + /// Constructs an instance of the Info class. + /// + public Info() + { + _flags = zlibCompileFlags(); + } + + /// + /// True if the library is compiled with debug info + /// + public bool HasDebugInfo { get { return 0 != (_flags & 0x100); } } + + /// + /// True if the library is compiled with assembly optimizations + /// + public bool UsesAssemblyCode { get { return 0 != (_flags & 0x200); } } + + /// + /// Gets the size of the unsigned int that was compiled into Zlib + /// + public int SizeOfUInt { get { return bitSize(_flags & 3); } } + + /// + /// Gets the size of the unsigned long that was compiled into Zlib + /// + public int SizeOfULong { get { return bitSize((_flags >> 2) & 3); } } + + /// + /// Gets the size of the pointers that were compiled into Zlib + /// + public int SizeOfPointer { get { return bitSize((_flags >> 4) & 3); } } + + /// + /// Gets the size of the z_off_t type that was compiled into Zlib + /// + public int SizeOfOffset { get { return bitSize((_flags >> 6) & 3); } } + + /// + /// Gets the version of ZLib as a string, e.g. "1.2.1" + /// + public static string Version { get { return zlibVersion(); } } + } + + #endregion + +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.csproj b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.csproj new file mode 100644 index 0000000..dea7fb1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/DotZLib.csproj @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/GZipStream.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/GZipStream.cs new file mode 100644 index 0000000..f0eada1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/GZipStream.cs @@ -0,0 +1,301 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + /// + /// Implements a compressed , in GZip (.gz) format. + /// + public class GZipStream : Stream, IDisposable + { + #region Dll Imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] + private static extern IntPtr gzopen(string name, string mode); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int gzclose(IntPtr gzFile); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int gzwrite(IntPtr gzFile, int data, int length); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int gzread(IntPtr gzFile, int data, int length); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int gzgetc(IntPtr gzFile); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int gzputc(IntPtr gzFile, int c); + + #endregion + + #region Private data + private IntPtr _gzFile; + private bool _isDisposed = false; + private bool _isWriting; + #endregion + + #region Constructors + /// + /// Creates a new file as a writeable GZipStream + /// + /// The name of the compressed file to create + /// The compression level to use when adding data + /// If an error occurred in the internal zlib function + public GZipStream(string fileName, CompressLevel level) + { + _isWriting = true; + _gzFile = gzopen(fileName, String.Format("wb{0}", (int)level)); + if (_gzFile == IntPtr.Zero) + throw new ZLibException(-1, "Could not open " + fileName); + } + + /// + /// Opens an existing file as a readable GZipStream + /// + /// The name of the file to open + /// If an error occurred in the internal zlib function + public GZipStream(string fileName) + { + _isWriting = false; + _gzFile = gzopen(fileName, "rb"); + if (_gzFile == IntPtr.Zero) + throw new ZLibException(-1, "Could not open " + fileName); + + } + #endregion + + #region Access properties + /// + /// Returns true of this stream can be read from, false otherwise + /// + public override bool CanRead + { + get + { + return !_isWriting; + } + } + + + /// + /// Returns false. + /// + public override bool CanSeek + { + get + { + return false; + } + } + + /// + /// Returns true if this tsream is writeable, false otherwise + /// + public override bool CanWrite + { + get + { + return _isWriting; + } + } + #endregion + + #region Destructor & IDispose stuff + + /// + /// Destroys this instance + /// + ~GZipStream() + { + cleanUp(false); + } + + /// + /// Closes the external file handle + /// + public void Dispose() + { + cleanUp(true); + } + + // Does the actual closing of the file handle. + private void cleanUp(bool isDisposing) + { + if (!_isDisposed) + { + gzclose(_gzFile); + _isDisposed = true; + } + } + #endregion + + #region Basic reading and writing + /// + /// Attempts to read a number of bytes from the stream. + /// + /// The destination data buffer + /// The index of the first destination byte in buffer + /// The number of bytes requested + /// The number of bytes read + /// If buffer is null + /// If count or offset are negative + /// If offset + count is > buffer.Length + /// If this stream is not readable. + /// If this stream has been disposed. + public override int Read(byte[] buffer, int offset, int count) + { + if (!CanRead) throw new NotSupportedException(); + if (buffer == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > buffer.Length) throw new ArgumentException(); + if (_isDisposed) throw new ObjectDisposedException("GZipStream"); + + GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned); + int result; + try + { + result = gzread(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count); + if (result < 0) + throw new IOException(); + } + finally + { + h.Free(); + } + return result; + } + + /// + /// Attempts to read a single byte from the stream. + /// + /// The byte that was read, or -1 in case of error or End-Of-File + public override int ReadByte() + { + if (!CanRead) throw new NotSupportedException(); + if (_isDisposed) throw new ObjectDisposedException("GZipStream"); + return gzgetc(_gzFile); + } + + /// + /// Writes a number of bytes to the stream + /// + /// + /// + /// + /// If buffer is null + /// If count or offset are negative + /// If offset + count is > buffer.Length + /// If this stream is not writeable. + /// If this stream has been disposed. + public override void Write(byte[] buffer, int offset, int count) + { + if (!CanWrite) throw new NotSupportedException(); + if (buffer == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > buffer.Length) throw new ArgumentException(); + if (_isDisposed) throw new ObjectDisposedException("GZipStream"); + + GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned); + try + { + int result = gzwrite(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count); + if (result < 0) + throw new IOException(); + } + finally + { + h.Free(); + } + } + + /// + /// Writes a single byte to the stream + /// + /// The byte to add to the stream. + /// If this stream is not writeable. + /// If this stream has been disposed. + public override void WriteByte(byte value) + { + if (!CanWrite) throw new NotSupportedException(); + if (_isDisposed) throw new ObjectDisposedException("GZipStream"); + + int result = gzputc(_gzFile, (int)value); + if (result < 0) + throw new IOException(); + } + #endregion + + #region Position & length stuff + /// + /// Not supported. + /// + /// + /// Always thrown + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + /// + /// Not suppported. + /// + /// + /// + /// + /// Always thrown + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// Flushes the GZipStream. + /// + /// In this implementation, this method does nothing. This is because excessive + /// flushing may degrade the achievable compression rates. + public override void Flush() + { + // left empty on purpose + } + + /// + /// Gets/sets the current position in the GZipStream. Not suppported. + /// + /// In this implementation this property is not supported + /// Always thrown + public override long Position + { + get + { + throw new NotSupportedException(); + } + set + { + throw new NotSupportedException(); + } + } + + /// + /// Gets the size of the stream. Not suppported. + /// + /// In this implementation this property is not supported + /// Always thrown + public override long Length + { + get + { + throw new NotSupportedException(); + } + } + #endregion + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Inflater.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Inflater.cs new file mode 100644 index 0000000..d295f26 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/Inflater.cs @@ -0,0 +1,105 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace DotZLib +{ + + /// + /// Implements a data decompressor, using the inflate algorithm in the ZLib dll + /// + public class Inflater : CodecBase + { + #region Dll imports + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)] + private static extern int inflateInit_(ref ZStream sz, string vs, int size); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflate(ref ZStream sz, int flush); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflateReset(ref ZStream sz); + + [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)] + private static extern int inflateEnd(ref ZStream sz); + #endregion + + /// + /// Constructs an new instance of the Inflater + /// + public Inflater() : base() + { + int retval = inflateInit_(ref _ztream, Info.Version, Marshal.SizeOf(_ztream)); + if (retval != 0) + throw new ZLibException(retval, "Could not initialize inflater"); + + resetOutput(); + } + + + /// + /// Adds more data to the codec to be processed. + /// + /// Byte array containing the data to be added to the codec + /// The index of the first byte to add from data + /// The number of bytes to add + /// Adding data may, or may not, raise the DataAvailable event + public override void Add(byte[] data, int offset, int count) + { + if (data == null) throw new ArgumentNullException(); + if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); + if ((offset+count) > data.Length) throw new ArgumentException(); + + int total = count; + int inputIndex = offset; + int err = 0; + + while (err >= 0 && inputIndex < total) + { + copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize)); + err = inflate(ref _ztream, (int)FlushTypes.None); + if (err == 0) + while (_ztream.avail_out == 0) + { + OnDataAvailable(); + err = inflate(ref _ztream, (int)FlushTypes.None); + } + + inputIndex += (int)_ztream.total_in; + } + setChecksum( _ztream.adler ); + } + + + /// + /// Finishes up any pending data that needs to be processed and handled. + /// + public override void Finish() + { + int err; + do + { + err = inflate(ref _ztream, (int)FlushTypes.Finish); + OnDataAvailable(); + } + while (err == 0); + setChecksum( _ztream.adler ); + inflateReset(ref _ztream); + resetOutput(); + } + + /// + /// Closes the internal zlib inflate stream + /// + protected override void CleanUp() { inflateEnd(ref _ztream); } + + + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/UnitTests.cs b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/UnitTests.cs new file mode 100644 index 0000000..24c6399 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/DotZLib/UnitTests.cs @@ -0,0 +1,274 @@ +// +// � Copyright Henrik Ravn 2004 +// +// Use, modification and distribution are subject to the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +using System; +using System.Collections; +using System.IO; + +// uncomment the define below to include unit tests +//#define nunit +#if nunit +using NUnit.Framework; + +// Unit tests for the DotZLib class library +// ---------------------------------------- +// +// Use this with NUnit 2 from http://www.nunit.org +// + +namespace DotZLibTests +{ + using DotZLib; + + // helper methods + internal class Utils + { + public static bool byteArrEqual( byte[] lhs, byte[] rhs ) + { + if (lhs.Length != rhs.Length) + return false; + for (int i = lhs.Length-1; i >= 0; --i) + if (lhs[i] != rhs[i]) + return false; + return true; + } + + } + + + [TestFixture] + public class CircBufferTests + { + #region Circular buffer tests + [Test] + public void SinglePutGet() + { + CircularBuffer buf = new CircularBuffer(10); + Assert.AreEqual( 0, buf.Size ); + Assert.AreEqual( -1, buf.Get() ); + + Assert.IsTrue(buf.Put( 1 )); + Assert.AreEqual( 1, buf.Size ); + Assert.AreEqual( 1, buf.Get() ); + Assert.AreEqual( 0, buf.Size ); + Assert.AreEqual( -1, buf.Get() ); + } + + [Test] + public void BlockPutGet() + { + CircularBuffer buf = new CircularBuffer(10); + byte[] arr = {1,2,3,4,5,6,7,8,9,10}; + Assert.AreEqual( 10, buf.Put(arr,0,10) ); + Assert.AreEqual( 10, buf.Size ); + Assert.IsFalse( buf.Put(11) ); + Assert.AreEqual( 1, buf.Get() ); + Assert.IsTrue( buf.Put(11) ); + + byte[] arr2 = (byte[])arr.Clone(); + Assert.AreEqual( 9, buf.Get(arr2,1,9) ); + Assert.IsTrue( Utils.byteArrEqual(arr,arr2) ); + } + + #endregion + } + + [TestFixture] + public class ChecksumTests + { + #region CRC32 Tests + [Test] + public void CRC32_Null() + { + CRC32Checksum crc32 = new CRC32Checksum(); + Assert.AreEqual( 0, crc32.Value ); + + crc32 = new CRC32Checksum(1); + Assert.AreEqual( 1, crc32.Value ); + + crc32 = new CRC32Checksum(556); + Assert.AreEqual( 556, crc32.Value ); + } + + [Test] + public void CRC32_Data() + { + CRC32Checksum crc32 = new CRC32Checksum(); + byte[] data = { 1,2,3,4,5,6,7 }; + crc32.Update(data); + Assert.AreEqual( 0x70e46888, crc32.Value ); + + crc32 = new CRC32Checksum(); + crc32.Update("penguin"); + Assert.AreEqual( 0x0e5c1a120, crc32.Value ); + + crc32 = new CRC32Checksum(1); + crc32.Update("penguin"); + Assert.AreEqual(0x43b6aa94, crc32.Value); + + } + #endregion + + #region Adler tests + + [Test] + public void Adler_Null() + { + AdlerChecksum adler = new AdlerChecksum(); + Assert.AreEqual(0, adler.Value); + + adler = new AdlerChecksum(1); + Assert.AreEqual( 1, adler.Value ); + + adler = new AdlerChecksum(556); + Assert.AreEqual( 556, adler.Value ); + } + + [Test] + public void Adler_Data() + { + AdlerChecksum adler = new AdlerChecksum(1); + byte[] data = { 1,2,3,4,5,6,7 }; + adler.Update(data); + Assert.AreEqual( 0x5b001d, adler.Value ); + + adler = new AdlerChecksum(); + adler.Update("penguin"); + Assert.AreEqual(0x0bcf02f6, adler.Value ); + + adler = new AdlerChecksum(1); + adler.Update("penguin"); + Assert.AreEqual(0x0bd602f7, adler.Value); + + } + #endregion + } + + [TestFixture] + public class InfoTests + { + #region Info tests + [Test] + public void Info_Version() + { + Info info = new Info(); + Assert.AreEqual("1.2.7", Info.Version); + Assert.AreEqual(32, info.SizeOfUInt); + Assert.AreEqual(32, info.SizeOfULong); + Assert.AreEqual(32, info.SizeOfPointer); + Assert.AreEqual(32, info.SizeOfOffset); + } + #endregion + } + + [TestFixture] + public class DeflateInflateTests + { + #region Deflate tests + [Test] + public void Deflate_Init() + { + using (Deflater def = new Deflater(CompressLevel.Default)) + { + } + } + + private ArrayList compressedData = new ArrayList(); + private uint adler1; + + private ArrayList uncompressedData = new ArrayList(); + private uint adler2; + + public void CDataAvail(byte[] data, int startIndex, int count) + { + for (int i = 0; i < count; ++i) + compressedData.Add(data[i+startIndex]); + } + + [Test] + public void Deflate_Compress() + { + compressedData.Clear(); + + byte[] testData = new byte[35000]; + for (int i = 0; i < testData.Length; ++i) + testData[i] = 5; + + using (Deflater def = new Deflater((CompressLevel)5)) + { + def.DataAvailable += new DataAvailableHandler(CDataAvail); + def.Add(testData); + def.Finish(); + adler1 = def.Checksum; + } + } + #endregion + + #region Inflate tests + [Test] + public void Inflate_Init() + { + using (Inflater inf = new Inflater()) + { + } + } + + private void DDataAvail(byte[] data, int startIndex, int count) + { + for (int i = 0; i < count; ++i) + uncompressedData.Add(data[i+startIndex]); + } + + [Test] + public void Inflate_Expand() + { + uncompressedData.Clear(); + + using (Inflater inf = new Inflater()) + { + inf.DataAvailable += new DataAvailableHandler(DDataAvail); + inf.Add((byte[])compressedData.ToArray(typeof(byte))); + inf.Finish(); + adler2 = inf.Checksum; + } + Assert.AreEqual( adler1, adler2 ); + } + #endregion + } + + [TestFixture] + public class GZipStreamTests + { + #region GZipStream test + [Test] + public void GZipStream_WriteRead() + { + using (GZipStream gzOut = new GZipStream("gzstream.gz", CompressLevel.Best)) + { + BinaryWriter writer = new BinaryWriter(gzOut); + writer.Write("hi there"); + writer.Write(Math.PI); + writer.Write(42); + } + + using (GZipStream gzIn = new GZipStream("gzstream.gz")) + { + BinaryReader reader = new BinaryReader(gzIn); + string s = reader.ReadString(); + Assert.AreEqual("hi there",s); + double d = reader.ReadDouble(); + Assert.AreEqual(Math.PI, d); + int i = reader.ReadInt32(); + Assert.AreEqual(42,i); + } + + } + #endregion + } +} + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/LICENSE_1_0.txt b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/LICENSE_1_0.txt new file mode 100644 index 0000000..127a5bc --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/LICENSE_1_0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/readme.txt new file mode 100644 index 0000000..4d8c2dd --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/dotzlib/readme.txt @@ -0,0 +1,58 @@ +This directory contains a .Net wrapper class library for the ZLib1.dll + +The wrapper includes support for inflating/deflating memory buffers, +.Net streaming wrappers for the gz streams part of zlib, and wrappers +for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. + +Directory structure: +-------------------- + +LICENSE_1_0.txt - License file. +readme.txt - This file. +DotZLib.chm - Class library documentation +DotZLib.build - NAnt build file +DotZLib.sln - Microsoft Visual Studio 2003 solution file + +DotZLib\*.cs - Source files for the class library + +Unit tests: +----------- +The file DotZLib/UnitTests.cs contains unit tests for use with NUnit 2.1 or higher. +To include unit tests in the build, define nunit before building. + + +Build instructions: +------------------- + +1. Using Visual Studio.Net 2003: + Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) + will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on + you are building the release or debug version of the library. Check + DotZLib/UnitTests.cs for instructions on how to include unit tests in the + build. + +2. Using NAnt: + Open a command prompt with access to the build environment and run nant + in the same directory as the DotZLib.build file. + You can define 2 properties on the nant command-line to control the build: + debug={true|false} to toggle between release/debug builds (default=true). + nunit={true|false} to include or esclude unit tests (default=true). + Also the target clean will remove binaries. + Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release + or ./DotZLib/bin/debug, depending on whether you are building the release + or debug version of the library. + + Examples: + nant -D:debug=false -D:nunit=false + will build a release mode version of the library without unit tests. + nant + will build a debug version of the library with unit tests + nant clean + will remove all previously built files. + + +--------------------------------- +Copyright (c) Henrik Ravn 2004 + +Use, modification and distribution are subject to the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/gcc_gvmat64/gvmat64.S b/thirdparty/zlib/zlib-1.2.7/contrib/gcc_gvmat64/gvmat64.S new file mode 100644 index 0000000..23309fa --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/gcc_gvmat64/gvmat64.S @@ -0,0 +1,574 @@ +/* +;uInt longest_match_x64( +; deflate_state *s, +; IPos cur_match); // current match + +; gvmat64.S -- Asm portion of the optimized longest_match for 32 bits x86_64 +; (AMD64 on Athlon 64, Opteron, Phenom +; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) +; this file is translation from gvmat64.asm to GCC 4.x (for Linux, Mac XCode) +; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; +; File written by Gilles Vollant, by converting to assembly the longest_match +; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. +; and by taking inspiration on asm686 with masm, optimised assembly code +; from Brian Raiter, written 1998 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software +; 3. This notice may not be removed or altered from any source distribution. +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; to compile this file for zLib, I use option: +; gcc -c -arch x86_64 gvmat64.S + + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; // current match / +; +; with XCode for Mac, I had strange error with some jump on intel syntax +; this is why BEFORE_JMP and AFTER_JMP are used + */ + + +#define BEFORE_JMP .att_syntax +#define AFTER_JMP .intel_syntax noprefix + +#ifndef NO_UNDERLINE +# define match_init _match_init +# define longest_match _longest_match +#endif + +.intel_syntax noprefix + +.globl match_init, longest_match +.text +longest_match: + + + +#define LocalVarsSize 96 +/* +; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 +; free register : r14,r15 +; register can be saved : rsp +*/ + +#define chainlenwmask (rsp + 8 - LocalVarsSize) +#define nicematch (rsp + 16 - LocalVarsSize) + +#define save_rdi (rsp + 24 - LocalVarsSize) +#define save_rsi (rsp + 32 - LocalVarsSize) +#define save_rbx (rsp + 40 - LocalVarsSize) +#define save_rbp (rsp + 48 - LocalVarsSize) +#define save_r12 (rsp + 56 - LocalVarsSize) +#define save_r13 (rsp + 64 - LocalVarsSize) +#define save_r14 (rsp + 72 - LocalVarsSize) +#define save_r15 (rsp + 80 - LocalVarsSize) + + +/* +; all the +4 offsets are due to the addition of pending_buf_size (in zlib +; in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, remove the +4). +; Note : these value are good with a 8 bytes boundary pack structure +*/ + +#define MAX_MATCH 258 +#define MIN_MATCH 3 +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) + +/* +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). +*/ + + + +/* you can check the structure offset by running + +#include +#include +#include "deflate.h" + +void print_depl() +{ +deflate_state ds; +deflate_state *s=&ds; +printf("size pointer=%u\n",(int)sizeof(void*)); + +printf("#define dsWSize %u\n",(int)(((char*)&(s->w_size))-((char*)s))); +printf("#define dsWMask %u\n",(int)(((char*)&(s->w_mask))-((char*)s))); +printf("#define dsWindow %u\n",(int)(((char*)&(s->window))-((char*)s))); +printf("#define dsPrev %u\n",(int)(((char*)&(s->prev))-((char*)s))); +printf("#define dsMatchLen %u\n",(int)(((char*)&(s->match_length))-((char*)s))); +printf("#define dsPrevMatch %u\n",(int)(((char*)&(s->prev_match))-((char*)s))); +printf("#define dsStrStart %u\n",(int)(((char*)&(s->strstart))-((char*)s))); +printf("#define dsMatchStart %u\n",(int)(((char*)&(s->match_start))-((char*)s))); +printf("#define dsLookahead %u\n",(int)(((char*)&(s->lookahead))-((char*)s))); +printf("#define dsPrevLen %u\n",(int)(((char*)&(s->prev_length))-((char*)s))); +printf("#define dsMaxChainLen %u\n",(int)(((char*)&(s->max_chain_length))-((char*)s))); +printf("#define dsGoodMatch %u\n",(int)(((char*)&(s->good_match))-((char*)s))); +printf("#define dsNiceMatch %u\n",(int)(((char*)&(s->nice_match))-((char*)s))); +} +*/ + +#define dsWSize 68 +#define dsWMask 76 +#define dsWindow 80 +#define dsPrev 96 +#define dsMatchLen 144 +#define dsPrevMatch 148 +#define dsStrStart 156 +#define dsMatchStart 160 +#define dsLookahead 164 +#define dsPrevLen 168 +#define dsMaxChainLen 172 +#define dsGoodMatch 188 +#define dsNiceMatch 192 + +#define window_size [ rcx + dsWSize] +#define WMask [ rcx + dsWMask] +#define window_ad [ rcx + dsWindow] +#define prev_ad [ rcx + dsPrev] +#define strstart [ rcx + dsStrStart] +#define match_start [ rcx + dsMatchStart] +#define Lookahead [ rcx + dsLookahead] //; 0ffffffffh on infozip +#define prev_length [ rcx + dsPrevLen] +#define max_chain_length [ rcx + dsMaxChainLen] +#define good_match [ rcx + dsGoodMatch] +#define nice_match [ rcx + dsNiceMatch] + +/* +; windows: +; parameter 1 in rcx(deflate state s), param 2 in rdx (cur match) + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. + +; +; gcc on macosx-linux: +; see http://www.x86-64.org/documentation/abi-0.99.pdf +; param 1 in rdi, param 2 in rsi +; rbx, rsp, rbp, r12 to r15 must be preserved + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + +;;; Retrieve the function arguments. r8d will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + +; ms: parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) +; mac: param 1 in rdi, param 2 rsi +; this clear high 32 bits of r8, which can be garbage in both r8 and rdx +*/ + mov [save_rbx],rbx + mov [save_rbp],rbp + + + mov rcx,rdi + + mov r8d,esi + + + mov [save_r12],r12 + mov [save_r13],r13 + mov [save_r14],r14 + mov [save_r15],r15 + + +//;;; uInt wmask = s->w_mask; +//;;; unsigned chain_length = s->max_chain_length; +//;;; if (s->prev_length >= s->good_match) { +//;;; chain_length >>= 2; +//;;; } + + + mov edi, prev_length + mov esi, good_match + mov eax, WMask + mov ebx, max_chain_length + cmp edi, esi + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +//;;; chainlen is decremented once beforehand so that the function can +//;;; use the sign flag instead of the zero flag for the exit test. +//;;; It is then shifted into the high word, to make room for the wmask +//;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + +//;;; on zlib only +//;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + + + mov eax, nice_match + mov [chainlenwmask], ebx + mov r10d, Lookahead + cmp r10d, eax + cmovnl r10d, eax + mov [nicematch],r10d + + + +//;;; register Bytef *scan = s->window + s->strstart; + mov r10, window_ad + mov ebp, strstart + lea r13, [r10 + rbp] + +//;;; Determine how many bytes the scan ptr is off from being +//;;; dword-aligned. + + mov r9,r13 + neg r13 + and r13,3 + +//;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +//;;; s->strstart - (IPos)MAX_DIST(s) : NIL; + + + mov eax, window_size + sub eax, MIN_LOOKAHEAD + + + xor edi,edi + sub ebp, eax + + mov r11d, prev_length + + cmovng ebp,edi + +//;;; int best_len = s->prev_length; + + +//;;; Store the sum of s->window + best_len in esi locally, and in esi. + + lea rsi,[r10+r11] + +//;;; register ush scan_start = *(ushf*)scan; +//;;; register ush scan_end = *(ushf*)(scan+best_len-1); +//;;; Posf *prev = s->prev; + + movzx r12d,word ptr [r9] + movzx ebx, word ptr [r9 + r11 - 1] + + mov rdi, prev_ad + +//;;; Jump into the main loop. + + mov edx, [chainlenwmask] + + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + + + +LookupLoop1: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + + + + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry1: + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jz LookupLoopIsZero + AFTER_JMP + +LookupLoop2: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry2: + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jz LookupLoopIsZero + AFTER_JMP + +LookupLoop4: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry4: + + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jnz LookupLoop1 + jmp LookupLoopIsZero + AFTER_JMP +/* +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; r8d = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit +*/ +.balign 16 +LookupLoop: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + BEFORE_JMP + jbe LeaveNow + AFTER_JMP + sub edx, 0x00010000 + BEFORE_JMP + js LeaveNow + AFTER_JMP + +LoopEntry: + + cmp bx,word ptr [rsi + r8 - 1] + BEFORE_JMP + jnz LookupLoop1 + AFTER_JMP +LookupLoopIsZero: + cmp r12w, word ptr [r10 + r8] + BEFORE_JMP + jnz LookupLoop1 + AFTER_JMP + + +//;;; Store the current value of chainlen. + mov [chainlenwmask], edx +/* +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). +*/ + lea rsi,[r8+r10] + mov rdx, 0xfffffffffffffef8 //; -(MAX_MATCH_8) + lea rsi, [rsi + r13 + 0x0108] //;MAX_MATCH_8] + lea rdi, [r9 + r13 + 0x0108] //;MAX_MATCH_8] + + prefetcht1 [rsi+rdx] + prefetcht1 [rdi+rdx] + +/* +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust rdx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (rsi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. +*/ + +LoopCmps: + mov rax, [rsi + rdx] + xor rax, [rdi + rdx] + jnz LeaveLoopCmps + + mov rax, [rsi + rdx + 8] + xor rax, [rdi + rdx + 8] + jnz LeaveLoopCmps8 + + + mov rax, [rsi + rdx + 8+8] + xor rax, [rdi + rdx + 8+8] + jnz LeaveLoopCmps16 + + add rdx,8+8+8 + + BEFORE_JMP + jnz LoopCmps + jmp LenMaximum + AFTER_JMP + +LeaveLoopCmps16: add rdx,8 +LeaveLoopCmps8: add rdx,8 +LeaveLoopCmps: + + test eax, 0x0000FFFF + jnz LenLower + + test eax,0xffffffff + + jnz LenLower32 + + add rdx,4 + shr rax,32 + or ax,ax + BEFORE_JMP + jnz LenLower + AFTER_JMP + +LenLower32: + shr eax,16 + add rdx,2 + +LenLower: + sub al, 1 + adc rdx, 0 +//;;; Calculate the length of the match. If it is longer than MAX_MATCH, +//;;; then automatically accept it as the best possible match and leave. + + lea rax, [rdi + rdx] + sub rax, r9 + cmp eax, MAX_MATCH + BEFORE_JMP + jge LenMaximum + AFTER_JMP +/* +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. +;/////////////////////////////////// +*/ + cmp eax, r11d + jg LongerMatch + + lea rsi,[r10+r11] + + mov rdi, prev_ad + mov edx, [chainlenwmask] + BEFORE_JMP + jmp LookupLoop + AFTER_JMP +/* +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); +*/ +LongerMatch: + mov r11d, eax + mov match_start, r8d + cmp eax, [nicematch] + BEFORE_JMP + jge LeaveNow + AFTER_JMP + + lea rsi,[r10+rax] + + movzx ebx, word ptr [r9 + rax - 1] + mov rdi, prev_ad + mov edx, [chainlenwmask] + BEFORE_JMP + jmp LookupLoop + AFTER_JMP + +//;;; Accept the current string, with the maximum possible length. + +LenMaximum: + mov r11d,MAX_MATCH + mov match_start, r8d + +//;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +//;;; return s->lookahead; + +LeaveNow: + mov eax, Lookahead + cmp r11d, eax + cmovng eax, r11d + + + +//;;; Restore the stack and return from whence we came. + + +// mov rsi,[save_rsi] +// mov rdi,[save_rdi] + mov rbx,[save_rbx] + mov rbp,[save_rbp] + mov r12,[save_r12] + mov r13,[save_r13] + mov r14,[save_r14] + mov r15,[save_r15] + + + ret 0 +//; please don't remove this string ! +//; Your can freely use gvmat64 in any free or commercial app +//; but it is far better don't remove the string in the binary! + // db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 + + +match_init: + ret 0 + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/README b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/README new file mode 100644 index 0000000..e75ed13 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/README @@ -0,0 +1 @@ +See infback9.h for what this is and how to use it. diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.c b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.c new file mode 100644 index 0000000..7bbe90c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.c @@ -0,0 +1,617 @@ +/* infback9.c -- inflate deflate64 data using a call-back interface + * Copyright (C) 1995-2008 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "infback9.h" +#include "inftree9.h" +#include "inflate9.h" + +#define WSIZE 65536UL + +/* + strm provides memory allocation functions in zalloc and zfree, or + Z_NULL to use the library memory allocation functions. + + window is a user-supplied window and output buffer that is 64K bytes. + */ +int ZEXPORT inflateBack9Init_(strm, window, version, stream_size) +z_stream FAR *strm; +unsigned char FAR *window; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL || window == Z_NULL) + return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *)ZALLOC(strm, 1, + sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (voidpf)state; + state->window = window; + return Z_OK; +} + +/* + Build and output length and distance decoding tables for fixed code + decoding. + */ +#ifdef MAKEFIXED +#include + +void makefixed9(void) +{ + unsigned sym, bits, low, size; + code *next, *lenfix, *distfix; + struct inflate_state state; + code fixed[544]; + + /* literal/length table */ + sym = 0; + while (sym < 144) state.lens[sym++] = 8; + while (sym < 256) state.lens[sym++] = 9; + while (sym < 280) state.lens[sym++] = 7; + while (sym < 288) state.lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table9(LENS, state.lens, 288, &(next), &(bits), state.work); + + /* distance table */ + sym = 0; + while (sym < 32) state.lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table9(DISTS, state.lens, 32, &(next), &(bits), state.work); + + /* write tables */ + puts(" /* inffix9.h -- table for decoding deflate64 fixed codes"); + puts(" * Generated automatically by makefixed9()."); + puts(" */"); + puts(""); + puts(" /* WARNING: this file should *not* be used by applications."); + puts(" It is part of the implementation of this library and is"); + puts(" subject to change. Applications should only use zlib.h."); + puts(" */"); + puts(""); + size = 1U << 9; + printf(" static const code lenfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 6) == 0) printf("\n "); + printf("{%u,%u,%d}", lenfix[low].op, lenfix[low].bits, + lenfix[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); + size = 1U << 5; + printf("\n static const code distfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 5) == 0) printf("\n "); + printf("{%u,%u,%d}", distfix[low].op, distfix[low].bits, + distfix[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); +} +#endif /* MAKEFIXED */ + +/* Macros for inflateBack(): */ + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Assure that some input is available. If input is requested, but denied, + then return a Z_BUF_ERROR from inflateBack(). */ +#define PULL() \ + do { \ + if (have == 0) { \ + have = in(in_desc, &next); \ + if (have == 0) { \ + next = Z_NULL; \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflateBack() + with an error if there is no input available. */ +#define PULLBYTE() \ + do { \ + PULL(); \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflateBack() with + an error. */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n <= 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Assure that some output space is available, by writing out the window + if it's full. If the write fails, return from inflateBack() with a + Z_BUF_ERROR. */ +#define ROOM() \ + do { \ + if (left == 0) { \ + put = window; \ + left = WSIZE; \ + wrap = 1; \ + if (out(out_desc, put, (unsigned)left)) { \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* + strm provides the memory allocation functions and window buffer on input, + and provides information on the unused input on return. For Z_DATA_ERROR + returns, strm will also provide an error message. + + in() and out() are the call-back input and output functions. When + inflateBack() needs more input, it calls in(). When inflateBack() has + filled the window with output, or when it completes with data in the + window, it calls out() to write out the data. The application must not + change the provided input until in() is called again or inflateBack() + returns. The application must not change the window/output buffer until + inflateBack() returns. + + in() and out() are called with a descriptor parameter provided in the + inflateBack() call. This parameter can be a structure that provides the + information required to do the read or write, as well as accumulated + information on the input and output such as totals and check values. + + in() should return zero on failure. out() should return non-zero on + failure. If either in() or out() fails, than inflateBack() returns a + Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it + was in() or out() that caused in the error. Otherwise, inflateBack() + returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format + error, or Z_MEM_ERROR if it could not allocate memory for the state. + inflateBack() can also return Z_STREAM_ERROR if the input parameters + are not correct, i.e. strm is Z_NULL or the state was not initialized. + */ +int ZEXPORT inflateBack9(strm, in, in_desc, out, out_desc) +z_stream FAR *strm; +in_func in; +void FAR *in_desc; +out_func out; +void FAR *out_desc; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have; /* available input */ + unsigned long left; /* available output */ + inflate_mode mode; /* current inflate mode */ + int lastblock; /* true if processing last block */ + int wrap; /* true if the window has wrapped */ + unsigned long write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned extra; /* extra bits needed */ + unsigned long length; /* literal or length of data to copy */ + unsigned long offset; /* distance back to copy string from */ + unsigned long copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + code here; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +#include "inffix9.h" + + /* Check that the strm exists and that the state was initialized */ + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* Reset the state */ + strm->msg = Z_NULL; + mode = TYPE; + lastblock = 0; + write = 0; + wrap = 0; + window = state->window; + next = strm->next_in; + have = next != Z_NULL ? strm->avail_in : 0; + hold = 0; + bits = 0; + put = window; + left = WSIZE; + lencode = Z_NULL; + distcode = Z_NULL; + + /* Inflate until end of block marked as last */ + for (;;) + switch (mode) { + case TYPE: + /* determine and dispatch block type */ + if (lastblock) { + BYTEBITS(); + mode = DONE; + break; + } + NEEDBITS(3); + lastblock = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + lastblock ? " (last)" : "")); + mode = STORED; + break; + case 1: /* fixed block */ + lencode = lenfix; + lenbits = 9; + distcode = distfix; + distbits = 5; + Tracev((stderr, "inflate: fixed codes block%s\n", + lastblock ? " (last)" : "")); + mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + lastblock ? " (last)" : "")); + mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + mode = BAD; + } + DROPBITS(2); + break; + + case STORED: + /* get and verify stored block length */ + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + mode = BAD; + break; + } + length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %lu\n", + length)); + INITBITS(); + + /* copy stored block from input to output */ + while (length != 0) { + copy = length; + PULL(); + ROOM(); + if (copy > have) copy = have; + if (copy > left) copy = left; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + length -= copy; + } + Tracev((stderr, "inflate: stored end\n")); + mode = TYPE; + break; + + case TABLE: + /* get dynamic table entries descriptor */ + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); + if (state->nlen > 286) { + strm->msg = (char *)"too many length symbols"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: table sizes ok\n")); + + /* get code length code lengths (not a typo) */ + state->have = 0; + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + lencode = (code const FAR *)(state->next); + lenbits = 7; + ret = inflate_table9(CODES, state->lens, 19, &(state->next), + &(lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + + /* get length and distance code code lengths */ + state->have = 0; + while (state->have < state->nlen + state->ndist) { + for (;;) { + here = lencode[BITS(lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.val < 16) { + NEEDBITS(here.bits); + DROPBITS(here.bits); + state->lens[state->have++] = here.val; + } + else { + if (here.val == 16) { + NEEDBITS(here.bits + 2); + DROPBITS(here.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + mode = BAD; + break; + } + len = (unsigned)(state->lens[state->have - 1]); + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (here.val == 17) { + NEEDBITS(here.bits + 3); + DROPBITS(here.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(here.bits + 7); + DROPBITS(here.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (mode == BAD) break; + + /* check for end-of-block code (better have one) */ + if (state->lens[256] == 0) { + strm->msg = (char *)"invalid code -- missing end-of-block"; + mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftree9.h + concerning the ENOUGH constants, which depend on those values */ + state->next = state->codes; + lencode = (code const FAR *)(state->next); + lenbits = 9; + ret = inflate_table9(LENS, state->lens, state->nlen, + &(state->next), &(lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + mode = BAD; + break; + } + distcode = (code const FAR *)(state->next); + distbits = 6; + ret = inflate_table9(DISTS, state->lens + state->nlen, + state->ndist, &(state->next), &(distbits), + state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + mode = LEN; + + case LEN: + /* get a literal, length, or end-of-block code */ + for (;;) { + here = lencode[BITS(lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.op && (here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + length = (unsigned)here.val; + + /* process literal */ + if (here.op == 0) { + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", here.val)); + ROOM(); + *put++ = (unsigned char)(length); + left--; + mode = LEN; + break; + } + + /* process end of block */ + if (here.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + mode = TYPE; + break; + } + + /* invalid code */ + if (here.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + mode = BAD; + break; + } + + /* length code -- get extra bits, if any */ + extra = (unsigned)(here.op) & 31; + if (extra != 0) { + NEEDBITS(extra); + length += BITS(extra); + DROPBITS(extra); + } + Tracevv((stderr, "inflate: length %lu\n", length)); + + /* get distance code */ + for (;;) { + here = distcode[BITS(distbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if ((here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + if (here.op & 64) { + strm->msg = (char *)"invalid distance code"; + mode = BAD; + break; + } + offset = (unsigned)here.val; + + /* get distance extra bits, if any */ + extra = (unsigned)(here.op) & 15; + if (extra != 0) { + NEEDBITS(extra); + offset += BITS(extra); + DROPBITS(extra); + } + if (offset > WSIZE - (wrap ? 0: left)) { + strm->msg = (char *)"invalid distance too far back"; + mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %lu\n", offset)); + + /* copy match from window to output */ + do { + ROOM(); + copy = WSIZE - offset; + if (copy < left) { + from = put + copy; + copy = left - copy; + } + else { + from = put - offset; + copy = left; + } + if (copy > length) copy = length; + length -= copy; + left -= copy; + do { + *put++ = *from++; + } while (--copy); + } while (length != 0); + break; + + case DONE: + /* inflate stream terminated properly -- write leftover output */ + ret = Z_STREAM_END; + if (left < WSIZE) { + if (out(out_desc, window, (unsigned)(WSIZE - left))) + ret = Z_BUF_ERROR; + } + goto inf_leave; + + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + + default: /* can't happen, but makes compilers happy */ + ret = Z_STREAM_ERROR; + goto inf_leave; + } + + /* Return unused input */ + inf_leave: + strm->next_in = next; + strm->avail_in = have; + return ret; +} + +int ZEXPORT inflateBack9End(strm) +z_stream FAR *strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.h b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.h new file mode 100644 index 0000000..1073c0a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/infback9.h @@ -0,0 +1,37 @@ +/* infback9.h -- header for using inflateBack9 functions + * Copyright (C) 2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * This header file and associated patches provide a decoder for PKWare's + * undocumented deflate64 compression method (method 9). Use with infback9.c, + * inftree9.h, inftree9.c, and inffix9.h. These patches are not supported. + * This should be compiled with zlib, since it uses zutil.h and zutil.o. + * This code has not yet been tested on 16-bit architectures. See the + * comments in zlib.h for inflateBack() usage. These functions are used + * identically, except that there is no windowBits parameter, and a 64K + * window must be provided. Also if int's are 16 bits, then a zero for + * the third parameter of the "out" function actually means 65536UL. + * zlib.h must be included before this header file. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +ZEXTERN int ZEXPORT inflateBack9 OF((z_stream FAR *strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +ZEXTERN int ZEXPORT inflateBack9End OF((z_stream FAR *strm)); +ZEXTERN int ZEXPORT inflateBack9Init_ OF((z_stream FAR *strm, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define inflateBack9Init(strm, window) \ + inflateBack9Init_((strm), (window), \ + ZLIB_VERSION, sizeof(z_stream)) + +#ifdef __cplusplus +} +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inffix9.h b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inffix9.h new file mode 100644 index 0000000..ee5671d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inffix9.h @@ -0,0 +1,107 @@ + /* inffix9.h -- table for decoding deflate64 fixed codes + * Generated automatically by makefixed9(). + */ + + /* WARNING: this file should *not* be used by applications. + It is part of the implementation of this library and is + subject to change. Applications should only use zlib.h. + */ + + static const code lenfix[512] = { + {96,7,0},{0,8,80},{0,8,16},{132,8,115},{130,7,31},{0,8,112}, + {0,8,48},{0,9,192},{128,7,10},{0,8,96},{0,8,32},{0,9,160}, + {0,8,0},{0,8,128},{0,8,64},{0,9,224},{128,7,6},{0,8,88}, + {0,8,24},{0,9,144},{131,7,59},{0,8,120},{0,8,56},{0,9,208}, + {129,7,17},{0,8,104},{0,8,40},{0,9,176},{0,8,8},{0,8,136}, + {0,8,72},{0,9,240},{128,7,4},{0,8,84},{0,8,20},{133,8,227}, + {131,7,43},{0,8,116},{0,8,52},{0,9,200},{129,7,13},{0,8,100}, + {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232}, + {128,7,8},{0,8,92},{0,8,28},{0,9,152},{132,7,83},{0,8,124}, + {0,8,60},{0,9,216},{130,7,23},{0,8,108},{0,8,44},{0,9,184}, + {0,8,12},{0,8,140},{0,8,76},{0,9,248},{128,7,3},{0,8,82}, + {0,8,18},{133,8,163},{131,7,35},{0,8,114},{0,8,50},{0,9,196}, + {129,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},{0,8,130}, + {0,8,66},{0,9,228},{128,7,7},{0,8,90},{0,8,26},{0,9,148}, + {132,7,67},{0,8,122},{0,8,58},{0,9,212},{130,7,19},{0,8,106}, + {0,8,42},{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244}, + {128,7,5},{0,8,86},{0,8,22},{65,8,0},{131,7,51},{0,8,118}, + {0,8,54},{0,9,204},{129,7,15},{0,8,102},{0,8,38},{0,9,172}, + {0,8,6},{0,8,134},{0,8,70},{0,9,236},{128,7,9},{0,8,94}, + {0,8,30},{0,9,156},{132,7,99},{0,8,126},{0,8,62},{0,9,220}, + {130,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, + {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{133,8,131}, + {130,7,31},{0,8,113},{0,8,49},{0,9,194},{128,7,10},{0,8,97}, + {0,8,33},{0,9,162},{0,8,1},{0,8,129},{0,8,65},{0,9,226}, + {128,7,6},{0,8,89},{0,8,25},{0,9,146},{131,7,59},{0,8,121}, + {0,8,57},{0,9,210},{129,7,17},{0,8,105},{0,8,41},{0,9,178}, + {0,8,9},{0,8,137},{0,8,73},{0,9,242},{128,7,4},{0,8,85}, + {0,8,21},{144,8,3},{131,7,43},{0,8,117},{0,8,53},{0,9,202}, + {129,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133}, + {0,8,69},{0,9,234},{128,7,8},{0,8,93},{0,8,29},{0,9,154}, + {132,7,83},{0,8,125},{0,8,61},{0,9,218},{130,7,23},{0,8,109}, + {0,8,45},{0,9,186},{0,8,13},{0,8,141},{0,8,77},{0,9,250}, + {128,7,3},{0,8,83},{0,8,19},{133,8,195},{131,7,35},{0,8,115}, + {0,8,51},{0,9,198},{129,7,11},{0,8,99},{0,8,35},{0,9,166}, + {0,8,3},{0,8,131},{0,8,67},{0,9,230},{128,7,7},{0,8,91}, + {0,8,27},{0,9,150},{132,7,67},{0,8,123},{0,8,59},{0,9,214}, + {130,7,19},{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139}, + {0,8,75},{0,9,246},{128,7,5},{0,8,87},{0,8,23},{77,8,0}, + {131,7,51},{0,8,119},{0,8,55},{0,9,206},{129,7,15},{0,8,103}, + {0,8,39},{0,9,174},{0,8,7},{0,8,135},{0,8,71},{0,9,238}, + {128,7,9},{0,8,95},{0,8,31},{0,9,158},{132,7,99},{0,8,127}, + {0,8,63},{0,9,222},{130,7,27},{0,8,111},{0,8,47},{0,9,190}, + {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80}, + {0,8,16},{132,8,115},{130,7,31},{0,8,112},{0,8,48},{0,9,193}, + {128,7,10},{0,8,96},{0,8,32},{0,9,161},{0,8,0},{0,8,128}, + {0,8,64},{0,9,225},{128,7,6},{0,8,88},{0,8,24},{0,9,145}, + {131,7,59},{0,8,120},{0,8,56},{0,9,209},{129,7,17},{0,8,104}, + {0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},{0,9,241}, + {128,7,4},{0,8,84},{0,8,20},{133,8,227},{131,7,43},{0,8,116}, + {0,8,52},{0,9,201},{129,7,13},{0,8,100},{0,8,36},{0,9,169}, + {0,8,4},{0,8,132},{0,8,68},{0,9,233},{128,7,8},{0,8,92}, + {0,8,28},{0,9,153},{132,7,83},{0,8,124},{0,8,60},{0,9,217}, + {130,7,23},{0,8,108},{0,8,44},{0,9,185},{0,8,12},{0,8,140}, + {0,8,76},{0,9,249},{128,7,3},{0,8,82},{0,8,18},{133,8,163}, + {131,7,35},{0,8,114},{0,8,50},{0,9,197},{129,7,11},{0,8,98}, + {0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, + {128,7,7},{0,8,90},{0,8,26},{0,9,149},{132,7,67},{0,8,122}, + {0,8,58},{0,9,213},{130,7,19},{0,8,106},{0,8,42},{0,9,181}, + {0,8,10},{0,8,138},{0,8,74},{0,9,245},{128,7,5},{0,8,86}, + {0,8,22},{65,8,0},{131,7,51},{0,8,118},{0,8,54},{0,9,205}, + {129,7,15},{0,8,102},{0,8,38},{0,9,173},{0,8,6},{0,8,134}, + {0,8,70},{0,9,237},{128,7,9},{0,8,94},{0,8,30},{0,9,157}, + {132,7,99},{0,8,126},{0,8,62},{0,9,221},{130,7,27},{0,8,110}, + {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253}, + {96,7,0},{0,8,81},{0,8,17},{133,8,131},{130,7,31},{0,8,113}, + {0,8,49},{0,9,195},{128,7,10},{0,8,97},{0,8,33},{0,9,163}, + {0,8,1},{0,8,129},{0,8,65},{0,9,227},{128,7,6},{0,8,89}, + {0,8,25},{0,9,147},{131,7,59},{0,8,121},{0,8,57},{0,9,211}, + {129,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},{0,8,137}, + {0,8,73},{0,9,243},{128,7,4},{0,8,85},{0,8,21},{144,8,3}, + {131,7,43},{0,8,117},{0,8,53},{0,9,203},{129,7,13},{0,8,101}, + {0,8,37},{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235}, + {128,7,8},{0,8,93},{0,8,29},{0,9,155},{132,7,83},{0,8,125}, + {0,8,61},{0,9,219},{130,7,23},{0,8,109},{0,8,45},{0,9,187}, + {0,8,13},{0,8,141},{0,8,77},{0,9,251},{128,7,3},{0,8,83}, + {0,8,19},{133,8,195},{131,7,35},{0,8,115},{0,8,51},{0,9,199}, + {129,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, + {0,8,67},{0,9,231},{128,7,7},{0,8,91},{0,8,27},{0,9,151}, + {132,7,67},{0,8,123},{0,8,59},{0,9,215},{130,7,19},{0,8,107}, + {0,8,43},{0,9,183},{0,8,11},{0,8,139},{0,8,75},{0,9,247}, + {128,7,5},{0,8,87},{0,8,23},{77,8,0},{131,7,51},{0,8,119}, + {0,8,55},{0,9,207},{129,7,15},{0,8,103},{0,8,39},{0,9,175}, + {0,8,7},{0,8,135},{0,8,71},{0,9,239},{128,7,9},{0,8,95}, + {0,8,31},{0,9,159},{132,7,99},{0,8,127},{0,8,63},{0,9,223}, + {130,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143}, + {0,8,79},{0,9,255} + }; + + static const code distfix[32] = { + {128,5,1},{135,5,257},{131,5,17},{139,5,4097},{129,5,5}, + {137,5,1025},{133,5,65},{141,5,16385},{128,5,3},{136,5,513}, + {132,5,33},{140,5,8193},{130,5,9},{138,5,2049},{134,5,129}, + {142,5,32769},{128,5,2},{135,5,385},{131,5,25},{139,5,6145}, + {129,5,7},{137,5,1537},{133,5,97},{141,5,24577},{128,5,4}, + {136,5,769},{132,5,49},{140,5,12289},{130,5,13},{138,5,3073}, + {134,5,193},{142,5,49153} + }; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inflate9.h b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inflate9.h new file mode 100644 index 0000000..ee9a793 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inflate9.h @@ -0,0 +1,47 @@ +/* inflate9.h -- internal inflate state definition + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Possible inflate modes between inflate() calls */ +typedef enum { + TYPE, /* i: waiting for type bits, including last-flag bit */ + STORED, /* i: waiting for stored size (length and complement) */ + TABLE, /* i: waiting for dynamic block table lengths */ + LEN, /* i: waiting for length/lit code */ + DONE, /* finished check, done -- remain here until reset */ + BAD /* got a data error -- remain here until reset */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to the BAD mode -- not shown for clarity) + + Read deflate blocks: + TYPE -> STORED or TABLE or LEN or DONE + STORED -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN + Read deflate codes: + LEN -> LEN or TYPE + */ + +/* state maintained between inflate() calls. Approximately 7K bytes. */ +struct inflate_state { + /* sliding window */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ +}; diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.c b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.c new file mode 100644 index 0000000..5a0b328 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.c @@ -0,0 +1,324 @@ +/* inftree9.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftree9.h" + +#define MAXBITS 15 + +const char inflate9_copyright[] = + " inflate9 1.2.7 Copyright 1995-2012 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* + Build a set of tables to decode the provided canonical Huffman code. + The code lengths are lens[0..codes-1]. The result starts at *table, + whose indices are 0..2^bits-1. work is a writable array of at least + lens shorts, which is used as a work area. type is the type of code + to be generated, CODES, LENS, or DISTS. On return, zero is success, + -1 is an invalid code, and +1 means that ENOUGH isn't enough. table + on return points to the next available entry's address. bits is the + requested root table index bits, and on return it is the actual root + table index bits. It will differ if the request is greater than the + longest code or if it is less than the shortest code. + */ +int inflate_table9(type, lens, codes, table, bits, work) +codetype type; +unsigned short FAR *lens; +unsigned codes; +code FAR * FAR *table; +unsigned FAR *bits; +unsigned short FAR *work; +{ + unsigned len; /* a code's length in bits */ + unsigned sym; /* index of code symbols */ + unsigned min, max; /* minimum and maximum code lengths */ + unsigned root; /* number of index bits for root table */ + unsigned curr; /* number of index bits for current table */ + unsigned drop; /* code bits to drop for sub-table */ + int left; /* number of prefix codes available */ + unsigned used; /* code entries in table used */ + unsigned huff; /* Huffman code */ + unsigned incr; /* for incrementing code, index */ + unsigned fill; /* index for replicating entries */ + unsigned low; /* low bits for current root entry */ + unsigned mask; /* mask for low root bits */ + code this; /* table entry for duplication */ + code FAR *next; /* next available space in table */ + const unsigned short FAR *base; /* base value table to use */ + const unsigned short FAR *extra; /* extra bits table to use */ + int end; /* use base and extra for symbol > end */ + unsigned short count[MAXBITS+1]; /* number of codes of each length */ + unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const unsigned short lbase[31] = { /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, + 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, + 131, 163, 195, 227, 3, 0, 0}; + static const unsigned short lext[31] = { /* Length codes 257..285 extra */ + 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, + 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, + 133, 133, 133, 133, 144, 78, 68}; + static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, + 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, + 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153}; + static const unsigned short dext[32] = { /* Distance codes 0..31 extra */ + 128, 128, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, + 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, + 139, 139, 140, 140, 141, 141, 142, 142}; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) + count[len] = 0; + for (sym = 0; sym < codes; sym++) + count[lens[sym]]++; + + /* bound code lengths, force root to be within code lengths */ + root = *bits; + for (max = MAXBITS; max >= 1; max--) + if (count[max] != 0) break; + if (root > max) root = max; + if (max == 0) return -1; /* no codes! */ + for (min = 1; min <= MAXBITS; min++) + if (count[min] != 0) break; + if (root < min) root = min; + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) return -1; /* over-subscribed */ + } + if (left > 0 && (type == CODES || max != 1)) + return -1; /* incomplete set */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + count[len]; + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) + if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftree9.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + switch (type) { + case CODES: + base = extra = work; /* dummy value--not used */ + end = 19; + break; + case LENS: + base = lbase; + base -= 257; + extra = lext; + extra -= 257; + end = 256; + break; + default: /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize state for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = *table; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = (unsigned)(-1); /* trigger new sub-table when len > root */ + used = 1U << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type == LENS && used >= ENOUGH_LENS) || + (type == DISTS && used >= ENOUGH_DISTS)) + return 1; + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + this.bits = (unsigned char)(len - drop); + if ((int)(work[sym]) < end) { + this.op = (unsigned char)0; + this.val = work[sym]; + } + else if ((int)(work[sym]) > end) { + this.op = (unsigned char)(extra[work[sym]]); + this.val = base[work[sym]]; + } + else { + this.op = (unsigned char)(32 + 64); /* end of block */ + this.val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1U << (len - drop); + fill = 1U << curr; + do { + fill -= incr; + next[(huff >> drop) + fill] = this; + } while (fill != 0); + + /* backwards increment the len-bit code huff */ + incr = 1U << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + + /* go to next symbol, update count, len */ + sym++; + if (--(count[len]) == 0) { + if (len == max) break; + len = lens[work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) != low) { + /* if first time, transition to sub-tables */ + if (drop == 0) + drop = root; + + /* increment past last table */ + next += 1U << curr; + + /* determine length of next table */ + curr = len - drop; + left = (int)(1 << curr); + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) break; + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1U << curr; + if ((type == LENS && used >= ENOUGH_LENS) || + (type == DISTS && used >= ENOUGH_DISTS)) + return 1; + + /* point entry in root table to sub-table */ + low = huff & mask; + (*table)[low].op = (unsigned char)curr; + (*table)[low].bits = (unsigned char)root; + (*table)[low].val = (unsigned short)(next - *table); + } + } + + /* + Fill in rest of table for incomplete codes. This loop is similar to the + loop above in incrementing huff for table indices. It is assumed that + len is equal to curr + drop, so there is no loop needed to increment + through high index bits. When the current sub-table is filled, the loop + drops back to the root table to fill in any remaining entries there. + */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)(len - drop); + this.val = (unsigned short)0; + while (huff != 0) { + /* when done with sub-table, drop back to root table */ + if (drop != 0 && (huff & mask) != low) { + drop = 0; + len = root; + next = *table; + curr = root; + this.bits = (unsigned char)len; + } + + /* put invalid code marker in table */ + next[huff >> drop] = this; + + /* backwards increment the len-bit code huff */ + incr = 1U << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + } + + /* set return parameters */ + *table += used; + *bits = root; + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.h b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.h new file mode 100644 index 0000000..5ab21f0 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/infback9/inftree9.h @@ -0,0 +1,61 @@ +/* inftree9.h -- header to use inftree9.c + * Copyright (C) 1995-2008 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Structure for decoding tables. Each entry provides either the + information needed to do the operation requested by the code that + indexed that table entry, or it provides a pointer to another + table that indexes more bits of the code. op indicates whether + the entry is a pointer to another table, a literal, a length or + distance, an end-of-block, or an invalid code. For a table + pointer, the low four bits of op is the number of index bits of + that table. For a length or distance, the low four bits of op + is the number of extra bits to get after the code. bits is + the number of bits in this code or part of the code to drop off + of the bit buffer. val is the actual byte to output in the case + of a literal, the base length or distance, or the offset from + the current table to the next table. Each entry is four bytes. */ +typedef struct { + unsigned char op; /* operation, extra bits, table bits */ + unsigned char bits; /* bits in this part of the code */ + unsigned short val; /* offset in table or code value */ +} code; + +/* op values as set by inflate_table(): + 00000000 - literal + 0000tttt - table link, tttt != 0 is the number of table index bits + 100eeeee - length or distance, eeee is the number of extra bits + 01100000 - end of block + 01000000 - invalid code + */ + +/* Maximum size of the dynamic table. The maximum number of code structures is + 1446, which is the sum of 852 for literal/length codes and 594 for distance + codes. These values were found by exhaustive searches using the program + examples/enough.c found in the zlib distribtution. The arguments to that + program are the number of symbols, the initial root table size, and the + maximum bit length of a code. "enough 286 9 15" for literal/length codes + returns returns 852, and "enough 32 6 15" for distance codes returns 594. + The initial root table size (9 or 6) is found in the fifth argument of the + inflate_table() calls in infback9.c. If the root table size is changed, + then these maximum sizes would be need to be recalculated and updated. */ +#define ENOUGH_LENS 852 +#define ENOUGH_DISTS 594 +#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) + +/* Type of code to build for inflate_table9() */ +typedef enum { + CODES, + LENS, + DISTS +} codetype; + +extern int inflate_table9 OF((codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work)); diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffas86.c b/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffas86.c new file mode 100644 index 0000000..7292f67 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffas86.c @@ -0,0 +1,1157 @@ +/* inffas86.c is a hand tuned assembler version of + * + * inffast.c -- fast decoding + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Copyright (C) 2003 Chris Anderson + * Please use the copyright conditions above. + * + * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also + * slightly quicker on x86 systems because, instead of using rep movsb to copy + * data, it uses rep movsw, which moves data in 2-byte chunks instead of single + * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates + * from http://fedora.linux.duke.edu/fc1_x86_64 + * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with + * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version, + * when decompressing mozilla-source-1.3.tar.gz. + * + * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from + * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at + * the moment. I have successfully compiled and tested this code with gcc2.96, + * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S + * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX + * enabled. I will attempt to merge the MMX code into this version. Newer + * versions of this and inffast.S can be found at + * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +/* Mark Adler's comments from inffast.c: */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ +void inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + struct inffast_ar { +/* 64 32 x86 x86_64 */ +/* ar offset register */ +/* 0 0 */ void *esp; /* esp save */ +/* 8 4 */ void *ebp; /* ebp save */ +/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */ +/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */ +/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */ +/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */ +/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */ +/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */ +/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */ +/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */ +/* 80 40 */ unsigned long hold; /* edx rdx local strm->hold */ +/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */ +/* 92 48 */ unsigned wsize; /* window size */ +/* 96 52 */ unsigned write; /* window write index */ +/*100 56 */ unsigned lmask; /* r12 mask for lcode */ +/*104 60 */ unsigned dmask; /* r13 mask for dcode */ +/*108 64 */ unsigned len; /* r14 match length */ +/*112 68 */ unsigned dist; /* r15 match distance */ +/*116 72 */ unsigned status; /* set when state chng*/ + } ar; + +#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 ) +#define PAD_AVAIL_IN 6 +#define PAD_AVAIL_OUT 258 +#else +#define PAD_AVAIL_IN 5 +#define PAD_AVAIL_OUT 257 +#endif + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + ar.in = strm->next_in; + ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN); + ar.out = strm->next_out; + ar.beg = ar.out - (start - strm->avail_out); + ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); + ar.wsize = state->wsize; + ar.write = state->wnext; + ar.window = state->window; + ar.hold = state->hold; + ar.bits = state->bits; + ar.lcode = state->lencode; + ar.dcode = state->distcode; + ar.lmask = (1U << state->lenbits) - 1; + ar.dmask = (1U << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + /* align in on 1/2 hold size boundary */ + while (((unsigned long)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) { + ar.hold += (unsigned long)*ar.in++ << ar.bits; + ar.bits += 8; + } + +#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 ) + __asm__ __volatile__ ( +" leaq %0, %%rax\n" +" movq %%rbp, 8(%%rax)\n" /* save regs rbp and rsp */ +" movq %%rsp, (%%rax)\n" +" movq %%rax, %%rsp\n" /* make rsp point to &ar */ +" movq 16(%%rsp), %%rsi\n" /* rsi = in */ +" movq 32(%%rsp), %%rdi\n" /* rdi = out */ +" movq 24(%%rsp), %%r9\n" /* r9 = last */ +" movq 48(%%rsp), %%r10\n" /* r10 = end */ +" movq 64(%%rsp), %%rbp\n" /* rbp = lcode */ +" movq 72(%%rsp), %%r11\n" /* r11 = dcode */ +" movq 80(%%rsp), %%rdx\n" /* rdx = hold */ +" movl 88(%%rsp), %%ebx\n" /* ebx = bits */ +" movl 100(%%rsp), %%r12d\n" /* r12d = lmask */ +" movl 104(%%rsp), %%r13d\n" /* r13d = dmask */ + /* r14d = len */ + /* r15d = dist */ +" cld\n" +" cmpq %%rdi, %%r10\n" +" je .L_one_time\n" /* if only one decode left */ +" cmpq %%rsi, %%r9\n" +" je .L_one_time\n" +" jmp .L_do_loop\n" + +".L_one_time:\n" +" movq %%r12, %%r8\n" /* r8 = lmask */ +" cmpb $32, %%bl\n" +" ja .L_get_length_code_one_time\n" + +" lodsl\n" /* eax = *(uint *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $32, %%bl\n" /* bits += 32 */ +" shlq %%cl, %%rax\n" +" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ +" jmp .L_get_length_code_one_time\n" + +".align 32,0x90\n" +".L_while_test:\n" +" cmpq %%rdi, %%r10\n" +" jbe .L_break_loop\n" +" cmpq %%rsi, %%r9\n" +" jbe .L_break_loop\n" + +".L_do_loop:\n" +" movq %%r12, %%r8\n" /* r8 = lmask */ +" cmpb $32, %%bl\n" +" ja .L_get_length_code\n" /* if (32 < bits) */ + +" lodsl\n" /* eax = *(uint *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $32, %%bl\n" /* bits += 32 */ +" shlq %%cl, %%rax\n" +" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ + +".L_get_length_code:\n" +" andq %%rdx, %%r8\n" /* r8 &= hold */ +" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */ + +" movb %%ah, %%cl\n" /* cl = this.bits */ +" subb %%ah, %%bl\n" /* bits -= this.bits */ +" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ + +" testb %%al, %%al\n" +" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ + +" movq %%r12, %%r8\n" /* r8 = lmask */ +" shrl $16, %%eax\n" /* output this.val char */ +" stosb\n" + +".L_get_length_code_one_time:\n" +" andq %%rdx, %%r8\n" /* r8 &= hold */ +" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */ + +".L_dolen:\n" +" movb %%ah, %%cl\n" /* cl = this.bits */ +" subb %%ah, %%bl\n" /* bits -= this.bits */ +" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ + +" testb %%al, %%al\n" +" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ + +" shrl $16, %%eax\n" /* output this.val char */ +" stosb\n" +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_test_for_length_base:\n" +" movl %%eax, %%r14d\n" /* len = this */ +" shrl $16, %%r14d\n" /* len = this.val */ +" movb %%al, %%cl\n" + +" testb $16, %%al\n" +" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */ +" andb $15, %%cl\n" /* op &= 15 */ +" jz .L_decode_distance\n" /* if (!op) */ + +".L_add_bits_to_len:\n" +" subb %%cl, %%bl\n" +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" shrq %%cl, %%rdx\n" +" addl %%eax, %%r14d\n" /* len += hold & mask[op] */ + +".L_decode_distance:\n" +" movq %%r13, %%r8\n" /* r8 = dmask */ +" cmpb $32, %%bl\n" +" ja .L_get_distance_code\n" /* if (32 < bits) */ + +" lodsl\n" /* eax = *(uint *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $32, %%bl\n" /* bits += 32 */ +" shlq %%cl, %%rax\n" +" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */ + +".L_get_distance_code:\n" +" andq %%rdx, %%r8\n" /* r8 &= hold */ +" movl (%%r11,%%r8,4), %%eax\n" /* eax = dcode[hold & dmask] */ + +".L_dodist:\n" +" movl %%eax, %%r15d\n" /* dist = this */ +" shrl $16, %%r15d\n" /* dist = this.val */ +" movb %%ah, %%cl\n" +" subb %%ah, %%bl\n" /* bits -= this.bits */ +" shrq %%cl, %%rdx\n" /* hold >>= this.bits */ +" movb %%al, %%cl\n" /* cl = this.op */ + +" testb $16, %%al\n" /* if ((op & 16) == 0) */ +" jz .L_test_for_second_level_dist\n" +" andb $15, %%cl\n" /* op &= 15 */ +" jz .L_check_dist_one\n" + +".L_add_bits_to_dist:\n" +" subb %%cl, %%bl\n" +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" /* (1 << op) - 1 */ +" andl %%edx, %%eax\n" /* eax &= hold */ +" shrq %%cl, %%rdx\n" +" addl %%eax, %%r15d\n" /* dist += hold & ((1 << op) - 1) */ + +".L_check_window:\n" +" movq %%rsi, %%r8\n" /* save in so from can use it's reg */ +" movq %%rdi, %%rax\n" +" subq 40(%%rsp), %%rax\n" /* nbytes = out - beg */ + +" cmpl %%r15d, %%eax\n" +" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */ + +" movl %%r14d, %%ecx\n" /* ecx = len */ +" movq %%rdi, %%rsi\n" +" subq %%r15, %%rsi\n" /* from = out - dist */ + +" sarl %%ecx\n" +" jnc .L_copy_two\n" /* if len % 2 == 0 */ + +" rep movsw\n" +" movb (%%rsi), %%al\n" +" movb %%al, (%%rdi)\n" +" incq %%rdi\n" + +" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */ +" jmp .L_while_test\n" + +".L_copy_two:\n" +" rep movsw\n" +" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */ +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_check_dist_one:\n" +" cmpl $1, %%r15d\n" /* if dist 1, is a memset */ +" jne .L_check_window\n" +" cmpq %%rdi, 40(%%rsp)\n" /* if out == beg, outside window */ +" je .L_check_window\n" + +" movl %%r14d, %%ecx\n" /* ecx = len */ +" movb -1(%%rdi), %%al\n" +" movb %%al, %%ah\n" + +" sarl %%ecx\n" +" jnc .L_set_two\n" +" movb %%al, (%%rdi)\n" +" incq %%rdi\n" + +".L_set_two:\n" +" rep stosw\n" +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_test_for_second_level_length:\n" +" testb $64, %%al\n" +" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */ + +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" addl %%r14d, %%eax\n" /* eax += len */ +" movl (%%rbp,%%rax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/ +" jmp .L_dolen\n" + +".align 32,0x90\n" +".L_test_for_second_level_dist:\n" +" testb $64, %%al\n" +" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */ + +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" addl %%r15d, %%eax\n" /* eax += dist */ +" movl (%%r11,%%rax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/ +" jmp .L_dodist\n" + +".align 32,0x90\n" +".L_clip_window:\n" +" movl %%eax, %%ecx\n" /* ecx = nbytes */ +" movl 92(%%rsp), %%eax\n" /* eax = wsize, prepare for dist cmp */ +" negl %%ecx\n" /* nbytes = -nbytes */ + +" cmpl %%r15d, %%eax\n" +" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */ + +" addl %%r15d, %%ecx\n" /* nbytes = dist - nbytes */ +" cmpl $0, 96(%%rsp)\n" +" jne .L_wrap_around_window\n" /* if (write != 0) */ + +" movq 56(%%rsp), %%rsi\n" /* from = window */ +" subl %%ecx, %%eax\n" /* eax -= nbytes */ +" addq %%rax, %%rsi\n" /* from += wsize - nbytes */ + +" movl %%r14d, %%eax\n" /* eax = len */ +" cmpl %%ecx, %%r14d\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* eax -= nbytes */ +" rep movsb\n" +" movq %%rdi, %%rsi\n" +" subq %%r15, %%rsi\n" /* from = &out[ -dist ] */ +" jmp .L_do_copy\n" + +".align 32,0x90\n" +".L_wrap_around_window:\n" +" movl 96(%%rsp), %%eax\n" /* eax = write */ +" cmpl %%eax, %%ecx\n" +" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */ + +" movl 92(%%rsp), %%esi\n" /* from = wsize */ +" addq 56(%%rsp), %%rsi\n" /* from += window */ +" addq %%rax, %%rsi\n" /* from += write */ +" subq %%rcx, %%rsi\n" /* from -= nbytes */ +" subl %%eax, %%ecx\n" /* nbytes -= write */ + +" movl %%r14d, %%eax\n" /* eax = len */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movq 56(%%rsp), %%rsi\n" /* from = window */ +" movl 96(%%rsp), %%ecx\n" /* nbytes = write */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movq %%rdi, %%rsi\n" +" subq %%r15, %%rsi\n" /* from = out - dist */ +" jmp .L_do_copy\n" + +".align 32,0x90\n" +".L_contiguous_in_window:\n" +" movq 56(%%rsp), %%rsi\n" /* rsi = window */ +" addq %%rax, %%rsi\n" +" subq %%rcx, %%rsi\n" /* from += write - nbytes */ + +" movl %%r14d, %%eax\n" /* eax = len */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movq %%rdi, %%rsi\n" +" subq %%r15, %%rsi\n" /* from = out - dist */ +" jmp .L_do_copy\n" /* if (nbytes >= len) */ + +".align 32,0x90\n" +".L_do_copy:\n" +" movl %%eax, %%ecx\n" /* ecx = len */ +" rep movsb\n" + +" movq %%r8, %%rsi\n" /* move in back to %esi, toss from */ +" jmp .L_while_test\n" + +".L_test_for_end_of_block:\n" +" testb $32, %%al\n" +" jz .L_invalid_literal_length_code\n" +" movl $1, 116(%%rsp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_literal_length_code:\n" +" movl $2, 116(%%rsp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_distance_code:\n" +" movl $3, 116(%%rsp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_distance_too_far:\n" +" movl $4, 116(%%rsp)\n" +" jmp .L_break_loop_with_status\n" + +".L_break_loop:\n" +" movl $0, 116(%%rsp)\n" + +".L_break_loop_with_status:\n" +/* put in, out, bits, and hold back into ar and pop esp */ +" movq %%rsi, 16(%%rsp)\n" /* in */ +" movq %%rdi, 32(%%rsp)\n" /* out */ +" movl %%ebx, 88(%%rsp)\n" /* bits */ +" movq %%rdx, 80(%%rsp)\n" /* hold */ +" movq (%%rsp), %%rax\n" /* restore rbp and rsp */ +" movq 8(%%rsp), %%rbp\n" +" movq %%rax, %%rsp\n" + : + : "m" (ar) + : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", + "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" + ); +#elif ( defined( __GNUC__ ) || defined( __ICC ) ) && defined( __i386 ) + __asm__ __volatile__ ( +" leal %0, %%eax\n" +" movl %%esp, (%%eax)\n" /* save esp, ebp */ +" movl %%ebp, 4(%%eax)\n" +" movl %%eax, %%esp\n" +" movl 8(%%esp), %%esi\n" /* esi = in */ +" movl 16(%%esp), %%edi\n" /* edi = out */ +" movl 40(%%esp), %%edx\n" /* edx = hold */ +" movl 44(%%esp), %%ebx\n" /* ebx = bits */ +" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ + +" cld\n" +" jmp .L_do_loop\n" + +".align 32,0x90\n" +".L_while_test:\n" +" cmpl %%edi, 24(%%esp)\n" /* out < end */ +" jbe .L_break_loop\n" +" cmpl %%esi, 12(%%esp)\n" /* in < last */ +" jbe .L_break_loop\n" + +".L_do_loop:\n" +" cmpb $15, %%bl\n" +" ja .L_get_length_code\n" /* if (15 < bits) */ + +" xorl %%eax, %%eax\n" +" lodsw\n" /* al = *(ushort *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $16, %%bl\n" /* bits += 16 */ +" shll %%cl, %%eax\n" +" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ + +".L_get_length_code:\n" +" movl 56(%%esp), %%eax\n" /* eax = lmask */ +" andl %%edx, %%eax\n" /* eax &= hold */ +" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */ + +".L_dolen:\n" +" movb %%ah, %%cl\n" /* cl = this.bits */ +" subb %%ah, %%bl\n" /* bits -= this.bits */ +" shrl %%cl, %%edx\n" /* hold >>= this.bits */ + +" testb %%al, %%al\n" +" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */ + +" shrl $16, %%eax\n" /* output this.val char */ +" stosb\n" +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_test_for_length_base:\n" +" movl %%eax, %%ecx\n" /* len = this */ +" shrl $16, %%ecx\n" /* len = this.val */ +" movl %%ecx, 64(%%esp)\n" /* save len */ +" movb %%al, %%cl\n" + +" testb $16, %%al\n" +" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */ +" andb $15, %%cl\n" /* op &= 15 */ +" jz .L_decode_distance\n" /* if (!op) */ +" cmpb %%cl, %%bl\n" +" jae .L_add_bits_to_len\n" /* if (op <= bits) */ + +" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ +" xorl %%eax, %%eax\n" +" lodsw\n" /* al = *(ushort *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $16, %%bl\n" /* bits += 16 */ +" shll %%cl, %%eax\n" +" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ +" movb %%ch, %%cl\n" /* move op back to ecx */ + +".L_add_bits_to_len:\n" +" subb %%cl, %%bl\n" +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" shrl %%cl, %%edx\n" +" addl %%eax, 64(%%esp)\n" /* len += hold & mask[op] */ + +".L_decode_distance:\n" +" cmpb $15, %%bl\n" +" ja .L_get_distance_code\n" /* if (15 < bits) */ + +" xorl %%eax, %%eax\n" +" lodsw\n" /* al = *(ushort *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $16, %%bl\n" /* bits += 16 */ +" shll %%cl, %%eax\n" +" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ + +".L_get_distance_code:\n" +" movl 60(%%esp), %%eax\n" /* eax = dmask */ +" movl 36(%%esp), %%ecx\n" /* ecx = dcode */ +" andl %%edx, %%eax\n" /* eax &= hold */ +" movl (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */ + +".L_dodist:\n" +" movl %%eax, %%ebp\n" /* dist = this */ +" shrl $16, %%ebp\n" /* dist = this.val */ +" movb %%ah, %%cl\n" +" subb %%ah, %%bl\n" /* bits -= this.bits */ +" shrl %%cl, %%edx\n" /* hold >>= this.bits */ +" movb %%al, %%cl\n" /* cl = this.op */ + +" testb $16, %%al\n" /* if ((op & 16) == 0) */ +" jz .L_test_for_second_level_dist\n" +" andb $15, %%cl\n" /* op &= 15 */ +" jz .L_check_dist_one\n" +" cmpb %%cl, %%bl\n" +" jae .L_add_bits_to_dist\n" /* if (op <= bits) 97.6% */ + +" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */ +" xorl %%eax, %%eax\n" +" lodsw\n" /* al = *(ushort *)in++ */ +" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */ +" addb $16, %%bl\n" /* bits += 16 */ +" shll %%cl, %%eax\n" +" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */ +" movb %%ch, %%cl\n" /* move op back to ecx */ + +".L_add_bits_to_dist:\n" +" subb %%cl, %%bl\n" +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" /* (1 << op) - 1 */ +" andl %%edx, %%eax\n" /* eax &= hold */ +" shrl %%cl, %%edx\n" +" addl %%eax, %%ebp\n" /* dist += hold & ((1 << op) - 1) */ + +".L_check_window:\n" +" movl %%esi, 8(%%esp)\n" /* save in so from can use it's reg */ +" movl %%edi, %%eax\n" +" subl 20(%%esp), %%eax\n" /* nbytes = out - beg */ + +" cmpl %%ebp, %%eax\n" +" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */ + +" movl 64(%%esp), %%ecx\n" /* ecx = len */ +" movl %%edi, %%esi\n" +" subl %%ebp, %%esi\n" /* from = out - dist */ + +" sarl %%ecx\n" +" jnc .L_copy_two\n" /* if len % 2 == 0 */ + +" rep movsw\n" +" movb (%%esi), %%al\n" +" movb %%al, (%%edi)\n" +" incl %%edi\n" + +" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ +" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ +" jmp .L_while_test\n" + +".L_copy_two:\n" +" rep movsw\n" +" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ +" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_check_dist_one:\n" +" cmpl $1, %%ebp\n" /* if dist 1, is a memset */ +" jne .L_check_window\n" +" cmpl %%edi, 20(%%esp)\n" +" je .L_check_window\n" /* out == beg, if outside window */ + +" movl 64(%%esp), %%ecx\n" /* ecx = len */ +" movb -1(%%edi), %%al\n" +" movb %%al, %%ah\n" + +" sarl %%ecx\n" +" jnc .L_set_two\n" +" movb %%al, (%%edi)\n" +" incl %%edi\n" + +".L_set_two:\n" +" rep stosw\n" +" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ +" jmp .L_while_test\n" + +".align 32,0x90\n" +".L_test_for_second_level_length:\n" +" testb $64, %%al\n" +" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */ + +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" addl 64(%%esp), %%eax\n" /* eax += len */ +" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/ +" jmp .L_dolen\n" + +".align 32,0x90\n" +".L_test_for_second_level_dist:\n" +" testb $64, %%al\n" +" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */ + +" xorl %%eax, %%eax\n" +" incl %%eax\n" +" shll %%cl, %%eax\n" +" decl %%eax\n" +" andl %%edx, %%eax\n" /* eax &= hold */ +" addl %%ebp, %%eax\n" /* eax += dist */ +" movl 36(%%esp), %%ecx\n" /* ecx = dcode */ +" movl (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/ +" jmp .L_dodist\n" + +".align 32,0x90\n" +".L_clip_window:\n" +" movl %%eax, %%ecx\n" +" movl 48(%%esp), %%eax\n" /* eax = wsize */ +" negl %%ecx\n" /* nbytes = -nbytes */ +" movl 28(%%esp), %%esi\n" /* from = window */ + +" cmpl %%ebp, %%eax\n" +" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */ + +" addl %%ebp, %%ecx\n" /* nbytes = dist - nbytes */ +" cmpl $0, 52(%%esp)\n" +" jne .L_wrap_around_window\n" /* if (write != 0) */ + +" subl %%ecx, %%eax\n" +" addl %%eax, %%esi\n" /* from += wsize - nbytes */ + +" movl 64(%%esp), %%eax\n" /* eax = len */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movl %%edi, %%esi\n" +" subl %%ebp, %%esi\n" /* from = out - dist */ +" jmp .L_do_copy\n" + +".align 32,0x90\n" +".L_wrap_around_window:\n" +" movl 52(%%esp), %%eax\n" /* eax = write */ +" cmpl %%eax, %%ecx\n" +" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */ + +" addl 48(%%esp), %%esi\n" /* from += wsize */ +" addl %%eax, %%esi\n" /* from += write */ +" subl %%ecx, %%esi\n" /* from -= nbytes */ +" subl %%eax, %%ecx\n" /* nbytes -= write */ + +" movl 64(%%esp), %%eax\n" /* eax = len */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movl 28(%%esp), %%esi\n" /* from = window */ +" movl 52(%%esp), %%ecx\n" /* nbytes = write */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movl %%edi, %%esi\n" +" subl %%ebp, %%esi\n" /* from = out - dist */ +" jmp .L_do_copy\n" + +".align 32,0x90\n" +".L_contiguous_in_window:\n" +" addl %%eax, %%esi\n" +" subl %%ecx, %%esi\n" /* from += write - nbytes */ + +" movl 64(%%esp), %%eax\n" /* eax = len */ +" cmpl %%ecx, %%eax\n" +" jbe .L_do_copy\n" /* if (nbytes >= len) */ + +" subl %%ecx, %%eax\n" /* len -= nbytes */ +" rep movsb\n" +" movl %%edi, %%esi\n" +" subl %%ebp, %%esi\n" /* from = out - dist */ +" jmp .L_do_copy\n" /* if (nbytes >= len) */ + +".align 32,0x90\n" +".L_do_copy:\n" +" movl %%eax, %%ecx\n" +" rep movsb\n" + +" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */ +" movl 32(%%esp), %%ebp\n" /* ebp = lcode */ +" jmp .L_while_test\n" + +".L_test_for_end_of_block:\n" +" testb $32, %%al\n" +" jz .L_invalid_literal_length_code\n" +" movl $1, 72(%%esp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_literal_length_code:\n" +" movl $2, 72(%%esp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_distance_code:\n" +" movl $3, 72(%%esp)\n" +" jmp .L_break_loop_with_status\n" + +".L_invalid_distance_too_far:\n" +" movl 8(%%esp), %%esi\n" +" movl $4, 72(%%esp)\n" +" jmp .L_break_loop_with_status\n" + +".L_break_loop:\n" +" movl $0, 72(%%esp)\n" + +".L_break_loop_with_status:\n" +/* put in, out, bits, and hold back into ar and pop esp */ +" movl %%esi, 8(%%esp)\n" /* save in */ +" movl %%edi, 16(%%esp)\n" /* save out */ +" movl %%ebx, 44(%%esp)\n" /* save bits */ +" movl %%edx, 40(%%esp)\n" /* save hold */ +" movl 4(%%esp), %%ebp\n" /* restore esp, ebp */ +" movl (%%esp), %%esp\n" + : + : "m" (ar) + : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi" + ); +#elif defined( _MSC_VER ) && ! defined( _M_AMD64 ) + __asm { + lea eax, ar + mov [eax], esp /* save esp, ebp */ + mov [eax+4], ebp + mov esp, eax + mov esi, [esp+8] /* esi = in */ + mov edi, [esp+16] /* edi = out */ + mov edx, [esp+40] /* edx = hold */ + mov ebx, [esp+44] /* ebx = bits */ + mov ebp, [esp+32] /* ebp = lcode */ + + cld + jmp L_do_loop + +ALIGN 4 +L_while_test: + cmp [esp+24], edi + jbe L_break_loop + cmp [esp+12], esi + jbe L_break_loop + +L_do_loop: + cmp bl, 15 + ja L_get_length_code /* if (15 < bits) */ + + xor eax, eax + lodsw /* al = *(ushort *)in++ */ + mov cl, bl /* cl = bits, needs it for shifting */ + add bl, 16 /* bits += 16 */ + shl eax, cl + or edx, eax /* hold |= *((ushort *)in)++ << bits */ + +L_get_length_code: + mov eax, [esp+56] /* eax = lmask */ + and eax, edx /* eax &= hold */ + mov eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */ + +L_dolen: + mov cl, ah /* cl = this.bits */ + sub bl, ah /* bits -= this.bits */ + shr edx, cl /* hold >>= this.bits */ + + test al, al + jnz L_test_for_length_base /* if (op != 0) 45.7% */ + + shr eax, 16 /* output this.val char */ + stosb + jmp L_while_test + +ALIGN 4 +L_test_for_length_base: + mov ecx, eax /* len = this */ + shr ecx, 16 /* len = this.val */ + mov [esp+64], ecx /* save len */ + mov cl, al + + test al, 16 + jz L_test_for_second_level_length /* if ((op & 16) == 0) 8% */ + and cl, 15 /* op &= 15 */ + jz L_decode_distance /* if (!op) */ + cmp bl, cl + jae L_add_bits_to_len /* if (op <= bits) */ + + mov ch, cl /* stash op in ch, freeing cl */ + xor eax, eax + lodsw /* al = *(ushort *)in++ */ + mov cl, bl /* cl = bits, needs it for shifting */ + add bl, 16 /* bits += 16 */ + shl eax, cl + or edx, eax /* hold |= *((ushort *)in)++ << bits */ + mov cl, ch /* move op back to ecx */ + +L_add_bits_to_len: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx /* eax &= hold */ + shr edx, cl + add [esp+64], eax /* len += hold & mask[op] */ + +L_decode_distance: + cmp bl, 15 + ja L_get_distance_code /* if (15 < bits) */ + + xor eax, eax + lodsw /* al = *(ushort *)in++ */ + mov cl, bl /* cl = bits, needs it for shifting */ + add bl, 16 /* bits += 16 */ + shl eax, cl + or edx, eax /* hold |= *((ushort *)in)++ << bits */ + +L_get_distance_code: + mov eax, [esp+60] /* eax = dmask */ + mov ecx, [esp+36] /* ecx = dcode */ + and eax, edx /* eax &= hold */ + mov eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */ + +L_dodist: + mov ebp, eax /* dist = this */ + shr ebp, 16 /* dist = this.val */ + mov cl, ah + sub bl, ah /* bits -= this.bits */ + shr edx, cl /* hold >>= this.bits */ + mov cl, al /* cl = this.op */ + + test al, 16 /* if ((op & 16) == 0) */ + jz L_test_for_second_level_dist + and cl, 15 /* op &= 15 */ + jz L_check_dist_one + cmp bl, cl + jae L_add_bits_to_dist /* if (op <= bits) 97.6% */ + + mov ch, cl /* stash op in ch, freeing cl */ + xor eax, eax + lodsw /* al = *(ushort *)in++ */ + mov cl, bl /* cl = bits, needs it for shifting */ + add bl, 16 /* bits += 16 */ + shl eax, cl + or edx, eax /* hold |= *((ushort *)in)++ << bits */ + mov cl, ch /* move op back to ecx */ + +L_add_bits_to_dist: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax /* (1 << op) - 1 */ + and eax, edx /* eax &= hold */ + shr edx, cl + add ebp, eax /* dist += hold & ((1 << op) - 1) */ + +L_check_window: + mov [esp+8], esi /* save in so from can use it's reg */ + mov eax, edi + sub eax, [esp+20] /* nbytes = out - beg */ + + cmp eax, ebp + jb L_clip_window /* if (dist > nbytes) 4.2% */ + + mov ecx, [esp+64] /* ecx = len */ + mov esi, edi + sub esi, ebp /* from = out - dist */ + + sar ecx, 1 + jnc L_copy_two + + rep movsw + mov al, [esi] + mov [edi], al + inc edi + + mov esi, [esp+8] /* move in back to %esi, toss from */ + mov ebp, [esp+32] /* ebp = lcode */ + jmp L_while_test + +L_copy_two: + rep movsw + mov esi, [esp+8] /* move in back to %esi, toss from */ + mov ebp, [esp+32] /* ebp = lcode */ + jmp L_while_test + +ALIGN 4 +L_check_dist_one: + cmp ebp, 1 /* if dist 1, is a memset */ + jne L_check_window + cmp [esp+20], edi + je L_check_window /* out == beg, if outside window */ + + mov ecx, [esp+64] /* ecx = len */ + mov al, [edi-1] + mov ah, al + + sar ecx, 1 + jnc L_set_two + mov [edi], al /* memset out with from[-1] */ + inc edi + +L_set_two: + rep stosw + mov ebp, [esp+32] /* ebp = lcode */ + jmp L_while_test + +ALIGN 4 +L_test_for_second_level_length: + test al, 64 + jnz L_test_for_end_of_block /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx /* eax &= hold */ + add eax, [esp+64] /* eax += len */ + mov eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/ + jmp L_dolen + +ALIGN 4 +L_test_for_second_level_dist: + test al, 64 + jnz L_invalid_distance_code /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx /* eax &= hold */ + add eax, ebp /* eax += dist */ + mov ecx, [esp+36] /* ecx = dcode */ + mov eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/ + jmp L_dodist + +ALIGN 4 +L_clip_window: + mov ecx, eax + mov eax, [esp+48] /* eax = wsize */ + neg ecx /* nbytes = -nbytes */ + mov esi, [esp+28] /* from = window */ + + cmp eax, ebp + jb L_invalid_distance_too_far /* if (dist > wsize) */ + + add ecx, ebp /* nbytes = dist - nbytes */ + cmp dword ptr [esp+52], 0 + jne L_wrap_around_window /* if (write != 0) */ + + sub eax, ecx + add esi, eax /* from += wsize - nbytes */ + + mov eax, [esp+64] /* eax = len */ + cmp eax, ecx + jbe L_do_copy /* if (nbytes >= len) */ + + sub eax, ecx /* len -= nbytes */ + rep movsb + mov esi, edi + sub esi, ebp /* from = out - dist */ + jmp L_do_copy + +ALIGN 4 +L_wrap_around_window: + mov eax, [esp+52] /* eax = write */ + cmp ecx, eax + jbe L_contiguous_in_window /* if (write >= nbytes) */ + + add esi, [esp+48] /* from += wsize */ + add esi, eax /* from += write */ + sub esi, ecx /* from -= nbytes */ + sub ecx, eax /* nbytes -= write */ + + mov eax, [esp+64] /* eax = len */ + cmp eax, ecx + jbe L_do_copy /* if (nbytes >= len) */ + + sub eax, ecx /* len -= nbytes */ + rep movsb + mov esi, [esp+28] /* from = window */ + mov ecx, [esp+52] /* nbytes = write */ + cmp eax, ecx + jbe L_do_copy /* if (nbytes >= len) */ + + sub eax, ecx /* len -= nbytes */ + rep movsb + mov esi, edi + sub esi, ebp /* from = out - dist */ + jmp L_do_copy + +ALIGN 4 +L_contiguous_in_window: + add esi, eax + sub esi, ecx /* from += write - nbytes */ + + mov eax, [esp+64] /* eax = len */ + cmp eax, ecx + jbe L_do_copy /* if (nbytes >= len) */ + + sub eax, ecx /* len -= nbytes */ + rep movsb + mov esi, edi + sub esi, ebp /* from = out - dist */ + jmp L_do_copy + +ALIGN 4 +L_do_copy: + mov ecx, eax + rep movsb + + mov esi, [esp+8] /* move in back to %esi, toss from */ + mov ebp, [esp+32] /* ebp = lcode */ + jmp L_while_test + +L_test_for_end_of_block: + test al, 32 + jz L_invalid_literal_length_code + mov dword ptr [esp+72], 1 + jmp L_break_loop_with_status + +L_invalid_literal_length_code: + mov dword ptr [esp+72], 2 + jmp L_break_loop_with_status + +L_invalid_distance_code: + mov dword ptr [esp+72], 3 + jmp L_break_loop_with_status + +L_invalid_distance_too_far: + mov esi, [esp+4] + mov dword ptr [esp+72], 4 + jmp L_break_loop_with_status + +L_break_loop: + mov dword ptr [esp+72], 0 + +L_break_loop_with_status: +/* put in, out, bits, and hold back into ar and pop esp */ + mov [esp+8], esi /* save in */ + mov [esp+16], edi /* save out */ + mov [esp+44], ebx /* save bits */ + mov [esp+40], edx /* save hold */ + mov ebp, [esp+4] /* restore esp, ebp */ + mov esp, [esp] + } +#else +#error "x86 architecture not defined" +#endif + + if (ar.status > 1) { + if (ar.status == 2) + strm->msg = "invalid literal/length code"; + else if (ar.status == 3) + strm->msg = "invalid distance code"; + else + strm->msg = "invalid distance too far back"; + state->mode = BAD; + } + else if ( ar.status == 1 ) { + state->mode = TYPE; + } + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + ar.len = ar.bits >> 3; + ar.in -= ar.len; + ar.bits -= ar.len << 3; + ar.hold &= (1U << ar.bits) - 1; + + /* update state and return */ + strm->next_in = ar.in; + strm->next_out = ar.out; + strm->avail_in = (unsigned)(ar.in < ar.last ? + PAD_AVAIL_IN + (ar.last - ar.in) : + PAD_AVAIL_IN - (ar.in - ar.last)); + strm->avail_out = (unsigned)(ar.out < ar.end ? + PAD_AVAIL_OUT + (ar.end - ar.out) : + PAD_AVAIL_OUT - (ar.out - ar.end)); + state->hold = ar.hold; + state->bits = ar.bits; + return; +} + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffast.S b/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffast.S new file mode 100644 index 0000000..2245a29 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/inflate86/inffast.S @@ -0,0 +1,1368 @@ +/* + * inffast.S is a hand tuned assembler version of: + * + * inffast.c -- fast decoding + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Copyright (C) 2003 Chris Anderson + * Please use the copyright conditions above. + * + * This version (Jan-23-2003) of inflate_fast was coded and tested under + * GNU/Linux on a pentium 3, using the gcc-3.2 compiler distribution. On that + * machine, I found that gzip style archives decompressed about 20% faster than + * the gcc-3.2 -O3 -fomit-frame-pointer compiled version. Your results will + * depend on how large of a buffer is used for z_stream.next_in & next_out + * (8K-32K worked best for my 256K cpu cache) and how much overhead there is in + * stream processing I/O and crc32/addler32. In my case, this routine used + * 70% of the cpu time and crc32 used 20%. + * + * I am confident that this version will work in the general case, but I have + * not tested a wide variety of datasets or a wide variety of platforms. + * + * Jan-24-2003 -- Added -DUSE_MMX define for slightly faster inflating. + * It should be a runtime flag instead of compile time flag... + * + * Jan-26-2003 -- Added runtime check for MMX support with cpuid instruction. + * With -DUSE_MMX, only MMX code is compiled. With -DNO_MMX, only non-MMX code + * is compiled. Without either option, runtime detection is enabled. Runtime + * detection should work on all modern cpus and the recomended algorithm (flip + * ID bit on eflags and then use the cpuid instruction) is used in many + * multimedia applications. Tested under win2k with gcc-2.95 and gas-2.12 + * distributed with cygwin3. Compiling with gcc-2.95 -c inffast.S -o + * inffast.obj generates a COFF object which can then be linked with MSVC++ + * compiled code. Tested under FreeBSD 4.7 with gcc-2.95. + * + * Jan-28-2003 -- Tested Athlon XP... MMX mode is slower than no MMX (and + * slower than compiler generated code). Adjusted cpuid check to use the MMX + * code only for Pentiums < P4 until I have more data on the P4. Speed + * improvment is only about 15% on the Athlon when compared with code generated + * with MSVC++. Not sure yet, but I think the P4 will also be slower using the + * MMX mode because many of it's x86 ALU instructions execute in .5 cycles and + * have less latency than MMX ops. Added code to buffer the last 11 bytes of + * the input stream since the MMX code grabs bits in chunks of 32, which + * differs from the inffast.c algorithm. I don't think there would have been + * read overruns where a page boundary was crossed (a segfault), but there + * could have been overruns when next_in ends on unaligned memory (unintialized + * memory read). + * + * Mar-13-2003 -- P4 MMX is slightly slower than P4 NO_MMX. I created a C + * version of the non-MMX code so that it doesn't depend on zstrm and zstate + * structure offsets which are hard coded in this file. This was last tested + * with zlib-1.2.0 which is currently in beta testing, newer versions of this + * and inffas86.c can be found at http://www.eetbeetee.com/zlib/ and + * http://www.charm.net/~christop/zlib/ + */ + + +/* + * if you have underscore linking problems (_inflate_fast undefined), try + * using -DGAS_COFF + */ +#if ! defined( GAS_COFF ) && ! defined( GAS_ELF ) + +#if defined( WIN32 ) || defined( __CYGWIN__ ) +#define GAS_COFF /* windows object format */ +#else +#define GAS_ELF +#endif + +#endif /* ! GAS_COFF && ! GAS_ELF */ + + +#if defined( GAS_COFF ) + +/* coff externals have underscores */ +#define inflate_fast _inflate_fast +#define inflate_fast_use_mmx _inflate_fast_use_mmx + +#endif /* GAS_COFF */ + + +.file "inffast.S" + +.globl inflate_fast + +.text +.align 4,0 +.L_invalid_literal_length_code_msg: +.string "invalid literal/length code" + +.align 4,0 +.L_invalid_distance_code_msg: +.string "invalid distance code" + +.align 4,0 +.L_invalid_distance_too_far_msg: +.string "invalid distance too far back" + +#if ! defined( NO_MMX ) +.align 4,0 +.L_mask: /* mask[N] = ( 1 << N ) - 1 */ +.long 0 +.long 1 +.long 3 +.long 7 +.long 15 +.long 31 +.long 63 +.long 127 +.long 255 +.long 511 +.long 1023 +.long 2047 +.long 4095 +.long 8191 +.long 16383 +.long 32767 +.long 65535 +.long 131071 +.long 262143 +.long 524287 +.long 1048575 +.long 2097151 +.long 4194303 +.long 8388607 +.long 16777215 +.long 33554431 +.long 67108863 +.long 134217727 +.long 268435455 +.long 536870911 +.long 1073741823 +.long 2147483647 +.long 4294967295 +#endif /* NO_MMX */ + +.text + +/* + * struct z_stream offsets, in zlib.h + */ +#define next_in_strm 0 /* strm->next_in */ +#define avail_in_strm 4 /* strm->avail_in */ +#define next_out_strm 12 /* strm->next_out */ +#define avail_out_strm 16 /* strm->avail_out */ +#define msg_strm 24 /* strm->msg */ +#define state_strm 28 /* strm->state */ + +/* + * struct inflate_state offsets, in inflate.h + */ +#define mode_state 0 /* state->mode */ +#define wsize_state 32 /* state->wsize */ +#define write_state 40 /* state->write */ +#define window_state 44 /* state->window */ +#define hold_state 48 /* state->hold */ +#define bits_state 52 /* state->bits */ +#define lencode_state 68 /* state->lencode */ +#define distcode_state 72 /* state->distcode */ +#define lenbits_state 76 /* state->lenbits */ +#define distbits_state 80 /* state->distbits */ + +/* + * inflate_fast's activation record + */ +#define local_var_size 64 /* how much local space for vars */ +#define strm_sp 88 /* first arg: z_stream * (local_var_size + 24) */ +#define start_sp 92 /* second arg: unsigned int (local_var_size + 28) */ + +/* + * offsets for local vars on stack + */ +#define out 60 /* unsigned char* */ +#define window 56 /* unsigned char* */ +#define wsize 52 /* unsigned int */ +#define write 48 /* unsigned int */ +#define in 44 /* unsigned char* */ +#define beg 40 /* unsigned char* */ +#define buf 28 /* char[ 12 ] */ +#define len 24 /* unsigned int */ +#define last 20 /* unsigned char* */ +#define end 16 /* unsigned char* */ +#define dcode 12 /* code* */ +#define lcode 8 /* code* */ +#define dmask 4 /* unsigned int */ +#define lmask 0 /* unsigned int */ + +/* + * typedef enum inflate_mode consts, in inflate.h + */ +#define INFLATE_MODE_TYPE 11 /* state->mode flags enum-ed in inflate.h */ +#define INFLATE_MODE_BAD 26 + + +#if ! defined( USE_MMX ) && ! defined( NO_MMX ) + +#define RUN_TIME_MMX + +#define CHECK_MMX 1 +#define DO_USE_MMX 2 +#define DONT_USE_MMX 3 + +.globl inflate_fast_use_mmx + +.data + +.align 4,0 +inflate_fast_use_mmx: /* integer flag for run time control 1=check,2=mmx,3=no */ +.long CHECK_MMX + +#if defined( GAS_ELF ) +/* elf info */ +.type inflate_fast_use_mmx,@object +.size inflate_fast_use_mmx,4 +#endif + +#endif /* RUN_TIME_MMX */ + +#if defined( GAS_COFF ) +/* coff info: scl 2 = extern, type 32 = function */ +.def inflate_fast; .scl 2; .type 32; .endef +#endif + +.text + +.align 32,0x90 +inflate_fast: + pushl %edi + pushl %esi + pushl %ebp + pushl %ebx + pushf /* save eflags (strm_sp, state_sp assumes this is 32 bits) */ + subl $local_var_size, %esp + cld + +#define strm_r %esi +#define state_r %edi + + movl strm_sp(%esp), strm_r + movl state_strm(strm_r), state_r + + /* in = strm->next_in; + * out = strm->next_out; + * last = in + strm->avail_in - 11; + * beg = out - (start - strm->avail_out); + * end = out + (strm->avail_out - 257); + */ + movl avail_in_strm(strm_r), %edx + movl next_in_strm(strm_r), %eax + + addl %eax, %edx /* avail_in += next_in */ + subl $11, %edx /* avail_in -= 11 */ + + movl %eax, in(%esp) + movl %edx, last(%esp) + + movl start_sp(%esp), %ebp + movl avail_out_strm(strm_r), %ecx + movl next_out_strm(strm_r), %ebx + + subl %ecx, %ebp /* start -= avail_out */ + negl %ebp /* start = -start */ + addl %ebx, %ebp /* start += next_out */ + + subl $257, %ecx /* avail_out -= 257 */ + addl %ebx, %ecx /* avail_out += out */ + + movl %ebx, out(%esp) + movl %ebp, beg(%esp) + movl %ecx, end(%esp) + + /* wsize = state->wsize; + * write = state->write; + * window = state->window; + * hold = state->hold; + * bits = state->bits; + * lcode = state->lencode; + * dcode = state->distcode; + * lmask = ( 1 << state->lenbits ) - 1; + * dmask = ( 1 << state->distbits ) - 1; + */ + + movl lencode_state(state_r), %eax + movl distcode_state(state_r), %ecx + + movl %eax, lcode(%esp) + movl %ecx, dcode(%esp) + + movl $1, %eax + movl lenbits_state(state_r), %ecx + shll %cl, %eax + decl %eax + movl %eax, lmask(%esp) + + movl $1, %eax + movl distbits_state(state_r), %ecx + shll %cl, %eax + decl %eax + movl %eax, dmask(%esp) + + movl wsize_state(state_r), %eax + movl write_state(state_r), %ecx + movl window_state(state_r), %edx + + movl %eax, wsize(%esp) + movl %ecx, write(%esp) + movl %edx, window(%esp) + + movl hold_state(state_r), %ebp + movl bits_state(state_r), %ebx + +#undef strm_r +#undef state_r + +#define in_r %esi +#define from_r %esi +#define out_r %edi + + movl in(%esp), in_r + movl last(%esp), %ecx + cmpl in_r, %ecx + ja .L_align_long /* if in < last */ + + addl $11, %ecx /* ecx = &in[ avail_in ] */ + subl in_r, %ecx /* ecx = avail_in */ + movl $12, %eax + subl %ecx, %eax /* eax = 12 - avail_in */ + leal buf(%esp), %edi + rep movsb /* memcpy( buf, in, avail_in ) */ + movl %eax, %ecx + xorl %eax, %eax + rep stosb /* memset( &buf[ avail_in ], 0, 12 - avail_in ) */ + leal buf(%esp), in_r /* in = buf */ + movl in_r, last(%esp) /* last = in, do just one iteration */ + jmp .L_is_aligned + + /* align in_r on long boundary */ +.L_align_long: + testl $3, in_r + jz .L_is_aligned + xorl %eax, %eax + movb (in_r), %al + incl in_r + movl %ebx, %ecx + addl $8, %ebx + shll %cl, %eax + orl %eax, %ebp + jmp .L_align_long + +.L_is_aligned: + movl out(%esp), out_r + +#if defined( NO_MMX ) + jmp .L_do_loop +#endif + +#if defined( USE_MMX ) + jmp .L_init_mmx +#endif + +/*** Runtime MMX check ***/ + +#if defined( RUN_TIME_MMX ) +.L_check_mmx: + cmpl $DO_USE_MMX, inflate_fast_use_mmx + je .L_init_mmx + ja .L_do_loop /* > 2 */ + + pushl %eax + pushl %ebx + pushl %ecx + pushl %edx + pushf + movl (%esp), %eax /* copy eflags to eax */ + xorl $0x200000, (%esp) /* try toggling ID bit of eflags (bit 21) + * to see if cpu supports cpuid... + * ID bit method not supported by NexGen but + * bios may load a cpuid instruction and + * cpuid may be disabled on Cyrix 5-6x86 */ + popf + pushf + popl %edx /* copy new eflags to edx */ + xorl %eax, %edx /* test if ID bit is flipped */ + jz .L_dont_use_mmx /* not flipped if zero */ + xorl %eax, %eax + cpuid + cmpl $0x756e6547, %ebx /* check for GenuineIntel in ebx,ecx,edx */ + jne .L_dont_use_mmx + cmpl $0x6c65746e, %ecx + jne .L_dont_use_mmx + cmpl $0x49656e69, %edx + jne .L_dont_use_mmx + movl $1, %eax + cpuid /* get cpu features */ + shrl $8, %eax + andl $15, %eax + cmpl $6, %eax /* check for Pentium family, is 0xf for P4 */ + jne .L_dont_use_mmx + testl $0x800000, %edx /* test if MMX feature is set (bit 23) */ + jnz .L_use_mmx + jmp .L_dont_use_mmx +.L_use_mmx: + movl $DO_USE_MMX, inflate_fast_use_mmx + jmp .L_check_mmx_pop +.L_dont_use_mmx: + movl $DONT_USE_MMX, inflate_fast_use_mmx +.L_check_mmx_pop: + popl %edx + popl %ecx + popl %ebx + popl %eax + jmp .L_check_mmx +#endif + + +/*** Non-MMX code ***/ + +#if defined ( NO_MMX ) || defined( RUN_TIME_MMX ) + +#define hold_r %ebp +#define bits_r %bl +#define bitslong_r %ebx + +.align 32,0x90 +.L_while_test: + /* while (in < last && out < end) + */ + cmpl out_r, end(%esp) + jbe .L_break_loop /* if (out >= end) */ + + cmpl in_r, last(%esp) + jbe .L_break_loop + +.L_do_loop: + /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out + * + * do { + * if (bits < 15) { + * hold |= *((unsigned short *)in)++ << bits; + * bits += 16 + * } + * this = lcode[hold & lmask] + */ + cmpb $15, bits_r + ja .L_get_length_code /* if (15 < bits) */ + + xorl %eax, %eax + lodsw /* al = *(ushort *)in++ */ + movb bits_r, %cl /* cl = bits, needs it for shifting */ + addb $16, bits_r /* bits += 16 */ + shll %cl, %eax + orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ + +.L_get_length_code: + movl lmask(%esp), %edx /* edx = lmask */ + movl lcode(%esp), %ecx /* ecx = lcode */ + andl hold_r, %edx /* edx &= hold */ + movl (%ecx,%edx,4), %eax /* eax = lcode[hold & lmask] */ + +.L_dolen: + /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out + * + * dolen: + * bits -= this.bits; + * hold >>= this.bits + */ + movb %ah, %cl /* cl = this.bits */ + subb %ah, bits_r /* bits -= this.bits */ + shrl %cl, hold_r /* hold >>= this.bits */ + + /* check if op is a literal + * if (op == 0) { + * PUP(out) = this.val; + * } + */ + testb %al, %al + jnz .L_test_for_length_base /* if (op != 0) 45.7% */ + + shrl $16, %eax /* output this.val char */ + stosb + jmp .L_while_test + +.L_test_for_length_base: + /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = len + * + * else if (op & 16) { + * len = this.val + * op &= 15 + * if (op) { + * if (op > bits) { + * hold |= *((unsigned short *)in)++ << bits; + * bits += 16 + * } + * len += hold & mask[op]; + * bits -= op; + * hold >>= op; + * } + */ +#define len_r %edx + movl %eax, len_r /* len = this */ + shrl $16, len_r /* len = this.val */ + movb %al, %cl + + testb $16, %al + jz .L_test_for_second_level_length /* if ((op & 16) == 0) 8% */ + andb $15, %cl /* op &= 15 */ + jz .L_save_len /* if (!op) */ + cmpb %cl, bits_r + jae .L_add_bits_to_len /* if (op <= bits) */ + + movb %cl, %ch /* stash op in ch, freeing cl */ + xorl %eax, %eax + lodsw /* al = *(ushort *)in++ */ + movb bits_r, %cl /* cl = bits, needs it for shifting */ + addb $16, bits_r /* bits += 16 */ + shll %cl, %eax + orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ + movb %ch, %cl /* move op back to ecx */ + +.L_add_bits_to_len: + movl $1, %eax + shll %cl, %eax + decl %eax + subb %cl, bits_r + andl hold_r, %eax /* eax &= hold */ + shrl %cl, hold_r + addl %eax, len_r /* len += hold & mask[op] */ + +.L_save_len: + movl len_r, len(%esp) /* save len */ +#undef len_r + +.L_decode_distance: + /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * + * if (bits < 15) { + * hold |= *((unsigned short *)in)++ << bits; + * bits += 16 + * } + * this = dcode[hold & dmask]; + * dodist: + * bits -= this.bits; + * hold >>= this.bits; + * op = this.op; + */ + + cmpb $15, bits_r + ja .L_get_distance_code /* if (15 < bits) */ + + xorl %eax, %eax + lodsw /* al = *(ushort *)in++ */ + movb bits_r, %cl /* cl = bits, needs it for shifting */ + addb $16, bits_r /* bits += 16 */ + shll %cl, %eax + orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ + +.L_get_distance_code: + movl dmask(%esp), %edx /* edx = dmask */ + movl dcode(%esp), %ecx /* ecx = dcode */ + andl hold_r, %edx /* edx &= hold */ + movl (%ecx,%edx,4), %eax /* eax = dcode[hold & dmask] */ + +#define dist_r %edx +.L_dodist: + movl %eax, dist_r /* dist = this */ + shrl $16, dist_r /* dist = this.val */ + movb %ah, %cl + subb %ah, bits_r /* bits -= this.bits */ + shrl %cl, hold_r /* hold >>= this.bits */ + + /* if (op & 16) { + * dist = this.val + * op &= 15 + * if (op > bits) { + * hold |= *((unsigned short *)in)++ << bits; + * bits += 16 + * } + * dist += hold & mask[op]; + * bits -= op; + * hold >>= op; + */ + movb %al, %cl /* cl = this.op */ + + testb $16, %al /* if ((op & 16) == 0) */ + jz .L_test_for_second_level_dist + andb $15, %cl /* op &= 15 */ + jz .L_check_dist_one + cmpb %cl, bits_r + jae .L_add_bits_to_dist /* if (op <= bits) 97.6% */ + + movb %cl, %ch /* stash op in ch, freeing cl */ + xorl %eax, %eax + lodsw /* al = *(ushort *)in++ */ + movb bits_r, %cl /* cl = bits, needs it for shifting */ + addb $16, bits_r /* bits += 16 */ + shll %cl, %eax + orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */ + movb %ch, %cl /* move op back to ecx */ + +.L_add_bits_to_dist: + movl $1, %eax + shll %cl, %eax + decl %eax /* (1 << op) - 1 */ + subb %cl, bits_r + andl hold_r, %eax /* eax &= hold */ + shrl %cl, hold_r + addl %eax, dist_r /* dist += hold & ((1 << op) - 1) */ + jmp .L_check_window + +.L_check_window: + /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * %ecx = nbytes + * + * nbytes = out - beg; + * if (dist <= nbytes) { + * from = out - dist; + * do { + * PUP(out) = PUP(from); + * } while (--len > 0) { + * } + */ + + movl in_r, in(%esp) /* save in so from can use it's reg */ + movl out_r, %eax + subl beg(%esp), %eax /* nbytes = out - beg */ + + cmpl dist_r, %eax + jb .L_clip_window /* if (dist > nbytes) 4.2% */ + + movl len(%esp), %ecx + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + + subl $3, %ecx + movb (from_r), %al + movb %al, (out_r) + movb 1(from_r), %al + movb 2(from_r), %dl + addl $3, from_r + movb %al, 1(out_r) + movb %dl, 2(out_r) + addl $3, out_r + rep movsb + + movl in(%esp), in_r /* move in back to %esi, toss from */ + jmp .L_while_test + +.align 16,0x90 +.L_check_dist_one: + cmpl $1, dist_r + jne .L_check_window + cmpl out_r, beg(%esp) + je .L_check_window + + decl out_r + movl len(%esp), %ecx + movb (out_r), %al + subl $3, %ecx + + movb %al, 1(out_r) + movb %al, 2(out_r) + movb %al, 3(out_r) + addl $4, out_r + rep stosb + + jmp .L_while_test + +.align 16,0x90 +.L_test_for_second_level_length: + /* else if ((op & 64) == 0) { + * this = lcode[this.val + (hold & mask[op])]; + * } + */ + testb $64, %al + jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */ + + movl $1, %eax + shll %cl, %eax + decl %eax + andl hold_r, %eax /* eax &= hold */ + addl %edx, %eax /* eax += this.val */ + movl lcode(%esp), %edx /* edx = lcode */ + movl (%edx,%eax,4), %eax /* eax = lcode[val + (hold&mask[op])] */ + jmp .L_dolen + +.align 16,0x90 +.L_test_for_second_level_dist: + /* else if ((op & 64) == 0) { + * this = dcode[this.val + (hold & mask[op])]; + * } + */ + testb $64, %al + jnz .L_invalid_distance_code /* if ((op & 64) != 0) */ + + movl $1, %eax + shll %cl, %eax + decl %eax + andl hold_r, %eax /* eax &= hold */ + addl %edx, %eax /* eax += this.val */ + movl dcode(%esp), %edx /* edx = dcode */ + movl (%edx,%eax,4), %eax /* eax = dcode[val + (hold&mask[op])] */ + jmp .L_dodist + +.align 16,0x90 +.L_clip_window: + /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * %ecx = nbytes + * + * else { + * if (dist > wsize) { + * invalid distance + * } + * from = window; + * nbytes = dist - nbytes; + * if (write == 0) { + * from += wsize - nbytes; + */ +#define nbytes_r %ecx + movl %eax, nbytes_r + movl wsize(%esp), %eax /* prepare for dist compare */ + negl nbytes_r /* nbytes = -nbytes */ + movl window(%esp), from_r /* from = window */ + + cmpl dist_r, %eax + jb .L_invalid_distance_too_far /* if (dist > wsize) */ + + addl dist_r, nbytes_r /* nbytes = dist - nbytes */ + cmpl $0, write(%esp) + jne .L_wrap_around_window /* if (write != 0) */ + + subl nbytes_r, %eax + addl %eax, from_r /* from += wsize - nbytes */ + + /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * %ecx = nbytes, %eax = len + * + * if (nbytes < len) { + * len -= nbytes; + * do { + * PUP(out) = PUP(from); + * } while (--nbytes); + * from = out - dist; + * } + * } + */ +#define len_r %eax + movl len(%esp), len_r + cmpl nbytes_r, len_r + jbe .L_do_copy1 /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1 + + cmpl nbytes_r, len_r + jbe .L_do_copy1 /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1 + +.L_wrap_around_window: + /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * %ecx = nbytes, %eax = write, %eax = len + * + * else if (write < nbytes) { + * from += wsize + write - nbytes; + * nbytes -= write; + * if (nbytes < len) { + * len -= nbytes; + * do { + * PUP(out) = PUP(from); + * } while (--nbytes); + * from = window; + * nbytes = write; + * if (nbytes < len) { + * len -= nbytes; + * do { + * PUP(out) = PUP(from); + * } while(--nbytes); + * from = out - dist; + * } + * } + * } + */ +#define write_r %eax + movl write(%esp), write_r + cmpl write_r, nbytes_r + jbe .L_contiguous_in_window /* if (write >= nbytes) */ + + addl wsize(%esp), from_r + addl write_r, from_r + subl nbytes_r, from_r /* from += wsize + write - nbytes */ + subl write_r, nbytes_r /* nbytes -= write */ +#undef write_r + + movl len(%esp), len_r + cmpl nbytes_r, len_r + jbe .L_do_copy1 /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl window(%esp), from_r /* from = window */ + movl write(%esp), nbytes_r /* nbytes = write */ + cmpl nbytes_r, len_r + jbe .L_do_copy1 /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1 + +.L_contiguous_in_window: + /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist + * %ecx = nbytes, %eax = write, %eax = len + * + * else { + * from += write - nbytes; + * if (nbytes < len) { + * len -= nbytes; + * do { + * PUP(out) = PUP(from); + * } while (--nbytes); + * from = out - dist; + * } + * } + */ +#define write_r %eax + addl write_r, from_r + subl nbytes_r, from_r /* from += write - nbytes */ +#undef write_r + + movl len(%esp), len_r + cmpl nbytes_r, len_r + jbe .L_do_copy1 /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + +.L_do_copy1: + /* regs: %esi = from, %esi = in, %ebp = hold, %bl = bits, %edi = out + * %eax = len + * + * while (len > 0) { + * PUP(out) = PUP(from); + * len--; + * } + * } + * } while (in < last && out < end); + */ +#undef nbytes_r +#define in_r %esi + movl len_r, %ecx + rep movsb + + movl in(%esp), in_r /* move in back to %esi, toss from */ + jmp .L_while_test + +#undef len_r +#undef dist_r + +#endif /* NO_MMX || RUN_TIME_MMX */ + + +/*** MMX code ***/ + +#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) + +.align 32,0x90 +.L_init_mmx: + emms + +#undef bits_r +#undef bitslong_r +#define bitslong_r %ebp +#define hold_mm %mm0 + movd %ebp, hold_mm + movl %ebx, bitslong_r + +#define used_mm %mm1 +#define dmask2_mm %mm2 +#define lmask2_mm %mm3 +#define lmask_mm %mm4 +#define dmask_mm %mm5 +#define tmp_mm %mm6 + + movd lmask(%esp), lmask_mm + movq lmask_mm, lmask2_mm + movd dmask(%esp), dmask_mm + movq dmask_mm, dmask2_mm + pxor used_mm, used_mm + movl lcode(%esp), %ebx /* ebx = lcode */ + jmp .L_do_loop_mmx + +.align 32,0x90 +.L_while_test_mmx: + /* while (in < last && out < end) + */ + cmpl out_r, end(%esp) + jbe .L_break_loop /* if (out >= end) */ + + cmpl in_r, last(%esp) + jbe .L_break_loop + +.L_do_loop_mmx: + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + + cmpl $32, bitslong_r + ja .L_get_length_code_mmx /* if (32 < bits) */ + + movd bitslong_r, tmp_mm + movd (in_r), %mm7 + addl $4, in_r + psllq tmp_mm, %mm7 + addl $32, bitslong_r + por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */ + +.L_get_length_code_mmx: + pand hold_mm, lmask_mm + movd lmask_mm, %eax + movq lmask2_mm, lmask_mm + movl (%ebx,%eax,4), %eax /* eax = lcode[hold & lmask] */ + +.L_dolen_mmx: + movzbl %ah, %ecx /* ecx = this.bits */ + movd %ecx, used_mm + subl %ecx, bitslong_r /* bits -= this.bits */ + + testb %al, %al + jnz .L_test_for_length_base_mmx /* if (op != 0) 45.7% */ + + shrl $16, %eax /* output this.val char */ + stosb + jmp .L_while_test_mmx + +.L_test_for_length_base_mmx: +#define len_r %edx + movl %eax, len_r /* len = this */ + shrl $16, len_r /* len = this.val */ + + testb $16, %al + jz .L_test_for_second_level_length_mmx /* if ((op & 16) == 0) 8% */ + andl $15, %eax /* op &= 15 */ + jz .L_decode_distance_mmx /* if (!op) */ + + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + movd %eax, used_mm + movd hold_mm, %ecx + subl %eax, bitslong_r + andl .L_mask(,%eax,4), %ecx + addl %ecx, len_r /* len += hold & mask[op] */ + +.L_decode_distance_mmx: + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + + cmpl $32, bitslong_r + ja .L_get_dist_code_mmx /* if (32 < bits) */ + + movd bitslong_r, tmp_mm + movd (in_r), %mm7 + addl $4, in_r + psllq tmp_mm, %mm7 + addl $32, bitslong_r + por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */ + +.L_get_dist_code_mmx: + movl dcode(%esp), %ebx /* ebx = dcode */ + pand hold_mm, dmask_mm + movd dmask_mm, %eax + movq dmask2_mm, dmask_mm + movl (%ebx,%eax,4), %eax /* eax = dcode[hold & lmask] */ + +.L_dodist_mmx: +#define dist_r %ebx + movzbl %ah, %ecx /* ecx = this.bits */ + movl %eax, dist_r + shrl $16, dist_r /* dist = this.val */ + subl %ecx, bitslong_r /* bits -= this.bits */ + movd %ecx, used_mm + + testb $16, %al /* if ((op & 16) == 0) */ + jz .L_test_for_second_level_dist_mmx + andl $15, %eax /* op &= 15 */ + jz .L_check_dist_one_mmx + +.L_add_bits_to_dist_mmx: + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + movd %eax, used_mm /* save bit length of current op */ + movd hold_mm, %ecx /* get the next bits on input stream */ + subl %eax, bitslong_r /* bits -= op bits */ + andl .L_mask(,%eax,4), %ecx /* ecx = hold & mask[op] */ + addl %ecx, dist_r /* dist += hold & mask[op] */ + +.L_check_window_mmx: + movl in_r, in(%esp) /* save in so from can use it's reg */ + movl out_r, %eax + subl beg(%esp), %eax /* nbytes = out - beg */ + + cmpl dist_r, %eax + jb .L_clip_window_mmx /* if (dist > nbytes) 4.2% */ + + movl len_r, %ecx + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + + subl $3, %ecx + movb (from_r), %al + movb %al, (out_r) + movb 1(from_r), %al + movb 2(from_r), %dl + addl $3, from_r + movb %al, 1(out_r) + movb %dl, 2(out_r) + addl $3, out_r + rep movsb + + movl in(%esp), in_r /* move in back to %esi, toss from */ + movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ + jmp .L_while_test_mmx + +.align 16,0x90 +.L_check_dist_one_mmx: + cmpl $1, dist_r + jne .L_check_window_mmx + cmpl out_r, beg(%esp) + je .L_check_window_mmx + + decl out_r + movl len_r, %ecx + movb (out_r), %al + subl $3, %ecx + + movb %al, 1(out_r) + movb %al, 2(out_r) + movb %al, 3(out_r) + addl $4, out_r + rep stosb + + movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ + jmp .L_while_test_mmx + +.align 16,0x90 +.L_test_for_second_level_length_mmx: + testb $64, %al + jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */ + + andl $15, %eax + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + movd hold_mm, %ecx + andl .L_mask(,%eax,4), %ecx + addl len_r, %ecx + movl (%ebx,%ecx,4), %eax /* eax = lcode[hold & lmask] */ + jmp .L_dolen_mmx + +.align 16,0x90 +.L_test_for_second_level_dist_mmx: + testb $64, %al + jnz .L_invalid_distance_code /* if ((op & 64) != 0) */ + + andl $15, %eax + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + movd hold_mm, %ecx + andl .L_mask(,%eax,4), %ecx + movl dcode(%esp), %eax /* ecx = dcode */ + addl dist_r, %ecx + movl (%eax,%ecx,4), %eax /* eax = lcode[hold & lmask] */ + jmp .L_dodist_mmx + +.align 16,0x90 +.L_clip_window_mmx: +#define nbytes_r %ecx + movl %eax, nbytes_r + movl wsize(%esp), %eax /* prepare for dist compare */ + negl nbytes_r /* nbytes = -nbytes */ + movl window(%esp), from_r /* from = window */ + + cmpl dist_r, %eax + jb .L_invalid_distance_too_far /* if (dist > wsize) */ + + addl dist_r, nbytes_r /* nbytes = dist - nbytes */ + cmpl $0, write(%esp) + jne .L_wrap_around_window_mmx /* if (write != 0) */ + + subl nbytes_r, %eax + addl %eax, from_r /* from += wsize - nbytes */ + + cmpl nbytes_r, len_r + jbe .L_do_copy1_mmx /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1_mmx + + cmpl nbytes_r, len_r + jbe .L_do_copy1_mmx /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1_mmx + +.L_wrap_around_window_mmx: +#define write_r %eax + movl write(%esp), write_r + cmpl write_r, nbytes_r + jbe .L_contiguous_in_window_mmx /* if (write >= nbytes) */ + + addl wsize(%esp), from_r + addl write_r, from_r + subl nbytes_r, from_r /* from += wsize + write - nbytes */ + subl write_r, nbytes_r /* nbytes -= write */ +#undef write_r + + cmpl nbytes_r, len_r + jbe .L_do_copy1_mmx /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl window(%esp), from_r /* from = window */ + movl write(%esp), nbytes_r /* nbytes = write */ + cmpl nbytes_r, len_r + jbe .L_do_copy1_mmx /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + jmp .L_do_copy1_mmx + +.L_contiguous_in_window_mmx: +#define write_r %eax + addl write_r, from_r + subl nbytes_r, from_r /* from += write - nbytes */ +#undef write_r + + cmpl nbytes_r, len_r + jbe .L_do_copy1_mmx /* if (nbytes >= len) */ + + subl nbytes_r, len_r /* len -= nbytes */ + rep movsb + movl out_r, from_r + subl dist_r, from_r /* from = out - dist */ + +.L_do_copy1_mmx: +#undef nbytes_r +#define in_r %esi + movl len_r, %ecx + rep movsb + + movl in(%esp), in_r /* move in back to %esi, toss from */ + movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */ + jmp .L_while_test_mmx + +#undef hold_r +#undef bitslong_r + +#endif /* USE_MMX || RUN_TIME_MMX */ + + +/*** USE_MMX, NO_MMX, and RUNTIME_MMX from here on ***/ + +.L_invalid_distance_code: + /* else { + * strm->msg = "invalid distance code"; + * state->mode = BAD; + * } + */ + movl $.L_invalid_distance_code_msg, %ecx + movl $INFLATE_MODE_BAD, %edx + jmp .L_update_stream_state + +.L_test_for_end_of_block: + /* else if (op & 32) { + * state->mode = TYPE; + * break; + * } + */ + testb $32, %al + jz .L_invalid_literal_length_code /* if ((op & 32) == 0) */ + + movl $0, %ecx + movl $INFLATE_MODE_TYPE, %edx + jmp .L_update_stream_state + +.L_invalid_literal_length_code: + /* else { + * strm->msg = "invalid literal/length code"; + * state->mode = BAD; + * } + */ + movl $.L_invalid_literal_length_code_msg, %ecx + movl $INFLATE_MODE_BAD, %edx + jmp .L_update_stream_state + +.L_invalid_distance_too_far: + /* strm->msg = "invalid distance too far back"; + * state->mode = BAD; + */ + movl in(%esp), in_r /* from_r has in's reg, put in back */ + movl $.L_invalid_distance_too_far_msg, %ecx + movl $INFLATE_MODE_BAD, %edx + jmp .L_update_stream_state + +.L_update_stream_state: + /* set strm->msg = %ecx, strm->state->mode = %edx */ + movl strm_sp(%esp), %eax + testl %ecx, %ecx /* if (msg != NULL) */ + jz .L_skip_msg + movl %ecx, msg_strm(%eax) /* strm->msg = msg */ +.L_skip_msg: + movl state_strm(%eax), %eax /* state = strm->state */ + movl %edx, mode_state(%eax) /* state->mode = edx (BAD | TYPE) */ + jmp .L_break_loop + +.align 32,0x90 +.L_break_loop: + +/* + * Regs: + * + * bits = %ebp when mmx, and in %ebx when non-mmx + * hold = %hold_mm when mmx, and in %ebp when non-mmx + * in = %esi + * out = %edi + */ + +#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) + +#if defined( RUN_TIME_MMX ) + + cmpl $DO_USE_MMX, inflate_fast_use_mmx + jne .L_update_next_in + +#endif /* RUN_TIME_MMX */ + + movl %ebp, %ebx + +.L_update_next_in: + +#endif + +#define strm_r %eax +#define state_r %edx + + /* len = bits >> 3; + * in -= len; + * bits -= len << 3; + * hold &= (1U << bits) - 1; + * state->hold = hold; + * state->bits = bits; + * strm->next_in = in; + * strm->next_out = out; + */ + movl strm_sp(%esp), strm_r + movl %ebx, %ecx + movl state_strm(strm_r), state_r + shrl $3, %ecx + subl %ecx, in_r + shll $3, %ecx + subl %ecx, %ebx + movl out_r, next_out_strm(strm_r) + movl %ebx, bits_state(state_r) + movl %ebx, %ecx + + leal buf(%esp), %ebx + cmpl %ebx, last(%esp) + jne .L_buf_not_used /* if buf != last */ + + subl %ebx, in_r /* in -= buf */ + movl next_in_strm(strm_r), %ebx + movl %ebx, last(%esp) /* last = strm->next_in */ + addl %ebx, in_r /* in += strm->next_in */ + movl avail_in_strm(strm_r), %ebx + subl $11, %ebx + addl %ebx, last(%esp) /* last = &strm->next_in[ avail_in - 11 ] */ + +.L_buf_not_used: + movl in_r, next_in_strm(strm_r) + + movl $1, %ebx + shll %cl, %ebx + decl %ebx + +#if defined( USE_MMX ) || defined( RUN_TIME_MMX ) + +#if defined( RUN_TIME_MMX ) + + cmpl $DO_USE_MMX, inflate_fast_use_mmx + jne .L_update_hold + +#endif /* RUN_TIME_MMX */ + + psrlq used_mm, hold_mm /* hold_mm >>= last bit length */ + movd hold_mm, %ebp + + emms + +.L_update_hold: + +#endif /* USE_MMX || RUN_TIME_MMX */ + + andl %ebx, %ebp + movl %ebp, hold_state(state_r) + +#define last_r %ebx + + /* strm->avail_in = in < last ? 11 + (last - in) : 11 - (in - last) */ + movl last(%esp), last_r + cmpl in_r, last_r + jbe .L_last_is_smaller /* if (in >= last) */ + + subl in_r, last_r /* last -= in */ + addl $11, last_r /* last += 11 */ + movl last_r, avail_in_strm(strm_r) + jmp .L_fixup_out +.L_last_is_smaller: + subl last_r, in_r /* in -= last */ + negl in_r /* in = -in */ + addl $11, in_r /* in += 11 */ + movl in_r, avail_in_strm(strm_r) + +#undef last_r +#define end_r %ebx + +.L_fixup_out: + /* strm->avail_out = out < end ? 257 + (end - out) : 257 - (out - end)*/ + movl end(%esp), end_r + cmpl out_r, end_r + jbe .L_end_is_smaller /* if (out >= end) */ + + subl out_r, end_r /* end -= out */ + addl $257, end_r /* end += 257 */ + movl end_r, avail_out_strm(strm_r) + jmp .L_done +.L_end_is_smaller: + subl end_r, out_r /* out -= end */ + negl out_r /* out = -out */ + addl $257, out_r /* out += 257 */ + movl out_r, avail_out_strm(strm_r) + +#undef end_r +#undef strm_r +#undef state_r + +.L_done: + addl $local_var_size, %esp + popf + popl %ebx + popl %ebp + popl %esi + popl %edi + ret + +#if defined( GAS_ELF ) +/* elf info */ +.type inflate_fast,@function +.size inflate_fast,.-inflate_fast +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream/test.cpp b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/test.cpp new file mode 100644 index 0000000..7d265b3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/test.cpp @@ -0,0 +1,24 @@ + +#include "zfstream.h" + +int main() { + + // Construct a stream object with this filebuffer. Anything sent + // to this stream will go to standard out. + gzofstream os( 1, ios::out ); + + // This text is getting compressed and sent to stdout. + // To prove this, run 'test | zcat'. + os << "Hello, Mommy" << endl; + + os << setcompressionlevel( Z_NO_COMPRESSION ); + os << "hello, hello, hi, ho!" << endl; + + setcompressionlevel( os, Z_DEFAULT_COMPRESSION ) + << "I'm compressing again" << endl; + + os.close(); + + return 0; + +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.cpp b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.cpp new file mode 100644 index 0000000..d0cd85f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.cpp @@ -0,0 +1,329 @@ + +#include "zfstream.h" + +gzfilebuf::gzfilebuf() : + file(NULL), + mode(0), + own_file_descriptor(0) +{ } + +gzfilebuf::~gzfilebuf() { + + sync(); + if ( own_file_descriptor ) + close(); + +} + +gzfilebuf *gzfilebuf::open( const char *name, + int io_mode ) { + + if ( is_open() ) + return NULL; + + char char_mode[10]; + char *p = char_mode; + + if ( io_mode & ios::in ) { + mode = ios::in; + *p++ = 'r'; + } else if ( io_mode & ios::app ) { + mode = ios::app; + *p++ = 'a'; + } else { + mode = ios::out; + *p++ = 'w'; + } + + if ( io_mode & ios::binary ) { + mode |= ios::binary; + *p++ = 'b'; + } + + // Hard code the compression level + if ( io_mode & (ios::out|ios::app )) { + *p++ = '9'; + } + + // Put the end-of-string indicator + *p = '\0'; + + if ( (file = gzopen(name, char_mode)) == NULL ) + return NULL; + + own_file_descriptor = 1; + + return this; + +} + +gzfilebuf *gzfilebuf::attach( int file_descriptor, + int io_mode ) { + + if ( is_open() ) + return NULL; + + char char_mode[10]; + char *p = char_mode; + + if ( io_mode & ios::in ) { + mode = ios::in; + *p++ = 'r'; + } else if ( io_mode & ios::app ) { + mode = ios::app; + *p++ = 'a'; + } else { + mode = ios::out; + *p++ = 'w'; + } + + if ( io_mode & ios::binary ) { + mode |= ios::binary; + *p++ = 'b'; + } + + // Hard code the compression level + if ( io_mode & (ios::out|ios::app )) { + *p++ = '9'; + } + + // Put the end-of-string indicator + *p = '\0'; + + if ( (file = gzdopen(file_descriptor, char_mode)) == NULL ) + return NULL; + + own_file_descriptor = 0; + + return this; + +} + +gzfilebuf *gzfilebuf::close() { + + if ( is_open() ) { + + sync(); + gzclose( file ); + file = NULL; + + } + + return this; + +} + +int gzfilebuf::setcompressionlevel( int comp_level ) { + + return gzsetparams(file, comp_level, -2); + +} + +int gzfilebuf::setcompressionstrategy( int comp_strategy ) { + + return gzsetparams(file, -2, comp_strategy); + +} + + +streampos gzfilebuf::seekoff( streamoff off, ios::seek_dir dir, int which ) { + + return streampos(EOF); + +} + +int gzfilebuf::underflow() { + + // If the file hasn't been opened for reading, error. + if ( !is_open() || !(mode & ios::in) ) + return EOF; + + // if a buffer doesn't exists, allocate one. + if ( !base() ) { + + if ( (allocate()) == EOF ) + return EOF; + setp(0,0); + + } else { + + if ( in_avail() ) + return (unsigned char) *gptr(); + + if ( out_waiting() ) { + if ( flushbuf() == EOF ) + return EOF; + } + + } + + // Attempt to fill the buffer. + + int result = fillbuf(); + if ( result == EOF ) { + // disable get area + setg(0,0,0); + return EOF; + } + + return (unsigned char) *gptr(); + +} + +int gzfilebuf::overflow( int c ) { + + if ( !is_open() || !(mode & ios::out) ) + return EOF; + + if ( !base() ) { + if ( allocate() == EOF ) + return EOF; + setg(0,0,0); + } else { + if (in_avail()) { + return EOF; + } + if (out_waiting()) { + if (flushbuf() == EOF) + return EOF; + } + } + + int bl = blen(); + setp( base(), base() + bl); + + if ( c != EOF ) { + + *pptr() = c; + pbump(1); + + } + + return 0; + +} + +int gzfilebuf::sync() { + + if ( !is_open() ) + return EOF; + + if ( out_waiting() ) + return flushbuf(); + + return 0; + +} + +int gzfilebuf::flushbuf() { + + int n; + char *q; + + q = pbase(); + n = pptr() - q; + + if ( gzwrite( file, q, n) < n ) + return EOF; + + setp(0,0); + + return 0; + +} + +int gzfilebuf::fillbuf() { + + int required; + char *p; + + p = base(); + + required = blen(); + + int t = gzread( file, p, required ); + + if ( t <= 0) return EOF; + + setg( base(), base(), base()+t); + + return t; + +} + +gzfilestream_common::gzfilestream_common() : + ios( gzfilestream_common::rdbuf() ) +{ } + +gzfilestream_common::~gzfilestream_common() +{ } + +void gzfilestream_common::attach( int fd, int io_mode ) { + + if ( !buffer.attach( fd, io_mode) ) + clear( ios::failbit | ios::badbit ); + else + clear(); + +} + +void gzfilestream_common::open( const char *name, int io_mode ) { + + if ( !buffer.open( name, io_mode ) ) + clear( ios::failbit | ios::badbit ); + else + clear(); + +} + +void gzfilestream_common::close() { + + if ( !buffer.close() ) + clear( ios::failbit | ios::badbit ); + +} + +gzfilebuf *gzfilestream_common::rdbuf() +{ + return &buffer; +} + +gzifstream::gzifstream() : + ios( gzfilestream_common::rdbuf() ) +{ + clear( ios::badbit ); +} + +gzifstream::gzifstream( const char *name, int io_mode ) : + ios( gzfilestream_common::rdbuf() ) +{ + gzfilestream_common::open( name, io_mode ); +} + +gzifstream::gzifstream( int fd, int io_mode ) : + ios( gzfilestream_common::rdbuf() ) +{ + gzfilestream_common::attach( fd, io_mode ); +} + +gzifstream::~gzifstream() { } + +gzofstream::gzofstream() : + ios( gzfilestream_common::rdbuf() ) +{ + clear( ios::badbit ); +} + +gzofstream::gzofstream( const char *name, int io_mode ) : + ios( gzfilestream_common::rdbuf() ) +{ + gzfilestream_common::open( name, io_mode ); +} + +gzofstream::gzofstream( int fd, int io_mode ) : + ios( gzfilestream_common::rdbuf() ) +{ + gzfilestream_common::attach( fd, io_mode ); +} + +gzofstream::~gzofstream() { } diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.h b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.h new file mode 100644 index 0000000..ed79098 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream/zfstream.h @@ -0,0 +1,128 @@ + +#ifndef zfstream_h +#define zfstream_h + +#include +#include "zlib.h" + +class gzfilebuf : public streambuf { + +public: + + gzfilebuf( ); + virtual ~gzfilebuf(); + + gzfilebuf *open( const char *name, int io_mode ); + gzfilebuf *attach( int file_descriptor, int io_mode ); + gzfilebuf *close(); + + int setcompressionlevel( int comp_level ); + int setcompressionstrategy( int comp_strategy ); + + inline int is_open() const { return (file !=NULL); } + + virtual streampos seekoff( streamoff, ios::seek_dir, int ); + + virtual int sync(); + +protected: + + virtual int underflow(); + virtual int overflow( int = EOF ); + +private: + + gzFile file; + short mode; + short own_file_descriptor; + + int flushbuf(); + int fillbuf(); + +}; + +class gzfilestream_common : virtual public ios { + + friend class gzifstream; + friend class gzofstream; + friend gzofstream &setcompressionlevel( gzofstream &, int ); + friend gzofstream &setcompressionstrategy( gzofstream &, int ); + +public: + virtual ~gzfilestream_common(); + + void attach( int fd, int io_mode ); + void open( const char *name, int io_mode ); + void close(); + +protected: + gzfilestream_common(); + +private: + gzfilebuf *rdbuf(); + + gzfilebuf buffer; + +}; + +class gzifstream : public gzfilestream_common, public istream { + +public: + + gzifstream(); + gzifstream( const char *name, int io_mode = ios::in ); + gzifstream( int fd, int io_mode = ios::in ); + + virtual ~gzifstream(); + +}; + +class gzofstream : public gzfilestream_common, public ostream { + +public: + + gzofstream(); + gzofstream( const char *name, int io_mode = ios::out ); + gzofstream( int fd, int io_mode = ios::out ); + + virtual ~gzofstream(); + +}; + +template class gzomanip { + friend gzofstream &operator<<(gzofstream &, const gzomanip &); +public: + gzomanip(gzofstream &(*f)(gzofstream &, T), T v) : func(f), val(v) { } +private: + gzofstream &(*func)(gzofstream &, T); + T val; +}; + +template gzofstream &operator<<(gzofstream &s, const gzomanip &m) +{ + return (*m.func)(s, m.val); +} + +inline gzofstream &setcompressionlevel( gzofstream &s, int l ) +{ + (s.rdbuf())->setcompressionlevel(l); + return s; +} + +inline gzofstream &setcompressionstrategy( gzofstream &s, int l ) +{ + (s.rdbuf())->setcompressionstrategy(l); + return s; +} + +inline gzomanip setcompressionlevel(int l) +{ + return gzomanip(&setcompressionlevel,l); +} + +inline gzomanip setcompressionstrategy(int l) +{ + return gzomanip(&setcompressionstrategy,l); +} + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream.h b/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream.h new file mode 100644 index 0000000..43d2332 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream.h @@ -0,0 +1,307 @@ +/* + * + * Copyright (c) 1997 + * Christian Michelsen Research AS + * Advanced Computing + * Fantoftvegen 38, 5036 BERGEN, Norway + * http://www.cmr.no + * + * 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. Christian Michelsen Research AS makes no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + */ + +#ifndef ZSTREAM__H +#define ZSTREAM__H + +/* + * zstream.h - C++ interface to the 'zlib' general purpose compression library + * $Id: zstream.h 1.1 1997-06-25 12:00:56+02 tyge Exp tyge $ + */ + +#include +#include +#include +#include "zlib.h" + +#if defined(_WIN32) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +class zstringlen { +public: + zstringlen(class izstream&); + zstringlen(class ozstream&, const char*); + size_t value() const { return val.word; } +private: + struct Val { unsigned char byte; size_t word; } val; +}; + +// ----------------------------- izstream ----------------------------- + +class izstream +{ + public: + izstream() : m_fp(0) {} + izstream(FILE* fp) : m_fp(0) { open(fp); } + izstream(const char* name) : m_fp(0) { open(name); } + ~izstream() { close(); } + + /* Opens a gzip (.gz) file for reading. + * open() can be used to read a file which is not in gzip format; + * in this case read() will directly read from the file without + * decompression. errno can be checked to distinguish two error + * cases (if errno is zero, the zlib error is Z_MEM_ERROR). + */ + void open(const char* name) { + if (m_fp) close(); + m_fp = ::gzopen(name, "rb"); + } + + void open(FILE* fp) { + SET_BINARY_MODE(fp); + if (m_fp) close(); + m_fp = ::gzdopen(fileno(fp), "rb"); + } + + /* Flushes all pending input if necessary, closes the compressed file + * and deallocates all the (de)compression state. The return value is + * the zlib error number (see function error() below). + */ + int close() { + int r = ::gzclose(m_fp); + m_fp = 0; return r; + } + + /* Binary read the given number of bytes from the compressed file. + */ + int read(void* buf, size_t len) { + return ::gzread(m_fp, buf, len); + } + + /* Returns the error message for the last error which occurred on the + * given compressed file. errnum is set to zlib error number. If an + * error occurred in the file system and not in the compression library, + * errnum is set to Z_ERRNO and the application may consult errno + * to get the exact error code. + */ + const char* error(int* errnum) { + return ::gzerror(m_fp, errnum); + } + + gzFile fp() { return m_fp; } + + private: + gzFile m_fp; +}; + +/* + * Binary read the given (array of) object(s) from the compressed file. + * If the input file was not in gzip format, read() copies the objects number + * of bytes into the buffer. + * returns the number of uncompressed bytes actually read + * (0 for end of file, -1 for error). + */ +template +inline int read(izstream& zs, T* x, Items items) { + return ::gzread(zs.fp(), x, items*sizeof(T)); +} + +/* + * Binary input with the '>' operator. + */ +template +inline izstream& operator>(izstream& zs, T& x) { + ::gzread(zs.fp(), &x, sizeof(T)); + return zs; +} + + +inline zstringlen::zstringlen(izstream& zs) { + zs > val.byte; + if (val.byte == 255) zs > val.word; + else val.word = val.byte; +} + +/* + * Read length of string + the string with the '>' operator. + */ +inline izstream& operator>(izstream& zs, char* x) { + zstringlen len(zs); + ::gzread(zs.fp(), x, len.value()); + x[len.value()] = '\0'; + return zs; +} + +inline char* read_string(izstream& zs) { + zstringlen len(zs); + char* x = new char[len.value()+1]; + ::gzread(zs.fp(), x, len.value()); + x[len.value()] = '\0'; + return x; +} + +// ----------------------------- ozstream ----------------------------- + +class ozstream +{ + public: + ozstream() : m_fp(0), m_os(0) { + } + ozstream(FILE* fp, int level = Z_DEFAULT_COMPRESSION) + : m_fp(0), m_os(0) { + open(fp, level); + } + ozstream(const char* name, int level = Z_DEFAULT_COMPRESSION) + : m_fp(0), m_os(0) { + open(name, level); + } + ~ozstream() { + close(); + } + + /* Opens a gzip (.gz) file for writing. + * The compression level parameter should be in 0..9 + * errno can be checked to distinguish two error cases + * (if errno is zero, the zlib error is Z_MEM_ERROR). + */ + void open(const char* name, int level = Z_DEFAULT_COMPRESSION) { + char mode[4] = "wb\0"; + if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level; + if (m_fp) close(); + m_fp = ::gzopen(name, mode); + } + + /* open from a FILE pointer. + */ + void open(FILE* fp, int level = Z_DEFAULT_COMPRESSION) { + SET_BINARY_MODE(fp); + char mode[4] = "wb\0"; + if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level; + if (m_fp) close(); + m_fp = ::gzdopen(fileno(fp), mode); + } + + /* Flushes all pending output if necessary, closes the compressed file + * and deallocates all the (de)compression state. The return value is + * the zlib error number (see function error() below). + */ + int close() { + if (m_os) { + ::gzwrite(m_fp, m_os->str(), m_os->pcount()); + delete[] m_os->str(); delete m_os; m_os = 0; + } + int r = ::gzclose(m_fp); m_fp = 0; return r; + } + + /* Binary write the given number of bytes into the compressed file. + */ + int write(const void* buf, size_t len) { + return ::gzwrite(m_fp, (voidp) buf, len); + } + + /* Flushes all pending output into the compressed file. The parameter + * _flush is as in the deflate() function. The return value is the zlib + * error number (see function gzerror below). flush() returns Z_OK if + * the flush_ parameter is Z_FINISH and all output could be flushed. + * flush() should be called only when strictly necessary because it can + * degrade compression. + */ + int flush(int _flush) { + os_flush(); + return ::gzflush(m_fp, _flush); + } + + /* Returns the error message for the last error which occurred on the + * given compressed file. errnum is set to zlib error number. If an + * error occurred in the file system and not in the compression library, + * errnum is set to Z_ERRNO and the application may consult errno + * to get the exact error code. + */ + const char* error(int* errnum) { + return ::gzerror(m_fp, errnum); + } + + gzFile fp() { return m_fp; } + + ostream& os() { + if (m_os == 0) m_os = new ostrstream; + return *m_os; + } + + void os_flush() { + if (m_os && m_os->pcount()>0) { + ostrstream* oss = new ostrstream; + oss->fill(m_os->fill()); + oss->flags(m_os->flags()); + oss->precision(m_os->precision()); + oss->width(m_os->width()); + ::gzwrite(m_fp, m_os->str(), m_os->pcount()); + delete[] m_os->str(); delete m_os; m_os = oss; + } + } + + private: + gzFile m_fp; + ostrstream* m_os; +}; + +/* + * Binary write the given (array of) object(s) into the compressed file. + * returns the number of uncompressed bytes actually written + * (0 in case of error). + */ +template +inline int write(ozstream& zs, const T* x, Items items) { + return ::gzwrite(zs.fp(), (voidp) x, items*sizeof(T)); +} + +/* + * Binary output with the '<' operator. + */ +template +inline ozstream& operator<(ozstream& zs, const T& x) { + ::gzwrite(zs.fp(), (voidp) &x, sizeof(T)); + return zs; +} + +inline zstringlen::zstringlen(ozstream& zs, const char* x) { + val.byte = 255; val.word = ::strlen(x); + if (val.word < 255) zs < (val.byte = val.word); + else zs < val; +} + +/* + * Write length of string + the string with the '<' operator. + */ +inline ozstream& operator<(ozstream& zs, const char* x) { + zstringlen len(zs, x); + ::gzwrite(zs.fp(), (voidp) x, len.value()); + return zs; +} + +#ifdef _MSC_VER +inline ozstream& operator<(ozstream& zs, char* const& x) { + return zs < (const char*) x; +} +#endif + +/* + * Ascii write with the << operator; + */ +template +inline ostream& operator<<(ozstream& zs, const T& x) { + zs.os_flush(); + return zs.os() << x; +} + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream_test.cpp b/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream_test.cpp new file mode 100644 index 0000000..6273f62 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream2/zstream_test.cpp @@ -0,0 +1,25 @@ +#include "zstream.h" +#include +#include +#include + +void main() { + char h[256] = "Hello"; + char* g = "Goodbye"; + ozstream out("temp.gz"); + out < "This works well" < h < g; + out.close(); + + izstream in("temp.gz"); // read it back + char *x = read_string(in), *y = new char[256], z[256]; + in > y > z; + in.close(); + cout << x << endl << y << endl << z << endl; + + out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results + out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; + out << z << endl << y << endl << x << endl; + out << 1.1234567890123456789 << endl; + + delete[] x; delete[] y; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/README b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/README new file mode 100644 index 0000000..f7b319a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/README @@ -0,0 +1,35 @@ +These classes provide a C++ stream interface to the zlib library. It allows you +to do things like: + + gzofstream outf("blah.gz"); + outf << "These go into the gzip file " << 123 << endl; + +It does this by deriving a specialized stream buffer for gzipped files, which is +the way Stroustrup would have done it. :-> + +The gzifstream and gzofstream classes were originally written by Kevin Ruland +and made available in the zlib contrib/iostream directory. The older version still +compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of +this version. + +The new classes are as standard-compliant as possible, closely following the +approach of the standard library's fstream classes. It compiles under gcc versions +3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard +library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs +from the previous one in the following respects: +- added showmanyc +- added setbuf, with support for unbuffered output via setbuf(0,0) +- a few bug fixes of stream behavior +- gzipped output file opened with default compression level instead of maximum level +- setcompressionlevel()/strategy() members replaced by single setcompression() + +The code is provided "as is", with the permission to use, copy, modify, distribute +and sell it for any purpose without fee. + +Ludwig Schwardt + + +DSP Lab +Electrical & Electronic Engineering Department +University of Stellenbosch +South Africa diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/TODO b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/TODO new file mode 100644 index 0000000..7032f97 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/TODO @@ -0,0 +1,17 @@ +Possible upgrades to gzfilebuf: + +- The ability to do putback (e.g. putbackfail) + +- The ability to seek (zlib supports this, but could be slow/tricky) + +- Simultaneous read/write access (does it make sense?) + +- Support for ios_base::ate open mode + +- Locale support? + +- Check public interface to see which calls give problems + (due to dependence on library internals) + +- Override operator<<(ostream&, gzfilebuf*) to allow direct copying + of stream buffer to stream ( i.e. os << is.rdbuf(); ) diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/test.cc b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/test.cc new file mode 100644 index 0000000..9423533 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/test.cc @@ -0,0 +1,50 @@ +/* + * Test program for gzifstream and gzofstream + * + * by Ludwig Schwardt + * original version by Kevin Ruland + */ + +#include "zfstream.h" +#include // for cout + +int main() { + + gzofstream outf; + gzifstream inf; + char buf[80]; + + outf.open("test1.txt.gz"); + outf << "The quick brown fox sidestepped the lazy canine\n" + << 1.3 << "\nPlan " << 9 << std::endl; + outf.close(); + std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n" + << "The quick brown fox sidestepped the lazy canine\n" + << 1.3 << "\nPlan " << 9 << std::endl; + + std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n"; + inf.open("test1.txt.gz"); + while (inf.getline(buf,80,'\n')) { + std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; + } + inf.close(); + + outf.rdbuf()->pubsetbuf(0,0); + outf.open("test2.txt.gz"); + outf << setcompression(Z_NO_COMPRESSION) + << "The quick brown fox sidestepped the lazy canine\n" + << 1.3 << "\nPlan " << 9 << std::endl; + outf.close(); + std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form"; + + std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n"; + inf.rdbuf()->pubsetbuf(0,0); + inf.open("test2.txt.gz"); + while (inf.getline(buf,80,'\n')) { + std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n"; + } + inf.close(); + + return 0; + +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.cc b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.cc new file mode 100644 index 0000000..94eb933 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.cc @@ -0,0 +1,479 @@ +/* + * A C++ I/O streams interface to the zlib gz* functions + * + * by Ludwig Schwardt + * original version by Kevin Ruland + * + * This version is standard-compliant and compatible with gcc 3.x. + */ + +#include "zfstream.h" +#include // for strcpy, strcat, strlen (mode strings) +#include // for BUFSIZ + +// Internal buffer sizes (default and "unbuffered" versions) +#define BIGBUFSIZE BUFSIZ +#define SMALLBUFSIZE 1 + +/*****************************************************************************/ + +// Default constructor +gzfilebuf::gzfilebuf() +: file(NULL), io_mode(std::ios_base::openmode(0)), own_fd(false), + buffer(NULL), buffer_size(BIGBUFSIZE), own_buffer(true) +{ + // No buffers to start with + this->disable_buffer(); +} + +// Destructor +gzfilebuf::~gzfilebuf() +{ + // Sync output buffer and close only if responsible for file + // (i.e. attached streams should be left open at this stage) + this->sync(); + if (own_fd) + this->close(); + // Make sure internal buffer is deallocated + this->disable_buffer(); +} + +// Set compression level and strategy +int +gzfilebuf::setcompression(int comp_level, + int comp_strategy) +{ + return gzsetparams(file, comp_level, comp_strategy); +} + +// Open gzipped file +gzfilebuf* +gzfilebuf::open(const char *name, + std::ios_base::openmode mode) +{ + // Fail if file already open + if (this->is_open()) + return NULL; + // Don't support simultaneous read/write access (yet) + if ((mode & std::ios_base::in) && (mode & std::ios_base::out)) + return NULL; + + // Build mode string for gzopen and check it [27.8.1.3.2] + char char_mode[6] = "\0\0\0\0\0"; + if (!this->open_mode(mode, char_mode)) + return NULL; + + // Attempt to open file + if ((file = gzopen(name, char_mode)) == NULL) + return NULL; + + // On success, allocate internal buffer and set flags + this->enable_buffer(); + io_mode = mode; + own_fd = true; + return this; +} + +// Attach to gzipped file +gzfilebuf* +gzfilebuf::attach(int fd, + std::ios_base::openmode mode) +{ + // Fail if file already open + if (this->is_open()) + return NULL; + // Don't support simultaneous read/write access (yet) + if ((mode & std::ios_base::in) && (mode & std::ios_base::out)) + return NULL; + + // Build mode string for gzdopen and check it [27.8.1.3.2] + char char_mode[6] = "\0\0\0\0\0"; + if (!this->open_mode(mode, char_mode)) + return NULL; + + // Attempt to attach to file + if ((file = gzdopen(fd, char_mode)) == NULL) + return NULL; + + // On success, allocate internal buffer and set flags + this->enable_buffer(); + io_mode = mode; + own_fd = false; + return this; +} + +// Close gzipped file +gzfilebuf* +gzfilebuf::close() +{ + // Fail immediately if no file is open + if (!this->is_open()) + return NULL; + // Assume success + gzfilebuf* retval = this; + // Attempt to sync and close gzipped file + if (this->sync() == -1) + retval = NULL; + if (gzclose(file) < 0) + retval = NULL; + // File is now gone anyway (postcondition [27.8.1.3.8]) + file = NULL; + own_fd = false; + // Destroy internal buffer if it exists + this->disable_buffer(); + return retval; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Convert int open mode to mode string +bool +gzfilebuf::open_mode(std::ios_base::openmode mode, + char* c_mode) const +{ + bool testb = mode & std::ios_base::binary; + bool testi = mode & std::ios_base::in; + bool testo = mode & std::ios_base::out; + bool testt = mode & std::ios_base::trunc; + bool testa = mode & std::ios_base::app; + + // Check for valid flag combinations - see [27.8.1.3.2] (Table 92) + // Original zfstream hardcoded the compression level to maximum here... + // Double the time for less than 1% size improvement seems + // excessive though - keeping it at the default level + // To change back, just append "9" to the next three mode strings + if (!testi && testo && !testt && !testa) + strcpy(c_mode, "w"); + if (!testi && testo && !testt && testa) + strcpy(c_mode, "a"); + if (!testi && testo && testt && !testa) + strcpy(c_mode, "w"); + if (testi && !testo && !testt && !testa) + strcpy(c_mode, "r"); + // No read/write mode yet +// if (testi && testo && !testt && !testa) +// strcpy(c_mode, "r+"); +// if (testi && testo && testt && !testa) +// strcpy(c_mode, "w+"); + + // Mode string should be empty for invalid combination of flags + if (strlen(c_mode) == 0) + return false; + if (testb) + strcat(c_mode, "b"); + return true; +} + +// Determine number of characters in internal get buffer +std::streamsize +gzfilebuf::showmanyc() +{ + // Calls to underflow will fail if file not opened for reading + if (!this->is_open() || !(io_mode & std::ios_base::in)) + return -1; + // Make sure get area is in use + if (this->gptr() && (this->gptr() < this->egptr())) + return std::streamsize(this->egptr() - this->gptr()); + else + return 0; +} + +// Fill get area from gzipped file +gzfilebuf::int_type +gzfilebuf::underflow() +{ + // If something is left in the get area by chance, return it + // (this shouldn't normally happen, as underflow is only supposed + // to be called when gptr >= egptr, but it serves as error check) + if (this->gptr() && (this->gptr() < this->egptr())) + return traits_type::to_int_type(*(this->gptr())); + + // If the file hasn't been opened for reading, produce error + if (!this->is_open() || !(io_mode & std::ios_base::in)) + return traits_type::eof(); + + // Attempt to fill internal buffer from gzipped file + // (buffer must be guaranteed to exist...) + int bytes_read = gzread(file, buffer, buffer_size); + // Indicates error or EOF + if (bytes_read <= 0) + { + // Reset get area + this->setg(buffer, buffer, buffer); + return traits_type::eof(); + } + // Make all bytes read from file available as get area + this->setg(buffer, buffer, buffer + bytes_read); + + // Return next character in get area + return traits_type::to_int_type(*(this->gptr())); +} + +// Write put area to gzipped file +gzfilebuf::int_type +gzfilebuf::overflow(int_type c) +{ + // Determine whether put area is in use + if (this->pbase()) + { + // Double-check pointer range + if (this->pptr() > this->epptr() || this->pptr() < this->pbase()) + return traits_type::eof(); + // Add extra character to buffer if not EOF + if (!traits_type::eq_int_type(c, traits_type::eof())) + { + *(this->pptr()) = traits_type::to_char_type(c); + this->pbump(1); + } + // Number of characters to write to file + int bytes_to_write = this->pptr() - this->pbase(); + // Overflow doesn't fail if nothing is to be written + if (bytes_to_write > 0) + { + // If the file hasn't been opened for writing, produce error + if (!this->is_open() || !(io_mode & std::ios_base::out)) + return traits_type::eof(); + // If gzipped file won't accept all bytes written to it, fail + if (gzwrite(file, this->pbase(), bytes_to_write) != bytes_to_write) + return traits_type::eof(); + // Reset next pointer to point to pbase on success + this->pbump(-bytes_to_write); + } + } + // Write extra character to file if not EOF + else if (!traits_type::eq_int_type(c, traits_type::eof())) + { + // If the file hasn't been opened for writing, produce error + if (!this->is_open() || !(io_mode & std::ios_base::out)) + return traits_type::eof(); + // Impromptu char buffer (allows "unbuffered" output) + char_type last_char = traits_type::to_char_type(c); + // If gzipped file won't accept this character, fail + if (gzwrite(file, &last_char, 1) != 1) + return traits_type::eof(); + } + + // If you got here, you have succeeded (even if c was EOF) + // The return value should therefore be non-EOF + if (traits_type::eq_int_type(c, traits_type::eof())) + return traits_type::not_eof(c); + else + return c; +} + +// Assign new buffer +std::streambuf* +gzfilebuf::setbuf(char_type* p, + std::streamsize n) +{ + // First make sure stuff is sync'ed, for safety + if (this->sync() == -1) + return NULL; + // If buffering is turned off on purpose via setbuf(0,0), still allocate one... + // "Unbuffered" only really refers to put [27.8.1.4.10], while get needs at + // least a buffer of size 1 (very inefficient though, therefore make it bigger?) + // This follows from [27.5.2.4.3]/12 (gptr needs to point at something, it seems) + if (!p || !n) + { + // Replace existing buffer (if any) with small internal buffer + this->disable_buffer(); + buffer = NULL; + buffer_size = 0; + own_buffer = true; + this->enable_buffer(); + } + else + { + // Replace existing buffer (if any) with external buffer + this->disable_buffer(); + buffer = p; + buffer_size = n; + own_buffer = false; + this->enable_buffer(); + } + return this; +} + +// Write put area to gzipped file (i.e. ensures that put area is empty) +int +gzfilebuf::sync() +{ + return traits_type::eq_int_type(this->overflow(), traits_type::eof()) ? -1 : 0; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// Allocate internal buffer +void +gzfilebuf::enable_buffer() +{ + // If internal buffer required, allocate one + if (own_buffer && !buffer) + { + // Check for buffered vs. "unbuffered" + if (buffer_size > 0) + { + // Allocate internal buffer + buffer = new char_type[buffer_size]; + // Get area starts empty and will be expanded by underflow as need arises + this->setg(buffer, buffer, buffer); + // Setup entire internal buffer as put area. + // The one-past-end pointer actually points to the last element of the buffer, + // so that overflow(c) can safely add the extra character c to the sequence. + // These pointers remain in place for the duration of the buffer + this->setp(buffer, buffer + buffer_size - 1); + } + else + { + // Even in "unbuffered" case, (small?) get buffer is still required + buffer_size = SMALLBUFSIZE; + buffer = new char_type[buffer_size]; + this->setg(buffer, buffer, buffer); + // "Unbuffered" means no put buffer + this->setp(0, 0); + } + } + else + { + // If buffer already allocated, reset buffer pointers just to make sure no + // stale chars are lying around + this->setg(buffer, buffer, buffer); + this->setp(buffer, buffer + buffer_size - 1); + } +} + +// Destroy internal buffer +void +gzfilebuf::disable_buffer() +{ + // If internal buffer exists, deallocate it + if (own_buffer && buffer) + { + // Preserve unbuffered status by zeroing size + if (!this->pbase()) + buffer_size = 0; + delete[] buffer; + buffer = NULL; + this->setg(0, 0, 0); + this->setp(0, 0); + } + else + { + // Reset buffer pointers to initial state if external buffer exists + this->setg(buffer, buffer, buffer); + if (buffer) + this->setp(buffer, buffer + buffer_size - 1); + else + this->setp(0, 0); + } +} + +/*****************************************************************************/ + +// Default constructor initializes stream buffer +gzifstream::gzifstream() +: std::istream(NULL), sb() +{ this->init(&sb); } + +// Initialize stream buffer and open file +gzifstream::gzifstream(const char* name, + std::ios_base::openmode mode) +: std::istream(NULL), sb() +{ + this->init(&sb); + this->open(name, mode); +} + +// Initialize stream buffer and attach to file +gzifstream::gzifstream(int fd, + std::ios_base::openmode mode) +: std::istream(NULL), sb() +{ + this->init(&sb); + this->attach(fd, mode); +} + +// Open file and go into fail() state if unsuccessful +void +gzifstream::open(const char* name, + std::ios_base::openmode mode) +{ + if (!sb.open(name, mode | std::ios_base::in)) + this->setstate(std::ios_base::failbit); + else + this->clear(); +} + +// Attach to file and go into fail() state if unsuccessful +void +gzifstream::attach(int fd, + std::ios_base::openmode mode) +{ + if (!sb.attach(fd, mode | std::ios_base::in)) + this->setstate(std::ios_base::failbit); + else + this->clear(); +} + +// Close file +void +gzifstream::close() +{ + if (!sb.close()) + this->setstate(std::ios_base::failbit); +} + +/*****************************************************************************/ + +// Default constructor initializes stream buffer +gzofstream::gzofstream() +: std::ostream(NULL), sb() +{ this->init(&sb); } + +// Initialize stream buffer and open file +gzofstream::gzofstream(const char* name, + std::ios_base::openmode mode) +: std::ostream(NULL), sb() +{ + this->init(&sb); + this->open(name, mode); +} + +// Initialize stream buffer and attach to file +gzofstream::gzofstream(int fd, + std::ios_base::openmode mode) +: std::ostream(NULL), sb() +{ + this->init(&sb); + this->attach(fd, mode); +} + +// Open file and go into fail() state if unsuccessful +void +gzofstream::open(const char* name, + std::ios_base::openmode mode) +{ + if (!sb.open(name, mode | std::ios_base::out)) + this->setstate(std::ios_base::failbit); + else + this->clear(); +} + +// Attach to file and go into fail() state if unsuccessful +void +gzofstream::attach(int fd, + std::ios_base::openmode mode) +{ + if (!sb.attach(fd, mode | std::ios_base::out)) + this->setstate(std::ios_base::failbit); + else + this->clear(); +} + +// Close file +void +gzofstream::close() +{ + if (!sb.close()) + this->setstate(std::ios_base::failbit); +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.h b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.h new file mode 100644 index 0000000..8574479 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/iostream3/zfstream.h @@ -0,0 +1,466 @@ +/* + * A C++ I/O streams interface to the zlib gz* functions + * + * by Ludwig Schwardt + * original version by Kevin Ruland + * + * This version is standard-compliant and compatible with gcc 3.x. + */ + +#ifndef ZFSTREAM_H +#define ZFSTREAM_H + +#include // not iostream, since we don't need cin/cout +#include +#include "zlib.h" + +/*****************************************************************************/ + +/** + * @brief Gzipped file stream buffer class. + * + * This class implements basic_filebuf for gzipped files. It doesn't yet support + * seeking (allowed by zlib but slow/limited), putback and read/write access + * (tricky). Otherwise, it attempts to be a drop-in replacement for the standard + * file streambuf. +*/ +class gzfilebuf : public std::streambuf +{ +public: + // Default constructor. + gzfilebuf(); + + // Destructor. + virtual + ~gzfilebuf(); + + /** + * @brief Set compression level and strategy on the fly. + * @param comp_level Compression level (see zlib.h for allowed values) + * @param comp_strategy Compression strategy (see zlib.h for allowed values) + * @return Z_OK on success, Z_STREAM_ERROR otherwise. + * + * Unfortunately, these parameters cannot be modified separately, as the + * previous zfstream version assumed. Since the strategy is seldom changed, + * it can default and setcompression(level) then becomes like the old + * setcompressionlevel(level). + */ + int + setcompression(int comp_level, + int comp_strategy = Z_DEFAULT_STRATEGY); + + /** + * @brief Check if file is open. + * @return True if file is open. + */ + bool + is_open() const { return (file != NULL); } + + /** + * @brief Open gzipped file. + * @param name File name. + * @param mode Open mode flags. + * @return @c this on success, NULL on failure. + */ + gzfilebuf* + open(const char* name, + std::ios_base::openmode mode); + + /** + * @brief Attach to already open gzipped file. + * @param fd File descriptor. + * @param mode Open mode flags. + * @return @c this on success, NULL on failure. + */ + gzfilebuf* + attach(int fd, + std::ios_base::openmode mode); + + /** + * @brief Close gzipped file. + * @return @c this on success, NULL on failure. + */ + gzfilebuf* + close(); + +protected: + /** + * @brief Convert ios open mode int to mode string used by zlib. + * @return True if valid mode flag combination. + */ + bool + open_mode(std::ios_base::openmode mode, + char* c_mode) const; + + /** + * @brief Number of characters available in stream buffer. + * @return Number of characters. + * + * This indicates number of characters in get area of stream buffer. + * These characters can be read without accessing the gzipped file. + */ + virtual std::streamsize + showmanyc(); + + /** + * @brief Fill get area from gzipped file. + * @return First character in get area on success, EOF on error. + * + * This actually reads characters from gzipped file to stream + * buffer. Always buffered. + */ + virtual int_type + underflow(); + + /** + * @brief Write put area to gzipped file. + * @param c Extra character to add to buffer contents. + * @return Non-EOF on success, EOF on error. + * + * This actually writes characters in stream buffer to + * gzipped file. With unbuffered output this is done one + * character at a time. + */ + virtual int_type + overflow(int_type c = traits_type::eof()); + + /** + * @brief Installs external stream buffer. + * @param p Pointer to char buffer. + * @param n Size of external buffer. + * @return @c this on success, NULL on failure. + * + * Call setbuf(0,0) to enable unbuffered output. + */ + virtual std::streambuf* + setbuf(char_type* p, + std::streamsize n); + + /** + * @brief Flush stream buffer to file. + * @return 0 on success, -1 on error. + * + * This calls underflow(EOF) to do the job. + */ + virtual int + sync(); + +// +// Some future enhancements +// +// virtual int_type uflow(); +// virtual int_type pbackfail(int_type c = traits_type::eof()); +// virtual pos_type +// seekoff(off_type off, +// std::ios_base::seekdir way, +// std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out); +// virtual pos_type +// seekpos(pos_type sp, +// std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out); + +private: + /** + * @brief Allocate internal buffer. + * + * This function is safe to call multiple times. It will ensure + * that a proper internal buffer exists if it is required. If the + * buffer already exists or is external, the buffer pointers will be + * reset to their original state. + */ + void + enable_buffer(); + + /** + * @brief Destroy internal buffer. + * + * This function is safe to call multiple times. It will ensure + * that the internal buffer is deallocated if it exists. In any + * case, it will also reset the buffer pointers. + */ + void + disable_buffer(); + + /** + * Underlying file pointer. + */ + gzFile file; + + /** + * Mode in which file was opened. + */ + std::ios_base::openmode io_mode; + + /** + * @brief True if this object owns file descriptor. + * + * This makes the class responsible for closing the file + * upon destruction. + */ + bool own_fd; + + /** + * @brief Stream buffer. + * + * For simplicity this remains allocated on the free store for the + * entire life span of the gzfilebuf object, unless replaced by setbuf. + */ + char_type* buffer; + + /** + * @brief Stream buffer size. + * + * Defaults to system default buffer size (typically 8192 bytes). + * Modified by setbuf. + */ + std::streamsize buffer_size; + + /** + * @brief True if this object owns stream buffer. + * + * This makes the class responsible for deleting the buffer + * upon destruction. + */ + bool own_buffer; +}; + +/*****************************************************************************/ + +/** + * @brief Gzipped file input stream class. + * + * This class implements ifstream for gzipped files. Seeking and putback + * is not supported yet. +*/ +class gzifstream : public std::istream +{ +public: + // Default constructor + gzifstream(); + + /** + * @brief Construct stream on gzipped file to be opened. + * @param name File name. + * @param mode Open mode flags (forced to contain ios::in). + */ + explicit + gzifstream(const char* name, + std::ios_base::openmode mode = std::ios_base::in); + + /** + * @brief Construct stream on already open gzipped file. + * @param fd File descriptor. + * @param mode Open mode flags (forced to contain ios::in). + */ + explicit + gzifstream(int fd, + std::ios_base::openmode mode = std::ios_base::in); + + /** + * Obtain underlying stream buffer. + */ + gzfilebuf* + rdbuf() const + { return const_cast(&sb); } + + /** + * @brief Check if file is open. + * @return True if file is open. + */ + bool + is_open() { return sb.is_open(); } + + /** + * @brief Open gzipped file. + * @param name File name. + * @param mode Open mode flags (forced to contain ios::in). + * + * Stream will be in state good() if file opens successfully; + * otherwise in state fail(). This differs from the behavior of + * ifstream, which never sets the state to good() and therefore + * won't allow you to reuse the stream for a second file unless + * you manually clear() the state. The choice is a matter of + * convenience. + */ + void + open(const char* name, + std::ios_base::openmode mode = std::ios_base::in); + + /** + * @brief Attach to already open gzipped file. + * @param fd File descriptor. + * @param mode Open mode flags (forced to contain ios::in). + * + * Stream will be in state good() if attach succeeded; otherwise + * in state fail(). + */ + void + attach(int fd, + std::ios_base::openmode mode = std::ios_base::in); + + /** + * @brief Close gzipped file. + * + * Stream will be in state fail() if close failed. + */ + void + close(); + +private: + /** + * Underlying stream buffer. + */ + gzfilebuf sb; +}; + +/*****************************************************************************/ + +/** + * @brief Gzipped file output stream class. + * + * This class implements ofstream for gzipped files. Seeking and putback + * is not supported yet. +*/ +class gzofstream : public std::ostream +{ +public: + // Default constructor + gzofstream(); + + /** + * @brief Construct stream on gzipped file to be opened. + * @param name File name. + * @param mode Open mode flags (forced to contain ios::out). + */ + explicit + gzofstream(const char* name, + std::ios_base::openmode mode = std::ios_base::out); + + /** + * @brief Construct stream on already open gzipped file. + * @param fd File descriptor. + * @param mode Open mode flags (forced to contain ios::out). + */ + explicit + gzofstream(int fd, + std::ios_base::openmode mode = std::ios_base::out); + + /** + * Obtain underlying stream buffer. + */ + gzfilebuf* + rdbuf() const + { return const_cast(&sb); } + + /** + * @brief Check if file is open. + * @return True if file is open. + */ + bool + is_open() { return sb.is_open(); } + + /** + * @brief Open gzipped file. + * @param name File name. + * @param mode Open mode flags (forced to contain ios::out). + * + * Stream will be in state good() if file opens successfully; + * otherwise in state fail(). This differs from the behavior of + * ofstream, which never sets the state to good() and therefore + * won't allow you to reuse the stream for a second file unless + * you manually clear() the state. The choice is a matter of + * convenience. + */ + void + open(const char* name, + std::ios_base::openmode mode = std::ios_base::out); + + /** + * @brief Attach to already open gzipped file. + * @param fd File descriptor. + * @param mode Open mode flags (forced to contain ios::out). + * + * Stream will be in state good() if attach succeeded; otherwise + * in state fail(). + */ + void + attach(int fd, + std::ios_base::openmode mode = std::ios_base::out); + + /** + * @brief Close gzipped file. + * + * Stream will be in state fail() if close failed. + */ + void + close(); + +private: + /** + * Underlying stream buffer. + */ + gzfilebuf sb; +}; + +/*****************************************************************************/ + +/** + * @brief Gzipped file output stream manipulator class. + * + * This class defines a two-argument manipulator for gzofstream. It is used + * as base for the setcompression(int,int) manipulator. +*/ +template + class gzomanip2 + { + public: + // Allows insertor to peek at internals + template + friend gzofstream& + operator<<(gzofstream&, + const gzomanip2&); + + // Constructor + gzomanip2(gzofstream& (*f)(gzofstream&, T1, T2), + T1 v1, + T2 v2); + private: + // Underlying manipulator function + gzofstream& + (*func)(gzofstream&, T1, T2); + + // Arguments for manipulator function + T1 val1; + T2 val2; + }; + +/*****************************************************************************/ + +// Manipulator function thunks through to stream buffer +inline gzofstream& +setcompression(gzofstream &gzs, int l, int s = Z_DEFAULT_STRATEGY) +{ + (gzs.rdbuf())->setcompression(l, s); + return gzs; +} + +// Manipulator constructor stores arguments +template + inline + gzomanip2::gzomanip2(gzofstream &(*f)(gzofstream &, T1, T2), + T1 v1, + T2 v2) + : func(f), val1(v1), val2(v2) + { } + +// Insertor applies underlying manipulator function to stream +template + inline gzofstream& + operator<<(gzofstream& s, const gzomanip2& m) + { return (*m.func)(s, m.val1, m.val2); } + +// Insert this onto stream to simplify setting of compression level +inline gzomanip2 +setcompression(int l, int s = Z_DEFAULT_STRATEGY) +{ return gzomanip2(&setcompression, l, s); } + +#endif // ZFSTREAM_H diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/bld_ml64.bat b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/bld_ml64.bat new file mode 100644 index 0000000..f74bcef --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/bld_ml64.bat @@ -0,0 +1,2 @@ +ml64.exe /Flinffasx64 /c /Zi inffasx64.asm +ml64.exe /Flgvmat64 /c /Zi gvmat64.asm diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/gvmat64.asm b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/gvmat64.asm new file mode 100644 index 0000000..c1817f1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/gvmat64.asm @@ -0,0 +1,553 @@ +;uInt longest_match_x64( +; deflate_state *s, +; IPos cur_match); /* current match */ + +; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64 +; (AMD64 on Athlon 64, Opteron, Phenom +; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7) +; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; +; File written by Gilles Vollant, by converting to assembly the longest_match +; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. +; +; and by taking inspiration on asm686 with masm, optimised assembly code +; from Brian Raiter, written 1998 +; +; This software is provided 'as-is', without any express or implied +; warranty. In no event will the authors be held liable for any damages +; arising from the use of this software. +; +; Permission is granted to anyone to use this software for any purpose, +; including commercial applications, and to alter it and redistribute it +; freely, subject to the following restrictions: +; +; 1. The origin of this software must not be misrepresented; you must not +; claim that you wrote the original software. If you use this software +; in a product, an acknowledgment in the product documentation would be +; appreciated but is not required. +; 2. Altered source versions must be plainly marked as such, and must not be +; misrepresented as being the original software +; 3. This notice may not be removed or altered from any source distribution. +; +; +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; to compile this file for infozip Zip, I use option: +; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm +; +; to compile this file for zLib, I use option: +; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm +; Be carrefull to adapt zlib1222add below to your version of zLib +; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change +; value of zlib1222add later) +; +; This file compile with Microsoft Macro Assembler (x64) for AMD64 +; +; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK +; +; (you can get Windows WDK with ml64 for AMD64 from +; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) +; + + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; /* current match */ +.code +longest_match PROC + + +;LocalVarsSize equ 88 + LocalVarsSize equ 72 + +; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12 +; free register : r14,r15 +; register can be saved : rsp + + chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len + ; low word: s->wmask +;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10 +;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11 +;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w +;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx +;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13 +;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d +;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9 +IFDEF INFOZIP +ELSE + nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size +ENDIF + +save_rdi equ rsp + 24 - LocalVarsSize +save_rsi equ rsp + 32 - LocalVarsSize +save_rbx equ rsp + 40 - LocalVarsSize +save_rbp equ rsp + 48 - LocalVarsSize +save_r12 equ rsp + 56 - LocalVarsSize +save_r13 equ rsp + 64 - LocalVarsSize +;save_r14 equ rsp + 72 - LocalVarsSize +;save_r15 equ rsp + 80 - LocalVarsSize + + +; summary of register usage +; scanend ebx +; scanendw bx +; chainlenwmask edx +; curmatch rsi +; curmatchd esi +; windowbestlen r8 +; scanalign r9 +; scanalignd r9d +; window r10 +; bestlen r11 +; bestlend r11d +; scanstart r12d +; scanstartw r12w +; scan r13 +; nicematch r14d +; limit r15 +; limitd r15d +; prev rcx + +; all the +4 offsets are due to the addition of pending_buf_size (in zlib +; in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, remove the +4). +; Note : these value are good with a 8 bytes boundary pack structure + + + MAX_MATCH equ 258 + MIN_MATCH equ 3 + MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) + + +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + + +IFDEF INFOZIP + +_DATA SEGMENT +COMM window_size:DWORD +; WMask ; 7fff +COMM window:BYTE:010040H +COMM prev:WORD:08000H +; MatchLen : unused +; PrevMatch : unused +COMM strstart:DWORD +COMM match_start:DWORD +; Lookahead : ignore +COMM prev_length:DWORD ; PrevLen +COMM max_chain_length:DWORD +COMM good_match:DWORD +COMM nice_match:DWORD +prev_ad equ OFFSET prev +window_ad equ OFFSET window +nicematch equ nice_match +_DATA ENDS +WMask equ 07fffh + +ELSE + + IFNDEF zlib1222add + zlib1222add equ 8 + ENDIF +dsWSize equ 56+zlib1222add+(zlib1222add/2) +dsWMask equ 64+zlib1222add+(zlib1222add/2) +dsWindow equ 72+zlib1222add +dsPrev equ 88+zlib1222add +dsMatchLen equ 128+zlib1222add +dsPrevMatch equ 132+zlib1222add +dsStrStart equ 140+zlib1222add +dsMatchStart equ 144+zlib1222add +dsLookahead equ 148+zlib1222add +dsPrevLen equ 152+zlib1222add +dsMaxChainLen equ 156+zlib1222add +dsGoodMatch equ 172+zlib1222add +dsNiceMatch equ 176+zlib1222add + +window_size equ [ rcx + dsWSize] +WMask equ [ rcx + dsWMask] +window_ad equ [ rcx + dsWindow] +prev_ad equ [ rcx + dsPrev] +strstart equ [ rcx + dsStrStart] +match_start equ [ rcx + dsMatchStart] +Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip +prev_length equ [ rcx + dsPrevLen] +max_chain_length equ [ rcx + dsMaxChainLen] +good_match equ [ rcx + dsGoodMatch] +nice_match equ [ rcx + dsNiceMatch] +ENDIF + +; parameter 1 in r8(deflate state s), param 2 in rdx (cur match) + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch. + + + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + +;;; Retrieve the function arguments. r8d will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + +; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match) + +; this clear high 32 bits of r8, which can be garbage in both r8 and rdx + + mov [save_rdi],rdi + mov [save_rsi],rsi + mov [save_rbx],rbx + mov [save_rbp],rbp +IFDEF INFOZIP + mov r8d,ecx +ELSE + mov r8d,edx +ENDIF + mov [save_r12],r12 + mov [save_r13],r13 +; mov [save_r14],r14 +; mov [save_r15],r15 + + +;;; uInt wmask = s->w_mask; +;;; unsigned chain_length = s->max_chain_length; +;;; if (s->prev_length >= s->good_match) { +;;; chain_length >>= 2; +;;; } + + mov edi, prev_length + mov esi, good_match + mov eax, WMask + mov ebx, max_chain_length + cmp edi, esi + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +;;; chainlen is decremented once beforehand so that the function can +;;; use the sign flag instead of the zero flag for the exit test. +;;; It is then shifted into the high word, to make room for the wmask +;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + +;;; on zlib only +;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + +IFDEF INFOZIP + mov [chainlenwmask], ebx +; on infozip nice_match = [nice_match] +ELSE + mov eax, nice_match + mov [chainlenwmask], ebx + mov r10d, Lookahead + cmp r10d, eax + cmovnl r10d, eax + mov [nicematch],r10d +ENDIF + +;;; register Bytef *scan = s->window + s->strstart; + mov r10, window_ad + mov ebp, strstart + lea r13, [r10 + rbp] + +;;; Determine how many bytes the scan ptr is off from being +;;; dword-aligned. + + mov r9,r13 + neg r13 + and r13,3 + +;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +;;; s->strstart - (IPos)MAX_DIST(s) : NIL; +IFDEF INFOZIP + mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1)) +ELSE + mov eax, window_size + sub eax, MIN_LOOKAHEAD +ENDIF + xor edi,edi + sub ebp, eax + + mov r11d, prev_length + + cmovng ebp,edi + +;;; int best_len = s->prev_length; + + +;;; Store the sum of s->window + best_len in esi locally, and in esi. + + lea rsi,[r10+r11] + +;;; register ush scan_start = *(ushf*)scan; +;;; register ush scan_end = *(ushf*)(scan+best_len-1); +;;; Posf *prev = s->prev; + + movzx r12d,word ptr [r9] + movzx ebx, word ptr [r9 + r11 - 1] + + mov rdi, prev_ad + +;;; Jump into the main loop. + + mov edx, [chainlenwmask] + + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop1: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry1: + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop2: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry2: + cmp bx,word ptr [rsi + r8 - 1] + jz LookupLoopIsZero + +LookupLoop4: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry4: + + cmp bx,word ptr [rsi + r8 - 1] + jnz LookupLoop1 + jmp LookupLoopIsZero + + +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; r8d = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit + +LookupLoop: + and r8d, edx + + movzx r8d, word ptr [rdi + r8*2] + cmp r8d, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow + +LoopEntry: + + cmp bx,word ptr [rsi + r8 - 1] + jnz LookupLoop1 +LookupLoopIsZero: + cmp r12w, word ptr [r10 + r8] + jnz LookupLoop1 + + +;;; Store the current value of chainlen. + mov [chainlenwmask], edx + +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). + + lea rsi,[r8+r10] + mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8) + lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8] + lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8] + + prefetcht1 [rsi+rdx] + prefetcht1 [rdi+rdx] + + +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust rdx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (rsi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. + + +LoopCmps: + mov rax, [rsi + rdx] + xor rax, [rdi + rdx] + jnz LeaveLoopCmps + + mov rax, [rsi + rdx + 8] + xor rax, [rdi + rdx + 8] + jnz LeaveLoopCmps8 + + + mov rax, [rsi + rdx + 8+8] + xor rax, [rdi + rdx + 8+8] + jnz LeaveLoopCmps16 + + add rdx,8+8+8 + + jnz short LoopCmps + jmp short LenMaximum +LeaveLoopCmps16: add rdx,8 +LeaveLoopCmps8: add rdx,8 +LeaveLoopCmps: + + test eax, 0000FFFFh + jnz LenLower + + test eax,0ffffffffh + + jnz LenLower32 + + add rdx,4 + shr rax,32 + or ax,ax + jnz LenLower + +LenLower32: + shr eax,16 + add rdx,2 +LenLower: sub al, 1 + adc rdx, 0 +;;; Calculate the length of the match. If it is longer than MAX_MATCH, +;;; then automatically accept it as the best possible match and leave. + + lea rax, [rdi + rdx] + sub rax, r9 + cmp eax, MAX_MATCH + jge LenMaximum + +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. +;/////////////////////////////////// + + cmp eax, r11d + jg LongerMatch + + lea rsi,[r10+r11] + + mov rdi, prev_ad + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); + +LongerMatch: + mov r11d, eax + mov match_start, r8d + cmp eax, [nicematch] + jge LeaveNow + + lea rsi,[r10+rax] + + movzx ebx, word ptr [r9 + rax - 1] + mov rdi, prev_ad + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; Accept the current string, with the maximum possible length. + +LenMaximum: + mov r11d,MAX_MATCH + mov match_start, r8d + +;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +;;; return s->lookahead; + +LeaveNow: +IFDEF INFOZIP + mov eax,r11d +ELSE + mov eax, Lookahead + cmp r11d, eax + cmovng eax, r11d +ENDIF + +;;; Restore the stack and return from whence we came. + + + mov rsi,[save_rsi] + mov rdi,[save_rdi] + mov rbx,[save_rbx] + mov rbp,[save_rbp] + mov r12,[save_r12] + mov r13,[save_r13] +; mov r14,[save_r14] +; mov r15,[save_r15] + + + ret 0 +; please don't remove this string ! +; Your can freely use gvmat64 in any free or commercial app +; but it is far better don't remove the string in the binary! + db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 +longest_match ENDP + +match_init PROC + ret 0 +match_init ENDP + + +END diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffas8664.c b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffas8664.c new file mode 100644 index 0000000..aa861a3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffas8664.c @@ -0,0 +1,186 @@ +/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding + * version for AMD64 on Windows using Microsoft C compiler + * + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Copyright (C) 2003 Chris Anderson + * Please use the copyright conditions above. + * + * 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant + * + * inffas8664.c call function inffas8664fnc in inffasx64.asm + * inffasx64.asm is automatically convert from AMD64 portion of inffas86.c + * + * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also + * slightly quicker on x86 systems because, instead of using rep movsb to copy + * data, it uses rep movsw, which moves data in 2-byte chunks instead of single + * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates + * from http://fedora.linux.duke.edu/fc1_x86_64 + * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with + * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version, + * when decompressing mozilla-source-1.3.tar.gz. + * + * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from + * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at + * the moment. I have successfully compiled and tested this code with gcc2.96, + * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S + * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX + * enabled. I will attempt to merge the MMX code into this version. Newer + * versions of this and inffast.S can be found at + * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ + * + */ + +#include +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +/* Mark Adler's comments from inffast.c: */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ + + + + typedef struct inffast_ar { +/* 64 32 x86 x86_64 */ +/* ar offset register */ +/* 0 0 */ void *esp; /* esp save */ +/* 8 4 */ void *ebp; /* ebp save */ +/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */ +/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */ +/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */ +/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */ +/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */ +/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */ +/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */ +/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */ +/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */ +/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */ +/* 92 48 */ unsigned wsize; /* window size */ +/* 96 52 */ unsigned write; /* window write index */ +/*100 56 */ unsigned lmask; /* r12 mask for lcode */ +/*104 60 */ unsigned dmask; /* r13 mask for dcode */ +/*108 64 */ unsigned len; /* r14 match length */ +/*112 68 */ unsigned dist; /* r15 match distance */ +/*116 72 */ unsigned status; /* set when state chng*/ + } type_ar; +#ifdef ASMINF + +void inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + type_ar ar; + void inffas8664fnc(struct inffast_ar * par); + + + +#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64)) +#define PAD_AVAIL_IN 6 +#define PAD_AVAIL_OUT 258 +#else +#define PAD_AVAIL_IN 5 +#define PAD_AVAIL_OUT 257 +#endif + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + + ar.in = strm->next_in; + ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN); + ar.out = strm->next_out; + ar.beg = ar.out - (start - strm->avail_out); + ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); + ar.wsize = state->wsize; + ar.write = state->wnext; + ar.window = state->window; + ar.hold = state->hold; + ar.bits = state->bits; + ar.lcode = state->lencode; + ar.dcode = state->distcode; + ar.lmask = (1U << state->lenbits) - 1; + ar.dmask = (1U << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + /* align in on 1/2 hold size boundary */ + while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) { + ar.hold += (unsigned long)*ar.in++ << ar.bits; + ar.bits += 8; + } + + inffas8664fnc(&ar); + + if (ar.status > 1) { + if (ar.status == 2) + strm->msg = "invalid literal/length code"; + else if (ar.status == 3) + strm->msg = "invalid distance code"; + else + strm->msg = "invalid distance too far back"; + state->mode = BAD; + } + else if ( ar.status == 1 ) { + state->mode = TYPE; + } + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + ar.len = ar.bits >> 3; + ar.in -= ar.len; + ar.bits -= ar.len << 3; + ar.hold &= (1U << ar.bits) - 1; + + /* update state and return */ + strm->next_in = ar.in; + strm->next_out = ar.out; + strm->avail_in = (unsigned)(ar.in < ar.last ? + PAD_AVAIL_IN + (ar.last - ar.in) : + PAD_AVAIL_IN - (ar.in - ar.last)); + strm->avail_out = (unsigned)(ar.out < ar.end ? + PAD_AVAIL_OUT + (ar.end - ar.out) : + PAD_AVAIL_OUT - (ar.out - ar.end)); + state->hold = (unsigned long)ar.hold; + state->bits = ar.bits; + return; +} + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffasx64.asm b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffasx64.asm new file mode 100644 index 0000000..41ec823 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/inffasx64.asm @@ -0,0 +1,396 @@ +; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding +; version for AMD64 on Windows using Microsoft C compiler +; +; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c +; inffasx64.asm is called by inffas8664.c, which contain more info. + + +; to compile this file, I use option +; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm +; with Microsoft Macro Assembler (x64) for AMD64 +; + +; This file compile with Microsoft Macro Assembler (x64) for AMD64 +; +; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK +; +; (you can get Windows WDK with ml64 for AMD64 from +; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price) +; + + +.code +inffas8664fnc PROC + +; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and +; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp +; +; All registers must be preserved across the call, except for +; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. + + + mov [rsp-8],rsi + mov [rsp-16],rdi + mov [rsp-24],r12 + mov [rsp-32],r13 + mov [rsp-40],r14 + mov [rsp-48],r15 + mov [rsp-56],rbx + + mov rax,rcx + + mov [rax+8], rbp ; /* save regs rbp and rsp */ + mov [rax], rsp + + mov rsp, rax ; /* make rsp point to &ar */ + + mov rsi, [rsp+16] ; /* rsi = in */ + mov rdi, [rsp+32] ; /* rdi = out */ + mov r9, [rsp+24] ; /* r9 = last */ + mov r10, [rsp+48] ; /* r10 = end */ + mov rbp, [rsp+64] ; /* rbp = lcode */ + mov r11, [rsp+72] ; /* r11 = dcode */ + mov rdx, [rsp+80] ; /* rdx = hold */ + mov ebx, [rsp+88] ; /* ebx = bits */ + mov r12d, [rsp+100] ; /* r12d = lmask */ + mov r13d, [rsp+104] ; /* r13d = dmask */ + ; /* r14d = len */ + ; /* r15d = dist */ + + + cld + cmp r10, rdi + je L_one_time ; /* if only one decode left */ + cmp r9, rsi + + jne L_do_loop + + +L_one_time: + mov r8, r12 ; /* r8 = lmask */ + cmp bl, 32 + ja L_get_length_code_one_time + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + jmp L_get_length_code_one_time + +ALIGN 4 +L_while_test: + cmp r10, rdi + jbe L_break_loop + cmp r9, rsi + jbe L_break_loop + +L_do_loop: + mov r8, r12 ; /* r8 = lmask */ + cmp bl, 32 + ja L_get_length_code ; /* if (32 < bits) */ + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + +L_get_length_code: + and r8, rdx ; /* r8 &= hold */ + mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ + + mov cl, ah ; /* cl = this.bits */ + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + + test al, al + jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ + + mov r8, r12 ; /* r8 = lmask */ + shr eax, 16 ; /* output this.val char */ + stosb + +L_get_length_code_one_time: + and r8, rdx ; /* r8 &= hold */ + mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */ + +L_dolen: + mov cl, ah ; /* cl = this.bits */ + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + + test al, al + jnz L_test_for_length_base ; /* if (op != 0) 45.7% */ + + shr eax, 16 ; /* output this.val char */ + stosb + jmp L_while_test + +ALIGN 4 +L_test_for_length_base: + mov r14d, eax ; /* len = this */ + shr r14d, 16 ; /* len = this.val */ + mov cl, al + + test al, 16 + jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */ + and cl, 15 ; /* op &= 15 */ + jz L_decode_distance ; /* if (!op) */ + +L_add_bits_to_len: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + shr rdx, cl + add r14d, eax ; /* len += hold & mask[op] */ + +L_decode_distance: + mov r8, r13 ; /* r8 = dmask */ + cmp bl, 32 + ja L_get_distance_code ; /* if (32 < bits) */ + + lodsd ; /* eax = *(uint *)in++ */ + mov cl, bl ; /* cl = bits, needs it for shifting */ + add bl, 32 ; /* bits += 32 */ + shl rax, cl + or rdx, rax ; /* hold |= *((uint *)in)++ << bits */ + +L_get_distance_code: + and r8, rdx ; /* r8 &= hold */ + mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */ + +L_dodist: + mov r15d, eax ; /* dist = this */ + shr r15d, 16 ; /* dist = this.val */ + mov cl, ah + sub bl, ah ; /* bits -= this.bits */ + shr rdx, cl ; /* hold >>= this.bits */ + mov cl, al ; /* cl = this.op */ + + test al, 16 ; /* if ((op & 16) == 0) */ + jz L_test_for_second_level_dist + and cl, 15 ; /* op &= 15 */ + jz L_check_dist_one + +L_add_bits_to_dist: + sub bl, cl + xor eax, eax + inc eax + shl eax, cl + dec eax ; /* (1 << op) - 1 */ + and eax, edx ; /* eax &= hold */ + shr rdx, cl + add r15d, eax ; /* dist += hold & ((1 << op) - 1) */ + +L_check_window: + mov r8, rsi ; /* save in so from can use it's reg */ + mov rax, rdi + sub rax, [rsp+40] ; /* nbytes = out - beg */ + + cmp eax, r15d + jb L_clip_window ; /* if (dist > nbytes) 4.2% */ + + mov ecx, r14d ; /* ecx = len */ + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + + sar ecx, 1 + jnc L_copy_two ; /* if len % 2 == 0 */ + + rep movsw + mov al, [rsi] + mov [rdi], al + inc rdi + + mov rsi, r8 ; /* move in back to %rsi, toss from */ + jmp L_while_test + +L_copy_two: + rep movsw + mov rsi, r8 ; /* move in back to %rsi, toss from */ + jmp L_while_test + +ALIGN 4 +L_check_dist_one: + cmp r15d, 1 ; /* if dist 1, is a memset */ + jne L_check_window + cmp [rsp+40], rdi ; /* if out == beg, outside window */ + je L_check_window + + mov ecx, r14d ; /* ecx = len */ + mov al, [rdi-1] + mov ah, al + + sar ecx, 1 + jnc L_set_two + mov [rdi], al + inc rdi + +L_set_two: + rep stosw + jmp L_while_test + +ALIGN 4 +L_test_for_second_level_length: + test al, 64 + jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + add eax, r14d ; /* eax += len */ + mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/ + jmp L_dolen + +ALIGN 4 +L_test_for_second_level_dist: + test al, 64 + jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */ + + xor eax, eax + inc eax + shl eax, cl + dec eax + and eax, edx ; /* eax &= hold */ + add eax, r15d ; /* eax += dist */ + mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/ + jmp L_dodist + +ALIGN 4 +L_clip_window: + mov ecx, eax ; /* ecx = nbytes */ + mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */ + neg ecx ; /* nbytes = -nbytes */ + + cmp eax, r15d + jb L_invalid_distance_too_far ; /* if (dist > wsize) */ + + add ecx, r15d ; /* nbytes = dist - nbytes */ + cmp dword ptr [rsp+96], 0 + jne L_wrap_around_window ; /* if (write != 0) */ + + mov rsi, [rsp+56] ; /* from = window */ + sub eax, ecx ; /* eax -= nbytes */ + add rsi, rax ; /* from += wsize - nbytes */ + + mov eax, r14d ; /* eax = len */ + cmp r14d, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* eax -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = &out[ -dist ] */ + jmp L_do_copy + +ALIGN 4 +L_wrap_around_window: + mov eax, [rsp+96] ; /* eax = write */ + cmp ecx, eax + jbe L_contiguous_in_window ; /* if (write >= nbytes) */ + + mov esi, [rsp+92] ; /* from = wsize */ + add rsi, [rsp+56] ; /* from += window */ + add rsi, rax ; /* from += write */ + sub rsi, rcx ; /* from -= nbytes */ + sub ecx, eax ; /* nbytes -= write */ + + mov eax, r14d ; /* eax = len */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, [rsp+56] ; /* from = window */ + mov ecx, [rsp+96] ; /* nbytes = write */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + jmp L_do_copy + +ALIGN 4 +L_contiguous_in_window: + mov rsi, [rsp+56] ; /* rsi = window */ + add rsi, rax + sub rsi, rcx ; /* from += write - nbytes */ + + mov eax, r14d ; /* eax = len */ + cmp eax, ecx + jbe L_do_copy ; /* if (nbytes >= len) */ + + sub eax, ecx ; /* len -= nbytes */ + rep movsb + mov rsi, rdi + sub rsi, r15 ; /* from = out - dist */ + jmp L_do_copy ; /* if (nbytes >= len) */ + +ALIGN 4 +L_do_copy: + mov ecx, eax ; /* ecx = len */ + rep movsb + + mov rsi, r8 ; /* move in back to %esi, toss from */ + jmp L_while_test + +L_test_for_end_of_block: + test al, 32 + jz L_invalid_literal_length_code + mov dword ptr [rsp+116], 1 + jmp L_break_loop_with_status + +L_invalid_literal_length_code: + mov dword ptr [rsp+116], 2 + jmp L_break_loop_with_status + +L_invalid_distance_code: + mov dword ptr [rsp+116], 3 + jmp L_break_loop_with_status + +L_invalid_distance_too_far: + mov dword ptr [rsp+116], 4 + jmp L_break_loop_with_status + +L_break_loop: + mov dword ptr [rsp+116], 0 + +L_break_loop_with_status: +; /* put in, out, bits, and hold back into ar and pop esp */ + mov [rsp+16], rsi ; /* in */ + mov [rsp+32], rdi ; /* out */ + mov [rsp+88], ebx ; /* bits */ + mov [rsp+80], rdx ; /* hold */ + + mov rax, [rsp] ; /* restore rbp and rsp */ + mov rbp, [rsp+8] + mov rsp, rax + + + + mov rsi,[rsp-8] + mov rdi,[rsp-16] + mov r12,[rsp-24] + mov r13,[rsp-32] + mov r14,[rsp-40] + mov r15,[rsp-48] + mov rbx,[rsp-56] + + ret 0 +; : +; : "m" (ar) +; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi", +; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" +; ); + +inffas8664fnc ENDP +;_TEXT ENDS +END diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/readme.txt new file mode 100644 index 0000000..652571c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx64/readme.txt @@ -0,0 +1,31 @@ +Summary +------- +This directory contains ASM implementations of the functions +longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t), +for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits. + +gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits + assembly optimized version from Jean-loup Gailly original longest_match function + +inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing + original function from Mark Adler + +Use instructions +---------------- +Assemble the .asm files using MASM and put the object files into the zlib source +directory. You can also get object files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip + +define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, +and inffasx64.obj and gvmat64.obj as object to link. + + +Build instructions +------------------ +run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) + +ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK + +You can get Windows 2003 server DDK with ml64 and cl for AMD64 from + http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/bld_ml32.bat b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/bld_ml32.bat new file mode 100644 index 0000000..fcf5755 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/bld_ml32.bat @@ -0,0 +1,2 @@ +ml /coff /Zi /c /Flmatch686.lst match686.asm +ml /coff /Zi /c /Flinffas32.lst inffas32.asm diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/inffas32.asm b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/inffas32.asm new file mode 100644 index 0000000..cb37a81 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/inffas32.asm @@ -0,0 +1,1080 @@ +;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding +; * +; * inffas32.asm is derivated from inffas86.c, with translation of assembly code +; * +; * Copyright (C) 1995-2003 Mark Adler +; * For conditions of distribution and use, see copyright notice in zlib.h +; * +; * Copyright (C) 2003 Chris Anderson +; * Please use the copyright conditions above. +; * +; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from +; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at +; * the moment. I have successfully compiled and tested this code with gcc2.96, +; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S +; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX +; * enabled. I will attempt to merge the MMX code into this version. Newer +; * versions of this and inffast.S can be found at +; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ +; * +; * 2005 : modification by Gilles Vollant +; */ +; For Visual C++ 4.x and higher and ML 6.x and higher +; ml.exe is in directory \MASM611C of Win95 DDK +; ml.exe is also distributed in http://www.masm32.com/masmdl.htm +; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ +; +; +; compile with command line option +; ml /coff /Zi /c /Flinffas32.lst inffas32.asm + +; if you define NO_GZIP (see inflate.h), compile with +; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm + + +; zlib122sup is 0 fort zlib 1.2.2.1 and lower +; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head +; in inflate_state in inflate.h) +zlib1222sup equ 8 + + +IFDEF GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 +ELSE + IFNDEF NO_GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 + ELSE + INFLATE_MODE_TYPE equ 3 + INFLATE_MODE_BAD equ 17 + ENDIF +ENDIF + + +; 75 "inffast.S" +;FILE "inffast.S" + +;;;GLOBAL _inflate_fast + +;;;SECTION .text + + + + .586p + .mmx + + name inflate_fast_x86 + .MODEL FLAT + +_DATA segment +inflate_fast_use_mmx: + dd 1 + + +_TEXT segment + + + +ALIGN 4 + db 'Fast decoding Code from Chris Anderson' + db 0 + +ALIGN 4 +invalid_literal_length_code_msg: + db 'invalid literal/length code' + db 0 + +ALIGN 4 +invalid_distance_code_msg: + db 'invalid distance code' + db 0 + +ALIGN 4 +invalid_distance_too_far_msg: + db 'invalid distance too far back' + db 0 + + +ALIGN 4 +inflate_fast_mask: +dd 0 +dd 1 +dd 3 +dd 7 +dd 15 +dd 31 +dd 63 +dd 127 +dd 255 +dd 511 +dd 1023 +dd 2047 +dd 4095 +dd 8191 +dd 16383 +dd 32767 +dd 65535 +dd 131071 +dd 262143 +dd 524287 +dd 1048575 +dd 2097151 +dd 4194303 +dd 8388607 +dd 16777215 +dd 33554431 +dd 67108863 +dd 134217727 +dd 268435455 +dd 536870911 +dd 1073741823 +dd 2147483647 +dd 4294967295 + + +mode_state equ 0 ;/* state->mode */ +wsize_state equ (32+zlib1222sup) ;/* state->wsize */ +write_state equ (36+4+zlib1222sup) ;/* state->write */ +window_state equ (40+4+zlib1222sup) ;/* state->window */ +hold_state equ (44+4+zlib1222sup) ;/* state->hold */ +bits_state equ (48+4+zlib1222sup) ;/* state->bits */ +lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ +distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ +lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ +distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ + + +;;SECTION .text +; 205 "inffast.S" +;GLOBAL inflate_fast_use_mmx + +;SECTION .data + + +; GLOBAL inflate_fast_use_mmx:object +;.size inflate_fast_use_mmx, 4 +; 226 "inffast.S" +;SECTION .text + +ALIGN 4 +_inflate_fast proc near +.FPO (16, 4, 0, 0, 1, 0) + push edi + push esi + push ebp + push ebx + pushfd + sub esp,64 + cld + + + + + mov esi, [esp+88] + mov edi, [esi+28] + + + + + + + + mov edx, [esi+4] + mov eax, [esi+0] + + add edx,eax + sub edx,11 + + mov [esp+44],eax + mov [esp+20],edx + + mov ebp, [esp+92] + mov ecx, [esi+16] + mov ebx, [esi+12] + + sub ebp,ecx + neg ebp + add ebp,ebx + + sub ecx,257 + add ecx,ebx + + mov [esp+60],ebx + mov [esp+40],ebp + mov [esp+16],ecx +; 285 "inffast.S" + mov eax, [edi+lencode_state] + mov ecx, [edi+distcode_state] + + mov [esp+8],eax + mov [esp+12],ecx + + mov eax,1 + mov ecx, [edi+lenbits_state] + shl eax,cl + dec eax + mov [esp+0],eax + + mov eax,1 + mov ecx, [edi+distbits_state] + shl eax,cl + dec eax + mov [esp+4],eax + + mov eax, [edi+wsize_state] + mov ecx, [edi+write_state] + mov edx, [edi+window_state] + + mov [esp+52],eax + mov [esp+48],ecx + mov [esp+56],edx + + mov ebp, [edi+hold_state] + mov ebx, [edi+bits_state] +; 321 "inffast.S" + mov esi, [esp+44] + mov ecx, [esp+20] + cmp ecx,esi + ja L_align_long + + add ecx,11 + sub ecx,esi + mov eax,12 + sub eax,ecx + lea edi, [esp+28] + rep movsb + mov ecx,eax + xor eax,eax + rep stosb + lea esi, [esp+28] + mov [esp+20],esi + jmp L_is_aligned + + +L_align_long: + test esi,3 + jz L_is_aligned + xor eax,eax + mov al, [esi] + inc esi + mov ecx,ebx + add ebx,8 + shl eax,cl + or ebp,eax + jmp L_align_long + +L_is_aligned: + mov edi, [esp+60] +; 366 "inffast.S" +L_check_mmx: + cmp dword ptr [inflate_fast_use_mmx],2 + je L_init_mmx + ja L_do_loop + + push eax + push ebx + push ecx + push edx + pushfd + mov eax, [esp] + xor dword ptr [esp],0200000h + + + + + popfd + pushfd + pop edx + xor edx,eax + jz L_dont_use_mmx + xor eax,eax + cpuid + cmp ebx,0756e6547h + jne L_dont_use_mmx + cmp ecx,06c65746eh + jne L_dont_use_mmx + cmp edx,049656e69h + jne L_dont_use_mmx + mov eax,1 + cpuid + shr eax,8 + and eax,15 + cmp eax,6 + jne L_dont_use_mmx + test edx,0800000h + jnz L_use_mmx + jmp L_dont_use_mmx +L_use_mmx: + mov dword ptr [inflate_fast_use_mmx],2 + jmp L_check_mmx_pop +L_dont_use_mmx: + mov dword ptr [inflate_fast_use_mmx],3 +L_check_mmx_pop: + pop edx + pop ecx + pop ebx + pop eax + jmp L_check_mmx +; 426 "inffast.S" +ALIGN 4 +L_do_loop: +; 437 "inffast.S" + cmp bl,15 + ja L_get_length_code + + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + +L_get_length_code: + mov edx, [esp+0] + mov ecx, [esp+8] + and edx,ebp + mov eax, [ecx+edx*4] + +L_dolen: + + + + + + + mov cl,ah + sub bl,ah + shr ebp,cl + + + + + + + test al,al + jnz L_test_for_length_base + + shr eax,16 + stosb + +L_while_test: + + + cmp [esp+16],edi + jbe L_break_loop + + cmp [esp+20],esi + ja L_do_loop + jmp L_break_loop + +L_test_for_length_base: +; 502 "inffast.S" + mov edx,eax + shr edx,16 + mov cl,al + + test al,16 + jz L_test_for_second_level_length + and cl,15 + jz L_save_len + cmp bl,cl + jae L_add_bits_to_len + + mov ch,cl + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + mov cl,ch + +L_add_bits_to_len: + mov eax,1 + shl eax,cl + dec eax + sub bl,cl + and eax,ebp + shr ebp,cl + add edx,eax + +L_save_len: + mov [esp+24],edx + + +L_decode_distance: +; 549 "inffast.S" + cmp bl,15 + ja L_get_distance_code + + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + +L_get_distance_code: + mov edx, [esp+4] + mov ecx, [esp+12] + and edx,ebp + mov eax, [ecx+edx*4] + + +L_dodist: + mov edx,eax + shr edx,16 + mov cl,ah + sub bl,ah + shr ebp,cl +; 584 "inffast.S" + mov cl,al + + test al,16 + jz L_test_for_second_level_dist + and cl,15 + jz L_check_dist_one + cmp bl,cl + jae L_add_bits_to_dist + + mov ch,cl + xor eax,eax + lodsw + mov cl,bl + add bl,16 + shl eax,cl + or ebp,eax + mov cl,ch + +L_add_bits_to_dist: + mov eax,1 + shl eax,cl + dec eax + sub bl,cl + and eax,ebp + shr ebp,cl + add edx,eax + jmp L_check_window + +L_check_window: +; 625 "inffast.S" + mov [esp+44],esi + mov eax,edi + sub eax, [esp+40] + + cmp eax,edx + jb L_clip_window + + mov ecx, [esp+24] + mov esi,edi + sub esi,edx + + sub ecx,3 + mov al, [esi] + mov [edi],al + mov al, [esi+1] + mov dl, [esi+2] + add esi,3 + mov [edi+1],al + mov [edi+2],dl + add edi,3 + rep movsb + + mov esi, [esp+44] + jmp L_while_test + +ALIGN 4 +L_check_dist_one: + cmp edx,1 + jne L_check_window + cmp [esp+40],edi + je L_check_window + + dec edi + mov ecx, [esp+24] + mov al, [edi] + sub ecx,3 + + mov [edi+1],al + mov [edi+2],al + mov [edi+3],al + add edi,4 + rep stosb + + jmp L_while_test + +ALIGN 4 +L_test_for_second_level_length: + + + + + test al,64 + jnz L_test_for_end_of_block + + mov eax,1 + shl eax,cl + dec eax + and eax,ebp + add eax,edx + mov edx, [esp+8] + mov eax, [edx+eax*4] + jmp L_dolen + +ALIGN 4 +L_test_for_second_level_dist: + + + + + test al,64 + jnz L_invalid_distance_code + + mov eax,1 + shl eax,cl + dec eax + and eax,ebp + add eax,edx + mov edx, [esp+12] + mov eax, [edx+eax*4] + jmp L_dodist + +ALIGN 4 +L_clip_window: +; 721 "inffast.S" + mov ecx,eax + mov eax, [esp+52] + neg ecx + mov esi, [esp+56] + + cmp eax,edx + jb L_invalid_distance_too_far + + add ecx,edx + cmp dword ptr [esp+48],0 + jne L_wrap_around_window + + sub eax,ecx + add esi,eax +; 749 "inffast.S" + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + +L_wrap_around_window: +; 793 "inffast.S" + mov eax, [esp+48] + cmp ecx,eax + jbe L_contiguous_in_window + + add esi, [esp+52] + add esi,eax + sub esi,ecx + sub ecx,eax + + + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi, [esp+56] + mov ecx, [esp+48] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + jmp L_do_copy1 + +L_contiguous_in_window: +; 836 "inffast.S" + add esi,eax + sub esi,ecx + + + mov eax, [esp+24] + cmp eax,ecx + jbe L_do_copy1 + + sub eax,ecx + rep movsb + mov esi,edi + sub esi,edx + +L_do_copy1: +; 862 "inffast.S" + mov ecx,eax + rep movsb + + mov esi, [esp+44] + jmp L_while_test +; 878 "inffast.S" +ALIGN 4 +L_init_mmx: + emms + + + + + + movd mm0,ebp + mov ebp,ebx +; 896 "inffast.S" + movd mm4,dword ptr [esp+0] + movq mm3,mm4 + movd mm5,dword ptr [esp+4] + movq mm2,mm5 + pxor mm1,mm1 + mov ebx, [esp+8] + jmp L_do_loop_mmx + +ALIGN 4 +L_do_loop_mmx: + psrlq mm0,mm1 + + cmp ebp,32 + ja L_get_length_code_mmx + + movd mm6,ebp + movd mm7,dword ptr [esi] + add esi,4 + psllq mm7,mm6 + add ebp,32 + por mm0,mm7 + +L_get_length_code_mmx: + pand mm4,mm0 + movd eax,mm4 + movq mm4,mm3 + mov eax, [ebx+eax*4] + +L_dolen_mmx: + movzx ecx,ah + movd mm1,ecx + sub ebp,ecx + + test al,al + jnz L_test_for_length_base_mmx + + shr eax,16 + stosb + +L_while_test_mmx: + + + cmp [esp+16],edi + jbe L_break_loop + + cmp [esp+20],esi + ja L_do_loop_mmx + jmp L_break_loop + +L_test_for_length_base_mmx: + + mov edx,eax + shr edx,16 + + test al,16 + jz L_test_for_second_level_length_mmx + and eax,15 + jz L_decode_distance_mmx + + psrlq mm0,mm1 + movd mm1,eax + movd ecx,mm0 + sub ebp,eax + and ecx, [inflate_fast_mask+eax*4] + add edx,ecx + +L_decode_distance_mmx: + psrlq mm0,mm1 + + cmp ebp,32 + ja L_get_dist_code_mmx + + movd mm6,ebp + movd mm7,dword ptr [esi] + add esi,4 + psllq mm7,mm6 + add ebp,32 + por mm0,mm7 + +L_get_dist_code_mmx: + mov ebx, [esp+12] + pand mm5,mm0 + movd eax,mm5 + movq mm5,mm2 + mov eax, [ebx+eax*4] + +L_dodist_mmx: + + movzx ecx,ah + mov ebx,eax + shr ebx,16 + sub ebp,ecx + movd mm1,ecx + + test al,16 + jz L_test_for_second_level_dist_mmx + and eax,15 + jz L_check_dist_one_mmx + +L_add_bits_to_dist_mmx: + psrlq mm0,mm1 + movd mm1,eax + movd ecx,mm0 + sub ebp,eax + and ecx, [inflate_fast_mask+eax*4] + add ebx,ecx + +L_check_window_mmx: + mov [esp+44],esi + mov eax,edi + sub eax, [esp+40] + + cmp eax,ebx + jb L_clip_window_mmx + + mov ecx,edx + mov esi,edi + sub esi,ebx + + sub ecx,3 + mov al, [esi] + mov [edi],al + mov al, [esi+1] + mov dl, [esi+2] + add esi,3 + mov [edi+1],al + mov [edi+2],dl + add edi,3 + rep movsb + + mov esi, [esp+44] + mov ebx, [esp+8] + jmp L_while_test_mmx + +ALIGN 4 +L_check_dist_one_mmx: + cmp ebx,1 + jne L_check_window_mmx + cmp [esp+40],edi + je L_check_window_mmx + + dec edi + mov ecx,edx + mov al, [edi] + sub ecx,3 + + mov [edi+1],al + mov [edi+2],al + mov [edi+3],al + add edi,4 + rep stosb + + mov ebx, [esp+8] + jmp L_while_test_mmx + +ALIGN 4 +L_test_for_second_level_length_mmx: + test al,64 + jnz L_test_for_end_of_block + + and eax,15 + psrlq mm0,mm1 + movd ecx,mm0 + and ecx, [inflate_fast_mask+eax*4] + add ecx,edx + mov eax, [ebx+ecx*4] + jmp L_dolen_mmx + +ALIGN 4 +L_test_for_second_level_dist_mmx: + test al,64 + jnz L_invalid_distance_code + + and eax,15 + psrlq mm0,mm1 + movd ecx,mm0 + and ecx, [inflate_fast_mask+eax*4] + mov eax, [esp+12] + add ecx,ebx + mov eax, [eax+ecx*4] + jmp L_dodist_mmx + +ALIGN 4 +L_clip_window_mmx: + + mov ecx,eax + mov eax, [esp+52] + neg ecx + mov esi, [esp+56] + + cmp eax,ebx + jb L_invalid_distance_too_far + + add ecx,ebx + cmp dword ptr [esp+48],0 + jne L_wrap_around_window_mmx + + sub eax,ecx + add esi,eax + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + +L_wrap_around_window_mmx: + + mov eax, [esp+48] + cmp ecx,eax + jbe L_contiguous_in_window_mmx + + add esi, [esp+52] + add esi,eax + sub esi,ecx + sub ecx,eax + + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi, [esp+56] + mov ecx, [esp+48] + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + jmp L_do_copy1_mmx + +L_contiguous_in_window_mmx: + + add esi,eax + sub esi,ecx + + + cmp edx,ecx + jbe L_do_copy1_mmx + + sub edx,ecx + rep movsb + mov esi,edi + sub esi,ebx + +L_do_copy1_mmx: + + + mov ecx,edx + rep movsb + + mov esi, [esp+44] + mov ebx, [esp+8] + jmp L_while_test_mmx +; 1174 "inffast.S" +L_invalid_distance_code: + + + + + + mov ecx, invalid_distance_code_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_test_for_end_of_block: + + + + + + test al,32 + jz L_invalid_literal_length_code + + mov ecx,0 + mov edx,INFLATE_MODE_TYPE + jmp L_update_stream_state + +L_invalid_literal_length_code: + + + + + + mov ecx, invalid_literal_length_code_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_invalid_distance_too_far: + + + + mov esi, [esp+44] + mov ecx, invalid_distance_too_far_msg + mov edx,INFLATE_MODE_BAD + jmp L_update_stream_state + +L_update_stream_state: + + mov eax, [esp+88] + test ecx,ecx + jz L_skip_msg + mov [eax+24],ecx +L_skip_msg: + mov eax, [eax+28] + mov [eax+mode_state],edx + jmp L_break_loop + +ALIGN 4 +L_break_loop: +; 1243 "inffast.S" + cmp dword ptr [inflate_fast_use_mmx],2 + jne L_update_next_in + + + + mov ebx,ebp + +L_update_next_in: +; 1266 "inffast.S" + mov eax, [esp+88] + mov ecx,ebx + mov edx, [eax+28] + shr ecx,3 + sub esi,ecx + shl ecx,3 + sub ebx,ecx + mov [eax+12],edi + mov [edx+bits_state],ebx + mov ecx,ebx + + lea ebx, [esp+28] + cmp [esp+20],ebx + jne L_buf_not_used + + sub esi,ebx + mov ebx, [eax+0] + mov [esp+20],ebx + add esi,ebx + mov ebx, [eax+4] + sub ebx,11 + add [esp+20],ebx + +L_buf_not_used: + mov [eax+0],esi + + mov ebx,1 + shl ebx,cl + dec ebx + + + + + + cmp dword ptr [inflate_fast_use_mmx],2 + jne L_update_hold + + + + psrlq mm0,mm1 + movd ebp,mm0 + + emms + +L_update_hold: + + + + and ebp,ebx + mov [edx+hold_state],ebp + + + + + mov ebx, [esp+20] + cmp ebx,esi + jbe L_last_is_smaller + + sub ebx,esi + add ebx,11 + mov [eax+4],ebx + jmp L_fixup_out +L_last_is_smaller: + sub esi,ebx + neg esi + add esi,11 + mov [eax+4],esi + + + + +L_fixup_out: + + mov ebx, [esp+16] + cmp ebx,edi + jbe L_end_is_smaller + + sub ebx,edi + add ebx,257 + mov [eax+16],ebx + jmp L_done +L_end_is_smaller: + sub edi,ebx + neg edi + add edi,257 + mov [eax+16],edi + + + + + +L_done: + add esp,64 + popfd + pop ebx + pop ebp + pop esi + pop edi + ret +_inflate_fast endp + +_TEXT ends +end diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/match686.asm b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/match686.asm new file mode 100644 index 0000000..69e0eed --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/match686.asm @@ -0,0 +1,479 @@ +; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86 +; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant. +; File written by Gilles Vollant, by converting match686.S from Brian Raiter +; for MASM. This is as assembly version of longest_match +; from Jean-loup Gailly in deflate.c +; +; http://www.zlib.net +; http://www.winimage.com/zLibDll +; http://www.muppetlabs.com/~breadbox/software/assembly.html +; +; For Visual C++ 4.x and higher and ML 6.x and higher +; ml.exe is distributed in +; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 +; +; this file contain two implementation of longest_match +; +; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro +; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom) +; +; for using an assembly version of longest_match, you need define ASMV in project +; +; compile the asm file running +; ml /coff /Zi /c /Flmatch686.lst match686.asm +; and do not include match686.obj in your project +; +; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for +; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor +; with autoselect (with cpu detection code) +; if you want support the old pentium optimization, you can still use these version +; +; this file is not optimized for old pentium, but it compatible with all x86 32 bits +; processor (starting 80386) +; +; +; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2 + +;uInt longest_match(s, cur_match) +; deflate_state *s; +; IPos cur_match; /* current match */ + + NbStack equ 76 + cur_match equ dword ptr[esp+NbStack-0] + str_s equ dword ptr[esp+NbStack-4] +; 5 dword on top (ret,ebp,esi,edi,ebx) + adrret equ dword ptr[esp+NbStack-8] + pushebp equ dword ptr[esp+NbStack-12] + pushedi equ dword ptr[esp+NbStack-16] + pushesi equ dword ptr[esp+NbStack-20] + pushebx equ dword ptr[esp+NbStack-24] + + chain_length equ dword ptr [esp+NbStack-28] + limit equ dword ptr [esp+NbStack-32] + best_len equ dword ptr [esp+NbStack-36] + window equ dword ptr [esp+NbStack-40] + prev equ dword ptr [esp+NbStack-44] + scan_start equ word ptr [esp+NbStack-48] + wmask equ dword ptr [esp+NbStack-52] + match_start_ptr equ dword ptr [esp+NbStack-56] + nice_match equ dword ptr [esp+NbStack-60] + scan equ dword ptr [esp+NbStack-64] + + windowlen equ dword ptr [esp+NbStack-68] + match_start equ dword ptr [esp+NbStack-72] + strend equ dword ptr [esp+NbStack-76] + NbStackAdd equ (NbStack-24) + + .386p + + name gvmatch + .MODEL FLAT + + + +; all the +zlib1222add offsets are due to the addition of fields +; in zlib in the deflate_state structure since the asm code was first written +; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). +; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). +; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). + + zlib1222add equ 8 + +; Note : these value are good with a 8 bytes boundary pack structure + dep_chain_length equ 74h+zlib1222add + dep_window equ 30h+zlib1222add + dep_strstart equ 64h+zlib1222add + dep_prev_length equ 70h+zlib1222add + dep_nice_match equ 88h+zlib1222add + dep_w_size equ 24h+zlib1222add + dep_prev equ 38h+zlib1222add + dep_w_mask equ 2ch+zlib1222add + dep_good_match equ 84h+zlib1222add + dep_match_start equ 68h+zlib1222add + dep_lookahead equ 6ch+zlib1222add + + +_TEXT segment + +IFDEF NOUNDERLINE + public longest_match + public match_init +ELSE + public _longest_match + public _match_init +ENDIF + + MAX_MATCH equ 258 + MIN_MATCH equ 3 + MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) + + + +MAX_MATCH equ 258 +MIN_MATCH equ 3 +MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1) +MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h) + + +;;; stack frame offsets + +chainlenwmask equ esp + 0 ; high word: current chain len + ; low word: s->wmask +window equ esp + 4 ; local copy of s->window +windowbestlen equ esp + 8 ; s->window + bestlen +scanstart equ esp + 16 ; first two bytes of string +scanend equ esp + 12 ; last two bytes of string +scanalign equ esp + 20 ; dword-misalignment of string +nicematch equ esp + 24 ; a good enough match size +bestlen equ esp + 28 ; size of best match so far +scan equ esp + 32 ; ptr to string wanting match + +LocalVarsSize equ 36 +; saved ebx byte esp + 36 +; saved edi byte esp + 40 +; saved esi byte esp + 44 +; saved ebp byte esp + 48 +; return address byte esp + 52 +deflatestate equ esp + 56 ; the function arguments +curmatch equ esp + 60 + +;;; Offsets for fields in the deflate_state structure. These numbers +;;; are calculated from the definition of deflate_state, with the +;;; assumption that the compiler will dword-align the fields. (Thus, +;;; changing the definition of deflate_state could easily cause this +;;; program to crash horribly, without so much as a warning at +;;; compile time. Sigh.) + +dsWSize equ 36+zlib1222add +dsWMask equ 44+zlib1222add +dsWindow equ 48+zlib1222add +dsPrev equ 56+zlib1222add +dsMatchLen equ 88+zlib1222add +dsPrevMatch equ 92+zlib1222add +dsStrStart equ 100+zlib1222add +dsMatchStart equ 104+zlib1222add +dsLookahead equ 108+zlib1222add +dsPrevLen equ 112+zlib1222add +dsMaxChainLen equ 116+zlib1222add +dsGoodMatch equ 132+zlib1222add +dsNiceMatch equ 136+zlib1222add + + +;;; match686.asm -- Pentium-Pro-optimized version of longest_match() +;;; Written for zlib 1.1.2 +;;; Copyright (C) 1998 Brian Raiter +;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html +;;; +;; +;; This software is provided 'as-is', without any express or implied +;; warranty. In no event will the authors be held liable for any damages +;; arising from the use of this software. +;; +;; Permission is granted to anyone to use this software for any purpose, +;; including commercial applications, and to alter it and redistribute it +;; freely, subject to the following restrictions: +;; +;; 1. The origin of this software must not be misrepresented; you must not +;; claim that you wrote the original software. If you use this software +;; in a product, an acknowledgment in the product documentation would be +;; appreciated but is not required. +;; 2. Altered source versions must be plainly marked as such, and must not be +;; misrepresented as being the original software +;; 3. This notice may not be removed or altered from any source distribution. +;; + +;GLOBAL _longest_match, _match_init + + +;SECTION .text + +;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch) + +;_longest_match: + IFDEF NOUNDERLINE + longest_match proc near + ELSE + _longest_match proc near + ENDIF +.FPO (9, 4, 0, 0, 1, 0) + +;;; Save registers that the compiler may be using, and adjust esp to +;;; make room for our stack frame. + + push ebp + push edi + push esi + push ebx + sub esp, LocalVarsSize + +;;; Retrieve the function arguments. ecx will hold cur_match +;;; throughout the entire function. edx will hold the pointer to the +;;; deflate_state structure during the function's setup (before +;;; entering the main loop. + + mov edx, [deflatestate] + mov ecx, [curmatch] + +;;; uInt wmask = s->w_mask; +;;; unsigned chain_length = s->max_chain_length; +;;; if (s->prev_length >= s->good_match) { +;;; chain_length >>= 2; +;;; } + + mov eax, [edx + dsPrevLen] + mov ebx, [edx + dsGoodMatch] + cmp eax, ebx + mov eax, [edx + dsWMask] + mov ebx, [edx + dsMaxChainLen] + jl LastMatchGood + shr ebx, 2 +LastMatchGood: + +;;; chainlen is decremented once beforehand so that the function can +;;; use the sign flag instead of the zero flag for the exit test. +;;; It is then shifted into the high word, to make room for the wmask +;;; value, which it will always accompany. + + dec ebx + shl ebx, 16 + or ebx, eax + mov [chainlenwmask], ebx + +;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + mov eax, [edx + dsNiceMatch] + mov ebx, [edx + dsLookahead] + cmp ebx, eax + jl LookaheadLess + mov ebx, eax +LookaheadLess: mov [nicematch], ebx + +;;; register Bytef *scan = s->window + s->strstart; + + mov esi, [edx + dsWindow] + mov [window], esi + mov ebp, [edx + dsStrStart] + lea edi, [esi + ebp] + mov [scan], edi + +;;; Determine how many bytes the scan ptr is off from being +;;; dword-aligned. + + mov eax, edi + neg eax + and eax, 3 + mov [scanalign], eax + +;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? +;;; s->strstart - (IPos)MAX_DIST(s) : NIL; + + mov eax, [edx + dsWSize] + sub eax, MIN_LOOKAHEAD + sub ebp, eax + jg LimitPositive + xor ebp, ebp +LimitPositive: + +;;; int best_len = s->prev_length; + + mov eax, [edx + dsPrevLen] + mov [bestlen], eax + +;;; Store the sum of s->window + best_len in esi locally, and in esi. + + add esi, eax + mov [windowbestlen], esi + +;;; register ush scan_start = *(ushf*)scan; +;;; register ush scan_end = *(ushf*)(scan+best_len-1); +;;; Posf *prev = s->prev; + + movzx ebx, word ptr [edi] + mov [scanstart], ebx + movzx ebx, word ptr [edi + eax - 1] + mov [scanend], ebx + mov edi, [edx + dsPrev] + +;;; Jump into the main loop. + + mov edx, [chainlenwmask] + jmp short LoopEntry + +align 4 + +;;; do { +;;; match = s->window + cur_match; +;;; if (*(ushf*)(match+best_len-1) != scan_end || +;;; *(ushf*)match != scan_start) continue; +;;; [...] +;;; } while ((cur_match = prev[cur_match & wmask]) > limit +;;; && --chain_length != 0); +;;; +;;; Here is the inner loop of the function. The function will spend the +;;; majority of its time in this loop, and majority of that time will +;;; be spent in the first ten instructions. +;;; +;;; Within this loop: +;;; ebx = scanend +;;; ecx = curmatch +;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) +;;; esi = windowbestlen - i.e., (window + bestlen) +;;; edi = prev +;;; ebp = limit + +LookupLoop: + and ecx, edx + movzx ecx, word ptr [edi + ecx*2] + cmp ecx, ebp + jbe LeaveNow + sub edx, 00010000h + js LeaveNow +LoopEntry: movzx eax, word ptr [esi + ecx - 1] + cmp eax, ebx + jnz LookupLoop + mov eax, [window] + movzx eax, word ptr [eax + ecx] + cmp eax, [scanstart] + jnz LookupLoop + +;;; Store the current value of chainlen. + + mov [chainlenwmask], edx + +;;; Point edi to the string under scrutiny, and esi to the string we +;;; are hoping to match it up with. In actuality, esi and edi are +;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is +;;; initialized to -(MAX_MATCH_8 - scanalign). + + mov esi, [window] + mov edi, [scan] + add esi, ecx + mov eax, [scanalign] + mov edx, 0fffffef8h; -(MAX_MATCH_8) + lea edi, [edi + eax + 0108h] ;MAX_MATCH_8] + lea esi, [esi + eax + 0108h] ;MAX_MATCH_8] + +;;; Test the strings for equality, 8 bytes at a time. At the end, +;;; adjust edx so that it is offset to the exact byte that mismatched. +;;; +;;; We already know at this point that the first three bytes of the +;;; strings match each other, and they can be safely passed over before +;;; starting the compare loop. So what this code does is skip over 0-3 +;;; bytes, as much as necessary in order to dword-align the edi +;;; pointer. (esi will still be misaligned three times out of four.) +;;; +;;; It should be confessed that this loop usually does not represent +;;; much of the total running time. Replacing it with a more +;;; straightforward "rep cmpsb" would not drastically degrade +;;; performance. + +LoopCmps: + mov eax, [esi + edx] + xor eax, [edi + edx] + jnz LeaveLoopCmps + mov eax, [esi + edx + 4] + xor eax, [edi + edx + 4] + jnz LeaveLoopCmps4 + add edx, 8 + jnz LoopCmps + jmp short LenMaximum +LeaveLoopCmps4: add edx, 4 +LeaveLoopCmps: test eax, 0000FFFFh + jnz LenLower + add edx, 2 + shr eax, 16 +LenLower: sub al, 1 + adc edx, 0 + +;;; Calculate the length of the match. If it is longer than MAX_MATCH, +;;; then automatically accept it as the best possible match and leave. + + lea eax, [edi + edx] + mov edi, [scan] + sub eax, edi + cmp eax, MAX_MATCH + jge LenMaximum + +;;; If the length of the match is not longer than the best match we +;;; have so far, then forget it and return to the lookup loop. + + mov edx, [deflatestate] + mov ebx, [bestlen] + cmp eax, ebx + jg LongerMatch + mov esi, [windowbestlen] + mov edi, [edx + dsPrev] + mov ebx, [scanend] + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; s->match_start = cur_match; +;;; best_len = len; +;;; if (len >= nice_match) break; +;;; scan_end = *(ushf*)(scan+best_len-1); + +LongerMatch: mov ebx, [nicematch] + mov [bestlen], eax + mov [edx + dsMatchStart], ecx + cmp eax, ebx + jge LeaveNow + mov esi, [window] + add esi, eax + mov [windowbestlen], esi + movzx ebx, word ptr [edi + eax - 1] + mov edi, [edx + dsPrev] + mov [scanend], ebx + mov edx, [chainlenwmask] + jmp LookupLoop + +;;; Accept the current string, with the maximum possible length. + +LenMaximum: mov edx, [deflatestate] + mov dword ptr [bestlen], MAX_MATCH + mov [edx + dsMatchStart], ecx + +;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; +;;; return s->lookahead; + +LeaveNow: + mov edx, [deflatestate] + mov ebx, [bestlen] + mov eax, [edx + dsLookahead] + cmp ebx, eax + jg LookaheadRet + mov eax, ebx +LookaheadRet: + +;;; Restore the stack and return from whence we came. + + add esp, LocalVarsSize + pop ebx + pop esi + pop edi + pop ebp + + ret +; please don't remove this string ! +; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary! + db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah + + + IFDEF NOUNDERLINE + longest_match endp + ELSE + _longest_match endp + ENDIF + + IFDEF NOUNDERLINE + match_init proc near + ret + match_init endp + ELSE + _match_init proc near + ret + _match_init endp + ENDIF + + +_TEXT ends +end diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/readme.txt new file mode 100644 index 0000000..3f88886 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/masmx86/readme.txt @@ -0,0 +1,27 @@ + +Summary +------- +This directory contains ASM implementations of the functions +longest_match() and inflate_fast(). + + +Use instructions +---------------- +Assemble using MASM, and copy the object files into the zlib source +directory, then run the appropriate makefile, as suggested below. You can +donwload MASM from here: + + http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 + +You can also get objects files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip + +Build instructions +------------------ +* With Microsoft C and MASM: +nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" + +* With Borland C and TASM: +make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile new file mode 100644 index 0000000..84eaad2 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile @@ -0,0 +1,25 @@ +CC=cc +CFLAGS=-O -I../.. + +UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a +ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +all: miniunz minizip + +miniunz: $(UNZ_OBJS) + $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) + +minizip: $(ZIP_OBJS) + $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) + +test: miniunz minizip + ./minizip test readme.txt + ./miniunz -l test.zip + mv readme.txt readme.old + ./miniunz test.zip + +clean: + /bin/rm -f *.o *~ minizip miniunz diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile.am b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile.am new file mode 100644 index 0000000..d343011 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/Makefile.am @@ -0,0 +1,45 @@ +lib_LTLIBRARIES = libminizip.la + +if COND_DEMOS +bin_PROGRAMS = miniunzip minizip +endif + +zlib_top_srcdir = $(top_srcdir)/../.. +zlib_top_builddir = $(top_builddir)/../.. + +AM_CPPFLAGS = -I$(zlib_top_srcdir) +AM_LDFLAGS = -L$(zlib_top_builddir) + +if WIN32 +iowin32_src = iowin32.c +iowin32_h = iowin32.h +endif + +libminizip_la_SOURCES = \ + ioapi.c \ + mztools.c \ + unzip.c \ + zip.c \ + ${iowin32_src} + +libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz + +minizip_includedir = $(includedir)/minizip +minizip_include_HEADERS = \ + crypt.h \ + ioapi.h \ + mztools.h \ + unzip.h \ + zip.h \ + ${iowin32_h} + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = minizip.pc + +EXTRA_PROGRAMS = miniunzip minizip + +miniunzip_SOURCES = miniunz.c +miniunzip_LDADD = libminizip.la + +minizip_SOURCES = minizip.c +minizip_LDADD = libminizip.la -lz diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_Changes.txt b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_Changes.txt new file mode 100644 index 0000000..13a1bd9 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_Changes.txt @@ -0,0 +1,6 @@ + +MiniZip 1.1 was derrived from MiniZip at version 1.01f + +Change in 1.0 (Okt 2009) + - **TODO - Add history** + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_info.txt b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_info.txt new file mode 100644 index 0000000..57d7152 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/MiniZip64_info.txt @@ -0,0 +1,74 @@ +MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson + +Introduction +--------------------- +MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html ) + +When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0. +All possible work was done for compatibility. + + +Background +--------------------- +When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 +support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) + +That was used as a starting point. And after that ZIP64 support was added to zip.c +some refactoring and code cleanup was also done. + + +Changed from MiniZip 1.0 to MiniZip 1.1 +--------------------------------------- +* Added ZIP64 support for unzip ( by Even Rouault ) +* Added ZIP64 support for zip ( by Mathias Svensson ) +* Reverted some changed that Even Rouault did. +* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users. +* Added unzip patch for BZIP Compression method (patch create by Daniel Borca) +* Added BZIP Compress method for zip +* Did some refactoring and code cleanup + + +Credits + + Gilles Vollant - Original MiniZip author + Even Rouault - ZIP64 unzip Support + Daniel Borca - BZip Compression method support in unzip + Mathias Svensson - ZIP64 zip support + Mathias Svensson - BZip Compression method support in zip + + Resources + + ZipLayout http://result42.com/projects/ZipFileLayout + Command line tool for Windows that shows the layout and information of the headers in a zip archive. + Used when debugging and validating the creation of zip files using MiniZip64 + + + ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT + Zip File specification + + +Notes. + * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined. + +License +---------------------------------------------------------- + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +---------------------------------------------------------- + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/configure.ac b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/configure.ac new file mode 100644 index 0000000..6a9af21 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/configure.ac @@ -0,0 +1,32 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_INIT([minizip], [1.2.7], [bugzilla.redhat.com]) +AC_CONFIG_SRCDIR([minizip.c]) +AM_INIT_AUTOMAKE([foreign]) +LT_INIT + +AC_MSG_CHECKING([whether to build example programs]) +AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs])) +AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) +if test "$enable_demos" = yes +then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +case "${host}" in + *-mingw* | mingw*) + WIN32="yes" + ;; + *) + ;; +esac +AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) + + +AC_SUBST([HAVE_UNISTD_H], [0]) +AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) +AC_CONFIG_FILES([Makefile minizip.pc]) +AC_OUTPUT diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/crypt.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/crypt.h new file mode 100644 index 0000000..a01d08d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/crypt.h @@ -0,0 +1,131 @@ +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(const char* passwd, /* password string */ + unsigned char* buf, /* where to write header */ + int bufSize, + unsigned long* pkeys, + const unsigned long* pcrc_32_tab, + unsigned long crcForCrypting) +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.c new file mode 100644 index 0000000..7f5c191 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.c @@ -0,0 +1,247 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS))) + #define _CRT_SECURE_NO_WARNINGS +#endif + +#if defined(__APPLE__) || defined(IOAPI_NO_64) +// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions +#define FOPEN_FUNC(filename, mode) fopen(filename, mode) +#define FTELLO_FUNC(stream) ftello(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin) +#else +#define FOPEN_FUNC(filename, mode) fopen64(filename, mode) +#define FTELLO_FUNC(stream) ftello64(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin) +#endif + + +#include "ioapi.h" + +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) +{ + if (pfilefunc->zfile_func64.zopen64_file != NULL) + return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); + else + { + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + } +} + +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + else + { + uLong offsetTruncated = (uLong)offset; + if (offsetTruncated != offset) + return -1; + else + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); + } +} + +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); + else + { + uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + if ((tell_uLong) == MAXU32) + return (ZPOS64_T)-1; + else + return tell_uLong; + } +} + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) +{ + p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; + p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.ztell64_file = NULL; + p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; + p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; + p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; +} + + + +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); +static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); +static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); +static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + +static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = FOPEN_FUNC((const char*)filename, mode_fopen); + return file; +} + + +static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + + +static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret; + ret = FTELLO_FUNC((FILE *)stream); + return ret; +} + +static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + if (fseek((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + return ret; +} + +static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + + if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + + return ret; +} + + +static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = fopen64_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell64_file = ftell64_file_func; + pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.h new file mode 100644 index 0000000..8dcbdb0 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/ioapi.h @@ -0,0 +1,208 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them. + + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif + +#endif + +#include +#include +#include "zlib.h" + +#if defined(USE_FILE32API) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef __FreeBSD__ +#define fopen64 fopen +#define ftello64 ftello +#define fseeko64 fseeko +#endif +#ifdef _MSC_VER + #define fopen64 fopen + #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) + #define ftello64 _ftelli64 + #define fseeko64 _fseeki64 + #else // old MSC + #define ftello64 ftell + #define fseeko64 fseek + #endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type choosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + +/* Maximum unsigned 32-bit value used as placeholder for zip64 */ +#define MAXU32 0xffffffff + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) + #define ZCALLBACK CALLBACK + #else + #define ZCALLBACK + #endif +#endif + + + + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); + +typedef struct zlib_filefunc64_def_s +{ + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s +{ + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + + +#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) +#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); + +#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) +#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) +#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.c new file mode 100644 index 0000000..6a2a883 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.c @@ -0,0 +1,389 @@ +/* iowin32.c -- IO base function header for compress/uncompress .zip + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#include + +#include "zlib.h" +#include "ioapi.h" +#include "iowin32.h" + +#ifndef INVALID_HANDLE_VALUE +#define INVALID_HANDLE_VALUE (0xFFFFFFFF) +#endif + +#ifndef INVALID_SET_FILE_POINTER +#define INVALID_SET_FILE_POINTER ((DWORD)-1) +#endif + +voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode)); +uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream)); +long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream)); +int ZCALLBACK win32_error_file_func OF((voidpf opaque, voidpf stream)); + +typedef struct +{ + HANDLE hf; + int error; +} WIN32FILE_IOWIN; + + +static void win32_translate_open_mode(int mode, + DWORD* lpdwDesiredAccess, + DWORD* lpdwCreationDisposition, + DWORD* lpdwShareMode, + DWORD* lpdwFlagsAndAttributes) +{ + *lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0; + + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + { + *lpdwDesiredAccess = GENERIC_READ; + *lpdwCreationDisposition = OPEN_EXISTING; + *lpdwShareMode = FILE_SHARE_READ; + } + else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + { + *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ; + *lpdwCreationDisposition = OPEN_EXISTING; + } + else if (mode & ZLIB_FILEFUNC_MODE_CREATE) + { + *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ; + *lpdwCreationDisposition = CREATE_ALWAYS; + } +} + +static voidpf win32_build_iowin(HANDLE hFile) +{ + voidpf ret=NULL; + + if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE)) + { + WIN32FILE_IOWIN w32fiow; + w32fiow.hf = hFile; + w32fiow.error = 0; + ret = malloc(sizeof(WIN32FILE_IOWIN)); + + if (ret==NULL) + CloseHandle(hFile); + else + *((WIN32FILE_IOWIN*)ret) = w32fiow; + } + return ret; +} + +voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int mode) +{ + const char* mode_fopen = NULL; + DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; + HANDLE hFile = NULL; + + win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes); + + if ((filename!=NULL) && (dwDesiredAccess != 0)) + hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL); + + return win32_build_iowin(hFile); +} + + +voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode) +{ + const char* mode_fopen = NULL; + DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; + HANDLE hFile = NULL; + + win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes); + + if ((filename!=NULL) && (dwDesiredAccess != 0)) + hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL); + + return win32_build_iowin(hFile); +} + + +voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int mode) +{ + const char* mode_fopen = NULL; + DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; + HANDLE hFile = NULL; + + win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes); + + if ((filename!=NULL) && (dwDesiredAccess != 0)) + hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL); + + return win32_build_iowin(hFile); +} + + +voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode) +{ + const char* mode_fopen = NULL; + DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; + HANDLE hFile = NULL; + + win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes); + + if ((filename!=NULL) && (dwDesiredAccess != 0)) + hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL); + + return win32_build_iowin(hFile); +} + + +uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uLong size) +{ + uLong ret=0; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + + if (hFile != NULL) + { + if (!ReadFile(hFile, buf, size, &ret, NULL)) + { + DWORD dwErr = GetLastError(); + if (dwErr == ERROR_HANDLE_EOF) + dwErr = 0; + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + } + } + + return ret; +} + + +uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* buf,uLong size) +{ + uLong ret=0; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + + if (hFile != NULL) + { + if (!WriteFile(hFile, buf, size, &ret, NULL)) + { + DWORD dwErr = GetLastError(); + if (dwErr == ERROR_HANDLE_EOF) + dwErr = 0; + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + } + } + + return ret; +} + +long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream) +{ + long ret=-1; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + if (hFile != NULL) + { + DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); + if (dwSet == INVALID_SET_FILE_POINTER) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = -1; + } + else + ret=(long)dwSet; + } + return ret; +} + +ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret= (ZPOS64_T)-1; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream)->hf; + + if (hFile) + { + LARGE_INTEGER li; + li.QuadPart = 0; + li.u.LowPart = SetFilePointer(hFile, li.u.LowPart, &li.u.HighPart, FILE_CURRENT); + if ( (li.LowPart == 0xFFFFFFFF) && (GetLastError() != NO_ERROR)) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = (ZPOS64_T)-1; + } + else + ret=li.QuadPart; + } + return ret; +} + + +long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,int origin) +{ + DWORD dwMoveMethod=0xFFFFFFFF; + HANDLE hFile = NULL; + + long ret=-1; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + dwMoveMethod = FILE_CURRENT; + break; + case ZLIB_FILEFUNC_SEEK_END : + dwMoveMethod = FILE_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + dwMoveMethod = FILE_BEGIN; + break; + default: return -1; + } + + if (hFile != NULL) + { + DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); + if (dwSet == INVALID_SET_FILE_POINTER) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = -1; + } + else + ret=0; + } + return ret; +} + +long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T offset,int origin) +{ + DWORD dwMoveMethod=0xFFFFFFFF; + HANDLE hFile = NULL; + long ret=-1; + + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream)->hf; + + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + dwMoveMethod = FILE_CURRENT; + break; + case ZLIB_FILEFUNC_SEEK_END : + dwMoveMethod = FILE_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + dwMoveMethod = FILE_BEGIN; + break; + default: return -1; + } + + if (hFile) + { + LARGE_INTEGER* li = (LARGE_INTEGER*)&offset; + DWORD dwSet = SetFilePointer(hFile, li->u.LowPart, &li->u.HighPart, dwMoveMethod); + if (dwSet == INVALID_SET_FILE_POINTER) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = -1; + } + else + ret=0; + } + return ret; +} + +int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream) +{ + int ret=-1; + + if (stream!=NULL) + { + HANDLE hFile; + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + if (hFile != NULL) + { + CloseHandle(hFile); + ret=0; + } + free(stream); + } + return ret; +} + +int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream) +{ + int ret=-1; + if (stream!=NULL) + { + ret = ((WIN32FILE_IOWIN*)stream) -> error; + } + return ret; +} + +void fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen_file = win32_open_file_func; + pzlib_filefunc_def->zread_file = win32_read_file_func; + pzlib_filefunc_def->zwrite_file = win32_write_file_func; + pzlib_filefunc_def->ztell_file = win32_tell_file_func; + pzlib_filefunc_def->zseek_file = win32_seek_file_func; + pzlib_filefunc_def->zclose_file = win32_close_file_func; + pzlib_filefunc_def->zerror_file = win32_error_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = win32_open64_file_func; + pzlib_filefunc_def->zread_file = win32_read_file_func; + pzlib_filefunc_def->zwrite_file = win32_write_file_func; + pzlib_filefunc_def->ztell64_file = win32_tell64_file_func; + pzlib_filefunc_def->zseek64_file = win32_seek64_file_func; + pzlib_filefunc_def->zclose_file = win32_close_file_func; + pzlib_filefunc_def->zerror_file = win32_error_file_func; + pzlib_filefunc_def->opaque = NULL; +} + + +void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA; + pzlib_filefunc_def->zread_file = win32_read_file_func; + pzlib_filefunc_def->zwrite_file = win32_write_file_func; + pzlib_filefunc_def->ztell64_file = win32_tell64_file_func; + pzlib_filefunc_def->zseek64_file = win32_seek64_file_func; + pzlib_filefunc_def->zclose_file = win32_close_file_func; + pzlib_filefunc_def->zerror_file = win32_error_file_func; + pzlib_filefunc_def->opaque = NULL; +} + + +void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW; + pzlib_filefunc_def->zread_file = win32_read_file_func; + pzlib_filefunc_def->zwrite_file = win32_write_file_func; + pzlib_filefunc_def->ztell64_file = win32_tell64_file_func; + pzlib_filefunc_def->zseek64_file = win32_seek64_file_func; + pzlib_filefunc_def->zclose_file = win32_close_file_func; + pzlib_filefunc_def->zerror_file = win32_error_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.h new file mode 100644 index 0000000..0ca0969 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/iowin32.h @@ -0,0 +1,28 @@ +/* iowin32.h -- IO base function header for compress/uncompress .zip + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); +void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def)); + +#ifdef __cplusplus +} +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/make_vms.com b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/make_vms.com new file mode 100644 index 0000000..9ac13a9 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/make_vms.com @@ -0,0 +1,25 @@ +$ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig +$ open/write zdef vmsdefs.h +$ copy sys$input: zdef +$ deck +#define unix +#define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from +#define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator +#define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord +#define Write_EndOfCentralDirectoryRecord Write_EoDRecord +$ eod +$ close zdef +$ copy vmsdefs.h,ioapi.h_orig ioapi.h +$ cc/include=[--]/prefix=all ioapi.c +$ cc/include=[--]/prefix=all miniunz.c +$ cc/include=[--]/prefix=all unzip.c +$ cc/include=[--]/prefix=all minizip.c +$ cc/include=[--]/prefix=all zip.c +$ link miniunz,unzip,ioapi,[--]libz.olb/lib +$ link minizip,zip,ioapi,[--]libz.olb/lib +$ mcr []minizip test minizip_info.txt +$ mcr []miniunz -l test.zip +$ rename minizip_info.txt; minizip_info.txt_old +$ mcr []miniunz test.zip +$ delete test.zip;* +$exit diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/miniunz.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/miniunz.c new file mode 100644 index 0000000..3d65401 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/miniunz.c @@ -0,0 +1,660 @@ +/* + miniunz.c + Version 1.1, February 14h, 2010 + sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) +*/ + +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif +#endif + +#ifdef __APPLE__ +// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions +#define FOPEN_FUNC(filename, mode) fopen(filename, mode) +#define FTELLO_FUNC(stream) ftello(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin) +#else +#define FOPEN_FUNC(filename, mode) fopen64(filename, mode) +#define FTELLO_FUNC(stream) ftello64(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin) +#endif + + +#include +#include +#include +#include +#include +#include + +#ifdef _WIN32 +# include +# include +#else +# include +# include +#endif + + +#include "unzip.h" + +#define CASESENSITIVITY (0) +#define WRITEBUFFERSIZE (8192) +#define MAXFILENAME (256) + +#ifdef _WIN32 +#define USEWIN32IOAPI +#include "iowin32.h" +#endif +/* + mini unzip, demo of unzip package + + usage : + Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir] + + list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT + if it exists +*/ + + +/* change_file_date : change the date/time of a file + filename : the filename of the file where date/time must be modified + dosdate : the new date at the MSDos format (4 bytes) + tmu_date : the SAME new date at the tm_unz format */ +void change_file_date(filename,dosdate,tmu_date) + const char *filename; + uLong dosdate; + tm_unz tmu_date; +{ +#ifdef _WIN32 + HANDLE hFile; + FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; + + hFile = CreateFileA(filename,GENERIC_READ | GENERIC_WRITE, + 0,NULL,OPEN_EXISTING,0,NULL); + GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite); + DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal); + LocalFileTimeToFileTime(&ftLocal,&ftm); + SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); + CloseHandle(hFile); +#else +#ifdef unix || __APPLE__ + struct utimbuf ut; + struct tm newdate; + newdate.tm_sec = tmu_date.tm_sec; + newdate.tm_min=tmu_date.tm_min; + newdate.tm_hour=tmu_date.tm_hour; + newdate.tm_mday=tmu_date.tm_mday; + newdate.tm_mon=tmu_date.tm_mon; + if (tmu_date.tm_year > 1900) + newdate.tm_year=tmu_date.tm_year - 1900; + else + newdate.tm_year=tmu_date.tm_year ; + newdate.tm_isdst=-1; + + ut.actime=ut.modtime=mktime(&newdate); + utime(filename,&ut); +#endif +#endif +} + + +/* mymkdir and change_file_date are not 100 % portable + As I don't know well Unix, I wait feedback for the unix portion */ + +int mymkdir(dirname) + const char* dirname; +{ + int ret=0; +#ifdef _WIN32 + ret = _mkdir(dirname); +#elif unix + ret = mkdir (dirname,0775); +#elif __APPLE__ + ret = mkdir (dirname,0775); +#endif + return ret; +} + +int makedir (newdir) + char *newdir; +{ + char *buffer ; + char *p; + int len = (int)strlen(newdir); + + if (len <= 0) + return 0; + + buffer = (char*)malloc(len+1); + if (buffer==NULL) + { + printf("Error allocating memory\n"); + return UNZ_INTERNALERROR; + } + strcpy(buffer,newdir); + + if (buffer[len-1] == '/') { + buffer[len-1] = '\0'; + } + if (mymkdir(buffer) == 0) + { + free(buffer); + return 1; + } + + p = buffer+1; + while (1) + { + char hold; + + while(*p && *p != '\\' && *p != '/') + p++; + hold = *p; + *p = 0; + if ((mymkdir(buffer) == -1) && (errno == ENOENT)) + { + printf("couldn't create directory %s\n",buffer); + free(buffer); + return 0; + } + if (hold == 0) + break; + *p++ = hold; + } + free(buffer); + return 1; +} + +void do_banner() +{ + printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); + printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); +} + +void do_help() +{ + printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ + " -e Extract without pathname (junk paths)\n" \ + " -x Extract with pathname\n" \ + " -v list files\n" \ + " -l list files\n" \ + " -d directory to extract into\n" \ + " -o overwrite files without prompting\n" \ + " -p extract crypted file using password\n\n"); +} + +void Display64BitsSize(ZPOS64_T n, int size_char) +{ + /* to avoid compatibility problem , we do here the conversion */ + char number[21]; + int offset=19; + int pos_string = 19; + number[20]=0; + for (;;) { + number[offset]=(char)((n%10)+'0'); + if (number[offset] != '0') + pos_string=offset; + n/=10; + if (offset==0) + break; + offset--; + } + { + int size_display_string = 19-pos_string; + while (size_char > size_display_string) + { + size_char--; + printf(" "); + } + } + + printf("%s",&number[pos_string]); +} + +int do_list(uf) + unzFile uf; +{ + uLong i; + unz_global_info64 gi; + int err; + + err = unzGetGlobalInfo64(uf,&gi); + if (err!=UNZ_OK) + printf("error %d with zipfile in unzGetGlobalInfo \n",err); + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); + for (i=0;i0) + ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size); + + /* display a '*' if the file is crypted */ + if ((file_info.flag & 1) != 0) + charCrypt='*'; + + if (file_info.compression_method==0) + string_method="Stored"; + else + if (file_info.compression_method==Z_DEFLATED) + { + uInt iLevel=(uInt)((file_info.flag & 0x6)/2); + if (iLevel==0) + string_method="Defl:N"; + else if (iLevel==1) + string_method="Defl:X"; + else if ((iLevel==2) || (iLevel==3)) + string_method="Defl:F"; /* 2:fast , 3 : extra fast*/ + } + else + if (file_info.compression_method==Z_BZIP2ED) + { + string_method="BZip2 "; + } + else + string_method="Unkn. "; + + Display64BitsSize(file_info.uncompressed_size,7); + printf(" %6s%c",string_method,charCrypt); + Display64BitsSize(file_info.compressed_size,7); + printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", + ratio, + (uLong)file_info.tmu_date.tm_mon + 1, + (uLong)file_info.tmu_date.tm_mday, + (uLong)file_info.tmu_date.tm_year % 100, + (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min, + (uLong)file_info.crc,filename_inzip); + if ((i+1)='a') && (rep<='z')) + rep -= 0x20; + } + while ((rep!='Y') && (rep!='N') && (rep!='A')); + } + + if (rep == 'N') + skip = 1; + + if (rep == 'A') + *popt_overwrite=1; + } + + if ((skip==0) && (err==UNZ_OK)) + { + fout=FOPEN_FUNC(write_filename,"wb"); + /* some zipfile don't contain directory alone before file */ + if ((fout==NULL) && ((*popt_extract_without_path)==0) && + (filename_withoutpath!=(char*)filename_inzip)) + { + char c=*(filename_withoutpath-1); + *(filename_withoutpath-1)='\0'; + makedir(write_filename); + *(filename_withoutpath-1)=c; + fout=FOPEN_FUNC(write_filename,"wb"); + } + + if (fout==NULL) + { + printf("error opening %s\n",write_filename); + } + } + + if (fout!=NULL) + { + printf(" extracting: %s\n",write_filename); + + do + { + err = unzReadCurrentFile(uf,buf,size_buf); + if (err<0) + { + printf("error %d with zipfile in unzReadCurrentFile\n",err); + break; + } + if (err>0) + if (fwrite(buf,err,1,fout)!=1) + { + printf("error in writing extracted file\n"); + err=UNZ_ERRNO; + break; + } + } + while (err>0); + if (fout) + fclose(fout); + + if (err==0) + change_file_date(write_filename,file_info.dosDate, + file_info.tmu_date); + } + + if (err==UNZ_OK) + { + err = unzCloseCurrentFile (uf); + if (err!=UNZ_OK) + { + printf("error %d with zipfile in unzCloseCurrentFile\n",err); + } + } + else + unzCloseCurrentFile(uf); /* don't lose the error */ + } + + free(buf); + return err; +} + + +int do_extract(uf,opt_extract_without_path,opt_overwrite,password) + unzFile uf; + int opt_extract_without_path; + int opt_overwrite; + const char* password; +{ + uLong i; + unz_global_info64 gi; + int err; + FILE* fout=NULL; + + err = unzGetGlobalInfo64(uf,&gi); + if (err!=UNZ_OK) + printf("error %d with zipfile in unzGetGlobalInfo \n",err); + + for (i=0;i +#include +#include +#include +#include +#include + +#ifdef _WIN32 +# include +# include +#else +# include +# include +# include +# include +#endif + +#include "zip.h" + +#ifdef _WIN32 + #define USEWIN32IOAPI + #include "iowin32.h" +#endif + + + +#define WRITEBUFFERSIZE (16384) +#define MAXFILENAME (256) + +#ifdef _WIN32 +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + int ret = 0; + { + FILETIME ftLocal; + HANDLE hFind; + WIN32_FIND_DATAA ff32; + + hFind = FindFirstFileA(f,&ff32); + if (hFind != INVALID_HANDLE_VALUE) + { + FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); + FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0); + FindClose(hFind); + ret = 1; + } + } + return ret; +} +#else +#ifdef unix || __APPLE__ +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + int ret=0; + struct stat s; /* results of stat() */ + struct tm* filedate; + time_t tm_t=0; + + if (strcmp(f,"-")!=0) + { + char name[MAXFILENAME+1]; + int len = strlen(f); + if (len > MAXFILENAME) + len = MAXFILENAME; + + strncpy(name, f,MAXFILENAME-1); + /* strncpy doesnt append the trailing NULL, of the string is too long. */ + name[ MAXFILENAME ] = '\0'; + + if (name[len - 1] == '/') + name[len - 1] = '\0'; + /* not all systems allow stat'ing a file with / appended */ + if (stat(name,&s)==0) + { + tm_t = s.st_mtime; + ret = 1; + } + } + filedate = localtime(&tm_t); + + tmzip->tm_sec = filedate->tm_sec; + tmzip->tm_min = filedate->tm_min; + tmzip->tm_hour = filedate->tm_hour; + tmzip->tm_mday = filedate->tm_mday; + tmzip->tm_mon = filedate->tm_mon ; + tmzip->tm_year = filedate->tm_year; + + return ret; +} +#else +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + return 0; +} +#endif +#endif + + + + +int check_exist_file(filename) + const char* filename; +{ + FILE* ftestexist; + int ret = 1; + ftestexist = FOPEN_FUNC(filename,"rb"); + if (ftestexist==NULL) + ret = 0; + else + fclose(ftestexist); + return ret; +} + +void do_banner() +{ + printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); + printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); +} + +void do_help() +{ + printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \ + " -o Overwrite existing file.zip\n" \ + " -a Append to existing file.zip\n" \ + " -0 Store only\n" \ + " -1 Compress faster\n" \ + " -9 Compress better\n\n" \ + " -j exclude path. store only the file name.\n\n"); +} + +/* calculate the CRC32 of a file, + because to encrypt a file, we need known the CRC32 of the file before */ +int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) +{ + unsigned long calculate_crc=0; + int err=ZIP_OK; + FILE * fin = FOPEN_FUNC(filenameinzip,"rb"); + + unsigned long size_read = 0; + unsigned long total_read = 0; + if (fin==NULL) + { + err = ZIP_ERRNO; + } + + if (err == ZIP_OK) + do + { + err = ZIP_OK; + size_read = (int)fread(buf,1,size_buf,fin); + if (size_read < size_buf) + if (feof(fin)==0) + { + printf("error in reading %s\n",filenameinzip); + err = ZIP_ERRNO; + } + + if (size_read>0) + calculate_crc = crc32(calculate_crc,buf,size_read); + total_read += size_read; + + } while ((err == ZIP_OK) && (size_read>0)); + + if (fin) + fclose(fin); + + *result_crc=calculate_crc; + printf("file %s crc %lx\n", filenameinzip, calculate_crc); + return err; +} + +int isLargeFile(const char* filename) +{ + int largeFile = 0; + ZPOS64_T pos = 0; + FILE* pFile = FOPEN_FUNC(filename, "rb"); + + if(pFile != NULL) + { + int n = FSEEKO_FUNC(pFile, 0, SEEK_END); + pos = FTELLO_FUNC(pFile); + + printf("File : %s is %lld bytes\n", filename, pos); + + if(pos >= 0xffffffff) + largeFile = 1; + + fclose(pFile); + } + + return largeFile; +} + +int main(argc,argv) + int argc; + char *argv[]; +{ + int i; + int opt_overwrite=0; + int opt_compress_level=Z_DEFAULT_COMPRESSION; + int opt_exclude_path=0; + int zipfilenamearg = 0; + char filename_try[MAXFILENAME+16]; + int zipok; + int err=0; + int size_buf=0; + void* buf=NULL; + const char* password=NULL; + + + do_banner(); + if (argc==1) + { + do_help(); + return 0; + } + else + { + for (i=1;i='0') && (c<='9')) + opt_compress_level = c-'0'; + if ((c=='j') || (c=='J')) + opt_exclude_path = 1; + + if (((c=='p') || (c=='P')) && (i+1='a') && (rep<='z')) + rep -= 0x20; + } + while ((rep!='Y') && (rep!='N') && (rep!='A')); + if (rep=='N') + zipok = 0; + if (rep=='A') + opt_overwrite = 2; + } + } + + if (zipok==1) + { + zipFile zf; + int errclose; +# ifdef USEWIN32IOAPI + zlib_filefunc64_def ffunc; + fill_win32_filefunc64A(&ffunc); + zf = zipOpen2_64(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc); +# else + zf = zipOpen64(filename_try,(opt_overwrite==2) ? 2 : 0); +# endif + + if (zf == NULL) + { + printf("error opening %s\n",filename_try); + err= ZIP_ERRNO; + } + else + printf("creating %s\n",filename_try); + + for (i=zipfilenamearg+1;(i='0') || (argv[i][1]<='9'))) && + (strlen(argv[i]) == 2))) + { + FILE * fin; + int size_read; + const char* filenameinzip = argv[i]; + const char *savefilenameinzip; + zip_fileinfo zi; + unsigned long crcFile=0; + int zip64 = 0; + + zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = + zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; + zi.dosDate = 0; + zi.internal_fa = 0; + zi.external_fa = 0; + filetime(filenameinzip,&zi.tmz_date,&zi.dosDate); + +/* + err = zipOpenNewFileInZip(zf,filenameinzip,&zi, + NULL,0,NULL,0,NULL / * comment * /, + (opt_compress_level != 0) ? Z_DEFLATED : 0, + opt_compress_level); +*/ + if ((password != NULL) && (err==ZIP_OK)) + err = getFileCrc(filenameinzip,buf,size_buf,&crcFile); + + zip64 = isLargeFile(filenameinzip); + + /* The path name saved, should not include a leading slash. */ + /*if it did, windows/xp and dynazip couldn't read the zip file. */ + savefilenameinzip = filenameinzip; + while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' ) + { + savefilenameinzip++; + } + + /*should the zip file contain any path at all?*/ + if( opt_exclude_path ) + { + const char *tmpptr; + const char *lastslash = 0; + for( tmpptr = savefilenameinzip; *tmpptr; tmpptr++) + { + if( *tmpptr == '\\' || *tmpptr == '/') + { + lastslash = tmpptr; + } + } + if( lastslash != NULL ) + { + savefilenameinzip = lastslash+1; // base filename follows last slash. + } + } + + /**/ + err = zipOpenNewFileInZip3_64(zf,savefilenameinzip,&zi, + NULL,0,NULL,0,NULL /* comment*/, + (opt_compress_level != 0) ? Z_DEFLATED : 0, + opt_compress_level,0, + /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */ + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + password,crcFile, zip64); + + if (err != ZIP_OK) + printf("error in opening %s in zipfile\n",filenameinzip); + else + { + fin = FOPEN_FUNC(filenameinzip,"rb"); + if (fin==NULL) + { + err=ZIP_ERRNO; + printf("error in opening %s for reading\n",filenameinzip); + } + } + + if (err == ZIP_OK) + do + { + err = ZIP_OK; + size_read = (int)fread(buf,1,size_buf,fin); + if (size_read < size_buf) + if (feof(fin)==0) + { + printf("error in reading %s\n",filenameinzip); + err = ZIP_ERRNO; + } + + if (size_read>0) + { + err = zipWriteInFileInZip (zf,buf,size_read); + if (err<0) + { + printf("error in writing %s in the zipfile\n", + filenameinzip); + } + + } + } while ((err == ZIP_OK) && (size_read>0)); + + if (fin) + fclose(fin); + + if (err<0) + err=ZIP_ERRNO; + else + { + err = zipCloseFileInZip(zf); + if (err!=ZIP_OK) + printf("error in closing %s in the zipfile\n", + filenameinzip); + } + } + } + errclose = zipClose(zf,NULL); + if (errclose != ZIP_OK) + printf("error in closing %s\n",filename_try); + } + else + { + do_help(); + } + + free(buf); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/minizip.pc.in b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/minizip.pc.in new file mode 100644 index 0000000..69b5b7f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/minizip.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/minizip + +Name: minizip +Description: Minizip zip file manipulation library +Requires: +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lminizip +Libs.private: -lz +Cflags: -I${includedir} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.c new file mode 100644 index 0000000..96891c2 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.c @@ -0,0 +1,291 @@ +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +/* Code */ +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#define READ_8(adr) ((unsigned char)*(adr)) +#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) +#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) ) + +#define WRITE_8(buff, n) do { \ + *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \ +} while(0) +#define WRITE_16(buff, n) do { \ + WRITE_8((unsigned char*)(buff), n); \ + WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \ +} while(0) +#define WRITE_32(buff, n) do { \ + WRITE_16((unsigned char*)(buff), (n) & 0xffff); \ + WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ +} while(0) + +extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) +const char* file; +const char* fileOut; +const char* fileOutTmp; +uLong* nRecovered; +uLong* bytesRecovered; +{ + int err = Z_OK; + FILE* fpZip = fopen(file, "rb"); + FILE* fpOut = fopen(fileOut, "wb"); + FILE* fpOutCD = fopen(fileOutTmp, "wb"); + if (fpZip != NULL && fpOut != NULL) { + int entries = 0; + uLong totalBytes = 0; + char header[30]; + char filename[1024]; + char extra[1024]; + int offset = 0; + int offsetCD = 0; + while ( fread(header, 1, 30, fpZip) == 30 ) { + int currentOffset = offset; + + /* File entry */ + if (READ_32(header) == 0x04034b50) { + unsigned int version = READ_16(header + 4); + unsigned int gpflag = READ_16(header + 6); + unsigned int method = READ_16(header + 8); + unsigned int filetime = READ_16(header + 10); + unsigned int filedate = READ_16(header + 12); + unsigned int crc = READ_32(header + 14); /* crc */ + unsigned int cpsize = READ_32(header + 18); /* compressed size */ + unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */ + unsigned int fnsize = READ_16(header + 26); /* file name length */ + unsigned int extsize = READ_16(header + 28); /* extra field length */ + filename[0] = extra[0] = '\0'; + + /* Header */ + if (fwrite(header, 1, 30, fpOut) == 30) { + offset += 30; + } else { + err = Z_ERRNO; + break; + } + + /* Filename */ + if (fnsize > 0) { + if (fnsize < sizeof(filename)) { + if (fread(filename, 1, fnsize, fpZip) == fnsize) { + if (fwrite(filename, 1, fnsize, fpOut) == fnsize) { + offset += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (extsize < sizeof(extra)) { + if (fread(extra, 1, extsize, fpZip) == extsize) { + if (fwrite(extra, 1, extsize, fpOut) == extsize) { + offset += extsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } + + /* Data */ + { + int dataSize = cpsize; + if (dataSize == 0) { + dataSize = uncpsize; + } + if (dataSize > 0) { + char* data = malloc(dataSize); + if (data != NULL) { + if ((int)fread(data, 1, dataSize, fpZip) == dataSize) { + if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) { + offset += dataSize; + totalBytes += dataSize; + } else { + err = Z_ERRNO; + } + } else { + err = Z_ERRNO; + } + free(data); + if (err != Z_OK) { + break; + } + } else { + err = Z_MEM_ERROR; + break; + } + } + } + + /* Central directory entry */ + { + char header[46]; + char* comment = ""; + int comsize = (int) strlen(comment); + WRITE_32(header, 0x02014b50); + WRITE_16(header + 4, version); + WRITE_16(header + 6, version); + WRITE_16(header + 8, gpflag); + WRITE_16(header + 10, method); + WRITE_16(header + 12, filetime); + WRITE_16(header + 14, filedate); + WRITE_32(header + 16, crc); + WRITE_32(header + 20, cpsize); + WRITE_32(header + 24, uncpsize); + WRITE_16(header + 28, fnsize); + WRITE_16(header + 30, extsize); + WRITE_16(header + 32, comsize); + WRITE_16(header + 34, 0); /* disk # */ + WRITE_16(header + 36, 0); /* int attrb */ + WRITE_32(header + 38, 0); /* ext attrb */ + WRITE_32(header + 42, currentOffset); + /* Header */ + if (fwrite(header, 1, 46, fpOutCD) == 46) { + offsetCD += 46; + + /* Filename */ + if (fnsize > 0) { + if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) { + offsetCD += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (fwrite(extra, 1, extsize, fpOutCD) == extsize) { + offsetCD += extsize; + } else { + err = Z_ERRNO; + break; + } + } + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) { + offsetCD += comsize; + } else { + err = Z_ERRNO; + break; + } + } + + + } else { + err = Z_ERRNO; + break; + } + } + + /* Success */ + entries++; + + } else { + break; + } + } + + /* Final central directory */ + { + int entriesZip = entries; + char header[22]; + char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools"; + int comsize = (int) strlen(comment); + if (entriesZip > 0xffff) { + entriesZip = 0xffff; + } + WRITE_32(header, 0x06054b50); + WRITE_16(header + 4, 0); /* disk # */ + WRITE_16(header + 6, 0); /* disk # */ + WRITE_16(header + 8, entriesZip); /* hack */ + WRITE_16(header + 10, entriesZip); /* hack */ + WRITE_32(header + 12, offsetCD); /* size of CD */ + WRITE_32(header + 16, offset); /* offset to CD */ + WRITE_16(header + 20, comsize); /* comment */ + + /* Header */ + if (fwrite(header, 1, 22, fpOutCD) == 22) { + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) { + err = Z_ERRNO; + } + } + + } else { + err = Z_ERRNO; + } + } + + /* Final merge (file + central directory) */ + fclose(fpOutCD); + if (err == Z_OK) { + fpOutCD = fopen(fileOutTmp, "rb"); + if (fpOutCD != NULL) { + int nRead; + char buffer[8192]; + while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { + if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { + err = Z_ERRNO; + break; + } + } + fclose(fpOutCD); + } + } + + /* Close */ + fclose(fpZip); + fclose(fpOut); + + /* Wipe temporary file */ + (void)remove(fileOutTmp); + + /* Number of recovered entries */ + if (err == Z_OK) { + if (nRecovered != NULL) { + *nRecovered = entries; + } + if (bytesRecovered != NULL) { + *bytesRecovered = totalBytes; + } + } + } else { + err = Z_STREAM_ERROR; + } + return err; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.h new file mode 100644 index 0000000..a49a426 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/mztools.h @@ -0,0 +1,37 @@ +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +#ifndef _zip_tools_H +#define _zip_tools_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#include "unzip.h" + +/* Repair a ZIP file (missing central directory) + file: file to recover + fileOut: output file after recovery + fileOutTmp: temporary file name used for recovery +*/ +extern int ZEXPORT unzRepair(const char* file, + const char* fileOut, + const char* fileOutTmp, + uLong* nRecovered, + uLong* bytesRecovered); + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.c new file mode 100644 index 0000000..affad4b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.c @@ -0,0 +1,2125 @@ +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + + ------------------------------------------------------------------------------------ + Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of + compatibility with older software. The following is from the original crypt.c. + Code woven in by Terry Thorsen 1/2003. + + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html + + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + ------------------------------------------------------------------------------------ + + Changes in unzip.c + + 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos + 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* + 2007-2008 - Even Rouault - Remove old C style function prototypes + 2007-2008 - Even Rouault - Add unzip support for ZIP64 + + Copyright (C) 2007-2008 Even Rouault + + + Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). + Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G + should only read the compressed/uncompressed size from the Zip64 format if + the size from normal header was 0xFFFFFFFF + Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) + Patch created by Daniel Borca + + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + + Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson + +*/ + + +#include +#include +#include + +#ifndef NOUNCRYPT + #define NOUNCRYPT +#endif + +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info64_internal_s +{ + ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ +} unz_file_info64_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ + ZPOS64_T total_out_64; + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ + ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip64_read_info_s; + + +/* unz64_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + int is64bitOpenFunction; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info64 gi; /* public global information */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + ZPOS64_T num_file; /* number of the current file in the zipfile*/ + ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ + ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ + ZPOS64_T central_pos; /* position of the beginning of the central dir*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info64 cur_file_info; /* public info about the current file in zip*/ + unz_file_info64_internal cur_file_info_internal; /* private info about it*/ + file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; + + int isZip64; + +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz64_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unz64local_getByte OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unz64local_getShort OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX)); + + +local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX) +{ + ZPOS64_T x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<24; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<32; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<40; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<48; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<56; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity) + +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); +local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + + +/* + Locate the Central directory 64 of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream)); + +local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) + return 0; + + /* total number of disks */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + if (uL != 0x06064b50) + return 0; + + return relativeOffset; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +local unzFile unzOpenInternal (const void *path, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def, + int is64bitOpenFunction) +{ + unz64_s us; + unz64_s *s; + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + us.z_filefunc.zseek32_file = NULL; + us.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); + else + us.z_filefunc = *pzlib_filefunc64_32_def; + us.is64bitOpenFunction = is64bitOpenFunction; + + + + us.filestream = ZOPEN64(us.z_filefunc, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); + if (central_pos) + { + uLong uS; + ZPOS64_T uL64; + + us.isZip64 = 1; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* size of zip64 end of central directory record */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version made by */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version needed to extract */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + us.gi.size_comment = 0; + } + else + { + central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + us.isZip64 = 0; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.gi.number_entry = uL; + + /* total number of entries in the central dir */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + number_entry_CD = uL; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.size_central_dir = uL; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.offset_central_dir = uL; + + /* zipfile comment length */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + } + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE64(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + +extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + /* to do : check if number_entry is not truncated */ + pglobal_info32->number_entry = (uLong)s->gi.number_entry; + pglobal_info32->size_comment = s->gi.size_comment; + return UNZ_OK; +} +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) +{ + ZPOS64_T uDate; + uDate = (ZPOS64_T)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unz64local_GetCurrentFileInfoInternal (unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz64_s* s; + unz_file_info64 file_info; + unz_file_info64_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + uLong uL; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.compressed_size = uL; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.uncompressed_size = uL; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + // relative offset of local header + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info_internal.offset_curfile = uL; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + // Read extrafield + if ((err==UNZ_OK) && (extraField!=NULL)) + { + ZPOS64_T uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + + lSeek += file_info.size_file_extra - (uLong)uSizeRead; + } + else + lSeek += file_info.size_file_extra; + + + if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) + { + uLong acc = 0; + + // since lSeek now points to after the extra field we need to move back + lSeek -= file_info.size_file_extra; + + if (lSeek!=0) + { + if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + while(acc < file_info.size_file_extra) + { + uLong headerId; + uLong dataSize; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) + err=UNZ_ERRNO; + + /* ZIP64 extra fields */ + if (headerId == 0x0001) + { + uLong uL; + + if(file_info.uncompressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.compressed_size == MAXU32) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info_internal.offset_curfile == MAXU32) + { + /* Relative Header offset */ + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.disk_num_start == MAXU32) + { + /* Disk Start Number */ + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + } + + } + else + { + if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) + err=UNZ_ERRNO; + } + + acc += 2 + 2 + dataSize; + } + } + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + int err; + unz_file_info64 file_info64; + err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); + if ((err==UNZ_OK) && (pfile_info != NULL)) + { + pfile_info->version = file_info64.version; + pfile_info->version_needed = file_info64.version_needed; + pfile_info->flag = file_info64.flag; + pfile_info->compression_method = file_info64.compression_method; + pfile_info->dosDate = file_info64.dosDate; + pfile_info->crc = file_info64.crc; + + pfile_info->size_filename = file_info64.size_filename; + pfile_info->size_file_extra = file_info64.size_file_extra; + pfile_info->size_file_comment = file_info64.size_file_comment; + + pfile_info->disk_num_start = file_info64.disk_num_start; + pfile_info->internal_fa = file_info64.internal_fa; + pfile_info->external_fa = file_info64.external_fa; + + pfile_info->tmu_date = file_info64.tmu_date, + + + pfile_info->compressed_size = (uLong)file_info64.compressed_size; + pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; + + } + return err; +} +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (unzFile file) +{ + int err=UNZ_OK; + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (unzFile file) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz64_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info64 cur_file_infoSaved; + unz_file_info64_internal cur_file_info_internalSaved; + ZPOS64_T num_fileSaved; + ZPOS64_T pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo64(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; // offset in file + ZPOS64_T num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) +{ + unz64_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + int err = unzGetFilePos64(file,&file_pos64); + if (err==UNZ_OK) + { + file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; + file_pos->num_of_file = (uLong)file_pos64.num_of_file; + } + return err; +} + +extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) +{ + unz64_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + if (file_pos == NULL) + return UNZ_PARAMERROR; + + file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; + file_pos64.num_of_file = file_pos->num_of_file; + return unzGoToFilePos64(file,&file_pos64); +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, + ZPOS64_T * poffset_local_extrafield, + uInt * psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + int* level, int raw, const char* password) +{ + int err=UNZ_OK; + uInt iSizeVar; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->total_out_64=0; + pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) + { +#ifdef HAVE_BZIP2 + pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; + pfile_in_zip_read_info->bstream.bzfree = (free_func)0; + pfile_in_zip_read_info->bstream.opaque = (voidpf)0; + pfile_in_zip_read_info->bstream.state = (voidpf)0; + + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } +#else + pfile_in_zip_read_info->raw=1; +#endif + } + else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = 0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + s->encrypted = 0; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (unzFile file) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + s=(unz64_s*)file; + if (file==NULL) + return 0; //UNZ_PARAMERROR; + pfile_in_zip_read_info=s->pfile_in_zip_read; + if (pfile_in_zip_read_info==NULL) + return 0; //UNZ_PARAMERROR; + return pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile; +} + +/** Addition for GDAL : END */ + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->read_buffer == NULL) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + + pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; + pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; + pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; + pfile_in_zip_read_info->bstream.total_in_hi32 = 0; + pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; + pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; + pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; + pfile_in_zip_read_info->bstream.total_out_hi32 = 0; + + uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; + bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; + + err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); + + uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); + pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; + pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; + pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; + pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; + pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; + pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; + + if (err==BZ_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=BZ_OK) + break; +#endif + } // end Z_BZIP2ED + else + { + ZPOS64_T uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + ZPOS64_T uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + +extern ZPOS64_T ZEXPORT unztell64 (unzFile file) +{ + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return (ZPOS64_T)-1; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return (ZPOS64_T)-1; + + return pfile_in_zip_read_info->total_out_64; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* +Read extra field from the current file (opened by unzOpenCurrentFile) +This is the local-header version of the extra field (sometimes, there is +more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + uInt read_now; + ZPOS64_T size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) + inflateEnd(&pfile_in_zip_read_info->stream); +#ifdef HAVE_BZIP2 + else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) + BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); +#endif + + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) +{ + unz64_s* s; + uLong uReadThis ; + if (file==NULL) + return (int)UNZ_PARAMERROR; + s=(unz64_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) +{ + unz64_s* s; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern uLong ZEXPORT unzGetOffset (unzFile file) +{ + ZPOS64_T offset64; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + offset64 = unzGetOffset64(file); + return (uLong)offset64; +} + +extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) +{ + return unzSetOffset64(file,pos); +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.h new file mode 100644 index 0000000..3183968 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/unzip.h @@ -0,0 +1,437 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------------- + + Changes + + See header of unzip64.c + +*/ + +#ifndef _unz64_H +#define _unz64_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + ZPOS64_T number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info64_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + ZPOS64_T compressed_size; /* compressed size 8 bytes */ + ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +extern unzFile ZEXPORT unzOpen64 OF((const void *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. + the "64" function take a const void* pointer, because the path is just the + value passed to the open64_file_func callback. + Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path + is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* + does not describe the reality +*/ + + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, + zlib_filefunc64_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unz64Open, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); + +extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, + unz_global_info64 *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +typedef struct unz64_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ + ZPOS64_T num_of_file; /* # of file */ +} unz64_file_pos; + +extern int ZEXPORT unzGetFilePos64( + unzFile file, + unz64_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos64( + unzFile file, + const unz64_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); + +/** Addition for GDAL : END */ + + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); + +extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz64_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.c b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.c new file mode 100644 index 0000000..147934c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.c @@ -0,0 +1,2007 @@ +/* zip.c -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + Oct-2009 - Mathias Svensson - Remove old C style function prototypes + Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives + Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions. + Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data + It is used when recreting zip archive with RAW when deleting items from a zip. + ZIP64 data is automaticly added to items that needs it, and existing ZIP64 data need to be removed. + Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required) + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (64*1024) //(16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + + +// NOT sure that this work on ALL platform +#define MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32)) + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) +#define ZIP64ENDHEADERMAGIC (0x6064b50) +#define ZIP64ENDLOCHEADERMAGIC (0x7064b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + ZPOS64_T pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralExtra; + uLong size_centralheader; /* size of the central header for cur file */ + uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; + int zip64; /* Add ZIP64 extened information in the extra field */ + ZPOS64_T pos_zip64extrainfo; + ZPOS64_T totalCompressedData; + ZPOS64_T totalUncompressedData; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile64_info; + +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile64_info ci; /* info on the file curretly writing */ + + ZPOS64_T begin_pos; /* position of the beginning of the zipfile */ + ZPOS64_T add_position_when_writting_offset; + ZPOS64_T number_entry; + +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif + +} zip64_internal; + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(linkedlist_datablock_internal* ldi) +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(linkedlist_data* ll) +{ + ll->first_block = ll->last_block = NULL; +} + +local void free_linkedlist(linkedlist_data* ll) +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} + + +local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 ,4 or 8 (byte, short or long, ZPOS64_T) +*/ + +local int zip64local_putValue OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)); +local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) +{ + unsigned char buf[8]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void zip64local_putValue_inmemory OF((void* dest, ZPOS64_T x, int nbByte)); +local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) +{ + uLong year = (uLong)ptm->tm_year; + if (year>=1980) + year-=1980; + else if (year>=80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int zip64local_getByte OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)); + +local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,voidpf filestream,int* pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int zip64local_getShort OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)); + + +local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) +{ + ZPOS64_T x; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<24; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<32; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<40; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<48; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<56; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* +Locate the End of Zip64 Central directory locator and from there find the CD of a zipfile (at the end, just before +the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + { + // Signature "0x07064b50" Zip64 end of central directory locater + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + } + + if (uPosFound!=0) + break; + } + + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (zip64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=ZIP_OK) + return 0; + + /* total number of disks */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto Zip64 end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + if (uL != 0x06064b50) // signature of 'Zip64 end of central directory' + return 0; + + return relativeOffset; +} + +int LoadCentralDirectoryRecord(zip64_internal* pziinit) +{ + int err=ZIP_OK; + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory */ + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry; + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong VersionMadeBy; + uLong VersionNeeded; + uLong size_comment; + + int hasZIP64Record = 0; + + // check first if we find a ZIP64 record + central_pos = zip64local_SearchCentralDir64(&pziinit->z_filefunc,pziinit->filestream); + if(central_pos > 0) + { + hasZIP64Record = 1; + } + else if(central_pos == 0) + { + central_pos = zip64local_SearchCentralDir(&pziinit->z_filefunc,pziinit->filestream); + } + +/* disable to allow appending to empty ZIP archive + if (central_pos==0) + err=ZIP_ERRNO; +*/ + + if(hasZIP64Record) + { + ZPOS64_T sizeEndOfCentralDirectory; + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* size of zip64 end of central directory record */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &sizeEndOfCentralDirectory)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version made by */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionMadeBy)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version needed to extract */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionNeeded)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + // TODO.. + // read the comment from the standard central header. + size_comment = 0; + } + else + { + // Read End of central Directory info + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + number_entry = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry = uL; + + /* total number of entries in the central dir */ + number_entry_CD = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry_CD = uL; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + size_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + size_central_dir = uL; + + /* offset of start of central directory with respect to the starting disk number */ + offset_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + offset_central_dir = uL; + + + /* zipfile global comment length */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + } + + if ((central_posz_filefunc, pziinit->filestream); + return ZIP_ERRNO; + } + + if (size_comment>0) + { + pziinit->globalcomment = (char*)ALLOC(size_comment+1); + if (pziinit->globalcomment) + { + size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment); + pziinit->globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir); + pziinit->add_position_when_writting_offset = byte_before_the_zipfile; + + { + ZPOS64_T size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir + byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + ZPOS64_T read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + + if (ZREAD64(pziinit->z_filefunc, pziinit->filestream,buf_read,(uLong)read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&pziinit->central_dir,buf_read, (uLong)read_this); + + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + pziinit->begin_pos = byte_before_the_zipfile; + pziinit->number_entry = number_entry_CD; + + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + return err; +} + + +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + + +/************************************************************/ +extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) +{ + zip64_internal ziinit; + zip64_internal* zi; + int err=ZIP_OK; + + ziinit.z_filefunc.zseek32_file = NULL; + ziinit.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); + else + ziinit.z_filefunc = *pzlib_filefunc64_32_def; + + ziinit.filestream = ZOPEN64(ziinit.z_filefunc, + pathname, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + + if (append == APPEND_STATUS_CREATEAFTER) + ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END); + + ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + init_linkedlist(&(ziinit.central_dir)); + + + + zi = (zip64_internal*)ALLOC(sizeof(zip64_internal)); + if (zi==NULL) + { + ZCLOSE64(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + // Read and Cache Central Directory Records + err = LoadCentralDirectoryRecord(&ziinit); + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) +{ + if (pzlib_filefunc32_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def); + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + +extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def; + zlib_filefunc64_32_def_fill.ztell32_file = NULL; + zlib_filefunc64_32_def_fill.zseek32_file = NULL; + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + + + +extern zipFile ZEXPORT zipOpen (const char* pathname, int append) +{ + return zipOpen3((const void*)pathname,append,NULL,NULL); +} + +extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) +{ + return zipOpen3(pathname,append,NULL,NULL); +} + +int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) +{ + /* write the local header */ + int err; + uInt size_filename = (uInt)strlen(filename); + uInt size_extrafield = size_extrafield_local; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4); + + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + // CRC / Compressed size / Uncompressed size will be filled in later and rewritten later + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + } + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if(zi->ci.zip64) + { + size_extrafield += 20; + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2); + + if ((err==ZIP_OK) && (size_filename > 0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + } + + if ((err==ZIP_OK) && (size_extrafield_local > 0)) + { + if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local) + err = ZIP_ERRNO; + } + + + if ((err==ZIP_OK) && (zi->ci.zip64)) + { + // write the Zip64 extended info + short HeaderID = 1; + short DataSize = 16; + ZPOS64_T CompressedSize = 0; + ZPOS64_T UncompressedSize = 0; + + // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file) + zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8); + } + + return err; +} + +/* + NOTE. + When writing RAW the ZIP64 extended information in extrafield_local and extrafield_global needs to be stripped + before calling this function it can be done with zipRemoveExtraInfoBlock + + It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize + unnecessary allocations. + */ +extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase, int zip64) +{ + zip64_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + +# ifdef NOCRYPT + (crcForCrypting); + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + +#ifdef HAVE_BZIP2 + if ((method!=0) && (method!=Z_DEFLATED) && (method!=Z_BZIP2ED)) + return ZIP_PARAMERROR; +#else + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; +#endif + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else + zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date); + } + + zi->ci.flag = flagBase; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if (level==2) + zi->ci.flag |= 4; + if (level==1) + zi->ci.flag |= 6; + if (password != NULL) + zi->ci.flag |= 1; + + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream); + + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment; + zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data + + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree); + + zi->ci.size_centralExtra = size_extrafield_global; + zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2); + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); + zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + if(zi->ci.pos_local_header >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + zi->ci.zip64 = zip64; + zi->ci.totalCompressedData = 0; + zi->ci.totalUncompressedData = 0; + zi->ci.pos_zip64extrainfo = 0; + + err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local); + +#ifdef HAVE_BZIP2 + zi->ci.bstream.avail_in = (uInt)0; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + zi->ci.bstream.total_in_hi32 = 0; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_out_hi32 = 0; + zi->ci.bstream.total_out_lo32 = 0; +#endif + + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + zi->ci.stream.data_type = Z_BINARY; + +#ifdef HAVE_BZIP2 + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) +#else + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) +#endif + { + if(zi->ci.method == Z_DEFLATED) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = Z_DEFLATED; + } + else if(zi->ci.method == Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + // Init BZip stuff here + zi->ci.bstream.bzalloc = 0; + zi->ci.bstream.bzfree = 0; + zi->ci.bstream.opaque = (voidpf)0; + + err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35); + if(err == BZ_OK) + zi->ci.stream_initialised = Z_BZIP2ED; +#endif + } + + } + +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, versionMadeBy, flagBase, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +local int zip64FlushWriteBuffer(zip64_internal* zi) +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t); +#endif + } + + if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + + zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data; + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED) + { + zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_in_hi32 = 0; + } + else +#endif + { + zi->ci.totalUncompressedData += zi->ci.stream.total_in; + zi->ci.stream.total_in = 0; + } + + + zi->ci.pos_in_buffered_data = 0; + + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) +{ + zip64_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len); + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw)) + { + zi->ci.bstream.next_in = (void*)buf; + zi->ci.bstream.avail_in = len; + err = BZ_RUN_OK; + + while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0)) + { + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + + + if(err != BZ_RUN_OK) + break; + + if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32; +// uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN); + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ; + } + } + + if(err == BZ_RUN_OK) + err = ZIP_OK; + } + else +#endif + { + zi->ci.stream.next_in = (Bytef*)buf; + zi->ci.stream.avail_in = len; + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + if(uTotalOutBefore > zi->ci.stream.total_out) + { + int bBreak = 0; + bBreak++; + } + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + + for (i = 0; i < copy_this; i++) + *(((char*)zi->ci.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + }// while(...) + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) +{ + return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); +} + +extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) +{ + zip64_internal* zi; + ZPOS64_T compressed_size; + uLong invalidValue = 0xffffffff; + short datasize = 0; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + } + else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { +#ifdef HAVE_BZIP2 + err = BZ_FINISH_OK; + while (err==BZ_FINISH_OK) + { + uLong uTotalOutBefore; + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.bstream.total_out_lo32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH); + if(err == BZ_STREAM_END) + err = Z_STREAM_END; + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore); + } + + if(err == BZ_FINISH_OK) + err = ZIP_OK; +#endif + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + { + if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + } + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + int tmp_err = deflateEnd(&zi->ci.stream); + if (err == ZIP_OK) + err = tmp_err; + zi->ci.stream_initialised = 0; + } +#ifdef HAVE_BZIP2 + else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream); + if (err==ZIP_OK) + err = tmperr; + zi->ci.stream_initialised = 0; + } +#endif + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = zi->ci.totalUncompressedData; + } + compressed_size = zi->ci.totalCompressedData; + +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + // update Current Item crc and sizes, + if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff) + { + /*version Made by*/ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2); + /*version needed*/ + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2); + + } + + zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + + + if(compressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/ + + /// set internal file attributes field + if (zi->ci.stream.data_type == Z_ASCII) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + + if(uncompressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/ + + // Add ZIP64 extra info field for uncompressed size + if(uncompressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for compressed size + if(compressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for relative offset to local file header of current file + if(zi->ci.pos_local_header >= 0xffffffff) + datasize += 8; + + if(datasize > 0) + { + char* p = NULL; + + if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) + { + // we can not write more data to the buffer that we have room for. + return ZIP_BADZIPFILE; + } + + p = zi->ci.central_header + zi->ci.size_centralheader; + + // Add Extra Information Header for 'ZIP64 information' + zip64local_putValue_inmemory(p, 0x0001, 2); // HeaderID + p += 2; + zip64local_putValue_inmemory(p, datasize, 2); // DataSize + p += 2; + + if(uncompressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, uncompressed_size, 8); + p += 8; + } + + if(compressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, compressed_size, 8); + p += 8; + } + + if(zi->ci.pos_local_header >= 0xffffffff) + { + zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8); + p += 8; + } + + // Update how much extra free space we got in the memory buffer + // and increase the centralheader size so the new ZIP64 fields are included + // ( 4 below is the size of HeaderID and DataSize field ) + zi->ci.size_centralExtraFree -= datasize + 4; + zi->ci.size_centralheader += datasize + 4; + + // Update the extra info size field + zi->ci.size_centralExtra += datasize + 4; + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2); + } + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader); + + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + // Update the LocalFileHeader with the new values. + + ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff ) + { + if(zi->ci.pos_zip64extrainfo > 0) + { + // Update the size in the ZIP64 extended field. + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8); + } + else + err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal + } + else + { + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + } + + if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (zipFile file) +{ + return zipCloseFileInZipRaw (file,0,0); +} + +int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) +{ + int err = ZIP_OK; + ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4); + + /*num disks*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + /*relative offset*/ + if (err==ZIP_OK) /* Relative offset to the Zip64EndOfCentralDirectory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8); + + /*total disks*/ /* Do not support spawning of disk so always say 1 here*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4); + + return err; +} + +int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + uLong Zip64DataSize = 44; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ? + + if (err==ZIP_OK) /* version made by */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* version needed */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8); + } + return err; +} +int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + /*signature*/ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + { + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + } + + if (err==ZIP_OK) /* total number of entries in the central dir */ + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff) + { + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4); + } + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + } + + return err; +} + +int Write_GlobalComment(zip64_internal* zi, const char* global_comment) +{ + int err = ZIP_OK; + uInt size_global_comment = 0; + + if(global_comment != NULL) + size_global_comment = (uInt)strlen(global_comment); + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if (err == ZIP_OK && size_global_comment > 0) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + } + return err; +} + +extern int ZEXPORT zipClose (zipFile file, const char* global_comment) +{ + zip64_internal* zi; + int err = 0; + uLong size_centraldir = 0; + ZPOS64_T centraldir_pos_inzip; + ZPOS64_T pos; + + if (file == NULL) + return ZIP_PARAMERROR; + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + + centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block) + err = ZIP_ERRNO; + } + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_linkedlist(&(zi->central_dir)); + + pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff || zi->number_entry > 0xFFFF) + { + ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); + Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos); + } + + if (err==ZIP_OK) + err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + if(err == ZIP_OK) + err = Write_GlobalComment(zi, global_comment); + + if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} + +extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) +{ + char* p = pData; + int size = 0; + char* pNewHeader; + char* pTmp; + short header; + short dataSize; + + int retVal = ZIP_OK; + + if(pData == NULL || *dataLen < 4) + return ZIP_PARAMERROR; + + pNewHeader = (char*)ALLOC(*dataLen); + pTmp = pNewHeader; + + while(p < (pData + *dataLen)) + { + header = *(short*)p; + dataSize = *(((short*)p)+1); + + if( header == sHeader ) // Header found. + { + p += dataSize + 4; // skip it. do not copy to temp buffer + } + else + { + // Extra Info block should not be removed, So copy it to the temp buffer. + memcpy(pTmp, p, dataSize + 4); + p += dataSize + 4; + size += dataSize + 4; + } + + } + + if(size < *dataLen) + { + // clean old extra info block. + memset(pData,0, *dataLen); + + // copy the new extra info block over the old + if(size > 0) + memcpy(pData, pNewHeader, size); + + // set the new extra info size + *dataLen = size; + + retVal = ZIP_OK; + } + else + retVal = ZIP_ERRNO; + + TRYFREE(pNewHeader); + + return retVal; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.h b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.h new file mode 100644 index 0000000..8aaebb6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/minizip/zip.h @@ -0,0 +1,362 @@ +/* zip.h -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------- + + Changes + + See header of zip.h + +*/ + +#ifndef _zip12_H +#define _zip12_H + +#ifdef __cplusplus +extern "C" { +#endif + +//#define HAVE_BZIP2 + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); + +extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int zip64)); + +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) + zip64 is set to 1 if a zip64 extended information block should be added to the local file header. + this MUST be '1' if the uncompressed size is >= 0xffffffff. + +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + + +extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int zip64)); +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting)); + +extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + int zip64 + )); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCrypting : crc of file to compress (needed for crypting) + */ + +extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase + )); + + +extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase, + int zip64 + )); +/* + Same than zipOpenNewFileInZip4, except + versionMadeBy : value for Version made by field + flag : value for flag field (compression level info will be added) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); + +extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, + ZPOS64_T uncompressed_size, + uLong crc32)); + +/* + Close the current file in the zipfile, for file opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + + +extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); +/* + zipRemoveExtraInfoBlock - Added by Mathias Svensson + + Remove extra information block from a extra information data for the local file header or central directory header + + It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. + + 0x0001 is the signature header for the ZIP64 extra information blocks + + usage. + Remove ZIP64 Extra information from a central director extra field data + zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); + + Remove ZIP64 Extra information from a Local File Header extra field data + zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip64_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/pascal/example.pas b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/example.pas new file mode 100644 index 0000000..5518b36 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/example.pas @@ -0,0 +1,599 @@ +(* example.c -- usage example of the zlib compression library + * Copyright (C) 1995-2003 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Pascal translation + * Copyright (C) 1998 by Jacques Nomssi Nzali. + * For conditions of distribution and use, see copyright notice in readme.txt + * + * Adaptation to the zlibpas interface + * Copyright (C) 2003 by Cosmin Truta. + * For conditions of distribution and use, see copyright notice in readme.txt + *) + +program example; + +{$DEFINE TEST_COMPRESS} +{DO NOT $DEFINE TEST_GZIO} +{$DEFINE TEST_DEFLATE} +{$DEFINE TEST_INFLATE} +{$DEFINE TEST_FLUSH} +{$DEFINE TEST_SYNC} +{$DEFINE TEST_DICT} + +uses SysUtils, zlibpas; + +const TESTFILE = 'foo.gz'; + +(* "hello world" would be more standard, but the repeated "hello" + * stresses the compression code better, sorry... + *) +const hello: PChar = 'hello, hello!'; + +const dictionary: PChar = 'hello'; + +var dictId: LongInt; (* Adler32 value of the dictionary *) + +procedure CHECK_ERR(err: Integer; msg: String); +begin + if err <> Z_OK then + begin + WriteLn(msg, ' error: ', err); + Halt(1); + end; +end; + +procedure EXIT_ERR(const msg: String); +begin + WriteLn('Error: ', msg); + Halt(1); +end; + +(* =========================================================================== + * Test compress and uncompress + *) +{$IFDEF TEST_COMPRESS} +procedure test_compress(compr: Pointer; comprLen: LongInt; + uncompr: Pointer; uncomprLen: LongInt); +var err: Integer; + len: LongInt; +begin + len := StrLen(hello)+1; + + err := compress(compr, comprLen, hello, len); + CHECK_ERR(err, 'compress'); + + StrCopy(PChar(uncompr), 'garbage'); + + err := uncompress(uncompr, uncomprLen, compr, comprLen); + CHECK_ERR(err, 'uncompress'); + + if StrComp(PChar(uncompr), hello) <> 0 then + EXIT_ERR('bad uncompress') + else + WriteLn('uncompress(): ', PChar(uncompr)); +end; +{$ENDIF} + +(* =========================================================================== + * Test read/write of .gz files + *) +{$IFDEF TEST_GZIO} +procedure test_gzio(const fname: PChar; (* compressed file name *) + uncompr: Pointer; + uncomprLen: LongInt); +var err: Integer; + len: Integer; + zfile: gzFile; + pos: LongInt; +begin + len := StrLen(hello)+1; + + zfile := gzopen(fname, 'wb'); + if zfile = NIL then + begin + WriteLn('gzopen error'); + Halt(1); + end; + gzputc(zfile, 'h'); + if gzputs(zfile, 'ello') <> 4 then + begin + WriteLn('gzputs err: ', gzerror(zfile, err)); + Halt(1); + end; + {$IFDEF GZ_FORMAT_STRING} + if gzprintf(zfile, ', %s!', 'hello') <> 8 then + begin + WriteLn('gzprintf err: ', gzerror(zfile, err)); + Halt(1); + end; + {$ELSE} + if gzputs(zfile, ', hello!') <> 8 then + begin + WriteLn('gzputs err: ', gzerror(zfile, err)); + Halt(1); + end; + {$ENDIF} + gzseek(zfile, 1, SEEK_CUR); (* add one zero byte *) + gzclose(zfile); + + zfile := gzopen(fname, 'rb'); + if zfile = NIL then + begin + WriteLn('gzopen error'); + Halt(1); + end; + + StrCopy(PChar(uncompr), 'garbage'); + + if gzread(zfile, uncompr, uncomprLen) <> len then + begin + WriteLn('gzread err: ', gzerror(zfile, err)); + Halt(1); + end; + if StrComp(PChar(uncompr), hello) <> 0 then + begin + WriteLn('bad gzread: ', PChar(uncompr)); + Halt(1); + end + else + WriteLn('gzread(): ', PChar(uncompr)); + + pos := gzseek(zfile, -8, SEEK_CUR); + if (pos <> 6) or (gztell(zfile) <> pos) then + begin + WriteLn('gzseek error, pos=', pos, ', gztell=', gztell(zfile)); + Halt(1); + end; + + if gzgetc(zfile) <> ' ' then + begin + WriteLn('gzgetc error'); + Halt(1); + end; + + if gzungetc(' ', zfile) <> ' ' then + begin + WriteLn('gzungetc error'); + Halt(1); + end; + + gzgets(zfile, PChar(uncompr), uncomprLen); + uncomprLen := StrLen(PChar(uncompr)); + if uncomprLen <> 7 then (* " hello!" *) + begin + WriteLn('gzgets err after gzseek: ', gzerror(zfile, err)); + Halt(1); + end; + if StrComp(PChar(uncompr), hello + 6) <> 0 then + begin + WriteLn('bad gzgets after gzseek'); + Halt(1); + end + else + WriteLn('gzgets() after gzseek: ', PChar(uncompr)); + + gzclose(zfile); +end; +{$ENDIF} + +(* =========================================================================== + * Test deflate with small buffers + *) +{$IFDEF TEST_DEFLATE} +procedure test_deflate(compr: Pointer; comprLen: LongInt); +var c_stream: z_stream; (* compression stream *) + err: Integer; + len: LongInt; +begin + len := StrLen(hello)+1; + + c_stream.zalloc := NIL; + c_stream.zfree := NIL; + c_stream.opaque := NIL; + + err := deflateInit(c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, 'deflateInit'); + + c_stream.next_in := hello; + c_stream.next_out := compr; + + while (c_stream.total_in <> len) and + (c_stream.total_out < comprLen) do + begin + c_stream.avail_out := 1; { force small buffers } + c_stream.avail_in := 1; + err := deflate(c_stream, Z_NO_FLUSH); + CHECK_ERR(err, 'deflate'); + end; + + (* Finish the stream, still forcing small buffers: *) + while TRUE do + begin + c_stream.avail_out := 1; + err := deflate(c_stream, Z_FINISH); + if err = Z_STREAM_END then + break; + CHECK_ERR(err, 'deflate'); + end; + + err := deflateEnd(c_stream); + CHECK_ERR(err, 'deflateEnd'); +end; +{$ENDIF} + +(* =========================================================================== + * Test inflate with small buffers + *) +{$IFDEF TEST_INFLATE} +procedure test_inflate(compr: Pointer; comprLen : LongInt; + uncompr: Pointer; uncomprLen : LongInt); +var err: Integer; + d_stream: z_stream; (* decompression stream *) +begin + StrCopy(PChar(uncompr), 'garbage'); + + d_stream.zalloc := NIL; + d_stream.zfree := NIL; + d_stream.opaque := NIL; + + d_stream.next_in := compr; + d_stream.avail_in := 0; + d_stream.next_out := uncompr; + + err := inflateInit(d_stream); + CHECK_ERR(err, 'inflateInit'); + + while (d_stream.total_out < uncomprLen) and + (d_stream.total_in < comprLen) do + begin + d_stream.avail_out := 1; (* force small buffers *) + d_stream.avail_in := 1; + err := inflate(d_stream, Z_NO_FLUSH); + if err = Z_STREAM_END then + break; + CHECK_ERR(err, 'inflate'); + end; + + err := inflateEnd(d_stream); + CHECK_ERR(err, 'inflateEnd'); + + if StrComp(PChar(uncompr), hello) <> 0 then + EXIT_ERR('bad inflate') + else + WriteLn('inflate(): ', PChar(uncompr)); +end; +{$ENDIF} + +(* =========================================================================== + * Test deflate with large buffers and dynamic change of compression level + *) +{$IFDEF TEST_DEFLATE} +procedure test_large_deflate(compr: Pointer; comprLen: LongInt; + uncompr: Pointer; uncomprLen: LongInt); +var c_stream: z_stream; (* compression stream *) + err: Integer; +begin + c_stream.zalloc := NIL; + c_stream.zfree := NIL; + c_stream.opaque := NIL; + + err := deflateInit(c_stream, Z_BEST_SPEED); + CHECK_ERR(err, 'deflateInit'); + + c_stream.next_out := compr; + c_stream.avail_out := Integer(comprLen); + + (* At this point, uncompr is still mostly zeroes, so it should compress + * very well: + *) + c_stream.next_in := uncompr; + c_stream.avail_in := Integer(uncomprLen); + err := deflate(c_stream, Z_NO_FLUSH); + CHECK_ERR(err, 'deflate'); + if c_stream.avail_in <> 0 then + EXIT_ERR('deflate not greedy'); + + (* Feed in already compressed data and switch to no compression: *) + deflateParams(c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); + c_stream.next_in := compr; + c_stream.avail_in := Integer(comprLen div 2); + err := deflate(c_stream, Z_NO_FLUSH); + CHECK_ERR(err, 'deflate'); + + (* Switch back to compressing mode: *) + deflateParams(c_stream, Z_BEST_COMPRESSION, Z_FILTERED); + c_stream.next_in := uncompr; + c_stream.avail_in := Integer(uncomprLen); + err := deflate(c_stream, Z_NO_FLUSH); + CHECK_ERR(err, 'deflate'); + + err := deflate(c_stream, Z_FINISH); + if err <> Z_STREAM_END then + EXIT_ERR('deflate should report Z_STREAM_END'); + + err := deflateEnd(c_stream); + CHECK_ERR(err, 'deflateEnd'); +end; +{$ENDIF} + +(* =========================================================================== + * Test inflate with large buffers + *) +{$IFDEF TEST_INFLATE} +procedure test_large_inflate(compr: Pointer; comprLen: LongInt; + uncompr: Pointer; uncomprLen: LongInt); +var err: Integer; + d_stream: z_stream; (* decompression stream *) +begin + StrCopy(PChar(uncompr), 'garbage'); + + d_stream.zalloc := NIL; + d_stream.zfree := NIL; + d_stream.opaque := NIL; + + d_stream.next_in := compr; + d_stream.avail_in := Integer(comprLen); + + err := inflateInit(d_stream); + CHECK_ERR(err, 'inflateInit'); + + while TRUE do + begin + d_stream.next_out := uncompr; (* discard the output *) + d_stream.avail_out := Integer(uncomprLen); + err := inflate(d_stream, Z_NO_FLUSH); + if err = Z_STREAM_END then + break; + CHECK_ERR(err, 'large inflate'); + end; + + err := inflateEnd(d_stream); + CHECK_ERR(err, 'inflateEnd'); + + if d_stream.total_out <> 2 * uncomprLen + comprLen div 2 then + begin + WriteLn('bad large inflate: ', d_stream.total_out); + Halt(1); + end + else + WriteLn('large_inflate(): OK'); +end; +{$ENDIF} + +(* =========================================================================== + * Test deflate with full flush + *) +{$IFDEF TEST_FLUSH} +procedure test_flush(compr: Pointer; var comprLen : LongInt); +var c_stream: z_stream; (* compression stream *) + err: Integer; + len: Integer; +begin + len := StrLen(hello)+1; + + c_stream.zalloc := NIL; + c_stream.zfree := NIL; + c_stream.opaque := NIL; + + err := deflateInit(c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, 'deflateInit'); + + c_stream.next_in := hello; + c_stream.next_out := compr; + c_stream.avail_in := 3; + c_stream.avail_out := Integer(comprLen); + err := deflate(c_stream, Z_FULL_FLUSH); + CHECK_ERR(err, 'deflate'); + + Inc(PByteArray(compr)^[3]); (* force an error in first compressed block *) + c_stream.avail_in := len - 3; + + err := deflate(c_stream, Z_FINISH); + if err <> Z_STREAM_END then + CHECK_ERR(err, 'deflate'); + + err := deflateEnd(c_stream); + CHECK_ERR(err, 'deflateEnd'); + + comprLen := c_stream.total_out; +end; +{$ENDIF} + +(* =========================================================================== + * Test inflateSync() + *) +{$IFDEF TEST_SYNC} +procedure test_sync(compr: Pointer; comprLen: LongInt; + uncompr: Pointer; uncomprLen : LongInt); +var err: Integer; + d_stream: z_stream; (* decompression stream *) +begin + StrCopy(PChar(uncompr), 'garbage'); + + d_stream.zalloc := NIL; + d_stream.zfree := NIL; + d_stream.opaque := NIL; + + d_stream.next_in := compr; + d_stream.avail_in := 2; (* just read the zlib header *) + + err := inflateInit(d_stream); + CHECK_ERR(err, 'inflateInit'); + + d_stream.next_out := uncompr; + d_stream.avail_out := Integer(uncomprLen); + + inflate(d_stream, Z_NO_FLUSH); + CHECK_ERR(err, 'inflate'); + + d_stream.avail_in := Integer(comprLen-2); (* read all compressed data *) + err := inflateSync(d_stream); (* but skip the damaged part *) + CHECK_ERR(err, 'inflateSync'); + + err := inflate(d_stream, Z_FINISH); + if err <> Z_DATA_ERROR then + EXIT_ERR('inflate should report DATA_ERROR'); + (* Because of incorrect adler32 *) + + err := inflateEnd(d_stream); + CHECK_ERR(err, 'inflateEnd'); + + WriteLn('after inflateSync(): hel', PChar(uncompr)); +end; +{$ENDIF} + +(* =========================================================================== + * Test deflate with preset dictionary + *) +{$IFDEF TEST_DICT} +procedure test_dict_deflate(compr: Pointer; comprLen: LongInt); +var c_stream: z_stream; (* compression stream *) + err: Integer; +begin + c_stream.zalloc := NIL; + c_stream.zfree := NIL; + c_stream.opaque := NIL; + + err := deflateInit(c_stream, Z_BEST_COMPRESSION); + CHECK_ERR(err, 'deflateInit'); + + err := deflateSetDictionary(c_stream, dictionary, StrLen(dictionary)); + CHECK_ERR(err, 'deflateSetDictionary'); + + dictId := c_stream.adler; + c_stream.next_out := compr; + c_stream.avail_out := Integer(comprLen); + + c_stream.next_in := hello; + c_stream.avail_in := StrLen(hello)+1; + + err := deflate(c_stream, Z_FINISH); + if err <> Z_STREAM_END then + EXIT_ERR('deflate should report Z_STREAM_END'); + + err := deflateEnd(c_stream); + CHECK_ERR(err, 'deflateEnd'); +end; +{$ENDIF} + +(* =========================================================================== + * Test inflate with a preset dictionary + *) +{$IFDEF TEST_DICT} +procedure test_dict_inflate(compr: Pointer; comprLen: LongInt; + uncompr: Pointer; uncomprLen: LongInt); +var err: Integer; + d_stream: z_stream; (* decompression stream *) +begin + StrCopy(PChar(uncompr), 'garbage'); + + d_stream.zalloc := NIL; + d_stream.zfree := NIL; + d_stream.opaque := NIL; + + d_stream.next_in := compr; + d_stream.avail_in := Integer(comprLen); + + err := inflateInit(d_stream); + CHECK_ERR(err, 'inflateInit'); + + d_stream.next_out := uncompr; + d_stream.avail_out := Integer(uncomprLen); + + while TRUE do + begin + err := inflate(d_stream, Z_NO_FLUSH); + if err = Z_STREAM_END then + break; + if err = Z_NEED_DICT then + begin + if d_stream.adler <> dictId then + EXIT_ERR('unexpected dictionary'); + err := inflateSetDictionary(d_stream, dictionary, StrLen(dictionary)); + end; + CHECK_ERR(err, 'inflate with dict'); + end; + + err := inflateEnd(d_stream); + CHECK_ERR(err, 'inflateEnd'); + + if StrComp(PChar(uncompr), hello) <> 0 then + EXIT_ERR('bad inflate with dict') + else + WriteLn('inflate with dictionary: ', PChar(uncompr)); +end; +{$ENDIF} + +var compr, uncompr: Pointer; + comprLen, uncomprLen: LongInt; + +begin + if zlibVersion^ <> ZLIB_VERSION[1] then + EXIT_ERR('Incompatible zlib version'); + + WriteLn('zlib version: ', zlibVersion); + WriteLn('zlib compile flags: ', Format('0x%x', [zlibCompileFlags])); + + comprLen := 10000 * SizeOf(Integer); (* don't overflow on MSDOS *) + uncomprLen := comprLen; + GetMem(compr, comprLen); + GetMem(uncompr, uncomprLen); + if (compr = NIL) or (uncompr = NIL) then + EXIT_ERR('Out of memory'); + (* compr and uncompr are cleared to avoid reading uninitialized + * data and to ensure that uncompr compresses well. + *) + FillChar(compr^, comprLen, 0); + FillChar(uncompr^, uncomprLen, 0); + + {$IFDEF TEST_COMPRESS} + WriteLn('** Testing compress'); + test_compress(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + + {$IFDEF TEST_GZIO} + WriteLn('** Testing gzio'); + if ParamCount >= 1 then + test_gzio(ParamStr(1), uncompr, uncomprLen) + else + test_gzio(TESTFILE, uncompr, uncomprLen); + {$ENDIF} + + {$IFDEF TEST_DEFLATE} + WriteLn('** Testing deflate with small buffers'); + test_deflate(compr, comprLen); + {$ENDIF} + {$IFDEF TEST_INFLATE} + WriteLn('** Testing inflate with small buffers'); + test_inflate(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + + {$IFDEF TEST_DEFLATE} + WriteLn('** Testing deflate with large buffers'); + test_large_deflate(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + {$IFDEF TEST_INFLATE} + WriteLn('** Testing inflate with large buffers'); + test_large_inflate(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + + {$IFDEF TEST_FLUSH} + WriteLn('** Testing deflate with full flush'); + test_flush(compr, comprLen); + {$ENDIF} + {$IFDEF TEST_SYNC} + WriteLn('** Testing inflateSync'); + test_sync(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + comprLen := uncomprLen; + + {$IFDEF TEST_DICT} + WriteLn('** Testing deflate and inflate with preset dictionary'); + test_dict_deflate(compr, comprLen); + test_dict_inflate(compr, comprLen, uncompr, uncomprLen); + {$ENDIF} + + FreeMem(compr, comprLen); + FreeMem(uncompr, uncomprLen); +end. diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/pascal/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/readme.txt new file mode 100644 index 0000000..60e87c8 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/readme.txt @@ -0,0 +1,76 @@ + +This directory contains a Pascal (Delphi, Kylix) interface to the +zlib data compression library. + + +Directory listing +================= + +zlibd32.mak makefile for Borland C++ +example.pas usage example of zlib +zlibpas.pas the Pascal interface to zlib +readme.txt this file + + +Compatibility notes +=================== + +- Although the name "zlib" would have been more normal for the + zlibpas unit, this name is already taken by Borland's ZLib unit. + This is somehow unfortunate, because that unit is not a genuine + interface to the full-fledged zlib functionality, but a suite of + class wrappers around zlib streams. Other essential features, + such as checksums, are missing. + It would have been more appropriate for that unit to have a name + like "ZStreams", or something similar. + +- The C and zlib-supplied types int, uInt, long, uLong, etc. are + translated directly into Pascal types of similar sizes (Integer, + LongInt, etc.), to avoid namespace pollution. In particular, + there is no conversion of unsigned int into a Pascal unsigned + integer. The Word type is non-portable and has the same size + (16 bits) both in a 16-bit and in a 32-bit environment, unlike + Integer. Even if there is a 32-bit Cardinal type, there is no + real need for unsigned int in zlib under a 32-bit environment. + +- Except for the callbacks, the zlib function interfaces are + assuming the calling convention normally used in Pascal + (__pascal for DOS and Windows16, __fastcall for Windows32). + Since the cdecl keyword is used, the old Turbo Pascal does + not work with this interface. + +- The gz* function interfaces are not translated, to avoid + interfacing problems with the C runtime library. Besides, + gzprintf(gzFile file, const char *format, ...) + cannot be translated into Pascal. + + +Legal issues +============ + +The zlibpas interface is: + Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler. + Copyright (C) 1998 by Bob Dellaca. + Copyright (C) 2003 by Cosmin Truta. + +The example program is: + Copyright (C) 1995-2003 by Jean-loup Gailly. + Copyright (C) 1998,1999,2000 by Jacques Nomssi Nzali. + Copyright (C) 2003 by Cosmin Truta. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibd32.mak b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibd32.mak new file mode 100644 index 0000000..9bb00b7 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibd32.mak @@ -0,0 +1,99 @@ +# Makefile for zlib +# For use with Delphi and C++ Builder under Win32 +# Updated for zlib 1.2.x by Cosmin Truta + +# ------------ Borland C++ ------------ + +# This project uses the Delphi (fastcall/register) calling convention: +LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl + +CC = bcc32 +LD = bcc32 +AR = tlib +# do not use "-pr" in CFLAGS +CFLAGS = -a -d -k- -O2 $(LOC) +LDFLAGS = + + +# variables +ZLIB_LIB = zlib.lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj +OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj +OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(CFLAGS) $*.c + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + + +# For the sake of the old Borland make, +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + $(AR) $(ZLIB_LIB) $(OBJP2) + + +# testing +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) + + +# cleanup +clean: + -del *.obj + -del *.exe + -del *.lib + -del *.tds + -del zlib.bak + -del foo.gz + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibpas.pas b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibpas.pas new file mode 100644 index 0000000..7abd862 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/pascal/zlibpas.pas @@ -0,0 +1,276 @@ +(* zlibpas -- Pascal interface to the zlib data compression library + * + * Copyright (C) 2003 Cosmin Truta. + * Derived from original sources by Bob Dellaca. + * For conditions of distribution and use, see copyright notice in readme.txt + *) + +unit zlibpas; + +interface + +const + ZLIB_VERSION = '1.2.7'; + ZLIB_VERNUM = $1270; + +type + alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; + cdecl; + free_func = procedure(opaque, address: Pointer); + cdecl; + + in_func = function(opaque: Pointer; var buf: PByte): Integer; + cdecl; + out_func = function(opaque: Pointer; buf: PByte; size: Integer): Integer; + cdecl; + + z_streamp = ^z_stream; + z_stream = packed record + next_in: PChar; (* next input byte *) + avail_in: Integer; (* number of bytes available at next_in *) + total_in: LongInt; (* total nb of input bytes read so far *) + + next_out: PChar; (* next output byte should be put there *) + avail_out: Integer; (* remaining free space at next_out *) + total_out: LongInt; (* total nb of bytes output so far *) + + msg: PChar; (* last error message, NULL if no error *) + state: Pointer; (* not visible by applications *) + + zalloc: alloc_func; (* used to allocate the internal state *) + zfree: free_func; (* used to free the internal state *) + opaque: Pointer; (* private data object passed to zalloc and zfree *) + + data_type: Integer; (* best guess about the data type: ascii or binary *) + adler: LongInt; (* adler32 value of the uncompressed data *) + reserved: LongInt; (* reserved for future use *) + end; + + gz_headerp = ^gz_header; + gz_header = packed record + text: Integer; (* true if compressed data believed to be text *) + time: LongInt; (* modification time *) + xflags: Integer; (* extra flags (not used when writing a gzip file) *) + os: Integer; (* operating system *) + extra: PChar; (* pointer to extra field or Z_NULL if none *) + extra_len: Integer; (* extra field length (valid if extra != Z_NULL) *) + extra_max: Integer; (* space at extra (only when reading header) *) + name: PChar; (* pointer to zero-terminated file name or Z_NULL *) + name_max: Integer; (* space at name (only when reading header) *) + comment: PChar; (* pointer to zero-terminated comment or Z_NULL *) + comm_max: Integer; (* space at comment (only when reading header) *) + hcrc: Integer; (* true if there was or will be a header crc *) + done: Integer; (* true when done reading gzip header *) + end; + +(* constants *) +const + Z_NO_FLUSH = 0; + Z_PARTIAL_FLUSH = 1; + Z_SYNC_FLUSH = 2; + Z_FULL_FLUSH = 3; + Z_FINISH = 4; + Z_BLOCK = 5; + Z_TREES = 6; + + Z_OK = 0; + Z_STREAM_END = 1; + Z_NEED_DICT = 2; + Z_ERRNO = -1; + Z_STREAM_ERROR = -2; + Z_DATA_ERROR = -3; + Z_MEM_ERROR = -4; + Z_BUF_ERROR = -5; + Z_VERSION_ERROR = -6; + + Z_NO_COMPRESSION = 0; + Z_BEST_SPEED = 1; + Z_BEST_COMPRESSION = 9; + Z_DEFAULT_COMPRESSION = -1; + + Z_FILTERED = 1; + Z_HUFFMAN_ONLY = 2; + Z_RLE = 3; + Z_FIXED = 4; + Z_DEFAULT_STRATEGY = 0; + + Z_BINARY = 0; + Z_TEXT = 1; + Z_ASCII = 1; + Z_UNKNOWN = 2; + + Z_DEFLATED = 8; + +(* basic functions *) +function zlibVersion: PChar; +function deflateInit(var strm: z_stream; level: Integer): Integer; +function deflate(var strm: z_stream; flush: Integer): Integer; +function deflateEnd(var strm: z_stream): Integer; +function inflateInit(var strm: z_stream): Integer; +function inflate(var strm: z_stream; flush: Integer): Integer; +function inflateEnd(var strm: z_stream): Integer; + +(* advanced functions *) +function deflateInit2(var strm: z_stream; level, method, windowBits, + memLevel, strategy: Integer): Integer; +function deflateSetDictionary(var strm: z_stream; const dictionary: PChar; + dictLength: Integer): Integer; +function deflateCopy(var dest, source: z_stream): Integer; +function deflateReset(var strm: z_stream): Integer; +function deflateParams(var strm: z_stream; level, strategy: Integer): Integer; +function deflateTune(var strm: z_stream; good_length, max_lazy, nice_length, max_chain: Integer): Integer; +function deflateBound(var strm: z_stream; sourceLen: LongInt): LongInt; +function deflatePending(var strm: z_stream; var pending: Integer; var bits: Integer): Integer; +function deflatePrime(var strm: z_stream; bits, value: Integer): Integer; +function deflateSetHeader(var strm: z_stream; head: gz_header): Integer; +function inflateInit2(var strm: z_stream; windowBits: Integer): Integer; +function inflateSetDictionary(var strm: z_stream; const dictionary: PChar; + dictLength: Integer): Integer; +function inflateSync(var strm: z_stream): Integer; +function inflateCopy(var dest, source: z_stream): Integer; +function inflateReset(var strm: z_stream): Integer; +function inflateReset2(var strm: z_stream; windowBits: Integer): Integer; +function inflatePrime(var strm: z_stream; bits, value: Integer): Integer; +function inflateMark(var strm: z_stream): LongInt; +function inflateGetHeader(var strm: z_stream; var head: gz_header): Integer; +function inflateBackInit(var strm: z_stream; + windowBits: Integer; window: PChar): Integer; +function inflateBack(var strm: z_stream; in_fn: in_func; in_desc: Pointer; + out_fn: out_func; out_desc: Pointer): Integer; +function inflateBackEnd(var strm: z_stream): Integer; +function zlibCompileFlags: LongInt; + +(* utility functions *) +function compress(dest: PChar; var destLen: LongInt; + const source: PChar; sourceLen: LongInt): Integer; +function compress2(dest: PChar; var destLen: LongInt; + const source: PChar; sourceLen: LongInt; + level: Integer): Integer; +function compressBound(sourceLen: LongInt): LongInt; +function uncompress(dest: PChar; var destLen: LongInt; + const source: PChar; sourceLen: LongInt): Integer; + +(* checksum functions *) +function adler32(adler: LongInt; const buf: PChar; len: Integer): LongInt; +function adler32_combine(adler1, adler2, len2: LongInt): LongInt; +function crc32(crc: LongInt; const buf: PChar; len: Integer): LongInt; +function crc32_combine(crc1, crc2, len2: LongInt): LongInt; + +(* various hacks, don't look :) *) +function deflateInit_(var strm: z_stream; level: Integer; + const version: PChar; stream_size: Integer): Integer; +function inflateInit_(var strm: z_stream; const version: PChar; + stream_size: Integer): Integer; +function deflateInit2_(var strm: z_stream; + level, method, windowBits, memLevel, strategy: Integer; + const version: PChar; stream_size: Integer): Integer; +function inflateInit2_(var strm: z_stream; windowBits: Integer; + const version: PChar; stream_size: Integer): Integer; +function inflateBackInit_(var strm: z_stream; + windowBits: Integer; window: PChar; + const version: PChar; stream_size: Integer): Integer; + + +implementation + +{$L adler32.obj} +{$L compress.obj} +{$L crc32.obj} +{$L deflate.obj} +{$L infback.obj} +{$L inffast.obj} +{$L inflate.obj} +{$L inftrees.obj} +{$L trees.obj} +{$L uncompr.obj} +{$L zutil.obj} + +function adler32; external; +function adler32_combine; external; +function compress; external; +function compress2; external; +function compressBound; external; +function crc32; external; +function crc32_combine; external; +function deflate; external; +function deflateBound; external; +function deflateCopy; external; +function deflateEnd; external; +function deflateInit_; external; +function deflateInit2_; external; +function deflateParams; external; +function deflatePending; external; +function deflatePrime; external; +function deflateReset; external; +function deflateSetDictionary; external; +function deflateSetHeader; external; +function deflateTune; external; +function inflate; external; +function inflateBack; external; +function inflateBackEnd; external; +function inflateBackInit_; external; +function inflateCopy; external; +function inflateEnd; external; +function inflateGetHeader; external; +function inflateInit_; external; +function inflateInit2_; external; +function inflateMark; external; +function inflatePrime; external; +function inflateReset; external; +function inflateReset2; external; +function inflateSetDictionary; external; +function inflateSync; external; +function uncompress; external; +function zlibCompileFlags; external; +function zlibVersion; external; + +function deflateInit(var strm: z_stream; level: Integer): Integer; +begin + Result := deflateInit_(strm, level, ZLIB_VERSION, sizeof(z_stream)); +end; + +function deflateInit2(var strm: z_stream; level, method, windowBits, memLevel, + strategy: Integer): Integer; +begin + Result := deflateInit2_(strm, level, method, windowBits, memLevel, strategy, + ZLIB_VERSION, sizeof(z_stream)); +end; + +function inflateInit(var strm: z_stream): Integer; +begin + Result := inflateInit_(strm, ZLIB_VERSION, sizeof(z_stream)); +end; + +function inflateInit2(var strm: z_stream; windowBits: Integer): Integer; +begin + Result := inflateInit2_(strm, windowBits, ZLIB_VERSION, sizeof(z_stream)); +end; + +function inflateBackInit(var strm: z_stream; + windowBits: Integer; window: PChar): Integer; +begin + Result := inflateBackInit_(strm, windowBits, window, + ZLIB_VERSION, sizeof(z_stream)); +end; + +function _malloc(Size: Integer): Pointer; cdecl; +begin + GetMem(Result, Size); +end; + +procedure _free(Block: Pointer); cdecl; +begin + FreeMem(Block); +end; + +procedure _memset(P: Pointer; B: Byte; count: Integer); cdecl; +begin + FillChar(P^, count, B); +end; + +procedure _memcpy(dest, source: Pointer; count: Integer); cdecl; +begin + Move(source^, dest^, count); +end; + +end. diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/Makefile b/thirdparty/zlib/zlib-1.2.7/contrib/puff/Makefile new file mode 100644 index 0000000..0e2594c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/puff/Makefile @@ -0,0 +1,42 @@ +CFLAGS=-O + +puff: puff.o pufftest.o + +puff.o: puff.h + +pufftest.o: puff.h + +test: puff + puff zeros.raw + +puft: puff.c puff.h pufftest.o + cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o + +# puff full coverage test (should say 100%) +cov: puft + @rm -f *.gcov *.gcda + @puft -w zeros.raw 2>&1 | cat > /dev/null + @echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254 + @echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null + @echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2 + @echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249 + @echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null + @echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246 + @echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245 + @puft -f zeros.raw 2>&1 | cat > /dev/null + @echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253 + @echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252 + @echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251 + @echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248 + @echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250 + @echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247 + @gcov -n puff.c + +clean: + rm -f puff puft *.o *.gc* diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/README b/thirdparty/zlib/zlib-1.2.7/contrib/puff/README new file mode 100644 index 0000000..bbc4cb5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/puff/README @@ -0,0 +1,63 @@ +Puff -- A Simple Inflate +3 Mar 2003 +Mark Adler +madler@alumni.caltech.edu + +What this is -- + +puff.c provides the routine puff() to decompress the deflate data format. It +does so more slowly than zlib, but the code is about one-fifth the size of the +inflate code in zlib, and written to be very easy to read. + +Why I wrote this -- + +puff.c was written to document the deflate format unambiguously, by virtue of +being working C code. It is meant to supplement RFC 1951, which formally +describes the deflate format. I have received many questions on details of the +deflate format, and I hope that reading this code will answer those questions. +puff.c is heavily commented with details of the deflate format, especially +those little nooks and cranies of the format that might not be obvious from a +specification. + +puff.c may also be useful in applications where code size or memory usage is a +very limited resource, and speed is not as important. + +How to use it -- + +Well, most likely you should just be reading puff.c and using zlib for actual +applications, but if you must ... + +Include puff.h in your code, which provides this prototype: + +int puff(unsigned char *dest, /* pointer to destination pointer */ + unsigned long *destlen, /* amount of output space */ + unsigned char *source, /* pointer to source data pointer */ + unsigned long *sourcelen); /* amount of input available */ + +Then you can call puff() to decompress a deflate stream that is in memory in +its entirety at source, to a sufficiently sized block of memory for the +decompressed data at dest. puff() is the only external symbol in puff.c The +only C library functions that puff.c needs are setjmp() and longjmp(), which +are used to simplify error checking in the code to improve readabilty. puff.c +does no memory allocation, and uses less than 2K bytes off of the stack. + +If destlen is not enough space for the uncompressed data, then inflate will +return an error without writing more than destlen bytes. Note that this means +that in order to decompress the deflate data successfully, you need to know +the size of the uncompressed data ahead of time. + +If needed, puff() can determine the size of the uncompressed data with no +output space. This is done by passing dest equal to (unsigned char *)0. Then +the initial value of *destlen is ignored and *destlen is set to the length of +the uncompressed data. So if the size of the uncompressed data is not known, +then two passes of puff() can be used--first to determine the size, and second +to do the actual inflation after allocating the appropriate memory. Not +pretty, but it works. (This is one of the reasons you should be using zlib.) + +The deflate format is self-terminating. If the deflate stream does not end +in *sourcelen bytes, puff() will return an error without reading at or past +endsource. + +On return, *sourcelen is updated to the amount of input data consumed, and +*destlen is updated to the size of the uncompressed data. See the comments +in puff.c for the possible return codes for puff(). diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.c b/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.c new file mode 100644 index 0000000..df8470c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.c @@ -0,0 +1,837 @@ +/* + * puff.c + * Copyright (C) 2002-2010 Mark Adler + * For conditions of distribution and use, see copyright notice in puff.h + * version 2.2, 25 Apr 2010 + * + * puff.c is a simple inflate written to be an unambiguous way to specify the + * deflate format. It is not written for speed but rather simplicity. As a + * side benefit, this code might actually be useful when small code is more + * important than speed, such as bootstrap applications. For typical deflate + * data, zlib's inflate() is about four times as fast as puff(). zlib's + * inflate compiles to around 20K on my machine, whereas puff.c compiles to + * around 4K on my machine (a PowerPC using GNU cc). If the faster decode() + * function here is used, then puff() is only twice as slow as zlib's + * inflate(). + * + * All dynamically allocated memory comes from the stack. The stack required + * is less than 2K bytes. This code is compatible with 16-bit int's and + * assumes that long's are at least 32 bits. puff.c uses the short data type, + * assumed to be 16 bits, for arrays in order to to conserve memory. The code + * works whether integers are stored big endian or little endian. + * + * In the comments below are "Format notes" that describe the inflate process + * and document some of the less obvious aspects of the format. This source + * code is meant to supplement RFC 1951, which formally describes the deflate + * format: + * + * http://www.zlib.org/rfc-deflate.html + */ + +/* + * Change history: + * + * 1.0 10 Feb 2002 - First version + * 1.1 17 Feb 2002 - Clarifications of some comments and notes + * - Update puff() dest and source pointers on negative + * errors to facilitate debugging deflators + * - Remove longest from struct huffman -- not needed + * - Simplify offs[] index in construct() + * - Add input size and checking, using longjmp() to + * maintain easy readability + * - Use short data type for large arrays + * - Use pointers instead of long to specify source and + * destination sizes to avoid arbitrary 4 GB limits + * 1.2 17 Mar 2002 - Add faster version of decode(), doubles speed (!), + * but leave simple version for readabilty + * - Make sure invalid distances detected if pointers + * are 16 bits + * - Fix fixed codes table error + * - Provide a scanning mode for determining size of + * uncompressed data + * 1.3 20 Mar 2002 - Go back to lengths for puff() parameters [Gailly] + * - Add a puff.h file for the interface + * - Add braces in puff() for else do [Gailly] + * - Use indexes instead of pointers for readability + * 1.4 31 Mar 2002 - Simplify construct() code set check + * - Fix some comments + * - Add FIXLCODES #define + * 1.5 6 Apr 2002 - Minor comment fixes + * 1.6 7 Aug 2002 - Minor format changes + * 1.7 3 Mar 2003 - Added test code for distribution + * - Added zlib-like license + * 1.8 9 Jan 2004 - Added some comments on no distance codes case + * 1.9 21 Feb 2008 - Fix bug on 16-bit integer architectures [Pohland] + * - Catch missing end-of-block symbol error + * 2.0 25 Jul 2008 - Add #define to permit distance too far back + * - Add option in TEST code for puff to write the data + * - Add option in TEST code to skip input bytes + * - Allow TEST code to read from piped stdin + * 2.1 4 Apr 2010 - Avoid variable initialization for happier compilers + * - Avoid unsigned comparisons for even happier compilers + * 2.2 25 Apr 2010 - Fix bug in variable initializations [Oberhumer] + * - Add const where appropriate [Oberhumer] + * - Split if's and ?'s for coverage testing + * - Break out test code to separate file + * - Move NIL to puff.h + * - Allow incomplete code only if single code length is 1 + * - Add full code coverage test to Makefile + */ + +#include /* for setjmp(), longjmp(), and jmp_buf */ +#include "puff.h" /* prototype for puff() */ + +#define local static /* for local function definitions */ + +/* + * Maximums for allocations and loops. It is not useful to change these -- + * they are fixed by the deflate format. + */ +#define MAXBITS 15 /* maximum bits in a code */ +#define MAXLCODES 286 /* maximum number of literal/length codes */ +#define MAXDCODES 30 /* maximum number of distance codes */ +#define MAXCODES (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */ +#define FIXLCODES 288 /* number of fixed literal/length codes */ + +/* input and output state */ +struct state { + /* output state */ + unsigned char *out; /* output buffer */ + unsigned long outlen; /* available space at out */ + unsigned long outcnt; /* bytes written to out so far */ + + /* input state */ + const unsigned char *in; /* input buffer */ + unsigned long inlen; /* available input at in */ + unsigned long incnt; /* bytes read so far */ + int bitbuf; /* bit buffer */ + int bitcnt; /* number of bits in bit buffer */ + + /* input limit error return state for bits() and decode() */ + jmp_buf env; +}; + +/* + * Return need bits from the input stream. This always leaves less than + * eight bits in the buffer. bits() works properly for need == 0. + * + * Format notes: + * + * - Bits are stored in bytes from the least significant bit to the most + * significant bit. Therefore bits are dropped from the bottom of the bit + * buffer, using shift right, and new bytes are appended to the top of the + * bit buffer, using shift left. + */ +local int bits(struct state *s, int need) +{ + long val; /* bit accumulator (can use up to 20 bits) */ + + /* load at least need bits into val */ + val = s->bitbuf; + while (s->bitcnt < need) { + if (s->incnt == s->inlen) + longjmp(s->env, 1); /* out of input */ + val |= (long)(s->in[s->incnt++]) << s->bitcnt; /* load eight bits */ + s->bitcnt += 8; + } + + /* drop need bits and update buffer, always zero to seven bits left */ + s->bitbuf = (int)(val >> need); + s->bitcnt -= need; + + /* return need bits, zeroing the bits above that */ + return (int)(val & ((1L << need) - 1)); +} + +/* + * Process a stored block. + * + * Format notes: + * + * - After the two-bit stored block type (00), the stored block length and + * stored bytes are byte-aligned for fast copying. Therefore any leftover + * bits in the byte that has the last bit of the type, as many as seven, are + * discarded. The value of the discarded bits are not defined and should not + * be checked against any expectation. + * + * - The second inverted copy of the stored block length does not have to be + * checked, but it's probably a good idea to do so anyway. + * + * - A stored block can have zero length. This is sometimes used to byte-align + * subsets of the compressed data for random access or partial recovery. + */ +local int stored(struct state *s) +{ + unsigned len; /* length of stored block */ + + /* discard leftover bits from current byte (assumes s->bitcnt < 8) */ + s->bitbuf = 0; + s->bitcnt = 0; + + /* get length and check against its one's complement */ + if (s->incnt + 4 > s->inlen) + return 2; /* not enough input */ + len = s->in[s->incnt++]; + len |= s->in[s->incnt++] << 8; + if (s->in[s->incnt++] != (~len & 0xff) || + s->in[s->incnt++] != ((~len >> 8) & 0xff)) + return -2; /* didn't match complement! */ + + /* copy len bytes from in to out */ + if (s->incnt + len > s->inlen) + return 2; /* not enough input */ + if (s->out != NIL) { + if (s->outcnt + len > s->outlen) + return 1; /* not enough output space */ + while (len--) + s->out[s->outcnt++] = s->in[s->incnt++]; + } + else { /* just scanning */ + s->outcnt += len; + s->incnt += len; + } + + /* done with a valid stored block */ + return 0; +} + +/* + * Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of + * each length, which for a canonical code are stepped through in order. + * symbol[] are the symbol values in canonical order, where the number of + * entries is the sum of the counts in count[]. The decoding process can be + * seen in the function decode() below. + */ +struct huffman { + short *count; /* number of symbols of each length */ + short *symbol; /* canonically ordered symbols */ +}; + +/* + * Decode a code from the stream s using huffman table h. Return the symbol or + * a negative value if there is an error. If all of the lengths are zero, i.e. + * an empty code, or if the code is incomplete and an invalid code is received, + * then -10 is returned after reading MAXBITS bits. + * + * Format notes: + * + * - The codes as stored in the compressed data are bit-reversed relative to + * a simple integer ordering of codes of the same lengths. Hence below the + * bits are pulled from the compressed data one at a time and used to + * build the code value reversed from what is in the stream in order to + * permit simple integer comparisons for decoding. A table-based decoding + * scheme (as used in zlib) does not need to do this reversal. + * + * - The first code for the shortest length is all zeros. Subsequent codes of + * the same length are simply integer increments of the previous code. When + * moving up a length, a zero bit is appended to the code. For a complete + * code, the last code of the longest length will be all ones. + * + * - Incomplete codes are handled by this decoder, since they are permitted + * in the deflate format. See the format notes for fixed() and dynamic(). + */ +#ifdef SLOW +local int decode(struct state *s, const struct huffman *h) +{ + int len; /* current number of bits in code */ + int code; /* len bits being decoded */ + int first; /* first code of length len */ + int count; /* number of codes of length len */ + int index; /* index of first code of length len in symbol table */ + + code = first = index = 0; + for (len = 1; len <= MAXBITS; len++) { + code |= bits(s, 1); /* get next bit */ + count = h->count[len]; + if (code - count < first) /* if length len, return symbol */ + return h->symbol[index + (code - first)]; + index += count; /* else update for next length */ + first += count; + first <<= 1; + code <<= 1; + } + return -10; /* ran out of codes */ +} + +/* + * A faster version of decode() for real applications of this code. It's not + * as readable, but it makes puff() twice as fast. And it only makes the code + * a few percent larger. + */ +#else /* !SLOW */ +local int decode(struct state *s, const struct huffman *h) +{ + int len; /* current number of bits in code */ + int code; /* len bits being decoded */ + int first; /* first code of length len */ + int count; /* number of codes of length len */ + int index; /* index of first code of length len in symbol table */ + int bitbuf; /* bits from stream */ + int left; /* bits left in next or left to process */ + short *next; /* next number of codes */ + + bitbuf = s->bitbuf; + left = s->bitcnt; + code = first = index = 0; + len = 1; + next = h->count + 1; + while (1) { + while (left--) { + code |= bitbuf & 1; + bitbuf >>= 1; + count = *next++; + if (code - count < first) { /* if length len, return symbol */ + s->bitbuf = bitbuf; + s->bitcnt = (s->bitcnt - len) & 7; + return h->symbol[index + (code - first)]; + } + index += count; /* else update for next length */ + first += count; + first <<= 1; + code <<= 1; + len++; + } + left = (MAXBITS+1) - len; + if (left == 0) + break; + if (s->incnt == s->inlen) + longjmp(s->env, 1); /* out of input */ + bitbuf = s->in[s->incnt++]; + if (left > 8) + left = 8; + } + return -10; /* ran out of codes */ +} +#endif /* SLOW */ + +/* + * Given the list of code lengths length[0..n-1] representing a canonical + * Huffman code for n symbols, construct the tables required to decode those + * codes. Those tables are the number of codes of each length, and the symbols + * sorted by length, retaining their original order within each length. The + * return value is zero for a complete code set, negative for an over- + * subscribed code set, and positive for an incomplete code set. The tables + * can be used if the return value is zero or positive, but they cannot be used + * if the return value is negative. If the return value is zero, it is not + * possible for decode() using that table to return an error--any stream of + * enough bits will resolve to a symbol. If the return value is positive, then + * it is possible for decode() using that table to return an error for received + * codes past the end of the incomplete lengths. + * + * Not used by decode(), but used for error checking, h->count[0] is the number + * of the n symbols not in the code. So n - h->count[0] is the number of + * codes. This is useful for checking for incomplete codes that have more than + * one symbol, which is an error in a dynamic block. + * + * Assumption: for all i in 0..n-1, 0 <= length[i] <= MAXBITS + * This is assured by the construction of the length arrays in dynamic() and + * fixed() and is not verified by construct(). + * + * Format notes: + * + * - Permitted and expected examples of incomplete codes are one of the fixed + * codes and any code with a single symbol which in deflate is coded as one + * bit instead of zero bits. See the format notes for fixed() and dynamic(). + * + * - Within a given code length, the symbols are kept in ascending order for + * the code bits definition. + */ +local int construct(struct huffman *h, const short *length, int n) +{ + int symbol; /* current symbol when stepping through length[] */ + int len; /* current length when stepping through h->count[] */ + int left; /* number of possible codes left of current length */ + short offs[MAXBITS+1]; /* offsets in symbol table for each length */ + + /* count number of codes of each length */ + for (len = 0; len <= MAXBITS; len++) + h->count[len] = 0; + for (symbol = 0; symbol < n; symbol++) + (h->count[length[symbol]])++; /* assumes lengths are within bounds */ + if (h->count[0] == n) /* no codes! */ + return 0; /* complete, but decode() will fail */ + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; /* one possible code of zero length */ + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; /* one more bit, double codes left */ + left -= h->count[len]; /* deduct count from possible codes */ + if (left < 0) + return left; /* over-subscribed--return negative */ + } /* left > 0 means incomplete */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + h->count[len]; + + /* + * put symbols in table sorted by length, by symbol order within each + * length + */ + for (symbol = 0; symbol < n; symbol++) + if (length[symbol] != 0) + h->symbol[offs[length[symbol]]++] = symbol; + + /* return zero for complete set, positive for incomplete set */ + return left; +} + +/* + * Decode literal/length and distance codes until an end-of-block code. + * + * Format notes: + * + * - Compressed data that is after the block type if fixed or after the code + * description if dynamic is a combination of literals and length/distance + * pairs terminated by and end-of-block code. Literals are simply Huffman + * coded bytes. A length/distance pair is a coded length followed by a + * coded distance to represent a string that occurs earlier in the + * uncompressed data that occurs again at the current location. + * + * - Literals, lengths, and the end-of-block code are combined into a single + * code of up to 286 symbols. They are 256 literals (0..255), 29 length + * symbols (257..285), and the end-of-block symbol (256). + * + * - There are 256 possible lengths (3..258), and so 29 symbols are not enough + * to represent all of those. Lengths 3..10 and 258 are in fact represented + * by just a length symbol. Lengths 11..257 are represented as a symbol and + * some number of extra bits that are added as an integer to the base length + * of the length symbol. The number of extra bits is determined by the base + * length symbol. These are in the static arrays below, lens[] for the base + * lengths and lext[] for the corresponding number of extra bits. + * + * - The reason that 258 gets its own symbol is that the longest length is used + * often in highly redundant files. Note that 258 can also be coded as the + * base value 227 plus the maximum extra value of 31. While a good deflate + * should never do this, it is not an error, and should be decoded properly. + * + * - If a length is decoded, including its extra bits if any, then it is + * followed a distance code. There are up to 30 distance symbols. Again + * there are many more possible distances (1..32768), so extra bits are added + * to a base value represented by the symbol. The distances 1..4 get their + * own symbol, but the rest require extra bits. The base distances and + * corresponding number of extra bits are below in the static arrays dist[] + * and dext[]. + * + * - Literal bytes are simply written to the output. A length/distance pair is + * an instruction to copy previously uncompressed bytes to the output. The + * copy is from distance bytes back in the output stream, copying for length + * bytes. + * + * - Distances pointing before the beginning of the output data are not + * permitted. + * + * - Overlapped copies, where the length is greater than the distance, are + * allowed and common. For example, a distance of one and a length of 258 + * simply copies the last byte 258 times. A distance of four and a length of + * twelve copies the last four bytes three times. A simple forward copy + * ignoring whether the length is greater than the distance or not implements + * this correctly. You should not use memcpy() since its behavior is not + * defined for overlapped arrays. You should not use memmove() or bcopy() + * since though their behavior -is- defined for overlapping arrays, it is + * defined to do the wrong thing in this case. + */ +local int codes(struct state *s, + const struct huffman *lencode, + const struct huffman *distcode) +{ + int symbol; /* decoded symbol */ + int len; /* length for copy */ + unsigned dist; /* distance for copy */ + static const short lens[29] = { /* Size base for length codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258}; + static const short lext[29] = { /* Extra bits for length codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0}; + static const short dists[30] = { /* Offset base for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; + static const short dext[30] = { /* Extra bits for distance codes 0..29 */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + /* decode literals and length/distance pairs */ + do { + symbol = decode(s, lencode); + if (symbol < 0) + return symbol; /* invalid symbol */ + if (symbol < 256) { /* literal: symbol is the byte */ + /* write out the literal */ + if (s->out != NIL) { + if (s->outcnt == s->outlen) + return 1; + s->out[s->outcnt] = symbol; + } + s->outcnt++; + } + else if (symbol > 256) { /* length */ + /* get and compute length */ + symbol -= 257; + if (symbol >= 29) + return -10; /* invalid fixed code */ + len = lens[symbol] + bits(s, lext[symbol]); + + /* get and check distance */ + symbol = decode(s, distcode); + if (symbol < 0) + return symbol; /* invalid symbol */ + dist = dists[symbol] + bits(s, dext[symbol]); +#ifndef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + if (dist > s->outcnt) + return -11; /* distance too far back */ +#endif + + /* copy length bytes from distance bytes back */ + if (s->out != NIL) { + if (s->outcnt + len > s->outlen) + return 1; + while (len--) { + s->out[s->outcnt] = +#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + dist > s->outcnt ? + 0 : +#endif + s->out[s->outcnt - dist]; + s->outcnt++; + } + } + else + s->outcnt += len; + } + } while (symbol != 256); /* end of block symbol */ + + /* done with a valid fixed or dynamic block */ + return 0; +} + +/* + * Process a fixed codes block. + * + * Format notes: + * + * - This block type can be useful for compressing small amounts of data for + * which the size of the code descriptions in a dynamic block exceeds the + * benefit of custom codes for that block. For fixed codes, no bits are + * spent on code descriptions. Instead the code lengths for literal/length + * codes and distance codes are fixed. The specific lengths for each symbol + * can be seen in the "for" loops below. + * + * - The literal/length code is complete, but has two symbols that are invalid + * and should result in an error if received. This cannot be implemented + * simply as an incomplete code since those two symbols are in the "middle" + * of the code. They are eight bits long and the longest literal/length\ + * code is nine bits. Therefore the code must be constructed with those + * symbols, and the invalid symbols must be detected after decoding. + * + * - The fixed distance codes also have two invalid symbols that should result + * in an error if received. Since all of the distance codes are the same + * length, this can be implemented as an incomplete code. Then the invalid + * codes are detected while decoding. + */ +local int fixed(struct state *s) +{ + static int virgin = 1; + static short lencnt[MAXBITS+1], lensym[FIXLCODES]; + static short distcnt[MAXBITS+1], distsym[MAXDCODES]; + static struct huffman lencode, distcode; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + int symbol; + short lengths[FIXLCODES]; + + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + + /* literal/length table */ + for (symbol = 0; symbol < 144; symbol++) + lengths[symbol] = 8; + for (; symbol < 256; symbol++) + lengths[symbol] = 9; + for (; symbol < 280; symbol++) + lengths[symbol] = 7; + for (; symbol < FIXLCODES; symbol++) + lengths[symbol] = 8; + construct(&lencode, lengths, FIXLCODES); + + /* distance table */ + for (symbol = 0; symbol < MAXDCODES; symbol++) + lengths[symbol] = 5; + construct(&distcode, lengths, MAXDCODES); + + /* do this just once */ + virgin = 0; + } + + /* decode data until end-of-block code */ + return codes(s, &lencode, &distcode); +} + +/* + * Process a dynamic codes block. + * + * Format notes: + * + * - A dynamic block starts with a description of the literal/length and + * distance codes for that block. New dynamic blocks allow the compressor to + * rapidly adapt to changing data with new codes optimized for that data. + * + * - The codes used by the deflate format are "canonical", which means that + * the actual bits of the codes are generated in an unambiguous way simply + * from the number of bits in each code. Therefore the code descriptions + * are simply a list of code lengths for each symbol. + * + * - The code lengths are stored in order for the symbols, so lengths are + * provided for each of the literal/length symbols, and for each of the + * distance symbols. + * + * - If a symbol is not used in the block, this is represented by a zero as + * as the code length. This does not mean a zero-length code, but rather + * that no code should be created for this symbol. There is no way in the + * deflate format to represent a zero-length code. + * + * - The maximum number of bits in a code is 15, so the possible lengths for + * any code are 1..15. + * + * - The fact that a length of zero is not permitted for a code has an + * interesting consequence. Normally if only one symbol is used for a given + * code, then in fact that code could be represented with zero bits. However + * in deflate, that code has to be at least one bit. So for example, if + * only a single distance base symbol appears in a block, then it will be + * represented by a single code of length one, in particular one 0 bit. This + * is an incomplete code, since if a 1 bit is received, it has no meaning, + * and should result in an error. So incomplete distance codes of one symbol + * should be permitted, and the receipt of invalid codes should be handled. + * + * - It is also possible to have a single literal/length code, but that code + * must be the end-of-block code, since every dynamic block has one. This + * is not the most efficient way to create an empty block (an empty fixed + * block is fewer bits), but it is allowed by the format. So incomplete + * literal/length codes of one symbol should also be permitted. + * + * - If there are only literal codes and no lengths, then there are no distance + * codes. This is represented by one distance code with zero bits. + * + * - The list of up to 286 length/literal lengths and up to 30 distance lengths + * are themselves compressed using Huffman codes and run-length encoding. In + * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means + * that length, and the symbols 16, 17, and 18 are run-length instructions. + * Each of 16, 17, and 18 are follwed by extra bits to define the length of + * the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10 + * zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols + * are common, hence the special coding for zero lengths. + * + * - The symbols for 0..18 are Huffman coded, and so that code must be + * described first. This is simply a sequence of up to 19 three-bit values + * representing no code (0) or the code length for that symbol (1..7). + * + * - A dynamic block starts with three fixed-size counts from which is computed + * the number of literal/length code lengths, the number of distance code + * lengths, and the number of code length code lengths (ok, you come up with + * a better name!) in the code descriptions. For the literal/length and + * distance codes, lengths after those provided are considered zero, i.e. no + * code. The code length code lengths are received in a permuted order (see + * the order[] array below) to make a short code length code length list more + * likely. As it turns out, very short and very long codes are less likely + * to be seen in a dynamic code description, hence what may appear initially + * to be a peculiar ordering. + * + * - Given the number of literal/length code lengths (nlen) and distance code + * lengths (ndist), then they are treated as one long list of nlen + ndist + * code lengths. Therefore run-length coding can and often does cross the + * boundary between the two sets of lengths. + * + * - So to summarize, the code description at the start of a dynamic block is + * three counts for the number of code lengths for the literal/length codes, + * the distance codes, and the code length codes. This is followed by the + * code length code lengths, three bits each. This is used to construct the + * code length code which is used to read the remainder of the lengths. Then + * the literal/length code lengths and distance lengths are read as a single + * set of lengths using the code length codes. Codes are constructed from + * the resulting two sets of lengths, and then finally you can start + * decoding actual compressed data in the block. + * + * - For reference, a "typical" size for the code description in a dynamic + * block is around 80 bytes. + */ +local int dynamic(struct state *s) +{ + int nlen, ndist, ncode; /* number of lengths in descriptor */ + int index; /* index of lengths[] */ + int err; /* construct() return value */ + short lengths[MAXCODES]; /* descriptor code lengths */ + short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */ + short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */ + struct huffman lencode, distcode; /* length and distance codes */ + static const short order[19] = /* permutation of code length codes */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + + /* get number of lengths in each table, check lengths */ + nlen = bits(s, 5) + 257; + ndist = bits(s, 5) + 1; + ncode = bits(s, 4) + 4; + if (nlen > MAXLCODES || ndist > MAXDCODES) + return -3; /* bad counts */ + + /* read code length code lengths (really), missing lengths are zero */ + for (index = 0; index < ncode; index++) + lengths[order[index]] = bits(s, 3); + for (; index < 19; index++) + lengths[order[index]] = 0; + + /* build huffman table for code lengths codes (use lencode temporarily) */ + err = construct(&lencode, lengths, 19); + if (err != 0) /* require complete code set here */ + return -4; + + /* read length/literal and distance code length tables */ + index = 0; + while (index < nlen + ndist) { + int symbol; /* decoded value */ + int len; /* last length to repeat */ + + symbol = decode(s, &lencode); + if (symbol < 16) /* length in 0..15 */ + lengths[index++] = symbol; + else { /* repeat instruction */ + len = 0; /* assume repeating zeros */ + if (symbol == 16) { /* repeat last length 3..6 times */ + if (index == 0) + return -5; /* no last length! */ + len = lengths[index - 1]; /* last length */ + symbol = 3 + bits(s, 2); + } + else if (symbol == 17) /* repeat zero 3..10 times */ + symbol = 3 + bits(s, 3); + else /* == 18, repeat zero 11..138 times */ + symbol = 11 + bits(s, 7); + if (index + symbol > nlen + ndist) + return -6; /* too many lengths! */ + while (symbol--) /* repeat last or zero symbol times */ + lengths[index++] = len; + } + } + + /* check for end-of-block code -- there better be one! */ + if (lengths[256] == 0) + return -9; + + /* build huffman table for literal/length codes */ + err = construct(&lencode, lengths, nlen); + if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1])) + return -7; /* incomplete code ok only for single length 1 code */ + + /* build huffman table for distance codes */ + err = construct(&distcode, lengths + nlen, ndist); + if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1])) + return -8; /* incomplete code ok only for single length 1 code */ + + /* decode data until end-of-block code */ + return codes(s, &lencode, &distcode); +} + +/* + * Inflate source to dest. On return, destlen and sourcelen are updated to the + * size of the uncompressed data and the size of the deflate data respectively. + * On success, the return value of puff() is zero. If there is an error in the + * source data, i.e. it is not in the deflate format, then a negative value is + * returned. If there is not enough input available or there is not enough + * output space, then a positive error is returned. In that case, destlen and + * sourcelen are not updated to facilitate retrying from the beginning with the + * provision of more input data or more output space. In the case of invalid + * inflate data (a negative error), the dest and source pointers are updated to + * facilitate the debugging of deflators. + * + * puff() also has a mode to determine the size of the uncompressed output with + * no output written. For this dest must be (unsigned char *)0. In this case, + * the input value of *destlen is ignored, and on return *destlen is set to the + * size of the uncompressed output. + * + * The return codes are: + * + * 2: available inflate data did not terminate + * 1: output space exhausted before completing inflate + * 0: successful inflate + * -1: invalid block type (type == 3) + * -2: stored block length did not match one's complement + * -3: dynamic block code description: too many length or distance codes + * -4: dynamic block code description: code lengths codes incomplete + * -5: dynamic block code description: repeat lengths with no first length + * -6: dynamic block code description: repeat more than specified lengths + * -7: dynamic block code description: invalid literal/length code lengths + * -8: dynamic block code description: invalid distance code lengths + * -9: dynamic block code description: missing end-of-block code + * -10: invalid literal/length or distance code in fixed or dynamic block + * -11: distance is too far back in fixed or dynamic block + * + * Format notes: + * + * - Three bits are read for each block to determine the kind of block and + * whether or not it is the last block. Then the block is decoded and the + * process repeated if it was not the last block. + * + * - The leftover bits in the last byte of the deflate data after the last + * block (if it was a fixed or dynamic block) are undefined and have no + * expected values to check. + */ +int puff(unsigned char *dest, /* pointer to destination pointer */ + unsigned long *destlen, /* amount of output space */ + const unsigned char *source, /* pointer to source data pointer */ + unsigned long *sourcelen) /* amount of input available */ +{ + struct state s; /* input/output state */ + int last, type; /* block information */ + int err; /* return value */ + + /* initialize output state */ + s.out = dest; + s.outlen = *destlen; /* ignored if dest is NIL */ + s.outcnt = 0; + + /* initialize input state */ + s.in = source; + s.inlen = *sourcelen; + s.incnt = 0; + s.bitbuf = 0; + s.bitcnt = 0; + + /* return if bits() or decode() tries to read past available input */ + if (setjmp(s.env) != 0) /* if came back here via longjmp() */ + err = 2; /* then skip do-loop, return error */ + else { + /* process blocks until last block or error */ + do { + last = bits(&s, 1); /* one if last block */ + type = bits(&s, 2); /* block type 0..3 */ + err = type == 0 ? + stored(&s) : + (type == 1 ? + fixed(&s) : + (type == 2 ? + dynamic(&s) : + -1)); /* type == 3, invalid */ + if (err != 0) + break; /* return with error */ + } while (!last); + } + + /* update the lengths and return */ + if (err <= 0) { + *destlen = s.outcnt; + *sourcelen = s.incnt; + } + return err; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.h b/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.h new file mode 100644 index 0000000..6a0080a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/puff/puff.h @@ -0,0 +1,35 @@ +/* puff.h + Copyright (C) 2002-2010 Mark Adler, all rights reserved + version 2.2, 25 Apr 2010 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + + +/* + * See puff.c for purpose and usage. + */ +#ifndef NIL +# define NIL ((unsigned char *)0) /* for no output option */ +#endif + +int puff(unsigned char *dest, /* pointer to destination pointer */ + unsigned long *destlen, /* amount of output space */ + const unsigned char *source, /* pointer to source data pointer */ + unsigned long *sourcelen); /* amount of input available */ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/pufftest.c b/thirdparty/zlib/zlib-1.2.7/contrib/puff/pufftest.c new file mode 100644 index 0000000..76e35f6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/puff/pufftest.c @@ -0,0 +1,165 @@ +/* + * pufftest.c + * Copyright (C) 2002-2010 Mark Adler + * For conditions of distribution and use, see copyright notice in puff.h + * version 2.2, 25 Apr 2010 + */ + +/* Example of how to use puff(). + + Usage: puff [-w] [-f] [-nnn] file + ... | puff [-w] [-f] [-nnn] + + where file is the input file with deflate data, nnn is the number of bytes + of input to skip before inflating (e.g. to skip a zlib or gzip header), and + -w is used to write the decompressed data to stdout. -f is for coverage + testing, and causes pufftest to fail with not enough output space (-f does + a write like -w, so -w is not required). */ + +#include +#include +#include "puff.h" + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +#define local static + +/* Return size times approximately the cube root of 2, keeping the result as 1, + 3, or 5 times a power of 2 -- the result is always > size, until the result + is the maximum value of an unsigned long, where it remains. This is useful + to keep reallocations less than ~33% over the actual data. */ +local size_t bythirds(size_t size) +{ + int n; + size_t m; + + m = size; + for (n = 0; m; n++) + m >>= 1; + if (n < 3) + return size + 1; + n -= 3; + m = size >> n; + m += m == 6 ? 2 : 1; + m <<= n; + return m > size ? m : (size_t)(-1); +} + +/* Read the input file *name, or stdin if name is NULL, into allocated memory. + Reallocate to larger buffers until the entire file is read in. Return a + pointer to the allocated data, or NULL if there was a memory allocation + failure. *len is the number of bytes of data read from the input file (even + if load() returns NULL). If the input file was empty or could not be opened + or read, *len is zero. */ +local void *load(const char *name, size_t *len) +{ + size_t size; + void *buf, *swap; + FILE *in; + + *len = 0; + buf = malloc(size = 4096); + if (buf == NULL) + return NULL; + in = name == NULL ? stdin : fopen(name, "rb"); + if (in != NULL) { + for (;;) { + *len += fread((char *)buf + *len, 1, size - *len, in); + if (*len < size) break; + size = bythirds(size); + if (size == *len || (swap = realloc(buf, size)) == NULL) { + free(buf); + buf = NULL; + break; + } + buf = swap; + } + fclose(in); + } + return buf; +} + +int main(int argc, char **argv) +{ + int ret, put = 0, fail = 0; + unsigned skip = 0; + char *arg, *name = NULL; + unsigned char *source = NULL, *dest; + size_t len = 0; + unsigned long sourcelen, destlen; + + /* process arguments */ + while (arg = *++argv, --argc) + if (arg[0] == '-') { + if (arg[1] == 'w' && arg[2] == 0) + put = 1; + else if (arg[1] == 'f' && arg[2] == 0) + fail = 1, put = 1; + else if (arg[1] >= '0' && arg[1] <= '9') + skip = (unsigned)atoi(arg + 1); + else { + fprintf(stderr, "invalid option %s\n", arg); + return 3; + } + } + else if (name != NULL) { + fprintf(stderr, "only one file name allowed\n"); + return 3; + } + else + name = arg; + source = load(name, &len); + if (source == NULL) { + fprintf(stderr, "memory allocation failure\n"); + return 4; + } + if (len == 0) { + fprintf(stderr, "could not read %s, or it was empty\n", + name == NULL ? "" : name); + free(source); + return 3; + } + if (skip >= len) { + fprintf(stderr, "skip request of %d leaves no input\n", skip); + free(source); + return 3; + } + + /* test inflate data with offset skip */ + len -= skip; + sourcelen = (unsigned long)len; + ret = puff(NIL, &destlen, source + skip, &sourcelen); + if (ret) + fprintf(stderr, "puff() failed with return code %d\n", ret); + else { + fprintf(stderr, "puff() succeeded uncompressing %lu bytes\n", destlen); + if (sourcelen < len) fprintf(stderr, "%lu compressed bytes unused\n", + len - sourcelen); + } + + /* if requested, inflate again and write decompressd data to stdout */ + if (put && ret == 0) { + if (fail) + destlen >>= 1; + dest = malloc(destlen); + if (dest == NULL) { + fprintf(stderr, "memory allocation failure\n"); + free(source); + return 4; + } + puff(dest, &destlen, source + skip, &sourcelen); + SET_BINARY_MODE(stdout); + fwrite(dest, 1, destlen, stdout); + free(dest); + } + + /* clean up */ + free(source); + return ret; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/puff/zeros.raw b/thirdparty/zlib/zlib-1.2.7/contrib/puff/zeros.raw new file mode 100644 index 0000000..0a90e76 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/contrib/puff/zeros.raw differ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.c b/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.c new file mode 100644 index 0000000..f559a36 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.c @@ -0,0 +1,275 @@ +#include +#include +#include + +#include "zlib.h" + + +void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B) +{ + R->HighPart = A.HighPart - B.HighPart; + if (A.LowPart >= B.LowPart) + R->LowPart = A.LowPart - B.LowPart; + else + { + R->LowPart = A.LowPart - B.LowPart; + R->HighPart --; + } +} + +#ifdef _M_X64 +// see http://msdn2.microsoft.com/library/twchhe95(en-us,vs.80).aspx for __rdtsc +unsigned __int64 __rdtsc(void); +void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64) +{ + // printf("rdtsc = %I64x\n",__rdtsc()); + pbeginTime64->QuadPart=__rdtsc(); +} + +LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf) +{ + LARGE_INTEGER LIres; + unsigned _int64 res=__rdtsc()-((unsigned _int64)(beginTime64.QuadPart)); + LIres.QuadPart=res; + // printf("rdtsc = %I64x\n",__rdtsc()); + return LIres; +} +#else +#ifdef _M_IX86 +void myGetRDTSC32(LARGE_INTEGER * pbeginTime64) +{ + DWORD dwEdx,dwEax; + _asm + { + rdtsc + mov dwEax,eax + mov dwEdx,edx + } + pbeginTime64->LowPart=dwEax; + pbeginTime64->HighPart=dwEdx; +} + +void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64) +{ + myGetRDTSC32(pbeginTime64); +} + +LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf) +{ + LARGE_INTEGER LIres,endTime64; + myGetRDTSC32(&endTime64); + + LIres.LowPart=LIres.HighPart=0; + MyDoMinus64(&LIres,endTime64,beginTime64); + return LIres; +} +#else +void myGetRDTSC32(LARGE_INTEGER * pbeginTime64) +{ +} + +void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64) +{ +} + +LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf) +{ + LARGE_INTEGER lr; + lr.QuadPart=0; + return lr; +} +#endif +#endif + +void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf) +{ + if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(pbeginTime64))) + { + pbeginTime64->LowPart = GetTickCount(); + pbeginTime64->HighPart = 0; + } +} + +DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf) +{ + LARGE_INTEGER endTime64,ticksPerSecond,ticks; + DWORDLONG ticksShifted,tickSecShifted; + DWORD dwLog=16+0; + DWORD dwRet; + if ((!fComputeTimeQueryPerf) || (!QueryPerformanceCounter(&endTime64))) + dwRet = (GetTickCount() - beginTime64.LowPart)*1; + else + { + MyDoMinus64(&ticks,endTime64,beginTime64); + QueryPerformanceFrequency(&ticksPerSecond); + + + { + ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog); + tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog); + + } + + dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted)); + dwRet *=1; + } + return dwRet; +} + +int ReadFileMemory(const char* filename,long* plFileSize,void** pFilePtr) +{ + FILE* stream; + void* ptr; + int retVal=1; + stream=fopen(filename, "rb"); + if (stream==NULL) + return 0; + + fseek(stream,0,SEEK_END); + + *plFileSize=ftell(stream); + fseek(stream,0,SEEK_SET); + ptr=malloc((*plFileSize)+1); + if (ptr==NULL) + retVal=0; + else + { + if (fread(ptr, 1, *plFileSize,stream) != (*plFileSize)) + retVal=0; + } + fclose(stream); + *pFilePtr=ptr; + return retVal; +} + +int main(int argc, char *argv[]) +{ + int BlockSizeCompress=0x8000; + int BlockSizeUncompress=0x8000; + int cprLevel=Z_DEFAULT_COMPRESSION ; + long lFileSize; + unsigned char* FilePtr; + long lBufferSizeCpr; + long lBufferSizeUncpr; + long lCompressedSize=0; + unsigned char* CprPtr; + unsigned char* UncprPtr; + long lSizeCpr,lSizeUncpr; + DWORD dwGetTick,dwMsecQP; + LARGE_INTEGER li_qp,li_rdtsc,dwResRdtsc; + + if (argc<=1) + { + printf("run TestZlib [BlockSizeCompress] [BlockSizeUncompress] [compres. level]\n"); + return 0; + } + + if (ReadFileMemory(argv[1],&lFileSize,&FilePtr)==0) + { + printf("error reading %s\n",argv[1]); + return 1; + } + else printf("file %s read, %u bytes\n",argv[1],lFileSize); + + if (argc>=3) + BlockSizeCompress=atol(argv[2]); + + if (argc>=4) + BlockSizeUncompress=atol(argv[3]); + + if (argc>=5) + cprLevel=(int)atol(argv[4]); + + lBufferSizeCpr = lFileSize + (lFileSize/0x10) + 0x200; + lBufferSizeUncpr = lBufferSizeCpr; + + CprPtr=(unsigned char*)malloc(lBufferSizeCpr + BlockSizeCompress); + + BeginCountPerfCounter(&li_qp,TRUE); + dwGetTick=GetTickCount(); + BeginCountRdtsc(&li_rdtsc); + { + z_stream zcpr; + int ret=Z_OK; + long lOrigToDo = lFileSize; + long lOrigDone = 0; + int step=0; + memset(&zcpr,0,sizeof(z_stream)); + deflateInit(&zcpr,cprLevel); + + zcpr.next_in = FilePtr; + zcpr.next_out = CprPtr; + + + do + { + long all_read_before = zcpr.total_in; + zcpr.avail_in = min(lOrigToDo,BlockSizeCompress); + zcpr.avail_out = BlockSizeCompress; + ret=deflate(&zcpr,(zcpr.avail_in==lOrigToDo) ? Z_FINISH : Z_SYNC_FLUSH); + lOrigDone += (zcpr.total_in-all_read_before); + lOrigToDo -= (zcpr.total_in-all_read_before); + step++; + } while (ret==Z_OK); + + lSizeCpr=zcpr.total_out; + deflateEnd(&zcpr); + dwGetTick=GetTickCount()-dwGetTick; + dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE); + dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE); + printf("total compress size = %u, in %u step\n",lSizeCpr,step); + printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.); + printf("defcpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.); + printf("defcpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart); + } + + CprPtr=(unsigned char*)realloc(CprPtr,lSizeCpr); + UncprPtr=(unsigned char*)malloc(lBufferSizeUncpr + BlockSizeUncompress); + + BeginCountPerfCounter(&li_qp,TRUE); + dwGetTick=GetTickCount(); + BeginCountRdtsc(&li_rdtsc); + { + z_stream zcpr; + int ret=Z_OK; + long lOrigToDo = lSizeCpr; + long lOrigDone = 0; + int step=0; + memset(&zcpr,0,sizeof(z_stream)); + inflateInit(&zcpr); + + zcpr.next_in = CprPtr; + zcpr.next_out = UncprPtr; + + + do + { + long all_read_before = zcpr.total_in; + zcpr.avail_in = min(lOrigToDo,BlockSizeUncompress); + zcpr.avail_out = BlockSizeUncompress; + ret=inflate(&zcpr,Z_SYNC_FLUSH); + lOrigDone += (zcpr.total_in-all_read_before); + lOrigToDo -= (zcpr.total_in-all_read_before); + step++; + } while (ret==Z_OK); + + lSizeUncpr=zcpr.total_out; + inflateEnd(&zcpr); + dwGetTick=GetTickCount()-dwGetTick; + dwMsecQP=GetMsecSincePerfCounter(li_qp,TRUE); + dwResRdtsc=GetResRdtsc(li_rdtsc,TRUE); + printf("total uncompress size = %u, in %u step\n",lSizeUncpr,step); + printf("time = %u msec = %f sec\n",dwGetTick,dwGetTick/(double)1000.); + printf("uncpr time QP = %u msec = %f sec\n",dwMsecQP,dwMsecQP/(double)1000.); + printf("uncpr result rdtsc = %I64x\n\n",dwResRdtsc.QuadPart); + } + + if (lSizeUncpr==lFileSize) + { + if (memcmp(FilePtr,UncprPtr,lFileSize)==0) + printf("compare ok\n"); + + } + + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.txt b/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.txt new file mode 100644 index 0000000..e508bb2 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/testzlib/testzlib.txt @@ -0,0 +1,10 @@ +To build testzLib with Visual Studio 2005: + +copy to a directory file from : +- root of zLib tree +- contrib/testzlib +- contrib/masmx86 +- contrib/masmx64 +- contrib/vstudio/vc7 + +and open testzlib8.sln \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile new file mode 100644 index 0000000..b54266f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile @@ -0,0 +1,14 @@ +CC=cc +CFLAGS=-g + +untgz: untgz.o ../../libz.a + $(CC) $(CFLAGS) -o untgz untgz.o -L../.. -lz + +untgz.o: untgz.c ../../zlib.h + $(CC) $(CFLAGS) -c -I../.. untgz.c + +../../libz.a: + cd ../..; ./configure; make + +clean: + rm -f untgz untgz.o *~ diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile.msc b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile.msc new file mode 100644 index 0000000..77b8602 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/Makefile.msc @@ -0,0 +1,17 @@ +CC=cl +CFLAGS=-MD + +untgz.exe: untgz.obj ..\..\zlib.lib + $(CC) $(CFLAGS) untgz.obj ..\..\zlib.lib + +untgz.obj: untgz.c ..\..\zlib.h + $(CC) $(CFLAGS) -c -I..\.. untgz.c + +..\..\zlib.lib: + cd ..\.. + $(MAKE) -f win32\makefile.msc + cd contrib\untgz + +clean: + -del untgz.obj + -del untgz.exe diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/untgz/untgz.c b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/untgz.c new file mode 100644 index 0000000..2c391e5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/untgz/untgz.c @@ -0,0 +1,674 @@ +/* + * untgz.c -- Display contents and extract files from a gzip'd TAR file + * + * written by Pedro A. Aranda Gutierrez + * adaptation to Unix by Jean-loup Gailly + * various fixes by Cosmin Truta + */ + +#include +#include +#include +#include +#include + +#include "zlib.h" + +#ifdef unix +# include +#else +# include +# include +#endif + +#ifdef WIN32 +#include +# ifndef F_OK +# define F_OK 0 +# endif +# define mkdir(dirname,mode) _mkdir(dirname) +# ifdef _MSC_VER +# define access(path,mode) _access(path,mode) +# define chmod(path,mode) _chmod(path,mode) +# define strdup(str) _strdup(str) +# endif +#else +# include +#endif + + +/* values used in typeflag field */ + +#define REGTYPE '0' /* regular file */ +#define AREGTYPE '\0' /* regular file */ +#define LNKTYPE '1' /* link */ +#define SYMTYPE '2' /* reserved */ +#define CHRTYPE '3' /* character special */ +#define BLKTYPE '4' /* block special */ +#define DIRTYPE '5' /* directory */ +#define FIFOTYPE '6' /* FIFO special */ +#define CONTTYPE '7' /* reserved */ + +/* GNU tar extensions */ + +#define GNUTYPE_DUMPDIR 'D' /* file names from dumped directory */ +#define GNUTYPE_LONGLINK 'K' /* long link name */ +#define GNUTYPE_LONGNAME 'L' /* long file name */ +#define GNUTYPE_MULTIVOL 'M' /* continuation of file from another volume */ +#define GNUTYPE_NAMES 'N' /* file name that does not fit into main hdr */ +#define GNUTYPE_SPARSE 'S' /* sparse file */ +#define GNUTYPE_VOLHDR 'V' /* tape/volume header */ + + +/* tar header */ + +#define BLOCKSIZE 512 +#define SHORTNAMESIZE 100 + +struct tar_header +{ /* byte offset */ + char name[100]; /* 0 */ + char mode[8]; /* 100 */ + char uid[8]; /* 108 */ + char gid[8]; /* 116 */ + char size[12]; /* 124 */ + char mtime[12]; /* 136 */ + char chksum[8]; /* 148 */ + char typeflag; /* 156 */ + char linkname[100]; /* 157 */ + char magic[6]; /* 257 */ + char version[2]; /* 263 */ + char uname[32]; /* 265 */ + char gname[32]; /* 297 */ + char devmajor[8]; /* 329 */ + char devminor[8]; /* 337 */ + char prefix[155]; /* 345 */ + /* 500 */ +}; + +union tar_buffer +{ + char buffer[BLOCKSIZE]; + struct tar_header header; +}; + +struct attr_item +{ + struct attr_item *next; + char *fname; + int mode; + time_t time; +}; + +enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID }; + +char *TGZfname OF((const char *)); +void TGZnotfound OF((const char *)); + +int getoct OF((char *, int)); +char *strtime OF((time_t *)); +int setfiletime OF((char *, time_t)); +void push_attr OF((struct attr_item **, char *, int, time_t)); +void restore_attr OF((struct attr_item **)); + +int ExprMatch OF((char *, char *)); + +int makedir OF((char *)); +int matchname OF((int, int, char **, char *)); + +void error OF((const char *)); +int tar OF((gzFile, int, int, int, char **)); + +void help OF((int)); +int main OF((int, char **)); + +char *prog; + +const char *TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL }; + +/* return the file name of the TGZ archive */ +/* or NULL if it does not exist */ + +char *TGZfname (const char *arcname) +{ + static char buffer[1024]; + int origlen,i; + + strcpy(buffer,arcname); + origlen = strlen(buffer); + + for (i=0; TGZsuffix[i]; i++) + { + strcpy(buffer+origlen,TGZsuffix[i]); + if (access(buffer,F_OK) == 0) + return buffer; + } + return NULL; +} + + +/* error message for the filename */ + +void TGZnotfound (const char *arcname) +{ + int i; + + fprintf(stderr,"%s: Couldn't find ",prog); + for (i=0;TGZsuffix[i];i++) + fprintf(stderr,(TGZsuffix[i+1]) ? "%s%s, " : "or %s%s\n", + arcname, + TGZsuffix[i]); + exit(1); +} + + +/* convert octal digits to int */ +/* on error return -1 */ + +int getoct (char *p,int width) +{ + int result = 0; + char c; + + while (width--) + { + c = *p++; + if (c == 0) + break; + if (c == ' ') + continue; + if (c < '0' || c > '7') + return -1; + result = result * 8 + (c - '0'); + } + return result; +} + + +/* convert time_t to string */ +/* use the "YYYY/MM/DD hh:mm:ss" format */ + +char *strtime (time_t *t) +{ + struct tm *local; + static char result[32]; + + local = localtime(t); + sprintf(result,"%4d/%02d/%02d %02d:%02d:%02d", + local->tm_year+1900, local->tm_mon+1, local->tm_mday, + local->tm_hour, local->tm_min, local->tm_sec); + return result; +} + + +/* set file time */ + +int setfiletime (char *fname,time_t ftime) +{ +#ifdef WIN32 + static int isWinNT = -1; + SYSTEMTIME st; + FILETIME locft, modft; + struct tm *loctm; + HANDLE hFile; + int result; + + loctm = localtime(&ftime); + if (loctm == NULL) + return -1; + + st.wYear = (WORD)loctm->tm_year + 1900; + st.wMonth = (WORD)loctm->tm_mon + 1; + st.wDayOfWeek = (WORD)loctm->tm_wday; + st.wDay = (WORD)loctm->tm_mday; + st.wHour = (WORD)loctm->tm_hour; + st.wMinute = (WORD)loctm->tm_min; + st.wSecond = (WORD)loctm->tm_sec; + st.wMilliseconds = 0; + if (!SystemTimeToFileTime(&st, &locft) || + !LocalFileTimeToFileTime(&locft, &modft)) + return -1; + + if (isWinNT < 0) + isWinNT = (GetVersion() < 0x80000000) ? 1 : 0; + hFile = CreateFile(fname, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + (isWinNT ? FILE_FLAG_BACKUP_SEMANTICS : 0), + NULL); + if (hFile == INVALID_HANDLE_VALUE) + return -1; + result = SetFileTime(hFile, NULL, NULL, &modft) ? 0 : -1; + CloseHandle(hFile); + return result; +#else + struct utimbuf settime; + + settime.actime = settime.modtime = ftime; + return utime(fname,&settime); +#endif +} + + +/* push file attributes */ + +void push_attr(struct attr_item **list,char *fname,int mode,time_t time) +{ + struct attr_item *item; + + item = (struct attr_item *)malloc(sizeof(struct attr_item)); + if (item == NULL) + error("Out of memory"); + item->fname = strdup(fname); + item->mode = mode; + item->time = time; + item->next = *list; + *list = item; +} + + +/* restore file attributes */ + +void restore_attr(struct attr_item **list) +{ + struct attr_item *item, *prev; + + for (item = *list; item != NULL; ) + { + setfiletime(item->fname,item->time); + chmod(item->fname,item->mode); + prev = item; + item = item->next; + free(prev); + } + *list = NULL; +} + + +/* match regular expression */ + +#define ISSPECIAL(c) (((c) == '*') || ((c) == '/')) + +int ExprMatch (char *string,char *expr) +{ + while (1) + { + if (ISSPECIAL(*expr)) + { + if (*expr == '/') + { + if (*string != '\\' && *string != '/') + return 0; + string ++; expr++; + } + else if (*expr == '*') + { + if (*expr ++ == 0) + return 1; + while (*++string != *expr) + if (*string == 0) + return 0; + } + } + else + { + if (*string != *expr) + return 0; + if (*expr++ == 0) + return 1; + string++; + } + } +} + + +/* recursive mkdir */ +/* abort on ENOENT; ignore other errors like "directory already exists" */ +/* return 1 if OK */ +/* 0 on error */ + +int makedir (char *newdir) +{ + char *buffer = strdup(newdir); + char *p; + int len = strlen(buffer); + + if (len <= 0) { + free(buffer); + return 0; + } + if (buffer[len-1] == '/') { + buffer[len-1] = '\0'; + } + if (mkdir(buffer, 0755) == 0) + { + free(buffer); + return 1; + } + + p = buffer+1; + while (1) + { + char hold; + + while(*p && *p != '\\' && *p != '/') + p++; + hold = *p; + *p = 0; + if ((mkdir(buffer, 0755) == -1) && (errno == ENOENT)) + { + fprintf(stderr,"%s: Couldn't create directory %s\n",prog,buffer); + free(buffer); + return 0; + } + if (hold == 0) + break; + *p++ = hold; + } + free(buffer); + return 1; +} + + +int matchname (int arg,int argc,char **argv,char *fname) +{ + if (arg == argc) /* no arguments given (untgz tgzarchive) */ + return 1; + + while (arg < argc) + if (ExprMatch(fname,argv[arg++])) + return 1; + + return 0; /* ignore this for the moment being */ +} + + +/* tar file list or extract */ + +int tar (gzFile in,int action,int arg,int argc,char **argv) +{ + union tar_buffer buffer; + int len; + int err; + int getheader = 1; + int remaining = 0; + FILE *outfile = NULL; + char fname[BLOCKSIZE]; + int tarmode; + time_t tartime; + struct attr_item *attributes = NULL; + + if (action == TGZ_LIST) + printf(" date time size file\n" + " ---------- -------- --------- -------------------------------------\n"); + while (1) + { + len = gzread(in, &buffer, BLOCKSIZE); + if (len < 0) + error(gzerror(in, &err)); + /* + * Always expect complete blocks to process + * the tar information. + */ + if (len != BLOCKSIZE) + { + action = TGZ_INVALID; /* force error exit */ + remaining = 0; /* force I/O cleanup */ + } + + /* + * If we have to get a tar header + */ + if (getheader >= 1) + { + /* + * if we met the end of the tar + * or the end-of-tar block, + * we are done + */ + if (len == 0 || buffer.header.name[0] == 0) + break; + + tarmode = getoct(buffer.header.mode,8); + tartime = (time_t)getoct(buffer.header.mtime,12); + if (tarmode == -1 || tartime == (time_t)-1) + { + buffer.header.name[0] = 0; + action = TGZ_INVALID; + } + + if (getheader == 1) + { + strncpy(fname,buffer.header.name,SHORTNAMESIZE); + if (fname[SHORTNAMESIZE-1] != 0) + fname[SHORTNAMESIZE] = 0; + } + else + { + /* + * The file name is longer than SHORTNAMESIZE + */ + if (strncmp(fname,buffer.header.name,SHORTNAMESIZE-1) != 0) + error("bad long name"); + getheader = 1; + } + + /* + * Act according to the type flag + */ + switch (buffer.header.typeflag) + { + case DIRTYPE: + if (action == TGZ_LIST) + printf(" %s %s\n",strtime(&tartime),fname); + if (action == TGZ_EXTRACT) + { + makedir(fname); + push_attr(&attributes,fname,tarmode,tartime); + } + break; + case REGTYPE: + case AREGTYPE: + remaining = getoct(buffer.header.size,12); + if (remaining == -1) + { + action = TGZ_INVALID; + break; + } + if (action == TGZ_LIST) + printf(" %s %9d %s\n",strtime(&tartime),remaining,fname); + else if (action == TGZ_EXTRACT) + { + if (matchname(arg,argc,argv,fname)) + { + outfile = fopen(fname,"wb"); + if (outfile == NULL) { + /* try creating directory */ + char *p = strrchr(fname, '/'); + if (p != NULL) { + *p = '\0'; + makedir(fname); + *p = '/'; + outfile = fopen(fname,"wb"); + } + } + if (outfile != NULL) + printf("Extracting %s\n",fname); + else + fprintf(stderr, "%s: Couldn't create %s",prog,fname); + } + else + outfile = NULL; + } + getheader = 0; + break; + case GNUTYPE_LONGLINK: + case GNUTYPE_LONGNAME: + remaining = getoct(buffer.header.size,12); + if (remaining < 0 || remaining >= BLOCKSIZE) + { + action = TGZ_INVALID; + break; + } + len = gzread(in, fname, BLOCKSIZE); + if (len < 0) + error(gzerror(in, &err)); + if (fname[BLOCKSIZE-1] != 0 || (int)strlen(fname) > remaining) + { + action = TGZ_INVALID; + break; + } + getheader = 2; + break; + default: + if (action == TGZ_LIST) + printf(" %s <---> %s\n",strtime(&tartime),fname); + break; + } + } + else + { + unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining; + + if (outfile != NULL) + { + if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes) + { + fprintf(stderr, + "%s: Error writing %s -- skipping\n",prog,fname); + fclose(outfile); + outfile = NULL; + remove(fname); + } + } + remaining -= bytes; + } + + if (remaining == 0) + { + getheader = 1; + if (outfile != NULL) + { + fclose(outfile); + outfile = NULL; + if (action != TGZ_INVALID) + push_attr(&attributes,fname,tarmode,tartime); + } + } + + /* + * Abandon if errors are found + */ + if (action == TGZ_INVALID) + { + error("broken archive"); + break; + } + } + + /* + * Restore file modes and time stamps + */ + restore_attr(&attributes); + + if (gzclose(in) != Z_OK) + error("failed gzclose"); + + return 0; +} + + +/* ============================================================ */ + +void help(int exitval) +{ + printf("untgz version 0.2.1\n" + " using zlib version %s\n\n", + zlibVersion()); + printf("Usage: untgz file.tgz extract all files\n" + " untgz file.tgz fname ... extract selected files\n" + " untgz -l file.tgz list archive contents\n" + " untgz -h display this help\n"); + exit(exitval); +} + +void error(const char *msg) +{ + fprintf(stderr, "%s: %s\n", prog, msg); + exit(1); +} + + +/* ============================================================ */ + +#if defined(WIN32) && defined(__GNUC__) +int _CRT_glob = 0; /* disable argument globbing in MinGW */ +#endif + +int main(int argc,char **argv) +{ + int action = TGZ_EXTRACT; + int arg = 1; + char *TGZfile; + gzFile *f; + + prog = strrchr(argv[0],'\\'); + if (prog == NULL) + { + prog = strrchr(argv[0],'/'); + if (prog == NULL) + { + prog = strrchr(argv[0],':'); + if (prog == NULL) + prog = argv[0]; + else + prog++; + } + else + prog++; + } + else + prog++; + + if (argc == 1) + help(0); + + if (strcmp(argv[arg],"-l") == 0) + { + action = TGZ_LIST; + if (argc == ++arg) + help(0); + } + else if (strcmp(argv[arg],"-h") == 0) + { + help(0); + } + + if ((TGZfile = TGZfname(argv[arg])) == NULL) + TGZnotfound(argv[arg]); + + ++arg; + if ((action == TGZ_LIST) && (arg != argc)) + help(1); + +/* + * Process the TGZ file + */ + switch(action) + { + case TGZ_LIST: + case TGZ_EXTRACT: + f = gzopen(TGZfile,"rb"); + if (f == NULL) + { + fprintf(stderr,"%s: Couldn't gzopen %s\n",prog,TGZfile); + return 1; + } + exit(tar(f, action, arg, argc, argv)); + break; + + default: + error("Unknown option"); + exit(1); + } + + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/readme.txt b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/readme.txt new file mode 100644 index 0000000..9c46c6f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/readme.txt @@ -0,0 +1,60 @@ +Building instructions for the DLL versions of Zlib 1.2.7 +======================================================== + +This directory contains projects that build zlib and minizip using +Microsoft Visual C++ 9.0/10.0. + +You don't need to build these projects yourself. You can download the +binaries from: + http://www.winimage.com/zLibDll + +More information can be found at this site. + + + + + +Build instructions for Visual Studio 2008 (32 bits or 64 bits) +-------------------------------------------------------------- +- Uncompress current zlib, including all contrib/* files +- Compile assembly code (with Visual Studio Command Prompt) by running: + bld_ml64.bat (in contrib\masmx64) + bld_ml32.bat (in contrib\masmx86) +- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 +- Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" + +Build instructions for Visual Studio 2010 (32 bits or 64 bits) +-------------------------------------------------------------- +- Uncompress current zlib, including all contrib/* files +- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010 + + +Important +--------- +- To use zlibwapi.dll in your application, you must define the + macro ZLIB_WINAPI when compiling your application's source files. + + +Additional notes +---------------- +- This DLL, named zlibwapi.dll, is compatible to the old zlib.dll built + by Gilles Vollant from the zlib 1.1.x sources, and distributed at + http://www.winimage.com/zLibDll + It uses the WINAPI calling convention for the exported functions, and + includes the minizip functionality. If your application needs that + particular build of zlib.dll, you can rename zlibwapi.dll to zlib.dll. + +- The new DLL was renamed because there exist several incompatible + versions of zlib.dll on the Internet. + +- There is also an official DLL build of zlib, named zlib1.dll. This one + is exporting the functions using the CDECL convention. See the file + win32\DLL_FAQ.txt found in this zlib distribution. + +- There used to be a ZLIB_DLL macro in zlib 1.1.x, but now this symbol + has a slightly different effect. To avoid compatibility problems, do + not define it here. + + +Gilles Vollant +info@winimage.com diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj new file mode 100644 index 0000000..1b36242 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj @@ -0,0 +1,310 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {C52F9E7B-498A-42BE-8DB4-85A15694382A} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\MiniUnzip$(Configuration)\ + x86\MiniUnzip$(Configuration)\Tmp\ + true + false + x86\MiniUnzip$(Configuration)\ + x86\MiniUnzip$(Configuration)\Tmp\ + false + false + x64\MiniUnzip$(Configuration)\ + x64\MiniUnzip$(Configuration)\Tmp\ + true + false + ia64\MiniUnzip$(Configuration)\ + ia64\MiniUnzip$(Configuration)\Tmp\ + true + false + x64\MiniUnzip$(Configuration)\ + x64\MiniUnzip$(Configuration)\Tmp\ + false + false + ia64\MiniUnzip$(Configuration)\ + ia64\MiniUnzip$(Configuration)\Tmp\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + false + + + $(IntDir) + Level3 + EditAndContinue + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + MachineX64 + + + + + Itanium + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + $(OutDir)miniunz.pdb + Console + MachineIA64 + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + MachineX64 + + + + + Itanium + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)miniunz.exe + true + Console + true + true + MachineIA64 + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj.filters new file mode 100644 index 0000000..0bd1221 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/miniunz.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {048af943-022b-4db6-beeb-a54c34774ee2} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} + h;hpp;hxx;hm;inl;inc + + + {0844199a-966b-4f19-81db-1e0125e141b9} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj new file mode 100644 index 0000000..ccd3651 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj @@ -0,0 +1,307 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\MiniZip$(Configuration)\ + x86\MiniZip$(Configuration)\Tmp\ + true + false + x86\MiniZip$(Configuration)\ + x86\MiniZip$(Configuration)\Tmp\ + false + x64\$(Configuration)\ + x64\$(Configuration)\ + true + false + ia64\$(Configuration)\ + ia64\$(Configuration)\ + true + false + x64\$(Configuration)\ + x64\$(Configuration)\ + false + ia64\$(Configuration)\ + ia64\$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + false + + + $(IntDir) + Level3 + EditAndContinue + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + MachineX64 + + + + + Itanium + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + $(OutDir)minizip.pdb + Console + MachineIA64 + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + MachineX64 + + + + + Itanium + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)minizip.exe + true + Console + true + true + MachineIA64 + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj.filters new file mode 100644 index 0000000..7076d76 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/minizip.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {c0419b40-bf50-40da-b153-ff74215b79de} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {bb87b070-735b-478e-92ce-7383abb2f36c} + h;hpp;hxx;hm;inl;inc + + + {f46ab6a6-548f-43cb-ae96-681abb5bd5db} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj new file mode 100644 index 0000000..476b8ea --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj @@ -0,0 +1,420 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + Itanium + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B} + testzlib + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + true + + + Application + true + + + Application + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + true + false + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + false + false + x86\TestZlib$(Configuration)\ + x86\TestZlib$(Configuration)\Tmp\ + false + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + ia64\TestZlib$(Configuration)\ + ia64\TestZlib$(Configuration)\Tmp\ + true + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + ia64\TestZlib$(Configuration)\ + ia64\TestZlib$(Configuration)\Tmp\ + false + false + x64\TestZlib$(Configuration)\ + x64\TestZlib$(Configuration)\Tmp\ + false + ia64\TestZlib$(Configuration)\ + ia64\TestZlib$(Configuration)\Tmp\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + false + + + AssemblyAndSourceCode + $(IntDir) + Level3 + EditAndContinue + + + ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + $(OutDir)testzlib.exe + true + $(OutDir)testzlib.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + $(OutDir)testzlib.exe + true + Console + true + true + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + $(OutDir)testzlib.exe + true + Console + true + true + false + + + MachineX86 + + + + + ..\..\..;%(AdditionalIncludeDirectories) + ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDebugDLL + false + $(IntDir) + + + ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + + + + + Itanium + + + Disabled + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + AssemblyAndSourceCode + $(IntDir) + Level3 + ProgramDatabase + + + $(OutDir)testzlib.exe + true + $(OutDir)testzlib.pdb + Console + MachineIA64 + + + + + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + %(AdditionalDependencies) + + + + + Itanium + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + $(OutDir)testzlib.exe + true + Console + true + true + MachineIA64 + + + + + ..\..\..;%(AdditionalIncludeDirectories) + ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + Default + MultiThreadedDLL + false + $(IntDir) + + + ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + + + + + Itanium + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + $(OutDir)testzlib.exe + true + Console + true + true + MachineIA64 + + + + + + + + + + true + true + true + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj.filters new file mode 100644 index 0000000..3276491 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlib.vcxproj.filters @@ -0,0 +1,58 @@ + + + + + {c1f6a2e3-5da5-4955-8653-310d3efe05a9} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {c2aaffdc-2c95-4d6f-8466-4bec5890af2c} + h;hpp;hxx;hm;inl;inc + + + {c274fe07-05f2-461c-964b-f6341e4e7eb5} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj new file mode 100644 index 0000000..8e38876 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj @@ -0,0 +1,310 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {C52F9E7B-498A-42BE-8DB4-85A15694366A} + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\TestZlibDll$(Configuration)\ + x86\TestZlibDll$(Configuration)\Tmp\ + true + false + x86\TestZlibDll$(Configuration)\ + x86\TestZlibDll$(Configuration)\Tmp\ + false + false + x64\TestZlibDll$(Configuration)\ + x64\TestZlibDll$(Configuration)\Tmp\ + true + false + ia64\TestZlibDll$(Configuration)\ + ia64\TestZlibDll$(Configuration)\Tmp\ + true + false + x64\TestZlibDll$(Configuration)\ + x64\TestZlibDll$(Configuration)\Tmp\ + false + false + ia64\TestZlibDll$(Configuration)\ + ia64\TestZlibDll$(Configuration)\Tmp\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebug + false + + + $(IntDir) + Level3 + EditAndContinue + + + x86\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + false + + + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + Default + MultiThreaded + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x86\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + MachineX64 + + + + + Itanium + + + Disabled + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDebugDLL + false + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllDebug\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + $(OutDir)testzlib.pdb + Console + MachineIA64 + + + + + X64 + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + x64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + MachineX64 + + + + + Itanium + + + MaxSpeed + OnlyExplicitInline + true + ..\..\..;..\..\minizip;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64;%(PreprocessorDefinitions) + true + Default + MultiThreadedDLL + false + true + + + $(IntDir) + Level3 + ProgramDatabase + + + ia64\ZlibDllRelease\zlibwapi.lib;%(AdditionalDependencies) + $(OutDir)testzlibdll.exe + true + Console + true + true + MachineIA64 + + + + + + + + {8fd826f8-3739-44e6-8cc8-997122e53b8d} + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj.filters new file mode 100644 index 0000000..ab87f09 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/testzlibdll.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {fa61a89f-93fc-4c89-b29e-36224b7592f4} + cpp;c;cxx;def;odl;idl;hpj;bat;asm + + + {d4b85da0-2ba2-4934-b57f-e2584e3848ee} + h;hpp;hxx;hm;inl;inc + + + {e573e075-00bd-4a7d-bd67-a8cc9bfc5aca} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlib.rc b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlib.rc new file mode 100644 index 0000000..3de60c5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlib.rc @@ -0,0 +1,32 @@ +#include + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 1.2.7,0 + PRODUCTVERSION 1.2.7,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" + VALUE "FileVersion", "1.2.7\0" + VALUE "InternalName", "zlib\0" + VALUE "OriginalFilename", "zlib.dll\0" + VALUE "ProductName", "ZLib.DLL\0" + VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" + VALUE "LegalCopyright", "(C) 1995-2012 Jean-loup Gailly & Mark Adler\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj new file mode 100644 index 0000000..9382021 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj @@ -0,0 +1,457 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + Itanium + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x86\ZlibStat$(Configuration)\ + x86\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + ia64\ZlibStat$(Configuration)\ + ia64\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + ia64\ZlibStat$(Configuration)\ + ia64\ZlibStat$(Configuration)\Tmp\ + x64\ZlibStat$(Configuration)\ + x64\ZlibStat$(Configuration)\Tmp\ + ia64\ZlibStat$(Configuration)\ + ia64\ZlibStat$(Configuration)\Tmp\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + + + MultiThreadedDebug + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + Itanium + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + OldStyle + + + 0x040c + + + /MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + $(OutDir)zlibstat.lib + true + + + + + Itanium + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + X64 + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + Itanium + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibstat.pch + $(IntDir) + $(IntDir) + $(OutDir) + Level3 + true + + + 0x040c + + + /MACHINE:IA64 /NODEFAULTLIB %(AdditionalOptions) + $(OutDir)zlibstat.lib + true + + + + + + + + + + + + + + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj.filters new file mode 100644 index 0000000..0c8b250 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibstat.vcxproj.filters @@ -0,0 +1,77 @@ + + + + + {174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.def b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.def new file mode 100644 index 0000000..8bd5d99 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.def @@ -0,0 +1,139 @@ +LIBRARY +; zlib data compression and ZIP file I/O library + +VERSION 1.2.7 + +EXPORTS + adler32 @1 + compress @2 + crc32 @3 + deflate @4 + deflateCopy @5 + deflateEnd @6 + deflateInit2_ @7 + deflateInit_ @8 + deflateParams @9 + deflateReset @10 + deflateSetDictionary @11 + gzclose @12 + gzdopen @13 + gzerror @14 + gzflush @15 + gzopen @16 + gzread @17 + gzwrite @18 + inflate @19 + inflateEnd @20 + inflateInit2_ @21 + inflateInit_ @22 + inflateReset @23 + inflateSetDictionary @24 + inflateSync @25 + uncompress @26 + zlibVersion @27 + gzprintf @28 + gzputc @29 + gzgetc @30 + gzseek @31 + gzrewind @32 + gztell @33 + gzeof @34 + gzsetparams @35 + zError @36 + inflateSyncPoint @37 + get_crc_table @38 + compress2 @39 + gzputs @40 + gzgets @41 + inflateCopy @42 + inflateBackInit_ @43 + inflateBack @44 + inflateBackEnd @45 + compressBound @46 + deflateBound @47 + gzclearerr @48 + gzungetc @49 + zlibCompileFlags @50 + deflatePrime @51 + deflatePending @52 + + unzOpen @61 + unzClose @62 + unzGetGlobalInfo @63 + unzGetCurrentFileInfo @64 + unzGoToFirstFile @65 + unzGoToNextFile @66 + unzOpenCurrentFile @67 + unzReadCurrentFile @68 + unzOpenCurrentFile3 @69 + unztell @70 + unzeof @71 + unzCloseCurrentFile @72 + unzGetGlobalComment @73 + unzStringFileNameCompare @74 + unzLocateFile @75 + unzGetLocalExtrafield @76 + unzOpen2 @77 + unzOpenCurrentFile2 @78 + unzOpenCurrentFilePassword @79 + + zipOpen @80 + zipOpenNewFileInZip @81 + zipWriteInFileInZip @82 + zipCloseFileInZip @83 + zipClose @84 + zipOpenNewFileInZip2 @86 + zipCloseFileInZipRaw @87 + zipOpen2 @88 + zipOpenNewFileInZip3 @89 + + unzGetFilePos @100 + unzGoToFilePos @101 + + fill_win32_filefunc @110 + +; zlibwapi v1.2.4 added: + fill_win32_filefunc64 @111 + fill_win32_filefunc64A @112 + fill_win32_filefunc64W @113 + + unzOpen64 @120 + unzOpen2_64 @121 + unzGetGlobalInfo64 @122 + unzGetCurrentFileInfo64 @124 + unzGetCurrentFileZStreamPos64 @125 + unztell64 @126 + unzGetFilePos64 @127 + unzGoToFilePos64 @128 + + zipOpen64 @130 + zipOpen2_64 @131 + zipOpenNewFileInZip64 @132 + zipOpenNewFileInZip2_64 @133 + zipOpenNewFileInZip3_64 @134 + zipOpenNewFileInZip4_64 @135 + zipCloseFileInZipRaw64 @136 + +; zlib1 v1.2.4 added: + adler32_combine @140 + crc32_combine @142 + deflateSetHeader @144 + deflateTune @145 + gzbuffer @146 + gzclose_r @147 + gzclose_w @148 + gzdirect @149 + gzoffset @150 + inflateGetHeader @156 + inflateMark @157 + inflatePrime @158 + inflateReset2 @159 + inflateUndermine @160 + +; zlib1 v1.2.6 added: + gzgetc_ @161 + inflateResetKeep @163 + deflateResetKeep @164 + +; zlib1 v1.2.7 added: + gzopen_w @165 diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.sln b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.sln new file mode 100644 index 0000000..649f40c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.sln @@ -0,0 +1,135 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcxproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlibdll", "testzlibdll.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcxproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcxproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Itanium = Debug|Itanium + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Itanium = Release|Itanium + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium + ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32 + ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.Build.0 = Debug|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.Build.0 = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj new file mode 100644 index 0000000..6430472 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj @@ -0,0 +1,681 @@ + + + + + Debug + Itanium + + + Debug + Win32 + + + Debug + x64 + + + ReleaseWithoutAsm + Itanium + + + ReleaseWithoutAsm + Win32 + + + ReleaseWithoutAsm + x64 + + + Release + Itanium + + + Release + Win32 + + + Release + x64 + + + + {8FD826F8-3739-44E6-8CC8-997122E53B8D} + + + + DynamicLibrary + false + true + + + DynamicLibrary + false + true + + + DynamicLibrary + false + + + DynamicLibrary + false + true + + + DynamicLibrary + false + true + + + DynamicLibrary + false + + + DynamicLibrary + false + true + + + DynamicLibrary + false + true + + + DynamicLibrary + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30128.1 + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + true + false + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + false + false + x86\ZlibDll$(Configuration)\ + x86\ZlibDll$(Configuration)\Tmp\ + false + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + true + false + ia64\ZlibDll$(Configuration)\ + ia64\ZlibDll$(Configuration)\Tmp\ + true + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + false + false + ia64\ZlibDll$(Configuration)\ + ia64\ZlibDll$(Configuration)\Tmp\ + false + false + x64\ZlibDll$(Configuration)\ + x64\ZlibDll$(Configuration)\Tmp\ + false + false + ia64\ZlibDll$(Configuration)\ + ia64\ZlibDll$(Configuration)\Tmp\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + zlibwapi + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + + + MultiThreadedDebug + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + + + cd ..\..\masmx86 +bld_ml32.bat + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + /MACHINE:I386 %(AdditionalOptions) + ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + false + + + $(OutDir)zlibwapi.lib + + + cd ..\..\masmx86 +bld_ml32.bat + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + cd ..\..\contrib\masmx64 +bld_ml64.bat + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Itanium + $(OutDir)zlibvc.tlb + + + Disabled + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + + + MultiThreadedDebugDLL + false + $(IntDir)zlibvc.pch + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + .\zlibvc.def + true + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineIA64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Itanium + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineIA64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineX64 + + + cd ..\..\masmx64 +bld_ml64.bat + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Itanium + $(OutDir)zlibvc.tlb + + + OnlyExplicitInline + ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + $(IntDir)zlibvc.pch + All + $(IntDir) + $(IntDir) + $(OutDir) + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x040c + + + $(OutDir)zlibwapi.dll + true + false + .\zlibvc.def + $(OutDir)zlibwapi.pdb + true + $(OutDir)zlibwapi.map + Windows + $(OutDir)zlibwapi.lib + MachineIA64 + + + + + + + + + + + + + + true + true + true + true + true + true + + + + + + + + + + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj.filters new file mode 100644 index 0000000..2278682 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc10/zlibvc.vcxproj.filters @@ -0,0 +1,118 @@ + + + + + {07934a85-8b61-443d-a0ee-b2eedb74f3cd} + cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90 + + + {1d99675b-433d-4a21-9e50-ed4ab8b19762} + h;hpp;hxx;hm;inl;fi;fd + + + {431c0958-fa71-44d0-9084-2d19d100c0cc} + ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/miniunz.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/miniunz.vcproj new file mode 100644 index 0000000..038a9e5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/miniunz.vcproj @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/minizip.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/minizip.vcproj new file mode 100644 index 0000000..ad40239 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/minizip.vcproj @@ -0,0 +1,562 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlib.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlib.vcproj new file mode 100644 index 0000000..c9f19d2 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlib.vcproj @@ -0,0 +1,852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlibdll.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlibdll.vcproj new file mode 100644 index 0000000..d7530fd --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/testzlibdll.vcproj @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlib.rc b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlib.rc new file mode 100644 index 0000000..3de60c5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlib.rc @@ -0,0 +1,32 @@ +#include + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 1.2.7,0 + PRODUCTVERSION 1.2.7,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" + VALUE "FileVersion", "1.2.7\0" + VALUE "InternalName", "zlib\0" + VALUE "OriginalFilename", "zlib.dll\0" + VALUE "ProductName", "ZLib.DLL\0" + VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" + VALUE "LegalCopyright", "(C) 1995-2012 Jean-loup Gailly & Mark Adler\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibstat.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibstat.vcproj new file mode 100644 index 0000000..d4ffb46 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibstat.vcproj @@ -0,0 +1,835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.def b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.def new file mode 100644 index 0000000..8bd5d99 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.def @@ -0,0 +1,139 @@ +LIBRARY +; zlib data compression and ZIP file I/O library + +VERSION 1.2.7 + +EXPORTS + adler32 @1 + compress @2 + crc32 @3 + deflate @4 + deflateCopy @5 + deflateEnd @6 + deflateInit2_ @7 + deflateInit_ @8 + deflateParams @9 + deflateReset @10 + deflateSetDictionary @11 + gzclose @12 + gzdopen @13 + gzerror @14 + gzflush @15 + gzopen @16 + gzread @17 + gzwrite @18 + inflate @19 + inflateEnd @20 + inflateInit2_ @21 + inflateInit_ @22 + inflateReset @23 + inflateSetDictionary @24 + inflateSync @25 + uncompress @26 + zlibVersion @27 + gzprintf @28 + gzputc @29 + gzgetc @30 + gzseek @31 + gzrewind @32 + gztell @33 + gzeof @34 + gzsetparams @35 + zError @36 + inflateSyncPoint @37 + get_crc_table @38 + compress2 @39 + gzputs @40 + gzgets @41 + inflateCopy @42 + inflateBackInit_ @43 + inflateBack @44 + inflateBackEnd @45 + compressBound @46 + deflateBound @47 + gzclearerr @48 + gzungetc @49 + zlibCompileFlags @50 + deflatePrime @51 + deflatePending @52 + + unzOpen @61 + unzClose @62 + unzGetGlobalInfo @63 + unzGetCurrentFileInfo @64 + unzGoToFirstFile @65 + unzGoToNextFile @66 + unzOpenCurrentFile @67 + unzReadCurrentFile @68 + unzOpenCurrentFile3 @69 + unztell @70 + unzeof @71 + unzCloseCurrentFile @72 + unzGetGlobalComment @73 + unzStringFileNameCompare @74 + unzLocateFile @75 + unzGetLocalExtrafield @76 + unzOpen2 @77 + unzOpenCurrentFile2 @78 + unzOpenCurrentFilePassword @79 + + zipOpen @80 + zipOpenNewFileInZip @81 + zipWriteInFileInZip @82 + zipCloseFileInZip @83 + zipClose @84 + zipOpenNewFileInZip2 @86 + zipCloseFileInZipRaw @87 + zipOpen2 @88 + zipOpenNewFileInZip3 @89 + + unzGetFilePos @100 + unzGoToFilePos @101 + + fill_win32_filefunc @110 + +; zlibwapi v1.2.4 added: + fill_win32_filefunc64 @111 + fill_win32_filefunc64A @112 + fill_win32_filefunc64W @113 + + unzOpen64 @120 + unzOpen2_64 @121 + unzGetGlobalInfo64 @122 + unzGetCurrentFileInfo64 @124 + unzGetCurrentFileZStreamPos64 @125 + unztell64 @126 + unzGetFilePos64 @127 + unzGoToFilePos64 @128 + + zipOpen64 @130 + zipOpen2_64 @131 + zipOpenNewFileInZip64 @132 + zipOpenNewFileInZip2_64 @133 + zipOpenNewFileInZip3_64 @134 + zipOpenNewFileInZip4_64 @135 + zipCloseFileInZipRaw64 @136 + +; zlib1 v1.2.4 added: + adler32_combine @140 + crc32_combine @142 + deflateSetHeader @144 + deflateTune @145 + gzbuffer @146 + gzclose_r @147 + gzclose_w @148 + gzdirect @149 + gzoffset @150 + inflateGetHeader @156 + inflateMark @157 + inflatePrime @158 + inflateReset2 @159 + inflateUndermine @160 + +; zlib1 v1.2.6 added: + gzgetc_ @161 + inflateResetKeep @163 + deflateResetKeep @164 + +; zlib1 v1.2.7 added: + gzopen_w @165 diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.sln b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.sln new file mode 100644 index 0000000..75c64c3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.sln @@ -0,0 +1,144 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestZlibDll", "testzlibdll.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}" + ProjectSection(ProjectDependencies) = postProject + {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}" + ProjectSection(ProjectDependencies) = postProject + {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}" + ProjectSection(ProjectDependencies) = postProject + {8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Itanium = Debug|Itanium + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Itanium = Release|Itanium + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium + ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32 + ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.Build.0 = Debug|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.Build.0 = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.vcproj b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.vcproj new file mode 100644 index 0000000..95bb241 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/contrib/vstudio/vc9/zlibvc.vcproj @@ -0,0 +1,1156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/crc32.c b/thirdparty/zlib/zlib-1.2.7/crc32.c new file mode 100644 index 0000000..979a719 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/crc32.c @@ -0,0 +1,425 @@ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Thanks to Rodney Brown for his contribution of faster + * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing + * tables for updating the shift register in one step with three exclusive-ors + * instead of four steps with four exclusive-ors. This results in about a + * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + */ + +/* @(#) $Id$ */ + +/* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). + + DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. + */ + +#ifdef MAKECRCH +# include +# ifndef DYNAMIC_CRC_TABLE +# define DYNAMIC_CRC_TABLE +# endif /* !DYNAMIC_CRC_TABLE */ +#endif /* MAKECRCH */ + +#include "zutil.h" /* for STDC and FAR definitions */ + +#define local static + +/* Definitions for doing the crc four data bytes at a time. */ +#if !defined(NOBYFOUR) && defined(Z_U4) +# define BYFOUR +#endif +#ifdef BYFOUR + local unsigned long crc32_little OF((unsigned long, + const unsigned char FAR *, unsigned)); + local unsigned long crc32_big OF((unsigned long, + const unsigned char FAR *, unsigned)); +# define TBLS 8 +#else +# define TBLS 1 +#endif /* BYFOUR */ + +/* Local functions for crc concatenation */ +local unsigned long gf2_matrix_times OF((unsigned long *mat, + unsigned long vec)); +local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); +local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2)); + + +#ifdef DYNAMIC_CRC_TABLE + +local volatile int crc_table_empty = 1; +local z_crc_t FAR crc_table[TBLS][256]; +local void make_crc_table OF((void)); +#ifdef MAKECRCH + local void write_table OF((FILE *, const z_crc_t FAR *)); +#endif /* MAKECRCH */ +/* + Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The first table is simply the CRC of all possible eight bit values. This is + all the information needed to generate CRCs on data a byte at a time for all + combinations of CRC register values and incoming bytes. The remaining tables + allow for word-at-a-time CRC calculation for both big-endian and little- + endian machines, where a word is four bytes. +*/ +local void make_crc_table() +{ + z_crc_t c; + int n, k; + z_crc_t poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static volatile int first = 1; /* flag to limit concurrent making */ + static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* See if another task is already doing this (not thread-safe, but better + than nothing -- significantly reduces duration of vulnerability in + case the advice about DYNAMIC_CRC_TABLE is ignored) */ + if (first) { + first = 0; + + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0; + for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++) + poly |= (z_crc_t)1 << (31 - p[n]); + + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (z_crc_t)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } + +#ifdef BYFOUR + /* generate crc for each value followed by one, two, and three zeros, + and then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = ZSWAP32(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = ZSWAP32(c); + } + } +#endif /* BYFOUR */ + + crc_table_empty = 0; + } + else { /* not first */ + /* wait for the other guy to finish (not efficient, but rare) */ + while (crc_table_empty) + ; + } + +#ifdef MAKECRCH + /* write out CRC tables to crc32.h */ + { + FILE *out; + + out = fopen("crc32.h", "w"); + if (out == NULL) return; + fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); + fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); + fprintf(out, "local const z_crc_t FAR "); + fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); + write_table(out, crc_table[0]); +# ifdef BYFOUR + fprintf(out, "#ifdef BYFOUR\n"); + for (k = 1; k < 8; k++) { + fprintf(out, " },\n {\n"); + write_table(out, crc_table[k]); + } + fprintf(out, "#endif\n"); +# endif /* BYFOUR */ + fprintf(out, " }\n};\n"); + fclose(out); + } +#endif /* MAKECRCH */ +} + +#ifdef MAKECRCH +local void write_table(out, table) + FILE *out; + const z_crc_t FAR *table; +{ + int n; + + for (n = 0; n < 256; n++) + fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", + (unsigned long)(table[n]), + n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); +} +#endif /* MAKECRCH */ + +#else /* !DYNAMIC_CRC_TABLE */ +/* ======================================================================== + * Tables of CRC-32s of all single-byte values, made by make_crc_table(). + */ +#include "crc32.h" +#endif /* DYNAMIC_CRC_TABLE */ + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const z_crc_t FAR * ZEXPORT get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + return (const z_crc_t FAR *)crc_table; +} + +/* ========================================================================= */ +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 + +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + uInt len; +{ + if (buf == Z_NULL) return 0UL; + +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + +#ifdef BYFOUR + if (sizeof(void *) == sizeof(ptrdiff_t)) { + z_crc_t endian; + + endian = 1; + if (*((unsigned char *)(&endian))) + return crc32_little(crc, buf, len); + else + return crc32_big(crc, buf, len); + } +#endif /* BYFOUR */ + crc = crc ^ 0xffffffffUL; + while (len >= 8) { + DO8; + len -= 8; + } + if (len) do { + DO1; + } while (--len); + return crc ^ 0xffffffffUL; +} + +#ifdef BYFOUR + +/* ========================================================================= */ +#define DOLIT4 c ^= *buf4++; \ + c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ + crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] +#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 + +/* ========================================================================= */ +local unsigned long crc32_little(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register z_crc_t c; + register const z_crc_t FAR *buf4; + + c = (z_crc_t)crc; + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + len--; + } + + buf4 = (const z_crc_t FAR *)(const void FAR *)buf; + while (len >= 32) { + DOLIT32; + len -= 32; + } + while (len >= 4) { + DOLIT4; + len -= 4; + } + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + } while (--len); + c = ~c; + return (unsigned long)c; +} + +/* ========================================================================= */ +#define DOBIG4 c ^= *++buf4; \ + c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ + crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] +#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 + +/* ========================================================================= */ +local unsigned long crc32_big(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register z_crc_t c; + register const z_crc_t FAR *buf4; + + c = ZSWAP32((z_crc_t)crc); + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + len--; + } + + buf4 = (const z_crc_t FAR *)(const void FAR *)buf; + buf4--; + while (len >= 32) { + DOBIG32; + len -= 32; + } + while (len >= 4) { + DOBIG4; + len -= 4; + } + buf4++; + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + } while (--len); + c = ~c; + return (unsigned long)(ZSWAP32(c)); +} + +#endif /* BYFOUR */ + +#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ + +/* ========================================================================= */ +local unsigned long gf2_matrix_times(mat, vec) + unsigned long *mat; + unsigned long vec; +{ + unsigned long sum; + + sum = 0; + while (vec) { + if (vec & 1) + sum ^= *mat; + vec >>= 1; + mat++; + } + return sum; +} + +/* ========================================================================= */ +local void gf2_matrix_square(square, mat) + unsigned long *square; + unsigned long *mat; +{ + int n; + + for (n = 0; n < GF2_DIM; n++) + square[n] = gf2_matrix_times(mat, mat[n]); +} + +/* ========================================================================= */ +local uLong crc32_combine_(crc1, crc2, len2) + uLong crc1; + uLong crc2; + z_off64_t len2; +{ + int n; + unsigned long row; + unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ + unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ + + /* degenerate case (also disallow negative lengths) */ + if (len2 <= 0) + return crc1; + + /* put operator for one zero bit in odd */ + odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ + row = 1; + for (n = 1; n < GF2_DIM; n++) { + odd[n] = row; + row <<= 1; + } + + /* put operator for two zero bits in even */ + gf2_matrix_square(even, odd); + + /* put operator for four zero bits in odd */ + gf2_matrix_square(odd, even); + + /* apply len2 zeros to crc1 (first square will put the operator for one + zero byte, eight zero bits, in even) */ + do { + /* apply zeros operator for this bit of len2 */ + gf2_matrix_square(even, odd); + if (len2 & 1) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + if (len2 == 0) + break; + + /* another iteration of the loop with odd and even swapped */ + gf2_matrix_square(odd, even); + if (len2 & 1) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + } while (len2 != 0); + + /* return combined crc */ + crc1 ^= crc2; + return crc1; +} + +/* ========================================================================= */ +uLong ZEXPORT crc32_combine(crc1, crc2, len2) + uLong crc1; + uLong crc2; + z_off_t len2; +{ + return crc32_combine_(crc1, crc2, len2); +} + +uLong ZEXPORT crc32_combine64(crc1, crc2, len2) + uLong crc1; + uLong crc2; + z_off64_t len2; +{ + return crc32_combine_(crc1, crc2, len2); +} diff --git a/thirdparty/zlib/zlib-1.2.7/crc32.h b/thirdparty/zlib/zlib-1.2.7/crc32.h new file mode 100644 index 0000000..9e0c778 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/crc32.h @@ -0,0 +1,441 @@ +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +local const z_crc_t FAR crc_table[TBLS][256] = +{ + { + 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, + 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, + 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, + 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, + 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, + 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, + 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, + 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, + 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, + 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, + 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, + 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, + 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, + 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, + 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, + 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, + 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, + 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, + 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, + 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, + 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, + 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, + 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, + 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, + 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, + 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, + 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, + 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, + 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, + 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, + 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, + 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, + 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, + 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, + 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, + 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, + 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, + 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, + 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, + 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, + 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, + 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, + 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, + 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, + 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, + 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, + 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, + 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, + 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, + 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, + 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, + 0x2d02ef8dUL +#ifdef BYFOUR + }, + { + 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, + 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, + 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, + 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, + 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, + 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, + 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, + 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, + 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, + 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, + 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, + 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, + 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, + 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, + 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, + 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, + 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, + 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, + 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, + 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, + 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, + 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, + 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, + 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, + 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, + 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, + 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, + 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, + 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, + 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, + 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, + 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, + 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, + 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, + 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, + 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, + 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, + 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, + 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, + 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, + 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, + 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, + 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, + 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, + 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, + 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, + 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, + 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, + 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, + 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, + 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, + 0x9324fd72UL + }, + { + 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, + 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, + 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, + 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, + 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, + 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, + 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, + 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, + 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, + 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, + 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, + 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, + 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, + 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, + 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, + 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, + 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, + 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, + 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, + 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, + 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, + 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, + 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, + 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, + 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, + 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, + 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, + 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, + 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, + 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, + 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, + 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, + 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, + 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, + 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, + 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, + 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, + 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, + 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, + 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, + 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, + 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, + 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, + 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, + 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, + 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, + 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, + 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, + 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, + 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, + 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, + 0xbe9834edUL + }, + { + 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, + 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, + 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, + 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, + 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, + 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, + 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, + 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, + 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, + 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, + 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, + 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, + 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, + 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, + 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, + 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, + 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, + 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, + 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, + 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, + 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, + 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, + 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, + 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, + 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, + 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, + 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, + 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, + 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, + 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, + 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, + 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, + 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, + 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, + 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, + 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, + 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, + 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, + 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, + 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, + 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, + 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, + 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, + 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, + 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, + 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, + 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, + 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, + 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, + 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, + 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, + 0xde0506f1UL + }, + { + 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, + 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, + 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, + 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, + 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, + 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, + 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, + 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, + 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, + 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, + 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, + 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, + 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, + 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, + 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, + 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, + 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, + 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, + 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, + 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, + 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, + 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, + 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, + 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, + 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, + 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, + 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, + 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, + 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, + 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, + 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, + 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, + 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, + 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, + 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, + 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, + 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, + 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, + 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, + 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, + 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, + 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, + 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, + 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, + 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, + 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, + 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, + 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, + 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, + 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, + 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, + 0x8def022dUL + }, + { + 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, + 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, + 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, + 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, + 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, + 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, + 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, + 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, + 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, + 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, + 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, + 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, + 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, + 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, + 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, + 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, + 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, + 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, + 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, + 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, + 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, + 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, + 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, + 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, + 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, + 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, + 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, + 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, + 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, + 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, + 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, + 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, + 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, + 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, + 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, + 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, + 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, + 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, + 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, + 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, + 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, + 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, + 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, + 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, + 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, + 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, + 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, + 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, + 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, + 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, + 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, + 0x72fd2493UL + }, + { + 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, + 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, + 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, + 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, + 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, + 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, + 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, + 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, + 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, + 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, + 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, + 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, + 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, + 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, + 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, + 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, + 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, + 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, + 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, + 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, + 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, + 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, + 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, + 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, + 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, + 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, + 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, + 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, + 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, + 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, + 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, + 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, + 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, + 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, + 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, + 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, + 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, + 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, + 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, + 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, + 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, + 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, + 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, + 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, + 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, + 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, + 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, + 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, + 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, + 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, + 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, + 0xed3498beUL + }, + { + 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, + 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, + 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, + 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, + 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, + 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, + 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, + 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, + 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, + 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, + 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, + 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, + 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, + 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, + 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, + 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, + 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, + 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, + 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, + 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, + 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, + 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, + 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, + 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, + 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, + 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, + 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, + 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, + 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, + 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, + 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, + 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, + 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, + 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, + 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, + 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, + 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, + 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, + 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, + 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, + 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, + 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, + 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, + 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, + 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, + 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, + 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, + 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, + 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, + 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, + 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, + 0xf10605deUL +#endif + } +}; diff --git a/thirdparty/zlib/zlib-1.2.7/deflate.c b/thirdparty/zlib/zlib-1.2.7/deflate.c new file mode 100644 index 0000000..9e4c2cb --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/deflate.c @@ -0,0 +1,1965 @@ +/* deflate.c -- compress data using the deflation algorithm + * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process depends on being able to identify portions + * of the input text which are identical to earlier input (within a + * sliding window trailing behind the input currently being processed). + * + * The most straightforward technique turns out to be the fastest for + * most input files: try all possible matches and select the longest. + * The key feature of this algorithm is that insertions into the string + * dictionary are very simple and thus fast, and deletions are avoided + * completely. Insertions are performed at each input character, whereas + * string matches are performed only when the previous match ends. So it + * is preferable to spend more time in matches to allow very fast string + * insertions and avoid deletions. The matching algorithm for small + * strings is inspired from that of Rabin & Karp. A brute force approach + * is used to find longer strings when a small match has been found. + * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze + * (by Leonid Broukhis). + * A previous version of this file used a more sophisticated algorithm + * (by Fiala and Greene) which is guaranteed to run in linear amortized + * time, but has a larger average cost, uses more memory and is patented. + * However the F&G algorithm may be faster for some highly redundant + * files if the parameter max_chain_length (described below) is too large. + * + * ACKNOWLEDGEMENTS + * + * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and + * I found it in 'freeze' written by Leonid Broukhis. + * Thanks to many people for bug reports and testing. + * + * REFERENCES + * + * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". + * Available in http://tools.ietf.org/html/rfc1951 + * + * A description of the Rabin and Karp algorithm is given in the book + * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. + * + * Fiala,E.R., and Greene,D.H. + * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 + * + */ + +/* @(#) $Id$ */ + +#include "deflate.h" + +const char deflate_copyright[] = + " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* =========================================================================== + * Function prototypes. + */ +typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ +} block_state; + +typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +/* Compression function. Returns the block state after the call. */ + +local void fill_window OF((deflate_state *s)); +local block_state deflate_stored OF((deflate_state *s, int flush)); +local block_state deflate_fast OF((deflate_state *s, int flush)); +#ifndef FASTEST +local block_state deflate_slow OF((deflate_state *s, int flush)); +#endif +local block_state deflate_rle OF((deflate_state *s, int flush)); +local block_state deflate_huff OF((deflate_state *s, int flush)); +local void lm_init OF((deflate_state *s)); +local void putShortMSB OF((deflate_state *s, uInt b)); +local void flush_pending OF((z_streamp strm)); +local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +#ifdef ASMV + void match_init OF((void)); /* asm code initialization */ + uInt longest_match OF((deflate_state *s, IPos cur_match)); +#else +local uInt longest_match OF((deflate_state *s, IPos cur_match)); +#endif + +#ifdef DEBUG +local void check_match OF((deflate_state *s, IPos start, IPos match, + int length)); +#endif + +/* =========================================================================== + * Local data + */ + +#define NIL 0 +/* Tail of hash chains */ + +#ifndef TOO_FAR +# define TOO_FAR 4096 +#endif +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +typedef struct config_s { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; + compress_func func; +} config; + +#ifdef FASTEST +local const config configuration_table[2] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ +#else +local const config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8, deflate_fast}, +/* 3 */ {4, 6, 32, 32, deflate_fast}, + +/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32, deflate_slow}, +/* 6 */ {8, 16, 128, 128, deflate_slow}, +/* 7 */ {8, 32, 128, 256, deflate_slow}, +/* 8 */ {32, 128, 258, 1024, deflate_slow}, +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ +#endif + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +#define EQUAL 0 +/* result of memcmp for equal strings */ + +#ifndef NO_DUMMY_DECL +struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ +#endif + +/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ +#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to to UPDATE_HASH are made with consecutive + * input characters, so that a running hash key can be computed from the + * previous key instead of complete recalculation each time. + */ +#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) + + +/* =========================================================================== + * Insert string str in the dictionary and set match_head to the previous head + * of the hash chain (the most recent string with same hash key). Return + * the previous length of the hash chain. + * If this file is compiled with -DFASTEST, the compression level is forced + * to 1, and no hash chains are maintained. + * IN assertion: all calls to to INSERT_STRING are made with consecutive + * input characters and the first MIN_MATCH bytes of str are valid + * (except for the last MIN_MATCH-1 bytes of the input file). + */ +#ifdef FASTEST +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#else +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#endif + +/* =========================================================================== + * Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ +#define CLEAR_HASH(s) \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + +/* ========================================================================= */ +int ZEXPORT deflateInit_(strm, level, version, stream_size) + z_streamp strm; + int level; + const char *version; + int stream_size; +{ + return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY, version, stream_size); + /* To do: ignore strm->next_in if we use it as window */ +} + +/* ========================================================================= */ +int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, + version, stream_size) + z_streamp strm; + int level; + int method; + int windowBits; + int memLevel; + int strategy; + const char *version; + int stream_size; +{ + deflate_state *s; + int wrap = 1; + static const char my_version[] = ZLIB_VERSION; + + ushf *overlay; + /* We overlay pending_buf and d_buf+l_buf. This works since the average + * output size for (length,distance) codes is <= 24 bits. + */ + + if (version == Z_NULL || version[0] != my_version[0] || + stream_size != sizeof(z_stream)) { + return Z_VERSION_ERROR; + } + if (strm == Z_NULL) return Z_STREAM_ERROR; + + strm->msg = Z_NULL; + if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; +#endif + } + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } +#ifdef GZIP + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } +#endif + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ + s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == Z_NULL) return Z_MEM_ERROR; + strm->state = (struct internal_state FAR *)s; + s->strm = strm; + + s->wrap = wrap; + s->gzhead = Z_NULL; + s->w_bits = windowBits; + s->w_size = 1 << s->w_bits; + s->w_mask = s->w_size - 1; + + s->hash_bits = memLevel + 7; + s->hash_size = 1 << s->hash_bits; + s->hash_mask = s->hash_size - 1; + s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + + s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + + s->high_water = 0; /* nothing written to s->window yet */ + + s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + s->pending_buf = (uchf *) overlay; + s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + + if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || + s->pending_buf == Z_NULL) { + s->status = FINISH_STATE; + strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + deflateEnd (strm); + return Z_MEM_ERROR; + } + s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + + s->level = level; + s->strategy = strategy; + s->method = (Byte)method; + + return deflateReset(strm); +} + +/* ========================================================================= */ +int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) + z_streamp strm; + const Bytef *dictionary; + uInt dictLength; +{ + deflate_state *s; + uInt str, n; + int wrap; + unsigned avail; + unsigned char *next; + + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + return Z_STREAM_ERROR; + s = strm->state; + wrap = s->wrap; + if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead) + return Z_STREAM_ERROR; + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap == 1) + strm->adler = adler32(strm->adler, dictionary, dictLength); + s->wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s->w_size) { + if (wrap == 0) { /* already empty otherwise */ + CLEAR_HASH(s); + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + dictionary += dictLength - s->w_size; /* use the tail */ + dictLength = s->w_size; + } + + /* insert dictionary into window and hash */ + avail = strm->avail_in; + next = strm->next_in; + strm->avail_in = dictLength; + strm->next_in = (Bytef *)dictionary; + fill_window(s); + while (s->lookahead >= MIN_MATCH) { + str = s->strstart; + n = s->lookahead - (MIN_MATCH-1); + do { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + } while (--n); + s->strstart = str; + s->lookahead = MIN_MATCH-1; + fill_window(s); + } + s->strstart += s->lookahead; + s->block_start = (long)s->strstart; + s->insert = s->lookahead; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + strm->next_in = next; + strm->avail_in = avail; + s->wrap = wrap; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateResetKeep (strm) + z_streamp strm; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { + return Z_STREAM_ERROR; + } + + strm->total_in = strm->total_out = 0; + strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = Z_UNKNOWN; + + s = (deflate_state *)strm->state; + s->pending = 0; + s->pending_out = s->pending_buf; + + if (s->wrap < 0) { + s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ + } + s->status = s->wrap ? INIT_STATE : BUSY_STATE; + strm->adler = +#ifdef GZIP + s->wrap == 2 ? crc32(0L, Z_NULL, 0) : +#endif + adler32(0L, Z_NULL, 0); + s->last_flush = Z_NO_FLUSH; + + _tr_init(s); + + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateReset (strm) + z_streamp strm; +{ + int ret; + + ret = deflateResetKeep(strm); + if (ret == Z_OK) + lm_init(strm->state); + return ret; +} + +/* ========================================================================= */ +int ZEXPORT deflateSetHeader (strm, head) + z_streamp strm; + gz_headerp head; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm->state->wrap != 2) return Z_STREAM_ERROR; + strm->state->gzhead = head; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflatePending (strm, pending, bits) + unsigned *pending; + int *bits; + z_streamp strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (pending != Z_NULL) + *pending = strm->state->pending; + if (bits != Z_NULL) + *bits = strm->state->bi_valid; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflatePrime (strm, bits, value) + z_streamp strm; + int bits; + int value; +{ + deflate_state *s; + int put; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; + do { + put = Buf_size - s->bi_valid; + if (put > bits) + put = bits; + s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid); + s->bi_valid += put; + _tr_flush_bits(s); + value >>= put; + bits -= put; + } while (bits); + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateParams(strm, level, strategy) + z_streamp strm; + int level; + int strategy; +{ + deflate_state *s; + compress_func func; + int err = Z_OK; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + func = configuration_table[s->level].func; + + if ((strategy != s->strategy || func != configuration_table[level].func) && + strm->total_in != 0) { + /* Flush the last buffer: */ + err = deflate(strm, Z_BLOCK); + } + if (s->level != level) { + s->level = level; + s->max_lazy_match = configuration_table[level].max_lazy; + s->good_match = configuration_table[level].good_length; + s->nice_match = configuration_table[level].nice_length; + s->max_chain_length = configuration_table[level].max_chain; + } + s->strategy = strategy; + return err; +} + +/* ========================================================================= */ +int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) + z_streamp strm; + int good_length; + int max_lazy; + int nice_length; + int max_chain; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + s->good_match = good_length; + s->max_lazy_match = max_lazy; + s->nice_match = nice_length; + s->max_chain_length = max_chain; + return Z_OK; +} + +/* ========================================================================= + * For the default windowBits of 15 and memLevel of 8, this function returns + * a close to exact, as well as small, upper bound on the compressed size. + * They are coded as constants here for a reason--if the #define's are + * changed, then this function needs to be changed as well. The return + * value for 15 and 8 only works for those exact settings. + * + * For any setting other than those defaults for windowBits and memLevel, + * the value returned is a conservative worst case for the maximum expansion + * resulting from using fixed blocks instead of stored blocks, which deflate + * can emit on compressed data for some combinations of the parameters. + * + * This function could be more sophisticated to provide closer upper bounds for + * every combination of windowBits and memLevel. But even the conservative + * upper bound of about 14% expansion does not seem onerous for output buffer + * allocation. + */ +uLong ZEXPORT deflateBound(strm, sourceLen) + z_streamp strm; + uLong sourceLen; +{ + deflate_state *s; + uLong complen, wraplen; + Bytef *str; + + /* conservative upper bound for compressed data */ + complen = sourceLen + + ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + + /* if can't get parameters, return conservative bound plus zlib wrapper */ + if (strm == Z_NULL || strm->state == Z_NULL) + return complen + 6; + + /* compute wrapper length */ + s = strm->state; + switch (s->wrap) { + case 0: /* raw deflate */ + wraplen = 0; + break; + case 1: /* zlib wrapper */ + wraplen = 6 + (s->strstart ? 4 : 0); + break; + case 2: /* gzip wrapper */ + wraplen = 18; + if (s->gzhead != Z_NULL) { /* user-supplied gzip header */ + if (s->gzhead->extra != Z_NULL) + wraplen += 2 + s->gzhead->extra_len; + str = s->gzhead->name; + if (str != Z_NULL) + do { + wraplen++; + } while (*str++); + str = s->gzhead->comment; + if (str != Z_NULL) + do { + wraplen++; + } while (*str++); + if (s->gzhead->hcrc) + wraplen += 2; + } + break; + default: /* for compiler happiness */ + wraplen = 6; + } + + /* if not default parameters, return conservative bound */ + if (s->w_bits != 15 || s->hash_bits != 8 + 7) + return complen + wraplen; + + /* default settings: return tight bound for that case */ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + + (sourceLen >> 25) + 13 - 6 + wraplen; +} + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +local void putShortMSB (s, b) + deflate_state *s; + uInt b; +{ + put_byte(s, (Byte)(b >> 8)); + put_byte(s, (Byte)(b & 0xff)); +} + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->next_out buffer and copying into it. + * (See also read_buf()). + */ +local void flush_pending(strm) + z_streamp strm; +{ + unsigned len; + deflate_state *s = strm->state; + + _tr_flush_bits(s); + len = s->pending; + if (len > strm->avail_out) len = strm->avail_out; + if (len == 0) return; + + zmemcpy(strm->next_out, s->pending_out, len); + strm->next_out += len; + s->pending_out += len; + strm->total_out += len; + strm->avail_out -= len; + s->pending -= len; + if (s->pending == 0) { + s->pending_out = s->pending_buf; + } +} + +/* ========================================================================= */ +int ZEXPORT deflate (strm, flush) + z_streamp strm; + int flush; +{ + int old_flush; /* value of flush param for previous deflate call */ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + flush > Z_BLOCK || flush < 0) { + return Z_STREAM_ERROR; + } + s = strm->state; + + if (strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0) || + (s->status == FINISH_STATE && flush != Z_FINISH)) { + ERR_RETURN(strm, Z_STREAM_ERROR); + } + if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + + s->strm = strm; /* just in case */ + old_flush = s->last_flush; + s->last_flush = flush; + + /* Write the header */ + if (s->status == INIT_STATE) { +#ifdef GZIP + if (s->wrap == 2) { + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == Z_NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s->status = BUSY_STATE; + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != Z_NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); + } + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; + } + } + else +#endif + { + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; + else + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + s->status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + } + } +#ifdef GZIP + if (s->status == EXTRA_STATE) { + if (s->gzhead->extra != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + + while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) + break; + } + put_byte(s, s->gzhead->extra[s->gzindex]); + s->gzindex++; + } + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (s->gzindex == s->gzhead->extra_len) { + s->gzindex = 0; + s->status = NAME_STATE; + } + } + else + s->status = NAME_STATE; + } + if (s->status == NAME_STATE) { + if (s->gzhead->name != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->name[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) { + s->gzindex = 0; + s->status = COMMENT_STATE; + } + } + else + s->status = COMMENT_STATE; + } + if (s->status == COMMENT_STATE) { + if (s->gzhead->comment != Z_NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->comment[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) + s->status = HCRC_STATE; + } + else + s->status = HCRC_STATE; + } + if (s->status == HCRC_STATE) { + if (s->gzhead->hcrc) { + if (s->pending + 2 > s->pending_buf_size) + flush_pending(strm); + if (s->pending + 2 <= s->pending_buf_size) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + } + } + else + s->status = BUSY_STATE; + } +#endif + + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm->avail_in != 0 || s->lookahead != 0 || + (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + block_state bstate; + + bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : + (s->strategy == Z_RLE ? deflate_rle(s, flush) : + (*(configuration_table[s->level].func))(s, flush)); + + if (bstate == finish_started || bstate == finish_done) { + s->status = FINISH_STATE; + } + if (bstate == need_more || bstate == finish_started) { + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate == block_done) { + if (flush == Z_PARTIAL_FLUSH) { + _tr_align(s); + } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + _tr_stored_block(s, (char*)0, 0L, 0); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush == Z_FULL_FLUSH) { + CLEAR_HASH(s); /* forget history */ + if (s->lookahead == 0) { + s->strstart = 0; + s->block_start = 0L; + s->insert = 0; + } + } + } + flush_pending(strm); + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + Assert(strm->avail_out > 0, "bug2"); + + if (flush != Z_FINISH) return Z_OK; + if (s->wrap <= 0) return Z_STREAM_END; + + /* Write the trailer */ +#ifdef GZIP + if (s->wrap == 2) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); + put_byte(s, (Byte)(strm->total_in & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); + } + else +#endif + { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ + return s->pending != 0 ? Z_OK : Z_STREAM_END; +} + +/* ========================================================================= */ +int ZEXPORT deflateEnd (strm) + z_streamp strm; +{ + int status; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + + status = strm->state->status; + if (status != INIT_STATE && + status != EXTRA_STATE && + status != NAME_STATE && + status != COMMENT_STATE && + status != HCRC_STATE && + status != BUSY_STATE && + status != FINISH_STATE) { + return Z_STREAM_ERROR; + } + + /* Deallocate in reverse order of allocations: */ + TRY_FREE(strm, strm->state->pending_buf); + TRY_FREE(strm, strm->state->head); + TRY_FREE(strm, strm->state->prev); + TRY_FREE(strm, strm->state->window); + + ZFREE(strm, strm->state); + strm->state = Z_NULL; + + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; +} + +/* ========================================================================= + * Copy the source state to the destination state. + * To simplify the source, this is not supported for 16-bit MSDOS (which + * doesn't have enough memory anyway to duplicate compression states). + */ +int ZEXPORT deflateCopy (dest, source) + z_streamp dest; + z_streamp source; +{ +#ifdef MAXSEG_64K + return Z_STREAM_ERROR; +#else + deflate_state *ds; + deflate_state *ss; + ushf *overlay; + + + if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + return Z_STREAM_ERROR; + } + + ss = source->state; + + zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); + + ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); + if (ds == Z_NULL) return Z_MEM_ERROR; + dest->state = (struct internal_state FAR *) ds; + zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state)); + ds->strm = dest; + + ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); + ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); + ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); + overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); + ds->pending_buf = (uchf *) overlay; + + if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || + ds->pending_buf == Z_NULL) { + deflateEnd (dest); + return Z_MEM_ERROR; + } + /* following zmemcpy do not work for 16-bit MSDOS */ + zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); + zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); + zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); + zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + + ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); + ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); + ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; + + ds->l_desc.dyn_tree = ds->dyn_ltree; + ds->d_desc.dyn_tree = ds->dyn_dtree; + ds->bl_desc.dyn_tree = ds->bl_tree; + + return Z_OK; +#endif /* MAXSEG_64K */ +} + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local int read_buf(strm, buf, size) + z_streamp strm; + Bytef *buf; + unsigned size; +{ + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + zmemcpy(buf, strm->next_in, len); + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, buf, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, buf, len); + } +#endif + strm->next_in += len; + strm->total_in += len; + + return (int)len; +} + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init (s) + deflate_state *s; +{ + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->insert = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +#ifndef FASTEST +#ifdef ASMV + match_init(); /* initialize the asm code */ +#endif +#endif +} + +#ifndef FASTEST +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +#ifndef ASMV +/* For 80x86 and 680x0, an optimized version will be provided in match.asm or + * match.S. The code will be functionally equivalent. + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + unsigned chain_length = s->max_chain_length;/* max hash chain length */ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + int best_len = s->prev_length; /* best match length so far */ + int nice_match = s->nice_match; /* stop if match long enough */ + IPos limit = s->strstart > (IPos)MAX_DIST(s) ? + s->strstart - (IPos)MAX_DIST(s) : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + Posf *prev = s->prev; + uInt wmask = s->w_mask; + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + register ush scan_start = *(ushf*)scan; + register ush scan_end = *(ushf*)(scan+best_len-1); +#else + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end = scan[best_len]; +#endif + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s->prev_length >= s->good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + Assert(cur_match < s->strstart, "no future"); + match = s->window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ushf*)(match+best_len-1) != scan_end || + *(ushf*)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + Assert(scan[2] == match[2], "scan[2]?"); + scan++, match++; + do { + } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + s->match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ushf*)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & wmask]) > limit + && --chain_length != 0); + + if ((uInt)best_len <= s->lookahead) return (uInt)best_len; + return s->lookahead; +} +#endif /* ASMV */ + +#else /* FASTEST */ + +/* --------------------------------------------------------------------------- + * Optimized version for FASTEST only + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + Assert(cur_match < s->strstart, "no future"); + + match = s->window + cur_match; + + /* Return failure if the match length is less than 2: + */ + if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match += 2; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + + if (len < MIN_MATCH) return MIN_MATCH - 1; + + s->match_start = cur_match; + return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; +} + +#endif /* FASTEST */ + +#ifdef DEBUG +/* =========================================================================== + * Check that the match at match_start is indeed a match. + */ +local void check_match(s, start, match, length) + deflate_state *s; + IPos start, match; + int length; +{ + /* check that the match is indeed a match */ + if (zmemcmp(s->window + match, + s->window + start, length) != EQUAL) { + fprintf(stderr, " start %u, match %u, length %d\n", + start, match, length); + do { + fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); + } while (--length != 0); + z_error("invalid match"); + } + if (z_verbose > 1) { + fprintf(stderr,"\\[%d,%d]", start-match, length); + do { putc(s->window[start++], stderr); } while (--length != 0); + } +} +#else +# define check_match(s, start, match, length) +#endif /* DEBUG */ + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(s) + deflate_state *s; +{ + register unsigned n, m; + register Posf *p; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize+MAX_DIST(s)) { + + zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + } while (--n); + + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif + more += wsize; + } + if (s->strm->avail_in == 0) break; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead + s->insert >= MIN_MATCH) { + uInt str = s->strstart - s->insert; + s->ins_h = s->window[str]; + UPDATE_HASH(s, s->ins_h, s->window[str + 1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + while (s->insert) { + UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); +#ifndef FASTEST + s->prev[str & s->w_mask] = s->head[s->ins_h]; +#endif + s->head[s->ins_h] = (Pos)str; + str++; + s->insert--; + if (s->lookahead + s->insert < MIN_MATCH) + break; + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ + if (s->high_water < s->window_size) { + ulg curr = s->strstart + (ulg)(s->lookahead); + ulg init; + + if (s->high_water < curr) { + /* Previous high water mark below current data -- zero WIN_INIT + * bytes or up to end of window, whichever is less. + */ + init = s->window_size - curr; + if (init > WIN_INIT) + init = WIN_INIT; + zmemzero(s->window + curr, (unsigned)init); + s->high_water = curr + init; + } + else if (s->high_water < (ulg)curr + WIN_INIT) { + /* High water mark at or above current data, but below current data + * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up + * to end of window, whichever is less. + */ + init = (ulg)curr + WIN_INIT - s->high_water; + if (init > s->window_size - s->high_water) + init = s->window_size - s->high_water; + zmemzero(s->window + s->high_water, (unsigned)init); + s->high_water += init; + } + } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK_ONLY(s, last) { \ + _tr_flush_block(s, (s->block_start >= 0L ? \ + (charf *)&s->window[(unsigned)s->block_start] : \ + (charf *)Z_NULL), \ + (ulg)((long)s->strstart - s->block_start), \ + (last)); \ + s->block_start = s->strstart; \ + flush_pending(s->strm); \ + Tracev((stderr,"[FLUSH]")); \ +} + +/* Same but force premature exit if necessary. */ +#define FLUSH_BLOCK(s, last) { \ + FLUSH_BLOCK_ONLY(s, last); \ + if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +local block_state deflate_stored(s, flush) + deflate_state *s; + int flush; +{ + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + ulg max_block_size = 0xffff; + ulg max_start; + + if (max_block_size > s->pending_buf_size - 5) { + max_block_size = s->pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s->lookahead <= 1) { + + Assert(s->strstart < s->w_size+MAX_DIST(s) || + s->block_start >= (long)s->w_size, "slide too late"); + + fill_window(s); + if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + + if (s->lookahead == 0) break; /* flush the current block */ + } + Assert(s->block_start >= 0L, "block gone"); + + s->strstart += s->lookahead; + s->lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + max_start = s->block_start + max_block_size; + if (s->strstart == 0 || (ulg)s->strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s->lookahead = (uInt)(s->strstart - max_start); + s->strstart = (uInt)max_start; + FLUSH_BLOCK(s, 0); + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { + FLUSH_BLOCK(s, 0); + } + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if ((long)s->strstart > s->block_start) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +local block_state deflate_fast(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head; /* head of the hash chain */ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + } + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->match_start, s->match_length); + + _tr_tally_dist(s, s->strstart - s->match_start, + s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +#ifndef FASTEST + if (s->match_length <= s->max_insert_length && + s->lookahead >= MIN_MATCH) { + s->match_length--; /* string at strstart already in table */ + do { + s->strstart++; + INSERT_STRING(s, s->strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s->match_length != 0); + s->strstart++; + } else +#endif + { + s->strstart += s->match_length; + s->match_length = 0; + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +#ifndef FASTEST +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +local block_state deflate_slow(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head; /* head of hash chain */ + int bflush; /* set if current block must be flushed */ + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = NIL; + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + */ + s->prev_length = s->match_length, s->prev_match = s->match_start; + s->match_length = MIN_MATCH-1; + + if (hash_head != NIL && s->prev_length < s->max_lazy_match && + s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s->match_length = longest_match (s, hash_head); + /* longest_match() sets match_start */ + + if (s->match_length <= 5 && (s->strategy == Z_FILTERED +#if TOO_FAR <= 32767 + || (s->match_length == MIN_MATCH && + s->strstart - s->match_start > TOO_FAR) +#endif + )) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s->match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { + uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + check_match(s, s->strstart-1, s->prev_match, s->prev_length); + + _tr_tally_dist(s, s->strstart -1 - s->prev_match, + s->prev_length - MIN_MATCH, bflush); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s->lookahead -= s->prev_length-1; + s->prev_length -= 2; + do { + if (++s->strstart <= max_insert) { + INSERT_STRING(s, s->strstart, hash_head); + } + } while (--s->prev_length != 0); + s->match_available = 0; + s->match_length = MIN_MATCH-1; + s->strstart++; + + if (bflush) FLUSH_BLOCK(s, 0); + + } else if (s->match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + if (bflush) { + FLUSH_BLOCK_ONLY(s, 0); + } + s->strstart++; + s->lookahead--; + if (s->strm->avail_out == 0) return need_more; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s->match_available = 1; + s->strstart++; + s->lookahead--; + } + } + Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s->match_available) { + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + s->match_available = 0; + } + s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} +#endif /* FASTEST */ + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +local block_state deflate_rle(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + uInt prev; /* byte at distance one to match */ + Bytef *scan, *strend; /* scan goes up to strend for length of run */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s->lookahead <= MAX_MATCH) { + fill_window(s); + if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s->match_length = 0; + if (s->lookahead >= MIN_MATCH && s->strstart > 0) { + scan = s->window + s->strstart - 1; + prev = *scan; + if (prev == *++scan && prev == *++scan && prev == *++scan) { + strend = s->window + s->strstart + MAX_MATCH; + do { + } while (prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + prev == *++scan && prev == *++scan && + scan < strend); + s->match_length = MAX_MATCH - (int)(strend - scan); + if (s->match_length > s->lookahead) + s->match_length = s->lookahead; + } + Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->strstart - 1, s->match_length); + + _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + s->strstart += s->match_length; + s->match_length = 0; + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +local block_state deflate_huff(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s->lookahead == 0) { + fill_window(s); + if (s->lookahead == 0) { + if (flush == Z_NO_FLUSH) + return need_more; + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s->match_length = 0; + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + if (bflush) FLUSH_BLOCK(s, 0); + } + s->insert = 0; + if (flush == Z_FINISH) { + FLUSH_BLOCK(s, 1); + return finish_done; + } + if (s->last_lit) + FLUSH_BLOCK(s, 0); + return block_done; +} diff --git a/thirdparty/zlib/zlib-1.2.7/deflate.h b/thirdparty/zlib/zlib-1.2.7/deflate.h new file mode 100644 index 0000000..fbac44d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/deflate.h @@ -0,0 +1,346 @@ +/* deflate.h -- internal compression state + * Copyright (C) 1995-2012 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef DEFLATE_H +#define DEFLATE_H + +#include "zutil.h" + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer creation by deflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip encoding + should be left enabled. */ +#ifndef NO_GZIP +# define GZIP +#endif + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define Buf_size 16 +/* size of bit buffer in bi_buf */ + +#define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + uInt pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to suppress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + uInt insert; /* bytes at end of window left to insert */ + +#ifdef DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + ulg high_water; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + +#define WIN_INIT MAX_MATCH +/* Number of bytes after end of data in window to initialize in order to avoid + memory checker errors from longest match routines */ + + /* in trees.c */ +void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); +int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, + ulg stored_len, int last)); +void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s)); +void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); +void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, + ulg stored_len, int last)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch ZLIB_INTERNAL _length_code[]; + extern uch ZLIB_INTERNAL _dist_code[]; +#else + extern const uch ZLIB_INTERNAL _length_code[]; + extern const uch ZLIB_INTERNAL _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif /* DEFLATE_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/doc/algorithm.txt b/thirdparty/zlib/zlib-1.2.7/doc/algorithm.txt new file mode 100644 index 0000000..c97f495 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/doc/algorithm.txt @@ -0,0 +1,209 @@ +1. Compression algorithm (deflate) + +The deflation algorithm used by gzip (also zip and zlib) is a variation of +LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in +the input data. The second occurrence of a string is replaced by a +pointer to the previous string, in the form of a pair (distance, +length). Distances are limited to 32K bytes, and lengths are limited +to 258 bytes. When a string does not occur anywhere in the previous +32K bytes, it is emitted as a sequence of literal bytes. (In this +description, `string' must be taken as an arbitrary sequence of bytes, +and is not restricted to printable characters.) + +Literals or match lengths are compressed with one Huffman tree, and +match distances are compressed with another tree. The trees are stored +in a compact form at the start of each block. The blocks can have any +size (except that the compressed data for one block must fit in +available memory). A block is terminated when deflate() determines that +it would be useful to start another block with fresh trees. (This is +somewhat similar to the behavior of LZW-based _compress_.) + +Duplicated strings are found using a hash table. All input strings of +length 3 are inserted in the hash table. A hash index is computed for +the next 3 bytes. If the hash chain for this index is not empty, all +strings in the chain are compared with the current input string, and +the longest match is selected. + +The hash chains are searched starting with the most recent strings, to +favor small distances and thus take advantage of the Huffman encoding. +The hash chains are singly linked. There are no deletions from the +hash chains, the algorithm simply discards matches that are too old. + +To avoid a worst-case situation, very long hash chains are arbitrarily +truncated at a certain length, determined by a runtime option (level +parameter of deflateInit). So deflate() does not always find the longest +possible match but generally finds a match which is long enough. + +deflate() also defers the selection of matches with a lazy evaluation +mechanism. After a match of length N has been found, deflate() searches for +a longer match at the next input byte. If a longer match is found, the +previous match is truncated to a length of one (thus producing a single +literal byte) and the process of lazy evaluation begins again. Otherwise, +the original match is kept, and the next match search is attempted only N +steps later. + +The lazy match evaluation is also subject to a runtime parameter. If +the current match is long enough, deflate() reduces the search for a longer +match, thus speeding up the whole process. If compression ratio is more +important than speed, deflate() attempts a complete second search even if +the first match is already long enough. + +The lazy match evaluation is not performed for the fastest compression +modes (level parameter 1 to 3). For these fast modes, new strings +are inserted in the hash table only when no match was found, or +when the match is not too long. This degrades the compression ratio +but saves time since there are both fewer insertions and fewer searches. + + +2. Decompression algorithm (inflate) + +2.1 Introduction + +The key question is how to represent a Huffman code (or any prefix code) so +that you can decode fast. The most important characteristic is that shorter +codes are much more common than longer codes, so pay attention to decoding the +short codes fast, and let the long codes take longer to decode. + +inflate() sets up a first level table that covers some number of bits of +input less than the length of longest code. It gets that many bits from the +stream, and looks it up in the table. The table will tell if the next +code is that many bits or less and how many, and if it is, it will tell +the value, else it will point to the next level table for which inflate() +grabs more bits and tries to decode a longer code. + +How many bits to make the first lookup is a tradeoff between the time it +takes to decode and the time it takes to build the table. If building the +table took no time (and if you had infinite memory), then there would only +be a first level table to cover all the way to the longest code. However, +building the table ends up taking a lot longer for more bits since short +codes are replicated many times in such a table. What inflate() does is +simply to make the number of bits in the first table a variable, and then +to set that variable for the maximum speed. + +For inflate, which has 286 possible codes for the literal/length tree, the size +of the first table is nine bits. Also the distance trees have 30 possible +values, and the size of the first table is six bits. Note that for each of +those cases, the table ended up one bit longer than the ``average'' code +length, i.e. the code length of an approximately flat code which would be a +little more than eight bits for 286 symbols and a little less than five bits +for 30 symbols. + + +2.2 More details on the inflate table lookup + +Ok, you want to know what this cleverly obfuscated inflate tree actually +looks like. You are correct that it's not a Huffman tree. It is simply a +lookup table for the first, let's say, nine bits of a Huffman symbol. The +symbol could be as short as one bit or as long as 15 bits. If a particular +symbol is shorter than nine bits, then that symbol's translation is duplicated +in all those entries that start with that symbol's bits. For example, if the +symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a +symbol is nine bits long, it appears in the table once. + +If the symbol is longer than nine bits, then that entry in the table points +to another similar table for the remaining bits. Again, there are duplicated +entries as needed. The idea is that most of the time the symbol will be short +and there will only be one table look up. (That's whole idea behind data +compression in the first place.) For the less frequent long symbols, there +will be two lookups. If you had a compression method with really long +symbols, you could have as many levels of lookups as is efficient. For +inflate, two is enough. + +So a table entry either points to another table (in which case nine bits in +the above example are gobbled), or it contains the translation for the symbol +and the number of bits to gobble. Then you start again with the next +ungobbled bit. + +You may wonder: why not just have one lookup table for how ever many bits the +longest symbol is? The reason is that if you do that, you end up spending +more time filling in duplicate symbol entries than you do actually decoding. +At least for deflate's output that generates new trees every several 10's of +kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code +would take too long if you're only decoding several thousand symbols. At the +other extreme, you could make a new table for every bit in the code. In fact, +that's essentially a Huffman tree. But then you spend too much time +traversing the tree while decoding, even for short symbols. + +So the number of bits for the first lookup table is a trade of the time to +fill out the table vs. the time spent looking at the second level and above of +the table. + +Here is an example, scaled down: + +The code being decoded, with 10 symbols, from 1 to 6 bits long: + +A: 0 +B: 10 +C: 1100 +D: 11010 +E: 11011 +F: 11100 +G: 11101 +H: 11110 +I: 111110 +J: 111111 + +Let's make the first table three bits long (eight entries): + +000: A,1 +001: A,1 +010: A,1 +011: A,1 +100: B,2 +101: B,2 +110: -> table X (gobble 3 bits) +111: -> table Y (gobble 3 bits) + +Each entry is what the bits decode as and how many bits that is, i.e. how +many bits to gobble. Or the entry points to another table, with the number of +bits to gobble implicit in the size of the table. + +Table X is two bits long since the longest code starting with 110 is five bits +long: + +00: C,1 +01: C,1 +10: D,2 +11: E,2 + +Table Y is three bits long since the longest code starting with 111 is six +bits long: + +000: F,2 +001: F,2 +010: G,2 +011: G,2 +100: H,2 +101: H,2 +110: I,3 +111: J,3 + +So what we have here are three tables with a total of 20 entries that had to +be constructed. That's compared to 64 entries for a single table. Or +compared to 16 entries for a Huffman tree (six two entry tables and one four +entry table). Assuming that the code ideally represents the probability of +the symbols, it takes on the average 1.25 lookups per symbol. That's compared +to one lookup for the single table, or 1.66 lookups per symbol for the +Huffman tree. + +There, I think that gives you a picture of what's going on. For inflate, the +meaning of a particular symbol is often more than just a letter. It can be a +byte (a "literal"), or it can be either a length or a distance which +indicates a base value and a number of bits to fetch after the code that is +added to the base value. Or it might be the special end-of-block code. The +data structures created in inftrees.c try to encode all that information +compactly in the tables. + + +Jean-loup Gailly Mark Adler +jloup@gzip.org madler@alumni.caltech.edu + + +References: + +[LZ77] Ziv J., Lempel A., ``A Universal Algorithm for Sequential Data +Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3, +pp. 337-343. + +``DEFLATE Compressed Data Format Specification'' available in +http://tools.ietf.org/html/rfc1951 diff --git a/thirdparty/zlib/zlib-1.2.7/doc/rfc1950.txt b/thirdparty/zlib/zlib-1.2.7/doc/rfc1950.txt new file mode 100644 index 0000000..ce6428a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/doc/rfc1950.txt @@ -0,0 +1,619 @@ + + + + + + +Network Working Group P. Deutsch +Request for Comments: 1950 Aladdin Enterprises +Category: Informational J-L. Gailly + Info-ZIP + May 1996 + + + ZLIB Compressed Data Format Specification version 3.3 + +Status of This Memo + + This memo provides information for the Internet community. This memo + does not specify an Internet standard of any kind. Distribution of + this memo is unlimited. + +IESG Note: + + The IESG takes no position on the validity of any Intellectual + Property Rights statements contained in this document. + +Notices + + Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly + + Permission is granted to copy and distribute this document for any + purpose and without charge, including translations into other + languages and incorporation into compilations, provided that the + copyright notice and this notice are preserved, and that any + substantive changes or deletions from the original are clearly + marked. + + A pointer to the latest version of this and related documentation in + HTML format can be found at the URL + . + +Abstract + + This specification defines a lossless compressed data format. The + data can be produced or consumed, even for an arbitrarily long + sequentially presented input data stream, using only an a priori + bounded amount of intermediate storage. The format presently uses + the DEFLATE compression method but can be easily extended to use + other compression methods. It can be implemented readily in a manner + not covered by patents. This specification also defines the ADLER-32 + checksum (an extension and improvement of the Fletcher checksum), + used for detection of data corruption, and provides an algorithm for + computing it. + + + + +Deutsch & Gailly Informational [Page 1] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + +Table of Contents + + 1. Introduction ................................................... 2 + 1.1. Purpose ................................................... 2 + 1.2. Intended audience ......................................... 3 + 1.3. Scope ..................................................... 3 + 1.4. Compliance ................................................ 3 + 1.5. Definitions of terms and conventions used ................ 3 + 1.6. Changes from previous versions ............................ 3 + 2. Detailed specification ......................................... 3 + 2.1. Overall conventions ....................................... 3 + 2.2. Data format ............................................... 4 + 2.3. Compliance ................................................ 7 + 3. References ..................................................... 7 + 4. Source code .................................................... 8 + 5. Security Considerations ........................................ 8 + 6. Acknowledgements ............................................... 8 + 7. Authors' Addresses ............................................. 8 + 8. Appendix: Rationale ............................................ 9 + 9. Appendix: Sample code ..........................................10 + +1. Introduction + + 1.1. Purpose + + The purpose of this specification is to define a lossless + compressed data format that: + + * Is independent of CPU type, operating system, file system, + and character set, and hence can be used for interchange; + + * Can be produced or consumed, even for an arbitrarily long + sequentially presented input data stream, using only an a + priori bounded amount of intermediate storage, and hence can + be used in data communications or similar structures such as + Unix filters; + + * Can use a number of different compression methods; + + * Can be implemented readily in a manner not covered by + patents, and hence can be practiced freely. + + The data format defined by this specification does not attempt to + allow random access to compressed data. + + + + + + + +Deutsch & Gailly Informational [Page 2] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + 1.2. Intended audience + + This specification is intended for use by implementors of software + to compress data into zlib format and/or decompress data from zlib + format. + + The text of the specification assumes a basic background in + programming at the level of bits and other primitive data + representations. + + 1.3. Scope + + The specification specifies a compressed data format that can be + used for in-memory compression of a sequence of arbitrary bytes. + + 1.4. Compliance + + Unless otherwise indicated below, a compliant decompressor must be + able to accept and decompress any data set that conforms to all + the specifications presented here; a compliant compressor must + produce data sets that conform to all the specifications presented + here. + + 1.5. Definitions of terms and conventions used + + byte: 8 bits stored or transmitted as a unit (same as an octet). + (For this specification, a byte is exactly 8 bits, even on + machines which store a character on a number of bits different + from 8.) See below, for the numbering of bits within a byte. + + 1.6. Changes from previous versions + + Version 3.1 was the first public release of this specification. + In version 3.2, some terminology was changed and the Adler-32 + sample code was rewritten for clarity. In version 3.3, the + support for a preset dictionary was introduced, and the + specification was converted to RFC style. + +2. Detailed specification + + 2.1. Overall conventions + + In the diagrams below, a box like this: + + +---+ + | | <-- the vertical bars might be missing + +---+ + + + + +Deutsch & Gailly Informational [Page 3] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + represents one byte; a box like this: + + +==============+ + | | + +==============+ + + represents a variable number of bytes. + + Bytes stored within a computer do not have a "bit order", since + they are always treated as a unit. However, a byte considered as + an integer between 0 and 255 does have a most- and least- + significant bit, and since we write numbers with the most- + significant digit on the left, we also write bytes with the most- + significant bit on the left. In the diagrams below, we number the + bits of a byte so that bit 0 is the least-significant bit, i.e., + the bits are numbered: + + +--------+ + |76543210| + +--------+ + + Within a computer, a number may occupy multiple bytes. All + multi-byte numbers in the format described here are stored with + the MOST-significant byte first (at the lower memory address). + For example, the decimal number 520 is stored as: + + 0 1 + +--------+--------+ + |00000010|00001000| + +--------+--------+ + ^ ^ + | | + | + less significant byte = 8 + + more significant byte = 2 x 256 + + 2.2. Data format + + A zlib stream has the following structure: + + 0 1 + +---+---+ + |CMF|FLG| (more-->) + +---+---+ + + + + + + + + +Deutsch & Gailly Informational [Page 4] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + (if FLG.FDICT set) + + 0 1 2 3 + +---+---+---+---+ + | DICTID | (more-->) + +---+---+---+---+ + + +=====================+---+---+---+---+ + |...compressed data...| ADLER32 | + +=====================+---+---+---+---+ + + Any data which may appear after ADLER32 are not part of the zlib + stream. + + CMF (Compression Method and flags) + This byte is divided into a 4-bit compression method and a 4- + bit information field depending on the compression method. + + bits 0 to 3 CM Compression method + bits 4 to 7 CINFO Compression info + + CM (Compression method) + This identifies the compression method used in the file. CM = 8 + denotes the "deflate" compression method with a window size up + to 32K. This is the method used by gzip and PNG (see + references [1] and [2] in Chapter 3, below, for the reference + documents). CM = 15 is reserved. It might be used in a future + version of this specification to indicate the presence of an + extra field before the compressed data. + + CINFO (Compression info) + For CM = 8, CINFO is the base-2 logarithm of the LZ77 window + size, minus eight (CINFO=7 indicates a 32K window size). Values + of CINFO above 7 are not allowed in this version of the + specification. CINFO is not defined in this specification for + CM not equal to 8. + + FLG (FLaGs) + This flag byte is divided as follows: + + bits 0 to 4 FCHECK (check bits for CMF and FLG) + bit 5 FDICT (preset dictionary) + bits 6 to 7 FLEVEL (compression level) + + The FCHECK value must be such that CMF and FLG, when viewed as + a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG), + is a multiple of 31. + + + + +Deutsch & Gailly Informational [Page 5] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + FDICT (Preset dictionary) + If FDICT is set, a DICT dictionary identifier is present + immediately after the FLG byte. The dictionary is a sequence of + bytes which are initially fed to the compressor without + producing any compressed output. DICT is the Adler-32 checksum + of this sequence of bytes (see the definition of ADLER32 + below). The decompressor can use this identifier to determine + which dictionary has been used by the compressor. + + FLEVEL (Compression level) + These flags are available for use by specific compression + methods. The "deflate" method (CM = 8) sets these flags as + follows: + + 0 - compressor used fastest algorithm + 1 - compressor used fast algorithm + 2 - compressor used default algorithm + 3 - compressor used maximum compression, slowest algorithm + + The information in FLEVEL is not needed for decompression; it + is there to indicate if recompression might be worthwhile. + + compressed data + For compression method 8, the compressed data is stored in the + deflate compressed data format as described in the document + "DEFLATE Compressed Data Format Specification" by L. Peter + Deutsch. (See reference [3] in Chapter 3, below) + + Other compressed data formats are not specified in this version + of the zlib specification. + + ADLER32 (Adler-32 checksum) + This contains a checksum value of the uncompressed data + (excluding any dictionary data) computed according to Adler-32 + algorithm. This algorithm is a 32-bit extension and improvement + of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 + standard. See references [4] and [5] in Chapter 3, below) + + Adler-32 is composed of two sums accumulated per byte: s1 is + the sum of all bytes, s2 is the sum of all s1 values. Both sums + are done modulo 65521. s1 is initialized to 1, s2 to zero. The + Adler-32 checksum is stored as s2*65536 + s1 in most- + significant-byte first (network) order. + + + + + + + + +Deutsch & Gailly Informational [Page 6] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + 2.3. Compliance + + A compliant compressor must produce streams with correct CMF, FLG + and ADLER32, but need not support preset dictionaries. When the + zlib data format is used as part of another standard data format, + the compressor may use only preset dictionaries that are specified + by this other data format. If this other format does not use the + preset dictionary feature, the compressor must not set the FDICT + flag. + + A compliant decompressor must check CMF, FLG, and ADLER32, and + provide an error indication if any of these have incorrect values. + A compliant decompressor must give an error indication if CM is + not one of the values defined in this specification (only the + value 8 is permitted in this version), since another value could + indicate the presence of new features that would cause subsequent + data to be interpreted incorrectly. A compliant decompressor must + give an error indication if FDICT is set and DICTID is not the + identifier of a known preset dictionary. A decompressor may + ignore FLEVEL and still be compliant. When the zlib data format + is being used as a part of another standard format, a compliant + decompressor must support all the preset dictionaries specified by + the other format. When the other format does not use the preset + dictionary feature, a compliant decompressor must reject any + stream in which the FDICT flag is set. + +3. References + + [1] Deutsch, L.P.,"GZIP Compressed Data Format Specification", + available in ftp://ftp.uu.net/pub/archiving/zip/doc/ + + [2] Thomas Boutell, "PNG (Portable Network Graphics) specification", + available in ftp://ftp.uu.net/graphics/png/documents/ + + [3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification", + available in ftp://ftp.uu.net/pub/archiving/zip/doc/ + + [4] Fletcher, J. G., "An Arithmetic Checksum for Serial + Transmissions," IEEE Transactions on Communications, Vol. COM-30, + No. 1, January 1982, pp. 247-252. + + [5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms," + November, 1993, pp. 144, 145. (Available from + gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073. + + + + + + + +Deutsch & Gailly Informational [Page 7] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + +4. Source code + + Source code for a C language implementation of a "zlib" compliant + library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/. + +5. Security Considerations + + A decoder that fails to check the ADLER32 checksum value may be + subject to undetected data corruption. + +6. Acknowledgements + + Trademarks cited in this document are the property of their + respective owners. + + Jean-Loup Gailly and Mark Adler designed the zlib format and wrote + the related software described in this specification. Glenn + Randers-Pehrson converted this document to RFC and HTML format. + +7. Authors' Addresses + + L. Peter Deutsch + Aladdin Enterprises + 203 Santa Margarita Ave. + Menlo Park, CA 94025 + + Phone: (415) 322-0103 (AM only) + FAX: (415) 322-1734 + EMail: + + + Jean-Loup Gailly + + EMail: + + Questions about the technical content of this specification can be + sent by email to + + Jean-Loup Gailly and + Mark Adler + + Editorial comments on this specification can be sent by email to + + L. Peter Deutsch and + Glenn Randers-Pehrson + + + + + + +Deutsch & Gailly Informational [Page 8] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + +8. Appendix: Rationale + + 8.1. Preset dictionaries + + A preset dictionary is specially useful to compress short input + sequences. The compressor can take advantage of the dictionary + context to encode the input in a more compact manner. The + decompressor can be initialized with the appropriate context by + virtually decompressing a compressed version of the dictionary + without producing any output. However for certain compression + algorithms such as the deflate algorithm this operation can be + achieved without actually performing any decompression. + + The compressor and the decompressor must use exactly the same + dictionary. The dictionary may be fixed or may be chosen among a + certain number of predefined dictionaries, according to the kind + of input data. The decompressor can determine which dictionary has + been chosen by the compressor by checking the dictionary + identifier. This document does not specify the contents of + predefined dictionaries, since the optimal dictionaries are + application specific. Standard data formats using this feature of + the zlib specification must precisely define the allowed + dictionaries. + + 8.2. The Adler-32 algorithm + + The Adler-32 algorithm is much faster than the CRC32 algorithm yet + still provides an extremely low probability of undetected errors. + + The modulo on unsigned long accumulators can be delayed for 5552 + bytes, so the modulo operation time is negligible. If the bytes + are a, b, c, the second sum is 3a + 2b + c + 3, and so is position + and order sensitive, unlike the first sum, which is just a + checksum. That 65521 is prime is important to avoid a possible + large class of two-byte errors that leave the check unchanged. + (The Fletcher checksum uses 255, which is not prime and which also + makes the Fletcher check insensitive to single byte changes 0 <-> + 255.) + + The sum s1 is initialized to 1 instead of zero to make the length + of the sequence part of s2, so that the length does not have to be + checked separately. (Any sequence of zeroes has a Fletcher + checksum of zero.) + + + + + + + + +Deutsch & Gailly Informational [Page 9] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + +9. Appendix: Sample code + + The following C code computes the Adler-32 checksum of a data buffer. + It is written for clarity, not for speed. The sample code is in the + ANSI C programming language. Non C users may find it easier to read + with these hints: + + & Bitwise AND operator. + >> Bitwise right shift operator. When applied to an + unsigned quantity, as here, right shift inserts zero bit(s) + at the left. + << Bitwise left shift operator. Left shift inserts zero + bit(s) at the right. + ++ "n++" increments the variable n. + % modulo operator: a % b is the remainder of a divided by b. + + #define BASE 65521 /* largest prime smaller than 65536 */ + + /* + Update a running Adler-32 checksum with the bytes buf[0..len-1] + and return the updated checksum. The Adler-32 checksum should be + initialized to 1. + + Usage example: + + unsigned long adler = 1L; + + while (read_buffer(buffer, length) != EOF) { + adler = update_adler32(adler, buffer, length); + } + if (adler != original_adler) error(); + */ + unsigned long update_adler32(unsigned long adler, + unsigned char *buf, int len) + { + unsigned long s1 = adler & 0xffff; + unsigned long s2 = (adler >> 16) & 0xffff; + int n; + + for (n = 0; n < len; n++) { + s1 = (s1 + buf[n]) % BASE; + s2 = (s2 + s1) % BASE; + } + return (s2 << 16) + s1; + } + + /* Return the adler32 of the bytes buf[0..len-1] */ + + + + +Deutsch & Gailly Informational [Page 10] + +RFC 1950 ZLIB Compressed Data Format Specification May 1996 + + + unsigned long adler32(unsigned char *buf, int len) + { + return update_adler32(1L, buf, len); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Deutsch & Gailly Informational [Page 11] + diff --git a/thirdparty/zlib/zlib-1.2.7/doc/rfc1951.txt b/thirdparty/zlib/zlib-1.2.7/doc/rfc1951.txt new file mode 100644 index 0000000..403c8c7 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/doc/rfc1951.txt @@ -0,0 +1,955 @@ + + + + + + +Network Working Group P. Deutsch +Request for Comments: 1951 Aladdin Enterprises +Category: Informational May 1996 + + + DEFLATE Compressed Data Format Specification version 1.3 + +Status of This Memo + + This memo provides information for the Internet community. This memo + does not specify an Internet standard of any kind. Distribution of + this memo is unlimited. + +IESG Note: + + The IESG takes no position on the validity of any Intellectual + Property Rights statements contained in this document. + +Notices + + Copyright (c) 1996 L. Peter Deutsch + + Permission is granted to copy and distribute this document for any + purpose and without charge, including translations into other + languages and incorporation into compilations, provided that the + copyright notice and this notice are preserved, and that any + substantive changes or deletions from the original are clearly + marked. + + A pointer to the latest version of this and related documentation in + HTML format can be found at the URL + . + +Abstract + + This specification defines a lossless compressed data format that + compresses data using a combination of the LZ77 algorithm and Huffman + coding, with efficiency comparable to the best currently available + general-purpose compression methods. The data can be produced or + consumed, even for an arbitrarily long sequentially presented input + data stream, using only an a priori bounded amount of intermediate + storage. The format can be implemented readily in a manner not + covered by patents. + + + + + + + + +Deutsch Informational [Page 1] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + +Table of Contents + + 1. Introduction ................................................... 2 + 1.1. Purpose ................................................... 2 + 1.2. Intended audience ......................................... 3 + 1.3. Scope ..................................................... 3 + 1.4. Compliance ................................................ 3 + 1.5. Definitions of terms and conventions used ................ 3 + 1.6. Changes from previous versions ............................ 4 + 2. Compressed representation overview ............................. 4 + 3. Detailed specification ......................................... 5 + 3.1. Overall conventions ....................................... 5 + 3.1.1. Packing into bytes .................................. 5 + 3.2. Compressed block format ................................... 6 + 3.2.1. Synopsis of prefix and Huffman coding ............... 6 + 3.2.2. Use of Huffman coding in the "deflate" format ....... 7 + 3.2.3. Details of block format ............................. 9 + 3.2.4. Non-compressed blocks (BTYPE=00) ................... 11 + 3.2.5. Compressed blocks (length and distance codes) ...... 11 + 3.2.6. Compression with fixed Huffman codes (BTYPE=01) .... 12 + 3.2.7. Compression with dynamic Huffman codes (BTYPE=10) .. 13 + 3.3. Compliance ............................................... 14 + 4. Compression algorithm details ................................. 14 + 5. References .................................................... 16 + 6. Security Considerations ....................................... 16 + 7. Source code ................................................... 16 + 8. Acknowledgements .............................................. 16 + 9. Author's Address .............................................. 17 + +1. Introduction + + 1.1. Purpose + + The purpose of this specification is to define a lossless + compressed data format that: + * Is independent of CPU type, operating system, file system, + and character set, and hence can be used for interchange; + * Can be produced or consumed, even for an arbitrarily long + sequentially presented input data stream, using only an a + priori bounded amount of intermediate storage, and hence + can be used in data communications or similar structures + such as Unix filters; + * Compresses data with efficiency comparable to the best + currently available general-purpose compression methods, + and in particular considerably better than the "compress" + program; + * Can be implemented readily in a manner not covered by + patents, and hence can be practiced freely; + + + +Deutsch Informational [Page 2] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + * Is compatible with the file format produced by the current + widely used gzip utility, in that conforming decompressors + will be able to read data produced by the existing gzip + compressor. + + The data format defined by this specification does not attempt to: + + * Allow random access to compressed data; + * Compress specialized data (e.g., raster graphics) as well + as the best currently available specialized algorithms. + + A simple counting argument shows that no lossless compression + algorithm can compress every possible input data set. For the + format defined here, the worst case expansion is 5 bytes per 32K- + byte block, i.e., a size increase of 0.015% for large data sets. + English text usually compresses by a factor of 2.5 to 3; + executable files usually compress somewhat less; graphical data + such as raster images may compress much more. + + 1.2. Intended audience + + This specification is intended for use by implementors of software + to compress data into "deflate" format and/or decompress data from + "deflate" format. + + The text of the specification assumes a basic background in + programming at the level of bits and other primitive data + representations. Familiarity with the technique of Huffman coding + is helpful but not required. + + 1.3. Scope + + The specification specifies a method for representing a sequence + of bytes as a (usually shorter) sequence of bits, and a method for + packing the latter bit sequence into bytes. + + 1.4. Compliance + + Unless otherwise indicated below, a compliant decompressor must be + able to accept and decompress any data set that conforms to all + the specifications presented here; a compliant compressor must + produce data sets that conform to all the specifications presented + here. + + 1.5. Definitions of terms and conventions used + + Byte: 8 bits stored or transmitted as a unit (same as an octet). + For this specification, a byte is exactly 8 bits, even on machines + + + +Deutsch Informational [Page 3] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + which store a character on a number of bits different from eight. + See below, for the numbering of bits within a byte. + + String: a sequence of arbitrary bytes. + + 1.6. Changes from previous versions + + There have been no technical changes to the deflate format since + version 1.1 of this specification. In version 1.2, some + terminology was changed. Version 1.3 is a conversion of the + specification to RFC style. + +2. Compressed representation overview + + A compressed data set consists of a series of blocks, corresponding + to successive blocks of input data. The block sizes are arbitrary, + except that non-compressible blocks are limited to 65,535 bytes. + + Each block is compressed using a combination of the LZ77 algorithm + and Huffman coding. The Huffman trees for each block are independent + of those for previous or subsequent blocks; the LZ77 algorithm may + use a reference to a duplicated string occurring in a previous block, + up to 32K input bytes before. + + Each block consists of two parts: a pair of Huffman code trees that + describe the representation of the compressed data part, and a + compressed data part. (The Huffman trees themselves are compressed + using Huffman encoding.) The compressed data consists of a series of + elements of two types: literal bytes (of strings that have not been + detected as duplicated within the previous 32K input bytes), and + pointers to duplicated strings, where a pointer is represented as a + pair . The representation used in the + "deflate" format limits distances to 32K bytes and lengths to 258 + bytes, but does not limit the size of a block, except for + uncompressible blocks, which are limited as noted above. + + Each type of value (literals, distances, and lengths) in the + compressed data is represented using a Huffman code, using one code + tree for literals and lengths and a separate code tree for distances. + The code trees for each block appear in a compact form just before + the compressed data for that block. + + + + + + + + + + +Deutsch Informational [Page 4] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + +3. Detailed specification + + 3.1. Overall conventions In the diagrams below, a box like this: + + +---+ + | | <-- the vertical bars might be missing + +---+ + + represents one byte; a box like this: + + +==============+ + | | + +==============+ + + represents a variable number of bytes. + + Bytes stored within a computer do not have a "bit order", since + they are always treated as a unit. However, a byte considered as + an integer between 0 and 255 does have a most- and least- + significant bit, and since we write numbers with the most- + significant digit on the left, we also write bytes with the most- + significant bit on the left. In the diagrams below, we number the + bits of a byte so that bit 0 is the least-significant bit, i.e., + the bits are numbered: + + +--------+ + |76543210| + +--------+ + + Within a computer, a number may occupy multiple bytes. All + multi-byte numbers in the format described here are stored with + the least-significant byte first (at the lower memory address). + For example, the decimal number 520 is stored as: + + 0 1 + +--------+--------+ + |00001000|00000010| + +--------+--------+ + ^ ^ + | | + | + more significant byte = 2 x 256 + + less significant byte = 8 + + 3.1.1. Packing into bytes + + This document does not address the issue of the order in which + bits of a byte are transmitted on a bit-sequential medium, + since the final data format described here is byte- rather than + + + +Deutsch Informational [Page 5] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + bit-oriented. However, we describe the compressed block format + in below, as a sequence of data elements of various bit + lengths, not a sequence of bytes. We must therefore specify + how to pack these data elements into bytes to form the final + compressed byte sequence: + + * Data elements are packed into bytes in order of + increasing bit number within the byte, i.e., starting + with the least-significant bit of the byte. + * Data elements other than Huffman codes are packed + starting with the least-significant bit of the data + element. + * Huffman codes are packed starting with the most- + significant bit of the code. + + In other words, if one were to print out the compressed data as + a sequence of bytes, starting with the first byte at the + *right* margin and proceeding to the *left*, with the most- + significant bit of each byte on the left as usual, one would be + able to parse the result from right to left, with fixed-width + elements in the correct MSB-to-LSB order and Huffman codes in + bit-reversed order (i.e., with the first bit of the code in the + relative LSB position). + + 3.2. Compressed block format + + 3.2.1. Synopsis of prefix and Huffman coding + + Prefix coding represents symbols from an a priori known + alphabet by bit sequences (codes), one code for each symbol, in + a manner such that different symbols may be represented by bit + sequences of different lengths, but a parser can always parse + an encoded string unambiguously symbol-by-symbol. + + We define a prefix code in terms of a binary tree in which the + two edges descending from each non-leaf node are labeled 0 and + 1 and in which the leaf nodes correspond one-for-one with (are + labeled with) the symbols of the alphabet; then the code for a + symbol is the sequence of 0's and 1's on the edges leading from + the root to the leaf labeled with that symbol. For example: + + + + + + + + + + + +Deutsch Informational [Page 6] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + /\ Symbol Code + 0 1 ------ ---- + / \ A 00 + /\ B B 1 + 0 1 C 011 + / \ D 010 + A /\ + 0 1 + / \ + D C + + A parser can decode the next symbol from an encoded input + stream by walking down the tree from the root, at each step + choosing the edge corresponding to the next input bit. + + Given an alphabet with known symbol frequencies, the Huffman + algorithm allows the construction of an optimal prefix code + (one which represents strings with those symbol frequencies + using the fewest bits of any possible prefix codes for that + alphabet). Such a code is called a Huffman code. (See + reference [1] in Chapter 5, references for additional + information on Huffman codes.) + + Note that in the "deflate" format, the Huffman codes for the + various alphabets must not exceed certain maximum code lengths. + This constraint complicates the algorithm for computing code + lengths from symbol frequencies. Again, see Chapter 5, + references for details. + + 3.2.2. Use of Huffman coding in the "deflate" format + + The Huffman codes used for each alphabet in the "deflate" + format have two additional rules: + + * All codes of a given bit length have lexicographically + consecutive values, in the same order as the symbols + they represent; + + * Shorter codes lexicographically precede longer codes. + + + + + + + + + + + + +Deutsch Informational [Page 7] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + We could recode the example above to follow this rule as + follows, assuming that the order of the alphabet is ABCD: + + Symbol Code + ------ ---- + A 10 + B 0 + C 110 + D 111 + + I.e., 0 precedes 10 which precedes 11x, and 110 and 111 are + lexicographically consecutive. + + Given this rule, we can define the Huffman code for an alphabet + just by giving the bit lengths of the codes for each symbol of + the alphabet in order; this is sufficient to determine the + actual codes. In our example, the code is completely defined + by the sequence of bit lengths (2, 1, 3, 3). The following + algorithm generates the codes as integers, intended to be read + from most- to least-significant bit. The code lengths are + initially in tree[I].Len; the codes are produced in + tree[I].Code. + + 1) Count the number of codes for each code length. Let + bl_count[N] be the number of codes of length N, N >= 1. + + 2) Find the numerical value of the smallest code for each + code length: + + code = 0; + bl_count[0] = 0; + for (bits = 1; bits <= MAX_BITS; bits++) { + code = (code + bl_count[bits-1]) << 1; + next_code[bits] = code; + } + + 3) Assign numerical values to all codes, using consecutive + values for all codes of the same length with the base + values determined at step 2. Codes that are never used + (which have a bit length of zero) must not be assigned a + value. + + for (n = 0; n <= max_code; n++) { + len = tree[n].Len; + if (len != 0) { + tree[n].Code = next_code[len]; + next_code[len]++; + } + + + +Deutsch Informational [Page 8] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + } + + Example: + + Consider the alphabet ABCDEFGH, with bit lengths (3, 3, 3, 3, + 3, 2, 4, 4). After step 1, we have: + + N bl_count[N] + - ----------- + 2 1 + 3 5 + 4 2 + + Step 2 computes the following next_code values: + + N next_code[N] + - ------------ + 1 0 + 2 0 + 3 2 + 4 14 + + Step 3 produces the following code values: + + Symbol Length Code + ------ ------ ---- + A 3 010 + B 3 011 + C 3 100 + D 3 101 + E 3 110 + F 2 00 + G 4 1110 + H 4 1111 + + 3.2.3. Details of block format + + Each block of compressed data begins with 3 header bits + containing the following data: + + first bit BFINAL + next 2 bits BTYPE + + Note that the header bits do not necessarily begin on a byte + boundary, since a block does not necessarily occupy an integral + number of bytes. + + + + + +Deutsch Informational [Page 9] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + BFINAL is set if and only if this is the last block of the data + set. + + BTYPE specifies how the data are compressed, as follows: + + 00 - no compression + 01 - compressed with fixed Huffman codes + 10 - compressed with dynamic Huffman codes + 11 - reserved (error) + + The only difference between the two compressed cases is how the + Huffman codes for the literal/length and distance alphabets are + defined. + + In all cases, the decoding algorithm for the actual data is as + follows: + + do + read block header from input stream. + if stored with no compression + skip any remaining bits in current partially + processed byte + read LEN and NLEN (see next section) + copy LEN bytes of data to output + otherwise + if compressed with dynamic Huffman codes + read representation of code trees (see + subsection below) + loop (until end of block code recognized) + decode literal/length value from input stream + if value < 256 + copy value (literal byte) to output stream + otherwise + if value = end of block (256) + break from loop + otherwise (value = 257..285) + decode distance from input stream + + move backwards distance bytes in the output + stream, and copy length bytes from this + position to the output stream. + end loop + while not last block + + Note that a duplicated string reference may refer to a string + in a previous block; i.e., the backward distance may cross one + or more block boundaries. However a distance cannot refer past + the beginning of the output stream. (An application using a + + + +Deutsch Informational [Page 10] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + preset dictionary might discard part of the output stream; a + distance can refer to that part of the output stream anyway) + Note also that the referenced string may overlap the current + position; for example, if the last 2 bytes decoded have values + X and Y, a string reference with + adds X,Y,X,Y,X to the output stream. + + We now specify each compression method in turn. + + 3.2.4. Non-compressed blocks (BTYPE=00) + + Any bits of input up to the next byte boundary are ignored. + The rest of the block consists of the following information: + + 0 1 2 3 4... + +---+---+---+---+================================+ + | LEN | NLEN |... LEN bytes of literal data...| + +---+---+---+---+================================+ + + LEN is the number of data bytes in the block. NLEN is the + one's complement of LEN. + + 3.2.5. Compressed blocks (length and distance codes) + + As noted above, encoded data blocks in the "deflate" format + consist of sequences of symbols drawn from three conceptually + distinct alphabets: either literal bytes, from the alphabet of + byte values (0..255), or pairs, + where the length is drawn from (3..258) and the distance is + drawn from (1..32,768). In fact, the literal and length + alphabets are merged into a single alphabet (0..285), where + values 0..255 represent literal bytes, the value 256 indicates + end-of-block, and values 257..285 represent length codes + (possibly in conjunction with extra bits following the symbol + code) as follows: + + + + + + + + + + + + + + + + +Deutsch Informational [Page 11] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + Extra Extra Extra + Code Bits Length(s) Code Bits Lengths Code Bits Length(s) + ---- ---- ------ ---- ---- ------- ---- ---- ------- + 257 0 3 267 1 15,16 277 4 67-82 + 258 0 4 268 1 17,18 278 4 83-98 + 259 0 5 269 2 19-22 279 4 99-114 + 260 0 6 270 2 23-26 280 4 115-130 + 261 0 7 271 2 27-30 281 5 131-162 + 262 0 8 272 2 31-34 282 5 163-194 + 263 0 9 273 3 35-42 283 5 195-226 + 264 0 10 274 3 43-50 284 5 227-257 + 265 1 11,12 275 3 51-58 285 0 258 + 266 1 13,14 276 3 59-66 + + The extra bits should be interpreted as a machine integer + stored with the most-significant bit first, e.g., bits 1110 + represent the value 14. + + Extra Extra Extra + Code Bits Dist Code Bits Dist Code Bits Distance + ---- ---- ---- ---- ---- ------ ---- ---- -------- + 0 0 1 10 4 33-48 20 9 1025-1536 + 1 0 2 11 4 49-64 21 9 1537-2048 + 2 0 3 12 5 65-96 22 10 2049-3072 + 3 0 4 13 5 97-128 23 10 3073-4096 + 4 1 5,6 14 6 129-192 24 11 4097-6144 + 5 1 7,8 15 6 193-256 25 11 6145-8192 + 6 2 9-12 16 7 257-384 26 12 8193-12288 + 7 2 13-16 17 7 385-512 27 12 12289-16384 + 8 3 17-24 18 8 513-768 28 13 16385-24576 + 9 3 25-32 19 8 769-1024 29 13 24577-32768 + + 3.2.6. Compression with fixed Huffman codes (BTYPE=01) + + The Huffman codes for the two alphabets are fixed, and are not + represented explicitly in the data. The Huffman code lengths + for the literal/length alphabet are: + + Lit Value Bits Codes + --------- ---- ----- + 0 - 143 8 00110000 through + 10111111 + 144 - 255 9 110010000 through + 111111111 + 256 - 279 7 0000000 through + 0010111 + 280 - 287 8 11000000 through + 11000111 + + + +Deutsch Informational [Page 12] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + The code lengths are sufficient to generate the actual codes, + as described above; we show the codes in the table for added + clarity. Literal/length values 286-287 will never actually + occur in the compressed data, but participate in the code + construction. + + Distance codes 0-31 are represented by (fixed-length) 5-bit + codes, with possible additional bits as shown in the table + shown in Paragraph 3.2.5, above. Note that distance codes 30- + 31 will never actually occur in the compressed data. + + 3.2.7. Compression with dynamic Huffman codes (BTYPE=10) + + The Huffman codes for the two alphabets appear in the block + immediately after the header bits and before the actual + compressed data, first the literal/length code and then the + distance code. Each code is defined by a sequence of code + lengths, as discussed in Paragraph 3.2.2, above. For even + greater compactness, the code length sequences themselves are + compressed using a Huffman code. The alphabet for code lengths + is as follows: + + 0 - 15: Represent code lengths of 0 - 15 + 16: Copy the previous code length 3 - 6 times. + The next 2 bits indicate repeat length + (0 = 3, ... , 3 = 6) + Example: Codes 8, 16 (+2 bits 11), + 16 (+2 bits 10) will expand to + 12 code lengths of 8 (1 + 6 + 5) + 17: Repeat a code length of 0 for 3 - 10 times. + (3 bits of length) + 18: Repeat a code length of 0 for 11 - 138 times + (7 bits of length) + + A code length of 0 indicates that the corresponding symbol in + the literal/length or distance alphabet will not occur in the + block, and should not participate in the Huffman code + construction algorithm given earlier. If only one distance + code is used, it is encoded using one bit, not zero bits; in + this case there is a single code length of one, with one unused + code. One distance code of zero bits means that there are no + distance codes used at all (the data is all literals). + + We can now define the format of the block: + + 5 Bits: HLIT, # of Literal/Length codes - 257 (257 - 286) + 5 Bits: HDIST, # of Distance codes - 1 (1 - 32) + 4 Bits: HCLEN, # of Code Length codes - 4 (4 - 19) + + + +Deutsch Informational [Page 13] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + (HCLEN + 4) x 3 bits: code lengths for the code length + alphabet given just above, in the order: 16, 17, 18, + 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 + + These code lengths are interpreted as 3-bit integers + (0-7); as above, a code length of 0 means the + corresponding symbol (literal/length or distance code + length) is not used. + + HLIT + 257 code lengths for the literal/length alphabet, + encoded using the code length Huffman code + + HDIST + 1 code lengths for the distance alphabet, + encoded using the code length Huffman code + + The actual compressed data of the block, + encoded using the literal/length and distance Huffman + codes + + The literal/length symbol 256 (end of data), + encoded using the literal/length Huffman code + + The code length repeat codes can cross from HLIT + 257 to the + HDIST + 1 code lengths. In other words, all code lengths form + a single sequence of HLIT + HDIST + 258 values. + + 3.3. Compliance + + A compressor may limit further the ranges of values specified in + the previous section and still be compliant; for example, it may + limit the range of backward pointers to some value smaller than + 32K. Similarly, a compressor may limit the size of blocks so that + a compressible block fits in memory. + + A compliant decompressor must accept the full range of possible + values defined in the previous section, and must accept blocks of + arbitrary size. + +4. Compression algorithm details + + While it is the intent of this document to define the "deflate" + compressed data format without reference to any particular + compression algorithm, the format is related to the compressed + formats produced by LZ77 (Lempel-Ziv 1977, see reference [2] below); + since many variations of LZ77 are patented, it is strongly + recommended that the implementor of a compressor follow the general + algorithm presented here, which is known not to be patented per se. + The material in this section is not part of the definition of the + + + +Deutsch Informational [Page 14] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + + specification per se, and a compressor need not follow it in order to + be compliant. + + The compressor terminates a block when it determines that starting a + new block with fresh trees would be useful, or when the block size + fills up the compressor's block buffer. + + The compressor uses a chained hash table to find duplicated strings, + using a hash function that operates on 3-byte sequences. At any + given point during compression, let XYZ be the next 3 input bytes to + be examined (not necessarily all different, of course). First, the + compressor examines the hash chain for XYZ. If the chain is empty, + the compressor simply writes out X as a literal byte and advances one + byte in the input. If the hash chain is not empty, indicating that + the sequence XYZ (or, if we are unlucky, some other 3 bytes with the + same hash function value) has occurred recently, the compressor + compares all strings on the XYZ hash chain with the actual input data + sequence starting at the current point, and selects the longest + match. + + The compressor searches the hash chains starting with the most recent + strings, to favor small distances and thus take advantage of the + Huffman encoding. The hash chains are singly linked. There are no + deletions from the hash chains; the algorithm simply discards matches + that are too old. To avoid a worst-case situation, very long hash + chains are arbitrarily truncated at a certain length, determined by a + run-time parameter. + + To improve overall compression, the compressor optionally defers the + selection of matches ("lazy matching"): after a match of length N has + been found, the compressor searches for a longer match starting at + the next input byte. If it finds a longer match, it truncates the + previous match to a length of one (thus producing a single literal + byte) and then emits the longer match. Otherwise, it emits the + original match, and, as described above, advances N bytes before + continuing. + + Run-time parameters also control this "lazy match" procedure. If + compression ratio is most important, the compressor attempts a + complete second search regardless of the length of the first match. + In the normal case, if the current match is "long enough", the + compressor reduces the search for a longer match, thus speeding up + the process. If speed is most important, the compressor inserts new + strings in the hash table only when no match was found, or when the + match is not "too long". This degrades the compression ratio but + saves time since there are both fewer insertions and fewer searches. + + + + + +Deutsch Informational [Page 15] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + +5. References + + [1] Huffman, D. A., "A Method for the Construction of Minimum + Redundancy Codes", Proceedings of the Institute of Radio + Engineers, September 1952, Volume 40, Number 9, pp. 1098-1101. + + [2] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data + Compression", IEEE Transactions on Information Theory, Vol. 23, + No. 3, pp. 337-343. + + [3] Gailly, J.-L., and Adler, M., ZLIB documentation and sources, + available in ftp://ftp.uu.net/pub/archiving/zip/doc/ + + [4] Gailly, J.-L., and Adler, M., GZIP documentation and sources, + available as gzip-*.tar in ftp://prep.ai.mit.edu/pub/gnu/ + + [5] Schwartz, E. S., and Kallick, B. "Generating a canonical prefix + encoding." Comm. ACM, 7,3 (Mar. 1964), pp. 166-169. + + [6] Hirschberg and Lelewer, "Efficient decoding of prefix codes," + Comm. ACM, 33,4, April 1990, pp. 449-459. + +6. Security Considerations + + Any data compression method involves the reduction of redundancy in + the data. Consequently, any corruption of the data is likely to have + severe effects and be difficult to correct. Uncompressed text, on + the other hand, will probably still be readable despite the presence + of some corrupted bytes. + + It is recommended that systems using this data format provide some + means of validating the integrity of the compressed data. See + reference [3], for example. + +7. Source code + + Source code for a C language implementation of a "deflate" compliant + compressor and decompressor is available within the zlib package at + ftp://ftp.uu.net/pub/archiving/zip/zlib/. + +8. Acknowledgements + + Trademarks cited in this document are the property of their + respective owners. + + Phil Katz designed the deflate format. Jean-Loup Gailly and Mark + Adler wrote the related software described in this specification. + Glenn Randers-Pehrson converted this document to RFC and HTML format. + + + +Deutsch Informational [Page 16] + +RFC 1951 DEFLATE Compressed Data Format Specification May 1996 + + +9. Author's Address + + L. Peter Deutsch + Aladdin Enterprises + 203 Santa Margarita Ave. + Menlo Park, CA 94025 + + Phone: (415) 322-0103 (AM only) + FAX: (415) 322-1734 + EMail: + + Questions about the technical content of this specification can be + sent by email to: + + Jean-Loup Gailly and + Mark Adler + + Editorial comments on this specification can be sent by email to: + + L. Peter Deutsch and + Glenn Randers-Pehrson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Deutsch Informational [Page 17] + diff --git a/thirdparty/zlib/zlib-1.2.7/doc/rfc1952.txt b/thirdparty/zlib/zlib-1.2.7/doc/rfc1952.txt new file mode 100644 index 0000000..a8e51b4 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/doc/rfc1952.txt @@ -0,0 +1,675 @@ + + + + + + +Network Working Group P. Deutsch +Request for Comments: 1952 Aladdin Enterprises +Category: Informational May 1996 + + + GZIP file format specification version 4.3 + +Status of This Memo + + This memo provides information for the Internet community. This memo + does not specify an Internet standard of any kind. Distribution of + this memo is unlimited. + +IESG Note: + + The IESG takes no position on the validity of any Intellectual + Property Rights statements contained in this document. + +Notices + + Copyright (c) 1996 L. Peter Deutsch + + Permission is granted to copy and distribute this document for any + purpose and without charge, including translations into other + languages and incorporation into compilations, provided that the + copyright notice and this notice are preserved, and that any + substantive changes or deletions from the original are clearly + marked. + + A pointer to the latest version of this and related documentation in + HTML format can be found at the URL + . + +Abstract + + This specification defines a lossless compressed data format that is + compatible with the widely used GZIP utility. The format includes a + cyclic redundancy check value for detecting data corruption. The + format presently uses the DEFLATE method of compression but can be + easily extended to use other compression methods. The format can be + implemented readily in a manner not covered by patents. + + + + + + + + + + +Deutsch Informational [Page 1] + +RFC 1952 GZIP File Format Specification May 1996 + + +Table of Contents + + 1. Introduction ................................................... 2 + 1.1. Purpose ................................................... 2 + 1.2. Intended audience ......................................... 3 + 1.3. Scope ..................................................... 3 + 1.4. Compliance ................................................ 3 + 1.5. Definitions of terms and conventions used ................. 3 + 1.6. Changes from previous versions ............................ 3 + 2. Detailed specification ......................................... 4 + 2.1. Overall conventions ....................................... 4 + 2.2. File format ............................................... 5 + 2.3. Member format ............................................. 5 + 2.3.1. Member header and trailer ........................... 6 + 2.3.1.1. Extra field ................................... 8 + 2.3.1.2. Compliance .................................... 9 + 3. References .................................................. 9 + 4. Security Considerations .................................... 10 + 5. Acknowledgements ........................................... 10 + 6. Author's Address ........................................... 10 + 7. Appendix: Jean-Loup Gailly's gzip utility .................. 11 + 8. Appendix: Sample CRC Code .................................. 11 + +1. Introduction + + 1.1. Purpose + + The purpose of this specification is to define a lossless + compressed data format that: + + * Is independent of CPU type, operating system, file system, + and character set, and hence can be used for interchange; + * Can compress or decompress a data stream (as opposed to a + randomly accessible file) to produce another data stream, + using only an a priori bounded amount of intermediate + storage, and hence can be used in data communications or + similar structures such as Unix filters; + * Compresses data with efficiency comparable to the best + currently available general-purpose compression methods, + and in particular considerably better than the "compress" + program; + * Can be implemented readily in a manner not covered by + patents, and hence can be practiced freely; + * Is compatible with the file format produced by the current + widely used gzip utility, in that conforming decompressors + will be able to read data produced by the existing gzip + compressor. + + + + +Deutsch Informational [Page 2] + +RFC 1952 GZIP File Format Specification May 1996 + + + The data format defined by this specification does not attempt to: + + * Provide random access to compressed data; + * Compress specialized data (e.g., raster graphics) as well as + the best currently available specialized algorithms. + + 1.2. Intended audience + + This specification is intended for use by implementors of software + to compress data into gzip format and/or decompress data from gzip + format. + + The text of the specification assumes a basic background in + programming at the level of bits and other primitive data + representations. + + 1.3. Scope + + The specification specifies a compression method and a file format + (the latter assuming only that a file can store a sequence of + arbitrary bytes). It does not specify any particular interface to + a file system or anything about character sets or encodings + (except for file names and comments, which are optional). + + 1.4. Compliance + + Unless otherwise indicated below, a compliant decompressor must be + able to accept and decompress any file that conforms to all the + specifications presented here; a compliant compressor must produce + files that conform to all the specifications presented here. The + material in the appendices is not part of the specification per se + and is not relevant to compliance. + + 1.5. Definitions of terms and conventions used + + byte: 8 bits stored or transmitted as a unit (same as an octet). + (For this specification, a byte is exactly 8 bits, even on + machines which store a character on a number of bits different + from 8.) See below for the numbering of bits within a byte. + + 1.6. Changes from previous versions + + There have been no technical changes to the gzip format since + version 4.1 of this specification. In version 4.2, some + terminology was changed, and the sample CRC code was rewritten for + clarity and to eliminate the requirement for the caller to do pre- + and post-conditioning. Version 4.3 is a conversion of the + specification to RFC style. + + + +Deutsch Informational [Page 3] + +RFC 1952 GZIP File Format Specification May 1996 + + +2. Detailed specification + + 2.1. Overall conventions + + In the diagrams below, a box like this: + + +---+ + | | <-- the vertical bars might be missing + +---+ + + represents one byte; a box like this: + + +==============+ + | | + +==============+ + + represents a variable number of bytes. + + Bytes stored within a computer do not have a "bit order", since + they are always treated as a unit. However, a byte considered as + an integer between 0 and 255 does have a most- and least- + significant bit, and since we write numbers with the most- + significant digit on the left, we also write bytes with the most- + significant bit on the left. In the diagrams below, we number the + bits of a byte so that bit 0 is the least-significant bit, i.e., + the bits are numbered: + + +--------+ + |76543210| + +--------+ + + This document does not address the issue of the order in which + bits of a byte are transmitted on a bit-sequential medium, since + the data format described here is byte- rather than bit-oriented. + + Within a computer, a number may occupy multiple bytes. All + multi-byte numbers in the format described here are stored with + the least-significant byte first (at the lower memory address). + For example, the decimal number 520 is stored as: + + 0 1 + +--------+--------+ + |00001000|00000010| + +--------+--------+ + ^ ^ + | | + | + more significant byte = 2 x 256 + + less significant byte = 8 + + + +Deutsch Informational [Page 4] + +RFC 1952 GZIP File Format Specification May 1996 + + + 2.2. File format + + A gzip file consists of a series of "members" (compressed data + sets). The format of each member is specified in the following + section. The members simply appear one after another in the file, + with no additional information before, between, or after them. + + 2.3. Member format + + Each member has the following structure: + + +---+---+---+---+---+---+---+---+---+---+ + |ID1|ID2|CM |FLG| MTIME |XFL|OS | (more-->) + +---+---+---+---+---+---+---+---+---+---+ + + (if FLG.FEXTRA set) + + +---+---+=================================+ + | XLEN |...XLEN bytes of "extra field"...| (more-->) + +---+---+=================================+ + + (if FLG.FNAME set) + + +=========================================+ + |...original file name, zero-terminated...| (more-->) + +=========================================+ + + (if FLG.FCOMMENT set) + + +===================================+ + |...file comment, zero-terminated...| (more-->) + +===================================+ + + (if FLG.FHCRC set) + + +---+---+ + | CRC16 | + +---+---+ + + +=======================+ + |...compressed blocks...| (more-->) + +=======================+ + + 0 1 2 3 4 5 6 7 + +---+---+---+---+---+---+---+---+ + | CRC32 | ISIZE | + +---+---+---+---+---+---+---+---+ + + + + +Deutsch Informational [Page 5] + +RFC 1952 GZIP File Format Specification May 1996 + + + 2.3.1. Member header and trailer + + ID1 (IDentification 1) + ID2 (IDentification 2) + These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139 + (0x8b, \213), to identify the file as being in gzip format. + + CM (Compression Method) + This identifies the compression method used in the file. CM + = 0-7 are reserved. CM = 8 denotes the "deflate" + compression method, which is the one customarily used by + gzip and which is documented elsewhere. + + FLG (FLaGs) + This flag byte is divided into individual bits as follows: + + bit 0 FTEXT + bit 1 FHCRC + bit 2 FEXTRA + bit 3 FNAME + bit 4 FCOMMENT + bit 5 reserved + bit 6 reserved + bit 7 reserved + + If FTEXT is set, the file is probably ASCII text. This is + an optional indication, which the compressor may set by + checking a small amount of the input data to see whether any + non-ASCII characters are present. In case of doubt, FTEXT + is cleared, indicating binary data. For systems which have + different file formats for ascii text and binary data, the + decompressor can use FTEXT to choose the appropriate format. + We deliberately do not specify the algorithm used to set + this bit, since a compressor always has the option of + leaving it cleared and a decompressor always has the option + of ignoring it and letting some other program handle issues + of data conversion. + + If FHCRC is set, a CRC16 for the gzip header is present, + immediately before the compressed data. The CRC16 consists + of the two least significant bytes of the CRC32 for all + bytes of the gzip header up to and not including the CRC16. + [The FHCRC bit was never set by versions of gzip up to + 1.2.4, even though it was documented with a different + meaning in gzip 1.2.4.] + + If FEXTRA is set, optional extra fields are present, as + described in a following section. + + + +Deutsch Informational [Page 6] + +RFC 1952 GZIP File Format Specification May 1996 + + + If FNAME is set, an original file name is present, + terminated by a zero byte. The name must consist of ISO + 8859-1 (LATIN-1) characters; on operating systems using + EBCDIC or any other character set for file names, the name + must be translated to the ISO LATIN-1 character set. This + is the original name of the file being compressed, with any + directory components removed, and, if the file being + compressed is on a file system with case insensitive names, + forced to lower case. There is no original file name if the + data was compressed from a source other than a named file; + for example, if the source was stdin on a Unix system, there + is no file name. + + If FCOMMENT is set, a zero-terminated file comment is + present. This comment is not interpreted; it is only + intended for human consumption. The comment must consist of + ISO 8859-1 (LATIN-1) characters. Line breaks should be + denoted by a single line feed character (10 decimal). + + Reserved FLG bits must be zero. + + MTIME (Modification TIME) + This gives the most recent modification time of the original + file being compressed. The time is in Unix format, i.e., + seconds since 00:00:00 GMT, Jan. 1, 1970. (Note that this + may cause problems for MS-DOS and other systems that use + local rather than Universal time.) If the compressed data + did not come from a file, MTIME is set to the time at which + compression started. MTIME = 0 means no time stamp is + available. + + XFL (eXtra FLags) + These flags are available for use by specific compression + methods. The "deflate" method (CM = 8) sets these flags as + follows: + + XFL = 2 - compressor used maximum compression, + slowest algorithm + XFL = 4 - compressor used fastest algorithm + + OS (Operating System) + This identifies the type of file system on which compression + took place. This may be useful in determining end-of-line + convention for text files. The currently defined values are + as follows: + + + + + + +Deutsch Informational [Page 7] + +RFC 1952 GZIP File Format Specification May 1996 + + + 0 - FAT filesystem (MS-DOS, OS/2, NT/Win32) + 1 - Amiga + 2 - VMS (or OpenVMS) + 3 - Unix + 4 - VM/CMS + 5 - Atari TOS + 6 - HPFS filesystem (OS/2, NT) + 7 - Macintosh + 8 - Z-System + 9 - CP/M + 10 - TOPS-20 + 11 - NTFS filesystem (NT) + 12 - QDOS + 13 - Acorn RISCOS + 255 - unknown + + XLEN (eXtra LENgth) + If FLG.FEXTRA is set, this gives the length of the optional + extra field. See below for details. + + CRC32 (CRC-32) + This contains a Cyclic Redundancy Check value of the + uncompressed data computed according to CRC-32 algorithm + used in the ISO 3309 standard and in section 8.1.1.6.2 of + ITU-T recommendation V.42. (See http://www.iso.ch for + ordering ISO documents. See gopher://info.itu.ch for an + online version of ITU-T V.42.) + + ISIZE (Input SIZE) + This contains the size of the original (uncompressed) input + data modulo 2^32. + + 2.3.1.1. Extra field + + If the FLG.FEXTRA bit is set, an "extra field" is present in + the header, with total length XLEN bytes. It consists of a + series of subfields, each of the form: + + +---+---+---+---+==================================+ + |SI1|SI2| LEN |... LEN bytes of subfield data ...| + +---+---+---+---+==================================+ + + SI1 and SI2 provide a subfield ID, typically two ASCII letters + with some mnemonic value. Jean-Loup Gailly + is maintaining a registry of subfield + IDs; please send him any subfield ID you wish to use. Subfield + IDs with SI2 = 0 are reserved for future use. The following + IDs are currently defined: + + + +Deutsch Informational [Page 8] + +RFC 1952 GZIP File Format Specification May 1996 + + + SI1 SI2 Data + ---------- ---------- ---- + 0x41 ('A') 0x70 ('P') Apollo file type information + + LEN gives the length of the subfield data, excluding the 4 + initial bytes. + + 2.3.1.2. Compliance + + A compliant compressor must produce files with correct ID1, + ID2, CM, CRC32, and ISIZE, but may set all the other fields in + the fixed-length part of the header to default values (255 for + OS, 0 for all others). The compressor must set all reserved + bits to zero. + + A compliant decompressor must check ID1, ID2, and CM, and + provide an error indication if any of these have incorrect + values. It must examine FEXTRA/XLEN, FNAME, FCOMMENT and FHCRC + at least so it can skip over the optional fields if they are + present. It need not examine any other part of the header or + trailer; in particular, a decompressor may ignore FTEXT and OS + and always produce binary output, and still be compliant. A + compliant decompressor must give an error indication if any + reserved bit is non-zero, since such a bit could indicate the + presence of a new field that would cause subsequent data to be + interpreted incorrectly. + +3. References + + [1] "Information Processing - 8-bit single-byte coded graphic + character sets - Part 1: Latin alphabet No.1" (ISO 8859-1:1987). + The ISO 8859-1 (Latin-1) character set is a superset of 7-bit + ASCII. Files defining this character set are available as + iso_8859-1.* in ftp://ftp.uu.net/graphics/png/documents/ + + [2] ISO 3309 + + [3] ITU-T recommendation V.42 + + [4] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification", + available in ftp://ftp.uu.net/pub/archiving/zip/doc/ + + [5] Gailly, J.-L., GZIP documentation, available as gzip-*.tar in + ftp://prep.ai.mit.edu/pub/gnu/ + + [6] Sarwate, D.V., "Computation of Cyclic Redundancy Checks via Table + Look-Up", Communications of the ACM, 31(8), pp.1008-1013. + + + + +Deutsch Informational [Page 9] + +RFC 1952 GZIP File Format Specification May 1996 + + + [7] Schwaderer, W.D., "CRC Calculation", April 85 PC Tech Journal, + pp.118-133. + + [8] ftp://ftp.adelaide.edu.au/pub/rocksoft/papers/crc_v3.txt, + describing the CRC concept. + +4. Security Considerations + + Any data compression method involves the reduction of redundancy in + the data. Consequently, any corruption of the data is likely to have + severe effects and be difficult to correct. Uncompressed text, on + the other hand, will probably still be readable despite the presence + of some corrupted bytes. + + It is recommended that systems using this data format provide some + means of validating the integrity of the compressed data, such as by + setting and checking the CRC-32 check value. + +5. Acknowledgements + + Trademarks cited in this document are the property of their + respective owners. + + Jean-Loup Gailly designed the gzip format and wrote, with Mark Adler, + the related software described in this specification. Glenn + Randers-Pehrson converted this document to RFC and HTML format. + +6. Author's Address + + L. Peter Deutsch + Aladdin Enterprises + 203 Santa Margarita Ave. + Menlo Park, CA 94025 + + Phone: (415) 322-0103 (AM only) + FAX: (415) 322-1734 + EMail: + + Questions about the technical content of this specification can be + sent by email to: + + Jean-Loup Gailly and + Mark Adler + + Editorial comments on this specification can be sent by email to: + + L. Peter Deutsch and + Glenn Randers-Pehrson + + + +Deutsch Informational [Page 10] + +RFC 1952 GZIP File Format Specification May 1996 + + +7. Appendix: Jean-Loup Gailly's gzip utility + + The most widely used implementation of gzip compression, and the + original documentation on which this specification is based, were + created by Jean-Loup Gailly . Since this + implementation is a de facto standard, we mention some more of its + features here. Again, the material in this section is not part of + the specification per se, and implementations need not follow it to + be compliant. + + When compressing or decompressing a file, gzip preserves the + protection, ownership, and modification time attributes on the local + file system, since there is no provision for representing protection + attributes in the gzip file format itself. Since the file format + includes a modification time, the gzip decompressor provides a + command line switch that assigns the modification time from the file, + rather than the local modification time of the compressed input, to + the decompressed output. + +8. Appendix: Sample CRC Code + + The following sample code represents a practical implementation of + the CRC (Cyclic Redundancy Check). (See also ISO 3309 and ITU-T V.42 + for a formal specification.) + + The sample code is in the ANSI C programming language. Non C users + may find it easier to read with these hints: + + & Bitwise AND operator. + ^ Bitwise exclusive-OR operator. + >> Bitwise right shift operator. When applied to an + unsigned quantity, as here, right shift inserts zero + bit(s) at the left. + ! Logical NOT operator. + ++ "n++" increments the variable n. + 0xNNN 0x introduces a hexadecimal (base 16) constant. + Suffix L indicates a long value (at least 32 bits). + + /* Table of CRCs of all 8-bit messages. */ + unsigned long crc_table[256]; + + /* Flag: has the table been computed? Initially false. */ + int crc_table_computed = 0; + + /* Make the table for a fast CRC. */ + void make_crc_table(void) + { + unsigned long c; + + + +Deutsch Informational [Page 11] + +RFC 1952 GZIP File Format Specification May 1996 + + + int n, k; + for (n = 0; n < 256; n++) { + c = (unsigned long) n; + for (k = 0; k < 8; k++) { + if (c & 1) { + c = 0xedb88320L ^ (c >> 1); + } else { + c = c >> 1; + } + } + crc_table[n] = c; + } + crc_table_computed = 1; + } + + /* + Update a running crc with the bytes buf[0..len-1] and return + the updated crc. The crc should be initialized to zero. Pre- and + post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the caller. Usage example: + + unsigned long crc = 0L; + + while (read_buffer(buffer, length) != EOF) { + crc = update_crc(crc, buffer, length); + } + if (crc != original_crc) error(); + */ + unsigned long update_crc(unsigned long crc, + unsigned char *buf, int len) + { + unsigned long c = crc ^ 0xffffffffL; + int n; + + if (!crc_table_computed) + make_crc_table(); + for (n = 0; n < len; n++) { + c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); + } + return c ^ 0xffffffffL; + } + + /* Return the CRC of the bytes buf[0..len-1]. */ + unsigned long crc(unsigned char *buf, int len) + { + return update_crc(0L, buf, len); + } + + + + +Deutsch Informational [Page 12] + diff --git a/thirdparty/zlib/zlib-1.2.7/doc/txtvsbin.txt b/thirdparty/zlib/zlib-1.2.7/doc/txtvsbin.txt new file mode 100644 index 0000000..3d0f063 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/doc/txtvsbin.txt @@ -0,0 +1,107 @@ +A Fast Method for Identifying Plain Text Files +============================================== + + +Introduction +------------ + +Given a file coming from an unknown source, it is sometimes desirable +to find out whether the format of that file is plain text. Although +this may appear like a simple task, a fully accurate detection of the +file type requires heavy-duty semantic analysis on the file contents. +It is, however, possible to obtain satisfactory results by employing +various heuristics. + +Previous versions of PKZip and other zip-compatible compression tools +were using a crude detection scheme: if more than 80% (4/5) of the bytes +found in a certain buffer are within the range [7..127], the file is +labeled as plain text, otherwise it is labeled as binary. A prominent +limitation of this scheme is the restriction to Latin-based alphabets. +Other alphabets, like Greek, Cyrillic or Asian, make extensive use of +the bytes within the range [128..255], and texts using these alphabets +are most often misidentified by this scheme; in other words, the rate +of false negatives is sometimes too high, which means that the recall +is low. Another weakness of this scheme is a reduced precision, due to +the false positives that may occur when binary files containing large +amounts of textual characters are misidentified as plain text. + +In this article we propose a new, simple detection scheme that features +a much increased precision and a near-100% recall. This scheme is +designed to work on ASCII, Unicode and other ASCII-derived alphabets, +and it handles single-byte encodings (ISO-8859, MacRoman, KOI8, etc.) +and variable-sized encodings (ISO-2022, UTF-8, etc.). Wider encodings +(UCS-2/UTF-16 and UCS-4/UTF-32) are not handled, however. + + +The Algorithm +------------- + +The algorithm works by dividing the set of bytecodes [0..255] into three +categories: +- The white list of textual bytecodes: + 9 (TAB), 10 (LF), 13 (CR), 32 (SPACE) to 255. +- The gray list of tolerated bytecodes: + 7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB), 27 (ESC). +- The black list of undesired, non-textual bytecodes: + 0 (NUL) to 6, 14 to 31. + +If a file contains at least one byte that belongs to the white list and +no byte that belongs to the black list, then the file is categorized as +plain text; otherwise, it is categorized as binary. (The boundary case, +when the file is empty, automatically falls into the latter category.) + + +Rationale +--------- + +The idea behind this algorithm relies on two observations. + +The first observation is that, although the full range of 7-bit codes +[0..127] is properly specified by the ASCII standard, most control +characters in the range [0..31] are not used in practice. The only +widely-used, almost universally-portable control codes are 9 (TAB), +10 (LF) and 13 (CR). There are a few more control codes that are +recognized on a reduced range of platforms and text viewers/editors: +7 (BEL), 8 (BS), 11 (VT), 12 (FF), 26 (SUB) and 27 (ESC); but these +codes are rarely (if ever) used alone, without being accompanied by +some printable text. Even the newer, portable text formats such as +XML avoid using control characters outside the list mentioned here. + +The second observation is that most of the binary files tend to contain +control characters, especially 0 (NUL). Even though the older text +detection schemes observe the presence of non-ASCII codes from the range +[128..255], the precision rarely has to suffer if this upper range is +labeled as textual, because the files that are genuinely binary tend to +contain both control characters and codes from the upper range. On the +other hand, the upper range needs to be labeled as textual, because it +is used by virtually all ASCII extensions. In particular, this range is +used for encoding non-Latin scripts. + +Since there is no counting involved, other than simply observing the +presence or the absence of some byte values, the algorithm produces +consistent results, regardless what alphabet encoding is being used. +(If counting were involved, it could be possible to obtain different +results on a text encoded, say, using ISO-8859-16 versus UTF-8.) + +There is an extra category of plain text files that are "polluted" with +one or more black-listed codes, either by mistake or by peculiar design +considerations. In such cases, a scheme that tolerates a small fraction +of black-listed codes would provide an increased recall (i.e. more true +positives). This, however, incurs a reduced precision overall, since +false positives are more likely to appear in binary files that contain +large chunks of textual data. Furthermore, "polluted" plain text should +be regarded as binary by general-purpose text detection schemes, because +general-purpose text processing algorithms might not be applicable. +Under this premise, it is safe to say that our detection method provides +a near-100% recall. + +Experiments have been run on many files coming from various platforms +and applications. We tried plain text files, system logs, source code, +formatted office documents, compiled object code, etc. The results +confirm the optimistic assumptions about the capabilities of this +algorithm. + + +-- +Cosmin Truta +Last updated: 2006-May-28 diff --git a/thirdparty/zlib/zlib-1.2.7/examples/README.examples b/thirdparty/zlib/zlib-1.2.7/examples/README.examples new file mode 100644 index 0000000..56a3171 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/README.examples @@ -0,0 +1,49 @@ +This directory contains examples of the use of zlib and other relevant +programs and documentation. + +enough.c + calculation and justification of ENOUGH parameter in inftrees.h + - calculates the maximum table space used in inflate tree + construction over all possible Huffman codes + +fitblk.c + compress just enough input to nearly fill a requested output size + - zlib isn't designed to do this, but fitblk does it anyway + +gun.c + uncompress a gzip file + - illustrates the use of inflateBack() for high speed file-to-file + decompression using call-back functions + - is approximately twice as fast as gzip -d + - also provides Unix uncompress functionality, again twice as fast + +gzappend.c + append to a gzip file + - illustrates the use of the Z_BLOCK flush parameter for inflate() + - illustrates the use of deflatePrime() to start at any bit + +gzjoin.c + join gzip files without recalculating the crc or recompressing + - illustrates the use of the Z_BLOCK flush parameter for inflate() + - illustrates the use of crc32_combine() + +gzlog.c +gzlog.h + efficiently and robustly maintain a message log file in gzip format + - illustrates use of raw deflate, Z_PARTIAL_FLUSH, deflatePrime(), + and deflateSetDictionary() + - illustrates use of a gzip header extra field + +zlib_how.html + painfully comprehensive description of zpipe.c (see below) + - describes in excruciating detail the use of deflate() and inflate() + +zpipe.c + reads and writes zlib streams from stdin to stdout + - illustrates the proper use of deflate() and inflate() + - deeply commented in zlib_how.html (see above) + +zran.c + index a zlib or gzip stream and randomly access it + - illustrates the use of Z_BLOCK, inflatePrime(), and + inflateSetDictionary() to provide random access diff --git a/thirdparty/zlib/zlib-1.2.7/examples/enough.c b/thirdparty/zlib/zlib-1.2.7/examples/enough.c new file mode 100644 index 0000000..c40410b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/enough.c @@ -0,0 +1,569 @@ +/* enough.c -- determine the maximum size of inflate's Huffman code tables over + * all possible valid and complete Huffman codes, subject to a length limit. + * Copyright (C) 2007, 2008 Mark Adler + * Version 1.3 17 February 2008 Mark Adler + */ + +/* Version history: + 1.0 3 Jan 2007 First version (derived from codecount.c version 1.4) + 1.1 4 Jan 2007 Use faster incremental table usage computation + Prune examine() search on previously visited states + 1.2 5 Jan 2007 Comments clean up + As inflate does, decrease root for short codes + Refuse cases where inflate would increase root + 1.3 17 Feb 2008 Add argument for initial root table size + Fix bug for initial root table size == max - 1 + Use a macro to compute the history index + */ + +/* + Examine all possible Huffman codes for a given number of symbols and a + maximum code length in bits to determine the maximum table size for zilb's + inflate. Only complete Huffman codes are counted. + + Two codes are considered distinct if the vectors of the number of codes per + length are not identical. So permutations of the symbol assignments result + in the same code for the counting, as do permutations of the assignments of + the bit values to the codes (i.e. only canonical codes are counted). + + We build a code from shorter to longer lengths, determining how many symbols + are coded at each length. At each step, we have how many symbols remain to + be coded, what the last code length used was, and how many bit patterns of + that length remain unused. Then we add one to the code length and double the + number of unused patterns to graduate to the next code length. We then + assign all portions of the remaining symbols to that code length that + preserve the properties of a correct and eventually complete code. Those + properties are: we cannot use more bit patterns than are available; and when + all the symbols are used, there are exactly zero possible bit patterns + remaining. + + The inflate Huffman decoding algorithm uses two-level lookup tables for + speed. There is a single first-level table to decode codes up to root bits + in length (root == 9 in the current inflate implementation). The table + has 1 << root entries and is indexed by the next root bits of input. Codes + shorter than root bits have replicated table entries, so that the correct + entry is pointed to regardless of the bits that follow the short code. If + the code is longer than root bits, then the table entry points to a second- + level table. The size of that table is determined by the longest code with + that root-bit prefix. If that longest code has length len, then the table + has size 1 << (len - root), to index the remaining bits in that set of + codes. Each subsequent root-bit prefix then has its own sub-table. The + total number of table entries required by the code is calculated + incrementally as the number of codes at each bit length is populated. When + all of the codes are shorter than root bits, then root is reduced to the + longest code length, resulting in a single, smaller, one-level table. + + The inflate algorithm also provides for small values of root (relative to + the log2 of the number of symbols), where the shortest code has more bits + than root. In that case, root is increased to the length of the shortest + code. This program, by design, does not handle that case, so it is verified + that the number of symbols is less than 2^(root + 1). + + In order to speed up the examination (by about ten orders of magnitude for + the default arguments), the intermediate states in the build-up of a code + are remembered and previously visited branches are pruned. The memory + required for this will increase rapidly with the total number of symbols and + the maximum code length in bits. However this is a very small price to pay + for the vast speedup. + + First, all of the possible Huffman codes are counted, and reachable + intermediate states are noted by a non-zero count in a saved-results array. + Second, the intermediate states that lead to (root + 1) bit or longer codes + are used to look at all sub-codes from those junctures for their inflate + memory usage. (The amount of memory used is not affected by the number of + codes of root bits or less in length.) Third, the visited states in the + construction of those sub-codes and the associated calculation of the table + size is recalled in order to avoid recalculating from the same juncture. + Beginning the code examination at (root + 1) bit codes, which is enabled by + identifying the reachable nodes, accounts for about six of the orders of + magnitude of improvement for the default arguments. About another four + orders of magnitude come from not revisiting previous states. Out of + approximately 2x10^16 possible Huffman codes, only about 2x10^6 sub-codes + need to be examined to cover all of the possible table memory usage cases + for the default arguments of 286 symbols limited to 15-bit codes. + + Note that an unsigned long long type is used for counting. It is quite easy + to exceed the capacity of an eight-byte integer with a large number of + symbols and a large maximum code length, so multiple-precision arithmetic + would need to replace the unsigned long long arithmetic in that case. This + program will abort if an overflow occurs. The big_t type identifies where + the counting takes place. + + An unsigned long long type is also used for calculating the number of + possible codes remaining at the maximum length. This limits the maximum + code length to the number of bits in a long long minus the number of bits + needed to represent the symbols in a flat code. The code_t type identifies + where the bit pattern counting takes place. + */ + +#include +#include +#include +#include + +#define local static + +/* special data types */ +typedef unsigned long long big_t; /* type for code counting */ +typedef unsigned long long code_t; /* type for bit pattern counting */ +struct tab { /* type for been here check */ + size_t len; /* length of bit vector in char's */ + char *vec; /* allocated bit vector */ +}; + +/* The array for saving results, num[], is indexed with this triplet: + + syms: number of symbols remaining to code + left: number of available bit patterns at length len + len: number of bits in the codes currently being assigned + + Those indices are constrained thusly when saving results: + + syms: 3..totsym (totsym == total symbols to code) + left: 2..syms - 1, but only the evens (so syms == 8 -> 2, 4, 6) + len: 1..max - 1 (max == maximum code length in bits) + + syms == 2 is not saved since that immediately leads to a single code. left + must be even, since it represents the number of available bit patterns at + the current length, which is double the number at the previous length. + left ends at syms-1 since left == syms immediately results in a single code. + (left > sym is not allowed since that would result in an incomplete code.) + len is less than max, since the code completes immediately when len == max. + + The offset into the array is calculated for the three indices with the + first one (syms) being outermost, and the last one (len) being innermost. + We build the array with length max-1 lists for the len index, with syms-3 + of those for each symbol. There are totsym-2 of those, with each one + varying in length as a function of sym. See the calculation of index in + count() for the index, and the calculation of size in main() for the size + of the array. + + For the deflate example of 286 symbols limited to 15-bit codes, the array + has 284,284 entries, taking up 2.17 MB for an 8-byte big_t. More than + half of the space allocated for saved results is actually used -- not all + possible triplets are reached in the generation of valid Huffman codes. + */ + +/* The array for tracking visited states, done[], is itself indexed identically + to the num[] array as described above for the (syms, left, len) triplet. + Each element in the array is further indexed by the (mem, rem) doublet, + where mem is the amount of inflate table space used so far, and rem is the + remaining unused entries in the current inflate sub-table. Each indexed + element is simply one bit indicating whether the state has been visited or + not. Since the ranges for mem and rem are not known a priori, each bit + vector is of a variable size, and grows as needed to accommodate the visited + states. mem and rem are used to calculate a single index in a triangular + array. Since the range of mem is expected in the default case to be about + ten times larger than the range of rem, the array is skewed to reduce the + memory usage, with eight times the range for mem than for rem. See the + calculations for offset and bit in beenhere() for the details. + + For the deflate example of 286 symbols limited to 15-bit codes, the bit + vectors grow to total approximately 21 MB, in addition to the 4.3 MB done[] + array itself. + */ + +/* Globals to avoid propagating constants or constant pointers recursively */ +local int max; /* maximum allowed bit length for the codes */ +local int root; /* size of base code table in bits */ +local int large; /* largest code table so far */ +local size_t size; /* number of elements in num and done */ +local int *code; /* number of symbols assigned to each bit length */ +local big_t *num; /* saved results array for code counting */ +local struct tab *done; /* states already evaluated array */ + +/* Index function for num[] and done[] */ +#define INDEX(i,j,k) (((size_t)((i-1)>>1)*((i-2)>>1)+(j>>1)-1)*(max-1)+k-1) + +/* Free allocated space. Uses globals code, num, and done. */ +local void cleanup(void) +{ + size_t n; + + if (done != NULL) { + for (n = 0; n < size; n++) + if (done[n].len) + free(done[n].vec); + free(done); + } + if (num != NULL) + free(num); + if (code != NULL) + free(code); +} + +/* Return the number of possible Huffman codes using bit patterns of lengths + len through max inclusive, coding syms symbols, with left bit patterns of + length len unused -- return -1 if there is an overflow in the counting. + Keep a record of previous results in num to prevent repeating the same + calculation. Uses the globals max and num. */ +local big_t count(int syms, int len, int left) +{ + big_t sum; /* number of possible codes from this juncture */ + big_t got; /* value returned from count() */ + int least; /* least number of syms to use at this juncture */ + int most; /* most number of syms to use at this juncture */ + int use; /* number of bit patterns to use in next call */ + size_t index; /* index of this case in *num */ + + /* see if only one possible code */ + if (syms == left) + return 1; + + /* note and verify the expected state */ + assert(syms > left && left > 0 && len < max); + + /* see if we've done this one already */ + index = INDEX(syms, left, len); + got = num[index]; + if (got) + return got; /* we have -- return the saved result */ + + /* we need to use at least this many bit patterns so that the code won't be + incomplete at the next length (more bit patterns than symbols) */ + least = (left << 1) - syms; + if (least < 0) + least = 0; + + /* we can use at most this many bit patterns, lest there not be enough + available for the remaining symbols at the maximum length (if there were + no limit to the code length, this would become: most = left - 1) */ + most = (((code_t)left << (max - len)) - syms) / + (((code_t)1 << (max - len)) - 1); + + /* count all possible codes from this juncture and add them up */ + sum = 0; + for (use = least; use <= most; use++) { + got = count(syms - use, len + 1, (left - use) << 1); + sum += got; + if (got == -1 || sum < got) /* overflow */ + return -1; + } + + /* verify that all recursive calls are productive */ + assert(sum != 0); + + /* save the result and return it */ + num[index] = sum; + return sum; +} + +/* Return true if we've been here before, set to true if not. Set a bit in a + bit vector to indicate visiting this state. Each (syms,len,left) state + has a variable size bit vector indexed by (mem,rem). The bit vector is + lengthened if needed to allow setting the (mem,rem) bit. */ +local int beenhere(int syms, int len, int left, int mem, int rem) +{ + size_t index; /* index for this state's bit vector */ + size_t offset; /* offset in this state's bit vector */ + int bit; /* mask for this state's bit */ + size_t length; /* length of the bit vector in bytes */ + char *vector; /* new or enlarged bit vector */ + + /* point to vector for (syms,left,len), bit in vector for (mem,rem) */ + index = INDEX(syms, left, len); + mem -= 1 << root; + offset = (mem >> 3) + rem; + offset = ((offset * (offset + 1)) >> 1) + rem; + bit = 1 << (mem & 7); + + /* see if we've been here */ + length = done[index].len; + if (offset < length && (done[index].vec[offset] & bit) != 0) + return 1; /* done this! */ + + /* we haven't been here before -- set the bit to show we have now */ + + /* see if we need to lengthen the vector in order to set the bit */ + if (length <= offset) { + /* if we have one already, enlarge it, zero out the appended space */ + if (length) { + do { + length <<= 1; + } while (length <= offset); + vector = realloc(done[index].vec, length); + if (vector != NULL) + memset(vector + done[index].len, 0, length - done[index].len); + } + + /* otherwise we need to make a new vector and zero it out */ + else { + length = 1 << (len - root); + while (length <= offset) + length <<= 1; + vector = calloc(length, sizeof(char)); + } + + /* in either case, bail if we can't get the memory */ + if (vector == NULL) { + fputs("abort: unable to allocate enough memory\n", stderr); + cleanup(); + exit(1); + } + + /* install the new vector */ + done[index].len = length; + done[index].vec = vector; + } + + /* set the bit */ + done[index].vec[offset] |= bit; + return 0; +} + +/* Examine all possible codes from the given node (syms, len, left). Compute + the amount of memory required to build inflate's decoding tables, where the + number of code structures used so far is mem, and the number remaining in + the current sub-table is rem. Uses the globals max, code, root, large, and + done. */ +local void examine(int syms, int len, int left, int mem, int rem) +{ + int least; /* least number of syms to use at this juncture */ + int most; /* most number of syms to use at this juncture */ + int use; /* number of bit patterns to use in next call */ + + /* see if we have a complete code */ + if (syms == left) { + /* set the last code entry */ + code[len] = left; + + /* complete computation of memory used by this code */ + while (rem < left) { + left -= rem; + rem = 1 << (len - root); + mem += rem; + } + assert(rem == left); + + /* if this is a new maximum, show the entries used and the sub-code */ + if (mem > large) { + large = mem; + printf("max %d: ", mem); + for (use = root + 1; use <= max; use++) + if (code[use]) + printf("%d[%d] ", code[use], use); + putchar('\n'); + fflush(stdout); + } + + /* remove entries as we drop back down in the recursion */ + code[len] = 0; + return; + } + + /* prune the tree if we can */ + if (beenhere(syms, len, left, mem, rem)) + return; + + /* we need to use at least this many bit patterns so that the code won't be + incomplete at the next length (more bit patterns than symbols) */ + least = (left << 1) - syms; + if (least < 0) + least = 0; + + /* we can use at most this many bit patterns, lest there not be enough + available for the remaining symbols at the maximum length (if there were + no limit to the code length, this would become: most = left - 1) */ + most = (((code_t)left << (max - len)) - syms) / + (((code_t)1 << (max - len)) - 1); + + /* occupy least table spaces, creating new sub-tables as needed */ + use = least; + while (rem < use) { + use -= rem; + rem = 1 << (len - root); + mem += rem; + } + rem -= use; + + /* examine codes from here, updating table space as we go */ + for (use = least; use <= most; use++) { + code[len] = use; + examine(syms - use, len + 1, (left - use) << 1, + mem + (rem ? 1 << (len - root) : 0), rem << 1); + if (rem == 0) { + rem = 1 << (len - root); + mem += rem; + } + rem--; + } + + /* remove entries as we drop back down in the recursion */ + code[len] = 0; +} + +/* Look at all sub-codes starting with root + 1 bits. Look at only the valid + intermediate code states (syms, left, len). For each completed code, + calculate the amount of memory required by inflate to build the decoding + tables. Find the maximum amount of memory required and show the code that + requires that maximum. Uses the globals max, root, and num. */ +local void enough(int syms) +{ + int n; /* number of remaing symbols for this node */ + int left; /* number of unused bit patterns at this length */ + size_t index; /* index of this case in *num */ + + /* clear code */ + for (n = 0; n <= max; n++) + code[n] = 0; + + /* look at all (root + 1) bit and longer codes */ + large = 1 << root; /* base table */ + if (root < max) /* otherwise, there's only a base table */ + for (n = 3; n <= syms; n++) + for (left = 2; left < n; left += 2) + { + /* look at all reachable (root + 1) bit nodes, and the + resulting codes (complete at root + 2 or more) */ + index = INDEX(n, left, root + 1); + if (root + 1 < max && num[index]) /* reachable node */ + examine(n, root + 1, left, 1 << root, 0); + + /* also look at root bit codes with completions at root + 1 + bits (not saved in num, since complete), just in case */ + if (num[index - 1] && n <= left << 1) + examine((n - left) << 1, root + 1, (n - left) << 1, + 1 << root, 0); + } + + /* done */ + printf("done: maximum of %d table entries\n", large); +} + +/* + Examine and show the total number of possible Huffman codes for a given + maximum number of symbols, initial root table size, and maximum code length + in bits -- those are the command arguments in that order. The default + values are 286, 9, and 15 respectively, for the deflate literal/length code. + The possible codes are counted for each number of coded symbols from two to + the maximum. The counts for each of those and the total number of codes are + shown. The maximum number of inflate table entires is then calculated + across all possible codes. Each new maximum number of table entries and the + associated sub-code (starting at root + 1 == 10 bits) is shown. + + To count and examine Huffman codes that are not length-limited, provide a + maximum length equal to the number of symbols minus one. + + For the deflate literal/length code, use "enough". For the deflate distance + code, use "enough 30 6". + + This uses the %llu printf format to print big_t numbers, which assumes that + big_t is an unsigned long long. If the big_t type is changed (for example + to a multiple precision type), the method of printing will also need to be + updated. + */ +int main(int argc, char **argv) +{ + int syms; /* total number of symbols to code */ + int n; /* number of symbols to code for this run */ + big_t got; /* return value of count() */ + big_t sum; /* accumulated number of codes over n */ + + /* set up globals for cleanup() */ + code = NULL; + num = NULL; + done = NULL; + + /* get arguments -- default to the deflate literal/length code */ + syms = 286; + root = 9; + max = 15; + if (argc > 1) { + syms = atoi(argv[1]); + if (argc > 2) { + root = atoi(argv[2]); + if (argc > 3) + max = atoi(argv[3]); + } + } + if (argc > 4 || syms < 2 || root < 1 || max < 1) { + fputs("invalid arguments, need: [sym >= 2 [root >= 1 [max >= 1]]]\n", + stderr); + return 1; + } + + /* if not restricting the code length, the longest is syms - 1 */ + if (max > syms - 1) + max = syms - 1; + + /* determine the number of bits in a code_t */ + n = 0; + while (((code_t)1 << n) != 0) + n++; + + /* make sure that the calculation of most will not overflow */ + if (max > n || syms - 2 >= (((code_t)0 - 1) >> (max - 1))) { + fputs("abort: code length too long for internal types\n", stderr); + return 1; + } + + /* reject impossible code requests */ + if (syms - 1 > ((code_t)1 << max) - 1) { + fprintf(stderr, "%d symbols cannot be coded in %d bits\n", + syms, max); + return 1; + } + + /* allocate code vector */ + code = calloc(max + 1, sizeof(int)); + if (code == NULL) { + fputs("abort: unable to allocate enough memory\n", stderr); + return 1; + } + + /* determine size of saved results array, checking for overflows, + allocate and clear the array (set all to zero with calloc()) */ + if (syms == 2) /* iff max == 1 */ + num = NULL; /* won't be saving any results */ + else { + size = syms >> 1; + if (size > ((size_t)0 - 1) / (n = (syms - 1) >> 1) || + (size *= n, size > ((size_t)0 - 1) / (n = max - 1)) || + (size *= n, size > ((size_t)0 - 1) / sizeof(big_t)) || + (num = calloc(size, sizeof(big_t))) == NULL) { + fputs("abort: unable to allocate enough memory\n", stderr); + cleanup(); + return 1; + } + } + + /* count possible codes for all numbers of symbols, add up counts */ + sum = 0; + for (n = 2; n <= syms; n++) { + got = count(n, 1, 2); + sum += got; + if (got == -1 || sum < got) { /* overflow */ + fputs("abort: can't count that high!\n", stderr); + cleanup(); + return 1; + } + printf("%llu %d-codes\n", got, n); + } + printf("%llu total codes for 2 to %d symbols", sum, syms); + if (max < syms - 1) + printf(" (%d-bit length limit)\n", max); + else + puts(" (no length limit)"); + + /* allocate and clear done array for beenhere() */ + if (syms == 2) + done = NULL; + else if (size > ((size_t)0 - 1) / sizeof(struct tab) || + (done = calloc(size, sizeof(struct tab))) == NULL) { + fputs("abort: unable to allocate enough memory\n", stderr); + cleanup(); + return 1; + } + + /* find and show maximum inflate table usage */ + if (root > max) /* reduce root to max length */ + root = max; + if (syms < ((code_t)1 << (root + 1))) + enough(syms); + else + puts("cannot handle minimum code lengths > root"); + + /* done */ + cleanup(); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/fitblk.c b/thirdparty/zlib/zlib-1.2.7/examples/fitblk.c new file mode 100644 index 0000000..c61de5c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/fitblk.c @@ -0,0 +1,233 @@ +/* fitblk.c: example of fitting compressed output to a specified size + Not copyrighted -- provided to the public domain + Version 1.1 25 November 2004 Mark Adler */ + +/* Version history: + 1.0 24 Nov 2004 First version + 1.1 25 Nov 2004 Change deflateInit2() to deflateInit() + Use fixed-size, stack-allocated raw buffers + Simplify code moving compression to subroutines + Use assert() for internal errors + Add detailed description of approach + */ + +/* Approach to just fitting a requested compressed size: + + fitblk performs three compression passes on a portion of the input + data in order to determine how much of that input will compress to + nearly the requested output block size. The first pass generates + enough deflate blocks to produce output to fill the requested + output size plus a specfied excess amount (see the EXCESS define + below). The last deflate block may go quite a bit past that, but + is discarded. The second pass decompresses and recompresses just + the compressed data that fit in the requested plus excess sized + buffer. The deflate process is terminated after that amount of + input, which is less than the amount consumed on the first pass. + The last deflate block of the result will be of a comparable size + to the final product, so that the header for that deflate block and + the compression ratio for that block will be about the same as in + the final product. The third compression pass decompresses the + result of the second step, but only the compressed data up to the + requested size minus an amount to allow the compressed stream to + complete (see the MARGIN define below). That will result in a + final compressed stream whose length is less than or equal to the + requested size. Assuming sufficient input and a requested size + greater than a few hundred bytes, the shortfall will typically be + less than ten bytes. + + If the input is short enough that the first compression completes + before filling the requested output size, then that compressed + stream is return with no recompression. + + EXCESS is chosen to be just greater than the shortfall seen in a + two pass approach similar to the above. That shortfall is due to + the last deflate block compressing more efficiently with a smaller + header on the second pass. EXCESS is set to be large enough so + that there is enough uncompressed data for the second pass to fill + out the requested size, and small enough so that the final deflate + block of the second pass will be close in size to the final deflate + block of the third and final pass. MARGIN is chosen to be just + large enough to assure that the final compression has enough room + to complete in all cases. + */ + +#include +#include +#include +#include "zlib.h" + +#define local static + +/* print nastygram and leave */ +local void quit(char *why) +{ + fprintf(stderr, "fitblk abort: %s\n", why); + exit(1); +} + +#define RAWLEN 4096 /* intermediate uncompressed buffer size */ + +/* compress from file to def until provided buffer is full or end of + input reached; return last deflate() return value, or Z_ERRNO if + there was read error on the file */ +local int partcompress(FILE *in, z_streamp def) +{ + int ret, flush; + unsigned char raw[RAWLEN]; + + flush = Z_NO_FLUSH; + do { + def->avail_in = fread(raw, 1, RAWLEN, in); + if (ferror(in)) + return Z_ERRNO; + def->next_in = raw; + if (feof(in)) + flush = Z_FINISH; + ret = deflate(def, flush); + assert(ret != Z_STREAM_ERROR); + } while (def->avail_out != 0 && flush == Z_NO_FLUSH); + return ret; +} + +/* recompress from inf's input to def's output; the input for inf and + the output for def are set in those structures before calling; + return last deflate() return value, or Z_MEM_ERROR if inflate() + was not able to allocate enough memory when it needed to */ +local int recompress(z_streamp inf, z_streamp def) +{ + int ret, flush; + unsigned char raw[RAWLEN]; + + flush = Z_NO_FLUSH; + do { + /* decompress */ + inf->avail_out = RAWLEN; + inf->next_out = raw; + ret = inflate(inf, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR && ret != Z_DATA_ERROR && + ret != Z_NEED_DICT); + if (ret == Z_MEM_ERROR) + return ret; + + /* compress what was decompresed until done or no room */ + def->avail_in = RAWLEN - inf->avail_out; + def->next_in = raw; + if (inf->avail_out != 0) + flush = Z_FINISH; + ret = deflate(def, flush); + assert(ret != Z_STREAM_ERROR); + } while (ret != Z_STREAM_END && def->avail_out != 0); + return ret; +} + +#define EXCESS 256 /* empirically determined stream overage */ +#define MARGIN 8 /* amount to back off for completion */ + +/* compress from stdin to fixed-size block on stdout */ +int main(int argc, char **argv) +{ + int ret; /* return code */ + unsigned size; /* requested fixed output block size */ + unsigned have; /* bytes written by deflate() call */ + unsigned char *blk; /* intermediate and final stream */ + unsigned char *tmp; /* close to desired size stream */ + z_stream def, inf; /* zlib deflate and inflate states */ + + /* get requested output size */ + if (argc != 2) + quit("need one argument: size of output block"); + ret = strtol(argv[1], argv + 1, 10); + if (argv[1][0] != 0) + quit("argument must be a number"); + if (ret < 8) /* 8 is minimum zlib stream size */ + quit("need positive size of 8 or greater"); + size = (unsigned)ret; + + /* allocate memory for buffers and compression engine */ + blk = malloc(size + EXCESS); + def.zalloc = Z_NULL; + def.zfree = Z_NULL; + def.opaque = Z_NULL; + ret = deflateInit(&def, Z_DEFAULT_COMPRESSION); + if (ret != Z_OK || blk == NULL) + quit("out of memory"); + + /* compress from stdin until output full, or no more input */ + def.avail_out = size + EXCESS; + def.next_out = blk; + ret = partcompress(stdin, &def); + if (ret == Z_ERRNO) + quit("error reading input"); + + /* if it all fit, then size was undersubscribed -- done! */ + if (ret == Z_STREAM_END && def.avail_out >= EXCESS) { + /* write block to stdout */ + have = size + EXCESS - def.avail_out; + if (fwrite(blk, 1, have, stdout) != have || ferror(stdout)) + quit("error writing output"); + + /* clean up and print results to stderr */ + ret = deflateEnd(&def); + assert(ret != Z_STREAM_ERROR); + free(blk); + fprintf(stderr, + "%u bytes unused out of %u requested (all input)\n", + size - have, size); + return 0; + } + + /* it didn't all fit -- set up for recompression */ + inf.zalloc = Z_NULL; + inf.zfree = Z_NULL; + inf.opaque = Z_NULL; + inf.avail_in = 0; + inf.next_in = Z_NULL; + ret = inflateInit(&inf); + tmp = malloc(size + EXCESS); + if (ret != Z_OK || tmp == NULL) + quit("out of memory"); + ret = deflateReset(&def); + assert(ret != Z_STREAM_ERROR); + + /* do first recompression close to the right amount */ + inf.avail_in = size + EXCESS; + inf.next_in = blk; + def.avail_out = size + EXCESS; + def.next_out = tmp; + ret = recompress(&inf, &def); + if (ret == Z_MEM_ERROR) + quit("out of memory"); + + /* set up for next reocmpression */ + ret = inflateReset(&inf); + assert(ret != Z_STREAM_ERROR); + ret = deflateReset(&def); + assert(ret != Z_STREAM_ERROR); + + /* do second and final recompression (third compression) */ + inf.avail_in = size - MARGIN; /* assure stream will complete */ + inf.next_in = tmp; + def.avail_out = size; + def.next_out = blk; + ret = recompress(&inf, &def); + if (ret == Z_MEM_ERROR) + quit("out of memory"); + assert(ret == Z_STREAM_END); /* otherwise MARGIN too small */ + + /* done -- write block to stdout */ + have = size - def.avail_out; + if (fwrite(blk, 1, have, stdout) != have || ferror(stdout)) + quit("error writing output"); + + /* clean up and print results to stderr */ + free(tmp); + ret = inflateEnd(&inf); + assert(ret != Z_STREAM_ERROR); + ret = deflateEnd(&def); + assert(ret != Z_STREAM_ERROR); + free(blk); + fprintf(stderr, + "%u bytes unused out of %u requested (%lu input)\n", + size - have, size, def.total_in); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/gun.c b/thirdparty/zlib/zlib-1.2.7/examples/gun.c new file mode 100644 index 0000000..72b0882 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/gun.c @@ -0,0 +1,701 @@ +/* gun.c -- simple gunzip to give an example of the use of inflateBack() + * Copyright (C) 2003, 2005, 2008, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + Version 1.6 17 January 2010 Mark Adler */ + +/* Version history: + 1.0 16 Feb 2003 First version for testing of inflateBack() + 1.1 21 Feb 2005 Decompress concatenated gzip streams + Remove use of "this" variable (C++ keyword) + Fix return value for in() + Improve allocation failure checking + Add typecasting for void * structures + Add -h option for command version and usage + Add a bunch of comments + 1.2 20 Mar 2005 Add Unix compress (LZW) decompression + Copy file attributes from input file to output file + 1.3 12 Jun 2005 Add casts for error messages [Oberhumer] + 1.4 8 Dec 2006 LZW decompression speed improvements + 1.5 9 Feb 2008 Avoid warning in latest version of gcc + 1.6 17 Jan 2010 Avoid signed/unsigned comparison warnings + */ + +/* + gun [ -t ] [ name ... ] + + decompresses the data in the named gzip files. If no arguments are given, + gun will decompress from stdin to stdout. The names must end in .gz, -gz, + .z, -z, _z, or .Z. The uncompressed data will be written to a file name + with the suffix stripped. On success, the original file is deleted. On + failure, the output file is deleted. For most failures, the command will + continue to process the remaining names on the command line. A memory + allocation failure will abort the command. If -t is specified, then the + listed files or stdin will be tested as gzip files for integrity (without + checking for a proper suffix), no output will be written, and no files + will be deleted. + + Like gzip, gun allows concatenated gzip streams and will decompress them, + writing all of the uncompressed data to the output. Unlike gzip, gun allows + an empty file on input, and will produce no error writing an empty output + file. + + gun will also decompress files made by Unix compress, which uses LZW + compression. These files are automatically detected by virtue of their + magic header bytes. Since the end of Unix compress stream is marked by the + end-of-file, they cannot be concantenated. If a Unix compress stream is + encountered in an input file, it is the last stream in that file. + + Like gunzip and uncompress, the file attributes of the orignal compressed + file are maintained in the final uncompressed file, to the extent that the + user permissions allow it. + + On my Mac OS X PowerPC G4, gun is almost twice as fast as gunzip (version + 1.2.4) is on the same file, when gun is linked with zlib 1.2.2. Also the + LZW decompression provided by gun is about twice as fast as the standard + Unix uncompress command. + */ + +/* external functions and related types and constants */ +#include /* fprintf() */ +#include /* malloc(), free() */ +#include /* strerror(), strcmp(), strlen(), memcpy() */ +#include /* errno */ +#include /* open() */ +#include /* read(), write(), close(), chown(), unlink() */ +#include +#include /* stat(), chmod() */ +#include /* utime() */ +#include "zlib.h" /* inflateBackInit(), inflateBack(), */ + /* inflateBackEnd(), crc32() */ + +/* function declaration */ +#define local static + +/* buffer constants */ +#define SIZE 32768U /* input and output buffer sizes */ +#define PIECE 16384 /* limits i/o chunks for 16-bit int case */ + +/* structure for infback() to pass to input function in() -- it maintains the + input file and a buffer of size SIZE */ +struct ind { + int infile; + unsigned char *inbuf; +}; + +/* Load input buffer, assumed to be empty, and return bytes loaded and a + pointer to them. read() is called until the buffer is full, or until it + returns end-of-file or error. Return 0 on error. */ +local unsigned in(void *in_desc, unsigned char **buf) +{ + int ret; + unsigned len; + unsigned char *next; + struct ind *me = (struct ind *)in_desc; + + next = me->inbuf; + *buf = next; + len = 0; + do { + ret = PIECE; + if ((unsigned)ret > SIZE - len) + ret = (int)(SIZE - len); + ret = (int)read(me->infile, next, ret); + if (ret == -1) { + len = 0; + break; + } + next += ret; + len += ret; + } while (ret != 0 && len < SIZE); + return len; +} + +/* structure for infback() to pass to output function out() -- it maintains the + output file, a running CRC-32 check on the output and the total number of + bytes output, both for checking against the gzip trailer. (The length in + the gzip trailer is stored modulo 2^32, so it's ok if a long is 32 bits and + the output is greater than 4 GB.) */ +struct outd { + int outfile; + int check; /* true if checking crc and total */ + unsigned long crc; + unsigned long total; +}; + +/* Write output buffer and update the CRC-32 and total bytes written. write() + is called until all of the output is written or an error is encountered. + On success out() returns 0. For a write failure, out() returns 1. If the + output file descriptor is -1, then nothing is written. + */ +local int out(void *out_desc, unsigned char *buf, unsigned len) +{ + int ret; + struct outd *me = (struct outd *)out_desc; + + if (me->check) { + me->crc = crc32(me->crc, buf, len); + me->total += len; + } + if (me->outfile != -1) + do { + ret = PIECE; + if ((unsigned)ret > len) + ret = (int)len; + ret = (int)write(me->outfile, buf, ret); + if (ret == -1) + return 1; + buf += ret; + len -= ret; + } while (len != 0); + return 0; +} + +/* next input byte macro for use inside lunpipe() and gunpipe() */ +#define NEXT() (have ? 0 : (have = in(indp, &next)), \ + last = have ? (have--, (int)(*next++)) : -1) + +/* memory for gunpipe() and lunpipe() -- + the first 256 entries of prefix[] and suffix[] are never used, could + have offset the index, but it's faster to waste the memory */ +unsigned char inbuf[SIZE]; /* input buffer */ +unsigned char outbuf[SIZE]; /* output buffer */ +unsigned short prefix[65536]; /* index to LZW prefix string */ +unsigned char suffix[65536]; /* one-character LZW suffix */ +unsigned char match[65280 + 2]; /* buffer for reversed match or gzip + 32K sliding window */ + +/* throw out what's left in the current bits byte buffer (this is a vestigial + aspect of the compressed data format derived from an implementation that + made use of a special VAX machine instruction!) */ +#define FLUSHCODE() \ + do { \ + left = 0; \ + rem = 0; \ + if (chunk > have) { \ + chunk -= have; \ + have = 0; \ + if (NEXT() == -1) \ + break; \ + chunk--; \ + if (chunk > have) { \ + chunk = have = 0; \ + break; \ + } \ + } \ + have -= chunk; \ + next += chunk; \ + chunk = 0; \ + } while (0) + +/* Decompress a compress (LZW) file from indp to outfile. The compress magic + header (two bytes) has already been read and verified. There are have bytes + of buffered input at next. strm is used for passing error information back + to gunpipe(). + + lunpipe() will return Z_OK on success, Z_BUF_ERROR for an unexpected end of + file, read error, or write error (a write error indicated by strm->next_in + not equal to Z_NULL), or Z_DATA_ERROR for invalid input. + */ +local int lunpipe(unsigned have, unsigned char *next, struct ind *indp, + int outfile, z_stream *strm) +{ + int last; /* last byte read by NEXT(), or -1 if EOF */ + unsigned chunk; /* bytes left in current chunk */ + int left; /* bits left in rem */ + unsigned rem; /* unused bits from input */ + int bits; /* current bits per code */ + unsigned code; /* code, table traversal index */ + unsigned mask; /* mask for current bits codes */ + int max; /* maximum bits per code for this stream */ + unsigned flags; /* compress flags, then block compress flag */ + unsigned end; /* last valid entry in prefix/suffix tables */ + unsigned temp; /* current code */ + unsigned prev; /* previous code */ + unsigned final; /* last character written for previous code */ + unsigned stack; /* next position for reversed string */ + unsigned outcnt; /* bytes in output buffer */ + struct outd outd; /* output structure */ + unsigned char *p; + + /* set up output */ + outd.outfile = outfile; + outd.check = 0; + + /* process remainder of compress header -- a flags byte */ + flags = NEXT(); + if (last == -1) + return Z_BUF_ERROR; + if (flags & 0x60) { + strm->msg = (char *)"unknown lzw flags set"; + return Z_DATA_ERROR; + } + max = flags & 0x1f; + if (max < 9 || max > 16) { + strm->msg = (char *)"lzw bits out of range"; + return Z_DATA_ERROR; + } + if (max == 9) /* 9 doesn't really mean 9 */ + max = 10; + flags &= 0x80; /* true if block compress */ + + /* clear table */ + bits = 9; + mask = 0x1ff; + end = flags ? 256 : 255; + + /* set up: get first 9-bit code, which is the first decompressed byte, but + don't create a table entry until the next code */ + if (NEXT() == -1) /* no compressed data is ok */ + return Z_OK; + final = prev = (unsigned)last; /* low 8 bits of code */ + if (NEXT() == -1) /* missing a bit */ + return Z_BUF_ERROR; + if (last & 1) { /* code must be < 256 */ + strm->msg = (char *)"invalid lzw code"; + return Z_DATA_ERROR; + } + rem = (unsigned)last >> 1; /* remaining 7 bits */ + left = 7; + chunk = bits - 2; /* 7 bytes left in this chunk */ + outbuf[0] = (unsigned char)final; /* write first decompressed byte */ + outcnt = 1; + + /* decode codes */ + stack = 0; + for (;;) { + /* if the table will be full after this, increment the code size */ + if (end >= mask && bits < max) { + FLUSHCODE(); + bits++; + mask <<= 1; + mask++; + } + + /* get a code of length bits */ + if (chunk == 0) /* decrement chunk modulo bits */ + chunk = bits; + code = rem; /* low bits of code */ + if (NEXT() == -1) { /* EOF is end of compressed data */ + /* write remaining buffered output */ + if (outcnt && out(&outd, outbuf, outcnt)) { + strm->next_in = outbuf; /* signal write error */ + return Z_BUF_ERROR; + } + return Z_OK; + } + code += (unsigned)last << left; /* middle (or high) bits of code */ + left += 8; + chunk--; + if (bits > left) { /* need more bits */ + if (NEXT() == -1) /* can't end in middle of code */ + return Z_BUF_ERROR; + code += (unsigned)last << left; /* high bits of code */ + left += 8; + chunk--; + } + code &= mask; /* mask to current code length */ + left -= bits; /* number of unused bits */ + rem = (unsigned)last >> (8 - left); /* unused bits from last byte */ + + /* process clear code (256) */ + if (code == 256 && flags) { + FLUSHCODE(); + bits = 9; /* initialize bits and mask */ + mask = 0x1ff; + end = 255; /* empty table */ + continue; /* get next code */ + } + + /* special code to reuse last match */ + temp = code; /* save the current code */ + if (code > end) { + /* Be picky on the allowed code here, and make sure that the code + we drop through (prev) will be a valid index so that random + input does not cause an exception. The code != end + 1 check is + empirically derived, and not checked in the original uncompress + code. If this ever causes a problem, that check could be safely + removed. Leaving this check in greatly improves gun's ability + to detect random or corrupted input after a compress header. + In any case, the prev > end check must be retained. */ + if (code != end + 1 || prev > end) { + strm->msg = (char *)"invalid lzw code"; + return Z_DATA_ERROR; + } + match[stack++] = (unsigned char)final; + code = prev; + } + + /* walk through linked list to generate output in reverse order */ + p = match + stack; + while (code >= 256) { + *p++ = suffix[code]; + code = prefix[code]; + } + stack = p - match; + match[stack++] = (unsigned char)code; + final = code; + + /* link new table entry */ + if (end < mask) { + end++; + prefix[end] = (unsigned short)prev; + suffix[end] = (unsigned char)final; + } + + /* set previous code for next iteration */ + prev = temp; + + /* write output in forward order */ + while (stack > SIZE - outcnt) { + while (outcnt < SIZE) + outbuf[outcnt++] = match[--stack]; + if (out(&outd, outbuf, outcnt)) { + strm->next_in = outbuf; /* signal write error */ + return Z_BUF_ERROR; + } + outcnt = 0; + } + p = match + stack; + do { + outbuf[outcnt++] = *--p; + } while (p > match); + stack = 0; + + /* loop for next code with final and prev as the last match, rem and + left provide the first 0..7 bits of the next code, end is the last + valid table entry */ + } +} + +/* Decompress a gzip file from infile to outfile. strm is assumed to have been + successfully initialized with inflateBackInit(). The input file may consist + of a series of gzip streams, in which case all of them will be decompressed + to the output file. If outfile is -1, then the gzip stream(s) integrity is + checked and nothing is written. + + The return value is a zlib error code: Z_MEM_ERROR if out of memory, + Z_DATA_ERROR if the header or the compressed data is invalid, or if the + trailer CRC-32 check or length doesn't match, Z_BUF_ERROR if the input ends + prematurely or a write error occurs, or Z_ERRNO if junk (not a another gzip + stream) follows a valid gzip stream. + */ +local int gunpipe(z_stream *strm, int infile, int outfile) +{ + int ret, first, last; + unsigned have, flags, len; + unsigned char *next = NULL; + struct ind ind, *indp; + struct outd outd; + + /* setup input buffer */ + ind.infile = infile; + ind.inbuf = inbuf; + indp = &ind; + + /* decompress concatenated gzip streams */ + have = 0; /* no input data read in yet */ + first = 1; /* looking for first gzip header */ + strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */ + for (;;) { + /* look for the two magic header bytes for a gzip stream */ + if (NEXT() == -1) { + ret = Z_OK; + break; /* empty gzip stream is ok */ + } + if (last != 31 || (NEXT() != 139 && last != 157)) { + strm->msg = (char *)"incorrect header check"; + ret = first ? Z_DATA_ERROR : Z_ERRNO; + break; /* not a gzip or compress header */ + } + first = 0; /* next non-header is junk */ + + /* process a compress (LZW) file -- can't be concatenated after this */ + if (last == 157) { + ret = lunpipe(have, next, indp, outfile, strm); + break; + } + + /* process remainder of gzip header */ + ret = Z_BUF_ERROR; + if (NEXT() != 8) { /* only deflate method allowed */ + if (last == -1) break; + strm->msg = (char *)"unknown compression method"; + ret = Z_DATA_ERROR; + break; + } + flags = NEXT(); /* header flags */ + NEXT(); /* discard mod time, xflgs, os */ + NEXT(); + NEXT(); + NEXT(); + NEXT(); + NEXT(); + if (last == -1) break; + if (flags & 0xe0) { + strm->msg = (char *)"unknown header flags set"; + ret = Z_DATA_ERROR; + break; + } + if (flags & 4) { /* extra field */ + len = NEXT(); + len += (unsigned)(NEXT()) << 8; + if (last == -1) break; + while (len > have) { + len -= have; + have = 0; + if (NEXT() == -1) break; + len--; + } + if (last == -1) break; + have -= len; + next += len; + } + if (flags & 8) /* file name */ + while (NEXT() != 0 && last != -1) + ; + if (flags & 16) /* comment */ + while (NEXT() != 0 && last != -1) + ; + if (flags & 2) { /* header crc */ + NEXT(); + NEXT(); + } + if (last == -1) break; + + /* set up output */ + outd.outfile = outfile; + outd.check = 1; + outd.crc = crc32(0L, Z_NULL, 0); + outd.total = 0; + + /* decompress data to output */ + strm->next_in = next; + strm->avail_in = have; + ret = inflateBack(strm, in, indp, out, &outd); + if (ret != Z_STREAM_END) break; + next = strm->next_in; + have = strm->avail_in; + strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */ + + /* check trailer */ + ret = Z_BUF_ERROR; + if (NEXT() != (int)(outd.crc & 0xff) || + NEXT() != (int)((outd.crc >> 8) & 0xff) || + NEXT() != (int)((outd.crc >> 16) & 0xff) || + NEXT() != (int)((outd.crc >> 24) & 0xff)) { + /* crc error */ + if (last != -1) { + strm->msg = (char *)"incorrect data check"; + ret = Z_DATA_ERROR; + } + break; + } + if (NEXT() != (int)(outd.total & 0xff) || + NEXT() != (int)((outd.total >> 8) & 0xff) || + NEXT() != (int)((outd.total >> 16) & 0xff) || + NEXT() != (int)((outd.total >> 24) & 0xff)) { + /* length error */ + if (last != -1) { + strm->msg = (char *)"incorrect length check"; + ret = Z_DATA_ERROR; + } + break; + } + + /* go back and look for another gzip stream */ + } + + /* clean up and return */ + return ret; +} + +/* Copy file attributes, from -> to, as best we can. This is best effort, so + no errors are reported. The mode bits, including suid, sgid, and the sticky + bit are copied (if allowed), the owner's user id and group id are copied + (again if allowed), and the access and modify times are copied. */ +local void copymeta(char *from, char *to) +{ + struct stat was; + struct utimbuf when; + + /* get all of from's Unix meta data, return if not a regular file */ + if (stat(from, &was) != 0 || (was.st_mode & S_IFMT) != S_IFREG) + return; + + /* set to's mode bits, ignore errors */ + (void)chmod(to, was.st_mode & 07777); + + /* copy owner's user and group, ignore errors */ + (void)chown(to, was.st_uid, was.st_gid); + + /* copy access and modify times, ignore errors */ + when.actime = was.st_atime; + when.modtime = was.st_mtime; + (void)utime(to, &when); +} + +/* Decompress the file inname to the file outnname, of if test is true, just + decompress without writing and check the gzip trailer for integrity. If + inname is NULL or an empty string, read from stdin. If outname is NULL or + an empty string, write to stdout. strm is a pre-initialized inflateBack + structure. When appropriate, copy the file attributes from inname to + outname. + + gunzip() returns 1 if there is an out-of-memory error or an unexpected + return code from gunpipe(). Otherwise it returns 0. + */ +local int gunzip(z_stream *strm, char *inname, char *outname, int test) +{ + int ret; + int infile, outfile; + + /* open files */ + if (inname == NULL || *inname == 0) { + inname = "-"; + infile = 0; /* stdin */ + } + else { + infile = open(inname, O_RDONLY, 0); + if (infile == -1) { + fprintf(stderr, "gun cannot open %s\n", inname); + return 0; + } + } + if (test) + outfile = -1; + else if (outname == NULL || *outname == 0) { + outname = "-"; + outfile = 1; /* stdout */ + } + else { + outfile = open(outname, O_CREAT | O_TRUNC | O_WRONLY, 0666); + if (outfile == -1) { + close(infile); + fprintf(stderr, "gun cannot create %s\n", outname); + return 0; + } + } + errno = 0; + + /* decompress */ + ret = gunpipe(strm, infile, outfile); + if (outfile > 2) close(outfile); + if (infile > 2) close(infile); + + /* interpret result */ + switch (ret) { + case Z_OK: + case Z_ERRNO: + if (infile > 2 && outfile > 2) { + copymeta(inname, outname); /* copy attributes */ + unlink(inname); + } + if (ret == Z_ERRNO) + fprintf(stderr, "gun warning: trailing garbage ignored in %s\n", + inname); + break; + case Z_DATA_ERROR: + if (outfile > 2) unlink(outname); + fprintf(stderr, "gun data error on %s: %s\n", inname, strm->msg); + break; + case Z_MEM_ERROR: + if (outfile > 2) unlink(outname); + fprintf(stderr, "gun out of memory error--aborting\n"); + return 1; + case Z_BUF_ERROR: + if (outfile > 2) unlink(outname); + if (strm->next_in != Z_NULL) { + fprintf(stderr, "gun write error on %s: %s\n", + outname, strerror(errno)); + } + else if (errno) { + fprintf(stderr, "gun read error on %s: %s\n", + inname, strerror(errno)); + } + else { + fprintf(stderr, "gun unexpected end of file on %s\n", + inname); + } + break; + default: + if (outfile > 2) unlink(outname); + fprintf(stderr, "gun internal error--aborting\n"); + return 1; + } + return 0; +} + +/* Process the gun command line arguments. See the command syntax near the + beginning of this source file. */ +int main(int argc, char **argv) +{ + int ret, len, test; + char *outname; + unsigned char *window; + z_stream strm; + + /* initialize inflateBack state for repeated use */ + window = match; /* reuse LZW match buffer */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + ret = inflateBackInit(&strm, 15, window); + if (ret != Z_OK) { + fprintf(stderr, "gun out of memory error--aborting\n"); + return 1; + } + + /* decompress each file to the same name with the suffix removed */ + argc--; + argv++; + test = 0; + if (argc && strcmp(*argv, "-h") == 0) { + fprintf(stderr, "gun 1.6 (17 Jan 2010)\n"); + fprintf(stderr, "Copyright (C) 2003-2010 Mark Adler\n"); + fprintf(stderr, "usage: gun [-t] [file1.gz [file2.Z ...]]\n"); + return 0; + } + if (argc && strcmp(*argv, "-t") == 0) { + test = 1; + argc--; + argv++; + } + if (argc) + do { + if (test) + outname = NULL; + else { + len = (int)strlen(*argv); + if (strcmp(*argv + len - 3, ".gz") == 0 || + strcmp(*argv + len - 3, "-gz") == 0) + len -= 3; + else if (strcmp(*argv + len - 2, ".z") == 0 || + strcmp(*argv + len - 2, "-z") == 0 || + strcmp(*argv + len - 2, "_z") == 0 || + strcmp(*argv + len - 2, ".Z") == 0) + len -= 2; + else { + fprintf(stderr, "gun error: no gz type on %s--skipping\n", + *argv); + continue; + } + outname = malloc(len + 1); + if (outname == NULL) { + fprintf(stderr, "gun out of memory error--aborting\n"); + ret = 1; + break; + } + memcpy(outname, *argv, len); + outname[len] = 0; + } + ret = gunzip(&strm, *argv, outname, test); + if (outname != NULL) free(outname); + if (ret) break; + } while (argv++, --argc); + else + ret = gunzip(&strm, NULL, NULL, test); + + /* clean up */ + inflateBackEnd(&strm); + return ret; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/gzappend.c b/thirdparty/zlib/zlib-1.2.7/examples/gzappend.c new file mode 100644 index 0000000..e9e878e --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/gzappend.c @@ -0,0 +1,500 @@ +/* gzappend -- command to append to a gzip file + + Copyright (C) 2003 Mark Adler, all rights reserved + version 1.1, 4 Nov 2003 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + +/* + * Change history: + * + * 1.0 19 Oct 2003 - First version + * 1.1 4 Nov 2003 - Expand and clarify some comments and notes + * - Add version and copyright to help + * - Send help to stdout instead of stderr + * - Add some preemptive typecasts + * - Add L to constants in lseek() calls + * - Remove some debugging information in error messages + * - Use new data_type definition for zlib 1.2.1 + * - Simplfy and unify file operations + * - Finish off gzip file in gztack() + * - Use deflatePrime() instead of adding empty blocks + * - Keep gzip file clean on appended file read errors + * - Use in-place rotate instead of auxiliary buffer + * (Why you ask? Because it was fun to write!) + */ + +/* + gzappend takes a gzip file and appends to it, compressing files from the + command line or data from stdin. The gzip file is written to directly, to + avoid copying that file, in case it's large. Note that this results in the + unfriendly behavior that if gzappend fails, the gzip file is corrupted. + + This program was written to illustrate the use of the new Z_BLOCK option of + zlib 1.2.x's inflate() function. This option returns from inflate() at each + block boundary to facilitate locating and modifying the last block bit at + the start of the final deflate block. Also whether using Z_BLOCK or not, + another required feature of zlib 1.2.x is that inflate() now provides the + number of unusued bits in the last input byte used. gzappend will not work + with versions of zlib earlier than 1.2.1. + + gzappend first decompresses the gzip file internally, discarding all but + the last 32K of uncompressed data, and noting the location of the last block + bit and the number of unused bits in the last byte of the compressed data. + The gzip trailer containing the CRC-32 and length of the uncompressed data + is verified. This trailer will be later overwritten. + + Then the last block bit is cleared by seeking back in the file and rewriting + the byte that contains it. Seeking forward, the last byte of the compressed + data is saved along with the number of unused bits to initialize deflate. + + A deflate process is initialized, using the last 32K of the uncompressed + data from the gzip file to initialize the dictionary. If the total + uncompressed data was less than 32K, then all of it is used to initialize + the dictionary. The deflate output bit buffer is also initialized with the + last bits from the original deflate stream. From here on, the data to + append is simply compressed using deflate, and written to the gzip file. + When that is complete, the new CRC-32 and uncompressed length are written + as the trailer of the gzip file. + */ + +#include +#include +#include +#include +#include +#include "zlib.h" + +#define local static +#define LGCHUNK 14 +#define CHUNK (1U << LGCHUNK) +#define DSIZE 32768U + +/* print an error message and terminate with extreme prejudice */ +local void bye(char *msg1, char *msg2) +{ + fprintf(stderr, "gzappend error: %s%s\n", msg1, msg2); + exit(1); +} + +/* return the greatest common divisor of a and b using Euclid's algorithm, + modified to be fast when one argument much greater than the other, and + coded to avoid unnecessary swapping */ +local unsigned gcd(unsigned a, unsigned b) +{ + unsigned c; + + while (a && b) + if (a > b) { + c = b; + while (a - c >= c) + c <<= 1; + a -= c; + } + else { + c = a; + while (b - c >= c) + c <<= 1; + b -= c; + } + return a + b; +} + +/* rotate list[0..len-1] left by rot positions, in place */ +local void rotate(unsigned char *list, unsigned len, unsigned rot) +{ + unsigned char tmp; + unsigned cycles; + unsigned char *start, *last, *to, *from; + + /* normalize rot and handle degenerate cases */ + if (len < 2) return; + if (rot >= len) rot %= len; + if (rot == 0) return; + + /* pointer to last entry in list */ + last = list + (len - 1); + + /* do simple left shift by one */ + if (rot == 1) { + tmp = *list; + memcpy(list, list + 1, len - 1); + *last = tmp; + return; + } + + /* do simple right shift by one */ + if (rot == len - 1) { + tmp = *last; + memmove(list + 1, list, len - 1); + *list = tmp; + return; + } + + /* otherwise do rotate as a set of cycles in place */ + cycles = gcd(len, rot); /* number of cycles */ + do { + start = from = list + cycles; /* start index is arbitrary */ + tmp = *from; /* save entry to be overwritten */ + for (;;) { + to = from; /* next step in cycle */ + from += rot; /* go right rot positions */ + if (from > last) from -= len; /* (pointer better not wrap) */ + if (from == start) break; /* all but one shifted */ + *to = *from; /* shift left */ + } + *to = tmp; /* complete the circle */ + } while (--cycles); +} + +/* structure for gzip file read operations */ +typedef struct { + int fd; /* file descriptor */ + int size; /* 1 << size is bytes in buf */ + unsigned left; /* bytes available at next */ + unsigned char *buf; /* buffer */ + unsigned char *next; /* next byte in buffer */ + char *name; /* file name for error messages */ +} file; + +/* reload buffer */ +local int readin(file *in) +{ + int len; + + len = read(in->fd, in->buf, 1 << in->size); + if (len == -1) bye("error reading ", in->name); + in->left = (unsigned)len; + in->next = in->buf; + return len; +} + +/* read from file in, exit if end-of-file */ +local int readmore(file *in) +{ + if (readin(in) == 0) bye("unexpected end of ", in->name); + return 0; +} + +#define read1(in) (in->left == 0 ? readmore(in) : 0, \ + in->left--, *(in->next)++) + +/* skip over n bytes of in */ +local void skip(file *in, unsigned n) +{ + unsigned bypass; + + if (n > in->left) { + n -= in->left; + bypass = n & ~((1U << in->size) - 1); + if (bypass) { + if (lseek(in->fd, (off_t)bypass, SEEK_CUR) == -1) + bye("seeking ", in->name); + n -= bypass; + } + readmore(in); + if (n > in->left) + bye("unexpected end of ", in->name); + } + in->left -= n; + in->next += n; +} + +/* read a four-byte unsigned integer, little-endian, from in */ +unsigned long read4(file *in) +{ + unsigned long val; + + val = read1(in); + val += (unsigned)read1(in) << 8; + val += (unsigned long)read1(in) << 16; + val += (unsigned long)read1(in) << 24; + return val; +} + +/* skip over gzip header */ +local void gzheader(file *in) +{ + int flags; + unsigned n; + + if (read1(in) != 31 || read1(in) != 139) bye(in->name, " not a gzip file"); + if (read1(in) != 8) bye("unknown compression method in", in->name); + flags = read1(in); + if (flags & 0xe0) bye("unknown header flags set in", in->name); + skip(in, 6); + if (flags & 4) { + n = read1(in); + n += (unsigned)(read1(in)) << 8; + skip(in, n); + } + if (flags & 8) while (read1(in) != 0) ; + if (flags & 16) while (read1(in) != 0) ; + if (flags & 2) skip(in, 2); +} + +/* decompress gzip file "name", return strm with a deflate stream ready to + continue compression of the data in the gzip file, and return a file + descriptor pointing to where to write the compressed data -- the deflate + stream is initialized to compress using level "level" */ +local int gzscan(char *name, z_stream *strm, int level) +{ + int ret, lastbit, left, full; + unsigned have; + unsigned long crc, tot; + unsigned char *window; + off_t lastoff, end; + file gz; + + /* open gzip file */ + gz.name = name; + gz.fd = open(name, O_RDWR, 0); + if (gz.fd == -1) bye("cannot open ", name); + gz.buf = malloc(CHUNK); + if (gz.buf == NULL) bye("out of memory", ""); + gz.size = LGCHUNK; + gz.left = 0; + + /* skip gzip header */ + gzheader(&gz); + + /* prepare to decompress */ + window = malloc(DSIZE); + if (window == NULL) bye("out of memory", ""); + strm->zalloc = Z_NULL; + strm->zfree = Z_NULL; + strm->opaque = Z_NULL; + ret = inflateInit2(strm, -15); + if (ret != Z_OK) bye("out of memory", " or library mismatch"); + + /* decompress the deflate stream, saving append information */ + lastbit = 0; + lastoff = lseek(gz.fd, 0L, SEEK_CUR) - gz.left; + left = 0; + strm->avail_in = gz.left; + strm->next_in = gz.next; + crc = crc32(0L, Z_NULL, 0); + have = full = 0; + do { + /* if needed, get more input */ + if (strm->avail_in == 0) { + readmore(&gz); + strm->avail_in = gz.left; + strm->next_in = gz.next; + } + + /* set up output to next available section of sliding window */ + strm->avail_out = DSIZE - have; + strm->next_out = window + have; + + /* inflate and check for errors */ + ret = inflate(strm, Z_BLOCK); + if (ret == Z_STREAM_ERROR) bye("internal stream error!", ""); + if (ret == Z_MEM_ERROR) bye("out of memory", ""); + if (ret == Z_DATA_ERROR) + bye("invalid compressed data--format violated in", name); + + /* update crc and sliding window pointer */ + crc = crc32(crc, window + have, DSIZE - have - strm->avail_out); + if (strm->avail_out) + have = DSIZE - strm->avail_out; + else { + have = 0; + full = 1; + } + + /* process end of block */ + if (strm->data_type & 128) { + if (strm->data_type & 64) + left = strm->data_type & 0x1f; + else { + lastbit = strm->data_type & 0x1f; + lastoff = lseek(gz.fd, 0L, SEEK_CUR) - strm->avail_in; + } + } + } while (ret != Z_STREAM_END); + inflateEnd(strm); + gz.left = strm->avail_in; + gz.next = strm->next_in; + + /* save the location of the end of the compressed data */ + end = lseek(gz.fd, 0L, SEEK_CUR) - gz.left; + + /* check gzip trailer and save total for deflate */ + if (crc != read4(&gz)) + bye("invalid compressed data--crc mismatch in ", name); + tot = strm->total_out; + if ((tot & 0xffffffffUL) != read4(&gz)) + bye("invalid compressed data--length mismatch in", name); + + /* if not at end of file, warn */ + if (gz.left || readin(&gz)) + fprintf(stderr, + "gzappend warning: junk at end of gzip file overwritten\n"); + + /* clear last block bit */ + lseek(gz.fd, lastoff - (lastbit != 0), SEEK_SET); + if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name); + *gz.buf = (unsigned char)(*gz.buf ^ (1 << ((8 - lastbit) & 7))); + lseek(gz.fd, -1L, SEEK_CUR); + if (write(gz.fd, gz.buf, 1) != 1) bye("writing after seek to ", name); + + /* if window wrapped, build dictionary from window by rotating */ + if (full) { + rotate(window, DSIZE, have); + have = DSIZE; + } + + /* set up deflate stream with window, crc, total_in, and leftover bits */ + ret = deflateInit2(strm, level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + if (ret != Z_OK) bye("out of memory", ""); + deflateSetDictionary(strm, window, have); + strm->adler = crc; + strm->total_in = tot; + if (left) { + lseek(gz.fd, --end, SEEK_SET); + if (read(gz.fd, gz.buf, 1) != 1) bye("reading after seek on ", name); + deflatePrime(strm, 8 - left, *gz.buf); + } + lseek(gz.fd, end, SEEK_SET); + + /* clean up and return */ + free(window); + free(gz.buf); + return gz.fd; +} + +/* append file "name" to gzip file gd using deflate stream strm -- if last + is true, then finish off the deflate stream at the end */ +local void gztack(char *name, int gd, z_stream *strm, int last) +{ + int fd, len, ret; + unsigned left; + unsigned char *in, *out; + + /* open file to compress and append */ + fd = 0; + if (name != NULL) { + fd = open(name, O_RDONLY, 0); + if (fd == -1) + fprintf(stderr, "gzappend warning: %s not found, skipping ...\n", + name); + } + + /* allocate buffers */ + in = fd == -1 ? NULL : malloc(CHUNK); + out = malloc(CHUNK); + if (out == NULL) bye("out of memory", ""); + + /* compress input file and append to gzip file */ + do { + /* get more input */ + len = fd == -1 ? 0 : read(fd, in, CHUNK); + if (len == -1) { + fprintf(stderr, + "gzappend warning: error reading %s, skipping rest ...\n", + name); + len = 0; + } + strm->avail_in = (unsigned)len; + strm->next_in = in; + if (len) strm->adler = crc32(strm->adler, in, (unsigned)len); + + /* compress and write all available output */ + do { + strm->avail_out = CHUNK; + strm->next_out = out; + ret = deflate(strm, last && len == 0 ? Z_FINISH : Z_NO_FLUSH); + left = CHUNK - strm->avail_out; + while (left) { + len = write(gd, out + CHUNK - strm->avail_out - left, left); + if (len == -1) bye("writing gzip file", ""); + left -= (unsigned)len; + } + } while (strm->avail_out == 0 && ret != Z_STREAM_END); + } while (len != 0); + + /* write trailer after last entry */ + if (last) { + deflateEnd(strm); + out[0] = (unsigned char)(strm->adler); + out[1] = (unsigned char)(strm->adler >> 8); + out[2] = (unsigned char)(strm->adler >> 16); + out[3] = (unsigned char)(strm->adler >> 24); + out[4] = (unsigned char)(strm->total_in); + out[5] = (unsigned char)(strm->total_in >> 8); + out[6] = (unsigned char)(strm->total_in >> 16); + out[7] = (unsigned char)(strm->total_in >> 24); + len = 8; + do { + ret = write(gd, out + 8 - len, len); + if (ret == -1) bye("writing gzip file", ""); + len -= ret; + } while (len); + close(gd); + } + + /* clean up and return */ + free(out); + if (in != NULL) free(in); + if (fd > 0) close(fd); +} + +/* process the compression level option if present, scan the gzip file, and + append the specified files, or append the data from stdin if no other file + names are provided on the command line -- the gzip file must be writable + and seekable */ +int main(int argc, char **argv) +{ + int gd, level; + z_stream strm; + + /* ignore command name */ + argv++; + + /* provide usage if no arguments */ + if (*argv == NULL) { + printf("gzappend 1.1 (4 Nov 2003) Copyright (C) 2003 Mark Adler\n"); + printf( + "usage: gzappend [-level] file.gz [ addthis [ andthis ... ]]\n"); + return 0; + } + + /* set compression level */ + level = Z_DEFAULT_COMPRESSION; + if (argv[0][0] == '-') { + if (argv[0][1] < '0' || argv[0][1] > '9' || argv[0][2] != 0) + bye("invalid compression level", ""); + level = argv[0][1] - '0'; + if (*++argv == NULL) bye("no gzip file name after options", ""); + } + + /* prepare to append to gzip file */ + gd = gzscan(*argv++, &strm, level); + + /* append files on command line, or from stdin if none */ + if (*argv == NULL) + gztack(NULL, gd, &strm, 1); + else + do { + gztack(*argv, gd, &strm, argv[1] == NULL); + } while (*++argv != NULL); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/gzjoin.c b/thirdparty/zlib/zlib-1.2.7/examples/gzjoin.c new file mode 100644 index 0000000..129347c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/gzjoin.c @@ -0,0 +1,448 @@ +/* gzjoin -- command to join gzip files into one gzip file + + Copyright (C) 2004 Mark Adler, all rights reserved + version 1.0, 11 Dec 2004 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + +/* + * Change history: + * + * 1.0 11 Dec 2004 - First version + * 1.1 12 Jun 2005 - Changed ssize_t to long for portability + */ + +/* + gzjoin takes one or more gzip files on the command line and writes out a + single gzip file that will uncompress to the concatenation of the + uncompressed data from the individual gzip files. gzjoin does this without + having to recompress any of the data and without having to calculate a new + crc32 for the concatenated uncompressed data. gzjoin does however have to + decompress all of the input data in order to find the bits in the compressed + data that need to be modified to concatenate the streams. + + gzjoin does not do an integrity check on the input gzip files other than + checking the gzip header and decompressing the compressed data. They are + otherwise assumed to be complete and correct. + + Each joint between gzip files removes at least 18 bytes of previous trailer + and subsequent header, and inserts an average of about three bytes to the + compressed data in order to connect the streams. The output gzip file + has a minimal ten-byte gzip header with no file name or modification time. + + This program was written to illustrate the use of the Z_BLOCK option of + inflate() and the crc32_combine() function. gzjoin will not compile with + versions of zlib earlier than 1.2.3. + */ + +#include /* fputs(), fprintf(), fwrite(), putc() */ +#include /* exit(), malloc(), free() */ +#include /* open() */ +#include /* close(), read(), lseek() */ +#include "zlib.h" + /* crc32(), crc32_combine(), inflateInit2(), inflate(), inflateEnd() */ + +#define local static + +/* exit with an error (return a value to allow use in an expression) */ +local int bail(char *why1, char *why2) +{ + fprintf(stderr, "gzjoin error: %s%s, output incomplete\n", why1, why2); + exit(1); + return 0; +} + +/* -- simple buffered file input with access to the buffer -- */ + +#define CHUNK 32768 /* must be a power of two and fit in unsigned */ + +/* bin buffered input file type */ +typedef struct { + char *name; /* name of file for error messages */ + int fd; /* file descriptor */ + unsigned left; /* bytes remaining at next */ + unsigned char *next; /* next byte to read */ + unsigned char *buf; /* allocated buffer of length CHUNK */ +} bin; + +/* close a buffered file and free allocated memory */ +local void bclose(bin *in) +{ + if (in != NULL) { + if (in->fd != -1) + close(in->fd); + if (in->buf != NULL) + free(in->buf); + free(in); + } +} + +/* open a buffered file for input, return a pointer to type bin, or NULL on + failure */ +local bin *bopen(char *name) +{ + bin *in; + + in = malloc(sizeof(bin)); + if (in == NULL) + return NULL; + in->buf = malloc(CHUNK); + in->fd = open(name, O_RDONLY, 0); + if (in->buf == NULL || in->fd == -1) { + bclose(in); + return NULL; + } + in->left = 0; + in->next = in->buf; + in->name = name; + return in; +} + +/* load buffer from file, return -1 on read error, 0 or 1 on success, with + 1 indicating that end-of-file was reached */ +local int bload(bin *in) +{ + long len; + + if (in == NULL) + return -1; + if (in->left != 0) + return 0; + in->next = in->buf; + do { + len = (long)read(in->fd, in->buf + in->left, CHUNK - in->left); + if (len < 0) + return -1; + in->left += (unsigned)len; + } while (len != 0 && in->left < CHUNK); + return len == 0 ? 1 : 0; +} + +/* get a byte from the file, bail if end of file */ +#define bget(in) (in->left ? 0 : bload(in), \ + in->left ? (in->left--, *(in->next)++) : \ + bail("unexpected end of file on ", in->name)) + +/* get a four-byte little-endian unsigned integer from file */ +local unsigned long bget4(bin *in) +{ + unsigned long val; + + val = bget(in); + val += (unsigned long)(bget(in)) << 8; + val += (unsigned long)(bget(in)) << 16; + val += (unsigned long)(bget(in)) << 24; + return val; +} + +/* skip bytes in file */ +local void bskip(bin *in, unsigned skip) +{ + /* check pointer */ + if (in == NULL) + return; + + /* easy case -- skip bytes in buffer */ + if (skip <= in->left) { + in->left -= skip; + in->next += skip; + return; + } + + /* skip what's in buffer, discard buffer contents */ + skip -= in->left; + in->left = 0; + + /* seek past multiples of CHUNK bytes */ + if (skip > CHUNK) { + unsigned left; + + left = skip & (CHUNK - 1); + if (left == 0) { + /* exact number of chunks: seek all the way minus one byte to check + for end-of-file with a read */ + lseek(in->fd, skip - 1, SEEK_CUR); + if (read(in->fd, in->buf, 1) != 1) + bail("unexpected end of file on ", in->name); + return; + } + + /* skip the integral chunks, update skip with remainder */ + lseek(in->fd, skip - left, SEEK_CUR); + skip = left; + } + + /* read more input and skip remainder */ + bload(in); + if (skip > in->left) + bail("unexpected end of file on ", in->name); + in->left -= skip; + in->next += skip; +} + +/* -- end of buffered input functions -- */ + +/* skip the gzip header from file in */ +local void gzhead(bin *in) +{ + int flags; + + /* verify gzip magic header and compression method */ + if (bget(in) != 0x1f || bget(in) != 0x8b || bget(in) != 8) + bail(in->name, " is not a valid gzip file"); + + /* get and verify flags */ + flags = bget(in); + if ((flags & 0xe0) != 0) + bail("unknown reserved bits set in ", in->name); + + /* skip modification time, extra flags, and os */ + bskip(in, 6); + + /* skip extra field if present */ + if (flags & 4) { + unsigned len; + + len = bget(in); + len += (unsigned)(bget(in)) << 8; + bskip(in, len); + } + + /* skip file name if present */ + if (flags & 8) + while (bget(in) != 0) + ; + + /* skip comment if present */ + if (flags & 16) + while (bget(in) != 0) + ; + + /* skip header crc if present */ + if (flags & 2) + bskip(in, 2); +} + +/* write a four-byte little-endian unsigned integer to out */ +local void put4(unsigned long val, FILE *out) +{ + putc(val & 0xff, out); + putc((val >> 8) & 0xff, out); + putc((val >> 16) & 0xff, out); + putc((val >> 24) & 0xff, out); +} + +/* Load up zlib stream from buffered input, bail if end of file */ +local void zpull(z_streamp strm, bin *in) +{ + if (in->left == 0) + bload(in); + if (in->left == 0) + bail("unexpected end of file on ", in->name); + strm->avail_in = in->left; + strm->next_in = in->next; +} + +/* Write header for gzip file to out and initialize trailer. */ +local void gzinit(unsigned long *crc, unsigned long *tot, FILE *out) +{ + fwrite("\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10, out); + *crc = crc32(0L, Z_NULL, 0); + *tot = 0; +} + +/* Copy the compressed data from name, zeroing the last block bit of the last + block if clr is true, and adding empty blocks as needed to get to a byte + boundary. If clr is false, then the last block becomes the last block of + the output, and the gzip trailer is written. crc and tot maintains the + crc and length (modulo 2^32) of the output for the trailer. The resulting + gzip file is written to out. gzinit() must be called before the first call + of gzcopy() to write the gzip header and to initialize crc and tot. */ +local void gzcopy(char *name, int clr, unsigned long *crc, unsigned long *tot, + FILE *out) +{ + int ret; /* return value from zlib functions */ + int pos; /* where the "last block" bit is in byte */ + int last; /* true if processing the last block */ + bin *in; /* buffered input file */ + unsigned char *start; /* start of compressed data in buffer */ + unsigned char *junk; /* buffer for uncompressed data -- discarded */ + z_off_t len; /* length of uncompressed data (support > 4 GB) */ + z_stream strm; /* zlib inflate stream */ + + /* open gzip file and skip header */ + in = bopen(name); + if (in == NULL) + bail("could not open ", name); + gzhead(in); + + /* allocate buffer for uncompressed data and initialize raw inflate + stream */ + junk = malloc(CHUNK); + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, -15); + if (junk == NULL || ret != Z_OK) + bail("out of memory", ""); + + /* inflate and copy compressed data, clear last-block bit if requested */ + len = 0; + zpull(&strm, in); + start = strm.next_in; + last = start[0] & 1; + if (last && clr) + start[0] &= ~1; + strm.avail_out = 0; + for (;;) { + /* if input used and output done, write used input and get more */ + if (strm.avail_in == 0 && strm.avail_out != 0) { + fwrite(start, 1, strm.next_in - start, out); + start = in->buf; + in->left = 0; + zpull(&strm, in); + } + + /* decompress -- return early when end-of-block reached */ + strm.avail_out = CHUNK; + strm.next_out = junk; + ret = inflate(&strm, Z_BLOCK); + switch (ret) { + case Z_MEM_ERROR: + bail("out of memory", ""); + case Z_DATA_ERROR: + bail("invalid compressed data in ", in->name); + } + + /* update length of uncompressed data */ + len += CHUNK - strm.avail_out; + + /* check for block boundary (only get this when block copied out) */ + if (strm.data_type & 128) { + /* if that was the last block, then done */ + if (last) + break; + + /* number of unused bits in last byte */ + pos = strm.data_type & 7; + + /* find the next last-block bit */ + if (pos != 0) { + /* next last-block bit is in last used byte */ + pos = 0x100 >> pos; + last = strm.next_in[-1] & pos; + if (last && clr) + strm.next_in[-1] &= ~pos; + } + else { + /* next last-block bit is in next unused byte */ + if (strm.avail_in == 0) { + /* don't have that byte yet -- get it */ + fwrite(start, 1, strm.next_in - start, out); + start = in->buf; + in->left = 0; + zpull(&strm, in); + } + last = strm.next_in[0] & 1; + if (last && clr) + strm.next_in[0] &= ~1; + } + } + } + + /* update buffer with unused input */ + in->left = strm.avail_in; + in->next = strm.next_in; + + /* copy used input, write empty blocks to get to byte boundary */ + pos = strm.data_type & 7; + fwrite(start, 1, in->next - start - 1, out); + last = in->next[-1]; + if (pos == 0 || !clr) + /* already at byte boundary, or last file: write last byte */ + putc(last, out); + else { + /* append empty blocks to last byte */ + last &= ((0x100 >> pos) - 1); /* assure unused bits are zero */ + if (pos & 1) { + /* odd -- append an empty stored block */ + putc(last, out); + if (pos == 1) + putc(0, out); /* two more bits in block header */ + fwrite("\0\0\xff\xff", 1, 4, out); + } + else { + /* even -- append 1, 2, or 3 empty fixed blocks */ + switch (pos) { + case 6: + putc(last | 8, out); + last = 0; + case 4: + putc(last | 0x20, out); + last = 0; + case 2: + putc(last | 0x80, out); + putc(0, out); + } + } + } + + /* update crc and tot */ + *crc = crc32_combine(*crc, bget4(in), len); + *tot += (unsigned long)len; + + /* clean up */ + inflateEnd(&strm); + free(junk); + bclose(in); + + /* write trailer if this is the last gzip file */ + if (!clr) { + put4(*crc, out); + put4(*tot, out); + } +} + +/* join the gzip files on the command line, write result to stdout */ +int main(int argc, char **argv) +{ + unsigned long crc, tot; /* running crc and total uncompressed length */ + + /* skip command name */ + argc--; + argv++; + + /* show usage if no arguments */ + if (argc == 0) { + fputs("gzjoin usage: gzjoin f1.gz [f2.gz [f3.gz ...]] > fjoin.gz\n", + stderr); + return 0; + } + + /* join gzip files on command line and write to stdout */ + gzinit(&crc, &tot, stdout); + while (argc--) + gzcopy(*argv++, argc, &crc, &tot, stdout); + + /* done */ + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/gzlog.c b/thirdparty/zlib/zlib-1.2.7/examples/gzlog.c new file mode 100644 index 0000000..d70aaca --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/gzlog.c @@ -0,0 +1,1058 @@ +/* + * gzlog.c + * Copyright (C) 2004, 2008 Mark Adler, all rights reserved + * For conditions of distribution and use, see copyright notice in gzlog.h + * version 2.0, 25 Apr 2008 + */ + +/* + gzlog provides a mechanism for frequently appending short strings to a gzip + file that is efficient both in execution time and compression ratio. The + strategy is to write the short strings in an uncompressed form to the end of + the gzip file, only compressing when the amount of uncompressed data has + reached a given threshold. + + gzlog also provides protection against interruptions in the process due to + system crashes. The status of the operation is recorded in an extra field + in the gzip file, and is only updated once the gzip file is brought to a + valid state. The last data to be appended or compressed is saved in an + auxiliary file, so that if the operation is interrupted, it can be completed + the next time an append operation is attempted. + + gzlog maintains another auxiliary file with the last 32K of data from the + compressed portion, which is preloaded for the compression of the subsequent + data. This minimizes the impact to the compression ratio of appending. + */ + +/* + Operations Concept: + + Files (log name "foo"): + foo.gz -- gzip file with the complete log + foo.add -- last message to append or last data to compress + foo.dict -- dictionary of the last 32K of data for next compression + foo.temp -- temporary dictionary file for compression after this one + foo.lock -- lock file for reading and writing the other files + foo.repairs -- log file for log file recovery operations (not compressed) + + gzip file structure: + - fixed-length (no file name) header with extra field (see below) + - compressed data ending initially with empty stored block + - uncompressed data filling out originally empty stored block and + subsequent stored blocks as needed (16K max each) + - gzip trailer + - no junk at end (no other gzip streams) + + When appending data, the information in the first three items above plus the + foo.add file are sufficient to recover an interrupted append operation. The + extra field has the necessary information to restore the start of the last + stored block and determine where to append the data in the foo.add file, as + well as the crc and length of the gzip data before the append operation. + + The foo.add file is created before the gzip file is marked for append, and + deleted after the gzip file is marked as complete. So if the append + operation is interrupted, the data to add will still be there. If due to + some external force, the foo.add file gets deleted between when the append + operation was interrupted and when recovery is attempted, the gzip file will + still be restored, but without the appended data. + + When compressing data, the information in the first two items above plus the + foo.add file are sufficient to recover an interrupted compress operation. + The extra field has the necessary information to find the end of the + compressed data, and contains both the crc and length of just the compressed + data and of the complete set of data including the contents of the foo.add + file. + + Again, the foo.add file is maintained during the compress operation in case + of an interruption. If in the unlikely event the foo.add file with the data + to be compressed is missing due to some external force, a gzip file with + just the previous compressed data will be reconstructed. In this case, all + of the data that was to be compressed is lost (approximately one megabyte). + This will not occur if all that happened was an interruption of the compress + operation. + + The third state that is marked is the replacement of the old dictionary with + the new dictionary after a compress operation. Once compression is + complete, the gzip file is marked as being in the replace state. This + completes the gzip file, so an interrupt after being so marked does not + result in recompression. Then the dictionary file is replaced, and the gzip + file is marked as completed. This state prevents the possibility of + restarting compression with the wrong dictionary file. + + All three operations are wrapped by a lock/unlock procedure. In order to + gain exclusive access to the log files, first a foo.lock file must be + exclusively created. When all operations are complete, the lock is + released by deleting the foo.lock file. If when attempting to create the + lock file, it already exists and the modify time of the lock file is more + than five minutes old (set by the PATIENCE define below), then the old + lock file is considered stale and deleted, and the exclusive creation of + the lock file is retried. To assure that there are no false assessments + of the staleness of the lock file, the operations periodically touch the + lock file to update the modified date. + + Following is the definition of the extra field with all of the information + required to enable the above append and compress operations and their + recovery if interrupted. Multi-byte values are stored little endian + (consistent with the gzip format). File pointers are eight bytes long. + The crc's and lengths for the gzip trailer are four bytes long. (Note that + the length at the end of a gzip file is used for error checking only, and + for large files is actually the length modulo 2^32.) The stored block + length is two bytes long. The gzip extra field two-byte identification is + "ap" for append. It is assumed that writing the extra field to the file is + an "atomic" operation. That is, either all of the extra field is written + to the file, or none of it is, if the operation is interrupted right at the + point of updating the extra field. This is a reasonable assumption, since + the extra field is within the first 52 bytes of the file, which is smaller + than any expected block size for a mass storage device (usually 512 bytes or + larger). + + Extra field (35 bytes): + - Pointer to first stored block length -- this points to the two-byte length + of the first stored block, which is followed by the two-byte, one's + complement of that length. The stored block length is preceded by the + three-bit header of the stored block, which is the actual start of the + stored block in the deflate format. See the bit offset field below. + - Pointer to the last stored block length. This is the same as above, but + for the last stored block of the uncompressed data in the gzip file. + Initially this is the same as the first stored block length pointer. + When the stored block gets to 16K (see the MAX_STORE define), then a new + stored block as added, at which point the last stored block length pointer + is different from the first stored block length pointer. When they are + different, the first bit of the last stored block header is eight bits, or + one byte back from the block length. + - Compressed data crc and length. This is the crc and length of the data + that is in the compressed portion of the deflate stream. These are used + only in the event that the foo.add file containing the data to compress is + lost after a compress operation is interrupted. + - Total data crc and length. This is the crc and length of all of the data + stored in the gzip file, compressed and uncompressed. It is used to + reconstruct the gzip trailer when compressing, as well as when recovering + interrupted operations. + - Final stored block length. This is used to quickly find where to append, + and allows the restoration of the original final stored block state when + an append operation is interrupted. + - First stored block start as the number of bits back from the final stored + block first length byte. This value is in the range of 3..10, and is + stored as the low three bits of the final byte of the extra field after + subtracting three (0..7). This allows the last-block bit of the stored + block header to be updated when a new stored block is added, for the case + when the first stored block and the last stored block are the same. (When + they are different, the numbers of bits back is known to be eight.) This + also allows for new compressed data to be appended to the old compressed + data in the compress operation, overwriting the previous first stored + block, or for the compressed data to be terminated and a valid gzip file + reconstructed on the off chance that a compression operation was + interrupted and the data to compress in the foo.add file was deleted. + - The operation in process. This is the next two bits in the last byte (the + bits under the mask 0x18). The are interpreted as 0: nothing in process, + 1: append in process, 2: compress in process, 3: replace in process. + - The top three bits of the last byte in the extra field are reserved and + are currently set to zero. + + Main procedure: + - Exclusively create the foo.lock file using the O_CREAT and O_EXCL modes of + the system open() call. If the modify time of an existing lock file is + more than PATIENCE seconds old, then the lock file is deleted and the + exclusive create is retried. + - Load the extra field from the foo.gz file, and see if an operation was in + progress but not completed. If so, apply the recovery procedure below. + - Perform the append procedure with the provided data. + - If the uncompressed data in the foo.gz file is 1MB or more, apply the + compress procedure. + - Delete the foo.lock file. + + Append procedure: + - Put what to append in the foo.add file so that the operation can be + restarted if this procedure is interrupted. + - Mark the foo.gz extra field with the append operation in progress. + + Restore the original last-block bit and stored block length of the last + stored block from the information in the extra field, in case a previous + append operation was interrupted. + - Append the provided data to the last stored block, creating new stored + blocks as needed and updating the stored blocks last-block bits and + lengths. + - Update the crc and length with the new data, and write the gzip trailer. + - Write over the extra field (with a single write operation) with the new + pointers, lengths, and crc's, and mark the gzip file as not in process. + Though there is still a foo.add file, it will be ignored since nothing + is in process. If a foo.add file is leftover from a previously + completed operation, it is truncated when writing new data to it. + - Delete the foo.add file. + + Compress and replace procedures: + - Read all of the uncompressed data in the stored blocks in foo.gz and write + it to foo.add. Also write foo.temp with the last 32K of that data to + provide a dictionary for the next invocation of this procedure. + - Rewrite the extra field marking foo.gz with a compression in process. + * If there is no data provided to compress (due to a missing foo.add file + when recovering), reconstruct and truncate the foo.gz file to contain + only the previous compressed data and proceed to the step after the next + one. Otherwise ... + - Compress the data with the dictionary in foo.dict, and write to the + foo.gz file starting at the bit immediately following the last previously + compressed block. If there is no foo.dict, proceed anyway with the + compression at slightly reduced efficiency. (For the foo.dict file to be + missing requires some external failure beyond simply the interruption of + a compress operation.) During this process, the foo.lock file is + periodically touched to assure that that file is not considered stale by + another process before we're done. The deflation is terminated with a + non-last empty static block (10 bits long), that is then located and + written over by a last-bit-set empty stored block. + - Append the crc and length of the data in the gzip file (previously + calculated during the append operations). + - Write over the extra field with the updated stored block offsets, bits + back, crc's, and lengths, and mark foo.gz as in process for a replacement + of the dictionary. + @ Delete the foo.add file. + - Replace foo.dict with foo.temp. + - Write over the extra field, marking foo.gz as complete. + + Recovery procedure: + - If not a replace recovery, read in the foo.add file, and provide that data + to the appropriate recovery below. If there is no foo.add file, provide + a zero data length to the recovery. In that case, the append recovery + restores the foo.gz to the previous compressed + uncompressed data state. + For the the compress recovery, a missing foo.add file results in foo.gz + being restored to the previous compressed-only data state. + - Append recovery: + - Pick up append at + step above + - Compress recovery: + - Pick up compress at * step above + - Replace recovery: + - Pick up compress at @ step above + - Log the repair with a date stamp in foo.repairs + */ + +#include +#include /* rename, fopen, fprintf, fclose */ +#include /* malloc, free */ +#include /* strlen, strrchr, strcpy, strncpy, strcmp */ +#include /* open */ +#include /* lseek, read, write, close, unlink, sleep, */ + /* ftruncate, fsync */ +#include /* errno */ +#include /* time, ctime */ +#include /* stat */ +#include /* utimes */ +#include "zlib.h" /* crc32 */ + +#include "gzlog.h" /* header for external access */ + +#define local static +typedef unsigned int uint; +typedef unsigned long ulong; + +/* Macro for debugging to deterministically force recovery operations */ +#ifdef DEBUG + #include /* longjmp */ + jmp_buf gzlog_jump; /* where to go back to */ + int gzlog_bail = 0; /* which point to bail at (1..8) */ + int gzlog_count = -1; /* number of times through to wait */ +# define BAIL(n) do { if (n == gzlog_bail && gzlog_count-- == 0) \ + longjmp(gzlog_jump, gzlog_bail); } while (0) +#else +# define BAIL(n) +#endif + +/* how old the lock file can be in seconds before considering it stale */ +#define PATIENCE 300 + +/* maximum stored block size in Kbytes -- must be in 1..63 */ +#define MAX_STORE 16 + +/* number of stored Kbytes to trigger compression (must be >= 32 to allow + dictionary construction, and <= 204 * MAX_STORE, in order for >> 10 to + discard the stored block headers contribution of five bytes each) */ +#define TRIGGER 1024 + +/* size of a deflate dictionary (this cannot be changed) */ +#define DICT 32768U + +/* values for the operation (2 bits) */ +#define NO_OP 0 +#define APPEND_OP 1 +#define COMPRESS_OP 2 +#define REPLACE_OP 3 + +/* macros to extract little-endian integers from an unsigned byte buffer */ +#define PULL2(p) ((p)[0]+((uint)((p)[1])<<8)) +#define PULL4(p) (PULL2(p)+((ulong)PULL2(p+2)<<16)) +#define PULL8(p) (PULL4(p)+((off_t)PULL4(p+4)<<32)) + +/* macros to store integers into a byte buffer in little-endian order */ +#define PUT2(p,a) do {(p)[0]=a;(p)[1]=(a)>>8;} while(0) +#define PUT4(p,a) do {PUT2(p,a);PUT2(p+2,a>>16);} while(0) +#define PUT8(p,a) do {PUT4(p,a);PUT4(p+4,a>>32);} while(0) + +/* internal structure for log information */ +#define LOGID "\106\035\172" /* should be three non-zero characters */ +struct log { + char id[4]; /* contains LOGID to detect inadvertent overwrites */ + int fd; /* file descriptor for .gz file, opened read/write */ + char *path; /* allocated path, e.g. "/var/log/foo" or "foo" */ + char *end; /* end of path, for appending suffices such as ".gz" */ + off_t first; /* offset of first stored block first length byte */ + int back; /* location of first block id in bits back from first */ + uint stored; /* bytes currently in last stored block */ + off_t last; /* offset of last stored block first length byte */ + ulong ccrc; /* crc of compressed data */ + ulong clen; /* length (modulo 2^32) of compressed data */ + ulong tcrc; /* crc of total data */ + ulong tlen; /* length (modulo 2^32) of total data */ + time_t lock; /* last modify time of our lock file */ +}; + +/* gzip header for gzlog */ +local unsigned char log_gzhead[] = { + 0x1f, 0x8b, /* magic gzip id */ + 8, /* compression method is deflate */ + 4, /* there is an extra field (no file name) */ + 0, 0, 0, 0, /* no modification time provided */ + 0, 0xff, /* no extra flags, no OS specified */ + 39, 0, 'a', 'p', 35, 0 /* extra field with "ap" subfield */ + /* 35 is EXTRA, 39 is EXTRA + 4 */ +}; + +#define HEAD sizeof(log_gzhead) /* should be 16 */ + +/* initial gzip extra field content (52 == HEAD + EXTRA + 1) */ +local unsigned char log_gzext[] = { + 52, 0, 0, 0, 0, 0, 0, 0, /* offset of first stored block length */ + 52, 0, 0, 0, 0, 0, 0, 0, /* offset of last stored block length */ + 0, 0, 0, 0, 0, 0, 0, 0, /* compressed data crc and length */ + 0, 0, 0, 0, 0, 0, 0, 0, /* total data crc and length */ + 0, 0, /* final stored block data length */ + 5 /* op is NO_OP, last bit 8 bits back */ +}; + +#define EXTRA sizeof(log_gzext) /* should be 35 */ + +/* initial gzip data and trailer */ +local unsigned char log_gzbody[] = { + 1, 0, 0, 0xff, 0xff, /* empty stored block (last) */ + 0, 0, 0, 0, /* crc */ + 0, 0, 0, 0 /* uncompressed length */ +}; + +#define BODY sizeof(log_gzbody) + +/* Exclusively create foo.lock in order to negotiate exclusive access to the + foo.* files. If the modify time of an existing lock file is greater than + PATIENCE seconds in the past, then consider the lock file to have been + abandoned, delete it, and try the exclusive create again. Save the lock + file modify time for verification of ownership. Return 0 on success, or -1 + on failure, usually due to an access restriction or invalid path. Note that + if stat() or unlink() fails, it may be due to another process noticing the + abandoned lock file a smidge sooner and deleting it, so those are not + flagged as an error. */ +local int log_lock(struct log *log) +{ + int fd; + struct stat st; + + strcpy(log->end, ".lock"); + while ((fd = open(log->path, O_CREAT | O_EXCL, 0644)) < 0) { + if (errno != EEXIST) + return -1; + if (stat(log->path, &st) == 0 && time(NULL) - st.st_mtime > PATIENCE) { + unlink(log->path); + continue; + } + sleep(2); /* relinquish the CPU for two seconds while waiting */ + } + close(fd); + if (stat(log->path, &st) == 0) + log->lock = st.st_mtime; + return 0; +} + +/* Update the modify time of the lock file to now, in order to prevent another + task from thinking that the lock is stale. Save the lock file modify time + for verification of ownership. */ +local void log_touch(struct log *log) +{ + struct stat st; + + strcpy(log->end, ".lock"); + utimes(log->path, NULL); + if (stat(log->path, &st) == 0) + log->lock = st.st_mtime; +} + +/* Check the log file modify time against what is expected. Return true if + this is not our lock. If it is our lock, touch it to keep it. */ +local int log_check(struct log *log) +{ + struct stat st; + + strcpy(log->end, ".lock"); + if (stat(log->path, &st) || st.st_mtime != log->lock) + return 1; + log_touch(log); + return 0; +} + +/* Unlock a previously acquired lock, but only if it's ours. */ +local void log_unlock(struct log *log) +{ + if (log_check(log)) + return; + strcpy(log->end, ".lock"); + unlink(log->path); + log->lock = 0; +} + +/* Check the gzip header and read in the extra field, filling in the values in + the log structure. Return op on success or -1 if the gzip header was not as + expected. op is the current operation in progress last written to the extra + field. This assumes that the gzip file has already been opened, with the + file descriptor log->fd. */ +local int log_head(struct log *log) +{ + int op; + unsigned char buf[HEAD + EXTRA]; + + if (lseek(log->fd, 0, SEEK_SET) < 0 || + read(log->fd, buf, HEAD + EXTRA) != HEAD + EXTRA || + memcmp(buf, log_gzhead, HEAD)) { + return -1; + } + log->first = PULL8(buf + HEAD); + log->last = PULL8(buf + HEAD + 8); + log->ccrc = PULL4(buf + HEAD + 16); + log->clen = PULL4(buf + HEAD + 20); + log->tcrc = PULL4(buf + HEAD + 24); + log->tlen = PULL4(buf + HEAD + 28); + log->stored = PULL2(buf + HEAD + 32); + log->back = 3 + (buf[HEAD + 34] & 7); + op = (buf[HEAD + 34] >> 3) & 3; + return op; +} + +/* Write over the extra field contents, marking the operation as op. Use fsync + to assure that the device is written to, and in the requested order. This + operation, and only this operation, is assumed to be atomic in order to + assure that the log is recoverable in the event of an interruption at any + point in the process. Return -1 if the write to foo.gz failed. */ +local int log_mark(struct log *log, int op) +{ + int ret; + unsigned char ext[EXTRA]; + + PUT8(ext, log->first); + PUT8(ext + 8, log->last); + PUT4(ext + 16, log->ccrc); + PUT4(ext + 20, log->clen); + PUT4(ext + 24, log->tcrc); + PUT4(ext + 28, log->tlen); + PUT2(ext + 32, log->stored); + ext[34] = log->back - 3 + (op << 3); + fsync(log->fd); + ret = lseek(log->fd, HEAD, SEEK_SET) < 0 || + write(log->fd, ext, EXTRA) != EXTRA ? -1 : 0; + fsync(log->fd); + return ret; +} + +/* Rewrite the last block header bits and subsequent zero bits to get to a byte + boundary, setting the last block bit if last is true, and then write the + remainder of the stored block header (length and one's complement). Leave + the file pointer after the end of the last stored block data. Return -1 if + there is a read or write failure on the foo.gz file */ +local int log_last(struct log *log, int last) +{ + int back, len, mask; + unsigned char buf[6]; + + /* determine the locations of the bytes and bits to modify */ + back = log->last == log->first ? log->back : 8; + len = back > 8 ? 2 : 1; /* bytes back from log->last */ + mask = 0x80 >> ((back - 1) & 7); /* mask for block last-bit */ + + /* get the byte to modify (one or two back) into buf[0] -- don't need to + read the byte if the last-bit is eight bits back, since in that case + the entire byte will be modified */ + buf[0] = 0; + if (back != 8 && (lseek(log->fd, log->last - len, SEEK_SET) < 0 || + read(log->fd, buf, 1) != 1)) + return -1; + + /* change the last-bit of the last stored block as requested -- note + that all bits above the last-bit are set to zero, per the type bits + of a stored block being 00 and per the convention that the bits to + bring the stream to a byte boundary are also zeros */ + buf[1] = 0; + buf[2 - len] = (*buf & (mask - 1)) + (last ? mask : 0); + + /* write the modified stored block header and lengths, move the file + pointer to after the last stored block data */ + PUT2(buf + 2, log->stored); + PUT2(buf + 4, log->stored ^ 0xffff); + return lseek(log->fd, log->last - len, SEEK_SET) < 0 || + write(log->fd, buf + 2 - len, len + 4) != len + 4 || + lseek(log->fd, log->stored, SEEK_CUR) < 0 ? -1 : 0; +} + +/* Append len bytes from data to the locked and open log file. len may be zero + if recovering and no .add file was found. In that case, the previous state + of the foo.gz file is restored. The data is appended uncompressed in + deflate stored blocks. Return -1 if there was an error reading or writing + the foo.gz file. */ +local int log_append(struct log *log, unsigned char *data, size_t len) +{ + uint put; + off_t end; + unsigned char buf[8]; + + /* set the last block last-bit and length, in case recovering an + interrupted append, then position the file pointer to append to the + block */ + if (log_last(log, 1)) + return -1; + + /* append, adding stored blocks and updating the offset of the last stored + block as needed, and update the total crc and length */ + while (len) { + /* append as much as we can to the last block */ + put = (MAX_STORE << 10) - log->stored; + if (put > len) + put = (uint)len; + if (put) { + if (write(log->fd, data, put) != put) + return -1; + BAIL(1); + log->tcrc = crc32(log->tcrc, data, put); + log->tlen += put; + log->stored += put; + data += put; + len -= put; + } + + /* if we need to, add a new empty stored block */ + if (len) { + /* mark current block as not last */ + if (log_last(log, 0)) + return -1; + + /* point to new, empty stored block */ + log->last += 4 + log->stored + 1; + log->stored = 0; + } + + /* mark last block as last, update its length */ + if (log_last(log, 1)) + return -1; + BAIL(2); + } + + /* write the new crc and length trailer, and truncate just in case (could + be recovering from partial append with a missing foo.add file) */ + PUT4(buf, log->tcrc); + PUT4(buf + 4, log->tlen); + if (write(log->fd, buf, 8) != 8 || + (end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end)) + return -1; + + /* write the extra field, marking the log file as done, delete .add file */ + if (log_mark(log, NO_OP)) + return -1; + strcpy(log->end, ".add"); + unlink(log->path); /* ignore error, since may not exist */ + return 0; +} + +/* Replace the foo.dict file with the foo.temp file. Also delete the foo.add + file, since the compress operation may have been interrupted before that was + done. Returns 1 if memory could not be allocated, or -1 if reading or + writing foo.gz fails, or if the rename fails for some reason other than + foo.temp not existing. foo.temp not existing is a permitted error, since + the replace operation may have been interrupted after the rename is done, + but before foo.gz is marked as complete. */ +local int log_replace(struct log *log) +{ + int ret; + char *dest; + + /* delete foo.add file */ + strcpy(log->end, ".add"); + unlink(log->path); /* ignore error, since may not exist */ + BAIL(3); + + /* rename foo.name to foo.dict, replacing foo.dict if it exists */ + strcpy(log->end, ".dict"); + dest = malloc(strlen(log->path) + 1); + if (dest == NULL) + return -2; + strcpy(dest, log->path); + strcpy(log->end, ".temp"); + ret = rename(log->path, dest); + free(dest); + if (ret && errno != ENOENT) + return -1; + BAIL(4); + + /* mark the foo.gz file as done */ + return log_mark(log, NO_OP); +} + +/* Compress the len bytes at data and append the compressed data to the + foo.gz deflate data immediately after the previous compressed data. This + overwrites the previous uncompressed data, which was stored in foo.add + and is the data provided in data[0..len-1]. If this operation is + interrupted, it picks up at the start of this routine, with the foo.add + file read in again. If there is no data to compress (len == 0), then we + simply terminate the foo.gz file after the previously compressed data, + appending a final empty stored block and the gzip trailer. Return -1 if + reading or writing the log.gz file failed, or -2 if there was a memory + allocation failure. */ +local int log_compress(struct log *log, unsigned char *data, size_t len) +{ + int fd; + uint got, max; + ssize_t dict; + off_t end; + z_stream strm; + unsigned char buf[DICT]; + + /* compress and append compressed data */ + if (len) { + /* set up for deflate, allocating memory */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, 8, + Z_DEFAULT_STRATEGY) != Z_OK) + return -2; + + /* read in dictionary (last 32K of data that was compressed) */ + strcpy(log->end, ".dict"); + fd = open(log->path, O_RDONLY, 0); + if (fd >= 0) { + dict = read(fd, buf, DICT); + close(fd); + if (dict < 0) { + deflateEnd(&strm); + return -1; + } + if (dict) + deflateSetDictionary(&strm, buf, (uint)dict); + } + log_touch(log); + + /* prime deflate with last bits of previous block, position write + pointer to write those bits and overwrite what follows */ + if (lseek(log->fd, log->first - (log->back > 8 ? 2 : 1), + SEEK_SET) < 0 || + read(log->fd, buf, 1) != 1 || lseek(log->fd, -1, SEEK_CUR) < 0) { + deflateEnd(&strm); + return -1; + } + deflatePrime(&strm, (8 - log->back) & 7, *buf); + + /* compress, finishing with a partial non-last empty static block */ + strm.next_in = data; + max = (((uint)0 - 1) >> 1) + 1; /* in case int smaller than size_t */ + do { + strm.avail_in = len > max ? max : (uint)len; + len -= strm.avail_in; + do { + strm.avail_out = DICT; + strm.next_out = buf; + deflate(&strm, len ? Z_NO_FLUSH : Z_PARTIAL_FLUSH); + got = DICT - strm.avail_out; + if (got && write(log->fd, buf, got) != got) { + deflateEnd(&strm); + return -1; + } + log_touch(log); + } while (strm.avail_out == 0); + } while (len); + deflateEnd(&strm); + BAIL(5); + + /* find start of empty static block -- scanning backwards the first one + bit is the second bit of the block, if the last byte is zero, then + we know the byte before that has a one in the top bit, since an + empty static block is ten bits long */ + if ((log->first = lseek(log->fd, -1, SEEK_CUR)) < 0 || + read(log->fd, buf, 1) != 1) + return -1; + log->first++; + if (*buf) { + log->back = 1; + while ((*buf & ((uint)1 << (8 - log->back++))) == 0) + ; /* guaranteed to terminate, since *buf != 0 */ + } + else + log->back = 10; + + /* update compressed crc and length */ + log->ccrc = log->tcrc; + log->clen = log->tlen; + } + else { + /* no data to compress -- fix up existing gzip stream */ + log->tcrc = log->ccrc; + log->tlen = log->clen; + } + + /* complete and truncate gzip stream */ + log->last = log->first; + log->stored = 0; + PUT4(buf, log->tcrc); + PUT4(buf + 4, log->tlen); + if (log_last(log, 1) || write(log->fd, buf, 8) != 8 || + (end = lseek(log->fd, 0, SEEK_CUR)) < 0 || ftruncate(log->fd, end)) + return -1; + BAIL(6); + + /* mark as being in the replace operation */ + if (log_mark(log, REPLACE_OP)) + return -1; + + /* execute the replace operation and mark the file as done */ + return log_replace(log); +} + +/* log a repair record to the .repairs file */ +local void log_log(struct log *log, int op, char *record) +{ + time_t now; + FILE *rec; + + now = time(NULL); + strcpy(log->end, ".repairs"); + rec = fopen(log->path, "a"); + if (rec == NULL) + return; + fprintf(rec, "%.24s %s recovery: %s\n", ctime(&now), op == APPEND_OP ? + "append" : (op == COMPRESS_OP ? "compress" : "replace"), record); + fclose(rec); + return; +} + +/* Recover the interrupted operation op. First read foo.add for recovering an + append or compress operation. Return -1 if there was an error reading or + writing foo.gz or reading an existing foo.add, or -2 if there was a memory + allocation failure. */ +local int log_recover(struct log *log, int op) +{ + int fd, ret = 0; + unsigned char *data = NULL; + size_t len = 0; + struct stat st; + + /* log recovery */ + log_log(log, op, "start"); + + /* load foo.add file if expected and present */ + if (op == APPEND_OP || op == COMPRESS_OP) { + strcpy(log->end, ".add"); + if (stat(log->path, &st) == 0 && st.st_size) { + len = (size_t)(st.st_size); + if (len != st.st_size || (data = malloc(st.st_size)) == NULL) { + log_log(log, op, "allocation failure"); + return -2; + } + if ((fd = open(log->path, O_RDONLY, 0)) < 0) { + log_log(log, op, ".add file read failure"); + return -1; + } + ret = read(fd, data, len) != len; + close(fd); + if (ret) { + log_log(log, op, ".add file read failure"); + return -1; + } + log_log(log, op, "loaded .add file"); + } + else + log_log(log, op, "missing .add file!"); + } + + /* recover the interrupted operation */ + switch (op) { + case APPEND_OP: + ret = log_append(log, data, len); + break; + case COMPRESS_OP: + ret = log_compress(log, data, len); + break; + case REPLACE_OP: + ret = log_replace(log); + } + + /* log status */ + log_log(log, op, ret ? "failure" : "complete"); + + /* clean up */ + if (data != NULL) + free(data); + return ret; +} + +/* Close the foo.gz file (if open) and release the lock. */ +local void log_close(struct log *log) +{ + if (log->fd >= 0) + close(log->fd); + log->fd = -1; + log_unlock(log); +} + +/* Open foo.gz, verify the header, and load the extra field contents, after + first creating the foo.lock file to gain exclusive access to the foo.* + files. If foo.gz does not exist or is empty, then write the initial header, + extra, and body content of an empty foo.gz log file. If there is an error + creating the lock file due to access restrictions, or an error reading or + writing the foo.gz file, or if the foo.gz file is not a proper log file for + this object (e.g. not a gzip file or does not contain the expected extra + field), then return true. If there is an error, the lock is released. + Otherwise, the lock is left in place. */ +local int log_open(struct log *log) +{ + int op; + + /* release open file resource if left over -- can occur if lock lost + between gzlog_open() and gzlog_write() */ + if (log->fd >= 0) + close(log->fd); + log->fd = -1; + + /* negotiate exclusive access */ + if (log_lock(log) < 0) + return -1; + + /* open the log file, foo.gz */ + strcpy(log->end, ".gz"); + log->fd = open(log->path, O_RDWR | O_CREAT, 0644); + if (log->fd < 0) { + log_close(log); + return -1; + } + + /* if new, initialize foo.gz with an empty log, delete old dictionary */ + if (lseek(log->fd, 0, SEEK_END) == 0) { + if (write(log->fd, log_gzhead, HEAD) != HEAD || + write(log->fd, log_gzext, EXTRA) != EXTRA || + write(log->fd, log_gzbody, BODY) != BODY) { + log_close(log); + return -1; + } + strcpy(log->end, ".dict"); + unlink(log->path); + } + + /* verify log file and load extra field information */ + if ((op = log_head(log)) < 0) { + log_close(log); + return -1; + } + + /* check for interrupted process and if so, recover */ + if (op != NO_OP && log_recover(log, op)) { + log_close(log); + return -1; + } + + /* touch the lock file to prevent another process from grabbing it */ + log_touch(log); + return 0; +} + +/* See gzlog.h for the description of the external methods below */ +gzlog *gzlog_open(char *path) +{ + size_t n; + struct log *log; + + /* check arguments */ + if (path == NULL || *path == 0) + return NULL; + + /* allocate and initialize log structure */ + log = malloc(sizeof(struct log)); + if (log == NULL) + return NULL; + strcpy(log->id, LOGID); + log->fd = -1; + + /* save path and end of path for name construction */ + n = strlen(path); + log->path = malloc(n + 9); /* allow for ".repairs" */ + if (log->path == NULL) { + free(log); + return NULL; + } + strcpy(log->path, path); + log->end = log->path + n; + + /* gain exclusive access and verify log file -- may perform a + recovery operation if needed */ + if (log_open(log)) { + free(log->path); + free(log); + return NULL; + } + + /* return pointer to log structure */ + return log; +} + +/* gzlog_compress() return values: + 0: all good + -1: file i/o error (usually access issue) + -2: memory allocation failure + -3: invalid log pointer argument */ +int gzlog_compress(gzlog *logd) +{ + int fd, ret; + uint block; + size_t len, next; + unsigned char *data, buf[5]; + struct log *log = logd; + + /* check arguments */ + if (log == NULL || strcmp(log->id, LOGID) || len < 0) + return -3; + + /* see if we lost the lock -- if so get it again and reload the extra + field information (it probably changed), recover last operation if + necessary */ + if (log_check(log) && log_open(log)) + return -1; + + /* create space for uncompressed data */ + len = ((size_t)(log->last - log->first) & ~(((size_t)1 << 10) - 1)) + + log->stored; + if ((data = malloc(len)) == NULL) + return -2; + + /* do statement here is just a cheap trick for error handling */ + do { + /* read in the uncompressed data */ + if (lseek(log->fd, log->first - 1, SEEK_SET) < 0) + break; + next = 0; + while (next < len) { + if (read(log->fd, buf, 5) != 5) + break; + block = PULL2(buf + 1); + if (next + block > len || + read(log->fd, (char *)data + next, block) != block) + break; + next += block; + } + if (lseek(log->fd, 0, SEEK_CUR) != log->last + 4 + log->stored) + break; + log_touch(log); + + /* write the uncompressed data to the .add file */ + strcpy(log->end, ".add"); + fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd < 0) + break; + ret = write(fd, data, len) != len; + if (ret | close(fd)) + break; + log_touch(log); + + /* write the dictionary for the next compress to the .temp file */ + strcpy(log->end, ".temp"); + fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd < 0) + break; + next = DICT > len ? len : DICT; + ret = write(fd, (char *)data + len - next, next) != next; + if (ret | close(fd)) + break; + log_touch(log); + + /* roll back to compressed data, mark the compress in progress */ + log->last = log->first; + log->stored = 0; + if (log_mark(log, COMPRESS_OP)) + break; + BAIL(7); + + /* compress and append the data (clears mark) */ + ret = log_compress(log, data, len); + free(data); + return ret; + } while (0); + + /* broke out of do above on i/o error */ + free(data); + return -1; +} + +/* gzlog_write() return values: + 0: all good + -1: file i/o error (usually access issue) + -2: memory allocation failure + -3: invalid log pointer argument */ +int gzlog_write(gzlog *logd, void *data, size_t len) +{ + int fd, ret; + struct log *log = logd; + + /* check arguments */ + if (log == NULL || strcmp(log->id, LOGID) || len < 0) + return -3; + if (data == NULL || len == 0) + return 0; + + /* see if we lost the lock -- if so get it again and reload the extra + field information (it probably changed), recover last operation if + necessary */ + if (log_check(log) && log_open(log)) + return -1; + + /* create and write .add file */ + strcpy(log->end, ".add"); + fd = open(log->path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd < 0) + return -1; + ret = write(fd, data, len) != len; + if (ret | close(fd)) + return -1; + log_touch(log); + + /* mark log file with append in progress */ + if (log_mark(log, APPEND_OP)) + return -1; + BAIL(8); + + /* append data (clears mark) */ + if (log_append(log, data, len)) + return -1; + + /* check to see if it's time to compress -- if not, then done */ + if (((log->last - log->first) >> 10) + (log->stored >> 10) < TRIGGER) + return 0; + + /* time to compress */ + return gzlog_compress(log); +} + +/* gzlog_close() return values: + 0: ok + -3: invalid log pointer argument */ +int gzlog_close(gzlog *logd) +{ + struct log *log = logd; + + /* check arguments */ + if (log == NULL || strcmp(log->id, LOGID)) + return -3; + + /* close the log file and release the lock */ + log_close(log); + + /* free structure and return */ + if (log->path != NULL) + free(log->path); + strcpy(log->id, "bad"); + free(log); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/gzlog.h b/thirdparty/zlib/zlib-1.2.7/examples/gzlog.h new file mode 100644 index 0000000..c461426 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/gzlog.h @@ -0,0 +1,89 @@ +/* gzlog.h + Copyright (C) 2004, 2008 Mark Adler, all rights reserved + version 2.0, 25 Apr 2008 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Mark Adler madler@alumni.caltech.edu + */ + +/* Version History: + 1.0 26 Nov 2004 First version + 2.0 25 Apr 2008 Complete redesign for recovery of interrupted operations + Interface changed slightly in that now path is a prefix + Compression now occurs as needed during gzlog_write() + gzlog_write() now always leaves the log file as valid gzip + */ + +/* + The gzlog object allows writing short messages to a gzipped log file, + opening the log file locked for small bursts, and then closing it. The log + object works by appending stored (uncompressed) data to the gzip file until + 1 MB has been accumulated. At that time, the stored data is compressed, and + replaces the uncompressed data in the file. The log file is truncated to + its new size at that time. After each write operation, the log file is a + valid gzip file that can decompressed to recover what was written. + + The gzlog operations can be interupted at any point due to an application or + system crash, and the log file will be recovered the next time the log is + opened with gzlog_open(). + */ + +#ifndef GZLOG_H +#define GZLOG_H + +/* gzlog object type */ +typedef void gzlog; + +/* Open a gzlog object, creating the log file if it does not exist. Return + NULL on error. Note that gzlog_open() could take a while to complete if it + has to wait to verify that a lock is stale (possibly for five minutes), or + if there is significant contention with other instantiations of this object + when locking the resource. path is the prefix of the file names created by + this object. If path is "foo", then the log file will be "foo.gz", and + other auxiliary files will be created and destroyed during the process: + "foo.dict" for a compression dictionary, "foo.temp" for a temporary (next) + dictionary, "foo.add" for data being added or compressed, "foo.lock" for the + lock file, and "foo.repairs" to log recovery operations performed due to + interrupted gzlog operations. A gzlog_open() followed by a gzlog_close() + will recover a previously interrupted operation, if any. */ +gzlog *gzlog_open(char *path); + +/* Write to a gzlog object. Return zero on success, -1 if there is a file i/o + error on any of the gzlog files (this should not happen if gzlog_open() + succeeded, unless the device has run out of space or leftover auxiliary + files have permissions or ownership that prevent their use), -2 if there is + a memory allocation failure, or -3 if the log argument is invalid (e.g. if + it was not created by gzlog_open()). This function will write data to the + file uncompressed, until 1 MB has been accumulated, at which time that data + will be compressed. The log file will be a valid gzip file upon successful + return. */ +int gzlog_write(gzlog *log, void *data, size_t len); + +/* Force compression of any uncompressed data in the log. This should be used + sparingly, if at all. The main application would be when a log file will + not be appended to again. If this is used to compress frequently while + appending, it will both significantly increase the execution time and + reduce the compression ratio. The return codes are the same as for + gzlog_write(). */ +int gzlog_compress(gzlog *log); + +/* Close a gzlog object. Return zero on success, -3 if the log argument is + invalid. The log object is freed, and so cannot be referenced again. */ +int gzlog_close(gzlog *log); + +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/examples/zlib_how.html b/thirdparty/zlib/zlib-1.2.7/examples/zlib_how.html new file mode 100644 index 0000000..444ff1c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/zlib_how.html @@ -0,0 +1,545 @@ + + + + +zlib Usage Example + + + +

    zlib Usage Example

    +We often get questions about how the deflate() and inflate() functions should be used. +Users wonder when they should provide more input, when they should use more output, +what to do with a Z_BUF_ERROR, how to make sure the process terminates properly, and +so on. So for those who have read zlib.h (a few times), and +would like further edification, below is an annotated example in C of simple routines to compress and decompress +from an input file to an output file using deflate() and inflate() respectively. The +annotations are interspersed between lines of the code. So please read between the lines. +We hope this helps explain some of the intricacies of zlib. +

    +Without further adieu, here is the program zpipe.c: +

    
    +/* zpipe.c: example of proper use of zlib's inflate() and deflate()
    +   Not copyrighted -- provided to the public domain
    +   Version 1.4  11 December 2005  Mark Adler */
    +
    +/* Version history:
    +   1.0  30 Oct 2004  First version
    +   1.1   8 Nov 2004  Add void casting for unused return values
    +                     Use switch statement for inflate() return values
    +   1.2   9 Nov 2004  Add assertions to document zlib guarantees
    +   1.3   6 Apr 2005  Remove incorrect assertion in inf()
    +   1.4  11 Dec 2005  Add hack to avoid MSDOS end-of-line conversions
    +                     Avoid some compiler warnings for input and output buffers
    + */
    +
    +We now include the header files for the required definitions. From +stdio.h we use fopen(), fread(), fwrite(), +feof(), ferror(), and fclose() for file i/o, and +fputs() for error messages. From string.h we use +strcmp() for command line argument processing. +From assert.h we use the assert() macro. +From zlib.h +we use the basic compression functions deflateInit(), +deflate(), and deflateEnd(), and the basic decompression +functions inflateInit(), inflate(), and +inflateEnd(). +
    
    +#include <stdio.h>
    +#include <string.h>
    +#include <assert.h>
    +#include "zlib.h"
    +
    +This is an ugly hack required to avoid corruption of the input and output data on +Windows/MS-DOS systems. Without this, those systems would assume that the input and output +files are text, and try to convert the end-of-line characters from one standard to +another. That would corrupt binary data, and in particular would render the compressed data unusable. +This sets the input and output to binary which suppresses the end-of-line conversions. +SET_BINARY_MODE() will be used later on stdin and stdout, at the beginning of main(). +
    
    +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
    +#  include <fcntl.h>
    +#  include <io.h>
    +#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
    +#else
    +#  define SET_BINARY_MODE(file)
    +#endif
    +
    +CHUNK is simply the buffer size for feeding data to and pulling data +from the zlib routines. Larger buffer sizes would be more efficient, +especially for inflate(). If the memory is available, buffers sizes +on the order of 128K or 256K bytes should be used. +
    
    +#define CHUNK 16384
    +
    +The def() routine compresses data from an input file to an output file. The output data +will be in the zlib format, which is different from the gzip or zip +formats. The zlib format has a very small header of only two bytes to identify it as +a zlib stream and to provide decoding information, and a four-byte trailer with a fast +check value to verify the integrity of the uncompressed data after decoding. +
    
    +/* Compress from file source to file dest until EOF on source.
    +   def() returns Z_OK on success, Z_MEM_ERROR if memory could not be
    +   allocated for processing, Z_STREAM_ERROR if an invalid compression
    +   level is supplied, Z_VERSION_ERROR if the version of zlib.h and the
    +   version of the library linked do not match, or Z_ERRNO if there is
    +   an error reading or writing the files. */
    +int def(FILE *source, FILE *dest, int level)
    +{
    +
    +Here are the local variables for def(). ret will be used for zlib +return codes. flush will keep track of the current flushing state for deflate(), +which is either no flushing, or flush to completion after the end of the input file is reached. +have is the amount of data returned from deflate(). The strm structure +is used to pass information to and from the zlib routines, and to maintain the +deflate() state. in and out are the input and output buffers for +deflate(). +
    
    +    int ret, flush;
    +    unsigned have;
    +    z_stream strm;
    +    unsigned char in[CHUNK];
    +    unsigned char out[CHUNK];
    +
    +The first thing we do is to initialize the zlib state for compression using +deflateInit(). This must be done before the first use of deflate(). +The zalloc, zfree, and opaque fields in the strm +structure must be initialized before calling deflateInit(). Here they are +set to the zlib constant Z_NULL to request that zlib use +the default memory allocation routines. An application may also choose to provide +custom memory allocation routines here. deflateInit() will allocate on the +order of 256K bytes for the internal state. +(See zlib Technical Details.) +

    +deflateInit() is called with a pointer to the structure to be initialized and +the compression level, which is an integer in the range of -1 to 9. Lower compression +levels result in faster execution, but less compression. Higher levels result in +greater compression, but slower execution. The zlib constant Z_DEFAULT_COMPRESSION, +equal to -1, +provides a good compromise between compression and speed and is equivalent to level 6. +Level 0 actually does no compression at all, and in fact expands the data slightly to produce +the zlib format (it is not a byte-for-byte copy of the input). +More advanced applications of zlib +may use deflateInit2() here instead. Such an application may want to reduce how +much memory will be used, at some price in compression. Or it may need to request a +gzip header and trailer instead of a zlib header and trailer, or raw +encoding with no header or trailer at all. +

    +We must check the return value of deflateInit() against the zlib constant +Z_OK to make sure that it was able to +allocate memory for the internal state, and that the provided arguments were valid. +deflateInit() will also check that the version of zlib that the zlib.h +file came from matches the version of zlib actually linked with the program. This +is especially important for environments in which zlib is a shared library. +

    +Note that an application can initialize multiple, independent zlib streams, which can +operate in parallel. The state information maintained in the structure allows the zlib +routines to be reentrant. +

    
    +    /* allocate deflate state */
    +    strm.zalloc = Z_NULL;
    +    strm.zfree = Z_NULL;
    +    strm.opaque = Z_NULL;
    +    ret = deflateInit(&strm, level);
    +    if (ret != Z_OK)
    +        return ret;
    +
    +With the pleasantries out of the way, now we can get down to business. The outer do-loop +reads all of the input file and exits at the bottom of the loop once end-of-file is reached. +This loop contains the only call of deflate(). So we must make sure that all of the +input data has been processed and that all of the output data has been generated and consumed +before we fall out of the loop at the bottom. +
    
    +    /* compress until end of file */
    +    do {
    +
    +We start off by reading data from the input file. The number of bytes read is put directly +into avail_in, and a pointer to those bytes is put into next_in. We also +check to see if end-of-file on the input has been reached. If we are at the end of file, then flush is set to the +zlib constant Z_FINISH, which is later passed to deflate() to +indicate that this is the last chunk of input data to compress. We need to use feof() +to check for end-of-file as opposed to seeing if fewer than CHUNK bytes have been read. The +reason is that if the input file length is an exact multiple of CHUNK, we will miss +the fact that we got to the end-of-file, and not know to tell deflate() to finish +up the compressed stream. If we are not yet at the end of the input, then the zlib +constant Z_NO_FLUSH will be passed to deflate to indicate that we are still +in the middle of the uncompressed data. +

    +If there is an error in reading from the input file, the process is aborted with +deflateEnd() being called to free the allocated zlib state before returning +the error. We wouldn't want a memory leak, now would we? deflateEnd() can be called +at any time after the state has been initialized. Once that's done, deflateInit() (or +deflateInit2()) would have to be called to start a new compression process. There is +no point here in checking the deflateEnd() return code. The deallocation can't fail. +

    
    +        strm.avail_in = fread(in, 1, CHUNK, source);
    +        if (ferror(source)) {
    +            (void)deflateEnd(&strm);
    +            return Z_ERRNO;
    +        }
    +        flush = feof(source) ? Z_FINISH : Z_NO_FLUSH;
    +        strm.next_in = in;
    +
    +The inner do-loop passes our chunk of input data to deflate(), and then +keeps calling deflate() until it is done producing output. Once there is no more +new output, deflate() is guaranteed to have consumed all of the input, i.e., +avail_in will be zero. +
    
    +        /* run deflate() on input until output buffer not full, finish
    +           compression if all of source has been read in */
    +        do {
    +
    +Output space is provided to deflate() by setting avail_out to the number +of available output bytes and next_out to a pointer to that space. +
    
    +            strm.avail_out = CHUNK;
    +            strm.next_out = out;
    +
    +Now we call the compression engine itself, deflate(). It takes as many of the +avail_in bytes at next_in as it can process, and writes as many as +avail_out bytes to next_out. Those counters and pointers are then +updated past the input data consumed and the output data written. It is the amount of +output space available that may limit how much input is consumed. +Hence the inner loop to make sure that +all of the input is consumed by providing more output space each time. Since avail_in +and next_in are updated by deflate(), we don't have to mess with those +between deflate() calls until it's all used up. +

    +The parameters to deflate() are a pointer to the strm structure containing +the input and output information and the internal compression engine state, and a parameter +indicating whether and how to flush data to the output. Normally deflate will consume +several K bytes of input data before producing any output (except for the header), in order +to accumulate statistics on the data for optimum compression. It will then put out a burst of +compressed data, and proceed to consume more input before the next burst. Eventually, +deflate() +must be told to terminate the stream, complete the compression with provided input data, and +write out the trailer check value. deflate() will continue to compress normally as long +as the flush parameter is Z_NO_FLUSH. Once the Z_FINISH parameter is provided, +deflate() will begin to complete the compressed output stream. However depending on how +much output space is provided, deflate() may have to be called several times until it +has provided the complete compressed stream, even after it has consumed all of the input. The flush +parameter must continue to be Z_FINISH for those subsequent calls. +

    +There are other values of the flush parameter that are used in more advanced applications. You can +force deflate() to produce a burst of output that encodes all of the input data provided +so far, even if it wouldn't have otherwise, for example to control data latency on a link with +compressed data. You can also ask that deflate() do that as well as erase any history up to +that point so that what follows can be decompressed independently, for example for random access +applications. Both requests will degrade compression by an amount depending on how often such +requests are made. +

    +deflate() has a return value that can indicate errors, yet we do not check it here. Why +not? Well, it turns out that deflate() can do no wrong here. Let's go through +deflate()'s return values and dispense with them one by one. The possible values are +Z_OK, Z_STREAM_END, Z_STREAM_ERROR, or Z_BUF_ERROR. Z_OK +is, well, ok. Z_STREAM_END is also ok and will be returned for the last call of +deflate(). This is already guaranteed by calling deflate() with Z_FINISH +until it has no more output. Z_STREAM_ERROR is only possible if the stream is not +initialized properly, but we did initialize it properly. There is no harm in checking for +Z_STREAM_ERROR here, for example to check for the possibility that some +other part of the application inadvertently clobbered the memory containing the zlib state. +Z_BUF_ERROR will be explained further below, but +suffice it to say that this is simply an indication that deflate() could not consume +more input or produce more output. deflate() can be called again with more output space +or more available input, which it will be in this code. +

    
    +            ret = deflate(&strm, flush);    /* no bad return value */
    +            assert(ret != Z_STREAM_ERROR);  /* state not clobbered */
    +
    +Now we compute how much output deflate() provided on the last call, which is the +difference between how much space was provided before the call, and how much output space +is still available after the call. Then that data, if any, is written to the output file. +We can then reuse the output buffer for the next call of deflate(). Again if there +is a file i/o error, we call deflateEnd() before returning to avoid a memory leak. +
    
    +            have = CHUNK - strm.avail_out;
    +            if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
    +                (void)deflateEnd(&strm);
    +                return Z_ERRNO;
    +            }
    +
    +The inner do-loop is repeated until the last deflate() call fails to fill the +provided output buffer. Then we know that deflate() has done as much as it can with +the provided input, and that all of that input has been consumed. We can then fall out of this +loop and reuse the input buffer. +

    +The way we tell that deflate() has no more output is by seeing that it did not fill +the output buffer, leaving avail_out greater than zero. However suppose that +deflate() has no more output, but just so happened to exactly fill the output buffer! +avail_out is zero, and we can't tell that deflate() has done all it can. +As far as we know, deflate() +has more output for us. So we call it again. But now deflate() produces no output +at all, and avail_out remains unchanged as CHUNK. That deflate() call +wasn't able to do anything, either consume input or produce output, and so it returns +Z_BUF_ERROR. (See, I told you I'd cover this later.) However this is not a problem at +all. Now we finally have the desired indication that deflate() is really done, +and so we drop out of the inner loop to provide more input to deflate(). +

    +With flush set to Z_FINISH, this final set of deflate() calls will +complete the output stream. Once that is done, subsequent calls of deflate() would return +Z_STREAM_ERROR if the flush parameter is not Z_FINISH, and do no more processing +until the state is reinitialized. +

    +Some applications of zlib have two loops that call deflate() +instead of the single inner loop we have here. The first loop would call +without flushing and feed all of the data to deflate(). The second loop would call +deflate() with no more +data and the Z_FINISH parameter to complete the process. As you can see from this +example, that can be avoided by simply keeping track of the current flush state. +

    
    +        } while (strm.avail_out == 0);
    +        assert(strm.avail_in == 0);     /* all input will be used */
    +
    +Now we check to see if we have already processed all of the input file. That information was +saved in the flush variable, so we see if that was set to Z_FINISH. If so, +then we're done and we fall out of the outer loop. We're guaranteed to get Z_STREAM_END +from the last deflate() call, since we ran it until the last chunk of input was +consumed and all of the output was generated. +
    
    +        /* done when last data in file processed */
    +    } while (flush != Z_FINISH);
    +    assert(ret == Z_STREAM_END);        /* stream will be complete */
    +
    +The process is complete, but we still need to deallocate the state to avoid a memory leak +(or rather more like a memory hemorrhage if you didn't do this). Then +finally we can return with a happy return value. +
    
    +    /* clean up and return */
    +    (void)deflateEnd(&strm);
    +    return Z_OK;
    +}
    +
    +Now we do the same thing for decompression in the inf() routine. inf() +decompresses what is hopefully a valid zlib stream from the input file and writes the +uncompressed data to the output file. Much of the discussion above for def() +applies to inf() as well, so the discussion here will focus on the differences between +the two. +
    
    +/* Decompress from file source to file dest until stream ends or EOF.
    +   inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be
    +   allocated for processing, Z_DATA_ERROR if the deflate data is
    +   invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and
    +   the version of the library linked do not match, or Z_ERRNO if there
    +   is an error reading or writing the files. */
    +int inf(FILE *source, FILE *dest)
    +{
    +
    +The local variables have the same functionality as they do for def(). The +only difference is that there is no flush variable, since inflate() +can tell from the zlib stream itself when the stream is complete. +
    
    +    int ret;
    +    unsigned have;
    +    z_stream strm;
    +    unsigned char in[CHUNK];
    +    unsigned char out[CHUNK];
    +
    +The initialization of the state is the same, except that there is no compression level, +of course, and two more elements of the structure are initialized. avail_in +and next_in must be initialized before calling inflateInit(). This +is because the application has the option to provide the start of the zlib stream in +order for inflateInit() to have access to information about the compression +method to aid in memory allocation. In the current implementation of zlib +(up through versions 1.2.x), the method-dependent memory allocations are deferred to the first call of +inflate() anyway. However those fields must be initialized since later versions +of zlib that provide more compression methods may take advantage of this interface. +In any case, no decompression is performed by inflateInit(), so the +avail_out and next_out fields do not need to be initialized before calling. +

    +Here avail_in is set to zero and next_in is set to Z_NULL to +indicate that no input data is being provided. +

    
    +    /* allocate inflate state */
    +    strm.zalloc = Z_NULL;
    +    strm.zfree = Z_NULL;
    +    strm.opaque = Z_NULL;
    +    strm.avail_in = 0;
    +    strm.next_in = Z_NULL;
    +    ret = inflateInit(&strm);
    +    if (ret != Z_OK)
    +        return ret;
    +
    +The outer do-loop decompresses input until inflate() indicates +that it has reached the end of the compressed data and has produced all of the uncompressed +output. This is in contrast to def() which processes all of the input file. +If end-of-file is reached before the compressed data self-terminates, then the compressed +data is incomplete and an error is returned. +
    
    +    /* decompress until deflate stream ends or end of file */
    +    do {
    +
    +We read input data and set the strm structure accordingly. If we've reached the +end of the input file, then we leave the outer loop and report an error, since the +compressed data is incomplete. Note that we may read more data than is eventually consumed +by inflate(), if the input file continues past the zlib stream. +For applications where zlib streams are embedded in other data, this routine would +need to be modified to return the unused data, or at least indicate how much of the input +data was not used, so the application would know where to pick up after the zlib stream. +
    
    +        strm.avail_in = fread(in, 1, CHUNK, source);
    +        if (ferror(source)) {
    +            (void)inflateEnd(&strm);
    +            return Z_ERRNO;
    +        }
    +        if (strm.avail_in == 0)
    +            break;
    +        strm.next_in = in;
    +
    +The inner do-loop has the same function it did in def(), which is to +keep calling inflate() until has generated all of the output it can with the +provided input. +
    
    +        /* run inflate() on input until output buffer not full */
    +        do {
    +
    +Just like in def(), the same output space is provided for each call of inflate(). +
    
    +            strm.avail_out = CHUNK;
    +            strm.next_out = out;
    +
    +Now we run the decompression engine itself. There is no need to adjust the flush parameter, since +the zlib format is self-terminating. The main difference here is that there are +return values that we need to pay attention to. Z_DATA_ERROR +indicates that inflate() detected an error in the zlib compressed data format, +which means that either the data is not a zlib stream to begin with, or that the data was +corrupted somewhere along the way since it was compressed. The other error to be processed is +Z_MEM_ERROR, which can occur since memory allocation is deferred until inflate() +needs it, unlike deflate(), whose memory is allocated at the start by deflateInit(). +

    +Advanced applications may use +deflateSetDictionary() to prime deflate() with a set of likely data to improve the +first 32K or so of compression. This is noted in the zlib header, so inflate() +requests that that dictionary be provided before it can start to decompress. Without the dictionary, +correct decompression is not possible. For this routine, we have no idea what the dictionary is, +so the Z_NEED_DICT indication is converted to a Z_DATA_ERROR. +

    +inflate() can also return Z_STREAM_ERROR, which should not be possible here, +but could be checked for as noted above for def(). Z_BUF_ERROR does not need to be +checked for here, for the same reasons noted for def(). Z_STREAM_END will be +checked for later. +

    
    +            ret = inflate(&strm, Z_NO_FLUSH);
    +            assert(ret != Z_STREAM_ERROR);  /* state not clobbered */
    +            switch (ret) {
    +            case Z_NEED_DICT:
    +                ret = Z_DATA_ERROR;     /* and fall through */
    +            case Z_DATA_ERROR:
    +            case Z_MEM_ERROR:
    +                (void)inflateEnd(&strm);
    +                return ret;
    +            }
    +
    +The output of inflate() is handled identically to that of deflate(). +
    
    +            have = CHUNK - strm.avail_out;
    +            if (fwrite(out, 1, have, dest) != have || ferror(dest)) {
    +                (void)inflateEnd(&strm);
    +                return Z_ERRNO;
    +            }
    +
    +The inner do-loop ends when inflate() has no more output as indicated +by not filling the output buffer, just as for deflate(). In this case, we cannot +assert that strm.avail_in will be zero, since the deflate stream may end before the file +does. +
    
    +        } while (strm.avail_out == 0);
    +
    +The outer do-loop ends when inflate() reports that it has reached the +end of the input zlib stream, has completed the decompression and integrity +check, and has provided all of the output. This is indicated by the inflate() +return value Z_STREAM_END. The inner loop is guaranteed to leave ret +equal to Z_STREAM_END if the last chunk of the input file read contained the end +of the zlib stream. So if the return value is not Z_STREAM_END, the +loop continues to read more input. +
    
    +        /* done when inflate() says it's done */
    +    } while (ret != Z_STREAM_END);
    +
    +At this point, decompression successfully completed, or we broke out of the loop due to no +more data being available from the input file. If the last inflate() return value +is not Z_STREAM_END, then the zlib stream was incomplete and a data error +is returned. Otherwise, we return with a happy return value. Of course, inflateEnd() +is called first to avoid a memory leak. +
    
    +    /* clean up and return */
    +    (void)inflateEnd(&strm);
    +    return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
    +}
    +
    +That ends the routines that directly use zlib. The following routines make this +a command-line program by running data through the above routines from stdin to +stdout, and handling any errors reported by def() or inf(). +

    +zerr() is used to interpret the possible error codes from def() +and inf(), as detailed in their comments above, and print out an error message. +Note that these are only a subset of the possible return values from deflate() +and inflate(). +

    
    +/* report a zlib or i/o error */
    +void zerr(int ret)
    +{
    +    fputs("zpipe: ", stderr);
    +    switch (ret) {
    +    case Z_ERRNO:
    +        if (ferror(stdin))
    +            fputs("error reading stdin\n", stderr);
    +        if (ferror(stdout))
    +            fputs("error writing stdout\n", stderr);
    +        break;
    +    case Z_STREAM_ERROR:
    +        fputs("invalid compression level\n", stderr);
    +        break;
    +    case Z_DATA_ERROR:
    +        fputs("invalid or incomplete deflate data\n", stderr);
    +        break;
    +    case Z_MEM_ERROR:
    +        fputs("out of memory\n", stderr);
    +        break;
    +    case Z_VERSION_ERROR:
    +        fputs("zlib version mismatch!\n", stderr);
    +    }
    +}
    +
    +Here is the main() routine used to test def() and inf(). The +zpipe command is simply a compression pipe from stdin to stdout, if +no arguments are given, or it is a decompression pipe if zpipe -d is used. If any other +arguments are provided, no compression or decompression is performed. Instead a usage +message is displayed. Examples are zpipe < foo.txt > foo.txt.z to compress, and +zpipe -d < foo.txt.z > foo.txt to decompress. +
    
    +/* compress or decompress from stdin to stdout */
    +int main(int argc, char **argv)
    +{
    +    int ret;
    +
    +    /* avoid end-of-line conversions */
    +    SET_BINARY_MODE(stdin);
    +    SET_BINARY_MODE(stdout);
    +
    +    /* do compression if no arguments */
    +    if (argc == 1) {
    +        ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION);
    +        if (ret != Z_OK)
    +            zerr(ret);
    +        return ret;
    +    }
    +
    +    /* do decompression if -d specified */
    +    else if (argc == 2 && strcmp(argv[1], "-d") == 0) {
    +        ret = inf(stdin, stdout);
    +        if (ret != Z_OK)
    +            zerr(ret);
    +        return ret;
    +    }
    +
    +    /* otherwise, report usage */
    +    else {
    +        fputs("zpipe usage: zpipe [-d] < source > dest\n", stderr);
    +        return 1;
    +    }
    +}
    +
    +
    +Copyright (c) 2004, 2005 by Mark Adler
    Last modified 11 December 2005
    + + diff --git a/thirdparty/zlib/zlib-1.2.7/examples/zpipe.c b/thirdparty/zlib/zlib-1.2.7/examples/zpipe.c new file mode 100644 index 0000000..83535d1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/zpipe.c @@ -0,0 +1,205 @@ +/* zpipe.c: example of proper use of zlib's inflate() and deflate() + Not copyrighted -- provided to the public domain + Version 1.4 11 December 2005 Mark Adler */ + +/* Version history: + 1.0 30 Oct 2004 First version + 1.1 8 Nov 2004 Add void casting for unused return values + Use switch statement for inflate() return values + 1.2 9 Nov 2004 Add assertions to document zlib guarantees + 1.3 6 Apr 2005 Remove incorrect assertion in inf() + 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions + Avoid some compiler warnings for input and output buffers + */ + +#include +#include +#include +#include "zlib.h" + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) +# include +# include +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +#define CHUNK 16384 + +/* Compress from file source to file dest until EOF on source. + def() returns Z_OK on success, Z_MEM_ERROR if memory could not be + allocated for processing, Z_STREAM_ERROR if an invalid compression + level is supplied, Z_VERSION_ERROR if the version of zlib.h and the + version of the library linked do not match, or Z_ERRNO if there is + an error reading or writing the files. */ +int def(FILE *source, FILE *dest, int level) +{ + int ret, flush; + unsigned have; + z_stream strm; + unsigned char in[CHUNK]; + unsigned char out[CHUNK]; + + /* allocate deflate state */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + ret = deflateInit(&strm, level); + if (ret != Z_OK) + return ret; + + /* compress until end of file */ + do { + strm.avail_in = fread(in, 1, CHUNK, source); + if (ferror(source)) { + (void)deflateEnd(&strm); + return Z_ERRNO; + } + flush = feof(source) ? Z_FINISH : Z_NO_FLUSH; + strm.next_in = in; + + /* run deflate() on input until output buffer not full, finish + compression if all of source has been read in */ + do { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = deflate(&strm, flush); /* no bad return value */ + assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + have = CHUNK - strm.avail_out; + if (fwrite(out, 1, have, dest) != have || ferror(dest)) { + (void)deflateEnd(&strm); + return Z_ERRNO; + } + } while (strm.avail_out == 0); + assert(strm.avail_in == 0); /* all input will be used */ + + /* done when last data in file processed */ + } while (flush != Z_FINISH); + assert(ret == Z_STREAM_END); /* stream will be complete */ + + /* clean up and return */ + (void)deflateEnd(&strm); + return Z_OK; +} + +/* Decompress from file source to file dest until stream ends or EOF. + inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be + allocated for processing, Z_DATA_ERROR if the deflate data is + invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and + the version of the library linked do not match, or Z_ERRNO if there + is an error reading or writing the files. */ +int inf(FILE *source, FILE *dest) +{ + int ret; + unsigned have; + z_stream strm; + unsigned char in[CHUNK]; + unsigned char out[CHUNK]; + + /* allocate inflate state */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); + if (ret != Z_OK) + return ret; + + /* decompress until deflate stream ends or end of file */ + do { + strm.avail_in = fread(in, 1, CHUNK, source); + if (ferror(source)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + if (strm.avail_in == 0) + break; + strm.next_in = in; + + /* run inflate() on input until output buffer not full */ + do { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; /* and fall through */ + case Z_DATA_ERROR: + case Z_MEM_ERROR: + (void)inflateEnd(&strm); + return ret; + } + have = CHUNK - strm.avail_out; + if (fwrite(out, 1, have, dest) != have || ferror(dest)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + } while (strm.avail_out == 0); + + /* done when inflate() says it's done */ + } while (ret != Z_STREAM_END); + + /* clean up and return */ + (void)inflateEnd(&strm); + return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; +} + +/* report a zlib or i/o error */ +void zerr(int ret) +{ + fputs("zpipe: ", stderr); + switch (ret) { + case Z_ERRNO: + if (ferror(stdin)) + fputs("error reading stdin\n", stderr); + if (ferror(stdout)) + fputs("error writing stdout\n", stderr); + break; + case Z_STREAM_ERROR: + fputs("invalid compression level\n", stderr); + break; + case Z_DATA_ERROR: + fputs("invalid or incomplete deflate data\n", stderr); + break; + case Z_MEM_ERROR: + fputs("out of memory\n", stderr); + break; + case Z_VERSION_ERROR: + fputs("zlib version mismatch!\n", stderr); + } +} + +/* compress or decompress from stdin to stdout */ +int main(int argc, char **argv) +{ + int ret; + + /* avoid end-of-line conversions */ + SET_BINARY_MODE(stdin); + SET_BINARY_MODE(stdout); + + /* do compression if no arguments */ + if (argc == 1) { + ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION); + if (ret != Z_OK) + zerr(ret); + return ret; + } + + /* do decompression if -d specified */ + else if (argc == 2 && strcmp(argv[1], "-d") == 0) { + ret = inf(stdin, stdout); + if (ret != Z_OK) + zerr(ret); + return ret; + } + + /* otherwise, report usage */ + else { + fputs("zpipe usage: zpipe [-d] < source > dest\n", stderr); + return 1; + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/examples/zran.c b/thirdparty/zlib/zlib-1.2.7/examples/zran.c new file mode 100644 index 0000000..617a130 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/examples/zran.c @@ -0,0 +1,404 @@ +/* zran.c -- example of zlib/gzip stream indexing and random access + * Copyright (C) 2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + Version 1.0 29 May 2005 Mark Adler */ + +/* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary() + for random access of a compressed file. A file containing a zlib or gzip + stream is provided on the command line. The compressed stream is decoded in + its entirety, and an index built with access points about every SPAN bytes + in the uncompressed output. The compressed file is left open, and can then + be read randomly, having to decompress on the average SPAN/2 uncompressed + bytes before getting to the desired block of data. + + An access point can be created at the start of any deflate block, by saving + the starting file offset and bit of that block, and the 32K bytes of + uncompressed data that precede that block. Also the uncompressed offset of + that block is saved to provide a referece for locating a desired starting + point in the uncompressed stream. build_index() works by decompressing the + input zlib or gzip stream a block at a time, and at the end of each block + deciding if enough uncompressed data has gone by to justify the creation of + a new access point. If so, that point is saved in a data structure that + grows as needed to accommodate the points. + + To use the index, an offset in the uncompressed data is provided, for which + the latest accees point at or preceding that offset is located in the index. + The input file is positioned to the specified location in the index, and if + necessary the first few bits of the compressed data is read from the file. + inflate is initialized with those bits and the 32K of uncompressed data, and + the decompression then proceeds until the desired offset in the file is + reached. Then the decompression continues to read the desired uncompressed + data from the file. + + Another approach would be to generate the index on demand. In that case, + requests for random access reads from the compressed data would try to use + the index, but if a read far enough past the end of the index is required, + then further index entries would be generated and added. + + There is some fair bit of overhead to starting inflation for the random + access, mainly copying the 32K byte dictionary. So if small pieces of the + file are being accessed, it would make sense to implement a cache to hold + some lookahead and avoid many calls to extract() for small lengths. + + Another way to build an index would be to use inflateCopy(). That would + not be constrained to have access points at block boundaries, but requires + more memory per access point, and also cannot be saved to file due to the + use of pointers in the state. The approach here allows for storage of the + index in a file. + */ + +#include +#include +#include +#include "zlib.h" + +#define local static + +#define SPAN 1048576L /* desired distance between access points */ +#define WINSIZE 32768U /* sliding window size */ +#define CHUNK 16384 /* file input buffer size */ + +/* access point entry */ +struct point { + off_t out; /* corresponding offset in uncompressed data */ + off_t in; /* offset in input file of first full byte */ + int bits; /* number of bits (1-7) from byte at in - 1, or 0 */ + unsigned char window[WINSIZE]; /* preceding 32K of uncompressed data */ +}; + +/* access point list */ +struct access { + int have; /* number of list entries filled in */ + int size; /* number of list entries allocated */ + struct point *list; /* allocated list */ +}; + +/* Deallocate an index built by build_index() */ +local void free_index(struct access *index) +{ + if (index != NULL) { + free(index->list); + free(index); + } +} + +/* Add an entry to the access point list. If out of memory, deallocate the + existing list and return NULL. */ +local struct access *addpoint(struct access *index, int bits, + off_t in, off_t out, unsigned left, unsigned char *window) +{ + struct point *next; + + /* if list is empty, create it (start with eight points) */ + if (index == NULL) { + index = malloc(sizeof(struct access)); + if (index == NULL) return NULL; + index->list = malloc(sizeof(struct point) << 3); + if (index->list == NULL) { + free(index); + return NULL; + } + index->size = 8; + index->have = 0; + } + + /* if list is full, make it bigger */ + else if (index->have == index->size) { + index->size <<= 1; + next = realloc(index->list, sizeof(struct point) * index->size); + if (next == NULL) { + free_index(index); + return NULL; + } + index->list = next; + } + + /* fill in entry and increment how many we have */ + next = index->list + index->have; + next->bits = bits; + next->in = in; + next->out = out; + if (left) + memcpy(next->window, window + WINSIZE - left, left); + if (left < WINSIZE) + memcpy(next->window + left, window, WINSIZE - left); + index->have++; + + /* return list, possibly reallocated */ + return index; +} + +/* Make one entire pass through the compressed stream and build an index, with + access points about every span bytes of uncompressed output -- span is + chosen to balance the speed of random access against the memory requirements + of the list, about 32K bytes per access point. Note that data after the end + of the first zlib or gzip stream in the file is ignored. build_index() + returns the number of access points on success (>= 1), Z_MEM_ERROR for out + of memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a + file read error. On success, *built points to the resulting index. */ +local int build_index(FILE *in, off_t span, struct access **built) +{ + int ret; + off_t totin, totout; /* our own total counters to avoid 4GB limit */ + off_t last; /* totout value of last access point */ + struct access *index; /* access points being generated */ + z_stream strm; + unsigned char input[CHUNK]; + unsigned char window[WINSIZE]; + + /* initialize inflate */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, 47); /* automatic zlib or gzip decoding */ + if (ret != Z_OK) + return ret; + + /* inflate the input, maintain a sliding window, and build an index -- this + also validates the integrity of the compressed data using the check + information at the end of the gzip or zlib stream */ + totin = totout = last = 0; + index = NULL; /* will be allocated by first addpoint() */ + strm.avail_out = 0; + do { + /* get some compressed data from input file */ + strm.avail_in = fread(input, 1, CHUNK, in); + if (ferror(in)) { + ret = Z_ERRNO; + goto build_index_error; + } + if (strm.avail_in == 0) { + ret = Z_DATA_ERROR; + goto build_index_error; + } + strm.next_in = input; + + /* process all of that, or until end of stream */ + do { + /* reset sliding window if necessary */ + if (strm.avail_out == 0) { + strm.avail_out = WINSIZE; + strm.next_out = window; + } + + /* inflate until out of input, output, or at end of block -- + update the total input and output counters */ + totin += strm.avail_in; + totout += strm.avail_out; + ret = inflate(&strm, Z_BLOCK); /* return at end of block */ + totin -= strm.avail_in; + totout -= strm.avail_out; + if (ret == Z_NEED_DICT) + ret = Z_DATA_ERROR; + if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) + goto build_index_error; + if (ret == Z_STREAM_END) + break; + + /* if at end of block, consider adding an index entry (note that if + data_type indicates an end-of-block, then all of the + uncompressed data from that block has been delivered, and none + of the compressed data after that block has been consumed, + except for up to seven bits) -- the totout == 0 provides an + entry point after the zlib or gzip header, and assures that the + index always has at least one access point; we avoid creating an + access point after the last block by checking bit 6 of data_type + */ + if ((strm.data_type & 128) && !(strm.data_type & 64) && + (totout == 0 || totout - last > span)) { + index = addpoint(index, strm.data_type & 7, totin, + totout, strm.avail_out, window); + if (index == NULL) { + ret = Z_MEM_ERROR; + goto build_index_error; + } + last = totout; + } + } while (strm.avail_in != 0); + } while (ret != Z_STREAM_END); + + /* clean up and return index (release unused entries in list) */ + (void)inflateEnd(&strm); + index = realloc(index, sizeof(struct point) * index->have); + index->size = index->have; + *built = index; + return index->size; + + /* return error */ + build_index_error: + (void)inflateEnd(&strm); + if (index != NULL) + free_index(index); + return ret; +} + +/* Use the index to read len bytes from offset into buf, return bytes read or + negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past + the end of the uncompressed data, then extract() will return a value less + than len, indicating how much as actually read into buf. This function + should not return a data error unless the file was modified since the index + was generated. extract() may also return Z_ERRNO if there is an error on + reading or seeking the input file. */ +local int extract(FILE *in, struct access *index, off_t offset, + unsigned char *buf, int len) +{ + int ret, skip; + z_stream strm; + struct point *here; + unsigned char input[CHUNK]; + unsigned char discard[WINSIZE]; + + /* proceed only if something reasonable to do */ + if (len < 0) + return 0; + + /* find where in stream to start */ + here = index->list; + ret = index->have; + while (--ret && here[1].out <= offset) + here++; + + /* initialize file and inflate state to start there */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, -15); /* raw inflate */ + if (ret != Z_OK) + return ret; + ret = fseeko(in, here->in - (here->bits ? 1 : 0), SEEK_SET); + if (ret == -1) + goto extract_ret; + if (here->bits) { + ret = getc(in); + if (ret == -1) { + ret = ferror(in) ? Z_ERRNO : Z_DATA_ERROR; + goto extract_ret; + } + (void)inflatePrime(&strm, here->bits, ret >> (8 - here->bits)); + } + (void)inflateSetDictionary(&strm, here->window, WINSIZE); + + /* skip uncompressed bytes until offset reached, then satisfy request */ + offset -= here->out; + strm.avail_in = 0; + skip = 1; /* while skipping to offset */ + do { + /* define where to put uncompressed data, and how much */ + if (offset == 0 && skip) { /* at offset now */ + strm.avail_out = len; + strm.next_out = buf; + skip = 0; /* only do this once */ + } + if (offset > WINSIZE) { /* skip WINSIZE bytes */ + strm.avail_out = WINSIZE; + strm.next_out = discard; + offset -= WINSIZE; + } + else if (offset != 0) { /* last skip */ + strm.avail_out = (unsigned)offset; + strm.next_out = discard; + offset = 0; + } + + /* uncompress until avail_out filled, or end of stream */ + do { + if (strm.avail_in == 0) { + strm.avail_in = fread(input, 1, CHUNK, in); + if (ferror(in)) { + ret = Z_ERRNO; + goto extract_ret; + } + if (strm.avail_in == 0) { + ret = Z_DATA_ERROR; + goto extract_ret; + } + strm.next_in = input; + } + ret = inflate(&strm, Z_NO_FLUSH); /* normal inflate */ + if (ret == Z_NEED_DICT) + ret = Z_DATA_ERROR; + if (ret == Z_MEM_ERROR || ret == Z_DATA_ERROR) + goto extract_ret; + if (ret == Z_STREAM_END) + break; + } while (strm.avail_out != 0); + + /* if reach end of stream, then don't keep trying to get more */ + if (ret == Z_STREAM_END) + break; + + /* do until offset reached and requested data read, or stream ends */ + } while (skip); + + /* compute number of uncompressed bytes read after offset */ + ret = skip ? 0 : len - strm.avail_out; + + /* clean up and return bytes read or error */ + extract_ret: + (void)inflateEnd(&strm); + return ret; +} + +/* Demonstrate the use of build_index() and extract() by processing the file + provided on the command line, and the extracting 16K from about 2/3rds of + the way through the uncompressed output, and writing that to stdout. */ +int main(int argc, char **argv) +{ + int len; + off_t offset; + FILE *in; + struct access *index = NULL; + unsigned char buf[CHUNK]; + + /* open input file */ + if (argc != 2) { + fprintf(stderr, "usage: zran file.gz\n"); + return 1; + } + in = fopen(argv[1], "rb"); + if (in == NULL) { + fprintf(stderr, "zran: could not open %s for reading\n", argv[1]); + return 1; + } + + /* build index */ + len = build_index(in, SPAN, &index); + if (len < 0) { + fclose(in); + switch (len) { + case Z_MEM_ERROR: + fprintf(stderr, "zran: out of memory\n"); + break; + case Z_DATA_ERROR: + fprintf(stderr, "zran: compressed data error in %s\n", argv[1]); + break; + case Z_ERRNO: + fprintf(stderr, "zran: read error on %s\n", argv[1]); + break; + default: + fprintf(stderr, "zran: error %d while building index\n", len); + } + return 1; + } + fprintf(stderr, "zran: built index with %d access points\n", len); + + /* use index by reading some bytes from an arbitrary offset */ + offset = (index->list[index->have - 1].out << 1) / 3; + len = extract(in, index, offset, buf, CHUNK); + if (len < 0) + fprintf(stderr, "zran: extraction failed: %s error\n", + len == Z_MEM_ERROR ? "out of memory" : "input corrupted"); + else { + fwrite(buf, 1, len, stdout); + fprintf(stderr, "zran: extracted %d bytes at %llu\n", len, offset); + } + + /* clean up and exit */ + free_index(index); + fclose(in); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/gzclose.c b/thirdparty/zlib/zlib-1.2.7/gzclose.c new file mode 100644 index 0000000..caeb99a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/gzclose.c @@ -0,0 +1,25 @@ +/* gzclose.c -- zlib gzclose() function + * Copyright (C) 2004, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* gzclose() is in a separate file so that it is linked in only if it is used. + That way the other gzclose functions can be used instead to avoid linking in + unneeded compression or decompression routines. */ +int ZEXPORT gzclose(file) + gzFile file; +{ +#ifndef NO_GZCOMPRESS + gz_statep state; + + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); +#else + return gzclose_r(file); +#endif +} diff --git a/thirdparty/zlib/zlib-1.2.7/gzguts.h b/thirdparty/zlib/zlib-1.2.7/gzguts.h new file mode 100644 index 0000000..ee3f281 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/gzguts.h @@ -0,0 +1,193 @@ +/* gzguts.h -- zlib internal header definitions for gz* operations + * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#ifdef _LARGEFILE64_SOURCE +# ifndef _LARGEFILE_SOURCE +# define _LARGEFILE_SOURCE 1 +# endif +# ifdef _FILE_OFFSET_BITS +# undef _FILE_OFFSET_BITS +# endif +#endif + +#ifdef HAVE_HIDDEN +# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +#else +# define ZLIB_INTERNAL +#endif + +#include +#include "zlib.h" +#ifdef STDC +# include +# include +# include +#endif +#include + +#ifdef _WIN32 +# include +#endif + +#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) +# include +#endif + +#ifdef NO_DEFLATE /* for compatibility with old definition */ +# define NO_GZCOMPRESS +#endif + +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#if defined(__CYGWIN__) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#ifndef HAVE_VSNPRINTF +# ifdef MSDOS +/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), + but for now we just assume it doesn't. */ +# define NO_vsnprintf +# endif +# ifdef __TURBOC__ +# define NO_vsnprintf +# endif +# ifdef WIN32 +/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ +# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) +# define vsnprintf _vsnprintf +# endif +# endif +# endif +# ifdef __SASC +# define NO_vsnprintf +# endif +# ifdef VMS +# define NO_vsnprintf +# endif +# ifdef __OS400__ +# define NO_vsnprintf +# endif +# ifdef __MVS__ +# define NO_vsnprintf +# endif +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +/* gz* functions always use library allocation functions */ +#ifndef STDC + extern voidp malloc OF((uInt size)); + extern void free OF((voidpf ptr)); +#endif + +/* get errno and strerror definition */ +#if defined UNDER_CE +# include +# define zstrerror() gz_strwinerror((DWORD)GetLastError()) +#else +# ifndef NO_STRERROR +# include +# define zstrerror() strerror(errno) +# else +# define zstrerror() "stdio error (consult errno)" +# endif +#endif + +/* provide prototypes for these when building zlib without LFS */ +#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); +#endif + +/* default memLevel */ +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif + +/* default i/o buffer size -- double this for output when reading */ +#define GZBUFSIZE 8192 + +/* gzip modes, also provide a little integrity check on the passed structure */ +#define GZ_NONE 0 +#define GZ_READ 7247 +#define GZ_WRITE 31153 +#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ + +/* values for gz_state how */ +#define LOOK 0 /* look for a gzip header */ +#define COPY 1 /* copy input directly */ +#define GZIP 2 /* decompress a gzip stream */ + +/* internal gzip file state data structure */ +typedef struct { + /* exposed contents for gzgetc() macro */ + struct gzFile_s x; /* "x" for exposed */ + /* x.have: number of bytes available at x.next */ + /* x.next: next output data to deliver or write */ + /* x.pos: current position in uncompressed data */ + /* used for both reading and writing */ + int mode; /* see gzip modes above */ + int fd; /* file descriptor */ + char *path; /* path or fd for error messages */ + unsigned size; /* buffer size, zero if not allocated yet */ + unsigned want; /* requested buffer size, default is GZBUFSIZE */ + unsigned char *in; /* input buffer */ + unsigned char *out; /* output buffer (double-sized when reading) */ + int direct; /* 0 if processing gzip, 1 if transparent */ + /* just for reading */ + int how; /* 0: get header, 1: copy, 2: decompress */ + z_off64_t start; /* where the gzip data started, for rewinding */ + int eof; /* true if end of input file reached */ + int past; /* true if read requested past end */ + /* just for writing */ + int level; /* compression level */ + int strategy; /* compression strategy */ + /* seek request */ + z_off64_t skip; /* amount to skip (already rewound if backwards) */ + int seek; /* true if seek request pending */ + /* error information */ + int err; /* error code */ + char *msg; /* error message */ + /* zlib inflate or deflate stream */ + z_stream strm; /* stream structure in-place (not a pointer) */ +} gz_state; +typedef gz_state FAR *gz_statep; + +/* shared functions */ +void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); +#if defined UNDER_CE +char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +#endif + +/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t + value -- needed when comparing unsigned to z_off64_t, which is signed + (possible z_off64_t types off_t, off64_t, and long are all signed) */ +#ifdef INT_MAX +# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) +#else +unsigned ZLIB_INTERNAL gz_intmax OF((void)); +# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/gzlib.c b/thirdparty/zlib/zlib-1.2.7/gzlib.c new file mode 100644 index 0000000..ca55c6e --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/gzlib.c @@ -0,0 +1,620 @@ +/* gzlib.c -- zlib functions common to reading and writing gzip files + * Copyright (C) 2004, 2010, 2011, 2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +#if defined(_WIN32) && !defined(__BORLANDC__) +# define LSEEK _lseeki64 +#else +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 +# define LSEEK lseek64 +#else +# define LSEEK lseek +#endif +#endif + +/* Local functions */ +local void gz_reset OF((gz_statep)); +local gzFile gz_open OF((const void *, int, const char *)); + +#if defined UNDER_CE + +/* Map the Windows error number in ERROR to a locale-dependent error message + string and return a pointer to it. Typically, the values for ERROR come + from GetLastError. + + The string pointed to shall not be modified by the application, but may be + overwritten by a subsequent call to gz_strwinerror + + The gz_strwinerror function does not change the current setting of + GetLastError. */ +char ZLIB_INTERNAL *gz_strwinerror (error) + DWORD error; +{ + static char buf[1024]; + + wchar_t *msgbuf; + DWORD lasterr = GetLastError(); + DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, + error, + 0, /* Default language */ + (LPVOID)&msgbuf, + 0, + NULL); + if (chars != 0) { + /* If there is an \r\n appended, zap it. */ + if (chars >= 2 + && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { + chars -= 2; + msgbuf[chars] = 0; + } + + if (chars > sizeof (buf) - 1) { + chars = sizeof (buf) - 1; + msgbuf[chars] = 0; + } + + wcstombs(buf, msgbuf, chars + 1); + LocalFree(msgbuf); + } + else { + sprintf(buf, "unknown win32 error (%ld)", error); + } + + SetLastError(lasterr); + return buf; +} + +#endif /* UNDER_CE */ + +/* Reset gzip file state */ +local void gz_reset(state) + gz_statep state; +{ + state->x.have = 0; /* no output data available */ + if (state->mode == GZ_READ) { /* for reading ... */ + state->eof = 0; /* not at end of file */ + state->past = 0; /* have not read past end yet */ + state->how = LOOK; /* look for gzip header */ + } + state->seek = 0; /* no seek request pending */ + gz_error(state, Z_OK, NULL); /* clear error */ + state->x.pos = 0; /* no uncompressed data yet */ + state->strm.avail_in = 0; /* no input data yet */ +} + +/* Open a gzip file either by name or file descriptor. */ +local gzFile gz_open(path, fd, mode) + const void *path; + int fd; + const char *mode; +{ + gz_statep state; + size_t len; + int oflag; +#ifdef O_CLOEXEC + int cloexec = 0; +#endif +#ifdef O_EXCL + int exclusive = 0; +#endif + + /* check input */ + if (path == NULL) + return NULL; + + /* allocate gzFile structure to return */ + state = malloc(sizeof(gz_state)); + if (state == NULL) + return NULL; + state->size = 0; /* no buffers allocated yet */ + state->want = GZBUFSIZE; /* requested buffer size */ + state->msg = NULL; /* no error message yet */ + + /* interpret mode */ + state->mode = GZ_NONE; + state->level = Z_DEFAULT_COMPRESSION; + state->strategy = Z_DEFAULT_STRATEGY; + state->direct = 0; + while (*mode) { + if (*mode >= '0' && *mode <= '9') + state->level = *mode - '0'; + else + switch (*mode) { + case 'r': + state->mode = GZ_READ; + break; +#ifndef NO_GZCOMPRESS + case 'w': + state->mode = GZ_WRITE; + break; + case 'a': + state->mode = GZ_APPEND; + break; +#endif + case '+': /* can't read and write at the same time */ + free(state); + return NULL; + case 'b': /* ignore -- will request binary anyway */ + break; +#ifdef O_CLOEXEC + case 'e': + cloexec = 1; + break; +#endif +#ifdef O_EXCL + case 'x': + exclusive = 1; + break; +#endif + case 'f': + state->strategy = Z_FILTERED; + break; + case 'h': + state->strategy = Z_HUFFMAN_ONLY; + break; + case 'R': + state->strategy = Z_RLE; + break; + case 'F': + state->strategy = Z_FIXED; + case 'T': + state->direct = 1; + default: /* could consider as an error, but just ignore */ + ; + } + mode++; + } + + /* must provide an "r", "w", or "a" */ + if (state->mode == GZ_NONE) { + free(state); + return NULL; + } + + /* can't force transparent read */ + if (state->mode == GZ_READ) { + if (state->direct) { + free(state); + return NULL; + } + state->direct = 1; /* for empty file */ + } + + /* save the path name for error messages */ +#ifdef _WIN32 + if (fd == -2) { + len = wcstombs(NULL, path, 0); + if (len == (size_t)-1) + len = 0; + } + else +#endif + len = strlen(path); + state->path = malloc(len + 1); + if (state->path == NULL) { + free(state); + return NULL; + } +#ifdef _WIN32 + if (fd == -2) + if (len) + wcstombs(state->path, path, len + 1); + else + *(state->path) = 0; + else +#endif + strcpy(state->path, path); + + /* compute the flags for open() */ + oflag = +#ifdef O_LARGEFILE + O_LARGEFILE | +#endif +#ifdef O_BINARY + O_BINARY | +#endif +#ifdef O_CLOEXEC + (cloexec ? O_CLOEXEC : 0) | +#endif + (state->mode == GZ_READ ? + O_RDONLY : + (O_WRONLY | O_CREAT | +#ifdef O_EXCL + (exclusive ? O_EXCL : 0) | +#endif + (state->mode == GZ_WRITE ? + O_TRUNC : + O_APPEND))); + + /* open the file with the appropriate flags (or just use fd) */ + state->fd = fd > -1 ? fd : ( +#ifdef _WIN32 + fd == -2 ? _wopen(path, oflag, 0666) : +#endif + open(path, oflag, 0666)); + if (state->fd == -1) { + free(state->path); + free(state); + return NULL; + } + if (state->mode == GZ_APPEND) + state->mode = GZ_WRITE; /* simplify later checks */ + + /* save the current position for rewinding (only if reading) */ + if (state->mode == GZ_READ) { + state->start = LSEEK(state->fd, 0, SEEK_CUR); + if (state->start == -1) state->start = 0; + } + + /* initialize stream */ + gz_reset(state); + + /* return stream */ + return (gzFile)state; +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzopen(path, mode) + const char *path; + const char *mode; +{ + return gz_open(path, -1, mode); +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzopen64(path, mode) + const char *path; + const char *mode; +{ + return gz_open(path, -1, mode); +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzdopen(fd, mode) + int fd; + const char *mode; +{ + char *path; /* identifier for error messages */ + gzFile gz; + + if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL) + return NULL; + sprintf(path, "", fd); /* for debugging */ + gz = gz_open(path, fd, mode); + free(path); + return gz; +} + +/* -- see zlib.h -- */ +#ifdef _WIN32 +gzFile ZEXPORT gzopen_w(path, mode) + const wchar_t *path; + const char *mode; +{ + return gz_open(path, -2, mode); +} +#endif + +/* -- see zlib.h -- */ +int ZEXPORT gzbuffer(file, size) + gzFile file; + unsigned size; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* make sure we haven't already allocated memory */ + if (state->size != 0) + return -1; + + /* check and set requested size */ + if (size < 2) + size = 2; /* need two bytes to check magic header */ + state->want = size; + return 0; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzrewind(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* back up and start over */ + if (LSEEK(state->fd, state->start, SEEK_SET) == -1) + return -1; + gz_reset(state); + return 0; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gzseek64(file, offset, whence) + gzFile file; + z_off64_t offset; + int whence; +{ + unsigned n; + z_off64_t ret; + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* check that there's no error */ + if (state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + + /* can only seek from start or relative to current position */ + if (whence != SEEK_SET && whence != SEEK_CUR) + return -1; + + /* normalize offset to a SEEK_CUR specification */ + if (whence == SEEK_SET) + offset -= state->x.pos; + else if (state->seek) + offset += state->skip; + state->seek = 0; + + /* if within raw area while reading, just go there */ + if (state->mode == GZ_READ && state->how == COPY && + state->x.pos + offset >= 0) { + ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); + if (ret == -1) + return -1; + state->x.have = 0; + state->eof = 0; + state->past = 0; + state->seek = 0; + gz_error(state, Z_OK, NULL); + state->strm.avail_in = 0; + state->x.pos += offset; + return state->x.pos; + } + + /* calculate skip amount, rewinding if needed for back seek when reading */ + if (offset < 0) { + if (state->mode != GZ_READ) /* writing -- can't go backwards */ + return -1; + offset += state->x.pos; + if (offset < 0) /* before start of file! */ + return -1; + if (gzrewind(file) == -1) /* rewind, then skip to offset */ + return -1; + } + + /* if reading, skip what's in output buffer (one less gzgetc() check) */ + if (state->mode == GZ_READ) { + n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ? + (unsigned)offset : state->x.have; + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + offset -= n; + } + + /* request skip (if not zero) */ + if (offset) { + state->seek = 1; + state->skip = offset; + } + return state->x.pos + offset; +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gzseek(file, offset, whence) + gzFile file; + z_off_t offset; + int whence; +{ + z_off64_t ret; + + ret = gzseek64(file, (z_off64_t)offset, whence); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gztell64(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* return position */ + return state->x.pos + (state->seek ? state->skip : 0); +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gztell(file) + gzFile file; +{ + z_off64_t ret; + + ret = gztell64(file); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gzoffset64(file) + gzFile file; +{ + z_off64_t offset; + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* compute and return effective offset in file */ + offset = LSEEK(state->fd, 0, SEEK_CUR); + if (offset == -1) + return -1; + if (state->mode == GZ_READ) /* reading */ + offset -= state->strm.avail_in; /* don't count buffered input */ + return offset; +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gzoffset(file) + gzFile file; +{ + z_off64_t ret; + + ret = gzoffset64(file); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzeof(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return 0; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return 0; + + /* return end-of-file state */ + return state->mode == GZ_READ ? state->past : 0; +} + +/* -- see zlib.h -- */ +const char * ZEXPORT gzerror(file, errnum) + gzFile file; + int *errnum; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return NULL; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return NULL; + + /* return error information */ + if (errnum != NULL) + *errnum = state->err; + return state->msg == NULL ? "" : state->msg; +} + +/* -- see zlib.h -- */ +void ZEXPORT gzclearerr(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return; + + /* clear error and end-of-file */ + if (state->mode == GZ_READ) { + state->eof = 0; + state->past = 0; + } + gz_error(state, Z_OK, NULL); +} + +/* Create an error message in allocated memory and set state->err and + state->msg accordingly. Free any previous error message already there. Do + not try to free or allocate space if the error is Z_MEM_ERROR (out of + memory). Simply save the error message as a static string. If there is an + allocation failure constructing the error message, then convert the error to + out of memory. */ +void ZLIB_INTERNAL gz_error(state, err, msg) + gz_statep state; + int err; + const char *msg; +{ + /* free previously allocated message and clear */ + if (state->msg != NULL) { + if (state->err != Z_MEM_ERROR) + free(state->msg); + state->msg = NULL; + } + + /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */ + if (err != Z_OK && err != Z_BUF_ERROR) + state->x.have = 0; + + /* set error code, and if no message, then done */ + state->err = err; + if (msg == NULL) + return; + + /* for an out of memory error, save as static string */ + if (err == Z_MEM_ERROR) { + state->msg = (char *)msg; + return; + } + + /* construct error message with path */ + if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { + state->err = Z_MEM_ERROR; + state->msg = (char *)"out of memory"; + return; + } + strcpy(state->msg, state->path); + strcat(state->msg, ": "); + strcat(state->msg, msg); + return; +} + +#ifndef INT_MAX +/* portably return maximum value for an int (when limits.h presumed not + available) -- we need to do this to cover cases where 2's complement not + used, since C standard permits 1's complement and sign-bit representations, + otherwise we could just use ((unsigned)-1) >> 1 */ +unsigned ZLIB_INTERNAL gz_intmax() +{ + unsigned p, q; + + p = 1; + do { + q = p; + p <<= 1; + p++; + } while (p > q); + return q >> 1; +} +#endif diff --git a/thirdparty/zlib/zlib-1.2.7/gzread.c b/thirdparty/zlib/zlib-1.2.7/gzread.c new file mode 100644 index 0000000..3493d34 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/gzread.c @@ -0,0 +1,589 @@ +/* gzread.c -- zlib functions for reading gzip files + * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* Local functions */ +local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); +local int gz_avail OF((gz_statep)); +local int gz_look OF((gz_statep)); +local int gz_decomp OF((gz_statep)); +local int gz_fetch OF((gz_statep)); +local int gz_skip OF((gz_statep, z_off64_t)); + +/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from + state->fd, and update state->eof, state->err, and state->msg as appropriate. + This function needs to loop on read(), since read() is not guaranteed to + read the number of bytes requested, depending on the type of descriptor. */ +local int gz_load(state, buf, len, have) + gz_statep state; + unsigned char *buf; + unsigned len; + unsigned *have; +{ + int ret; + + *have = 0; + do { + ret = read(state->fd, buf + *have, len - *have); + if (ret <= 0) + break; + *have += ret; + } while (*have < len); + if (ret < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + if (ret == 0) + state->eof = 1; + return 0; +} + +/* Load up input buffer and set eof flag if last data loaded -- return -1 on + error, 0 otherwise. Note that the eof flag is set when the end of the input + file is reached, even though there may be unused data in the buffer. Once + that data has been used, no more attempts will be made to read the file. + If strm->avail_in != 0, then the current data is moved to the beginning of + the input buffer, and then the remainder of the buffer is loaded with the + available data from the input file. */ +local int gz_avail(state) + gz_statep state; +{ + unsigned got; + z_streamp strm = &(state->strm); + + if (state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + if (state->eof == 0) { + if (strm->avail_in) { /* copy what's there to the start */ + unsigned char *p = state->in, *q = strm->next_in; + unsigned n = strm->avail_in; + do { + *p++ = *q++; + } while (--n); + } + if (gz_load(state, state->in + strm->avail_in, + state->size - strm->avail_in, &got) == -1) + return -1; + strm->avail_in += got; + strm->next_in = state->in; + } + return 0; +} + +/* Look for gzip header, set up for inflate or copy. state->x.have must be 0. + If this is the first time in, allocate required memory. state->how will be + left unchanged if there is no more input data available, will be set to COPY + if there is no gzip header and direct copying will be performed, or it will + be set to GZIP for decompression. If direct copying, then leftover input + data from the input buffer will be copied to the output buffer. In that + case, all further file reads will be directly to either the output buffer or + a user buffer. If decompressing, the inflate state will be initialized. + gz_look() will return 0 on success or -1 on failure. */ +local int gz_look(state) + gz_statep state; +{ + z_streamp strm = &(state->strm); + + /* allocate read buffers and inflate memory */ + if (state->size == 0) { + /* allocate buffers */ + state->in = malloc(state->want); + state->out = malloc(state->want << 1); + if (state->in == NULL || state->out == NULL) { + if (state->out != NULL) + free(state->out); + if (state->in != NULL) + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + state->size = state->want; + + /* allocate inflate memory */ + state->strm.zalloc = Z_NULL; + state->strm.zfree = Z_NULL; + state->strm.opaque = Z_NULL; + state->strm.avail_in = 0; + state->strm.next_in = Z_NULL; + if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */ + free(state->out); + free(state->in); + state->size = 0; + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + } + + /* get at least the magic bytes in the input buffer */ + if (strm->avail_in < 2) { + if (gz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) + return 0; + } + + /* look for gzip magic bytes -- if there, do gzip decoding (note: there is + a logical dilemma here when considering the case of a partially written + gzip file, to wit, if a single 31 byte is written, then we cannot tell + whether this is a single-byte file, or just a partially written gzip + file -- for here we assume that if a gzip file is being written, then + the header will be written in a single operation, so that reading a + single byte is sufficient indication that it is not a gzip file) */ + if (strm->avail_in > 1 && + strm->next_in[0] == 31 && strm->next_in[1] == 139) { + inflateReset(strm); + state->how = GZIP; + state->direct = 0; + return 0; + } + + /* no gzip header -- if we were decoding gzip before, then this is trailing + garbage. Ignore the trailing garbage and finish. */ + if (state->direct == 0) { + strm->avail_in = 0; + state->eof = 1; + state->x.have = 0; + return 0; + } + + /* doing raw i/o, copy any leftover input to output -- this assumes that + the output buffer is larger than the input buffer, which also assures + space for gzungetc() */ + state->x.next = state->out; + if (strm->avail_in) { + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; + } + state->how = COPY; + state->direct = 1; + return 0; +} + +/* Decompress from input to the provided next_out and avail_out in the state. + On return, state->x.have and state->x.next point to the just decompressed + data. If the gzip stream completes, state->how is reset to LOOK to look for + the next gzip stream or raw data, once state->x.have is depleted. Returns 0 + on success, -1 on failure. */ +local int gz_decomp(state) + gz_statep state; +{ + int ret = Z_OK; + unsigned had; + z_streamp strm = &(state->strm); + + /* fill output buffer up to end of deflate stream */ + had = strm->avail_out; + do { + /* get more input for inflate() */ + if (strm->avail_in == 0 && gz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) { + gz_error(state, Z_BUF_ERROR, "unexpected end of file"); + break; + } + + /* decompress and handle errors */ + ret = inflate(strm, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) { + gz_error(state, Z_STREAM_ERROR, + "internal error: inflate stream corrupt"); + return -1; + } + if (ret == Z_MEM_ERROR) { + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + if (ret == Z_DATA_ERROR) { /* deflate stream invalid */ + gz_error(state, Z_DATA_ERROR, + strm->msg == NULL ? "compressed data error" : strm->msg); + return -1; + } + } while (strm->avail_out && ret != Z_STREAM_END); + + /* update available output */ + state->x.have = had - strm->avail_out; + state->x.next = strm->next_out - state->x.have; + + /* if the gzip stream completed successfully, look for another */ + if (ret == Z_STREAM_END) + state->how = LOOK; + + /* good decompression */ + return 0; +} + +/* Fetch data and put it in the output buffer. Assumes state->x.have is 0. + Data is either copied from the input file or decompressed from the input + file depending on state->how. If state->how is LOOK, then a gzip header is + looked for to determine whether to copy or decompress. Returns -1 on error, + otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the + end of the input file has been reached and all data has been processed. */ +local int gz_fetch(state) + gz_statep state; +{ + z_streamp strm = &(state->strm); + + do { + switch(state->how) { + case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */ + if (gz_look(state) == -1) + return -1; + if (state->how == LOOK) + return 0; + break; + case COPY: /* -> COPY */ + if (gz_load(state, state->out, state->size << 1, &(state->x.have)) + == -1) + return -1; + state->x.next = state->out; + return 0; + case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */ + strm->avail_out = state->size << 1; + strm->next_out = state->out; + if (gz_decomp(state) == -1) + return -1; + } + } while (state->x.have == 0 && (!state->eof || strm->avail_in)); + return 0; +} + +/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ +local int gz_skip(state, len) + gz_statep state; + z_off64_t len; +{ + unsigned n; + + /* skip over len bytes or reach end-of-file, whichever comes first */ + while (len) + /* skip over whatever is in output buffer */ + if (state->x.have) { + n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ? + (unsigned)len : state->x.have; + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + len -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && state->strm.avail_in == 0) + break; + + /* need more data to skip -- load up output buffer */ + else { + /* get more output, looking for header if required */ + if (gz_fetch(state) == -1) + return -1; + } + return 0; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzread(file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + unsigned got, n; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids the flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); + return -1; + } + + /* if len is zero, avoid unnecessary operations */ + if (len == 0) + return 0; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return -1; + } + + /* get len bytes to buf, or less than len if at the end */ + got = 0; + do { + /* first just try copying data from the output buffer */ + if (state->x.have) { + n = state->x.have > len ? len : state->x.have; + memcpy(buf, state->x.next, n); + state->x.next += n; + state->x.have -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && strm->avail_in == 0) { + state->past = 1; /* tried to read past end */ + break; + } + + /* need output data -- for small len or new stream load up our output + buffer */ + else if (state->how == LOOK || len < (state->size << 1)) { + /* get more output, looking for header if required */ + if (gz_fetch(state) == -1) + return -1; + continue; /* no progress yet -- go back to copy above */ + /* the copy above assures that we will leave with space in the + output buffer, allowing at least one gzungetc() to succeed */ + } + + /* large len -- read directly into user buffer */ + else if (state->how == COPY) { /* read directly */ + if (gz_load(state, buf, len, &n) == -1) + return -1; + } + + /* large len -- decompress directly into user buffer */ + else { /* state->how == GZIP */ + strm->avail_out = len; + strm->next_out = buf; + if (gz_decomp(state) == -1) + return -1; + n = state->x.have; + state->x.have = 0; + } + + /* update progress */ + len -= n; + buf = (char *)buf + n; + got += n; + state->x.pos += n; + } while (len); + + /* return number of bytes read into user buffer (will fit in int) */ + return (int)got; +} + +/* -- see zlib.h -- */ +#undef gzgetc +int ZEXPORT gzgetc(file) + gzFile file; +{ + int ret; + unsigned char buf[1]; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* try output buffer (no need to check for skip request) */ + if (state->x.have) { + state->x.have--; + state->x.pos++; + return *(state->x.next)++; + } + + /* nothing there -- try gzread() */ + ret = gzread(file, buf, 1); + return ret < 1 ? -1 : buf[0]; +} + +int ZEXPORT gzgetc_(file) +gzFile file; +{ + return gzgetc(file); +} + +/* -- see zlib.h -- */ +int ZEXPORT gzungetc(c, file) + int c; + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return -1; + } + + /* can't push EOF */ + if (c < 0) + return -1; + + /* if output buffer empty, put byte at end (allows more pushing) */ + if (state->x.have == 0) { + state->x.have = 1; + state->x.next = state->out + (state->size << 1) - 1; + state->x.next[0] = c; + state->x.pos--; + state->past = 0; + return c; + } + + /* if no room, give up (must have already done a gzungetc()) */ + if (state->x.have == (state->size << 1)) { + gz_error(state, Z_DATA_ERROR, "out of room to push characters"); + return -1; + } + + /* slide output data if needed and insert byte before existing data */ + if (state->x.next == state->out) { + unsigned char *src = state->out + state->x.have; + unsigned char *dest = state->out + (state->size << 1); + while (src > state->out) + *--dest = *--src; + state->x.next = dest; + } + state->x.have++; + state->x.next--; + state->x.next[0] = c; + state->x.pos--; + state->past = 0; + return c; +} + +/* -- see zlib.h -- */ +char * ZEXPORT gzgets(file, buf, len) + gzFile file; + char *buf; + int len; +{ + unsigned left, n; + char *str; + unsigned char *eol; + gz_statep state; + + /* check parameters and get internal structure */ + if (file == NULL || buf == NULL || len < 1) + return NULL; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return NULL; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return NULL; + } + + /* copy output bytes up to new line or len - 1, whichever comes first -- + append a terminating zero to the string (we don't check for a zero in + the contents, let the user worry about that) */ + str = buf; + left = (unsigned)len - 1; + if (left) do { + /* assure that something is in the output buffer */ + if (state->x.have == 0 && gz_fetch(state) == -1) + return NULL; /* error */ + if (state->x.have == 0) { /* end of file */ + state->past = 1; /* read past end */ + break; /* return what we have */ + } + + /* look for end-of-line in current output buffer */ + n = state->x.have > left ? left : state->x.have; + eol = memchr(state->x.next, '\n', n); + if (eol != NULL) + n = (unsigned)(eol - state->x.next) + 1; + + /* copy through end-of-line, or remainder if not found */ + memcpy(buf, state->x.next, n); + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + left -= n; + buf += n; + } while (left && eol == NULL); + + /* return terminated string, or if nothing, end of file */ + if (buf == str) + return NULL; + buf[0] = 0; + return str; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzdirect(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* if the state is not known, but we can find out, then do so (this is + mainly for right after a gzopen() or gzdopen()) */ + if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) + (void)gz_look(state); + + /* return 1 if transparent, 0 if processing a gzip stream */ + return state->direct; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzclose_r(file) + gzFile file; +{ + int ret, err; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + /* check that we're reading */ + if (state->mode != GZ_READ) + return Z_STREAM_ERROR; + + /* free memory and close file */ + if (state->size) { + inflateEnd(&(state->strm)); + free(state->out); + free(state->in); + } + err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK; + gz_error(state, Z_OK, NULL); + free(state->path); + ret = close(state->fd); + free(state); + return ret ? Z_ERRNO : err; +} diff --git a/thirdparty/zlib/zlib-1.2.7/gzwrite.c b/thirdparty/zlib/zlib-1.2.7/gzwrite.c new file mode 100644 index 0000000..27cb342 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/gzwrite.c @@ -0,0 +1,565 @@ +/* gzwrite.c -- zlib functions for writing gzip files + * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* Local functions */ +local int gz_init OF((gz_statep)); +local int gz_comp OF((gz_statep, int)); +local int gz_zero OF((gz_statep, z_off64_t)); + +/* Initialize state for writing a gzip file. Mark initialization by setting + state->size to non-zero. Return -1 on failure or 0 on success. */ +local int gz_init(state) + gz_statep state; +{ + int ret; + z_streamp strm = &(state->strm); + + /* allocate input buffer */ + state->in = malloc(state->want); + if (state->in == NULL) { + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + + /* only need output buffer and deflate state if compressing */ + if (!state->direct) { + /* allocate output buffer */ + state->out = malloc(state->want); + if (state->out == NULL) { + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + + /* allocate deflate memory, set up for gzip compression */ + strm->zalloc = Z_NULL; + strm->zfree = Z_NULL; + strm->opaque = Z_NULL; + ret = deflateInit2(strm, state->level, Z_DEFLATED, + MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy); + if (ret != Z_OK) { + free(state->out); + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + } + + /* mark state as initialized */ + state->size = state->want; + + /* initialize write buffer if compressing */ + if (!state->direct) { + strm->avail_out = state->size; + strm->next_out = state->out; + state->x.next = strm->next_out; + } + return 0; +} + +/* Compress whatever is at avail_in and next_in and write to the output file. + Return -1 if there is an error writing to the output file, otherwise 0. + flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH, + then the deflate() state is reset to start a new gzip stream. If gz->direct + is true, then simply write to the output file without compressing, and + ignore flush. */ +local int gz_comp(state, flush) + gz_statep state; + int flush; +{ + int ret, got; + unsigned have; + z_streamp strm = &(state->strm); + + /* allocate memory if this is the first time through */ + if (state->size == 0 && gz_init(state) == -1) + return -1; + + /* write directly if requested */ + if (state->direct) { + got = write(state->fd, strm->next_in, strm->avail_in); + if (got < 0 || (unsigned)got != strm->avail_in) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + strm->avail_in = 0; + return 0; + } + + /* run deflate() on provided input until it produces no more output */ + ret = Z_OK; + do { + /* write out current buffer contents if full, or if flushing, but if + doing Z_FINISH then don't write until we get to Z_STREAM_END */ + if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && + (flush != Z_FINISH || ret == Z_STREAM_END))) { + have = (unsigned)(strm->next_out - state->x.next); + if (have && ((got = write(state->fd, state->x.next, have)) < 0 || + (unsigned)got != have)) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + if (strm->avail_out == 0) { + strm->avail_out = state->size; + strm->next_out = state->out; + } + state->x.next = strm->next_out; + } + + /* compress */ + have = strm->avail_out; + ret = deflate(strm, flush); + if (ret == Z_STREAM_ERROR) { + gz_error(state, Z_STREAM_ERROR, + "internal error: deflate stream corrupt"); + return -1; + } + have -= strm->avail_out; + } while (have); + + /* if that completed a deflate stream, allow another to start */ + if (flush == Z_FINISH) + deflateReset(strm); + + /* all done, no errors */ + return 0; +} + +/* Compress len zeros to output. Return -1 on error, 0 on success. */ +local int gz_zero(state, len) + gz_statep state; + z_off64_t len; +{ + int first; + unsigned n; + z_streamp strm = &(state->strm); + + /* consume whatever's left in the input buffer */ + if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return -1; + + /* compress len zeros (len guaranteed > 0) */ + first = 1; + while (len) { + n = GT_OFF(state->size) || (z_off64_t)state->size > len ? + (unsigned)len : state->size; + if (first) { + memset(state->in, 0, n); + first = 0; + } + strm->avail_in = n; + strm->next_in = state->in; + state->x.pos += n; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return -1; + len -= n; + } + return 0; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzwrite(file, buf, len) + gzFile file; + voidpc buf; + unsigned len; +{ + unsigned put = len; + unsigned n; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids the flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); + return 0; + } + + /* if len is zero, avoid unnecessary operations */ + if (len == 0) + return 0; + + /* allocate memory if this is the first time through */ + if (state->size == 0 && gz_init(state) == -1) + return 0; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return 0; + } + + /* for small len, copy to input buffer, otherwise compress directly */ + if (len < state->size) { + /* copy to input buffer, compress when full */ + do { + if (strm->avail_in == 0) + strm->next_in = state->in; + n = state->size - strm->avail_in; + if (n > len) + n = len; + memcpy(strm->next_in + strm->avail_in, buf, n); + strm->avail_in += n; + state->x.pos += n; + buf = (char *)buf + n; + len -= n; + if (len && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + } while (len); + } + else { + /* consume whatever's left in the input buffer */ + if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + + /* directly compress user buffer to file */ + strm->avail_in = len; + strm->next_in = (voidp)buf; + state->x.pos += len; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + } + + /* input was all buffered or compressed (put will fit in int) */ + return (int)put; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzputc(file, c) + gzFile file; + int c; +{ + unsigned char buf[1]; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return -1; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return -1; + } + + /* try writing to input buffer for speed (state->size == 0 if buffer not + initialized) */ + if (strm->avail_in < state->size) { + if (strm->avail_in == 0) + strm->next_in = state->in; + strm->next_in[strm->avail_in++] = c; + state->x.pos++; + return c & 0xff; + } + + /* no room in buffer or not initialized, use gz_write() */ + buf[0] = c; + if (gzwrite(file, buf, 1) != 1) + return -1; + return c & 0xff; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzputs(file, str) + gzFile file; + const char *str; +{ + int ret; + unsigned len; + + /* write string */ + len = (unsigned)strlen(str); + ret = gzwrite(file, str, len); + return ret == 0 && len != 0 ? -1 : ret; +} + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +#include + +/* -- see zlib.h -- */ +int ZEXPORTVA gzprintf (gzFile file, const char *format, ...) +{ + int size, len; + gz_statep state; + z_streamp strm; + va_list va; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* make sure we have some buffer space */ + if (state->size == 0 && gz_init(state) == -1) + return 0; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return 0; + } + + /* consume whatever's left in the input buffer */ + if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + + /* do the printf() into the input buffer, put length in len */ + size = (int)(state->size); + state->in[size - 1] = 0; + va_start(va, format); +#ifdef NO_vsnprintf +# ifdef HAS_vsprintf_void + (void)vsprintf((char *)(state->in), format, va); + va_end(va); + for (len = 0; len < size; len++) + if (state->in[len] == 0) break; +# else + len = vsprintf((char *)(state->in), format, va); + va_end(va); +# endif +#else +# ifdef HAS_vsnprintf_void + (void)vsnprintf((char *)(state->in), size, format, va); + va_end(va); + len = strlen((char *)(state->in)); +# else + len = vsnprintf((char *)(state->in), size, format, va); + va_end(va); +# endif +#endif + + /* check that printf() results fit in buffer */ + if (len <= 0 || len >= (int)size || state->in[size - 1] != 0) + return 0; + + /* update buffer and position, defer compression until needed */ + strm->avail_in = (unsigned)len; + strm->next_in = state->in; + state->x.pos += len; + return len; +} + +#else /* !STDC && !Z_HAVE_STDARG_H */ + +/* -- see zlib.h -- */ +int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + gzFile file; + const char *format; + int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; +{ + int size, len; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that can really pass pointer in ints */ + if (sizeof(int) != sizeof(void *)) + return 0; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* make sure we have some buffer space */ + if (state->size == 0 && gz_init(state) == -1) + return 0; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return 0; + } + + /* consume whatever's left in the input buffer */ + if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + + /* do the printf() into the input buffer, put length in len */ + size = (int)(state->size); + state->in[size - 1] = 0; +#ifdef NO_snprintf +# ifdef HAS_sprintf_void + sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + for (len = 0; len < size; len++) + if (state->in[len] == 0) break; +# else + len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); +# endif +#else +# ifdef HAS_snprintf_void + snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + len = strlen((char *)(state->in)); +# else + len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, + a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, + a19, a20); +# endif +#endif + + /* check that printf() results fit in buffer */ + if (len <= 0 || len >= (int)size || state->in[size - 1] != 0) + return 0; + + /* update buffer and position, defer compression until needed */ + strm->avail_in = (unsigned)len; + strm->next_in = state->in; + state->x.pos += len; + return len; +} + +#endif + +/* -- see zlib.h -- */ +int ZEXPORT gzflush(file, flush) + gzFile file; + int flush; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* check flush parameter */ + if (flush < 0 || flush > Z_FINISH) + return Z_STREAM_ERROR; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return -1; + } + + /* compress remaining data with requested flush */ + gz_comp(state, flush); + return state->err; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzsetparams(file, level, strategy) + gzFile file; + int level; + int strategy; +{ + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* if no change is requested, then do nothing */ + if (level == state->level && strategy == state->strategy) + return Z_OK; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return -1; + } + + /* change compression parameters for subsequent input */ + if (state->size) { + /* flush previous input with previous parameters before changing */ + if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1) + return state->err; + deflateParams(strm, level, strategy); + } + state->level = level; + state->strategy = strategy; + return Z_OK; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzclose_w(file) + gzFile file; +{ + int ret = Z_OK; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + /* check that we're writing */ + if (state->mode != GZ_WRITE) + return Z_STREAM_ERROR; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + ret = state->err; + } + + /* flush, free memory, and close file */ + if (state->size) { + if (gz_comp(state, Z_FINISH) == -1) + ret = state->err; + if (!state->direct) { + (void)deflateEnd(&(state->strm)); + free(state->out); + } + free(state->in); + } + gz_error(state, Z_OK, NULL); + free(state->path); + if (close(state->fd) == -1) + ret = Z_ERRNO; + free(state); + return ret; +} diff --git a/thirdparty/zlib/zlib-1.2.7/infback.c b/thirdparty/zlib/zlib-1.2.7/infback.c new file mode 100644 index 0000000..981aff1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/infback.c @@ -0,0 +1,640 @@ +/* infback.c -- inflate using a call-back interface + * Copyright (C) 1995-2011 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + This code is largely copied from inflate.c. Normally either infback.o or + inflate.o would be linked into an application--not both. The interface + with inffast.c is retained so that optimized assembler-coded versions of + inflate_fast() can be used with either inflate.c or infback.c. + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); + +/* + strm provides memory allocation functions in zalloc and zfree, or + Z_NULL to use the library memory allocation functions. + + windowBits is in the range 8..15, and window is a user-supplied + window and output buffer that is 2**windowBits bytes. + */ +int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) +z_streamp strm; +int windowBits; +unsigned char FAR *window; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL || window == Z_NULL || + windowBits < 8 || windowBits > 15) + return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; +#endif + } + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif + state = (struct inflate_state FAR *)ZALLOC(strm, 1, + sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + state->dmax = 32768U; + state->wbits = windowBits; + state->wsize = 1U << windowBits; + state->window = window; + state->wnext = 0; + state->whave = 0; + return Z_OK; +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifdef BUILDFIXED + static int virgin = 1; + static code *lenfix, *distfix; + static code fixed[544]; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + unsigned sym, bits; + static code *next; + + /* literal/length table */ + sym = 0; + while (sym < 144) state->lens[sym++] = 8; + while (sym < 256) state->lens[sym++] = 9; + while (sym < 280) state->lens[sym++] = 7; + while (sym < 288) state->lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); + + /* distance table */ + sym = 0; + while (sym < 32) state->lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); + + /* do this just once */ + virgin = 0; + } +#else /* !BUILDFIXED */ +# include "inffixed.h" +#endif /* BUILDFIXED */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +/* Macros for inflateBack(): */ + +/* Load returned state from inflate_fast() */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Set state from registers for inflate_fast() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Assure that some input is available. If input is requested, but denied, + then return a Z_BUF_ERROR from inflateBack(). */ +#define PULL() \ + do { \ + if (have == 0) { \ + have = in(in_desc, &next); \ + if (have == 0) { \ + next = Z_NULL; \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflateBack() + with an error if there is no input available. */ +#define PULLBYTE() \ + do { \ + PULL(); \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflateBack() with + an error. */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Assure that some output space is available, by writing out the window + if it's full. If the write fails, return from inflateBack() with a + Z_BUF_ERROR. */ +#define ROOM() \ + do { \ + if (left == 0) { \ + put = state->window; \ + left = state->wsize; \ + state->whave = left; \ + if (out(out_desc, put, left)) { \ + ret = Z_BUF_ERROR; \ + goto inf_leave; \ + } \ + } \ + } while (0) + +/* + strm provides the memory allocation functions and window buffer on input, + and provides information on the unused input on return. For Z_DATA_ERROR + returns, strm will also provide an error message. + + in() and out() are the call-back input and output functions. When + inflateBack() needs more input, it calls in(). When inflateBack() has + filled the window with output, or when it completes with data in the + window, it calls out() to write out the data. The application must not + change the provided input until in() is called again or inflateBack() + returns. The application must not change the window/output buffer until + inflateBack() returns. + + in() and out() are called with a descriptor parameter provided in the + inflateBack() call. This parameter can be a structure that provides the + information required to do the read or write, as well as accumulated + information on the input and output such as totals and check values. + + in() should return zero on failure. out() should return non-zero on + failure. If either in() or out() fails, than inflateBack() returns a + Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it + was in() or out() that caused in the error. Otherwise, inflateBack() + returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format + error, or Z_MEM_ERROR if it could not allocate memory for the state. + inflateBack() can also return Z_STREAM_ERROR if the input parameters + are not correct, i.e. strm is Z_NULL or the state was not initialized. + */ +int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) +z_streamp strm; +in_func in; +void FAR *in_desc; +out_func out; +void FAR *out_desc; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code here; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + /* Check that the strm exists and that the state was initialized */ + if (strm == Z_NULL || strm->state == Z_NULL) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* Reset the state */ + strm->msg = Z_NULL; + state->mode = TYPE; + state->last = 0; + state->whave = 0; + next = strm->next_in; + have = next != Z_NULL ? strm->avail_in : 0; + hold = 0; + bits = 0; + put = state->window; + left = state->wsize; + + /* Inflate until end of block marked as last */ + for (;;) + switch (state->mode) { + case TYPE: + /* determine and dispatch block type */ + if (state->last) { + BYTEBITS(); + state->mode = DONE; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + + case STORED: + /* get and verify stored block length */ + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + + /* copy stored block from input to output */ + while (state->length != 0) { + copy = state->length; + PULL(); + ROOM(); + if (copy > have) copy = have; + if (copy > left) copy = left; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + + case TABLE: + /* get dynamic table entries descriptor */ + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + + /* get code length code lengths (not a typo) */ + state->have = 0; + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + + /* get length and distance code code lengths */ + state->have = 0; + while (state->have < state->nlen + state->ndist) { + for (;;) { + here = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.val < 16) { + DROPBITS(here.bits); + state->lens[state->have++] = here.val; + } + else { + if (here.val == 16) { + NEEDBITS(here.bits + 2); + DROPBITS(here.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = (unsigned)(state->lens[state->have - 1]); + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (here.val == 17) { + NEEDBITS(here.bits + 3); + DROPBITS(here.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(here.bits + 7); + DROPBITS(here.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* check for end-of-block code (better have one) */ + if (state->lens[256] == 0) { + strm->msg = (char *)"invalid code -- missing end-of-block"; + state->mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN; + + case LEN: + /* use inflate_fast() if we have enough input and output */ + if (have >= 6 && left >= 258) { + RESTORE(); + if (state->whave < state->wsize) + state->whave = state->wsize - left; + inflate_fast(strm, state->wsize); + LOAD(); + break; + } + + /* get a literal, length, or end-of-block code */ + for (;;) { + here = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.op && (here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + state->length = (unsigned)here.val; + + /* process literal */ + if (here.op == 0) { + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", here.val)); + ROOM(); + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + } + + /* process end of block */ + if (here.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + + /* invalid code */ + if (here.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + + /* length code -- get extra bits, if any */ + state->extra = (unsigned)(here.op) & 15; + if (state->extra != 0) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + + /* get distance code */ + for (;;) { + here = state->distcode[BITS(state->distbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if ((here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(here.bits); + if (here.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)here.val; + + /* get distance extra bits, if any */ + state->extra = (unsigned)(here.op) & 15; + if (state->extra != 0) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + } + if (state->offset > state->wsize - (state->whave < state->wsize ? + left : 0)) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + + /* copy match from window to output */ + do { + ROOM(); + copy = state->wsize - state->offset; + if (copy < left) { + from = put + copy; + copy = left - copy; + } + else { + from = put - state->offset; + copy = left; + } + if (copy > state->length) copy = state->length; + state->length -= copy; + left -= copy; + do { + *put++ = *from++; + } while (--copy); + } while (state->length != 0); + break; + + case DONE: + /* inflate stream terminated properly -- write leftover output */ + ret = Z_STREAM_END; + if (left < state->wsize) { + if (out(out_desc, state->window, state->wsize - left)) + ret = Z_BUF_ERROR; + } + goto inf_leave; + + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + + default: /* can't happen, but makes compilers happy */ + ret = Z_STREAM_ERROR; + goto inf_leave; + } + + /* Return unused input */ + inf_leave: + strm->next_in = next; + strm->avail_in = have; + return ret; +} + +int ZEXPORT inflateBackEnd(strm) +z_streamp strm; +{ + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} diff --git a/thirdparty/zlib/zlib-1.2.7/inffast.c b/thirdparty/zlib/zlib-1.2.7/inffast.c new file mode 100644 index 0000000..2f1d60b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inffast.c @@ -0,0 +1,340 @@ +/* inffast.c -- fast decoding + * Copyright (C) 1995-2008, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +#ifndef ASMINF + +/* Allow machine dependent optimization for post-increment or pre-increment. + Based on testing to date, + Pre-increment preferred for: + - PowerPC G3 (Adler) + - MIPS R5000 (Randers-Pehrson) + Post-increment preferred for: + - none + No measurable difference: + - Pentium III (Anderson) + - M68060 (Nikl) + */ +#ifdef POSTINC +# define OFF 0 +# define PUP(a) *(a)++ +#else +# define OFF 1 +# define PUP(a) *++(a) +#endif + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ +void ZLIB_INTERNAL inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + unsigned char FAR *in; /* local strm->next_in */ + unsigned char FAR *last; /* while in < last, enough input available */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ +#ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ +#endif + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned wnext; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned long hold; /* local strm->hold */ + unsigned bits; /* local strm->bits */ + code const FAR *lcode; /* local strm->lencode */ + code const FAR *dcode; /* local strm->distcode */ + unsigned lmask; /* mask for first level of length codes */ + unsigned dmask; /* mask for first level of distance codes */ + code here; /* retrieved table entry */ + unsigned op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + unsigned len; /* match length, unused bytes */ + unsigned dist; /* match distance */ + unsigned char FAR *from; /* where to copy match from */ + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + in = strm->next_in - OFF; + last = in + (strm->avail_in - 5); + out = strm->next_out - OFF; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); +#ifdef INFLATE_STRICT + dmax = state->dmax; +#endif + wsize = state->wsize; + whave = state->whave; + wnext = state->wnext; + window = state->window; + hold = state->hold; + bits = state->bits; + lcode = state->lencode; + dcode = state->distcode; + lmask = (1U << state->lenbits) - 1; + dmask = (1U << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + do { + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + here = lcode[hold & lmask]; + dolen: + op = (unsigned)(here.bits); + hold >>= op; + bits -= op; + op = (unsigned)(here.op); + if (op == 0) { /* literal */ + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", here.val)); + PUP(out) = (unsigned char)(here.val); + } + else if (op & 16) { /* length base */ + len = (unsigned)(here.val); + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + len += (unsigned)hold & ((1U << op) - 1); + hold >>= op; + bits -= op; + } + Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + here = dcode[hold & dmask]; + dodist: + op = (unsigned)(here.bits); + hold >>= op; + bits -= op; + op = (unsigned)(here.op); + if (op & 16) { /* distance base */ + dist = (unsigned)(here.val); + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + } + dist += (unsigned)hold & ((1U << op) - 1); +#ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + hold >>= op; + bits -= op; + Tracevv((stderr, "inflate: distance %u\n", dist)); + op = (unsigned)(out - beg); /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state->sane) { + strm->msg = + (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + if (len <= op - whave) { + do { + PUP(out) = 0; + } while (--len); + continue; + } + len -= op - whave; + do { + PUP(out) = 0; + } while (--op > whave); + if (op == 0) { + from = out - dist; + do { + PUP(out) = PUP(from); + } while (--len); + continue; + } +#endif + } + from = window - OFF; + if (wnext == 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = window - OFF; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + while (len > 2) { + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + else { + from = out - dist; /* copy direct from output */ + do { /* minimum length is three */ + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } while (len > 2); + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ + here = dcode[here.val + (hold & ((1U << op) - 1))]; + goto dodist; + } + else { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + } + else if ((op & 64) == 0) { /* 2nd level length code */ + here = lcode[here.val + (hold & ((1U << op) - 1))]; + goto dolen; + } + else if (op & 32) { /* end-of-block */ + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + else { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + } while (in < last && out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + in -= len; + bits -= len << 3; + hold &= (1U << bits) - 1; + + /* update state and return */ + strm->next_in = in + OFF; + strm->next_out = out + OFF; + strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); + strm->avail_out = (unsigned)(out < end ? + 257 + (end - out) : 257 - (out - end)); + state->hold = hold; + state->bits = bits; + return; +} + +/* + inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): + - Using bit fields for code structure + - Different op definition to avoid & for extra bits (do & for table bits) + - Three separate decoding do-loops for direct, window, and wnext == 0 + - Special case for distance > 1 copies to do overlapped load and store copy + - Explicit branch predictions (based on measured branch probabilities) + - Deferring match copy and interspersed it with decoding subsequent codes + - Swapping literal/length else + - Swapping window/direct else + - Larger unrolled copy loops (three is about right) + - Moving len -= 3 statement into middle of loop + */ + +#endif /* !ASMINF */ diff --git a/thirdparty/zlib/zlib-1.2.7/inffast.h b/thirdparty/zlib/zlib-1.2.7/inffast.h new file mode 100644 index 0000000..e5c1aa4 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inffast.h @@ -0,0 +1,11 @@ +/* inffast.h -- header to use inffast.c + * Copyright (C) 1995-2003, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/thirdparty/zlib/zlib-1.2.7/inffixed.h b/thirdparty/zlib/zlib-1.2.7/inffixed.h new file mode 100644 index 0000000..d628327 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inffixed.h @@ -0,0 +1,94 @@ + /* inffixed.h -- table for decoding fixed codes + * Generated automatically by makefixed(). + */ + + /* WARNING: this file should *not* be used by applications. + It is part of the implementation of this library and is + subject to change. Applications should only use zlib.h. + */ + + static const code lenfix[512] = { + {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, + {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, + {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, + {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, + {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, + {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, + {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, + {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, + {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, + {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, + {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, + {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, + {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, + {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, + {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, + {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, + {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, + {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, + {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, + {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, + {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, + {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, + {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, + {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, + {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, + {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, + {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, + {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, + {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, + {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, + {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, + {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, + {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, + {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, + {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, + {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, + {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, + {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, + {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, + {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, + {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, + {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, + {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, + {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, + {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, + {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, + {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, + {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, + {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, + {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, + {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, + {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, + {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, + {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, + {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, + {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, + {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, + {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, + {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, + {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, + {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, + {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, + {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, + {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, + {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, + {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, + {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, + {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, + {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, + {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, + {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, + {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, + {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, + {0,9,255} + }; + + static const code distfix[32] = { + {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, + {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, + {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, + {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, + {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, + {22,5,193},{64,5,0} + }; diff --git a/thirdparty/zlib/zlib-1.2.7/inflate.c b/thirdparty/zlib/zlib-1.2.7/inflate.c new file mode 100644 index 0000000..47418a1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inflate.c @@ -0,0 +1,1496 @@ +/* inflate.c -- zlib decompression + * Copyright (C) 1995-2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * Change history: + * + * 1.2.beta0 24 Nov 2002 + * - First version -- complete rewrite of inflate to simplify code, avoid + * creation of window when not needed, minimize use of window when it is + * needed, make inffast.c even faster, implement gzip decoding, and to + * improve code readability and style over the previous zlib inflate code + * + * 1.2.beta1 25 Nov 2002 + * - Use pointers for available input and output checking in inffast.c + * - Remove input and output counters in inffast.c + * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 + * - Remove unnecessary second byte pull from length extra in inffast.c + * - Unroll direct copy to three copies per loop in inffast.c + * + * 1.2.beta2 4 Dec 2002 + * - Change external routine names to reduce potential conflicts + * - Correct filename to inffixed.h for fixed tables in inflate.c + * - Make hbuf[] unsigned char to match parameter type in inflate.c + * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) + * to avoid negation problem on Alphas (64 bit) in inflate.c + * + * 1.2.beta3 22 Dec 2002 + * - Add comments on state->bits assertion in inffast.c + * - Add comments on op field in inftrees.h + * - Fix bug in reuse of allocated window after inflateReset() + * - Remove bit fields--back to byte structure for speed + * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths + * - Change post-increments to pre-increments in inflate_fast(), PPC biased? + * - Add compile time option, POSTINC, to use post-increments instead (Intel?) + * - Make MATCH copy in inflate() much faster for when inflate_fast() not used + * - Use local copies of stream next and avail values, as well as local bit + * buffer and bit count in inflate()--for speed when inflate_fast() not used + * + * 1.2.beta4 1 Jan 2003 + * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings + * - Move a comment on output buffer sizes from inffast.c to inflate.c + * - Add comments in inffast.c to introduce the inflate_fast() routine + * - Rearrange window copies in inflate_fast() for speed and simplification + * - Unroll last copy for window match in inflate_fast() + * - Use local copies of window variables in inflate_fast() for speed + * - Pull out common wnext == 0 case for speed in inflate_fast() + * - Make op and len in inflate_fast() unsigned for consistency + * - Add FAR to lcode and dcode declarations in inflate_fast() + * - Simplified bad distance check in inflate_fast() + * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new + * source file infback.c to provide a call-back interface to inflate for + * programs like gzip and unzip -- uses window as output buffer to avoid + * window copying + * + * 1.2.beta5 1 Jan 2003 + * - Improved inflateBack() interface to allow the caller to provide initial + * input in strm. + * - Fixed stored blocks bug in inflateBack() + * + * 1.2.beta6 4 Jan 2003 + * - Added comments in inffast.c on effectiveness of POSTINC + * - Typecasting all around to reduce compiler warnings + * - Changed loops from while (1) or do {} while (1) to for (;;), again to + * make compilers happy + * - Changed type of window in inflateBackInit() to unsigned char * + * + * 1.2.beta7 27 Jan 2003 + * - Changed many types to unsigned or unsigned short to avoid warnings + * - Added inflateCopy() function + * + * 1.2.0 9 Mar 2003 + * - Changed inflateBack() interface to provide separate opaque descriptors + * for the in() and out() functions + * - Changed inflateBack() argument and in_func typedef to swap the length + * and buffer address return values for the input function + * - Check next_in and next_out for Z_NULL on entry to inflate() + * + * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +#ifdef MAKEFIXED +# ifndef BUILDFIXED +# define BUILDFIXED +# endif +#endif + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); +local int updatewindow OF((z_streamp strm, unsigned out)); +#ifdef BUILDFIXED + void makefixed OF((void)); +#endif +local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, + unsigned len)); + +int ZEXPORT inflateResetKeep(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + strm->total_in = strm->total_out = state->total = 0; + strm->msg = Z_NULL; + if (state->wrap) /* to support ill-conceived Java test suite */ + strm->adler = state->wrap & 1; + state->mode = HEAD; + state->last = 0; + state->havedict = 0; + state->dmax = 32768U; + state->head = Z_NULL; + state->hold = 0; + state->bits = 0; + state->lencode = state->distcode = state->next = state->codes; + state->sane = 1; + state->back = -1; + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +int ZEXPORT inflateReset(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + state->wsize = 0; + state->whave = 0; + state->wnext = 0; + return inflateResetKeep(strm); +} + +int ZEXPORT inflateReset2(strm, windowBits) +z_streamp strm; +int windowBits; +{ + int wrap; + struct inflate_state FAR *state; + + /* get the state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; +#ifdef GUNZIP + if (windowBits < 48) + windowBits &= 15; +#endif + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) + return Z_STREAM_ERROR; + if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { + ZFREE(strm, state->window); + state->window = Z_NULL; + } + + /* update state and reset the rest of it */ + state->wrap = wrap; + state->wbits = (unsigned)windowBits; + return inflateReset(strm); +} + +int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) +z_streamp strm; +int windowBits; +const char *version; +int stream_size; +{ + int ret; + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL) return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; +#endif + } + if (strm->zfree == (free_func)0) +#ifdef Z_SOLO + return Z_STREAM_ERROR; +#else + strm->zfree = zcfree; +#endif + state = (struct inflate_state FAR *) + ZALLOC(strm, 1, sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + state->window = Z_NULL; + ret = inflateReset2(strm, windowBits); + if (ret != Z_OK) { + ZFREE(strm, state); + strm->state = Z_NULL; + } + return ret; +} + +int ZEXPORT inflateInit_(strm, version, stream_size) +z_streamp strm; +const char *version; +int stream_size; +{ + return inflateInit2_(strm, DEF_WBITS, version, stream_size); +} + +int ZEXPORT inflatePrime(strm, bits, value) +z_streamp strm; +int bits; +int value; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits < 0) { + state->hold = 0; + state->bits = 0; + return Z_OK; + } + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifdef BUILDFIXED + static int virgin = 1; + static code *lenfix, *distfix; + static code fixed[544]; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + unsigned sym, bits; + static code *next; + + /* literal/length table */ + sym = 0; + while (sym < 144) state->lens[sym++] = 8; + while (sym < 256) state->lens[sym++] = 9; + while (sym < 280) state->lens[sym++] = 7; + while (sym < 288) state->lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); + + /* distance table */ + sym = 0; + while (sym < 32) state->lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); + + /* do this just once */ + virgin = 0; + } +#else /* !BUILDFIXED */ +# include "inffixed.h" +#endif /* BUILDFIXED */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +#ifdef MAKEFIXED +#include + +/* + Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also + defines BUILDFIXED, so the tables are built on the fly. makefixed() writes + those tables to stdout, which would be piped to inffixed.h. A small program + can simply call makefixed to do this: + + void makefixed(void); + + int main(void) + { + makefixed(); + return 0; + } + + Then that can be linked with zlib built with MAKEFIXED defined and run: + + a.out > inffixed.h + */ +void makefixed() +{ + unsigned low, size; + struct inflate_state state; + + fixedtables(&state); + puts(" /* inffixed.h -- table for decoding fixed codes"); + puts(" * Generated automatically by makefixed()."); + puts(" */"); + puts(""); + puts(" /* WARNING: this file should *not* be used by applications."); + puts(" It is part of the implementation of this library and is"); + puts(" subject to change. Applications should only use zlib.h."); + puts(" */"); + puts(""); + size = 1U << 9; + printf(" static const code lenfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 7) == 0) printf("\n "); + printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, + state.lencode[low].bits, state.lencode[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); + size = 1U << 5; + printf("\n static const code distfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 6) == 0) printf("\n "); + printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, + state.distcode[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); +} +#endif /* MAKEFIXED */ + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +local int updatewindow(strm, out) +z_streamp strm; +unsigned out; +{ + struct inflate_state FAR *state; + unsigned copy, dist; + + state = (struct inflate_state FAR *)strm->state; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { + state->window = (unsigned char FAR *) + ZALLOC(strm, 1U << state->wbits, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; + } + + /* if window not in use yet, initialize */ + if (state->wsize == 0) { + state->wsize = 1U << state->wbits; + state->wnext = 0; + state->whave = 0; + } + + /* copy state->wsize or less output bytes into the circular window */ + copy = out - strm->avail_out; + if (copy >= state->wsize) { + zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + state->wnext = 0; + state->whave = state->wsize; + } + else { + dist = state->wsize - state->wnext; + if (dist > copy) dist = copy; + zmemcpy(state->window + state->wnext, strm->next_out - copy, dist); + copy -= dist; + if (copy) { + zmemcpy(state->window, strm->next_out - copy, copy); + state->wnext = copy; + state->whave = state->wsize; + } + else { + state->wnext += dist; + if (state->wnext == state->wsize) state->wnext = 0; + if (state->whave < state->wsize) state->whave += dist; + } + } + return 0; +} + +/* Macros for inflate(): */ + +/* check function to use adler32() for zlib or crc32() for gzip */ +#ifdef GUNZIP +# define UPDATE(check, buf, len) \ + (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) +#else +# define UPDATE(check, buf, len) adler32(check, buf, len) +#endif + +/* check macros for header crc */ +#ifdef GUNZIP +# define CRC2(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + check = crc32(check, hbuf, 2); \ + } while (0) + +# define CRC4(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + hbuf[2] = (unsigned char)((word) >> 16); \ + hbuf[3] = (unsigned char)((word) >> 24); \ + check = crc32(check, hbuf, 4); \ + } while (0) +#endif + +/* Load registers with state in inflate() for speed */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Restore state from registers in inflate() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflate() + if there is no input available. */ +#define PULLBYTE() \ + do { \ + if (have == 0) goto inf_leave; \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflate(). */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* + inflate() uses a state machine to process as much input data and generate as + much output data as possible before returning. The state machine is + structured roughly as follows: + + for (;;) switch (state) { + ... + case STATEn: + if (not enough input data or output space to make progress) + return; + ... make progress ... + state = STATEm; + break; + ... + } + + so when inflate() is called again, the same case is attempted again, and + if the appropriate resources are provided, the machine proceeds to the + next state. The NEEDBITS() macro is usually the way the state evaluates + whether it can proceed or should return. NEEDBITS() does the return if + the requested bits are not available. The typical use of the BITS macros + is: + + NEEDBITS(n); + ... do something with BITS(n) ... + DROPBITS(n); + + where NEEDBITS(n) either returns from inflate() if there isn't enough + input left to load n bits into the accumulator, or it continues. BITS(n) + gives the low n bits in the accumulator. When done, DROPBITS(n) drops + the low n bits off the accumulator. INITBITS() clears the accumulator + and sets the number of available bits to zero. BYTEBITS() discards just + enough bits to put the accumulator on a byte boundary. After BYTEBITS() + and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. + + NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return + if there is no input available. The decoding of variable length codes uses + PULLBYTE() directly in order to pull just enough bytes to decode the next + code, and no more. + + Some states loop until they get enough input, making sure that enough + state information is maintained to continue the loop where it left off + if NEEDBITS() returns in the loop. For example, want, need, and keep + would all have to actually be part of the saved state in case NEEDBITS() + returns: + + case STATEw: + while (want < need) { + NEEDBITS(n); + keep[want++] = BITS(n); + DROPBITS(n); + } + state = STATEx; + case STATEx: + + As shown above, if the next state is also the next case, then the break + is omitted. + + A state may also return if there is not enough output space available to + complete that state. Those states are copying stored data, writing a + literal byte, and copying a matching string. + + When returning, a "goto inf_leave" is used to update the total counters, + update the check value, and determine whether any progress has been made + during that inflate() call in order to return the proper return code. + Progress is defined as a change in either strm->avail_in or strm->avail_out. + When there is a window, goto inf_leave will update the window with the last + output written. If a goto inf_leave occurs in the middle of decompression + and there is no window currently, goto inf_leave will create one and copy + output to the window for the next call of inflate(). + + In this implementation, the flush parameter of inflate() only affects the + return code (per zlib.h). inflate() always writes as much as possible to + strm->next_out, given the space available and the provided input--the effect + documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers + the allocation of and copying into a sliding window until necessary, which + provides the effect documented in zlib.h for Z_FINISH when the entire input + stream available. So the only thing the flush parameter actually does is: + when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it + will return Z_BUF_ERROR if it has not reached the end of the stream. + */ + +int ZEXPORT inflate(strm, flush) +z_streamp strm; +int flush; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned in, out; /* save starting available input and output */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code here; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ +#ifdef GUNZIP + unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ +#endif + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0)) + return Z_STREAM_ERROR; + + state = (struct inflate_state FAR *)strm->state; + if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ + LOAD(); + in = have; + out = left; + ret = Z_OK; + for (;;) + switch (state->mode) { + case HEAD: + if (state->wrap == 0) { + state->mode = TYPEDO; + break; + } + NEEDBITS(16); +#ifdef GUNZIP + if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + state->check = crc32(0L, Z_NULL, 0); + CRC2(state->check, hold); + INITBITS(); + state->mode = FLAGS; + break; + } + state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; + if (!(state->wrap & 1) || /* check if zlib header allowed */ +#else + if ( +#endif + ((BITS(8) << 8) + (hold >> 8)) % 31) { + strm->msg = (char *)"incorrect header check"; + state->mode = BAD; + break; + } + if (BITS(4) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + DROPBITS(4); + len = BITS(4) + 8; + if (state->wbits == 0) + state->wbits = len; + else if (len > state->wbits) { + strm->msg = (char *)"invalid window size"; + state->mode = BAD; + break; + } + state->dmax = 1U << len; + Tracev((stderr, "inflate: zlib header ok\n")); + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = hold & 0x200 ? DICTID : TYPE; + INITBITS(); + break; +#ifdef GUNZIP + case FLAGS: + NEEDBITS(16); + state->flags = (int)(hold); + if ((state->flags & 0xff) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + if (state->flags & 0xe000) { + strm->msg = (char *)"unknown header flags set"; + state->mode = BAD; + break; + } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = TIME; + case TIME: + NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; + if (state->flags & 0x0200) CRC4(state->check, hold); + INITBITS(); + state->mode = OS; + case OS: + NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = EXLEN; + case EXLEN: + if (state->flags & 0x0400) { + NEEDBITS(16); + state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; + state->mode = EXTRA; + case EXTRA: + if (state->flags & 0x0400) { + copy = state->length; + if (copy > have) copy = have; + if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + state->length -= copy; + } + if (state->length) goto inf_leave; + } + state->length = 0; + state->mode = NAME; + case NAME: + if (state->flags & 0x0800) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; + state->mode = COMMENT; + case COMMENT: + if (state->flags & 0x1000) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; + state->mode = HCRC; + case HCRC: + if (state->flags & 0x0200) { + NEEDBITS(16); + if (hold != (state->check & 0xffff)) { + strm->msg = (char *)"header crc mismatch"; + state->mode = BAD; + break; + } + INITBITS(); + } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } + strm->adler = state->check = crc32(0L, Z_NULL, 0); + state->mode = TYPE; + break; +#endif + case DICTID: + NEEDBITS(32); + strm->adler = state->check = ZSWAP32(hold); + INITBITS(); + state->mode = DICT; + case DICT: + if (state->havedict == 0) { + RESTORE(); + return Z_NEED_DICT; + } + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = TYPE; + case TYPE: + if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; + case TYPEDO: + if (state->last) { + BYTEBITS(); + state->mode = CHECK; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN_; /* decode codes */ + if (flush == Z_TREES) { + DROPBITS(2); + goto inf_leave; + } + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + case STORED: + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + state->mode = COPY_; + if (flush == Z_TREES) goto inf_leave; + case COPY_: + state->mode = COPY; + case COPY: + copy = state->length; + if (copy) { + if (copy > have) copy = have; + if (copy > left) copy = left; + if (copy == 0) goto inf_leave; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + break; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + case TABLE: + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + state->have = 0; + state->mode = LENLENS; + case LENLENS: + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + state->have = 0; + state->mode = CODELENS; + case CODELENS: + while (state->have < state->nlen + state->ndist) { + for (;;) { + here = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.val < 16) { + DROPBITS(here.bits); + state->lens[state->have++] = here.val; + } + else { + if (here.val == 16) { + NEEDBITS(here.bits + 2); + DROPBITS(here.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = state->lens[state->have - 1]; + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (here.val == 17) { + NEEDBITS(here.bits + 3); + DROPBITS(here.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(here.bits + 7); + DROPBITS(here.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* check for end-of-block code (better have one) */ + if (state->lens[256] == 0) { + strm->msg = (char *)"invalid code -- missing end-of-block"; + state->mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN_; + if (flush == Z_TREES) goto inf_leave; + case LEN_: + state->mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + RESTORE(); + inflate_fast(strm, out); + LOAD(); + if (state->mode == TYPE) + state->back = -1; + break; + } + state->back = 0; + for (;;) { + here = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if (here.op && (here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + state->back += last.bits; + } + DROPBITS(here.bits); + state->back += here.bits; + state->length = (unsigned)here.val; + if ((int)(here.op) == 0) { + Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", here.val)); + state->mode = LIT; + break; + } + if (here.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->back = -1; + state->mode = TYPE; + break; + } + if (here.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + state->extra = (unsigned)(here.op) & 15; + state->mode = LENEXT; + case LENEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + state->back += state->extra; + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + state->was = state->length; + state->mode = DIST; + case DIST: + for (;;) { + here = state->distcode[BITS(state->distbits)]; + if ((unsigned)(here.bits) <= bits) break; + PULLBYTE(); + } + if ((here.op & 0xf0) == 0) { + last = here; + for (;;) { + here = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + here.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + state->back += last.bits; + } + DROPBITS(here.bits); + state->back += here.bits; + if (here.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)here.val; + state->extra = (unsigned)(here.op) & 15; + state->mode = DISTEXT; + case DISTEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + state->back += state->extra; + } +#ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + state->mode = MATCH; + case MATCH: + if (left == 0) goto inf_leave; + copy = out - left; + if (state->offset > copy) { /* copy from window */ + copy = state->offset - copy; + if (copy > state->whave) { + if (state->sane) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + Trace((stderr, "inflate.c too far\n")); + copy -= state->whave; + if (copy > state->length) copy = state->length; + if (copy > left) copy = left; + left -= copy; + state->length -= copy; + do { + *put++ = 0; + } while (--copy); + if (state->length == 0) state->mode = LEN; + break; +#endif + } + if (copy > state->wnext) { + copy -= state->wnext; + from = state->window + (state->wsize - copy); + } + else + from = state->window + (state->wnext - copy); + if (copy > state->length) copy = state->length; + } + else { /* copy from output */ + from = put - state->offset; + copy = state->length; + } + if (copy > left) copy = left; + left -= copy; + state->length -= copy; + do { + *put++ = *from++; + } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: + if (left == 0) goto inf_leave; + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + case CHECK: + if (state->wrap) { + NEEDBITS(32); + out -= left; + strm->total_out += out; + state->total += out; + if (out) + strm->adler = state->check = + UPDATE(state->check, put - out, out); + out = left; + if (( +#ifdef GUNZIP + state->flags ? hold : +#endif + ZSWAP32(hold)) != state->check) { + strm->msg = (char *)"incorrect data check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: check matches trailer\n")); + } +#ifdef GUNZIP + state->mode = LENGTH; + case LENGTH: + if (state->wrap && state->flags) { + NEEDBITS(32); + if (hold != (state->total & 0xffffffffUL)) { + strm->msg = (char *)"incorrect length check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: length matches trailer\n")); + } +#endif + state->mode = DONE; + case DONE: + ret = Z_STREAM_END; + goto inf_leave; + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR; + } + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + inf_leave: + RESTORE(); + if (state->wsize || (out != strm->avail_out && state->mode < BAD && + (state->mode < CHECK || flush != Z_FINISH))) + if (updatewindow(strm, out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + in -= strm->avail_in; + out -= strm->avail_out; + strm->total_in += in; + strm->total_out += out; + state->total += out; + if (state->wrap && out) + strm->adler = state->check = + UPDATE(state->check, strm->next_out - out, out); + strm->data_type = state->bits + (state->last ? 64 : 0) + + (state->mode == TYPE ? 128 : 0) + + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); + if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) + ret = Z_BUF_ERROR; + return ret; +} + +int ZEXPORT inflateEnd(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->window != Z_NULL) ZFREE(strm, state->window); + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + +int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) +z_streamp strm; +const Bytef *dictionary; +uInt dictLength; +{ + struct inflate_state FAR *state; + unsigned long dictid; + unsigned char *next; + unsigned avail; + int ret; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->wrap != 0 && state->mode != DICT) + return Z_STREAM_ERROR; + + /* check for correct dictionary identifier */ + if (state->mode == DICT) { + dictid = adler32(0L, Z_NULL, 0); + dictid = adler32(dictid, dictionary, dictLength); + if (dictid != state->check) + return Z_DATA_ERROR; + } + + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + next = strm->next_out; + avail = strm->avail_out; + strm->next_out = (Bytef *)dictionary + dictLength; + strm->avail_out = 0; + ret = updatewindow(strm, dictLength); + strm->avail_out = avail; + strm->next_out = next; + if (ret) { + state->mode = MEM; + return Z_MEM_ERROR; + } + state->havedict = 1; + Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +int ZEXPORT inflateGetHeader(strm, head) +z_streamp strm; +gz_headerp head; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; + head->done = 0; + return Z_OK; +} + +/* + Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found + or when out of input. When called, *have is the number of pattern bytes + found in order so far, in 0..3. On return *have is updated to the new + state. If on return *have equals four, then the pattern was found and the + return value is how many bytes were read including the last byte of the + pattern. If *have is less than four, then the pattern has not been found + yet and the return value is len. In the latter case, syncsearch() can be + called again with more data and the *have state. *have is initialized to + zero for the first call. + */ +local unsigned syncsearch(have, buf, len) +unsigned FAR *have; +unsigned char FAR *buf; +unsigned len; +{ + unsigned got; + unsigned next; + + got = *have; + next = 0; + while (next < len && got < 4) { + if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) + got++; + else if (buf[next]) + got = 0; + else + got = 4 - got; + next++; + } + *have = got; + return next; +} + +int ZEXPORT inflateSync(strm) +z_streamp strm; +{ + unsigned len; /* number of bytes to look at or looked at */ + unsigned long in, out; /* temporary to save total_in and total_out */ + unsigned char buf[4]; /* to restore bit buffer to byte string */ + struct inflate_state FAR *state; + + /* check parameters */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; + + /* if first time, start search in bit buffer */ + if (state->mode != SYNC) { + state->mode = SYNC; + state->hold <<= state->bits & 7; + state->bits -= state->bits & 7; + len = 0; + while (state->bits >= 8) { + buf[len++] = (unsigned char)(state->hold); + state->hold >>= 8; + state->bits -= 8; + } + state->have = 0; + syncsearch(&(state->have), buf, len); + } + + /* search available input */ + len = syncsearch(&(state->have), strm->next_in, strm->avail_in); + strm->avail_in -= len; + strm->next_in += len; + strm->total_in += len; + + /* return no joy or set up to restart inflate() on a new block */ + if (state->have != 4) return Z_DATA_ERROR; + in = strm->total_in; out = strm->total_out; + inflateReset(strm); + strm->total_in = in; strm->total_out = out; + state->mode = TYPE; + return Z_OK; +} + +/* + Returns true if inflate is currently at the end of a block generated by + Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + implementation to provide an additional safety check. PPP uses + Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored + block. When decompressing, PPP checks that at the end of input packet, + inflate is waiting for these length bytes. + */ +int ZEXPORT inflateSyncPoint(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + return state->mode == STORED && state->bits == 0; +} + +int ZEXPORT inflateCopy(dest, source) +z_streamp dest; +z_streamp source; +{ + struct inflate_state FAR *state; + struct inflate_state FAR *copy; + unsigned char FAR *window; + unsigned wsize; + + /* check input */ + if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || + source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)source->state; + + /* allocate space */ + copy = (struct inflate_state FAR *) + ZALLOC(source, 1, sizeof(struct inflate_state)); + if (copy == Z_NULL) return Z_MEM_ERROR; + window = Z_NULL; + if (state->window != Z_NULL) { + window = (unsigned char FAR *) + ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); + if (window == Z_NULL) { + ZFREE(source, copy); + return Z_MEM_ERROR; + } + } + + /* copy state */ + zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); + zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); + if (state->lencode >= state->codes && + state->lencode <= state->codes + ENOUGH - 1) { + copy->lencode = copy->codes + (state->lencode - state->codes); + copy->distcode = copy->codes + (state->distcode - state->codes); + } + copy->next = copy->codes + (state->next - state->codes); + if (window != Z_NULL) { + wsize = 1U << state->wbits; + zmemcpy(window, state->window, wsize); + } + copy->window = window; + dest->state = (struct internal_state FAR *)copy; + return Z_OK; +} + +int ZEXPORT inflateUndermine(strm, subvert) +z_streamp strm; +int subvert; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + state->sane = !subvert; +#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + return Z_OK; +#else + state->sane = 1; + return Z_DATA_ERROR; +#endif +} + +long ZEXPORT inflateMark(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + state = (struct inflate_state FAR *)strm->state; + return ((long)(state->back) << 16) + + (state->mode == COPY ? state->length : + (state->mode == MATCH ? state->was - state->length : 0)); +} diff --git a/thirdparty/zlib/zlib-1.2.7/inflate.h b/thirdparty/zlib/zlib-1.2.7/inflate.h new file mode 100644 index 0000000..95f4986 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inflate.h @@ -0,0 +1,122 @@ +/* inflate.h -- internal inflate state definition + * Copyright (C) 1995-2009 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer decoding by inflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip decoding + should be left enabled. */ +#ifndef NO_GZIP +# define GUNZIP +#endif + +/* Possible inflate modes between inflate() calls */ +typedef enum { + HEAD, /* i: waiting for magic header */ + FLAGS, /* i: waiting for method and flags (gzip) */ + TIME, /* i: waiting for modification time (gzip) */ + OS, /* i: waiting for extra flags and operating system (gzip) */ + EXLEN, /* i: waiting for extra length (gzip) */ + EXTRA, /* i: waiting for extra bytes (gzip) */ + NAME, /* i: waiting for end of file name (gzip) */ + COMMENT, /* i: waiting for end of comment (gzip) */ + HCRC, /* i: waiting for header crc (gzip) */ + DICTID, /* i: waiting for dictionary check value */ + DICT, /* waiting for inflateSetDictionary() call */ + TYPE, /* i: waiting for type bits, including last-flag bit */ + TYPEDO, /* i: same, but skip check to exit inflate on new block */ + STORED, /* i: waiting for stored size (length and complement) */ + COPY_, /* i/o: same as COPY below, but only first time in */ + COPY, /* i/o: waiting for input or output to copy stored block */ + TABLE, /* i: waiting for dynamic block table lengths */ + LENLENS, /* i: waiting for code length code lengths */ + CODELENS, /* i: waiting for length/lit and distance code lengths */ + LEN_, /* i: same as LEN below, but only first time in */ + LEN, /* i: waiting for length/lit/eob code */ + LENEXT, /* i: waiting for length extra bits */ + DIST, /* i: waiting for distance code */ + DISTEXT, /* i: waiting for distance extra bits */ + MATCH, /* o: waiting for output space to copy string */ + LIT, /* o: waiting for output space to write literal */ + CHECK, /* i: waiting for 32-bit check value */ + LENGTH, /* i: waiting for 32-bit length (gzip) */ + DONE, /* finished check, done -- remain here until reset */ + BAD, /* got a data error -- remain here until reset */ + MEM, /* got an inflate() memory error -- remain here until reset */ + SYNC /* looking for synchronization bytes to restart inflate() */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to BAD or MEM on error -- not shown for clarity) + + Process header: + HEAD -> (gzip) or (zlib) or (raw) + (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT -> + HCRC -> TYPE + (zlib) -> DICTID or TYPE + DICTID -> DICT -> TYPE + (raw) -> TYPEDO + Read deflate blocks: + TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK + STORED -> COPY_ -> COPY -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN_ + LEN_ -> LEN + Read deflate codes in fixed or dynamic block: + LEN -> LENEXT or LIT or TYPE + LENEXT -> DIST -> DISTEXT -> MATCH -> LEN + LIT -> LEN + Process trailer: + CHECK -> LENGTH -> DONE + */ + +/* state maintained between inflate() calls. Approximately 10K bytes. */ +struct inflate_state { + inflate_mode mode; /* current inflate mode */ + int last; /* true if processing last block */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int havedict; /* true if dictionary provided */ + int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ + unsigned long check; /* protected copy of check value */ + unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ + /* sliding window */ + unsigned wbits; /* log base 2 of requested window size */ + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned wnext; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* bit accumulator */ + unsigned long hold; /* input bit accumulator */ + unsigned bits; /* number of bits in "in" */ + /* for string and stored block copying */ + unsigned length; /* literal or length of data to copy */ + unsigned offset; /* distance back to copy string from */ + /* for table and code decoding */ + unsigned extra; /* extra bits needed */ + /* fixed and dynamic code tables */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ + int sane; /* if false, allow invalid distance too far */ + int back; /* bits back of last unprocessed length/lit */ + unsigned was; /* initial length of match */ +}; diff --git a/thirdparty/zlib/zlib-1.2.7/inftrees.c b/thirdparty/zlib/zlib-1.2.7/inftrees.c new file mode 100644 index 0000000..abcd7c4 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inftrees.c @@ -0,0 +1,306 @@ +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2012 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" + +#define MAXBITS 15 + +const char inflate_copyright[] = + " inflate 1.2.7 Copyright 1995-2012 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* + Build a set of tables to decode the provided canonical Huffman code. + The code lengths are lens[0..codes-1]. The result starts at *table, + whose indices are 0..2^bits-1. work is a writable array of at least + lens shorts, which is used as a work area. type is the type of code + to be generated, CODES, LENS, or DISTS. On return, zero is success, + -1 is an invalid code, and +1 means that ENOUGH isn't enough. table + on return points to the next available entry's address. bits is the + requested root table index bits, and on return it is the actual root + table index bits. It will differ if the request is greater than the + longest code or if it is less than the shortest code. + */ +int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work) +codetype type; +unsigned short FAR *lens; +unsigned codes; +code FAR * FAR *table; +unsigned FAR *bits; +unsigned short FAR *work; +{ + unsigned len; /* a code's length in bits */ + unsigned sym; /* index of code symbols */ + unsigned min, max; /* minimum and maximum code lengths */ + unsigned root; /* number of index bits for root table */ + unsigned curr; /* number of index bits for current table */ + unsigned drop; /* code bits to drop for sub-table */ + int left; /* number of prefix codes available */ + unsigned used; /* code entries in table used */ + unsigned huff; /* Huffman code */ + unsigned incr; /* for incrementing code, index */ + unsigned fill; /* index for replicating entries */ + unsigned low; /* low bits for current root entry */ + unsigned mask; /* mask for low root bits */ + code here; /* table entry for duplication */ + code FAR *next; /* next available space in table */ + const unsigned short FAR *base; /* base value table to use */ + const unsigned short FAR *extra; /* extra bits table to use */ + int end; /* use base and extra for symbol > end */ + unsigned short count[MAXBITS+1]; /* number of codes of each length */ + unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const unsigned short lbase[31] = { /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + static const unsigned short lext[31] = { /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 78, 68}; + static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0}; + static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64}; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) + count[len] = 0; + for (sym = 0; sym < codes; sym++) + count[lens[sym]]++; + + /* bound code lengths, force root to be within code lengths */ + root = *bits; + for (max = MAXBITS; max >= 1; max--) + if (count[max] != 0) break; + if (root > max) root = max; + if (max == 0) { /* no symbols to code at all */ + here.op = (unsigned char)64; /* invalid code marker */ + here.bits = (unsigned char)1; + here.val = (unsigned short)0; + *(*table)++ = here; /* make a table to force an error */ + *(*table)++ = here; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) + if (count[min] != 0) break; + if (root < min) root = min; + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) return -1; /* over-subscribed */ + } + if (left > 0 && (type == CODES || max != 1)) + return -1; /* incomplete set */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + count[len]; + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) + if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + switch (type) { + case CODES: + base = extra = work; /* dummy value--not used */ + end = 19; + break; + case LENS: + base = lbase; + base -= 257; + extra = lext; + extra -= 257; + end = 256; + break; + default: /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize state for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = *table; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = (unsigned)(-1); /* trigger new sub-table when len > root */ + used = 1U << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type == LENS && used >= ENOUGH_LENS) || + (type == DISTS && used >= ENOUGH_DISTS)) + return 1; + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + here.bits = (unsigned char)(len - drop); + if ((int)(work[sym]) < end) { + here.op = (unsigned char)0; + here.val = work[sym]; + } + else if ((int)(work[sym]) > end) { + here.op = (unsigned char)(extra[work[sym]]); + here.val = base[work[sym]]; + } + else { + here.op = (unsigned char)(32 + 64); /* end of block */ + here.val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1U << (len - drop); + fill = 1U << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + next[(huff >> drop) + fill] = here; + } while (fill != 0); + + /* backwards increment the len-bit code huff */ + incr = 1U << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + + /* go to next symbol, update count, len */ + sym++; + if (--(count[len]) == 0) { + if (len == max) break; + len = lens[work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) != low) { + /* if first time, transition to sub-tables */ + if (drop == 0) + drop = root; + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = (int)(1 << curr); + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) break; + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1U << curr; + if ((type == LENS && used >= ENOUGH_LENS) || + (type == DISTS && used >= ENOUGH_DISTS)) + return 1; + + /* point entry in root table to sub-table */ + low = huff & mask; + (*table)[low].op = (unsigned char)curr; + (*table)[low].bits = (unsigned char)root; + (*table)[low].val = (unsigned short)(next - *table); + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff != 0) { + here.op = (unsigned char)64; /* invalid code marker */ + here.bits = (unsigned char)(len - drop); + here.val = (unsigned short)0; + next[huff] = here; + } + + /* set return parameters */ + *table += used; + *bits = root; + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/inftrees.h b/thirdparty/zlib/zlib-1.2.7/inftrees.h new file mode 100644 index 0000000..baa53a0 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/inftrees.h @@ -0,0 +1,62 @@ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2005, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Structure for decoding tables. Each entry provides either the + information needed to do the operation requested by the code that + indexed that table entry, or it provides a pointer to another + table that indexes more bits of the code. op indicates whether + the entry is a pointer to another table, a literal, a length or + distance, an end-of-block, or an invalid code. For a table + pointer, the low four bits of op is the number of index bits of + that table. For a length or distance, the low four bits of op + is the number of extra bits to get after the code. bits is + the number of bits in this code or part of the code to drop off + of the bit buffer. val is the actual byte to output in the case + of a literal, the base length or distance, or the offset from + the current table to the next table. Each entry is four bytes. */ +typedef struct { + unsigned char op; /* operation, extra bits, table bits */ + unsigned char bits; /* bits in this part of the code */ + unsigned short val; /* offset in table or code value */ +} code; + +/* op values as set by inflate_table(): + 00000000 - literal + 0000tttt - table link, tttt != 0 is the number of table index bits + 0001eeee - length or distance, eeee is the number of extra bits + 01100000 - end of block + 01000000 - invalid code + */ + +/* Maximum size of the dynamic table. The maximum number of code structures is + 1444, which is the sum of 852 for literal/length codes and 592 for distance + codes. These values were found by exhaustive searches using the program + examples/enough.c found in the zlib distribtution. The arguments to that + program are the number of symbols, the initial root table size, and the + maximum bit length of a code. "enough 286 9 15" for literal/length codes + returns returns 852, and "enough 30 6 15" for distance codes returns 592. + The initial root table size (9 or 6) is found in the fifth argument of the + inflate_table() calls in inflate.c and infback.c. If the root table size is + changed, then these maximum sizes would be need to be recalculated and + updated. */ +#define ENOUGH_LENS 852 +#define ENOUGH_DISTS 592 +#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) + +/* Type of code to build for inflate_table() */ +typedef enum { + CODES, + LENS, + DISTS +} codetype; + +int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work)); diff --git a/thirdparty/zlib/zlib-1.2.7/lib/libz.a b/thirdparty/zlib/zlib-1.2.7/lib/libz.a new file mode 100644 index 0000000..aff2337 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/lib/libz.a differ diff --git a/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7.lib b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7.lib new file mode 100644 index 0000000..dacdea6 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7.lib differ diff --git a/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64.lib b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64.lib new file mode 100644 index 0000000..e8dd543 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64.lib differ diff --git a/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64d.lib b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64d.lib new file mode 100644 index 0000000..ec985e3 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7_64d.lib differ diff --git a/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7d.lib b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7d.lib new file mode 100644 index 0000000..df7a1d3 Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/lib/zlib-1.2.7d.lib differ diff --git a/thirdparty/zlib/zlib-1.2.7/make_vms.com b/thirdparty/zlib/zlib-1.2.7/make_vms.com new file mode 100644 index 0000000..65e9d0c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/make_vms.com @@ -0,0 +1,867 @@ +$! make libz under VMS written by +$! Martin P.J. Zinser +$! +$! In case of problems with the install you might contact me at +$! zinser@zinser.no-ip.info(preferred) or +$! martin.zinser@eurexchange.com (work) +$! +$! Make procedure history for Zlib +$! +$!------------------------------------------------------------------------------ +$! Version history +$! 0.01 20060120 First version to receive a number +$! 0.02 20061008 Adapt to new Makefile.in +$! 0.03 20091224 Add support for large file check +$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite +$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in +$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples +$! subdir path, update module search in makefile.in +$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned +$! shared image creation +$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared +$! image +$! 0.09 20120305 SMS. P1 sets builder ("MMK", "MMS", " " (built-in)). +$! "" -> automatic, preference: MMK, MMS, built-in. +$! +$ on error then goto err_exit +$! +$ true = 1 +$ false = 0 +$ tmpnam = "temp_" + f$getjpi("","pid") +$ tt = tmpnam + ".txt" +$ tc = tmpnam + ".c" +$ th = tmpnam + ".h" +$ define/nolog tconfig 'th' +$ its_decc = false +$ its_vaxc = false +$ its_gnuc = false +$ s_case = False +$! +$! Setup variables holding "config" information +$! +$ Make = "''p1'" +$ name = "Zlib" +$ version = "?.?.?" +$ v_string = "ZLIB_VERSION" +$ v_file = "zlib.h" +$ ccopt = "/include = []" +$ lopts = "" +$ dnsrl = "" +$ aconf_in_file = "zconf.h.in#zconf.h_in#zconf_h.in" +$ conf_check_string = "" +$ linkonly = false +$ optfile = name + ".opt" +$ mapfile = name + ".map" +$ libdefs = "" +$ vax = f$getsyi("HW_MODEL").lt.1024 +$ axp = f$getsyi("HW_MODEL").ge.1024 .and. f$getsyi("HW_MODEL").lt.4096 +$ ia64 = f$getsyi("HW_MODEL").ge.4096 +$! +$! 2012-03-05 SMS. +$! Why is this needed? And if it is needed, why not simply ".not. vax"? +$! +$!!! if axp .or. ia64 then set proc/parse=extended +$! +$ whoami = f$parse(f$environment("Procedure"),,,,"NO_CONCEAL") +$ mydef = F$parse(whoami,,,"DEVICE") +$ mydir = f$parse(whoami,,,"DIRECTORY") - "][" +$ myproc = f$parse(whoami,,,"Name") + f$parse(whoami,,,"type") +$! +$! Check for MMK/MMS +$! +$ if (Make .eqs. "") +$ then +$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS" +$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK" +$ else +$ Make = f$edit( Make, "trim") +$ endif +$! +$ gosub find_version +$! +$ open/write topt tmp.opt +$ open/write optf 'optfile' +$! +$ gosub check_opts +$! +$! Look for the compiler used +$! +$ gosub check_compiler +$ close topt +$ close optf +$! +$ if its_decc +$ then +$ ccopt = "/prefix=all" + ccopt +$ if f$trnlnm("SYS") .eqs. "" +$ then +$ if axp +$ then +$ define sys sys$library: +$ else +$ ccopt = "/decc" + ccopt +$ define sys decc$library_include: +$ endif +$ endif +$! +$! 2012-03-05 SMS. +$! Why /NAMES = AS_IS? Why not simply ".not. vax"? And why not on VAX? +$! +$ if axp .or. ia64 +$ then +$ ccopt = ccopt + "/name=as_is/opt=(inline=speed)" +$ s_case = true +$ endif +$ endif +$ if its_vaxc .or. its_gnuc +$ then +$ if f$trnlnm("SYS").eqs."" then define sys sys$library: +$ endif +$! +$! Build a fake configure input header +$! +$ open/write conf_hin config.hin +$ write conf_hin "#undef _LARGEFILE64_SOURCE" +$ close conf_hin +$! +$! +$ i = 0 +$FIND_ACONF: +$ fname = f$element(i,"#",aconf_in_file) +$ if fname .eqs. "#" then goto AMISS_ERR +$ if f$search(fname) .eqs. "" +$ then +$ i = i + 1 +$ goto find_aconf +$ endif +$ open/read/err=aconf_err aconf_in 'fname' +$ open/write aconf zconf.h +$ACONF_LOOP: +$ read/end_of_file=aconf_exit aconf_in line +$ work = f$edit(line, "compress,trim") +$ if f$extract(0,6,work) .nes. "#undef" +$ then +$ if f$extract(0,12,work) .nes. "#cmakedefine" +$ then +$ write aconf line +$ endif +$ else +$ cdef = f$element(1," ",work) +$ gosub check_config +$ endif +$ goto aconf_loop +$ACONF_EXIT: +$ write aconf "" +$ write aconf "/* VMS specifics added by make_vms.com: */" +$ write aconf "#define VMS 1" +$ write aconf "#include " +$ write aconf "#include " +$ write aconf "#ifdef _LARGEFILE" +$ write aconf "# define off64_t __off64_t" +$ write aconf "# define fopen64 fopen" +$ write aconf "# define fseeko64 fseeko" +$ write aconf "# define lseek64 lseek" +$ write aconf "# define ftello64 ftell" +$ write aconf "#endif" +$ write aconf "#if !defined( __VAX) && (__CRTL_VER >= 70312000)" +$ write aconf "# define HAVE_VSNPRINTF" +$ write aconf "#endif" +$ close aconf_in +$ close aconf +$ if f$search("''th'") .nes. "" then delete 'th';* +$! Build the thing plain or with mms +$! +$ write sys$output "Compiling Zlib sources ..." +$ if make.eqs."" +$ then +$ if (f$search( "example.obj;*") .nes. "") then delete example.obj;* +$ if (f$search( "minigzip.obj;*") .nes. "") then delete minigzip.obj;* +$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - + adler32.c zlib.h zconf.h +$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - + compress.c zlib.h zconf.h +$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - + crc32.c zlib.h zconf.h +$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - + deflate.c deflate.h zutil.h zlib.h zconf.h +$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - + gzclose.c zutil.h zlib.h zconf.h +$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - + gzlib.c zutil.h zlib.h zconf.h +$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - + gzread.c zutil.h zlib.h zconf.h +$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - + gzwrite.c zutil.h zlib.h zconf.h +$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - + infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h +$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - + inffast.c zutil.h zlib.h zconf.h inffast.h +$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - + inflate.c zutil.h zlib.h zconf.h infblock.h +$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - + inftrees.c zutil.h zlib.h zconf.h inftrees.h +$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - + trees.c deflate.h zutil.h zlib.h zconf.h +$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - + uncompr.c zlib.h zconf.h +$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - + zutil.c zutil.h zlib.h zconf.h +$ write sys$output "Building Zlib ..." +$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ +$ write sys$output "Building example..." +$ CALL MAKE example.OBJ "CC ''CCOPT' [.test]example" - + [.test]example.c zlib.h zconf.h +$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb +$ write sys$output "Building minigzip..." +$ CALL MAKE minigzip.OBJ "CC ''CCOPT' [.test]minigzip" - + [.test]minigzip.c zlib.h zconf.h +$ call make minigzip.exe - + "LINK minigzip,libz.olb/lib" - + minigzip.obj libz.olb +$ else +$ gosub crea_mms +$ write sys$output "Make ''name' ''version' with ''Make' " +$ 'make' +$ endif +$! +$! Create shareable image +$! +$ gosub crea_olist +$ write sys$output "Creating libzshr.exe" +$ call map_2_shopt 'mapfile' 'optfile' +$ LINK_'lopts'/SHARE=libzshr.exe modules.opt/opt,'optfile'/opt +$ write sys$output "Zlib build completed" +$ delete/nolog tmp.opt;* +$ exit +$AMISS_ERR: +$ write sys$output "No source for config.hin found." +$ write sys$output "Tried any of ''aconf_in_file'" +$ goto err_exit +$CC_ERR: +$ write sys$output "C compiler required to build ''name'" +$ goto err_exit +$ERR_EXIT: +$ set message/facil/ident/sever/text +$ close/nolog optf +$ close/nolog topt +$ close/nolog aconf_in +$ close/nolog aconf +$ close/nolog out +$ close/nolog min +$ close/nolog mod +$ close/nolog h_in +$ write sys$output "Exiting..." +$ exit 2 +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 - P8 What it depends on +$ +$ If F$Search(P1) .Eqs. "" Then Goto Makeit +$ Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(0) +$ write sys$output P2 +$ 'P2 +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE +$!------------------------------------------------------------------------------ +$! +$! Check command line options and set symbols accordingly +$! +$!------------------------------------------------------------------------------ +$! Version history +$! 0.01 20041206 First version to receive a number +$! 0.02 20060126 Add new "HELP" target +$ CHECK_OPTS: +$ i = 1 +$ OPT_LOOP: +$ if i .lt. 9 +$ then +$ cparm = f$edit(p'i',"upcase") +$! +$! Check if parameter actually contains something +$! +$ if f$edit(cparm,"trim") .nes. "" +$ then +$ if cparm .eqs. "DEBUG" +$ then +$ ccopt = ccopt + "/noopt/deb" +$ lopts = lopts + "/deb" +$ endif +$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm) +$ then +$ start = f$locate("=",cparm) + 1 +$ len = f$length(cparm) - start +$ ccopt = ccopt + f$extract(start,len,cparm) +$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) - + then s_case = true +$ endif +$ if cparm .eqs. "LINK" then linkonly = true +$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm) +$ then +$ start = f$locate("=",cparm) + 1 +$ len = f$length(cparm) - start +$ lopts = lopts + f$extract(start,len,cparm) +$ endif +$ if f$locate("CC=",cparm) .lt. f$length(cparm) +$ then +$ start = f$locate("=",cparm) + 1 +$ len = f$length(cparm) - start +$ cc_com = f$extract(start,len,cparm) + if (cc_com .nes. "DECC") .and. - + (cc_com .nes. "VAXC") .and. - + (cc_com .nes. "GNUC") +$ then +$ write sys$output "Unsupported compiler choice ''cc_com' ignored" +$ write sys$output "Use DECC, VAXC, or GNUC instead" +$ else +$ if cc_com .eqs. "DECC" then its_decc = true +$ if cc_com .eqs. "VAXC" then its_vaxc = true +$ if cc_com .eqs. "GNUC" then its_gnuc = true +$ endif +$ endif +$ if f$locate("MAKE=",cparm) .lt. f$length(cparm) +$ then +$ start = f$locate("=",cparm) + 1 +$ len = f$length(cparm) - start +$ mmks = f$extract(start,len,cparm) +$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS") +$ then +$ make = mmks +$ else +$ write sys$output "Unsupported make choice ''mmks' ignored" +$ write sys$output "Use MMK or MMS instead" +$ endif +$ endif +$ if cparm .eqs. "HELP" then gosub bhelp +$ endif +$ i = i + 1 +$ goto opt_loop +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! Look for the compiler used +$! +$! Version history +$! 0.01 20040223 First version to receive a number +$! 0.02 20040229 Save/set value of decc$no_rooted_search_lists +$! 0.03 20060202 Extend handling of GNU C +$! 0.04 20090402 Compaq -> hp +$CHECK_COMPILER: +$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) +$ then +$ its_decc = (f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "") +$ its_vaxc = .not. its_decc .and. (F$Search("SYS$System:VAXC.Exe") .nes. "") +$ its_gnuc = .not. (its_decc .or. its_vaxc) .and. (f$trnlnm("gnu_cc") .nes. "") +$ endif +$! +$! Exit if no compiler available +$! +$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc)) +$ then goto CC_ERR +$ else +$ if its_decc +$ then +$ write sys$output "CC compiler check ... hp C" +$ if f$trnlnm("decc$no_rooted_search_lists") .nes. "" +$ then +$ dnrsl = f$trnlnm("decc$no_rooted_search_lists") +$ endif +$ define/nolog decc$no_rooted_search_lists 1 +$ else +$ if its_vaxc then write sys$output "CC compiler check ... VAX C" +$ if its_gnuc +$ then +$ write sys$output "CC compiler check ... GNU C" +$ if f$trnlnm(topt) then write topt "gnu_cc:[000000]gcclib.olb/lib" +$ if f$trnlnm(optf) then write optf "gnu_cc:[000000]gcclib.olb/lib" +$ cc = "gcc" +$ endif +$ if f$trnlnm(topt) then write topt "sys$share:vaxcrtl.exe/share" +$ if f$trnlnm(optf) then write optf "sys$share:vaxcrtl.exe/share" +$ endif +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! If MMS/MMK are available dump out the descrip.mms if required +$! +$CREA_MMS: +$ write sys$output "Creating descrip.mms..." +$ create descrip.mms +$ open/append out descrip.mms +$ copy sys$input: out +$ deck +# descrip.mms: MMS description file for building zlib on VMS +# written by Martin P.J. Zinser +# + +OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\ + gzread.obj, gzwrite.obj, uncompr.obj, infback.obj\ + deflate.obj, trees.obj, zutil.obj, inflate.obj, \ + inftrees.obj, inffast.obj + +$ eod +$ write out "CFLAGS=", ccopt +$ write out "LOPTS=", lopts +$ write out "all : example.exe minigzip.exe libz.olb" +$ copy sys$input: out +$ deck + @ write sys$output " Example applications available" + +libz.olb : libz.olb($(OBJS)) + @ write sys$output " libz available" + +example.exe : example.obj libz.olb + link $(LOPTS) example,libz.olb/lib + +minigzip.exe : minigzip.obj libz.olb + link $(LOPTS) minigzip,libz.olb/lib + +clean : + delete *.obj;*,libz.olb;*,*.opt;*,*.exe;* + + +# Other dependencies. +adler32.obj : adler32.c zutil.h zlib.h zconf.h +compress.obj : compress.c zlib.h zconf.h +crc32.obj : crc32.c zutil.h zlib.h zconf.h +deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h +example.obj : [.test]example.c zlib.h zconf.h +gzclose.obj : gzclose.c zutil.h zlib.h zconf.h +gzlib.obj : gzlib.c zutil.h zlib.h zconf.h +gzread.obj : gzread.c zutil.h zlib.h zconf.h +gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h +inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h +inflate.obj : inflate.c zutil.h zlib.h zconf.h +inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h +minigzip.obj : [.test]minigzip.c zlib.h zconf.h +trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h +uncompr.obj : uncompr.c zlib.h zconf.h +zutil.obj : zutil.c zutil.h zlib.h zconf.h +infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h +$ eod +$ close out +$ return +$!------------------------------------------------------------------------------ +$! +$! Read list of core library sources from makefile.in and create options +$! needed to build shareable image +$! +$CREA_OLIST: +$ open/read min makefile.in +$ open/write mod modules.opt +$ src_check_list = "OBJZ =#OBJG =" +$MRLOOP: +$ read/end=mrdone min rec +$ i = 0 +$SRC_CHECK_LOOP: +$ src_check = f$element(i, "#", src_check_list) +$ i = i+1 +$ if src_check .eqs. "#" then goto mrloop +$ if (f$extract(0,6,rec) .nes. src_check) then goto src_check_loop +$ rec = rec - src_check +$ gosub extra_filnam +$ if (f$element(1,"\",rec) .eqs. "\") then goto mrloop +$MRSLOOP: +$ read/end=mrdone min rec +$ gosub extra_filnam +$ if (f$element(1,"\",rec) .nes. "\") then goto mrsloop +$MRDONE: +$ close min +$ close mod +$ return +$!------------------------------------------------------------------------------ +$! +$! Take record extracted in crea_olist and split it into single filenames +$! +$EXTRA_FILNAM: +$ myrec = f$edit(rec - "\", "trim,compress") +$ i = 0 +$FELOOP: +$ srcfil = f$element(i," ", myrec) +$ if (srcfil .nes. " ") +$ then +$ write mod f$parse(srcfil,,,"NAME"), ".obj" +$ i = i + 1 +$ goto feloop +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! Find current Zlib version number +$! +$FIND_VERSION: +$ open/read h_in 'v_file' +$hloop: +$ read/end=hdone h_in rec +$ rec = f$edit(rec,"TRIM") +$ if (f$extract(0,1,rec) .nes. "#") then goto hloop +$ rec = f$edit(rec - "#", "TRIM") +$ if f$element(0," ",rec) .nes. "define" then goto hloop +$ if f$element(1," ",rec) .eqs. v_string +$ then +$ version = 'f$element(2," ",rec)' +$ goto hdone +$ endif +$ goto hloop +$hdone: +$ close h_in +$ return +$!------------------------------------------------------------------------------ +$! +$CHECK_CONFIG: +$! +$ in_ldef = f$locate(cdef,libdefs) +$ if (in_ldef .lt. f$length(libdefs)) +$ then +$ write aconf "#define ''cdef' 1" +$ libdefs = f$extract(0,in_ldef,libdefs) + - + f$extract(in_ldef + f$length(cdef) + 1, - + f$length(libdefs) - in_ldef - f$length(cdef) - 1, - + libdefs) +$ else +$ if (f$type('cdef') .eqs. "INTEGER") +$ then +$ write aconf "#define ''cdef' ", 'cdef' +$ else +$ if (f$type('cdef') .eqs. "STRING") +$ then +$ write aconf "#define ''cdef' ", """", '''cdef'', """" +$ else +$ gosub check_cc_def +$ endif +$ endif +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! Check if this is a define relating to the properties of the C/C++ +$! compiler +$! +$ CHECK_CC_DEF: +$ if (cdef .eqs. "_LARGEFILE64_SOURCE") +$ then +$ copy sys$input: 'tc' +$ deck +#include "tconfig" +#define _LARGEFILE +#include + +int main(){ +FILE *fp; + fp = fopen("temp.txt","r"); + fseeko(fp,1,SEEK_SET); + fclose(fp); +} + +$ eod +$ test_inv = false +$ comm_h = false +$ gosub cc_prop_check +$ return +$ endif +$ write aconf "/* ", line, " */" +$ return +$!------------------------------------------------------------------------------ +$! +$! Check for properties of C/C++ compiler +$! +$! Version history +$! 0.01 20031020 First version to receive a number +$! 0.02 20031022 Added logic for defines with value +$! 0.03 20040309 Make sure local config file gets not deleted +$! 0.04 20041230 Also write include for configure run +$! 0.05 20050103 Add processing of "comment defines" +$CC_PROP_CHECK: +$ cc_prop = true +$ is_need = false +$ is_need = (f$extract(0,4,cdef) .eqs. "NEED") .or. (test_inv .eq. true) +$ if f$search(th) .eqs. "" then create 'th' +$ set message/nofac/noident/nosever/notext +$ on error then continue +$ cc 'tmpnam' +$ if .not. ($status) then cc_prop = false +$ on error then continue +$! The headers might lie about the capabilities of the RTL +$ link 'tmpnam',tmp.opt/opt +$ if .not. ($status) then cc_prop = false +$ set message/fac/ident/sever/text +$ on error then goto err_exit +$ delete/nolog 'tmpnam'.*;*/exclude='th' +$ if (cc_prop .and. .not. is_need) .or. - + (.not. cc_prop .and. is_need) +$ then +$ write sys$output "Checking for ''cdef'... yes" +$ if f$type('cdef_val'_yes) .nes. "" +$ then +$ if f$type('cdef_val'_yes) .eqs. "INTEGER" - + then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_yes) +$ if f$type('cdef_val'_yes) .eqs. "STRING" - + then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_yes) +$ else +$ call write_config f$fao("#define !AS 1",cdef) +$ endif +$ if (cdef .eqs. "HAVE_FSEEKO") .or. (cdef .eqs. "_LARGE_FILES") .or. - + (cdef .eqs. "_LARGEFILE64_SOURCE") then - + call write_config f$string("#define _LARGEFILE 1") +$ else +$ write sys$output "Checking for ''cdef'... no" +$ if (comm_h) +$ then + call write_config f$fao("/* !AS */",line) +$ else +$ if f$type('cdef_val'_no) .nes. "" +$ then +$ if f$type('cdef_val'_no) .eqs. "INTEGER" - + then call write_config f$fao("#define !AS !UL",cdef,'cdef_val'_no) +$ if f$type('cdef_val'_no) .eqs. "STRING" - + then call write_config f$fao("#define !AS !AS",cdef,'cdef_val'_no) +$ else +$ call write_config f$fao("#undef !AS",cdef) +$ endif +$ endif +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! Check for properties of C/C++ compiler with multiple result values +$! +$! Version history +$! 0.01 20040127 First version +$! 0.02 20050103 Reconcile changes from cc_prop up to version 0.05 +$CC_MPROP_CHECK: +$ cc_prop = true +$ i = 1 +$ idel = 1 +$ MT_LOOP: +$ if f$type(result_'i') .eqs. "STRING" +$ then +$ set message/nofac/noident/nosever/notext +$ on error then continue +$ cc 'tmpnam'_'i' +$ if .not. ($status) then cc_prop = false +$ on error then continue +$! The headers might lie about the capabilities of the RTL +$ link 'tmpnam'_'i',tmp.opt/opt +$ if .not. ($status) then cc_prop = false +$ set message/fac/ident/sever/text +$ on error then goto err_exit +$ delete/nolog 'tmpnam'_'i'.*;* +$ if (cc_prop) +$ then +$ write sys$output "Checking for ''cdef'... ", mdef_'i' +$ if f$type(mdef_'i') .eqs. "INTEGER" - + then call write_config f$fao("#define !AS !UL",cdef,mdef_'i') +$ if f$type('cdef_val'_yes) .eqs. "STRING" - + then call write_config f$fao("#define !AS !AS",cdef,mdef_'i') +$ goto msym_clean +$ else +$ i = i + 1 +$ goto mt_loop +$ endif +$ endif +$ write sys$output "Checking for ''cdef'... no" +$ call write_config f$fao("#undef !AS",cdef) +$ MSYM_CLEAN: +$ if (idel .le. msym_max) +$ then +$ delete/sym mdef_'idel' +$ idel = idel + 1 +$ goto msym_clean +$ endif +$ return +$!------------------------------------------------------------------------------ +$! +$! Write configuration to both permanent and temporary config file +$! +$! Version history +$! 0.01 20031029 First version to receive a number +$! +$WRITE_CONFIG: SUBROUTINE +$ write aconf 'p1' +$ open/append confh 'th' +$ write confh 'p1' +$ close confh +$ENDSUBROUTINE +$!------------------------------------------------------------------------------ +$! +$! Analyze the project map file and create the symbol vector for a shareable +$! image from it +$! +$! Version history +$! 0.01 20120128 First version +$! 0.02 20120226 Add pre-load logic +$! +$ MAP_2_SHOPT: Subroutine +$! +$ SAY := "WRITE_ SYS$OUTPUT" +$! +$ IF F$SEARCH("''P1'") .EQS. "" +$ THEN +$ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available" +$ goto exit_m2s +$ ENDIF +$ IF "''P2'" .EQS. "" +$ THEN +$ SAY "MAP_2_SHOPT: Error, no output file provided" +$ goto exit_m2s +$ ENDIF +$! +$ module1 = "deflate#deflateEnd#deflateInit_#deflateParams#deflateSetDictionary" +$ module2 = "gzclose#gzerror#gzgetc#gzgets#gzopen#gzprintf#gzputc#gzputs#gzread" +$ module3 = "gzseek#gztell#inflate#inflateEnd#inflateInit_#inflateSetDictionary" +$ module4 = "inflateSync#uncompress#zlibVersion#compress" +$ open/read map 'p1 +$ if axp .or. ia64 +$ then +$ open/write aopt a.opt +$ open/write bopt b.opt +$ write aopt " CASE_SENSITIVE=YES" +$ write bopt "SYMBOL_VECTOR= (-" +$ mod_sym_num = 1 +$ MOD_SYM_LOOP: +$ if f$type(module'mod_sym_num') .nes. "" +$ then +$ mod_in = 0 +$ MOD_SYM_IN: +$ shared_proc = f$element(mod_in, "#", module'mod_sym_num') +$ if shared_proc .nes. "#" +$ then +$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",- + f$edit(shared_proc,"upcase"),shared_proc) +$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc) +$ mod_in = mod_in + 1 +$ goto mod_sym_in +$ endif +$ mod_sym_num = mod_sym_num + 1 +$ goto mod_sym_loop +$ endif +$MAP_LOOP: +$ read/end=map_end map line +$ if (f$locate("{",line).lt. f$length(line)) .or. - + (f$locate("global:", line) .lt. f$length(line)) +$ then +$ proc = true +$ goto map_loop +$ endif +$ if f$locate("}",line).lt. f$length(line) then proc = false +$ if f$locate("local:", line) .lt. f$length(line) then proc = false +$ if proc +$ then +$ shared_proc = f$edit(line,"collapse") +$ chop_semi = f$locate(";", shared_proc) +$ if chop_semi .lt. f$length(shared_proc) then - + shared_proc = f$extract(0, chop_semi, shared_proc) +$ write aopt f$fao(" symbol_vector=(!AS/!AS=PROCEDURE)",- + f$edit(shared_proc,"upcase"),shared_proc) +$ write bopt f$fao("!AS=PROCEDURE,-",shared_proc) +$ endif +$ goto map_loop +$MAP_END: +$ close/nolog aopt +$ close/nolog bopt +$ open/append libopt 'p2' +$ open/read aopt a.opt +$ open/read bopt b.opt +$ALOOP: +$ read/end=aloop_end aopt line +$ write libopt line +$ goto aloop +$ALOOP_END: +$ close/nolog aopt +$ sv = "" +$BLOOP: +$ read/end=bloop_end bopt svn +$ if (svn.nes."") +$ then +$ if (sv.nes."") then write libopt sv +$ sv = svn +$ endif +$ goto bloop +$BLOOP_END: +$ write libopt f$extract(0,f$length(sv)-2,sv), "-" +$ write libopt ")" +$ close/nolog bopt +$ delete/nolog/noconf a.opt;*,b.opt;* +$ else +$ if vax +$ then +$ open/append libopt 'p2' +$ mod_sym_num = 1 +$ VMOD_SYM_LOOP: +$ if f$type(module'mod_sym_num') .nes. "" +$ then +$ mod_in = 0 +$ VMOD_SYM_IN: +$ shared_proc = f$element(mod_in, "#", module'mod_sym_num') +$ if shared_proc .nes. "#" +$ then +$ write libopt f$fao("UNIVERSAL=!AS",- + f$edit(shared_proc,"upcase")) +$ mod_in = mod_in + 1 +$ goto vmod_sym_in +$ endif +$ mod_sym_num = mod_sym_num + 1 +$ goto vmod_sym_loop +$ endif +$VMAP_LOOP: +$ read/end=vmap_end map line +$ if (f$locate("{",line).lt. f$length(line)) .or. - + (f$locate("global:", line) .lt. f$length(line)) +$ then +$ proc = true +$ goto vmap_loop +$ endif +$ if f$locate("}",line).lt. f$length(line) then proc = false +$ if f$locate("local:", line) .lt. f$length(line) then proc = false +$ if proc +$ then +$ shared_proc = f$edit(line,"collapse") +$ chop_semi = f$locate(";", shared_proc) +$ if chop_semi .lt. f$length(shared_proc) then - + shared_proc = f$extract(0, chop_semi, shared_proc) +$ write libopt f$fao("UNIVERSAL=!AS",- + f$edit(shared_proc,"upcase")) +$ endif +$ goto vmap_loop +$VMAP_END: +$ else +$ write sys$output "Unknown Architecture (Not VAX, AXP, or IA64)" +$ write sys$output "No options file created" +$ endif +$ endif +$ EXIT_M2S: +$ close/nolog map +$ close/nolog libopt +$ endsubroutine diff --git a/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.bor b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.bor new file mode 100644 index 0000000..3d12a2c --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.bor @@ -0,0 +1,115 @@ +# Makefile for zlib +# Borland C++ +# Last updated: 15-Mar-2003 + +# To use, do "make -fmakefile.bor" +# To compile in small model, set below: MODEL=s + +# WARNING: the small model is supported but only for small values of +# MAX_WBITS and MAX_MEM_LEVEL. For example: +# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3 +# If you wish to reduce the memory requirements (default 256K for big +# objects plus a few K), you can add to the LOC macro below: +# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 +# See zconf.h for details about the memory requirements. + +# ------------ Turbo C++, Borland C++ ------------ + +# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) +# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_ZLIB) + +# type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. +CPU_TYP = 0 + +# memory model: one of s, m, c, l (small, medium, compact, large) +MODEL=l + +# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version +CC=bcc +LD=bcc +AR=tlib + +# compiler flags +# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0 +CFLAGS=-O2 -Z -m$(MODEL) $(LOC) + +LDFLAGS=-m$(MODEL) -f- + + +# variables +ZLIB_LIB = zlib_$(MODEL).lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj +OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj +OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(CFLAGS) $*.c + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + + +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + $(AR) $(ZLIB_LIB) $(OBJP2) + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) + +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +clean: + -del *.obj + -del *.lib + -del *.exe + -del zlib_*.bak + -del foo.gz diff --git a/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.dj2 b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.dj2 new file mode 100644 index 0000000..29b0395 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.dj2 @@ -0,0 +1,104 @@ +# Makefile for zlib. Modified for djgpp v2.0 by F. J. Donahoe, 3/15/96. +# Copyright (C) 1995-1998 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile, or to compile and test, type: +# +# make -fmakefile.dj2; make test -fmakefile.dj2 +# +# To install libz.a, zconf.h and zlib.h in the djgpp directories, type: +# +# make install -fmakefile.dj2 +# +# after first defining LIBRARY_PATH and INCLUDE_PATH in djgpp.env as +# in the sample below if the pattern of the DJGPP distribution is to +# be followed. Remember that, while 'es around <=> are ignored in +# makefiles, they are *not* in batch files or in djgpp.env. +# - - - - - +# [make] +# INCLUDE_PATH=%\>;INCLUDE_PATH%%\DJDIR%\include +# LIBRARY_PATH=%\>;LIBRARY_PATH%%\DJDIR%\lib +# BUTT=-m486 +# - - - - - +# Alternately, these variables may be defined below, overriding the values +# in djgpp.env, as +# INCLUDE_PATH=c:\usr\include +# LIBRARY_PATH=c:\usr\lib + +CC=gcc + +#CFLAGS=-MMD -O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-MMD -g -DDEBUG +CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ + -Wstrict-prototypes -Wmissing-prototypes + +# If cp.exe is available, replace "copy /Y" with "cp -fp" . +CP=copy /Y +# If gnu install.exe is available, replace $(CP) with ginstall. +INSTALL=$(CP) +# The default value of RM is "rm -f." If "rm.exe" is found, comment out: +RM=del +LDLIBS=-L. -lz +LD=$(CC) -s -o +LDSHARED=$(CC) + +INCL=zlib.h zconf.h +LIBS=libz.a + +AR=ar rcs + +prefix=/usr/local +exec_prefix = $(prefix) + +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ + uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o + +OBJA = +# to use the asm code: make OBJA=match.o + +TEST_OBJS = example.o minigzip.o + +all: example.exe minigzip.exe + +check: test +test: all + ./example + echo hello world | .\minigzip | .\minigzip -d + +%.o : %.c + $(CC) $(CFLAGS) -c $< -o $@ + +libz.a: $(OBJS) $(OBJA) + $(AR) $@ $(OBJS) $(OBJA) + +%.exe : %.o $(LIBS) + $(LD) $@ $< $(LDLIBS) + +# INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . + +.PHONY : uninstall clean + +install: $(INCL) $(LIBS) + -@if not exist $(INCLUDE_PATH)\nul mkdir $(INCLUDE_PATH) + -@if not exist $(LIBRARY_PATH)\nul mkdir $(LIBRARY_PATH) + $(INSTALL) zlib.h $(INCLUDE_PATH) + $(INSTALL) zconf.h $(INCLUDE_PATH) + $(INSTALL) libz.a $(LIBRARY_PATH) + +uninstall: + $(RM) $(INCLUDE_PATH)\zlib.h + $(RM) $(INCLUDE_PATH)\zconf.h + $(RM) $(LIBRARY_PATH)\libz.a + +clean: + $(RM) *.d + $(RM) *.o + $(RM) *.exe + $(RM) libz.a + $(RM) foo.gz + +DEPS := $(wildcard *.d) +ifneq ($(DEPS),) +include $(DEPS) +endif diff --git a/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.emx b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.emx new file mode 100644 index 0000000..9c1b57a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.emx @@ -0,0 +1,69 @@ +# Makefile for zlib. Modified for emx 0.9c by Chr. Spieler, 6/17/98. +# Copyright (C) 1995-1998 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile, or to compile and test, type: +# +# make -fmakefile.emx; make test -fmakefile.emx +# + +CC=gcc + +#CFLAGS=-MMD -O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-MMD -g -DDEBUG +CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ + -Wstrict-prototypes -Wmissing-prototypes + +# If cp.exe is available, replace "copy /Y" with "cp -fp" . +CP=copy /Y +# If gnu install.exe is available, replace $(CP) with ginstall. +INSTALL=$(CP) +# The default value of RM is "rm -f." If "rm.exe" is found, comment out: +RM=del +LDLIBS=-L. -lzlib +LD=$(CC) -s -o +LDSHARED=$(CC) + +INCL=zlib.h zconf.h +LIBS=zlib.a + +AR=ar rcs + +prefix=/usr/local +exec_prefix = $(prefix) + +OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \ + uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o + +TEST_OBJS = example.o minigzip.o + +all: example.exe minigzip.exe + +test: all + ./example + echo hello world | .\minigzip | .\minigzip -d + +%.o : %.c + $(CC) $(CFLAGS) -c $< -o $@ + +zlib.a: $(OBJS) + $(AR) $@ $(OBJS) + +%.exe : %.o $(LIBS) + $(LD) $@ $< $(LDLIBS) + + +.PHONY : clean + +clean: + $(RM) *.d + $(RM) *.o + $(RM) *.exe + $(RM) zlib.a + $(RM) foo.gz + +DEPS := $(wildcard *.d) +ifneq ($(DEPS),) +include $(DEPS) +endif diff --git a/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.msc b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.msc new file mode 100644 index 0000000..ae83786 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.msc @@ -0,0 +1,112 @@ +# Makefile for zlib +# Microsoft C 5.1 or later +# Last updated: 19-Mar-2003 + +# To use, do "make makefile.msc" +# To compile in small model, set below: MODEL=S + +# If you wish to reduce the memory requirements (default 256K for big +# objects plus a few K), you can add to the LOC macro below: +# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 +# See zconf.h for details about the memory requirements. + +# ------------- Microsoft C 5.1 and later ------------- + +# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) +# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added +# to the declaration of LOC here: +LOC = $(LOCAL_ZLIB) + +# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. +CPU_TYP = 0 + +# Memory model: one of S, M, C, L (small, medium, compact, large) +MODEL=L + +CC=cl +CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC) +#-Ox generates bad code with MSC 5.1 +LIB_CFLAGS=-Zl $(CFLAGS) + +LD=link +LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode +# "/farcall/packcode" are only useful for `large code' memory models +# but should be a "no-op" for small code models. + + +# variables +ZLIB_LIB = zlib_$(MODEL).lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(LIB_CFLAGS) $*.c + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + $(CC) -c $(CFLAGS) $*.c + +minigzip.obj: test/minigzip.c zlib.h zconf.h + $(CC) -c $(CFLAGS) $*.c + + +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) + if exist $(ZLIB_LIB) del $(ZLIB_LIB) + lib $(ZLIB_LIB) $(OBJ1); + lib $(ZLIB_LIB) $(OBJ2); + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB); + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB); + +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +clean: + -del *.obj + -del *.lib + -del *.exe + -del *.map + -del zlib_*.bak + -del foo.gz diff --git a/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.tc b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.tc new file mode 100644 index 0000000..5aec82a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/msdos/Makefile.tc @@ -0,0 +1,100 @@ +# Makefile for zlib +# Turbo C 2.01, Turbo C++ 1.01 +# Last updated: 15-Mar-2003 + +# To use, do "make -fmakefile.tc" +# To compile in small model, set below: MODEL=s + +# WARNING: the small model is supported but only for small values of +# MAX_WBITS and MAX_MEM_LEVEL. For example: +# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 +# If you wish to reduce the memory requirements (default 256K for big +# objects plus a few K), you can add to CFLAGS below: +# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 +# See zconf.h for details about the memory requirements. + +# ------------ Turbo C 2.01, Turbo C++ 1.01 ------------ +MODEL=l +CC=tcc +LD=tcc +AR=tlib +# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 +CFLAGS=-O2 -G -Z -m$(MODEL) +LDFLAGS=-m$(MODEL) -f- + + +# variables +ZLIB_LIB = zlib_$(MODEL).lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj +OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj +OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(CFLAGS) $*.c + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + + +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + $(AR) $(ZLIB_LIB) $(OBJP2) + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) + +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +clean: + -del *.obj + -del *.lib + -del *.exe + -del zlib_*.bak + -del foo.gz diff --git a/thirdparty/zlib/zlib-1.2.7/nintendods/Makefile b/thirdparty/zlib/zlib-1.2.7/nintendods/Makefile new file mode 100644 index 0000000..21337d0 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/nintendods/Makefile @@ -0,0 +1,126 @@ +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- + +ifeq ($(strip $(DEVKITARM)),) +$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") +endif + +include $(DEVKITARM)/ds_rules + +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# DATA is a list of directories containing data files +# INCLUDES is a list of directories containing header files +#--------------------------------------------------------------------------------- +TARGET := $(shell basename $(CURDIR)) +BUILD := build +SOURCES := ../../ +DATA := data +INCLUDES := include + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +ARCH := -mthumb -mthumb-interwork + +CFLAGS := -Wall -O2\ + -march=armv5te -mtune=arm946e-s \ + -fomit-frame-pointer -ffast-math \ + $(ARCH) + +CFLAGS += $(INCLUDE) -DARM9 +CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions + +ASFLAGS := $(ARCH) -march=armv5te -mtune=arm946e-s +LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := $(LIBNDS) + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- + +export OUTPUT := $(CURDIR)/lib/libz.a + +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ + $(foreach dir,$(DATA),$(CURDIR)/$(dir)) + +export DEPSDIR := $(CURDIR)/$(BUILD) + +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) + +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) +#--------------------------------------------------------------------------------- + export LD := $(CC) +#--------------------------------------------------------------------------------- +else +#--------------------------------------------------------------------------------- + export LD := $(CXX) +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- + +export OFILES := $(addsuffix .o,$(BINFILES)) \ + $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) + +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +.PHONY: $(BUILD) clean all + +#--------------------------------------------------------------------------------- +all: $(BUILD) + @[ -d $@ ] || mkdir -p include + @cp ../../*.h include + +lib: + @[ -d $@ ] || mkdir -p $@ + +$(BUILD): lib + @[ -d $@ ] || mkdir -p $@ + @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) lib + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +$(OUTPUT) : $(OFILES) + +#--------------------------------------------------------------------------------- +%.bin.o : %.bin +#--------------------------------------------------------------------------------- + @echo $(notdir $<) + @$(bin2o) + + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------------- diff --git a/thirdparty/zlib/zlib-1.2.7/nintendods/README b/thirdparty/zlib/zlib-1.2.7/nintendods/README new file mode 100644 index 0000000..ba7a37d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/nintendods/README @@ -0,0 +1,5 @@ +This Makefile requires devkitARM (http://www.devkitpro.org/category/devkitarm/) and works inside "contrib/nds". It is based on a devkitARM template. + +Eduardo Costa +January 3, 2009 + diff --git a/thirdparty/zlib/zlib-1.2.7/old/Makefile.emx b/thirdparty/zlib/zlib-1.2.7/old/Makefile.emx new file mode 100644 index 0000000..4d6ab0e --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/Makefile.emx @@ -0,0 +1,69 @@ +# Makefile for zlib. Modified for emx/rsxnt by Chr. Spieler, 6/16/98. +# Copyright (C) 1995-1998 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile, or to compile and test, type: +# +# make -fmakefile.emx; make test -fmakefile.emx +# + +CC=gcc -Zwin32 + +#CFLAGS=-MMD -O +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-MMD -g -DDEBUG +CFLAGS=-MMD -O3 $(BUTT) -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ + -Wstrict-prototypes -Wmissing-prototypes + +# If cp.exe is available, replace "copy /Y" with "cp -fp" . +CP=copy /Y +# If gnu install.exe is available, replace $(CP) with ginstall. +INSTALL=$(CP) +# The default value of RM is "rm -f." If "rm.exe" is found, comment out: +RM=del +LDLIBS=-L. -lzlib +LD=$(CC) -s -o +LDSHARED=$(CC) + +INCL=zlib.h zconf.h +LIBS=zlib.a + +AR=ar rcs + +prefix=/usr/local +exec_prefix = $(prefix) + +OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \ + gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o + +TEST_OBJS = example.o minigzip.o + +all: example.exe minigzip.exe + +test: all + ./example + echo hello world | .\minigzip | .\minigzip -d + +%.o : %.c + $(CC) $(CFLAGS) -c $< -o $@ + +zlib.a: $(OBJS) + $(AR) $@ $(OBJS) + +%.exe : %.o $(LIBS) + $(LD) $@ $< $(LDLIBS) + + +.PHONY : clean + +clean: + $(RM) *.d + $(RM) *.o + $(RM) *.exe + $(RM) zlib.a + $(RM) foo.gz + +DEPS := $(wildcard *.d) +ifneq ($(DEPS),) +include $(DEPS) +endif diff --git a/thirdparty/zlib/zlib-1.2.7/old/Makefile.riscos b/thirdparty/zlib/zlib-1.2.7/old/Makefile.riscos new file mode 100644 index 0000000..57e29d3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/Makefile.riscos @@ -0,0 +1,151 @@ +# Project: zlib_1_03 +# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430 +# test works out-of-the-box, installs `somewhere' on demand + +# Toolflags: +CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah +C++flags = -c -depend !Depend -IC: -throwback +Linkflags = -aif -c++ -o $@ +ObjAsmflags = -throwback -NoCache -depend !Depend +CMHGflags = +LibFileflags = -c -l -o $@ +Squeezeflags = -o $@ + +# change the line below to where _you_ want the library installed. +libdest = lib:zlib + +# Final targets: +@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ + @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ + @.o.uncompr @.o.zutil + LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ + @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ + @.o.trees @.o.uncompr @.o.zutil +test: @.minigzip @.example @.lib + @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV + @echo running tests: hang on. + @/@.minigzip -f -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -f -1 libc + @/@.minigzip -d libc-gz + @/@.minigzip -h -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -h -1 libc + @/@.minigzip -d libc-gz + @/@.minigzip -9 libc + @/@.minigzip -d libc-gz + @/@.minigzip -1 libc + @/@.minigzip -d libc-gz + @diff @.lib @.libc + @echo that should have reported '@.lib and @.libc identical' if you have diff. + @/@.example @.fred @.fred + @echo that will have given lots of hello!'s. + +@.minigzip: @.o.minigzip @.lib C:o.Stubs + Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs +@.example: @.o.example @.lib C:o.Stubs + Link $(Linkflags) @.o.example @.lib C:o.Stubs + +install: @.lib + cdir $(libdest) + cdir $(libdest).h + @copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV + @copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV + @copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV + @echo okay, installed zlib in $(libdest) + +clean:; remove @.minigzip + remove @.example + remove @.libc + -wipe @.o.* F~r~cV + remove @.fred + +# User-editable dependencies: +.c.o: + cc $(ccflags) -o $@ $< + +# Static dependencies: + +# Dynamic dependencies: +o.example: c.example +o.example: h.zlib +o.example: h.zconf +o.minigzip: c.minigzip +o.minigzip: h.zlib +o.minigzip: h.zconf +o.adler32: c.adler32 +o.adler32: h.zlib +o.adler32: h.zconf +o.compress: c.compress +o.compress: h.zlib +o.compress: h.zconf +o.crc32: c.crc32 +o.crc32: h.zlib +o.crc32: h.zconf +o.deflate: c.deflate +o.deflate: h.deflate +o.deflate: h.zutil +o.deflate: h.zlib +o.deflate: h.zconf +o.gzio: c.gzio +o.gzio: h.zutil +o.gzio: h.zlib +o.gzio: h.zconf +o.infblock: c.infblock +o.infblock: h.zutil +o.infblock: h.zlib +o.infblock: h.zconf +o.infblock: h.infblock +o.infblock: h.inftrees +o.infblock: h.infcodes +o.infblock: h.infutil +o.infcodes: c.infcodes +o.infcodes: h.zutil +o.infcodes: h.zlib +o.infcodes: h.zconf +o.infcodes: h.inftrees +o.infcodes: h.infblock +o.infcodes: h.infcodes +o.infcodes: h.infutil +o.infcodes: h.inffast +o.inffast: c.inffast +o.inffast: h.zutil +o.inffast: h.zlib +o.inffast: h.zconf +o.inffast: h.inftrees +o.inffast: h.infblock +o.inffast: h.infcodes +o.inffast: h.infutil +o.inffast: h.inffast +o.inflate: c.inflate +o.inflate: h.zutil +o.inflate: h.zlib +o.inflate: h.zconf +o.inflate: h.infblock +o.inftrees: c.inftrees +o.inftrees: h.zutil +o.inftrees: h.zlib +o.inftrees: h.zconf +o.inftrees: h.inftrees +o.inftrees: h.inffixed +o.infutil: c.infutil +o.infutil: h.zutil +o.infutil: h.zlib +o.infutil: h.zconf +o.infutil: h.infblock +o.infutil: h.inftrees +o.infutil: h.infcodes +o.infutil: h.infutil +o.trees: c.trees +o.trees: h.deflate +o.trees: h.zutil +o.trees: h.zlib +o.trees: h.zconf +o.trees: h.trees +o.uncompr: c.uncompr +o.uncompr: h.zlib +o.uncompr: h.zconf +o.zutil: c.zutil +o.zutil: h.zutil +o.zutil: h.zlib +o.zutil: h.zconf diff --git a/thirdparty/zlib/zlib-1.2.7/old/README b/thirdparty/zlib/zlib-1.2.7/old/README new file mode 100644 index 0000000..800bf07 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/README @@ -0,0 +1,3 @@ +This directory contains files that have not been updated for zlib 1.2.x + +(Volunteers are encouraged to help clean this up. Thanks.) diff --git a/thirdparty/zlib/zlib-1.2.7/old/descrip.mms b/thirdparty/zlib/zlib-1.2.7/old/descrip.mms new file mode 100644 index 0000000..7066da5 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/descrip.mms @@ -0,0 +1,48 @@ +# descrip.mms: MMS description file for building zlib on VMS +# written by Martin P.J. Zinser + +cc_defs = +c_deb = + +.ifdef __DECC__ +pref = /prefix=all +.endif + +OBJS = adler32.obj, compress.obj, crc32.obj, gzio.obj, uncompr.obj,\ + deflate.obj, trees.obj, zutil.obj, inflate.obj, infblock.obj,\ + inftrees.obj, infcodes.obj, infutil.obj, inffast.obj + +CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) + +all : example.exe minigzip.exe + @ write sys$output " Example applications available" +libz.olb : libz.olb($(OBJS)) + @ write sys$output " libz available" + +example.exe : example.obj libz.olb + link example,libz.olb/lib + +minigzip.exe : minigzip.obj libz.olb + link minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib + +clean : + delete *.obj;*,libz.olb;* + + +# Other dependencies. +adler32.obj : zutil.h zlib.h zconf.h +compress.obj : zlib.h zconf.h +crc32.obj : zutil.h zlib.h zconf.h +deflate.obj : deflate.h zutil.h zlib.h zconf.h +example.obj : zlib.h zconf.h +gzio.obj : zutil.h zlib.h zconf.h +infblock.obj : zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h +infcodes.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h +inffast.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h +inflate.obj : zutil.h zlib.h zconf.h infblock.h +inftrees.obj : zutil.h zlib.h zconf.h inftrees.h +infutil.obj : zutil.h zlib.h zconf.h inftrees.h infutil.h +minigzip.obj : zlib.h zconf.h +trees.obj : deflate.h zutil.h zlib.h zconf.h +uncompr.obj : zlib.h zconf.h +zutil.obj : zutil.h zlib.h zconf.h diff --git a/thirdparty/zlib/zlib-1.2.7/old/os2/Makefile.os2 b/thirdparty/zlib/zlib-1.2.7/old/os2/Makefile.os2 new file mode 100644 index 0000000..a105aaa --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/os2/Makefile.os2 @@ -0,0 +1,136 @@ +# Makefile for zlib under OS/2 using GCC (PGCC) +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile and test, type: +# cp Makefile.os2 .. +# cd .. +# make -f Makefile.os2 test + +# This makefile will build a static library z.lib, a shared library +# z.dll and a import library zdll.lib. You can use either z.lib or +# zdll.lib by specifying either -lz or -lzdll on gcc's command line + +CC=gcc -Zomf -s + +CFLAGS=-O6 -Wall +#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 +#CFLAGS=-g -DDEBUG +#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ +# -Wstrict-prototypes -Wmissing-prototypes + +#################### BUG WARNING: ##################### +## infcodes.c hits a bug in pgcc-1.0, so you have to use either +## -O# where # <= 4 or one of (-fno-ommit-frame-pointer or -fno-force-mem) +## This bug is reportedly fixed in pgcc >1.0, but this was not tested +CFLAGS+=-fno-force-mem + +LDFLAGS=-s -L. -lzdll -Zcrtdll +LDSHARED=$(CC) -s -Zomf -Zdll -Zcrtdll + +VER=1.1.0 +ZLIB=z.lib +SHAREDLIB=z.dll +SHAREDLIBIMP=zdll.lib +LIBS=$(ZLIB) $(SHAREDLIB) $(SHAREDLIBIMP) + +AR=emxomfar cr +IMPLIB=emximp +RANLIB=echo +TAR=tar +SHELL=bash + +prefix=/usr/local +exec_prefix = $(prefix) + +OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ + zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o + +TEST_OBJS = example.o minigzip.o + +DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ + algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ + nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \ + contrib/asm386/*.asm contrib/asm386/*.c \ + contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ + contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \ + contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 + +all: example.exe minigzip.exe + +test: all + @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ + echo hello world | ./minigzip | ./minigzip -d || \ + echo ' *** minigzip test FAILED ***' ; \ + if ./example; then \ + echo ' *** zlib test OK ***'; \ + else \ + echo ' *** zlib test FAILED ***'; \ + fi + +$(ZLIB): $(OBJS) + $(AR) $@ $(OBJS) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +$(SHAREDLIB): $(OBJS) os2/z.def + $(LDSHARED) -o $@ $^ + +$(SHAREDLIBIMP): os2/z.def + $(IMPLIB) -o $@ $^ + +example.exe: example.o $(LIBS) + $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) + +minigzip.exe: minigzip.o $(LIBS) + $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) + +clean: + rm -f *.o *~ example minigzip libz.a libz.so* foo.gz + +distclean: clean + +zip: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c + v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + zip -ul9 zlib$$v $(DISTFILES) + mv Makefile~ Makefile + +dist: + mv Makefile Makefile~; cp -p Makefile.in Makefile + rm -f test.c ztest*.c + d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ + rm -f $$d.tar.gz; \ + if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ + files=""; \ + for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \ + cd ..; \ + GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \ + if test ! -d $$d; then rm -f $$d; fi + mv Makefile~ Makefile + +tags: + etags *.[ch] + +depend: + makedepend -- $(CFLAGS) -- *.[ch] + +# DO NOT DELETE THIS LINE -- make depend depends on it. + +adler32.o: zlib.h zconf.h +compress.o: zlib.h zconf.h +crc32.o: zlib.h zconf.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +example.o: zlib.h zconf.h +gzio.o: zutil.h zlib.h zconf.h +infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h +infcodes.o: zutil.h zlib.h zconf.h +infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h +inffast.o: infblock.h infcodes.h infutil.h inffast.h +inflate.o: zutil.h zlib.h zconf.h infblock.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h +minigzip.o: zlib.h zconf.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h +uncompr.o: zlib.h zconf.h +zutil.o: zutil.h zlib.h zconf.h diff --git a/thirdparty/zlib/zlib-1.2.7/old/os2/zlib.def b/thirdparty/zlib/zlib-1.2.7/old/os2/zlib.def new file mode 100644 index 0000000..4c753f1 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/os2/zlib.def @@ -0,0 +1,51 @@ +; +; Slightly modified version of ../nt/zlib.dnt :-) +; + +LIBRARY Z +DESCRIPTION "Zlib compression library for OS/2" +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE + +EXPORTS + adler32 + compress + crc32 + deflate + deflateCopy + deflateEnd + deflateInit2_ + deflateInit_ + deflateParams + deflateReset + deflateSetDictionary + gzclose + gzdopen + gzerror + gzflush + gzopen + gzread + gzwrite + inflate + inflateEnd + inflateInit2_ + inflateInit_ + inflateReset + inflateSetDictionary + inflateSync + uncompress + zlibVersion + gzprintf + gzputc + gzgetc + gzseek + gzrewind + gztell + gzeof + gzsetparams + zError + inflateSyncPoint + get_crc_table + compress2 + gzputs + gzgets diff --git a/thirdparty/zlib/zlib-1.2.7/old/visual-basic.txt b/thirdparty/zlib/zlib-1.2.7/old/visual-basic.txt new file mode 100644 index 0000000..57efe58 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/old/visual-basic.txt @@ -0,0 +1,160 @@ +See below some functions declarations for Visual Basic. + +Frequently Asked Question: + +Q: Each time I use the compress function I get the -5 error (not enough + room in the output buffer). + +A: Make sure that the length of the compressed buffer is passed by + reference ("as any"), not by value ("as long"). Also check that + before the call of compress this length is equal to the total size of + the compressed buffer and not zero. + + +From: "Jon Caruana" +Subject: Re: How to port zlib declares to vb? +Date: Mon, 28 Oct 1996 18:33:03 -0600 + +Got the answer! (I haven't had time to check this but it's what I got, and +looks correct): + +He has the following routines working: + compress + uncompress + gzopen + gzwrite + gzread + gzclose + +Declares follow: (Quoted from Carlos Rios , in Vb4 form) + +#If Win16 Then 'Use Win16 calls. +Declare Function compress Lib "ZLIB.DLL" (ByVal compr As + String, comprLen As Any, ByVal buf As String, ByVal buflen + As Long) As Integer +Declare Function uncompress Lib "ZLIB.DLL" (ByVal uncompr + As String, uncomprLen As Any, ByVal compr As String, ByVal + lcompr As Long) As Integer +Declare Function gzopen Lib "ZLIB.DLL" (ByVal filePath As + String, ByVal mode As String) As Long +Declare Function gzread Lib "ZLIB.DLL" (ByVal file As + Long, ByVal uncompr As String, ByVal uncomprLen As Integer) + As Integer +Declare Function gzwrite Lib "ZLIB.DLL" (ByVal file As + Long, ByVal uncompr As String, ByVal uncomprLen As Integer) + As Integer +Declare Function gzclose Lib "ZLIB.DLL" (ByVal file As + Long) As Integer +#Else +Declare Function compress Lib "ZLIB32.DLL" + (ByVal compr As String, comprLen As Any, ByVal buf As + String, ByVal buflen As Long) As Integer +Declare Function uncompress Lib "ZLIB32.DLL" + (ByVal uncompr As String, uncomprLen As Any, ByVal compr As + String, ByVal lcompr As Long) As Long +Declare Function gzopen Lib "ZLIB32.DLL" + (ByVal file As String, ByVal mode As String) As Long +Declare Function gzread Lib "ZLIB32.DLL" + (ByVal file As Long, ByVal uncompr As String, ByVal + uncomprLen As Long) As Long +Declare Function gzwrite Lib "ZLIB32.DLL" + (ByVal file As Long, ByVal uncompr As String, ByVal + uncomprLen As Long) As Long +Declare Function gzclose Lib "ZLIB32.DLL" + (ByVal file As Long) As Long +#End If + +-Jon Caruana +jon-net@usa.net +Microsoft Sitebuilder Network Level 1 Member - HTML Writer's Guild Member + + +Here is another example from Michael that he +says conforms to the VB guidelines, and that solves the problem of not +knowing the uncompressed size by storing it at the end of the file: + +'Calling the functions: +'bracket meaning: [optional] {Range of possible values} +'Call subCompressFile( [, , [level of compression {1..9}]]) +'Call subUncompressFile() + +Option Explicit +Private lngpvtPcnSml As Long 'Stores value for 'lngPercentSmaller' +Private Const SUCCESS As Long = 0 +Private Const strFilExt As String = ".cpr" +Private Declare Function lngfncCpr Lib "zlib.dll" Alias "compress2" (ByRef +dest As Any, ByRef destLen As Any, ByRef src As Any, ByVal srcLen As Long, +ByVal level As Integer) As Long +Private Declare Function lngfncUcp Lib "zlib.dll" Alias "uncompress" (ByRef +dest As Any, ByRef destLen As Any, ByRef src As Any, ByVal srcLen As Long) +As Long + +Public Sub subCompressFile(ByVal strargOriFilPth As String, Optional ByVal +strargCprFilPth As String, Optional ByVal intLvl As Integer = 9) + Dim strCprPth As String + Dim lngOriSiz As Long + Dim lngCprSiz As Long + Dim bytaryOri() As Byte + Dim bytaryCpr() As Byte + lngOriSiz = FileLen(strargOriFilPth) + ReDim bytaryOri(lngOriSiz - 1) + Open strargOriFilPth For Binary Access Read As #1 + Get #1, , bytaryOri() + Close #1 + strCprPth = IIf(strargCprFilPth = "", strargOriFilPth, strargCprFilPth) +'Select file path and name + strCprPth = strCprPth & IIf(Right(strCprPth, Len(strFilExt)) = +strFilExt, "", strFilExt) 'Add file extension if not exists + lngCprSiz = (lngOriSiz * 1.01) + 12 'Compression needs temporary a bit +more space then original file size + ReDim bytaryCpr(lngCprSiz - 1) + If lngfncCpr(bytaryCpr(0), lngCprSiz, bytaryOri(0), lngOriSiz, intLvl) = +SUCCESS Then + lngpvtPcnSml = (1# - (lngCprSiz / lngOriSiz)) * 100 + ReDim Preserve bytaryCpr(lngCprSiz - 1) + Open strCprPth For Binary Access Write As #1 + Put #1, , bytaryCpr() + Put #1, , lngOriSiz 'Add the the original size value to the end +(last 4 bytes) + Close #1 + Else + MsgBox "Compression error" + End If + Erase bytaryCpr + Erase bytaryOri +End Sub + +Public Sub subUncompressFile(ByVal strargFilPth As String) + Dim bytaryCpr() As Byte + Dim bytaryOri() As Byte + Dim lngOriSiz As Long + Dim lngCprSiz As Long + Dim strOriPth As String + lngCprSiz = FileLen(strargFilPth) + ReDim bytaryCpr(lngCprSiz - 1) + Open strargFilPth For Binary Access Read As #1 + Get #1, , bytaryCpr() + Close #1 + 'Read the original file size value: + lngOriSiz = bytaryCpr(lngCprSiz - 1) * (2 ^ 24) _ + + bytaryCpr(lngCprSiz - 2) * (2 ^ 16) _ + + bytaryCpr(lngCprSiz - 3) * (2 ^ 8) _ + + bytaryCpr(lngCprSiz - 4) + ReDim Preserve bytaryCpr(lngCprSiz - 5) 'Cut of the original size value + ReDim bytaryOri(lngOriSiz - 1) + If lngfncUcp(bytaryOri(0), lngOriSiz, bytaryCpr(0), lngCprSiz) = SUCCESS +Then + strOriPth = Left(strargFilPth, Len(strargFilPth) - Len(strFilExt)) + Open strOriPth For Binary Access Write As #1 + Put #1, , bytaryOri() + Close #1 + Else + MsgBox "Uncompression error" + End If + Erase bytaryCpr + Erase bytaryOri +End Sub +Public Property Get lngPercentSmaller() As Long + lngPercentSmaller = lngpvtPcnSml +End Property diff --git a/thirdparty/zlib/zlib-1.2.7/prj/zlib/ipch/zlib-42795fac/zlib-affe1c5d.ipch b/thirdparty/zlib/zlib-1.2.7/prj/zlib/ipch/zlib-42795fac/zlib-affe1c5d.ipch new file mode 100644 index 0000000..cc65b6b Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/prj/zlib/ipch/zlib-42795fac/zlib-affe1c5d.ipch differ diff --git a/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.sln b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.sln new file mode 100644 index 0000000..263f634 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{3AB459C5-5369-4226-9442-0CAD256A7CF3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Debug|Win32.ActiveCfg = Debug|Win32 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Debug|Win32.Build.0 = Debug|Win32 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Debug|x64.ActiveCfg = Debug|x64 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Debug|x64.Build.0 = Debug|x64 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Release|Win32.ActiveCfg = Release|Win32 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Release|Win32.Build.0 = Release|Win32 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Release|x64.ActiveCfg = Release|x64 + {3AB459C5-5369-4226-9442-0CAD256A7CF3}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj new file mode 100644 index 0000000..b822dde --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj @@ -0,0 +1,146 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {3AB459C5-5369-4226-9442-0CAD256A7CF3} + zlib + + + + StaticLibrary + true + MultiByte + + + StaticLibrary + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + StaticLibrary + false + true + MultiByte + + + + + + + + + + + + + + + + + + + + + Level3 + Disabled + + + true + + + + + Level3 + Disabled + + + true + + + + + Level3 + MaxSpeed + true + true + + + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + + + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj.filters b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj.filters new file mode 100644 index 0000000..57cbbe4 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/prj/zlib/zlib.vcxproj.filters @@ -0,0 +1,99 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/thirdparty/zlib/zlib-1.2.7/qnx/package.qpg b/thirdparty/zlib/zlib-1.2.7/qnx/package.qpg new file mode 100644 index 0000000..26eed9b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/qnx/package.qpg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Library + + Medium + + 2.0 + + + + zlib + zlib + alain.bonnefoy@icbt.com + Public + public + www.gzip.org/zlib + + + Jean-Loup Gailly,Mark Adler + www.gzip.org/zlib + + zlib@gzip.org + + + A massively spiffy yet delicately unobtrusive compression library. + zlib is designed to be a free, general-purpose, legally unencumbered, lossless data compression library for use on virtually any computer hardware and operating system. + http://www.gzip.org/zlib + + + + + 1.2.7 + Medium + Stable + + + + + + + No License + + + + Software Development/Libraries and Extensions/C Libraries + zlib,compression + qnx6 + qnx6 + None + Developer + + + + + + + + + + + + + + Install + Post + No + Ignore + + No + Optional + + + + + + + + + + + + + InstallOver + zlib + + + + + + + + + + + + + InstallOver + zlib-dev + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/test/example.c b/thirdparty/zlib/zlib-1.2.7/test/example.c new file mode 100644 index 0000000..f515a48 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/test/example.c @@ -0,0 +1,601 @@ +/* example.c -- usage example of the zlib compression library + * Copyright (C) 1995-2006, 2011 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zlib.h" +#include + +#ifdef STDC +# include +# include +#endif + +#if defined(VMS) || defined(RISCOS) +# define TESTFILE "foo-gz" +#else +# define TESTFILE "foo.gz" +#endif + +#define CHECK_ERR(err, msg) { \ + if (err != Z_OK) { \ + fprintf(stderr, "%s error: %d\n", msg, err); \ + exit(1); \ + } \ +} + +const char hello[] = "hello, hello!"; +/* "hello world" would be more standard, but the repeated "hello" + * stresses the compression code better, sorry... + */ + +const char dictionary[] = "hello"; +uLong dictId; /* Adler32 value of the dictionary */ + +void test_deflate OF((Byte *compr, uLong comprLen)); +void test_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_large_deflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_large_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_flush OF((Byte *compr, uLong *comprLen)); +void test_sync OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_dict_deflate OF((Byte *compr, uLong comprLen)); +void test_dict_inflate OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +int main OF((int argc, char *argv[])); + + +#ifdef Z_SOLO + +void *myalloc OF((void *, unsigned, unsigned)); +void myfree OF((void *, void *)); + +void *myalloc(q, n, m) + void *q; + unsigned n, m; +{ + q = Z_NULL; + return calloc(n, m); +} + +void myfree(void *q, void *p) +{ + q = Z_NULL; + free(p); +} + +static alloc_func zalloc = myalloc; +static free_func zfree = myfree; + +#else /* !Z_SOLO */ + +static alloc_func zalloc = (alloc_func)0; +static free_func zfree = (free_func)0; + +void test_compress OF((Byte *compr, uLong comprLen, + Byte *uncompr, uLong uncomprLen)); +void test_gzio OF((const char *fname, + Byte *uncompr, uLong uncomprLen)); + +/* =========================================================================== + * Test compress() and uncompress() + */ +void test_compress(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + uLong len = (uLong)strlen(hello)+1; + + err = compress(compr, &comprLen, (const Bytef*)hello, len); + CHECK_ERR(err, "compress"); + + strcpy((char*)uncompr, "garbage"); + + err = uncompress(uncompr, &uncomprLen, compr, comprLen); + CHECK_ERR(err, "uncompress"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad uncompress\n"); + exit(1); + } else { + printf("uncompress(): %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Test read/write of .gz files + */ +void test_gzio(fname, uncompr, uncomprLen) + const char *fname; /* compressed file name */ + Byte *uncompr; + uLong uncomprLen; +{ +#ifdef NO_GZCOMPRESS + fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); +#else + int err; + int len = (int)strlen(hello)+1; + gzFile file; + z_off_t pos; + + file = gzopen(fname, "wb"); + if (file == NULL) { + fprintf(stderr, "gzopen error\n"); + exit(1); + } + gzputc(file, 'h'); + if (gzputs(file, "ello") != 4) { + fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err)); + exit(1); + } + if (gzprintf(file, ", %s!", "hello") != 8) { + fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err)); + exit(1); + } + gzseek(file, 1L, SEEK_CUR); /* add one zero byte */ + gzclose(file); + + file = gzopen(fname, "rb"); + if (file == NULL) { + fprintf(stderr, "gzopen error\n"); + exit(1); + } + strcpy((char*)uncompr, "garbage"); + + if (gzread(file, uncompr, (unsigned)uncomprLen) != len) { + fprintf(stderr, "gzread err: %s\n", gzerror(file, &err)); + exit(1); + } + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); + exit(1); + } else { + printf("gzread(): %s\n", (char*)uncompr); + } + + pos = gzseek(file, -8L, SEEK_CUR); + if (pos != 6 || gztell(file) != pos) { + fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", + (long)pos, (long)gztell(file)); + exit(1); + } + + if (gzgetc(file) != ' ') { + fprintf(stderr, "gzgetc error\n"); + exit(1); + } + + if (gzungetc(' ', file) != ' ') { + fprintf(stderr, "gzungetc error\n"); + exit(1); + } + + gzgets(file, (char*)uncompr, (int)uncomprLen); + if (strlen((char*)uncompr) != 7) { /* " hello!" */ + fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); + exit(1); + } + if (strcmp((char*)uncompr, hello + 6)) { + fprintf(stderr, "bad gzgets after gzseek\n"); + exit(1); + } else { + printf("gzgets() after gzseek: %s\n", (char*)uncompr); + } + + gzclose(file); +#endif +} + +#endif /* Z_SOLO */ + +/* =========================================================================== + * Test deflate() with small buffers + */ +void test_deflate(compr, comprLen) + Byte *compr; + uLong comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + uLong len = (uLong)strlen(hello)+1; + + c_stream.zalloc = zalloc; + c_stream.zfree = zfree; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_in = (Bytef*)hello; + c_stream.next_out = compr; + + while (c_stream.total_in != len && c_stream.total_out < comprLen) { + c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */ + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + } + /* Finish the stream, still forcing small buffers: */ + for (;;) { + c_stream.avail_out = 1; + err = deflate(&c_stream, Z_FINISH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "deflate"); + } + + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with small buffers + */ +void test_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = zalloc; + d_stream.zfree = zfree; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = 0; + d_stream.next_out = uncompr; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) { + d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */ + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "inflate"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad inflate\n"); + exit(1); + } else { + printf("inflate(): %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Test deflate() with large buffers and dynamic change of compression level + */ +void test_large_deflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + + c_stream.zalloc = zalloc; + c_stream.zfree = zfree; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_BEST_SPEED); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_out = compr; + c_stream.avail_out = (uInt)comprLen; + + /* At this point, uncompr is still mostly zeroes, so it should compress + * very well: + */ + c_stream.next_in = uncompr; + c_stream.avail_in = (uInt)uncomprLen; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + if (c_stream.avail_in != 0) { + fprintf(stderr, "deflate not greedy\n"); + exit(1); + } + + /* Feed in already compressed data and switch to no compression: */ + deflateParams(&c_stream, Z_NO_COMPRESSION, Z_DEFAULT_STRATEGY); + c_stream.next_in = compr; + c_stream.avail_in = (uInt)comprLen/2; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + + /* Switch back to compressing mode: */ + deflateParams(&c_stream, Z_BEST_COMPRESSION, Z_FILTERED); + c_stream.next_in = uncompr; + c_stream.avail_in = (uInt)uncomprLen; + err = deflate(&c_stream, Z_NO_FLUSH); + CHECK_ERR(err, "deflate"); + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + fprintf(stderr, "deflate should report Z_STREAM_END\n"); + exit(1); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with large buffers + */ +void test_large_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = zalloc; + d_stream.zfree = zfree; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = (uInt)comprLen; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + for (;;) { + d_stream.next_out = uncompr; /* discard the output */ + d_stream.avail_out = (uInt)uncomprLen; + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + CHECK_ERR(err, "large inflate"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (d_stream.total_out != 2*uncomprLen + comprLen/2) { + fprintf(stderr, "bad large inflate: %ld\n", d_stream.total_out); + exit(1); + } else { + printf("large_inflate(): OK\n"); + } +} + +/* =========================================================================== + * Test deflate() with full flush + */ +void test_flush(compr, comprLen) + Byte *compr; + uLong *comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + uInt len = (uInt)strlen(hello)+1; + + c_stream.zalloc = zalloc; + c_stream.zfree = zfree; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + c_stream.next_in = (Bytef*)hello; + c_stream.next_out = compr; + c_stream.avail_in = 3; + c_stream.avail_out = (uInt)*comprLen; + err = deflate(&c_stream, Z_FULL_FLUSH); + CHECK_ERR(err, "deflate"); + + compr[3]++; /* force an error in first compressed block */ + c_stream.avail_in = len - 3; + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + CHECK_ERR(err, "deflate"); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); + + *comprLen = c_stream.total_out; +} + +/* =========================================================================== + * Test inflateSync() + */ +void test_sync(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = zalloc; + d_stream.zfree = zfree; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = 2; /* just read the zlib header */ + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + d_stream.next_out = uncompr; + d_stream.avail_out = (uInt)uncomprLen; + + inflate(&d_stream, Z_NO_FLUSH); + CHECK_ERR(err, "inflate"); + + d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */ + err = inflateSync(&d_stream); /* but skip the damaged part */ + CHECK_ERR(err, "inflateSync"); + + err = inflate(&d_stream, Z_FINISH); + if (err != Z_DATA_ERROR) { + fprintf(stderr, "inflate should report DATA_ERROR\n"); + /* Because of incorrect adler32 */ + exit(1); + } + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + printf("after inflateSync(): hel%s\n", (char *)uncompr); +} + +/* =========================================================================== + * Test deflate() with preset dictionary + */ +void test_dict_deflate(compr, comprLen) + Byte *compr; + uLong comprLen; +{ + z_stream c_stream; /* compression stream */ + int err; + + c_stream.zalloc = zalloc; + c_stream.zfree = zfree; + c_stream.opaque = (voidpf)0; + + err = deflateInit(&c_stream, Z_BEST_COMPRESSION); + CHECK_ERR(err, "deflateInit"); + + err = deflateSetDictionary(&c_stream, + (const Bytef*)dictionary, (int)sizeof(dictionary)); + CHECK_ERR(err, "deflateSetDictionary"); + + dictId = c_stream.adler; + c_stream.next_out = compr; + c_stream.avail_out = (uInt)comprLen; + + c_stream.next_in = (Bytef*)hello; + c_stream.avail_in = (uInt)strlen(hello)+1; + + err = deflate(&c_stream, Z_FINISH); + if (err != Z_STREAM_END) { + fprintf(stderr, "deflate should report Z_STREAM_END\n"); + exit(1); + } + err = deflateEnd(&c_stream); + CHECK_ERR(err, "deflateEnd"); +} + +/* =========================================================================== + * Test inflate() with a preset dictionary + */ +void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) + Byte *compr, *uncompr; + uLong comprLen, uncomprLen; +{ + int err; + z_stream d_stream; /* decompression stream */ + + strcpy((char*)uncompr, "garbage"); + + d_stream.zalloc = zalloc; + d_stream.zfree = zfree; + d_stream.opaque = (voidpf)0; + + d_stream.next_in = compr; + d_stream.avail_in = (uInt)comprLen; + + err = inflateInit(&d_stream); + CHECK_ERR(err, "inflateInit"); + + d_stream.next_out = uncompr; + d_stream.avail_out = (uInt)uncomprLen; + + for (;;) { + err = inflate(&d_stream, Z_NO_FLUSH); + if (err == Z_STREAM_END) break; + if (err == Z_NEED_DICT) { + if (d_stream.adler != dictId) { + fprintf(stderr, "unexpected dictionary"); + exit(1); + } + err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary, + (int)sizeof(dictionary)); + } + CHECK_ERR(err, "inflate with dict"); + } + + err = inflateEnd(&d_stream); + CHECK_ERR(err, "inflateEnd"); + + if (strcmp((char*)uncompr, hello)) { + fprintf(stderr, "bad inflate with dict\n"); + exit(1); + } else { + printf("inflate with dictionary: %s\n", (char *)uncompr); + } +} + +/* =========================================================================== + * Usage: example [output.gz [input.gz]] + */ + +int main(argc, argv) + int argc; + char *argv[]; +{ + Byte *compr, *uncompr; + uLong comprLen = 10000*sizeof(int); /* don't overflow on MSDOS */ + uLong uncomprLen = comprLen; + static const char* myVersion = ZLIB_VERSION; + + if (zlibVersion()[0] != myVersion[0]) { + fprintf(stderr, "incompatible zlib version\n"); + exit(1); + + } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { + fprintf(stderr, "warning: different zlib version\n"); + } + + printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n", + ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags()); + + compr = (Byte*)calloc((uInt)comprLen, 1); + uncompr = (Byte*)calloc((uInt)uncomprLen, 1); + /* compr and uncompr are cleared to avoid reading uninitialized + * data and to ensure that uncompr compresses well. + */ + if (compr == Z_NULL || uncompr == Z_NULL) { + printf("out of memory\n"); + exit(1); + } + +#ifdef Z_SOLO + argc = strlen(argv[0]); +#else + test_compress(compr, comprLen, uncompr, uncomprLen); + + test_gzio((argc > 1 ? argv[1] : TESTFILE), + uncompr, uncomprLen); +#endif + + test_deflate(compr, comprLen); + test_inflate(compr, comprLen, uncompr, uncomprLen); + + test_large_deflate(compr, comprLen, uncompr, uncomprLen); + test_large_inflate(compr, comprLen, uncompr, uncomprLen); + + test_flush(compr, &comprLen); + test_sync(compr, comprLen, uncompr, uncomprLen); + comprLen = uncomprLen; + + test_dict_deflate(compr, comprLen); + test_dict_inflate(compr, comprLen, uncompr, uncomprLen); + + free(compr); + free(uncompr); + + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/test/infcover.c b/thirdparty/zlib/zlib-1.2.7/test/infcover.c new file mode 100644 index 0000000..fe3d920 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/test/infcover.c @@ -0,0 +1,671 @@ +/* infcover.c -- test zlib's inflate routines with full code coverage + * Copyright (C) 2011 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* to use, do: ./configure --cover && make cover */ + +#include +#include +#include +#include +#include "zlib.h" + +/* get definition of internal structure so we can mess with it (see pull()), + and so we can call inflate_trees() (see cover5()) */ +#define ZLIB_INTERNAL +#include "inftrees.h" +#include "inflate.h" + +#define local static + +/* -- memory tracking routines -- */ + +/* + These memory tracking routines are provided to zlib and track all of zlib's + allocations and deallocations, check for LIFO operations, keep a current + and high water mark of total bytes requested, optionally set a limit on the + total memory that can be allocated, and when done check for memory leaks. + + They are used as follows: + + z_stream strm; + mem_setup(&strm) initializes the memory tracking and sets the + zalloc, zfree, and opaque members of strm to use + memory tracking for all zlib operations on strm + mem_limit(&strm, limit) sets a limit on the total bytes requested -- a + request that exceeds this limit will result in an + allocation failure (returns NULL) -- setting the + limit to zero means no limit, which is the default + after mem_setup() + mem_used(&strm, "msg") prints to stderr "msg" and the total bytes used + mem_high(&strm, "msg") prints to stderr "msg" and the high water mark + mem_done(&strm, "msg") ends memory tracking, releases all allocations + for the tracking as well as leaked zlib blocks, if + any. If there was anything unusual, such as leaked + blocks, non-FIFO frees, or frees of addresses not + allocated, then "msg" and information about the + problem is printed to stderr. If everything is + normal, nothing is printed. mem_done resets the + strm members to Z_NULL to use the default memory + allocation routines on the next zlib initialization + using strm. + */ + +/* these items are strung together in a linked list, one for each allocation */ +struct mem_item { + void *ptr; /* pointer to allocated memory */ + size_t size; /* requested size of allocation */ + struct mem_item *next; /* pointer to next item in list, or NULL */ +}; + +/* this structure is at the root of the linked list, and tracks statistics */ +struct mem_zone { + struct mem_item *first; /* pointer to first item in list, or NULL */ + size_t total, highwater; /* total allocations, and largest total */ + size_t limit; /* memory allocation limit, or 0 if no limit */ + int notlifo, rogue; /* counts of non-LIFO frees and rogue frees */ +}; + +/* memory allocation routine to pass to zlib */ +local void *mem_alloc(void *mem, unsigned count, unsigned size) +{ + void *ptr; + struct mem_item *item; + struct mem_zone *zone = mem; + size_t len = count * (size_t)size; + + /* induced allocation failure */ + if (zone == NULL || (zone->limit && zone->total + len > zone->limit)) + return NULL; + + /* perform allocation using the standard library, fill memory with a + non-zero value to make sure that the code isn't depending on zeros */ + ptr = malloc(len); + if (ptr == NULL) + return NULL; + memset(ptr, 0xa5, len); + + /* create a new item for the list */ + item = malloc(sizeof(struct mem_item)); + if (item == NULL) { + free(ptr); + return NULL; + } + item->ptr = ptr; + item->size = len; + + /* insert item at the beginning of the list */ + item->next = zone->first; + zone->first = item; + + /* update the statistics */ + zone->total += item->size; + if (zone->total > zone->highwater) + zone->highwater = zone->total; + + /* return the allocated memory */ + return ptr; +} + +/* memory free routine to pass to zlib */ +local void mem_free(void *mem, void *ptr) +{ + struct mem_item *item, *next; + struct mem_zone *zone = mem; + + /* if no zone, just do a free */ + if (zone == NULL) { + free(ptr); + return; + } + + /* point next to the item that matches ptr, or NULL if not found -- remove + the item from the linked list if found */ + next = zone->first; + if (next) { + if (next->ptr == ptr) + zone->first = next->next; /* first one is it, remove from list */ + else { + do { /* search the linked list */ + item = next; + next = item->next; + } while (next != NULL && next->ptr != ptr); + if (next) { /* if found, remove from linked list */ + item->next = next->next; + zone->notlifo++; /* not a LIFO free */ + } + + } + } + + /* if found, update the statistics and free the item */ + if (next) { + zone->total -= next->size; + free(next); + } + + /* if not found, update the rogue count */ + else + zone->rogue++; + + /* in any case, do the requested free with the standard library function */ + free(ptr); +} + +/* set up a controlled memory allocation space for monitoring, set the stream + parameters to the controlled routines, with opaque pointing to the space */ +local void mem_setup(z_stream *strm) +{ + struct mem_zone *zone; + + zone = malloc(sizeof(struct mem_zone)); + assert(zone != NULL); + zone->first = NULL; + zone->total = 0; + zone->highwater = 0; + zone->limit = 0; + zone->notlifo = 0; + zone->rogue = 0; + strm->opaque = zone; + strm->zalloc = mem_alloc; + strm->zfree = mem_free; +} + +/* set a limit on the total memory allocation, or 0 to remove the limit */ +local void mem_limit(z_stream *strm, size_t limit) +{ + struct mem_zone *zone = strm->opaque; + + zone->limit = limit; +} + +/* show the current total requested allocations in bytes */ +local void mem_used(z_stream *strm, char *prefix) +{ + struct mem_zone *zone = strm->opaque; + + fprintf(stderr, "%s: %lu allocated\n", prefix, zone->total); +} + +/* show the high water allocation in bytes */ +local void mem_high(z_stream *strm, char *prefix) +{ + struct mem_zone *zone = strm->opaque; + + fprintf(stderr, "%s: %lu high water mark\n", prefix, zone->highwater); +} + +/* release the memory allocation zone -- if there are any surprises, notify */ +local void mem_done(z_stream *strm, char *prefix) +{ + int count = 0; + struct mem_item *item, *next; + struct mem_zone *zone = strm->opaque; + + /* show high water mark */ + mem_high(strm, prefix); + + /* free leftover allocations and item structures, if any */ + item = zone->first; + while (item != NULL) { + free(item->ptr); + next = item->next; + free(item); + item = next; + count++; + } + + /* issue alerts about anything unexpected */ + if (count || zone->total) + fprintf(stderr, "** %s: %lu bytes in %d blocks not freed\n", + prefix, zone->total, count); + if (zone->notlifo) + fprintf(stderr, "** %s: %d frees not LIFO\n", prefix, zone->notlifo); + if (zone->rogue) + fprintf(stderr, "** %s: %d frees not recognized\n", + prefix, zone->rogue); + + /* free the zone and delete from the stream */ + free(zone); + strm->opaque = Z_NULL; + strm->zalloc = Z_NULL; + strm->zfree = Z_NULL; +} + +/* -- inflate test routines -- */ + +/* Decode a hexadecimal string, set *len to length, in[] to the bytes. This + decodes liberally, in that hex digits can be adjacent, in which case two in + a row writes a byte. Or they can delimited by any non-hex character, where + the delimiters are ignored except when a single hex digit is followed by a + delimiter in which case that single digit writes a byte. The returned + data is allocated and must eventually be freed. NULL is returned if out of + memory. If the length is not needed, then len can be NULL. */ +local unsigned char *h2b(const char *hex, unsigned *len) +{ + unsigned char *in; + unsigned next, val; + + in = malloc((strlen(hex) + 1) >> 1); + if (in == NULL) + return NULL; + next = 0; + val = 1; + do { + if (*hex >= '0' && *hex <= '9') + val = (val << 4) + *hex - '0'; + else if (*hex >= 'A' && *hex <= 'F') + val = (val << 4) + *hex - 'A' + 10; + else if (*hex >= 'a' && *hex <= 'f') + val = (val << 4) + *hex - 'a' + 10; + else if (val != 1 && val < 32) /* one digit followed by delimiter */ + val += 240; /* make it look like two digits */ + if (val > 255) { /* have two digits */ + in[next++] = val & 0xff; /* save the decoded byte */ + val = 1; /* start over */ + } + } while (*hex++); /* go through the loop with the terminating null */ + if (len != NULL) + *len = next; + in = reallocf(in, next); + return in; +} + +/* generic inflate() run, where hex is the hexadecimal input data, what is the + text to include in an error message, step is how much input data to feed + inflate() on each call, or zero to feed it all, win is the window bits + parameter to inflateInit2(), len is the size of the output buffer, and err + is the error code expected from the first inflate() call (the second + inflate() call is expected to return Z_STREAM_END). If win is 47, then + header information is collected with inflateGetHeader(). If a zlib stream + is looking for a dictionary, then an empty dictionary is provided. + inflate() is run until all of the input data is consumed. */ +local void inf(char *hex, char *what, unsigned step, int win, unsigned len, + int err) +{ + int ret; + unsigned have; + unsigned char *in, *out; + z_stream strm, copy; + gz_header head; + + mem_setup(&strm); + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, win); + if (ret != Z_OK) { + mem_done(&strm, what); + return; + } + out = malloc(len); assert(out != NULL); + if (win == 47) { + head.extra = out; + head.extra_max = len; + head.name = out; + head.name_max = len; + head.comment = out; + head.comm_max = len; + ret = inflateGetHeader(&strm, &head); assert(ret == Z_OK); + } + in = h2b(hex, &have); assert(in != NULL); + if (step == 0 || step > have) + step = have; + strm.avail_in = step; + have -= step; + strm.next_in = in; + do { + strm.avail_out = len; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); assert(err == 9 || ret == err); + if (ret != Z_OK && ret != Z_BUF_ERROR && ret != Z_NEED_DICT) + break; + if (ret == Z_NEED_DICT) { + ret = inflateSetDictionary(&strm, in, 1); + assert(ret == Z_DATA_ERROR); + mem_limit(&strm, 1); + ret = inflateSetDictionary(&strm, out, 0); + assert(ret == Z_MEM_ERROR); + mem_limit(&strm, 0); + ((struct inflate_state *)strm.state)->mode = DICT; + ret = inflateSetDictionary(&strm, out, 0); + assert(ret == Z_OK); + ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_BUF_ERROR); + } + ret = inflateCopy(©, &strm); assert(ret == Z_OK); + ret = inflateEnd(©); assert(ret == Z_OK); + err = 9; /* don't care next time around */ + have += strm.avail_in; + strm.avail_in = step > have ? have : step; + have -= strm.avail_in; + } while (strm.avail_in); + free(in); + free(out); + ret = inflateReset2(&strm, -8); assert(ret == Z_OK); + ret = inflateEnd(&strm); assert(ret == Z_OK); + mem_done(&strm, what); +} + +/* cover all of the lines in inflate.c up to inflate() */ +local void cover_support(void) +{ + int ret; + z_stream strm; + + mem_setup(&strm); + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); assert(ret == Z_OK); + mem_used(&strm, "inflate init"); + ret = inflatePrime(&strm, 5, 31); assert(ret == Z_OK); + ret = inflatePrime(&strm, -1, 0); assert(ret == Z_OK); + ret = inflateSetDictionary(&strm, Z_NULL, 0); + assert(ret == Z_STREAM_ERROR); + ret = inflateEnd(&strm); assert(ret == Z_OK); + mem_done(&strm, "prime"); + + inf("63 0", "force window allocation", 0, -15, 1, Z_OK); + inf("63 18 5", "force window replacement", 0, -8, 259, Z_OK); + inf("63 18 68 30 d0 0 0", "force split window update", 4, -8, 259, Z_OK); + inf("3 0", "use fixed blocks", 0, -15, 1, Z_STREAM_END); + inf("", "bad window size", 0, 1, 0, Z_STREAM_ERROR); + + mem_setup(&strm); + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit_(&strm, ZLIB_VERSION - 1, (int)sizeof(z_stream)); + assert(ret == Z_VERSION_ERROR); + mem_done(&strm, "wrong version"); + + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); assert(ret == Z_OK); + ret = inflateEnd(&strm); assert(ret == Z_OK); + fputs("inflate built-in memory routines\n", stderr); +} + +/* cover all inflate() header and trailer cases and code after inflate() */ +local void cover_wrap(void) +{ + int ret; + z_stream strm, copy; + unsigned char dict[257]; + + ret = inflate(Z_NULL, 0); assert(ret == Z_STREAM_ERROR); + ret = inflateEnd(Z_NULL); assert(ret == Z_STREAM_ERROR); + ret = inflateCopy(Z_NULL, Z_NULL); assert(ret == Z_STREAM_ERROR); + fputs("inflate bad parameters\n", stderr); + + inf("1f 8b 0 0", "bad gzip method", 0, 31, 0, Z_DATA_ERROR); + inf("1f 8b 8 80", "bad gzip flags", 0, 31, 0, Z_DATA_ERROR); + inf("77 85", "bad zlib method", 0, 15, 0, Z_DATA_ERROR); + inf("8 99", "set window size from header", 0, 0, 0, Z_OK); + inf("78 9c", "bad zlib window size", 0, 8, 0, Z_DATA_ERROR); + inf("78 9c 63 0 0 0 1 0 1", "check adler32", 0, 15, 1, Z_STREAM_END); + inf("1f 8b 8 1e 0 0 0 0 0 0 1 0 0 0 0 0 0", "bad header crc", 0, 47, 1, + Z_DATA_ERROR); + inf("1f 8b 8 2 0 0 0 0 0 0 1d 26 3 0 0 0 0 0 0 0 0 0", "check gzip length", + 0, 47, 0, Z_STREAM_END); + inf("78 90", "bad zlib header check", 0, 47, 0, Z_DATA_ERROR); + inf("8 b8 0 0 0 1", "need dictionary", 0, 8, 0, Z_NEED_DICT); + inf("78 9c 63 0", "compute adler32", 0, 15, 1, Z_OK); + + mem_setup(&strm); + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, -8); + strm.avail_in = 2; + strm.next_in = (void *)"\x63"; + strm.avail_out = 1; + strm.next_out = (void *)&ret; + mem_limit(&strm, 1); + ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR); + ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_MEM_ERROR); + mem_limit(&strm, 0); + memset(dict, 0, 257); + ret = inflateSetDictionary(&strm, dict, 257); + assert(ret == Z_OK); + mem_limit(&strm, (sizeof(struct inflate_state) << 1) + 256); + ret = inflatePrime(&strm, 16, 0); assert(ret == Z_OK); + strm.avail_in = 2; + strm.next_in = (void *)"\x80"; + ret = inflateSync(&strm); assert(ret == Z_DATA_ERROR); + ret = inflate(&strm, Z_NO_FLUSH); assert(ret == Z_STREAM_ERROR); + strm.avail_in = 4; + strm.next_in = (void *)"\0\0\xff\xff"; + ret = inflateSync(&strm); assert(ret == Z_OK); + (void)inflateSyncPoint(&strm); + ret = inflateCopy(©, &strm); assert(ret == Z_MEM_ERROR); + mem_limit(&strm, 0); + ret = inflateUndermine(&strm, 1); assert(ret == Z_DATA_ERROR); + (void)inflateMark(&strm); + ret = inflateEnd(&strm); assert(ret == Z_OK); + mem_done(&strm, "miscellaneous, force memory errors"); +} + +/* input and output functions for inflateBack() */ +local unsigned pull(void *desc, unsigned char **buf) +{ + static unsigned int next = 0; + static unsigned char dat[] = {0x63, 0, 2, 0}; + struct inflate_state *state; + + if (desc == Z_NULL) { + next = 0; + return 0; /* no input (already provided at next_in) */ + } + state = (void *)((z_stream *)desc)->state; + if (state != Z_NULL) + state->mode = SYNC; /* force an otherwise impossible situation */ + return next < sizeof(dat) ? (*buf = dat + next++, 1) : 0; +} + +local int push(void *desc, unsigned char *buf, unsigned len) +{ + buf += len; + return desc != Z_NULL; /* force error if desc not null */ +} + +/* cover inflateBack() up to common deflate data cases and after those */ +local void cover_back(void) +{ + int ret; + z_stream strm; + unsigned char win[32768]; + + ret = inflateBackInit_(Z_NULL, 0, win, 0, 0); + assert(ret == Z_VERSION_ERROR); + ret = inflateBackInit(Z_NULL, 0, win); assert(ret == Z_STREAM_ERROR); + ret = inflateBack(Z_NULL, Z_NULL, Z_NULL, Z_NULL, Z_NULL); + assert(ret == Z_STREAM_ERROR); + ret = inflateBackEnd(Z_NULL); assert(ret == Z_STREAM_ERROR); + fputs("inflateBack bad parameters\n", stderr); + + mem_setup(&strm); + ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK); + strm.avail_in = 2; + strm.next_in = (void *)"\x03"; + ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL); + assert(ret == Z_STREAM_END); + /* force output error */ + strm.avail_in = 3; + strm.next_in = (void *)"\x63\x00"; + ret = inflateBack(&strm, pull, Z_NULL, push, &strm); + assert(ret == Z_BUF_ERROR); + /* force mode error by mucking with state */ + ret = inflateBack(&strm, pull, &strm, push, Z_NULL); + assert(ret == Z_STREAM_ERROR); + ret = inflateBackEnd(&strm); assert(ret == Z_OK); + mem_done(&strm, "inflateBack bad state"); + + ret = inflateBackInit(&strm, 15, win); assert(ret == Z_OK); + ret = inflateBackEnd(&strm); assert(ret == Z_OK); + fputs("inflateBack built-in memory routines\n", stderr); +} + +/* do a raw inflate of data in hexadecimal with both inflate and inflateBack */ +local int try(char *hex, char *id, int err) +{ + int ret; + unsigned len, size; + unsigned char *in, *out, *win; + char *prefix; + z_stream strm; + + /* convert to hex */ + in = h2b(hex, &len); + assert(in != NULL); + + /* allocate work areas */ + size = len << 3; + out = malloc(size); + assert(out != NULL); + win = malloc(32768); + assert(win != NULL); + prefix = malloc(strlen(id) + 6); + assert(prefix != NULL); + + /* first with inflate */ + strcpy(prefix, id); + strcat(prefix, "-late"); + mem_setup(&strm); + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit2(&strm, err < 0 ? 47 : -15); + assert(ret == Z_OK); + strm.avail_in = len; + strm.next_in = in; + do { + strm.avail_out = size; + strm.next_out = out; + ret = inflate(&strm, Z_TREES); + assert(ret != Z_STREAM_ERROR && ret != Z_MEM_ERROR); + if (ret == Z_DATA_ERROR || ret == Z_NEED_DICT) + break; + } while (strm.avail_in || strm.avail_out == 0); + if (err) { + assert(ret == Z_DATA_ERROR); + assert(strcmp(id, strm.msg) == 0); + } + inflateEnd(&strm); + mem_done(&strm, prefix); + + /* then with inflateBack */ + if (err >= 0) { + strcpy(prefix, id); + strcat(prefix, "-back"); + mem_setup(&strm); + ret = inflateBackInit(&strm, 15, win); + assert(ret == Z_OK); + strm.avail_in = len; + strm.next_in = in; + ret = inflateBack(&strm, pull, Z_NULL, push, Z_NULL); + assert(ret != Z_STREAM_ERROR); + if (err) { + assert(ret == Z_DATA_ERROR); + assert(strcmp(id, strm.msg) == 0); + } + inflateBackEnd(&strm); + mem_done(&strm, prefix); + } + + /* clean up */ + free(prefix); + free(win); + free(out); + free(in); + return ret; +} + +/* cover deflate data cases in both inflate() and inflateBack() */ +local void cover_inflate(void) +{ + try("0 0 0 0 0", "invalid stored block lengths", 1); + try("3 0", "fixed", 0); + try("6", "invalid block type", 1); + try("1 1 0 fe ff 0", "stored", 0); + try("fc 0 0", "too many length or distance symbols", 1); + try("4 0 fe ff", "invalid code lengths set", 1); + try("4 0 24 49 0", "invalid bit length repeat", 1); + try("4 0 24 e9 ff ff", "invalid bit length repeat", 1); + try("4 0 24 e9 ff 6d", "invalid code -- missing end-of-block", 1); + try("4 80 49 92 24 49 92 24 71 ff ff 93 11 0", + "invalid literal/lengths set", 1); + try("4 80 49 92 24 49 92 24 f b4 ff ff c3 84", "invalid distances set", 1); + try("4 c0 81 8 0 0 0 0 20 7f eb b 0 0", "invalid literal/length code", 1); + try("2 7e ff ff", "invalid distance code", 1); + try("c c0 81 0 0 0 0 0 90 ff 6b 4 0", "invalid distance too far back", 1); + + /* also trailer mismatch just in inflate() */ + try("1f 8b 8 0 0 0 0 0 0 0 3 0 0 0 0 1", "incorrect data check", -1); + try("1f 8b 8 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 1", + "incorrect length check", -1); + try("5 c0 21 d 0 0 0 80 b0 fe 6d 2f 91 6c", "pull 17", 0); + try("5 e0 81 91 24 cb b2 2c 49 e2 f 2e 8b 9a 47 56 9f fb fe ec d2 ff 1f", + "long code", 0); + try("ed c0 1 1 0 0 0 40 20 ff 57 1b 42 2c 4f", "length extra", 0); + try("ed cf c1 b1 2c 47 10 c4 30 fa 6f 35 1d 1 82 59 3d fb be 2e 2a fc f c", + "long distance and extra", 0); + try("ed c0 81 0 0 0 0 80 a0 fd a9 17 a9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6", "window end", 0); + inf("2 8 20 80 0 3 0", "inflate_fast TYPE return", 0, -15, 258, + Z_STREAM_END); + inf("63 18 5 40 c 0", "window wrap", 3, -8, 300, Z_OK); +} + +/* cover remaining lines in inftrees.c */ +local void cover_trees(void) +{ + int ret; + unsigned bits; + unsigned short lens[16], work[16]; + code *next, table[ENOUGH_DISTS]; + + /* we need to call inflate_table() directly in order to manifest not- + enough errors, since zlib insures that enough is always enough */ + for (bits = 0; bits < 15; bits++) + lens[bits] = (unsigned short)(bits + 1); + lens[15] = 15; + next = table; + bits = 15; + ret = inflate_table(DISTS, lens, 16, &next, &bits, work); + assert(ret == 1); + next = table; + bits = 1; + ret = inflate_table(DISTS, lens, 16, &next, &bits, work); + assert(ret == 1); + fputs("inflate_table not enough errors\n", stderr); +} + +/* cover remaining inffast.c decoding and window copying */ +local void cover_fast(void) +{ + inf("e5 e0 81 ad 6d cb b2 2c c9 01 1e 59 63 ae 7d ee fb 4d fd b5 35 41 68" + " ff 7f 0f 0 0 0", "fast length extra bits", 0, -8, 258, Z_DATA_ERROR); + inf("25 fd 81 b5 6d 59 b6 6a 49 ea af 35 6 34 eb 8c b9 f6 b9 1e ef 67 49" + " 50 fe ff ff 3f 0 0", "fast distance extra bits", 0, -8, 258, + Z_DATA_ERROR); + inf("3 7e 0 0 0 0 0", "fast invalid distance code", 0, -8, 258, + Z_DATA_ERROR); + inf("1b 7 0 0 0 0 0", "fast invalid literal/length code", 0, -8, 258, + Z_DATA_ERROR); + inf("d c7 1 ae eb 38 c 4 41 a0 87 72 de df fb 1f b8 36 b1 38 5d ff ff 0", + "fast 2nd level codes and too far back", 0, -8, 258, Z_DATA_ERROR); + inf("63 18 5 8c 10 8 0 0 0 0", "very common case", 0, -8, 259, Z_OK); + inf("63 60 60 18 c9 0 8 18 18 18 26 c0 28 0 29 0 0 0", + "contiguous and wrap around window", 6, -8, 259, Z_OK); + inf("63 0 3 0 0 0 0 0", "copy direct from output", 0, -8, 259, + Z_STREAM_END); +} + +int main(void) +{ + fprintf(stderr, "%s\n", zlibVersion()); + cover_support(); + cover_wrap(); + cover_back(); + cover_inflate(); + cover_trees(); + cover_fast(); + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/test/minigzip.c b/thirdparty/zlib/zlib-1.2.7/test/minigzip.c new file mode 100644 index 0000000..aa7ac7a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/test/minigzip.c @@ -0,0 +1,631 @@ +/* minigzip.c -- simulate gzip using the zlib compression library + * Copyright (C) 1995-2006, 2010, 2011 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * minigzip is a minimal implementation of the gzip utility. This is + * only an example of using zlib and isn't meant to replace the + * full-featured gzip. No attempt is made to deal with file systems + * limiting names to 14 or 8+3 characters, etc... Error checking is + * very limited. So use minigzip only for testing; use gzip for the + * real thing. On MSDOS, use only on file names without extension + * or in pipe mode. + */ + +/* @(#) $Id$ */ + +#include "zlib.h" +#include + +#ifdef STDC +# include +# include +#endif + +#ifdef USE_MMAP +# include +# include +# include +#endif + +#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) +# include +# include +# ifdef UNDER_CE +# include +# endif +# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif + +#ifdef VMS +# define unlink delete +# define GZ_SUFFIX "-gz" +#endif +#ifdef RISCOS +# define unlink remove +# define GZ_SUFFIX "-gz" +# define fileno(file) file->__file +#endif +#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fileno */ +#endif + +#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) +#ifndef WIN32 /* unlink already in stdio.h for WIN32 */ + extern int unlink OF((const char *)); +#endif +#endif + +#if defined(UNDER_CE) +# include +# define perror(s) pwinerror(s) + +/* Map the Windows error number in ERROR to a locale-dependent error + message string and return a pointer to it. Typically, the values + for ERROR come from GetLastError. + + The string pointed to shall not be modified by the application, + but may be overwritten by a subsequent call to strwinerror + + The strwinerror function does not change the current setting + of GetLastError. */ + +static char *strwinerror (error) + DWORD error; +{ + static char buf[1024]; + + wchar_t *msgbuf; + DWORD lasterr = GetLastError(); + DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, + error, + 0, /* Default language */ + (LPVOID)&msgbuf, + 0, + NULL); + if (chars != 0) { + /* If there is an \r\n appended, zap it. */ + if (chars >= 2 + && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { + chars -= 2; + msgbuf[chars] = 0; + } + + if (chars > sizeof (buf) - 1) { + chars = sizeof (buf) - 1; + msgbuf[chars] = 0; + } + + wcstombs(buf, msgbuf, chars + 1); + LocalFree(msgbuf); + } + else { + sprintf(buf, "unknown win32 error (%ld)", error); + } + + SetLastError(lasterr); + return buf; +} + +static void pwinerror (s) + const char *s; +{ + if (s && *s) + fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ())); + else + fprintf(stderr, "%s\n", strwinerror(GetLastError ())); +} + +#endif /* UNDER_CE */ + +#ifndef GZ_SUFFIX +# define GZ_SUFFIX ".gz" +#endif +#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) + +#define BUFLEN 16384 +#define MAX_NAME_LEN 1024 + +#ifdef MAXSEG_64K +# define local static + /* Needed for systems with limitation on stack size. */ +#else +# define local +#endif + +#ifdef Z_SOLO +/* for Z_SOLO, create simplified gz* functions using deflate and inflate */ + +#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE) +# include /* for unlink() */ +#endif + +void *myalloc OF((void *, unsigned, unsigned)); +void myfree OF((void *, void *)); + +void *myalloc(q, n, m) + void *q; + unsigned n, m; +{ + q = Z_NULL; + return calloc(n, m); +} + +void myfree(q, p) + void *q, *p; +{ + q = Z_NULL; + free(p); +} + +typedef struct gzFile_s { + FILE *file; + int write; + int err; + char *msg; + z_stream strm; +} *gzFile; + +gzFile gzopen OF((const char *, const char *)); +gzFile gzdopen OF((int, const char *)); +gzFile gz_open OF((const char *, int, const char *)); + +gzFile gzopen(path, mode) +const char *path; +const char *mode; +{ + return gz_open(path, -1, mode); +} + +gzFile gzdopen(fd, mode) +int fd; +const char *mode; +{ + return gz_open(NULL, fd, mode); +} + +gzFile gz_open(path, fd, mode) + const char *path; + int fd; + const char *mode; +{ + gzFile gz; + int ret; + + gz = malloc(sizeof(struct gzFile_s)); + if (gz == NULL) + return NULL; + gz->write = strchr(mode, 'w') != NULL; + gz->strm.zalloc = myalloc; + gz->strm.zfree = myfree; + gz->strm.opaque = Z_NULL; + if (gz->write) + ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0); + else { + gz->strm.next_in = 0; + gz->strm.avail_in = Z_NULL; + ret = inflateInit2(&(gz->strm), 15 + 16); + } + if (ret != Z_OK) { + free(gz); + return NULL; + } + gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") : + fopen(path, gz->write ? "wb" : "rb"); + if (gz->file == NULL) { + gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm)); + free(gz); + return NULL; + } + gz->err = 0; + gz->msg = ""; + return gz; +} + +int gzwrite OF((gzFile, const void *, unsigned)); + +int gzwrite(gz, buf, len) + gzFile gz; + const void *buf; + unsigned len; +{ + z_stream *strm; + unsigned char out[BUFLEN]; + + if (gz == NULL || !gz->write) + return 0; + strm = &(gz->strm); + strm->next_in = (void *)buf; + strm->avail_in = len; + do { + strm->next_out = out; + strm->avail_out = BUFLEN; + (void)deflate(strm, Z_NO_FLUSH); + fwrite(out, 1, BUFLEN - strm->avail_out, gz->file); + } while (strm->avail_out == 0); + return len; +} + +int gzread OF((gzFile, void *, unsigned)); + +int gzread(gz, buf, len) + gzFile gz; + void *buf; + unsigned len; +{ + int ret; + unsigned got; + unsigned char in[1]; + z_stream *strm; + + if (gz == NULL || gz->write) + return 0; + if (gz->err) + return 0; + strm = &(gz->strm); + strm->next_out = (void *)buf; + strm->avail_out = len; + do { + got = fread(in, 1, 1, gz->file); + if (got == 0) + break; + strm->next_in = in; + strm->avail_in = 1; + ret = inflate(strm, Z_NO_FLUSH); + if (ret == Z_DATA_ERROR) { + gz->err = Z_DATA_ERROR; + gz->msg = strm->msg; + return 0; + } + if (ret == Z_STREAM_END) + inflateReset(strm); + } while (strm->avail_out); + return len - strm->avail_out; +} + +int gzclose OF((gzFile)); + +int gzclose(gz) + gzFile gz; +{ + z_stream *strm; + unsigned char out[BUFLEN]; + + if (gz == NULL) + return Z_STREAM_ERROR; + strm = &(gz->strm); + if (gz->write) { + strm->next_in = Z_NULL; + strm->avail_in = 0; + do { + strm->next_out = out; + strm->avail_out = BUFLEN; + (void)deflate(strm, Z_FINISH); + fwrite(out, 1, BUFLEN - strm->avail_out, gz->file); + } while (strm->avail_out == 0); + deflateEnd(strm); + } + else + inflateEnd(strm); + fclose(gz->file); + free(gz); + return Z_OK; +} + +const char *gzerror OF((gzFile, int *)); + +const char *gzerror(gz, err) + gzFile gz; + int *err; +{ + *err = gz->err; + return gz->msg; +} + +#endif + +char *prog; + +void error OF((const char *msg)); +void gz_compress OF((FILE *in, gzFile out)); +#ifdef USE_MMAP +int gz_compress_mmap OF((FILE *in, gzFile out)); +#endif +void gz_uncompress OF((gzFile in, FILE *out)); +void file_compress OF((char *file, char *mode)); +void file_uncompress OF((char *file)); +int main OF((int argc, char *argv[])); + +/* =========================================================================== + * Display error message and exit + */ +void error(msg) + const char *msg; +{ + fprintf(stderr, "%s: %s\n", prog, msg); + exit(1); +} + +/* =========================================================================== + * Compress input to output then close both files. + */ + +void gz_compress(in, out) + FILE *in; + gzFile out; +{ + local char buf[BUFLEN]; + int len; + int err; + +#ifdef USE_MMAP + /* Try first compressing with mmap. If mmap fails (minigzip used in a + * pipe), use the normal fread loop. + */ + if (gz_compress_mmap(in, out) == Z_OK) return; +#endif + for (;;) { + len = (int)fread(buf, 1, sizeof(buf), in); + if (ferror(in)) { + perror("fread"); + exit(1); + } + if (len == 0) break; + + if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); + } + fclose(in); + if (gzclose(out) != Z_OK) error("failed gzclose"); +} + +#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ + +/* Try compressing the input file at once using mmap. Return Z_OK if + * if success, Z_ERRNO otherwise. + */ +int gz_compress_mmap(in, out) + FILE *in; + gzFile out; +{ + int len; + int err; + int ifd = fileno(in); + caddr_t buf; /* mmap'ed buffer for the entire input file */ + off_t buf_len; /* length of the input file */ + struct stat sb; + + /* Determine the size of the file, needed for mmap: */ + if (fstat(ifd, &sb) < 0) return Z_ERRNO; + buf_len = sb.st_size; + if (buf_len <= 0) return Z_ERRNO; + + /* Now do the actual mmap: */ + buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); + if (buf == (caddr_t)(-1)) return Z_ERRNO; + + /* Compress the whole file at once: */ + len = gzwrite(out, (char *)buf, (unsigned)buf_len); + + if (len != (int)buf_len) error(gzerror(out, &err)); + + munmap(buf, buf_len); + fclose(in); + if (gzclose(out) != Z_OK) error("failed gzclose"); + return Z_OK; +} +#endif /* USE_MMAP */ + +/* =========================================================================== + * Uncompress input to output then close both files. + */ +void gz_uncompress(in, out) + gzFile in; + FILE *out; +{ + local char buf[BUFLEN]; + int len; + int err; + + for (;;) { + len = gzread(in, buf, sizeof(buf)); + if (len < 0) error (gzerror(in, &err)); + if (len == 0) break; + + if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { + error("failed fwrite"); + } + } + if (fclose(out)) error("failed fclose"); + + if (gzclose(in) != Z_OK) error("failed gzclose"); +} + + +/* =========================================================================== + * Compress the given file: create a corresponding .gz file and remove the + * original. + */ +void file_compress(file, mode) + char *file; + char *mode; +{ + local char outfile[MAX_NAME_LEN]; + FILE *in; + gzFile out; + + if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) { + fprintf(stderr, "%s: filename too long\n", prog); + exit(1); + } + + strcpy(outfile, file); + strcat(outfile, GZ_SUFFIX); + + in = fopen(file, "rb"); + if (in == NULL) { + perror(file); + exit(1); + } + out = gzopen(outfile, mode); + if (out == NULL) { + fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); + exit(1); + } + gz_compress(in, out); + + unlink(file); +} + + +/* =========================================================================== + * Uncompress the given file and remove the original. + */ +void file_uncompress(file) + char *file; +{ + local char buf[MAX_NAME_LEN]; + char *infile, *outfile; + FILE *out; + gzFile in; + size_t len = strlen(file); + + if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) { + fprintf(stderr, "%s: filename too long\n", prog); + exit(1); + } + + strcpy(buf, file); + + if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { + infile = file; + outfile = buf; + outfile[len-3] = '\0'; + } else { + outfile = file; + infile = buf; + strcat(infile, GZ_SUFFIX); + } + in = gzopen(infile, "rb"); + if (in == NULL) { + fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); + exit(1); + } + out = fopen(outfile, "wb"); + if (out == NULL) { + perror(file); + exit(1); + } + + gz_uncompress(in, out); + + unlink(infile); +} + + +/* =========================================================================== + * Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...] + * -c : write to standard output + * -d : decompress + * -f : compress with Z_FILTERED + * -h : compress with Z_HUFFMAN_ONLY + * -r : compress with Z_RLE + * -1 to -9 : compression level + */ + +int main(argc, argv) + int argc; + char *argv[]; +{ + int copyout = 0; + int uncompr = 0; + gzFile file; + char *bname, outmode[20]; + + strcpy(outmode, "wb6 "); + + prog = argv[0]; + bname = strrchr(argv[0], '/'); + if (bname) + bname++; + else + bname = argv[0]; + argc--, argv++; + + if (!strcmp(bname, "gunzip")) + uncompr = 1; + else if (!strcmp(bname, "zcat")) + copyout = uncompr = 1; + + while (argc > 0) { + if (strcmp(*argv, "-c") == 0) + copyout = 1; + else if (strcmp(*argv, "-d") == 0) + uncompr = 1; + else if (strcmp(*argv, "-f") == 0) + outmode[3] = 'f'; + else if (strcmp(*argv, "-h") == 0) + outmode[3] = 'h'; + else if (strcmp(*argv, "-r") == 0) + outmode[3] = 'R'; + else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && + (*argv)[2] == 0) + outmode[2] = (*argv)[1]; + else + break; + argc--, argv++; + } + if (outmode[3] == ' ') + outmode[3] = 0; + if (argc == 0) { + SET_BINARY_MODE(stdin); + SET_BINARY_MODE(stdout); + if (uncompr) { + file = gzdopen(fileno(stdin), "rb"); + if (file == NULL) error("can't gzdopen stdin"); + gz_uncompress(file, stdout); + } else { + file = gzdopen(fileno(stdout), outmode); + if (file == NULL) error("can't gzdopen stdout"); + gz_compress(stdin, file); + } + } else { + if (copyout) { + SET_BINARY_MODE(stdout); + } + do { + if (uncompr) { + if (copyout) { + file = gzopen(*argv, "rb"); + if (file == NULL) + fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv); + else + gz_uncompress(file, stdout); + } else { + file_uncompress(*argv); + } + } else { + if (copyout) { + FILE * in = fopen(*argv, "rb"); + + if (in == NULL) { + perror(*argv); + } else { + file = gzdopen(fileno(stdout), outmode); + if (file == NULL) error("can't gzdopen stdout"); + + gz_compress(in, file); + } + + } else { + file_compress(*argv, outmode); + } + } + } while (argv++, --argc); + } + return 0; +} diff --git a/thirdparty/zlib/zlib-1.2.7/treebuild.xml b/thirdparty/zlib/zlib-1.2.7/treebuild.xml new file mode 100644 index 0000000..1f4d15f --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/treebuild.xml @@ -0,0 +1,116 @@ + + + + zip compression library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/zlib/zlib-1.2.7/trees.c b/thirdparty/zlib/zlib-1.2.7/trees.c new file mode 100644 index 0000000..8c32b21 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/trees.c @@ -0,0 +1,1224 @@ +/* trees.c -- output deflated data using Huffman coding + * Copyright (C) 1995-2012 Jean-loup Gailly + * detect_data_type() function provided freely by Cosmin Truta, 2006 + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process uses several Huffman trees. The more + * common source values are represented by shorter bit sequences. + * + * Each code tree is stored in a compressed form which is itself + * a Huffman encoding of the lengths of all the code strings (in + * ascending order by source values). The actual code strings are + * reconstructed from the lengths in the inflate process, as described + * in the deflate specification. + * + * REFERENCES + * + * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". + * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc + * + * Storer, James A. + * Data Compression: Methods and Theory, pp. 49-50. + * Computer Science Press, 1988. ISBN 0-7167-8156-5. + * + * Sedgewick, R. + * Algorithms, p290. + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + */ + +/* @(#) $Id$ */ + +/* #define GEN_TREES_H */ + +#include "deflate.h" + +#ifdef DEBUG +# include +#endif + +/* =========================================================================== + * Constants + */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +local const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +local const uch bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ + +#if defined(GEN_TREES_H) || !defined(STDC) +/* non ANSI compilers may not accept trees.h */ + +local ct_data static_ltree[L_CODES+2]; +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +local ct_data static_dtree[D_CODES]; +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +uch _dist_code[DIST_CODE_LEN]; +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +uch _length_code[MAX_MATCH-MIN_MATCH+1]; +/* length code for each normalized match length (0 == MIN_MATCH) */ + +local int base_length[LENGTH_CODES]; +/* First normalized length for each code (0 = MIN_MATCH) */ + +local int base_dist[D_CODES]; +/* First normalized distance for each code (0 = distance of 1) */ + +#else +# include "trees.h" +#endif /* GEN_TREES_H */ + +struct static_tree_desc_s { + const ct_data *static_tree; /* static tree or NULL */ + const intf *extra_bits; /* extra bits for each code or NULL */ + int extra_base; /* base index for extra_bits */ + int elems; /* max number of elements in the tree */ + int max_length; /* max bit length for the codes */ +}; + +local static_tree_desc static_l_desc = +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; + +local static_tree_desc static_d_desc = +{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; + +local static_tree_desc static_bl_desc = +{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; + +/* =========================================================================== + * Local (static) routines in this file. + */ + +local void tr_static_init OF((void)); +local void init_block OF((deflate_state *s)); +local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); +local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); +local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); +local void build_tree OF((deflate_state *s, tree_desc *desc)); +local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local int build_bl_tree OF((deflate_state *s)); +local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, + int blcodes)); +local void compress_block OF((deflate_state *s, ct_data *ltree, + ct_data *dtree)); +local int detect_data_type OF((deflate_state *s)); +local unsigned bi_reverse OF((unsigned value, int length)); +local void bi_windup OF((deflate_state *s)); +local void bi_flush OF((deflate_state *s)); +local void copy_block OF((deflate_state *s, charf *buf, unsigned len, + int header)); + +#ifdef GEN_TREES_H +local void gen_trees_header OF((void)); +#endif + +#ifndef DEBUG +# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) + /* Send a code of the given tree. c and tree must not have side effects */ + +#else /* DEBUG */ +# define send_code(s, c, tree) \ + { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ + send_bits(s, tree[c].Code, tree[c].Len); } +#endif + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +#ifdef DEBUG +local void send_bits OF((deflate_state *s, int value, int length)); + +local void send_bits(s, value, length) + deflate_state *s; + int value; /* value to send */ + int length; /* number of bits */ +{ + Tracevv((stderr," l %2d v %4x ", length, value)); + Assert(length > 0 && length <= 15, "invalid length"); + s->bits_sent += (ulg)length; + + /* If not enough room in bi_buf, use (valid) bits from bi_buf and + * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + * unused bits in value. + */ + if (s->bi_valid > (int)Buf_size - length) { + s->bi_buf |= (ush)value << s->bi_valid; + put_short(s, s->bi_buf); + s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); + s->bi_valid += length - Buf_size; + } else { + s->bi_buf |= (ush)value << s->bi_valid; + s->bi_valid += length; + } +} +#else /* !DEBUG */ + +#define send_bits(s, value, length) \ +{ int len = length;\ + if (s->bi_valid > (int)Buf_size - len) {\ + int val = value;\ + s->bi_buf |= (ush)val << s->bi_valid;\ + put_short(s, s->bi_buf);\ + s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ + s->bi_valid += len - Buf_size;\ + } else {\ + s->bi_buf |= (ush)(value) << s->bi_valid;\ + s->bi_valid += len;\ + }\ +} +#endif /* DEBUG */ + + +/* the arguments must not have side effects */ + +/* =========================================================================== + * Initialize the various 'constant' tables. + */ +local void tr_static_init() +{ +#if defined(GEN_TREES_H) || !defined(STDC) + static int static_init_done = 0; + int n; /* iterates over tree elements */ + int bits; /* bit counter */ + int length; /* length value */ + int code; /* code value */ + int dist; /* distance index */ + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + if (static_init_done) return; + + /* For some embedded targets, global variables are not initialized: */ +#ifdef NO_INIT_GLOBAL_POINTERS + static_l_desc.static_tree = static_ltree; + static_l_desc.extra_bits = extra_lbits; + static_d_desc.static_tree = static_dtree; + static_d_desc.extra_bits = extra_dbits; + static_bl_desc.extra_bits = extra_blbits; +#endif + + /* Initialize the mapping length (0..255) -> length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES-1; code++) { + base_length[code] = length; + for (n = 0; n < (1< dist code (0..29) */ + dist = 0; + for (code = 0 ; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ + for ( ; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + _dist_code[256 + dist++] = (uch)code; + } + } + Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; + n = 0; + while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; + while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; + while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; + while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n].Len = 5; + static_dtree[n].Code = bi_reverse((unsigned)n, 5); + } + static_init_done = 1; + +# ifdef GEN_TREES_H + gen_trees_header(); +# endif +#endif /* defined(GEN_TREES_H) || !defined(STDC) */ +} + +/* =========================================================================== + * Genererate the file trees.h describing the static trees. + */ +#ifdef GEN_TREES_H +# ifndef DEBUG +# include +# endif + +# define SEPARATOR(i, last, width) \ + ((i) == (last)? "\n};\n\n" : \ + ((i) % (width) == (width)-1 ? ",\n" : ", ")) + +void gen_trees_header() +{ + FILE *header = fopen("trees.h", "w"); + int i; + + Assert (header != NULL, "Can't open trees.h"); + fprintf(header, + "/* header created automatically with -DGEN_TREES_H */\n\n"); + + fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); + for (i = 0; i < L_CODES+2; i++) { + fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, + static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); + } + + fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, + static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); + } + + fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n"); + for (i = 0; i < DIST_CODE_LEN; i++) { + fprintf(header, "%2u%s", _dist_code[i], + SEPARATOR(i, DIST_CODE_LEN-1, 20)); + } + + fprintf(header, + "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); + for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { + fprintf(header, "%2u%s", _length_code[i], + SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); + } + + fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); + for (i = 0; i < LENGTH_CODES; i++) { + fprintf(header, "%1u%s", base_length[i], + SEPARATOR(i, LENGTH_CODES-1, 20)); + } + + fprintf(header, "local const int base_dist[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "%5u%s", base_dist[i], + SEPARATOR(i, D_CODES-1, 10)); + } + + fclose(header); +} +#endif /* GEN_TREES_H */ + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +void ZLIB_INTERNAL _tr_init(s) + deflate_state *s; +{ + tr_static_init(); + + s->l_desc.dyn_tree = s->dyn_ltree; + s->l_desc.stat_desc = &static_l_desc; + + s->d_desc.dyn_tree = s->dyn_dtree; + s->d_desc.stat_desc = &static_d_desc; + + s->bl_desc.dyn_tree = s->bl_tree; + s->bl_desc.stat_desc = &static_bl_desc; + + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef DEBUG + s->compressed_len = 0L; + s->bits_sent = 0L; +#endif + + /* Initialize the first block of the first file: */ + init_block(s); +} + +/* =========================================================================== + * Initialize a new block. + */ +local void init_block(s) + deflate_state *s; +{ + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->last_lit = s->matches = 0; +} + +#define SMALLEST 1 +/* Index within the heap array of least frequent node in the Huffman tree */ + + +/* =========================================================================== + * Remove the smallest element from the heap and recreate the heap with + * one less element. Updates heap and heap_len. + */ +#define pqremove(s, tree, top) \ +{\ + top = s->heap[SMALLEST]; \ + s->heap[SMALLEST] = s->heap[s->heap_len--]; \ + pqdownheap(s, tree, SMALLEST); \ +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +#define smaller(tree, n, m, depth) \ + (tree[n].Freq < tree[m].Freq || \ + (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +local void pqdownheap(s, tree, k) + deflate_state *s; + ct_data *tree; /* the tree to restore */ + int k; /* node to move down */ +{ + int v = s->heap[k]; + int j = k << 1; /* left son of k */ + while (j <= s->heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s->heap_len && + smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s->heap[j], s->depth)) break; + + /* Exchange v with the smallest son */ + s->heap[k] = s->heap[j]; k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s->heap[k] = v; +} + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +local void gen_bitlen(s, desc) + deflate_state *s; + tree_desc *desc; /* the tree descriptor */ +{ + ct_data *tree = desc->dyn_tree; + int max_code = desc->max_code; + const ct_data *stree = desc->stat_desc->static_tree; + const intf *extra = desc->stat_desc->extra_bits; + int base = desc->stat_desc->extra_base; + int max_length = desc->stat_desc->max_length; + int h; /* heap index */ + int n, m; /* iterate over the tree elements */ + int bits; /* bit length */ + int xbits; /* extra bits */ + ush f; /* frequency */ + int overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ + + for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + n = s->heap[h]; + bits = tree[tree[n].Dad].Len + 1; + if (bits > max_length) bits = max_length, overflow++; + tree[n].Len = (ush)bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) continue; /* not a leaf node */ + + s->bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n].Freq; + s->opt_len += (ulg)f * (bits + xbits); + if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); + } + if (overflow == 0) return; + + Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (s->bl_count[bits] == 0) bits--; + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits != 0; bits--) { + n = s->bl_count[bits]; + while (n != 0) { + m = s->heap[--h]; + if (m > max_code) continue; + if ((unsigned) tree[m].Len != (unsigned) bits) { + Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((long)bits - (long)tree[m].Len) + *(long)tree[m].Freq; + tree[m].Len = (ush)bits; + } + n--; + } + } +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes (tree, max_code, bl_count) + ct_data *tree; /* the tree to decorate */ + int max_code; /* largest code with non zero frequency */ + ushf *bl_count; /* number of codes at each bit length */ +{ + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + ush code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits-1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; + const ct_data *stree = desc->stat_desc->static_tree; + int elems = desc->stat_desc->elems; + int n, m; /* iterate over heap elements */ + int max_code = -1; /* largest code with non zero frequency */ + int node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s->heap_len = 0, s->heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n].Freq != 0) { + s->heap[++(s->heap_len)] = max_code = n; + s->depth[n] = 0; + } else { + tree[n].Len = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s->heap_len < 2) { + node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); + tree[node].Freq = 1; + s->depth[node] = 0; + s->opt_len--; if (stree) s->static_len -= stree[node].Len; + /* node is 0 or 1 so it does not have extra bits */ + } + desc->max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + pqremove(s, tree, n); /* n = node of least frequency */ + m = s->heap[SMALLEST]; /* m = node of next least frequency */ + + s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ + s->heap[--(s->heap_max)] = m; + + /* Create a new node father of n and m */ + tree[node].Freq = tree[n].Freq + tree[m].Freq; + s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? + s->depth[n] : s->depth[m]) + 1); + tree[n].Dad = tree[m].Dad = (ush)node; +#ifdef DUMP_BL_TREE + if (tree == s->bl_tree) { + fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", + node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); + } +#endif + /* and insert the new node in the heap */ + s->heap[SMALLEST] = node++; + pqdownheap(s, tree, SMALLEST); + + } while (s->heap_len >= 2); + + s->heap[--(s->heap_max)] = s->heap[SMALLEST]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, (tree_desc *)desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes ((ct_data *)tree, max_code, s->bl_count); +} + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +local void scan_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + if (nextlen == 0) max_count = 138, min_count = 3; + tree[max_code+1].Len = (ush)0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + s->bl_tree[curlen].Freq += count; + } else if (curlen != 0) { + if (curlen != prevlen) s->bl_tree[curlen].Freq++; + s->bl_tree[REP_3_6].Freq++; + } else if (count <= 10) { + s->bl_tree[REPZ_3_10].Freq++; + } else { + s->bl_tree[REPZ_11_138].Freq++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +local void send_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen == 0) max_count = 138, min_count = 3; + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + do { send_code(s, curlen, s->bl_tree); } while (--count != 0); + + } else if (curlen != 0) { + if (curlen != prevlen) { + send_code(s, curlen, s->bl_tree); count--; + } + Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + + } else { + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +local int build_bl_tree(s) + deflate_state *s; +{ + int max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); + scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, (tree_desc *)(&(s->bl_desc))); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; + } + /* Update opt_len to include the bit length tree and counts */ + s->opt_len += 3*(max_blindex+1) + 5+5+4; + Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + s->opt_len, s->static_len)); + + return max_blindex; +} + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +local void send_all_trees(s, lcodes, dcodes, blcodes) + deflate_state *s; + int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + int rank; /* index in bl_order */ + + Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + "too many codes"); + Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes-1, 5); + send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); + } + Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + +/* =========================================================================== + * Send a stored block + */ +void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) + deflate_state *s; + charf *buf; /* input block */ + ulg stored_len; /* length of input block */ + int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ +#ifdef DEBUG + s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; + s->compressed_len += (stored_len + 4) << 3; +#endif + copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ +} + +/* =========================================================================== + * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) + */ +void ZLIB_INTERNAL _tr_flush_bits(s) + deflate_state *s; +{ + bi_flush(s); +} + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +void ZLIB_INTERNAL _tr_align(s) + deflate_state *s; +{ + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef DEBUG + s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ +#endif + bi_flush(s); +} + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) + deflate_state *s; + charf *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ + int last; /* one if this is the last block for a file */ +{ + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + int max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s->level > 0) { + + /* Check if the file is binary or text */ + if (s->strm->data_type == Z_UNKNOWN) + s->strm->data_type = detect_data_type(s); + + /* Construct the literal and distance trees */ + build_tree(s, (tree_desc *)(&(s->l_desc))); + Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + + build_tree(s, (tree_desc *)(&(s->d_desc))); + Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s->opt_len+3+7)>>3; + static_lenb = (s->static_len+3+7)>>3; + + Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + s->last_lit)); + + if (static_lenb <= opt_lenb) opt_lenb = static_lenb; + + } else { + Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + +#ifdef FORCE_STORED + if (buf != (char*)0) { /* force stored block */ +#else + if (stored_len+4 <= opt_lenb && buf != (char*)0) { + /* 4: two words for the lengths */ +#endif + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + +#ifdef FORCE_STATIC + } else if (static_lenb >= 0) { /* force static trees */ +#else + } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { +#endif + send_bits(s, (STATIC_TREES<<1)+last, 3); + compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->static_len; +#endif + } else { + send_bits(s, (DYN_TREES<<1)+last, 3); + send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, + max_blindex+1); + compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->opt_len; +#endif + } + Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); +#ifdef DEBUG + s->compressed_len += 7; /* align on byte boundary */ +#endif + } + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +int ZLIB_INTERNAL _tr_tally (s, dist, lc) + deflate_state *s; + unsigned dist; /* distance of matched string */ + unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + s->d_buf[s->last_lit] = (ush)dist; + s->l_buf[s->last_lit++] = (uch)lc; + if (dist == 0) { + /* lc is the unmatched char */ + s->dyn_ltree[lc].Freq++; + } else { + s->matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + Assert((ush)dist < (ush)MAX_DIST(s) && + (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; + s->dyn_dtree[d_code(dist)].Freq++; + } + +#ifdef TRUNCATE_BLOCK + /* Try to guess if it is profitable to stop the current block here */ + if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { + /* Compute an upper bound for the compressed length */ + ulg out_length = (ulg)s->last_lit*8L; + ulg in_length = (ulg)((long)s->strstart - s->block_start); + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (ulg)s->dyn_dtree[dcode].Freq * + (5L+extra_dbits[dcode]); + } + out_length >>= 3; + Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", + s->last_lit, in_length, out_length, + 100L - out_length*100L/in_length)); + if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; + } +#endif + return (s->last_lit == s->lit_bufsize-1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(s, ltree, dtree) + deflate_state *s; + ct_data *ltree; /* literal tree */ + ct_data *dtree; /* distance tree */ +{ + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned lx = 0; /* running index in l_buf */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->last_lit != 0) do { + dist = s->d_buf[lx]; + lc = s->l_buf[lx++]; + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + "pendingBuf overflow"); + + } while (lx < s->last_lit); + + send_code(s, END_BLOCK, ltree); +} + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +local int detect_data_type(s) + deflate_state *s; +{ + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + unsigned long black_mask = 0xf3ffc07fUL; + int n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>= 1) + if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) + return Z_BINARY; + + /* Check for textual ("white-listed") bytes. */ + if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 + || s->dyn_ltree[13].Freq != 0) + return Z_TEXT; + for (n = 32; n < LITERALS; n++) + if (s->dyn_ltree[n].Freq != 0) + return Z_TEXT; + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +local unsigned bi_reverse(code, len) + unsigned code; /* the value to invert */ + int len; /* its bit length */ +{ + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +local void bi_flush(s) + deflate_state *s; +{ + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +local void bi_windup(s) + deflate_state *s; +{ + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef DEBUG + s->bits_sent = (s->bits_sent+7) & ~7; +#endif +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +local void copy_block(s, buf, len, header) + deflate_state *s; + charf *buf; /* the input data */ + unsigned len; /* its length */ + int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, (ush)len); + put_short(s, (ush)~len); +#ifdef DEBUG + s->bits_sent += 2*16; +#endif + } +#ifdef DEBUG + s->bits_sent += (ulg)len<<3; +#endif + while (len--) { + put_byte(s, *buf++); + } +} diff --git a/thirdparty/zlib/zlib-1.2.7/trees.h b/thirdparty/zlib/zlib-1.2.7/trees.h new file mode 100644 index 0000000..d35639d --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/trees.h @@ -0,0 +1,128 @@ +/* header created automatically with -DGEN_TREES_H */ + +local const ct_data static_ltree[L_CODES+2] = { +{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, +{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, +{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, +{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, +{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, +{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, +{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, +{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, +{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, +{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, +{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, +{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, +{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, +{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, +{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, +{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, +{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, +{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, +{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, +{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, +{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, +{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, +{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, +{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, +{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, +{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, +{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, +{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, +{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, +{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, +{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, +{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, +{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, +{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, +{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, +{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, +{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, +{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, +{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, +{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, +{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, +{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, +{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, +{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, +{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, +{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, +{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, +{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, +{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, +{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, +{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, +{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, +{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, +{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, +{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, +{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, +{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, +{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} +}; + +local const ct_data static_dtree[D_CODES] = { +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} +}; + +const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 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, 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, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 +}; + +const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 +}; + +local const int base_length[LENGTH_CODES] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, +64, 80, 96, 112, 128, 160, 192, 224, 0 +}; + +local const int base_dist[D_CODES] = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 +}; + diff --git a/thirdparty/zlib/zlib-1.2.7/uncompr.c b/thirdparty/zlib/zlib-1.2.7/uncompr.c new file mode 100644 index 0000000..ad98be3 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/uncompr.c @@ -0,0 +1,59 @@ +/* uncompr.c -- decompress a memory buffer + * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#define ZLIB_INTERNAL +#include "zlib.h" + +/* =========================================================================== + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted. +*/ +int ZEXPORT uncompress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + z_stream stream; + int err; + + stream.next_in = (Bytef*)source; + stream.avail_in = (uInt)sourceLen; + /* Check for source > 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; + + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + + err = inflateInit(&stream); + if (err != Z_OK) return err; + + err = inflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + inflateEnd(&stream); + if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) + return Z_DATA_ERROR; + return err; + } + *destLen = stream.total_out; + + err = inflateEnd(&stream); + return err; +} diff --git a/thirdparty/zlib/zlib-1.2.7/watcom/watcom_f.mak b/thirdparty/zlib/zlib-1.2.7/watcom/watcom_f.mak new file mode 100644 index 0000000..37f4d74 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/watcom/watcom_f.mak @@ -0,0 +1,43 @@ +# Makefile for zlib +# OpenWatcom flat model +# Last updated: 28-Dec-2005 + +# To use, do "wmake -f watcom_f.mak" + +C_SOURCE = adler32.c compress.c crc32.c deflate.c & + gzclose.c gzlib.c gzread.c gzwrite.c & + infback.c inffast.c inflate.c inftrees.c & + trees.c uncompr.c zutil.c + +OBJS = adler32.obj compress.obj crc32.obj deflate.obj & + gzclose.obj gzlib.obj gzread.obj gzwrite.obj & + infback.obj inffast.obj inflate.obj inftrees.obj & + trees.obj uncompr.obj zutil.obj + +CC = wcc386 +LINKER = wcl386 +CFLAGS = -zq -mf -3r -fp3 -s -bt=dos -oilrtfm -fr=nul -wx +ZLIB_LIB = zlib_f.lib + +.C.OBJ: + $(CC) $(CFLAGS) $[@ + +all: $(ZLIB_LIB) example.exe minigzip.exe + +$(ZLIB_LIB): $(OBJS) + wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj + wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj + wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj + wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj + wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj + +example.exe: $(ZLIB_LIB) example.obj + $(LINKER) -ldos32a -fe=example.exe example.obj $(ZLIB_LIB) + +minigzip.exe: $(ZLIB_LIB) minigzip.obj + $(LINKER) -ldos32a -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) + +clean: .SYMBOLIC + del *.obj + del $(ZLIB_LIB) + @echo Cleaning done diff --git a/thirdparty/zlib/zlib-1.2.7/watcom/watcom_l.mak b/thirdparty/zlib/zlib-1.2.7/watcom/watcom_l.mak new file mode 100644 index 0000000..193eed7 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/watcom/watcom_l.mak @@ -0,0 +1,43 @@ +# Makefile for zlib +# OpenWatcom large model +# Last updated: 28-Dec-2005 + +# To use, do "wmake -f watcom_l.mak" + +C_SOURCE = adler32.c compress.c crc32.c deflate.c & + gzclose.c gzlib.c gzread.c gzwrite.c & + infback.c inffast.c inflate.c inftrees.c & + trees.c uncompr.c zutil.c + +OBJS = adler32.obj compress.obj crc32.obj deflate.obj & + gzclose.obj gzlib.obj gzread.obj gzwrite.obj & + infback.obj inffast.obj inflate.obj inftrees.obj & + trees.obj uncompr.obj zutil.obj + +CC = wcc +LINKER = wcl +CFLAGS = -zq -ml -s -bt=dos -oilrtfm -fr=nul -wx +ZLIB_LIB = zlib_l.lib + +.C.OBJ: + $(CC) $(CFLAGS) $[@ + +all: $(ZLIB_LIB) example.exe minigzip.exe + +$(ZLIB_LIB): $(OBJS) + wlib -b -c $(ZLIB_LIB) -+adler32.obj -+compress.obj -+crc32.obj + wlib -b -c $(ZLIB_LIB) -+gzclose.obj -+gzlib.obj -+gzread.obj -+gzwrite.obj + wlib -b -c $(ZLIB_LIB) -+deflate.obj -+infback.obj + wlib -b -c $(ZLIB_LIB) -+inffast.obj -+inflate.obj -+inftrees.obj + wlib -b -c $(ZLIB_LIB) -+trees.obj -+uncompr.obj -+zutil.obj + +example.exe: $(ZLIB_LIB) example.obj + $(LINKER) -fe=example.exe example.obj $(ZLIB_LIB) + +minigzip.exe: $(ZLIB_LIB) minigzip.obj + $(LINKER) -fe=minigzip.exe minigzip.obj $(ZLIB_LIB) + +clean: .SYMBOLIC + del *.obj + del $(ZLIB_LIB) + @echo Cleaning done diff --git a/thirdparty/zlib/zlib-1.2.7/win32/DLL_FAQ.txt b/thirdparty/zlib/zlib-1.2.7/win32/DLL_FAQ.txt new file mode 100644 index 0000000..12c0090 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/DLL_FAQ.txt @@ -0,0 +1,397 @@ + + Frequently Asked Questions about ZLIB1.DLL + + +This document describes the design, the rationale, and the usage +of the official DLL build of zlib, named ZLIB1.DLL. If you have +general questions about zlib, you should see the file "FAQ" found +in the zlib distribution, or at the following location: + http://www.gzip.org/zlib/zlib_faq.html + + + 1. What is ZLIB1.DLL, and how can I get it? + + - ZLIB1.DLL is the official build of zlib as a DLL. + (Please remark the character '1' in the name.) + + Pointers to a precompiled ZLIB1.DLL can be found in the zlib + web site at: + http://www.zlib.net/ + + Applications that link to ZLIB1.DLL can rely on the following + specification: + + * The exported symbols are exclusively defined in the source + files "zlib.h" and "zlib.def", found in an official zlib + source distribution. + * The symbols are exported by name, not by ordinal. + * The exported names are undecorated. + * The calling convention of functions is "C" (CDECL). + * The ZLIB1.DLL binary is linked to MSVCRT.DLL. + + The archive in which ZLIB1.DLL is bundled contains compiled + test programs that must run with a valid build of ZLIB1.DLL. + It is recommended to download the prebuilt DLL from the zlib + web site, instead of building it yourself, to avoid potential + incompatibilities that could be introduced by your compiler + and build settings. If you do build the DLL yourself, please + make sure that it complies with all the above requirements, + and it runs with the precompiled test programs, bundled with + the original ZLIB1.DLL distribution. + + If, for any reason, you need to build an incompatible DLL, + please use a different file name. + + + 2. Why did you change the name of the DLL to ZLIB1.DLL? + What happened to the old ZLIB.DLL? + + - The old ZLIB.DLL, built from zlib-1.1.4 or earlier, required + compilation settings that were incompatible to those used by + a static build. The DLL settings were supposed to be enabled + by defining the macro ZLIB_DLL, before including "zlib.h". + Incorrect handling of this macro was silently accepted at + build time, resulting in two major problems: + + * ZLIB_DLL was missing from the old makefile. When building + the DLL, not all people added it to the build options. In + consequence, incompatible incarnations of ZLIB.DLL started + to circulate around the net. + + * When switching from using the static library to using the + DLL, applications had to define the ZLIB_DLL macro and + to recompile all the sources that contained calls to zlib + functions. Failure to do so resulted in creating binaries + that were unable to run with the official ZLIB.DLL build. + + The only possible solution that we could foresee was to make + a binary-incompatible change in the DLL interface, in order to + remove the dependency on the ZLIB_DLL macro, and to release + the new DLL under a different name. + + We chose the name ZLIB1.DLL, where '1' indicates the major + zlib version number. We hope that we will not have to break + the binary compatibility again, at least not as long as the + zlib-1.x series will last. + + There is still a ZLIB_DLL macro, that can trigger a more + efficient build and use of the DLL, but compatibility no + longer dependents on it. + + + 3. Can I build ZLIB.DLL from the new zlib sources, and replace + an old ZLIB.DLL, that was built from zlib-1.1.4 or earlier? + + - In principle, you can do it by assigning calling convention + keywords to the macros ZEXPORT and ZEXPORTVA. In practice, + it depends on what you mean by "an old ZLIB.DLL", because the + old DLL exists in several mutually-incompatible versions. + You have to find out first what kind of calling convention is + being used in your particular ZLIB.DLL build, and to use the + same one in the new build. If you don't know what this is all + about, you might be better off if you would just leave the old + DLL intact. + + + 4. Can I compile my application using the new zlib interface, and + link it to an old ZLIB.DLL, that was built from zlib-1.1.4 or + earlier? + + - The official answer is "no"; the real answer depends again on + what kind of ZLIB.DLL you have. Even if you are lucky, this + course of action is unreliable. + + If you rebuild your application and you intend to use a newer + version of zlib (post- 1.1.4), it is strongly recommended to + link it to the new ZLIB1.DLL. + + + 5. Why are the zlib symbols exported by name, and not by ordinal? + + - Although exporting symbols by ordinal is a little faster, it + is risky. Any single glitch in the maintenance or use of the + DEF file that contains the ordinals can result in incompatible + builds and frustrating crashes. Simply put, the benefits of + exporting symbols by ordinal do not justify the risks. + + Technically, it should be possible to maintain ordinals in + the DEF file, and still export the symbols by name. Ordinals + exist in every DLL, and even if the dynamic linking performed + at the DLL startup is searching for names, ordinals serve as + hints, for a faster name lookup. However, if the DEF file + contains ordinals, the Microsoft linker automatically builds + an implib that will cause the executables linked to it to use + those ordinals, and not the names. It is interesting to + notice that the GNU linker for Win32 does not suffer from this + problem. + + It is possible to avoid the DEF file if the exported symbols + are accompanied by a "__declspec(dllexport)" attribute in the + source files. You can do this in zlib by predefining the + ZLIB_DLL macro. + + + 6. I see that the ZLIB1.DLL functions use the "C" (CDECL) calling + convention. Why not use the STDCALL convention? + STDCALL is the standard convention in Win32, and I need it in + my Visual Basic project! + + (For readability, we use CDECL to refer to the convention + triggered by the "__cdecl" keyword, STDCALL to refer to + the convention triggered by "__stdcall", and FASTCALL to + refer to the convention triggered by "__fastcall".) + + - Most of the native Windows API functions (without varargs) use + indeed the WINAPI convention (which translates to STDCALL in + Win32), but the standard C functions use CDECL. If a user + application is intrinsically tied to the Windows API (e.g. + it calls native Windows API functions such as CreateFile()), + sometimes it makes sense to decorate its own functions with + WINAPI. But if ANSI C or POSIX portability is a goal (e.g. + it calls standard C functions such as fopen()), it is not a + sound decision to request the inclusion of , or to + use non-ANSI constructs, for the sole purpose to make the user + functions STDCALL-able. + + The functionality offered by zlib is not in the category of + "Windows functionality", but is more like "C functionality". + + Technically, STDCALL is not bad; in fact, it is slightly + faster than CDECL, and it works with variable-argument + functions, just like CDECL. It is unfortunate that, in spite + of using STDCALL in the Windows API, it is not the default + convention used by the C compilers that run under Windows. + The roots of the problem reside deep inside the unsafety of + the K&R-style function prototypes, where the argument types + are not specified; but that is another story for another day. + + The remaining fact is that CDECL is the default convention. + Even if an explicit convention is hard-coded into the function + prototypes inside C headers, problems may appear. The + necessity to expose the convention in users' callbacks is one + of these problems. + + The calling convention issues are also important when using + zlib in other programming languages. Some of them, like Ada + (GNAT) and Fortran (GNU G77), have C bindings implemented + initially on Unix, and relying on the C calling convention. + On the other hand, the pre- .NET versions of Microsoft Visual + Basic require STDCALL, while Borland Delphi prefers, although + it does not require, FASTCALL. + + In fairness to all possible uses of zlib outside the C + programming language, we choose the default "C" convention. + Anyone interested in different bindings or conventions is + encouraged to maintain specialized projects. The "contrib/" + directory from the zlib distribution already holds a couple + of foreign bindings, such as Ada, C++, and Delphi. + + + 7. I need a DLL for my Visual Basic project. What can I do? + + - Define the ZLIB_WINAPI macro before including "zlib.h", when + building both the DLL and the user application (except that + you don't need to define anything when using the DLL in Visual + Basic). The ZLIB_WINAPI macro will switch on the WINAPI + (STDCALL) convention. The name of this DLL must be different + than the official ZLIB1.DLL. + + Gilles Vollant has contributed a build named ZLIBWAPI.DLL, + with the ZLIB_WINAPI macro turned on, and with the minizip + functionality built in. For more information, please read + the notes inside "contrib/vstudio/readme.txt", found in the + zlib distribution. + + + 8. I need to use zlib in my Microsoft .NET project. What can I + do? + + - Henrik Ravn has contributed a .NET wrapper around zlib. Look + into contrib/dotzlib/, inside the zlib distribution. + + + 9. If my application uses ZLIB1.DLL, should I link it to + MSVCRT.DLL? Why? + + - It is not required, but it is recommended to link your + application to MSVCRT.DLL, if it uses ZLIB1.DLL. + + The executables (.EXE, .DLL, etc.) that are involved in the + same process and are using the C run-time library (i.e. they + are calling standard C functions), must link to the same + library. There are several libraries in the Win32 system: + CRTDLL.DLL, MSVCRT.DLL, the static C libraries, etc. + Since ZLIB1.DLL is linked to MSVCRT.DLL, the executables that + depend on it should also be linked to MSVCRT.DLL. + + +10. Why are you saying that ZLIB1.DLL and my application should + be linked to the same C run-time (CRT) library? I linked my + application and my DLLs to different C libraries (e.g. my + application to a static library, and my DLLs to MSVCRT.DLL), + and everything works fine. + + - If a user library invokes only pure Win32 API (accessible via + and the related headers), its DLL build will work + in any context. But if this library invokes standard C API, + things get more complicated. + + There is a single Win32 library in a Win32 system. Every + function in this library resides in a single DLL module, that + is safe to call from anywhere. On the other hand, there are + multiple versions of the C library, and each of them has its + own separate internal state. Standalone executables and user + DLLs that call standard C functions must link to a C run-time + (CRT) library, be it static or shared (DLL). Intermixing + occurs when an executable (not necessarily standalone) and a + DLL are linked to different CRTs, and both are running in the + same process. + + Intermixing multiple CRTs is possible, as long as their + internal states are kept intact. The Microsoft Knowledge Base + articles KB94248 "HOWTO: Use the C Run-Time" and KB140584 + "HOWTO: Link with the Correct C Run-Time (CRT) Library" + mention the potential problems raised by intermixing. + + If intermixing works for you, it's because your application + and DLLs are avoiding the corruption of each of the CRTs' + internal states, maybe by careful design, or maybe by fortune. + + Also note that linking ZLIB1.DLL to non-Microsoft CRTs, such + as those provided by Borland, raises similar problems. + + +11. Why are you linking ZLIB1.DLL to MSVCRT.DLL? + + - MSVCRT.DLL exists on every Windows 95 with a new service pack + installed, or with Microsoft Internet Explorer 4 or later, and + on all other Windows 4.x or later (Windows 98, Windows NT 4, + or later). It is freely distributable; if not present in the + system, it can be downloaded from Microsoft or from other + software provider for free. + + The fact that MSVCRT.DLL does not exist on a virgin Windows 95 + is not so problematic. Windows 95 is scarcely found nowadays, + Microsoft ended its support a long time ago, and many recent + applications from various vendors, including Microsoft, do not + even run on it. Furthermore, no serious user should run + Windows 95 without a proper update installed. + + +12. Why are you not linking ZLIB1.DLL to + <> ? + + - We considered and abandoned the following alternatives: + + * Linking ZLIB1.DLL to a static C library (LIBC.LIB, or + LIBCMT.LIB) is not a good option. People are using the DLL + mainly to save disk space. If you are linking your program + to a static C library, you may as well consider linking zlib + in statically, too. + + * Linking ZLIB1.DLL to CRTDLL.DLL looks appealing, because + CRTDLL.DLL is present on every Win32 installation. + Unfortunately, it has a series of problems: it does not + work properly with Microsoft's C++ libraries, it does not + provide support for 64-bit file offsets, (and so on...), + and Microsoft discontinued its support a long time ago. + + * Linking ZLIB1.DLL to MSVCR70.DLL or MSVCR71.DLL, supplied + with the Microsoft .NET platform, and Visual C++ 7.0/7.1, + raises problems related to the status of ZLIB1.DLL as a + system component. According to the Microsoft Knowledge Base + article KB326922 "INFO: Redistribution of the Shared C + Runtime Component in Visual C++ .NET", MSVCR70.DLL and + MSVCR71.DLL are not supposed to function as system DLLs, + because they may clash with MSVCRT.DLL. Instead, the + application's installer is supposed to put these DLLs + (if needed) in the application's private directory. + If ZLIB1.DLL depends on a non-system runtime, it cannot + function as a redistributable system component. + + * Linking ZLIB1.DLL to non-Microsoft runtimes, such as + Borland's, or Cygwin's, raises problems related to the + reliable presence of these runtimes on Win32 systems. + It's easier to let the DLL build of zlib up to the people + who distribute these runtimes, and who may proceed as + explained in the answer to Question 14. + + +13. If ZLIB1.DLL cannot be linked to MSVCR70.DLL or MSVCR71.DLL, + how can I build/use ZLIB1.DLL in Microsoft Visual C++ 7.0 + (Visual Studio .NET) or newer? + + - Due to the problems explained in the Microsoft Knowledge Base + article KB326922 (see the previous answer), the C runtime that + comes with the VC7 environment is no longer considered a + system component. That is, it should not be assumed that this + runtime exists, or may be installed in a system directory. + Since ZLIB1.DLL is supposed to be a system component, it may + not depend on a non-system component. + + In order to link ZLIB1.DLL and your application to MSVCRT.DLL + in VC7, you need the library of Visual C++ 6.0 or older. If + you don't have this library at hand, it's probably best not to + use ZLIB1.DLL. + + We are hoping that, in the future, Microsoft will provide a + way to build applications linked to a proper system runtime, + from the Visual C++ environment. Until then, you have a + couple of alternatives, such as linking zlib in statically. + If your application requires dynamic linking, you may proceed + as explained in the answer to Question 14. + + +14. I need to link my own DLL build to a CRT different than + MSVCRT.DLL. What can I do? + + - Feel free to rebuild the DLL from the zlib sources, and link + it the way you want. You should, however, clearly state that + your build is unofficial. You should give it a different file + name, and/or install it in a private directory that can be + accessed by your application only, and is not visible to the + others (i.e. it's neither in the PATH, nor in the SYSTEM or + SYSTEM32 directories). Otherwise, your build may clash with + applications that link to the official build. + + For example, in Cygwin, zlib is linked to the Cygwin runtime + CYGWIN1.DLL, and it is distributed under the name CYGZ.DLL. + + +15. May I include additional pieces of code that I find useful, + link them in ZLIB1.DLL, and export them? + + - No. A legitimate build of ZLIB1.DLL must not include code + that does not originate from the official zlib source code. + But you can make your own private DLL build, under a different + file name, as suggested in the previous answer. + + For example, zlib is a part of the VCL library, distributed + with Borland Delphi and C++ Builder. The DLL build of VCL + is a redistributable file, named VCLxx.DLL. + + +16. May I remove some functionality out of ZLIB1.DLL, by enabling + macros like NO_GZCOMPRESS or NO_GZIP at compile time? + + - No. A legitimate build of ZLIB1.DLL must provide the complete + zlib functionality, as implemented in the official zlib source + code. But you can make your own private DLL build, under a + different file name, as suggested in the previous answer. + + +17. I made my own ZLIB1.DLL build. Can I test it for compliance? + + - We prefer that you download the official DLL from the zlib + web site. If you need something peculiar from this DLL, you + can send your suggestion to the zlib mailing list. + + However, in case you do rebuild the DLL yourself, you can run + it with the test programs found in the DLL distribution. + Running these test programs is not a guarantee of compliance, + but a failure can imply a detected problem. + +** + +This document is written and maintained by +Cosmin Truta diff --git a/thirdparty/zlib/zlib-1.2.7/win32/Makefile.bor b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.bor new file mode 100644 index 0000000..d152bbb --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.bor @@ -0,0 +1,110 @@ +# Makefile for zlib +# Borland C++ for Win32 +# +# Usage: +# make -f win32/Makefile.bor +# make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj + +# ------------ Borland C++ ------------ + +# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) +# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or +# added to the declaration of LOC here: +LOC = $(LOCAL_ZLIB) + +CC = bcc32 +AS = bcc32 +LD = bcc32 +AR = tlib +CFLAGS = -a -d -k- -O2 $(LOC) +ASFLAGS = $(LOC) +LDFLAGS = $(LOC) + + +# variables +ZLIB_LIB = zlib.lib + +OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj +OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj +#OBJA = +OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj +OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj +#OBJPA= + + +# targets +all: $(ZLIB_LIB) example.exe minigzip.exe + +.c.obj: + $(CC) -c $(CFLAGS) $< + +.asm.obj: + $(AS) -c $(ASFLAGS) $< + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + + +# For the sake of the old Borland make, +# the command line is cut to fit in the MS-DOS 128 byte limit: +$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) + -del $(ZLIB_LIB) + $(AR) $(ZLIB_LIB) $(OBJP1) + $(AR) $(ZLIB_LIB) $(OBJP2) + $(AR) $(ZLIB_LIB) $(OBJPA) + + +# testing +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +example.exe: example.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) + +minigzip.exe: minigzip.obj $(ZLIB_LIB) + $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) + + +# cleanup +clean: + -del $(ZLIB_LIB) + -del *.obj + -del *.exe + -del *.tds + -del zlib.bak + -del foo.gz diff --git a/thirdparty/zlib/zlib-1.2.7/win32/Makefile.gcc b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.gcc new file mode 100644 index 0000000..6d1ded6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.gcc @@ -0,0 +1,182 @@ +# Makefile for zlib, derived from Makefile.dj2. +# Modified for mingw32 by C. Spieler, 6/16/98. +# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003. +# Last updated: Mar 2012. +# Tested under Cygwin and MinGW. + +# Copyright (C) 1995-2003 Jean-loup Gailly. +# For conditions of distribution and use, see copyright notice in zlib.h + +# To compile, or to compile and test, type from the top level zlib directory: +# +# make -fwin32/Makefile.gcc; make test testdll -fwin32/Makefile.gcc +# +# To use the asm code, type: +# cp contrib/asm?86/match.S ./match.S +# make LOC=-DASMV OBJA=match.o -fwin32/Makefile.gcc +# +# To install libz.a, zconf.h and zlib.h in the system directories, type: +# +# make install -fwin32/Makefile.gcc +# +# BINARY_PATH, INCLUDE_PATH and LIBRARY_PATH must be set. +# +# To install the shared lib, append SHARED_MODE=1 to the make command : +# +# make install -fwin32/Makefile.gcc SHARED_MODE=1 + +# Note: +# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN), +# the DLL name should be changed from "zlib1.dll". + +STATICLIB = libz.a +SHAREDLIB = zlib1.dll +IMPLIB = libz.dll.a + +# +# Set to 1 if shared object needs to be installed +# +SHARED_MODE=0 + +#LOC = -DASMV +#LOC = -DDEBUG -g + +PREFIX = +CC = $(PREFIX)gcc +CFLAGS = $(LOC) -O3 -Wall + +AS = $(CC) +ASFLAGS = $(LOC) -Wall + +LD = $(CC) +LDFLAGS = $(LOC) + +AR = $(PREFIX)ar +ARFLAGS = rcs + +RC = $(PREFIX)windres +RCFLAGS = --define GCC_WINDRES + +STRIP = $(PREFIX)strip + +CP = cp -fp +# If GNU install is available, replace $(CP) with install. +INSTALL = $(CP) +RM = rm -f + +prefix ?= /usr/local +exec_prefix = $(prefix) + +OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \ + gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o +OBJA = + +all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe + +test: example.exe minigzip.exe + ./example + echo hello world | ./minigzip | ./minigzip -d + +testdll: example_d.exe minigzip_d.exe + ./example_d + echo hello world | ./minigzip_d | ./minigzip_d -d + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +.S.o: + $(AS) $(ASFLAGS) -c -o $@ $< + +$(STATICLIB): $(OBJS) $(OBJA) + $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA) + +$(IMPLIB): $(SHAREDLIB) + +$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o + $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \ + -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o + $(STRIP) $@ + +example.exe: example.o $(STATICLIB) + $(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB) + $(STRIP) $@ + +minigzip.exe: minigzip.o $(STATICLIB) + $(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB) + $(STRIP) $@ + +example_d.exe: example.o $(IMPLIB) + $(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB) + $(STRIP) $@ + +minigzip_d.exe: minigzip.o $(IMPLIB) + $(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB) + $(STRIP) $@ + +example.o: test/example.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/example.c + +minigzip.o: test/minigzip.c zlib.h zconf.h + $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c + +zlibrc.o: win32/zlib1.rc + $(RC) $(RCFLAGS) -o $@ win32/zlib1.rc + +.PHONY: install uninstall clean + +install: zlib.h zconf.h $(STATICLIB) $(IMPLIB) + @if test -z "$(DESTDIR)$(INCLUDE_PATH)" -o -z "$(DESTDIR)$(LIBRARY_PATH)" -o -z "$(DESTDIR)$(BINARY_PATH)"; then \ + echo INCLUDE_PATH, LIBRARY_PATH, and BINARY_PATH must be specified; \ + exit 1; \ + fi + -@mkdir -p '$(DESTDIR)$(INCLUDE_PATH)' + -@mkdir -p '$(DESTDIR)$(LIBRARY_PATH)' '$(DESTDIR)$(LIBRARY_PATH)'/pkgconfig + -if [ "$(SHARED_MODE)" = "1" ]; then \ + mkdir -p '$(DESTDIR)$(BINARY_PATH)'; \ + $(INSTALL) $(SHAREDLIB) '$(DESTDIR)$(BINARY_PATH)'; \ + $(INSTALL) $(IMPLIB) '$(DESTDIR)$(LIBRARY_PATH)'; \ + fi + -$(INSTALL) zlib.h '$(DESTDIR)$(INCLUDE_PATH)' + -$(INSTALL) zconf.h '$(DESTDIR)$(INCLUDE_PATH)' + -$(INSTALL) $(STATICLIB) '$(DESTDIR)$(LIBRARY_PATH)' + sed \ + -e 's|@prefix@|${prefix}|g' \ + -e 's|@exec_prefix@|${exec_prefix}|g' \ + -e 's|@libdir@|$(LIBRARY_PATH)|g' \ + -e 's|@sharedlibdir@|$(LIBRARY_PATH)|g' \ + -e 's|@includedir@|$(INCLUDE_PATH)|g' \ + -e 's|@VERSION@|'`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' zlib.h`'|g' \ + zlib.pc.in > '$(DESTDIR)$(LIBRARY_PATH)'/pkgconfig/zlib.pc + +uninstall: + -if [ "$(SHARED_MODE)" = "1" ]; then \ + $(RM) '$(DESTDIR)$(BINARY_PATH)'/$(SHAREDLIB); \ + $(RM) '$(DESTDIR)$(LIBRARY_PATH)'/$(IMPLIB); \ + fi + -$(RM) '$(DESTDIR)$(INCLUDE_PATH)'/zlib.h + -$(RM) '$(DESTDIR)$(INCLUDE_PATH)'/zconf.h + -$(RM) '$(DESTDIR)$(LIBRARY_PATH)'/$(STATICLIB) + +clean: + -$(RM) $(STATICLIB) + -$(RM) $(SHAREDLIB) + -$(RM) $(IMPLIB) + -$(RM) *.o + -$(RM) *.exe + -$(RM) foo.gz + +adler32.o: zlib.h zconf.h +compress.o: zlib.h zconf.h +crc32.o: crc32.h zlib.h zconf.h +deflate.o: deflate.h zutil.h zlib.h zconf.h +gzclose.o: zlib.h zconf.h gzguts.h +gzlib.o: zlib.h zconf.h gzguts.h +gzread.o: zlib.h zconf.h gzguts.h +gzwrite.o: zlib.h zconf.h gzguts.h +inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h +inftrees.o: zutil.h zlib.h zconf.h inftrees.h +trees.o: deflate.h zutil.h zlib.h zconf.h trees.h +uncompr.o: zlib.h zconf.h +zutil.o: zutil.h zlib.h zconf.h diff --git a/thirdparty/zlib/zlib-1.2.7/win32/Makefile.msc b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.msc new file mode 100644 index 0000000..59bb0da --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/Makefile.msc @@ -0,0 +1,160 @@ +# Makefile for zlib using Microsoft (Visual) C +# zlib is copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler +# +# Usage: +# nmake -f win32/Makefile.msc (standard build) +# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build) +# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \ +# OBJA="inffas32.obj match686.obj" (use ASM code, x86) +# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." \ +# OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" (use ASM code, x64) + +# optional build flags +LOC = + +# variables +STATICLIB = zlib.lib +SHAREDLIB = zlib1.dll +IMPLIB = zdll.lib + +CC = cl +AS = ml +LD = link +AR = lib +RC = rc +CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC) +WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE +ASFLAGS = -coff -Zi $(LOC) +LDFLAGS = -nologo -debug -incremental:no -opt:ref +ARFLAGS = -nologo +RCFLAGS = /dWIN32 /r + +OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj \ + gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj +OBJA = + + +# targets +all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \ + example.exe minigzip.exe example_d.exe minigzip_d.exe + +$(STATICLIB): $(OBJS) $(OBJA) + $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA) + +$(IMPLIB): $(SHAREDLIB) + +$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res + $(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \ + -out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res + if exist $@.manifest \ + mt -nologo -manifest $@.manifest -outputresource:$@;2 + +example.exe: example.obj $(STATICLIB) + $(LD) $(LDFLAGS) example.obj $(STATICLIB) + if exist $@.manifest \ + mt -nologo -manifest $@.manifest -outputresource:$@;1 + +minigzip.exe: minigzip.obj $(STATICLIB) + $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB) + if exist $@.manifest \ + mt -nologo -manifest $@.manifest -outputresource:$@;1 + +example_d.exe: example.obj $(IMPLIB) + $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB) + if exist $@.manifest \ + mt -nologo -manifest $@.manifest -outputresource:$@;1 + +minigzip_d.exe: minigzip.obj $(IMPLIB) + $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB) + if exist $@.manifest \ + mt -nologo -manifest $@.manifest -outputresource:$@;1 + +.c.obj: + $(CC) -c $(WFLAGS) $(CFLAGS) $< + +{test}.c.obj: + $(CC) -c -I. $(WFLAGS) $(CFLAGS) $< + +{contrib/masmx64}.c.obj: + $(CC) -c $(WFLAGS) $(CFLAGS) $< + +{contrib/masmx64}.asm.obj: + $(AS) -c $(ASFLAGS) $< + +{contrib/masmx86}.asm.obj: + $(AS) -c $(ASFLAGS) $< + +adler32.obj: adler32.c zlib.h zconf.h + +compress.obj: compress.c zlib.h zconf.h + +crc32.obj: crc32.c zlib.h zconf.h crc32.h + +deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h + +gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h + +gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h + +gzread.obj: gzread.c zlib.h zconf.h gzguts.h + +gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h + +infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h + +inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ + inffast.h inffixed.h + +inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h + +trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h + +uncompr.obj: uncompr.c zlib.h zconf.h + +zutil.obj: zutil.c zutil.h zlib.h zconf.h + +gvmat64.obj: contrib\masmx64\gvmat64.asm + +inffasx64.obj: contrib\masmx64\inffasx64.asm + +inffas8664.obj: contrib\masmx64\inffas8664.c zutil.h zlib.h zconf.h \ + inftrees.h inflate.h inffast.h + +inffas32.obj: contrib\masmx86\inffas32.asm + +match686.obj: contrib\masmx86\match686.asm + +example.obj: test/example.c zlib.h zconf.h + +minigzip.obj: test/minigzip.c zlib.h zconf.h + +zlib1.res: win32/zlib1.rc + $(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc + + +# testing +test: example.exe minigzip.exe + example + echo hello world | minigzip | minigzip -d + +testdll: example_d.exe minigzip_d.exe + example_d + echo hello world | minigzip_d | minigzip_d -d + + +# cleanup +clean: + -del $(STATICLIB) + -del $(SHAREDLIB) + -del $(IMPLIB) + -del *.obj + -del *.res + -del *.exp + -del *.exe + -del *.pdb + -del *.manifest + -del foo.gz diff --git a/thirdparty/zlib/zlib-1.2.7/win32/README-WIN32.txt b/thirdparty/zlib/zlib-1.2.7/win32/README-WIN32.txt new file mode 100644 index 0000000..46c5923 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/README-WIN32.txt @@ -0,0 +1,103 @@ +ZLIB DATA COMPRESSION LIBRARY + +zlib 1.2.7 is a general purpose data compression library. All the code is +thread safe. The data format used by the zlib library is described by RFCs +(Request for Comments) 1950 to 1952 in the files +http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) +and rfc1952.txt (gzip format). + +All functions of the compression library are documented in the file zlib.h +(volunteer to write man pages welcome, contact zlib@gzip.org). Two compiled +examples are distributed in this package, example and minigzip. The example_d +and minigzip_d flavors validate that the zlib1.dll file is working correctly. + +Questions about zlib should be sent to . The zlib home page +is http://zlib.net/ . Before reporting a problem, please check this site to +verify that you have the latest version of zlib; otherwise get the latest +version and check whether the problem still exists or not. + +PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html +before asking for help. + + +Manifest: + +The package zlib-1.2.7-win32-x86.zip will contain the following files: + + README-WIN32.txt This document + ChangeLog Changes since previous zlib packages + DLL_FAQ.txt Frequently asked questions about zlib1.dll + zlib.3.pdf Documentation of this library in Adobe Acrobat format + + example.exe A statically-bound example (using zlib.lib, not the dll) + example.pdb Symbolic information for debugging example.exe + + example_d.exe A zlib1.dll bound example (using zdll.lib) + example_d.pdb Symbolic information for debugging example_d.exe + + minigzip.exe A statically-bound test program (using zlib.lib, not the dll) + minigzip.pdb Symbolic information for debugging minigzip.exe + + minigzip_d.exe A zlib1.dll bound test program (using zdll.lib) + minigzip_d.pdb Symbolic information for debugging minigzip_d.exe + + zlib.h Install these files into the compilers' INCLUDE path to + zconf.h compile programs which use zlib.lib or zdll.lib + + zdll.lib Install these files into the compilers' LIB path if linking + zdll.exp a compiled program to the zlib1.dll binary + + zlib.lib Install these files into the compilers' LIB path to link zlib + zlib.pdb into compiled programs, without zlib1.dll runtime dependency + (zlib.pdb provides debugging info to the compile time linker) + + zlib1.dll Install this binary shared library into the system PATH, or + the program's runtime directory (where the .exe resides) + zlib1.pdb Install in the same directory as zlib1.dll, in order to debug + an application crash using WinDbg or similar tools. + +All .pdb files above are entirely optional, but are very useful to a developer +attempting to diagnose program misbehavior or a crash. Many additional +important files for developers can be found in the zlib127.zip source package +available from http://zlib.net/ - review that package's README file for details. + + +Acknowledgments: + +The deflate format used by zlib was defined by Phil Katz. The deflate and +zlib specifications were written by L. Peter Deutsch. Thanks to all the +people who reported problems and suggested various improvements in zlib; they +are too numerous to cite here. + + +Copyright notice: + + (C) 1995-2012 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. diff --git a/thirdparty/zlib/zlib-1.2.7/win32/VisualC.txt b/thirdparty/zlib/zlib-1.2.7/win32/VisualC.txt new file mode 100644 index 0000000..579a5fc --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/VisualC.txt @@ -0,0 +1,3 @@ + +To build zlib using the Microsoft Visual C++ environment, +use the appropriate project from the projects/ directory. diff --git a/thirdparty/zlib/zlib-1.2.7/win32/zlib.def b/thirdparty/zlib/zlib-1.2.7/win32/zlib.def new file mode 100644 index 0000000..0489615 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/zlib.def @@ -0,0 +1,84 @@ +; zlib data compression library +EXPORTS +; basic functions + zlibVersion + deflate + deflateEnd + inflate + inflateEnd +; advanced functions + deflateSetDictionary + deflateCopy + deflateReset + deflateParams + deflateTune + deflateBound + deflatePending + deflatePrime + deflateSetHeader + inflateSetDictionary + inflateSync + inflateCopy + inflateReset + inflateReset2 + inflatePrime + inflateMark + inflateGetHeader + inflateBack + inflateBackEnd + zlibCompileFlags +; utility functions + compress + compress2 + compressBound + uncompress + gzopen + gzdopen + gzbuffer + gzsetparams + gzread + gzwrite + gzprintf + gzputs + gzgets + gzputc + gzgetc + gzungetc + gzflush + gzseek + gzrewind + gztell + gzoffset + gzeof + gzdirect + gzclose + gzclose_r + gzclose_w + gzerror + gzclearerr +; large file functions + gzopen64 + gzseek64 + gztell64 + gzoffset64 + adler32_combine64 + crc32_combine64 +; checksum functions + adler32 + crc32 + adler32_combine + crc32_combine +; various hacks, don't look :) + deflateInit_ + deflateInit2_ + inflateInit_ + inflateInit2_ + inflateBackInit_ + gzgetc_ + zError + inflateSyncPoint + get_crc_table + inflateUndermine + inflateResetKeep + deflateResetKeep + gzopen_w diff --git a/thirdparty/zlib/zlib-1.2.7/win32/zlib1.rc b/thirdparty/zlib/zlib-1.2.7/win32/zlib1.rc new file mode 100644 index 0000000..0d1d7ff --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/win32/zlib1.rc @@ -0,0 +1,40 @@ +#include +#include "../zlib.h" + +#ifdef GCC_WINDRES +VS_VERSION_INFO VERSIONINFO +#else +VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE +#endif + FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 + PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS 1 +#else + FILEFLAGS 0 +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + BEGIN + VALUE "FileDescription", "zlib data compression library\0" + VALUE "FileVersion", ZLIB_VERSION "\0" + VALUE "InternalName", "zlib1.dll\0" + VALUE "LegalCopyright", "(C) 1995-2006 Jean-loup Gailly & Mark Adler\0" + VALUE "OriginalFilename", "zlib1.dll\0" + VALUE "ProductName", "zlib\0" + VALUE "ProductVersion", ZLIB_VERSION "\0" + VALUE "Comments", "For more information visit http://www.zlib.net/\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/thirdparty/zlib/zlib-1.2.7/zconf.h b/thirdparty/zlib/zlib-1.2.7/zconf.h new file mode 100644 index 0000000..8a46a58 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zconf.h @@ -0,0 +1,506 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetHeader z_inflateGetHeader +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateResetKeep z_inflateResetKeep +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +/* ./configure may #define Z_U4 here */ + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# else +# if (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# else +# if (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +# endif +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_STDARG_H +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#ifdef _WIN32 +# include /* for wchar_t */ +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) +# define Z_HAVE_UNISTD_H +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/zconf.h.cmakein b/thirdparty/zlib/zlib-1.2.7/zconf.h.cmakein new file mode 100644 index 0000000..b6ca59a --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zconf.h.cmakein @@ -0,0 +1,508 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H +#cmakedefine Z_PREFIX +#cmakedefine Z_HAVE_UNISTD_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetHeader z_inflateGetHeader +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateResetKeep z_inflateResetKeep +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +/* ./configure may #define Z_U4 here */ + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# else +# if (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# else +# if (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +# endif +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_STDARG_H +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#ifdef _WIN32 +# include /* for wchar_t */ +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) +# define Z_HAVE_UNISTD_H +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/zconf.h.in b/thirdparty/zlib/zlib-1.2.7/zconf.h.in new file mode 100644 index 0000000..8a46a58 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zconf.h.in @@ -0,0 +1,506 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetHeader z_inflateGetHeader +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateResetKeep z_inflateResetKeep +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +/* ./configure may #define Z_U4 here */ + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# else +# if (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# else +# if (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +# endif +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_STDARG_H +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#ifdef _WIN32 +# include /* for wchar_t */ +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) +# define Z_HAVE_UNISTD_H +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.3 b/thirdparty/zlib/zlib-1.2.7/zlib.3 new file mode 100644 index 0000000..79d3402 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.3 @@ -0,0 +1,151 @@ +.TH ZLIB 3 "2 May 2012" +.SH NAME +zlib \- compression/decompression library +.SH SYNOPSIS +[see +.I zlib.h +for full description] +.SH DESCRIPTION +The +.I zlib +library is a general purpose data compression library. +The code is thread safe, assuming that the standard library functions +used are thread safe, such as memory allocation routines. +It provides in-memory compression and decompression functions, +including integrity checks of the uncompressed data. +This version of the library supports only one compression method (deflation) +but other algorithms may be added later +with the same stream interface. +.LP +Compression can be done in a single step if the buffers are large enough +or can be done by repeated calls of the compression function. +In the latter case, +the application must provide more input and/or consume the output +(providing more output space) before each call. +.LP +The library also supports reading and writing files in +.IR gzip (1) +(.gz) format +with an interface similar to that of stdio. +.LP +The library does not install any signal handler. +The decoder checks the consistency of the compressed data, +so the library should never crash even in the case of corrupted input. +.LP +All functions of the compression library are documented in the file +.IR zlib.h . +The distribution source includes examples of use of the library +in the files +.I test/example.c +and +.IR test/minigzip.c, +as well as other examples in the +.IR examples/ +directory. +.LP +Changes to this version are documented in the file +.I ChangeLog +that accompanies the source. +.LP +.I zlib +is available in Java using the java.util.zip package: +.IP +http://java.sun.com/developer/technicalArticles/Programming/compression/ +.LP +A Perl interface to +.IR zlib , +written by Paul Marquess (pmqs@cpan.org), +is available at CPAN (Comprehensive Perl Archive Network) sites, +including: +.IP +http://search.cpan.org/~pmqs/IO-Compress-Zlib/ +.LP +A Python interface to +.IR zlib , +written by A.M. Kuchling (amk@magnet.com), +is available in Python 1.5 and later versions: +.IP +http://docs.python.org/library/zlib.html +.LP +.I zlib +is built into +.IR tcl: +.IP +http://wiki.tcl.tk/4610 +.LP +An experimental package to read and write files in .zip format, +written on top of +.I zlib +by Gilles Vollant (info@winimage.com), +is available at: +.IP +http://www.winimage.com/zLibDll/minizip.html +and also in the +.I contrib/minizip +directory of the main +.I zlib +source distribution. +.SH "SEE ALSO" +The +.I zlib +web site can be found at: +.IP +http://zlib.net/ +.LP +The data format used by the zlib library is described by RFC +(Request for Comments) 1950 to 1952 in the files: +.IP +http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer format) +.br +http://tools.ietf.org/html/rfc1951 (for the deflate compressed data format) +.br +http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer format) +.LP +Mark Nelson wrote an article about +.I zlib +for the Jan. 1997 issue of Dr. Dobb's Journal; +a copy of the article is available at: +.IP +http://marknelson.us/1997/01/01/zlib-engine/ +.SH "REPORTING PROBLEMS" +Before reporting a problem, +please check the +.I zlib +web site to verify that you have the latest version of +.IR zlib ; +otherwise, +obtain the latest version and see if the problem still exists. +Please read the +.I zlib +FAQ at: +.IP +http://zlib.net/zlib_faq.html +.LP +before asking for help. +Send questions and/or comments to zlib@gzip.org, +or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). +.SH AUTHORS +Version 1.2.7 +Copyright (C) 1995-2012 Jean-loup Gailly (jloup@gzip.org) +and Mark Adler (madler@alumni.caltech.edu). +.LP +This software is provided "as-is," +without any express or implied warranty. +In no event will the authors be held liable for any damages +arising from the use of this software. +See the distribution directory with respect to requirements +governing redistribution. +The deflate format used by +.I zlib +was defined by Phil Katz. +The deflate and +.I zlib +specifications were written by L. Peter Deutsch. +Thanks to all the people who reported problems and suggested various +improvements in +.IR zlib ; +who are too numerous to cite here. +.LP +UNIX manual page by R. P. C. Rodgers, +U.S. National Library of Medicine (rodgers@nlm.nih.gov). +.\" end of man page diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.3.pdf b/thirdparty/zlib/zlib-1.2.7/zlib.3.pdf new file mode 100644 index 0000000..485306c Binary files /dev/null and b/thirdparty/zlib/zlib-1.2.7/zlib.3.pdf differ diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.h b/thirdparty/zlib/zlib-1.2.7/zlib.h new file mode 100644 index 0000000..3edf3ac --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.h @@ -0,0 +1,1744 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.7, May 2nd, 2012 + + Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.7" +#define ZLIB_VERNUM 0x1270 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 7 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use in the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). Some + output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed code + block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the stream + are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least the + value returned by deflateBound (see below). Then deflate is guaranteed to + return Z_STREAM_END. If not enough output space is provided, deflate will + not return Z_STREAM_END, and it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered + binary. This field is only for information purposes and does not affect the + compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not + fatal, and deflate() can be called again with more input and more output + space to continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the + exact value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit() does not process any header information -- that is deferred + until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing will + resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + Also to assist in this, on return inflate() will set strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed adler32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained, so applications that need that information should + instead use raw inflate, see inflateInit2() below, or inflateBack() and + perform their own processing of the gzip header and trailer. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + producted so far. The CRC-32 is checked against the gzip trailer. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, + Z_BUF_ERROR if no progress is possible or if there was not enough room in the + output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is desired. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by the + caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute an adler32 check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + adler32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. The + stream will keep the same compression level and any other attributes that + may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression level is changed, the input available so far is + compressed with the old level (and may be flushed); the new level will take + effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to be + compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if + strm->avail_out was zero. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an adler32 or a crc32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + crc32 instead of an adler32. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the adler32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above or -1 << 16 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is more efficient than inflate() for + file i/o applications in that it avoids copying between the output and the + sliding window by simply making the window itself the output buffer. This + function trusts the application to not change the output buffer passed by + the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the normal + behavior of inflate(), which expects either a zlib or gzip header and + trailer around the deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero--buf is ignored in that + case--and inflateBack() will return a buffer error. inflateBack() will call + out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() + should return zero on success, or non-zero on failure. If out() returns + non-zero, inflateBack() will return with an error. Neither in() nor out() + are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed buffer. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Opens a gzip (.gz) file for reading or writing. The mode parameter is as + in fopen ("rb" or "wb") but can also include a compression level ("wb9") or + a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only + compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' + for fixed code compression as in "wb9F". (See the description of + deflateInit2 for more information about the strategy parameter.) 'T' will + request transparent writing or appending with no compression and not using + the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen associates a gzFile with the file descriptor fd. File descriptors + are obtained from calls like open, dup, creat, pipe or fileno (if the file + has been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions. The + default buffer size is 8192 bytes. This function must be called after + gzopen() or gzdopen(), and before any other calls that read or write the + file. The buffer memory allocation is always deferred to the first read or + write. Two buffers are allocated, either both of the specified size when + writing, or one of the specified size and the other twice that size when + reading. A larger buffer size of, for example, 64K or 128K bytes will + noticeably increase the speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + voidpc buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes written or 0 in case of + error. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the arguments to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or 0 in case of error. The number of + uncompressed bytes written is limited to 8191, or one less than the buffer + size given to gzbuffer(). The caller should assure that this limit is not + exceeded. If it is exceeded, then gzprintf() will return an error (0) with + nothing written. In this case, there may also be a buffer overflow with + unpredictable consequences, which is possible only if zlib was compiled with + the insecure functions sprintf() or vsprintf() because the secure snprintf() + or vsnprintf() functions were not available. This can be determined using + zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or a + newline character is read and transferred to buf, or an end-of-file + condition is encountered. If any characters are read or if len == 1, the + string is terminated with a null character. If no characters are read due + to an end-of-file or len < 1, then the buffer is left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push one character back onto the stream to be read as the first character + on the next read. At least one character of push-back is allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter flush + is as in the deflate() function. The return value is the zlib error number + (see function gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatented gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Sets the starting position for the next gzread or gzwrite on the given + compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Returns the starting position for the next gzread or gzwrite on the given + compressed file. This position represents a number of bytes in the + uncompressed data stream, and is zero when starting, even if appending or + reading a gzip stream from the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Returns the current offset in the file being read or written. This offset + includes the count of bytes that precede the gzip stream, for example when + appending or when using gzdopen() for reading. When reading, the offset + does not include as yet unused buffered input. This information can be used + for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns true (1) if the end-of-file indicator has been set while reading, + false (0) otherwise. Note that the end-of-file indicator is set only if the + read tried to go past the end of the input, but came up short. Therefore, + just like feof(), gzeof() may return false even if there is no more data to + read, in the event that the last read request was for the exact number of + bytes remaining in the input file. This will happen if the input file size + is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Returns true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file and + deallocates the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the given + compressed file. errnum is set to zlib error number. If an error occurred + in the file system and not in the compression library, errnum is set to + Z_ERRNO and the application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clears the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is Z_NULL, this function returns the + required initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. If buf is Z_NULL, this function returns the required + initial value for the crc. Pre- and post-conditioning (one's complement) is + performed within this function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +#define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + +#endif /* !Z_SOLO */ + +/* hack for buggy compilers */ +#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; +#endif + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.map b/thirdparty/zlib/zlib-1.2.7/zlib.map new file mode 100644 index 0000000..771f420 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.map @@ -0,0 +1,78 @@ +ZLIB_1.2.0 { + global: + compressBound; + deflateBound; + inflateBack; + inflateBackEnd; + inflateBackInit_; + inflateCopy; + local: + deflate_copyright; + inflate_copyright; + inflate_fast; + inflate_table; + zcalloc; + zcfree; + z_errmsg; + gz_error; + gz_intmax; + _*; +}; + +ZLIB_1.2.0.2 { + gzclearerr; + gzungetc; + zlibCompileFlags; +} ZLIB_1.2.0; + +ZLIB_1.2.0.8 { + deflatePrime; +} ZLIB_1.2.0.2; + +ZLIB_1.2.2 { + adler32_combine; + crc32_combine; + deflateSetHeader; + inflateGetHeader; +} ZLIB_1.2.0.8; + +ZLIB_1.2.2.3 { + deflateTune; + gzdirect; +} ZLIB_1.2.2; + +ZLIB_1.2.2.4 { + inflatePrime; +} ZLIB_1.2.2.3; + +ZLIB_1.2.3.3 { + adler32_combine64; + crc32_combine64; + gzopen64; + gzseek64; + gztell64; + inflateUndermine; +} ZLIB_1.2.2.4; + +ZLIB_1.2.3.4 { + inflateReset2; + inflateMark; +} ZLIB_1.2.3.3; + +ZLIB_1.2.3.5 { + gzbuffer; + gzoffset; + gzoffset64; + gzclose_r; + gzclose_w; +} ZLIB_1.2.3.4; + +ZLIB_1.2.5.1 { + deflatePending; +} ZLIB_1.2.3.5; + +ZLIB_1.2.5.2 { + deflateResetKeep; + gzgetc_; + inflateResetKeep; +} ZLIB_1.2.5.1; diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.pc b/thirdparty/zlib/zlib-1.2.7/zlib.pc new file mode 100644 index 0000000..2ac9d7b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.pc @@ -0,0 +1,13 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: zlib +Description: zlib compression library +Version: 1.2.7 + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.pc.cmakein b/thirdparty/zlib/zlib-1.2.7/zlib.pc.cmakein new file mode 100644 index 0000000..a5e6429 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.pc.cmakein @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@INSTALL_LIB_DIR@ +sharedlibdir=@INSTALL_LIB_DIR@ +includedir=@INSTALL_INC_DIR@ + +Name: zlib +Description: zlib compression library +Version: @VERSION@ + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} diff --git a/thirdparty/zlib/zlib-1.2.7/zlib.pc.in b/thirdparty/zlib/zlib-1.2.7/zlib.pc.in new file mode 100644 index 0000000..7e5acf9 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +sharedlibdir=@sharedlibdir@ +includedir=@includedir@ + +Name: zlib +Description: zlib compression library +Version: @VERSION@ + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} diff --git a/thirdparty/zlib/zlib-1.2.7/zlib2ansi b/thirdparty/zlib/zlib-1.2.7/zlib2ansi new file mode 100644 index 0000000..15e3e16 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zlib2ansi @@ -0,0 +1,152 @@ +#!/usr/bin/perl + +# Transform K&R C function definitions into ANSI equivalent. +# +# Author: Paul Marquess +# Version: 1.0 +# Date: 3 October 2006 + +# TODO +# +# Asumes no function pointer parameters. unless they are typedefed. +# Assumes no literal strings that look like function definitions +# Assumes functions start at the beginning of a line + +use strict; +use warnings; + +local $/; +$_ = <>; + +my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments + +my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ; +my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ; +my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ; + + +while (s/^ + ( # Start $1 + ( # Start $2 + .*? # Minimal eat content + ( ^ \w [\w\s\*]+ ) # $3 -- function name + \s* # optional whitespace + ) # $2 - Matched up to before parameter list + + \( \s* # Literal "(" + optional whitespace + ( [^\)]+ ) # $4 - one or more anythings except ")" + \s* \) # optional whitespace surrounding a Literal ")" + + ( (?: $dList )+ ) # $5 + + $sp ^ { # literal "{" at start of line + ) # Remember to $1 + //xsom + ) +{ + my $all = $1 ; + my $prefix = $2; + my $param_list = $4 ; + my $params = $5; + + StripComments($params); + StripComments($param_list); + $param_list =~ s/^\s+//; + $param_list =~ s/\s+$//; + + my $i = 0 ; + my %pList = map { $_ => $i++ } + split /\s*,\s*/, $param_list; + my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ; + + my @params = split /\s*;\s*/, $params; + my @outParams = (); + foreach my $p (@params) + { + if ($p =~ /,/) + { + my @bits = split /\s*,\s*/, $p; + my $first = shift @bits; + $first =~ s/^\s*//; + push @outParams, $first; + $first =~ /^(\w+\s*)/; + my $type = $1 ; + push @outParams, map { $type . $_ } @bits; + } + else + { + $p =~ s/^\s+//; + push @outParams, $p; + } + } + + + my %tmp = map { /$pMatch/; $_ => $pList{$1} } + @outParams ; + + @outParams = map { " $_" } + sort { $tmp{$a} <=> $tmp{$b} } + @outParams ; + + print $prefix ; + print "(\n" . join(",\n", @outParams) . ")\n"; + print "{" ; + +} + +# Output any trailing code. +print ; +exit 0; + + +sub StripComments +{ + + no warnings; + + # Strip C & C++ coments + # From the perlfaq + $_[0] =~ + + s{ + /\* ## Start of /* ... */ comment + [^*]*\*+ ## Non-* followed by 1-or-more *'s + ( + [^/*][^*]*\*+ + )* ## 0-or-more things which don't start with / + ## but do end with '*' + / ## End of /* ... */ comment + + | ## OR C++ Comment + // ## Start of C++ comment // + [^\n]* ## followed by 0-or-more non end of line characters + + | ## OR various things which aren't comments: + + ( + " ## Start of " ... " string + ( + \\. ## Escaped char + | ## OR + [^"\\] ## Non "\ + )* + " ## End of " ... " string + + | ## OR + + ' ## Start of ' ... ' string + ( + \\. ## Escaped char + | ## OR + [^'\\] ## Non '\ + )* + ' ## End of ' ... ' string + + | ## OR + + . ## Anything other char + [^/"'\\]* ## Chars which doesn't start a comment, string or escape + ) + }{$2}gxs; + +} diff --git a/thirdparty/zlib/zlib-1.2.7/zutil.c b/thirdparty/zlib/zlib-1.2.7/zutil.c new file mode 100644 index 0000000..65e0d3b --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zutil.c @@ -0,0 +1,324 @@ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zutil.h" +#ifndef Z_SOLO +# include "gzguts.h" +#endif + +#ifndef NO_DUMMY_DECL +struct internal_state {int dummy;}; /* for buggy compilers */ +#endif + +const char * const z_errmsg[10] = { +"need dictionary", /* Z_NEED_DICT 2 */ +"stream end", /* Z_STREAM_END 1 */ +"", /* Z_OK 0 */ +"file error", /* Z_ERRNO (-1) */ +"stream error", /* Z_STREAM_ERROR (-2) */ +"data error", /* Z_DATA_ERROR (-3) */ +"insufficient memory", /* Z_MEM_ERROR (-4) */ +"buffer error", /* Z_BUF_ERROR (-5) */ +"incompatible version",/* Z_VERSION_ERROR (-6) */ +""}; + + +const char * ZEXPORT zlibVersion() +{ + return ZLIB_VERSION; +} + +uLong ZEXPORT zlibCompileFlags() +{ + uLong flags; + + flags = 0; + switch ((int)(sizeof(uInt))) { + case 2: break; + case 4: flags += 1; break; + case 8: flags += 2; break; + default: flags += 3; + } + switch ((int)(sizeof(uLong))) { + case 2: break; + case 4: flags += 1 << 2; break; + case 8: flags += 2 << 2; break; + default: flags += 3 << 2; + } + switch ((int)(sizeof(voidpf))) { + case 2: break; + case 4: flags += 1 << 4; break; + case 8: flags += 2 << 4; break; + default: flags += 3 << 4; + } + switch ((int)(sizeof(z_off_t))) { + case 2: break; + case 4: flags += 1 << 6; break; + case 8: flags += 2 << 6; break; + default: flags += 3 << 6; + } +#ifdef DEBUG + flags += 1 << 8; +#endif +#if defined(ASMV) || defined(ASMINF) + flags += 1 << 9; +#endif +#ifdef ZLIB_WINAPI + flags += 1 << 10; +#endif +#ifdef BUILDFIXED + flags += 1 << 12; +#endif +#ifdef DYNAMIC_CRC_TABLE + flags += 1 << 13; +#endif +#ifdef NO_GZCOMPRESS + flags += 1L << 16; +#endif +#ifdef NO_GZIP + flags += 1L << 17; +#endif +#ifdef PKZIP_BUG_WORKAROUND + flags += 1L << 20; +#endif +#ifdef FASTEST + flags += 1L << 21; +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifdef NO_vsnprintf + flags += 1L << 25; +# ifdef HAS_vsprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_vsnprintf_void + flags += 1L << 26; +# endif +# endif +#else + flags += 1L << 24; +# ifdef NO_snprintf + flags += 1L << 25; +# ifdef HAS_sprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_snprintf_void + flags += 1L << 26; +# endif +# endif +#endif + return flags; +} + +#ifdef DEBUG + +# ifndef verbose +# define verbose 0 +# endif +int ZLIB_INTERNAL z_verbose = verbose; + +void ZLIB_INTERNAL z_error (m) + char *m; +{ + fprintf(stderr, "%s\n", m); + exit(1); +} +#endif + +/* exported to allow conversion of error code to string for compress() and + * uncompress() + */ +const char * ZEXPORT zError(err) + int err; +{ + return ERR_MSG(err); +} + +#if defined(_WIN32_WCE) + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. + */ + int errno = 0; +#endif + +#ifndef HAVE_MEMCPY + +void ZLIB_INTERNAL zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int ZLIB_INTERNAL zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void ZLIB_INTERNAL zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + +#ifndef Z_SOLO + +#ifdef SYS16BIT + +#ifdef __TURBOC__ +/* Turbo C in 16-bit mode */ + +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} + +#endif /* __TURBOC__ */ + + +#ifdef M_I86 +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* M_I86 */ + +#endif /* SYS16BIT */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif + +voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + (voidpf)calloc(items, size); +} + +void ZLIB_INTERNAL zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ + +#endif /* !Z_SOLO */ diff --git a/thirdparty/zlib/zlib-1.2.7/zutil.h b/thirdparty/zlib/zlib-1.2.7/zutil.h new file mode 100644 index 0000000..4e3dcc6 --- /dev/null +++ b/thirdparty/zlib/zlib-1.2.7/zutil.h @@ -0,0 +1,252 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2012 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef ZUTIL_H +#define ZUTIL_H + +#ifdef HAVE_HIDDEN +# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +#else +# define ZLIB_INTERNAL +#endif + +#include "zlib.h" + +#if defined(STDC) && !defined(Z_SOLO) +# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) +# include +# endif +# include +# include +#endif + +#ifdef Z_SOLO + typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) +# define OS_CODE 0x00 +# ifndef Z_SOLO +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +# endif +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +# if defined(M_I86) && !defined(Z_SOLO) +# include +# endif +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# ifndef Z_SOLO +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +# endif +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#ifdef WIN32 +# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ +# define OS_CODE 0x0b +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0f +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX +# if defined(_WIN32_WCE) +# define fdopen(fd,mode) NULL /* No fdopen() */ +# ifndef _PTRDIFF_T_DEFINED + typedef int ptrdiff_t; +# define _PTRDIFF_T_DEFINED +# endif +# else +# define fdopen(fd,type) _fdopen(fd,type) +# endif +#endif + +#if defined(__BORLANDC__) && !defined(MSDOS) + #pragma warn -8004 + #pragma warn -8008 + #pragma warn -8066 +#endif + +/* provide prototypes for these when building zlib without LFS */ +#if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +#endif + + /* common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#if defined(pyr) || defined(Z_SOLO) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int ZLIB_INTERNAL z_verbose; + extern void ZLIB_INTERNAL z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + +#ifndef Z_SOLO + voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, + unsigned size)); + void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); +#endif + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +/* Reverse the bytes in a 32-bit value */ +#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +#endif /* ZUTIL_H */